diff --git a/.gitignore b/.gitignore index 809a717c00..fa00778214 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *.exe *.o +*.i *.elf *.gba *.1bpp @@ -7,10 +8,13 @@ *.8bpp *.gbapal *.lz +*.rl *.latfont *.hwjpnfont *.fwjpnfont pokeas pokeld pokeobjcopy -genasm/* +src/*.s +tools/agbcc +*.map diff --git a/Makefile b/Makefile index 038ad5d67d..d67648afe1 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,18 @@ -AS := pokeas +AS := $(DEVKITARM)/bin/arm-none-eabi-as ASFLAGS := -mcpu=arm7tdmi -CC := gbacc -CFLAGS := -mthumb-interwork -O2 -Iinclude +CC1 := tools/agbcc/bin/agbcc +CFLAGS := -mthumb-interwork -O2 + +CPP := $(DEVKITARM)/bin/arm-none-eabi-cpp +CPPFLAGS := -I tools/agbcc/include -iquote include -nostdinc -undef + +LD := $(DEVKITARM)/bin/arm-none-eabi-ld +LDFLAGS := -T ld_script.txt -T iwram_syms.txt -T ewram_syms.txt -Map pokeemerald.map + +OBJCOPY := $(DEVKITARM)/bin/arm-none-eabi-objcopy + +LIBGCC := tools/agbcc/lib/libgcc.a SHA1 := sha1sum -c @@ -10,47 +20,73 @@ GFX := @tools/gbagfx/gbagfx SCANINC := tools/scaninc/scaninc +PREPROC := tools/preproc/preproc + # Clear the default suffixes. .SUFFIXES: # Secondary expansion is required for dependency variables in object rules. .SECONDEXPANSION: -.PRECIOUS: %.1bpp %.4bpp %.8bpp %.gbapal %.lz +.PRECIOUS: %.1bpp %.4bpp %.8bpp %.gbapal %.lz %.rl -.PHONY: rom tools gbagfx scaninc clean compare deps +.PHONY: rom clean compare tidy -CSRCS := $(wildcard src/*.c) -OBJS := asm/emerald.o +C_SRCS := $(wildcard src/*.c) +C_OBJS := $(C_SRCS:%.c=%.o) -$(foreach obj, $(OBJS), \ - $(eval $(obj)_deps := $(shell $(SCANINC) $(obj:.o=.s))) \ -) +ASM_OBJS := \ +asm/crt0.o \ +asm/main.o \ +asm/dma3_manager.o \ +asm/gpu_bg.o \ +asm/pixel_buffer.o \ +asm/window.o \ +asm/text_renderer.o \ +asm/gpu_obj.o \ +asm/string_util.o \ +asm/rom_80093CC.o \ +asm/rtc.o \ +asm/main_menu.o \ +asm/rom_8032654.o \ +asm/tileset_animation.o \ +asm/rom_80A18F4.o \ +asm/task.o \ +asm/rom_80A92F4.o \ +asm/multiboot.o \ +asm/rom_81BAD84.o \ +asm/libgcnmultiboot.o \ +asm/libmks4agb.o \ +asm/libagbbackup.o \ +asm/librtc.o \ +asm/librfu.o \ +asm/libagbsyscall.o \ +asm/libc.o + +DATA_ASM_OBJS := data/data1.o data/data2.o + +OBJS := $(C_OBJS) $(ASM_OBJS) $(DATA_ASM_OBJS) ROM := pokeemerald.gba ELF := $(ROM:.gba=.elf) rom: $(ROM) -tools: gbagfx scaninc - -gbagfx: - cd tools/gbagfx && make - -scaninc: - cd tools/scaninc && make - # For contributors to make sure a change didn't affect the contents of the ROM. compare: $(ROM) @$(SHA1) rom.sha1 clean: - $(RM) $(ROM) $(ELF) $(OBJS) - $(RM) genasm/* + rm -f $(ROM) $(ELF) $(OBJS) $(C_SRCS:%.c=%.i) pokeemerald.map find . \( -iname '*.1bpp' -o -iname '*.4bpp' -o -iname '*.8bpp' -o -iname '*.gbapal' -o -iname '*.lz' -o -iname '*.latfont' -o -iname '*.hwjpnfont' -o -iname '*.fwjpnfont' \) -exec rm {} + +tidy: + rm -f $(ROM) $(ELF) $(OBJS) $(C_SRCS:%.c=%.i) pokeemerald.map + include graphics_file_rules.mk +%.s: ; +%.bin: ; %.png: ; %.pal: ; %.1bpp: %.png ; $(GFX) $< $@ @@ -58,28 +94,32 @@ include graphics_file_rules.mk %.8bpp: %.png ; $(GFX) $< $@ %.gbapal: %.pal ; $(GFX) $< $@ %.lz: % ; $(GFX) $< $@ +%.rl: % ; $(GFX) $< $@ -$(OBJS): $(CSRCS:src/%.c=genasm/%.s) +src/siirtc.o: CFLAGS := -mthumb-interwork -# TODO: fix this .syntax hack +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 -genasm/prefix.tmp: - echo -e "\t.syntax divided" >$@ +src/m4a_2.o: CC1 := tools/agbcc/bin/old_agbcc +src/m4a_4.o: CC1 := tools/agbcc/bin/old_agbcc -genasm/suffix.tmp: - echo -e "\t.syntax unified" >$@ +$(C_OBJS): %.o : %.c + @$(CPP) $(CPPFLAGS) $< -o $*.i + @$(PREPROC) $*.i charmap.txt | $(CC1) $(CFLAGS) -o $*.s + @echo -e ".text\n\t.align\t2, 0\n" >> $*.s + $(AS) $(ASFLAGS) -o $@ $*.s -genasm/%.s: src/%.c genasm/prefix.tmp genasm/suffix.tmp - mkdir -p genasm - $(CC) $(CFLAGS) -o $@.tmp $< -S - cat genasm/prefix.tmp $@.tmp genasm/suffix.tmp >$@.tmp2 - perl fix_local_labels.pl $@.tmp2 $@ - $(RM) $@.tmp $@.tmp2 +%.o : dep = $(shell $(SCANINC) $*.s) -%.o: %.s $$($$@_deps) +$(ASM_OBJS): %.o: %.s $$(dep) $(AS) $(ASFLAGS) -o $@ $< +$(DATA_ASM_OBJS): %.o: %.s $$(dep) + $(PREPROC) $< charmap.txt | $(AS) $(ASFLAGS) -o $@ + # Link objects to produce the ROM. $(ROM): $(OBJS) - ./pokeld -T ld_script.txt -T wram_syms.txt -o $(ELF) $(OBJS) - ./pokeobjcopy -O binary $(ELF) $(ROM) + $(LD) $(LDFLAGS) -o $(ELF) $(OBJS) $(LIBGCC) + $(OBJCOPY) -O binary --gap-fill 0xFF --pad-to 0x9000000 $(ELF) $(ROM) diff --git a/asm/libc.s b/asm/libc.s new file mode 100644 index 0000000000..a7a233f83b --- /dev/null +++ b/asm/libc.s @@ -0,0 +1,213 @@ + .include "asm/macros.s" + + .syntax unified + + .text + + thumb_func_start memcpy +@ void *memcpy(void *dest, void *src, int size) +memcpy: @ 82E93D4 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r5, 0 + adds r3, r1, 0 + cmp r2, 0xF + bls _082E9414 + adds r0, r3, 0 + orrs r0, r5 + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _082E9414 + adds r1, r5, 0 +_082E93EE: + 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 _082E93EE + cmp r2, 0x3 + bls _082E9412 +_082E9408: + ldm r3!, {r0} + stm r1!, {r0} + subs r2, 0x4 + cmp r2, 0x3 + bhi _082E9408 +_082E9412: + adds r4, r1, 0 +_082E9414: + subs r2, 0x1 + movs r0, 0x1 + negs r0, r0 + cmp r2, r0 + beq _082E942E + adds r1, r0, 0 +_082E9420: + ldrb r0, [r3] + strb r0, [r4] + adds r3, 0x1 + adds r4, 0x1 + subs r2, 0x1 + cmp r2, r1 + bne _082E9420 +_082E942E: + adds r0, r5, 0 + pop {r4,r5,pc} + thumb_func_end memcpy + + thumb_func_start memset +@ void *memset(void *dest, char c, int size) +memset: @ 82E9434 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r3, r5, 0 + cmp r2, 0x3 + bls _082E947A + movs r0, 0x3 + ands r0, r5 + cmp r0, 0 + bne _082E947A + 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 _082E946E +_082E945A: + stm r1!, {r3} + stm r1!, {r3} + stm r1!, {r3} + stm r1!, {r3} + subs r2, 0x10 + cmp r2, 0xF + bhi _082E945A + b _082E946E +_082E946A: + stm r1!, {r3} + subs r2, 0x4 +_082E946E: + cmp r2, 0x3 + bhi _082E946A + adds r3, r1, 0 + b _082E947A +_082E9476: + strb r4, [r3] + adds r3, 0x1 +_082E947A: + adds r0, r2, 0 + subs r2, 0x1 + cmp r0, 0 + bne _082E9476 + adds r0, r5, 0 + pop {r4,r5,pc} + thumb_func_end memset + + thumb_func_start strcmp +@ int strcmp(char *s1, char *s2) +strcmp: @ 82E9488 + 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 _082E94CE + ldr r1, [r2] + ldr r0, [r3] + cmp r1, r0 + bne _082E94CE + ldr r5, _082E94B4 + ldr r4, _082E94B8 +_082E94A4: + ldr r1, [r2] + adds r0, r1, r5 + bics r0, r1 + ands r0, r4 + cmp r0, 0 + beq _082E94BC + movs r0, 0 + b _082E94E0 + .align 2, 0 +_082E94B4: .4byte 0xfefefeff +_082E94B8: .4byte 0x80808080 +_082E94BC: + adds r2, 0x4 + adds r3, 0x4 + ldr r1, [r2] + ldr r0, [r3] + cmp r1, r0 + beq _082E94A4 + b _082E94CE +_082E94CA: + adds r2, 0x1 + adds r3, 0x1 +_082E94CE: + ldrb r0, [r2] + cmp r0, 0 + beq _082E94DA + ldrb r1, [r3] + cmp r0, r1 + beq _082E94CA +_082E94DA: + ldrb r2, [r2] + ldrb r3, [r3] + subs r0, r2, r3 +_082E94E0: + pop {r4,r5,pc} + thumb_func_end strcmp + + thumb_func_start strcat +strcat: @ 82E94E4 + 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 _082E951C + ldr r1, [r2] + ldr r5, _082E9504 + adds r0, r1, r5 + bics r0, r1 + ldr r4, _082E9508 + b _082E9516 + .align 2, 0 +_082E9504: .4byte 0xfefefeff +_082E9508: .4byte 0x80808080 +_082E950C: + ldm r2!, {r0} + stm r3!, {r0} + ldr r1, [r2] + adds r0, r1, r5 + bics r0, r1 +_082E9516: + ands r0, r4 + cmp r0, 0 + beq _082E950C +_082E951C: + ldrb r0, [r2] + strb r0, [r3] + lsls r0, 24 + adds r2, 0x1 + adds r3, 0x1 + cmp r0, 0 + bne _082E951C + adds r0, r6, 0 + pop {r4-r6,pc} + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/libgcc.s b/asm/libgcc.s deleted file mode 100644 index 6e313ee1de..0000000000 --- a/asm/libgcc.s +++ /dev/null @@ -1,5238 +0,0 @@ - .include "asm/macros.s" - - .syntax unified - - .text - - thumb_func_start _call_via_r0 -_call_via_r0: @ 82E70D0 - bx r0 - mov r8, r8 - thumb_func_end _call_via_r0 - - thumb_func_start _call_via_r1 -_call_via_r1: @ 82E70D4 - bx r1 - mov r8, r8 - thumb_func_end _call_via_r1 - - thumb_func_start _call_via_r2 -_call_via_r2: @ 82E70D8 - bx r2 - mov r8, r8 - thumb_func_end _call_via_r2 - - thumb_func_start _call_via_r3 -_call_via_r3: @ 82E70DC - bx r3 - mov r8, r8 - thumb_func_end _call_via_r3 - - thumb_func_start _call_via_r4 -_call_via_r4: @ 82E70E0 - bx r4 - mov r8, r8 - thumb_func_end _call_via_r4 - - thumb_func_start _call_via_r5 -_call_via_r5: @ 82E70E4 - bx r5 - mov r8, r8 - thumb_func_end _call_via_r5 - - thumb_func_start _call_via_r6 -_call_via_r6: @ 82E70E8 - bx r6 - mov r8, r8 - thumb_func_end _call_via_r6 - - thumb_func_start _call_via_r7 -_call_via_r7: @ 82E70EC - bx r7 - mov r8, r8 - thumb_func_end _call_via_r7 - - thumb_func_start _call_via_r8 -_call_via_r8: @ 82E70F0 - bx r8 - mov r8, r8 - thumb_func_end _call_via_r8 - - thumb_func_start _call_via_r9 -_call_via_r9: @ 82E70F4 - bx r9 - mov r8, r8 - thumb_func_end _call_via_r9 - - thumb_func_start _call_via_sl -_call_via_sl: @ 82E70F8 - bx r10 - mov r8, r8 - thumb_func_end _call_via_sl - - thumb_func_start _call_via_fp -_call_via_fp: @ 82E70FC - bx r11 - mov r8, r8 - thumb_func_end _call_via_fp - - thumb_func_start _call_via_ip -_call_via_ip: @ 82E7100 - bx r12 - mov r8, r8 - thumb_func_end _call_via_ip - - thumb_func_start _call_via_sp -_call_via_sp: @ 82E7104 - bx sp - mov r8, r8 - thumb_func_end _call_via_sp - - thumb_func_start _call_via_lr -_call_via_lr: @ 82E7108 - bx lr - mov r8, r8 - thumb_func_end _call_via_lr - - thumb_func_start __divdi3 -__divdi3: @ 82E710C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x34 - movs r4, 0 - str r4, [sp] - adds r5, r1, 0 - adds r4, r0, 0 - cmp r5, 0 - bge _082E713C - ldr r0, [sp] - mvns r0, r0 - str r0, [sp] - negs r0, r4 - adds r6, r0, 0 - negs r1, r5 - cmp r0, 0 - beq _082E7136 - subs r1, 0x1 -_082E7136: - adds r7, r1, 0 - adds r5, r7, 0 - adds r4, r6, 0 -_082E713C: - cmp r3, 0 - bge _082E7158 - ldr r1, [sp] - mvns r1, r1 - str r1, [sp] - negs r0, r2 - str r0, [sp, 0x4] - negs r2, r3 - cmp r0, 0 - beq _082E7152 - subs r2, 0x1 -_082E7152: - str r2, [sp, 0x8] - ldr r2, [sp, 0x4] - ldr r3, [sp, 0x8] -_082E7158: - adds r7, r2, 0 - adds r6, r3, 0 - mov r10, r4 - mov r8, r5 - cmp r6, 0 - beq _082E7166 - b _082E73B4 -_082E7166: - cmp r7, r8 - bls _082E7240 - ldr r0, _082E717C - cmp r7, r0 - bhi _082E7180 - movs r1, 0 - cmp r7, 0xFF - bls _082E718A - movs r1, 0x8 - b _082E718A - .align 2, 0 -_082E717C: .4byte 0x0000ffff -_082E7180: - ldr r0, _082E7234 - movs r1, 0x18 - cmp r7, r0 - bhi _082E718A - movs r1, 0x10 -_082E718A: - ldr r0, _082E7238 - lsrs r2, r1 - adds r0, r2, r0 - ldrb r0, [r0] - adds r0, r1 - movs r1, 0x20 - subs r2, r1, r0 - cmp r2, 0 - beq _082E71B2 - lsls r7, r2 - mov r3, r8 - lsls r3, r2 - subs r1, r2 - mov r0, r10 - lsrs r0, r1 - orrs r3, r0 - mov r8, r3 - mov r4, r10 - lsls r4, r2 - mov r10, r4 -_082E71B2: - lsrs r0, r7, 16 - mov r9, r0 - ldr r1, _082E723C - ands r1, r7 - str r1, [sp, 0xC] - mov r0, r8 - mov r1, r9 - bl __umodsi3 - adds r4, r0, 0 - mov r0, r8 - mov r1, r9 - bl __udivsi3 - adds r6, r0, 0 - ldr r3, [sp, 0xC] - adds r2, r6, 0 - muls r2, r3 - lsls r4, 16 - mov r1, r10 - lsrs r0, r1, 16 - orrs r4, r0 - cmp r4, r2 - bcs _082E71F2 - subs r6, 0x1 - adds r4, r7 - cmp r4, r7 - bcc _082E71F2 - cmp r4, r2 - bcs _082E71F2 - subs r6, 0x1 - adds r4, r7 -_082E71F2: - subs r4, r2 - adds r0, r4, 0 - mov r1, r9 - bl __umodsi3 - adds r5, r0, 0 - adds r0, r4, 0 - mov r1, r9 - bl __udivsi3 - adds r1, r0, 0 - ldr r3, [sp, 0xC] - adds r2, r1, 0 - muls r2, r3 - lsls r5, 16 - ldr r0, _082E723C - mov r4, r10 - ands r4, r0 - orrs r5, r4 - cmp r5, r2 - bcs _082E722A - subs r1, 0x1 - adds r5, r7 - cmp r5, r7 - bcc _082E722A - cmp r5, r2 - bcs _082E722A - subs r1, 0x1 -_082E722A: - lsls r6, 16 - orrs r6, r1 - movs r0, 0 - str r0, [sp, 0x10] - b _082E750A - .align 2, 0 -_082E7234: .4byte 0x00ffffff -_082E7238: .4byte gUnknown_089A3270 -_082E723C: .4byte 0x0000ffff -_082E7240: - cmp r2, 0 - bne _082E724E - movs r0, 0x1 - movs r1, 0 - bl __udivsi3 - adds r7, r0, 0 -_082E724E: - adds r1, r7, 0 - ldr r0, _082E7260 - cmp r7, r0 - bhi _082E7264 - movs r2, 0 - cmp r7, 0xFF - bls _082E726E - movs r2, 0x8 - b _082E726E - .align 2, 0 -_082E7260: .4byte 0x0000ffff -_082E7264: - ldr r0, _082E728C - movs r2, 0x18 - cmp r7, r0 - bhi _082E726E - movs r2, 0x10 -_082E726E: - ldr r0, _082E7290 - lsrs r1, r2 - adds r0, r1, r0 - ldrb r0, [r0] - adds r0, r2 - movs r1, 0x20 - subs r2, r1, r0 - cmp r2, 0 - bne _082E7294 - mov r1, r8 - subs r1, r7 - mov r8, r1 - movs r2, 0x1 - str r2, [sp, 0x10] - b _082E7332 - .align 2, 0 -_082E728C: .4byte 0x00ffffff -_082E7290: .4byte gUnknown_089A3270 -_082E7294: - subs r1, r2 - lsls r7, r2 - mov r5, r8 - lsrs r5, r1 - mov r3, r8 - lsls r3, r2 - mov r0, r10 - lsrs r0, r1 - orrs r3, r0 - mov r8, r3 - mov r4, r10 - lsls r4, r2 - mov r10, r4 - lsrs r0, r7, 16 - mov r9, r0 - ldr r1, _082E73B0 - ands r1, r7 - str r1, [sp, 0x14] - adds r0, r5, 0 - mov r1, r9 - bl __umodsi3 - adds r4, r0, 0 - adds r0, r5, 0 - mov r1, r9 - bl __udivsi3 - adds r6, r0, 0 - ldr r2, [sp, 0x14] - adds r1, r6, 0 - muls r1, r2 - lsls r4, 16 - mov r3, r8 - lsrs r0, r3, 16 - orrs r4, r0 - cmp r4, r1 - bcs _082E72EE - subs r6, 0x1 - adds r4, r7 - cmp r4, r7 - bcc _082E72EE - cmp r4, r1 - bcs _082E72EE - subs r6, 0x1 - adds r4, r7 -_082E72EE: - subs r4, r1 - adds r0, r4, 0 - mov r1, r9 - bl __umodsi3 - adds r5, r0, 0 - adds r0, r4, 0 - mov r1, r9 - bl __udivsi3 - adds r2, r0, 0 - ldr r4, [sp, 0x14] - adds r1, r2, 0 - muls r1, r4 - lsls r5, 16 - ldr r0, _082E73B0 - mov r3, r8 - ands r3, r0 - orrs r5, r3 - cmp r5, r1 - bcs _082E7328 - subs r2, 0x1 - adds r5, r7 - cmp r5, r7 - bcc _082E7328 - cmp r5, r1 - bcs _082E7328 - subs r2, 0x1 - adds r5, r7 -_082E7328: - lsls r6, 16 - orrs r6, r2 - str r6, [sp, 0x10] - subs r1, r5, r1 - mov r8, r1 -_082E7332: - lsrs r4, r7, 16 - mov r9, r4 - ldr r0, _082E73B0 - ands r0, r7 - str r0, [sp, 0x18] - mov r0, r8 - mov r1, r9 - bl __umodsi3 - adds r4, r0, 0 - mov r0, r8 - mov r1, r9 - bl __udivsi3 - adds r6, r0, 0 - ldr r1, [sp, 0x18] - adds r2, r6, 0 - muls r2, r1 - lsls r4, 16 - mov r3, r10 - lsrs r0, r3, 16 - orrs r4, r0 - cmp r4, r2 - bcs _082E7372 - subs r6, 0x1 - adds r4, r7 - cmp r4, r7 - bcc _082E7372 - cmp r4, r2 - bcs _082E7372 - subs r6, 0x1 - adds r4, r7 -_082E7372: - subs r4, r2 - adds r0, r4, 0 - mov r1, r9 - bl __umodsi3 - adds r5, r0, 0 - adds r0, r4, 0 - mov r1, r9 - bl __udivsi3 - adds r1, r0, 0 - ldr r4, [sp, 0x18] - adds r2, r1, 0 - muls r2, r4 - lsls r5, 16 - ldr r0, _082E73B0 - mov r3, r10 - ands r3, r0 - orrs r5, r3 - cmp r5, r2 - bcs _082E73AA - subs r1, 0x1 - adds r5, r7 - cmp r5, r7 - bcc _082E73AA - cmp r5, r2 - bcs _082E73AA - subs r1, 0x1 -_082E73AA: - lsls r6, 16 - orrs r6, r1 - b _082E750A - .align 2, 0 -_082E73B0: .4byte 0x0000ffff -_082E73B4: - cmp r6, r8 - bls _082E73C0 - movs r6, 0 - movs r4, 0 - str r4, [sp, 0x10] - b _082E750A -_082E73C0: - adds r1, r6, 0 - ldr r0, _082E73D4 - cmp r6, r0 - bhi _082E73D8 - movs r2, 0 - cmp r6, 0xFF - bls _082E73E2 - movs r2, 0x8 - b _082E73E2 - .align 2, 0 -_082E73D4: .4byte 0x0000ffff -_082E73D8: - ldr r0, _082E7404 - movs r2, 0x18 - cmp r6, r0 - bhi _082E73E2 - movs r2, 0x10 -_082E73E2: - ldr r0, _082E7408 - lsrs r1, r2 - adds r0, r1, r0 - ldrb r0, [r0] - adds r0, r2 - movs r1, 0x20 - subs r2, r1, r0 - cmp r2, 0 - bne _082E7410 - cmp r8, r6 - bhi _082E73FC - cmp r10, r7 - bcc _082E740C -_082E73FC: - movs r6, 0x1 - mov r1, r10 - b _082E7504 - .align 2, 0 -_082E7404: .4byte 0x00ffffff -_082E7408: .4byte gUnknown_089A3270 -_082E740C: - movs r6, 0 - b _082E7506 -_082E7410: - subs r1, r2 - lsls r6, r2 - adds r0, r7, 0 - lsrs r0, r1 - orrs r6, r0 - lsls r7, r2 - mov r5, r8 - lsrs r5, r1 - mov r3, r8 - lsls r3, r2 - mov r0, r10 - lsrs r0, r1 - orrs r3, r0 - mov r8, r3 - mov r4, r10 - lsls r4, r2 - mov r10, r4 - lsrs r0, r6, 16 - mov r9, r0 - ldr r1, _082E753C - ands r1, r6 - str r1, [sp, 0x1C] - adds r0, r5, 0 - mov r1, r9 - bl __umodsi3 - adds r4, r0, 0 - adds r0, r5, 0 - mov r1, r9 - bl __udivsi3 - adds r3, r0, 0 - ldr r2, [sp, 0x1C] - adds r1, r3, 0 - muls r1, r2 - lsls r4, 16 - mov r2, r8 - lsrs r0, r2, 16 - orrs r4, r0 - cmp r4, r1 - bcs _082E7472 - subs r3, 0x1 - adds r4, r6 - cmp r4, r6 - bcc _082E7472 - cmp r4, r1 - bcs _082E7472 - subs r3, 0x1 - adds r4, r6 -_082E7472: - subs r4, r1 - adds r0, r4, 0 - mov r1, r9 - str r3, [sp, 0x30] - bl __umodsi3 - adds r5, r0, 0 - adds r0, r4, 0 - mov r1, r9 - bl __udivsi3 - adds r2, r0, 0 - ldr r4, [sp, 0x1C] - adds r1, r2, 0 - muls r1, r4 - lsls r5, 16 - ldr r0, _082E753C - mov r4, r8 - ands r4, r0 - orrs r5, r4 - ldr r3, [sp, 0x30] - cmp r5, r1 - bcs _082E74B0 - subs r2, 0x1 - adds r5, r6 - cmp r5, r6 - bcc _082E74B0 - cmp r5, r1 - bcs _082E74B0 - subs r2, 0x1 - adds r5, r6 -_082E74B0: - lsls r6, r3, 16 - orrs r6, r2 - subs r1, r5, r1 - mov r8, r1 - ldr r0, _082E753C - mov r9, r0 - adds r1, r6, 0 - ands r1, r0 - lsrs r3, r6, 16 - adds r0, r7, 0 - mov r2, r9 - ands r0, r2 - lsrs r2, r7, 16 - adds r5, r1, 0 - muls r5, r0 - adds r4, r1, 0 - muls r4, r2 - adds r1, r3, 0 - muls r1, r0 - muls r3, r2 - lsrs r0, r5, 16 - adds r4, r0 - adds r4, r1 - cmp r4, r1 - bcs _082E74E8 - movs r0, 0x80 - lsls r0, 9 - adds r3, r0 -_082E74E8: - lsrs r0, r4, 16 - adds r3, r0 - mov r1, r9 - ands r4, r1 - lsls r0, r4, 16 - ands r5, r1 - adds r1, r0, r5 - cmp r3, r8 - bhi _082E7502 - cmp r3, r8 - bne _082E7506 - cmp r1, r10 - bls _082E7506 -_082E7502: - subs r6, 0x1 -_082E7504: - subs r0, r1, r7 -_082E7506: - movs r2, 0 - str r2, [sp, 0x10] -_082E750A: - str r6, [sp, 0x20] - ldr r3, [sp, 0x10] - str r3, [sp, 0x24] - ldr r1, [sp, 0x20] - ldr r2, [sp, 0x24] - ldr r4, [sp] - cmp r4, 0 - beq _082E752C - negs r0, r1 - str r0, [sp, 0x28] - negs r1, r2 - cmp r0, 0 - beq _082E7526 - subs r1, 0x1 -_082E7526: - str r1, [sp, 0x2C] - ldr r1, [sp, 0x28] - ldr r2, [sp, 0x2C] -_082E752C: - adds r0, r1, 0 - adds r1, r2, 0 - add sp, 0x34 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7,pc} - .align 2, 0 -_082E753C: .4byte 0x0000ffff - thumb_func_end __divdi3 - - thumb_func_start __divsi3 -@ int __divsi3(int dividend, int divisor) -__divsi3: @ 82E7540 - cmp r1, 0 - beq _082E75C8 - push {r4} - adds r4, r0, 0 - eors r4, r1 - mov r12, r4 - movs r3, 0x1 - movs r2, 0 - cmp r1, 0 - bpl _082E7556 - negs r1, r1 -_082E7556: - cmp r0, 0 - bpl _082E755C - negs r0, r0 -_082E755C: - cmp r0, r1 - bcc _082E75BA - movs r4, 0x1 - lsls r4, 28 -_082E7564: - cmp r1, r4 - bcs _082E7572 - cmp r1, r0 - bcs _082E7572 - lsls r1, 4 - lsls r3, 4 - b _082E7564 -_082E7572: - lsls r4, 3 -_082E7574: - cmp r1, r4 - bcs _082E7582 - cmp r1, r0 - bcs _082E7582 - lsls r1, 1 - lsls r3, 1 - b _082E7574 -_082E7582: - cmp r0, r1 - bcc _082E758A - subs r0, r1 - orrs r2, r3 -_082E758A: - lsrs r4, r1, 1 - cmp r0, r4 - bcc _082E7596 - subs r0, r4 - lsrs r4, r3, 1 - orrs r2, r4 -_082E7596: - lsrs r4, r1, 2 - cmp r0, r4 - bcc _082E75A2 - subs r0, r4 - lsrs r4, r3, 2 - orrs r2, r4 -_082E75A2: - lsrs r4, r1, 3 - cmp r0, r4 - bcc _082E75AE - subs r0, r4 - lsrs r4, r3, 3 - orrs r2, r4 -_082E75AE: - cmp r0, 0 - beq _082E75BA - lsrs r3, 4 - beq _082E75BA - lsrs r1, 4 - b _082E7582 -_082E75BA: - adds r0, r2, 0 - mov r4, r12 - cmp r4, 0 - bpl _082E75C4 - negs r0, r0 -_082E75C4: - pop {r4} - mov pc, lr -_082E75C8: - push {lr} - bl nullsub_1 - movs r0, 0 - pop {pc} - thumb_func_end __divsi3 - - thumb_func_start nullsub_1 -nullsub_1: @ 82E75D4 - mov pc, lr - thumb_func_end nullsub_1 - - thumb_func_start __fixunsdfsi -__fixunsdfsi: @ 82E75D8 - push {r4,r5,lr} - adds r5, r1, 0 - adds r4, r0, 0 - ldr r3, _082E75F8 - ldr r2, _082E75F4 - bl __gedf2 - cmp r0, 0 - bge _082E75FC - adds r1, r5, 0 - adds r0, r4, 0 - bl __fixdfsi - b _082E7612 - .align 2, 0 -_082E75F4: .4byte 0x41e00000 -_082E75F8: .4byte 0x00000000 -_082E75FC: - ldr r3, _082E7618 - ldr r2, _082E7614 - adds r1, r5, 0 - adds r0, r4, 0 - bl __adddf3 - bl __fixdfsi - movs r1, 0x80 - lsls r1, 24 - adds r0, r1 -_082E7612: - pop {r4,r5,pc} - .align 2, 0 -_082E7614: .4byte 0xc1e00000 -_082E7618: .4byte 0x00000000 - thumb_func_end __fixunsdfsi - - thumb_func_start __fixunssfsi -__fixunssfsi: @ 82E761C - push {r4,lr} - adds r4, r0, 0 - ldr r1, _082E7634 - bl __gesf2 - cmp r0, 0 - bge _082E7638 - adds r0, r4, 0 - bl __fixsfsi - b _082E764A - .align 2, 0 -_082E7634: .4byte 0x4f000000 -_082E7638: - ldr r1, _082E764C - adds r0, r4, 0 - bl __addsf3 - bl __fixsfsi - movs r1, 0x80 - lsls r1, 24 - adds r0, r1 -_082E764A: - pop {r4,pc} - .align 2, 0 -_082E764C: .4byte 0xcf000000 - thumb_func_end __fixunssfsi - - thumb_func_start __modsi3 -__modsi3: @ 82E7650 - movs r3, 0x1 - cmp r1, 0 - beq _082E7714 - bpl _082E765A - negs r1, r1 -_082E765A: - push {r4} - push {r0} - cmp r0, 0 - bpl _082E7664 - negs r0, r0 -_082E7664: - cmp r0, r1 - bcc _082E7708 - movs r4, 0x1 - lsls r4, 28 -_082E766C: - cmp r1, r4 - bcs _082E767A - cmp r1, r0 - bcs _082E767A - lsls r1, 4 - lsls r3, 4 - b _082E766C -_082E767A: - lsls r4, 3 -_082E767C: - cmp r1, r4 - bcs _082E768A - cmp r1, r0 - bcs _082E768A - lsls r1, 1 - lsls r3, 1 - b _082E767C -_082E768A: - movs r2, 0 - cmp r0, r1 - bcc _082E7692 - subs r0, r1 -_082E7692: - lsrs r4, r1, 1 - cmp r0, r4 - bcc _082E76A4 - subs r0, r4 - mov r12, r3 - movs r4, 0x1 - rors r3, r4 - orrs r2, r3 - mov r3, r12 -_082E76A4: - lsrs r4, r1, 2 - cmp r0, r4 - bcc _082E76B6 - subs r0, r4 - mov r12, r3 - movs r4, 0x2 - rors r3, r4 - orrs r2, r3 - mov r3, r12 -_082E76B6: - lsrs r4, r1, 3 - cmp r0, r4 - bcc _082E76C8 - subs r0, r4 - mov r12, r3 - movs r4, 0x3 - rors r3, r4 - orrs r2, r3 - mov r3, r12 -_082E76C8: - mov r12, r3 - cmp r0, 0 - beq _082E76D6 - lsrs r3, 4 - beq _082E76D6 - lsrs r1, 4 - b _082E768A -_082E76D6: - movs r4, 0xE - lsls r4, 28 - ands r2, r4 - beq _082E7708 - mov r3, r12 - movs r4, 0x3 - rors r3, r4 - tst r2, r3 - beq _082E76EC - lsrs r4, r1, 3 - adds r0, r4 -_082E76EC: - mov r3, r12 - movs r4, 0x2 - rors r3, r4 - tst r2, r3 - beq _082E76FA - lsrs r4, r1, 2 - adds r0, r4 -_082E76FA: - mov r3, r12 - movs r4, 0x1 - rors r3, r4 - tst r2, r3 - beq _082E7708 - lsrs r4, r1, 1 - adds r0, r4 -_082E7708: - pop {r4} - cmp r4, 0 - bpl _082E7710 - negs r0, r0 -_082E7710: - pop {r4} - mov pc, lr -_082E7714: - push {lr} - bl nullsub_1 - movs r0, 0 - pop {pc} - thumb_func_end __modsi3 - - thumb_func_start __muldi3 -__muldi3: @ 82E7720 - push {r4-r7,lr} - sub sp, 0x10 - str r0, [sp] - str r1, [sp, 0x4] - str r2, [sp, 0x8] - str r3, [sp, 0xC] - ldr r3, [sp] - ldr r0, _082E778C - mov r12, r0 - adds r2, r3, 0 - ands r2, r0 - lsrs r3, 16 - ldr r1, [sp, 0x8] - adds r0, r1, 0 - mov r4, r12 - ands r0, r4 - lsrs r1, 16 - adds r5, r2, 0 - muls r5, r0 - adds r4, r2, 0 - muls r4, r1 - adds r2, r3, 0 - muls r2, r0 - muls r3, r1 - lsrs r0, r5, 16 - adds r4, r0 - adds r4, r2 - cmp r4, r2 - bcs _082E7760 - movs r0, 0x80 - lsls r0, 9 - adds r3, r0 -_082E7760: - lsrs r0, r4, 16 - adds r7, r3, r0 - mov r1, r12 - ands r4, r1 - lsls r0, r4, 16 - ands r5, r1 - adds r6, r0, 0 - orrs r6, r5 - adds r1, r7, 0 - adds r0, r6, 0 - ldr r3, [sp] - ldr r4, [sp, 0xC] - adds r2, r3, 0 - muls r2, r4 - ldr r5, [sp, 0x4] - ldr r4, [sp, 0x8] - adds r3, r5, 0 - muls r3, r4 - adds r2, r3 - adds r1, r7, r2 - add sp, 0x10 - pop {r4-r7,pc} - .align 2, 0 -_082E778C: .4byte 0x0000ffff - thumb_func_end __muldi3 - - thumb_func_start __udivdi3 -__udivdi3: @ 82E7790 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - adds r7, r2, 0 - adds r6, r3, 0 - mov r10, r0 - mov r8, r1 - cmp r6, 0 - beq _082E77AA - b _082E79F8 -_082E77AA: - cmp r7, r8 - bls _082E7884 - ldr r0, _082E77C0 - cmp r7, r0 - bhi _082E77C4 - movs r1, 0 - cmp r7, 0xFF - bls _082E77CE - movs r1, 0x8 - b _082E77CE - .align 2, 0 -_082E77C0: .4byte 0x0000ffff -_082E77C4: - ldr r0, _082E7878 - movs r1, 0x18 - cmp r7, r0 - bhi _082E77CE - movs r1, 0x10 -_082E77CE: - ldr r0, _082E787C - lsrs r2, r1 - adds r0, r2, r0 - ldrb r0, [r0] - adds r0, r1 - movs r1, 0x20 - subs r2, r1, r0 - cmp r2, 0 - beq _082E77FA - lsls r7, r2 - mov r0, r8 - lsls r0, r2 - mov r8, r0 - subs r1, r2 - mov r0, r10 - lsrs r0, r1 - mov r1, r8 - orrs r1, r0 - mov r8, r1 - mov r3, r10 - lsls r3, r2 - mov r10, r3 -_082E77FA: - lsrs r4, r7, 16 - mov r9, r4 - ldr r0, _082E7880 - ands r0, r7 - str r0, [sp] - mov r0, r8 - mov r1, r9 - bl __umodsi3 - adds r4, r0, 0 - mov r0, r8 - mov r1, r9 - bl __udivsi3 - adds r6, r0, 0 - ldr r1, [sp] - adds r2, r6, 0 - muls r2, r1 - lsls r4, 16 - mov r3, r10 - lsrs r0, r3, 16 - orrs r4, r0 - cmp r4, r2 - bcs _082E783A - subs r6, 0x1 - adds r4, r7 - cmp r4, r7 - bcc _082E783A - cmp r4, r2 - bcs _082E783A - subs r6, 0x1 - adds r4, r7 -_082E783A: - subs r4, r2 - adds r0, r4, 0 - mov r1, r9 - bl __umodsi3 - adds r5, r0, 0 - adds r0, r4, 0 - mov r1, r9 - bl __udivsi3 - adds r1, r0, 0 - ldr r4, [sp] - adds r2, r1, 0 - muls r2, r4 - lsls r5, 16 - ldr r0, _082E7880 - mov r3, r10 - ands r3, r0 - orrs r5, r3 - cmp r5, r2 - bcs _082E7872 - subs r1, 0x1 - adds r5, r7 - cmp r5, r7 - bcc _082E7872 - cmp r5, r2 - bcs _082E7872 - subs r1, 0x1 -_082E7872: - lsls r6, 16 - orrs r6, r1 - b _082E79FE - .align 2, 0 -_082E7878: .4byte 0x00ffffff -_082E787C: .4byte gUnknown_089A3370 -_082E7880: .4byte 0x0000ffff -_082E7884: - cmp r2, 0 - bne _082E7892 - movs r0, 0x1 - movs r1, 0 - bl __udivsi3 - adds r7, r0, 0 -_082E7892: - adds r1, r7, 0 - ldr r0, _082E78A4 - cmp r7, r0 - bhi _082E78A8 - movs r2, 0 - cmp r7, 0xFF - bls _082E78B2 - movs r2, 0x8 - b _082E78B2 - .align 2, 0 -_082E78A4: .4byte 0x0000ffff -_082E78A8: - ldr r0, _082E78D0 - movs r2, 0x18 - cmp r7, r0 - bhi _082E78B2 - movs r2, 0x10 -_082E78B2: - ldr r0, _082E78D4 - lsrs r1, r2 - adds r0, r1, r0 - ldrb r0, [r0] - adds r0, r2 - movs r1, 0x20 - subs r2, r1, r0 - cmp r2, 0 - bne _082E78D8 - mov r0, r8 - subs r0, r7 - mov r8, r0 - movs r1, 0x1 - str r1, [sp, 0x4] - b _082E7976 - .align 2, 0 -_082E78D0: .4byte 0x00ffffff -_082E78D4: .4byte gUnknown_089A3370 -_082E78D8: - subs r1, r2 - lsls r7, r2 - mov r5, r8 - lsrs r5, r1 - mov r3, r8 - lsls r3, r2 - mov r0, r10 - lsrs r0, r1 - orrs r3, r0 - mov r8, r3 - mov r4, r10 - lsls r4, r2 - mov r10, r4 - lsrs r0, r7, 16 - mov r9, r0 - ldr r1, _082E79F4 - ands r1, r7 - str r1, [sp, 0x8] - adds r0, r5, 0 - mov r1, r9 - bl __umodsi3 - adds r4, r0, 0 - adds r0, r5, 0 - mov r1, r9 - bl __udivsi3 - adds r6, r0, 0 - ldr r2, [sp, 0x8] - adds r1, r6, 0 - muls r1, r2 - lsls r4, 16 - mov r3, r8 - lsrs r0, r3, 16 - orrs r4, r0 - cmp r4, r1 - bcs _082E7932 - subs r6, 0x1 - adds r4, r7 - cmp r4, r7 - bcc _082E7932 - cmp r4, r1 - bcs _082E7932 - subs r6, 0x1 - adds r4, r7 -_082E7932: - subs r4, r1 - adds r0, r4, 0 - mov r1, r9 - bl __umodsi3 - adds r5, r0, 0 - adds r0, r4, 0 - mov r1, r9 - bl __udivsi3 - adds r2, r0, 0 - ldr r4, [sp, 0x8] - adds r1, r2, 0 - muls r1, r4 - lsls r5, 16 - ldr r0, _082E79F4 - mov r3, r8 - ands r3, r0 - orrs r5, r3 - cmp r5, r1 - bcs _082E796C - subs r2, 0x1 - adds r5, r7 - cmp r5, r7 - bcc _082E796C - cmp r5, r1 - bcs _082E796C - subs r2, 0x1 - adds r5, r7 -_082E796C: - lsls r6, 16 - orrs r6, r2 - str r6, [sp, 0x4] - subs r1, r5, r1 - mov r8, r1 -_082E7976: - lsrs r4, r7, 16 - mov r9, r4 - ldr r0, _082E79F4 - ands r0, r7 - str r0, [sp, 0xC] - mov r0, r8 - mov r1, r9 - bl __umodsi3 - adds r4, r0, 0 - mov r0, r8 - mov r1, r9 - bl __udivsi3 - adds r6, r0, 0 - ldr r1, [sp, 0xC] - adds r2, r6, 0 - muls r2, r1 - lsls r4, 16 - mov r3, r10 - lsrs r0, r3, 16 - orrs r4, r0 - cmp r4, r2 - bcs _082E79B6 - subs r6, 0x1 - adds r4, r7 - cmp r4, r7 - bcc _082E79B6 - cmp r4, r2 - bcs _082E79B6 - subs r6, 0x1 - adds r4, r7 -_082E79B6: - subs r4, r2 - adds r0, r4, 0 - mov r1, r9 - bl __umodsi3 - adds r5, r0, 0 - adds r0, r4, 0 - mov r1, r9 - bl __udivsi3 - adds r1, r0, 0 - ldr r4, [sp, 0xC] - adds r2, r1, 0 - muls r2, r4 - lsls r5, 16 - ldr r0, _082E79F4 - mov r3, r10 - ands r3, r0 - orrs r5, r3 - cmp r5, r2 - bcs _082E79EE - subs r1, 0x1 - adds r5, r7 - cmp r5, r7 - bcc _082E79EE - cmp r5, r2 - bcs _082E79EE - subs r1, 0x1 -_082E79EE: - lsls r6, 16 - orrs r6, r1 - b _082E7B4E - .align 2, 0 -_082E79F4: .4byte 0x0000ffff -_082E79F8: - cmp r6, r8 - bls _082E7A04 - movs r6, 0 -_082E79FE: - movs r4, 0 - str r4, [sp, 0x4] - b _082E7B4E -_082E7A04: - adds r1, r6, 0 - ldr r0, _082E7A18 - cmp r6, r0 - bhi _082E7A1C - movs r2, 0 - cmp r6, 0xFF - bls _082E7A26 - movs r2, 0x8 - b _082E7A26 - .align 2, 0 -_082E7A18: .4byte 0x0000ffff -_082E7A1C: - ldr r0, _082E7A48 - movs r2, 0x18 - cmp r6, r0 - bhi _082E7A26 - movs r2, 0x10 -_082E7A26: - ldr r0, _082E7A4C - lsrs r1, r2 - adds r0, r1, r0 - ldrb r0, [r0] - adds r0, r2 - movs r1, 0x20 - subs r2, r1, r0 - cmp r2, 0 - bne _082E7A54 - cmp r8, r6 - bhi _082E7A40 - cmp r10, r7 - bcc _082E7A50 -_082E7A40: - movs r6, 0x1 - mov r1, r10 - b _082E7B48 - .align 2, 0 -_082E7A48: .4byte 0x00ffffff -_082E7A4C: .4byte gUnknown_089A3370 -_082E7A50: - movs r6, 0 - b _082E7B4A -_082E7A54: - subs r1, r2 - lsls r6, r2 - adds r0, r7, 0 - lsrs r0, r1 - orrs r6, r0 - lsls r7, r2 - mov r5, r8 - lsrs r5, r1 - mov r3, r8 - lsls r3, r2 - mov r0, r10 - lsrs r0, r1 - orrs r3, r0 - mov r8, r3 - mov r4, r10 - lsls r4, r2 - mov r10, r4 - lsrs r0, r6, 16 - mov r9, r0 - ldr r1, _082E7B64 - ands r1, r6 - str r1, [sp, 0x10] - adds r0, r5, 0 - mov r1, r9 - bl __umodsi3 - adds r4, r0, 0 - adds r0, r5, 0 - mov r1, r9 - bl __udivsi3 - adds r3, r0, 0 - ldr r2, [sp, 0x10] - adds r1, r3, 0 - muls r1, r2 - lsls r4, 16 - mov r2, r8 - lsrs r0, r2, 16 - orrs r4, r0 - cmp r4, r1 - bcs _082E7AB6 - subs r3, 0x1 - adds r4, r6 - cmp r4, r6 - bcc _082E7AB6 - cmp r4, r1 - bcs _082E7AB6 - subs r3, 0x1 - adds r4, r6 -_082E7AB6: - subs r4, r1 - adds r0, r4, 0 - mov r1, r9 - str r3, [sp, 0x1C] - bl __umodsi3 - adds r5, r0, 0 - adds r0, r4, 0 - mov r1, r9 - bl __udivsi3 - adds r2, r0, 0 - ldr r4, [sp, 0x10] - adds r1, r2, 0 - muls r1, r4 - lsls r5, 16 - ldr r0, _082E7B64 - mov r4, r8 - ands r4, r0 - orrs r5, r4 - ldr r3, [sp, 0x1C] - cmp r5, r1 - bcs _082E7AF4 - subs r2, 0x1 - adds r5, r6 - cmp r5, r6 - bcc _082E7AF4 - cmp r5, r1 - bcs _082E7AF4 - subs r2, 0x1 - adds r5, r6 -_082E7AF4: - lsls r6, r3, 16 - orrs r6, r2 - subs r1, r5, r1 - mov r8, r1 - ldr r0, _082E7B64 - mov r9, r0 - adds r1, r6, 0 - ands r1, r0 - lsrs r3, r6, 16 - adds r0, r7, 0 - mov r2, r9 - ands r0, r2 - lsrs r2, r7, 16 - adds r5, r1, 0 - muls r5, r0 - adds r4, r1, 0 - muls r4, r2 - adds r1, r3, 0 - muls r1, r0 - muls r3, r2 - lsrs r0, r5, 16 - adds r4, r0 - adds r4, r1 - cmp r4, r1 - bcs _082E7B2C - movs r0, 0x80 - lsls r0, 9 - adds r3, r0 -_082E7B2C: - lsrs r0, r4, 16 - adds r3, r0 - mov r1, r9 - ands r4, r1 - lsls r0, r4, 16 - ands r5, r1 - adds r1, r0, r5 - cmp r3, r8 - bhi _082E7B46 - cmp r3, r8 - bne _082E7B4A - cmp r1, r10 - bls _082E7B4A -_082E7B46: - subs r6, 0x1 -_082E7B48: - subs r0, r1, r7 -_082E7B4A: - movs r2, 0 - str r2, [sp, 0x4] -_082E7B4E: - str r6, [sp, 0x14] - ldr r3, [sp, 0x4] - str r3, [sp, 0x18] - ldr r0, [sp, 0x14] - ldr r1, [sp, 0x18] - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7,pc} - .align 2, 0 -_082E7B64: .4byte 0x0000ffff - thumb_func_end __udivdi3 - - thumb_func_start __udivsi3 -@ unsigned int __udivsi3(unsigned int dividend, unsigned int divisor) -__udivsi3: @ 82E7B68 - cmp r1, 0 - beq _082E7BD6 - movs r3, 0x1 - movs r2, 0 - push {r4} - cmp r0, r1 - bcc _082E7BD0 - movs r4, 0x1 - lsls r4, 28 -_082E7B7A: - cmp r1, r4 - bcs _082E7B88 - cmp r1, r0 - bcs _082E7B88 - lsls r1, 4 - lsls r3, 4 - b _082E7B7A -_082E7B88: - lsls r4, 3 -_082E7B8A: - cmp r1, r4 - bcs _082E7B98 - cmp r1, r0 - bcs _082E7B98 - lsls r1, 1 - lsls r3, 1 - b _082E7B8A -_082E7B98: - cmp r0, r1 - bcc _082E7BA0 - subs r0, r1 - orrs r2, r3 -_082E7BA0: - lsrs r4, r1, 1 - cmp r0, r4 - bcc _082E7BAC - subs r0, r4 - lsrs r4, r3, 1 - orrs r2, r4 -_082E7BAC: - lsrs r4, r1, 2 - cmp r0, r4 - bcc _082E7BB8 - subs r0, r4 - lsrs r4, r3, 2 - orrs r2, r4 -_082E7BB8: - lsrs r4, r1, 3 - cmp r0, r4 - bcc _082E7BC4 - subs r0, r4 - lsrs r4, r3, 3 - orrs r2, r4 -_082E7BC4: - cmp r0, 0 - beq _082E7BD0 - lsrs r3, 4 - beq _082E7BD0 - lsrs r1, 4 - b _082E7B98 -_082E7BD0: - adds r0, r2, 0 - pop {r4} - mov pc, lr -_082E7BD6: - push {lr} - bl nullsub_1 - movs r0, 0 - pop {pc} - thumb_func_end __udivsi3 - - thumb_func_start __umodsi3 -@ unsigned int __umodsi3(unsigned int dividend, unsigned int divisor) -__umodsi3: @ 82E7BE0 - cmp r1, 0 - beq _082E7C96 - movs r3, 0x1 - cmp r0, r1 - bcs _082E7BEC - mov pc, lr -_082E7BEC: - push {r4} - movs r4, 0x1 - lsls r4, 28 -_082E7BF2: - cmp r1, r4 - bcs _082E7C00 - cmp r1, r0 - bcs _082E7C00 - lsls r1, 4 - lsls r3, 4 - b _082E7BF2 -_082E7C00: - lsls r4, 3 -_082E7C02: - cmp r1, r4 - bcs _082E7C10 - cmp r1, r0 - bcs _082E7C10 - lsls r1, 1 - lsls r3, 1 - b _082E7C02 -_082E7C10: - movs r2, 0 - cmp r0, r1 - bcc _082E7C18 - subs r0, r1 -_082E7C18: - lsrs r4, r1, 1 - cmp r0, r4 - bcc _082E7C2A - subs r0, r4 - mov r12, r3 - movs r4, 0x1 - rors r3, r4 - orrs r2, r3 - mov r3, r12 -_082E7C2A: - lsrs r4, r1, 2 - cmp r0, r4 - bcc _082E7C3C - subs r0, r4 - mov r12, r3 - movs r4, 0x2 - rors r3, r4 - orrs r2, r3 - mov r3, r12 -_082E7C3C: - lsrs r4, r1, 3 - cmp r0, r4 - bcc _082E7C4E - subs r0, r4 - mov r12, r3 - movs r4, 0x3 - rors r3, r4 - orrs r2, r3 - mov r3, r12 -_082E7C4E: - mov r12, r3 - cmp r0, 0 - beq _082E7C5C - lsrs r3, 4 - beq _082E7C5C - lsrs r1, 4 - b _082E7C10 -_082E7C5C: - movs r4, 0xE - lsls r4, 28 - ands r2, r4 - bne _082E7C68 - pop {r4} - mov pc, lr -_082E7C68: - mov r3, r12 - movs r4, 0x3 - rors r3, r4 - tst r2, r3 - beq _082E7C76 - lsrs r4, r1, 3 - adds r0, r4 -_082E7C76: - mov r3, r12 - movs r4, 0x2 - rors r3, r4 - tst r2, r3 - beq _082E7C84 - lsrs r4, r1, 2 - adds r0, r4 -_082E7C84: - mov r3, r12 - movs r4, 0x1 - rors r3, r4 - tst r2, r3 - beq _082E7C92 - lsrs r4, r1, 1 - adds r0, r4 -_082E7C92: - pop {r4} - mov pc, lr -_082E7C96: - push {lr} - bl nullsub_1 - movs r0, 0 - pop {pc} - thumb_func_end __umodsi3 - - thumb_func_start __pack_d -__pack_d: @ 82E7CA0 - push {r4-r7,lr} - sub sp, 0x8 - adds r1, r0, 0 - ldr r4, [r1, 0xC] - ldr r5, [r1, 0x10] - ldr r7, [r1, 0x4] - movs r6, 0 - movs r2, 0 - ldr r0, [r1] - cmp r0, 0x1 - bhi _082E7CB8 - movs r2, 0x1 -_082E7CB8: - cmp r2, 0 - beq _082E7CD8 - ldr r6, _082E7CCC - ldr r2, _082E7CD0 - ldr r3, _082E7CD4 - adds r0, r4, 0 - adds r1, r5, 0 - orrs r1, r3 - b _082E7D90 - .align 2, 0 -_082E7CCC: .4byte 0x000007ff -_082E7CD0: .4byte 0x00000000 -_082E7CD4: .4byte 0x00080000 -_082E7CD8: - movs r2, 0 - cmp r0, 0x4 - bne _082E7CE0 - movs r2, 0x1 -_082E7CE0: - cmp r2, 0 - bne _082E7D2C - movs r2, 0 - cmp r0, 0x2 - bne _082E7CEC - movs r2, 0x1 -_082E7CEC: - cmp r2, 0 - beq _082E7CF6 - movs r4, 0 - movs r5, 0 - b _082E7D94 -_082E7CF6: - adds r0, r5, 0 - orrs r0, r4 - cmp r0, 0 - beq _082E7D94 - ldr r2, [r1, 0x8] - ldr r0, _082E7D14 - cmp r2, r0 - bge _082E7D26 - subs r2, r0, r2 - cmp r2, 0x38 - ble _082E7D18 - movs r4, 0 - movs r5, 0 - b _082E7D86 - .align 2, 0 -_082E7D14: .4byte 0xfffffc02 -_082E7D18: - adds r1, r5, 0 - adds r0, r4, 0 - bl __lshrdi3 - adds r5, r1, 0 - adds r4, r0, 0 - b _082E7D86 -_082E7D26: - ldr r0, _082E7D34 - cmp r2, r0 - ble _082E7D3C -_082E7D2C: - ldr r6, _082E7D38 - movs r4, 0 - movs r5, 0 - b _082E7D94 - .align 2, 0 -_082E7D34: .4byte 0x000003ff -_082E7D38: .4byte 0x000007ff -_082E7D3C: - ldr r0, _082E7D64 - adds r6, r2, r0 - movs r0, 0xFF - adds r1, r4, 0 - ands r1, r0 - movs r2, 0 - cmp r1, 0x80 - bne _082E7D68 - cmp r2, 0 - bne _082E7D68 - adds r0, 0x1 - adds r1, r4, 0 - ands r1, r0 - adds r0, r2, 0 - orrs r0, r1 - cmp r0, 0 - beq _082E7D70 - movs r0, 0x80 - movs r1, 0 - b _082E7D6C - .align 2, 0 -_082E7D64: .4byte 0x000003ff -_082E7D68: - movs r0, 0x7F - movs r1, 0 -_082E7D6C: - adds r4, r0 - adcs r5, r1 -_082E7D70: - ldr r0, _082E7DD4 - cmp r5, r0 - bls _082E7D86 - lsls r3, r5, 31 - lsrs r2, r4, 1 - adds r0, r3, 0 - orrs r0, r2 - lsrs r1, r5, 1 - adds r5, r1, 0 - adds r4, r0, 0 - adds r6, 0x1 -_082E7D86: - lsls r3, r5, 24 - lsrs r2, r4, 8 - adds r0, r3, 0 - orrs r0, r2 - lsrs r1, r5, 8 -_082E7D90: - adds r5, r1, 0 - adds r4, r0, 0 -_082E7D94: - str r4, [sp] - ldr r2, _082E7DD8 - ands r2, r5 - ldr r0, [sp, 0x4] - ldr r1, _082E7DDC - ands r0, r1 - orrs r0, r2 - str r0, [sp, 0x4] - mov r2, sp - ldr r1, _082E7DE0 - adds r0, r1, 0 - ands r6, r0 - lsls r1, r6, 4 - ldr r0, _082E7DE4 - ldrh r3, [r2, 0x6] - ands r0, r3 - orrs r0, r1 - strh r0, [r2, 0x6] - lsls r1, r7, 7 - movs r0, 0x7F - ldrb r3, [r2, 0x7] - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x7] - ldr r1, [sp] - ldr r0, [sp, 0x4] - str r0, [sp] - str r1, [sp, 0x4] - ldr r0, [sp] - ldr r1, [sp, 0x4] - add sp, 0x8 - pop {r4-r7,pc} - .align 2, 0 -_082E7DD4: .4byte 0x1fffffff -_082E7DD8: .4byte 0x000fffff -_082E7DDC: .4byte 0xfff00000 -_082E7DE0: .4byte 0x000007ff -_082E7DE4: .4byte 0xffff800f - thumb_func_end __pack_d - - thumb_func_start __unpack_d -__unpack_d: @ 82E7DE8 - push {r4-r7,lr} - sub sp, 0x8 - adds r2, r0, 0 - adds r6, r1, 0 - ldr r1, [r2, 0x4] - str r1, [sp] - ldr r0, [r2] - str r0, [sp, 0x4] - mov r2, sp - adds r4, r1, 0 - lsls r0, 12 - lsrs r5, r0, 12 - ldrh r3, [r2, 0x6] - lsls r0, r3, 17 - lsrs r3, r0, 21 - ldrb r2, [r2, 0x7] - lsrs r0, r2, 7 - str r0, [r6, 0x4] - cmp r3, 0 - bne _082E7E5C - orrs r1, r5 - cmp r1, 0 - bne _082E7E1C - movs r0, 0x2 - str r0, [r6] - b _082E7EB0 -_082E7E1C: - ldr r0, _082E7E54 - str r0, [r6, 0x8] - lsrs r3, r4, 24 - lsls r2, r5, 8 - adds r1, r3, 0 - orrs r1, r2 - lsls r0, r4, 8 - adds r5, r1, 0 - adds r4, r0, 0 - movs r0, 0x3 - str r0, [r6] - ldr r0, _082E7E58 - cmp r5, r0 - bhi _082E7E8C - adds r7, r0, 0 -_082E7E3A: - lsrs r3, r4, 31 - lsls r2, r5, 1 - adds r1, r3, 0 - orrs r1, r2 - lsls r0, r4, 1 - adds r5, r1, 0 - adds r4, r0, 0 - ldr r0, [r6, 0x8] - subs r0, 0x1 - str r0, [r6, 0x8] - cmp r5, r7 - bls _082E7E3A - b _082E7E8C - .align 2, 0 -_082E7E54: .4byte 0xfffffc02 -_082E7E58: .4byte 0x0fffffff -_082E7E5C: - ldr r0, _082E7E70 - cmp r3, r0 - bne _082E7E92 - orrs r1, r5 - cmp r1, 0 - bne _082E7E74 - movs r0, 0x4 - str r0, [r6] - b _082E7EB0 - .align 2, 0 -_082E7E70: .4byte 0x000007ff -_082E7E74: - movs r2, 0x80 - lsls r2, 12 - movs r0, 0 - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - cmp r1, 0 - beq _082E7E8A - movs r0, 0x1 - str r0, [r6] - b _082E7E8C -_082E7E8A: - str r1, [r6] -_082E7E8C: - str r4, [r6, 0xC] - str r5, [r6, 0x10] - b _082E7EB0 -_082E7E92: - ldr r1, _082E7EB4 - adds r0, r3, r1 - str r0, [r6, 0x8] - movs r0, 0x3 - str r0, [r6] - lsrs r3, r4, 24 - lsls r2, r5, 8 - adds r1, r3, 0 - orrs r1, r2 - lsls r0, r4, 8 - ldr r2, _082E7EB8 - ldr r3, _082E7EBC - orrs r1, r3 - str r0, [r6, 0xC] - str r1, [r6, 0x10] -_082E7EB0: - add sp, 0x8 - pop {r4-r7,pc} - .align 2, 0 -_082E7EB4: .4byte 0xfffffc01 -_082E7EB8: .4byte 0x00000000 -_082E7EBC: .4byte 0x10000000 - thumb_func_end __unpack_d - - thumb_func_start __fpadd_parts_d -__fpadd_parts_d: @ 82E7EC0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - adds r3, r0, 0 - adds r4, r1, 0 - mov r10, r2 - movs r0, 0 - ldr r2, [r3] - cmp r2, 0x1 - bhi _082E7EDC - movs r0, 0x1 -_082E7EDC: - cmp r0, 0 - beq _082E7EE4 -_082E7EE0: - adds r0, r3, 0 - b _082E811C -_082E7EE4: - movs r1, 0 - ldr r0, [r4] - cmp r0, 0x1 - bhi _082E7EEE - movs r1, 0x1 -_082E7EEE: - cmp r1, 0 - bne _082E7F66 - movs r1, 0 - cmp r2, 0x4 - bne _082E7EFA - movs r1, 0x1 -_082E7EFA: - cmp r1, 0 - beq _082E7F1C - movs r1, 0 - cmp r0, 0x4 - bne _082E7F06 - movs r1, 0x1 -_082E7F06: - cmp r1, 0 - beq _082E7EE0 - ldr r1, [r3, 0x4] - ldr r0, [r4, 0x4] - cmp r1, r0 - beq _082E7EE0 - ldr r0, _082E7F18 - b _082E811C - .align 2, 0 -_082E7F18: .4byte 0x03001a80 -_082E7F1C: - movs r1, 0 - cmp r0, 0x4 - bne _082E7F24 - movs r1, 0x1 -_082E7F24: - cmp r1, 0 - bne _082E7F66 - movs r1, 0 - cmp r0, 0x2 - bne _082E7F30 - movs r1, 0x1 -_082E7F30: - cmp r1, 0 - beq _082E7F58 - movs r0, 0 - cmp r2, 0x2 - bne _082E7F3C - movs r0, 0x1 -_082E7F3C: - cmp r0, 0 - beq _082E7EE0 - mov r1, r10 - adds r0, r3, 0 - ldm r0!, {r2,r5,r6} - stm r1!, {r2,r5,r6} - ldm r0!, {r2,r5} - stm r1!, {r2,r5} - ldr r0, [r3, 0x4] - ldr r1, [r4, 0x4] - ands r0, r1 - mov r6, r10 - str r0, [r6, 0x4] - b _082E811A -_082E7F58: - movs r1, 0 - ldr r0, [r3] - cmp r0, 0x2 - bne _082E7F62 - movs r1, 0x1 -_082E7F62: - cmp r1, 0 - beq _082E7F6A -_082E7F66: - adds r0, r4, 0 - b _082E811C -_082E7F6A: - ldr r0, [r3, 0x8] - mov r9, r0 - ldr r1, [r4, 0x8] - mov r8, r1 - ldr r6, [r3, 0xC] - ldr r7, [r3, 0x10] - ldr r0, [r4, 0xC] - ldr r1, [r4, 0x10] - str r0, [sp] - str r1, [sp, 0x4] - mov r1, r9 - mov r2, r8 - subs r0, r1, r2 - cmp r0, 0 - bge _082E7F8A - negs r0, r0 -_082E7F8A: - cmp r0, 0x3F - bgt _082E8008 - ldr r3, [r3, 0x4] - mov r12, r3 - ldr r4, [r4, 0x4] - str r4, [sp, 0x8] - cmp r9, r8 - ble _082E7FD4 - mov r3, r9 - mov r4, r8 - subs r3, r4 - mov r8, r3 -_082E7FA2: - movs r5, 0x1 - negs r5, r5 - add r8, r5 - ldr r2, [sp] - movs r0, 0x1 - ands r2, r0 - movs r3, 0 - ldr r1, [sp, 0x4] - lsls r5, r1, 31 - ldr r0, [sp] - lsrs r4, r0, 1 - adds r0, r5, 0 - orrs r0, r4 - adds r4, r1, 0 - lsrs r1, r4, 1 - adds r5, r2, 0 - orrs r5, r0 - str r5, [sp] - adds r4, r3, 0 - orrs r4, r1 - str r4, [sp, 0x4] - mov r5, r8 - cmp r5, 0 - bne _082E7FA2 - mov r8, r9 -_082E7FD4: - cmp r8, r9 - ble _082E8024 - mov r0, r8 - mov r1, r9 - subs r0, r1 - mov r9, r0 -_082E7FE0: - movs r2, 0x1 - negs r2, r2 - add r9, r2 - movs r2, 0x1 - ands r2, r6 - movs r3, 0 - lsls r5, r7, 31 - lsrs r4, r6, 1 - adds r0, r5, 0 - orrs r0, r4 - lsrs r1, r7, 1 - adds r6, r2, 0 - orrs r6, r0 - adds r7, r3, 0 - orrs r7, r1 - mov r3, r9 - cmp r3, 0 - bne _082E7FE0 - mov r9, r8 - b _082E8024 -_082E8008: - cmp r9, r8 - ble _082E8016 - movs r0, 0 - movs r1, 0 - str r0, [sp] - str r1, [sp, 0x4] - b _082E801C -_082E8016: - mov r9, r8 - movs r6, 0 - movs r7, 0 -_082E801C: - ldr r3, [r3, 0x4] - mov r12, r3 - ldr r4, [r4, 0x4] - str r4, [sp, 0x8] -_082E8024: - ldr r1, [sp, 0x8] - cmp r12, r1 - beq _082E80CC - mov r2, r12 - cmp r2, 0 - beq _082E8046 - adds r1, r7, 0 - adds r0, r6, 0 - bl __negdi2 - adds r3, r1, 0 - adds r2, r0, 0 - ldr r4, [sp] - ldr r5, [sp, 0x4] - adds r2, r4 - adcs r3, r5 - b _082E8052 -_082E8046: - adds r3, r7, 0 - adds r2, r6, 0 - ldr r0, [sp] - ldr r1, [sp, 0x4] - subs r2, r0 - sbcs r3, r1 -_082E8052: - cmp r3, 0 - blt _082E8068 - movs r0, 0 - mov r1, r10 - str r0, [r1, 0x4] - mov r4, r9 - str r4, [r1, 0x8] - mov r5, r10 - str r2, [r5, 0xC] - str r3, [r5, 0x10] - b _082E8080 -_082E8068: - movs r0, 0x1 - mov r6, r10 - str r0, [r6, 0x4] - mov r0, r9 - str r0, [r6, 0x8] - adds r1, r3, 0 - adds r0, r2, 0 - bl __negdi2 - mov r2, r10 - str r0, [r2, 0xC] - str r1, [r2, 0x10] -_082E8080: - mov r4, r10 - ldr r2, [r4, 0xC] - ldr r3, [r4, 0x10] - movs r0, 0x1 - negs r0, r0 - asrs r1, r0, 31 -_082E808C: - adds r2, r0 - adcs r3, r1 - ldr r0, _082E80C8 - cmp r3, r0 - bhi _082E80E4 - cmp r3, r0 - bne _082E80A2 - movs r0, 0x2 - negs r0, r0 - cmp r2, r0 - bhi _082E80E4 -_082E80A2: - mov r5, r10 - ldr r0, [r5, 0xC] - ldr r1, [r5, 0x10] - lsrs r3, r0, 31 - lsls r2, r1, 1 - adds r1, r3, 0 - orrs r1, r2 - lsls r0, 1 - mov r6, r10 - str r0, [r6, 0xC] - str r1, [r6, 0x10] - ldr r2, [r6, 0x8] - subs r2, 0x1 - str r2, [r6, 0x8] - movs r2, 0x1 - negs r2, r2 - asrs r3, r2, 31 - b _082E808C - .align 2, 0 -_082E80C8: .4byte 0x0fffffff -_082E80CC: - mov r0, r12 - mov r1, r10 - str r0, [r1, 0x4] - mov r2, r9 - str r2, [r1, 0x8] - ldr r3, [sp] - ldr r4, [sp, 0x4] - adds r6, r3 - adcs r7, r4 - mov r4, r10 - str r6, [r4, 0xC] - str r7, [r4, 0x10] -_082E80E4: - movs r0, 0x3 - mov r5, r10 - str r0, [r5] - ldr r1, [r5, 0x10] - ldr r0, _082E8128 - cmp r1, r0 - bls _082E811A - ldr r4, [r5, 0xC] - ldr r5, [r5, 0x10] - movs r2, 0x1 - adds r0, r4, 0 - ands r0, r2 - movs r1, 0 - lsls r6, r5, 31 - mov r8, r6 - lsrs r6, r4, 1 - mov r2, r8 - orrs r2, r6 - lsrs r3, r5, 1 - orrs r0, r2 - orrs r1, r3 - mov r2, r10 - str r0, [r2, 0xC] - str r1, [r2, 0x10] - ldr r0, [r2, 0x8] - adds r0, 0x1 - str r0, [r2, 0x8] -_082E811A: - mov r0, r10 -_082E811C: - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7,pc} - .align 2, 0 -_082E8128: .4byte 0x1fffffff - thumb_func_end __fpadd_parts_d - - thumb_func_start __adddf3 -@ double __adddf3(double arg_a, double arg_b) -__adddf3: @ 82E812C - push {r4,lr} - sub sp, 0x4C - str r0, [sp, 0x3C] - str r1, [sp, 0x40] - str r2, [sp, 0x44] - str r3, [sp, 0x48] - add r0, sp, 0x3C - mov r1, sp - bl __unpack_d - add r0, sp, 0x44 - add r4, sp, 0x14 - adds r1, r4, 0 - bl __unpack_d - add r2, sp, 0x28 - mov r0, sp - adds r1, r4, 0 - bl __fpadd_parts_d - bl __pack_d - add sp, 0x4C - pop {r4,pc} - thumb_func_end __adddf3 - - thumb_func_start __subdf3 -__subdf3: @ 82E815C - push {r4,lr} - sub sp, 0x4C - str r0, [sp, 0x3C] - str r1, [sp, 0x40] - str r2, [sp, 0x44] - str r3, [sp, 0x48] - add r0, sp, 0x3C - mov r1, sp - bl __unpack_d - add r0, sp, 0x44 - add r4, sp, 0x14 - adds r1, r4, 0 - bl __unpack_d - ldr r0, [r4, 0x4] - movs r1, 0x1 - eors r0, r1 - str r0, [r4, 0x4] - add r2, sp, 0x28 - mov r0, sp - adds r1, r4, 0 - bl __fpadd_parts_d - bl __pack_d - add sp, 0x4C - pop {r4,pc} - thumb_func_end __subdf3 - - thumb_func_start __muldf3 -__muldf3: @ 82E8194 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x74 - str r0, [sp, 0x3C] - str r1, [sp, 0x40] - str r2, [sp, 0x44] - str r3, [sp, 0x48] - add r0, sp, 0x3C - mov r1, sp - bl __unpack_d - add r0, sp, 0x44 - add r4, sp, 0x14 - adds r1, r4, 0 - bl __unpack_d - mov r8, sp - add r0, sp, 0x28 - mov r10, r0 - movs r0, 0 - ldr r1, [sp] - cmp r1, 0x1 - bhi _082E81CA - movs r0, 0x1 -_082E81CA: - cmp r0, 0 - bne _082E822E - movs r2, 0 - ldr r0, [sp, 0x14] - cmp r0, 0x1 - bhi _082E81D8 - movs r2, 0x1 -_082E81D8: - cmp r2, 0 - beq _082E81E0 - ldr r0, [sp, 0x4] - b _082E8250 -_082E81E0: - movs r2, 0 - cmp r1, 0x4 - bne _082E81E8 - movs r2, 0x1 -_082E81E8: - cmp r2, 0 - beq _082E81FA - movs r1, 0 - cmp r0, 0x2 - bne _082E81F4 - movs r1, 0x1 -_082E81F4: - cmp r1, 0 - bne _082E8212 - b _082E822E -_082E81FA: - movs r2, 0 - cmp r0, 0x4 - bne _082E8202 - movs r2, 0x1 -_082E8202: - cmp r2, 0 - beq _082E8222 - movs r0, 0 - cmp r1, 0x2 - bne _082E820E - movs r0, 0x1 -_082E820E: - cmp r0, 0 - beq _082E821C -_082E8212: - ldr r0, _082E8218 - b _082E841A - .align 2, 0 -_082E8218: .4byte 0x03001a80 -_082E821C: - mov r1, r8 - ldr r0, [r1, 0x4] - b _082E8250 -_082E8222: - movs r2, 0 - cmp r1, 0x2 - bne _082E822A - movs r2, 0x1 -_082E822A: - cmp r2, 0 - beq _082E8240 -_082E822E: - ldr r0, [sp, 0x4] - ldr r1, [sp, 0x18] - eors r0, r1 - negs r1, r0 - orrs r1, r0 - lsrs r1, 31 - str r1, [sp, 0x4] - mov r0, sp - b _082E841A -_082E8240: - movs r1, 0 - cmp r0, 0x2 - bne _082E8248 - movs r1, 0x1 -_082E8248: - cmp r1, 0 - beq _082E8260 - mov r2, r8 - ldr r0, [r2, 0x4] -_082E8250: - ldr r1, [sp, 0x18] - eors r0, r1 - negs r1, r0 - orrs r1, r0 - lsrs r1, 31 - str r1, [sp, 0x18] - adds r0, r4, 0 - b _082E841A -_082E8260: - mov r4, r8 - ldr r0, [r4, 0xC] - ldr r1, [r4, 0x10] - adds r6, r0, 0 - movs r7, 0 - str r1, [sp, 0x4C] - movs r5, 0 - str r5, [sp, 0x50] - ldr r0, [sp, 0x20] - ldr r1, [sp, 0x24] - adds r4, r0, 0 - str r1, [sp, 0x54] - movs r0, 0 - str r0, [sp, 0x58] - adds r1, r5, 0 - adds r0, r4, 0 - adds r3, r7, 0 - adds r2, r6, 0 - bl __muldi3 - str r0, [sp, 0x5C] - str r1, [sp, 0x60] - ldr r0, [sp, 0x54] - ldr r1, [sp, 0x58] - adds r3, r7, 0 - adds r2, r6, 0 - bl __muldi3 - adds r7, r1, 0 - adds r6, r0, 0 - adds r1, r5, 0 - adds r0, r4, 0 - ldr r2, [sp, 0x4C] - ldr r3, [sp, 0x50] - bl __muldi3 - adds r5, r1, 0 - adds r4, r0, 0 - ldr r0, [sp, 0x54] - ldr r1, [sp, 0x58] - ldr r2, [sp, 0x4C] - ldr r3, [sp, 0x50] - bl __muldi3 - str r0, [sp, 0x64] - str r1, [sp, 0x68] - movs r1, 0 - movs r2, 0 - str r1, [sp, 0x6C] - str r2, [sp, 0x70] - adds r3, r7, 0 - adds r2, r6, 0 - adds r2, r4 - adcs r3, r5 - cmp r7, r3 - bhi _082E82D8 - cmp r7, r3 - bne _082E82E0 - cmp r6, r2 - bls _082E82E0 -_082E82D8: - ldr r5, _082E8430 - ldr r4, _082E842C - str r4, [sp, 0x6C] - str r5, [sp, 0x70] -_082E82E0: - adds r1, r2, 0 - movs r6, 0 - adds r7, r1, 0 - ldr r0, [sp, 0x5C] - ldr r1, [sp, 0x60] - adds r6, r0 - adcs r7, r1 - cmp r1, r7 - bhi _082E82FC - ldr r1, [sp, 0x60] - cmp r1, r7 - bne _082E830C - cmp r0, r6 - bls _082E830C -_082E82FC: - movs r0, 0x1 - movs r1, 0 - ldr r4, [sp, 0x6C] - ldr r5, [sp, 0x70] - adds r4, r0 - adcs r5, r1 - str r4, [sp, 0x6C] - str r5, [sp, 0x70] -_082E830C: - adds r0, r3, 0 - adds r2, r0, 0 - movs r3, 0 - adds r5, r3, 0 - adds r4, r2, 0 - ldr r0, [sp, 0x64] - ldr r1, [sp, 0x68] - adds r4, r0 - adcs r5, r1 - ldr r1, [sp, 0x6C] - ldr r2, [sp, 0x70] - adds r4, r1 - adcs r5, r2 - mov r0, r8 - ldr r2, [r0, 0x8] - ldr r0, [sp, 0x1C] - adds r2, r0 - str r2, [sp, 0x30] - mov r0, r8 - ldr r1, [r0, 0x4] - ldr r0, [sp, 0x18] - eors r1, r0 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - str r0, [sp, 0x2C] - adds r2, 0x4 - str r2, [sp, 0x30] - ldr r0, _082E8434 - cmp r5, r0 - bls _082E838E - movs r1, 0x1 - mov r9, r1 - mov r8, r0 - mov r12, r2 -_082E8352: - movs r2, 0x1 - add r12, r2 - mov r0, r9 - ands r0, r4 - cmp r0, 0 - beq _082E8378 - lsls r3, r7, 31 - lsrs r2, r6, 1 - adds r0, r3, 0 - orrs r0, r2 - lsrs r1, r7, 1 - adds r7, r1, 0 - adds r6, r0, 0 - adds r0, r6, 0 - movs r1, 0x80 - lsls r1, 24 - orrs r1, r7 - adds r7, r1, 0 - adds r6, r0, 0 -_082E8378: - lsls r3, r5, 31 - lsrs r2, r4, 1 - adds r0, r3, 0 - orrs r0, r2 - lsrs r1, r5, 1 - adds r5, r1, 0 - adds r4, r0, 0 - cmp r5, r8 - bhi _082E8352 - mov r0, r12 - str r0, [sp, 0x30] -_082E838E: - ldr r0, _082E8438 - cmp r5, r0 - bhi _082E83E0 - movs r1, 0x80 - lsls r1, 24 - mov r9, r1 - mov r8, r0 - ldr r2, [sp, 0x30] - mov r12, r2 -_082E83A0: - movs r0, 0x1 - negs r0, r0 - add r12, r0 - lsrs r3, r4, 31 - lsls r2, r5, 1 - adds r1, r3, 0 - orrs r1, r2 - lsls r0, r4, 1 - adds r5, r1, 0 - adds r4, r0, 0 - movs r0, 0 - mov r1, r9 - ands r1, r7 - orrs r0, r1 - cmp r0, 0 - beq _082E83CA - movs r0, 0x1 - orrs r0, r4 - adds r1, r5, 0 - adds r5, r1, 0 - adds r4, r0, 0 -_082E83CA: - lsrs r3, r6, 31 - lsls r2, r7, 1 - adds r1, r3, 0 - orrs r1, r2 - lsls r0, r6, 1 - adds r7, r1, 0 - adds r6, r0, 0 - cmp r5, r8 - bls _082E83A0 - mov r1, r12 - str r1, [sp, 0x30] -_082E83E0: - movs r0, 0xFF - adds r1, r4, 0 - ands r1, r0 - movs r2, 0 - cmp r1, 0x80 - bne _082E840E - cmp r2, 0 - bne _082E840E - adds r0, 0x1 - adds r1, r4, 0 - ands r1, r0 - adds r0, r2, 0 - orrs r0, r1 - cmp r0, 0 - bne _082E8406 - adds r0, r7, 0 - orrs r0, r6 - cmp r0, 0 - beq _082E840E -_082E8406: - movs r0, 0x80 - movs r1, 0 - adds r4, r0 - adcs r5, r1 -_082E840E: - str r4, [sp, 0x34] - str r5, [sp, 0x38] - movs r0, 0x3 - mov r2, r10 - str r0, [r2] - add r0, sp, 0x28 -_082E841A: - bl __pack_d - add sp, 0x74 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7,pc} - .align 2, 0 -_082E842C: .4byte 0x00000000 -_082E8430: .4byte 0x00000001 -_082E8434: .4byte 0x1fffffff -_082E8438: .4byte 0x0fffffff - thumb_func_end __muldf3 - - thumb_func_start __divdf3 -__divdf3: @ 82E843C - push {r4-r7,lr} - sub sp, 0x48 - str r0, [sp, 0x28] - str r1, [sp, 0x2C] - str r2, [sp, 0x30] - str r3, [sp, 0x34] - add r0, sp, 0x28 - mov r1, sp - bl __unpack_d - add r0, sp, 0x30 - add r4, sp, 0x14 - adds r1, r4, 0 - bl __unpack_d - mov r12, sp - movs r0, 0 - ldr r3, [sp] - cmp r3, 0x1 - bhi _082E8466 - movs r0, 0x1 -_082E8466: - cmp r0, 0 - beq _082E846E - mov r1, sp - b _082E85B0 -_082E846E: - movs r0, 0 - ldr r2, [sp, 0x14] - adds r5, r2, 0 - cmp r2, 0x1 - bhi _082E847A - movs r0, 0x1 -_082E847A: - cmp r0, 0 - beq _082E8482 - adds r1, r4, 0 - b _082E85B0 -_082E8482: - ldr r0, [sp, 0x4] - ldr r1, [sp, 0x18] - eors r0, r1 - str r0, [sp, 0x4] - movs r0, 0 - cmp r3, 0x4 - bne _082E8492 - movs r0, 0x1 -_082E8492: - cmp r0, 0 - bne _082E84A2 - movs r4, 0 - cmp r3, 0x2 - bne _082E849E - movs r4, 0x1 -_082E849E: - cmp r4, 0 - beq _082E84B4 -_082E84A2: - mov r1, r12 - ldr r0, [r1] - cmp r0, r5 - beq _082E84AC - b _082E85B0 -_082E84AC: - ldr r1, _082E84B0 - b _082E85B0 - .align 2, 0 -_082E84B0: .4byte 0x03001a80 -_082E84B4: - movs r0, 0 - cmp r2, 0x4 - bne _082E84BC - movs r0, 0x1 -_082E84BC: - cmp r0, 0 - beq _082E84CE - movs r0, 0 - movs r1, 0 - str r0, [sp, 0xC] - str r1, [sp, 0x10] - str r4, [sp, 0x8] - mov r1, sp - b _082E85B0 -_082E84CE: - movs r0, 0 - cmp r2, 0x2 - bne _082E84D6 - movs r0, 0x1 -_082E84D6: - cmp r0, 0 - beq _082E84E2 - movs r0, 0x4 - mov r2, r12 - str r0, [r2] - b _082E85AE -_082E84E2: - mov r3, r12 - ldr r1, [r3, 0x8] - ldr r0, [sp, 0x1C] - subs r6, r1, r0 - str r6, [r3, 0x8] - ldr r4, [r3, 0xC] - ldr r5, [r3, 0x10] - ldr r0, [sp, 0x20] - ldr r1, [sp, 0x24] - str r0, [sp, 0x38] - str r1, [sp, 0x3C] - cmp r1, r5 - bhi _082E8506 - ldr r1, [sp, 0x3C] - cmp r1, r5 - bne _082E851A - cmp r0, r4 - bls _082E851A -_082E8506: - lsrs r3, r4, 31 - lsls r2, r5, 1 - adds r1, r3, 0 - orrs r1, r2 - lsls r0, r4, 1 - adds r5, r1, 0 - adds r4, r0, 0 - subs r0, r6, 0x1 - mov r2, r12 - str r0, [r2, 0x8] -_082E851A: - ldr r7, _082E85C0 - ldr r6, _082E85BC - movs r0, 0 - movs r1, 0 - str r0, [sp, 0x40] - str r1, [sp, 0x44] -_082E8526: - ldr r1, [sp, 0x3C] - cmp r1, r5 - bhi _082E854A - cmp r1, r5 - bne _082E8536 - ldr r2, [sp, 0x38] - cmp r2, r4 - bhi _082E854A -_082E8536: - ldr r0, [sp, 0x40] - orrs r0, r6 - ldr r1, [sp, 0x44] - orrs r1, r7 - str r0, [sp, 0x40] - str r1, [sp, 0x44] - ldr r0, [sp, 0x38] - ldr r1, [sp, 0x3C] - subs r4, r0 - sbcs r5, r1 -_082E854A: - lsls r3, r7, 31 - lsrs r2, r6, 1 - adds r0, r3, 0 - orrs r0, r2 - lsrs r1, r7, 1 - adds r7, r1, 0 - adds r6, r0, 0 - lsrs r3, r4, 31 - lsls r2, r5, 1 - adds r1, r3, 0 - orrs r1, r2 - lsls r0, r4, 1 - adds r5, r1, 0 - adds r4, r0, 0 - adds r0, r7, 0 - orrs r0, r6 - cmp r0, 0 - bne _082E8526 - movs r0, 0xFF - ldr r1, [sp, 0x40] - ands r1, r0 - movs r2, 0 - cmp r1, 0x80 - bne _082E85A4 - cmp r2, 0 - bne _082E85A4 - adds r0, 0x1 - ldr r1, [sp, 0x40] - ands r1, r0 - adds r0, r2, 0 - orrs r0, r1 - cmp r0, 0 - bne _082E8594 - adds r0, r5, 0 - orrs r0, r4 - cmp r0, 0 - beq _082E85A4 -_082E8594: - movs r0, 0x80 - movs r1, 0 - ldr r2, [sp, 0x40] - ldr r3, [sp, 0x44] - adds r2, r0 - adcs r3, r1 - str r2, [sp, 0x40] - str r3, [sp, 0x44] -_082E85A4: - ldr r0, [sp, 0x40] - ldr r1, [sp, 0x44] - mov r2, r12 - str r0, [r2, 0xC] - str r1, [r2, 0x10] -_082E85AE: - mov r1, r12 -_082E85B0: - adds r0, r1, 0 - bl __pack_d - add sp, 0x48 - pop {r4-r7,pc} - .align 2, 0 -_082E85BC: .4byte 0x00000000 -_082E85C0: .4byte 0x10000000 - thumb_func_end __divdf3 - - thumb_func_start __fpcmp_parts_d -__fpcmp_parts_d: @ 82E85C4 - push {r4-r6,lr} - adds r5, r0, 0 - adds r6, r1, 0 - movs r0, 0 - ldr r1, [r5] - cmp r1, 0x1 - bhi _082E85D4 - movs r0, 0x1 -_082E85D4: - cmp r0, 0 - bne _082E85E6 - movs r0, 0 - ldr r2, [r6] - cmp r2, 0x1 - bhi _082E85E2 - movs r0, 0x1 -_082E85E2: - cmp r0, 0 - beq _082E85EA -_082E85E6: - movs r0, 0x1 - b _082E86C0 -_082E85EA: - movs r0, 0 - cmp r1, 0x4 - bne _082E85F2 - movs r0, 0x1 -_082E85F2: - cmp r0, 0 - beq _082E860A - movs r0, 0 - cmp r2, 0x4 - bne _082E85FE - movs r0, 0x1 -_082E85FE: - cmp r0, 0 - beq _082E860A - ldr r0, [r6, 0x4] - ldr r1, [r5, 0x4] - subs r0, r1 - b _082E86C0 -_082E860A: - movs r1, 0 - ldr r0, [r5] - cmp r0, 0x4 - bne _082E8614 - movs r1, 0x1 -_082E8614: - cmp r1, 0 - bne _082E8662 - movs r1, 0 - cmp r2, 0x4 - bne _082E8620 - movs r1, 0x1 -_082E8620: - cmp r1, 0 - beq _082E8632 -_082E8624: - ldr r0, [r6, 0x4] - movs r1, 0x1 - negs r1, r1 - cmp r0, 0 - beq _082E866C - movs r1, 0x1 - b _082E866C -_082E8632: - movs r1, 0 - cmp r0, 0x2 - bne _082E863A - movs r1, 0x1 -_082E863A: - cmp r1, 0 - beq _082E864A - movs r1, 0 - cmp r2, 0x2 - bne _082E8646 - movs r1, 0x1 -_082E8646: - cmp r1, 0 - bne _082E86BE -_082E864A: - movs r1, 0 - cmp r0, 0x2 - bne _082E8652 - movs r1, 0x1 -_082E8652: - cmp r1, 0 - bne _082E8624 - movs r0, 0 - cmp r2, 0x2 - bne _082E865E - movs r0, 0x1 -_082E865E: - cmp r0, 0 - beq _082E8670 -_082E8662: - ldr r0, [r5, 0x4] - movs r1, 0x1 - cmp r0, 0 - beq _082E866C - subs r1, 0x2 -_082E866C: - adds r0, r1, 0 - b _082E86C0 -_082E8670: - ldr r0, [r6, 0x4] - ldr r4, [r5, 0x4] - cmp r4, r0 - beq _082E8682 -_082E8678: - movs r0, 0x1 - cmp r4, 0 - beq _082E86C0 - subs r0, 0x2 - b _082E86C0 -_082E8682: - ldr r1, [r5, 0x8] - ldr r0, [r6, 0x8] - cmp r1, r0 - bgt _082E8678 - cmp r1, r0 - bge _082E869A -_082E868E: - movs r0, 0x1 - negs r0, r0 - cmp r4, 0 - beq _082E86C0 - movs r0, 0x1 - b _082E86C0 -_082E869A: - ldr r3, [r5, 0x10] - ldr r2, [r6, 0x10] - cmp r3, r2 - bhi _082E8678 - cmp r3, r2 - bne _082E86AE - ldr r1, [r5, 0xC] - ldr r0, [r6, 0xC] - cmp r1, r0 - bhi _082E8678 -_082E86AE: - cmp r2, r3 - bhi _082E868E - cmp r2, r3 - bne _082E86BE - ldr r1, [r6, 0xC] - ldr r0, [r5, 0xC] - cmp r1, r0 - bhi _082E868E -_082E86BE: - movs r0, 0 -_082E86C0: - pop {r4-r6,pc} - thumb_func_end __fpcmp_parts_d - - thumb_func_start __cmpdf2 -__cmpdf2: @ 82E86C4 - push {r4,lr} - sub sp, 0x38 - str r0, [sp, 0x28] - str r1, [sp, 0x2C] - str r2, [sp, 0x30] - str r3, [sp, 0x34] - add r0, sp, 0x28 - mov r1, sp - bl __unpack_d - add r0, sp, 0x30 - add r4, sp, 0x14 - adds r1, r4, 0 - bl __unpack_d - mov r0, sp - adds r1, r4, 0 - bl __fpcmp_parts_d - add sp, 0x38 - pop {r4,pc} - thumb_func_end __cmpdf2 - - thumb_func_start __eqdf2 -__eqdf2: @ 82E86F0 - push {r4,lr} - sub sp, 0x38 - str r0, [sp, 0x28] - str r1, [sp, 0x2C] - str r2, [sp, 0x30] - str r3, [sp, 0x34] - add r0, sp, 0x28 - mov r1, sp - bl __unpack_d - add r0, sp, 0x30 - add r4, sp, 0x14 - adds r1, r4, 0 - bl __unpack_d - movs r1, 0 - ldr r0, [sp] - cmp r0, 0x1 - bhi _082E8718 - movs r1, 0x1 -_082E8718: - cmp r1, 0 - bne _082E872A - movs r1, 0 - ldr r0, [sp, 0x14] - cmp r0, 0x1 - bhi _082E8726 - movs r1, 0x1 -_082E8726: - cmp r1, 0 - beq _082E872E -_082E872A: - movs r0, 0x1 - b _082E8736 -_082E872E: - mov r0, sp - adds r1, r4, 0 - bl __fpcmp_parts_d -_082E8736: - add sp, 0x38 - pop {r4,pc} - thumb_func_end __eqdf2 - - thumb_func_start __nedf2 -__nedf2: @ 82E873C - push {r4,lr} - sub sp, 0x38 - str r0, [sp, 0x28] - str r1, [sp, 0x2C] - str r2, [sp, 0x30] - str r3, [sp, 0x34] - add r0, sp, 0x28 - mov r1, sp - bl __unpack_d - add r0, sp, 0x30 - add r4, sp, 0x14 - adds r1, r4, 0 - bl __unpack_d - movs r1, 0 - ldr r0, [sp] - cmp r0, 0x1 - bhi _082E8764 - movs r1, 0x1 -_082E8764: - cmp r1, 0 - bne _082E8776 - movs r1, 0 - ldr r0, [sp, 0x14] - cmp r0, 0x1 - bhi _082E8772 - movs r1, 0x1 -_082E8772: - cmp r1, 0 - beq _082E877A -_082E8776: - movs r0, 0x1 - b _082E8782 -_082E877A: - mov r0, sp - adds r1, r4, 0 - bl __fpcmp_parts_d -_082E8782: - add sp, 0x38 - pop {r4,pc} - thumb_func_end __nedf2 - - thumb_func_start __gtdf2 -__gtdf2: @ 82E8788 - push {r4,lr} - sub sp, 0x38 - str r0, [sp, 0x28] - str r1, [sp, 0x2C] - str r2, [sp, 0x30] - str r3, [sp, 0x34] - add r0, sp, 0x28 - mov r1, sp - bl __unpack_d - add r0, sp, 0x30 - add r4, sp, 0x14 - adds r1, r4, 0 - bl __unpack_d - movs r1, 0 - ldr r0, [sp] - cmp r0, 0x1 - bhi _082E87B0 - movs r1, 0x1 -_082E87B0: - cmp r1, 0 - bne _082E87C2 - movs r1, 0 - ldr r0, [sp, 0x14] - cmp r0, 0x1 - bhi _082E87BE - movs r1, 0x1 -_082E87BE: - cmp r1, 0 - beq _082E87C8 -_082E87C2: - movs r0, 0x1 - negs r0, r0 - b _082E87D0 -_082E87C8: - mov r0, sp - adds r1, r4, 0 - bl __fpcmp_parts_d -_082E87D0: - add sp, 0x38 - pop {r4,pc} - thumb_func_end __gtdf2 - - thumb_func_start __gedf2 -@ int __gedf2(double arg_a, double arg_b) -__gedf2: @ 82E87D4 - push {r4,lr} - sub sp, 0x38 - str r0, [sp, 0x28] - str r1, [sp, 0x2C] - str r2, [sp, 0x30] - str r3, [sp, 0x34] - add r0, sp, 0x28 - mov r1, sp - bl __unpack_d - add r0, sp, 0x30 - add r4, sp, 0x14 - adds r1, r4, 0 - bl __unpack_d - movs r1, 0 - ldr r0, [sp] - cmp r0, 0x1 - bhi _082E87FC - movs r1, 0x1 -_082E87FC: - cmp r1, 0 - bne _082E880E - movs r1, 0 - ldr r0, [sp, 0x14] - cmp r0, 0x1 - bhi _082E880A - movs r1, 0x1 -_082E880A: - cmp r1, 0 - beq _082E8814 -_082E880E: - movs r0, 0x1 - negs r0, r0 - b _082E881C -_082E8814: - mov r0, sp - adds r1, r4, 0 - bl __fpcmp_parts_d -_082E881C: - add sp, 0x38 - pop {r4,pc} - thumb_func_end __gedf2 - - thumb_func_start __ltdf2 -__ltdf2: @ 82E8820 - push {r4,lr} - sub sp, 0x38 - str r0, [sp, 0x28] - str r1, [sp, 0x2C] - str r2, [sp, 0x30] - str r3, [sp, 0x34] - add r0, sp, 0x28 - mov r1, sp - bl __unpack_d - add r0, sp, 0x30 - add r4, sp, 0x14 - adds r1, r4, 0 - bl __unpack_d - movs r1, 0 - ldr r0, [sp] - cmp r0, 0x1 - bhi _082E8848 - movs r1, 0x1 -_082E8848: - cmp r1, 0 - bne _082E885A - movs r1, 0 - ldr r0, [sp, 0x14] - cmp r0, 0x1 - bhi _082E8856 - movs r1, 0x1 -_082E8856: - cmp r1, 0 - beq _082E885E -_082E885A: - movs r0, 0x1 - b _082E8866 -_082E885E: - mov r0, sp - adds r1, r4, 0 - bl __fpcmp_parts_d -_082E8866: - add sp, 0x38 - pop {r4,pc} - thumb_func_end __ltdf2 - - thumb_func_start __ledf2 -__ledf2: @ 82E886C - push {r4,lr} - sub sp, 0x38 - str r0, [sp, 0x28] - str r1, [sp, 0x2C] - str r2, [sp, 0x30] - str r3, [sp, 0x34] - add r0, sp, 0x28 - mov r1, sp - bl __unpack_d - add r0, sp, 0x30 - add r4, sp, 0x14 - adds r1, r4, 0 - bl __unpack_d - movs r1, 0 - ldr r0, [sp] - cmp r0, 0x1 - bhi _082E8894 - movs r1, 0x1 -_082E8894: - cmp r1, 0 - bne _082E88A6 - movs r1, 0 - ldr r0, [sp, 0x14] - cmp r0, 0x1 - bhi _082E88A2 - movs r1, 0x1 -_082E88A2: - cmp r1, 0 - beq _082E88AA -_082E88A6: - movs r0, 0x1 - b _082E88B2 -_082E88AA: - mov r0, sp - adds r1, r4, 0 - bl __fpcmp_parts_d -_082E88B2: - add sp, 0x38 - pop {r4,pc} - thumb_func_end __ledf2 - - thumb_func_start __floatsidf -__floatsidf: @ 82E88B8 - push {r4,r5,lr} - sub sp, 0x14 - adds r2, r0, 0 - movs r0, 0x3 - str r0, [sp] - lsrs r1, r2, 31 - str r1, [sp, 0x4] - cmp r2, 0 - bne _082E88D0 - movs r0, 0x2 - str r0, [sp] - b _082E8926 -_082E88D0: - movs r0, 0x3C - str r0, [sp, 0x8] - cmp r1, 0 - beq _082E88F6 - movs r0, 0x80 - lsls r0, 24 - cmp r2, r0 - bne _082E88F0 - ldr r1, _082E88EC - ldr r0, _082E88E8 - b _082E892C - .align 2, 0 -_082E88E8: .4byte 0xc1e00000 -_082E88EC: .4byte 0x00000000 -_082E88F0: - negs r0, r2 - asrs r1, r0, 31 - b _082E88FA -_082E88F6: - adds r0, r2, 0 - asrs r1, r2, 31 -_082E88FA: - str r0, [sp, 0xC] - str r1, [sp, 0x10] - ldr r0, [sp, 0x10] - ldr r1, _082E8930 - cmp r0, r1 - bhi _082E8926 - adds r5, r1, 0 - ldr r4, [sp, 0x8] -_082E890A: - ldr r0, [sp, 0xC] - ldr r1, [sp, 0x10] - lsrs r3, r0, 31 - lsls r2, r1, 1 - adds r1, r3, 0 - orrs r1, r2 - lsls r0, 1 - str r0, [sp, 0xC] - str r1, [sp, 0x10] - subs r4, 0x1 - ldr r0, [sp, 0x10] - cmp r0, r5 - bls _082E890A - str r4, [sp, 0x8] -_082E8926: - mov r0, sp - bl __pack_d -_082E892C: - add sp, 0x14 - pop {r4,r5,pc} - .align 2, 0 -_082E8930: .4byte 0x0fffffff - thumb_func_end __floatsidf - - thumb_func_start __fixdfsi -@ int __fixdfsi(double arg_a) -__fixdfsi: @ 82E8934 - push {lr} - sub sp, 0x1C - str r0, [sp, 0x14] - str r1, [sp, 0x18] - add r0, sp, 0x14 - mov r1, sp - bl __unpack_d - movs r1, 0 - ldr r0, [sp] - cmp r0, 0x2 - bne _082E894E - movs r1, 0x1 -_082E894E: - cmp r1, 0 - bne _082E8982 - movs r1, 0 - cmp r0, 0x1 - bhi _082E895A - movs r1, 0x1 -_082E895A: - cmp r1, 0 - bne _082E8982 - movs r1, 0 - cmp r0, 0x4 - bne _082E8966 - movs r1, 0x1 -_082E8966: - cmp r1, 0 - beq _082E897C -_082E896A: - ldr r0, [sp, 0x4] - ldr r1, _082E8978 - cmp r0, 0 - beq _082E89A0 - adds r1, 0x1 - b _082E89A0 - .align 2, 0 -_082E8978: .4byte 0x7fffffff -_082E897C: - ldr r0, [sp, 0x8] - cmp r0, 0 - bge _082E8986 -_082E8982: - movs r0, 0 - b _082E89A2 -_082E8986: - cmp r0, 0x1E - bgt _082E896A - movs r2, 0x3C - subs r2, r0 - ldr r0, [sp, 0xC] - ldr r1, [sp, 0x10] - bl __lshrdi3 - adds r1, r0, 0 - ldr r0, [sp, 0x4] - cmp r0, 0 - beq _082E89A0 - negs r1, r1 -_082E89A0: - adds r0, r1, 0 -_082E89A2: - add sp, 0x1C - pop {pc} - thumb_func_end __fixdfsi - - thumb_func_start __negdf2 -__negdf2: @ 82E89A8 - push {lr} - sub sp, 0x1C - str r0, [sp, 0x14] - str r1, [sp, 0x18] - add r0, sp, 0x14 - mov r1, sp - bl __unpack_d - movs r1, 0 - ldr r0, [sp, 0x4] - cmp r0, 0 - bne _082E89C2 - movs r1, 0x1 -_082E89C2: - str r1, [sp, 0x4] - mov r0, sp - bl __pack_d - add sp, 0x1C - pop {pc} - thumb_func_end __negdf2 - - thumb_func_start __make_dp -__make_dp: @ 82E89D0 - sub sp, 0x4 - push {r4,lr} - sub sp, 0x14 - str r3, [sp, 0x1C] - ldr r3, [sp, 0x1C] - ldr r4, [sp, 0x20] - str r0, [sp] - str r1, [sp, 0x4] - str r2, [sp, 0x8] - str r3, [sp, 0xC] - str r4, [sp, 0x10] - mov r0, sp - bl __pack_d - add sp, 0x14 - pop {r4} - pop {r3} - add sp, 0x4 - bx r3 - thumb_func_end __make_dp - - thumb_func_start __truncdfsf2 -__truncdfsf2: @ 82E89F8 - push {r4,r5,lr} - sub sp, 0x1C - str r0, [sp, 0x14] - str r1, [sp, 0x18] - add r0, sp, 0x14 - mov r1, sp - bl __unpack_d - ldr r2, [sp, 0xC] - ldr r3, [sp, 0x10] - lsls r5, r3, 2 - lsrs r4, r2, 30 - adds r0, r5, 0 - orrs r0, r4 - adds r5, r0, 0 - ldr r4, _082E8A38 - adds r0, r2, 0 - ands r0, r4 - movs r1, 0 - orrs r0, r1 - cmp r0, 0 - beq _082E8A28 - movs r0, 0x1 - orrs r5, r0 -_082E8A28: - ldr r0, [sp] - ldr r1, [sp, 0x4] - ldr r2, [sp, 0x8] - adds r3, r5, 0 - bl __make_fp - add sp, 0x1C - pop {r4,r5,pc} - .align 2, 0 -_082E8A38: .4byte 0x3fffffff - thumb_func_end __truncdfsf2 - - thumb_func_start __pack_f -__pack_f: @ 82E8A3C - push {r4-r6,lr} - ldr r2, [r0, 0xC] - ldr r6, [r0, 0x4] - movs r5, 0 - movs r1, 0 - ldr r3, [r0] - cmp r3, 0x1 - bhi _082E8A4E - movs r1, 0x1 -_082E8A4E: - cmp r1, 0 - beq _082E8A5C - movs r5, 0xFF - movs r0, 0x80 - lsls r0, 13 - orrs r2, r0 - b _082E8AC2 -_082E8A5C: - movs r1, 0 - cmp r3, 0x4 - bne _082E8A64 - movs r1, 0x1 -_082E8A64: - cmp r1, 0 - bne _082E8A98 - movs r1, 0 - cmp r3, 0x2 - bne _082E8A70 - movs r1, 0x1 -_082E8A70: - cmp r1, 0 - beq _082E8A78 - movs r2, 0 - b _082E8AC2 -_082E8A78: - cmp r2, 0 - beq _082E8AC2 - ldr r0, [r0, 0x8] - movs r3, 0x7E - negs r3, r3 - cmp r0, r3 - bge _082E8A94 - subs r0, r3, r0 - cmp r0, 0x19 - ble _082E8A90 - movs r2, 0 - b _082E8AC0 -_082E8A90: - lsrs r2, r0 - b _082E8AC0 -_082E8A94: - cmp r0, 0x7F - ble _082E8A9E -_082E8A98: - movs r5, 0xFF - movs r2, 0 - b _082E8AC2 -_082E8A9E: - adds r5, r0, 0 - adds r5, 0x7F - movs r0, 0x7F - ands r0, r2 - cmp r0, 0x40 - bne _082E8AB6 - movs r0, 0x80 - ands r0, r2 - cmp r0, 0 - beq _082E8AB8 - adds r2, 0x40 - b _082E8AB8 -_082E8AB6: - adds r2, 0x3F -_082E8AB8: - cmp r2, 0 - bge _082E8AC0 - lsrs r2, 1 - adds r5, 0x1 -_082E8AC0: - lsrs r2, 7 -_082E8AC2: - ldr r0, _082E8AE4 - ands r2, r0 - ldr r0, _082E8AE8 - ands r4, r0 - orrs r4, r2 - movs r0, 0xFF - ands r5, r0 - lsls r1, r5, 23 - ldr r0, _082E8AEC - ands r4, r0 - orrs r4, r1 - lsls r1, r6, 31 - ldr r0, _082E8AF0 - ands r4, r0 - orrs r4, r1 - adds r0, r4, 0 - pop {r4-r6,pc} - .align 2, 0 -_082E8AE4: .4byte 0x007fffff -_082E8AE8: .4byte 0xff800000 -_082E8AEC: .4byte 0x807fffff -_082E8AF0: .4byte 0x7fffffff - thumb_func_end __pack_f - - thumb_func_start __unpack_f -__unpack_f: @ 82E8AF4 - push {r4,lr} - adds r3, r1, 0 - ldr r0, [r0] - lsls r1, r0, 9 - lsrs r2, r1, 9 - lsls r1, r0, 1 - lsrs r1, 24 - lsrs r0, 31 - str r0, [r3, 0x4] - cmp r1, 0 - bne _082E8B38 - cmp r2, 0 - bne _082E8B14 - movs r0, 0x2 - str r0, [r3] - b _082E8B6C -_082E8B14: - adds r4, r1, 0 - subs r4, 0x7E - str r4, [r3, 0x8] - lsls r2, 7 - movs r0, 0x3 - str r0, [r3] - ldr r1, _082E8B34 - cmp r2, r1 - bhi _082E8B54 - adds r0, r4, 0 -_082E8B28: - lsls r2, 1 - subs r0, 0x1 - cmp r2, r1 - bls _082E8B28 - str r0, [r3, 0x8] - b _082E8B54 - .align 2, 0 -_082E8B34: .4byte 0x3fffffff -_082E8B38: - cmp r1, 0xFF - bne _082E8B58 - cmp r2, 0 - bne _082E8B46 - movs r0, 0x4 - str r0, [r3] - b _082E8B6C -_082E8B46: - movs r0, 0x80 - lsls r0, 13 - ands r0, r2 - cmp r0, 0 - beq _082E8B52 - movs r0, 0x1 -_082E8B52: - str r0, [r3] -_082E8B54: - str r2, [r3, 0xC] - b _082E8B6C -_082E8B58: - adds r0, r1, 0 - subs r0, 0x7F - str r0, [r3, 0x8] - movs r0, 0x3 - str r0, [r3] - lsls r0, r2, 7 - movs r1, 0x80 - lsls r1, 23 - orrs r0, r1 - str r0, [r3, 0xC] -_082E8B6C: - pop {r4,pc} - thumb_func_end __unpack_f - - thumb_func_start __fpadd_parts_f -__fpadd_parts_f: @ 82E8B70 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - adds r7, r1, 0 - adds r5, r2, 0 - movs r0, 0 - ldr r2, [r6] - cmp r2, 0x1 - bhi _082E8B86 - movs r0, 0x1 -_082E8B86: - cmp r0, 0 - beq _082E8B8E -_082E8B8A: - adds r0, r6, 0 - b _082E8CE4 -_082E8B8E: - movs r1, 0 - ldr r0, [r7] - cmp r0, 0x1 - bhi _082E8B98 - movs r1, 0x1 -_082E8B98: - cmp r1, 0 - bne _082E8C0C - movs r1, 0 - cmp r2, 0x4 - bne _082E8BA4 - movs r1, 0x1 -_082E8BA4: - cmp r1, 0 - beq _082E8BC4 - movs r1, 0 - cmp r0, 0x4 - bne _082E8BB0 - movs r1, 0x1 -_082E8BB0: - cmp r1, 0 - beq _082E8B8A - ldr r1, [r6, 0x4] - ldr r0, [r7, 0x4] - cmp r1, r0 - beq _082E8B8A - ldr r0, _082E8BC0 - b _082E8CE4 - .align 2, 0 -_082E8BC0: .4byte 0x03001a98 -_082E8BC4: - movs r1, 0 - cmp r0, 0x4 - bne _082E8BCC - movs r1, 0x1 -_082E8BCC: - cmp r1, 0 - bne _082E8C0C - movs r1, 0 - cmp r0, 0x2 - bne _082E8BD8 - movs r1, 0x1 -_082E8BD8: - cmp r1, 0 - beq _082E8BFE - movs r0, 0 - cmp r2, 0x2 - bne _082E8BE4 - movs r0, 0x1 -_082E8BE4: - cmp r0, 0 - beq _082E8B8A - adds r1, r5, 0 - adds r0, r6, 0 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldr r0, [r0] - str r0, [r1] - ldr r0, [r6, 0x4] - ldr r1, [r7, 0x4] - ands r0, r1 - str r0, [r5, 0x4] - b _082E8CE2 -_082E8BFE: - movs r1, 0 - ldr r0, [r6] - cmp r0, 0x2 - bne _082E8C08 - movs r1, 0x1 -_082E8C08: - cmp r1, 0 - beq _082E8C10 -_082E8C0C: - adds r0, r7, 0 - b _082E8CE4 -_082E8C10: - ldr r1, [r6, 0x8] - ldr r3, [r7, 0x8] - ldr r2, [r6, 0xC] - ldr r4, [r7, 0xC] - subs r0, r1, r3 - cmp r0, 0 - bge _082E8C20 - negs r0, r0 -_082E8C20: - cmp r0, 0x1F - bgt _082E8C64 - ldr r6, [r6, 0x4] - ldr r7, [r7, 0x4] - mov r8, r7 - cmp r1, r3 - ble _082E8C46 - movs r7, 0x1 - mov r12, r7 - subs r3, r1, r3 -_082E8C34: - subs r3, 0x1 - adds r0, r4, 0 - mov r7, r12 - ands r0, r7 - lsrs r4, 1 - orrs r4, r0 - cmp r3, 0 - bne _082E8C34 - adds r3, r1, 0 -_082E8C46: - cmp r3, r1 - ble _082E8C76 - movs r0, 0x1 - mov r12, r0 - subs r1, r3, r1 -_082E8C50: - subs r1, 0x1 - adds r0, r2, 0 - mov r7, r12 - ands r0, r7 - lsrs r2, 1 - orrs r2, r0 - cmp r1, 0 - bne _082E8C50 - adds r1, r3, 0 - b _082E8C76 -_082E8C64: - cmp r1, r3 - ble _082E8C6C - movs r4, 0 - b _082E8C70 -_082E8C6C: - adds r1, r3, 0 - movs r2, 0 -_082E8C70: - ldr r6, [r6, 0x4] - ldr r7, [r7, 0x4] - mov r8, r7 -_082E8C76: - cmp r6, r8 - beq _082E8CC0 - cmp r6, 0 - beq _082E8C82 - subs r3, r4, r2 - b _082E8C84 -_082E8C82: - subs r3, r2, r4 -_082E8C84: - cmp r3, 0 - blt _082E8C92 - movs r0, 0 - str r0, [r5, 0x4] - str r1, [r5, 0x8] - str r3, [r5, 0xC] - b _082E8C9C -_082E8C92: - movs r0, 0x1 - str r0, [r5, 0x4] - str r1, [r5, 0x8] - negs r0, r3 - str r0, [r5, 0xC] -_082E8C9C: - ldr r1, [r5, 0xC] - subs r0, r1, 0x1 - ldr r2, _082E8CBC - cmp r0, r2 - bhi _082E8CC8 -_082E8CA6: - lsls r0, r1, 1 - str r0, [r5, 0xC] - ldr r1, [r5, 0x8] - subs r1, 0x1 - str r1, [r5, 0x8] - adds r1, r0, 0 - subs r0, r1, 0x1 - cmp r0, r2 - bls _082E8CA6 - b _082E8CC8 - .align 2, 0 -_082E8CBC: .4byte 0x3ffffffe -_082E8CC0: - str r6, [r5, 0x4] - str r1, [r5, 0x8] - adds r0, r2, r4 - str r0, [r5, 0xC] -_082E8CC8: - movs r0, 0x3 - str r0, [r5] - ldr r1, [r5, 0xC] - cmp r1, 0 - bge _082E8CE2 - movs r0, 0x1 - ands r0, r1 - lsrs r1, 1 - orrs r0, r1 - str r0, [r5, 0xC] - ldr r0, [r5, 0x8] - adds r0, 0x1 - str r0, [r5, 0x8] -_082E8CE2: - adds r0, r5, 0 -_082E8CE4: - pop {r3} - mov r8, r3 - pop {r4-r7,pc} - thumb_func_end __fpadd_parts_f - - thumb_func_start __addsf3 -__addsf3: @ 82E8CEC - push {r4,lr} - sub sp, 0x38 - str r0, [sp, 0x30] - str r1, [sp, 0x34] - add r0, sp, 0x30 - mov r1, sp - bl __unpack_f - add r0, sp, 0x34 - add r4, sp, 0x10 - adds r1, r4, 0 - bl __unpack_f - add r2, sp, 0x20 - mov r0, sp - adds r1, r4, 0 - bl __fpadd_parts_f - bl __pack_f - add sp, 0x38 - pop {r4,pc} - thumb_func_end __addsf3 - - thumb_func_start __subsf3 -__subsf3: @ 82E8D18 - push {r4,lr} - sub sp, 0x38 - str r0, [sp, 0x30] - str r1, [sp, 0x34] - add r0, sp, 0x30 - mov r1, sp - bl __unpack_f - add r0, sp, 0x34 - add r4, sp, 0x10 - adds r1, r4, 0 - bl __unpack_f - ldr r0, [r4, 0x4] - movs r1, 0x1 - eors r0, r1 - str r0, [r4, 0x4] - add r2, sp, 0x20 - mov r0, sp - adds r1, r4, 0 - bl __fpadd_parts_f - bl __pack_f - add sp, 0x38 - pop {r4,pc} - thumb_func_end __subsf3 - - thumb_func_start __mulsf3 -__mulsf3: @ 82E8D4C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x38 - str r0, [sp, 0x30] - str r1, [sp, 0x34] - add r0, sp, 0x30 - mov r1, sp - bl __unpack_f - add r0, sp, 0x34 - add r4, sp, 0x10 - adds r1, r4, 0 - bl __unpack_f - mov r7, sp - add r0, sp, 0x20 - mov r8, r0 - movs r0, 0 - ldr r1, [sp] - mov r9, r8 - cmp r1, 0x1 - bhi _082E8D7E - movs r0, 0x1 -_082E8D7E: - cmp r0, 0 - bne _082E8DDC - movs r2, 0 - ldr r0, [sp, 0x10] - cmp r0, 0x1 - bhi _082E8D8C - movs r2, 0x1 -_082E8D8C: - cmp r2, 0 - beq _082E8D94 - ldr r0, [sp, 0x4] - b _082E8DFC -_082E8D94: - movs r2, 0 - cmp r1, 0x4 - bne _082E8D9C - movs r2, 0x1 -_082E8D9C: - cmp r2, 0 - beq _082E8DAE - movs r1, 0 - cmp r0, 0x2 - bne _082E8DA8 - movs r1, 0x1 -_082E8DA8: - cmp r1, 0 - bne _082E8DC6 - b _082E8DDC -_082E8DAE: - movs r2, 0 - cmp r0, 0x4 - bne _082E8DB6 - movs r2, 0x1 -_082E8DB6: - cmp r2, 0 - beq _082E8DD0 - movs r0, 0 - cmp r1, 0x2 - bne _082E8DC2 - movs r0, 0x1 -_082E8DC2: - cmp r0, 0 - beq _082E8DFA -_082E8DC6: - ldr r0, _082E8DCC - b _082E8E9E - .align 2, 0 -_082E8DCC: .4byte 0x03001a98 -_082E8DD0: - movs r2, 0 - cmp r1, 0x2 - bne _082E8DD8 - movs r2, 0x1 -_082E8DD8: - cmp r2, 0 - beq _082E8DEE -_082E8DDC: - ldr r0, [sp, 0x4] - ldr r1, [sp, 0x14] - eors r0, r1 - negs r1, r0 - orrs r1, r0 - lsrs r1, 31 - str r1, [sp, 0x4] - mov r0, sp - b _082E8E9E -_082E8DEE: - movs r1, 0 - cmp r0, 0x2 - bne _082E8DF6 - movs r1, 0x1 -_082E8DF6: - cmp r1, 0 - beq _082E8E0C -_082E8DFA: - ldr r0, [r7, 0x4] -_082E8DFC: - ldr r1, [sp, 0x14] - eors r0, r1 - negs r1, r0 - orrs r1, r0 - lsrs r1, 31 - str r1, [sp, 0x14] - adds r0, r4, 0 - b _082E8E9E -_082E8E0C: - ldr r0, [r7, 0xC] - movs r1, 0 - ldr r2, [sp, 0x1C] - movs r3, 0 - bl __muldi3 - adds r2, r1, 0 - adds r5, r2, 0 - adds r6, r0, 0 - ldr r4, [r7, 0x8] - ldr r0, [sp, 0x18] - adds r4, r0 - str r4, [sp, 0x28] - ldr r1, [r7, 0x4] - ldr r0, [sp, 0x14] - eors r1, r0 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - str r0, [sp, 0x24] - adds r4, 0x2 - str r4, [sp, 0x28] - cmp r2, 0 - bge _082E8E58 - movs r2, 0x1 - movs r1, 0x80 - lsls r1, 24 -_082E8E42: - adds r4, 0x1 - adds r0, r5, 0 - ands r0, r2 - cmp r0, 0 - beq _082E8E50 - lsrs r6, 1 - orrs r6, r1 -_082E8E50: - lsrs r5, 1 - cmp r5, 0 - blt _082E8E42 - str r4, [sp, 0x28] -_082E8E58: - ldr r0, _082E8EAC - cmp r5, r0 - bhi _082E8E7E - movs r4, 0x80 - lsls r4, 24 - movs r3, 0x1 - adds r2, r0, 0 - ldr r1, [sp, 0x28] -_082E8E68: - subs r1, 0x1 - lsls r5, 1 - adds r0, r6, 0 - ands r0, r4 - cmp r0, 0 - beq _082E8E76 - orrs r5, r3 -_082E8E76: - lsls r6, 1 - cmp r5, r2 - bls _082E8E68 - str r1, [sp, 0x28] -_082E8E7E: - movs r0, 0x7F - ands r0, r5 - cmp r0, 0x40 - bne _082E8E94 - movs r0, 0x80 - ands r0, r5 - cmp r0, 0 - bne _082E8E92 - cmp r6, 0 - beq _082E8E94 -_082E8E92: - adds r5, 0x40 -_082E8E94: - str r5, [sp, 0x2C] - movs r0, 0x3 - mov r1, r8 - str r0, [r1] - mov r0, r9 -_082E8E9E: - bl __pack_f - add sp, 0x38 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7,pc} - .align 2, 0 -_082E8EAC: .4byte 0x3fffffff - thumb_func_end __mulsf3 - - thumb_func_start __divsf3 -__divsf3: @ 82E8EB0 - push {r4-r6,lr} - sub sp, 0x28 - str r0, [sp, 0x20] - str r1, [sp, 0x24] - add r0, sp, 0x20 - mov r1, sp - bl __unpack_f - add r0, sp, 0x24 - add r5, sp, 0x10 - adds r1, r5, 0 - bl __unpack_f - mov r4, sp - movs r0, 0 - ldr r3, [sp] - cmp r3, 0x1 - bhi _082E8ED6 - movs r0, 0x1 -_082E8ED6: - cmp r0, 0 - beq _082E8EDE - mov r1, sp - b _082E8F90 -_082E8EDE: - movs r0, 0 - ldr r2, [sp, 0x10] - adds r6, r2, 0 - cmp r2, 0x1 - bhi _082E8EEA - movs r0, 0x1 -_082E8EEA: - cmp r0, 0 - beq _082E8EF2 - adds r1, r5, 0 - b _082E8F90 -_082E8EF2: - ldr r0, [sp, 0x4] - ldr r1, [sp, 0x14] - eors r0, r1 - str r0, [sp, 0x4] - movs r0, 0 - cmp r3, 0x4 - bne _082E8F02 - movs r0, 0x1 -_082E8F02: - cmp r0, 0 - bne _082E8F12 - movs r0, 0 - cmp r3, 0x2 - bne _082E8F0E - movs r0, 0x1 -_082E8F0E: - cmp r0, 0 - beq _082E8F24 -_082E8F12: - ldr r0, [r4] - adds r1, r4, 0 - cmp r0, r6 - bne _082E8F90 - ldr r1, _082E8F20 - b _082E8F90 - .align 2, 0 -_082E8F20: .4byte 0x03001a98 -_082E8F24: - movs r1, 0 - cmp r2, 0x4 - bne _082E8F2C - movs r1, 0x1 -_082E8F2C: - cmp r1, 0 - beq _082E8F38 - str r0, [sp, 0xC] - str r0, [sp, 0x8] - mov r1, sp - b _082E8F90 -_082E8F38: - movs r0, 0 - cmp r2, 0x2 - bne _082E8F40 - movs r0, 0x1 -_082E8F40: - cmp r0, 0 - beq _082E8F4A - movs r0, 0x4 - str r0, [r4] - b _082E8F8E -_082E8F4A: - ldr r1, [r4, 0x8] - ldr r0, [sp, 0x18] - subs r0, r1, r0 - str r0, [r4, 0x8] - ldr r2, [r4, 0xC] - ldr r3, [sp, 0x1C] - cmp r2, r3 - bcs _082E8F60 - lsls r2, 1 - subs r0, 0x1 - str r0, [r4, 0x8] -_082E8F60: - movs r0, 0x80 - lsls r0, 23 - movs r1, 0 -_082E8F66: - cmp r2, r3 - bcc _082E8F6E - orrs r1, r0 - subs r2, r3 -_082E8F6E: - lsrs r0, 1 - lsls r2, 1 - cmp r0, 0 - bne _082E8F66 - movs r0, 0x7F - ands r0, r1 - cmp r0, 0x40 - bne _082E8F8C - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _082E8F8A - cmp r2, 0 - beq _082E8F8C -_082E8F8A: - adds r1, 0x40 -_082E8F8C: - str r1, [r4, 0xC] -_082E8F8E: - adds r1, r4, 0 -_082E8F90: - adds r0, r1, 0 - bl __pack_f - add sp, 0x28 - pop {r4-r6,pc} - thumb_func_end __divsf3 - - thumb_func_start __fpcmp_parts_f -__fpcmp_parts_f: @ 82E8F9C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0 - ldr r2, [r4] - cmp r2, 0x1 - bhi _082E8FAA - movs r0, 0x1 -_082E8FAA: - cmp r0, 0 - bne _082E8FBC - movs r0, 0 - ldr r3, [r1] - cmp r3, 0x1 - bhi _082E8FB8 - movs r0, 0x1 -_082E8FB8: - cmp r0, 0 - beq _082E8FC0 -_082E8FBC: - movs r0, 0x1 - b _082E907E -_082E8FC0: - movs r0, 0 - cmp r2, 0x4 - bne _082E8FC8 - movs r0, 0x1 -_082E8FC8: - cmp r0, 0 - beq _082E8FE0 - movs r0, 0 - cmp r3, 0x4 - bne _082E8FD4 - movs r0, 0x1 -_082E8FD4: - cmp r0, 0 - beq _082E8FE0 - ldr r0, [r1, 0x4] - ldr r1, [r4, 0x4] - subs r0, r1 - b _082E907E -_082E8FE0: - movs r2, 0 - ldr r0, [r4] - cmp r0, 0x4 - bne _082E8FEA - movs r2, 0x1 -_082E8FEA: - cmp r2, 0 - bne _082E9038 - movs r2, 0 - cmp r3, 0x4 - bne _082E8FF6 - movs r2, 0x1 -_082E8FF6: - cmp r2, 0 - beq _082E9008 -_082E8FFA: - ldr r0, [r1, 0x4] - movs r1, 0x1 - negs r1, r1 - cmp r0, 0 - beq _082E9042 - movs r1, 0x1 - b _082E9042 -_082E9008: - movs r2, 0 - cmp r0, 0x2 - bne _082E9010 - movs r2, 0x1 -_082E9010: - cmp r2, 0 - beq _082E9020 - movs r2, 0 - cmp r3, 0x2 - bne _082E901C - movs r2, 0x1 -_082E901C: - cmp r2, 0 - bne _082E907C -_082E9020: - movs r2, 0 - cmp r0, 0x2 - bne _082E9028 - movs r2, 0x1 -_082E9028: - cmp r2, 0 - bne _082E8FFA - movs r0, 0 - cmp r3, 0x2 - bne _082E9034 - movs r0, 0x1 -_082E9034: - cmp r0, 0 - beq _082E9046 -_082E9038: - ldr r0, [r4, 0x4] - movs r1, 0x1 - cmp r0, 0 - beq _082E9042 - subs r1, 0x2 -_082E9042: - adds r0, r1, 0 - b _082E907E -_082E9046: - ldr r3, [r4, 0x4] - ldr r0, [r1, 0x4] - cmp r3, r0 - beq _082E9058 -_082E904E: - movs r0, 0x1 - cmp r3, 0 - beq _082E907E - subs r0, 0x2 - b _082E907E -_082E9058: - ldr r2, [r4, 0x8] - ldr r0, [r1, 0x8] - cmp r2, r0 - bgt _082E904E - cmp r2, r0 - bge _082E9070 -_082E9064: - movs r0, 0x1 - negs r0, r0 - cmp r3, 0 - beq _082E907E - movs r0, 0x1 - b _082E907E -_082E9070: - ldr r0, [r4, 0xC] - ldr r1, [r1, 0xC] - cmp r0, r1 - bhi _082E904E - cmp r0, r1 - bcc _082E9064 -_082E907C: - movs r0, 0 -_082E907E: - pop {r4,pc} - thumb_func_end __fpcmp_parts_f - - thumb_func_start __cmpsf2 -__cmpsf2: @ 82E9080 - push {r4,lr} - sub sp, 0x28 - str r0, [sp, 0x20] - str r1, [sp, 0x24] - add r0, sp, 0x20 - mov r1, sp - bl __unpack_f - add r0, sp, 0x24 - add r4, sp, 0x10 - adds r1, r4, 0 - bl __unpack_f - mov r0, sp - adds r1, r4, 0 - bl __fpcmp_parts_f - add sp, 0x28 - pop {r4,pc} - thumb_func_end __cmpsf2 - - thumb_func_start __eqsf2 -__eqsf2: @ 82E90A8 - push {r4,lr} - sub sp, 0x28 - str r0, [sp, 0x20] - str r1, [sp, 0x24] - add r0, sp, 0x20 - mov r1, sp - bl __unpack_f - add r0, sp, 0x24 - add r4, sp, 0x10 - adds r1, r4, 0 - bl __unpack_f - movs r1, 0 - ldr r0, [sp] - cmp r0, 0x1 - bhi _082E90CC - movs r1, 0x1 -_082E90CC: - cmp r1, 0 - bne _082E90DE - movs r1, 0 - ldr r0, [sp, 0x10] - cmp r0, 0x1 - bhi _082E90DA - movs r1, 0x1 -_082E90DA: - cmp r1, 0 - beq _082E90E2 -_082E90DE: - movs r0, 0x1 - b _082E90EA -_082E90E2: - mov r0, sp - adds r1, r4, 0 - bl __fpcmp_parts_f -_082E90EA: - add sp, 0x28 - pop {r4,pc} - thumb_func_end __eqsf2 - - thumb_func_start __nesf2 -__nesf2: @ 82E90F0 - push {r4,lr} - sub sp, 0x28 - str r0, [sp, 0x20] - str r1, [sp, 0x24] - add r0, sp, 0x20 - mov r1, sp - bl __unpack_f - add r0, sp, 0x24 - add r4, sp, 0x10 - adds r1, r4, 0 - bl __unpack_f - movs r1, 0 - ldr r0, [sp] - cmp r0, 0x1 - bhi _082E9114 - movs r1, 0x1 -_082E9114: - cmp r1, 0 - bne _082E9126 - movs r1, 0 - ldr r0, [sp, 0x10] - cmp r0, 0x1 - bhi _082E9122 - movs r1, 0x1 -_082E9122: - cmp r1, 0 - beq _082E912A -_082E9126: - movs r0, 0x1 - b _082E9132 -_082E912A: - mov r0, sp - adds r1, r4, 0 - bl __fpcmp_parts_f -_082E9132: - add sp, 0x28 - pop {r4,pc} - thumb_func_end __nesf2 - - thumb_func_start __gtsf2 -__gtsf2: @ 82E9138 - push {r4,lr} - sub sp, 0x28 - str r0, [sp, 0x20] - str r1, [sp, 0x24] - add r0, sp, 0x20 - mov r1, sp - bl __unpack_f - add r0, sp, 0x24 - add r4, sp, 0x10 - adds r1, r4, 0 - bl __unpack_f - movs r1, 0 - ldr r0, [sp] - cmp r0, 0x1 - bhi _082E915C - movs r1, 0x1 -_082E915C: - cmp r1, 0 - bne _082E916E - movs r1, 0 - ldr r0, [sp, 0x10] - cmp r0, 0x1 - bhi _082E916A - movs r1, 0x1 -_082E916A: - cmp r1, 0 - beq _082E9174 -_082E916E: - movs r0, 0x1 - negs r0, r0 - b _082E917C -_082E9174: - mov r0, sp - adds r1, r4, 0 - bl __fpcmp_parts_f -_082E917C: - add sp, 0x28 - pop {r4,pc} - thumb_func_end __gtsf2 - - thumb_func_start __gesf2 -__gesf2: @ 82E9180 - push {r4,lr} - sub sp, 0x28 - str r0, [sp, 0x20] - str r1, [sp, 0x24] - add r0, sp, 0x20 - mov r1, sp - bl __unpack_f - add r0, sp, 0x24 - add r4, sp, 0x10 - adds r1, r4, 0 - bl __unpack_f - movs r1, 0 - ldr r0, [sp] - cmp r0, 0x1 - bhi _082E91A4 - movs r1, 0x1 -_082E91A4: - cmp r1, 0 - bne _082E91B6 - movs r1, 0 - ldr r0, [sp, 0x10] - cmp r0, 0x1 - bhi _082E91B2 - movs r1, 0x1 -_082E91B2: - cmp r1, 0 - beq _082E91BC -_082E91B6: - movs r0, 0x1 - negs r0, r0 - b _082E91C4 -_082E91BC: - mov r0, sp - adds r1, r4, 0 - bl __fpcmp_parts_f -_082E91C4: - add sp, 0x28 - pop {r4,pc} - thumb_func_end __gesf2 - - thumb_func_start __ltsf2 -__ltsf2: @ 82E91C8 - push {r4,lr} - sub sp, 0x28 - str r0, [sp, 0x20] - str r1, [sp, 0x24] - add r0, sp, 0x20 - mov r1, sp - bl __unpack_f - add r0, sp, 0x24 - add r4, sp, 0x10 - adds r1, r4, 0 - bl __unpack_f - movs r1, 0 - ldr r0, [sp] - cmp r0, 0x1 - bhi _082E91EC - movs r1, 0x1 -_082E91EC: - cmp r1, 0 - bne _082E91FE - movs r1, 0 - ldr r0, [sp, 0x10] - cmp r0, 0x1 - bhi _082E91FA - movs r1, 0x1 -_082E91FA: - cmp r1, 0 - beq _082E9202 -_082E91FE: - movs r0, 0x1 - b _082E920A -_082E9202: - mov r0, sp - adds r1, r4, 0 - bl __fpcmp_parts_f -_082E920A: - add sp, 0x28 - pop {r4,pc} - thumb_func_end __ltsf2 - - thumb_func_start __lesf2 -__lesf2: @ 82E9210 - push {r4,lr} - sub sp, 0x28 - str r0, [sp, 0x20] - str r1, [sp, 0x24] - add r0, sp, 0x20 - mov r1, sp - bl __unpack_f - add r0, sp, 0x24 - add r4, sp, 0x10 - adds r1, r4, 0 - bl __unpack_f - movs r1, 0 - ldr r0, [sp] - cmp r0, 0x1 - bhi _082E9234 - movs r1, 0x1 -_082E9234: - cmp r1, 0 - bne _082E9246 - movs r1, 0 - ldr r0, [sp, 0x10] - cmp r0, 0x1 - bhi _082E9242 - movs r1, 0x1 -_082E9242: - cmp r1, 0 - beq _082E924A -_082E9246: - movs r0, 0x1 - b _082E9252 -_082E924A: - mov r0, sp - adds r1, r4, 0 - bl __fpcmp_parts_f -_082E9252: - add sp, 0x28 - pop {r4,pc} - thumb_func_end __lesf2 - - thumb_func_start __floatsisf -__floatsisf: @ 82E9258 - push {lr} - sub sp, 0x10 - adds r1, r0, 0 - movs r0, 0x3 - str r0, [sp] - lsrs r2, r1, 31 - str r2, [sp, 0x4] - cmp r1, 0 - bne _082E9270 - movs r0, 0x2 - str r0, [sp] - b _082E92A8 -_082E9270: - movs r0, 0x1E - str r0, [sp, 0x8] - cmp r2, 0 - beq _082E928E - movs r0, 0x80 - lsls r0, 24 - cmp r1, r0 - bne _082E9288 - ldr r0, _082E9284 - b _082E92AE - .align 2, 0 -_082E9284: .4byte 0xcf000000 -_082E9288: - negs r0, r1 - str r0, [sp, 0xC] - b _082E9290 -_082E928E: - str r1, [sp, 0xC] -_082E9290: - ldr r2, [sp, 0xC] - ldr r3, _082E92B4 - cmp r2, r3 - bhi _082E92A8 - ldr r1, [sp, 0x8] -_082E929A: - lsls r0, r2, 1 - subs r1, 0x1 - adds r2, r0, 0 - cmp r0, r3 - bls _082E929A - str r1, [sp, 0x8] - str r0, [sp, 0xC] -_082E92A8: - mov r0, sp - bl __pack_f -_082E92AE: - add sp, 0x10 - pop {pc} - .align 2, 0 -_082E92B4: .4byte 0x3fffffff - thumb_func_end __floatsisf - - thumb_func_start __fixsfsi -__fixsfsi: @ 82E92B8 - push {lr} - sub sp, 0x14 - str r0, [sp, 0x10] - add r0, sp, 0x10 - mov r1, sp - bl __unpack_f - movs r1, 0 - ldr r0, [sp] - cmp r0, 0x2 - bne _082E92D0 - movs r1, 0x1 -_082E92D0: - cmp r1, 0 - bne _082E9302 - movs r1, 0 - cmp r0, 0x1 - bhi _082E92DC - movs r1, 0x1 -_082E92DC: - cmp r1, 0 - bne _082E9302 - movs r1, 0 - cmp r0, 0x4 - bne _082E92E8 - movs r1, 0x1 -_082E92E8: - cmp r1, 0 - beq _082E92FC -_082E92EC: - ldr r0, [sp, 0x4] - ldr r1, _082E92F8 - cmp r0, 0 - beq _082E931A - adds r1, 0x1 - b _082E931A - .align 2, 0 -_082E92F8: .4byte 0x7fffffff -_082E92FC: - ldr r1, [sp, 0x8] - cmp r1, 0 - bge _082E9306 -_082E9302: - movs r0, 0 - b _082E931C -_082E9306: - cmp r1, 0x1E - bgt _082E92EC - movs r0, 0x1E - subs r0, r1 - ldr r1, [sp, 0xC] - lsrs r1, r0 - ldr r0, [sp, 0x4] - cmp r0, 0 - beq _082E931A - negs r1, r1 -_082E931A: - adds r0, r1, 0 -_082E931C: - add sp, 0x14 - pop {pc} - thumb_func_end __fixsfsi - - thumb_func_start __negsf2 -__negsf2: @ 82E9320 - push {lr} - sub sp, 0x14 - str r0, [sp, 0x10] - add r0, sp, 0x10 - mov r1, sp - bl __unpack_f - movs r1, 0 - ldr r0, [sp, 0x4] - cmp r0, 0 - bne _082E9338 - movs r1, 0x1 -_082E9338: - str r1, [sp, 0x4] - mov r0, sp - bl __pack_f - add sp, 0x14 - pop {pc} - thumb_func_end __negsf2 - - thumb_func_start __make_fp -__make_fp: @ 82E9344 - push {lr} - sub sp, 0x10 - str r0, [sp] - str r1, [sp, 0x4] - str r2, [sp, 0x8] - str r3, [sp, 0xC] - mov r0, sp - bl __pack_f - add sp, 0x10 - pop {pc} - thumb_func_end __make_fp - - thumb_func_start __extendsfdf2 -__extendsfdf2: @ 82E935C - push {r4-r6,lr} - sub sp, 0x18 - str r0, [sp, 0x14] - add r0, sp, 0x14 - add r1, sp, 0x4 - bl __unpack_f - ldr r0, [sp, 0x4] - ldr r1, [sp, 0x8] - ldr r2, [sp, 0xC] - ldr r3, [sp, 0x10] - movs r4, 0 - lsrs r6, r3, 2 - lsls r5, r4, 30 - adds r4, r6, 0 - orrs r4, r5 - lsls r3, 30 - str r4, [sp] - bl __make_dp - add sp, 0x18 - pop {r4-r6,pc} - thumb_func_end __extendsfdf2 - - thumb_func_start __lshrdi3 -__lshrdi3: @ 82E9388 - push {r4-r6,lr} - adds r6, r1, 0 - adds r5, r0, 0 - cmp r2, 0 - beq _082E93B8 - movs r0, 0x20 - subs r0, r2 - cmp r0, 0 - bgt _082E93A4 - movs r4, 0 - negs r0, r0 - adds r3, r6, 0 - lsrs r3, r0 - b _082E93B4 -_082E93A4: - adds r1, r6, 0 - lsls r1, r0 - adds r4, r6, 0 - lsrs r4, r2 - adds r0, r5, 0 - lsrs r0, r2 - adds r3, r0, 0 - orrs r3, r1 -_082E93B4: - adds r1, r4, 0 - adds r0, r3, 0 -_082E93B8: - pop {r4-r6,pc} - thumb_func_end __lshrdi3 - - thumb_func_start __negdi2 -__negdi2: @ 82E93BC - push {r4,lr} - negs r2, r0 - adds r3, r2, 0 - negs r1, r1 - cmp r2, 0 - beq _082E93CA - subs r1, 0x1 -_082E93CA: - adds r4, r1, 0 - adds r1, r4, 0 - adds r0, r3, 0 - pop {r4,pc} - thumb_func_end __negdi2 - - thumb_func_start memcpy -@ void *memcpy(void *dest, void *src, int size) -memcpy: @ 82E93D4 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r5, 0 - adds r3, r1, 0 - cmp r2, 0xF - bls _082E9414 - adds r0, r3, 0 - orrs r0, r5 - movs r1, 0x3 - ands r0, r1 - cmp r0, 0 - bne _082E9414 - adds r1, r5, 0 -_082E93EE: - 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 _082E93EE - cmp r2, 0x3 - bls _082E9412 -_082E9408: - ldm r3!, {r0} - stm r1!, {r0} - subs r2, 0x4 - cmp r2, 0x3 - bhi _082E9408 -_082E9412: - adds r4, r1, 0 -_082E9414: - subs r2, 0x1 - movs r0, 0x1 - negs r0, r0 - cmp r2, r0 - beq _082E942E - adds r1, r0, 0 -_082E9420: - ldrb r0, [r3] - strb r0, [r4] - adds r3, 0x1 - adds r4, 0x1 - subs r2, 0x1 - cmp r2, r1 - bne _082E9420 -_082E942E: - adds r0, r5, 0 - pop {r4,r5,pc} - thumb_func_end memcpy - - thumb_func_start memset -@ void *memset(void *dest, char c, int size) -memset: @ 82E9434 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - adds r3, r5, 0 - cmp r2, 0x3 - bls _082E947A - movs r0, 0x3 - ands r0, r5 - cmp r0, 0 - bne _082E947A - 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 _082E946E -_082E945A: - stm r1!, {r3} - stm r1!, {r3} - stm r1!, {r3} - stm r1!, {r3} - subs r2, 0x10 - cmp r2, 0xF - bhi _082E945A - b _082E946E -_082E946A: - stm r1!, {r3} - subs r2, 0x4 -_082E946E: - cmp r2, 0x3 - bhi _082E946A - adds r3, r1, 0 - b _082E947A -_082E9476: - strb r4, [r3] - adds r3, 0x1 -_082E947A: - adds r0, r2, 0 - subs r2, 0x1 - cmp r0, 0 - bne _082E9476 - adds r0, r5, 0 - pop {r4,r5,pc} - thumb_func_end memset - - thumb_func_start strcmp -@ int strcmp(char *s1, char *s2) -strcmp: @ 82E9488 - 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 _082E94CE - ldr r1, [r2] - ldr r0, [r3] - cmp r1, r0 - bne _082E94CE - ldr r5, _082E94B4 - ldr r4, _082E94B8 -_082E94A4: - ldr r1, [r2] - adds r0, r1, r5 - bics r0, r1 - ands r0, r4 - cmp r0, 0 - beq _082E94BC - movs r0, 0 - b _082E94E0 - .align 2, 0 -_082E94B4: .4byte 0xfefefeff -_082E94B8: .4byte 0x80808080 -_082E94BC: - adds r2, 0x4 - adds r3, 0x4 - ldr r1, [r2] - ldr r0, [r3] - cmp r1, r0 - beq _082E94A4 - b _082E94CE -_082E94CA: - adds r2, 0x1 - adds r3, 0x1 -_082E94CE: - ldrb r0, [r2] - cmp r0, 0 - beq _082E94DA - ldrb r1, [r3] - cmp r0, r1 - beq _082E94CA -_082E94DA: - ldrb r2, [r2] - ldrb r3, [r3] - subs r0, r2, r3 -_082E94E0: - pop {r4,r5,pc} - thumb_func_end strcmp - - thumb_func_start strcat -strcat: @ 82E94E4 - 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 _082E951C - ldr r1, [r2] - ldr r5, _082E9504 - adds r0, r1, r5 - bics r0, r1 - ldr r4, _082E9508 - b _082E9516 - .align 2, 0 -_082E9504: .4byte 0xfefefeff -_082E9508: .4byte 0x80808080 -_082E950C: - ldm r2!, {r0} - stm r3!, {r0} - ldr r1, [r2] - adds r0, r1, r5 - bics r0, r1 -_082E9516: - ands r0, r4 - cmp r0, 0 - beq _082E950C -_082E951C: - ldrb r0, [r2] - strb r0, [r3] - lsls r0, 24 - adds r2, 0x1 - adds r3, 0x1 - cmp r0, 0 - bne _082E951C - adds r0, r6, 0 - pop {r4-r6,pc} - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_80093CC.s b/asm/rom_80093CC.s new file mode 100644 index 0000000000..287afef484 --- /dev/null +++ b/asm/rom_80093CC.s @@ -0,0 +1,73847 @@ + .include "asm/macros.s" + .include "constants/constants.s" + + .syntax unified + + .text + + thumb_func_start sub_80093CC +sub_80093CC: @ 80093CC + push {lr} + bl sub_800B488 + bl sub_800E700 + bl sub_800BEC0 + ldr r1, =0x00008001 + cmp r0, r1 + beq _080093F4 + bl sub_800B4A4 + bl sub_80097E8 + bl RestoreSerialTimer3IntrHandlers + movs r0, 0 + b _080093FE + .pool +_080093F4: + bl rfu_REQ_stopMode + bl rfu_waitREQComplete + movs r0, 0x1 +_080093FE: + pop {r1} + bx r1 + thumb_func_end sub_80093CC + + thumb_func_start sub_8009404 +sub_8009404: @ 8009404 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl remove_task + pop {r0} + bx r0 + thumb_func_end sub_8009404 + + thumb_func_start sub_8009414 +sub_8009414: @ 8009414 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + ldr r4, [sp, 0x18] + lsls r5, 24 + lsrs r5, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r2, 24 + lsrs r6, r2, 24 + lsls r3, 24 + lsrs r7, r3, 24 + lsls r4, 16 + lsrs r4, 16 + ldr r0, =gUnknown_082ECF20 + lsls r1, r5, 4 + movs r2, 0x20 + bl gpu_pal_apply + ldr r3, =0x040000d4 + ldr r0, =gUnknown_082ECF40 + str r0, [r3] + lsls r2, r7, 14 + lsls r0, r4, 5 + movs r1, 0xC0 + lsls r1, 19 + adds r0, r1 + adds r2, r0 + str r2, [r3, 0x4] + ldr r0, =0x80000110 + str r0, [r3, 0x8] + ldr r0, [r3, 0x8] + ldr r0, =0x03003130 + str r6, [r0] + str r5, [r0, 0x4] + str r4, [r0, 0x8] + mov r0, r8 + cmp r0, 0x2 + beq _0800949E + cmp r0, 0x2 + bgt _08009484 + cmp r0, 0x1 + beq _0800948C + b _080094C0 + .pool +_08009484: + mov r0, r8 + cmp r0, 0x3 + beq _080094B0 + b _080094C0 +_0800948C: + lsls r1, r6, 8 + movs r0, 0x1 + orrs r1, r0 + lsls r0, r7, 2 + orrs r1, r0 + movs r0, 0xA + bl SetGpuReg + b _080094C0 +_0800949E: + lsls r1, r6, 8 + movs r0, 0x1 + orrs r1, r0 + lsls r0, r7, 2 + orrs r1, r0 + movs r0, 0xC + bl SetGpuReg + b _080094C0 +_080094B0: + lsls r1, r6, 8 + movs r0, 0x1 + orrs r1, r0 + lsls r0, r7, 2 + orrs r1, r0 + movs r0, 0xE + bl SetGpuReg +_080094C0: + mov r0, r8 + lsls r4, r0, 2 + adds r0, r4, 0 + adds r0, 0x10 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl SetGpuReg + adds r4, 0x12 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0 + bl SetGpuReg + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8009414 + + thumb_func_start sub_80094EC +sub_80094EC: @ 80094EC + push {r4-r6,lr} + mov r6, r8 + push {r6} + mov r8, r0 + adds r6, r1, 0 + adds r4, r2, 0 + adds r5, r3, 0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r6, 24 + lsrs r6, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_082ECF20 + mov r2, r8 + lsls r1, r2, 4 + movs r2, 0x20 + bl gpu_pal_apply + ldr r2, =0x040000d4 + ldr r0, =gUnknown_082ECF40 + str r0, [r2] + lsls r0, r5, 14 + movs r1, 0xC0 + lsls r1, 19 + adds r0, r1 + str r0, [r2, 0x4] + ldr r0, =0x80000110 + str r0, [r2, 0x8] + ldr r0, [r2, 0x8] + ldr r0, =0x03003130 + str r4, [r0] + mov r1, r8 + str r1, [r0, 0x4] + movs r1, 0 + str r1, [r0, 0x8] + ldr r0, =gUnknown_082ED1D0 + adds r6, r0 + ldrb r0, [r6] + lsls r4, 8 + lsls r5, 2 + orrs r4, r5 + adds r1, r4, 0 + bl SetGpuReg + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80094EC + + thumb_func_start sub_8009570 +sub_8009570: @ 8009570 + push {r4,lr} + sub sp, 0x4 + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + bl clear_tasks + ldr r0, =sub_80096BC + bl SetVBlankCallback + bl sub_800A2E0 + ldr r1, =0x020229c6 + ldr r2, =0x00001111 + adds r0, r2, 0 + strh r0, [r1] + bl sub_8009734 + ldr r0, =0x030022c0 + ldrh r0, [r0, 0x24] + bl SeedRng + movs r4, 0 +_080095A0: + bl GenerateRandomNumber + ldr r1, =0x03005d90 + ldr r1, [r1] + adds r1, 0xA + adds r1, r4 + strb r0, [r1] + adds r4, 0x1 + cmp r4, 0x3 + ble _080095A0 + movs r4, 0 + str r4, [sp] + movs r0, 0 + movs r1, 0x2 + movs r2, 0x4 + movs r3, 0 + bl sub_8009414 + movs r1, 0xAA + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + ldr r0, =sub_8009404 + movs r1, 0 + bl AddTask + bl RunActiveTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + ldr r0, =0x03000d60 + str r4, [r0] + bl sub_8009638 + ldr r0, =task00_link_test + movs r1, 0 + bl AddTask + ldr r0, =c2_08009A8C + bl SetMainCallback2 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8009570 + + thumb_func_start sub_8009628 +sub_8009628: @ 8009628 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x020229cc + strh r0, [r1, 0x18] + bx lr + .pool + thumb_func_end sub_8009628 + + thumb_func_start sub_8009638 +sub_8009638: @ 8009638 + push {r4,r5,lr} + ldr r5, =0x020229cc + ldr r4, =0x03005d90 + ldr r1, [r4] + ldrb r2, [r1, 0xA] + ldrb r0, [r1, 0xB] + lsls r0, 8 + orrs r2, r0 + ldrb r0, [r1, 0xC] + lsls r0, 16 + orrs r2, r0 + ldrb r0, [r1, 0xD] + lsls r0, 24 + orrs r2, r0 + str r2, [r5, 0x4] + adds r0, r5, 0 + adds r0, 0x8 + bl CopyString + ldr r0, [r4] + ldrb r0, [r0, 0x8] + strb r0, [r5, 0x13] + ldr r0, =0x020229c6 + ldrh r0, [r0] + str r0, [r5, 0x14] + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + strh r0, [r5, 0x1A] + ldr r0, =gUnknown_82E9530 + ldrb r0, [r0] + movs r2, 0x80 + lsls r2, 7 + adds r1, r2, 0 + adds r0, r1 + strh r0, [r5] + movs r0, 0x80 + lsls r0, 8 + strh r0, [r5, 0x2] + bl sub_809D42C + strb r0, [r5, 0x10] + ldr r0, =0x0000087f + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0800969E + ldrb r0, [r5, 0x10] + movs r1, 0x10 + orrs r0, r1 + strb r0, [r5, 0x10] +_0800969E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8009638 + + thumb_func_start sub_80096BC +sub_80096BC: @ 80096BC + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_80096BC + + thumb_func_start sub_80096D0 +sub_80096D0: @ 80096D0 + push {lr} + ldr r3, =0x020229c4 + ldr r1, =0x03003110 + ldr r2, =0x0000efff + adds r0, r1, 0 + adds r0, 0xE +_080096DC: + strh r2, [r0] + subs r0, 0x2 + cmp r0, r1 + bge _080096DC + movs r0, 0x1 + strb r0, [r3] + bl sub_800B594 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80096D0 + + thumb_func_start task02_080097CC +task02_080097CC: @ 80096FC + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x03005e00 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + bne _08009726 + ldr r1, =0x03003144 + movs r0, 0x1 + strb r0, [r1] + adds r0, r2, 0 + bl remove_task +_08009726: + pop {r0} + bx r0 + .pool + thumb_func_end task02_080097CC + + thumb_func_start sub_8009734 +sub_8009734: @ 8009734 + push {r4-r6,lr} + ldr r0, =0x030030fc + ldrb r4, [r0] + cmp r4, 0 + bne _080097A8 + bl sub_800B628 + bl sub_80096D0 + ldr r1, =0x03003140 + ldr r0, =sub_800A824 + str r0, [r1] + ldr r0, =0x03002748 + strb r4, [r0] + ldr r0, =0x0300306c + strb r4, [r0] + ldr r0, =0x030030f8 + strb r4, [r0] + bl sub_800A5B4 + bl sub_800A2E0 + ldr r0, =0x03000d54 + str r4, [r0] + ldr r0, =0x030030e8 + strb r4, [r0] + ldr r0, =0x030030e4 + strb r4, [r0] + ldr r0, =0x030030f4 + strh r4, [r0] + ldr r0, =task02_080097CC + movs r1, 0x2 + bl AddTask + b _080097AC + .pool +_080097A8: + bl sub_800E700 +_080097AC: + ldr r1, =0x03003124 + movs r0, 0 + strb r0, [r1] + movs r1, 0 + ldr r6, =0x03003078 + movs r2, 0 + movs r5, 0x1 + ldr r4, =0x030030f0 + ldr r3, =0x030030ec +_080097BE: + adds r0, r1, r6 + strb r5, [r0] + adds r0, r1, r4 + strb r2, [r0] + adds r0, r1, r3 + strb r2, [r0] + adds r1, 0x1 + cmp r1, 0x3 + ble _080097BE + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8009734 + + thumb_func_start sub_80097E8 +sub_80097E8: @ 80097E8 + push {r4,lr} + ldr r0, =0x03003124 + movs r4, 0 + strb r4, [r0] + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _080097FC + bl sub_800EDD4 +_080097FC: + ldr r0, =0x020229c4 + strb r4, [r0] + bl sub_800B53C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80097E8 + + thumb_func_start sub_8009818 +sub_8009818: @ 8009818 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r5, =0x03000d64 + ldr r4, =0x03000d10 + ldrb r0, [r5] + ldrh r1, [r4] + cmp r0, r1 + beq _0800983C + ldrh r0, [r4] + movs r1, 0x2 + movs r2, 0x3 + movs r3, 0x2 + bl sub_800A6E8 + ldrh r0, [r4] + strb r0, [r5] +_0800983C: + movs r5, 0 + ldr r7, =0x03000d20 +_08009840: + ldr r0, =0x03000d68 + adds r6, r5, r0 + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r4, r0, r7 + ldrb r0, [r6] + ldrh r1, [r4] + cmp r0, r1 + beq _08009868 + ldrh r0, [r4] + adds r2, r5, 0x4 + lsls r2, 24 + lsrs r2, 24 + movs r1, 0x2 + movs r3, 0x2 + bl sub_800A6E8 + ldrh r0, [r4] + strb r0, [r6] +_08009868: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _08009840 + bl sub_800A550 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0xF + bne _080098CE + movs r5, 0 + ldr r0, =0x03000d20 + mov r9, r0 + ldr r1, =0x00000342 + mov r8, r1 +_08009888: + adds r0, r7, 0 + asrs r0, r5 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080098C4 + lsls r0, r5, 8 + ldr r1, =0x020223c4 + adds r0, r1 + lsls r4, r5, 1 + adds r1, r4, r5 + lsls r1, 2 + add r1, r9 + ldrh r1, [r1, 0x2] + bl sub_800A648 + ldr r1, =0x03003148 + adds r4, r1 + movs r6, 0 + strh r0, [r4] + adds r0, r5, 0 + bl sub_800A5EC + ldrh r0, [r4] + cmp r0, r8 + beq _080098C4 + ldr r0, =0x020223bc + strb r6, [r0] + ldr r0, =0x020223bd + strb r6, [r0] +_080098C4: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _08009888 +_080098CE: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8009818 + + thumb_func_start sub_8009900 +sub_8009900: @ 8009900 + push {r4,r5,lr} + sub sp, 0x4 + ldr r4, =0x030022c0 + ldrh r1, [r4, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08009916 + ldr r1, =0x03003144 + movs r0, 0x1 + strb r0, [r1] +_08009916: + ldrh r1, [r4, 0x2C] + movs r5, 0x2 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _0800992A + ldr r0, =0x02004000 + ldr r1, =0x00002004 + bl sub_800A2F4 +_0800992A: + ldrh r1, [r4, 0x2E] + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + beq _08009946 + movs r0, 0x1 + negs r0, r0 + str r5, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe +_08009946: + ldrh r1, [r4, 0x2E] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08009956 + movs r0, 0x1 + bl sub_800B330 +_08009956: + ldrh r1, [r4, 0x2E] + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _08009968 + movs r0, 0x1 + bl save_game_when_memory_present +_08009968: + ldrh r1, [r4, 0x2E] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08009976 + bl sub_800AC34 +_08009976: + ldr r0, =0x020223bc + ldrb r0, [r0] + cmp r0, 0 + beq _08009996 + ldr r2, [r4, 0x24] + ldr r0, =0x03002748 + ldrb r1, [r0] + ldr r0, =0x03003140 + ldr r0, [r0] + cmp r0, 0 + bne _08009990 + movs r0, 0x10 + orrs r1, r0 +_08009990: + adds r0, r2, 0 + bl sub_800A994 +_08009996: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8009900 + + thumb_func_start c2_08009A8C +c2_08009A8C: @ 80099BC + push {lr} + bl sub_8009900 + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + bl sub_8009818 + bl RunActiveTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end c2_08009A8C + + thumb_func_start sub_80099E0 +sub_80099E0: @ 80099E0 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, =0x020229c4 + ldrb r0, [r0] + cmp r0, 0 + bne _080099F4 + movs r0, 0 + b _08009A3C + .pool +_080099F4: + movs r1, 0 + ldr r5, =0x03003084 + ldr r3, =0x03003110 + movs r2, 0 +_080099FC: + lsls r0, r1, 1 + adds r0, r3 + strh r2, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x7 + bls _080099FC + ldrh r0, [r4] + strh r0, [r5] + ldr r0, =0x030030e0 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08009A38 + ldr r0, =0x04000128 + ldr r0, [r0] + lsls r0, 26 + lsrs r0, 30 + bl sub_8009AA0 + ldr r0, =0x03003140 + ldr r0, [r0] + cmp r0, 0 + beq _08009A34 + bl _call_via_r0 +_08009A34: + bl sub_800AEB4 +_08009A38: + ldr r0, =0x030030e0 + ldrh r0, [r0] +_08009A3C: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80099E0 + + thumb_func_start sub_8009A58 +sub_8009A58: @ 8009A58 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + ldr r1, =0x03003078 + adds r0, r1 + strb r5, [r0] + movs r4, 0 + adds r6, r1, 0 + b _08009A78 + .pool +_08009A70: + adds r0, r4, r6 + ldrb r0, [r0] + adds r5, r0 + adds r4, 0x1 +_08009A78: + bl sub_800ABAC + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + blt _08009A70 + cmp r5, 0 + bne _08009A94 + ldr r1, =0x03003124 + ldrb r0, [r1] + cmp r0, 0 + bne _08009A94 + movs r0, 0x1 + strb r0, [r1] +_08009A94: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8009A58 + + thumb_func_start sub_8009AA0 +sub_8009AA0: @ 8009AA0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r6, 0 +_08009AAE: + ldr r0, =0x03003020 + lsls r1, r6, 1 + adds r3, r1, r0 + movs r0, 0 + strh r0, [r3] + lsls r4, r6, 4 + ldr r5, =0x03003090 + adds r2, r4, r5 + ldrh r0, [r2] + mov r12, r1 + adds r7, r6, 0x1 + str r7, [sp] + cmp r0, 0 + bne _08009ACC + b _08009D6E +_08009ACC: + ldrh r1, [r2] + ldr r0, =0x00005fff + cmp r1, r0 + bne _08009AD6 + b _08009D20 +_08009AD6: + cmp r1, r0 + bgt _08009B24 + ldr r0, =0x00004444 + cmp r1, r0 + bne _08009AE2 + b _08009D64 +_08009AE2: + cmp r1, r0 + bgt _08009B10 + ldr r0, =0x00002222 + cmp r1, r0 + beq _08009B68 + ldr r0, =0x00002ffe + cmp r1, r0 + bne _08009AF4 + b _08009D28 +_08009AF4: + b _08009D6E + .pool +_08009B10: + ldr r0, =0x00005555 + cmp r1, r0 + beq _08009BB8 + adds r0, 0x11 + cmp r1, r0 + beq _08009BB8 + b _08009D6E + .pool +_08009B24: + ldr r0, =0x0000bbbb + cmp r1, r0 + beq _08009BC4 + cmp r1, r0 + bgt _08009B4C + ldr r0, =0x00008888 + cmp r1, r0 + beq _08009BF0 + ldr r0, =0x0000aaaa + cmp r1, r0 + bne _08009B3C + b _08009D38 +_08009B3C: + b _08009D6E + .pool +_08009B4C: + ldr r0, =0x0000cafe + cmp r1, r0 + bne _08009B54 + b _08009D64 +_08009B54: + ldr r0, =0x0000cccc + cmp r1, r0 + bne _08009B5C + b _08009D3E +_08009B5C: + b _08009D6E + .pool +_08009B68: + bl sub_8009638 + ldr r0, =0x03003030 + adds r2, r0, 0 + adds r2, 0x10 + ldr r1, =0x020229cc + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + ldm r1!, {r3,r6,r7} + stm r2!, {r3,r6,r7} + ldr r1, [r1] + str r1, [r2] + ldr r4, =gUnknown_082ED1D4 + adds r2, r0, 0 + adds r1, r4, 0 + ldm r1!, {r5-r7} + stm r2!, {r5-r7} + ldrh r3, [r1] + strh r3, [r2] + ldrb r1, [r1, 0x2] + strb r1, [r2, 0x2] + adds r1, r0, 0 + adds r1, 0x2C + ldm r4!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldrh r2, [r4] + strh r2, [r1] + ldrb r2, [r4, 0x2] + strb r2, [r1, 0x2] + movs r1, 0x3C + bl sub_800A2F4 + b _08009D6E + .pool +_08009BB8: + ldr r1, =0x030030e8 + movs r0, 0x1 + strb r0, [r1] + b _08009D6E + .pool +_08009BC4: + mov r7, r12 + adds r1, r7, r6 + lsls r1, 2 + ldr r0, =0x03000d20 + adds r1, r0 + movs r2, 0 + strh r2, [r1] + ldr r0, =0x03003090 + adds r0, 0x2 + adds r0, r4, r0 + ldrh r0, [r0] + strh r0, [r1, 0x2] + ldr r0, =0x03003090 + adds r0, 0x4 + adds r0, r4, r0 + ldrh r0, [r0] + strb r0, [r1, 0x9] + b _08009D6E + .pool +_08009BF0: + mov r3, r12 + adds r0, r3, r6 + lsls r0, 2 + ldr r5, =0x03000d20 + adds r3, r0, r5 + ldrh r1, [r3, 0x2] + movs r0, 0x80 + lsls r0, 1 + adds r7, r5, 0 + mov r10, r7 + cmp r1, r0 + bls _08009C40 + ldr r0, =0x0201c000 + mov r8, r0 + movs r2, 0 + adds r5, r3, 0 + ldr r7, =0x03003090 + adds r3, r4, 0 +_08009C14: + ldrh r1, [r5] + lsrs r1, 1 + adds r1, r2 + lsls r1, 1 + add r1, r8 + adds r2, 0x1 + lsls r0, r2, 1 + adds r0, r3 + adds r0, r7 + ldrh r0, [r0] + strh r0, [r1] + lsls r2, 16 + lsrs r2, 16 + cmp r2, 0x6 + bls _08009C14 + b _08009C70 + .pool +_08009C40: + movs r2, 0 + ldr r1, =0x020223c4 + mov r9, r1 + adds r7, r3, 0 + ldr r3, =0x03003090 + mov r8, r3 + lsls r5, r6, 8 + adds r3, r4, 0 +_08009C50: + ldrh r1, [r7] + lsrs r1, 1 + adds r1, r2 + lsls r1, 1 + adds r1, r5 + add r1, r9 + adds r2, 0x1 + lsls r0, r2, 1 + adds r0, r3 + add r0, r8 + ldrh r0, [r0] + strh r0, [r1] + lsls r2, 16 + lsrs r2, 16 + cmp r2, 0x6 + bls _08009C50 +_08009C70: + mov r4, r12 + adds r1, r4, r6 + lsls r1, 2 + add r1, r10 + ldrh r0, [r1] + adds r0, 0xE + movs r3, 0 + strh r0, [r1] + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r1, 0x2] + cmp r0, r1 + bcc _08009D6E + ldr r0, =0x03003078 + adds r0, r6, r0 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08009D16 + lsls r1, r6, 8 + ldr r0, =0x020223c4 + adds r1, r0 + mov r8, r1 + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 2 + ldr r1, =0x020229e8 + adds r2, r0, r1 + adds r1, r2, 0 + mov r0, r8 + adds r0, 0x10 + ldm r0!, {r4,r5,r7} + stm r1!, {r4,r5,r7} + ldm r0!, {r4,r5,r7} + stm r1!, {r4,r5,r7} + ldr r0, [r0] + str r0, [r1] + ldrb r0, [r2] + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _08009CCA + strb r3, [r2, 0x12] + strb r3, [r2, 0x11] + strb r3, [r2, 0x10] +_08009CCA: + adds r0, r2, 0 + bl sub_800B524 + ldr r5, =gUnknown_082ED1D4 + mov r0, r8 + adds r1, r5, 0 + bl strcmp + cmp r0, 0 + bne _08009CEC + mov r0, r8 + adds r0, 0x2C + adds r1, r5, 0 + bl strcmp + cmp r0, 0 + beq _08009D0C +_08009CEC: + ldr r0, =c2_800ACD4 + bl SetMainCallback2 + b _08009D6E + .pool +_08009D0C: + lsls r0, r6, 24 + lsrs r0, 24 + bl sub_8009A58 + b _08009D6E +_08009D16: + lsls r0, r6, 24 + lsrs r0, 24 + bl sub_800A588 + b _08009D6E +_08009D20: + ldr r0, =0x030030f0 + b _08009D2A + .pool +_08009D28: + ldr r0, =0x030030ec +_08009D2A: + adds r0, r6, r0 + movs r1, 0x1 + strb r1, [r0] + b _08009D6E + .pool +_08009D38: + bl sub_800A418 + b _08009D6E +_08009D3E: + ldr r3, =gUnknown_082ED1A8 + ldr r0, =0x03003090 + adds r0, 0x2 + adds r0, r4, r0 + ldrh r2, [r0] + lsls r2, 3 + adds r0, r2, r3 + ldr r1, [r0] + adds r3, 0x4 + adds r2, r3 + ldrh r2, [r2] + movs r0, 0 + bl link_0800A448 + b _08009D6E + .pool +_08009D64: + ldr r0, =0x03003090 + adds r0, 0x2 + adds r0, r4, r0 + ldrh r0, [r0] + strh r0, [r3] +_08009D6E: + ldr r5, [sp] + lsls r0, r5, 16 + lsrs r6, r0, 16 + cmp r6, 0x3 + bhi _08009D7A + b _08009AAE +_08009D7A: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8009AA0 + + thumb_func_start sub_8009D90 +sub_8009D90: @ 8009D90 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, =0x00006666 + cmp r2, r0 + beq _08009E60 + cmp r2, r0 + bgt _08009DF0 + ldr r0, =0x00004444 + cmp r2, r0 + beq _08009E4C + cmp r2, r0 + bgt _08009DCC + ldr r0, =0x00002222 + cmp r2, r0 + beq _08009E38 + ldr r0, =0x00002ffe +_08009DB2: + cmp r2, r0 + bne _08009DB8 + b _08009EE4 +_08009DB8: + b _08009F06 + .pool +_08009DCC: + ldr r0, =0x00005566 + cmp r2, r0 + bne _08009DD4 + b _08009EE4 +_08009DD4: + cmp r2, r0 + bgt _08009DE0 + subs r0, 0x11 + b _08009DB2 + .pool +_08009DE0: + ldr r0, =0x00005fff + cmp r2, r0 + bne _08009DE8 + b _08009ED0 +_08009DE8: + b _08009F06 + .pool +_08009DF0: + ldr r0, =0x0000aaab + cmp r2, r0 + beq _08009EA8 + cmp r2, r0 + bgt _08009E10 + ldr r0, =0x00007777 + cmp r2, r0 + beq _08009E6C + ldr r0, =0x0000aaaa + b _08009DB2 + .pool +_08009E10: + ldr r0, =0x0000cafe + cmp r2, r0 + beq _08009EF0 + cmp r2, r0 + bgt _08009E2C + ldr r0, =0x0000bbbb + cmp r2, r0 + beq _08009E8C + b _08009F06 + .pool +_08009E2C: + ldr r0, =0x0000cccc + cmp r2, r0 + beq _08009EBC + b _08009F06 + .pool +_08009E38: + ldr r0, =0x03003110 + strh r2, [r0] + ldr r1, =0x020229c6 + ldrh r1, [r1] + b _08009F04 + .pool +_08009E4C: + ldr r0, =0x03003110 + strh r2, [r0] + ldr r1, =0x030022c0 + ldrh r1, [r1, 0x2C] + b _08009F04 + .pool +_08009E60: + ldr r0, =0x03003110 + movs r1, 0 + b _08009F02 + .pool +_08009E6C: + ldr r0, =0x03003110 + strh r2, [r0] + movs r1, 0 + adds r3, r0, 0 + movs r2, 0xEE +_08009E76: + adds r1, 0x1 + lsls r0, r1, 1 + adds r0, r3 + strh r2, [r0] + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x4 + bls _08009E76 + b _08009F06 + .pool +_08009E8C: + ldr r1, =0x03003110 + strh r2, [r1] + ldr r2, =0x03000d10 + ldrh r0, [r2, 0x2] + strh r0, [r1, 0x2] + ldrb r0, [r2, 0x9] + adds r0, 0x80 + strh r0, [r1, 0x4] + b _08009F06 + .pool +_08009EA8: + ldr r0, =0x03003110 + strh r2, [r0] + ldr r1, =0x0203ce7c + ldrh r1, [r1] + b _08009F04 + .pool +_08009EBC: + ldr r0, =0x03003110 + strh r2, [r0] + ldr r1, =0x03003150 + ldrb r1, [r1] + b _08009F04 + .pool +_08009ED0: + ldr r0, =0x03003110 + strh r2, [r0] + ldr r1, =0x030030f4 + ldrh r1, [r1] + b _08009F04 + .pool +_08009EE4: + ldr r0, =0x03003110 + strh r2, [r0] + b _08009F06 + .pool +_08009EF0: + ldr r0, =0x03005da8 + ldrh r1, [r0] + cmp r1, 0 + beq _08009F06 + ldr r0, =0x030022b4 + ldrb r0, [r0] + cmp r0, 0 + bne _08009F06 + ldr r0, =0x03003110 +_08009F02: + strh r2, [r0] +_08009F04: + strh r1, [r0, 0x2] +_08009F06: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8009D90 + + thumb_func_start sub_8009F18 +sub_8009F18: @ 8009F18 + push {lr} + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08009F26 + bl sub_800F804 +_08009F26: + ldr r1, =0x03003140 + ldr r0, =sub_8009F70 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8009F18 + + thumb_func_start sub_8009F3C +sub_8009F3C: @ 8009F3C + push {lr} + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08009F50 + bl sub_800F7E4 + b _08009F6A + .pool +_08009F50: + ldr r0, =0x03003140 + ldr r1, [r0] + ldr r0, =sub_8009F70 + cmp r1, r0 + beq _08009F68 + movs r0, 0 + b _08009F6A + .pool +_08009F68: + movs r0, 0x1 +_08009F6A: + pop {r1} + bx r1 + thumb_func_end sub_8009F3C + + thumb_func_start sub_8009F70 +sub_8009F70: @ 8009F70 + push {lr} + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08009F80 + ldr r0, =0x0000cafe + bl sub_8009D90 +_08009F80: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8009F70 + + thumb_func_start sub_8009F8C +sub_8009F8C: @ 8009F8C + push {lr} + ldr r0, =0x030030fc + ldrb r1, [r0] + cmp r1, 0 + beq _08009FA0 + bl Rfu_set_zero + b _08009FA4 + .pool +_08009FA0: + ldr r0, =0x03003140 + str r1, [r0] +_08009FA4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8009F8C + + thumb_func_start sub_8009FAC +sub_8009FAC: @ 8009FAC + push {lr} + ldr r0, =0x030030fc + ldrb r1, [r0] + cmp r1, 0 + beq _08009FC0 + bl Rfu_set_zero + b _08009FC4 + .pool +_08009FC0: + ldr r0, =0x03003140 + str r1, [r0] +_08009FC4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8009FAC + + thumb_func_start sub_8009FCC +sub_8009FCC: @ 8009FCC + push {lr} + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _08009FEC + ldr r0, =0x030030e0 + ldr r0, [r0] + movs r1, 0x1C + ands r0, r1 + lsrs r0, 2 + b _08009FF4 + .pool +_08009FEC: + bl sub_80104F4 + lsls r0, 24 + lsrs r0, 24 +_08009FF4: + pop {r1} + bx r1 + thumb_func_end sub_8009FCC + + thumb_func_start sub_8009FF8 +sub_8009FF8: @ 8009FF8 + push {r4-r7,lr} + adds r6, r0, 0 + adds r5, r1, 0 + bl sub_8009FCC + lsls r0, 24 + lsrs r4, r0, 24 + movs r2, 0 + cmp r2, r4 + bge _0800A030 + movs r7, 0xFF + ldr r3, =0x020229e8 +_0800A010: + ldrh r0, [r3] + adds r1, r7, 0 + ands r1, r0 + cmp r1, r6 + beq _0800A01E + cmp r1, r5 + bne _0800A028 +_0800A01E: + movs r0, 0x1 + b _0800A034 + .pool +_0800A028: + adds r3, 0x1C + adds r2, 0x1 + cmp r2, r4 + blt _0800A010 +_0800A030: + movs r0, 0x1 + negs r0, r0 +_0800A034: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8009FF8 + + thumb_func_start sub_800A03C +sub_800A03C: @ 800A03C + movs r0, 0x2 + bx lr + thumb_func_end sub_800A03C + + thumb_func_start sub_800A040 +sub_800A040: @ 800A040 + push {lr} + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bne _0800A05A + movs r0, 0x2 + movs r1, 0x1 + bl sub_8009FF8 + cmp r0, 0 + bge _0800A05E +_0800A05A: + movs r0, 0 + b _0800A060 +_0800A05E: + movs r0, 0x1 +_0800A060: + pop {r1} + bx r1 + thumb_func_end sub_800A040 + + thumb_func_start sub_800A064 +sub_800A064: @ 800A064 + push {lr} + movs r0, 0x2 + movs r1, 0x1 + bl sub_8009FF8 + cmp r0, 0 + bge _0800A076 + movs r0, 0 + b _0800A078 +_0800A076: + movs r0, 0x1 +_0800A078: + pop {r1} + bx r1 + thumb_func_end sub_800A064 + + thumb_func_start sub_800A07C +sub_800A07C: @ 800A07C + push {lr} + movs r0, 0x4 + movs r1, 0x5 + bl sub_8009FF8 + adds r2, r0, 0 + cmp r2, 0 + blt _0800A0A4 + ldr r0, =0x020229e8 + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x1A] + cmp r0, 0x1 + bne _0800A0A4 + movs r0, 0x1 + b _0800A0A6 + .pool +_0800A0A4: + movs r0, 0 +_0800A0A6: + pop {r1} + bx r1 + thumb_func_end sub_800A07C + + thumb_func_start sub_800A0AC +sub_800A0AC: @ 800A0AC + push {lr} + ldr r0, =0x03000d5c + movs r1, 0 + str r1, [r0] + ldr r0, =0x020229c8 + strh r1, [r0] + bl sub_8009734 + pop {r0} + bx r0 + .pool + thumb_func_end sub_800A0AC + + thumb_func_start sub_800A0C8 +sub_800A0C8: @ 800A0C8 + push {r4-r7,lr} + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + ldr r0, =0x03003124 + ldrb r4, [r0] + cmp r4, 0x1 + beq _0800A0DA + b _0800A214 +_0800A0DA: + bl sub_800ABAC + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + bgt _0800A0EA + cmp r0, r6 + ble _0800A0FC +_0800A0EA: + ldr r1, =0x03000d5c + movs r0, 0x6 + str r0, [r1] + b _0800A22E + .pool +_0800A0FC: + bl sub_8009FCC + lsls r0, 24 + cmp r0, 0 + bne _0800A10E + ldr r0, =0x0300306c + strb r4, [r0] + bl sub_80097E8 +_0800A10E: + movs r6, 0 + ldr r4, =0x020229e8 + movs r5, 0 + b _0800A134 + .pool +_0800A120: + adds r0, r4, 0 + adds r0, 0x14 + adds r0, r5, r0 + ldr r1, [r0] + ldr r0, [r4, 0x14] + cmp r1, r0 + bne _0800A130 + adds r7, 0x1 +_0800A130: + adds r5, 0x1C + adds r6, 0x1 +_0800A134: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + blt _0800A120 + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r7, r0 + bne _0800A1AC + ldr r0, =0x020229e8 + ldr r1, [r0, 0x14] + ldr r0, =0x00001133 + cmp r1, r0 + bne _0800A19C + bl sub_807A728 + cmp r0, 0x1 + beq _0800A184 + cmp r0, 0x1 + bgt _0800A178 + cmp r0, 0 + beq _0800A19C + ldr r3, =0x03000d5c + b _0800A22C + .pool +_0800A178: + cmp r0, 0x2 + beq _0800A190 + ldr r3, =0x03000d5c + b _0800A22C + .pool +_0800A184: + ldr r1, =0x03000d5c + movs r0, 0x4 + b _0800A1A0 + .pool +_0800A190: + ldr r1, =0x03000d5c + movs r0, 0x5 + b _0800A1A0 + .pool +_0800A19C: + ldr r1, =0x03000d5c + movs r0, 0x1 +_0800A1A0: + str r0, [r1] + adds r3, r1, 0 + b _0800A22C + .pool +_0800A1AC: + ldr r6, =0x03000d5c + movs r0, 0x3 + str r0, [r6] + ldr r4, =0x020229e8 + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r4, 0x14 + adds r1, r4 + ldr r5, [r1] + bl link_get_multiplayer_id + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r4 + ldr r1, [r1] + ldr r2, =0x00002266 + cmp r5, r2 + bne _0800A1EA + ldr r0, =0x00002277 + cmp r1, r0 + beq _0800A1F6 +_0800A1EA: + ldr r0, =0x00002277 + adds r3, r6, 0 + cmp r5, r0 + bne _0800A22C + cmp r1, r2 + bne _0800A22C +_0800A1F6: + ldr r1, =0x020375e2 + movs r0, 0x3 + strh r0, [r1] + ldr r3, =0x03000d5c + b _0800A22C + .pool +_0800A214: + ldr r0, =0x020229c8 + ldrh r1, [r0] + adds r1, 0x1 + strh r1, [r0] + lsls r1, 16 + movs r0, 0x96 + lsls r0, 18 + ldr r3, =0x03000d5c + cmp r1, r0 + bls _0800A22C + movs r0, 0x2 + str r0, [r3] +_0800A22C: + ldrb r0, [r3] +_0800A22E: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_800A0C8 + + thumb_func_start sub_800A23C +sub_800A23C: @ 800A23C + push {r4-r6,lr} + movs r6, 0 + movs r4, 0 + ldr r5, =0x020229e8 + b _0800A26C + .pool +_0800A24C: + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r1, r5, 0 + adds r1, 0x14 + adds r0, r1 + ldr r1, [r0] + ldr r0, [r5, 0x14] + cmp r1, r0 + bne _0800A266 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0800A266: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_0800A26C: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bcc _0800A24C + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + bne _0800A290 + movs r2, 0x1 + ldr r0, =0x03000d5c + str r2, [r0] + b _0800A298 + .pool +_0800A290: + movs r2, 0 + ldr r1, =0x03000d5c + movs r0, 0x3 + str r0, [r1] +_0800A298: + adds r0, r2, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_800A23C + + thumb_func_start sub_800A2A4 +sub_800A2A4: @ 800A2A4 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x020229e8 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r2, 0x4 + adds r1, r2 + ldr r0, [r1] + bx lr + .pool + thumb_func_end sub_800A2A4 + + thumb_func_start sub_800A2BC +sub_800A2BC: @ 800A2BC + push {r4,r5,lr} + ldr r5, =0x020229e8 + movs r4, 0x4 +_0800A2C2: + adds r0, r5, 0 + movs r1, 0 + movs r2, 0x1C + bl memset + adds r5, 0x1C + subs r4, 0x1 + cmp r4, 0 + bge _0800A2C2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800A2BC + + thumb_func_start sub_800A2E0 +sub_800A2E0: @ 800A2E0 + ldr r1, =0x03000d10 + movs r0, 0 + strb r0, [r1, 0x8] + strh r0, [r1] + strh r0, [r1, 0x2] + str r0, [r1, 0x4] + bx lr + .pool + thumb_func_end sub_800A2E0 + + thumb_func_start sub_800A2F4 +sub_800A2F4: @ 800A2F4 + push {r4-r7,lr} + adds r7, r0, 0 + adds r6, r1, 0 + ldr r4, =0x03000d10 + ldrb r5, [r4, 0x8] + cmp r5, 0 + beq _0800A30C + movs r0, 0 + b _0800A34A + .pool +_0800A30C: + bl link_get_multiplayer_id + strb r0, [r4, 0x9] + movs r0, 0x1 + strb r0, [r4, 0x8] + strh r6, [r4, 0x2] + strh r5, [r4] + adds r0, 0xFF + cmp r6, r0 + bls _0800A324 + str r7, [r4, 0x4] + b _0800A336 +_0800A324: + ldr r5, =0x020228c4 + cmp r7, r5 + beq _0800A334 + adds r0, r5, 0 + adds r1, r7, 0 + adds r2, r6, 0 + bl memcpy +_0800A334: + str r5, [r4, 0x4] +_0800A336: + ldr r0, =0x0000bbbb + bl sub_8009D90 + ldr r1, =0x03003140 + ldr r0, =sub_800A364 + str r0, [r1] + ldr r1, =0x03000d50 + movs r0, 0 + str r0, [r1] + movs r0, 0x1 +_0800A34A: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_800A2F4 + + thumb_func_start sub_800A364 +sub_800A364: @ 800A364 + push {lr} + ldr r1, =0x03000d50 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + cmp r0, 0x2 + bls _0800A378 + ldr r1, =0x03003140 + ldr r0, =sub_800A388 + str r0, [r1] +_0800A378: + pop {r0} + bx r0 + .pool + thumb_func_end sub_800A364 + + thumb_func_start sub_800A388 +sub_800A388: @ 800A388 + push {r4-r6,lr} + ldr r0, =0x03000d10 + ldr r5, [r0, 0x4] + ldr r2, =0x03003110 + ldr r1, =0x00008888 + strh r1, [r2] + movs r3, 0 + adds r4, r0, 0 + adds r6, r4, 0 + adds r2, 0x2 +_0800A39C: + lsls r0, r3, 1 + ldrh r1, [r6] + adds r0, r1 + adds r0, r5 + ldrb r1, [r0, 0x1] + lsls r1, 8 + ldrb r0, [r0] + orrs r0, r1 + strh r0, [r2] + adds r2, 0x2 + adds r3, 0x1 + cmp r3, 0x6 + ble _0800A39C + ldrh r0, [r4] + adds r0, 0xE + strh r0, [r4] + ldrh r1, [r4, 0x2] + lsls r0, 16 + lsrs r0, 16 + cmp r1, r0 + bhi _0800A3D0 + movs r0, 0 + strb r0, [r4, 0x8] + ldr r1, =0x03003140 + ldr r0, =sub_800A3EC + str r0, [r1] +_0800A3D0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800A388 + + thumb_func_start sub_800A3EC +sub_800A3EC: @ 800A3EC + ldr r1, =0x03003140 + movs r0, 0 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_800A3EC + + thumb_func_start sub_800A3F8 +sub_800A3F8: @ 800A3F8 + push {lr} + bl link_get_multiplayer_id + ldr r0, =0x00004444 + bl sub_8009D90 + ldr r1, =0x020223c0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_800A3F8 + + thumb_func_start sub_800A418 +sub_800A418: @ 800A418 + push {lr} + ldr r1, =0x020223c0 + movs r0, 0 + str r0, [r1] + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _0800A438 + bl sub_800F850 + b _0800A43E + .pool +_0800A438: + ldr r1, =0x03003140 + ldr r0, =sub_800A3F8 + str r0, [r1] +_0800A43E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_800A418 + + thumb_func_start sub_800A44C +sub_800A44C: @ 800A44C + ldr r0, =0x020223c0 + ldr r0, [r0] + bx lr + .pool + thumb_func_end sub_800A44C + + thumb_func_start sub_800A458 +sub_800A458: @ 800A458 + push {lr} + ldr r0, =0x0000aaaa + bl sub_8009D90 + pop {r0} + bx r0 + .pool + thumb_func_end sub_800A458 + + thumb_func_start link_get_multiplayer_id +link_get_multiplayer_id: @ 800A468 + push {lr} + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0x1 + beq _0800A484 + ldr r0, =0x04000128 + ldr r0, [r0] + lsls r0, 26 + lsrs r0, 30 + b _0800A48C + .pool +_0800A484: + bl rfu_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 +_0800A48C: + pop {r1} + bx r1 + thumb_func_end link_get_multiplayer_id + + thumb_func_start bitmask_all_link_players_but_self +bitmask_all_link_players_but_self: @ 800A490 + push {lr} + bl link_get_multiplayer_id + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x1 + lsls r0, r1 + movs r1, 0xF + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end bitmask_all_link_players_but_self + + thumb_func_start link_0800A448 +link_0800A448: @ 800A4AC + push {lr} + adds r3, r1, 0 + lsls r2, 16 + lsrs r1, r2, 16 + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0x1 + beq _0800A4C8 + adds r0, r3, 0 + bl sub_800A2F4 + b _0800A4CE + .pool +_0800A4C8: + adds r0, r3, 0 + bl sub_800FE84 +_0800A4CE: + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end link_0800A448 + + thumb_func_start sub_800A4D8 +sub_800A4D8: @ 800A4D8 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + adds r2, r1, 0 + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0x1 + bne _0800A4F8 + adds r0, r1, 0 + bl sub_8010100 + lsls r0, 24 + lsrs r0, 24 + b _0800A514 + .pool +_0800A4F8: + ldr r0, =0x03003140 + ldr r0, [r0] + cmp r0, 0 + beq _0800A508 + movs r0, 0 + b _0800A514 + .pool +_0800A508: + ldr r0, =0x03003150 + strb r2, [r0] + ldr r0, =0x0000cccc + bl sub_8009D90 + movs r0, 0x1 +_0800A514: + pop {r1} + bx r1 + .pool + thumb_func_end sub_800A4D8 + + thumb_func_start sub_800A520 +sub_800A520: @ 800A520 + push {lr} + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0x1 + bne _0800A538 + bl sub_8010500 + lsls r0, 24 + lsrs r0, 24 + b _0800A546 + .pool +_0800A538: + movs r1, 0 + ldr r0, =0x03003140 + ldr r0, [r0] + cmp r0, 0 + bne _0800A544 + movs r1, 0x1 +_0800A544: + adds r0, r1, 0 +_0800A546: + pop {r1} + bx r1 + .pool + thumb_func_end sub_800A520 + + thumb_func_start sub_800A550 +sub_800A550: @ 800A550 + push {lr} + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0x1 + beq _0800A57C + ldr r2, =0x0300307c + ldrb r0, [r2, 0x3] + lsls r0, 3 + ldrb r1, [r2, 0x2] + lsls r1, 2 + orrs r0, r1 + ldrb r1, [r2, 0x1] + lsls r1, 1 + orrs r0, r1 + ldrb r1, [r2] + orrs r0, r1 + b _0800A580 + .pool +_0800A57C: + bl sub_800FCD8 +_0800A580: + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_800A550 + + thumb_func_start sub_800A588 +sub_800A588: @ 800A588 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0x1 + bne _0800A5A4 + adds r0, r1, 0 + bl sub_800F6FC + b _0800A5AC + .pool +_0800A5A4: + ldr r0, =0x0300307c + adds r0, r1, r0 + movs r1, 0x1 + strb r1, [r0] +_0800A5AC: + pop {r0} + bx r0 + .pool + thumb_func_end sub_800A588 + + thumb_func_start sub_800A5B4 +sub_800A5B4: @ 800A5B4 + push {r4,lr} + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0x1 + bne _0800A5D4 + movs r4, 0 +_0800A5C0: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_800F728 + adds r4, 0x1 + cmp r4, 0x4 + ble _0800A5C0 + b _0800A5E2 + .pool +_0800A5D4: + ldr r1, =0x0300307c + movs r2, 0 + adds r0, r1, 0x3 +_0800A5DA: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _0800A5DA +_0800A5E2: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800A5B4 + + thumb_func_start sub_800A5EC +sub_800A5EC: @ 800A5EC + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0x1 + bne _0800A608 + adds r0, r1, 0 + bl sub_800F728 + b _0800A616 + .pool +_0800A608: + ldr r0, =0x0300307c + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _0800A616 + movs r0, 0 + strb r0, [r1] +_0800A616: + pop {r0} + bx r0 + .pool + thumb_func_end sub_800A5EC + + thumb_func_start sub_800A620 +sub_800A620: @ 800A620 + push {lr} + ldr r0, =0x030030e0 + ldr r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0800A63C + movs r0, 0x1C + ands r1, r0 + cmp r1, 0x4 + bls _0800A63C + ldr r1, =0x03003144 + movs r0, 0x1 + strb r0, [r1] +_0800A63C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_800A620 + + thumb_func_start sub_800A648 +sub_800A648: @ 800A648 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 16 + movs r3, 0 + movs r2, 0 + lsrs r1, 17 + cmp r3, r1 + bcs _0800A66E +_0800A658: + lsls r0, r2, 1 + adds r0, r4 + ldrh r0, [r0] + adds r0, r3, r0 + lsls r0, 16 + lsrs r3, r0, 16 + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, r1 + bcc _0800A658 +_0800A66E: + adds r0, r3, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_800A648 + + thumb_func_start sub_800A678 +sub_800A678: @ 800A678 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + ldr r4, =0x03003130 + ldr r3, [r4] + lsls r3, 11 + movs r5, 0xC0 + lsls r5, 19 + adds r3, r5 + lsrs r2, 19 + adds r2, r1 + lsls r2, 1 + adds r2, r3 + ldr r3, [r4, 0x4] + lsls r3, 12 + ldr r1, [r4, 0x8] + adds r1, 0x1 + adds r0, r1 + orrs r3, r0 + strh r3, [r2] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800A678 + + thumb_func_start sub_800A6B0 +sub_800A6B0: @ 800A6B0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + ldr r4, =0x03003130 + ldr r3, [r4] + lsls r3, 11 + movs r5, 0xC0 + lsls r5, 19 + adds r3, r5 + lsrs r2, 19 + adds r2, r1 + lsls r2, 1 + adds r2, r3 + ldr r3, [r4, 0x4] + lsls r3, 12 + ldr r1, [r4, 0x8] + adds r1, r0 + orrs r3, r1 + strh r3, [r2] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800A6B0 + + thumb_func_start sub_800A6E8 +sub_800A6E8: @ 800A6E8 + push {r4-r7,lr} + sub sp, 0x10 + adds r5, r0, 0 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r7, r2, 24 + lsls r3, 24 + lsrs r3, 24 + movs r4, 0 + cmp r4, r3 + bge _0800A714 + movs r2, 0xF +_0800A702: + mov r0, sp + adds r1, r0, r4 + adds r0, r5, 0 + ands r0, r2 + strb r0, [r1] + lsrs r5, 4 + adds r4, 0x1 + cmp r4, r3 + blt _0800A702 +_0800A714: + subs r4, r3, 0x1 + cmp r4, 0 + blt _0800A734 +_0800A71A: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + adds r1, r6, 0 + adds r2, r7, 0 + bl sub_800A678 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + subs r4, 0x1 + cmp r4, 0 + bge _0800A71A +_0800A734: + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_800A6E8 + + thumb_func_start sub_800A73C +sub_800A73C: @ 800A73C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + adds r6, r0, 0 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x10] + cmp r6, 0 + bge _0800A768 + str r7, [sp, 0x10] + negs r6, r6 +_0800A768: + movs r5, 0 + movs r1, 0x1 + negs r1, r1 + add r1, r8 + mov r10, r1 + cmp r5, r8 + bge _0800A794 +_0800A776: + mov r0, sp + adds r4, r0, r5 + adds r0, r6, 0 + movs r1, 0xA + bl __modsi3 + strb r0, [r4] + adds r0, r6, 0 + movs r1, 0xA + bl __divsi3 + adds r6, r0, 0 + adds r5, 0x1 + cmp r5, r8 + blt _0800A776 +_0800A794: + mov r5, r10 + cmp r5, 0 + blt _0800A7B4 +_0800A79A: + mov r1, sp + adds r0, r1, r5 + ldrb r0, [r0] + adds r1, r7, 0 + mov r2, r9 + bl sub_800A678 + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + subs r5, 0x1 + cmp r5, 0 + bge _0800A79A +_0800A7B4: + movs r0, 0x1 + negs r0, r0 + ldr r1, [sp, 0x10] + cmp r1, r0 + beq _0800A7CA + lsls r1, 24 + lsrs r1, 24 + movs r0, 0xA + mov r2, r9 + bl sub_800A678 +_0800A7CA: + 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_800A73C + + thumb_func_start sub_800A7DC +sub_800A7DC: @ 800A7DC + push {r4-r7,lr} + adds r3, r0, 0 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + movs r6, 0 + ldrb r0, [r3] + cmp r0, 0 + beq _0800A81C + adds r4, r3, 0 + lsls r5, r2, 24 +_0800A7F4: + ldrb r0, [r4] + cmp r0, 0xA + bne _0800A804 + movs r0, 0x80 + lsls r0, 17 + adds r5, r0 + movs r6, 0 + b _0800A814 +_0800A804: + ldrb r0, [r4] + adds r1, r7, r6 + lsls r1, 24 + lsrs r1, 24 + lsrs r2, r5, 24 + bl sub_800A6B0 + adds r6, 0x1 +_0800A814: + adds r4, 0x1 + ldrb r0, [r4] + cmp r0, 0 + bne _0800A7F4 +_0800A81C: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_800A7DC + + thumb_func_start sub_800A824 +sub_800A824: @ 800A824 + push {lr} + ldr r0, =0x030030e0 + ldr r0, [r0] + movs r1, 0x20 + ands r0, r1 + cmp r0, 0 +_0800A830: + beq _0800A838 + ldr r0, =0x00002222 + bl sub_8009D90 +_0800A838: + ldr r1, =0x03003140 + movs r0, 0 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_800A824 + + thumb_func_start task00_link_test +task00_link_test: @ 800A850 + push {r4-r6,lr} + sub sp, 0x20 + ldr r1, =gUnknown_082ED1E4 + mov r0, sp + bl strcat + mov r0, sp + movs r1, 0x5 + movs r2, 0x2 + bl sub_800A7DC + ldr r0, =0x03003144 + ldrb r0, [r0] + movs r1, 0x2 + movs r2, 0x1 + movs r3, 0x2 + bl sub_800A6E8 + ldr r4, =0x030030e0 + ldr r0, [r4] + movs r1, 0xF + movs r2, 0x1 + movs r3, 0x8 + bl sub_800A6E8 + ldr r0, =0x03003170 + ldrb r0, [r0, 0x1] + movs r1, 0x2 + movs r2, 0xA + movs r3, 0x2 + bl sub_800A6E8 + ldr r0, [r4] + movs r1, 0x1C + ands r0, r1 + lsrs r0, 2 + movs r1, 0xF + movs r2, 0xA + movs r3, 0x2 + bl sub_800A6E8 + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + movs r1, 0xF + movs r2, 0xC + movs r3, 0x2 + bl sub_800A6E8 + ldr r0, =0x03003160 + ldrb r0, [r0] + movs r1, 0x19 + movs r2, 0x1 + movs r3, 0x2 + bl sub_800A6E8 + ldr r0, =0x03004130 + ldrb r0, [r0] + movs r1, 0x19 + movs r2, 0x2 + movs r3, 0x2 + bl sub_800A6E8 + bl sub_800A550 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0xF + movs r2, 0x5 + movs r3, 0x2 + bl sub_800A6E8 + ldr r0, =0x0300302c + ldr r0, [r0] + movs r1, 0x2 + movs r2, 0xC + movs r3, 0x8 + bl sub_800A6E8 + ldr r0, =0x03003070 + ldr r0, [r0] + movs r1, 0x2 + movs r2, 0xD + movs r3, 0x8 + bl sub_800A6E8 + bl sub_800B2E8 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x19 + movs r2, 0x5 + movs r3, 0x1 + bl sub_800A6E8 + bl sub_800B2F8 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x19 + movs r2, 0x6 + movs r3, 0x1 + bl sub_800A6E8 + bl sub_800B320 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x19 + movs r2, 0x7 + movs r3, 0x1 + bl sub_800A6E8 + bl sub_800B33C + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x19 + movs r2, 0x8 + movs r3, 0x1 + bl sub_800A6E8 + movs r6, 0 + movs r5, 0x80 + lsls r5, 19 + ldr r4, =0x03003148 +_0800A94E: + ldrh r0, [r4] + lsrs r2, r5, 24 + movs r1, 0xA + movs r3, 0x4 + bl sub_800A6E8 + movs r0, 0x80 + lsls r0, 17 + adds r5, r0 + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _0800A94E + add sp, 0x20 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end task00_link_test + + thumb_func_start sub_800A994 +sub_800A994: @ 800A994 + ldr r2, =0x0300302c + str r0, [r2] + ldr r0, =0x03003070 + str r1, [r0] + bx lr + .pool + thumb_func_end sub_800A994 + + thumb_func_start sub_800A9A8 +sub_800A9A8: @ 800A9A8 + push {r4,lr} + movs r1, 0 + movs r2, 0 + ldr r0, =0x03003100 + ldrb r0, [r0] + cmp r1, r0 + bge _0800A9CA + movs r4, 0x1 + adds r3, r0, 0 +_0800A9BA: + adds r0, r4, 0 + lsls r0, r2 + orrs r1, r0 + lsls r0, r1, 24 + lsrs r1, r0, 24 + adds r2, 0x1 + cmp r2, r3 + blt _0800A9BA +_0800A9CA: + adds r0, r1, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_800A9A8 + + thumb_func_start sub_800A9D8 +sub_800A9D8: @ 800A9D8 + push {r4-r6,lr} + movs r4, 0 + movs r5, 0 + movs r6, 0x1 + b _0800A9EE +_0800A9E2: + adds r0, r6, 0 + lsls r0, r5 + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 + adds r5, 0x1 +_0800A9EE: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + blt _0800A9E2 + adds r0, r4, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_800A9D8 + + thumb_func_start sub_800AA04 +sub_800AA04: @ 800AA04 + push {r4-r7,lr} + ldr r1, =0x03003100 + strb r0, [r1] + bl link_get_multiplayer_id + ldr r1, =0x03003120 + strb r0, [r1] + ldr r4, =0x020229e8 + ldr r3, =0x02022a74 + movs r2, 0x4 +_0800AA18: + adds r0, r3, 0 + adds r1, r4, 0 + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldr r1, [r1] + str r1, [r0] + adds r4, 0x1C + adds r3, 0x1C + subs r2, 0x1 + cmp r2, 0 + bge _0800AA18 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800AA04 + + thumb_func_start sub_800AA48 +sub_800AA48: @ 800AA48 + ldr r0, =0x03003100 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_800AA48 + + thumb_func_start sub_800AA54 +sub_800AA54: @ 800AA54 + ldr r0, =0x03003120 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_800AA54 + + thumb_func_start sub_800AA60 +sub_800AA60: @ 800AA60 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r3, 0 + ldr r0, =0x03003100 + ldrb r1, [r0] + mov r9, r0 + cmp r3, r1 + bge _0800AAB4 + ldr r0, =0x020229e8 + mov r12, r0 + ldr r0, =0x02022a74 + ldr r2, =0x00002288 + mov r8, r2 + ldr r7, =0x020229c6 + mov r6, r12 + adds r6, 0x14 + adds r5, r0, 0x4 + movs r4, 0 + adds r2, r1, 0 +_0800AA8A: + mov r0, r12 + adds r0, 0x4 + adds r0, r4, r0 + ldr r1, [r0] + ldr r0, [r5] + cmp r1, r0 + bne _0800AAA8 + ldrh r0, [r7] + cmp r0, r8 + bne _0800AAA6 + adds r1, r0, 0 + ldr r0, [r6] + cmp r1, r0 + bne _0800AAA8 +_0800AAA6: + adds r3, 0x1 +_0800AAA8: + adds r6, 0x1C + adds r5, 0x1C + adds r4, 0x1C + subs r2, 0x1 + cmp r2, 0 + bne _0800AA8A +_0800AAB4: + mov r0, r9 + ldrb r0, [r0] + cmp r3, r0 + bne _0800AAE4 + bl sub_800ABAC + lsls r0, 24 + lsrs r0, 24 + mov r1, r9 + ldrb r1, [r1] + cmp r0, r1 + bne _0800AAE4 + movs r0, 0x1 + b _0800AAE6 + .pool +_0800AAE4: + movs r0, 0 +_0800AAE6: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_800AA60 + + thumb_func_start sub_800AAF4 +sub_800AAF4: @ 800AAF4 + push {r4,r5,lr} + ldr r5, =0x02022a74 + movs r4, 0x3 +_0800AAFA: + adds r0, r5, 0 + movs r1, 0 + movs r2, 0x1C + bl CpuSet + adds r5, 0x1C + subs r4, 0x1 + cmp r4, 0 + bge _0800AAFA + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800AAF4 + + thumb_func_start sub_800AB18 +sub_800AB18: @ 800AB18 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r4, 0 + ldr r0, =0x03003100 + ldrb r0, [r0] + cmp r4, r0 + bcs _0800AB78 + ldr r6, =0x02022a74 + ldr r5, =0x020229e8 + movs r0, 0x8 + adds r0, r6 + mov r8, r0 + adds r7, r5, 0 + adds r7, 0x8 +_0800AB36: + lsls r0, r4, 3 + subs r0, r4 + lsls r2, r0, 2 + adds r1, r6, 0x4 + adds r1, r2, r1 + adds r0, r5, 0x4 + adds r0, r2, r0 + ldr r1, [r1] + ldr r0, [r0] + cmp r1, r0 + bne _0800AB5A + mov r1, r8 + adds r0, r2, r1 + adds r1, r2, r7 + bl CompareString + cmp r0, 0 + beq _0800AB6A +_0800AB5A: + ldr r1, =0x0300306c + movs r0, 0x1 + strb r0, [r1] + bl sub_80097E8 + ldr r0, =c2_800ACD4 + bl SetMainCallback2 +_0800AB6A: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x03003100 + ldrb r0, [r0] + cmp r4, r0 + bcc _0800AB36 +_0800AB78: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800AB18 + + thumb_func_start sub_800AB98 +sub_800AB98: @ 800AB98 + ldr r0, =0x03003100 + movs r1, 0 + strb r1, [r0] + ldr r0, =0x03003120 + strb r1, [r0] + bx lr + .pool + thumb_func_end sub_800AB98 + + thumb_func_start sub_800ABAC +sub_800ABAC: @ 800ABAC + ldr r0, =0x030030e0 + ldr r0, [r0] + movs r1, 0x1C + ands r0, r1 + lsrs r0, 2 + bx lr + .pool + thumb_func_end sub_800ABAC + + thumb_func_start sub_800ABBC +sub_800ABBC: @ 800ABBC + push {lr} + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _0800ABDC + ldr r0, =0x030030e0 + ldr r0, [r0] + lsrs r0, 5 + movs r1, 0x1 + ands r0, r1 + b _0800ABE4 + .pool +_0800ABDC: + bl sub_8011AB0 + lsls r0, 24 + lsrs r0, 24 +_0800ABE4: + pop {r1} + bx r1 + thumb_func_end sub_800ABBC + + thumb_func_start sub_800ABE8 +sub_800ABE8: @ 800ABE8 + ldr r0, =0x03000d58 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_800ABE8 + + thumb_func_start sub_800ABF4 +sub_800ABF4: @ 800ABF4 + push {lr} + lsls r0, 16 + lsrs r3, r0, 16 + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0x1 + bne _0800AC0C + bl task_add_05_task_del_08FA224_when_no_RfuFunc + b _0800AC20 + .pool +_0800AC0C: + ldr r2, =0x03003140 + ldr r1, [r2] + cmp r1, 0 + bne _0800AC20 + ldr r0, =sub_800AC80 + str r0, [r2] + ldr r0, =0x030030e4 + strb r1, [r0] + ldr r0, =0x030030f4 + strh r3, [r0] +_0800AC20: + pop {r0} + bx r0 + .pool + thumb_func_end sub_800ABF4 + + thumb_func_start sub_800AC34 +sub_800AC34: @ 800AC34 + push {lr} + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0x1 + bne _0800AC48 + bl task_add_05_task_del_08FA224_when_no_RfuFunc + b _0800AC70 + .pool +_0800AC48: + ldr r2, =0x03003140 + ldr r1, [r2] + cmp r1, 0 + beq _0800AC64 + ldr r1, =0x02022b08 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0800AC70 + .pool +_0800AC64: + ldr r0, =sub_800AC80 + str r0, [r2] + ldr r0, =0x030030e4 + strb r1, [r0] + ldr r0, =0x030030f4 + strh r1, [r0] +_0800AC70: + pop {r0} + bx r0 + .pool + thumb_func_end sub_800AC34 + + thumb_func_start sub_800AC80 +sub_800AC80: @ 800AC80 + push {lr} + ldr r0, =0x03004130 + ldrb r0, [r0] + cmp r0, 0 + bne _0800AC96 + ldr r0, =0x00005fff + bl sub_8009D90 + ldr r1, =0x03003140 + ldr r0, =sub_800ACAC + str r0, [r1] +_0800AC96: + pop {r0} + bx r0 + .pool + thumb_func_end sub_800AC80 + + thumb_func_start sub_800ACAC +sub_800ACAC: @ 800ACAC + push {r4,lr} + bl sub_8009FCC + lsls r0, 24 + lsrs r2, r0, 24 + movs r3, 0 + movs r1, 0 + cmp r3, r2 + bge _0800ACD0 + ldr r4, =0x030030f0 +_0800ACC0: + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _0800ACCA + adds r3, 0x1 +_0800ACCA: + adds r1, 0x1 + cmp r1, r2 + blt _0800ACC0 +_0800ACD0: + cmp r3, r2 + bne _0800ACF4 + ldr r2, =0x02022fec + ldr r0, [r2] + movs r1, 0x21 + negs r1, r1 + ands r0, r1 + str r0, [r2] + ldr r0, =0x03002748 + movs r4, 0x1 + strb r4, [r0] + bl sub_80097E8 + ldr r1, =0x03003140 + movs r0, 0 + str r0, [r1] + ldr r0, =0x030030e4 + strb r4, [r0] +_0800ACF4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800ACAC + + thumb_func_start sub_800AD10 +sub_800AD10: @ 800AD10 + push {lr} + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0x1 + bne _0800AD24 + bl task_add_05_task_del_08FA224_when_no_RfuFunc + b _0800AD4C + .pool +_0800AD24: + ldr r2, =0x03003140 + ldr r1, [r2] + cmp r1, 0 + beq _0800AD40 + ldr r1, =0x02022b08 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0800AD4C + .pool +_0800AD40: + ldr r0, =sub_800AD5C + str r0, [r2] + ldr r0, =0x030030e4 + strb r1, [r0] + ldr r0, =0x030030f4 + strh r1, [r0] +_0800AD4C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_800AD10 + + thumb_func_start sub_800AD5C +sub_800AD5C: @ 800AD5C + push {lr} + ldr r0, =0x03004130 + ldrb r0, [r0] + cmp r0, 0 + bne _0800AD72 + ldr r0, =0x00005fff + bl sub_8009D90 + ldr r1, =0x03003140 + ldr r0, =sub_800AD88 + str r0, [r1] +_0800AD72: + pop {r0} + bx r0 + .pool + thumb_func_end sub_800AD5C + + thumb_func_start sub_800AD88 +sub_800AD88: @ 800AD88 + push {r4,r5,lr} + bl sub_8009FCC + lsls r0, 24 + lsrs r3, r0, 24 + movs r1, 0 + movs r2, 0 + cmp r1, r3 + bge _0800ADB6 + ldr r5, =0x030030f0 + ldr r4, =0x020229e8 +_0800AD9E: + ldrh r0, [r4, 0x1A] + cmp r0, 0x1 + beq _0800ADAC + adds r0, r2, r5 + ldrb r0, [r0] + cmp r0, 0 + beq _0800ADAE +_0800ADAC: + adds r1, 0x1 +_0800ADAE: + adds r4, 0x1C + adds r2, 0x1 + cmp r2, r3 + blt _0800AD9E +_0800ADB6: + cmp r1, r3 + bne _0800ADDA + ldr r2, =0x02022fec + ldr r0, [r2] + movs r1, 0x21 + negs r1, r1 + ands r0, r1 + str r0, [r2] + ldr r0, =0x03002748 + movs r4, 0x1 + strb r4, [r0] + bl sub_80097E8 + ldr r1, =0x03003140 + movs r0, 0 + str r0, [r1] + ldr r0, =0x030030e4 + strb r4, [r0] +_0800ADDA: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800AD88 + + thumb_func_start sub_800ADF8 +sub_800ADF8: @ 800ADF8 + push {lr} + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0x1 + bne _0800AE0C + bl sub_8010434 + b _0800AE1E + .pool +_0800AE0C: + ldr r1, =0x03003140 + ldr r0, [r1] + cmp r0, 0 + bne _0800AE18 + ldr r0, =sub_800AE30 + str r0, [r1] +_0800AE18: + ldr r1, =0x030030e4 + movs r0, 0 + strb r0, [r1] +_0800AE1E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_800ADF8 + + thumb_func_start sub_800AE30 +sub_800AE30: @ 800AE30 + push {lr} + ldr r0, =0x03004130 + ldrb r0, [r0] + cmp r0, 0 + bne _0800AE46 + ldr r0, =0x00002ffe + bl sub_8009D90 + ldr r1, =0x03003140 + ldr r0, =sub_800AE5C + str r0, [r1] +_0800AE46: + pop {r0} + bx r0 + .pool + thumb_func_end sub_800AE30 + + thumb_func_start sub_800AE5C +sub_800AE5C: @ 800AE5C + push {r4,lr} + bl sub_8009FCC + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0 + cmp r1, r2 + bcs _0800AE86 + ldr r3, =0x030030ec + ldrb r0, [r3] + cmp r0, 0 + beq _0800AE86 +_0800AE74: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, r2 + bcs _0800AE86 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _0800AE74 +_0800AE86: + cmp r1, r2 + bne _0800AEA4 + movs r1, 0 + ldr r4, =0x03003140 + ldr r3, =0x030030ec + movs r2, 0 +_0800AE92: + adds r0, r1, r3 + strb r2, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bls _0800AE92 + movs r0, 0 + str r0, [r4] +_0800AEA4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800AE5C + + thumb_func_start sub_800AEB4 +sub_800AEB4: @ 800AEB4 + push {lr} + ldr r0, =0x020229c4 + ldrb r0, [r0] + cmp r0, 0 + beq _0800AEF4 + ldr r0, =0x030030e0 + ldr r2, [r0] + movs r0, 0xFE + lsls r0, 11 + ands r0, r2 + cmp r0, 0 + beq _0800AEF4 + ldr r0, =0x030030f8 + ldrb r0, [r0] + cmp r0, 0 + bne _0800AEEA + ldr r1, =0x02022b00 + str r2, [r1] + ldr r0, =0x03004130 + ldrb r0, [r0] + strb r0, [r1, 0x4] + ldr r0, =0x03003160 + ldrb r0, [r0] + strb r0, [r1, 0x5] + ldr r0, =c2_800ACD4 + bl SetMainCallback2 +_0800AEEA: + ldr r1, =0x0300306c + movs r0, 0x1 + strb r0, [r1] + bl sub_80097E8 +_0800AEF4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_800AEB4 + + thumb_func_start sub_800AF18 +sub_800AF18: @ 800AF18 + push {r4,lr} + ldr r4, =0x02022b00 + str r0, [r4] + strb r1, [r4, 0x5] + strb r2, [r4, 0x4] + strb r3, [r4, 0x6] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800AF18 + + thumb_func_start c2_800ACD4 +c2_800ACD4: @ 800AF30 + push {r4,lr} + movs r0, 0 + movs r1, 0 + bl SetGpuReg + ldr r0, =0x030075f0 + bl MPlayStop_rev01 + ldr r0, =0x03007630 + bl MPlayStop_rev01 + ldr r0, =0x03007800 + bl MPlayStop_rev01 + ldr r0, =0x02000000 + movs r1, 0xE0 + lsls r1, 9 + bl InitHeap + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + bl pal_fade_control_reset_maybe + movs r0, 0 + movs r1, 0 + movs r2, 0x2 + bl rboxid_80040B8 + bl clear_tasks + bl remove_some_task + ldr r1, =0x030030fc + ldrb r0, [r1] + cmp r0, 0 + beq _0800AF8C + ldr r0, =0x02022b00 + ldrb r0, [r0, 0x6] + cmp r0, 0 + bne _0800AF88 + movs r0, 0x3 + strb r0, [r1] +_0800AF88: + bl sub_800E604 +_0800AF8C: + ldr r0, =sub_80096BC + bl SetVBlankCallback + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_082ED1FC + movs r0, 0 + movs r2, 0x2 + bl InitBgsFromTemplates + ldr r4, =0x02022b0c + movs r0, 0x80 + lsls r0, 4 + bl Alloc + adds r1, r0, 0 + str r1, [r4] + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r0, =gUnknown_082ED204 + bl InitWindows + lsls r0, 16 + cmp r0, 0 + beq _0800B03C + bl DeactivateAllTextPrinters + bl reset_temp_tile_data_buffers + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x10 + movs r1, 0 + bl SetGpuReg + movs r0, 0x12 + movs r1, 0 + bl SetGpuReg + movs r0, 0x14 + movs r1, 0 + bl SetGpuReg + movs r0, 0x16 + movs r1, 0 + bl SetGpuReg + movs r1, 0xE0 + lsls r1, 8 + movs r0, 0 + bl ClearGpuRegBits + ldr r0, =gUnknown_0860F074 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, =0x03002700 + movs r0, 0 + strb r0, [r1] + ldr r0, =sub_8009404 + movs r1, 0 + bl AddTask + bl sub_80A2F30 + ldr r1, =0x030022c0 + movs r0, 0 + str r0, [r1] + bl RunActiveTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + ldr r0, =sub_800B1A0 + bl SetMainCallback2 +_0800B03C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end c2_800ACD4 + + thumb_func_start sub_800B080 +sub_800B080: @ 800B080 + push {r4,r5,lr} + sub sp, 0xC + ldr r1, =gUnknown_082ED168 + movs r0, 0 + movs r2, 0x20 + movs r3, 0 + bl LoadBgTiles + ldr r1, =gUnknown_082EC88C + movs r5, 0 + str r5, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, =gUnknown_082ECD34 + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + ldr r0, =gUnknown_082EC86C + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x2 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r4, =gUnknown_082ED224 + str r4, [sp] + str r5, [sp, 0x4] + ldr r0, =gUnknown_085EE4F7 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x3 + movs r2, 0x2 + movs r3, 0x6 + bl box_print + str r4, [sp] + str r5, [sp, 0x4] + ldr r0, =gUnknown_085EE50C + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x3 + movs r2, 0x2 + movs r3, 0x1 + bl box_print + movs r0, 0 + bl PutWindowTilemap + movs r0, 0x2 + bl PutWindowTilemap + movs r0, 0 + movs r1, 0 + bl CopyWindowToVram + movs r0, 0x2 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800B080 + + thumb_func_start sub_800B138 +sub_800B138: @ 800B138 + push {lr} + sub sp, 0xC + ldr r1, =gUnknown_082ED168 + movs r0, 0 + movs r2, 0x20 + movs r3, 0 + bl LoadBgTiles + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x2 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r0, =gUnknown_082ED224 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + ldr r0, =gUnknown_085EE4A4 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0x2 + movs r3, 0 + bl box_print + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0x2 + bl PutWindowTilemap + movs r0, 0x1 + movs r1, 0 + bl CopyWindowToVram + movs r0, 0x2 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_800B138 + + thumb_func_start sub_800B1A0 +sub_800B1A0: @ 800B1A0 + push {r4,lr} + sub sp, 0xC + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1E + beq _0800B20C + cmp r0, 0x1E + bgt _0800B1C4 + cmp r0, 0 + beq _0800B1D8 + cmp r0, 0x2 + beq _0800B1F2 + b _0800B260 + .pool +_0800B1C4: + cmp r0, 0x5A + beq _0800B20C + cmp r0, 0x5A + bgt _0800B1D2 + cmp r0, 0x3C + beq _0800B20C + b _0800B260 +_0800B1D2: + cmp r0, 0x82 + beq _0800B214 + b _0800B260 +_0800B1D8: + ldr r0, =0x02022b00 + ldrb r0, [r0, 0x6] + cmp r0, 0 + beq _0800B1EC + bl sub_800B080 + b _0800B260 + .pool +_0800B1EC: + bl sub_800B138 + b _0800B260 +_0800B1F2: + movs r0, 0 + bl ShowBg + ldr r0, =0x02022b00 + ldrb r0, [r0, 0x6] + cmp r0, 0 + beq _0800B260 + movs r0, 0x1 + bl ShowBg + b _0800B260 + .pool +_0800B20C: + movs r0, 0x16 + bl audio_play + b _0800B260 +_0800B214: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0x2 + bne _0800B244 + ldr r0, =gUnknown_082ED224 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + ldr r0, =gUnknown_085EE572 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x3 + movs r2, 0x2 + movs r3, 0x14 + bl box_print + b _0800B260 + .pool +_0800B244: + cmp r0, 0x1 + bne _0800B260 + ldr r0, =gUnknown_082ED224 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + ldr r0, =gUnknown_085EE553 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x3 + movs r2, 0x2 + movs r3, 0x14 + bl box_print +_0800B260: + ldr r0, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r0, r2 + ldrb r1, [r1] + cmp r1, 0xA0 + bne _0800B2D0 + ldr r4, =0x030030fc + ldrb r2, [r4] + cmp r2, 0x1 + bne _0800B2A8 + ldrh r0, [r0, 0x2E] + ands r2, r0 + cmp r2, 0 + beq _0800B2C2 + movs r0, 0x15 + bl audio_play + movs r0, 0 + strb r0, [r4] + ldr r1, =0x02022b00 + movs r0, 0 + strb r0, [r1, 0x6] + bl sub_81700F8 + b _0800B2C2 + .pool +_0800B2A8: + cmp r2, 0x2 + bne _0800B2C2 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0800B2C2 + bl rfu_REQ_stopMode + bl rfu_waitREQComplete + bl Reset +_0800B2C2: + ldr r0, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r0, r2 + ldrb r1, [r1] + cmp r1, 0xA0 + beq _0800B2DC +_0800B2D0: + movs r2, 0x87 + lsls r2, 3 + adds r1, r0, r2 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0800B2DC: + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800B1A0 + + thumb_func_start sub_800B2E8 +sub_800B2E8: @ 800B2E8 + ldr r0, =0x04000128 + ldrh r0, [r0] + lsrs r0, 2 + movs r1, 0x1 + ands r0, r1 + bx lr + .pool + thumb_func_end sub_800B2E8 + + thumb_func_start sub_800B2F8 +sub_800B2F8: @ 800B2F8 + push {lr} + movs r3, 0 + ldr r2, =0x04000128 + ldrh r1, [r2] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0800B314 + ldrh r1, [r2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _0800B314 + movs r3, 0x1 +_0800B314: + adds r0, r3, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_800B2F8 + + thumb_func_start sub_800B320 +sub_800B320: @ 800B320 + ldr r0, =0x030030e0 + ldr r0, [r0] + lsrs r0, 6 + movs r1, 0x1 + ands r0, r1 + bx lr + .pool + thumb_func_end sub_800B320 + + thumb_func_start sub_800B330 +sub_800B330: @ 800B330 + ldr r1, =0x030030f8 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_800B330 + + thumb_func_start sub_800B33C +sub_800B33C: @ 800B33C + ldr r0, =0x0300306c + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_800B33C + + thumb_func_start sub_800B348 +sub_800B348: @ 800B348 + push {r4-r6,lr} + bl sub_8009638 + ldr r1, =0x03003030 + adds r2, r1, 0 + adds r2, 0x10 + ldr r0, =0x020229cc + ldm r0!, {r3-r5} + stm r2!, {r3-r5} + ldm r0!, {r3,r4,r6} + stm r2!, {r3,r4,r6} + ldr r0, [r0] + str r0, [r2] + ldr r3, =gUnknown_082ED1D4 + adds r2, r1, 0 + adds r0, r3, 0 + ldm r0!, {r4-r6} + stm r2!, {r4-r6} + ldrh r4, [r0] + strh r4, [r2] + ldrb r0, [r0, 0x2] + strb r0, [r2, 0x2] + adds r0, r1, 0 + adds r0, 0x2C + ldm r3!, {r2,r5,r6} + stm r0!, {r2,r5,r6} + ldrh r2, [r3] + strh r2, [r0] + ldrb r2, [r3, 0x2] + strb r2, [r0, 0x2] + ldr r0, =0x020228c4 + movs r2, 0x3C + bl memcpy + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800B348 + + thumb_func_start sub_800B3A4 +sub_800B3A4: @ 800B3A4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 8 + ldr r1, =0x020223c4 + adds r4, r2, r1 + lsls r2, r0, 3 + subs r2, r0 + lsls r2, 2 + ldr r0, =0x020229e8 + adds r2, r0 + adds r1, r2, 0 + adds r0, r4, 0 + adds r0, 0x10 + ldm r0!, {r3,r5,r6} + stm r1!, {r3,r5,r6} + ldm r0!, {r3,r5,r6} + stm r1!, {r3,r5,r6} + ldr r0, [r0] + str r0, [r1] + adds r0, r2, 0 + bl sub_800B524 + ldr r5, =gUnknown_082ED1D4 + adds r0, r4, 0 + adds r1, r5, 0 + bl strcmp + cmp r0, 0 + bne _0800B3EE + adds r0, r4, 0 + adds r0, 0x2C + adds r1, r5, 0 + bl strcmp + cmp r0, 0 + beq _0800B3F4 +_0800B3EE: + ldr r0, =c2_800ACD4 + bl SetMainCallback2 +_0800B3F4: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800B3A4 + + thumb_func_start HandleLinkConnection +HandleLinkConnection: @ 800B40C + push {r4,r5,lr} + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _0800B45C + ldr r0, =0x03003144 + ldr r1, =0x03003110 + ldr r2, =0x03003090 + bl sub_800B638 + ldr r4, =0x030030e0 + str r0, [r4] + ldr r0, =0x030022ec + bl sub_80099E0 + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 1 + ands r0, r1 + cmp r0, 0 + beq _0800B480 + bl sub_808766C + cmp r0, 0x1 + bne _0800B480 +_0800B43E: + movs r0, 0x1 + b _0800B482 + .pool +_0800B45C: + bl sub_8010EC0 + adds r4, r0, 0 + bl sub_8010F1C + adds r5, r0, 0 + bl sub_808766C + cmp r0, 0x1 + bne _0800B480 + cmp r4, 0x1 + beq _0800B43E + bl sub_800F0B8 + cmp r0, 0 + bne _0800B43E + cmp r5, 0 + bne _0800B43E +_0800B480: + movs r0, 0 +_0800B482: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end HandleLinkConnection + + thumb_func_start sub_800B488 +sub_800B488: @ 800B488 + push {lr} + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _0800B498 + ldr r1, =0x030030fc + movs r0, 0x1 + strb r0, [r1] +_0800B498: + pop {r0} + bx r0 + .pool + thumb_func_end sub_800B488 + + thumb_func_start sub_800B4A4 +sub_800B4A4: @ 800B4A4 + push {lr} + ldr r0, =0x03003124 + ldrb r1, [r0] + cmp r1, 0 + bne _0800B4B2 + ldr r0, =0x030030fc + strb r1, [r0] +_0800B4B2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_800B4A4 + + thumb_func_start sub_800B4C0 +sub_800B4C0: @ 800B4C0 + push {lr} + ldr r0, =0x03003124 + ldrb r1, [r0] + cmp r1, 0 + bne _0800B4CE + ldr r0, =0x030030fc + strb r1, [r0] +_0800B4CE: + pop {r0} + bx r0 + .pool + thumb_func_end sub_800B4C0 + + thumb_func_start sub_800B4DC +sub_800B4DC: @ 800B4DC + push {lr} + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _0800B4FC + ldr r0, =0x03003170 + ldr r1, =0x00000fbd + adds r0, r1 + ldrb r0, [r0] + b _0800B500 + .pool +_0800B4FC: + bl sub_80124D4 +_0800B500: + pop {r1} + bx r1 + thumb_func_end sub_800B4DC + + thumb_func_start sub_800B504 +sub_800B504: @ 800B504 + push {lr} + bl sub_800B4DC + cmp r0, 0x2 + bhi _0800B512 + movs r0, 0 + b _0800B514 +_0800B512: + movs r0, 0x1 +_0800B514: + pop {r1} + bx r1 + thumb_func_end sub_800B504 + + thumb_func_start sub_800B518 +sub_800B518: @ 800B518 + ldr r0, =0x030030fc + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_800B518 + + thumb_func_start sub_800B524 +sub_800B524: @ 800B524 + push {lr} + ldrb r1, [r0, 0x10] + strb r1, [r0, 0x12] + adds r2, r0, 0 + adds r2, 0x8 + ldrb r1, [r0, 0x1A] + adds r0, r2, 0 + bl StopMusicWhileStringIsPrinted + pop {r0} + bx r0 + thumb_func_end sub_800B524 + + thumb_func_start sub_800B53C +sub_800B53C: @ 800B53C + push {lr} + sub sp, 0x4 + movs r0, 0xC0 + bl DisableInterrupts + ldr r1, =0x04000128 + movs r2, 0x80 + lsls r2, 6 + adds r0, r2, 0 + strh r0, [r1] + ldr r0, =0x0400010e + movs r2, 0 + strh r2, [r0] + adds r1, 0xDA + movs r0, 0xC0 + strh r0, [r1] + ldr r0, =0x0400012a + strh r2, [r0] + ldr r2, =0x04000120 + movs r0, 0 + movs r1, 0 + str r0, [r2] + str r1, [r2, 0x4] + str r0, [sp] + ldr r1, =0x03003170 + ldr r2, =0x050003f0 + mov r0, sp + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_800B53C + + thumb_func_start sub_800B594 +sub_800B594: @ 800B594 + push {r4,r5,lr} + sub sp, 0x4 + movs r0, 0xC0 + bl DisableInterrupts + ldr r0, =0x04000134 + movs r4, 0 + strh r4, [r0] + ldr r2, =0x04000128 + movs r1, 0x80 + lsls r1, 6 + adds r0, r1, 0 + strh r0, [r2] + ldrh r0, [r2] + ldr r3, =0x00004003 + adds r1, r3, 0 + orrs r0, r1 + strh r0, [r2] + movs r0, 0x80 + bl EnableInterrupts + ldr r0, =0x0400012a + strh r4, [r0] + movs r5, 0 + str r5, [sp] + ldr r1, =0x03003170 + ldr r2, =0x050003f0 + mov r0, sp + bl CpuSet + ldr r0, =0x03000d6c + strb r4, [r0] + ldr r0, =0x03000d6e + strh r5, [r0] + ldr r0, =0x03000d70 + strh r5, [r0] + ldr r0, =0x03000d72 + strb r4, [r0] + ldr r0, =0x03000d73 + strb r4, [r0] + ldr r0, =0x03003160 + strb r4, [r0] + ldr r0, =0x03004130 + strb r4, [r0] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800B594 + + thumb_func_start sub_800B628 +sub_800B628: @ 800B628 + push {lr} + bl sub_800B594 + bl sub_800B53C + pop {r0} + bx r0 + thumb_func_end sub_800B628 + + thumb_func_start sub_800B638 +sub_800B638: @ 800B638 + push {r4-r7,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + ldr r0, =0x03003170 + ldrb r0, [r0, 0x1] + cmp r0, 0x4 + bhi _0800B6EA + lsls r0, 2 + ldr r1, =_0800B65C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0800B65C: + .4byte _0800B670 + .4byte _0800B680 + .4byte _0800B698 + .4byte _0800B6D4 + .4byte _0800B6DE +_0800B670: + bl sub_800B53C + ldr r1, =0x03003170 + movs r0, 0x1 + strb r0, [r1, 0x1] + b _0800B6EA + .pool +_0800B680: + ldrb r0, [r4] + cmp r0, 0x1 + bne _0800B6EA + bl sub_800B594 + ldr r1, =0x03003170 + movs r0, 0x2 + strb r0, [r1, 0x1] + b _0800B6EA + .pool +_0800B698: + ldrb r1, [r4] + cmp r1, 0x1 + beq _0800B6A8 + cmp r1, 0x2 + beq _0800B6C0 + bl sub_800B764 + b _0800B6EA +_0800B6A8: + ldr r2, =0x03003170 + ldrb r0, [r2] + cmp r0, 0x8 + bne _0800B6EA + ldrb r0, [r2, 0x3] + cmp r0, 0x1 + bls _0800B6EA + strb r1, [r2, 0xE] + b _0800B6EA + .pool +_0800B6C0: + ldr r0, =0x03003170 + movs r1, 0 + strb r1, [r0, 0x1] + ldr r0, =0x0400012a + strh r1, [r0] + b _0800B6EA + .pool +_0800B6D4: + bl sub_800B790 + ldr r1, =0x03003170 + movs r0, 0x4 + strb r0, [r1, 0x1] +_0800B6DE: + adds r0, r5, 0 + bl sub_800B7C0 + adds r0, r6, 0 + bl sub_800B8A8 +_0800B6EA: + movs r0, 0 + strb r0, [r4] + ldr r1, =0x03003170 + ldrb r2, [r1, 0x2] + ldrb r0, [r1, 0x3] + lsls r0, 2 + orrs r2, r0 + ldrb r0, [r1] + cmp r0, 0x8 + bne _0800B702 + movs r0, 0x20 + orrs r2, r0 +_0800B702: + ldrb r0, [r1, 0xC] + lsls r3, r0, 8 + ldrb r0, [r1, 0xF] + lsls r4, r0, 9 + ldrb r0, [r1, 0x10] + lsls r5, r0, 12 + ldrb r0, [r1, 0x11] + lsls r6, r0, 13 + ldrb r0, [r1, 0x12] + lsls r7, r0, 14 + ldrb r0, [r1, 0x1] + cmp r0, 0x4 + bne _0800B728 + movs r0, 0x40 + orrs r0, r3 + orrs r0, r2 + b _0800B72C + .pool +_0800B728: + adds r0, r2, 0 + orrs r0, r3 +_0800B72C: + orrs r0, r4 + orrs r0, r5 + orrs r0, r6 + orrs r0, r7 + adds r2, r0, 0 + ldrb r3, [r1, 0x13] + cmp r3, 0x1 + bne _0800B742 + movs r0, 0x80 + lsls r0, 9 + orrs r2, r0 +_0800B742: + ldrb r0, [r1, 0x2] + cmp r0, 0x3 + bls _0800B74E + movs r0, 0x80 + lsls r0, 10 + orrs r2, r0 +_0800B74E: + adds r1, r2, 0 + cmp r3, 0x2 + bne _0800B75A + movs r0, 0x80 + lsls r0, 11 + orrs r1, r0 +_0800B75A: + adds r0, r1, 0 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_800B638 + + thumb_func_start sub_800B764 +sub_800B764: @ 800B764 + push {lr} + ldr r0, =0x04000128 + ldr r1, [r0] + movs r0, 0xC + ands r1, r0 + ldr r2, =0x03003170 + cmp r1, 0x8 + bne _0800B788 + ldrb r0, [r2, 0x2] + cmp r0, 0 + bne _0800B788 + strb r1, [r2] + b _0800B78C + .pool +_0800B788: + movs r0, 0 + strb r0, [r2] +_0800B78C: + pop {r0} + bx r0 + thumb_func_end sub_800B764 + + thumb_func_start sub_800B790 +sub_800B790: @ 800B790 + push {lr} + ldr r0, =0x03003170 + ldrb r0, [r0] + cmp r0, 0 + beq _0800B7AE + ldr r1, =0x0400010c + ldr r2, =0x0000ff3b + adds r0, r2, 0 + strh r0, [r1] + adds r1, 0x2 + movs r0, 0x41 + strh r0, [r1] + movs r0, 0x40 + bl EnableInterrupts +_0800B7AE: + pop {r0} + bx r0 + .pool + thumb_func_end sub_800B790 + + thumb_func_start sub_800B7C0 +sub_800B7C0: @ 800B7C0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r3, r0, 0 + ldr r2, =0x03004134 + ldr r1, =0x04000208 + ldrh r0, [r1] + strh r0, [r2] + movs r0, 0 + strh r0, [r1] + ldr r1, =0x03003170 + ldr r4, =0x00000339 + adds r0, r1, r4 + ldrb r4, [r0] + adds r6, r1, 0 + cmp r4, 0x31 + bhi _0800B850 + movs r1, 0xCE + lsls r1, 2 + adds r0, r6, r1 + ldrb r0, [r0] + adds r0, r4, r0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x31 + bls _0800B7FE + subs r0, 0x32 + lsls r0, 24 + lsrs r0, 24 +_0800B7FE: + movs r2, 0 + ldr r4, =0x03000d6e + mov r9, r4 + ldr r1, =0x03003160 + mov r10, r1 + lsls r5, r0, 1 + movs r0, 0x18 + adds r0, r6 + mov r8, r0 + mov r12, r2 + movs r7, 0x64 +_0800B814: + ldrh r0, [r4] + ldrh r1, [r3] + orrs r0, r1 + strh r0, [r4] + adds r0, r2, 0 + muls r0, r7 + adds r0, r5, r0 + add r0, r8 + strh r1, [r0] + mov r1, r12 + strh r1, [r3] + adds r3, 0x2 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x7 + bls _0800B814 + b _0800B85C + .pool +_0800B850: + movs r0, 0x1 + strb r0, [r6, 0x12] + ldr r2, =0x03000d6e + mov r9, r2 + ldr r4, =0x03003160 + mov r10, r4 +_0800B85C: + mov r1, r9 + ldrh r0, [r1] + cmp r0, 0 + beq _0800B874 + ldr r2, =0x00000339 + adds r0, r6, r2 + ldrb r1, [r0] + adds r1, 0x1 + movs r2, 0 + strb r1, [r0] + mov r4, r9 + strh r2, [r4] +_0800B874: + ldr r1, =0x04000208 + ldr r2, =0x03004134 + ldrh r0, [r2] + strh r0, [r1] + ldr r4, =0x00000339 + adds r0, r6, r4 + ldrb r0, [r0] + mov r1, r10 + strb r0, [r1] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800B7C0 + + thumb_func_start sub_800B8A8 +sub_800B8A8: @ 800B8A8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r9, r0 + ldr r2, =0x03004134 + ldr r1, =0x04000208 + ldrh r0, [r1] + strh r0, [r2] + movs r0, 0 + strh r0, [r1] + ldr r1, =0x03003170 + ldr r3, =0x00000fbd + adds r0, r1, r3 + ldrb r0, [r0] + mov r12, r1 + cmp r0, 0 + bne _0800B914 + movs r3, 0 + ldrb r0, [r1, 0x3] + cmp r3, r0 + bcs _0800B8FA + movs r5, 0 + adds r6, r0, 0 +_0800B8DA: + movs r2, 0 + lsls r1, r3, 4 + adds r4, r3, 0x1 + add r1, r9 +_0800B8E2: + lsls r0, r2, 1 + adds r0, r1 + strh r5, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x7 + bls _0800B8E2 + lsls r0, r4, 24 + lsrs r3, r0, 24 + cmp r3, r6 + bcc _0800B8DA +_0800B8FA: + movs r0, 0x1 + mov r7, r12 + strb r0, [r7, 0xC] + b _0800B990 + .pool +_0800B914: + movs r3, 0 + mov r0, r12 + ldrb r1, [r0, 0x3] + cmp r3, r1 + bcs _0800B96A + ldr r0, =0x00000fbc + add r0, r12 + ldrb r0, [r0] + lsls r6, r0, 1 + movs r2, 0xCF + lsls r2, 2 + add r2, r12 + mov r8, r2 + mov r10, r1 +_0800B930: + movs r2, 0 + lsls r1, r3, 4 + adds r4, r3, 0x1 + lsls r0, r3, 1 + mov r7, r9 + adds r5, r1, r7 + adds r0, r3 + lsls r0, 3 + adds r0, r3 + lsls r3, r0, 5 +_0800B944: + lsls r1, r2, 1 + adds r1, r5 + movs r7, 0x64 + adds r0, r2, 0 + muls r0, r7 + adds r0, r6, r0 + adds r0, r3 + add r0, r8 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x7 + bls _0800B944 + lsls r0, r4, 24 + lsrs r3, r0, 24 + cmp r3, r10 + bcc _0800B930 +_0800B96A: + mov r2, r12 + ldr r0, =0x00000fbd + adds r1, r2, r0 + ldrb r0, [r1] + subs r0, 0x1 + movs r3, 0 + strb r0, [r1] + ldr r1, =0x00000fbc + adds r2, r1 + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x31 + bls _0800B98C + strb r3, [r2] +_0800B98C: + mov r2, r12 + strb r3, [r2, 0xC] +_0800B990: + ldr r1, =0x04000208 + ldr r3, =0x03004134 + ldrh r0, [r3] + strh r0, [r1] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800B8A8 + + thumb_func_start sub_800B9B8 +sub_800B9B8: @ 800B9B8 + push {r4,lr} + ldr r3, =0x03003170 + ldrb r4, [r3] + cmp r4, 0 + beq _0800B9F4 + ldrb r0, [r3, 0x1] + cmp r0, 0x2 + beq _0800B9EE + cmp r0, 0x4 + bne _0800BA1E + movs r0, 0xD + ldrsb r0, [r3, r0] + cmp r0, 0x8 + bgt _0800B9E4 + ldrb r0, [r3, 0x10] + cmp r0, 0x1 + beq _0800B9EE + movs r0, 0x1 + strb r0, [r3, 0x13] + b _0800BA1E + .pool +_0800B9E4: + ldrb r0, [r3, 0x13] + cmp r0, 0x1 + beq _0800BA1E + movs r0, 0 + strb r0, [r3, 0xD] +_0800B9EE: + bl sub_800BAC0 + b _0800BA1E +_0800B9F4: + ldrb r2, [r3, 0x1] + cmp r2, 0x4 + beq _0800B9FE + cmp r2, 0x2 + bne _0800BA1E +_0800B9FE: + ldr r1, =0x03000d6c + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xA + bls _0800BA1E + cmp r2, 0x4 + bne _0800BA16 + movs r0, 0x2 + strb r0, [r3, 0x13] +_0800BA16: + cmp r2, 0x2 + bne _0800BA1E + strb r4, [r3, 0x3] + strb r4, [r3, 0xF] +_0800BA1E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800B9B8 + + thumb_func_start Timer3Intr +Timer3Intr: @ 800BA28 + push {lr} + bl sub_800BD98 + bl sub_800BAC0 + pop {r0} + bx r0 + thumb_func_end Timer3Intr + + thumb_func_start sub_800BA38 +sub_800BA38: @ 800BA38 + push {r4,lr} + ldr r4, =0x03003170 + ldr r0, =0x04000128 + ldr r1, [r0] + lsls r0, r1, 26 + lsrs r0, 30 + strb r0, [r4, 0x2] + ldrb r0, [r4, 0x1] + cmp r0, 0x2 + beq _0800BA6C + cmp r0, 0x4 + bne _0800BA8A + lsls r0, r1, 25 + lsrs r0, 31 + strb r0, [r4, 0x10] + bl sub_800BBCC + bl sub_800BCE4 + bl sub_800BDCC + b _0800BA8A + .pool +_0800BA6C: + bl sub_800BAD0 + lsls r0, 24 + cmp r0, 0 + beq _0800BA8A + ldrb r0, [r4] + cmp r0, 0 + beq _0800BA86 + movs r0, 0x3 + strb r0, [r4, 0x1] + movs r0, 0x8 + strb r0, [r4, 0xD] + b _0800BA8A +_0800BA86: + movs r0, 0x4 + strb r0, [r4, 0x1] +_0800BA8A: + ldr r3, =0x03003170 + ldrb r0, [r3, 0xD] + adds r0, 0x1 + movs r2, 0 + strb r0, [r3, 0xD] + ldr r1, =0x03000d6c + strb r2, [r1] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x8 + bne _0800BAAA + ldr r0, =0x03004130 + ldr r2, =0x00000fbd + adds r1, r3, r2 + ldrb r1, [r1] + strb r1, [r0] +_0800BAAA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800BA38 + + thumb_func_start sub_800BAC0 +sub_800BAC0: @ 800BAC0 + ldr r0, =0x04000128 + ldrh r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strh r1, [r0] + bx lr + .pool + thumb_func_end sub_800BAC0 + + thumb_func_start sub_800BAD0 +sub_800BAD0: @ 800BAD0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r5, 0 + ldr r6, =0x0000ffff + ldr r0, =0x03003170 + ldrb r1, [r0, 0xE] + adds r7, r0, 0 + cmp r1, 0x1 + bne _0800BAFC + ldr r1, =0x0400012a + ldr r2, =0x00008fff + b _0800BB00 + .pool +_0800BAFC: + ldr r1, =0x0400012a + ldr r2, =0x0000b9a0 +_0800BB00: + adds r0, r2, 0 + strh r0, [r1] + ldr r2, =0x03003174 + ldr r3, =0x04000120 + ldr r0, [r3] + ldr r1, [r3, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + movs r0, 0 + movs r1, 0 + str r0, [r3] + str r1, [r3, 0x4] + strb r0, [r2, 0xA] + movs r4, 0 + ldr r0, =0x03000d73 + mov r9, r0 + mov r8, r2 + ldr r2, =0x00008fff + ldr r1, =0x0000ffff + mov r12, r1 +_0800BB28: + lsls r0, r4, 1 + add r0, r8 + ldrh r3, [r0] + movs r0, 0x4 + negs r0, r0 + ands r0, r3 + ldr r1, =0x0000b9a0 + cmp r0, r1 + beq _0800BB40 + adds r0, r3, 0 + cmp r0, r2 + bne _0800BB70 +_0800BB40: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r3, 0 + cmp r6, r0 + bls _0800BB78 + cmp r0, 0 + beq _0800BB78 + adds r6, r3, 0 + b _0800BB78 + .pool +_0800BB70: + cmp r0, r12 + beq _0800BB82 + movs r5, 0 + b _0800BB82 +_0800BB78: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _0800BB28 +_0800BB82: + strb r5, [r7, 0x3] + adds r0, r5, 0 + cmp r0, 0x1 + bls _0800BBB2 + mov r2, r9 + ldrb r2, [r2] + cmp r0, r2 + bne _0800BBA4 + ldrh r1, [r7, 0x4] + ldr r0, =0x00008fff + cmp r1, r0 + bne _0800BBA4 + movs r0, 0x1 + b _0800BBBE + .pool +_0800BBA4: + ldrb r0, [r7, 0x3] + cmp r0, 0x1 + bls _0800BBB2 + movs r0, 0x3 + ands r6, r0 + adds r0, r6, 0x1 + b _0800BBB4 +_0800BBB2: + movs r0, 0 +_0800BBB4: + strb r0, [r7, 0xF] + ldrb r0, [r7, 0x3] + mov r1, r9 + strb r0, [r1] + movs r0, 0 +_0800BBBE: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_800BAD0 + + thumb_func_start sub_800BBCC +sub_800BBCC: @ 800BBCC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + ldr r0, =0x04000120 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp] + str r1, [sp, 0x4] + ldr r0, =0x03003170 + ldrb r1, [r0, 0x16] + adds r6, r0, 0 + cmp r1, 0 + bne _0800BC30 + movs r4, 0 + ldr r7, =0x03000d72 + ldrb r0, [r6, 0x3] + cmp r4, r0 + bcs _0800BC1A + adds r5, r6, 0 + ldrh r1, [r6, 0x14] + adds r3, r7, 0 + adds r2, r6, 0 +_0800BBFA: + lsls r0, r4, 1 + add r0, sp + ldrh r0, [r0] + cmp r1, r0 + beq _0800BC0E + ldrb r0, [r3] + cmp r0, 0 + beq _0800BC0E + movs r0, 0x1 + strb r0, [r5, 0x11] +_0800BC0E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldrb r0, [r2, 0x3] + cmp r4, r0 + bcc _0800BBFA +_0800BC1A: + movs r0, 0 + strh r0, [r6, 0x14] + movs r0, 0x1 + strb r0, [r7] + b _0800BCD0 + .pool +_0800BC30: + ldr r2, =0x00000fbc + adds r1, r6, r2 + adds r2, 0x1 + adds r0, r6, r2 + ldrb r2, [r0] + ldrb r1, [r1] + adds r0, r2, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x31 + bls _0800BC4C + subs r0, 0x32 + lsls r0, 24 + lsrs r0, 24 +_0800BC4C: + cmp r2, 0x31 + bhi _0800BCA8 + movs r4, 0 + ldrb r1, [r6, 0x3] + cmp r4, r1 + bcs _0800BCAC + adds r5, r6, 0 + ldr r7, =0x03000d70 + lsls r0, 1 + mov r12, r0 + movs r2, 0xCF + lsls r2, 2 + adds r2, r6 + mov r8, r2 +_0800BC68: + lsls r1, r4, 1 + mov r2, sp + adds r0, r2, r1 + ldrh r3, [r0] + ldrh r2, [r5, 0x14] + adds r0, r3, r2 + strh r0, [r5, 0x14] + ldrh r0, [r7] + orrs r0, r3 + strh r0, [r7] + ldrb r2, [r5, 0x17] + movs r0, 0x64 + muls r0, r2 + add r0, r12 + adds r1, r4 + lsls r1, 3 + adds r1, r4 + lsls r1, 5 + adds r0, r1 + add r0, r8 + strh r3, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldrb r0, [r5, 0x3] + cmp r4, r0 + bcc _0800BC68 + b _0800BCAC + .pool +_0800BCA8: + movs r0, 0x2 + strb r0, [r6, 0x12] +_0800BCAC: + ldrb r0, [r6, 0x17] + adds r0, 0x1 + strb r0, [r6, 0x17] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x8 + bne _0800BCD0 + ldr r2, =0x03000d70 + ldrh r0, [r2] + cmp r0, 0 + beq _0800BCD0 + ldr r1, =0x00000fbd + adds r0, r6, r1 + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + movs r0, 0 + strh r0, [r2] +_0800BCD0: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800BBCC + + thumb_func_start sub_800BCE4 +sub_800BCE4: @ 800BCE4 + push {r4,lr} + ldr r0, =0x03003170 + ldrb r1, [r0, 0x16] + adds r4, r0, 0 + cmp r1, 0x8 + bne _0800BD36 + ldr r1, =0x0400012a + ldrh r0, [r4, 0x14] + strh r0, [r1] + ldr r1, =0x03000d6d + ldrb r2, [r1] + cmp r2, 0 + bne _0800BD30 + ldr r0, =0x00000339 + adds r1, r4, r0 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + movs r0, 0xCE + lsls r0, 2 + adds r1, r4, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x31 + bls _0800BD8C + strb r2, [r1] + b _0800BD8C + .pool +_0800BD30: + movs r0, 0 + strb r0, [r1] + b _0800BD8C +_0800BD36: + ldr r1, =0x03000d6d + ldrb r0, [r1] + cmp r0, 0 + bne _0800BD52 + ldr r2, =0x00000339 + adds r0, r4, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _0800BD4C + movs r0, 0x1 + strb r0, [r1] +_0800BD4C: + ldrb r0, [r1] + cmp r0, 0 + beq _0800BD68 +_0800BD52: + ldr r1, =0x0400012a + movs r0, 0 + strh r0, [r1] + b _0800BD86 + .pool +_0800BD68: + ldr r3, =0x0400012a + movs r1, 0xCE + lsls r1, 2 + adds r0, r4, r1 + ldrb r0, [r0] + lsls r0, 1 + ldrb r2, [r4, 0x16] + movs r1, 0x64 + muls r1, r2 + adds r0, r1 + adds r1, r4, 0 + adds r1, 0x18 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r3] +_0800BD86: + ldrb r0, [r4, 0x16] + adds r0, 0x1 + strb r0, [r4, 0x16] +_0800BD8C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800BCE4 + + thumb_func_start sub_800BD98 +sub_800BD98: @ 800BD98 + push {lr} + ldr r0, =0x03003170 + ldrb r0, [r0] + cmp r0, 0 + beq _0800BDB4 + ldr r2, =0x0400010e + ldrh r1, [r2] + ldr r0, =0x0000ff7f + ands r0, r1 + strh r0, [r2] + ldr r1, =0x0400010c + ldr r2, =0x0000ff3b + adds r0, r2, 0 + strh r0, [r1] +_0800BDB4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_800BD98 + + thumb_func_start sub_800BDCC +sub_800BDCC: @ 800BDCC + push {lr} + ldr r1, =0x03003170 + ldrb r0, [r1, 0x17] + cmp r0, 0x8 + bne _0800BDE4 + movs r0, 0 + strb r0, [r1, 0x16] + strb r0, [r1, 0x17] + b _0800BDF4 + .pool +_0800BDE4: + ldrb r0, [r1] + cmp r0, 0 + beq _0800BDF4 + ldr r0, =0x0400010e + ldrh r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strh r1, [r0] +_0800BDF4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_800BDCC + + thumb_func_start sub_800BDFC +sub_800BDFC: @ 800BDFC + push {r4-r6,lr} + ldr r1, =0x03003170 + ldr r2, =0x00000339 + adds r0, r1, r2 + movs r2, 0 + strb r2, [r0] + movs r3, 0xCE + lsls r3, 2 + adds r0, r1, r3 + strb r2, [r0] + movs r0, 0 + movs r6, 0x64 + adds r5, r1, 0 + adds r5, 0x18 + ldr r4, =0x0000efff +_0800BE1A: + movs r2, 0 + adds r1, r0, 0x1 + adds r3, r0, 0 + muls r3, r6 +_0800BE22: + lsls r0, r2, 1 + adds r0, r3 + adds r0, r5 + strh r4, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x31 + bls _0800BE22 + lsls r0, r1, 24 + lsrs r0, 24 + cmp r0, 0x7 + bls _0800BE1A + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800BDFC + + thumb_func_start sub_800BE50 +sub_800BE50: @ 800BE50 + push {r4-r7,lr} + ldr r1, =0x03003170 + ldr r2, =0x00000fbd + adds r0, r1, r2 + movs r2, 0 + strb r2, [r0] + ldr r3, =0x00000fbc + adds r0, r1, r3 + strb r2, [r0] + movs r0, 0x64 + mov r12, r0 + movs r3, 0xCF + lsls r3, 2 + adds r7, r1, r3 + ldr r6, =0x0000efff +_0800BE6E: + movs r3, 0 + lsls r0, r2, 1 + adds r5, r2, 0x1 + adds r0, r2 + lsls r0, 3 + adds r0, r2 + lsls r4, r0, 5 +_0800BE7C: + movs r2, 0 + adds r1, r3, 0x1 + mov r0, r12 + muls r0, r3 + adds r3, r0, 0 +_0800BE86: + lsls r0, r2, 1 + adds r0, r3 + adds r0, r4 + adds r0, r7 + strh r6, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x31 + bls _0800BE86 + lsls r0, r1, 24 + lsrs r3, r0, 24 + cmp r3, 0x7 + bls _0800BE7C + lsls r0, r5, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _0800BE6E + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800BE50 + + thumb_func_start sub_800BEC0 +sub_800BEC0: @ 800BEC0 + push {r4,lr} + bl rfu_REQBN_softReset_and_checkID + adds r4, r0, 0 + ldr r0, =0x00008001 + cmp r4, r0 + bne _0800BED4 + ldr r1, =0x03004140 + movs r0, 0x1 + strb r0, [r1, 0x8] +_0800BED4: + ldr r0, =0x03004140 + ldrb r2, [r0, 0x4] + adds r1, r0, 0 + cmp r2, 0x17 + beq _0800BEE8 + cmp r2, 0x1 + beq _0800BEE8 + movs r0, 0 + strb r0, [r1, 0x5] + strb r0, [r1, 0x4] +_0800BEE8: + movs r0, 0 + strb r0, [r1, 0x7] + strb r0, [r1, 0xD] + strb r0, [r1, 0x1] + strb r0, [r1] + movs r0, 0xFF + strb r0, [r1, 0x6] + bl sub_800D610 + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_800BEC0 + + thumb_func_start rfu_REQ_sendData_wrapper +rfu_REQ_sendData_wrapper: @ 800BF0C + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x03007890 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0 + bne _0800BF34 + ldr r0, =0x03004140 + ldrb r0, [r0, 0x2] + movs r2, 0 + cmp r0, 0x1 + bne _0800BF3C + movs r2, 0x1 + b _0800BF3C + .pool +_0800BF34: + ldr r0, =0x03004140 + ldrb r1, [r0, 0x3] + movs r1, 0 + strb r1, [r0, 0x3] +_0800BF3C: + adds r0, r2, 0 + bl rfu_REQ_sendData + pop {r0} + bx r0 + .pool + thumb_func_end rfu_REQ_sendData_wrapper + + thumb_func_start sub_800BF4C +sub_800BF4C: @ 800BF4C + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + cmp r5, 0 + beq _0800BF94 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r4, =0x03004140 + ldr r2, =0x01000024 + mov r0, sp + adds r1, r4, 0 + bl CpuSet + movs r0, 0xFF + strb r0, [r4, 0x6] + str r5, [r4, 0x40] + str r6, [r4, 0x44] + ldr r0, =sub_800CEB0 + bl rfu_setMSCCallback + ldr r0, =sub_800C7B4 + bl rfu_setREQCallback + movs r0, 0 + b _0800BF96 + .pool +_0800BF94: + movs r0, 0x4 +_0800BF96: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_800BF4C + + thumb_func_start sub_800BFA0 +sub_800BFA0: @ 800BFA0 + push {r4,lr} + sub sp, 0x4 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r4, =0x03004140 + ldr r2, =0x01000020 + mov r0, sp + adds r1, r4, 0 + bl CpuSet + movs r0, 0xFF + strb r0, [r4, 0x6] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800BFA0 + + thumb_func_start sub_800BFCC +sub_800BFCC: @ 800BFCC + push {r4,lr} + adds r4, r0, 0 + bl sub_800C000 + ldr r1, =0x03004140 + movs r2, 0x1 + strb r2, [r1, 0x4] + movs r0, 0x2 + strb r0, [r1, 0x5] + str r4, [r1, 0x3C] + ldrb r0, [r4, 0x11] + strb r0, [r1, 0x9] + ldrh r0, [r4, 0x12] + strh r0, [r1, 0x32] + ldrh r0, [r4, 0x14] + strh r0, [r1, 0x18] + ldrb r0, [r4, 0x10] + cmp r0, 0 + beq _0800BFF4 + strb r2, [r1, 0xB] +_0800BFF4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800BFCC + + thumb_func_start sub_800C000 +sub_800C000: @ 800C000 + push {r4,r5,lr} + ldr r2, =0x03004140 + movs r0, 0 + strb r0, [r2, 0x5] + strb r0, [r2, 0x4] + movs r1, 0xFF + strb r1, [r2, 0x6] + strb r0, [r2, 0x7] + strb r0, [r2, 0x10] + strb r0, [r2, 0xC] + adds r1, r2, 0 + adds r1, 0x24 + strb r0, [r1] + adds r1, 0xC + strb r0, [r1] + movs r3, 0 + adds r5, r2, 0 + adds r5, 0x28 + movs r4, 0 + adds r2, 0x34 +_0800C028: + lsls r1, r3, 1 + adds r0, r1, r5 + strh r4, [r0] + adds r1, r2 + strh r4, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3 + bls _0800C028 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800C000 + + thumb_func_start sub_800C048 +sub_800C048: @ 800C048 + ldr r1, =0x03004140 + movs r0, 0x15 + strb r0, [r1, 0x4] + bx lr + .pool + thumb_func_end sub_800C048 + + thumb_func_start sub_800C054 +sub_800C054: @ 800C054 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r3, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 16 + lsrs r7, r1, 16 + lsls r2, 16 + lsrs r2, 16 + mov r8, r2 + ldr r1, =0x03004140 + ldrb r0, [r1, 0x4] + cmp r0, 0 + beq _0800C090 + cmp r0, 0x8 + bne _0800C07A + cmp r5, 0x1 + beq _0800C090 +_0800C07A: + movs r0, 0x1 + strh r0, [r1, 0x14] + movs r0, 0xF3 + movs r1, 0x1 + bl sub_800D30C + movs r0, 0x1 + b _0800C122 + .pool +_0800C090: + bl rfu_getMasterSlave + lsls r0, 24 + cmp r0, 0 + bne _0800C0B0 + ldr r1, =0x03004140 + movs r0, 0x2 + strh r0, [r1, 0x14] + movs r0, 0xF3 + movs r1, 0x1 + bl sub_800D30C + movs r0, 0x2 + b _0800C122 + .pool +_0800C0B0: + movs r2, 0 + ldrh r0, [r6] + ldr r4, =0x0000ffff + adds r1, r6, 0x2 + ldr r3, =0x03004140 + cmp r0, r4 + beq _0800C0D0 +_0800C0BE: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xF + bhi _0800C0D0 + ldrh r0, [r1] + adds r1, 0x2 + cmp r0, r4 + bne _0800C0BE +_0800C0D0: + cmp r2, 0x10 + bne _0800C0EC + movs r0, 0x4 + strh r0, [r3, 0x14] + movs r0, 0xF3 + movs r1, 0x1 + bl sub_800D30C + movs r0, 0x4 + b _0800C122 + .pool +_0800C0EC: + cmp r5, 0x1 + bls _0800C0FA + movs r0, 0x1 + strb r0, [r3, 0x7] + movs r5, 0x1 + movs r7, 0 + b _0800C0FE +_0800C0FA: + movs r0, 0 + strb r0, [r3, 0x7] +_0800C0FE: + cmp r5, 0 + beq _0800C108 + movs r0, 0x5 + strb r0, [r3, 0x4] + b _0800C116 +_0800C108: + movs r0, 0x9 + strb r0, [r3, 0x4] + ldrb r0, [r3, 0xB] + cmp r0, 0 + beq _0800C116 + movs r0, 0x2 + strb r0, [r3, 0xB] +_0800C116: + strb r5, [r3, 0x6] + strh r7, [r3, 0x1A] + mov r0, r8 + strh r0, [r3, 0x26] + str r6, [r3, 0x20] + movs r0, 0 +_0800C122: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_800C054 + + thumb_func_start sub_800C12C +sub_800C12C: @ 800C12C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + ldr r1, =0x03004140 + ldrb r0, [r1, 0x4] + cmp r0, 0 + beq _0800C164 + subs r0, 0x9 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bls _0800C164 + movs r0, 0x1 + strh r0, [r1, 0x14] + movs r0, 0xF3 + movs r1, 0x1 + bl sub_800D30C + movs r0, 0x1 + b _0800C204 + .pool +_0800C164: + bl rfu_getMasterSlave + lsls r0, 24 + cmp r0, 0 + bne _0800C184 + ldr r1, =0x03004140 + movs r0, 0x2 + strh r0, [r1, 0x14] + movs r0, 0xF3 + movs r1, 0x1 + bl sub_800D30C + movs r0, 0x2 + b _0800C204 + .pool +_0800C184: + movs r2, 0 + ldr r0, =0x03007890 + ldr r1, [r0] + ldrb r3, [r1, 0x8] + ldr r5, =0x03004140 + adds r7, r0, 0 + cmp r2, r3 + bcs _0800C1B2 + ldrh r0, [r1, 0x14] + cmp r0, r6 + beq _0800C1B2 + adds r4, r1, 0 + adds r1, r3, 0 +_0800C19E: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r1 + bcs _0800C1B2 + lsls r0, r2, 5 + adds r0, r4, r0 + ldrh r0, [r0, 0x14] + cmp r0, r6 + bne _0800C19E +_0800C1B2: + ldr r0, [r7] + ldrb r0, [r0, 0x8] + cmp r0, 0 + beq _0800C1BE + cmp r2, r0 + bne _0800C1D8 +_0800C1BE: + movs r0, 0x3 + strh r0, [r5, 0x14] + movs r0, 0xF3 + movs r1, 0x1 + bl sub_800D30C + movs r0, 0x3 + b _0800C204 + .pool +_0800C1D8: + ldrb r0, [r5, 0x4] + cmp r0, 0 + beq _0800C1E2 + cmp r0, 0x9 + bne _0800C1EA +_0800C1E2: + movs r0, 0xC + strb r0, [r5, 0x4] + movs r0, 0xD + b _0800C1F0 +_0800C1EA: + movs r0, 0xB + strb r0, [r5, 0x4] + movs r0, 0xC +_0800C1F0: + strb r0, [r5, 0x5] + strh r6, [r5, 0x1E] + mov r0, r8 + strh r0, [r5, 0x1A] + ldrb r0, [r5, 0x7] + cmp r0, 0 + beq _0800C202 + movs r0, 0x7 + strb r0, [r5, 0x7] +_0800C202: + movs r0, 0 +_0800C204: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_800C12C + + thumb_func_start sub_800C210 +sub_800C210: @ 800C210 + push {r4-r7,lr} + lsls r0, 24 + lsrs r1, r0, 24 + ldr r6, =0x03004140 + adds r3, r6, 0 + adds r3, 0x30 + ldrb r2, [r3] + adds r0, r1, 0 + ands r0, r2 + cmp r0, 0 + beq _0800C26C + adds r0, r2, 0 + bics r0, r1 + strb r0, [r3] + movs r4, 0 + ldr r7, =0x03007890 + movs r5, 0x1 + adds r3, 0x4 + movs r2, 0 +_0800C236: + adds r0, r1, 0 + asrs r0, r4 + ands r0, r5 + cmp r0, 0 + beq _0800C246 + lsls r0, r4, 1 + adds r0, r3 + strh r2, [r0] +_0800C246: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _0800C236 + ldr r0, [r7] + ldrb r4, [r0, 0x3] + ands r4, r1 + cmp r4, 0 + beq _0800C260 + adds r0, r4, 0 + bl sub_800D334 +_0800C260: + ldr r0, =0x03004140 + strh r4, [r0, 0x14] + movs r0, 0x33 + adds r1, r4, 0 + bl sub_800D30C +_0800C26C: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800C210 + + thumb_func_start sub_800C27C +sub_800C27C: @ 800C27C + push {r4,r5,lr} + lsls r0, 24 + movs r2, 0 + ldr r1, =0x03004140 + strb r2, [r1, 0x7] + adds r5, r1, 0 + cmp r0, 0 + beq _0800C29C + bl sub_800C000 + movs r0, 0x17 + strb r0, [r5, 0x4] + b _0800C366 + .pool +_0800C29C: + ldrb r0, [r5, 0x4] + subs r0, 0x5 + cmp r0, 0xD + bhi _0800C352 + lsls r0, 2 + ldr r1, =_0800C2B4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0800C2B4: + .4byte _0800C2EC + .4byte _0800C2F8 + .4byte _0800C2F8 + .4byte _0800C358 + .4byte _0800C302 + .4byte _0800C30C + .4byte _0800C30C + .4byte _0800C316 + .4byte _0800C320 + .4byte _0800C320 + .4byte _0800C358 + .4byte _0800C326 + .4byte _0800C34C + .4byte _0800C34C +_0800C2EC: + movs r1, 0 + movs r0, 0x8 + strb r0, [r5, 0x4] + strb r1, [r5, 0x5] + movs r2, 0x13 + b _0800C358 +_0800C2F8: + movs r0, 0x7 + strb r0, [r5, 0x4] + movs r0, 0x8 + strb r0, [r5, 0x5] + b _0800C358 +_0800C302: + movs r0, 0 + strb r0, [r5, 0x5] + strb r0, [r5, 0x4] + movs r2, 0x21 + b _0800C358 +_0800C30C: + movs r1, 0 + movs r0, 0xB + strb r0, [r5, 0x4] + strb r1, [r5, 0x5] + b _0800C358 +_0800C316: + movs r0, 0 + strb r0, [r5, 0x5] + strb r0, [r5, 0x4] + movs r2, 0x23 + b _0800C358 +_0800C320: + movs r0, 0xE + strb r0, [r5, 0x4] + b _0800C358 +_0800C326: + ldrb r0, [r5, 0x11] + strb r0, [r5, 0x4] + ldrb r0, [r5, 0x12] + strb r0, [r5, 0x5] + ldr r4, =0x03007890 + ldr r0, [r4] + ldrb r0, [r0, 0x3] + bl sub_800D334 + ldr r0, [r4] + ldrb r0, [r0, 0x3] + strh r0, [r5, 0x14] + movs r0, 0x33 + movs r1, 0x1 + bl sub_800D30C + b _0800C366 + .pool +_0800C34C: + movs r0, 0x12 + strb r0, [r5, 0x4] + b _0800C358 +_0800C352: + strb r2, [r5, 0x5] + strb r2, [r5, 0x4] + movs r2, 0x43 +_0800C358: + ldrb r0, [r5, 0x4] + cmp r0, 0 + bne _0800C366 + adds r0, r2, 0 + movs r1, 0 + bl sub_800D30C +_0800C366: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_800C27C + + thumb_func_start sub_800C36C +sub_800C36C: @ 800C36C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + mov r8, r1 + mov r5, sp + adds r5, 0x1 + mov r4, sp + adds r4, 0x2 + mov r1, sp + adds r2, r5, 0 + adds r3, r4, 0 + bl rfu_REQBN_watchLink + mov r0, sp + ldrb r0, [r0] + adds r7, r4, 0 + cmp r0, 0 + beq _0800C43E + ldr r1, =0x03004140 + mov r0, sp + ldrb r0, [r0] + strh r0, [r1, 0x14] + ldrb r0, [r5] + strh r0, [r1, 0x16] + ldrb r0, [r1, 0x9] + adds r6, r1, 0 + cmp r0, 0 + beq _0800C426 + movs r0, 0x1 + strb r0, [r6, 0xA] + ldrb r0, [r6, 0x6] + cmp r0, 0 + bne _0800C3C2 + ldrb r0, [r5] + cmp r0, 0 + bne _0800C3C2 + movs r0, 0x4 + strb r0, [r6, 0xA] +_0800C3C2: + ldrb r0, [r6, 0xA] + cmp r0, 0x1 + bne _0800C40C + movs r2, 0 + mov r4, sp + movs r5, 0x1 + mov r12, r6 + mov r3, r12 + adds r3, 0x30 + movs r6, 0x34 + add r6, r12 + mov r9, r6 +_0800C3DA: + ldrb r0, [r4] + asrs r0, r2 + ands r0, r5 + cmp r0, 0 + beq _0800C3F8 + adds r0, r5, 0 + lsls r0, r2 + ldrb r1, [r3] + orrs r0, r1 + strb r0, [r3] + lsls r0, r2, 1 + add r0, r9 + mov r6, r12 + ldrh r1, [r6, 0x32] + strh r1, [r0] +_0800C3F8: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _0800C3DA + movs r0, 0x31 + b _0800C41E + .pool +_0800C40C: + movs r0, 0 + strb r0, [r6, 0xA] + mov r0, sp + ldrb r0, [r0] + bl sub_800D334 + movs r0, 0x1 + mov r8, r0 + movs r0, 0x33 +_0800C41E: + movs r1, 0x1 + bl sub_800D30C + b _0800C43A +_0800C426: + mov r0, sp + ldrb r0, [r0] + bl sub_800D334 + movs r1, 0x1 + mov r8, r1 + movs r0, 0x30 + movs r1, 0x2 + bl sub_800D30C +_0800C43A: + bl sub_800D610 +_0800C43E: + ldr r0, =0x03007890 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x1 + bne _0800C518 + ldrb r0, [r7] + cmp r0, 0 + beq _0800C49C + movs r2, 0 + ldr r6, =0x03004140 + movs r3, 0x1 + adds r4, r6, 0 + adds r4, 0x34 + adds r6, 0x30 + adds r5, r7, 0 +_0800C45C: + ldrb r0, [r6] + asrs r0, r2 + ands r0, r3 + cmp r0, 0 + beq _0800C478 + ldrb r0, [r5] + asrs r0, r2 + ands r0, r3 + cmp r0, 0 + beq _0800C478 + lsls r0, r2, 1 + adds r0, r4 + movs r1, 0 + strh r1, [r0] +_0800C478: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _0800C45C + ldr r3, =0x03004140 + adds r2, r3, 0 + adds r2, 0x30 + ldrb r1, [r7] + ldrb r0, [r2] + bics r0, r1 + strb r0, [r2] + ldrb r0, [r7] + strh r0, [r3, 0x14] + movs r0, 0x32 + movs r1, 0x1 + bl sub_800D30C +_0800C49C: + ldr r0, =0x03004140 + adds r3, r0, 0 + adds r3, 0x30 + ldrb r1, [r3] + adds r6, r0, 0 + cmp r1, 0 + beq _0800C514 + movs r4, 0 + movs r2, 0 + movs r5, 0x1 +_0800C4B0: + ldrb r0, [r3] + asrs r0, r2 + ands r0, r5 + cmp r0, 0 + beq _0800C4E2 + lsls r1, r2, 1 + adds r0, r6, 0 + adds r0, 0x34 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _0800C4E2 + subs r0, 0x1 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + bne _0800C4E2 + adds r0, r5, 0 + lsls r0, r2 + ldrb r1, [r3] + bics r1, r0 + strb r1, [r3] + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_0800C4E2: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _0800C4B0 + cmp r4, 0 + beq _0800C506 + adds r0, r4, 0 + bl sub_800D334 + movs r6, 0x1 + mov r8, r6 + ldr r0, =0x03004140 + strh r4, [r0, 0x14] + movs r0, 0x33 + movs r1, 0x1 + bl sub_800D30C +_0800C506: + ldr r0, =0x03004140 + adds r1, r0, 0 + adds r1, 0x30 + ldrb r1, [r1] + adds r6, r0, 0 + cmp r1, 0 + bne _0800C518 +_0800C514: + movs r0, 0 + strb r0, [r6, 0xA] +_0800C518: + mov r0, r8 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_800C36C + + thumb_func_start rfu_syncVBlank_ +rfu_syncVBlank_: @ 800C530 + push {lr} + bl rfu_syncVBlank + lsls r0, 16 + cmp r0, 0 + beq _0800C548 + movs r0, 0xF1 + movs r1, 0 + bl sub_800D30C + bl sub_800D610 +_0800C548: + pop {r0} + bx r0 + thumb_func_end rfu_syncVBlank_ + + thumb_func_start sub_800C54C +sub_800C54C: @ 800C54C + push {r4,lr} + adds r3, r0, 0 + ldr r1, =0x03004140 + ldr r2, [r1, 0x40] + cmp r2, 0 + bne _0800C568 + ldrb r0, [r1, 0x4] + cmp r0, 0 + beq _0800C568 + strb r2, [r1, 0x4] + b _0800C736 + .pool +_0800C568: + ldr r0, =0x03004140 + ldrb r0, [r0, 0x7] + cmp r0, 0 + beq _0800C576 + adds r0, r3, 0 + bl sub_800C744 +_0800C576: + ldr r4, =0x03004140 + ldrb r0, [r4, 0x4] + cmp r0, 0 + bne _0800C580 + b _0800C700 +_0800C580: + bl rfu_waitREQComplete + movs r0, 0x1 + strb r0, [r4, 0xE] + ldrb r0, [r4, 0x4] + subs r0, 0x1 + cmp r0, 0x16 + bls _0800C592 + b _0800C6F6 +_0800C592: + lsls r0, 2 + ldr r1, =_0800C5A4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0800C5A4: + .4byte _0800C624 + .4byte _0800C65C + .4byte _0800C662 + .4byte _0800C678 + .4byte _0800C690 + .4byte _0800C696 + .4byte _0800C69C + .4byte _0800C6F6 + .4byte _0800C6A2 + .4byte _0800C6A8 + .4byte _0800C6AE + .4byte _0800C6B4 + .4byte _0800C6C4 + .4byte _0800C6CA + .4byte _0800C6F6 + .4byte _0800C6D0 + .4byte _0800C6E0 + .4byte _0800C6E6 + .4byte _0800C6EC + .4byte _0800C6F6 + .4byte _0800C6F2 + .4byte _0800C6F6 + .4byte _0800C600 +_0800C600: + bl sub_800BEC0 + ldr r1, =0x00008001 + movs r2, 0xFF + cmp r0, r1 + bne _0800C60E + movs r2, 0x44 +_0800C60E: + ldr r1, =0x03004140 + movs r0, 0 + strb r0, [r1, 0x5] + strb r0, [r1, 0x4] + adds r0, r2, 0 + b _0800C64E + .pool +_0800C624: + bl sub_800BEC0 + ldr r1, =0x00008001 + cmp r0, r1 + bne _0800C644 + ldr r0, =0x03004140 + ldrb r1, [r0, 0x5] + strb r1, [r0, 0x4] + movs r1, 0x3 + strb r1, [r0, 0x5] + b _0800C6F6 + .pool +_0800C644: + ldr r1, =0x03004140 + movs r0, 0 + strb r0, [r1, 0x5] + strb r0, [r1, 0x4] + movs r0, 0xFF +_0800C64E: + movs r1, 0 + bl sub_800D30C + b _0800C6F6 + .pool +_0800C65C: + bl rfu_REQ_reset + b _0800C6F6 +_0800C662: + ldr r0, =0x03004140 + ldr r2, [r0, 0x3C] + ldrh r0, [r2, 0x2] + ldrb r1, [r2] + ldrb r2, [r2, 0x1] + bl rfu_REQ_configSystem + b _0800C6F6 + .pool +_0800C678: + ldr r0, =0x03004140 + ldr r3, [r0, 0x3C] + ldrb r0, [r3, 0x4] + ldrh r1, [r3, 0x6] + ldr r2, [r3, 0x8] + ldr r3, [r3, 0xC] + bl rfu_REQ_configGameData + b _0800C6F6 + .pool +_0800C690: + bl rfu_REQ_startSearchChild + b _0800C6F6 +_0800C696: + bl rfu_REQ_pollSearchChild + b _0800C6F6 +_0800C69C: + bl rfu_REQ_endSearchChild + b _0800C6F6 +_0800C6A2: + bl rfu_REQ_startSearchParent + b _0800C6F6 +_0800C6A8: + bl rfu_REQ_pollSearchParent + b _0800C6F6 +_0800C6AE: + bl rfu_REQ_endSearchParent + b _0800C6F6 +_0800C6B4: + ldr r0, =0x03004140 + ldrh r0, [r0, 0x1E] + bl rfu_REQ_startConnectParent + b _0800C6F6 + .pool +_0800C6C4: + bl rfu_REQ_pollConnectParent + b _0800C6F6 +_0800C6CA: + bl rfu_REQ_endConnectParent + b _0800C6F6 +_0800C6D0: + ldr r0, =0x03007890 + ldr r0, [r0] + ldrb r0, [r0, 0x3] + bl rfu_REQ_CHILD_startConnectRecovery + b _0800C6F6 + .pool +_0800C6E0: + bl rfu_REQ_CHILD_pollConnectRecovery + b _0800C6F6 +_0800C6E6: + bl rfu_REQ_CHILD_endConnectRecovery + b _0800C6F6 +_0800C6EC: + bl rfu_REQ_changeMasterSlave + b _0800C6F6 +_0800C6F2: + bl rfu_REQ_stopMode +_0800C6F6: + bl rfu_waitREQComplete + ldr r1, =0x03004140 + movs r0, 0 + strb r0, [r1, 0xE] +_0800C700: + ldr r0, =0x03004140 + ldrb r0, [r0, 0x4] + subs r0, 0x12 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0800C710 + b _0800C576 +_0800C710: + ldr r0, =0x03007890 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x1 + bne _0800C726 + movs r0, 0 + bl sub_800C36C + lsls r0, 24 + cmp r0, 0 + bne _0800C736 +_0800C726: + bl sub_800CF34 + bl sub_800D158 + bl sub_800D268 + bl sub_800D434 +_0800C736: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800C54C + + thumb_func_start sub_800C744 +sub_800C744: @ 800C744 + push {r4,lr} + adds r3, r0, 0 + ldr r0, =0x03004140 + ldrb r1, [r0, 0x7] + adds r4, r0, 0 + cmp r1, 0x5 + bne _0800C76E + movs r2, 0x1 + strb r2, [r4, 0x6] + strb r1, [r4, 0x4] + ldrh r0, [r4, 0x1C] + strh r0, [r4, 0x1A] + lsls r0, 16 + cmp r0, 0 + beq _0800C76C + movs r0, 0x6 + strb r0, [r4, 0x7] + b _0800C76E + .pool +_0800C76C: + strb r2, [r4, 0x7] +_0800C76E: + ldrb r0, [r4, 0x7] + cmp r0, 0x1 + bne _0800C798 + strb r0, [r4, 0x6] + movs r0, 0x5 + strb r0, [r4, 0x4] + adds r0, r3, 0 + movs r1, 0x8C + bl __umodsi3 + strh r0, [r4, 0x1A] + movs r1, 0x8C + subs r1, r0 + strh r1, [r4, 0x1C] + lsls r0, 16 + cmp r0, 0 + beq _0800C794 + movs r0, 0x2 + b _0800C796 +_0800C794: + movs r0, 0x3 +_0800C796: + strb r0, [r4, 0x7] +_0800C798: + ldrb r0, [r4, 0x7] + cmp r0, 0x3 + bne _0800C7AE + movs r0, 0 + strb r0, [r4, 0x6] + movs r0, 0x28 + strh r0, [r4, 0x1A] + movs r0, 0x4 + strb r0, [r4, 0x7] + movs r0, 0x9 + strb r0, [r4, 0x4] +_0800C7AE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_800C744 + + thumb_func_start sub_800C7B4 +sub_800C7B4: @ 800C7B4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r1, 16 + lsrs r6, r1, 16 + ldr r0, =0x03004140 + ldrb r1, [r0, 0xE] + adds r7, r0, 0 + cmp r1, 0 + bne _0800C7D2 + b _0800CC98 +_0800C7D2: + movs r0, 0 + strb r0, [r7, 0xE] + mov r0, r8 + subs r0, 0x10 + cmp r0, 0x2D + bls _0800C7E0 + b _0800CC8A +_0800C7E0: + lsls r0, 2 + ldr r1, =_0800C7F4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0800C7F4: + .4byte _0800C8AC + .4byte _0800CC8A + .4byte _0800CC8A + .4byte _0800CC8A + .4byte _0800CC8A + .4byte _0800CC8A + .4byte _0800C8D8 + .4byte _0800C8C4 + .4byte _0800CC8A + .4byte _0800C8EC + .4byte _0800C8FC + .4byte _0800C920 + .4byte _0800C940 + .4byte _0800C960 + .4byte _0800C9D0 + .4byte _0800CA02 + .4byte _0800CA18 + .4byte _0800CA60 + .4byte _0800CC8A + .4byte _0800CC8A + .4byte _0800CC8A + .4byte _0800CC8A + .4byte _0800CC8A + .4byte _0800CBD8 + .4byte _0800CC8A + .4byte _0800CC8A + .4byte _0800CC8A + .4byte _0800CC8A + .4byte _0800CC8A + .4byte _0800CC8A + .4byte _0800CC8A + .4byte _0800CC8A + .4byte _0800CC8A + .4byte _0800CC8A + .4byte _0800CAD0 + .4byte _0800CB1C + .4byte _0800CB64 + .4byte _0800CC8A + .4byte _0800CC8A + .4byte _0800CC8A + .4byte _0800CC8A + .4byte _0800CC8A + .4byte _0800CC8A + .4byte _0800CC8A + .4byte _0800CC8A + .4byte _0800CC78 +_0800C8AC: + cmp r6, 0 + beq _0800C8B2 + b _0800CC8A +_0800C8B2: + ldr r0, =0x03004140 + ldrb r1, [r0, 0x5] + strb r1, [r0, 0x4] + movs r1, 0x4 + strb r1, [r0, 0x5] + b _0800CC8A + .pool +_0800C8C4: + cmp r6, 0 + beq _0800C8CA + b _0800CC8A +_0800C8CA: + ldr r0, =0x03004140 + ldrb r1, [r0, 0x5] + strb r1, [r0, 0x4] + strb r6, [r0, 0x5] + b _0800CC8A + .pool +_0800C8D8: + cmp r6, 0 + beq _0800C8DE + b _0800CC8A +_0800C8DE: + ldr r0, =0x03004140 + strb r6, [r0, 0x5] + strb r6, [r0, 0x4] + movs r0, 0 + b _0800CBF6 + .pool +_0800C8EC: + cmp r6, 0 + beq _0800C8F2 + b _0800CC8A +_0800C8F2: + ldr r1, =0x03004140 + movs r0, 0x6 + b _0800CA0C + .pool +_0800C8FC: + ldr r1, =0x03004140 + ldrh r0, [r1, 0x1A] + cmp r0, 0 + bne _0800C906 + b _0800CC8A +_0800C906: + subs r0, 0x1 + strh r0, [r1, 0x1A] + lsls r0, 16 + cmp r0, 0 + beq _0800C912 + b _0800CC8A +_0800C912: + movs r0, 0x7 + strb r0, [r1, 0x4] + movs r0, 0x8 + strb r0, [r1, 0x5] + b _0800CC8A + .pool +_0800C920: + cmp r6, 0 + beq _0800C926 + b _0800CC8A +_0800C926: + ldr r0, =0x03004140 + ldrb r1, [r0, 0x5] + strb r1, [r0, 0x4] + strb r6, [r0, 0x5] + ldrb r0, [r0, 0x7] + cmp r0, 0 + beq _0800C936 + b _0800CC8A +_0800C936: + movs r0, 0x13 + b _0800CBF6 + .pool +_0800C940: + cmp r6, 0 + beq _0800C946 + b _0800CC8A +_0800C946: + ldrb r0, [r7, 0xB] + cmp r0, 0x1 + bne _0800C956 + ldrh r0, [r7, 0x1A] + cmp r0, 0x1 + bls _0800C956 + subs r0, 0x1 + strh r0, [r7, 0x1A] +_0800C956: + ldr r1, =0x03004140 + movs r0, 0xA + b _0800CA0C + .pool +_0800C960: + cmp r6, 0 + bne _0800C9A6 + bl sub_800D294 + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + strb r0, [r1] + ldr r4, =0x03004140 + strh r0, [r4, 0x14] + cmp r0, 0 + beq _0800C980 + movs r0, 0x20 + movs r1, 0x1 + bl sub_800D30C +_0800C980: + ldrb r0, [r4, 0xB] + cmp r0, 0 + beq _0800C9A6 + ldrh r0, [r4, 0x1A] + cmp r0, 0x1 + beq _0800C9A6 + ldr r0, =0x03007890 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0x4 + bne _0800C9A6 + bl rfu_REQ_endSearchParent + bl rfu_waitREQComplete + movs r0, 0x9 + strb r0, [r4, 0x4] + movs r0, 0x1 + strb r0, [r4, 0xB] +_0800C9A6: + ldr r1, =0x03004140 + ldrh r0, [r1, 0x1A] + cmp r0, 0 + bne _0800C9B0 + b _0800CC8A +_0800C9B0: + subs r0, 0x1 + strh r0, [r1, 0x1A] + lsls r0, 16 + cmp r0, 0 + beq _0800C9BC + b _0800CC8A +_0800C9BC: + movs r0, 0xB + strb r0, [r1, 0x4] + movs r0, 0 + strb r0, [r1, 0x5] + b _0800CC8A + .pool +_0800C9D0: + cmp r6, 0 + beq _0800C9D6 + b _0800CC8A +_0800C9D6: + ldr r2, =0x03004140 + ldrb r0, [r2, 0x5] + strb r0, [r2, 0x4] + ldrb r1, [r2, 0x7] + cmp r1, 0 + bne _0800C9F4 + lsls r0, 24 + cmp r0, 0 + beq _0800C9EA + b _0800CC8A +_0800C9EA: + movs r0, 0x21 + b _0800CBF6 + .pool +_0800C9F4: + cmp r1, 0x7 + bne _0800C9FA + b _0800CC8A +_0800C9FA: + movs r0, 0x5 + strb r0, [r2, 0x4] + strb r0, [r2, 0x7] + b _0800CC8A +_0800CA02: + cmp r6, 0 + beq _0800CA08 + b _0800CC8A +_0800CA08: + ldr r1, =0x03004140 + movs r0, 0xD +_0800CA0C: + strb r0, [r1, 0x5] + strb r0, [r1, 0x4] + b _0800CC8A + .pool +_0800CA18: + cmp r6, 0 + bne _0800CA3C + ldr r4, =0x03004150 + mov r0, sp + adds r1, r4, 0 + bl rfu_getConnectParentStatus + lsls r0, 16 + cmp r0, 0 + bne _0800CA3C + mov r0, sp + ldrb r0, [r0] + cmp r0, 0 + bne _0800CA3C + adds r1, r4, 0 + subs r1, 0x10 + movs r0, 0xE + strb r0, [r1, 0x4] +_0800CA3C: + ldr r1, =0x03004140 + ldrh r0, [r1, 0x1A] + cmp r0, 0 + bne _0800CA46 + b _0800CC8A +_0800CA46: + subs r0, 0x1 + strh r0, [r1, 0x1A] + lsls r0, 16 + cmp r0, 0 + beq _0800CA52 + b _0800CC8A +_0800CA52: + movs r0, 0xE + strb r0, [r1, 0x4] + b _0800CC8A + .pool +_0800CA60: + cmp r6, 0 + beq _0800CA66 + b _0800CC8A +_0800CA66: + ldr r4, =0x03004150 + mov r0, sp + adds r1, r4, 0 + bl rfu_getConnectParentStatus + lsls r0, 16 + cmp r0, 0 + beq _0800CA78 + b _0800CC8A +_0800CA78: + mov r0, sp + ldrb r0, [r0] + cmp r0, 0 + bne _0800CA9C + adds r1, r4, 0 + subs r1, 0x10 + movs r0, 0x13 + strb r0, [r1, 0x4] + movs r0, 0xF + strb r0, [r1, 0x5] + movs r0, 0x22 + strh r0, [r1, 0x1E] + ldrb r0, [r1, 0x10] + strh r0, [r1, 0x14] + b _0800CABC + .pool +_0800CA9C: + adds r1, r4, 0 + subs r1, 0x10 + strb r6, [r1, 0x5] + strb r6, [r1, 0x4] + movs r0, 0x23 + strh r0, [r1, 0x1E] + mov r0, sp + ldrb r0, [r0] + strh r0, [r1, 0x14] + ldrb r0, [r1, 0x7] + cmp r0, 0 + beq _0800CABC + movs r0, 0x3 + strb r0, [r1, 0x7] + movs r0, 0x9 + strb r0, [r1, 0x4] +_0800CABC: + ldr r4, =0x03004140 + ldrb r0, [r4, 0x1E] + movs r1, 0x1 + bl sub_800D30C + movs r0, 0 + strh r0, [r4, 0x1E] + b _0800CC8A + .pool +_0800CAD0: + cmp r6, 0 + beq _0800CAD6 + b _0800CC8A +_0800CAD6: + ldr r2, =0x03007890 + ldr r3, [r2] + ldrb r0, [r3, 0x3] + movs r1, 0 + strh r0, [r7, 0x14] + movs r0, 0x11 + strb r0, [r7, 0x5] + strb r0, [r7, 0x4] + strb r1, [r7, 0x10] + ldrb r0, [r3, 0x3] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0800CAF4 + b _0800CC8A +_0800CAF4: + adds r1, r7, 0 + movs r3, 0x1 +_0800CAF8: + ldrb r0, [r1, 0x10] + adds r0, 0x1 + strb r0, [r1, 0x10] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _0800CB08 + b _0800CC8A +_0800CB08: + ldr r0, [r2] + ldrb r0, [r0, 0x3] + ldrb r4, [r7, 0x10] + asrs r0, r4 + ands r0, r3 + cmp r0, 0 + beq _0800CAF8 + b _0800CC8A + .pool +_0800CB1C: + cmp r6, 0 + bne _0800CB3A + mov r0, sp + bl rfu_CHILD_getConnectRecoveryStatus + lsls r0, 16 + cmp r0, 0 + bne _0800CB3A + mov r0, sp + ldrb r0, [r0] + cmp r0, 0x1 + bhi _0800CB3A + ldr r1, =0x03004140 + movs r0, 0x12 + strb r0, [r1, 0x4] +_0800CB3A: + ldr r2, =0x03004140 + ldrb r0, [r2, 0x10] + lsls r0, 1 + adds r1, r2, 0 + adds r1, 0x34 + adds r1, r0, r1 + ldrh r0, [r1] + cmp r0, 0 + bne _0800CB4E + b _0800CC8A +_0800CB4E: + subs r0, 0x1 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + beq _0800CB5A + b _0800CC8A +_0800CB5A: + movs r0, 0x12 + strb r0, [r2, 0x4] + b _0800CC8A + .pool +_0800CB64: + cmp r6, 0 + beq _0800CB6A + b _0800CC8A +_0800CB6A: + mov r0, sp + bl rfu_CHILD_getConnectRecoveryStatus + lsls r0, 16 + cmp r0, 0 + beq _0800CB78 + b _0800CC8A +_0800CB78: + mov r0, sp + ldrb r0, [r0] + cmp r0, 0 + bne _0800CB94 + ldr r1, =0x03004140 + movs r0, 0x13 + strb r0, [r1, 0x4] + movs r0, 0x16 + strb r0, [r1, 0x5] + movs r0, 0x32 + strh r0, [r1, 0x1E] + b _0800CBA8 + .pool +_0800CB94: + ldr r4, =0x03004140 + strb r6, [r4, 0x5] + strb r6, [r4, 0x4] + ldr r0, =0x03007890 + ldr r0, [r0] + ldrb r0, [r0, 0x3] + bl sub_800D334 + movs r0, 0x33 + strh r0, [r4, 0x1E] +_0800CBA8: + ldr r5, =0x03004140 + ldrb r0, [r5, 0x10] + lsls r0, 1 + adds r1, r5, 0 + adds r1, 0x34 + adds r0, r1 + movs r1, 0 + movs r4, 0 + strh r4, [r0] + adds r0, r5, 0 + adds r0, 0x30 + strb r1, [r0] + strb r1, [r5, 0xA] + ldrb r0, [r5, 0x1E] + movs r1, 0x1 + bl sub_800D30C + strh r4, [r5, 0x1E] + b _0800CC8A + .pool +_0800CBD8: + cmp r6, 0 + bne _0800CC8A + ldr r5, =0x03004140 + ldrb r1, [r5, 0x5] + adds r0, r1, 0 + cmp r0, 0x16 + bne _0800CC04 + ldrb r0, [r5, 0x11] + strb r0, [r5, 0x4] + ldrb r0, [r5, 0x12] + strb r0, [r5, 0x5] + ldrb r0, [r5, 0x2] + movs r0, 0x1 + strb r0, [r5, 0x2] + movs r0, 0x41 +_0800CBF6: + movs r1, 0 + bl sub_800D30C + b _0800CC8A + .pool +_0800CC04: + cmp r0, 0xF + bne _0800CC8A + strb r1, [r5, 0x4] + ldrb r0, [r5, 0x2] + movs r4, 0x1 + strb r4, [r5, 0x2] + movs r0, 0x41 + movs r1, 0 + bl sub_800D30C + adds r1, r5, 0 + adds r1, 0x24 + ldrb r0, [r5, 0x10] + lsls r4, r0 + ldrb r0, [r1] + orrs r4, r0 + strb r4, [r1] + ldrb r0, [r5, 0x10] + lsls r0, 1 + adds r1, 0x4 + adds r0, r1 + ldrh r1, [r5, 0x26] + movs r7, 0 + strh r1, [r0] + ldrb r1, [r5, 0x10] + movs r0, 0x4 + bl rfu_clearSlot + mov r4, sp + ldrb r0, [r5, 0x10] + movs r1, 0xE + bl rfu_NI_CHILD_setSendGameName + strb r0, [r4] + lsls r0, 24 + cmp r0, 0 + beq _0800CC8A + strb r7, [r5, 0x5] + strb r7, [r5, 0x4] + bl sub_800D610 + ldr r0, =0x03007890 + ldr r0, [r0] + ldrb r1, [r0, 0x2] + ldrb r0, [r0, 0x3] + orrs r0, r1 + bl sub_800D334 + mov r0, sp + ldrb r0, [r0] + strh r0, [r5, 0x14] + movs r0, 0x25 + movs r1, 0x1 + bl sub_800D30C + b _0800CC8A + .pool +_0800CC78: + cmp r6, 0 + bne _0800CC8A + ldr r0, =0x03004140 + strb r6, [r0, 0x5] + strb r6, [r0, 0x4] + movs r0, 0x42 + movs r1, 0 + bl sub_800D30C +_0800CC8A: + ldr r1, =0x03004140 + movs r0, 0x1 + strb r0, [r1, 0xE] + b _0800CCE6 + .pool +_0800CC98: + cmp r6, 0x3 + bne _0800CCE6 + ldrb r0, [r7, 0xF] + cmp r0, 0 + beq _0800CCE6 + mov r3, r8 + cmp r3, 0x24 + beq _0800CCB0 + cmp r3, 0x26 + beq _0800CCB0 + cmp r3, 0x27 + bne _0800CCE6 +_0800CCB0: + bl rfu_REQ_RFUStatus + bl rfu_waitREQComplete + mov r0, sp + bl rfu_getRFUStatus + mov r0, sp + ldrb r0, [r0] + cmp r0, 0 + bne _0800CCE6 + ldr r4, =0x03007890 + ldr r0, [r4] + ldrb r0, [r0] + cmp r0, 0 + bne _0800CCE6 + bl rfu_getSTWIRecvBuffer + ldr r1, [r4] + ldrb r1, [r1, 0x2] + strb r1, [r0, 0x4] + movs r1, 0x1 + strb r1, [r0, 0x5] + movs r0, 0x29 + bl sub_800C36C + movs r6, 0 +_0800CCE6: + mov r4, r8 + cmp r4, 0x26 + bne _0800CCEE + b _0800CE02 +_0800CCEE: + cmp r4, 0x26 + bgt _0800CD00 + cmp r4, 0x10 + bne _0800CCF8 + b _0800CE20 +_0800CCF8: + b _0800CE3E + .pool +_0800CD00: + mov r0, r8 + cmp r0, 0x30 + beq _0800CD0E + cmp r0, 0x3D + bne _0800CD0C + b _0800CE20 +_0800CD0C: + b _0800CE3E +_0800CD0E: + cmp r6, 0 + beq _0800CD14 + b _0800CE42 +_0800CD14: + bl rfu_getSTWIRecvBuffer + ldr r4, =0x03004140 + ldrb r0, [r0, 0x8] + strh r0, [r4, 0x14] + bl sub_800D358 + adds r2, r4, 0 + adds r2, 0x30 + ldrb r1, [r2] + cmp r1, 0 + beq _0800CD6A + ldrb r0, [r4, 0x14] + adds r3, r1, 0 + bics r3, r0 + adds r0, r3, 0 + strb r0, [r2] + movs r3, 0 + adds r7, r4, 0 + adds r1, r7, 0 + movs r5, 0x1 + adds r4, r1, 0 + adds r4, 0x34 + movs r2, 0 +_0800CD44: + ldrh r0, [r1, 0x14] + asrs r0, r3 + ands r0, r5 + cmp r0, 0 + beq _0800CD54 + lsls r0, r3, 1 + adds r0, r4 + strh r2, [r0] +_0800CD54: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3 + bls _0800CD44 + ldr r1, =0x03004140 + ldrb r0, [r1, 0x6] + cmp r0, 0 + bne _0800CD6A + strb r0, [r1, 0x5] + strb r0, [r1, 0x4] +_0800CD6A: + mov r3, sp + ldr r1, =0x03004140 + ldrb r2, [r1] + ldrb r0, [r1, 0x14] + ands r0, r2 + strb r0, [r3] + movs r3, 0 + adds r7, r1, 0 + ldr r2, =0x03007890 + mov r1, sp + movs r5, 0x1 + adds r4, r7, 0 +_0800CD82: + ldrb r0, [r1] + asrs r0, r3 + ands r0, r5 + cmp r0, 0 + beq _0800CD96 + ldrb r0, [r4, 0x1] + cmp r0, 0 + beq _0800CD96 + subs r0, 0x1 + strb r0, [r7, 0x1] +_0800CD96: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3 + bls _0800CD82 + ldrb r1, [r7, 0x14] + ldrb r0, [r7] + bics r0, r1 + strb r0, [r7] + ldrb r1, [r7, 0x7] + cmp r1, 0 + beq _0800CDE0 + ldr r0, [r2] + ldrb r0, [r0] + cmp r0, 0xFF + bne _0800CDF2 + cmp r1, 0x8 + bne _0800CDCC + ldrh r0, [r7, 0x1C] + strh r0, [r7, 0x1A] + movs r0, 0x6 + strb r0, [r7, 0x7] + b _0800CDDE + .pool +_0800CDCC: + ldrb r0, [r7, 0x4] + subs r0, 0x6 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _0800CDE0 + movs r0, 0x1 + strb r0, [r7, 0x7] + movs r0, 0x5 +_0800CDDE: + strb r0, [r7, 0x4] +_0800CDE0: + ldr r0, [r2] + ldrb r0, [r0] + cmp r0, 0xFF + bne _0800CDF2 + ldrb r0, [r7, 0x4] + cmp r0, 0 + bne _0800CDF2 + movs r0, 0xFF + strb r0, [r7, 0x6] +_0800CDF2: + ldrb r0, [r7, 0xE] + cmp r0, 0 + bne _0800CE3E + movs r0, 0x40 + movs r1, 0x1 + bl sub_800D30C + b _0800CE3E +_0800CE02: + bl sub_800D20C + ldr r0, =0x03007890 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0xFF + beq _0800CE3E + movs r0, 0x50 + movs r1, 0 + bl sub_800D30C + b _0800CE3E + .pool +_0800CE20: + cmp r6, 0 + bne _0800CE42 + ldr r0, =0x03004140 + strb r6, [r0, 0xD] + strb r6, [r0, 0x1] + strb r6, [r0] + movs r1, 0xFF + strb r1, [r0, 0x6] + bl sub_800D610 + mov r4, r8 + cmp r4, 0x3D + bne _0800CE3E + bl sub_800BFA0 +_0800CE3E: + cmp r6, 0 + beq _0800CE92 +_0800CE42: + ldr r7, =0x03004140 + mov r0, r8 + cmp r0, 0x1C + bne _0800CE74 + cmp r6, 0 + beq _0800CE74 + ldrb r0, [r7, 0x7] + cmp r0, 0x4 + bne _0800CE74 + ldr r2, =0x03007890 + ldr r1, [r2] + movs r0, 0x1 + strb r0, [r1] + ldr r1, [r2] + movs r0, 0xF + strb r0, [r1, 0x2] + bl sub_800D334 + bl rfu_waitREQComplete + b _0800CEA4 + .pool +_0800CE74: + movs r1, 0 + mov r3, r8 + strh r3, [r7, 0x14] + strh r6, [r7, 0x16] + ldrb r0, [r7, 0xE] + cmp r0, 0 + beq _0800CE86 + strb r1, [r7, 0x5] + strb r1, [r7, 0x4] +_0800CE86: + movs r0, 0xF0 + movs r1, 0x2 + bl sub_800D30C + bl sub_800D610 +_0800CE92: + mov r4, r8 + cmp r4, 0xFF + bne _0800CEA4 + movs r0, 0xF2 + movs r1, 0 + bl sub_800D30C + bl sub_800D610 +_0800CEA4: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_800C7B4 + + thumb_func_start sub_800CEB0 +sub_800CEB0: @ 800CEB0 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r4, =0x03004140 + ldrb r7, [r4, 0xE] + movs r0, 0 + strb r0, [r4, 0xE] + movs r0, 0x1 + strb r0, [r4, 0xF] + ldr r0, =0x03007890 + ldr r0, [r0] + ldrb r5, [r0] + cmp r5, 0 + bne _0800CEEC + adds r0, r6, 0 + bl sub_800C36C + ldrb r0, [r4, 0x2] + cmp r0, 0x1 + beq _0800CF04 + bl sub_800D610 + strb r5, [r4, 0xF] + strb r7, [r4, 0xE] + b _0800CF28 + .pool +_0800CEEC: + mov r0, sp + bl rfu_UNI_PARENT_getDRAC_ACK + lsls r0, 16 + cmp r0, 0 + bne _0800CF04 + mov r1, sp + ldrb r0, [r4, 0x3] + ldrb r1, [r1] + orrs r0, r1 + ldrb r1, [r4, 0x3] + strb r0, [r4, 0x3] +_0800CF04: + ldr r4, =0x03004140 + ldr r1, [r4, 0x44] + cmp r1, 0 + beq _0800CF20 + adds r0, r6, 0 + bl _call_via_r1 + bl rfu_waitREQComplete + ldrb r0, [r4, 0x2] + cmp r0, 0x2 + bne _0800CF20 + bl sub_800D610 +_0800CF20: + ldr r1, =0x03004140 + movs r0, 0 + strb r0, [r1, 0xF] + strb r7, [r1, 0xE] +_0800CF28: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800CEB0 + + thumb_func_start sub_800CF34 +sub_800CF34: @ 800CF34 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + ldr r1, =0x03004140 + ldrb r0, [r1, 0x4] + subs r0, 0x5 + lsls r0, 24 + lsrs r0, 24 + adds r3, r1, 0 + cmp r0, 0x3 + bls _0800CF52 + b _0800D146 +_0800CF52: + ldr r0, =0x03007890 + ldr r2, [r0] + ldrb r1, [r2, 0x2] + ldrb r0, [r3, 0xC] + adds r4, r1, 0 + eors r4, r0 + ands r4, r1 + ldrb r0, [r2, 0x7] + bics r4, r0 + mov r8, r4 + strb r1, [r3, 0xC] + cmp r4, 0 + beq _0800CF7A + strh r4, [r3, 0x14] + movs r0, 0x10 + movs r1, 0x1 + str r3, [sp, 0x4] + bl sub_800D30C + ldr r3, [sp, 0x4] +_0800CF7A: + movs r0, 0 + str r0, [sp] + movs r6, 0 + adds r7, r3, 0 + movs r1, 0x24 + adds r1, r3 + mov r9, r1 +_0800CF88: + movs r0, 0x80 + lsls r0, 17 + lsls r0, r6 + lsrs r4, r0, 24 + movs r5, 0 + mov r0, r8 + ands r0, r4 + cmp r0, 0 + beq _0800CFDA + lsls r1, r6, 1 + adds r0, r7, 0 + adds r0, 0x28 + adds r1, r0 + ldrh r0, [r7, 0x26] + strh r0, [r1] + mov r2, r9 + ldrb r1, [r2] + adds r0, r4, 0 + orrs r0, r1 + strb r0, [r2] + adds r6, 0x1 + mov r10, r6 + b _0800D090 + .pool +_0800CFC0: + ldrb r1, [r7] + adds r0, r4, 0 + orrs r0, r1 + strb r0, [r7] + ldrb r0, [r7, 0x1] + adds r0, 0x1 + strb r0, [r7, 0x1] + ldr r0, [sp] + orrs r0, r4 + str r0, [sp] + movs r0, 0x1 + orrs r5, r0 + b _0800D024 +_0800CFDA: + mov r1, r9 + ldrb r0, [r1] + ands r0, r4 + adds r2, r6, 0x1 + mov r10, r2 + cmp r0, 0 + beq _0800D090 + ldr r0, =0x03007880 + lsls r1, r6, 2 + adds r1, r0 + ldr r1, [r1] + ldrh r0, [r1, 0x34] + cmp r0, 0x46 + bne _0800D040 + adds r0, r1, 0 + adds r0, 0x61 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0800D058 + movs r5, 0x2 + ldr r3, [r3, 0x20] + ldrh r2, [r3] + ldr r0, =0x0000ffff + cmp r2, r0 + beq _0800D024 + ldr r0, =0x03007890 + ldr r0, [r0] + lsls r1, r6, 5 + adds r0, r1 + ldrh r0, [r0, 0x18] + ldr r1, =0x0000ffff +_0800D018: + cmp r0, r2 + beq _0800CFC0 + adds r3, 0x2 + ldrh r2, [r3] + cmp r2, r1 + bne _0800D018 +_0800D024: + movs r0, 0x1 + ands r0, r5 + cmp r0, 0 + bne _0800D058 + movs r0, 0x4 + orrs r5, r0 + b _0800D058 + .pool +_0800D040: + lsls r1, r6, 1 + adds r0, r3, 0 + adds r0, 0x28 + adds r1, r0 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + ldr r1, =0x0000ffff + ands r0, r1 + cmp r0, 0 + bne _0800D058 + movs r5, 0x6 +_0800D058: + movs r0, 0x2 + ands r0, r5 + cmp r0, 0 + beq _0800D07E + mov r2, r9 + ldrb r0, [r2] + bics r0, r4 + movs r2, 0 + mov r1, r9 + strb r0, [r1] + lsls r0, r6, 1 + adds r1, r7, 0 + adds r1, 0x28 + adds r0, r1 + strh r2, [r0] + movs r0, 0x8 + adds r1, r6, 0 + bl rfu_clearSlot +_0800D07E: + movs r0, 0x4 + ands r5, r0 + ldr r3, =0x03004140 + cmp r5, 0 + beq _0800D090 + ldrb r1, [r7, 0xD] + adds r0, r4, 0 + orrs r0, r1 + strb r0, [r7, 0xD] +_0800D090: + mov r2, r10 + lsls r0, r2, 24 + lsrs r6, r0, 24 + cmp r6, 0x3 + bhi _0800D09C + b _0800CF88 +_0800D09C: + ldr r4, [sp] + cmp r4, 0 + beq _0800D0AE + ldr r0, =0x03004140 + strh r4, [r0, 0x14] + movs r0, 0x11 + movs r1, 0x1 + bl sub_800D30C +_0800D0AE: + ldr r1, =0x03004140 + ldrb r0, [r1, 0xD] + cmp r0, 0 + beq _0800D0EA + movs r5, 0x1 + ldr r0, =0x03007890 + ldr r0, [r0] + ldrb r0, [r0, 0x6] + cmp r0, 0 + beq _0800D0CE + ldrb r0, [r1, 0x3] + ldrb r1, [r1] + ands r0, r1 + cmp r0, r1 + beq _0800D0CE + movs r5, 0 +_0800D0CE: + cmp r5, 0 + beq _0800D0EA + ldr r4, =0x03004140 + ldrb r0, [r4, 0xD] + bl sub_800D334 + ldrb r0, [r4, 0xD] + movs r1, 0 + strh r0, [r4, 0x14] + strb r1, [r4, 0xD] + movs r0, 0x12 + movs r1, 0x1 + bl sub_800D30C +_0800D0EA: + ldr r0, =0x03004140 + adds r1, r0, 0 + adds r1, 0x24 + ldrb r1, [r1] + adds r3, r0, 0 + cmp r1, 0 + bne _0800D146 + ldrb r0, [r3, 0x4] + cmp r0, 0x8 + bne _0800D146 + ldrb r0, [r3, 0x7] + cmp r0, 0 + bne _0800D120 + strb r0, [r3, 0x5] + strb r0, [r3, 0x4] + movs r0, 0x14 + movs r1, 0 + bl sub_800D30C + b _0800D146 + .pool +_0800D120: + cmp r0, 0x2 + bne _0800D12C + movs r0, 0x3 + strb r0, [r3, 0x7] + movs r0, 0x9 + b _0800D132 +_0800D12C: + movs r0, 0x1 + strb r0, [r3, 0x7] + movs r0, 0x5 +_0800D132: + strb r0, [r3, 0x4] + ldrb r0, [r3] + cmp r0, 0 + beq _0800D146 + movs r0, 0 + strh r0, [r3, 0x1A] + movs r0, 0x8 + strb r0, [r3, 0x7] + movs r0, 0x5 + strb r0, [r3, 0x4] +_0800D146: + 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_800CF34 + + thumb_func_start sub_800D158 +sub_800D158: @ 800D158 + push {r4-r6,lr} + ldr r1, =0x04000208 + ldrh r0, [r1] + adds r6, r0, 0 + movs r0, 0 + strh r0, [r1] + ldr r4, =0x03004140 + ldrb r0, [r4, 0x4] + cmp r0, 0xF + bne _0800D1BC + ldrb r1, [r4, 0x10] + lsls r1, 1 + adds r5, r4, 0 + adds r5, 0x28 + adds r1, r5 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + beq _0800D192 + ldr r1, =0x03007880 + ldrb r0, [r4, 0x10] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ldrh r0, [r0] + cmp r0, 0x27 + bne _0800D1BC +_0800D192: + bl sub_800D630 + movs r0, 0x18 + strb r0, [r4, 0x4] + ldrb r1, [r4, 0x10] + movs r0, 0x4 + bl rfu_clearSlot + adds r2, r4, 0 + adds r2, 0x24 + movs r1, 0x1 + ldrb r0, [r4, 0x10] + lsls r1, r0 + ldrb r0, [r2] + bics r0, r1 + strb r0, [r2] + ldrb r0, [r4, 0x10] + lsls r0, 1 + adds r0, r5 + movs r1, 0 + strh r1, [r0] +_0800D1BC: + ldr r0, =0x04000208 + strh r6, [r0] + ldr r5, =0x03004140 + ldrb r0, [r5, 0x4] + cmp r0, 0x18 + bne _0800D1F6 + ldrb r0, [r5, 0x2] + cmp r0, 0x1 + bne _0800D1D2 + bl sub_800D630 +_0800D1D2: + ldrb r0, [r5, 0x2] + adds r4, r0, 0 + cmp r4, 0 + bne _0800D1F6 + strb r4, [r5, 0x5] + strb r4, [r5, 0x4] + ldr r0, =0x03007890 + ldr r0, [r0] + ldrb r1, [r0, 0x2] + ldrb r0, [r0, 0x3] + orrs r0, r1 + bl sub_800D334 + strh r4, [r5, 0x14] + movs r0, 0x25 + movs r1, 0x1 + bl sub_800D30C +_0800D1F6: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800D158 + + thumb_func_start sub_800D20C +sub_800D20C: @ 800D20C + push {r4,r5,lr} + ldr r5, =0x03004140 + ldrb r0, [r5, 0x4] + cmp r0, 0xF + bne _0800D258 + ldr r1, =0x03007880 + ldrb r2, [r5, 0x10] + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + ldrh r0, [r0] + cmp r0, 0x26 + bne _0800D258 + movs r4, 0 + strb r4, [r5, 0x5] + strb r4, [r5, 0x4] + movs r0, 0x4 + adds r1, r2, 0 + bl rfu_clearSlot + adds r2, r5, 0 + adds r2, 0x24 + movs r1, 0x1 + ldrb r0, [r5, 0x10] + lsls r1, r0 + ldrb r0, [r2] + bics r0, r1 + strb r0, [r2] + ldrb r0, [r5, 0x10] + lsls r0, 1 + adds r1, r5, 0 + adds r1, 0x28 + adds r0, r1 + strh r4, [r0] + movs r0, 0x24 + movs r1, 0 + bl sub_800D30C +_0800D258: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800D20C + + thumb_func_start sub_800D268 +sub_800D268: @ 800D268 + push {lr} + ldr r1, =0x03004140 + ldrb r0, [r1, 0x6] + cmp r0, 0 + bne _0800D28C + ldrb r0, [r1, 0xA] + cmp r0, 0x1 + bne _0800D28C + ldrb r0, [r1, 0x4] + strb r0, [r1, 0x11] + ldrb r0, [r1, 0x5] + strb r0, [r1, 0x12] + movs r0, 0x10 + strb r0, [r1, 0x4] + movs r0, 0x11 + strb r0, [r1, 0x5] + movs r0, 0x2 + strb r0, [r1, 0xA] +_0800D28C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_800D268 + + thumb_func_start sub_800D294 +sub_800D294: @ 800D294 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r6, 0 + movs r5, 0 + ldr r1, =0x03007890 + ldr r0, [r1] + ldrb r0, [r0, 0x8] + cmp r6, r0 + bcs _0800D2F0 + mov r8, r0 + ldr r0, =0x03004140 + mov r10, r0 + mov r9, r1 +_0800D2B4: + mov r1, r10 + ldr r3, [r1, 0x20] + ldrh r2, [r3] + adds r0, r5, 0x1 + mov r12, r0 + ldr r1, =0x0000ffff + cmp r2, r1 + beq _0800D2E6 + mov r1, r9 + ldr r0, [r1] + lsls r1, r5, 5 + adds r0, r1 + ldrh r4, [r0, 0x18] + ldr r7, =0x0000ffff + movs r1, 0x1 + lsls r1, r5 +_0800D2D4: + cmp r4, r2 + bne _0800D2DE + orrs r6, r1 + lsls r0, r6, 24 + lsrs r6, r0, 24 +_0800D2DE: + adds r3, 0x2 + ldrh r2, [r3] + cmp r2, r7 + bne _0800D2D4 +_0800D2E6: + mov r1, r12 + lsls r0, r1, 24 + lsrs r5, r0, 24 + cmp r5, r8 + bcc _0800D2B4 +_0800D2F0: + adds r0, r6, 0 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_800D294 + + thumb_func_start sub_800D30C +sub_800D30C: @ 800D30C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r4, =0x03004140 + ldr r2, [r4, 0x40] + cmp r2, 0 + beq _0800D322 + bl _call_via_r2 +_0800D322: + movs r0, 0 + strh r0, [r4, 0x16] + strh r0, [r4, 0x14] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800D30C + + thumb_func_start sub_800D334 +sub_800D334: @ 800D334 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x03004140 + ldrb r5, [r4, 0xE] + movs r1, 0x1 + strb r1, [r4, 0xE] + bl rfu_REQ_disconnect + bl rfu_waitREQComplete + strb r5, [r4, 0xE] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800D334 + + thumb_func_start sub_800D358 +sub_800D358: @ 800D358 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x03007890 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _0800D3A0 + movs r4, 0 +_0800D36A: + ldr r1, =0x03007880 + lsls r0, r4, 2 + adds r0, r1 + ldr r2, [r0] + ldrh r0, [r2] + movs r3, 0x80 + lsls r3, 8 + adds r1, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _0800D396 + ldrb r1, [r2, 0x1A] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _0800D396 + adds r2, r1, 0 + bics r2, r5 + movs r0, 0x20 + adds r1, r4, 0 + bl rfu_changeSendTarget +_0800D396: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _0800D36A +_0800D3A0: + ldr r0, =0x03007890 + ldr r0, [r0] + ldrb r0, [r0, 0x5] + cmp r0, 0 + beq _0800D3DE + movs r4, 0 +_0800D3AC: + ldr r1, =0x03007880 + lsls r0, r4, 2 + adds r0, r1 + ldr r2, [r0] + ldrh r0, [r2, 0x34] + movs r3, 0x80 + lsls r3, 8 + adds r1, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _0800D3D4 + adds r0, r2, 0 + adds r0, 0x4E + ldrb r0, [r0] + ands r0, r5 + cmp r0, 0 + beq _0800D3D4 + adds r0, r4, 0 + bl rfu_NI_stopReceivingData +_0800D3D4: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _0800D3AC +_0800D3DE: + ldr r0, =0x03007890 + ldr r3, [r0] + ldrb r2, [r3, 0x6] + cmp r2, 0 + beq _0800D41C + mvns r1, r5 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3, 0x6] + movs r4, 0 + ldr r7, =0x03007870 + ldr r6, =0x00008024 +_0800D3F6: + lsls r0, r4, 2 + adds r0, r7 + ldr r2, [r0] + ldrh r0, [r2] + cmp r0, r6 + bne _0800D412 + ldrb r3, [r2, 0x3] + adds r0, r5, 0 + ands r0, r3 + cmp r0, 0 + beq _0800D412 + adds r0, r1, 0 + ands r0, r3 + strb r0, [r2, 0x3] +_0800D412: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _0800D3F6 +_0800D41C: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800D358 + + thumb_func_start sub_800D434 +sub_800D434: @ 800D434 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r0, =0x03004140 + ldrh r0, [r0, 0x18] + cmp r0, 0 + beq _0800D510 + ldr r0, =0x03007890 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _0800D4D4 + movs r6, 0 +_0800D454: + ldr r3, =0x03007880 + lsls r2, r6, 2 + adds r0, r2, r3 + ldr r0, [r0] + ldrh r1, [r0] + movs r4, 0x80 + lsls r4, 8 + adds r0, r4, 0 + ands r1, r0 + adds r7, r2, 0 + adds r0, r6, 0x1 + mov r9, r0 + cmp r1, 0 + beq _0800D4CA + movs r5, 0 + movs r4, 0 + movs r1, 0x1 + mov r8, r1 + mov r10, r3 +_0800D47A: + adds r0, r7, r3 + ldr r0, [r0] + ldrb r0, [r0, 0x1A] + asrs r0, r4 + mov r1, r8 + ands r0, r1 + cmp r0, 0 + beq _0800D4A4 + lsls r0, r4, 2 + adds r0, r3 + ldr r0, [r0] + ldr r1, =0x03004140 + ldrh r0, [r0, 0x2] + ldrh r1, [r1, 0x18] + cmp r0, r1 + bls _0800D4A4 + mov r0, r8 + lsls r0, r4 + orrs r5, r0 + lsls r0, r5, 24 + lsrs r5, r0, 24 +_0800D4A4: + cmp r5, 0 + beq _0800D4C0 + mov r1, r10 + adds r0, r7, r1 + ldr r0, [r0] + ldrb r0, [r0, 0x1A] + adds r2, r5, 0 + eors r2, r0 + movs r0, 0x20 + adds r1, r6, 0 + str r3, [sp] + bl rfu_changeSendTarget + ldr r3, [sp] +_0800D4C0: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _0800D47A +_0800D4CA: + mov r3, r9 + lsls r0, r3, 24 + lsrs r6, r0, 24 + cmp r6, 0x3 + bls _0800D454 +_0800D4D4: + ldr r0, =0x03007890 + ldr r0, [r0] + ldrb r0, [r0, 0x5] + cmp r0, 0 + beq _0800D510 + movs r6, 0 +_0800D4E0: + ldr r1, =0x03007880 + lsls r0, r6, 2 + adds r0, r1 + ldr r2, [r0] + ldrh r0, [r2, 0x34] + movs r4, 0x80 + lsls r4, 8 + adds r1, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _0800D506 + ldr r1, =0x03004140 + ldrh r0, [r2, 0x36] + ldrh r1, [r1, 0x18] + cmp r0, r1 + bls _0800D506 + adds r0, r6, 0 + bl rfu_NI_stopReceivingData +_0800D506: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x3 + bls _0800D4E0 +_0800D510: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800D434 + + thumb_func_start sub_800D52C +sub_800D52C: @ 800D52C + push {lr} + ldr r1, =0x03004140 + str r0, [r1, 0x44] + ldr r0, =sub_800CEB0 + bl rfu_setMSCCallback + pop {r0} + bx r0 + .pool + thumb_func_end sub_800D52C + + thumb_func_start sub_800D544 +sub_800D544: @ 800D544 + ldr r1, =0x03004140 + str r0, [r1, 0x40] + bx lr + .pool + thumb_func_end sub_800D544 + + thumb_func_start sub_800D550 +sub_800D550: @ 800D550 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 16 + lsrs r5, r1, 16 + ldr r0, =0x03004140 + ldrb r1, [r0, 0x9] + adds r3, r0, 0 + cmp r1, 0 + beq _0800D578 + cmp r4, 0 + bne _0800D578 + adds r0, 0x30 + ldrb r0, [r0] + cmp r0, 0 + beq _0800D578 + movs r0, 0x5 + b _0800D588 + .pool +_0800D578: + ldr r2, =0x04000208 + ldrh r1, [r2] + movs r0, 0 + strh r0, [r2] + strb r4, [r3, 0x9] + strh r5, [r3, 0x32] + strh r1, [r2] + movs r0, 0 +_0800D588: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_800D550 + + thumb_func_start sub_800D594 +sub_800D594: @ 800D594 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, =0x03007890 + ldr r0, [r0] + ldrb r1, [r0, 0x4] + ldrb r0, [r0, 0x5] + orrs r0, r1 + cmp r0, 0 + bne _0800D5B8 + ldr r0, =0x03004140 + strh r2, [r0, 0x18] + movs r0, 0 + b _0800D5C8 + .pool +_0800D5B8: + ldr r1, =0x03004140 + movs r0, 0x6 + strh r0, [r1, 0x14] + movs r0, 0xF3 + movs r1, 0x1 + bl sub_800D30C + movs r0, 0x6 +_0800D5C8: + pop {r1} + bx r1 + .pool + thumb_func_end sub_800D594 + + thumb_func_start sub_800D5D0 +sub_800D5D0: @ 800D5D0 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + adds r3, r2, 0 + ldr r1, =0x03004140 + ldrb r0, [r1, 0x4] + subs r0, 0x9 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bhi _0800D5FC + movs r0, 0x7 + strh r0, [r1, 0x14] + movs r0, 0xF3 + movs r1, 0x1 + bl sub_800D30C + movs r0, 0x7 + b _0800D60A + .pool +_0800D5FC: + cmp r2, 0 + beq _0800D606 + movs r0, 0x1 + strb r0, [r1, 0xB] + b _0800D608 +_0800D606: + strb r3, [r1, 0xB] +_0800D608: + movs r0, 0 +_0800D60A: + pop {r1} + bx r1 + thumb_func_end sub_800D5D0 + + thumb_func_start sub_800D610 +sub_800D610: @ 800D610 + push {lr} + ldr r1, =0x03004140 + ldrb r0, [r1, 0x2] + cmp r0, 0 + beq _0800D628 + ldrb r0, [r1, 0x2] + movs r0, 0 + strb r0, [r1, 0x2] + movs r0, 0x45 + movs r1, 0 + bl sub_800D30C +_0800D628: + pop {r0} + bx r0 + .pool + thumb_func_end sub_800D610 + + thumb_func_start sub_800D630 +sub_800D630: @ 800D630 + push {lr} + ldr r1, =0x03004140 + ldrb r0, [r1, 0x2] + cmp r0, 0 + bne _0800D648 + movs r0, 0x45 + movs r1, 0 + bl sub_800D30C + b _0800D654 + .pool +_0800D648: + ldrb r0, [r1, 0x2] + cmp r0, 0x1 + bne _0800D654 + ldrb r0, [r1, 0x2] + movs r0, 0x2 + strb r0, [r1, 0x2] +_0800D654: + pop {r0} + bx r0 + thumb_func_end sub_800D630 + + thumb_func_start sub_800D658 +sub_800D658: @ 800D658 + push {lr} + ldr r0, =0x03004140 + ldrb r1, [r0, 0x7] + adds r2, r0, 0 + cmp r1, 0 + beq _0800D6C2 + ldrb r0, [r2, 0x4] + subs r0, 0x5 + cmp r0, 0x6 + bhi _0800D6C2 + lsls r0, 2 + ldr r1, =_0800D680 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0800D680: + .4byte _0800D69C + .4byte _0800D6A4 + .4byte _0800D6AE + .4byte _0800D6AE + .4byte _0800D6B4 + .4byte _0800D6B4 + .4byte _0800D6BA +_0800D69C: + movs r0, 0x3 + strb r0, [r2, 0x7] + movs r0, 0x9 + b _0800D6C0 +_0800D6A4: + movs r0, 0x2 + strb r0, [r2, 0x7] + movs r0, 0x1 + strh r0, [r2, 0x1A] + b _0800D6C2 +_0800D6AE: + movs r0, 0x2 + strb r0, [r2, 0x7] + b _0800D6C2 +_0800D6B4: + movs r0, 0x28 + strh r0, [r2, 0x1A] + b _0800D6C2 +_0800D6BA: + movs r0, 0x28 + strh r0, [r2, 0x1A] + movs r0, 0xA +_0800D6C0: + strb r0, [r2, 0x4] +_0800D6C2: + pop {r0} + bx r0 + thumb_func_end sub_800D658 + + thumb_func_start sub_800D6C8 +sub_800D6C8: @ 800D6C8 + push {r4,r5,lr} + adds r3, r0, 0 + movs r0, 0 + movs r4, 0 + movs r5, 0x46 +_0800D6D2: + adds r2, r0, 0x1 + movs r1, 0x45 + muls r0, r5 + adds r0, r3 + adds r0, 0x45 +_0800D6DC: + strb r4, [r0] + subs r0, 0x1 + subs r1, 0x1 + cmp r1, 0 + bge _0800D6DC + adds r0, r2, 0 + cmp r0, 0x1F + ble _0800D6D2 + movs r1, 0 + ldr r2, =0x000008c1 + adds r0, r3, r2 + ldrb r2, [r0] + strb r1, [r0] + movs r2, 0x8C + lsls r2, 4 + adds r0, r3, r2 + ldrb r2, [r0] + strb r1, [r0] + ldr r2, =0x000008c2 + adds r0, r3, r2 + ldrb r2, [r0] + strb r1, [r0] + ldr r2, =0x000008c3 + adds r0, r3, r2 + ldrb r2, [r0] + strb r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800D6C8 + + thumb_func_start sub_800D724 +sub_800D724: @ 800D724 + push {r4,lr} + adds r3, r0, 0 + movs r1, 0 + movs r4, 0 +_0800D72C: + lsls r0, r1, 3 + adds r2, r1, 0x1 + subs r0, r1 + movs r1, 0xD + lsls r0, 1 + adds r0, r3 + adds r0, 0xD +_0800D73A: + strb r4, [r0] + subs r0, 0x1 + subs r1, 0x1 + cmp r1, 0 + bge _0800D73A + adds r1, r2, 0 + cmp r1, 0x27 + ble _0800D72C + movs r1, 0 + ldr r2, =0x00000231 + adds r0, r3, r2 + ldrb r2, [r0] + strb r1, [r0] + movs r2, 0x8C + lsls r2, 2 + adds r0, r3, r2 + ldrb r2, [r0] + strb r1, [r0] + ldr r2, =0x00000232 + adds r0, r3, r2 + ldrb r2, [r0] + strb r1, [r0] + ldr r2, =0x00000233 + adds r0, r3, r2 + ldrb r2, [r0] + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800D724 + + thumb_func_start sub_800D780 +sub_800D780: @ 800D780 + push {r4,lr} + adds r3, r0, 0 + movs r1, 0 + movs r4, 0 +_0800D788: + lsls r0, r1, 8 + adds r2, r1, 0x1 + movs r1, 0xFF + adds r0, r3 + adds r0, 0xFF +_0800D792: + strb r4, [r0] + subs r0, 0x1 + subs r1, 0x1 + cmp r1, 0 + bge _0800D792 + adds r1, r2, 0 + cmp r1, 0x1 + ble _0800D788 + movs r1, 0 + ldr r2, =0x00000201 + adds r0, r3, r2 + ldrb r2, [r0] + strb r1, [r0] + movs r2, 0x80 + lsls r2, 2 + adds r0, r3, r2 + ldrb r2, [r0] + strb r1, [r0] + ldr r2, =0x00000202 + adds r0, r3, r2 + ldrb r2, [r0] + strb r1, [r0] + ldr r2, =0x00000203 + adds r0, r3, r2 + ldrb r2, [r0] + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800D780 + + thumb_func_start sub_800D7D8 +sub_800D7D8: @ 800D7D8 + push {r4-r7,lr} + adds r3, r0, 0 + adds r4, r1, 0 + ldr r1, =0x000008c2 + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0x1F + bhi _0800D874 + ldr r0, =0x04000208 + ldrh r1, [r0] + adds r7, r1, 0 + movs r1, 0 + strh r1, [r0] + movs r5, 0 + movs r2, 0 +_0800D7F6: + adds r1, r4, r2 + ldrb r0, [r1] + cmp r0, 0 + bne _0800D80A + ldrb r0, [r1, 0x1] + cmp r0, 0 + bne _0800D80A + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_0800D80A: + adds r2, 0xE + cmp r2, 0x45 + ble _0800D7F6 + cmp r5, 0x5 + beq _0800D866 + movs r2, 0 + movs r0, 0x8C + lsls r0, 4 + adds r5, r3, r0 + movs r6, 0x46 +_0800D81E: + ldrb r0, [r5] + adds r1, r0, 0 + muls r1, r6 + adds r1, r2, r1 + adds r1, r3, r1 + adds r0, r4, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r2, 0x1 + cmp r2, 0x45 + ble _0800D81E + movs r0, 0x8C + lsls r0, 4 + adds r1, r3, r0 + ldrb r0, [r1] + adds r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + ldrb r2, [r1] + movs r0, 0x1F + ands r0, r2 + ldrb r2, [r1] + strb r0, [r1] + ldr r0, =0x000008c2 + adds r1, r3, r0 + ldrb r0, [r1] + adds r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + movs r1, 0 + adds r0, r4, 0 + adds r0, 0x45 +_0800D85E: + strb r1, [r0] + subs r0, 0x1 + cmp r0, r4 + bge _0800D85E +_0800D866: + ldr r0, =0x04000208 + strh r7, [r0] + b _0800D87E + .pool +_0800D874: + ldr r1, =0x000008c3 + adds r0, r3, r1 + ldrb r1, [r0] + movs r1, 0x1 + strb r1, [r0] +_0800D87E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800D7D8 + + thumb_func_start sub_800D888 +sub_800D888: @ 800D888 + push {r4-r7,lr} + adds r6, r0, 0 + adds r5, r1, 0 + ldr r1, =0x00000232 + adds r0, r6, r1 + ldrb r0, [r0] + cmp r0, 0x27 + bhi _0800D920 + ldr r1, =0x04000208 + ldrh r0, [r1] + adds r7, r0, 0 + movs r0, 0 + strh r0, [r1] + movs r2, 0 + ldrb r0, [r5] + cmp r0, 0 + bne _0800D8B8 +_0800D8AA: + adds r2, 0x1 + cmp r2, 0xD + bgt _0800D8B8 + adds r0, r5, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _0800D8AA +_0800D8B8: + cmp r2, 0xE + beq _0800D910 + movs r2, 0 + movs r0, 0x8C + lsls r0, 2 + adds r3, r6, r0 +_0800D8C4: + ldrb r1, [r3] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 1 + adds r0, r2, r0 + adds r0, r6, r0 + adds r1, r5, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0xD + ble _0800D8C4 + movs r1, 0x8C + lsls r1, 2 + adds r4, r6, r1 + ldrb r0, [r4] + adds r0, 0x1 + ldrb r1, [r4] + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0x28 + bl __umodsi3 + ldrb r1, [r4] + strb r0, [r4] + ldr r0, =0x00000232 + adds r1, r6, r0 + ldrb r0, [r1] + adds r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + movs r1, 0 + adds r0, r5, 0 + adds r0, 0xD +_0800D908: + strb r1, [r0] + subs r0, 0x1 + cmp r0, r5 + bge _0800D908 +_0800D910: + ldr r0, =0x04000208 + strh r7, [r0] + b _0800D92A + .pool +_0800D920: + ldr r1, =0x00000233 + adds r0, r6, r1 + ldrb r1, [r0] + movs r1, 0x1 + strb r1, [r0] +_0800D92A: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800D888 + + thumb_func_start sub_800D934 +sub_800D934: @ 800D934 + push {r4-r7,lr} + adds r3, r0, 0 + adds r4, r1, 0 + ldr r1, =0x04000208 + ldrh r0, [r1] + mov r12, r0 + movs r0, 0 + strh r0, [r1] + movs r1, 0x8C + lsls r1, 4 + adds r0, r3, r1 + ldr r7, =0x000008c1 + adds r5, r3, r7 + ldrb r1, [r0] + ldrb r0, [r5] + cmp r1, r0 + beq _0800D960 + ldr r1, =0x000008c3 + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0800D984 +_0800D960: + movs r1, 0 + adds r0, r4, 0 + adds r0, 0x45 +_0800D966: + strb r1, [r0] + subs r0, 0x1 + cmp r0, r4 + bge _0800D966 + ldr r0, =0x04000208 + mov r7, r12 + strh r7, [r0] + movs r0, 0 + b _0800D9CA + .pool +_0800D984: + movs r2, 0 + movs r6, 0x46 +_0800D988: + adds r1, r4, r2 + ldrb r0, [r5] + adds r7, r0, 0 + muls r7, r6 + adds r0, r7, 0 + adds r0, r2, r0 + adds r0, r3, r0 + ldrb r0, [r0] + strb r0, [r1] + adds r2, 0x1 + cmp r2, 0x45 + ble _0800D988 + ldr r0, =0x000008c1 + adds r1, r3, r0 + ldrb r0, [r1] + adds r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + ldrb r2, [r1] + movs r0, 0x1F + ands r0, r2 + ldrb r2, [r1] + strb r0, [r1] + ldr r7, =0x000008c2 + adds r1, r3, r7 + ldrb r0, [r1] + subs r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + ldr r0, =0x04000208 + mov r1, r12 + strh r1, [r0] + movs r0, 0x1 +_0800D9CA: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_800D934 + + thumb_func_start sub_800D9DC +sub_800D9DC: @ 800D9DC + push {r4-r7,lr} + adds r5, r0, 0 + adds r6, r1, 0 + movs r1, 0x8C + lsls r1, 2 + adds r0, r5, r1 + adds r1, 0x1 + adds r4, r5, r1 + ldrb r1, [r0] + ldrb r0, [r4] + cmp r1, r0 + beq _0800DA00 + ldr r1, =0x00000233 + adds r0, r5, r1 + ldrb r0, [r0] + adds r2, r0, 0 + cmp r2, 0 + beq _0800DA08 +_0800DA00: + movs r0, 0 + b _0800DA54 + .pool +_0800DA08: + ldr r1, =0x04000208 + ldrh r0, [r1] + adds r7, r0, 0 + strh r2, [r1] + movs r3, 0 +_0800DA12: + adds r2, r6, r3 + ldrb r1, [r4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 1 + adds r0, r3, r0 + adds r0, r5, r0 + ldrb r0, [r0] + strb r0, [r2] + adds r3, 0x1 + cmp r3, 0xD + ble _0800DA12 + ldr r0, =0x00000231 + adds r4, r5, r0 + ldrb r0, [r4] + adds r0, 0x1 + ldrb r1, [r4] + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0x28 + bl __umodsi3 + ldrb r1, [r4] + strb r0, [r4] + ldr r0, =0x00000232 + adds r1, r5, r0 + ldrb r0, [r1] + subs r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + ldr r0, =0x04000208 + strh r7, [r0] + movs r0, 0x1 +_0800DA54: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_800D9DC + + thumb_func_start sub_800DA68 +sub_800DA68: @ 800DA68 + push {r4,lr} + adds r2, r0, 0 + adds r4, r1, 0 + ldrb r0, [r4, 0x1] + cmp r0, 0 + bne _0800DA7E + adds r0, r2, 0 + movs r1, 0 + bl sub_800DAC8 + b _0800DAC0 +_0800DA7E: + movs r3, 0 +_0800DA80: + ldrb r1, [r2, 0x1C] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 1 + adds r0, r3, r0 + adds r0, r2, r0 + adds r1, r4, r3 + ldrb r1, [r1] + strb r1, [r0] + adds r3, 0x1 + cmp r3, 0xD + ble _0800DA80 + ldrb r0, [r2, 0x1C] + adds r0, 0x1 + ldrb r1, [r2, 0x1C] + strb r0, [r2, 0x1C] + ldrb r1, [r2, 0x1C] + movs r0, 0x1 + ands r0, r1 + ldrb r1, [r2, 0x1C] + strb r0, [r2, 0x1C] + ldrb r0, [r2, 0x1E] + cmp r0, 0x1 + bhi _0800DABA + ldrb r0, [r2, 0x1E] + adds r0, 0x1 + ldrb r1, [r2, 0x1E] + strb r0, [r2, 0x1E] + b _0800DAC0 +_0800DABA: + ldrb r0, [r2, 0x1C] + ldrb r1, [r2, 0x1D] + strb r0, [r2, 0x1D] +_0800DAC0: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_800DA68 + + thumb_func_start sub_800DAC8 +sub_800DAC8: @ 800DAC8 + push {r4,r5,lr} + adds r3, r0, 0 + adds r5, r1, 0 + ldrb r0, [r3, 0x1E] + cmp r0, 0 + bne _0800DAD8 + movs r0, 0 + b _0800DB12 +_0800DAD8: + cmp r5, 0 + beq _0800DAF6 + movs r4, 0 +_0800DADE: + adds r2, r5, r4 + ldrb r1, [r3, 0x1D] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 1 + adds r0, r4, r0 + adds r0, r3, r0 + ldrb r0, [r0] + strb r0, [r2] + adds r4, 0x1 + cmp r4, 0xD + ble _0800DADE +_0800DAF6: + ldrb r0, [r3, 0x1D] + adds r0, 0x1 + ldrb r1, [r3, 0x1D] + strb r0, [r3, 0x1D] + ldrb r1, [r3, 0x1D] + movs r0, 0x1 + ands r0, r1 + ldrb r1, [r3, 0x1D] + strb r0, [r3, 0x1D] + ldrb r0, [r3, 0x1E] + subs r0, 0x1 + ldrb r1, [r3, 0x1E] + strb r0, [r3, 0x1E] + movs r0, 0x1 +_0800DB12: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_800DAC8 + + thumb_func_start sub_800DB18 +sub_800DB18: @ 800DB18 + push {r4,r5,lr} + adds r3, r0, 0 + adds r5, r1, 0 + ldr r1, =0x00000202 + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bhi _0800DB70 + movs r2, 0 + movs r0, 0x80 + lsls r0, 2 + adds r4, r3, r0 +_0800DB30: + ldrb r0, [r4] + lsls r0, 8 + adds r0, r2, r0 + adds r0, r3, r0 + adds r1, r5, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0xFF + ble _0800DB30 + movs r0, 0x80 + lsls r0, 2 + adds r1, r3, r0 + ldrb r0, [r1] + adds r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + ldrb r2, [r1] + movs r0, 0x1 + ands r0, r2 + ldrb r2, [r1] + strb r0, [r1] + ldr r0, =0x00000202 + adds r1, r3, r0 + ldrb r0, [r1] + adds r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + b _0800DB7A + .pool +_0800DB70: + ldr r1, =0x00000203 + adds r0, r3, r1 + ldrb r1, [r0] + movs r1, 0x1 + strb r1, [r0] +_0800DB7A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800DB18 + + thumb_func_start sub_800DB84 +sub_800DB84: @ 800DB84 + push {r4,r5,lr} + adds r3, r0, 0 + adds r5, r1, 0 + movs r1, 0x80 + lsls r1, 2 + adds r0, r3, r1 + adds r1, 0x1 + adds r4, r3, r1 + ldrb r1, [r0] + ldrb r0, [r4] + cmp r1, r0 + beq _0800DBA6 + ldr r1, =0x00000203 + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0800DBB0 +_0800DBA6: + movs r0, 0 + b _0800DBEA + .pool +_0800DBB0: + movs r2, 0 +_0800DBB2: + adds r0, r5, r2 + ldrb r1, [r4] + lsls r1, 8 + adds r1, r2, r1 + adds r1, r3, r1 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0xFF + ble _0800DBB2 + ldr r0, =0x00000201 + adds r1, r3, r0 + ldrb r0, [r1] + adds r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + ldrb r2, [r1] + movs r0, 0x1 + ands r0, r2 + ldrb r2, [r1] + strb r0, [r1] + ldr r0, =0x00000202 + adds r1, r3, r0 + ldrb r0, [r1] + subs r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + movs r0, 0x1 +_0800DBEA: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_800DB84 + + thumb_func_start sub_800DBF8 +sub_800DBF8: @ 800DBF8 + push {r4-r7,lr} + adds r6, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r1, 0 + movs r5, 0 + cmp r1, 0x1 + beq _0800DC36 + cmp r1, 0x1 + bgt _0800DC12 + cmp r1, 0 + beq _0800DC1C + b _0800DCAA +_0800DC12: + cmp r0, 0x2 + beq _0800DC56 + cmp r0, 0x3 + beq _0800DC76 + b _0800DCAA +_0800DC1C: + movs r4, 0 +_0800DC1E: + adds r0, r6, r4 + adds r1, r4, 0x1 + strb r1, [r0] + lsls r0, r5, 16 + asrs r0, 16 + adds r0, r1 + lsls r0, 16 + lsrs r5, r0, 16 + adds r4, r1, 0 + cmp r4, 0xC7 + ble _0800DC1E + b _0800DC70 +_0800DC36: + movs r4, 0 + adds r2, r6, 0 + adds r2, 0xC8 +_0800DC3C: + adds r0, r6, r4 + adds r1, r4, 0x1 + strb r1, [r0] + lsls r0, r5, 16 + asrs r0, 16 + adds r0, r1 + lsls r0, 16 + lsrs r5, r0, 16 + adds r4, r1, 0 + cmp r4, 0x63 + ble _0800DC3C + strh r5, [r2] + b _0800DCAA +_0800DC56: + movs r4, 0 +_0800DC58: + bl GenerateRandomNumber + lsls r0, 24 + lsrs r0, 24 + adds r1, r6, r4 + strb r0, [r1] + adds r0, r5, r0 + lsls r0, 16 + lsrs r5, r0, 16 + adds r4, 0x1 + cmp r4, 0xC7 + ble _0800DC58 +_0800DC70: + adds r0, r6, r4 + strh r5, [r0] + b _0800DCAA +_0800DC76: + movs r4, 0 + ldr r3, =0x03000d74 + ldrb r1, [r3] + ldrb r0, [r3] + adds r7, r0, 0x1 + adds r2, r1, 0x1 + movs r0, 0xFF + mov r12, r0 +_0800DC86: + adds r0, r6, r4 + adds r1, r4, 0x1 + strb r2, [r0] + adds r0, r4, r7 + mov r4, r12 + ands r0, r4 + adds r0, r5, r0 + lsls r0, 16 + lsrs r5, r0, 16 + adds r2, 0x1 + adds r4, r1, 0 + cmp r1, 0xC7 + ble _0800DC86 + adds r0, r6, r1 + strh r5, [r0] + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] +_0800DCAA: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800DBF8 + + thumb_func_start sub_800DCB4 +sub_800DCB4: @ 800DCB4 + push {r4,r5,lr} + adds r4, r0, 0 + movs r3, 0 + ldrb r0, [r1] + cmp r0, 0xFF + beq _0800DCD8 + ldr r5, =gUnknown_082ED470 + adds r2, r1, 0 +_0800DCC4: + adds r1, r4, r3 + ldrb r0, [r2] + adds r0, r5 + ldrb r0, [r0] + strb r0, [r1] + adds r2, 0x1 + adds r3, 0x1 + ldrb r0, [r2] + cmp r0, 0xFF + bne _0800DCC4 +_0800DCD8: + adds r1, r4, r3 + movs r0, 0 + strb r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800DCB4 + + thumb_func_start sub_800DCE8 +sub_800DCE8: @ 800DCE8 + push {r4,r5,lr} + adds r4, r0, 0 + movs r3, 0 + ldrb r0, [r1] + cmp r0, 0 + beq _0800DD0C + ldr r5, =gUnknown_082ED370 + adds r2, r1, 0 +_0800DCF8: + adds r1, r4, r3 + ldrb r0, [r2] + adds r0, r5 + ldrb r0, [r0] + strb r0, [r1] + adds r2, 0x1 + adds r3, 0x1 + ldrb r0, [r2] + cmp r0, 0 + bne _0800DCF8 +_0800DD0C: + adds r1, r4, r3 + movs r0, 0xFF + strb r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800DCE8 + + thumb_func_start sub_800DD1C +sub_800DD1C: @ 800DD1C + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r6, 0 + ldr r0, =0x03007890 + ldr r4, [r0] + ldrb r2, [r4, 0x2] + ldrb r1, [r4] + adds r7, r0, 0 + cmp r1, 0x1 + bne _0800DD72 + movs r3, 0 + ands r1, r2 + cmp r1, 0 + beq _0800DD4E + cmp r5, 0x1 + bne _0800DD48 + ldrb r0, [r4, 0xA] + b _0800DD8C + .pool +_0800DD48: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0800DD4E: + lsrs r2, 1 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3 + bhi _0800DD8A + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _0800DD4E + adds r0, r6, 0x1 + cmp r5, r0 + bne _0800DD48 +_0800DD68: + ldr r0, [r7] + adds r0, 0xA + adds r0, r3 + ldrb r0, [r0] + b _0800DD8C +_0800DD72: + movs r3, 0 + movs r1, 0x1 +_0800DD76: + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _0800DD68 + lsrs r2, 1 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3 + bls _0800DD76 +_0800DD8A: + movs r0, 0 +_0800DD8C: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_800DD1C + + thumb_func_start sub_800DD94 +sub_800DD94: @ 800DD94 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r7, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + movs r4, 0 + ldr r0, =0x03005d90 + mov r8, r0 + adds r6, r7, 0x2 + ldr r0, [r0] + adds r5, r0, 0 + adds r5, 0xA +_0800DDB2: + adds r0, r6, r4 + adds r1, r5, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x1 + ble _0800DDB2 + movs r4, 0 + lsls r2, 7 + mov r12, r2 + adds r1, r7, 0x4 +_0800DDC8: + adds r0, r1, r4 + strb r3, [r0] + asrs r3, 8 + adds r4, 0x1 + cmp r4, 0x3 + ble _0800DDC8 + mov r1, r8 + ldr r0, [r1] + ldrb r0, [r0, 0x8] + movs r6, 0x1 + movs r1, 0x1 + ands r1, r0 + ldrb r2, [r7, 0xB] + movs r5, 0x2 + negs r5, r5 + adds r0, r5, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r7, 0xB] + movs r4, 0x7F + mov r1, r9 + ands r1, r4 + ldrb r2, [r7, 0xA] + movs r0, 0x80 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + ands r0, r4 + mov r1, r12 + orrs r0, r1 + strb r0, [r7, 0xA] + ldrb r0, [r7] + movs r1, 0x10 + negs r1, r1 + ands r1, r0 + movs r0, 0x2 + orrs r1, r0 + ldrb r2, [r7, 0x1] + movs r0, 0x3D + negs r0, r0 + ands r0, r2 + movs r2, 0xC + orrs r0, r2 + strb r0, [r7, 0x1] + movs r0, 0x11 + negs r0, r0 + ands r1, r0 + subs r0, 0x10 + ands r1, r0 + subs r0, 0x20 + ands r1, r0 + strb r1, [r7] + ldr r0, =0x0000087f + bl FlagGet + lsls r0, 7 + ldrb r1, [r7] + ands r4, r1 + orrs r4, r0 + strb r4, [r7] + bl sub_809D42C + ands r0, r6 + ldrb r1, [r7, 0x1] + ands r5, r1 + orrs r5, r0 + strb r5, [r7, 0x1] + ldr r0, =0x00000864 + bl FlagGet + ands r6, r0 + lsls r6, 1 + ldrb r1, [r7, 0x1] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + orrs r0, r6 + strb r0, [r7, 0x1] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800DD94 + + thumb_func_start sub_800DE7C +sub_800DE7C: @ 800DE7C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r7, r0, 0 + mov r8, r1 + lsls r2, 24 + lsrs r5, r2, 24 + ldr r0, =0x03004140 + ldrb r0, [r0, 0x6] + cmp r0, 0x1 + bne _0800DED8 + movs r0, 0x1 + mov r9, r0 + ldr r6, =0x03007890 + ldr r0, [r6] + lsls r4, r5, 5 + adds r0, r4 + ldrh r0, [r0, 0x18] + bl sub_8010454 + cmp r0, 0 + beq _0800DEB8 + ldr r1, [r6] + ldrb r0, [r1, 0x7] + asrs r0, r5 + mov r2, r9 + ands r0, r2 + cmp r0, 0 + bne _0800DEF0 +_0800DEB8: + adds r0, r7, 0 + movs r1, 0 + movs r2, 0xD + bl memset + mov r0, r8 + movs r1, 0 + movs r2, 0x8 + bl memset + b _0800DF24 + .pool +_0800DED8: + movs r0, 0 + mov r9, r0 + ldr r6, =0x03007890 + ldr r0, [r6] + lsls r4, r5, 5 + adds r0, r4 + ldrh r0, [r0, 0x18] + bl sub_8010454 + cmp r0, 0 + beq _0800DF10 + ldr r1, [r6] +_0800DEF0: + adds r1, r4, r1 + adds r1, 0x1A + adds r0, r7, 0 + movs r2, 0xD + bl memcpy + ldr r1, [r6] + adds r1, r4, r1 + adds r1, 0x29 + mov r0, r8 + movs r2, 0x8 + bl memcpy + b _0800DF24 + .pool +_0800DF10: + adds r0, r7, 0 + movs r1, 0 + movs r2, 0xD + bl memset + mov r0, r8 + movs r1, 0 + movs r2, 0x8 + bl memset +_0800DF24: + mov r0, r9 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_800DE7C + + thumb_func_start sub_800DF34 +sub_800DF34: @ 800DF34 + push {r4-r7,lr} + adds r3, r0, 0 + adds r5, r1, 0 + lsls r2, 24 + movs r7, 0 + ldr r6, =0x03007890 + ldr r0, [r6] + lsrs r4, r2, 19 + adds r2, r0, r4 + ldrh r1, [r2, 0x18] + ldr r0, =0x00007f7d + cmp r1, r0 + bne _0800DF74 + adds r1, r2, 0 + adds r1, 0x1A + adds r0, r3, 0 + movs r2, 0xD + bl memcpy + ldr r1, [r6] + adds r1, r4, r1 + adds r1, 0x29 + adds r0, r5, 0 + movs r2, 0x8 + bl memcpy + movs r7, 0x1 + b _0800DF88 + .pool +_0800DF74: + adds r0, r3, 0 + movs r1, 0 + movs r2, 0xD + bl memset + adds r0, r5, 0 + movs r1, 0 + movs r2, 0x8 + bl memset +_0800DF88: + adds r0, r7, 0 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_800DF34 + + thumb_func_start sub_800DF90 +sub_800DF90: @ 800DF90 + push {r4,lr} + adds r4, r1, 0 + ldr r1, =0x02022b14 + movs r2, 0xD + bl memcpy + ldr r1, =0x02022b22 + adds r0, r4, 0 + movs r2, 0x8 + bl memcpy + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800DF90 + + thumb_func_start sub_800DFB4 +sub_800DFB4: @ 800DFB4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r2, r1, 24 + cmp r3, 0 + bne _0800DFCA + cmp r2, 0 + bne _0800DFCA + movs r3, 0xE7 + movs r2, 0x8 +_0800DFCA: + ldr r0, =0x03007890 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x1 + bne _0800E024 + ldr r0, =gUnknown_082ED5F0 + adds r1, r3, 0 + movs r3, 0 + bl AddObjectToFront + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =0x02020630 + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + adds r4, r0 + ldr r0, =0x00001234 + strh r0, [r4, 0x3C] + ldr r0, =gUnknown_082ED5E0 + ldrh r0, [r0, 0x6] + bl GetObjectTileRangeStartByTag + strh r0, [r4, 0x3A] + adds r4, 0x3E + ldrb r0, [r4] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4] + ldr r0, =0x02022b10 + strb r5, [r0] + b _0800E06A + .pool +_0800E024: + ldr r0, =gUnknown_082ED5F0 + adds r1, r3, 0 + movs r3, 0 + bl AddObjectToFront + ldr r4, =0x02022b10 + strb r0, [r4] + ldr r5, =0x02020630 + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =0x00001234 + strh r1, [r0, 0x3C] + ldr r0, =gUnknown_082ED5E0 + ldrh r0, [r0, 0x6] + bl GetObjectTileRangeStartByTag + ldrb r2, [r4] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r5 + strh r0, [r1, 0x3A] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_0800E06A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800DFB4 + + thumb_func_start sub_800E084 +sub_800E084: @ 800E084 + push {r4,lr} + ldr r4, =0x02020630 + ldr r3, =0x02022b10 + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, r0, r4 + movs r0, 0x3C + ldrsh r1, [r2, r0] + ldr r0, =0x00001234 + cmp r1, r0 + bne _0800E0CA + movs r0, 0 + strh r0, [r2, 0x3C] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r3, =0x030022c0 + movs r0, 0x84 + lsls r0, 3 + adds r3, r0 + ldr r0, =gDefaultOamAttributes + ldr r1, [r0] + ldr r2, [r0, 0x4] + str r1, [r3] + str r2, [r3, 0x4] + ldr r1, =0x070003e8 + movs r2, 0x4 + bl CpuSet +_0800E0CA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800E084 + + thumb_func_start sub_800E0E8 +sub_800E0E8: @ 800E0E8 + push {r4,lr} + ldr r4, =gUnknown_082ED5E0 + ldrh r0, [r4, 0x6] + bl GetObjectTileRangeStartByTag + lsls r0, 16 + ldr r1, =0xffff0000 + cmp r0, r1 + bne _0800E100 + adds r0, r4, 0 + bl LoadCompressedObjectPic +_0800E100: + ldr r0, =gUnknown_082ED5E8 + bl LoadTaggedObjectPalette + ldr r1, =0x02022b10 + movs r0, 0xFF + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800E0E8 + + thumb_func_start sub_800E124 +sub_800E124: @ 800E124 + push {r4,lr} + ldr r1, =0x03007890 + ldr r0, [r1] + ldrb r2, [r0, 0x2] + movs r3, 0 + movs r4, 0x1 +_0800E130: + adds r0, r2, 0 + ands r0, r4 + cmp r0, 0 + beq _0800E148 + ldr r0, [r1] + adds r0, 0xA + adds r0, r3 + ldrb r0, [r0] + b _0800E156 + .pool +_0800E148: + lsrs r2, 1 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3 + bls _0800E130 + movs r0, 0 +_0800E156: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_800E124 + + thumb_func_start sub_800E15C +sub_800E15C: @ 800E15C + push {lr} + adds r2, r0, 0 + movs r3, 0x32 + ldrsh r0, [r2, r3] + cmp r0, r1 + beq _0800E170 + movs r0, 0 + strh r1, [r2, 0x32] + strh r0, [r2, 0x34] + strh r0, [r2, 0x36] +_0800E170: + pop {r0} + bx r0 + thumb_func_end sub_800E15C + + thumb_func_start sub_800E174 +sub_800E174: @ 800E174 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r1, =0x02022b10 + ldrb r0, [r1] + cmp r0, 0xFF + bne _0800E184 + b _0800E346 +_0800E184: + ldr r2, =0x02020630 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, r0, r2 + movs r0, 0x3C + ldrsh r1, [r2, r0] + ldr r0, =0x00001234 + cmp r1, r0 + beq _0800E19C + b _0800E346 +_0800E19C: + adds r6, r2, 0 + movs r5, 0xFF + movs r4, 0 + ldr r0, =0x03007890 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x1 + bne _0800E1F6 + adds r7, r6, 0 + adds r7, 0x28 + movs r1, 0x29 + adds r1, r6 + mov r8, r1 + b _0800E1E6 + .pool +_0800E1C8: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_800DD1C + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + bcc _0800E1E6 + adds r0, r4, 0 + bl sub_800DD1C + lsls r0, 24 + lsrs r5, r0, 24 +_0800E1E6: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x1 + cmp r4, r0 + blt _0800E1C8 + b _0800E208 +_0800E1F6: + bl sub_800E124 + lsls r0, 24 + lsrs r5, r0, 24 + adds r7, r6, 0 + adds r7, 0x28 + movs r2, 0x29 + adds r2, r6 + mov r8, r2 +_0800E208: + bl sub_8012224 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0800E218 + movs r0, 0x4 + b _0800E246 +_0800E218: + cmp r5, 0x18 + bhi _0800E220 + movs r0, 0x3 + b _0800E246 +_0800E220: + adds r0, r5, 0 + subs r0, 0x19 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x65 + bhi _0800E230 + movs r0, 0x2 + b _0800E246 +_0800E230: + adds r0, r5, 0 + subs r0, 0x7F + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x65 + bhi _0800E240 + movs r0, 0x1 + b _0800E246 +_0800E240: + cmp r5, 0xE4 + bls _0800E248 + movs r0, 0 +_0800E246: + strh r0, [r6, 0x2E] +_0800E248: + movs r3, 0x2E + ldrsh r1, [r6, r3] + movs r2, 0x30 + ldrsh r0, [r6, r2] + cmp r1, r0 + beq _0800E25E + adds r0, r6, 0 + bl sub_800E15C + ldrh r0, [r6, 0x2E] + strh r0, [r6, 0x30] +_0800E25E: + movs r0, 0x32 + ldrsh r1, [r6, r0] + ldr r2, [r6, 0x8] + lsls r1, 2 + adds r1, r2 + movs r3, 0x36 + ldrsh r0, [r6, r3] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + lsls r0, 10 + lsrs r0, 26 + movs r3, 0x34 + ldrsh r1, [r6, r3] + cmp r0, r1 + bge _0800E2AC + ldrh r0, [r6, 0x36] + adds r0, 0x1 + movs r3, 0 + strh r0, [r6, 0x36] + strh r3, [r6, 0x34] + movs r1, 0x32 + ldrsh r0, [r6, r1] + lsls r0, 2 + adds r0, r2 + movs r2, 0x36 + ldrsh r1, [r6, r2] + ldr r0, [r0] + lsls r1, 2 + adds r1, r0 + movs r0, 0 + ldrsh r1, [r1, r0] + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + bne _0800E2B2 + strh r3, [r6, 0x36] + b _0800E2B2 +_0800E2AC: + ldrh r0, [r6, 0x34] + adds r0, 0x1 + strh r0, [r6, 0x34] +_0800E2B2: + ldr r4, =0x030022c0 + movs r1, 0x84 + lsls r1, 3 + adds r0, r4, r1 + ldr r1, =gUnknown_082ED570 + ldr r2, [r1, 0x4] + ldr r1, [r1] + str r1, [r0] + str r2, [r0, 0x4] + movs r3, 0x20 + ldrsh r2, [r6, r3] + movs r1, 0 + ldrsb r1, [r7, r1] + adds r2, r1 + ldr r1, =0x00000422 + adds r5, r4, r1 + ldr r3, =0x000001ff + adds r1, r3, 0 + ands r2, r1 + ldrh r3, [r5] + ldr r1, =0xfffffe00 + ands r1, r3 + orrs r1, r2 + strh r1, [r5] + ldrh r1, [r6, 0x22] + mov r2, r8 + ldrb r2, [r2] + adds r1, r2 + strb r1, [r0] + ldrb r2, [r6, 0x5] + ldr r3, =0x00000425 + adds r5, r4, r3 + lsrs r2, 4 + lsls r2, 4 + ldrb r3, [r5] + movs r1, 0xF + ands r1, r3 + orrs r1, r2 + strb r1, [r5] + movs r1, 0x32 + ldrsh r2, [r6, r1] + ldr r1, [r6, 0x8] + lsls r2, 2 + adds r2, r1 + movs r3, 0x36 + ldrsh r1, [r6, r3] + ldr r2, [r2] + lsls r1, 2 + adds r1, r2 + ldrh r2, [r1] + ldrh r6, [r6, 0x3A] + adds r2, r6 + ldr r1, =0x00000424 + adds r4, r1 + ldr r3, =0x000003ff + adds r1, r3, 0 + ands r2, r1 + ldrh r3, [r4] + ldr r1, =0xfffffc00 + ands r1, r3 + orrs r1, r2 + strh r1, [r4] + ldr r1, =0x070003e8 + movs r2, 0x4 + bl CpuSet + bl sub_8011A74 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0800E346 + bl sub_800E084 +_0800E346: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800E174 + + thumb_func_start sub_800E378 +sub_800E378: @ 800E378 + push {lr} + stm r0!, {r1} + adds r1, r2, 0 + bl CopyString + pop {r0} + bx r0 + thumb_func_end sub_800E378 + + thumb_func_start sub_800E388 +sub_800E388: @ 800E388 + push {lr} + adds r2, r0, 0 + movs r1, 0 +_0800E38E: + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0800E39A + movs r0, 0x1 + b _0800E3A2 +_0800E39A: + adds r1, 0x1 + cmp r1, 0x7 + ble _0800E38E + movs r0, 0 +_0800E3A2: + pop {r1} + bx r1 + thumb_func_end sub_800E388 + + thumb_func_start sub_800E3A8 +sub_800E3A8: @ 800E3A8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _0800E3BE + b _0800E520 +_0800E3BE: + movs r0, 0xF0 + bl AllocZeroed + str r0, [sp, 0x14] + movs r4, 0 + b _0800E434 + .pool +_0800E3D0: + lsls r2, r4, 2 + mov r0, sp + adds r1, r0, r2 + movs r0, 0x1 + negs r0, r0 + str r0, [r1] + movs r5, 0 + mov r8, r2 + lsls r0, r4, 3 + adds r1, r4, 0x1 + mov r9, r1 + subs r0, r4 + lsls r0, 2 + str r0, [sp, 0x1C] + ldr r7, =0x020229f0 + mov r10, r7 + ldr r6, =0x00003b98 + movs r4, 0 + mov r0, r10 + subs r0, 0x4 + ldr r1, [sp, 0x1C] + adds r3, r1, r0 +_0800E3FC: + ldrh r1, [r3] + ldr r0, =0x03005d8c + ldr r2, [r0] + ldr r7, =0x00003b98 + adds r0, r2, r7 + adds r0, r4 + ldr r0, [r0] + cmp r1, r0 + bne _0800E428 + adds r1, r2, r6 + adds r1, 0x4 + ldr r0, [sp, 0x1C] + add r0, r10 + str r3, [sp, 0x18] + bl CompareString + ldr r3, [sp, 0x18] + cmp r0, 0 + bne _0800E428 + mov r0, sp + add r0, r8 + str r5, [r0] +_0800E428: + adds r6, 0xC + adds r4, 0xC + adds r5, 0x1 + cmp r5, 0x13 + ble _0800E3FC + mov r4, r9 +_0800E434: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + blt _0800E3D0 + movs r0, 0 + mov r8, r0 + movs r4, 0 + mov r7, sp + movs r5, 0 + ldr r6, [sp, 0x14] + b _0800E4AC + .pool +_0800E45C: + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + beq _0800E4A6 + ldr r2, =0x020229e8 + adds r0, r5, r2 + ldrh r0, [r0, 0x1A] + cmp r0, 0x1 + beq _0800E4A6 + adds r0, r2, 0x4 + adds r0, r5, r0 + ldrh r1, [r0] + adds r2, 0x8 + adds r2, r5, r2 + adds r0, r6, 0 + bl sub_800E378 + ldr r2, [r7] + cmp r2, 0 + blt _0800E4A0 + ldr r0, =0x03005d8c + ldr r1, [r0] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldr r1, =0x00003b9c + adds r0, r1 + movs r1, 0 + movs r2, 0x8 + bl memset +_0800E4A0: + adds r6, 0xC + movs r0, 0x1 + add r8, r0 +_0800E4A6: + adds r7, 0x4 + adds r5, 0x1C + adds r4, 0x1 +_0800E4AC: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + blt _0800E45C + movs r4, 0 + ldr r1, =0x03005d8c + mov r9, r1 + ldr r6, =0x00003b98 + movs r7, 0 + mov r1, r8 + lsls r0, r1, 1 + add r0, r8 + lsls r0, 2 + ldr r1, [sp, 0x14] + adds r5, r0, r1 +_0800E4CE: + mov r1, r9 + ldr r0, [r1] + adds r0, r6 + adds r0, 0x4 + bl sub_800E388 + cmp r0, 0 + beq _0800E500 + mov r0, r9 + ldr r2, [r0] + ldr r1, =0x00003b98 + adds r0, r2, r1 + adds r0, r7 + ldr r1, [r0] + adds r2, r6 + adds r2, 0x4 + adds r0, r5, 0 + bl sub_800E378 + adds r5, 0xC + movs r0, 0x1 + add r8, r0 + mov r1, r8 + cmp r1, 0x13 + bgt _0800E50A +_0800E500: + adds r6, 0xC + adds r7, 0xC + adds r4, 0x1 + cmp r4, 0x13 + ble _0800E4CE +_0800E50A: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r7, =0x00003b98 + adds r0, r7 + ldr r1, [sp, 0x14] + movs r2, 0xF0 + bl memcpy + ldr r0, [sp, 0x14] + bl Free +_0800E520: + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800E3A8 + + thumb_func_start sub_800E540 +sub_800E540: @ 800E540 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r9, r1 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + movs r7, 0 + ldr r6, =0x03005d8c + ldr r4, =0x00003b98 + movs r5, 0 +_0800E558: + ldr r0, [r6] + adds r0, r4 + adds r0, 0x4 + mov r1, r9 + bl CompareString + cmp r0, 0 + bne _0800E584 + ldr r0, [r6] + ldr r1, =0x00003b98 + adds r0, r1 + adds r0, r5 + ldr r0, [r0] + cmp r0, r8 + bne _0800E584 + movs r0, 0x1 + b _0800E59E + .pool +_0800E584: + ldr r0, [r6] + adds r0, r4 + adds r0, 0x4 + bl sub_800E388 + cmp r0, 0 + beq _0800E59C + adds r4, 0xC + adds r5, 0xC + adds r7, 0x1 + cmp r7, 0x13 + ble _0800E558 +_0800E59C: + movs r0, 0 +_0800E59E: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_800E540 + + thumb_func_start sub_800E5AC +sub_800E5AC: @ 800E5AC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + ldr r0, =0x00003b98 + mov r8, r0 + movs r7, 0 + mov r6, r8 + movs r5, 0 + movs r4, 0x13 +_0800E5C0: + ldr r0, =0x03005d8c + ldr r1, [r0] + mov r2, r8 + adds r0, r1, r2 + adds r0, r5 + str r7, [r0] + mov r0, sp + strh r7, [r0] + adds r1, r6 + adds r1, 0x4 + ldr r2, =0x01000004 + bl CpuSet + adds r6, 0xC + adds r5, 0xC + subs r4, 0x1 + cmp r4, 0 + bge _0800E5C0 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800E5AC + + thumb_func_start nullsub_5 +nullsub_5: @ 800E5FC + bx lr + thumb_func_end nullsub_5 + + thumb_func_start nullsub_13 +nullsub_13: @ 800E600 + bx lr + thumb_func_end nullsub_13 + + thumb_func_start sub_800E604 +sub_800E604: @ 800E604 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + ldr r6, =0x03005000 + adds r5, r6, 0 + adds r5, 0xEE + ldrb r4, [r5] + mov r0, sp + movs r7, 0 + strh r7, [r0] + ldr r2, =0x0100067a + adds r1, r6, 0 + bl CpuSet + ldrb r0, [r5] + strb r4, [r5] + movs r0, 0xFF + strb r0, [r6, 0xC] + ldrb r0, [r5] + cmp r0, 0x4 + beq _0800E636 + ldrb r0, [r5] + strb r7, [r5] +_0800E636: + mov r7, sp + adds r7, 0x2 + add r0, sp, 0x4 + mov r8, r0 + movs r0, 0x6 + add r0, sp + mov r9, r0 + adds r5, r6, 0 + adds r5, 0x80 + movs r4, 0x4 +_0800E64A: + adds r0, r5, 0 + bl sub_800FCC4 + adds r5, 0x14 + subs r4, 0x1 + cmp r4, 0 + bge _0800E64A + movs r5, 0 + ldr r4, =0x0300506c + adds r0, r4, 0 + bl sub_800FCC4 + adds r0, r4, 0 + adds r0, 0xB8 + bl sub_800D6C8 + ldr r0, =0x0000097c + adds r4, r0 + adds r0, r4, 0 + bl sub_800D724 + strh r5, [r7] + ldr r1, =0x03003110 + ldr r2, =0x01000008 + adds r0, r7, 0 + bl CpuSet + mov r0, r8 + strh r5, [r0] + ldr r1, =0x03003090 + ldr r2, =0x01000028 + bl CpuSet + mov r0, r9 + strh r5, [r0] + ldr r1, =0x020229e8 + ldr r2, =0x01000046 + bl CpuSet + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800E604 + + thumb_func_start sub_800E6D0 +sub_800E6D0: @ 800E6D0 + push {r4-r6,lr} + ldr r4, =0x03002710 + ldr r5, [r4, 0x4] + ldr r6, [r4, 0x8] + bl sub_800E700 + bl rfu_REQ_stopMode + bl rfu_waitREQComplete + ldr r1, =0x04000208 + movs r0, 0 + strh r0, [r1] + str r5, [r4, 0x4] + str r6, [r4, 0x8] + movs r0, 0x1 + strh r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800E6D0 + + thumb_func_start sub_800E700 +sub_800E700: @ 800E700 + push {r4,lr} + ldr r0, =0x03004190 + ldr r1, =0x00000e64 + ldr r4, =0x03002714 + adds r2, r4, 0 + movs r3, 0x1 + bl rfu_initializeAPI + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _0800E732 + ldr r0, =0x020229c6 + strh r1, [r0] + bl sub_800AAF4 + movs r0, 0 + bl sub_80111B0 + bl sub_800E604 + adds r1, r4, 0x4 + movs r0, 0x3 + bl rfu_setTimerInterrupt +_0800E732: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800E700 + + thumb_func_start sub_800E748 +sub_800E748: @ 800E748 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_8010750 + ldr r0, =0x03005000 + ldrh r0, [r0, 0x4] + cmp r0, 0x12 + bls _0800E75C + b _0800E862 +_0800E75C: + lsls r0, 2 + ldr r1, =_0800E770 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0800E770: + .4byte _0800E7BC + .4byte _0800E862 + .4byte _0800E7E4 + .4byte _0800E862 + .4byte _0800E814 + .4byte _0800E862 + .4byte _0800E862 + .4byte _0800E862 + .4byte _0800E862 + .4byte _0800E862 + .4byte _0800E862 + .4byte _0800E862 + .4byte _0800E862 + .4byte _0800E862 + .4byte _0800E862 + .4byte _0800E862 + .4byte _0800E862 + .4byte _0800E862 + .4byte _0800E828 +_0800E7BC: + ldr r0, =0x02022b2c + bl sub_800BFCC + ldr r0, =0x03005000 + movs r2, 0x1 + strh r2, [r0, 0x4] + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + strh r2, [r0, 0xA] + b _0800E862 + .pool +_0800E7E4: + ldr r4, =0x03005000 + ldrb r0, [r4, 0xC] + ldr r3, =gUnknown_082ED6E0 + movs r1, 0 + movs r2, 0xF0 + bl sub_800C054 + movs r0, 0x3 + strh r0, [r4, 0x4] + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x6 + strh r1, [r0, 0xA] + b _0800E862 + .pool +_0800E814: + movs r0, 0 + bl sub_800C27C + ldr r1, =0x03005000 + movs r0, 0x5 + strh r0, [r1, 0x4] + b _0800E862 + .pool +_0800E828: + ldr r4, =0x03005000 + ldr r0, =0x00000cdb + adds r1, r4, r0 + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldr r0, =sub_800EDBC + bl sub_800D52C + bl sub_800EAB4 + bl sub_800EAFC + movs r0, 0x14 + strh r0, [r4, 0x4] + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + strh r1, [r0, 0xA] + ldr r0, =sub_801084C + movs r1, 0x5 + bl AddTask + adds r0, r5, 0 + bl remove_task +_0800E862: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800E748 + + thumb_func_start sub_800E87C +sub_800E87C: @ 800E87C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_082ED6A5 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_800E87C + + thumb_func_start sub_800E88C +sub_800E88C: @ 800E88C + push {r4-r7,lr} + adds r2, r0, 0 + adds r5, r1, 0 + movs r4, 0x1 + adds r1, r2, 0 + movs r6, 0 + movs r0, 0x1 + negs r0, r0 + cmp r5, r0 + bne _0800E8CC + movs r3, 0 + movs r5, 0x1 + ldr r1, =0x03005cde +_0800E8A6: + adds r0, r2, 0 + ands r0, r5 + cmp r0, 0 + beq _0800E8B8 + adds r0, r3, r1 + strb r4, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_0800E8B8: + asrs r2, 1 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3 + bls _0800E8A6 + b _0800E942 + .pool +_0800E8CC: + movs r3, 0 + mvns r0, r1 + mov r12, r0 + movs r7, 0x1 + ldr r4, =0x03005cde +_0800E8D6: + adds r2, r1, 0 + ands r2, r7 + cmp r2, 0 + bne _0800E8E2 + adds r0, r3, r4 + strb r2, [r0] +_0800E8E2: + asrs r1, 1 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3 + bls _0800E8D6 + movs r4, 0x4 + ldr r0, =0x03005cde + ldrb r7, [r0] +_0800E8F4: + movs r3, 0 + subs r1, r4, 0x1 + cmp r7, r4 + beq _0800E910 + ldr r2, =0x03005cde +_0800E8FE: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3 + bhi _0800E910 + adds r0, r3, r2 + ldrb r0, [r0] + cmp r0, r4 + bne _0800E8FE +_0800E910: + cmp r3, 0x4 + bne _0800E916 + adds r6, r4, 0 +_0800E916: + lsls r0, r1, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0800E8F4 + mov r0, r12 + ands r5, r0 + movs r3, 0 + movs r2, 0x1 + ldr r1, =0x03005cde +_0800E928: + adds r0, r5, 0 + ands r0, r2 + cmp r0, 0 + beq _0800E936 + adds r0, r3, r1 + strb r6, [r0] + adds r6, 0x1 +_0800E936: + asrs r5, 1 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3 + bls _0800E928 +_0800E942: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800E88C + + thumb_func_start sub_800E94C +sub_800E94C: @ 800E94C + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x03005000 + ldrh r3, [r0, 0x4] + adds r7, r0, 0 + cmp r3, 0xC + bls _0800E95E + b _0800EA9A +_0800E95E: + lsls r0, r3, 2 + ldr r1, =_0800E970 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0800E970: + .4byte _0800E9A4 + .4byte _0800EA9A + .4byte _0800EA9A + .4byte _0800EA9A + .4byte _0800EA9A + .4byte _0800EA9A + .4byte _0800E9BC + .4byte _0800EA9A + .4byte _0800EA9A + .4byte _0800E9E4 + .4byte _0800EA9A + .4byte _0800E9F8 + .4byte _0800EA3C +_0800E9A4: + ldr r0, =gUnknown_082ED608 + bl sub_800BFCC + ldr r0, =0x03005000 + movs r2, 0x1 + strh r2, [r0, 0x4] + b _0800E9CC + .pool +_0800E9BC: + ldrb r0, [r7, 0xC] + ldr r3, =gUnknown_082ED6E0 + movs r1, 0 + movs r2, 0xF0 + bl sub_800C054 + movs r2, 0x7 + strh r2, [r7, 0x4] +_0800E9CC: + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + strh r2, [r0, 0xA] + b _0800EA9A + .pool +_0800E9E4: + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + movs r0, 0xA + strh r0, [r1, 0xA] + b _0800EA9A + .pool +_0800E9F8: + bl sub_80107A0 + cmp r0, 0x6 + beq _0800EA1C + cmp r0, 0x6 + bgt _0800EA0A + cmp r0, 0x5 + beq _0800EA10 + b _0800EA9A +_0800EA0A: + cmp r0, 0x9 + beq _0800EA1C + b _0800EA9A +_0800EA10: + ldr r1, =0x03005000 + movs r0, 0xC + strh r0, [r1, 0x4] + b _0800EA9A + .pool +_0800EA1C: + bl sub_800D630 + ldr r0, =0x03005000 + ldr r1, =0x00000ce4 + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] + adds r0, r6, 0 + bl remove_task + b _0800EA9A + .pool +_0800EA3C: + ldr r0, =0x00000c3e + adds r4, r7, r0 + ldrb r0, [r4] + movs r5, 0x80 + lsls r5, 17 + lsls r5, r0 + lsrs r5, 24 + ldrb r1, [r4] + movs r0, 0xC + bl rfu_clearSlot + ldrb r1, [r4] + ldr r0, =0x00000c3f + adds r2, r7, r0 + movs r0, 0x10 + movs r3, 0x46 + bl rfu_setRecvBuffer + adds r1, r7, 0 + adds r1, 0x4C + adds r0, r5, 0 + movs r2, 0xE + bl rfu_UNI_setSendData + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + strh r1, [r0, 0xA] + adds r0, r6, 0 + bl remove_task + ldr r4, =0x02022b44 + ldrb r0, [r4, 0xF] + cmp r0, 0 + bne _0800EA92 + bl sub_801227C + ldrb r0, [r4, 0xF] + adds r0, 0x1 + strb r0, [r4, 0xF] +_0800EA92: + ldr r0, =sub_801084C + movs r1, 0x5 + bl AddTask +_0800EA9A: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800E94C + + thumb_func_start sub_800EAB4 +sub_800EAB4: @ 800EAB4 + push {r4,r5,lr} + ldr r0, =0x03004140 + ldrb r5, [r0] + movs r4, 0 +_0800EABC: + movs r0, 0x1 + ands r0, r5 + cmp r0, 0 + beq _0800EAE0 + lsls r2, r4, 3 + subs r2, r4 + lsls r2, 1 + ldr r0, =0x03005014 + adds r2, r0 + movs r0, 0x10 + adds r1, r4, 0 + movs r3, 0xE + bl rfu_setRecvBuffer + movs r0, 0x3 + adds r1, r4, 0 + bl rfu_clearSlot +_0800EAE0: + lsrs r5, 1 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _0800EABC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800EAB4 + + thumb_func_start sub_800EAFC +sub_800EAFC: @ 800EAFC + push {r4-r6,lr} + ldr r0, =0x03004140 + ldrb r5, [r0] + ldr r4, =0x03005c87 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x46 + bl rfu_UNI_setSendData + adds r0, r5, 0 + bl sub_800E87C + ldr r1, =0xfffff379 + adds r6, r4, r1 + adds r1, r4, 0 + adds r1, 0x53 + strb r0, [r1] + adds r4, 0x5B + strb r5, [r4] + movs r1, 0x1 + negs r1, r1 + adds r0, r5, 0 + bl sub_800E88C + movs r0, 0x1 + strb r0, [r6, 0xC] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800EAFC + + thumb_func_start sub_800EB44 +sub_800EB44: @ 800EB44 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_800F7DC + ldrb r1, [r0, 0xA] + movs r0, 0x7F + ands r0, r1 + cmp r0, 0x54 + bne _0800EB78 + bl sub_8011A74 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bne _0800EB78 + ldr r0, =0x03004140 + ldrb r0, [r0] + bl rfu_REQ_disconnect + bl rfu_waitREQComplete + movs r0, 0 + movs r1, 0 + bl sub_8011A64 +_0800EB78: + ldr r0, =0x03005000 + ldrh r2, [r0, 0x4] + adds r6, r0, 0 + cmp r2, 0x12 + bls _0800EB84 + b _0800ECF4 +_0800EB84: + lsls r0, r2, 2 + ldr r1, =_0800EB9C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0800EB9C: + .4byte _0800EBE8 + .4byte _0800ECF4 + .4byte _0800ECF4 + .4byte _0800ECF4 + .4byte _0800ECF4 + .4byte _0800ECF4 + .4byte _0800ECF4 + .4byte _0800ECF4 + .4byte _0800ECF4 + .4byte _0800ECF4 + .4byte _0800ECF4 + .4byte _0800ECF4 + .4byte _0800ECF4 + .4byte _0800EC38 + .4byte _0800EC98 + .4byte _0800ECF4 + .4byte _0800ECAC + .4byte _0800EC10 + .4byte _0800ECF4 +_0800EBE8: + ldr r0, =0x02022b2c + bl sub_800BFCC + ldr r0, =0x03005000 + movs r2, 0x1 + strh r2, [r0, 0x4] + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + strh r2, [r0, 0xA] + b _0800ECF4 + .pool +_0800EC10: + ldr r3, =gUnknown_082ED6E0 + movs r0, 0x2 + movs r1, 0 + movs r2, 0xF0 + bl sub_800C054 + ldr r0, =sub_800ED34 + bl sub_800D52C + ldr r1, =0x03005000 + movs r0, 0x12 + strh r0, [r1, 0x4] + b _0800ECF4 + .pool +_0800EC38: + ldr r1, =0x00000c3e + adds r0, r6, r1 + ldrb r1, [r0] + movs r0, 0x80 + lsls r0, 17 + lsls r0, r1 + lsrs r0, 24 + adds r1, r6, 0 + adds r1, 0x4C + movs r2, 0xE + bl rfu_UNI_setSendData + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _0800ECF4 + strb r0, [r6, 0xC] + adds r0, r5, 0 + bl remove_task + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + movs r2, 0x16 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _0800EC88 + ldr r0, =sub_8010D0C + movs r1, 0x1 + bl AddTask + b _0800ECF4 + .pool +_0800EC88: + ldr r0, =sub_801084C + movs r1, 0x5 + bl AddTask + b _0800ECF4 + .pool +_0800EC98: + movs r0, 0 + bl sub_800C27C + ldr r1, =0x03005000 + movs r0, 0xF + strh r0, [r1, 0x4] + b _0800ECF4 + .pool +_0800ECAC: + ldr r0, =0x00000cdb + adds r1, r6, r0 + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldr r0, =sub_800EDBC + bl sub_800D52C + movs r0, 0x1 + bl sub_8011068 + bl sub_800EAB4 + bl sub_800EAFC + movs r0, 0x14 + strh r0, [r6, 0x4] + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + strh r1, [r0, 0xA] + movs r4, 0x1 + strb r4, [r6, 0xC] + ldr r0, =sub_801084C + movs r1, 0x5 + bl AddTask + ldr r1, =0x00000ce8 + adds r0, r6, r1 + strb r4, [r0] + adds r0, r5, 0 + bl remove_task +_0800ECF4: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800EB44 + + thumb_func_start sub_800ED10 +sub_800ED10: @ 800ED10 + push {lr} + ldr r3, =gUnknown_082ED6E0 + movs r0, 0x1 + movs r1, 0 + movs r2, 0xF0 + bl sub_800C054 + pop {r0} + bx r0 + .pool + thumb_func_end sub_800ED10 + + thumb_func_start sub_800ED28 +sub_800ED28: @ 800ED28 + push {lr} + movs r0, 0 + bl sub_800C27C + pop {r0} + bx r0 + thumb_func_end sub_800ED28 + + thumb_func_start sub_800ED34 +sub_800ED34: @ 800ED34 + push {r4,lr} + ldr r0, =0x03005000 + movs r2, 0 + movs r1, 0xD + adds r0, 0x59 +_0800ED3E: + strb r2, [r0] + subs r0, 0x1 + subs r1, 0x1 + cmp r1, 0 + bge _0800ED3E + bl rfu_REQ_recvData + bl rfu_waitREQComplete + ldr r1, =0x03007870 + ldr r3, =0x03005000 + ldr r0, =0x00000c3e + adds r4, r3, r0 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ldrb r0, [r0, 0x12] + cmp r0, 0 + beq _0800ED9A + movs r2, 0xCD + lsls r2, 4 + adds r1, r3, r2 + ldrb r0, [r1] + adds r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + movs r1, 0x92 + lsls r1, 1 + adds r0, r3, r1 + ldr r2, =0x00000c3f + adds r1, r3, r2 + bl sub_800D7D8 + ldr r1, =0x02022b44 + ldrh r0, [r1, 0x6] + adds r0, 0x1 + strh r0, [r1, 0x6] + bl sub_800F048 + ldrb r0, [r4] + bl rfu_UNI_readySendData + ldrb r0, [r4] + bl rfu_UNI_clearRecvNewDataFlag +_0800ED9A: + movs r0, 0x1 + bl rfu_REQ_sendData_wrapper + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800ED34 + + thumb_func_start sub_800EDBC +sub_800EDBC: @ 800EDBC + ldr r0, =0x03005000 + ldr r1, =0x00000cdb + adds r0, r1 + ldrb r1, [r0] + movs r1, 0x1 + strb r1, [r0] + bx lr + .pool + thumb_func_end sub_800EDBC + + thumb_func_start sub_800EDD4 +sub_800EDD4: @ 800EDD4 + push {r4-r6,lr} + bl sub_800C048 + ldr r4, =0x03005000 + ldrb r0, [r4, 0xC] + cmp r0, 0x1 + bne _0800EDF0 + ldr r0, =sub_800E748 + b _0800EDF6 + .pool +_0800EDF0: + cmp r0, 0 + bne _0800EE18 + ldr r0, =sub_800E94C +_0800EDF6: + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0800EE38 + adds r0, r4, 0 + adds r0, 0x67 + ldrb r0, [r0] + bl remove_task + bl sub_800E604 + b _0800EE38 + .pool +_0800EE18: + cmp r0, 0x2 + bne _0800EE38 + ldr r0, =sub_800EB44 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0800EE38 + adds r0, r4, 0 + adds r0, 0x67 + ldrb r0, [r0] + bl remove_task + bl sub_800E604 +_0800EE38: + movs r5, 0 + ldr r6, =gUnknown_082ED7E0 +_0800EE3C: + lsls r0, r5, 2 + adds r0, r6 + ldr r4, [r0] + adds r0, r4, 0 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0800EE5E + adds r0, r4, 0 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_0800EE5E: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _0800EE3C + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800EDD4 + + thumb_func_start sub_800EE78 +sub_800EE78: @ 800EE78 + push {lr} + ldr r0, =sub_800E748 + movs r1, 0x1 + bl AddTask + ldr r1, =0x03005000 + adds r1, 0x67 + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_800EE78 + + thumb_func_start sub_800EE94 +sub_800EE94: @ 800EE94 + push {lr} + ldr r1, =0x03005000 + ldrh r0, [r1, 0x4] + cmp r0, 0x7 + bne _0800EEB4 + ldr r2, =0x00000ccd + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _0800EEB4 + movs r0, 0x1 + b _0800EEB6 + .pool +_0800EEB4: + movs r0, 0 +_0800EEB6: + pop {r1} + bx r1 + thumb_func_end sub_800EE94 + + thumb_func_start sub_800EEBC +sub_800EEBC: @ 800EEBC + push {r4,lr} + ldr r4, =0x03005000 + ldrh r0, [r4, 0x4] + cmp r0, 0x7 + bne _0800EEF8 + ldr r0, =0x03007890 + ldr r1, [r0] + ldr r2, =0x00000c3d + adds r0, r4, r2 + ldrb r0, [r0] + lsls r0, 5 + adds r1, r0 + ldrh r0, [r1, 0x14] + movs r1, 0xF0 + bl sub_800C12C + lsls r0, 24 + cmp r0, 0 + bne _0800EEF8 + movs r0, 0x9 + strh r0, [r4, 0x4] + movs r0, 0x1 + b _0800EEFA + .pool +_0800EEF8: + movs r0, 0 +_0800EEFA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_800EEBC + + thumb_func_start sub_800EF00 +sub_800EF00: @ 800EF00 + push {lr} + ldr r0, =sub_800E94C + movs r1, 0x1 + bl AddTask + ldr r1, =0x03005000 + adds r1, 0x67 + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_800EF00 + + thumb_func_start sub_800EF1C +sub_800EF1C: @ 800EF1C + push {lr} + ldr r0, =0x03004140 + ldrb r0, [r0] + cmp r0, 0 + bne _0800EF30 + movs r0, 0 + b _0800EF32 + .pool +_0800EF30: + movs r0, 0x1 +_0800EF32: + pop {r1} + bx r1 + thumb_func_end sub_800EF1C + + thumb_func_start sub_800EF38 +sub_800EF38: @ 800EF38 + ldr r1, =0x03005000 + movs r0, 0x4 + strh r0, [r1, 0x4] + ldr r0, =0x03004140 + ldrb r0, [r0] + ldr r2, =0x00000ce7 + adds r1, r2 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_800EF38 + + thumb_func_start sub_800EF58 +sub_800EF58: @ 800EF58 + push {lr} + adds r1, r0, 0 + ldr r2, =0x03005000 + ldrh r0, [r2, 0x4] + cmp r0, 0x11 + beq _0800EF68 + cmp r1, 0 + beq _0800EF74 +_0800EF68: + movs r0, 0x12 + strh r0, [r2, 0x4] + movs r0, 0x1 + b _0800EF76 + .pool +_0800EF74: + movs r0, 0 +_0800EF76: + pop {r1} + bx r1 + thumb_func_end sub_800EF58 + + thumb_func_start sub_800EF7C +sub_800EF7C: @ 800EF7C + ldr r1, =0x03005000 + movs r0, 0xE + strh r0, [r1, 0x4] + bx lr + .pool + thumb_func_end sub_800EF7C + + thumb_func_start sub_800EF88 +sub_800EF88: @ 800EF88 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0 + b _0800EF9A +_0800EF92: + lsrs r1, 1 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 +_0800EF9A: + cmp r2, 0x3 + bhi _0800EFAC + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0800EF92 + adds r0, r2, 0 + bl rfu_UNI_readySendData +_0800EFAC: + pop {r0} + bx r0 + thumb_func_end sub_800EF88 + + thumb_func_start sub_800EFB0 +sub_800EFB0: @ 800EFB0 + push {r4-r7,lr} + sub sp, 0x4 + movs r2, 0 + ldr r7, =0x03003090 + ldr r0, =0x03005000 + adds r6, r7, 0 + ldr r1, =0x00000c87 + adds r5, r0, r1 +_0800EFC0: + movs r3, 0 + lsls r0, r2, 3 + lsls r1, r2, 4 + adds r4, r2, 0x1 + subs r0, r2 + lsls r0, 1 + adds r2, r0, r5 + adds r1, r6 +_0800EFD0: + ldrh r0, [r1] + lsrs r0, 8 + strb r0, [r2, 0x1] + ldrh r0, [r1] + strb r0, [r2] + adds r2, 0x2 + adds r1, 0x2 + adds r3, 0x1 + cmp r3, 0x6 + ble _0800EFD0 + adds r2, r4, 0 + cmp r2, 0x4 + ble _0800EFC0 + movs r0, 0 + mov r1, sp + strh r0, [r1] + ldr r2, =0x01000028 + mov r0, sp + adds r1, r7, 0 + bl CpuSet + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800EFB0 + + thumb_func_start sub_800F014 +sub_800F014: @ 800F014 + push {lr} + ldr r3, =0x03003110 + ldr r2, =0x03003090 + movs r1, 0x6 +_0800F01C: + ldrh r0, [r3] + strh r0, [r2] + adds r3, 0x2 + adds r2, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _0800F01C + ldr r1, =0x03003110 + movs r2, 0 + adds r0, r1, 0 + adds r0, 0xC +_0800F032: + strh r2, [r0] + subs r0, 0x2 + cmp r0, r1 + bge _0800F032 + pop {r0} + bx r0 + .pool + thumb_func_end sub_800F014 + + thumb_func_start sub_800F048 +sub_800F048: @ 800F048 + push {r4,r5,lr} + ldr r4, =0x03005000 + ldr r0, =0x00000c3c + adds r5, r4, r0 + ldrb r0, [r5] + cmp r0, 0 + beq _0800F07A + ldr r1, =0x00000c1c + adds r0, r4, r1 + adds r1, r4, 0 + adds r1, 0x4C + bl sub_800DAC8 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =0x00000c3a + adds r0, r4, r1 + ldrb r0, [r0] + adds r1, r0, 0 + cmp r1, 0 + bne _0800F076 + ldrb r0, [r5] + strb r1, [r5] +_0800F076: + cmp r2, 0 + bne _0800F09E +_0800F07A: + ldr r5, =0x03005000 + ldr r1, =0x00000c3c + adds r0, r5, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0800F09E + ldr r1, =0x000009e8 + adds r0, r5, r1 + adds r4, r5, 0 + adds r4, 0x4C + adds r1, r4, 0 + bl sub_800D9DC + ldr r1, =0x00000c1c + adds r0, r5, r1 + adds r1, r4, 0 + bl sub_800DA68 +_0800F09E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800F048 + + thumb_func_start sub_800F0B8 +sub_800F0B8: @ 800F0B8 + push {r4,lr} + ldr r0, =0x03007890 + ldr r0, [r0] + ldrb r0, [r0, 0x6] + cmp r0, 0 + bne _0800F0CC +_0800F0C4: + movs r0, 0 + b _0800F0EC + .pool +_0800F0CC: + movs r3, 0 + ldr r4, =0x03003090 +_0800F0D0: + movs r2, 0 + lsls r0, r3, 4 + adds r1, r0, r4 +_0800F0D6: + ldrh r0, [r1] + cmp r0, 0 + bne _0800F0C4 + adds r1, 0x2 + adds r2, 0x1 + cmp r2, 0x6 + ble _0800F0D6 + adds r3, 0x1 + cmp r3, 0x4 + ble _0800F0D0 + movs r0, 0x1 +_0800F0EC: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_800F0B8 + + thumb_func_start sub_800F0F8 +sub_800F0F8: @ 800F0F8 + push {r4-r6,lr} + ldr r6, =0x03005000 + ldrh r0, [r6, 0x4] + cmp r0, 0x13 + bhi _0800F118 + bl rfu_REQ_recvData + bl rfu_waitREQComplete + movs r0, 0 + bl rfu_REQ_sendData_wrapper + b _0800F1D2 + .pool +_0800F118: + ldr r0, =0x00000cdb + adds r1, r6, r0 + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldr r0, =0x00000ce2 + adds r1, r6, r0 + ldr r0, =0x03007890 + ldr r0, [r0] + ldrb r1, [r1] + ldrb r0, [r0, 0x2] + ands r0, r1 + cmp r0, r1 + bne _0800F1D2 + cmp r0, 0 + beq _0800F1D2 + ldr r1, =0x00000cdc + adds r0, r6, r1 + ldrb r0, [r0] + adds r5, r0, 0 + cmp r5, 0 + bne _0800F1C8 + ldr r0, =0x00000ce3 + adds r4, r6, r0 + ldrb r0, [r4] + cmp r0, 0 + beq _0800F1A8 + bl sub_8011D6C + strb r5, [r4] + ldr r1, =0x00000ce4 + adds r0, r6, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0800F18C + movs r4, 0x80 + lsls r4, 8 + movs r0, 0x2 + adds r1, r4, 0 + bl sub_8011A64 + adds r0, r4, 0 + bl sub_8011170 + b _0800F1D2 + .pool +_0800F18C: + ldr r0, =0x03004140 + ldrb r4, [r0] + cmp r4, 0 + bne _0800F1A8 + bl sub_800EDD4 + ldr r0, =0x03003124 + strb r4, [r0] + b _0800F1D2 + .pool +_0800F1A8: + bl sub_800EFB0 + ldr r0, =0x03005000 + ldr r1, =0x00000cda + adds r0, r1 + ldrb r0, [r0] + bl rfu_UNI_readySendData + movs r0, 0x1 + bl rfu_REQ_sendData_wrapper + b _0800F1CC + .pool +_0800F1C8: + bl rfu_REQ_PARENT_resumeRetransmitAndChange +_0800F1CC: + ldr r1, =0x03005000 + movs r0, 0x1 + strb r0, [r1, 0xE] +_0800F1D2: + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_800F0F8 + + thumb_func_start sub_800F1E0 +sub_800F1E0: @ 800F1E0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + ldr r0, =0x03005000 + ldrh r1, [r0, 0x4] + adds r6, r0, 0 + cmp r1, 0x13 + bhi _0800F1F8 + b _0800F45A +_0800F1F8: + ldrb r0, [r6, 0xE] + cmp r0, 0x1 + beq _0800F200 + b _0800F45A +_0800F200: + bl rfu_waitREQComplete + ldr r0, =0x00000cdb + adds r2, r6, r0 + ldrb r0, [r2] + cmp r0, 0 + bne _0800F220 + adds r1, r6, 0 + adds r1, 0xEE +_0800F212: + ldrb r0, [r1] + cmp r0, 0 + beq _0800F21A + b _0800F480 +_0800F21A: + ldrb r0, [r2] + cmp r0, 0 + beq _0800F212 +_0800F220: + bl rfu_REQ_recvData + bl rfu_waitREQComplete + ldr r2, =0x03004140 + ldr r4, =0x03005000 + ldr r1, =0x00000ce2 + adds r0, r4, r1 + ldrb r1, [r2, 0x3] + ldrb r0, [r0] + ands r1, r0 + cmp r1, r0 + beq _0800F23C + b _0800F444 +_0800F23C: + ldr r6, =0x00000cdc + adds r1, r4, r6 + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldr r1, =0x02022b44 + ldrh r0, [r1, 0x6] + adds r0, 0x1 + strh r0, [r1, 0x6] + ldrb r7, [r2] + movs r5, 0 +_0800F252: + movs r0, 0x1 + ands r0, r7 + lsrs r1, r7, 1 + str r1, [sp, 0x4] + adds r2, r5, 0x1 + str r2, [sp] + cmp r0, 0 + bne _0800F264 + b _0800F364 +_0800F264: + ldr r1, =0x03005000 + lsls r2, r5, 3 + subs r0, r2, r5 + lsls r4, r0, 1 + adds r0, r1, 0 + adds r0, 0x15 + adds r0, r4, r0 + ldrb r0, [r0] + adds r6, r1, 0 + adds r3, r2, 0 + lsls r1, r5, 24 + mov r10, r1 + cmp r0, 0 + beq _0800F35C + ldr r2, =0x00000cee + adds r0, r6, r2 + adds r1, r5, r0 + ldrb r0, [r1] + cmp r0, 0xFF + beq _0800F2E0 + adds r0, r6, 0 + adds r0, 0x14 + adds r0, r4, r0 + ldrb r2, [r0] + lsrs r2, 5 + ldrb r0, [r1] + adds r0, 0x1 + movs r1, 0x7 + ands r0, r1 + cmp r2, r0 + beq _0800F2E0 + ldr r0, =0x00000cea + adds r1, r6, r0 + adds r1, r5, r1 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bls _0800F35C + movs r0, 0x81 + lsls r0, 8 + bl sub_8011170 + b _0800F35C + .pool +_0800F2E0: + ldr r2, =0x03005000 + ldr r6, =0x00000cee + adds r1, r2, r6 + adds r1, r5, r1 + subs r3, r5 + lsls r3, 1 + adds r4, r2, 0 + adds r4, 0x14 + adds r2, r3, r4 + ldrb r0, [r2] + lsrs r0, 5 + strb r0, [r1] + ldr r1, =0x03005000 + subs r6, 0x4 + adds r0, r1, r6 + adds r0, r5, r0 + movs r1, 0 + strb r1, [r0] + ldrb r1, [r2] + movs r0, 0x1F + ands r0, r1 + strb r0, [r2] + ldr r2, =0x03005cde + adds r0, r5, r2 + ldrb r0, [r0] + movs r6, 0 + lsls r1, r5, 24 + mov r10, r1 + lsrs r2, r7, 1 + str r2, [sp, 0x4] + adds r5, 0x1 + str r5, [sp] + ldr r1, =0x03003090 + mov r9, r1 + adds r5, r3, 0 + adds r7, r4, 0 + lsls r0, 4 + mov r8, r0 + adds r2, r5, 0x1 + mov r12, r2 +_0800F330: + lsls r1, r6, 1 + mov r0, r8 + adds r4, r1, r0 + add r4, r9 + mov r2, r12 + adds r3, r1, r2 + adds r3, r7 + ldrb r2, [r3] + lsls r2, 8 + adds r1, r5 + adds r1, r7 + ldrb r0, [r1] + orrs r0, r2 + strh r0, [r4] + movs r0, 0 + strb r0, [r3] + strb r0, [r1] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x6 + bls _0800F330 +_0800F35C: + mov r1, r10 + lsrs r0, r1, 24 + bl rfu_UNI_clearRecvNewDataFlag +_0800F364: + ldr r2, [sp, 0x4] + lsls r0, r2, 16 + lsrs r7, r0, 16 + ldr r6, [sp] + lsls r0, r6, 16 + lsrs r5, r0, 16 + cmp r5, 0x3 + bhi _0800F376 + b _0800F252 +_0800F376: + bl sub_800F014 + movs r0, 0 + bl sub_800F86C + bl sub_8010528 + ldr r4, =0x03005000 + ldr r1, =0x00000ce5 + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0800F452 + ldr r2, =0x00000cd9 + adds r0, r4, r2 + ldrb r2, [r0] + cmp r2, 0 + bne _0800F452 + ldr r0, =0x02022b44 + ldrb r1, [r0, 0xE] + strb r2, [r0, 0xE] + ldr r6, =0x00000cda + adds r0, r4, r6 + ldrb r1, [r0] + movs r0, 0x3 + bl rfu_clearSlot + movs r5, 0 + adds r7, r4, 0 + adds r7, 0x14 +_0800F3B2: + ldr r0, =0x00000ce5 + adds r6, r4, r0 + ldrb r0, [r6] + asrs r0, r5 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0800F3D6 + lsls r1, r5, 24 + lsrs r1, 24 + lsls r2, r5, 3 + subs r2, r5 + lsls r2, 1 + adds r2, r7 + movs r0, 0x10 + movs r3, 0xE + bl rfu_setRecvBuffer +_0800F3D6: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x3 + bls _0800F3B2 + subs r4, r6, 0x3 + ldrb r0, [r4] + ldrb r2, [r6] + adds r1, r0, 0 + orrs r1, r2 + bl sub_800E88C + ldrb r1, [r6] + movs r2, 0 + strb r1, [r6, 0x4] + ldrb r0, [r4] + orrs r0, r1 + strb r0, [r4] + strb r2, [r6] + ldrb r0, [r4] + adds r1, r6, 0 + subs r1, 0x5E + movs r2, 0x46 + bl rfu_UNI_setSendData + ldrb r0, [r4] + bl sub_800E87C + adds r1, r6, 0 + subs r1, 0xB + strb r0, [r1] + ldr r0, =sub_8010AAC + movs r1, 0 + bl AddTask + b _0800F452 + .pool +_0800F444: + ldr r2, =0x00000cdc + adds r1, r4, r2 + ldrb r0, [r1] + movs r2, 0 + movs r0, 0x1 + strb r0, [r1] + strb r2, [r4, 0xE] +_0800F452: + ldr r1, =0x03005000 + movs r0, 0 + strb r0, [r1, 0xE] + adds r6, r1, 0 +_0800F45A: + ldr r1, =0x00000cdc + adds r0, r6, r1 + ldrb r0, [r0] + adds r1, r0, 0 + ldr r0, =0x03007890 + ldr r0, [r0] + ldrb r0, [r0, 0x6] + cmp r0, 0 + beq _0800F484 + movs r0, 0x1 + ands r0, r1 + b _0800F486 + .pool +_0800F480: + movs r0, 0 + b _0800F486 +_0800F484: + movs r0, 0 +_0800F486: + 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_800F1E0 + + thumb_func_start sub_800F498 +sub_800F498: @ 800F498 + push {r4,r5,lr} + adds r4, r0, 0 + adds r2, r1, 0 + ldrh r1, [r4] + cmp r1, 0 + beq _0800F4DC + ldr r0, =0x03005000 + movs r5, 0x81 + lsls r5, 1 + adds r3, r0, r5 + ldrb r0, [r3] + lsls r0, 5 + orrs r0, r1 + strh r0, [r4] + ldrb r0, [r3] + adds r0, 0x1 + movs r1, 0x7 + ands r0, r1 + strb r0, [r3] + adds r3, r4, 0 + movs r4, 0x6 +_0800F4C2: + ldrh r1, [r3] + lsrs r0, r1, 8 + strb r0, [r2, 0x1] + strb r1, [r2] + adds r2, 0x2 + adds r3, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _0800F4C2 + b _0800F4EA + .pool +_0800F4DC: + movs r1, 0 + adds r0, r2, 0 + adds r0, 0xD +_0800F4E2: + strb r1, [r0] + subs r0, 0x1 + cmp r0, r2 + bge _0800F4E2 +_0800F4EA: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_800F498 + + thumb_func_start sub_800F4F0 +sub_800F4F0: @ 800F4F0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x58 + ldr r0, =0x03005124 + mov r1, sp + bl sub_800D934 + movs r1, 0 + ldr r0, =0x03003090 + mov r12, r0 +_0800F506: + movs r4, 0 + lsls r0, r1, 3 + adds r2, r1, 0x1 + mov r8, r2 + lsls r6, r1, 4 + subs r0, r1 + lsls r5, r0, 1 +_0800F514: + lsls r1, r4, 1 + adds r3, r1, r6 + add r3, r12 + adds r1, r5, r1 + adds r0, r1, 0x1 + add r0, sp + ldrb r2, [r0] + lsls r2, 8 + mov r7, sp + adds r0, r7, r1 + ldrb r0, [r0] + orrs r0, r2 + strh r0, [r3] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x6 + bls _0800F514 + mov r1, r8 + lsls r0, r1, 24 + lsrs r1, r0, 24 + cmp r1, 0x4 + bls _0800F506 + movs r0, 0 + bl sub_800F86C + ldr r0, =0x03004140 + ldrb r0, [r0, 0x2] + cmp r0, 0 + bne _0800F5C0 + ldr r0, =0x03005000 + ldr r2, =0x00000ce4 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _0800F5C0 + ldr r0, =0x03007890 + ldr r0, [r0] + ldrb r1, [r0, 0x2] + ldrb r0, [r0, 0x3] + orrs r0, r1 + bl rfu_REQ_disconnect + bl rfu_waitREQComplete + bl sub_8011A74 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0800F58C + cmp r0, 0x6 + beq _0800F58C + cmp r0, 0x9 + beq _0800F58C + movs r1, 0x90 + lsls r1, 8 + movs r0, 0x2 + bl sub_8011A64 +_0800F58C: + bl rfu_clearAllSlot + ldr r1, =0x03003124 + movs r0, 0 + strb r0, [r1] + ldr r0, =0x03005000 + movs r5, 0 + str r5, [r0] + ldr r7, =0x00000ce4 + adds r6, r0, r7 + ldrb r0, [r6] + cmp r0, 0x1 + bne _0800F5B8 + movs r4, 0x90 + lsls r4, 8 + movs r0, 0x2 + adds r1, r4, 0 + bl sub_8011A64 + adds r0, r4, 0 + bl sub_8011170 +_0800F5B8: + ldr r0, =0x03004140 + strb r5, [r0, 0x5] + strb r5, [r0, 0x4] + strb r5, [r6] +_0800F5C0: + ldr r6, =0x03005000 + movs r0, 0xCD + lsls r0, 4 + adds r2, r6, r0 + ldrb r0, [r2] + cmp r0, 0 + beq _0800F604 + ldrb r0, [r2] + subs r0, 0x1 + ldrb r1, [r2] + strb r0, [r2] + bl sub_8010528 + ldr r5, =0x03003110 + add r4, sp, 0x48 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_800F498 + ldr r1, =0x000009e8 + adds r0, r6, r1 + adds r1, r4, 0 + bl sub_800D888 + movs r1, 0 + movs r2, 0 +_0800F5F4: + lsls r0, r1, 1 + adds r0, r5 + strh r2, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x6 + bls _0800F5F4 +_0800F604: + bl sub_800F0B8 + add sp, 0x58 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_800F4F0 + + thumb_func_start sub_800F638 +sub_800F638: @ 800F638 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =0x03005000 + ldr r2, [r0, 0x70] + mov r10, r2 + movs r5, 0 + adds r2, r0, 0 + adds r2, 0x6E + ldrh r3, [r2] + cmp r5, r3 + bge _0800F6D4 + mov r9, r0 + ldr r0, =0x03000d90 + mov r8, r0 +_0800F65A: + movs r0, 0x1 + ands r0, r1 + lsrs r7, r1, 1 + adds r6, r5, 0x1 + cmp r0, 0 + bne _0800F6C8 + ldr r1, =0xffff8900 + adds r0, r1, 0 + adds r1, r5, 0 + orrs r1, r0 + mov r2, r8 + strh r1, [r2] + movs r4, 0 + lsls r0, r5, 1 + ldr r3, =0x03000d80 + mov r12, r3 + adds r0, r5 + lsls r0, 2 + mov r1, r10 + adds r2, r0, r1 + mov r3, r8 + adds r3, 0x2 +_0800F686: + ldrb r1, [r2, 0x1] + lsls r1, 8 + ldrb r0, [r2] + orrs r0, r1 + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + adds r4, 0x1 + cmp r4, 0x6 + ble _0800F686 + movs r4, 0 + ldr r2, =0x03000d90 + ldr r1, =0x03000d80 +_0800F6A0: + ldrh r0, [r2] + lsrs r0, 8 + strb r0, [r1, 0x1] + ldrh r0, [r2] + strb r0, [r1] + adds r2, 0x2 + adds r1, 0x2 + adds r4, 0x1 + cmp r4, 0x6 + ble _0800F6A0 + ldr r0, =0x030059e8 + mov r1, r12 + bl sub_800D888 + movs r1, 0x1 + lsls r1, r5 + mov r2, r9 + ldr r0, [r2, 0x78] + orrs r0, r1 + str r0, [r2, 0x78] +_0800F6C8: + adds r1, r7, 0 + adds r5, r6, 0 + ldr r3, =0x0300506e + ldrh r3, [r3] + cmp r5, r3 + blt _0800F65A +_0800F6D4: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800F638 + + thumb_func_start sub_800F6FC +sub_800F6FC: @ 800F6FC + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, =0x03005000 + ldrb r2, [r0, 0xC] + cmp r2, 0x1 + bne _0800F71C + cmp r1, 0 + beq _0800F71C + adds r0, 0x61 + adds r0, r1, r0 + strb r2, [r0] + b _0800F724 + .pool +_0800F71C: + adds r0, 0x5C + adds r0, r1, r0 + movs r1, 0x1 + strb r1, [r0] +_0800F724: + pop {r0} + bx r0 + thumb_func_end sub_800F6FC + + thumb_func_start sub_800F728 +sub_800F728: @ 800F728 + lsls r0, 24 + lsrs r0, 24 + ldr r3, =0x03005000 + adds r1, r3, 0 + adds r1, 0x5C + adds r1, r0, r1 + movs r2, 0 + strb r2, [r1] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + adds r1, 0x92 + strb r2, [r1] + bx lr + .pool + thumb_func_end sub_800F728 + + thumb_func_start sub_800F74C +sub_800F74C: @ 800F74C + push {r4,r5,lr} + adds r3, r0, 0 + ldr r0, =0x03005000 + ldrb r1, [r0, 0xC] + adds r5, r0, 0 + cmp r1, 0x1 + bne _0800F764 + movs r0, 0 + b _0800F786 + .pool +_0800F764: + movs r2, 0 + ldr r0, =0x00000cde + adds r4, r5, r0 +_0800F76A: + adds r1, r2, r4 + adds r0, r3, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _0800F76A + ldr r1, =0x00000c3e + adds r0, r5, r1 + ldrb r0, [r0] + adds r0, r3 + ldrb r0, [r0] +_0800F786: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_800F74C + + thumb_func_start rfu_func_080F97B8 +rfu_func_080F97B8: @ 800F794 + push {lr} + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _0800F7C6 + ldr r3, =0x03005da8 + ldrh r2, [r3] + cmp r2, 0 + beq _0800F7C6 + ldr r0, =0x030022b4 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0800F7C6 + ldr r1, =0x03000d78 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldrb r0, [r1] + lsls r0, 8 + orrs r0, r2 + strh r0, [r3] + movs r0, 0xBE + lsls r0, 8 + bl sub_800FD14 +_0800F7C6: + pop {r0} + bx r0 + .pool + thumb_func_end rfu_func_080F97B8 + + thumb_func_start sub_800F7DC +sub_800F7DC: @ 800F7DC + ldr r0, =0x02022b14 + bx lr + .pool + thumb_func_end sub_800F7DC + + thumb_func_start sub_800F7E4 +sub_800F7E4: @ 800F7E4 + push {lr} + movs r2, 0 + ldr r0, =0x03005000 + ldr r1, [r0] + ldr r0, =rfu_func_080F97B8 + cmp r1, r0 + bne _0800F7F4 + movs r2, 0x1 +_0800F7F4: + adds r0, r2, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_800F7E4 + + thumb_func_start sub_800F804 +sub_800F804: @ 800F804 + ldr r1, =0x03005000 + ldr r0, =rfu_func_080F97B8 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_800F804 + + thumb_func_start Rfu_set_zero +Rfu_set_zero: @ 800F814 + ldr r1, =0x03005000 + movs r0, 0 + str r0, [r1] + bx lr + .pool + thumb_func_end Rfu_set_zero + + thumb_func_start sub_800F820 +sub_800F820: @ 800F820 + push {lr} + movs r0, 0x88 + lsls r0, 7 + bl sub_800FD14 + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _0800F83C + bl sub_8082D18 + ldr r1, =0x03003110 + strh r0, [r1, 0xC] +_0800F83C: + ldr r1, =0x020223c0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_800F820 + + thumb_func_start sub_800F850 +sub_800F850: @ 800F850 + push {lr} + ldr r1, =0x03005000 + ldr r0, [r1] + cmp r0, 0 + bne _0800F85E + ldr r0, =sub_800F820 + str r0, [r1] +_0800F85E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_800F850 + + thumb_func_start sub_800F86C +sub_800F86C: @ 800F86C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r0, 0 + mov r8, r0 +_0800F87A: + mov r1, r8 + lsls r0, r1, 4 + ldr r2, =0x03003090 + adds r1, r0, r2 + ldrh r7, [r1] + movs r3, 0xFF + lsls r3, 8 + adds r1, r3, 0 + ands r1, r7 + movs r2, 0x88 + lsls r2, 8 + adds r5, r0, 0 + cmp r1, r2 + beq _0800F960 + cmp r1, r2 + bgt _0800F8D6 + movs r0, 0xCC + lsls r0, 7 + cmp r1, r0 + bne _0800F8A4 + b _0800FAE0 +_0800F8A4: + cmp r1, r0 + bgt _0800F8C4 + movs r0, 0x88 + lsls r0, 7 + cmp r1, r0 + bne _0800F8B2 + b _0800FBF4 +_0800F8B2: + movs r0, 0xBE + lsls r0, 7 + cmp r1, r0 + bne _0800F8BC + b _0800FAD0 +_0800F8BC: + b _0800FC04 + .pool +_0800F8C4: + movs r0, 0xEE + lsls r0, 7 + cmp r1, r0 + beq _0800F920 + movs r0, 0xF0 + lsls r0, 7 + cmp r1, r0 + beq _0800F90E + b _0800FC04 +_0800F8D6: + movs r0, 0xBE + lsls r0, 8 + cmp r1, r0 + bne _0800F8E0 + b _0800FBF4 +_0800F8E0: + cmp r1, r0 + bgt _0800F8F8 + movs r0, 0x89 + lsls r0, 8 + cmp r1, r0 + beq _0800F9C8 + movs r0, 0xA1 + lsls r0, 8 + cmp r1, r0 + bne _0800F8F6 + b _0800FAAC +_0800F8F6: + b _0800FC04 +_0800F8F8: + movs r0, 0xED + lsls r0, 8 + cmp r1, r0 + bne _0800F902 + b _0800FB10 +_0800F902: + movs r0, 0xEE + lsls r0, 8 + cmp r1, r0 + bne _0800F90C + b _0800FBB0 +_0800F90C: + b _0800FC04 +_0800F90E: + ldr r4, =0x03005000 + ldrb r0, [r4, 0xC] + cmp r0, 0 + bne _0800F920 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _0800F920 + b _0800FC50 +_0800F920: + ldr r0, =0x03007890 + ldr r0, [r0] + ldrb r0, [r0] + mov r6, r8 + adds r6, 0x1 + cmp r0, 0 + beq _0800F930 + b _0800FC08 +_0800F930: + ldr r1, =0x03003092 + adds r0, r5, r1 + ldrh r0, [r0] + ldr r2, =0x03005000 + strb r0, [r2, 0xD] + ldr r3, =0x03003094 + adds r0, r5, r3 + bl sub_800F74C + ldr r4, =0x03005cce + strb r0, [r4] + b _0800FC08 + .pool +_0800F960: + ldr r0, =0x03005000 + mov r9, r0 + mov r1, r8 + lsls r0, r1, 2 + add r0, r8 + lsls r7, r0, 2 + mov r2, r9 + adds r3, r7, r2 + movs r4, 0x92 + adds r4, r3 + mov r12, r4 + ldrb r4, [r4] + mov r6, r8 + adds r6, 0x1 + cmp r4, 0 + beq _0800F982 + b _0800FC08 +_0800F982: + adds r0, r3, 0 + adds r0, 0x80 + movs r2, 0 + strh r4, [r0] + ldr r1, =0x03003092 + adds r0, r5, r1 + ldrh r0, [r0] + adds r1, r3, 0 + adds r1, 0x82 + strh r0, [r1] + ldr r1, =0x03003094 + adds r0, r5, r1 + ldrh r1, [r0] + adds r0, r3, 0 + adds r0, 0x91 + strb r1, [r0] + mov r0, r9 + adds r0, 0x88 + adds r0, r7, r0 + str r4, [r0] + movs r0, 0x1 + mov r3, r12 + strb r0, [r3] + mov r0, r9 + adds r0, 0x5C + add r0, r8 + strb r2, [r0] + b _0800FC08 + .pool +_0800F9C8: + ldr r4, =0x03005000 + mov r9, r4 + mov r0, r8 + lsls r1, r0, 2 + adds r0, r1, r0 + lsls r4, r0, 2 + mov r3, r9 + adds r2, r4, r3 + adds r0, r2, 0 + adds r0, 0x92 + ldrb r3, [r0] + mov r10, r1 + mov r6, r8 + adds r6, 0x1 + cmp r3, 0x1 + beq _0800F9EA + b _0800FC08 +_0800F9EA: + movs r0, 0xFF + ands r0, r7 + adds r2, 0x80 + strh r0, [r2] + mov r1, r9 + adds r1, 0x88 + adds r1, r4, r1 + lsls r3, r0 + ldr r0, [r1] + orrs r0, r3 + str r0, [r1] + movs r4, 0 + ldr r0, =0x020223c4 + mov r9, r0 + mov r12, r2 + mov r1, r8 + lsls r7, r1, 8 + adds r3, r5, 0 +_0800FA0E: + mov r2, r12 + ldrh r0, [r2] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 1 + adds r1, r4 + lsls r1, 1 + adds r1, r7 + add r1, r9 + adds r2, r4, 0x1 + lsls r0, r2, 1 + adds r0, r3 + ldr r4, =0x03003090 + adds r0, r4 + ldrh r0, [r0] + strh r0, [r1] + lsls r2, 16 + lsrs r4, r2, 16 + cmp r4, 0x5 + bls _0800FA0E + ldr r4, =0x03005000 + mov r0, r10 + add r0, r8 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x88 + adds r1, r0, r1 + adds r2, r0, r4 + adds r0, r2, 0 + adds r0, 0x82 + ldrh r0, [r0] + lsls r0, 2 + ldr r3, =gUnknown_082ED628 + adds r0, r3 + ldr r1, [r1] + ldr r0, [r0] + cmp r1, r0 + beq _0800FA5C + b _0800FC08 +_0800FA5C: + adds r1, r2, 0 + adds r1, 0x92 + movs r0, 0x2 + strb r0, [r1] + mov r1, r8 + lsls r0, r1, 24 + lsrs r0, 24 + bl sub_800F6FC + bl sub_800F7DC + ldrb r1, [r0, 0xA] + movs r0, 0x7F + ands r0, r1 + cmp r0, 0x45 + beq _0800FA7E + b _0800FC08 +_0800FA7E: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _0800FA88 + b _0800FC08 +_0800FA88: + ldrb r0, [r4, 0xC] + cmp r0, 0 + beq _0800FA90 + b _0800FC08 +_0800FA90: + ldr r0, =0x020223c4 + bl sub_8010A70 + b _0800FC08 + .pool +_0800FAAC: + ldr r2, =gUnknown_082ED6B8 + ldr r3, =0x03003092 + adds r0, r5, r3 + ldrh r1, [r0] + lsls r1, 3 + adds r0, r1, r2 + ldr r0, [r0] + adds r2, 0x4 + adds r1, r2 + ldrh r1, [r1] + bl sub_800FE84 + b _0800FC04 + .pool +_0800FAD0: + ldr r1, =0x030050e4 + add r1, r8 + movs r0, 0x1 + strb r0, [r1] + b _0800FC04 + .pool +_0800FAE0: + ldr r2, =0x03005000 + movs r4, 0x80 + lsls r4, 1 + adds r0, r2, r4 + ldr r3, =0x03003092 + adds r1, r5, r3 + ldrh r0, [r0] + mov r6, r8 + adds r6, 0x1 + ldrh r1, [r1] + cmp r0, r1 + beq _0800FAFA + b _0800FC08 +_0800FAFA: + adds r0, r2, 0 + adds r0, 0xE9 + add r0, r8 + movs r1, 0x1 + strb r1, [r0] + b _0800FC08 + .pool +_0800FB10: + ldr r7, =0x03005000 + ldrb r2, [r7, 0xC] + cmp r2, 0 + bne _0800FB78 + ldr r3, =0x03003124 + ldrb r0, [r3] + mov r6, r8 + adds r6, 0x1 + cmp r0, 0 + beq _0800FC08 + ldr r0, =0x03003092 + adds r4, r5, r0 + ldrh r1, [r4] + ldr r0, =0x03007890 + ldr r0, [r0] + ldrb r0, [r0, 0x2] + ands r1, r0 + cmp r1, 0 + beq _0800FB48 + strb r2, [r3] + bl sub_800D630 + ldr r1, =0x03003094 + adds r0, r5, r1 + ldrh r1, [r0] + ldr r2, =0x00000ce4 + adds r0, r7, r2 + strb r1, [r0] +_0800FB48: + ldr r0, =0x03003090 + adds r0, 0x6 + adds r0, r5, r0 + ldrh r0, [r0] + strb r0, [r7, 0xD] + ldrh r0, [r4] + bl sub_80109E8 + b _0800FC08 + .pool +_0800FB78: + movs r0, 0xEE + lsls r0, 8 + bl sub_800FD14 + ldr r1, =0x03003110 + ldr r3, =0x03003092 + adds r0, r5, r3 + ldrh r0, [r0] + strh r0, [r1, 0x2] + ldr r4, =0x03003094 + adds r0, r5, r4 + ldrh r0, [r0] + strh r0, [r1, 0x4] + ldr r0, =0x03003090 + adds r0, 0x6 + adds r0, r5, r0 + ldrh r0, [r0] + strh r0, [r1, 0x6] + b _0800FC04 + .pool +_0800FBB0: + ldr r4, =0x03005000 + ldrb r0, [r4, 0xC] + mov r6, r8 + adds r6, 0x1 + cmp r0, 0x1 + bne _0800FC44 + ldr r0, =0x00000ce3 + adds r2, r4, r0 + ldr r1, =0x03003092 + adds r3, r5, r1 + ldrb r1, [r3] + ldrb r0, [r2] + orrs r0, r1 + strb r0, [r2] + ldr r2, =0x03003094 + adds r0, r5, r2 + ldrh r1, [r0] + ldr r2, =0x00000ce4 + adds r0, r4, r2 + strb r1, [r0] + ldrh r0, [r3] + bl sub_80109E8 + b _0800FC08 + .pool +_0800FBF4: + ldr r0, =0x03003020 + mov r3, r8 + lsls r1, r3, 1 + adds r1, r0 + ldr r4, =0x03003092 + adds r0, r5, r4 + ldrh r0, [r0] + strh r0, [r1] +_0800FC04: + mov r6, r8 + adds r6, 0x1 +_0800FC08: + ldr r3, =0x03005000 + ldrb r4, [r3, 0xC] + cmp r4, 0x1 + bne _0800FC44 + adds r0, r3, 0 + adds r0, 0x61 + mov r1, r8 + adds r2, r1, r0 + ldrb r0, [r2] + adds r1, r0, 0 + cmp r1, 0 + beq _0800FC44 + cmp r1, 0x4 + bne _0800FC40 + adds r0, r3, 0 + adds r0, 0x5C + add r0, r8 + movs r1, 0 + strb r4, [r0] + strb r1, [r2] + b _0800FC44 + .pool +_0800FC40: + adds r0, 0x1 + strb r0, [r2] +_0800FC44: + lsls r0, r6, 16 + lsrs r0, 16 + mov r8, r0 + cmp r0, 0x4 + bhi _0800FC50 + b _0800F87A +_0800FC50: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_800F86C + + thumb_func_start sub_800FC60 +sub_800FC60: @ 800FC60 + push {lr} + movs r2, 0 + ldr r0, =0x03005000 + adds r1, r0, 0 + adds r1, 0x92 +_0800FC6A: + ldrb r0, [r1] + cmp r0, 0 + beq _0800FC78 + movs r0, 0 + b _0800FC82 + .pool +_0800FC78: + adds r1, 0x14 + adds r2, 0x1 + cmp r2, 0x4 + ble _0800FC6A + movs r0, 0x1 +_0800FC82: + pop {r1} + bx r1 + thumb_func_end sub_800FC60 + + thumb_func_start sub_800FC88 +sub_800FC88: @ 800FC88 + push {r4,lr} + movs r1, 0 + ldr r2, =0x03005000 + ldrb r0, [r2, 0xD] + cmp r1, r0 + bge _0800FCBC + adds r4, r0, 0 + adds r3, r2, 0 + adds r3, 0x92 + adds r2, 0x5C +_0800FC9C: + ldrb r0, [r3] + cmp r0, 0x2 + bne _0800FCAA + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0800FCB4 +_0800FCAA: + movs r0, 0 + b _0800FCBE + .pool +_0800FCB4: + adds r3, 0x14 + adds r1, 0x1 + cmp r1, r4 + blt _0800FC9C +_0800FCBC: + movs r0, 0x1 +_0800FCBE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_800FC88 + + thumb_func_start sub_800FCC4 +sub_800FCC4: @ 800FCC4 + movs r2, 0 + movs r1, 0 + strh r1, [r0] + strh r1, [r0, 0x2] + str r1, [r0, 0x4] + str r1, [r0, 0x8] + strb r2, [r0, 0x10] + strb r2, [r0, 0x11] + strb r2, [r0, 0x12] + bx lr + thumb_func_end sub_800FCC4 + + thumb_func_start sub_800FCD8 +sub_800FCD8: @ 800FCD8 + push {r4,lr} + movs r2, 0 + movs r1, 0 + ldr r0, =0x03005000 + adds r3, r0, 0 + adds r3, 0x92 + adds r4, r0, 0 + adds r4, 0x5C +_0800FCE8: + ldrb r0, [r3] + cmp r0, 0x2 + bne _0800FCFE + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0800FCFE + lsls r0, r1 + orrs r2, r0 + lsls r0, r2, 24 + lsrs r2, r0, 24 +_0800FCFE: + adds r3, 0x14 + adds r1, 0x1 + cmp r1, 0x4 + ble _0800FCE8 + adds r0, r2, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_800FCD8 + + thumb_func_start sub_800FD14 +sub_800FD14: @ 800FD14 + push {r4,r5,lr} + lsls r0, 16 + lsrs r1, r0, 16 + ldr r5, =0x03003110 + strh r1, [r5] + movs r0, 0xF0 + lsls r0, 7 + adds r4, r5, 0 + cmp r1, r0 + beq _0800FDB0 + cmp r1, r0 + bgt _0800FD62 + movs r0, 0xBE + lsls r0, 7 + cmp r1, r0 + beq _0800FE00 + cmp r1, r0 + bgt _0800FD50 + movs r0, 0xBC + lsls r0, 6 + cmp r1, r0 + beq _0800FE20 + movs r0, 0x88 + lsls r0, 7 + cmp r1, r0 + beq _0800FE14 + b _0800FE46 + .pool +_0800FD50: + movs r0, 0xCC + lsls r0, 7 + cmp r1, r0 + beq _0800FE00 + movs r0, 0xEE + lsls r0, 7 + cmp r1, r0 + beq _0800FDB0 + b _0800FE46 +_0800FD62: + movs r0, 0xBE + lsls r0, 8 + cmp r1, r0 + beq _0800FE40 + cmp r1, r0 + bgt _0800FE46 + movs r0, 0x88 + lsls r0, 8 + cmp r1, r0 + beq _0800FD80 + movs r0, 0xA1 + lsls r0, 8 + cmp r1, r0 + beq _0800FD98 + b _0800FE46 +_0800FD80: + ldr r0, =0x03005000 + adds r1, r0, 0 + adds r1, 0x6E + ldrh r1, [r1] + strh r1, [r5, 0x2] + adds r0, 0x7D + ldrb r0, [r0] + adds r0, 0x80 + strh r0, [r5, 0x4] + b _0800FE46 + .pool +_0800FD98: + bl sub_800FC60 + lsls r0, 24 + cmp r0, 0 + beq _0800FE46 + ldr r0, =0x03005000 + adds r0, 0x5A + ldrb r0, [r0] + b _0800FE44 + .pool +_0800FDB0: + ldr r3, =0x03005000 + ldr r1, =0x00000ce2 + adds r0, r3, r1 + ldr r2, =0x00000ce3 + adds r1, r3, r2 + ldrb r2, [r0] + ldrb r0, [r1] + eors r0, r2 + ldr r1, =gUnknown_082ED695 + adds r0, r1 + ldrb r0, [r0] + adds r0, 0x1 + strb r0, [r3, 0xD] + ldrb r0, [r3, 0xD] + strh r0, [r4, 0x2] + adds r2, r4, 0x4 + movs r4, 0 + ldr r0, =0x00000cde + adds r3, r0 +_0800FDD6: + adds r1, r2, r4 + adds r0, r4, r3 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _0800FDD6 + b _0800FE46 + .pool +_0800FE00: + ldr r0, =0x03005000 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r4, 0x2] + b _0800FE46 + .pool +_0800FE14: + strh r1, [r5] + ldr r0, =0x030022c0 + ldrh r0, [r0, 0x2C] + b _0800FE44 + .pool +_0800FE20: + movs r4, 0 + ldr r3, =0x030050f2 +_0800FE24: + adds r2, r4, 0x1 + lsls r1, r2, 1 + adds r1, r5 + lsls r0, r4, 1 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r1] + lsls r2, 24 + lsrs r4, r2, 24 + cmp r4, 0x5 + bls _0800FE24 + b _0800FE46 + .pool +_0800FE40: + ldr r0, =0x03005da8 + ldrh r0, [r0] +_0800FE44: + strh r0, [r5, 0x2] +_0800FE46: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800FD14 + + thumb_func_start sub_800FE50 +sub_800FE50: @ 800FE50 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x03003110 + ldrh r0, [r0] + cmp r0, 0 + bne _0800FE76 + bl sub_8011A80 + cmp r0, 0 + bne _0800FE76 + ldr r0, =0x030050f2 + adds r1, r4, 0 + movs r2, 0xC + bl memcpy + movs r0, 0xBC + lsls r0, 6 + bl sub_800FD14 +_0800FE76: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800FE50 + + thumb_func_start sub_800FE84 +@ bool8 sub_800FE84(u32 a1, u32 size) +sub_800FE84: @ 800FE84 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r7, r0, 0 + adds r6, r1, 0 + ldr r5, =0x03005000 + ldr r0, [r5] + cmp r0, 0 + bne _0800FEB8 + ldr r0, =0x03003110 + ldrh r0, [r0] + cmp r0, 0 + bne _0800FEB8 + movs r0, 0x7C + adds r0, r5 + mov r9, r0 + ldrb r1, [r0] + mov r8, r1 + cmp r1, 0 + beq _0800FEC8 + ldr r1, =0x02022b44 + adds r1, 0x83 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0800FEB8: + movs r0, 0 + b _0800FF32 + .pool +_0800FEC8: + adds r0, r6, 0 + movs r1, 0xC + bl __umodsi3 + negs r4, r0 + orrs r4, r0 + lsrs r4, 31 + bl link_get_multiplayer_id + adds r1, r5, 0 + adds r1, 0x7D + strb r0, [r1] + movs r0, 0x1 + mov r1, r9 + strb r0, [r1] + adds r0, r6, 0 + movs r1, 0xC + bl __udivsi3 + adds r0, r4 + adds r1, r5, 0 + adds r1, 0x6E + strh r0, [r1] + adds r0, r5, 0 + adds r0, 0x6C + mov r1, r8 + strh r1, [r0] + movs r0, 0x80 + lsls r0, 1 + cmp r6, r0 + bls _0800FF0A + str r7, [r5, 0x70] + b _0800FF1C +_0800FF0A: + ldr r4, =0x020228c4 + cmp r7, r4 + beq _0800FF1A + adds r0, r4, 0 + adds r1, r7, 0 + adds r2, r6, 0 + bl memcpy +_0800FF1A: + str r4, [r5, 0x70] +_0800FF1C: + movs r0, 0x88 + lsls r0, 8 + bl sub_800FD14 + ldr r0, =0x03005000 + ldr r1, =rfufunc_80F9F44 + str r1, [r0] + adds r0, 0x5B + movs r1, 0 + strb r1, [r0] + movs r0, 0x1 +_0800FF32: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_800FE84 + + thumb_func_start rfufunc_80F9F44 +rfufunc_80F9F44: @ 800FF4C + push {r4,r5,lr} + ldr r0, =0x03003110 + ldrh r0, [r0] + cmp r0, 0 + bne _0800FFA0 + movs r5, 0x88 + lsls r5, 8 + adds r0, r5, 0 + bl sub_800FD14 + ldr r4, =0x03005000 + ldrb r0, [r4, 0xC] + cmp r0, 0x1 + bne _0800FF84 + adds r1, r4, 0 + adds r1, 0x5B + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bls _0800FFA0 + b _0800FF9C + .pool +_0800FF84: + bl link_get_multiplayer_id + ldr r1, =0x03003090 + lsls r0, 24 + lsrs r0, 20 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + cmp r0, r5 + bne _0800FFA0 +_0800FF9C: + ldr r0, =sub_800FFB0 + str r0, [r4] +_0800FFA0: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end rfufunc_80F9F44 + + thumb_func_start sub_800FFB0 +sub_800FFB0: @ 800FFB0 + push {r4-r6,lr} + ldr r0, =0x03005000 + mov r12, r0 + ldr r5, [r0, 0x70] + ldr r3, =0x03003110 + mov r2, r12 + adds r2, 0x6C + ldrh r1, [r2] + movs r4, 0x89 + lsls r4, 8 + adds r0, r4, 0 + orrs r0, r1 + strh r0, [r3] + movs r4, 0 + adds r6, r2, 0 + adds r3, 0x2 +_0800FFD0: + lsls r2, r4, 1 + ldrh r1, [r6] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, r5 + ldrb r1, [r0, 0x1] + lsls r1, 8 + ldrb r0, [r0] + orrs r0, r1 + strh r0, [r3] + adds r3, 0x2 + adds r4, 0x1 + cmp r4, 0x6 + ble _0800FFD0 + mov r0, r12 + adds r0, 0x6C + ldrh r1, [r0] + adds r1, 0x1 + strh r1, [r0] + adds r0, 0x2 + ldrh r0, [r0] + lsls r1, 16 + lsrs r1, 16 + cmp r0, r1 + bhi _08010014 + mov r0, r12 + adds r0, 0x7C + movs r1, 0 + strb r1, [r0] + ldr r0, =rfufunc_80FA020 + mov r1, r12 + str r0, [r1] +_08010014: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_800FFB0 + + thumb_func_start rfufunc_80FA020 +rfufunc_80FA020: @ 8010028 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r5, =0x03005000 + ldr r0, [r5, 0x70] + mov r8, r0 + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r0, [r5, 0xC] + cmp r0, 0 + bne _080100F0 + ldr r3, =0x03003110 + adds r2, r5, 0 + adds r2, 0x6E + ldrh r0, [r2] + subs r0, 0x1 + ldr r4, =0xffff8900 + adds r1, r4, 0 + orrs r0, r1 + strh r0, [r3] + movs r4, 0 + mov r9, r5 + ldr r0, =0x03003090 + mov r12, r0 + lsls r5, r6, 4 + adds r7, r2, 0 + adds r3, 0x2 +_08010064: + lsls r2, r4, 1 + ldrh r1, [r7] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + add r0, r8 + adds r1, r0, 0 + subs r1, 0xB + ldrb r1, [r1] + lsls r1, 8 + subs r0, 0xC + ldrb r0, [r0] + orrs r0, r1 + strh r0, [r3] + adds r3, 0x2 + adds r4, 0x1 + cmp r4, 0x6 + ble _08010064 + mov r1, r12 + adds r0, r5, r1 + ldrb r1, [r0] + mov r3, r9 + adds r0, r3, 0 + adds r0, 0x6E + ldrh r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bne _080100F4 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 2 + adds r1, r3, 0 + adds r1, 0x88 + adds r1, r0, r1 + ldr r2, =gUnknown_082ED628 + adds r0, r3 + adds r0, 0x82 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r2 + ldr r1, [r1] + ldr r0, [r0] + cmp r1, r0 + beq _080100E8 + adds r0, r6, 0 + bl sub_800F638 + ldr r1, =0x02022b44 + adds r1, 0x64 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _080100F4 + .pool +_080100E8: + movs r0, 0 + mov r4, r9 + str r0, [r4] + b _080100F4 +_080100F0: + movs r0, 0 + str r0, [r5] +_080100F4: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end rfufunc_80FA020 + + thumb_func_start sub_8010100 +sub_8010100: @ 8010100 + push {lr} + ldr r1, =0x03005000 + adds r1, 0x5A + strb r0, [r1] + movs r0, 0xA1 + lsls r0, 8 + bl sub_800FD14 + movs r0, 0x1 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8010100 + + thumb_func_start sub_801011C +sub_801011C: @ 801011C + push {lr} + bl rfu_clearAllSlot + bl sub_800C048 + ldr r1, =0x03003124 + movs r0, 0 + strb r0, [r1] + ldr r2, =0x03005000 + adds r3, r2, 0 + adds r3, 0xEF + movs r1, 0 + movs r0, 0x1 + strb r0, [r3] + str r1, [r2] + pop {r0} + bx r0 + .pool + thumb_func_end sub_801011C + + thumb_func_start sub_8010148 +sub_8010148: @ 8010148 + push {lr} + ldr r0, =0x03007890 + ldr r0, [r0] + ldrb r1, [r0, 0x2] + ldrb r0, [r0, 0x3] + orrs r0, r1 + bl rfu_REQ_disconnect + bl rfu_waitREQComplete + bl sub_801011C + pop {r0} + bx r0 + .pool + thumb_func_end sub_8010148 + + thumb_func_start sub_8010168 +sub_8010168: @ 8010168 + push {r4,lr} + ldr r4, =0x03005000 + ldrb r0, [r4, 0xC] + cmp r0, 0 + bne _08010188 + bl sub_800D630 + ldr r0, =0x00000ce4 + adds r1, r4, r0 + movs r0, 0x2 + strb r0, [r1] + b _0801018C + .pool +_08010188: + ldr r0, =sub_8010148 + str r0, [r4] +_0801018C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8010168 + + thumb_func_start sub_8010198 +sub_8010198: @ 8010198 + push {lr} + bl sub_800D630 + ldr r2, =0x03005000 + ldr r0, =0x00000ce4 + adds r1, r2, r0 + movs r0, 0x1 + strb r0, [r1] + ldr r0, =0x03007890 + ldr r1, [r0] + ldrb r0, [r1, 0x2] + ldrb r1, [r1, 0x3] + orrs r0, r1 + ldr r1, =0x00000ce3 + adds r2, r1 + strb r0, [r2] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8010198 + + thumb_func_start sub_80101CC +sub_80101CC: @ 80101CC + push {r4,r5,lr} + ldr r0, =0x03005000 + ldrb r5, [r0, 0xD] + movs r2, 0 + movs r1, 0 + adds r3, r0, 0 + adds r4, r3, 0 + adds r4, 0xE4 +_080101DC: + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _080101E6 + adds r2, 0x1 +_080101E6: + adds r1, 0x1 + cmp r1, 0x4 + ble _080101DC + cmp r2, r5 + bne _08010220 + ldr r2, =0x02022fec + ldr r0, [r2] + movs r1, 0x21 + negs r1, r1 + ands r0, r1 + str r0, [r2] + ldrb r0, [r3, 0xC] + cmp r0, 0 + bne _0801021C + adds r0, r3, 0 + adds r0, 0xEE + ldrb r1, [r0] + movs r1, 0x3 + strb r1, [r0] + bl sub_8010168 + b _08010220 + .pool +_0801021C: + ldr r0, =sub_8010168 + str r0, [r3] +_08010220: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80101CC + + thumb_func_start sub_801022C +sub_801022C: @ 801022C + push {r4,lr} + ldr r0, =0x03003110 + ldrh r0, [r0] + cmp r0, 0 + bne _0801024E + ldr r4, =0x03005000 + ldr r1, =0x00000ce8 + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0801024E + movs r0, 0xBE + lsls r0, 7 + bl sub_800FD14 + ldr r0, =sub_80101CC + str r0, [r4] +_0801024E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801022C + + thumb_func_start sub_8010264 +sub_8010264: @ 8010264 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, =0x03005000 + ldr r0, [r2] + cmp r0, 0 + bne _08010284 + ldr r1, =0x00000cd9 + adds r0, r2, r1 + movs r1, 0x1 + strb r1, [r0] + ldr r0, =sub_801022C + str r0, [r2] + adds r0, r3, 0 + bl remove_task +_08010284: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8010264 + + thumb_func_start task_add_05_task_del_08FA224_when_no_RfuFunc +task_add_05_task_del_08FA224_when_no_RfuFunc: @ 8010294 + push {r4,lr} + ldr r4, =sub_8010264 + adds r0, r4, 0 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _080102AC + adds r0, r4, 0 + movs r1, 0x5 + bl AddTask +_080102AC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task_add_05_task_del_08FA224_when_no_RfuFunc + + thumb_func_start sub_80102B8 +sub_80102B8: @ 80102B8 + push {r4,r5,lr} + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + beq _080102E6 + ldr r1, =0x03005000 + ldr r2, =0x000009e6 + adds r0, r1, r2 + ldrb r0, [r0] + adds r4, r0, 0 + cmp r4, 0 + bne _080102E6 + adds r5, r1, 0 + adds r5, 0xFE + ldrh r0, [r5] + cmp r0, 0x3C + bls _080102E6 + movs r0, 0xCC + lsls r0, 7 + bl sub_800FD14 + strh r4, [r5] +_080102E6: + bl sub_8009FCC + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0 + cmp r1, r2 + bcs _08010312 + ldr r0, =0x03005000 + adds r3, r0, 0 + adds r3, 0xE9 + ldrb r0, [r3] + cmp r0, 0 + beq _08010312 +_08010300: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, r2 + bcs _08010312 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _08010300 +_08010312: + ldr r4, =0x03005000 + cmp r1, r2 + bne _0801033E + movs r1, 0 + adds r3, r4, 0 + adds r3, 0xE9 + movs r2, 0 +_08010320: + adds r0, r1, r3 + strb r2, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x4 + bls _08010320 + movs r1, 0x80 + lsls r1, 1 + adds r0, r4, r1 + ldrh r1, [r0] + adds r1, 0x1 + movs r2, 0 + strh r1, [r0] + str r2, [r4] +_0801033E: + adds r1, r4, 0 + adds r1, 0xFE + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80102B8 + + thumb_func_start sub_8010358 +sub_8010358: @ 8010358 + push {r4,lr} + ldr r4, =0x03005000 + ldr r1, =0x000009e6 + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0801037A + ldr r0, =0x03003110 + ldrh r0, [r0] + cmp r0, 0 + bne _0801037A + movs r0, 0xCC + lsls r0, 7 + bl sub_800FD14 + ldr r0, =sub_80102B8 + str r0, [r4] +_0801037A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8010358 + + thumb_func_start sub_8010390 +sub_8010390: @ 8010390 + push {r4,lr} + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + beq _080103CC + ldr r4, =0x03005000 + ldr r1, =0x000009e6 + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0801041E + ldr r0, =0x03003110 + ldrh r0, [r0] + cmp r0, 0 + bne _0801041E + movs r0, 0xCC + lsls r0, 7 + bl sub_800FD14 + ldr r0, =sub_80102B8 + b _0801041C + .pool +_080103CC: + bl sub_8009FCC + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0x1 + cmp r1, r2 + bcs _080103FA + ldr r3, =0x03005000 + adds r0, r3, 0 + adds r0, 0xEA + ldrb r0, [r0] + cmp r0, 0 + beq _080103FA + adds r3, 0xE9 +_080103E8: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, r2 + bcs _080103FA + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _080103E8 +_080103FA: + cmp r1, r2 + bne _0801041E + ldr r4, =0x03005000 + ldr r1, =0x000009e6 + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0801041E + ldr r0, =0x03003110 + ldrh r0, [r0] + cmp r0, 0 + bne _0801041E + movs r0, 0xCC + lsls r0, 7 + bl sub_800FD14 + ldr r0, =sub_8010358 +_0801041C: + str r0, [r4] +_0801041E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8010390 + + thumb_func_start sub_8010434 +sub_8010434: @ 8010434 + push {lr} + ldr r1, =0x03005000 + ldr r2, [r1] + cmp r2, 0 + bne _08010448 + ldr r0, =sub_8010390 + str r0, [r1] + adds r0, r1, 0 + adds r0, 0xFE + strh r2, [r0] +_08010448: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8010434 + + thumb_func_start sub_8010454 +sub_8010454: @ 8010454 + push {r4,lr} + adds r3, r0, 0 + ldr r1, =gUnknown_082ED6E0 + ldrh r0, [r1] + cmp r0, r3 + beq _08010482 + ldr r4, =0x0000ffff + adds r2, r1, 0 +_08010464: + ldrh r0, [r2] + cmp r0, r4 + bne _08010478 + movs r0, 0 + b _08010484 + .pool +_08010478: + adds r1, 0x2 + adds r2, 0x2 + ldrh r0, [r1] + cmp r0, r3 + bne _08010464 +_08010482: + movs r0, 0x1 +_08010484: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8010454 + + thumb_func_start sub_801048C +sub_801048C: @ 801048C + push {lr} + cmp r0, 0 + beq _080104A0 + movs r1, 0x96 + lsls r1, 2 + movs r0, 0x1 + bl sub_800D550 + movs r0, 0 + b _080104AC +_080104A0: + movs r0, 0 + movs r1, 0 + bl sub_800D550 + lsls r0, 24 + lsrs r0, 24 +_080104AC: + pop {r1} + bx r1 + thumb_func_end sub_801048C + + thumb_func_start sub_80104B0 +sub_80104B0: @ 80104B0 + push {lr} + ldr r0, =0x03005000 + ldr r1, =0x00000cd9 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + movs r0, 0 + bl sub_800C27C + pop {r0} + bx r0 + .pool + thumb_func_end sub_80104B0 + + thumb_func_start rfu_get_multiplayer_id +rfu_get_multiplayer_id: @ 80104D0 + push {lr} + ldr r1, =0x03005000 + ldrb r0, [r1, 0xC] + cmp r0, 0x1 + beq _080104EC + ldr r2, =0x00000cce + adds r0, r1, r2 + ldrb r0, [r0] + b _080104EE + .pool +_080104EC: + movs r0, 0 +_080104EE: + pop {r1} + bx r1 + thumb_func_end rfu_get_multiplayer_id + + thumb_func_start sub_80104F4 +sub_80104F4: @ 80104F4 + ldr r0, =0x03005000 + ldrb r0, [r0, 0xD] + bx lr + .pool + thumb_func_end sub_80104F4 + + thumb_func_start sub_8010500 +sub_8010500: @ 8010500 + push {lr} + ldr r2, =0x03005000 + adds r0, r2, 0 + adds r0, 0xF1 + ldrb r0, [r0] + cmp r0, 0x2 + bne _08010518 + movs r0, 0 + b _08010524 + .pool +_08010518: + movs r1, 0 + ldr r0, [r2] + cmp r0, 0 + bne _08010522 + movs r1, 0x1 +_08010522: + adds r0, r1, 0 +_08010524: + pop {r1} + bx r1 + thumb_func_end sub_8010500 + + thumb_func_start sub_8010528 +sub_8010528: @ 8010528 + push {lr} + ldr r0, =0x03005000 + ldr r0, [r0] + cmp r0, 0 + beq _08010536 + bl _call_via_r0 +_08010536: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8010528 + + thumb_func_start sub_8010540 +sub_8010540: @ 8010540 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r7, 0 + movs r5, 0 + ldr r6, =0x03005000 + ldr r0, =0x00000c3e + adds r0, r6 + mov r8, r0 +_08010552: + ldr r1, =0x00000cd1 + adds r0, r6, r1 + adds r4, r5, r0 + ldrb r0, [r4] + subs r0, 0x5 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _080105DA + ldr r1, =0x03007880 + lsls r0, r5, 2 + adds r0, r1 + ldr r0, [r0] + ldrh r0, [r0, 0x34] + cmp r0, 0x46 + beq _08010576 + cmp r0, 0x48 + bne _080105C0 +_08010576: + ldr r2, =0x00000cd5 + adds r0, r6, r2 + adds r1, r5, r0 + ldrb r0, [r1] + cmp r0, 0x8 + bne _080105DA + movs r0, 0x9 + strb r0, [r4] + movs r0, 0xA + strb r0, [r1] + lsls r1, r5, 24 + lsrs r1, 24 + movs r0, 0x8 + bl rfu_clearSlot + movs r0, 0x80 + lsls r0, 17 + lsls r0, r5 + lsrs r0, 24 + movs r1, 0x8 + adds r2, r4, 0 + movs r3, 0x1 + bl rfu_NI_setSendData + movs r7, 0x1 + b _080105DA + .pool +_080105C0: + mov r2, r8 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ldrh r0, [r0, 0x34] + cmp r0, 0x47 + bne _080105DA + lsls r1, r5, 24 + lsrs r1, 24 + movs r0, 0x8 + bl rfu_clearSlot +_080105DA: + adds r5, 0x1 + cmp r5, 0x3 + ble _08010552 + adds r0, r7, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8010540 + + thumb_func_start sub_80105EC +sub_80105EC: @ 80105EC + push {r4-r6,lr} + movs r3, 0 + movs r1, 0 + ldr r5, =0x03005cd5 + movs r6, 0x1 + movs r4, 0 +_080105F8: + adds r2, r1, r5 + ldrb r0, [r2] + cmp r0, 0xB + bne _0801060C + adds r0, r6, 0 + lsls r0, r1 + orrs r3, r0 + lsls r0, r3, 24 + lsrs r3, r0, 24 + strb r4, [r2] +_0801060C: + adds r1, 0x1 + cmp r1, 0x3 + ble _080105F8 + cmp r3, 0 + beq _08010620 + adds r0, r3, 0 + bl rfu_REQ_disconnect + bl rfu_waitREQComplete +_08010620: + movs r1, 0 + ldr r2, =0x03005cd5 +_08010624: + adds r0, r1, r2 + ldrb r0, [r0] + subs r0, 0xA + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0801063C + movs r0, 0x1 + b _08010644 + .pool +_0801063C: + adds r1, 0x1 + cmp r1, 0x3 + ble _08010624 + movs r0, 0 +_08010644: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80105EC + + thumb_func_start sub_801064C +sub_801064C: @ 801064C + push {lr} + adds r2, r0, 0 + adds r0, r1, 0 + lsls r2, 16 + lsrs r2, 16 + adds r1, r2, 0 + bl sub_8011CE4 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xFF + beq _08010680 + ldr r0, =0x03005000 + ldr r2, =0x00000cd1 + adds r0, r2 + adds r0, r1, r0 + ldrb r0, [r0] + cmp r0, 0x9 + beq _08010680 + movs r0, 0 + b _08010682 + .pool +_08010680: + movs r0, 0x1 +_08010682: + pop {r1} + bx r1 + thumb_func_end sub_801064C + + thumb_func_start sub_8010688 +sub_8010688: @ 8010688 + push {r4-r6,lr} + adds r6, r0, 0 + adds r0, r2, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r1, 16 + lsrs r1, 16 + bl sub_8011CE4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =0x03005000 + ldr r0, =0x00000cd1 + adds r5, r0 + adds r5, r4, r5 + strb r6, [r5] + movs r0, 0x4 + adds r1, r4, 0 + bl rfu_clearSlot + movs r0, 0x80 + lsls r0, 17 + lsls r0, r4 + lsrs r0, 24 + movs r1, 0x8 + adds r2, r5, 0 + movs r3, 0x1 + bl rfu_NI_setSendData + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8010688 + + thumb_func_start sub_80106D4 +sub_80106D4: @ 80106D4 + push {r4,r5,lr} + ldr r4, =0x03005000 + ldr r0, =0x00000c85 + adds r5, r4, r0 + movs r0, 0x8 + strb r0, [r5] + ldr r0, =0x00000c3e + adds r4, r0 + ldrb r1, [r4] + movs r0, 0x4 + bl rfu_clearSlot + ldrb r1, [r4] + movs r0, 0x80 + lsls r0, 17 + lsls r0, r1 + lsrs r0, 24 + movs r1, 0x8 + adds r2, r5, 0 + movs r3, 0x1 + bl rfu_NI_setSendData + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80106D4 + + thumb_func_start sub_8010714 +sub_8010714: @ 8010714 + push {lr} + adds r2, r0, 0 + adds r0, r1, 0 + lsls r2, 16 + lsrs r2, 16 + adds r1, r2, 0 + bl sub_8011CE4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _08010730 + movs r0, 0x2 + b _0801074A +_08010730: + ldr r1, =0x03007880 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ldrh r0, [r0] + cmp r0, 0 + beq _08010748 + movs r0, 0 + b _0801074A + .pool +_08010748: + movs r0, 0x1 +_0801074A: + pop {r1} + bx r1 + thumb_func_end sub_8010714 + + thumb_func_start sub_8010750 +sub_8010750: @ 8010750 + push {r4,r5,lr} + bl sub_8010540 + movs r4, 0 + ldr r0, =0x03005000 + ldr r1, =0x00000cd5 + adds r5, r0, r1 +_0801075E: + ldr r1, =0x03007880 + lsls r0, r4, 2 + adds r0, r1 + ldr r0, [r0] + ldrh r0, [r0] + subs r0, 0x26 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _08010788 + adds r1, r4, r5 + ldrb r0, [r1] + cmp r0, 0xA + bne _0801077E + movs r0, 0xB + strb r0, [r1] +_0801077E: + lsls r1, r4, 24 + lsrs r1, 24 + movs r0, 0x4 + bl rfu_clearSlot +_08010788: + adds r4, 0x1 + cmp r4, 0x3 + ble _0801075E + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8010750 + + thumb_func_start sub_80107A0 +sub_80107A0: @ 80107A0 + push {r4,r5,lr} + movs r4, 0 + ldr r1, =0x03005000 + ldr r2, =0x00000c85 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x8 + bne _080107DA + ldr r2, =0x03007880 + ldr r0, =0x00000c3e + adds r1, r0 + ldrb r0, [r1] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ldrh r0, [r0] + cmp r0, 0x26 + beq _080107D2 + ldrb r0, [r1] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ldrh r0, [r0] + cmp r0, 0x27 + bne _080107DA +_080107D2: + ldrb r1, [r1] + movs r0, 0x4 + bl rfu_clearSlot +_080107DA: + ldr r2, =0x03007880 + ldr r5, =0x03005000 + ldr r0, =0x00000c3e + adds r1, r5, r0 + ldrb r0, [r1] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ldrh r0, [r0, 0x34] + cmp r0, 0x46 + beq _080107FE + ldrb r0, [r1] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ldrh r0, [r0, 0x34] + cmp r0, 0x48 + bne _0801082C +_080107FE: + ldrb r1, [r1] + movs r0, 0x8 + bl rfu_clearSlot + ldr r2, =0x00000c86 + adds r4, r5, r2 + ldrb r0, [r4] + movs r1, 0 + bl sub_8011A64 + ldrb r4, [r4] + b _08010844 + .pool +_0801082C: + ldrb r0, [r1] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ldrh r0, [r0, 0x34] + cmp r0, 0x47 + bne _08010844 + ldrb r1, [r1] + movs r0, 0x8 + bl rfu_clearSlot + movs r4, 0x6 +_08010844: + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80107A0 + + thumb_func_start sub_801084C +sub_801084C: @ 801084C + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r5, =0x03005000 + adds r0, r5, 0 + adds r0, 0xF1 + ldrb r0, [r0] + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _08010872 + ldr r0, =0x00000ce8 + adds r1, r5, r0 + movs r0, 0 + strb r0, [r1] + adds r0, r6, 0 + bl remove_task +_08010872: + ldr r2, =0x03005e00 + lsls r1, r6, 2 + adds r0, r1, r6 + lsls r0, 3 + adds r4, r0, r2 + movs r2, 0x8 + ldrsh r0, [r4, r2] + adds r7, r1, 0 + cmp r0, 0x3 + beq _0801091C + cmp r0, 0x3 + bgt _080108A4 + cmp r0, 0x1 + beq _080108CC + cmp r0, 0x1 + bgt _08010918 + cmp r0, 0 + beq _080108B6 + b _080109D2 + .pool +_080108A4: + cmp r0, 0x5 + beq _08010950 + cmp r0, 0x5 + blt _0801093E + cmp r0, 0x6 + beq _08010984 + cmp r0, 0x65 + beq _08010904 + b _080109D2 +_080108B6: + bl sub_800FC60 + lsls r0, 24 + cmp r0, 0 + bne _080108C2 + b _080109D2 +_080108C2: + bl sub_800A5B4 + bl sub_800B348 + b _08010948 +_080108CC: + ldrb r0, [r5, 0xC] + cmp r0, 0x1 + bne _0801090C + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _080108E8 + movs r0, 0xF0 + lsls r0, 7 + bl sub_800FD14 + b _080108F0 + .pool +_080108E8: + movs r0, 0xEE + lsls r0, 7 + bl sub_800FD14 +_080108F0: + ldr r0, =0x03005e00 + adds r1, r7, r6 + lsls r1, 3 + adds r1, r0 + movs r0, 0x65 + strh r0, [r1, 0x8] + b _080109D2 + .pool +_08010904: + ldr r0, =0x03003110 + ldrh r0, [r0] + cmp r0, 0 + bne _080109D2 +_0801090C: + movs r0, 0x2 + strh r0, [r4, 0x8] + b _080109D2 + .pool +_08010918: + ldrb r0, [r5, 0xD] + b _08010944 +_0801091C: + ldrb r0, [r5, 0xC] + cmp r0, 0x1 + bne _08010948 + bl sub_800FC60 + lsls r0, 24 + cmp r0, 0 + beq _080109D2 + adds r1, r5, 0 + adds r1, 0x5A + movs r0, 0 + strb r0, [r1] + movs r0, 0xA1 + lsls r0, 8 + bl sub_800FD14 + b _08010948 +_0801093E: + bl sub_800FC88 + lsls r0, 24 +_08010944: + cmp r0, 0 + beq _080109D2 +_08010948: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080109D2 +_08010950: + movs r4, 0 + ldrb r0, [r5, 0xD] + cmp r4, r0 + bge _0801096E +_08010958: + adds r0, r4, 0 + bl sub_800B3A4 + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_800F728 + adds r4, 0x1 + ldrb r2, [r5, 0xD] + cmp r4, r2 + blt _08010958 +_0801096E: + ldr r0, =0x03005e00 + adds r1, r7, r6 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _080109D2 + .pool +_08010984: + adds r0, r6, 0 + bl remove_task + ldr r1, =0x03003124 + movs r0, 0x1 + strb r0, [r1] + ldr r0, =0x00000ce8 + adds r1, r5, r0 + movs r0, 0 + strb r0, [r1] + movs r1, 0x96 + lsls r1, 2 + movs r0, 0x1 + bl sub_800D550 + ldr r2, =0x00000ce6 + adds r1, r5, r2 + ldrb r0, [r1] + cmp r0, 0 + beq _080109D2 + movs r4, 0 + adds r2, r1, 0 + movs r3, 0x1 + ldr r0, =0x00000ce5 + adds r5, r0 +_080109B6: + ldrb r0, [r2] + asrs r0, r4 + ands r0, r3 + cmp r0, 0 + beq _080109CC + adds r0, r3, 0 + lsls r0, r4 + strb r0, [r5] + ldrb r1, [r2] + eors r0, r1 + strb r0, [r2] +_080109CC: + adds r4, 0x1 + cmp r4, 0x3 + ble _080109B6 +_080109D2: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801084C + + thumb_func_start sub_80109E8 +sub_80109E8: @ 80109E8 + push {r4,r5,lr} + lsls r0, 16 + lsrs r2, r0, 16 + movs r1, 0 + movs r5, 0x1 + ldr r4, =0x03005cde + movs r3, 0 +_080109F6: + adds r0, r2, 0 + asrs r0, r1 + ands r0, r5 + cmp r0, 0 + beq _08010A04 + adds r0, r1, r4 + strb r3, [r0] +_08010A04: + adds r1, 0x1 + cmp r1, 0x3 + ble _080109F6 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80109E8 + + thumb_func_start sub_8010A14 +sub_8010A14: @ 8010A14 + push {r4-r7,lr} + adds r2, r0, 0 + ldr r1, =0x03005000 + ldrb r0, [r2, 0xF] + strb r0, [r1, 0xD] + movs r4, 0 + ldr r0, =0x00000cde + adds r5, r1, r0 + adds r3, r2, 0 + adds r3, 0x10 +_08010A28: + adds r0, r4, r5 + adds r1, r3, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x3 + ble _08010A28 + adds r6, r2, 0 + ldr r5, =0x020229e8 + movs r4, 0x4 +_08010A3C: + adds r0, r5, 0 + adds r1, r6, 0 + adds r1, 0x14 + ldm r1!, {r2,r3,r7} + stm r0!, {r2,r3,r7} + ldm r1!, {r2,r3,r7} + stm r0!, {r2,r3,r7} + ldr r1, [r1] + str r1, [r0] + adds r0, r5, 0 + bl sub_800B524 + adds r6, 0x1C + adds r5, 0x1C + subs r4, 0x1 + cmp r4, 0 + bge _08010A3C + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8010A14 + + thumb_func_start sub_8010A70 +sub_8010A70: @ 8010A70 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldr r0, =gUnknown_082ED7EC + adds r1, r4, 0 + bl strcmp + adds r5, r0, 0 + cmp r5, 0 + bne _08010A9C + adds r0, r4, 0 + bl sub_8010A14 + mov r0, sp + strh r5, [r0] + ldr r2, =0x0100007e + adds r1, r4, 0 + bl CpuSet + movs r0, 0 + bl sub_800A5EC +_08010A9C: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8010A70 + + thumb_func_start sub_8010AAC +sub_8010AAC: @ 8010AAC + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r3, =0x03005000 + ldr r2, =gUnknown_082ED68C + ldr r1, =0x00000ce9 + adds r0, r3, r1 + ldrb r1, [r0] + adds r1, r2 + ldr r2, =0x00000cde + adds r0, r3, r2 + ldrb r1, [r1] + adds r0, r1 + ldrb r4, [r0] + adds r0, r3, 0 + adds r0, 0xF1 + ldrb r0, [r0] + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _08010AE8 + ldr r5, =0x00000ce8 + adds r1, r3, r5 + movs r0, 0 + strb r0, [r1] + adds r0, r6, 0 + bl remove_task +_08010AE8: + ldr r0, =0x03005e00 + lsls r2, r6, 2 + adds r1, r2, r6 + lsls r1, 3 + adds r1, r0 + movs r3, 0x8 + ldrsh r1, [r1, r3] + adds r3, r0, 0 + adds r7, r2, 0 + cmp r1, 0x5 + bls _08010B00 + b _08010CF0 +_08010B00: + lsls r0, r1, 2 + ldr r1, =_08010B28 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08010B28: + .4byte _08010B40 + .4byte _08010B60 + .4byte _08010B78 + .4byte _08010BC0 + .4byte _08010C0A + .4byte _08010C94 +_08010B40: + ldr r0, =0x03003110 + ldrh r0, [r0] + cmp r0, 0 + beq _08010B4A + b _08010CF0 +_08010B4A: + adds r0, r4, 0 + bl sub_800A5EC + movs r0, 0xF0 + lsls r0, 7 + bl sub_800FD14 + b _08010C4A + .pool +_08010B60: + ldr r0, =0x03003110 + ldrh r0, [r0] + cmp r0, 0 + beq _08010B6A + b _08010CF0 +_08010B6A: + adds r1, r7, r6 + lsls r1, 3 + adds r1, r3 + b _08010C52 + .pool +_08010B78: + bl sub_800A550 + lsls r0, 24 + lsrs r0, 24 + asrs r0, r4 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08010B8C + b _08010CF0 +_08010B8C: + adds r0, r4, 0 + bl sub_800A5EC + lsls r2, r4, 8 + ldr r0, =0x020223c4 + adds r2, r0 + ldr r1, =0x020229e8 + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r0, r1 + adds r1, r0, 0 + adds r2, 0x10 + ldm r2!, {r3-r5} + stm r1!, {r3-r5} + ldm r2!, {r3-r5} + stm r1!, {r3-r5} + ldr r2, [r2] + str r2, [r1] + bl sub_800B524 + b _08010C4A + .pool +_08010BC0: + ldr r5, =0x020228c4 + adds r1, r5, 0 + ldr r0, =gUnknown_082ED7EC + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldrh r2, [r0] + strh r2, [r1] + ldrb r0, [r0, 0x2] + strb r0, [r1, 0x2] + ldr r1, =0x03005000 + ldrb r0, [r1, 0xD] + strb r0, [r5, 0xF] + movs r2, 0 + adds r4, r5, 0 + adds r4, 0x10 + ldr r0, =0x00000cde + adds r3, r1, r0 +_08010BE2: + adds r0, r4, r2 + adds r1, r2, r3 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x3 + ble _08010BE2 + ldr r1, =0x020229e8 + adds r0, r5, 0 + adds r0, 0x14 + movs r2, 0x8C + bl memcpy + ldr r0, =0x03005e00 + adds r1, r7, r6 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_08010C0A: + ldr r5, =0x020228c4 + ldr r1, =0x03005000 + ldrb r0, [r1, 0xD] + strb r0, [r5, 0xF] + movs r2, 0 + ldr r3, =0x020229e8 + mov r12, r3 + adds r4, r5, 0 + adds r4, 0x10 + ldr r0, =0x00000cde + adds r3, r1, r0 +_08010C20: + adds r0, r4, r2 + adds r1, r2, r3 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x3 + ble _08010C20 + adds r0, r5, 0 + adds r0, 0x14 + mov r1, r12 + movs r2, 0x8C + bl memcpy + ldr r1, =0x020228c4 + movs r0, 0 + movs r2, 0xA0 + bl link_0800A448 + lsls r0, 24 + cmp r0, 0 + beq _08010CF0 +_08010C4A: + ldr r0, =0x03005e00 + adds r1, r7, r6 + lsls r1, 3 + adds r1, r0 +_08010C52: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _08010CF0 + .pool +_08010C74: + adds r0, r3, 0 + lsls r0, r2 + ldr r2, =0x00000ce5 + adds r1, r5, r2 + strb r0, [r1] + ldrb r1, [r4] + eors r0, r1 + strb r0, [r4] + ldr r4, =0x00000ce8 + adds r0, r5, r4 + strb r3, [r0] + b _08010CEA + .pool +_08010C94: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08010CF0 + bl sub_800A550 + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _08010CF0 + mov r0, sp + movs r4, 0 + strh r4, [r0] + ldr r1, =0x020223c4 + ldr r2, =0x0100007e + bl CpuSet + movs r0, 0 + bl sub_800A5EC + ldr r1, =0x03005000 + ldr r5, =0x00000ce8 + adds r0, r1, r5 + strb r4, [r0] + ldr r0, =0x00000ce6 + adds r3, r1, r0 + ldrb r0, [r3] + cmp r0, 0 + beq _08010CEA + movs r2, 0 + adds r5, r1, 0 + adds r4, r3, 0 + ldrb r1, [r4] + movs r3, 0x1 +_08010CDA: + adds r0, r1, 0 + asrs r0, r2 + ands r0, r3 + cmp r0, 0 + bne _08010C74 + adds r2, 0x1 + cmp r2, 0x3 + ble _08010CDA +_08010CEA: + adds r0, r6, 0 + bl remove_task +_08010CF0: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8010AAC + + thumb_func_start sub_8010D0C +sub_8010D0C: @ 8010D0C + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r6, =0x03005000 + adds r0, r6, 0 + adds r0, 0xF1 + ldrb r0, [r0] + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _08010D2A + adds r0, r5, 0 + bl remove_task +_08010D2A: + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _08010D70 + cmp r0, 0x1 + bgt _08010D50 + cmp r0, 0 + beq _08010D56 + b _08010DA6 + .pool +_08010D50: + cmp r0, 0x2 + beq _08010D82 + b _08010DA6 +_08010D56: + ldrb r0, [r6, 0xD] + cmp r0, 0 + beq _08010DA6 + bl sub_800B348 + ldr r1, =0x020228c4 + movs r0, 0 + movs r2, 0x3C + bl link_0800A448 + b _08010D7A + .pool +_08010D70: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08010DA6 +_08010D7A: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08010DA6 +_08010D82: + bl sub_800A550 + movs r4, 0x1 + adds r1, r4, 0 + ands r1, r0 + cmp r1, 0 + beq _08010DA6 + ldr r0, =0x020223c4 + bl sub_8010A14 + movs r0, 0 + bl sub_800A5EC + ldr r0, =0x03003124 + strb r4, [r0] + adds r0, r5, 0 + bl remove_task +_08010DA6: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8010D0C + + thumb_func_start sub_8010DB4 +sub_8010DB4: @ 8010DB4 + push {r4-r7,lr} + ldr r0, =0x03005000 + adds r1, r0, 0 + adds r1, 0xEE + ldrb r1, [r1] + adds r3, r0, 0 + cmp r1, 0x1 + bne _08010E5C + ldr r2, =0x03004140 + ldrb r0, [r2, 0x2] + cmp r0, 0 + bne _08010E5C + ldr r0, =0x030022c0 + ldr r1, [r0, 0x4] + ldr r0, =sub_8018438 + cmp r1, r0 + beq _08010DDE + ldr r0, [r2, 0x3C] + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _08010DE4 +_08010DDE: + ldr r1, =0x030030fc + movs r0, 0x2 + strb r0, [r1] +_08010DE4: + ldr r4, =c2_800ACD4 + adds r0, r4, 0 + bl SetMainCallback2 + ldr r0, =0x030022c0 + str r4, [r0, 0x8] + ldr r5, =0x03005000 + ldrh r0, [r5, 0xA] + lsls r4, r0, 16 + ldrh r0, [r5, 0x10] + lsls r0, 8 + orrs r4, r0 + ldrh r0, [r5, 0x12] + orrs r4, r0 + ldr r1, =0x000009e6 + adds r0, r5, r1 + ldrb r0, [r0] + adds r7, r0, 0 + ldr r1, =0x00000c1a + adds r0, r5, r1 + ldrb r0, [r0] + adds r6, r0, 0 + bl sub_8011A74 + movs r3, 0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08010E20 + movs r3, 0x1 +_08010E20: + adds r0, r4, 0 + adds r1, r7, 0 + adds r2, r6, 0 + bl sub_800AF18 + adds r0, r5, 0 + adds r0, 0xEE + ldrb r1, [r0] + movs r1, 0x2 + strb r1, [r0] + bl sub_80097E8 + b _08010E8E + .pool +_08010E5C: + ldr r1, =0x00000c1b + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08010E70 + ldr r1, =0x000009e7 + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08010E8E +_08010E70: + ldr r0, =0x03004140 + ldrb r0, [r0, 0x2] + cmp r0, 0 + beq _08010E7C + bl sub_800D630 +_08010E7C: + movs r4, 0xE0 + lsls r4, 7 + movs r0, 0x1 + adds r1, r4, 0 + bl sub_8011A64 + adds r0, r4, 0 + bl sub_8011170 +_08010E8E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8010DB4 + + thumb_func_start rfu_REQ_recvData_then_sendData +rfu_REQ_recvData_then_sendData: @ 8010EA0 + push {lr} + ldr r0, =0x03004140 + ldrb r0, [r0, 0x6] + cmp r0, 0x1 + bne _08010EB8 + bl rfu_REQ_recvData + bl rfu_waitREQComplete + movs r0, 0 + bl rfu_REQ_sendData_wrapper +_08010EB8: + pop {r0} + bx r0 + .pool + thumb_func_end rfu_REQ_recvData_then_sendData + + thumb_func_start sub_8010EC0 +sub_8010EC0: @ 8010EC0 + push {r4,r5,lr} + movs r5, 0 + ldr r4, =0x03005000 + ldr r1, =0x00000ccd + adds r0, r4, r1 + strb r5, [r0] + bl GenerateRandomNumber2 + lsls r0, 16 + lsrs r0, 16 + bl sub_800C54C + adds r0, r4, 0 + adds r0, 0xEF + ldrb r0, [r0] + cmp r0, 0 + bne _08010F14 + ldrb r0, [r4, 0xC] + cmp r0, 0x1 + beq _08010F02 + cmp r0, 0x1 + bgt _08010EFC + cmp r0, 0 + beq _08010F08 + b _08010F14 + .pool +_08010EFC: + cmp r0, 0x2 + beq _08010F10 + b _08010F14 +_08010F02: + bl sub_800F0F8 + b _08010F14 +_08010F08: + bl sub_800F4F0 + adds r5, r0, 0 + b _08010F14 +_08010F10: + bl rfu_REQ_recvData_then_sendData +_08010F14: + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8010EC0 + + thumb_func_start sub_8010F1C +sub_8010F1C: @ 8010F1C + push {r4,lr} + movs r4, 0 + ldr r1, =0x03005000 + adds r0, r1, 0 + adds r0, 0xEF + ldrb r0, [r0] + cmp r0, 0 + bne _08010F3C + ldrb r0, [r1, 0xC] + cmp r0, 0x1 + bne _08010F38 + bl sub_800F1E0 + adds r4, r0, 0 +_08010F38: + bl sub_8010DB4 +_08010F3C: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8010F1C + + thumb_func_start sub_8010F48 +sub_8010F48: @ 8010F48 + push {lr} + ldr r0, =0x02022b22 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + pop {r0} + bx r0 + .pool + thumb_func_end sub_8010F48 + + thumb_func_start sub_8010F60 +sub_8010F60: @ 8010F60 + push {r4,lr} + ldr r4, =0x02022b14 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0xD + bl memset + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_800DD94 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8010F60 + + thumb_func_start sub_8010F84 +sub_8010F84: @ 8010F84 + push {r4,lr} + adds r4, r0, 0 + adds r3, r1, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x02022b14 + adds r1, r4, 0 + bl sub_800DD94 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8010F84 + + thumb_func_start sub_8010FA0 +sub_8010FA0: @ 8010FA0 + push {r4,r5,lr} + ldr r5, =0x02022b14 + movs r4, 0x1 + ands r0, r4 + lsls r0, 4 + ldrb r3, [r5] + movs r2, 0x11 + negs r2, r2 + ands r2, r3 + orrs r2, r0 + ands r1, r4 + lsls r1, 5 + movs r0, 0x21 + negs r0, r0 + ands r2, r0 + orrs r2, r1 + strb r2, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8010FA0 + + thumb_func_start sub_8010FCC +sub_8010FCC: @ 8010FCC + push {r4,r5,lr} + ldr r5, =0x02022b14 + lsls r0, 2 + ldrb r4, [r5, 0x9] + movs r3, 0x3 + ands r3, r4 + orrs r3, r0 + strb r3, [r5, 0x9] + ldr r3, =0x000003ff + adds r0, r3, 0 + ands r1, r0 + ldrh r3, [r5, 0x8] + ldr r0, =0xfffffc00 + ands r0, r3 + orrs r0, r1 + strh r0, [r5, 0x8] + lsls r2, 1 + ldrb r1, [r5, 0xB] + movs r0, 0x1 + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0xB] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8010FCC + + thumb_func_start sub_801100C +sub_801100C: @ 801100C + push {r4,lr} + movs r4, 0x80 + ldr r3, =0x020229e8 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r0, r1, r3 + ldrb r2, [r0, 0x13] + lsls r2, 3 + orrs r2, r4 + adds r3, 0x4 + adds r1, r3 + ldr r0, [r1] + movs r1, 0x7 + ands r0, r1 + orrs r0, r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_801100C + + thumb_func_start sub_801103C +sub_801103C: @ 801103C + push {r4,r5,lr} + ldr r5, =0x02022b14 + movs r4, 0x1 + b _08011054 + .pool +_08011048: + adds r0, r4, 0 + bl sub_801100C + adds r1, r5, r4 + strb r0, [r1, 0x3] + adds r4, 0x1 +_08011054: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + blt _08011048 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_801103C + + thumb_func_start sub_8011068 +sub_8011068: @ 8011068 + push {lr} + lsls r0, 24 + ldr r2, =0x02022b14 + lsrs r0, 17 + ldrb r3, [r2, 0xA] + movs r1, 0x7F + ands r1, r3 + orrs r1, r0 + strb r1, [r2, 0xA] + ldr r3, =0x02022b22 + movs r0, 0 + movs r1, 0x2 + bl rfu_REQ_configGameData + pop {r0} + bx r0 + .pool + thumb_func_end sub_8011068 + + thumb_func_start sub_8011090 +sub_8011090: @ 8011090 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _0801109E + bl sub_8010F84 +_0801109E: + ldr r2, =0x02022b14 + ldr r3, =0x02022b22 + movs r0, 0 + movs r1, 0x2 + bl rfu_REQ_configGameData + pop {r0} + bx r0 + .pool + thumb_func_end sub_8011090 + + thumb_func_start sub_80110B8 +sub_80110B8: @ 80110B8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r9, r0 + bl sub_800F7DC + ldrb r1, [r0, 0xA] + movs r0, 0x7F + ands r0, r1 + cmp r0, 0x45 + bne _0801114C + movs r5, 0 + movs r7, 0 + ldr r3, =0x03005000 + ldr r1, =0x00000ce2 + adds r0, r3, r1 + ldr r2, =0x00000ce3 + adds r1, r3, r2 + ldrb r2, [r0] + ldrb r0, [r1] + adds r1, r0, 0 + eors r1, r2 + mov r8, r1 + movs r4, 0 + movs r6, 0x1 + ldr r2, =0x020229e8 + mov r12, r2 + ldr r0, =0x00000cde + adds r0, r3 + mov r10, r0 + mov r3, r12 + adds r3, 0x4 +_080110FC: + mov r0, r8 + asrs r0, r4 + ands r0, r6 + cmp r0, 0 + beq _0801113C + mov r1, r10 + adds r0, r4, r1 + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + mov r2, r12 + adds r1, r0, r2 + ldrb r1, [r1, 0x13] + adds r2, r6, 0 + ands r2, r1 + lsls r2, 3 + adds r0, r3 + ldr r1, [r0] + movs r0, 0x7 + ands r1, r0 + movs r0, 0x80 + orrs r1, r0 + orrs r2, r1 + lsls r0, r5, 3 + lsls r2, r0 + orrs r7, r2 + adds r5, 0x1 + mov r0, r9 + subs r0, 0x1 + cmp r5, r0 + beq _08011142 +_0801113C: + adds r4, 0x1 + cmp r4, 0x3 + ble _080110FC +_08011142: + movs r0, 0x45 + adds r1, r7, 0 + movs r2, 0 + bl sub_8011090 +_0801114C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80110B8 + + thumb_func_start sub_8011170 +sub_8011170: @ 8011170 + push {r4,lr} + adds r4, r0, 0 + ldr r2, =0x03005000 + adds r3, r2, 0 + adds r3, 0xEE + ldrb r0, [r3] + cmp r0, 0 + bne _08011192 + ldr r1, =0x03004140 + ldrh r0, [r1, 0x14] + strh r0, [r2, 0x10] + ldrh r0, [r1, 0x16] + strh r0, [r2, 0x12] + strh r4, [r2, 0xA] + ldrb r0, [r3] + movs r0, 0x1 + strb r0, [r3] +_08011192: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8011170 + + thumb_func_start sub_80111A0 +sub_80111A0: @ 80111A0 + ldr r0, =0x03005000 + adds r0, 0xEE + ldrb r1, [r0] + movs r1, 0 + strb r1, [r0] + bx lr + .pool + thumb_func_end sub_80111A0 + + thumb_func_start sub_80111B0 +sub_80111B0: @ 80111B0 + push {lr} + adds r2, r0, 0 + cmp r2, 0 + bne _080111C8 + ldr r0, =0x03005000 + adds r0, 0xEE + ldrb r1, [r0] + strb r2, [r0] + b _080111D2 + .pool +_080111C8: + ldr r0, =0x03005000 + adds r0, 0xEE + ldrb r1, [r0] + movs r1, 0x4 + strb r1, [r0] +_080111D2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80111B0 + + thumb_func_start sub_80111DC +sub_80111DC: @ 80111DC + push {lr} + ldr r0, =0x03004140 + ldrb r0, [r0] + movs r1, 0x1 + bl sub_8011E94 + ldr r1, =0x03005000 + movs r0, 0 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80111DC + + thumb_func_start sub_80111FC +sub_80111FC: @ 80111FC + ldr r1, =0x03005000 + ldr r0, =sub_80111DC + str r0, [r1] + bx lr + .pool + thumb_func_end sub_80111FC + + thumb_func_start sub_801120C +sub_801120C: @ 801120C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r4, r0, 24 + movs r6, 0 + cmp r4, 0x32 + bne _08011222 + b _08011360 +_08011222: + cmp r4, 0x32 + bgt _08011252 + cmp r4, 0x13 + bgt _08011240 + cmp r4, 0x12 + blt _08011230 + b _080113EE +_08011230: + cmp r4, 0x10 + bne _08011236 + b _080113EE +_08011236: + cmp r4, 0x10 + bgt _0801128C + cmp r4, 0 + beq _0801127E + b _080113EE +_08011240: + cmp r4, 0x30 + bne _08011246 + b _0801136C +_08011246: + cmp r4, 0x30 + ble _0801124C + b _08011354 +_0801124C: + cmp r4, 0x14 + beq _08011328 + b _080113EE +_08011252: + cmp r4, 0x44 + bgt _08011264 + cmp r4, 0x42 + blt _0801125C + b _080113EE +_0801125C: + cmp r4, 0x33 + bne _08011262 + b _0801136C +_08011262: + b _080113EE +_08011264: + cmp r4, 0xF3 + bne _0801126A + b _080113BA +_0801126A: + cmp r4, 0xF3 + bgt _08011276 + cmp r4, 0xF0 + bge _08011274 + b _080113EE +_08011274: + b _080113D4 +_08011276: + cmp r4, 0xFF + bne _0801127C + b _080113D4 +_0801127C: + b _080113EE +_0801127E: + ldr r1, =0x03005000 + movs r0, 0x2 + strh r0, [r1, 0x4] + b _080113EE + .pool +_0801128C: + ldr r0, =0x03004140 + ldrh r0, [r0, 0x14] + bl sub_80115EC + movs r5, 0 + movs r0, 0x1 + mov r8, r0 + ldr r1, =0x03005000 + mov r9, r1 + ldr r3, =0x00000cd5 + add r3, r9 + mov r10, r3 + movs r7, 0x7F +_080112A6: + ldr r0, =0x03004140 + ldrh r0, [r0, 0x14] + asrs r0, r5 + mov r1, r8 + ands r0, r1 + cmp r0, 0 + beq _0801130E + ldr r0, =0x03007890 + lsls r1, r5, 5 + adds r1, 0x14 + ldr r0, [r0] + adds r0, r1 + ldrb r0, [r0, 0x10] + adds r4, r7, 0 + ands r4, r0 + bl sub_800F7DC + ldrb r1, [r0, 0xA] + adds r0, r7, 0 + ands r0, r1 + cmp r4, r0 + bne _08011304 + ldr r0, =0x00000cd1 + add r0, r9 + adds r0, r5, r0 + movs r1, 0 + strb r1, [r0] + mov r3, r10 + adds r2, r5, r3 + strb r1, [r2] + movs r0, 0x20 + adds r1, r5, 0 + movs r3, 0x1 + bl rfu_setRecvBuffer + b _0801130E + .pool +_08011304: + mov r0, r8 + lsls r0, r5 + orrs r6, r0 + lsls r0, r6, 24 + lsrs r6, r0, 24 +_0801130E: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _080112A6 + cmp r6, 0 + beq _080113EE + adds r0, r6, 0 + bl rfu_REQ_disconnect + bl rfu_waitREQComplete + b _080113EE +_08011328: + ldr r4, =0x03005000 + ldr r1, =0x00000ce7 + adds r0, r4, r1 + ldr r1, =0x03004140 + ldrb r2, [r0] + ldrb r0, [r1] + cmp r2, r0 + beq _08011342 + eors r0, r2 + bl rfu_REQ_disconnect + bl rfu_waitREQComplete +_08011342: + movs r0, 0x11 + strh r0, [r4, 0x4] + b _080113EE + .pool +_08011354: + ldr r0, =0x03005000 + adds r0, 0xF0 + b _080113EA + .pool +_08011360: + ldr r0, =0x03005000 + adds r0, 0xF0 + movs r1, 0x3 + b _080113EC + .pool +_0801136C: + ldr r1, =0x03005000 + adds r2, r1, 0 + adds r2, 0xF0 + movs r0, 0x4 + strb r0, [r2] + ldr r3, =0x00000ce2 + adds r1, r3 + ldr r0, =0x03004140 + ldrb r2, [r0, 0x14] + ldrb r0, [r1] + adds r3, r0, 0 + bics r3, r2 + adds r2, r3, 0 + strb r2, [r1] + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080113B0 + cmp r2, 0 + bne _080113AC + adds r0, r4, 0 + bl sub_8011170 + b _080113B0 + .pool +_080113AC: + bl sub_80111FC +_080113B0: + movs r0, 0x2 + adds r1, r4, 0 + bl sub_8011A64 + b _080113EE +_080113BA: + movs r0, 0x1 + movs r1, 0xF3 + bl sub_8011A64 + movs r0, 0xF3 + bl sub_8011170 + ldr r0, =0x03005000 + adds r0, 0xEF + b _080113EA + .pool +_080113D4: + adds r0, r4, 0 + bl sub_8011170 + movs r0, 0x1 + adds r1, r4, 0 + bl sub_8011A64 + ldr r0, =0x03005000 + ldr r1, =0x00000cdb + adds r0, r1 + ldrb r1, [r0] +_080113EA: + movs r1, 0x1 +_080113EC: + strb r1, [r0] +_080113EE: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801120C + + thumb_func_start sub_8011404 +sub_8011404: @ 8011404 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x31 + bne _08011410 + b _08011570 +_08011410: + cmp r4, 0x31 + bgt _0801143E + cmp r4, 0x22 + beq _08011494 + cmp r4, 0x22 + bgt _0801142C + cmp r4, 0x20 + beq _0801147C + cmp r4, 0x20 + ble _08011426 + b _080115DE +_08011426: + cmp r4, 0 + beq _0801146E + b _080115DE +_0801142C: + cmp r4, 0x24 + beq _080114BA + cmp r4, 0x24 + blt _080114B0 + cmp r4, 0x25 + beq _08011504 + cmp r4, 0x30 + beq _0801150E + b _080115DE +_0801143E: + cmp r4, 0x44 + bgt _08011454 + cmp r4, 0x42 + blt _08011448 + b _080115DE +_08011448: + cmp r4, 0x33 + beq _08011522 + cmp r4, 0x33 + bge _08011452 + b _0801158C +_08011452: + b _080115DE +_08011454: + cmp r4, 0xF3 + bne _0801145A + b _080115AC +_0801145A: + cmp r4, 0xF3 + bgt _08011466 + cmp r4, 0xF0 + bge _08011464 + b _080115DE +_08011464: + b _080115C4 +_08011466: + cmp r4, 0xFF + bne _0801146C + b _080115C4 +_0801146C: + b _080115DE +_0801146E: + ldr r1, =0x03005000 + movs r0, 0x6 + strh r0, [r1, 0x4] + b _080115DE + .pool +_0801147C: + ldr r0, =0x03005000 + ldr r1, =0x03004140 + ldrh r1, [r1, 0x14] + ldr r2, =0x00000ccd + adds r0, r2 + b _080115DC + .pool +_08011494: + ldr r0, =0x03005000 + ldr r1, =0x03004140 + ldrh r1, [r1, 0x14] + ldr r2, =0x00000c3e + adds r0, r2 + ldrb r2, [r0] + b _080115DC + .pool +_080114B0: + movs r0, 0x2 + adds r1, r4, 0 + bl sub_8011A64 + b _080115DE +_080114BA: + ldr r4, =0x03005000 + movs r1, 0 + movs r0, 0xB + strh r0, [r4, 0x4] + ldr r2, =0x00000c85 + adds r0, r4, r2 + strb r1, [r0] + ldr r0, =0x00000c86 + adds r2, r4, r0 + strb r1, [r2] + ldr r1, =0x00000c3e + adds r5, r4, r1 + ldrb r1, [r5] + movs r0, 0x20 + movs r3, 0x1 + bl rfu_setRecvBuffer + ldrb r1, [r5] + ldr r2, =0x00000c3f + adds r4, r2 + movs r0, 0x10 + adds r2, r4, 0 + movs r3, 0x46 + bl rfu_setRecvBuffer + b _080115DE + .pool +_08011504: + movs r0, 0x2 + movs r1, 0x25 + bl sub_8011A64 + b _080115DE +_0801150E: + ldr r0, =0x03005000 + adds r2, r0, 0 + adds r2, 0xF0 + movs r1, 0x2 + strb r1, [r2] + ldr r1, =0x00000c86 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x6 + beq _080115DE +_08011522: + ldr r2, =0x03005000 + adds r1, r2, 0 + adds r1, 0xF0 + ldrb r0, [r1] + cmp r0, 0x2 + beq _08011532 + movs r0, 0x4 + strb r0, [r1] +_08011532: + ldr r1, =0x00000c86 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x9 + beq _08011544 + movs r0, 0x2 + adds r1, r4, 0 + bl sub_8011A64 +_08011544: + ldr r0, =gUnknown_082ED7FC + movs r1, 0x5 + movs r2, 0x5 + bl nullsub_5 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080115DE + adds r0, r4, 0 + bl sub_8011170 + b _080115DE + .pool +_08011570: + ldr r0, =0x03005000 + adds r0, 0xF0 + movs r1, 0x1 + strb r1, [r0] + ldr r0, =gUnknown_082ED814 + movs r1, 0x5 + movs r2, 0x5 + bl nullsub_5 + b _080115DE + .pool +_0801158C: + ldr r1, =0x03005000 + adds r2, r1, 0 + adds r2, 0xF0 + movs r0, 0x3 + strb r0, [r2] + ldr r2, =0x00000c3c + adds r1, r2 + ldrb r0, [r1] + movs r0, 0x1 + strb r0, [r1] + b _080115DE + .pool +_080115AC: + movs r0, 0x1 + movs r1, 0xF3 + bl sub_8011A64 + movs r0, 0xF3 + bl sub_8011170 + ldr r0, =0x03005000 + adds r0, 0xEF + b _080115DA + .pool +_080115C4: + movs r0, 0x1 + adds r1, r4, 0 + bl sub_8011A64 + adds r0, r4, 0 + bl sub_8011170 + ldr r0, =0x03005000 + ldr r1, =0x00000cdb + adds r0, r1 + ldrb r1, [r0] +_080115DA: + movs r1, 0x1 +_080115DC: + strb r1, [r0] +_080115DE: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8011404 + + thumb_func_start sub_80115EC +sub_80115EC: @ 80115EC + push {r4-r6,lr} + adds r3, r0, 0 + movs r2, 0 + movs r6, 0x1 + ldr r0, =0x03005000 + ldr r4, =0x00000cea + adds r1, r0, r4 + movs r5, 0 + movs r4, 0xFF +_080115FE: + adds r0, r3, 0 + asrs r0, r2 + ands r0, r6 + cmp r0, 0 + beq _08011610 + strb r5, [r1] + ldrb r0, [r1, 0x4] + orrs r0, r4 + strb r0, [r1, 0x4] +_08011610: + adds r1, 0x1 + adds r2, 0x1 + cmp r2, 0x3 + ble _080115FE + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80115EC + + thumb_func_start sub_8011628 +sub_8011628: @ 8011628 + push {r4-r7,lr} + adds r5, r0, 0 + movs r3, 0 + movs r2, 0 + movs r4, 0x1 + ldr r6, =0x03007890 + movs r7, 0x7F +_08011636: + adds r0, r5, 0 + asrs r0, r2 + ands r0, r4 + cmp r0, 0 + beq _0801165C + lsls r1, r2, 5 + adds r1, 0x14 + ldr r0, [r6] + adds r0, r1 + ldrb r1, [r0, 0x10] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0x45 + bne _0801165C + adds r0, r4, 0 + lsls r0, r2 + orrs r3, r0 + lsls r0, r3, 24 + lsrs r3, r0, 24 +_0801165C: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _08011636 + adds r0, r3, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8011628 + + thumb_func_start sub_8011674 +sub_8011674: @ 8011674 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x25 + bne _08011680 + b _080118EC +_08011680: + cmp r4, 0x25 + bgt _080116C2 + cmp r4, 0x14 + bne _0801168A + b _08011804 +_0801168A: + cmp r4, 0x14 + bgt _080116A2 + cmp r4, 0x11 + beq _08011722 + cmp r4, 0x11 + ble _08011698 + b _08011A42 +_08011698: + cmp r4, 0 + beq _0801170C + cmp r4, 0x10 + beq _08011718 + b _08011A42 +_080116A2: + cmp r4, 0x22 + bne _080116A8 + b _08011868 +_080116A8: + cmp r4, 0x22 + bgt _080116B4 + cmp r4, 0x20 + bne _080116B2 + b _08011850 +_080116B2: + b _08011A42 +_080116B4: + cmp r4, 0x23 + bne _080116BA + b _08011884 +_080116BA: + cmp r4, 0x24 + bne _080116C0 + b _080118BA +_080116C0: + b _08011A42 +_080116C2: + cmp r4, 0x44 + bgt _080116F2 + cmp r4, 0x42 + blt _080116CC + b _08011A42 +_080116CC: + cmp r4, 0x32 + bne _080116D2 + b _08011914 +_080116D2: + cmp r4, 0x32 + bgt _080116E4 + cmp r4, 0x30 + bne _080116DC + b _08011940 +_080116DC: + cmp r4, 0x31 + bne _080116E2 + b _080118F6 +_080116E2: + b _08011A42 +_080116E4: + cmp r4, 0x33 + bne _080116EA + b _08011948 +_080116EA: + cmp r4, 0x40 + bne _080116F0 + b _080119FC +_080116F0: + b _08011A42 +_080116F2: + cmp r4, 0xF3 + bne _080116F8 + b _08011A0C +_080116F8: + cmp r4, 0xF3 + bgt _08011704 + cmp r4, 0xF0 + bge _08011702 + b _08011A42 +_08011702: + b _08011A28 +_08011704: + cmp r4, 0xFF + bne _0801170A + b _08011A28 +_0801170A: + b _08011A42 +_0801170C: + ldr r1, =0x03005000 + movs r0, 0x11 + strh r0, [r1, 0x4] + b _08011A42 + .pool +_08011718: + movs r0, 0x4 + movs r1, 0 + bl sub_8011A64 + b _08011A42 +_08011722: + bl sub_800F7DC + ldrb r1, [r0, 0xA] + movs r0, 0x7F + ands r0, r1 + cmp r0, 0x45 + bne _080117DC + ldr r5, =0x03005000 + ldr r1, =0x00000cd9 + adds r0, r5, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080117DC + ldr r0, =0x03004140 + ldrh r0, [r0, 0x14] + bl sub_8011628 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _080117A6 + adds r0, r4, 0 + bl sub_800E87C + movs r2, 0x1 + mov r12, r2 + mov r1, r12 + lsls r1, r0 + lsls r1, 24 + lsrs r1, 24 + ldr r7, =0x00000ce6 + adds r6, r5, r7 + ldrb r2, [r6] + cmp r2, 0 + bne _08011798 + ldr r0, =0x00000ce8 + adds r3, r5, r0 + ldrb r0, [r3] + cmp r0, 0 + bne _08011798 + subs r7, 0x1 + adds r0, r5, r7 + strb r1, [r0] + eors r1, r4 + orrs r1, r2 + strb r1, [r6] + mov r0, r12 + strb r0, [r3] + b _080117A6 + .pool +_08011798: + ldr r0, =0x03005000 + ldr r1, =0x00000ce6 + adds r0, r1 + ldrb r2, [r0] + adds r1, r4, 0 + orrs r1, r2 + strb r1, [r0] +_080117A6: + ldr r0, =0x03004140 + ldrh r1, [r0, 0x14] + cmp r4, r1 + beq _080117F6 + ldr r2, =0x03005000 + ldr r7, =0x00000ce3 + adds r3, r2, r7 + adds r0, r4, 0 + eors r0, r1 + ldrb r1, [r3] + orrs r0, r1 + strb r0, [r3] + ldr r0, =0x00000ce4 + adds r2, r0 + movs r0, 0x2 + strb r0, [r2] + b _080117F6 + .pool +_080117DC: + bl sub_800F7DC + ldrb r1, [r0, 0xA] + movs r0, 0x7F + ands r0, r1 + cmp r0, 0x54 + bne _080117F6 + ldr r0, =0x03004140 + ldrb r0, [r0] + bl rfu_REQ_disconnect + bl rfu_waitREQComplete +_080117F6: + ldr r0, =0x03004140 + ldrh r0, [r0, 0x14] + bl sub_80115EC + b _08011A42 + .pool +_08011804: + bl sub_800F7DC + ldrb r1, [r0, 0xA] + movs r0, 0x7F + ands r0, r1 + cmp r0, 0x45 + beq _08011836 + ldr r4, =0x03004140 + ldrb r0, [r4, 0x1] + cmp r0, 0x1 + bls _08011836 + ldrb r0, [r4, 0x14] + bl sub_800E87C + movs r1, 0x80 + lsls r1, 17 + lsls r1, r0 + lsrs r1, 24 + ldrb r0, [r4] + eors r1, r0 + adds r0, r1, 0 + bl rfu_REQ_disconnect + bl rfu_waitREQComplete +_08011836: + ldr r1, =0x03005000 + ldrh r0, [r1, 0x4] + cmp r0, 0xF + beq _08011840 + b _08011A42 +_08011840: + movs r0, 0x10 + strh r0, [r1, 0x4] + b _08011A42 + .pool +_08011850: + ldr r0, =0x03005000 + ldr r1, =0x03004140 + ldrh r1, [r1, 0x14] + ldr r2, =0x00000ccd + adds r0, r2 + b _08011A40 + .pool +_08011868: + ldr r0, =0x03005000 + ldr r1, =0x03004140 + ldrh r1, [r1, 0x14] + ldr r7, =0x00000c3e + adds r0, r7 + ldrb r2, [r0] + b _08011A40 + .pool +_08011884: + ldr r1, =0x03005000 + movs r0, 0x12 + strh r0, [r1, 0x4] + ldr r0, =0x00000ccf + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x1 + bhi _080118B0 + adds r0, 0x1 + strb r0, [r1] + ldr r0, =sub_801209C + movs r1, 0x2 + bl AddTask + b _08011A42 + .pool +_080118B0: + movs r0, 0x2 + movs r1, 0x23 + bl sub_8011A64 + b _08011A42 +_080118BA: + ldr r4, =0x03005000 + movs r0, 0xD + strh r0, [r4, 0x4] + movs r0, 0x3 + movs r1, 0 + bl sub_8011A64 + ldr r1, =0x00000c3e + adds r0, r4, r1 + ldrb r1, [r0] + ldr r2, =0x00000c3f + adds r4, r2 + movs r0, 0x10 + adds r2, r4, 0 + movs r3, 0x46 + bl rfu_setRecvBuffer + b _08011A42 + .pool +_080118EC: + movs r0, 0x2 + movs r1, 0x25 + bl sub_8011A64 + b _08011A42 +_080118F6: + ldr r0, =0x03004140 + ldrb r1, [r0] + ldrh r0, [r0, 0x14] + ands r1, r0 + cmp r1, 0 + bne _08011904 + b _08011A42 +_08011904: + ldr r0, =0x03005000 + adds r0, 0xF0 + movs r1, 0x1 + b _08011A40 + .pool +_08011914: + ldr r2, =0x03005000 + adds r1, r2, 0 + adds r1, 0xF0 + movs r0, 0x3 + strb r0, [r1] + ldr r0, =0x03007890 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0 + beq _0801192A + b _08011A42 +_0801192A: + ldr r7, =0x00000c3c + adds r0, r2, r7 + ldrb r1, [r0] + movs r1, 0x1 + b _08011A40 + .pool +_08011940: + ldr r0, =0x03005000 + adds r0, 0xF0 + movs r1, 0x2 + strb r1, [r0] +_08011948: + ldr r2, =0x03005000 + adds r1, r2, 0 + adds r1, 0xF0 + ldrb r0, [r1] + cmp r0, 0x2 + beq _08011958 + movs r0, 0x4 + strb r0, [r1] +_08011958: + ldrb r0, [r2, 0xC] + cmp r0, 0x1 + bne _08011996 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080119B4 + ldr r0, =0x00000ce2 + adds r2, r0 + ldr r0, =0x03004140 + ldrb r1, [r0, 0x14] + ldrb r0, [r2] + bics r0, r1 + strb r0, [r2] + cmp r0, 0 + bne _08011990 + adds r0, r4, 0 + bl sub_8011170 + b _080119B4 + .pool +_08011990: + bl sub_80111FC + b _080119B4 +_08011996: + ldr r1, =0x00000ce4 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x2 + beq _080119B4 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080119B4 + adds r0, r4, 0 + bl sub_8011170 + movs r0, 0 + bl sub_800C27C +_080119B4: + ldr r0, =0x03007890 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0xFF + bne _080119DA + ldr r0, =0x03004140 + ldrb r0, [r0, 0x7] + cmp r0, 0 + bne _080119DA + ldr r0, =sub_800EB44 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080119DA + ldr r1, =0x03005000 + movs r0, 0x11 + strh r0, [r1, 0x4] +_080119DA: + movs r0, 0x2 + adds r1, r4, 0 + bl sub_8011A64 + b _08011A42 + .pool +_080119FC: + ldr r0, =0x03005000 + ldr r2, =0x00000ce3 + adds r0, r2 + b _08011A3E + .pool +_08011A0C: + movs r0, 0x1 + movs r1, 0xF3 + bl sub_8011A64 + movs r0, 0xF3 + bl sub_8011170 + ldr r0, =0x03005000 + adds r0, 0xEF + movs r1, 0x1 + b _08011A40 + .pool +_08011A28: + adds r0, r4, 0 + bl sub_8011170 + movs r0, 0x1 + adds r1, r4, 0 + bl sub_8011A64 + ldr r0, =0x03005000 + ldr r7, =0x00000cdb + adds r0, r7 + ldrb r1, [r0] +_08011A3E: + movs r1, 0 +_08011A40: + strb r1, [r0] +_08011A42: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8011674 + + thumb_func_start sub_8011A50 +sub_8011A50: @ 8011A50 + ldr r0, =0x03005000 + ldr r1, =0x00000ce4 + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] + bx lr + .pool + thumb_func_end sub_8011A50 + + thumb_func_start sub_8011A64 +sub_8011A64: @ 8011A64 + ldr r2, =0x03005000 + adds r3, r2, 0 + adds r3, 0xF1 + strb r0, [r3] + strh r1, [r2, 0xA] + bx lr + .pool + thumb_func_end sub_8011A64 + + thumb_func_start sub_8011A74 +sub_8011A74: @ 8011A74 + ldr r0, =0x03005000 + adds r0, 0xF1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_8011A74 + + thumb_func_start sub_8011A80 +sub_8011A80: @ 8011A80 + push {lr} + bl sub_8011A74 + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x1 + cmp r0, 0x1 + bls _08011A94 + movs r0, 0 + b _08011A96 +_08011A94: + movs r0, 0x1 +_08011A96: + pop {r1} + bx r1 + thumb_func_end sub_8011A80 + + thumb_func_start sub_8011A9C +sub_8011A9C: @ 8011A9C + ldr r0, =0x03005000 + ldr r1, =0x00000ce8 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_8011A9C + + thumb_func_start sub_8011AB0 +sub_8011AB0: @ 8011AB0 + ldr r0, =0x03005000 + ldrb r0, [r0, 0xC] + bx lr + .pool + thumb_func_end sub_8011AB0 + + thumb_func_start rfu_syncVBlank__ +rfu_syncVBlank__: @ 8011ABC + push {lr} + bl rfu_syncVBlank_ + pop {r0} + bx r0 + thumb_func_end rfu_syncVBlank__ + + thumb_func_start sub_8011AC8 +sub_8011AC8: @ 8011AC8 + push {lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + ldr r1, =0x03003090 + ldr r2, =0x05000014 + mov r0, sp + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8011AC8 + + thumb_func_start sub_8011AE8 +sub_8011AE8: @ 8011AE8 + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_8011AE8 + + thumb_func_start sub_8011AFC +sub_8011AFC: @ 8011AFC + push {r4,lr} + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + bl clear_tasks + bl sub_80A1A74 + ldr r0, =sub_8011AE8 + bl SetVBlankCallback + bl sub_80093CC + lsls r0, 24 + cmp r0, 0 + beq _08011B70 + ldr r1, =0x020229c6 + ldr r2, =0x00001111 + adds r0, r2, 0 + strh r0, [r1] + bl sub_800B488 + bl sub_8009734 + ldr r0, =0x030022c0 + ldrh r0, [r0, 0x24] + bl SeedRng + movs r4, 0 +_08011B38: + bl GenerateRandomNumber + ldr r1, =0x03005d90 + ldr r1, [r1] + adds r1, 0xA + adds r1, r4 + strb r0, [r1] + adds r4, 0x1 + cmp r4, 0x3 + ble _08011B38 + movs r1, 0xAA + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + bl RunActiveTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + bl sub_8011BA4 + ldr r0, =sub_8011BF8 + bl SetMainCallback2 +_08011B70: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8011AFC + + thumb_func_start sub_8011B90 +sub_8011B90: @ 8011B90 + push {lr} + ldr r0, =sub_800EB44 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8011B90 + + thumb_func_start sub_8011BA4 +sub_8011BA4: @ 8011BA4 + push {r4,lr} + ldr r4, =nullsub_89 + adds r0, r4, 0 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _08011BC2 + adds r0, r4, 0 + movs r1, 0 + bl AddTask + ldr r1, =0x03005000 + adds r1, 0x66 + strb r0, [r1] +_08011BC2: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8011BA4 + + thumb_func_start sub_8011BD0 +sub_8011BD0: @ 8011BD0 + push {lr} + ldr r0, =nullsub_89 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08011BEA + ldr r0, =0x03005000 + adds r0, 0x66 + ldrb r0, [r0] + bl remove_task +_08011BEA: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8011BD0 + + thumb_func_start sub_8011BF8 +sub_8011BF8: @ 8011BF8 + push {lr} + bl RunActiveTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_8011BF8 + + thumb_func_start sub_8011C10 +sub_8011C10: @ 8011C10 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r1, =0x03005000 + movs r0, 0x1 + strb r0, [r1, 0xC] + bl sub_8010F48 + ldr r0, =sub_801120C + movs r1, 0 + bl sub_800BF4C + ldr r2, =0x02022b2c + adds r1, r2, 0 + ldr r0, =gUnknown_082ED608 + ldm r0!, {r3,r5,r6} + stm r1!, {r3,r5,r6} + ldm r0!, {r3,r5,r6} + stm r1!, {r3,r5,r6} + ldr r0, =gUnknown_082ED620 + subs r4, 0x1 + adds r4, r0 + ldrb r0, [r4] + strh r0, [r2, 0x2] + bl sub_800EE78 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8011C10 + + thumb_func_start sub_8011C5C +sub_8011C5C: @ 8011C5C + push {lr} + ldr r1, =0x03005000 + movs r0, 0 + strb r0, [r1, 0xC] + bl sub_8010F48 + ldr r0, =sub_8011404 + ldr r1, =sub_800ED34 + bl sub_800BF4C + bl sub_800EF00 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8011C5C + + thumb_func_start sub_8011C84 +sub_8011C84: @ 8011C84 + push {r4-r7,lr} + ldr r4, =0x03005000 + movs r5, 0 + movs r0, 0x2 + strb r0, [r4, 0xC] + bl sub_8010F48 + ldr r0, =sub_8011674 + movs r1, 0 + bl sub_800BF4C + ldr r2, =0x02022b2c + adds r1, r2, 0 + ldr r0, =gUnknown_082ED608 + ldm r0!, {r3,r6,r7} + stm r1!, {r3,r6,r7} + ldm r0!, {r3,r6,r7} + stm r1!, {r3,r6,r7} + strb r5, [r2, 0x11] + movs r0, 0x96 + lsls r0, 2 + strh r0, [r2, 0x12] + ldr r0, =sub_800EB44 + movs r1, 0x1 + bl AddTask + adds r4, 0x67 + strb r0, [r4] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8011C84 + + thumb_func_start sub_8011CD8 +sub_8011CD8: @ 8011CD8 + ldrb r1, [r0, 0x1] + lsls r1, 8 + ldrb r0, [r0] + orrs r0, r1 + bx lr + thumb_func_end sub_8011CD8 + + thumb_func_start sub_8011CE4 +sub_8011CE4: @ 8011CE4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + str r0, [sp] + lsls r1, 16 + lsrs r1, 16 + mov r10, r1 + movs r0, 0xFF + mov r9, r0 + movs r7, 0 + ldr r1, =0x03007890 + mov r8, r1 +_08011D02: + lsls r4, r7, 5 + adds r5, r4, 0 + adds r5, 0x14 + mov r1, r8 + ldr r0, [r1] + adds r0, r5 + adds r0, 0x8 + bl sub_8011CD8 + lsls r0, 16 + lsrs r6, r0, 16 + mov r1, r8 + ldr r0, [r1] + adds r0, r4 + ldrh r0, [r0, 0x18] + bl sub_8010454 + cmp r0, 0 + beq _08011D4C + mov r0, r8 + ldr r1, [r0] + adds r1, r5 + adds r1, 0x15 + ldr r0, [sp] + bl CompareString + cmp r0, 0 + bne _08011D4C + cmp r10, r6 + bne _08011D4C + mov r9, r7 + mov r1, r8 + ldr r0, [r1] + adds r0, r4 + ldrb r0, [r0, 0x16] + cmp r0, 0xFF + bne _08011D56 +_08011D4C: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x3 + bls _08011D02 +_08011D56: + 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 + .pool + thumb_func_end sub_8011CE4 + + thumb_func_start sub_8011D6C +sub_8011D6C: @ 8011D6C + push {r4-r6,lr} + adds r6, r0, 0 + lsls r0, r6, 24 + lsrs r0, 24 + bl rfu_REQ_disconnect + bl rfu_waitREQComplete + ldr r4, =0x03005000 + ldr r0, =0x00000ce2 + adds r5, r4, r0 + ldrb r0, [r5] + bics r0, r6 + strb r0, [r5] + ldr r1, =0x00000cda + adds r6, r4, r1 + ldrb r1, [r6] + movs r0, 0x1 + bl rfu_clearSlot + ldrb r0, [r5] + ldr r1, =0x00000c87 + adds r4, r1 + adds r1, r4, 0 + movs r2, 0x46 + bl rfu_UNI_setSendData + ldrb r0, [r5] + bl sub_800E87C + strb r0, [r6] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8011D6C + + thumb_func_start sub_8011DC0 +sub_8011DC0: @ 8011DC0 + push {lr} + lsls r1, 16 + lsrs r1, 16 + bl sub_8011CE4 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xFF + beq _08011DDA + movs r0, 0x1 + lsls r0, r1 + bl sub_8011D6C +_08011DDA: + pop {r0} + bx r0 + thumb_func_end sub_8011DC0 + + thumb_func_start sub_8011DE0 +sub_8011DE0: @ 8011DE0 + push {r4-r6,lr} + adds r4, r0, 0 + cmp r4, 0 + beq _08011E20 + movs r3, 0 + movs r2, 0 + ldr r5, =0x03005cde + adds r6, r5, 0x4 +_08011DF0: + adds r0, r2, r5 + ldrb r0, [r0] + cmp r0, r4 + bne _08011E0E + ldrb r0, [r6] + asrs r0, r2 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08011E0E + adds r0, r1, 0 + lsls r0, r2 + orrs r3, r0 + lsls r0, r3, 24 + lsrs r3, r0, 24 +_08011E0E: + adds r2, 0x1 + cmp r2, 0x3 + ble _08011DF0 + cmp r3, 0 + beq _08011E20 + adds r0, r3, 0 + movs r1, 0x2 + bl sub_8011E94 +_08011E20: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8011DE0 + + thumb_func_start sub_8011E2C +sub_8011E2C: @ 8011E2C + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r6, =0x03003110 + ldrh r0, [r6] + cmp r0, 0 + bne _08011E7A + ldr r5, =0x03005000 + ldr r1, =0x00000ce8 + adds r0, r5, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08011E7A + movs r0, 0xED + lsls r0, 8 + bl sub_800FD14 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x8] + strh r1, [r6, 0x2] + ldrh r1, [r0, 0xA] + strh r1, [r6, 0x4] + ldr r1, =gUnknown_082ED695 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r0, r1 + ldrb r1, [r5, 0xD] + ldrb r0, [r0] + subs r1, r0 + strb r1, [r5, 0xD] + ldrb r0, [r5, 0xD] + strh r0, [r6, 0x6] + adds r0, r4, 0 + bl remove_task +_08011E7A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8011E2C + + thumb_func_start sub_8011E94 +sub_8011E94: @ 8011E94 + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + ldr r5, =sub_8011E2C + adds r0, r5, 0 + bl get_task_id_by_function + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + bne _08011ECC + adds r0, r5, 0 + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + strh r4, [r0, 0x8] + b _08011EDC + .pool +_08011ECC: + ldr r0, =0x03005e00 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + orrs r4, r0 + strh r4, [r1, 0x8] +_08011EDC: + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + strh r6, [r0, 0xA] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8011E94 + + thumb_func_start sub_8011EF4 +sub_8011EF4: @ 8011EF4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + bl sub_800EE94 + lsls r0, 24 + cmp r0, 0 + beq _08011FA4 + adds r0, r4, 0 + adds r0, 0x10 + bl sub_8011CD8 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_8011CE4 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _08011F8C + ldr r0, =0x03007890 + ldr r0, [r0] + lsls r1, r2, 5 + adds r0, r1 + ldrb r0, [r0, 0x16] + cmp r0, 0xFF + beq _08011F5C + ldr r0, =0x03005000 + ldr r1, =0x00000c3d + adds r0, r1 + strb r2, [r0] + bl sub_800EEBC + cmp r0, 0 + beq _08011FAA + b _08011F84 + .pool +_08011F5C: + bl sub_800F7DC + ldrb r1, [r0, 0xA] + movs r5, 0x7F + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0x15 + beq _08011FA4 + bl sub_800F7DC + ldrb r1, [r0, 0xA] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0x16 + beq _08011FA4 + movs r1, 0xE0 + lsls r1, 7 + movs r0, 0x2 + bl sub_8011A64 +_08011F84: + adds r0, r6, 0 + bl remove_task + b _08011FAA +_08011F8C: + ldrh r0, [r4, 0x1E] + adds r0, 0x1 + strh r0, [r4, 0x1E] + ldr r0, =0x03005000 + ldr r1, =0x00000c3d + adds r0, r1 + strb r2, [r0] + b _08011FAA + .pool +_08011FA4: + ldrh r0, [r4, 0x1E] + adds r0, 0x1 + strh r0, [r4, 0x1E] +_08011FAA: + movs r1, 0x1E + ldrsh r0, [r4, r1] + cmp r0, 0xF0 + ble _08011FC2 + movs r1, 0xE0 + lsls r1, 7 + movs r0, 0x2 + bl sub_8011A64 + adds r0, r6, 0 + bl remove_task +_08011FC2: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8011EF4 + + thumb_func_start sub_8011FC8 +sub_8011FC8: @ 8011FC8 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r5, r1, 16 + lsrs r5, 16 + ldr r0, =0x03005000 + adds r0, 0xF1 + movs r1, 0 + strb r1, [r0] + ldr r0, =sub_8011EF4 + movs r1, 0x3 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =0x03005e08 + adds r4, r0 + adds r0, r4, 0 + adds r1, r6, 0 + bl CopyString + strh r5, [r4, 0x10] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8011FC8 + + thumb_func_start sub_801200C +sub_801200C: @ 801200C + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 16 + lsrs r5, r0, 16 + bl sub_800F7DC + ldrb r1, [r0, 0xA] + movs r2, 0x7F + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0x45 + bne _08012032 + ldrb r1, [r4, 0xA] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0x45 + beq _08012092 +_0801202E: + movs r0, 0x1 + b _08012094 +_08012032: + ldrb r1, [r4, 0xA] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0x40 + bne _0801202E + cmp r5, 0x44 + bne _08012092 + ldr r5, =0x0300510a + ldrh r0, [r5, 0x8] + ldr r3, =0x000003ff + adds r2, r3, 0 + ands r2, r0 + movs r0, 0xCE + lsls r0, 1 + cmp r2, r0 + bne _08012068 + ldrh r1, [r4, 0x8] + adds r0, r3, 0 + ands r0, r1 + cmp r0, r2 + beq _08012092 + b _0801202E + .pool +_08012068: + ldrh r1, [r4, 0x8] + adds r0, r3, 0 + ands r0, r1 + cmp r0, r2 + bne _0801202E + ldrb r2, [r4, 0xB] + movs r0, 0xFE + ldrb r3, [r5, 0xB] + adds r1, r0, 0 + ands r1, r2 + ands r0, r3 + cmp r1, r0 + bne _0801202E + ldrb r2, [r4, 0x9] + movs r0, 0xFC + ldrb r3, [r5, 0x9] + adds r1, r0, 0 + ands r1, r2 + ands r0, r3 + cmp r1, r0 + bne _0801202E +_08012092: + movs r0, 0 +_08012094: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_801200C + + thumb_func_start sub_801209C +sub_801209C: @ 801209C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + mov r8, r5 + ldr r6, =0x03005000 + adds r0, r6, 0 + adds r0, 0xF1 + ldrb r0, [r0] + cmp r0, 0x4 + bne _080120BA + adds r0, r5, 0 + bl remove_task +_080120BA: + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + lsls r0, 16 + movs r1, 0x96 + lsls r1, 17 + cmp r0, r1 + ble _080120E4 + movs r1, 0xE0 + lsls r1, 7 + movs r0, 0x2 + bl sub_8011A64 + adds r0, r5, 0 + bl remove_task +_080120E4: + ldr r1, =0x00000ccd + adds r0, r6, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0801217C + ldr r0, =0x03004140 + ldrb r0, [r0, 0x6] + cmp r0, 0 + bne _0801217C + movs r2, 0x86 + lsls r2, 1 + adds r0, r6, r2 + bl sub_8011CD8 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r2, =0x00000119 + adds r0, r6, r2 + bl sub_8011CE4 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _0801217C + movs r1, 0xA + ldrsh r0, [r4, r1] + ldr r7, =0x03007890 + lsls r4, r2, 5 + adds r2, r4, 0 + adds r2, 0x14 + ldr r1, [r7] + adds r1, r2 + adds r1, 0x6 + bl sub_801200C + cmp r0, 0 + bne _0801216C + ldr r0, [r7] + adds r1, r0, r4 + ldrb r0, [r1, 0x16] + cmp r0, 0xFF + beq _0801217C + ldrh r0, [r1, 0x14] + movs r1, 0x5A + bl sub_800C12C + lsls r0, 24 + cmp r0, 0 + bne _0801217C + movs r0, 0xA + strh r0, [r6, 0x4] + adds r0, r5, 0 + bl remove_task + b _0801217C + .pool +_0801216C: + movs r1, 0xE0 + lsls r1, 7 + movs r0, 0x2 + bl sub_8011A64 + mov r0, r8 + bl remove_task +_0801217C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_801209C + + thumb_func_start sub_8012188 +sub_8012188: @ 8012188 + push {r4-r7,lr} + adds r3, r0, 0 + adds r5, r1, 0 + lsls r4, r2, 24 + lsrs r4, 24 + ldr r6, =0x03005000 + ldr r1, =0x00000ccf + adds r0, r6, r1 + movs r7, 0 + strb r7, [r0] + adds r0, r6, 0 + adds r0, 0xF1 + strb r7, [r0] + ldr r1, =0x00000119 + adds r0, r6, r1 + adds r1, r3, 0 + bl CopyString + movs r1, 0x85 + lsls r1, 1 + adds r0, r6, r1 + adds r1, r5, 0 + movs r2, 0xD + bl memcpy + bl sub_800D658 + ldr r0, =sub_801209C + movs r1, 0x2 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r5, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r5 + strh r4, [r1, 0xA] + ldr r0, =sub_800EB44 + bl get_task_id_by_function + lsls r0, 24 + lsrs r1, r0, 24 + adds r2, r1, 0 + cmp r4, 0x45 + bne _08012210 + cmp r1, 0xFF + beq _0801221E + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + movs r1, 0x1 + strh r1, [r0, 0x16] + b _0801221E + .pool +_08012210: + cmp r2, 0xFF + beq _0801221E + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r5 + strh r7, [r0, 0x16] +_0801221E: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8012188 + + thumb_func_start sub_8012224 +sub_8012224: @ 8012224 + push {lr} + ldr r0, =0x03005000 + adds r0, 0xF0 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08012238 + movs r0, 0 + b _0801223A + .pool +_08012238: + movs r0, 0x1 +_0801223A: + pop {r1} + bx r1 + thumb_func_end sub_8012224 + + thumb_func_start sub_8012240 +sub_8012240: @ 8012240 + push {r4,lr} + movs r1, 0 + ldr r0, =0x03004140 + ldrb r2, [r0] + ldr r4, =0x03005cd1 + movs r3, 0x1 +_0801224C: + adds r0, r2, 0 + asrs r0, r1 + ands r0, r3 + cmp r0, 0 + beq _0801226C + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _0801226C + movs r0, 0 + b _08012274 + .pool +_0801226C: + adds r1, 0x1 + cmp r1, 0x3 + ble _0801224C + movs r0, 0x1 +_08012274: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8012240 + + thumb_func_start sub_801227C +sub_801227C: @ 801227C + push {r4,lr} + movs r4, 0 +_08012280: + lsls r2, r4, 24 + lsrs r2, 24 + ldr r0, =gUnknown_082ED82C + movs r1, 0 + bl nullsub_5 + adds r4, 0x1 + cmp r4, 0x13 + ble _08012280 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801227C + + thumb_func_start sub_801229C +sub_801229C: @ 801229C + push {r4-r7,lr} + mov r7, r8 + push {r7} + bl sub_800A550 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1C + movs r2, 0x13 + movs r3, 0x2 + bl nullsub_13 + ldr r4, =0x03007890 + ldr r0, [r4] + ldrb r0, [r0, 0x2] + movs r1, 0x14 + movs r2, 0x1 + movs r3, 0x1 + bl nullsub_13 + ldr r0, [r4] + ldrb r0, [r0, 0x3] + movs r1, 0x17 + movs r2, 0x1 + movs r3, 0x1 + bl nullsub_13 + ldr r0, =0x03005000 + ldrb r0, [r0, 0xC] + cmp r0, 0x1 + bne _08012378 + movs r6, 0 + adds r7, r4, 0 + movs r5, 0x14 +_080122E0: + ldr r2, [r7] + ldrb r0, [r2, 0x7] + asrs r0, r6 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0801231E + lsls r0, r6, 5 + adds r0, r2, r0 + ldrh r0, [r0, 0x18] + adds r4, r6, 0x3 + lsls r4, 24 + lsrs r4, 24 + adds r2, r4, 0 + movs r3, 0x4 + bl nullsub_13 + ldr r0, [r7] + adds r0, r5 + adds r0, 0x6 + movs r1, 0x6 + adds r2, r4, 0 + bl nullsub_5 + ldr r0, [r7] + adds r0, r5 + adds r0, 0x15 + movs r1, 0x16 + adds r2, r4, 0 + bl nullsub_5 +_0801231E: + adds r5, 0x20 + adds r6, 0x1 + cmp r6, 0x3 + ble _080122E0 + movs r6, 0 + ldr r0, =0x03005000 + mov r8, r0 +_0801232C: + movs r5, 0 + adds r7, r6, 0x1 + lsls r0, r6, 3 + adds r2, r6, 0 + adds r2, 0xB + subs r0, r6 + lsls r0, 1 + mov r1, r8 + adds r1, 0x14 + adds r4, r0, r1 + lsls r6, r2, 24 +_08012342: + ldrb r0, [r4] + lsls r1, r5, 25 + lsrs r1, 24 + lsrs r2, r6, 24 + movs r3, 0x2 + bl nullsub_13 + adds r4, 0x1 + adds r5, 0x1 + cmp r5, 0xD + ble _08012342 + adds r6, r7, 0 + cmp r6, 0x3 + ble _0801232C + ldr r0, =gUnknown_082ED868 + movs r1, 0x1 + movs r2, 0xF + bl nullsub_5 + b _080124AA + .pool +_08012378: + ldr r1, [r4] + ldrb r0, [r1, 0x2] + cmp r0, 0 + beq _08012414 + ldrb r0, [r1, 0x7] + cmp r0, 0 + beq _08012414 + movs r6, 0 + movs r5, 0xC0 + lsls r5, 18 +_0801238C: + lsrs r4, r5, 24 + movs r0, 0 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x4 + bl nullsub_13 + ldr r0, =gUnknown_082ED84B + movs r1, 0x6 + adds r2, r4, 0 + bl nullsub_5 + ldr r0, =gUnknown_082ED85B + movs r1, 0x16 + adds r2, r4, 0 + bl nullsub_5 + movs r1, 0x80 + lsls r1, 17 + adds r5, r1 + adds r6, 0x1 + cmp r6, 0x3 + ble _0801238C + ldr r5, =0x03007890 + ldr r1, [r5] + ldr r4, =0x03005000 + ldr r0, =0x00000c3e + adds r4, r0 + ldrb r0, [r4] + lsls r0, 5 + adds r1, r0 + ldrh r0, [r1, 0x18] + movs r1, 0x1 + movs r2, 0x3 + movs r3, 0x4 + bl nullsub_13 + ldrb r1, [r4] + lsls r1, 5 + adds r1, 0x14 + ldr r0, [r5] + adds r0, r1 + adds r0, 0x6 + movs r1, 0x6 + movs r2, 0x3 + bl nullsub_5 + ldrb r1, [r4] + lsls r1, 5 + adds r1, 0x14 + ldr r0, [r5] + adds r0, r1 + adds r0, 0x15 + movs r1, 0x16 + movs r2, 0x3 + bl nullsub_5 + b _080124AA + .pool +_08012414: + movs r6, 0 + ldr r1, =0x03007890 + ldr r0, [r1] + ldrb r0, [r0, 0x8] + cmp r6, r0 + bge _08012470 + adds r7, r1, 0 + movs r1, 0x14 + mov r8, r1 +_08012426: + ldr r0, [r7] + lsls r5, r6, 5 + adds r1, r0, r5 + ldrb r0, [r1, 0x16] + cmp r0, 0xFF + beq _08012462 + ldrh r0, [r1, 0x18] + adds r4, r6, 0x3 + lsls r4, 24 + lsrs r4, 24 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x4 + bl nullsub_13 + ldr r0, [r7] + adds r0, r5 + ldrh r0, [r0, 0x14] + movs r1, 0x6 + adds r2, r4, 0 + movs r3, 0x4 + bl nullsub_13 + ldr r0, [r7] + add r0, r8 + adds r0, 0x15 + movs r1, 0x16 + adds r2, r4, 0 + bl nullsub_5 +_08012462: + movs r0, 0x20 + add r8, r0 + adds r6, 0x1 + ldr r0, [r7] + ldrb r0, [r0, 0x8] + cmp r6, r0 + blt _08012426 +_08012470: + cmp r6, 0x3 + bgt _080124AA + lsls r0, r6, 24 + movs r1, 0xC0 + lsls r1, 18 + adds r5, r0, r1 +_0801247C: + lsrs r4, r5, 24 + movs r0, 0 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x4 + bl nullsub_13 + ldr r0, =gUnknown_082ED84B + movs r1, 0x6 + adds r2, r4, 0 + bl nullsub_5 + ldr r0, =gUnknown_082ED85B + movs r1, 0x16 + adds r2, r4, 0 + bl nullsub_5 + movs r0, 0x80 + lsls r0, 17 + adds r5, r0 + adds r6, 0x1 + cmp r6, 0x3 + ble _0801247C +_080124AA: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801229C + + thumb_func_start sub_80124C0 +sub_80124C0: @ 80124C0 + ldr r0, =0x03005000 + ldr r1, =0x00000c1a + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_80124C0 + + thumb_func_start sub_80124D4 +sub_80124D4: @ 80124D4 + ldr r0, =0x03005000 + ldr r1, =0x000009e6 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_80124D4 + + thumb_func_start nullsub_89 +nullsub_89: @ 80124E8 + bx lr + thumb_func_end nullsub_89 + + thumb_func_start sub_80124EC +sub_80124EC: @ 80124EC + push {r4-r6,lr} + sub sp, 0x8 + adds r4, r1, 0 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r2, 24 + lsrs r5, r2, 24 + adds r0, r6, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + lsls r4, 8 + movs r0, 0x90 + lsls r0, 6 + cmp r4, r0 + beq _08012588 + cmp r4, r0 + bgt _08012526 + movs r0, 0x80 + lsls r0, 2 + cmp r4, r0 + beq _08012538 + movs r0, 0x80 + lsls r0, 3 + cmp r4, r0 + beq _08012544 + b _080125A6 +_08012526: + movs r0, 0x94 + lsls r0, 6 + cmp r4, r0 + beq _08012554 + movs r0, 0xD4 + lsls r0, 6 + cmp r4, r0 + beq _08012564 + b _080125A6 +_08012538: + ldr r1, =gUnknown_082EDB60 + subs r0, r5, 0x1 + lsls r0, 2 + b _0801256C + .pool +_08012544: + ldr r1, =gUnknown_082EDB60 + subs r0, r5, 0x1 + lsls r0, 2 + adds r1, 0x14 + b _0801256C + .pool +_08012554: + ldr r1, =gUnknown_082EDB60 + subs r0, r5, 0x1 + lsls r0, 2 + adds r1, 0x28 + b _0801256C + .pool +_08012564: + ldr r1, =gUnknown_082EDB60 + subs r0, r5, 0x1 + lsls r0, 2 + adds r1, 0x3C +_0801256C: + adds r0, r1 + ldr r2, [r0] + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + adds r0, r6, 0 + movs r1, 0x1 + movs r3, 0 + bl sub_80173E0 + b _080125A6 + .pool +_08012588: + ldr r1, =gUnknown_082EDB60 + subs r0, r5, 0x1 + lsls r0, 2 + adds r1, 0x50 + adds r0, r1 + ldr r2, [r0] + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + adds r0, r6, 0 + movs r1, 0x1 + movs r3, 0 + bl sub_80173E0 +_080125A6: + adds r0, r6, 0 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80124EC + + thumb_func_start sub_80125BC +sub_80125BC: @ 80125BC + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x28 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r6, =0x03005d90 + ldr r2, [r6] + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + mov r8, r0 + str r0, [sp, 0x4] + adds r0, r4, 0 + movs r1, 0x1 + movs r3, 0 + bl sub_80173E0 + ldr r1, =gUnknown_082ED8CC + add r0, sp, 0x8 + bl CopyString + adds r5, r0, 0 + ldr r0, [r6] + adds r0, 0xA + bl sub_8015658 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + movs r2, 0x2 + movs r3, 0x5 + bl ConvertIntToDecimalString + movs r0, 0x11 + str r0, [sp] + mov r0, r8 + str r0, [sp, 0x4] + adds r0, r4, 0 + movs r1, 0x1 + add r2, sp, 0x8 + movs r3, 0 + bl sub_80173E0 + add sp, 0x28 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80125BC + + thumb_func_start sub_801262C +sub_801262C: @ 801262C + push {lr} + lsls r1, 24 + lsrs r1, 24 + subs r0, r1, 0x1 + cmp r0, 0x1B + bhi _080126C0 + lsls r0, 2 + ldr r1, =_08012648 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08012648: + .4byte _080126B8 + .4byte _080126B8 + .4byte _080126B8 + .4byte _080126B8 + .4byte _080126C0 + .4byte _080126C0 + .4byte _080126C0 + .4byte _080126C0 + .4byte _080126B8 + .4byte _080126B8 + .4byte _080126B8 + .4byte _080126C0 + .4byte _080126C0 + .4byte _080126B8 + .4byte _080126B8 + .4byte _080126B8 + .4byte _080126C0 + .4byte _080126C0 + .4byte _080126C0 + .4byte _080126C0 + .4byte _080126B8 + .4byte _080126B8 + .4byte _080126B8 + .4byte _080126B8 + .4byte _080126B8 + .4byte _080126B8 + .4byte _080126B8 + .4byte _080126B8 +_080126B8: + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_082ED960 + bl ExpandStringRefs +_080126C0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_801262C + + thumb_func_start sub_80126CC +sub_80126CC: @ 80126CC + push {lr} + subs r0, 0x9 + cmp r0, 0x12 + bhi _08012734 + lsls r0, 2 + ldr r1, =_080126E4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080126E4: + .4byte _08012730 + .4byte _08012730 + .4byte _08012730 + .4byte _08012734 + .4byte _08012734 + .4byte _08012734 + .4byte _08012730 + .4byte _08012730 + .4byte _08012734 + .4byte _08012734 + .4byte _08012734 + .4byte _08012734 + .4byte _08012734 + .4byte _08012734 + .4byte _08012730 + .4byte _08012730 + .4byte _08012730 + .4byte _08012730 + .4byte _08012730 +_08012730: + movs r0, 0x1 + b _08012736 +_08012734: + movs r0, 0 +_08012736: + pop {r1} + bx r1 + thumb_func_end sub_80126CC + + thumb_func_start BerryBlenderLinkBecomeLeader +BerryBlenderLinkBecomeLeader: @ 801273C + push {lr} + ldr r0, =sub_8012780 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02022c30 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r1, r0 + str r1, [r2] + ldr r0, =0x03000da0 + str r1, [r0] + movs r0, 0 + strb r0, [r1, 0xC] + strb r0, [r1, 0xD] + ldr r1, =0x020375f0 + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end BerryBlenderLinkBecomeLeader + + thumb_func_start sub_8012780 +sub_8012780: @ 8012780 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02022c30 + ldr r6, [r0] + ldrb r0, [r6, 0xC] + cmp r0, 0x1E + bls _0801279A + bl _08012F50 +_0801279A: + lsls r0, 2 + ldr r1, =_080127AC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080127AC: + .4byte _08012828 + .4byte _08012F50 + .4byte _08012F50 + .4byte _080128A0 + .4byte _080129C8 + .4byte _08012A50 + .4byte _08012A6C + .4byte _08012B8C + .4byte _08012F50 + .4byte _08012AFC + .4byte _08012B14 + .4byte _08012BA8 + .4byte _08012C5C + .4byte _08012D5A + .4byte _08012D78 + .4byte _08012D8A + .4byte _08012DA8 + .4byte _08012E62 + .4byte _08012E78 + .4byte _08012DF2 + .4byte _08012E10 + .4byte _08012ED0 + .4byte _08012EFC + .4byte _08012ED0 + .4byte _08012EE6 + .4byte _08012F50 + .4byte _08012F14 + .4byte _08012F50 + .4byte _08012F50 + .4byte _08012B54 + .4byte _08012EB6 +_08012828: + ldr r0, =0x020375e0 + ldrh r2, [r0] + adds r3, r0, 0 + cmp r2, 0x14 + bne _08012848 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + bne _08012848 + adds r0, r2, 0x1 + strh r0, [r3] +_08012848: + ldr r2, =0x02022c2c + ldr r1, =gUnknown_082F00C4 + ldrh r0, [r3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + strb r0, [r2] + ldr r4, =0x02022c2d + ldrh r0, [r3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + lsrs r0, 8 + strb r0, [r4] + ldrb r0, [r2] + movs r1, 0 + movs r2, 0 + bl sub_8010F84 + bl sub_800B488 + bl sub_8009734 + ldrb r1, [r4] + movs r0, 0xF + ands r0, r1 + bl sub_8011C10 + movs r0, 0x3 + strb r0, [r6, 0xC] + b _08012F50 + .pool +_080128A0: + movs r0, 0x70 + bl AllocZeroed + str r0, [r6, 0x4] + movs r0, 0xA0 + bl AllocZeroed + str r0, [r6] + movs r0, 0xA0 + bl AllocZeroed + str r0, [r6, 0x8] + ldr r0, [r6, 0x4] + movs r1, 0x4 + bl sub_80175EC + ldr r0, [r6] + movs r1, 0x5 + bl sub_8017580 + ldr r0, [r6] + adds r1, r0, 0 + adds r1, 0x10 + bl sub_800DF90 + ldr r1, [r6] + movs r3, 0 + movs r0, 0 + strh r0, [r1, 0x18] + ldr r2, [r6] + ldrb r1, [r2, 0x1A] + subs r0, 0x4 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x1A] + ldr r2, [r6] + ldrb r1, [r2, 0x1A] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x1A] + ldr r0, [r6] + strb r3, [r0, 0x1B] + ldr r0, [r6, 0x4] + movs r1, 0xFF + bl sub_8016FC0 + strb r0, [r6, 0x17] + ldr r0, =gUnknown_082F00BC + bl AddWindow + strb r0, [r6, 0x10] + ldr r0, =0x02022c2d + ldrb r0, [r0] + movs r1, 0xF + ands r1, r0 + cmp r1, 0x2 + blt _08012938 + cmp r1, 0x4 + ble _08012928 + cmp r1, 0x5 + beq _08012930 + b _08012938 + .pool +_08012928: + ldr r0, =gUnknown_082F011C + b _08012932 + .pool +_08012930: + ldr r0, =gUnknown_082F0124 +_08012932: + bl AddWindow + strb r0, [r6, 0xF] +_08012938: + ldr r0, =gUnknown_082F012C + bl AddWindow + strb r0, [r6, 0x11] + ldrb r0, [r6, 0x10] + movs r1, 0x22 + bl FillWindowPixelBuffer + ldrb r0, [r6, 0x10] + ldr r2, =gUnknown_082EDBC4 + movs r3, 0x1 + mov r8, r3 + str r3, [sp] + movs r4, 0x4 + str r4, [sp, 0x4] + movs r1, 0 + movs r3, 0x8 + bl sub_80173E0 + ldrb r0, [r6, 0x10] + bl PutWindowTilemap + ldrb r0, [r6, 0x10] + movs r1, 0x2 + bl CopyWindowToVram + ldrb r0, [r6, 0xF] + movs r1, 0 + bl sub_81973FC + ldr r0, =0x03006310 + adds r2, r0, 0 + ldr r1, =gUnknown_082F015C + ldm r1!, {r3,r5,r7} + stm r2!, {r3,r5,r7} + ldm r1!, {r3,r5,r7} + stm r2!, {r3,r5,r7} + ldrb r1, [r6, 0xF] + strb r1, [r0, 0x10] + movs r1, 0 + movs r2, 0 + bl ListMenuInit + strb r0, [r6, 0x12] + ldrb r0, [r6, 0x11] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r6, 0x11] + bl PutWindowTilemap + ldrb r0, [r6, 0x11] + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0 + bl CopyBgTilemapBufferToVram + mov r5, r8 + strb r5, [r6, 0x13] + strb r4, [r6, 0xC] + b _08012F50 + .pool +_080129C8: + ldr r0, =0x02021cc4 + ldr r2, =gUnknown_082F0048 + ldr r4, =0x02022c2c + ldrb r1, [r4] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl CopyString + ldr r0, =0x02022c2d + ldrb r2, [r0] + lsrs r0, r2, 4 + cmp r0, 0 + beq _08012A2C + ldrb r1, [r6, 0x13] + subs r0, 0x1 + cmp r1, r0 + ble _08012A18 + movs r0, 0xF + ands r0, r2 + cmp r0, 0 + beq _08012A18 + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_082ED990 + bl ExpandStringRefs + b _08012A34 + .pool +_08012A18: + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_082ED960 + bl ExpandStringRefs + b _08012A34 + .pool +_08012A2C: + ldr r0, =0x02021fc4 + ldrb r1, [r4] + bl sub_801262C +_08012A34: + ldrb r0, [r6, 0x11] + ldr r1, =0x02022c2d + ldrb r1, [r1] + ldrb r2, [r6, 0x13] + bl sub_80124EC + movs r0, 0x5 + strb r0, [r6, 0xC] + b _08012F50 + .pool +_08012A50: + adds r0, r6, 0 + adds r0, 0xD + ldr r1, =0x02021fc4 + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + bne _08012A62 + b _08012F50 +_08012A62: + movs r0, 0x6 + strb r0, [r6, 0xC] + b _08012F50 + .pool +_08012A6C: + adds r0, r6, 0 + movs r1, 0x7 + movs r2, 0xA + bl sub_801320C + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08012AA8 + ldrb r0, [r6, 0x13] + cmp r0, 0x1 + bne _08012A90 + movs r0, 0x17 + b _08012AA6 + .pool +_08012A90: + ldr r0, =0x02022c2d + ldrb r1, [r0] + movs r0, 0xF0 + ands r0, r1 + cmp r0, 0 + beq _08012AA4 + movs r0, 0x1E + b _08012AA6 + .pool +_08012AA4: + movs r0, 0x13 +_08012AA6: + strb r0, [r6, 0xC] +_08012AA8: + ldr r0, =0x02022c2d + ldrb r2, [r0] + lsrs r0, r2, 4 + cmp r0, 0 + beq _08012ADE + ldrb r1, [r6, 0x13] + subs r0, 0x1 + cmp r1, r0 + ble _08012ADE + movs r4, 0xF + adds r0, r4, 0 + ands r0, r2 + cmp r0, 0 + beq _08012ADE + bl sub_8012240 + cmp r0, 0 + beq _08012ADE + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08012ADE + strb r4, [r6, 0xC] + bl sub_800EF38 +_08012ADE: + ldrb r0, [r6, 0xC] + cmp r0, 0x6 + beq _08012AE6 + b _08012F50 +_08012AE6: + bl sub_80105EC + cmp r0, 0 + bne _08012AF0 + b _08012F50 +_08012AF0: + b _08012C56 + .pool +_08012AFC: + bl sub_80105EC + cmp r0, 0 + beq _08012B06 + b _08012F50 +_08012B06: + movs r0, 0x6 + strb r0, [r6, 0xC] + ldr r0, [r6] + bl sub_8013398 + strb r0, [r6, 0x13] + b _08012F50 +_08012B14: + movs r3, 0 + ldr r0, =0x02022c2c + ldrb r1, [r0] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x2 + bne _08012B24 + movs r3, 0x1 +_08012B24: + adds r0, r6, 0 + adds r0, 0xD + ldr r2, =gUnknown_082EDDC4 + lsls r1, r3, 2 + adds r1, r2 + ldr r1, [r1] + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + bne _08012B3C + b _08012F50 +_08012B3C: + ldr r0, [r6] + bl sub_8013398 + strb r0, [r6, 0x13] + ldrb r0, [r6, 0x12] + bl sub_81AE70C + b _08012E5C + .pool +_08012B54: + ldr r0, =0x02022c2d + ldrb r0, [r0] + movs r1, 0xF + ands r1, r0 + movs r0, 0x2 + eors r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r3, r0, 31 + adds r0, r6, 0 + adds r0, 0xD + ldr r2, =gUnknown_082EDDC4 + lsls r1, r3, 2 + adds r1, r2 + ldr r1, [r1] + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + bne _08012B7E + b _08012F50 +_08012B7E: + movs r0, 0x15 + strb r0, [r6, 0xC] + b _08012F50 + .pool +_08012B8C: + adds r0, r6, 0 + adds r0, 0xD + ldr r1, =0x02021fc4 + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + bne _08012B9E + b _08012F50 +_08012B9E: + movs r0, 0xB + strb r0, [r6, 0xC] + b _08012F50 + .pool +_08012BA8: + adds r4, r6, 0 + adds r4, 0xD + ldrb r1, [r6, 0x13] + lsls r1, 5 + ldr r0, [r6] + adds r0, r1 + adds r0, 0x2 + bl sub_8015658 + lsls r0, 16 + lsrs r0, 16 + ldrb r2, [r6, 0x13] + lsls r2, 5 + ldr r1, [r6] + adds r1, r2 + adds r1, 0x10 + bl sub_801064C + adds r1, r0, 0 + adds r0, r4, 0 + bl sub_80170B8 + lsls r0, 24 + asrs r1, r0, 24 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08012C28 + cmp r1, r0 + bgt _08012BEC + subs r0, 0x2 + cmp r1, r0 + beq _08012C56 + b _08012F50 +_08012BEC: + cmp r1, 0 + beq _08012BF6 + cmp r1, 0x1 + beq _08012C28 + b _08012F50 +_08012BF6: + bl sub_800E0E8 + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + movs r0, 0x5 + strb r0, [r6, 0x19] + ldrb r1, [r6, 0x13] + lsls r1, 5 + ldr r0, [r6] + adds r0, r1 + adds r0, 0x2 + bl sub_8015658 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldrb r0, [r6, 0x13] + lsls r0, 5 + ldr r2, [r6] + adds r2, r0 + adds r2, 0x10 + movs r0, 0x5 + b _08012C4C +_08012C28: + movs r0, 0x6 + strb r0, [r6, 0x19] + ldrb r1, [r6, 0x13] + lsls r1, 5 + ldr r0, [r6] + adds r0, r1 + adds r0, 0x2 + bl sub_8015658 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldrb r0, [r6, 0x13] + lsls r0, 5 + ldr r2, [r6] + adds r2, r0 + adds r2, 0x10 + movs r0, 0x6 +_08012C4C: + bl sub_8010688 + movs r0, 0xC + strb r0, [r6, 0xC] + b _08012F50 +_08012C56: + movs r0, 0x9 + strb r0, [r6, 0xC] + b _08012F50 +_08012C5C: + ldrb r1, [r6, 0x13] + lsls r1, 5 + ldr r0, [r6] + adds r0, r1 + adds r0, 0x2 + bl sub_8015658 + lsls r0, 16 + lsrs r0, 16 + ldrb r2, [r6, 0x13] + lsls r2, 5 + ldr r1, [r6] + adds r1, r2 + adds r1, 0x10 + bl sub_8010714 + cmp r0, 0x1 + bne _08012D4A + ldrb r0, [r6, 0x19] + cmp r0, 0x5 + bne _08012D04 + ldr r1, [r6] + ldrb r0, [r6, 0x13] + lsls r0, 5 + adds r1, r0 + movs r0, 0 + strb r0, [r1, 0x1B] + ldrb r0, [r6, 0x12] + bl sub_81AE70C + ldrb r0, [r6, 0x13] + adds r0, 0x1 + strb r0, [r6, 0x13] + ldr r1, =0x02022c2d + ldrb r1, [r1] + movs r3, 0xF + lsls r0, 24 + lsrs r2, r0, 24 + adds r0, r3, 0 + ands r0, r1 + cmp r2, r0 + bne _08012D40 + movs r0, 0xF0 + ands r0, r1 + cmp r0, 0 + bne _08012CBC + cmp r2, 0x4 + bne _08012CC4 +_08012CBC: + strb r3, [r6, 0xC] + b _08012CE0 + .pool +_08012CC4: + ldr r0, =0x02021cc4 + ldrb r2, [r6, 0x13] + lsls r2, 5 + subs r2, 0x20 + ldr r1, [r6] + adds r1, r2 + bl sub_8018404 + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_082EDC9C + bl ExpandStringRefs + movs r0, 0xD + strb r0, [r6, 0xC] +_08012CE0: + bl sub_800EF38 + ldrb r0, [r6, 0x11] + ldr r1, =0x02022c2d + ldrb r1, [r1] + ldrb r2, [r6, 0x13] + bl sub_80124EC + b _08012D44 + .pool +_08012D04: + ldrb r1, [r6, 0x13] + lsls r1, 5 + ldr r0, [r6] + adds r0, r1 + adds r4, r0, 0 + adds r4, 0x10 + adds r0, 0x2 + bl sub_8015658 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_8011DC0 + ldr r1, [r6] + ldrb r0, [r6, 0x13] + lsls r0, 5 + adds r1, r0 + ldrb r2, [r1, 0x1A] + movs r0, 0x4 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1A] + ldr r0, [r6] + bl sub_8013398 + ldrb r0, [r6, 0x12] + bl sub_81AE70C +_08012D40: + movs r0, 0x4 + strb r0, [r6, 0xC] +_08012D44: + movs r0, 0 + strb r0, [r6, 0x19] + b _08012F50 +_08012D4A: + cmp r0, 0x2 + beq _08012D50 + b _08012F50 +_08012D50: + movs r0, 0 + movs r1, 0 + bl sub_8011A64 + b _08012E5C +_08012D5A: + adds r0, r6, 0 + adds r0, 0xD + ldr r1, =0x02021fc4 + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + bne _08012D6C + b _08012F50 +_08012D6C: + movs r0, 0xE + strb r0, [r6, 0xC] + b _08012F50 + .pool +_08012D78: + ldrb r0, [r6, 0xE] + adds r0, 0x1 + strb r0, [r6, 0xE] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x78 + bhi _08012D88 + b _08012F50 +_08012D88: + b _08012DCE +_08012D8A: + adds r0, r6, 0 + adds r0, 0xD + ldr r1, =gUnknown_082EDC5C + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + bne _08012D9C + b _08012F50 +_08012D9C: + movs r0, 0x10 + strb r0, [r6, 0xC] + b _08012F50 + .pool +_08012DA8: + adds r0, r6, 0 + adds r0, 0xD + movs r1, 0 + bl sub_80170B8 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _08012DCE + cmp r1, 0 + bgt _08012DC8 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08012DD4 + b _08012F50 +_08012DC8: + cmp r1, 0x1 + beq _08012DD4 + b _08012F50 +_08012DCE: + movs r0, 0x11 + strb r0, [r6, 0xC] + b _08012F50 +_08012DD4: + ldr r0, =0x02022c2d + ldrb r1, [r0] + movs r0, 0xF0 + ands r0, r1 + cmp r0, 0 + beq _08012DEC + movs r0, 0x1E + strb r0, [r6, 0xC] + b _08012F50 + .pool +_08012DEC: + movs r0, 0x13 + strb r0, [r6, 0xC] + b _08012F50 +_08012DF2: + adds r0, r6, 0 + adds r0, 0xD + ldr r1, =gUnknown_082EDC78 + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + bne _08012E04 + b _08012F50 +_08012E04: + movs r0, 0x14 + strb r0, [r6, 0xC] + b _08012F50 + .pool +_08012E10: + adds r0, r6, 0 + adds r0, 0xD + movs r1, 0 + bl sub_80170B8 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _08012EC6 + cmp r1, 0 + bgt _08012E30 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08012E36 + b _08012F50 +_08012E30: + cmp r1, 0x1 + beq _08012E36 + b _08012F50 +_08012E36: + ldr r0, =0x02022c2d + ldrb r2, [r0] + movs r0, 0xF0 + ands r0, r2 + cmp r0, 0 + beq _08012E4C + movs r0, 0xF + strb r0, [r6, 0xC] + b _08012F50 + .pool +_08012E4C: + movs r3, 0xF + ldrb r1, [r6, 0x13] + adds r0, r3, 0 + ands r0, r2 + cmp r1, r0 + bne _08012E5C + strb r3, [r6, 0xC] + b _08012F50 +_08012E5C: + movs r0, 0x4 + strb r0, [r6, 0xC] + b _08012F50 +_08012E62: + adds r0, r6, 0 + movs r1, 0x7 + movs r2, 0x1D + bl sub_801320C + lsls r0, 24 + cmp r0, 0 + bne _08012F50 + movs r0, 0x12 + strb r0, [r6, 0xC] + b _08012F50 +_08012E78: + bl sub_800EF1C + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _08012EAE + movs r0, 0 + bl sub_800EF58 + cmp r0, 0 + beq _08012E94 + movs r0, 0x1A + strb r0, [r6, 0xC] + b _08012F50 +_08012E94: + ldrh r0, [r6, 0x1A] + adds r0, 0x1 + strh r0, [r6, 0x1A] + lsls r0, 16 + movs r1, 0x96 + lsls r1, 17 + cmp r0, r1 + bls _08012F50 + movs r0, 0x1D + strb r0, [r6, 0xC] + movs r0, 0 + strb r0, [r6, 0xD] + b _08012F50 +_08012EAE: + movs r0, 0x1D + strb r0, [r6, 0xC] + strb r1, [r6, 0xD] + b _08012F50 +_08012EB6: + adds r0, r6, 0 + adds r0, 0xD + ldr r1, =gUnknown_082EDD58 + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + beq _08012F50 +_08012EC6: + movs r0, 0x17 + strb r0, [r6, 0xC] + b _08012F50 + .pool +_08012ED0: + bl sub_800E084 + bl sub_800EDD4 + adds r0, r6, 0 + bl sub_8012F64 + ldrb r0, [r6, 0xC] + adds r0, 0x1 + strb r0, [r6, 0xC] + b _08012F50 +_08012EE6: + bl script_env_2_enable_and_set_ctx_running + adds r0, r4, 0 + bl remove_task + ldr r1, =0x020375f0 + movs r0, 0x5 + strh r0, [r1] + b _08012F50 + .pool +_08012EFC: + bl script_env_2_enable_and_set_ctx_running + adds r0, r4, 0 + bl remove_task + ldr r1, =0x020375f0 + movs r0, 0x8 + strh r0, [r1] + b _08012F50 + .pool +_08012F14: + bl sub_8011A80 + cmp r0, 0 + beq _08012F22 + movs r0, 0x1D + strb r0, [r6, 0xC] + b _08012F50 +_08012F22: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _08012F50 + ldr r0, =0x02022c2c + ldrb r0, [r0] + bl sub_80126CC + cmp r0, 0 + beq _08012F3A + bl sub_801103C +_08012F3A: + movs r0, 0x1 + bl sub_8011068 + bl sub_80149C4 + adds r0, r6, 0 + bl sub_8012F64 + adds r0, r4, 0 + bl remove_task +_08012F50: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8012780 + + thumb_func_start sub_8012F64 +sub_8012F64: @ 8012F64 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0x11] + bl ClearWindowTilemap + ldrb r0, [r4, 0x11] + movs r1, 0 + bl sub_819746C + ldrb r0, [r4, 0x12] + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + ldrb r0, [r4, 0x10] + bl ClearWindowTilemap + ldrb r0, [r4, 0xF] + movs r1, 0 + bl sub_819746C + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldrb r0, [r4, 0x11] + bl RemoveWindow + ldrb r0, [r4, 0xF] + bl RemoveWindow + ldrb r0, [r4, 0x10] + bl RemoveWindow + ldrb r0, [r4, 0x17] + bl remove_task + ldr r0, [r4, 0x8] + bl Free + ldr r0, [r4] + bl Free + ldr r0, [r4, 0x4] + bl Free + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8012F64 + + thumb_func_start sub_8012FC4 +sub_8012FC4: @ 8012FC4 + push {lr} + adds r2, r0, 0 + lsls r1, 24 + lsrs r1, 24 + subs r0, r1, 0x1 + cmp r0, 0x1B + bhi _08013070 + lsls r0, 2 + ldr r1, =_08012FE0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08012FE0: + .4byte _08013050 + .4byte _08013050 + .4byte _08013068 + .4byte _08013050 + .4byte _08013070 + .4byte _08013070 + .4byte _08013070 + .4byte _08013070 + .4byte _08013068 + .4byte _08013068 + .4byte _08013068 + .4byte _08013070 + .4byte _08013070 + .4byte _08013050 + .4byte _08013068 + .4byte _08013068 + .4byte _08013070 + .4byte _08013070 + .4byte _08013070 + .4byte _08013070 + .4byte _08013058 + .4byte _08013058 + .4byte _08013068 + .4byte _08013068 + .4byte _08013068 + .4byte _08013068 + .4byte _08013068 + .4byte _08013050 +_08013050: + ldr r1, =gUnknown_082EDBE8 + b _0801305A + .pool +_08013058: + ldr r1, =gUnknown_082EDC0C +_0801305A: + adds r0, r2, 0 + bl ExpandStringRefs + b _08013070 + .pool +_08013068: + ldr r1, =gUnknown_082EDC34 + adds r0, r2, 0 + bl ExpandStringRefs +_08013070: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8012FC4 + + thumb_func_start sub_8013078 +sub_8013078: @ 8013078 + push {lr} + lsls r1, 24 + lsrs r1, 24 + adds r2, r1, 0 + cmp r1, 0x44 + beq _08013098 + cmp r1, 0x44 + bgt _0801308E + cmp r1, 0x41 + beq _08013098 + b _080130AA +_0801308E: + cmp r2, 0x45 + beq _080130A4 + cmp r2, 0x48 + beq _080130A4 + b _080130AA +_08013098: + ldr r1, =gUnknown_082EE560 + bl ExpandStringRefs + b _080130AA + .pool +_080130A4: + ldr r1, =gUnknown_082EE57C + bl ExpandStringRefs +_080130AA: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8013078 + + thumb_func_start sub_80130B4 +sub_80130B4: @ 80130B4 + push {lr} + adds r2, r0, 0 + lsls r1, 24 + lsrs r1, 24 + subs r0, r1, 0x1 + cmp r0, 0x1B + bhi _08013158 + lsls r0, 2 + ldr r1, =_080130D0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080130D0: + .4byte _08013140 + .4byte _08013140 + .4byte _08013150 + .4byte _08013140 + .4byte _08013158 + .4byte _08013158 + .4byte _08013158 + .4byte _08013158 + .4byte _08013150 + .4byte _08013150 + .4byte _08013150 + .4byte _08013158 + .4byte _08013158 + .4byte _08013140 + .4byte _08013150 + .4byte _08013150 + .4byte _08013158 + .4byte _08013158 + .4byte _08013158 + .4byte _08013158 + .4byte _08013140 + .4byte _08013140 + .4byte _08013150 + .4byte _08013150 + .4byte _08013150 + .4byte _08013150 + .4byte _08013150 + .4byte _08013140 +_08013140: + ldr r1, =gUnknown_082EFC3C + adds r0, r2, 0 + bl ExpandStringRefs + b _08013158 + .pool +_08013150: + ldr r1, =gUnknown_082EFC54 + adds r0, r2, 0 + bl ExpandStringRefs +_08013158: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80130B4 + + thumb_func_start sub_8013160 +sub_8013160: @ 8013160 + push {lr} + adds r2, r0, 0 + lsls r1, 24 + lsrs r1, 24 + subs r0, r1, 0x1 + cmp r0, 0x1B + bhi _08013204 + lsls r0, 2 + ldr r1, =_0801317C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0801317C: + .4byte _080131EC + .4byte _080131EC + .4byte _080131FC + .4byte _080131EC + .4byte _08013204 + .4byte _08013204 + .4byte _08013204 + .4byte _08013204 + .4byte _080131FC + .4byte _080131FC + .4byte _080131FC + .4byte _08013204 + .4byte _08013204 + .4byte _080131EC + .4byte _080131FC + .4byte _080131FC + .4byte _08013204 + .4byte _08013204 + .4byte _08013204 + .4byte _08013204 + .4byte _080131EC + .4byte _080131EC + .4byte _080131FC + .4byte _080131FC + .4byte _080131FC + .4byte _080131FC + .4byte _080131FC + .4byte _080131EC +_080131EC: + ldr r1, =gUnknown_082EDDF4 + adds r0, r2, 0 + bl ExpandStringRefs + b _08013204 + .pool +_080131FC: + ldr r1, =gUnknown_082EDE0C + adds r0, r2, 0 + bl ExpandStringRefs +_08013204: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8013160 + + thumb_func_start sub_801320C +sub_801320C: @ 801320C + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + adds r5, r2, 0 + ldr r0, [r4] + bl sub_80132D4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08013228 + cmp r0, 0x2 + beq _0801325C + b _08013270 +_08013228: + movs r0, 0x2 + bl audio_play + ldrb r0, [r4, 0x12] + bl sub_81AE70C + ldr r0, =0x02021dc4 + ldrb r2, [r4, 0x13] + lsls r2, 5 + ldr r1, [r4] + adds r1, r2 + bl sub_8018404 + ldr r0, =0x02021fc4 + ldr r1, =0x02022c2c + ldrb r1, [r1] + bl sub_8012FC4 + strb r6, [r4, 0xC] + b _08013270 + .pool +_0801325C: + movs r0, 0 + movs r1, 0 + bl sub_8011A64 + ldrb r0, [r4, 0x12] + bl sub_81AE70C + strb r5, [r4, 0xC] + movs r0, 0x1 + b _08013272 +_08013270: + movs r0, 0 +_08013272: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_801320C + + thumb_func_start sub_8013278 +sub_8013278: @ 8013278 + push {r4-r6,lr} + sub sp, 0x8 + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r0, =0x02022c30 + ldr r3, [r0] + movs r2, 0 + ldr r1, [r3] + lsls r0, r4, 5 + adds r1, r0 + ldrb r0, [r1, 0x1A] + lsls r0, 30 + lsrs r0, 30 + cmp r0, 0x1 + beq _080132A8 + cmp r0, 0x2 + beq _080132B2 + b _080132B4 + .pool +_080132A8: + ldrb r0, [r1, 0x1B] + cmp r0, 0 + beq _080132B4 + movs r2, 0x2 + b _080132B4 +_080132B2: + movs r2, 0x1 +_080132B4: + lsls r0, r4, 5 + ldr r3, [r3] + adds r3, r0 + str r2, [sp] + lsls r0, r4, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + adds r0, r5, 0 + movs r1, 0 + adds r2, r6, 0 + bl sub_80178A0 + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8013278 + + thumb_func_start sub_80132D4 +sub_80132D4: @ 80132D4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + ldr r0, =0x02022c30 + ldr r5, [r0] + movs r0, 0 + mov r8, r0 + movs r3, 0x1 +_080132E8: + ldr r0, [r5] + lsls r6, r3, 5 + adds r2, r0, r6 + ldrb r0, [r2, 0x1A] + lsls r0, 30 + lsrs r0, 30 + mov r9, r0 + cmp r0, 0x1 + bne _08013348 + ldr r1, [r5, 0x4] + adds r0, r2, 0 + str r3, [sp] + bl sub_80176E4 + adds r4, r0, 0 + ldr r3, [sp] + cmp r4, 0xFF + beq _08013330 + ldr r1, [r5] + ldr r0, [r5, 0x4] + lsls r2, r4, 3 + subs r2, r4 + lsls r2, 2 + adds r1, r6 + adds r0, r2 + ldm r0!, {r2,r4,r7} + stm r1!, {r2,r4,r7} + ldm r0!, {r2,r4,r7} + stm r1!, {r2,r4,r7} + ldr r0, [r5] + adds r0, r6 + mov r1, r9 + strh r1, [r0, 0x18] + b _08013348 + .pool +_08013330: + ldr r2, [r5] + adds r2, r6 + ldrb r1, [r2, 0x1A] + movs r4, 0x4 + negs r4, r4 + adds r0, r4, 0 + ands r1, r0 + movs r0, 0x2 + orrs r1, r0 + strb r1, [r2, 0x1A] + movs r7, 0x2 + mov r8, r7 +_08013348: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x4 + bls _080132E8 + movs r6, 0 + movs r4, 0x3 +_08013356: + ldr r0, [r5] + ldr r1, [r5, 0x4] + adds r1, r6 + movs r2, 0x5 + bl sub_8017734 + adds r6, 0x1C + subs r4, 0x1 + ldr r0, [r5] + cmp r4, 0 + bge _08013356 + mov r1, r8 + cmp r1, 0x2 + beq _08013388 + adds r1, r0, 0 + movs r4, 0x4 +_08013376: + ldrb r0, [r1, 0x1B] + cmp r0, 0 + beq _08013380 + movs r2, 0x1 + mov r8, r2 +_08013380: + adds r1, 0x20 + subs r4, 0x1 + cmp r4, 0 + bge _08013376 +_08013388: + 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_80132D4 + + thumb_func_start sub_8013398 +sub_8013398: @ 8013398 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =0x02022c30 + ldr r4, [r0] + movs r3, 0 +_080133A8: + ldr r0, [r4, 0x8] + lsls r2, r3, 5 + ldr r1, [r4] + adds r0, r2 + adds r1, r2 + ldm r1!, {r2,r5,r6} + stm r0!, {r2,r5,r6} + ldm r1!, {r2,r5,r7} + stm r0!, {r2,r5,r7} + ldm r1!, {r6,r7} + stm r0!, {r6,r7} + adds r3, 0x1 + ldr r0, [r4, 0x8] + ldr r1, [r4] + cmp r3, 0x4 + ble _080133A8 + movs r5, 0 + mov r8, r1 + mov r9, r0 + movs r3, 0x4 +_080133D0: + mov r1, r9 + ldrb r0, [r1, 0x1A] + lsls r0, 30 + lsrs r0, 30 + cmp r0, 0x1 + bne _080133F2 + lsls r0, r5, 5 + add r0, r8 + ldm r1!, {r2,r6,r7} + stm r0!, {r2,r6,r7} + ldm r1!, {r2,r6,r7} + stm r0!, {r2,r6,r7} + ldm r1!, {r2,r6} + stm r0!, {r2,r6} + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080133F2: + movs r7, 0x20 + add r9, r7 + subs r3, 0x1 + cmp r3, 0 + bge _080133D0 + mov r10, r5 + cmp r5, 0x4 + bhi _08013454 + ldr r0, =gUnknown_082F045C + mov r9, r0 + movs r1, 0 + mov r12, r1 + movs r2, 0x4 + negs r2, r2 + mov r8, r2 +_08013410: + ldr r1, [r4] + lsls r3, r5, 5 + adds r1, r3 + mov r0, r9 + ldm r0!, {r2,r6,r7} + stm r1!, {r2,r6,r7} + ldm r0!, {r2,r6,r7} + stm r1!, {r2,r6,r7} + ldr r0, [r4] + adds r0, r3 + movs r1, 0 + strh r1, [r0, 0x18] + ldr r1, [r4] + adds r1, r3 + ldrb r2, [r1, 0x1A] + mov r0, r8 + ands r0, r2 + strb r0, [r1, 0x1A] + ldr r1, [r4] + adds r1, r3 + ldrb r2, [r1, 0x1A] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1A] + ldr r0, [r4] + adds r0, r3 + mov r6, r12 + strb r6, [r0, 0x1B] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x4 + bls _08013410 +_08013454: + movs r3, 0 + ldr r1, [r4] + ldrb r0, [r1, 0x1A] + lsls r0, 30 + lsrs r0, 30 + cmp r0, 0x1 + bne _08013474 + ldrb r0, [r1, 0x1B] + cmp r0, 0x40 + bne _08013474 + mov r10, r3 + b _08013494 + .pool +_08013474: + adds r3, 0x1 + cmp r3, 0x4 + bgt _08013494 + lsls r0, r3, 5 + adds r2, r1, r0 + ldrb r0, [r2, 0x1A] + lsls r0, 30 + lsrs r0, 30 + cmp r0, 0x1 + bne _08013474 + ldrb r0, [r2, 0x1B] + cmp r0, 0x40 + bne _08013474 + lsls r0, r3, 24 + lsrs r0, 24 + mov r10, r0 +_08013494: + mov r0, r10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8013398 + + thumb_func_start BerryBlenderLinkJoinGroup +BerryBlenderLinkJoinGroup: @ 80134A4 + push {lr} + ldr r0, =sub_80134E8 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02022c30 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r1, r0 + str r1, [r2] + ldr r0, =0x03000da4 + str r1, [r0] + movs r0, 0 + strb r0, [r1, 0x8] + strb r0, [r1, 0x9] + ldr r1, =0x020375f0 + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end BerryBlenderLinkJoinGroup + + thumb_func_start sub_80134E8 +sub_80134E8: @ 80134E8 + push {r4-r7,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02022c30 + ldr r6, [r0] + ldrb r0, [r6, 0x8] + cmp r0, 0x17 + bls _080134FC + b _08013B82 +_080134FC: + lsls r0, 2 + ldr r1, =_08013510 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08013510: + .4byte _08013570 + .4byte _080135E0 + .4byte _0801360C + .4byte _080136D8 + .4byte _08013B82 + .4byte _08013788 + .4byte _080137C4 + .4byte _08013A10 + .4byte _08013A2C + .4byte _08013A7A + .4byte _08013A8C + .4byte _08013B14 + .4byte _08013A8C + .4byte _08013AE4 + .4byte _08013A8C + .4byte _08013B24 + .4byte _08013B82 + .4byte _08013B82 + .4byte _08013A8C + .4byte _08013B44 + .4byte _08013A8C + .4byte _08013B78 + .4byte _08013B82 + .4byte _08013B68 +_08013570: + ldr r0, =0x020375e0 + ldrh r2, [r0] + adds r3, r0, 0 + cmp r2, 0x14 + bne _08013590 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + bne _08013590 + adds r0, r2, 0x1 + strh r0, [r3] +_08013590: + ldr r2, =0x02022c2c + ldr r1, =gUnknown_082F0530 + ldrh r0, [r3] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + ldrb r0, [r2] + movs r1, 0 + movs r2, 0 + bl sub_8010F84 + bl sub_800B488 + bl sub_8009734 + bl sub_8011C5C + movs r0, 0x70 + bl AllocZeroed + str r0, [r6, 0x4] + movs r0, 0x80 + lsls r0, 2 + bl AllocZeroed + str r0, [r6] + movs r0, 0x1 + strb r0, [r6, 0x8] + b _08013B82 + .pool +_080135E0: + adds r0, r6, 0 + adds r0, 0x9 + ldr r2, =gUnknown_082EFB70 + ldr r1, =0x020375e0 + ldrh r1, [r1] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + bne _080135FC + b _08013B82 +_080135FC: + movs r0, 0x2 + strb r0, [r6, 0x8] + b _08013B82 + .pool +_0801360C: + ldr r0, [r6, 0x4] + movs r1, 0x4 + bl sub_80175EC + ldr r0, [r6] + movs r1, 0x10 + bl sub_8017580 + ldr r0, [r6, 0x4] + ldr r1, =0x020375e0 + ldrh r1, [r1] + bl sub_8016FC0 + movs r4, 0 + strb r0, [r6, 0x11] + ldr r0, =gUnknown_082F00BC + bl AddWindow + strb r0, [r6, 0xC] + ldr r0, =gUnknown_082F0174 + bl AddWindow + strb r0, [r6, 0xB] + ldr r0, =gUnknown_082F017C + bl AddWindow + strb r0, [r6, 0xD] + ldrb r0, [r6, 0xC] + movs r1, 0x22 + bl FillWindowPixelBuffer + ldrb r0, [r6, 0xC] + ldr r2, =gUnknown_082EF7DC + movs r1, 0x1 + str r1, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + movs r1, 0 + movs r3, 0x8 + bl sub_80173E0 + ldrb r0, [r6, 0xC] + bl PutWindowTilemap + ldrb r0, [r6, 0xC] + movs r1, 0x2 + bl CopyWindowToVram + ldrb r0, [r6, 0xB] + movs r1, 0 + bl sub_81973FC + ldr r0, =0x03006310 + adds r2, r0, 0 + ldr r1, =gUnknown_082F0204 + ldm r1!, {r3,r5,r7} + stm r2!, {r3,r5,r7} + ldm r1!, {r3,r5,r7} + stm r2!, {r3,r5,r7} + ldrb r1, [r6, 0xB] + strb r1, [r0, 0x10] + movs r1, 0 + movs r2, 0 + bl ListMenuInit + strb r0, [r6, 0xE] + ldrb r0, [r6, 0xD] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r6, 0xD] + bl PutWindowTilemap + ldrb r0, [r6, 0xD] + bl sub_80125BC + ldrb r0, [r6, 0xD] + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0 + bl CopyBgTilemapBufferToVram + strb r4, [r6, 0xF] + movs r0, 0x3 + strb r0, [r6, 0x8] + b _08013B82 + .pool +_080136D8: + bl sub_8013E44 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _080136F2 + cmp r4, 0x1 + beq _080136EA + b _08013A72 +_080136EA: + movs r0, 0x2 + bl audio_play + b _08013A72 +_080136F2: + ldrb r0, [r6, 0xE] + bl ListMenuHandleInput + adds r4, r0, 0 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08013770 + movs r0, 0x1 + negs r0, r0 + cmp r4, r0 + beq _08013770 + ldr r0, [r6] + lsls r1, r4, 5 + adds r0, r1 + ldrb r1, [r0, 0xA] + ldrb r0, [r0, 0x1A] + lsls r0, 30 + lsrs r0, 30 + cmp r0, 0x1 + bne _08013768 + lsrs r0, r1, 7 + cmp r0, 0 + bne _08013768 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_8013B8C + adds r1, r0, 0 + cmp r1, 0 + bne _08013744 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_8013BD8 + movs r0, 0x5 + b _08013756 + .pool +_08013744: + ldr r0, =0x02021fc4 + ldr r2, =gUnknown_082EDD50 + subs r1, 0x1 + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl CopyString + movs r0, 0x12 +_08013756: + strb r0, [r6, 0x8] + movs r0, 0x6E + bl audio_play + b _08013B82 + .pool +_08013768: + movs r0, 0x7 + bl audio_play + b _08013B82 +_08013770: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0801377E + b _08013B82 +_0801377E: + movs r0, 0xA + strb r0, [r6, 0x8] + b _08013B82 + .pool +_08013788: + ldr r4, =0x02021fc4 + ldr r0, =0x02022c2c + ldrb r1, [r0] + adds r0, r4, 0 + bl sub_80130B4 + adds r0, r6, 0 + adds r0, 0x9 + adds r1, r4, 0 + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + bne _080137A6 + b _08013B82 +_080137A6: + ldr r0, =0x02021cc4 + ldrb r2, [r6, 0xF] + lsls r2, 5 + ldr r1, [r6] + adds r1, r2 + bl sub_8018404 + b _08013A86 + .pool +_080137C4: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _0801387A + ldr r4, =0x02022c2c + ldr r1, [r6] + ldrb r0, [r6, 0xF] + lsls r0, 5 + adds r1, r0 + ldrb r0, [r1, 0xA] + lsls r0, 25 + lsrs r0, 25 + strb r0, [r4] + movs r0, 0 + movs r1, 0 + bl sub_8011A64 + ldrb r0, [r4] + subs r0, 0x1 + cmp r0, 0x1B + bhi _0801387A + lsls r0, 2 + ldr r1, =_08013804 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08013804: + .4byte _08013874 + .4byte _08013874 + .4byte _08013874 + .4byte _08013874 + .4byte _08013874 + .4byte _0801387A + .4byte _0801387A + .4byte _0801387A + .4byte _08013874 + .4byte _08013874 + .4byte _08013874 + .4byte _0801387A + .4byte _08013874 + .4byte _08013874 + .4byte _08013874 + .4byte _08013874 + .4byte _0801387A + .4byte _0801387A + .4byte _0801387A + .4byte _0801387A + .4byte _08013874 + .4byte _08013874 + .4byte _08013874 + .4byte _08013874 + .4byte _08013874 + .4byte _08013874 + .4byte _08013874 + .4byte _08013874 +_08013874: + movs r0, 0x14 + strb r0, [r6, 0x8] + b _08013B82 +_0801387A: + bl sub_8011A74 + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x1 + cmp r0, 0x8 + bls _0801388A + b _080139EC +_0801388A: + lsls r0, 2 + ldr r1, =_08013898 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08013898: + .4byte _080138BC + .4byte _080138C2 + .4byte _080139EC + .4byte _080139EC + .4byte _080138C8 + .4byte _080138C2 + .4byte _08013934 + .4byte _080139EC + .4byte _080138C2 +_080138BC: + movs r0, 0xC + strb r0, [r6, 0x8] + b _080139EC +_080138C2: + movs r0, 0xE + strb r0, [r6, 0x8] + b _080139EC +_080138C8: + ldr r5, =0x02021fc4 + ldr r4, =0x02022c2c + ldrb r1, [r4] + adds r0, r5, 0 + bl sub_8013160 + adds r0, r6, 0 + adds r0, 0x9 + adds r1, r5, 0 + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + bne _080138E6 + b _080139EC +_080138E6: + ldrb r0, [r4] + cmp r0, 0x1C + beq _080138F0 + cmp r0, 0xE + bne _08013904 +_080138F0: + movs r0, 0xC + movs r1, 0 + bl sub_8011A64 + b _080139EC + .pool +_08013904: + movs r0, 0x7 + movs r1, 0 + bl sub_8011A64 + ldr r0, =0x02021cc4 + ldr r2, =gUnknown_082F0048 + ldrb r1, [r4] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl CopyString + ldr r1, =gUnknown_082EDE48 + adds r0, r5, 0 + bl ExpandStringRefs + b _080139EC + .pool +_08013934: + ldrb r0, [r6, 0x15] + adds r2, r0, 0 + cmp r2, 0xF0 + bls _0801395C + adds r0, r6, 0 + adds r0, 0x9 + ldr r1, =0x02021fc4 + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + beq _080139EC + movs r0, 0xC + movs r1, 0 + bl sub_8011A64 + movs r0, 0 + b _080139EA + .pool +_0801395C: + ldr r0, =0x02022c2c + ldrb r0, [r0] + subs r0, 0x1 + cmp r0, 0x1B + bhi _080139E8 + lsls r0, 2 + ldr r1, =_08013978 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08013978: + .4byte _080139EC + .4byte _080139EC + .4byte _080139E8 + .4byte _080139EC + .4byte _080139E8 + .4byte _080139E8 + .4byte _080139E8 + .4byte _080139E8 + .4byte _080139E8 + .4byte _080139E8 + .4byte _080139E8 + .4byte _080139E8 + .4byte _080139E8 + .4byte _080139EC + .4byte _080139E8 + .4byte _080139E8 + .4byte _080139E8 + .4byte _080139E8 + .4byte _080139E8 + .4byte _080139E8 + .4byte _080139E8 + .4byte _080139E8 + .4byte _080139E8 + .4byte _080139E8 + .4byte _080139E8 + .4byte _080139E8 + .4byte _080139E8 + .4byte _080139EC +_080139E8: + adds r0, r2, 0x1 +_080139EA: + strb r0, [r6, 0x15] +_080139EC: + bl sub_8011A74 + lsls r0, 24 + cmp r0, 0 + beq _080139F8 + b _08013B82 +_080139F8: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08013A06 + b _08013B82 +_08013A06: + movs r0, 0x7 + strb r0, [r6, 0x8] + b _08013B82 + .pool +_08013A10: + adds r0, r6, 0 + adds r0, 0x9 + ldr r1, =gUnknown_082EDE64 + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + bne _08013A22 + b _08013B82 +_08013A22: + movs r0, 0x8 + strb r0, [r6, 0x8] + b _08013B82 + .pool +_08013A2C: + adds r4, r6, 0 + adds r4, 0x9 + bl sub_8011A74 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_80170B8 + lsls r0, 24 + asrs r1, r0, 24 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08013A6A + cmp r1, r0 + bgt _08013A58 + subs r0, 0x2 + cmp r1, r0 + beq _08013A6E + b _08013B82 +_08013A58: + cmp r1, 0 + beq _08013A62 + cmp r1, 0x1 + beq _08013A6A + b _08013B82 +_08013A62: + bl sub_80106D4 + movs r0, 0x9 + b _08013A70 +_08013A6A: + movs r0, 0x5 + b _08013A70 +_08013A6E: + movs r0, 0x6 +_08013A70: + strb r0, [r6, 0x8] +_08013A72: + ldrb r0, [r6, 0xE] + bl sub_81AE70C + b _08013B82 +_08013A7A: + bl sub_8011A74 + lsls r0, 24 + cmp r0, 0 + bne _08013A86 + b _08013B82 +_08013A86: + movs r0, 0x6 + strb r0, [r6, 0x8] + b _08013B82 +_08013A8C: + ldrb r0, [r6, 0xD] + bl ClearWindowTilemap + ldrb r0, [r6, 0xD] + movs r1, 0 + bl sub_819746C + ldrb r0, [r6, 0xE] + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + ldrb r0, [r6, 0xC] + bl ClearWindowTilemap + ldrb r0, [r6, 0xB] + movs r1, 0 + bl sub_819746C + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldrb r0, [r6, 0xD] + bl RemoveWindow + ldrb r0, [r6, 0xB] + bl RemoveWindow + ldrb r0, [r6, 0xC] + bl RemoveWindow + ldrb r0, [r6, 0x11] + bl remove_task + ldr r0, [r6] + bl Free + ldr r0, [r6, 0x4] + bl Free + ldrb r0, [r6, 0x8] + adds r0, 0x1 + strb r0, [r6, 0x8] + b _08013B82 +_08013AE4: + bl sub_800E084 + adds r5, r6, 0 + adds r5, 0x9 + ldr r4, =gUnknown_082EDE9C + bl sub_8011A74 + lsls r0, 24 + lsrs r0, 22 + adds r0, r4 + ldr r1, [r0] + adds r0, r5, 0 + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + beq _08013B82 + ldr r0, =0x020375f0 + movs r1, 0x6 + b _08013B58 + .pool +_08013B14: + bl sub_800E084 + ldr r0, =0x020375f0 + movs r1, 0x5 + b _08013B58 + .pool +_08013B24: + bl sub_800E084 + adds r5, r6, 0 + adds r5, 0x9 + ldr r4, =gUnknown_082EDE9C + bl sub_8011A74 + lsls r0, 24 + lsrs r0, 22 + adds r0, r4 + ldr r1, [r0] + adds r0, r5, 0 + b _08013B4A + .pool +_08013B44: + adds r0, r6, 0 + adds r0, 0x9 + ldr r1, =0x02021fc4 +_08013B4A: + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + beq _08013B82 + ldr r0, =0x020375f0 + movs r1, 0x8 +_08013B58: + strh r1, [r0] + movs r0, 0x17 + strb r0, [r6, 0x8] + b _08013B82 + .pool +_08013B68: + adds r0, r4, 0 + bl remove_task + bl sub_80173D4 + bl sub_800EDD4 + b _08013B82 +_08013B78: + bl sub_80149C4 + adds r0, r4, 0 + bl remove_task +_08013B82: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80134E8 + + thumb_func_start sub_8013B8C +sub_8013B8C: @ 8013B8C + push {lr} + lsls r1, 5 + ldr r0, [r0] + adds r3, r0, r1 + ldr r0, =0x02022c2c + ldrb r0, [r0] + cmp r0, 0x4 + bne _08013BCE + ldrb r1, [r3, 0x1] + movs r0, 0x3C + ands r0, r1 + cmp r0, 0xC + beq _08013BCE + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r1, [r0, 0x9] + movs r2, 0x80 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _08013BC4 + movs r0, 0x1 + b _08013BD4 + .pool +_08013BC4: + ldrb r1, [r3] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _08013BD2 +_08013BCE: + movs r0, 0 + b _08013BD4 +_08013BD2: + movs r0, 0x2 +_08013BD4: + pop {r1} + bx r1 + thumb_func_end sub_8013B8C + + thumb_func_start sub_8013BD8 +sub_8013BD8: @ 8013BD8 + push {r4,lr} + adds r4, r0, 0 + strb r1, [r4, 0xF] + bl sub_800E0E8 + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + ldrb r0, [r4, 0xE] + bl sub_81AE70C + ldr r0, =0x02021cc4 + ldrb r2, [r4, 0xF] + lsls r2, 5 + ldr r1, [r4] + adds r1, r2 + bl sub_8018404 + ldr r1, =gUnknown_082F0530 + ldr r0, =0x020375e0 + ldrh r0, [r0] + adds r0, r1 + ldrb r0, [r0] + movs r1, 0 + movs r2, 0x1 + bl sub_8011090 + ldrb r1, [r4, 0xF] + lsls r1, 5 + ldr r0, [r4] + adds r0, r1 + adds r4, r0, 0 + adds r4, 0x10 + adds r0, 0x2 + bl sub_8015658 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_8011FC8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8013BD8 + + thumb_func_start sub_8013C40 +sub_8013C40: @ 8013C40 + push {lr} + ldr r0, =sub_8013C7C + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r3, =0x02022c30 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r2, =0x03005e08 + adds r1, r2 + str r1, [r3] + movs r2, 0 + strb r2, [r1, 0x8] + strb r2, [r1, 0x9] + ldr r2, =0x03000da4 + str r1, [r2] + pop {r1} + bx r1 + .pool + thumb_func_end sub_8013C40 + + thumb_func_start sub_8013C7C +sub_8013C7C: @ 8013C7C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02022c30 + ldr r4, [r0] + ldrb r0, [r4, 0x8] + cmp r0, 0xB + bhi _08013D80 + lsls r0, 2 + ldr r1, =_08013CA0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08013CA0: + .4byte _08013CD0 + .4byte _08013D80 + .4byte _08013D04 + .4byte _08013D28 + .4byte _08013D80 + .4byte _08013D80 + .4byte _08013D80 + .4byte _08013D80 + .4byte _08013D80 + .4byte _08013D80 + .4byte _08013D58 + .4byte _08013D76 +_08013CD0: + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl sub_8010F84 + bl sub_800B488 + bl sub_8009734 + bl sub_8011C5C + movs r0, 0x1 + bl sub_80111B0 + movs r0, 0x70 + bl AllocZeroed + str r0, [r4, 0x4] + movs r0, 0x80 + lsls r0, 2 + bl AllocZeroed + str r0, [r4] + movs r0, 0x2 + strb r0, [r4, 0x8] + b _08013D80 +_08013D04: + ldr r0, [r4, 0x4] + movs r1, 0x4 + bl sub_80175EC + ldr r0, [r4] + movs r1, 0x10 + bl sub_8017580 + ldr r0, [r4, 0x4] + movs r1, 0xFF + bl sub_8016FC0 + movs r1, 0 + strb r0, [r4, 0x11] + strb r1, [r4, 0xF] + movs r0, 0x3 + strb r0, [r4, 0x8] + b _08013D80 +_08013D28: + bl sub_8013E44 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08013D3A + movs r0, 0x2 + bl audio_play +_08013D3A: + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + movs r2, 0x26 + ldrsh r0, [r1, r2] + cmp r0, 0xFF + bne _08013D80 + movs r0, 0xA + strb r0, [r4, 0x8] + b _08013D80 + .pool +_08013D58: + ldrb r0, [r4, 0x11] + bl remove_task + ldr r0, [r4] + bl Free + ldr r0, [r4, 0x4] + bl Free + bl sub_800EDD4 + ldrb r0, [r4, 0x8] + adds r0, 0x1 + strb r0, [r4, 0x8] + b _08013D80 +_08013D76: + bl sub_800EDD4 + adds r0, r5, 0 + bl remove_task +_08013D80: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8013C7C + + thumb_func_start sub_8013D88 +sub_8013D88: @ 8013D88 + push {lr} + adds r2, r0, 0 + cmp r1, 0xFF + bne _08013D94 +_08013D90: + movs r0, 0x1 + b _08013DB8 +_08013D94: + cmp r1, 0x16 + bhi _08013DB6 + ldr r0, =gUnknown_082F04D8 + lsls r1, 2 + adds r1, r0 + ldr r1, [r1] + b _08013DB0 + .pool +_08013DA8: + ldrb r0, [r1] + cmp r0, r2 + beq _08013D90 + adds r1, 0x1 +_08013DB0: + ldrb r0, [r1] + cmp r0, 0xFF + bne _08013DA8 +_08013DB6: + movs r0, 0 +_08013DB8: + pop {r1} + bx r1 + thumb_func_end sub_8013D88 + + thumb_func_start sub_8013DBC +sub_8013DBC: @ 8013DBC + push {lr} + ldr r0, [r0] + lsls r1, 5 + adds r1, r0, r1 + ldrb r2, [r1, 0x1A] + lsls r0, r2, 30 + lsrs r0, 30 + cmp r0, 0x1 + bne _08013DEE + ldrb r0, [r1, 0xA] + lsrs r0, 7 + cmp r0, 0 + beq _08013DDA + movs r0, 0x3 + b _08013DF0 +_08013DDA: + lsls r0, r2, 29 + cmp r0, 0 + bge _08013DE4 + movs r0, 0x1 + b _08013DF0 +_08013DE4: + ldrb r0, [r1, 0x1B] + cmp r0, 0 + beq _08013DEE + movs r0, 0x2 + b _08013DF0 +_08013DEE: + movs r0, 0 +_08013DF0: + pop {r1} + bx r1 + thumb_func_end sub_8013DBC + + thumb_func_start sub_8013DF4 +sub_8013DF4: @ 8013DF4 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x8 + adds r5, r0, 0 + adds r4, r1, 0 + adds r6, r2, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + ldr r0, =0x02022c30 + ldr r0, [r0] + mov r8, r0 + bl sub_8013DBC + lsls r0, 24 + lsrs r0, 24 + lsls r1, r4, 5 + mov r2, r8 + ldr r3, [r2] + adds r3, r1 + str r0, [sp] + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x4] + adds r0, r5, 0 + movs r1, 0x8 + adds r2, r6, 0 + bl sub_80177B8 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8013DF4 + + thumb_func_start sub_8013E44 +sub_8013E44: @ 8013E44 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + ldr r0, =0x02022c30 + ldr r6, [r0] + movs r7, 0 + movs r3, 0 +_08013E54: + ldr r0, [r6] + lsls r5, r3, 5 + adds r2, r0, r5 + ldrb r0, [r2, 0x1A] + lsls r0, 30 + mov r8, r5 + cmp r0, 0 + beq _08013F20 + ldr r1, [r6, 0x4] + adds r0, r2, 0 + str r3, [sp] + bl sub_80176E4 + adds r4, r0, 0 + ldr r3, [sp] + cmp r4, 0xFF + beq _08013EEE + ldr r0, [r6] + adds r2, r0, r5 + ldrb r1, [r2, 0x1A] + lsls r0, r1, 30 + lsrs r0, 30 + cmp r0, 0x1 + bne _08013ECC + lsls r0, r4, 3 + subs r0, r4 + lsls r4, r0, 2 + ldr r1, [r6, 0x4] + adds r1, r4 + adds r0, r2, 0 + bl sub_8017678 + ldr r3, [sp] + cmp r0, 0 + beq _08013EB0 + ldr r1, [r6] + ldr r0, [r6, 0x4] + adds r1, r5 + adds r0, r4 + ldm r0!, {r2,r4,r7} + stm r1!, {r2,r4,r7} + ldm r0!, {r2,r4,r7} + stm r1!, {r2,r4,r7} + b _08013EDA + .pool +_08013EB0: + ldr r0, [r6] + adds r1, r0, r5 + ldrb r0, [r1, 0x1B] + cmp r0, 0 + beq _08013EE4 + subs r0, 0x1 + strb r0, [r1, 0x1B] + ldr r0, [r6] + adds r0, r5 + ldrb r0, [r0, 0x1B] + cmp r0, 0 + bne _08013EE4 + movs r7, 0x2 + b _08013EE4 +_08013ECC: + movs r4, 0x4 + negs r4, r4 + adds r0, r4, 0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x1A] +_08013EDA: + ldr r0, [r6] + adds r0, r5 + movs r1, 0x40 + strb r1, [r0, 0x1B] + movs r7, 0x1 +_08013EE4: + ldr r0, [r6] + add r0, r8 + movs r1, 0 + strh r1, [r0, 0x18] + b _08013F20 +_08013EEE: + ldr r0, [r6] + adds r1, r0, r5 + ldrb r0, [r1, 0x1A] + lsls r0, 30 + lsrs r0, 30 + cmp r0, 0x2 + beq _08013F20 + ldrh r0, [r1, 0x18] + adds r0, 0x1 + strh r0, [r1, 0x18] + ldr r0, [r6] + adds r2, r0, r5 + ldrh r1, [r2, 0x18] + ldr r0, =0x0000012b + cmp r1, r0 + bls _08013F20 + ldrb r0, [r2, 0x1A] + movs r7, 0x4 + negs r7, r7 + adds r1, r7, 0 + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2, 0x1A] + movs r7, 0x2 +_08013F20: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0xF + bls _08013E54 + movs r5, 0 + movs r4, 0x3 +_08013F2E: + ldr r0, [r6] + ldr r1, [r6, 0x4] + adds r1, r5 + movs r2, 0x10 + bl sub_8017734 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _08013F44 + movs r7, 0x1 +_08013F44: + adds r5, 0x1C + subs r4, 0x1 + cmp r4, 0 + bge _08013F2E + adds r0, r7, 0 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8013E44 + + thumb_func_start sub_8013F60 +sub_8013F60: @ 8013F60 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_80773AC + adds r0, r4, 0 + bl remove_task + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8013F60 + + thumb_func_start sub_8013F78 +sub_8013F78: @ 8013F78 + push {lr} + ldr r0, =sub_8013F60 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8013F78 + + thumb_func_start sub_8013F90 +sub_8013F90: @ 8013F90 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x02022c40 + mov r8, r0 + bl link_get_multiplayer_id + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, r8 + bl sub_8018120 + adds r7, r0, 0 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _08013FFC + cmp r0, 0x1 + bgt _08013FD4 + cmp r0, 0 + beq _08013FDE + b _080140BC + .pool +_08013FD4: + cmp r0, 0x2 + beq _08014038 + cmp r0, 0x3 + beq _08014070 + b _080140BC +_08013FDE: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r1, r0 + movs r0, 0 + movs r2, 0x64 + bl link_0800A448 + b _080140BC + .pool +_08013FFC: + bl sub_800A550 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _080140BC + bl link_get_multiplayer_id + adds r1, r0, 0 + ldr r0, =0x02024744 + movs r2, 0x1 + eors r1, r2 + lsls r1, 24 + lsrs r1, 16 + ldr r2, =0x020223c4 + adds r1, r2 + movs r2, 0x64 + bl memcpy + movs r0, 0x32 + bl sav12_xor_increment + bl sub_800A5B4 + b _0801405A + .pool +_08014038: + ldr r4, =0x020228c4 + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r0, =0x00002be0 + adds r1, r0 + adds r0, r4, 0 + movs r2, 0xDC + bl memcpy + movs r0, 0 + adds r1, r4, 0 + movs r2, 0xDC + bl link_0800A448 + lsls r0, 24 + cmp r0, 0 + beq _080140BC +_0801405A: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + b _080140BC + .pool +_08014070: + bl sub_800A550 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _080140BC + ldr r4, =0x020321c0 + bl link_get_multiplayer_id + adds r1, r0, 0 + movs r0, 0x1 + eors r1, r0 + lsls r1, 24 + lsrs r1, 16 + ldr r0, =0x020223c4 + adds r1, r0 + adds r0, r4, 0 + movs r2, 0xD8 + bl memcpy + bl sub_800A5B4 + ldr r1, =0x02032298 + strb r7, [r1] + movs r0, 0x6 + strb r0, [r1, 0x1] + ldr r1, =0x030022c0 + ldr r0, =c2_exit_to_overworld_2_switch + str r0, [r1, 0x8] + ldr r0, =sub_807AE50 + bl SetMainCallback2 + mov r0, r8 + bl sub_801807C + adds r0, r6, 0 + bl remove_task +_080140BC: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8013F90 + + thumb_func_start sub_80140E0 +sub_80140E0: @ 80140E0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _08014104 + cmp r0, 0x1 + beq _0801411C + b _0801419E + .pool +_08014104: + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _08014114 + movs r0, 0x2 + bl sub_800A4D8 +_08014114: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0801419E +_0801411C: + bl sub_800A550 + adds r4, r0, 0 + bl sub_800A9D8 + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _0801419E + movs r4, 0 + ldr r5, =0x020229e8 + b _08014152 + .pool +_08014138: + lsls r1, r4, 8 + ldr r0, =0x020223c4 + adds r3, r1, r0 + movs r0, 0x64 + muls r0, r4 + ldr r1, =0x02039b58 + adds r0, r1 + ldrb r2, [r5] + adds r1, r3, 0 + bl sub_80C3120 + adds r5, 0x1C + adds r4, 0x1 +_08014152: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + blt _08014138 + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08014190 + bl link_get_multiplayer_id + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 16 + ldr r1, =0x020223c4 + adds r3, r0, r1 + adds r0, r3, 0 + adds r0, 0x60 + ldrh r0, [r0] + bl sub_801B94C + b _08014194 + .pool +_08014190: + bl sub_801B940 +_08014194: + bl sub_800A5B4 + adds r0, r6, 0 + bl remove_task +_0801419E: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80140E0 + + thumb_func_start sub_80141A4 +sub_80141A4: @ 80141A4 + push {r4,lr} + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0 + beq _080141C0 + cmp r0, 0x1 + beq _080141D4 + b _080141F2 + .pool +_080141C0: + ldr r0, =sub_80140E0 + movs r1, 0x5 + bl AddTask + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _080141F2 + .pool +_080141D4: + ldr r0, =sub_80140E0 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _080141F2 + bl link_get_multiplayer_id + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =c2_exit_to_overworld_2_switch + bl sub_80C4E74 +_080141F2: + bl RunActiveTasks + bl RunTextPrinters + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80141A4 + + thumb_func_start sub_8014210 +sub_8014210: @ 8014210 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r6, 16 + lsrs r6, 16 + bl sp000_heal_pokemon + bl copy_player_party_to_sav1 + bl copy_bags_and_unk_data_from_save_blocks + ldr r5, =0x020229e8 + ldr r0, =0x00002211 + str r0, [r5, 0x14] + bl link_get_multiplayer_id + adds r4, r0, 0 + bl link_get_multiplayer_id + lsls r4, 24 + lsrs r4, 24 + lsls r1, r4, 3 + subs r1, r4 + lsls r1, 2 + adds r1, r5 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0x18] + bl link_get_multiplayer_id + adds r4, r0, 0 + bl link_get_multiplayer_id + movs r2, 0x1 + eors r4, r2 + lsls r4, 24 + lsrs r4, 24 + lsls r1, r4, 3 + subs r1, r4 + lsls r1, 2 + adds r1, r5 + eors r0, r2 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0x18] + ldr r1, =0x030022c0 + ldr r0, =sub_80B360C + str r0, [r1, 0x8] + ldr r0, =0x02022fec + str r6, [r0] + bl sub_806E64C + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8014210 + + thumb_func_start sub_8014290 +sub_8014290: @ 8014290 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x8 + adds r3, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + lsls r3, 16 + lsrs r3, 16 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + ldr r0, =0x00004087 + adds r1, r3, 0 + bl VarSet + ldr r6, =0x03005d8c + ldr r1, [r6] + movs r0, 0x4 + ldrsb r0, [r1, r0] + ldrb r1, [r1, 0x5] + lsls r1, 24 + asrs r1, 24 + movs r2, 0x1 + negs r2, r2 + mov r8, r2 + lsls r4, 24 + asrs r4, 24 + lsls r5, 24 + asrs r5, 24 + str r5, [sp] + adds r3, r4, 0 + bl warp1_set + ldr r0, [r6] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + str r4, [sp] + str r5, [sp, 0x4] + movs r0, 0 + mov r3, r8 + bl saved_warp2_set_2 + bl warp_in + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8014290 + + thumb_func_start sub_8014304 +sub_8014304: @ 8014304 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + mov r8, r2 + adds r6, r3, 0 + ldr r1, [sp, 0x18] + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r1, 16 + lsrs r1, 16 + ldr r0, =0x020375e0 + strh r1, [r0] + ldr r0, =0x00004087 + bl VarSet + bl sub_8009FCC + ldr r1, =0x03005db8 + strb r0, [r1] + bl link_get_multiplayer_id + ldr r1, =0x03005db4 + strb r0, [r1] + bl sub_809D2BC + lsls r4, 24 + asrs r4, 24 + lsls r5, 24 + asrs r5, 24 + movs r2, 0x1 + negs r2, r2 + mov r0, r8 + lsls r0, 24 + asrs r0, 24 + mov r8, r0 + lsls r6, 24 + asrs r6, 24 + str r6, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + mov r3, r8 + bl warp1_set + bl warp_in + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8014304 + + thumb_func_start sub_8014384 +sub_8014384: @ 8014384 + push {r4,lr} + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0 + beq _080143A0 + cmp r0, 0x1 + beq _080143B4 + b _080143C6 + .pool +_080143A0: + ldr r0, =sub_80140E0 + movs r1, 0x5 + bl AddTask + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _080143C6 + .pool +_080143B4: + ldr r0, =sub_80140E0 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _080143C6 + ldr r0, =sub_8086074 + bl SetMainCallback2 +_080143C6: + bl RunActiveTasks + bl RunTextPrinters + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8014384 + + thumb_func_start sub_80143E4 +sub_80143E4: @ 80143E4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80C30A4 + cmp r5, 0 + beq _080143FE + bl sub_801B39C + adds r1, r4, 0 + adds r1, 0x60 + strh r0, [r1] + b _08014404 +_080143FE: + adds r0, r4, 0 + adds r0, 0x60 + strh r5, [r0] +_08014404: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80143E4 + + thumb_func_start sub_801440C +sub_801440C: @ 801440C + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_801B940 + ldr r0, =0x02022c2c + ldrb r0, [r0] + subs r0, 0x1 + cmp r0, 0xE + bhi _08014474 + lsls r0, 2 + ldr r1, =_08014434 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08014434: + .4byte _08014470 + .4byte _08014470 + .4byte _08014470 + .4byte _08014470 + .4byte _08014474 + .4byte _08014474 + .4byte _08014474 + .4byte _08014474 + .4byte _08014470 + .4byte _08014470 + .4byte _08014470 + .4byte _08014474 + .4byte _08014470 + .4byte _08014474 + .4byte _08014470 +_08014470: + bl sub_800E3A8 +_08014474: + ldr r0, =0x02022c2c + ldrb r0, [r0] + subs r0, 0x1 + cmp r0, 0x50 + bls _08014480 + b _08014764 +_08014480: + lsls r0, 2 + ldr r1, =_08014494 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08014494: + .4byte _080145F4 + .4byte _08014620 + .4byte _0801464C + .4byte _08014678 + .4byte _080146D8 + .4byte _08014764 + .4byte _08014764 + .4byte _080146FC + .4byte _08014714 + .4byte _08014734 + .4byte _0801474C + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014698 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _080145D8 + .4byte _08014764 + .4byte _08014764 + .4byte _080146C4 + .4byte _080146D8 + .4byte _08014764 + .4byte _08014764 + .4byte _080146FC + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _08014764 + .4byte _080145D8 +_080145D8: + bl overworld_free_bg_tilemaps + ldr r1, =0x030022c0 + ldr r0, =sub_801AC54 + str r0, [r1, 0x8] + movs r0, 0x3 + bl sub_81B8518 + b _08014764 + .pool +_080145F4: + bl overworld_free_bg_tilemaps + ldr r0, =0x020228c4 + movs r1, 0x1 + bl sub_80143E4 + bl sp000_heal_pokemon + bl copy_player_party_to_sav1 + bl copy_bags_and_unk_data_from_save_blocks + movs r0, 0x1 + str r0, [sp] + movs r0, 0x19 + movs r1, 0x18 + movs r2, 0x6 + movs r3, 0x8 + b _080146B0 + .pool +_08014620: + bl overworld_free_bg_tilemaps + bl sp000_heal_pokemon + bl copy_player_party_to_sav1 + bl copy_bags_and_unk_data_from_save_blocks + ldr r0, =0x020228c4 + movs r1, 0x1 + bl sub_80143E4 + movs r0, 0x2 + str r0, [sp] + movs r0, 0x19 + movs r1, 0x18 + movs r2, 0x6 + movs r3, 0x8 + b _080146B0 + .pool +_0801464C: + bl overworld_free_bg_tilemaps + bl sp000_heal_pokemon + bl copy_player_party_to_sav1 + bl copy_bags_and_unk_data_from_save_blocks + ldr r0, =0x020228c4 + movs r1, 0x1 + bl sub_80143E4 + movs r0, 0x5 + str r0, [sp] + movs r0, 0x19 + movs r1, 0x1B + movs r2, 0x5 + movs r3, 0x8 + b _080146B0 + .pool +_08014678: + ldr r0, =0x020228c4 + movs r1, 0x1 + bl sub_80143E4 + bl overworld_free_bg_tilemaps + movs r0, 0x3 + str r0, [sp] + movs r0, 0x19 + movs r1, 0x19 + movs r2, 0x5 + movs r3, 0x8 + b _080146B0 + .pool +_08014698: + ldr r0, =0x020228c4 + movs r1, 0x1 + bl sub_80143E4 + bl overworld_free_bg_tilemaps + movs r0, 0x4 + str r0, [sp] + movs r0, 0x19 + movs r1, 0x1A + movs r2, 0x8 + movs r3, 0x9 +_080146B0: + bl sub_8014304 + ldr r0, =sub_8014384 + bl SetMainCallback2 + b _08014764 + .pool +_080146C4: + bl overworld_free_bg_tilemaps + ldr r0, =sub_8013F90 + movs r1, 0 + bl AddTask + b _08014764 + .pool +_080146D8: + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _080146E8 + bl sub_800ED10 + b _080146F6 +_080146E8: + bl sub_800ED28 + movs r0, 0x45 + movs r1, 0 + movs r2, 0x1 + bl sub_8010F84 +_080146F6: + bl sub_801DD98 + b _08014764 +_080146FC: + ldr r0, =0x020228c4 + movs r1, 0 + bl sub_80143E4 + ldr r0, =sub_80141A4 + bl SetMainCallback2 + b _08014764 + .pool +_08014714: + movs r0, 0x8 + movs r1, 0x5 + movs r2, 0x1 + bl sub_8014290 + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + ldr r1, =c2_load_new_map + bl sub_802A9A8 + b _08014764 + .pool +_08014734: + movs r0, 0x7 + movs r1, 0x9 + movs r2, 0x1 + bl sub_8014290 + ldr r0, =c2_load_new_map + bl sub_8020C70 + b _08014764 + .pool +_0801474C: + movs r0, 0x8 + movs r1, 0x5 + movs r2, 0x1 + bl sub_8014290 + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + ldr r1, =c2_load_new_map + bl sub_802493C +_08014764: + adds r0, r4, 0 + bl remove_task + ldr r1, =0x020375f0 + movs r0, 0x1 + strh r0, [r1] + ldr r0, =0x02022c2c + ldrb r0, [r0] + cmp r0, 0x44 + beq _0801477C + bl script_env_2_disable +_0801477C: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801440C + + thumb_func_start sub_8014790 +sub_8014790: @ 8014790 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r7, r0, r1 + ldr r0, =0x020228c4 + mov r9, r0 + movs r1, 0 + ldrsh r0, [r7, r1] + mov r2, r9 + cmp r0, 0x8 + bls _080147B6 + b _080149B2 +_080147B6: + lsls r0, 2 + ldr r1, =_080147CC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080147CC: + .4byte _080147F0 + .4byte _080148CC + .4byte _080148E4 + .4byte _0801491E + .4byte _08014934 + .4byte _0801494A + .4byte _08014986 + .4byte _08014992 + .4byte _0801499C +_080147F0: + ldr r1, =0x020375f0 + movs r0, 0x1 + strh r0, [r1] + ldr r0, =0x02022c2c + ldrb r0, [r0] + subs r0, 0xE + cmp r0, 0xE + bhi _080148C2 + lsls r0, 2 + ldr r1, =_08014818 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08014818: + .4byte _08014854 + .4byte _080148C2 + .4byte _080148B8 + .4byte _080148C2 + .4byte _080148C2 + .4byte _080148C2 + .4byte _080148C2 + .4byte _080148C2 + .4byte _080148C2 + .4byte _080148B8 + .4byte _080148B8 + .4byte _080148B8 + .4byte _080148B8 + .4byte _080148B8 + .4byte _08014854 +_08014854: + ldr r1, =0x020229e8 + ldr r0, =0x00002211 + str r0, [r1, 0x14] + movs r2, 0 + mov r8, r2 + mov r0, r8 + strh r0, [r1, 0x18] + movs r0, 0x2 + strh r0, [r1, 0x34] + ldr r6, =0x0203cef8 + ldrb r0, [r6] + movs r5, 0x64 + muls r0, r5 + ldr r4, =0x02024488 + adds r0, r4 + movs r1, 0xB + bl pokemon_getattr + mov r1, r9 + strh r0, [r1] + ldrb r0, [r6, 0x1] + muls r0, r5 + adds r0, r4 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + mov r2, r9 + strh r0, [r2, 0x2] + ldr r0, =0x030022c0 + mov r1, r8 + str r1, [r0, 0x8] + movs r0, 0x4 + strh r0, [r7] + bl sub_800E3A8 + bl sub_800A5B4 + b _080149B2 + .pool +_080148B8: + bl sub_800E3A8 + adds r0, r4, 0 + bl remove_task +_080148C2: + bl script_env_2_enable_and_set_ctx_running + movs r0, 0x1 + strh r0, [r7] + b _080149B2 +_080148CC: + bl script_env_context_is_running + lsls r0, 24 + cmp r0, 0 + bne _080149B2 + movs r0, 0x1 + movs r1, 0 + bl fade_screen + movs r0, 0x2 + strh r0, [r7] + b _080149B2 +_080148E4: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080149B2 + ldr r0, =0x02022c2c + ldrb r0, [r0] + cmp r0, 0x1D + bne _08014914 + adds r0, r4, 0 + bl remove_task + ldr r0, =sub_80773AC + bl SetMainCallback2 + b _080149B2 + .pool +_08014914: + bl sub_800ADF8 + movs r0, 0x3 + strh r0, [r7] + b _080149B2 +_0801491E: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080149B2 + adds r0, r4, 0 + bl remove_task + bl sub_80149D8 + b _080149B2 +_08014934: + movs r0, 0 + adds r1, r2, 0 + movs r2, 0xE + bl link_0800A448 + lsls r0, 24 + cmp r0, 0 + beq _080149B2 + movs r0, 0x5 + strh r0, [r7] + b _080149B2 +_0801494A: + bl sub_800A550 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _080149B2 + bl sub_800A5B4 + ldr r0, =0x020223c4 + movs r2, 0x80 + lsls r2, 1 + adds r1, r0, r2 + bl sub_80B2AF4 + cmp r0, 0 + beq _08014980 + ldr r0, =0x020375f0 + movs r1, 0xB + strh r1, [r0] + movs r0, 0x7 + strh r0, [r7] + b _080149B2 + .pool +_08014980: + movs r0, 0x6 + strh r0, [r7] + b _080149B2 +_08014986: + bl script_env_2_enable_and_set_ctx_running + adds r0, r4, 0 + bl remove_task + b _080149B2 +_08014992: + bl sub_800AC34 + movs r0, 0x8 + strh r0, [r7] + b _080149B2 +_0801499C: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _080149B2 + bl sub_800E084 + bl script_env_2_enable_and_set_ctx_running + adds r0, r4, 0 + bl remove_task +_080149B2: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8014790 + + thumb_func_start sub_80149C4 +sub_80149C4: @ 80149C4 + push {lr} + ldr r0, =sub_8014790 + movs r1, 0 + bl AddTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80149C4 + + thumb_func_start sub_80149D8 +sub_80149D8: @ 80149D8 + push {lr} + ldr r0, =sub_801440C + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0x8] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80149D8 + + thumb_func_start sub_8014A00 +sub_8014A00: @ 8014A00 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =sub_8014A40 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02022c30 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r1, r0 + str r1, [r2] + movs r2, 0 + strb r2, [r1, 0xC] + strb r2, [r1, 0xD] + strb r4, [r1, 0x18] + ldr r0, =0x020375f0 + strh r2, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8014A00 + + thumb_func_start sub_8014A40 +sub_8014A40: @ 8014A40 + push {r4-r6,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02022c30 + ldr r5, [r0] + ldrb r0, [r5, 0xC] + cmp r0, 0x11 + bls _08014A54 + b _08014EF2 +_08014A54: + lsls r0, 2 + ldr r1, =_08014A68 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08014A68: + .4byte _08014AB0 + .4byte _08014AEC + .4byte _08014BBC + .4byte _08014BEC + .4byte _08014BFC + .4byte _08014C4C + .4byte _08014C24 + .4byte _08014C52 + .4byte _08014CF2 + .4byte _08014DBC + .4byte _08014DCC + .4byte _08014DE2 + .4byte _08014DFA + .4byte _08014E16 + .4byte _08014E4E + .4byte _08014E74 + .4byte _08014EA8 + .4byte _08014EE2 +_08014AB0: + ldr r1, =0x02022c2c + ldrb r0, [r5, 0x18] + strb r0, [r1] + ldr r1, =0x02022c2d + movs r0, 0x2 + strb r0, [r1] + ldrb r0, [r5, 0x18] + movs r1, 0 + movs r2, 0 + bl sub_8010F84 + movs r0, 0 + movs r1, 0 + bl sub_8010FA0 + bl sub_800B488 + bl sub_8009734 + movs r0, 0x2 + bl sub_8011C10 + movs r0, 0x1 + strb r0, [r5, 0xC] + b _08014EF2 + .pool +_08014AEC: + movs r0, 0x70 + bl AllocZeroed + str r0, [r5, 0x4] + movs r0, 0xA0 + bl AllocZeroed + str r0, [r5] + movs r0, 0xA0 + bl AllocZeroed + str r0, [r5, 0x8] + ldr r0, [r5, 0x4] + movs r1, 0x4 + bl sub_80175EC + ldr r0, [r5] + movs r1, 0x5 + bl sub_8017580 + ldr r0, [r5] + adds r1, r0, 0 + adds r1, 0x10 + bl sub_800DF90 + ldr r1, [r5] + movs r3, 0 + movs r0, 0 + strh r0, [r1, 0x18] + ldr r2, [r5] + ldrb r1, [r2, 0x1A] + subs r0, 0x4 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x1A] + ldr r2, [r5] + ldrb r1, [r2, 0x1A] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x1A] + ldr r0, [r5] + strb r3, [r0, 0x1B] + ldr r0, [r5, 0x4] + movs r1, 0xFF + bl sub_8016FC0 + strb r0, [r5, 0x17] + ldr r0, =gUnknown_082F011C + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp] + str r1, [sp, 0x4] + bl sub_8019930 + lsls r0, 16 + ldr r2, =0x0000ffff + ldr r1, [sp, 0x4] + ands r1, r2 + orrs r1, r0 + ldr r0, =0xffff00ff + ands r1, r0 + movs r0, 0xC0 + lsls r0, 4 + orrs r1, r0 + str r1, [sp, 0x4] + mov r0, sp + bl AddWindow + strb r0, [r5, 0xF] + ldrb r0, [r5, 0xF] + bl sub_8018784 + ldr r0, =0x03006310 + adds r2, r0, 0 + ldr r1, =gUnknown_082F015C + ldm r1!, {r3,r4,r6} + stm r2!, {r3,r4,r6} + ldm r1!, {r3,r4,r6} + stm r2!, {r3,r4,r6} + ldrb r1, [r5, 0xF] + strb r1, [r0, 0x10] + movs r1, 0 + movs r2, 0 + bl ListMenuInit + strb r0, [r5, 0x12] + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0x1 + strb r0, [r5, 0x13] + b _08014C42 + .pool +_08014BBC: + ldr r0, =0x02021cc4 + ldr r2, =gUnknown_082F0048 + ldr r4, =0x02022c2c + ldrb r1, [r4] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl CopyString + ldr r0, =0x02021fc4 + ldrb r1, [r4] + bl sub_801262C + movs r0, 0x3 + strb r0, [r5, 0xC] + b _08014EF2 + .pool +_08014BEC: + ldr r0, =0x02021fc4 + bl sub_8018884 + movs r0, 0x4 + strb r0, [r5, 0xC] + b _08014EF2 + .pool +_08014BFC: + adds r0, r5, 0 + movs r1, 0x5 + movs r2, 0x6 + bl sub_801320C + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08014C14 + b _08014EF2 +_08014C14: + movs r0, 0xD + strb r0, [r5, 0xC] + bl sub_800E084 + b _08014EF2 + .pool +_08014C24: + adds r0, r5, 0 + adds r0, 0xD + ldr r1, =gUnknown_082EDF40 + bl mevent_0814257C + cmp r0, 0 + bne _08014C34 + b _08014EF2 +_08014C34: + ldr r0, [r5] + bl sub_8013398 + strb r0, [r5, 0x13] + ldrb r0, [r5, 0x12] + bl sub_81AE70C +_08014C42: + movs r0, 0x2 + strb r0, [r5, 0xC] + b _08014EF2 + .pool +_08014C4C: + movs r0, 0x7 + strb r0, [r5, 0xC] + b _08014EF2 +_08014C52: + adds r0, r5, 0 + adds r0, 0xD + adds r1, r5, 0 + adds r1, 0x14 + ldr r3, =0x02021fc4 + movs r2, 0 + bl sub_8018B08 + lsls r0, 24 + asrs r4, r0, 24 + cmp r4, 0 + beq _08014C82 + cmp r4, 0 + bgt _08014C7C + movs r0, 0x1 + negs r0, r0 + cmp r4, r0 + beq _08014CC4 + b _08014EF2 + .pool +_08014C7C: + cmp r4, 0x1 + beq _08014CC4 + b _08014EF2 +_08014C82: + bl sub_800E0E8 + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + ldr r1, [r5] + ldrb r0, [r5, 0x13] + lsls r0, 5 + adds r1, r0 + strb r4, [r1, 0x1B] + ldrb r0, [r5, 0x12] + bl sub_81AE70C + movs r0, 0x5 + strb r0, [r5, 0x19] + ldrb r1, [r5, 0x13] + lsls r1, 5 + ldr r0, [r5] + adds r0, r1 + adds r0, 0x2 + bl sub_8015658 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldrb r0, [r5, 0x13] + lsls r0, 5 + ldr r2, [r5] + adds r2, r0 + adds r2, 0x10 + movs r0, 0x5 + b _08014CE8 +_08014CC4: + movs r0, 0x6 + strb r0, [r5, 0x19] + ldrb r1, [r5, 0x13] + lsls r1, 5 + ldr r0, [r5] + adds r0, r1 + adds r0, 0x2 + bl sub_8015658 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldrb r0, [r5, 0x13] + lsls r0, 5 + ldr r2, [r5] + adds r2, r0 + adds r2, 0x10 + movs r0, 0x6 +_08014CE8: + bl sub_8010688 + movs r0, 0x8 + strb r0, [r5, 0xC] + b _08014EF2 +_08014CF2: + ldrb r1, [r5, 0x13] + lsls r1, 5 + ldr r0, [r5] + adds r0, r1 + adds r0, 0x2 + bl sub_8015658 + lsls r0, 16 + lsrs r0, 16 + ldrb r2, [r5, 0x13] + lsls r2, 5 + ldr r1, [r5] + adds r1, r2 + adds r1, 0x10 + bl sub_8010714 + adds r4, r0, 0 + cmp r4, 0x1 + bne _08014DAA + ldrb r0, [r5, 0x19] + cmp r0, 0x5 + bne _08014D64 + ldr r1, [r5] + ldrb r0, [r5, 0x13] + lsls r0, 5 + adds r1, r0 + movs r0, 0 + strb r0, [r1, 0x1B] + ldrb r0, [r5, 0x12] + bl sub_81AE70C + ldrb r0, [r5, 0x13] + adds r0, 0x1 + strb r0, [r5, 0x13] + ldr r0, =0x02021cc4 + ldrb r2, [r5, 0x13] + lsls r2, 5 + subs r2, 0x20 + ldr r1, [r5] + adds r1, r2 + bl sub_8018404 + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_082EDC9C + bl ExpandStringRefs + movs r0, 0x9 + strb r0, [r5, 0xC] + bl sub_800EF38 + b _08014DA4 + .pool +_08014D64: + ldrb r1, [r5, 0x13] + lsls r1, 5 + ldr r0, [r5] + adds r0, r1 + adds r4, r0, 0 + adds r4, 0x10 + adds r0, 0x2 + bl sub_8015658 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_8011DC0 + ldr r1, [r5] + ldrb r0, [r5, 0x13] + lsls r0, 5 + adds r1, r0 + ldrb r2, [r1, 0x1A] + movs r0, 0x4 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1A] + ldr r0, [r5] + bl sub_8013398 + ldrb r0, [r5, 0x12] + bl sub_81AE70C + movs r0, 0x2 + strb r0, [r5, 0xC] +_08014DA4: + movs r0, 0 + strb r0, [r5, 0x19] + b _08014EF2 +_08014DAA: + cmp r4, 0x2 + beq _08014DB0 + b _08014EF2 +_08014DB0: + movs r0, 0 + movs r1, 0 + bl sub_8011A64 + strb r4, [r5, 0xC] + b _08014EF2 +_08014DBC: + ldr r0, =0x02021fc4 + bl sub_8018884 + movs r0, 0xA + strb r0, [r5, 0xC] + b _08014EF2 + .pool +_08014DCC: + ldrb r0, [r5, 0xE] + adds r0, 0x1 + strb r0, [r5, 0xE] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x78 + bhi _08014DDC + b _08014EF2 +_08014DDC: + movs r0, 0xB + strb r0, [r5, 0xC] + b _08014EF2 +_08014DE2: + adds r0, r5, 0 + movs r1, 0x5 + movs r2, 0x6 + bl sub_801320C + lsls r0, 24 + cmp r0, 0 + beq _08014DF4 + b _08014EF2 +_08014DF4: + movs r0, 0xC + strb r0, [r5, 0xC] + b _08014EF2 +_08014DFA: + bl sub_800EF1C + lsls r0, 24 + cmp r0, 0 + beq _08014E10 + movs r0, 0 + bl sub_800EF58 + movs r0, 0xF + strb r0, [r5, 0xC] + b _08014EF2 +_08014E10: + movs r0, 0x6 + strb r0, [r5, 0xC] + b _08014EF2 +_08014E16: + bl sub_800E084 + bl sub_800EDD4 + ldrb r0, [r5, 0x12] + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldrb r0, [r5, 0xF] + bl RemoveWindow + ldrb r0, [r5, 0x17] + bl remove_task + ldr r0, [r5, 0x8] + bl Free + ldr r0, [r5] + bl Free + ldr r0, [r5, 0x4] + bl Free + b _08014EDA +_08014E4E: + adds r0, r5, 0 + adds r0, 0xD + ldr r1, =gUnknown_082ED8D0 + bl mevent_0814257C + cmp r0, 0 + beq _08014EF2 + adds r0, r4, 0 + bl remove_task + ldr r1, =0x020375f0 + movs r0, 0x5 + strh r0, [r1] + b _08014EF2 + .pool +_08014E74: + bl sub_8011A74 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08014E8C + bl sub_8011A74 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08014E92 +_08014E8C: + movs r0, 0xD + strb r0, [r5, 0xC] + b _08014EF2 +_08014E92: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _08014EF2 + movs r0, 0x1 + bl sub_8011068 + b _08014EDA + .pool +_08014EA8: + ldrb r0, [r5, 0x12] + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldrb r0, [r5, 0xF] + bl RemoveWindow + ldrb r0, [r5, 0x17] + bl remove_task + ldr r0, [r5, 0x8] + bl Free + ldr r0, [r5] + bl Free + ldr r0, [r5, 0x4] + bl Free + bl sub_800ADF8 +_08014EDA: + ldrb r0, [r5, 0xC] + adds r0, 0x1 + strb r0, [r5, 0xC] + b _08014EF2 +_08014EE2: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08014EF2 + adds r0, r4, 0 + bl remove_task +_08014EF2: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8014A40 + + thumb_func_start sub_8014EFC +sub_8014EFC: @ 8014EFC + push {r4,lr} + adds r4, r0, 0 + ldr r0, =sub_8014F48 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02022c30 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r1, r0 + str r1, [r2] + ldr r0, =0x03000da4 + str r1, [r0] + movs r2, 0 + strb r2, [r1, 0x8] + strb r2, [r1, 0x9] + subs r4, 0x15 + strb r4, [r1, 0x12] + ldr r0, =0x020375f0 + strh r2, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8014EFC + + thumb_func_start sub_8014F48 +sub_8014F48: @ 8014F48 + push {r4-r7,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x02022c30 + ldr r7, [r0] + ldrb r0, [r7, 0x8] + cmp r0, 0xC + bls _08014F5C + b _080152A0 +_08014F5C: + lsls r0, 2 + ldr r1, =_08014F70 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08014F70: + .4byte _08014FA4 + .4byte _08014FD8 + .4byte _08014FE8 + .4byte _080150B8 + .4byte _08015180 + .4byte _080151A4 + .4byte _08015204 + .4byte _08015260 + .4byte _08015204 + .4byte _0801523A + .4byte _08015204 + .4byte _08015284 + .4byte _08015290 +_08014FA4: + ldrb r0, [r7, 0x12] + adds r0, 0x15 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + movs r2, 0 + bl sub_8010F84 + bl sub_800B488 + bl sub_8009734 + bl sub_8011C5C + movs r0, 0x70 + bl AllocZeroed + str r0, [r7, 0x4] + movs r0, 0x80 + lsls r0, 2 + bl AllocZeroed + str r0, [r7] + movs r0, 0x1 + strb r0, [r7, 0x8] + b _080152A0 +_08014FD8: + ldr r0, =gUnknown_082EF7F8 + bl sub_8018884 + movs r0, 0x2 + strb r0, [r7, 0x8] + b _080152A0 + .pool +_08014FE8: + ldr r0, [r7, 0x4] + movs r1, 0x4 + bl sub_80175EC + ldr r0, [r7] + movs r1, 0x10 + bl sub_8017580 + ldr r0, [r7, 0x4] + ldrb r1, [r7, 0x12] + adds r1, 0x7 + bl sub_8016FC0 + movs r6, 0 + strb r0, [r7, 0x11] + ldr r0, =gUnknown_082F0174 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp] + str r1, [sp, 0x4] + bl sub_8019930 + lsls r0, 16 + ldr r2, =0x0000ffff + ldr r1, [sp, 0x4] + ands r1, r2 + orrs r1, r0 + ldr r5, =0xffff00ff + ands r1, r5 + movs r4, 0xC0 + lsls r4, 4 + orrs r1, r4 + str r1, [sp, 0x4] + mov r0, sp + bl AddWindow + strb r0, [r7, 0xB] + ldr r0, =gUnknown_082F017C + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x8] + str r1, [sp, 0xC] + add r0, sp, 0x8 + ldr r1, [r0, 0x4] + ands r1, r5 + orrs r1, r4 + str r1, [r0, 0x4] + bl AddWindow + strb r0, [r7, 0xD] + ldrb r0, [r7, 0xB] + bl sub_8018784 + ldr r0, =0x03006310 + adds r2, r0, 0 + ldr r1, =gUnknown_082F0204 + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + ldrb r1, [r7, 0xB] + strb r1, [r0, 0x10] + movs r1, 0 + movs r2, 0 + bl ListMenuInit + strb r0, [r7, 0xE] + ldrb r0, [r7, 0xD] + bl sub_8018784 + ldrb r0, [r7, 0xD] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldrb r0, [r7, 0xD] + bl PutWindowTilemap + ldrb r0, [r7, 0xD] + bl sub_80125BC + ldrb r0, [r7, 0xD] + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0 + bl CopyBgTilemapBufferToVram + strb r6, [r7, 0xF] + movs r0, 0x3 + strb r0, [r7, 0x8] + b _080152A0 + .pool +_080150B8: + bl sub_8013E44 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _080150D6 + cmp r2, 0x1 + bne _080150CE + movs r0, 0x2 + bl audio_play +_080150CE: + ldrb r0, [r7, 0xE] + bl sub_81AE70C + b _080152A0 +_080150D6: + ldrb r0, [r7, 0xE] + bl ListMenuHandleInput + adds r2, r0, 0 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08015168 + movs r0, 0x1 + negs r0, r0 + cmp r2, r0 + beq _08015168 + ldr r0, [r7] + lsls r1, r2, 5 + adds r0, r1 + ldrb r1, [r0, 0xA] + ldrb r0, [r0, 0x1A] + lsls r0, 30 + lsrs r0, 30 + cmp r0, 0x1 + bne _08015160 + lsrs r0, r1, 7 + cmp r0, 0 + bne _08015160 + strb r2, [r7, 0xF] + bl sub_800E0E8 + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + ldrb r0, [r7, 0xE] + bl sub_81AE70C + ldr r0, =0x02021cc4 + ldrb r2, [r7, 0xF] + lsls r2, 5 + ldr r1, [r7] + adds r1, r2 + bl sub_8018404 + ldrb r1, [r7, 0xF] + lsls r1, 5 + ldr r0, [r7] + adds r0, r1 + adds r4, r0, 0 + adds r4, 0x10 + adds r0, 0x2 + bl sub_8015658 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_8011FC8 + movs r0, 0x6E + bl audio_play + movs r0, 0x4 + strb r0, [r7, 0x8] + b _080152A0 + .pool +_08015160: + movs r0, 0x7 + bl audio_play + b _080152A0 +_08015168: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08015176 + b _080152A0 +_08015176: + movs r0, 0x6 + strb r0, [r7, 0x8] + b _080152A0 + .pool +_08015180: + ldr r0, =gUnknown_082EFC3C + bl sub_8018884 + ldr r0, =0x02021cc4 + ldrb r2, [r7, 0xF] + lsls r2, 5 + ldr r1, [r7] + adds r1, r2 + bl sub_8018404 + movs r0, 0x5 + strb r0, [r7, 0x8] + b _080152A0 + .pool +_080151A4: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _080151C2 + ldr r2, =0x02022c2c + ldr r1, [r7] + ldrb r0, [r7, 0xF] + lsls r0, 5 + adds r1, r0 + ldrb r0, [r1, 0xA] + lsls r0, 25 + lsrs r0, 25 + strb r0, [r2] + movs r0, 0xA + strb r0, [r7, 0x8] +_080151C2: + bl sub_8011A74 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + beq _080151EE + cmp r0, 0x5 + bgt _080151E4 + cmp r0, 0x2 + bgt _080152A0 + cmp r0, 0x1 + blt _080152A0 + b _080151E8 + .pool +_080151E4: + cmp r0, 0x6 + bne _080152A0 +_080151E8: + movs r0, 0x8 + strb r0, [r7, 0x8] + b _080152A0 +_080151EE: + ldr r0, =gUnknown_082EDDF4 + bl sub_8018884 + movs r0, 0 + movs r1, 0 + bl sub_8011A64 + b _080152A0 + .pool +_08015204: + ldrb r0, [r7, 0xE] + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldrb r0, [r7, 0xD] + bl RemoveWindow + ldrb r0, [r7, 0xB] + bl RemoveWindow + ldrb r0, [r7, 0x11] + bl remove_task + ldr r0, [r7] + bl Free + ldr r0, [r7, 0x4] + bl Free + ldrb r0, [r7, 0x8] + adds r0, 0x1 + strb r0, [r7, 0x8] + b _080152A0 +_0801523A: + adds r5, r7, 0 + adds r5, 0x9 + ldr r4, =gUnknown_082EDF80 + bl sub_8011A74 + lsls r0, 24 + lsrs r0, 22 + adds r0, r4 + ldr r1, [r0] + adds r0, r5, 0 + bl mevent_0814257C + cmp r0, 0 + beq _080152A0 + bl sub_800E084 + b _0801526A + .pool +_08015260: + bl sub_800E084 + ldr r0, =gUnknown_082ED8D0 + bl sub_8018884 +_0801526A: + adds r0, r6, 0 + bl remove_task + bl sub_800EDD4 + ldr r1, =0x020375f0 + movs r0, 0x5 + strh r0, [r1] + b _080152A0 + .pool +_08015284: + ldrb r0, [r7, 0x8] + adds r0, 0x1 + strb r0, [r7, 0x8] + bl sub_800ADF8 + b _080152A0 +_08015290: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080152A0 + adds r0, r6, 0 + bl remove_task +_080152A0: + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8014F48 + + thumb_func_start sub_80152A8 +sub_80152A8: @ 80152A8 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =task00_081182DC + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02022c30 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r1, r0 + str r1, [r2] + ldr r0, =0x03000da4 + str r1, [r0] + movs r2, 0 + strb r2, [r1, 0x8] + strb r2, [r1, 0x9] + subs r4, 0x15 + strb r4, [r1, 0x12] + ldr r0, =0x020375f0 + strh r2, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80152A8 + + thumb_func_start task00_081182DC +task00_081182DC: @ 80152F4 + push {r4-r6,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02022c30 + ldr r5, [r0] + ldrb r0, [r5, 0x8] + cmp r0, 0xE + bls _08015308 + b _08015604 +_08015308: + lsls r0, 2 + ldr r1, =_0801531C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0801531C: + .4byte _08015358 + .4byte _08015386 + .4byte _08015398 + .4byte _08015420 + .4byte _080154E0 + .4byte _08015504 + .4byte _08015564 + .4byte _080155A8 + .4byte _08015564 + .4byte _0801559A + .4byte _08015564 + .4byte _080155B4 + .4byte _08015564 + .4byte _080155E8 + .4byte _080155F4 +_08015358: + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl sub_8010F84 + bl sub_800B488 + bl sub_8009734 + bl sub_8011C5C + movs r0, 0x70 + bl AllocZeroed + str r0, [r5, 0x4] + movs r0, 0x80 + lsls r0, 2 + bl AllocZeroed + str r0, [r5] + movs r0, 0x1 + strb r0, [r5, 0x8] + b _08015604 +_08015386: + ldr r0, =gUnknown_082EFBC8 + bl sub_8018884 + movs r0, 0x2 + strb r0, [r5, 0x8] + b _08015604 + .pool +_08015398: + ldr r0, [r5, 0x4] + movs r1, 0x4 + bl sub_80175EC + ldr r0, [r5] + movs r1, 0x10 + bl sub_8017580 + ldr r0, [r5, 0x4] + ldrb r1, [r5, 0x12] + adds r1, 0x7 + bl sub_8016FF0 + strb r0, [r5, 0x11] + ldrb r0, [r5, 0x13] + cmp r0, 0 + beq _08015404 + ldr r0, =gUnknown_082F0174 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp] + str r1, [sp, 0x4] + bl sub_8019930 + lsls r0, 16 + ldr r2, =0x0000ffff + ldr r1, [sp, 0x4] + ands r1, r2 + orrs r1, r0 + str r1, [sp, 0x4] + mov r0, sp + bl AddWindow + strb r0, [r5, 0xB] + ldrb r0, [r5, 0xB] + bl sub_8018784 + ldr r0, =0x03006310 + adds r2, r0, 0 + ldr r1, =gUnknown_082F0204 + ldm r1!, {r3,r4,r6} + stm r2!, {r3,r4,r6} + ldm r1!, {r3,r4,r6} + stm r2!, {r3,r4,r6} + ldrb r1, [r5, 0xB] + strb r1, [r0, 0x10] + movs r1, 0 + movs r2, 0 + bl ListMenuInit + strb r0, [r5, 0xE] + movs r0, 0 + bl CopyBgTilemapBufferToVram +_08015404: + movs r0, 0 + strb r0, [r5, 0xF] + movs r0, 0x3 + strb r0, [r5, 0x8] + b _08015604 + .pool +_08015420: + bl sub_8013E44 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _08015446 + cmp r0, 0x1 + bne _08015436 + movs r0, 0x2 + bl audio_play +_08015436: + ldrb r0, [r5, 0x13] + cmp r0, 0 + bne _0801543E + b _08015604 +_0801543E: + ldrb r0, [r5, 0xE] + bl sub_81AE70C + b _08015604 +_08015446: + ldrb r0, [r5, 0x13] + cmp r0, 0 + beq _08015452 + ldrb r0, [r5, 0xE] + bl ListMenuHandleInput +_08015452: + ldrb r0, [r5, 0x14] + cmp r0, 0x78 + bls _080154C0 + ldr r2, [r5] + ldrb r1, [r2, 0x1A] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + bne _080154D4 + ldrb r1, [r2, 0xA] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080154D4 + ldrb r1, [r5, 0x12] + adds r1, 0x7 + adds r0, r2, 0 + bl sub_8016F1C + cmp r0, 0 + beq _080154B4 + strb r4, [r5, 0xF] + strb r4, [r5, 0x14] + bl sub_800E0E8 + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + ldr r0, [r5] + adds r4, r0, 0 + adds r4, 0x10 + adds r0, 0x2 + bl sub_8015658 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_8011FC8 + movs r0, 0x6E + bl audio_play + movs r0, 0x4 + strb r0, [r5, 0x8] + b _080154D4 +_080154B4: + movs r0, 0x16 + bl audio_play + movs r0, 0xA + strb r0, [r5, 0x8] + b _080154D4 +_080154C0: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080154D4 + movs r1, 0 + movs r0, 0x6 + strb r0, [r5, 0x8] + strb r1, [r5, 0x14] +_080154D4: + ldrb r0, [r5, 0x14] + adds r0, 0x1 + strb r0, [r5, 0x14] + b _08015604 + .pool +_080154E0: + ldr r0, =gUnknown_082EFC90 + bl sub_8018884 + ldr r0, =0x02021cc4 + ldrb r2, [r5, 0xF] + lsls r2, 5 + ldr r1, [r5] + adds r1, r2 + bl sub_8018404 + movs r0, 0x5 + strb r0, [r5, 0x8] + b _08015604 + .pool +_08015504: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _08015522 + ldr r2, =0x02022c2c + ldr r1, [r5] + ldrb r0, [r5, 0xF] + lsls r0, 5 + adds r1, r0 + ldrb r0, [r1, 0xA] + lsls r0, 25 + lsrs r0, 25 + strb r0, [r2] + movs r0, 0xC + strb r0, [r5, 0x8] +_08015522: + bl sub_8011A74 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + beq _0801554E + cmp r0, 0x5 + bgt _08015544 + cmp r0, 0x2 + bgt _08015604 + cmp r0, 0x1 + blt _08015604 + b _08015548 + .pool +_08015544: + cmp r0, 0x6 + bne _08015604 +_08015548: + movs r0, 0x8 + strb r0, [r5, 0x8] + b _08015604 +_0801554E: + ldr r0, =gUnknown_082EDEC4 + bl sub_8018884 + movs r0, 0 + movs r1, 0 + bl sub_8011A64 + b _08015604 + .pool +_08015564: + ldrb r0, [r5, 0x13] + cmp r0, 0 + beq _08015580 + ldrb r0, [r5, 0xE] + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldrb r0, [r5, 0xB] + bl RemoveWindow +_08015580: + ldrb r0, [r5, 0x11] + bl remove_task + ldr r0, [r5] + bl Free + ldr r0, [r5, 0x4] + bl Free + ldrb r0, [r5, 0x8] + adds r0, 0x1 + strb r0, [r5, 0x8] + b _08015604 +_0801559A: + adds r0, r5, 0 + adds r0, 0x9 + ldr r1, =gUnknown_082EDF04 + b _080155C2 + .pool +_080155A8: + adds r0, r5, 0 + adds r0, 0x9 + ldr r1, =gUnknown_082ED8F8 + b _080155C2 + .pool +_080155B4: + adds r0, r5, 0 + adds r0, 0x9 + ldr r2, =gUnknown_082EFD58 + ldrb r1, [r5, 0x12] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] +_080155C2: + bl mevent_0814257C + cmp r0, 0 + beq _08015604 + bl sub_800E084 + adds r0, r4, 0 + bl remove_task + bl sub_800EDD4 + ldr r1, =0x020375f0 + movs r0, 0x5 + strh r0, [r1] + b _08015604 + .pool +_080155E8: + ldrb r0, [r5, 0x8] + adds r0, 0x1 + strb r0, [r5, 0x8] + bl sub_800ADF8 + b _08015604 +_080155F4: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08015604 + adds r0, r4, 0 + bl remove_task +_08015604: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end task00_081182DC + + thumb_func_start UnionRoomSpecial +UnionRoomSpecial: @ 801560C + push {r4,lr} + bl sub_8010F60 + ldr r0, =sub_80156E0 + movs r1, 0xA + bl AddTask + ldr r4, =0x02022c30 + movs r0, 0x9B + lsls r0, 2 + bl AllocZeroed + str r0, [r4] + ldr r1, =0x03000da8 + str r0, [r1] + movs r1, 0 + strb r1, [r0, 0x14] + strb r1, [r0, 0x16] + strh r1, [r0, 0x10] + strh r1, [r0, 0x12] + ldr r0, =0x020375f0 + strh r1, [r0] + movs r0, 0xD0 + movs r1, 0x1 + bl sub_819A2BC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end UnionRoomSpecial + + thumb_func_start sub_8015658 +sub_8015658: @ 8015658 + ldrb r1, [r0, 0x1] + lsls r1, 8 + ldrb r0, [r0] + orrs r0, r1 + bx lr + thumb_func_end sub_8015658 + + thumb_func_start sub_8015664 +sub_8015664: @ 8015664 + push {lr} + adds r3, r1, 0 + ldr r1, =0x02022c30 + ldr r2, [r1] + movs r1, 0x8 + strb r1, [r2, 0x14] + strb r0, [r2, 0x15] + ldr r0, =0x02021fc4 + cmp r3, r0 + beq _0801567E + adds r1, r3, 0 + bl ExpandStringRefs +_0801567E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8015664 + + thumb_func_start sub_801568C +sub_801568C: @ 801568C + push {lr} + adds r2, r0, 0 + ldr r0, =0x02022c30 + ldr r1, [r0] + movs r0, 0x1A + strb r0, [r1, 0x14] + ldr r0, =0x02021fc4 + cmp r2, r0 + beq _080156A4 + adds r1, r2, 0 + bl ExpandStringRefs +_080156A4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_801568C + + thumb_func_start sub_80156B0 +sub_80156B0: @ 80156B0 + push {lr} + ldr r3, =0x0201ff00 + ldr r1, [r0] + movs r2, 0x80 + lsls r2, 1 + adds r0, r3, 0 + bl memcpy + pop {r0} + bx r0 + .pool + thumb_func_end sub_80156B0 + + thumb_func_start sub_80156C8 +sub_80156C8: @ 80156C8 + push {lr} + ldr r0, [r0] + ldr r1, =0x0201ff00 + movs r2, 0x80 + lsls r2, 1 + bl memcpy + pop {r0} + bx r0 + .pool + thumb_func_end sub_80156C8 + + thumb_func_start sub_80156E0 +sub_80156E0: @ 80156E0 + push {r4-r7,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r4, r0, 24 + movs r5, 0 + ldr r0, =0x02022c30 + ldr r6, [r0] + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r7, r0, r1 + ldrb r0, [r6, 0x14] + cmp r0, 0x38 + bls _08015702 + bl _08016878 +_08015702: + lsls r0, 2 + ldr r1, =_08015718 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08015718: + .4byte _080157FC + .4byte _08015854 + .4byte _08015878 + .4byte _080158C8 + .4byte _080159A6 + .4byte _08015E5C + .4byte _08015C54 + .4byte _08015E5C + .4byte _08016864 + .4byte _080161C8 + .4byte _080162D4 + .4byte _080160AC + .4byte _080160C6 + .4byte _08016324 + .4byte _08016348 + .4byte _08016350 + .4byte _08016360 + .4byte _0801638E + .4byte _080163A2 + .4byte _08015F32 + .4byte _08015FB8 + .4byte _08015FD6 + .4byte _0801604A + .4byte _08015ADA + .4byte _08015B00 + .4byte _08015B78 + .4byte _08016838 + .4byte _08015D4C + .4byte _08015D34 + .4byte _08015DD0 + .4byte _08015C2A + .4byte _08015DA6 + .4byte _08015D9C + .4byte _08016158 + .4byte _08016178 + .4byte _080161B8 + .4byte _080162DC + .4byte _08016318 + .4byte _08015BF4 + .4byte _08016104 + .4byte _08015E94 + .4byte _08015EC4 + .4byte _080163CC + .4byte _0801645C + .4byte _080165A8 + .4byte _08016610 + .4byte _0801662C + .4byte _08016478 + .4byte _08016634 + .4byte _08016738 + .4byte _0801676C + .4byte _080167F4 + .4byte _0801652C + .4byte _080164E0 + .4byte _080164F4 + .4byte _0801658C + .4byte _080165DC +_080157FC: + movs r0, 0x70 + bl AllocZeroed + str r0, [r6, 0x4] + movs r0, 0x70 + bl AllocZeroed + str r0, [r6, 0xC] + movs r0, 0x80 + lsls r0, 1 + bl AllocZeroed + str r0, [r6] + movs r0, 0x20 + bl AllocZeroed + str r0, [r6, 0x8] + ldr r0, [r6] + movs r1, 0x8 + bl sub_8017580 + ldr r1, =0x02022c2c + movs r0, 0x40 + strb r0, [r1] + ldr r0, [r6, 0xC] + ldr r1, [r6, 0x4] + movs r2, 0x9 + bl sub_8016DF0 + adds r1, r6, 0 + adds r1, 0x20 + strb r0, [r1] + adds r0, r6, 0 + adds r0, 0xA0 + bl sub_8019BA8 + bl sub_8019F2C + movs r0, 0x1 + bl _08016876 + .pool +_08015854: + adds r0, r6, 0 + adds r0, 0x21 + movs r2, 0 + ldrsh r1, [r7, r2] + bl sub_8019E70 + ldrh r0, [r7] + adds r0, 0x1 + strh r0, [r7] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + beq _08015872 + bl _08016878 +_08015872: + movs r0, 0x2 + bl _08016876 +_08015878: + movs r0, 0x40 + movs r1, 0 + movs r2, 0 + bl sub_8010F84 + ldr r2, =0x02022c40 + ldrh r0, [r2, 0x2] + ldrh r1, [r2, 0xA] + ldrh r2, [r2, 0xC] + bl sub_8010FCC + bl sub_800B488 + bl sub_8009734 + bl sub_8011C84 + ldr r0, [r6, 0x8] + movs r1, 0x1 + bl sub_8017580 + ldr r0, [r6, 0x4] + movs r1, 0x4 + bl sub_80175EC + ldr r0, [r6, 0xC] + movs r1, 0x4 + bl sub_80175EC + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + movs r0, 0x3 + bl _08016876 + .pool +_080158C8: + bl sub_81B1360 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x8 + beq _080158E0 + bl sub_81B1360 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x9 + bne _080159A0 +_080158E0: + ldr r4, =0x02022c40 + ldrh r0, [r4] + cmp r0, 0 + beq _080159A0 + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r5, r0, 24 + ldrh r0, [r4] + cmp r0, 0x1 + beq _08015900 + cmp r0, 0x2 + beq _08015950 + b _0801598E + .pool +_08015900: + movs r0, 0x54 + movs r1, 0 + movs r2, 0x1 + bl sub_8011090 + cmp r5, 0x5 + bls _0801592C + adds r0, r4, 0 + bl sub_801807C + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl sub_8010FCC + ldr r0, =gUnknown_082EF4FC + bl sub_801568C + b _0801598E + .pool +_0801592C: + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + bl sub_80180A0 + cmp r0, 0 + bne _0801594C + ldr r1, =gUnknown_082EF47C + movs r0, 0x34 + bl sub_8015664 + b _0801598E + .pool +_0801594C: + movs r0, 0x37 + b _0801598C +_08015950: + adds r0, r6, 0 + bl sub_80156C8 + ldrb r0, [r4, 0x8] + strh r0, [r7, 0x2] + cmp r5, 0x5 + bls _0801596C + ldr r0, =gUnknown_082EF544 + bl sub_801568C + b _0801598E + .pool +_0801596C: + movs r0, 0x54 + movs r1, 0 + movs r2, 0x1 + bl sub_8011090 + ldr r1, =0x02022c2c + movs r0, 0x44 + strb r0, [r1] + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + bl sub_80180E8 + movs r0, 0x33 +_0801598C: + strb r0, [r6, 0x14] +_0801598E: + ldr r1, =0x02022c40 + movs r0, 0 + strh r0, [r1] + bl _08016878 + .pool +_080159A0: + movs r0, 0x4 + bl _08016876 +_080159A6: + ldr r4, =0x020375f0 + ldrh r0, [r4] + cmp r0, 0 + beq _08015A0A + cmp r0, 0x9 + bne _080159E0 + movs r0, 0x54 + movs r1, 0 + movs r2, 0x1 + bl sub_8011090 + movs r0, 0x2 + bl audio_play + ldr r0, =0x02021cc4 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + movs r1, 0 + movs r0, 0x2A + b _08015A02 + .pool +_080159E0: + cmp r0, 0xB + bne _080159F4 + movs r0, 0x54 + movs r1, 0 + movs r2, 0x1 + bl sub_8011090 + movs r1, 0 + movs r0, 0x17 + b _08015A02 +_080159F4: + movs r0, 0 + strh r0, [r7] + ldrh r0, [r4] + subs r0, 0x1 + strh r0, [r7, 0x2] + movs r1, 0 + movs r0, 0x18 +_08015A02: + strb r0, [r6, 0x14] + strh r1, [r4] + bl _08016878 +_08015A0A: + bl script_env_2_is_enabled + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08015A1A + bl _08016878 +_08015A1A: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08015A80 + ldr r0, [r6] + adds r2, r7, 0x2 + adds r3, r6, 0 + adds r3, 0x21 + adds r1, r7, 0 + bl sub_801A2A8 + cmp r0, 0 + beq _08015A4C + movs r0, 0x5 + bl audio_play + bl sub_80181CC + movs r0, 0x18 + bl _08016876 + .pool +_08015A4C: + bl sub_8017940 + cmp r0, 0 + beq _08015A80 + movs r0, 0x54 + movs r1, 0 + movs r2, 0x1 + bl sub_8011090 + movs r0, 0x2 + bl audio_play + bl sub_80181CC + ldr r0, =0x02021cc4 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + movs r0, 0x2D + bl _08016876 + .pool +_08015A80: + bl sub_8016B00 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _08015AA2 + cmp r0, 0x2 + bgt _08015A96 + cmp r0, 0x1 + beq _08015A9C + b _08015AD0 +_08015A96: + cmp r0, 0x4 + beq _08015AAA + b _08015AD0 +_08015A9C: + movs r0, 0x2 + bl audio_play +_08015AA2: + adds r0, r6, 0 + bl sub_801A274 + b _08015AD0 +_08015AAA: + movs r0, 0xB + strb r0, [r6, 0x14] + bl sub_80181CC + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl sub_8010FCC + adds r0, r6, 0 + bl sub_80181DC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x53 + movs r2, 0 + bl sub_8011090 +_08015AD0: + adds r0, r6, 0 + bl sub_801A284 + bl _08016878 +_08015ADA: + ldr r0, =sub_809FA34 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + beq _08015AEA + bl _08016878 +_08015AEA: + movs r0, 0x40 + movs r1, 0 + movs r2, 0 + bl sub_8011090 + movs r0, 0x4 + bl _08016876 + .pool +_08015B00: + bl sub_801704C + movs r3, 0x2 + ldrsh r0, [r7, r3] + ldr r1, [r6] + bl sub_8017CF8 + adds r4, r0, 0 + movs r0, 0x54 + movs r1, 0 + movs r2, 0x1 + bl sub_8011090 + ldr r0, [r6] + ldrb r1, [r7] + ldrb r2, [r7, 0x2] + adds r3, r4, 0 + bl sub_80179D4 + cmp r0, 0x1 + beq _08015B44 + cmp r0, 0x1 + bgt _08015B36 + cmp r0, 0 + beq _08015B3E + bl _08016878 +_08015B36: + cmp r0, 0x2 + beq _08015B68 + bl _08016878 +_08015B3E: + movs r0, 0x1A + bl _08016876 +_08015B44: + movs r1, 0x2 + ldrsh r0, [r7, r1] + lsls r0, 5 + ldr r1, [r6] + adds r1, r0 + adds r0, r1, 0 + adds r0, 0x10 + ldr r2, =0x02022c2c + ldrb r2, [r2] + bl sub_8012188 + strh r5, [r6, 0x12] + movs r0, 0x19 + bl _08016876 + .pool +_08015B68: + ldr r1, =0x02021fc4 + movs r0, 0x13 + bl sub_8015664 + bl _08016878 + .pool +_08015B78: + bl sub_801704C + bl sub_8011A74 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + blt _08015BBE + cmp r4, 0x2 + ble _08015B9A + cmp r4, 0x4 + bne _08015BBE + movs r0, 0x1 + bl sub_801818C + strb r4, [r6, 0x14] + b _08015BBE +_08015B9A: + bl sub_8011B90 + cmp r0, 0x1 + bne _08015BB0 + ldr r0, =gUnknown_082EE6C8 + bl sub_801568C + b _08015BB8 + .pool +_08015BB0: + ldr r1, =gUnknown_082EE6C8 + movs r0, 0x1E + bl sub_8015664 +_08015BB8: + ldr r1, =0x02022c2c + movs r0, 0x40 + strb r0, [r1] +_08015BBE: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _08015BCA + bl _08016878 +_08015BCA: + ldr r0, =0x020228c4 + movs r1, 0x1 + bl sub_80143E4 + ldr r0, =sub_80140E0 + movs r1, 0x5 + bl AddTask + movs r0, 0x26 + bl _08016876 + .pool +_08015BF4: + ldr r0, =sub_80140E0 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + beq _08015C04 + bl _08016878 +_08015C04: + ldr r0, =0x02022c2c + ldrb r0, [r0] + cmp r0, 0x44 + bne _08015C24 + ldr r1, =gUnknown_082EE004 + movs r0, 0x1F + bl sub_8015664 + bl _08016878 + .pool +_08015C24: + movs r0, 0x5 + bl _08016876 +_08015C2A: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _08015C36 + bl _08016878 +_08015C36: + movs r0, 0 + bl sub_801818C + movs r2, 0 + ldrsh r0, [r7, r2] + movs r3, 0x2 + ldrsh r1, [r7, r3] + ldr r2, [r6] + bl sub_801A3D0 + movs r0, 0x2 + bl _08016876 + .pool +_08015C54: + adds r0, r6, 0 + adds r0, 0x16 + adds r1, r6, 0 + adds r1, 0x1B + adds r2, r6, 0 + adds r2, 0x1C + ldr r3, =gUnknown_082F021C + ldr r4, =gUnknown_082F0244 + str r4, [sp] + bl sub_8017178 + adds r5, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r5, r0 + bne _08015C78 + bl _08016878 +_08015C78: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _08015C94 + movs r0, 0x1C + bl _08016876 + .pool +_08015C94: + adds r1, r6, 0 + adds r1, 0x98 + movs r0, 0 + strh r0, [r1] + movs r2, 0x2 + ldrsh r0, [r7, r2] + ldr r1, [r6] + bl sub_8017CF8 + movs r0, 0x2 + negs r0, r0 + cmp r5, r0 + beq _08015CB2 + cmp r5, 0x40 + bne _08015CE4 +_08015CB2: + adds r0, r6, 0 + adds r0, 0x4C + movs r1, 0x40 + strh r1, [r0] + bl sub_800FE50 + ldr r0, =0x02021fc4 + ldr r2, =gUnknown_082EEB80 + ldr r1, =0x020229e8 + ldrb r1, [r1, 0x13] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl CopyString + movs r0, 0x20 + bl _08016876 + .pool +_08015CE4: + ldr r0, =0x02022c2c + strb r5, [r0] + ldr r1, =0x02022c2d + lsrs r0, r5, 8 + strb r0, [r1] + lsls r0, r5, 24 + lsrs r0, 24 + cmp r0, 0x41 + bne _08015D18 + bl sub_8018024 + cmp r0, 0 + bne _08015D18 + ldr r1, =gUnknown_082EEBD0 + movs r0, 0x5 + bl sub_8015664 + bl _08016878 + .pool +_08015D18: + ldr r0, =0x02022c2c + ldrb r0, [r0] + movs r1, 0x40 + orrs r1, r0 + adds r0, r6, 0 + adds r0, 0x4C + strh r1, [r0] + bl sub_800FE50 + movs r0, 0x1B + bl _08016876 + .pool +_08015D34: + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_082EEB88 + bl CopyString + movs r0, 0x24 + bl _08016876 + .pool +_08015D4C: + adds r0, r6, 0 + bl sub_8017FD8 + movs r3, 0x2 + ldrsh r0, [r7, r3] + ldr r1, [r6] + bl sub_8017CF8 + adds r4, r0, 0 + adds r0, r6, 0 + adds r0, 0x4C + ldrh r1, [r0] + movs r0, 0x3F + ands r0, r1 + bl sub_8017984 + adds r5, r0, 0 + adds r0, r6, 0 + adds r0, 0x16 + ldr r3, =gUnknown_082EE82C + lsls r1, r5, 2 + lsls r2, r4, 4 + adds r1, r2 + adds r1, r3 + ldr r1, [r1] + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + bne _08015D8C + bl _08016878 +_08015D8C: + movs r0, 0 + strh r0, [r7, 0x6] + movs r0, 0x1D + bl _08016876 + .pool +_08015D9C: + bl sub_800AC34 + movs r0, 0x24 + bl _08016876 +_08015DA6: + adds r0, r6, 0 + adds r0, 0x4C + movs r1, 0x44 + strh r1, [r0] + ldr r2, =0x02022c40 + ldrh r1, [r2, 0xE] + adds r3, r6, 0 + adds r3, 0x4E + strh r1, [r3] + ldrh r2, [r2, 0x10] + adds r1, r6, 0 + adds r1, 0x50 + strh r2, [r1] + bl sub_800FE50 + movs r0, 0x1D + bl _08016876 + .pool +_08015DD0: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _08015DF4 + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_082EEB88 + bl CopyString + movs r0, 0x1C + bl _08016876 + .pool +_08015DF4: + adds r0, r6, 0 + bl sub_8017FD8 + adds r0, r6, 0 + adds r0, 0x98 + ldrh r0, [r0] + cmp r0, 0x51 + bne _08015E2A + ldr r0, =0x02022c2c + ldrb r0, [r0] + cmp r0, 0x8 + bne _08015E24 + ldr r0, =0x02021fc4 + adds r1, r6, 0 + movs r2, 0 + bl sub_8018220 + movs r0, 0x28 + bl _08016876 + .pool +_08015E24: + movs r0, 0xD + bl _08016876 +_08015E2A: + cmp r0, 0x52 + beq _08015E32 + bl _08016878 +_08015E32: + movs r5, 0 + movs r0, 0x20 + strb r0, [r6, 0x14] + ldr r0, =0x02021fc4 + ldr r4, =0x02022c2c + ldrb r2, [r4] + movs r1, 0x40 + orrs r1, r2 + ldr r2, =0x020229e8 + ldrb r2, [r2, 0x13] + bl sub_8017D9C + strb r5, [r4] + bl _08016878 + .pool +_08015E5C: + movs r0, 0x2 + ldrsh r1, [r7, r0] + lsls r1, 5 + ldr r0, [r6] + adds r0, r1 + bl sub_80179AC + adds r5, r0, 0 + movs r1, 0x2 + ldrsh r0, [r7, r1] + ldr r1, [r6] + bl sub_8017CF8 + adds r4, r0, 0 + ldr r2, =gUnknown_082EE24C + lsls r0, r4, 2 + lsls r1, r5, 3 + adds r0, r1 + adds r0, r2 + ldr r1, [r0] + movs r0, 0x6 + bl sub_8015664 + bl _08016878 + .pool +_08015E94: + adds r0, r6, 0 + adds r0, 0x16 + ldr r1, =0x02021fc4 + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + bne _08015EA8 + bl _08016878 +_08015EA8: + movs r4, 0 + movs r0, 0x29 + strb r0, [r6, 0x14] + bl sub_800ADF8 + adds r0, r6, 0 + adds r0, 0x98 + strh r4, [r0] + adds r0, 0x2 + strh r4, [r0] + bl _08016878 + .pool +_08015EC4: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _08015ED2 + bl _08016878 +_08015ED2: + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _08015F2C + ldr r5, =0x02021cc4 + bl link_get_multiplayer_id + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r4, =0x020229f0 + adds r1, r4 + adds r0, r5, 0 + bl CopyString + ldrh r0, [r4, 0x18] + adds r4, 0x1C + adds r1, r4, 0 + bl sub_800E540 + adds r5, r0, 0 + ldr r0, =0x02021fc4 + ldr r2, =gUnknown_082EE378 + lsls r1, r5, 2 + adds r1, r2 + ldr r1, [r1] + bl ExpandStringRefs + movs r0, 0x21 + bl _08016876 + .pool +_08015F2C: + movs r0, 0x7 + bl _08016876 +_08015F32: + adds r0, r6, 0 + adds r0, 0x16 + movs r1, 0 + bl sub_80170B8 + lsls r0, 24 + asrs r5, r0, 24 + cmp r5, 0 + beq _08015F5C + cmp r5, 0 + bgt _08015F54 + movs r0, 0x1 + negs r0, r0 + cmp r5, r0 + beq _08015F98 + bl _08016878 +_08015F54: + cmp r5, 0x1 + beq _08015F98 + bl _08016878 +_08015F5C: + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldr r4, =0x02022c2c + movs r0, 0x45 + strb r0, [r4] + movs r0, 0x45 + movs r1, 0 + movs r2, 0x1 + bl sub_8011090 + movs r2, 0x2 + ldrsh r0, [r7, r2] + lsls r0, 5 + ldr r1, [r6] + adds r1, r0 + adds r0, r1, 0 + adds r0, 0x10 + ldrb r2, [r4] + bl sub_8012188 + ldrh r0, [r7, 0x2] + strh r0, [r6, 0x12] + movs r0, 0x14 + strb r0, [r6, 0x14] + strh r5, [r7, 0x6] + bl _08016878 + .pool +_08015F98: + movs r3, 0x2 + ldrsh r0, [r7, r3] + ldr r1, [r6] + bl sub_8017CF8 + adds r4, r0, 0 + ldr r1, =gUnknown_082EEC9C + lsls r0, r4, 2 + adds r0, r1 + ldr r0, [r0] + bl sub_801568C + bl _08016878 + .pool +_08015FB8: + ldrh r0, [r7, 0x4] + adds r0, 0x1 + strh r0, [r7, 0x4] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3C + bgt _08015FCA + bl _08016878 +_08015FCA: + movs r1, 0 + movs r0, 0x15 + strb r0, [r6, 0x14] + strh r1, [r7, 0x4] + bl _08016878 +_08015FD6: + bl sub_8011A74 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + beq _0801603C + cmp r4, 0x3 + ble _08015FF4 + cmp r4, 0x4 + bne _08016040 + movs r0, 0x1 + bl sub_801818C + strb r4, [r6, 0x14] + b _08016040 +_08015FF4: + cmp r4, 0x1 + blt _08016040 + movs r1, 0x2 + ldrsh r0, [r7, r1] + ldr r1, [r6] + bl sub_8017CF8 + adds r4, r0, 0 + movs r0, 0x54 + movs r1, 0 + movs r2, 0x1 + bl sub_8011090 + bl sub_8011B90 + cmp r0, 0x1 + bne _08016028 + ldr r0, =gUnknown_082EED3C + lsls r1, r4, 2 + adds r1, r0 + ldr r0, [r1] + bl sub_801568C + b _08016040 + .pool +_08016028: + ldr r0, =gUnknown_082EED3C + lsls r1, r4, 2 + adds r1, r0 + ldr r1, [r1] + movs r0, 0x1E + bl sub_8015664 + b _08016040 + .pool +_0801603C: + movs r0, 0x16 + strb r0, [r6, 0x14] +_08016040: + ldrh r0, [r7, 0x6] + adds r0, 0x1 + strh r0, [r7, 0x6] + bl _08016878 +_0801604A: + bl sub_8011A80 + cmp r0, 0 + beq _08016092 + movs r2, 0x2 + ldrsh r0, [r7, r2] + ldr r1, [r6] + bl sub_8017CF8 + adds r4, r0, 0 + movs r0, 0x54 + movs r1, 0 + movs r2, 0x1 + bl sub_8011090 + bl sub_8011B90 + cmp r0, 0x1 + bne _08016084 + ldr r0, =gUnknown_082EED3C + lsls r1, r4, 2 + adds r1, r0 + ldr r0, [r1] + bl sub_801568C + b _08016092 + .pool +_08016084: + ldr r0, =gUnknown_082EED3C + lsls r1, r4, 2 + adds r1, r0 + ldr r1, [r1] + movs r0, 0x1E + bl sub_8015664 +_08016092: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _0801609E + bl _08016878 +_0801609E: + movs r0, 0x10 + bl _08016876 + .pool +_080160AC: + movs r0, 0x49 + bl audio_play + bl sub_800EF7C + movs r0, 0 + movs r1, 0xC + strb r1, [r6, 0x14] + adds r1, r6, 0 + adds r1, 0x9A + strh r0, [r1] + bl _08016878 +_080160C6: + bl sub_8011A80 + cmp r0, 0 + beq _080160DA + movs r0, 0 + bl sub_801818C + movs r0, 0x2 + bl _08016876 +_080160DA: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _080160E4 + b _08016878 +_080160E4: + ldr r0, =0x020228c4 + movs r1, 0x1 + bl sub_80143E4 + ldr r0, =sub_80140E0 + movs r1, 0x5 + bl AddTask + movs r0, 0x27 + b _08016876 + .pool +_08016104: + adds r0, r6, 0 + bl sub_801689C + ldr r0, =sub_80140E0 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + beq _08016118 + b _08016878 +_08016118: + movs r0, 0x21 + strb r0, [r6, 0x14] + ldr r0, =0x02021cc4 + ldr r4, =0x02022a0c + adds r1, r4, 0 + bl CopyString + adds r0, r4, 0 + subs r0, 0x24 + ldrh r0, [r0, 0x20] + adds r1, r4, 0 + bl sub_800E540 + adds r5, r0, 0 + ldr r0, =0x02021fc4 + ldr r2, =gUnknown_082EE324 + lsls r1, r5, 2 + adds r1, r2 + ldr r1, [r1] + bl ExpandStringRefs + b _08016878 + .pool +_08016158: + adds r0, r6, 0 + bl sub_801689C + adds r0, r6, 0 + adds r0, 0x16 + ldr r1, =0x02021fc4 + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + bne _08016170 + b _08016878 +_08016170: + movs r0, 0x22 + b _08016876 + .pool +_08016178: + adds r0, r6, 0 + bl sub_801689C + adds r0, r6, 0 + bl sub_80168DC + cmp r0, 0 + bne _0801618A + b _08016878 +_0801618A: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08016198 + b _08016878 +_08016198: + movs r0, 0x1 + bl sub_8011DE0 + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_082EE598 + bl CopyString + movs r0, 0x24 + b _08016876 + .pool +_080161B8: + ldr r1, =0x02021fc4 + movs r0, 0x9 + bl sub_8015664 + b _08016878 + .pool +_080161C8: + adds r0, r6, 0 + adds r0, 0x16 + movs r1, 0 + bl sub_80170B8 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _080161EE + cmp r1, 0 + bgt _080161E8 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080162AE + b _08016878 +_080161E8: + cmp r1, 0x1 + beq _080162AE + b _08016878 +_080161EE: + adds r0, r6, 0 + adds r0, 0x4C + movs r1, 0x51 + strh r1, [r0] + ldr r1, =0x02022c2c + ldrb r1, [r1] + adds r5, r0, 0 + cmp r1, 0x45 + bne _08016220 + movs r4, 0x40 + orrs r4, r1 + movs r0, 0x1 + bl sub_801100C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + movs r2, 0 + bl sub_8011090 + b _0801623E + .pool +_08016220: + movs r0, 0x40 + adds r4, r1, 0 + orrs r4, r0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + bl sub_801100C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_8011090 +_0801623E: + ldr r1, [r6, 0x8] + movs r0, 0 + strb r0, [r1, 0x1B] + strh r0, [r7, 0x6] + ldr r0, =0x02022c2c + ldrb r0, [r0] + cmp r0, 0x41 + bne _08016286 + bl sub_8018024 + cmp r0, 0 + bne _0801627C + movs r0, 0x52 + strh r0, [r5] + adds r0, r5, 0 + bl sub_800FE50 + movs r0, 0xA + strb r0, [r6, 0x14] + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_082EEC14 + bl CopyString + b _08016878 + .pool +_0801627C: + adds r0, r5, 0 + bl sub_800FE50 + movs r0, 0xD + b _08016876 +_08016286: + cmp r0, 0x48 + bne _080162A4 + adds r0, r5, 0 + bl sub_800FE50 + ldr r0, =0x02021fc4 + adds r1, r6, 0 + movs r2, 0x1 + bl sub_8018220 + movs r0, 0x28 + b _08016876 + .pool +_080162A4: + adds r0, r5, 0 + bl sub_800FE50 + movs r0, 0xD + b _08016876 +_080162AE: + adds r0, r6, 0 + adds r0, 0x4C + movs r1, 0x52 + strh r1, [r0] + bl sub_800FE50 + movs r0, 0xA + strb r0, [r6, 0x14] + ldr r0, =0x02021fc4 + ldr r1, =0x02022c2c + ldrb r1, [r1] + bl sub_8013078 + b _08016878 + .pool +_080162D4: + bl sub_800AC34 + movs r0, 0x24 + b _08016876 +_080162DC: + ldr r0, =0x03003124 + ldrb r4, [r0] + cmp r4, 0 + beq _080162E6 + b _08016878 +_080162E6: + ldr r1, =0x02022c2c + movs r0, 0x40 + strb r0, [r1] + ldr r1, =0x02021fc4 + movs r0, 0x25 + bl sub_8015664 + adds r0, r6, 0 + adds r0, 0x4C + movs r1, 0 + movs r2, 0xC + bl memset + adds r0, r6, 0 + adds r0, 0x9A + strh r4, [r0] + subs r0, 0x2 + strh r4, [r0] + b _08016878 + .pool +_08016318: + movs r0, 0x2 + strb r0, [r6, 0x14] + movs r0, 0 + bl sub_801818C + b _08016878 +_08016324: + ldr r4, =0x02021fc4 + ldr r0, =0x02022c2c + ldrb r0, [r0] + movs r1, 0x40 + orrs r1, r0 + adds r0, r4, 0 + bl sub_8017E00 + movs r0, 0xE + adds r1, r4, 0 + bl sub_8015664 + b _08016878 + .pool +_08016348: + bl sub_800ADF8 + movs r0, 0xF + b _08016876 +_08016350: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _0801635C + b _08016878 +_0801635C: + movs r0, 0x10 + b _08016876 +_08016360: + ldr r0, [r6, 0x8] + bl Free + ldr r0, [r6] + bl Free + ldr r0, [r6, 0xC] + bl Free + ldr r0, [r6, 0x4] + bl Free + adds r0, r6, 0 + adds r0, 0x20 + ldrb r0, [r0] + bl remove_task + adds r0, r6, 0 + adds r0, 0x21 + bl sub_8019F04 + movs r0, 0x11 + b _08016876 +_0801638E: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + movs r0, 0x12 + b _08016876 +_080163A2: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + beq _080163AE + b _08016878 +_080163AE: + bl sub_8019E3C + adds r0, r4, 0 + bl remove_task + ldr r0, =0x02022c30 + ldr r0, [r0] + bl Free + bl sub_80149D8 + b _08016878 + .pool +_080163CC: + bl sub_800F7DC + ldrh r1, [r0, 0x8] + ldr r4, =0x000003ff + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + bne _080163E4 + movs r0, 0x2B + b _08016876 + .pool +_080163E4: + bl sub_800F7DC + ldrh r1, [r0, 0x8] + adds r0, r4, 0 + ands r0, r1 + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + bne _08016408 + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_082EF590 + bl CopyString + b _0801643E + .pool +_08016408: + ldr r4, =0x02021cc4 + bl sub_800F7DC + ldrh r0, [r0, 0x8] + lsls r0, 22 + lsrs r0, 22 + movs r1, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r4, 0 + bl CopyString + ldr r4, =0x02021dc4 + bl sub_800F7DC + ldrb r1, [r0, 0xB] + lsrs r1, 1 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_082EF564 + bl ExpandStringRefs +_0801643E: + ldr r1, =0x02021fc4 + movs r0, 0x2C + bl sub_8015664 + b _08016878 + .pool +_0801645C: + adds r0, r6, 0 + adds r0, 0x16 + ldr r1, =gUnknown_082EF20C + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + bne _0801646E + b _08016878 +_0801646E: + movs r0, 0x2F + b _08016876 + .pool +_08016478: + adds r0, r6, 0 + adds r0, 0x16 + adds r1, r6, 0 + adds r1, 0x1D + adds r2, r6, 0 + adds r2, 0x1E + ldr r3, =gUnknown_082F025C + ldr r4, =gUnknown_082F027C + str r4, [sp] + bl sub_8017178 + adds r5, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r5, r0 + bne _0801649A + b _08016878 +_0801649A: + subs r0, 0x1 + cmp r5, r0 + beq _080164A4 + cmp r5, 0x3 + bne _080164B8 +_080164A4: + movs r0, 0x4 + strb r0, [r6, 0x14] + movs r0, 0x1 + bl sub_801818C + b _08016878 + .pool +_080164B8: + cmp r5, 0x1 + beq _080164C2 + cmp r5, 0x2 + beq _080164D0 + b _08016878 +_080164C2: + ldr r1, =gUnknown_082EF4C4 + movs r0, 0x35 + bl sub_8015664 + b _08016878 + .pool +_080164D0: + ldr r1, =gUnknown_082EF298 + movs r0, 0x2F + bl sub_8015664 + b _08016878 + .pool +_080164E0: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + movs r0, 0x36 + b _08016876 +_080164F4: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08016502 + b _08016878 +_08016502: + ldr r1, =0x02022c40 + movs r0, 0x1 + strh r0, [r1] + ldr r1, =0x03005dac + ldr r0, =sub_80AF128 + str r0, [r1] + ldr r1, =c2_exit_to_overworld_2_switch + movs r0, 0x8 + bl sub_81B8904 + b _08016878 + .pool +_0801652C: + adds r0, r6, 0 + adds r0, 0x16 + adds r1, r6, 0 + adds r1, 0x1D + adds r2, r6, 0 + adds r2, 0x1E + ldr r3, =gUnknown_082F0294 + ldr r4, =gUnknown_082F032C + str r4, [sp] + bl sub_8017178 + adds r5, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r5, r0 + bne _0801654E + b _08016878 +_0801654E: + subs r0, 0x1 + cmp r5, r0 + beq _08016558 + cmp r5, 0x12 + bne _08016580 +_08016558: + ldr r0, =0x02022c40 + bl sub_801807C + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl sub_8010FCC + ldr r0, =gUnknown_082EF4FC + bl sub_801568C + b _08016878 + .pool +_08016580: + ldr r0, =0x02022c40 + strh r5, [r0, 0x2] + movs r0, 0x37 + b _08016876 + .pool +_0801658C: + ldr r2, =0x02022c40 + ldrh r0, [r2, 0x2] + ldrh r1, [r2, 0xA] + ldrh r2, [r2, 0xC] + bl sub_8010FCC + ldr r0, =gUnknown_082EF520 + bl sub_801568C + b _08016878 + .pool +_080165A8: + adds r0, r6, 0 + adds r0, 0x16 + movs r1, 0 + bl sub_80170B8 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _080165CE + cmp r1, 0 + bgt _080165C8 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080165D2 + b _08016878 +_080165C8: + cmp r1, 0x1 + beq _080165D2 + b _08016878 +_080165CE: + movs r0, 0x38 + b _08016876 +_080165D2: + movs r0, 0x1 + bl sub_801818C + movs r0, 0x4 + b _08016876 +_080165DC: + adds r0, r6, 0 + adds r0, 0x16 + ldr r1, =gUnknown_082EF5B8 + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + bne _080165EE + b _08016878 +_080165EE: + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl sub_8010FCC + ldr r0, =0x02022c40 + bl sub_801807C + movs r0, 0x1 + bl sub_801818C + movs r0, 0x4 + b _08016876 + .pool +_08016610: + adds r0, r6, 0 + adds r0, 0x16 + ldr r1, =gUnknown_082EF1EC + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + bne _08016622 + b _08016878 +_08016622: + movs r0, 0x2E + b _08016876 + .pool +_0801662C: + bl sub_80173B0 + movs r0, 0x30 + b _08016876 +_08016634: + adds r0, r6, 0 + adds r0, 0x16 + adds r1, r6, 0 + adds r1, 0x1D + adds r2, r6, 0 + adds r2, 0x4A + adds r3, r6, 0 + adds r3, 0x1E + ldr r4, =gUnknown_082F034C + str r4, [sp] + ldr r4, =gUnknown_082F03A4 + str r4, [sp, 0x4] + ldr r4, [r6] + str r4, [sp, 0x8] + bl sub_80172A0 + adds r5, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r5, r0 + bne _08016660 + b _08016878 +_08016660: + subs r0, 0x1 + cmp r5, r0 + beq _0801666A + cmp r5, 0x8 + bne _0801667C +_0801666A: + movs r0, 0x1 + bl sub_801818C + movs r0, 0x4 + b _08016876 + .pool +_0801667C: + bl sub_80173B0 + ldr r1, [r6] + lsls r4, r5, 5 + adds r1, r4 + ldrb r0, [r1, 0x9] + lsrs r0, 2 + ldrh r1, [r1, 0x8] + lsls r1, 22 + lsrs r1, 22 + bl sub_8017D04 + cmp r0, 0x1 + beq _080166C8 + cmp r0, 0x1 + bgt _080166A2 + cmp r0, 0 + beq _080166A8 + b _08016878 +_080166A2: + cmp r0, 0x2 + beq _080166FC + b _08016878 +_080166A8: + ldr r0, =0x02021cc4 + ldr r1, [r6] + adds r1, r4 + bl sub_8018404 + ldr r1, =gUnknown_082EF65C + movs r0, 0x31 + bl sub_8015664 + strh r5, [r7, 0x2] + b _08016878 + .pool +_080166C8: + ldr r0, =0x02021cc4 + ldr r1, [r6] + adds r1, r4 + bl sub_8018404 + ldr r0, =0x02021dc4 + ldr r1, [r6] + adds r1, r4 + ldrb r2, [r1, 0x9] + lsrs r2, 2 + lsls r1, r2, 3 + subs r1, r2 + ldr r2, =gTypeNames + adds r1, r2 + bl CopyString + ldr r1, =gUnknown_082EF6E4 + b _0801671E + .pool +_080166FC: + ldr r0, =0x02021cc4 + ldr r1, [r6] + adds r1, r4 + bl sub_8018404 + ldr r0, =0x02021dc4 + ldr r1, [r6] + adds r1, r4 + ldrb r2, [r1, 0x9] + lsrs r2, 2 + lsls r1, r2, 3 + subs r1, r2 + ldr r2, =gTypeNames + adds r1, r2 + bl CopyString + ldr r1, =gUnknown_082EF718 +_0801671E: + movs r0, 0x2E + bl sub_8015664 + b _08016878 + .pool +_08016738: + adds r0, r6, 0 + adds r0, 0x16 + movs r1, 0 + bl sub_80170B8 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _0801675E + cmp r1, 0 + bgt _08016758 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08016762 + b _08016878 +_08016758: + cmp r1, 0x1 + beq _08016762 + b _08016878 +_0801675E: + movs r0, 0x32 + b _08016876 +_08016762: + movs r0, 0x1 + bl sub_801818C + movs r0, 0x4 + b _08016876 +_0801676C: + adds r0, r6, 0 + adds r0, 0x16 + ldr r1, =gUnknown_082EF4C4 + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + bne _0801677E + b _08016878 +_0801677E: + ldr r4, =0x02022c40 + movs r0, 0x2 + strh r0, [r4] + ldr r2, =0x02022c38 + movs r3, 0x2 + ldrsh r0, [r7, r3] + ldr r1, [r6] + lsls r0, 5 + adds r0, r1 + ldr r0, [r0] + str r0, [r2] + ldr r2, =0x02022c3e + ldr r1, [r6] + movs r3, 0x2 + ldrsh r0, [r7, r3] + lsls r0, 5 + adds r1, r0 + ldrb r0, [r1, 0x9] + lsrs r0, 2 + strb r0, [r2] + ldr r2, =0x02022c3c + ldr r1, [r6] + movs r3, 0x2 + ldrsh r0, [r7, r3] + lsls r0, 5 + adds r1, r0 + ldrh r0, [r1, 0x8] + lsls r0, 22 + lsrs r0, 22 + strh r0, [r2] + ldr r1, =0x03005dac + ldr r0, =sub_80AF128 + str r0, [r1] + ldr r1, =c2_exit_to_overworld_2_switch + movs r0, 0x9 + bl sub_81B8904 + adds r0, r6, 0 + bl sub_80156B0 + ldrh r0, [r7, 0x2] + strb r0, [r4, 0x8] + b _08016878 + .pool +_080167F4: + ldr r1, =0x02022c2c + movs r0, 0x44 + strb r0, [r1] + movs r1, 0x2 + ldrsh r0, [r7, r1] + lsls r0, 5 + ldr r1, [r6] + adds r1, r0 + adds r0, r1, 0 + adds r0, 0x10 + movs r2, 0x44 + bl sub_8012188 + ldr r0, =0x02021cc4 + movs r3, 0x2 + ldrsh r2, [r7, r3] + lsls r2, 5 + ldr r1, [r6] + adds r1, r2 + bl sub_8018404 + ldr r0, =gUnknown_082EE17C + ldr r0, [r0, 0x8] + bl sub_8017020 + movs r0, 0x19 + b _08016876 + .pool +_08016838: + adds r0, r6, 0 + adds r0, 0x16 + ldr r1, =0x02021fc4 + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + beq _08016878 + movs r0, 0x1 + bl sub_801818C + movs r1, 0 + ldrsh r0, [r7, r1] + movs r2, 0x2 + ldrsh r1, [r7, r2] + ldr r2, [r6] + bl sub_801A3D0 + movs r0, 0x4 + b _08016876 + .pool +_08016864: + adds r0, r6, 0 + adds r0, 0x16 + ldr r1, =0x02021fc4 + bl sub_8017064 + lsls r0, 24 + cmp r0, 0 + beq _08016878 + ldrb r0, [r6, 0x15] +_08016876: + strb r0, [r6, 0x14] +_08016878: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80156E0 + + thumb_func_start var_800D_set_xB +var_800D_set_xB: @ 8016884 + push {lr} + bl InUnionRoom + cmp r0, 0x1 + bne _08016894 + ldr r1, =0x020375f0 + movs r0, 0xB + strh r0, [r1] +_08016894: + pop {r0} + bx r0 + .pool + thumb_func_end var_800D_set_xB + + thumb_func_start sub_801689C +sub_801689C: @ 801689C + push {r4,r5,lr} + adds r2, r0, 0 + ldr r3, =0x03003090 + ldrh r5, [r3, 0x12] + adds r4, r5, 0 + cmp r4, 0 + beq _080168D0 + ldrh r0, [r3, 0x10] + movs r1, 0xFF + lsls r1, 8 + ands r1, r0 + movs r0, 0xBC + lsls r0, 6 + cmp r1, r0 + bne _080168D0 + adds r0, r2, 0 + adds r0, 0x9A + strh r5, [r0] + cmp r4, 0x44 + bne _080168D0 + ldrh r1, [r3, 0x14] + adds r0, 0x2 + strh r1, [r0] + ldrh r1, [r3, 0x16] + adds r0, 0x2 + strh r1, [r0] +_080168D0: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801689C + + thumb_func_start sub_80168DC +sub_80168DC: @ 80168DC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r4, 0 + adds r5, 0x9A + ldrh r0, [r5] + cmp r0, 0 + beq _0801692C + ldr r0, =0x02021fc4 + ldr r1, =0x020229e8 + adds r1, 0x2F + ldrb r1, [r1] + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_8017EA0 + cmp r0, 0 + beq _0801692C + cmp r0, 0x1 + bne _0801691C + movs r0, 0x23 + strb r0, [r4, 0x14] + ldr r1, =0x02022c2c + ldrh r0, [r5] + strb r0, [r1] + movs r0, 0 + b _0801692E + .pool +_0801691C: + cmp r0, 0x2 + bne _0801692C + movs r0, 0x24 + strb r0, [r4, 0x14] + bl sub_800AC34 + movs r0, 0 + b _0801692E +_0801692C: + movs r0, 0x1 +_0801692E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80168DC + + thumb_func_start sub_8016934 +sub_8016934: @ 8016934 + push {r4,r5,lr} + ldr r5, =0x02022c20 + movs r0, 0xFF + strb r0, [r5] + ldr r0, =task00_081199FC + movs r1, 0 + bl AddTask + ldr r4, =0x02022c30 + movs r0, 0x9B + lsls r0, 2 + bl AllocZeroed + str r0, [r4] + ldr r1, =0x03000da8 + str r0, [r1] + movs r1, 0 + strb r1, [r0, 0x14] + strb r1, [r0, 0x16] + strh r1, [r0, 0x10] + strh r1, [r0, 0x12] + movs r0, 0x1 + negs r0, r0 + strb r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8016934 + + thumb_func_start task00_081199FC +task00_081199FC: @ 801697C + push {r4-r6,lr} + sub sp, 0x20 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02022c30 + ldr r5, [r0] + ldrb r0, [r5, 0x14] + cmp r0, 0x4 + bls _08016990 + b _08016AC8 +_08016990: + lsls r0, 2 + ldr r1, =_080169A4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080169A4: + .4byte _080169B8 + .4byte _080169BE + .4byte _080169E0 + .4byte _08016A30 + .4byte _08016A94 +_080169B8: + movs r0, 0x1 + strb r0, [r5, 0x14] + b _08016AC8 +_080169BE: + movs r0, 0xC + movs r1, 0 + movs r2, 0 + bl sub_8010F84 + bl sub_800B488 + bl sub_8009734 + bl sub_8011C84 + movs r0, 0x1 + bl sub_80111B0 + movs r0, 0x2 + strb r0, [r5, 0x14] + b _08016AC8 +_080169E0: + movs r0, 0x70 + bl AllocZeroed + str r0, [r5, 0x4] + movs r1, 0x4 + bl sub_80175EC + movs r0, 0x70 + bl AllocZeroed + str r0, [r5, 0xC] + movs r1, 0x4 + bl sub_80175EC + movs r0, 0x80 + lsls r0, 1 + bl AllocZeroed + str r0, [r5] + movs r1, 0x8 + bl sub_8017580 + movs r0, 0x20 + bl AllocZeroed + str r0, [r5, 0x8] + movs r1, 0x1 + bl sub_8017580 + ldr r0, [r5, 0xC] + ldr r1, [r5, 0x4] + movs r2, 0xA + bl sub_8016DF0 + adds r1, r5, 0 + adds r1, 0x20 + strb r0, [r1] + movs r0, 0x3 + strb r0, [r5, 0x14] + b _08016AC8 +_08016A30: + bl sub_8016B00 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + blt _08016AC8 + cmp r0, 0x2 + bgt _08016AC8 + ldr r0, =0x02022c20 + ldrb r0, [r0] + cmp r0, 0xFF + bne _08016AC8 + movs r6, 0 +_08016A4A: + ldr r0, [r5] + lsls r4, r6, 5 + adds r1, r0, r4 + ldrb r0, [r1, 0x1A] + lsls r0, 30 + lsrs r0, 30 + cmp r0, 0x1 + bne _08016A78 + mov r0, sp + bl sub_8018404 + ldr r0, [r5] + adds r0, r4 + adds r0, 0x2 + bl sub_8015658 + lsls r0, 16 + lsrs r0, 16 + mov r1, sp + bl sub_800E540 + cmp r0, 0 + bne _08016A84 +_08016A78: + adds r6, 0x1 + cmp r6, 0x7 + ble _08016A4A + b _08016AC8 + .pool +_08016A84: + ldr r0, =0x02022c20 + mov r1, sp + bl CopyString + b _08016AC8 + .pool +_08016A94: + ldr r0, [r5, 0x8] + bl Free + ldr r0, [r5] + bl Free + ldr r0, [r5, 0xC] + bl Free + ldr r0, [r5, 0x4] + bl Free + adds r0, r5, 0 + adds r0, 0x20 + ldrb r0, [r0] + bl remove_task + ldr r0, =0x02022c30 + ldr r0, [r0] + bl Free + bl sub_800EDD4 + adds r0, r4, 0 + bl remove_task +_08016AC8: + add sp, 0x20 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end task00_081199FC + + thumb_func_start sp182_move_string +sp182_move_string: @ 8016AD4 + push {r4,lr} + ldr r4, =0x02022c20 + ldrb r0, [r4] + cmp r0, 0xFF + bne _08016AE8 + movs r0, 0 + b _08016AF6 + .pool +_08016AE8: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + bl CopyString + movs r0, 0xFF + strb r0, [r4] + movs r0, 0x1 +_08016AF6: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sp182_move_string + + thumb_func_start sub_8016B00 +sub_8016B00: @ 8016B00 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r0, =0x02022c30 + ldr r4, [r0] + movs r7, 0 + movs r6, 0 + movs r5, 0 +_08016B12: + ldr r0, [r4, 0xC] + adds r0, r5 + ldr r1, =gUnknown_082F045C + bl sub_8017630 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x1 + bne _08016B5C + ldr r1, [r4, 0xC] + ldr r0, [r4, 0x8] + adds r1, r5 + ldm r1!, {r2,r5,r6} + stm r0!, {r2,r5,r6} + ldm r1!, {r2,r5,r6} + stm r0!, {r2,r5,r6} + ldr r1, [r4, 0x8] + movs r0, 0 + strh r0, [r1, 0x18] + ldr r2, [r4, 0x8] + ldrb r1, [r2, 0x1A] + movs r5, 0x4 + negs r5, r5 + adds r0, r5, 0 + ands r1, r0 + movs r0, 0x1 + orrs r1, r0 + strb r1, [r2, 0x1A] + ldr r0, [r4, 0x8] + strb r3, [r0, 0x1B] + movs r0, 0x4 + b _08016C90 + .pool +_08016B5C: + adds r5, 0x1C + adds r6, 0x1 + cmp r6, 0x3 + ble _08016B12 + movs r6, 0 + mov r9, r6 +_08016B68: + ldr r0, [r4] + mov r1, r9 + lsls r5, r1, 5 + adds r2, r0, r5 + ldrb r0, [r2, 0x1A] + lsls r0, 30 + mov r8, r5 + cmp r0, 0 + beq _08016C5C + ldr r1, [r4, 0x4] + adds r0, r2, 0 + bl sub_80176E4 + adds r6, r0, 0 + cmp r6, 0xFF + beq _08016C02 + ldr r0, [r4] + adds r2, r0, r5 + ldrb r1, [r2, 0x1A] + lsls r0, r1, 30 + lsrs r0, 30 + cmp r0, 0x1 + bne _08016BE0 + lsls r0, r6, 3 + subs r0, r6 + lsls r6, r0, 2 + ldr r1, [r4, 0x4] + adds r1, r6 + adds r0, r2, 0 + bl sub_8017678 + cmp r0, 0 + beq _08016BC6 + ldr r1, [r4] + ldr r0, [r4, 0x4] + adds r1, r5 + adds r0, r6 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldr r0, [r4] + adds r0, r5 + movs r1, 0x40 + strb r1, [r0, 0x1B] + movs r7, 0x1 + b _08016BF8 +_08016BC6: + ldr r0, [r4] + adds r1, r0, r5 + ldrb r0, [r1, 0x1B] + cmp r0, 0 + beq _08016BF8 + subs r0, 0x1 + strb r0, [r1, 0x1B] + ldr r0, [r4] + adds r0, r5 + ldrb r0, [r0, 0x1B] + cmp r0, 0 + bne _08016BF8 + b _08016BF6 +_08016BE0: + movs r3, 0x4 + negs r3, r3 + adds r0, r3, 0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x1A] + ldr r0, [r4] + adds r0, r5 + movs r1, 0 + strb r1, [r0, 0x1B] +_08016BF6: + movs r7, 0x2 +_08016BF8: + ldr r0, [r4] + add r0, r8 + movs r1, 0 + strh r1, [r0, 0x18] + b _08016C5C +_08016C02: + ldr r0, [r4] + adds r1, r0, r5 + ldrb r0, [r1, 0x1A] + lsls r2, r0, 30 + lsrs r0, r2, 30 + cmp r0, 0x2 + beq _08016C3C + ldrh r0, [r1, 0x18] + adds r0, 0x1 + strh r0, [r1, 0x18] + ldr r0, [r4] + adds r2, r0, r5 + ldrh r1, [r2, 0x18] + ldr r0, =0x00000257 + cmp r1, r0 + bls _08016C5C + ldrb r0, [r2, 0x1A] + movs r5, 0x4 + negs r5, r5 + adds r1, r5, 0 + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2, 0x1A] + movs r7, 0x2 + b _08016C5C + .pool +_08016C3C: + lsrs r0, r2, 30 + cmp r0, 0x2 + bne _08016C5C + ldrh r0, [r1, 0x18] + adds r0, 0x1 + strh r0, [r1, 0x18] + ldr r0, [r4] + adds r2, r0, r5 + ldrh r1, [r2, 0x18] + ldr r0, =0x00000383 + cmp r1, r0 + bls _08016C5C + adds r0, r2, 0 + movs r1, 0x1 + bl sub_8017580 +_08016C5C: + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + cmp r0, 0x7 + bhi _08016C6C + b _08016B68 +_08016C6C: + movs r5, 0 + movs r6, 0x3 +_08016C70: + ldr r0, [r4] + ldr r1, [r4, 0x4] + adds r1, r5 + movs r2, 0x8 + bl sub_8017734 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _08016C86 + movs r7, 0x1 +_08016C86: + adds r5, 0x1C + subs r6, 0x1 + cmp r6, 0 + bge _08016C70 + adds r0, r7, 0 +_08016C90: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8016B00 + + thumb_func_start sub_8016CA0 +sub_8016CA0: @ 8016CA0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r0, 2 + add r0, r10 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r6, r0, r1 + movs r7, 0 + mov r0, sp + adds r0, 0x10 + str r0, [sp, 0x18] +_08016CC4: + lsls r2, r7, 24 + lsrs r2, 24 + mov r0, sp + ldr r1, [sp, 0x18] + bl sub_800DE7C + lsls r0, 24 + lsrs r4, r0, 24 + mov r0, sp + ldrb r0, [r0, 0xA] + lsls r0, 25 + lsrs r0, 25 + mov r2, r10 + lsls r1, r2, 2 + add r1, r10 + lsls r1, 3 + ldr r3, =0x03005e00 + adds r1, r3 + movs r5, 0x10 + ldrsh r1, [r1, r5] + bl sub_8013D88 + cmp r0, 0 + bne _08016D00 + mov r1, sp + ldr r0, =gUnknown_082F045C + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} +_08016D00: + mov r0, sp + ldrb r1, [r0] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x1 + bne _08016D18 + mov r1, sp + ldr r0, =gUnknown_082F045C + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} +_08016D18: + cmp r4, 0 + bne _08016D9C + lsls r0, r7, 3 + mov r8, r0 + adds r1, r7, 0x1 + mov r9, r1 + cmp r7, 0 + ble _08016D58 + movs r2, 0 + str r2, [sp, 0x1C] + adds r4, r7, 0 +_08016D2E: + ldr r0, [r6, 0x4] + ldr r3, [sp, 0x1C] + adds r0, r3 + mov r1, sp + bl sub_8017630 + lsls r0, 24 + cmp r0, 0 + bne _08016D4C + mov r1, sp + ldr r0, =gUnknown_082F045C + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} +_08016D4C: + ldr r5, [sp, 0x1C] + adds r5, 0x1C + str r5, [sp, 0x1C] + subs r4, 0x1 + cmp r4, 0 + bne _08016D2E +_08016D58: + ldr r1, [r6, 0x4] + mov r0, r8 + subs r4, r0, r7 + lsls r4, 2 + adds r1, r4 + mov r0, sp + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldr r0, [r6, 0x4] + adds r0, r4 + ldr r1, =gUnknown_082F045C + bl sub_8017630 + ldr r3, [r6, 0x4] + adds r3, r4 + movs r2, 0x1 + ands r2, r0 + ldrb r0, [r3, 0x18] + movs r4, 0x2 + negs r4, r4 + adds r1, r4, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r3, 0x18] + b _08016DD4 + .pool +_08016D9C: + ldr r1, [r6] + lsls r4, r7, 3 + subs r4, r7 + lsls r4, 2 + adds r1, r4 + mov r0, sp + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldr r0, [r6] + adds r0, r4 + ldr r1, =gUnknown_082F045C + bl sub_8017630 + ldr r3, [r6] + adds r3, r4 + movs r2, 0x1 + ands r2, r0 + ldrb r0, [r3, 0x18] + movs r4, 0x2 + negs r4, r4 + adds r1, r4, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r3, 0x18] + adds r7, 0x1 + mov r9, r7 +_08016DD4: + mov r7, r9 + cmp r7, 0x3 + bgt _08016DDC + b _08016CC4 +_08016DDC: + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8016CA0 + + thumb_func_start sub_8016DF0 +sub_8016DF0: @ 8016DF0 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + ldr r0, =sub_8016CA0 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r2, =0x03005e08 + adds r3, r1, r2 + str r4, [r3] + str r5, [r3, 0x4] + adds r2, r1 + strh r6, [r2, 0x8] + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8016DF0 + + thumb_func_start sub_8016E24 +sub_8016E24: @ 8016E24 + 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 + mov r10, r0 + lsls r0, 2 + add r0, r10 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r6, r0, r1 + movs r3, 0 +_08016E42: + lsls r4, r3, 3 + subs r0, r4, r3 + lsls r5, r0, 2 + ldr r0, [r6] + adds r0, r5 + adds r1, r0, 0 + adds r1, 0x10 + lsls r2, r3, 24 + lsrs r2, 24 + str r3, [sp] + bl sub_800DE7C + ldr r0, [r6] + adds r0, r5 + ldrb r0, [r0, 0xA] + lsls r0, 25 + lsrs r0, 25 + mov r2, r10 + lsls r1, r2, 2 + add r1, r10 + lsls r1, 3 + ldr r7, =0x03005e00 + adds r1, r7 + movs r2, 0xC + ldrsh r1, [r1, r2] + bl sub_8013D88 + mov r8, r4 + ldr r3, [sp] + cmp r0, 0 + bne _08016E8E + ldr r1, [r6] + adds r1, r5 + ldr r0, =gUnknown_082F045C + ldm r0!, {r2,r4,r7} + stm r1!, {r2,r4,r7} + ldm r0!, {r2,r4,r7} + stm r1!, {r2,r4,r7} +_08016E8E: + adds r4, r3, 0x1 + mov r9, r4 + cmp r3, 0 + ble _08016ED2 + str r5, [sp, 0x4] + movs r5, 0 + str r5, [sp, 0x8] + adds r4, r3, 0 +_08016E9E: + ldr r1, [r6] + ldr r7, [sp, 0x8] + adds r0, r1, r7 + ldr r2, [sp, 0x4] + adds r1, r2 + str r3, [sp] + bl sub_8017630 + lsls r0, 24 + ldr r3, [sp] + cmp r0, 0 + bne _08016EC6 + ldr r1, [r6] + ldr r5, [sp, 0x4] + adds r1, r5 + ldr r0, =gUnknown_082F045C + ldm r0!, {r2,r5,r7} + stm r1!, {r2,r5,r7} + ldm r0!, {r2,r5,r7} + stm r1!, {r2,r5,r7} +_08016EC6: + ldr r7, [sp, 0x8] + adds r7, 0x1C + str r7, [sp, 0x8] + subs r4, 0x1 + cmp r4, 0 + bne _08016E9E +_08016ED2: + mov r0, r8 + subs r4, r0, r3 + lsls r4, 2 + ldr r0, [r6] + adds r0, r4 + ldr r1, =gUnknown_082F045C + bl sub_8017630 + ldr r3, [r6] + adds r3, r4 + movs r2, 0x1 + ands r2, r0 + ldrb r0, [r3, 0x18] + movs r4, 0x2 + negs r4, r4 + adds r1, r4, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r3, 0x18] + mov r3, r9 + cmp r3, 0x3 + ble _08016E42 + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8016E24 + + thumb_func_start sub_8016F1C +sub_8016F1C: @ 8016F1C + push {lr} + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x7 + bne _08016F2C + ldrb r1, [r0] + movs r0, 0x20 + b _08016F34 +_08016F2C: + cmp r1, 0x8 + bne _08016F3E + ldrb r1, [r0] + movs r0, 0x10 +_08016F34: + ands r0, r1 + cmp r0, 0 + beq _08016F3E + movs r0, 0x1 + b _08016F40 +_08016F3E: + movs r0, 0 +_08016F40: + pop {r1} + bx r1 + thumb_func_end sub_8016F1C + + thumb_func_start sub_8016F44 +sub_8016F44: @ 8016F44 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r4, r1, r0 + movs r6, 0 + subs r0, 0x8 + movs r5, 0 + adds r1, r0 + mov r8, r1 +_08016F62: + ldr r0, [r4] + adds r0, r5 + adds r1, r0, 0 + adds r1, 0x10 + lsls r2, r6, 24 + lsrs r2, 24 + bl sub_800DF34 + lsls r0, 24 + cmp r0, 0 + beq _08016F86 + ldr r0, [r4] + adds r0, r5 + mov r2, r8 + movs r3, 0xC + ldrsh r1, [r2, r3] + bl sub_8016F1C +_08016F86: + ldr r0, [r4] + adds r0, r5 + ldr r1, =gUnknown_082F045C + bl sub_8017630 + ldr r3, [r4] + adds r3, r5 + movs r2, 0x1 + ands r2, r0 + ldrb r0, [r3, 0x18] + movs r7, 0x2 + negs r7, r7 + adds r1, r7, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r3, 0x18] + adds r5, 0x1C + adds r6, 0x1 + cmp r6, 0x3 + ble _08016F62 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8016F44 + + thumb_func_start sub_8016FC0 +sub_8016FC0: @ 8016FC0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, =sub_8016E24 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + ldr r1, =0x03005e08 + adds r3, r2, r1 + str r4, [r3] + adds r1, r2 + strh r5, [r1, 0x4] + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8016FC0 + + thumb_func_start sub_8016FF0 +sub_8016FF0: @ 8016FF0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, =sub_8016F44 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + ldr r1, =0x03005e08 + adds r3, r2, r1 + str r4, [r3] + adds r1, r2 + strh r5, [r1, 0x4] + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8016FF0 + + thumb_func_start sub_8017020 +sub_8017020: @ 8017020 + push {r4,lr} + adds r4, r0, 0 + bl sub_81973A4 + movs r0, 0 + movs r1, 0x1 + bl sub_81973C4 + ldr r0, =0x02021fc4 + adds r1, r4, 0 + bl ExpandStringRefs + movs r0, 0 + movs r1, 0x1 + bl AddTextPrinterWithCustomSpeedForMessage + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8017020 + + thumb_func_start sub_801704C +sub_801704C: @ 801704C + push {lr} + bl sub_8197224 + lsls r0, 16 + cmp r0, 0 + beq _0801705C + movs r0, 0 + b _0801705E +_0801705C: + movs r0, 0x1 +_0801705E: + pop {r1} + bx r1 + thumb_func_end sub_801704C + + thumb_func_start sub_8017064 +sub_8017064: @ 8017064 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4] + cmp r0, 0 + beq _08017076 + cmp r0, 0x1 + beq _0801709C + b _080170AE +_08017076: + bl sub_81973A4 + movs r0, 0 + movs r1, 0x1 + bl sub_81973C4 + ldr r0, =0x02021fc4 + adds r1, r5, 0 + bl ExpandStringRefs + movs r0, 0x1 + bl AddTextPrinterForMessage_2 + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _080170AE + .pool +_0801709C: + bl sub_8197224 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _080170AE + strb r0, [r4] + movs r0, 0x1 + b _080170B0 +_080170AE: + movs r0, 0 +_080170B0: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8017064 + + thumb_func_start sub_80170B8 +sub_80170B8: @ 80170B8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4] + cmp r0, 0 + beq _080170CA + cmp r0, 0x1 + beq _080170E0 + b _0801710C +_080170CA: + cmp r5, 0 + beq _080170D4 + movs r0, 0x3 + negs r0, r0 + b _08017110 +_080170D4: + bl sub_8197930 + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _0801710C +_080170E0: + cmp r5, 0 + beq _080170F2 + bl sub_8198C78 + movs r0, 0 + strb r0, [r4] + movs r0, 0x3 + negs r0, r0 + b _08017110 +_080170F2: + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + movs r2, 0x80 + lsls r2, 17 + adds r0, r2 + lsrs r0, 24 + cmp r0, 0x2 + bhi _0801710C + strb r5, [r4] + adds r0, r1, 0 + b _08017110 +_0801710C: + movs r0, 0x2 + negs r0, r0 +_08017110: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80170B8 + + thumb_func_start sub_8017118 +sub_8017118: @ 8017118 + push {r4,lr} + sub sp, 0x8 + bl AddWindow + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0 + bl sub_81973FC + adds r0, r4, 0 + movs r1, 0xFF + bl FillWindowPixelBuffer + ldr r2, =gUnknown_082EFD94 + movs r0, 0x1 + str r0, [sp] + movs r0, 0x6 + str r0, [sp, 0x4] + adds r0, r4, 0 + movs r1, 0x1 + movs r3, 0x8 + bl sub_80173E0 + adds r0, r4, 0 + movs r1, 0x2 + bl CopyWindowToVram + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8017118 + + thumb_func_start sub_8017168 +sub_8017168: @ 8017168 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl RemoveWindow + pop {r0} + bx r0 + thumb_func_end sub_8017168 + + thumb_func_start sub_8017178 +sub_8017178: @ 8017178 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + adds r7, r0, 0 + adds r5, r1, 0 + mov r9, r2 + ldrb r4, [r7] + cmp r4, 0 + beq _08017194 + cmp r4, 0x1 + beq _08017228 + b _0801728E +_08017194: + ldr r0, [r3] + ldr r1, [r3, 0x4] + str r0, [sp] + str r1, [sp, 0x4] + ldr r0, [sp, 0x24] + bl sub_81DB41C + adds r1, r0, 0 + ldr r2, [sp] + lsrs r0, r2, 24 + cmp r0, r1 + ble _080171B6 + lsls r1, 24 + ldr r0, =0x00ffffff + ands r0, r2 + orrs r0, r1 + str r0, [sp] +_080171B6: + ldr r2, [sp] + lsrs r0, r2, 8 + lsls r0, 24 + lsrs r0, 24 + lsrs r1, r2, 24 + adds r0, r1 + cmp r0, 0x1D + ble _080171DC + movs r0, 0x1D + subs r0, r1 + cmp r0, 0 + bge _080171D0 + movs r0, 0 +_080171D0: + lsls r1, r0, 24 + lsrs r1, 16 + ldr r0, =0xffff00ff + ands r0, r2 + orrs r0, r1 + str r0, [sp] +_080171DC: + mov r0, sp + bl AddWindow + strb r0, [r5] + ldrb r0, [r5] + movs r1, 0 + bl sub_81973FC + ldr r0, =0x03006310 + adds r2, r0, 0 + ldr r1, [sp, 0x24] + ldm r1!, {r3,r4,r6} + stm r2!, {r3,r4,r6} + ldm r1!, {r3,r4,r6} + stm r2!, {r3,r4,r6} + ldrb r1, [r5] + strb r1, [r0, 0x10] + movs r1, 0 + movs r2, 0 + bl ListMenuInit + mov r1, r9 + strb r0, [r1] + ldrb r0, [r5] + movs r1, 0x1 + bl CopyWindowToVram + ldrb r0, [r7] + adds r0, 0x1 + strb r0, [r7] + b _0801728E + .pool +_08017228: + mov r3, r9 + ldrb r0, [r3] + bl ListMenuHandleInput + mov r8, r0 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + ands r4, r1 + cmp r4, 0 + beq _08017264 + mov r4, r9 + ldrb r0, [r4] + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + ldrb r0, [r5] + movs r1, 0x1 + bl sub_819746C + ldrb r0, [r5] + bl RemoveWindow + movs r0, 0 + strb r0, [r7] + mov r0, r8 + b _08017292 + .pool +_08017264: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0801728E + mov r6, r9 + ldrb r0, [r6] + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + ldrb r0, [r5] + movs r1, 0x1 + bl sub_819746C + ldrb r0, [r5] + bl RemoveWindow + strb r4, [r7] + movs r0, 0x2 + negs r0, r0 + b _08017292 +_0801728E: + movs r0, 0x1 + negs r0, r0 +_08017292: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8017178 + + thumb_func_start sub_80172A0 +sub_80172A0: @ 80172A0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r5, r0, 0 + adds r6, r1, 0 + mov r10, r2 + mov r9, r3 + ldrb r4, [r5] + cmp r4, 0x1 + beq _0801730C + cmp r4, 0x1 + bgt _080172C2 + cmp r4, 0 + beq _080172C8 + b _0801739C +_080172C2: + cmp r4, 0x2 + beq _0801731C + b _0801739C +_080172C8: + ldr r0, =gUnknown_082F0344 + bl sub_8017118 + mov r1, r9 + strb r0, [r1] + ldr r0, [sp, 0x20] + bl AddWindow + strb r0, [r6] + ldrb r0, [r6] + movs r1, 0 + bl sub_81973FC + ldr r0, =0x03006310 + adds r2, r0, 0 + ldr r1, [sp, 0x24] + ldm r1!, {r3,r4,r7} + stm r2!, {r3,r4,r7} + ldm r1!, {r3,r4,r7} + stm r2!, {r3,r4,r7} + ldrb r1, [r6] + strb r1, [r0, 0x10] + movs r1, 0 + movs r2, 0x1 + bl ListMenuInit + mov r1, r10 + strb r0, [r1] + b _08017314 + .pool +_0801730C: + ldrb r0, [r6] + movs r1, 0x1 + bl CopyWindowToVram +_08017314: + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + b _0801739C +_0801731C: + mov r3, r10 + ldrb r0, [r3] + bl ListMenuHandleInput + adds r1, r0, 0 + ldr r0, =0x030022c0 + ldrh r2, [r0, 0x2E] + movs r0, 0x3 + ands r0, r2 + cmp r0, 0 + beq _0801739C + cmp r1, 0x8 + beq _0801733E + ands r4, r2 + mov r8, r4 + cmp r4, 0 + beq _08017368 +_0801733E: + mov r4, r10 + ldrb r0, [r4] + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + ldrb r0, [r6] + bl RemoveWindow + mov r7, r9 + ldrb r0, [r7] + bl sub_8017168 + movs r0, 0 + strb r0, [r5] + movs r0, 0x2 + negs r0, r0 + b _080173A0 + .pool +_08017368: + ldr r0, [sp, 0x28] + bl sub_8017CB0 + adds r4, r0, 0 + cmp r4, 0 + blt _08017396 + mov r1, r10 + ldrb r0, [r1] + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + ldrb r0, [r6] + bl RemoveWindow + mov r3, r9 + ldrb r0, [r3] + bl sub_8017168 + mov r7, r8 + strb r7, [r5] + adds r0, r4, 0 + b _080173A0 +_08017396: + movs r0, 0x7 + bl audio_play +_0801739C: + movs r0, 0x1 + negs r0, r0 +_080173A0: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80172A0 + + thumb_func_start sub_80173B0 +sub_80173B0: @ 80173B0 + push {lr} + sub sp, 0xC + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect + movs r0, 0 + bl CopyBgTilemapBufferToVram + add sp, 0xC + pop {r0} + bx r0 + thumb_func_end sub_80173B0 + + thumb_func_start sub_80173D4 +sub_80173D4: @ 80173D4 + push {lr} + bl script_env_2_enable_and_set_ctx_running + pop {r0} + bx r0 + thumb_func_end sub_80173D4 + + thumb_func_start sub_80173E0 +sub_80173E0: @ 80173E0 + push {r4,r5,lr} + sub sp, 0x10 + ldr r5, [sp, 0x1C] + ldr r4, [sp, 0x20] + lsls r3, 24 + lsrs r3, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r4, 24 + lsrs r4, 24 + str r2, [sp] + mov r2, sp + strb r0, [r2, 0x4] + mov r0, sp + strb r1, [r0, 0x5] + strb r3, [r0, 0x6] + strb r5, [r0, 0x7] + strb r3, [r0, 0x8] + strb r5, [r0, 0x9] + ldrb r1, [r2, 0xC] + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0xC] + ldr r2, =0x03003014 + ldrb r1, [r2] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + cmp r4, 0x6 + bls _08017422 + b _0801756E +_08017422: + lsls r0, r4, 2 + ldr r1, =_08017434 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08017434: + .4byte _08017450 + .4byte _0801747C + .4byte _080174A8 + .4byte _080174D4 + .4byte _08017500 + .4byte _0801752C + .4byte _08017544 +_08017450: + mov r0, sp + movs r1, 0 + strb r1, [r0, 0xA] + strb r1, [r0, 0xB] + mov r2, sp + ldrb r1, [r2, 0xC] + movs r3, 0xF + adds r0, r3, 0 + ands r0, r1 + movs r1, 0x20 + orrs r0, r1 + strb r0, [r2, 0xC] + ldrb r1, [r2, 0xD] + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0xD] + ands r0, r3 + movs r1, 0x30 + b _0801756A +_0801747C: + mov r0, sp + movs r1, 0 + strb r1, [r0, 0xA] + strb r1, [r0, 0xB] + mov r2, sp + ldrb r1, [r2, 0xC] + movs r3, 0xF + adds r0, r3, 0 + ands r0, r1 + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2, 0xC] + ldrb r1, [r2, 0xD] + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0xD] + ands r0, r3 + movs r1, 0x50 + b _0801756A +_080174A8: + mov r0, sp + movs r1, 0 + strb r1, [r0, 0xA] + strb r1, [r0, 0xB] + mov r2, sp + ldrb r1, [r2, 0xC] + movs r3, 0xF + adds r0, r3, 0 + ands r0, r1 + movs r1, 0x60 + orrs r0, r1 + strb r0, [r2, 0xC] + ldrb r1, [r2, 0xD] + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0xD] + ands r0, r3 + movs r1, 0x70 + b _0801756A +_080174D4: + mov r0, sp + movs r1, 0 + strb r1, [r0, 0xA] + strb r1, [r0, 0xB] + mov r2, sp + ldrb r1, [r2, 0xC] + movs r3, 0xF + adds r0, r3, 0 + ands r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r2, 0xC] + ldrb r1, [r2, 0xD] + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0xD] + ands r0, r3 + movs r1, 0x30 + b _0801756A +_08017500: + mov r0, sp + movs r1, 0 + strb r1, [r0, 0xA] + strb r1, [r0, 0xB] + mov r2, sp + ldrb r1, [r2, 0xC] + movs r3, 0xF + adds r0, r3, 0 + ands r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r2, 0xC] + ldrb r1, [r2, 0xD] + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2, 0xD] + ands r0, r3 + movs r1, 0x30 + b _0801756A +_0801752C: + mov r0, sp + movs r1, 0 + strb r1, [r0, 0xA] + strb r1, [r0, 0xB] + mov r2, sp + ldrb r1, [r2, 0xC] + movs r4, 0xF + movs r3, 0xF + adds r0, r3, 0 + ands r0, r1 + movs r1, 0x70 + b _0801755A +_08017544: + mov r0, sp + movs r1, 0 + strb r1, [r0, 0xA] + strb r1, [r0, 0xB] + mov r2, sp + ldrb r1, [r2, 0xC] + movs r4, 0xF + movs r3, 0xF + adds r0, r3, 0 + ands r0, r1 + movs r1, 0xE0 +_0801755A: + orrs r0, r1 + strb r0, [r2, 0xC] + mov r1, sp + ldrb r0, [r1, 0xD] + orrs r0, r4 + strb r0, [r1, 0xD] + ands r0, r3 + movs r1, 0x90 +_0801756A: + orrs r0, r1 + strb r0, [r2, 0xD] +_0801756E: + mov r0, sp + movs r1, 0xFF + movs r2, 0 + bl AddTextPrinter + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80173E0 + + thumb_func_start sub_8017580 +sub_8017580: @ 8017580 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0 + beq _080175D8 + ldr r2, =gUnknown_082F045C + mov r8, r2 + movs r5, 0 + mov r9, r5 + movs r6, 0x4 + negs r6, r6 + mov r12, r6 + adds r2, r0, 0 + adds r2, 0x18 + adds r4, r0, 0 + movs r7, 0xFF + mov r10, r7 + adds r3, r1, 0 +_080175AC: + adds r1, r4, 0 + mov r0, r8 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + mov r0, r10 + strh r0, [r2] + ldrb r1, [r2, 0x2] + mov r0, r12 + ands r0, r1 + movs r1, 0x5 + negs r1, r1 + ands r0, r1 + strb r0, [r2, 0x2] + mov r5, r9 + strb r5, [r2, 0x3] + adds r2, 0x20 + adds r4, 0x20 + subs r3, 0x1 + cmp r3, 0 + bne _080175AC +_080175D8: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8017580 + + thumb_func_start sub_80175EC +sub_80175EC: @ 80175EC + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r1, =gUnknown_082F045C + mov r12, r1 + movs r5, 0x2 + negs r5, r5 + mov r8, r5 + adds r2, r0, 0 + adds r2, 0x18 + adds r3, r0, 0 + movs r4, 0x3 +_08017604: + adds r1, r3, 0 + mov r0, r12 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldrb r1, [r2] + mov r0, r8 + ands r0, r1 + strb r0, [r2] + adds r2, 0x1C + adds r3, 0x1C + subs r4, 0x1 + cmp r4, 0 + bge _08017604 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80175EC + + thumb_func_start sub_8017630 +sub_8017630: @ 8017630 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + movs r2, 0 + adds r4, r5, 0x2 + adds r3, r6, 0x2 +_0801763C: + adds r0, r4, r2 + adds r1, r3, r2 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bne _08017664 + adds r2, 0x1 + cmp r2, 0x1 + ble _0801763C + movs r2, 0 + adds r4, r5, 0 + adds r4, 0x10 + adds r3, r6, 0 + adds r3, 0x10 +_08017658: + adds r0, r4, r2 + adds r1, r3, r2 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + beq _08017668 +_08017664: + movs r0, 0x1 + b _08017670 +_08017668: + adds r2, 0x1 + cmp r2, 0x7 + ble _08017658 + movs r0, 0 +_08017670: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8017630 + + thumb_func_start sub_8017678 +sub_8017678: @ 8017678 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + ldrb r3, [r5, 0xA] + movs r0, 0x7F + ldrb r2, [r6, 0xA] + adds r1, r0, 0 + ands r1, r3 + ands r0, r2 + cmp r1, r0 + bne _080176DC + movs r0, 0x80 + adds r1, r0, 0 + ands r1, r3 + ands r0, r2 + cmp r1, r0 + bne _080176DC + movs r2, 0 + adds r4, r5, 0x4 + adds r3, r6, 0x4 +_080176A0: + adds r0, r4, r2 + adds r1, r3, r2 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bne _080176DC + adds r2, 0x1 + cmp r2, 0x3 + ble _080176A0 + ldrh r2, [r5, 0x8] + ldr r0, =0x000003ff + ldrh r3, [r6, 0x8] + adds r1, r0, 0 + ands r1, r2 + ands r0, r3 + cmp r1, r0 + bne _080176DC + ldrb r2, [r5, 0x9] + movs r0, 0xFC + ldrb r3, [r6, 0x9] + adds r1, r0, 0 + ands r1, r2 + ands r0, r3 + cmp r1, r0 + bne _080176DC + movs r0, 0 + b _080176DE + .pool +_080176DC: + movs r0, 0x1 +_080176DE: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8017678 + + thumb_func_start sub_80176E4 +sub_80176E4: @ 80176E4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + movs r7, 0xFF + movs r6, 0 + adds r4, r1, 0 + adds r4, 0x18 + adds r5, r1, 0 +_080176F6: + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0801771E + mov r0, r8 + adds r1, r5, 0 + bl sub_8017630 + lsls r0, 24 + cmp r0, 0 + bne _0801771E + lsls r0, r6, 24 + lsrs r7, r0, 24 + ldrb r0, [r4] + movs r2, 0x2 + negs r2, r2 + adds r1, r2, 0 + ands r0, r1 + strb r0, [r4] +_0801771E: + adds r4, 0x1C + adds r5, 0x1C + adds r6, 0x1 + cmp r6, 0x3 + ble _080176F6 + adds r0, r7, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80176E4 + + thumb_func_start sub_8017734 +sub_8017734: @ 8017734 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r3, r0, 0 + mov r8, r1 + lsls r2, 24 + lsrs r6, r2, 24 + ldrb r1, [r1, 0x18] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080177A8 + movs r5, 0 + cmp r5, r6 + bge _080177A8 + movs r0, 0x4 + negs r0, r0 + mov r9, r0 + movs r1, 0x2 + negs r1, r1 + mov r12, r1 + adds r2, r3, 0 + adds r2, 0x18 + adds r1, r3, 0 +_08017766: + ldrb r0, [r2, 0x2] + movs r3, 0x3 + ands r3, r0 + cmp r3, 0 + bne _0801779E + mov r0, r8 + ldm r0!, {r4,r6,r7} + stm r1!, {r4,r6,r7} + ldm r0!, {r4,r6,r7} + stm r1!, {r4,r6,r7} + strh r3, [r2] + ldrb r1, [r2, 0x2] + mov r0, r9 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x2] + movs r0, 0x40 + strb r0, [r2, 0x3] + mov r0, r8 + ldrb r1, [r0, 0x18] + mov r0, r12 + ands r0, r1 + mov r1, r8 + strb r0, [r1, 0x18] + lsls r0, r5, 24 + lsrs r0, 24 + b _080177AA +_0801779E: + adds r2, 0x20 + adds r1, 0x20 + adds r5, 0x1 + cmp r5, r6 + blt _08017766 +_080177A8: + movs r0, 0xFF +_080177AA: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8017734 + + thumb_func_start sub_80177B8 +sub_80177B8: @ 80177B8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + adds r4, r1, 0 + adds r6, r3, 0 + ldr r3, [sp, 0x2C] + ldr r1, [sp, 0x30] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r4, 24 + lsrs r4, 24 + lsls r2, 24 + lsrs r7, r2, 24 + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + lsls r1, 24 + lsrs r1, 24 + ldr r5, =0x02021fc4 + adds r1, 0x1 + adds r0, r5, 0 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r1, =gUnknown_082ED8C8 + adds r0, r5, 0 + bl AppendString + str r7, [sp] + movs r0, 0 + str r0, [sp, 0x4] + mov r0, r8 + movs r1, 0x1 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_80173E0 + adds r4, 0x12 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r6, 0xA] + lsls r0, 25 + lsrs r2, r0, 25 + ldrb r1, [r6, 0x1A] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + bne _08017884 + movs r0, 0x40 + ands r2, r0 + cmp r2, 0 + bne _08017884 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8018404 + str r7, [sp] + mov r0, r9 + str r0, [sp, 0x4] + mov r0, r8 + movs r1, 0x1 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_80173E0 + ldrb r1, [r6, 0x2] + ldrb r0, [r6, 0x3] + lsls r0, 8 + orrs r1, r0 + add r0, sp, 0x8 + movs r2, 0x2 + movs r3, 0x5 + bl ConvertIntToDecimalString + ldr r1, =gUnknown_082ED8CC + adds r0, r5, 0 + bl CopyString + adds r0, r5, 0 + add r1, sp, 0x8 + bl AppendString + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x88 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + str r7, [sp] + mov r0, r9 + str r0, [sp, 0x4] + mov r0, r8 + movs r1, 0x1 + adds r2, r5, 0 + bl sub_80173E0 +_08017884: + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80177B8 + + thumb_func_start sub_80178A0 +sub_80178A0: @ 80178A0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + adds r5, r3, 0 + ldr r3, [sp, 0x2C] + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r7, r3, 24 + ldrb r1, [r5, 0x1A] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + bne _0801792A + ldr r4, =0x02021fc4 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8018404 + mov r0, r8 + str r0, [sp] + str r7, [sp, 0x4] + mov r0, r9 + movs r1, 0x1 + adds r2, r4, 0 + adds r3, r6, 0 + bl sub_80173E0 + ldrb r1, [r5, 0x2] + ldrb r0, [r5, 0x3] + lsls r0, 8 + orrs r1, r0 + add r0, sp, 0x8 + movs r2, 0x2 + movs r3, 0x5 + bl ConvertIntToDecimalString + ldr r1, =gUnknown_082ED8CC + adds r0, r4, 0 + bl CopyString + adds r0, r4, 0 + add r1, sp, 0x8 + bl AppendString + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x68 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + mov r0, r8 + str r0, [sp] + str r7, [sp, 0x4] + mov r0, r9 + movs r1, 0x1 + adds r2, r4, 0 + bl sub_80173E0 +_0801792A: + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80178A0 + + thumb_func_start sub_8017940 +sub_8017940: @ 8017940 + push {r4,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl GetXYCoordsOneStepInFrontOfPlayer + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x9 + bne _08017978 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0x8 + bne _08017978 + ldr r0, =0x02037590 + ldrb r0, [r0, 0x3] + cmp r0, 0x2 + beq _0801796E + cmp r0, 0 + bne _08017978 +_0801796E: + movs r0, 0x1 + b _0801797A + .pool +_08017978: + movs r0, 0 +_0801797A: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8017940 + + thumb_func_start sub_8017984 +sub_8017984: @ 8017984 + push {lr} + cmp r0, 0x4 + beq _0801799C + cmp r0, 0x4 + ble _080179A4 + cmp r0, 0x5 + beq _08017998 + cmp r0, 0x8 + beq _080179A0 + b _080179A4 +_08017998: + movs r0, 0x1 + b _080179A6 +_0801799C: + movs r0, 0x2 + b _080179A6 +_080179A0: + movs r0, 0x3 + b _080179A6 +_080179A4: + movs r0, 0 +_080179A6: + pop {r1} + bx r1 + thumb_func_end sub_8017984 + + thumb_func_start sub_80179AC +sub_80179AC: @ 80179AC + push {r4,lr} + sub sp, 0x20 + adds r4, r0, 0 + mov r0, sp + adds r1, r4, 0 + bl sub_8018404 + adds r4, 0x2 + adds r0, r4, 0 + bl sub_8015658 + lsls r0, 16 + lsrs r0, 16 + mov r1, sp + bl sub_800E540 + add sp, 0x20 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80179AC + + thumb_func_start sub_80179D4 +sub_80179D4: @ 80179D4 + push {r4-r6,lr} + adds r6, r3, 0 + lsls r1, 24 + lsrs r4, r1, 24 + lsls r2, 24 + lsrs r2, 19 + adds r5, r0, r2 + ldrb r1, [r5, 0xA] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08017A4C + cmp r4, 0 + bne _08017A4C + ldr r4, =0x02021cc4 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8018404 + adds r0, r5, 0x2 + bl sub_8015658 + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl sub_800E540 + adds r2, r0, 0 + ldrb r1, [r5, 0xA] + movs r0, 0x7F + ands r0, r1 + cmp r0, 0x45 + bne _08017A38 + ldr r0, =0x02021fc4 + ldr r3, =gUnknown_082EE6B8 + lsls r1, r6, 2 + lsls r2, 3 + adds r1, r2 + adds r1, r3 + ldr r1, [r1] + bl ExpandStringRefs + movs r0, 0x2 + b _08017B2A + .pool +_08017A38: + ldr r0, =gUnknown_082EE17C + lsls r1, r2, 2 + adds r1, r0 + ldr r0, [r1] + bl sub_8017020 + movs r0, 0x1 + b _08017B2A + .pool +_08017A4C: + ldr r0, =0x02021cc4 + adds r1, r5, 0 + bl sub_8018404 + cmp r4, 0 + beq _08017A62 + adds r0, r5, r4 + ldrb r0, [r0, 0x3] + lsrs r6, r0, 3 + movs r0, 0x1 + ands r6, r0 +_08017A62: + ldrb r0, [r5, 0xA] + lsls r0, 25 + lsrs r0, 25 + movs r1, 0x3F + ands r1, r0 + cmp r1, 0x4 + beq _08017AB0 + cmp r1, 0x4 + bgt _08017A80 + cmp r1, 0x1 + beq _08017A8A + b _08017B20 + .pool +_08017A80: + cmp r1, 0x5 + beq _08017AD0 + cmp r1, 0x8 + beq _08017AF4 + b _08017B20 +_08017A8A: + ldr r5, =0x02021fc4 + ldr r4, =gUnknown_082EEEAC + bl GenerateRandomNumber + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + lsrs r1, 14 + lsls r0, r6, 4 + adds r1, r0 + adds r1, r4 + ldr r1, [r1] + b _08017B0E + .pool +_08017AB0: + ldr r5, =0x02021fc4 + ldr r4, =gUnknown_082EF1CC + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + lsls r0, 2 + lsls r1, r6, 4 + b _08017B08 + .pool +_08017AD0: + ldr r5, =0x02021fc4 + ldr r4, =gUnknown_082EF010 + bl GenerateRandomNumber + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + lsrs r1, 14 + lsls r0, r6, 4 + adds r1, r0 + adds r1, r4 + ldr r1, [r1] + b _08017B0E + .pool +_08017AF4: + ldr r5, =0x02021fc4 + ldr r4, =gUnknown_082EF100 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + lsls r0, 2 + lsls r1, r6, 3 +_08017B08: + adds r0, r1 + adds r0, r4 + ldr r1, [r0] +_08017B0E: + adds r0, r5, 0 + bl ExpandStringRefs + b _08017B28 + .pool +_08017B20: + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_082EE6C8 + bl ExpandStringRefs +_08017B28: + movs r0, 0 +_08017B2A: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80179D4 + + thumb_func_start nullsub_14 +nullsub_14: @ 8017B38 + bx lr + thumb_func_end nullsub_14 + + thumb_func_start sub_8017B3C +sub_8017B3C: @ 8017B3C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + ldr r4, [sp, 0x28] + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r4, 24 + lsrs r4, 24 + ldrh r0, [r2, 0x8] + lsls r0, 22 + lsrs r0, 22 + mov r8, r0 + ldrb r0, [r2, 0x9] + lsrs r7, r0, 2 + ldrb r0, [r2, 0xB] + lsrs r0, 1 + mov r9, r0 + str r5, [sp] + str r4, [sp, 0x4] + adds r0, r6, 0 + movs r1, 0x1 + adds r2, r3, 0 + movs r3, 0x8 + bl sub_80173E0 + movs r0, 0xCE + lsls r0, 1 + cmp r8, r0 + bne _08017B94 + ldr r2, =gUnknown_082EF7D0 + str r5, [sp] + str r4, [sp, 0x4] + adds r0, r6, 0 + movs r1, 0x1 + movs r3, 0x44 + bl sub_80173E0 + b _08017BD4 + .pool +_08017B94: + adds r1, r7, 0x1 + adds r0, r6, 0 + movs r2, 0x44 + adds r3, r5, 0 + bl blit_move_info_icon + movs r0, 0xB + mov r2, r8 + muls r2, r0 + ldr r0, =gSpeciesNames + adds r2, r0 + str r5, [sp] + str r4, [sp, 0x4] + adds r0, r6, 0 + movs r1, 0x1 + movs r3, 0x76 + bl sub_80173E0 + add r0, sp, 0x8 + mov r1, r9 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + str r5, [sp] + str r4, [sp, 0x4] + adds r0, r6, 0 + movs r1, 0x1 + add r2, sp, 0x8 + movs r3, 0xC6 + bl sub_80173E0 +_08017BD4: + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8017B3C + + thumb_func_start sub_8017BE8 +sub_8017BE8: @ 8017BE8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r2, 24 + lsrs r7, r2, 24 + ldr r0, =0x02022c30 + ldr r0, [r0] + mov r8, r0 + movs r0, 0x3 + negs r0, r0 + cmp r4, r0 + bne _08017C6C + ldr r0, =gUnknown_082F03A4 + ldrb r0, [r0, 0x14] + lsls r0, 28 + lsrs r0, 28 + cmp r7, r0 + bne _08017C6C + bl sub_800F7DC + adds r2, r0, 0 + ldrh r1, [r2, 0x8] + ldr r0, =0x000003ff + ands r0, r1 + cmp r0, 0 + beq _08017CA0 + ldr r0, =0x03005d90 + ldr r3, [r0] + movs r0, 0x5 + str r0, [sp] + mov r0, r9 + adds r1, r7, 0 + bl sub_8017B3C + b _08017CA0 + .pool +_08017C4C: + mov r0, r12 + adds r1, r0, r4 + add r0, sp, 0x4 + bl sub_8018404 + mov r0, r8 + ldr r2, [r0] + adds r2, r4 + movs r0, 0x6 + str r0, [sp] + mov r0, r9 + adds r1, r7, 0 + add r3, sp, 0x4 + bl sub_8017B3C + b _08017CA0 +_08017C6C: + movs r5, 0 + movs r1, 0 + mov r2, r8 + ldr r2, [r2] + mov r12, r2 + adds r2, 0x8 + movs r3, 0 + adds r6, r4, 0x1 +_08017C7C: + ldrb r0, [r2, 0x12] + lsls r0, 30 + lsrs r0, 30 + adds r4, r3, 0 + cmp r0, 0x1 + bne _08017C92 + ldrh r0, [r2] + lsls r0, 22 + cmp r0, 0 + beq _08017C92 + adds r5, 0x1 +_08017C92: + cmp r5, r6 + beq _08017C4C + adds r2, 0x20 + adds r3, 0x20 + adds r1, 0x1 + cmp r1, 0x7 + ble _08017C7C +_08017CA0: + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8017BE8 + + thumb_func_start sub_8017CB0 +sub_8017CB0: @ 8017CB0 + push {r4-r7,lr} + movs r4, 0 + movs r3, 0 + movs r7, 0x3 + ldr r6, =0x000003ff + adds r2, r0, 0 + adds r2, 0x8 + adds r5, r1, 0x1 +_08017CC0: + ldrb r1, [r2, 0x12] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0x1 + bne _08017CD6 + ldrh r1, [r2] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _08017CD6 + adds r4, 0x1 +_08017CD6: + cmp r4, r5 + bne _08017CE4 + adds r0, r3, 0 + b _08017CF0 + .pool +_08017CE4: + adds r2, 0x20 + adds r3, 0x1 + cmp r3, 0x7 + ble _08017CC0 + movs r0, 0x1 + negs r0, r0 +_08017CF0: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8017CB0 + + thumb_func_start sub_8017CF8 +sub_8017CF8: @ 8017CF8 + lsls r0, 5 + adds r0, r1 + ldrb r0, [r0, 0xB] + lsls r0, 31 + lsrs r0, 31 + bx lr + thumb_func_end sub_8017CF8 + + thumb_func_start sub_8017D04 +sub_8017D04: @ 8017D04 + push {r4-r6,lr} + adds r5, r0, 0 + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + bne _08017D44 + movs r4, 0 + b _08017D2E +_08017D14: + movs r0, 0x64 + muls r0, r4 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x41 + bl pokemon_getattr + adds r1, r0, 0 + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + beq _08017D74 + adds r4, 0x1 +_08017D2E: + ldr r0, =0x020244e9 + ldrb r0, [r0] + cmp r4, r0 + blt _08017D14 + movs r0, 0x2 + b _08017D90 + .pool +_08017D44: + movs r4, 0 + ldr r0, =0x020244e9 + ldrb r0, [r0] + cmp r4, r0 + bge _08017D8E + ldr r6, =gBaseStats +_08017D50: + movs r0, 0x64 + muls r0, r4 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x41 + bl pokemon_getattr + adds r1, r0, 0 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r1, r0, r6 + ldrb r0, [r1, 0x6] + cmp r0, r5 + beq _08017D74 + ldrb r0, [r1, 0x7] + cmp r0, r5 + bne _08017D84 +_08017D74: + movs r0, 0 + b _08017D90 + .pool +_08017D84: + adds r4, 0x1 + ldr r0, =0x020244e9 + ldrb r0, [r0] + cmp r4, r0 + blt _08017D50 +_08017D8E: + movs r0, 0x1 +_08017D90: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8017D04 + + thumb_func_start sub_8017D9C +sub_8017D9C: @ 8017D9C + push {lr} + adds r3, r0, 0 + cmp r1, 0x44 + beq _08017DD8 + cmp r1, 0x44 + bgt _08017DAE + cmp r1, 0x41 + beq _08017DB8 + b _08017DF6 +_08017DAE: + cmp r1, 0x45 + beq _08017DC8 + cmp r1, 0x48 + beq _08017DE8 + b _08017DF6 +_08017DB8: + ldr r0, =gUnknown_082EEA68 + lsls r1, r2, 2 + adds r1, r0 + ldr r1, [r1] + b _08017DDA + .pool +_08017DC8: + ldr r0, =gUnknown_082EED3C + lsls r1, r2, 2 + adds r1, r0 + ldr r1, [r1] + b _08017DDA + .pool +_08017DD8: + ldr r1, =gUnknown_082EF7B0 +_08017DDA: + adds r0, r3, 0 + bl ExpandStringRefs + b _08017DF6 + .pool +_08017DE8: + ldr r0, =gUnknown_082EEB08 + lsls r1, r2, 2 + adds r1, r0 + ldr r1, [r1] + adds r0, r3, 0 + bl ExpandStringRefs +_08017DF6: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8017D9C + + thumb_func_start sub_8017E00 +sub_8017E00: @ 8017E00 + push {r4-r6,lr} + adds r5, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + adds r6, r4, 0 + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, =0x020229e8 + movs r0, 0x1 + adds r1, r3, 0 + eors r1, r0 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x13] + cmp r4, 0x44 + beq _08017E54 + cmp r4, 0x44 + bgt _08017E38 + cmp r4, 0x41 + beq _08017E3E + b _08017E94 + .pool +_08017E38: + cmp r6, 0x45 + beq _08017E78 + b _08017E94 +_08017E3E: + ldr r2, =gUnknown_082EE984 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 3 + adds r1, r0 + b _08017E66 + .pool +_08017E54: + ldr r2, =gUnknown_082EE984 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 3 + adds r1, r0 + adds r2, 0x8 +_08017E66: + adds r1, r2 + ldr r1, [r1] + adds r0, r5, 0 + bl CopyString + b _08017E94 + .pool +_08017E78: + ldr r2, =gUnknown_082EE984 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 3 + adds r1, r0 + adds r2, 0x4 + adds r1, r2 + ldr r1, [r1] + adds r0, r5, 0 + bl CopyString +_08017E94: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8017E00 + + thumb_func_start sub_8017EA0 +sub_8017EA0: @ 8017EA0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + adds r5, r2, 0 + adds r6, r3, 0 + movs r2, 0 + mov r8, r2 + ldrh r0, [r5] + subs r0, 0x40 + cmp r0, 0x8 + bls _08017EBA + b _08017FC6 +_08017EBA: + lsls r0, 2 + ldr r1, =_08017EC8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08017EC8: + .4byte _08017FBC + .4byte _08017EEC + .4byte _08017FC6 + .4byte _08017FC6 + .4byte _08017EFC + .4byte _08017EF4 + .4byte _08017FC6 + .4byte _08017FC6 + .4byte _08017FAC +_08017EEC: + ldr r1, =gUnknown_082EE3DC + b _08017FAE + .pool +_08017EF4: + ldr r1, =gUnknown_082EE430 + b _08017FAE + .pool +_08017EFC: + adds r0, r6, 0 + adds r0, 0x58 + ldr r4, =0x02022c40 + ldrh r1, [r4, 0xC] + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + adds r0, r6, 0 + adds r0, 0x68 + ldrh r2, [r4, 0xA] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + movs r4, 0 + b _08017F2E + .pool +_08017F2C: + adds r4, 0x1 +_08017F2E: + cmp r4, 0x3 + bgt _08017F64 + ldr r0, =0x03007890 + ldr r0, [r0] + lsls r1, r4, 5 + adds r0, r1 + ldrh r0, [r0, 0x18] + cmp r0, 0x2 + bne _08017F2C + ldrh r1, [r5, 0x4] + adds r0, r6, 0 + adds r0, 0x78 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldrh r1, [r5, 0x2] + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r6, 0 + adds r0, 0x88 + bl CopyString + ldrh r5, [r5, 0x2] + mov r8, r5 +_08017F64: + movs r0, 0xCE + lsls r0, 1 + cmp r8, r0 + bne _08017F84 + ldr r1, =gUnknown_082EE4F0 + adds r0, r7, 0 + bl CopyString + b _08017FB4 + .pool +_08017F84: + movs r4, 0 + adds r5, r6, 0 + adds r5, 0x58 +_08017F8A: + lsls r0, r4, 24 + lsrs r0, 24 + adds r1, r5, 0 + bl sub_81AFC0C + adds r5, 0x10 + adds r4, 0x1 + cmp r4, 0x3 + ble _08017F8A + ldr r1, =gUnknown_082EE47C + adds r0, r7, 0 + bl sub_81AFC28 + b _08017FB4 + .pool +_08017FAC: + ldr r1, =gUnknown_082EE380 +_08017FAE: + adds r0, r7, 0 + bl ExpandStringRefs +_08017FB4: + movs r2, 0x1 + b _08017FC6 + .pool +_08017FBC: + ldr r1, =gUnknown_082EE544 + adds r0, r7, 0 + bl ExpandStringRefs + movs r2, 0x2 +_08017FC6: + adds r0, r2, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8017EA0 + + thumb_func_start sub_8017FD8 +sub_8017FD8: @ 8017FD8 + push {lr} + adds r2, r0, 0 + ldr r0, =0x03003090 + ldrh r1, [r0, 0x2] + cmp r1, 0 + beq _08017FFC + cmp r1, 0x51 + beq _08017FEC + cmp r1, 0x52 + bne _08017FFC +_08017FEC: + adds r0, r2, 0 + adds r0, 0x98 + strh r1, [r0] + movs r0, 0x1 + b _08017FFE + .pool +_08017FFC: + movs r0, 0 +_08017FFE: + pop {r1} + bx r1 + thumb_func_end sub_8017FD8 + + thumb_func_start InUnionRoom +InUnionRoom: @ 8018004 + push {lr} + movs r2, 0 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r1, [r0, 0x4] + ldr r0, =0x00003c19 + cmp r1, r0 + bne _08018016 + movs r2, 0x1 +_08018016: + adds r0, r2, 0 + pop {r1} + bx r1 + .pool + thumb_func_end InUnionRoom + + thumb_func_start sub_8018024 +sub_8018024: @ 8018024 + push {r4-r6,lr} + movs r6, 0 + movs r5, 0 + ldr r0, =0x020244e9 + ldrb r0, [r0] + cmp r6, r0 + bge _08018064 +_08018032: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + cmp r0, 0x1E + bhi _0801805A + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _0801805A + adds r6, 0x1 +_0801805A: + adds r5, 0x1 + ldr r0, =0x020244e9 + ldrb r0, [r0] + cmp r5, r0 + blt _08018032 +_08018064: + cmp r6, 0x1 + bgt _08018074 + movs r0, 0 + b _08018076 + .pool +_08018074: + movs r0, 0x1 +_08018076: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8018024 + + thumb_func_start sub_801807C +sub_801807C: @ 801807C + movs r1, 0 + strh r1, [r0] + strh r1, [r0, 0x2] + str r1, [r0, 0x4] + strh r1, [r0, 0xA] + strh r1, [r0, 0xC] + strh r1, [r0, 0xE] + strh r1, [r0, 0x10] + str r1, [r0, 0x14] + bx lr + thumb_func_end sub_801807C + + thumb_func_start sub_8018090 +sub_8018090: @ 8018090 + push {lr} + ldr r0, =0x02022c40 + bl sub_801807C + pop {r0} + bx r0 + .pool + thumb_func_end sub_8018090 + + thumb_func_start sub_80180A0 +sub_80180A0: @ 80180A0 + push {r4,r5,lr} + adds r5, r1, 0 + movs r1, 0x64 + adds r4, r0, 0 + muls r4, r1 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + strh r0, [r5, 0xA] + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + strh r0, [r5, 0xC] + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + str r0, [r5, 0x4] + ldrh r1, [r5, 0xA] + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + beq _080180E0 + movs r0, 0 + b _080180E2 + .pool +_080180E0: + movs r0, 0x1 +_080180E2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80180A0 + + thumb_func_start sub_80180E8 +sub_80180E8: @ 80180E8 + push {r4,r5,lr} + adds r5, r1, 0 + movs r1, 0x64 + adds r4, r0, 0 + muls r4, r1 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + strh r0, [r5, 0xE] + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + strh r0, [r5, 0x10] + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + str r0, [r5, 0x14] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80180E8 + + thumb_func_start sub_8018120 +sub_8018120: @ 8018120 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r1, 24 + movs r2, 0 + mov r8, r2 + cmp r1, 0 + bne _0801813E + ldrh r7, [r0, 0xA] + ldr r6, [r0, 0x4] + b _08018142 +_08018136: + lsls r0, r5, 16 + lsrs r0, 16 + mov r8, r0 + b _08018176 +_0801813E: + ldrh r7, [r0, 0xE] + ldr r6, [r0, 0x14] +_08018142: + movs r5, 0 + b _0801816E +_08018146: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + cmp r0, r6 + bne _0801816C + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + cmp r0, r7 + beq _08018136 +_0801816C: + adds r5, 0x1 +_0801816E: + ldr r0, =0x020244e9 + ldrb r0, [r0] + cmp r5, r0 + blt _08018146 +_08018176: + mov r0, r8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8018120 + + thumb_func_start sub_801818C +sub_801818C: @ 801818C + push {r4,lr} + adds r4, r0, 0 + bl sub_80173B0 + bl script_env_2_disable + bl sub_8098524 + ldr r1, =0x02022c2c + movs r0, 0 + strb r0, [r1] + cmp r4, 0 + beq _080181BC + ldr r2, =0x02022c40 + ldrh r0, [r2, 0x2] + ldrh r1, [r2, 0xA] + ldrh r2, [r2, 0xC] + bl sub_8010FCC + movs r0, 0x40 + movs r1, 0 + movs r2, 0 + bl sub_8011090 +_080181BC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801818C + + thumb_func_start sub_80181CC +sub_80181CC: @ 80181CC + push {lr} + bl script_env_2_enable + bl sub_80983E8 + pop {r0} + bx r0 + thumb_func_end sub_80181CC + + thumb_func_start sub_80181DC +sub_80181DC: @ 80181DC + push {r4,lr} + movs r3, 0x80 + movs r2, 0 + ldr r4, [r0, 0xC] +_080181E4: + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r1, r4, r0 + ldrb r0, [r1, 0x18] + lsls r0, 31 + cmp r0, 0 + beq _0801820C + ldrb r0, [r1, 0xB] + lsls r0, 31 + lsrs r0, 31 + lsls r0, 3 + orrs r3, r0 + ldrb r1, [r1, 0x2] + movs r0, 0x7 + ands r0, r1 + orrs r3, r0 + lsls r0, r3, 24 + lsrs r3, r0, 24 + b _08018216 +_0801820C: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _080181E4 +_08018216: + adds r0, r3, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80181DC + + thumb_func_start sub_8018220 +sub_8018220: @ 8018220 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r9, r1 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp] + bl link_get_multiplayer_id + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r1, r0 + ldr r0, =0x02039b58 + adds r1, r0 + mov r8, r1 + bl sub_81AFBF0 + mov r6, r9 + adds r6, 0xC0 + bl sub_8068BB0 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xD + muls r1, r0 + ldr r0, =gTrainerClassNames + adds r1, r0 + adds r0, r6, 0 + bl CopyString + movs r0, 0 + adds r1, r6, 0 + bl sub_81AFC0C + mov r1, r8 + adds r1, 0x30 + movs r0, 0x1 + bl sub_81AFC0C + movs r4, 0xBA + lsls r4, 1 + add r4, r9 + ldr r1, =gUnknown_082EFF50 + mov r2, r8 + ldrb r0, [r2, 0x1] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r4, 0 + bl CopyString + movs r0, 0x2 + adds r1, r4, 0 + bl sub_81AFC0C + mov r5, r9 + adds r5, 0xDE + mov r0, r8 + ldrh r1, [r0, 0xC] + adds r0, r5, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + movs r0, 0x3 + adds r1, r5, 0 + bl sub_81AFC0C + movs r2, 0xED + add r2, r9 + mov r10, r2 + mov r0, r8 + ldrh r1, [r0, 0x10] + mov r0, r10 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + mov r4, r9 + adds r4, 0xFC + mov r2, r8 + ldrh r1, [r2, 0x12] + adds r0, r4, 0 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalString + movs r0, 0x4 + mov r1, r10 + bl sub_81AFC0C + movs r0, 0x5 + adds r1, r4, 0 + bl sub_81AFC0C + movs r4, 0xD2 + lsls r4, 1 + add r4, r9 + ldr r1, =gUnknown_082EFF64 + adds r0, r4, 0 + bl sub_81AFC28 + ldr r0, =0x02021fc4 + adds r1, r4, 0 + bl CopyString + mov r0, r8 + ldrh r1, [r0, 0x14] + ldr r4, =0x0000270f + cmp r1, r4 + ble _0801830C + adds r1, r4, 0 +_0801830C: + adds r0, r6, 0 + movs r2, 0 + movs r3, 0x4 + bl ConvertIntToDecimalString + movs r0, 0 + adds r1, r6, 0 + bl sub_81AFC0C + mov r2, r8 + ldrh r1, [r2, 0x16] + cmp r1, r4 + ble _08018328 + adds r1, r4, 0 +_08018328: + mov r4, r9 + adds r4, 0xCF + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x4 + bl ConvertIntToDecimalString + movs r0, 0x2 + adds r1, r4, 0 + bl sub_81AFC0C + mov r0, r8 + ldrh r1, [r0, 0x20] + adds r0, r5, 0 + movs r2, 0 + movs r3, 0x5 + bl ConvertIntToDecimalString + movs r0, 0x3 + adds r1, r5, 0 + bl sub_81AFC0C + movs r7, 0 + movs r6, 0x80 + lsls r6, 19 + mov r5, r8 + adds r5, 0x28 + mov r4, r10 +_08018360: + ldrh r1, [r5] + adds r0, r4, 0 + bl CopyEasyChatWord + lsrs r0, r6, 24 + adds r1, r4, 0 + bl sub_81AFC0C + movs r2, 0x80 + lsls r2, 17 + adds r6, r2 + adds r5, 0x2 + adds r4, 0xF + adds r7, 0x1 + cmp r7, 0x3 + ble _08018360 + movs r4, 0xD2 + lsls r4, 1 + add r4, r9 + ldr r1, =gUnknown_082EFFA4 + adds r0, r4, 0 + bl sub_81AFC28 + ldr r5, =0x02021fc4 + adds r0, r5, 0 + adds r1, r4, 0 + bl AppendString + ldr r0, [sp] + cmp r0, 0x1 + bne _080183D0 + ldr r1, =gUnknown_082F0020 + adds r0, r4, 0 + bl sub_81AFC28 + adds r0, r5, 0 + adds r1, r4, 0 + bl AppendString + b _080183F0 + .pool +_080183D0: + ldr r2, [sp] + cmp r2, 0 + bne _080183F0 + ldr r0, =gUnknown_082F0018 + mov r2, r8 + ldrb r1, [r2] + lsls r1, 2 + adds r1, r0 + ldr r1, [r1] + adds r0, r4, 0 + bl sub_81AFC28 + adds r0, r5, 0 + adds r1, r4, 0 + bl AppendString +_080183F0: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8018220 + + thumb_func_start sub_8018404 +sub_8018404: @ 8018404 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r1, 0x10 + bl CopyString_Limit7 + ldrb r1, [r4] + lsls r1, 28 + lsrs r1, 28 + adds r0, r5, 0 + bl StopMusicWhileStringIsPrinted + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8018404 + + thumb_func_start sub_8018424 +sub_8018424: @ 8018424 + push {lr} + bl ProcessObjectCopyRequests + bl LoadOamFromSprites + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_8018424 + + thumb_func_start sub_8018438 +sub_8018438: @ 8018438 + push {lr} + bl RunActiveTasks + bl RunTextPrinters + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + pop {r0} + bx r0 + thumb_func_end sub_8018438 + + thumb_func_start sub_8018450 +sub_8018450: @ 8018450 + push {r4-r7,lr} + sub sp, 0xC + adds r7, r0, 0 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r6, r0, r1 + ldrb r0, [r6] + cmp r0, 0x1 + bne _08018466 + b _08018574 +_08018466: + cmp r0, 0x1 + bgt _08018474 + cmp r0, 0 + beq _08018482 + b _08018644 + .pool +_08018474: + cmp r0, 0x2 + bne _0801847A + b _080185F8 +_0801847A: + cmp r0, 0x3 + bne _08018480 + b _08018618 +_08018480: + b _08018644 +_08018482: + movs r0, 0 + bl SetVBlankCallback + bl sub_80A1A74 + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + bl clear_tasks + bl remove_some_task + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_082F0598 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r4, 0x80 + lsls r4, 4 + adds r0, r4, 0 + bl Alloc + adds r1, r0, 0 + movs r0, 0x3 + bl SetBgTilemapBuffer + adds r0, r4, 0 + bl Alloc + adds r1, r0, 0 + movs r0, 0x2 + bl SetBgTilemapBuffer + adds r0, r4, 0 + bl Alloc + adds r1, r0, 0 + movs r0, 0x1 + bl SetBgTilemapBuffer + adds r0, r4, 0 + bl Alloc + adds r1, r0, 0 + movs r0, 0 + bl SetBgTilemapBuffer + movs r0, 0x3 + bl bgid_upload_textbox_1 + ldr r0, =gUnknown_082F05A8 + bl InitWindows + bl DeactivateAllTextPrinters + movs r1, 0xC0 + lsls r1, 7 + movs r0, 0 + bl ClearGpuRegBits + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + b _08018610 + .pool +_08018574: + ldr r0, =gUnknown_082F0548 + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0x2 + bl stdpal_get + movs r1, 0xD0 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0xC0 + bl sub_81978B0 + movs r0, 0 + movs r1, 0xA + movs r2, 0xE0 + bl sub_809882C + movs r0, 0 + movs r1, 0x1 + movs r2, 0xF0 + bl box_border_load_tiles_and_pal + movs r4, 0x20 + str r4, [sp] + str r4, [sp, 0x4] + movs r5, 0x11 + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect + movs r0, 0x3 + bl sub_8018798 + lsls r0, r7, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_80186EC + b _08018610 + .pool +_080185F8: + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0 + bl CopyBgTilemapBufferToVram +_08018610: + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] + b _08018644 +_08018618: + movs r0, 0 + bl ShowBg + movs r0, 0x3 + bl ShowBg + ldr r0, =0x0000021d + bl song_play_for_text + ldr r0, =sub_8018424 + bl SetVBlankCallback + movs r0, 0xC5 + bl EnableInterrupts + movs r0, 0x1 + b _08018646 + .pool +_08018644: + movs r0, 0 +_08018646: + add sp, 0xC + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8018450 + + thumb_func_start c2_mystery_gift +c2_mystery_gift: @ 8018650 + push {lr} + movs r0, 0 + bl sub_8018450 + cmp r0, 0 + beq _0801866C + ldr r0, =sub_8018438 + bl SetMainCallback2 + ldr r1, =0x02022c60 + movs r0, 0 + strb r0, [r1] + bl task_add_00_mystery_gift +_0801866C: + bl RunActiveTasks + pop {r0} + bx r0 + .pool + thumb_func_end c2_mystery_gift + + thumb_func_start sub_801867C +sub_801867C: @ 801867C + push {lr} + movs r0, 0x1 + bl sub_8018450 + cmp r0, 0 + beq _08018698 + ldr r0, =sub_8018438 + bl SetMainCallback2 + ldr r1, =0x02022c60 + movs r0, 0x1 + strb r0, [r1] + bl sub_81D5014 +_08018698: + pop {r0} + bx r0 + .pool + thumb_func_end sub_801867C + + thumb_func_start sub_80186A4 +sub_80186A4: @ 80186A4 + push {lr} + ldr r1, =0x02022c60 + movs r0, 0 + strb r0, [r1] + bl FreeAllWindowBuffers + movs r0, 0 + bl GetBgTilemapBuffer + bl Free + movs r0, 0x1 + bl GetBgTilemapBuffer + bl Free + movs r0, 0x2 + bl GetBgTilemapBuffer + bl Free + movs r0, 0x3 + bl GetBgTilemapBuffer + bl Free + ldr r0, =c2_title_screen_1 + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80186A4 + + thumb_func_start sub_80186EC +sub_80186EC: @ 80186EC + push {r4-r7,lr} + sub sp, 0x14 + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + movs r1, 0 + bl FillWindowPixelBuffer + cmp r4, 0 + bne _0801871C + ldr r0, =gUnknown_085EF654 + ldr r7, =gUnknown_085EF678 + cmp r5, 0 + bne _08018720 + ldr r7, =gUnknown_085EF664 + b _08018720 + .pool +_0801871C: + ldr r0, =gUnknown_085EDFBF + ldr r7, =gUnknown_085EDFC9 +_08018720: + movs r4, 0 + str r4, [sp] + str r4, [sp, 0x4] + ldr r6, =gUnknown_082F0720 + str r6, [sp, 0x8] + movs r5, 0x1 + negs r5, r5 + str r5, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0 + movs r1, 0x1 + movs r2, 0x4 + movs r3, 0x1 + bl AddTextPrinterParametrized2 + movs r0, 0 + adds r1, r7, 0 + movs r2, 0xDE + bl GetStringRightAlignXOffset + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + str r4, [sp] + str r4, [sp, 0x4] + str r6, [sp, 0x8] + str r5, [sp, 0xC] + str r7, [sp, 0x10] + movs r0, 0 + movs r1, 0 + movs r3, 0x1 + bl AddTextPrinterParametrized2 + movs r0, 0 + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0 + bl PutWindowTilemap + add sp, 0x14 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80186EC + + thumb_func_start sub_8018784 +sub_8018784: @ 8018784 + push {lr} + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + movs r2, 0xF + bl sub_8098858 + pop {r0} + bx r0 + thumb_func_end sub_8018784 + + thumb_func_start sub_8018798 +sub_8018798: @ 8018798 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + adds r4, r0, 0 + movs r0, 0 + mov r9, r0 + lsls r4, 24 + lsrs r0, r4, 24 + movs r1, 0x20 + str r1, [sp] + movs r1, 0x2 + str r1, [sp, 0x4] + movs r1, 0x11 + str r1, [sp, 0x8] + movs r1, 0x3 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect + mov r8, r4 + movs r4, 0x1 +_080187C8: + movs r7, 0 + mov r0, r9 + adds r0, 0x2 + movs r1, 0x1 + add r1, r9 + mov r10, r1 + lsls r5, r0, 24 + movs r6, 0 +_080187D8: + mov r1, r9 + ands r1, r4 + adds r0, r7, 0 + ands r0, r4 + cmp r1, r0 + beq _080187FC + lsrs r2, r6, 24 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + mov r1, r8 + lsrs r0, r1, 24 + movs r1, 0x1 + lsrs r3, r5, 24 + bl FillBgTilemapBufferRect + b _08018812 +_080187FC: + lsrs r2, r6, 24 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + mov r1, r8 + lsrs r0, r1, 24 + movs r1, 0x2 + lsrs r3, r5, 24 + bl FillBgTilemapBufferRect +_08018812: + movs r0, 0x80 + lsls r0, 17 + adds r6, r0 + adds r7, 0x1 + cmp r7, 0x1F + ble _080187D8 + mov r9, r10 + mov r1, r9 + cmp r1, 0x11 + ble _080187C8 + 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_8018798 + + thumb_func_start sub_8018838 +sub_8018838: @ 8018838 + push {lr} + sub sp, 0xC + cmp r0, 0 + beq _08018846 + cmp r0, 0x1 + beq _0801885E + b _08018876 +_08018846: + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect + b _08018876 +_0801885E: + movs r0, 0x20 + str r0, [sp] + movs r0, 0x1E + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x2 + bl FillBgTilemapBufferRect +_08018876: + movs r0, 0 + bl CopyBgTilemapBufferToVram + add sp, 0xC + pop {r0} + bx r0 + thumb_func_end sub_8018838 + + thumb_func_start sub_8018884 +sub_8018884: @ 8018884 + push {r4,lr} + sub sp, 0x14 + adds r1, r0, 0 + ldr r4, =0x02021fc4 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0x1 + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r1, 0 + str r1, [sp] + str r1, [sp, 0x4] + ldr r0, =gUnknown_082F0728 + str r0, [sp, 0x8] + str r1, [sp, 0xC] + str r4, [sp, 0x10] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x1 + bl AddTextPrinterParametrized2 + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0xF + bl sub_8098858 + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0x1 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0x14 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8018884 + + thumb_func_start sub_80188DC +sub_80188DC: @ 80188DC + push {lr} + movs r0, 0x1 + bl rbox_fill_rectangle + movs r0, 0x1 + bl ClearWindowTilemap + movs r0, 0x1 + movs r1, 0x1 + bl CopyWindowToVram + pop {r0} + bx r0 + thumb_func_end sub_80188DC + + thumb_func_start mevent_0814257C +mevent_0814257C: @ 80188F8 + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + adds r0, r1, 0 + ldrb r2, [r4] + cmp r2, 0x1 + beq _08018920 + cmp r2, 0x1 + bgt _08018910 + cmp r2, 0 + beq _0801891A + b _08018980 +_08018910: + cmp r2, 0x2 + beq _08018954 + cmp r2, 0xFF + beq _0801897C + b _08018980 +_0801891A: + bl sub_8018884 + b _08018944 +_08018920: + movs r0, 0 + str r0, [sp] + ldr r0, =0x02022c58 + str r0, [sp, 0x4] + adds r0, 0x1 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0xD0 + movs r2, 0x14 + movs r3, 0x1 + bl DrawDownArrow + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _08018980 +_08018944: + ldrb r0, [r4] + adds r0, 0x1 + b _0801897E + .pool +_08018954: + movs r0, 0x1 + str r0, [sp] + ldr r0, =0x02022c58 + str r0, [sp, 0x4] + adds r0, 0x1 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0xD0 + movs r2, 0x14 + movs r3, 0x1 + bl DrawDownArrow + movs r0, 0 + strb r0, [r4] + bl sub_80188DC + movs r0, 0x1 + b _08018982 + .pool +_0801897C: + movs r0, 0x2 +_0801897E: + strb r0, [r4] +_08018980: + movs r0, 0 +_08018982: + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + thumb_func_end mevent_0814257C + + thumb_func_start sub_801898C +sub_801898C: @ 801898C + push {lr} + sub sp, 0xC + movs r0, 0 + str r0, [sp] + ldr r0, =0x02022c58 + str r0, [sp, 0x4] + adds r0, 0x1 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0xD0 + movs r2, 0x14 + movs r3, 0x1 + bl DrawDownArrow + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_801898C + + thumb_func_start sub_80189B4 +sub_80189B4: @ 80189B4 + push {lr} + sub sp, 0xC + movs r0, 0x1 + str r0, [sp] + ldr r0, =0x02022c58 + str r0, [sp, 0x4] + adds r0, 0x1 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0xD0 + movs r2, 0x14 + movs r3, 0x1 + bl DrawDownArrow + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_80189B4 + + thumb_func_start sub_80189DC +sub_80189DC: @ 80189DC + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0 + beq _080189EC + cmp r0, 0x1 + beq _08018A08 + b _08018A14 +_080189EC: + bl sub_801898C + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _08018A14 + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _08018A14 + .pool +_08018A08: + bl sub_80189B4 + movs r0, 0 + strb r0, [r4] + movs r0, 0x1 + b _08018A16 +_08018A14: + movs r0, 0 +_08018A16: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80189DC + + thumb_func_start sub_8018A1C +sub_8018A1C: @ 8018A1C + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0 + bne _08018A2C + adds r0, r1, 0 + bl sub_8018884 +_08018A2C: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x78 + bhi _08018A3E + movs r0, 0 + b _08018A48 +_08018A3E: + movs r0, 0 + strb r0, [r4] + bl sub_80188DC + movs r0, 0x1 +_08018A48: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8018A1C + + thumb_func_start sub_8018A50 +sub_8018A50: @ 8018A50 + push {r4,r5,lr} + sub sp, 0x24 + lsls r2, 24 + add r1, sp, 0x4 + ldr r0, =gUnknown_082F0638 + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldr r0, =gUnknown_082F05E0 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x1C] + str r1, [sp, 0x20] + cmp r2, 0 + bne _08018A80 + ldr r0, =gUnknown_082F0608 + b _08018A82 + .pool +_08018A80: + ldr r0, =gUnknown_082F0620 +_08018A82: + str r0, [sp, 0x4] + add r0, sp, 0x4 + bl sub_81DB41C + adds r3, r0, 0 + movs r0, 0x1 + ands r0, r3 + cmp r0, 0 + beq _08018A96 + adds r3, 0x1 +_08018A96: + lsls r1, r3, 24 + ldr r0, =0x00ffffff + ldr r2, [sp, 0x1C] + ands r2, r0 + orrs r2, r1 + str r2, [sp, 0x1C] + cmp r3, 0x1D + bgt _08018ACC + movs r0, 0x1E + subs r0, r3 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + lsls r0, 24 + lsrs r0, 16 + ldr r1, =0xffff00ff + ands r1, r2 + orrs r1, r0 + str r1, [sp, 0x1C] + b _08018AD2 + .pool +_08018ACC: + ldr r0, =0xffff00ff + ands r2, r0 + str r2, [sp, 0x1C] +_08018AD2: + add r0, sp, 0x1C + movs r1, 0xE0 + str r1, [sp] + add r1, sp, 0x4 + movs r2, 0x1 + movs r3, 0xA + bl DoMysteryGiftListMenu + adds r4, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r4, r0 + beq _08018AFA + movs r0, 0x2 + bl ClearWindowTilemap + movs r0, 0x2 + movs r1, 0x1 + bl CopyWindowToVram +_08018AFA: + adds r0, r4, 0 + add sp, 0x24 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8018A50 + + thumb_func_start sub_8018B08 +sub_8018B08: @ 8018B08 + push {r4-r6,lr} + sub sp, 0x1C + adds r5, r0, 0 + adds r4, r1, 0 + adds r1, r3, 0 + lsls r2, 24 + lsrs r6, r2, 24 + ldrb r0, [r5] + cmp r0, 0x1 + beq _08018B98 + cmp r0, 0x1 + bgt _08018B26 + cmp r0, 0 + beq _08018B30 + b _08018C3E +_08018B26: + cmp r0, 0x2 + beq _08018BE4 + cmp r0, 0xFF + beq _08018C1A + b _08018C3E +_08018B30: + ldr r0, =0x02021fc4 + bl ExpandStringRefs + cmp r6, 0 + bne _08018B48 + ldr r0, =gUnknown_082F05C8 + b _08018B4A + .pool +_08018B48: + ldr r0, =gUnknown_082F05D0 +_08018B4A: + bl AddWindow + strh r0, [r4] + ldrb r0, [r4] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldrb r0, [r4] + movs r2, 0 + str r2, [sp] + str r2, [sp, 0x4] + ldr r1, =gUnknown_082F0728 + str r1, [sp, 0x8] + str r2, [sp, 0xC] + ldr r1, =0x02021fc4 + str r1, [sp, 0x10] + movs r1, 0x1 + movs r3, 0x1 + bl AddTextPrinterParametrized2 + ldrb r0, [r4] + movs r1, 0x1 + movs r2, 0xF + bl sub_8098858 + ldrb r0, [r4] + movs r1, 0x2 + bl CopyWindowToVram + ldrb r0, [r4] + bl PutWindowTilemap + b _08018BD6 + .pool +_08018B98: + ldr r0, =gUnknown_082F05E8 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x14] + str r1, [sp, 0x18] + cmp r6, 0 + bne _08018BBC + ldr r0, =0xff00ffff + ldr r1, [sp, 0x14] + ands r1, r0 + movs r0, 0x90 + lsls r0, 12 + b _08018BC6 + .pool +_08018BBC: + ldr r0, =0xff00ffff + ldr r1, [sp, 0x14] + ands r1, r0 + movs r0, 0xF0 + lsls r0, 12 +_08018BC6: + orrs r1, r0 + str r1, [sp, 0x14] + add r0, sp, 0x14 + movs r1, 0xA + movs r2, 0xE + movs r3, 0 + bl CreateYesNoMenu +_08018BD6: + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + b _08018C3E + .pool +_08018BE4: + bl sub_8198C58 + lsls r0, 24 + asrs r6, r0, 24 + movs r1, 0x80 + lsls r1, 17 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x2 + bhi _08018C3E + movs r0, 0 + strb r0, [r5] + ldrb r0, [r4] + bl rbox_fill_rectangle + ldrb r0, [r4] + bl ClearWindowTilemap + ldrb r0, [r4] + movs r1, 0x1 + bl CopyWindowToVram + ldrb r0, [r4] + bl RemoveWindow + adds r0, r6, 0 + b _08018C42 +_08018C1A: + movs r0, 0 + strb r0, [r5] + ldrb r0, [r4] + bl rbox_fill_rectangle + ldrb r0, [r4] + bl ClearWindowTilemap + ldrb r0, [r4] + movs r1, 0x1 + bl CopyWindowToVram + ldrb r0, [r4] + bl RemoveWindow + movs r0, 0x1 + negs r0, r0 + b _08018C42 +_08018C3E: + movs r0, 0x2 + negs r0, r0 +_08018C42: + add sp, 0x1C + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8018B08 + + thumb_func_start sub_8018C4C +sub_8018C4C: @ 8018C4C + push {r4-r6,lr} + sub sp, 0x14 + adds r6, r0, 0 + adds r5, r1, 0 + ldrb r0, [r6] + cmp r0, 0x1 + beq _08018CE8 + cmp r0, 0x1 + bgt _08018C64 + cmp r0, 0 + beq _08018C6C + b _08018D8C +_08018C64: + cmp r0, 0xFF + bne _08018C6A + b _08018D68 +_08018C6A: + b _08018D8C +_08018C6C: + cmp r2, 0 + bne _08018C84 + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085EF2FC + bl ExpandStringRefs + b _08018C8C + .pool +_08018C84: + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085EF330 + bl ExpandStringRefs +_08018C8C: + ldr r0, =gUnknown_082F05D8 + bl AddWindow + strh r0, [r5] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldrb r0, [r5] + movs r2, 0 + str r2, [sp] + str r2, [sp, 0x4] + ldr r1, =gUnknown_082F0728 + str r1, [sp, 0x8] + str r2, [sp, 0xC] + ldr r1, =0x02021fc4 + str r1, [sp, 0x10] + movs r1, 0x1 + movs r3, 0x1 + bl AddTextPrinterParametrized2 + ldrb r0, [r5] + movs r1, 0x1 + movs r2, 0xF + bl sub_8098858 + ldrb r0, [r5] + movs r1, 0x2 + bl CopyWindowToVram + ldrb r0, [r5] + bl PutWindowTilemap + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] + b _08018D8C + .pool +_08018CE8: + cmp r3, 0 + beq _08018D10 + cmp r2, 0 + bne _08018D00 + ldr r0, =gUnknown_082F05F8 + ldr r1, =gUnknown_082F06C8 + b _08018D28 + .pool +_08018D00: + ldr r0, =gUnknown_082F0600 + ldr r1, =gUnknown_082F06F8 + b _08018D28 + .pool +_08018D10: + cmp r2, 0 + bne _08018D24 + ldr r0, =gUnknown_082F05F0 + ldr r1, =gUnknown_082F06B0 + b _08018D28 + .pool +_08018D24: + ldr r0, =gUnknown_082F05F8 + ldr r1, =gUnknown_082F06E0 +_08018D28: + movs r2, 0xE0 + str r2, [sp] + movs r2, 0x1 + movs r3, 0xA + bl DoMysteryGiftListMenu + adds r4, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r4, r0 + beq _08018D8C + movs r0, 0 + strb r0, [r6] + ldrb r0, [r5] + bl rbox_fill_rectangle + ldrb r0, [r5] + bl ClearWindowTilemap + ldrb r0, [r5] + movs r1, 0x1 + bl CopyWindowToVram + ldrb r0, [r5] + bl RemoveWindow + adds r0, r4, 0 + b _08018D90 + .pool +_08018D68: + movs r0, 0 + strb r0, [r6] + ldrb r0, [r5] + bl rbox_fill_rectangle + ldrb r0, [r5] + bl ClearWindowTilemap + ldrb r0, [r5] + movs r1, 0x1 + bl CopyWindowToVram + ldrb r0, [r5] + bl RemoveWindow + movs r0, 0x2 + negs r0, r0 + b _08018D90 +_08018D8C: + movs r0, 0x1 + negs r0, r0 +_08018D90: + add sp, 0x14 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8018C4C + + thumb_func_start sub_8018D98 +sub_8018D98: @ 8018D98 + push {lr} + cmp r0, 0 + beq _08018DA4 + bl sub_801B0CC + b _08018DA8 +_08018DA4: + bl sub_801B27C +_08018DA8: + pop {r1} + bx r1 + thumb_func_end sub_8018D98 + + thumb_func_start sub_8018DAC +sub_8018DAC: @ 8018DAC + push {r4,r5,lr} + adds r5, r0, 0 + ldrb r0, [r5] + cmp r0, 0 + beq _08018DBC + cmp r0, 0x1 + beq _08018DE4 + b _08018E00 +_08018DBC: + cmp r1, 0 + bne _08018DD4 + bl sav1_get_mevent_buffer_1 + adds r4, r0, 0 + bl sav1_get_mevent_buffer_2 + adds r1, r0, 0 + adds r0, r4, 0 + bl sub_801BAAC + b _08018DDC +_08018DD4: + bl sub_801B00C + bl sub_801C6C8 +_08018DDC: + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + b _08018E00 +_08018DE4: + cmp r1, 0 + bne _08018DF2 + bl sub_801BB74 +_08018DEC: + cmp r0, 0 + bne _08018DF8 + b _08018E00 +_08018DF2: + bl sub_801C758 + b _08018DEC +_08018DF8: + movs r0, 0 + strb r0, [r5] + movs r0, 0x1 + b _08018E02 +_08018E00: + movs r0, 0 +_08018E02: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8018DAC + + thumb_func_start sub_8018E08 +sub_8018E08: @ 8018E08 + push {lr} + cmp r0, 0 + bne _08018E14 + bl sub_801B1E8 + b _08018E18 +_08018E14: + bl sub_801B06C +_08018E18: + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8018E08 + + thumb_func_start sub_8018E20 +sub_8018E20: @ 8018E20 + push {lr} + cmp r0, 0 + bne _08018E36 + adds r0, r1, 0 + bl sub_801BDA4 + cmp r0, 0 + beq _08018E40 + bl sub_801BB48 + b _08018E48 +_08018E36: + adds r0, r1, 0 + bl sub_801CA50 + cmp r0, 0 + bne _08018E44 +_08018E40: + movs r0, 0 + b _08018E4A +_08018E44: + bl sub_801C72C +_08018E48: + movs r0, 0x1 +_08018E4A: + pop {r1} + bx r1 + thumb_func_end sub_8018E20 + + thumb_func_start sub_8018E50 +sub_8018E50: @ 8018E50 + push {lr} + cmp r2, 0 + beq _08018E60 + ldr r3, =gUnknown_085EF55C + b _08018E62 + .pool +_08018E60: + ldr r3, =gUnknown_085EF520 +_08018E62: + movs r2, 0x1 + bl sub_8018B08 + lsls r0, 24 + asrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8018E50 + + thumb_func_start mevent_message_was_thrown_away +mevent_message_was_thrown_away: @ 8018E74 + push {lr} + cmp r1, 0 + beq _08018E84 + ldr r1, =gUnknown_085EF630 + b _08018E86 + .pool +_08018E84: + ldr r1, =gUnknown_085EF60C +_08018E86: + bl mevent_0814257C + pop {r1} + bx r1 + .pool + thumb_func_end mevent_message_was_thrown_away + + thumb_func_start mevent_save_game +mevent_save_game: @ 8018E94 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0x4 + bhi _08018F04 + lsls r0, 2 + ldr r1, =_08018EAC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08018EAC: + .4byte _08018EC0 + .4byte _08018ECC + .4byte _08018ED4 + .4byte _08018EE0 + .4byte _08018EF8 +_08018EC0: + ldr r0, =gUnknown_085EF5BC + bl sub_8018884 + b _08018EEC + .pool +_08018ECC: + movs r0, 0 + bl save_game_when_memory_present + b _08018EEC +_08018ED4: + ldr r0, =gUnknown_085EF5E0 + bl sub_8018884 + b _08018EEC + .pool +_08018EE0: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _08018F04 +_08018EEC: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _08018F04 + .pool +_08018EF8: + movs r0, 0 + strb r0, [r4] + bl sub_80188DC + movs r0, 0x1 + b _08018F06 +_08018F04: + movs r0, 0 +_08018F06: + pop {r4} + pop {r1} + bx r1 + thumb_func_end mevent_save_game + + thumb_func_start mevent_message +mevent_message: @ 8018F0C + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r5, r2, 24 + movs r2, 0 + str r2, [r4] + cmp r3, 0xE + bls _08018F22 + b _08019034 +_08018F22: + lsls r0, r3, 2 + ldr r1, =_08018F30 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08018F30: + .4byte _08018F6C + .4byte _08018F78 + .4byte _08018F84 + .4byte _08018F9C + .4byte _08018FB4 + .4byte _08018FC0 + .4byte _08018FCC + .4byte _08018FD8 + .4byte _08018FE4 + .4byte _08018FF0 + .4byte _08018FFC + .4byte _08019014 + .4byte _08019020 + .4byte _0801902C + .4byte _08019030 +_08018F6C: + movs r0, 0 + str r0, [r4] + ldr r2, =gUnknown_085EF2E4 + b _08019034 + .pool +_08018F78: + movs r0, 0 + str r0, [r4] + ldr r2, =gUnknown_085EF244 + b _08019034 + .pool +_08018F84: + movs r0, 0x1 + str r0, [r4] + ldr r2, =gUnknown_085EF0C8 + cmp r5, 0 + bne _08019034 + ldr r2, =gUnknown_085EF124 + b _08019034 + .pool +_08018F9C: + movs r0, 0x1 + str r0, [r4] + ldr r2, =gUnknown_085EF0F4 + cmp r5, 0 + bne _08019034 + ldr r2, =gUnknown_085EF14C + b _08019034 + .pool +_08018FB4: + movs r0, 0x1 + str r0, [r4] + ldr r2, =gUnknown_085EF178 + b _08019034 + .pool +_08018FC0: + movs r0, 0 + str r0, [r4] + ldr r2, =gUnknown_085EF1B4 + b _08019034 + .pool +_08018FCC: + movs r0, 0 + str r0, [r4] + ldr r2, =gUnknown_085EF200 + b _08019034 + .pool +_08018FD8: + movs r0, 0 + str r0, [r4] + ldr r2, =gUnknown_085EF1D8 + b _08019034 + .pool +_08018FE4: + movs r0, 0 + str r0, [r4] + ldr r2, =gUnknown_085EF21C + b _08019034 + .pool +_08018FF0: + movs r0, 0 + str r0, [r4] + ldr r2, =gUnknown_085EF02C + b _08019034 + .pool +_08018FFC: + movs r0, 0 + str r0, [r4] + ldr r2, =gUnknown_085EF2B4 + cmp r6, 0 + bne _08019034 + ldr r2, =gUnknown_085EF280 + b _08019034 + .pool +_08019014: + movs r0, 0 + str r0, [r4] + ldr r2, =gUnknown_085EF014 + b _08019034 + .pool +_08019020: + movs r0, 0x1 + str r0, [r4] + ldr r2, =gUnknown_085EF198 + b _08019034 + .pool +_0801902C: + movs r0, 0x1 + b _08019032 +_08019030: + movs r0, 0 +_08019032: + str r0, [r4] +_08019034: + adds r0, r2, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end mevent_message + + thumb_func_start mevent_08142CE8 +mevent_08142CE8: @ 801903C + push {r4-r6,lr} + adds r6, r0, 0 + adds r0, r1, 0 + adds r5, r2, 0 + ldrb r4, [r6] + cmp r4, 0x1 + beq _0801906E + cmp r4, 0x1 + bgt _08019054 + cmp r4, 0 + beq _0801905A + b _0801909A +_08019054: + cmp r4, 0x2 + beq _08019084 + b _0801909A +_0801905A: + cmp r0, 0 + beq _08019062 + bl sub_8018884 +_08019062: + movs r0, 0xB9 + lsls r0, 1 + bl fanfare_play + strh r4, [r5] + b _0801907C +_0801906E: + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xF0 + bls _0801909A +_0801907C: + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] + b _0801909A +_08019084: + bl task_is_not_running_overworld_fanfare + lsls r0, 24 + cmp r0, 0 + beq _0801909A + movs r0, 0 + strb r0, [r6] + bl sub_80188DC + movs r0, 0x1 + b _0801909C +_0801909A: + movs r0, 0 +_0801909C: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end mevent_08142CE8 + + thumb_func_start mevent_message_stamp_card_etc_send_status +mevent_message_stamp_card_etc_send_status: @ 80190A4 + push {r4,lr} + adds r3, r0, 0 + ldr r1, =gUnknown_085EF014 + movs r0, 0 + str r0, [r3] + adds r4, r1, 0 + cmp r2, 0xE + bhi _08019166 + lsls r0, r2, 2 + ldr r1, =_080190C8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080190C8: + .4byte _08019104 + .4byte _0801910C + .4byte _08019114 + .4byte _0801911C + .4byte _08019128 + .4byte _08019130 + .4byte _08019138 + .4byte _08019140 + .4byte _08019148 + .4byte _08019150 + .4byte _08019164 + .4byte _08019158 + .4byte _0801915C + .4byte _0801915C + .4byte _08019164 +_08019104: + ldr r1, =gUnknown_085EF2E4 + b _08019166 + .pool +_0801910C: + ldr r1, =gUnknown_085EF244 + b _08019166 + .pool +_08019114: + ldr r1, =gUnknown_085EF39C + b _0801911E + .pool +_0801911C: + ldr r1, =gUnknown_085EF3C4 +_0801911E: + movs r0, 0x1 + str r0, [r3] + b _08019166 + .pool +_08019128: + ldr r1, =gUnknown_085EF3F0 + b _08019166 + .pool +_08019130: + ldr r1, =gUnknown_085EF42C + b _08019166 + .pool +_08019138: + ldr r1, =gUnknown_085EF494 + b _08019166 + .pool +_08019140: + ldr r1, =gUnknown_085EF460 + b _08019166 + .pool +_08019148: + ldr r1, =gUnknown_085EF21C + b _08019166 + .pool +_08019150: + ldr r1, =gUnknown_085EF4C4 + b _08019166 + .pool +_08019158: + adds r1, r4, 0 + b _08019166 +_0801915C: + ldr r1, =gUnknown_085EF410 + b _08019166 + .pool +_08019164: + ldr r1, =gUnknown_085EF4F0 +_08019166: + adds r0, r1, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end mevent_message_stamp_card_etc_send_status + + thumb_func_start sub_8019174 +sub_8019174: @ 8019174 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + adds r1, r2, 0 + adds r2, r3, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, sp + bl mevent_message_stamp_card_etc_send_status + adds r1, r0, 0 + ldr r0, [sp] + cmp r0, 0 + bne _0801919A + adds r0, r4, 0 + bl mevent_0814257C + b _080191A2 +_0801919A: + adds r0, r4, 0 + adds r2, r5, 0 + bl mevent_08142CE8 +_080191A2: + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8019174 + + thumb_func_start task_add_00_mystery_gift +task_add_00_mystery_gift: @ 80191AC + push {r4,lr} + ldr r0, =task00_mystery_gift + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =0x03005e08 + adds r4, r0 + movs r0, 0 + strb r0, [r4, 0x8] + strb r0, [r4, 0x9] + strb r0, [r4, 0xA] + strb r0, [r4, 0xB] + strb r0, [r4, 0xC] + strb r0, [r4, 0xD] + movs r1, 0 + strh r0, [r4] + strh r0, [r4, 0x2] + strh r0, [r4, 0x4] + strh r0, [r4, 0x6] + strb r1, [r4, 0xE] + movs r0, 0x40 + bl AllocZeroed + str r0, [r4, 0x10] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task_add_00_mystery_gift + + thumb_func_start task00_mystery_gift +task00_mystery_gift: @ 80191F4 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r5, r0, r1 + ldrb r0, [r5, 0x8] + cmp r0, 0x25 + bls _0801920E + b _08019922 +_0801920E: + lsls r0, 2 + ldr r1, =_08019220 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08019220: + .4byte _080192B8 + .4byte _080192BE + .4byte _08019300 + .4byte _08019338 + .4byte _0801935C + .4byte _080193AC + .4byte _0801940C + .4byte _08019444 + .4byte _08019454 + .4byte _080194CC + .4byte _080194F0 + .4byte _08019508 + .4byte _08019538 + .4byte _08019574 + .4byte _0801958C + .4byte _080195BC + .4byte _080198EC + .4byte _0801961A + .4byte _0801962A + .4byte _08019922 + .4byte _0801963C + .4byte _08019688 + .4byte _080196FE + .4byte _0801972E + .4byte _08019764 + .4byte _0801977E + .4byte _08019792 + .4byte _0801979E + .4byte _080197B2 + .4byte _080197C6 + .4byte _080197F8 + .4byte _0801982C + .4byte _08019870 + .4byte _08019884 + .4byte _080198A0 + .4byte _080198B8 + .4byte _080198EC + .4byte _0801990C +_080192B8: + movs r0, 0x1 + strb r0, [r5, 0x8] + b _08019922 +_080192BE: + adds r0, r5, 0 + adds r0, 0x9 + adds r1, r5, 0 + movs r2, 0 + bl sub_8018A50 + adds r1, r0, 0 + cmp r1, 0x1 + beq _080192E8 + cmp r1, 0x1 + bcc _080192DE + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + beq _080192FA + b _08019922 +_080192DE: + movs r0, 0 + strb r0, [r5, 0xC] + bl sub_801B27C + b _080192EE +_080192E8: + strb r1, [r5, 0xC] + bl sub_801B0CC +_080192EE: + cmp r0, 0x1 + bne _080192F4 + b _08019820 +_080192F4: + movs r0, 0x2 + strb r0, [r5, 0x8] + b _08019922 +_080192FA: + movs r0, 0x25 + strb r0, [r5, 0x8] + b _08019922 +_08019300: + ldrb r0, [r5, 0xC] + cmp r0, 0 + bne _08019314 + adds r0, r5, 0 + adds r0, 0x9 + ldr r1, =gUnknown_085EEEF0 + b _0801931A + .pool +_08019314: + adds r0, r5, 0 + adds r0, 0x9 + ldr r1, =gUnknown_085EEF2C +_0801931A: + bl mevent_0814257C + cmp r0, 0 + bne _08019324 + b _08019922 +_08019324: + movs r0, 0x3 + strb r0, [r5, 0x8] + movs r0, 0 + movs r1, 0x1 + bl sub_80186EC + b _08019922 + .pool +_08019338: + ldrb r0, [r5, 0xC] + cmp r0, 0 + bne _0801934C + ldr r0, =gUnknown_085EEF68 + bl sub_8018884 + b _08019352 + .pool +_0801934C: + ldr r0, =gUnknown_085EEF94 + bl sub_8018884 +_08019352: + movs r0, 0x4 + strb r0, [r5, 0x8] + b _08019922 + .pool +_0801935C: + adds r0, r5, 0 + adds r0, 0x9 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_8018A50 + adds r4, r0, 0 + cmp r4, 0x1 + beq _0801938A + cmp r4, 0x1 + bcc _0801937C + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _08019396 + b _08019922 +_0801937C: + bl sub_80188DC + movs r1, 0 + movs r0, 0x5 + strb r0, [r5, 0x8] + strb r1, [r5, 0xD] + b _08019922 +_0801938A: + bl sub_80188DC + movs r0, 0x5 + strb r0, [r5, 0x8] + strb r4, [r5, 0xD] + b _08019922 +_08019396: + bl sub_80188DC + ldrb r0, [r5, 0xC] + bl sub_8018D98 + cmp r0, 0 + beq _080193A6 + b _08019820 +_080193A6: + strb r0, [r5, 0x8] + movs r0, 0 + b _080198FE +_080193AC: + ldr r0, =0x02021cc4 + movs r1, 0xFF + strb r1, [r0] + ldr r0, =0x02021dc4 + strb r1, [r0] + ldr r0, =0x02021ec4 + strb r1, [r0] + ldrb r0, [r5, 0xC] + cmp r0, 0 + beq _080193D4 + cmp r0, 0x1 + beq _080193EE + b _08019406 + .pool +_080193D4: + ldrb r0, [r5, 0xD] + cmp r0, 0x1 + bne _080193E2 + movs r0, 0x15 + bl sub_8014EFC + b _08019406 +_080193E2: + cmp r0, 0 + bne _08019406 + movs r0, 0x15 + bl sub_80152A8 + b _08019406 +_080193EE: + ldrb r0, [r5, 0xD] + cmp r0, 0x1 + bne _080193FC + movs r0, 0x16 + bl sub_8014EFC + b _08019406 +_080193FC: + cmp r0, 0 + bne _08019406 + movs r0, 0x16 + bl sub_80152A8 +_08019406: + movs r0, 0x6 + strb r0, [r5, 0x8] + b _08019922 +_0801940C: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _0801942C + movs r0, 0x1 + bl sub_8018838 + movs r0, 0x7 + strb r0, [r5, 0x8] + ldrb r0, [r5, 0xC] + bl sub_801D484 + b _08019922 + .pool +_0801942C: + ldr r0, =0x020375f0 + ldrh r0, [r0] + cmp r0, 0x5 + beq _08019436 + b _08019922 +_08019436: + movs r0, 0x1 + bl sub_8018838 + b _080197C0 + .pool +_08019444: + ldr r0, =gUnknown_085EEFE8 + bl sub_8018884 + movs r0, 0x8 + strb r0, [r5, 0x8] + b _08019922 + .pool +_08019454: + adds r0, r5, 0 + bl sub_801D4A8 + subs r0, 0x2 + cmp r0, 0x4 + bls _08019462 + b _08019922 +_08019462: + lsls r0, 2 + ldr r1, =_08019470 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08019470: + .4byte _080194AE + .4byte _080194A8 + .4byte _080194B4 + .4byte _08019492 + .4byte _08019484 +_08019484: + bl task_add_05_task_del_08FA224_when_no_RfuFunc + ldrh r0, [r5] + strb r0, [r5, 0xE] + movs r0, 0xD + strb r0, [r5, 0x8] + b _08019922 +_08019492: + ldr r4, [r5, 0x10] + bl sub_801D4F4 + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0x40 + bl memcpy + bl sub_801D4E4 + b _08019922 +_080194A8: + movs r0, 0xA + strb r0, [r5, 0x8] + b _08019922 +_080194AE: + movs r0, 0x9 + strb r0, [r5, 0x8] + b _08019922 +_080194B4: + movs r0, 0xB + strb r0, [r5, 0x8] + ldr r0, =0x02021cc4 + ldr r1, =0x020229f0 + bl CopyString + b _08019922 + .pool +_080194CC: + adds r4, r5, 0 + adds r4, 0x9 + bl sub_801D4F4 + adds r3, r0, 0 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + bl sub_8018B08 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0x1 + beq _08019564 + cmp r1, 0x1 + bcs _08019552 + movs r0, 0 + b _08019566 +_080194F0: + adds r4, r5, 0 + adds r4, 0x9 + bl sub_801D4F4 + adds r1, r0, 0 + adds r0, r4, 0 + bl mevent_0814257C + cmp r0, 0 + bne _08019506 + b _08019922 +_08019506: + b _0801956A +_08019508: + adds r0, r5, 0 + adds r0, 0x9 + ldr r3, =gUnknown_085EF050 + adds r1, r5, 0 + movs r2, 0 + bl sub_8018B08 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0x1 + beq _08019564 + cmp r1, 0x1 + bcs _08019552 + bl sub_801B3F8 + cmp r0, 0x1 + bne _08019534 + movs r0, 0xC + strb r0, [r5, 0x8] + b _08019922 + .pool +_08019534: + movs r0, 0 + b _08019566 +_08019538: + adds r0, r5, 0 + adds r0, 0x9 + ldr r3, =gUnknown_085EF084 + adds r1, r5, 0 + movs r2, 0 + bl sub_8018B08 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0x1 + beq _08019564 + cmp r1, 0x1 + bcc _08019560 +_08019552: + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08019564 + b _08019922 + .pool +_08019560: + movs r0, 0 + b _08019566 +_08019564: + movs r0, 0x1 +_08019566: + bl sub_801D500 +_0801956A: + bl sub_801D4E4 + movs r0, 0x7 + strb r0, [r5, 0x8] + b _08019922 +_08019574: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _0801957E + b _08019922 +_0801957E: + bl sub_800E084 + movs r0, 0xE + strb r0, [r5, 0x8] + b _08019922 + .pool +_0801958C: + adds r0, r5, 0 + adds r0, 0x9 + ldr r1, =gUnknown_085EEFF8 + bl sub_8018A1C + cmp r0, 0 + bne _0801959C + b _08019922 +_0801959C: + ldrb r0, [r5, 0xD] + cmp r0, 0x1 + bne _080195AA + ldr r0, =0x02021cc4 + ldr r1, =0x020229f0 + bl CopyString +_080195AA: + movs r0, 0xF + strb r0, [r5, 0x8] + b _08019922 + .pool +_080195BC: + ldrb r1, [r5, 0xC] + ldrb r2, [r5, 0xD] + ldrb r3, [r5, 0xE] + mov r0, sp + bl mevent_message + adds r1, r0, 0 + cmp r1, 0 + bne _080195D0 + ldr r1, [r5, 0x10] +_080195D0: + ldr r0, [sp] + cmp r0, 0 + beq _080195E2 + adds r0, r5, 0 + adds r0, 0x9 + adds r2, r5, 0 + bl mevent_08142CE8 + b _080195EA +_080195E2: + adds r0, r5, 0 + adds r0, 0x9 + bl mevent_0814257C +_080195EA: + adds r1, r0, 0 + cmp r1, 0 + bne _080195F2 + b _08019922 +_080195F2: + ldrb r0, [r5, 0xE] + cmp r0, 0x3 + bne _0801960C + ldrb r0, [r5, 0xD] + cmp r0, 0x1 + bne _08019606 + movs r0, 0x1 + bl sub_801DB68 + b _0801960C +_08019606: + movs r0, 0x2 + bl sub_801DB68 +_0801960C: + ldr r0, [sp] + cmp r0, 0 + beq _08019614 + b _080198DC +_08019614: + strb r0, [r5, 0x8] + movs r0, 0 + b _080198FE +_0801961A: + adds r0, r5, 0 + adds r0, 0x9 + bl mevent_save_game + cmp r0, 0 + bne _08019628 + b _08019922 +_08019628: + b _08019820 +_0801962A: + adds r0, r5, 0 + adds r0, 0x9 + ldrb r1, [r5, 0xC] + bl sub_8018DAC + cmp r0, 0 + bne _0801963A + b _08019922 +_0801963A: + b _080196F8 +_0801963C: + ldrb r0, [r5, 0xC] + cmp r0, 0 + bne _08019664 + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08019652 + movs r0, 0x15 + strb r0, [r5, 0x8] +_08019652: + ldrh r1, [r2, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0801965E + b _08019922 +_0801965E: + b _08019682 + .pool +_08019664: + ldr r0, =0x030022c0 + ldrh r0, [r0, 0x2E] + bl sub_801CCD0 + cmp r0, 0 + beq _0801967C + cmp r0, 0x1 + beq _08019682 + b _08019922 + .pool +_0801967C: + bl sub_801CC38 + b _0801975E +_08019682: + movs r0, 0x1B + strb r0, [r5, 0x8] + b _08019922 +_08019688: + ldrb r0, [r5, 0xC] + cmp r0, 0 + bne _080196A2 + bl sub_801B308 + cmp r0, 0 + beq _080196B6 + adds r0, r5, 0 + adds r0, 0x9 + ldrb r2, [r5, 0xC] + adds r1, r5, 0 + movs r3, 0 + b _080196C0 +_080196A2: + bl sub_801B128 + cmp r0, 0 + beq _080196B6 + adds r0, r5, 0 + adds r0, 0x9 + ldrb r2, [r5, 0xC] + adds r1, r5, 0 + movs r3, 0 + b _080196C0 +_080196B6: + adds r0, r5, 0 + adds r0, 0x9 + ldrb r2, [r5, 0xC] + adds r1, r5, 0 + movs r3, 0x1 +_080196C0: + bl sub_8018C4C + adds r1, r0, 0 + cmp r1, 0x1 + beq _080196E2 + cmp r1, 0x1 + bcc _080196DC + cmp r1, 0x2 + beq _080196E8 + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + beq _080196EE + b _08019922 +_080196DC: + movs r0, 0x1C + strb r0, [r5, 0x8] + b _08019922 +_080196E2: + movs r0, 0x1D + strb r0, [r5, 0x8] + b _08019922 +_080196E8: + movs r0, 0x16 + strb r0, [r5, 0x8] + b _08019922 +_080196EE: + ldrb r0, [r5, 0xC] + cmp r0, 0x1 + bne _080196F8 + bl sub_801CC80 +_080196F8: + movs r0, 0x14 + strb r0, [r5, 0x8] + b _08019922 +_080196FE: + adds r0, r5, 0 + adds r0, 0x9 + ldrb r2, [r5, 0xC] + adds r1, r5, 0 + bl sub_8018E50 + adds r1, r0, 0 + cmp r1, 0 + beq _0801971A + cmp r1, 0 + ble _08019748 + cmp r1, 0x1 + beq _0801975E + b _08019922 +_0801971A: + ldrb r0, [r5, 0xC] + cmp r0, 0 + bne _08019758 + bl sub_801B3F8 + cmp r0, 0x1 + bne _08019758 + movs r0, 0x17 + strb r0, [r5, 0x8] + b _08019922 +_0801972E: + adds r0, r5, 0 + adds r0, 0x9 + ldr r3, =gUnknown_085EF584 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_8018B08 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0x1 + beq _0801975E + cmp r1, 0x1 + bcc _08019758 +_08019748: + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0801975E + b _08019922 + .pool +_08019758: + movs r0, 0x18 + strb r0, [r5, 0x8] + b _08019922 +_0801975E: + movs r0, 0x15 + strb r0, [r5, 0x8] + b _08019922 +_08019764: + ldrb r0, [r5, 0xC] + movs r1, 0x1 + bl sub_8018E20 + cmp r0, 0 + bne _08019772 + b _08019922 +_08019772: + ldrb r0, [r5, 0xC] + bl sub_8018E08 + movs r0, 0x19 + strb r0, [r5, 0x8] + b _08019922 +_0801977E: + adds r0, r5, 0 + adds r0, 0x9 + bl mevent_save_game + cmp r0, 0 + bne _0801978C + b _08019922 +_0801978C: + movs r0, 0x1A + strb r0, [r5, 0x8] + b _08019922 +_08019792: + adds r0, r5, 0 + adds r0, 0x9 + ldrb r1, [r5, 0xC] + bl mevent_message_was_thrown_away + b _080198F6 +_0801979E: + ldrb r0, [r5, 0xC] + movs r1, 0 + bl sub_8018E20 + cmp r0, 0 + bne _080197AC + b _08019922 +_080197AC: + movs r0, 0 + strb r0, [r5, 0x8] + b _08019922 +_080197B2: + ldrb r0, [r5, 0xC] + movs r1, 0x1 + bl sub_8018E20 + cmp r0, 0 + bne _080197C0 + b _08019922 +_080197C0: + movs r0, 0x3 + strb r0, [r5, 0x8] + b _08019922 +_080197C6: + ldrb r0, [r5, 0xC] + movs r1, 0x1 + bl sub_8018E20 + cmp r0, 0 + bne _080197D4 + b _08019922 +_080197D4: + ldrb r0, [r5, 0xC] + cmp r0, 0 + beq _080197E0 + cmp r0, 0x1 + beq _080197E8 + b _080197EE +_080197E0: + movs r0, 0x15 + bl sub_8014A00 + b _080197EE +_080197E8: + movs r0, 0x16 + bl sub_8014A00 +_080197EE: + movs r0, 0x1 + strb r0, [r5, 0xD] + movs r0, 0x1E + strb r0, [r5, 0x8] + b _08019922 +_080197F8: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _08019810 + movs r0, 0x1 + bl sub_8018838 + movs r0, 0x1F + strb r0, [r5, 0x8] + b _08019922 + .pool +_08019810: + ldr r0, =0x020375f0 + ldrh r0, [r0] + cmp r0, 0x5 + beq _0801981A + b _08019922 +_0801981A: + movs r0, 0x1 + bl sub_8018838 +_08019820: + movs r0, 0x12 + strb r0, [r5, 0x8] + b _08019922 + .pool +_0801982C: + ldr r0, =0x02021cc4 + movs r1, 0xFF + strb r1, [r0] + ldr r0, =0x02021dc4 + strb r1, [r0] + ldr r0, =0x02021ec4 + strb r1, [r0] + ldrb r0, [r5, 0xC] + cmp r0, 0 + bne _0801985C + ldr r0, =gUnknown_085EF360 + bl sub_8018884 + bl mevent_srv_new_wcard + b _08019866 + .pool +_0801985C: + ldr r0, =gUnknown_085EF37C + bl sub_8018884 + bl mevent_srv_init_wnews +_08019866: + movs r0, 0x20 + strb r0, [r5, 0x8] + b _08019922 + .pool +_08019870: + adds r0, r5, 0 + bl sub_801D0C4 + cmp r0, 0x3 + bne _08019922 + ldrh r0, [r5] + strb r0, [r5, 0xE] + movs r0, 0x21 + strb r0, [r5, 0x8] + b _08019922 +_08019884: + bl task_add_05_task_del_08FA224_when_no_RfuFunc + ldr r0, =0x02021cc4 + ldr r1, =0x02022a0c + bl CopyString + movs r0, 0x22 + strb r0, [r5, 0x8] + b _08019922 + .pool +_080198A0: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _08019922 + bl sub_800E084 + movs r0, 0x23 + strb r0, [r5, 0x8] + b _08019922 + .pool +_080198B8: + adds r0, r5, 0 + adds r0, 0x9 + ldrb r2, [r5, 0xD] + ldrb r3, [r5, 0xE] + adds r1, r5, 0 + bl sub_8019174 + cmp r0, 0 + beq _08019922 + ldr r0, [r5, 0xC] + ldr r1, =0x00ffff00 + ands r0, r1 + ldr r1, =0x00030100 + cmp r0, r1 + bne _080198FA + movs r0, 0x3 + bl sub_801DB68 +_080198DC: + movs r0, 0x11 + strb r0, [r5, 0x8] + b _08019922 + .pool +_080198EC: + adds r0, r5, 0 + adds r0, 0x9 + ldr r1, =gUnknown_085EF014 + bl mevent_0814257C +_080198F6: + cmp r0, 0 + beq _08019922 +_080198FA: + movs r0, 0 + strb r0, [r5, 0x8] +_080198FE: + movs r1, 0 + bl sub_80186EC + b _08019922 + .pool +_0801990C: + bl sub_80097E8 + ldr r0, [r5, 0x10] + bl Free + adds r0, r4, 0 + bl remove_task + ldr r0, =sub_80186A4 + bl SetMainCallback2 +_08019922: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end task00_mystery_gift + + thumb_func_start sub_8019930 +sub_8019930: @ 8019930 + ldr r0, =0x000001a9 + bx lr + .pool + thumb_func_end sub_8019930 + + thumb_func_start bgid_upload_textbox_1 +bgid_upload_textbox_1: @ 8019938 + push {lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_082F0568 + movs r2, 0x80 + lsls r2, 1 + movs r3, 0 + str r3, [sp] + bl copy_decompressed_tile_data_to_vram_autofree + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end bgid_upload_textbox_1 + + thumb_func_start is_walking_or_running +is_walking_or_running: @ 8019958 + push {lr} + ldr r0, =0x02037590 + ldrb r0, [r0, 0x3] + cmp r0, 0x2 + beq _08019966 + cmp r0, 0 + bne _08019970 +_08019966: + movs r0, 0x1 + b _08019972 + .pool +_08019970: + movs r0, 0 +_08019972: + pop {r1} + bx r1 + thumb_func_end is_walking_or_running + + thumb_func_start sub_8019978 +sub_8019978: @ 8019978 + ldr r3, =gUnknown_082F072C + movs r2, 0x7 + ands r2, r1 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 1 + adds r2, r1 + adds r2, r3 + ldrb r0, [r2] + bx lr + .pool + thumb_func_end sub_8019978 + + thumb_func_start sub_8019990 +sub_8019990: @ 8019990 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r4, =gUnknown_082F0740 + mov r8, r4 + lsls r0, 2 + adds r4, r0, r4 + movs r6, 0 + ldrsh r5, [r4, r6] + ldr r6, =gUnknown_082F0760 + lsls r1, 1 + adds r4, r1, r6 + ldrb r4, [r4] + lsls r4, 24 + asrs r4, 24 + adds r5, r4 + adds r5, 0x7 + str r5, [r2] + movs r2, 0x2 + add r8, r2 + add r0, r8 + movs r4, 0 + ldrsh r0, [r0, r4] + adds r6, 0x1 + adds r1, r6 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + adds r0, r1 + adds r0, 0x7 + str r0, [r3] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8019990 + + thumb_func_start sub_80199E0 +sub_80199E0: @ 80199E0 + push {r4-r7,lr} + mov r12, r3 + ldr r7, =gUnknown_082F0740 + lsls r5, r0, 2 + adds r0, r5, r7 + movs r4, 0 + ldrsh r3, [r0, r4] + ldr r6, =gUnknown_082F0760 + lsls r4, r1, 1 + adds r0, r4, r6 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + adds r3, r0 + adds r3, 0x7 + cmp r3, r2 + bne _08019A28 + adds r0, r7, 0x2 + adds r0, r5, r0 + movs r2, 0 + ldrsh r1, [r0, r2] + adds r0, r6, 0x1 + adds r0, r4, r0 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + adds r1, r0 + adds r1, 0x7 + cmp r1, r12 + bne _08019A28 + movs r0, 0x1 + b _08019A2A + .pool +_08019A28: + movs r0, 0 +_08019A2A: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80199E0 + + thumb_func_start sub_8019A30 +sub_8019A30: @ 8019A30 + push {lr} + ldr r1, =0x000002bf + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8019A30 + + thumb_func_start flag_set_x63 +flag_set_x63: @ 8019A4C + push {lr} + ldr r1, =0x000002bf + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + bl FlagSet + pop {r0} + bx r0 + .pool + thumb_func_end flag_set_x63 + + thumb_func_start flag_clear_x63 +flag_clear_x63: @ 8019A64 + push {lr} + ldr r1, =0x000002bf + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + bl FlagReset + pop {r0} + bx r0 + .pool + thumb_func_end flag_clear_x63 + + thumb_func_start sub_8019A7C +sub_8019A7C: @ 8019A7C + push {lr} + ldr r2, =0x00004010 + adds r0, r2 + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r1, 16 + bl VarSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_8019A7C + + thumb_func_start sub_8019A98 +sub_8019A98: @ 8019A98 + push {lr} + ldr r1, =gUnknown_082F0774 + adds r0, r1 + ldrb r0, [r0] + ldr r1, =0x03005d8c + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl show_sprite + pop {r0} + bx r0 + .pool + thumb_func_end sub_8019A98 + + thumb_func_start sub_8019AB8 +sub_8019AB8: @ 8019AB8 + push {lr} + ldr r1, =gUnknown_082F0774 + adds r0, r1 + ldrb r0, [r0] + ldr r1, =0x03005d8c + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl RemoveFieldObjectByLocalIdAndMap + pop {r0} + bx r0 + .pool + thumb_func_end sub_8019AB8 + + thumb_func_start sub_8019AD8 +sub_8019AD8: @ 8019AD8 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r1, 0 + ldr r1, =gUnknown_082F0774 + adds r0, r1 + ldrb r0, [r0] + ldr r1, =0x03005d8c + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _08019B30 + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + adds r0, r4, 0 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + cmp r0, 0 + bne _08019B30 + ldrb r1, [r5] + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim + lsls r0, 24 + cmp r0, 0 + bne _08019B30 + movs r0, 0x1 + b _08019B32 + .pool +_08019B30: + movs r0, 0 +_08019B32: + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8019AD8 + + thumb_func_start sub_8019B3C +sub_8019B3C: @ 8019B3C + push {r4,lr} + sub sp, 0x4 + ldr r1, =gUnknown_082F0774 + adds r0, r1 + ldrb r0, [r0] + ldr r1, =0x03005d8c + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _08019B9C + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + bne _08019B84 + movs r0, 0 + b _08019B9E + .pool +_08019B84: + bl script_env_2_is_enabled + lsls r0, 24 + cmp r0, 0 + bne _08019B96 + adds r0, r4, 0 + bl npc_sync_anim_pause_bits + b _08019B9C +_08019B96: + adds r0, r4, 0 + bl sub_8097404 +_08019B9C: + movs r0, 0x1 +_08019B9E: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8019B3C + + thumb_func_start sub_8019BA8 +sub_8019BA8: @ 8019BA8 + push {lr} + ldr r2, =0x02022c68 + movs r1, 0 + str r1, [r2] + ldr r1, =0x02022c64 + str r0, [r1] + movs r1, 0 + movs r2, 0x7 +_08019BB8: + strb r1, [r0] + strb r1, [r0, 0x1] + strb r1, [r0, 0x2] + strb r1, [r0, 0x3] + adds r0, 0x4 + subs r2, 0x1 + cmp r2, 0 + bge _08019BB8 + bl sub_8019DF4 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8019BA8 + + thumb_func_start sub_8019BDC +sub_8019BDC: @ 8019BDC + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r0, 0 + ldrsb r0, [r5, r0] + cmp r0, 0 + beq _08019BF0 + cmp r0, 0x1 + beq _08019C10 + b _08019C2E +_08019BF0: + ldr r1, =gUnknown_082F078C + adds r0, r4, 0 + bl sub_8019AD8 + cmp r0, 0x1 + bne _08019C2E + adds r0, r4, 0 + bl flag_set_x63 + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + b _08019C2E + .pool +_08019C10: + adds r0, r4, 0 + bl sub_8019B3C + cmp r0, 0 + beq _08019C2E + adds r0, r4, 0 + bl sub_8019AB8 + adds r0, r4, 0 + bl flag_set_x63 + movs r0, 0 + strb r0, [r5] + movs r0, 0x1 + b _08019C30 +_08019C2E: + movs r0, 0 +_08019C30: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8019BDC + + thumb_func_start sub_8019C38 +sub_8019C38: @ 8019C38 + push {r4-r7,lr} + sub sp, 0x4 + adds r6, r0, 0 + adds r5, r1, 0 + adds r7, r2, 0 + movs r0, 0 + ldrsb r0, [r6, r0] + cmp r0, 0x2 + beq _08019CD4 + cmp r0, 0x2 + bgt _08019C54 + cmp r0, 0 + beq _08019C5A + b _08019CE6 +_08019C54: + cmp r0, 0x3 + beq _08019CBC + b _08019CE6 +_08019C5A: + bl is_walking_or_running + cmp r0, 0 + beq _08019CE6 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + mov r0, sp + movs r1, 0 + ldrsh r2, [r0, r1] + movs r0, 0 + ldrsh r3, [r4, r0] + adds r0, r5, 0 + movs r1, 0 + bl sub_80199E0 + cmp r0, 0x1 + beq _08019CE6 + mov r0, sp + adds r1, r4, 0 + bl plaer_get_pos_including_state_based_drift + mov r0, sp + movs r1, 0 + ldrsh r2, [r0, r1] + movs r0, 0 + ldrsh r3, [r4, r0] + adds r0, r5, 0 + movs r1, 0 + bl sub_80199E0 + cmp r0, 0x1 + beq _08019CE6 + ldrb r1, [r7, 0x1] + adds r0, r5, 0 + bl sub_8019A7C + adds r0, r5, 0 + bl sub_8019A98 + adds r0, r5, 0 + bl flag_clear_x63 + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] +_08019CBC: + ldr r1, =gUnknown_082F078E + adds r0, r5, 0 + bl sub_8019AD8 + cmp r0, 0x1 + bne _08019CE6 + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] + b _08019CE6 + .pool +_08019CD4: + adds r0, r5, 0 + bl sub_8019B3C + cmp r0, 0 + beq _08019CE6 + movs r0, 0 + strb r0, [r6] + movs r0, 0x1 + b _08019CE8 +_08019CE6: + movs r0, 0 +_08019CE8: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8019C38 + + thumb_func_start sub_8019CF0 +sub_8019CF0: @ 8019CF0 + push {r4,lr} + ldr r3, =0x02022c64 + lsls r0, 2 + ldr r4, [r3] + adds r4, r0 + movs r0, 0x1 + strb r0, [r4, 0x3] + adds r0, r1, 0 + adds r1, r2, 0 + bl sub_8019978 + strb r0, [r4, 0x1] + ldrb r0, [r4] + cmp r0, 0 + beq _08019D18 + movs r0, 0 + b _08019D1A + .pool +_08019D18: + movs r0, 0x1 +_08019D1A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8019CF0 + + thumb_func_start AGBAssert +AGBAssert: @ 8019D20 + push {lr} + ldr r1, =0x02022c64 + lsls r0, 2 + ldr r1, [r1] + adds r1, r0 + movs r0, 0x2 + strb r0, [r1, 0x3] + ldrb r0, [r1] + cmp r0, 0x1 + beq _08019D3C + movs r0, 0 + b _08019D3E + .pool +_08019D3C: + movs r0, 0x1 +_08019D3E: + pop {r1} + bx r1 + thumb_func_end AGBAssert + + thumb_func_start sub_8019D44 +sub_8019D44: @ 8019D44 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldrb r1, [r4] + cmp r1, 0x1 + beq _08019DA6 + cmp r1, 0x1 + bgt _08019D5A + cmp r1, 0 + beq _08019D64 + b _08019DC6 +_08019D5A: + cmp r1, 0x2 + beq _08019D70 + cmp r1, 0x3 + beq _08019DB4 + b _08019DC6 +_08019D64: + ldrb r0, [r4, 0x3] + cmp r0, 0x1 + bne _08019DC6 + movs r0, 0x2 + strb r0, [r4] + strb r1, [r4, 0x2] +_08019D70: + adds r0, r5, 0 + movs r1, 0 + bl sub_8019F8C + adds r1, r0, 0 + cmp r1, 0 + bne _08019D96 + ldrb r0, [r4, 0x3] + cmp r0, 0x2 + bne _08019D96 + strb r1, [r4] + strb r1, [r4, 0x2] + adds r0, r5, 0 + bl sub_8019AB8 + adds r0, r5, 0 + bl flag_set_x63 + b _08019DC6 +_08019D96: + adds r0, r4, 0x2 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_8019C38 + cmp r0, 0x1 + bne _08019DC6 + b _08019DC4 +_08019DA6: + ldrb r0, [r4, 0x3] + cmp r0, 0x2 + bne _08019DC6 + movs r1, 0 + movs r0, 0x3 + strb r0, [r4] + strb r1, [r4, 0x2] +_08019DB4: + adds r0, r4, 0x2 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_8019BDC + cmp r0, 0x1 + bne _08019DC6 + movs r0, 0 +_08019DC4: + strb r0, [r4] +_08019DC6: + movs r0, 0 + strb r0, [r4, 0x3] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8019D44 + + thumb_func_start sub_8019DD0 +sub_8019DD0: @ 8019DD0 + push {r4,r5,lr} + movs r4, 0 + ldr r5, =0x02022c64 +_08019DD6: + lsls r0, r4, 2 + ldr r1, [r5] + adds r1, r0 + adds r0, r4, 0 + bl sub_8019D44 + adds r4, 0x1 + cmp r4, 0x7 + ble _08019DD6 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8019DD0 + + thumb_func_start sub_8019DF4 +sub_8019DF4: @ 8019DF4 + push {r4,lr} + ldr r4, =sub_8019DD0 + adds r0, r4, 0 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08019E18 + adds r0, r4, 0 + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + b _08019E1A + .pool +_08019E18: + movs r0, 0x10 +_08019E1A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8019DF4 + + thumb_func_start sub_8019E20 +sub_8019E20: @ 8019E20 + push {lr} + ldr r0, =sub_8019DD0 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xF + bhi _08019E34 + bl remove_task +_08019E34: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8019E20 + + thumb_func_start sub_8019E3C +sub_8019E3C: @ 8019E3C + push {r4,lr} + movs r4, 0 +_08019E40: + adds r0, r4, 0 + bl sub_8019A30 + cmp r0, 0 + bne _08019E56 + adds r0, r4, 0 + bl sub_8019AB8 + adds r0, r4, 0 + bl flag_set_x63 +_08019E56: + adds r4, 0x1 + cmp r4, 0x7 + ble _08019E40 + ldr r1, =0x02022c64 + movs r0, 0 + str r0, [r1] + bl sub_8019E20 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8019E3C + + thumb_func_start sub_8019E70 +sub_8019E70: @ 8019E70 + 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 r7, 0 + mov r0, r9 + lsls r0, 2 + mov r8, r0 + ldr r0, =gUnknown_082F0740 + mov r2, r8 + adds r1, r2, r0 + ldrh r1, [r1] + mov r2, sp + strh r1, [r2, 0xC] + adds r0, 0x2 + add r0, r8 + ldrh r0, [r0] + mov r10, r0 + ldr r6, =gUnknown_082F0760 +_08019E9E: + mov r5, r8 + add r5, r9 + adds r5, r7 + adds r4, r5, 0 + subs r4, 0x38 + lsls r4, 24 + lsrs r4, 24 + movs r2, 0 + ldrsb r2, [r6, r2] + mov r0, sp + ldrh r0, [r0, 0xC] + adds r2, r0, r2 + lsls r2, 16 + asrs r2, 16 + movs r3, 0x1 + ldrsb r3, [r6, r3] + add r3, r10 + lsls r3, 16 + asrs r3, 16 + movs r0, 0x3 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r0, 0x41 + adds r1, r4, 0 + bl sprite_new + ldr r1, [sp, 0x8] + adds r5, r1, r5 + strb r0, [r5] + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8097C44 + adds r6, 0x2 + adds r7, 0x1 + cmp r7, 0x4 + ble _08019E9E + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8019E70 + + thumb_func_start sub_8019F04 +sub_8019F04: @ 8019F04 + push {r4-r6,lr} + adds r5, r0, 0 + movs r4, 0 + ldr r6, =0x02020630 +_08019F0C: + adds r0, r5, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl RemoveObjectAndFreeTiles + adds r4, 0x1 + cmp r4, 0x27 + ble _08019F0C + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8019F04 + + thumb_func_start sub_8019F2C +sub_8019F2C: @ 8019F2C + push {r4-r7,lr} + sub sp, 0x8 + movs r5, 0 + add r7, sp, 0x4 +_08019F34: + movs r4, 0 + adds r6, r5, 0x1 +_08019F38: + adds r0, r5, 0 + adds r1, r4, 0 + mov r2, sp + adds r3, r7, 0 + bl sub_8019990 + ldr r0, [sp] + ldr r1, [sp, 0x4] + movs r2, 0 + bl sub_8088B94 + adds r4, 0x1 + cmp r4, 0x4 + ble _08019F38 + adds r5, r6, 0 + cmp r5, 0x7 + ble _08019F34 + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8019F2C + + thumb_func_start sub_8019F64 +sub_8019F64: @ 8019F64 + push {lr} + adds r1, r0, 0 + cmp r1, 0 + beq _08019F78 + ldr r0, =gUnknown_082F076F + adds r0, r1, r0 + ldrb r0, [r0] + b _08019F88 + .pool +_08019F78: + ldrb r1, [r2, 0xA] + movs r0, 0x7F + ands r0, r1 + cmp r0, 0x45 + beq _08019F86 + movs r0, 0x4 + b _08019F88 +_08019F86: + movs r0, 0x1 +_08019F88: + pop {r1} + bx r1 + thumb_func_end sub_8019F64 + + thumb_func_start sub_8019F8C +sub_8019F8C: @ 8019F8C + push {lr} + adds r2, r0, 0 + lsls r0, r2, 2 + adds r0, r2 + adds r0, r1 + subs r0, 0x38 + lsls r0, 24 + lsrs r0, 24 + bl sub_8097C8C + pop {r1} + bx r1 + thumb_func_end sub_8019F8C + + thumb_func_start sub_8019FA4 +sub_8019FA4: @ 8019FA4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + adds r5, r0, 0 + adds r6, r1, 0 + mov r9, r3 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r0, r5, 2 + adds r0, r5 + adds r7, r0, r6 + adds r0, r5, 0 + bl sub_8019F8C + cmp r0, 0x1 + bne _08019FE2 + adds r4, r7, 0 + subs r4, 0x38 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0 + bl sub_8097C44 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8097CC4 +_08019FE2: + adds r0, r7, 0 + subs r0, 0x38 + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + bl sub_8097BB4 + adds r0, r6, 0 + adds r1, r5, 0 + mov r2, r9 + bl sub_8019F64 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_801A3B0 + add r3, sp, 0x4 + adds r0, r5, 0 + adds r1, r6, 0 + mov r2, sp + bl sub_8019990 + ldr r0, [sp] + ldr r1, [sp, 0x4] + movs r2, 0x1 + bl sub_8088B94 + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8019FA4 + + thumb_func_start sub_801A02C +sub_801A02C: @ 801A02C + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + adds r5, r1, 0 + lsls r0, r4, 2 + adds r0, r4 + adds r0, r5 + subs r0, 0x38 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl sub_8097CC4 + add r3, sp, 0x4 + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl sub_8019990 + ldr r0, [sp] + ldr r1, [sp, 0x4] + movs r2, 0 + bl sub_8088B94 + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_801A02C + + thumb_func_start sub_801A064 +sub_801A064: @ 801A064 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r7, r0, 0 + mov r8, r1 + mov r6, sp + adds r6, 0x2 + mov r0, sp + adds r1, r6, 0 + bl PlayerGetDestCoords + add r4, sp, 0x4 + mov r5, sp + adds r5, 0x6 + adds r0, r4, 0 + adds r1, r5, 0 + bl plaer_get_pos_including_state_based_drift + lsls r0, r7, 2 + adds r0, r7 + subs r0, 0x38 + lsls r0, 24 + lsrs r0, 24 + bl sub_8097C8C + mov r10, r6 + mov r9, r4 + adds r6, r5, 0 + cmp r0, 0x1 + bne _0801A0F0 + mov r0, sp + movs r1, 0 + ldrsh r2, [r0, r1] + mov r0, r10 + movs r1, 0 + ldrsh r3, [r0, r1] + adds r0, r7, 0 + movs r1, 0 + bl sub_80199E0 + cmp r0, 0x1 + beq _0801A15C + movs r0, 0 + ldrsh r2, [r4, r0] + movs r1, 0 + ldrsh r3, [r6, r1] + adds r0, r7, 0 + movs r1, 0 + bl sub_80199E0 + cmp r0, 0x1 + beq _0801A15C + mov r2, r8 + ldrb r0, [r2, 0xB] + lsls r0, 31 + lsrs r0, 31 + ldrb r1, [r2, 0x2] + bl sub_8019978 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r7, 0 + movs r1, 0 + mov r3, r8 + bl sub_8019FA4 +_0801A0F0: + movs r5, 0x1 + mov r4, r8 + adds r4, 0x4 +_0801A0F6: + ldrb r0, [r4] + cmp r0, 0 + bne _0801A106 + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_801A02C + b _0801A154 +_0801A106: + mov r0, sp + movs r1, 0 + ldrsh r2, [r0, r1] + mov r0, r10 + movs r1, 0 + ldrsh r3, [r0, r1] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80199E0 + cmp r0, 0 + bne _0801A154 + mov r0, r9 + movs r1, 0 + ldrsh r2, [r0, r1] + movs r0, 0 + ldrsh r3, [r6, r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80199E0 + cmp r0, 0 + bne _0801A154 + ldrb r2, [r4] + lsrs r0, r2, 3 + movs r1, 0x1 + ands r0, r1 + movs r1, 0x7 + ands r1, r2 + bl sub_8019978 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r7, 0 + adds r1, r5, 0 + mov r3, r8 + bl sub_8019FA4 +_0801A154: + adds r4, 0x1 + adds r5, 0x1 + cmp r5, 0x4 + ble _0801A0F6 +_0801A15C: + 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_801A064 + + thumb_func_start sub_801A16C +sub_801A16C: @ 801A16C + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldrb r0, [r4, 0xA] + lsls r0, 25 + lsrs r0, 25 + subs r0, 0x40 + cmp r0, 0x14 + bhi _0801A20E + lsls r0, 2 + ldr r1, =_0801A18C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0801A18C: + .4byte _0801A1E0 + .4byte _0801A200 + .4byte _0801A20E + .4byte _0801A20E + .4byte _0801A200 + .4byte _0801A200 + .4byte _0801A20E + .4byte _0801A20E + .4byte _0801A200 + .4byte _0801A20E + .4byte _0801A20E + .4byte _0801A20E + .4byte _0801A20E + .4byte _0801A20E + .4byte _0801A20E + .4byte _0801A20E + .4byte _0801A20E + .4byte _0801A200 + .4byte _0801A200 + .4byte _0801A200 + .4byte _0801A1E0 +_0801A1E0: + ldrb r1, [r4, 0xB] + lsls r1, 31 + lsrs r1, 31 + ldrb r2, [r4, 0x2] + adds r0, r5, 0 + bl sub_8019CF0 + movs r4, 0 +_0801A1F0: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_801A02C + adds r4, 0x1 + cmp r4, 0x4 + bls _0801A1F0 + b _0801A20E +_0801A200: + adds r0, r5, 0 + bl AGBAssert + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_801A064 +_0801A20E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_801A16C + + thumb_func_start sub_801A214 +sub_801A214: @ 801A214 + push {r4,r5,lr} + adds r5, r0, 0 + bl AGBAssert + movs r4, 0 +_0801A21E: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_801A02C + adds r4, 0x1 + cmp r4, 0x4 + ble _0801A21E + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_801A214 + + thumb_func_start sub_801A234 +sub_801A234: @ 801A234 + push {r4,r5,lr} + ldr r2, =0x02022c68 + movs r1, 0 + str r1, [r2] + movs r5, 0 + ldr r4, [r0] +_0801A240: + ldrb r0, [r4, 0x1A] + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x1 + bne _0801A258 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_801A16C + b _0801A264 + .pool +_0801A258: + cmp r1, 0x2 + bne _0801A264 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_801A214 +_0801A264: + adds r4, 0x20 + adds r5, 0x1 + cmp r5, 0x7 + ble _0801A240 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_801A234 + + thumb_func_start sub_801A274 +sub_801A274: @ 801A274 + ldr r1, =0x02022c68 + movs r0, 0x96 + lsls r0, 1 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_801A274 + + thumb_func_start sub_801A284 +sub_801A284: @ 801A284 + push {lr} + adds r2, r0, 0 + ldr r0, =0x02022c68 + ldr r1, [r0] + adds r1, 0x1 + str r1, [r0] + movs r0, 0x96 + lsls r0, 1 + cmp r1, r0 + bls _0801A29E + adds r0, r2, 0 + bl sub_801A234 +_0801A29E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_801A284 + + thumb_func_start sub_801A2A8 +sub_801A2A8: @ 801A2A8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + adds r5, r0, 0 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + bl is_walking_or_running + cmp r0, 0 + bne _0801A2F0 + b _0801A396 +_0801A2C4: + ldr r4, =gUnknown_082F076A + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r2, [r0] + adds r0, r6, 0 + ldr r1, [sp, 0xC] + bl sub_801A3B0 + ldr r0, [sp, 0x4] + strh r6, [r0] + mov r1, sp + ldrh r2, [r1, 0xC] + ldr r1, [sp, 0x8] + strh r2, [r1] + movs r0, 0x1 + b _0801A398 + .pool +_0801A2F0: + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl GetXYCoordsOneStepInFrontOfPlayer + movs r0, 0 + str r0, [sp, 0xC] + ldr r0, =gUnknown_082F0740 + adds r7, r5, 0 + movs r1, 0 + mov r10, r1 + adds r2, r0, 0x2 + str r2, [sp, 0x10] + str r0, [sp, 0x14] +_0801A30E: + movs r6, 0 + ldr r4, [sp, 0x14] + movs r0, 0 + ldrsh r4, [r4, r0] + mov r9, r4 + ldr r1, [sp, 0x10] + mov r8, r1 + ldr r5, =gUnknown_082F0760 +_0801A31E: + mov r2, r10 + adds r3, r2, r6 + mov r0, sp + movs r4, 0 + ldrsh r1, [r0, r4] + movs r0, 0 + ldrsb r0, [r5, r0] + add r0, r9 + adds r0, 0x7 + cmp r1, r0 + bne _0801A372 + mov r1, sp + movs r2, 0x2 + ldrsh r0, [r1, r2] + mov r4, r8 + movs r2, 0 + ldrsh r1, [r4, r2] + movs r2, 0x1 + ldrsb r2, [r5, r2] + adds r1, r2 + adds r1, 0x7 + cmp r0, r1 + bne _0801A372 + adds r0, r3, 0 + subs r0, 0x38 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_8097C8C + cmp r0, 0 + bne _0801A372 + adds r0, r4, 0 + bl sub_8097D9C + cmp r0, 0 + bne _0801A372 + ldrb r1, [r7, 0x1A] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + beq _0801A2C4 +_0801A372: + adds r5, 0x2 + adds r6, 0x1 + cmp r6, 0x4 + ble _0801A31E + adds r7, 0x20 + movs r4, 0x5 + add r10, r4 + ldr r0, [sp, 0x10] + adds r0, 0x4 + str r0, [sp, 0x10] + ldr r1, [sp, 0x14] + adds r1, 0x4 + str r1, [sp, 0x14] + ldr r2, [sp, 0xC] + adds r2, 0x1 + str r2, [sp, 0xC] + cmp r2, 0x7 + ble _0801A30E +_0801A396: + movs r0, 0 +_0801A398: + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_801A2A8 + + thumb_func_start sub_801A3B0 +sub_801A3B0: @ 801A3B0 + push {r4,lr} + adds r4, r0, 0 + adds r3, r1, 0 + lsls r1, r2, 24 + lsrs r1, 24 + lsls r0, r3, 2 + adds r0, r3 + subs r0, 0x38 + adds r0, r4 + lsls r0, 24 + lsrs r0, 24 + bl sub_8097B78 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_801A3B0 + + thumb_func_start sub_801A3D0 +sub_801A3D0: @ 801A3D0 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + lsls r3, r4, 5 + adds r3, r2 + adds r2, r3, 0 + bl sub_8019F64 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_801A3B0 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_801A3D0 + + thumb_func_start sub_801A3F4 +sub_801A3F4: @ 801A3F4 + push {lr} + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0801A414 + bl RunActiveTasks + bl RunTextPrinters + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably +_0801A414: + pop {r0} + bx r0 + thumb_func_end sub_801A3F4 + + thumb_func_start sub_801A418 +sub_801A418: @ 801A418 + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_801A418 + + thumb_func_start sub_801A42C +sub_801A42C: @ 801A42C + push {lr} + ldr r0, =sub_801A43C + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_801A42C + + thumb_func_start sub_801A43C +sub_801A43C: @ 801A43C + push {r4,r5,lr} + sub sp, 0xC + movs r0, 0 + movs r1, 0 + bl SetGpuReg + ldr r5, =0x03000dac + movs r0, 0x6C + bl AllocZeroed + str r0, [r5] + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_082F0D34 + movs r0, 0 + movs r2, 0x2 + bl InitBgsFromTemplates + movs r4, 0x80 + lsls r4, 4 + adds r0, r4, 0 + bl Alloc + adds r1, r0, 0 + movs r0, 0x1 + bl SetBgTilemapBuffer + adds r0, r4, 0 + bl Alloc + adds r1, r0, 0 + movs r0, 0 + bl SetBgTilemapBuffer + ldr r1, =gUnknown_082F0990 + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, =gUnknown_082F0BA0 + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + ldr r0, =gUnknown_082F0D3C + bl InitWindows + bl DeactivateAllTextPrinters + bl sub_80A1A74 + bl ResetAllObjectData + bl clear_tasks + bl remove_some_task + bl SoundVSyncOn_rev01 + ldr r0, =sub_801A418 + bl SetVBlankCallback + ldr r0, =sub_801A6C0 + movs r1, 0 + bl AddTask + ldr r1, [r5] + adds r1, 0x60 + strb r0, [r1] + bl sub_8013C40 + ldr r1, [r5] + adds r1, 0x61 + strb r0, [r1] + ldr r1, [r5] + movs r0, 0x1 + str r0, [r1, 0x1C] + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + ldr r0, =gUnknown_082F0790 + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0xF0 + bl sub_81978B0 + bl sub_81AFBF0 + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + ldr r0, =sub_801A3F4 + bl SetMainCallback2 + bl RunActiveTasks + bl RunTextPrinters + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801A43C + + thumb_func_start sub_801A584 +sub_801A584: @ 801A584 + push {r4,lr} + bl FreeAllWindowBuffers + movs r4, 0 +_0801A58C: + lsls r0, r4, 24 + lsrs r0, 24 + bl GetBgTilemapBuffer + bl Free + adds r4, 0x1 + cmp r4, 0x1 + ble _0801A58C + ldr r0, =0x03000dac + ldr r0, [r0] + bl Free + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801A584 + + thumb_func_start sub_801A5BC +sub_801A5BC: @ 801A5BC + push {lr} + adds r2, r0, 0 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + ble _0801A5E4 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xE + bne _0801A5E0 + movs r0, 0 + strh r0, [r1] +_0801A5E0: + movs r0, 0 + strh r0, [r2] +_0801A5E4: + movs r2, 0 + ldrsh r0, [r1, r2] + adds r0, 0x2 + lsls r0, 5 + ldr r1, =gUnknown_082F0790 + adds r0, r1 + movs r1, 0 + movs r2, 0x10 + bl gpu_pal_apply + pop {r0} + bx r0 + .pool + thumb_func_end sub_801A5BC + + thumb_func_start sub_801A600 +sub_801A600: @ 801A600 + push {r4,r5,lr} + sub sp, 0x8 + movs r0, 0 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x2 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r5, =gUnknown_082F0D5C + ldr r4, [r5] + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xC0 + bl GetStringCenterAlignXOffset + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x6 + str r0, [sp] + movs r0, 0x3 + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl sub_801A8B0 + movs r1, 0 +_0801A644: + adds r4, r1, 0x1 + lsls r0, r4, 2 + adds r0, r5 + ldr r2, [r0] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 25 + movs r1, 0x80 + lsls r1, 20 + adds r0, r1 + lsrs r0, 24 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r1, 0x1 + movs r3, 0 + bl sub_801A8B0 + adds r1, r4, 0 + cmp r4, 0x2 + ble _0801A644 + ldr r1, =gUnknown_082F0D5C + adds r0, r4, 0x1 + lsls r0, 2 + adds r0, r1 + ldr r2, [r0] + lsls r0, r4, 4 + subs r0, r4 + lsls r0, 25 + movs r1, 0x80 + lsls r1, 20 + adds r0, r1 + lsrs r0, 24 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0 + bl sub_801A8B0 + movs r0, 0 + bl PutWindowTilemap + movs r0, 0 + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0x1 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801A600 + + thumb_func_start sub_801A6C0 +sub_801A6C0: @ 801A6C0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r2, r1, 0 + cmp r0, 0x5 + bls _0801A6E2 + b _0801A89C +_0801A6E2: + lsls r0, 2 + ldr r1, =_0801A6F4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0801A6F4: + .4byte _0801A70C + .4byte _0801A728 + .4byte _0801A74C + .4byte _0801A768 + .4byte _0801A85C + .4byte _0801A884 +_0801A70C: + bl sub_801A600 + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0801A89C + .pool +_0801A728: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + movs r0, 0x1 + bl ShowBg + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0 + bl ShowBg + b _0801A86C +_0801A74C: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0801A75A + b _0801A89C +_0801A75A: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r2 + b _0801A876 + .pool +_0801A768: + ldr r0, =0x03000dac + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0x10 + adds r2, r0, 0 + adds r2, 0x20 + adds r3, r0, 0 + adds r3, 0x61 + ldrb r3, [r3] + bl sub_801AA30 + lsls r1, r5, 2 + mov r8, r1 + cmp r0, 0 + beq _0801A7F8 + movs r0, 0x2 + movs r1, 0 + bl FillWindowPixelBuffer + movs r4, 0 + ldr r6, =0x02021fc4 + movs r7, 0x80 + lsls r7, 20 +_0801A796: + ldr r0, =0x03000dac + ldr r0, [r0] + lsls r1, r4, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r6, 0 + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalString + cmp r4, 0x3 + beq _0801A7CC + lsrs r0, r7, 24 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r0, 0x2 + movs r1, 0x1 + adds r2, r6, 0 + movs r3, 0xC + bl sub_801A8B0 + b _0801A7DE + .pool +_0801A7CC: + movs r0, 0x62 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r1, 0x1 + adds r2, r6, 0 + movs r3, 0xC + bl sub_801A8B0 +_0801A7DE: + movs r2, 0xF0 + lsls r2, 21 + adds r7, r2 + adds r4, 0x1 + cmp r4, 0x3 + ble _0801A796 + movs r0, 0x2 + bl PutWindowTilemap + movs r0, 0x2 + movs r1, 0x3 + bl CopyWindowToVram +_0801A7F8: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0801A80C + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0801A836 +_0801A80C: + movs r0, 0x5 + bl audio_play + ldr r2, =0x03005e00 + ldr r0, =0x03000dac + ldr r0, [r0] + adds r0, 0x61 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0xFF + strh r1, [r0, 0x26] + mov r0, r8 + adds r1, r0, r5 + lsls r1, 3 + adds r1, r2 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_0801A836: + mov r2, r8 + adds r1, r2, r5 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r1, r0 + adds r0, r1, 0 + adds r0, 0xE + adds r1, 0x10 + bl sub_801A5BC + b _0801A89C + .pool +_0801A85C: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe +_0801A86C: + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 +_0801A876: + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + b _0801A89C + .pool +_0801A884: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0801A89C + ldr r0, =sub_801A584 + bl SetMainCallback2 + adds r0, r5, 0 + bl remove_task +_0801A89C: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801A6C0 + + thumb_func_start sub_801A8B0 +sub_801A8B0: @ 801A8B0 + push {r4-r7,lr} + sub sp, 0x18 + mov r12, r2 + ldr r2, [sp, 0x2C] + ldr r4, [sp, 0x30] + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r3, 24 + lsrs r5, r3, 24 + lsls r2, 24 + lsrs r3, r2, 24 + lsls r4, 24 + lsrs r0, r4, 24 + cmp r0, 0x4 + bhi _0801A93A + lsls r0, 2 + ldr r1, =_0801A8E0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0801A8E0: + .4byte _0801A8F4 + .4byte _0801A902 + .4byte _0801A910 + .4byte _0801A91E + .4byte _0801A92C +_0801A8F4: + add r1, sp, 0x14 + movs r0, 0 + strb r0, [r1] + movs r0, 0x2 + strb r0, [r1, 0x1] + movs r0, 0x3 + b _0801A938 +_0801A902: + add r1, sp, 0x14 + movs r0, 0 + strb r0, [r1] + movs r0, 0x1 + strb r0, [r1, 0x1] + movs r0, 0x3 + b _0801A938 +_0801A910: + add r1, sp, 0x14 + movs r0, 0 + strb r0, [r1] + movs r0, 0x4 + strb r0, [r1, 0x1] + movs r0, 0x5 + b _0801A938 +_0801A91E: + add r1, sp, 0x14 + movs r0, 0 + strb r0, [r1] + movs r0, 0x7 + strb r0, [r1, 0x1] + movs r0, 0x6 + b _0801A938 +_0801A92C: + add r1, sp, 0x14 + movs r0, 0 + strb r0, [r1] + movs r0, 0x1 + strb r0, [r1, 0x1] + movs r0, 0x2 +_0801A938: + strb r0, [r1, 0x2] +_0801A93A: + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + add r0, sp, 0x14 + str r0, [sp, 0x8] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0xC] + mov r0, r12 + str r0, [sp, 0x10] + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r5, 0 + bl AddTextPrinterParametrized2 + add sp, 0x18 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_801A8B0 + + thumb_func_start sub_801A960 +sub_801A960: @ 801A960 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r12, r0 + adds r7, r1, 0 + ldrb r0, [r0, 0xA] + lsls r0, 25 + lsrs r0, 25 + mov r8, r0 + movs r4, 0 + ldr r0, =gUnknown_082F0D70 + mov r9, r0 + movs r1, 0x1 + add r1, r9 + mov r10, r1 + mov r3, r12 + adds r3, 0x4 + str r3, [sp] +_0801A98A: + lsls r0, r4, 1 + adds r2, r0, r4 + mov r3, r9 + adds r1, r2, r3 + adds r5, r0, 0 + adds r6, r4, 0x1 + ldrb r1, [r1] + cmp r8, r1 + bne _0801A9EE + mov r0, r12 + ldrb r1, [r0, 0x1A] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + bne _0801A9EE + mov r0, r9 + adds r0, 0x2 + adds r3, r2, r0 + ldrb r0, [r3] + cmp r0, 0 + bne _0801A9DC + movs r2, 0 + movs r1, 0 + ldr r3, [sp] +_0801A9BA: + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0801A9C4 + adds r2, 0x1 +_0801A9C4: + adds r1, 0x1 + cmp r1, 0x3 + ble _0801A9BA + adds r2, 0x1 + adds r0, r5, r4 + add r0, r10 + ldrb r1, [r0] + lsls r1, 2 + adds r1, r7 + b _0801A9E8 + .pool +_0801A9DC: + mov r1, r10 + adds r0, r2, r1 + ldrb r1, [r0] + lsls r1, 2 + adds r1, r7 + ldrb r2, [r3] +_0801A9E8: + ldr r0, [r1] + adds r0, r2 + str r0, [r1] +_0801A9EE: + adds r4, r6, 0 + cmp r4, 0x1E + bls _0801A98A + 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 + thumb_func_end sub_801A960 + + thumb_func_start sub_801AA08 +sub_801AA08: @ 801AA08 + push {r4,lr} + movs r4, 0 + adds r3, r1, 0 + adds r2, r0, 0 +_0801AA10: + ldr r1, [r2] + ldr r0, [r3] + cmp r1, r0 + beq _0801AA1C + movs r0, 0x1 + b _0801AA28 +_0801AA1C: + adds r3, 0x4 + adds r2, 0x4 + adds r4, 0x1 + cmp r4, 0x3 + ble _0801AA10 + movs r0, 0 +_0801AA28: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801AA08 + + thumb_func_start sub_801AA30 +sub_801AA30: @ 801AA30 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + adds r6, r0, 0 + mov r9, r1 + adds r5, r2, 0 + lsls r4, r3, 24 + lsrs r4, 24 + movs r0, 0 + mov r8, r0 + mov r0, sp + movs r1, 0 + movs r2, 0x10 + bl memset + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r7, r0, r1 + movs r4, 0 +_0801AA5E: + lsls r1, r4, 5 + ldr r0, [r7] + adds r0, r1 + mov r1, sp + bl sub_801A960 + adds r1, r0, 0 + ldr r0, [r5] + cmp r1, r0 + beq _0801AA78 + str r1, [r5] + movs r2, 0x1 + mov r8, r2 +_0801AA78: + adds r5, 0x4 + adds r4, 0x1 + cmp r4, 0xF + ble _0801AA5E + mov r0, sp + mov r1, r9 + bl sub_801AA08 + cmp r0, 0 + bne _0801AA9C + mov r3, r8 + cmp r3, 0x1 + beq _0801AAC4 + movs r0, 0 + b _0801AAC6 + .pool +_0801AA9C: + adds r1, r6, 0 + mov r0, sp + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r0, [r0] + str r0, [r1] + mov r1, r9 + mov r0, sp + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r0, [r0] + str r0, [r1] + ldr r0, [r6] + ldr r1, [r6, 0x4] + adds r0, r1 + ldr r1, [r6, 0x8] + adds r0, r1 + ldr r1, [r6, 0xC] + adds r0, r1 + str r0, [r6, 0xC] +_0801AAC4: + movs r0, 0x1 +_0801AAC6: + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_801AA30 + + thumb_func_start sub_801AAD4 +sub_801AAD4: @ 801AAD4 + push {r4-r7,lr} + movs r0, 0xA + bl sub_8014210 + movs r4, 0 + movs r7, 0x64 + ldr r6, =0x020244ec + ldr r5, =0x02024744 +_0801AAE4: + ldr r0, =0x0203cef8 + adds r0, r4, r0 + ldrb r0, [r0] + subs r0, 0x1 + adds r1, r0, 0 + muls r1, r7 + adds r1, r6 + adds r0, r5, 0 + movs r2, 0x64 + bl memcpy + adds r5, 0x64 + adds r4, 0x1 + cmp r4, 0x1 + ble _0801AAE4 + ldr r4, =0x020244ec + movs r0, 0xFA + lsls r0, 1 + adds r5, r4, r0 +_0801AB0A: + adds r0, r4, 0 + bl zero_pokemon_struct + adds r4, 0x64 + cmp r4, r5 + ble _0801AB0A + ldr r4, =0x020244ec + movs r5, 0 + adds r6, r4, 0 + adds r6, 0x64 +_0801AB1E: + ldr r1, =0x02024744 + adds r1, r5, r1 + adds r0, r4, 0 + movs r2, 0x64 + bl memcpy + adds r4, 0x64 + adds r5, 0x64 + cmp r4, r6 + ble _0801AB1E + movs r0, 0x32 + bl sav12_xor_increment + bl calc_player_party_count + ldr r0, =0x02038bca + movs r2, 0xC0 + lsls r2, 4 + adds r1, r2, 0 + strh r1, [r0] + ldr r0, =sub_8036760 + bl SetMainCallback2 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801AAD4 + + thumb_func_start sub_801AB68 +sub_801AB68: @ 801AB68 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + adds r5, r0, 0 + adds r7, r1, 0 + adds r6, r2, 0 + ldr r4, [sp, 0x38] + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0 + mov r9, r0 + movs r1, 0x1 + mov r10, r1 + ldr r0, =gUnknown_082F0DE4 + mov r8, r0 + ldrb r0, [r0] + lsls r1, r0, 4 + orrs r1, r0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + str r3, [sp, 0x14] + bl FillWindowPixelBuffer + mov r1, r9 + str r1, [sp] + mov r0, r10 + str r0, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + lsls r4, 24 + asrs r4, 24 + str r4, [sp, 0xC] + str r7, [sp, 0x10] + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r6, 0 + ldr r3, [sp, 0x14] + bl AddTextPrinterParametrized2 + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801AB68 + + thumb_func_start sub_801ABDC +sub_801ABDC: @ 801ABDC + push {r4-r6,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r6, r1, 0 + adds r5, r2, 0 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0801ABF4 + cmp r0, 0x1 + beq _0801AC22 + b _0801AC36 +_0801ABF4: + movs r0, 0 + movs r1, 0x1 + movs r2, 0xD + bl sub_8098858 + str r5, [sp] + movs r0, 0 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_801AB68 + movs r0, 0 + bl PutWindowTilemap + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _0801AC36 +_0801AC22: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _0801AC36 + strh r0, [r4] + movs r0, 0x1 + b _0801AC38 +_0801AC36: + movs r0, 0 +_0801AC38: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_801ABDC + + thumb_func_start sub_801AC40 +sub_801AC40: @ 801AC40 + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_801AC40 + + thumb_func_start sub_801AC54 +sub_801AC54: @ 801AC54 + push {r4,lr} + sub sp, 0xC + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0x33 + bls _0801AC6A + b _0801AFAE +_0801AC6A: + lsls r0, 2 + ldr r1, =_0801AC7C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0801AC7C: + .4byte _0801AD4C + .4byte _0801ADFC + .4byte _0801AE24 + .4byte _0801AE48 + .4byte _0801AE98 + .4byte _0801AFAE + .4byte _0801AF7C + .4byte _0801AF58 + .4byte _0801AF7C + .4byte _0801AF98 + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AFAE + .4byte _0801AF24 + .4byte _0801AF40 +_0801AD4C: + movs r0, 0 + movs r1, 0 + bl SetGpuReg + ldr r4, =0x02022c6c + movs r0, 0x4 + bl AllocZeroed + str r0, [r4] + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + bl clear_tasks + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_082F0DD0 + movs r0, 0 + movs r2, 0x1 + bl InitBgsFromTemplates + bl reset_temp_tile_data_buffers + ldr r0, =gUnknown_082F0DD4 + bl InitWindows + lsls r0, 16 + cmp r0, 0 + bne _0801AD8C + b _0801AFC2 +_0801AD8C: + bl DeactivateAllTextPrinters + movs r0, 0 + bl ClearWindowTilemap + movs r0, 0 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r0, 0x1E + str r0, [sp] + movs r0, 0x14 + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect + movs r0, 0 + movs r1, 0x1 + movs r2, 0xD0 + bl sub_809882C + movs r0, 0 + movs r1, 0x1 + movs r2, 0xD0 + bl box_border_load_tiles_and_pal + bl sub_819789C + ldr r0, =sub_801AC40 + bl SetVBlankCallback + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0801AF8A + .pool +_0801ADFC: + ldr r0, =0x02022c6c + ldr r0, [r0] + ldr r1, =gUnknown_085EFBD2 + movs r2, 0 + bl sub_801ABDC + cmp r0, 0 + bne _0801AE0E + b _0801AFAE +_0801AE0E: + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _0801AF8A + .pool +_0801AE24: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + movs r0, 0 + bl ShowBg + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0801AF8A + .pool +_0801AE48: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + beq _0801AE54 + b _0801AFAE +_0801AE54: + ldr r4, =0x020228c4 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x20 + bl memset + ldr r0, =0x0203cef8 + ldrb r1, [r0] + ldrb r0, [r0, 0x1] + cmn r1, r0 + bne _0801AE78 + movs r0, 0x52 + b _0801AE7A + .pool +_0801AE78: + movs r0, 0x51 +_0801AE7A: + strb r0, [r4] + ldr r1, =0x020228c4 + movs r0, 0 + movs r2, 0x20 + bl link_0800A448 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _0801AF8A + .pool +_0801AE98: + bl sub_800A550 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + beq _0801AEA6 + b _0801AFAE +_0801AEA6: + ldr r1, =0x020223c4 + ldrh r0, [r1] + cmp r0, 0x51 + bne _0801AEE0 + movs r2, 0x80 + lsls r2, 1 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, 0x51 + bne _0801AEE0 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x32 + b _0801AF16 + .pool +_0801AEE0: + bl sub_800AC34 + ldr r4, =0x020223c4 + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 16 + adds r0, r4 + ldrh r0, [r0] + cmp r0, 0x52 + bne _0801AF0C + ldr r0, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x6 + b _0801AF16 + .pool +_0801AF0C: + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x8 +_0801AF16: + strb r1, [r0] + bl sub_800A5B4 + b _0801AFAE + .pool +_0801AF24: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _0801AFAE + bl sub_800ADF8 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _0801AF8A + .pool +_0801AF40: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _0801AFAE + ldr r0, =sub_801AAD4 + bl SetMainCallback2 + b _0801AFAE + .pool +_0801AF58: + ldr r0, =0x02022c6c + ldr r0, [r0] + ldr r1, =gUnknown_085EFC27 + movs r2, 0x1 + bl sub_801ABDC + cmp r0, 0 + beq _0801AFAE + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + b _0801AFAE + .pool +_0801AF7C: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _0801AFAE + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 +_0801AF8A: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0801AFAE + .pool +_0801AF98: + ldr r0, =0x02022c6c + ldr r0, [r0] + ldr r1, =gUnknown_085EFC0C + movs r2, 0x1 + bl sub_801ABDC + cmp r0, 0 + beq _0801AFAE + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 +_0801AFAE: + bl RunActiveTasks + bl RunTextPrinters + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably +_0801AFC2: + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801AC54 + + thumb_func_start sub_801AFD8 +sub_801AFD8: @ 801AFD8 + push {lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r0, =0x0000322c + adds r1, r0 + ldr r2, =0x050000db + mov r0, sp + bl CpuSet + bl sub_801B180 + bl sub_811F8BC + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_801AFD8 + + thumb_func_start sub_801B00C +sub_801B00C: @ 801B00C + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003230 + adds r0, r1 + bx lr + .pool + thumb_func_end sub_801B00C + + thumb_func_start sav1_get_mevent_buffer_1 +sav1_get_mevent_buffer_1: @ 801B020 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x000033f0 + adds r0, r1 + bx lr + .pool + thumb_func_end sav1_get_mevent_buffer_1 + + thumb_func_start sav1_get_mevent_buffer_2 +sav1_get_mevent_buffer_2: @ 801B034 + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r1, 0xD5 + lsls r1, 6 + adds r0, r1 + bx lr + .pool + thumb_func_end sav1_get_mevent_buffer_2 + + thumb_func_start sub_801B044 +sub_801B044: @ 801B044 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x0000356c + adds r0, r1 + bx lr + .pool + thumb_func_end sub_801B044 + + thumb_func_start sub_801B058 +sub_801B058: @ 801B058 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003564 + adds r0, r1 + bx lr + .pool + thumb_func_end sub_801B058 + + thumb_func_start sub_801B06C +sub_801B06C: @ 801B06C + push {lr} + bl sub_801B14C + pop {r0} + bx r0 + thumb_func_end sub_801B06C + + thumb_func_start sub_801B078 +sub_801B078: @ 801B078 + push {r4-r7,lr} + adds r7, r0, 0 + bl sub_801B114 + cmp r0, 0 + beq _0801B0C4 + bl sub_801B14C + ldr r4, =0x03005d8c + ldr r0, [r4] + ldr r5, =0x00003230 + adds r0, r5 + movs r6, 0xDE + lsls r6, 1 + adds r1, r7, 0 + adds r2, r6, 0 + bl memcpy + ldr r0, [r4] + adds r0, r5 + adds r1, r6, 0 + bl sub_806F928 + ldr r1, [r4] + ldr r2, =0x0000322c + adds r1, r2 + lsls r0, 16 + lsrs r0, 16 + str r0, [r1] + movs r0, 0x1 + b _0801B0C6 + .pool +_0801B0C4: + movs r0, 0 +_0801B0C6: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_801B078 + + thumb_func_start sub_801B0CC +sub_801B0CC: @ 801B0CC + push {r4,lr} + ldr r4, =0x03005d8c + ldr r0, [r4] + ldr r1, =0x00003230 + adds r0, r1 + movs r1, 0xDE + lsls r1, 1 + bl sub_806F928 + lsls r0, 16 + lsrs r0, 16 + ldr r4, [r4] + ldr r2, =0x0000322c + adds r1, r4, r2 + ldr r1, [r1] + cmp r0, r1 + bne _0801B10C + ldr r1, =0x00003230 + adds r0, r4, r1 + bl sub_801B114 + cmp r0, 0 + beq _0801B10C + movs r0, 0x1 + b _0801B10E + .pool +_0801B10C: + movs r0, 0 +_0801B10E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801B0CC + + thumb_func_start sub_801B114 +sub_801B114: @ 801B114 + push {lr} + ldrh r0, [r0] + cmp r0, 0 + beq _0801B120 + movs r0, 0x1 + b _0801B122 +_0801B120: + movs r0, 0 +_0801B122: + pop {r1} + bx r1 + thumb_func_end sub_801B114 + + thumb_func_start sub_801B128 +sub_801B128: @ 801B128 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003230 + adds r0, r1 + ldrb r0, [r0, 0x2] + cmp r0, 0 + beq _0801B144 + movs r0, 0x1 + b _0801B146 + .pool +_0801B144: + movs r0, 0 +_0801B146: + pop {r1} + bx r1 + thumb_func_end sub_801B128 + + thumb_func_start sub_801B14C +sub_801B14C: @ 801B14C + push {r4,lr} + sub sp, 0x4 + movs r4, 0 + str r4, [sp] + bl sub_801B00C + adds r1, r0, 0 + ldr r2, =0x0500006f + mov r0, sp + bl CpuSet + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x0000322c + adds r0, r1 + str r4, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801B14C + + thumb_func_start sub_801B180 +sub_801B180: @ 801B180 + push {lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + bl sub_801B044 + adds r1, r0, 0 + ldr r2, =0x05000001 + mov r0, sp + bl CpuSet + bl sub_801DBC0 + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_801B180 + + thumb_func_start sub_801B1A4 +sub_801B1A4: @ 801B1A4 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003230 + adds r4, r0, r1 + bl sub_801B0CC + cmp r0, 0 + bne _0801B1C4 +_0801B1B8: + movs r0, 0 + b _0801B1DC + .pool +_0801B1C4: + movs r2, 0 + ldr r3, =0x000001bb +_0801B1C8: + adds r0, r4, r2 + adds r1, r5, r2 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bne _0801B1B8 + adds r2, 0x1 + cmp r2, r3 + bls _0801B1C8 + movs r0, 0x1 +_0801B1DC: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_801B1A4 + + thumb_func_start sub_801B1E8 +sub_801B1E8: @ 801B1E8 + push {lr} + bl sub_801B330 + bl sub_801B368 + bl sub_801B9F8 + bl killram + bl sub_809D4D8 + bl sub_809D570 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000bec + adds r0, r1 + bl sub_816534C + pop {r0} + bx r0 + .pool + thumb_func_end sub_801B1E8 + + thumb_func_start sub_801B21C +sub_801B21C: @ 801B21C + push {r4-r7,lr} + adds r7, r0, 0 + bl sub_801B2CC + cmp r0, 0 + beq _0801B274 + bl sub_801B1E8 + ldr r4, =0x03005d8c + ldr r0, [r4] + ldr r5, =0x000033f0 + adds r0, r5 + movs r6, 0xA6 + lsls r6, 1 + adds r1, r7, 0 + adds r2, r6, 0 + bl memcpy + ldr r0, [r4] + adds r0, r5 + adds r1, r6, 0 + bl sub_806F928 + ldr r1, [r4] + ldr r3, =0x000033ec + adds r2, r1, r3 + lsls r0, 16 + lsrs r0, 16 + str r0, [r2] + movs r0, 0xD5 + lsls r0, 6 + adds r2, r1, r0 + adds r1, r5 + ldrh r0, [r1, 0x2] + strh r0, [r2, 0x6] + movs r0, 0x1 + b _0801B276 + .pool +_0801B274: + movs r0, 0 +_0801B276: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_801B21C + + thumb_func_start sub_801B27C +sub_801B27C: @ 801B27C + push {r4,r5,lr} + ldr r5, =0x03005d8c + ldr r0, [r5] + ldr r1, =0x000033ec + adds r4, r0, r1 + adds r1, 0x4 + adds r0, r1 + movs r1, 0xA6 + lsls r1, 1 + bl sub_806F928 + lsls r0, 16 + lsrs r0, 16 + ldr r1, [r4] + cmp r1, r0 + bne _0801B2C4 + ldr r0, [r5] + ldr r1, =0x000033f0 + adds r0, r1 + bl sub_801B2CC + cmp r0, 0 + beq _0801B2C4 + bl sub_80991F8 + cmp r0, 0 + beq _0801B2C4 + movs r0, 0x1 + b _0801B2C6 + .pool +_0801B2C4: + movs r0, 0 +_0801B2C6: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_801B27C + + thumb_func_start sub_801B2CC +sub_801B2CC: @ 801B2CC + push {lr} + adds r2, r0, 0 + ldrh r0, [r2] + cmp r0, 0 + beq _0801B302 + ldrb r1, [r2, 0x8] + lsls r0, r1, 30 + lsrs r0, 30 + cmp r0, 0x2 + bhi _0801B302 + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0 + beq _0801B2F0 + cmp r0, 0x40 + beq _0801B2F0 + cmp r0, 0x80 + bne _0801B302 +_0801B2F0: + lsls r0, r1, 26 + lsrs r0, 28 + cmp r0, 0x7 + bhi _0801B302 + ldrb r0, [r2, 0x9] + cmp r0, 0x7 + bhi _0801B302 + movs r0, 0x1 + b _0801B304 +_0801B302: + movs r0, 0 +_0801B304: + pop {r1} + bx r1 + thumb_func_end sub_801B2CC + + thumb_func_start sub_801B308 +sub_801B308: @ 801B308 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x000033f0 + adds r0, r1 + ldrb r1, [r0, 0x8] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0 + beq _0801B328 + movs r0, 0x1 + b _0801B32A + .pool +_0801B328: + movs r0, 0 +_0801B32A: + pop {r1} + bx r1 + thumb_func_end sub_801B308 + + thumb_func_start sub_801B330 +sub_801B330: @ 801B330 + push {r4,r5,lr} + sub sp, 0x4 + movs r5, 0 + str r5, [sp] + ldr r4, =0x03005d8c + ldr r1, [r4] + ldr r0, =0x000033f0 + adds r1, r0 + ldr r2, =0x05000053 + mov r0, sp + bl CpuSet + ldr r0, [r4] + ldr r1, =0x000033ec + adds r0, r1 + str r5, [r0] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801B330 + + thumb_func_start sub_801B368 +sub_801B368: @ 801B368 + push {r4,lr} + sub sp, 0x4 + movs r4, 0 + str r4, [sp] + bl sav1_get_mevent_buffer_2 + adds r1, r0, 0 + ldr r2, =0x05000009 + mov r0, sp + bl CpuSet + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x0000353c + adds r0, r1 + str r4, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801B368 + + thumb_func_start sub_801B39C +sub_801B39C: @ 801B39C + push {lr} + bl sub_801B27C + cmp r0, 0 + bne _0801B3AA + movs r0, 0 + b _0801B3B4 +_0801B3AA: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x000033f0 + adds r0, r1 + ldrh r0, [r0] +_0801B3B4: + pop {r1} + bx r1 + .pool + thumb_func_end sub_801B39C + + thumb_func_start sub_801B3C0 +sub_801B3C0: @ 801B3C0 + push {lr} + adds r2, r0, 0 + ldrb r1, [r2, 0x8] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0x40 + bne _0801B3D4 + movs r0, 0x3F + ands r0, r1 + strb r0, [r2, 0x8] +_0801B3D4: + pop {r0} + bx r0 + thumb_func_end sub_801B3C0 + + thumb_func_start sub_801B3D8 +sub_801B3D8: @ 801B3D8 + push {lr} + lsls r0, 16 + ldr r1, =0xfc180000 + adds r0, r1 + lsrs r0, 16 + cmp r0, 0x13 + bls _0801B3F0 + movs r0, 0 + b _0801B3F2 + .pool +_0801B3F0: + movs r0, 0x1 +_0801B3F2: + pop {r1} + bx r1 + thumb_func_end sub_801B3D8 + + thumb_func_start sub_801B3F8 +sub_801B3F8: @ 801B3F8 + push {r4,lr} + bl sub_801B39C + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl sub_801B3D8 + cmp r0, 0 + beq _0801B430 + ldr r1, =gUnknown_082F0DE8 + ldr r2, =0xfffffc18 + adds r0, r4, r2 + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0801B430 + movs r0, 0x1 + b _0801B432 + .pool +_0801B430: + movs r0, 0 +_0801B432: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801B3F8 + + thumb_func_start sub_801B438 +sub_801B438: @ 801B438 + push {lr} + movs r3, 0 + cmp r3, r1 + bge _0801B45A + adds r2, r0, 0 + adds r2, 0x8 +_0801B444: + ldrh r0, [r2, 0xE] + cmp r0, 0 + beq _0801B452 + ldrh r0, [r2] + cmp r0, 0 + beq _0801B452 + adds r3, 0x1 +_0801B452: + adds r2, 0x2 + subs r1, 0x1 + cmp r1, 0 + bne _0801B444 +_0801B45A: + adds r0, r3, 0 + pop {r1} + bx r1 + thumb_func_end sub_801B438 + + thumb_func_start sub_801B460 +sub_801B460: @ 801B460 + push {r4-r7,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r1, 0 + cmp r1, r2 + bge _0801B49A + ldrh r6, [r4, 0x2] + movs r0, 0x16 + adds r0, r5 + mov r12, r0 +_0801B474: + lsls r3, r1, 1 + mov r7, r12 + ldrh r0, [r7] + cmp r0, r6 + beq _0801B48C + adds r0, r5, 0 + adds r0, 0x8 + adds r0, r3 + ldrh r0, [r0] + ldrh r3, [r4] + cmp r0, r3 + bne _0801B490 +_0801B48C: + movs r0, 0x1 + b _0801B49C +_0801B490: + movs r7, 0x2 + add r12, r7 + adds r1, 0x1 + cmp r1, r2 + blt _0801B474 +_0801B49A: + movs r0, 0 +_0801B49C: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_801B460 + + thumb_func_start sub_801B4A4 +sub_801B4A4: @ 801B4A4 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x2] + cmp r0, 0 + beq _0801B4C4 + ldrh r1, [r1] + cmp r1, 0 + beq _0801B4C4 + ldr r0, =0x0000019b + cmp r1, r0 + bhi _0801B4C4 + movs r0, 0x1 + b _0801B4C6 + .pool +_0801B4C4: + movs r0, 0 +_0801B4C6: + pop {r1} + bx r1 + thumb_func_end sub_801B4A4 + + thumb_func_start sub_801B4CC +sub_801B4CC: @ 801B4CC + push {lr} + bl sub_801B27C + cmp r0, 0 + beq _0801B500 + ldr r0, =0x03005d8c + ldr r3, [r0] + ldr r0, =0x000033f0 + adds r2, r3, r0 + ldrb r1, [r2, 0x8] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + bne _0801B500 + movs r1, 0xD5 + lsls r1, 6 + adds r0, r3, r1 + ldrb r1, [r2, 0x9] + bl sub_801B438 + b _0801B502 + .pool +_0801B500: + movs r0, 0 +_0801B502: + pop {r1} + bx r1 + thumb_func_end sub_801B4CC + + thumb_func_start sub_801B508 +sub_801B508: @ 801B508 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, =0x03005d8c + ldr r0, [r6] + ldr r1, =0x000033f0 + adds r0, r1 + ldrb r4, [r0, 0x9] + adds r0, r5, 0 + bl sub_801B4A4 + cmp r0, 0 + beq _0801B572 + ldr r0, [r6] + movs r1, 0xD5 + lsls r1, 6 + adds r0, r1 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_801B460 + cmp r0, 0 + beq _0801B54C + b _0801B572 + .pool +_0801B540: + ldrh r0, [r5, 0x2] + strh r0, [r1] + ldrh r0, [r5] + strh r0, [r2] + movs r0, 0x1 + b _0801B574 +_0801B54C: + movs r3, 0 + cmp r3, r4 + bge _0801B572 + ldr r0, [r6] + ldr r6, =0x00003548 + adds r2, r0, r6 + adds r6, 0xE + adds r1, r0, r6 +_0801B55C: + ldrh r0, [r2, 0xE] + cmp r0, 0 + bne _0801B568 + ldrh r0, [r2] + cmp r0, 0 + beq _0801B540 +_0801B568: + adds r2, 0x2 + adds r1, 0x2 + adds r3, 0x1 + cmp r3, r4 + blt _0801B55C +_0801B572: + movs r0, 0 +_0801B574: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_801B508 + + thumb_func_start sub_801B580 +sub_801B580: @ 801B580 + 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 + movs r0, 0 + str r0, [sp] + ldr r2, =0x05000019 + mov r0, sp + adds r1, r5, 0 + bl CpuSet + ldr r0, =0x00000101 + str r0, [r5] + movs r0, 0x1 + strh r0, [r5, 0x4] + str r0, [r5, 0x8] + cmp r4, 0 + beq _0801B5C0 + movs r0, 0x5 + strh r0, [r5, 0xC] + ldr r0, =0x00000201 + b _0801B5C8 + .pool +_0801B5C0: + movs r0, 0x4 + strh r0, [r5, 0xC] + movs r0, 0x80 + lsls r0, 2 +_0801B5C8: + str r0, [r5, 0x10] + bl sub_801B27C + cmp r0, 0 + beq _0801B5FC + bl sav1_get_mevent_buffer_1 + ldrh r0, [r0] + strh r0, [r5, 0x14] + bl sav1_get_mevent_buffer_2 + adds r1, r5, 0 + adds r1, 0x20 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + bl sav1_get_mevent_buffer_1 + ldrb r1, [r0, 0x9] + adds r0, r5, 0 + adds r0, 0x44 + strb r1, [r0] + b _0801B5FE +_0801B5FC: + strh r0, [r5, 0x14] +_0801B5FE: + adds r4, r5, 0 + adds r4, 0x4C + ldr r0, =0x03005d90 + mov r8, r0 + adds r6, r5, 0 + adds r6, 0x45 + adds r7, r5, 0 + adds r7, 0x50 + movs r1, 0x5C + adds r1, r5 + mov r9, r1 + movs r2, 0x60 + adds r2, r5 + mov r10, r2 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r3, =0x00003564 + adds r2, r0, r3 + adds r1, r5, 0 + adds r1, 0x16 + movs r3, 0x3 +_0801B628: + ldrh r0, [r2] + strh r0, [r1] + adds r2, 0x2 + adds r1, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _0801B628 + mov r0, r8 + ldr r1, [r0] + adds r1, 0xA + adds r0, r4, 0 + bl sub_80842F4 + mov r2, r8 + ldr r1, [r2] + adds r0, r6, 0 + bl CopyString + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r3, =0x00002bb0 + adds r2, r0, r3 + adds r1, r7, 0 + movs r3, 0x5 +_0801B658: + ldrh r0, [r2] + strh r0, [r1] + adds r2, 0x2 + adds r1, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _0801B658 + ldr r1, =RomHeaderGameCode + mov r0, r9 + movs r2, 0x4 + bl memcpy + ldr r0, =RomHeaderSoftwareVersion + ldrb r0, [r0] + mov r4, r10 + strb r0, [r4] + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801B580 + + thumb_func_start sub_801B6A0 +sub_801B6A0: @ 801B6A0 + push {r4,lr} + adds r2, r0, 0 + adds r4, r1, 0 + ldr r1, [r2] + ldr r0, =0x00000101 + cmp r1, r0 + bne _0801B6DC + ldrh r1, [r2, 0x4] + movs r3, 0x1 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _0801B6DC + ldr r0, [r2, 0x8] + ands r0, r3 + cmp r0, 0 + beq _0801B6DC + cmp r4, 0 + bne _0801B6E4 + ldrh r1, [r2, 0xC] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0801B6DC + ldr r0, [r2, 0x10] + movs r1, 0xE0 + lsls r1, 2 + ands r0, r1 + cmp r0, 0 + bne _0801B6E4 +_0801B6DC: + movs r0, 0 + b _0801B6E6 + .pool +_0801B6E4: + movs r0, 0x1 +_0801B6E6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801B6A0 + + thumb_func_start sub_801B6EC +sub_801B6EC: @ 801B6EC + push {lr} + ldrh r1, [r1, 0x14] + cmp r1, 0 + bne _0801B6F8 + movs r0, 0 + b _0801B704 +_0801B6F8: + ldrh r0, [r0] + cmp r0, r1 + beq _0801B702 + movs r0, 0x2 + b _0801B704 +_0801B702: + movs r0, 0x1 +_0801B704: + pop {r1} + bx r1 + thumb_func_end sub_801B6EC + + thumb_func_start sub_801B708 +sub_801B708: @ 801B708 + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r5, r4, 0 + adds r5, 0x20 + adds r4, 0x44 + ldrb r1, [r4] + adds r0, r5, 0 + bl sub_801B438 + ldrb r2, [r4] + subs r4, r2, r0 + cmp r4, 0 + bne _0801B728 + movs r0, 0x1 + b _0801B742 +_0801B728: + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_801B460 + cmp r0, 0 + beq _0801B738 + movs r0, 0x3 + b _0801B742 +_0801B738: + cmp r4, 0x1 + beq _0801B740 + movs r0, 0x2 + b _0801B742 +_0801B740: + movs r0, 0x4 +_0801B742: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_801B708 + + thumb_func_start sub_801B748 +sub_801B748: @ 801B748 + push {r4,lr} + movs r3, 0 + adds r2, r0, 0 + adds r2, 0x16 +_0801B750: + ldrh r0, [r2] + ldrh r4, [r1] + cmp r0, r4 + beq _0801B75C + movs r0, 0 + b _0801B768 +_0801B75C: + adds r1, 0x2 + adds r2, 0x2 + adds r3, 0x1 + cmp r3, 0x3 + ble _0801B750 + movs r0, 0x1 +_0801B768: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801B748 + + thumb_func_start sub_801B770 +sub_801B770: @ 801B770 + push {lr} + adds r2, r0, 0 + adds r2, 0x20 + adds r0, 0x44 + ldrb r1, [r0] + adds r0, r2, 0 + bl sub_801B438 + pop {r1} + bx r1 + thumb_func_end sub_801B770 + + thumb_func_start sub_801B784 +sub_801B784: @ 801B784 + push {lr} + adds r2, r0, 0 + cmp r1, 0x4 + bhi _0801B7D0 + lsls r0, r1, 2 + ldr r1, =_0801B79C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0801B79C: + .4byte _0801B7B0 + .4byte _0801B7B4 + .4byte _0801B7B8 + .4byte _0801B7BC + .4byte _0801B7C8 +_0801B7B0: + ldrh r0, [r2, 0x20] + b _0801B7D2 +_0801B7B4: + ldrh r0, [r2, 0x22] + b _0801B7D2 +_0801B7B8: + ldrh r0, [r2, 0x24] + b _0801B7D2 +_0801B7BC: + adds r0, r2, 0 + bl sub_801B770 + lsls r0, 16 + lsrs r0, 16 + b _0801B7D2 +_0801B7C8: + adds r0, r2, 0 + adds r0, 0x44 + ldrb r0, [r0] + b _0801B7D2 +_0801B7D0: + movs r0, 0 +_0801B7D2: + pop {r1} + bx r1 + thumb_func_end sub_801B784 + + thumb_func_start sub_801B7D8 +sub_801B7D8: @ 801B7D8 + push {r4,lr} + adds r4, r0, 0 + ldr r2, =0x03005d8c + ldr r0, [r2] + ldr r1, =0x000033f0 + adds r0, r1 + ldrb r1, [r0, 0x8] + movs r0, 0x3 + ands r0, r1 + adds r3, r2, 0 + cmp r0, 0x2 + bne _0801B850 + movs r2, 0 + cmp r4, 0x4 + bhi _0801B83A + lsls r0, r4, 2 + ldr r1, =_0801B80C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0801B80C: + .4byte _0801B820 + .4byte _0801B828 + .4byte _0801B834 + .4byte _0801B83A + .4byte _0801B83A +_0801B820: + ldr r0, [r3] + movs r1, 0xD5 + lsls r1, 6 + b _0801B838 +_0801B828: + ldr r0, [r3] + ldr r1, =0x00003542 + b _0801B838 + .pool +_0801B834: + ldr r0, [r3] + ldr r1, =0x00003544 +_0801B838: + adds r2, r0, r1 +_0801B83A: + cmp r2, 0 + beq _0801B850 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x000003e7 + cmp r0, r1 + bls _0801B850 + strh r1, [r2] +_0801B850: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801B7D8 + + thumb_func_start mevent_081445C0 +mevent_081445C0: @ 801B860 + push {lr} + cmp r0, 0x4 + bhi _0801B938 + lsls r0, 2 + ldr r1, =_0801B874 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0801B874: + .4byte _0801B888 + .4byte _0801B8AC + .4byte _0801B8D0 + .4byte _0801B8F4 + .4byte _0801B918 +_0801B888: + ldr r0, =0x03005d8c + ldr r2, [r0] + ldr r1, =0x000033f0 + adds r0, r2, r1 + ldrb r1, [r0, 0x8] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + bne _0801B938 + movs r1, 0xD5 + lsls r1, 6 + adds r0, r2, r1 + ldrh r0, [r0] + b _0801B93A + .pool +_0801B8AC: + ldr r0, =0x03005d8c + ldr r2, [r0] + ldr r1, =0x000033f0 + adds r0, r2, r1 + ldrb r1, [r0, 0x8] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + bne _0801B938 + movs r1, 0xD5 + lsls r1, 6 + adds r0, r2, r1 + ldrh r0, [r0, 0x2] + b _0801B93A + .pool +_0801B8D0: + ldr r0, =0x03005d8c + ldr r2, [r0] + ldr r1, =0x000033f0 + adds r0, r2, r1 + ldrb r1, [r0, 0x8] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + bne _0801B938 + movs r1, 0xD5 + lsls r1, 6 + adds r0, r2, r1 + ldrh r0, [r0, 0x4] + b _0801B93A + .pool +_0801B8F4: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x000033f0 + adds r0, r1 + ldrb r1, [r0, 0x8] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + bne _0801B938 + bl sub_801B4CC + lsls r0, 16 + lsrs r0, 16 + b _0801B93A + .pool +_0801B918: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x000033f0 + adds r2, r0, r1 + ldrb r1, [r2, 0x8] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + bne _0801B938 + ldrb r0, [r2, 0x9] + b _0801B93A + .pool +_0801B938: + movs r0, 0 +_0801B93A: + pop {r1} + bx r1 + thumb_func_end mevent_081445C0 + + thumb_func_start sub_801B940 +sub_801B940: @ 801B940 + ldr r1, =0x02022c70 + movs r0, 0 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_801B940 + + thumb_func_start sub_801B94C +sub_801B94C: @ 801B94C + push {r4,r5,lr} + lsls r0, 16 + lsrs r0, 16 + adds r4, r0, 0 + ldr r5, =0x02022c70 + movs r0, 0 + str r0, [r5] + cmp r4, 0 + beq _0801B98A + bl sub_801B27C + cmp r0, 0 + beq _0801B988 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x000033f0 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r4 + bne _0801B988 + movs r0, 0x1 + str r0, [r5] + b _0801B98A + .pool +_0801B988: + movs r0, 0 +_0801B98A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_801B94C + + thumb_func_start sub_801B990 +sub_801B990: @ 801B990 + push {lr} + adds r2, r0, 0 + ldr r0, =0x02022c70 + ldr r0, [r0] + cmp r0, 0 + beq _0801B9EC + cmp r2, 0x1 + beq _0801B9DC + cmp r2, 0x1 + bcc _0801B9C0 + cmp r2, 0x2 + bne _0801B9EC + ldr r0, =0x03005d8c + ldr r2, [r0] + ldr r0, =0x00003584 + adds r2, r0 + movs r0, 0x2 + b _0801B9CA + .pool +_0801B9C0: + ldr r0, =0x03005d8c + ldr r2, [r0] + ldr r0, =0x00003570 + adds r2, r0 + movs r0, 0 +_0801B9CA: + movs r3, 0x5 + bl sub_801BA8C + b _0801B9EC + .pool +_0801B9DC: + ldr r0, =0x03005d8c + ldr r2, [r0] + ldr r0, =0x00003570 + adds r2, r0 + movs r0, 0x1 + movs r3, 0x5 + bl sub_801BA8C +_0801B9EC: + pop {r0} + bx r0 + .pool + thumb_func_end sub_801B990 + + thumb_func_start sub_801B9F8 +sub_801B9F8: @ 801B9F8 + push {lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r0, =0x00003570 + adds r1, r0 + ldr r2, =0x0500000a + mov r0, sp + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_801B9F8 + + thumb_func_start sub_801BA24 +sub_801BA24: @ 801BA24 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r1, 0 + cmp r1, r2 + bge _0801BA46 + ldr r0, [r4] + cmp r0, r5 + beq _0801BA46 + adds r3, r4, 0 +_0801BA38: + adds r3, 0x4 + adds r1, 0x1 + cmp r1, r2 + bge _0801BA46 + ldr r0, [r3] + cmp r0, r5 + bne _0801BA38 +_0801BA46: + cmp r1, r2 + bne _0801BA68 + subs r3, r1, 0x1 + cmp r3, 0 + ble _0801BA62 + lsls r0, r3, 2 + subs r0, 0x4 + adds r2, r0, r4 +_0801BA56: + ldr r0, [r2] + str r0, [r2, 0x4] + subs r2, 0x4 + subs r3, 0x1 + cmp r3, 0 + bgt _0801BA56 +_0801BA62: + str r5, [r4] + movs r0, 0x1 + b _0801BA84 +_0801BA68: + adds r3, r1, 0 + cmp r3, 0 + ble _0801BA80 + lsls r0, r3, 2 + subs r0, 0x4 + adds r2, r0, r4 +_0801BA74: + ldr r0, [r2] + str r0, [r2, 0x4] + subs r2, 0x4 + subs r3, 0x1 + cmp r3, 0 + bgt _0801BA74 +_0801BA80: + str r5, [r4] + movs r0, 0 +_0801BA84: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_801BA24 + + thumb_func_start sub_801BA8C +sub_801BA8C: @ 801BA8C + push {r4,lr} + adds r4, r0, 0 + adds r0, r1, 0 + adds r1, r2, 0 + adds r2, r3, 0 + bl sub_801BA24 + cmp r0, 0 + beq _0801BAA4 + adds r0, r4, 0 + bl sub_801B7D8 +_0801BAA4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_801BA8C + + thumb_func_start sub_801BAAC +sub_801BAAC: @ 801BAAC + push {r4-r7,lr} + adds r5, r0, 0 + adds r6, r1, 0 + cmp r5, 0 + beq _0801BAC8 + cmp r6, 0 + beq _0801BAC8 + ldr r7, =0x02022c74 + ldr r0, =0x0000145c + bl AllocZeroed + str r0, [r7] + cmp r0, 0 + bne _0801BAD4 +_0801BAC8: + movs r0, 0 + b _0801BB3E + .pool +_0801BAD4: + movs r4, 0xA6 + lsls r4, 1 + adds r1, r5, 0 + adds r2, r4, 0 + bl memcpy + ldr r1, [r7] + adds r1, r4 + 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 r2, [r7] + ldrb r1, [r2, 0x8] + lsls r0, r1, 26 + lsrs r0, 28 + cmp r0, 0x7 + bls _0801BB06 + movs r0, 0x3D + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x8] +_0801BB06: + ldr r2, [r7] + ldrb r1, [r2, 0x8] + lsls r0, r1, 30 + lsrs r0, 30 + cmp r0, 0x2 + bls _0801BB1A + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x8] +_0801BB1A: + ldr r1, [r7] + ldrb r0, [r1, 0x9] + cmp r0, 0x7 + bls _0801BB26 + movs r0, 0 + strb r0, [r1, 0x9] +_0801BB26: + ldr r0, [r7] + movs r1, 0xB8 + lsls r1, 1 + adds r2, r0, r1 + ldrb r0, [r0, 0x8] + lsls r0, 26 + lsrs r0, 28 + lsls r0, 4 + ldr r1, =gUnknown_082F1D60 + adds r0, r1 + str r0, [r2] + movs r0, 0x1 +_0801BB3E: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_801BAAC + + thumb_func_start sub_801BB48 +sub_801BB48: @ 801BB48 + push {r4,lr} + ldr r4, =0x02022c74 + ldr r0, [r4] + cmp r0, 0 + beq _0801BB64 + ldr r2, =0x0000145c + movs r1, 0 + bl memset + ldr r0, [r4] + bl Free + movs r0, 0 + str r0, [r4] +_0801BB64: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801BB48 + + thumb_func_start sub_801BB74 +sub_801BB74: @ 801BB74 + push {r4-r6,lr} + sub sp, 0x24 + ldr r5, =0x02022c74 + ldr r0, [r5] + cmp r0, 0 + bne _0801BB8C + movs r0, 0x1 + negs r0, r0 + b _0801BD98 + .pool +_0801BB8C: + movs r4, 0xBA + lsls r4, 1 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0x7 + bls _0801BB9A + b _0801BD70 +_0801BB9A: + lsls r0, 2 + ldr r1, =_0801BBA8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0801BBA8: + .4byte _0801BBC8 + .4byte _0801BBDA + .4byte _0801BBE8 + .4byte _0801BC8C + .4byte _0801BD14 + .4byte _0801BD1A + .4byte _0801BD34 + .4byte _0801BD3A +_0801BBC8: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + b _0801BD86 +_0801BBDA: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _0801BBE6 + b _0801BD86 +_0801BBE6: + b _0801BD96 +_0801BBE8: + movs r5, 0x1E + str r5, [sp] + movs r4, 0x14 + str r4, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + str r5, [sp] + str r4, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + str r5, [sp] + str r4, [sp, 0x4] + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + ldr r5, =0x02022c74 + ldr r0, [r5] + movs r1, 0xB8 + lsls r1, 1 + adds r0, r1 + ldr r0, [r0] + ldr r1, [r0, 0x4] + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0x8 + bl decompress_and_copy_tile_data_to_vram + ldr r4, =gUnknown_082F0E1C + adds r0, r4, 0 + bl AddWindow + ldr r1, [r5] + movs r2, 0xBB + lsls r2, 1 + adds r1, r2 + strh r0, [r1] + adds r0, r4, 0 + adds r0, 0x8 + bl AddWindow + ldr r1, [r5] + movs r2, 0xBC + lsls r2, 1 + adds r1, r2 + strh r0, [r1] + adds r4, 0x10 + adds r0, r4, 0 + bl AddWindow + ldr r1, [r5] + movs r2, 0xBD + lsls r2, 1 + adds r1, r2 + strh r0, [r1] + b _0801BD86 + .pool +_0801BC8C: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + beq _0801BC9A + b _0801BD96 +_0801BC9A: + movs r0, 0x1 + bl stdpal_get + movs r1, 0x20 + movs r2, 0x20 + bl gpu_pal_apply + ldr r2, =0x02037fd4 + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + ldr r5, =0x02022c74 + ldr r0, [r5] + movs r4, 0xB8 + lsls r4, 1 + adds r0, r4 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x10 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, [r5] + adds r4, r1, r4 + ldr r0, [r4] + ldr r0, [r0, 0x8] + ldr r4, =0x0000045c + adds r1, r4 + bl LZ77UnCompWram + ldr r1, [r5] + adds r1, r4 + movs r2, 0x1E + str r2, [sp] + movs r0, 0x14 + str r0, [sp, 0x4] + str r6, [sp, 0x8] + str r6, [sp, 0xC] + str r2, [sp, 0x10] + str r0, [sp, 0x14] + movs r0, 0x1 + str r0, [sp, 0x18] + movs r0, 0x8 + str r0, [sp, 0x1C] + str r6, [sp, 0x20] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl CopyRectToBgTilemapBufferRect + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + b _0801BD86 + .pool +_0801BD14: + bl sub_801BEF8 + b _0801BD86 +_0801BD1A: + movs r0, 0 + bl sub_801C178 + movs r0, 0x1 + bl sub_801C178 + movs r0, 0x2 + bl sub_801C178 + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + b _0801BD86 +_0801BD34: + bl sub_80D2F04 + b _0801BD86 +_0801BD3A: + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] + bl sub_801C4C0 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + bl fade_and_return_progress_probably + b _0801BD86 + .pool +_0801BD70: + bl fade_and_return_progress_probably + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0801BD96 + ldr r0, [r5] + adds r0, r4 + strb r1, [r0] + movs r0, 0x1 + b _0801BD98 +_0801BD86: + ldr r0, =0x02022c74 + ldr r1, [r0] + movs r0, 0xBA + lsls r0, 1 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0801BD96: + movs r0, 0 +_0801BD98: + add sp, 0x24 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_801BB74 + + thumb_func_start sub_801BDA4 +sub_801BDA4: @ 801BDA4 + push {r4,r5,lr} + sub sp, 0x8 + adds r2, r0, 0 + ldr r5, =0x02022c74 + ldr r0, [r5] + cmp r0, 0 + bne _0801BDBC + movs r0, 0x1 + negs r0, r0 + b _0801BEEC + .pool +_0801BDBC: + movs r4, 0xBA + lsls r4, 1 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0x5 + bls _0801BDCA + b _0801BEC4 +_0801BDCA: + lsls r0, 2 + ldr r1, =_0801BDD8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0801BDD8: + .4byte _0801BDF0 + .4byte _0801BE02 + .4byte _0801BE0E + .4byte _0801BE56 + .4byte _0801BE94 + .4byte _0801BE9E +_0801BDF0: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + b _0801BEDA +_0801BE02: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + beq _0801BEDA + b _0801BEEA +_0801BE0E: + movs r5, 0x1E + str r5, [sp] + movs r4, 0x14 + str r4, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + str r5, [sp] + str r4, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + str r5, [sp] + str r4, [sp, 0x4] + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + b _0801BEDA +_0801BE56: + movs r0, 0x1 + bl HideBg + movs r0, 0x2 + bl HideBg + ldr r4, =0x02022c74 + ldr r0, [r4] + movs r1, 0xBD + lsls r1, 1 + adds r0, r1 + ldrb r0, [r0] + bl RemoveWindow + ldr r0, [r4] + movs r1, 0xBC + lsls r1, 1 + adds r0, r1 + ldrb r0, [r0] + bl RemoveWindow + ldr r0, [r4] + movs r1, 0xBB + lsls r1, 1 + adds r0, r1 + ldrb r0, [r0] + bl RemoveWindow + b _0801BEDA + .pool +_0801BE94: + bl sub_801C61C + bl sub_80D2F9C + b _0801BEDA +_0801BE9E: + ldr r0, =0x02022c60 + ldrb r0, [r0] + adds r1, r2, 0 + bl sub_80186EC + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + b _0801BEDA + .pool +_0801BEC4: + bl fade_and_return_progress_probably + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0801BEEA + ldr r0, [r5] + adds r0, r4 + strb r1, [r0] + movs r0, 0x1 + b _0801BEEC +_0801BEDA: + ldr r0, =0x02022c74 + ldr r1, [r0] + movs r0, 0xBA + lsls r0, 1 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0801BEEA: + movs r0, 0 +_0801BEEC: + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_801BDA4 + + thumb_func_start sub_801BEF8 +sub_801BEF8: @ 801BEF8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + movs r5, 0 + mov r0, sp + movs r1, 0 + movs r2, 0x6 + bl memset + ldr r4, =0x02022c74 + ldr r1, [r4] + ldr r2, =0x0000018b + adds r0, r1, r2 + adds r1, 0xA + movs r2, 0x28 + bl memcpy + ldr r0, [r4] + ldr r3, =0x000001b3 + adds r1, r0, r3 + movs r0, 0xFF + strb r0, [r1] + ldr r1, [r4] + movs r2, 0xDA + lsls r2, 1 + adds r0, r1, r2 + adds r1, 0x32 + movs r2, 0x28 + bl memcpy + ldr r0, [r4] + movs r3, 0xEE + lsls r3, 1 + adds r0, r3 + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + ldr r1, [r4] + ldr r0, [r1, 0x4] + ldr r2, =0x000f423f + cmp r0, r2 + bls _0801BF54 + str r2, [r1, 0x4] +_0801BF54: + ldr r1, [r4] + ldr r2, =0x000001dd + adds r0, r1, r2 + ldr r1, [r1, 0x4] + movs r2, 0 + movs r3, 0x6 + bl ConvertIntToDecimalString + adds r6, r4, 0 +_0801BF66: + ldr r2, [r6] + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r4, r1, r5 + adds r0, r4, r2 + movs r3, 0xF2 + lsls r3, 1 + adds r0, r3 + adds r1, r2 + adds r1, 0x5A + movs r2, 0x28 + bl memcpy + ldr r1, [r6] + movs r0, 0x83 + lsls r0, 2 + adds r1, r0 + adds r1, r4 + movs r2, 0x1 + negs r2, r2 + adds r7, r2, 0 + movs r0, 0xFF + strb r0, [r1] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x3 + bls _0801BF66 + ldr r6, =0x02022c74 + ldr r1, [r6] + movs r3, 0xA2 + lsls r3, 2 + adds r0, r1, r3 + adds r1, 0xFA + movs r2, 0x28 + bl memcpy + ldr r0, [r6] + movs r4, 0xAC + lsls r4, 2 + adds r0, r4 + movs r1, 0x1 + negs r1, r1 + adds r4, r1, 0 + movs r1, 0xFF + strb r1, [r0] + ldr r1, [r6] + ldrb r0, [r1, 0x8] + lsls r0, 30 + lsrs r0, 30 + cmp r0, 0x1 + beq _0801C018 + cmp r0, 0x1 + bgt _0801BFF0 + cmp r0, 0 + beq _0801BFF6 + b _0801C168 + .pool +_0801BFF0: + cmp r0, 0x2 + beq _0801C028 + b _0801C168 +_0801BFF6: + ldr r2, =0x000002b1 + adds r0, r1, r2 + movs r3, 0x91 + lsls r3, 1 + adds r1, r3 + movs r2, 0x28 + bl memcpy + ldr r1, [r6] + ldr r0, =0x000002d9 + adds r1, r0 + b _0801C01C + .pool +_0801C018: + ldr r2, =0x000002b1 + adds r1, r2 +_0801C01C: + ldrb r0, [r1] + orrs r0, r4 + strb r0, [r1] + b _0801C168 + .pool +_0801C028: + ldr r3, =0x000002b1 + adds r0, r1, r3 + ldrb r1, [r0] + orrs r1, r7 + strb r1, [r0] + mov r3, sp + ldr r1, [r6] + movs r4, 0xA6 + lsls r4, 1 + adds r0, r1, r4 + ldrh r0, [r0] + ldr r2, =0x000003e7 + cmp r0, r2 + bls _0801C046 + adds r0, r2, 0 +_0801C046: + strh r0, [r3] + mov r3, sp + movs r4, 0xA7 + lsls r4, 1 + adds r0, r1, r4 + ldrh r0, [r0] + cmp r0, r2 + bls _0801C058 + adds r0, r2, 0 +_0801C058: + strh r0, [r3, 0x2] + mov r3, sp + movs r4, 0xA8 + lsls r4, 1 + adds r0, r1, r4 + ldrh r0, [r0] + cmp r0, r2 + bls _0801C06A + adds r0, r2, 0 +_0801C06A: + strh r0, [r3, 0x4] + movs r5, 0 +_0801C06E: + lsls r4, r5, 1 + adds r4, r5 + lsls r4, 4 + movs r0, 0xB7 + lsls r0, 2 + adds r4, r0 + ldr r0, [r6] + adds r0, r4 + adds r0, 0x2A + movs r1, 0xFF + movs r2, 0x4 + bl memset + ldr r0, [r6] + adds r0, r4 + adds r0, 0x1 + movs r1, 0xFF + movs r2, 0x29 + bl memset + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x7 + bls _0801C06E + movs r5, 0 + movs r6, 0 + ldr r1, =0x02022c74 + mov r8, r1 + movs r2, 0x91 + lsls r2, 1 + mov r10, r2 + ldr r7, =0x00000175 + movs r3, 0xB7 + lsls r3, 2 + mov r9, r3 +_0801C0B6: + mov r4, r8 + ldr r2, [r4] + mov r0, r10 + adds r1, r2, r0 + adds r0, r1, r5 + ldrb r3, [r0] + cmp r3, 0xF7 + beq _0801C0F8 + ldr r1, =0x00000175 + adds r0, r2, r1 + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 4 + adds r0, r6, r0 + ldr r4, =0x000002dd + adds r1, r2, r4 + adds r1, r0 + strb r3, [r1] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + b _0801C15E + .pool +_0801C0F8: + adds r0, r5, 0x1 + adds r0, r1, r0 + ldrb r3, [r0] + cmp r3, 0x2 + bls _0801C108 + adds r0, r5, 0x2 + lsls r0, 16 + b _0801C15C +_0801C108: + adds r0, r2, r7 + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 4 + add r0, r9 + adds r0, r2, r0 + adds r0, 0x2A + lsls r1, r3, 1 + add r1, sp + ldrh r1, [r1] + movs r2, 0x2 + movs r3, 0x3 + bl ConvertIntToDecimalString + mov r0, r8 + ldr r1, [r0] + adds r0, r1, r7 + ldrb r2, [r0] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 4 + adds r0, r1, r0 + adds r4, r5, 0x2 + add r1, r10 + adds r1, r4 + ldrb r1, [r1] + add r0, r9 + strb r1, [r0] + mov r2, r8 + ldr r1, [r2] + adds r1, r7 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r2] + adds r0, r7 + ldrb r0, [r0] + cmp r0, 0x7 + bhi _0801C168 + movs r6, 0 + lsls r0, r4, 16 +_0801C15C: + lsrs r5, r0, 16 +_0801C15E: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x27 + bls _0801C0B6 +_0801C168: + 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_801BEF8 + + thumb_func_start sub_801C178 +sub_801C178: @ 801C178 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + lsls r0, 24 + lsrs r4, r0, 24 + mov r8, r4 + movs r0, 0 + str r0, [sp, 0xC] + ldr r7, =0x02022c74 + ldr r0, [r7] + lsls r1, r4, 1 + movs r2, 0xBB + lsls r2, 1 + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + lsls r6, r0, 24 + lsrs r5, r6, 24 + adds r0, r5, 0 + bl PutWindowTilemap + adds r0, r5, 0 + movs r1, 0 + bl FillWindowPixelBuffer + cmp r4, 0x1 + beq _0801C2A0 + cmp r4, 0x1 + bgt _0801C1C4 + cmp r4, 0 + beq _0801C1D0 + mov r9, r6 + b _0801C498 + .pool +_0801C1C4: + mov r0, r8 + cmp r0, 0x2 + bne _0801C1CC + b _0801C304 +_0801C1CC: + mov r9, r6 + b _0801C498 +_0801C1D0: + ldr r2, [r7] + movs r1, 0xB8 + lsls r1, 1 + mov r10, r1 + adds r0, r2, r1 + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 28 + lsrs r0, 28 + lsls r1, r0, 1 + adds r1, r0 + ldr r0, =gUnknown_082F0E10 + mov r8, r0 + add r1, r8 + str r1, [sp] + ldr r1, [sp, 0xC] + str r1, [sp, 0x4] + ldr r0, =0x0000018b + adds r2, r0 + str r2, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0x3 + movs r2, 0 + movs r3, 0x1 + bl box_print + ldr r4, [r7] + movs r1, 0xDA + lsls r1, 1 + mov r9, r1 + add r4, r9 + movs r0, 0x3 + movs r1, 0x2 + bl GetFontAttribute + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x3 + adds r1, r4, 0 + bl GetStringWidth + movs r1, 0xA0 + subs r1, r0 + cmp r1, 0 + bge _0801C22E + movs r1, 0 +_0801C22E: + lsls r2, r1, 24 + lsrs r2, 24 + ldr r3, [r7] + mov r1, r10 + adds r0, r3, r1 + ldr r0, [r0] + ldrb r1, [r0] + lsls r1, 28 + lsrs r1, 28 + lsls r0, r1, 1 + adds r0, r1 + add r0, r8 + str r0, [sp] + ldr r0, [sp, 0xC] + str r0, [sp, 0x4] + add r3, r9 + str r3, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0x3 + movs r3, 0x11 + bl box_print + ldr r2, [r7] + ldr r0, [r2, 0x4] + mov r9, r6 + cmp r0, 0 + bne _0801C266 + b _0801C498 +_0801C266: + mov r1, r10 + adds r0, r2, r1 + ldr r0, [r0] + ldrb r1, [r0] + lsls r1, 28 + lsrs r1, 28 + lsls r0, r1, 1 + adds r0, r1 + add r0, r8 + str r0, [sp] + ldr r0, [sp, 0xC] + str r0, [sp, 0x4] + ldr r1, =0x000001dd + adds r0, r2, r1 + str r0, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0x1 + movs r2, 0xA6 + movs r3, 0x11 + bl box_print + b _0801C498 + .pool +_0801C2A0: + mov r9, r6 +_0801C2A2: + ldr r2, [sp, 0xC] + lsls r4, r2, 24 + asrs r4, 24 + lsls r3, r4, 4 + adds r3, 0x2 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =0x02022c74 + ldr r2, [r0] + movs r1, 0xB8 + lsls r1, 1 + adds r0, r2, r1 + ldr r0, [r0] + ldrb r0, [r0] + lsrs r0, 4 + lsls r1, r0, 1 + adds r1, r0 + ldr r0, =gUnknown_082F0E10 + adds r1, r0 + str r1, [sp] + movs r0, 0 + str r0, [sp, 0x4] + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r4 + movs r1, 0xF2 + lsls r1, 1 + adds r0, r1 + adds r2, r0 + str r2, [sp, 0x8] + mov r2, r9 + lsrs r0, r2, 24 + movs r1, 0x3 + movs r2, 0 + bl box_print + adds r4, 0x1 + lsls r4, 24 + lsrs r0, r4, 24 + str r0, [sp, 0xC] + asrs r4, 24 + cmp r4, 0x3 + ble _0801C2A2 + b _0801C498 + .pool +_0801C304: + ldr r4, =gUnknown_082F0E18 + ldr r2, [r7] + ldrb r0, [r2, 0x8] + lsls r0, 30 + lsrs r0, 30 + adds r0, r4 + ldrb r3, [r0] + movs r1, 0xB8 + lsls r1, 1 + adds r0, r2, r1 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + lsls r0, 28 + lsrs r0, 28 + lsls r1, r0, 1 + adds r1, r0 + ldr r0, =gUnknown_082F0E10 + mov r10, r0 + add r1, r10 + str r1, [sp] + ldr r1, [sp, 0xC] + str r1, [sp, 0x4] + movs r1, 0xA2 + lsls r1, 2 + adds r0, r2, r1 + str r0, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0x3 + movs r2, 0 + bl box_print + ldr r2, [r7] + ldrb r1, [r2, 0x8] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + beq _0801C398 + lsls r0, r1, 30 + lsrs r0, 30 + adds r0, r4 + ldrb r3, [r0] + adds r3, 0x10 + lsls r3, 24 + lsrs r3, 24 + movs r1, 0xB8 + lsls r1, 1 + adds r0, r2, r1 + ldr r0, [r0] + ldrb r1, [r0, 0x1] + lsls r1, 28 + lsrs r1, 28 + lsls r0, r1, 1 + adds r0, r1 + add r0, r10 + str r0, [sp] + ldr r0, [sp, 0xC] + str r0, [sp, 0x4] + ldr r1, =0x000002b1 + adds r0, r2, r1 + str r0, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0x3 + movs r2, 0 + bl box_print + mov r9, r6 + b _0801C498 + .pool +_0801C398: + movs r2, 0 + mov r8, r2 + lsls r0, r1, 30 + lsrs r0, 30 + adds r0, r4 + ldrb r0, [r0] + adds r4, r0, 0 + adds r4, 0x10 + movs r0, 0x3 + movs r1, 0x2 + bl GetFontAttribute + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, [r7] + ldr r1, =0x00000175 + adds r0, r1 + mov r9, r6 + ldr r1, [sp, 0xC] + ldrb r0, [r0] + cmp r1, r0 + bge _0801C498 + str r5, [sp, 0x10] + lsls r0, r4, 24 + lsrs r0, 24 + str r0, [sp, 0x14] + mov r10, r2 +_0801C3CE: + mov r0, r8 + lsls r2, r0, 24 + lsrs r2, 24 + ldr r3, [r7] + movs r1, 0xB8 + lsls r1, 1 + adds r0, r3, r1 + ldr r0, [r0] + ldrb r1, [r0, 0x1] + lsls r1, 28 + lsrs r1, 28 + lsls r0, r1, 1 + adds r0, r1 + ldr r1, =gUnknown_082F0E10 + adds r0, r1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + ldr r1, [sp, 0xC] + lsls r0, r1, 24 + asrs r6, r0, 24 + lsls r0, r6, 1 + adds r0, r6 + lsls r5, r0, 4 + movs r0, 0xB7 + lsls r0, 2 + adds r4, r5, r0 + adds r3, r4 + adds r3, 0x1 + str r3, [sp, 0x8] + ldr r0, [sp, 0x10] + movs r1, 0x3 + ldr r3, [sp, 0x14] + bl box_print + ldr r1, [r7] + adds r0, r1, r5 + ldr r2, =0x00000306 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0xFF + beq _0801C482 + adds r1, r4 + adds r1, 0x1 + movs r0, 0x3 + mov r2, r10 + bl GetStringWidth + add r8, r0 + mov r0, r8 + lsls r2, r0, 24 + lsrs r2, 24 + ldr r3, [r7] + movs r1, 0xB8 + lsls r1, 1 + adds r0, r3, r1 + ldr r0, [r0] + ldrb r1, [r0, 0x1] + lsls r1, 28 + lsrs r1, 28 + lsls r0, r1, 1 + adds r0, r1 + ldr r1, =gUnknown_082F0E10 + adds r0, r1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + adds r3, r4 + adds r3, 0x2A + str r3, [sp, 0x8] + ldr r0, [sp, 0x10] + movs r1, 0x3 + ldr r3, [sp, 0x14] + bl box_print + ldr r1, [r7] + adds r1, r4 + adds r1, 0x2A + movs r0, 0x3 + mov r2, r10 + bl GetStringWidth + ldr r1, [r7] + adds r1, r5 + movs r2, 0xB7 + lsls r2, 2 + adds r1, r2 + ldrb r1, [r1] + adds r0, r1 + add r8, r0 +_0801C482: + adds r1, r6, 0x1 + lsls r1, 24 + lsrs r0, r1, 24 + str r0, [sp, 0xC] + asrs r1, 24 + ldr r0, [r7] + ldr r2, =0x00000175 + adds r0, r2 + ldrb r0, [r0] + cmp r1, r0 + blt _0801C3CE +_0801C498: + mov r1, r9 + lsrs r0, r1, 24 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801C178 + + thumb_func_start sub_801C4C0 +sub_801C4C0: @ 801C4C0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + movs r7, 0 + ldr r4, =0x02022c74 + ldr r0, [r4] + movs r1, 0xBE + lsls r1, 1 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r4] + movs r2, 0xA9 + lsls r2, 1 + adds r1, r0, r2 + ldrh r0, [r1] + cmp r0, 0 + beq _0801C52C + bl sub_80D2E84 + lsls r0, 16 + lsrs r0, 16 + ldr r1, =DummyObjectCallback + str r7, [sp] + str r7, [sp, 0x4] + movs r2, 0xDC + movs r3, 0x14 + bl sub_80D2D78 + ldr r1, [r4] + movs r2, 0xBE + lsls r2, 1 + adds r1, r2 + strb r0, [r1] + ldr r2, =0x02020630 + ldr r0, [r4] + movs r1, 0xBE + lsls r1, 1 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r2, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0, 0x5] +_0801C52C: + ldr r1, [r4] + ldrb r0, [r1, 0x9] + cmp r0, 0 + beq _0801C5EE + ldrb r1, [r1, 0x8] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + bne _0801C5EE + ldr r0, =gUnknown_082F1D00 + bl LoadCompressedObjectPicUsingHeap + ldr r0, [r4] + movs r2, 0xB8 + lsls r2, 1 + adds r0, r2 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + lsrs r0, 4 + lsls r0, 3 + ldr r1, =gUnknown_082F1D08 + adds r0, r1 + bl LoadTaggedObjectPalette + ldr r0, [r4] + ldrb r0, [r0, 0x9] + cmp r7, r0 + bcs _0801C5EE + adds r6, r4, 0 + ldr r0, =0x0000017d + mov r10, r0 + movs r1, 0 + mov r9, r1 + movs r2, 0xFF + mov r8, r2 +_0801C572: + ldr r1, [r6] + lsls r4, r7, 1 + add r1, r10 + adds r1, r4 + ldrb r0, [r1] + mov r2, r8 + orrs r0, r2 + strb r0, [r1] + ldr r1, [r6] + movs r0, 0xBF + lsls r0, 1 + adds r1, r0 + adds r1, r4 + ldrb r0, [r1] + orrs r0, r2 + strb r0, [r1] + lsls r1, r7, 5 + movs r0, 0xD8 + subs r5, r0, r1 + ldr r0, =gUnknown_082F1D48 + adds r1, r5, 0 + movs r2, 0x90 + movs r3, 0x8 + bl AddObjectToFront + ldr r1, [r6] + add r1, r10 + adds r1, r4 + strb r0, [r1] + ldr r0, [r6] + movs r1, 0xAA + lsls r1, 1 + adds r0, r1 + adds r1, r0, r4 + ldrh r0, [r1] + cmp r0, 0 + beq _0801C5E0 + bl sub_80D2E84 + lsls r0, 16 + lsrs r0, 16 + mov r2, r9 + str r2, [sp] + str r2, [sp, 0x4] + ldr r1, =DummyObjectCallback + adds r2, r5, 0 + movs r3, 0x88 + bl sub_80D2D78 + ldr r1, [r6] + movs r2, 0xBF + lsls r2, 1 + adds r1, r2 + adds r1, r4 + strb r0, [r1] +_0801C5E0: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, [r6] + ldrb r0, [r0, 0x9] + cmp r7, r0 + bcc _0801C572 +_0801C5EE: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801C4C0 + + thumb_func_start sub_801C61C +sub_801C61C: @ 801C61C + push {r4-r7,lr} + movs r5, 0 + ldr r4, =0x02022c74 + ldr r0, [r4] + movs r2, 0xBE + lsls r2, 1 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _0801C640 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl sub_80D2EF8 +_0801C640: + ldr r0, [r4] + ldrb r2, [r0, 0x9] + cmp r2, 0 + beq _0801C6B4 + ldrb r1, [r0, 0x8] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + bne _0801C6B4 + cmp r5, r2 + bcs _0801C6A4 + adds r6, r4, 0 + ldr r7, =0x02020630 +_0801C65A: + ldr r0, [r6] + lsls r4, r5, 1 + ldr r1, =0x0000017d + adds r0, r1 + adds r1, r0, r4 + ldrb r0, [r1] + cmp r0, 0xFF + beq _0801C678 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + bl RemoveObjectAndFreeTiles +_0801C678: + ldr r0, [r6] + movs r2, 0xBF + lsls r2, 1 + adds r0, r2 + adds r1, r0, r4 + ldrb r0, [r1] + cmp r0, 0xFF + beq _0801C696 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + bl sub_80D2EF8 +_0801C696: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [r6] + ldrb r0, [r0, 0x9] + cmp r5, r0 + bcc _0801C65A +_0801C6A4: + movs r4, 0x80 + lsls r4, 8 + adds r0, r4, 0 + bl FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag +_0801C6B4: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801C61C + + thumb_func_start sub_801C6C8 +sub_801C6C8: @ 801C6C8 + push {r4-r6,lr} + adds r4, r0, 0 + cmp r4, 0 + beq _0801C6DE + ldr r5, =0x02022c78 + ldr r0, =0x000013a4 + bl AllocZeroed + str r0, [r5] + cmp r0, 0 + bne _0801C6EC +_0801C6DE: + movs r0, 0 + b _0801C71C + .pool +_0801C6EC: + movs r6, 0xDE + lsls r6, 1 + adds r1, r4, 0 + adds r2, r6, 0 + bl memcpy + ldr r1, [r5] + ldrb r0, [r1, 0x3] + cmp r0, 0x7 + bls _0801C704 + movs r0, 0 + strb r0, [r1, 0x3] +_0801C704: + ldr r2, [r5] + adds r3, r2, r6 + ldrb r0, [r2, 0x3] + lsls r0, 4 + ldr r1, =gUnknown_082F24C8 + adds r0, r1 + str r0, [r3] + ldr r0, =0x000001c1 + adds r1, r2, r0 + movs r0, 0xFF + strb r0, [r1] + movs r0, 0x1 +_0801C71C: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_801C6C8 + + thumb_func_start sub_801C72C +sub_801C72C: @ 801C72C + push {r4,lr} + ldr r4, =0x02022c78 + ldr r0, [r4] + cmp r0, 0 + beq _0801C748 + ldr r2, =0x000013a4 + movs r1, 0 + bl memset + ldr r0, [r4] + bl Free + movs r0, 0 + str r0, [r4] +_0801C748: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801C72C + + thumb_func_start sub_801C758 +sub_801C758: @ 801C758 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + ldr r5, =0x02022c78 + ldr r0, [r5] + cmp r0, 0 + bne _0801C778 + movs r0, 0x1 + negs r0, r0 + b _0801CA3A + .pool +_0801C778: + movs r4, 0xE0 + lsls r4, 1 + adds r0, r4 + ldrb r0, [r0] + lsrs r0, 1 + cmp r0, 0x6 + bls _0801C788 + b _0801CA04 +_0801C788: + lsls r0, 2 + ldr r1, =_0801C798 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0801C798: + .4byte _0801C7B4 + .4byte _0801C7C6 + .4byte _0801C82C + .4byte _0801C8D4 + .4byte _0801C990 + .4byte _0801C996 + .4byte _0801C9A8 +_0801C7B4: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + b _0801CA1E +_0801C7C6: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + beq _0801C7D2 + b _0801CA38 +_0801C7D2: + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x40 + movs r1, 0xF0 + bl SetGpuReg + ldr r1, =0x00001a98 + movs r0, 0x44 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0x1F + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x1B + bl SetGpuReg + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl SetGpuRegBits + b _0801CA1E + .pool +_0801C82C: + movs r5, 0x1E + str r5, [sp] + movs r4, 0x14 + str r4, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + str r5, [sp] + str r4, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + str r5, [sp] + str r4, [sp, 0x4] + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + str r5, [sp] + str r4, [sp, 0x4] + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + ldr r5, =0x02022c78 + ldr r0, [r5] + movs r1, 0xDE + lsls r1, 1 + adds r0, r1 + ldr r0, [r0] + ldr r1, [r0, 0x4] + movs r0, 0 + str r0, [sp] + movs r0, 0x3 + movs r2, 0 + movs r3, 0x8 + bl decompress_and_copy_tile_data_to_vram + ldr r4, =gUnknown_082F1DE8 + adds r0, r4, 0 + bl AddWindow + ldr r1, [r5] + movs r2, 0xE4 + lsls r2, 1 + adds r1, r2 + strh r0, [r1] + adds r4, 0x8 + adds r0, r4, 0 + bl AddWindow + ldr r1, [r5] + movs r3, 0xE5 + lsls r3, 1 + adds r1, r3 + strh r0, [r1] + b _0801CA1E + .pool +_0801C8D4: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0 + beq _0801C8E2 + b _0801CA38 +_0801C8E2: + movs r0, 0x1 + bl stdpal_get + movs r1, 0x20 + movs r2, 0x20 + bl gpu_pal_apply + ldr r2, =0x02037fd4 + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + ldr r0, =0x02022c78 + mov r8, r0 + ldr r0, [r0] + movs r4, 0xDE + lsls r4, 1 + adds r0, r4 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x10 + movs r2, 0x20 + bl gpu_pal_apply + mov r2, r8 + ldr r1, [r2] + adds r4, r1, r4 + ldr r0, [r4] + ldr r0, [r0, 0x8] + movs r6, 0xE9 + lsls r6, 2 + adds r1, r6 + bl LZ77UnCompWram + mov r3, r8 + ldr r1, [r3] + adds r1, r6 + movs r4, 0x1E + str r4, [sp] + movs r5, 0x3 + str r5, [sp, 0x4] + str r7, [sp, 0x8] + str r7, [sp, 0xC] + str r4, [sp, 0x10] + str r5, [sp, 0x14] + movs r0, 0x1 + mov r10, r0 + str r0, [sp, 0x18] + movs r2, 0x8 + mov r9, r2 + str r2, [sp, 0x1C] + str r7, [sp, 0x20] + movs r2, 0 + movs r3, 0 + bl CopyRectToBgTilemapBufferRect + mov r3, r8 + ldr r1, [r3] + adds r1, r6 + str r4, [sp] + movs r0, 0x17 + str r0, [sp, 0x4] + str r7, [sp, 0x8] + str r5, [sp, 0xC] + str r4, [sp, 0x10] + str r0, [sp, 0x14] + mov r0, r10 + str r0, [sp, 0x18] + mov r2, r9 + str r2, [sp, 0x1C] + str r7, [sp, 0x20] + movs r0, 0x3 + movs r2, 0 + movs r3, 0x3 + bl CopyRectToBgTilemapBufferRect + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + b _0801CA1E + .pool +_0801C990: + bl sub_801CDCC + b _0801CA1E +_0801C996: + bl sub_801CE7C + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + b _0801CA1E +_0801C9A8: + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] + ldr r4, =0x02022c78 + ldr r1, [r4] + movs r3, 0xE5 + lsls r3, 2 + adds r0, r1, r3 + movs r2, 0xE3 + lsls r2, 1 + adds r1, r2 + bl AddScrollIndicatorArrowPair + ldr r1, [r4] + ldr r3, =0x000001c1 + adds r2, r1, r3 + movs r1, 0 + strb r0, [r2] + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + bl fade_and_return_progress_probably + b _0801CA1E + .pool +_0801CA04: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _0801CA38 + ldr r0, [r5] + adds r0, r4 + ldrb r2, [r0] + movs r1, 0x1 + ands r1, r2 + strb r1, [r0] + movs r0, 0x1 + b _0801CA3A +_0801CA1E: + ldr r0, =0x02022c78 + ldr r2, [r0] + movs r0, 0xE0 + lsls r0, 1 + adds r2, r0 + ldrb r3, [r2] + lsrs r1, r3, 1 + adds r1, 0x1 + lsls r1, 1 + movs r0, 0x1 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] +_0801CA38: + movs r0, 0 +_0801CA3A: + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_801C758 + + thumb_func_start sub_801CA50 +sub_801CA50: @ 801CA50 + push {r4,r5,lr} + sub sp, 0x8 + adds r2, r0, 0 + ldr r5, =0x02022c78 + ldr r0, [r5] + cmp r0, 0 + bne _0801CA68 + movs r0, 0x1 + negs r0, r0 + b _0801CC2A + .pool +_0801CA68: + movs r4, 0xE0 + lsls r4, 1 + adds r0, r4 + ldrb r0, [r0] + lsrs r0, 1 + cmp r0, 0x5 + bls _0801CA78 + b _0801CBF4 +_0801CA78: + lsls r0, 2 + ldr r1, =_0801CA88 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0801CA88: + .4byte _0801CAA0 + .4byte _0801CAB2 + .4byte _0801CAF4 + .4byte _0801CB54 + .4byte _0801CB84 + .4byte _0801CBC0 +_0801CAA0: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + b _0801CC0E +_0801CAB2: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + beq _0801CABE + b _0801CC28 +_0801CABE: + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x40 + movs r1, 0 + bl SetGpuReg + movs r0, 0x44 + movs r1, 0 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4A + movs r1, 0 + bl SetGpuReg + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl ClearGpuRegBits + b _0801CC0E +_0801CAF4: + movs r4, 0x1E + str r4, [sp] + movs r5, 0x14 + str r5, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + str r4, [sp] + str r5, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + str r4, [sp] + movs r5, 0x18 + str r5, [sp, 0x4] + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + str r4, [sp] + str r5, [sp, 0x4] + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + b _0801CC0E +_0801CB54: + movs r0, 0x1 + bl HideBg + movs r0, 0x2 + bl HideBg + ldr r4, =0x02022c78 + ldr r0, [r4] + movs r1, 0xE5 + lsls r1, 1 + adds r0, r1 + ldrb r0, [r0] + bl RemoveWindow + ldr r0, [r4] + movs r2, 0xE4 + lsls r2, 1 + adds r0, r2 + ldrb r0, [r0] + bl RemoveWindow + b _0801CC0E + .pool +_0801CB84: + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + ldr r4, =0x02022c78 + ldr r0, [r4] + ldr r2, =0x000001c1 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _0801CC0E + bl RemoveScrollIndicatorArrowPair + ldr r0, [r4] + ldr r2, =0x000001c1 + adds r1, r0, r2 + movs r0, 0xFF + strb r0, [r1] + b _0801CC0E + .pool +_0801CBC0: + ldr r0, =0x02022c60 + ldrb r0, [r0] + adds r1, r2, 0 + bl sub_80186EC + movs r0, 0x3 + bl sub_8018798 + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + b _0801CC0E + .pool +_0801CBF4: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _0801CC28 + ldr r0, [r5] + adds r0, r4 + ldrb r2, [r0] + movs r1, 0x1 + ands r1, r2 + strb r1, [r0] + movs r0, 0x1 + b _0801CC2A +_0801CC0E: + ldr r0, =0x02022c78 + ldr r2, [r0] + movs r0, 0xE0 + lsls r0, 1 + adds r2, r0 + ldrb r3, [r2] + lsrs r1, r3, 1 + adds r1, 0x1 + lsls r1, 1 + movs r0, 0x1 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] +_0801CC28: + movs r0, 0 +_0801CC2A: + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_801CA50 + + thumb_func_start sub_801CC38 +sub_801CC38: @ 801CC38 + push {r4,r5,lr} + ldr r4, =0x02022c78 + ldr r2, [r4] + movs r5, 0xE0 + lsls r5, 1 + adds r0, r2, r5 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0801CC72 + ldr r0, =0x000001c1 + adds r1, r2, r0 + ldrb r0, [r1] + cmp r0, 0xFF + beq _0801CC72 + bl RemoveScrollIndicatorArrowPair + ldr r0, [r4] + ldr r2, =0x000001c1 + adds r1, r0, r2 + movs r0, 0xFF + strb r0, [r1] + ldr r1, [r4] + adds r1, r5 + ldrb r0, [r1] + movs r2, 0x1 + orrs r0, r2 + strb r0, [r1] +_0801CC72: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801CC38 + + thumb_func_start sub_801CC80 +sub_801CC80: @ 801CC80 + push {r4,lr} + ldr r4, =0x02022c78 + ldr r2, [r4] + movs r1, 0xE0 + lsls r1, 1 + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0801CCC0 + movs r3, 0xE5 + lsls r3, 2 + adds r0, r2, r3 + movs r3, 0xE3 + lsls r3, 1 + adds r1, r2, r3 + bl AddScrollIndicatorArrowPair + ldr r1, [r4] + ldr r2, =0x000001c1 + adds r1, r2 + strb r0, [r1] + ldr r1, [r4] + movs r3, 0xE0 + lsls r3, 1 + adds r1, r3 + ldrb r2, [r1] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r1] +_0801CCC0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801CC80 + + thumb_func_start sub_801CCD0 +sub_801CCD0: @ 801CCD0 + push {r4-r6,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r3, r4, 0 + ldr r2, =0x02022c78 + ldr r0, [r2] + mov r12, r0 + movs r0, 0xE1 + lsls r0, 1 + add r0, r12 + ldrb r1, [r0] + movs r5, 0x1 + adds r0, r5, 0 + ands r0, r1 + adds r6, r2, 0 + cmp r0, 0 + beq _0801CD00 + bl sub_801CFA4 +_0801CCF6: + movs r0, 0xFF + b _0801CDC6 + .pool +_0801CD00: + cmp r4, 0x2 + beq _0801CD1C + cmp r4, 0x2 + bgt _0801CD0E + cmp r4, 0x1 + beq _0801CD18 + b _0801CCF6 +_0801CD0E: + cmp r3, 0x40 + beq _0801CD20 + cmp r3, 0x80 + beq _0801CD50 + b _0801CCF6 +_0801CD18: + movs r0, 0 + b _0801CDC6 +_0801CD1C: + movs r0, 0x1 + b _0801CDC6 +_0801CD20: + movs r0, 0xE3 + lsls r0, 1 + add r0, r12 + ldrh r0, [r0] + cmp r0, 0 + beq _0801CCF6 + movs r0, 0xE0 + lsls r0, 1 + add r0, r12 + ldrb r1, [r0] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _0801CCF6 + ldr r2, =0x000001c3 + add r2, r12 + ldrb r1, [r2] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + b _0801CD7E + .pool +_0801CD50: + movs r0, 0xE3 + lsls r0, 1 + add r0, r12 + movs r1, 0xE2 + lsls r1, 1 + add r1, r12 + ldrh r0, [r0] + ldrh r1, [r1] + cmp r0, r1 + beq _0801CCF6 + movs r0, 0xE0 + lsls r0, 1 + add r0, r12 + ldrb r1, [r0] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _0801CCF6 + ldr r2, =0x000001c3 + add r2, r12 + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 +_0801CD7E: + strb r0, [r2] + ldr r2, [r6] + movs r4, 0xE1 + lsls r4, 1 + adds r2, r4 + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r3, [r6] + adds r3, r4 + ldrb r1, [r3] + movs r2, 0x1 + adds r0, r2, 0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r3] + ldr r1, [r6] + adds r4, 0x1 + adds r1, r4 + ldrb r3, [r1] + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + ldr r0, [r6] + adds r0, r4 + ldrb r0, [r0] + ands r2, r0 + cmp r2, 0 + beq _0801CDC4 + movs r0, 0x3 + b _0801CDC6 + .pool +_0801CDC4: + movs r0, 0x2 +_0801CDC6: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_801CCD0 + + thumb_func_start sub_801CDCC +sub_801CDCC: @ 801CDCC + push {r4-r6,lr} + movs r5, 0 + ldr r4, =0x02022c78 + ldr r1, [r4] + movs r2, 0xE7 + lsls r2, 1 + adds r0, r1, r2 + adds r1, 0x4 + movs r2, 0x28 + bl memcpy + ldr r0, [r4] + movs r3, 0xFB + lsls r3, 1 + adds r1, r0, r3 + movs r0, 0xFF + strb r0, [r1] + adds r6, r4, 0 +_0801CDF0: + ldr r2, [r6] + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r4, r1, r5 + adds r0, r4, r2 + ldr r3, =0x000001f7 + adds r0, r3 + adds r1, r2 + adds r1, 0x2C + movs r2, 0x28 + bl memcpy + ldr r0, [r6] + ldr r1, =0x0000021f + adds r0, r1 + adds r0, r4 + movs r1, 0xFF + strb r1, [r0] + cmp r5, 0x7 + bls _0801CE34 + ldr r1, [r6] + ldr r2, =0x000001f7 + adds r0, r1, r2 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0xFF + beq _0801CE34 + movs r3, 0xE2 + lsls r3, 1 + adds r1, r3 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0801CE34: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x9 + bls _0801CDF0 + ldr r2, =0x02022c78 + ldr r1, [r2] + movs r4, 0xE5 + lsls r4, 2 + adds r1, r4 + ldr r0, =gUnknown_082F1DF8 + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldr r0, [r0] + str r0, [r1] + ldr r2, [r2] + movs r5, 0xE2 + lsls r5, 1 + adds r0, r2, r5 + ldrh r1, [r0] + movs r3, 0xE7 + lsls r3, 2 + adds r0, r2, r3 + strh r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801CDCC + + thumb_func_start sub_801CE7C +sub_801CE7C: @ 801CE7C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + movs r5, 0 + ldr r6, =0x02022c78 + ldr r0, [r6] + movs r7, 0xE4 + lsls r7, 1 + adds r0, r7 + ldrb r0, [r0] + bl PutWindowTilemap + ldr r0, [r6] + movs r4, 0xE5 + lsls r4, 1 + adds r0, r4 + ldrb r0, [r0] + bl PutWindowTilemap + ldr r0, [r6] + adds r0, r7 + ldrb r0, [r0] + movs r1, 0 + bl FillWindowPixelBuffer + ldr r0, [r6] + adds r0, r4 + ldrb r0, [r0] + movs r1, 0 + bl FillWindowPixelBuffer + ldr r4, [r6] + movs r0, 0xE7 + lsls r0, 1 + mov r8, r0 + add r4, r8 + movs r0, 0x3 + movs r1, 0x2 + bl GetFontAttribute + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x3 + adds r1, r4, 0 + bl GetStringWidth + movs r1, 0xE0 + subs r1, r0 + lsrs r0, r1, 31 + adds r1, r0 + asrs r1, 1 + cmp r1, 0 + bge _0801CEEC + movs r1, 0 +_0801CEEC: + ldr r4, [r6] + adds r0, r4, r7 + ldrb r0, [r0] + lsls r2, r1, 24 + lsrs r2, 24 + movs r3, 0xDE + lsls r3, 1 + adds r1, r4, r3 + ldr r1, [r1] + ldrb r1, [r1] + lsls r1, 28 + lsrs r1, 28 + lsls r3, r1, 1 + adds r3, r1 + ldr r1, =gUnknown_082F1DE0 + adds r3, r1 + str r3, [sp] + str r5, [sp, 0x4] + add r4, r8 + str r4, [sp, 0x8] + movs r1, 0x3 + movs r3, 0x6 + bl box_print +_0801CF1C: + ldr r6, =0x02022c78 + ldr r4, [r6] + movs r1, 0xE5 + lsls r1, 1 + adds r0, r4, r1 + ldrb r0, [r0] + lsls r3, r5, 4 + adds r3, 0x2 + lsls r3, 24 + lsrs r3, 24 + movs r2, 0xDE + lsls r2, 1 + adds r1, r4, r2 + ldr r1, [r1] + ldrb r1, [r1] + lsrs r1, 4 + lsls r2, r1, 1 + adds r2, r1 + ldr r1, =gUnknown_082F1DE0 + adds r2, r1 + str r2, [sp] + movs r1, 0 + str r1, [sp, 0x4] + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r5 + ldr r2, =0x000001f7 + adds r1, r2 + adds r4, r1 + str r4, [sp, 0x8] + movs r1, 0x3 + movs r2, 0 + bl box_print + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x9 + bls _0801CF1C + ldr r0, [r6] + movs r3, 0xE4 + lsls r3, 1 + adds r0, r3 + ldrb r0, [r0] + movs r1, 0x3 + bl CopyWindowToVram + ldr r0, [r6] + movs r1, 0xE5 + lsls r1, 1 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801CE7C + + thumb_func_start sub_801CFA4 +sub_801CFA4: @ 801CFA4 + push {r4-r6,lr} + ldr r0, =0x02022c78 + ldr r1, [r0] + movs r2, 0xE1 + lsls r2, 1 + adds r0, r1, r2 + ldrb r0, [r0] + lsrs r4, r0, 1 + lsls r4, 8 + ldr r6, =0x000001c3 + adds r0, r1, r6 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0801CFE4 + movs r0, 0x2 + adds r1, r4, 0 + movs r2, 0x1 + bl ChangeBgY + movs r0, 0x3 + adds r1, r4, 0 + movs r2, 0x1 + bl ChangeBgY + b _0801CFF8 + .pool +_0801CFE4: + movs r0, 0x2 + adds r1, r4, 0 + movs r2, 0x2 + bl ChangeBgY + movs r0, 0x3 + adds r1, r4, 0 + movs r2, 0x2 + bl ChangeBgY +_0801CFF8: + ldr r3, =0x02022c78 + ldr r0, [r3] + ldr r2, =0x000001c3 + adds r5, r0, r2 + ldrb r4, [r5] + lsrs r1, r4, 1 + movs r6, 0xE1 + lsls r6, 1 + adds r0, r6 + ldrb r0, [r0] + lsrs r0, 1 + adds r1, r0 + lsls r1, 1 + movs r6, 0x1 + adds r0, r6, 0 + ands r0, r4 + orrs r0, r1 + strb r0, [r5] + ldr r1, [r3] + adds r2, r1, r2 + ldrb r2, [r2] + lsrs r0, r2, 1 + cmp r0, 0xF + bls _0801D070 + adds r0, r6, 0 + ands r0, r2 + cmp r0, 0 + beq _0801D044 + movs r0, 0xE3 + lsls r0, 1 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + b _0801D04E + .pool +_0801D044: + movs r2, 0xE3 + lsls r2, 1 + adds r1, r2 + ldrh r0, [r1] + subs r0, 0x1 +_0801D04E: + strh r0, [r1] + ldr r0, [r3] + movs r6, 0xE1 + lsls r6, 1 + adds r2, r0, r6 + ldrb r1, [r2] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, [r3] + ldr r1, =0x000001c3 + adds r2, r0, r1 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + strb r0, [r2] +_0801D070: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801CFA4 + + thumb_func_start mevent_srv_init_wnews +mevent_srv_init_wnews: @ 801D07C + push {r4,lr} + ldr r4, =0x02022c7c + movs r0, 0x60 + bl AllocZeroed + str r0, [r4] + ldr r1, =gUnknown_082F298C + movs r2, 0 + movs r3, 0x1 + bl mevent_srv_init_common + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end mevent_srv_init_wnews + + thumb_func_start mevent_srv_new_wcard +mevent_srv_new_wcard: @ 801D0A0 + push {r4,lr} + ldr r4, =0x02022c7c + movs r0, 0x60 + bl AllocZeroed + str r0, [r4] + ldr r1, =gUnknown_082F29EC + movs r2, 0 + movs r3, 0x1 + bl mevent_srv_init_common + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end mevent_srv_new_wcard + + thumb_func_start sub_801D0C4 +sub_801D0C4: @ 801D0C4 + push {r4-r6,lr} + adds r6, r0, 0 + ldr r4, =0x02022c7c + ldr r0, [r4] + cmp r0, 0 + bne _0801D0D8 + movs r0, 0x3 + b _0801D0F8 + .pool +_0801D0D8: + bl mevent_dispatch_08145600 + adds r5, r0, 0 + cmp r5, 0x3 + bne _0801D0F6 + ldr r0, [r4] + ldr r1, [r0, 0x4] + strh r1, [r6] + bl mevent_srv_free_resources + ldr r0, [r4] + bl Free + movs r0, 0 + str r0, [r4] +_0801D0F6: + adds r0, r5, 0 +_0801D0F8: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_801D0C4 + + thumb_func_start mevent_srv_init_common +mevent_srv_init_common: @ 801D100 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + adds r4, r0, 0 + adds r6, r1, 0 + mov r8, r2 + mov r9, r3 + movs r5, 0 + str r5, [r4] + str r5, [r4, 0x8] + movs r0, 0xA6 + lsls r0, 1 + bl AllocZeroed + str r0, [r4, 0x18] + movs r0, 0xDE + lsls r0, 1 + bl AllocZeroed + str r0, [r4, 0x1C] + movs r0, 0x80 + lsls r0, 3 + bl AllocZeroed + str r0, [r4, 0x14] + movs r0, 0x64 + bl AllocZeroed + str r0, [r4, 0x20] + str r6, [r4, 0x10] + str r5, [r4, 0xC] + adds r4, 0x38 + adds r0, r4, 0 + mov r1, r8 + mov r2, r9 + bl sub_801D8D8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end mevent_srv_init_common + + thumb_func_start mevent_srv_free_resources +mevent_srv_free_resources: @ 801D158 + push {r4,lr} + adds r4, r0, 0 + ldr r0, [r4, 0x18] + bl Free + ldr r0, [r4, 0x1C] + bl Free + ldr r0, [r4, 0x14] + bl Free + ldr r0, [r4, 0x20] + bl Free + pop {r4} + pop {r0} + bx r0 + thumb_func_end mevent_srv_free_resources + + thumb_func_start mevent_srv_814501C +mevent_srv_814501C: @ 801D17C + push {lr} + adds r0, 0x38 + bl sub_801D904 + pop {r0} + bx r0 + thumb_func_end mevent_srv_814501C + + thumb_func_start sub_801D188 +sub_801D188: @ 801D188 + push {lr} + cmp r0, 0 + bne _0801D190 + adds r0, r1, 0 +_0801D190: + pop {r1} + bx r1 + thumb_func_end sub_801D188 + + thumb_func_start sub_801D194 +sub_801D194: @ 801D194 + push {lr} + cmp r1, r0 + bcs _0801D19E + movs r0, 0 + b _0801D1A8 +_0801D19E: + cmp r1, r0 + beq _0801D1A6 + movs r0, 0x2 + b _0801D1A8 +_0801D1A6: + movs r0, 0x1 +_0801D1A8: + pop {r1} + bx r1 + thumb_func_end sub_801D194 + + thumb_func_start sub_801D1AC +sub_801D1AC: @ 801D1AC + movs r1, 0x4 + str r1, [r0, 0x8] + movs r0, 0 + bx lr + thumb_func_end sub_801D1AC + + thumb_func_start sub_801D1B4 +sub_801D1B4: @ 801D1B4 + movs r0, 0x3 + bx lr + thumb_func_end sub_801D1B4 + + thumb_func_start sub_801D1B8 +sub_801D1B8: @ 801D1B8 + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x38 + bl sub_801D8C0 + cmp r0, 0 + beq _0801D1CA + movs r0, 0x4 + str r0, [r4, 0x8] +_0801D1CA: + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801D1B8 + + thumb_func_start sub_801D1D4 +sub_801D1D4: @ 801D1D4 + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x38 + bl sub_801D8CC + cmp r0, 0 + beq _0801D1E6 + movs r0, 0x4 + str r0, [r4, 0x8] +_0801D1E6: + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801D1D4 + + thumb_func_start sub_801D1F0 +sub_801D1F0: @ 801D1F0 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, [r5, 0xC] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + ldr r2, [r5, 0x10] + adds r3, r2, r1 + adds r0, 0x1 + str r0, [r5, 0xC] + ldr r0, [r3] + cmp r0, 0x1E + bls _0801D20C + b _0801D464 +_0801D20C: + lsls r0, 2 + ldr r1, =_0801D21C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0801D21C: + .4byte _0801D298 + .4byte _0801D2A2 + .4byte _0801D2A8 + .4byte _0801D2E2 + .4byte _0801D2D8 + .4byte _0801D2BA + .4byte _0801D2C6 + .4byte _0801D2EC + .4byte _0801D300 + .4byte _0801D308 + .4byte _0801D31E + .4byte _0801D32E + .4byte _0801D33A + .4byte _0801D360 + .4byte _0801D348 + .4byte _0801D390 + .4byte _0801D378 + .4byte _0801D3DC + .4byte _0801D3A8 + .4byte _0801D3C0 + .4byte _0801D3CE + .4byte _0801D406 + .4byte _0801D3EA + .4byte _0801D3F8 + .4byte _0801D40E + .4byte _0801D418 + .4byte _0801D422 + .4byte _0801D43C + .4byte _0801D450 + .4byte _0801D458 + .4byte _0801D2CC +_0801D298: + movs r0, 0x1 + str r0, [r5, 0x8] + ldr r0, [r3, 0x4] + str r0, [r5, 0x4] + b _0801D464 +_0801D2A2: + movs r0, 0x3 + str r0, [r5, 0x8] + b _0801D464 +_0801D2A8: + adds r0, r5, 0 + adds r0, 0x38 + ldr r1, [r3, 0x4] + ldr r2, [r5, 0x14] + bl sub_801D928 + movs r0, 0x2 + str r0, [r5, 0x8] + b _0801D464 +_0801D2BA: + ldr r0, [r5, 0x20] + ldr r1, [r5, 0x14] + movs r2, 0x64 + bl memcpy + b _0801D464 +_0801D2C6: + ldr r0, [r5, 0x20] + movs r1, 0 + b _0801D2D0 +_0801D2CC: + ldr r0, [r5, 0x20] + movs r1, 0x1 +_0801D2D0: + bl sub_801B6A0 + str r0, [r5, 0x4] + b _0801D464 +_0801D2D8: + ldr r1, [r5, 0x4] + ldr r0, [r3, 0x4] + cmp r1, r0 + beq _0801D2E2 + b _0801D464 +_0801D2E2: + movs r0, 0 + str r0, [r5, 0xC] + ldr r0, [r3, 0x8] + str r0, [r5, 0x10] + b _0801D464 +_0801D2EC: + ldr r0, [r3, 0x8] + ldr r1, [r5, 0x18] + bl sub_801D188 + adds r2, r0, 0 + ldr r1, [r5, 0x20] + bl sub_801B6EC + str r0, [r5, 0x4] + b _0801D464 +_0801D300: + ldr r0, [r5, 0x14] + ldr r0, [r0] + str r0, [r5, 0x4] + b _0801D464 +_0801D308: + ldr r0, [r3, 0x8] + adds r1, r5, 0 + adds r1, 0x34 + bl sub_801D188 + adds r2, r0, 0 + ldr r1, [r5, 0x20] + bl sub_801B708 + str r0, [r5, 0x4] + b _0801D464 +_0801D31E: + ldr r0, [r5, 0x20] + ldr r1, [r3, 0x4] + bl sub_801B784 + lsls r0, 16 + lsrs r0, 16 + str r0, [r5, 0x4] + b _0801D464 +_0801D32E: + ldr r0, [r5, 0x20] + ldr r1, [r3, 0x8] + bl sub_801B748 + str r0, [r5, 0x4] + b _0801D464 +_0801D33A: + ldr r0, [r3, 0x8] + ldr r1, [r5, 0x14] + ldr r1, [r1] + bl sub_801D194 + str r0, [r5, 0x4] + b _0801D464 +_0801D348: + ldr r0, [r3, 0x8] + ldr r1, [r5, 0x1C] + bl sub_801D188 + adds r2, r0, 0 + movs r3, 0xDE + lsls r3, 1 + adds r0, r5, 0 + movs r1, 0x17 + bl mevent_srv_814501C + b _0801D464 +_0801D360: + ldr r0, [r3, 0x8] + ldr r1, [r5, 0x18] + bl sub_801D188 + adds r2, r0, 0 + movs r3, 0xA6 + lsls r3, 1 + adds r0, r5, 0 + movs r1, 0x16 + bl mevent_srv_814501C + b _0801D464 +_0801D378: + ldr r0, [r3, 0x8] + adds r1, r5, 0 + adds r1, 0x34 + bl sub_801D188 + adds r2, r0, 0 + adds r0, r5, 0 + movs r1, 0x18 + movs r3, 0x4 + bl mevent_srv_814501C + b _0801D464 +_0801D390: + ldr r2, [r3, 0x8] + cmp r2, 0 + bne _0801D39C + ldr r2, [r5, 0x24] + ldr r3, [r5, 0x28] + b _0801D39E +_0801D39C: + ldr r3, [r3, 0x4] +_0801D39E: + adds r0, r5, 0 + movs r1, 0x19 + bl mevent_srv_814501C + b _0801D464 +_0801D3A8: + ldr r2, [r3, 0x8] + cmp r2, 0 + bne _0801D3B4 + ldr r2, [r5, 0x2C] + ldr r3, [r5, 0x30] + b _0801D3B6 +_0801D3B4: + ldr r3, [r3, 0x4] +_0801D3B6: + adds r0, r5, 0 + movs r1, 0x10 + bl mevent_srv_814501C + b _0801D464 +_0801D3C0: + ldr r2, [r3, 0x8] + adds r0, r5, 0 + movs r1, 0x1A + movs r3, 0xBC + bl mevent_srv_814501C + b _0801D464 +_0801D3CE: + ldr r2, [r3, 0x8] + ldr r3, [r3, 0x4] + adds r0, r5, 0 + movs r1, 0x15 + bl mevent_srv_814501C + b _0801D464 +_0801D3DC: + ldr r2, [r3, 0x8] + ldr r3, [r3, 0x4] + adds r0, r5, 0 + movs r1, 0x1C + bl mevent_srv_814501C + b _0801D464 +_0801D3EA: + ldr r0, [r5, 0x18] + ldr r1, [r3, 0x8] + movs r2, 0xA6 + lsls r2, 1 + bl memcpy + b _0801D464 +_0801D3F8: + ldr r0, [r5, 0x1C] + ldr r1, [r3, 0x8] + movs r2, 0xDE + lsls r2, 1 + bl memcpy + b _0801D464 +_0801D406: + ldr r0, [r3, 0x8] + ldr r0, [r0] + str r0, [r5, 0x34] + b _0801D464 +_0801D40E: + ldr r0, [r3, 0x8] + str r0, [r5, 0x24] + ldr r0, [r3, 0x4] + str r0, [r5, 0x28] + b _0801D464 +_0801D418: + ldr r0, [r3, 0x8] + str r0, [r5, 0x2C] + ldr r0, [r3, 0x4] + str r0, [r5, 0x30] + b _0801D464 +_0801D422: + ldr r4, [r5, 0x18] + bl sav1_get_mevent_buffer_1 + adds r1, r0, 0 + movs r2, 0xA6 + lsls r2, 1 + adds r0, r4, 0 + bl memcpy + ldr r0, [r5, 0x18] + bl sub_801B3C0 + b _0801D464 +_0801D43C: + ldr r4, [r5, 0x1C] + bl sub_801B00C + adds r1, r0, 0 + movs r2, 0xDE + lsls r2, 1 + adds r0, r4, 0 + bl memcpy + b _0801D464 +_0801D450: + bl sub_8099244 + str r0, [r5, 0x24] + b _0801D464 +_0801D458: + ldr r2, [r3, 0x8] + ldr r3, [r3, 0x4] + adds r0, r5, 0 + movs r1, 0x1B + bl mevent_srv_814501C +_0801D464: + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_801D1F0 + + thumb_func_start mevent_dispatch_08145600 +mevent_dispatch_08145600: @ 801D46C + push {lr} + ldr r2, =gUnknown_082F2548 + ldr r1, [r0, 0x8] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl _call_via_r1 + pop {r1} + bx r1 + .pool + thumb_func_end mevent_dispatch_08145600 + + thumb_func_start sub_801D484 +sub_801D484: @ 801D484 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x02022c80 + movs r0, 0x50 + bl AllocZeroed + str r0, [r4] + movs r1, 0x1 + movs r2, 0 + bl mevent_srv_ish_init + ldr r0, [r4] + str r5, [r0, 0x4C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801D484 + + thumb_func_start sub_801D4A8 +sub_801D4A8: @ 801D4A8 + push {r4-r6,lr} + adds r6, r0, 0 + ldr r4, =0x02022c80 + ldr r0, [r4] + cmp r0, 0 + bne _0801D4BC + movs r0, 0x6 + b _0801D4DC + .pool +_0801D4BC: + bl mevent_srv_ish_exec + adds r5, r0, 0 + cmp r5, 0x6 + bne _0801D4DA + ldr r0, [r4] + ldr r1, [r0, 0x4] + strh r1, [r6] + bl sub_801D55C + ldr r0, [r4] + bl Free + movs r0, 0 + str r0, [r4] +_0801D4DA: + adds r0, r5, 0 +_0801D4DC: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_801D4A8 + + thumb_func_start sub_801D4E4 +sub_801D4E4: @ 801D4E4 + ldr r0, =0x02022c80 + ldr r1, [r0] + ldr r0, [r1, 0xC] + adds r0, 0x1 + str r0, [r1, 0xC] + bx lr + .pool + thumb_func_end sub_801D4E4 + + thumb_func_start sub_801D4F4 +sub_801D4F4: @ 801D4F4 + ldr r0, =0x02022c80 + ldr r0, [r0] + ldr r0, [r0, 0x20] + bx lr + .pool + thumb_func_end sub_801D4F4 + + thumb_func_start sub_801D500 +sub_801D500: @ 801D500 + ldr r1, =0x02022c80 + ldr r1, [r1] + str r0, [r1, 0x4] + bx lr + .pool + thumb_func_end sub_801D500 + + thumb_func_start mevent_srv_ish_init +mevent_srv_ish_init: @ 801D50C + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r4, r0, 0 + adds r6, r1, 0 + mov r8, r2 + movs r0, 0 + str r0, [r4] + str r0, [r4, 0x8] + str r0, [r4, 0xC] + movs r5, 0x80 + lsls r5, 3 + adds r0, r5, 0 + bl AllocZeroed + str r0, [r4, 0x14] + adds r0, r5, 0 + bl AllocZeroed + str r0, [r4, 0x18] + adds r0, r5, 0 + bl AllocZeroed + str r0, [r4, 0x1C] + movs r0, 0x40 + bl AllocZeroed + str r0, [r4, 0x20] + adds r4, 0x24 + adds r0, r4, 0 + adds r1, r6, 0 + mov r2, r8 + bl sub_801D8D8 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end mevent_srv_ish_init + + thumb_func_start sub_801D55C +sub_801D55C: @ 801D55C + push {r4,lr} + adds r4, r0, 0 + ldr r0, [r4, 0x14] + bl Free + ldr r0, [r4, 0x18] + bl Free + ldr r0, [r4, 0x1C] + bl Free + ldr r0, [r4, 0x20] + bl Free + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_801D55C + + thumb_func_start sub_801D580 +sub_801D580: @ 801D580 + push {r4,lr} + adds r4, r0, 0 + ldr r0, [r4, 0x1C] + ldr r1, [r4, 0x18] + movs r2, 0x80 + lsls r2, 3 + bl memcpy + movs r0, 0 + str r0, [r4, 0x10] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_801D580 + + thumb_func_start sub_801D59C +sub_801D59C: @ 801D59C + push {r4-r6,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r6, r1, 0 + adds r5, r2, 0 + movs r0, 0 + str r0, [sp] + ldr r1, [r4, 0x14] + ldr r2, =0x05000100 + mov r0, sp + bl CpuSet + ldr r2, [r4, 0x14] + str r5, [r2] + adds r4, 0x24 + adds r0, r4, 0 + adds r1, r6, 0 + movs r3, 0x4 + bl sub_801D904 + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801D59C + + thumb_func_start sub_801D5D0 +sub_801D5D0: @ 801D5D0 + push {r4,lr} + adds r4, r0, 0 + ldr r0, [r4, 0x1C] + ldr r1, =gUnknown_082F2598 + movs r2, 0x80 + lsls r2, 3 + bl memcpy + movs r1, 0 + str r1, [r4, 0x10] + movs r0, 0x4 + str r0, [r4, 0x8] + str r1, [r4, 0xC] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_801D5D0 + + thumb_func_start sub_801D5F8 +sub_801D5F8: @ 801D5F8 + movs r0, 0x6 + bx lr + thumb_func_end sub_801D5F8 + + thumb_func_start sub_801D5FC +sub_801D5FC: @ 801D5FC + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x24 + bl sub_801D8C0 + cmp r0, 0 + beq _0801D612 + movs r0, 0x4 + str r0, [r4, 0x8] + movs r0, 0 + str r0, [r4, 0xC] +_0801D612: + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801D5FC + + thumb_func_start sub_801D61C +sub_801D61C: @ 801D61C + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x24 + bl sub_801D8CC + cmp r0, 0 + beq _0801D632 + movs r0, 0x4 + str r0, [r4, 0x8] + movs r0, 0 + str r0, [r4, 0xC] +_0801D632: + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801D61C + + thumb_func_start sub_801D63C +sub_801D63C: @ 801D63C + push {r4,lr} + adds r4, r0, 0 + ldr r0, [r4, 0x10] + lsls r2, r0, 3 + ldr r1, [r4, 0x1C] + adds r2, r1, r2 + adds r0, 0x1 + str r0, [r4, 0x10] + ldr r0, [r2] + cmp r0, 0x15 + bls _0801D654 + b _0801D804 +_0801D654: + lsls r0, 2 + ldr r1, =_0801D664 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0801D664: + .4byte _0801D804 + .4byte _0801D6BC + .4byte _0801D6C4 + .4byte _0801D6D4 + .4byte _0801D70E + .4byte _0801D716 + .4byte _0801D6FE + .4byte _0801D708 + .4byte _0801D764 + .4byte _0801D790 + .4byte _0801D788 + .4byte _0801D72C + .4byte _0801D742 + .4byte _0801D758 + .4byte _0801D77C + .4byte _0801D7B8 + .4byte _0801D7BC + .4byte _0801D7C4 + .4byte _0801D7D0 + .4byte _0801D6EA + .4byte _0801D6D8 + .4byte _0801D7F0 +_0801D6BC: + ldr r0, [r2, 0x4] + str r0, [r4, 0x4] + movs r0, 0x1 + b _0801D7FE +_0801D6C4: + adds r0, r4, 0 + adds r0, 0x24 + ldr r1, [r2, 0x4] + ldr r2, [r4, 0x18] + bl sub_801D928 + movs r0, 0x2 + b _0801D7FE +_0801D6D4: + movs r0, 0x3 + b _0801D7FE +_0801D6D8: + adds r0, r4, 0 + adds r0, 0x24 + ldr r2, [r4, 0x14] + movs r1, 0x14 + movs r3, 0 + bl sub_801D904 + movs r0, 0x3 + b _0801D7FE +_0801D6EA: + ldrb r0, [r2, 0x4] + bl sub_80847F8 + adds r2, r0, 0 + adds r0, r4, 0 + movs r1, 0x12 + bl sub_801D59C + movs r0, 0x3 + b _0801D7FE +_0801D6FE: + ldr r0, [r4, 0x4] + cmp r0, 0 + beq _0801D706 + b _0801D804 +_0801D706: + b _0801D70E +_0801D708: + ldr r0, [r4, 0x4] + cmp r0, 0x1 + bne _0801D804 +_0801D70E: + adds r0, r4, 0 + bl sub_801D580 + b _0801D804 +_0801D716: + ldr r0, [r4, 0x20] + ldr r1, [r4, 0x18] + movs r2, 0x40 + bl memcpy + movs r0, 0x5 + str r0, [r4, 0x8] + movs r0, 0 + str r0, [r4, 0xC] + movs r0, 0x2 + b _0801D806 +_0801D72C: + ldr r0, [r4, 0x20] + ldr r1, [r4, 0x18] + movs r2, 0x40 + bl memcpy + movs r0, 0x5 + str r0, [r4, 0x8] + movs r0, 0 + str r0, [r4, 0xC] + movs r0, 0x3 + b _0801D806 +_0801D742: + ldr r0, [r4, 0x20] + ldr r1, [r4, 0x18] + movs r2, 0x40 + bl memcpy + movs r0, 0x5 + str r0, [r4, 0x8] + movs r0, 0 + str r0, [r4, 0xC] + movs r0, 0x5 + b _0801D806 +_0801D758: + movs r0, 0x5 + str r0, [r4, 0x8] + movs r0, 0 + str r0, [r4, 0xC] + movs r0, 0x4 + b _0801D806 +_0801D764: + ldr r0, [r4, 0x14] + ldr r1, [r4, 0x4C] + bl sub_801B580 + adds r0, r4, 0 + adds r0, 0x24 + ldr r2, [r4, 0x14] + movs r1, 0x11 + movs r3, 0x64 + bl sub_801D904 + b _0801D804 +_0801D77C: + ldr r2, [r4, 0x4] + adds r0, r4, 0 + movs r1, 0x13 + bl sub_801D59C + b _0801D804 +_0801D788: + ldr r0, [r4, 0x18] + bl sub_801B21C + b _0801D804 +_0801D790: + ldr r0, [r4, 0x18] + bl sub_801B1A4 + cmp r0, 0 + bne _0801D7AC + ldr r0, [r4, 0x18] + bl sub_801B078 + adds r0, r4, 0 + movs r1, 0x13 + movs r2, 0 + bl sub_801D59C + b _0801D804 +_0801D7AC: + adds r0, r4, 0 + movs r1, 0x13 + movs r2, 0x1 + bl sub_801D59C + b _0801D804 +_0801D7B8: + movs r0, 0x6 + b _0801D7FE +_0801D7BC: + ldr r0, [r4, 0x18] + bl sub_801B508 + b _0801D804 +_0801D7C4: + ldr r0, [r4, 0x18] + movs r1, 0xFA + lsls r1, 2 + bl sub_80992A0 + b _0801D804 +_0801D7D0: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000bec + adds r0, r1 + ldr r1, [r4, 0x18] + movs r2, 0xBC + bl memcpy + bl sub_81652B4 + b _0801D804 + .pool +_0801D7F0: + ldr r0, =0x0201c000 + ldr r1, [r4, 0x18] + movs r2, 0x80 + lsls r2, 3 + bl memcpy + movs r0, 0x7 +_0801D7FE: + str r0, [r4, 0x8] + movs r0, 0 + str r0, [r4, 0xC] +_0801D804: + movs r0, 0x1 +_0801D806: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_801D63C + + thumb_func_start sub_801D810 +sub_801D810: @ 801D810 + push {lr} + adds r1, r0, 0 + ldr r0, [r1, 0xC] + cmp r0, 0 + beq _0801D822 + movs r0, 0x4 + str r0, [r1, 0x8] + movs r0, 0 + str r0, [r1, 0xC] +_0801D822: + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_801D810 + + thumb_func_start sub_801D828 +sub_801D828: @ 801D828 + push {r4,lr} + adds r4, r0, 0 + ldr r0, [r4, 0xC] + cmp r0, 0 + beq _0801D838 + cmp r0, 0x1 + beq _0801D846 + b _0801D858 +_0801D838: + ldr r0, [r4, 0x18] + bl sub_8153870 + ldr r0, [r4, 0xC] + adds r0, 0x1 + str r0, [r4, 0xC] + b _0801D858 +_0801D846: + adds r0, r4, 0x4 + bl sub_8153884 + adds r1, r0, 0 + cmp r1, 0 + bne _0801D858 + movs r0, 0x4 + str r0, [r4, 0x8] + str r1, [r4, 0xC] +_0801D858: + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801D828 + + thumb_func_start sub_801D860 +sub_801D860: @ 801D860 + push {r4,lr} + adds r4, r0, 0 + ldr r3, =0x0201c000 + adds r0, r4, 0x4 + ldr r1, =0x03005d90 + ldr r1, [r1] + ldr r2, =0x03005d8c + ldr r2, [r2] + bl _call_via_r3 + cmp r0, 0x1 + bne _0801D880 + movs r0, 0x4 + str r0, [r4, 0x8] + movs r0, 0 + str r0, [r4, 0xC] +_0801D880: + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_801D860 + + thumb_func_start mevent_srv_ish_exec +mevent_srv_ish_exec: @ 801D894 + push {r4,r5,lr} + sub sp, 0x20 + mov r2, sp + ldr r1, =gUnknown_082F255C + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + ldm r1!, {r3,r4} + stm r2!, {r3,r4} + ldr r1, [r0, 0x8] + lsls r1, 2 + add r1, sp + ldr r1, [r1] + bl _call_via_r1 + add sp, 0x20 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end mevent_srv_ish_exec + + thumb_func_start sub_801D8C0 +sub_801D8C0: @ 801D8C0 + push {lr} + ldr r1, [r0, 0x20] + bl _call_via_r1 + pop {r1} + bx r1 + thumb_func_end sub_801D8C0 + + thumb_func_start sub_801D8CC +sub_801D8CC: @ 801D8CC + push {lr} + ldr r1, [r0, 0x24] + bl _call_via_r1 + pop {r1} + bx r1 + thumb_func_end sub_801D8CC + + thumb_func_start sub_801D8D8 +sub_801D8D8: @ 801D8D8 + movs r3, 0 + strb r1, [r0, 0x4] + strb r2, [r0, 0x5] + str r3, [r0] + strh r3, [r0, 0x12] + strh r3, [r0, 0x14] + strh r3, [r0, 0x10] + strh r3, [r0, 0xA] + strh r3, [r0, 0xC] + strh r3, [r0, 0x8] + str r3, [r0, 0x1C] + str r3, [r0, 0x18] + ldr r1, =sub_801DA5C + str r1, [r0, 0x24] + ldr r1, =sub_801D988 + str r1, [r0, 0x20] + bx lr + .pool + thumb_func_end sub_801D8D8 + + thumb_func_start sub_801D904 +sub_801D904: @ 801D904 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0 + str r0, [r4] + strh r1, [r4, 0xE] + strh r0, [r4, 0x10] + strh r0, [r4, 0x12] + cmp r3, 0 + beq _0801D91A + strh r3, [r4, 0x14] + b _0801D920 +_0801D91A: + movs r0, 0x80 + lsls r0, 3 + strh r0, [r4, 0x14] +_0801D920: + str r2, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_801D904 + + thumb_func_start sub_801D928 +sub_801D928: @ 801D928 + movs r3, 0 + str r3, [r0] + strh r1, [r0, 0x6] + strh r3, [r0, 0x8] + strh r3, [r0, 0xA] + strh r3, [r0, 0xC] + str r2, [r0, 0x18] + bx lr + thumb_func_end sub_801D928 + + thumb_func_start sub_801D938 +sub_801D938: @ 801D938 + push {lr} + adds r3, r0, 0 + adds r0, r1, 0 + lsls r3, 8 + ldr r1, =0x020223c4 + adds r3, r1 + adds r1, r3, 0 + bl memcpy + pop {r0} + bx r0 + .pool + thumb_func_end sub_801D938 + + thumb_func_start sub_801D954 +sub_801D954: @ 801D954 + push {r4,lr} + adds r4, r0, 0 + bl sub_800A550 + lsls r0, 24 + lsrs r0, 24 + asrs r0, r4 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0801D96E + movs r0, 0 + b _0801D970 +_0801D96E: + movs r0, 0x1 +_0801D970: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801D954 + + thumb_func_start sub_801D978 +sub_801D978: @ 801D978 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_800A5EC + pop {r0} + bx r0 + thumb_func_end sub_801D978 + + thumb_func_start sub_801D988 +sub_801D988: @ 801D988 + push {r4-r6,lr} + sub sp, 0x8 + adds r5, r0, 0 + ldr r6, [r5] + cmp r6, 0x1 + beq _0801D9EC + cmp r6, 0x1 + bgt _0801D99E + cmp r6, 0 + beq _0801D9A4 + b _0801DA52 +_0801D99E: + cmp r6, 0x2 + beq _0801DA38 + b _0801DA52 +_0801D9A4: + ldrb r0, [r5, 0x5] + bl sub_801D954 + cmp r0, 0 + beq _0801DA52 + ldrb r0, [r5, 0x5] + mov r4, sp + mov r1, sp + movs r2, 0x8 + bl sub_801D938 + ldrh r1, [r4, 0x4] + strh r1, [r5, 0xC] + ldrh r0, [r4, 0x2] + strh r0, [r5, 0xA] + lsls r1, 16 + movs r0, 0x80 + lsls r0, 19 + cmp r1, r0 + bls _0801D9D2 +_0801D9CC: + bl sub_8010198 + b _0801DA52 +_0801D9D2: + mov r1, sp + ldrh r0, [r5, 0x6] + ldrh r1, [r1] + cmp r0, r1 + bne _0801D9CC + strh r6, [r5, 0x8] + ldrb r0, [r5, 0x5] + bl sub_801D978 + ldr r0, [r5] + adds r0, 0x1 + str r0, [r5] + b _0801DA52 +_0801D9EC: + ldrb r0, [r5, 0x5] + bl sub_801D954 + cmp r0, 0 + beq _0801DA52 + ldrh r0, [r5, 0x8] + lsls r1, r0, 6 + subs r1, r0 + lsls r3, r1, 2 + ldrh r0, [r5, 0xC] + subs r2, r0, r3 + cmp r2, 0xFC + bhi _0801DA1E + ldrb r0, [r5, 0x5] + ldr r1, [r5, 0x18] + adds r1, r3 + bl sub_801D938 + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + ldr r0, [r5] + adds r0, 0x1 + str r0, [r5] + b _0801DA30 +_0801DA1E: + ldrb r0, [r5, 0x5] + ldr r1, [r5, 0x18] + adds r1, r3 + movs r2, 0xFC + bl sub_801D938 + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] +_0801DA30: + ldrb r0, [r5, 0x5] + bl sub_801D978 + b _0801DA52 +_0801DA38: + ldr r0, [r5, 0x18] + ldrh r1, [r5, 0xC] + bl sub_806F928 + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r5, 0xA] + cmp r0, r1 + bne _0801D9CC + movs r0, 0 + str r0, [r5] + movs r0, 0x1 + b _0801DA54 +_0801DA52: + movs r0, 0 +_0801DA54: + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_801D988 + + thumb_func_start sub_801DA5C +sub_801DA5C: @ 801DA5C + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r5, [r4] + cmp r5, 0x1 + beq _0801DAC8 + cmp r5, 0x1 + bgt _0801DA72 + cmp r5, 0 + beq _0801DA7C + b _0801DB5E +_0801DA72: + cmp r5, 0x2 + beq _0801DB1C + cmp r5, 0x3 + beq _0801DB46 + b _0801DB5E +_0801DA7C: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _0801DB5E + ldrh r1, [r4, 0xE] + ldr r2, =0xffff0000 + ldr r0, [sp] + ands r0, r2 + orrs r0, r1 + str r0, [sp] + ldrh r1, [r4, 0x14] + ldr r0, [sp, 0x4] + ands r0, r2 + orrs r0, r1 + str r0, [sp, 0x4] + ldr r0, [r4, 0x1C] + bl sub_806F928 + lsls r0, 16 + ldr r2, =0x0000ffff + ldr r1, [sp] + ands r1, r2 + orrs r1, r0 + str r1, [sp] + lsrs r1, 16 + strh r1, [r4, 0x12] + strh r5, [r4, 0x10] + movs r0, 0 + mov r1, sp + movs r2, 0x8 + bl link_0800A448 + b _0801DB3E + .pool +_0801DAC8: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _0801DB5E + ldrb r0, [r4, 0x4] + bl sub_801D954 + cmp r0, 0 + beq _0801DB5E + ldrb r0, [r4, 0x4] + bl sub_801D978 + ldrh r1, [r4, 0x10] + lsls r0, r1, 6 + subs r0, r1 + lsls r3, r0, 2 + ldrh r0, [r4, 0x14] + subs r0, r3 + cmp r0, 0xFC + bhi _0801DB08 + ldr r1, [r4, 0x1C] + adds r1, r3 + lsls r2, r0, 16 + lsrs r2, 16 + movs r0, 0 + bl link_0800A448 + ldrh r0, [r4, 0x10] + adds r0, 0x1 + strh r0, [r4, 0x10] + b _0801DB3E +_0801DB08: + ldr r1, [r4, 0x1C] + adds r1, r3 + movs r0, 0 + movs r2, 0xFC + bl link_0800A448 + ldrh r0, [r4, 0x10] + adds r0, 0x1 + strh r0, [r4, 0x10] + b _0801DB5E +_0801DB1C: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _0801DB5E + ldr r0, [r4, 0x1C] + ldrh r1, [r4, 0x14] + bl sub_806F928 + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r4, 0x12] + cmp r0, r1 + beq _0801DB3E + bl sub_8010198 + b _0801DB5E +_0801DB3E: + ldr r0, [r4] + adds r0, 0x1 + str r0, [r4] + b _0801DB5E +_0801DB46: + ldrb r0, [r4, 0x4] + bl sub_801D954 + cmp r0, 0 + beq _0801DB5E + ldrb r0, [r4, 0x4] + bl sub_801D978 + movs r0, 0 + str r0, [r4] + movs r0, 0x1 + b _0801DB60 +_0801DB5E: + movs r0, 0 +_0801DB60: + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_801DA5C + + thumb_func_start sub_801DB68 +sub_801DB68: @ 801DB68 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_801B044 + adds r5, r0, 0 + movs r0, 0x3 + adds r1, r4, 0 + ands r1, r0 + ldrb r2, [r5] + movs r0, 0x4 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5] + cmp r4, 0x2 + bhi _0801DB8E + cmp r4, 0x1 + bcs _0801DB94 + b _0801DBB8 +_0801DB8E: + cmp r4, 0x3 + beq _0801DBA6 + b _0801DBB8 +_0801DB94: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xF + bl __umodsi3 + adds r0, 0x10 + b _0801DBB6 +_0801DBA6: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xF + bl __umodsi3 + adds r0, 0x1 +_0801DBB6: + strb r0, [r5, 0x1] +_0801DBB8: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_801DB68 + + thumb_func_start sub_801DBC0 +sub_801DBC0: @ 801DBC0 + push {lr} + bl sub_801B044 + movs r1, 0 + strb r1, [r0] + strb r1, [r0, 0x1] + ldr r0, =0x0000402e + bl VarSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_801DBC0 + + thumb_func_start sub_801DBDC +sub_801DBDC: @ 801DBDC + push {r4,lr} + ldr r0, =0x0000402e + bl GetVarPointer + adds r4, r0, 0 + bl sub_801B044 + adds r2, r0, 0 + ldr r0, [r2] + lsls r0, 24 + lsrs r0, 29 + cmp r0, 0x4 + bls _0801DC10 + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + lsls r0, 16 + ldr r1, =0x01f30000 + cmp r0, r1 + bls _0801DC10 + ldrb r0, [r2] + movs r1, 0x1F + ands r1, r0 + strb r1, [r2] + movs r0, 0 + strh r0, [r4] +_0801DC10: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801DBDC + + thumb_func_start sub_801DC20 +sub_801DC20: @ 801DC20 + push {r4-r6,lr} + ldr r6, =0x020375f0 + bl sub_801B044 + adds r4, r0, 0 + bl sub_809D490 + cmp r0, 0 + beq _0801DC3A + bl sub_801B0CC + cmp r0, 0 + bne _0801DC44 +_0801DC3A: + movs r0, 0 + b _0801DCA6 + .pool +_0801DC44: + adds r0, r4, 0 + bl sub_801DD44 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x6 + bhi _0801DCA4 + lsls r0, r5, 2 + ldr r1, =_0801DC60 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0801DC60: + .4byte _0801DCA4 + .4byte _0801DC7C + .4byte _0801DC7C + .4byte _0801DCA4 + .4byte _0801DC86 + .4byte _0801DC96 + .4byte _0801DCA4 +_0801DC7C: + adds r0, r4, 0 + bl sub_801DCAC + strh r0, [r6] + b _0801DCA4 +_0801DC86: + adds r0, r4, 0 + bl sub_801DCAC + strh r0, [r6] + adds r0, r4, 0 + bl sub_801DCD8 + b _0801DCA4 +_0801DC96: + adds r0, r4, 0 + bl sub_801DCAC + strh r0, [r6] + adds r0, r4, 0 + bl sub_801DCCC +_0801DCA4: + adds r0, r5, 0 +_0801DCA6: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_801DC20 + + thumb_func_start sub_801DCAC +sub_801DCAC: @ 801DCAC + push {r4,lr} + ldrb r2, [r0] + movs r1, 0x4 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + ldrb r4, [r0, 0x1] + adds r4, 0x84 + movs r1, 0 + strb r1, [r0, 0x1] + bl sub_801DD10 + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801DCAC + + thumb_func_start sub_801DCCC +sub_801DCCC: @ 801DCCC + ldrb r2, [r0] + movs r1, 0x1D + negs r1, r1 + ands r1, r2 + strb r1, [r0] + bx lr + thumb_func_end sub_801DCCC + + thumb_func_start sub_801DCD8 +sub_801DCD8: @ 801DCD8 + push {r4,lr} + adds r3, r0, 0 + ldr r0, [r3] + lsls r0, 27 + lsrs r0, 29 + adds r0, 0x1 + movs r1, 0x7 + ands r0, r1 + lsls r0, 2 + ldrb r1, [r3] + movs r4, 0x1D + negs r4, r4 + adds r2, r4, 0 + ands r2, r1 + orrs r2, r0 + strb r2, [r3] + ldr r0, [r3] + lsls r0, 27 + lsrs r0, 29 + cmp r0, 0x4 + bls _0801DD0A + ands r2, r4 + movs r0, 0x10 + orrs r2, r0 + strb r2, [r3] +_0801DD0A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_801DCD8 + + thumb_func_start sub_801DD10 +sub_801DD10: @ 801DD10 + push {r4,lr} + adds r3, r0, 0 + ldr r0, [r3] + lsls r0, 24 + lsrs r0, 29 + adds r0, 0x1 + lsls r0, 5 + ldrb r1, [r3] + movs r4, 0x1F + adds r2, r4, 0 + ands r2, r1 + orrs r2, r0 + strb r2, [r3] + ldr r0, [r3] + lsls r0, 24 + lsrs r0, 29 + cmp r0, 0x5 + bls _0801DD3C + ands r2, r4 + movs r0, 0xA0 + orrs r2, r0 + strb r2, [r3] +_0801DD3C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_801DD10 + + thumb_func_start sub_801DD44 +sub_801DD44: @ 801DD44 + push {lr} + adds r2, r0, 0 + ldrb r1, [r2] + movs r0, 0xE0 + ands r0, r1 + cmp r0, 0xA0 + bne _0801DD56 + movs r0, 0x6 + b _0801DD92 +_0801DD56: + ldr r1, [r2] + lsls r0, r1, 30 + lsrs r0, 30 + cmp r0, 0x1 + beq _0801DD78 + cmp r0, 0x1 + bgt _0801DD6A + cmp r0, 0 + beq _0801DD74 + b _0801DD90 +_0801DD6A: + cmp r0, 0x2 + beq _0801DD7C + cmp r0, 0x3 + beq _0801DD80 + b _0801DD90 +_0801DD74: + movs r0, 0x3 + b _0801DD92 +_0801DD78: + movs r0, 0x1 + b _0801DD92 +_0801DD7C: + movs r0, 0x2 + b _0801DD92 +_0801DD80: + lsls r0, r1, 27 + lsrs r0, 29 + cmp r0, 0x2 + bhi _0801DD8C + movs r0, 0x4 + b _0801DD92 +_0801DD8C: + movs r0, 0x5 + b _0801DD92 +_0801DD90: + movs r0, 0 +_0801DD92: + pop {r1} + bx r1 + thumb_func_end sub_801DD44 + + thumb_func_start sub_801DD98 +sub_801DD98: @ 801DD98 + push {r4,lr} + ldr r4, =0x02022c84 + movs r0, 0xDE + lsls r0, 1 + bl Alloc + str r0, [r4] + bl sub_801DDD0 + ldr r1, =0x030022b0 + movs r0, 0x14 + strh r0, [r1] + movs r0, 0 + bl SetVBlankCallback + ldr r0, =c2_081284E0 + bl SetMainCallback2 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801DD98 + + thumb_func_start sub_801DDD0 +sub_801DDD0: @ 801DDD0 + push {r4-r7,lr} + adds r4, r0, 0 + movs r5, 0 + movs r0, 0 + strh r0, [r4, 0x4] + strh r0, [r4, 0x6] + strb r5, [r4, 0x10] + strb r5, [r4, 0x11] + strb r5, [r4, 0x12] + strb r5, [r4, 0x14] + strb r5, [r4, 0x15] + strb r5, [r4, 0x16] + movs r0, 0xFF + strb r0, [r4, 0x1A] + bl sub_8009FCC + strb r0, [r4, 0xD] + bl link_get_multiplayer_id + strb r0, [r4, 0x13] + strb r5, [r4, 0x17] + strb r5, [r4, 0x18] + movs r1, 0xC8 + lsls r1, 1 + adds r0, r4, r1 + bl sub_801EF1C + ldr r7, =0x03005d8c + ldr r6, =0x00003c88 + adds r4, 0xB9 + movs r5, 0x9 +_0801DE0E: + ldr r1, [r7] + adds r1, r6 + adds r0, r4, 0 + bl CopyString + adds r6, 0x15 + adds r4, 0x15 + subs r5, 0x1 + cmp r5, 0 + bge _0801DE0E + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801DDD0 + + thumb_func_start sub_801DE30 +sub_801DE30: @ 801DE30 + push {r4,lr} + ldr r4, =0x02022c84 + ldr r0, [r4] + ldrb r0, [r0, 0xE] + bl remove_task + ldr r0, [r4] + ldrb r0, [r0, 0xF] + bl remove_task + ldr r0, [r4] + bl Free + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801DE30 + + thumb_func_start c2_081284E0 +c2_081284E0: @ 801DE54 + push {r4-r6,lr} + sub sp, 0x4 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r6, r0, r1 + ldrb r0, [r6] + cmp r0, 0x1 + beq _0801DE8C + cmp r0, 0x1 + bgt _0801DE74 + cmp r0, 0 + beq _0801DE7A + b _0801DF04 + .pool +_0801DE74: + cmp r0, 0x2 + beq _0801DEC8 + b _0801DF04 +_0801DE7A: + bl clear_tasks + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + bl sub_801F4D0 + b _0801DEBC +_0801DE8C: + bl sub_801F5B8 + bl sub_801F534 + adds r5, r0, 0 + cmp r5, 0 + bne _0801DF04 + movs r4, 0x1 + negs r4, r4 + adds r0, r4, 0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + str r5, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r0, =sub_801DF20 + bl SetVBlankCallback +_0801DEBC: + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] + b _0801DF04 + .pool +_0801DEC8: + bl fade_and_return_progress_probably + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0801DF04 + ldr r0, =sub_801DF38 + bl SetMainCallback2 + ldr r0, =sub_801DF54 + movs r1, 0x8 + bl AddTask + ldr r4, =0x02022c84 + ldr r1, [r4] + strb r0, [r1, 0xE] + ldr r0, =sub_801F2B4 + movs r1, 0x7 + bl AddTask + ldr r1, [r4] + strb r0, [r1, 0xF] + bl sub_800E0E8 + movs r0, 0xE8 + movs r1, 0x96 + bl sub_800DFB4 +_0801DF04: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end c2_081284E0 + + thumb_func_start sub_801DF20 +sub_801DF20: @ 801DF20 + push {lr} + bl copy_pal_bg_faded_to_pal_ram + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl sub_80BA0A8 + pop {r0} + bx r0 + thumb_func_end sub_801DF20 + + thumb_func_start sub_801DF38 +sub_801DF38: @ 801DF38 + push {lr} + bl RunActiveTasks + bl sub_801F5B8 + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_801DF38 + + thumb_func_start sub_801DF54 +sub_801DF54: @ 801DF54 + push {r4,lr} + ldr r4, =0x02022c84 + ldr r0, [r4] + ldrb r0, [r0, 0x17] + cmp r0, 0x2 + beq _0801DF7A + cmp r0, 0x2 + bgt _0801DF70 + cmp r0, 0x1 + beq _0801DF76 + b _0801DF8A + .pool +_0801DF70: + cmp r0, 0x3 + beq _0801DF7E + b _0801DF8A +_0801DF76: + movs r0, 0x6 + b _0801DF80 +_0801DF7A: + movs r0, 0x7 + b _0801DF80 +_0801DF7E: + movs r0, 0x8 +_0801DF80: + bl sub_801EBD4 + ldr r1, [r4] + movs r0, 0 + strb r0, [r1, 0x17] +_0801DF8A: + ldr r1, =gUnknown_082F2A7C + ldr r0, =0x02022c84 + ldr r0, [r0] + ldrh r0, [r0, 0x4] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801DF54 + + thumb_func_start sub_801DFAC +sub_801DFAC: @ 801DFAC + push {r4,lr} + ldr r4, =0x02022c84 + ldr r0, [r4] + ldrh r1, [r0, 0x6] + cmp r1, 0x1 + beq _0801DFE0 + cmp r1, 0x1 + bgt _0801DFC8 + cmp r1, 0 + beq _0801DFCE + b _0801E028 + .pool +_0801DFC8: + cmp r1, 0x2 + beq _0801E018 + b _0801E028 +_0801DFCE: + movs r1, 0xC8 + lsls r1, 1 + adds r0, r1 + bl sub_801EF24 + ldr r1, [r4] + ldrh r0, [r1, 0x6] + adds r0, 0x1 + strh r0, [r1, 0x6] +_0801DFE0: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _0801E028 + bl sub_8011A9C + cmp r0, 0 + bne _0801E028 + ldr r4, =0x02022c84 + ldr r1, [r4] + movs r0, 0xC8 + lsls r0, 1 + adds r1, r0 + movs r0, 0 + movs r2, 0x28 + bl link_0800A448 + lsls r0, 24 + cmp r0, 0 + beq _0801E028 + ldr r1, [r4] + ldrh r0, [r1, 0x6] + adds r0, 0x1 + strh r0, [r1, 0x6] + b _0801E028 + .pool +_0801E018: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _0801E028 + movs r0, 0x1 + bl sub_801EBD4 +_0801E028: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_801DFAC + + thumb_func_start sub_801E030 +sub_801E030: @ 801E030 + push {r4,r5,lr} + ldr r5, =0x02022c84 + ldr r3, [r5] + ldrh r0, [r3, 0x6] + cmp r0, 0 + beq _0801E048 + cmp r0, 0x1 + beq _0801E0F6 + b _0801E118 + .pool +_0801E048: + ldr r1, =0x030022c0 + ldrh r2, [r1, 0x2E] + movs r0, 0x8 + ands r0, r2 + cmp r0, 0 + beq _0801E068 + ldrb r0, [r3, 0x15] + cmp r0, 0 + beq _0801E118 + movs r0, 0x4 + bl sub_801EBD4 + b _0801E118 + .pool +_0801E068: + movs r0, 0x4 + ands r0, r2 + cmp r0, 0 + beq _0801E078 + movs r0, 0x2 + bl sub_801EBD4 + b _0801E118 +_0801E078: + ldrh r1, [r1, 0x30] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0801E0A4 + ldrb r0, [r3, 0x15] + cmp r0, 0 + beq _0801E09C + bl sub_801ED68 + movs r0, 0x8 + movs r1, 0 + bl sub_801F5EC + ldr r1, [r5] + movs r0, 0x1 + strh r0, [r1, 0x6] + b _0801E118 +_0801E09C: + movs r0, 0x3 + bl sub_801EBD4 + b _0801E118 +_0801E0A4: + movs r4, 0x1 + adds r0, r4, 0 + ands r0, r2 + cmp r0, 0 + beq _0801E0C0 + bl sub_801EC94 + movs r0, 0x8 + movs r1, 0 + bl sub_801F5EC + movs r0, 0x2 + movs r1, 0x1 + b _0801E0EC +_0801E0C0: + movs r0, 0x80 + lsls r0, 1 + ands r0, r2 + cmp r0, 0 + beq _0801E0E0 + ldrb r0, [r3, 0x10] + cmp r0, 0x3 + beq _0801E0D8 + bl sub_801ED94 + movs r0, 0x8 + b _0801E0EA +_0801E0D8: + movs r0, 0x5 + bl sub_801EBD4 + b _0801E118 +_0801E0E0: + bl sub_801EBE4 + cmp r0, 0 + beq _0801E118 + movs r0, 0x1 +_0801E0EA: + movs r1, 0 +_0801E0EC: + bl sub_801F5EC + ldr r0, [r5] + strh r4, [r0, 0x6] + b _0801E118 +_0801E0F6: + movs r0, 0 + bl sub_801F644 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + bl sub_801F644 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r4, 0 + bne _0801E118 + cmp r1, 0 + bne _0801E118 + ldr r0, [r5] + strh r1, [r0, 0x6] +_0801E118: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_801E030 + + thumb_func_start sub_801E120 +sub_801E120: @ 801E120 + push {r4-r6,lr} + ldr r0, =0x02022c84 + ldr r0, [r0] + ldrh r0, [r0, 0x6] + cmp r0, 0x4 + bls _0801E12E + b _0801E23A +_0801E12E: + lsls r0, 2 + ldr r1, =_0801E140 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0801E140: + .4byte _0801E154 + .4byte _0801E15E + .4byte _0801E17C + .4byte _0801E208 + .4byte _0801E21C +_0801E154: + movs r0, 0x3 + movs r1, 0 + bl sub_801F5EC + b _0801E16A +_0801E15E: + movs r0, 0 + bl sub_801F644 + lsls r0, 24 + cmp r0, 0 + bne _0801E23A +_0801E16A: + ldr r0, =0x02022c84 + ldr r1, [r0] + ldrh r0, [r1, 0x6] + adds r0, 0x1 + strh r0, [r1, 0x6] + b _0801E23A + .pool +_0801E17C: + bl ProcessMenuInput + lsls r0, 24 + asrs r0, 8 + lsrs r6, r0, 16 + asrs r4, r0, 16 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _0801E1B4 + adds r0, 0x1 + cmp r4, r0 + beq _0801E1D4 + movs r0, 0x4 + movs r1, 0 + bl sub_801F5EC + ldr r5, =0x02022c84 + ldr r2, [r5] + ldrb r0, [r2, 0x10] + cmp r0, r4 + beq _0801E1DC + cmp r4, 0x3 + ble _0801E1EC + b _0801E1DC + .pool +_0801E1B4: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0801E23A + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + bl MoveMenuCursor + b _0801E23A + .pool +_0801E1D4: + movs r0, 0x4 + movs r1, 0 + bl sub_801F5EC +_0801E1DC: + ldr r0, =0x02022c84 + ldr r1, [r0] + movs r0, 0x3 + strh r0, [r1, 0x6] + b _0801E23A + .pool +_0801E1EC: + movs r1, 0 + strb r1, [r2, 0x11] + ldr r0, [r5] + strb r1, [r0, 0x12] + movs r0, 0x5 + movs r1, 0x1 + bl sub_801F5EC + ldr r0, [r5] + strb r6, [r0, 0x10] + ldr r1, [r5] + movs r0, 0x4 + strh r0, [r1, 0x6] + b _0801E23A +_0801E208: + movs r0, 0 + bl sub_801F644 + lsls r0, 24 + cmp r0, 0 + bne _0801E23A + movs r0, 0x1 + bl sub_801EBD4 + b _0801E23A +_0801E21C: + movs r0, 0 + bl sub_801F644 + lsls r0, 24 + cmp r0, 0 + bne _0801E23A + movs r0, 0x1 + bl sub_801F644 + lsls r0, 24 + cmp r0, 0 + bne _0801E23A + movs r0, 0x1 + bl sub_801EBD4 +_0801E23A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_801E120 + + thumb_func_start sub_801E240 +sub_801E240: @ 801E240 + push {r4,r5,lr} + ldr r1, =0x02022c84 + ldr r0, [r1] + ldrh r0, [r0, 0x6] + adds r2, r1, 0 + cmp r0, 0xA + bls _0801E250 + b _0801E458 +_0801E250: + lsls r0, 2 + ldr r1, =_0801E264 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0801E264: + .4byte _0801E290 + .4byte _0801E2A8 + .4byte _0801E2C4 + .4byte _0801E322 + .4byte _0801E3D4 + .4byte _0801E424 + .4byte _0801E458 + .4byte _0801E458 + .4byte _0801E378 + .4byte _0801E338 + .4byte _0801E35C +_0801E290: + movs r0, 0x6 + movs r1, 0 + bl sub_801F5EC + ldr r0, =0x02022c84 + ldr r1, [r0] + movs r0, 0x1 + strh r0, [r1, 0x6] + b _0801E458 + .pool +_0801E2A8: + movs r0, 0 + bl sub_801F644 + lsls r0, 24 + cmp r0, 0 + beq _0801E2B6 + b _0801E458 +_0801E2B6: + ldr r0, =0x02022c84 + ldr r1, [r0] + movs r0, 0x2 + strh r0, [r1, 0x6] + b _0801E458 + .pool +_0801E2C4: + bl sub_801FF08 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _0801E2E6 + cmp r1, 0 + bgt _0801E2DE + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0801E396 + b _0801E458 +_0801E2DE: + cmp r1, 0x1 + beq _0801E2E4 + b _0801E458 +_0801E2E4: + b _0801E396 +_0801E2E6: + ldr r4, =0x02022c84 + ldr r1, [r4] + ldrb r0, [r1, 0x13] + cmp r0, 0 + bne _0801E310 + movs r2, 0xC8 + lsls r2, 1 + adds r0, r1, r2 + bl sub_801EFD0 + movs r0, 0x7 + movs r1, 0 + bl sub_801F5EC + ldr r1, [r4] + movs r0, 0x9 + strh r0, [r1, 0x6] + b _0801E458 + .pool +_0801E310: + movs r2, 0xC8 + lsls r2, 1 + adds r0, r1, r2 + bl sub_801EF7C + ldr r1, [r4] + movs r0, 0x4 + strh r0, [r1, 0x6] + b _0801E458 +_0801E322: + movs r0, 0 + bl sub_801F644 + lsls r0, 24 + cmp r0, 0 + beq _0801E330 + b _0801E458 +_0801E330: + movs r0, 0x1 + bl sub_801EBD4 + b _0801E458 +_0801E338: + movs r0, 0 + bl sub_801F644 + lsls r0, 24 + cmp r0, 0 + beq _0801E346 + b _0801E458 +_0801E346: + movs r0, 0x14 + movs r1, 0 + bl sub_801F5EC + ldr r0, =0x02022c84 + ldr r1, [r0] + movs r0, 0xA + strh r0, [r1, 0x6] + b _0801E458 + .pool +_0801E35C: + movs r0, 0 + bl sub_801F644 + lsls r0, 24 + cmp r0, 0 + beq _0801E36A + b _0801E458 +_0801E36A: + ldr r0, =0x02022c84 + ldr r1, [r0] + movs r0, 0x8 + strh r0, [r1, 0x6] + b _0801E458 + .pool +_0801E378: + bl sub_801FF08 + lsls r0, 24 + asrs r5, r0, 24 + cmp r5, 0 + beq _0801E3AC + cmp r5, 0 + bgt _0801E392 + movs r0, 0x1 + negs r0, r0 + cmp r5, r0 + beq _0801E396 + b _0801E458 +_0801E392: + cmp r5, 0x1 + bne _0801E458 +_0801E396: + movs r0, 0x7 + movs r1, 0 + bl sub_801F5EC + ldr r0, =0x02022c84 + ldr r1, [r0] + movs r0, 0x3 + strh r0, [r1, 0x6] + b _0801E458 + .pool +_0801E3AC: + bl sub_80104B0 + ldr r4, =0x02022c84 + ldr r0, [r4] + movs r1, 0xC8 + lsls r1, 1 + adds r0, r1 + bl sub_801EFD0 + ldr r0, [r4] + movs r1, 0x4 + strh r1, [r0, 0x6] + movs r2, 0xDC + lsls r2, 1 + adds r0, r2 + strh r5, [r0] + b _0801E458 + .pool +_0801E3D4: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _0801E414 + bl sub_8011A9C + cmp r0, 0 + bne _0801E414 + ldr r4, =0x02022c84 + ldr r1, [r4] + movs r0, 0xC8 + lsls r0, 1 + adds r1, r0 + movs r0, 0 + movs r2, 0x28 + bl link_0800A448 + lsls r0, 24 + cmp r0, 0 + beq _0801E414 + ldr r1, [r4] + ldrb r0, [r1, 0x13] + cmp r0, 0 + bne _0801E410 + movs r0, 0x6 + b _0801E412 + .pool +_0801E410: + movs r0, 0x5 +_0801E412: + strh r0, [r1, 0x6] +_0801E414: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _0801E458 + b _0801E42C + .pool +_0801E424: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _0801E438 +_0801E42C: + movs r0, 0x9 + bl sub_801EBD4 + b _0801E458 + .pool +_0801E438: + ldr r3, [r2] + movs r1, 0xDC + lsls r1, 1 + adds r2, r3, r1 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + lsls r0, 16 + movs r1, 0x96 + lsls r1, 17 + cmp r0, r1 + bls _0801E458 + movs r0, 0 + strh r0, [r2] + movs r0, 0x4 + strh r0, [r3, 0x6] +_0801E458: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_801E240 + + thumb_func_start sub_801E460 +sub_801E460: @ 801E460 + push {r4,lr} + ldr r1, =0x02022c84 + ldr r0, [r1] + ldrh r0, [r0, 0x6] + adds r2, r1, 0 + cmp r0, 0x7 + bls _0801E470 + b _0801E5BC +_0801E470: + lsls r0, 2 + ldr r1, =_0801E484 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0801E484: + .4byte _0801E4A4 + .4byte _0801E4C8 + .4byte _0801E4E8 + .4byte _0801E50C + .4byte _0801E540 + .4byte _0801E560 + .4byte _0801E584 + .4byte _0801E5A8 +_0801E4A4: + ldr r0, =sub_801F2B4 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + beq _0801E4B2 + b _0801E5BC +_0801E4B2: + movs r0, 0x7 + movs r1, 0 + bl sub_801F5EC + ldr r0, =0x02022c84 + ldr r1, [r0] + b _0801E59A + .pool +_0801E4C8: + movs r0, 0 + bl sub_801F644 + lsls r0, 24 + cmp r0, 0 + bne _0801E5BC + movs r0, 0x12 + movs r1, 0 + bl sub_801F5EC + ldr r0, =0x02022c84 + ldr r1, [r0] + b _0801E59A + .pool +_0801E4E8: + movs r0, 0 + bl sub_801F644 + lsls r0, 24 + cmp r0, 0 + bne _0801E5BC + ldr r4, =0x02022c84 + ldr r0, [r4] + movs r1, 0xC8 + lsls r1, 1 + adds r0, r1 + bl sub_801EFA8 + ldr r1, [r4] + b _0801E59A + .pool +_0801E50C: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _0801E5BC + bl sub_8011A9C + cmp r0, 0 + bne _0801E5BC + ldr r4, =0x02022c84 + ldr r1, [r4] + movs r0, 0xC8 + lsls r0, 1 + adds r1, r0 + movs r0, 0 + movs r2, 0x28 + bl link_0800A448 + lsls r0, 24 + cmp r0, 0 + beq _0801E5BC + ldr r1, [r4] + b _0801E59A + .pool +_0801E540: + bl sub_800A550 + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0801E5BC + bl sub_8011A9C + cmp r0, 0 + bne _0801E5BC + ldr r0, =0x02022c84 + ldr r1, [r0] + b _0801E59A + .pool +_0801E560: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _0801E5BC + bl sub_8011A9C + adds r4, r0, 0 + cmp r4, 0 + bne _0801E5BC + bl sub_800AC34 + ldr r0, =0x02022c84 + ldr r1, [r0] + strh r4, [r1, 0xA] + b _0801E59A + .pool +_0801E584: + ldr r1, [r2] + ldrh r0, [r1, 0xA] + cmp r0, 0x95 + bhi _0801E590 + adds r0, 0x1 + strh r0, [r1, 0xA] +_0801E590: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _0801E5BC + ldr r1, [r2] +_0801E59A: + ldrh r0, [r1, 0x6] + adds r0, 0x1 + strh r0, [r1, 0x6] + b _0801E5BC + .pool +_0801E5A8: + ldr r1, [r2] + ldrh r0, [r1, 0xA] + cmp r0, 0x95 + bls _0801E5B8 + movs r0, 0x9 + bl sub_801EBD4 + b _0801E5BC +_0801E5B8: + adds r0, 0x1 + strh r0, [r1, 0xA] +_0801E5BC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_801E460 + + thumb_func_start sub_801E5C4 +sub_801E5C4: @ 801E5C4 + push {r4,r5,lr} + ldr r5, =0x02022c84 + ldr r1, [r5] + ldrh r0, [r1, 0x6] + cmp r0, 0x1 + beq _0801E604 + cmp r0, 0x1 + bgt _0801E5E0 + cmp r0, 0 + beq _0801E5EA + b _0801E662 + .pool +_0801E5E0: + cmp r0, 0x2 + beq _0801E62E + cmp r0, 0x3 + beq _0801E650 + b _0801E662 +_0801E5EA: + ldr r0, =sub_801F2B4 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _0801E662 + movs r0, 0x7 + movs r1, 0 + bl sub_801F5EC + b _0801E640 + .pool +_0801E604: + movs r0, 0 + bl sub_801F644 + lsls r0, 24 + cmp r0, 0 + bne _0801E662 + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _0801E662 + bl sub_8011A9C + adds r4, r0, 0 + cmp r4, 0 + bne _0801E662 + bl sub_800AC34 + ldr r1, [r5] + strh r4, [r1, 0xA] + b _0801E642 +_0801E62E: + ldrh r0, [r1, 0xA] + cmp r0, 0x95 + bhi _0801E638 + adds r0, 0x1 + strh r0, [r1, 0xA] +_0801E638: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _0801E662 +_0801E640: + ldr r1, [r5] +_0801E642: + ldrh r0, [r1, 0x6] + adds r0, 0x1 + strh r0, [r1, 0x6] + b _0801E662 + .pool +_0801E650: + ldrh r0, [r1, 0xA] + cmp r0, 0x95 + bls _0801E65E + movs r0, 0x9 + bl sub_801EBD4 + b _0801E662 +_0801E65E: + adds r0, 0x1 + strh r0, [r1, 0xA] +_0801E662: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_801E5C4 + + thumb_func_start sub_801E668 +sub_801E668: @ 801E668 + push {r4,lr} + ldr r1, =0x02022c84 + ldr r0, [r1] + ldrh r0, [r0, 0x6] + adds r2, r1, 0 + cmp r0, 0x4 + bhi _0801E75C + lsls r0, 2 + ldr r1, =_0801E688 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0801E688: + .4byte _0801E69C + .4byte _0801E6C8 + .4byte _0801E6F0 + .4byte _0801E724 + .4byte _0801E748 +_0801E69C: + ldr r0, =sub_801F2B4 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _0801E75C + ldr r4, =0x02022c84 + ldr r0, [r4] + ldrb r0, [r0, 0x13] + cmp r0, 0 + beq _0801E6BA + movs r0, 0x7 + movs r1, 0 + bl sub_801F5EC +_0801E6BA: + ldr r1, [r4] + b _0801E73A + .pool +_0801E6C8: + movs r0, 0 + bl sub_801F644 + lsls r0, 24 + cmp r0, 0 + bne _0801E75C + ldr r4, =0x02022c84 + ldr r0, [r4] + ldrb r0, [r0, 0x13] + cmp r0, 0 + beq _0801E6E6 + movs r0, 0x13 + movs r1, 0 + bl sub_801F5EC +_0801E6E6: + ldr r1, [r4] + b _0801E73A + .pool +_0801E6F0: + movs r0, 0 + bl sub_801F644 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0801E75C + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _0801E75C + bl sub_8011A9C + adds r4, r0, 0 + cmp r4, 0 + bne _0801E75C + bl sub_800AC34 + ldr r0, =0x02022c84 + ldr r1, [r0] + strh r4, [r1, 0xA] + b _0801E73A + .pool +_0801E724: + ldr r1, [r2] + ldrh r0, [r1, 0xA] + cmp r0, 0x95 + bhi _0801E730 + adds r0, 0x1 + strh r0, [r1, 0xA] +_0801E730: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _0801E75C + ldr r1, [r2] +_0801E73A: + ldrh r0, [r1, 0x6] + adds r0, 0x1 + strh r0, [r1, 0x6] + b _0801E75C + .pool +_0801E748: + ldr r1, [r2] + ldrh r0, [r1, 0xA] + cmp r0, 0x95 + bls _0801E758 + movs r0, 0x9 + bl sub_801EBD4 + b _0801E75C +_0801E758: + adds r0, 0x1 + strh r0, [r1, 0xA] +_0801E75C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_801E668 + + thumb_func_start sub_801E764 +sub_801E764: @ 801E764 + push {r4,lr} + ldr r1, =0x02022c84 + ldr r0, [r1] + ldrh r0, [r0, 0x6] + adds r4, r1, 0 + cmp r0, 0x4 + bhi _0801E830 + lsls r0, 2 + ldr r1, =_0801E784 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0801E784: + .4byte _0801E798 + .4byte _0801E7C0 + .4byte _0801E7F4 + .4byte _0801E802 + .4byte _0801E820 +_0801E798: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _0801E7AC + movs r0, 0x1 + bl sub_801EBD4 + b _0801E830 + .pool +_0801E7AC: + ldr r0, [r4] + movs r1, 0xC8 + lsls r1, 1 + adds r0, r1 + bl sub_801EF4C + ldr r1, [r4] + ldrh r0, [r1, 0x6] + adds r0, 0x1 + strh r0, [r1, 0x6] +_0801E7C0: + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0801E830 + bl sub_8011A9C + cmp r0, 0 + bne _0801E830 + ldr r4, =0x02022c84 + ldr r1, [r4] + movs r0, 0xC8 + lsls r0, 1 + adds r1, r0 + movs r0, 0 + movs r2, 0x28 + bl link_0800A448 + lsls r0, 24 + cmp r0, 0 + beq _0801E830 + ldr r1, [r4] + b _0801E812 + .pool +_0801E7F4: + bl sub_801EE10 + movs r0, 0x8 + movs r1, 0 + bl sub_801F5EC + b _0801E80E +_0801E802: + movs r0, 0 + bl sub_801F644 + lsls r0, 24 + cmp r0, 0 + bne _0801E830 +_0801E80E: + ldr r0, =0x02022c84 + ldr r1, [r0] +_0801E812: + ldrh r0, [r1, 0x6] + adds r0, 0x1 + strh r0, [r1, 0x6] + b _0801E830 + .pool +_0801E820: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _0801E830 + movs r0, 0x1 + bl sub_801EBD4 +_0801E830: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_801E764 + + thumb_func_start sub_801E838 +sub_801E838: @ 801E838 + push {r4,lr} + ldr r0, =0x02022c84 + ldr r0, [r0] + ldrh r0, [r0, 0x6] + cmp r0, 0x6 + bls _0801E846 + b _0801E968 +_0801E846: + lsls r0, 2 + ldr r1, =_0801E858 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0801E858: + .4byte _0801E874 + .4byte _0801E8A4 + .4byte _0801E8F8 + .4byte _0801E910 + .4byte _0801E920 + .4byte _0801E934 + .4byte _0801E94C +_0801E874: + bl sub_801EDC4 + cmp r0, 0 + beq _0801E890 + movs r0, 0x9 + movs r1, 0 + bl sub_801F5EC + ldr r0, =0x02022c84 + ldr r1, [r0] + movs r0, 0x2 + b _0801E966 + .pool +_0801E890: + movs r0, 0xD + movs r1, 0 + bl sub_801F5EC + ldr r0, =0x02022c84 + ldr r1, [r0] + movs r0, 0x5 + b _0801E966 + .pool +_0801E8A4: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0801E8CC + bl sub_801EDE0 + movs r0, 0xB + movs r1, 0 + bl sub_801F5EC + ldr r0, =0x02022c84 + ldr r1, [r0] + movs r0, 0x3 + b _0801E966 + .pool +_0801E8CC: + movs r4, 0x2 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _0801E8DA + movs r0, 0xA + b _0801E95A +_0801E8DA: + bl sub_801EBE4 + cmp r0, 0 + beq _0801E968 + movs r0, 0x1 + movs r1, 0 + bl sub_801F5EC + ldr r0, =0x02022c84 + ldr r0, [r0] + strh r4, [r0, 0x6] + b _0801E968 + .pool +_0801E8F8: + movs r0, 0 + bl sub_801F644 + lsls r0, 24 + cmp r0, 0 + bne _0801E968 + ldr r0, =0x02022c84 + ldr r1, [r0] + movs r0, 0x1 + b _0801E966 + .pool +_0801E910: + movs r0, 0 + bl sub_801F644 + lsls r0, 24 + cmp r0, 0 + bne _0801E968 + movs r0, 0xA + b _0801E95A +_0801E920: + movs r0, 0 + bl sub_801F644 + lsls r0, 24 + cmp r0, 0 + bne _0801E968 + movs r0, 0x1 + bl sub_801EBD4 + b _0801E968 +_0801E934: + movs r0, 0 + bl sub_801F644 + lsls r0, 24 + cmp r0, 0 + bne _0801E968 + ldr r0, =0x02022c84 + ldr r1, [r0] + movs r0, 0x6 + b _0801E966 + .pool +_0801E94C: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _0801E968 + movs r0, 0x7 +_0801E95A: + movs r1, 0 + bl sub_801F5EC + ldr r0, =0x02022c84 + ldr r1, [r0] + movs r0, 0x4 +_0801E966: + strh r0, [r1, 0x6] +_0801E968: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801E838 + + thumb_func_start sub_801E978 +sub_801E978: @ 801E978 + push {r4,lr} + sub sp, 0x4 + ldr r1, =0x02022c84 + ldr r0, [r1] + ldrh r0, [r0, 0x6] + adds r4, r1, 0 + cmp r0, 0xD + bls _0801E98A + b _0801EBC2 +_0801E98A: + lsls r0, 2 + ldr r1, =_0801E99C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0801E99C: + .4byte _0801E9D4 + .4byte _0801E9EE + .4byte _0801EA14 + .4byte _0801EA58 + .4byte _0801EA7C + .4byte _0801EA98 + .4byte _0801EADC + .4byte _0801EB04 + .4byte _0801EB28 + .4byte _0801EB40 + .4byte _0801EB64 + .4byte _0801EB72 + .4byte _0801EB88 + .4byte _0801EBA8 +_0801E9D4: + ldr r1, [r4] + ldrb r0, [r1, 0x18] + cmp r0, 0 + bne _0801E9DE + b _0801EB82 +_0801E9DE: + movs r0, 0x7 + movs r1, 0 + bl sub_801F5EC + ldr r1, [r4] + movs r0, 0x1 + strh r0, [r1, 0x6] + b _0801EBC2 +_0801E9EE: + movs r0, 0 + bl sub_801F644 + lsls r0, 24 + cmp r0, 0 + beq _0801E9FC + b _0801EBC2 +_0801E9FC: + movs r0, 0xE + movs r1, 0 + bl sub_801F5EC + ldr r0, =0x02022c84 + ldr r1, [r0] + movs r0, 0x2 + strh r0, [r1, 0x6] + b _0801EBC2 + .pool +_0801EA14: + bl sub_801FF08 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _0801EA40 + cmp r1, 0 + bgt _0801EA2E + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0801EA34 + b _0801EBC2 +_0801EA2E: + cmp r1, 0x1 + beq _0801EA34 + b _0801EBC2 +_0801EA34: + ldr r0, =0x02022c84 + ldr r1, [r0] + b _0801EB82 + .pool +_0801EA40: + movs r0, 0x7 + movs r1, 0 + bl sub_801F5EC + ldr r0, =0x02022c84 + ldr r1, [r0] + movs r0, 0x3 + strh r0, [r1, 0x6] + b _0801EBC2 + .pool +_0801EA58: + movs r0, 0 + bl sub_801F644 + lsls r0, 24 + cmp r0, 0 + beq _0801EA66 + b _0801EBC2 +_0801EA66: + movs r0, 0xF + movs r1, 0 + bl sub_801F5EC + ldr r0, =0x02022c84 + ldr r1, [r0] + movs r0, 0x4 + strh r0, [r1, 0x6] + b _0801EBC2 + .pool +_0801EA7C: + movs r0, 0 + bl sub_801F644 + lsls r0, 24 + cmp r0, 0 + beq _0801EA8A + b _0801EBC2 +_0801EA8A: + ldr r0, =0x02022c84 + ldr r1, [r0] + movs r0, 0x5 + strh r0, [r1, 0x6] + b _0801EBC2 + .pool +_0801EA98: + bl sub_801FF08 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _0801EAC4 + cmp r1, 0 + bgt _0801EAB2 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0801EAB8 + b _0801EBC2 +_0801EAB2: + cmp r1, 0x1 + beq _0801EAB8 + b _0801EBC2 +_0801EAB8: + ldr r0, =0x02022c84 + ldr r1, [r0] + b _0801EB82 + .pool +_0801EAC4: + movs r0, 0x7 + movs r1, 0 + bl sub_801F5EC + ldr r0, =0x02022c84 + ldr r1, [r0] + movs r0, 0x6 + strh r0, [r1, 0x6] + b _0801EBC2 + .pool +_0801EADC: + movs r0, 0 + bl sub_801F644 + lsls r0, 24 + cmp r0, 0 + bne _0801EBC2 + movs r0, 0x10 + movs r1, 0 + bl sub_801F5EC + bl sub_801EE2C + ldr r0, =0x02022c84 + ldr r1, [r0] + movs r0, 0x7 + strh r0, [r1, 0x6] + b _0801EBC2 + .pool +_0801EB04: + movs r0, 0 + bl sub_801F644 + lsls r0, 24 + cmp r0, 0 + bne _0801EBC2 + bl sub_8076D5C + movs r0, 0 + bl save_game_when_memory_present + ldr r0, =0x02022c84 + ldr r1, [r0] + movs r0, 0x8 + strh r0, [r1, 0x6] + b _0801EBC2 + .pool +_0801EB28: + movs r0, 0x11 + movs r1, 0 + bl sub_801F5EC + ldr r0, =0x02022c84 + ldr r1, [r0] + movs r0, 0x9 + strh r0, [r1, 0x6] + b _0801EBC2 + .pool +_0801EB40: + movs r0, 0 + bl sub_801F644 + lsls r0, 24 + cmp r0, 0 + bne _0801EBC2 + movs r0, 0x37 + bl audio_play + bl sav2_gender2_inplace_and_xFE + ldr r0, =0x02022c84 + ldr r1, [r0] + movs r0, 0xA + strh r0, [r1, 0x6] + b _0801EBC2 + .pool +_0801EB64: + ldr r1, [r4] + movs r0, 0 + strb r0, [r1, 0x19] + ldr r1, [r4] + movs r0, 0xB + strh r0, [r1, 0x6] + b _0801EBC2 +_0801EB72: + ldr r0, [r4] + ldrb r1, [r0, 0x19] + adds r1, 0x1 + strb r1, [r0, 0x19] + ldr r1, [r4] + ldrb r0, [r1, 0x19] + cmp r0, 0x78 + bls _0801EBC2 +_0801EB82: + movs r0, 0xC + strh r0, [r1, 0x6] + b _0801EBC2 +_0801EB88: + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x02022c84 + ldr r1, [r0] + movs r0, 0xD + strh r0, [r1, 0x6] + b _0801EBC2 + .pool +_0801EBA8: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0801EBC2 + bl sub_801F544 + bl sub_801DE30 + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 +_0801EBC2: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801E978 + + thumb_func_start sub_801EBD4 +sub_801EBD4: @ 801EBD4 + ldr r1, =0x02022c84 + ldr r1, [r1] + movs r2, 0 + strh r0, [r1, 0x4] + strh r2, [r1, 0x6] + bx lr + .pool + thumb_func_end sub_801EBD4 + + thumb_func_start sub_801EBE4 +sub_801EBE4: @ 801EBE4 + push {lr} + ldr r0, =0x030022c0 + ldrh r2, [r0, 0x30] + movs r0, 0x40 + ands r0, r2 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0 + bne _0801EC6E + movs r0, 0x80 + ands r0, r2 + cmp r0, 0 + beq _0801EC24 + ldr r0, =0x02022c84 + ldr r2, [r0] + ldr r1, =gUnknown_082F2AA4 + ldrb r0, [r2, 0x10] + adds r0, r1 + ldrb r1, [r2, 0x12] + ldrb r0, [r0] + cmp r1, r0 + bcs _0801EC20 + adds r0, r1, 0x1 + b _0801EC88 + .pool +_0801EC20: + strb r3, [r2, 0x12] + b _0801EC8A +_0801EC24: + ldr r0, =0x02022c84 + ldr r1, [r0] + ldrb r0, [r1, 0x10] + cmp r0, 0x3 + beq _0801EC6A + movs r0, 0x20 + ands r0, r2 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0 + beq _0801EC52 + ldrb r0, [r1, 0x11] + cmp r0, 0 + beq _0801EC4C + subs r0, 0x1 + strb r0, [r1, 0x11] + b _0801EC8A + .pool +_0801EC4C: + movs r0, 0x4 + strb r0, [r1, 0x11] + b _0801EC8A +_0801EC52: + movs r0, 0x10 + ands r0, r2 + cmp r0, 0 + beq _0801EC6A + ldrb r0, [r1, 0x11] + cmp r0, 0x3 + bhi _0801EC66 + adds r0, 0x1 + strb r0, [r1, 0x11] + b _0801EC8A +_0801EC66: + strb r3, [r1, 0x11] + b _0801EC8A +_0801EC6A: + movs r0, 0 + b _0801EC8C +_0801EC6E: + ldr r0, =0x02022c84 + ldr r2, [r0] + ldrb r0, [r2, 0x12] + cmp r0, 0 + beq _0801EC80 + subs r0, 0x1 + b _0801EC88 + .pool +_0801EC80: + ldr r0, =gUnknown_082F2AA4 + ldrb r1, [r2, 0x10] + adds r1, r0 + ldrb r0, [r1] +_0801EC88: + strb r0, [r2, 0x12] +_0801EC8A: + movs r0, 0x1 +_0801EC8C: + pop {r1} + bx r1 + .pool + thumb_func_end sub_801EBE4 + + thumb_func_start sub_801EC94 +sub_801EC94: @ 801EC94 + push {r4-r6,lr} + sub sp, 0x18 + ldr r0, =0x02022c84 + ldr r5, [r0] + ldrb r0, [r5, 0x10] + cmp r0, 0x3 + beq _0801ECDC + ldr r3, =gUnknown_082F2BA8 + ldrb r1, [r5, 0x12] + lsls r1, 2 + adds r2, r0, 0 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, r3 + ldr r4, [r1] + ldrb r0, [r5, 0x11] + cmp r0, 0 + beq _0801ECCE + adds r1, r0, 0 +_0801ECBE: + ldrb r0, [r4] + cmp r0, 0xF9 + bne _0801ECC6 + adds r4, 0x1 +_0801ECC6: + adds r4, 0x1 + subs r1, 0x1 + cmp r1, 0 + bne _0801ECBE +_0801ECCE: + movs r5, 0x1 + b _0801ED02 + .pool +_0801ECDC: + ldrb r0, [r5, 0x12] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r0 + adds r1, 0xB9 + adds r1, r5, r1 + mov r0, sp + bl CopyString + movs r1, 0 + strb r1, [r0] + movs r1, 0xFF + strb r1, [r0, 0x1] + mov r4, sp + mov r0, sp + bl GetStringLength_Multibyte + adds r5, r0, 0 +_0801ED02: + ldr r6, =0x02022c84 + ldr r1, [r6] + ldrb r0, [r1, 0x15] + strb r0, [r1, 0x14] + cmp r4, 0 + beq _0801ED5A + bl sub_801EE84 + adds r2, r0, 0 + subs r5, 0x1 + movs r0, 0x1 + negs r0, r0 + cmp r5, r0 + beq _0801ED56 + ldr r0, [r6] + ldrb r0, [r0, 0x15] + cmp r0, 0xE + bhi _0801ED56 + adds r3, r6, 0 +_0801ED28: + ldrb r0, [r4] + cmp r0, 0xF9 + bne _0801ED34 + strb r0, [r2] + adds r4, 0x1 + adds r2, 0x1 +_0801ED34: + ldrb r0, [r4] + strb r0, [r2] + adds r4, 0x1 + adds r2, 0x1 + ldr r1, [r3] + ldrb r0, [r1, 0x15] + adds r0, 0x1 + strb r0, [r1, 0x15] + subs r5, 0x1 + movs r0, 0x1 + negs r0, r0 + cmp r5, r0 + beq _0801ED56 + ldr r0, [r3] + ldrb r0, [r0, 0x15] + cmp r0, 0xE + bls _0801ED28 +_0801ED56: + movs r0, 0xFF + strb r0, [r2] +_0801ED5A: + add sp, 0x18 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801EC94 + + thumb_func_start sub_801ED68 +sub_801ED68: @ 801ED68 + push {r4,lr} + ldr r4, =0x02022c84 + ldr r1, [r4] + ldrb r0, [r1, 0x15] + strb r0, [r1, 0x14] + ldr r0, [r4] + ldrb r0, [r0, 0x15] + cmp r0, 0 + beq _0801ED8A + bl sub_801EEA8 + movs r1, 0xFF + strb r1, [r0] + ldr r1, [r4] + ldrb r0, [r1, 0x15] + subs r0, 0x1 + strb r0, [r1, 0x15] +_0801ED8A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801ED68 + + thumb_func_start sub_801ED94 +sub_801ED94: @ 801ED94 + push {lr} + ldr r0, =0x02022c84 + ldr r1, [r0] + ldrb r0, [r1, 0x15] + subs r0, 0x1 + strb r0, [r1, 0x14] + bl sub_801EEA8 + adds r2, r0, 0 + ldrb r0, [r2] + cmp r0, 0xF9 + beq _0801EDB8 + ldr r1, =gUnknown_082F2AA8 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0801EDB8 + strb r0, [r2] +_0801EDB8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_801ED94 + + thumb_func_start sub_801EDC4 +sub_801EDC4: @ 801EDC4 + push {lr} + ldr r0, =0x02022c84 + ldr r0, [r0] + ldrb r0, [r0, 0x15] + cmp r0, 0 + bne _0801EDD8 + movs r0, 0 + b _0801EDDA + .pool +_0801EDD8: + movs r0, 0x1 +_0801EDDA: + pop {r1} + bx r1 + thumb_func_end sub_801EDC4 + + thumb_func_start sub_801EDE0 +sub_801EDE0: @ 801EDE0 + push {r4,lr} + bl sub_801F114 + adds r1, r0, 0 + ldr r4, =0x02022c84 + ldr r0, [r4] + ldrb r3, [r0, 0x12] + lsls r2, r3, 2 + adds r2, r3 + lsls r2, 2 + adds r2, r3 + adds r2, 0xB9 + adds r0, r2 + bl CopyString + ldr r1, [r4] + movs r0, 0x1 + strb r0, [r1, 0x18] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801EDE0 + + thumb_func_start sub_801EE10 +sub_801EE10: @ 801EE10 + ldr r1, =0x02022c84 + ldr r2, [r1] + movs r0, 0xFF + strb r0, [r2, 0x1A] + ldr r2, [r1] + movs r3, 0 + movs r0, 0xF + strb r0, [r2, 0x14] + ldr r0, [r1] + strb r3, [r0, 0x15] + bx lr + .pool + thumb_func_end sub_801EE10 + + thumb_func_start sub_801EE2C +sub_801EE2C: @ 801EE2C + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =0x03005d8c + mov r8, r0 + ldr r7, =0x02022c84 + movs r6, 0xB9 + ldr r5, =0x00003c88 + movs r4, 0x9 +_0801EE3E: + mov r1, r8 + ldr r0, [r1] + adds r0, r5 + ldr r1, [r7] + adds r1, r6 + bl CopyString + adds r6, 0x15 + adds r5, 0x15 + subs r4, 0x1 + cmp r4, 0 + bge _0801EE3E + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801EE2C + + thumb_func_start sub_801EE6C +sub_801EE6C: @ 801EE6C + ldr r2, =0x02022c84 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r0 + adds r1, 0xB9 + ldr r0, [r2] + adds r0, r1 + bx lr + .pool + thumb_func_end sub_801EE6C + + thumb_func_start sub_801EE84 +sub_801EE84: @ 801EE84 + push {lr} + ldr r0, =0x02022c84 + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0x1A + ldrb r0, [r0, 0x1A] + cmp r0, 0xFF + beq _0801EE9C +_0801EE94: + adds r1, 0x1 + ldrb r0, [r1] + cmp r0, 0xFF + bne _0801EE94 +_0801EE9C: + adds r0, r1, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_801EE84 + + thumb_func_start sub_801EEA8 +sub_801EEA8: @ 801EEA8 + push {lr} + ldr r0, =0x02022c84 + ldr r0, [r0] + adds r2, r0, 0 + adds r2, 0x1A + adds r1, r2, 0 + ldrb r0, [r0, 0x1A] + cmp r0, 0xFF + beq _0801EECC +_0801EEBA: + adds r2, r1, 0 + ldrb r0, [r2] + cmp r0, 0xF9 + bne _0801EEC4 + adds r1, r2, 0x1 +_0801EEC4: + adds r1, 0x1 + ldrb r0, [r1] + cmp r0, 0xFF + bne _0801EEBA +_0801EECC: + adds r0, r2, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_801EEA8 + + thumb_func_start sub_801EED8 +sub_801EED8: @ 801EED8 + push {r4,lr} + ldr r4, =0x02022c84 + ldr r0, [r4] + adds r0, 0x1A + bl GetStringLength_Multibyte + adds r2, r0, 0 + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0x1A + movs r4, 0 + cmp r2, 0xA + bls _0801EF0C + subs r2, 0xA + movs r3, 0 + cmp r4, r2 + bcs _0801EF0C +_0801EEFA: + ldrb r0, [r1] + cmp r0, 0xF9 + bne _0801EF02 + adds r1, 0x1 +_0801EF02: + adds r1, 0x1 + adds r4, 0x1 + adds r3, 0x1 + cmp r3, r2 + bcc _0801EEFA +_0801EF0C: + lsls r0, r4, 16 + lsrs r0, 16 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_801EED8 + + thumb_func_start sub_801EF1C +sub_801EF1C: @ 801EF1C + movs r1, 0 + strb r1, [r0] + bx lr + thumb_func_end sub_801EF1C + + thumb_func_start sub_801EF24 +sub_801EF24: @ 801EF24 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x2 + strb r0, [r4] + adds r0, r4, 0x1 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + ldr r0, =0x02022c84 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + strb r0, [r4, 0x9] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801EF24 + + thumb_func_start sub_801EF4C +sub_801EF4C: @ 801EF4C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x1 + strb r0, [r4] + adds r0, r4, 0x1 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + adds r4, 0x9 + ldr r0, =0x02022c84 + ldr r1, [r0] + adds r1, 0x1A + adds r0, r4, 0 + bl CopyString + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801EF4C + + thumb_func_start sub_801EF7C +sub_801EF7C: @ 801EF7C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x3 + strb r0, [r4] + adds r0, r4, 0x1 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + ldr r0, =0x02022c84 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + strb r0, [r4, 0x9] + bl sub_8011A50 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801EF7C + + thumb_func_start sub_801EFA8 +sub_801EFA8: @ 801EFA8 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x4 + strb r0, [r4] + adds r0, r4, 0x1 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + ldr r0, =0x02022c84 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + strb r0, [r4, 0x9] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801EFA8 + + thumb_func_start sub_801EFD0 +sub_801EFD0: @ 801EFD0 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x5 + strb r0, [r4] + adds r0, r4, 0x1 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + ldr r0, =0x02022c84 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + strb r0, [r4, 0x9] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801EFD0 + + thumb_func_start sub_801EFF8 +sub_801EFF8: @ 801EFF8 + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r1, 0 + ldrb r0, [r5] + adds r1, r0, 0 + adds r4, r5, 0x1 + adds r5, r4, 0 + adds r5, 0x8 + cmp r0, 0x2 + beq _0801F020 + cmp r0, 0x2 + bgt _0801F016 + cmp r0, 0x1 + beq _0801F044 + b _0801F0A8 +_0801F016: + cmp r1, 0x3 + beq _0801F07A + cmp r1, 0x5 + beq _0801F06E + b _0801F0A8 +_0801F020: + ldr r0, =0x02022c84 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + ldrb r1, [r4, 0x8] + cmp r0, r1 + beq _0801F0A8 + bl sub_81AFBF0 + movs r0, 0 + adds r1, r4, 0 + bl sub_81AFC0C + ldr r1, =gUnknown_085ED2A9 + b _0801F094 + .pool +_0801F044: + adds r0, r6, 0 + adds r1, r4, 0 + bl CopyString + movs r1, 0xFC + strb r1, [r0] + adds r0, 0x1 + movs r1, 0x13 + strb r1, [r0] + adds r0, 0x1 + movs r1, 0x2A + strb r1, [r0] + adds r0, 0x1 + movs r1, 0xF0 + strb r1, [r0] + adds r0, 0x1 + adds r1, r5, 0 + bl CopyString + movs r0, 0x1 + b _0801F0AA +_0801F06E: + ldr r0, =0x02022c84 + ldr r0, [r0] + adds r0, 0x79 + adds r1, r4, 0 + bl CopyString +_0801F07A: + ldr r0, =0x02022c84 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + ldrb r5, [r5] + cmp r0, r5 + beq _0801F0A8 + bl sub_81AFBF0 + movs r0, 0 + adds r1, r4, 0 + bl sub_81AFC0C + ldr r1, =gUnknown_085ED2BD +_0801F094: + adds r0, r6, 0 + bl sub_81AFC28 + movs r0, 0x1 + b _0801F0AA + .pool +_0801F0A8: + movs r0, 0 +_0801F0AA: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_801EFF8 + + thumb_func_start sub_801F0B0 +sub_801F0B0: @ 801F0B0 + ldr r0, =0x02022c84 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + bx lr + .pool + thumb_func_end sub_801F0B0 + + thumb_func_start sub_801F0BC +sub_801F0BC: @ 801F0BC + ldr r2, =0x02022c84 + ldr r3, [r2] + ldrb r2, [r3, 0x11] + strb r2, [r0] + ldrb r0, [r3, 0x12] + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_801F0BC + + thumb_func_start sub_801F0D0 +sub_801F0D0: @ 801F0D0 + ldr r0, =0x02022c84 + ldr r0, [r0] + adds r0, 0x1A + bx lr + .pool + thumb_func_end sub_801F0D0 + + thumb_func_start sub_801F0DC +sub_801F0DC: @ 801F0DC + push {lr} + bl sub_801F0D0 + bl GetStringLength_Multibyte + pop {r1} + bx r1 + thumb_func_end sub_801F0DC + + thumb_func_start sub_801F0EC +sub_801F0EC: @ 801F0EC + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x02022c84 + ldr r0, [r0] + ldrb r3, [r0, 0x15] + ldrb r2, [r0, 0x14] + subs r0, r3, r2 + cmp r0, 0 + bge _0801F108 + negs r0, r0 + str r3, [r4] + b _0801F10A + .pool +_0801F108: + str r2, [r4] +_0801F10A: + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_801F0EC + + thumb_func_start sub_801F114 +sub_801F114: @ 801F114 + push {lr} + bl sub_801EED8 + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, =0x02022c84 + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0x1A + cmp r2, 0 + beq _0801F13A +_0801F12A: + ldrb r0, [r1] + cmp r0, 0xF9 + bne _0801F132 + adds r1, 0x1 +_0801F132: + adds r1, 0x1 + subs r2, 0x1 + cmp r2, 0 + bne _0801F12A +_0801F13A: + adds r0, r1, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_801F114 + + thumb_func_start sub_801F144 +sub_801F144: @ 801F144 + push {r4,lr} + bl sub_801EED8 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x02022c84 + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0x1A + movs r2, 0 + movs r3, 0 + cmp r2, r4 + bcs _0801F174 +_0801F15E: + ldrb r0, [r1] + cmp r0, 0xF9 + bne _0801F166 + adds r1, 0x1 +_0801F166: + adds r1, 0x1 + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + adds r3, 0x1 + cmp r3, r4 + bcc _0801F15E +_0801F174: + adds r0, r2, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_801F144 + + thumb_func_start sub_801F180 +sub_801F180: @ 801F180 + ldr r0, =0x02022c84 + ldr r0, [r0] + adds r0, 0x39 + bx lr + .pool + thumb_func_end sub_801F180 + + thumb_func_start sub_801F18C +sub_801F18C: @ 801F18C + ldr r0, =0x02022c84 + ldr r0, [r0] + ldrb r0, [r0, 0x16] + bx lr + .pool + thumb_func_end sub_801F18C + + thumb_func_start sub_801F198 +sub_801F198: @ 801F198 + ldr r0, =0x02022c84 + ldr r0, [r0] + ldrb r0, [r0, 0x15] + bx lr + .pool + thumb_func_end sub_801F198 + + thumb_func_start sub_801F1A4 +sub_801F1A4: @ 801F1A4 + push {lr} + bl sub_801EEA8 + ldrb r1, [r0] + cmp r1, 0xFF + bhi _0801F1BE + ldr r0, =gUnknown_082F2AA8 + adds r0, r1, r0 + ldrb r0, [r0] + cmp r0, r1 + beq _0801F1BE + cmp r0, 0 + bne _0801F1C8 +_0801F1BE: + movs r0, 0x3 + b _0801F1CA + .pool +_0801F1C8: + movs r0, 0 +_0801F1CA: + pop {r1} + bx r1 + thumb_func_end sub_801F1A4 + + thumb_func_start sub_801F1D0 +sub_801F1D0: @ 801F1D0 + ldr r0, =0x02022c84 + ldr r0, [r0] + adds r0, 0x79 + bx lr + .pool + thumb_func_end sub_801F1D0 + + thumb_func_start copy_strings_to_sav1 +copy_strings_to_sav1: @ 801F1DC + push {r4,lr} + ldr r4, =0x03005d8c + ldr r0, [r4] + ldr r1, =0x00003c88 + adds r0, r1 + ldr r1, =gUnknown_085ED40F + bl CopyString + ldr r0, [r4] + ldr r1, =0x00003c9d + adds r0, r1 + ldr r1, =gUnknown_085ED415 + bl CopyString + ldr r0, [r4] + ldr r1, =0x00003cb2 + adds r0, r1 + ldr r1, =gUnknown_085ED41D + bl CopyString + ldr r0, [r4] + ldr r1, =0x00003cc7 + adds r0, r1 + ldr r1, =gUnknown_085ED423 + bl CopyString + ldr r0, [r4] + ldr r1, =0x00003cdc + adds r0, r1 + ldr r1, =gUnknown_085ED42A + bl CopyString + ldr r0, [r4] + ldr r1, =0x00003cf1 + adds r0, r1 + ldr r1, =gUnknown_085ED430 + bl CopyString + ldr r0, [r4] + ldr r1, =0x00003d06 + adds r0, r1 + ldr r1, =gUnknown_085ED434 + bl CopyString + ldr r0, [r4] + ldr r1, =0x00003d1b + adds r0, r1 + ldr r1, =gUnknown_085ED43A + bl CopyString + ldr r0, [r4] + ldr r1, =0x00003d30 + adds r0, r1 + ldr r1, =gUnknown_085ED440 + bl CopyString + ldr r0, [r4] + ldr r1, =0x00003d45 + adds r0, r1 + ldr r1, =gUnknown_085ED44A + bl CopyString + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end copy_strings_to_sav1 + + thumb_func_start sub_801F2B4 +sub_801F2B4: @ 801F2B4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0x7 + bls _0801F2CE + b _0801F4C4 +_0801F2CE: + lsls r0, 2 + ldr r1, =_0801F2E0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0801F2E0: + .4byte _0801F300 + .4byte _0801F30E + .4byte _0801F4A8 + .4byte _0801F35C + .4byte _0801F448 + .4byte _0801F480 + .4byte _0801F494 + .4byte _0801F438 +_0801F300: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _0801F30A + b _0801F49C +_0801F30A: + movs r0, 0x1 + strh r0, [r4] +_0801F30E: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + adds r2, r0, 0 + strh r0, [r4, 0x8] + ldr r3, =0x02022c84 + ldr r0, [r3] + ldrb r1, [r0, 0xD] + movs r5, 0x8 + ldrsh r0, [r4, r5] + cmp r1, r0 + beq _0801F33C + movs r0, 0x2 + strh r0, [r4] + ldr r0, [r3] + strb r2, [r0, 0xD] + b _0801F4C4 + .pool +_0801F33C: + bl sub_800A550 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x6] + cmp r0, 0 + bne _0801F354 + bl sub_8011A9C + cmp r0, 0 + beq _0801F354 + b _0801F4C4 +_0801F354: + movs r0, 0 + strh r0, [r4, 0x2] + movs r0, 0x3 + strh r0, [r4] +_0801F35C: + movs r1, 0x2 + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bgt _0801F396 + movs r2, 0x6 + ldrsh r0, [r4, r2] + movs r3, 0x2 + ldrsh r1, [r4, r3] + asrs r0, r1 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0801F396 + movs r2, 0x1 +_0801F378: + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bgt _0801F396 + movs r5, 0x6 + ldrsh r0, [r4, r5] + movs r3, 0x2 + ldrsh r1, [r4, r3] + asrs r0, r1 + ands r0, r2 + cmp r0, 0 + beq _0801F378 +_0801F396: + ldrh r1, [r4, 0x2] + movs r5, 0x2 + ldrsh r0, [r4, r5] + cmp r0, 0x5 + bne _0801F3A2 + b _0801F4C0 +_0801F3A2: + strh r1, [r4, 0x4] + lsls r0, r1, 24 + lsrs r0, 24 + bl sub_800A5EC + movs r1, 0x2 + ldrsh r0, [r4, r1] + lsls r0, 8 + ldr r1, =0x020223c4 + adds r0, r1 + ldrb r0, [r0] + subs r0, 0x1 + cmp r0, 0x4 + bhi _0801F3E4 + lsls r0, 2 + ldr r1, =_0801F3D0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0801F3D0: + .4byte _0801F3E4 + .4byte _0801F3E8 + .4byte _0801F3EC + .4byte _0801F3F0 + .4byte _0801F3F4 +_0801F3E4: + movs r0, 0x3 + b _0801F3F6 +_0801F3E8: + movs r0, 0x3 + b _0801F3F6 +_0801F3EC: + movs r0, 0x4 + b _0801F3F6 +_0801F3F0: + movs r0, 0x5 + b _0801F3F6 +_0801F3F4: + movs r0, 0x6 +_0801F3F6: + strh r0, [r4, 0xA] + ldr r5, =0x02022c84 + ldr r0, [r5] + adds r0, 0x39 + movs r2, 0x2 + ldrsh r1, [r4, r2] + lsls r1, 8 + ldr r2, =0x020223c4 + adds r1, r2 + bl sub_801EFF8 + cmp r0, 0 + beq _0801F42C + ldr r0, [r5] + ldrh r1, [r4, 0x2] + strb r1, [r0, 0x16] + movs r0, 0xC + movs r1, 0x2 + bl sub_801F5EC + movs r0, 0x7 + b _0801F42E + .pool +_0801F42C: + ldrh r0, [r4, 0xA] +_0801F42E: + strh r0, [r4] + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + b _0801F4C4 +_0801F438: + movs r0, 0x2 + bl sub_801F644 + lsls r0, 24 + cmp r0, 0 + bne _0801F4C4 + ldrh r0, [r4, 0xA] + b _0801F4C2 +_0801F448: + ldr r6, =0x02022c84 + ldr r0, [r6] + ldrb r0, [r0, 0x13] + cmp r0, 0 + bne _0801F47C + movs r3, 0x4 + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _0801F47C + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _0801F474 + bl sub_80104B0 + ldr r1, [r6] + movs r0, 0x1 + b _0801F49A + .pool +_0801F474: + movs r5, 0x4 + ldrsh r0, [r4, r5] + bl sub_8011DE0 +_0801F47C: + movs r0, 0x3 + b _0801F4C2 +_0801F480: + ldr r0, =0x02022c84 + ldr r1, [r0] + ldrb r0, [r1, 0x13] + cmp r0, 0 + beq _0801F49C + movs r0, 0x2 + b _0801F49A + .pool +_0801F494: + ldr r0, =0x02022c84 + ldr r1, [r0] + movs r0, 0x3 +_0801F49A: + strb r0, [r1, 0x17] +_0801F49C: + adds r0, r5, 0 + bl remove_task + b _0801F4C4 + .pool +_0801F4A8: + bl sub_8011A9C + cmp r0, 0 + bne _0801F4C4 + ldr r0, =0x02022c84 + ldr r1, [r0] + ldrb r0, [r1, 0x13] + cmp r0, 0 + bne _0801F4C0 + ldrb r0, [r1, 0xD] + bl sub_80110B8 +_0801F4C0: + movs r0, 0x1 +_0801F4C2: + strh r0, [r4] +_0801F4C4: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801F2B4 + + thumb_func_start sub_801F4D0 +sub_801F4D0: @ 801F4D0 + push {r4,lr} + ldr r4, =0x02022c88 + ldr r0, =0x00002168 + bl Alloc + str r0, [r4] + cmp r0, 0 + beq _0801F52C + bl sub_8020890 + cmp r0, 0 + beq _0801F52C + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_082F2C60 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + ldr r0, =gUnknown_082F2C70 + bl InitWindows + bl reset_temp_tile_data_buffers + bl sub_8020770 + ldr r0, [r4] + bl sub_801F574 + bl sub_801F580 + movs r0, 0 + movs r1, 0 + bl sub_801F5EC + movs r0, 0x1 + b _0801F52E + .pool +_0801F52C: + movs r0, 0 +_0801F52E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801F4D0 + + thumb_func_start sub_801F534 +sub_801F534: @ 801F534 + push {lr} + movs r0, 0 + bl sub_801F644 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_801F534 + + thumb_func_start sub_801F544 +sub_801F544: @ 801F544 + push {r4,lr} + bl sub_80208D0 + ldr r4, =0x02022c88 + ldr r0, [r4] + cmp r0, 0 + beq _0801F55A + bl Free + movs r0, 0 + str r0, [r4] +_0801F55A: + bl FreeAllWindowBuffers + ldr r1, =0x02039b28 + movs r0, 0x3 + strb r0, [r1, 0x15] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801F544 + + thumb_func_start sub_801F574 +sub_801F574: @ 801F574 + movs r2, 0 + movs r1, 0xFF + strh r1, [r0, 0x18] + strh r1, [r0, 0x1E] + strh r2, [r0, 0x1A] + bx lr + thumb_func_end sub_801F574 + + thumb_func_start sub_801F580 +sub_801F580: @ 801F580 + push {r4,r5,lr} + ldr r1, =0x02022c88 + ldr r0, [r1] + cmp r0, 0 + beq _0801F5A8 + movs r2, 0 + adds r4, r1, 0 + ldr r5, =sub_801FDD8 + movs r3, 0 +_0801F592: + ldr r0, [r4] + lsls r1, r2, 3 + adds r0, r1 + str r5, [r0] + strb r3, [r0, 0x4] + ldr r0, [r4] + adds r0, r1 + strb r3, [r0, 0x5] + adds r2, 0x1 + cmp r2, 0x2 + ble _0801F592 +_0801F5A8: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801F580 + + thumb_func_start sub_801F5B8 +sub_801F5B8: @ 801F5B8 + push {r4-r6,lr} + ldr r1, =0x02022c88 + ldr r0, [r1] + cmp r0, 0 + beq _0801F5E0 + movs r5, 0 + adds r6, r1, 0 +_0801F5C6: + ldr r1, [r6] + lsls r4, r5, 3 + adds r1, r4 + adds r0, r1, 0x5 + ldr r1, [r1] + bl _call_via_r1 + ldr r1, [r6] + adds r1, r4 + strb r0, [r1, 0x4] + adds r5, 0x1 + cmp r5, 0x2 + ble _0801F5C6 +_0801F5E0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801F5B8 + + thumb_func_start sub_801F5EC +sub_801F5EC: @ 801F5EC + push {r4-r7,lr} + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 24 + ldr r3, =0x02022c88 + ldr r0, [r3] + lsrs r1, 21 + adds r0, r1 + ldr r2, =sub_801FDD8 + str r2, [r0] + movs r4, 0 + adds r5, r3, 0 + adds r3, r1, 0 + mov r12, r4 + ldr r1, =gUnknown_082F2C98 + movs r7, 0x1 + adds r2, r1, 0x4 +_0801F60E: + ldrh r0, [r1] + cmp r0, r6 + bne _0801F634 + ldr r1, [r5] + adds r1, r3 + ldr r0, [r2] + str r0, [r1] + strb r7, [r1, 0x4] + ldr r0, [r5] + adds r0, r3 + mov r1, r12 + strb r1, [r0, 0x5] + b _0801F63E + .pool +_0801F634: + adds r1, 0x8 + adds r2, 0x8 + adds r4, 0x1 + cmp r4, 0x14 + bls _0801F60E +_0801F63E: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_801F5EC + + thumb_func_start sub_801F644 +sub_801F644: @ 801F644 + lsls r0, 24 + ldr r1, =0x02022c88 + ldr r1, [r1] + lsrs r0, 21 + adds r1, r0 + ldrb r0, [r1, 0x4] + bx lr + .pool + thumb_func_end sub_801F644 + + thumb_func_start sub_801F658 +sub_801F658: @ 801F658 + push {r4,lr} + adds r4, r0, 0 + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0801F6EE + ldrb r0, [r4] + cmp r0, 0x6 + bhi _0801F6E4 + lsls r0, 2 + ldr r1, =_0801F67C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0801F67C: + .4byte _0801F698 + .4byte _0801F6A2 + .4byte _0801F6A8 + .4byte _0801F6AE + .4byte _0801F6B4 + .4byte _0801F6BA + .4byte _0801F6CC +_0801F698: + bl sub_8020480 + bl sub_8020538 + b _0801F6E8 +_0801F6A2: + bl sub_8020584 + b _0801F6E8 +_0801F6A8: + bl sub_80205B4 + b _0801F6E8 +_0801F6AE: + bl task_tutorial_story_unknown + b _0801F6E8 +_0801F6B4: + bl sub_8020680 + b _0801F6E8 +_0801F6BA: + bl sub_80206A4 + bl sub_80206D0 + bl sub_8020740 + bl sub_80206E8 + b _0801F6E8 +_0801F6CC: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0801F6E8 + bl sub_80208E8 + bl sub_8020A68 + bl sub_8020B20 + b _0801F6E8 +_0801F6E4: + movs r0, 0 + b _0801F6F0 +_0801F6E8: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] +_0801F6EE: + movs r0, 0x1 +_0801F6F0: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801F658 + + thumb_func_start sub_801F6F8 +sub_801F6F8: @ 801F6F8 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0 + beq _0801F708 + cmp r0, 0x1 + beq _0801F716 + b _0801F720 +_0801F708: + bl sub_80203B0 + movs r0, 0x3 + movs r1, 0x3 + bl CopyWindowToVram + b _0801F720 +_0801F716: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r0, 24 + b _0801F728 +_0801F720: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + movs r0, 0x1 +_0801F728: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801F6F8 + + thumb_func_start sub_801F730 +sub_801F730: @ 801F730 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0 + beq _0801F740 + cmp r0, 0x1 + beq _0801F74E + b _0801F758 +_0801F740: + bl sub_802040C + movs r0, 0x3 + movs r1, 0x3 + bl CopyWindowToVram + b _0801F758 +_0801F74E: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r0, 24 + b _0801F760 +_0801F758: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + movs r0, 0x1 +_0801F760: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801F730 + + thumb_func_start sub_801F768 +sub_801F768: @ 801F768 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0x1 + beq _0801F79E + cmp r0, 0x1 + bgt _0801F77C + cmp r0, 0 + beq _0801F782 + b _0801F7C4 +_0801F77C: + cmp r0, 0x2 + beq _0801F7AA + b _0801F7C4 +_0801F782: + movs r0, 0x1 + bl sub_802091C + bl sub_8020320 + cmp r0, 0 + bne _0801F7CA + bl sub_80201A4 + movs r0, 0x2 + movs r1, 0x2 + bl CopyWindowToVram + b _0801F7C4 +_0801F79E: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _0801F7C4 + b _0801F7CA +_0801F7AA: + bl sub_8020368 + cmp r0, 0 + bne _0801F7CA + bl sub_802093C + movs r0, 0 + bl sub_802091C + bl sub_8020B80 + movs r0, 0 + b _0801F7CC +_0801F7C4: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] +_0801F7CA: + movs r0, 0x1 +_0801F7CC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801F768 + + thumb_func_start sub_801F7D4 +sub_801F7D4: @ 801F7D4 + push {lr} + bl sub_802093C + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_801F7D4 + + thumb_func_start sub_801F7E0 +sub_801F7E0: @ 801F7E0 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0 + beq _0801F7F0 + cmp r0, 0x1 + beq _0801F814 + b _0801F81E +_0801F7F0: + movs r0, 0 + movs r1, 0 + bl sub_801FF18 + movs r0, 0x17 + movs r1, 0xB + movs r2, 0x1 + bl sub_801FDDC + ldr r0, =0x02022c88 + ldr r0, [r0] + ldrb r0, [r0, 0x1E] + movs r1, 0x3 + bl CopyWindowToVram + b _0801F81E + .pool +_0801F814: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r0, 24 + b _0801F826 +_0801F81E: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + movs r0, 0x1 +_0801F826: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801F7E0 + + thumb_func_start sub_801F82C +sub_801F82C: @ 801F82C + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0 + beq _0801F83C + cmp r0, 0x1 + beq _0801F84C + b _0801F862 +_0801F83C: + bl sub_8020094 + bl sub_801FEBC + movs r0, 0 + bl CopyBgTilemapBufferToVram + b _0801F862 +_0801F84C: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0801F868 + bl sub_80200C8 + bl sub_801FEE4 + movs r0, 0 + b _0801F86A +_0801F862: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] +_0801F868: + movs r0, 0x1 +_0801F86A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801F82C + + thumb_func_start sub_801F870 +sub_801F870: @ 801F870 + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0 + beq _0801F882 + cmp r0, 0x1 + beq _0801F8BA + b _0801F8CC +_0801F882: + add r1, sp, 0x8 + add r0, sp, 0x4 + bl sub_801F0EC + ldr r0, [sp, 0x4] + lsls r0, 16 + lsrs r0, 16 + ldr r1, [sp, 0x8] + lsls r1, 16 + lsrs r1, 16 + movs r2, 0 + bl sub_80200EC + bl sub_801F0D0 + adds r1, r0, 0 + movs r0, 0x2 + str r0, [sp] + movs r0, 0 + movs r2, 0x3 + movs r3, 0x1 + bl sub_8020118 + movs r0, 0x1 + movs r1, 0x2 + bl CopyWindowToVram + b _0801F8CC +_0801F8BA: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0801F8D2 + bl sub_8020B80 + movs r0, 0 + b _0801F8D4 +_0801F8CC: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] +_0801F8D2: + movs r0, 0x1 +_0801F8D4: + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801F870 + + thumb_func_start sub_801F8DC +sub_801F8DC: @ 801F8DC + push {r4-r6,lr} + sub sp, 0x4 + adds r6, r0, 0 + ldrb r0, [r6] + cmp r0, 0x1 + beq _0801F938 + cmp r0, 0x1 + bgt _0801F8F2 + cmp r0, 0 + beq _0801F8FC + b _0801F972 +_0801F8F2: + cmp r0, 0x2 + beq _0801F95C + cmp r0, 0x3 + beq _0801F96E + b _0801F972 +_0801F8FC: + bl sub_801F144 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl sub_801F114 + adds r5, r0, 0 + bl GetStringLength_Multibyte + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + movs r2, 0x66 + bl sub_80200EC + movs r0, 0x5 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + movs r3, 0x4 + bl sub_8020118 + movs r0, 0x1 + movs r1, 0x2 + bl CopyWindowToVram + b _0801F972 +_0801F938: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0801F978 + movs r0, 0x1 + movs r1, 0x10 + bl sub_801FF18 + ldr r0, =0x02022c88 + ldr r0, [r0] + ldrb r0, [r0, 0x1E] + movs r1, 0x3 + bl CopyWindowToVram + b _0801F972 + .pool +_0801F95C: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0801F978 + movs r0, 0x1 + bl sub_80209AC + b _0801F972 +_0801F96E: + movs r0, 0 + b _0801F97A +_0801F972: + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] +_0801F978: + movs r0, 0x1 +_0801F97A: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_801F8DC + + thumb_func_start sub_801F984 +sub_801F984: @ 801F984 + push {r4-r6,lr} + sub sp, 0x4 + adds r6, r0, 0 + ldrb r0, [r6] + cmp r0, 0x1 + beq _0801F9E0 + cmp r0, 0x1 + bgt _0801F99A + cmp r0, 0 + beq _0801F9A4 + b _0801FA1A +_0801F99A: + cmp r0, 0x2 + beq _0801FA00 + cmp r0, 0x3 + beq _0801FA16 + b _0801FA1A +_0801F9A4: + bl sub_801F144 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl sub_801F114 + adds r5, r0, 0 + bl GetStringLength_Multibyte + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + movs r2, 0 + bl sub_80200EC + movs r0, 0x2 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x3 + movs r3, 0x1 + bl sub_8020118 + movs r0, 0x1 + movs r1, 0x2 + bl CopyWindowToVram + b _0801FA1A +_0801F9E0: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0801FA20 + bl sub_8020094 + ldr r0, =0x02022c88 + ldr r0, [r0] + ldrb r0, [r0, 0x1E] + movs r1, 0x3 + bl CopyWindowToVram + b _0801FA1A + .pool +_0801FA00: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0801FA20 + movs r0, 0 + bl sub_80209AC + bl sub_80200C8 + b _0801FA1A +_0801FA16: + movs r0, 0 + b _0801FA22 +_0801FA1A: + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] +_0801FA20: + movs r0, 0x1 +_0801FA22: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_801F984 + + thumb_func_start sub_801FA2C +sub_801FA2C: @ 801FA2C + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0 + beq _0801FA3C + cmp r0, 0x1 + beq _0801FA50 + b _0801FA5E +_0801FA3C: + bl sub_80201A4 + movs r0, 0x2 + movs r1, 0x2 + bl CopyWindowToVram + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _0801FA5E +_0801FA50: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0801FA5E + movs r0, 0 + b _0801FA60 +_0801FA5E: + movs r0, 0x1 +_0801FA60: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801FA2C + + thumb_func_start sub_801FA68 +sub_801FA68: @ 801FA68 + push {r4-r6,lr} + adds r6, r0, 0 + ldrb r0, [r6] + cmp r0, 0x4 + bhi _0801FB3A + lsls r0, 2 + ldr r1, =_0801FA80 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0801FA80: + .4byte _0801FA94 + .4byte _0801FAC0 + .4byte _0801FAF0 + .4byte _0801FB14 + .4byte _0801FADE +_0801FA94: + ldr r0, =0x02022c88 + ldr r0, [r0] + ldrh r5, [r0, 0x1A] + bl sub_801F180 + adds r4, r0, 0 + bl sub_801F18C + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8020420 + movs r0, 0 + movs r1, 0x2 + bl CopyWindowToVram + b _0801FB34 + .pool +_0801FAC0: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _0801FB3A + ldr r0, =0x02022c88 + ldr r1, [r0] + ldrh r0, [r1, 0x1A] + cmp r0, 0x8 + bhi _0801FAE8 + adds r0, 0x1 + strh r0, [r1, 0x1A] + movs r0, 0x4 + strb r0, [r6] +_0801FADE: + movs r0, 0 + b _0801FB3C + .pool +_0801FAE8: + strh r2, [r1, 0x1C] + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] +_0801FAF0: + movs r0, 0 + movs r1, 0 + movs r2, 0x5 + movs r3, 0x11 + bl ScrollWindow + movs r0, 0 + movs r1, 0x2 + bl CopyWindowToVram + ldr r0, =0x02022c88 + ldr r1, [r0] + ldrh r0, [r1, 0x1C] + adds r0, 0x1 + strh r0, [r1, 0x1C] + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] +_0801FB14: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0801FB3A + ldr r0, =0x02022c88 + ldr r0, [r0] + ldrh r0, [r0, 0x1C] + cmp r0, 0x2 + bhi _0801FB34 + ldrb r0, [r6] + subs r0, 0x1 + b _0801FB38 + .pool +_0801FB34: + ldrb r0, [r6] + adds r0, 0x1 +_0801FB38: + strb r0, [r6] +_0801FB3A: + movs r0, 0x1 +_0801FB3C: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_801FA68 + + thumb_func_start sub_801FB44 +sub_801FB44: @ 801FB44 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0 + beq _0801FB54 + cmp r0, 0x1 + beq _0801FB60 + b _0801FB66 +_0801FB54: + bl sub_80209E0 + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _0801FB66 +_0801FB60: + bl sub_8020A1C + b _0801FB68 +_0801FB66: + movs r0, 0x1 +_0801FB68: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801FB44 + + thumb_func_start sub_801FB70 +sub_801FB70: @ 801FB70 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0 + beq _0801FB80 + cmp r0, 0x1 + beq _0801FBA0 + b _0801FBAA +_0801FB80: + movs r0, 0x3 + movs r1, 0x10 + bl sub_801FF18 + ldr r0, =0x02022c88 + ldr r0, [r0] + ldrb r0, [r0, 0x1E] + movs r1, 0x3 + bl CopyWindowToVram + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _0801FBAA + .pool +_0801FBA0: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r0, 24 + b _0801FBAC +_0801FBAA: + movs r0, 0x1 +_0801FBAC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801FB70 + + thumb_func_start sub_801FBB4 +sub_801FBB4: @ 801FBB4 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0 + beq _0801FBC4 + cmp r0, 0x1 + beq _0801FBE4 + b _0801FBEE +_0801FBC4: + movs r0, 0x4 + movs r1, 0 + bl sub_801FF18 + ldr r0, =0x02022c88 + ldr r0, [r0] + ldrb r0, [r0, 0x1E] + movs r1, 0x3 + bl CopyWindowToVram + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _0801FBEE + .pool +_0801FBE4: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r0, 24 + b _0801FBF0 +_0801FBEE: + movs r0, 0x1 +_0801FBF0: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801FBB4 + + thumb_func_start sub_801FBF8 +sub_801FBF8: @ 801FBF8 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0 + beq _0801FC08 + cmp r0, 0x1 + beq _0801FC38 + b _0801FC42 +_0801FC08: + bl sub_81AFBF0 + bl sub_801F1D0 + adds r1, r0, 0 + movs r0, 0 + bl sub_81AFC0C + movs r0, 0x5 + movs r1, 0 + bl sub_801FF18 + ldr r0, =0x02022c88 + ldr r0, [r0] + ldrb r0, [r0, 0x1E] + movs r1, 0x3 + bl CopyWindowToVram + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _0801FC42 + .pool +_0801FC38: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r0, 24 + b _0801FC44 +_0801FC42: + movs r0, 0x1 +_0801FC44: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801FBF8 + + thumb_func_start sub_801FC4C +sub_801FC4C: @ 801FC4C + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0 + beq _0801FC5C + cmp r0, 0x1 + beq _0801FC88 + b _0801FC92 +_0801FC5C: + movs r0, 0x6 + movs r1, 0 + bl sub_801FF18 + movs r0, 0x17 + movs r1, 0xA + movs r2, 0x1 + bl sub_801FDDC + ldr r0, =0x02022c88 + ldr r0, [r0] + ldrb r0, [r0, 0x1E] + movs r1, 0x3 + bl CopyWindowToVram + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _0801FC92 + .pool +_0801FC88: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r0, 24 + b _0801FC94 +_0801FC92: + movs r0, 0x1 +_0801FC94: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801FC4C + + thumb_func_start sub_801FC9C +sub_801FC9C: @ 801FC9C + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0 + beq _0801FCAC + cmp r0, 0x1 + beq _0801FCD8 + b _0801FCE2 +_0801FCAC: + movs r0, 0x7 + movs r1, 0 + bl sub_801FF18 + movs r0, 0x17 + movs r1, 0xA + movs r2, 0x1 + bl sub_801FDDC + ldr r0, =0x02022c88 + ldr r0, [r0] + ldrb r0, [r0, 0x1E] + movs r1, 0x3 + bl CopyWindowToVram + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _0801FCE2 + .pool +_0801FCD8: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r0, 24 + b _0801FCE4 +_0801FCE2: + movs r0, 0x1 +_0801FCE4: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801FC9C + + thumb_func_start sub_801FCEC +sub_801FCEC: @ 801FCEC + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0 + beq _0801FCFC + cmp r0, 0x1 + beq _0801FD1C + b _0801FD26 +_0801FCFC: + movs r0, 0x8 + movs r1, 0 + bl sub_801FF18 + ldr r0, =0x02022c88 + ldr r0, [r0] + ldrb r0, [r0, 0x1E] + movs r1, 0x3 + bl CopyWindowToVram + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _0801FD26 + .pool +_0801FD1C: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r0, 24 + b _0801FD28 +_0801FD26: + movs r0, 0x1 +_0801FD28: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801FCEC + + thumb_func_start sub_801FD30 +sub_801FD30: @ 801FD30 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0 + beq _0801FD40 + cmp r0, 0x1 + beq _0801FD74 + b _0801FD7E +_0801FD40: + bl sub_81AFBF0 + ldr r0, =0x03005d90 + ldr r1, [r0] + movs r0, 0 + bl sub_81AFC0C + movs r0, 0x9 + movs r1, 0 + bl sub_801FF18 + ldr r0, =0x02022c88 + ldr r0, [r0] + ldrb r0, [r0, 0x1E] + movs r1, 0x3 + bl CopyWindowToVram + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _0801FD7E + .pool +_0801FD74: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r0, 24 + b _0801FD80 +_0801FD7E: + movs r0, 0x1 +_0801FD80: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801FD30 + + thumb_func_start sub_801FD88 +sub_801FD88: @ 801FD88 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0 + beq _0801FD98 + cmp r0, 0x1 + beq _0801FDC4 + b _0801FDCE +_0801FD98: + movs r0, 0xA + movs r1, 0 + bl sub_801FF18 + movs r0, 0x17 + movs r1, 0xA + movs r2, 0x1 + bl sub_801FDDC + ldr r0, =0x02022c88 + ldr r0, [r0] + ldrb r0, [r0, 0x1E] + movs r1, 0x3 + bl CopyWindowToVram + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _0801FDCE + .pool +_0801FDC4: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r0, 24 + b _0801FDD0 +_0801FDCE: + movs r0, 0x1 +_0801FDD0: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801FD88 + + thumb_func_start sub_801FDD8 +sub_801FDD8: @ 801FDD8 + movs r0, 0 + bx lr + thumb_func_end sub_801FDD8 + + thumb_func_start sub_801FDDC +sub_801FDDC: @ 801FDDC + push {r4-r7,lr} + sub sp, 0x14 + lsls r0, 24 + lsls r1, 24 + lsls r2, 24 + lsrs r7, r2, 24 + ldr r4, =0xffffff00 + ldr r2, [sp, 0xC] + ands r2, r4 + lsrs r0, 16 + ldr r3, =0xffff00ff + ands r2, r3 + orrs r2, r0 + lsrs r1, 8 + ldr r0, =0xff00ffff + ands r2, r0 + orrs r2, r1 + ldr r0, =0x00ffffff + ands r2, r0 + movs r0, 0xC0 + lsls r0, 19 + orrs r2, r0 + str r2, [sp, 0xC] + ldr r0, [sp, 0x10] + ands r0, r4 + movs r1, 0x4 + orrs r0, r1 + ands r0, r3 + movs r1, 0xE0 + lsls r1, 4 + orrs r0, r1 + ldr r1, =0x0000ffff + ands r0, r1 + movs r1, 0xA4 + lsls r1, 15 + orrs r0, r1 + str r0, [sp, 0x10] + add r0, sp, 0xC + bl AddWindow + adds r1, r0, 0 + ldr r5, =0x02022c88 + ldr r0, [r5] + movs r6, 0 + strh r1, [r0, 0x18] + lsls r0, r1, 16 + lsrs r0, 16 + cmp r0, 0xFF + beq _0801FE94 + lsls r0, r1, 24 + lsrs r0, 24 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r0, [r5] + ldrb r0, [r0, 0x18] + bl PutWindowTilemap + ldr r0, [r5] + ldrb r0, [r0, 0x18] + ldr r2, =gUnknown_085EAE62 + movs r1, 0x1 + str r1, [sp] + movs r4, 0xFF + str r4, [sp, 0x4] + str r6, [sp, 0x8] + movs r3, 0x8 + bl Print + ldr r0, [r5] + ldrb r0, [r0, 0x18] + ldr r2, =gUnknown_085EAE66 + movs r1, 0x11 + str r1, [sp] + str r4, [sp, 0x4] + str r6, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl Print + ldr r0, [r5] + ldrb r0, [r0, 0x18] + movs r1, 0x1 + movs r2, 0xD + bl sub_8098858 + ldr r0, [r5] + ldrb r0, [r0, 0x18] + movs r1, 0x2 + adds r2, r7, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed +_0801FE94: + add sp, 0x14 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801FDDC + + thumb_func_start sub_801FEBC +sub_801FEBC: @ 801FEBC + push {r4,lr} + ldr r4, =0x02022c88 + ldr r0, [r4] + ldrh r0, [r0, 0x18] + cmp r0, 0xFF + beq _0801FEDA + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_8198070 + ldr r0, [r4] + ldrb r0, [r0, 0x18] + bl ClearWindowTilemap +_0801FEDA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801FEBC + + thumb_func_start sub_801FEE4 +sub_801FEE4: @ 801FEE4 + push {r4,lr} + ldr r4, =0x02022c88 + ldr r0, [r4] + ldrh r0, [r0, 0x18] + cmp r0, 0xFF + beq _0801FEFE + lsls r0, 24 + lsrs r0, 24 + bl RemoveWindow + ldr r1, [r4] + movs r0, 0xFF + strh r0, [r1, 0x18] +_0801FEFE: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801FEE4 + + thumb_func_start sub_801FF08 +sub_801FF08: @ 801FF08 + push {lr} + bl ProcessMenuInput + lsls r0, 24 + asrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_801FF08 + + thumb_func_start sub_801FF18 +sub_801FF18: @ 801FF18 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x1C + adds r7, r0, 0 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + ldr r1, =0xffffff00 + ldr r3, [sp, 0x14] + ands r3, r1 + ldr r2, =0xffff00ff + ands r3, r2 + movs r0, 0x80 + lsls r0, 4 + orrs r3, r0 + ldr r0, =0xff00ffff + ands r3, r0 + movs r0, 0x80 + lsls r0, 13 + orrs r3, r0 + ldr r5, =0x00ffffff + ands r3, r5 + movs r0, 0xA8 + lsls r0, 21 + orrs r3, r0 + str r3, [sp, 0x14] + ldr r0, [sp, 0x18] + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + ands r0, r2 + movs r1, 0xE0 + lsls r1, 4 + orrs r0, r1 + ldr r1, =0x0000ffff + ands r0, r1 + movs r1, 0xD4 + lsls r1, 15 + orrs r0, r1 + str r0, [sp, 0x18] + ldr r1, =gUnknown_082F2D40 + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 2 + adds r4, r0, r1 + ldrb r0, [r4, 0xA] + cmp r0, 0 + beq _0801FF98 + lsls r0, r3, 16 + movs r1, 0xF9 + lsls r1, 24 + adds r0, r1 + lsrs r0, 16 + ands r2, r3 + orrs r2, r0 + lsrs r1, r2, 24 + adds r1, 0x7 + lsls r1, 24 + adds r0, r5, 0 + ands r0, r2 + orrs r0, r1 + str r0, [sp, 0x14] +_0801FF98: + add r0, sp, 0x14 + bl AddWindow + ldr r5, =0x02022c88 + ldr r1, [r5] + strh r0, [r1, 0x1E] + ldrh r0, [r1, 0x1E] + mov r8, r0 + cmp r0, 0xFF + beq _08020082 + ldrb r0, [r4, 0x9] + cmp r0, 0 + beq _0801FFE0 + adds r0, r1, 0 + adds r0, 0x22 + ldr r1, [r4] + bl sub_81AFC28 + ldr r0, [r5] + adds r6, r0, 0 + adds r6, 0x22 + b _0801FFE2 + .pool +_0801FFE0: + ldr r6, [r4] +_0801FFE2: + mov r0, r9 + lsls r1, r0, 8 + movs r0, 0 + movs r2, 0 + bl ChangeBgY + mov r1, r8 + lsls r0, r1, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + adds r0, r5, 0 + bl PutWindowTilemap + ldr r1, =gUnknown_082F2D40 + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 2 + adds r4, r0, r1 + ldrb r0, [r4, 0x4] + cmp r0, 0x1 + bne _08020050 + adds r0, r5, 0 + movs r1, 0xA + movs r2, 0x2 + bl sub_80989E0 + ldrb r3, [r4, 0x5] + adds r3, 0x8 + lsls r3, 24 + lsrs r3, 24 + ldrb r0, [r4, 0x6] + adds r0, 0x8 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + ldrb r0, [r4, 0x7] + str r0, [sp, 0xC] + ldrb r0, [r4, 0x8] + str r0, [sp, 0x10] + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r6, 0 + bl sub_8199F74 + b _0802007A + .pool +_08020050: + adds r0, r5, 0 + movs r1, 0xA + movs r2, 0x2 + bl sub_8098858 + ldrb r3, [r4, 0x5] + ldrb r0, [r4, 0x6] + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + ldrb r0, [r4, 0x7] + str r0, [sp, 0xC] + ldrb r0, [r4, 0x8] + str r0, [sp, 0x10] + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r6, 0 + bl sub_8199F74 +_0802007A: + ldr r0, =0x02022c88 + ldr r0, [r0] + mov r1, r8 + strh r1, [r0, 0x1E] +_08020082: + add sp, 0x1C + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_801FF18 + + thumb_func_start sub_8020094 +sub_8020094: @ 8020094 + push {r4,lr} + ldr r4, =0x02022c88 + ldr r0, [r4] + ldrh r0, [r0, 0x1E] + cmp r0, 0xFF + beq _080200B2 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_8198070 + ldr r0, [r4] + ldrb r0, [r0, 0x1E] + bl ClearWindowTilemap +_080200B2: + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8020094 + + thumb_func_start sub_80200C8 +sub_80200C8: @ 80200C8 + push {r4,lr} + ldr r4, =0x02022c88 + ldr r0, [r4] + ldrh r0, [r0, 0x1E] + cmp r0, 0xFF + beq _080200E2 + lsls r0, 24 + lsrs r0, 24 + bl RemoveWindow + ldr r1, [r4] + movs r0, 0xFF + strh r0, [r1, 0x1E] +_080200E2: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80200C8 + + thumb_func_start sub_80200EC +sub_80200EC: @ 80200EC + push {lr} + sub sp, 0x8 + adds r3, r0, 0 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 19 + lsrs r3, 16 + lsls r1, 19 + lsrs r1, 16 + str r1, [sp] + movs r0, 0xE + str r0, [sp, 0x4] + movs r0, 0x1 + adds r1, r2, 0 + adds r2, r3, 0 + movs r3, 0x1 + bl FillWindowPixelRect + add sp, 0x8 + pop {r0} + bx r0 + thumb_func_end sub_80200EC + + thumb_func_start sub_8020118 +sub_8020118: @ 8020118 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x34 + mov r10, r1 + ldr r1, [sp, 0x54] + lsls r0, 16 + lsrs r5, r0, 16 + mov r9, r5 + lsls r2, 24 + lsrs r4, r2, 24 + mov r8, r4 + lsls r3, 24 + lsrs r7, r3, 24 + lsls r1, 24 + lsrs r6, r1, 24 + cmp r4, 0 + beq _08020154 + bl sub_801F198 + adds r1, r0, 0 + subs r1, r5 + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + adds r2, r4, 0 + bl sub_80200EC +_08020154: + add r0, sp, 0xC + mov r1, r8 + strb r1, [r0] + strb r7, [r0, 0x1] + strb r6, [r0, 0x2] + add r4, sp, 0x10 + movs r0, 0xFC + strb r0, [r4] + movs r0, 0x14 + strb r0, [r4, 0x1] + movs r0, 0x8 + strb r0, [r4, 0x2] + mov r0, sp + adds r0, 0x13 + mov r1, r10 + bl CopyString + mov r0, r9 + lsls r2, r0, 27 + lsrs r2, 24 + add r1, sp, 0xC + str r1, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x2 + movs r3, 0x1 + bl box_print + 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_8020118 + + thumb_func_start sub_80201A4 +sub_80201A4: @ 80201A4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4C + movs r0, 0x2 + movs r1, 0xFF + bl FillWindowPixelBuffer + bl sub_801F0B0 + lsls r0, 24 + lsrs r2, r0, 24 + add r1, sp, 0xC + movs r0, 0 + strb r0, [r1] + movs r0, 0xE + strb r0, [r1, 0x1] + movs r0, 0xD + strb r0, [r1, 0x2] + cmp r2, 0x3 + beq _08020240 + add r1, sp, 0x10 + movs r0, 0xFC + strb r0, [r1] + movs r0, 0x14 + strb r0, [r1, 0x1] + movs r0, 0x8 + strb r0, [r1, 0x2] + str r0, [sp, 0x40] + str r1, [sp, 0x44] + cmp r2, 0x2 + bne _080201EC + movs r1, 0x6 + str r1, [sp, 0x40] +_080201EC: + movs r7, 0 + movs r6, 0 + lsls r0, r2, 2 + ldr r1, =gUnknown_082F2BA8 + adds r0, r2 + lsls r0, 3 + adds r4, r0, r1 + ldr r0, [sp, 0x40] + lsls r5, r0, 24 +_080201FE: + ldr r1, [r4] + cmp r1, 0 + bne _08020206 + b _0802030C +_08020206: + mov r0, sp + adds r0, 0x13 + bl CopyString + lsls r3, r6, 24 + lsrs r3, 24 + add r1, sp, 0xC + str r1, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + ldr r0, [sp, 0x44] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0 + lsrs r2, r5, 24 + bl box_print + adds r4, 0x4 + adds r7, 0x1 + adds r0, r6, 0 + adds r0, 0xC + lsls r0, 16 + lsrs r6, r0, 16 + cmp r7, 0x9 + ble _080201FE + b _0802030C + .pool +_08020240: + movs r1, 0x4 + str r1, [sp, 0x40] + movs r7, 0 + movs r6, 0 +_08020248: + adds r0, r7, 0 + bl sub_801EE6C + adds r5, r0, 0 + movs r0, 0 + adds r1, r5, 0 + movs r2, 0 + bl GetStringWidth + cmp r0, 0x28 + bgt _08020286 + lsls r3, r6, 24 + lsrs r3, 24 + add r4, sp, 0xC + str r4, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x2 + movs r1, 0 + movs r4, 0x80 + lsls r4, 19 + lsrs r2, r4, 24 + bl box_print + adds r0, r7, 0x1 + str r0, [sp, 0x48] + adds r6, 0xC + mov r10, r6 + b _08020300 +_08020286: + adds r0, r5, 0 + bl GetStringLength_Multibyte + adds r4, r0, 0 + mov r1, sp + adds r1, 0x10 + str r1, [sp, 0x44] + ldr r0, [sp, 0x40] + lsls r0, 24 + mov r8, r0 + lsls r1, r6, 24 + mov r9, r1 + adds r0, r7, 0x1 + str r0, [sp, 0x48] + adds r6, 0xC + mov r10, r6 + ldr r7, [sp, 0x40] + adds r7, 0x23 + ldr r6, [sp, 0x44] +_080202AC: + subs r4, 0x1 + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl CopyString_LimitN_Multibyte + movs r0, 0 + adds r1, r6, 0 + movs r2, 0 + bl GetStringWidth + cmp r0, 0x23 + bgt _080202AC + mov r1, r8 + lsrs r2, r1, 24 + mov r0, r9 + lsrs r4, r0, 24 + add r1, sp, 0xC + str r1, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + ldr r1, [sp, 0x44] + str r1, [sp, 0x8] + movs r0, 0x2 + movs r1, 0 + adds r3, r4, 0 + bl box_print + adds r2, r7, 0 + add r0, sp, 0xC + str r0, [sp] + movs r1, 0x1 + negs r1, r1 + str r1, [sp, 0x4] + ldr r0, =gUnknown_082F2DC4 + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0 + adds r3, r4, 0 + bl box_print +_08020300: + ldr r7, [sp, 0x48] + mov r4, r10 + lsls r0, r4, 16 + lsrs r6, r0, 16 + cmp r7, 0x9 + ble _08020248 +_0802030C: + add sp, 0x4C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80201A4 + + thumb_func_start sub_8020320 +sub_8020320: @ 8020320 + push {r4,lr} + ldr r1, =0x02022c88 + ldr r2, [r1] + ldrh r3, [r2, 0x20] + movs r4, 0x20 + ldrsh r0, [r2, r4] + cmp r0, 0x37 + bgt _08020354 + adds r0, r3, 0 + adds r0, 0xC + strh r0, [r2, 0x20] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x37 + ble _08020348 + movs r0, 0x38 + strh r0, [r2, 0x20] + b _08020354 + .pool +_08020348: + movs r1, 0x20 + ldrsh r0, [r2, r1] + bl sub_80207C0 + movs r0, 0x1 + b _08020360 +_08020354: + ldr r0, [r1] + movs r4, 0x20 + ldrsh r0, [r0, r4] + bl sub_8020818 + movs r0, 0 +_08020360: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8020320 + + thumb_func_start sub_8020368 +sub_8020368: @ 8020368 + push {r4,lr} + ldr r1, =0x02022c88 + ldr r2, [r1] + ldrh r3, [r2, 0x20] + movs r4, 0x20 + ldrsh r0, [r2, r4] + cmp r0, 0 + ble _0802039C + adds r0, r3, 0 + subs r0, 0xC + strh r0, [r2, 0x20] + lsls r0, 16 + cmp r0, 0 + bgt _08020390 + movs r0, 0 + strh r0, [r2, 0x20] + b _0802039C + .pool +_08020390: + movs r1, 0x20 + ldrsh r0, [r2, r1] + bl sub_80207C0 + movs r0, 0x1 + b _080203A8 +_0802039C: + ldr r0, [r1] + movs r4, 0x20 + ldrsh r0, [r0, r4] + bl sub_8020818 + movs r0, 0 +_080203A8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8020368 + + thumb_func_start sub_80203B0 +sub_80203B0: @ 80203B0 + push {r4,r5,lr} + sub sp, 0xC + movs r0, 0x3 + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0xD + bl sub_8098858 + movs r5, 0xE + str r5, [sp] + movs r4, 0x5 + str r4, [sp, 0x4] + ldr r0, =gUnknown_082F2DC8 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x2 + movs r2, 0x8 + movs r3, 0x1 + bl PrintTextArray + bl sub_801F0B0 + lsls r0, 24 + lsrs r0, 24 + str r5, [sp] + str r4, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x2 + movs r2, 0 + movs r3, 0x1 + bl sub_81983AC + movs r0, 0x3 + bl PutWindowTilemap + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80203B0 + + thumb_func_start sub_802040C +sub_802040C: @ 802040C + push {lr} + movs r0, 0x3 + movs r1, 0 + bl sub_8198070 + movs r0, 0x3 + bl ClearWindowTilemap + pop {r0} + bx r0 + thumb_func_end sub_802040C + + thumb_func_start sub_8020420 +sub_8020420: @ 8020420 + push {r4,r5,lr} + sub sp, 0x10 + adds r5, r1, 0 + lsls r0, 16 + lsrs r0, 16 + lsls r2, 24 + add r3, sp, 0xC + movs r1, 0x1 + strb r1, [r3] + lsrs r2, 23 + adds r1, r2, 0x2 + strb r1, [r3, 0x1] + adds r1, r3, 0 + adds r2, 0x3 + strb r2, [r1, 0x2] + lsls r4, r0, 4 + subs r4, r0 + lsls r3, r4, 16 + lsrs r3, 16 + movs r0, 0xA8 + str r0, [sp] + movs r0, 0xF + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0x11 + movs r2, 0 + bl FillWindowPixelRect + adds r4, 0x1 + lsls r4, 24 + lsrs r4, 24 + add r0, sp, 0xC + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + adds r3, r4, 0 + bl box_print + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8020420 + + thumb_func_start sub_8020480 +sub_8020480: @ 8020480 + push {lr} + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuRegBits + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r1, 0xE0 + lsls r1, 8 + movs r0, 0 + bl ClearGpuRegBits + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl SetGpuRegBits + ldr r1, =0x000040f0 + movs r0, 0x40 + bl SetGpuReg + movs r0, 0x44 + movs r1, 0x90 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0x3D + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x3F + bl SetGpuReg + pop {r0} + bx r0 + .pool + thumb_func_end sub_8020480 + + thumb_func_start sub_8020538 +sub_8020538: @ 8020538 + push {r4,lr} + ldr r4, =0x02022c88 + ldr r1, [r4] + movs r0, 0x94 + lsls r0, 1 + adds r1, r0 + movs r0, 0 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00000928 + adds r1, r0 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00001128 + adds r1, r0 + movs r0, 0x3 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00001928 + adds r1, r0 + movs r0, 0x2 + bl SetBgTilemapBuffer + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8020538 + + thumb_func_start sub_8020584 +sub_8020584: @ 8020584 + push {lr} + sub sp, 0x8 + movs r1, 0xC0 + lsls r1, 19 + movs r0, 0 + movs r2, 0x20 + movs r3, 0x1 + bl RequestDma3Fill + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0 + bl CopyBgTilemapBufferToVram + add sp, 0x8 + pop {r0} + bx r0 + thumb_func_end sub_8020584 + + thumb_func_start sub_80205B4 +sub_80205B4: @ 80205B4 + push {lr} + sub sp, 0x4 + ldr r0, =gUnknown_08DD4BD0 + movs r1, 0x70 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_08DD4BB0 + movs r1, 0xC0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, =gUnknown_08DD4BF0 + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r1, =gUnknown_08DD4C4C + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80205B4 + + thumb_func_start task_tutorial_story_unknown +task_tutorial_story_unknown: @ 8020604 + push {r4,r5,lr} + sub sp, 0x4 + ldr r0, =gUnknown_08DD4860 + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, =gUnknown_08DD4880 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + adds r5, r0, 0 + cmp r5, 0 + beq _0802064E + movs r1, 0x88 + lsls r1, 2 + adds r0, r5, r1 + ldr r4, =0x02022c88 + ldr r1, [r4] + ldr r2, =0x00002128 + adds r1, r2 + movs r2, 0x8 + bl CpuFastSet + movs r1, 0x84 + lsls r1, 3 + adds r0, r5, r1 + ldr r1, [r4] + ldr r2, =0x00002148 + adds r1, r2 + movs r2, 0x8 + bl CpuFastSet +_0802064E: + ldr r1, =gUnknown_08DD4AB8 + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end task_tutorial_story_unknown + + thumb_func_start sub_8020680 +sub_8020680: @ 8020680 + push {lr} + ldr r0, =gUnknown_082F2C20 + movs r1, 0x80 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, =0x06004020 + movs r0, 0 + movs r2, 0x20 + movs r3, 0x1 + bl RequestDma3Fill + pop {r0} + bx r0 + .pool + thumb_func_end sub_8020680 + + thumb_func_start sub_80206A4 +sub_80206A4: @ 80206A4 + push {lr} + ldr r0, =gUnknown_082F2C40 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0 + bl PutWindowTilemap + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + pop {r0} + bx r0 + .pool + thumb_func_end sub_80206A4 + + thumb_func_start sub_80206D0 +sub_80206D0: @ 80206D0 + push {lr} + movs r0, 0x2 + bl PutWindowTilemap + bl sub_80201A4 + movs r0, 0x2 + movs r1, 0x3 + bl CopyWindowToVram + pop {r0} + bx r0 + thumb_func_end sub_80206D0 + + thumb_func_start sub_80206E8 +sub_80206E8: @ 80206E8 + push {r4,lr} + sub sp, 0xC + add r1, sp, 0x8 + movs r0, 0 + strb r0, [r1] + movs r0, 0xFF + strb r0, [r1, 0x1] + movs r4, 0 +_080206F8: + ldr r0, =0x02022c88 + ldr r1, [r0] + ldr r0, =0x00002128 + adds r1, r0 + lsls r2, r4, 19 + lsrs r2, 16 + movs r0, 0x8 + str r0, [sp] + movs r0, 0x10 + str r0, [sp, 0x4] + movs r0, 0x1 + movs r3, 0 + bl BlitBitmapToWindow + adds r4, 0x1 + cmp r4, 0xE + ble _080206F8 + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0x1 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80206E8 + + thumb_func_start sub_8020740 +sub_8020740: @ 8020740 + push {lr} + movs r0, 0x3 + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0xD0 + bl sub_809882C + movs r0, 0x3 + movs r1, 0xA + movs r2, 0x20 + bl box_border_load_tiles_and_pal + ldr r0, =gUnknown_0860F074 + movs r1, 0xE0 + movs r2, 0x20 + bl gpu_pal_apply + pop {r0} + bx r0 + .pool + thumb_func_end sub_8020740 + + thumb_func_start sub_8020770 +sub_8020770: @ 8020770 + push {lr} + sub sp, 0x10 + ldr r0, =0xa2600001 + str r0, [sp, 0x4] + ldr r0, =0x04000014 + str r0, [sp] + mov r2, sp + movs r1, 0 + movs r0, 0x1 + strb r0, [r2, 0x8] + mov r0, sp + strb r1, [r0, 0x9] + ldr r0, =0x02022c88 + ldr r0, [r0] + strh r1, [r0, 0x20] + str r1, [sp, 0xC] + add r0, sp, 0xC + ldr r1, =0x02038c28 + ldr r2, =0x010003c0 + bl CpuFastSet + ldr r0, [sp] + ldr r1, [sp, 0x4] + ldr r2, [sp, 0x8] + bl sub_80BA038 + add sp, 0x10 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8020770 + + thumb_func_start sub_80207C0 +sub_80207C0: @ 80207C0 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r0, 16 + mov r1, sp + strh r0, [r1] + ldr r5, =0x02039b28 + ldrb r0, [r5, 0x14] + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 7 + ldr r4, =0x02038c28 + adds r1, r4 + ldr r2, =0x01000090 + mov r0, sp + bl CpuSet + mov r0, sp + adds r0, 0x2 + movs r1, 0 + strh r1, [r0] + ldrb r2, [r5, 0x14] + lsls r1, r2, 4 + subs r1, r2 + lsls r1, 7 + movs r2, 0x90 + lsls r2, 1 + adds r4, r2 + adds r1, r4 + ldr r2, =0x01000010 + bl CpuSet + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80207C0 + + thumb_func_start sub_8020818 +sub_8020818: @ 8020818 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x8 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, sp + strh r4, [r0] + ldr r5, =0x02038c28 + ldr r0, =0x01000090 + mov r9, r0 + mov r0, sp + adds r1, r5, 0 + mov r2, r9 + bl CpuSet + mov r0, sp + adds r0, 0x2 + movs r6, 0 + strh r6, [r0] + movs r2, 0x90 + lsls r2, 1 + adds r1, r5, r2 + ldr r2, =0x01000010 + mov r8, r2 + bl CpuSet + add r0, sp, 0x4 + strh r4, [r0] + movs r2, 0xF0 + lsls r2, 3 + adds r1, r5, r2 + mov r2, r9 + bl CpuSet + mov r0, sp + adds r0, 0x6 + strh r6, [r0] + movs r1, 0x8A + lsls r1, 4 + adds r5, r1 + adds r1, r5, 0 + mov r2, r8 + bl CpuSet + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8020818 + + thumb_func_start sub_8020890 +sub_8020890: @ 8020890 + push {r4,r5,lr} + movs r5, 0 + ldr r4, =gUnknown_082F3134 +_08020896: + adds r0, r4, 0 + bl LoadCompressedObjectPic + adds r4, 0x8 + adds r5, 0x1 + cmp r5, 0x4 + bls _08020896 + ldr r0, =gUnknown_082F315C + bl LoadTaggedObjectPalette + ldr r4, =0x02022c8c + movs r0, 0x18 + bl Alloc + str r0, [r4] + cmp r0, 0 + beq _080208C8 + movs r0, 0x1 + b _080208CA + .pool +_080208C8: + movs r0, 0 +_080208CA: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8020890 + + thumb_func_start sub_80208D0 +sub_80208D0: @ 80208D0 + push {lr} + ldr r0, =0x02022c8c + ldr r0, [r0] + cmp r0, 0 + beq _080208DE + bl Free +_080208DE: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80208D0 + + thumb_func_start sub_80208E8 +sub_80208E8: @ 80208E8 + push {lr} + ldr r0, =gUnknown_082F319C + movs r1, 0xA + movs r2, 0x18 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022c8c + ldr r2, [r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + str r1, [r2] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80208E8 + + thumb_func_start sub_802091C +sub_802091C: @ 802091C + ldr r1, =0x02022c8c + ldr r1, [r1] + ldr r2, [r1] + adds r2, 0x3E + movs r1, 0x1 + ands r0, r1 + lsls r0, 2 + ldrb r3, [r2] + movs r1, 0x5 + negs r1, r1 + ands r1, r3 + orrs r1, r0 + strb r1, [r2] + bx lr + .pool + thumb_func_end sub_802091C + + thumb_func_start sub_802093C +sub_802093C: @ 802093C + push {r4,r5,lr} + sub sp, 0x4 + bl sub_801F0B0 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + mov r5, sp + adds r5, 0x1 + mov r0, sp + adds r1, r5, 0 + bl sub_801F0BC + cmp r4, 0x3 + beq _0802097C + ldr r4, =0x02022c8c + ldr r0, [r4] + ldr r0, [r0] + movs r1, 0 + bl StartObjectImageAnim + ldr r1, [r4] + ldr r2, [r1] + mov r0, sp + ldrb r0, [r0] + lsls r0, 3 + adds r0, 0xA + strh r0, [r2, 0x20] + ldr r2, [r1] + b _08020992 + .pool +_0802097C: + ldr r4, =0x02022c8c + ldr r0, [r4] + ldr r0, [r0] + movs r1, 0x2 + bl StartObjectImageAnim + ldr r2, [r4] + ldr r1, [r2] + movs r0, 0x18 + strh r0, [r1, 0x20] + ldr r2, [r2] +_08020992: + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, 0x18 + strh r0, [r2, 0x22] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802093C + + thumb_func_start sub_80209AC +sub_80209AC: @ 80209AC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 2 + ldr r0, =gUnknown_082F2DF2 + adds r4, r0 + movs r0, 0 + bl IndexOfObjectPaletteTag + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 4 + ldr r0, =0x01010000 + adds r1, r0 + lsrs r1, 16 + adds r0, r4, 0 + movs r2, 0x4 + bl gpu_pal_apply + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80209AC + + thumb_func_start sub_80209E0 +sub_80209E0: @ 80209E0 + push {lr} + bl sub_801F0B0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + beq _08020A00 + ldr r0, =0x02022c8c + ldr r0, [r0] + ldr r0, [r0] + movs r1, 0x1 + bl StartObjectImageAnim + b _08020A0C + .pool +_08020A00: + ldr r0, =0x02022c8c + ldr r0, [r0] + ldr r0, [r0] + movs r1, 0x3 + bl StartObjectImageAnim +_08020A0C: + ldr r0, =0x02022c8c + ldr r1, [r0] + movs r0, 0 + strh r0, [r1, 0x14] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80209E0 + + thumb_func_start sub_8020A1C +sub_8020A1C: @ 8020A1C + push {r4,lr} + ldr r4, =0x02022c8c + ldr r1, [r4] + ldrh r0, [r1, 0x14] + cmp r0, 0x3 + bls _08020A30 +_08020A28: + movs r0, 0 + b _08020A62 + .pool +_08020A30: + adds r0, 0x1 + strh r0, [r1, 0x14] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x3 + bls _08020A60 + bl sub_801F0B0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + beq _08020A54 + ldr r0, [r4] + ldr r0, [r0] + movs r1, 0 + bl StartObjectImageAnim + b _08020A28 +_08020A54: + ldr r0, [r4] + ldr r0, [r0] + movs r1, 0x2 + bl StartObjectImageAnim + b _08020A28 +_08020A60: + movs r0, 0x1 +_08020A62: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8020A1C + + thumb_func_start sub_8020A68 +sub_8020A68: @ 8020A68 + push {r4,r5,lr} + ldr r0, =gUnknown_082F31BC + movs r1, 0x4C + movs r2, 0x98 + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r5, =0x02022c8c + ldr r2, [r5] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r4, =0x02020630 + adds r1, r4 + str r1, [r2, 0x8] + ldr r0, =gUnknown_082F31D4 + movs r1, 0x40 + movs r2, 0x98 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r2, [r5] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + str r1, [r2, 0x4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8020A68 + + thumb_func_start sub_8020ABC +sub_8020ABC: @ 8020ABC + push {r4,lr} + adds r4, r0, 0 + bl sub_801F198 + adds r3, r0, 0 + cmp r3, 0xF + bne _08020AD8 + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + b _08020AEC +_08020AD8: + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x5 + negs r1, r1 + ands r1, r0 + strb r1, [r2] + lsls r0, r3, 3 + adds r0, 0x4C + strh r0, [r4, 0x20] +_08020AEC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8020ABC + + thumb_func_start sub_8020AF4 +sub_8020AF4: @ 8020AF4 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + movs r2, 0 + strh r0, [r1, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _08020B1A + strh r2, [r1, 0x2E] + ldrh r0, [r1, 0x24] + adds r0, 0x1 + strh r0, [r1, 0x24] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _08020B1A + strh r2, [r1, 0x24] +_08020B1A: + pop {r0} + bx r0 + thumb_func_end sub_8020AF4 + + thumb_func_start sub_8020B20 +sub_8020B20: @ 8020B20 + push {r4,r5,lr} + ldr r0, =gUnknown_082F322C + movs r1, 0x8 + movs r2, 0x98 + movs r3, 0x3 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r5, =0x02022c8c + ldr r2, [r5] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r4, =0x02020630 + adds r1, r4 + str r1, [r2, 0xC] + ldr r0, =gUnknown_082F3244 + movs r1, 0x20 + movs r2, 0x98 + movs r3, 0x4 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r2, [r5] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + str r1, [r2, 0x10] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8020B20 + + thumb_func_start sub_8020B80 +sub_8020B80: @ 8020B80 + push {r4,lr} + bl sub_801F0B0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _08020BB8 + bl sub_801F0DC + cmp r0, 0 + beq _08020BC2 + ldr r3, =0x02022c8c + ldr r0, [r3] + ldr r1, [r0, 0x10] + adds r1, 0x3E + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r0, [r3] + ldr r0, [r0, 0x10] + movs r1, 0x3 + bl StartObjectImageAnim + b _08020BF6 + .pool +_08020BB8: + bl sub_801F1A4 + adds r4, r0, 0 + cmp r4, 0x3 + bne _08020BD8 +_08020BC2: + ldr r0, =0x02022c8c + ldr r0, [r0] + ldr r1, [r0, 0x10] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + b _08020BF6 + .pool +_08020BD8: + ldr r3, =0x02022c8c + ldr r0, [r3] + ldr r1, [r0, 0x10] + adds r1, 0x3E + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r0, [r3] + ldr r0, [r0, 0x10] + lsls r1, r4, 24 + lsrs r1, 24 + bl StartObjectImageAnim +_08020BF6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8020B80 + + thumb_func_start sub_8020C00 +sub_8020C00: @ 8020C00 + ldr r0, =0x02022c90 + ldr r0, [r0] + bx lr + .pool + thumb_func_end sub_8020C00 + + thumb_func_start sub_8020C0C +sub_8020C0C: @ 8020C0C + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =0x02022c90 + ldr r0, [r5] + cmp r0, 0 + bne _08020C20 + movs r0, 0x2 + b _08020C5C + .pool +_08020C20: + cmp r4, 0 + bne _08020C26 + ldr r4, [r0] +_08020C26: + ldrb r0, [r0, 0xA] + bl remove_task + ldr r0, [r5] + bl Free + movs r0, 0 + str r0, [r5] + adds r0, r4, 0 + bl SetMainCallback2 + ldr r0, =c2_exit_to_overworld_2_switch + cmp r4, r0 + bne _08020C5A + ldr r2, =0x03003014 + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + movs r0, 0xC8 + lsls r0, 1 + bl current_map_music_set + ldr r0, =c1_overworld + bl set_callback1 +_08020C5A: + movs r0, 0 +_08020C5C: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8020C0C + + thumb_func_start sub_8020C70 +sub_8020C70: @ 8020C70 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + adds r4, r0, 0 + movs r0, 0 + mov r8, r0 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _08020C8E + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _08020CAC +_08020C8E: + adds r0, r4, 0 + bl SetMainCallback2 + ldr r0, =0x03005000 + mov r1, r8 + strh r1, [r0, 0x10] + strh r1, [r0, 0x12] + b _08020CF8 + .pool +_08020CAC: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r7, r0, 24 + mov r0, r8 + cmp r0, 0x1 + bls _08020CC8 + cmp r7, r8 + bcc _08020CDC +_08020CC8: + adds r0, r4, 0 + bl SetMainCallback2 + ldr r0, =0x03005000 + movs r1, 0 + strh r1, [r0, 0x10] + strh r1, [r0, 0x12] + b _08020CF8 + .pool +_08020CDC: + ldr r6, =0x02022c90 + ldr r0, =0x000041c0 + bl AllocZeroed + adds r5, r0, 0 + str r5, [r6] + cmp r5, 0 + bne _08020D10 + adds r0, r4, 0 + bl SetMainCallback2 + ldr r0, =0x03005000 + strh r5, [r0, 0x10] + strh r5, [r0, 0x12] +_08020CF8: + adds r0, 0xEE + ldrb r1, [r0] + movs r1, 0x1 + strb r1, [r0] + b _08020D74 + .pool +_08020D10: + str r4, [r5] + movs r4, 0 + strb r7, [r5, 0x8] + ldr r0, [r6] + mov r1, r8 + strb r1, [r0, 0x9] + ldr r0, [r6] + bl sub_8020FC4 + ldr r1, [r6] + movs r2, 0x1 + movs r0, 0x1 + strh r0, [r1, 0x12] + strb r2, [r1, 0xE] + ldr r1, [r6] + movs r0, 0x6 + strb r0, [r1, 0xF] + ldr r0, [r6] + adds r0, 0x36 + movs r2, 0x1 + negs r2, r2 + movs r1, 0x10 + str r1, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl sub_8024604 + ldr r2, [r6] + adds r2, 0x36 + movs r0, 0x4 + movs r1, 0x1 + bl sub_8022BEC + ldr r0, =sub_8020F88 + bl SetMainCallback2 + ldr r0, =sub_8020FA0 + movs r1, 0x8 + bl AddTask + ldr r1, [r6] + strb r0, [r1, 0xA] + ldr r2, =0x03003014 + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_08020D74: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8020C70 + + thumb_func_start sub_8020D8C +sub_8020D8C: @ 8020D8C + push {r4,lr} + sub sp, 0xC + ldr r1, =0x0203ce7c + ldrh r0, [r1] + subs r0, 0x85 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2B + bls _08020DA8 + movs r0, 0x85 + strh r0, [r1] + b _08020DB0 + .pool +_08020DA8: + ldrh r0, [r1] + movs r1, 0x1 + bl remove_item +_08020DB0: + ldr r4, =0x02022c90 + ldr r2, [r4] + ldrb r0, [r2, 0x8] + lsls r0, 5 + adds r0, r2, r0 + ldr r1, =0x0203ce7c + ldrh r1, [r1] + subs r1, 0x85 + adds r0, 0xA4 + movs r3, 0 + strh r1, [r0] + movs r0, 0x1 + strb r0, [r2, 0xE] + ldr r1, [r4] + movs r0, 0x9 + strb r0, [r1, 0xF] + ldr r0, [r4] + adds r0, 0x36 + movs r2, 0x1 + negs r2, r2 + movs r1, 0x10 + str r1, [sp] + str r3, [sp, 0x4] + str r3, [sp, 0x8] + movs r1, 0 + bl sub_8024604 + ldr r2, [r4] + adds r2, 0x36 + movs r0, 0x4 + movs r1, 0x1 + bl sub_8022BEC + ldr r0, =sub_8020FA0 + movs r1, 0x8 + bl AddTask + ldr r1, [r4] + strb r0, [r1, 0xA] + ldr r0, =sub_8020F88 + bl SetMainCallback2 + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8020D8C + + thumb_func_start sub_8020E1C +sub_8020E1C: @ 8020E1C + push {lr} + ldr r0, =0x02022c90 + ldr r0, [r0] + ldrb r0, [r0, 0xA] + bl remove_task + ldr r0, =sub_8020D8C + bl sub_81AABF0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8020E1C + + thumb_func_start sub_8020E3C +sub_8020E3C: @ 8020E3C + push {lr} + ldr r0, =sub_8020F74 + bl SetVBlankCallback + pop {r0} + bx r0 + .pool + thumb_func_end sub_8020E3C + + thumb_func_start sub_8020E4C +sub_8020E4C: @ 8020E4C + push {lr} + movs r0, 0 + bl SetVBlankCallback + pop {r0} + bx r0 + thumb_func_end sub_8020E4C + + thumb_func_start sub_8020E58 +sub_8020E58: @ 8020E58 + push {r4-r6,lr} + ldr r4, =0x02022c90 + ldr r0, [r4] + adds r0, 0x6C + ldrh r2, [r0] + lsls r2, 8 + movs r1, 0xF0 + lsls r1, 6 + adds r0, r2, 0 + bl sub_81515FC + adds r2, r0, 0 + ldr r0, [r4] + adds r0, 0x72 + ldrh r3, [r0] + lsls r3, 8 + adds r0, r3, 0 + adds r1, r2, 0 + bl sub_81515FC + adds r3, r0, 0 + ldr r0, =0x0000ffff + ands r3, r0 + ldr r2, [r4] + strh r3, [r2, 0x16] + ldrb r0, [r2, 0x9] + cmp r0, 0x3 + beq _08020EDC + cmp r0, 0x3 + bgt _08020EA4 + cmp r0, 0x2 + beq _08020EAE + b _08020F48 + .pool +_08020EA4: + cmp r0, 0x4 + beq _08020EEC + cmp r0, 0x5 + beq _08020F20 + b _08020F48 +_08020EAE: + ldr r5, =0x03005d90 + ldr r1, [r5] + movs r0, 0xF6 + lsls r0, 1 + adds r1, r0 + lsls r0, r3, 16 + lsrs r0, 16 + ldrh r1, [r1] + cmp r0, r1 + bls _08020F48 + adds r2, 0x25 + ldrb r0, [r2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2] + ldr r0, [r5] + ldr r1, [r4] + ldrh r1, [r1, 0x16] + movs r2, 0xF6 + lsls r2, 1 + b _08020F14 + .pool +_08020EDC: + ldr r5, =0x03005d90 + ldr r0, [r5] + movs r6, 0xF7 + lsls r6, 1 + b _08020F28 + .pool +_08020EEC: + ldr r5, =0x03005d90 + ldr r1, [r5] + movs r0, 0xF8 + lsls r0, 1 + adds r1, r0 + lsls r0, r3, 16 + lsrs r0, 16 + ldrh r1, [r1] + cmp r0, r1 + bls _08020F48 + adds r2, 0x25 + ldrb r0, [r2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2] + ldr r0, [r5] + ldr r1, [r4] + ldrh r1, [r1, 0x16] + movs r2, 0xF8 + lsls r2, 1 +_08020F14: + adds r0, r2 + strh r1, [r0] + b _08020F48 + .pool +_08020F20: + ldr r5, =0x03005d90 + ldr r0, [r5] + movs r6, 0xF9 + lsls r6, 1 +_08020F28: + adds r1, r0, r6 + lsls r0, r3, 16 + lsrs r0, 16 + ldrh r1, [r1] + cmp r0, r1 + bls _08020F48 + adds r2, 0x25 + ldrb r0, [r2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2] + ldr r1, [r5] + ldr r0, [r4] + ldrh r0, [r0, 0x16] + adds r1, r6 + strh r0, [r1] +_08020F48: + ldr r4, =0x02022c90 + ldr r1, [r4] + ldr r0, [r1, 0x68] + str r0, [r1, 0x1C] + bl sub_8024700 + lsls r0, 24 + cmp r0, 0 + bne _08020F66 + ldr r0, [r4] + adds r0, 0x25 + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] +_08020F66: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8020E58 + + thumb_func_start sub_8020F74 +sub_8020F74: @ 8020F74 + push {lr} + bl copy_pal_bg_faded_to_pal_ram + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + pop {r0} + bx r0 + thumb_func_end sub_8020F74 + + thumb_func_start sub_8020F88 +sub_8020F88: @ 8020F88 + push {lr} + bl RunActiveTasks + bl RunTextPrinters + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + pop {r0} + bx r0 + thumb_func_end sub_8020F88 + + thumb_func_start sub_8020FA0 +sub_8020FA0: @ 8020FA0 + push {r4,lr} + ldr r4, =0x02022c90 + ldr r0, [r4] + ldr r2, [r0, 0x4] + cmp r2, 0 + beq _08020FB4 + adds r1, r0, 0 + adds r1, 0x36 + bl _call_via_r2 +_08020FB4: + ldr r0, [r4] + bl sub_8021450 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8020FA0 + + thumb_func_start sub_8020FC4 +sub_8020FC4: @ 8020FC4 + push {r4-r6,lr} + adds r6, r0, 0 + movs r5, 0 + b _08020FE6 +_08020FCC: + lsls r0, r5, 5 + adds r0, 0x98 + adds r0, r6, r0 + lsls r1, r5, 3 + subs r1, r5 + lsls r1, 2 + ldr r2, =0x020229f0 + adds r1, r2 + bl CopyString + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_08020FE6: + ldrb r0, [r6, 0x9] + cmp r5, r0 + bcc _08020FCC + cmp r5, 0x4 + bhi _08021012 +_08020FF0: + lsls r4, r5, 5 + adds r0, r4, 0 + adds r0, 0x98 + adds r0, r6, r0 + movs r1, 0x1 + movs r2, 0x7 + bl memset + adds r4, r6, r4 + adds r4, 0x9F + movs r0, 0xFF + strb r0, [r4] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x4 + bls _08020FF0 +_08021012: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x14] + lsls r0, 29 + lsrs r0, 29 + cmp r0, 0x1 + beq _0802103E + cmp r0, 0x1 + bgt _08021034 + cmp r0, 0 + beq _0802103A + b _08021046 + .pool +_08021034: + cmp r0, 0x2 + beq _08021042 + b _08021046 +_0802103A: + movs r0, 0x8 + b _08021044 +_0802103E: + movs r0, 0x4 + b _08021044 +_08021042: + movs r0, 0x1 +_08021044: + strb r0, [r6, 0xB] +_08021046: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8020FC4 + + thumb_func_start sub_802104C +sub_802104C: @ 802104C + push {r4,r5,lr} + sub sp, 0xC + bl sub_8020C00 + adds r5, r0, 0 + cmp r5, 0 + bne _08021060 + movs r0, 0x1 + negs r0, r0 + b _08021304 +_08021060: + ldrb r0, [r5, 0xC] + cmp r0, 0x9 + bls _08021068 + b _080212FC +_08021068: + lsls r0, 2 + ldr r1, =_08021078 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08021078: + .4byte _080210A0 + .4byte _080210BE + .4byte _080210E4 + .4byte _080210F2 + .4byte _08021178 + .4byte _080211BE + .4byte _080211EC + .4byte _0802121C + .4byte _08021278 + .4byte _080212B4 +_080210A0: + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + movs r1, 0 + bl SetGpuReg + bl remove_some_task + bl reset_temp_tile_data_buffers + b _080212FC +_080210BE: + add r0, sp, 0x8 + movs r4, 0 + strh r4, [r0] + movs r1, 0xE0 + lsls r1, 19 + ldr r2, =0x01000200 + bl CpuSet + ldr r0, =0x0300301c + strb r4, [r0] + movs r0, 0x3 + bl sub_8034C54 + b _080212FC + .pool +_080210E4: + bl sub_80A1A74 + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + b _080212FC +_080210F2: + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_082F32C8 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + movs r0, 0xE0 + lsls r0, 1 + adds r1, r5, r0 + movs r0, 0x1 + bl SetBgTilemapBuffer + movs r0, 0x87 + lsls r0, 6 + adds r1, r5, r0 + movs r0, 0x2 + bl SetBgTilemapBuffer + movs r0, 0xC7 + lsls r0, 6 + adds r1, r5, r0 + movs r0, 0x3 + bl SetBgTilemapBuffer + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + b _080212FC + .pool +_08021178: + movs r4, 0x20 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + str r4, [sp] + movs r0, 0x40 + str r0, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + b _080212FC +_080211BE: + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + ldr r1, =gUnknown_08DE34B8 + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + b _080212FC + .pool +_080211EC: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + beq _080211F8 + b _08021302 +_080211F8: + bl sub_81971D0 + bl sub_8197200 + adds r0, r5, 0 + bl sub_8022588 + adds r0, r5, 0 + bl sub_8022600 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x8] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0, 0x8] + b _080212FC + .pool +_0802121C: + ldr r0, =gUnknown_08DE3398 + movs r2, 0xC0 + lsls r2, 1 + movs r1, 0 + bl gpu_pal_apply + ldr r1, =gUnknown_082F3C8C + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + ldr r1, =gUnknown_082F3DBC + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + ldr r1, =gUnknown_082F3F54 + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + adds r0, r5, 0 + bl sub_80226D0 + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + b _080212FC + .pool +_08021278: + bl sub_800E0E8 + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + adds r0, r5, 0 + bl sub_8022730 + ldr r0, =0x02021bbe + ldrh r1, [r0] + negs r1, r1 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x16 + bl SetGpuReg + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + b _080212FC + .pool +_080212B4: + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuRegBits + bl sub_8020E3C + movs r0, 0 + strb r0, [r5, 0xC] + movs r0, 0x1 + b _08021304 + .pool +_080212FC: + ldrb r0, [r5, 0xC] + adds r0, 0x1 + strb r0, [r5, 0xC] +_08021302: + movs r0, 0 +_08021304: + add sp, 0xC + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_802104C + + thumb_func_start sub_802130C +sub_802130C: @ 802130C + push {r4,r5,lr} + sub sp, 0x8 + bl sub_8020C00 + adds r5, r0, 0 + cmp r5, 0 + bne _08021320 + movs r0, 0x1 + negs r0, r0 + b _08021446 +_08021320: + ldrb r0, [r5, 0xC] + cmp r0, 0x7 + bls _08021328 + b _0802143E +_08021328: + lsls r0, 2 + ldr r1, =_08021338 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08021338: + .4byte _08021358 + .4byte _0802135E + .4byte _08021368 + .4byte _0802137E + .4byte _0802138A + .4byte _080213E6 + .4byte _08021426 + .4byte _08021436 +_08021358: + bl sub_8010434 + b _0802143E +_0802135E: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08021444 +_08021368: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + bl fade_and_return_progress_probably + b _0802143E +_0802137E: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + beq _0802143E + b _08021444 +_0802138A: + movs r4, 0x20 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + b _0802143E +_080213E6: + bl FreeAllWindowBuffers + movs r0, 0 + bl HideBg + movs r0, 0 + bl UnsetBgTilemapBuffer + movs r0, 0x1 + bl HideBg + movs r0, 0x1 + bl UnsetBgTilemapBuffer + movs r0, 0x2 + bl HideBg + movs r0, 0x2 + bl UnsetBgTilemapBuffer + movs r0, 0x3 + bl HideBg + movs r0, 0x3 + bl UnsetBgTilemapBuffer + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl ClearGpuRegBits + b _0802143E +_08021426: + bl sub_800E084 + adds r0, r5, 0 + bl sub_8022960 + bl sub_8034CC8 + b _0802143E +_08021436: + movs r0, 0 + strb r0, [r5, 0xC] + movs r0, 0x1 + b _08021446 +_0802143E: + ldrb r0, [r5, 0xC] + adds r0, 0x1 + strb r0, [r5, 0xC] +_08021444: + movs r0, 0 +_08021446: + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_802130C + + thumb_func_start sub_8021450 +sub_8021450: @ 8021450 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x02021bbe + ldrh r1, [r4, 0x2C] + ldrh r2, [r4, 0x2A] + adds r1, r2 + strh r1, [r0] + negs r1, r1 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x16 + bl SetGpuReg + ldrh r0, [r4, 0x12] + cmp r0, 0x7 + bne _0802147C + movs r1, 0x9C + lsls r1, 1 + adds r0, r4, r1 + ldrh r1, [r4, 0x28] + bl sub_8022524 +_0802147C: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8021450 + + thumb_func_start sub_8021488 +sub_8021488: @ 8021488 + movs r1, 0 + ldr r2, =0x0000ff98 + strh r2, [r0, 0x2A] + strh r1, [r0, 0x2C] + ldr r0, =0x02021bbc + strh r1, [r0] + ldr r0, =0x02021bbe + strh r2, [r0] + bx lr + .pool + thumb_func_end sub_8021488 + + thumb_func_start sub_80214A8 +sub_80214A8: @ 80214A8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + mov r10, r0 + str r1, [sp] + movs r0, 0 + mov r9, r0 + mov r1, r10 + ldrb r1, [r1, 0x9] + cmp r9, r1 + bcc _080214C6 + b _080215E4 +_080214C6: + ldr r1, =gUnknown_082F41E8 + mov r2, r9 + lsls r0, r2, 1 + adds r0, r1 + ldrh r2, [r0] + mov r1, r9 + lsls r0, r1, 5 + add r0, r10 + adds r0, 0xA4 + ldrh r3, [r0] + adds r3, 0x85 + lsls r3, 16 + lsrs r3, 16 + ldr r0, =gUnknown_082F436C + adds r1, r2, 0 + bl AddItemIconObjectWithCustomObjectTemplate + lsls r0, 24 + lsrs r0, 24 + mov r2, r9 + lsls r3, r2, 2 + ldr r1, [sp] + adds r1, 0x38 + adds r6, r1, r3 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + str r1, [r6] + ldrb r0, [r1, 0x5] + movs r2, 0xC + orrs r0, r2 + strb r0, [r1, 0x5] + ldr r2, [r6] + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r1, [r6] + ldr r0, [sp] + adds r0, 0xC + adds r0, r3 + mov r8, r0 + ldr r0, [r0] + ldrh r0, [r0, 0x8] + adds r0, 0x78 + strh r0, [r1, 0x20] + ldr r1, [r6] + ldr r0, =0x0000fff0 + strh r0, [r1, 0x22] + ldr r3, [r6] + adds r5, r3, 0 + adds r5, 0x2E + movs r0, 0x80 + lsls r0, 2 + strh r0, [r5, 0x2] + movs r0, 0x20 + strh r0, [r5, 0x4] + movs r0, 0x70 + strh r0, [r5, 0xE] + mov r2, r8 + ldr r1, [r2] + ldrh r0, [r1, 0xA] + ldrh r1, [r1, 0x8] + subs r0, r1 + lsls r0, 16 + asrs r1, r0, 16 + adds r0, r1, 0 + cmp r1, 0 + bge _08021558 + adds r0, r1, 0x3 +_08021558: + asrs r0, 2 + strh r0, [r5, 0xC] + lsls r0, r1, 23 + lsrs r7, r0, 16 + movs r2, 0x80 + lsls r2, 2 + adds r2, 0x20 + lsrs r2, 1 + movs r0, 0x7 + movs r1, 0xFE + lsls r1, 6 + str r3, [sp, 0x4] + bl sub_81515D4 + adds r4, r0, 0 + ldr r0, [r6] + ldrh r0, [r0, 0x20] + lsls r0, 7 + ldr r3, [sp, 0x4] + strh r0, [r3, 0x2E] + lsls r1, r7, 16 + asrs r1, 16 + lsls r4, 16 + asrs r4, 16 + movs r0, 0x7 + adds r2, r4, 0 + bl sub_81515D4 + strh r0, [r5, 0x6] + movs r0, 0x7 + adds r1, r4, 0 + movs r2, 0x55 + bl sub_8151550 + adds r2, r0, 0 + movs r0, 0 + strh r0, [r5, 0x8] + lsls r2, 16 + asrs r2, 16 + movs r0, 0x7 + movs r1, 0xFE + lsls r1, 6 + bl sub_81515D4 + strh r0, [r5, 0xA] + ldrh r0, [r5, 0xE] + ldr r2, =0xffff8000 + adds r1, r2, 0 + orrs r0, r1 + strh r0, [r5, 0xE] + mov r1, r8 + ldr r0, [r1] + movs r2, 0x8 + ldrsh r0, [r0, r2] + cmp r0, 0 + bge _080215D0 + ldr r0, [r6] + movs r1, 0x1 + bl StartObjectRotScalAnim +_080215D0: + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + mov r0, r10 + ldrb r0, [r0, 0x9] + cmp r9, r0 + bcs _080215E4 + b _080214C6 +_080215E4: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80214A8 + + thumb_func_start sub_8021608 +sub_8021608: @ 8021608 + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r5, 0 + adds r4, 0x2E + ldrh r0, [r4, 0x4] + ldrh r1, [r4, 0x2] + adds r0, r1 + strh r0, [r4, 0x2] + lsls r0, 16 + asrs r0, 24 + ldrh r2, [r5, 0x26] + adds r0, r2 + strh r0, [r5, 0x26] + movs r1, 0xE + ldrsh r0, [r4, r1] + movs r6, 0x80 + lsls r6, 8 + ands r0, r6 + cmp r0, 0 + beq _0802166E + ldrh r0, [r4, 0x6] + ldrh r2, [r5, 0x2E] + adds r0, r2 + strh r0, [r5, 0x2E] + ldrh r0, [r4, 0xA] + ldrh r1, [r4, 0x8] + adds r0, r1 + strh r0, [r4, 0x8] + lsls r0, 16 + asrs r0, 23 + movs r2, 0xC + ldrsh r1, [r4, r2] + bl sine + strh r0, [r5, 0x24] + movs r1, 0xE + ldrsh r0, [r4, r1] + ands r0, r6 + cmp r0, 0 + beq _0802166E + ldrh r0, [r4, 0x8] + lsls r0, 16 + asrs r0, 23 + cmp r0, 0x7E + ble _0802166E + movs r0, 0 + strh r0, [r5, 0x24] + ldrh r1, [r4, 0xE] + ldr r0, =0x00007fff + ands r0, r1 + strh r0, [r4, 0xE] +_0802166E: + ldrh r0, [r4] + lsls r0, 16 + asrs r0, 23 + strh r0, [r5, 0x20] + movs r2, 0x22 + ldrsh r1, [r5, r2] + movs r2, 0x26 + ldrsh r0, [r5, r2] + adds r1, r0 + ldrh r2, [r4, 0xE] + ldr r0, =0x00007fff + ands r0, r2 + cmp r1, r0 + blt _0802169A + ldr r0, =DummyObjectCallback + str r0, [r5, 0x1C] + adds r0, r5, 0 + bl obj_free_rotscale_entry + adds r0, r5, 0 + bl RemoveObjectAndFreeTiles +_0802169A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8021608 + + thumb_func_start sub_80216A8 +sub_80216A8: @ 80216A8 + push {r4-r7,lr} + adds r6, r0, 0 + movs r5, 0 + ldrb r0, [r6, 0x9] + cmp r5, r0 + bcs _080216D4 + ldr r7, =gUnknown_082F41E8 +_080216B6: + lsls r0, r5, 1 + adds r0, r7 + ldrh r4, [r0] + adds r0, r4, 0 + bl FreeObjectPaletteByTag + adds r0, r4, 0 + bl FreeObjectTilesByTag + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldrb r0, [r6, 0x9] + cmp r5, r0 + bcc _080216B6 +_080216D4: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80216A8 + + thumb_func_start sub_80216E0 +sub_80216E0: @ 80216E0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + adds r6, r0, 0 + str r1, [sp] + movs r0, 0 + str r0, [sp, 0x4] + movs r1, 0x4E + adds r1, r6 + mov r10, r1 + mov r9, r0 + ldrb r2, [r6, 0x9] + cmp r0, r2 + bcs _080217AE + ldr r7, =gUnknown_082F41CC +_08021704: + mov r3, r10 + ldrh r0, [r3, 0xA] + mov r4, r9 + lsls r1, r4, 1 + add r1, r9 + asrs r0, r1 + lsls r0, 16 + movs r1, 0xE0 + lsls r1, 11 + ands r1, r0 + lsrs r1, 16 + mov r8, r1 + cmp r1, 0 + beq _0802179E + ldr r0, [sp, 0x4] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08021748 + lsls r4, 2 + ldr r5, [sp] + adds r5, 0x24 + adds r0, r5, r4 + ldr r0, [r0] + movs r1, 0x1 + bl StartObjectImageAnim + b _0802175A + .pool +_08021748: + mov r0, r9 + lsls r4, r0, 2 + ldr r5, [sp] + adds r5, 0x24 + adds r0, r5, r4 + ldr r0, [r0] + movs r1, 0 + bl StartObjectImageAnim +_0802175A: + adds r3, r5, r4 + ldr r2, [r3] + adds r2, 0x3E + ldrb r0, [r2] + movs r4, 0x5 + negs r4, r4 + adds r1, r4, 0 + ands r0, r1 + strb r0, [r2] + ldr r2, [r3] + adds r2, 0x2C + ldrb r0, [r2] + subs r4, 0x3C + adds r1, r4, 0 + ands r0, r1 + strb r0, [r2] + ldr r2, [r3] + movs r0, 0x3 + mov r1, r8 + ands r1, r0 + mov r8, r1 + subs r1, 0x1 + lsls r1, 1 + adds r0, r1, r7 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + strh r0, [r2, 0x24] + ldr r2, [r3] + ldr r3, =gUnknown_082F41CD + adds r1, r3 + movs r0, 0 + ldrsb r0, [r1, r0] + strh r0, [r2, 0x26] +_0802179E: + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldrb r4, [r6, 0x9] + cmp r9, r4 + bcc _08021704 +_080217AE: + ldr r0, [sp, 0x4] + cmp r0, 0 + bne _080217C0 + adds r2, r6, 0 + adds r2, 0x25 + ldrb r1, [r2] + b _0802189C + .pool +_080217C0: + ldrh r0, [r6, 0x28] + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + mov r1, r8 + str r1, [sp, 0x8] + movs r2, 0 + mov r9, r2 + mov r3, r10 + ldrh r1, [r3, 0xC] + lsls r0, r1, 1 + adds r0, 0x3 + adds r6, 0x25 + str r6, [sp, 0xC] + adds r3, r1, 0 + cmp r9, r0 + bge _08021890 +_080217E8: + mov r4, r9 + lsls r1, r4, 2 + ldr r0, [sp] + adds r0, 0x4C + adds r7, r0, r1 + ldr r2, [r7] + adds r0, r2, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0802187E + ldr r0, =sub_8022B28 + str r0, [r2, 0x1C] + lsls r1, r4, 1 + ldr r3, =gUnknown_082F41D2 + adds r0, r1, r3 + movs r4, 0 + ldrsb r4, [r0, r4] + adds r0, r4, 0 + adds r0, 0x78 + strh r0, [r2, 0x20] + ldr r2, [r7] + ldr r0, =gUnknown_082F41D3 + adds r1, r0 + movs r6, 0 + ldrsb r6, [r1, r6] + mov r1, r8 + lsls r0, r1, 2 + subs r0, 0x88 + subs r0, r6, r0 + strh r0, [r2, 0x22] + ldr r5, [r7] + ldr r2, [sp, 0x8] + lsls r1, r2, 2 + adds r0, r4, 0 + bl __divsi3 + adds r4, r0 + strh r4, [r5, 0x24] + ldr r0, [r7] + strh r6, [r0, 0x26] + mov r3, r10 + ldrb r1, [r3, 0x4] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08021860 + ldr r0, [r7] + movs r1, 0x1 + bl StartObjectImageAnim + b _08021868 + .pool +_08021860: + ldr r0, [r7] + movs r1, 0 + bl StartObjectImageAnim +_08021868: + mov r0, r8 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + mov r4, r10 + ldrh r3, [r4, 0xC] + cmp r0, 0x3 + bls _0802187E + movs r0, 0 + mov r8, r0 +_0802187E: + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r0, r3, 1 + adds r0, 0x3 + cmp r9, r0 + blt _080217E8 +_08021890: + ldr r2, [sp, 0xC] + ldrb r1, [r2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080218A6 +_0802189C: + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + b _080218C4 +_080218A6: + ldr r3, [sp, 0x4] + cmp r3, 0x1 + bne _080218B4 + movs r0, 0x4E + bl audio_play + b _080218BA +_080218B4: + movs r0, 0x4D + bl audio_play +_080218BA: + ldr r4, [sp, 0xC] + ldrb r0, [r4] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4] +_080218C4: + 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_80216E0 + + thumb_func_start sub_80218D4 +sub_80218D4: @ 80218D4 + push {r4-r7,lr} + adds r5, r0, 0 + adds r6, r1, 0 + movs r2, 0 + ldrb r0, [r5, 0x9] + cmp r2, r0 + bcs _08021906 + adds r4, r6, 0 + adds r4, 0x24 + movs r7, 0x4 + adds r3, r0, 0 +_080218EA: + lsls r0, r2, 2 + adds r0, r4, r0 + ldr r0, [r0] + adds r0, 0x3E + ldrb r1, [r0] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _08021920 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r3 + bcc _080218EA +_08021906: + movs r2, 0 + adds r3, r6, 0 + adds r3, 0x4C + movs r4, 0x4 +_0802190E: + lsls r0, r2, 2 + adds r0, r3, r0 + ldr r0, [r0] + adds r0, 0x3E + ldrb r1, [r0] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + bne _08021924 +_08021920: + movs r0, 0 + b _0802193C +_08021924: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xA + bls _0802190E + movs r1, 0x2C + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _0802193A + movs r0, 0 + strh r0, [r5, 0x2C] +_0802193A: + movs r0, 0x1 +_0802193C: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80218D4 + + thumb_func_start sub_8021944 +sub_8021944: @ 8021944 + push {r4-r7,lr} + adds r6, r0, 0 + lsls r4, r1, 16 + lsrs r4, 16 + movs r7, 0 + movs r5, 0xE1 + lsls r5, 4 + adds r0, r4, 0 + adds r1, r5, 0 + bl __udivsi3 + strh r0, [r6, 0x4] + adds r0, r4, 0 + adds r1, r5, 0 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3C + bl __udivsi3 + strh r0, [r6, 0x6] + adds r0, r4, 0 + movs r1, 0x3C + bl __umodsi3 + lsls r0, 24 + asrs r0, 16 + movs r1, 0x4 + bl sub_8151534 + adds r2, r7, 0 + lsls r0, 16 + asrs r3, r0, 16 + movs r0, 0x7 + mov r12, r0 + ldr r5, =gUnknown_082F334C + movs r4, 0x1 +_08021990: + mov r0, r12 + subs r1, r0, r2 + adds r0, r3, 0 + asrs r0, r1 + ands r0, r4 + cmp r0, 0 + beq _080219A6 + lsls r0, r2, 2 + adds r0, r5 + ldr r0, [r0] + adds r7, r0 +_080219A6: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x7 + bls _08021990 + ldr r1, =0x000f4240 + adds r0, r7, 0 + bl __udivsi3 + strh r0, [r6, 0x8] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8021944 + + thumb_func_start sub_80219C8 +sub_80219C8: @ 80219C8 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0xC + adds r6, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + mov r8, r3 + lsls r6, 24 + lsrs r6, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + movs r2, 0x1 + negs r2, r2 + movs r0, 0x2 + mov r1, r8 + bl GetStringWidth + lsls r4, 2 + lsrs r0, 1 + subs r4, r0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r5, 1 + adds r0, r5 + ldr r1, =gUnknown_082F32D8 + adds r0, r1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + mov r0, r8 + str r0, [sp, 0x8] + adds r0, r6, 0 + movs r1, 0x2 + adds r2, r4, 0 + movs r3, 0 + bl box_print + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80219C8 + + thumb_func_start sub_8021A28 +sub_8021A28: @ 8021A28 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + str r0, [sp, 0xC] + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x10] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x14] + lsls r3, 24 + movs r0, 0 + str r0, [sp, 0x18] + movs r1, 0 + str r1, [sp, 0x1C] + ldr r2, [sp, 0xC] + adds r2, 0x68 + str r2, [sp, 0x20] + movs r4, 0xF0 + lsls r4, 24 + adds r3, r4 + lsrs r3, 24 + ldr r0, [sp, 0x10] + cmp r0, 0x2 + bne _08021A68 + adds r0, r3, 0 + subs r0, 0x2A + lsls r0, 24 + lsrs r3, r0, 24 +_08021A68: + ldr r2, [sp, 0xC] + ldrb r1, [r2, 0x9] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 1 + subs r6, r3, r0 + cmp r6, 0 + ble _08021A84 + lsrs r0, r6, 31 + adds r0, r6, r0 + asrs r0, 1 + adds r6, r0, 0 + adds r6, 0x10 + b _08021A86 +_08021A84: + movs r6, 0x10 +_08021A86: + movs r5, 0 + ldr r3, [sp, 0xC] + ldrb r3, [r3, 0x9] + cmp r5, r3 + bcc _08021A92 + b _08021D14 +_08021A92: + ldr r4, [sp, 0x10] + lsls r4, 2 + str r4, [sp, 0x24] +_08021A98: + bl sub_81AFBF0 + ldr r0, [sp, 0x10] + cmp r0, 0x1 + beq _08021B48 + cmp r0, 0x1 + bgt _08021AC0 + cmp r0, 0 + beq _08021ADE + ldr r4, [sp, 0x14] + subs r4, 0x4 + lsls r1, r6, 24 + mov r10, r1 + ldr r2, [sp, 0x1C] + adds r2, 0xA2 + mov r9, r2 + ldr r3, [sp, 0x18] + lsls r3, 5 + mov r8, r3 + b _08021C5A +_08021AC0: + ldr r4, [sp, 0x10] + cmp r4, 0x2 + bne _08021AC8 + b _08021C1C +_08021AC8: + ldr r4, [sp, 0x14] + subs r4, 0x4 + lsls r0, r6, 24 + mov r10, r0 + ldr r1, [sp, 0x1C] + adds r1, 0xA2 + mov r9, r1 + ldr r2, [sp, 0x18] + lsls r2, 5 + mov r8, r2 + b _08021C5A +_08021ADE: + ldr r0, [sp, 0x20] + adds r0, 0x20 + adds r0, r5 + ldrb r0, [r0] + str r0, [sp, 0x18] + lsls r3, r5, 1 + ldr r2, [sp, 0x20] + adds r2, 0xC + cmp r5, 0 + beq _08021B04 + adds r0, r2, r3 + subs r1, r5, 0x1 + lsls r1, 1 + adds r1, r2, r1 + ldrh r0, [r0] + ldrh r1, [r1] + cmp r0, r1 + beq _08021B04 + str r5, [sp, 0x1C] +_08021B04: + ldr r4, [sp, 0x24] + ldr r1, [sp, 0x10] + adds r0, r4, r1 + lsls r0, 1 + adds r0, r3, r0 + adds r0, r2, r0 + ldrh r1, [r0] + ldr r0, =0x02021fc4 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalString + ldr r0, =gUnknown_082F43B4 + adds r0, r4, r0 + ldr r1, [r0] + ldr r0, =0x02021fc4 + bl AppendString + ldr r4, [sp, 0x14] + subs r4, 0x4 + lsls r2, r6, 24 + mov r10, r2 + ldr r3, [sp, 0x1C] + adds r3, 0xA2 + mov r9, r3 + ldr r0, [sp, 0x18] + lsls r0, 5 + mov r8, r0 + b _08021C5A + .pool +_08021B48: + ldr r1, [sp, 0x20] + adds r0, r1, r5 + adds r0, 0x28 + ldrb r0, [r0] + str r0, [sp, 0x18] + lsls r3, r5, 1 + adds r2, r1, 0 + adds r2, 0xC + cmp r5, 0 + beq _08021B72 + adds r0, r3, 0 + adds r0, 0xA + adds r0, r2, r0 + adds r1, r3, 0 + adds r1, 0x8 + adds r1, r2, r1 + ldrh r0, [r0] + ldrh r1, [r1] + cmp r0, r1 + beq _08021B72 + str r5, [sp, 0x1C] +_08021B72: + ldr r0, [sp, 0x24] + ldr r1, [sp, 0x10] + adds r4, r0, r1 + lsls r4, 1 + adds r4, r3, r4 + adds r4, r2, r4 + ldrh r1, [r4] + lsrs r1, 4 + ldr r0, =0x02021cc4 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + movs r7, 0 + ldrb r0, [r4] + movs r3, 0xF + ands r3, r0 + movs r2, 0 + ldr r4, [sp, 0x10] + lsls r4, 2 + str r4, [sp, 0x28] + ldr r4, [sp, 0x14] + subs r4, 0x4 + lsls r0, r6, 24 + mov r10, r0 + ldr r1, [sp, 0x1C] + adds r1, 0xA2 + mov r9, r1 + ldr r0, [sp, 0x18] + lsls r0, 5 + mov r8, r0 + adds r6, 0xE + adds r5, 0x1 + ldr r1, =gUnknown_082F334C + mov r12, r1 +_08021BB8: + movs r0, 0x3 + subs r1, r0, r2 + adds r0, r3, 0 + asrs r0, r1 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08021BD0 + lsls r0, r2, 2 + add r0, r12 + ldr r0, [r0] + adds r7, r0 +_08021BD0: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _08021BB8 + adds r0, r7, 0 + ldr r1, =0x000f4240 + bl __udivsi3 + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, =0x02021dc4 + adds r1, r3, 0 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r0, =gUnknown_082F43B4 + ldr r2, [sp, 0x28] + adds r0, r2, r0 + ldr r1, [r0] + ldr r0, =0x02021fc4 + bl ExpandStringRefs + b _08021C5E + .pool +_08021C1C: + str r5, [sp, 0x18] + str r5, [sp, 0x1C] + lsls r7, r5, 5 + ldr r3, [sp, 0xC] + adds r0, r3, r7 + adds r0, 0xA4 + ldrb r2, [r0] + cmp r2, 0x2B + bls _08021C30 + movs r2, 0 +_08021C30: + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + ldr r0, =gBerries + adds r1, r0 + ldr r0, =0x02021cc4 + bl CopyString + ldr r0, =gUnknown_082F43B4 + ldr r1, [r0, 0x8] + ldr r0, =0x02021fc4 + bl ExpandStringRefs + ldr r4, [sp, 0x14] + subs r4, 0x4 + lsls r0, r6, 24 + mov r10, r0 + movs r1, 0xA2 + adds r1, r5 + mov r9, r1 + mov r8, r7 +_08021C5A: + adds r6, 0xE + adds r5, 0x1 +_08021C5E: + movs r0, 0x2 + ldr r1, =0x02021fc4 + adds r2, r4, 0 + bl GetStringRightAlignXOffset + adds r2, r0, 0 + ldr r3, [sp, 0xC] + movs r4, 0xDD + lsls r4, 1 + adds r0, r3, r4 + ldrb r0, [r0] + lsls r2, 24 + lsrs r2, 24 + mov r1, r10 + lsrs r3, r1, 24 + ldr r1, =gUnknown_082F32D8 + str r1, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r1, =0x02021fc4 + str r1, [sp, 0x8] + movs r1, 0x2 + bl box_print + ldr r3, [sp, 0x18] + ldr r2, [sp, 0xC] + ldrb r2, [r2, 0x8] + cmp r3, r2 + bne _08021CC0 + ldr r0, =0x02021ec4 + ldr r1, =gUnknown_085ED7D4 + bl CopyString + b _08021CC8 + .pool +_08021CC0: + ldr r0, =0x02021ec4 + ldr r1, =gUnknown_085ED7E0 + bl CopyString +_08021CC8: + ldr r4, =0x02021ec4 + mov r3, r9 + strb r3, [r4] + mov r1, r8 + adds r1, 0x98 + ldr r0, [sp, 0xC] + adds r1, r0, r1 + movs r0, 0 + bl sub_81AFC0C + ldr r0, =0x02021fc4 + adds r1, r4, 0 + bl sub_81AFC28 + ldr r1, [sp, 0xC] + movs r2, 0xDD + lsls r2, 1 + adds r0, r1, r2 + ldrb r0, [r0] + mov r4, r10 + lsrs r3, r4, 24 + ldr r1, =gUnknown_082F32D8 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + ldr r2, =0x02021fc4 + str r2, [sp, 0x8] + movs r1, 0x2 + movs r2, 0x4 + bl box_print + lsls r0, r5, 24 + lsrs r5, r0, 24 + ldr r3, [sp, 0xC] + ldrb r3, [r3, 0x9] + cmp r5, r3 + bcs _08021D14 + b _08021A98 +_08021D14: + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8021A28 + + thumb_func_start sub_8021D34 +sub_8021D34: @ 8021D34 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + mov r8, r0 + movs r0, 0 + mov r10, r0 + movs r6, 0 + movs r1, 0 + str r1, [sp, 0xC] + mov r2, r8 + adds r2, 0x68 + str r2, [sp, 0x10] + movs r4, 0xDD + lsls r4, 1 + add r4, r8 + mov r9, r4 + ldrb r0, [r4] + movs r1, 0x4 + bl GetWindowAttribute + lsls r0, 27 + movs r1, 0xD6 + lsls r1, 24 + adds r0, r1 + lsrs r7, r0, 24 + movs r0, 0x9C + lsls r0, 1 + add r0, r8 + ldr r2, [sp, 0x10] + ldrh r1, [r2, 0x4] + bl sub_8021944 + ldrb r0, [r4] + ldr r4, =gUnknown_082F32D8 + str r4, [sp] + str r6, [sp, 0x4] + ldr r1, =gUnknown_085ED808 + str r1, [sp, 0x8] + movs r1, 0x2 + movs r2, 0 + adds r3, r7, 0 + bl box_print + ldr r4, =gUnknown_085ED840 + movs r0, 0x2 + adds r1, r4, 0 + movs r2, 0x1 + negs r2, r2 + bl GetStringWidth + movs r1, 0xB0 + subs r0, r1, r0 + lsls r0, 24 + lsrs r6, r0, 24 + mov r2, r9 + ldrb r0, [r2] + ldr r1, =gUnknown_082F32D8 + str r1, [sp] + mov r2, r10 + str r2, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x2 + adds r2, r6, 0 + adds r3, r7, 0 + bl box_print + movs r0, 0x9F + lsls r0, 1 + add r0, r8 + movs r4, 0 + ldrsh r1, [r0, r4] + ldr r0, =0x02021cc4 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r0, =0x02021dc4 + movs r1, 0xA0 + lsls r1, 1 + add r1, r8 + movs r2, 0 + ldrsh r1, [r1, r2] + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r5, =0x02021fc4 + ldr r1, =gUnknown_085ED838 + adds r0, r5, 0 + bl ExpandStringRefs + movs r0, 0x2 + adds r1, r5, 0 + movs r2, 0x1 + negs r2, r2 + bl GetStringWidth + subs r0, r6, r0 + lsls r0, 24 + lsrs r6, r0, 24 + mov r4, r9 + ldrb r0, [r4] + ldr r1, =gUnknown_082F32D8 + str r1, [sp] + mov r2, r10 + str r2, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x2 + adds r2, r6, 0 + adds r3, r7, 0 + bl box_print + ldr r4, =gUnknown_085ED830 + movs r0, 0x2 + adds r1, r4, 0 + movs r2, 0x1 + negs r2, r2 + bl GetStringWidth + subs r0, r6, r0 + lsls r0, 24 + lsrs r6, r0, 24 + mov r1, r9 + ldrb r0, [r1] + ldr r2, =gUnknown_082F32D8 + str r2, [sp] + mov r1, r10 + str r1, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x2 + adds r2, r6, 0 + adds r3, r7, 0 + bl box_print + movs r0, 0x9E + lsls r0, 1 + add r0, r8 + movs r2, 0 + ldrsh r1, [r0, r2] + ldr r0, =0x02021cc4 + movs r2, 0x2 + movs r3, 0x1 + bl ConvertIntToDecimalString + ldr r1, =gUnknown_085ED82C + adds r0, r5, 0 + bl ExpandStringRefs + movs r0, 0x2 + adds r1, r5, 0 + movs r2, 0x1 + negs r2, r2 + bl GetStringWidth + subs r0, r6, r0 + lsls r0, 24 + lsrs r6, r0, 24 + mov r4, r9 + ldrb r0, [r4] + ldr r1, =gUnknown_082F32D8 + str r1, [sp] + mov r2, r10 + str r2, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x2 + adds r2, r6, 0 + adds r3, r7, 0 + bl box_print + adds r0, r7, 0 + adds r0, 0xE + lsls r0, 24 + lsrs r7, r0, 24 + ldrb r0, [r4] + ldr r4, =gUnknown_082F32D8 + str r4, [sp] + mov r1, r10 + str r1, [sp, 0x4] + ldr r1, =gUnknown_085ED810 + str r1, [sp, 0x8] + movs r1, 0x2 + movs r2, 0 + adds r3, r7, 0 + bl box_print + ldr r4, =gUnknown_085ED850 + movs r0, 0x2 + adds r1, r4, 0 + movs r2, 0x1 + negs r2, r2 + bl GetStringWidth + movs r2, 0xB0 + subs r0, r2, r0 + lsls r0, 24 + str r0, [sp, 0x18] + lsrs r6, r0, 24 + mov r1, r9 + ldrb r0, [r1] + ldr r2, =gUnknown_082F32D8 + str r2, [sp] + mov r1, r10 + str r1, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x2 + adds r2, r6, 0 + adds r3, r7, 0 + bl box_print + mov r4, r8 + ldrb r2, [r4, 0x16] + ldrh r0, [r4, 0x16] + mov r12, r0 + movs r1, 0x7 + mov r9, r1 + movs r5, 0x1 + ldr r3, =gUnknown_082F334C +_08021EEC: + mov r4, r9 + mov r0, r10 + subs r1, r4, r0 + adds r0, r2, 0 + asrs r0, r1 + ands r0, r5 + cmp r0, 0 + beq _08021F0A + mov r1, r10 + lsls r0, r1, 2 + adds r0, r3 + ldr r0, [r0] + ldr r4, [sp, 0xC] + adds r4, r0 + str r4, [sp, 0xC] +_08021F0A: + mov r0, r10 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + cmp r0, 0x7 + bls _08021EEC + ldr r0, =0x02021cc4 + mov r2, r12 + lsrs r1, r2, 8 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r4, =0x02021dc4 + ldr r1, =0x000f4240 + ldr r0, [sp, 0xC] + bl __udivsi3 + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085ED848 + adds r0, r4, 0 + bl ExpandStringRefs + movs r2, 0x1 + negs r2, r2 + movs r0, 0x2 + adds r1, r4, 0 + bl GetStringWidth + subs r0, r6, r0 + lsls r0, 24 + lsrs r6, r0, 24 + mov r0, r8 + adds r0, 0x25 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _08021FC4 + movs r0, 0xDD + lsls r0, 1 + add r0, r8 + ldrb r0, [r0] + ldr r1, =gUnknown_082F32E7 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x2 + adds r2, r6, 0 + adds r3, r7, 0 + bl box_print + b _08021FDE + .pool +_08021FC4: + movs r0, 0xDD + lsls r0, 1 + add r0, r8 + ldrb r0, [r0] + ldr r1, =gUnknown_082F32D8 + str r1, [sp] + str r2, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x2 + adds r2, r6, 0 + adds r3, r7, 0 + bl box_print +_08021FDE: + adds r0, r7, 0 + adds r0, 0xE + lsls r0, 24 + lsrs r7, r0, 24 + movs r4, 0xDD + lsls r4, 1 + add r8, r4 + mov r1, r8 + ldrb r0, [r1] + ldr r2, =gUnknown_082F32D8 + mov r9, r2 + str r2, [sp] + movs r5, 0 + str r5, [sp, 0x4] + ldr r1, =gUnknown_085ED820 + str r1, [sp, 0x8] + movs r1, 0x2 + movs r2, 0 + adds r3, r7, 0 + bl box_print + ldr r0, =0x02021cc4 + ldr r4, [sp, 0x10] + ldrh r1, [r4, 0x8] + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085ED85C + adds r0, r4, 0 + bl ExpandStringRefs + movs r2, 0x1 + negs r2, r2 + movs r0, 0x2 + adds r1, r4, 0 + bl GetStringWidth + movs r1, 0xB0 + subs r1, r0 + lsls r1, 24 + lsrs r6, r1, 24 + mov r1, r8 + ldrb r0, [r1] + mov r2, r9 + str r2, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x2 + adds r2, r6, 0 + adds r3, r7, 0 + bl box_print + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8021D34 + + thumb_func_start sub_8022070 +sub_8022070: @ 8022070 + push {r4-r6,lr} + sub sp, 0x8 + adds r4, r0, 0 + adds r6, r1, 0 + adds r0, r6, 0 + adds r0, 0x80 + ldrb r0, [r0] + cmp r0, 0x5 + bls _08022084 + b _08022218 +_08022084: + lsls r0, 2 + ldr r1, =_08022094 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08022094: + .4byte _080220AC + .4byte _080220F8 + .4byte _0802210C + .4byte _08022130 + .4byte _080221F8 + .4byte _08022200 +_080220AC: + ldrb r0, [r4, 0x9] + subs r0, 0x2 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r6, 0 + bl sub_8022554 + ldrh r0, [r4, 0x12] + lsls r0, 3 + ldr r2, =gUnknown_082F32CC + mov r1, sp + adds r0, r2 + ldm r0!, {r2,r3} + stm r1!, {r2,r3} + ldrh r0, [r4, 0x12] + cmp r0, 0xD + bne _080220DC + ldr r0, =gUnknown_082F3344 + adds r0, 0x4 + b _080220DE + .pool +_080220DC: + ldr r0, =gUnknown_082F3344 +_080220DE: + adds r0, r5, r0 + ldrb r1, [r0] + mov r0, sp + strb r1, [r0, 0x4] + mov r0, sp + bl AddWindow + adds r1, r6, 0 + adds r1, 0x82 + strb r0, [r1] + b _08022218 + .pool +_080220F8: + adds r4, r6, 0 + adds r4, 0x82 + ldrb r0, [r4] + bl PutWindowTilemap + ldrb r0, [r4] + movs r1, 0 + bl FillWindowPixelBuffer + b _08022218 +_0802210C: + adds r5, r6, 0 + adds r5, 0x82 + ldrb r0, [r5] + ldr r4, =0x0000021d + adds r1, r4, 0 + movs r2, 0xD0 + bl box_border_load_tiles_and_pal + ldrb r0, [r5] + movs r1, 0 + adds r2, r4, 0 + movs r3, 0xD + bl SetWindowBorderStyle + b _08022218 + .pool +_08022130: + ldrb r0, [r4, 0x9] + subs r0, 0x2 + lsls r0, 24 + lsrs r5, r0, 24 + ldrh r0, [r4, 0x12] + cmp r0, 0xC + beq _08022184 + cmp r0, 0xC + bgt _08022148 + cmp r0, 0xB + beq _0802214E + b _08022218 +_08022148: + cmp r0, 0xD + beq _080221C8 + b _08022218 +_0802214E: + adds r0, r6, 0 + adds r0, 0x82 + ldrb r0, [r0] + ldr r3, =gUnknown_085ED860 + movs r1, 0x14 + movs r2, 0x3 + bl sub_80219C8 + ldr r0, =gUnknown_082F3344 + adds r0, r5, r0 + ldrb r3, [r0] + lsls r3, 27 + lsrs r3, 24 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0xA0 + bl sub_8021A28 + adds r1, r6, 0 + adds r1, 0x80 + movs r0, 0x5 + b _08022220 + .pool +_08022184: + adds r0, r6, 0 + adds r0, 0x82 + ldrb r0, [r0] + ldr r2, =gUnknown_082F43B4 + adds r1, r4, 0 + adds r1, 0x8F + ldrb r1, [r1] + adds r1, 0x3 + lsls r1, 2 + adds r1, r2 + ldr r3, [r1] + movs r1, 0x14 + movs r2, 0x4 + bl sub_80219C8 + ldr r0, =gUnknown_082F3344 + adds r0, r5, r0 + ldrb r3, [r0] + lsls r3, 27 + lsrs r3, 24 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0xA0 + bl sub_8021A28 + adds r1, r6, 0 + adds r1, 0x80 + movs r0, 0x5 + b _08022220 + .pool +_080221C8: + adds r0, r6, 0 + adds r0, 0x82 + ldrb r0, [r0] + ldr r3, =gUnknown_085ED878 + movs r1, 0x16 + movs r2, 0x3 + bl sub_80219C8 + ldr r0, =gUnknown_082F3344 + adds r0, 0x4 + adds r0, r5, r0 + ldrb r3, [r0] + lsls r3, 27 + lsrs r3, 24 + adds r0, r4, 0 + movs r1, 0x2 + movs r2, 0xB0 + bl sub_8021A28 + b _08022218 + .pool +_080221F8: + adds r0, r4, 0 + bl sub_8021D34 + b _08022218 +_08022200: + adds r0, r6, 0 + adds r0, 0x82 + ldrb r0, [r0] + movs r1, 0x3 + bl CopyWindowToVram + adds r1, r6, 0 + adds r1, 0x80 + movs r0, 0 + strb r0, [r1] + movs r0, 0x1 + b _08022224 +_08022218: + adds r1, r6, 0 + adds r1, 0x80 + ldrb r0, [r1] + adds r0, 0x1 +_08022220: + strb r0, [r1] + movs r0, 0 +_08022224: + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8022070 + + thumb_func_start sub_802222C +sub_802222C: @ 802222C + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0xDD + lsls r0, 1 + adds r5, r4, r0 + ldrb r0, [r5] + movs r1, 0x1 + bl sub_8198070 + ldrb r0, [r5] + bl RemoveWindow + adds r0, r4, 0 + bl sub_8022600 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_802222C + + thumb_func_start sub_8022250 +sub_8022250: @ 8022250 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0 + mov r9, r0 + movs r1, 0 + str r1, [sp, 0xC] + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r6, r0, r1 + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0x1 + beq _080222D0 + cmp r0, 0x1 + bgt _08022288 + cmp r0, 0 + beq _08022296 + b _080224BA + .pool +_08022288: + cmp r0, 0x2 + bne _0802228E + b _08022480 +_0802228E: + cmp r0, 0x3 + bne _08022294 + b _08022494 +_08022294: + b _080224BA +_08022296: + ldr r0, =gUnknown_082F32EC + bl AddWindow + strh r0, [r6, 0x2] + lsls r0, 24 + lsrs r0, 24 + bl PutWindowTilemap + ldrb r0, [r6, 0x2] + movs r1, 0 + bl FillWindowPixelBuffer + ldrb r0, [r6, 0x2] + ldr r4, =0x0000021d + adds r1, r4, 0 + movs r2, 0xD0 + bl box_border_load_tiles_and_pal + ldrb r0, [r6, 0x2] + movs r1, 0 + adds r2, r4, 0 + movs r3, 0xD + bl SetWindowBorderStyle + b _080224BA + .pool +_080222D0: + ldr r0, =gUnknown_085ED8D0 + mov r10, r0 + movs r1, 0x1 + negs r1, r1 + mov r8, r1 + movs r0, 0x1 + mov r1, r10 + mov r2, r8 + bl GetStringWidth + lsrs r0, 1 + movs r4, 0x60 + subs r0, r4, r0 + lsls r0, 24 + lsrs r7, r0, 24 + ldrb r0, [r6, 0x2] + ldr r5, =gUnknown_082F32E1 + str r5, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r10 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r7, 0 + movs r3, 0x1 + bl box_print + ldr r0, =gUnknown_085ED8DC + mov r10, r0 + movs r0, 0x1 + mov r1, r10 + mov r2, r8 + bl GetStringWidth + lsrs r0, 1 + subs r4, r0 + lsls r4, 24 + lsrs r7, r4, 24 + ldrb r0, [r6, 0x2] + str r5, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r10 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r7, 0 + movs r3, 0x11 + bl box_print + movs r0, 0x29 + mov r10, r0 +_08022336: + mov r1, r9 + adds r1, 0x2 + ldr r0, =0x02021cc4 + movs r2, 0 + movs r3, 0x1 + bl ConvertIntToDecimalString + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085ED8F4 + bl ExpandStringRefs + ldrb r0, [r6, 0x2] + ldr r1, =gUnknown_082F32D8 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + ldr r1, =0x02021fc4 + str r1, [sp, 0x8] + movs r1, 0x1 + movs r2, 0 + mov r3, r10 + bl box_print + movs r0, 0x1 + ldr r1, =gUnknown_085ED850 + movs r2, 0x1 + negs r2, r2 + bl GetStringWidth + movs r1, 0xC0 + subs r1, r0 + lsls r1, 24 + lsrs r7, r1, 24 + ldrb r0, [r6, 0x2] + ldr r1, =gUnknown_082F32D8 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + ldr r1, =gUnknown_085ED850 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r7, 0 + mov r3, r10 + bl box_print + movs r2, 0 + mov r0, r9 + lsls r4, r0, 1 + mov r1, r10 + adds r1, 0x10 + str r1, [sp, 0x10] + movs r0, 0x1 + add r9, r0 + adds r0, r4, r6 + ldrb r3, [r0, 0x4] + movs r1, 0x7 + mov r12, r1 + movs r0, 0x1 + mov r8, r0 + ldr r5, =gUnknown_082F334C +_080223AE: + mov r0, r12 + subs r1, r0, r2 + adds r0, r3, 0 + asrs r0, r1 + mov r1, r8 + ands r0, r1 + cmp r0, 0 + beq _080223CA + lsls r0, r2, 2 + adds r0, r5 + ldr r0, [r0] + ldr r1, [sp, 0xC] + adds r1, r0 + str r1, [sp, 0xC] +_080223CA: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x7 + bls _080223AE + adds r0, r4, r6 + ldrh r1, [r0, 0x4] + lsrs r1, 8 + ldr r0, =0x02021cc4 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r0, [sp, 0xC] + ldr r1, =0x000f4240 + bl __udivsi3 + adds r1, r0, 0 + ldr r0, =0x02021dc4 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085ED848 + bl ExpandStringRefs + movs r0, 0x1 + ldr r1, =0x02021fc4 + movs r2, 0x1 + negs r2, r2 + bl GetStringWidth + subs r0, r7, r0 + lsls r0, 24 + lsrs r7, r0, 24 + ldrb r0, [r6, 0x2] + ldr r1, =gUnknown_082F32D8 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + ldr r1, =0x02021fc4 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r7, 0 + mov r3, r10 + bl box_print + ldr r1, [sp, 0x10] + lsls r0, r1, 24 + lsrs r0, 24 + mov r10, r0 + movs r0, 0 + str r0, [sp, 0xC] + mov r1, r9 + lsls r0, r1, 24 + lsrs r0, 24 + mov r9, r0 + cmp r0, 0x3 + bhi _08022444 + b _08022336 +_08022444: + ldrb r0, [r6, 0x2] + movs r1, 0x3 + bl CopyWindowToVram + b _080224BA + .pool +_08022480: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _080224BA + b _080224C0 + .pool +_08022494: + ldrb r0, [r6, 0x2] + movs r1, 0x1 + bl sub_8198070 + ldrb r0, [r6, 0x2] + bl ClearWindowTilemap + ldrb r0, [r6, 0x2] + bl RemoveWindow + adds r0, r4, 0 + bl remove_task + bl script_env_2_enable_and_set_ctx_running + bl script_env_2_disable + mov r0, r9 + b _080224BE +_080224BA: + ldrh r0, [r6] + adds r0, 0x1 +_080224BE: + strh r0, [r6] +_080224C0: + 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_8022250 + + thumb_func_start sub_80224D0 +sub_80224D0: @ 80224D0 + push {lr} + bl script_env_2_enable + ldr r0, =sub_8022250 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, =0x03005d90 + ldr r2, [r0] + movs r3, 0xF6 + lsls r3, 1 + adds r0, r2, r3 + ldrh r0, [r0] + strh r0, [r1, 0xC] + adds r3, 0x2 + adds r0, r2, r3 + ldrh r0, [r0] + strh r0, [r1, 0xE] + adds r3, 0x2 + adds r0, r2, r3 + ldrh r0, [r0] + strh r0, [r1, 0x10] + adds r3, 0x2 + adds r0, r2, r3 + ldrh r0, [r0] + strh r0, [r1, 0x12] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80224D0 + + thumb_func_start sub_8022524 +sub_8022524: @ 8022524 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r1, 16 + bl sub_8021944 + movs r0, 0x4 + ldrsh r1, [r4, r0] + movs r0, 0 + bl sub_8035044 + movs r0, 0x6 + ldrsh r1, [r4, r0] + movs r0, 0x1 + bl sub_8035044 + movs r0, 0x8 + ldrsh r1, [r4, r0] + movs r0, 0x2 + bl sub_8035044 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8022524 + + thumb_func_start sub_8022554 +sub_8022554: @ 8022554 + push {lr} + ldr r2, [r0, 0x78] + adds r2, 0x3E + ldrb r1, [r2] + movs r3, 0x4 + orrs r1, r3 + strb r1, [r2] + ldr r1, [r0, 0x7C] + adds r1, 0x3E + ldrb r0, [r1] + orrs r0, r3 + strb r0, [r1] + movs r0, 0x2 + movs r1, 0x1 + bl sub_803547C + movs r0, 0x1 + movs r1, 0x1 + bl sub_803547C + movs r0, 0 + movs r1, 0x1 + bl sub_803547C + pop {r0} + bx r0 + thumb_func_end sub_8022554 + + thumb_func_start sub_8022588 +sub_8022588: @ 8022588 + push {r4-r7,lr} + adds r5, r0, 0 + movs r6, 0 + ldrb r0, [r5, 0x9] + cmp r6, r0 + bcs _080225E8 + ldr r7, =gUnknown_082F417C +_08022596: + lsls r0, r6, 2 + movs r1, 0xA2 + lsls r1, 1 + adds r2, r5, r1 + adds r2, r0 + ldrb r1, [r5, 0x9] + subs r1, 0x2 + lsls r0, r1, 2 + adds r0, r1 + adds r0, r6, r0 + adds r0, r7 + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_082F4190 + adds r0, r1 + str r0, [r2] + ldrb r0, [r0] + lsls r0, 3 + ldr r1, =gUnknown_082F32F4 + adds r0, r1 + bl AddWindow + ldr r1, =0x000001bb + adds r4, r5, r1 + adds r4, r6 + strb r0, [r4] + ldrb r0, [r4] + bl PutWindowTilemap + ldrb r0, [r4] + movs r1, 0 + bl FillWindowPixelBuffer + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r0, [r5, 0x9] + cmp r6, r0 + bcc _08022596 +_080225E8: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8022588 + + thumb_func_start sub_8022600 +sub_8022600: @ 8022600 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + adds r6, r0, 0 + movs r7, 0 + ldrb r0, [r6, 0x9] + cmp r7, r0 + bcs _080226B6 + movs r1, 0 + mov r8, r1 +_08022616: + ldr r1, =0x000001bb + adds r0, r6, r1 + adds r5, r0, r7 + ldrb r0, [r5] + bl PutWindowTilemap + ldrb r0, [r6, 0x8] + cmp r7, r0 + bne _08022668 + lsls r4, r7, 5 + adds r4, 0x98 + adds r4, r6, r4 + movs r0, 0x2 + adds r1, r4, 0 + movs r2, 0 + bl GetStringWidth + lsrs r0, 1 + movs r2, 0x24 + subs r2, r0 + lsls r2, 24 + lsrs r2, 24 + ldrb r0, [r5] + mov r1, r8 + str r1, [sp] + str r1, [sp, 0x4] + ldr r1, =gUnknown_082F32DB + str r1, [sp, 0x8] + mov r1, r8 + str r1, [sp, 0xC] + str r4, [sp, 0x10] + movs r1, 0x2 + movs r3, 0x1 + bl AddTextPrinterParametrized2 + b _0802269C + .pool +_08022668: + lsls r4, r7, 5 + adds r4, 0x98 + adds r4, r6, r4 + movs r0, 0x2 + adds r1, r4, 0 + movs r2, 0 + bl GetStringWidth + lsrs r0, 1 + movs r2, 0x24 + subs r2, r0 + lsls r2, 24 + lsrs r2, 24 + ldrb r0, [r5] + mov r1, r8 + str r1, [sp] + str r1, [sp, 0x4] + ldr r1, =gUnknown_082F32DE + str r1, [sp, 0x8] + mov r1, r8 + str r1, [sp, 0xC] + str r4, [sp, 0x10] + movs r1, 0x2 + movs r3, 0x1 + bl AddTextPrinterParametrized2 +_0802269C: + ldr r1, =0x000001bb + adds r0, r6, r1 + adds r0, r7 + ldrb r0, [r0] + movs r1, 0x3 + bl CopyWindowToVram + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + ldrb r0, [r6, 0x9] + cmp r7, r0 + bcc _08022616 +_080226B6: + movs r0, 0 + bl CopyBgTilemapBufferToVram + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8022600 + + thumb_func_start sub_80226D0 +sub_80226D0: @ 80226D0 + push {r4-r6,lr} + sub sp, 0x8 + adds r6, r0, 0 + movs r5, 0 + ldr r0, =gUnknown_08DE3FD4 + ldr r4, =0x0201c000 + adds r1, r4, 0 + bl LZ77UnCompWram + b _0802271A + .pool +_080226EC: + lsls r1, r5, 2 + movs r2, 0xA2 + lsls r2, 1 + adds r0, r6, r2 + adds r0, r1 + ldr r3, [r0] + ldrb r0, [r3] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4, r1 + ldrb r2, [r3, 0x1] + ldrb r3, [r3, 0x2] + movs r0, 0xA + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x3 + bl CopyToBgTilemapBufferRect + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_0802271A: + ldrb r0, [r6, 0x9] + cmp r5, r0 + bcc _080226EC + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80226D0 + + thumb_func_start sub_8022730 +sub_8022730: @ 8022730 + push {r4-r7,lr} + adds r6, r0, 0 + movs r5, 0 + ldr r0, =0x0000ff98 + strh r0, [r6, 0x2A] + strh r5, [r6, 0x2C] + ldr r1, =0x02021bbc + strh r5, [r1] + ldr r1, =0x02021bbe + strh r0, [r1] + ldr r4, =gUnknown_082F41F4 +_08022746: + lsls r0, r5, 3 + adds r0, r4 + bl LoadCompressedObjectPic + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _08022746 + ldr r0, =gUnknown_082F421C + bl LoadTaggedObjectPalettes + ldr r0, =gUnknown_082F430C + movs r1, 0x78 + movs r2, 0x58 + movs r3, 0x5 + bl AddObjectToFront + lsls r0, 24 + lsrs r2, r0, 24 + movs r0, 0xAC + lsls r0, 1 + adds r3, r6, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + str r0, [r3] + ldrb r1, [r0, 0x5] + movs r2, 0xC + orrs r1, r2 + strb r1, [r0, 0x5] + ldr r1, [r3] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x2 + orrs r0, r2 + strb r0, [r1] + ldr r1, [r3] + adds r1, 0x2C + ldrb r0, [r1] + movs r2, 0x40 + orrs r0, r2 + strb r0, [r1] + movs r5, 0 + ldrb r1, [r6, 0x9] + cmp r5, r1 + bcs _08022822 + movs r7, 0x4 +_080227AA: + lsls r4, r5, 2 + movs r3, 0xA2 + lsls r3, 1 + adds r0, r6, r3 + adds r0, r4 + ldr r0, [r0] + ldrh r1, [r0, 0x4] + adds r1, 0x78 + lsls r1, 16 + asrs r1, 16 + ldrh r2, [r0, 0x6] + adds r2, 0x20 + lsls r2, 16 + asrs r2, 16 + ldr r0, =gUnknown_082F4324 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r2, r0, 24 + movs r0, 0xAE + lsls r0, 1 + adds r3, r6, r0 + adds r3, r4 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + str r1, [r3] + ldrb r0, [r1, 0x5] + movs r4, 0xD + negs r4, r4 + adds r2, r4, 0 + ands r0, r2 + orrs r0, r7 + strb r0, [r1, 0x5] + ldr r1, [r3] + adds r1, 0x3E + ldrb r0, [r1] + orrs r0, r7 + strb r0, [r1] + ldr r2, [r3] + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2] + ldr r2, [r3] + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldrb r0, [r6, 0x9] + cmp r5, r0 + bcc _080227AA +_08022822: + movs r5, 0 + ldr r4, =gUnknown_082F41D2 + adds r7, r4, 0x1 +_08022828: + lsls r2, r5, 1 + adds r0, r2, r4 + movs r1, 0 + ldrsb r1, [r0, r1] + adds r1, 0x78 + adds r2, r7 + ldrb r2, [r2] + lsls r2, 24 + asrs r2, 24 + adds r2, 0x88 + ldr r0, =gUnknown_082F433C + movs r3, 0x6 + bl AddObjectToFront + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r5, 2 + movs r1, 0xC2 + lsls r1, 1 + adds r3, r6, r1 + adds r3, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + str r0, [r3] + ldrb r1, [r0, 0x5] + movs r2, 0xC + orrs r1, r2 + strb r1, [r0, 0x5] + ldr r2, [r3] + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r2, [r3] + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + ldr r0, [r3] + strh r5, [r0, 0x2E] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0xA + bls _08022828 + movs r5, 0 +_0802288E: + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 19 + movs r3, 0xB0 + lsls r3, 16 + adds r1, r3 + asrs r1, 16 + ldr r0, =gUnknown_082F4354 + movs r2, 0x8 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r5, 2 + movs r4, 0xD8 + lsls r4, 1 + adds r3, r6, r4 + adds r3, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + str r0, [r3] + ldrb r1, [r0, 0x5] + movs r4, 0xD + negs r4, r4 + adds r2, r4, 0 + ands r1, r2 + strb r1, [r0, 0x5] + ldr r2, [r3] + adds r2, 0x3E + ldrb r0, [r2] + adds r4, 0x8 + adds r1, r4, 0 + ands r0, r1 + strb r0, [r2] + ldr r2, [r3] + adds r2, 0x2C + ldrb r0, [r2] + movs r3, 0x41 + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 + strb r0, [r2] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bls _0802288E + ldr r4, =gUnknown_082F4384 + movs r0, 0 + movs r1, 0 + adds r2, r4, 0 + bl sub_8034D14 + adds r2, r4, 0 + adds r2, 0x10 + movs r0, 0x1 + movs r1, 0 + bl sub_8034D14 + adds r4, 0x20 + movs r0, 0x2 + movs r1, 0 + adds r2, r4, 0 + bl sub_8034D14 + ldrh r0, [r6, 0x12] + cmp r0, 0x1 + bne _08022928 + movs r4, 0x9C + lsls r4, 1 + adds r0, r6, r4 + bl sub_8022554 +_08022928: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8022730 + + thumb_func_start sub_8022960 +sub_8022960: @ 8022960 + push {r4-r6,lr} + adds r5, r0, 0 + movs r4, 0 + movs r0, 0x4 + bl FreeObjectTilesByTag + movs r0, 0x3 + bl FreeObjectTilesByTag + movs r0, 0x2 + bl FreeObjectTilesByTag + movs r0, 0x1 + bl FreeObjectTilesByTag + movs r0, 0x4 + bl FreeObjectPaletteByTag + movs r0, 0x2 + bl FreeObjectPaletteByTag + movs r0, 0x1 + bl FreeObjectPaletteByTag + movs r0, 0xD8 + lsls r0, 1 + adds r6, r5, r0 +_08022996: + lsls r0, r4, 2 + adds r0, r6, r0 + ldr r0, [r0] + bl RemoveObjectAndFreeTiles + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _08022996 + movs r0, 0x2 + bl sub_80353DC + movs r0, 0x1 + bl sub_80353DC + movs r0, 0 + bl sub_80353DC + movs r4, 0 + movs r1, 0xC2 + lsls r1, 1 + adds r6, r5, r1 +_080229C4: + lsls r0, r4, 2 + adds r0, r6, r0 + ldr r0, [r0] + bl RemoveObjectAndFreeTiles + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xA + bls _080229C4 + movs r4, 0 + ldrb r2, [r5, 0x9] + cmp r4, r2 + bcs _080229FC +_080229E0: + lsls r1, r4, 2 + movs r2, 0xAE + lsls r2, 1 + adds r0, r5, r2 + adds r0, r1 + ldr r0, [r0] + bl RemoveObjectAndFreeTiles + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldrb r0, [r5, 0x9] + cmp r4, r0 + bcc _080229E0 +_080229FC: + movs r1, 0xAC + lsls r1, 1 + adds r0, r5, r1 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08022A18 + adds r0, r2, 0 + bl RemoveObjectAndFreeTiles +_08022A18: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8022960 + + thumb_func_start sub_8022A20 +sub_8022A20: @ 8022A20 + push {lr} + adds r3, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08022A46 + adds r2, r3, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + subs r2, 0x12 + ldrb r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] +_08022A46: + pop {r0} + bx r0 + thumb_func_end sub_8022A20 + + thumb_func_start sub_8022A4C +sub_8022A4C: @ 8022A4C + push {r4,r5,lr} + adds r3, r0, 0 + movs r1, 0 + ldr r5, =DummyObjectCallback + adds r2, r3, 0 + adds r2, 0x2E + movs r4, 0 +_08022A5A: + lsls r0, r1, 1 + adds r0, r2, r0 + strh r4, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x7 + bls _08022A5A + movs r0, 0 + strh r0, [r3, 0x24] + strh r0, [r3, 0x26] + adds r2, r3, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + subs r2, 0x12 + ldrb r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + str r5, [r3, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8022A4C + + thumb_func_start sub_8022A94 +sub_8022A94: @ 8022A94 + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r5, 0 + adds r4, 0x2E + ldrh r0, [r4, 0x4] + ldrh r1, [r4, 0x2] + adds r0, r1 + strh r0, [r4, 0x2] + lsls r0, 16 + asrs r0, 24 + ldrh r2, [r5, 0x26] + adds r0, r2 + strh r0, [r5, 0x26] + movs r1, 0xE + ldrsh r0, [r4, r1] + movs r6, 0x80 + lsls r6, 8 + ands r0, r6 + cmp r0, 0 + beq _08022AFA + ldrh r0, [r4, 0x6] + ldrh r2, [r5, 0x2E] + adds r0, r2 + strh r0, [r5, 0x2E] + ldrh r0, [r4, 0xA] + ldrh r1, [r4, 0x8] + adds r0, r1 + strh r0, [r4, 0x8] + lsls r0, 16 + asrs r0, 23 + movs r2, 0xC + ldrsh r1, [r4, r2] + bl sine + strh r0, [r5, 0x24] + movs r1, 0xE + ldrsh r0, [r4, r1] + ands r0, r6 + cmp r0, 0 + beq _08022AFA + ldrh r0, [r4, 0x8] + lsls r0, 16 + asrs r0, 23 + cmp r0, 0x7E + ble _08022AFA + movs r0, 0 + strh r0, [r5, 0x24] + ldrh r1, [r4, 0xE] + ldr r0, =0x00007fff + ands r0, r1 + strh r0, [r4, 0xE] +_08022AFA: + ldrh r0, [r4] + lsls r0, 16 + asrs r0, 23 + strh r0, [r5, 0x20] + movs r2, 0x22 + ldrsh r1, [r5, r2] + movs r2, 0x26 + ldrsh r0, [r5, r2] + adds r1, r0 + ldrh r2, [r4, 0xE] + ldr r0, =0x00007fff + ands r0, r2 + cmp r1, r0 + ble _08022B1A + ldr r0, =sub_8022A4C + str r0, [r5, 0x1C] +_08022B1A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8022A94 + + thumb_func_start sub_8022B28 +sub_8022B28: @ 8022B28 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + adds r7, r6, 0 + adds r7, 0x2E + movs r0, 0 + mov r8, r0 + movs r2, 0xA0 + lsls r2, 2 + strh r2, [r7, 0x2] + movs r0, 0x20 + strh r0, [r7, 0x4] + movs r1, 0xA8 + strh r1, [r7, 0xE] + movs r0, 0x24 + ldrsh r4, [r6, r0] + lsls r4, 23 + lsrs r4, 16 + ldrh r0, [r6, 0x22] + subs r1, r0 + lsls r1, 23 + asrs r1, 16 + adds r2, 0x20 + asrs r2, 1 + movs r0, 0x7 + bl sub_81515D4 + adds r5, r0, 0 + ldrh r0, [r6, 0x20] + lsls r0, 7 + strh r0, [r6, 0x2E] + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + movs r0, 0x7 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_81515D4 + strh r0, [r7, 0x6] + movs r0, 0x7 + adds r1, r5, 0 + movs r2, 0x55 + bl sub_8151550 + adds r2, r0, 0 + mov r1, r8 + strh r1, [r7, 0x8] + movs r1, 0xFE + lsls r1, 6 + lsls r2, 16 + asrs r2, 16 + movs r0, 0x7 + bl sub_81515D4 + strh r0, [r7, 0xA] + movs r2, 0x24 + ldrsh r0, [r6, r2] + cmp r0, 0 + bge _08022BA6 + adds r0, 0x3 +_08022BA6: + asrs r0, 2 + strh r0, [r7, 0xC] + ldrh r0, [r7, 0xE] + ldr r2, =0xffff8000 + adds r1, r2, 0 + orrs r0, r1 + strh r0, [r7, 0xE] + mov r0, r8 + strh r0, [r6, 0x26] + strh r0, [r6, 0x24] + ldr r0, =sub_8022A94 + str r0, [r6, 0x1C] + adds r2, r6, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r2, 0x12 + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8022B28 + + thumb_func_start sub_8022BEC +sub_8022BEC: @ 8022BEC + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r2, 0 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 24 + lsrs r4, r1, 24 + mov r8, r4 + bl sub_8020C00 + adds r6, r0, 0 + cmp r5, 0x19 + bls _08022C0A + movs r5, 0 +_08022C0A: + cmp r4, 0 + beq _08022C14 + cmp r4, 0x1 + beq _08022C40 + b _08022C4A +_08022C14: + cmp r5, 0 + beq _08022C28 + ldr r0, =gUnknown_082F43CC + lsls r1, r5, 2 + adds r1, r0 + ldr r2, [r1] + adds r0, r6, 0 + adds r1, r7, 0 + bl _call_via_r2 +_08022C28: + ldrb r0, [r6, 0xE] + cmp r0, 0x19 + bls _08022C32 + mov r0, r8 + strb r0, [r6, 0xE] +_08022C32: + ldr r0, =gUnknown_082F43CC + ldrb r1, [r6, 0xE] + lsls r1, 2 + b _08022C44 + .pool +_08022C40: + ldr r0, =gUnknown_082F43CC + lsls r1, r5, 2 +_08022C44: + adds r1, r0 + ldr r0, [r1] + str r0, [r6, 0x4] +_08022C4A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8022BEC + + thumb_func_start sub_8022C58 +sub_8022C58: @ 8022C58 + push {r4-r6,lr} + sub sp, 0x4 + adds r6, r0, 0 + ldrb r2, [r1] + ldrb r3, [r1, 0x1] + lsls r3, 8 + orrs r2, r3 + ldrb r3, [r1, 0x2] + lsls r3, 16 + orrs r2, r3 + ldrb r3, [r1, 0x3] + lsls r3, 24 + adds r0, r2, 0 + orrs r0, r3 + ldrb r2, [r1, 0x9] + strb r2, [r1] + ldrb r4, [r1, 0x8] + lsls r4, 8 + ldrb r2, [r1, 0x7] + orrs r4, r2 + ldr r5, =0x02037fd4 + ldrb r3, [r5, 0x8] + movs r2, 0x7F + ands r2, r3 + strb r2, [r5, 0x8] + movs r5, 0x4 + ldrsb r5, [r1, r5] + ldrb r2, [r1, 0x5] + ldrb r3, [r1, 0x6] + str r4, [sp] + adds r1, r5, 0 + bl pal_fade_maybe + bl fade_and_return_progress_probably + movs r0, 0x2 + strb r0, [r6, 0xE] + movs r0, 0 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8022C58 + + thumb_func_start sub_8022CB0 +sub_8022CB0: @ 8022CB0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0xC] + cmp r0, 0x1 + beq _08022CE4 + cmp r0, 0x1 + bgt _08022CC6 + cmp r0, 0 + beq _08022CD0 + b _08022D06 +_08022CC6: + cmp r0, 0x2 + beq _08022CEA + cmp r0, 0x3 + beq _08022CF6 + b _08022D06 +_08022CD0: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _08022D0C + ldrb r0, [r5] + cmp r0, 0 + bne _08022D06 + movs r0, 0x3 + b _08022D0A +_08022CE4: + bl sub_8010434 + b _08022D06 +_08022CEA: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _08022D06 + b _08022D0C +_08022CF6: + ldrb r0, [r4, 0xF] + movs r1, 0x1 + movs r2, 0 + bl sub_8022BEC + movs r0, 0 + strb r0, [r4, 0xC] + b _08022D0E +_08022D06: + ldrb r0, [r4, 0xC] + adds r0, 0x1 +_08022D0A: + strb r0, [r4, 0xC] +_08022D0C: + movs r0, 0 +_08022D0E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8022CB0 + + thumb_func_start sub_8022D14 +sub_8022D14: @ 8022D14 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + adds r7, r0, 0 + adds r5, r1, 0 + ldrb r4, [r5, 0x3] + lsls r4, 8 + ldrb r0, [r5, 0x2] + orrs r4, r0 + ldrb r6, [r7, 0xC] + cmp r6, 0x1 + beq _08022DC0 + cmp r6, 0x1 + bgt _08022D38 + cmp r6, 0 + beq _08022D42 + b _08022E08 +_08022D38: + cmp r6, 0x2 + beq _08022DD8 + cmp r6, 0x3 + beq _08022DE8 + b _08022E08 +_08022D42: + movs r0, 0 + movs r1, 0 + bl sub_81973C4 + ldrb r1, [r5, 0x1] + movs r0, 0x2 + mov r8, r0 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _08022D90 + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_082F32A4 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r4, 0 + bl ExpandStringRefs + ldrb r3, [r7, 0xB] + str r6, [sp] + mov r0, r8 + str r0, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl AddTextPrinterParametrized + b _08022DB2 + .pool +_08022D90: + ldr r1, =gUnknown_082F32A4 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r2, [r0] + ldrb r3, [r7, 0xB] + str r4, [sp] + mov r0, r8 + str r0, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0 + movs r1, 0x1 + bl AddTextPrinterParametrized +_08022DB2: + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + b _08022E08 + .pool +_08022DC0: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _08022E0E + cmp r4, 0 + bne _08022E08 + ldrb r0, [r7, 0xC] + adds r0, 0x1 + strb r0, [r7, 0xC] + b _08022E08 +_08022DD8: + ldr r0, =0x030022c0 + ldrh r0, [r0, 0x2E] + ands r4, r0 + cmp r4, 0 + bne _08022E08 + b _08022E0E + .pool +_08022DE8: + ldrb r1, [r5, 0x1] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08022DFA + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 +_08022DFA: + ldrb r0, [r7, 0xE] + movs r1, 0x1 + movs r2, 0 + bl sub_8022BEC + ldrb r0, [r5, 0x4] + b _08022E0C +_08022E08: + ldrb r0, [r7, 0xC] + adds r0, 0x1 +_08022E0C: + strb r0, [r7, 0xC] +_08022E0E: + movs r0, 0 + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8022D14 + + thumb_func_start sub_8022E1C +sub_8022E1C: @ 8022E1C + push {r4,lr} + adds r4, r0, 0 + bl sub_802104C + cmp r0, 0 + beq _08022E34 + ldrb r0, [r4, 0xE] + adds r2, r4, 0 + adds r2, 0x36 + movs r1, 0 + bl sub_8022BEC +_08022E34: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8022E1C + + thumb_func_start sub_8022E3C +sub_8022E3C: @ 8022E3C + push {r4,lr} + adds r4, r0, 0 + bl sub_802130C + cmp r0, 0 + beq _08022E54 + ldrb r0, [r4, 0xE] + adds r2, r4, 0 + adds r2, 0x36 + movs r1, 0 + bl sub_8022BEC +_08022E54: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8022E3C + + thumb_func_start sub_8022E5C +sub_8022E5C: @ 8022E5C + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0xC] + cmp r0, 0 + beq _08022E6C + cmp r0, 0x1 + beq _08022E72 + b _08022E9C +_08022E6C: + bl sub_8010434 + b _08022E9C +_08022E72: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08022EA2 + ldr r0, =0x000001e5 + bl current_map_music_set + movs r0, 0x7 + movs r1, 0x1 + movs r2, 0 + bl sub_8022BEC + movs r1, 0 + movs r0, 0x3 + strh r0, [r4, 0x12] + strb r1, [r4, 0xC] + b _08022EA2 + .pool +_08022E9C: + ldrb r0, [r4, 0xC] + adds r0, 0x1 + strb r0, [r4, 0xC] +_08022EA2: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8022E5C + + thumb_func_start sub_8022EAC +sub_8022EAC: @ 8022EAC + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0xC] + cmp r0, 0 + beq _08022EC2 + cmp r0, 0x1 + beq _08022EE8 + adds r0, 0x1 + b _08022EF8 +_08022EC2: + adds r0, r4, 0 + bl sub_8024578 + movs r0, 0x1 + str r0, [sp] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_8024644 + movs r0, 0x7 + strb r0, [r4, 0xE] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0 + bl sub_8022BEC + b _08022EFA +_08022EE8: + movs r0, 0x8 + strb r0, [r4, 0xE] + movs r0, 0x5 + movs r1, 0x1 + movs r2, 0 + bl sub_8022BEC + movs r0, 0x2 +_08022EF8: + strb r0, [r4, 0xC] +_08022EFA: + movs r0, 0 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8022EAC + + thumb_func_start sub_8022F04 +sub_8022F04: @ 8022F04 + push {lr} + movs r1, 0 + str r1, [r0, 0x4] + ldr r0, =sub_8020E1C + bl SetMainCallback2 + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8022F04 + + thumb_func_start sub_8022F1C +sub_8022F1C: @ 8022F1C + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r2, r1, 0 + ldrb r0, [r5, 0xC] + cmp r0, 0x5 + bls _08022F2C + b _08023060 +_08022F2C: + lsls r0, 2 + ldr r1, =_08022F3C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08022F3C: + .4byte _08022F54 + .4byte _08022F74 + .4byte _08022F7A + .4byte _08022FAA + .4byte _08022FBA + .4byte _08023044 +_08022F54: + movs r0, 0x1 + str r0, [sp] + adds r0, r2, 0 + movs r1, 0x1 + movs r2, 0 + movs r3, 0 + bl sub_8024644 + movs r0, 0x9 + strb r0, [r5, 0xE] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0 + bl sub_8022BEC + b _08023066 +_08022F74: + bl sub_8010434 + b _08023060 +_08022F7A: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08023066 + adds r4, r5, 0 + adds r4, 0x42 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0xC + bl memset + ldrb r0, [r5, 0x8] + lsls r0, 5 + adds r0, r5, r0 + adds r0, 0xA4 + ldrh r0, [r0] + strh r0, [r4] + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x2 + bl link_0800A448 + b _08023060 +_08022FAA: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08023066 + movs r0, 0 + strh r0, [r5, 0x10] + b _08023060 +_08022FBA: + bl sub_800A550 + ldr r2, =gUnknown_082F4448 + ldrb r4, [r5, 0x9] + subs r1, r4, 0x2 + adds r1, r2 + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bne _08023066 + movs r3, 0 + cmp r3, r4 + bcs _0802301E + ldr r7, =0x020223c4 + movs r6, 0 + ldr r4, =gUnknown_0858AB24 +_08022FDC: + lsls r0, r3, 5 + adds r0, r5, r0 + lsls r1, r3, 8 + adds r1, r7 + ldrh r1, [r1] + adds r2, r0, 0 + adds r2, 0xA4 + strh r1, [r2] + lsls r1, 16 + lsrs r1, 16 + cmp r1, 0xB0 + bls _08022FF6 + strh r6, [r2] +_08022FF6: + ldrh r1, [r2] + lsls r1, 2 + adds r1, r4 + ldrh r0, [r5, 0x18] + ldrb r1, [r1] + adds r0, r1 + strh r0, [r5, 0x18] + ldrh r0, [r2] + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x2] + ldr r0, [r5, 0x1C] + adds r0, r1 + str r0, [r5, 0x1C] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + ldrb r0, [r5, 0x9] + cmp r3, r0 + bcc _08022FDC +_0802301E: + movs r0, 0 + strh r0, [r5, 0x10] + bl sub_800A5B4 + movs r1, 0x18 + ldrsh r0, [r5, r1] + lsls r0, 8 + movs r1, 0x80 + lsls r1, 6 + bl sub_81515FC + str r0, [r5, 0x20] + b _08023060 + .pool +_08023044: + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + movs r0, 0xA + movs r1, 0x1 + movs r2, 0 + bl sub_8022BEC + movs r1, 0 + movs r0, 0x4 + strh r0, [r5, 0x12] + strb r1, [r5, 0xC] + b _08023066 +_08023060: + ldrb r0, [r5, 0xC] + adds r0, 0x1 + strb r0, [r5, 0xC] +_08023066: + movs r0, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8022F1C + + thumb_func_start sub_8023070 +sub_8023070: @ 8023070 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0xC] + cmp r0, 0x6 + bls _0802307C + b _080231A8 +_0802307C: + lsls r0, 2 + ldr r1, =_0802308C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0802308C: + .4byte _080230A8 + .4byte _080230BA + .4byte _080230E8 + .4byte _08023120 + .4byte _08023150 + .4byte _08023172 + .4byte _08023184 +_080230A8: + movs r0, 0x9C + lsls r0, 1 + adds r1, r4, r0 + adds r0, r4, 0 + bl sub_80214A8 + bl sub_8010434 + b _080231A8 +_080230BA: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080231AE + movs r2, 0x9C + lsls r2, 1 + adds r1, r4, r2 + movs r0, 0 + strb r0, [r1] + ldr r3, =0x00000139 + adds r1, r4, r3 + strb r0, [r1] + adds r2, 0x2 + adds r1, r4, r2 + strb r0, [r1] + adds r3, 0x2 + adds r1, r4, r3 + strb r0, [r1] + b _080231A8 + .pool +_080230E8: + movs r0, 0x9C + lsls r0, 1 + adds r3, r4, r0 + ldrb r0, [r3] + lsls r0, 2 + movs r2, 0xB8 + lsls r2, 1 + adds r1, r4, r2 + adds r0, r1, r0 + ldr r2, [r0] + ldr r0, =sub_8021608 + str r0, [r2, 0x1C] + ldrb r0, [r3] + lsls r0, 2 + adds r1, r0 + ldr r1, [r1] + adds r1, 0x2C + ldrb r2, [r1] + movs r0, 0x7F + ands r0, r2 + strb r0, [r1] + movs r0, 0x3D + bl audio_play + b _080231A8 + .pool +_08023120: + movs r3, 0x9C + lsls r3, 1 + adds r2, r4, r3 + ldrb r0, [r2] + lsls r0, 2 + adds r3, 0x38 + adds r1, r4, r3 + adds r3, r1, r0 + ldr r0, [r3] + ldr r1, [r0, 0x1C] + ldr r0, =sub_8021608 + cmp r1, r0 + beq _080231AE + movs r0, 0 + str r0, [r3] + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + bl sub_8010434 + b _080231A8 + .pool +_08023150: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080231AE + movs r0, 0x9C + lsls r0, 1 + adds r1, r4, r0 + ldrb r0, [r1] + ldrb r2, [r4, 0x9] + cmp r0, r2 + bcs _0802316C + movs r0, 0x2 + b _080231AC +_0802316C: + movs r0, 0 + strb r0, [r1] + b _080231A8 +_08023172: + movs r3, 0x9C + lsls r3, 1 + adds r1, r4, r3 + adds r0, r4, 0 + bl sub_80216A8 + bl sub_8010434 + b _080231A8 +_08023184: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080231AE + movs r0, 0x2B + bl audio_play + movs r0, 0xB + movs r1, 0x1 + movs r2, 0 + bl sub_8022BEC + movs r1, 0 + movs r0, 0x5 + strh r0, [r4, 0x12] + strb r1, [r4, 0xC] + b _080231AE +_080231A8: + ldrb r0, [r4, 0xC] + adds r0, 0x1 +_080231AC: + strb r0, [r4, 0xC] +_080231AE: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8023070 + + thumb_func_start sub_80231B8 +sub_80231B8: @ 80231B8 + push {r4-r7,lr} + adds r4, r0, 0 + ldrb r1, [r4, 0xC] + cmp r1, 0x1 + beq _0802321C + cmp r1, 0x1 + bgt _080231CC + cmp r1, 0 + beq _080231D6 + b _080232DC +_080231CC: + cmp r1, 0x2 + beq _0802329C + cmp r1, 0x3 + beq _080232BE + b _080232DC +_080231D6: + ldrh r0, [r4, 0x2A] + adds r0, 0x4 + strh r0, [r4, 0x2A] + lsls r0, 16 + cmp r0, 0 + bge _080231E4 + b _080232E2 +_080231E4: + strh r1, [r4, 0x2A] + ldr r0, =0x00000139 + adds r3, r4, r0 + movs r0, 0x4 + strb r0, [r3] + movs r2, 0x9C + lsls r2, 1 + adds r1, r4, r2 + movs r0, 0 + strb r0, [r1] + ldr r2, =gUnknown_082F326C + ldrb r1, [r3] + lsls r0, r1, 3 + subs r0, r1 + adds r0, r2 + ldrb r0, [r0] + movs r2, 0x9D + lsls r2, 1 + adds r1, r4, r2 + strb r0, [r1] + movs r0, 0xD6 + bl audio_play + b _080232DC + .pool +_0802321C: + ldr r7, =gUnknown_082F326C + movs r0, 0x9C + lsls r0, 1 + adds r6, r4, r0 + ldr r1, =0x00000139 + adds r5, r4, r1 + ldrb r1, [r5] + lsls r0, r1, 3 + subs r0, r1 + ldrb r2, [r6] + adds r0, r2 + adds r0, r7 + movs r1, 0 + ldrsb r1, [r0, r1] + strh r1, [r4, 0x2C] + negs r1, r1 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x12 + bl SetGpuReg + ldrh r1, [r4, 0x2C] + negs r1, r1 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x1A + bl SetGpuReg + ldrh r1, [r4, 0x2C] + negs r1, r1 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x1E + bl SetGpuReg + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] + movs r1, 0x9D + lsls r1, 1 + adds r2, r4, r1 + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r2] + cmp r0, r1 + bcc _080232E2 + ldrb r0, [r5] + cmp r0, 0 + beq _080232DC + subs r0, 0x1 + strb r0, [r5] + ldrb r1, [r5] + lsls r0, r1, 3 + subs r0, r1 + adds r0, r7 + ldrb r0, [r0] + strb r0, [r2] + movs r0, 0 + strb r0, [r6] + b _080232E2 + .pool +_0802329C: + movs r0, 0 + strh r0, [r4, 0x2C] + movs r0, 0x12 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1A + movs r1, 0 + bl SetGpuReg + movs r0, 0x1E + movs r1, 0 + bl SetGpuReg + bl sub_8010434 + b _080232DC +_080232BE: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080232E2 + movs r0, 0xC + movs r1, 0x1 + movs r2, 0 + bl sub_8022BEC + movs r1, 0 + movs r0, 0x6 + strh r0, [r4, 0x12] + strb r1, [r4, 0xC] + b _080232E2 +_080232DC: + ldrb r0, [r4, 0xC] + adds r0, 0x1 + strb r0, [r4, 0xC] +_080232E2: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80231B8 + + thumb_func_start sub_80232EC +sub_80232EC: @ 80232EC + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldrb r0, [r4, 0xC] + cmp r0, 0x1 + beq _0802330C + cmp r0, 0x1 + bgt _08023302 + cmp r0, 0 + beq _08023332 + b _0802338C +_08023302: + cmp r0, 0x2 + beq _0802332A + cmp r0, 0x3 + beq _08023338 + b _0802338C +_0802330C: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08023392 + movs r1, 0x80 + lsls r1, 5 + movs r0, 0 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0x78 + movs r3, 0x50 + bl sub_802EB24 + b _0802338C +_0802332A: + bl sub_802EB84 + cmp r0, 0 + bne _08023392 +_08023332: + bl sub_8010434 + b _0802338C +_08023338: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08023392 + movs r0, 0x9C + lsls r0, 1 + adds r1, r4, r0 + movs r0, 0 + strb r0, [r1] + ldr r2, =0x00000139 + adds r1, r4, r2 + strb r0, [r1] + adds r2, 0x1 + adds r1, r4, r2 + strb r0, [r1] + adds r2, 0x1 + adds r1, r4, r2 + strb r0, [r1] + strh r0, [r4, 0x10] + ldrb r0, [r4, 0x8] + cmp r0, 0 + bne _08023378 + movs r0, 0xD + movs r1, 0x1 + movs r2, 0 + bl sub_8022BEC + b _08023382 + .pool +_08023378: + movs r0, 0xE + movs r1, 0x1 + movs r2, 0 + bl sub_8022BEC +_08023382: + movs r1, 0 + movs r0, 0x7 + strh r0, [r4, 0x12] + strb r1, [r4, 0xC] + b _08023392 +_0802338C: + ldrb r0, [r4, 0xC] + adds r0, 0x1 + strb r0, [r4, 0xC] +_08023392: + movs r0, 0 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80232EC + + thumb_func_start sub_802339C +sub_802339C: @ 802339C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r4, r0, 0 + movs r0, 0 + mov r8, r0 + movs r2, 0 + adds r7, r2, 0 + ldrb r1, [r4, 0x9] + cmp r7, r1 + bcs _080234AA + movs r2, 0x5E + adds r2, r4 + mov r9, r2 + ldr r3, =gUnknown_082F325C + mov r10, r3 +_080233C0: + lsls r0, r7, 4 + ldr r1, =0x03003090 + adds r2, r0, r1 + ldrh r1, [r2] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + movs r3, 0xBC + lsls r3, 6 + cmp r0, r3 + bne _0802349E + ldrh r0, [r2, 0x2] + cmp r0, 0x2 + bne _0802349E + ldrb r1, [r2, 0x4] + movs r0, 0x4 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _08023496 + mov r0, r9 + ldrb r2, [r0] + lsrs r1, r2, 3 + mov r3, r10 + adds r0, r7, r3 + ldrb r0, [r0] + orrs r1, r0 + lsls r1, 3 + movs r0, 0x7 + ands r0, r2 + orrs r0, r1 + mov r1, r9 + strb r0, [r1] + lsls r2, r7, 5 + adds r3, r4, r2 + mov r12, r3 + mov r1, r12 + adds r1, 0xB5 + movs r0, 0x1 + strb r0, [r1] + subs r1, 0x7 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + subs r1, 0x8 + ldrh r0, [r4, 0x28] + ldrh r1, [r1] + subs r0, r1 + lsls r0, 16 + lsrs r3, r0, 16 + mov r5, r12 + adds r5, 0xAA + ldrh r1, [r5] + subs r0, r1, 0x1 + adds r6, r2, 0 + cmp r3, r0 + blt _08023468 + adds r0, r1, 0x1 + cmp r3, r0 + bgt _08023468 + mov r1, r12 + adds r1, 0xA8 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + strh r3, [r5] + mov r0, r12 + adds r0, 0xAC + ldrh r1, [r1] + ldrh r2, [r0] + cmp r1, r2 + bls _08023476 + strh r1, [r0] + b _08023476 + .pool +_08023468: + adds r0, r4, r6 + adds r2, r0, 0 + adds r2, 0xA8 + movs r1, 0 + strh r1, [r2] + adds r0, 0xAA + strh r3, [r0] +_08023476: + adds r1, r4, r6 + ldrh r0, [r4, 0x28] + adds r3, r1, 0 + adds r3, 0xA6 + movs r2, 0 + strh r0, [r3] + adds r1, 0xB4 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bls _0802349E + strb r2, [r1] + b _0802349E +_08023496: + lsls r0, r7, 5 + adds r0, r4, r0 + adds r0, 0xB5 + strb r1, [r0] +_0802349E: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + ldrb r3, [r4, 0x9] + cmp r7, r3 + bcc _080233C0 +_080234AA: + mov r0, r8 + cmp r0, 0x1 + bls _080234E0 + movs r7, 0 + ldrb r1, [r4, 0x9] + cmp r7, r1 + bcs _080234E0 + movs r3, 0x2 +_080234BA: + lsls r0, r7, 5 + adds r1, r4, r0 + adds r2, r1, 0 + adds r2, 0xB5 + ldrb r0, [r2] + cmp r0, 0 + beq _080234D4 + orrs r0, r3 + strb r0, [r2] + adds r1, 0xB0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_080234D4: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + ldrb r2, [r4, 0x9] + cmp r7, r2 + bcc _080234BA +_080234E0: + mov r3, r8 + cmp r3, 0 + beq _08023548 + ldrh r0, [r4, 0x2E] + add r0, r8 + strh r0, [r4, 0x2E] + ldr r1, =gUnknown_082F3264 + mov r0, r8 + subs r0, 0x1 + adds r0, r1 + ldrb r0, [r0] + add r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldrh r0, [r4, 0x34] + add r0, r8 + strh r0, [r4, 0x34] + ldrh r0, [r4, 0x1A] + add r0, r8 + strh r0, [r4, 0x1A] + movs r1, 0x18 + ldrsh r0, [r4, r1] + movs r3, 0x1A + ldrsh r2, [r4, r3] + subs r0, r2 + cmp r0, 0 + ble _08023534 + lsls r2, 8 + ldr r1, [r4, 0x20] + adds r0, r2, 0 + bl sub_81515FC + adds r2, r0, 0 + asrs r2, 8 + adds r0, r4, 0 + adds r0, 0x24 + strb r2, [r0] + b _08023548 + .pool +_08023534: + adds r1, r4, 0 + adds r1, 0x24 + movs r0, 0x20 + strb r0, [r1] + adds r2, r4, 0 + adds r2, 0x5E + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] +_08023548: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_802339C + + thumb_func_start sub_8023558 +sub_8023558: @ 8023558 + push {r4-r6,lr} + adds r3, r0, 0 + movs r6, 0 + movs r1, 0 + adds r4, r1, 0 + ldrb r0, [r3, 0x9] + cmp r4, r0 + bcs _080235B0 + adds r5, r3, 0 + adds r5, 0x64 +_0802356C: + lsls r0, r4, 5 + adds r1, r3, r0 + adds r0, r1, 0 + adds r0, 0xB5 + ldrb r2, [r0] + cmp r2, 0 + beq _080235A4 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r1, 0 + adds r0, 0xB4 + ldrb r0, [r0] + adds r1, r0, 0x1 + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + beq _08023594 + movs r0, 0x4 + orrs r1, r0 +_08023594: + lsls r0, r4, 1 + adds r0, r4 + lsls r1, r0 + lsls r0, r1, 16 + lsrs r1, r0, 16 + ldrh r0, [r5] + orrs r1, r0 + strh r1, [r5] +_080235A4: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldrb r1, [r3, 0x9] + cmp r4, r1 + bcc _0802356C +_080235B0: + adds r0, r3, 0 + adds r0, 0x24 + ldrb r1, [r0] + adds r0, 0x3C + strh r1, [r0] + cmp r6, 0 + bne _080235D4 + ldr r2, =0x0000013b + adds r0, r3, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080236A0 + movs r4, 0x9C + lsls r4, 1 + adds r1, r3, r4 + b _08023612 + .pool +_080235D4: + ldr r5, =0x0000013b + adds r2, r3, r5 + ldrb r0, [r2] + cmp r0, 0 + beq _0802361A + ldr r0, =0x00000139 + adds r1, r3, r0 + ldrb r2, [r1] + cmp r6, r2 + beq _0802360C + subs r0, r6, 0x1 + strb r0, [r1] + ldr r1, =gUnknown_082F3290 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0] + movs r4, 0x9D + lsls r4, 1 + adds r1, r3, r4 + strb r0, [r1] + b _08023640 + .pool +_0802360C: + movs r5, 0x9C + lsls r5, 1 + adds r1, r3, r5 +_08023612: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08023640 +_0802361A: + movs r0, 0x9C + lsls r0, 1 + adds r1, r3, r0 + movs r0, 0 + strb r0, [r1] + subs r0, r6, 0x1 + ldr r4, =0x00000139 + adds r1, r3, r4 + strb r0, [r1] + ldr r1, =gUnknown_082F3290 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0] + movs r5, 0x9D + lsls r5, 1 + adds r1, r3, r5 + strb r0, [r1] + movs r0, 0x1 + strb r0, [r2] +_08023640: + ldr r0, =0x0000013b + adds r4, r3, r0 + ldrb r0, [r4] + cmp r0, 0 + beq _080236A0 + movs r2, 0x9C + lsls r2, 1 + adds r1, r3, r2 + movs r5, 0x9D + lsls r5, 1 + adds r2, r3, r5 + ldrb r0, [r1] + ldrb r5, [r2] + cmp r0, r5 + bcc _0802367C + movs r0, 0 + strb r0, [r1] + ldr r5, =0x00000139 + adds r1, r3, r5 + strb r0, [r1] + strb r0, [r2] + strb r0, [r4] + movs r1, 0 + b _08023690 + .pool +_0802367C: + ldr r2, =gUnknown_082F3290 + ldrb r1, [r1] + ldr r4, =0x00000139 + adds r0, r3, r4 + ldrb r0, [r0] + lsls r0, 2 + adds r0, 0x1 + adds r1, r0 + adds r1, r2 + ldrb r1, [r1] +_08023690: + adds r0, r3, 0 + adds r0, 0x5F + strb r1, [r0] + b _080236A8 + .pool +_080236A0: + adds r1, r3, 0 + adds r1, 0x5F + movs r0, 0 + strb r0, [r1] +_080236A8: + ldrh r1, [r3, 0x26] + adds r0, r3, 0 + adds r0, 0x62 + strh r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8023558 + + thumb_func_start sub_80236B8 +sub_80236B8: @ 80236B8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + ldr r3, =0x030022c0 + ldrh r1, [r3, 0x2E] + movs r4, 0x1 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _080236DA + adds r2, r5, 0 + adds r2, 0x5E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_080236DA: + ldrh r1, [r3, 0x2C] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _080236FA + ldrb r0, [r5, 0x8] + lsls r0, 5 + adds r0, r5, r0 + adds r1, r0, 0 + adds r1, 0xB2 + ldrh r0, [r1] + ldrh r2, [r5, 0x28] + cmp r0, r2 + bcs _080236FA + adds r0, 0x1 + strh r0, [r1] +_080236FA: + ldrb r0, [r5, 0x8] + adds r7, r5, 0 + adds r7, 0x5E + cmp r0, 0 + beq _08023710 + ldrb r1, [r7] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _08023710 + b _0802384C +_08023710: + adds r4, r5, 0 + adds r4, 0x5C + movs r0, 0x2 + strh r0, [r4] + ldrh r0, [r5, 0x28] + movs r1, 0x1E + bl __umodsi3 + lsls r0, 16 + mov r8, r4 + adds r6, r5, 0 + adds r6, 0x25 + cmp r0, 0 + bne _08023768 + movs r0, 0x2E + ldrsh r2, [r5, r0] + ldr r1, =gUnknown_082F4444 + ldrb r0, [r5, 0x9] + subs r0, 0x2 + adds r0, r1 + ldrb r0, [r0] + cmp r2, r0 + ble _08023754 + ldrh r0, [r5, 0x30] + adds r0, 0x1 + strh r0, [r5, 0x30] + ldrb r0, [r6] + movs r1, 0x10 + orrs r0, r1 + b _0802375C + .pool +_08023754: + ldrb r1, [r6] + movs r0, 0x11 + negs r0, r0 + ands r0, r1 +_0802375C: + strb r0, [r6] + movs r0, 0 + strh r0, [r5, 0x2E] + ldrh r0, [r5, 0x32] + adds r0, 0x1 + strh r0, [r5, 0x32] +_08023768: + ldrh r0, [r5, 0x28] + movs r1, 0xF + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + bne _080237DE + movs r0, 0x34 + ldrsh r2, [r5, r0] + ldr r3, =gUnknown_082F4434 + ldrb r0, [r5, 0x9] + subs r0, 0x2 + lsls r1, r0, 2 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r2, r0 + bge _08023798 + ldrb r1, [r6] + movs r0, 0x1F + ands r0, r1 + strb r0, [r6] + b _080237D8 + .pool +_08023798: + adds r0, r3, 0x1 + adds r0, r1, r0 + ldrb r0, [r0] + cmp r2, r0 + bge _080237AC + ldrb r0, [r6] + movs r1, 0x1F + ands r1, r0 + movs r0, 0x20 + b _080237D4 +_080237AC: + adds r0, r3, 0x2 + adds r0, r1, r0 + ldrb r0, [r0] + cmp r2, r0 + bge _080237BC + movs r0, 0x2 + strh r0, [r5, 0x34] + b _080237D8 +_080237BC: + adds r0, r3, 0x3 + adds r0, r1, r0 + ldrb r0, [r0] + cmp r2, r0 + bge _080237CC + movs r0, 0x3 + strh r0, [r5, 0x34] + b _080237D8 +_080237CC: + ldrb r0, [r6] + movs r1, 0x1F + ands r1, r0 + movs r0, 0x80 +_080237D4: + orrs r1, r0 + strb r1, [r6] +_080237D8: + movs r0, 0 + strh r0, [r5, 0x34] + b _0802380A +_080237DE: + ldrh r0, [r5, 0x10] + adds r0, 0x1 + strh r0, [r5, 0x10] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x3C + bls _0802380A + cmp r0, 0x46 + bls _080237FA + bl sub_8011AC8 + movs r0, 0 + strh r0, [r5, 0x10] + b _0802380A +_080237FA: + ldrb r0, [r7] + movs r4, 0xF8 + ands r4, r0 + cmp r4, 0 + bne _0802380A + bl sub_8011AC8 + strh r4, [r5, 0x10] +_0802380A: + ldrh r1, [r5, 0x28] + ldr r0, =0x00008c9f + cmp r1, r0 + bls _0802381A + ldrb r0, [r7] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r7] +_0802381A: + ldrb r1, [r6] + lsls r1, 27 + lsrs r1, 31 + lsls r1, 1 + ldrb r2, [r7] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r7] + ldrb r0, [r6] + lsrs r0, 5 + adds r2, r5, 0 + adds r2, 0x66 + strh r0, [r2] + adds r4, r5, 0 + adds r4, 0x42 + adds r0, r4, 0 + mov r1, r8 + movs r2, 0xC + bl memcpy + adds r0, r4, 0 + bl sub_800FE50 +_0802384C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80236B8 + + thumb_func_start sub_802385C +sub_802385C: @ 802385C + push {r4,r5,lr} + adds r5, r0, 0 + movs r4, 0 + ldr r3, =0x03003090 + ldrb r0, [r5, 0x9] + cmp r4, r0 + bcs _08023880 + movs r1, 0 +_0802386C: + lsls r0, r4, 5 + adds r0, r5, r0 + adds r0, 0xB5 + strb r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldrb r0, [r5, 0x9] + cmp r4, r0 + bcc _0802386C +_08023880: + adds r2, r3, 0 + ldrh r0, [r2] + movs r1, 0xFF + lsls r1, 8 + ands r1, r0 + movs r0, 0xBC + lsls r0, 6 + cmp r1, r0 + bne _08023898 + ldrh r0, [r2, 0x2] + cmp r0, 0x2 + beq _080238AC +_08023898: + adds r2, r5, 0 + adds r2, 0x25 + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + b _080238EA + .pool +_080238AC: + adds r4, r5, 0 + adds r4, 0x4E + adds r0, r4, 0 + adds r1, r3, 0 + movs r2, 0xE + bl memcpy + ldrh r0, [r4, 0x6] + strh r0, [r5, 0x2A] + movs r0, 0x5 + ldrsb r0, [r4, r0] + strh r0, [r5, 0x2C] + ldrh r0, [r4, 0x8] + strh r0, [r5, 0x28] + movs r0, 0x9C + lsls r0, 1 + adds r1, r5, r0 + adds r0, r5, 0 + bl sub_80216E0 + ldrb r1, [r4, 0x4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080238EA + adds r0, r5, 0 + adds r0, 0x25 + ldrb r1, [r0] + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0] +_080238EA: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_802385C + + thumb_func_start sub_80238F0 +sub_80238F0: @ 80238F0 + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x5C + movs r1, 0 + movs r2, 0xC + bl memset + adds r0, r4, 0 + adds r0, 0x4E + movs r1, 0 + movs r2, 0xE + bl memset + adds r0, r4, 0 + bl sub_802385C + ldrh r1, [r4, 0x2C] + negs r1, r1 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x12 + bl SetGpuReg + ldrh r1, [r4, 0x2C] + negs r1, r1 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x1A + bl SetGpuReg + ldrh r1, [r4, 0x2C] + negs r1, r1 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x1E + bl SetGpuReg + adds r0, r4, 0 + adds r0, 0x25 + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08023978 + ldrh r1, [r4, 0x28] + ldr r0, =0x00008c9f + cmp r1, r0 + bls _08023964 + adds r0, 0x1 + strh r0, [r4, 0x28] + movs r0, 0x10 + movs r1, 0x1 + movs r2, 0 + bl sub_8022BEC + b _0802396E + .pool +_08023964: + movs r0, 0xF + movs r1, 0x1 + movs r2, 0 + bl sub_8022BEC +_0802396E: + movs r1, 0 + movs r0, 0 + strh r0, [r4, 0x10] + strb r1, [r4, 0xC] + b _08023992 +_08023978: + ldrh r0, [r4, 0x26] + adds r0, 0x1 + strh r0, [r4, 0x26] + adds r0, r4, 0 + bl sub_802339C + adds r0, r4, 0 + bl sub_8023558 + adds r0, r4, 0 + bl sub_80236B8 + movs r0, 0 +_08023992: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80238F0 + + thumb_func_start sub_8023998 +sub_8023998: @ 8023998 + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x5C + movs r1, 0 + movs r2, 0xC + bl memset + adds r0, r4, 0 + adds r0, 0x4E + movs r1, 0 + movs r2, 0xE + bl memset + adds r0, r4, 0 + bl sub_802385C + ldrh r1, [r4, 0x2C] + negs r1, r1 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x12 + bl SetGpuReg + ldrh r1, [r4, 0x2C] + negs r1, r1 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x1A + bl SetGpuReg + ldrh r1, [r4, 0x2C] + negs r1, r1 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x1E + bl SetGpuReg + adds r0, r4, 0 + adds r0, 0x25 + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08023A20 + ldrh r1, [r4, 0x28] + ldr r0, =0x00008c9f + cmp r1, r0 + bls _08023A0C + adds r0, 0x1 + strh r0, [r4, 0x28] + movs r0, 0x10 + movs r1, 0x1 + movs r2, 0 + bl sub_8022BEC + b _08023A16 + .pool +_08023A0C: + movs r0, 0xF + movs r1, 0x1 + movs r2, 0 + bl sub_8022BEC +_08023A16: + movs r1, 0 + movs r0, 0 + strh r0, [r4, 0x10] + strb r1, [r4, 0xC] + b _08023A28 +_08023A20: + adds r0, r4, 0 + bl sub_80236B8 + movs r0, 0 +_08023A28: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8023998 + + thumb_func_start sub_8023A30 +sub_8023A30: @ 8023A30 + push {r4-r7,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0xC] + cmp r0, 0x5 + bls _08023A3C + b _08023BB2 +_08023A3C: + lsls r0, 2 + ldr r1, =_08023A4C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08023A4C: + .4byte _08023A64 + .4byte _08023A8C + .4byte _08023ADC + .4byte _08023B5C + .4byte _08023B7A + .4byte _08023B94 +_08023A64: + movs r0, 0x8 + strh r0, [r4, 0x12] + movs r0, 0xD6 + bl audio_play + movs r0, 0x1 + negs r0, r0 + ldr r2, =0x000003ff + movs r1, 0x8 + bl sub_80A2A20 + movs r0, 0x9C + lsls r0, 1 + adds r1, r4, r0 + movs r0, 0x2 + strb r0, [r1] + b _08023BB2 + .pool +_08023A8C: + movs r1, 0x9C + lsls r1, 1 + adds r5, r4, r1 + ldrb r0, [r5] + subs r0, 0x1 + strb r0, [r5] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _08023AA2 + b _08023BB8 +_08023AA2: + movs r0, 0x1 + negs r0, r0 + ldr r2, =0x000003ff + movs r1, 0 + bl sub_80A2A20 + ldr r2, =0x00000139 + adds r1, r4, r2 + movs r0, 0x4 + strb r0, [r1] + movs r0, 0 + strb r0, [r5] + ldr r2, =gUnknown_082F326C + ldrb r1, [r1] + lsls r0, r1, 3 + subs r0, r1 + adds r0, r2 + ldrb r0, [r0] + movs r2, 0x9D + lsls r2, 1 + adds r1, r4, r2 + strb r0, [r1] + b _08023BB2 + .pool +_08023ADC: + ldr r7, =gUnknown_082F326C + movs r0, 0x9C + lsls r0, 1 + adds r6, r4, r0 + ldr r1, =0x00000139 + adds r5, r4, r1 + ldrb r1, [r5] + lsls r0, r1, 3 + subs r0, r1 + ldrb r2, [r6] + adds r0, r2 + adds r0, r7 + movs r1, 0 + ldrsb r1, [r0, r1] + strh r1, [r4, 0x2C] + negs r1, r1 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x12 + bl SetGpuReg + ldrh r1, [r4, 0x2C] + negs r1, r1 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x1A + bl SetGpuReg + ldrh r1, [r4, 0x2C] + negs r1, r1 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x1E + bl SetGpuReg + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] + movs r1, 0x9D + lsls r1, 1 + adds r2, r4, r1 + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r2] + cmp r0, r1 + bcc _08023BB8 + ldrb r0, [r5] + cmp r0, 0 + beq _08023BB2 + subs r0, 0x1 + strb r0, [r5] + ldrb r1, [r5] + lsls r0, r1, 3 + subs r0, r1 + adds r0, r7 + ldrb r0, [r0] + strb r0, [r2] + movs r0, 0 + strb r0, [r6] + b _08023BB8 + .pool +_08023B5C: + movs r0, 0 + strh r0, [r4, 0x2C] + movs r0, 0x12 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1A + movs r1, 0 + bl SetGpuReg + movs r0, 0x1E + movs r1, 0 + bl SetGpuReg + b _08023BB2 +_08023B7A: + movs r2, 0x9C + lsls r2, 1 + adds r1, r4, r2 + adds r0, r4, 0 + bl sub_80218D4 + cmp r0, 0 + beq _08023BB8 + bl sub_8010434 + movs r0, 0 + strh r0, [r4, 0x10] + b _08023BB2 +_08023B94: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08023BB8 + movs r0, 0x11 + movs r1, 0x1 + movs r2, 0 + bl sub_8022BEC + movs r1, 0 + movs r0, 0 + strh r0, [r4, 0x10] + strb r1, [r4, 0xC] + b _08023BBA +_08023BB2: + ldrb r0, [r4, 0xC] + adds r0, 0x1 + strb r0, [r4, 0xC] +_08023BB8: + movs r0, 0 +_08023BBA: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8023A30 + + thumb_func_start sub_8023BC0 +sub_8023BC0: @ 8023BC0 + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + ldrb r0, [r5, 0xC] + cmp r0, 0x1 + beq _08023C04 + cmp r0, 0x1 + bgt _08023BD8 + cmp r0, 0 + beq _08023BE2 + b _08023C9C +_08023BD8: + cmp r0, 0x2 + beq _08023C2A + cmp r0, 0x3 + beq _08023C5C + b _08023C9C +_08023BE2: + movs r0, 0x9 + strh r0, [r5, 0x12] + movs r0, 0x20 + bl audio_play + movs r0, 0x1 + negs r0, r0 + movs r1, 0x8 + movs r2, 0x1F + bl sub_80A2A20 + movs r0, 0x9C + lsls r0, 1 + adds r1, r5, r0 + movs r0, 0x4 + strb r0, [r1] + b _08023C9C +_08023C04: + movs r0, 0x9C + lsls r0, 1 + adds r4, r5, r0 + ldrb r0, [r4] + subs r0, 0x1 + strb r0, [r4] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _08023CA2 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + movs r2, 0x1F + bl sub_80A2A20 + movs r0, 0 + strb r0, [r4] + b _08023C9C +_08023C2A: + movs r0, 0x9C + lsls r0, 1 + adds r1, r5, r0 + adds r0, r5, 0 + bl sub_80218D4 + cmp r0, 0 + beq _08023CA2 + bl sub_8010434 + movs r0, 0 + strh r0, [r5, 0x10] + movs r0, 0x12 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1A + movs r1, 0 + bl SetGpuReg + movs r0, 0x1E + movs r1, 0 + bl SetGpuReg + b _08023C9C +_08023C5C: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08023CA2 + ldr r0, =0x02021cc4 + ldr r1, [r5, 0x1C] + movs r2, 0 + movs r3, 0x6 + bl ConvertIntToDecimalString + movs r4, 0 + str r4, [sp] + adds r0, r6, 0 + movs r1, 0x7 + movs r2, 0x1 + movs r3, 0 + bl sub_8024644 + movs r0, 0x13 + strb r0, [r5, 0xE] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0 + bl sub_8022BEC + movs r0, 0 + strh r4, [r5, 0x10] + b _08023CA0 + .pool +_08023C9C: + ldrb r0, [r5, 0xC] + adds r0, 0x1 +_08023CA0: + strb r0, [r5, 0xC] +_08023CA2: + movs r0, 0 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8023BC0 + + thumb_func_start sub_8023CAC +sub_8023CAC: @ 8023CAC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + adds r7, r0, 0 + ldrb r0, [r7, 0xC] + cmp r0, 0x7 + bls _08023CC2 + b _0802402E +_08023CC2: + lsls r0, 2 + ldr r1, =_08023CD0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08023CD0: + .4byte _08023CF0 + .4byte _08023D2A + .4byte _08023D38 + .4byte _08023DA0 + .4byte _08023F20 + .4byte _08023FD0 + .4byte _08023FDC + .4byte _08024010 +_08023CF0: + adds r4, r7, 0 + adds r4, 0x42 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x4 + bl memset + ldrb r0, [r7, 0x8] + lsls r0, 5 + adds r0, r7, r0 + adds r2, r0, 0 + adds r2, 0xB2 + ldrh r1, [r7, 0x28] + ldrh r0, [r2] + cmp r0, r1 + bls _08023D12 + strh r1, [r2] +_08023D12: + ldrb r0, [r7, 0x8] + lsls r0, 5 + adds r0, r7, r0 + adds r0, 0xB2 + ldrh r0, [r0] + strh r0, [r4] + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x2 + bl link_0800A448 + b _0802402E +_08023D2A: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _08023D36 + b _08024034 +_08023D36: + b _08024004 +_08023D38: + bl sub_800A550 + ldr r2, =gUnknown_082F4448 + ldrb r3, [r7, 0x9] + subs r1, r3, 0x2 + adds r1, r2 + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + beq _08023D50 + b _08024034 +_08023D50: + movs r0, 0 + mov r8, r0 + adds r4, r7, 0 + adds r4, 0x42 + cmp r8, r3 + bcs _08023D7E + ldr r2, =0x020223c4 +_08023D5E: + mov r3, r8 + lsls r1, r3, 5 + adds r1, r7, r1 + lsls r0, r3, 8 + adds r0, r2 + ldrh r0, [r0] + adds r1, 0xB2 + strh r0, [r1] + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldrb r6, [r7, 0x9] + cmp r8, r6 + bcc _08023D5E +_08023D7E: + movs r0, 0 + strh r0, [r7, 0x10] + strh r0, [r4] + bl sub_800A5B4 + ldrb r0, [r7, 0x8] + cmp r0, 0 + bne _08023D9C + movs r0, 0x3 + b _08024032 + .pool +_08023D9C: + movs r0, 0x6 + b _08024032 +_08023DA0: + adds r0, r7, 0 + adds r0, 0x68 + movs r1, 0 + movs r2, 0x30 + bl memset + ldrh r1, [r7, 0x28] + adds r0, r7, 0 + adds r0, 0x6C + strh r1, [r0] + movs r0, 0x18 + ldrsh r4, [r7, r0] + ldrh r0, [r7, 0x28] + movs r1, 0x3C + bl __udivsi3 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl __divsi3 + adds r1, r7, 0 + adds r1, 0x6E + strh r0, [r1] + movs r1, 0x30 + ldrsh r0, [r7, r1] + lsls r0, 8 + movs r4, 0xC8 + lsls r4, 6 + adds r1, r4, 0 + bl sub_8151574 + adds r2, r0, 0 + movs r3, 0x32 + ldrsh r1, [r7, r3] + lsls r1, 8 + bl sub_81515FC + adds r2, r0, r4 + asrs r2, 8 + movs r1, 0x7F + adds r0, r2, 0 + ands r0, r1 + adds r1, r7, 0 + adds r1, 0x70 + strh r0, [r1] + lsls r2, 8 + movs r1, 0xC8 + lsls r1, 7 + adds r0, r2, 0 + bl sub_81515FC + adds r2, r0, 0 + ldrb r1, [r7, 0x9] + ldr r0, [r7, 0x1C] + muls r0, r1 + lsls r4, r0, 8 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_8151574 + adds r4, r0, 0 + asrs r0, r4, 8 + str r0, [r7, 0x68] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + adds r1, r7, 0 + adds r1, 0x8F + strb r0, [r1] + movs r6, 0 + mov r8, r6 + mov r9, r1 + ldrb r0, [r7, 0x9] + cmp r8, r0 + bcc _08023E44 + b _0802402E +_08023E44: + adds r0, r7, 0 + adds r0, 0x88 + add r0, r8 + mov r1, r8 + strb r1, [r0] + adds r0, r7, 0 + adds r0, 0x90 + add r0, r8 + strb r1, [r0] + mov r3, r8 + lsls r2, r3, 1 + adds r1, r7, 0 + adds r1, 0x74 + adds r1, r2 + lsls r0, r3, 5 + adds r3, r7, r0 + adds r5, r3, 0 + adds r5, 0xAE + ldrh r0, [r5] + strh r0, [r1] + adds r1, r7, 0 + adds r1, 0x72 + ldrh r6, [r1] + adds r0, r6 + strh r0, [r1] + mov r1, r9 + ldrb r0, [r1] + adds r6, r2, 0 + cmp r0, 0x1 + beq _08023EAE + cmp r0, 0x1 + bgt _08023E8A + cmp r0, 0 + beq _08023E90 + b _08023F04 +_08023E8A: + cmp r0, 0x2 + beq _08023ECC + b _08023F04 +_08023E90: + ldrh r0, [r5] + cmp r0, 0 + beq _08023ED2 + adds r0, r3, 0 + adds r0, 0xAC + ldrh r2, [r0] + lsls r2, 8 + adds r0, r2, 0 + movs r1, 0xC8 + lsls r1, 7 + bl sub_8151574 + adds r2, r0, 0 + ldrh r4, [r5] + b _08023EFA +_08023EAE: + ldrh r0, [r5] + cmp r0, 0 + beq _08023ED2 + adds r0, r3, 0 + adds r0, 0xB0 + ldrh r2, [r0] + lsls r2, 8 + adds r0, r2, 0 + movs r1, 0xC8 + lsls r1, 7 + bl sub_8151574 + adds r2, r0, 0 + ldrh r4, [r5] + b _08023EFA +_08023ECC: + ldrh r0, [r5] + cmp r0, 0 + bne _08023ED6 +_08023ED2: + movs r4, 0 + b _08023F04 +_08023ED6: + adds r1, r3, 0 + adds r1, 0xB2 + ldrh r0, [r1] + ldrh r2, [r7, 0x28] + cmp r0, r2 + bcc _08023EE8 + movs r4, 0xC8 + lsls r4, 7 + b _08023F04 +_08023EE8: + ldrh r2, [r1] + lsls r2, 8 + adds r0, r2, 0 + movs r1, 0xC8 + lsls r1, 7 + bl sub_8151574 + adds r2, r0, 0 + ldrh r4, [r7, 0x28] +_08023EFA: + lsls r4, 8 + adds r1, r4, 0 + bl sub_81515FC + adds r4, r0, 0 +_08023F04: + asrs r4, 4 + adds r0, r7, 0 + adds r0, 0x7E + adds r0, r6 + strh r4, [r0] + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldrb r3, [r7, 0x9] + cmp r8, r3 + bcc _08023E44 + b _0802402E +_08023F20: + movs r6, 0 + mov r8, r6 + ldrb r0, [r7, 0x9] + subs r0, 0x1 + adds r1, r7, 0 + adds r1, 0x68 + str r1, [sp, 0xC] + cmp r8, r0 + bge _08023FC4 +_08023F32: + ldrb r0, [r7, 0x9] + subs r0, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + mov r2, r8 + adds r2, 0x1 + str r2, [sp, 0x8] + cmp r4, r8 + bls _08023FB4 + adds r3, r7, 0 + adds r3, 0x74 + str r3, [sp] + adds r6, r7, 0 + adds r6, 0x88 + str r6, [sp, 0x4] + movs r0, 0x90 + adds r0, r7 + mov r10, r0 + movs r1, 0x7E + adds r1, r7 + mov r9, r1 +_08023F5C: + subs r2, r4, 0x1 + mov r12, r2 + lsls r6, r2, 1 + ldr r0, [sp] + adds r3, r0, r6 + lsls r5, r4, 1 + adds r1, r0, r5 + ldrh r2, [r3] + ldrh r0, [r1] + cmp r2, r0 + bcs _08023F86 + ldrh r0, [r1] + strh r2, [r1] + strh r0, [r3] + ldr r1, [sp, 0x4] + adds r2, r1, r4 + ldrb r3, [r2] + add r1, r12 + ldrb r0, [r1] + strb r0, [r2] + strb r3, [r1] +_08023F86: + mov r2, r9 + adds r3, r2, r6 + adds r1, r2, r5 + ldrh r2, [r3] + ldrh r6, [r1] + cmp r2, r6 + bcs _08023FAA + ldrh r0, [r1] + strh r2, [r1] + strh r0, [r3] + mov r0, r10 + adds r2, r0, r4 + ldrb r3, [r2] + mov r1, r10 + add r1, r12 + ldrb r0, [r1] + strb r0, [r2] + strb r3, [r1] +_08023FAA: + mov r1, r12 + lsls r0, r1, 24 + lsrs r4, r0, 24 + cmp r4, r8 + bhi _08023F5C +_08023FB4: + ldr r2, [sp, 0x8] + lsls r0, r2, 24 + lsrs r0, 24 + mov r8, r0 + ldrb r0, [r7, 0x9] + subs r0, 0x1 + cmp r8, r0 + blt _08023F32 +_08023FC4: + movs r0, 0 + ldr r1, [sp, 0xC] + movs r2, 0x30 + bl link_0800A448 + b _0802402E +_08023FD0: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08024034 + b _08024004 +_08023FDC: + bl sub_800A550 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08024034 + adds r4, r7, 0 + adds r4, 0x68 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x30 + bl memset + ldr r1, =0x020223c4 + adds r0, r4, 0 + movs r2, 0x30 + bl memcpy + bl sub_800A5B4 +_08024004: + movs r0, 0 + strh r0, [r7, 0x10] + b _0802402E + .pool +_08024010: + bl sub_8020E58 + movs r0, 0x12 + movs r1, 0x1 + movs r2, 0 + bl sub_8022BEC + movs r0, 0 + movs r1, 0xB + strh r1, [r7, 0x12] + strb r0, [r7, 0xC] + adds r1, r7, 0 + adds r1, 0x24 + strb r0, [r1] + b _08024034 +_0802402E: + ldrb r0, [r7, 0xC] + adds r0, 0x1 +_08024032: + strb r0, [r7, 0xC] +_08024034: + movs r0, 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_8023CAC + + thumb_func_start sub_8024048 +sub_8024048: @ 8024048 + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + ldrb r0, [r5, 0xC] + cmp r0, 0x4 + bhi _08024124 + lsls r0, 2 + ldr r1, =_08024064 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08024064: + .4byte _08024078 + .4byte _0802408A + .4byte _0802409C + .4byte _080240CC + .4byte _080240DC +_08024078: + movs r0, 0x9C + lsls r0, 1 + adds r1, r5, r0 + adds r0, r5, 0 + bl sub_8022070 + cmp r0, 0 + bne _08024124 + b _0802412A +_0802408A: + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0x9C + lsls r0, 1 + adds r1, r5, r0 + movs r0, 0x1E + strb r0, [r1] + b _08024124 +_0802409C: + movs r0, 0x9C + lsls r0, 1 + adds r1, r5, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _080240AE + subs r0, 0x1 + strb r0, [r1] + b _0802412A +_080240AE: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0802412A + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_802222C + b _08024124 + .pool +_080240CC: + ldrh r0, [r5, 0x12] + cmp r0, 0xC + bhi _08024124 + adds r0, 0x1 + movs r1, 0 + strh r0, [r5, 0x12] + strb r1, [r5, 0xC] + b _0802412A +_080240DC: + ldr r0, =0x02021cc4 + ldr r1, [r5, 0x1C] + movs r2, 0 + movs r3, 0x6 + bl ConvertIntToDecimalString + ldr r4, =0x02021dc4 + bl sub_80247BC + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x6 + bl ConvertIntToDecimalString + movs r4, 0 + str r4, [sp] + adds r0, r6, 0 + movs r1, 0x2 + movs r2, 0x3 + movs r3, 0 + bl sub_8024644 + movs r0, 0x13 + strb r0, [r5, 0xE] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0 + bl sub_8022BEC + strb r4, [r5, 0xC] + b _0802412A + .pool +_08024124: + ldrb r0, [r5, 0xC] + adds r0, 0x1 + strb r0, [r5, 0xC] +_0802412A: + movs r0, 0 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8024048 + + thumb_func_start sub_8024134 +sub_8024134: @ 8024134 + push {r4,r5,lr} + sub sp, 0x10 + adds r5, r0, 0 + adds r4, r1, 0 + ldrb r0, [r5, 0xC] + cmp r0, 0x4 + bhi _08024218 + lsls r0, 2 + ldr r1, =_08024150 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08024150: + .4byte _08024164 + .4byte _080241A0 + .4byte _080241A6 + .4byte _080241F0 + .4byte _08024204 +_08024164: + ldrh r1, [r5, 0x28] + ldr r0, =0x00008c9f + cmp r1, r0 + bls _08024176 + movs r1, 0x9C + lsls r1, 1 + adds r0, r5, r1 + bl sub_8022554 +_08024176: + movs r0, 0x1 + str r0, [sp] + adds r0, r4, 0 + movs r1, 0x8 + movs r2, 0 + movs r3, 0 + bl sub_8024644 + movs r4, 0 + movs r0, 0x13 + strb r0, [r5, 0xE] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0 + bl sub_8022BEC + strb r4, [r5, 0xC] + b _0802421E + .pool +_080241A0: + bl sub_8010434 + b _08024218 +_080241A6: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _0802421E + movs r0, 0 + movs r1, 0 + bl sub_81973C4 + ldr r2, =gUnknown_082C8959 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0 + movs r1, 0x1 + movs r3, 0 + bl AddTextPrinterParametrized + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + ldr r0, =sub_8153688 + movs r1, 0 + bl AddTask + b _08024218 + .pool +_080241F0: + ldr r0, =sub_8153688 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + beq _08024218 + b _0802421E + .pool +_08024204: + movs r0, 0x14 + movs r1, 0x1 + movs r2, 0 + bl sub_8022BEC + movs r1, 0 + movs r0, 0xF + strh r0, [r5, 0x12] + strb r1, [r5, 0xC] + b _0802421E +_08024218: + ldrb r0, [r5, 0xC] + adds r0, 0x1 + strb r0, [r5, 0xC] +_0802421E: + movs r0, 0 + add sp, 0x10 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8024134 + + thumb_func_start sub_8024228 +sub_8024228: @ 8024228 + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + ldrb r0, [r5, 0xC] + cmp r0, 0x1 + beq _0802426A + cmp r0, 0x1 + bgt _08024240 + cmp r0, 0 + beq _08024246 + b _080242D0 +_08024240: + cmp r0, 0x2 + beq _08024270 + b _080242D0 +_08024246: + movs r0, 0x1 + str r0, [sp] + adds r0, r6, 0 + movs r1, 0x4 + movs r2, 0 + movs r3, 0 + bl sub_8024644 + movs r0, 0x14 + strb r0, [r5, 0xE] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0 + bl sub_8022BEC + movs r0, 0 + strb r0, [r5, 0xC] + b _080242D8 +_0802426A: + bl sub_8197930 + b _080242D0 +_08024270: + bl sub_8198C58 + lsls r0, 24 + asrs r4, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _080242D6 + adds r0, r5, 0 + adds r0, 0x42 + movs r1, 0 + movs r2, 0xC + bl memset + cmp r4, 0 + bne _080242A2 + bl sub_80D67C4 + lsls r0, 24 + cmp r0, 0 + beq _0802429E + strh r4, [r5, 0x14] + b _080242A6 +_0802429E: + movs r0, 0x3 + b _080242A4 +_080242A2: + movs r0, 0x1 +_080242A4: + strh r0, [r5, 0x14] +_080242A6: + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + movs r4, 0 + str r4, [sp] + adds r0, r6, 0 + movs r1, 0x8 + movs r2, 0 + movs r3, 0 + bl sub_8024644 + movs r0, 0x15 + strb r0, [r5, 0xE] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0 + bl sub_8022BEC + strb r4, [r5, 0xC] + b _080242D6 +_080242D0: + ldrb r0, [r5, 0xC] + adds r0, 0x1 + strb r0, [r5, 0xC] +_080242D6: + movs r0, 0 +_080242D8: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8024228 + + thumb_func_start sub_80242E0 +sub_80242E0: @ 80242E0 + push {r4-r7,lr} + adds r4, r0, 0 + movs r5, 0 + ldrb r0, [r4, 0xC] + cmp r0, 0x1 + beq _08024306 + cmp r0, 0x1 + bgt _080242F6 + cmp r0, 0 + beq _08024300 + b _080243AC +_080242F6: + cmp r0, 0x2 + beq _08024328 + cmp r0, 0x3 + beq _08024336 + b _080243AC +_08024300: + bl sub_8010434 + b _080243AC +_08024306: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080243B2 + ldrh r0, [r4, 0x14] + adds r1, r4, 0 + adds r1, 0x42 + strh r0, [r1] + adds r0, r4, 0 + adds r0, 0x4E + strh r5, [r0] + movs r0, 0 + movs r2, 0x2 + bl link_0800A448 + b _080243AC +_08024328: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080243B2 + strh r5, [r4, 0x10] + b _080243AC +_08024336: + bl sub_800A550 + ldr r2, =gUnknown_082F4448 + ldrb r3, [r4, 0x9] + subs r1, r3, 0x2 + adds r1, r2 + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bne _080243B2 + adds r7, r4, 0 + adds r7, 0x42 + adds r6, r4, 0 + adds r6, 0x4E + cmp r5, r3 + bcs _08024374 + adds r1, r6, 0 + ldr r2, =0x020223c4 +_0802435C: + lsls r0, r5, 8 + adds r0, r2 + ldrh r0, [r0] + ldrh r3, [r1] + adds r0, r3 + strh r0, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldrb r0, [r4, 0x9] + cmp r5, r0 + bcc _0802435C +_08024374: + ldrh r0, [r6] + cmp r0, 0 + beq _08024390 + movs r0, 0x17 + movs r1, 0x1 + movs r2, 0 + bl sub_8022BEC + b _0802439A + .pool +_08024390: + movs r0, 0x16 + movs r1, 0x1 + movs r2, 0 + bl sub_8022BEC +_0802439A: + bl sub_800A5B4 + movs r1, 0 + movs r0, 0 + strh r0, [r7] + strh r0, [r6] + strh r0, [r4, 0x10] + strb r1, [r4, 0xC] + b _080243B4 +_080243AC: + ldrb r0, [r4, 0xC] + adds r0, 0x1 + strb r0, [r4, 0xC] +_080243B2: + movs r0, 0 +_080243B4: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80242E0 + + thumb_func_start sub_80243BC +sub_80243BC: @ 80243BC + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + ldrb r4, [r5, 0xC] + cmp r4, 0x1 + beq _080243EA + cmp r4, 0x1 + bgt _080243D2 + cmp r4, 0 + beq _080243DC + b _08024434 +_080243D2: + cmp r4, 0x2 + beq _080243F6 + cmp r4, 0x3 + beq _0802441A + b _08024434 +_080243DC: + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0x1 + movs r2, 0 + movs r3, 0x10 + b _08024410 +_080243EA: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + beq _08024434 + b _0802443A +_080243F6: + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + adds r0, r5, 0 + bl sub_8021488 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 +_08024410: + bl pal_fade_maybe + bl fade_and_return_progress_probably + b _08024434 +_0802441A: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _0802443A + movs r0, 0x7 + movs r1, 0x1 + movs r2, 0 + bl sub_8022BEC + movs r0, 0 + strh r4, [r5, 0x12] + b _08024438 +_08024434: + ldrb r0, [r5, 0xC] + adds r0, 0x1 +_08024438: + strb r0, [r5, 0xC] +_0802443A: + movs r0, 0 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80243BC + + thumb_func_start sub_8024444 +sub_8024444: @ 8024444 + push {r4,r5,lr} + sub sp, 0x10 + adds r5, r0, 0 + ldrb r4, [r5, 0xC] + cmp r4, 0x1 + beq _080244BC + cmp r4, 0x1 + bgt _0802445A + cmp r4, 0 + beq _08024460 + b _080244F6 +_0802445A: + cmp r4, 0x2 + beq _080244D4 + b _080244F6 +_08024460: + movs r0, 0 + movs r1, 0 + bl sub_81973C4 + ldrh r1, [r5, 0x14] + cmp r1, 0x3 + bne _08024490 + ldr r0, =gUnknown_082F32A4 + ldr r2, [r0, 0x14] + ldrb r3, [r5, 0xB] + str r4, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + str r1, [sp, 0xC] + movs r0, 0 + movs r1, 0x1 + bl AddTextPrinterParametrized + b _080244AC + .pool +_08024490: + ldr r0, =gUnknown_082F32A4 + ldr r2, [r0, 0x18] + ldrb r3, [r5, 0xB] + str r4, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0 + movs r1, 0x1 + bl AddTextPrinterParametrized +_080244AC: + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + b _080244F6 + .pool +_080244BC: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _080244FC + movs r0, 0x9C + lsls r0, 1 + adds r1, r5, r0 + movs r0, 0x78 + strb r0, [r1] + b _080244F6 +_080244D4: + movs r0, 0x9C + lsls r0, 1 + adds r1, r5, r0 + ldrb r0, [r1] + adds r4, r0, 0 + cmp r4, 0 + beq _080244E8 + subs r0, 0x1 + strb r0, [r1] + b _080244FC +_080244E8: + movs r0, 0x18 + movs r1, 0x1 + movs r2, 0 + bl sub_8022BEC + strb r4, [r5, 0xC] + b _080244FC +_080244F6: + ldrb r0, [r5, 0xC] + adds r0, 0x1 + strb r0, [r5, 0xC] +_080244FC: + movs r0, 0 + add sp, 0x10 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8024444 + + thumb_func_start sub_8024508 +sub_8024508: @ 8024508 + push {r4,r5,lr} + adds r5, r0, 0 + ldrb r4, [r5, 0xC] + cmp r4, 0x1 + beq _08024528 + cmp r4, 0x1 + bgt _0802451C + cmp r4, 0 + beq _08024522 + b _08024558 +_0802451C: + cmp r4, 0x2 + beq _08024538 + b _08024558 +_08024522: + bl sub_8010434 + b _08024558 +_08024528: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _0802455E + bl sub_800AC34 + b _08024558 +_08024538: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _0802455E + movs r0, 0x19 + strb r0, [r5, 0xE] + movs r0, 0x5 + movs r1, 0x1 + movs r2, 0 + bl sub_8022BEC + strb r4, [r5, 0xC] + b _0802455E + .pool +_08024558: + ldrb r0, [r5, 0xC] + adds r0, 0x1 + strb r0, [r5, 0xC] +_0802455E: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8024508 + + thumb_func_start sub_8024568 +sub_8024568: @ 8024568 + push {lr} + movs r0, 0 + bl sub_8020C0C + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_8024568 + + thumb_func_start sub_8024578 +sub_8024578: @ 8024578 + push {r4-r6,lr} + adds r4, r0, 0 + movs r5, 0 + movs r0, 0x33 + bl sav12_xor_increment + strb r5, [r4, 0xD] + movs r1, 0 + strh r5, [r4, 0x10] + movs r0, 0x2 + strh r0, [r4, 0x12] + strh r5, [r4, 0x14] + str r5, [r4, 0x1C] + strh r5, [r4, 0x18] + strh r5, [r4, 0x1A] + str r5, [r4, 0x20] + adds r0, r4, 0 + adds r0, 0x24 + strb r1, [r0] + adds r1, r4, 0 + adds r1, 0x25 + movs r0, 0 + strb r0, [r1] + strh r5, [r4, 0x26] + strh r5, [r4, 0x28] + strh r5, [r4, 0x2E] + ldr r0, =0x0000ffff + strh r0, [r4, 0x32] + strh r5, [r4, 0x30] + strh r5, [r4, 0x34] + movs r6, 0 + movs r3, 0 +_080245B8: + lsls r0, r5, 5 + adds r2, r4, r0 + adds r1, r2, 0 + adds r1, 0xA4 + ldr r0, =0x0000ffff + strh r0, [r1] + adds r0, r2, 0 + adds r0, 0xA6 + strh r3, [r0] + adds r0, 0x2 + strh r3, [r0] + adds r1, 0x6 + movs r0, 0x1 + strh r0, [r1] + adds r0, r2, 0 + adds r0, 0xAC + strh r3, [r0] + adds r0, 0x2 + strh r3, [r0] + adds r0, 0x2 + strh r3, [r0] + adds r0, 0x2 + strh r3, [r0] + adds r0, 0x2 + strb r6, [r0] + adds r0, 0x1 + strb r6, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x4 + bls _080245B8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8024578 + + thumb_func_start sub_8024604 +sub_8024604: @ 8024604 + push {r4-r6,lr} + sub sp, 0x8 + str r2, [sp, 0x4] + ldr r5, [sp, 0x18] + ldr r6, [sp, 0x1C] + ldr r4, [sp, 0x20] + mov r2, sp + strh r4, [r2] + add r4, sp, 0x4 + ldrb r2, [r4] + strb r2, [r0] + ldrb r2, [r4, 0x1] + strb r2, [r0, 0x1] + ldrb r2, [r4, 0x2] + strb r2, [r0, 0x2] + ldrb r2, [r4, 0x3] + strb r2, [r0, 0x3] + strb r3, [r0, 0x4] + strb r5, [r0, 0x5] + strb r6, [r0, 0x6] + mov r2, sp + ldrb r2, [r2] + strb r2, [r0, 0x7] + mov r2, sp + ldrb r2, [r2, 0x1] + strb r2, [r0, 0x8] + strb r1, [r0, 0x9] + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8024604 + + thumb_func_start sub_8024644 +sub_8024644: @ 8024644 + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, [sp, 0x10] + mov r4, sp + strh r3, [r4] + strb r1, [r0] + strb r2, [r0, 0x1] + mov r1, sp + ldrb r1, [r1] + strb r1, [r0, 0x2] + mov r1, sp + ldrb r1, [r1, 0x1] + strb r1, [r0, 0x3] + strb r5, [r0, 0x4] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8024644 + + thumb_func_start sub_8024668 +sub_8024668: @ 8024668 + ldr r1, =0x03005d90 + ldr r1, [r1] + adds r1, 0xAC + ldr r0, [r0] + ldr r1, [r1] + eors r0, r1 + bx lr + .pool + thumb_func_end sub_8024668 + + thumb_func_start sub_802467C +sub_802467C: @ 802467C + ldr r2, =0x03005d90 + ldr r2, [r2] + adds r2, 0xAC + ldr r2, [r2] + eors r2, r1 + str r2, [r0] + bx lr + .pool + thumb_func_end sub_802467C + + thumb_func_start sub_8024690 +sub_8024690: @ 8024690 + push {lr} + adds r1, r0, 0 + ldr r0, =0x03005d90 + ldr r0, [r0] + movs r2, 0xFA + lsls r2, 1 + adds r0, r2 + bl apply_u32_xor_crypto + pop {r0} + bx r0 + .pool + thumb_func_end sub_8024690 + + thumb_func_start sub_80246AC +sub_80246AC: @ 80246AC + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x03005d90 + ldr r0, [r0] + movs r1, 0xFA + lsls r1, 1 + adds r0, r1 + bl sub_8024668 + cmp r0, r4 + bcc _080246CC + movs r0, 0x1 + b _080246CE + .pool +_080246CC: + movs r0, 0 +_080246CE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80246AC + + thumb_func_start sub_80246D4 +sub_80246D4: @ 80246D4 + push {lr} + ldr r0, =0x03005d90 + ldr r0, [r0] + movs r1, 0xFA + lsls r1, 1 + adds r0, r1 + bl sub_8024668 + ldr r1, =0x020375e0 + ldrh r1, [r1] + cmp r0, r1 + bcc _080246F8 + movs r0, 0x1 + b _080246FA + .pool +_080246F8: + movs r0, 0 +_080246FA: + pop {r1} + bx r1 + thumb_func_end sub_80246D4 + + thumb_func_start sub_8024700 +sub_8024700: @ 8024700 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, =0x03005d90 + ldr r0, [r0] + movs r1, 0xFA + lsls r1, 1 + adds r5, r0, r1 + adds r0, r5, 0 + bl sub_8024668 + adds r1, r0, r4 + ldr r2, =0x0001869f + cmp r1, r2 + bhi _08024730 + adds r0, r5, 0 + bl sub_802467C + movs r0, 0x1 + b _0802473A + .pool +_08024730: + adds r0, r5, 0 + adds r1, r2, 0 + bl sub_802467C + movs r0, 0 +_0802473A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8024700 + + thumb_func_start sub_8024740 +sub_8024740: @ 8024740 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =0x03005d90 + ldr r0, [r0] + movs r1, 0xFA + lsls r1, 1 + adds r4, r0, r1 + adds r0, r5, 0 + bl sub_80246AC + lsls r0, 24 + cmp r0, 0 + beq _08024774 + adds r0, r4, 0 + bl sub_8024668 + adds r1, r0, 0 + subs r1, r5 + adds r0, r4, 0 + bl sub_802467C + movs r0, 0x1 + b _08024776 + .pool +_08024774: + movs r0, 0 +_08024776: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8024740 + + thumb_func_start sub_802477C +sub_802477C: @ 802477C + push {r4,r5,lr} + ldr r0, =0x03005d90 + ldr r0, [r0] + movs r1, 0xFA + lsls r1, 1 + adds r4, r0, r1 + ldr r5, =0x020375e0 + ldrh r0, [r5] + bl sub_80246AC + lsls r0, 24 + cmp r0, 0 + beq _080247B4 + adds r0, r4, 0 + bl sub_8024668 + adds r1, r0, 0 + ldrh r0, [r5] + subs r1, r0 + adds r0, r4, 0 + bl sub_802467C + movs r0, 0x1 + b _080247B6 + .pool +_080247B4: + movs r0, 0 +_080247B6: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_802477C + + thumb_func_start sub_80247BC +sub_80247BC: @ 80247BC + push {lr} + ldr r0, =0x03005d90 + ldr r0, [r0] + movs r1, 0xFA + lsls r1, 1 + adds r0, r1 + bl sub_8024668 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80247BC + + thumb_func_start sub_80247D4 +sub_80247D4: @ 80247D4 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0xC + adds r6, r0, 0 + mov r8, r2 + adds r4, r3, 0 + ldr r5, [sp, 0x24] + lsls r6, 24 + lsrs r6, 24 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =0x02021cc4 + mov r9, r0 + movs r2, 0x1 + movs r3, 0x5 + bl ConvertIntToDecimalString + str r4, [sp] + str r5, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r6, 0 + movs r1, 0x1 + mov r2, r9 + mov r3, r8 + bl Print + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80247D4 + + thumb_func_start sub_802482C +sub_802482C: @ 802482C + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0xC + adds r6, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + mov r8, r3 + lsls r6, 24 + lsrs r6, 24 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + adds r0, r6, 0 + movs r1, 0 + adds r2, r4, 0 + adds r3, r5, 0 + bl SetWindowBorderStyle + ldr r2, =gUnknown_085EDCDE + movs r0, 0x1 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + adds r0, r6, 0 + movs r1, 0x1 + movs r3, 0 + bl Print + str r4, [sp] + adds r0, r6, 0 + mov r1, r8 + movs r2, 0x1A + movs r3, 0x11 + bl sub_80247D4 + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802482C + + thumb_func_start sub_802488C +sub_802488C: @ 802488C + push {lr} + sub sp, 0x4 + bl sub_80247BC + adds r1, r0, 0 + ldr r0, =0x02022c94 + ldrb r0, [r0] + movs r2, 0 + str r2, [sp] + movs r2, 0x1A + movs r3, 0x11 + bl sub_80247D4 + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_802488C + + thumb_func_start sub_80248B0 +sub_80248B0: @ 80248B0 + push {r4,r5,lr} + sub sp, 0x18 + movs r0, 0x7 + str r0, [sp] + movs r0, 0x4 + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + movs r0, 0x1C + str r0, [sp, 0xC] + add r0, sp, 0x10 + movs r1, 0 + movs r2, 0x1 + movs r3, 0x1 + bl rbox_template_set + ldr r4, =0x02022c94 + add r0, sp, 0x10 + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl FillWindowPixelBuffer + ldrb r0, [r4] + bl PutWindowTilemap + ldrb r0, [r4] + ldr r5, =0x0000021d + adds r1, r5, 0 + movs r2, 0xD0 + bl box_border_load_tiles_and_pal + ldrb r4, [r4] + bl sub_80247BC + adds r3, r0, 0 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0xD + bl sub_802482C + add sp, 0x18 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80248B0 + + thumb_func_start sub_8024918 +sub_8024918: @ 8024918 + push {r4,lr} + ldr r4, =0x02022c94 + ldrb r0, [r4] + bl ClearWindowTilemap + ldrb r0, [r4] + movs r1, 0x1 + bl sub_8198070 + ldrb r0, [r4] + bl RemoveWindow + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8024918 + + thumb_func_start sub_802493C +sub_802493C: @ 802493C + push {r4-r6,lr} + adds r5, r1, 0 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r1, =0x03000db0 + movs r0, 0 + str r0, [r1] + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _08024A10 + ldr r4, =0x02022c98 + ldr r0, =0x00003330 + bl AllocZeroed + str r0, [r4] + cmp r0, 0 + beq _08024A10 + bl sub_8024A1C + ldr r0, [r4] + bl sub_8024A30 + ldr r0, [r4] + str r5, [r0] + bl link_get_multiplayer_id + ldr r1, [r4] + adds r1, 0x28 + strb r0, [r1] + ldr r1, [r4] + ldr r2, =0x000032cc + adds r0, r1, r2 + adds r2, r1, 0 + adds r2, 0x28 + ldrb r3, [r2] + lsls r2, r3, 4 + subs r2, r3 + lsls r2, 2 + adds r1, r2 + ldr r2, =0x000031a0 + adds r1, r2 + movs r2, 0x3C + bl memcpy + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0x28 + ldrb r1, [r1] + lsls r1, 2 + ldr r2, =0x0000318c + adds r1, r2 + adds r0, r1 + movs r1, 0x64 + muls r1, r6 + ldr r2, =0x020244ec + adds r1, r2 + bl sub_80261F8 + ldr r0, =sub_8024BC8 + movs r1, 0x1 + bl AddTask + ldr r0, =sub_80261CC + bl SetMainCallback2 + bl sub_80273F0 + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x24 + ldrb r0, [r0] + adds r1, r2, 0 + adds r1, 0x44 + adds r2, 0x48 + bl sub_8026B5C + bl sub_80A2F30 + ldr r0, =0x0000021e + bl current_map_music_set + b _08024A16 + .pool +_08024A10: + adds r0, r5, 0 + bl SetMainCallback2 +_08024A16: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_802493C + + thumb_func_start sub_8024A1C +sub_8024A1C: @ 8024A1C + push {lr} + bl clear_tasks + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + pop {r0} + bx r0 + thumb_func_end sub_8024A1C + + thumb_func_start sub_8024A30 +sub_8024A30: @ 8024A30 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + adds r2, r0, 0 + movs r0, 0 + strb r0, [r2, 0xC] + strb r0, [r2, 0x10] + strb r0, [r2, 0x14] + strb r0, [r2, 0x18] + strb r0, [r2, 0x1C] + movs r3, 0x8E + lsls r3, 1 + adds r1, r2, r3 + str r0, [r1] + movs r7, 0x90 + lsls r7, 1 + adds r1, r2, r7 + str r0, [r1] + adds r1, r2, 0 + adds r1, 0x30 + strb r0, [r1] + adds r1, 0x10 + strb r0, [r1] + subs r1, 0x4 + strb r0, [r1] + adds r3, 0x10 + adds r1, r2, r3 + str r0, [r1] + movs r5, 0 + adds r1, r2, 0 + adds r1, 0x98 + movs r3, 0 +_08024A76: + adds r0, r1, r5 + strb r3, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _08024A76 + movs r5, 0 + adds r7, r2, 0 + adds r7, 0xA8 + str r7, [sp] + adds r0, r2, 0 + adds r0, 0xB0 + str r0, [sp, 0xC] + movs r1, 0x4A + adds r1, r2 + mov r10, r1 + movs r3, 0x4C + adds r3, r2 + mov r9, r3 + movs r7, 0x4E + adds r7, r2 + mov r12, r7 + subs r0, 0x60 + str r0, [sp, 0x24] + adds r6, r2, 0 + adds r6, 0x54 + adds r1, r2, 0 + adds r1, 0xD0 + str r1, [sp, 0x1C] + adds r3, r2, 0 + adds r3, 0xDC + str r3, [sp, 0x20] + adds r7, r2, 0 + adds r7, 0xC4 + str r7, [sp, 0x14] + adds r0, 0xA4 + str r0, [sp, 0x4] + adds r1, 0x25 + str r1, [sp, 0x8] + subs r3, 0xBC + str r3, [sp, 0x10] + movs r7, 0x24 + adds r7, r2 + mov r8, r7 + subs r0, 0xC0 + str r0, [sp, 0x18] + movs r3, 0 + movs r1, 0x86 + lsls r1, 1 + adds r4, r2, r1 + movs r7, 0x98 + lsls r7, 1 + adds r2, r7 +_08024AE2: + ldr r1, [sp] + adds r0, r1, r5 + strb r3, [r0] + ldr r7, [sp, 0xC] + adds r0, r7, r5 + strb r3, [r0] + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + mov r7, r10 + adds r1, r7, r0 + strh r3, [r1] + mov r7, r9 + adds r1, r7, r0 + strh r3, [r1] + mov r7, r12 + adds r1, r7, r0 + strh r3, [r1] + ldr r7, [sp, 0x24] + adds r1, r7, r0 + strh r3, [r1] + adds r0, r6, r0 + strh r3, [r0] + adds r0, r4, r5 + strb r3, [r0] + lsls r0, r5, 2 + adds r0, r2, r0 + str r3, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x4 + bls _08024AE2 + movs r5, 0 + movs r3, 0 + movs r4, 0xFF + ldr r6, [sp, 0x1C] +_08024B2C: + adds r0, r6, r5 + strb r3, [r0] + ldr r1, [sp, 0x20] + adds r0, r1, r5 + strb r3, [r0] + ldr r7, [sp, 0x14] + adds r0, r7, r5 + strb r3, [r0] + lsls r1, r5, 1 + ldr r0, [sp, 0x4] + adds r2, r0, r1 + ldrb r0, [r2] + orrs r0, r4 + strb r0, [r2] + ldr r7, [sp, 0x8] + adds r1, r7, r1 + ldrb r0, [r1] + orrs r0, r4 + strb r0, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0xA + bls _08024B2C + bl link_get_multiplayer_id + movs r1, 0 + lsls r0, 24 + cmp r0, 0 + bne _08024B6A + movs r1, 0x1 +_08024B6A: + ldr r0, [sp, 0x10] + strb r1, [r0] + bl sub_8009FCC + mov r1, r8 + strb r0, [r1] + bl link_get_multiplayer_id + ldr r3, [sp, 0x18] + strb r0, [r3] + movs r5, 0x1 + mov r7, r8 + ldrb r7, [r7] + cmp r5, r7 + bcs _08024BB6 + ldr r7, [sp, 0x18] + mov r6, r8 +_08024B8C: + adds r4, r7, r5 + subs r0, r5, 0x1 + adds r0, r7, r0 + ldrb r0, [r0] + adds r0, 0x1 + strb r0, [r4] + ldrb r2, [r4] + ldrb r1, [r6] + subs r0, r1, 0x1 + cmp r2, r0 + ble _08024BAA + adds r0, r2, 0 + bl __umodsi3 + strb r0, [r4] +_08024BAA: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldrb r0, [r6] + cmp r5, r0 + bcc _08024B8C +_08024BB6: + 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_8024A30 + + thumb_func_start sub_8024BC8 +sub_8024BC8: @ 8024BC8 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, =0x02022c98 + ldr r0, [r0] + ldrb r0, [r0, 0xC] + cmp r0, 0x7 + bls _08024BDC + b _08024D34 +_08024BDC: + lsls r0, 2 + ldr r1, =_08024BF0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08024BF0: + .4byte _08024C10 + .4byte _08024C24 + .4byte _08024C4C + .4byte _08024C5A + .4byte _08024C80 + .4byte _08024CD4 + .4byte _08024CE6 + .4byte _08024D10 +_08024C10: + movs r0, 0 + bl SetVBlankCallback + ldr r0, =sub_8025910 + movs r1, 0x4 + bl sub_802620C + b _08024D20 + .pool +_08024C24: + ldr r0, =sub_8025910 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + beq _08024C32 + b _08024D40 +_08024C32: + ldr r4, =0x02022c98 + ldr r0, [r4] + movs r1, 0xB0 + lsls r1, 1 + adds r0, r1 + bl sub_8029274 + ldr r1, [r4] + b _08024D24 + .pool +_08024C4C: + bl sub_802A770 + cmp r0, 0 + bne _08024D40 + bl sub_8010434 + b _08024D20 +_08024C5A: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08024D40 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _08024D20 + bl sub_800E0E8 + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + b _08024D20 + .pool +_08024C80: + ldr r0, =0x02022c98 + ldr r0, [r0] + adds r0, 0x24 + ldrb r5, [r0] + bl sub_80283A8 + movs r4, 0 + cmp r4, r5 + bcs _08024CBA +_08024C92: + ldr r0, =0x02022c98 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x34 + adds r0, r4 + ldrb r2, [r0] + lsls r0, r2, 2 + ldr r3, =0x0000318c + adds r0, r3 + adds r0, r1, r0 + adds r1, 0x24 + ldrb r3, [r1] + adds r1, r4, 0 + bl sub_8028408 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _08024C92 +_08024CBA: + ldr r4, =0x02022c98 + ldr r0, [r4] + adds r0, 0x24 + ldrb r1, [r0] + movs r0, 0 + bl sub_802868C + ldr r1, [r4] + b _08024D24 + .pool +_08024CD4: + bl sub_8028A34 + bl sub_8028A88 + bl sub_8028D44 + bl sub_8028734 + b _08024D20 +_08024CE6: + movs r4, 0x1 + negs r4, r4 + adds r0, r4, 0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r0, =sub_80261E4 + bl SetVBlankCallback + b _08024D20 + .pool +_08024D10: + bl fade_and_return_progress_probably + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08024D40 +_08024D20: + ldr r0, =0x02022c98 + ldr r1, [r0] +_08024D24: + ldrb r0, [r1, 0xC] + adds r0, 0x1 + strb r0, [r1, 0xC] + b _08024D40 + .pool +_08024D34: + adds r0, r1, 0 + bl remove_task + ldr r0, =sub_802589C + bl sub_802621C +_08024D40: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8024BC8 + + thumb_func_start sub_8024D4C +sub_8024D4C: @ 8024D4C + push {lr} + bl sub_8025D04 + ldr r1, =gUnknown_082F7AC4 + ldr r0, =0x02022c98 + ldr r0, [r0] + ldrb r0, [r0, 0x18] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, =0x03000db0 + ldr r0, [r0] + cmp r0, 0 + bne _08024D70 + bl sub_8026AF4 +_08024D70: + bl sub_8025D50 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8024D4C + + thumb_func_start sub_8024D84 +sub_8024D84: @ 8024D84 + push {lr} + bl sub_8025E0C + ldr r1, =gUnknown_082F7AF4 + ldr r0, =0x02022c98 + ldr r0, [r0] + ldrb r0, [r0, 0x18] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, =0x03000db0 + ldr r0, [r0] + cmp r0, 0 + bne _08024DA8 + bl sub_8026B28 +_08024DA8: + bl sub_8025ED8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8024D84 + + thumb_func_start sub_8024DBC +sub_8024DBC: @ 8024DBC + push {r4,lr} + ldr r4, =0x02022c98 + ldr r0, [r4] + ldrb r0, [r0, 0x10] + cmp r0, 0 + beq _08024DD4 + cmp r0, 0x1 + beq _08024DEA + b _08024DF8 + .pool +_08024DD4: + movs r0, 0x1 + bl sub_8028504 + movs r0, 0x1 + bl sub_80292E0 + ldr r1, [r4] + ldrb r0, [r1, 0x10] + adds r0, 0x1 + strb r0, [r1, 0x10] + b _08024DF8 +_08024DEA: + bl sub_802A770 + cmp r0, 0 + bne _08024DF8 + movs r0, 0x1 + bl sub_8026240 +_08024DF8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8024DBC + + thumb_func_start sub_8024E00 +sub_8024E00: @ 8024E00 + push {r4,lr} + ldr r4, =0x02022c98 + ldr r1, [r4] + ldrb r0, [r1, 0x10] + cmp r0, 0 + bne _08024E20 + bl sub_80262C0 + ldr r1, [r4] + ldrb r0, [r1, 0x10] + adds r0, 0x1 + strb r0, [r1, 0x10] + b _08024E30 + .pool +_08024E20: + movs r0, 0x8C + lsls r0, 1 + adds r1, r0 + movs r0, 0x1 + str r0, [r1] + movs r0, 0x2 + bl sub_8026240 +_08024E30: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8024E00 + + thumb_func_start sub_8024E38 +sub_8024E38: @ 8024E38 + push {r4,lr} + sub sp, 0x4 + ldr r1, =0x02022c98 + ldr r0, [r1] + ldrb r0, [r0, 0x10] + adds r4, r1, 0 + cmp r0, 0x5 + bhi _08024F08 + lsls r0, 2 + ldr r1, =_08024E5C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08024E5C: + .4byte _08024E74 + .4byte _08024E90 + .4byte _08024EA0 + .4byte _08024EC4 + .4byte _08024ED8 + .4byte _08024EF8 +_08024E74: + movs r0, 0 + str r0, [sp] + movs r0, 0x7 + movs r1, 0x8 + movs r2, 0x78 + movs r3, 0x50 + bl sub_802EB24 + ldr r0, =0x02022c98 + ldr r1, [r0] + b _08024EF0 + .pool +_08024E90: + bl sub_8010434 + ldr r0, =0x02022c98 + ldr r1, [r0] + b _08024EF0 + .pool +_08024EA0: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08024F08 + ldr r2, =0x02022c98 + ldr r1, [r2] + ldrb r0, [r1, 0x10] + adds r0, 0x1 + movs r3, 0 + strb r0, [r1, 0x10] + ldr r0, [r2] + adds r0, 0x30 + strb r3, [r0] + b _08024F08 + .pool +_08024EC4: + bl sub_802EB84 + cmp r0, 0 + bne _08024F08 + ldr r0, =0x02022c98 + ldr r1, [r0] + b _08024EF0 + .pool +_08024ED8: + ldr r1, [r4] + adds r1, 0x30 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bls _08024F08 + bl sub_8010434 + ldr r1, [r4] +_08024EF0: + ldrb r0, [r1, 0x10] + adds r0, 0x1 + strb r0, [r1, 0x10] + b _08024F08 +_08024EF8: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08024F08 + movs r0, 0x3 + bl sub_8026240 +_08024F08: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8024E38 + + thumb_func_start sub_8024F10 +sub_8024F10: @ 8024F10 + push {lr} + ldr r0, =0x02022c98 + ldr r1, [r0] + ldrb r0, [r1, 0x10] + cmp r0, 0 + bne _08024F2E + movs r2, 0x8E + lsls r2, 1 + adds r0, r1, r2 + ldr r0, [r0] + cmp r0, 0 + beq _08024F2E + movs r0, 0x4 + bl sub_8026240 +_08024F2E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8024F10 + + thumb_func_start sub_8024F38 +sub_8024F38: @ 8024F38 + push {r4,lr} + ldr r4, =0x02022c98 + ldr r2, [r4] + ldrb r0, [r2, 0x10] + cmp r0, 0 + bne _08024FF6 + adds r0, r2, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x9 + bhi _08024FE8 + adds r0, r2, 0 + adds r0, 0xA8 + ldrb r0, [r0] + cmp r0, 0 + bne _08024FEE + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08024F88 + ldr r1, =0x000031cc + adds r0, r2, r1 + ldrb r1, [r0] + cmp r1, 0 + bne _08024FEE + ldr r3, =0x000031d0 + adds r0, r2, r3 + strb r1, [r0] + movs r0, 0x2 + b _08024FC2 + .pool +_08024F88: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08024FA8 + ldr r3, =0x000031cc + adds r0, r2, r3 + ldrb r1, [r0] + cmp r1, 0 + bne _08024FEE + adds r3, 0x4 + adds r0, r2, r3 + strb r1, [r0] + movs r0, 0x1 + b _08024FC2 + .pool +_08024FA8: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08024FD4 + ldr r3, =0x000031cc + adds r0, r2, r3 + ldrb r1, [r0] + cmp r1, 0 + bne _08024FEE + adds r3, 0x4 + adds r0, r2, r3 + strb r1, [r0] + movs r0, 0x3 +_08024FC2: + bl sub_8027518 + ldr r1, [r4] + ldr r2, =0x000031cc + adds r1, r2 + strb r0, [r1] + b _08024FEE + .pool +_08024FD4: + movs r0, 0 + bl sub_8027518 + ldr r1, [r4] + ldr r3, =0x000031cc + adds r1, r3 + strb r0, [r1] + b _08024FEE + .pool +_08024FE8: + movs r0, 0xB + bl sub_8026240 +_08024FEE: + bl sub_802671C + bl sub_8025F48 +_08024FF6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8024F38 + + thumb_func_start sub_8024FFC +sub_8024FFC: @ 8024FFC + push {lr} + ldr r0, =0x02022c98 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x9 + bhi _080250C4 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0802504C + adds r0, r2, 0 + adds r0, 0x28 + ldrb r1, [r0] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 2 + adds r0, r2, r0 + ldr r1, =0x000031cc + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080250CA + ldr r3, =0x000032f8 + adds r1, r2, r3 + movs r0, 0x2 + strb r0, [r1] + b _080250CA + .pool +_0802504C: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08025080 + adds r0, r2, 0 + adds r0, 0x28 + ldrb r1, [r0] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 2 + adds r0, r2, r0 + ldr r1, =0x000031cc + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080250CA + ldr r3, =0x000032f8 + adds r1, r2, r3 + movs r0, 0x1 + strb r0, [r1] + b _080250CA + .pool +_08025080: + movs r0, 0x20 + ands r0, r1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _080250B8 + adds r0, r2, 0 + adds r0, 0x28 + ldrb r1, [r0] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 2 + adds r0, r2, r0 + ldr r1, =0x000031cc + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080250CA + ldr r3, =0x000032f8 + adds r1, r2, r3 + movs r0, 0x3 + strb r0, [r1] + b _080250CA + .pool +_080250B8: + ldr r3, =0x000032f8 + adds r0, r2, r3 + strb r1, [r0] + b _080250CA + .pool +_080250C4: + movs r0, 0xB + bl sub_8026240 +_080250CA: + bl sub_8026044 + pop {r0} + bx r0 + thumb_func_end sub_8024FFC + + thumb_func_start sub_80250D4 +sub_80250D4: @ 80250D4 + push {r4,r5,lr} + bl sub_802671C + bl sub_8025F48 + bl sub_8026C50 + cmp r0, 0x1 + bne _080250F2 + bl sub_80272A4 + movs r0, 0x5 + bl sub_8026240 + b _08025150 +_080250F2: + ldr r0, =0x02022c98 + ldr r2, [r0] + movs r1, 0x96 + lsls r1, 1 + adds r4, r2, r1 + movs r1, 0x1 + str r1, [r4] + movs r3, 0x1 + adds r1, r2, 0 + adds r1, 0x24 + adds r5, r0, 0 + ldrb r1, [r1] + cmp r3, r1 + bcs _08025150 + movs r1, 0x9A + lsls r1, 1 + adds r0, r2, r1 + ldr r0, [r0] + cmp r0, 0x1 + beq _08025124 + movs r0, 0 + str r0, [r4] + b _08025150 + .pool +_08025124: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, [r5] + adds r0, r2, 0 + adds r0, 0x24 + ldrb r0, [r0] + cmp r3, r0 + bcs _08025150 + lsls r0, r3, 2 + movs r4, 0x98 + lsls r4, 1 + adds r1, r2, r4 + adds r1, r0 + ldr r0, [r1] + cmp r0, 0x1 + beq _08025124 + movs r0, 0x96 + lsls r0, 1 + adds r1, r2, r0 + movs r0, 0 + str r0, [r1] +_08025150: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80250D4 + + thumb_func_start sub_8025158 +sub_8025158: @ 8025158 + push {lr} + bl sub_8026044 + bl sub_8026C90 + cmp r0, 0x1 + bne _0802516C + movs r0, 0x5 + bl sub_8026240 +_0802516C: + pop {r0} + bx r0 + thumb_func_end sub_8025158 + + thumb_func_start sub_8025170 +sub_8025170: @ 8025170 + push {r4,lr} + bl sub_800A550 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_800A9D8 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + beq _0802518C + movs r0, 0 + b _08025192 +_0802518C: + bl sub_800A5B4 + movs r0, 0x1 +_08025192: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8025170 + + thumb_func_start sub_8025198 +sub_8025198: @ 8025198 + push {r4,r5,lr} + ldr r5, =0x02022c98 + ldr r1, [r5] + ldrb r4, [r1, 0x10] + cmp r4, 0x1 + beq _080251D0 + cmp r4, 0x1 + bgt _080251B4 + cmp r4, 0 + beq _080251BA + b _0802520C + .pool +_080251B4: + cmp r4, 0x2 + beq _080251DC + b _0802520C +_080251BA: + adds r1, 0x4A + movs r0, 0 + movs r2, 0x3C + bl link_0800A448 + lsls r0, 24 + cmp r0, 0 + beq _08025226 + ldr r0, [r5] + strb r4, [r0, 0x8] + b _08025202 +_080251D0: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08025226 + b _08025202 +_080251DC: + bl sub_8025170 + cmp r0, 0 + beq _080251EE + ldr r0, [r5] + adds r1, r0, 0 + adds r1, 0x24 + ldrb r1, [r1] + strb r1, [r0, 0x8] +_080251EE: + ldr r2, [r5] + adds r1, r2, 0 + adds r1, 0x24 + ldrb r0, [r2, 0x8] + ldrb r1, [r1] + cmp r0, r1 + bcc _08025226 + ldrb r0, [r2, 0x14] + adds r0, 0x1 + strb r0, [r2, 0x14] +_08025202: + ldr r1, [r5] + ldrb r0, [r1, 0x10] + adds r0, 0x1 + strb r0, [r1, 0x10] + b _08025226 +_0802520C: + movs r0, 0x1 + bl ducking_tick + lsls r0, 24 + cmp r0, 0 + beq _08025226 + movs r0, 0x6 + bl sub_8026240 + ldr r0, =0x0000020b + movs r1, 0x4 + bl sub_80A2F88 +_08025226: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8025198 + + thumb_func_start sub_8025230 +sub_8025230: @ 8025230 + push {r4,r5,lr} + ldr r5, =0x02022c98 + ldr r2, [r5] + ldrb r4, [r2, 0x10] + cmp r4, 0x1 + beq _08025274 + cmp r4, 0x1 + bgt _0802524C + cmp r4, 0 + beq _08025252 + b _080252DC + .pool +_0802524C: + cmp r4, 0x2 + beq _08025282 + b _080252DC +_08025252: + ldrb r0, [r2, 0x14] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, 0x4A + adds r1, r2, r1 + movs r0, 0 + movs r2, 0x3C + bl link_0800A448 + lsls r0, 24 + cmp r0, 0 + beq _08025316 + ldr r0, [r5] + strb r4, [r0, 0x8] + ldr r1, [r5] + b _080252CC +_08025274: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08025316 + ldr r1, [r5] + b _080252CC +_08025282: + bl sub_8025170 + cmp r0, 0 + beq _080252B4 + movs r4, 0 + b _080252AA +_0802528E: + ldr r0, [r5] + adds r0, 0x4A + ldr r1, =0x020223c4 + movs r2, 0x3C + bl memcpy + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0x24 + ldrb r0, [r0] + strb r0, [r1, 0x8] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_080252AA: + ldr r0, [r5] + adds r0, 0x24 + ldrb r0, [r0] + cmp r4, r0 + bcc _0802528E +_080252B4: + ldr r3, =0x02022c98 + ldr r2, [r3] + adds r1, r2, 0 + adds r1, 0x24 + ldrb r0, [r2, 0x8] + ldrb r1, [r1] + cmp r0, r1 + bcc _08025316 + ldrb r0, [r2, 0x14] + adds r0, 0x1 + strb r0, [r2, 0x14] + ldr r1, [r3] +_080252CC: + ldrb r0, [r1, 0x10] + adds r0, 0x1 + strb r0, [r1, 0x10] + b _08025316 + .pool +_080252DC: + movs r0, 0x1 + bl ducking_tick + lsls r0, 24 + cmp r0, 0 + beq _08025316 + ldr r0, =0x02022c98 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x28 + ldrb r0, [r0] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r0, r2, 0 + adds r0, 0x54 + adds r0, r1 + ldrh r1, [r0] + movs r3, 0x8A + lsls r3, 1 + adds r0, r2, r3 + strh r1, [r0] + movs r0, 0x6 + bl sub_8026240 + ldr r0, =0x0000020b + movs r1, 0x4 + bl sub_80A2F88 +_08025316: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8025230 + + thumb_func_start sub_8025324 +sub_8025324: @ 8025324 + push {r4,r5,lr} + sub sp, 0x4 + movs r1, 0x1 + mov r0, sp + strb r1, [r0] + ldr r0, =0x02022c98 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0x4 + bls _0802533A + b _08025458 +_0802533A: + lsls r0, 2 + ldr r1, =_0802534C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0802534C: + .4byte _08025360 + .4byte _08025384 + .4byte _0802539C + .4byte _080253BC + .4byte _080253DC +_08025360: + bl sub_802749C + movs r0, 0x1 + bl sub_80289E8 + bl sub_8028DFC + movs r0, 0x1 + bl sub_8028EC8 + movs r0, 0x2 + bl sub_80292E0 + ldr r0, =0x02022c98 + ldr r1, [r0] + b _08025448 + .pool +_08025384: + bl sub_802A770 + cmp r0, 0 + bne _08025466 + movs r0, 0x5 + bl sub_80292E0 + ldr r0, =0x02022c98 + ldr r1, [r0] + b _08025448 + .pool +_0802539C: + bl sub_802A794 + mov r1, sp + strb r0, [r1] + movs r0, 0 + movs r2, 0x1 + bl link_0800A448 + lsls r0, 24 + cmp r0, 0 + beq _08025466 + ldr r0, =0x02022c98 + ldr r1, [r0] + b _08025448 + .pool +_080253BC: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08025466 + ldr r3, =0x02022c98 + ldr r1, [r3] + ldrb r0, [r1, 0x10] + adds r0, 0x1 + movs r2, 0 + strb r0, [r1, 0x10] + ldr r0, [r3] + strb r2, [r0, 0x8] + b _08025466 + .pool +_080253DC: + bl sub_8025170 + cmp r0, 0 + beq _08025422 + movs r2, 0 + ldr r1, =0x02022c98 + ldr r0, [r1] + adds r0, 0x24 + ldrb r0, [r0] + cmp r2, r0 + bcs _08025422 + adds r3, r1, 0 + movs r5, 0x86 + lsls r5, 1 + ldr r4, =0x020223c4 +_080253FA: + ldr r1, [r3] + adds r1, r2, r1 + adds r1, r5 + lsls r0, r2, 8 + adds r0, r4 + ldrb r0, [r0] + strb r0, [r1] + ldr r1, [r3] + adds r0, r1, 0 + adds r0, 0x24 + ldrb r0, [r0] + strb r0, [r1, 0x8] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, [r3] + adds r0, 0x24 + ldrb r0, [r0] + cmp r2, r0 + bcc _080253FA +_08025422: + ldr r4, =0x02022c98 + ldr r2, [r4] + adds r1, r2, 0 + adds r1, 0x24 + ldrb r0, [r2, 0x8] + ldrb r1, [r1] + cmp r0, r1 + bcc _08025466 + ldrb r0, [r2, 0x14] + adds r0, 0x1 + strb r0, [r2, 0x14] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x77 + bls _08025466 + movs r0, 0x6 + bl sub_80292E0 + ldr r1, [r4] +_08025448: + ldrb r0, [r1, 0x10] + adds r0, 0x1 + strb r0, [r1, 0x10] + b _08025466 + .pool +_08025458: + bl sub_802A770 + cmp r0, 0 + bne _08025466 + movs r0, 0x7 + bl sub_8026240 +_08025466: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8025324 + + thumb_func_start sub_8025470 +sub_8025470: @ 8025470 + push {r4,r5,lr} + sub sp, 0x4 + ldr r4, =0x02022c98 + ldr r0, [r4] + ldrb r0, [r0, 0x10] + cmp r0, 0x7 + bls _08025480 + b _08025606 +_08025480: + lsls r0, 2 + ldr r1, =_08025494 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08025494: + .4byte _080254B4 + .4byte _080254D4 + .4byte _080254F0 + .4byte _08025504 + .4byte _08025520 + .4byte _0802553C + .4byte _08025564 + .4byte _08025578 +_080254B4: + bl sub_8027748 + ldr r1, =0x00000bb7 + cmp r0, r1 + bls _080254C4 + movs r0, 0x4 + bl sub_80292E0 +_080254C4: + ldr r0, =0x02022c98 + ldr r1, [r0] + b _080255E8 + .pool +_080254D4: + bl sub_802A770 + cmp r0, 0 + beq _080254DE + b _0802563C +_080254DE: + movs r0, 0x3 + bl sub_80292E0 + ldr r0, =0x02022c98 + ldr r1, [r0] + b _080255E8 + .pool +_080254F0: + bl sub_8028FCC + bl sub_80272E8 + ldr r0, =0x02022c98 + ldr r1, [r0] + b _080255E8 + .pool +_08025504: + bl sub_802A794 + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + strb r0, [r1] + cmp r0, 0 + bne _08025516 + b _0802563C +_08025516: + ldr r0, =0x02022c98 + ldr r1, [r0] + b _080255E8 + .pool +_08025520: + bl sub_802A770 + cmp r0, 0 + beq _0802552A + b _0802563C +_0802552A: + movs r0, 0x5 + bl sub_80292E0 + ldr r0, =0x02022c98 + ldr r1, [r0] + b _080255E8 + .pool +_0802553C: + bl sub_802A794 + mov r1, sp + strb r0, [r1] + movs r0, 0 + movs r2, 0x1 + bl link_0800A448 + lsls r0, 24 + cmp r0, 0 + beq _0802563C + ldr r2, =0x02022c98 + ldr r1, [r2] + movs r0, 0 + strb r0, [r1, 0x8] + ldr r1, [r2] + b _080255E8 + .pool +_08025564: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _0802563C + ldr r0, =0x02022c98 + ldr r1, [r0] + b _080255E8 + .pool +_08025578: + bl sub_8025170 + cmp r0, 0 + beq _080255BE + movs r2, 0 + ldr r1, =0x02022c98 + ldr r0, [r1] + adds r0, 0x24 + ldrb r0, [r0] + cmp r2, r0 + bcs _080255BE + adds r3, r1, 0 + movs r5, 0x86 + lsls r5, 1 + ldr r4, =0x020223c4 +_08025596: + ldr r1, [r3] + adds r1, r2, r1 + adds r1, r5 + lsls r0, r2, 8 + adds r0, r4 + ldrb r0, [r0] + strb r0, [r1] + ldr r1, [r3] + adds r0, r1, 0 + adds r0, 0x24 + ldrb r0, [r0] + strb r0, [r1, 0x8] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, [r3] + adds r0, 0x24 + ldrb r0, [r0] + cmp r2, r0 + bcc _08025596 +_080255BE: + ldr r4, =0x02022c98 + ldr r2, [r4] + adds r1, r2, 0 + adds r1, 0x24 + ldrb r0, [r2, 0x8] + ldrb r1, [r1] + cmp r0, r1 + bcc _080255F8 + ldrb r0, [r2, 0x14] + adds r0, 0x1 + strb r0, [r2, 0x14] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x77 + bls _0802563C + bl sub_8027608 + movs r0, 0x6 + bl sub_80292E0 + ldr r1, [r4] +_080255E8: + ldrb r0, [r1, 0x10] + adds r0, 0x1 + strb r0, [r1, 0x10] + b _0802563C + .pool +_080255F8: + bl sub_8027554 + b _0802563C +_080255FE: + movs r0, 0x8 + bl sub_8026240 + b _0802563C +_08025606: + bl sub_802A770 + cmp r0, 0 + bne _0802563C + movs r2, 0 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x24 + ldrb r0, [r0] + cmp r2, r0 + bcs _08025636 + movs r4, 0x86 + lsls r4, 1 + adds r3, r1, r4 + adds r1, r0, 0 +_08025624: + adds r0, r3, r2 + ldrb r0, [r0] + cmp r0, 0x2 + beq _080255FE + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r1 + bcc _08025624 +_08025636: + movs r0, 0xA + bl sub_8026240 +_0802563C: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8025470 + + thumb_func_start sub_8025644 +sub_8025644: @ 8025644 + push {r4,lr} + ldr r4, =0x02022c98 + ldr r0, [r4] + ldrb r0, [r0, 0x10] + cmp r0, 0x1 + beq _08025672 + cmp r0, 0x1 + bgt _08025660 + cmp r0, 0 + beq _08025666 + b _08025692 + .pool +_08025660: + cmp r0, 0x2 + beq _0802567C + b _08025692 +_08025666: + bl sub_800AC34 + movs r0, 0x7 + bl sub_80292E0 + b _08025688 +_08025672: + bl sub_802A770 + cmp r0, 0 + bne _080256A0 + b _08025688 +_0802567C: + bl sub_802A794 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bne _080256A0 +_08025688: + ldr r1, [r4] + ldrb r0, [r1, 0x10] + adds r0, 0x1 + strb r0, [r1, 0x10] + b _080256A0 +_08025692: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _080256A0 + movs r0, 0x9 + bl sub_8026240 +_080256A0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8025644 + + thumb_func_start sub_80256AC +sub_80256AC: @ 80256AC + push {r4,lr} + sub sp, 0x4 + ldr r4, =0x02022c98 + ldr r0, [r4] + ldrb r1, [r0, 0x10] + cmp r1, 0x1 + beq _080256E0 + cmp r1, 0x1 + bgt _080256C8 + cmp r1, 0 + beq _080256CE + b _08025728 + .pool +_080256C8: + cmp r1, 0x2 + beq _080256F8 + b _08025728 +_080256CE: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + b _0802571A +_080256E0: + bl fade_and_return_progress_probably + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0802574C + b _0802571A + .pool +_080256F8: + bl sub_8028B80 + bl sub_80287E4 + ldr r0, [r4] + adds r0, 0x24 + ldrb r0, [r0] + bl sub_8028614 + bl sub_8028E84 + ldr r1, =0x03000db0 + movs r0, 0x1 + str r0, [r1] + movs r0, 0x8 + bl sub_80292E0 +_0802571A: + ldr r1, [r4] + ldrb r0, [r1, 0x10] + adds r0, 0x1 + strb r0, [r1, 0x10] + b _0802574C + .pool +_08025728: + bl sub_802A770 + cmp r0, 0 + bne _0802574C + ldr r4, =0x02022c98 + ldr r0, [r4] + ldr r0, [r0] + bl SetMainCallback2 + ldr r0, [r4] + ldrb r0, [r0, 0x4] + bl remove_task + ldr r0, [r4] + bl Free + bl FreeAllWindowBuffers +_0802574C: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80256AC + + thumb_func_start sub_8025758 +sub_8025758: @ 8025758 + push {r4,lr} + sub sp, 0x4 + ldr r4, =0x02022c98 + ldr r1, [r4] + ldrb r0, [r1, 0x10] + cmp r0, 0x6 + bls _08025768 + b _0802585C +_08025768: + lsls r0, 2 + ldr r1, =_0802577C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0802577C: + .4byte _08025798 + .4byte _08025838 + .4byte _080257B0 + .4byte _08025802 + .4byte _08025808 + .4byte _08025818 + .4byte _08025838 +_08025798: + movs r0, 0x9 + bl sub_80292E0 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + b _08025848 +_080257B0: + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + b _08025848 +_08025802: + bl sub_80A2F30 + b _08025848 +_08025808: + ldr r0, =0x0000021e + bl current_map_music_set + bl sub_8028E4C + b _08025848 + .pool +_08025818: + movs r4, 0x1 + negs r4, r4 + adds r0, r4, 0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + b _08025848 +_08025838: + bl fade_and_return_progress_probably + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0802588C +_08025848: + ldr r0, =0x02022c98 + ldr r1, [r0] + ldrb r0, [r1, 0x10] + adds r0, 0x1 + strb r0, [r1, 0x10] + b _0802588C + .pool +_0802585C: + ldrb r0, [r1, 0x4] + bl remove_task + ldr r0, =sub_802589C + bl sub_802621C + bl sub_802903C + ldr r0, [r4] + bl sub_8024A30 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _08025882 + ldr r0, [r4] + adds r0, 0x24 + movs r1, 0x1 + strb r1, [r0] +_08025882: + bl sub_80273F0 + movs r0, 0 + bl sub_8028EC8 +_0802588C: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8025758 + + thumb_func_start sub_802589C +sub_802589C: @ 802589C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x02022c98 + ldr r0, [r1] + ldrb r0, [r0, 0x10] + adds r4, r1, 0 + cmp r0, 0x1 + beq _080258C8 + cmp r0, 0x1 + bgt _080258BC + cmp r0, 0 + beq _080258C2 + b _080258E0 + .pool +_080258BC: + cmp r0, 0x2 + beq _080258CE + b _080258E0 +_080258C2: + bl sub_8026264 + b _080258D2 +_080258C8: + bl sub_80286E4 + b _080258D6 +_080258CE: + bl sub_8028828 +_080258D2: + cmp r0, 0x1 + bne _08025904 +_080258D6: + ldr r1, [r4] + ldrb r0, [r1, 0x10] + adds r0, 0x1 + strb r0, [r1, 0x10] + b _08025904 +_080258E0: + ldr r0, [r4] + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0 + beq _080258F8 + ldr r0, =sub_8024D4C + bl sub_802621C + b _080258FE + .pool +_080258F8: + ldr r0, =sub_8024D84 + bl sub_802621C +_080258FE: + adds r0, r5, 0 + bl remove_task +_08025904: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802589C + + thumb_func_start sub_8025910 +sub_8025910: @ 8025910 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r5, r0, r1 + movs r0, 0 + ldrsh r4, [r5, r0] + cmp r4, 0x1 + beq _0802596C + cmp r4, 0x1 + bgt _08025938 + cmp r4, 0 + beq _0802593E + b _080259E8 + .pool +_08025938: + cmp r4, 0x2 + beq _0802597E + b _080259E8 +_0802593E: + ldr r6, =0x02022c98 + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0x28 + ldrb r0, [r0] + lsls r0, 2 + ldr r2, =0x0000318c + adds r0, r2 + adds r1, r0 + movs r0, 0 + movs r2, 0x1 + bl link_0800A448 + lsls r0, 24 + cmp r0, 0 + beq _080259E8 + ldr r0, [r6] + strb r4, [r0, 0x8] + b _08025976 + .pool +_0802596C: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080259E8 +_08025976: + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + b _080259E8 +_0802597E: + bl sub_8025170 + cmp r0, 0 + beq _080259C4 + movs r2, 0 + ldr r1, =0x02022c98 + ldr r0, [r1] + adds r0, 0x24 + ldrb r0, [r0] + cmp r2, r0 + bcs _080259C4 + adds r3, r1, 0 + ldr r5, =0x020223c4 + ldr r4, =0x0000318c +_0802599A: + ldr r0, [r3] + lsls r1, r2, 2 + adds r1, r0 + adds r1, r4 + lsls r0, r2, 8 + adds r0, r5 + ldrb r0, [r0] + strb r0, [r1] + ldr r1, [r3] + adds r0, r1, 0 + adds r0, 0x24 + ldrb r0, [r0] + strb r0, [r1, 0x8] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, [r3] + adds r0, 0x24 + ldrb r0, [r0] + cmp r2, r0 + bcc _0802599A +_080259C4: + ldr r4, =0x02022c98 + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0x24 + ldrb r0, [r0, 0x8] + ldrb r1, [r1] + cmp r0, r1 + bcc _080259E8 + adds r0, r6, 0 + bl remove_task + movs r0, 0x6 + bl sub_80292E0 + ldr r1, [r4] + ldrb r0, [r1, 0x10] + adds r0, 0x1 + strb r0, [r1, 0x10] +_080259E8: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8025910 + + thumb_func_start sub_80259FC +sub_80259FC: @ 80259FC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x18 + ldr r6, =0x02022c98 + ldr r0, [r6] + adds r1, r0, 0 + adds r1, 0x24 + ldrb r7, [r1] + ldr r2, =0x000031a0 + adds r1, r0, r2 + ldr r3, =0x000031cc + adds r2, r0, r3 + ldr r4, =0x00003208 + adds r3, r0, r4 + ldr r5, =0x00003244 + adds r4, r0, r5 + str r4, [sp] + adds r5, 0x3C + adds r4, r0, r5 + str r4, [sp, 0x4] + adds r5, 0x3C + adds r4, r0, r5 + str r4, [sp, 0x8] + adds r4, r0, 0 + adds r4, 0x40 + str r4, [sp, 0xC] + movs r5, 0x90 + lsls r5, 1 + adds r4, r0, r5 + str r4, [sp, 0x10] + movs r4, 0x96 + lsls r4, 1 + adds r0, r4 + str r0, [sp, 0x14] + movs r0, 0 + bl sub_8028164 + ldr r1, [r6] + ldr r5, =0x000031b0 + adds r2, r1, r5 + str r0, [r2] + movs r0, 0x94 + lsls r0, 1 + adds r1, r0 + movs r0, 0x1 + strb r0, [r1] + movs r5, 0x1 + cmp r5, r7 + bcs _08025AA4 +_08025A60: + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0xA8 + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0 + bne _08025A9A + lsls r0, r5, 4 + subs r0, r5 + lsls r4, r0, 2 + adds r1, r4, r1 + ldr r2, =0x000031cc + adds r1, r2 + adds r0, r5, 0 + bl sub_8028318 + adds r1, r0, 0 + cmp r1, 0 + bne _08025A9A + ldr r0, [r6] + adds r0, r4 + ldr r3, =0x000031cc + adds r0, r3 + strb r1, [r0] + ldr r0, [r6] + movs r4, 0x94 + lsls r4, 1 + adds r0, r4 + strb r1, [r0] +_08025A9A: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r7 + bcc _08025A60 +_08025AA4: + ldr r5, =0x02022c98 + ldr r1, [r5] + movs r6, 0x92 + lsls r6, 1 + adds r1, r6 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3B + bls _08025B02 + ldr r1, [r5] + movs r2, 0x94 + lsls r2, 1 + adds r0, r1, r2 + ldrb r4, [r0] + cmp r4, 0 + beq _08025AF0 + bl sub_8011AC8 + ldr r0, [r5] + adds r0, r6 + movs r1, 0 + strb r1, [r0] + b _08025B02 + .pool +_08025AF0: + adds r0, r1, r6 + ldrb r0, [r0] + cmp r0, 0x46 + bls _08025B02 + bl sub_8011AC8 + ldr r0, [r5] + adds r0, r6 + strb r4, [r0] +_08025B02: + movs r5, 0 + cmp r5, r7 + bcs _08025BF6 + ldr r3, =0x000031cc + mov r12, r3 + ldr r4, =0x02022c98 + mov r8, r4 +_08025B10: + mov r6, r8 + ldr r2, [r6] + lsls r0, r5, 4 + subs r1, r0, r5 + lsls r1, 2 + adds r1, r2, r1 + add r1, r12 + ldrb r1, [r1] + adds r6, r0, 0 + cmp r1, 0 + beq _08025B36 + adds r0, r2, 0 + adds r0, 0xA8 + adds r1, r0, r5 + ldrb r0, [r1] + cmp r0, 0 + bne _08025B36 + movs r0, 0x1 + strb r0, [r1] +_08025B36: + adds r3, r4, 0 + ldr r1, [r3] + adds r0, r1, 0 + adds r0, 0xA8 + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0x3 + bgt _08025B54 + cmp r0, 0x1 + bge _08025B5A + b _08025BEC + .pool +_08025B54: + cmp r0, 0x4 + beq _08025BA8 + b _08025BEC +_08025B5A: + adds r1, 0xB0 + adds r1, r5 + ldrb r0, [r1] + adds r0, 0x1 + movs r2, 0 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bls _08025BEC + ldr r0, [r3] + adds r0, 0xB0 + adds r0, r5 + strb r2, [r0] + ldr r0, [r3] + adds r0, 0xA8 + adds r0, r5 + strb r2, [r0] + ldr r0, [r3] + subs r1, r6, r5 + lsls r1, 2 + adds r0, r1 + add r0, r12 + strb r2, [r0] + ldr r0, [r3] + adds r0, r1 + ldr r6, =0x000031d0 + adds r0, r6 + strb r2, [r0] + ldr r0, [r3] + adds r0, r1 + ldr r1, =0x000031d4 + adds r0, r1 + b _08025BEA + .pool +_08025BA8: + adds r1, 0xB0 + adds r1, r5 + ldrb r0, [r1] + adds r0, 0x1 + movs r2, 0 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x27 + bls _08025BEC + ldr r0, [r4] + adds r0, 0xB0 + adds r0, r5 + strb r2, [r0] + ldr r0, [r4] + adds r0, 0xA8 + adds r0, r5 + strb r2, [r0] + ldr r0, [r4] + subs r1, r6, r5 + lsls r1, 2 + adds r0, r1 + add r0, r12 + strb r2, [r0] + ldr r0, [r4] + adds r0, r1 + ldr r3, =0x000031d0 + adds r0, r3 + strb r2, [r0] + ldr r0, [r4] + adds r0, r1 + ldr r6, =0x000031d4 + adds r0, r6 +_08025BEA: + strb r2, [r0] +_08025BEC: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r7 + bcc _08025B10 +_08025BF6: + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80259FC + + thumb_func_start sub_8025C0C +sub_8025C0C: @ 8025C0C + push {r4-r7,lr} + sub sp, 0x18 + ldr r5, =0x02022c98 + ldr r0, [r5] + adds r1, r0, 0 + adds r1, 0x24 + ldrb r6, [r1] + ldr r2, =0x000031a0 + adds r1, r0, r2 + ldr r3, =0x000031cc + adds r2, r0, r3 + ldr r4, =0x00003208 + adds r3, r0, r4 + ldr r7, =0x00003244 + adds r4, r0, r7 + str r4, [sp] + adds r7, 0x3C + adds r4, r0, r7 + str r4, [sp, 0x4] + adds r7, 0x3C + adds r4, r0, r7 + str r4, [sp, 0x8] + adds r4, r0, 0 + adds r4, 0x40 + str r4, [sp, 0xC] + movs r7, 0x90 + lsls r7, 1 + adds r4, r0, r7 + str r4, [sp, 0x10] + movs r4, 0x96 + lsls r4, 1 + adds r0, r4 + str r0, [sp, 0x14] + movs r0, 0 + bl sub_8028164 + ldr r1, [r5] + ldr r7, =0x000031b0 + adds r2, r1, r7 + str r0, [r2] + movs r0, 0x94 + lsls r0, 1 + adds r1, r0 + movs r0, 0x1 + strb r0, [r1] + movs r4, 0x1 + cmp r4, r6 + bcs _08025C9C +_08025C6C: + adds r0, r4, 0 + bl sub_8028374 + cmp r0, 0 + beq _08025C92 + ldr r0, =0x02022c98 + ldr r2, [r0] + lsls r1, r4, 2 + movs r3, 0x98 + lsls r3, 1 + adds r0, r2, r3 + adds r0, r1 + movs r1, 0x1 + str r1, [r0] + movs r7, 0x94 + lsls r7, 1 + adds r1, r2, r7 + movs r0, 0 + strb r0, [r1] +_08025C92: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r6 + bcc _08025C6C +_08025C9C: + ldr r5, =0x02022c98 + ldr r1, [r5] + movs r6, 0x92 + lsls r6, 1 + adds r1, r6 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3B + bls _08025CFA + ldr r1, [r5] + movs r2, 0x94 + lsls r2, 1 + adds r0, r1, r2 + ldrb r4, [r0] + cmp r4, 0 + beq _08025CE8 + bl sub_8011AC8 + ldr r0, [r5] + adds r0, r6 + movs r1, 0 + strb r1, [r0] + b _08025CFA + .pool +_08025CE8: + adds r0, r1, r6 + ldrb r0, [r0] + cmp r0, 0x46 + bls _08025CFA + bl sub_8011AC8 + ldr r0, [r5] + adds r0, r6 + strb r4, [r0] +_08025CFA: + add sp, 0x18 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8025C0C + + thumb_func_start sub_8025D04 +sub_8025D04: @ 8025D04 + push {r4,r5,lr} + ldr r5, =0x02022c98 + ldr r0, [r5] + ldrb r0, [r0, 0x18] + cmp r0, 0x4 + beq _08025D40 + cmp r0, 0x4 + bgt _08025D20 + cmp r0, 0x3 + beq _08025D26 + b _08025D4A + .pool +_08025D20: + cmp r0, 0xB + beq _08025D46 + b _08025D4A +_08025D26: + bl sub_8026BB8 + adds r4, r0, 0 + cmp r4, 0x1 + bne _08025D4A + bl sub_8026C28 + ldr r0, [r5] + movs r1, 0x8E + lsls r1, 1 + adds r0, r1 + str r4, [r0] + b _08025D4A +_08025D40: + bl sub_80259FC + b _08025D4A +_08025D46: + bl sub_8025C0C +_08025D4A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8025D04 + + thumb_func_start sub_8025D50 +sub_8025D50: @ 8025D50 + push {r4-r6,lr} + sub sp, 0x14 + ldr r0, =0x02022c98 + ldr r5, [r0] + ldrb r0, [r5, 0x18] + cmp r0, 0x4 + beq _08025D68 + cmp r0, 0xB + beq _08025DB8 + b _08025DF4 + .pool +_08025D68: + ldr r1, =0x000032cc + adds r0, r5, r1 + ldr r2, =0x000031cc + adds r1, r5, r2 + ldr r3, =0x00003208 + adds r2, r5, r3 + ldr r4, =0x00003244 + adds r3, r5, r4 + movs r6, 0xCA + lsls r6, 6 + adds r4, r5, r6 + str r4, [sp] + adds r6, 0x3C + adds r4, r5, r6 + str r4, [sp, 0x4] + adds r4, r5, 0 + adds r4, 0x40 + ldrb r4, [r4] + str r4, [sp, 0x8] + movs r6, 0x90 + lsls r6, 1 + adds r4, r5, r6 + ldr r4, [r4] + str r4, [sp, 0xC] + adds r6, 0xC + adds r4, r5, r6 + ldr r4, [r4] + str r4, [sp, 0x10] + bl sub_8027E30 + b _08025DF4 + .pool +_08025DB8: + ldr r1, =0x000032cc + adds r0, r5, r1 + ldr r2, =0x000031cc + adds r1, r5, r2 + ldr r3, =0x00003208 + adds r2, r5, r3 + ldr r4, =0x00003244 + adds r3, r5, r4 + movs r6, 0xCA + lsls r6, 6 + adds r4, r5, r6 + str r4, [sp] + adds r6, 0x3C + adds r4, r5, r6 + str r4, [sp, 0x4] + adds r4, r5, 0 + adds r4, 0x40 + ldrb r4, [r4] + str r4, [sp, 0x8] + movs r6, 0x90 + lsls r6, 1 + adds r4, r5, r6 + ldr r4, [r4] + str r4, [sp, 0xC] + adds r6, 0xC + adds r4, r5, r6 + ldr r4, [r4] + str r4, [sp, 0x10] + bl sub_8027E30 +_08025DF4: + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8025D50 + + thumb_func_start sub_8025E0C +sub_8025E0C: @ 8025E0C + push {r4-r6,lr} + sub sp, 0x18 + ldr r0, =0x02022c98 + ldr r5, [r0] + ldrb r0, [r5, 0x18] + cmp r0, 0x4 + beq _08025E24 + cmp r0, 0xB + beq _08025E7C + b _08025EC0 + .pool +_08025E24: + adds r0, r5, 0 + adds r0, 0x28 + ldrb r0, [r0] + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 2 + ldr r2, =0x000031a0 + adds r1, r2 + adds r1, r5, r1 + ldr r3, =0x000031cc + adds r2, r5, r3 + ldr r4, =0x00003208 + adds r3, r5, r4 + ldr r6, =0x00003244 + adds r4, r5, r6 + str r4, [sp] + adds r6, 0x3C + adds r4, r5, r6 + str r4, [sp, 0x4] + adds r6, 0x3C + adds r4, r5, r6 + str r4, [sp, 0x8] + adds r4, r5, 0 + adds r4, 0x40 + str r4, [sp, 0xC] + movs r6, 0x90 + lsls r6, 1 + adds r4, r5, r6 + str r4, [sp, 0x10] + adds r6, 0xC + adds r4, r5, r6 + str r4, [sp, 0x14] + bl sub_8028164 + b _08025EC0 + .pool +_08025E7C: + adds r0, r5, 0 + adds r0, 0x28 + ldrb r0, [r0] + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 2 + ldr r2, =0x000031a0 + adds r1, r2 + adds r1, r5, r1 + ldr r3, =0x000031cc + adds r2, r5, r3 + ldr r4, =0x00003208 + adds r3, r5, r4 + ldr r6, =0x00003244 + adds r4, r5, r6 + str r4, [sp] + adds r6, 0x3C + adds r4, r5, r6 + str r4, [sp, 0x4] + adds r6, 0x3C + adds r4, r5, r6 + str r4, [sp, 0x8] + adds r4, r5, 0 + adds r4, 0x40 + str r4, [sp, 0xC] + movs r6, 0x90 + lsls r6, 1 + adds r4, r5, r6 + str r4, [sp, 0x10] + adds r6, 0xC + adds r4, r5, r6 + str r4, [sp, 0x14] + bl sub_8028164 +_08025EC0: + add sp, 0x18 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8025E0C + + thumb_func_start sub_8025ED8 +sub_8025ED8: @ 8025ED8 + push {r4,lr} + ldr r4, =0x02022c98 + ldr r1, [r4] + ldrb r0, [r1, 0x18] + cmp r0, 0x4 + beq _08025F0E + cmp r0, 0x4 + bgt _08025EF4 + cmp r0, 0x3 + beq _08025EFA + b _08025F40 + .pool +_08025EF4: + cmp r0, 0xB + beq _08025F24 + b _08025F40 +_08025EFA: + movs r0, 0x1 + bl sub_8027DD0 + ldr r0, [r4] + movs r1, 0x8E + lsls r1, 1 + adds r0, r1 + movs r1, 0x1 + str r1, [r0] + b _08025F40 +_08025F0E: + ldr r2, =0x000032f8 + adds r1, r2 + ldrb r0, [r1] + cmp r0, 0 + beq _08025F40 + bl sub_80282EC + b _08025F40 + .pool +_08025F24: + movs r2, 0x90 + lsls r2, 1 + adds r0, r1, r2 + ldr r0, [r0] + cmp r0, 0 + bne _08025F40 + adds r2, 0xC + adds r0, r1, r2 + ldr r0, [r0] + cmp r0, 0 + bne _08025F40 + movs r0, 0x1 + bl sub_8028350 +_08025F40: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8025ED8 + + thumb_func_start sub_8025F48 +sub_8025F48: @ 8025F48 + push {r4-r6,lr} + ldr r6, =0x02022c98 + ldr r2, [r6] + adds r0, r2, 0 + adds r0, 0x28 + ldrb r1, [r0] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 2 + adds r1, r2, r0 + ldr r3, =0x000031cc + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _08025F88 + bl mplay_has_finished_maybe + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _08025FEA + ldr r0, [r6] + movs r2, 0xA2 + lsls r2, 1 + adds r0, r2 + strb r1, [r0] + b _08025FEA + .pool +_08025F88: + ldr r3, =0x000031d0 + adds r0, r1, r3 + ldrb r4, [r0] + cmp r4, 0x1 + bne _08025FB8 + movs r1, 0xA2 + lsls r1, 1 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08025FEA + movs r0, 0x1F + bl m4aSongNumStop + movs r0, 0x1F + bl audio_play + ldr r0, [r6] + movs r2, 0xA2 + lsls r2, 1 + adds r0, r2 + b _08025FE8 + .pool +_08025FB8: + ldr r3, =0x000031d4 + adds r0, r1, r3 + ldrb r4, [r0] + cmp r4, 0x1 + bne _08025FEA + movs r5, 0xA2 + lsls r5, 1 + adds r0, r2, r5 + ldrb r0, [r0] + cmp r0, 0 + bne _08025FEA + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + bne _08025FEA + movs r0, 0x16 + bl audio_play + movs r0, 0x1 + bl sub_80284CC + ldr r0, [r6] + adds r0, r5 +_08025FE8: + strb r4, [r0] +_08025FEA: + ldr r0, =0x02022c98 + ldr r2, [r0] + movs r5, 0xAA + lsls r5, 1 + adds r1, r2, r5 + ldrb r1, [r1] + adds r4, r0, 0 + cmp r1, 0 + bne _0802601C + adds r0, r2, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x9 + bls _0802601C + bl sub_80A2F30 + ldr r0, [r4] + adds r0, r5 + movs r1, 0x1 + b _0802603A + .pool +_0802601C: + ldr r0, [r4] + movs r1, 0xAA + lsls r1, 1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0802603C + movs r0, 0xB + bl pause_music_for_sound_maybe + ldr r0, [r4] + movs r2, 0xAA + lsls r2, 1 + adds r0, r2 + movs r1, 0x2 +_0802603A: + strb r1, [r0] +_0802603C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8025F48 + + thumb_func_start sub_8026044 +sub_8026044: @ 8026044 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r6, =0x02022c98 + ldr r2, [r6] + adds r0, r2, 0 + adds r0, 0x44 + ldrb r0, [r0] + mov r8, r0 + adds r0, r2, 0 + adds r0, 0x48 + ldrb r7, [r0] + subs r0, 0x20 + ldrb r1, [r0] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 2 + adds r1, r2, r0 + ldr r3, =0x000031cc + adds r0, r1, r3 + ldrb r3, [r0] + cmp r3, 0 + bne _0802609C + ldr r4, =0x000031d0 + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080260FE + adds r4, 0x4 + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080260FE + movs r1, 0xA2 + lsls r1, 1 + adds r0, r2, r1 + strb r3, [r0] + b _080260FE + .pool +_0802609C: + ldr r3, =0x000031d0 + adds r0, r1, r3 + ldrb r4, [r0] + cmp r4, 0x1 + bne _080260CC + movs r1, 0xA2 + lsls r1, 1 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080260FE + movs r0, 0x1F + bl m4aSongNumStop + movs r0, 0x1F + bl audio_play + ldr r0, [r6] + movs r3, 0xA2 + lsls r3, 1 + adds r0, r3 + b _080260FC + .pool +_080260CC: + ldr r4, =0x000031d4 + adds r0, r1, r4 + ldrb r4, [r0] + cmp r4, 0x1 + bne _080260FE + movs r5, 0xA2 + lsls r5, 1 + adds r0, r2, r5 + ldrb r0, [r0] + cmp r0, 0 + bne _080260FE + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + bne _080260FE + movs r0, 0x16 + bl audio_play + movs r0, 0x1 + bl sub_80284CC + ldr r0, [r6] + adds r0, r5 +_080260FC: + strb r4, [r0] +_080260FE: + mov r4, r8 + cmp r4, r7 + bcs _08026172 + ldr r5, =0x02022c98 +_08026106: + ldr r2, [r5] + adds r0, r2, 0 + adds r0, 0x28 + ldrb r1, [r0] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 2 + ldr r1, =0x000031a0 + adds r0, r1 + adds r0, r2, r0 + adds r1, r0, 0 + adds r1, 0x14 + adds r0, 0x1F + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0x9 + bls _0802615C + movs r3, 0xA4 + lsls r3, 1 + adds r0, r2, r3 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _08026168 + adds r0, r1, r4 + ldrb r0, [r0] + adds r0, 0x4A + bl audio_play + ldr r0, [r5] + movs r1, 0xA4 + lsls r1, 1 + adds r0, r1 + adds r0, r4 + movs r1, 0x1 + b _08026166 + .pool +_0802615C: + movs r3, 0xA4 + lsls r3, 1 + adds r0, r2, r3 + adds r0, r4 + movs r1, 0 +_08026166: + strb r1, [r0] +_08026168: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r7 + bcc _08026106 +_08026172: + ldr r0, =0x02022c98 + ldr r2, [r0] + movs r5, 0xAA + lsls r5, 1 + adds r1, r2, r5 + ldrb r1, [r1] + adds r4, r0, 0 + cmp r1, 0 + bne _080261A0 + adds r0, r2, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x9 + bls _080261A0 + bl sub_80A2F30 + ldr r0, [r4] + adds r0, r5 + movs r1, 0x1 + b _080261BE + .pool +_080261A0: + ldr r0, [r4] + movs r1, 0xAA + lsls r1, 1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080261C0 + movs r0, 0xB + bl pause_music_for_sound_maybe + ldr r0, [r4] + movs r3, 0xAA + lsls r3, 1 + adds r0, r3 + movs r1, 0x2 +_080261BE: + strb r1, [r0] +_080261C0: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8026044 + + thumb_func_start sub_80261CC +sub_80261CC: @ 80261CC + push {lr} + bl RunActiveTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_80261CC + + thumb_func_start sub_80261E4 +sub_80261E4: @ 80261E4 + push {lr} + bl copy_pal_bg_faded_to_pal_ram + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + pop {r0} + bx r0 + thumb_func_end sub_80261E4 + + thumb_func_start sub_80261F8 +sub_80261F8: @ 80261F8 + push {r4,lr} + adds r4, r0, 0 + adds r0, r1, 0 + bl sub_806EBA4 + strb r0, [r4] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80261F8 + + thumb_func_start sub_802620C +sub_802620C: @ 802620C + push {lr} + lsls r1, 24 + lsrs r1, 24 + bl AddTask + pop {r0} + bx r0 + thumb_func_end sub_802620C + + thumb_func_start sub_802621C +sub_802621C: @ 802621C + push {lr} + movs r1, 0x1 + bl AddTask + ldr r1, =0x02022c98 + ldr r3, [r1] + movs r2, 0 + strb r0, [r3, 0x4] + ldr r0, [r1] + strb r2, [r0, 0x10] + ldr r0, [r1] + strb r2, [r0, 0xC] + ldr r0, [r1] + strb r2, [r0, 0x14] + pop {r0} + bx r0 + .pool + thumb_func_end sub_802621C + + thumb_func_start sub_8026240 +sub_8026240: @ 8026240 + push {r4,lr} + ldr r2, =0x02022c98 + ldr r1, [r2] + ldrb r3, [r1, 0x18] + movs r4, 0 + strb r3, [r1, 0x1C] + ldr r1, [r2] + strb r0, [r1, 0x18] + ldr r0, [r2] + strb r4, [r0, 0x10] + ldr r0, [r2] + strb r4, [r0, 0x14] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8026240 + + thumb_func_start sub_8026264 +sub_8026264: @ 8026264 + push {r4,lr} + ldr r3, =0x02022c98 + ldr r1, [r3] + ldrb r0, [r1, 0x14] + lsrs r2, r0, 2 + adds r0, 0x1 + strb r0, [r1, 0x14] + cmp r2, 0 + beq _080262B8 + ldr r3, [r3] + ldrb r0, [r3, 0x14] + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _080262B8 + ldr r1, =gUnknown_082F7A94 + adds r0, r3, 0 + adds r0, 0x24 + ldrb r0, [r0] + subs r0, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r2, r0 + bcc _080262A0 + movs r0, 0x1 + b _080262BA + .pool +_080262A0: + lsls r4, r2, 3 + adds r1, r4, 0 + movs r0, 0x14 + bl SetGpuReg + negs r4, r4 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0x18 + adds r1, r4, 0 + bl SetGpuReg +_080262B8: + movs r0, 0 +_080262BA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8026264 + + thumb_func_start sub_80262C0 +sub_80262C0: @ 80262C0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r2, =0x02022c98 + ldr r0, [r2] + adds r1, r0, 0 + adds r1, 0x44 + adds r0, 0x48 + ldrb r5, [r0] + ldrb r1, [r1] + cmp r1, r5 + bcs _0802630C + mov r8, r2 + ldr r0, =0x000032e0 + mov r12, r0 + movs r7, 0 + movs r6, 0x1 +_080262E2: + mov r2, r8 + ldr r0, [r2] + mov r2, r12 + adds r4, r0, r2 + ldr r2, =0x000032eb + adds r0, r2 + adds r2, r0, r1 + movs r3, 0 + adds r0, r1, 0 + ands r0, r6 + cmp r0, 0 + bne _080262FC + movs r3, 0x1 +_080262FC: + strb r3, [r2] + adds r0, r4, r1 + strb r7, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, r5 + bcc _080262E2 +_0802630C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80262C0 + + thumb_func_start sub_8026324 +sub_8026324: @ 8026324 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + ldr r0, =0x02022c98 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x44 + ldrb r0, [r0] + str r0, [sp] + adds r0, r1, 0 + adds r0, 0x48 + ldrb r0, [r0] + str r0, [sp, 0x4] + adds r0, r1, 0 + adds r0, 0x24 + ldrb r0, [r0] + str r0, [sp, 0x8] + adds r0, r1, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x9 + bls _08026358 + b _08026614 +_08026358: + movs r6, 0 + ldr r0, [sp, 0x8] + cmp r6, r0 + bcs _08026440 +_08026360: + ldr r3, =0x02022c98 + lsls r0, r6, 4 + subs r1, r0, r6 + lsls r1, 2 + ldr r2, [r3] + adds r1, r2 + ldr r4, =0x000031cc + adds r4, r1 + mov r8, r4 + ldrb r1, [r4] + mov r9, r0 + adds r0, r6, 0x1 + str r0, [sp, 0xC] + cmp r1, 0 + beq _08026434 + adds r0, r2, 0 + adds r0, 0xA8 + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08026434 + ldr r1, [sp] + mov r10, r1 + ldr r2, [sp, 0x4] + cmp r10, r2 + bcs _08026434 + adds r7, r3, 0 +_08026396: + ldr r0, =gUnknown_082F449C + add r0, r10 + ldrb r5, [r0] + ldr r1, [r7] + lsls r4, r5, 1 + adds r0, r1, 0 + adds r0, 0xF4 + adds r0, r4 + ldrb r0, [r0] + cmp r0, r6 + beq _08026434 + adds r0, r1, 0 + adds r0, 0xF5 + adds r0, r4 + ldrb r0, [r0] + cmp r0, r6 + beq _08026434 + mov r0, r8 + ldrb r1, [r0] + adds r0, r6, 0 + adds r2, r5, 0 + bl sub_8026634 + cmp r0, 0x1 + bne _08026410 + movs r2, 0 + ldr r3, =0x02022c98 + mov r8, r4 +_080263CE: + ldr r0, [r3] + mov r4, r8 + adds r1, r2, r4 + adds r0, 0xF4 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0xFF + bne _08026404 + strb r6, [r1] + ldr r0, [r3] + adds r0, 0xA8 + adds r0, r6 + movs r1, 0x2 + strb r1, [r0] + ldr r0, [r3] + adds r0, 0xC4 + adds r0, r5 + movs r1, 0x1 + strb r1, [r0] + b _08026434 + .pool +_08026404: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x1 + bls _080263CE + b _08026434 +_08026410: + ldr r0, [r7] + mov r2, r9 + subs r1, r2, r6 + lsls r1, 2 + adds r0, r1 + ldr r4, =0x000031d4 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08026434 + mov r0, r10 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r0, [sp, 0x4] + cmp r10, r0 + bcc _08026396 +_08026434: + ldr r1, [sp, 0xC] + lsls r0, r1, 24 + lsrs r6, r0, 24 + ldr r2, [sp, 0x8] + cmp r6, r2 + bcc _08026360 +_08026440: + ldr r4, [sp] + mov r10, r4 + ldr r0, [sp, 0x4] + cmp r10, r0 + bcc _0802644C + b _08026614 +_0802644C: + ldr r1, =0x02022c98 + mov r9, r1 +_08026450: + movs r6, 0xFF + ldr r0, =gUnknown_082F449C + add r0, r10 + ldrb r5, [r0] + mov r2, r9 + ldr r0, [r2] + adds r0, 0xC4 + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08026468 + b _08026602 +_08026468: + adds r0, r5, 0 + bl sub_8026D8C + mov r1, r9 + ldr r4, [r1] + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + adds r1, 0x90 + adds r1, r0 + ldrb r0, [r1] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x1 + bls _0802648E + movs r3, 0x2 +_0802648E: + ldr r2, =gUnknown_082F7A88 + ldr r0, =0x000031b4 + adds r1, r4, r0 + adds r1, r5 + lsls r0, r3, 1 + adds r0, r3 + ldrb r1, [r1] + adds r0, r1 + adds r0, r2 + ldrb r1, [r0] + adds r0, r4, 0 + adds r0, 0xD0 + adds r0, r5 + ldrb r0, [r0] + subs r2, r1, r0 + cmp r2, 0x5 + bgt _080264BC + adds r1, r4, 0 + adds r1, 0x9C + adds r1, r5 + ldrb r0, [r1] + adds r0, r2 + strb r0, [r1] +_080264BC: + mov r2, r9 + ldr r1, [r2] + adds r1, 0x9C + adds r1, r5 + ldrb r0, [r1] + adds r0, 0x1 + movs r2, 0 + strb r0, [r1] + movs r4, 0xFF + ands r0, r4 + cmp r0, 0x5 + bhi _080264D6 + b _08026602 +_080264D6: + mov r1, r9 + ldr r0, [r1] + adds r0, 0x9C + adds r0, r5 + strb r2, [r0] + ldr r3, [r1] + lsls r1, r5, 1 + adds r0, r3, 0 + adds r0, 0xF4 + adds r2, r0, r1 + ldrb r0, [r2] + mov r8, r1 + cmp r0, 0xFF + bne _08026518 + adds r0, r3, 0 + adds r0, 0xF5 + add r0, r8 + ldrb r0, [r0] + cmp r0, 0xFF + bne _08026500 + b _08026602 +_08026500: + b _08026528 + .pool +_08026518: + adds r0, r3, 0 + adds r0, 0xF5 + add r0, r8 + ldrb r0, [r0] + cmp r0, 0xFF + bne _08026528 + ldrb r4, [r2] + b _0802654E +_08026528: + mov r2, r9 + ldr r1, [r2] + adds r0, r1, 0 + adds r0, 0xF4 + add r0, r8 + ldrb r7, [r0] + adds r1, 0xF5 + add r1, r8 + ldrb r6, [r1] + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + bne _0802654A + adds r4, r7, 0 + b _0802654E +_0802654A: + adds r4, r6, 0 + adds r6, r7, 0 +_0802654E: + mov r1, r9 + ldr r0, [r1] + ldr r2, =0x000032eb + adds r0, r2 + adds r0, r5 + movs r1, 0x7 + strb r1, [r0] + mov r1, r9 + ldr r0, [r1] + adds r0, 0xC4 + adds r0, r5 + movs r1, 0x2 + strb r1, [r0] + mov r2, r9 + ldr r0, [r2] + adds r0, 0xA8 + adds r0, r4 + movs r1, 0x3 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0xB8 + adds r0, r5 + strb r4, [r0] + ldr r1, [r2] + lsls r0, r4, 4 + subs r0, r4 + lsls r0, 2 + adds r1, r0 + ldr r2, =0x000031d0 + adds r1, r2 + movs r0, 0x1 + strb r0, [r1] + mov r2, r9 + ldr r1, [r2] + lsls r0, r6, 4 + subs r0, r6 + lsls r0, 2 + adds r1, r0 + ldr r0, =0x000031d4 + adds r1, r0 + movs r2, 0x1 + strb r2, [r1] + mov r0, r9 + ldr r1, [r0] + lsls r0, r4, 1 + adds r1, 0x86 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + movs r0, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_8026F1C + movs r0, 0x1 + bl sub_8027234 + adds r0, r4, 0 + bl sub_8026D1C + mov r1, r9 + ldr r0, [r1] + adds r1, r0, 0 + adds r1, 0xE8 + adds r1, r5 + ldr r2, =0x000032e0 + adds r0, r2 + adds r0, r5 + ldrb r0, [r0] + strb r0, [r1] + mov r4, r9 + ldr r0, [r4] + adds r0, r2 + adds r0, r5 + movs r1, 0x3 + strb r1, [r0] + ldr r1, [r4] + adds r1, 0xF4 + add r1, r8 + ldrb r0, [r1] + movs r2, 0xFF + orrs r0, r2 + strb r0, [r1] + ldr r1, [r4] + adds r1, 0xF5 + add r1, r8 + ldrb r0, [r1] + orrs r0, r2 + strb r0, [r1] +_08026602: + mov r0, r10 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r4, [sp, 0x4] + cmp r10, r4 + bcs _08026614 + b _08026450 +_08026614: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8026324 + + thumb_func_start sub_8026634 +sub_8026634: @ 8026634 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + movs r7, 0 + ldr r2, =0x02022c98 + ldr r1, [r2] + adds r0, r1, 0 + adds r0, 0x24 + ldrb r0, [r0] + subs r0, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x000032e0 + adds r1, r0 + mov r12, r2 + cmp r3, 0x2 + beq _08026670 + cmp r3, 0x2 + bgt _08026676 + cmp r3, 0x1 + beq _08026674 + b _08026676 + .pool +_08026670: + movs r7, 0x1 + b _08026676 +_08026674: + movs r7, 0x2 +_08026676: + adds r0, r1, 0 + adds r0, 0xB + adds r0, r6 + ldrb r0, [r0] + subs r0, 0x6 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _080266D4 + ldr r0, =gUnknown_082F45AF + lsls r1, r4, 1 + adds r1, r4 + adds r1, r7, r1 + lsls r2, r5, 4 + subs r2, r5 + adds r1, r2 + adds r1, r0 + ldrb r1, [r1] + cmp r6, r1 + bne _0802670A + mov r0, r12 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xC4 + adds r0, r6 + ldrb r0, [r0] + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _080266D0 + lsls r0, r4, 4 + subs r0, r4 + lsls r0, 2 + adds r0, r1, r0 + ldr r1, =0x000031d4 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + b _0802670A + .pool +_080266D0: + movs r0, 0x1 + b _0802670C +_080266D4: + ldr r0, =gUnknown_082F45AF + lsls r1, r4, 1 + adds r1, r4 + adds r1, r7, r1 + lsls r2, r5, 4 + subs r2, r5 + adds r1, r2 + adds r1, r0 + ldrb r1, [r1] + cmp r6, r1 + bne _0802670A + mov r1, r12 + ldr r0, [r1] + adds r0, 0xA8 + adds r0, r4 + movs r1, 0x4 + strb r1, [r0] + mov r0, r12 + ldr r1, [r0] + lsls r0, r4, 4 + subs r0, r4 + lsls r0, 2 + adds r1, r0 + ldr r0, =0x000031d4 + adds r1, r0 + movs r0, 0x1 + strb r0, [r1] +_0802670A: + movs r0, 0 +_0802670C: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8026634 + + thumb_func_start sub_802671C +sub_802671C: @ 802671C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r2, =0x02022c98 + ldr r4, [r2] + adds r0, r4, 0 + adds r0, 0x44 + ldrb r1, [r0] + adds r0, 0x4 + ldrb r0, [r0] + mov r9, r0 + movs r3, 0 + mov r10, r3 + movs r5, 0x90 + lsls r5, 1 + adds r0, r4, r5 + str r3, [r0] + adds r5, r1, 0 + mov r0, r9 + subs r0, 0x1 + cmp r5, r0 + blt _0802674E + b _08026974 +_0802674E: + mov r8, r2 +_08026750: + mov r0, r8 + ldr r4, [r0] + adds r0, r4, 0 + adds r0, 0xC4 + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0x1 + bls _08026762 + b _0802686C +_08026762: + movs r1, 0x90 + lsls r1, 1 + adds r0, r4, r1 + movs r2, 0x1 + str r2, [r0] + ldr r1, =0x000032eb + adds r0, r4, r1 + adds r6, r0, r5 + ldrb r0, [r6] + cmp r0, 0x9 + bls _080267FC + movs r7, 0 + movs r0, 0xA + strb r0, [r6] + mov r1, r8 + ldr r0, [r1] + adds r0, 0xC4 + adds r0, r5 + movs r1, 0x3 + strb r1, [r0] + mov r1, r8 + ldr r0, [r1] + movs r6, 0xA4 + lsls r6, 1 + adds r0, r6 + adds r1, r0, r5 + ldrb r0, [r1] + cmp r0, 0 + bne _080267AC + strb r2, [r1] + ldr r2, =0x000032e0 + adds r0, r4, r2 + adds r0, r5 + ldrb r0, [r0] + adds r0, 0x4A + bl audio_play +_080267AC: + mov r0, r8 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x9 + bls _080267C2 + mov r2, r10 + cmp r2, 0x1 + beq _080267C2 + b _08026964 +_080267C2: + movs r0, 0x1 + mov r10, r0 + adds r0, r1, r6 + adds r0, r5 + strb r7, [r0] + mov r1, r8 + ldr r0, [r1] + adds r1, r0, 0 + adds r1, 0x40 + ldrb r0, [r1] + cmp r0, 0x9 + bhi _080267DE + adds r0, 0x1 + strb r0, [r1] +_080267DE: + movs r0, 0x3 + adds r1, r5, 0 + movs r2, 0 + bl sub_8026F1C + movs r0, 0 + bl sub_8027234 + b _08026964 + .pool +_080267FC: + adds r0, r5, 0 + bl sub_8026D8C + mov r2, r8 + ldr r7, [r2] + lsls r0, 24 + lsrs r0, 24 + adds r1, r7, 0 + adds r1, 0x90 + adds r1, r0 + ldrb r0, [r1] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x1 + bls _08026822 + movs r3, 0x2 +_08026822: + ldr r2, =gUnknown_082F7A88 + ldr r0, =0x000032e0 + adds r1, r4, r0 + adds r1, r5 + lsls r0, r3, 1 + adds r0, r3 + ldrb r1, [r1] + adds r0, r1 + adds r0, r2 + ldrb r2, [r0] + adds r1, r7, 0 + adds r1, 0xD0 + adds r1, r5 + ldrb r0, [r1] + adds r0, 0x1 + movs r3, 0 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, r2 + bcc _0802685C + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] + mov r1, r8 + ldr r0, [r1] + adds r0, 0xD0 + adds r0, r5 + strb r3, [r0] +_0802685C: + bl sub_8026324 + b _08026964 + .pool +_0802686C: + cmp r0, 0x2 + bne _080268F4 + movs r2, 0x90 + lsls r2, 1 + adds r0, r4, r2 + movs r6, 0x1 + str r6, [r0] + adds r1, r4, 0 + adds r1, 0xDC + adds r1, r5 + ldrb r0, [r1] + adds r0, 0x1 + movs r3, 0 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x13 + bls _08026964 + mov r0, r8 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0xB8 + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 2 + adds r2, r0 + ldr r1, =0x000031d0 + adds r2, r1 + strb r3, [r2] + mov r2, r8 + ldr r0, [r2] + adds r0, 0xDC + adds r0, r5 + strb r3, [r0] + ldr r0, [r2] + adds r0, 0xD0 + adds r0, r5 + strb r3, [r0] + ldr r0, [r2] + adds r0, 0xC4 + adds r0, r5 + strb r3, [r0] + ldr r1, =0x000032eb + adds r0, r4, r1 + adds r0, r5 + strb r6, [r0] + adds r0, r5, 0 + bl sub_8026D8C + lsls r0, 24 + lsrs r0, 24 + adds r1, r5, 0 + bl sub_8026DB0 + ldr r2, =0x000032e0 + adds r1, r4, r2 + adds r1, r5 + strb r0, [r1] + b _08026964 + .pool +_080268F4: + cmp r0, 0x3 + bne _08026964 + adds r1, r4, 0 + adds r1, 0xDC + adds r1, r5 + ldrb r0, [r1] + adds r0, 0x1 + movs r2, 0 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x13 + bls _08026964 + mov r0, r8 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x9 + bhi _08026964 + adds r0, r1, 0 + adds r0, 0xDC + adds r0, r5 + strb r2, [r0] + mov r1, r8 + ldr r0, [r1] + adds r0, 0xD0 + adds r0, r5 + strb r2, [r0] + ldr r0, [r1] + adds r0, 0xC4 + adds r0, r5 + strb r2, [r0] + ldr r2, =0x000032eb + adds r0, r4, r2 + adds r0, r5 + movs r1, 0x1 + strb r1, [r0] + mov r0, r8 + ldr r1, [r0] + adds r1, 0xE8 + adds r1, r5 + subs r2, 0xB + adds r4, r2 + adds r4, r5 + ldrb r0, [r4] + strb r0, [r1] + adds r0, r5, 0 + bl sub_8026D8C + lsls r0, 24 + lsrs r0, 24 + adds r1, r5, 0 + bl sub_8026DB0 + strb r0, [r4] +_08026964: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + mov r0, r9 + subs r0, 0x1 + cmp r5, r0 + bge _08026974 + b _08026750 +_08026974: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802671C + + thumb_func_start sub_8026988 +sub_8026988: @ 8026988 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r0, =0x02022c98 + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0x44 + adds r0, 0x48 + ldrb r0, [r0] + mov r8, r0 + ldrb r6, [r1] + cmp r6, r8 + bcs _08026A7A + ldr r0, =gUnknown_082F449C + mov r9, r0 +_080269A8: + ldr r0, =0x02022c98 + ldr r3, [r0] + adds r0, r3, 0 + adds r0, 0x28 + ldrb r1, [r0] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 2 + ldr r2, =0x000031a0 + adds r0, r2 + adds r7, r3, r0 + movs r0, 0xB + adds r2, r1, 0 + muls r2, r0 + adds r2, r6, r2 + adds r3, 0x24 + ldrb r1, [r3] + subs r1, 0x1 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 3 + subs r0, r1 + adds r2, r0 + add r2, r9 + ldrb r4, [r2] + adds r0, r7, 0 + adds r0, 0x1F + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _080269FC + adds r0, r6, 0 + movs r1, 0 + bl sub_8028BF8 + b _08026A04 + .pool +_080269FC: + adds r0, r6, 0 + movs r1, 0x1 + bl sub_8028BF8 +_08026A04: + adds r0, r7, 0 + adds r0, 0x1F + adds r5, r0, r4 + ldrb r0, [r5] + cmp r0, 0x9 + bls _08026A30 + adds r0, r7, 0 + adds r0, 0x14 + adds r0, r4 + ldrb r1, [r0] + adds r1, 0x3 + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + bl sub_8028CA4 + ldrb r1, [r5] + lsls r1, 25 + movs r0, 0xFF + lsls r0, 24 + adds r1, r0 + b _08026A52 +_08026A30: + adds r0, r7, 0 + adds r0, 0x14 + adds r3, r0, r4 + ldrb r0, [r3] + cmp r0, 0x3 + bne _08026A5C + movs r0, 0x7 + strb r0, [r5] + adds r0, r6, 0 + movs r1, 0x6 + bl sub_8028CA4 + ldrb r1, [r5] + lsls r1, 25 + movs r2, 0xFF + lsls r2, 24 + adds r1, r2 +_08026A52: + lsrs r1, 24 + adds r0, r6, 0 + bl sub_8028C7C + b _08026A70 +_08026A5C: + ldrb r1, [r3] + adds r0, r6, 0 + bl sub_8028CA4 + ldrb r1, [r5] + lsls r1, 25 + lsrs r1, 24 + adds r0, r6, 0 + bl sub_8028C7C +_08026A70: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, r8 + bcc _080269A8 +_08026A7A: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8026988 + + thumb_func_start sub_8026A88 +sub_8026A88: @ 8026A88 + push {r4-r6,lr} + ldr r1, =0x02022c98 + ldr r0, [r1] + adds r0, 0x24 + ldrb r5, [r0] + movs r4, 0 + cmp r4, r5 + bcs _08026ABA + adds r6, r1, 0 +_08026A9A: + lsls r0, r4, 4 + subs r0, r4 + lsls r0, 2 + ldr r1, [r6] + adds r0, r1 + ldr r1, =0x000031cc + adds r0, r1 + ldrb r1, [r0] + adds r0, r4, 0 + bl sub_80286B4 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _08026A9A +_08026ABA: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8026A88 + + thumb_func_start sub_8026AC8 +sub_8026AC8: @ 8026AC8 + push {r4,r5,lr} + ldr r0, =0x02022c98 + ldr r0, [r0] + adds r0, 0x24 + ldrb r5, [r0] + movs r4, 0 + cmp r4, r5 + bcs _08026AEA +_08026AD8: + adds r0, r4, 0 + movs r1, 0x4 + bl sub_80286B4 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _08026AD8 +_08026AEA: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8026AC8 + + thumb_func_start sub_8026AF4 +sub_8026AF4: @ 8026AF4 + push {lr} + bl sub_8026988 + ldr r0, =0x02022c98 + ldr r0, [r0] + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x9 + bls _08026B10 + bl sub_8026AC8 + b _08026B14 + .pool +_08026B10: + bl sub_8026A88 +_08026B14: + ldr r0, =0x02022c98 + ldr r0, [r0] + adds r0, 0x40 + ldrb r0, [r0] + bl sub_80288D4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8026AF4 + + thumb_func_start sub_8026B28 +sub_8026B28: @ 8026B28 + push {lr} + bl sub_8026988 + ldr r0, =0x02022c98 + ldr r0, [r0] + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x9 + bls _08026B44 + bl sub_8026AC8 + b _08026B48 + .pool +_08026B44: + bl sub_8026A88 +_08026B48: + ldr r0, =0x02022c98 + ldr r0, [r0] + adds r0, 0x40 + ldrb r0, [r0] + bl sub_80288D4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8026B28 + + thumb_func_start sub_8026B5C +sub_8026B5C: @ 8026B5C + push {lr} + adds r3, r1, 0 + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x1 + cmp r0, 0x4 + bhi _08026BB4 + lsls r0, 2 + ldr r1, =_08026B78 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08026B78: + .4byte _08026B8C + .4byte _08026B94 + .4byte _08026B9C + .4byte _08026BA4 + .4byte _08026BAC +_08026B8C: + movs r0, 0x4 + strb r0, [r3] + movs r0, 0x7 + b _08026BB2 +_08026B94: + movs r0, 0x3 + strb r0, [r3] + movs r0, 0x8 + b _08026BB2 +_08026B9C: + movs r0, 0x2 + strb r0, [r3] + movs r0, 0x9 + b _08026BB2 +_08026BA4: + movs r0, 0x1 + strb r0, [r3] + movs r0, 0xA + b _08026BB2 +_08026BAC: + movs r0, 0 + strb r0, [r3] + movs r0, 0xB +_08026BB2: + strb r0, [r2] +_08026BB4: + pop {r0} + bx r0 + thumb_func_end sub_8026B5C + + thumb_func_start sub_8026BB8 +sub_8026BB8: @ 8026BB8 + push {r4-r6,lr} + ldr r1, =0x02022c98 + ldr r0, [r1] + adds r0, 0x24 + ldrb r5, [r0] + movs r4, 0x1 + cmp r4, r5 + bcs _08026C1E + adds r6, r1, 0 +_08026BCA: + ldr r0, [r6] + movs r1, 0xAC + lsls r1, 1 + adds r0, r1 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _08026BEC + adds r0, r4, 0 + bl sub_8027DFC + ldr r1, [r6] + movs r2, 0xAC + lsls r2, 1 + adds r1, r2 + adds r1, r4 + strb r0, [r1] +_08026BEC: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _08026BCA + cmp r4, r5 + bcs _08026C1E + ldr r0, =0x02022c98 + ldr r0, [r0] + movs r2, 0xAC + lsls r2, 1 + adds r1, r0, r2 +_08026C04: + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _08026C14 + movs r0, 0 + b _08026C20 + .pool +_08026C14: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _08026C04 +_08026C1E: + movs r0, 0x1 +_08026C20: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8026BB8 + + thumb_func_start sub_8026C28 +sub_8026C28: @ 8026C28 + push {r4,lr} + movs r1, 0 + ldr r4, =0x02022c98 + movs r3, 0xAC + lsls r3, 1 + movs r2, 0 +_08026C34: + ldr r0, [r4] + adds r0, r3 + adds r0, r1 + strb r2, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x4 + bls _08026C34 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8026C28 + + thumb_func_start sub_8026C50 +sub_8026C50: @ 8026C50 + push {r4,lr} + ldr r3, =0x02022c98 + ldr r1, [r3] + adds r2, r1, 0 + adds r2, 0x40 + ldrb r0, [r2] + cmp r0, 0x9 + bls _08026C88 + movs r4, 0x90 + lsls r4, 1 + adds r0, r1, r4 + ldr r0, [r0] + cmp r0, 0 + bne _08026C88 + movs r0, 0xA + strb r0, [r2] + ldr r0, [r3] + movs r1, 0x96 + lsls r1, 1 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + beq _08026C88 + movs r0, 0x1 + b _08026C8A + .pool +_08026C88: + movs r0, 0 +_08026C8A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8026C50 + + thumb_func_start sub_8026C90 +sub_8026C90: @ 8026C90 + push {r4-r6,lr} + ldr r4, =0x02022c98 + ldr r1, [r4] + adds r2, r1, 0 + adds r2, 0x40 + ldrb r0, [r2] + cmp r0, 0x9 + bls _08026D14 + adds r0, r1, 0 + adds r0, 0x44 + ldrb r3, [r0] + adds r0, 0x4 + ldrb r5, [r0] + movs r0, 0xA + strb r0, [r2] + ldr r4, [r4] + mov r12, r4 + movs r0, 0x96 + lsls r0, 1 + add r0, r12 + ldr r0, [r0] + cmp r0, 0 + beq _08026D14 + adds r4, r3, 0 + cmp r4, r5 + bcs _08026D04 + mov r0, r12 + adds r0, 0x28 + ldrb r3, [r0] + lsls r1, r3, 4 + subs r1, r3 + lsls r1, 2 + ldr r6, =gUnknown_082F449C + subs r0, 0x4 + ldrb r2, [r0] + subs r2, 0x1 + add r1, r12 + movs r0, 0xB + muls r3, r0 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 3 + subs r2, r0, r2 + ldr r0, =0x000031bf + adds r1, r0 +_08026CEA: + adds r0, r4, r3 + adds r0, r2 + adds r0, r6 + ldrb r0, [r0] + adds r0, r1, r0 + ldrb r0, [r0] + cmp r0, 0xA + bne _08026D14 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _08026CEA +_08026D04: + movs r0, 0x1 + b _08026D16 + .pool +_08026D14: + movs r0, 0 +_08026D16: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8026C90 + + thumb_func_start sub_8026D1C +sub_8026D1C: @ 8026D1C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_082F7A9C + mov r8, r0 + ldr r0, =0x02022c98 + ldr r6, [r0] + adds r0, r6, 0 + adds r0, 0x90 + adds r0, r5 + mov r9, r0 + ldrb r7, [r0] + adds r0, r7, 0 + movs r1, 0x7 + bl __umodsi3 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + add r4, r8 + adds r0, r7, 0 + movs r1, 0x7 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldrb r4, [r4] + adds r0, r4 + lsls r0, 24 + lsls r5, 1 + adds r6, 0x86 + adds r6, r5 + ldrh r1, [r6] + lsrs r0, 24 + cmp r1, r0 + bcc _08026D76 + adds r0, r7, 0x1 + mov r1, r9 + strb r0, [r1] +_08026D76: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8026D1C + + thumb_func_start sub_8026D8C +sub_8026D8C: @ 8026D8C + lsls r0, 24 + lsrs r0, 24 + ldr r3, =gUnknown_082F4648 + ldr r1, =0x02022c98 + ldr r1, [r1] + adds r1, 0x24 + ldrb r1, [r1] + subs r1, 0x1 + movs r2, 0xB + muls r1, r2 + adds r0, r1 + adds r0, r3 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_8026D8C + + thumb_func_start sub_8026DB0 +sub_8026DB0: @ 8026DB0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r4, =0x02022c98 + ldr r1, [r4] + adds r1, 0x24 + ldrb r2, [r1] + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldr r3, =gUnknown_082F45FA + lsls r1, r0, 1 + adds r1, r0 + lsls r0, r2, 4 + subs r0, r2 + adds r1, r0 + adds r0, r1, r3 + ldrb r0, [r0] + mov r12, r0 + adds r0, r3, 0x1 + adds r0, r1, r0 + ldrb r7, [r0] + adds r3, 0x2 + adds r1, r3 + ldrb r1, [r1] + mov r8, r1 + movs r3, 0 + ldr r1, =gUnknown_082F467F + lsls r0, r2, 2 + adds r2, r0, r2 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08026E18 + adds r6, r1, 0 +_08026DFE: + adds r0, r3, r2 + adds r0, r6 + ldrb r0, [r0] + cmp r5, r0 + beq _08026E3C + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + adds r0, r3, r2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08026DFE +_08026E18: + ldr r0, [r4] + adds r0, 0x90 + mov r1, r12 + adds r2, r0, r1 + adds r1, r0, r7 + ldrb r0, [r2] + ldrb r3, [r1] + cmp r0, r3 + bls _08026E46 + adds r1, r0, 0 + b _08026E48 + .pool +_08026E3C: + ldr r0, [r4] + adds r0, 0x90 + adds r0, r7 + ldrb r0, [r0] + b _08026E5A +_08026E46: + ldrb r1, [r1] +_08026E48: + ldr r0, [r4] + adds r0, 0x90 + mov r2, r8 + adds r4, r0, r2 + ldrb r0, [r4] + cmp r0, r1 + bls _08026E58 + adds r1, r0, 0 +_08026E58: + adds r0, r1, 0 +_08026E5A: + adds r1, r5, 0 + bl sub_8026E70 + lsls r0, 24 + lsrs r0, 24 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8026DB0 + + thumb_func_start sub_8026E70 +sub_8026E70: @ 8026E70 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =0x02022c98 + ldr r2, [r2] + adds r2, 0xE8 + adds r2, r1 + ldrb r4, [r2] + movs r1, 0x7 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6 + bhi _08026EDE + lsls r0, 2 + ldr r1, =_08026EA4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08026EA4: + .4byte _08026EDE + .4byte _08026ED6 + .4byte _08026EE2 + .4byte _08026EC0 + .4byte _08026EC6 + .4byte _08026ECC + .4byte _08026ED2 +_08026EC0: + cmp r4, 0 + beq _08026ED6 + b _08026EDE +_08026EC6: + cmp r4, 0 + beq _08026EE2 + b _08026EDE +_08026ECC: + cmp r4, 0x2 + beq _08026ED6 + b _08026EE2 +_08026ED2: + cmp r4, 0 + bne _08026EDA +_08026ED6: + movs r0, 0x1 + b _08026EE4 +_08026EDA: + cmp r4, 0x1 + beq _08026EE2 +_08026EDE: + movs r0, 0 + b _08026EE4 +_08026EE2: + movs r0, 0x2 +_08026EE4: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8026E70 + + thumb_func_start sub_8026EEC +sub_8026EEC: @ 8026EEC + push {r4-r6,lr} + movs r6, 0 + movs r5, 0 + adds r4, r0, 0 + b _08026EFE +_08026EF6: + ldrh r0, [r4, 0x6] + adds r6, r0 + adds r4, 0xC + adds r5, 0x1 +_08026EFE: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + blt _08026EF6 + cmp r6, 0xA + bgt _08026F12 + movs r0, 0 + b _08026F14 +_08026F12: + movs r0, 0x1 +_08026F14: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8026EEC + + thumb_func_start sub_8026F1C +sub_8026F1C: @ 8026F1C + push {r4-r6,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + lsls r2, 24 + lsrs r2, 24 + ldr r6, =0x02022c98 + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0x24 + ldrb r5, [r0] + cmp r3, 0 + bge _08026F3A + b _0802722C +_08026F3A: + cmp r3, 0x2 + ble _08026F48 + cmp r3, 0x3 + beq _08026F78 + b _0802722C + .pool +_08026F48: + ldr r3, =0x000031b4 + adds r0, r1, r3 + adds r0, r4 + ldrb r4, [r0] + lsls r4, 1 + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r4, r0 + adds r0, r1, 0 + adds r0, 0x4A + adds r0, r4 + ldrh r0, [r0] + ldr r1, =0x00004e20 + bl sub_8027A28 + ldr r1, [r6] + adds r1, 0x4A + adds r1, r4 + b _0802722A + .pool +_08026F78: + adds r0, r1, 0 + adds r0, 0x4A + bl sub_8026EEC + cmp r0, 0 + beq _08026F86 + b _0802722C +_08026F86: + cmp r5, 0x3 + bne _08026F8C + b _08027154 +_08026F8C: + cmp r5, 0x3 + bgt _08026F98 + cmp r5, 0x2 + bne _08026F96 + b _080271E8 +_08026F96: + b _0802722C +_08026F98: + cmp r5, 0x4 + bne _08026F9E + b _08027090 +_08026F9E: + cmp r5, 0x5 + beq _08026FA4 + b _0802722C +_08026FA4: + cmp r4, 0x9 + bls _08026FAA + b _0802722C +_08026FAA: + lsls r0, r4, 2 + ldr r1, =_08026FB8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08026FB8: + .4byte _08026FE0 + .4byte _08026FF8 + .4byte _08027004 + .4byte _0802701C + .4byte _08027028 + .4byte _08027040 + .4byte _0802704C + .4byte _08027060 + .4byte _0802706C + .4byte _08027084 +_08026FE0: + ldr r0, =0x02022c98 + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0x68 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + adds r1, 0x74 + b _08027226 + .pool +_08026FF8: + ldr r0, =0x02022c98 + ldr r1, [r0] + adds r1, 0x74 + b _08027226 + .pool +_08027004: + ldr r0, =0x02022c98 + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0x74 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + adds r1, 0x80 + b _08027226 + .pool +_0802701C: + ldr r0, =0x02022c98 + ldr r1, [r0] + adds r1, 0x80 + b _08027226 + .pool +_08027028: + ldr r0, =0x02022c98 + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0x80 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + adds r1, 0x50 + b _08027226 + .pool +_08027040: + ldr r0, =0x02022c98 + ldr r1, [r0] + adds r1, 0x50 + b _08027226 + .pool +_0802704C: + ldr r0, =0x02022c98 + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0x50 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + b _08027224 + .pool +_08027060: + ldr r0, =0x02022c98 + ldr r1, [r0] + b _08027224 + .pool +_0802706C: + ldr r0, =0x02022c98 + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0x5C + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + adds r1, 0x68 + b _08027226 + .pool +_08027084: + ldr r0, =0x02022c98 + ldr r1, [r0] + adds r1, 0x68 + b _08027226 + .pool +_08027090: + subs r0, r4, 0x1 + cmp r0, 0x7 + bls _08027098 + b _0802722C +_08027098: + lsls r0, 2 + ldr r1, =_080270A8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080270A8: + .4byte _080270C8 + .4byte _080270E0 + .4byte _080270EC + .4byte _08027104 + .4byte _08027110 + .4byte _08027124 + .4byte _08027130 + .4byte _08027148 +_080270C8: + ldr r0, =0x02022c98 + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0x68 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + adds r1, 0x74 + b _08027226 + .pool +_080270E0: + ldr r0, =0x02022c98 + ldr r1, [r0] + adds r1, 0x74 + b _08027226 + .pool +_080270EC: + ldr r0, =0x02022c98 + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0x74 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + adds r1, 0x50 + b _08027226 + .pool +_08027104: + ldr r0, =0x02022c98 + ldr r1, [r0] + adds r1, 0x50 + b _08027226 + .pool +_08027110: + ldr r0, =0x02022c98 + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0x50 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + b _08027224 + .pool +_08027124: + ldr r0, =0x02022c98 + ldr r1, [r0] + b _08027224 + .pool +_08027130: + ldr r0, =0x02022c98 + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0x5C + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + adds r1, 0x68 + b _08027226 + .pool +_08027148: + ldr r0, =0x02022c98 + ldr r1, [r0] + adds r1, 0x68 + b _08027226 + .pool +_08027154: + subs r0, r4, 0x2 + cmp r0, 0x5 + bhi _0802722C + lsls r0, 2 + ldr r1, =_08027168 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08027168: + .4byte _08027180 + .4byte _08027198 + .4byte _080271A4 + .4byte _080271BC + .4byte _080271C8 + .4byte _080271DC +_08027180: + ldr r0, =0x02022c98 + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0x5C + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + adds r1, 0x68 + b _08027226 + .pool +_08027198: + ldr r0, =0x02022c98 + ldr r1, [r0] + adds r1, 0x68 + b _08027226 + .pool +_080271A4: + ldr r0, =0x02022c98 + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0x68 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + adds r1, 0x50 + b _08027226 + .pool +_080271BC: + ldr r0, =0x02022c98 + ldr r1, [r0] + adds r1, 0x50 + b _08027226 + .pool +_080271C8: + ldr r0, =0x02022c98 + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0x50 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + b _08027224 + .pool +_080271DC: + ldr r0, =0x02022c98 + ldr r1, [r0] + b _08027224 + .pool +_080271E8: + cmp r4, 0x4 + beq _0802720E + cmp r4, 0x4 + bgt _080271F6 + cmp r4, 0x3 + beq _08027200 + b _0802722C +_080271F6: + cmp r4, 0x5 + beq _08027214 + cmp r4, 0x6 + beq _08027222 + b _0802722C +_08027200: + ldr r1, [r6] + adds r2, r1, 0 + adds r2, 0x50 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + b _08027224 +_0802720E: + ldr r1, [r6] + adds r1, 0x50 + b _08027226 +_08027214: + ldr r1, [r6] + adds r2, r1, 0 + adds r2, 0x50 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + b _08027224 +_08027222: + ldr r1, [r6] +_08027224: + adds r1, 0x5C +_08027226: + ldrh r0, [r1] + adds r0, 0x1 +_0802722A: + strh r0, [r1] +_0802722C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8026F1C + + thumb_func_start sub_8027234 +sub_8027234: @ 8027234 + push {r4,r5,lr} + adds r1, r0, 0 + ldr r4, =0x02022c98 + ldr r3, [r4] + adds r0, r3, 0 + adds r0, 0x24 + ldrb r0, [r0] + cmp r0, 0x5 + bne _0802729E + cmp r1, 0x1 + bne _08027280 + movs r5, 0x89 + lsls r5, 1 + adds r1, r3, r5 + ldrh r0, [r1] + adds r2, r0, 0x1 + strh r2, [r1] + movs r0, 0x8A + lsls r0, 1 + adds r1, r3, r0 + lsls r0, r2, 16 + lsrs r0, 16 + ldrh r3, [r1] + cmp r0, r3 + bls _08027268 + strh r2, [r1] +_08027268: + ldr r0, [r4] + adds r2, r0, r5 + ldrh r0, [r2] + ldr r1, =0x0000270f + cmp r0, r1 + bls _0802729E + strh r1, [r2] + b _0802729E + .pool +_08027280: + movs r2, 0x89 + lsls r2, 1 + adds r0, r3, r2 + movs r5, 0x8A + lsls r5, 1 + adds r1, r3, r5 + ldrh r0, [r0] + ldrh r3, [r1] + cmp r0, r3 + bls _08027296 + strh r0, [r1] +_08027296: + ldr r0, [r4] + adds r0, r2 + movs r1, 0 + strh r1, [r0] +_0802729E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8027234 + + thumb_func_start sub_80272A4 +sub_80272A4: @ 80272A4 + push {r4,r5,lr} + movs r3, 0 + ldr r2, =0x02022c98 + ldr r0, [r2] + adds r0, 0x24 + ldrb r0, [r0] + cmp r3, r0 + bcs _080272DC + adds r5, r2, 0 + movs r4, 0x8A + lsls r4, 1 +_080272BA: + ldr r2, [r5] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r1, r2, 0 + adds r1, 0x54 + adds r1, r0 + adds r0, r2, r4 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + adds r2, 0x24 + ldrb r2, [r2] + cmp r3, r2 + bcc _080272BA +_080272DC: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80272A4 + + thumb_func_start sub_80272E8 +sub_80272E8: @ 80272E8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r5, 0 + ldr r7, =0x02022c98 + movs r4, 0 + ldr r0, =0x000031bf + mov r10, r0 +_080272FC: + movs r2, 0 + lsls r6, r5, 4 + lsls r1, r5, 1 + mov r8, r1 + lsls r0, r5, 3 + mov r12, r0 + adds r1, r5, 0x1 + mov r9, r1 + subs r0, r6, r5 + lsls r3, r0, 2 +_08027310: + ldr r0, [r7] + adds r1, r2, r3 + add r0, r10 + adds r0, r1 + strb r4, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xA + bls _08027310 + ldr r0, [r7] + subs r1, r6, r5 + lsls r1, 2 + adds r0, r1 + ldr r2, =0x000031cc + adds r0, r2 + strb r4, [r0] + ldr r0, [r7] + adds r0, r1 + ldr r1, =0x000031d0 + adds r0, r1 + strb r4, [r0] + ldr r0, [r7] + adds r0, 0x90 + adds r0, r5 + strb r4, [r0] + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0x86 + add r0, r8 + strh r4, [r0] + add r1, r12 + ldr r2, =0x00003308 + adds r1, r2 + strb r4, [r1] + ldr r2, [r7] + ldr r1, =0x0000330c + adds r0, r2, r1 + add r0, r12 + str r4, [r0] + mov r0, r8 + adds r1, r0, r5 + lsls r1, 2 + adds r0, r2, 0 + adds r0, 0x4A + adds r0, r1 + strh r4, [r0] + adds r0, r2, 0 + adds r0, 0x4C + adds r0, r1 + strh r4, [r0] + adds r0, r2, 0 + adds r0, 0x4E + adds r0, r1 + strh r4, [r0] + adds r0, r2, 0 + adds r0, 0x50 + adds r0, r1 + strh r4, [r0] + adds r0, r2, 0 + adds r0, 0x52 + adds r0, r1 + strh r4, [r0] + adds r0, r2, 0 + adds r0, 0x54 + adds r0, r1 + strh r4, [r0] + mov r1, r9 + lsls r0, r1, 24 + lsrs r5, r0, 24 + cmp r5, 0x4 + bls _080272FC + ldr r2, =0x02022c98 + ldr r0, [r2] + movs r1, 0xAA + lsls r1, 1 + adds r0, r1 + movs r2, 0 + strb r2, [r0] + ldr r1, =0x02022c98 + ldr r0, [r1] + movs r1, 0x89 + lsls r1, 1 + adds r3, r0, r1 + movs r1, 0 + strh r2, [r3] + adds r0, 0x40 + strb r1, [r0] + bl sub_8026A88 + bl sub_8026988 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80272E8 + + thumb_func_start sub_80273F0 +sub_80273F0: @ 80273F0 + push {r4,r5,lr} + movs r4, 0 + ldr r0, =0x02022c98 + ldr r0, [r0] + adds r0, 0x24 + ldrb r0, [r0] + cmp r0, 0x4 + beq _0802740C + cmp r0, 0x5 + beq _08027410 + b _08027412 + .pool +_0802740C: + movs r4, 0x1 + b _08027412 +_08027410: + movs r4, 0x2 +_08027412: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + movs r3, 0 + lsls r1, r4, 2 + ldr r5, =0x02022c98 + ldr r2, =gUnknown_082F7AA4 + adds r1, r4 + lsls r1, 1 + adds r0, r1 + adds r0, r2 + ldrb r2, [r0] +_08027436: + ldr r1, [r5] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r1, 0x52 + adds r1, r0 + strh r2, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x4 + bls _08027436 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80273F0 + + thumb_func_start sub_802745C +sub_802745C: @ 802745C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022c98 + ldr r2, [r1] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r0, r2, 0 + adds r0, 0x4A + adds r0, r1 + ldrh r3, [r0] + adds r0, r2, 0 + adds r0, 0x4C + adds r0, r1 + ldrh r0, [r0] + adds r2, 0x4E + adds r2, r1 + adds r3, r0 + ldrh r2, [r2] + adds r0, r3, r2 + ldr r1, =0x0000270f + cmp r0, r1 + bls _0802748E + adds r0, r1, 0 +_0802748E: + pop {r1} + bx r1 + .pool + thumb_func_end sub_802745C + + thumb_func_start sub_802749C +sub_802749C: @ 802749C + push {r4-r6,lr} + ldr r5, =0x02022c98 + ldr r0, [r5] + adds r0, 0x28 + ldrb r0, [r0] + bl sub_802745C + ldr r1, =0x0000270f + bl sub_8027A38 + adds r4, r0, 0 + ldr r0, [r5] + adds r0, 0x28 + ldrb r0, [r0] + bl sub_80276C0 + ldr r1, =0x000f4236 + bl sub_8027A38 + adds r2, r0, 0 + ldr r3, =0x03005d90 + ldr r0, [r3] + movs r6, 0x83 + lsls r6, 2 + adds r1, r0, r6 + ldr r0, [r1] + cmp r0, r2 + bcs _080274D6 + str r2, [r1] +_080274D6: + ldr r0, [r3] + movs r2, 0x84 + lsls r2, 2 + adds r1, r0, r2 + ldrh r0, [r1] + cmp r0, r4 + bcs _080274E6 + strh r4, [r1] +_080274E6: + ldr r0, [r3] + ldr r6, =0x00000212 + adds r2, r0, r6 + ldr r0, [r5] + movs r1, 0x8A + lsls r1, 1 + adds r0, r1 + ldrh r1, [r0] + ldrh r0, [r2] + cmp r0, r1 + bcs _080274FE + strh r1, [r2] +_080274FE: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802749C + + thumb_func_start sub_8027518 +sub_8027518: @ 8027518 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =0x02022c98 + ldr r0, [r1] + adds r0, 0x9B + ldrb r6, [r0] + movs r3, 0x3 + adds r5, r1, 0 + adds r4, r5, 0 +_0802752C: + ldr r0, [r4] + adds r0, 0x98 + adds r2, r0, r3 + subs r1, r3, 0x1 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + lsls r1, 24 + lsrs r3, r1, 24 + cmp r3, 0 + bne _0802752C + ldr r0, [r5] + adds r0, 0x98 + strb r7, [r0] + adds r0, r6, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8027518 + + thumb_func_start sub_8027554 +sub_8027554: @ 8027554 + push {r4,lr} + ldr r4, =0x02022c98 + ldr r3, [r4] + adds r0, r3, 0 + adds r0, 0x28 + ldrb r1, [r0] + adds r0, 0x88 + adds r2, r0, r1 + ldrb r0, [r2] + cmp r0, 0 + bne _080275FC + ldr r0, =0x030022c0 + ldrh r2, [r0, 0x2E] + movs r0, 0x40 + ands r0, r2 + cmp r0, 0 + beq _08027594 + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 2 + adds r0, r3, r0 + ldr r1, =0x000031cc + adds r0, r1 + movs r1, 0x2 + b _080275CA + .pool +_08027594: + movs r0, 0x20 + ands r0, r2 + cmp r0, 0 + beq _080275B0 + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 2 + adds r0, r3, r0 + ldr r1, =0x000031cc + adds r0, r1 + movs r1, 0x3 + b _080275CA + .pool +_080275B0: + movs r0, 0x10 + ands r0, r2 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0 + beq _080275E8 + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 2 + adds r0, r3, r0 + ldr r1, =0x000031cc + adds r0, r1 + movs r1, 0x1 +_080275CA: + strb r1, [r0] + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0x28 + adds r0, 0xB0 + ldrb r1, [r1] + adds r0, r1 + movs r1, 0x6 + strb r1, [r0] + movs r0, 0xD4 + bl audio_play + b _08027600 + .pool +_080275E8: + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 2 + adds r0, r3, r0 + ldr r1, =0x000031cc + adds r0, r1 + strb r2, [r0] + b _08027600 + .pool +_080275FC: + subs r0, 0x1 + strb r0, [r2] +_08027600: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8027554 + + thumb_func_start sub_8027608 +sub_8027608: @ 8027608 + ldr r0, =0x02022c98 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x28 + ldrb r2, [r0] + lsls r0, r2, 4 + subs r0, r2 + lsls r0, 2 + adds r1, r0 + ldr r0, =0x000031cc + adds r1, r0 + movs r0, 0 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_8027608 + + thumb_func_start sub_802762C +sub_802762C: @ 802762C + ldr r0, =0x02022c98 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x28 + ldrb r2, [r0] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r1, 0x52 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x85 + lsls r0, 16 + lsrs r0, 16 + bx lr + .pool + thumb_func_end sub_802762C + + thumb_func_start sub_8027650 +sub_8027650: @ 8027650 + ldr r0, =0x02022c98 + ldr r0, [r0] + adds r0, 0x24 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_8027650 + + thumb_func_start sub_8027660 +sub_8027660: @ 8027660 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _0802768C + ldr r0, =0x02022c98 + lsls r1, r2, 4 + subs r1, r2 + lsls r1, 2 + ldr r2, =0x000031a0 + adds r1, r2 + ldr r0, [r0] + b _08027694 + .pool +_0802768C: + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + ldr r1, =0x020229f0 +_08027694: + adds r0, r1 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8027660 + + thumb_func_start sub_80276A0 +sub_80276A0: @ 80276A0 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + ldr r2, =0x02022c98 + ldr r3, [r2] + lsrs r1, 23 + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + adds r1, r2 + adds r3, 0x4A + adds r3, r1 + ldrh r0, [r3] + bx lr + .pool + thumb_func_end sub_80276A0 + + thumb_func_start sub_80276C0 +sub_80276C0: @ 80276C0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + movs r5, 0 + movs r3, 0 + ldr r0, =0x02022c98 + mov r9, r0 + ldr r2, =gUnknown_082F7B24 + mov r10, r2 + ldr r2, [r0] + lsls r1, r4, 1 + adds r0, r1, r4 + lsls r0, 2 + str r0, [sp] + adds r6, r2, 0 + adds r6, 0x4A + mov r12, r1 + mov r8, r10 +_080276EE: + lsls r1, r3, 1 + ldr r7, [sp] + adds r0, r1, r7 + adds r0, r6, r0 + ldrh r2, [r0] + add r1, r8 + movs r7, 0 + ldrsh r0, [r1, r7] + muls r0, r2 + adds r5, r0 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x2 + bls _080276EE + mov r0, r9 + ldr r1, [r0] + mov r2, r12 + adds r0, r2, r4 + lsls r0, 2 + adds r1, 0x50 + adds r1, r0 + ldrh r1, [r1] + mov r3, r10 + movs r7, 0x6 + ldrsh r0, [r3, r7] + muls r0, r1 + cmp r5, r0 + bls _08027734 + subs r0, r5, r0 + b _08027736 + .pool +_08027734: + movs r0, 0 +_08027736: + 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_80276C0 + + thumb_func_start sub_8027748 +sub_8027748: @ 8027748 + push {r4-r6,lr} + ldr r0, =0x02022c98 + ldr r0, [r0] + adds r0, 0x24 + ldrb r6, [r0] + movs r0, 0 + bl sub_80276C0 + adds r5, r0, 0 + movs r4, 0x1 + cmp r4, r6 + bcs _08027776 +_08027760: + adds r0, r4, 0 + bl sub_80276C0 + cmp r0, r5 + bls _0802776C + adds r5, r0, 0 +_0802776C: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r6 + bcc _08027760 +_08027776: + ldr r1, =0x000f4236 + adds r0, r5, 0 + bl sub_8027A38 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8027748 + + thumb_func_start sub_802778C +sub_802778C: @ 802778C + push {r4,r5,lr} + lsls r0, 24 + ldr r1, =0x02022c98 + ldr r2, [r1] + adds r1, r2, 0 + adds r1, 0x24 + ldrb r5, [r1] + lsrs r4, r0, 23 + adds r2, 0x4A + adds r0, r2, r4 + ldrh r3, [r0] + movs r1, 0 + cmp r1, r5 + bcs _080277C4 +_080277A8: + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r4, r0 + adds r0, r2, r0 + ldrh r0, [r0] + cmp r0, r3 + bls _080277BA + adds r3, r0, 0 +_080277BA: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, r5 + bcc _080277A8 +_080277C4: + adds r0, r3, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_802778C + + thumb_func_start sub_80277D0 +sub_80277D0: @ 80277D0 + push {r4-r7,lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r7, r0, 24 + movs r6, 0x1 + ldr r0, =0x02022c98 + ldr r0, [r0] + adds r0, 0x24 + ldrb r5, [r0] + movs r4, 0 + cmp r4, r5 + bcs _080277FE +_080277E8: + adds r0, r4, 0 + bl sub_80276C0 + lsls r1, r4, 2 + add r1, sp + str r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _080277E8 +_080277FE: + lsls r7, 2 + mov r12, r7 + cmp r6, 0 + beq _08027838 + subs r7, r5, 0x1 +_08027808: + movs r6, 0 + movs r4, 0 + cmp r6, r7 + bge _08027834 + adds r5, r7, 0 +_08027812: + lsls r0, r4, 2 + mov r2, sp + adds r1, r2, r0 + adds r4, 0x1 + lsls r0, r4, 2 + adds r3, r2, r0 + ldr r0, [r1] + ldr r2, [r3] + cmp r0, r2 + bcs _0802782C + str r2, [r1] + str r0, [r3] + movs r6, 0x1 +_0802782C: + lsls r0, r4, 24 + lsrs r4, r0, 24 + cmp r4, r5 + blt _08027812 +_08027834: + cmp r6, 0 + bne _08027808 +_08027838: + mov r0, sp + add r0, r12 + ldr r0, [r0] + add sp, 0x14 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80277D0 + + thumb_func_start sub_802784C +sub_802784C: @ 802784C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r0, 0 + mov r10, r0 + mov r8, r0 + mov r9, r0 + ldr r6, =0x02022c98 + ldr r0, [r6] + adds r0, 0x24 + ldrb r5, [r0] + bl sub_8027748 + bl sub_8027748 + cmp r0, 0 + bne _080278A0 + movs r4, 0 + cmp r9, r5 + bcs _080278A0 + adds r2, r6, 0 + ldr r1, =0x00003308 + mov r12, r1 + movs r7, 0 + movs r6, 0x4 + ldr r3, =0x0000330c +_08027884: + ldr r0, [r2] + lsls r1, r4, 3 + adds r0, r1 + add r0, r12 + strb r6, [r0] + ldr r0, [r2] + adds r0, r3 + adds r0, r1 + str r7, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _08027884 +_080278A0: + movs r4, 0 + cmp r4, r5 + bcs _080278CA +_080278A6: + adds r0, r4, 0 + bl sub_80276C0 + ldr r1, =0x000f4236 + bl sub_8027A38 + ldr r1, =0x02022c98 + ldr r1, [r1] + lsls r2, r4, 3 + ldr r3, =0x0000330c + adds r1, r3 + adds r1, r2 + str r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _080278A6 +_080278CA: + mov r0, r10 + bl sub_80277D0 + adds r6, r0, 0 + mov r3, r8 + movs r4, 0 + cmp r4, r5 + bcs _08027916 + ldr r7, =0x02022c98 + mov r10, r7 +_080278DE: + mov r0, r10 + ldr r2, [r0] + lsls r1, r4, 3 + ldr r7, =0x0000330c + adds r0, r2, r7 + adds r0, r1 + ldr r0, [r0] + cmp r6, r0 + bne _0802790C + adds r0, r2, r1 + ldr r1, =0x00003308 + adds r0, r1 + strb r3, [r0] + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_0802790C: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _080278DE +_08027916: + mov r10, r8 + cmp r9, r5 + bcc _080278CA + movs r0, 0 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_802784C + + thumb_func_start sub_802793C +sub_802793C: @ 802793C + lsls r1, 24 + ldr r2, =0x02022c98 + ldr r2, [r2] + lsrs r1, 21 + ldr r3, =0x00003308 + adds r2, r3 + adds r2, r1 + ldr r1, [r2] + ldr r2, [r2, 0x4] + str r1, [r0] + str r2, [r0, 0x4] + bx lr + .pool + thumb_func_end sub_802793C + + thumb_func_start sub_802795C +sub_802795C: @ 802795C + push {r4-r7,lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r6, r0, 24 + movs r7, 0 + ldr r0, =0x02022c98 + ldr r0, [r0] + adds r0, 0x24 + ldrb r5, [r0] + mov r0, sp + movs r1, 0 + movs r2, 0x14 + bl memset + movs r4, 0 + cmp r7, r5 + bcs _08027994 +_0802797E: + adds r0, r4, 0 + bl sub_80276C0 + lsls r1, r4, 2 + add r1, sp + str r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _0802797E +_08027994: + lsls r0, r6, 2 + add r0, sp + ldr r1, [r0] + movs r4, 0 +_0802799C: + cmp r4, r6 + beq _080279B0 + lsls r0, r4, 2 + add r0, sp + ldr r0, [r0] + cmp r1, r0 + bcs _080279B0 + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 +_080279B0: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _0802799C + adds r0, r7, 0 + add sp, 0x14 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_802795C + + thumb_func_start sub_80279C8 +sub_80279C8: @ 80279C8 + push {r4-r6,lr} + ldr r0, =0x02022c98 + ldr r0, [r0] + adds r0, 0x28 + ldrb r4, [r0] + bl sub_802762C + lsls r0, 16 + lsrs r5, r0, 16 + adds r6, r5, 0 + adds r0, r4, 0 + bl sub_80276C0 + adds r4, r0, 0 + bl sub_8027748 + cmp r4, r0 + beq _080279F4 + movs r0, 0x3 + b _08027A22 + .pool +_080279F4: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80D6800 + lsls r0, 24 + cmp r0, 0 + bne _08027A06 + movs r0, 0x2 + b _08027A22 +_08027A06: + adds r0, r6, 0 + movs r1, 0x1 + bl bag_add_item + adds r0, r6, 0 + movs r1, 0x1 + bl sub_80D6800 + lsls r0, 24 + cmp r0, 0 + beq _08027A20 + movs r0, 0 + b _08027A22 +_08027A20: + movs r0, 0x1 +_08027A22: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80279C8 + + thumb_func_start sub_8027A28 +sub_8027A28: @ 8027A28 + push {lr} + adds r2, r0, 0 + adds r0, r1, 0 + cmp r2, r0 + bcs _08027A34 + adds r0, r2, 0x1 +_08027A34: + pop {r1} + bx r1 + thumb_func_end sub_8027A28 + + thumb_func_start sub_8027A38 +sub_8027A38: @ 8027A38 + push {lr} + adds r2, r0, 0 + adds r0, r1, 0 + cmp r2, r0 + bcs _08027A44 + adds r0, r2, 0 +_08027A44: + pop {r1} + bx r1 + thumb_func_end sub_8027A38 + + thumb_func_start sub_8027A48 +sub_8027A48: @ 8027A48 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022c98 + ldr r1, [r1] + adds r1, 0x34 + adds r1, r0 + ldrb r0, [r1] + bx lr + .pool + thumb_func_end sub_8027A48 + + thumb_func_start sub_8027A5C +sub_8027A5C: @ 8027A5C + push {r4-r6,lr} + movs r5, 0 + ldr r6, =0x020375f0 +_08027A62: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x5 + bl pokemon_getattr + cmp r0, 0 + beq _08027A94 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0x55 + bne _08027A94 + movs r0, 0x1 + strh r0, [r6] + b _08027AA0 + .pool +_08027A94: + adds r5, 0x1 + cmp r5, 0x5 + ble _08027A62 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] +_08027AA0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8027A5C + + thumb_func_start sub_8027AAC +sub_8027AAC: @ 8027AAC + push {r4,lr} + ldr r4, =sub_8027ACC + adds r0, r4, 0 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8027AAC + + thumb_func_start sub_8027ACC +sub_8027ACC: @ 8027ACC + push {r4-r7,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r7, r0, r1 + movs r1, 0 + ldrsh r0, [r7, r1] + cmp r0, 0x1 + beq _08027B94 + cmp r0, 0x1 + bgt _08027AF4 + cmp r0, 0 + beq _08027AFE + b _08027BE2 + .pool +_08027AF4: + cmp r0, 0x2 + beq _08027BA0 + cmp r0, 0x3 + beq _08027BC8 + b _08027BE2 +_08027AFE: + ldr r0, =gUnknown_082F7B2C + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp] + str r1, [sp, 0x4] + ldr r1, =gUnknown_085EDCE5 + movs r0, 0x1 + movs r2, 0 + bl GetStringWidth + adds r4, r0, 0 + movs r6, 0 + ldr r5, =gUnknown_082F7B34 +_08027B18: + ldr r1, [r5] + movs r0, 0x1 + movs r2, 0 + bl GetStringWidth + adds r0, 0x32 + cmp r0, r4 + ble _08027B2A + adds r4, r0, 0 +_08027B2A: + adds r5, 0x4 + adds r6, 0x1 + cmp r6, 0x2 + bls _08027B18 + adds r0, r4, 0x7 + cmp r0, 0 + bge _08027B3A + adds r0, 0x7 +_08027B3A: + asrs r4, r0, 3 + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _08027B46 + adds r4, 0x1 +_08027B46: + movs r1, 0x1E + subs r1, r4 + lsrs r0, r1, 31 + adds r1, r0 + asrs r1, 1 + lsls r1, 24 + lsrs r1, 16 + ldr r2, =0xffff00ff + ldr r0, [sp] + ands r0, r2 + orrs r0, r1 + lsls r2, r4, 24 + ldr r1, =0x00ffffff + ands r0, r1 + orrs r0, r2 + str r0, [sp] + mov r0, sp + bl AddWindow + strh r0, [r7, 0x2] + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + bl sub_8027BEC + ldrb r0, [r7, 0x2] + movs r1, 0x3 + b _08027BB6 + .pool +_08027B94: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _08027BE2 + b _08027BBA +_08027BA0: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _08027BE2 + ldrb r0, [r7, 0x2] + bl rbox_fill_rectangle + ldrb r0, [r7, 0x2] + movs r1, 0x1 +_08027BB6: + bl CopyWindowToVram +_08027BBA: + ldrh r0, [r7] + adds r0, 0x1 + strh r0, [r7] + b _08027BE2 + .pool +_08027BC8: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _08027BE2 + ldrb r0, [r7, 0x2] + bl RemoveWindow + adds r0, r4, 0 + bl remove_task + bl script_env_2_enable_and_set_ctx_running +_08027BE2: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8027ACC + + thumb_func_start sub_8027BEC +sub_8027BEC: @ 8027BEC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + str r1, [sp, 0x18] + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x03005d90 + ldr r1, [r0] + movs r2, 0x84 + lsls r2, 2 + adds r0, r1, r2 + ldrh r0, [r0] + str r0, [sp, 0xC] + subs r2, 0x4 + adds r0, r1, r2 + ldr r0, [r0] + str r0, [sp, 0x10] + ldr r0, =0x00000212 + adds r1, r0 + ldrh r0, [r1] + str r0, [sp, 0x14] + ldr r4, =0x0000021d + adds r0, r7, 0 + adds r1, r4, 0 + movs r2, 0xD0 + bl box_border_load_tiles_and_pal + adds r0, r7, 0 + adds r1, r4, 0 + movs r2, 0xD + bl sub_8098858 + adds r0, r7, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r4, =gUnknown_085EDCE5 + ldr r0, [sp, 0x18] + lsls r2, r0, 3 + movs r0, 0x1 + adds r1, r4, 0 + bl GetStringCenterAlignXOffset + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r7, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl Print + movs r6, 0 + ldr r2, =0x02021cc4 + mov r8, r2 + movs r0, 0xFF + mov r10, r0 + mov r9, r6 + mov r2, sp + adds r2, 0xC + str r2, [sp, 0x1C] +_08027C76: + lsls r4, r6, 2 + ldr r0, [sp, 0x1C] + ldm r0!, {r1} + str r0, [sp, 0x1C] + ldr r0, =gUnknown_082F7B40 + adds r0, r6, r0 + ldrb r3, [r0] + mov r0, r8 + movs r2, 0 + bl ConvertIntToDecimalString + movs r0, 0x1 + mov r1, r8 + movs r2, 0x1 + negs r2, r2 + bl GetStringWidth + adds r5, r0, 0 + ldr r0, =gUnknown_082F7B34 + adds r4, r0 + ldr r2, [r4] + ldr r0, =gUnknown_082F7B44 + lsls r4, r6, 1 + adds r0, r4, r0 + ldrb r0, [r0] + str r0, [sp] + mov r0, r10 + str r0, [sp, 0x4] + mov r0, r9 + str r0, [sp, 0x8] + adds r0, r7, 0 + movs r1, 0x1 + movs r3, 0 + bl Print + ldr r2, [sp, 0x18] + lsls r3, r2, 3 + subs r3, r5 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =gUnknown_082F7B4A + adds r4, r0 + ldrb r0, [r4] + str r0, [sp] + mov r0, r10 + str r0, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + adds r0, r7, 0 + movs r1, 0x1 + mov r2, r8 + bl Print + adds r6, 0x1 + cmp r6, 0x2 + ble _08027C76 + adds r0, r7, 0 + bl PutWindowTilemap + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8027BEC + + thumb_func_start sub_8027D20 +sub_8027D20: @ 8027D20 + push {lr} + bl sub_8009FCC + ldr r1, =0x02022c98 + ldr r1, [r1] + adds r1, 0x24 + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8027D20 + + thumb_func_start sub_8027D38 +sub_8027D38: @ 8027D38 + push {r4-r7,lr} + ldr r0, =0x02022c98 + ldr r0, [r0] + adds r0, 0x24 + ldrb r4, [r0] + cmp r4, 0x4 + bhi _08027D66 + ldr r5, =gUnknown_082F7B90 +_08027D48: + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + ldr r1, =0x020229f0 + adds r0, r1 + lsls r1, r4, 2 + adds r1, r5 + ldr r1, [r1] + bl CopyString + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _08027D48 +_08027D66: + ldr r0, =0x02022c98 + ldr r1, [r0] + adds r1, 0x24 + movs r2, 0x5 + strb r2, [r1] + movs r1, 0 + mov r12, r0 +_08027D74: + movs r4, 0 + mov r2, r12 + ldr r0, [r2] + adds r0, 0x24 + adds r5, r1, 0x1 + ldrb r0, [r0] + cmp r4, r0 + bcs _08027DB2 + ldr r7, =0x02022c98 + lsls r3, r1, 1 + ldr r6, =gUnknown_082F7B50 +_08027D8A: + ldr r2, [r7] + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r0, r3, r0 + adds r1, r2, 0 + adds r1, 0x4A + adds r1, r0 + lsls r0, r4, 3 + adds r0, r3, r0 + adds r0, r6 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + adds r2, 0x24 + ldrb r2, [r2] + cmp r4, r2 + bcc _08027D8A +_08027DB2: + lsls r0, r5, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bls _08027D74 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8027D38 + + thumb_func_start sub_8027DD0 +sub_8027DD0: @ 8027DD0 + push {lr} + sub sp, 0x8 + ldr r3, =0xffffff00 + ldr r1, [sp] + ands r1, r3 + movs r2, 0x1 + orrs r1, r2 + str r1, [sp] + lsls r0, 24 + lsrs r0, 24 + ldr r1, [sp, 0x4] + ands r1, r3 + orrs r1, r0 + str r1, [sp, 0x4] + mov r0, sp + bl sub_800FE50 + add sp, 0x8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8027DD0 + + thumb_func_start sub_8027DFC +sub_8027DFC: @ 8027DFC + push {lr} + adds r2, r0, 0 + ldr r3, =0x03003090 + ldrh r0, [r3] + movs r1, 0xFF + lsls r1, 8 + ands r1, r0 + movs r0, 0xBC + lsls r0, 6 + cmp r1, r0 + bne _08027E1E + lsls r0, r2, 4 + adds r1, r3, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0x1 + beq _08027E28 +_08027E1E: + movs r0, 0 + b _08027E2A + .pool +_08027E28: + ldrb r0, [r1, 0x4] +_08027E2A: + pop {r1} + bx r1 + thumb_func_end sub_8027DFC + + thumb_func_start sub_8027E30 +sub_8027E30: @ 8027E30 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + ldr r4, [sp, 0x48] + lsls r4, 24 + str r4, [sp, 0x1C] + movs r4, 0x14 + adds r4, r0 + mov r9, r4 + mov r5, sp + movs r4, 0x2 + strb r4, [r5] + mov r10, sp + mov r5, r9 + ldrb r4, [r5, 0xB] + movs r7, 0xF + adds r5, r7, 0 + ands r5, r4 + mov r6, r10 + ldrb r6, [r6, 0x1] + mov r8, r6 + movs r4, 0x10 + negs r4, r4 + mov r6, r8 + ands r4, r6 + orrs r4, r5 + mov r5, r10 + strb r4, [r5, 0x1] + mov r8, sp + mov r6, r9 + ldrb r5, [r6, 0xC] + lsls r5, 4 + ands r4, r7 + orrs r4, r5 + mov r5, r8 + strb r4, [r5, 0x1] + ldrb r5, [r6, 0xD] + movs r6, 0xF + ands r5, r6 + mov r4, r10 + ldrb r4, [r4, 0x2] + mov r8, r4 + movs r4, 0x10 + negs r4, r4 + mov r6, r8 + ands r4, r6 + orrs r4, r5 + mov r5, r10 + strb r4, [r5, 0x2] + mov r8, sp + mov r6, r9 + ldrb r5, [r6, 0xE] + lsls r5, 4 + ands r4, r7 + orrs r4, r5 + mov r5, r8 + strb r4, [r5, 0x2] + ldrb r5, [r6, 0xF] + movs r6, 0xF + ands r5, r6 + mov r4, r10 + ldrb r4, [r4, 0x3] + mov r8, r4 + movs r4, 0x10 + negs r4, r4 + mov r6, r8 + ands r4, r6 + orrs r4, r5 + mov r5, r10 + strb r4, [r5, 0x3] + mov r8, sp + mov r6, r9 + ldrb r5, [r6, 0x10] + lsls r5, 4 + ands r4, r7 + orrs r4, r5 + mov r5, r8 + strb r4, [r5, 0x3] + ldrb r5, [r6, 0x11] + movs r6, 0xF + ands r5, r6 + mov r4, r10 + ldrb r4, [r4, 0x4] + mov r8, r4 + movs r4, 0x10 + negs r4, r4 + mov r6, r8 + ands r4, r6 + orrs r4, r5 + mov r5, r10 + strb r4, [r5, 0x4] + mov r8, sp + mov r6, r9 + ldrb r5, [r6, 0x12] + lsls r5, 4 + ands r4, r7 + orrs r4, r5 + mov r5, r8 + strb r4, [r5, 0x4] + ldrb r4, [r6, 0x13] + movs r6, 0xF + ands r4, r6 + mov r6, r8 + ldrb r5, [r6, 0x5] + movs r6, 0x10 + negs r6, r6 + ands r6, r5 + orrs r6, r4 + str r6, [sp, 0xC] + mov r4, r8 + strb r6, [r4, 0x5] + mov r5, sp + mov r6, r9 + ldrb r4, [r6, 0x14] + lsls r4, 4 + ldr r6, [sp, 0xC] + ands r6, r7 + orrs r6, r4 + strb r6, [r5, 0x5] + mov r7, sp + movs r4, 0x3 + mov r8, r4 + ldrb r0, [r0, 0x14] + mov r5, r8 + ands r0, r5 + ldrb r5, [r7, 0x6] + movs r6, 0x4 + negs r6, r6 + mov r10, r6 + mov r4, r10 + ands r4, r5 + orrs r4, r0 + strb r4, [r7, 0x6] + mov r5, r9 + ldrb r0, [r5, 0x1] + mov r6, r8 + ands r0, r6 + lsls r0, 2 + movs r5, 0xD + negs r5, r5 + ands r5, r4 + orrs r5, r0 + strb r5, [r7, 0x6] + mov r0, r9 + ldrb r4, [r0, 0x2] + ands r4, r6 + lsls r4, 4 + movs r0, 0x31 + negs r0, r0 + ands r0, r5 + orrs r0, r4 + strb r0, [r7, 0x6] + mov r5, sp + mov r6, r9 + ldrb r4, [r6, 0x3] + lsls r4, 6 + movs r6, 0x3F + ands r0, r6 + orrs r0, r4 + strb r0, [r5, 0x6] + mov r4, r9 + ldrb r0, [r4, 0x4] + mov r5, r8 + ands r0, r5 + ldrb r5, [r7, 0x7] + mov r4, r10 + ands r4, r5 + orrs r4, r0 + strb r4, [r7, 0x7] + mov r6, r9 + ldrb r0, [r6, 0x5] + mov r5, r8 + ands r0, r5 + lsls r0, 2 + movs r5, 0xD + negs r5, r5 + ands r5, r4 + orrs r5, r0 + strb r5, [r7, 0x7] + ldrb r4, [r6, 0x6] + mov r6, r8 + ands r4, r6 + lsls r4, 4 + movs r0, 0x31 + negs r0, r0 + ands r0, r5 + orrs r0, r4 + strb r0, [r7, 0x7] + mov r5, sp + mov r6, r9 + ldrb r4, [r6, 0x7] + lsls r4, 6 + movs r6, 0x3F + ands r0, r6 + orrs r0, r4 + strb r0, [r5, 0x7] + mov r8, sp + mov r0, r9 + ldrb r4, [r0, 0x8] + movs r7, 0x3 + adds r0, r7, 0 + ands r0, r4 + mov r4, r8 + ldrb r5, [r4, 0x8] + mov r4, r10 + ands r4, r5 + orrs r4, r0 + mov r5, r8 + strb r4, [r5, 0x8] + mov r6, r9 + ldrb r5, [r6, 0x9] + adds r0, r7, 0 + ands r0, r5 + lsls r0, 2 + movs r5, 0xD + negs r5, r5 + ands r5, r4 + orrs r5, r0 + mov r0, r8 + strb r5, [r0, 0x8] + ldrb r0, [r1] + adds r4, r7, 0 + ands r4, r0 + lsls r4, 4 + movs r0, 0x31 + negs r0, r0 + ands r0, r5 + orrs r0, r4 + mov r4, r8 + strb r0, [r4, 0x8] + mov r5, sp + ldrb r4, [r2] + lsls r4, 6 + movs r6, 0x3F + ands r0, r6 + orrs r0, r4 + strb r0, [r5, 0x8] + ldrb r4, [r3] + adds r0, r7, 0 + ands r0, r4 + ldrb r4, [r5, 0x9] + mov r6, r10 + ands r6, r4 + orrs r6, r0 + mov r10, r6 + strb r6, [r5, 0x9] + ldr r0, [sp, 0x40] + ldrb r4, [r0] + adds r0, r7, 0 + ands r0, r4 + lsls r0, 2 + movs r4, 0xD + negs r4, r4 + ands r6, r4 + orrs r6, r0 + str r6, [sp, 0x10] + strb r6, [r5, 0x9] + mov r4, sp + ldr r5, [sp, 0x44] + ldrb r0, [r5] + adds r6, r7, 0 + ands r6, r0 + lsls r0, r6, 4 + subs r7, 0x34 + ldr r5, [sp, 0x10] + ands r7, r5 + orrs r7, r0 + strb r7, [r4, 0x9] + mov r5, sp + ldrb r0, [r1, 0x4] + movs r6, 0x1 + mov r12, r6 + mov r4, r12 + ands r4, r0 + lsls r4, 6 + movs r0, 0x41 + negs r0, r0 + mov r10, r0 + ands r0, r7 + orrs r0, r4 + strb r0, [r5, 0x9] + ldrb r4, [r2, 0x4] + lsls r4, 7 + movs r5, 0x7F + ands r0, r5 + orrs r0, r4 + mov r4, r8 + strb r0, [r4, 0x9] + ldrb r4, [r3, 0x4] + mov r0, r12 + ands r0, r4 + mov r5, r8 + ldrb r4, [r5, 0xA] + movs r7, 0x2 + negs r7, r7 + adds r5, r7, 0 + ands r5, r4 + orrs r5, r0 + mov r6, r8 + strb r5, [r6, 0xA] + mov r9, sp + ldr r4, [sp, 0x40] + ldrb r0, [r4, 0x4] + mov r4, r12 + ands r4, r0 + lsls r4, 1 + movs r6, 0x3 + negs r6, r6 + mov r8, r6 + mov r0, r8 + ands r0, r5 + orrs r0, r4 + mov r4, r9 + strb r0, [r4, 0xA] + ldr r6, [sp, 0x44] + ldrb r5, [r6, 0x4] + mov r4, r12 + ands r4, r5 + lsls r4, 2 + movs r5, 0x5 + negs r5, r5 + ands r0, r5 + orrs r0, r4 + mov r4, r9 + strb r0, [r4, 0xA] + mov r4, sp + ldrb r1, [r1, 0x8] + mov r0, r12 + ands r0, r1 + lsls r0, 2 + ldrb r1, [r4, 0xB] + ands r5, r1 + orrs r5, r0 + strb r5, [r4, 0xB] + ldrb r1, [r2, 0x8] + mov r0, r12 + ands r0, r1 + lsls r0, 3 + movs r1, 0x9 + negs r1, r1 + ands r1, r5 + orrs r1, r0 + strb r1, [r4, 0xB] + ldrb r2, [r3, 0x8] + mov r0, r12 + ands r0, r2 + lsls r0, 4 + movs r2, 0x11 + negs r2, r2 + ands r2, r1 + orrs r2, r0 + strb r2, [r4, 0xB] + mov r3, sp + ldr r5, [sp, 0x40] + ldrb r0, [r5, 0x8] + mov r1, r12 + ands r1, r0 + lsls r1, 5 + movs r0, 0x21 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0xB] + mov r2, sp + ldrb r1, [r6, 0x8] + mov r6, r12 + ands r6, r1 + lsls r1, r6, 6 + mov r3, r10 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0xB] + ldr r4, [sp, 0x1C] + lsrs r3, r4, 21 + ldrb r1, [r2, 0xA] + movs r0, 0x7 + ands r0, r1 + orrs r0, r3 + strb r0, [r2, 0xA] + mov r1, sp + ldr r5, [sp, 0x4C] + movs r6, 0x1 + ands r5, r6 + lsls r2, r5, 1 + ldrb r0, [r1, 0xB] + mov r3, r8 + ands r3, r0 + orrs r3, r2 + mov r8, r3 + strb r3, [r1, 0xB] + mov r0, sp + ldr r4, [sp, 0x50] + ands r4, r6 + mov r5, r8 + ands r5, r7 + orrs r5, r4 + strb r5, [r0, 0xB] + bl sub_800FE50 + 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_8027E30 + + thumb_func_start sub_8028164 +sub_8028164: @ 8028164 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r7, r1, 0 + adds r5, r2, 0 + adds r6, r3, 0 + ldr r0, [sp, 0x1C] + mov r12, r0 + ldr r1, [sp, 0x20] + mov r8, r1 + ldr r0, [sp, 0x24] + mov r9, r0 + adds r2, r7, 0 + adds r2, 0x14 + ldr r4, =0x03003090 + ldrh r0, [r4] + movs r1, 0xFF + lsls r1, 8 + ands r1, r0 + movs r0, 0xBC + lsls r0, 6 + cmp r1, r0 + bne _0802819C + adds r3, r4, 0x2 + ldrb r0, [r4, 0x2] + cmp r0, 0x2 + beq _080281A4 +_0802819C: + movs r0, 0 + b _080282DE + .pool +_080281A4: + ldrb r0, [r3, 0x1] + lsls r0, 28 + lsrs r0, 28 + strb r0, [r2, 0xB] + ldrb r0, [r3, 0x1] + lsrs r0, 4 + strb r0, [r2, 0xC] + ldrb r0, [r3, 0x2] + lsls r0, 28 + lsrs r0, 28 + strb r0, [r2, 0xD] + ldrb r0, [r3, 0x2] + lsrs r0, 4 + strb r0, [r2, 0xE] + ldrb r0, [r3, 0x3] + lsls r0, 28 + lsrs r0, 28 + strb r0, [r2, 0xF] + ldrb r0, [r3, 0x3] + lsrs r0, 4 + strb r0, [r2, 0x10] + ldrb r0, [r3, 0x4] + lsls r0, 28 + lsrs r0, 28 + strb r0, [r2, 0x11] + ldrb r0, [r3, 0x4] + lsrs r0, 4 + strb r0, [r2, 0x12] + ldrb r0, [r3, 0x5] + lsls r0, 28 + lsrs r0, 28 + strb r0, [r2, 0x13] + ldrb r0, [r3, 0x5] + lsrs r0, 4 + strb r0, [r2, 0x14] + ldrb r0, [r3, 0x1] + lsls r0, 28 + lsrs r0, 28 + strb r0, [r2, 0x15] + ldrb r0, [r3, 0x6] + lsls r0, 30 + lsrs r0, 30 + strb r0, [r7, 0x14] + ldrb r0, [r3, 0x6] + lsls r0, 28 + lsrs r0, 30 + strb r0, [r2, 0x1] + ldrb r0, [r3, 0x6] + lsls r0, 26 + lsrs r0, 30 + strb r0, [r2, 0x2] + ldrb r0, [r3, 0x6] + lsrs r0, 6 + strb r0, [r2, 0x3] + ldrb r0, [r3, 0x7] + lsls r0, 30 + lsrs r0, 30 + strb r0, [r2, 0x4] + ldrb r0, [r3, 0x7] + lsls r0, 28 + lsrs r0, 30 + strb r0, [r2, 0x5] + ldrb r0, [r3, 0x7] + lsls r0, 26 + lsrs r0, 30 + strb r0, [r2, 0x6] + ldrb r0, [r3, 0x7] + lsrs r0, 6 + strb r0, [r2, 0x7] + ldrb r0, [r3, 0x8] + lsls r0, 30 + lsrs r0, 30 + strb r0, [r2, 0x8] + ldrb r0, [r3, 0x8] + lsls r0, 28 + lsrs r0, 30 + strb r0, [r2, 0x9] + ldrb r0, [r3, 0x6] + lsls r0, 30 + lsrs r0, 30 + strb r0, [r2, 0xA] + ldrb r0, [r3, 0x8] + lsls r0, 26 + lsrs r0, 30 + strb r0, [r5] + ldrb r0, [r3, 0x9] + lsls r0, 25 + lsrs r0, 31 + strb r0, [r5, 0x4] + ldrb r0, [r3, 0xB] + lsls r0, 29 + lsrs r0, 31 + strb r0, [r5, 0x8] + ldrb r0, [r3, 0x8] + lsrs r0, 6 + strb r0, [r6] + ldrb r0, [r3, 0x9] + lsrs r0, 7 + strb r0, [r6, 0x4] + ldrb r0, [r3, 0xB] + lsls r0, 28 + lsrs r0, 31 + strb r0, [r6, 0x8] + ldrb r0, [r3, 0x9] + lsls r0, 30 + lsrs r0, 30 + mov r1, r12 + strb r0, [r1] + ldrb r0, [r3, 0xA] + lsls r0, 31 + lsrs r0, 31 + strb r0, [r1, 0x4] + ldrb r0, [r3, 0xB] + lsls r0, 27 + lsrs r0, 31 + strb r0, [r1, 0x8] + ldrb r0, [r3, 0x9] + lsls r0, 28 + lsrs r0, 30 + mov r1, r8 + strb r0, [r1] + ldrb r0, [r3, 0xA] + lsls r0, 30 + lsrs r0, 31 + strb r0, [r1, 0x4] + ldrb r0, [r3, 0xB] + lsls r0, 26 + lsrs r0, 31 + strb r0, [r1, 0x8] + ldrb r0, [r3, 0x9] + lsls r0, 26 + lsrs r0, 30 + mov r1, r9 + strb r0, [r1] + ldrb r0, [r3, 0xA] + lsls r0, 29 + lsrs r0, 31 + strb r0, [r1, 0x4] + ldrb r0, [r3, 0xB] + lsls r0, 25 + lsrs r0, 31 + strb r0, [r1, 0x8] + ldrb r0, [r3, 0xA] + lsrs r0, 3 + ldr r1, [sp, 0x28] + strb r0, [r1] + ldrb r0, [r3, 0xB] + lsls r0, 30 + lsrs r0, 31 + ldr r1, [sp, 0x2C] + str r0, [r1] + ldrb r0, [r3, 0xB] + lsls r0, 31 + lsrs r0, 31 + ldr r1, [sp, 0x30] + str r0, [r1] + movs r0, 0x1 +_080282DE: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8028164 + + thumb_func_start sub_80282EC +sub_80282EC: @ 80282EC + push {lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + ldr r3, =0xffffff00 + ldr r1, [sp] + ands r1, r3 + movs r2, 0x3 + orrs r1, r2 + str r1, [sp] + ldr r1, [sp, 0x4] + ands r1, r3 + orrs r1, r0 + str r1, [sp, 0x4] + mov r0, sp + bl sub_800FE50 + add sp, 0x8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80282EC + + thumb_func_start sub_8028318 +sub_8028318: @ 8028318 + push {r4,lr} + adds r2, r0, 0 + adds r4, r1, 0 + ldr r3, =0x03003090 + ldrh r0, [r3] + movs r1, 0xFF + lsls r1, 8 + ands r1, r0 + movs r0, 0xBC + lsls r0, 6 + cmp r1, r0 + bne _0802833C + lsls r0, r2, 4 + adds r1, r3, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0x3 + beq _08028344 +_0802833C: + movs r0, 0 + b _0802834A + .pool +_08028344: + ldrb r0, [r1, 0x4] + strb r0, [r4] + movs r0, 0x1 +_0802834A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8028318 + + thumb_func_start sub_8028350 +sub_8028350: @ 8028350 + push {lr} + sub sp, 0x8 + ldr r2, =0xffffff00 + ldr r1, [sp] + ands r1, r2 + movs r2, 0x4 + orrs r1, r2 + str r1, [sp] + str r0, [sp, 0x4] + mov r0, sp + bl sub_800FE50 + add sp, 0x8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8028350 + + thumb_func_start sub_8028374 +sub_8028374: @ 8028374 + push {lr} + adds r2, r0, 0 + ldr r3, =0x03003090 + ldrh r0, [r3] + movs r1, 0xFF + lsls r1, 8 + ands r1, r0 + movs r0, 0xBC + lsls r0, 6 + cmp r1, r0 + bne _08028396 + lsls r0, r2, 4 + adds r1, r3, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0x4 + beq _080283A0 +_08028396: + movs r0, 0 + b _080283A2 + .pool +_080283A0: + ldr r0, [r1, 0x4] +_080283A2: + pop {r1} + bx r1 + thumb_func_end sub_8028374 + + thumb_func_start sub_80283A8 +sub_80283A8: @ 80283A8 + push {r4,r5,lr} + sub sp, 0x18 + movs r5, 0xC0 + lsls r5, 6 + adds r0, r5, 0 + bl AllocZeroed + adds r4, r0, 0 + ldr r0, =gUnknown_082FB2D8 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x8] + str r1, [sp, 0xC] + ldr r0, =gUnknown_082FB2E0 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x10] + str r1, [sp, 0x14] + ldr r0, =gUnknown_082F98BC + adds r1, r4, 0 + bl LZ77UnCompWram + cmp r4, 0 + beq _080283E8 + str r4, [sp] + str r5, [sp, 0x4] + mov r0, sp + bl LoadObjectPic + adds r0, r4, 0 + bl Free +_080283E8: + add r0, sp, 0x8 + bl LoadTaggedObjectPalette + add r0, sp, 0x10 + bl LoadTaggedObjectPalette + add sp, 0x18 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80283A8 + + thumb_func_start sub_8028408 +sub_8028408: @ 8028408 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x30 + adds r6, r1, 0 + mov r8, r2 + adds r5, r3, 0 + lsls r6, 24 + lsrs r6, 24 + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r5, 24 + lsrs r5, 24 + add r1, sp, 0x18 + movs r3, 0 + strh r3, [r1] + ldrb r2, [r0] + mov r0, sp + adds r0, 0x1A + strh r2, [r0] + ldr r0, =gUnknown_082FB1E0 + str r0, [sp, 0x1C] + ldr r0, =gUnknown_082FB228 + str r0, [sp, 0x20] + str r3, [sp, 0x24] + ldr r0, =gDummyObjectRotScalAnimTable + str r0, [sp, 0x28] + ldr r0, =sub_80284A8 + str r0, [sp, 0x2C] + mov r0, sp + movs r2, 0x18 + bl memcpy + movs r0, 0x4 + bl AllocZeroed + ldr r1, =0x02022c9c + mov r2, r8 + lsls r4, r2, 2 + adds r4, r1 + str r0, [r4] + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_8028F14 + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + mov r0, sp + movs r2, 0x88 + movs r3, 0x3 + bl AddObjectToFront + ldr r1, [r4] + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1] + movs r0, 0x1 + mov r1, r8 + bl sub_8028654 + add sp, 0x30 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8028408 + + thumb_func_start sub_80284A8 +sub_80284A8: @ 80284A8 + push {lr} + movs r2, 0x2E + ldrsh r1, [r0, r2] + cmp r1, 0x1 + beq _080284BC + cmp r1, 0x1 + ble _080284C6 + cmp r1, 0x2 + beq _080284C2 + b _080284C6 +_080284BC: + bl sub_802853C + b _080284C6 +_080284C2: + bl sub_80285AC +_080284C6: + pop {r0} + bx r0 + thumb_func_end sub_80284A8 + + thumb_func_start sub_80284CC +sub_80284CC: @ 80284CC + push {lr} + bl link_get_multiplayer_id + ldr r1, =0x02022c9c + lsls r0, 24 + lsrs r0, 22 + adds r0, r1 + ldr r0, [r0] + ldrh r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r2, 0 + movs r1, 0x1 + strh r1, [r0, 0x2E] + strh r2, [r0, 0x30] + strh r2, [r0, 0x32] + strh r2, [r0, 0x34] + strh r2, [r0, 0x36] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80284CC + + thumb_func_start sub_8028504 +sub_8028504: @ 8028504 + push {lr} + bl link_get_multiplayer_id + ldr r1, =0x02022c9c + lsls r0, 24 + lsrs r0, 22 + adds r0, r1 + ldr r0, [r0] + ldrh r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r2, 0 + movs r1, 0x2 + strh r1, [r0, 0x2E] + strh r2, [r0, 0x30] + strh r2, [r0, 0x32] + strh r2, [r0, 0x34] + strh r2, [r0, 0x36] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8028504 + + thumb_func_start sub_802853C +sub_802853C: @ 802853C + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r2, r0, 16 + lsrs r0, 31 + adds r0, r2, r0 + asrs r1, r0, 1 + adds r0, r1, 0 + cmp r1, 0 + bge _08028558 + adds r0, r1, 0x3 +_08028558: + asrs r0, 2 + lsls r0, 2 + subs r0, r1, r0 + lsls r0, 24 + lsrs r0, 24 + cmp r2, 0x2 + ble _080285A2 + cmp r0, 0x2 + bgt _0802856E + cmp r0, 0x1 + bge _08028572 +_0802856E: + movs r0, 0x1 + b _08028574 +_08028572: + movs r0, 0xFF +_08028574: + lsls r0, 24 + asrs r0, 24 + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x27 + ble _080285A2 + movs r0, 0 + strh r0, [r4, 0x2E] + bl sub_8027650 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + bl sub_8028F14 + strh r0, [r4, 0x20] +_080285A2: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802853C + + thumb_func_start sub_80285AC +sub_80285AC: @ 80285AC + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0x30] + adds r0, 0x1 + strh r0, [r5, 0x30] + lsls r0, 16 + asrs r0, 16 + movs r1, 0xD + bl __divsi3 + lsls r0, 16 + asrs r1, r0, 16 + adds r0, r1, 0 + cmp r1, 0 + bge _080285CC + adds r0, r1, 0x3 +_080285CC: + asrs r0, 2 + lsls r0, 2 + subs r0, r1, r0 + lsls r0, 24 + lsrs r4, r0, 24 + movs r1, 0x30 + ldrsh r0, [r5, r1] + movs r1, 0xD + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + bne _080285F0 + cmp r4, 0 + beq _080285F0 + movs r0, 0xD4 + bl audio_play +_080285F0: + movs r1, 0x30 + ldrsh r0, [r5, r1] + cmp r0, 0x67 + ble _080285FE + movs r0, 0 + strh r0, [r5, 0x2E] + movs r4, 0 +_080285FE: + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + bl sub_80286B4 + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80285AC + + thumb_func_start sub_8028614 +sub_8028614: @ 8028614 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + cmp r4, r5 + bcs _08028646 + ldr r6, =0x02022c9c +_08028622: + lsls r0, r4, 2 + adds r0, r6 + ldr r0, [r0] + ldrh r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + cmp r0, 0 + beq _0802863C + bl RemoveObjectAndFreeResources +_0802863C: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _08028622 +_08028646: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8028614 + + thumb_func_start sub_8028654 +sub_8028654: @ 8028654 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + ldr r3, =0x02020630 + ldr r2, =0x02022c9c + lsrs r1, 22 + adds r1, r2 + ldr r1, [r1] + ldrh r1, [r1] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r3 + adds r2, 0x3E + movs r1, 0x1 + ands r0, r1 + lsls r0, 2 + ldrb r3, [r2] + movs r1, 0x5 + negs r1, r1 + ands r1, r3 + orrs r1, r0 + strb r1, [r2] + bx lr + .pool + thumb_func_end sub_8028654 + + thumb_func_start sub_802868C +sub_802868C: @ 802868C + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + movs r4, 0 + cmp r4, r5 + bcs _080286AE +_0802869C: + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_8028654 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _0802869C +_080286AE: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_802868C + + thumb_func_start sub_80286B4 +sub_80286B4: @ 80286B4 + push {lr} + lsls r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =0x02022c9c + lsrs r0, 22 + adds r0, r2 + ldr r0, [r0] + ldrh r2, [r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02020630 + adds r0, r2 + bl StartObjectImageAnim + pop {r0} + bx r0 + .pool + thumb_func_end sub_80286B4 + + thumb_func_start nullsub_15 +nullsub_15: @ 80286E0 + bx lr + thumb_func_end nullsub_15 + + thumb_func_start sub_80286E4 +sub_80286E4: @ 80286E4 + push {r4-r7,lr} + movs r4, 0 + ldr r0, =0x02020630 + mov r12, r0 + movs r6, 0 + ldr r5, =0x02022cf4 +_080286F0: + ldr r3, [r5] + lsls r1, r4, 1 + adds r0, r3, 0 + adds r0, 0x2A + adds r0, r1 + ldrh r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r12 + lsls r0, r4, 4 + adds r0, 0x30 + strh r0, [r1, 0x20] + lsls r2, r4, 3 + movs r7, 0x8 + negs r7, r7 + adds r0, r7, 0 + subs r0, r2 + strh r0, [r1, 0x22] + adds r3, 0xC + adds r3, r4 + strb r6, [r3] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x9 + bls _080286F0 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80286E4 + + thumb_func_start sub_8028734 +sub_8028734: @ 8028734 + push {r4-r6,lr} + sub sp, 0x28 + movs r4, 0xC0 + lsls r4, 1 + adds r0, r4, 0 + bl AllocZeroed + adds r6, r0, 0 + ldr r0, =gUnknown_082FB2E8 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x20] + str r1, [sp, 0x24] + ldr r0, =gUnknown_082F96E0 + adds r1, r6, 0 + bl LZ77UnCompWram + cmp r6, 0 + beq _080287C4 + str r6, [sp, 0x18] + add r5, sp, 0x18 + movs r0, 0x80 + lsls r0, 9 + orrs r0, r4 + str r0, [r5, 0x4] + mov r1, sp + ldr r0, =gUnknown_082FB2F0 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r4, =0x02022cf4 + movs r0, 0x40 + bl AllocZeroed + str r0, [r4] + adds r0, r5, 0 + bl LoadObjectPic + add r0, sp, 0x20 + bl LoadTaggedObjectPalette + movs r4, 0 +_0802878A: + lsls r1, r4, 20 + movs r0, 0xC0 + lsls r0, 14 + adds r1, r0 + asrs r1, 16 + lsls r0, r4, 3 + movs r3, 0x8 + negs r3, r3 + adds r2, r3, 0 + subs r2, r0 + lsls r2, 16 + asrs r2, 16 + mov r0, sp + movs r3, 0 + bl AddObjectToFront + ldr r1, =0x02022cf4 + ldr r1, [r1] + lsls r2, r4, 1 + adds r1, 0x2A + adds r1, r2 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x9 + bls _0802878A +_080287C4: + adds r0, r6, 0 + bl Free + add sp, 0x28 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8028734 + + thumb_func_start sub_80287E4 +sub_80287E4: @ 80287E4 + push {r4,r5,lr} + movs r4, 0 +_080287E8: + ldr r5, =0x02022cf4 + ldr r0, [r5] + lsls r1, r4, 1 + adds r0, 0x2A + adds r0, r1 + ldrh r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + cmp r0, 0 + beq _08028806 + bl RemoveObjectAndFreeResources +_08028806: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x9 + bls _080287E8 + ldr r0, [r5] + bl Free + movs r0, 0 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80287E4 + + thumb_func_start sub_8028828 +sub_8028828: @ 8028828 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + movs r3, 0 + movs r6, 0 + ldr r0, =0x02022cf4 + mov r9, r0 +_0802883A: + mov r7, r9 + ldr r2, [r7] + lsls r5, r6, 1 + adds r0, r2, 0 + adds r0, 0x2A + adds r0, r5 + ldrh r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r4, r0, r1 + adds r0, r2, 0 + adds r0, 0x16 + adds r0, r5 + movs r1, 0x2 + strh r1, [r0] + adds r0, r2, 0 + adds r0, 0xC + adds r2, r0, r6 + ldrb r1, [r2] + cmp r1, 0 + beq _08028870 + movs r7, 0x22 + ldrsh r0, [r4, r7] + cmp r0, 0x8 + beq _080288A6 +_08028870: + movs r3, 0x1 + movs r7, 0x22 + ldrsh r0, [r4, r7] + cmp r0, 0x8 + bne _08028896 + cmp r1, 0 + bne _080288A6 + strb r3, [r2] + mov r1, r9 + ldr r0, [r1] + adds r0, 0x16 + adds r0, r5 + ldr r1, =0x0000fff0 + strh r1, [r0] + movs r0, 0x24 + str r3, [sp] + bl audio_play + ldr r3, [sp] +_08028896: + mov r7, r9 + ldr r0, [r7] + adds r0, 0x16 + adds r0, r5 + ldrh r0, [r0] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] +_080288A6: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x9 + bls _0802883A + cmp r3, 0 + bne _080288C4 + movs r0, 0x1 + b _080288C6 + .pool +_080288C4: + movs r0, 0 +_080288C6: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8028828 + + thumb_func_start sub_80288D4 +sub_80288D4: @ 80288D4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0xA + bls _08028910 + movs r4, 0 +_080288E0: + ldr r0, =0x02022cf4 + ldr r0, [r0] + lsls r1, r4, 1 + adds r0, 0x2A + adds r0, r1 + ldrh r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r1, 0x1 + bl StartObjectImageAnim + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x9 + bls _080288E0 + b _080289DA + .pool +_08028910: + movs r4, 0 + movs r0, 0xA + subs r0, r5 + cmp r4, r0 + bge _080289D6 + ldr r6, =0x02020630 +_0802891C: + cmp r5, 0x6 + bls _08028984 + ldr r0, =0x02022cf4 + ldr r2, [r0] + ldr r1, =0x0000fffa + adds r0, r1, 0 + ldrh r1, [r2, 0x3E] + adds r0, r1 + adds r0, r5 + movs r1, 0 + strh r0, [r2, 0x3E] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1E + bls _0802894C + strh r1, [r2, 0x3E] + b _0802899E + .pool +_0802894C: + cmp r0, 0xA + bls _0802896A + lsls r1, r4, 1 + adds r0, r2, 0 + adds r0, 0x2A + adds r0, r1 + ldrh r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x2 + bl StartObjectImageAnim + b _0802899E +_0802896A: + lsls r1, r4, 1 + adds r0, r2, 0 + adds r0, 0x2A + adds r0, r1 + ldrh r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0 + bl StartObjectImageAnim + b _0802899E +_08028984: + ldr r0, =0x02022cf4 + ldr r0, [r0] + lsls r1, r4, 1 + adds r0, 0x2A + adds r0, r1 + ldrh r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0 + bl StartObjectImageAnim +_0802899E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0xA + subs r0, r5 + cmp r4, r0 + blt _0802891C + b _080289D6 + .pool +_080289B4: + ldr r0, =0x02022cf4 + ldr r0, [r0] + lsls r1, r4, 1 + adds r0, 0x2A + adds r0, r1 + ldrh r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r1, 0x1 + bl StartObjectImageAnim + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_080289D6: + cmp r4, 0x9 + bls _080289B4 +_080289DA: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80288D4 + + thumb_func_start sub_80289E8 +sub_80289E8: @ 80289E8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + movs r3, 0 + ldr r7, =0x02020630 + movs r1, 0x1 + ands r0, r1 + lsls r4, r0, 2 + movs r6, 0x5 + negs r6, r6 + ldr r5, =0x02022cf4 +_080289FE: + ldr r0, [r5] + lsls r1, r3, 1 + adds r0, 0x2A + adds r0, r1 + ldrh r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + adds r1, 0x3E + ldrb r2, [r1] + adds r0, r6, 0 + ands r0, r2 + orrs r0, r4 + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x9 + bls _080289FE + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80289E8 + + thumb_func_start sub_8028A34 +sub_8028A34: @ 8028A34 + push {r4,r5,lr} + sub sp, 0x10 + movs r5, 0x90 + lsls r5, 3 + adds r0, r5, 0 + bl AllocZeroed + adds r4, r0, 0 + ldr r0, =gUnknown_082FB314 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x8] + str r1, [sp, 0xC] + ldr r0, =gUnknown_082F7EB0 + adds r1, r4, 0 + bl LZ77UnCompWram + cmp r4, 0 + beq _08028A6A + str r4, [sp] + movs r0, 0x80 + lsls r0, 10 + orrs r0, r5 + str r0, [sp, 0x4] + mov r0, sp + bl LoadObjectPic +_08028A6A: + add r0, sp, 0x8 + bl LoadTaggedObjectPalette + adds r0, r4, 0 + bl Free + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8028A34 + + thumb_func_start sub_8028A88 +sub_8028A88: @ 8028A88 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x30 + mov r1, sp + ldr r0, =gUnknown_082FB324 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + add r2, sp, 0x18 + adds r1, r2, 0 + ldr r0, =gUnknown_082FB33C + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + movs r5, 0 + mov r9, r2 +_08028AB0: + movs r0, 0x4 + bl AllocZeroed + ldr r1, =0x02022cb8 + lsls r4, r5, 2 + adds r4, r1 + str r0, [r4] + lsls r0, r5, 3 + lsls r1, r5, 4 + adds r1, r0 + mov r0, sp + movs r2, 0x8 + movs r3, 0x1 + bl AddObjectToFront + ldr r1, [r4] + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1] + adds r0, r5, 0 + movs r1, 0x1 + bl sub_8028BF8 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0xA + bls _08028AB0 + movs r5, 0 + ldr r7, =0x02022ce4 + ldr r4, =gUnknown_082FB31C + mov r8, r4 +_08028AF0: + movs r0, 0x4 + bl AllocZeroed + lsls r1, r5, 2 + adds r4, r1, r7 + str r0, [r4] + adds r6, r1, 0 + cmp r5, 0x3 + bne _08028B2C + mov r0, r8 + movs r2, 0x6 + ldrsh r1, [r0, r2] + mov r0, r9 + movs r2, 0x31 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r7, 0xC] + b _08028B40 + .pool +_08028B2C: + lsls r0, r5, 1 + add r0, r8 + movs r3, 0 + ldrsh r1, [r0, r3] + mov r0, r9 + movs r2, 0x34 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r4] +_08028B40: + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1] + adds r0, r6, r7 + ldr r0, [r0] + ldrh r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + adds r1, r5, 0 + bl StartObjectImageAnim + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _08028AF0 + movs r0, 0x1 + bl sub_8028C30 + add sp, 0x30 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8028A88 + + thumb_func_start sub_8028B80 +sub_8028B80: @ 8028B80 + push {r4-r6,lr} + movs r5, 0 + ldr r6, =0x02022cb8 +_08028B86: + lsls r0, r5, 2 + adds r4, r0, r6 + ldr r0, [r4] + ldrh r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + cmp r0, 0 + beq _08028BA0 + bl RemoveObjectAndFreeTiles +_08028BA0: + ldr r0, [r4] + bl Free + movs r0, 0 + str r0, [r4] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0xA + bls _08028B86 + movs r5, 0 + ldr r6, =0x02022ce4 +_08028BB8: + lsls r0, r5, 2 + adds r4, r0, r6 + ldr r0, [r4] + ldrh r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + cmp r0, 0 + beq _08028BD2 + bl RemoveObjectAndFreeTiles +_08028BD2: + ldr r0, [r4] + bl Free + movs r0, 0 + str r0, [r4] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _08028BB8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8028B80 + + thumb_func_start sub_8028BF8 +sub_8028BF8: @ 8028BF8 + lsls r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =0x02020630 + ldr r2, =0x02022cb8 + lsrs r0, 22 + adds r0, r2 + ldr r0, [r0] + ldrh r0, [r0] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + adds r2, 0x3E + movs r0, 0x1 + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + bx lr + .pool + thumb_func_end sub_8028BF8 + + thumb_func_start sub_8028C30 +sub_8028C30: @ 8028C30 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + movs r3, 0 + ldr r7, =0x02020630 + ldr r6, =0x02022ce4 + movs r1, 0x1 + ands r0, r1 + lsls r4, r0, 2 + movs r5, 0x5 + negs r5, r5 +_08028C46: + lsls r0, r3, 2 + adds r0, r6 + ldr r0, [r0] + ldrh r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + adds r1, 0x3E + ldrb r2, [r1] + adds r0, r5, 0 + ands r0, r2 + orrs r0, r4 + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3 + bls _08028C46 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8028C30 + + thumb_func_start sub_8028C7C +sub_8028C7C: @ 8028C7C + lsls r0, 24 + lsls r1, 24 + ldr r3, =0x02020630 + ldr r2, =0x02022cb8 + lsrs r0, 22 + adds r0, r2 + ldr r0, [r0] + ldrh r2, [r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r3 + lsrs r1, 21 + strh r1, [r0, 0x22] + bx lr + .pool + thumb_func_end sub_8028C7C + + thumb_func_start sub_8028CA4 +sub_8028CA4: @ 8028CA4 + push {lr} + lsls r0, 16 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =0x02022cb8 + lsrs r0, 14 + adds r0, r2 + ldr r0, [r0] + ldrh r2, [r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02020630 + adds r0, r2 + bl StartObjectImageAnim + pop {r0} + bx r0 + .pool + thumb_func_end sub_8028CA4 + + thumb_func_start sub_8028CD0 +sub_8028CD0: @ 8028CD0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02020630 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r1 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, 0x32 + strh r1, [r2, 0x20] + movs r0, 0x32 + strh r0, [r2, 0x22] + bx lr + .pool + thumb_func_end sub_8028CD0 + + thumb_func_start sub_8028CF4 +sub_8028CF4: @ 8028CF4 + push {r4-r7,lr} + adds r4, r0, 0 + adds r0, 0x42 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x1 + beq _08028D36 + movs r3, 0 + ldr r7, =gUnknown_082FB354 + ldr r6, =0x02022cb0 + movs r5, 0 +_08028D0A: + lsls r0, r3, 2 + adds r2, r0, r6 + ldr r1, [r2] + ldrh r0, [r1, 0x2] + adds r0, 0x1 + strh r0, [r1, 0x2] + adds r1, r3, r7 + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1] + cmp r0, r1 + bls _08028D2C + ldrh r0, [r4, 0x20] + subs r0, 0x1 + strh r0, [r4, 0x20] + ldr r0, [r2] + strh r5, [r0, 0x2] +_08028D2C: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x1 + bls _08028D0A +_08028D36: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8028CF4 + + thumb_func_start sub_8028D44 +sub_8028D44: @ 8028D44 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x28 + movs r4, 0x80 + lsls r4, 3 + adds r0, r4, 0 + bl AllocZeroed + adds r6, r0, 0 + ldr r0, =gUnknown_082FB360 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x20] + str r1, [sp, 0x24] + ldr r0, =gUnknown_082F9774 + adds r1, r6, 0 + bl LZ77UnCompWram + cmp r6, 0 + beq _08028DD2 + str r6, [sp, 0x18] + add r0, sp, 0x18 + movs r1, 0xA0 + lsls r1, 11 + orrs r1, r4 + str r1, [r0, 0x4] + mov r2, sp + ldr r1, =gUnknown_082FB368 + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + bl LoadObjectPic + add r0, sp, 0x20 + bl LoadTaggedObjectPalette + movs r5, 0 + ldr r7, =gUnknown_082FB356 + adds r0, r7, 0x2 + mov r9, r0 + ldr r1, =0x02022cb0 + mov r8, r1 +_08028D9E: + movs r0, 0x4 + bl AllocZeroed + lsls r2, r5, 2 + mov r3, r8 + adds r4, r2, r3 + str r0, [r4] + adds r0, r2, r7 + movs r3, 0 + ldrsh r1, [r0, r3] + add r2, r9 + movs r0, 0 + ldrsh r2, [r2, r0] + mov r0, sp + movs r3, 0x4 + bl AddObjectToFront + ldr r1, [r4] + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bls _08028D9E +_08028DD2: + adds r0, r6, 0 + bl Free + add sp, 0x28 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8028D44 + + thumb_func_start sub_8028DFC +sub_8028DFC: @ 8028DFC + push {r4-r7,lr} + movs r3, 0 + ldr r0, =0x02022cb0 + mov r12, r0 + ldr r4, =gUnknown_082FB356 + adds r7, r4, 0x2 + ldr r6, =0x02020630 + movs r5, 0x1 +_08028E0C: + lsls r2, r3, 2 + mov r1, r12 + adds r0, r2, r1 + ldr r0, [r0] + ldrh r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + adds r0, r1, 0 + adds r0, 0x42 + strh r5, [r0] + adds r0, r2, r4 + ldrh r0, [r0] + strh r0, [r1, 0x20] + adds r2, r7 + ldrh r0, [r2] + strh r0, [r1, 0x22] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x1 + bls _08028E0C + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8028DFC + + thumb_func_start sub_8028E4C +sub_8028E4C: @ 8028E4C + push {r4,r5,lr} + movs r2, 0 + ldr r5, =0x02022cb0 + ldr r4, =0x02020630 + movs r3, 0 +_08028E56: + lsls r0, r2, 2 + adds r0, r5 + ldr r0, [r0] + ldrh r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x42 + strh r3, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x1 + bls _08028E56 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8028E4C + + thumb_func_start sub_8028E84 +sub_8028E84: @ 8028E84 + push {r4-r6,lr} + movs r5, 0 + ldr r6, =0x02022cb0 +_08028E8A: + lsls r0, r5, 2 + adds r4, r0, r6 + ldr r0, [r4] + ldrh r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + cmp r0, 0 + beq _08028EA4 + bl RemoveObjectAndFreeTiles +_08028EA4: + ldr r0, [r4] + bl Free + movs r0, 0 + str r0, [r4] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bls _08028E8A + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8028E84 + + thumb_func_start sub_8028EC8 +sub_8028EC8: @ 8028EC8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + movs r3, 0 + ldr r7, =0x02020630 + ldr r6, =0x02022cb0 + movs r1, 0x1 + ands r0, r1 + lsls r4, r0, 2 + movs r5, 0x5 + negs r5, r5 +_08028EDE: + lsls r0, r3, 2 + adds r0, r6 + ldr r0, [r0] + ldrh r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + adds r1, 0x3E + ldrb r2, [r1] + adds r0, r5, 0 + ands r0, r2 + orrs r0, r4 + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x1 + bls _08028EDE + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8028EC8 + + thumb_func_start sub_8028F14 +sub_8028F14: @ 8028F14 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r1, 24 + movs r3, 0 + subs r0, r1, 0x1 + cmp r0, 0x4 + bhi _08028FC6 + lsls r0, 2 + ldr r1, =_08028F34 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08028F34: + .4byte _08028FB4 + .4byte _08028F48 + .4byte _08028F52 + .4byte _08028F66 + .4byte _08028F8E +_08028F48: + cmp r2, 0 + beq _08028F7E + cmp r2, 0x1 + bne _08028FC6 + b _08028F82 +_08028F52: + cmp r2, 0x1 + beq _08028FB8 + cmp r2, 0x1 + bgt _08028F60 + cmp r2, 0 + beq _08028FB4 + b _08028FC6 +_08028F60: + cmp r2, 0x2 + bne _08028FC6 + b _08028FC4 +_08028F66: + cmp r2, 0x1 + beq _08028F82 + cmp r2, 0x1 + bgt _08028F74 + cmp r2, 0 + beq _08028F7E + b _08028FC6 +_08028F74: + cmp r2, 0x2 + beq _08028F86 + cmp r2, 0x3 + beq _08028F8A + b _08028FC6 +_08028F7E: + movs r3, 0xC + b _08028FC6 +_08028F82: + movs r3, 0x12 + b _08028FC6 +_08028F86: + movs r3, 0x18 + b _08028FC6 +_08028F8A: + movs r3, 0x6 + b _08028FC6 +_08028F8E: + cmp r2, 0x4 + bhi _08028FC6 + lsls r0, r2, 2 + ldr r1, =_08028FA0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08028FA0: + .4byte _08028FB4 + .4byte _08028FB8 + .4byte _08028FBC + .4byte _08028FC0 + .4byte _08028FC4 +_08028FB4: + movs r3, 0xF + b _08028FC6 +_08028FB8: + movs r3, 0x15 + b _08028FC6 +_08028FBC: + movs r3, 0x1B + b _08028FC6 +_08028FC0: + movs r3, 0x3 + b _08028FC6 +_08028FC4: + movs r3, 0x9 +_08028FC6: + lsls r0, r3, 3 + pop {r1} + bx r1 + thumb_func_end sub_8028F14 + + thumb_func_start sub_8028FCC +sub_8028FCC: @ 8028FCC + push {r4,lr} + movs r4, 0 +_08028FD0: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8028BF8 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8028C7C + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xA + bls _08028FD0 + movs r0, 0 + bl sub_80289E8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8028FCC + + thumb_func_start sub_8028FF8 +sub_8028FF8: @ 8028FF8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_8098758 + ldr r1, [r0] + movs r2, 0x90 + lsls r2, 1 + movs r0, 0 + movs r3, 0x1 + bl LoadBgTiles + adds r0, r4, 0 + bl sub_8098758 + ldr r0, [r0, 0x4] + movs r1, 0xA0 + movs r2, 0x20 + bl gpu_pal_apply + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8028FF8 + + thumb_func_start sub_802902C +sub_802902C: @ 802902C + push {lr} + movs r0, 0 + movs r1, 0xA + movs r2, 0xB0 + bl box_border_load_tiles_and_pal + pop {r0} + bx r0 + thumb_func_end sub_802902C + + thumb_func_start sub_802903C +sub_802903C: @ 802903C + ldr r3, =0x02022cf8 + ldr r0, [r3] + movs r2, 0xC0 + lsls r2, 6 + adds r1, r0, r2 + movs r2, 0 + str r2, [r1] + ldr r1, =0x00003014 + adds r0, r1 + strb r2, [r0] + ldr r0, [r3] + adds r1, 0x4 + adds r0, r1 + strb r2, [r0] + ldr r0, [r3] + adds r1, 0x8 + adds r0, r1 + strb r2, [r0] + ldr r0, [r3] + adds r1, 0x4 + adds r0, r1 + strb r2, [r0] + bx lr + .pool + thumb_func_end sub_802903C + + thumb_func_start sub_8029074 +sub_8029074: @ 8029074 + push {r4-r6,lr} + sub sp, 0xC + adds r4, r0, 0 + movs r6, 0xA + ldrb r2, [r4, 0x1] + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldrb r3, [r4, 0x2] + subs r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + movs r5, 0x1 + str r5, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + bl FillBgTilemapBufferRect + ldrb r2, [r4, 0x1] + ldrb r3, [r4, 0x2] + subs r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + ldrb r0, [r4, 0x3] + str r0, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0 + movs r1, 0x2 + bl FillBgTilemapBufferRect + ldrb r2, [r4, 0x3] + ldrb r0, [r4, 0x1] + adds r2, r0 + lsls r2, 24 + lsrs r2, 24 + ldrb r3, [r4, 0x2] + subs r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + str r5, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0 + movs r1, 0x3 + bl FillBgTilemapBufferRect + ldrb r2, [r4, 0x1] + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldrb r3, [r4, 0x2] + str r5, [sp] + ldrb r0, [r4, 0x4] + str r0, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0 + movs r1, 0x4 + bl FillBgTilemapBufferRect + ldrb r2, [r4, 0x3] + ldrb r0, [r4, 0x1] + adds r2, r0 + lsls r2, 24 + lsrs r2, 24 + ldrb r3, [r4, 0x2] + str r5, [sp] + ldrb r0, [r4, 0x4] + str r0, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0 + movs r1, 0x6 + bl FillBgTilemapBufferRect + ldrb r2, [r4, 0x1] + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldrb r3, [r4, 0x4] + ldrb r0, [r4, 0x2] + adds r3, r0 + lsls r3, 24 + lsrs r3, 24 + str r5, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0 + movs r1, 0x7 + bl FillBgTilemapBufferRect + ldrb r2, [r4, 0x1] + ldrb r3, [r4, 0x4] + ldrb r0, [r4, 0x2] + adds r3, r0 + lsls r3, 24 + lsrs r3, 24 + ldrb r0, [r4, 0x3] + str r0, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0 + movs r1, 0x8 + bl FillBgTilemapBufferRect + ldrb r2, [r4, 0x3] + ldrb r0, [r4, 0x1] + adds r2, r0 + lsls r2, 24 + lsrs r2, 24 + ldrb r3, [r4, 0x4] + ldrb r4, [r4, 0x2] + adds r3, r4 + lsls r3, 24 + lsrs r3, 24 + str r5, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0 + movs r1, 0x9 + bl FillBgTilemapBufferRect + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8029074 + + thumb_func_start sub_8029174 +sub_8029174: @ 8029174 + push {r4-r6,lr} + sub sp, 0xC + adds r4, r0, 0 + movs r6, 0xB + ldrb r2, [r4, 0x1] + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldrb r3, [r4, 0x2] + subs r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + movs r5, 0x1 + str r5, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0 + movs r1, 0xA + bl FillBgTilemapBufferRect + ldrb r2, [r4, 0x1] + ldrb r3, [r4, 0x2] + subs r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + ldrb r0, [r4, 0x3] + str r0, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0 + movs r1, 0xB + bl FillBgTilemapBufferRect + ldrb r2, [r4, 0x3] + ldrb r0, [r4, 0x1] + adds r2, r0 + lsls r2, 24 + lsrs r2, 24 + ldrb r3, [r4, 0x2] + subs r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + str r5, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0 + movs r1, 0xC + bl FillBgTilemapBufferRect + ldrb r2, [r4, 0x1] + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldrb r3, [r4, 0x2] + str r5, [sp] + ldrb r0, [r4, 0x4] + str r0, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0 + movs r1, 0xD + bl FillBgTilemapBufferRect + ldrb r2, [r4, 0x3] + ldrb r0, [r4, 0x1] + adds r2, r0 + lsls r2, 24 + lsrs r2, 24 + ldrb r3, [r4, 0x2] + str r5, [sp] + ldrb r0, [r4, 0x4] + str r0, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0 + movs r1, 0xF + bl FillBgTilemapBufferRect + ldrb r2, [r4, 0x1] + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldrb r3, [r4, 0x4] + ldrb r0, [r4, 0x2] + adds r3, r0 + lsls r3, 24 + lsrs r3, 24 + str r5, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0 + movs r1, 0x10 + bl FillBgTilemapBufferRect + ldrb r2, [r4, 0x1] + ldrb r3, [r4, 0x4] + ldrb r0, [r4, 0x2] + adds r3, r0 + lsls r3, 24 + lsrs r3, 24 + ldrb r0, [r4, 0x3] + str r0, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0 + movs r1, 0x11 + bl FillBgTilemapBufferRect + ldrb r2, [r4, 0x3] + ldrb r0, [r4, 0x1] + adds r2, r0 + lsls r2, 24 + lsrs r2, 24 + ldrb r3, [r4, 0x4] + ldrb r4, [r4, 0x2] + adds r3, r4 + lsls r3, 24 + lsrs r3, 24 + str r5, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0 + movs r1, 0x12 + bl FillBgTilemapBufferRect + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8029174 + + thumb_func_start sub_8029274 +sub_8029274: @ 8029274 + push {r4,lr} + ldr r4, =0x02022cf8 + str r0, [r4] + movs r2, 0xC0 + lsls r2, 6 + adds r1, r0, r2 + movs r2, 0 + str r2, [r1] + ldr r3, =0x00003014 + adds r1, r0, r3 + strb r2, [r1] + ldr r1, =0x00003018 + adds r0, r1 + strb r2, [r0] + ldr r0, [r4] + adds r3, 0xC + adds r0, r3 + strb r2, [r0] + ldr r0, [r4] + adds r1, 0xC + adds r0, r1 + strb r2, [r0] + ldr r0, =sub_8029314 + movs r1, 0x3 + bl AddTask + ldr r1, [r4] + ldr r2, =0x00003004 + adds r1, r2 + strb r0, [r1] + ldr r0, =sub_8029338 + bl sub_802A72C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8029274 + + thumb_func_start sub_80292D4 +sub_80292D4: @ 80292D4 + push {lr} + bl FreeAllWindowBuffers + pop {r0} + bx r0 + thumb_func_end sub_80292D4 + + thumb_func_start sub_80292E0 +sub_80292E0: @ 80292E0 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0 + ldr r5, =gUnknown_082FB40C + adds r7, r5, 0x4 +_080292EC: + lsls r1, r4, 3 + adds r0, r1, r5 + ldrb r0, [r0] + cmp r0, r6 + bne _080292FE + adds r0, r1, r7 + ldr r0, [r0] + bl sub_802A72C +_080292FE: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x9 + bls _080292EC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80292E0 + + thumb_func_start sub_8029314 +sub_8029314: @ 8029314 + push {lr} + ldr r0, =0x02022cf8 + ldr r0, [r0] + movs r1, 0xC0 + lsls r1, 6 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + bne _0802932E + bl sub_802A75C + bl _call_via_r0 +_0802932E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8029314 + + thumb_func_start sub_8029338 +sub_8029338: @ 8029338 + push {lr} + ldr r0, =0x02022cf8 + ldr r1, [r0] + ldr r2, =0x00003014 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x4 + bhi _08029430 + lsls r0, 2 + ldr r1, =_08029360 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08029360: + .4byte _08029374 + .4byte _0802937A + .4byte _08029394 + .4byte _080293D8 + .4byte _08029404 +_08029374: + bl sub_802A7A8 + b _08029414 +_0802937A: + bl sub_802A8E8 + cmp r0, 0x1 + bne _0802943A + ldr r0, =0x02022cf8 + ldr r1, [r0] + ldr r2, =0x00003014 + adds r1, r2 + b _0802941C + .pool +_08029394: + ldr r1, =gUnknown_082FAAD8 + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + ldr r1, =gUnknown_082FAF94 + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + ldr r1, =gUnknown_082FAD44 + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + b _08029414 + .pool +_080293D8: + movs r0, 0 + bl ShowBg + movs r0, 0x3 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + ldr r0, =0x02022cf8 + ldr r1, [r0] + ldr r2, =0x00003014 + adds r1, r2 + b _0802941C + .pool +_08029404: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x14] + lsrs r0, 3 + bl sub_8028FF8 + bl sub_802902C +_08029414: + ldr r0, =0x02022cf8 + ldr r1, [r0] + ldr r0, =0x00003014 + adds r1, r0 +_0802941C: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0802943A + .pool +_08029430: + movs r2, 0xC0 + lsls r2, 6 + adds r1, r2 + movs r0, 0x1 + str r0, [r1] +_0802943A: + pop {r0} + bx r0 + thumb_func_end sub_8029338 + + thumb_func_start sub_8029440 +sub_8029440: @ 8029440 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + ldr r4, =0x02022cf8 + ldr r0, [r4] + ldr r2, =0x00003014 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0 + beq _08029488 + cmp r0, 0x1 + bne _08029460 + b _080295EC +_08029460: + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xB4 + bhi _0802946E + b _0802968E +_0802946E: + bl sub_8027650 + lsls r0, 24 + lsrs r7, r0, 24 + movs r6, 0 + cmp r6, r7 + bcc _0802947E + b _08029666 +_0802947E: + b _08029640 + .pool +_08029488: + bl sub_8027650 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =gUnknown_082FB3C8 + subs r0, r7, 0x1 + lsls r0, 2 + adds r0, r1 + ldr r5, [r0] + ldr r2, =0xffffff00 + ldr r0, [sp, 0xC] + ands r0, r2 + ldr r1, =0x00ffffff + ands r0, r1 + movs r1, 0xE0 + lsls r1, 19 + orrs r0, r1 + str r0, [sp, 0xC] + ldr r0, [sp, 0x10] + ands r0, r2 + movs r1, 0x2 + orrs r0, r1 + ldr r1, =0xffff00ff + ands r0, r1 + movs r1, 0xD0 + lsls r1, 4 + orrs r0, r1 + ldr r1, =0x0000ffff + ands r0, r1 + movs r1, 0x98 + lsls r1, 13 + orrs r0, r1 + str r0, [sp, 0x10] + movs r6, 0 + cmp r6, r7 + bcs _080295B8 + mov r3, sp + adds r3, 0xC + str r3, [sp, 0x18] + mov r10, r4 + ldr r0, =0x00003008 + mov r9, r0 +_080294DC: + movs r1, 0 + mov r8, r1 + adds r0, r6, 0 + bl sub_8027A48 + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + bl sub_8027660 + adds r1, r0, 0 + movs r0, 0x1 + movs r2, 0x1 + negs r2, r2 + bl GetStringWidth + movs r1, 0x38 + subs r1, r0 + lsrs r1, 1 + str r1, [sp, 0x14] + ldrb r0, [r5] + lsls r0, 8 + ldr r2, =0xffff00ff + ldr r1, [sp, 0xC] + ands r1, r2 + orrs r1, r0 + str r1, [sp, 0xC] + ldrb r2, [r5, 0x1] + lsls r2, 16 + ldr r0, =0xff00ffff + ands r0, r1 + orrs r0, r2 + str r0, [sp, 0xC] + add r0, sp, 0xC + bl AddWindow + mov r2, r10 + ldr r1, [r2] + add r1, r9 + adds r1, r6 + strb r0, [r1] + ldr r0, [r2] + add r0, r9 + adds r0, r6 + ldrb r0, [r0] + bl ClearWindowTilemap + mov r3, r10 + ldr r0, [r3] + add r0, r9 + adds r0, r6 + ldrb r0, [r0] + movs r1, 0x11 + bl FillWindowPixelBuffer + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _0802955A + movs r0, 0x2 + mov r8, r0 +_0802955A: + adds r0, r4, 0 + bl sub_8027660 + adds r4, r0, 0 + mov r1, r10 + ldr r0, [r1] + add r0, r9 + adds r0, r6 + ldrb r0, [r0] + ldr r3, [sp, 0x14] + lsls r2, r3, 24 + lsrs r2, 24 + mov r3, r8 + lsls r1, r3, 1 + add r1, r8 + ldr r3, =gUnknown_082FB380 + adds r1, r3 + str r1, [sp] + movs r1, 0x1 + negs r1, r1 + str r1, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x1 + bl box_print + mov r2, r10 + ldr r0, [r2] + add r0, r9 + adds r0, r6 + ldrb r0, [r0] + movs r1, 0x2 + bl CopyWindowToVram + ldr r3, [sp, 0x18] + ldrh r0, [r3, 0x6] + adds r0, 0xE + strh r0, [r3, 0x6] + add r0, sp, 0xC + bl sub_8029174 + adds r5, 0x4 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, r7 + bcc _080294DC +_080295B8: + ldr r0, =0x02022cf8 + ldr r1, [r0] + ldr r0, =0x00003014 + adds r1, r0 + b _0802962A + .pool +_080295EC: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0802968E + bl sub_8027650 + lsls r0, 24 + lsrs r7, r0, 24 + movs r6, 0 + cmp r6, r7 + bcs _0802961C +_08029604: + ldr r0, [r4] + ldr r1, =0x00003008 + adds r0, r1 + adds r0, r6 + ldrb r0, [r0] + bl PutWindowTilemap + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, r7 + bcc _08029604 +_0802961C: + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldr r0, =0x02022cf8 + ldr r1, [r0] + ldr r2, =0x00003014 + adds r1, r2 +_0802962A: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0802968E + .pool +_08029640: + ldr r5, =0x02022cf8 + ldr r0, [r5] + ldr r4, =0x00003008 + adds r0, r4 + adds r0, r6 + ldrb r0, [r0] + bl ClearWindowTilemap + ldr r0, [r5] + adds r0, r4 + adds r0, r6 + ldrb r0, [r0] + bl RemoveWindow + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, r7 + bcc _08029640 +_08029666: + movs r0, 0x1E + str r0, [sp] + movs r0, 0x14 + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldr r0, =0x02022cf8 + ldr r0, [r0] + movs r3, 0xC0 + lsls r3, 6 + adds r0, r3 + movs r1, 0x1 + str r1, [r0] +_0802968E: + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8029440 + + thumb_func_start sub_80296A8 +sub_80296A8: @ 80296A8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x6C + lsls r0, 24 + movs r1, 0 + mov r8, r1 + movs r6, 0 + lsrs r7, r0, 24 + add r4, sp, 0x2C + ldr r1, =gUnknown_082FB45C + adds r0, r4, 0 + movs r2, 0x5 + bl memcpy + movs r5, 0 + cmp r5, r7 + bcs _080296F8 + add r4, sp, 0x34 +_080296D2: + mov r0, sp + adds r0, r5 + adds r0, 0x2C + strb r5, [r0] + add r0, sp, 0x5C + adds r1, r5, 0 + bl sub_802793C + lsls r2, r5, 3 + adds r2, r4, r2 + ldr r0, [sp, 0x5C] + ldr r1, [sp, 0x60] + str r0, [r2] + str r1, [r2, 0x4] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r7 + bcc _080296D2 +_080296F8: + bl sub_8027748 + cmp r0, 0 + beq _0802972E +_08029700: + movs r5, 0 + cmp r5, r7 + bcs _08029728 + add r2, sp, 0x34 + add r1, sp, 0x2C +_0802970A: + lsls r0, r5, 3 + adds r0, r2, r0 + ldrb r0, [r0] + cmp r0, r8 + bne _0802971E + adds r0, r1, r6 + strb r5, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0802971E: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r7 + bcc _0802970A +_08029728: + mov r8, r6 + cmp r6, r7 + bcc _08029700 +_0802972E: + movs r5, 0 + ldr r4, =gUnknown_085EDE5D + cmp r5, r7 + bcs _08029754 + add r1, sp, 0x34 + add r6, sp, 0x38 + subs r3, r7, 0x1 +_0802973C: + lsls r2, r5, 3 + adds r0, r6, r2 + ldr r0, [r0] + cmp r0, 0 + bne _0802974A + adds r0, r1, r2 + strb r3, [r0] +_0802974A: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r7 + bcc _0802973C +_08029754: + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0 + bl GetStringWidth + movs r1, 0xD8 + subs r1, r0 + str r1, [sp, 0x64] + movs r5, 0 + cmp r5, r7 + bcs _08029860 + mov r2, sp + adds r2, 0x34 + str r2, [sp, 0x68] + ldr r3, =0x00003009 + mov r10, r3 +_08029774: + movs r0, 0 + mov r8, r0 + mov r0, sp + adds r0, r5 + adds r0, 0x2C + ldrb r0, [r0] + adds r4, r0, 0 + lsls r1, r4, 3 + add r0, sp, 0x38 + adds r0, r1 + ldr r0, [r0] + mov r9, r0 + ldr r2, =0x02022cf8 + ldr r0, [r2] + add r0, r10 + ldrb r0, [r0] + ldr r2, =gUnknown_082FB3DC + ldr r3, [sp, 0x68] + adds r1, r3, r1 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r2 + ldr r2, [r1] + ldr r3, =gUnknown_082FB402 + lsls r1, r5, 1 + adds r1, r3 + ldrb r6, [r1] + str r6, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + mov r3, r8 + str r3, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl Print + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _080297CC + movs r0, 0x2 + mov r8, r0 +_080297CC: + adds r0, r4, 0 + bl sub_8027660 + adds r3, r0, 0 + ldr r1, =0x02022cf8 + ldr r0, [r1] + add r0, r10 + ldrb r0, [r0] + mov r2, r8 + lsls r1, r2, 1 + add r1, r8 + ldr r2, =gUnknown_082FB380 + adds r1, r2 + str r1, [sp] + movs r1, 0x1 + negs r1, r1 + str r1, [sp, 0x4] + str r3, [sp, 0x8] + movs r1, 0x1 + movs r2, 0x1C + adds r3, r6, 0 + bl box_print + add r0, sp, 0xC + mov r1, r9 + movs r2, 0 + movs r3, 0x7 + bl ConvertIntToDecimalString + movs r0, 0x1 + add r1, sp, 0xC + movs r2, 0x1 + negs r2, r2 + bl GetStringWidth + adds r3, r0, 0 + ldr r2, =0x02022cf8 + ldr r0, [r2] + add r0, r10 + ldrb r0, [r0] + ldr r1, [sp, 0x64] + subs r3, r1, r3 + lsls r3, 24 + lsrs r3, 24 + str r6, [sp] + movs r2, 0xFF + str r2, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + add r2, sp, 0xC + bl Print + ldr r2, =0x02022cf8 + ldr r0, [r2] + add r0, r10 + ldrb r0, [r0] + ldr r1, [sp, 0x64] + lsls r3, r1, 24 + str r6, [sp] + movs r2, 0xFF + str r2, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + ldr r2, =gUnknown_085EDE5D + lsrs r3, 24 + bl Print + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r7 + bcc _08029774 +_08029860: + add sp, 0x6C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80296A8 + + thumb_func_start sub_802988C +sub_802988C: @ 802988C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + bl sub_8027650 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0xC] + ldr r6, =0x02022cf8 + ldr r1, [r6] + ldr r2, =0x00003014 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0xB + bls _080298B2 + b _08029FA8 +_080298B2: + lsls r0, 2 + ldr r1, =_080298C8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080298C8: + .4byte _080298F8 + .4byte _08029914 + .4byte _0802996C + .4byte _08029B6C + .4byte _08029BB8 + .4byte _08029BFC + .4byte _08029C60 + .4byte _08029C9C + .4byte _08029CE0 + .4byte _08029DA0 + .4byte _08029F08 + .4byte _08029F5C +_080298F8: + bl sub_802784C + ldr r0, =0x02022cf8 + ldr r1, [r0] + ldr r0, =0x0000301c + adds r2, r1, r0 + movs r0, 0 + strh r0, [r2] + b _08029F8A + .pool +_08029914: + ldr r6, =gUnknown_082F7BBC + adds r0, r6, 0 + bl AddWindow + ldr r4, =0x02022cf8 + ldr r1, [r4] + ldr r2, =0x00003008 + mov r8, r2 + add r1, r8 + strb r0, [r1] + movs r0, 0x8 + adds r0, r6 + mov r9, r0 + bl AddWindow + ldr r1, [r4] + ldr r5, =0x00003009 + adds r1, r5 + strb r0, [r1] + ldr r0, [r4] + add r0, r8 + ldrb r0, [r0] + bl ClearWindowTilemap + ldr r0, [r4] + adds r0, r5 + ldrb r0, [r0] + bl ClearWindowTilemap + adds r0, r6, 0 + bl sub_8029174 + mov r0, r9 + bl sub_8029174 + b _08029F88 + .pool +_0802996C: + ldr r4, =0x02022cf8 + ldr r0, [r4] + ldr r5, =0x00003008 + adds r0, r5 + ldrb r0, [r0] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r0, [r4] + ldr r1, =0x00003009 + mov r9, r1 + add r0, r9 + ldrb r0, [r0] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r2, =gUnknown_085EDD49 + mov r8, r2 + movs r2, 0x1 + negs r2, r2 + movs r0, 0x1 + mov r1, r8 + bl GetStringWidth + adds r1, r0, 0 + movs r0, 0xE0 + subs r0, r1 + lsrs r3, r0, 1 + ldr r0, [r4] + adds r0, r5 + ldrb r0, [r0] + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x1 + str r1, [sp] + movs r6, 0xFF + str r6, [sp, 0x4] + movs r5, 0 + str r5, [sp, 0x8] + mov r2, r8 + bl Print + ldr r0, [r4] + add r0, r9 + ldrb r0, [r0] + ldr r2, =gUnknown_085EDD6B + movs r1, 0x11 + str r1, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x44 + bl Print + mov r9, r5 + ldr r0, [sp, 0xC] + cmp r9, r0 + bcc _080299E2 + b _08029B2A +_080299E2: + movs r4, 0 + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + cmp r9, r0 + bne _080299F2 + movs r4, 0x2 +_080299F2: + mov r0, r9 + bl sub_8027660 + adds r6, r0, 0 + ldr r0, =0x02022cf8 + ldr r0, [r0] + ldr r1, =0x00003009 + adds r0, r1 + ldrb r0, [r0] + mov r2, r9 + lsls r5, r2, 1 + ldr r2, =gUnknown_082FB3F8 + adds r1, r5, r2 + ldrb r3, [r1] + lsls r1, r4, 1 + adds r1, r4 + ldr r2, =gUnknown_082FB380 + adds r1, r2 + str r1, [sp] + movs r4, 0x1 + negs r4, r4 + str r4, [sp, 0x4] + str r6, [sp, 0x8] + movs r1, 0x1 + movs r2, 0 + bl box_print + movs r7, 0 + mov r8, r5 + mov r0, r9 + adds r0, 0x1 + str r0, [sp, 0x10] + ldr r1, =0x02021fc4 + mov r10, r1 +_08029A36: + mov r0, r9 + adds r1, r7, 0 + bl sub_80276A0 + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x0000270f + bl sub_8027A38 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r7, 0 + bl sub_802778C + ldr r1, =0x0000270f + bl sub_8027A38 + lsls r0, 16 + lsrs r6, r0, 16 + mov r0, r10 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x4 + bl ConvertIntToDecimalString + movs r0, 0x1 + mov r1, r10 + movs r2, 0x1 + negs r2, r2 + bl GetStringWidth + adds r5, r0, 0 + cmp r6, r4 + bne _08029AE0 + cmp r6, 0 + beq _08029AE0 + ldr r0, =0x02022cf8 + ldr r0, [r0] + ldr r2, =0x00003009 + adds r0, r2 + ldrb r0, [r0] + lsls r1, r7, 1 + ldr r2, =gUnknown_082FB3F0 + adds r1, r2 + ldrb r2, [r1] + subs r2, r5 + lsls r2, 24 + lsrs r2, 24 + ldr r1, =gUnknown_082FB3F8 + add r1, r8 + ldrb r3, [r1] + ldr r1, =gUnknown_082FB383 + str r1, [sp] + movs r1, 0x1 + negs r1, r1 + str r1, [sp, 0x4] + mov r1, r10 + str r1, [sp, 0x8] + movs r1, 0x1 + bl box_print + b _08029B10 + .pool +_08029AE0: + ldr r0, =0x02022cf8 + ldr r0, [r0] + ldr r2, =0x00003009 + adds r0, r2 + ldrb r0, [r0] + lsls r1, r7, 1 + ldr r2, =gUnknown_082FB3F0 + adds r1, r2 + ldrb r3, [r1] + subs r3, r5 + lsls r3, 24 + lsrs r3, 24 + ldr r1, =gUnknown_082FB3F8 + add r1, r8 + ldrb r1, [r1] + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + ldr r2, =0x02021fc4 + bl Print +_08029B10: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x3 + bls _08029A36 + ldr r1, [sp, 0x10] + lsls r0, r1, 24 + lsrs r0, 24 + mov r9, r0 + ldr r2, [sp, 0xC] + cmp r9, r2 + bcs _08029B2A + b _080299E2 +_08029B2A: + ldr r4, =0x02022cf8 + ldr r0, [r4] + ldr r1, =0x00003008 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0x2 + bl CopyWindowToVram + ldr r0, [r4] + ldr r2, =0x00003009 + adds r0, r2 + ldrb r0, [r0] + movs r1, 0x2 + bl CopyWindowToVram + ldr r1, [r4] + ldr r0, =0x00003014 + adds r1, r0 + b _08029F8E + .pool +_08029B6C: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _08029B90 + ldr r4, =0x02022cf8 + ldr r0, [r4] + ldr r1, =0x00003008 + adds r0, r1 + ldrb r0, [r0] + bl PutWindowTilemap + ldr r0, [r4] + ldr r2, =0x00003009 + adds r0, r2 + ldrb r0, [r0] + bl PutWindowTilemap +_08029B90: + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0 + bl sub_8028C30 + ldr r0, =0x02022cf8 + ldr r1, [r0] + ldr r0, =0x00003014 + adds r1, r0 + b _08029F8E + .pool +_08029BB8: + ldr r4, =0x02022cf8 + ldr r0, [r4] + ldr r1, =0x0000301c + adds r2, r0, r1 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1D + bhi _08029BD0 + b _08029FF8 +_08029BD0: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08029BDE + b _08029FF8 +_08029BDE: + movs r0, 0 + strh r0, [r2] + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + bl sub_8028C30 + b _08029F88 + .pool +_08029BFC: + ldr r4, =0x02022cf8 + ldr r0, [r4] + ldr r5, =0x00003008 + adds r0, r5 + ldrb r0, [r0] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r0, [r4] + ldr r1, =0x00003009 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r6, =gUnknown_085EDD86 + movs r2, 0x1 + negs r2, r2 + movs r0, 0x1 + adds r1, r6, 0 + bl GetStringWidth + adds r1, r0, 0 + movs r0, 0xE0 + subs r0, r1 + lsrs r3, r0, 1 + ldr r0, [r4] + adds r0, r5 + ldrb r0, [r0] + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x1 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r6, 0 + bl Print + b _08029F88 + .pool +_08029C60: + ldr r0, [sp, 0xC] + bl sub_80296A8 + ldr r4, =0x02022cf8 + ldr r0, [r4] + ldr r1, =0x00003008 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0x2 + bl CopyWindowToVram + ldr r0, [r4] + ldr r2, =0x00003009 + adds r0, r2 + ldrb r0, [r0] + movs r1, 0x2 + bl CopyWindowToVram + ldr r1, [r4] + ldr r0, =0x00003014 + adds r1, r0 + b _08029F8E + .pool +_08029C9C: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _08029CC0 + ldr r4, =0x02022cf8 + ldr r0, [r4] + ldr r1, =0x00003008 + adds r0, r1 + ldrb r0, [r0] + bl PutWindowTilemap + ldr r0, [r4] + ldr r2, =0x00003009 + adds r0, r2 + ldrb r0, [r0] + bl PutWindowTilemap +_08029CC0: + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldr r0, =0x02022cf8 + ldr r1, [r0] + ldr r0, =0x00003014 + adds r1, r0 + b _08029F8E + .pool +_08029CE0: + ldr r4, =0x02022cf8 + ldr r0, [r4] + ldr r1, =0x0000301c + adds r2, r0, r1 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1D + bhi _08029CF8 + b _08029FF8 +_08029CF8: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08029D06 + b _08029FF8 +_08029D06: + movs r0, 0 + strh r0, [r2] + movs r0, 0x5 + bl audio_play + bl sub_8027748 + ldr r1, =0x00000bb7 + cmp r0, r1 + bhi _08029D3C + ldr r0, [r4] + ldr r2, =0x00003014 + adds r0, r2 + movs r1, 0x7F + strb r1, [r0] + b _08029D4C + .pool +_08029D3C: + bl sub_80A2F30 + ldr r1, [r4] + ldr r0, =0x00003014 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_08029D4C: + movs r0, 0x1E + str r0, [sp] + movs r0, 0xF + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x5 + bl FillBgTilemapBufferRect_Palette0 + ldr r5, =0x02022cf8 + ldr r0, [r5] + ldr r4, =0x00003009 + adds r0, r4 + ldrb r0, [r0] + bl RemoveWindow + ldr r6, =gUnknown_082F7BCC + adds r0, r6, 0 + bl AddWindow + ldr r1, [r5] + adds r1, r4 + strb r0, [r1] + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + bl ClearWindowTilemap + adds r0, r6, 0 + bl sub_8029174 + b _08029FF8 + .pool +_08029DA0: + ldr r0, =0x0000016f + bl current_map_music_set + ldr r4, =0x02022cf8 + ldr r0, [r4] + ldr r6, =0x00003008 + adds r0, r6 + ldrb r0, [r0] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r0, [r4] + ldr r1, =0x00003009 + mov r10, r1 + add r0, r10 + ldrb r0, [r0] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r5, =gUnknown_085EDD9B + movs r2, 0x1 + negs r2, r2 + movs r0, 0x1 + adds r1, r5, 0 + bl GetStringWidth + adds r1, r0, 0 + movs r0, 0xE0 + subs r0, r1 + lsrs r3, r0, 1 + ldr r0, [r4] + adds r0, r6 + ldrb r0, [r0] + lsls r3, 24 + lsrs r3, 24 + movs r2, 0x1 + mov r9, r2 + str r2, [sp] + movs r1, 0xFF + mov r8, r1 + str r1, [sp, 0x4] + movs r6, 0 + str r6, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + bl Print + bl sub_81AFBF0 + bl sub_802762C + lsls r0, 16 + lsrs r0, 16 + ldr r5, =0x02021cc4 + adds r1, r5, 0 + bl itemid_get_name + movs r0, 0 + adds r1, r5, 0 + bl sub_81AFC0C + ldr r7, =0x02021fc4 + ldr r1, =gUnknown_085EDDBD + adds r0, r7, 0 + bl sub_81AFC28 + ldr r0, [r4] + add r0, r10 + ldrb r0, [r0] + mov r2, r9 + str r2, [sp] + mov r1, r8 + str r1, [sp, 0x4] + str r6, [sp, 0x8] + movs r1, 0x1 + adds r2, r7, 0 + movs r3, 0 + bl Print + bl sub_80279C8 + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + cmp r4, 0 + beq _08029EC8 + cmp r4, 0x3 + beq _08029EC8 + bl sub_81AFBF0 + bl sub_802762C + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + bl itemid_get_name + movs r0, 0 + adds r1, r5, 0 + bl sub_81AFC0C + cmp r4, 0x2 + bne _08029E9C + ldr r1, =gUnknown_085EDDE2 + adds r0, r7, 0 + bl sub_81AFC28 + b _08029EA8 + .pool +_08029E9C: + cmp r6, 0x1 + bne _08029EA8 + ldr r1, =gUnknown_085EDDFB + adds r0, r7, 0 + bl sub_81AFC28 +_08029EA8: + ldr r0, =0x02022cf8 + ldr r0, [r0] + ldr r2, =0x00003009 + adds r0, r2 + ldrb r0, [r0] + ldr r2, =0x02021fc4 + movs r1, 0x29 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print +_08029EC8: + ldr r4, =0x02022cf8 + ldr r0, [r4] + ldr r1, =0x00003008 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0x2 + bl CopyWindowToVram + ldr r0, [r4] + ldr r2, =0x00003009 + adds r0, r2 + ldrb r0, [r0] + movs r1, 0x2 + bl CopyWindowToVram + ldr r1, [r4] + ldr r0, =0x00003014 + adds r1, r0 + b _08029F8E + .pool +_08029F08: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _08029F2C + ldr r4, =0x02022cf8 + ldr r0, [r4] + ldr r1, =0x00003008 + adds r0, r1 + ldrb r0, [r0] + bl PutWindowTilemap + ldr r0, [r4] + ldr r2, =0x00003009 + adds r0, r2 + ldrb r0, [r0] + bl PutWindowTilemap +_08029F2C: + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldr r0, =0x0000020b + movs r1, 0x14 + movs r2, 0xA + bl sub_80A2FBC + ldr r0, =0x02022cf8 + ldr r1, [r0] + ldr r0, =0x00003014 + adds r1, r0 + b _08029F8E + .pool +_08029F5C: + ldr r4, =0x02022cf8 + ldr r0, [r4] + ldr r1, =0x0000301c + adds r2, r0, r1 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1D + bls _08029FF8 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08029FF8 + movs r0, 0 + strh r0, [r2] + movs r0, 0x5 + bl audio_play +_08029F88: + ldr r1, [r4] +_08029F8A: + ldr r2, =0x00003014 + adds r1, r2 +_08029F8E: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08029FF8 + .pool +_08029FA8: + ldr r5, =0x00003008 + adds r0, r1, r5 + ldrb r0, [r0] + bl ClearWindowTilemap + ldr r0, [r6] + ldr r4, =0x00003009 + adds r0, r4 + ldrb r0, [r0] + bl ClearWindowTilemap + ldr r0, [r6] + adds r0, r5 + ldrb r0, [r0] + bl RemoveWindow + ldr r0, [r6] + adds r0, r4 + ldrb r0, [r0] + bl RemoveWindow + movs r0, 0x1E + str r0, [sp] + movs r0, 0x14 + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldr r0, [r6] + movs r1, 0xC0 + lsls r1, 6 + adds r0, r1 + movs r1, 0x1 + str r1, [r0] +_08029FF8: + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802988C + + thumb_func_start sub_802A010 +sub_802A010: @ 802A010 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + ldr r1, =0x02022cf8 + ldr r2, [r1] + ldr r3, =0x00003014 + adds r0, r2, r3 + ldrb r6, [r0] + adds r7, r1, 0 + cmp r6, 0x1 + beq _0802A0CC + cmp r6, 0x1 + bgt _0802A040 + cmp r6, 0 + beq _0802A04E + b _0802A2FC + .pool +_0802A040: + cmp r6, 0x2 + bne _0802A046 + b _0802A194 +_0802A046: + cmp r6, 0x3 + bne _0802A04C + b _0802A1D0 +_0802A04C: + b _0802A2FC +_0802A04E: + ldr r0, =gUnknown_082F7BD4 + mov r9, r0 + bl AddWindow + ldr r1, [r7] + ldr r4, =0x00003008 + adds r1, r4 + strb r0, [r1] + movs r1, 0x8 + add r1, r9 + mov r8, r1 + mov r0, r8 + bl AddWindow + ldr r1, [r7] + ldr r2, =0x00003009 + adds r1, r2 + strb r0, [r1] + ldr r0, [r7] + adds r0, r4 + ldrb r0, [r0] + bl ClearWindowTilemap + ldr r0, [r7] + ldr r3, =0x00003009 + adds r0, r3 + ldrb r0, [r0] + bl ClearWindowTilemap + mov r0, r9 + bl sub_8029174 + mov r0, r8 + bl sub_8029074 + ldr r1, [r7] + ldr r0, =0x00003014 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r7] + ldr r1, =0x00003020 + adds r0, r1 + strb r6, [r0] + ldr r0, [r7] + ldr r2, =0x00003024 + adds r0, r2 + strb r6, [r0] + b _0802A35E + .pool +_0802A0CC: + ldr r3, =0x00003008 + mov r8, r3 + adds r0, r2, r3 + ldrb r0, [r0] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r0, [r7] + ldr r1, =0x00003009 + mov r10, r1 + add r0, r10 + ldrb r0, [r0] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r0, [r7] + add r0, r8 + ldrb r0, [r0] + ldr r2, =gUnknown_085EDE18 + movs r1, 0x5 + str r1, [sp] + movs r3, 0xFF + mov r9, r3 + str r3, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + ldr r0, [r7] + add r0, r10 + ldrb r0, [r0] + ldr r2, =gUnknown_085EAE62 + str r6, [sp] + mov r3, r9 + str r3, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl Print + ldr r0, [r7] + add r0, r10 + ldrb r0, [r0] + ldr r2, =gUnknown_085EAE66 + movs r1, 0x11 + str r1, [sp] + mov r3, r9 + str r3, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl Print + ldr r0, [r7] + add r0, r10 + ldrb r0, [r0] + ldr r2, =gUnknown_085E8D60 + str r6, [sp] + mov r3, r9 + str r3, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + ldr r0, [r7] + add r0, r8 + ldrb r0, [r0] + movs r1, 0x2 + bl CopyWindowToVram + ldr r0, [r7] + add r0, r10 + ldrb r0, [r0] + movs r1, 0x2 + bl CopyWindowToVram + ldr r1, [r7] + ldr r2, =0x00003014 + adds r1, r2 + b _0802A2EA + .pool +_0802A194: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0802A1B6 + ldr r0, [r7] + ldr r3, =0x00003008 + adds r0, r3 + ldrb r0, [r0] + bl PutWindowTilemap + ldr r0, [r7] + ldr r1, =0x00003009 + adds r0, r1 + ldrb r0, [r0] + bl PutWindowTilemap +_0802A1B6: + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldr r1, [r7] + ldr r2, =0x00003014 + adds r1, r2 + b _0802A2EA + .pool +_0802A1D0: + ldr r3, =0x00003020 + adds r0, r2, r3 + ldrb r5, [r0] + cmp r5, 0 + bne _0802A1DC + movs r5, 0x1 +_0802A1DC: + ldr r0, =0x00003009 + mov r8, r0 + adds r0, r2, r0 + ldrb r0, [r0] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r0, [r7] + add r0, r8 + ldrb r0, [r0] + ldr r2, =gUnknown_085EAE62 + movs r1, 0x1 + str r1, [sp] + movs r3, 0xFF + mov r10, r3 + str r3, [sp, 0x4] + movs r1, 0 + mov r9, r1 + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl Print + ldr r0, [r7] + add r0, r8 + ldrb r0, [r0] + ldr r2, =gUnknown_085EAE66 + movs r1, 0x11 + str r1, [sp] + mov r3, r10 + str r3, [sp, 0x4] + mov r1, r9 + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl Print + ldr r0, [r7] + add r0, r8 + ldrb r0, [r0] + ldr r2, =gUnknown_085E8D60 + subs r1, r5, 0x1 + lsls r1, 4 + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + mov r3, r10 + str r3, [sp, 0x4] + mov r1, r9 + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + ldr r0, [r7] + add r0, r8 + ldrb r0, [r0] + movs r1, 0x3 + bl CopyWindowToVram + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r5, 0x1 + movs r2, 0x1 + ands r2, r1 + cmp r2, 0 + beq _0802A294 + movs r0, 0x5 + bl audio_play + ldr r0, [r7] + ldr r3, =0x00003020 + adds r1, r0, r3 + ldrb r0, [r1] + cmp r0, 0 + bne _0802A2E4 + strb r5, [r1] + b _0802A2E4 + .pool +_0802A294: + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0 + beq _0802A2CC + movs r0, 0x5 + bl audio_play + ldr r0, [r7] + ldr r2, =0x00003020 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0x1 + beq _0802A2C2 + cmp r0, 0x1 + bgt _0802A2BC + cmp r0, 0 + beq _0802A2C2 + b _0802A35E + .pool +_0802A2BC: + cmp r0, 0x2 + beq _0802A2C8 + b _0802A35E +_0802A2C2: + movs r0, 0x2 + strb r0, [r1] + b _0802A35E +_0802A2C8: + strb r5, [r1] + b _0802A35E +_0802A2CC: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0802A35E + movs r0, 0x5 + bl audio_play + ldr r0, [r7] + ldr r3, =0x00003020 + adds r0, r3 + movs r1, 0x2 + strb r1, [r0] +_0802A2E4: + ldr r1, [r7] + ldr r0, =0x00003014 + adds r1, r0 +_0802A2EA: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0802A35E + .pool +_0802A2FC: + ldr r0, [r7] + ldr r2, =0x00003020 + adds r1, r0, r2 + ldrb r1, [r1] + ldr r3, =0x00003024 + adds r0, r3 + strb r1, [r0] + ldr r0, [r7] + ldr r6, =0x00003008 + adds r0, r6 + ldrb r0, [r0] + bl ClearWindowTilemap + ldr r0, [r7] + ldr r1, =0x00003009 + adds r0, r1 + ldrb r0, [r0] + bl ClearWindowTilemap + ldr r0, [r7] + adds r0, r6 + ldrb r0, [r0] + bl RemoveWindow + ldr r0, [r7] + ldr r2, =0x00003009 + adds r0, r2 + ldrb r0, [r0] + bl RemoveWindow + movs r0, 0x1E + str r0, [sp] + movs r0, 0x14 + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldr r0, [r7] + movs r3, 0xC0 + lsls r3, 6 + adds r0, r3 + movs r1, 0x1 + str r1, [r0] +_0802A35E: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802A010 + + thumb_func_start sub_802A380 +sub_802A380: @ 802A380 + push {r4-r6,lr} + sub sp, 0x10 + ldr r5, =0x02022cf8 + ldr r0, [r5] + ldr r6, =0x00003014 + adds r0, r6 + ldrb r4, [r0] + cmp r4, 0x1 + beq _0802A3D8 + cmp r4, 0x1 + bgt _0802A3A4 + cmp r4, 0 + beq _0802A3AE + b _0802A420 + .pool +_0802A3A4: + cmp r4, 0x2 + beq _0802A3EC + cmp r4, 0x3 + beq _0802A404 + b _0802A420 +_0802A3AE: + movs r0, 0 + movs r1, 0 + bl sub_81973C4 + ldr r2, =gUnknown_082C8959 + str r4, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0 + movs r1, 0x1 + movs r3, 0 + bl AddTextPrinterParametrized + b _0802A410 + .pool +_0802A3D8: + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + ldr r1, [r5] + ldr r0, =0x00003014 + adds r1, r0 + b _0802A414 + .pool +_0802A3EC: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0802A448 + ldr r0, =sub_8153688 + movs r1, 0 + bl AddTask + b _0802A410 + .pool +_0802A404: + ldr r0, =sub_8153688 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _0802A448 +_0802A410: + ldr r1, [r5] + adds r1, r6 +_0802A414: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0802A448 + .pool +_0802A420: + movs r0, 0x1E + str r0, [sp] + movs r0, 0x14 + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldr r0, =0x02022cf8 + ldr r0, [r0] + movs r1, 0xC0 + lsls r1, 6 + adds r0, r1 + movs r1, 0x1 + str r1, [r0] +_0802A448: + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802A380 + + thumb_func_start sub_802A454 +sub_802A454: @ 802A454 + push {r4-r6,lr} + sub sp, 0xC + ldr r1, =0x02022cf8 + ldr r2, [r1] + ldr r6, =0x00003014 + adds r0, r2, r6 + ldrb r0, [r0] + adds r5, r1, 0 + cmp r0, 0x1 + beq _0802A4AC + cmp r0, 0x1 + bgt _0802A47C + cmp r0, 0 + beq _0802A482 + b _0802A520 + .pool +_0802A47C: + cmp r0, 0x2 + beq _0802A4F4 + b _0802A520 +_0802A482: + ldr r4, =gUnknown_082F7BEC + adds r0, r4, 0 + bl AddWindow + ldr r1, [r5] + ldr r2, =0x00003008 + adds r1, r2 + strb r0, [r1] + ldr r0, [r5] + adds r0, r2 + ldrb r0, [r0] + bl ClearWindowTilemap + adds r0, r4, 0 + bl sub_8029174 + b _0802A510 + .pool +_0802A4AC: + ldr r4, =0x00003008 + adds r0, r2, r4 + ldrb r0, [r0] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + ldr r2, =gUnknown_085EDE65 + movs r1, 0x5 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + movs r1, 0x2 + bl CopyWindowToVram + ldr r1, [r5] + ldr r0, =0x00003014 + adds r1, r0 + b _0802A514 + .pool +_0802A4F4: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0802A50A + ldr r0, [r5] + ldr r1, =0x00003008 + adds r0, r1 + ldrb r0, [r0] + bl PutWindowTilemap +_0802A50A: + movs r0, 0 + bl CopyBgTilemapBufferToVram +_0802A510: + ldr r1, [r5] + adds r1, r6 +_0802A514: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0802A52C + .pool +_0802A520: + ldr r0, [r5] + movs r1, 0xC0 + lsls r1, 6 + adds r0, r1 + movs r1, 0x1 + str r1, [r0] +_0802A52C: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_802A454 + + thumb_func_start sub_802A534 +sub_802A534: @ 802A534 + push {r4,r5,lr} + sub sp, 0x8 + ldr r5, =0x02022cf8 + ldr r0, [r5] + ldr r4, =0x00003008 + adds r0, r4 + ldrb r0, [r0] + bl ClearWindowTilemap + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + bl RemoveWindow + movs r0, 0x1E + str r0, [sp] + movs r0, 0x14 + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldr r0, [r5] + movs r1, 0xC0 + lsls r1, 6 + adds r0, r1 + movs r1, 0x1 + str r1, [r0] + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802A534 + + thumb_func_start sub_802A588 +sub_802A588: @ 802A588 + push {r4-r7,lr} + sub sp, 0xC + ldr r0, =0x02022cf8 + ldr r1, [r0] + ldr r7, =0x00003014 + adds r2, r1, r7 + ldrb r5, [r2] + adds r6, r0, 0 + cmp r5, 0x1 + beq _0802A610 + cmp r5, 0x1 + bgt _0802A5B0 + cmp r5, 0 + beq _0802A5BA + b _0802A6A4 + .pool +_0802A5B0: + cmp r5, 0x2 + beq _0802A658 + cmp r5, 0x3 + beq _0802A684 + b _0802A6A4 +_0802A5BA: + ldr r4, =gUnknown_082F7BE4 + adds r0, r4, 0 + bl AddWindow + ldr r1, [r6] + ldr r2, =0x00003008 + adds r1, r2 + strb r0, [r1] + ldr r0, [r6] + adds r0, r2 + ldrb r0, [r0] + bl ClearWindowTilemap + adds r0, r4, 0 + bl sub_8029174 + ldr r1, [r6] + adds r1, r7 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r6] + ldr r2, =0x0000301c + adds r1, r0, r2 + movs r2, 0 + strh r5, [r1] + ldr r1, =0x00003020 + adds r0, r1 + strb r2, [r0] + ldr r0, [r6] + adds r1, 0x4 + adds r0, r1 + strb r2, [r0] + b _0802A6EA + .pool +_0802A610: + ldr r4, =0x00003008 + adds r0, r1, r4 + ldrb r0, [r0] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r0, [r6] + adds r0, r4 + ldrb r0, [r0] + ldr r2, =gUnknown_085EDE2C + movs r1, 0x5 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + ldr r0, [r6] + adds r0, r4 + ldrb r0, [r0] + movs r1, 0x2 + bl CopyWindowToVram + ldr r1, [r6] + ldr r2, =0x00003014 + adds r1, r2 + b _0802A678 + .pool +_0802A658: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0802A66E + ldr r0, [r6] + ldr r1, =0x00003008 + adds r0, r1 + ldrb r0, [r0] + bl PutWindowTilemap +_0802A66E: + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldr r1, [r6] + adds r1, r7 +_0802A678: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0802A6EA + .pool +_0802A684: + ldr r0, =0x0000301c + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x77 + bls _0802A6EA + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + b _0802A6EA + .pool +_0802A6A4: + ldr r0, [r6] + ldr r1, =0x00003024 + adds r0, r1 + movs r1, 0x5 + strb r1, [r0] + ldr r0, [r6] + ldr r4, =0x00003008 + adds r0, r4 + ldrb r0, [r0] + bl ClearWindowTilemap + ldr r0, [r6] + adds r0, r4 + ldrb r0, [r0] + bl RemoveWindow + movs r0, 0x1E + str r0, [sp] + movs r0, 0x14 + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldr r0, [r6] + movs r2, 0xC0 + lsls r2, 6 + adds r0, r2 + movs r1, 0x1 + str r1, [r0] +_0802A6EA: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802A588 + + thumb_func_start unused_0 +unused_0: @ 802A6FC + push {r4,lr} + ldr r4, =0x02022cf8 + ldr r0, [r4] + ldr r1, =0x00003004 + adds r0, r1 + ldrb r0, [r0] + bl remove_task + ldr r0, [r4] + movs r1, 0xC0 + lsls r1, 6 + adds r0, r1 + movs r1, 0x1 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end unused_0 + + thumb_func_start nullsub_16 +nullsub_16: @ 802A728 + bx lr + thumb_func_end nullsub_16 + + thumb_func_start sub_802A72C +sub_802A72C: @ 802A72C + push {r4,lr} + ldr r2, =0x02022cf8 + ldr r1, [r2] + ldr r3, =0x00003014 + adds r1, r3 + movs r3, 0 + strb r3, [r1] + ldr r1, [r2] + movs r4, 0xC0 + lsls r4, 6 + adds r2, r1, r4 + str r3, [r2] + ldr r2, =0x00003028 + adds r1, r2 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802A72C + + thumb_func_start sub_802A75C +sub_802A75C: @ 802A75C + ldr r0, =0x02022cf8 + ldr r0, [r0] + ldr r1, =0x00003028 + adds r0, r1 + ldr r0, [r0] + bx lr + .pool + thumb_func_end sub_802A75C + + thumb_func_start sub_802A770 +sub_802A770: @ 802A770 + push {lr} + ldr r0, =0x02022cf8 + ldr r0, [r0] + movs r1, 0xC0 + lsls r1, 6 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0x1 + beq _0802A78C + movs r0, 0x1 + b _0802A78E + .pool +_0802A78C: + movs r0, 0 +_0802A78E: + pop {r1} + bx r1 + thumb_func_end sub_802A770 + + thumb_func_start sub_802A794 +sub_802A794: @ 802A794 + ldr r0, =0x02022cf8 + ldr r0, [r0] + ldr r1, =0x00003024 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_802A794 + + thumb_func_start sub_802A7A8 +sub_802A7A8: @ 802A7A8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + movs r3, 0xC0 + lsls r3, 19 + movs r4, 0xC0 + lsls r4, 9 + add r0, sp, 0x4 + mov r8, r0 + mov r2, sp + movs r6, 0 + ldr r1, =0x040000d4 + movs r5, 0x80 + lsls r5, 5 + ldr r7, =0x81000800 + movs r0, 0x81 + lsls r0, 24 + mov r12, r0 +_0802A7CE: + strh r6, [r2] + mov r0, sp + str r0, [r1] + str r3, [r1, 0x4] + str r7, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r3, r5 + subs r4, r5 + cmp r4, r5 + bhi _0802A7CE + strh r6, [r2] + mov r2, sp + str r2, [r1] + str r3, [r1, 0x4] + lsrs r0, r4, 1 + mov r2, r12 + orrs r0, r2 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r0, 0xE0 + lsls r0, 19 + movs r3, 0x80 + lsls r3, 3 + movs r4, 0 + str r4, [sp, 0x4] + ldr r2, =0x040000d4 + mov r1, r8 + str r1, [r2] + str r0, [r2, 0x4] + lsrs r0, r3, 2 + movs r1, 0x85 + lsls r1, 24 + orrs r0, r1 + str r0, [r2, 0x8] + ldr r0, [r2, 0x8] + movs r1, 0xA0 + lsls r1, 19 + mov r0, sp + strh r4, [r0] + str r0, [r2] + str r1, [r2, 0x4] + lsrs r3, 1 + movs r0, 0x81 + lsls r0, 24 + orrs r3, r0 + str r3, [r2, 0x8] + ldr r0, [r2, 0x8] + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_082F7BA4 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + bl sub_81971D0 + bl sub_8197200 + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + ldr r4, =0x02022cf8 + ldr r1, [r4] + movs r0, 0x3 + bl SetBgTilemapBuffer + ldr r1, [r4] + movs r2, 0x80 + lsls r2, 5 + adds r1, r2 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, [r4] + movs r0, 0x80 + lsls r0, 6 + adds r1, r0 + movs r0, 0x2 + bl SetBgTilemapBuffer + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802A7A8 + + thumb_func_start sub_802A8E8 +sub_802A8E8: @ 802A8E8 + push {lr} + sub sp, 0x4 + ldr r0, =0x02022cf8 + ldr r0, [r0] + ldr r2, =0x00003018 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0x5 + bhi _0802A982 + lsls r0, 2 + ldr r1, =_0802A910 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0802A910: + .4byte _0802A928 + .4byte _0802A938 + .4byte _0802A93E + .4byte _0802A94C + .4byte _0802A964 + .4byte _0802A972 +_0802A928: + ldr r0, =gUnknown_082F7DF0 + movs r1, 0 + movs r2, 0x40 + bl gpu_pal_apply + b _0802A98A + .pool +_0802A938: + bl reset_temp_tile_data_buffers + b _0802A98A +_0802A93E: + ldr r1, =gUnknown_082F8084 + movs r0, 0 + str r0, [sp] + movs r0, 0x3 + b _0802A954 + .pool +_0802A94C: + ldr r1, =gUnknown_082F8914 + movs r0, 0 + str r0, [sp] + movs r0, 0x1 +_0802A954: + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + b _0802A98A + .pool +_0802A964: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0802A98A + b _0802A998 +_0802A972: + movs r0, 0x3 + bl stdpal_get + movs r1, 0xD0 + movs r2, 0x20 + bl gpu_pal_apply + b _0802A98A +_0802A982: + movs r0, 0 + strb r0, [r1] + movs r0, 0x1 + b _0802A99A +_0802A98A: + ldr r0, =0x02022cf8 + ldr r1, [r0] + ldr r0, =0x00003018 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0802A998: + movs r0, 0 +_0802A99A: + add sp, 0x4 + pop {r1} + bx r1 + .pool + thumb_func_end sub_802A8E8 + + thumb_func_start sub_802A9A8 +sub_802A9A8: @ 802A9A8 + push {r4-r7,lr} + adds r6, r1, 0 + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _0802AA3C + ldr r5, =0x02022cfc + ldr r0, =0x000083b0 + bl Alloc + str r0, [r5] + cmp r0, 0 + beq _0802AA3C + bl clear_tasks + ldr r0, =sub_802ACA0 + movs r1, 0x1 + bl AddTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, [r5] + movs r1, 0 + strh r1, [r0, 0x8] + str r6, [r0] + strb r4, [r0, 0x4] + bl link_get_multiplayer_id + ldr r1, [r5] + strb r0, [r1, 0x6] + ldr r0, [r5] + ldrb r2, [r0, 0x6] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + ldr r2, =0x000082a8 + adds r1, r2 + adds r0, r1 + movs r1, 0x64 + muls r1, r7 + ldr r2, =0x020244ec + adds r1, r2 + bl sub_802AC2C + ldr r0, [r5] + bl sub_802AA60 + ldr r2, [r5] + adds r0, r4, 0 + movs r1, 0x2 + bl set_word_task_arg + ldr r0, =sub_802AC6C + bl SetMainCallback2 + b _0802AA42 + .pool +_0802AA3C: + adds r0, r6, 0 + bl SetMainCallback2 +_0802AA42: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_802A9A8 + + thumb_func_start sub_802AA48 +sub_802AA48: @ 802AA48 + push {lr} + bl sub_802D0AC + ldr r0, =0x02022cfc + ldr r0, [r0] + bl Free + pop {r0} + bx r0 + .pool + thumb_func_end sub_802AA48 + + thumb_func_start sub_802AA60 +sub_802AA60: @ 802AA60 + push {r4,lr} + adds r4, r0, 0 + bl sub_8009FCC + movs r2, 0 + strb r0, [r4, 0x5] + adds r1, r4, 0 + adds r1, 0x70 + movs r0, 0x5 + strb r0, [r1] + adds r0, r4, 0 + adds r0, 0x72 + strh r2, [r0] + bl sub_802AB20 + adds r0, r4, 0 + bl sub_802AA94 + ldrb r0, [r4, 0x5] + cmp r0, 0x5 + bne _0802AA8E + bl sub_802E3A8 +_0802AA8E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_802AA60 + + thumb_func_start sub_802AA94 +sub_802AA94: @ 802AA94 + push {r4-r6,lr} + adds r4, r0, 0 + movs r0, 0x6 + str r0, [r4, 0x14] + str r0, [r4, 0x18] + adds r0, r4, 0 + adds r0, 0x4A + movs r6, 0 + movs r5, 0 + strh r5, [r0] + str r5, [r4, 0x1C] + str r5, [r4, 0x5C] + bl link_get_multiplayer_id + movs r1, 0 + lsls r0, 24 + cmp r0, 0 + bne _0802AABA + movs r1, 0x1 +_0802AABA: + adds r0, r4, 0 + adds r0, 0x47 + strb r1, [r0] + strh r5, [r4, 0x8] + strh r5, [r4, 0xA] + strh r5, [r4, 0xC] + strh r5, [r4, 0xE] + str r5, [r4, 0x58] + strh r5, [r4, 0x3A] + subs r0, 0x3 + strb r6, [r0] + str r5, [r4, 0x54] + adds r0, 0x2 + strb r6, [r0] + adds r0, 0x3 + strb r6, [r0] + subs r0, 0x1 + movs r1, 0x1 + strb r1, [r0] + str r5, [r4, 0x78] + adds r0, 0x29 + strb r6, [r0] + adds r0, 0x3 + strh r5, [r0] + str r1, [r4, 0x60] + subs r0, 0x27 + strb r6, [r0] + str r5, [r4, 0x68] + str r5, [r4, 0x64] + str r5, [r4, 0x2C] + str r5, [r4, 0x30] + bl sub_802AB98 + bl sub_802C0E8 + movs r2, 0 + adds r5, r4, 0 + adds r5, 0x7C + movs r3, 0 + adds r1, r4, 0 + adds r1, 0x9A +_0802AB0C: + adds r0, r5, r2 + strb r3, [r0] + strh r3, [r1] + adds r1, 0x2 + adds r2, 0x1 + cmp r2, 0x4 + ble _0802AB0C + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_802AA94 + + thumb_func_start sub_802AB20 +sub_802AB20: @ 802AB20 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r7, =0x02022cfc + movs r6, 0 + movs r5, 0 + ldr r0, =gUnknown_082FB464 + mov r8, r0 + movs r4, 0x4 +_0802AB32: + ldr r0, [r7] + adds r0, r5 + ldr r1, =0x000082a8 + adds r0, r1 + ldrh r0, [r0] + bl sub_802AC00 + lsls r0, 16 + ldr r1, [r7] + adds r1, r6 + asrs r0, 14 + add r0, r8 + ldrh r0, [r0, 0x2] + ldr r2, =0x000082f0 + adds r1, r2 + strh r0, [r1] + adds r6, 0x28 + adds r5, 0xC + subs r4, 0x1 + cmp r4, 0 + bge _0802AB32 + ldr r0, =0x02022cfc + ldr r1, [r0] + ldr r0, =0x000083ac + adds r3, r1, r0 + ldrb r2, [r1, 0x6] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r2, =0x000082e4 + adds r0, r2 + adds r1, r0 + str r1, [r3] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802AB20 + + thumb_func_start sub_802AB98 +sub_802AB98: @ 802AB98 + push {r4-r7,lr} + movs r5, 0 + ldr r6, =0x02022cfc + movs r4, 0 + movs r3, 0 +_0802ABA2: + ldr r2, [r6] + adds r1, r2, r3 + ldr r7, =0x000082f2 + adds r0, r1, r7 + strh r4, [r0] + adds r7, 0x2 + adds r0, r1, r7 + strh r4, [r0] + ldr r0, =0x000082f6 + adds r1, r0 + strh r4, [r1] + ldr r1, =0x000082e4 + adds r0, r2, r1 + adds r0, r3 + str r4, [r0] + subs r7, 0xC + adds r0, r2, r7 + adds r0, r3 + ldr r1, =0x7fffffff + str r1, [r0] + ldr r1, =0x000082f8 + adds r0, r2, r1 + adds r0, r3 + str r4, [r0] + adds r2, 0x8B + adds r2, r5 + movs r0, 0x9 + strb r0, [r2] + adds r3, 0x28 + adds r5, 0x1 + cmp r5, 0x4 + ble _0802ABA2 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802AB98 + + thumb_func_start sub_802AC00 +sub_802AC00: @ 802AC00 + push {lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r1, 0 + ldr r2, =gUnknown_082FB464 +_0802AC0A: + ldrh r0, [r2] + cmp r0, r3 + bne _0802AC1C + lsls r0, r1, 16 + asrs r0, 16 + b _0802AC28 + .pool +_0802AC1C: + adds r2, 0x4 + adds r1, 0x1 + cmp r1, 0x63 + bls _0802AC0A + movs r0, 0x1 + negs r0, r0 +_0802AC28: + pop {r1} + bx r1 + thumb_func_end sub_802AC00 + + thumb_func_start sub_802AC2C +sub_802AC2C: @ 802AC2C + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + strh r0, [r5] + adds r0, r4, 0 + movs r1, 0x1 + bl pokemon_getattr + str r0, [r5, 0x4] + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + str r0, [r5, 0x8] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_802AC2C + + thumb_func_start sub_802AC58 +sub_802AC58: @ 802AC58 + push {lr} + bl copy_pal_bg_faded_to_pal_ram + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + pop {r0} + bx r0 + thumb_func_end sub_802AC58 + + thumb_func_start sub_802AC6C +sub_802AC6C: @ 802AC6C + push {lr} + bl RunActiveTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_802AC6C + + thumb_func_start sub_802AC84 +sub_802AC84: @ 802AC84 + push {lr} + movs r1, 0x1 + bl AddTask + ldr r2, =0x02022cfc + ldr r1, [r2] + movs r3, 0 + strb r0, [r1, 0x4] + ldr r0, [r2] + strh r3, [r0, 0x8] + pop {r0} + bx r0 + .pool + thumb_func_end sub_802AC84 + + thumb_func_start sub_802ACA0 +sub_802ACA0: @ 802ACA0 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x02022cfc + ldr r0, [r1] + ldrh r0, [r0, 0x8] + adds r2, r1, 0 + cmp r0, 0x5 + bls _0802ACB6 + b _0802AE08 +_0802ACB6: + lsls r0, 2 + ldr r1, =_0802ACC8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0802ACC8: + .4byte _0802ACE0 + .4byte _0802AD0C + .4byte _0802AD3C + .4byte _0802AD68 + .4byte _0802ADA4 + .4byte _0802ADD0 +_0802ACE0: + movs r0, 0 + bl SetVBlankCallback + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + ldr r0, =sub_802BD84 + movs r1, 0x5 + bl sub_802BE60 + movs r0, 0x4 + bl sub_80A2F50 + ldr r0, =0x02022cfc + ldr r1, [r0] + b _0802ADC0 + .pool +_0802AD0C: + ldr r0, =sub_802BD84 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _0802AE08 + ldr r4, =0x02022cfc + ldr r0, [r4] + adds r0, 0xA4 + bl sub_802D074 + bl sub_800E0E8 + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + ldr r1, [r4] + b _0802ADC0 + .pool +_0802AD3C: + bl sub_802D0F0 + cmp r0, 0 + bne _0802AE08 + bl sub_80A303C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0802AE08 + ldr r0, =0x0000021a + movs r1, 0x8 + bl sub_80A2F88 + ldr r0, =0x02022cfc + ldr r1, [r0] + b _0802ADC0 + .pool +_0802AD68: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _0802AE08 + movs r4, 0x1 + negs r4, r4 + adds r0, r4, 0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r0, =sub_802AC58 + bl SetVBlankCallback + ldr r0, =0x02022cfc + ldr r1, [r0] + b _0802ADC0 + .pool +_0802ADA4: + bl fade_and_return_progress_probably + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _0802AE08 + ldr r1, =0x02022cfc + ldr r0, [r1] + strb r2, [r0, 0x7] + ldr r1, [r1] +_0802ADC0: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0802AE08 + .pool +_0802ADD0: + ldr r0, [r2] + ldrb r1, [r0, 0x7] + adds r1, 0x1 + strb r1, [r0, 0x7] + ldr r1, [r2] + ldrb r0, [r1, 0x7] + cmp r0, 0x13 + bls _0802AE08 + adds r0, r1, 0 + adds r0, 0x47 + ldrb r0, [r0] + cmp r0, 0 + beq _0802ADF8 + ldr r0, =sub_802AF80 + bl sub_802AC84 + b _0802ADFE + .pool +_0802ADF8: + ldr r0, =sub_802B194 + bl sub_802AC84 +_0802ADFE: + bl sub_802BE80 + adds r0, r4, 0 + bl remove_task +_0802AE08: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802ACA0 + + thumb_func_start sub_802AE14 +sub_802AE14: @ 802AE14 + push {lr} + adds r1, r0, 0 + cmp r1, 0 + bne _0802AE34 + ldr r0, =0x02022cfc + ldr r1, [r0] + ldr r0, =0x00001111 + str r0, [r1, 0x30] + movs r0, 0x1 + str r0, [r1, 0x2C] + b _0802AE46 + .pool +_0802AE34: + ldr r0, =0x02022cfc + ldr r2, [r0] + subs r1, 0x1 + movs r0, 0x1 + lsls r0, r1 + subs r0, 0x1 + str r0, [r2, 0x30] + movs r0, 0 + str r0, [r2, 0x2C] +_0802AE46: + pop {r0} + bx r0 + .pool + thumb_func_end sub_802AE14 + + thumb_func_start sub_802AE50 +sub_802AE50: @ 802AE50 + push {r4-r6,lr} + ldr r4, =0x02022cfc + ldr r1, [r4] + adds r1, 0x70 + movs r2, 0 + strb r0, [r1] + ldr r0, [r4] + movs r3, 0 + strh r2, [r0, 0x8] + strh r2, [r0, 0xA] + adds r0, 0x48 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x49 + strb r3, [r0] + movs r3, 0x1 + ldr r0, [r4] + ldrb r0, [r0, 0x5] + cmp r3, r0 + bge _0802AE94 + adds r6, r4, 0 + ldr r5, =0x000082fc + movs r4, 0 + movs r2, 0x28 +_0802AE82: + ldr r1, [r6] + adds r0, r1, r5 + adds r0, r2 + str r4, [r0] + adds r2, 0x28 + adds r3, 0x1 + ldrb r1, [r1, 0x5] + cmp r3, r1 + blt _0802AE82 +_0802AE94: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802AE50 + + thumb_func_start sub_802AEA4 +sub_802AEA4: @ 802AEA4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + movs r4, 0x1 + movs r0, 0 + str r0, [sp, 0x4] + ldr r7, =0x02022cfc + ldr r0, [r7] + ldrb r0, [r0, 0x5] + cmp r4, r0 + bge _0802AF48 + adds r1, r7, 0 + mov r10, r1 + movs r2, 0x2 + add r2, sp + mov r8, r2 + ldr r3, =0x0000830c + mov r9, r3 + movs r6, 0x28 +_0802AED0: + mov r1, r10 + ldr r0, [r1] + adds r1, r0, r6 + ldr r2, =0x000082f4 + adds r1, r2 + ldrh r5, [r1] + add r0, r9 + adds r1, r4, 0 + mov r2, sp + mov r3, r8 + bl sub_802E264 + cmp r0, 0 + beq _0802AF10 + ldr r2, [r7] + lsls r1, r4, 1 + adds r0, r2, 0 + adds r0, 0x90 + adds r0, r1 + mov r3, r8 + ldrh r1, [r3] + strh r1, [r0] + adds r2, 0x8B + adds r2, r4 + mov r0, sp + ldrb r0, [r0] + strb r0, [r2] + ldr r0, [r7] + adds r0, r6 + ldr r1, =0x000082f6 + adds r0, r1 + strh r5, [r0] +_0802AF10: + mov r2, r10 + ldr r1, [r2] + ldr r3, =0x000082fc + adds r0, r1, r3 + adds r0, r6 + ldr r0, [r0] + cmp r0, 0 + beq _0802AF36 + adds r0, r1, 0 + adds r0, 0x8B + adds r0, r4 + adds r1, 0x70 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bne _0802AF36 + ldr r0, [sp, 0x4] + adds r0, 0x1 + str r0, [sp, 0x4] +_0802AF36: + movs r1, 0x28 + add r9, r1 + adds r6, 0x28 + adds r4, 0x1 + ldr r7, =0x02022cfc + ldr r0, [r7] + ldrb r0, [r0, 0x5] + cmp r4, r0 + blt _0802AED0 +_0802AF48: + ldr r2, =0x02022cfc + ldr r1, [r2] + ldrb r0, [r1, 0x5] + subs r0, 0x1 + ldr r3, [sp, 0x4] + cmp r3, r0 + bne _0802AF5C + adds r1, 0x49 + movs r0, 0x1 + strb r0, [r1] +_0802AF5C: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802AEA4 + + thumb_func_start sub_802AF80 +sub_802AF80: @ 802AF80 + push {r4,r5,lr} + bl sub_802AEA4 + bl sub_802C43C + ldr r0, =0x02022cfc + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x48 + ldrb r0, [r0] + cmp r0, 0 + bne _0802AFB2 + adds r0, r1, 0 + adds r0, 0x49 + ldrb r0, [r0] + cmp r0, 0 + beq _0802AFB2 + adds r0, r1, 0 + adds r0, 0x4C + ldrb r0, [r0] + bl sub_802AE50 + movs r0, 0x3 + bl sub_802AE14 +_0802AFB2: + ldr r4, =0x02022cfc + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x48 + ldrb r5, [r0] + cmp r5, 0x1 + bne _0802AFEE + ldr r1, =gUnknown_082FB5F4 + adds r0, 0x28 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + adds r1, r0, 0 + cmp r1, 0 + bne _0802AFEE + ldr r0, [r4] + adds r0, 0x48 + strb r1, [r0] + ldr r1, [r4] + ldrb r2, [r1, 0x6] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r2, =0x000082fc + adds r1, r2 + adds r1, r0 + str r5, [r1] +_0802AFEE: + bl sub_802C1DC + bl sub_802B008 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802AF80 + + thumb_func_start sub_802B008 +sub_802B008: @ 802B008 + push {r4,lr} + ldr r4, =0x02022cfc + ldr r1, [r4] + ldr r0, [r1, 0x2C] + cmp r0, 0 + bne _0802B01E + ldr r2, =0x000082e4 + adds r0, r1, r2 + adds r1, 0x70 + bl sub_802E138 +_0802B01E: + ldr r1, [r4] + ldr r2, [r1, 0x30] + ldr r0, =0x00001111 + cmp r2, r0 + beq _0802B030 + ldr r0, [r1, 0x2C] + adds r0, 0x1 + ands r0, r2 + str r0, [r1, 0x2C] +_0802B030: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802B008 + + thumb_func_start sub_802B044 +sub_802B044: @ 802B044 + ldr r2, =0x02022cfc + ldr r1, [r2] + adds r1, 0x70 + movs r3, 0 + strb r0, [r1] + ldr r0, [r2] + strh r3, [r0, 0x8] + strh r3, [r0, 0xA] + adds r0, 0x48 + movs r1, 0x1 + strb r1, [r0] + ldr r1, [r2] + ldrb r2, [r1, 0x6] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r2, =0x000082fc + adds r1, r2 + adds r1, r0 + str r3, [r1] + bx lr + .pool + thumb_func_end sub_802B044 + + thumb_func_start sub_802B078 +sub_802B078: @ 802B078 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + ldr r4, =0x02022cfc + ldr r0, [r4] + ldr r2, =0x000082f4 + adds r1, r0, r2 + ldrh r1, [r1] + mov r8, r1 + ldr r3, =0x000082e4 + adds r0, r3 + mov r1, sp + bl sub_802E1BC + cmp r0, 0 + beq _0802B128 + ldr r2, [r4] + ldrb r0, [r2, 0x6] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r3, =0x000082fc + adds r0, r2, r3 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0x1 + bne _0802B0C6 + mov r0, sp + adds r1, r2, 0 + adds r1, 0x70 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + beq _0802B0C6 + mov r0, sp + ldrb r0, [r0] + bl sub_802B044 +_0802B0C6: + ldr r3, =0x02022cfc + ldr r2, [r3] + ldr r0, [r2, 0x78] + ldr r1, [sp, 0x8] + cmp r0, r1 + beq _0802B108 + str r1, [r2, 0x78] + movs r4, 0x1 + str r4, [r2, 0x5C] + mov r0, sp + ldrb r1, [r0, 0x1] + adds r0, r2, 0 + adds r0, 0x71 + strb r1, [r0] + ldr r0, [r3] + adds r1, r0, 0 + adds r1, 0x71 + ldrb r1, [r1] + cmp r1, 0 + beq _0802B104 + adds r0, 0x4D + strb r4, [r0] + b _0802B108 + .pool +_0802B104: + adds r0, 0x4D + strb r1, [r0] +_0802B108: + ldr r0, =0x02022cfc + ldr r1, [r0] + mov r0, sp + ldrh r0, [r0, 0x2] + adds r2, r1, 0 + adds r2, 0x72 + strh r0, [r2] + mov r0, sp + ldrh r2, [r0, 0x4] + adds r0, r1, 0 + adds r0, 0x74 + strh r2, [r0] + ldr r0, =0x000082f6 + adds r1, r0 + mov r2, r8 + strh r2, [r1] +_0802B128: + movs r4, 0x1 + ldr r2, =0x02022cfc + ldr r0, [r2] + ldrb r0, [r0, 0x5] + cmp r4, r0 + bge _0802B176 + adds r7, r2, 0 + ldr r6, =0x0000830c + movs r5, 0x28 +_0802B13A: + ldr r1, [r7] + ldrb r3, [r1, 0x6] + cmp r4, r3 + beq _0802B168 + adds r0, r1, r5 + ldr r3, =0x000082f4 + adds r0, r3 + ldrh r0, [r0] + mov r8, r0 + adds r0, r1, r6 + adds r1, r4, 0 + str r2, [sp, 0xC] + bl sub_802E2D0 + ldr r2, [sp, 0xC] + cmp r0, 0 + beq _0802B168 + ldr r0, [r7] + adds r0, r5 + ldr r1, =0x000082f6 + adds r0, r1 + mov r3, r8 + strh r3, [r0] +_0802B168: + adds r6, 0x28 + adds r5, 0x28 + adds r4, 0x1 + ldr r0, [r2] + ldrb r0, [r0, 0x5] + cmp r4, r0 + blt _0802B13A +_0802B176: + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802B078 + + thumb_func_start sub_802B194 +sub_802B194: @ 802B194 + push {r4,lr} + bl sub_802B078 + ldr r4, =0x02022cfc + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x48 + ldrb r0, [r0] + cmp r0, 0 + beq _0802B1E0 + ldr r1, =gUnknown_082FB618 + adds r0, r2, 0 + adds r0, 0x70 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + adds r1, r0, 0 + cmp r1, 0 + bne _0802B1E0 + ldr r0, [r4] + adds r0, 0x48 + strb r1, [r0] + ldr r1, [r4] + ldrb r2, [r1, 0x6] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r2, =0x000082fc + adds r1, r2 + adds r1, r0 + movs r0, 0x1 + str r0, [r1] + movs r0, 0x3 + bl sub_802AE14 +_0802B1E0: + bl sub_802C1DC + bl sub_802B1FC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802B194 + + thumb_func_start sub_802B1FC +sub_802B1FC: @ 802B1FC + push {r4,lr} + ldr r4, =0x02022cfc + ldr r2, [r4] + ldr r0, [r2, 0x2C] + cmp r0, 0 + bne _0802B224 + ldrb r1, [r2, 0x6] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, =0x000082e4 + adds r0, r1 + adds r0, r2, r0 + adds r1, r2, 0 + adds r1, 0x70 + ldrb r1, [r1] + adds r2, 0x42 + ldrh r2, [r2] + bl sub_802E234 +_0802B224: + ldr r1, [r4] + ldr r2, [r1, 0x30] + ldr r0, =0x00001111 + cmp r2, r0 + beq _0802B236 + ldr r0, [r1, 0x2C] + adds r0, 0x1 + ands r0, r2 + str r0, [r1, 0x2C] +_0802B236: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802B1FC + + thumb_func_start sub_802B248 +sub_802B248: @ 802B248 + push {r4,lr} + ldr r4, =0x02022cfc + ldr r0, [r4] + ldrh r0, [r0, 0x8] + cmp r0, 0 + beq _0802B260 + cmp r0, 0x1 + beq _0802B26E + b _0802B294 + .pool +_0802B260: + movs r0, 0x3 + bl sub_802AE14 + ldr r1, [r4] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_0802B26E: + bl sub_802B7E0 + cmp r0, 0 + bne _0802B294 + ldr r0, =0x02022cfc + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x4A + ldrh r0, [r0] + adds r2, r1, 0 + adds r2, 0x72 + strh r0, [r2] + adds r1, 0x4C + movs r0, 0x1 + strb r0, [r1] + movs r0, 0 + b _0802B296 + .pool +_0802B294: + movs r0, 0x1 +_0802B296: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802B248 + + thumb_func_start sub_802B29C +sub_802B29C: @ 802B29C + push {r4,lr} + ldr r4, =0x02022cfc + ldr r0, [r4] + ldrh r0, [r0, 0x8] + cmp r0, 0 + beq _0802B2B4 + cmp r0, 0x1 + beq _0802B2CA + movs r0, 0x1 + b _0802B2CE + .pool +_0802B2B4: + movs r0, 0 + bl sub_802AE14 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x72 + ldrh r0, [r0] + str r0, [r1, 0x24] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_0802B2CA: + bl sub_802B7E0 +_0802B2CE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802B29C + + thumb_func_start sub_802B2D4 +sub_802B2D4: @ 802B2D4 + push {r4,lr} + ldr r4, =0x02022cfc + ldr r1, [r4] + ldrh r0, [r1, 0x8] + cmp r0, 0 + beq _0802B2EC + cmp r0, 0x1 + beq _0802B300 + b _0802B314 + .pool +_0802B2EC: + bl sub_802C0E8 + movs r0, 0x5 + bl sub_802AE14 + ldr r1, [r4] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0802B314 +_0802B300: + adds r0, r1, 0 + adds r0, 0x49 + ldrb r0, [r0] + cmp r0, 0 + beq _0802B314 + adds r1, 0x4C + movs r0, 0x2 + strb r0, [r1] + movs r0, 0 + b _0802B316 +_0802B314: + movs r0, 0x1 +_0802B316: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802B2D4 + + thumb_func_start sub_802B31C +sub_802B31C: @ 802B31C + push {r4,lr} + ldr r4, =0x02022cfc + ldr r0, [r4] + ldrh r0, [r0, 0x8] + cmp r0, 0 + beq _0802B334 + cmp r0, 0x1 + beq _0802B352 + b _0802B35E + .pool +_0802B334: + bl sub_802C0E8 + movs r0, 0 + bl sub_802AE14 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x72 + ldrh r0, [r0] + adds r2, r1, 0 + adds r2, 0x4A + strh r0, [r2] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_0802B352: + bl sub_802C70C + cmp r0, 0 + beq _0802B35E + movs r0, 0 + b _0802B360 +_0802B35E: + movs r0, 0x1 +_0802B360: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802B31C + + thumb_func_start sub_802B368 +sub_802B368: @ 802B368 + push {lr} + bl sub_802B8CC + cmp r0, 0 + bne _0802B390 + ldr r0, =0x02022cfc + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x4A + ldrh r0, [r0] + adds r2, r1, 0 + adds r2, 0x72 + strh r0, [r2] + adds r1, 0x4C + movs r0, 0x1 + strb r0, [r1] + b _0802B3AA + .pool +_0802B390: + bl sub_802C538 + cmp r0, 0 + beq _0802B39C + movs r0, 0x1 + b _0802B3AC +_0802B39C: + bl sub_802C0B8 + ldr r0, =0x02022cfc + ldr r0, [r0] + adds r0, 0x4C + movs r1, 0x3 + strb r1, [r0] +_0802B3AA: + movs r0, 0 +_0802B3AC: + pop {r1} + bx r1 + .pool + thumb_func_end sub_802B368 + + thumb_func_start sub_802B3B4 +sub_802B3B4: @ 802B3B4 + push {lr} + bl sub_802B8CC + cmp r0, 0 + beq _0802B3CE + bl sub_802C538 + cmp r0, 0 + beq _0802B3CA + movs r0, 0x1 + b _0802B3D0 +_0802B3CA: + bl sub_802C0B8 +_0802B3CE: + movs r0, 0 +_0802B3D0: + pop {r1} + bx r1 + thumb_func_end sub_802B3B4 + + thumb_func_start sub_802B3D4 +sub_802B3D4: @ 802B3D4 + push {r4,lr} + ldr r4, =0x02022cfc + ldr r0, [r4] + ldrh r0, [r0, 0x8] + cmp r0, 0x1 + beq _0802B40C + cmp r0, 0x1 + bgt _0802B3F0 + cmp r0, 0 + beq _0802B3F6 + b _0802B468 + .pool +_0802B3F0: + cmp r0, 0x2 + beq _0802B460 + b _0802B468 +_0802B3F6: + bl sub_802C538 + bl sub_802C5DC + cmp r0, 0 + beq _0802B468 + ldr r1, [r4] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0802B468 +_0802B40C: + bl sub_802B964 + cmp r0, 0 + bne _0802B468 + bl sub_802C7BC + cmp r0, 0 + beq _0802B42E + bl sub_802C7E0 + ldr r1, [r4] + adds r2, r1, 0 + adds r2, 0x72 + strh r0, [r2] + adds r1, 0x4C + movs r0, 0x7 + b _0802B454 +_0802B42E: + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x74 + ldrh r0, [r0] + cmp r0, 0xC7 + bls _0802B448 + ldrh r0, [r1, 0xE] + adds r2, r1, 0 + adds r2, 0x72 + strh r0, [r2] + adds r1, 0x4C + movs r0, 0x8 + b _0802B454 +_0802B448: + ldrh r0, [r1, 0xE] + adds r2, r1, 0 + adds r2, 0x72 + strh r0, [r2] + adds r1, 0x4C + movs r0, 0x4 +_0802B454: + strb r0, [r1] + ldr r0, =0x02022cfc + ldr r1, [r0] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_0802B460: + movs r0, 0 + b _0802B46A + .pool +_0802B468: + movs r0, 0x1 +_0802B46A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802B3D4 + + thumb_func_start sub_802B470 +sub_802B470: @ 802B470 + push {r4,lr} + ldr r4, =0x02022cfc + ldr r0, [r4] + ldrh r0, [r0, 0x8] + cmp r0, 0x1 + beq _0802B4B0 + cmp r0, 0x1 + bgt _0802B48C + cmp r0, 0 + beq _0802B492 + b _0802B4C4 + .pool +_0802B48C: + cmp r0, 0x2 + beq _0802B4C0 + b _0802B4C4 +_0802B492: + bl sub_802C538 + cmp r0, 0 + bne _0802B49E + bl sub_802C0B8 +_0802B49E: + bl sub_802C5DC + cmp r0, 0 + beq _0802B4C4 + ldr r1, [r4] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0802B4C4 +_0802B4B0: + bl sub_802B964 + cmp r0, 0 + bne _0802B4C4 + ldr r1, [r4] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_0802B4C0: + movs r0, 0 + b _0802B4C6 +_0802B4C4: + movs r0, 0x1 +_0802B4C6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802B470 + + thumb_func_start sub_802B4CC +sub_802B4CC: @ 802B4CC + push {r4,lr} + ldr r4, =0x02022cfc + ldr r0, [r4] + ldrh r1, [r0, 0x8] + cmp r1, 0x1 + beq _0802B500 + cmp r1, 0x1 + bgt _0802B4E8 + cmp r1, 0 + beq _0802B4F2 + b _0802B560 + .pool +_0802B4E8: + cmp r1, 0x2 + beq _0802B52C + cmp r1, 0x3 + beq _0802B556 + b _0802B560 +_0802B4F2: + movs r0, 0x4 + bl sub_802AE14 + ldr r1, [r4] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_0802B500: + bl sub_802BB84 + cmp r0, 0 + bne _0802B560 + ldr r4, =0x02022cfc + ldr r2, [r4] + ldr r0, [r2, 0x78] + adds r1, r2, 0 + adds r1, 0x74 + ldrh r1, [r1] + adds r2, 0x72 + ldrh r2, [r2] + bl sub_802E354 + ldr r1, [r4] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0802B560 + .pool +_0802B52C: + adds r0, 0x49 + ldrb r0, [r0] + cmp r0, 0 + beq _0802B560 + bl sub_802C650 + cmp r0, 0 + beq _0802B544 + ldr r0, [r4] + adds r0, 0x4C + movs r1, 0x5 + b _0802B54A +_0802B544: + ldr r0, [r4] + adds r0, 0x4C + movs r1, 0x6 +_0802B54A: + strb r1, [r0] + ldr r0, =0x02022cfc + ldr r1, [r0] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_0802B556: + movs r0, 0 + b _0802B562 + .pool +_0802B560: + movs r0, 0x1 +_0802B562: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802B4CC + + thumb_func_start sub_802B568 +sub_802B568: @ 802B568 + push {r4,lr} + ldr r4, =0x02022cfc + ldr r0, [r4] + ldrh r0, [r0, 0x8] + cmp r0, 0 + beq _0802B580 + cmp r0, 0x1 + beq _0802B58E + b _0802B5C0 + .pool +_0802B580: + movs r0, 0 + bl sub_802AE14 + ldr r1, [r4] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_0802B58E: + bl sub_802BB84 + cmp r0, 0 + bne _0802B5C0 + ldr r4, =0x02022cfc + ldr r2, [r4] + ldr r0, [r2, 0x78] + adds r1, r2, 0 + adds r1, 0x74 + ldrh r1, [r1] + adds r2, 0x72 + ldrh r2, [r2] + bl sub_802E354 + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0x45 + ldrb r1, [r1] + adds r0, 0x42 + strh r1, [r0] + movs r0, 0 + b _0802B5C2 + .pool +_0802B5C0: + movs r0, 0x1 +_0802B5C2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802B568 + + thumb_func_start sub_802B5C8 +sub_802B5C8: @ 802B5C8 + push {r4,lr} + ldr r4, =0x02022cfc + ldr r1, [r4] + ldrh r0, [r1, 0x8] + cmp r0, 0 + beq _0802B5E0 + cmp r0, 0x1 + beq _0802B5F2 + b _0802B61E + .pool +_0802B5E0: + bl sub_802BD30 + cmp r0, 0 + bne _0802B61E + ldr r1, [r4] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0802B61E +_0802B5F2: + adds r0, r1, 0 + adds r0, 0x49 + ldrb r0, [r0] + cmp r0, 0 + beq _0802B61E + adds r0, r1, 0 + bl sub_802AA94 + bl GenerateRandomNumber + ldr r1, [r4] + lsls r0, 16 + lsrs r0, 16 + str r0, [r1, 0x24] + adds r3, r1, 0 + adds r3, 0x72 + movs r2, 0 + strh r0, [r3] + adds r1, 0x4C + strb r2, [r1] + movs r0, 0 + b _0802B620 +_0802B61E: + movs r0, 0x1 +_0802B620: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802B5C8 + + thumb_func_start sub_802B628 +sub_802B628: @ 802B628 + push {r4,lr} + ldr r4, =0x02022cfc + ldr r0, [r4] + ldrh r0, [r0, 0x8] + cmp r0, 0 + beq _0802B640 + cmp r0, 0x1 + beq _0802B656 + b _0802B65A + .pool +_0802B640: + bl sub_802BD30 + cmp r0, 0 + bne _0802B65A + ldr r0, [r4] + bl sub_802AA94 + ldr r1, [r4] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_0802B656: + movs r0, 0 + b _0802B65C +_0802B65A: + movs r0, 0x1 +_0802B65C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802B628 + + thumb_func_start sub_802B664 +sub_802B664: @ 802B664 + push {r4,lr} + ldr r4, =0x02022cfc + ldr r1, [r4] + ldrh r0, [r1, 0x8] + cmp r0, 0x1 + beq _0802B68C + cmp r0, 0x1 + bgt _0802B680 + cmp r0, 0 + beq _0802B686 + b _0802B6B0 + .pool +_0802B680: + cmp r0, 0x2 + beq _0802B69C + b _0802B6B0 +_0802B686: + movs r0, 0x1 + strh r0, [r1, 0x8] + b _0802B6B0 +_0802B68C: + movs r0, 0 + bl sub_802AE14 + ldr r1, [r4] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0802B6B0 +_0802B69C: + bl sub_802BC60 + cmp r0, 0 + bne _0802B6B0 + ldr r0, [r4] + ldr r0, [r0] + bl SetMainCallback2 + bl sub_802AA48 +_0802B6B0: + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802B664 + + thumb_func_start sub_802B6B8 +sub_802B6B8: @ 802B6B8 + push {r4,lr} + ldr r4, =0x02022cfc + ldr r0, [r4] + ldrh r0, [r0, 0x8] + cmp r0, 0 + beq _0802B6D0 + cmp r0, 0x1 + beq _0802B6E0 + b _0802B6FC + .pool +_0802B6D0: + movs r0, 0x4 + bl sub_802AE14 + ldr r1, [r4] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0802B6FC +_0802B6E0: + bl sub_802BA58 + cmp r0, 0 + bne _0802B6FC + ldr r0, [r4] + ldrh r1, [r0, 0xE] + adds r2, r0, 0 + adds r2, 0x72 + strh r1, [r2] + adds r0, 0x4C + movs r1, 0x8 + strb r1, [r0] + movs r0, 0 + b _0802B6FE +_0802B6FC: + movs r0, 0x1 +_0802B6FE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802B6B8 + + thumb_func_start sub_802B704 +sub_802B704: @ 802B704 + push {lr} + movs r0, 0 + bl sub_802AE14 + bl sub_802BA58 + cmp r0, 0 + beq _0802B718 + movs r0, 0x1 + b _0802B71A +_0802B718: + movs r0, 0 +_0802B71A: + pop {r1} + bx r1 + thumb_func_end sub_802B704 + + thumb_func_start sub_802B720 +sub_802B720: @ 802B720 + push {r4,lr} + ldr r1, =0x02022cfc + ldr r0, [r1] + ldrh r0, [r0, 0x8] + adds r4, r1, 0 + cmp r0, 0x4 + bhi _0802B7D8 + lsls r0, 2 + ldr r1, =_0802B740 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0802B740: + .4byte _0802B754 + .4byte _0802B770 + .4byte _0802B780 + .4byte _0802B798 + .4byte _0802B7BC +_0802B754: + ldr r2, [r4] + ldr r0, [r2, 0x78] + adds r1, r2, 0 + adds r1, 0x74 + ldrh r1, [r1] + adds r2, 0x72 + ldrh r2, [r2] + bl sub_802E354 + movs r0, 0x5 + bl sub_802D0C8 + ldr r1, [r4] + b _0802B7AC +_0802B770: + bl sub_802D0F0 + cmp r0, 0 + bne _0802B7D8 + movs r0, 0 + bl sub_802AE14 + b _0802B7A8 +_0802B780: + bl sub_802C70C + cmp r0, 0 + beq _0802B7D8 + ldr r0, =sub_8153688 + movs r1, 0x6 + bl AddTask + b _0802B7A8 + .pool +_0802B798: + ldr r0, =sub_8153688 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _0802B7D8 + bl sub_802DA14 +_0802B7A8: + ldr r0, =0x02022cfc + ldr r1, [r0] +_0802B7AC: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0802B7D8 + .pool +_0802B7BC: + bl sub_802DA44 + cmp r0, 0 + bne _0802B7D8 + ldr r0, =0x02022cfc + ldr r0, [r0] + adds r0, 0x4C + movs r1, 0x4 + strb r1, [r0] + movs r0, 0 + b _0802B7DA + .pool +_0802B7D8: + movs r0, 0x1 +_0802B7DA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802B720 + + thumb_func_start sub_802B7E0 +sub_802B7E0: @ 802B7E0 + push {r4,r5,lr} + ldr r1, =0x02022cfc + ldr r0, [r1] + ldrh r0, [r0, 0xA] + adds r4, r1, 0 + cmp r0, 0x7 + bhi _0802B8C4 + lsls r0, 2 + ldr r1, =_0802B800 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0802B800: + .4byte _0802B820 + .4byte _0802B82C + .4byte _0802B84C + .4byte _0802B866 + .4byte _0802B878 + .4byte _0802B880 + .4byte _0802B8A0 + .4byte _0802B8BA +_0802B820: + movs r0, 0x2 + bl sub_802D0C8 + bl sub_802DDE0 + b _0802B890 +_0802B82C: + bl sub_802D0F0 + adds r5, r0, 0 + cmp r5, 0 + bne _0802B8C4 + ldr r4, =0x02022cfc + ldr r0, [r4] + ldrb r0, [r0, 0x6] + bl sub_802DDF4 + ldr r1, [r4] + strh r5, [r1, 0x3C] + b _0802B894 + .pool +_0802B84C: + ldr r1, [r4] + ldrh r0, [r1, 0x3C] + adds r0, 0x1 + strh r0, [r1, 0x3C] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x78 + bls _0802B8C4 + movs r0, 0x3 + bl sub_802D0C8 + ldr r1, [r4] + b _0802B894 +_0802B866: + bl sub_802D0F0 + cmp r0, 0x1 + beq _0802B8C4 + bl sub_802DE08 + cmp r0, 0x1 + beq _0802B8C4 + b _0802B890 +_0802B878: + movs r0, 0x9 + bl sub_802D0C8 + b _0802B890 +_0802B880: + bl sub_802D0F0 + cmp r0, 0 + bne _0802B8C4 + bl sub_802C260 + bl sub_802D764 +_0802B890: + ldr r0, =0x02022cfc + ldr r1, [r0] +_0802B894: + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] + b _0802B8C4 + .pool +_0802B8A0: + bl sub_802D788 + cmp r0, 0 + bne _0802B8C4 + bl sub_802C270 + bl sub_802BEA0 + ldr r0, =0x02022cfc + ldr r1, [r0] + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] +_0802B8BA: + movs r0, 0 + b _0802B8C6 + .pool +_0802B8C4: + movs r0, 0x1 +_0802B8C6: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_802B7E0 + + thumb_func_start sub_802B8CC +sub_802B8CC: @ 802B8CC + push {r4,r5,lr} + bl sub_802BEE4 + ldr r5, =0x02022cfc + ldr r1, [r5] + ldrh r4, [r1, 0x36] + cmp r4, 0 + beq _0802B8E8 + movs r0, 0 + strh r0, [r1, 0x36] + b _0802B95C + .pool +_0802B8E8: + ldrh r0, [r1, 0xA] + cmp r0, 0x1 + beq _0802B914 + cmp r0, 0x1 + bgt _0802B8F8 + cmp r0, 0 + beq _0802B902 + b _0802B95A +_0802B8F8: + cmp r0, 0x2 + beq _0802B938 + cmp r0, 0x3 + beq _0802B94C + b _0802B95A +_0802B902: + movs r0, 0 + bl sub_802C130 + cmp r0, 0 + beq _0802B95A + ldr r1, [r5] + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] +_0802B914: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0802B95A + bl sub_802C164 + movs r0, 0x3 + bl sub_802AE14 + ldr r0, =0x02022cfc + ldr r1, [r0] + b _0802B944 + .pool +_0802B938: + movs r0, 0x1 + bl sub_802C130 + cmp r0, 0x1 + bne _0802B95A + ldr r1, [r5] +_0802B944: + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] + b _0802B95A +_0802B94C: + movs r0, 0 + bl sub_802C130 + cmp r0, 0x1 + bne _0802B95A + ldr r0, [r5] + strh r4, [r0, 0xA] +_0802B95A: + movs r0, 0x1 +_0802B95C: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_802B8CC + + thumb_func_start sub_802B964 +sub_802B964: @ 802B964 + push {r4-r6,lr} + ldr r1, =0x02022cfc + ldr r0, [r1] + ldrh r0, [r0, 0xA] + adds r5, r1, 0 + cmp r0, 0x4 + bhi _0802BA50 + lsls r0, 2 + ldr r1, =_0802B984 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0802B984: + .4byte _0802B998 + .4byte _0802B9BC + .4byte _0802BA00 + .4byte _0802BA24 + .4byte _0802BA46 +_0802B998: + movs r4, 0 + ldr r0, [r5] + ldrb r0, [r0, 0x5] + cmp r4, r0 + bge _0802B9B8 + adds r6, r5, 0 +_0802B9A4: + adds r0, r4, 0 + bl sub_802DDB8 + cmp r0, 0x1 + beq _0802BA50 + adds r4, 0x1 + ldr r0, [r6] + ldrb r0, [r0, 0x5] + cmp r4, r0 + blt _0802B9A4 +_0802B9B8: + ldr r1, [r5] + b _0802BA1C +_0802B9BC: + movs r4, 0 + ldr r0, [r5] + ldrb r0, [r0, 0x5] + cmp r4, r0 + bge _0802B9EC + adds r6, r5, 0 + movs r5, 0 +_0802B9CA: + ldr r0, [r6] + adds r0, r5 + ldr r1, =0x000082f4 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0x2 + bne _0802B9E0 + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_802DDA0 +_0802B9E0: + adds r5, 0x28 + adds r4, 0x1 + ldr r0, [r6] + ldrb r0, [r0, 0x5] + cmp r4, r0 + blt _0802B9CA +_0802B9EC: + movs r0, 0x1 + bl sub_802D0C8 + ldr r0, =0x02022cfc + ldr r1, [r0] + b _0802BA18 + .pool +_0802BA00: + ldr r1, [r5] + ldrh r0, [r1, 0x3C] + adds r0, 0x1 + strh r0, [r1, 0x3C] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x64 + bls _0802BA50 + movs r0, 0x3 + bl sub_802D0C8 + ldr r1, [r5] +_0802BA18: + movs r0, 0 + strh r0, [r1, 0x3C] +_0802BA1C: + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] + b _0802BA50 +_0802BA24: + bl sub_802D0F0 + adds r5, r0, 0 + cmp r5, 0 + bne _0802BA50 + bl sub_802DDCC + ldr r4, =0x02022cfc + ldr r0, [r4] + adds r0, 0x71 + strb r5, [r0] + bl sub_802C114 + ldr r1, [r4] + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] +_0802BA46: + movs r0, 0 + b _0802BA52 + .pool +_0802BA50: + movs r0, 0x1 +_0802BA52: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_802B964 + + thumb_func_start sub_802BA58 +sub_802BA58: @ 802BA58 + push {r4,lr} + ldr r1, =0x02022cfc + ldr r0, [r1] + ldrh r0, [r0, 0xA] + adds r4, r1, 0 + cmp r0, 0x6 + bls _0802BA68 + b _0802BB7C +_0802BA68: + lsls r0, 2 + ldr r1, =_0802BA7C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0802BA7C: + .4byte _0802BA98 + .4byte _0802BAB8 + .4byte _0802BAD0 + .4byte _0802BB00 + .4byte _0802BAB8 + .4byte _0802BAD0 + .4byte _0802BB70 +_0802BA98: + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x72 + ldrh r0, [r0] + adds r1, r2, 0 + adds r1, 0x3E + adds r2, 0x40 + bl sub_802C808 + ldr r1, [r4] + ldrh r0, [r1, 0x3E] + adds r1, 0x40 + ldrh r1, [r1] + bl sub_802D7E8 + b _0802BAF0 +_0802BAB8: + bl sub_802D974 + adds r2, r0, 0 + cmp r2, 0 + bne _0802BB7C + ldr r0, =0x02022cfc + ldr r1, [r0] + strh r2, [r1, 0x3C] + b _0802BAF2 + .pool +_0802BAD0: + ldr r1, [r4] + ldrh r0, [r1, 0x3C] + adds r2, r0, 0x1 + strh r2, [r1, 0x3C] + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _0802BAEC + lsls r0, r2, 16 + lsrs r0, 16 + cmp r0, 0xB4 + bls _0802BB7C +_0802BAEC: + bl sub_802DA14 +_0802BAF0: + ldr r1, [r4] +_0802BAF2: + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] + b _0802BB7C + .pool +_0802BB00: + bl sub_802DA44 + cmp r0, 0 + bne _0802BB7C + ldr r4, =0x02022cfc + ldr r1, [r4] + ldrh r0, [r1, 0x3E] + adds r1, 0x40 + ldrh r1, [r1] + bl sub_802C880 + ldr r1, [r4] + adds r2, r1, 0 + adds r2, 0x40 + strh r0, [r2] + lsls r0, 16 + cmp r0, 0 + beq _0802BB58 + ldrh r0, [r1, 0x3E] + ldrh r1, [r2] + bl bag_add_item + lsls r0, 24 + cmp r0, 0 + beq _0802BB58 + ldr r0, [r4] + ldrh r0, [r0, 0x3E] + movs r1, 0x1 + bl sub_80D6800 + lsls r0, 24 + cmp r0, 0 + bne _0802BB50 + ldr r0, [r4] + ldrh r0, [r0, 0x3E] + bl sub_802D884 + b _0802BB62 + .pool +_0802BB50: + ldr r1, [r4] + movs r0, 0x6 + strh r0, [r1, 0xA] + b _0802BB7C +_0802BB58: + ldr r4, =0x02022cfc + ldr r0, [r4] + ldrh r0, [r0, 0x3E] + bl sub_802D8FC +_0802BB62: + ldr r1, [r4] + movs r0, 0x4 + strh r0, [r1, 0xA] + b _0802BB7C + .pool +_0802BB70: + bl sub_802DA44 + cmp r0, 0 + bne _0802BB7C + movs r0, 0 + b _0802BB7E +_0802BB7C: + movs r0, 0x1 +_0802BB7E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802BA58 + + thumb_func_start sub_802BB84 +sub_802BB84: @ 802BB84 + push {r4,lr} + ldr r0, =0x02022cfc + ldr r0, [r0] + ldrh r0, [r0, 0xA] + cmp r0, 0x6 + bhi _0802BC58 + lsls r0, 2 + ldr r1, =_0802BBA4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0802BBA4: + .4byte _0802BBC0 + .4byte _0802BBC4 + .4byte _0802BBCE + .4byte _0802BC1C + .4byte _0802BC26 + .4byte _0802BC3C + .4byte _0802BC4E +_0802BBC0: + movs r0, 0x4 + b _0802BC28 +_0802BBC4: + bl sub_802D0F0 + cmp r0, 0 + bne _0802BC58 + b _0802BC2C +_0802BBCE: + bl sub_802DA8C + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _0802BC04 + cmp r1, 0 + bgt _0802BBE8 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0802BBEC + b _0802BC58 +_0802BBE8: + cmp r1, 0x1 + bne _0802BC58 +_0802BBEC: + ldr r4, =0x02022cfc + ldr r0, [r4] + adds r0, 0x45 + movs r1, 0x1 + strb r1, [r0] + movs r0, 0x6 + bl sub_802D0C8 + ldr r1, [r4] + b _0802BC30 + .pool +_0802BC04: + ldr r4, =0x02022cfc + ldr r0, [r4] + adds r0, 0x45 + movs r1, 0x2 + strb r1, [r0] + movs r0, 0x6 + bl sub_802D0C8 + ldr r1, [r4] + b _0802BC30 + .pool +_0802BC1C: + bl sub_802D0F0 + cmp r0, 0 + bne _0802BC58 + b _0802BC2C +_0802BC26: + movs r0, 0x8 +_0802BC28: + bl sub_802D0C8 +_0802BC2C: + ldr r0, =0x02022cfc + ldr r1, [r0] +_0802BC30: + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] + b _0802BC58 + .pool +_0802BC3C: + bl sub_802D0F0 + cmp r0, 0 + bne _0802BC58 + ldr r0, =0x02022cfc + ldr r1, [r0] + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] +_0802BC4E: + movs r0, 0 + b _0802BC5A + .pool +_0802BC58: + movs r0, 0x1 +_0802BC5A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802BB84 + + thumb_func_start sub_802BC60 +sub_802BC60: @ 802BC60 + push {r4,lr} + sub sp, 0x4 + ldr r1, =0x02022cfc + ldr r0, [r1] + ldrh r0, [r0, 0xA] + adds r4, r1, 0 + cmp r0, 0x5 + bhi _0802BD24 + lsls r0, 2 + ldr r1, =_0802BC84 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0802BC84: + .4byte _0802BC9C + .4byte _0802BCA2 + .4byte _0802BCB2 + .4byte _0802BCC8 + .4byte _0802BCEE + .4byte _0802BD14 +_0802BC9C: + bl sub_802DA14 + b _0802BCFE +_0802BCA2: + bl sub_802DA44 + cmp r0, 0 + bne _0802BD24 + movs r0, 0x7 + bl sub_802D0C8 + b _0802BCFE +_0802BCB2: + bl sub_802D0F0 + adds r2, r0, 0 + cmp r2, 0 + bne _0802BD24 + ldr r0, =0x02022cfc + ldr r1, [r0] + strh r2, [r1, 0x3C] + b _0802BD02 + .pool +_0802BCC8: + ldr r1, [r4] + ldrh r0, [r1, 0x3C] + adds r0, 0x1 + strh r0, [r1, 0x3C] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x78 + bls _0802BD24 + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, [r4] + b _0802BD02 +_0802BCEE: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0802BD24 + bl sub_800AC34 +_0802BCFE: + ldr r0, =0x02022cfc + ldr r1, [r0] +_0802BD02: + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] + b _0802BD24 + .pool +_0802BD14: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _0802BD24 + movs r0, 0 + b _0802BD26 + .pool +_0802BD24: + movs r0, 0x1 +_0802BD26: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802BC60 + + thumb_func_start sub_802BD30 +sub_802BD30: @ 802BD30 + push {r4,lr} + ldr r4, =0x02022cfc + ldr r0, [r4] + ldrh r0, [r0, 0xA] + cmp r0, 0x1 + beq _0802BD66 + cmp r0, 0x1 + bgt _0802BD4C + cmp r0, 0 + beq _0802BD52 + b _0802BD7A + .pool +_0802BD4C: + cmp r0, 0x2 + beq _0802BD76 + b _0802BD7A +_0802BD52: + bl sub_802DA14 + movs r0, 0 + bl sub_802DD64 + ldr r1, [r4] + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] + b _0802BD7A +_0802BD66: + bl sub_802DA44 + cmp r0, 0 + bne _0802BD7A + ldr r1, [r4] + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] +_0802BD76: + movs r0, 0 + b _0802BD7C +_0802BD7A: + movs r0, 0x1 +_0802BD7C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802BD30 + + thumb_func_start sub_802BD84 +sub_802BD84: @ 802BD84 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r0, 2 + add r0, r10 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r6, r0, r1 + mov r0, r10 + movs r1, 0xE + bl get_word_task_arg + mov r8, r0 + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + beq _0802BDC8 + cmp r0, 0x1 + beq _0802BDDC + b _0802BE48 + .pool +_0802BDBC: + bl sub_802AB20 + mov r0, r10 + bl remove_task + b _0802BE48 +_0802BDC8: + movs r1, 0 + adds r0, r6, 0 + adds r0, 0x8 +_0802BDCE: + strh r1, [r0, 0x4] + subs r0, 0x2 + cmp r0, r6 + bge _0802BDCE + ldrh r0, [r6] + adds r0, 0x1 + strh r0, [r6] +_0802BDDC: + mov r3, r8 + ldrb r1, [r3, 0x6] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x000082a8 + adds r0, r4 + add r0, r8 + bl sub_802E0AC + movs r2, 0 + adds r5, r6, 0x4 + mov r9, r2 + movs r7, 0x83 + lsls r7, 8 + add r7, r8 + add r4, r8 +_0802BDFE: + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0802BE38 + adds r0, r2, 0 + adds r1, r4, 0 + str r2, [sp] + bl sub_802E0D0 + ldr r2, [sp] + cmp r0, 0 + beq _0802BE38 + ldr r1, =0x020229f0 + add r1, r9 + adds r0, r7, 0 + bl CopyString + movs r0, 0x1 + strh r0, [r5] + ldrh r0, [r6, 0x2] + adds r0, 0x1 + strh r0, [r6, 0x2] + movs r3, 0x2 + ldrsh r0, [r6, r3] + ldr r2, [sp] + mov r1, r8 + ldrb r1, [r1, 0x5] + cmp r0, r1 + beq _0802BDBC +_0802BE38: + adds r5, 0x2 + movs r3, 0x1C + add r9, r3 + adds r7, 0x28 + adds r4, 0xC + adds r2, 0x1 + cmp r2, 0x4 + ble _0802BDFE +_0802BE48: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802BD84 + + thumb_func_start sub_802BE60 +sub_802BE60: @ 802BE60 + push {lr} + lsls r1, 24 + lsrs r1, 24 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022cfc + ldr r2, [r1] + movs r1, 0xE + bl set_word_task_arg + pop {r0} + bx r0 + .pool + thumb_func_end sub_802BE60 + + thumb_func_start sub_802BE80 +sub_802BE80: @ 802BE80 + ldr r0, =0x02022cfc + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x4A + movs r1, 0 + strh r1, [r0] + movs r0, 0x6 + str r0, [r2, 0x14] + strh r1, [r2, 0x34] + str r1, [r2, 0x1C] + strh r1, [r2, 0x36] + str r1, [r2, 0x10] + bx lr + .pool + thumb_func_end sub_802BE80 + + thumb_func_start sub_802BEA0 +sub_802BEA0: @ 802BEA0 + push {r4,lr} + ldr r3, =0x02022cfc + ldr r0, [r3] + adds r1, r0, 0 + adds r1, 0x4A + movs r4, 0 + movs r2, 0 + strh r2, [r1] + ldr r1, =0x000006ff + strh r1, [r0, 0x34] + movs r1, 0x7 + str r1, [r0, 0x14] + strh r2, [r0, 0x36] + str r2, [r0, 0x10] + adds r0, 0x51 + strb r4, [r0] + ldr r0, [r3] + adds r0, 0x50 + strb r4, [r0] + ldr r0, [r3] + str r2, [r0, 0x20] + adds r1, r0, 0 + adds r1, 0x4E + strh r2, [r1] + str r2, [r0, 0x6C] + bl sub_802BF7C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802BEA0 + + thumb_func_start sub_802BEE4 +sub_802BEE4: @ 802BEE4 + push {r4,lr} + ldr r4, =0x02022cfc + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x46 + ldrb r0, [r0] + cmp r0, 0 + beq _0802BF34 + adds r1, 0x4A + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + bl sub_802BF48 + ldr r3, [r4] + ldrh r1, [r3, 0x34] + adds r2, r1, r0 + strh r2, [r3, 0x34] + lsls r1, r2, 16 + ldr r0, =0x09fe0000 + cmp r1, r0 + bls _0802BF16 + ldr r1, =0xfffff601 + adds r0, r2, r1 + strh r0, [r3, 0x34] +_0802BF16: + ldr r1, [r4] + ldr r2, [r1, 0x14] + str r2, [r1, 0x18] + ldrh r0, [r1, 0x34] + lsrs r0, 8 + str r0, [r1, 0x14] + cmp r0, 0x6 + bls _0802BF34 + cmp r2, 0x6 + bhi _0802BF34 + ldrh r0, [r1, 0x36] + adds r0, 0x1 + strh r0, [r1, 0x36] + bl sub_802BF7C +_0802BF34: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802BEE4 + + thumb_func_start sub_802BF48 +sub_802BF48: @ 802BF48 + push {lr} + ldr r0, =0x02022cfc + ldr r2, [r0] + ldr r0, [r2, 0x10] + cmp r0, 0 + beq _0802BF5C + movs r0, 0 + b _0802BF72 + .pool +_0802BF5C: + ldr r3, [r2, 0x1C] + ldrh r1, [r2, 0x34] + ldr r0, =0x000005ff + cmp r1, r0 + bhi _0802BF70 + ldr r0, [r2, 0x20] + adds r0, 0x50 + str r0, [r2, 0x20] + lsrs r0, 8 + adds r3, r0 +_0802BF70: + adds r0, r3, 0 +_0802BF72: + pop {r1} + bx r1 + .pool + thumb_func_end sub_802BF48 + + thumb_func_start sub_802BF7C +sub_802BF7C: @ 802BF7C + push {r4,lr} + ldr r4, =0x02022cfc + ldr r3, [r4] + movs r0, 0 + str r0, [r3, 0x20] + adds r1, r3, 0 + adds r1, 0x4E + ldrh r0, [r1] + cmp r0, 0 + beq _0802BFC0 + subs r0, 0x1 + strh r0, [r1] + ldr r0, [r3, 0x6C] + cmp r0, 0 + beq _0802C08A + bl sub_802C098 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0 + beq _0802BFB0 + ldr r1, [r4] + b _0802C086 + .pool +_0802BFB0: + ldr r1, [r4] + ldr r0, [r1, 0x28] + cmp r0, 0x36 + bls _0802BFBC + movs r0, 0x1E + b _0802C088 +_0802BFBC: + movs r0, 0x52 + b _0802C088 +_0802BFC0: + adds r2, r3, 0 + adds r2, 0x50 + ldrb r1, [r2] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _0802C014 + ldr r0, =gUnknown_082FB63C + ldrb r1, [r2] + lsls r1, 1 + adds r1, r0 + adds r0, r3, 0 + adds r0, 0x51 + ldrb r2, [r0] + lsls r0, r2, 3 + subs r0, r2 + ldrh r1, [r1] + adds r0, r1 + str r0, [r3, 0x28] + bl sub_802C098 + ldr r2, [r4] + ldr r3, =gUnknown_082FB64C + movs r1, 0x3 + ands r1, r0 + lsls r1, 1 + adds r1, r3 + ldrh r0, [r1] + adds r0, 0x2 + adds r1, r2, 0 + adds r1, 0x4E + strh r0, [r1] + adds r2, 0x50 + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + b _0802C082 + .pool +_0802C014: + lsls r0, r1, 24 + lsrs r0, 24 + cmp r0, 0x8 + bne _0802C030 + adds r1, r3, 0 + adds r1, 0x51 + ldrb r0, [r1] + cmp r0, 0x2 + bhi _0802C02C + adds r0, 0x1 + strb r0, [r1] + b _0802C030 +_0802C02C: + movs r0, 0x1 + str r0, [r3, 0x6C] +_0802C030: + ldr r2, =gUnknown_082FB63C + ldr r4, =0x02022cfc + ldr r0, [r4] + mov r12, r0 + mov r3, r12 + adds r3, 0x50 + ldrb r0, [r3] + movs r1, 0xF + subs r1, r0 + lsls r1, 1 + adds r1, r2 + mov r0, r12 + adds r0, 0x51 + ldrb r2, [r0] + lsls r0, r2, 3 + subs r0, r2 + ldrh r1, [r1] + adds r0, r1 + mov r1, r12 + str r0, [r1, 0x28] + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xF + bls _0802C082 + bl sub_802C098 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0 + bne _0802C07A + ldr r1, [r4] + ldr r0, [r1, 0x28] + subs r0, 0x5 + str r0, [r1, 0x28] +_0802C07A: + ldr r0, [r4] + adds r0, 0x50 + movs r1, 0 + strb r1, [r0] +_0802C082: + ldr r0, =0x02022cfc + ldr r1, [r0] +_0802C086: + ldr r0, [r1, 0x28] +_0802C088: + str r0, [r1, 0x1C] +_0802C08A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802BF7C + + thumb_func_start sub_802C098 +sub_802C098: @ 802C098 + ldr r0, =0x02022cfc + ldr r2, [r0] + ldr r1, [r2, 0x24] + ldr r0, =0x41c64e6d + muls r0, r1 + ldr r1, =0x00006073 + adds r0, r1 + str r0, [r2, 0x24] + lsrs r0, 16 + bx lr + .pool + thumb_func_end sub_802C098 + + thumb_func_start sub_802C0B8 +sub_802C0B8: @ 802C0B8 + push {lr} + ldr r0, =0x02022cfc + ldr r1, [r0] + movs r0, 0x1 + str r0, [r1, 0x10] + movs r0, 0x6 + str r0, [r1, 0x14] + ldr r0, =0x000005ff + strh r0, [r1, 0x34] + bl sub_802C270 + pop {r0} + bx r0 + .pool + thumb_func_end sub_802C0B8 + + thumb_func_start sub_802C0DC +sub_802C0DC: @ 802C0DC + ldr r0, =0x02022cfc + ldr r0, [r0] + ldr r0, [r0, 0x10] + bx lr + .pool + thumb_func_end sub_802C0DC + + thumb_func_start sub_802C0E8 +sub_802C0E8: @ 802C0E8 + push {r4,r5,lr} + ldr r5, =0x02022cfc + ldr r4, =0x000082f8 + movs r3, 0 + movs r2, 0 + movs r1, 0x4 +_0802C0F4: + ldr r0, [r5] + adds r0, r4 + adds r0, r2 + str r3, [r0] + adds r2, 0x28 + subs r1, 0x1 + cmp r1, 0 + bge _0802C0F4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802C0E8 + + thumb_func_start sub_802C114 +sub_802C114: @ 802C114 + ldr r0, =0x02022cfc + ldr r0, [r0] + ldr r1, =0x000083ac + adds r0, r1 + ldr r1, [r0] + movs r2, 0 + strh r2, [r1, 0x10] + ldr r0, [r0] + strh r2, [r0, 0x12] + bx lr + .pool + thumb_func_end sub_802C114 + + thumb_func_start sub_802C130 +sub_802C130: @ 802C130 + push {lr} + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x02022cfc + ldr r2, [r1] + ldrb r3, [r2, 0x6] + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 3 + adds r2, r1 + ldr r1, =0x000082f4 + adds r2, r1 + ldrh r1, [r2] + cmp r1, r0 + beq _0802C15C + movs r0, 0 + b _0802C15E + .pool +_0802C15C: + movs r0, 0x1 +_0802C15E: + pop {r1} + bx r1 + thumb_func_end sub_802C130 + + thumb_func_start sub_802C164 +sub_802C164: @ 802C164 + ldr r0, =0x02022cfc + ldr r0, [r0] + ldr r1, =0x000083ac + adds r2, r0, r1 + ldr r1, [r2] + adds r0, 0x4A + ldrh r0, [r0] + strh r0, [r1, 0xE] + ldr r1, [r2] + ldrh r0, [r1, 0x10] + strh r0, [r1, 0x12] + ldr r1, [r2] + movs r0, 0x1 + strh r0, [r1, 0x10] + bx lr + .pool + thumb_func_end sub_802C164 + + thumb_func_start sub_802C18C +sub_802C18C: @ 802C18C + push {r4,lr} + ldr r0, =0x02022cfc + ldr r2, [r0] + ldr r0, =0x000083ac + adds r3, r2, r0 + ldr r1, [r3] + ldrh r0, [r1, 0x10] + strh r0, [r1, 0x12] + ldr r0, [r3] + movs r4, 0x2 + strh r4, [r0, 0x10] + ldr r1, [r3] + adds r2, 0x4A + ldrh r0, [r2] + strh r0, [r1, 0xE] + ldr r0, [r3] + str r4, [r0, 0x14] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802C18C + + thumb_func_start sub_802C1BC +sub_802C1BC: @ 802C1BC + ldr r0, =0x02022cfc + ldr r0, [r0] + ldr r1, =0x000083ac + adds r0, r1 + ldr r1, [r0] + ldrh r2, [r1, 0x10] + movs r3, 0 + strh r2, [r1, 0x12] + ldr r0, [r0] + strh r3, [r0, 0x10] + bx lr + .pool + thumb_func_end sub_802C1BC + + thumb_func_start sub_802C1DC +sub_802C1DC: @ 802C1DC + push {r4,r5,lr} + ldr r4, =0x02022cfc + ldr r1, [r4] + ldr r0, [r1, 0x5C] + cmp r0, 0 + beq _0802C21C + ldr r0, [r1, 0x78] + bl sub_802DD64 + ldr r1, [r4] + movs r5, 0 + str r5, [r1, 0x5C] + adds r0, r1, 0 + adds r0, 0x4D + ldrb r0, [r0] + cmp r0, 0 + beq _0802C21C + adds r0, r1, 0 + adds r0, 0x71 + ldrb r0, [r0] + bl sub_802DCCC + ldr r1, =gUnknown_082FB654 + subs r0, 0x2 + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + bl audio_play + ldr r0, [r4] + adds r0, 0x4D + strb r5, [r0] +_0802C21C: + ldr r0, =0x02022cfc + ldr r0, [r0] + adds r0, 0x74 + ldrh r0, [r0] + bl sub_802DD74 + bl sub_802C280 + bl sub_802C240 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802C1DC + + thumb_func_start sub_802C240 +sub_802C240: @ 802C240 + push {lr} + ldr r0, =0x02022cfc + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x46 + ldrb r0, [r0] + cmp r0, 0 + beq _0802C256 + ldr r0, [r1, 0x14] + bl sub_802DC9C +_0802C256: + pop {r0} + bx r0 + .pool + thumb_func_end sub_802C240 + + thumb_func_start sub_802C260 +sub_802C260: @ 802C260 + ldr r0, =0x02022cfc + ldr r0, [r0] + adds r0, 0x46 + movs r1, 0 + strb r1, [r0] + bx lr + .pool + thumb_func_end sub_802C260 + + thumb_func_start sub_802C270 +sub_802C270: @ 802C270 + ldr r0, =0x02022cfc + ldr r0, [r0] + adds r0, 0x46 + movs r1, 0x1 + strb r1, [r0] + bx lr + .pool + thumb_func_end sub_802C270 + + thumb_func_start sub_802C280 +sub_802C280: @ 802C280 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r6, 0 + ldr r2, =0x02022cfc + ldr r0, [r2] + ldrb r0, [r0, 0x5] + mov r9, r0 + movs r5, 0 + cmp r6, r9 + bge _0802C360 + mov r10, r2 + mov r8, r5 + movs r7, 0 +_0802C2A2: + mov r0, r10 + ldr r3, [r0] + adds r1, r3, r7 + ldr r2, =0x000082f4 + adds r0, r1, r2 + ldrh r2, [r0] + cmp r2, 0x1 + beq _0802C2D4 + cmp r2, 0x1 + bgt _0802C2C4 + cmp r2, 0 + beq _0802C2CA + b _0802C354 + .pool +_0802C2C4: + cmp r2, 0x2 + beq _0802C338 + b _0802C354 +_0802C2CA: + adds r0, r5, 0 + movs r1, 0 + bl sub_802DC80 + b _0802C354 +_0802C2D4: + ldr r0, =0x000082f6 + adds r4, r1, r0 + ldrh r0, [r4] + cmp r0, 0x1 + bne _0802C2F6 + ldr r0, =0x000082f2 + adds r0, r1 + adds r1, r3, 0 + adds r1, 0x9A + add r1, r8 + str r1, [sp] + ldrh r1, [r0] + mov r12, r1 + ldr r0, [sp] + ldrh r0, [r0] + cmp r12, r0 + beq _0802C31E +_0802C2F6: + ldrb r3, [r3, 0x6] + cmp r5, r3 + bne _0802C2FE + strh r2, [r4] +_0802C2FE: + orrs r6, r2 + mov r1, r10 + ldr r2, [r1] + ldr r1, =0x000082e8 + adds r0, r2, r1 + adds r0, r7 + ldr r1, =0x7fffffff + str r1, [r0] + adds r1, r2, 0 + adds r1, 0x9A + add r1, r8 + adds r2, r7 + ldr r0, =0x000082f2 + adds r2, r0 + ldrh r0, [r2] + strh r0, [r1] +_0802C31E: + adds r0, r5, 0 + bl sub_802C398 + b _0802C354 + .pool +_0802C338: + ldr r0, =0x000082f6 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0x2 + beq _0802C354 + ldrb r3, [r3, 0x6] + cmp r5, r3 + bne _0802C34A + strh r2, [r1] +_0802C34A: + orrs r6, r2 + lsls r0, r5, 24 + lsrs r0, 24 + bl sub_802DD88 +_0802C354: + movs r1, 0x2 + add r8, r1 + adds r7, 0x28 + adds r5, 0x1 + cmp r5, r9 + blt _0802C2A2 +_0802C360: + movs r0, 0x2 + ands r0, r6 + cmp r0, 0 + beq _0802C378 + movs r0, 0x83 + lsls r0, 1 + bl audio_play + b _0802C386 + .pool +_0802C378: + movs r0, 0x1 + ands r6, r0 + cmp r6, 0 + beq _0802C386 + movs r0, 0xA + bl audio_play +_0802C386: + 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_802C280 + + thumb_func_start sub_802C398 +sub_802C398: @ 802C398 + push {r4-r6,lr} + adds r6, r0, 0 + ldr r0, =0x02022cfc + ldr r2, [r0] + ldr r0, [r2, 0x68] + cmp r0, 0 + bne _0802C432 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x000082e4 + adds r0, r1 + adds r5, r2, r0 + ldr r1, [r5, 0x4] + ldr r0, =0x7fffffff + cmp r1, r0 + beq _0802C3D0 + adds r0, r1, 0x1 + str r0, [r5, 0x4] + adds r3, r0, 0 + b _0802C3E8 + .pool +_0802C3D0: + adds r0, r2, 0 + adds r0, 0x4A + ldrh r1, [r0] + ldrh r0, [r5, 0xE] + subs r3, r1, r0 + ldr r0, =0x0000fde7 + cmp r3, r0 + ble _0802C3E6 + ldr r0, =0xffff0218 + adds r3, r0 + adds r3, r1 +_0802C3E6: + str r3, [r5, 0x4] +_0802C3E8: + cmp r3, 0x3 + ble _0802C432 + subs r3, 0x4 + cmp r3, 0x2F + bgt _0802C414 + ldr r2, =gUnknown_082FB65C + ldrh r1, [r5, 0xC] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 4 + adds r0, r3, r0 + adds r0, r2 + movs r4, 0 + ldrsb r4, [r0, r4] + b _0802C416 + .pool +_0802C414: + movs r4, 0 +_0802C416: + adds r1, r4, 0 + adds r0, r6, 0 + bl sub_802DC80 + cmp r4, 0 + bne _0802C430 + ldr r0, =0x02022cfc + ldr r0, [r0] + ldrb r0, [r0, 0x6] + cmp r6, r0 + bne _0802C430 + bl sub_802C1BC +_0802C430: + str r4, [r5] +_0802C432: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802C398 + + thumb_func_start sub_802C43C +sub_802C43C: @ 802C43C + push {r4,r5,lr} + ldr r5, =0x02022cfc + ldr r1, [r5] + ldr r0, [r1, 0x14] + cmp r0, 0x8 + bne _0802C4CE + ldr r0, [r1, 0x18] + cmp r0, 0x7 + bne _0802C4CE + ldr r4, [r1, 0x58] + cmp r4, 0 + bne _0802C46C + bl sub_802C780 + ldr r0, [r5] + str r4, [r0, 0x54] + movs r1, 0x1 + str r1, [r0, 0x58] + adds r0, 0x71 + strb r4, [r0] + b _0802C4CE + .pool +_0802C46C: + ldr r0, [r1, 0x54] + cmp r0, 0x5 + bne _0802C480 + ldrh r0, [r1, 0xC] + adds r0, 0x1 + strh r0, [r1, 0xC] + ldrh r0, [r1, 0xC] + bl sub_802C7A0 + b _0802C484 +_0802C480: + movs r0, 0 + strh r0, [r1, 0xC] +_0802C484: + ldr r4, =0x02022cfc + ldr r1, [r4] + ldr r0, [r1, 0x54] + cmp r0, 0x1 + ble _0802C49E + movs r0, 0x1 + str r0, [r1, 0x64] + adds r0, r1, 0 + adds r0, 0x86 + adds r1, 0x81 + movs r2, 0x5 + bl memcpy +_0802C49E: + bl sub_802C780 + ldr r0, [r4] + movs r2, 0 + str r2, [r0, 0x54] + movs r1, 0x1 + str r1, [r0, 0x58] + adds r0, 0x71 + strb r2, [r0] + ldr r0, [r4] + adds r2, r0, 0 + adds r2, 0x74 + ldrh r1, [r2] + ldr r0, =0x0000270e + cmp r1, r0 + bhi _0802C4C2 + adds r0, r1, 0x1 + strh r0, [r2] +_0802C4C2: + movs r0, 0xA + bl sub_802C688 + movs r0, 0x3 + bl sub_802AE14 +_0802C4CE: + ldr r4, =0x02022cfc + ldr r0, [r4] + ldr r0, [r0, 0x64] + cmp r0, 0 + beq _0802C504 + bl sub_802C618 + cmp r0, 0x1 + beq _0802C4E8 + ldr r0, [r4] + ldr r0, [r0, 0x14] + cmp r0, 0 + bne _0802C504 +_0802C4E8: + ldr r0, [r4] + adds r0, 0x86 + bl sub_802C73C + bl sub_802C790 + bl sub_802C688 + movs r0, 0x3 + bl sub_802AE14 + ldr r1, [r4] + movs r0, 0 + str r0, [r1, 0x64] +_0802C504: + ldr r4, =0x02022cfc + ldr r0, [r4] + ldr r0, [r0, 0x58] + cmp r0, 0 + beq _0802C52A + bl sub_802C6B0 + adds r2, r0, 0 + ldr r1, [r4] + ldr r0, [r1, 0x54] + cmp r2, r0 + ble _0802C52A + str r2, [r1, 0x54] + adds r0, r1, 0 + adds r0, 0x81 + adds r1, 0x7C + movs r2, 0x5 + bl memcpy +_0802C52A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802C43C + + thumb_func_start sub_802C538 +sub_802C538: @ 802C538 + push {r4,r5,lr} + ldr r5, =0x02022cfc + ldr r1, [r5] + ldr r0, [r1, 0x14] + cmp r0, 0x6 + bne _0802C582 + ldr r4, =0x000083ac + adds r0, r1, r4 + ldr r1, [r0] + ldr r0, [r1] + cmp r0, 0 + bne _0802C582 + ldrh r0, [r1, 0x12] + cmp r0, 0x1 + bne _0802C578 + bl sub_802C0DC + adds r1, r0, 0 + cmp r1, 0x1 + bne _0802C578 + ldr r0, [r5] + adds r0, r4 + ldr r0, [r0] + str r1, [r0, 0x14] + b _0802C582 + .pool +_0802C574: + movs r0, 0 + b _0802C5CA +_0802C578: + bl sub_802C18C + movs r0, 0x3 + bl sub_802AE14 +_0802C582: + ldr r0, =0x02022cfc + ldr r1, [r0] + ldr r0, [r1, 0x14] + cmp r0, 0x7 + bne _0802C5A8 + ldr r0, [r1, 0x18] + cmp r0, 0x6 + bne _0802C5A8 + ldr r2, =0x000083ac + adds r0, r1, r2 + ldr r1, [r0] + ldrh r0, [r1, 0x10] + cmp r0, 0x2 + beq _0802C5A8 + movs r0, 0x1 + str r0, [r1, 0x14] + movs r0, 0x3 + bl sub_802AE14 +_0802C5A8: + movs r2, 0 + ldr r0, =0x02022cfc + ldr r0, [r0] + ldrb r1, [r0, 0x5] + cmp r2, r1 + bge _0802C5C8 + adds r3, r1, 0 + ldr r4, =0x000082f4 + adds r1, r0, r4 +_0802C5BA: + ldrh r0, [r1] + cmp r0, 0x2 + beq _0802C574 + adds r1, 0x28 + adds r2, 0x1 + cmp r2, r3 + blt _0802C5BA +_0802C5C8: + movs r0, 0x1 +_0802C5CA: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_802C538 + + thumb_func_start sub_802C5DC +sub_802C5DC: @ 802C5DC + push {r4,lr} + ldr r0, =0x02022cfc + ldr r0, [r0] + ldrb r3, [r0, 0x5] + movs r4, 0 + cmp r4, r3 + bge _0802C600 + ldr r1, =0x000082f8 + adds r2, r0, r1 + adds r1, r3, 0 +_0802C5F0: + ldr r0, [r2] + cmp r0, 0 + beq _0802C5F8 + adds r4, 0x1 +_0802C5F8: + adds r2, 0x28 + subs r1, 0x1 + cmp r1, 0 + bne _0802C5F0 +_0802C600: + movs r0, 0 + cmp r4, r3 + bne _0802C608 + movs r0, 0x1 +_0802C608: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_802C5DC + + thumb_func_start sub_802C618 +sub_802C618: @ 802C618 + push {r4,lr} + movs r2, 0 + ldr r0, =0x02022cfc + ldr r0, [r0] + ldrb r1, [r0, 0x5] + cmp r2, r1 + bge _0802C648 + adds r3, r1, 0 + ldr r4, =0x000082f8 + adds r1, r0, r4 +_0802C62C: + ldr r0, [r1] + cmp r0, 0x1 + beq _0802C640 + movs r0, 0 + b _0802C64A + .pool +_0802C640: + adds r1, 0x28 + adds r2, 0x1 + cmp r2, r3 + blt _0802C62C +_0802C648: + movs r0, 0x1 +_0802C64A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802C618 + + thumb_func_start sub_802C650 +sub_802C650: @ 802C650 + push {lr} + ldr r0, =0x02022cfc + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x45 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0802C668 +_0802C660: + movs r0, 0 + b _0802C684 + .pool +_0802C668: + movs r2, 0x1 + ldrb r0, [r1, 0x5] + cmp r2, r0 + bge _0802C682 + adds r3, r0, 0 + adds r1, 0x92 +_0802C674: + ldrh r0, [r1] + cmp r0, 0x1 + beq _0802C660 + adds r1, 0x2 + adds r2, 0x1 + cmp r2, r3 + blt _0802C674 +_0802C682: + movs r0, 0x1 +_0802C684: + pop {r1} + bx r1 + thumb_func_end sub_802C650 + + thumb_func_start sub_802C688 +sub_802C688: @ 802C688 + push {lr} + ldr r1, =0x02022cfc + ldr r2, [r1] + ldr r1, [r2, 0x78] + adds r1, r0 + str r1, [r2, 0x78] + movs r0, 0x1 + str r0, [r2, 0x5C] + ldr r0, =0x00018695 + cmp r1, r0 + bls _0802C6A2 + adds r0, 0x1 + str r0, [r2, 0x78] +_0802C6A2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_802C688 + + thumb_func_start sub_802C6B0 +sub_802C6B0: @ 802C6B0 + push {r4-r7,lr} + movs r5, 0 + ldr r1, =0x02022cfc + ldr r0, [r1] + ldrb r4, [r0, 0x5] + movs r2, 0 + cmp r5, r4 + bge _0802C702 + mov r12, r1 + movs r3, 0 + ldr r7, =0x000082e4 + movs r6, 0x1E + negs r6, r6 +_0802C6CA: + mov r0, r12 + ldr r1, [r0] + adds r0, r1, r7 + adds r0, r3 + ldr r0, [r0] + cmp r0, r6 + bne _0802C6F0 + adds r0, r1, 0 + adds r0, 0x7C + adds r0, r2 + movs r1, 0x1 + strb r1, [r0] + adds r5, 0x1 + b _0802C6FA + .pool +_0802C6F0: + adds r0, r1, 0 + adds r0, 0x7C + adds r0, r2 + movs r1, 0 + strb r1, [r0] +_0802C6FA: + adds r3, 0x28 + adds r2, 0x1 + cmp r2, r4 + blt _0802C6CA +_0802C702: + adds r0, r5, 0 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_802C6B0 + + thumb_func_start sub_802C70C +sub_802C70C: @ 802C70C + push {lr} + movs r2, 0 + ldr r1, =0x03005000 + ldr r3, =0x000009e6 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _0802C728 + ldr r3, =0x00000c1a + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _0802C728 + movs r2, 0x1 +_0802C728: + adds r0, r2, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_802C70C + + thumb_func_start sub_802C73C +sub_802C73C: @ 802C73C + push {r4-r6,lr} + adds r4, r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + ldr r6, =0x02022cfc + movs r5, 0x1 +_0802C74A: + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0802C75A + adds r0, r5, 0 + lsls r0, r1 + orrs r2, r0 + adds r3, 0x1 +_0802C75A: + adds r1, 0x1 + cmp r1, 0x4 + ble _0802C74A + ldr r0, [r6] + adds r0, 0x71 + strb r2, [r0] + cmp r2, 0 + beq _0802C772 + ldr r0, [r6] + adds r0, 0x4D + movs r1, 0x1 + strb r1, [r0] +_0802C772: + adds r0, r3, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_802C73C + + thumb_func_start sub_802C780 +sub_802C780: @ 802C780 + ldr r0, =0x02022cfc + ldr r0, [r0] + adds r0, 0x44 + movs r1, 0 + strb r1, [r0] + bx lr + .pool + thumb_func_end sub_802C780 + + thumb_func_start sub_802C790 +sub_802C790: @ 802C790 + ldr r1, =gUnknown_082FB6EC + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bx lr + .pool + thumb_func_end sub_802C790 + + thumb_func_start sub_802C7A0 +sub_802C7A0: @ 802C7A0 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =0x02022cfc + ldr r0, [r0] + ldrh r2, [r0, 0xE] + cmp r1, r2 + bls _0802C7B2 + strh r1, [r0, 0xE] +_0802C7B2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_802C7A0 + + thumb_func_start sub_802C7BC +sub_802C7BC: @ 802C7BC + push {lr} + ldr r0, =0x02022cfc + ldr r0, [r0] + ldr r1, =gUnknown_082FB714 + ldr r2, [r0, 0x78] + ldr r0, [r1] + cmp r2, r0 + bcs _0802C7D8 + movs r0, 0 + b _0802C7DA + .pool +_0802C7D8: + movs r0, 0x1 +_0802C7DA: + pop {r1} + bx r1 + thumb_func_end sub_802C7BC + + thumb_func_start sub_802C7E0 +sub_802C7E0: @ 802C7E0 + push {r4,lr} + bl sub_802C818 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl sub_802C838 + lsls r0, 16 + lsrs r0, 4 + ldr r1, =0x00000fff + ands r4, r1 + orrs r0, r4 + lsls r0, 16 + lsrs r0, 16 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_802C7E0 + + thumb_func_start sub_802C808 +sub_802C808: @ 802C808 + lsls r0, 16 + lsrs r3, r0, 28 + strh r3, [r2] + lsls r0, 4 + lsrs r0, 20 + strh r0, [r1] + bx lr + thumb_func_end sub_802C808 + + thumb_func_start sub_802C818 +sub_802C818: @ 802C818 + push {lr} + bl GenerateRandomNumber + lsls r0, 16 + movs r1, 0xE0 + lsls r1, 11 + ands r1, r0 + ldr r0, =gUnknown_082FB704 + lsrs r1, 15 + adds r1, r0 + ldrh r0, [r1] + pop {r1} + bx r1 + .pool + thumb_func_end sub_802C818 + + thumb_func_start sub_802C838 +sub_802C838: @ 802C838 + push {r4-r6,lr} + movs r5, 0 + movs r4, 0 + ldr r3, =0x02022cfc + ldr r0, [r3] + ldr r2, =gUnknown_082FB714 + ldr r1, [r0, 0x78] + ldr r0, [r2] + cmp r1, r0 + bcc _0802C874 + ldr r5, [r2, 0x4] + adds r6, r3, 0 + adds r3, r2, 0x4 +_0802C852: + adds r3, 0x8 + adds r2, 0x8 + adds r4, 0x1 + cmp r4, 0x4 + bhi _0802C874 + ldr r0, [r6] + ldr r1, [r0, 0x78] + ldr r0, [r2] + cmp r1, r0 + bcc _0802C874 + ldr r5, [r3] + b _0802C852 + .pool +_0802C874: + lsls r0, r5, 16 + lsrs r0, 16 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_802C838 + + thumb_func_start sub_802C880 +sub_802C880: @ 802C880 + push {r4,r5,lr} + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 16 + lsrs r4, r1, 16 + b _0802C892 +_0802C88C: + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_0802C892: + cmp r4, 0 + beq _0802C8A4 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80D6800 + lsls r0, 24 + cmp r0, 0 + beq _0802C88C +_0802C8A4: + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_802C880 + + thumb_func_start sub_802C8AC +sub_802C8AC: @ 802C8AC + push {lr} + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_802C8AC + + thumb_func_start sub_802C8BC +sub_802C8BC: @ 802C8BC + ldr r0, =0x02022cfc + ldr r0, [r0] + ldrb r0, [r0, 0x6] + bx lr + .pool + thumb_func_end sub_802C8BC + + thumb_func_start sub_802C8C8 +sub_802C8C8: @ 802C8C8 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02022cfc + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x000082a8 + adds r1, r0 + ldr r0, [r2] + adds r0, r1 + bx lr + .pool + thumb_func_end sub_802C8C8 + + thumb_func_start sub_802C8E8 +sub_802C8E8: @ 802C8E8 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =0x02022cfc + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, [r2] + adds r0, r1 + movs r1, 0x83 + lsls r1, 8 + adds r0, r1 + bx lr + .pool + thumb_func_end sub_802C8E8 + + thumb_func_start sub_802C908 +sub_802C908: @ 802C908 + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl sub_802AC00 + lsls r0, 16 + asrs r0, 16 + mvns r0, r0 + lsrs r0, 31 + pop {r1} + bx r1 + thumb_func_end sub_802C908 + + thumb_func_start sub_802C920 +sub_802C920: @ 802C920 + push {r4,r5,lr} + movs r5, 0 +_0802C924: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x5 + bl pokemon_getattr + cmp r0, 0 + beq _0802C95C + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + bl sub_802C908 + cmp r0, 0 + beq _0802C95C + ldr r1, =0x020375f0 + movs r0, 0x1 + b _0802C966 + .pool +_0802C95C: + adds r5, 0x1 + cmp r5, 0x5 + ble _0802C924 + ldr r1, =0x020375f0 + movs r0, 0 +_0802C966: + strh r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802C920 + + thumb_func_start sub_802C974 +sub_802C974: @ 802C974 + push {r4-r6,lr} + adds r6, r0, 0 + movs r4, 0 + ldr r5, =gUnknown_082FBE08 +_0802C97C: + adds r0, r5, 0 + bl LoadCompressedObjectPic + adds r5, 0x8 + adds r4, 0x1 + cmp r4, 0x4 + bls _0802C97C + movs r4, 0 + ldr r5, =gUnknown_082FBE30 +_0802C98E: + adds r0, r5, 0 + bl LoadTaggedObjectPalette + adds r5, 0x8 + adds r4, 0x1 + cmp r4, 0x1 + bls _0802C98E + movs r0, 0x5 + bl IndexOfObjectPaletteTag + strb r0, [r6, 0xE] + movs r0, 0x6 + bl IndexOfObjectPaletteTag + strb r0, [r6, 0xF] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802C974 + + thumb_func_start sub_802C9BC +sub_802C9BC: @ 802C9BC + push {lr} + movs r2, 0 + movs r1, 0x7 + adds r0, 0x3C +_0802C9C4: + strh r2, [r0] + subs r0, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _0802C9C4 + pop {r0} + bx r0 + thumb_func_end sub_802C9BC + + thumb_func_start sub_802C9D4 +sub_802C9D4: @ 802C9D4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x34 + mov r9, r0 + adds r7, r1, 0 + ldr r0, [sp, 0x54] + lsls r2, 16 + lsrs r2, 16 + str r2, [sp, 0x28] + lsls r3, 16 + lsrs r3, 16 + str r3, [sp, 0x2C] + lsls r0, 24 + lsrs r6, r0, 24 + mov r1, sp + ldr r0, =gUnknown_082FBE40 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + movs r0, 0x80 + lsls r0, 6 + bl Alloc + mov r8, r0 + movs r0, 0x80 + lsls r0, 4 + bl Alloc + mov r10, r0 + bl sub_802C8BC + lsls r0, 16 + lsrs r0, 16 + cmp r6, r0 + bne _0802CA2C + movs r0, 0x3 + b _0802CA32 + .pool +_0802CA2C: + adds r0, r6, 0x4 + lsls r0, 24 + lsrs r0, 24 +_0802CA32: + str r0, [sp, 0x30] + mov r1, r8 + cmp r1, 0 + beq _0802CAF4 + mov r2, r10 + cmp r2, 0 + beq _0802CAF4 + ldrh r2, [r7] + lsls r0, r2, 3 + ldr r1, =gMonStillFrontPicTable + adds r0, r1 + ldr r3, [r7, 0x8] + mov r1, r8 + bl DecompressMonPic_DetectFrontOrBack + mov r3, r8 + str r3, [sp, 0x18] + adds r4, r6, 0 + add r0, sp, 0x18 + ldr r5, =0xffff0000 + lsls r1, r4, 16 + movs r2, 0x80 + lsls r2, 4 + orrs r1, r2 + str r1, [r0, 0x4] + bl LoadObjectPic + ldrh r0, [r7] + ldr r1, [r7, 0x4] + ldr r2, [r7, 0x8] + bl species_and_otid_get_pal + str r0, [sp, 0x20] + add r0, sp, 0x20 + ldr r1, [r0, 0x4] + ands r1, r5 + orrs r1, r4 + str r1, [r0, 0x4] + bl LoadCompressedObjectPalette + mov r0, r8 + bl Free + mov r0, r10 + bl Free + mov r1, sp + mov r0, sp + ldrh r0, [r0] + adds r0, r6 + strh r0, [r1] + mov r0, sp + ldrh r0, [r0, 0x2] + adds r0, r6 + strh r0, [r1, 0x2] + ldr r4, [sp, 0x28] + lsls r1, r4, 16 + asrs r1, 16 + ldr r0, [sp, 0x2C] + lsls r2, r0, 16 + asrs r2, 16 + mov r0, sp + ldr r3, [sp, 0x30] + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _0802CAF4 + lsls r0, r6, 2 + ldr r2, =0x000081a8 + add r2, r9 + adds r2, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + str r0, [r2] + ldr r0, =0x000081fc + add r0, r9 + adds r0, r6 + add r1, sp, 0x30 + ldrb r1, [r1] + strb r1, [r0] + b _0802CB00 + .pool +_0802CAF4: + lsls r0, r6, 2 + ldr r1, =0x000081a8 + add r1, r9 + adds r1, r0 + movs r0, 0 + str r0, [r1] +_0802CB00: + add sp, 0x34 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802C9D4 + + thumb_func_start sub_802CB14 +sub_802CB14: @ 802CB14 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r6, r1, 2 + ldr r0, =0x000081bc + adds r5, r4, r0 + adds r5, r6 + ldr r0, [r5] + bl sub_802C9BC + ldr r2, [r5] + ldr r0, =0x000081a8 + adds r4, r0 + adds r4, r6 + ldr r1, [r4] + ldr r0, =0x02020630 + subs r1, r0 + lsls r0, r1, 4 + subs r0, r1 + lsls r1, r0, 8 + adds r0, r1 + lsls r1, r0, 16 + adds r0, r1 + negs r0, r0 + asrs r0, 2 + strh r0, [r2, 0x3C] + ldr r1, [r5] + adds r1, 0x3E + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r5] + movs r0, 0x60 + strh r0, [r1, 0x22] + ldr r0, [r5] + ldr r1, =sub_802CB7C + str r1, [r0, 0x1C] + movs r1, 0x1 + bl StartObjectImageAnim + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802CB14 + + thumb_func_start sub_802CB7C +sub_802CB7C: @ 802CB7C + push {lr} + adds r2, r0, 0 + movs r1, 0x2E + ldrsh r0, [r2, r1] + cmp r0, 0x1 + beq _0802CBA8 + cmp r0, 0x1 + bgt _0802CB92 + cmp r0, 0 + beq _0802CB98 + b _0802CBE6 +_0802CB92: + cmp r0, 0x2 + beq _0802CBC8 + b _0802CBE6 +_0802CB98: + adds r0, r2, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0802CBE6 + b _0802CBD6 +_0802CBA8: + ldrh r1, [r2, 0x22] + subs r1, 0x1 + strh r1, [r2, 0x22] + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x48 + bgt _0802CBE6 + movs r0, 0x48 + strh r0, [r2, 0x22] + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + b _0802CBE6 +_0802CBC8: + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2F + ble _0802CBE6 +_0802CBD6: + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r3] + ldr r0, =DummyObjectCallback + str r0, [r2, 0x1C] +_0802CBE6: + pop {r0} + bx r0 + .pool + thumb_func_end sub_802CB7C + + thumb_func_start sub_802CBF0 +sub_802CBF0: @ 802CBF0 + push {lr} + lsls r1, 2 + ldr r2, =0x000081a8 + adds r0, r2 + adds r0, r1 + ldr r2, [r0] + ldr r1, =sub_802CC40 + str r1, [r2, 0x1C] + movs r1, 0 + strh r1, [r2, 0x26] + ldr r0, [r0] + bl sub_802C9BC + pop {r0} + bx r0 + .pool + thumb_func_end sub_802CBF0 + + thumb_func_start sub_802CC18 +sub_802CC18: @ 802CC18 + push {lr} + movs r2, 0 + lsls r1, 2 + ldr r3, =0x000081a8 + adds r0, r3 + adds r0, r1 + ldr r0, [r0] + ldr r1, [r0, 0x1C] + ldr r0, =sub_802CC40 + cmp r1, r0 + bne _0802CC30 + movs r2, 0x1 +_0802CC30: + adds r0, r2, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_802CC18 + + thumb_func_start sub_802CC40 +sub_802CC40: @ 802CC40 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0802CC6C + ldrh r0, [r2, 0x32] + adds r0, 0x1 + strh r0, [r2, 0x32] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0802CC64 + movs r0, 0x2 + b _0802CC66 +_0802CC64: + ldr r0, =0x0000fffe +_0802CC66: + strh r0, [r2, 0x26] + movs r0, 0 + strh r0, [r2, 0x30] +_0802CC6C: + movs r1, 0x32 + ldrsh r0, [r2, r1] + cmp r0, 0xC + ble _0802CC7C + movs r0, 0 + strh r0, [r2, 0x26] + ldr r0, =DummyObjectCallback + str r0, [r2, 0x1C] +_0802CC7C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_802CC40 + + thumb_func_start sub_802CC88 +sub_802CC88: @ 802CC88 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 2 + ldr r0, =0x000081a8 + adds r4, r0 + adds r4, r1 + ldr r0, [r4] + bl sub_802C9BC + ldr r1, [r4] + ldr r0, =sub_802CD08 + str r0, [r1, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802CC88 + + thumb_func_start sub_802CCB0 +sub_802CCB0: @ 802CCB0 + push {r4-r7,lr} + adds r4, r0, 0 + bl sub_802C8AC + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + beq _0802CCF4 + movs r1, 0x5 + negs r1, r1 + mov r12, r1 + ldr r1, =0x000081a8 + adds r3, r4, r1 + ldr r7, =sub_802CD08 + ldr r6, =DummyObjectCallback + movs r5, 0xA + adds r4, r0, 0 +_0802CCD2: + ldr r2, [r3] + ldr r0, [r2, 0x1C] + cmp r0, r7 + bne _0802CCEC + adds r2, 0x3E + ldrb r1, [r2] + mov r0, r12 + ands r0, r1 + strb r0, [r2] + ldr r0, [r3] + str r6, [r0, 0x1C] + adds r0, 0x43 + strb r5, [r0] +_0802CCEC: + adds r3, 0x4 + subs r4, 0x1 + cmp r4, 0 + bne _0802CCD2 +_0802CCF4: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802CCB0 + + thumb_func_start sub_802CD08 +sub_802CD08: @ 802CD08 + push {lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _0802CD36 + movs r0, 0 + strh r0, [r3, 0x2E] + adds r3, 0x3E + ldrb r2, [r3] + lsls r0, r2, 29 + lsrs r0, 31 + movs r1, 0x1 + eors r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] +_0802CD36: + pop {r0} + bx r0 + thumb_func_end sub_802CD08 + + thumb_func_start sub_802CD3C +sub_802CD3C: @ 802CD3C + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_802C8AC + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + cmp r2, r3 + bge _0802CD66 + ldr r0, =0x000081fc + adds r5, r4, r0 + subs r0, 0x54 + adds r4, r0 +_0802CD56: + ldm r4!, {r0} + adds r1, r5, r2 + ldrb r1, [r1] + adds r0, 0x43 + strb r1, [r0] + adds r2, 0x1 + cmp r2, r3 + blt _0802CD56 +_0802CD66: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802CD3C + + thumb_func_start sub_802CD70 +sub_802CD70: @ 802CD70 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 2 + ldr r0, =0x000081a8 + adds r4, r0 + adds r4, r1 + ldr r0, [r4] + bl sub_802C9BC + ldr r1, [r4] + ldr r0, =sub_802CDD4 + str r0, [r1, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802CD70 + + thumb_func_start sub_802CD98 +sub_802CD98: @ 802CD98 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_802C8AC + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + cmp r2, r3 + bge _0802CDCC + ldr r5, =sub_802CDD4 + ldr r0, =0x000081a8 + adds r1, r4, r0 +_0802CDB0: + ldr r0, [r1] + ldr r0, [r0, 0x1C] + cmp r0, r5 + bne _0802CDC4 + movs r0, 0x1 + b _0802CDCE + .pool +_0802CDC4: + adds r1, 0x4 + adds r2, 0x1 + cmp r2, r3 + blt _0802CDB0 +_0802CDCC: + movs r0, 0 +_0802CDCE: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_802CD98 + + thumb_func_start sub_802CDD4 +sub_802CDD4: @ 802CDD4 + push {r4,r5,lr} + adds r5, r0, 0 + movs r0, 0x2E + ldrsh r4, [r5, r0] + cmp r4, 0 + beq _0802CDE6 + cmp r4, 0x1 + beq _0802CDF4 + b _0802CE3C +_0802CDE6: + movs r0, 0x22 + bl audio_play + strh r4, [r5, 0x30] + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] +_0802CDF4: + ldrh r0, [r5, 0x30] + adds r0, 0x4 + strh r0, [r5, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7F + ble _0802CE06 + movs r0, 0 + strh r0, [r5, 0x30] +_0802CE06: + ldr r1, =gUnknown_08329F40 + movs r2, 0x30 + ldrsh r0, [r5, r2] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 19 + negs r0, r0 + strh r0, [r5, 0x26] + movs r0, 0x30 + ldrsh r1, [r5, r0] + cmp r1, 0 + bne _0802CE3C + ldrh r0, [r5, 0x32] + adds r0, 0x1 + strh r0, [r5, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bgt _0802CE38 + strh r1, [r5, 0x2E] + b _0802CE3C + .pool +_0802CE38: + ldr r0, =DummyObjectCallback + str r0, [r5, 0x1C] +_0802CE3C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802CDD4 + + thumb_func_start sub_802CE48 +sub_802CE48: @ 802CE48 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r3, 24 + lsrs r4, r3, 24 + ldr r0, =gUnknown_082FC00C + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _0802CE88 + ldr r0, =0x02020630 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + adds r3, r1, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r3] + lsls r2, r4, 2 + ldr r3, =0x000081bc + adds r0, r5, r3 + adds r0, r2 + str r1, [r0] +_0802CE88: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802CE48 + + thumb_func_start sub_802CE9C +sub_802CE9C: @ 802CE9C + push {r4-r7,lr} + adds r7, r0, 0 + movs r5, 0 + movs r4, 0 + ldr r6, =gUnknown_082FBE58 +_0802CEA6: + ldr r1, =gUnknown_082FBEB8 + lsls r0, r4, 2 + adds r0, r1 + ldr r0, [r0] + ldr r2, =gUnknown_082FBEA8 + lsls r1, r5, 1 + adds r1, r2 + movs r2, 0 + ldrsh r1, [r1, r2] + movs r3, 0 + ldrsh r2, [r6, r3] + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r5, 2 + ldr r3, =0x000081d0 + adds r2, r7, r3 + adds r2, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + str r0, [r2] + adds r5, 0x1 + adds r6, 0x14 + adds r4, 0x1 + cmp r4, 0x3 + ble _0802CEA6 + movs r4, 0x3 + movs r6, 0x3C +_0802CEE8: + ldr r1, =gUnknown_082FBEB8 + lsls r0, r4, 2 + adds r0, r1 + ldr r0, [r0] + ldr r2, =gUnknown_082FBEA8 + lsls r1, r5, 1 + adds r1, r2 + movs r2, 0 + ldrsh r1, [r1, r2] + ldr r2, =gUnknown_082FBE58 + adds r2, r6, r2 + movs r3, 0 + ldrsh r2, [r2, r3] + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r5, 2 + ldr r3, =0x000081d0 + adds r2, r7, r3 + adds r2, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + str r0, [r2] + adds r0, 0x3F + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] + adds r5, 0x1 + subs r6, 0x14 + subs r4, 0x1 + cmp r4, 0 + bge _0802CEE8 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802CE9C + + thumb_func_start sub_802CF50 +sub_802CF50: @ 802CF50 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + str r0, [sp, 0x8] + cmp r1, 0x5 + ble _0802CF70 + movs r0, 0xA + subs r1, r0, r1 + movs r0, 0x3 + str r0, [sp] + ldr r2, [sp, 0x8] + ldrb r0, [r2, 0xF] + b _0802CF78 +_0802CF70: + movs r3, 0x2 + str r3, [sp] + ldr r7, [sp, 0x8] + ldrb r0, [r7, 0xE] +_0802CF78: + movs r6, 0 + lsls r2, r1, 1 + str r2, [sp, 0x4] + lsls r0, 4 + mov r9, r0 + lsls r1, 24 + mov r8, r1 + ldr r0, =gUnknown_082FBE58 + adds r4, r2, r0 + ldr r3, [sp] + lsls r3, 2 + mov r10, r3 + movs r5, 0x3 +_0802CF92: + lsls r0, r6, 2 + ldr r7, [sp, 0x8] + ldr r1, =0x000081d0 + adds r2, r7, r1 + adds r2, r0 + ldr r1, [r2] + ldrh r0, [r4] + strh r0, [r1, 0x22] + ldr r3, [r2] + ldrb r0, [r3, 0x5] + movs r7, 0xD + negs r7, r7 + adds r1, r7, 0 + ands r0, r1 + mov r1, r10 + orrs r0, r1 + strb r0, [r3, 0x5] + ldr r3, [r2] + ldrb r1, [r3, 0x5] + movs r0, 0xF + ands r0, r1 + mov r7, r9 + orrs r0, r7 + strb r0, [r3, 0x5] + ldr r0, [r2] + mov r2, r8 + lsrs r1, r2, 24 + bl StartObjectImageAnim + adds r6, 0x1 + adds r4, 0x14 + subs r5, 0x1 + cmp r5, 0 + bge _0802CF92 + movs r5, 0x3 + ldr r0, =gUnknown_082FBE58 + ldr r3, [sp, 0x4] + adds r0, r3, r0 + adds r4, r0, 0 + adds r4, 0x3C + ldr r7, [sp] + lsls r7, 2 + mov r10, r7 +_0802CFE8: + lsls r0, r6, 2 + ldr r1, [sp, 0x8] + ldr r3, =0x000081d0 + adds r2, r1, r3 + adds r2, r0 + ldr r1, [r2] + ldrh r0, [r4] + strh r0, [r1, 0x22] + ldr r3, [r2] + ldrb r0, [r3, 0x5] + movs r7, 0xD + negs r7, r7 + adds r1, r7, 0 + ands r0, r1 + mov r1, r10 + orrs r0, r1 + strb r0, [r3, 0x5] + ldr r3, [r2] + ldrb r1, [r3, 0x5] + movs r0, 0xF + ands r0, r1 + mov r7, r9 + orrs r0, r7 + strb r0, [r3, 0x5] + ldr r0, [r2] + mov r2, r8 + lsrs r1, r2, 24 + bl StartObjectImageAnim + adds r6, 0x1 + subs r4, 0x14 + subs r5, 0x1 + cmp r5, 0 + bge _0802CFE8 + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802CF50 + + thumb_func_start sub_802D044 +sub_802D044: @ 802D044 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + movs r0, 0 + str r0, [sp] + movs r0, 0x9 + movs r1, 0x7 + movs r2, 0x78 + movs r3, 0x50 + bl sub_802EB24 + adds r0, r4, 0 + bl sub_802CD3C + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_802D044 + + thumb_func_start sub_802D068 +sub_802D068: @ 802D068 + push {lr} + bl sub_802EB84 + pop {r1} + bx r1 + thumb_func_end sub_802D068 + + thumb_func_start sub_802D074 +sub_802D074: @ 802D074 + push {r4,lr} + ldr r4, =0x02022d00 + str r0, [r4] + bl sub_802D0BC + ldr r0, =sub_802D12C + movs r1, 0x3 + bl AddTask + ldr r1, [r4] + strb r0, [r1, 0x6] + ldr r2, [r4] + ldrb r0, [r2, 0x6] + movs r1, 0x2 + bl set_word_task_arg + ldr r0, =sub_802D150 + bl sub_802D108 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802D074 + + thumb_func_start sub_802D0AC +sub_802D0AC: @ 802D0AC + push {lr} + bl FreeAllWindowBuffers + bl sub_8034CC8 + pop {r0} + bx r0 + thumb_func_end sub_802D0AC + + thumb_func_start sub_802D0BC +sub_802D0BC: @ 802D0BC + movs r1, 0 + strh r1, [r0, 0x4] + str r1, [r0] + movs r1, 0xFF + strh r1, [r0, 0x12] + bx lr + thumb_func_end sub_802D0BC + + thumb_func_start sub_802D0C8 +sub_802D0C8: @ 802D0C8 + push {r4-r6,lr} + adds r6, r0, 0 + movs r5, 0 + ldr r4, =gUnknown_082FE18C +_0802D0D0: + ldr r0, [r4] + cmp r0, r6 + bne _0802D0DC + ldr r0, [r4, 0x4] + bl sub_802D108 +_0802D0DC: + adds r4, 0x8 + adds r5, 0x1 + cmp r5, 0x9 + bls _0802D0D0 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802D0C8 + + thumb_func_start sub_802D0F0 +sub_802D0F0: @ 802D0F0 + ldr r0, =0x02022d00 + ldr r0, [r0] + ldr r1, [r0] + movs r0, 0x1 + eors r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + bx lr + .pool + thumb_func_end sub_802D0F0 + + thumb_func_start sub_802D108 +sub_802D108: @ 802D108 + push {r4,lr} + adds r2, r0, 0 + ldr r4, =0x02022d00 + ldr r0, [r4] + ldrb r0, [r0, 0x6] + movs r1, 0 + bl set_word_task_arg + ldr r1, [r4] + movs r0, 0 + strh r0, [r1, 0x4] + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802D108 + + thumb_func_start sub_802D12C +sub_802D12C: @ 802D12C + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, =0x02022d00 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0 + bne _0802D148 + adds r0, r1, 0 + movs r1, 0 + bl get_word_task_arg + bl _call_via_r0 +_0802D148: + pop {r0} + bx r0 + .pool + thumb_func_end sub_802D12C + + thumb_func_start sub_802D150 +sub_802D150: @ 802D150 + push {r4-r6,lr} + sub sp, 0x8 + ldr r6, =0x02022d00 + ldr r1, [r6] + ldrh r5, [r1, 0x4] + cmp r5, 0x1 + bne _0802D160 + b _0802D298 +_0802D160: + cmp r5, 0x1 + bgt _0802D170 + cmp r5, 0 + beq _0802D178 + b _0802D2DA + .pool +_0802D170: + cmp r5, 0x2 + bne _0802D176 + b _0802D2D6 +_0802D176: + b _0802D2DA +_0802D178: + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_082FE164 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + ldr r0, =gUnknown_082FE174 + bl InitWindows + bl reset_temp_tile_data_buffers + ldr r0, [r6] + bl sub_802C974 + bl sub_802DD08 + ldr r0, =gUnknown_082FC044 + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, =gUnknown_082FC064 + str r5, [sp] + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r1, =gUnknown_082FC290 + movs r4, 0x1 + str r4, [sp] + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r0, =gUnknown_082FC440 + movs r1, 0x30 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, =gUnknown_082FC460 + str r5, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r1, =gUnknown_082FCDB0 + str r4, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r0, =gUnknown_082FD168 + movs r1, 0x10 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, =gUnknown_082FD188 + str r5, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r1, =gUnknown_082FDC38 + str r4, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r0, =gUnknown_082FC024 + movs r1, 0x20 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, [r6] + movs r0, 0xD3 + lsls r0, 1 + adds r1, r0 + movs r0, 0 + bl SetBgTilemapBuffer + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + bl sub_802DB8C + movs r0, 0 + bl sub_802DD64 + movs r0, 0 + movs r1, 0x1 + movs r2, 0xE0 + bl sub_8098C6C + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + bl sub_8199D98 + b _0802D2CC + .pool +_0802D298: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _0802D2DA + bl sub_802DBF8 + ldr r0, [r6] + bl sub_802CE9C + ldr r0, [r6] + movs r1, 0x6 + bl sub_802CF50 + movs r0, 0x3 + bl ShowBg + movs r0, 0 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x1 + bl HideBg +_0802D2CC: + ldr r1, [r6] + ldrh r0, [r1, 0x4] + adds r0, 0x1 + strh r0, [r1, 0x4] + b _0802D2DA +_0802D2D6: + movs r0, 0x1 + str r0, [r1] +_0802D2DA: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_802D150 + + thumb_func_start sub_802D2E4 +sub_802D2E4: @ 802D2E4 + push {r4,lr} + ldr r4, =0x02022d00 + ldr r0, [r4] + ldrh r0, [r0, 0x4] + cmp r0, 0x1 + beq _0802D310 + cmp r0, 0x1 + bgt _0802D300 + cmp r0, 0 + beq _0802D30A + b _0802D34A + .pool +_0802D300: + cmp r0, 0x2 + beq _0802D322 + cmp r0, 0x3 + beq _0802D33A + b _0802D34A +_0802D30A: + bl sub_802DE1C + b _0802D330 +_0802D310: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0802D34A + movs r0, 0 + bl sub_802DF70 + b _0802D330 +_0802D322: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0802D34A + bl sub_802DFD4 +_0802D330: + ldr r1, [r4] + ldrh r0, [r1, 0x4] + adds r0, 0x1 + strh r0, [r1, 0x4] + b _0802D34A +_0802D33A: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0802D34A + ldr r1, [r4] + movs r0, 0x1 + str r0, [r1] +_0802D34A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_802D2E4 + + thumb_func_start sub_802D350 +sub_802D350: @ 802D350 + push {r4,lr} + ldr r4, =0x02022d00 + ldr r0, [r4] + ldrh r0, [r0, 0x4] + cmp r0, 0x1 + beq _0802D37C + cmp r0, 0x1 + bgt _0802D36C + cmp r0, 0 + beq _0802D376 + b _0802D3B6 + .pool +_0802D36C: + cmp r0, 0x2 + beq _0802D38E + cmp r0, 0x3 + beq _0802D3A6 + b _0802D3B6 +_0802D376: + bl sub_802DE1C + b _0802D39C +_0802D37C: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0802D3B6 + movs r0, 0x1 + bl sub_802DF70 + b _0802D39C +_0802D38E: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0802D3B6 + bl sub_802DFD4 +_0802D39C: + ldr r1, [r4] + ldrh r0, [r1, 0x4] + adds r0, 0x1 + strh r0, [r1, 0x4] + b _0802D3B6 +_0802D3A6: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0802D3B6 + ldr r1, [r4] + movs r0, 0x1 + str r0, [r1] +_0802D3B6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_802D350 + + thumb_func_start sub_802D3BC +sub_802D3BC: @ 802D3BC + push {r4,r5,lr} + bl sub_802C8AC + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, =0x02022d00 + ldr r0, [r0] + ldrh r0, [r0, 0x4] + cmp r0, 0 + beq _0802D3DC + cmp r0, 0x1 + beq _0802D410 + b _0802D43E + .pool +_0802D3DC: + movs r4, 0 + cmp r4, r5 + bge _0802D3F8 +_0802D3E2: + ldr r0, =0x02022d00 + ldr r0, [r0] + lsls r1, r4, 1 + adds r0, 0x1C + adds r0, r1 + ldrb r0, [r0] + bl ClearWindowTilemap + adds r4, 0x1 + cmp r4, r5 + blt _0802D3E2 +_0802D3F8: + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldr r0, =0x02022d00 + ldr r1, [r0] + ldrh r0, [r1, 0x4] + adds r0, 0x1 + strh r0, [r1, 0x4] + b _0802D43E + .pool +_0802D410: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0802D43E + movs r4, 0 + cmp r4, r5 + bge _0802D436 +_0802D420: + ldr r0, =0x02022d00 + ldr r0, [r0] + lsls r1, r4, 1 + adds r0, 0x1C + adds r0, r1 + ldrb r0, [r0] + bl RemoveWindow + adds r4, 0x1 + cmp r4, r5 + blt _0802D420 +_0802D436: + ldr r0, =0x02022d00 + ldr r1, [r0] + movs r0, 0x1 + str r0, [r1] +_0802D43E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802D3BC + + thumb_func_start sub_802D448 +sub_802D448: @ 802D448 + push {r4,r5,lr} + sub sp, 0xC + ldr r5, =0x02022d00 + ldr r0, [r5] + ldrh r4, [r0, 0x4] + cmp r4, 0x1 + beq _0802D4A4 + cmp r4, 0x1 + bgt _0802D464 + cmp r4, 0 + beq _0802D46A + b _0802D4EC + .pool +_0802D464: + cmp r4, 0x2 + beq _0802D4DC + b _0802D4EC +_0802D46A: + movs r0, 0x1 + movs r1, 0x8 + movs r2, 0x14 + movs r3, 0x2 + bl sub_802DA9C + ldr r1, [r5] + strh r0, [r1, 0x12] + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gUnknown_085EDF2A + movs r1, 0x1 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + ldr r0, [r5] + ldrb r0, [r0, 0x12] + movs r1, 0x2 + bl CopyWindowToVram + b _0802D4D2 + .pool +_0802D4A4: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0802D4EC + ldr r0, [r5] + ldrb r0, [r0, 0x12] + bl PutWindowTilemap + ldr r0, [r5] + ldrb r0, [r0, 0x12] + movs r1, 0x1 + movs r2, 0xE + bl sub_8098858 + movs r0, 0x17 + movs r1, 0x7 + movs r2, 0 + bl sub_802DB18 + movs r0, 0 + bl CopyBgTilemapBufferToVram +_0802D4D2: + ldr r1, [r5] + ldrh r0, [r1, 0x4] + adds r0, 0x1 + strh r0, [r1, 0x4] + b _0802D4EC +_0802D4DC: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0802D4EC + ldr r1, [r5] + movs r0, 0x1 + str r0, [r1] +_0802D4EC: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_802D448 + + thumb_func_start sub_802D4F4 +sub_802D4F4: @ 802D4F4 + push {r4,r5,lr} + sub sp, 0xC + ldr r5, =0x02022d00 + ldr r0, [r5] + ldrh r4, [r0, 0x4] + cmp r4, 0x1 + beq _0802D550 + cmp r4, 0x1 + bgt _0802D510 + cmp r4, 0 + beq _0802D516 + b _0802D58E + .pool +_0802D510: + cmp r4, 0x2 + beq _0802D57E + b _0802D58E +_0802D516: + movs r0, 0x2 + movs r1, 0x7 + movs r2, 0x1A + movs r3, 0x4 + bl sub_802DA9C + ldr r1, [r5] + strh r0, [r1, 0x12] + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gUnknown_082C8959 + movs r1, 0x1 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + ldr r0, [r5] + ldrb r0, [r0, 0x12] + movs r1, 0x2 + bl CopyWindowToVram + b _0802D574 + .pool +_0802D550: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0802D58E + ldr r0, [r5] + ldrb r0, [r0, 0x12] + bl PutWindowTilemap + ldr r0, [r5] + ldrb r0, [r0, 0x12] + movs r1, 0x1 + movs r2, 0xE + bl sub_8098858 + movs r0, 0 + bl CopyBgTilemapBufferToVram +_0802D574: + ldr r1, [r5] + ldrh r0, [r1, 0x4] + adds r0, 0x1 + strh r0, [r1, 0x4] + b _0802D58E +_0802D57E: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0802D58E + ldr r1, [r5] + movs r0, 0x1 + str r0, [r1] +_0802D58E: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_802D4F4 + + thumb_func_start sub_802D598 +sub_802D598: @ 802D598 + push {r4,r5,lr} + ldr r5, =0x02022d00 + ldr r0, [r5] + ldrh r4, [r0, 0x4] + cmp r4, 0 + beq _0802D5B0 + cmp r4, 0x1 + beq _0802D5C8 + b _0802D5DE + .pool +_0802D5B0: + bl sub_802DA14 + bl sub_8198C78 + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldr r1, [r5] + ldrh r0, [r1, 0x4] + adds r0, 0x1 + strh r0, [r1, 0x4] + b _0802D5DE +_0802D5C8: + bl sub_802DA44 + cmp r0, 0 + bne _0802D5DE + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0802D5DE + ldr r0, [r5] + str r4, [r0] +_0802D5DE: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_802D598 + + thumb_func_start sub_802D5E4 +sub_802D5E4: @ 802D5E4 + push {r4,r5,lr} + sub sp, 0xC + ldr r5, =0x02022d00 + ldr r0, [r5] + ldrh r4, [r0, 0x4] + cmp r4, 0x1 + beq _0802D640 + cmp r4, 0x1 + bgt _0802D600 + cmp r4, 0 + beq _0802D606 + b _0802D67E + .pool +_0802D600: + cmp r4, 0x2 + beq _0802D66E + b _0802D67E +_0802D606: + movs r0, 0x2 + movs r1, 0x8 + movs r2, 0x16 + movs r3, 0x4 + bl sub_802DA9C + ldr r1, [r5] + strh r0, [r1, 0x12] + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gUnknown_085EDF3E + movs r1, 0x1 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + ldr r0, [r5] + ldrb r0, [r0, 0x12] + movs r1, 0x2 + bl CopyWindowToVram + b _0802D664 + .pool +_0802D640: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0802D67E + ldr r0, [r5] + ldrb r0, [r0, 0x12] + bl PutWindowTilemap + ldr r0, [r5] + ldrb r0, [r0, 0x12] + movs r1, 0x1 + movs r2, 0xE + bl sub_8098858 + movs r0, 0 + bl CopyBgTilemapBufferToVram +_0802D664: + ldr r1, [r5] + ldrh r0, [r1, 0x4] + adds r0, 0x1 + strh r0, [r1, 0x4] + b _0802D67E +_0802D66E: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0802D67E + ldr r1, [r5] + movs r0, 0x1 + str r0, [r1] +_0802D67E: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_802D5E4 + + thumb_func_start sub_802D688 +sub_802D688: @ 802D688 + push {r4,r5,lr} + sub sp, 0xC + ldr r5, =0x02022d00 + ldr r0, [r5] + ldrh r4, [r0, 0x4] + cmp r4, 0x1 + beq _0802D6E4 + cmp r4, 0x1 + bgt _0802D6A4 + cmp r4, 0 + beq _0802D6AA + b _0802D722 + .pool +_0802D6A4: + cmp r4, 0x2 + beq _0802D712 + b _0802D722 +_0802D6AA: + movs r0, 0x7 + movs r1, 0xA + movs r2, 0x10 + movs r3, 0x2 + bl sub_802DA9C + ldr r1, [r5] + strh r0, [r1, 0x12] + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gUnknown_085EDF6F + movs r1, 0x1 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + ldr r0, [r5] + ldrb r0, [r0, 0x12] + movs r1, 0x2 + bl CopyWindowToVram + b _0802D708 + .pool +_0802D6E4: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0802D722 + ldr r0, [r5] + ldrb r0, [r0, 0x12] + bl PutWindowTilemap + ldr r0, [r5] + ldrb r0, [r0, 0x12] + movs r1, 0x1 + movs r2, 0xE + bl sub_8098858 + movs r0, 0 + bl CopyBgTilemapBufferToVram +_0802D708: + ldr r1, [r5] + ldrh r0, [r1, 0x4] + adds r0, 0x1 + strh r0, [r1, 0x4] + b _0802D722 +_0802D712: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0802D722 + ldr r1, [r5] + movs r0, 0x1 + str r0, [r1] +_0802D722: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_802D688 + + thumb_func_start sub_802D72C +sub_802D72C: @ 802D72C + push {r4,r5,lr} + ldr r5, =0x02022d00 + ldr r0, [r5] + ldrh r4, [r0, 0x4] + cmp r4, 0 + beq _0802D744 + cmp r4, 0x1 + beq _0802D752 + b _0802D75E + .pool +_0802D744: + bl sub_802D044 + ldr r1, [r5] + ldrh r0, [r1, 0x4] + adds r0, 0x1 + strh r0, [r1, 0x4] + b _0802D75E +_0802D752: + bl sub_802D068 + cmp r0, 0 + bne _0802D75E + ldr r0, [r5] + str r4, [r0] +_0802D75E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_802D72C + + thumb_func_start sub_802D764 +sub_802D764: @ 802D764 + push {lr} + ldr r1, =0x02022d00 + ldr r0, [r1] + movs r2, 0 + strb r2, [r0, 0xA] + ldr r0, [r1] + strb r2, [r0, 0xB] + ldr r2, [r1] + movs r0, 0x6 + strb r0, [r2, 0xC] + ldr r0, [r1] + ldrb r0, [r0, 0xC] + bl sub_802DC9C + pop {r0} + bx r0 + .pool + thumb_func_end sub_802D764 + + thumb_func_start sub_802D788 +sub_802D788: @ 802D788 + push {r4,lr} + ldr r0, =0x02022d00 + ldr r2, [r0] + ldrb r3, [r2, 0xA] + adds r4, r0, 0 + cmp r3, 0 + beq _0802D7A0 + cmp r3, 0x1 + beq _0802D7DA + b _0802D7DE + .pool +_0802D7A0: + ldrb r0, [r2, 0xB] + adds r0, 0x1 + strb r0, [r2, 0xB] + ldr r1, [r4] + ldrb r0, [r1, 0xB] + cmp r0, 0xA + bls _0802D7CA + strb r3, [r1, 0xB] + ldr r0, [r4] + ldrb r1, [r0, 0xC] + adds r1, 0x1 + strb r1, [r0, 0xC] + ldr r1, [r4] + ldrb r0, [r1, 0xC] + cmp r0, 0x9 + bls _0802D7CA + strb r3, [r1, 0xC] + ldr r1, [r4] + ldrb r0, [r1, 0xA] + adds r0, 0x1 + strb r0, [r1, 0xA] +_0802D7CA: + ldr r0, [r4] + ldrb r0, [r0, 0xC] + bl sub_802DC9C + ldr r0, [r4] + ldrb r0, [r0, 0xC] + cmp r0, 0x7 + bne _0802D7DE +_0802D7DA: + movs r0, 0 + b _0802D7E0 +_0802D7DE: + movs r0, 0x1 +_0802D7E0: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802D788 + + thumb_func_start sub_802D7E8 +sub_802D7E8: @ 802D7E8 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r1, 0 + lsls r0, 16 + lsrs r0, 16 + lsls r4, 16 + lsrs r4, 16 + ldr r5, =0x02022d00 + ldr r1, [r5] + adds r1, 0x26 + adds r2, r4, 0 + bl sub_80D6660 + ldr r0, [r5] + adds r0, 0x66 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl ConvertIntToDecimalString + bl sub_81AFBF0 + ldr r1, [r5] + adds r1, 0x26 + movs r0, 0 + bl sub_81AFC0C + ldr r1, [r5] + adds r1, 0x66 + movs r0, 0x1 + bl sub_81AFC0C + ldr r0, [r5] + adds r0, 0xA6 + ldr r1, =gUnknown_085EDED3 + bl sub_81AFC28 + movs r0, 0x4 + movs r1, 0x8 + movs r2, 0x16 + movs r3, 0x4 + bl sub_802DA9C + ldr r2, [r5] + movs r4, 0 + movs r3, 0 + strh r0, [r2, 0x12] + lsls r0, 24 + lsrs r0, 24 + adds r2, 0xA6 + movs r1, 0x1 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + str r3, [sp, 0x8] + movs r1, 0x1 + bl Print + ldr r0, [r5] + ldrb r0, [r0, 0x12] + movs r1, 0x2 + bl CopyWindowToVram + ldr r1, [r5] + ldr r0, =0x0000016f + strh r0, [r1, 0x14] + strb r4, [r1, 0xD] + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802D7E8 + + thumb_func_start sub_802D884 +sub_802D884: @ 802D884 + push {r4-r6,lr} + sub sp, 0xC + lsls r0, 16 + lsrs r0, 16 + ldr r4, =0x02022d00 + ldr r1, [r4] + adds r1, 0x26 + bl itemid_get_name + bl sub_81AFBF0 + ldr r1, [r4] + adds r1, 0x26 + movs r0, 0 + bl sub_81AFC0C + ldr r0, [r4] + adds r0, 0xA6 + ldr r1, =gUnknown_085EDEF4 + bl sub_81AFC28 + movs r0, 0x4 + movs r1, 0x8 + movs r2, 0x16 + movs r3, 0x4 + bl sub_802DA9C + ldr r2, [r4] + movs r6, 0 + movs r5, 0 + strh r0, [r2, 0x12] + lsls r0, 24 + lsrs r0, 24 + adds r2, 0xA6 + movs r1, 0x1 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + ldr r0, [r4] + ldrb r0, [r0, 0x12] + movs r1, 0x2 + bl CopyWindowToVram + ldr r0, [r4] + strh r5, [r0, 0x14] + strb r6, [r0, 0xD] + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802D884 + + thumb_func_start sub_802D8FC +sub_802D8FC: @ 802D8FC + push {r4-r6,lr} + sub sp, 0xC + lsls r0, 16 + lsrs r0, 16 + ldr r4, =0x02022d00 + ldr r1, [r4] + adds r1, 0x26 + bl itemid_get_name + bl sub_81AFBF0 + ldr r1, [r4] + adds r1, 0x26 + movs r0, 0 + bl sub_81AFC0C + ldr r0, [r4] + adds r0, 0xA6 + ldr r1, =gUnknown_085EDF11 + bl sub_81AFC28 + movs r0, 0x4 + movs r1, 0x9 + movs r2, 0x16 + movs r3, 0x2 + bl sub_802DA9C + ldr r2, [r4] + movs r6, 0 + movs r5, 0 + strh r0, [r2, 0x12] + lsls r0, 24 + lsrs r0, 24 + adds r2, 0xA6 + movs r1, 0x1 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + ldr r0, [r4] + ldrb r0, [r0, 0x12] + movs r1, 0x2 + bl CopyWindowToVram + ldr r0, [r4] + strh r5, [r0, 0x14] + strb r6, [r0, 0xD] + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802D8FC + + thumb_func_start sub_802D974 +sub_802D974: @ 802D974 + push {r4,lr} + ldr r4, =0x02022d00 + ldr r0, [r4] + ldrb r0, [r0, 0xD] + cmp r0, 0x1 + beq _0802D9C8 + cmp r0, 0x1 + bgt _0802D990 + cmp r0, 0 + beq _0802D99A + b _0802DA0C + .pool +_0802D990: + cmp r0, 0x2 + beq _0802D9EE + cmp r0, 0x3 + beq _0802DA02 + b _0802DA0C +_0802D99A: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0802DA0C + ldr r0, [r4] + ldrb r0, [r0, 0x12] + bl PutWindowTilemap + ldr r0, [r4] + ldrb r0, [r0, 0x12] + movs r1, 0x1 + movs r2, 0xE + bl sub_8098858 + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldr r1, [r4] + ldrb r0, [r1, 0xD] + adds r0, 0x1 + strb r0, [r1, 0xD] + b _0802DA0C +_0802D9C8: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0802DA0C + ldr r1, [r4] + ldrh r0, [r1, 0x14] + cmp r0, 0 + bne _0802D9E0 + ldrb r0, [r1, 0xD] + adds r0, 0x2 + b _0802DA00 +_0802D9E0: + ldrh r0, [r1, 0x14] + bl fanfare_play + ldr r1, [r4] + ldrb r0, [r1, 0xD] + adds r0, 0x1 + strb r0, [r1, 0xD] +_0802D9EE: + bl task_is_not_running_overworld_fanfare + lsls r0, 24 + cmp r0, 0 + beq _0802DA0C + ldr r0, =0x02022d00 + ldr r1, [r0] + ldrb r0, [r1, 0xD] + adds r0, 0x1 +_0802DA00: + strb r0, [r1, 0xD] +_0802DA02: + movs r0, 0 + b _0802DA0E + .pool +_0802DA0C: + movs r0, 0x1 +_0802DA0E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802D974 + + thumb_func_start sub_802DA14 +sub_802DA14: @ 802DA14 + push {r4,lr} + ldr r4, =0x02022d00 + ldr r0, [r4] + ldrh r0, [r0, 0x12] + cmp r0, 0xFF + beq _0802DA38 + lsls r0, 24 + lsrs r0, 24 + bl rbox_fill_rectangle + ldr r0, [r4] + ldrb r0, [r0, 0x12] + movs r1, 0x1 + bl CopyWindowToVram + ldr r1, [r4] + movs r0, 0 + strb r0, [r1, 0xD] +_0802DA38: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802DA14 + + thumb_func_start sub_802DA44 +sub_802DA44: @ 802DA44 + push {r4,lr} + ldr r4, =0x02022d00 + ldr r1, [r4] + ldrh r0, [r1, 0x12] + cmp r0, 0xFF + bne _0802DA58 +_0802DA50: + movs r0, 0 + b _0802DA84 + .pool +_0802DA58: + ldrb r0, [r1, 0xD] + cmp r0, 0 + bne _0802DA7E + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0802DA82 + ldr r0, [r4] + ldrb r0, [r0, 0x12] + bl RemoveWindow + ldr r1, [r4] + movs r0, 0xFF + strh r0, [r1, 0x12] + ldrb r0, [r1, 0xD] + adds r0, 0x1 + strb r0, [r1, 0xD] + b _0802DA50 +_0802DA7E: + cmp r0, 0x1 + beq _0802DA50 +_0802DA82: + movs r0, 0x1 +_0802DA84: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802DA44 + + thumb_func_start sub_802DA8C +sub_802DA8C: @ 802DA8C + push {lr} + bl sub_8198C58 + lsls r0, 24 + asrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_802DA8C + + thumb_func_start sub_802DA9C +sub_802DA9C: @ 802DA9C + push {r4-r6,lr} + sub sp, 0x8 + ldr r6, =0xffffff00 + ldr r4, [sp] + ands r4, r6 + lsls r0, 24 + lsrs r0, 16 + ldr r5, =0xffff00ff + ands r4, r5 + orrs r4, r0 + lsls r1, 24 + lsrs r1, 8 + ldr r0, =0xff00ffff + ands r4, r0 + orrs r4, r1 + lsls r2, 24 + ldr r0, =0x00ffffff + ands r4, r0 + orrs r4, r2 + str r4, [sp] + lsls r3, 24 + lsrs r3, 24 + ldr r0, [sp, 0x4] + ands r0, r6 + orrs r0, r3 + ands r0, r5 + movs r1, 0xF0 + lsls r1, 4 + orrs r0, r1 + ldr r1, =0x0000ffff + ands r0, r1 + movs r1, 0x86 + lsls r1, 15 + orrs r0, r1 + str r0, [sp, 0x4] + mov r0, sp + bl AddWindow + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r0, r4, 24 + lsrs r0, 24 + movs r1, 0x11 + bl FillWindowPixelBuffer + adds r0, r4, 0 + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_802DA9C + + thumb_func_start sub_802DB18 +sub_802DB18: @ 802DB18 + push {r4,r5,lr} + sub sp, 0x8 + adds r3, r2, 0 + lsls r3, 24 + lsrs r3, 24 + ldr r5, =0xffffff00 + ldr r2, [sp] + ands r2, r5 + lsls r0, 24 + lsrs r0, 16 + ldr r4, =0xffff00ff + ands r2, r4 + orrs r2, r0 + lsls r1, 24 + lsrs r1, 8 + ldr r0, =0xff00ffff + ands r2, r0 + orrs r2, r1 + ldr r0, =0x00ffffff + ands r2, r0 + movs r0, 0xC0 + lsls r0, 19 + orrs r2, r0 + str r2, [sp] + ldr r0, [sp, 0x4] + ands r0, r5 + movs r1, 0x4 + orrs r0, r1 + ands r0, r4 + movs r1, 0x80 + lsls r1, 2 + orrs r0, r1 + ldr r1, =0x0000ffff + ands r0, r1 + movs r1, 0xAC + lsls r1, 14 + orrs r0, r1 + str r0, [sp, 0x4] + mov r0, sp + movs r1, 0x1 + movs r2, 0xD + bl CreateYesNoMenu + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802DB18 + + thumb_func_start sub_802DB8C +sub_802DB8C: @ 802DB8C + push {r4,lr} + sub sp, 0x10 + ldr r1, =gUnknown_082FE1DC + add r0, sp, 0xC + movs r2, 0x3 + bl memcpy + movs r0, 0 + bl PutWindowTilemap + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + add r0, sp, 0xC + str r0, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r0, =gUnknown_085EDE7C + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x1 + bl box_print + add r0, sp, 0xC + str r0, [sp] + str r4, [sp, 0x4] + ldr r0, =gUnknown_085EDE84 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0x1 + bl box_print + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802DB8C + + thumb_func_start sub_802DBF8 +sub_802DBF8: @ 802DBF8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + bl sub_802C8AC + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + ldr r1, =gUnknown_082FE260 + subs r0, 0x2 + lsls r0, 2 + adds r0, r1 + ldr r5, [r0] + movs r6, 0 + cmp r6, r10 + bge _0802DC62 + ldr r0, =gUnknown_08300D38 + mov r9, r0 + ldr r1, =0x02022d00 + mov r8, r1 +_0802DC26: + lsls r4, r6, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_802C8C8 + adds r1, r0, 0 + ldrh r0, [r1] + lsls r0, 2 + add r0, r9 + ldrb r3, [r0, 0x1] + mov r2, r8 + ldr r0, [r2] + movs r7, 0 + ldrsh r2, [r5, r7] + adds r3, 0x70 + str r4, [sp] + bl sub_802C9D4 + mov r1, r8 + ldr r0, [r1] + movs r2, 0 + ldrsh r1, [r5, r2] + movs r2, 0x70 + adds r3, r4, 0 + bl sub_802CE48 + adds r5, 0x2 + adds r6, 0x1 + cmp r6, r10 + blt _0802DC26 +_0802DC62: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802DBF8 + + thumb_func_start sub_802DC80 +sub_802DC80: @ 802DC80 + ldr r2, =0x02022d00 + ldr r2, [r2] + lsls r0, 2 + ldr r3, =0x000081a8 + adds r2, r3 + adds r2, r0 + ldr r0, [r2] + strh r1, [r0, 0x26] + bx lr + .pool + thumb_func_end sub_802DC80 + + thumb_func_start sub_802DC9C +sub_802DC9C: @ 802DC9C + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x02022d00 + ldr r0, [r0] + adds r1, r4, 0 + bl sub_802CF50 + ldr r0, =gUnknown_082FE1DF + adds r4, r0 + ldrb r0, [r4] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 13 + movs r0, 0x2 + movs r2, 0 + bl ChangeBgY + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802DC9C + + thumb_func_start sub_802DCCC +sub_802DCCC: @ 802DCCC + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r5, 0 + movs r6, 0 +_0802DCD6: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0802DCEA + ldr r0, =0x02022d00 + ldr r0, [r0] + adds r1, r5, 0 + bl sub_802CB14 + adds r6, 0x1 +_0802DCEA: + lsrs r4, 1 + adds r5, 0x1 + cmp r5, 0x4 + ble _0802DCD6 + subs r0, r6, 0x2 + lsls r0, 24 + lsrs r0, 24 + bl sub_802E00C + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_802DCCC + + thumb_func_start sub_802DD08 +sub_802DD08: @ 802DD08 + push {r4,lr} + sub sp, 0x10 + mov r1, sp + movs r0, 0x40 + strb r0, [r1] + movs r0, 0x5 + strb r0, [r1, 0x1] + movs r0, 0x8 + strb r0, [r1, 0x2] + movs r0, 0x6C + strh r0, [r1, 0x4] + movs r4, 0x6 + strh r4, [r1, 0x6] + ldr r0, =gUnknown_082FE1EC + str r0, [sp, 0x8] + ldr r0, =gUnknown_082FE1F4 + str r0, [sp, 0xC] + movs r0, 0x2 + bl sub_8034C54 + movs r0, 0 + movs r1, 0 + mov r2, sp + bl sub_8034D14 + mov r1, sp + movs r0, 0x4 + strb r0, [r1, 0x1] + movs r0, 0x1E + strh r0, [r1, 0x4] + mov r0, sp + strh r4, [r0, 0x6] + movs r0, 0x1 + movs r1, 0 + mov r2, sp + bl sub_8034D14 + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802DD08 + + thumb_func_start sub_802DD64 +sub_802DD64: @ 802DD64 + push {lr} + adds r1, r0, 0 + movs r0, 0 + bl sub_8035044 + pop {r0} + bx r0 + thumb_func_end sub_802DD64 + + thumb_func_start sub_802DD74 +sub_802DD74: @ 802DD74 + push {lr} + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x1 + bl sub_8035044 + pop {r0} + bx r0 + thumb_func_end sub_802DD74 + + thumb_func_start sub_802DD88 +sub_802DD88: @ 802DD88 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =0x02022d00 + ldr r0, [r0] + bl sub_802CBF0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_802DD88 + + thumb_func_start sub_802DDA0 +sub_802DDA0: @ 802DDA0 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =0x02022d00 + ldr r0, [r0] + bl sub_802CC88 + pop {r0} + bx r0 + .pool + thumb_func_end sub_802DDA0 + + thumb_func_start sub_802DDB8 +sub_802DDB8: @ 802DDB8 + push {lr} + adds r1, r0, 0 + ldr r0, =0x02022d00 + ldr r0, [r0] + bl sub_802CC18 + pop {r1} + bx r1 + .pool + thumb_func_end sub_802DDB8 + + thumb_func_start sub_802DDCC +sub_802DDCC: @ 802DDCC + push {lr} + ldr r0, =0x02022d00 + ldr r0, [r0] + bl sub_802CCB0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_802DDCC + + thumb_func_start sub_802DDE0 +sub_802DDE0: @ 802DDE0 + push {lr} + ldr r0, =0x02022d00 + ldr r0, [r0] + bl sub_802CD3C + pop {r0} + bx r0 + .pool + thumb_func_end sub_802DDE0 + + thumb_func_start sub_802DDF4 +sub_802DDF4: @ 802DDF4 + push {lr} + adds r1, r0, 0 + ldr r0, =0x02022d00 + ldr r0, [r0] + bl sub_802CD70 + pop {r0} + bx r0 + .pool + thumb_func_end sub_802DDF4 + + thumb_func_start sub_802DE08 +sub_802DE08: @ 802DE08 + push {lr} + ldr r0, =0x02022d00 + ldr r0, [r0] + bl sub_802CD98 + pop {r1} + bx r1 + .pool + thumb_func_end sub_802DE08 + + thumb_func_start sub_802DE1C +sub_802DE1C: @ 802DE1C + push {r4-r7,lr} + sub sp, 0x8 + bl sub_802C8AC + lsls r0, 16 + lsrs r7, r0, 16 + ldr r1, =gUnknown_082FE234 + subs r0, r7, 0x2 + lsls r0, 2 + adds r0, r1 + ldr r4, [r0] + ldr r2, =0xffffff00 + ldr r0, [sp] + ands r0, r2 + ldr r1, =0x00ffffff + ands r0, r1 + movs r1, 0x80 + lsls r1, 20 + orrs r0, r1 + str r0, [sp] + ldr r0, [sp, 0x4] + ands r0, r2 + movs r1, 0x2 + orrs r0, r1 + ldr r1, =0xffff00ff + ands r0, r1 + movs r1, 0x80 + lsls r1, 2 + orrs r0, r1 + ldr r1, =0x0000ffff + ands r0, r1 + movs r1, 0xAC + lsls r1, 14 + orrs r0, r1 + str r0, [sp, 0x4] + movs r5, 0 + cmp r5, r7 + bge _0802DEAC + mov r6, sp +_0802DE6A: + ldrb r0, [r4] + lsls r0, 8 + ldr r2, =0xffff00ff + ldr r1, [sp] + ands r1, r2 + orrs r1, r0 + str r1, [sp] + ldrb r2, [r4, 0x2] + lsls r2, 16 + ldr r0, =0xff00ffff + ands r0, r1 + orrs r0, r2 + str r0, [sp] + mov r0, sp + bl AddWindow + ldr r1, =0x02022d00 + ldr r1, [r1] + lsls r2, r5, 1 + adds r1, 0x1C + adds r1, r2 + strh r0, [r1] + lsls r0, 24 + lsrs r0, 24 + bl ClearWindowTilemap + ldrh r0, [r6, 0x6] + adds r0, 0x10 + strh r0, [r6, 0x6] + adds r4, 0x4 + adds r5, 0x1 + cmp r5, r7 + blt _0802DE6A +_0802DEAC: + movs r0, 0 + bl CopyBgTilemapBufferToVram + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802DE1C + + thumb_func_start sub_802DED8 +sub_802DED8: @ 802DED8 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x10 + adds r5, r0, 0 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + add r0, sp, 0xC + strb r1, [r0] + strb r2, [r0, 0x1] + strb r3, [r0, 0x2] + ldr r6, =0x02022d00 + ldr r0, [r6] + lsls r1, r5, 1 + mov r8, r1 + adds r0, 0x1C + add r0, r8 + ldrb r0, [r0] + movs r1, 0 + bl FillWindowPixelBuffer + lsls r5, 24 + lsrs r5, 24 + adds r0, r5, 0 + bl sub_802C8E8 + adds r1, r0, 0 + movs r2, 0x1 + negs r2, r2 + mov r9, r2 + movs r0, 0x1 + bl GetStringWidth + movs r4, 0x40 + subs r4, r0 + lsrs r4, 1 + adds r0, r5, 0 + bl sub_802C8E8 + adds r1, r0, 0 + ldr r0, [r6] + adds r0, 0x1C + add r0, r8 + ldrb r0, [r0] + lsls r4, 24 + lsrs r4, 24 + add r2, sp, 0xC + str r2, [sp] + mov r2, r9 + str r2, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x1 + bl box_print + ldr r0, [r6] + adds r0, 0x1C + add r0, r8 + ldrb r0, [r0] + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802DED8 + + thumb_func_start sub_802DF70 +sub_802DF70: @ 802DF70 + push {r4-r6,lr} + adds r4, r0, 0 + bl sub_802C8AC + lsls r0, 16 + lsrs r5, r0, 16 + cmp r4, 0 + bne _0802DF9A + movs r4, 0 + cmp r4, r5 + bge _0802DFCC +_0802DF86: + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x2 + movs r3, 0x3 + bl sub_802DED8 + adds r4, 0x1 + cmp r4, r5 + blt _0802DF86 + b _0802DFCC +_0802DF9A: + bl sub_802C8BC + lsls r0, 16 + lsrs r6, r0, 16 + movs r4, 0 + cmp r4, r5 + bge _0802DFCC +_0802DFA8: + cmp r6, r4 + beq _0802DFBA + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x2 + movs r3, 0x3 + bl sub_802DED8 + b _0802DFC6 +_0802DFBA: + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x4 + movs r3, 0x5 + bl sub_802DED8 +_0802DFC6: + adds r4, 0x1 + cmp r4, r5 + blt _0802DFA8 +_0802DFCC: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_802DF70 + + thumb_func_start sub_802DFD4 +sub_802DFD4: @ 802DFD4 + push {r4,r5,lr} + bl sub_802C8AC + lsls r0, 16 + lsrs r5, r0, 16 + movs r4, 0 + cmp r4, r5 + bge _0802DFFA +_0802DFE4: + ldr r0, =0x02022d00 + ldr r0, [r0] + lsls r1, r4, 1 + adds r0, 0x1C + adds r0, r1 + ldrb r0, [r0] + bl PutWindowTilemap + adds r4, 0x1 + cmp r4, r5 + blt _0802DFE4 +_0802DFFA: + movs r0, 0 + bl CopyBgTilemapBufferToVram + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802DFD4 + + thumb_func_start sub_802E00C +sub_802E00C: @ 802E00C + push {r4,lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + ldr r0, =0x02022d00 + ldr r2, [r0] + movs r0, 0 + str r0, [r2, 0x18] + lsrs r1, 25 + lsls r1, 16 + movs r0, 0x1 + movs r2, 0 + bl ChangeBgX + movs r0, 0x1 + ands r4, r0 + lsls r4, 8 + subs r4, 0x28 + lsls r4, 8 + adds r1, r4, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x1 + bl ShowBg + ldr r0, =sub_802E090 + movs r1, 0x4 + bl AddTask + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802E00C + + thumb_func_start sub_802E058 +sub_802E058: @ 802E058 + push {r4,lr} + ldr r4, =0x02022d00 + ldr r0, [r4] + ldr r0, [r0, 0x18] + cmp r0, 0x1F + bls _0802E06C + movs r0, 0 + b _0802E08A + .pool +_0802E06C: + movs r0, 0x1 + movs r1, 0x80 + movs r2, 0x1 + bl ChangeBgY + ldr r1, [r4] + ldr r0, [r1, 0x18] + adds r0, 0x1 + str r0, [r1, 0x18] + cmp r0, 0x1F + bls _0802E088 + movs r0, 0x1 + bl HideBg +_0802E088: + movs r0, 0x1 +_0802E08A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802E058 + + thumb_func_start sub_802E090 +sub_802E090: @ 802E090 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_802E058 + cmp r0, 0 + bne _0802E0A4 + adds r0, r4, 0 + bl remove_task +_0802E0A4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_802E090 + + thumb_func_start sub_802E0AC +sub_802E0AC: @ 802E0AC + push {lr} + sub sp, 0xC + mov r2, sp + movs r1, 0x1 + strb r1, [r2] + ldrh r1, [r0] + strh r1, [r2, 0x2] + ldr r1, [r0, 0x4] + str r1, [sp, 0x8] + ldr r0, [r0, 0x8] + str r0, [sp, 0x4] + mov r0, sp + bl sub_800FE50 + add sp, 0xC + pop {r0} + bx r0 + thumb_func_end sub_802E0AC + + thumb_func_start sub_802E0D0 +sub_802E0D0: @ 802E0D0 + push {r4,lr} + sub sp, 0xC + adds r4, r1, 0 + ldr r3, =0x03003090 + lsls r2, r0, 4 + adds r0, r2, r3 + ldrh r1, [r0] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + movs r1, 0xBC + lsls r1, 6 + cmp r0, r1 + bne _0802E100 + adds r1, r3, 0x2 + adds r1, r2, r1 + mov r0, sp + movs r2, 0xC + bl memcpy + mov r0, sp + ldrb r0, [r0] + cmp r0, 0x1 + beq _0802E108 +_0802E100: + movs r0, 0 + b _0802E118 + .pool +_0802E108: + mov r0, sp + ldrh r0, [r0, 0x2] + strh r0, [r4] + ldr r0, [sp, 0x8] + str r0, [r4, 0x4] + ldr r0, [sp, 0x4] + str r0, [r4, 0x8] + movs r0, 0x1 +_0802E118: + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802E0D0 + + thumb_func_start sub_802E120 +sub_802E120: @ 802E120 + push {lr} + sub sp, 0xC + mov r2, sp + movs r1, 0x2 + strb r1, [r2] + str r0, [sp, 0x4] + mov r0, sp + bl sub_800FE50 + add sp, 0xC + pop {r0} + bx r0 + thumb_func_end sub_802E120 + + thumb_func_start sub_802E138 +sub_802E138: @ 802E138 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0xC + mov r3, sp + movs r2, 0x3 + strb r2, [r3] + ldr r3, [r1, 0x8] + lsls r3, 15 + ldr r2, [sp, 0x8] + ldr r4, =0x00007fff + mov r8, r4 + ands r2, r4 + orrs r2, r3 + str r2, [sp, 0x8] + mov r6, sp + ldrb r2, [r1, 0x1] + movs r5, 0x1F + adds r3, r5, 0 + ands r3, r2 + ldrb r4, [r6, 0x3] + movs r2, 0x20 + negs r2, r2 + ands r2, r4 + orrs r2, r3 + strb r2, [r6, 0x3] + mov r3, sp + ldrb r2, [r1] + strb r2, [r3, 0x1] + ldrh r2, [r1, 0x2] + strh r2, [r3, 0x6] + mov r4, sp + ldrh r2, [r1, 0x4] + mov r1, r8 + ands r2, r1 + ldrh r3, [r4, 0x8] + ldr r1, =0xffff8000 + ands r1, r3 + orrs r1, r2 + strh r1, [r4, 0x8] + mov r2, sp + ldrh r1, [r0, 0x10] + strb r1, [r2, 0x2] + mov r3, sp + ldr r1, [r0, 0x14] + lsls r1, 5 + ldrb r2, [r3, 0x3] + ands r5, r2 + orrs r5, r1 + strb r5, [r3, 0x3] + mov r1, sp + ldrh r0, [r0, 0xE] + strh r0, [r1, 0x4] + mov r0, sp + bl sub_800FE50 + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802E138 + + thumb_func_start sub_802E1BC +sub_802E1BC: @ 802E1BC + push {r4,r5,lr} + sub sp, 0xC + adds r5, r0, 0 + adds r4, r1, 0 + ldr r2, =0x03003090 + ldrh r0, [r2] + movs r1, 0xFF + lsls r1, 8 + ands r1, r0 + movs r0, 0xBC + lsls r0, 6 + cmp r1, r0 + bne _0802E228 + adds r1, r2, 0x2 + mov r0, sp + movs r2, 0xC + bl memcpy + mov r0, sp + ldrb r0, [r0] + cmp r0, 0x3 + bne _0802E228 + ldr r0, [sp, 0x8] + lsrs r0, 15 + str r0, [r4, 0x8] + mov r0, sp + ldrb r1, [r0, 0x3] + lsls r0, r1, 27 + lsrs r0, 27 + strb r0, [r4, 0x1] + mov r0, sp + ldrb r0, [r0, 0x1] + strb r0, [r4] + mov r0, sp + ldrh r0, [r0, 0x6] + strh r0, [r4, 0x2] + mov r0, sp + ldrh r0, [r0, 0x8] + lsls r0, 17 + lsrs r0, 17 + strh r0, [r4, 0x4] + mov r0, sp + ldrb r0, [r0, 0x2] + strh r0, [r5, 0x10] + lsls r1, 24 + lsrs r1, 29 + str r1, [r5, 0x14] + mov r0, sp + ldrh r0, [r0, 0x4] + strh r0, [r5, 0xE] + movs r0, 0x1 + b _0802E22A + .pool +_0802E228: + movs r0, 0 +_0802E22A: + add sp, 0xC + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_802E1BC + + thumb_func_start sub_802E234 +sub_802E234: @ 802E234 + push {r4,lr} + sub sp, 0xC + mov r4, sp + movs r3, 0x4 + strb r3, [r4] + ldrh r3, [r0, 0x10] + strb r3, [r4, 0x1] + ldr r3, [r0, 0x14] + strb r3, [r4, 0x2] + ldr r3, [r0, 0x18] + strb r3, [r4, 0x3] + mov r3, sp + ldrh r0, [r0, 0xE] + strh r0, [r3, 0x4] + mov r0, sp + strb r1, [r0, 0x6] + strh r2, [r0, 0x8] + bl sub_800FE50 + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_802E234 + + thumb_func_start sub_802E264 +sub_802E264: @ 802E264 + push {r4-r6,lr} + sub sp, 0xC + adds r4, r0, 0 + adds r5, r2, 0 + adds r6, r3, 0 + ldr r3, =0x03003090 + lsls r2, r1, 4 + adds r0, r2, r3 + ldrh r1, [r0] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + movs r1, 0xBC + lsls r1, 6 + cmp r0, r1 + bne _0802E2C4 + adds r1, r3, 0x2 + adds r1, r2, r1 + mov r0, sp + movs r2, 0xC + bl memcpy + mov r0, sp + ldrb r0, [r0] + cmp r0, 0x4 + bne _0802E2C4 + mov r0, sp + ldrb r0, [r0, 0x1] + strh r0, [r4, 0x10] + mov r0, sp + ldrb r0, [r0, 0x2] + str r0, [r4, 0x14] + mov r0, sp + ldrb r0, [r0, 0x3] + str r0, [r4, 0x18] + mov r0, sp + ldrh r0, [r0, 0x4] + strh r0, [r4, 0xE] + mov r0, sp + ldrb r0, [r0, 0x6] + strb r0, [r5] + mov r0, sp + ldrh r0, [r0, 0x8] + strh r0, [r6] + movs r0, 0x1 + b _0802E2C6 + .pool +_0802E2C4: + movs r0, 0 +_0802E2C6: + add sp, 0xC + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_802E264 + + thumb_func_start sub_802E2D0 +sub_802E2D0: @ 802E2D0 + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + ldr r3, =0x03003090 + lsls r2, r1, 4 + adds r0, r2, r3 + ldrh r1, [r0] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + movs r1, 0xBC + lsls r1, 6 + cmp r0, r1 + bne _0802E320 + adds r1, r3, 0x2 + adds r1, r2, r1 + mov r0, sp + movs r2, 0xC + bl memcpy + mov r0, sp + ldrb r0, [r0] + cmp r0, 0x4 + bne _0802E320 + mov r0, sp + ldrb r0, [r0, 0x1] + strh r0, [r4, 0x10] + mov r0, sp + ldrb r0, [r0, 0x2] + str r0, [r4, 0x14] + mov r0, sp + ldrb r0, [r0, 0x3] + str r0, [r4, 0x18] + mov r0, sp + ldrh r0, [r0, 0x4] + strh r0, [r4, 0xE] + movs r0, 0x1 + b _0802E322 + .pool +_0802E320: + movs r0, 0 +_0802E322: + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802E2D0 + + thumb_func_start sub_802E32C +sub_802E32C: @ 802E32C + ldr r0, =0x03005d90 + ldr r0, [r0] + movs r1, 0xFE + lsls r1, 1 + adds r0, r1 + bx lr + .pool + thumb_func_end sub_802E32C + + thumb_func_start sub_802E33C +sub_802E33C: @ 802E33C + push {lr} + bl sub_802E32C + movs r1, 0 + strh r1, [r0] + str r1, [r0, 0xC] + strh r1, [r0, 0x4] + strh r1, [r0, 0x6] + str r1, [r0, 0x8] + strh r1, [r0, 0x2] + pop {r0} + bx r0 + thumb_func_end sub_802E33C + + thumb_func_start sub_802E354 +sub_802E354: @ 802E354 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + lsls r2, 16 + lsrs r6, r2, 16 + bl sub_802E32C + adds r1, r0, 0 + movs r2, 0 + ldr r0, [r1, 0xC] + cmp r0, r4 + bcs _0802E378 + ldr r0, =0x00018696 + cmp r4, r0 + bhi _0802E378 + str r4, [r1, 0xC] + movs r2, 0x1 +_0802E378: + ldrh r0, [r1] + cmp r0, r5 + bcs _0802E388 + ldr r0, =0x0000270f + cmp r5, r0 + bhi _0802E388 + strh r5, [r1] + movs r2, 0x1 +_0802E388: + ldrh r0, [r1, 0x4] + cmp r0, r6 + bcs _0802E398 + ldr r0, =0x0000270f + cmp r6, r0 + bhi _0802E398 + strh r6, [r1, 0x4] + movs r2, 0x1 +_0802E398: + adds r0, r2, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_802E354 + + thumb_func_start sub_802E3A8 +sub_802E3A8: @ 802E3A8 + push {lr} + bl sub_802E32C + adds r2, r0, 0 + ldrh r1, [r2, 0x6] + ldr r0, =0x0000270e + cmp r1, r0 + bhi _0802E3BC + adds r0, r1, 0x1 + strh r0, [r2, 0x6] +_0802E3BC: + pop {r0} + bx r0 + .pool + thumb_func_end sub_802E3A8 + + thumb_func_start sub_802E3C4 +sub_802E3C4: @ 802E3C4 + push {r4,lr} + ldr r4, =sub_802E3E4 + adds r0, r4, 0 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802E3C4 + + thumb_func_start sub_802E3E4 +sub_802E3E4: @ 802E3E4 + push {r4-r7,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r7, r0, r1 + movs r1, 0 + ldrsh r0, [r7, r1] + cmp r0, 0x1 + beq _0802E4A8 + cmp r0, 0x1 + bgt _0802E40C + cmp r0, 0 + beq _0802E416 + b _0802E4F6 + .pool +_0802E40C: + cmp r0, 0x2 + beq _0802E4B4 + cmp r0, 0x3 + beq _0802E4DC + b _0802E4F6 +_0802E416: + ldr r0, =gUnknown_082FE270 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp] + str r1, [sp, 0x4] + ldr r1, =gUnknown_085EDE8D + movs r0, 0x1 + movs r2, 0 + bl GetStringWidth + adds r4, r0, 0 + movs r6, 0 + ldr r5, =gUnknown_082FE278 +_0802E430: + ldr r1, [r5] + movs r0, 0x1 + movs r2, 0 + bl GetStringWidth + adds r0, 0x26 + cmp r0, r4 + ble _0802E442 + adds r4, r0, 0 +_0802E442: + adds r5, 0x4 + adds r6, 0x1 + cmp r6, 0x2 + bls _0802E430 + adds r0, r4, 0x7 + cmp r0, 0 + bge _0802E452 + adds r0, 0x7 +_0802E452: + asrs r4, r0, 3 + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0802E45E + adds r4, 0x1 +_0802E45E: + movs r1, 0x1E + subs r1, r4 + lsrs r0, r1, 31 + adds r1, r0 + asrs r1, 1 + lsls r1, 24 + lsrs r1, 16 + ldr r2, =0xffff00ff + ldr r0, [sp] + ands r0, r2 + orrs r0, r1 + lsls r2, r4, 24 + ldr r1, =0x00ffffff + ands r0, r1 + orrs r0, r2 + str r0, [sp] + mov r0, sp + bl AddWindow + strh r0, [r7, 0x2] + ldrh r0, [r7, 0x2] + adds r1, r4, 0 + bl sub_802E500 + ldrb r0, [r7, 0x2] + movs r1, 0x3 + b _0802E4CA + .pool +_0802E4A8: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0802E4F6 + b _0802E4CE +_0802E4B4: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _0802E4F6 + ldrb r0, [r7, 0x2] + bl rbox_fill_rectangle + ldrb r0, [r7, 0x2] + movs r1, 0x1 +_0802E4CA: + bl CopyWindowToVram +_0802E4CE: + ldrh r0, [r7] + adds r0, 0x1 + strh r0, [r7] + b _0802E4F6 + .pool +_0802E4DC: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0802E4F6 + ldrb r0, [r7, 0x2] + bl RemoveWindow + adds r0, r4, 0 + bl remove_task + bl script_env_2_enable_and_set_ctx_running +_0802E4F6: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_802E3E4 + + thumb_func_start sub_802E500 +sub_802E500: @ 802E500 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + str r1, [sp, 0x1C] + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x18] + bl sub_802E32C + ldrh r1, [r0] + str r1, [sp, 0xC] + ldr r1, [r0, 0xC] + str r1, [sp, 0x10] + ldrh r0, [r0, 0x4] + str r0, [sp, 0x14] + ldr r0, [sp, 0x18] + lsls r4, r0, 24 + lsrs r4, 24 + ldr r5, =0x0000021d + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0xD0 + bl box_border_load_tiles_and_pal + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0xD + bl sub_8098858 + adds r0, r4, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r5, =gUnknown_085EDE8D + ldr r1, [sp, 0x1C] + lsls r2, r1, 3 + movs r0, 0x1 + adds r1, r5, 0 + bl GetStringCenterAlignXOffset + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + adds r2, r5, 0 + bl Print + movs r6, 0 + adds r7, r4, 0 + movs r0, 0xFF + mov r10, r0 + mov r9, r6 + mov r1, sp + adds r1, 0xC + str r1, [sp, 0x20] + movs r0, 0xC8 + lsls r0, 21 + mov r8, r0 + ldr r5, =0x02021cc4 +_0802E58A: + ldr r1, =gUnknown_082FE278 + lsls r0, r6, 2 + adds r0, r1 + ldr r2, [r0] + mov r1, r8 + lsrs r4, r1, 24 + str r4, [sp] + mov r0, r10 + str r0, [sp, 0x4] + mov r1, r9 + str r1, [sp, 0x8] + adds r0, r7, 0 + movs r1, 0x1 + movs r3, 0 + bl Print + ldr r0, [sp, 0x20] + ldm r0!, {r1} + str r0, [sp, 0x20] + adds r0, r5, 0 + movs r2, 0 + movs r3, 0x5 + bl ConvertIntToDecimalString + adds r0, r5, 0 + bl sub_802E620 + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0 + bl GetStringWidth + ldr r1, [sp, 0x1C] + lsls r3, r1, 3 + subs r3, r0 + lsls r3, 24 + lsrs r3, 24 + str r4, [sp] + mov r0, r10 + str r0, [sp, 0x4] + mov r1, r9 + str r1, [sp, 0x8] + adds r0, r7, 0 + movs r1, 0x1 + adds r2, r5, 0 + bl Print + movs r0, 0x80 + lsls r0, 21 + add r8, r0 + adds r6, 0x1 + ldr r1, [sp, 0x18] + lsls r0, r1, 24 + cmp r6, 0x2 + bls _0802E58A + lsrs r0, 24 + bl PutWindowTilemap + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802E500 + + thumb_func_start sub_802E620 +sub_802E620: @ 802E620 + push {lr} + adds r1, r0, 0 + b _0802E628 +_0802E626: + adds r1, 0x1 +_0802E628: + ldrb r0, [r1] + cmp r0, 0xFF + beq _0802E636 + cmp r0, 0 + bne _0802E626 + movs r0, 0xFF + strb r0, [r1] +_0802E636: + pop {r0} + bx r0 + thumb_func_end sub_802E620 + + thumb_func_start sub_802E63C +sub_802E63C: @ 802E63C + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =sub_802E6D0 + bl AddTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0, 0x8] + strh r5, [r0, 0xA] + ldr r0, =gUnknown_082FE748 + lsls r5, 4 + adds r5, r0 + ldr r1, [r5] + adds r0, r4, 0 + bl _call_via_r1 + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_802E63C + + thumb_func_start sub_802E688 +sub_802E688: @ 802E688 + push {lr} + ldr r0, =sub_802E6D0 + bl get_task_id_by_function + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _0802E6B4 + ldr r0, =0x03005e00 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + movs r0, 0x2 + strh r0, [r1, 0x8] + movs r0, 0x1 + b _0802E6B6 + .pool +_0802E6B4: + movs r0, 0 +_0802E6B6: + pop {r1} + bx r1 + thumb_func_end sub_802E688 + + thumb_func_start sub_802E6BC +sub_802E6BC: @ 802E6BC + push {lr} + ldr r0, =sub_802E6D0 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_802E6BC + + thumb_func_start sub_802E6D0 +sub_802E6D0: @ 802E6D0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0x3 + beq _0802E71C + cmp r0, 0x3 + bgt _0802E6F8 + cmp r0, 0x2 + beq _0802E6FE + b _0802E752 + .pool +_0802E6F8: + cmp r0, 0x4 + beq _0802E738 + b _0802E752 +_0802E6FE: + ldr r1, =gUnknown_082FE748 + movs r2, 0x2 + ldrsh r0, [r4, r2] + lsls r0, 4 + adds r1, 0x8 + adds r0, r1 + ldr r1, [r0] + adds r0, r5, 0 + bl _call_via_r1 + movs r0, 0x3 + strh r0, [r4] + b _0802E752 + .pool +_0802E71C: + ldr r0, =gUnknown_082FE748 + movs r2, 0x2 + ldrsh r1, [r4, r2] + lsls r1, 4 + adds r0, 0xC + adds r1, r0 + ldr r1, [r1] + adds r0, r5, 0 + bl _call_via_r1 + b _0802E752 + .pool +_0802E738: + ldr r0, =gUnknown_082FE748 + movs r2, 0x2 + ldrsh r1, [r4, r2] + lsls r1, 4 + adds r0, 0x4 + adds r1, r0 + ldr r1, [r1] + adds r0, r5, 0 + bl _call_via_r1 + adds r0, r5, 0 + bl remove_task +_0802E752: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802E6D0 + + thumb_func_start sub_802E75C +sub_802E75C: @ 802E75C + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r1, 0x6 + ldrsh r0, [r4, r1] + lsls r0, 3 + ldr r1, =gUnknown_082FE6C8 + adds r0, r1 + bl LoadCompressedObjectPic + movs r2, 0x8 + ldrsh r0, [r4, r2] + lsls r0, 3 + ldr r1, =gUnknown_082FE6D8 + adds r0, r1 + bl LoadTaggedObjectPalette + movs r5, 0 + movs r3, 0x10 + ldrsh r0, [r4, r3] + cmp r5, r0 + bge _0802E7C4 +_0802E790: + movs r0, 0x4 + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + ldr r1, =gUnknown_082FE730 + adds r0, r1 + movs r2, 0x12 + ldrsh r1, [r4, r2] + movs r3, 0x14 + ldrsh r2, [r4, r3] + ldrb r3, [r4, 0xE] + bl AddObjectToFront + lsls r1, r5, 1 + adds r1, r4 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0x1A] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r5, r0 + blt _0802E790 +_0802E7C4: + movs r5, 0 + movs r2, 0x10 + ldrsh r0, [r4, r2] + cmp r5, r0 + bge _0802E820 + movs r7, 0x3 + movs r3, 0xD + negs r3, r3 + mov r12, r3 + ldr r6, =0x02020630 +_0802E7D8: + lsls r0, r5, 1 + adds r0, r4 + movs r1, 0x1A + ldrsh r0, [r0, r1] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r6 + ldrb r1, [r4, 0xC] + ands r1, r7 + lsls r1, 2 + ldrb r3, [r2, 0x5] + mov r0, r12 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r3] + ldrh r0, [r4, 0xA] + strh r0, [r2, 0x30] + mov r3, r8 + strh r3, [r2, 0x34] + strh r5, [r2, 0x36] + ldrh r0, [r4, 0x1A] + strh r0, [r2, 0x38] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r5, r0 + blt _0802E7D8 +_0802E820: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802E75C + + thumb_func_start sub_802E83C +sub_802E83C: @ 802E83C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r1, =0x03005e08 + adds r4, r1 + movs r5, 0 + strh r5, [r4, 0x4] + strh r5, [r4, 0x6] + strh r5, [r4, 0x8] + movs r1, 0x3C + strh r1, [r4, 0xA] + strh r5, [r4, 0xC] + strh r5, [r4, 0xE] + movs r1, 0x3 + strh r1, [r4, 0x10] + movs r1, 0x78 + strh r1, [r4, 0x12] + movs r1, 0x58 + strh r1, [r4, 0x14] + adds r1, r4, 0 + bl sub_802E75C + movs r0, 0x1C + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, =0x02020630 + adds r0, r5 + movs r1, 0x4 + bl StartObjectImageAnim + movs r0, 0x1C + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =0x0000ffe0 + strh r1, [r0, 0x24] + movs r0, 0x1E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x5 + bl StartObjectImageAnim + movs r0, 0x1E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x20 + strh r1, [r0, 0x24] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802E83C + + thumb_func_start sub_802E8C8 +sub_802E8C8: @ 802E8C8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r4, r1, r0 + b _0802E8FC + .pool +_0802E8E0: + lsls r0, r5, 1 + adds r0, r4 + movs r2, 0x1A + ldrsh r1, [r0, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_0802E8FC: + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r5, r0 + blt _0802E8E0 + ldr r1, =gUnknown_082FE6C8 + movs r2, 0x6 + ldrsh r0, [r4, r2] + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x6] + bl FreeObjectTilesByTag + ldr r1, =gUnknown_082FE6D8 + movs r2, 0x8 + ldrsh r0, [r4, r2] + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x4] + bl FreeObjectPaletteByTag + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802E8C8 + + thumb_func_start sub_802E938 +sub_802E938: @ 802E938 + push {r4-r6,lr} + adds r6, r0, 0 + movs r0, 0x34 + ldrsh r1, [r6, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r5, r0, r1 + movs r1, 0x16 + ldrsh r0, [r5, r1] + movs r2, 0xA + ldrsh r1, [r5, r2] + bl __modsi3 + cmp r0, 0 + bne _0802EA4A + ldrh r2, [r5, 0x16] + movs r3, 0x16 + ldrsh r1, [r5, r3] + movs r3, 0x14 + ldrsh r0, [r5, r3] + cmp r1, r0 + beq _0802EA4A + strh r2, [r5, 0x14] + movs r1, 0x32 + ldrsh r0, [r6, r1] + cmp r0, 0x4 + bhi _0802EA44 + lsls r0, 2 + ldr r1, =_0802E984 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0802E984: + .4byte _0802E998 + .4byte _0802E9A6 + .4byte _0802E9A6 + .4byte _0802E9BA + .4byte _0802EA04 +_0802E998: + adds r2, r6, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_0802E9A6: + movs r0, 0x38 + bl audio_play + ldrh r1, [r6, 0x32] + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + bl StartObjectImageAnim + b _0802EA44 +_0802E9BA: + movs r0, 0x15 + bl audio_play + ldrh r1, [r6, 0x32] + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + bl StartObjectImageAnim + ldr r4, =0x02020630 + movs r2, 0x1C + ldrsh r0, [r5, r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + movs r3, 0x1E + ldrsh r1, [r5, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + b _0802EA44 + .pool +_0802EA04: + adds r1, r6, 0 + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + ldr r3, =0x02020630 + movs r0, 0x1C + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + movs r0, 0x1E + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + movs r0, 0x4 + strh r0, [r5] + b _0802EA4A + .pool +_0802EA44: + ldrh r0, [r6, 0x32] + adds r0, 0x1 + strh r0, [r6, 0x32] +_0802EA4A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_802E938 + + thumb_func_start sub_802EA50 +sub_802EA50: @ 802EA50 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r5, =0x03005e08 + adds r6, r4, r5 + movs r0, 0x38 + bl audio_play + ldr r2, =0x02020630 + movs r0, 0x1A + ldrsh r1, [r6, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r2, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_802E938 + str r1, [r0] + movs r0, 0x1A + ldrsh r1, [r6, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + subs r5, 0x8 + adds r4, r5 + movs r0, 0x3 + strh r0, [r4, 0x8] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802EA50 + + thumb_func_start sub_802EAB0 +sub_802EAB0: @ 802EAB0 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r4, r1, r0 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _0802EB14 + ldr r1, =0x03003090 + ldrh r0, [r1, 0x2] + ldr r5, =0x00007fff + cmp r0, r5 + bne _0802EAD8 + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x16] +_0802EAD8: + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _0802EB1A + ldrh r0, [r4, 0x18] + adds r0, 0x1 + strh r0, [r4, 0x18] + mov r0, sp + movs r1, 0 + movs r2, 0xC + bl memset + mov r0, sp + strh r5, [r0] + mov r1, sp + ldrh r0, [r4, 0x18] + strh r0, [r1, 0x2] + mov r0, sp + bl sub_800FE50 + b _0802EB1A + .pool +_0802EB14: + ldrh r0, [r4, 0x16] + adds r0, 0x1 + strh r0, [r4, 0x16] +_0802EB1A: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_802EAB0 + + thumb_func_start sub_802EB24 +sub_802EB24: @ 802EB24 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + ldr r0, [sp, 0x18] + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 16 + lsrs r6, 16 + lsls r3, 16 + lsrs r3, 16 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, =sub_802EB98 + movs r1, 0x50 + str r3, [sp] + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0xC] + strh r5, [r1, 0xE] + strh r6, [r1, 0x10] + ldr r3, [sp] + strh r3, [r1, 0x12] + mov r0, r8 + strh r0, [r1, 0x14] + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802EB24 + + thumb_func_start sub_802EB84 +sub_802EB84: @ 802EB84 + push {lr} + ldr r0, =sub_802EB98 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_802EB84 + + thumb_func_start sub_802EB98 +sub_802EB98: @ 802EB98 + push {r4-r6,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r5, r0, r1 + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _0802EC08 + cmp r0, 0x1 + bgt _0802EBC0 + cmp r0, 0 + beq _0802EBC6 + b _0802EC8A + .pool +_0802EBC0: + cmp r0, 0x2 + beq _0802EC4C + b _0802EC8A +_0802EBC6: + ldrh r0, [r5, 0x4] + ldrh r1, [r5, 0x6] + bl sub_802EF50 + ldrh r0, [r5, 0x4] + ldrh r1, [r5, 0x6] + movs r3, 0x8 + ldrsh r2, [r5, r3] + movs r4, 0xA + ldrsh r3, [r5, r4] + ldrb r4, [r5, 0xC] + str r4, [sp] + bl sub_802EFA8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0xE] + ldrh r0, [r5, 0x4] + ldrh r1, [r5, 0x6] + movs r3, 0x8 + ldrsh r2, [r5, r3] + movs r4, 0xA + ldrsh r3, [r5, r4] + ldrb r4, [r5, 0xC] + str r4, [sp] + adds r4, r5, 0 + adds r4, 0x10 + str r4, [sp, 0x4] + adds r4, 0x2 + str r4, [sp, 0x8] + bl sub_802EFFC + b _0802EC3E +_0802EC08: + ldrb r0, [r5, 0xE] + bl sub_802EC98 + cmp r0, 0 + bne _0802EC8A + ldrb r0, [r5, 0xE] + ldrb r1, [r5, 0x10] + ldrb r2, [r5, 0x12] + bl sub_802EDCC + movs r0, 0xE + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl obj_free_rotscale_entry + movs r3, 0xE + ldrsh r1, [r5, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles +_0802EC3E: + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + b _0802EC8A + .pool +_0802EC4C: + ldrb r0, [r5, 0x10] + bl sub_802EE30 + cmp r0, 0 + bne _0802EC8A + movs r4, 0x10 + ldrsh r1, [r5, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl RemoveObjectAndFreeTiles + movs r0, 0x12 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldrh r0, [r5, 0x4] + bl FreeObjectTilesByTag + ldrh r0, [r5, 0x6] + bl FreeObjectPaletteByTag + adds r0, r6, 0 + bl remove_task +_0802EC8A: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802EB98 + + thumb_func_start sub_802EC98 +sub_802EC98: @ 802EC98 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r4, r1, r0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x7 + bls _0802ECB2 + b _0802EDC4 +_0802ECB2: + lsls r0, 2 + ldr r1, =_0802ECC4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0802ECC4: + .4byte _0802ECE4 + .4byte _0802ECF6 + .4byte _0802ED1C + .4byte _0802ED2C + .4byte _0802ED4E + .4byte _0802ED86 + .4byte _0802EDAC + .4byte _0802ED82 +_0802ECE4: + movs r1, 0x80 + lsls r1, 4 + adds r0, r4, 0 + movs r2, 0x1A + bl sub_8007E18 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] +_0802ECF6: + movs r2, 0x32 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _0802ED04 + movs r0, 0x39 + bl audio_play +_0802ED04: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x13 + ble _0802EDC4 + movs r0, 0 + strh r0, [r4, 0x32] + adds r0, r4, 0 + movs r1, 0x1 + b _0802EDA2 +_0802ED1C: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0802EDC4 + b _0802EDA6 +_0802ED2C: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _0802EDC4 + movs r0, 0 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + movs r1, 0x2 + bl StartObjectRotScalAnim + b _0802EDC4 +_0802ED4E: + ldrh r0, [r4, 0x22] + subs r0, 0x4 + strh r0, [r4, 0x22] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _0802EDC4 + ldrh r1, [r4, 0x36] + movs r2, 0x36 + ldrsh r0, [r4, r2] + cmp r0, 0x1 + bgt _0802ED7E + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + movs r0, 0 + strh r0, [r4, 0x32] + b _0802EDA6 +_0802ED7E: + movs r0, 0x7 + strh r0, [r4, 0x2E] +_0802ED82: + movs r0, 0 + b _0802EDC6 +_0802ED86: + ldrh r0, [r4, 0x22] + adds r0, 0x4 + strh r0, [r4, 0x22] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _0802EDC4 + movs r0, 0 + strh r0, [r4, 0x32] + adds r0, r4, 0 + movs r1, 0x3 +_0802EDA2: + bl StartObjectRotScalAnim +_0802EDA6: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + b _0802EDC2 +_0802EDAC: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0802EDC4 + ldrh r0, [r4, 0x36] + adds r0, 0x1 + strh r0, [r4, 0x36] + movs r0, 0x1 +_0802EDC2: + strh r0, [r4, 0x2E] +_0802EDC4: + movs r0, 0x1 +_0802EDC6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802EC98 + + thumb_func_start sub_802EDCC +sub_802EDCC: @ 802EDCC + push {r4-r6,lr} + mov r6, r8 + push {r6} + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =0x02020630 + mov r8, r0 + lsls r4, r1, 4 + adds r4, r1 + lsls r4, 2 + adds r5, r4, r0 + ldr r0, =0x0000ffd8 + strh r0, [r5, 0x26] + lsls r3, r2, 4 + adds r3, r2 + lsls r3, 2 + mov r1, r8 + adds r2, r3, r1 + strh r0, [r2, 0x26] + adds r5, 0x3E + ldrb r6, [r5] + movs r1, 0x5 + negs r1, r1 + adds r0, r1, 0 + ands r0, r6 + strb r0, [r5] + adds r2, 0x3E + ldrb r0, [r2] + ands r1, r0 + strb r1, [r2] + movs r0, 0x1C + add r8, r0 + add r4, r8 + ldr r0, =sub_802EE5C + str r0, [r4] + add r3, r8 + str r0, [r3] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802EDCC + + thumb_func_start sub_802EE30 +sub_802EE30: @ 802EE30 + push {lr} + lsls r0, 24 + lsrs r0, 24 + movs r3, 0 + ldr r2, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r2, 0x1C + adds r1, r2 + ldr r1, [r1] + ldr r0, =sub_802EE5C + cmp r1, r0 + bne _0802EE4E + movs r3, 0x1 +_0802EE4E: + adds r0, r3, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_802EE30 + + thumb_func_start sub_802EE5C +sub_802EE5C: @ 802EE5C + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r5, 0 + adds r4, 0x2E + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0x4 + bhi _0802EF46 + lsls r0, 2 + ldr r1, =_0802EE7C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0802EE7C: + .4byte _0802EE90 + .4byte _0802EEA0 + .4byte _0802EEC8 + .4byte _0802EEFC + .4byte _0802EF34 +_0802EE90: + movs r0, 0x40 + strh r0, [r4, 0x8] + ldrh r0, [r5, 0x26] + lsls r0, 4 + strh r0, [r4, 0xA] + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_0802EEA0: + ldrh r1, [r4, 0x8] + ldrh r2, [r4, 0xA] + adds r0, r1, r2 + strh r0, [r4, 0xA] + adds r1, 0x1 + strh r1, [r4, 0x8] + lsls r0, 16 + asrs r0, 20 + strh r0, [r5, 0x26] + cmp r0, 0 + blt _0802EF46 + movs r0, 0x39 + bl audio_play + movs r0, 0 + strh r0, [r5, 0x26] + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _0802EF46 +_0802EEC8: + ldrh r0, [r4, 0x2] + adds r0, 0xC + strh r0, [r4, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7F + ble _0802EEE6 + movs r0, 0x39 + bl audio_play + movs r0, 0 + strh r0, [r4, 0x2] + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_0802EEE6: + ldr r0, =gUnknown_08329F40 + movs r2, 0x2 + ldrsh r1, [r4, r2] + lsls r1, 1 + adds r1, r0 + movs r2, 0 + ldrsh r0, [r1, r2] + asrs r0, 4 + b _0802EF2A + .pool +_0802EEFC: + ldrh r0, [r4, 0x2] + adds r0, 0x10 + strh r0, [r4, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7F + ble _0802EF1A + movs r0, 0x39 + bl audio_play + movs r0, 0 + strh r0, [r4, 0x2] + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_0802EF1A: + ldr r1, =gUnknown_08329F40 + movs r2, 0x2 + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 21 +_0802EF2A: + negs r0, r0 + strh r0, [r5, 0x26] + b _0802EF46 + .pool +_0802EF34: + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x28 + ble _0802EF46 + ldr r0, =DummyObjectCallback + str r0, [r5, 0x1C] +_0802EF46: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802EE5C + + thumb_func_start sub_802EF50 +sub_802EF50: @ 802EF50 + push {r4,lr} + sub sp, 0x10 + lsls r1, 16 + lsrs r1, 16 + ldr r2, =gUnknown_082FEBCC + ldr r3, [r2, 0x4] + ldr r2, [r2] + str r2, [sp] + str r3, [sp, 0x4] + ldr r2, =gUnknown_082FEBD4 + ldr r3, [r2, 0x4] + ldr r2, [r2] + str r2, [sp, 0x8] + str r3, [sp, 0xC] + lsls r0, 16 + ldr r3, =0x0000ffff + ldr r2, [sp, 0x4] + ands r2, r3 + orrs r2, r0 + str r2, [sp, 0x4] + ldr r2, =0xffff0000 + add r4, sp, 0x8 + ldr r0, [r4, 0x4] + ands r0, r2 + orrs r0, r1 + str r0, [r4, 0x4] + mov r0, sp + bl LoadCompressedObjectPic + adds r0, r4, 0 + bl LoadTaggedObjectPalette + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802EF50 + + thumb_func_start sub_802EFA8 +sub_802EFA8: @ 802EFA8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x18 + mov r12, r3 + ldr r3, [sp, 0x30] + lsls r1, 16 + lsrs r1, 16 + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + mov r5, sp + ldr r4, =gUnknown_082FEC90 + ldm r4!, {r3,r6,r7} + stm r5!, {r3,r6,r7} + ldm r4!, {r3,r6,r7} + stm r5!, {r3,r6,r7} + mov r4, sp + strh r0, [r4] + mov r0, sp + strh r1, [r0, 0x2] + lsls r2, 16 + asrs r2, 16 + mov r0, r12 + lsls r6, r0, 16 + asrs r6, 16 + mov r0, sp + adds r1, r2, 0 + adds r2, r6, 0 + mov r3, r8 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_802EFA8 + + thumb_func_start sub_802EFFC +sub_802EFFC: @ 802EFFC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + mov r12, r3 + ldr r6, [sp, 0x38] + ldr r3, [sp, 0x3C] + mov r9, r3 + ldr r4, [sp, 0x40] + mov r8, r4 + lsls r1, 16 + lsrs r1, 16 + lsls r6, 24 + lsrs r6, 24 + mov r10, r6 + mov r4, sp + ldr r3, =gUnknown_082FECA8 + ldm r3!, {r5-r7} + stm r4!, {r5-r7} + ldm r3!, {r5-r7} + stm r4!, {r5-r7} + mov r3, sp + strh r0, [r3] + mov r0, sp + strh r1, [r0, 0x2] + lsls r2, 16 + asrs r4, r2, 16 + ldr r0, =0xffe00000 + adds r2, r0 + asrs r2, 16 + mov r1, r12 + lsls r5, r1, 16 + asrs r5, 16 + mov r0, sp + adds r1, r2, 0 + adds r2, r5, 0 + mov r3, r10 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + mov r3, r9 + strh r0, [r3] + adds r4, 0x20 + lsls r4, 16 + asrs r4, 16 + mov r0, sp + adds r1, r4, 0 + adds r2, r5, 0 + mov r3, r10 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + mov r4, r8 + strh r0, [r4] + ldr r2, =0x02020630 + mov r5, r9 + movs r6, 0 + ldrsh r1, [r5, r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r1, [r0] + movs r3, 0x4 + orrs r1, r3 + strb r1, [r0] + movs r7, 0 + ldrsh r1, [r4, r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r3 + strb r1, [r0] + movs r0, 0 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x1 + bl StartObjectImageAnim + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_802EFFC + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_8032654.s b/asm/rom_8032654.s new file mode 100644 index 0000000000..7edc62297a --- /dev/null +++ b/asm/rom_8032654.s @@ -0,0 +1,212175 @@ + .include "asm/macros.s" + .include "constants/constants.s" + + .syntax unified + + .text + + thumb_func_start battle_wireless_setup_if_required_maybe +battle_wireless_setup_if_required_maybe: @ 8032654 + push {lr} + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08032686 + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _0803266E + bl sub_800B488 +_0803266E: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _0803267A + bl sub_8009734 +_0803267A: + ldr r0, =task00_08081A90 + movs r1, 0 + bl AddTask + bl sub_8033244 +_08032686: + pop {r0} + bx r0 + .pool + thumb_func_end battle_wireless_setup_if_required_maybe + + thumb_func_start sub_803269C +sub_803269C: @ 803269C + push {r4-r7,lr} + sub sp, 0x14 + ldr r0, =0x03005d04 + ldr r1, =nullsub_20 + str r1, [r0] + movs r0, 0 + str r0, [sp, 0x10] + movs r1, 0 + ldr r7, =0x03005d60 + ldr r6, =0x020244ac + movs r2, 0 + ldr r5, =0x020244b0 + ldr r4, =nullsub_21 + ldr r3, =0x02024076 +_080326B8: + lsls r0, r1, 2 + adds r0, r7 + str r4, [r0] + adds r1, r3 + movs r0, 0xFF + strb r0, [r1] + ldr r0, [sp, 0x10] + adds r0, r6 + strb r2, [r0] + ldr r0, [sp, 0x10] + adds r0, r5 + strb r2, [r0] + ldr r0, [sp, 0x10] + adds r0, 0x1 + str r0, [sp, 0x10] + adds r1, r0, 0 + cmp r1, 0x3 + ble _080326B8 + bl battle_wireless_setup_if_required_maybe + ldr r0, =0x02024068 + movs r5, 0 + str r5, [r0] + bl sub_80A3934 + bl sub_806E414 + movs r0, 0xF + bl sub_81308C8 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08032728 + bl zero_enemy_party_data + ldr r4, =0x02024744 + movs r1, 0x90 + lsls r1, 1 + str r5, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + str r5, [sp, 0xC] + adds r0, r4, 0 + movs r2, 0x2 + movs r3, 0x20 + bl create_pokemon_set_level + str r5, [sp, 0x10] + adds r0, r4, 0 + movs r1, 0xC + add r2, sp, 0x10 + bl pokemon_setattr +_08032728: + ldr r0, =0x02022ff4 + str r5, [r0] + ldr r0, =0x0202428c + strb r5, [r0] + add sp, 0x14 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803269C + + thumb_func_start sub_8032768 +sub_8032768: @ 8032768 + push {r4,r5,lr} + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + bne _08032784 + movs r0, 0x1 + bl sub_8184DA4 + b _0803278A + .pool +_08032784: + movs r0, 0x2 + bl sub_8184DA4 +_0803278A: + ldr r4, =0x02022fec + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + bne _0803279C + bl sub_8185EB8 +_0803279C: + ldr r0, [r4] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080327B0 + bl b_setup_bx_link + b _080327B4 + .pool +_080327B0: + bl b_setup_bx +_080327B4: + bl sub_8033050 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _080327E2 + movs r4, 0 + ldr r0, =0x0202406c + ldrb r1, [r0] + cmp r4, r1 + bge _080327E2 + adds r5, r0, 0 +_080327D0: + lsls r0, r4, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_81B8D64 + adds r4, 0x1 + ldrb r0, [r5] + cmp r4, r0 + blt _080327D0 +_080327E2: + movs r4, 0 + ldr r3, =0x0202449c + movs r2, 0xD2 + lsls r2, 1 + movs r1, 0 +_080327EC: + ldr r0, [r3] + adds r0, r4, r0 + adds r0, r2 + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x5F + bls _080327EC + movs r4, 0 + ldr r3, =0x0202449c + movs r2, 0x81 + lsls r2, 2 + movs r1, 0 +_08032804: + ldr r0, [r3] + adds r0, r4, r0 + adds r0, r2 + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x67 + bls _08032804 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8032768 + + thumb_func_start b_setup_bx +b_setup_bx: @ 8032824 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =0x02022fec + ldr r3, [r0] + movs r5, 0x80 + lsls r5, 15 + ands r5, r3 + cmp r5, 0 + beq _080328E4 + ldr r1, =0x03005d04 + ldr r0, =sub_8039ECC + str r0, [r1] + movs r4, 0x80 + lsls r4, 17 + ands r4, r3 + cmp r4, 0 + beq _08032874 + ldr r2, =0x03005d60 + ldr r0, =sub_818994C + str r0, [r2] + ldr r1, =0x02024076 + movs r0, 0 + strb r0, [r1] + b _0803287E + .pool +_08032874: + ldr r2, =0x03005d60 + ldr r0, =sub_805745C + str r0, [r2] + ldr r1, =0x02024076 + strb r4, [r1] +_0803287E: + ldr r3, =sub_805F164 + str r3, [r2, 0x4] + movs r0, 0x1 + strb r0, [r1, 0x1] + ldr r0, =sub_81BADF4 + str r0, [r2, 0x8] + movs r0, 0x2 + strb r0, [r1, 0x2] + str r3, [r2, 0xC] + movs r0, 0x3 + strb r0, [r1, 0x3] + ldr r1, =0x0202406c + movs r0, 0x4 + strb r0, [r1] + movs r0, 0 + movs r1, 0 + bl sub_81B8D64 + movs r0, 0x1 + movs r1, 0 + bl sub_81B8D64 + movs r0, 0x2 + movs r1, 0x1 + bl sub_81B8D64 + movs r0, 0x3 + movs r1, 0x1 + bl sub_81B8D64 + ldr r0, =0x0202406e + movs r1, 0 + strh r1, [r0] + strh r1, [r0, 0x2] + movs r1, 0x3 + b _08032A76 + .pool +_080328E4: + movs r7, 0x1 + adds r0, r3, 0 + ands r0, r7 + cmp r0, 0 + beq _080328F0 + b _080329E0 +_080328F0: + ldr r0, =0x03005d04 + ldr r2, =sub_8039ECC + str r2, [r0] + movs r1, 0x80 + ands r1, r3 + mov r12, r2 + cmp r1, 0 + beq _08032918 + ldr r1, =0x03005d60 + ldr r0, =sub_815936C + b _08032934 + .pool +_08032918: + movs r0, 0x80 + lsls r0, 2 + ands r3, r0 + cmp r3, 0 + beq _08032930 + ldr r1, =0x03005d60 + ldr r0, =bx_goto_buffer_A_ch0_tbl3 + b _08032934 + .pool +_08032930: + ldr r1, =0x03005d60 + ldr r0, =sub_805745C +_08032934: + str r0, [r1] + mov r10, r1 + ldr r4, =0x02024076 + movs r0, 0 + mov r9, r0 + mov r1, r9 + strb r1, [r4] + mov r5, r10 + ldr r2, =sub_805F164 + mov r8, r2 + str r2, [r5, 0x4] + movs r6, 0x1 + strb r6, [r4, 0x1] + ldr r2, =0x0202406c + movs r7, 0x2 + strb r7, [r2] + ldr r0, =0x02022fec + ldr r3, [r0] + movs r0, 0x80 + lsls r0, 17 + ands r0, r3 + cmp r0, 0 + bne _08032964 + b _08032CB2 +_08032964: + movs r1, 0x80 + lsls r1, 18 + ands r1, r3 + cmp r1, 0 + beq _080329CC + movs r1, 0x80 + lsls r1, 24 + ands r1, r3 + cmp r1, 0 + beq _080329B4 + mov r1, r12 + ldr r0, =0x03005d04 + str r1, [r0] + ldr r0, =sub_818994C + str r0, [r5] + mov r1, r9 + strb r1, [r4] + ldr r0, =sub_81864EC + str r0, [r5, 0x4] + strb r6, [r4, 0x1] + strb r7, [r2] + b _08032CB2 + .pool +_080329B4: + ldr r0, =sub_818994C + str r0, [r5, 0x4] + strb r1, [r4, 0x1] + ldr r0, =sub_81864EC + str r0, [r5] + strb r6, [r4] + strb r7, [r2] + b _08032CB2 + .pool +_080329CC: + ldr r0, =sub_818994C + mov r2, r10 + str r0, [r2] + strb r1, [r4] + mov r0, r8 + str r0, [r2, 0x4] + strb r6, [r4, 0x1] + b _08032CB2 + .pool +_080329E0: + ldr r1, =sub_8039ECC + ldr r2, =0x03005d04 + str r1, [r2] + ldr r2, =0x03005d60 + ldr r0, =sub_805745C + str r0, [r2] + ldr r4, =0x02024076 + strb r5, [r4] + ldr r6, =sub_805F164 + str r6, [r2, 0x4] + strb r7, [r4, 0x1] + str r0, [r2, 0x8] + movs r0, 0x2 + mov r12, r0 + mov r1, r12 + strb r1, [r4, 0x2] + str r6, [r2, 0xC] + movs r0, 0x3 + mov r8, r0 + mov r1, r8 + strb r1, [r4, 0x3] + ldr r0, =0x0202406c + mov r10, r0 + movs r1, 0x4 + mov r9, r1 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 17 + ands r0, r3 + cmp r0, 0 + bne _08032A20 + b _08032CB2 +_08032A20: + movs r1, 0xA0 + lsls r1, 1 + adds r0, r3, 0 + ands r0, r1 + cmp r0, r1 + bne _08032AA0 + ldr r0, =sub_8039ECC + ldr r1, =0x03005d04 + str r0, [r1] + ldr r0, =sub_818994C + str r0, [r2] + strb r5, [r4] + str r6, [r2, 0x4] + strb r7, [r4, 0x1] + str r0, [r2, 0x8] + mov r0, r12 + strb r0, [r4, 0x2] + str r6, [r2, 0xC] + mov r1, r8 + strb r1, [r4, 0x3] + mov r0, r9 + mov r2, r10 + strb r0, [r2] + movs r0, 0 + movs r1, 0 + bl sub_81B8D64 + movs r0, 0x1 + movs r1, 0 + bl sub_81B8D64 + movs r0, 0x2 + movs r1, 0x1 + bl sub_81B8D64 + movs r0, 0x3 + movs r1, 0x1 + bl sub_81B8D64 + ldr r0, =0x0202406e + strh r5, [r0] + strh r5, [r0, 0x2] + mov r1, r8 +_08032A76: + strh r1, [r0, 0x4] + strh r1, [r0, 0x6] + b _08032CB2 + .pool +_08032AA0: + movs r5, 0x40 + ands r5, r3 + cmp r5, 0 + bne _08032AAA + b _08032C3C +_08032AAA: + ldr r0, =0x0203c7b4 + ldrb r5, [r0] + movs r0, 0 + mov r10, r0 + ldr r1, =0x020229e8 + mov r12, r1 + adds r7, r4, 0 + mov r8, r0 + ldr r6, =0x0202406e + movs r4, 0 + movs r2, 0x3 + mov r9, r2 +_08032AC2: + mov r1, r12 + adds r0, r4, r1 + ldrh r0, [r0, 0x18] + cmp r0, 0x2 + bgt _08032AE4 + cmp r0, 0x1 + bge _08032AFC + cmp r0, 0 + beq _08032AE8 + b _08032B06 + .pool +_08032AE4: + cmp r0, 0x3 + bne _08032B06 +_08032AE8: + ldr r0, =0x020229e8 + adds r0, r4, r0 + ldrb r0, [r0, 0x18] + movs r1, 0 + bl sub_81B8D64 + b _08032B06 + .pool +_08032AFC: + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_81B8D64 +_08032B06: + cmp r10, r5 + bne _08032B56 + ldr r0, =0x020229e8 + adds r3, r4, r0 + ldrh r1, [r3, 0x18] + lsls r1, 2 + ldr r2, =0x03005d60 + adds r1, r2 + ldr r2, =sub_818994C + str r2, [r1] + ldrh r1, [r3, 0x18] + mov r12, r0 + cmp r1, 0x2 + bgt _08032B38 + cmp r1, 0x1 + bge _08032B4C + cmp r1, 0 + beq _08032B3C + b _08032C2C + .pool +_08032B38: + cmp r1, 0x3 + bne _08032C2C +_08032B3C: + mov r1, r12 + adds r0, r4, r1 + ldrh r1, [r0, 0x18] + adds r1, r7 + mov r2, r8 + strb r2, [r1] + ldrh r0, [r0, 0x18] + b _08032C12 +_08032B4C: + adds r1, r7 + movs r0, 0x2 + strb r0, [r1] + ldrh r0, [r3, 0x18] + b _08032C24 +_08032B56: + ldr r2, =0x020229e8 + adds r0, r4, r2 + ldrh r1, [r0, 0x18] + movs r3, 0x1 + adds r0, r3, 0 + ands r0, r1 + mov r12, r2 + cmp r0, 0 + bne _08032B80 + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + add r0, r12 + ldrh r1, [r0, 0x18] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08032B92 + b _08032BD8 + .pool +_08032B80: + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + add r0, r12 + ldrh r1, [r0, 0x18] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08032BD8 +_08032B92: + mov r0, r12 + adds r2, r4, r0 + ldrh r0, [r2, 0x18] + lsls r0, 2 + ldr r1, =0x03005d60 + adds r0, r1 + ldr r1, =sub_818994C + str r1, [r0] + ldrh r1, [r2, 0x18] + cmp r1, 0x2 + bgt _08032BBC + cmp r1, 0x1 + bge _08032BD0 + cmp r1, 0 + beq _08032BC0 + b _08032C2C + .pool +_08032BBC: + cmp r1, 0x3 + bne _08032C2C +_08032BC0: + mov r2, r12 + adds r0, r4, r2 + ldrh r1, [r0, 0x18] + adds r1, r7 + mov r2, r8 + strb r2, [r1] + ldrh r0, [r0, 0x18] + b _08032C12 +_08032BD0: + adds r1, r7 + movs r0, 0x2 + strb r0, [r1] + b _08032C22 +_08032BD8: + mov r0, r12 + adds r2, r4, r0 + ldrh r0, [r2, 0x18] + lsls r0, 2 + ldr r1, =0x03005d60 + adds r0, r1 + ldr r1, =sub_81864EC + str r1, [r0] + ldrh r0, [r2, 0x18] + cmp r0, 0x2 + bgt _08032C00 + cmp r0, 0x1 + bge _08032C1C + cmp r0, 0 + beq _08032C04 + b _08032C2C + .pool +_08032C00: + cmp r0, 0x3 + bne _08032C2C +_08032C04: + mov r0, r12 + adds r2, r4, r0 + ldrh r0, [r2, 0x18] + adds r0, r7 + movs r1, 0x1 + strb r1, [r0] + ldrh r0, [r2, 0x18] +_08032C12: + lsls r0, 1 + adds r0, r6 + mov r1, r8 + strh r1, [r0] + b _08032C2C +_08032C1C: + adds r0, r7 + mov r1, r9 + strb r1, [r0] +_08032C22: + ldrh r0, [r2, 0x18] +_08032C24: + lsls r0, 1 + adds r0, r6 + mov r2, r9 + strh r2, [r0] +_08032C2C: + adds r4, 0x1C + movs r0, 0x1 + add r10, r0 + mov r1, r10 + cmp r1, 0x3 + bgt _08032C3A + b _08032AC2 +_08032C3A: + b _08032CB2 +_08032C3C: + movs r1, 0x4 + ands r1, r3 + cmp r1, 0 + beq _08032C7C + ldr r0, =sub_818994C + str r0, [r2] + strb r5, [r4] + str r0, [r2, 0x8] + mov r0, r12 + strb r0, [r4, 0x2] + movs r0, 0x80 + lsls r0, 18 + ands r3, r0 + cmp r3, 0 + beq _08032C70 + ldr r0, =sub_81864EC + str r0, [r2, 0x4] + strb r7, [r4, 0x1] + str r0, [r2, 0xC] + mov r1, r8 + strb r1, [r4, 0x3] + b _08032CB2 + .pool +_08032C70: + str r6, [r2, 0x4] + strb r7, [r4, 0x1] + str r6, [r2, 0xC] + mov r2, r8 + strb r2, [r4, 0x3] + b _08032CB2 +_08032C7C: + ldr r0, =sub_818994C + str r0, [r2, 0x4] + strb r1, [r4, 0x1] + str r0, [r2, 0xC] + mov r0, r12 + strb r0, [r4, 0x3] + movs r0, 0x80 + lsls r0, 18 + ands r3, r0 + cmp r3, 0 + beq _08032CA8 + ldr r0, =sub_81864EC + str r0, [r2] + strb r7, [r4] + str r0, [r2, 0x8] + mov r1, r8 + strb r1, [r4, 0x2] + b _08032CB2 + .pool +_08032CA8: + str r6, [r2] + strb r7, [r4] + str r6, [r2, 0x8] + mov r2, r8 + strb r2, [r4, 0x2] +_08032CB2: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end b_setup_bx + + thumb_func_start b_setup_bx_link +b_setup_bx_link: @ 8032CC0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, =0x02022fec + ldr r1, [r4] + movs r5, 0x1 + adds r3, r1, 0 + ands r3, r5 + cmp r3, 0 + bne _08032D48 + movs r4, 0x4 + ands r4, r1 + cmp r4, 0 + beq _08032D1C + ldr r1, =0x03005d04 + ldr r0, =sub_8039ECC + str r0, [r1] + ldr r2, =0x03005d60 + ldr r0, =sub_805745C + str r0, [r2] + ldr r1, =0x02024076 + strb r3, [r1] + ldr r0, =sub_8064394 + str r0, [r2, 0x4] + strb r5, [r1, 0x1] + ldr r1, =0x0202406c + movs r0, 0x2 + b _0803303A + .pool +_08032D1C: + ldr r2, =0x03005d60 + ldr r0, =sub_805745C + str r0, [r2, 0x4] + ldr r1, =0x02024076 + strb r4, [r1, 0x1] + ldr r0, =sub_8064394 + str r0, [r2] + strb r5, [r1] + ldr r1, =0x0202406c + movs r0, 0x2 + b _0803303A + .pool +_08032D48: + movs r0, 0x41 + ands r0, r1 + cmp r0, 0x1 + bne _08032DD0 + movs r6, 0x4 + adds r3, r6, 0 + ands r3, r1 + cmp r3, 0 + beq _08032D98 + ldr r1, =0x03005d04 + ldr r0, =sub_8039ECC + str r0, [r1] + ldr r2, =0x03005d60 + ldr r4, =sub_805745C + str r4, [r2] + ldr r1, =0x02024076 + movs r0, 0 + strb r0, [r1] + ldr r3, =sub_8064394 + str r3, [r2, 0x4] + strb r5, [r1, 0x1] + str r4, [r2, 0x8] + movs r0, 0x2 + strb r0, [r1, 0x2] + str r3, [r2, 0xC] + movs r0, 0x3 + strb r0, [r1, 0x3] + b _08032DB4 + .pool +_08032D98: + ldr r2, =0x03005d60 + ldr r0, =sub_805745C + str r0, [r2, 0x4] + ldr r1, =0x02024076 + strb r3, [r1, 0x1] + ldr r3, =sub_8064394 + str r3, [r2] + strb r5, [r1] + str r0, [r2, 0xC] + movs r0, 0x2 + strb r0, [r1, 0x3] + str r3, [r2, 0x8] + movs r0, 0x3 + strb r0, [r1, 0x2] +_08032DB4: + ldr r0, =0x0202406c + strb r6, [r0] + b _0803303C + .pool +_08032DD0: + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _08032E8C + movs r4, 0x4 + adds r3, r4, 0 + ands r3, r1 + cmp r3, 0 + beq _08032E1C + ldr r1, =0x03005d04 + ldr r0, =sub_8039ECC + str r0, [r1] + ldr r2, =0x03005d60 + ldr r0, =sub_805745C + str r0, [r2] + ldr r1, =0x02024076 + movs r0, 0 + strb r0, [r1] + ldr r3, =sub_805F164 + str r3, [r2, 0x4] + strb r5, [r1, 0x1] + ldr r0, =sub_814AEB0 + b _08032E2E + .pool +_08032E1C: + ldr r2, =0x03005d60 + ldr r0, =sub_814AEB0 + str r0, [r2] + ldr r1, =0x02024076 + strb r3, [r1] + ldr r3, =sub_8064394 + str r3, [r2, 0x4] + strb r5, [r1, 0x1] + ldr r0, =sub_805745C +_08032E2E: + str r0, [r2, 0x8] + movs r0, 0x2 + strb r0, [r1, 0x2] + str r3, [r2, 0xC] + movs r0, 0x3 + strb r0, [r1, 0x3] + ldr r0, =0x0202406c + strb r4, [r0] + movs r0, 0 + movs r1, 0 + bl sub_81B8D64 + movs r0, 0x1 + movs r1, 0 + bl sub_81B8D64 + movs r0, 0x2 + movs r1, 0x1 + bl sub_81B8D64 + movs r0, 0x3 + movs r1, 0x1 + bl sub_81B8D64 + ldr r0, =0x0202406e + movs r1, 0 + strh r1, [r0] + strh r1, [r0, 0x2] + movs r1, 0x3 + strh r1, [r0, 0x4] + strh r1, [r0, 0x6] + b _0803303C + .pool +_08032E8C: + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [r4] + movs r1, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08032EA4 + ldr r1, =0x03005d04 + ldr r0, =sub_8039ECC + str r0, [r1] +_08032EA4: + movs r0, 0 + mov r10, r0 + ldr r1, =0x020229e8 + mov r12, r1 + ldr r7, =0x02024076 + mov r8, r0 + ldr r6, =0x0202406e + movs r4, 0 + movs r2, 0x3 + mov r9, r2 +_08032EB8: + mov r1, r12 + adds r0, r4, r1 + ldrh r0, [r0, 0x18] + cmp r0, 0x2 + bgt _08032EE0 + cmp r0, 0x1 + bge _08032EF8 + cmp r0, 0 + beq _08032EE4 + b _08032F02 + .pool +_08032EE0: + cmp r0, 0x3 + bne _08032F02 +_08032EE4: + ldr r0, =0x020229e8 + adds r0, r4, r0 + ldrb r0, [r0, 0x18] + movs r1, 0 + bl sub_81B8D64 + b _08032F02 + .pool +_08032EF8: + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_81B8D64 +_08032F02: + cmp r10, r5 + bne _08032F52 + ldr r0, =0x020229e8 + adds r3, r4, r0 + ldrh r1, [r3, 0x18] + lsls r1, 2 + ldr r2, =0x03005d60 + adds r1, r2 + ldr r2, =sub_805745C + str r2, [r1] + ldrh r1, [r3, 0x18] + mov r12, r0 + cmp r1, 0x2 + bgt _08032F34 + cmp r1, 0x1 + bge _08032F48 + cmp r1, 0 + beq _08032F38 + b _08033028 + .pool +_08032F34: + cmp r1, 0x3 + bne _08033028 +_08032F38: + mov r1, r12 + adds r0, r4, r1 + ldrh r1, [r0, 0x18] + adds r1, r7 + mov r2, r8 + strb r2, [r1] + ldrh r0, [r0, 0x18] + b _0803300E +_08032F48: + adds r1, r7 + movs r0, 0x2 + strb r0, [r1] + ldrh r0, [r3, 0x18] + b _08033020 +_08032F52: + ldr r2, =0x020229e8 + adds r0, r4, r2 + ldrh r1, [r0, 0x18] + movs r3, 0x1 + adds r0, r3, 0 + ands r0, r1 + mov r12, r2 + cmp r0, 0 + bne _08032F7C + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + add r0, r12 + ldrh r1, [r0, 0x18] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08032F8E + b _08032FD4 + .pool +_08032F7C: + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + add r0, r12 + ldrh r1, [r0, 0x18] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08032FD4 +_08032F8E: + mov r0, r12 + adds r2, r4, r0 + ldrh r0, [r2, 0x18] + lsls r0, 2 + ldr r1, =0x03005d60 + adds r0, r1 + ldr r1, =sub_814AEB0 + str r1, [r0] + ldrh r1, [r2, 0x18] + cmp r1, 0x2 + bgt _08032FB8 + cmp r1, 0x1 + bge _08032FCC + cmp r1, 0 + beq _08032FBC + b _08033028 + .pool +_08032FB8: + cmp r1, 0x3 + bne _08033028 +_08032FBC: + mov r2, r12 + adds r0, r4, r2 + ldrh r1, [r0, 0x18] + adds r1, r7 + mov r2, r8 + strb r2, [r1] + ldrh r0, [r0, 0x18] + b _0803300E +_08032FCC: + adds r1, r7 + movs r0, 0x2 + strb r0, [r1] + b _0803301E +_08032FD4: + mov r0, r12 + adds r2, r4, r0 + ldrh r0, [r2, 0x18] + lsls r0, 2 + ldr r1, =0x03005d60 + adds r0, r1 + ldr r1, =sub_8064394 + str r1, [r0] + ldrh r0, [r2, 0x18] + cmp r0, 0x2 + bgt _08032FFC + cmp r0, 0x1 + bge _08033018 + cmp r0, 0 + beq _08033000 + b _08033028 + .pool +_08032FFC: + cmp r0, 0x3 + bne _08033028 +_08033000: + mov r0, r12 + adds r2, r4, r0 + ldrh r0, [r2, 0x18] + adds r0, r7 + movs r1, 0x1 + strb r1, [r0] + ldrh r0, [r2, 0x18] +_0803300E: + lsls r0, 1 + adds r0, r6 + mov r1, r8 + strh r1, [r0] + b _08033028 +_08033018: + adds r0, r7 + mov r1, r9 + strb r1, [r0] +_0803301E: + ldrh r0, [r2, 0x18] +_08033020: + lsls r0, 1 + adds r0, r6 + mov r2, r9 + strh r2, [r0] +_08033028: + adds r4, 0x1C + movs r0, 0x1 + add r10, r0 + mov r1, r10 + cmp r1, 0x3 + bgt _08033036 + b _08032EB8 +_08033036: + ldr r1, =0x0202406c + movs r0, 0x4 +_0803303A: + strb r0, [r1] +_0803303C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end b_setup_bx_link + + thumb_func_start sub_8033050 +sub_8033050: @ 8033050 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08033068 + b _0803319C +_08033068: + movs r0, 0 + mov r8, r0 + b _0803317A + .pool +_08033074: + movs r5, 0 + movs r0, 0x1 + add r0, r8 + mov r10, r0 + ldr r0, =0x02024076 + add r0, r8 + mov r9, r0 + mov r0, r8 + lsls r6, r0, 1 + movs r7, 0 +_08033088: + mov r0, r8 + cmp r0, 0x1 + bgt _080330F0 + mov r0, r9 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080330A8 + ldr r0, =0x020244ec + b _080330AA + .pool +_080330A8: + ldr r0, =0x02024744 +_080330AA: + adds r4, r7, r0 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _08033170 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + beq _08033170 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _08033170 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _08033170 + ldr r0, =0x0202406e + adds r0, r6, r0 + strh r5, [r0] + b _08033178 + .pool +_080330F0: + mov r0, r9 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08033118 + ldr r0, =0x020244ec + adds r4, r7, r0 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _08033170 + adds r0, r4, 0 + movs r1, 0xB + b _0803312C + .pool +_08033118: + ldr r0, =0x02024744 + adds r4, r7, r0 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _08033170 + adds r0, r4, 0 + movs r1, 0x41 +_0803312C: + bl pokemon_getattr + cmp r0, 0 + beq _08033170 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _08033170 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _08033170 + ldr r1, =0x0202406e + mov r0, r8 + subs r0, 0x2 + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r5 + beq _08033170 + adds r0, r6, r1 + strh r5, [r0] + b _08033178 + .pool +_08033170: + adds r7, 0x64 + adds r5, 0x1 + cmp r5, 0x5 + ble _08033088 +_08033178: + mov r8, r10 +_0803317A: + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r8, r0 + bge _08033184 + b _08033074 +_08033184: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0803319C + ldr r0, =0x0202406e + movs r1, 0 + strh r1, [r0, 0x2] + movs r1, 0x3 + strh r1, [r0, 0x6] +_0803319C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8033050 + + thumb_func_start dp01_prepare_buffer +dp01_prepare_buffer: @ 80331B8 + push {r4-r6,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r3, r0, 24 + adds r5, r3, 0 + lsls r2, 16 + lsrs r2, 16 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080331E4 + adds r0, r3, 0 + adds r1, r2, 0 + adds r2, r4, 0 + bl dp01_prepare_buffer_wireless_probably + b _08033236 + .pool +_080331E4: + cmp r5, 0 + beq _080331EE + cmp r5, 0x1 + beq _08033218 + b _08033236 +_080331EE: + movs r3, 0 + cmp r3, r2 + bge _08033236 + ldr r6, =0x02023064 + ldr r5, =0x02024064 +_080331F8: + ldrb r0, [r5] + lsls r0, 9 + adds r0, r3, r0 + adds r0, r6 + ldrb r1, [r4] + strb r1, [r0] + adds r4, 0x1 + adds r3, 0x1 + cmp r3, r2 + blt _080331F8 + b _08033236 + .pool +_08033218: + movs r3, 0 + cmp r3, r2 + bge _08033236 + ldr r6, =0x02023864 + ldr r5, =0x02024064 +_08033222: + ldrb r0, [r5] + lsls r0, 9 + adds r0, r3, r0 + adds r0, r6 + ldrb r1, [r4] + strb r1, [r0] + adds r4, 0x1 + adds r3, 0x1 + cmp r3, r2 + blt _08033222 +_08033236: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_prepare_buffer + + thumb_func_start sub_8033244 +sub_8033244: @ 8033244 + push {r4-r6,lr} + ldr r0, =task00_wireless_something + movs r1, 0 + bl AddTask + ldr r2, =0x02022d08 + strb r0, [r2] + ldr r5, =0x03005e00 + ldrb r1, [r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + movs r6, 0 + movs r4, 0 + strh r4, [r0, 0x1E] + ldrb r1, [r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + strh r4, [r0, 0x20] + ldrb r1, [r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + strh r4, [r0, 0x22] + ldrb r1, [r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + strh r4, [r0, 0x24] + ldrb r1, [r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + strh r4, [r0, 0x26] + ldr r0, =sub_803375C + movs r1, 0 + bl AddTask + ldr r2, =0x02022d09 + strb r0, [r2] + ldrb r1, [r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + strh r4, [r0, 0x20] + ldrb r1, [r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + strh r4, [r0, 0x22] + ldrb r1, [r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + strh r4, [r0, 0x24] + ldrb r1, [r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + strh r4, [r0, 0x26] + ldr r0, =0x02022d0a + strb r6, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8033244 + + thumb_func_start dp01_prepare_buffer_wireless_probably +dp01_prepare_buffer_wireless_probably: @ 80332F4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r9, r2 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 16 + lsrs r1, 16 + mov r12, r1 + movs r1, 0x3 + mov r0, r12 + bics r0, r1 + adds r0, 0x4 + mov r8, r0 + ldr r2, =0x03005e00 + ldr r3, =0x02022d08 + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r4, r0, r2 + movs r1, 0x24 + ldrsh r0, [r4, r1] + add r0, r8 + adds r0, 0x9 + movs r1, 0x80 + lsls r1, 5 + adds r5, r2, 0 + cmp r0, r1 + ble _08033346 + ldrh r0, [r4, 0x24] + movs r2, 0 + strh r0, [r4, 0x20] + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + strh r2, [r0, 0x24] +_08033346: + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + movs r2, 0x24 + ldrsh r1, [r0, r2] + ldr r4, =0x020244a0 + ldr r0, [r4] + adds r0, r1 + strb r6, [r0] + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + movs r7, 0x24 + ldrsh r1, [r0, r7] + ldr r0, [r4] + adds r1, r0 + ldr r0, =0x02024064 + ldrb r0, [r0] + strb r0, [r1, 0x1] + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + movs r2, 0x24 + ldrsh r1, [r0, r2] + ldr r0, [r4] + adds r1, r0 + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r1, 0x2] + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + movs r7, 0x24 + ldrsh r1, [r0, r7] + ldr r0, [r4] + adds r1, r0 + ldr r0, =0x0202420c + ldrb r0, [r0] + strb r0, [r1, 0x3] + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + movs r1, 0x24 + ldrsh r0, [r0, r1] + ldr r1, [r4] + adds r0, r1 + mov r2, r8 + strb r2, [r0, 0x4] + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + movs r7, 0x24 + ldrsh r1, [r0, r7] + ldr r0, [r4] + adds r1, r0 + movs r0, 0xFF + lsls r0, 8 + mov r2, r8 + ands r0, r2 + asrs r0, 8 + strb r0, [r1, 0x5] + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + movs r7, 0x24 + ldrsh r1, [r0, r7] + ldr r0, [r4] + adds r1, r0 + ldr r0, =0x02024210 + ldrb r0, [r0] + strb r0, [r1, 0x6] + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + movs r2, 0x24 + ldrsh r1, [r0, r2] + ldr r0, [r4] + adds r1, r0 + ldr r0, =0x0202420e + ldrb r0, [r0] + strb r0, [r1, 0x7] + movs r2, 0 + cmp r2, r12 + bge _08033434 + mov r10, r5 + adds r6, r3, 0 +_08033412: + ldrb r1, [r6] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + add r0, r10 + movs r7, 0x24 + ldrsh r1, [r0, r7] + ldr r0, [r4] + adds r1, r2, r1 + adds r1, r0 + mov r7, r9 + adds r0, r7, r2 + ldrb r0, [r0] + strb r0, [r1, 0x8] + adds r2, 0x1 + cmp r2, r12 + blt _08033412 +_08033434: + ldrb r0, [r3] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r5 + ldrh r0, [r1, 0x24] + add r0, r8 + adds r0, 0x8 + strh r0, [r1, 0x24] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_prepare_buffer_wireless_probably + + thumb_func_start task00_wireless_something +task00_wireless_something: @ 8033474 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0x1E + ldrsh r0, [r0, r2] + adds r7, r1, 0 + cmp r0, 0x5 + bls _08033490 + b _08033640 +_08033490: + lsls r0, 2 + ldr r1, =_080334A4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080334A4: + .4byte _080334BC + .4byte _080334CA + .4byte _080334E6 + .4byte _08033570 + .4byte _080335E6 + .4byte _08033624 +_080334BC: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r7 + movs r1, 0x64 + strh r1, [r0, 0x1C] + b _080334F6 +_080334CA: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r7 + ldrh r0, [r1, 0x1C] + subs r0, 0x1 + strh r0, [r1, 0x1C] + lsls r0, 16 + cmp r0, 0 + beq _080334E0 + b _08033640 +_080334E0: + ldrh r0, [r1, 0x1E] + adds r0, 0x1 + b _0803363E +_080334E6: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08033504 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r7 +_080334F6: + ldrh r1, [r0, 0x1E] + adds r1, 0x1 + strh r1, [r0, 0x1E] + b _08033640 + .pool +_08033504: + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _0803351C + movs r5, 0x2 + b _0803352A + .pool +_0803351C: + movs r0, 0x40 + ands r1, r0 + movs r0, 0x2 + cmp r1, 0 + beq _08033528 + movs r0, 0x4 +_08033528: + adds r5, r0, 0 +_0803352A: + bl sub_800ABAC + lsls r0, 24 + lsrs r0, 24 + cmp r0, r5 + bcs _08033538 + b _08033640 +_08033538: + bl sub_800ABBC + lsls r0, 24 + cmp r0, 0 + beq _0803355C + bl sub_800A620 + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x1E] + adds r0, 0x1 + b _0803363E + .pool +_0803355C: + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x1E] + adds r0, 0x1 + b _0803363E + .pool +_08033570: + lsls r1, r4, 2 + adds r0, r1, r4 + lsls r0, 3 + adds r2, r0, r7 + movs r3, 0x26 + ldrsh r5, [r2, r3] + movs r0, 0x24 + ldrsh r6, [r2, r0] + mov r12, r6 + cmp r5, r12 + beq _08033640 + ldrh r0, [r2, 0x22] + movs r6, 0x22 + ldrsh r3, [r2, r6] + cmp r3, 0 + bne _080335E0 + cmp r5, r12 + ble _080335A0 + movs r6, 0x20 + ldrsh r0, [r2, r6] + cmp r5, r0 + bne _080335A0 + strh r3, [r2, 0x20] + strh r3, [r2, 0x26] +_080335A0: + adds r4, r1, r4 + lsls r4, 3 + adds r4, r7 + movs r0, 0x26 + ldrsh r1, [r4, r0] + ldr r5, =0x020244a0 + ldr r0, [r5] + adds r1, r0 + ldrb r0, [r1, 0x4] + ldrb r1, [r1, 0x5] + lsls r1, 8 + orrs r0, r1 + adds r0, 0x8 + lsls r0, 16 + lsrs r6, r0, 16 + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x26 + ldrsh r2, [r4, r1] + ldr r1, [r5] + adds r1, r2 + adds r2, r6, 0 + bl link_0800A448 + ldrh r0, [r4, 0x1E] + adds r0, 0x1 + strh r0, [r4, 0x1E] + b _08033640 + .pool +_080335E0: + subs r0, 0x1 + strh r0, [r2, 0x22] + b _08033640 +_080335E6: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08033640 + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r3, 0x26 + ldrsh r2, [r1, r3] + ldr r0, =0x020244a0 + ldr r0, [r0] + adds r2, r0 + ldrb r0, [r2, 0x4] + ldrb r2, [r2, 0x5] + lsls r2, 8 + movs r3, 0x1 + strh r3, [r1, 0x22] + orrs r0, r2 + ldrh r6, [r1, 0x26] + adds r0, r6 + adds r0, 0x8 + strh r0, [r1, 0x26] + b _0803363C + .pool +_08033624: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r7 + ldrh r0, [r1, 0x22] + subs r0, 0x1 + strh r0, [r1, 0x22] + lsls r0, 16 + cmp r0, 0 + bne _08033640 + movs r0, 0x1 + strh r0, [r1, 0x22] +_0803363C: + movs r0, 0x3 +_0803363E: + strh r0, [r1, 0x1E] +_08033640: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end task00_wireless_something + + thumb_func_start sub_8033648 +sub_8033648: @ 8033648 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _08033738 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08033738 + bl sub_8011BD0 + movs r4, 0 + ldr r0, =0x020223c4 + mov r10, r0 + b _0803372C + .pool +_08033680: + bl sub_800A550 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gUnknown_0832A328 + lsls r1, r4, 2 + adds r1, r2 + ldr r1, [r1] + ands r0, r1 + adds r1, r4, 0x1 + mov r9, r1 + cmp r0, 0 + beq _08033726 + adds r0, r4, 0 + bl sub_800A5EC + lsls r0, r4, 8 + mov r4, r10 + adds r3, r0, r4 + ldr r1, =0x020223c8 + adds r0, r1 + ldrh r6, [r0] + ldr r7, =0x03005e00 + ldr r4, =0x02022d09 + mov r12, r4 + ldrb r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r2, r0, r7 + movs r0, 0x24 + ldrsh r1, [r2, r0] + adds r0, r6, 0 + adds r0, 0x9 + adds r1, r0 + movs r0, 0x80 + lsls r0, 5 + cmp r1, r0 + ble _080336E0 + ldrh r0, [r2, 0x24] + strh r0, [r2, 0x20] + ldrb r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0 + strh r1, [r0, 0x24] +_080336E0: + ldr r2, =0x020244a4 + mov r4, r12 + ldrb r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r4, 0x24 + ldrsh r1, [r0, r4] + ldr r0, [r2] + adds r5, r0, r1 + adds r4, r3, 0 + movs r2, 0 + adds r3, r6, 0 + adds r3, 0x8 + mov r8, r7 + mov r7, r12 + cmp r2, r3 + bge _08033714 +_08033706: + adds r0, r5, r2 + adds r1, r4, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, r3 + blt _08033706 +_08033714: + ldrb r0, [r7] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + add r1, r8 + ldrh r0, [r1, 0x24] + adds r0, r6, r0 + adds r0, 0x8 + strh r0, [r1, 0x24] +_08033726: + mov r1, r9 + lsls r0, r1, 24 + lsrs r4, r0, 24 +_0803372C: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bcc _08033680 +_08033738: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8033648 + + thumb_func_start sub_803375C +sub_803375C: @ 803375C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r3, r0, r1 + movs r0, 0x26 + ldrsh r2, [r3, r0] + movs r4, 0x24 + ldrsh r0, [r3, r4] + cmp r2, r0 + bne _08033780 + b _0803389C +_08033780: + cmp r2, r0 + ble _08033792 + movs r4, 0x20 + ldrsh r0, [r3, r4] + cmp r2, r0 + bne _08033792 + movs r0, 0 + strh r0, [r3, 0x20] + strh r0, [r3, 0x26] +_08033792: + lsls r2, r7, 2 + adds r0, r2, r7 + lsls r0, 3 + adds r5, r0, r1 + movs r0, 0x26 + ldrsh r1, [r5, r0] + ldr r3, =0x020244a4 + mov r8, r3 + ldr r0, [r3] + adds r3, r1, r0 + ldrb r4, [r3, 0x1] + ldrb r6, [r3, 0x4] + ldrb r0, [r3, 0x5] + lsls r0, 8 + orrs r6, r0 + ldrb r0, [r3] + mov r9, r2 + cmp r0, 0x1 + beq _0803385C + cmp r0, 0x1 + bgt _080337CC + cmp r0, 0 + beq _080337D2 + b _0803388A + .pool +_080337CC: + cmp r0, 0x2 + beq _08033874 + b _0803388A +_080337D2: + ldr r2, =0x02024068 + ldr r1, =gUnknown_0832A328 + lsls r0, r4, 2 + adds r0, r1 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0803389C + lsls r0, r4, 9 + ldr r1, =0x02023064 + adds r0, r1 + adds r1, r3, 0 + adds r1, 0x8 + adds r2, r6, 0 + bl memcpy + adds r0, r4, 0 + bl sub_803F850 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x4 + ands r0, r1 + cmp r0, 0 + bne _0803388A + ldr r2, =0x0202420b + movs r4, 0x26 + ldrsh r0, [r5, r4] + mov r3, r8 + ldr r1, [r3] + adds r0, r1 + ldrb r0, [r0, 0x2] + strb r0, [r2] + ldr r2, =0x0202420c + movs r4, 0x26 + ldrsh r0, [r5, r4] + adds r0, r1 + ldrb r0, [r0, 0x3] + strb r0, [r2] + ldr r2, =0x02024210 + movs r3, 0x26 + ldrsh r0, [r5, r3] + adds r0, r1 + ldrb r0, [r0, 0x6] + strb r0, [r2] + ldr r2, =0x0202420e + movs r4, 0x26 + ldrsh r0, [r5, r4] + adds r0, r1 + ldrb r0, [r0, 0x7] + strb r0, [r2] + b _0803388A + .pool +_0803385C: + lsls r0, r4, 9 + ldr r1, =0x02023864 + adds r0, r1 + adds r1, r3, 0 + adds r1, 0x8 + adds r2, r6, 0 + bl memcpy + b _0803388A + .pool +_08033874: + ldrb r2, [r3, 0x8] + ldr r3, =0x02024068 + ldr r1, =gUnknown_0832A328 + lsls r0, r4, 2 + adds r0, r1 + lsls r2, 2 + ldr r1, [r0] + lsls r1, r2 + ldr r0, [r3] + bics r0, r1 + str r0, [r3] +_0803388A: + ldr r0, =0x03005e00 + mov r2, r9 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x26] + adds r0, r6, r0 + adds r0, 0x8 + strh r0, [r1, 0x26] +_0803389C: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803375C + + thumb_func_start dp01_build_cmdbuf_x00_a_b_0 +dp01_build_cmdbuf_x00_a_b_0: @ 80338B4 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r3, 0 + strb r3, [r1] + strb r4, [r1, 0x1] + strb r2, [r1, 0x2] + strb r3, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x00_a_b_0 + + thumb_func_start dp01_build_cmdbuf_x01_a_b_0 +dp01_build_cmdbuf_x01_a_b_0: @ 80338D8 + push {r4,r5,lr} + adds r5, r1, 0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r4, 0 + movs r3, 0x1 + strb r3, [r1] + strb r5, [r1, 0x1] + strb r2, [r1, 0x2] + strb r4, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x01_a_b_0 + + thumb_func_start dp01_build_cmdbuf_x02_a_b_varargs +dp01_build_cmdbuf_x02_a_b_varargs: @ 8033900 + push {r4-r6,lr} + ldr r4, [sp, 0x10] + lsls r0, 24 + lsrs r6, r0, 24 + lsls r3, 24 + lsrs r5, r3, 24 + ldr r0, =0x02022d10 + movs r3, 0x2 + strb r3, [r0] + strb r1, [r0, 0x1] + strb r2, [r0, 0x2] + adds r1, r0, 0 + cmp r5, 0 + beq _0803392E + adds r3, r1, 0x3 + adds r2, r5, 0 +_08033920: + ldrb r0, [r4] + strb r0, [r3] + adds r4, 0x1 + adds r3, 0x1 + subs r2, 0x1 + cmp r2, 0 + bne _08033920 +_0803392E: + adds r2, r5, 0x3 + adds r0, r6, 0 + bl dp01_prepare_buffer + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x02_a_b_varargs + + thumb_func_start sub_8033940 +sub_8033940: @ 8033940 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r2, 24 + lsrs r4, r2, 24 + ldr r0, =0x02022d10 + movs r2, 0x3 + strb r2, [r0] + strb r1, [r0, 0x1] + strb r4, [r0, 0x2] + adds r5, r0, 0 + cmp r4, 0 + beq _0803396C + adds r1, r5, 0x3 + adds r2, r4, 0 +_0803395E: + ldrb r0, [r3] + strb r0, [r1] + adds r3, 0x1 + adds r1, 0x1 + subs r2, 0x1 + cmp r2, 0 + bne _0803395E +_0803396C: + adds r2, r4, 0x3 + adds r0, r6, 0 + adds r1, r5, 0 + bl dp01_prepare_buffer + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8033940 + + thumb_func_start dp01_build_cmdbuf_x04_4_4_4 +dp01_build_cmdbuf_x04_4_4_4: @ 8033980 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x4 + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x04_4_4_4 + + thumb_func_start dp01_build_cmdbuf_x05_a_b_c +dp01_build_cmdbuf_x05_a_b_c: @ 80339A0 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r3, 0x5 + strb r3, [r1] + strb r4, [r1, 0x1] + strb r2, [r1, 0x2] + strb r3, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x05_a_b_c + + thumb_func_start dp01_build_cmdbuf_x06_a +dp01_build_cmdbuf_x06_a: @ 80339C4 + push {lr} + adds r3, r1, 0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x6 + strb r2, [r1] + strb r3, [r1, 0x1] + movs r2, 0x2 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x06_a + + thumb_func_start dp01_build_cmdbuf_x07_7_7_7 +dp01_build_cmdbuf_x07_7_7_7: @ 80339E4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x7 + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x07_7_7_7 + + thumb_func_start dp01_build_cmdbuf_x08_8_8_8 +dp01_build_cmdbuf_x08_8_8_8: @ 8033A04 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x8 + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x08_8_8_8 + + thumb_func_start dp01_build_cmdbuf_x09_9_9_9 +dp01_build_cmdbuf_x09_9_9_9: @ 8033A24 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x9 + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x09_9_9_9 + + thumb_func_start dp01_build_cmdbuf_x0A_A_A_A +dp01_build_cmdbuf_x0A_A_A_A: @ 8033A44 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0xA + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x0A_A_A_A + + thumb_func_start dp01_build_cmdbuf_x0B_B_B_B +dp01_build_cmdbuf_x0B_B_B_B: @ 8033A64 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0xB + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x0B_B_B_B + + thumb_func_start dp01_build_cmdbuf_x0C_C_C_C +dp01_build_cmdbuf_x0C_C_C_C: @ 8033A84 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0xC + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x0C_C_C_C + + thumb_func_start dp01_build_cmdbuf_x0D_a +dp01_build_cmdbuf_x0D_a: @ 8033AA4 + push {lr} + adds r3, r1, 0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0xD + strb r2, [r1] + strb r3, [r1, 0x1] + movs r2, 0x2 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x0D_a + + thumb_func_start sub_8033AC4 +sub_8033AC4: @ 8033AC4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + ldr r1, =0x02022d10 + movs r0, 0xE + strb r0, [r1] + strb r4, [r1, 0x1] + lsls r0, r4, 1 + adds r0, r4 + adds r5, r1, 0 + cmp r0, 0 + beq _08033AF2 + adds r1, r5, 0x2 + adds r3, r0, 0 +_08033AE4: + ldrb r0, [r2] + strb r0, [r1] + adds r2, 0x1 + adds r1, 0x1 + subs r3, 0x1 + cmp r3, 0 + bne _08033AE4 +_08033AF2: + lsls r2, r4, 1 + adds r2, r4 + adds r2, 0x2 + adds r0, r6, 0 + adds r1, r5, 0 + bl dp01_prepare_buffer + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8033AC4 + + thumb_func_start dp01_build_cmdbuf_x0F_aa_b_cc_dddd_e_mlc_weather_00_x1Cbytes +dp01_build_cmdbuf_x0F_aa_b_cc_dddd_e_mlc_weather_00_x1Cbytes: @ 8033B0C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + ldr r4, [sp, 0x20] + ldr r5, [sp, 0x24] + ldr r6, [sp, 0x2C] + mov r8, r6 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r1, 16 + lsrs r1, 16 + lsls r3, 16 + lsrs r3, 16 + ldr r7, =0x02022d10 + movs r0, 0 + mov r12, r0 + movs r0, 0xF + strb r0, [r7] + strb r1, [r7, 0x1] + lsrs r1, 8 + strb r1, [r7, 0x2] + strb r2, [r7, 0x3] + strb r3, [r7, 0x4] + movs r6, 0xFF + lsls r6, 8 + lsrs r3, 8 + strb r3, [r7, 0x5] + strb r4, [r7, 0x6] + adds r0, r4, 0 + ands r0, r6 + asrs r0, 8 + strb r0, [r7, 0x7] + movs r0, 0xFF + lsls r0, 16 + ands r0, r4 + asrs r0, 16 + strb r0, [r7, 0x8] + lsrs r4, 24 + strb r4, [r7, 0x9] + strb r5, [r7, 0xA] + mov r0, r8 + strb r0, [r7, 0xB] + mov r0, r12 + str r0, [sp] + movs r0, 0xE + movs r1, 0 + movs r2, 0xD + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08033BAC + str r0, [sp] + movs r0, 0xE + movs r1, 0 + movs r2, 0x4D + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + bne _08033BAC + ldr r0, =0x020243cc + ldrh r0, [r0] + strb r0, [r7, 0xC] + ands r6, r0 + lsrs r0, r6, 8 + strb r0, [r7, 0xD] + adds r4, r7, 0 + b _08033BB6 + .pool +_08033BAC: + ldr r0, =0x02022d10 + movs r1, 0 + strb r1, [r0, 0xC] + strb r1, [r0, 0xD] + adds r4, r0, 0 +_08033BB6: + movs r0, 0 + strb r0, [r4, 0xE] + strb r0, [r4, 0xF] + adds r0, r4, 0 + adds r0, 0x10 + ldr r1, [sp, 0x28] + movs r2, 0x1C + bl memcpy + mov r0, r9 + adds r1, r4, 0 + movs r2, 0x2C + bl dp01_prepare_buffer + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x0F_aa_b_cc_dddd_e_mlc_weather_00_x1Cbytes + + thumb_func_start dp01_build_cmdbuf_x10_TODO +dp01_build_cmdbuf_x10_TODO: @ 8033BE4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r1, 16 + lsrs r1, 16 + ldr r2, =0x02022d10 + movs r0, 0x10 + strb r0, [r2] + ldr r0, =0x0202433a + ldrb r0, [r0] + strb r0, [r2, 0x1] + strb r1, [r2, 0x2] + lsrs r1, 8 + strb r1, [r2, 0x3] + adds r0, r2, 0x4 + mov r12, r0 + ldr r4, =0x020241ea + ldrh r0, [r4] + strh r0, [r2, 0x4] + ldr r0, =0x020241ec + ldrh r0, [r0] + mov r1, r12 + strh r0, [r1, 0x2] + ldr r0, =0x02024208 + ldrh r0, [r0] + strh r0, [r1, 0x4] + ldr r0, =0x0202420a + ldrb r0, [r0] + strb r0, [r1, 0x6] + ldr r0, =0x02024474 + ldrb r0, [r0, 0x17] + strb r0, [r1, 0x7] + ldr r0, =0x0202449c + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0x52 + ldrb r1, [r1] + mov r3, r12 + strb r1, [r3, 0x8] + adds r0, 0xB1 + ldrb r0, [r0] + strb r0, [r3, 0x9] + ldr r0, =0x0202420f + ldrb r0, [r0] + strb r0, [r3, 0xA] + ldr r3, =gBattleMoves + ldrh r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x2] + mov r7, r12 + strb r0, [r7, 0xB] + movs r3, 0 + mov r9, r2 + ldr r0, =0x02022f78 + mov r8, r0 + adds r2, 0x10 + ldr r0, =0x02024084 + adds r4, r0, 0 + adds r4, 0x20 +_08033C6A: + adds r1, r2, r3 + ldrb r0, [r4] + strb r0, [r1] + adds r4, 0x58 + adds r3, 0x1 + cmp r3, 0x3 + ble _08033C6A + movs r3, 0 + mov r5, r12 + adds r5, 0x10 + mov r4, r12 + adds r4, 0x20 + ldr r6, =0x02022f68 + mov r2, r12 + adds r2, 0x30 +_08033C88: + adds r1, r5, r3 + ldr r7, =0x02022f58 + adds r0, r3, r7 + ldrb r0, [r0] + strb r0, [r1] + adds r1, r4, r3 + adds r0, r3, r6 + ldrb r0, [r0] + strb r0, [r1] + adds r1, r2, r3 + mov r7, r8 + adds r0, r3, r7 + ldrb r0, [r0] + strb r0, [r1] + adds r3, 0x1 + cmp r3, 0xF + ble _08033C88 + mov r0, r10 + mov r1, r9 + movs r2, 0x44 + bl dp01_prepare_buffer + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x10_TODO + + thumb_func_start dp01_build_cmdbuf_x11_TODO +dp01_build_cmdbuf_x11_TODO: @ 8033CFC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r1, 16 + lsrs r1, 16 + ldr r2, =0x02022d10 + movs r0, 0x11 + strb r0, [r2] + strb r0, [r2, 0x1] + strb r1, [r2, 0x2] + lsrs r1, 8 + strb r1, [r2, 0x3] + adds r0, r2, 0x4 + mov r12, r0 + ldr r0, =0x020241ea + ldrh r0, [r0] + strh r0, [r2, 0x4] + ldr r0, =0x020241ec + ldrh r0, [r0] + mov r1, r12 + strh r0, [r1, 0x2] + ldr r0, =0x02024208 + ldrh r0, [r0] + strh r0, [r1, 0x4] + ldr r0, =0x0202420a + ldrb r0, [r0] + strb r0, [r1, 0x6] + ldr r0, =0x02024474 + ldrb r0, [r0, 0x17] + strb r0, [r1, 0x7] + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x52 + ldrb r0, [r0] + strb r0, [r1, 0x8] + movs r3, 0 + mov r9, r2 + ldr r7, =0x02022f78 + mov r8, r7 + mov r4, r9 + adds r4, 0x10 + ldr r0, =0x02024084 + adds r2, r0, 0 + adds r2, 0x20 +_08033D5E: + adds r1, r4, r3 + ldrb r0, [r2] + strb r0, [r1] + adds r2, 0x58 + adds r3, 0x1 + cmp r3, 0x3 + ble _08033D5E + movs r3, 0 + mov r5, r12 + adds r5, 0x10 + mov r4, r12 + adds r4, 0x20 + ldr r6, =0x02022f68 + mov r2, r12 + adds r2, 0x30 +_08033D7C: + adds r1, r5, r3 + ldr r7, =0x02022f58 + adds r0, r3, r7 + ldrb r0, [r0] + strb r0, [r1] + adds r1, r4, r3 + adds r0, r3, r6 + ldrb r0, [r0] + strb r0, [r1] + adds r1, r2, r3 + mov r7, r8 + adds r0, r3, r7 + ldrb r0, [r0] + strb r0, [r1] + adds r3, 0x1 + cmp r3, 0xF + ble _08033D7C + mov r0, r10 + mov r1, r9 + movs r2, 0x44 + bl dp01_prepare_buffer + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x11_TODO + + thumb_func_start dp01_build_cmdbuf_x12_a_bb +dp01_build_cmdbuf_x12_a_bb: @ 8033DE4 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r2, 16 + lsrs r2, 16 + ldr r1, =0x02022d10 + movs r3, 0x12 + strb r3, [r1] + strb r4, [r1, 0x1] + strb r2, [r1, 0x2] + lsrs r2, 8 + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x12_a_bb + + thumb_func_start sub_8033E10 +sub_8033E10: @ 8033E10 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x13 + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end sub_8033E10 + + thumb_func_start sub_8033E30 +sub_8033E30: @ 8033E30 + push {r4-r6,lr} + adds r5, r3, 0 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r3, =0x02022d10 + movs r4, 0 + movs r0, 0x14 + strb r0, [r3] + strb r1, [r3, 0x1] + strb r2, [r3, 0x2] + strb r4, [r3, 0x3] + movs r2, 0 + adds r1, r3, 0 + adds r4, r1, 0x4 +_08033E4C: + adds r0, r5, r2 + ldrb r0, [r0] + strb r0, [r4] + adds r4, 0x1 + adds r2, 0x1 + cmp r2, 0x13 + bls _08033E4C + adds r0, r6, 0 + movs r2, 0x18 + bl dp01_prepare_buffer + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8033E30 + + thumb_func_start sub_8033E6C +sub_8033E6C: @ 8033E6C + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x02022d10 + movs r0, 0x15 + strb r0, [r1] + movs r2, 0 + adds r3, r1, 0x1 +_08033E7E: + adds r0, r4, r2 + ldrb r0, [r0] + strb r0, [r3] + adds r3, 0x1 + adds r2, 0x1 + cmp r2, 0x2 + ble _08033E7E + adds r0, r5, 0 + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8033E6C + + thumb_func_start dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f +dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f: @ 8033EA0 + push {r4-r6,lr} + ldr r6, [sp, 0x10] + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =0x02022d10 + movs r0, 0x16 + strb r0, [r4] + strb r1, [r4, 0x1] + strb r2, [r4, 0x2] + strb r3, [r4, 0x3] + movs r2, 0 + adds r1, r4, 0 + adds r3, r1, 0x4 +_08033EBA: + adds r0, r6, r2 + ldrb r0, [r0] + strb r0, [r3] + adds r3, 0x1 + adds r2, 0x1 + cmp r2, 0x2 + ble _08033EBA + adds r0, r5, 0 + movs r2, 0x8 + bl dp01_prepare_buffer + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f + + thumb_func_start dp01_build_cmdbuf_x17_17_17_17 +dp01_build_cmdbuf_x17_17_17_17: @ 8033EDC + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x17 + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x17_17_17_17 + + thumb_func_start dp01_build_cmdbuf_x18_0_aa_health_bar_update +dp01_build_cmdbuf_x18_0_aa_health_bar_update: @ 8033EFC + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + ldr r3, =0x02022d10 + movs r4, 0 + movs r2, 0x18 + strb r2, [r3] + strb r4, [r3, 0x1] + strb r1, [r3, 0x2] + lsls r1, 16 + asrs r1, 16 + movs r2, 0xFF + lsls r2, 8 + ands r1, r2 + asrs r1, 8 + strb r1, [r3, 0x3] + adds r1, r3, 0 + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x18_0_aa_health_bar_update + + thumb_func_start dp01_build_cmdbuf_x19_a_bb +dp01_build_cmdbuf_x19_a_bb: @ 8033F34 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r2, 16 + lsrs r2, 16 + ldr r1, =0x02022d10 + movs r3, 0x19 + strb r3, [r1] + strb r4, [r1, 0x1] + strb r2, [r1, 0x2] + lsls r2, 16 + asrs r2, 16 + movs r3, 0xFF + lsls r3, 8 + ands r2, r3 + asrs r2, 8 + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x19_a_bb + + thumb_func_start dp01_build_cmdbuf_x1A_aaaa_bbbb +dp01_build_cmdbuf_x1A_aaaa_bbbb: @ 8033F68 + push {r4-r6,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r3, 0x1A + strb r3, [r1] + strb r4, [r1, 0x1] + movs r6, 0xFF + lsls r6, 8 + adds r3, r4, 0 + ands r3, r6 + lsrs r3, 8 + strb r3, [r1, 0x2] + movs r5, 0xFF + lsls r5, 16 + adds r3, r4, 0 + ands r3, r5 + lsrs r3, 16 + strb r3, [r1, 0x3] + lsrs r4, 24 + strb r4, [r1, 0x4] + strb r2, [r1, 0x5] + adds r3, r2, 0 + ands r3, r6 + lsrs r3, 8 + strb r3, [r1, 0x6] + adds r3, r2, 0 + ands r3, r5 + lsrs r3, 16 + strb r3, [r1, 0x7] + lsrs r2, 24 + strb r2, [r1, 0x8] + movs r2, 0x9 + bl dp01_prepare_buffer + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x1A_aaaa_bbbb + + thumb_func_start dp01_build_cmdbuf_x1B_aaaa_b +dp01_build_cmdbuf_x1B_aaaa_b: @ 8033FBC + push {r4,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r3, 0x1B + strb r3, [r1] + strb r4, [r1, 0x1] + strb r2, [r1, 0x2] + movs r3, 0xFF + lsls r3, 8 + ands r3, r2 + lsrs r3, 8 + strb r3, [r1, 0x3] + movs r3, 0xFF + lsls r3, 16 + ands r3, r2 + lsrs r3, 16 + strb r3, [r1, 0x4] + lsrs r2, 24 + strb r2, [r1, 0x5] + movs r2, 0x6 + bl dp01_prepare_buffer + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x1B_aaaa_b + + thumb_func_start dp01_build_cmdbuf_x1C_a +dp01_build_cmdbuf_x1C_a: @ 8033FF8 + push {lr} + adds r3, r1, 0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x1C + strb r2, [r1] + strb r3, [r1, 0x1] + movs r2, 0x2 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x1C_a + + thumb_func_start dp01_build_cmdbuf_x1D_1D_numargs_varargs +dp01_build_cmdbuf_x1D_1D_numargs_varargs: @ 8034018 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 16 + lsrs r4, r1, 16 + ldr r1, =0x02022d10 + movs r0, 0x1D + strb r0, [r1] + strb r0, [r1, 0x1] + strb r4, [r1, 0x2] + lsrs r0, r4, 8 + strb r0, [r1, 0x3] + adds r5, r1, 0 + cmp r4, 0 + beq _08034048 + adds r1, r5, 0x4 + adds r3, r4, 0 +_0803403A: + ldrb r0, [r2] + strb r0, [r1] + adds r2, 0x1 + adds r1, 0x1 + subs r3, 0x1 + cmp r3, 0 + bne _0803403A +_08034048: + adds r2, r4, 0x4 + lsls r2, 16 + lsrs r2, 16 + adds r0, r6, 0 + adds r1, r5, 0 + bl dp01_prepare_buffer + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x1D_1D_numargs_varargs + + thumb_func_start sub_8034060 +sub_8034060: @ 8034060 + push {r4-r6,lr} + adds r4, r3, 0 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r2, 16 + lsrs r5, r2, 16 + ldr r2, =0x02022d10 + movs r0, 0x1E + strb r0, [r2] + strb r1, [r2, 0x1] + movs r3, 0xFF + lsls r3, 8 + adds r0, r1, 0 + ands r0, r3 + lsrs r0, 8 + strb r0, [r2, 0x2] + movs r0, 0xFF + lsls r0, 16 + ands r0, r1 + lsrs r0, 16 + strb r0, [r2, 0x3] + lsrs r1, 24 + strb r1, [r2, 0x4] + strb r5, [r2, 0x5] + adds r0, r5, 0 + ands r0, r3 + lsrs r0, 8 + strb r0, [r2, 0x6] + adds r1, r2, 0 + cmp r5, 0 + beq _080340B0 + adds r3, r1, 0x7 + adds r2, r5, 0 +_080340A2: + ldrb r0, [r4] + strb r0, [r3] + adds r4, 0x1 + adds r3, 0x1 + subs r2, 0x1 + cmp r2, 0 + bne _080340A2 +_080340B0: + adds r2, r5, 0x7 + lsls r2, 16 + lsrs r2, 16 + adds r0, r6, 0 + bl dp01_prepare_buffer + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8034060 + + thumb_func_start sub_80340C8 +sub_80340C8: @ 80340C8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 16 + lsrs r4, r1, 16 + ldr r1, =0x02022d10 + movs r0, 0x1F + strb r0, [r1] + strb r4, [r1, 0x1] + lsrs r0, r4, 8 + strb r0, [r1, 0x2] + adds r5, r1, 0 + cmp r4, 0 + beq _080340F6 + adds r1, r5, 0x3 + adds r3, r4, 0 +_080340E8: + ldrb r0, [r2] + strb r0, [r1] + adds r2, 0x1 + adds r1, 0x1 + subs r3, 0x1 + cmp r3, 0 + bne _080340E8 +_080340F6: + adds r2, r4, 0x3 + lsls r2, 16 + lsrs r2, 16 + adds r0, r6, 0 + adds r1, r5, 0 + bl dp01_prepare_buffer + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80340C8 + + thumb_func_start sub_8034110 +sub_8034110: @ 8034110 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 16 + lsrs r4, r1, 16 + ldr r1, =0x02022d10 + movs r0, 0x20 + strb r0, [r1] + strb r4, [r1, 0x1] + lsrs r0, r4, 8 + strb r0, [r1, 0x2] + adds r5, r1, 0 + cmp r4, 0 + beq _0803413E + adds r1, r5, 0x3 + adds r3, r4, 0 +_08034130: + ldrb r0, [r2] + strb r0, [r1] + adds r2, 0x1 + adds r1, 0x1 + subs r3, 0x1 + cmp r3, 0 + bne _08034130 +_0803413E: + adds r2, r4, 0x3 + lsls r2, 16 + lsrs r2, 16 + adds r0, r6, 0 + adds r1, r5, 0 + bl dp01_prepare_buffer + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8034110 + + thumb_func_start dp01_build_cmdbuf_x21_a_bb +dp01_build_cmdbuf_x21_a_bb: @ 8034158 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r2, 16 + lsrs r2, 16 + ldr r1, =0x02022d10 + movs r3, 0x21 + strb r3, [r1] + strb r4, [r1, 0x1] + strb r2, [r1, 0x2] + lsrs r2, 8 + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x21_a_bb + + thumb_func_start dp01_build_cmdbuf_x22_a_three_bytes +dp01_build_cmdbuf_x22_a_three_bytes: @ 8034184 + push {r4,r5,lr} + adds r4, r2, 0 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, =0x02022d10 + movs r0, 0x22 + strb r0, [r2] + strb r1, [r2, 0x1] + movs r3, 0 + adds r1, r2, 0x2 +_08034198: + adds r0, r4, r3 + ldrb r0, [r0] + strb r0, [r1] + adds r1, 0x1 + adds r3, 0x1 + cmp r3, 0x2 + ble _08034198 + adds r0, r5, 0 + adds r1, r2, 0 + movs r2, 0x5 + bl dp01_prepare_buffer + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x22_a_three_bytes + + thumb_func_start dp01_build_cmdbuf_x23_aa_0 +dp01_build_cmdbuf_x23_aa_0: @ 80341BC + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + ldr r3, =0x02022d10 + movs r4, 0 + movs r2, 0x23 + strb r2, [r3] + strb r1, [r3, 0x1] + lsrs r1, 8 + strb r1, [r3, 0x2] + strb r4, [r3, 0x3] + adds r1, r3, 0 + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x23_aa_0 + + thumb_func_start dp01_build_cmdbuf_x24_aa_0 +dp01_build_cmdbuf_x24_aa_0: @ 80341E8 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + ldr r3, =0x02022d10 + movs r4, 0 + movs r2, 0x24 + strb r2, [r3] + strb r1, [r3, 0x1] + lsrs r1, 8 + strb r1, [r3, 0x2] + strb r4, [r3, 0x3] + adds r1, r3, 0 + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x24_aa_0 + + thumb_func_start dp01_build_cmdbuf_x25_25_25_25 +dp01_build_cmdbuf_x25_25_25_25: @ 8034214 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x25 + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x25_25_25_25 + + thumb_func_start dp01_build_cmdbuf_x26_a +dp01_build_cmdbuf_x26_a: @ 8034234 + push {lr} + adds r3, r1, 0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x26 + strb r2, [r1] + strb r3, [r1, 0x1] + movs r2, 0x2 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x26_a + + thumb_func_start dp01_build_cmdbuf_x27_27_27_27 +dp01_build_cmdbuf_x27_27_27_27: @ 8034254 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x27 + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x27_27_27_27 + + thumb_func_start dp01_build_cmdbuf_x28_28_28_28 +dp01_build_cmdbuf_x28_28_28_28: @ 8034274 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x28 + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x28_28_28_28 + + thumb_func_start dp01_build_cmdbuf_x29_29_29_29 +dp01_build_cmdbuf_x29_29_29_29: @ 8034294 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x29 + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x29_29_29_29 + + thumb_func_start dp01_build_cmdbuf_x2A_2A_2A_2A +dp01_build_cmdbuf_x2A_2A_2A_2A: @ 80342B4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x2A + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x2A_2A_2A_2A + + thumb_func_start dp01_build_cmdbuf_x2B_aa_0 +dp01_build_cmdbuf_x2B_aa_0: @ 80342D4 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + ldr r3, =0x02022d10 + movs r4, 0 + movs r2, 0x2B + strb r2, [r3] + strb r1, [r3, 0x1] + lsrs r1, 8 + strb r1, [r3, 0x2] + strb r4, [r3, 0x3] + adds r1, r3, 0 + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x2B_aa_0 + + thumb_func_start sub_8034300 +sub_8034300: @ 8034300 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + ldr r4, =0x02022d10 + movs r3, 0x2C + strb r3, [r4] + strb r1, [r4, 0x1] + lsrs r1, 8 + strb r1, [r4, 0x2] + strb r2, [r4, 0x3] + adds r1, r4, 0 + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8034300 + + thumb_func_start dp01_build_cmdbuf_x2D_2D_2D_2D +dp01_build_cmdbuf_x2D_2D_2D_2D: @ 803432C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x2D + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x2D_2D_2D_2D + + thumb_func_start dp01_build_cmdbuf_x2E_a +dp01_build_cmdbuf_x2E_a: @ 803434C + push {lr} + adds r3, r1, 0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x2E + strb r2, [r1] + strb r3, [r1, 0x1] + movs r2, 0x2 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x2E_a + + thumb_func_start dp01_build_cmdbuf_x2F_2F_2F_2F +dp01_build_cmdbuf_x2F_2F_2F_2F: @ 803436C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x2F + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x2F_2F_2F_2F + + thumb_func_start dp01_build_cmdbuf_x30_TODO +dp01_build_cmdbuf_x30_TODO: @ 803438C + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r2, 24 + lsrs r2, 24 + ldr r1, =0x02022d10 + movs r3, 0x30 + strb r3, [r1] + movs r0, 0x7F + ands r0, r2 + strb r0, [r1, 0x1] + movs r0, 0x80 + ands r0, r2 + lsls r0, 24 + lsrs r0, 31 + strb r0, [r1, 0x2] + strb r3, [r1, 0x3] + movs r2, 0 + adds r3, r1, 0x4 +_080343B4: + adds r0, r4, r2 + ldrb r0, [r0] + strb r0, [r3] + adds r3, 0x1 + adds r2, 0x1 + cmp r2, 0x2F + ble _080343B4 + adds r0, r5, 0 + movs r2, 0x34 + bl dp01_prepare_buffer + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x30_TODO + + thumb_func_start dp01_build_cmdbuf_x31_31_31_31 +dp01_build_cmdbuf_x31_31_31_31: @ 80343D4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x31 + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x31_31_31_31 + + thumb_func_start dp01_build_cmdbuf_x32_32_32_32 +dp01_build_cmdbuf_x32_32_32_32: @ 80343F4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x32 + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x32_32_32_32 + + thumb_func_start dp01_build_cmdbuf_x33_a_33_33 +dp01_build_cmdbuf_x33_a_33_33: @ 8034414 + push {lr} + adds r3, r1, 0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x33 + strb r2, [r1] + strb r3, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x33_a_33_33 + + thumb_func_start dp01_build_cmdbuf_x34_a_bb_aka_battle_anim +dp01_build_cmdbuf_x34_a_bb_aka_battle_anim: @ 8034438 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r2, 16 + lsrs r2, 16 + ldr r1, =0x02022d10 + movs r3, 0x34 + strb r3, [r1] + strb r4, [r1, 0x1] + strb r2, [r1, 0x2] + lsrs r2, 8 + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x34_a_bb_aka_battle_anim + + thumb_func_start sub_8034464 +sub_8034464: @ 8034464 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r2, 24 + lsrs r2, 24 + ldr r4, =0x02022d10 + movs r0, 0x35 + strb r0, [r4] + strb r1, [r4, 0x1] + cmp r2, 0 + beq _0803448C + adds r0, r4, 0x4 + bl sub_81850DC + strb r0, [r4, 0x2] + strb r0, [r4, 0x3] + b _08034490 + .pool +_0803448C: + strb r2, [r4, 0x2] + strb r2, [r4, 0x3] +_08034490: + ldr r1, =0x02022d10 + ldrb r2, [r1, 0x2] + adds r2, 0x4 + adds r0, r5, 0 + bl dp01_prepare_buffer + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8034464 + + thumb_func_start dp01_build_cmdbuf_x38_a +dp01_build_cmdbuf_x38_a: @ 80344A8 + push {lr} + adds r3, r1, 0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x36 + strb r2, [r1] + strb r3, [r1, 0x1] + movs r2, 0x2 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x38_a + + thumb_func_start dp01_build_cmdbuf_x37_a +dp01_build_cmdbuf_x37_a: @ 80344C8 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r4, =0x02022d10 + movs r0, 0x37 + strb r0, [r4] + strb r1, [r4, 0x1] + ldr r0, =0x03005d90 + ldr r1, [r0] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 28 + lsrs r0, 31 + strb r0, [r4, 0x2] + ldrb r0, [r1] + lsls r0, 28 + lsrs r0, 31 + strb r0, [r4, 0x3] + adds r0, r4, 0x6 + bl sub_81850DC + strb r0, [r4, 0x4] + strb r0, [r4, 0x5] + ldrb r2, [r4, 0x4] + adds r2, 0x6 + adds r0, r5, 0 + adds r1, r4, 0 + bl dp01_prepare_buffer + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x37_a + + thumb_func_start LZDecompressWram +@ void LZDecompressWram(void *src, void *dest) +LZDecompressWram: @ 8034518 + push {lr} + bl LZ77UnCompWram + pop {r0} + bx r0 + thumb_func_end LZDecompressWram + + thumb_func_start LZDecompressVram +@ void LZDecompressVram(void *src, void *dest) +LZDecompressVram: @ 8034524 + push {lr} + bl LZ77UnCompVram + pop {r0} + bx r0 + thumb_func_end LZDecompressVram + + thumb_func_start LoadCompressedObjectPic +@ u16 LoadCompressedObjectPic(struct obj_tiles *pic) +LoadCompressedObjectPic: @ 8034530 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r0, [r4] + ldr r5, =0x0201c000 + adds r1, r5, 0 + bl LZ77UnCompWram + str r5, [sp] + ldrh r1, [r4, 0x6] + lsls r1, 16 + ldrh r0, [r4, 0x4] + orrs r0, r1 + str r0, [sp, 0x4] + mov r0, sp + bl LoadObjectPic + lsls r0, 16 + lsrs r0, 16 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end LoadCompressedObjectPic + + thumb_func_start LoadCompressedObjectPicOverrideBuffer +@ void LoadCompressedObjectPicOverrideBuffer(struct obj_tiles *pic, void *tempBuffer) +LoadCompressedObjectPicOverrideBuffer: @ 8034564 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, [r4] + bl LZ77UnCompWram + str r5, [sp] + ldrh r1, [r4, 0x6] + lsls r1, 16 + ldrh r0, [r4, 0x4] + orrs r0, r1 + str r0, [sp, 0x4] + mov r0, sp + bl LoadObjectPic + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end LoadCompressedObjectPicOverrideBuffer + + thumb_func_start LoadCompressedObjectPalette +@ void LoadCompressedObjectPalette(struct TaggedObjectPalette *palette) +LoadCompressedObjectPalette: @ 803458C + push {r4,r5,lr} + sub sp, 0x8 + adds r5, r0, 0 + ldr r0, [r5] + ldr r4, =0x0201c000 + adds r1, r4, 0 + bl LZ77UnCompWram + str r4, [sp] + ldrh r2, [r5, 0x4] + ldr r1, =0xffff0000 + ldr r0, [sp, 0x4] + ands r0, r1 + orrs r0, r2 + str r0, [sp, 0x4] + mov r0, sp + bl LoadTaggedObjectPalette + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end LoadCompressedObjectPalette + + thumb_func_start LoadCompressedObjectPaletteOverrideBuffer +@ void LoadCompressedObjectPaletteOverrideBuffer(struct TaggedObjectPalette *palette, void *tempBuffer) +LoadCompressedObjectPaletteOverrideBuffer: @ 80345C0 + push {r4,r5,lr} + sub sp, 0x8 + adds r5, r0, 0 + adds r4, r1, 0 + ldr r0, [r5] + bl LZ77UnCompWram + str r4, [sp] + ldrh r2, [r5, 0x4] + ldr r1, =0xffff0000 + ldr r0, [sp, 0x4] + ands r0, r1 + orrs r0, r2 + str r0, [sp, 0x4] + mov r0, sp + bl LoadTaggedObjectPalette + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end LoadCompressedObjectPaletteOverrideBuffer + + thumb_func_start DecompressPicFromTable +@ void DecompressPicFromTable(void **picTable, void *dest, u32 index) +DecompressPicFromTable: @ 80345F0 + push {r4,r5,lr} + adds r3, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + movs r0, 0xCE + lsls r0, 1 + cmp r5, r0 + ble _08034610 + ldr r0, =gMonFrontPicTable + ldr r0, [r0] + bl LZ77UnCompWram + b _08034618 + .pool +_08034610: + ldr r0, [r3] + adds r1, r4, 0 + bl LZ77UnCompWram +_08034618: + adds r0, r4, 0 + adds r1, r5, 0 + bl DuplicateDeoxysTiles + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end DecompressPicFromTable + + thumb_func_start DecompressMonPic_DetectFrontOrBack +@ void DecompressMonPic_DetectFrontOrBack(void **picTable, void *dest, u32 speciesId, u32 personality) +DecompressMonPic_DetectFrontOrBack: @ 8034628 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + lsls r0, r2, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + movs r1, 0 + cmp r4, r0 + bne _0803463E + movs r1, 0x1 +_0803463E: + str r1, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + bl DecompressMonPic_2 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end DecompressMonPic_DetectFrontOrBack + + thumb_func_start DecompressMonPic +@ void DecompressMonPic(void **picTable, void *dest, u32 speciesId, u32 personality, bool8 isFrontPic) +DecompressMonPic: @ 8034654 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + adds r4, r1, 0 + adds r7, r2, 0 + adds r5, r3, 0 + ldr r0, [sp, 0x18] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r7, 0xC9 + bne _080346D0 + movs r0, 0xC0 + lsls r0, 18 + ands r0, r5 + lsrs r0, 18 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r5 + lsrs r1, 12 + orrs r0, r1 + movs r1, 0xC0 + lsls r1, 2 + ands r1, r5 + lsrs r1, 6 + orrs r0, r1 + movs r1, 0x3 + ands r1, r5 + orrs r0, r1 + movs r1, 0x1C + bl __umodsi3 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _080346A2 + movs r1, 0xC9 + b _080346AC +_080346A2: + movs r2, 0xCE + lsls r2, 1 + adds r0, r1, r2 + lsls r0, 16 + lsrs r1, r0, 16 +_080346AC: + mov r0, r8 + cmp r0, 0 + bne _080346C0 + ldr r0, =gMonBackPicTable + lsls r1, 3 + adds r1, r0 + ldr r0, [r1] + b _080346DC + .pool +_080346C0: + ldr r0, =gMonFrontPicTable + lsls r1, 3 + adds r1, r0 + ldr r0, [r1] + b _080346DC + .pool +_080346D0: + movs r0, 0xCE + lsls r0, 1 + cmp r7, r0 + ble _080346E8 + ldr r0, =gMonFrontPicTable + ldr r0, [r0] +_080346DC: + adds r1, r4, 0 + bl LZ77UnCompWram + b _080346F0 + .pool +_080346E8: + ldr r0, [r6] + adds r1, r4, 0 + bl LZ77UnCompWram +_080346F0: + adds r0, r4, 0 + adds r1, r7, 0 + bl DuplicateDeoxysTiles + lsls r0, r7, 16 + lsrs r0, 16 + adds r1, r5, 0 + adds r2, r4, 0 + mov r3, r8 + bl DrawSpindaSpots + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end DecompressMonPic + + thumb_func_start Unused_LZDecompressWramIndirect +@ void Unused_LZDecompressWramIndirect(void **src) +Unused_LZDecompressWramIndirect: @ 8034710 + push {lr} + ldr r0, [r0] + bl LZ77UnCompWram + pop {r0} + bx r0 + thumb_func_end Unused_LZDecompressWramIndirect + + thumb_func_start sub_803471C +sub_803471C: @ 803471C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + mov r9, r0 + str r1, [sp] + str r2, [sp, 0x4] + adds r5, r3, 0 + movs r0, 0x1 + mov r1, r9 + ands r0, r1 + cmp r0, 0 + bne _0803473C + b _080348D4 +_0803473C: + asrs r0, r1, 1 + adds r0, 0x4 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] + movs r0, 0 + ldr r2, [sp] + cmp r0, r2 + blt _08034750 + b _08034964 +_08034750: + movs r4, 0x8 + subs r1, r4, r1 + str r1, [sp, 0x10] +_08034756: + movs r7, 0 + adds r0, 0x1 + str r0, [sp, 0x14] + ldr r0, [sp, 0x10] + cmp r7, r0 + bge _080347D2 + ldr r1, [sp, 0x8] + lsls r1, 8 + str r1, [sp, 0x18] + movs r2, 0 + mov r10, r2 + mov r0, r9 + movs r4, 0x8 + subs r0, r4, r0 + str r0, [sp, 0xC] +_08034774: + movs r3, 0 + asrs r0, r7, 1 + adds r1, r7, 0 + movs r2, 0x1 + ands r1, r2 + str r1, [sp, 0x20] + lsls r0, 8 + mov r8, r0 + mov r12, r5 +_08034786: + lsls r1, r3, 5 + ldr r4, [sp, 0x18] + adds r0, r5, r4 + adds r0, r1 + mov r1, r8 + adds r2, r0, r1 + mov r1, r12 + add r1, r8 + movs r6, 0xF +_08034798: + ldr r4, [sp, 0x20] + cmp r4, 0 + bne _080347A8 + strb r4, [r1] + add r4, sp, 0x20 + ldrb r4, [r4] + strb r4, [r2, 0x10] + b _080347B6 +_080347A8: + mov r0, r10 + strb r0, [r1, 0x10] + movs r4, 0x80 + lsls r4, 1 + adds r4, r2, r4 + str r4, [sp, 0x1C] + strb r0, [r4] +_080347B6: + adds r2, 0x1 + adds r1, 0x1 + subs r6, 0x1 + cmp r6, 0 + bge _08034798 + movs r0, 0x20 + add r12, r0 + adds r3, 0x1 + cmp r3, 0x7 + ble _08034786 + adds r7, 0x1 + ldr r1, [sp, 0xC] + cmp r7, r1 + blt _08034774 +_080347D2: + movs r7, 0 + movs r2, 0 +_080347D6: + movs r6, 0 + adds r4, r7, 0x1 + mov r8, r4 + lsls r4, r7, 5 +_080347DE: + adds r0, r6, 0x1 + mov r10, r0 + lsls r1, r6, 8 + adds r0, r1, 0 + adds r0, 0xC0 + adds r0, r5, r0 + adds r0, r4 + adds r1, r5, r1 + adds r1, r4 + movs r3, 0x1F +_080347F2: + strb r2, [r1] + strb r2, [r0] + adds r0, 0x1 + adds r1, 0x1 + subs r3, 0x1 + cmp r3, 0 + bge _080347F2 + mov r6, r10 + cmp r6, 0x7 + ble _080347DE + mov r7, r8 + cmp r7, 0x1 + ble _080347D6 + mov r1, r9 + cmp r1, 0x5 + bne _08034818 + movs r2, 0x90 + lsls r2, 1 + adds r5, r2 +_08034818: + movs r7, 0 + cmp r7, r9 + bge _080348AE +_0803481E: + movs r3, 0 + adds r7, 0x1 + mov r8, r7 + cmp r3, r9 + bge _0803488E +_08034828: + adds r3, 0x1 + mov r10, r3 + ldr r4, [sp, 0x4] + adds r4, 0x20 + adds r7, r5, 0 + adds r7, 0x20 + movs r0, 0x12 + adds r0, r5 + mov r12, r0 + ldr r2, [sp, 0x4] + adds r3, r5, 0 + movs r6, 0x3 +_08034840: + ldrb r0, [r2] + mov r1, r12 + strb r0, [r1] + ldrb r0, [r2, 0x1] + strb r0, [r1, 0x1] + ldrb r0, [r2, 0x2] + strb r0, [r1, 0x1E] + ldrb r0, [r2, 0x3] + strb r0, [r1, 0x1F] + movs r0, 0x81 + lsls r0, 1 + adds r1, r3, r0 + ldrb r0, [r2, 0x10] + strb r0, [r1] + ldr r0, =0x00000103 + adds r1, r3, r0 + ldrb r0, [r2, 0x11] + strb r0, [r1] + movs r0, 0x90 + lsls r0, 1 + adds r1, r3, r0 + ldrb r0, [r2, 0x12] + strb r0, [r1] + ldr r0, =0x00000121 + adds r1, r3, r0 + ldrb r0, [r2, 0x13] + strb r0, [r1] + movs r1, 0x4 + add r12, r1 + adds r2, 0x4 + adds r3, 0x4 + subs r6, 0x1 + cmp r6, 0 + bge _08034840 + str r4, [sp, 0x4] + adds r5, r7, 0 + mov r3, r10 + cmp r3, r9 + blt _08034828 +_0803488E: + mov r2, r9 + cmp r2, 0x7 + bne _080348A0 + adds r5, 0x20 + b _080348A8 + .pool +_080348A0: + mov r4, r9 + cmp r4, 0x5 + bne _080348A8 + adds r5, 0x60 +_080348A8: + mov r7, r8 + cmp r7, r9 + blt _0803481E +_080348AE: + mov r0, r9 + cmp r0, 0x7 + bne _080348BC + movs r1, 0x80 + lsls r1, 1 + adds r5, r1 + b _080348C8 +_080348BC: + mov r2, r9 + cmp r2, 0x5 + bne _080348C8 + movs r4, 0xF0 + lsls r4, 1 + adds r5, r4 +_080348C8: + ldr r0, [sp, 0x14] + ldr r1, [sp] + cmp r0, r1 + bge _080348D2 + b _08034756 +_080348D2: + b _08034964 +_080348D4: + movs r6, 0 + ldr r2, [sp] + cmp r6, r2 + bge _08034964 +_080348DC: + adds r6, 0x1 + mov r10, r6 + mov r4, r9 + cmp r4, 0x6 + bne _080348F4 + movs r0, 0 + movs r3, 0xFF +_080348EA: + strb r0, [r5] + adds r5, 0x1 + subs r3, 0x1 + cmp r3, 0 + bge _080348EA +_080348F4: + movs r7, 0 + cmp r7, r9 + bge _08034948 +_080348FA: + adds r7, 0x1 + mov r8, r7 + mov r1, r9 + lsls r0, r1, 5 + cmp r1, 0x6 + bne _08034914 + movs r1, 0 + movs r3, 0x1F +_0803490A: + strb r1, [r5] + adds r5, 0x1 + subs r3, 0x1 + cmp r3, 0 + bge _0803490A +_08034914: + adds r1, r0, 0 + cmp r1, 0 + ble _0803492E + adds r3, r1, 0 +_0803491C: + ldr r2, [sp, 0x4] + ldrb r0, [r2] + strb r0, [r5] + adds r2, 0x1 + str r2, [sp, 0x4] + adds r5, 0x1 + subs r3, 0x1 + cmp r3, 0 + bne _0803491C +_0803492E: + mov r4, r9 + cmp r4, 0x6 + bne _08034942 + movs r0, 0 + movs r3, 0x1F +_08034938: + strb r0, [r5] + adds r5, 0x1 + subs r3, 0x1 + cmp r3, 0 + bge _08034938 +_08034942: + mov r7, r8 + cmp r7, r9 + blt _080348FA +_08034948: + mov r0, r9 + cmp r0, 0x6 + bne _0803495C + movs r0, 0 + movs r3, 0xFF +_08034952: + strb r0, [r5] + adds r5, 0x1 + subs r3, 0x1 + cmp r3, 0 + bge _08034952 +_0803495C: + mov r6, r10 + ldr r1, [sp] + cmp r6, r1 + blt _080348DC +_08034964: + 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_803471C + + thumb_func_start sub_8034974 +sub_8034974: @ 8034974 + adds r2, r0, 0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + ldrb r1, [r2, 0x2] + lsls r1, 8 + orrs r0, r1 + ldrb r1, [r2, 0x1] + orrs r0, r1 + bx lr + thumb_func_end sub_8034974 + + thumb_func_start LoadCompressedObjectPicUsingHeap +@ u32 LoadCompressedObjectPicUsingHeap(struct obj_tiles *pic) +LoadCompressedObjectPicUsingHeap: @ 8034988 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r0, [r4] + ldr r0, [r0] + lsrs r0, 8 + bl AllocZeroed + adds r5, r0, 0 + ldr r0, [r4] + adds r1, r5, 0 + bl LZ77UnCompWram + str r5, [sp] + ldrh r1, [r4, 0x6] + lsls r1, 16 + ldrh r0, [r4, 0x4] + orrs r0, r1 + str r0, [sp, 0x4] + mov r0, sp + bl LoadObjectPic + adds r0, r5, 0 + bl Free + movs r0, 0 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end LoadCompressedObjectPicUsingHeap + + thumb_func_start LoadCompressedObjectPaletteUsingHeap +@ u32 LoadCompressedObjectPaletteUsingHeap(struct TaggedObjectPalette *palette) +LoadCompressedObjectPaletteUsingHeap: @ 80349C4 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r0, [r4] + ldr r0, [r0] + lsrs r0, 8 + bl AllocZeroed + adds r5, r0, 0 + ldr r0, [r4] + adds r1, r5, 0 + bl LZ77UnCompWram + str r5, [sp] + ldrh r2, [r4, 0x4] + ldr r1, =0xffff0000 + ldr r0, [sp, 0x4] + ands r0, r1 + orrs r0, r2 + str r0, [sp, 0x4] + mov r0, sp + bl LoadTaggedObjectPalette + adds r0, r5, 0 + bl Free + movs r0, 0 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end LoadCompressedObjectPaletteUsingHeap + + thumb_func_start DecompressPicFromTable_2 +@ void DecompressPicFromTable_2(void **picTable, void *dest, u32 index) +DecompressPicFromTable_2: @ 8034A08 + push {r4,r5,lr} + adds r3, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + movs r0, 0xCE + lsls r0, 1 + cmp r5, r0 + ble _08034A28 + ldr r0, =gMonFrontPicTable + ldr r0, [r0] + bl LZ77UnCompWram + b _08034A30 + .pool +_08034A28: + ldr r0, [r3] + adds r1, r4, 0 + bl LZ77UnCompWram +_08034A30: + adds r0, r4, 0 + adds r1, r5, 0 + bl DuplicateDeoxysTiles + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end DecompressPicFromTable_2 + + thumb_func_start DecompressMonPic_2 +@ void DecompressMonPic_2(void **picTable, void *dest, u32 speciesId, u32 personality, bool8 isFrontPic) +DecompressMonPic_2: @ 8034A40 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + adds r4, r1, 0 + adds r7, r2, 0 + adds r5, r3, 0 + ldr r0, [sp, 0x18] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r7, 0xC9 + bne _08034ABC + movs r0, 0xC0 + lsls r0, 18 + ands r0, r5 + lsrs r0, 18 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r5 + lsrs r1, 12 + orrs r0, r1 + movs r1, 0xC0 + lsls r1, 2 + ands r1, r5 + lsrs r1, 6 + orrs r0, r1 + movs r1, 0x3 + ands r1, r5 + orrs r0, r1 + movs r1, 0x1C + bl __umodsi3 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _08034A8E + movs r1, 0xC9 + b _08034A98 +_08034A8E: + movs r2, 0xCE + lsls r2, 1 + adds r0, r1, r2 + lsls r0, 16 + lsrs r1, r0, 16 +_08034A98: + mov r0, r8 + cmp r0, 0 + bne _08034AAC + ldr r0, =gMonBackPicTable + lsls r1, 3 + adds r1, r0 + ldr r0, [r1] + b _08034AC8 + .pool +_08034AAC: + ldr r0, =gMonFrontPicTable + lsls r1, 3 + adds r1, r0 + ldr r0, [r1] + b _08034AC8 + .pool +_08034ABC: + movs r0, 0xCE + lsls r0, 1 + cmp r7, r0 + ble _08034AD4 + ldr r0, =gMonFrontPicTable + ldr r0, [r0] +_08034AC8: + adds r1, r4, 0 + bl LZ77UnCompWram + b _08034ADC + .pool +_08034AD4: + ldr r0, [r6] + adds r1, r4, 0 + bl LZ77UnCompWram +_08034ADC: + adds r0, r4, 0 + adds r1, r7, 0 + bl DuplicateDeoxysTiles + lsls r0, r7, 16 + lsrs r0, 16 + adds r1, r5, 0 + adds r2, r4, 0 + mov r3, r8 + bl DrawSpindaSpots + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end DecompressMonPic_2 + + thumb_func_start DecompressMonPic_DetectFrontOrBack_2 +@ void DecompressMonPic_DetectFrontOrBack_2(void **picTable, void *dest, u32 speciesId, u32 personality) +DecompressMonPic_DetectFrontOrBack_2: @ 8034AFC + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + lsls r0, r2, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + movs r1, 0 + cmp r4, r0 + bne _08034B12 + movs r1, 0x1 +_08034B12: + str r1, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + bl DecompressMonPic_2 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end DecompressMonPic_DetectFrontOrBack_2 + + thumb_func_start sub_8034B28 +sub_8034B28: @ 8034B28 + push {lr} + adds r3, r0, 0 + movs r0, 0xCE + lsls r0, 1 + cmp r2, r0 + ble _08034B44 + ldr r0, =gMonFrontPicTable + ldr r0, [r0] + bl LZ77UnCompWram + b _08034B4A + .pool +_08034B44: + ldr r0, [r3] + bl LZ77UnCompWram +_08034B4A: + pop {r0} + bx r0 + thumb_func_end sub_8034B28 + + thumb_func_start DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack +@ void DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack(void **picTable, void *dest, u32 speciesId, u32 personality) +DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack: @ 8034B50 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + lsls r0, r2, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + movs r1, 0 + cmp r4, r0 + bne _08034B66 + movs r1, 0x1 +_08034B66: + str r1, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + bl DecompressMonPicWithoutDuplicatingDeoxysTiles + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack + + thumb_func_start DecompressMonPicWithoutDuplicatingDeoxysTiles +@ void DecompressMonPicWithoutDuplicatingDeoxysTiles(void **picTable, void *dest, u32 speciesId, u32 personality, bool8 isFrontPic) +DecompressMonPicWithoutDuplicatingDeoxysTiles: @ 8034B7C + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + adds r5, r1, 0 + adds r7, r2, 0 + adds r4, r3, 0 + ldr r0, [sp, 0x18] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r7, 0xC9 + bne _08034BF8 + movs r0, 0xC0 + lsls r0, 18 + ands r0, r4 + lsrs r0, 18 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r4 + lsrs r1, 12 + orrs r0, r1 + movs r1, 0xC0 + lsls r1, 2 + ands r1, r4 + lsrs r1, 6 + orrs r0, r1 + movs r1, 0x3 + ands r1, r4 + orrs r0, r1 + movs r1, 0x1C + bl __umodsi3 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _08034BCA + movs r1, 0xC9 + b _08034BD4 +_08034BCA: + movs r2, 0xCE + lsls r2, 1 + adds r0, r1, r2 + lsls r0, 16 + lsrs r1, r0, 16 +_08034BD4: + mov r0, r8 + cmp r0, 0 + bne _08034BE8 + ldr r0, =gMonBackPicTable + lsls r1, 3 + adds r1, r0 + ldr r0, [r1] + b _08034C04 + .pool +_08034BE8: + ldr r0, =gMonFrontPicTable + lsls r1, 3 + adds r1, r0 + ldr r0, [r1] + b _08034C04 + .pool +_08034BF8: + movs r0, 0xCE + lsls r0, 1 + cmp r7, r0 + ble _08034C10 + ldr r0, =gMonFrontPicTable + ldr r0, [r0] +_08034C04: + adds r1, r5, 0 + bl LZ77UnCompWram + b _08034C18 + .pool +_08034C10: + ldr r0, [r6] + adds r1, r5, 0 + bl LZ77UnCompWram +_08034C18: + lsls r0, r7, 16 + lsrs r0, 16 + adds r1, r4, 0 + adds r2, r5, 0 + mov r3, r8 + bl DrawSpindaSpots + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end DecompressMonPicWithoutDuplicatingDeoxysTiles + + thumb_func_start DuplicateDeoxysTiles +@ void DuplicateDeoxysTiles(void *pointer, u32 speciesId) +DuplicateDeoxysTiles: @ 8034C30 + push {lr} + adds r3, r0, 0 + movs r0, 0xCD + lsls r0, 1 + cmp r1, r0 + bne _08034C4A + movs r1, 0x80 + lsls r1, 4 + adds r0, r3, r1 + ldr r2, =0x04000200 + adds r1, r3, 0 + bl CpuSet +_08034C4A: + pop {r0} + bx r0 + .pool + thumb_func_end DuplicateDeoxysTiles + + thumb_func_start sub_8034C54 +sub_8034C54: @ 8034C54 + push {r4-r7,lr} + adds r4, r0, 0 + ldr r5, =0x02022e10 + ldr r0, [r5] + cmp r0, 0 + beq _08034C64 + bl sub_8034CC8 +_08034C64: + movs r0, 0x8 + bl Alloc + str r0, [r5] + cmp r0, 0 + bne _08034C78 + movs r0, 0 + b _08034CC0 + .pool +_08034C78: + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + bl Alloc + ldr r1, [r5] + str r0, [r1, 0x4] + cmp r0, 0 + bne _08034C94 + adds r0, r1, 0 + bl Free + movs r0, 0 + b _08034CC0 +_08034C94: + str r4, [r1] + movs r3, 0 + cmp r3, r4 + bcs _08034CBE + movs r7, 0 + movs r6, 0xFF + movs r2, 0 +_08034CA2: + ldr r0, [r5] + ldr r0, [r0, 0x4] + adds r0, r2, r0 + strb r7, [r0] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r2, r1 + ldrb r0, [r1, 0x1] + orrs r0, r6 + strb r0, [r1, 0x1] + adds r2, 0x1C + adds r3, 0x1 + cmp r3, r4 + bcc _08034CA2 +_08034CBE: + movs r0, 0x1 +_08034CC0: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8034C54 + + thumb_func_start sub_8034CC8 +sub_8034CC8: @ 8034CC8 + push {r4,r5,lr} + ldr r2, =0x02022e10 + ldr r1, [r2] + cmp r1, 0 + beq _08034D08 + ldr r0, [r1, 0x4] + cmp r0, 0 + beq _08034CFC + movs r4, 0 + ldr r0, [r1] + cmp r4, r0 + bcs _08034CF2 + adds r5, r2, 0 +_08034CE2: + adds r0, r4, 0 + bl sub_80353DC + adds r4, 0x1 + ldr r0, [r5] + ldr r0, [r0] + cmp r4, r0 + bcc _08034CE2 +_08034CF2: + ldr r0, =0x02022e10 + ldr r0, [r0] + ldr r0, [r0, 0x4] + bl Free +_08034CFC: + ldr r4, =0x02022e10 + ldr r0, [r4] + bl Free + movs r0, 0 + str r0, [r4] +_08034D08: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8034CC8 + + thumb_func_start sub_8034D14 +sub_8034D14: @ 8034D14 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + mov r8, r0 + mov r10, r1 + adds r5, r2, 0 + ldr r6, =0x02022e10 + ldr r0, [r6] + cmp r0, 0 + beq _08034DD4 + ldr r1, [r0, 0x4] + mov r0, r8 + lsls r2, r0, 3 + subs r0, r2, r0 + lsls r4, r0, 2 + adds r1, r4, r1 + ldrb r0, [r1] + mov r9, r2 + cmp r0, 0 + bne _08034DD4 + ldrb r0, [r5, 0x1] + bl sub_8035518 + ldr r1, [r6] + ldr r1, [r1, 0x4] + adds r1, r4, r1 + strb r0, [r1, 0x1] + ldr r0, [r6] + ldr r0, [r0, 0x4] + adds r0, r4, r0 + ldrb r0, [r0, 0x1] + cmp r0, 0xFF + beq _08034DD4 + ldr r0, [r5, 0x8] + ldrh r0, [r0, 0x6] + bl GetObjectTileRangeStartByTag + ldr r2, [r6] + ldr r1, [r2, 0x4] + adds r1, r4, r1 + strh r0, [r1, 0xA] + ldr r0, [r2, 0x4] + adds r0, r4, r0 + ldrh r1, [r0, 0xA] + ldr r7, =0xffff0000 + lsrs r0, r7, 16 + cmp r1, r0 + bne _08034DE0 + ldr r2, [r5, 0x8] + ldrh r0, [r2, 0x4] + adds r1, r2, 0 + cmp r0, 0 + beq _08034D94 + adds r0, r1, 0 + bl LoadObjectPic + b _08034DB4 + .pool +_08034D94: + ldr r0, [r2] + ldr r1, [r2, 0x4] + str r0, [sp] + str r1, [sp, 0x4] + ldr r0, [r2] + bl sub_8034974 + lsls r0, 16 + lsrs r0, 16 + ldr r1, [sp, 0x4] + ands r1, r7 + orrs r1, r0 + str r1, [sp, 0x4] + mov r0, sp + bl LoadCompressedObjectPic +_08034DB4: + ldr r1, [r6] + ldr r1, [r1, 0x4] + adds r1, r4, r1 + strh r0, [r1, 0xA] + ldr r0, =0x02022e10 + ldr r0, [r0] + ldr r1, [r0, 0x4] + mov r2, r9 + mov r3, r8 + subs r0, r2, r3 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0, 0xA] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _08034DE0 +_08034DD4: + movs r0, 0 + b _08034EE8 + .pool +_08034DE0: + ldr r0, [r5, 0xC] + ldrh r0, [r0, 0x4] + bl IndexOfObjectPaletteTag + ldr r6, =0x02022e10 + ldr r1, [r6] + ldr r1, [r1, 0x4] + mov r4, r9 + mov r3, r8 + subs r2, r4, r3 + lsls r4, r2, 2 + adds r1, r4, r1 + strb r0, [r1, 0x4] + ldr r0, [r6] + ldr r0, [r0, 0x4] + adds r0, r4, r0 + ldrb r0, [r0, 0x4] + cmp r0, 0xFF + bne _08034E14 + ldr r0, [r5, 0xC] + bl LoadTaggedObjectPalette + ldr r1, [r6] + ldr r1, [r1, 0x4] + adds r1, r4, r1 + strb r0, [r1, 0x4] +_08034E14: + ldr r0, [r6] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r0, [r5] + lsls r0, 30 + lsrs r0, 30 + strb r0, [r1, 0x2] + ldr r0, [r6] + ldr r0, [r0, 0x4] + adds r0, r4, r0 + ldrb r1, [r5, 0x1] + strb r1, [r0, 0x3] + ldr r2, [r6] + ldr r0, [r2, 0x4] + adds r0, r4, r0 + ldrh r1, [r5, 0x4] + strh r1, [r0, 0xC] + ldr r0, [r2, 0x4] + adds r0, r4, r0 + ldrh r1, [r5, 0x6] + strh r1, [r0, 0xE] + ldr r1, [r2, 0x4] + adds r1, r4, r1 + ldrb r0, [r5] + lsls r0, 28 + lsrs r0, 30 + strb r0, [r1, 0x6] + ldr r0, [r6] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r0, [r5] + lsls r0, 26 + lsrs r0, 30 + strb r0, [r1, 0x5] + ldr r0, [r6] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r0, [r5] + lsrs r0, 6 + strb r0, [r1, 0x7] + ldr r0, [r6] + ldr r0, [r0, 0x4] + adds r0, r4, r0 + ldrb r1, [r5, 0x2] + strb r1, [r0, 0x8] + ldrb r1, [r5] + lsls r0, r1, 28 + lsrs r0, 30 + lsls r1, 26 + lsrs r1, 30 + bl sub_80355F8 + ldr r1, [r6] + ldr r1, [r1, 0x4] + adds r1, r4, r1 + strb r0, [r1, 0x9] + ldr r2, [r6] + ldr r0, [r2, 0x4] + adds r0, r4, r0 + ldr r1, [r5, 0x8] + ldrh r1, [r1, 0x6] + strh r1, [r0, 0x10] + ldr r0, [r2, 0x4] + adds r0, r4, r0 + ldr r1, [r5, 0xC] + ldrh r1, [r1, 0x4] + strh r1, [r0, 0x12] + ldr r0, [r2, 0x4] + adds r0, r4, r0 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r6] + ldr r0, [r0, 0x4] + adds r0, r4, r0 + str r1, [r0, 0x14] + movs r3, 0x1 + ldrb r0, [r5, 0x1] + cmp r3, r0 + bcs _08034ECA +_08034EB2: + ldr r0, [r6] + ldr r2, [r0, 0x4] + adds r2, r4, r2 + ldr r1, [r2, 0x14] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + str r0, [r2, 0x14] + adds r3, 0x1 + ldrb r2, [r5, 0x1] + cmp r3, r2 + bcc _08034EB2 +_08034ECA: + ldr r0, =0x02022e10 + ldr r0, [r0] + mov r3, r9 + mov r4, r8 + subs r1, r3, r4 + lsls r1, 2 + ldr r0, [r0, 0x4] + adds r0, r1 + bl sub_8034EFC + mov r0, r8 + mov r1, r10 + bl sub_8035044 + movs r0, 0x1 +_08034EE8: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8034D14 + + thumb_func_start sub_8034EFC +sub_8034EFC: @ 8034EFC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r4, r0, 0 + ldrb r5, [r4, 0x1] + movs r0, 0xC + ldrsh r7, [r4, r0] + ldrb r0, [r4, 0x3] + adds r0, 0x1 + mov r8, r0 + mov r1, sp + movs r0, 0 + strh r0, [r1] + lsls r1, r5, 3 + ldr r2, =0x030022f8 + mov r9, r2 + add r1, r9 + mov r0, r8 + lsls r2, r0, 2 + movs r0, 0x80 + lsls r0, 17 + orrs r2, r0 + mov r0, sp + bl CpuSet + movs r6, 0 + ldrb r5, [r4, 0x1] + cmp r6, r8 + bcs _08034FCE + movs r1, 0x3F + mov r10, r1 + movs r2, 0xD + negs r2, r2 + mov r9, r2 +_08034F46: + lsls r0, r5, 3 + ldr r1, =0x030022c0 + adds r3, r0, r1 + ldrh r1, [r4, 0xE] + adds r0, r3, 0 + adds r0, 0x38 + strb r1, [r0] + ldr r2, =0x000001ff + adds r0, r2, 0 + adds r1, r7, 0 + ands r1, r0 + ldrh r2, [r3, 0x3A] + ldr r0, =0xfffffe00 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x3A] + ldrb r1, [r4, 0x6] + movs r0, 0x39 + adds r0, r3 + mov r12, r0 + lsls r1, 6 + ldrb r2, [r0] + mov r0, r10 + ands r0, r2 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] + ldrb r1, [r4, 0x5] + movs r2, 0x3B + adds r2, r3 + mov r12, r2 + lsls r1, 6 + ldrb r2, [r2] + mov r0, r10 + ands r0, r2 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] + ldrh r0, [r4, 0xA] + ldr r1, =0x000003ff + ands r1, r0 + ldrh r2, [r3, 0x3C] + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x3C] + adds r3, 0x3D + movs r0, 0x3 + ldrb r1, [r4, 0x7] + ands r1, r0 + lsls r1, 2 + ldrb r2, [r3] + mov r0, r9 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + ldrb r2, [r4, 0x4] + lsls r2, 4 + movs r1, 0xF + ands r0, r1 + orrs r0, r2 + strb r0, [r3] + ldrb r0, [r4, 0x8] + adds r7, r0 + adds r6, 0x1 + adds r5, 0x1 + cmp r6, r8 + bcc _08034F46 +_08034FCE: + subs r5, 0x1 + ldr r0, =0x030022c0 + lsls r3, r5, 3 + adds r3, r0 + movs r2, 0xC + ldrsh r1, [r4, r2] + ldrb r0, [r4, 0x8] + subs r1, r0 + ldr r2, =0x000001ff + adds r0, r2, 0 + ands r1, r0 + ldrh r2, [r3, 0x3A] + ldr r0, =0xfffffe00 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x3A] + adds r2, r3, 0 + adds r2, 0x39 + ldrb r1, [r2] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2] + ldrb r0, [r4, 0x9] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 1 + ldrh r4, [r4, 0xA] + adds r1, r4 + ldr r2, =0x000003ff + adds r0, r2, 0 + ands r1, r0 + ldrh r2, [r3, 0x3C] + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x3C] + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8034EFC + + thumb_func_start sub_8035044 +sub_8035044: @ 8035044 + push {r4-r6,lr} + adds r3, r0, 0 + adds r4, r1, 0 + ldr r0, =0x02022e10 + ldr r1, [r0] + adds r6, r0, 0 + cmp r1, 0 + beq _080350A8 + ldr r2, [r1, 0x4] + lsls r1, r3, 3 + subs r0, r1, r3 + lsls r0, 2 + adds r2, r0, r2 + ldrb r0, [r2] + adds r5, r1, 0 + cmp r0, 0 + beq _080350A8 + str r4, [r2, 0x18] + cmp r4, 0 + bge _08035078 + movs r2, 0x1 + negs r4, r4 + b _0803507A + .pool +_08035078: + movs r2, 0 +_0803507A: + ldr r0, [r6] + ldr r1, [r0, 0x4] + subs r0, r5, r3 + lsls r0, 2 + adds r0, r1 + ldrb r3, [r0, 0x2] + cmp r3, 0x1 + beq _0803509A + cmp r3, 0x1 + ble _08035092 + cmp r3, 0x2 + beq _080350A2 +_08035092: + adds r1, r4, 0 + bl sub_80350B0 + b _080350A8 +_0803509A: + adds r1, r4, 0 + bl sub_8035164 + b _080350A8 +_080350A2: + adds r1, r4, 0 + bl sub_80352C0 +_080350A8: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8035044 + + thumb_func_start sub_80350B0 +sub_80350B0: @ 80350B0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r8, r0 + mov r9, r1 + str r2, [sp] + ldr r5, [r0, 0x14] + ldrb r7, [r0, 0x1] + ldr r0, =0x030022c0 + mov r10, r0 + cmp r5, 0 + beq _0803511A + lsls r0, r7, 3 + adds r0, 0x3C + mov r1, r10 + adds r6, r0, r1 +_080350D6: + mov r0, r9 + adds r1, r5, 0 + bl __udivsi3 + adds r4, r0, 0 + adds r0, r4, 0 + muls r0, r5 + mov r2, r9 + subs r2, r0 + mov r9, r2 + adds r0, r5, 0 + movs r1, 0xA + bl __udivsi3 + adds r5, r0, 0 + mov r1, r8 + ldrb r0, [r1, 0x9] + adds r1, r4, 0 + muls r1, r0 + mov r2, r8 + ldrh r2, [r2, 0xA] + adds r1, r2 + ldr r2, =0x000003ff + adds r0, r2, 0 + ands r1, r0 + ldrh r0, [r6] + ldr r2, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r6] + adds r6, 0x8 + adds r7, 0x1 + cmp r5, 0 + bne _080350D6 +_0803511A: + ldr r0, [sp] + cmp r0, 0 + beq _08035140 + lsls r0, r7, 3 + add r0, r10 + adds r0, 0x39 + ldrb r2, [r0] + movs r1, 0x4 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + b _08035154 + .pool +_08035140: + lsls r2, r7, 3 + add r2, r10 + adds r2, 0x39 + ldrb r1, [r2] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2] +_08035154: + 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_80350B0 + + thumb_func_start sub_8035164 +sub_8035164: @ 8035164 + 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 + str r2, [sp] + ldr r5, [r6, 0x14] + ldr r3, =0x03000dd4 + ldrb r0, [r6, 0x1] + str r0, [r3] + ldr r2, =0x03000dd8 + movs r0, 0 + str r0, [r2] + ldr r1, =0x03000ddc + subs r0, 0x1 + str r0, [r1] + adds r7, r3, 0 + mov r10, r1 + ldr r0, =0x030022c0 + mov r9, r0 + cmp r5, 0 + beq _0803524C +_08035196: + mov r0, r8 + adds r1, r5, 0 + bl __udivsi3 + adds r4, r0, 0 + adds r0, r4, 0 + muls r0, r5 + mov r1, r8 + subs r1, r0 + mov r8, r1 + adds r0, r5, 0 + movs r1, 0xA + bl __udivsi3 + adds r5, r0, 0 + cmp r4, 0 + bne _080351C8 + mov r2, r10 + ldr r1, [r2] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080351C8 + cmp r5, 0 + bne _08035224 +_080351C8: + ldr r2, [r7] + lsls r2, 3 + add r2, r9 + ldrb r0, [r6, 0x9] + adds r3, r4, 0 + muls r3, r0 + ldrh r4, [r6, 0xA] + adds r3, r4 + ldr r1, =0x000003ff + adds r0, r1, 0 + ands r3, r0 + ldrh r0, [r2, 0x3C] + ldr r4, =0xfffffc00 + adds r1, r4, 0 + ands r0, r1 + orrs r0, r3 + strh r0, [r2, 0x3C] + adds r2, 0x39 + ldrb r0, [r2] + movs r1, 0x4 + negs r1, r1 + ands r0, r1 + strb r0, [r2] + mov r2, r10 + ldr r1, [r2] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _0803523A + ldr r4, =0x03000dd8 + ldr r0, [r4] + str r0, [r2] + b _0803523A + .pool +_08035224: + ldr r0, [r7] + lsls r0, 3 + add r0, r9 + adds r0, 0x39 + ldrb r1, [r0] + movs r2, 0x4 + negs r2, r2 + ands r1, r2 + movs r2, 0x2 + orrs r1, r2 + strb r1, [r0] +_0803523A: + ldr r0, [r7] + adds r0, 0x1 + str r0, [r7] + ldr r4, =0x03000dd8 + ldr r0, [r4] + adds r0, 0x1 + str r0, [r4] + cmp r5, 0 + bne _08035196 +_0803524C: + ldr r0, [sp] + cmp r0, 0 + beq _08035298 + ldr r1, [r7] + lsls r1, 3 + add r1, r9 + adds r1, 0x39 + ldrb r2, [r1] + movs r0, 0x4 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r3, [r7] + lsls r3, 3 + add r3, r9 + movs r1, 0xC + ldrsh r2, [r6, r1] + mov r4, r10 + ldr r0, [r4] + subs r0, 0x1 + ldrb r1, [r6, 0x8] + muls r0, r1 + adds r2, r0 + ldr r1, =0x000001ff + adds r0, r1, 0 + ands r2, r0 + ldrh r1, [r3, 0x3A] + ldr r0, =0xfffffe00 + ands r0, r1 + orrs r0, r2 + strh r0, [r3, 0x3A] + b _080352AE + .pool +_08035298: + ldr r0, [r7] + lsls r0, 3 + add r0, r9 + adds r0, 0x39 + ldrb r2, [r0] + movs r1, 0x4 + negs r1, r1 + ands r1, r2 + movs r2, 0x2 + orrs r1, r2 + strb r1, [r0] +_080352AE: + 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_8035164 + + thumb_func_start sub_80352C0 +sub_80352C0: @ 80352C0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + mov r8, r0 + mov r10, r1 + str r2, [sp] + ldr r5, [r0, 0x14] + ldrb r3, [r0, 0x1] + movs r0, 0 + str r0, [sp, 0x4] + mov r9, r0 + cmp r5, 0 + beq _0803535A +_080352E0: + lsls r0, r3, 3 + adds r1, r0, 0 + adds r1, 0x39 + ldr r2, =0x030022c0 + adds r7, r1, r2 + adds r0, 0x3C + adds r6, r0, r2 +_080352EE: + mov r0, r10 + adds r1, r5, 0 + str r3, [sp, 0x8] + bl __udivsi3 + adds r4, r0, 0 + adds r0, r4, 0 + muls r0, r5 + mov r1, r10 + subs r1, r0 + mov r10, r1 + adds r0, r5, 0 + movs r1, 0xA + bl __udivsi3 + adds r5, r0, 0 + ldr r3, [sp, 0x8] + cmp r4, 0 + bne _0803531E + ldr r2, [sp, 0x4] + cmp r2, 0 + bne _0803531E + cmp r5, 0 + bne _080352E0 +_0803531E: + movs r0, 0x1 + str r0, [sp, 0x4] + mov r1, r8 + ldrb r0, [r1, 0x9] + adds r2, r4, 0 + muls r2, r0 + ldrh r4, [r1, 0xA] + adds r2, r4 + ldr r1, =0x000003ff + adds r0, r1, 0 + ands r2, r0 + ldrh r0, [r6] + ldr r4, =0xfffffc00 + adds r1, r4, 0 + ands r0, r1 + orrs r0, r2 + strh r0, [r6] + ldrb r0, [r7] + movs r2, 0x4 + negs r2, r2 + adds r1, r2, 0 + ands r0, r1 + strb r0, [r7] + adds r7, 0x8 + adds r6, 0x8 + adds r3, 0x1 + movs r4, 0x1 + add r9, r4 + cmp r5, 0 + bne _080352EE +_0803535A: + mov r0, r8 + ldrb r0, [r0, 0x3] + cmp r9, r0 + bge _0803538A + ldr r1, =0x030022c0 + movs r5, 0x4 + negs r5, r5 + movs r4, 0x2 + lsls r0, r3, 3 + adds r0, 0x39 + adds r2, r0, r1 +_08035370: + ldrb r1, [r2] + adds r0, r5, 0 + ands r0, r1 + orrs r0, r4 + strb r0, [r2] + adds r2, 0x8 + adds r3, 0x1 + movs r1, 0x1 + add r9, r1 + mov r0, r8 + ldrb r0, [r0, 0x3] + cmp r9, r0 + blt _08035370 +_0803538A: + ldr r1, [sp] + cmp r1, 0 + beq _080353B0 + lsls r0, r3, 3 + ldr r2, =0x030022c0 + adds r0, r2 + adds r0, 0x39 + ldrb r2, [r0] + movs r1, 0x4 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + b _080353C6 + .pool +_080353B0: + lsls r2, r3, 3 + ldr r4, =0x030022c0 + adds r2, r4 + adds r2, 0x39 + ldrb r1, [r2] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2] +_080353C6: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80352C0 + + thumb_func_start sub_80353DC +sub_80353DC: @ 80353DC + push {r4-r7,lr} + adds r4, r0, 0 + ldr r0, =0x02022e10 + ldr r0, [r0] + cmp r0, 0 + beq _0803546E + ldr r2, [r0, 0x4] + lsls r1, r4, 3 + subs r0, r1, r4 + lsls r0, 2 + adds r2, r0, r2 + ldrb r0, [r2] + adds r5, r1, 0 + cmp r0, 0 + beq _0803546E + ldrb r3, [r2, 0x3] + adds r0, r3, 0x1 + ldrb r2, [r2, 0x1] + cmp r0, 0 + beq _08035426 + ldr r1, =0x030022c0 + movs r7, 0x4 + negs r7, r7 + movs r6, 0x2 + adds r3, r0, 0 + lsls r0, r2, 3 + adds r0, 0x39 + adds r2, r0, r1 +_08035414: + ldrb r1, [r2] + adds r0, r7, 0 + ands r0, r1 + orrs r0, r6 + strb r0, [r2] + subs r3, 0x1 + adds r2, 0x8 + cmp r3, 0 + bne _08035414 +_08035426: + adds r0, r4, 0 + bl sub_8035570 + cmp r0, 0 + bne _08035442 + ldr r0, =0x02022e10 + ldr r0, [r0] + ldr r1, [r0, 0x4] + subs r0, r5, r4 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x10] + bl FreeObjectTilesByTag +_08035442: + adds r0, r4, 0 + bl sub_80355B4 + cmp r0, 0 + bne _0803545E + ldr r0, =0x02022e10 + ldr r0, [r0] + ldr r1, [r0, 0x4] + subs r0, r5, r4 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x12] + bl FreeObjectPaletteByTag +_0803545E: + ldr r0, =0x02022e10 + ldr r0, [r0] + ldr r1, [r0, 0x4] + subs r0, r5, r4 + lsls r0, 2 + adds r0, r1 + movs r1, 0 + strb r1, [r0] +_0803546E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80353DC + + thumb_func_start sub_803547C +sub_803547C: @ 803547C + push {r4-r7,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, =0x02022e10 + ldr r1, [r0] + adds r7, r0, 0 + cmp r1, 0 + beq _0803550C + ldr r2, [r1, 0x4] + lsls r1, r4, 3 + subs r0, r1, r4 + lsls r0, 2 + adds r2, r0, r2 + ldrb r0, [r2] + adds r6, r1, 0 + cmp r0, 0 + beq _0803550C + ldrb r3, [r2, 0x3] + adds r1, r3, 0x1 + ldrb r0, [r2, 0x1] + cmp r5, 0 + beq _080354D8 + cmp r1, 0 + beq _0803550C + ldr r1, =0x030022c0 + movs r5, 0x4 + negs r5, r5 + movs r4, 0x2 + adds r3, 0x1 + lsls r0, 3 + adds r0, 0x39 + adds r2, r0, r1 +_080354BC: + ldrb r1, [r2] + adds r0, r5, 0 + ands r0, r1 + orrs r0, r4 + strb r0, [r2] + subs r3, 0x1 + adds r2, 0x8 + cmp r3, 0 + bne _080354BC + b _0803550C + .pool +_080354D8: + cmp r1, 0 + beq _080354FA + ldr r1, =0x030022c0 + movs r5, 0x4 + negs r5, r5 + adds r3, 0x1 + lsls r0, 3 + adds r0, 0x39 + adds r2, r0, r1 +_080354EA: + ldrb r1, [r2] + adds r0, r5, 0 + ands r0, r1 + strb r0, [r2] + subs r3, 0x1 + adds r2, 0x8 + cmp r3, 0 + bne _080354EA +_080354FA: + ldr r0, [r7] + ldr r1, [r0, 0x4] + subs r0, r6, r4 + lsls r0, 2 + adds r0, r1 + ldr r1, [r0, 0x18] + adds r0, r4, 0 + bl sub_8035044 +_0803550C: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803547C + + thumb_func_start sub_8035518 +sub_8035518: @ 8035518 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r5, 0x40 + movs r3, 0 + ldr r0, =0x02022e10 + ldr r0, [r0] + ldr r2, [r0] + cmp r3, r2 + bcs _0803555A + ldr r1, [r0, 0x4] +_0803552E: + ldrb r0, [r1] + cmp r0, 0 + bne _08035548 + ldrb r0, [r1, 0x1] + cmp r0, 0xFF + beq _08035552 + ldrb r0, [r1, 0x3] + cmp r0, r4 + bhi _08035552 + ldrb r0, [r1, 0x1] + b _0803556A + .pool +_08035548: + adds r0, r5, 0x1 + ldrb r5, [r1, 0x3] + adds r0, r5 + lsls r0, 16 + lsrs r5, r0, 16 +_08035552: + adds r1, 0x1C + adds r3, 0x1 + cmp r3, r2 + bcc _0803552E +_0803555A: + adds r0, r5, r4 + adds r0, 0x1 + cmp r0, 0x80 + bgt _08035568 + lsls r0, r5, 24 + lsrs r0, 24 + b _0803556A +_08035568: + movs r0, 0xFF +_0803556A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8035518 + + thumb_func_start sub_8035570 +sub_8035570: @ 8035570 + push {r4-r6,lr} + adds r3, r0, 0 + movs r2, 0 + ldr r0, =0x02022e10 + ldr r0, [r0] + ldr r4, [r0] + cmp r2, r4 + bcs _080355AC + ldr r1, [r0, 0x4] + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r5, r0, r1 +_0803558A: + ldrb r0, [r1] + cmp r0, 0 + beq _080355A4 + cmp r2, r3 + beq _080355A4 + ldrh r0, [r1, 0x10] + ldrh r6, [r5, 0x10] + cmp r0, r6 + bne _080355A4 + movs r0, 0x1 + b _080355AE + .pool +_080355A4: + adds r1, 0x1C + adds r2, 0x1 + cmp r2, r4 + bcc _0803558A +_080355AC: + movs r0, 0 +_080355AE: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8035570 + + thumb_func_start sub_80355B4 +sub_80355B4: @ 80355B4 + push {r4-r6,lr} + adds r3, r0, 0 + movs r2, 0 + ldr r0, =0x02022e10 + ldr r0, [r0] + ldr r4, [r0] + cmp r2, r4 + bcs _080355F0 + ldr r1, [r0, 0x4] + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r5, r0, r1 +_080355CE: + ldrb r0, [r1] + cmp r0, 0 + beq _080355E8 + cmp r2, r3 + beq _080355E8 + ldrh r0, [r1, 0x12] + ldrh r6, [r5, 0x12] + cmp r0, r6 + bne _080355E8 + movs r0, 0x1 + b _080355F2 + .pool +_080355E8: + adds r1, 0x1C + adds r2, 0x1 + cmp r2, r4 + bcc _080355CE +_080355F0: + movs r0, 0 +_080355F2: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80355B4 + + thumb_func_start sub_80355F8 +sub_80355F8: @ 80355F8 + ldr r2, =gUnknown_082FF1C8 + lsls r0, 2 + adds r1, r0 + adds r1, r2 + ldrb r0, [r1] + bx lr + .pool + thumb_func_end sub_80355F8 + + thumb_func_start sub_8035608 +sub_8035608: @ 8035608 + push {lr} + bl ResetAllObjectData + ldr r0, =gUnknown_0831AC88 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + ldr r0, =sub_8035648 + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8035608 + + thumb_func_start sub_8035648 +sub_8035648: @ 8035648 + push {lr} + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + pop {r0} + bx r0 + thumb_func_end sub_8035648 + + thumb_func_start trs_config +trs_config: @ 8035658 + push {r4,lr} + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0831AA08 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 11 + ands r1, r0 + cmp r1, 0 + beq _080356A4 + ldr r0, =0x02024474 + adds r0, 0x24 + movs r1, 0x1 + strb r1, [r0] + ldr r4, =0x02023060 + ldr r1, [r4] + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, [r4] + movs r0, 0x2 + bl SetBgTilemapBuffer + b _080356AA + .pool +_080356A4: + ldr r0, =0x02024474 + adds r0, 0x24 + strb r1, [r0] +_080356AA: + ldr r1, =gUnknown_0831ABA0 + ldr r0, =0x02024474 + adds r0, 0x24 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl InitWindows + bl DeactivateAllTextPrinters + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end trs_config + + thumb_func_start c2_berry_program_update_menu +c2_berry_program_update_menu: @ 80356D0 + push {lr} + movs r0, 0x2 + bl DisableInterrupts + movs r0, 0xC5 + bl EnableInterrupts + bl trs_config + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + ldr r1, =0x0000b040 + movs r0, 0 + bl SetGpuReg + pop {r0} + bx r0 + .pool + thumb_func_end c2_berry_program_update_menu + + thumb_func_start sub_803570C +sub_803570C: @ 803570C + push {lr} + movs r0, 0x2 + movs r1, 0x12 + movs r2, 0x10 + bl sub_809882C + movs r0, 0x2 + movs r1, 0x22 + movs r2, 0x10 + bl sub_809882C + ldr r0, =gUnknown_08D85600 + movs r1, 0x50 + movs r2, 0x20 + bl decompress_palette + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _0803575A + movs r0, 0x70 + bl sub_81978B0 + movs r0, 0 + movs r1, 0x30 + movs r2, 0x70 + bl copy_textbox_border_tile_patterns_to_vram + ldr r0, =0x02037714 + adds r0, 0xEC + movs r1, 0 + strh r1, [r0] + ldr r1, =0x02037c00 + movs r2, 0x1 + bl CpuSet +_0803575A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_803570C + + thumb_func_start load_battle_oval_graphics +load_battle_oval_graphics: @ 8035770 + push {r4,r5,lr} + ldr r0, =0x02022fec + ldr r1, [r0] + ldr r0, =0x023f0902 + ands r0, r1 + cmp r0, 0 + beq _080357B0 + ldr r0, =gUnknown_08D7C440 + ldr r1, =0x06008000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7CA28 + ldr r1, =0x0600d000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7C9EC + b _08035A52 + .pool +_080357B0: + movs r0, 0x80 + lsls r0, 21 + ands r0, r1 + cmp r0, 0 + beq _080357E4 + ldr r0, =gUnknown_08D7BB14 + ldr r1, =0x06008000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7C154 + ldr r1, =0x0600d000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7DF30 + b _08035A52 + .pool +_080357E4: + movs r0, 0x80 + lsls r0, 22 + ands r0, r1 + cmp r0, 0 + beq _08035818 + ldr r0, =gUnknown_08D7A108 + ldr r1, =0x06008000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7A720 + ldr r1, =0x0600d000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7DEF4 + b _08035A52 + .pool +_08035818: + movs r0, 0x80 + lsls r0, 23 + ands r0, r1 + cmp r0, 0 + beq _0803584C + ldr r0, =gUnknown_08D7D590 + ldr r1, =0x06008000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7DC04 + ldr r1, =0x0600d000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7E234 + b _08035A52 + .pool +_0803584C: + movs r0, 0x8 + ands r1, r0 + cmp r1, 0 + beq _080358C4 + ldr r2, =gTrainers + ldr r0, =0x02038bca + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0x20 + bne _08035898 + ldr r0, =gUnknown_08D7C440 + ldr r1, =0x06008000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7CA28 + ldr r1, =0x0600d000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7DFC4 + b _08035A52 + .pool +_08035898: + cmp r0, 0x26 + bne _080358C4 + ldr r0, =gUnknown_08D7CCD8 + ldr r1, =0x06008000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7D2E0 + ldr r1, =0x0600d000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7E1F8 + b _08035A52 + .pool +_080358C4: + bl sav1_map_get_battletype + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x8 + bhi _08035904 + lsls r0, 2 + ldr r1, =_080358E0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080358E0: + .4byte _08035904 + .4byte _08035950 + .4byte _08035978 + .4byte _080359A0 + .4byte _080359C8 + .4byte _080359F0 + .4byte _08035A18 + .4byte _08035A40 + .4byte _08035A70 +_08035904: + ldr r4, =gUnknown_0831ABA8 + ldr r5, =0x02022ff0 + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + ldr r1, =0x06008000 + bl LZDecompressVram + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0x4 + adds r0, r1 + ldr r0, [r0] + ldr r1, =0x0600d000 + bl LZDecompressVram + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r4, 0x10 + adds r0, r4 + ldr r0, [r0] + b _08035A52 + .pool +_08035950: + ldr r0, =gUnknown_08D7C440 + ldr r1, =0x06008000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7CA28 + ldr r1, =0x0600d000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7DF88 + b _08035A52 + .pool +_08035978: + ldr r0, =gUnknown_08D7CCD8 + ldr r1, =0x06008000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7D2E0 + ldr r1, =0x0600d000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7E060 + b _08035A52 + .pool +_080359A0: + ldr r0, =gUnknown_08D7CCD8 + ldr r1, =0x06008000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7D2E0 + ldr r1, =0x0600d000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7E000 + b _08035A52 + .pool +_080359C8: + ldr r0, =gUnknown_08D7CCD8 + ldr r1, =0x06008000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7D2E0 + ldr r1, =0x0600d000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7E0CC + b _08035A52 + .pool +_080359F0: + ldr r0, =gUnknown_08D7CCD8 + ldr r1, =0x06008000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7D2E0 + ldr r1, =0x0600d000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7E11C + b _08035A52 + .pool +_08035A18: + ldr r0, =gUnknown_08D7CCD8 + ldr r1, =0x06008000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7D2E0 + ldr r1, =0x0600d000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7E164 + b _08035A52 + .pool +_08035A40: + ldr r0, =gUnknown_08D7CCD8 + ldr r1, =0x06008000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7D2E0 + ldr r1, =0x0600d000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7E1A8 +_08035A52: + movs r1, 0x20 + movs r2, 0x60 + bl decompress_palette + b _08035A8A + .pool +_08035A70: + ldr r0, =gUnknown_08D7C440 + ldr r1, =0x06008000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7CA28 + ldr r1, =0x0600d000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7C9EC + movs r1, 0x20 + movs r2, 0x60 + bl decompress_palette +_08035A8A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end load_battle_oval_graphics + + thumb_func_start sub_8035AA4 +sub_8035AA4: @ 8035AA4 + push {lr} + ldr r0, =gUnknown_08C00000 + movs r1, 0xC0 + lsls r1, 19 + bl LZDecompressVram + ldr r1, =gUnknown_08C00524 + movs r0, 0 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldr r0, =gUnknown_08C004E0 + movs r1, 0 + movs r2, 0x40 + bl decompress_palette + bl sub_803570C + bl load_battle_oval_graphics + pop {r0} + bx r0 + .pool + thumb_func_end sub_8035AA4 + + thumb_func_start sub_8035AE4 +sub_8035AE4: @ 8035AE4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x18 + ldr r4, [sp, 0x34] + lsls r0, 24 + lsrs r6, r0, 24 + adds r7, r6, 0 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r3, 24 + mov r12, r3 + lsls r4, 24 + lsrs r4, 24 + mov r9, r4 + movs r4, 0 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08035BCC + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + movs r2, 0x12 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _08035B56 + cmp r5, 0x1 + beq _08035B7E + cmp r5, 0x1 + bgt _08035B44 + cmp r5, 0 + beq _08035B4E + b _08035B88 + .pool +_08035B44: + cmp r5, 0x2 + beq _08035B52 + cmp r5, 0x3 + beq _08035B72 + b _08035B88 +_08035B4E: + ldrh r0, [r1, 0xE] + b _08035B74 +_08035B52: + ldrh r1, [r1, 0xE] + b _08035B80 +_08035B56: + cmp r5, 0x1 + beq _08035B72 + cmp r5, 0x1 + bgt _08035B64 + cmp r5, 0 + beq _08035B6E + b _08035B88 +_08035B64: + cmp r5, 0x2 + beq _08035B7A + cmp r5, 0x3 + beq _08035B7E + b _08035B88 +_08035B6E: + ldrh r0, [r1, 0xE] + b _08035B74 +_08035B72: + ldrh r0, [r1, 0x10] +_08035B74: + movs r4, 0x3F + ands r4, r0 + b _08035B88 +_08035B7A: + ldrh r1, [r1, 0xE] + b _08035B80 +_08035B7E: + ldrh r1, [r1, 0x10] +_08035B80: + movs r0, 0xFC + lsls r0, 4 + ands r0, r1 + lsrs r4, r0, 6 +_08035B88: + movs r2, 0 + movs r6, 0x3 + ldr r0, =0x00006001 + adds r5, r0, 0 + add r3, sp, 0xC +_08035B92: + lsls r1, r2, 1 + adds r0, r6, 0 + lsls r0, r1 + ands r0, r4 + asrs r0, r1 + adds r0, r5 + strh r0, [r3] + adds r3, 0x2 + adds r2, 0x1 + cmp r2, 0x2 + ble _08035B92 + movs r0, 0x3 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + mov r0, r8 + add r1, sp, 0xC + mov r2, r12 + mov r3, r9 + bl CopyToBgTilemapBufferRect_ChangePalette + mov r0, r8 + bl CopyBgTilemapBufferToVram + b _08035C36 + .pool +_08035BCC: + ldr r0, =0x02024474 + adds r0, 0x25 + ldrb r0, [r0] + cmp r5, r0 + bne _08035BEC + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldrh r4, [r0, 0xE] + b _08035BF8 + .pool +_08035BEC: + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldrh r4, [r0, 0x10] +_08035BF8: + movs r2, 0 + movs r6, 0x3 + ldr r0, =0x00006001 + adds r5, r0, 0 + add r3, sp, 0xC +_08035C02: + lsls r1, r2, 1 + adds r0, r6, 0 + lsls r0, r1 + ands r0, r4 + asrs r0, r1 + adds r0, r5 + strh r0, [r3] + adds r3, 0x2 + adds r2, 0x1 + cmp r2, 0x5 + ble _08035C02 + movs r0, 0x6 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + mov r0, r8 + add r1, sp, 0xC + mov r2, r12 + mov r3, r9 + bl CopyToBgTilemapBufferRect_ChangePalette + mov r0, r8 + bl CopyBgTilemapBufferToVram +_08035C36: + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8035AE4 + + thumb_func_start sub_8035C4C +sub_8035C4C: @ 8035C4C + push {lr} + ldr r0, =0x0202433a + ldrb r2, [r0] + cmp r2, 0x3 + bne _08035C68 + ldr r0, =gUnknown_085CCBAD + movs r1, 0x15 + bl battle_show_message_maybe + b _08035D68 + .pool +_08035C68: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08035CE2 + cmp r2, 0x1 + bne _08035CAE + ldr r2, =0x020229e8 + ldr r0, =0x02024474 + adds r0, 0x25 + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x18] + cmp r0, 0x1 + beq _08035CFC + cmp r0, 0x1 + bgt _08035CA4 + cmp r0, 0 + beq _08035D36 + b _08035D68 + .pool +_08035CA4: + cmp r0, 0x2 + beq _08035D36 + cmp r0, 0x3 + bne _08035D68 + b _08035CFC +_08035CAE: + ldr r2, =0x020229e8 + ldr r0, =0x02024474 + adds r0, 0x25 + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x18] + cmp r0, 0x1 + beq _08035D36 + cmp r0, 0x1 + bgt _08035CD8 + cmp r0, 0 + beq _08035CFC + b _08035D68 + .pool +_08035CD8: + cmp r0, 0x2 + beq _08035CFC + cmp r0, 0x3 + bne _08035D68 + b _08035D36 +_08035CE2: + cmp r2, 0x1 + bne _08035D20 + ldr r2, =0x020229e8 + ldr r0, =0x02024474 + adds r0, 0x25 + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x18] + cmp r0, 0 + beq _08035D36 +_08035CFC: + ldr r0, =gUnknown_085CCB9E + movs r1, 0x17 + bl battle_show_message_maybe + ldr r0, =gUnknown_085CCBA5 + movs r1, 0x16 + bl battle_show_message_maybe + b _08035D68 + .pool +_08035D20: + ldr r2, =0x020229e8 + ldr r0, =0x02024474 + adds r0, 0x25 + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x18] + cmp r0, 0 + beq _08035D58 +_08035D36: + ldr r0, =gUnknown_085CCB9E + movs r1, 0x16 + bl battle_show_message_maybe + ldr r0, =gUnknown_085CCBA5 + movs r1, 0x17 + bl battle_show_message_maybe + b _08035D68 + .pool +_08035D58: + ldr r0, =gUnknown_085CCB9E + movs r1, 0x17 + bl battle_show_message_maybe + ldr r0, =gUnknown_085CCBA5 + movs r1, 0x16 + bl battle_show_message_maybe +_08035D68: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8035C4C + + thumb_func_start task00_0800F6FC +task00_0800F6FC: @ 8035D74 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r7, 2 + mov r8, r0 + adds r0, r7 + lsls r0, 3 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + bne _08035D96 + b _08035EC4 +_08035D96: + cmp r0, 0x1 + bgt _08035DA4 + cmp r0, 0 + beq _08035DAC + b _08036138 + .pool +_08035DA4: + cmp r0, 0x2 + bne _08035DAA + b _08035F64 +_08035DAA: + b _08036138 +_08035DAC: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08035E44 + movs r5, 0 + movs r6, 0x3 +_08035DBC: + ldr r0, =0x020229f0 + adds r1, r5, r0 + subs r0, 0x8 + adds r4, r5, r0 + ldrh r0, [r4, 0x18] + cmp r0, 0x1 + beq _08035DF4 + cmp r0, 0x1 + bgt _08035DDC + cmp r0, 0 + beq _08035DE6 + b _08035E3A + .pool +_08035DDC: + cmp r0, 0x2 + beq _08035E08 + cmp r0, 0x3 + beq _08035E22 + b _08035E3A +_08035DE6: + adds r0, r1, 0 + movs r1, 0x11 + bl battle_show_message_maybe + ldrb r1, [r4, 0x18] + movs r0, 0x4 + b _08035E14 +_08035DF4: + adds r0, r1, 0 + movs r1, 0x12 + bl battle_show_message_maybe + ldrb r1, [r4, 0x18] + movs r0, 0x4 + str r0, [sp] + adds r0, r7, 0 + movs r2, 0x2 + b _08035E1A +_08035E08: + adds r0, r1, 0 + movs r1, 0x13 + bl battle_show_message_maybe + ldrb r1, [r4, 0x18] + movs r0, 0x8 +_08035E14: + str r0, [sp] + adds r0, r7, 0 + movs r2, 0x1 +_08035E1A: + movs r3, 0x2 + bl sub_8035AE4 + b _08035E3A +_08035E22: + adds r0, r1, 0 + movs r1, 0x14 + bl battle_show_message_maybe + ldrb r1, [r4, 0x18] + movs r0, 0x8 + str r0, [sp] + adds r0, r7, 0 + movs r2, 0x2 + movs r3, 0x2 + bl sub_8035AE4 +_08035E3A: + adds r5, 0x1C + subs r6, 0x1 + cmp r6, 0 + bge _08035DBC + b _08035EA6 +_08035E44: + ldr r0, =0x02024474 + adds r0, 0x25 + ldrb r5, [r0] + movs r0, 0x1 + adds r6, r5, 0 + eors r6, r0 + adds r1, r6, 0 + ldr r4, =0x020229e8 + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x18] + cmp r0, 0 + beq _08035E66 + adds r6, r5, 0 + adds r5, r1, 0 +_08035E66: + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r4, 0x8 + adds r1, r0, r4 + adds r0, r1, 0 + movs r1, 0xF + bl battle_show_message_maybe + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 2 + adds r1, r0, r4 + adds r0, r1, 0 + movs r1, 0x10 + bl battle_show_message_maybe + movs r4, 0x7 + str r4, [sp] + adds r0, r7, 0 + adds r1, r5, 0 + movs r2, 0x1 + movs r3, 0x2 + bl sub_8035AE4 + str r4, [sp] + adds r0, r7, 0 + adds r1, r6, 0 + movs r2, 0x2 + movs r3, 0x2 + bl sub_8035AE4 +_08035EA6: + ldr r0, =0x03005e00 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _08036138 + .pool +_08035EC4: + ldr r0, =0x00002710 + bl AllocObjectPalette + lsls r0, 24 + ldr r2, =0x02037714 + lsrs r0, 19 + ldr r3, =0x0000021e + adds r0, r3 + adds r2, r0, r2 + ldr r1, =0x02037b14 + adds r0, r1 + ldr r1, =0x00007fff + strh r1, [r0] + strh r1, [r2] + ldr r0, =gUnknown_0831A9D0 + movs r1, 0x6F + movs r2, 0x50 + movs r3, 0 + bl AddObjectToFront + ldr r4, =0x0202449c + ldr r1, [r4] + adds r1, 0x7D + strb r0, [r1] + ldr r0, =gUnknown_0831A9E8 + movs r1, 0x81 + movs r2, 0x50 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r4] + adds r1, 0x7E + strb r0, [r1] + ldr r3, =0x02020630 + ldr r0, [r4] + adds r0, 0x7D + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x7E + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + b _08036138 + .pool +_08035F64: + movs r1, 0x12 + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _08035FCC + ldr r4, =0x02022e18 + ldrh r0, [r5, 0xA] + bl sine2 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _08035F7E + adds r0, 0x1F +_08035F7E: + asrs r1, r0, 5 + movs r2, 0x14 + negs r2, r2 + adds r0, r2, 0 + subs r0, r1 + strh r0, [r4] + ldr r4, =0x02022e1c + ldrh r0, [r5, 0xC] + bl sine2 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _08035F9C + adds r0, 0x1F +_08035F9C: + asrs r1, r0, 5 + movs r3, 0x8C + negs r3, r3 + adds r0, r3, 0 + subs r0, r1 + strh r0, [r4] + ldr r0, =0x02022e1a + ldr r2, =0x0000ffdc + adds r1, r2, 0 + strh r1, [r0] + ldr r0, =0x02022e1e + strh r1, [r0] + b _08036038 + .pool +_08035FCC: + ldr r4, =0x02022e18 + ldrh r0, [r5, 0xA] + bl sine2 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _08035FDE + adds r0, 0x1F +_08035FDE: + asrs r1, r0, 5 + movs r3, 0x14 + negs r3, r3 + adds r0, r3, 0 + subs r0, r1 + strh r0, [r4] + ldr r4, =0x02022e1a + ldrh r0, [r5, 0xA] + bl cosine2 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _08035FFC + adds r0, 0x1F +_08035FFC: + asrs r0, 5 + subs r0, 0xA4 + strh r0, [r4] + ldr r4, =0x02022e1c + ldrh r0, [r5, 0xC] + bl sine2 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _08036014 + adds r0, 0x1F +_08036014: + asrs r1, r0, 5 + movs r2, 0x8C + negs r2, r2 + adds r0, r2, 0 + subs r0, r1 + strh r0, [r4] + ldr r4, =0x02022e1e + ldrh r0, [r5, 0xC] + bl cosine2 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _08036032 + adds r0, 0x1F +_08036032: + asrs r0, 5 + subs r0, 0xA4 + strh r0, [r4] +_08036038: + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r1, r0, r1 + ldrh r0, [r1, 0xC] + movs r2, 0xC + ldrsh r3, [r1, r2] + mov r8, r3 + cmp r3, 0 + beq _08036070 + subs r0, 0x2 + strh r0, [r1, 0xC] + ldrh r0, [r1, 0xA] + adds r0, 0x2 + strh r0, [r1, 0xA] + b _08036138 + .pool +_08036070: + movs r3, 0x12 + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _0803607C + bl sub_8035C4C +_0803607C: + movs r0, 0x78 + bl audio_play + adds r0, r7, 0 + bl remove_task + ldr r4, =0x02020630 + ldr r5, =0x0202449c + ldr r0, [r5] + adds r0, 0x7D + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + ldr r0, [r5] + adds r0, 0x7E + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + ldr r5, [r5] + adds r6, r5, 0 + adds r6, 0x7E + ldrb r0, [r6] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r4 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x40 + ldr r7, =0x000003ff + adds r0, r7, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r3 + orrs r0, r1 + strh r0, [r2, 0x4] + adds r5, 0x7D + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + mov r1, r8 + strh r1, [r0, 0x2E] + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + strh r1, [r0, 0x2E] + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x20] + strh r1, [r0, 0x30] + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x20] + strh r1, [r0, 0x30] + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + mov r2, r8 + strh r2, [r0, 0x32] + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r2, [r0, 0x32] +_08036138: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end task00_0800F6FC + + thumb_func_start sub_8036154 +sub_8036154: @ 8036154 + push {r4,r5,lr} + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08036208 + ldr r0, =gUnknown_08D778F0 + ldr r1, =0x06004000 + bl LZDecompressVram + ldr r0, =gUnknown_08D77B0C + ldr r1, =0x06010000 + bl LZDecompressVram + ldr r0, =gUnknown_08D77AE4 + movs r1, 0x60 + movs r2, 0x20 + bl decompress_palette + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0x1 + bl SetBgAttribute + ldr r1, =0x00005c04 + movs r0, 0xA + bl SetGpuReg + ldr r4, =gUnknown_08D779D8 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + movs r0, 0x2 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + movs r0, 0x48 + movs r1, 0x36 + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x36 + bl SetGpuReg + ldr r0, =0x02022e1a + ldr r2, =0x0000ff5c + adds r1, r2, 0 + strh r1, [r0] + ldr r0, =0x02022e1e + strh r1, [r0] + ldr r0, =gUnknown_0831AA00 + bl LoadCompressedObjectPicUsingHeap + b _080363AC + .pool +_08036208: + ldr r0, =0x023f0902 + ands r0, r1 + cmp r0, 0 + beq _0803628C + movs r0, 0x80 + lsls r0, 15 + ands r1, r0 + cmp r1, 0 + beq _08036224 + ldr r0, =0x02038bce + ldrh r1, [r0] + ldr r0, =0x00000c03 + cmp r1, r0 + bne _08036248 +_08036224: + ldr r0, =gUnknown_08D820D4 + ldr r1, =0x06004000 + bl LZDecompressVram + ldr r0, =gUnknown_08D824E4 + b _08036382 + .pool +_08036248: + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x2 + bl SetBgAttribute + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0x2 + bl SetBgAttribute + ldr r1, =gUnknown_08D857A8 + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + ldr r1, =gUnknown_08D85A1C + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + b _080363AC + .pool +_0803628C: + movs r0, 0x80 + lsls r0, 21 + ands r0, r1 + cmp r0, 0 + beq _080362B0 + ldr r0, =gUnknown_08D81610 + ldr r1, =0x06004000 + bl LZDecompressVram + ldr r0, =gUnknown_08D81E2C + b _08036382 + .pool +_080362B0: + movs r0, 0x80 + lsls r0, 22 + ands r0, r1 + cmp r0, 0 + beq _080362D4 + ldr r0, =gUnknown_08D7F9F8 + ldr r1, =0x06004000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7FEC4 + b _08036382 + .pool +_080362D4: + movs r0, 0x80 + lsls r0, 23 + ands r0, r1 + cmp r0, 0 + beq _080362F8 + ldr r0, =gUnknown_08D82608 + ldr r1, =0x06004000 + bl LZDecompressVram + ldr r0, =gUnknown_08D82C70 + b _08036382 + .pool +_080362F8: + movs r0, 0x8 + ands r1, r0 + cmp r1, 0 + beq _08036350 + ldr r2, =gTrainers + ldr r0, =0x02038bca + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0x20 + bne _08036334 + ldr r0, =gUnknown_08D820D4 + ldr r1, =0x06004000 + bl LZDecompressVram + ldr r0, =gUnknown_08D824E4 + b _08036382 + .pool +_08036334: + cmp r0, 0x26 + bne _08036350 + ldr r0, =gUnknown_08D820D4 + ldr r1, =0x06004000 + bl LZDecompressVram + ldr r0, =gUnknown_08D824E4 + b _08036382 + .pool +_08036350: + bl sav1_map_get_battletype + lsls r0, 24 + cmp r0, 0 + bne _0803639C + ldr r4, =gUnknown_0831ABA8 + ldr r5, =0x02022ff0 + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x8 + adds r0, r1 + ldr r0, [r0] + ldr r1, =0x06004000 + bl LZDecompressVram + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r4, 0xC + adds r0, r4 + ldr r0, [r0] +_08036382: + ldr r1, =0x0600e000 + bl LZDecompressVram + b _080363AC + .pool +_0803639C: + ldr r0, =gUnknown_08D820D4 + ldr r1, =0x06004000 + bl LZDecompressVram + ldr r0, =gUnknown_08D824E4 + ldr r1, =0x0600e000 + bl LZDecompressVram +_080363AC: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8036154 + + thumb_func_start sub_80363C4 +sub_80363C4: @ 80363C4 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + movs r4, 0 + cmp r0, 0x6 + bls _080363D2 + b _08036756 +_080363D2: + lsls r0, 2 + ldr r1, =_080363E0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080363E0: + .4byte _080363FC + .4byte _0803640C + .4byte _08036424 + .4byte _08036434 + .4byte _0803652C + .4byte _08036638 + .4byte _08036750 +_080363FC: + ldr r0, =gUnknown_08C00000 + movs r1, 0xC0 + lsls r1, 19 + bl LZDecompressVram + b _08036758 + .pool +_0803640C: + ldr r1, =gUnknown_08C00524 + movs r0, 0 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + movs r0, 0 + bl CopyBgTilemapBufferToVram + b _08036758 + .pool +_08036424: + ldr r0, =gUnknown_08C004E0 + movs r1, 0 + movs r2, 0x40 + bl decompress_palette + b _08036758 + .pool +_08036434: + ldr r0, =0x02022fec + ldr r1, [r0] + ldr r0, =0x023f0902 + ands r0, r1 + cmp r0, 0 + bne _08036518 + movs r0, 0x80 + lsls r0, 21 + ands r0, r1 + cmp r0, 0 + beq _0803645C + ldr r0, =gUnknown_08D7BB14 + b _0803651A + .pool +_0803645C: + movs r0, 0x8 + ands r1, r0 + cmp r1, 0 + beq _0803648C + ldr r2, =gTrainers + ldr r0, =0x02038bca + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0x20 + beq _08036518 + cmp r0, 0x26 + bne _0803648C + ldr r0, =gUnknown_08D7CCD8 + b _0803651A + .pool +_0803648C: + bl sav1_map_get_battletype + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x8 + bhi _080364CC + lsls r0, 2 + ldr r1, =_080364A8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080364A8: + .4byte _080364CC + .4byte _08036518 + .4byte _080364E8 + .4byte _080364F0 + .4byte _080364F8 + .4byte _08036500 + .4byte _08036508 + .4byte _08036510 + .4byte _08036518 +_080364CC: + ldr r2, =gUnknown_0831ABA8 + ldr r0, =0x02022ff0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + b _0803651A + .pool +_080364E8: + ldr r0, =gUnknown_08D7CCD8 + b _0803651A + .pool +_080364F0: + ldr r0, =gUnknown_08D7CCD8 + b _0803651A + .pool +_080364F8: + ldr r0, =gUnknown_08D7CCD8 + b _0803651A + .pool +_08036500: + ldr r0, =gUnknown_08D7CCD8 + b _0803651A + .pool +_08036508: + ldr r0, =gUnknown_08D7CCD8 + b _0803651A + .pool +_08036510: + ldr r0, =gUnknown_08D7CCD8 + b _0803651A + .pool +_08036518: + ldr r0, =gUnknown_08D7C440 +_0803651A: + ldr r1, =0x06008000 + bl LZDecompressVram + b _08036758 + .pool +_0803652C: + ldr r0, =0x02022fec + ldr r1, [r0] + ldr r0, =0x023f0902 + ands r0, r1 + cmp r0, 0 + beq _0803653A + b _08036624 +_0803653A: + movs r0, 0x80 + lsls r0, 5 + ands r0, r1 + cmp r0, 0 + beq _08036568 + ldr r0, =gUnknown_82E9530 + ldrb r0, [r0] + cmp r0, 0x2 + bne _08036560 + ldr r0, =gUnknown_08D7C154 + b _08036626 + .pool +_08036560: + ldr r0, =gUnknown_08D7A720 + b _08036626 + .pool +_08036568: + movs r0, 0x8 + ands r1, r0 + cmp r1, 0 + beq _08036598 + ldr r2, =gTrainers + ldr r0, =0x02038bca + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0x20 + beq _08036624 + cmp r0, 0x26 + bne _08036598 + ldr r0, =gUnknown_08D7D2E0 + b _08036626 + .pool +_08036598: + bl sav1_map_get_battletype + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x8 + bhi _080365D8 + lsls r0, 2 + ldr r1, =_080365B4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080365B4: + .4byte _080365D8 + .4byte _08036624 + .4byte _080365F4 + .4byte _080365FC + .4byte _08036604 + .4byte _0803660C + .4byte _08036614 + .4byte _0803661C + .4byte _08036624 +_080365D8: + ldr r2, =gUnknown_0831ABA8 + ldr r0, =0x02022ff0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x4 + adds r0, r2 + ldr r0, [r0] + b _08036626 + .pool +_080365F4: + ldr r0, =gUnknown_08D7D2E0 + b _08036626 + .pool +_080365FC: + ldr r0, =gUnknown_08D7D2E0 + b _08036626 + .pool +_08036604: + ldr r0, =gUnknown_08D7D2E0 + b _08036626 + .pool +_0803660C: + ldr r0, =gUnknown_08D7D2E0 + b _08036626 + .pool +_08036614: + ldr r0, =gUnknown_08D7D2E0 + b _08036626 + .pool +_0803661C: + ldr r0, =gUnknown_08D7D2E0 + b _08036626 + .pool +_08036624: + ldr r0, =gUnknown_08D7CA28 +_08036626: + ldr r1, =0x0600d000 + bl LZDecompressVram + b _08036758 + .pool +_08036638: + ldr r0, =0x02022fec + ldr r1, [r0] + ldr r0, =0x023f0902 + ands r0, r1 + cmp r0, 0 + beq _08036646 + b _08036740 +_08036646: + movs r0, 0x80 + lsls r0, 5 + ands r0, r1 + cmp r0, 0 + beq _08036674 + ldr r0, =gUnknown_82E9530 + ldrb r0, [r0] + cmp r0, 0x2 + bne _0803666C + ldr r0, =gUnknown_08D7DF30 + b _08036742 + .pool +_0803666C: + ldr r0, =gUnknown_08D7DEF4 + b _08036742 + .pool +_08036674: + movs r0, 0x8 + ands r1, r0 + cmp r1, 0 + beq _080366AC + ldr r2, =gTrainers + ldr r0, =0x02038bca + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0x20 + bne _080366A0 + ldr r0, =gUnknown_08D7DFC4 + b _08036742 + .pool +_080366A0: + cmp r0, 0x26 + bne _080366AC + ldr r0, =gUnknown_08D7E1F8 + b _08036742 + .pool +_080366AC: + bl sav1_map_get_battletype + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x8 + bhi _080366EC + lsls r0, 2 + ldr r1, =_080366C8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080366C8: + .4byte _080366EC + .4byte _08036708 + .4byte _08036710 + .4byte _08036718 + .4byte _08036720 + .4byte _08036728 + .4byte _08036730 + .4byte _08036738 + .4byte _08036740 +_080366EC: + ldr r2, =gUnknown_0831ABA8 + ldr r0, =0x02022ff0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x10 + adds r0, r2 + ldr r0, [r0] + b _08036742 + .pool +_08036708: + ldr r0, =gUnknown_08D7DF88 + b _08036742 + .pool +_08036710: + ldr r0, =gUnknown_08D7E060 + b _08036742 + .pool +_08036718: + ldr r0, =gUnknown_08D7E000 + b _08036742 + .pool +_08036720: + ldr r0, =gUnknown_08D7E0CC + b _08036742 + .pool +_08036728: + ldr r0, =gUnknown_08D7E11C + b _08036742 + .pool +_08036730: + ldr r0, =gUnknown_08D7E164 + b _08036742 + .pool +_08036738: + ldr r0, =gUnknown_08D7E1A8 + b _08036742 + .pool +_08036740: + ldr r0, =gUnknown_08D7C9EC +_08036742: + movs r1, 0x20 + movs r2, 0x60 + bl decompress_palette + b _08036758 + .pool +_08036750: + bl sub_803570C + b _08036758 +_08036756: + movs r4, 0x1 +_08036758: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80363C4 + + thumb_func_start sub_8036760 +sub_8036760: @ 8036760 + push {lr} + bl saveblock_randomize_and_relocate + bl sub_8056F28 + bl dp11_init + bl init_uns_table_pokemon_copy + bl sub_8185F84 + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080367CC + movs r0, 0x80 + lsls r0, 17 + ands r0, r1 + cmp r0, 0 + beq _08036798 + bl sub_80367D4 + b _080367BA + .pool +_08036798: + movs r0, 0x80 + lsls r0, 15 + ands r1, r0 + cmp r1, 0 + bne _080367B4 + bl battle_wireless_setup_if_required_maybe + ldr r0, =sub_8037ADC + bl SetMainCallback2 + b _080367BA + .pool +_080367B4: + ldr r0, =intro_end + bl SetMainCallback2 +_080367BA: + ldr r1, =0x02024332 + movs r0, 0 + strb r0, [r1] + b _080367D0 + .pool +_080367CC: + bl sub_80367D4 +_080367D0: + pop {r0} + bx r0 + thumb_func_end sub_8036760 + + thumb_func_start sub_80367D4 +sub_80367D4: @ 80367D4 + push {r4,r5,lr} + sub sp, 0x4 + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + str r0, [sp] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x05006000 + mov r0, sp + bl CpuSet + movs r0, 0x4C + movs r1, 0 + bl SetGpuReg + movs r0, 0x40 + movs r1, 0xF0 + bl SetGpuReg + ldr r1, =0x00005051 + movs r0, 0x44 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4A + movs r1, 0 + bl SetGpuReg + ldr r0, =0x02022e24 + movs r2, 0xF0 + strh r2, [r0] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _08036870 + ldr r0, =0x02038bce + ldrh r1, [r0] + ldr r0, =0x00000c03 + cmp r1, r0 + beq _08036870 + ldr r1, =0x02022e26 + movs r0, 0x9F + strh r0, [r1] + ldr r0, =0x02022e28 + strh r2, [r0] + ldr r1, =0x02022e2a + movs r0, 0x20 + strh r0, [r1] + b _080368BE + .pool +_08036870: + ldr r0, =0x02022e26 + ldr r2, =0x00005051 + adds r1, r2, 0 + strh r1, [r0] + bl dp12_8087EA4 + ldr r0, =0x02038c28 + movs r3, 0xF0 + movs r5, 0xF0 + lsls r5, 3 + adds r2, r0, r5 + movs r1, 0x4F +_08036888: + strh r3, [r0] + strh r3, [r2] + adds r2, 0x2 + adds r0, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _08036888 + movs r1, 0x50 + ldr r4, =gUnknown_0831AC70 + ldr r0, =0x02038c28 + ldr r3, =0x0000ff10 + movs r5, 0x82 + lsls r5, 4 + adds r2, r0, r5 + adds r0, 0xA0 +_080368A6: + strh r3, [r0] + strh r3, [r2] + adds r2, 0x2 + adds r0, 0x2 + adds r1, 0x1 + cmp r1, 0x9F + ble _080368A6 + ldr r0, [r4] + ldr r1, [r4, 0x4] + ldr r2, [r4, 0x8] + bl sub_80BA038 +_080368BE: + bl sub_80A1A74 + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r0, =0x02022e18 + strh r1, [r0] + ldr r0, =0x02022e1a + strh r1, [r0] + ldr r0, =0x02022e1c + strh r1, [r0] + ldr r0, =0x02022e1e + strh r1, [r0] + ldr r0, =0x02022e20 + strh r1, [r0] + ldr r0, =0x02022e22 + strh r1, [r0] + bl sub_80B0BD0 + ldr r2, =0x02022ff0 + strb r0, [r2] + ldr r4, =0x02022fec + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _080368FE + movs r0, 0x8 + strb r0, [r2] +_080368FE: + bl c2_berry_program_update_menu + bl sub_8035AA4 + bl ResetAllObjectData + bl clear_tasks + bl sub_8036154 + bl ResetObjectPaletteAllocator + ldr r1, =0x0300301c + movs r0, 0x4 + strb r0, [r1] + ldr r0, =vblank_cb_08078BB4 + bl SetVBlankCallback + bl sub_803269C + ldr r2, [r4] + movs r1, 0xA0 + lsls r1, 1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, r1 + beq _0803693E + ldr r1, =0x00400040 + adds r0, r2, 0 + ands r0, r1 + cmp r0, r1 + bne _08036994 +_0803693E: + ldr r0, =sub_8037458 + bl SetMainCallback2 + b _080369AE + .pool +_08036994: + movs r0, 0x40 + ands r2, r0 + cmp r2, 0 + beq _080369A8 + ldr r0, =sub_8037DF4 + bl SetMainCallback2 + b _080369AE + .pool +_080369A8: + ldr r0, =sub_8036FAC + bl SetMainCallback2 +_080369AE: + ldr r5, =0x02022fec + ldr r0, [r5] + ldr r1, =0x01000002 + ands r0, r1 + cmp r0, 0 + bne _080369E8 + ldr r4, =0x02024744 + ldr r0, =0x02038bca + ldrh r1, [r0] + adds r0, r4, 0 + movs r2, 0x1 + bl LoadTrainerParty + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _080369E4 + movs r1, 0x96 + lsls r1, 1 + adds r0, r4, r1 + ldr r1, =0x02038bcc + ldrh r1, [r1] + movs r2, 0 + bl LoadTrainerParty +_080369E4: + bl sub_806EA68 +_080369E8: + ldr r1, =0x030022c0 + ldr r2, =0x00000439 + adds r1, r2 + ldrb r0, [r1] + movs r2, 0x2 + orrs r0, r2 + strb r0, [r1] + ldr r0, =0x03005d90 + ldr r1, [r0] + ldr r5, =0x00000ca9 + adds r1, r5 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r4, =0x020244ec + movs r0, 0xFA + lsls r0, 1 + adds r5, r4, r0 +_08036A10: + adds r0, r4, 0 + movs r1, 0x3 + bl happiness_algorithm + adds r4, 0x64 + cmp r4, r5 + ble _08036A10 + movs r1, 0 + ldr r0, =0x02024332 + strb r1, [r0] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80367D4 + + thumb_func_start sub_8036A5C +sub_8036A5C: @ 8036A5C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r6, 0 + mov r9, r6 + movs r0, 0xCE + lsls r0, 1 + mov r10, r0 + mov r8, r6 +_08036A72: + movs r0, 0x64 + mov r4, r9 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + lsls r0, 16 + lsrs r7, r0, 16 + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr + adds r1, r0, 0 + cmp r5, 0 + beq _08036AEE + cmp r5, r10 + beq _08036ABA + cmp r7, 0 + beq _08036ABA + cmp r1, 0 + bne _08036ABA + movs r0, 0x1 + mov r2, r8 + lsls r0, r2 + orrs r6, r0 + lsls r0, r6, 16 + lsrs r6, r0, 16 +_08036ABA: + cmp r5, 0 + beq _08036AEE + cmp r7, 0 + beq _08036AD6 + cmp r5, r10 + beq _08036ACA + cmp r1, 0 + beq _08036AD6 +_08036ACA: + movs r0, 0x2 + mov r1, r8 + lsls r0, r1 + orrs r6, r0 + lsls r0, r6, 16 + lsrs r6, r0, 16 +_08036AD6: + cmp r5, 0 + beq _08036AEE + cmp r5, r10 + beq _08036AEE + cmp r7, 0 + bne _08036AEE + movs r0, 0x3 + mov r2, r8 + lsls r0, r2 + orrs r6, r0 + lsls r0, r6, 16 + lsrs r6, r0, 16 +_08036AEE: + movs r0, 0x2 + add r8, r0 + movs r1, 0x1 + add r9, r1 + mov r2, r9 + cmp r2, 0x5 + ble _08036A72 + ldr r4, =0x0202449c + ldr r0, [r4] + movs r1, 0xC1 + lsls r1, 1 + adds r0, r1 + strb r6, [r0] + ldr r0, [r4] + ldr r5, =0x00000183 + adds r0, r5 + lsrs r1, r6, 8 + strb r1, [r0] + ldr r0, =0x000008d2 + bl FlagGet + ldr r1, [r4] + adds r1, r5 + lsls r0, 7 + ldrb r2, [r1] + orrs r0, r2 + strb r0, [r1] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8036A5C + + thumb_func_start sub_8036B44 +sub_8036B44: @ 8036B44 + push {r4-r7,lr} + ldr r0, =0x0202449c + ldr r5, [r0] + movs r0, 0xC2 + lsls r0, 1 + adds r4, r5, r0 + bl sub_80E162C + cmp r0, 0x1 + bne _08036BC0 + movs r2, 0 + ldr r7, =0x03005d8c + movs r1, 0xC6 + lsls r1, 1 + adds r5, r1 + adds r6, r7, 0 + ldr r3, =0x000031f8 +_08036B66: + adds r0, r4, r2 + ldr r1, [r6] + adds r1, r3 + adds r1, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x5 + ble _08036B66 + adds r1, r4, r2 + movs r0, 0xFF + strb r0, [r1] + movs r2, 0 + adds r3, r5, 0 + ldr r6, =0x03005d8c + ldr r5, =0x00003214 +_08036B86: + adds r0, r3, r2 + ldr r1, [r6] + adds r1, r5 + adds r1, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x11 + ble _08036B86 + ldr r0, [r7] + ldr r1, =0x00003226 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r4, 0x7] + ldr r0, [r7] + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + b _08036C00 + .pool +_08036BC0: + movs r0, 0xAF + bl ItemIdToBerryType + lsls r0, 24 + lsrs r0, 24 + bl GetBerryInfo + adds r3, r0, 0 + movs r2, 0 + movs r0, 0xC6 + lsls r0, 1 + adds r5, r0 +_08036BD8: + adds r0, r4, r2 + adds r1, r3, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x5 + ble _08036BD8 + adds r1, r4, r2 + movs r0, 0xFF + strb r0, [r1] + adds r0, r5, 0 + movs r2, 0 + adds r1, r0, 0 + adds r1, 0x11 +_08036BF4: + strb r2, [r1] + subs r1, 0x1 + cmp r1, r0 + bge _08036BF4 + movs r0, 0 + strb r0, [r4, 0x7] +_08036C00: + strb r0, [r4, 0x1A] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8036B44 + + thumb_func_start berry_801017C +berry_801017C: @ 8036C08 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08036C20 + b _08036D4C +_08036C20: + bl sub_80E162C + cmp r0, 0x1 + bne _08036CDC + movs r5, 0 + ldr r3, =0x02024404 + ldr r0, =0x03005d8c + mov r8, r0 + adds r6, r3, 0 + mov r4, r8 + ldr r2, =0x000031f8 + adds r7, r3, 0 + adds r7, 0x38 +_08036C3A: + adds r1, r5, r6 + ldr r0, [r4] + adds r0, r2 + adds r0, r5 + ldrb r0, [r0] + strb r0, [r1] + adds r1, r5, r7 + ldr r0, [r4] + adds r0, r2 + adds r0, r5 + ldrb r0, [r0] + strb r0, [r1] + adds r5, 0x1 + cmp r5, 0x5 + ble _08036C3A + adds r1, r5, r3 + movs r0, 0xFF + strb r0, [r1] + adds r0, r3, 0 + adds r0, 0x38 + adds r0, r5, r0 + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + movs r5, 0 + adds r7, r3, 0 + adds r7, 0x8 + ldr r4, =0x03005d8c + ldr r2, =0x00003214 + adds r6, r3, 0 + adds r6, 0x40 +_08036C78: + adds r1, r5, r7 + ldr r0, [r4] + adds r0, r2 + adds r0, r5 + ldrb r0, [r0] + strb r0, [r1] + adds r1, r5, r6 + ldr r0, [r4] + adds r0, r2 + adds r0, r5 + ldrb r0, [r0] + strb r0, [r1] + adds r5, 0x1 + cmp r5, 0x11 + ble _08036C78 + mov r1, r8 + ldr r0, [r1] + ldr r2, =0x00003226 + adds r0, r2 + ldrb r1, [r0] + strb r1, [r3, 0x7] + ldrb r0, [r0] + adds r1, r3, 0 + adds r1, 0x3F + strb r0, [r1] + mov r4, r8 + ldr r0, [r4] + ldr r1, =0x00003227 + adds r0, r1 + ldrb r1, [r0] + strb r1, [r3, 0x1A] + ldrb r1, [r0] + adds r0, r3, 0 + adds r0, 0x52 + strb r1, [r0] + b _08036EA0 + .pool +_08036CDC: + movs r0, 0xAF + bl ItemIdToBerryType + lsls r0, 24 + lsrs r0, 24 + bl GetBerryInfo + adds r6, r0, 0 + movs r5, 0 + ldr r4, =0x02024404 + adds r7, r4, 0 + adds r7, 0x38 + adds r3, r4, 0 +_08036CF6: + adds r1, r5, r4 + adds r2, r6, r5 + ldrb r0, [r2] + strb r0, [r1] + adds r1, r5, r7 + ldrb r0, [r2] + strb r0, [r1] + adds r5, 0x1 + cmp r5, 0x5 + ble _08036CF6 + adds r1, r5, r3 + movs r0, 0xFF + strb r0, [r1] + adds r0, r3, 0 + adds r0, 0x38 + adds r0, r5, r0 + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + movs r5, 0 + adds r4, r3, 0 + adds r4, 0x8 + movs r1, 0 + adds r2, r3, 0 + adds r2, 0x40 +_08036D28: + adds r0, r5, r4 + strb r1, [r0] + adds r0, r5, r2 + strb r1, [r0] + adds r5, 0x1 + cmp r5, 0x11 + ble _08036D28 + movs r1, 0 + strb r1, [r3, 0x7] + adds r0, r3, 0 + adds r0, 0x3F + strb r1, [r0] + strb r1, [r3, 0x1A] + adds r0, 0x13 + strb r1, [r0] + b _08036EA0 + .pool +_08036D4C: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08036DF0 + movs r0, 0x80 + lsls r0, 1 + ands r1, r0 + movs r2, 0x4 + mov r8, r2 + cmp r1, 0 + beq _08036D66 + movs r4, 0x2 + mov r8, r4 +_08036D66: + movs r5, 0 + cmp r5, r8 + blt _08036D6E + b _08036EA0 +_08036D6E: + ldr r0, =0x020229e8 + mov r12, r0 + ldr r3, =0x02024404 + adds r6, r3, 0 + movs r1, 0x8 + adds r1, r6 + mov r9, r1 +_08036D7C: + lsls r1, r5, 8 + ldr r0, =0x020223c8 + adds r7, r1, r0 + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + add r0, r12 + ldrb r3, [r0, 0x18] + movs r4, 0 + adds r5, 0x1 + mov r10, r5 + lsls r1, r3, 3 + subs r0, r1, r3 + adds r5, r1, 0 + lsls r0, 2 + adds r1, r0, r6 +_08036D9C: + adds r0, r7, r4 + ldrb r0, [r0] + strb r0, [r1] + adds r1, 0x1 + adds r4, 0x1 + cmp r4, 0x5 + ble _08036D9C + subs r0, r5, r3 + lsls r0, 2 + adds r1, r4, r0 + adds r1, r6 + movs r2, 0xFF + strb r2, [r1] + movs r4, 0 + mov r2, r9 + adds r1, r0, r2 + adds r2, r7, 0 + adds r2, 0x8 +_08036DC0: + adds r0, r2, r4 + ldrb r0, [r0] + strb r0, [r1] + adds r1, 0x1 + adds r4, 0x1 + cmp r4, 0x11 + ble _08036DC0 + subs r0, r5, r3 + lsls r0, 2 + adds r0, r6 + ldrb r1, [r7, 0x7] + strb r1, [r0, 0x7] + ldrb r1, [r7, 0x1A] + strb r1, [r0, 0x1A] + mov r5, r10 + cmp r5, r8 + blt _08036D7C + b _08036EA0 + .pool +_08036DF0: + movs r5, 0 + ldr r4, =0x02024404 + mov r9, r4 +_08036DF6: + lsls r0, r5, 8 + ldr r1, =0x020223c8 + adds r7, r0, r1 + movs r4, 0 + adds r2, r5, 0x1 + mov r10, r2 + lsls r0, r5, 3 + mov r8, r0 + adds r1, r5, 0x2 + mov r12, r1 + subs r1, r0, r5 + mov r2, r12 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + mov r2, r9 + adds r3, r0, r2 + lsls r1, 2 + adds r2, r1, r2 +_08036E1C: + adds r0, r7, r4 + ldrb r1, [r0] + strb r1, [r2] + ldrb r0, [r0] + strb r0, [r3] + adds r3, 0x1 + adds r2, 0x1 + adds r4, 0x1 + cmp r4, 0x5 + ble _08036E1C + mov r0, r8 + subs r3, r0, r5 + lsls r3, 2 + adds r1, r4, r3 + add r1, r9 + ldrb r0, [r1] + movs r2, 0xFF + orrs r0, r2 + strb r0, [r1] + mov r0, r12 + lsls r2, r0, 3 + subs r2, r0 + lsls r2, 2 + adds r1, r4, r2 + add r1, r9 + ldrb r0, [r1] + movs r4, 0xFF + orrs r0, r4 + strb r0, [r1] + movs r4, 0 + ldr r0, =0x02024404 + adds r0, 0x8 + adds r2, r0 + adds r3, r0 + adds r6, r7, 0 + adds r6, 0x8 +_08036E64: + adds r0, r6, r4 + ldrb r1, [r0] + strb r1, [r3] + ldrb r0, [r0] + strb r0, [r2] + adds r2, 0x1 + adds r3, 0x1 + adds r4, 0x1 + cmp r4, 0x11 + ble _08036E64 + mov r0, r8 + subs r2, r0, r5 + lsls r2, 2 + add r2, r9 + ldrb r0, [r7, 0x7] + strb r0, [r2, 0x7] + mov r1, r12 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r9 + ldrb r1, [r7, 0x7] + strb r1, [r0, 0x7] + ldrb r1, [r7, 0x1A] + strb r1, [r2, 0x1A] + ldrb r1, [r7, 0x1A] + strb r1, [r0, 0x1A] + mov r5, r10 + cmp r5, 0x1 + ble _08036DF6 +_08036EA0: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end berry_801017C + + thumb_func_start sub_8036EB8 +sub_8036EB8: @ 8036EB8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + movs r6, 0 + ldr r0, =0x020223c4 + ldrh r2, [r0] + movs r1, 0x80 + lsls r1, 1 + mov r12, r0 + cmp r2, r1 + bne _08036EFC + cmp r3, 0 + bne _08036EEC + ldr r0, =0x02022fec + ldr r1, [r0] + movs r2, 0xC + b _08036EF2 + .pool +_08036EEC: + ldr r0, =0x02022fec + ldr r1, [r0] + movs r2, 0x8 +_08036EF2: + orrs r1, r2 + str r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_08036EFC: + cmp r6, 0 + bne _08036FA0 + movs r2, 0 + cmp r2, r4 + bge _08036F20 + ldr r1, =0x020223c4 + mov r8, r1 + movs r5, 0x80 + lsls r5, 1 +_08036F0E: + adds r1, r5 + adds r2, 0x1 + cmp r2, r4 + bge _08036F20 + mov r7, r8 + ldrh r0, [r7] + ldrh r7, [r1] + cmp r0, r7 + beq _08036F0E +_08036F20: + cmp r2, r4 + bne _08036F48 + cmp r3, 0 + bne _08036F38 + ldr r0, =0x02022fec + ldr r1, [r0] + movs r2, 0xC + b _08036F3E + .pool +_08036F38: + ldr r0, =0x02022fec + ldr r1, [r0] + movs r2, 0x8 +_08036F3E: + orrs r1, r2 + str r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_08036F48: + cmp r6, 0 + bne _08036FA0 + movs r2, 0 + ldr r5, =0x02022fec + cmp r2, r4 + bge _08036F8A + mov r0, r12 + ldrh r1, [r0] + movs r0, 0xC0 + lsls r0, 2 + cmp r1, r0 + beq _08036F82 +_08036F60: + lsls r0, r2, 8 + add r0, r12 + ldrh r0, [r0] + movs r1, 0xC0 + lsls r1, 2 + cmp r0, r1 + bls _08036F72 + cmp r2, r3 + bne _08036F8A +_08036F72: + adds r2, 0x1 + cmp r2, r4 + bge _08036F8A + lsls r0, r2, 8 + add r0, r12 + ldrh r0, [r0] + cmp r0, r1 + bne _08036F60 +_08036F82: + cmp r2, r3 + beq _08036F60 + cmp r2, r3 + bge _08036F60 +_08036F8A: + cmp r2, r4 + bne _08036F98 + ldr r0, [r5] + movs r1, 0xC + b _08036F9C + .pool +_08036F98: + ldr r0, [r5] + movs r1, 0x8 +_08036F9C: + orrs r0, r1 + str r0, [r5] +_08036FA0: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8036EB8 + + thumb_func_start sub_8036FAC +sub_8036FAC: @ 8036FAC + push {r4-r6,lr} + bl RunActiveTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x02024474 + adds r0, 0x25 + strb r6, [r0] + movs r0, 0x1 + adds r5, r6, 0 + eors r5, r0 + ldr r0, =0x02024332 + ldrb r0, [r0] + cmp r0, 0x12 + bls _08036FD8 + b _0803744C +_08036FD8: + lsls r0, 2 + ldr r1, =_08036FF0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08036FF0: + .4byte _0803703C + .4byte _08037080 + .4byte _08037144 + .4byte _080371D8 + .4byte _08037200 + .4byte _0803742C + .4byte _08037438 + .4byte _08037230 + .4byte _08037258 + .4byte _0803742C + .4byte _08037438 + .4byte _08037288 + .4byte _080372B0 + .4byte _0803742C + .4byte _08037438 + .4byte _08037318 + .4byte _08037378 + .4byte _080373A0 + .4byte _080373E0 +_0803703C: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _08037068 + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + bl sub_805EF14 + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1] +_08037068: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _08037072 + b _0803744C +_08037072: + bl sub_800E0E8 + b _0803744C + .pool +_08037080: + ldr r2, =0x02022fec + ldr r1, [r2] + movs r6, 0x2 + adds r0, r1, 0 + ands r0, r6 + cmp r0, 0 + beq _08037124 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _08037098 + b _0803744C +_08037098: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080370EE + ldr r4, =0x0202449c + ldr r0, [r4] + movs r5, 0xC0 + lsls r5, 1 + adds r0, r5 + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + ldr r2, =0x00000181 + adds r1, r0, r2 + movs r0, 0x3 + strb r0, [r1] + bl sub_8036A5C + bl sub_8036B44 + ldr r0, =0x02038bca + ldrh r1, [r0] + movs r0, 0xC0 + lsls r0, 4 + cmp r1, r0 + bne _080370D8 + ldr r0, =0x020229e8 + movs r1, 0 + strh r1, [r0, 0x18] + movs r1, 0x1 + strh r1, [r0, 0x34] +_080370D8: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, [r4] + adds r1, r5 + movs r2, 0x20 + bl link_0800A448 + ldr r0, =0x02024332 + strb r6, [r0] +_080370EE: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _080370F8 + b _0803744C +_080370F8: + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + b _0803744C + .pool +_08037124: + movs r0, 0x80 + lsls r0, 17 + ands r0, r1 + cmp r0, 0 + bne _08037134 + movs r0, 0x4 + orrs r1, r0 + str r1, [r2] +_08037134: + ldr r1, =0x02024332 + movs r0, 0xF + strb r0, [r1] + bl berry_801017C + b _0803744C + .pool +_08037144: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _08037152 + b _0803744C +_08037152: + bl sub_800A5B4 + movs r0, 0x2 + adds r1, r6, 0 + bl sub_8036EB8 + bl berry_801017C + ldr r0, =task00_0800F6FC + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005e00 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + adds r2, r1 + movs r1, 0 + movs r0, 0x87 + lsls r0, 1 + strh r0, [r2, 0xA] + movs r0, 0x5A + strh r0, [r2, 0xC] + strh r1, [r2, 0x12] + ldr r0, =0x0202449c + ldr r3, [r0] + movs r4, 0xC1 + lsls r4, 1 + adds r0, r3, r4 + ldrb r1, [r0] + adds r4, 0x1 + adds r0, r3, r4 + ldrb r0, [r0] + lsls r0, 8 + orrs r1, r0 + strh r1, [r2, 0xE] + ldr r1, =0x020223c4 + lsls r4, r5, 8 + adds r1, 0x2 + adds r4, r1 + ldrh r0, [r4] + strh r0, [r2, 0x10] + lsls r0, r6, 8 + adds r0, r1 + ldrh r0, [r0] + bl sub_8185F90 + ldrh r0, [r4] + bl sub_8185F90 + bl sub_8068AA4 + ldr r1, =0x02024332 + b _08037446 + .pool +_080371D8: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _080371E4 + b _0803744C +_080371E4: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x020244ec + movs r2, 0xC8 + bl link_0800A448 + ldr r1, =0x02024332 + b _08037446 + .pool +_08037200: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _0803720E + b _0803744C +_0803720E: + bl sub_800A5B4 + ldr r0, =0x02024744 + lsls r1, r5, 8 + ldr r2, =0x020223c4 + adds r1, r2 + movs r2, 0xC8 + bl memcpy + ldr r1, =0x02024332 + b _08037446 + .pool +_08037230: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _0803723C + b _0803744C +_0803723C: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x020245b4 + movs r2, 0xC8 + bl link_0800A448 + ldr r1, =0x02024332 + b _08037446 + .pool +_08037258: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _08037266 + b _0803744C +_08037266: + bl sub_800A5B4 + ldr r0, =0x0202480c + lsls r1, r5, 8 + ldr r2, =0x020223c4 + adds r1, r2 + movs r2, 0xC8 + bl memcpy + ldr r1, =0x02024332 + b _08037446 + .pool +_08037288: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _08037294 + b _0803744C +_08037294: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0202467c + movs r2, 0xC8 + bl link_0800A448 + ldr r1, =0x02024332 + b _08037446 + .pool +_080372B0: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _080372BE + b _0803744C +_080372BE: + bl sub_800A5B4 + ldr r4, =0x020248d4 + lsls r1, r5, 8 + ldr r0, =0x020223c4 + adds r1, r0 + adds r0, r4, 0 + movs r2, 0xC8 + bl memcpy + ldr r1, =0xfffffe70 + adds r0, r4, r1 + bl shedinja_something + ldr r2, =0xfffffed4 + adds r0, r4, r2 + bl shedinja_something + adds r0, r4, 0 + subs r0, 0xC8 + bl shedinja_something + adds r0, r4, 0 + subs r0, 0x64 + bl shedinja_something + adds r0, r4, 0 + bl shedinja_something + adds r0, r4, 0 + adds r0, 0x64 + bl shedinja_something + ldr r1, =0x02024332 + b _08037446 + .pool +_08037318: + bl sub_8032768 + bl sub_8184E58 + ldr r2, =0x02024332 + movs r0, 0 + strb r0, [r2, 0x1] + strb r0, [r2, 0x2] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08037372 + movs r3, 0 + ldr r1, =0x020229e8 + ldrb r0, [r1] + adds r5, r2, 0 + cmp r0, 0x3 + bne _08037356 + movs r4, 0xFF + adds r2, r1, 0 +_08037344: + adds r2, 0x1C + adds r3, 0x1 + cmp r3, 0x1 + bgt _08037356 + ldrh r1, [r2] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0x3 + beq _08037344 +_08037356: + cmp r3, 0x2 + bne _0803736C + movs r0, 0x10 + strb r0, [r5] + b _0803744C + .pool +_0803736C: + movs r0, 0x12 + strb r0, [r5] + b _0803744C +_08037372: + movs r0, 0x12 + strb r0, [r2] + b _0803744C +_08037378: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _0803744C + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0203bd2c + movs r2, 0x4 + bl link_0800A448 + ldr r1, =0x02024332 + b _08037446 + .pool +_080373A0: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + bne _0803744C + bl sub_800A5B4 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080373CA + ldr r0, =0x0203bd2c + lsls r1, r5, 8 + ldr r2, =0x020223c4 + adds r1, r2 + movs r2, 0x4 + bl memcpy +_080373CA: + ldr r1, =0x02024332 + b _08037446 + .pool +_080373E0: + ldr r0, =0x02024333 + adds r1, r0, 0x1 + bl battle_load_something + lsls r0, 24 + cmp r0, 0 + beq _0803744C + ldr r2, =0x03005d00 + ldr r1, =0x030022c0 + ldr r0, [r1] + str r0, [r2] + ldr r0, =sub_8039EF0 + str r0, [r1] + ldr r0, =sub_8038420 + bl SetMainCallback2 + ldr r2, =0x02022fec + ldr r1, [r2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0803744C + movs r0, 0x20 + orrs r1, r0 + str r1, [r2] + b _0803744C + .pool +_0803742C: + ldr r0, =0x02024332 + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + movs r1, 0x1 + strb r1, [r0, 0x1] +_08037438: + ldr r1, =0x02024332 + ldrb r0, [r1, 0x1] + subs r0, 0x1 + strb r0, [r1, 0x1] + lsls r0, 24 + cmp r0, 0 + bne _0803744C +_08037446: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0803744C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8036FAC + + thumb_func_start sub_8037458 +sub_8037458: @ 8037458 + push {r4-r7,lr} + sub sp, 0x4 + bl RunActiveTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x02024474 + adds r0, 0x25 + strb r6, [r0] + movs r0, 0x1 + adds r7, r6, 0 + eors r7, r0 + ldr r0, =0x02024332 + ldrb r0, [r0] + cmp r0, 0x10 + bls _08037486 + b _080379D6 +_08037486: + lsls r0, 2 + ldr r1, =_0803749C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0803749C: + .4byte _080374E0 + .4byte _08037518 + .4byte _0803761C + .4byte _08037670 + .4byte _08037694 + .4byte _08037710 + .4byte _08037734 + .4byte _080377B0 + .4byte _080377CC + .4byte _080377FC + .4byte _08037818 + .4byte _08037848 + .4byte _08037864 + .4byte _08037908 + .4byte _0803793A + .4byte _0803795C + .4byte _080379A0 +_080374E0: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0803750C + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + bl sub_805EF14 + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1] +_0803750C: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08037518 + bl sub_800E0E8 +_08037518: + ldr r2, =0x02022fec + ldr r1, [r2] + movs r3, 0x2 + adds r0, r1, 0 + ands r0, r3 + cmp r0, 0 + beq _080375FC + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _08037530 + b _080379D6 +_08037530: + ldr r6, =0x020229e8 + movs r0, 0 + strh r0, [r6, 0x18] + strh r3, [r6, 0x34] + adds r1, r6, 0 + adds r1, 0x50 + movs r0, 0x1 + strh r0, [r1] + adds r1, 0x1C + movs r0, 0x3 + strh r0, [r1] + adds r0, r6, 0 + adds r0, 0x40 + ldr r4, =0x02038bca + ldrh r1, [r4] + bl sub_8162E20 + adds r0, r6, 0 + adds r0, 0x5C + ldr r5, =0x02038bcc + ldrh r1, [r5] + bl sub_8162E20 + ldrh r1, [r4] + mov r0, sp + bl sub_8165B88 + mov r0, sp + ldrb r0, [r0] + adds r1, r6, 0 + adds r1, 0x52 + strh r0, [r1] + ldrh r1, [r5] + mov r0, sp + bl sub_8165B88 + mov r0, sp + ldrb r1, [r0] + adds r0, r6, 0 + adds r0, 0x6E + strh r1, [r0] + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080375C4 + ldr r4, =0x0202449c + ldr r0, [r4] + movs r5, 0xC0 + lsls r5, 1 + adds r0, r5 + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + ldr r2, =0x00000181 + adds r1, r0, r2 + movs r0, 0x3 + strb r0, [r1] + bl sub_8036A5C + bl sub_8036B44 + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, [r4] + adds r1, r5 + movs r2, 0x20 + bl link_0800A448 + ldr r1, =0x02024332 + movs r0, 0x2 + strb r0, [r1] +_080375C4: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _080375CE + b _080379D6 +_080375CE: + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + b _080379D6 + .pool +_080375FC: + movs r0, 0x80 + lsls r0, 17 + ands r0, r1 + cmp r0, 0 + bne _0803760C + movs r0, 0x4 + orrs r1, r0 + str r1, [r2] +_0803760C: + ldr r1, =0x02024332 + movs r0, 0xD + strb r0, [r1] + bl berry_801017C + b _080379D6 + .pool +_0803761C: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _0803762A + b _080379D6 +_0803762A: + bl sub_800A5B4 + movs r0, 0x2 + adds r1, r6, 0 + bl sub_8036EB8 + bl berry_801017C + ldr r0, =task00_0800F6FC + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0 + movs r0, 0x87 + lsls r0, 1 + strh r0, [r1, 0xA] + movs r0, 0x5A + strh r0, [r1, 0xC] + strh r2, [r1, 0x12] + adds r0, 0xEB + strh r0, [r1, 0xE] + strh r0, [r1, 0x10] + b _08037986 + .pool +_08037670: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _0803767C + b _080379D6 +_0803767C: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x020244ec +_08037686: + movs r2, 0xC8 + bl link_0800A448 + b _08037986 + .pool +_08037694: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _080376A2 + b _080379D6 +_080376A2: + bl sub_800A5B4 + ldr r0, =0x020229e8 + lsls r1, r6, 3 + subs r1, r6 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x18] + cmp r0, 0 + beq _080376E8 + ldr r4, =0x020244ec + lsls r1, r7, 8 + ldr r5, =0x020223c4 + adds r1, r5 + adds r0, r4, 0 + movs r2, 0xC8 + bl memcpy + movs r0, 0x96 + lsls r0, 1 + adds r4, r0 + lsls r1, r6, 8 + adds r1, r5 + adds r0, r4, 0 + movs r2, 0xC8 + bl memcpy + b _08037986 + .pool +_080376E8: + ldr r4, =0x020244ec + lsls r1, r6, 8 + ldr r5, =0x020223c4 + adds r1, r5 + adds r0, r4, 0 + movs r2, 0xC8 + bl memcpy + movs r1, 0x96 + lsls r1, 1 + adds r4, r1 + lsls r1, r7, 8 + adds r1, r5 + adds r0, r4, 0 + movs r2, 0xC8 + b _08037982 + .pool +_08037710: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _0803771C + b _080379D6 +_0803771C: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x020245b4 + movs r2, 0x64 + bl link_0800A448 + b _08037986 + .pool +_08037734: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _08037742 + b _080379D6 +_08037742: + bl sub_800A5B4 + ldr r0, =0x020229e8 + lsls r1, r6, 3 + subs r1, r6 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x18] + cmp r0, 0 + beq _08037788 + ldr r4, =0x020245b4 + lsls r1, r7, 8 + ldr r5, =0x020223c4 + adds r1, r5 + adds r0, r4, 0 + movs r2, 0x64 + bl memcpy + movs r2, 0x96 + lsls r2, 1 + adds r4, r2 + lsls r1, r6, 8 + adds r1, r5 + adds r0, r4, 0 + movs r2, 0x64 + bl memcpy + b _08037986 + .pool +_08037788: + ldr r4, =0x020245b4 + lsls r1, r6, 8 + ldr r5, =0x020223c4 + adds r1, r5 + adds r0, r4, 0 + movs r2, 0x64 + bl memcpy + movs r0, 0x96 + lsls r0, 1 + adds r4, r0 + lsls r1, r7, 8 + adds r1, r5 + adds r0, r4, 0 + movs r2, 0x64 + b _08037982 + .pool +_080377B0: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _080377BC + b _080379D6 +_080377BC: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02024744 + b _08037686 + .pool +_080377CC: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _080377DA + b _080379D6 +_080377DA: + bl sub_800A5B4 + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _080377EA + b _08037986 +_080377EA: + ldr r0, =0x02024744 + ldr r1, =0x020223c4 + movs r2, 0xC8 + b _08037982 + .pool +_080377FC: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _08037808 + b _080379D6 +_08037808: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0202480c + b _08037686 + .pool +_08037818: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _08037826 + b _080379D6 +_08037826: + bl sub_800A5B4 + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _08037836 + b _08037986 +_08037836: + ldr r0, =0x0202480c + ldr r1, =0x020223c4 + movs r2, 0xC8 + b _08037982 + .pool +_08037848: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _08037854 + b _080379D6 +_08037854: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x020248d4 + b _08037686 + .pool +_08037864: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _08037872 + b _080379D6 +_08037872: + bl sub_800A5B4 + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + beq _0803788A + ldr r0, =0x020248d4 + ldr r1, =0x020223c4 + movs r2, 0xC8 + bl memcpy +_0803788A: + ldr r4, =0x020244ec + adds r0, r4, 0 + bl shedinja_something + adds r0, r4, 0 + adds r0, 0x64 + bl shedinja_something + adds r0, r4, 0 + adds r0, 0xC8 + bl shedinja_something + movs r1, 0x96 + lsls r1, 1 + adds r0, r4, r1 + bl shedinja_something + movs r2, 0xC8 + lsls r2, 1 + adds r0, r4, r2 + bl shedinja_something + movs r1, 0xFA + lsls r1, 1 + adds r0, r4, r1 + bl shedinja_something + ldr r4, =0x02024744 + adds r0, r4, 0 + bl shedinja_something + adds r0, r4, 0 + adds r0, 0x64 + bl shedinja_something + adds r0, r4, 0 + adds r0, 0xC8 + bl shedinja_something + movs r2, 0x96 + lsls r2, 1 + adds r0, r4, r2 + bl shedinja_something + movs r1, 0xC8 + lsls r1, 1 + adds r0, r4, r1 + bl shedinja_something + movs r2, 0xFA + lsls r2, 1 + adds r0, r4, r2 + bl shedinja_something + b _08037986 + .pool +_08037908: + bl sub_8032768 + bl sub_8184E58 + ldr r2, =0x02024332 + movs r0, 0 + strb r0, [r2, 0x1] + strb r0, [r2, 0x2] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08037934 + movs r0, 0xE + strb r0, [r2] + b _080379D6 + .pool +_08037934: + movs r0, 0x10 + strb r0, [r2] + b _080379D6 +_0803793A: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080379D6 + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0203bd2c + movs r2, 0x4 + bl link_0800A448 + b _08037986 + .pool +_0803795C: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + bne _080379D6 + bl sub_800A5B4 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x4 + ands r0, r1 + cmp r0, 0 + bne _08037986 + ldr r0, =0x0203bd2c + lsls r1, r7, 8 + ldr r2, =0x020223c4 + adds r1, r2 + movs r2, 0x4 +_08037982: + bl memcpy +_08037986: + ldr r1, =0x02024332 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080379D6 + .pool +_080379A0: + ldr r0, =0x02024333 + adds r1, r0, 0x1 + bl battle_load_something + lsls r0, 24 + cmp r0, 0 + beq _080379D6 + bl sub_8166188 + ldr r2, =0x03005d00 + ldr r1, =0x030022c0 + ldr r0, [r1] + str r0, [r2] + ldr r0, =sub_8039EF0 + str r0, [r1] + ldr r0, =sub_8038420 + bl SetMainCallback2 + ldr r2, =0x02022fec + ldr r1, [r2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080379D6 + movs r0, 0x20 + orrs r1, r0 + str r1, [r2] +_080379D6: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8037458 + + thumb_func_start sub_80379F8 +sub_80379F8: @ 80379F8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0 + mov r8, r0 + ldr r6, =0x02022ff8 + mov r10, r6 +_08037A12: + ldr r1, [sp] + add r1, r8 + movs r0, 0x64 + adds r4, r1, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + mov r1, r8 + lsls r5, r1, 5 + strh r0, [r6] + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr + strh r0, [r6, 0x2] + movs r0, 0x4 + add r0, r10 + mov r9, r0 + adds r7, r5, r0 + adds r0, r4, 0 + movs r1, 0x2 + adds r2, r7, 0 + bl pokemon_getattr + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + strb r0, [r6, 0xF] + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + strh r0, [r6, 0x10] + adds r0, r4, 0 + movs r1, 0x3A + bl pokemon_getattr + strh r0, [r6, 0x12] + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr + mov r1, r10 + adds r1, 0x14 + adds r5, r1 + str r0, [r5] + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + str r0, [r6, 0x18] + adds r0, r4, 0 + bl pokemon_get_gender + strb r0, [r6, 0x1C] + adds r0, r7, 0 + bl StripExtendedControlCodes + adds r0, r4, 0 + movs r1, 0x3 + bl pokemon_getattr + cmp r0, 0x1 + beq _08037AA4 + adds r0, r7, 0 + movs r1, 0 + bl sub_81DB4DC +_08037AA4: + adds r6, 0x20 + movs r1, 0x1 + add r8, r1 + mov r0, r8 + cmp r0, 0x2 + ble _08037A12 + ldr r0, =0x02023058 + ldr r0, [r0] + mov r1, r9 + subs r1, 0x4 + movs r2, 0x60 + bl memcpy + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80379F8 + + thumb_func_start sub_8037ADC +sub_8037ADC: @ 8037ADC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r0, 0x4 + mov r9, r0 + movs r4, 0xF + ldr r6, =0x02022fec + ldr r0, [r6] + movs r1, 0x80 + lsls r1, 1 + ands r0, r1 + cmp r0, 0 + beq _08037B02 + movs r1, 0x2 + mov r9, r1 + movs r4, 0x3 +_08037B02: + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x02024474 + adds r0, 0x25 + movs r2, 0 + mov r8, r2 + strb r7, [r0] + ldr r0, =0x0202449c + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0xB4 + str r1, [sp] + adds r0, 0xAC + mov r10, r0 + bl RunActiveTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + ldr r5, =0x02024332 + ldrb r0, [r5] + cmp r0, 0x1 + beq _08037BA4 + cmp r0, 0x1 + bgt _08037B50 + cmp r0, 0 + beq _08037B5E + b _08037D0A + .pool +_08037B50: + cmp r0, 0x2 + bne _08037B56 + b _08037C64 +_08037B56: + cmp r0, 0x3 + bne _08037B5C + b _08037C9E +_08037B5C: + b _08037D0A +_08037B5E: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _08037B68 + b _08037D0A +_08037B68: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _08037B74 + b _08037D0A +_08037B74: + ldr r4, =0x02023058 + movs r0, 0x60 + bl Alloc + str r0, [r4] + movs r0, 0 + bl sub_80379F8 + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, [r4] + movs r2, 0x60 + bl link_0800A448 + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + b _08037D0A + .pool +_08037BA4: + bl sub_800A550 + adds r1, r4, 0 + ands r1, r0 + cmp r1, r4 + beq _08037BB2 + b _08037D0A +_08037BB2: + bl sub_800A5B4 + movs r5, 0 + cmp r8, r9 + bge _08037C2E + lsls r0, r7, 3 + subs r0, r7 + lsls r6, r0, 2 + mov r8, r5 + ldr r4, =0x020223c4 +_08037BC6: + cmp r5, r7 + beq _08037C1E + mov r2, r9 + cmp r2, 0x4 + bne _08037C14 + ldr r2, =0x020229e8 + mov r1, r8 + adds r0, r1, r2 + ldrh r1, [r0, 0x18] + movs r3, 0x1 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _08037BF8 + adds r0, r6, r2 + ldrh r1, [r0, 0x18] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08037C04 + b _08037C1E + .pool +_08037BF8: + adds r0, r6, r2 + ldrh r1, [r0, 0x18] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08037C1E +_08037C04: + ldr r0, =0x02022ff8 + adds r1, r4, 0 + movs r2, 0x60 + bl memcpy + b _08037C1E + .pool +_08037C14: + ldr r0, =0x02022ff8 + adds r1, r4, 0 + movs r2, 0x60 + bl memcpy +_08037C1E: + movs r2, 0x80 + lsls r2, 1 + adds r4, r2 + movs r0, 0x1C + add r8, r0 + adds r5, 0x1 + cmp r5, r9 + blt _08037BC6 +_08037C2E: + ldr r1, =0x02024332 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r1, =0x030022c0 + ldr r0, [r1, 0x8] + ldr r2, [sp] + str r0, [r2] + ldr r0, =0x02022fec + ldr r0, [r0] + mov r2, r10 + str r0, [r2] + ldr r0, =sub_8037ADC + str r0, [r1, 0x8] + bl sub_81B9150 + b _08037D0A + .pool +_08037C64: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08037D0A + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08037D0A + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08037C98 + bl sub_800ADF8 + b _08037D0A + .pool +_08037C98: + bl sub_800AC34 + b _08037D0A +_08037C9E: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08037CE4 + bl sub_8010500 + lsls r0, 24 + cmp r0, 0 + beq _08037D0A + mov r1, r10 + ldr r0, [r1] + str r0, [r6] + ldr r1, =0x030022c0 + ldr r2, [sp] + ldr r0, [r2] + str r0, [r1, 0x8] + ldr r0, =sub_80367D4 + bl SetMainCallback2 + ldr r4, =0x02023058 + ldr r0, [r4] + bl Free + mov r0, r8 + str r0, [r4] + b _08037D0A + .pool +_08037CE4: + ldr r0, =0x03003124 + ldrb r5, [r0] + cmp r5, 0 + bne _08037D0A + mov r1, r10 + ldr r0, [r1] + str r0, [r6] + ldr r1, =0x030022c0 + ldr r2, [sp] + ldr r0, [r2] + str r0, [r1, 0x8] + ldr r0, =sub_80367D4 + bl SetMainCallback2 + ldr r4, =0x02023058 + ldr r0, [r4] + bl Free + str r5, [r4] +_08037D0A: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8037ADC + + thumb_func_start intro_end +intro_end: @ 8037D2C + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =0x0202449c + ldr r0, [r0] + movs r1, 0xB4 + adds r1, r0 + mov r8, r1 + adds r7, r0, 0 + adds r7, 0xAC + bl RunActiveTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + ldr r5, =0x02024332 + ldrb r0, [r5] + cmp r0, 0 + beq _08037D64 + cmp r0, 0x1 + beq _08037DA4 + b _08037DD6 + .pool +_08037D64: + ldr r4, =0x02023058 + movs r0, 0x60 + bl Alloc + str r0, [r4] + movs r0, 0x3 + bl sub_80379F8 + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + ldr r1, =0x030022c0 + ldr r0, [r1, 0x8] + mov r2, r8 + str r0, [r2] + ldr r0, =0x02022fec + ldr r0, [r0] + str r0, [r7] + ldr r0, =intro_end + str r0, [r1, 0x8] + bl sub_81B9150 + b _08037DD6 + .pool +_08037DA4: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _08037DD6 + movs r0, 0x2 + strb r0, [r5] + ldr r1, =0x02022fec + ldr r0, [r7] + str r0, [r1] + ldr r1, =0x030022c0 + mov r2, r8 + ldr r0, [r2] + str r0, [r1, 0x8] + ldr r0, =sub_80367D4 + bl SetMainCallback2 + ldr r4, =0x02023058 + ldr r0, [r4] + bl Free + str r6, [r4] +_08037DD6: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end intro_end + + thumb_func_start sub_8037DF4 +sub_8037DF4: @ 8037DF4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x02024474 + adds r0, 0x25 + strb r7, [r0] + bl RunActiveTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + ldr r0, =0x02024332 + ldrb r0, [r0] + cmp r0, 0xA + bls _08037E20 + b _080383F8 +_08037E20: + lsls r0, 2 + ldr r1, =_08037E38 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08037E38: + .4byte _08037E64 + .4byte _08037EA8 + .4byte _08037F50 + .4byte _08038026 + .4byte _0803804C + .4byte _08038140 + .4byte _08038164 + .4byte _080382CC + .4byte _0803832C + .4byte _0803836C + .4byte _080383BC +_08037E64: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _08037E90 + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + bl sub_805EF14 + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1] +_08037E90: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _08037E9A + b _080383F8 +_08037E9A: + bl sub_800E0E8 + b _080383F8 + .pool +_08037EA8: + ldr r2, =0x02022fec + ldr r1, [r2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08037F30 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _08037EBE + b _080383F8 +_08037EBE: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08037F02 + ldr r4, =0x0202449c + ldr r0, [r4] + movs r5, 0xC0 + lsls r5, 1 + adds r0, r5 + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + ldr r2, =0x00000181 + adds r1, r0, r2 + movs r0, 0x3 + strb r0, [r1] + bl sub_8036A5C + bl sub_8036B44 + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, [r4] + adds r1, r5 + movs r2, 0x20 + bl link_0800A448 + ldr r1, =0x02024332 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_08037F02: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _08037F0C + b _080383F8 +_08037F0C: + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + b _080383F8 + .pool +_08037F30: + movs r0, 0x80 + lsls r0, 17 + ands r0, r1 + cmp r0, 0 + bne _08037F40 + movs r0, 0x4 + orrs r1, r0 + str r1, [r2] +_08037F40: + ldr r1, =0x02024332 + movs r0, 0x7 + strb r0, [r1] + bl berry_801017C + b _080383F8 + .pool +_08037F50: + bl sub_800A550 + movs r1, 0xF + ands r1, r0 + cmp r1, 0xF + beq _08037F5E + b _080383F8 +_08037F5E: + bl sub_800A5B4 + movs r0, 0x4 + adds r1, r7, 0 + bl sub_8036EB8 + bl berry_801017C + bl sub_8068AA4 + ldr r0, =task00_0800F6FC + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + movs r2, 0 + movs r1, 0x87 + lsls r1, 1 + strh r1, [r0, 0xA] + movs r1, 0x5A + strh r1, [r0, 0xC] + strh r2, [r0, 0x12] + strh r2, [r0, 0xE] + strh r2, [r0, 0x10] + ldr r1, =0x020223c4 + adds r4, r0, 0 + adds r5, r1, 0x2 + movs r7, 0x3F + movs r6, 0x3 +_08037FA4: + ldrh r0, [r5] + str r2, [sp] + bl sub_8185F90 + ldr r0, =0x020229e8 + ldr r2, [sp] + adds r0, r2, r0 + ldrh r0, [r0, 0x18] + cmp r0, 0x1 + beq _08037FE6 + cmp r0, 0x1 + bgt _08037FD4 + cmp r0, 0 + beq _08037FDE + b _0803800C + .pool +_08037FD4: + cmp r0, 0x2 + beq _08037FEE + cmp r0, 0x3 + beq _08037FFE + b _0803800C +_08037FDE: + ldrh r0, [r5] + adds r1, r7, 0 + ands r1, r0 + b _08037FF6 +_08037FE6: + ldrh r0, [r5] + adds r1, r7, 0 + ands r1, r0 + b _08038006 +_08037FEE: + ldrh r0, [r5] + adds r1, r7, 0 + ands r1, r0 + lsls r1, 6 +_08037FF6: + ldrh r0, [r4, 0xE] + orrs r1, r0 + strh r1, [r4, 0xE] + b _0803800C +_08037FFE: + ldrh r0, [r5] + adds r1, r7, 0 + ands r1, r0 + lsls r1, 6 +_08038006: + ldrh r0, [r4, 0x10] + orrs r1, r0 + strh r1, [r4, 0x10] +_0803800C: + movs r0, 0x80 + lsls r0, 1 + adds r5, r0 + adds r2, 0x1C + subs r6, 0x1 + cmp r6, 0 + bge _08037FA4 + bl zero_enemy_party_data + ldr r1, =0x02024332 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_08038026: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _08038032 + b _080383F8 +_08038032: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x020244ec + movs r2, 0xC8 + bl link_0800A448 + b _080383A6 + .pool +_0803804C: + bl sub_800A550 + movs r1, 0xF + ands r1, r0 + cmp r1, 0xF + beq _0803805A + b _080383F8 +_0803805A: + bl sub_800A5B4 + movs r6, 0 + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + mov r8, r0 + ldr r4, =0x020223c4 + movs r5, 0 +_0803806C: + cmp r6, r7 + bne _080380A0 + ldr r0, =0x020229e8 + adds r0, r5, r0 + ldrh r0, [r0, 0x18] + cmp r0, 0x2 + bgt _0803808C + cmp r0, 0x1 + bge _08038098 + cmp r0, 0 + beq _08038090 + b _0803812A + .pool +_0803808C: + cmp r0, 0x3 + bne _0803812A +_08038090: + ldr r0, =0x020244ec + b _08038110 + .pool +_08038098: + ldr r0, =0x02024618 + b _08038110 + .pool +_080380A0: + ldr r2, =0x020229e8 + adds r0, r5, r2 + ldrh r1, [r0, 0x18] + movs r3, 0x1 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _080380C4 + mov r1, r8 + adds r0, r1, r2 + ldrh r1, [r0, 0x18] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _080380D2 + b _080380F8 + .pool +_080380C4: + mov r1, r8 + adds r0, r1, r2 + ldrh r1, [r0, 0x18] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _080380F8 +_080380D2: + adds r0, r5, r2 + ldrh r0, [r0, 0x18] + cmp r0, 0x2 + bgt _080380E4 + cmp r0, 0x1 + bge _080380F0 + cmp r0, 0 + beq _080380E8 + b _0803812A +_080380E4: + cmp r0, 0x3 + bne _0803812A +_080380E8: + ldr r0, =0x020244ec + b _08038110 + .pool +_080380F0: + ldr r0, =0x02024618 + b _08038110 + .pool +_080380F8: + adds r0, r5, r2 + ldrh r0, [r0, 0x18] + cmp r0, 0x2 + bgt _0803810A + cmp r0, 0x1 + bge _08038120 + cmp r0, 0 + beq _0803810E + b _0803812A +_0803810A: + cmp r0, 0x3 + bne _0803812A +_0803810E: + ldr r0, =0x02024744 +_08038110: + adds r1, r4, 0 + movs r2, 0xC8 + bl memcpy + b _0803812A + .pool +_08038120: + ldr r0, =0x02024870 + adds r1, r4, 0 + movs r2, 0xC8 + bl memcpy +_0803812A: + movs r2, 0x80 + lsls r2, 1 + adds r4, r2 + adds r5, 0x1C + adds r6, 0x1 + cmp r6, 0x3 + ble _0803806C + b _080383A6 + .pool +_08038140: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _0803814C + b _080383F8 +_0803814C: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x020245b4 + movs r2, 0x64 + bl link_0800A448 + b _080383A6 + .pool +_08038164: + bl sub_800A550 + movs r1, 0xF + ands r1, r0 + cmp r1, 0xF + beq _08038172 + b _080383F8 +_08038172: + bl sub_800A5B4 + movs r6, 0 + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + mov r8, r0 + ldr r4, =0x020223c4 + movs r5, 0 +_08038184: + cmp r6, r7 + bne _080381B8 + ldr r0, =0x020229e8 + adds r0, r5, r0 + ldrh r0, [r0, 0x18] + cmp r0, 0x2 + bgt _080381A4 + cmp r0, 0x1 + bge _080381B0 + cmp r0, 0 + beq _080381A8 + b _08038242 + .pool +_080381A4: + cmp r0, 0x3 + bne _08038242 +_080381A8: + ldr r0, =0x020245b4 + b _08038228 + .pool +_080381B0: + ldr r0, =0x020246e0 + b _08038228 + .pool +_080381B8: + ldr r2, =0x020229e8 + adds r0, r5, r2 + ldrh r1, [r0, 0x18] + movs r3, 0x1 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _080381DC + mov r1, r8 + adds r0, r1, r2 + ldrh r1, [r0, 0x18] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _080381EA + b _08038210 + .pool +_080381DC: + mov r1, r8 + adds r0, r1, r2 + ldrh r1, [r0, 0x18] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08038210 +_080381EA: + adds r0, r5, r2 + ldrh r0, [r0, 0x18] + cmp r0, 0x2 + bgt _080381FC + cmp r0, 0x1 + bge _08038208 + cmp r0, 0 + beq _08038200 + b _08038242 +_080381FC: + cmp r0, 0x3 + bne _08038242 +_08038200: + ldr r0, =0x020245b4 + b _08038228 + .pool +_08038208: + ldr r0, =0x020246e0 + b _08038228 + .pool +_08038210: + adds r0, r5, r2 + ldrh r0, [r0, 0x18] + cmp r0, 0x2 + bgt _08038222 + cmp r0, 0x1 + bge _08038238 + cmp r0, 0 + beq _08038226 + b _08038242 +_08038222: + cmp r0, 0x3 + bne _08038242 +_08038226: + ldr r0, =0x0202480c +_08038228: + adds r1, r4, 0 + movs r2, 0x64 + bl memcpy + b _08038242 + .pool +_08038238: + ldr r0, =0x02024938 + adds r1, r4, 0 + movs r2, 0x64 + bl memcpy +_08038242: + movs r2, 0x80 + lsls r2, 1 + adds r4, r2 + adds r5, 0x1C + adds r6, 0x1 + cmp r6, 0x3 + ble _08038184 + ldr r4, =0x020244ec + adds r0, r4, 0 + bl shedinja_something + adds r0, r4, 0 + adds r0, 0x64 + bl shedinja_something + adds r0, r4, 0 + adds r0, 0xC8 + bl shedinja_something + movs r1, 0x96 + lsls r1, 1 + adds r0, r4, r1 + bl shedinja_something + movs r2, 0xC8 + lsls r2, 1 + adds r0, r4, r2 + bl shedinja_something + movs r1, 0xFA + lsls r1, 1 + adds r0, r4, r1 + bl shedinja_something + ldr r4, =0x02024744 + adds r0, r4, 0 + bl shedinja_something + adds r0, r4, 0 + adds r0, 0x64 + bl shedinja_something + adds r0, r4, 0 + adds r0, 0xC8 + bl shedinja_something + movs r2, 0x96 + lsls r2, 1 + adds r0, r4, r2 + bl shedinja_something + movs r1, 0xC8 + lsls r1, 1 + adds r0, r4, r1 + bl shedinja_something + movs r2, 0xFA + lsls r2, 1 + adds r0, r4, r2 + bl shedinja_something + b _080383A6 + .pool +_080382CC: + bl sub_8032768 + bl sub_8184E58 + ldr r3, =0x02024332 + movs r0, 0 + strb r0, [r3, 0x1] + strb r0, [r3, 0x2] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08038326 + movs r6, 0 + ldr r0, =0x020229e8 + ldrb r1, [r0] + adds r4, r3, 0 + adds r2, r0, 0 + cmp r1, 0x3 + bne _0803830A + movs r3, 0xFF +_080382F8: + adds r2, 0x1C + adds r6, 0x1 + cmp r6, 0x3 + bgt _0803830A + ldrh r1, [r2] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0x3 + beq _080382F8 +_0803830A: + cmp r6, 0x4 + bne _08038320 + movs r0, 0x8 + strb r0, [r4] + b _080383F8 + .pool +_08038320: + movs r0, 0xA + strb r0, [r4] + b _080383F8 +_08038326: + movs r0, 0xA + strb r0, [r3] + b _080383F8 +_0803832C: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080383F8 + ldr r0, =0x0202449c + ldr r4, [r0] + movs r0, 0xC0 + lsls r0, 1 + adds r4, r0 + ldr r0, =0x02022fec + ldr r0, [r0] + str r0, [r4] + ldr r0, =0x0203bd2c + ldr r0, [r0] + str r0, [r4, 0x4] + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + movs r2, 0x8 + bl link_0800A448 + b _080383A6 + .pool +_0803836C: + bl sub_800A550 + movs r1, 0xF + ands r1, r0 + cmp r1, 0xF + bne _080383F8 + bl sub_800A5B4 + movs r2, 0 + b _08038386 +_08038380: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 +_08038386: + cmp r2, 0x3 + bhi _080383A6 + ldr r4, =0x020223c4 + lsls r3, r2, 8 + adds r0, r3, r4 + ldrh r0, [r0] + movs r1, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08038380 + adds r1, r4, 0x4 + adds r1, r3, r1 + ldr r0, =0x0203bd2c + movs r2, 0x4 + bl memcpy +_080383A6: + ldr r1, =0x02024332 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080383F8 + .pool +_080383BC: + ldr r0, =0x02024333 + adds r1, r0, 0x1 + bl battle_load_something + lsls r0, 24 + cmp r0, 0 + beq _080383F8 + ldr r2, =0x03005d00 + ldr r1, =0x030022c0 + ldr r0, [r1] + str r0, [r2] + ldr r0, =sub_8039EF0 + str r0, [r1] + ldr r0, =sub_8038420 + bl SetMainCallback2 + ldr r3, =0x02022fec + ldr r2, [r3] + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + beq _080383F8 + ldr r0, =0x02038bca + movs r4, 0x80 + lsls r4, 4 + adds r1, r4, 0 + strh r1, [r0] + movs r0, 0x20 + orrs r2, r0 + str r2, [r3] +_080383F8: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8037DF4 + + thumb_func_start sub_8038420 +sub_8038420: @ 8038420 + push {lr} + sub sp, 0x4 + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl RunTextPrinters + bl fade_and_return_progress_probably + bl RunActiveTasks + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2C] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08038482 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08038482 + bl rfu_lacks_rfufunc + lsls r0, 24 + cmp r0, 0 + beq _08038482 + ldr r2, =0x020375f0 + ldr r1, =0x0202433a + movs r0, 0x5 + strb r0, [r1] + movs r0, 0x5 + strh r0, [r2] + bl pal_fade_control_reset_maybe + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =sub_80384E4 + bl SetMainCallback2 +_08038482: + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8038420 + + thumb_func_start sub_803849C +sub_803849C: @ 803849C + push {lr} + ldr r1, =0x030022c0 + ldr r0, =0x03005d00 + ldr r0, [r0] + str r0, [r1] + ldr r2, =0x02039b28 + movs r0, 0x3 + strb r0, [r2, 0x15] + ldr r0, =0x00000439 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + bl zero_enemy_party_data + movs r0, 0x5A + bl m4aSongNumStop + bl sub_805F094 + bl dp11_free + bl sub_8057028 + pop {r0} + bx r0 + .pool + thumb_func_end sub_803849C + + thumb_func_start sub_80384E4 +sub_80384E4: @ 80384E4 + push {lr} + bl fade_and_return_progress_probably + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08038512 + ldr r0, =0x030075f0 + bl MPlayStop_rev01 + ldr r0, =0x03007630 + bl MPlayStop_rev01 + bl sub_803849C + bl FreeAllWindowBuffers + ldr r0, =0x030022c0 + ldr r0, [r0, 0x8] + bl SetMainCallback2 +_08038512: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80384E4 + + thumb_func_start sub_8038528 +sub_8038528: @ 8038528 + movs r1, 0 + strh r1, [r0, 0x2E] + ldr r1, =sub_8038538 + str r1, [r0, 0x1C] + bx lr + .pool + thumb_func_end sub_8038528 + + thumb_func_start sub_8038538 +sub_8038538: @ 8038538 + push {r4,r5,lr} + adds r3, r0, 0 + ldr r5, =0x0201c000 + movs r0, 0x2E + ldrsh r1, [r3, r0] + cmp r1, 0x1 + beq _0803856C + cmp r1, 0x1 + bgt _08038554 + cmp r1, 0 + beq _0803855A + b _080385DC + .pool +_08038554: + cmp r1, 0x2 + beq _080385C8 + b _080385DC +_0803855A: + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + strh r1, [r3, 0x30] + ldr r0, =0x00000281 + strh r0, [r3, 0x32] + strh r1, [r3, 0x34] + movs r0, 0x1 + strh r0, [r3, 0x36] +_0803856C: + ldrh r0, [r3, 0x36] + subs r0, 0x1 + strh r0, [r3, 0x36] + lsls r0, 16 + cmp r0, 0 + bne _080385DC + movs r0, 0x2 + strh r0, [r3, 0x36] + movs r4, 0x30 + ldrsh r2, [r3, r4] + movs r0, 0x34 + ldrsh r1, [r3, r0] + lsls r1, 5 + adds r2, r1 + movs r4, 0x32 + ldrsh r0, [r3, r4] + subs r0, r1 + movs r4, 0x3D + lsls r0, 1 + adds r0, r5 + lsls r2, 1 + adds r2, r5 + movs r1, 0x1C +_0803859A: + strh r4, [r2] + strh r4, [r0] + adds r0, 0x4 + adds r2, 0x4 + subs r1, 0x2 + cmp r1, 0 + bge _0803859A + ldrh r0, [r3, 0x34] + adds r0, 0x1 + strh r0, [r3, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x15 + bne _080385DC + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + movs r0, 0x20 + strh r0, [r3, 0x30] + b _080385DC + .pool +_080385C8: + ldrh r0, [r3, 0x30] + subs r0, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + bne _080385DC + ldr r0, =sub_8036760 + bl SetMainCallback2 +_080385DC: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8038538 + + thumb_func_start LoadTrainerParty +LoadTrainerParty: @ 80385E8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + str r0, [sp, 0x10] + lsls r1, 16 + lsrs r1, 16 + str r1, [sp, 0x14] + lsls r2, 24 + lsrs r2, 24 + movs r0, 0 + mov r9, r0 + movs r0, 0x80 + lsls r0, 3 + cmp r1, r0 + bne _08038610 + movs r0, 0 + b _080389E2 +_08038610: + ldr r4, =0x02022fec + ldr r0, [r4] + ldr r1, =0x043f0908 + ands r0, r1 + ldr r1, [sp, 0x14] + lsls r1, 2 + str r1, [sp, 0x20] + cmp r0, 0x8 + beq _08038624 + b _080389D2 +_08038624: + cmp r2, 0x1 + bne _0803862C + bl zero_enemy_party_data +_0803862C: + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _08038668 + ldr r0, =gTrainers + ldr r2, [sp, 0x20] + ldr r3, [sp, 0x14] + adds r1, r2, r3 + lsls r1, 3 + adds r1, r0 + adds r2, r1, 0 + adds r2, 0x20 + ldrb r1, [r2] + movs r4, 0x3 + str r4, [sp, 0x1C] + adds r4, r0, 0 + cmp r1, 0x3 + bhi _0803867C + adds r2, r1, 0 + str r2, [sp, 0x1C] + b _0803867C + .pool +_08038668: + ldr r1, =gTrainers + ldr r2, [sp, 0x20] + ldr r3, [sp, 0x14] + adds r0, r2, r3 + lsls r0, 3 + adds r0, r1 + adds r0, 0x20 + ldrb r0, [r0] + str r0, [sp, 0x1C] + adds r4, r1, 0 +_0803867C: + movs r0, 0 + str r0, [sp, 0x18] + b _080389B4 + .pool +_08038688: + ldr r2, [sp, 0x20] + ldr r3, [sp, 0x14] + adds r0, r2, r3 + lsls r0, 3 + adds r1, r0, r4 + ldrb r0, [r1, 0x18] + cmp r0, 0x1 + bne _0803869E + movs r0, 0x80 + mov r10, r0 + b _080386B0 +_0803869E: + ldrb r1, [r1, 0x2] + movs r0, 0x80 + ands r0, r1 + movs r1, 0x88 + mov r10, r1 + cmp r0, 0 + beq _080386B0 + movs r2, 0x78 + mov r10, r2 +_080386B0: + movs r6, 0 + ldr r2, [sp, 0x20] + ldr r3, [sp, 0x14] + adds r0, r2, r3 + lsls r0, 3 + adds r1, r4, 0x4 + adds r0, r1 + ldrb r0, [r0] + ldr r3, [sp, 0x18] + adds r3, 0x1 + str r3, [sp, 0x24] + cmp r0, 0xFF + beq _080386E6 + adds r3, r1, 0 +_080386CC: + ldr r0, [sp, 0x14] + adds r1, r2, r0 + lsls r1, 3 + adds r0, r6, r1 + adds r0, r3 + ldrb r0, [r0] + add r9, r0 + adds r6, 0x1 + adds r1, r6, r1 + adds r1, r3 + ldrb r0, [r1] + cmp r0, 0xFF + bne _080386CC +_080386E6: + ldr r1, [sp, 0x20] + ldr r2, [sp, 0x14] + adds r0, r1, r2 + lsls r1, r0, 3 + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08038794 + cmp r0, 0x1 + bgt _08038700 + cmp r0, 0 + beq _0803870E + b _080389AC +_08038700: + cmp r0, 0x2 + bne _08038706 + b _08038854 +_08038706: + cmp r0, 0x3 + bne _0803870C + b _080388E8 +_0803870C: + b _080389AC +_0803870E: + adds r0, r4, 0 + adds r0, 0x24 + adds r0, r1, r0 + ldr r4, [r0] + movs r6, 0 + ldr r3, [sp, 0x18] + lsls r2, r3, 3 + adds r0, r2, r4 + ldrh r1, [r0, 0x4] + movs r0, 0xB + muls r0, r1 + ldr r1, =gSpeciesNames + adds r0, r1 + ldrb r0, [r0] + adds r5, r2, 0 + cmp r0, 0xFF + beq _08038750 + adds r3, r1, 0 + movs r7, 0xB +_08038734: + adds r0, r2, r4 + ldrh r0, [r0, 0x4] + adds r1, r0, 0 + muls r1, r7 + adds r0, r6, r1 + adds r0, r3 + ldrb r0, [r0] + add r9, r0 + adds r6, 0x1 + adds r1, r6, r1 + adds r1, r3 + ldrb r0, [r1] + cmp r0, 0xFF + bne _08038734 +_08038750: + mov r2, r9 + lsls r0, r2, 8 + add r10, r0 + adds r4, r5, r4 + ldrh r1, [r4] + lsls r0, r1, 5 + subs r0, r1 + movs r1, 0xFF + bl __divsi3 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r3, [sp, 0x18] + movs r1, 0x64 + adds r0, r3, 0 + muls r0, r1 + ldr r2, [sp, 0x10] + adds r0, r2, r0 + ldrh r1, [r4, 0x4] + ldrb r2, [r4, 0x2] + movs r3, 0x1 + str r3, [sp] + mov r3, r10 + str r3, [sp, 0x4] + movs r3, 0x2 + str r3, [sp, 0x8] + movs r3, 0 + str r3, [sp, 0xC] + adds r3, r6, 0 + bl create_pokemon_set_level + b _080389AC + .pool +_08038794: + adds r0, r4, 0 + adds r0, 0x24 + adds r0, r1, r0 + ldr r7, [r0] + movs r6, 0 + ldr r4, [sp, 0x18] + lsls r2, r4, 4 + adds r0, r2, r7 + ldrh r1, [r0, 0x4] + movs r0, 0xB + muls r0, r1 + ldr r1, =gSpeciesNames + adds r0, r1 + ldrb r0, [r0] + mov r8, r2 + cmp r0, 0xFF + beq _080387D6 + adds r3, r1, 0 + movs r4, 0xB +_080387BA: + adds r0, r2, r7 + ldrh r0, [r0, 0x4] + adds r1, r0, 0 + muls r1, r4 + adds r0, r6, r1 + adds r0, r3 + ldrb r0, [r0] + add r9, r0 + adds r6, 0x1 + adds r1, r6, r1 + adds r1, r3 + ldrb r0, [r1] + cmp r0, 0xFF + bne _080387BA +_080387D6: + mov r2, r9 + lsls r0, r2, 8 + add r10, r0 + mov r3, r8 + adds r4, r3, r7 + ldrh r1, [r4] + lsls r0, r1, 5 + subs r0, r1 + movs r1, 0xFF + bl __divsi3 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, [sp, 0x18] + movs r1, 0x64 + adds r5, r0, 0 + muls r5, r1 + ldr r2, [sp, 0x10] + adds r5, r2, r5 + ldrh r1, [r4, 0x4] + ldrb r2, [r4, 0x2] + movs r0, 0x1 + str r0, [sp] + mov r3, r10 + str r3, [sp, 0x4] + movs r0, 0x2 + str r0, [sp, 0x8] + movs r0, 0 + str r0, [sp, 0xC] + adds r0, r5, 0 + adds r3, r6, 0 + bl create_pokemon_set_level + movs r6, 0 + mov r0, r8 + adds r0, 0x6 + adds r4, r7, r0 +_08038820: + adds r1, r6, 0 + adds r1, 0xD + adds r0, r5, 0 + adds r2, r4, 0 + bl pokemon_setattr + adds r1, r6, 0 + adds r1, 0x11 + ldrh r0, [r4] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + ldr r0, =gBattleMoves + 0x4 @ PP offset + adds r2, r0 + adds r0, r5, 0 + bl pokemon_setattr + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _08038820 + b _080389AC + .pool +_08038854: + adds r0, r4, 0 + adds r0, 0x24 + adds r0, r1, r0 + ldr r4, [r0] + movs r6, 0 + ldr r0, [sp, 0x18] + lsls r2, r0, 3 + adds r0, r2, r4 + ldrh r1, [r0, 0x4] + movs r0, 0xB + muls r0, r1 + ldr r1, =gSpeciesNames + adds r0, r1 + ldrb r0, [r0] + adds r5, r2, 0 + cmp r0, 0xFF + beq _08038896 + adds r3, r1, 0 + movs r7, 0xB +_0803887A: + adds r0, r2, r4 + ldrh r0, [r0, 0x4] + adds r1, r0, 0 + muls r1, r7 + adds r0, r6, r1 + adds r0, r3 + ldrb r0, [r0] + add r9, r0 + adds r6, 0x1 + adds r1, r6, r1 + adds r1, r3 + ldrb r0, [r1] + cmp r0, 0xFF + bne _0803887A +_08038896: + mov r2, r9 + lsls r0, r2, 8 + add r10, r0 + adds r5, r4 + ldrh r1, [r5] + lsls r0, r1, 5 + subs r0, r1 + movs r1, 0xFF + bl __divsi3 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r3, [sp, 0x18] + movs r0, 0x64 + adds r4, r3, 0 + muls r4, r0 + ldr r1, [sp, 0x10] + adds r4, r1, r4 + ldrh r1, [r5, 0x4] + ldrb r2, [r5, 0x2] + movs r0, 0x1 + str r0, [sp] + mov r3, r10 + str r3, [sp, 0x4] + movs r0, 0x2 + str r0, [sp, 0x8] + movs r0, 0 + str r0, [sp, 0xC] + adds r0, r4, 0 + adds r3, r6, 0 + bl create_pokemon_set_level + adds r5, 0x6 + adds r0, r4, 0 + movs r1, 0xC + adds r2, r5, 0 + bl pokemon_setattr + b _080389AC + .pool +_080388E8: + adds r0, r4, 0 + adds r0, 0x24 + adds r0, r1, r0 + ldr r7, [r0] + movs r6, 0 + ldr r4, [sp, 0x18] + lsls r2, r4, 4 + adds r0, r2, r7 + ldrh r1, [r0, 0x4] + movs r0, 0xB + muls r0, r1 + ldr r1, =gSpeciesNames + adds r0, r1 + ldrb r0, [r0] + mov r8, r2 + cmp r0, 0xFF + beq _0803892A + adds r3, r1, 0 + movs r4, 0xB +_0803890E: + adds r0, r2, r7 + ldrh r0, [r0, 0x4] + adds r1, r0, 0 + muls r1, r4 + adds r0, r6, r1 + adds r0, r3 + ldrb r0, [r0] + add r9, r0 + adds r6, 0x1 + adds r1, r6, r1 + adds r1, r3 + ldrb r0, [r1] + cmp r0, 0xFF + bne _0803890E +_0803892A: + mov r2, r9 + lsls r0, r2, 8 + add r10, r0 + mov r3, r8 + adds r5, r3, r7 + ldrh r1, [r5] + lsls r0, r1, 5 + subs r0, r1 + movs r1, 0xFF + bl __divsi3 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, [sp, 0x18] + movs r1, 0x64 + adds r4, r0, 0 + muls r4, r1 + ldr r2, [sp, 0x10] + adds r4, r2, r4 + ldrh r1, [r5, 0x4] + ldrb r2, [r5, 0x2] + movs r0, 0x1 + str r0, [sp] + mov r3, r10 + str r3, [sp, 0x4] + movs r0, 0x2 + str r0, [sp, 0x8] + movs r0, 0 + str r0, [sp, 0xC] + adds r0, r4, 0 + adds r3, r6, 0 + bl create_pokemon_set_level + adds r5, 0x6 + adds r0, r4, 0 + movs r1, 0xC + adds r2, r5, 0 + bl pokemon_setattr + movs r6, 0 + adds r5, r4, 0 + mov r0, r8 + adds r0, 0x8 + adds r4, r7, r0 +_08038982: + adds r1, r6, 0 + adds r1, 0xD + adds r0, r5, 0 + adds r2, r4, 0 + bl pokemon_setattr + adds r1, r6, 0 + adds r1, 0x11 + ldrh r0, [r4] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + ldr r0, =gBattleMoves + 0x4 @ PP offset + adds r2, r0 + adds r0, r5, 0 + bl pokemon_setattr + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _08038982 +_080389AC: + ldr r4, [sp, 0x24] + str r4, [sp, 0x18] + ldr r4, =gTrainers + ldr r0, [sp, 0x18] +_080389B4: + ldr r1, [sp, 0x1C] + cmp r0, r1 + bge _080389BC + b _08038688 +_080389BC: + ldr r2, =0x02022fec + ldr r1, =gTrainers + ldr r3, [sp, 0x20] + ldr r4, [sp, 0x14] + adds r0, r3, r4 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x18] + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] +_080389D2: + ldr r0, =gTrainers + ldr r2, [sp, 0x20] + ldr r3, [sp, 0x14] + adds r1, r2, r3 + lsls r1, 3 + adds r1, r0 + adds r1, 0x20 + ldrb r0, [r1] +_080389E2: + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end LoadTrainerParty + + thumb_func_start sub_8038A04 +sub_8038A04: @ 8038A04 + push {lr} + ldr r0, =0x04000006 + ldrh r0, [r0] + subs r0, 0x6F + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x30 + bhi _08038A1E + movs r1, 0x98 + lsls r1, 8 + movs r0, 0x8 + bl SetGpuReg +_08038A1E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8038A04 + + thumb_func_start vblank_cb_08078BB4 +vblank_cb_08078BB4: @ 8038A28 + push {lr} + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x013f0102 + ands r0, r1 + cmp r0, 0 + bne _08038A3A + bl GenerateRandomNumber +_08038A3A: + ldr r0, =0x02022e14 + ldrh r1, [r0] + movs r0, 0x10 + bl SetGpuReg + ldr r0, =0x02022e16 + ldrh r1, [r0] + movs r0, 0x12 + bl SetGpuReg + ldr r0, =0x02022e18 + ldrh r1, [r0] + movs r0, 0x14 + bl SetGpuReg + ldr r0, =0x02022e1a + ldrh r1, [r0] + movs r0, 0x16 + bl SetGpuReg + ldr r0, =0x02022e1c + ldrh r1, [r0] + movs r0, 0x18 + bl SetGpuReg + ldr r0, =0x02022e1e + ldrh r1, [r0] + movs r0, 0x1A + bl SetGpuReg + ldr r0, =0x02022e20 + ldrh r1, [r0] + movs r0, 0x1C + bl SetGpuReg + ldr r0, =0x02022e22 + ldrh r1, [r0] + movs r0, 0x1E + bl SetGpuReg + ldr r0, =0x02022e24 + ldrh r1, [r0] + movs r0, 0x40 + bl SetGpuReg + ldr r0, =0x02022e26 + ldrh r1, [r0] + movs r0, 0x44 + bl SetGpuReg + ldr r0, =0x02022e28 + ldrh r1, [r0] + movs r0, 0x42 + bl SetGpuReg + ldr r0, =0x02022e2a + ldrh r1, [r0] + movs r0, 0x46 + bl SetGpuReg + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + bl sub_80BA0A8 + pop {r0} + bx r0 + .pool + thumb_func_end vblank_cb_08078BB4 + + thumb_func_start nullsub_17 +nullsub_17: @ 8038B00 + bx lr + thumb_func_end nullsub_17 + + thumb_func_start sub_8038B04 +sub_8038B04: @ 8038B04 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _08038B24 + movs r1, 0x32 + ldrsh r0, [r5, r1] + movs r1, 0xFF + lsls r1, 8 + ands r0, r1 + lsrs r0, 8 + ldrh r1, [r5, 0x30] + adds r0, r1 + strh r0, [r5, 0x20] + b _08038B36 +_08038B24: + movs r1, 0x32 + ldrsh r0, [r5, r1] + movs r1, 0xFF + lsls r1, 8 + ands r0, r1 + asrs r0, 8 + ldrh r1, [r5, 0x30] + subs r1, r0 + strh r1, [r5, 0x20] +_08038B36: + movs r1, 0xC0 + lsls r1, 1 + adds r0, r1, 0 + ldrh r1, [r5, 0x32] + adds r0, r1 + strh r0, [r5, 0x32] + adds r0, r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08038B6A + ldr r4, =0x00002710 + adds r0, r4, 0 + bl FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + adds r0, r5, 0 + bl obj_free_rotscale_entry + adds r0, r5, 0 + bl RemoveObjectAndFreeTiles +_08038B6A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8038B04 + + thumb_func_start sub_8038B74 +sub_8038B74: @ 8038B74 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim + ldr r0, =sub_8038B04 + str r0, [r4, 0x1C] + movs r0, 0x68 + bl audio_play + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8038B74 + + thumb_func_start sub_8038B94 +sub_8038B94: @ 8038B94 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + ldr r0, =0x02024474 + adds r0, 0x25 + ldrb r2, [r0] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08038C04 + ldr r1, =0x020229e8 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x18] + cmp r0, 0x1 + beq _08038BF0 + cmp r0, 0x1 + bgt _08038BE8 + cmp r0, 0 + beq _08038C04 + b _08038C0C + .pool +_08038BE8: + cmp r0, 0x2 + beq _08038C04 + cmp r0, 0x3 + bne _08038C0C +_08038BF0: + ldr r0, =0x02024744 + str r0, [sp, 0x4] + ldr r1, =0x020244ec + str r1, [sp, 0x8] + b _08038C0C + .pool +_08038C04: + ldr r2, =0x020244ec + str r2, [sp, 0x4] + ldr r3, =0x02024744 + str r3, [sp, 0x8] +_08038C0C: + movs r7, 0 + movs r0, 0 + mov r8, r0 + ldr r1, [sp] + lsls r1, 2 + str r1, [sp, 0xC] + movs r2, 0xCE + lsls r2, 1 + mov r10, r2 + mov r9, r0 +_08038C20: + movs r0, 0x64 + mov r4, r8 + muls r4, r0 + ldr r3, [sp, 0x4] + adds r4, r3, r4 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + lsls r0, 16 + lsrs r6, r0, 16 + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr + adds r1, r0, 0 + cmp r5, 0 + beq _08038C90 + cmp r5, r10 + beq _08038C64 + cmp r6, 0 + beq _08038C64 + cmp r1, 0 + bne _08038C64 + movs r0, 0x1 + mov r2, r9 + lsls r0, r2 + orrs r7, r0 +_08038C64: + cmp r5, 0 + beq _08038C90 + cmp r6, 0 + beq _08038C7C + cmp r5, r10 + beq _08038C74 + cmp r1, 0 + beq _08038C7C +_08038C74: + movs r0, 0x2 + mov r3, r9 + lsls r0, r3 + orrs r7, r0 +_08038C7C: + cmp r5, 0 + beq _08038C90 + cmp r5, r10 + beq _08038C90 + cmp r6, 0 + bne _08038C90 + movs r0, 0x3 + mov r1, r9 + lsls r0, r1 + orrs r7, r0 +_08038C90: + movs r2, 0x2 + add r9, r2 + movs r3, 0x1 + add r8, r3 + mov r0, r8 + cmp r0, 0x5 + ble _08038C20 + ldr r1, =0x03005e00 + ldr r2, [sp, 0xC] + ldr r3, [sp] + adds r0, r2, r3 + lsls r0, 3 + adds r0, r1 + strh r7, [r0, 0xE] + movs r7, 0 + movs r0, 0 + mov r8, r0 + movs r1, 0xCE + lsls r1, 1 + mov r10, r1 + mov r9, r0 +_08038CBA: + movs r0, 0x64 + mov r4, r8 + muls r4, r0 + ldr r2, [sp, 0x8] + adds r4, r2, r4 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + lsls r0, 16 + lsrs r6, r0, 16 + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr + adds r1, r0, 0 + cmp r5, 0 + beq _08038D2A + cmp r5, r10 + beq _08038CFE + cmp r6, 0 + beq _08038CFE + cmp r1, 0 + bne _08038CFE + movs r0, 0x1 + mov r3, r9 + lsls r0, r3 + orrs r7, r0 +_08038CFE: + cmp r5, 0 + beq _08038D2A + cmp r6, 0 + beq _08038D16 + cmp r5, r10 + beq _08038D0E + cmp r1, 0 + beq _08038D16 +_08038D0E: + movs r0, 0x2 + mov r1, r9 + lsls r0, r1 + orrs r7, r0 +_08038D16: + cmp r5, 0 + beq _08038D2A + cmp r5, r10 + beq _08038D2A + cmp r6, 0 + bne _08038D2A + movs r0, 0x3 + mov r2, r9 + lsls r0, r2 + orrs r7, r0 +_08038D2A: + movs r3, 0x2 + add r9, r3 + movs r0, 0x1 + add r8, r0 + mov r1, r8 + cmp r1, 0x5 + ble _08038CBA + ldr r1, =0x03005e00 + ldr r2, [sp, 0xC] + ldr r3, [sp] + adds r0, r2, r3 + lsls r0, 3 + adds r0, r1 + strh r7, [r0, 0x10] + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8038B94 + + thumb_func_start sub_8038D64 +sub_8038D64: @ 8038D64 + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + bl SetVBlankCallback + ldr r0, =0x02022fec + ldr r1, [r0] + movs r2, 0x21 + negs r2, r2 + ands r1, r2 + str r1, [r0] + ldr r0, =0x003f0100 + ands r0, r1 + cmp r0, 0 + beq _08038DAC + ldr r0, =0x030022c0 + ldr r0, [r0, 0x8] + bl SetMainCallback2 + bl sub_8057028 + bl dp11_free + bl sub_805F094 + b _08038EB6 + .pool +_08038DAC: + str r0, [sp] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x05006000 + mov r0, sp + bl CpuSet + movs r0, 0x4C + movs r1, 0 + bl SetGpuReg + movs r0, 0x40 + movs r1, 0xF0 + bl SetGpuReg + ldr r4, =0x00005051 + movs r0, 0x44 + adds r1, r4, 0 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4A + movs r1, 0 + bl SetGpuReg + ldr r1, =0x02022e24 + movs r0, 0xF0 + strh r0, [r1] + ldr r0, =0x02022e26 + strh r4, [r0] + bl dp12_8087EA4 + ldr r0, =0x02038c28 + movs r3, 0xF0 + movs r1, 0xF0 + lsls r1, 3 + adds r2, r0, r1 + movs r1, 0x4F +_08038DFE: + strh r3, [r0] + strh r3, [r2] + adds r2, 0x2 + adds r0, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _08038DFE + movs r1, 0x50 + ldr r0, =0x02038c28 + ldr r3, =0x0000ff10 + movs r4, 0x82 + lsls r4, 4 + adds r2, r0, r4 + adds r0, 0xA0 +_08038E1A: + strh r3, [r0] + strh r3, [r2] + adds r2, 0x2 + adds r0, 0x2 + adds r1, 0x1 + cmp r1, 0x9F + ble _08038E1A + bl sub_80A1A74 + ldr r0, =0x02022e14 + movs r4, 0 + strh r4, [r0] + ldr r0, =0x02022e16 + strh r4, [r0] + ldr r0, =0x02022e18 + strh r4, [r0] + ldr r0, =0x02022e1a + strh r4, [r0] + ldr r0, =0x02022e1c + strh r4, [r0] + ldr r0, =0x02022e1e + strh r4, [r0] + ldr r0, =0x02022e20 + strh r4, [r0] + ldr r0, =0x02022e22 + strh r4, [r0] + bl c2_berry_program_update_menu + ldr r0, =gUnknown_08C004E0 + movs r1, 0 + movs r2, 0x40 + bl decompress_palette + bl sub_803570C + bl ResetAllObjectData + bl clear_tasks + bl sub_8036154 + movs r0, 0x4A + movs r1, 0x37 + bl SetGpuReg + bl ResetObjectPaletteAllocator + ldr r1, =0x0300301c + movs r0, 0x4 + strb r0, [r1] + ldr r0, =vblank_cb_08078BB4 + bl SetVBlankCallback + ldr r0, =task00_0800F6FC + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0x87 + lsls r2, 1 + strh r2, [r1, 0xA] + movs r2, 0x5A + strh r2, [r1, 0xC] + movs r2, 0x1 + strh r2, [r1, 0x12] + bl sub_8038B94 + ldr r0, =sub_8038F14 + bl SetMainCallback2 + ldr r0, =0x02024332 + strb r4, [r0] +_08038EB6: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8038D64 + + thumb_func_start sub_8038F14 +sub_8038F14: @ 8038F14 + push {lr} + bl sub_8038F34 + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl RunTextPrinters + bl fade_and_return_progress_probably + bl RunActiveTasks + pop {r0} + bx r0 + thumb_func_end sub_8038F14 + + thumb_func_start sub_8038F34 +sub_8038F34: @ 8038F34 + push {r4-r6,lr} + sub sp, 0x8 + ldr r0, =0x02024332 + ldrb r1, [r0] + adds r4, r0, 0 + cmp r1, 0x9 + bls _08038F44 + b _080391C6 +_08038F44: + lsls r0, r1, 2 + ldr r1, =_08038F58 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08038F58: + .4byte _08038F80 + .4byte _08038FA0 + .4byte _08038FC2 + .4byte _080390C8 + .4byte _08039100 + .4byte _08039118 + .4byte _0803912C + .4byte _0803914C + .4byte _08039166 + .4byte _08039184 +_08038F80: + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + ldr r1, =0x02024332 + movs r0, 0xFF + strb r0, [r1, 0x1] + b _08039174 + .pool +_08038FA0: + ldrb r0, [r4, 0x1] + subs r0, 0x1 + strb r0, [r4, 0x1] + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _08038FB0 + b _080391C6 +_08038FB0: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + b _0803910C +_08038FC2: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08038FD0 + b _080391C6 +_08038FD0: + bl sub_8185FAC + ldr r2, =0x030022c0 + ldr r1, =0x00000439 + adds r2, r1 + movs r1, 0x1 + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + movs r3, 0x2 + cmp r0, 0 + beq _08038FFC + movs r3, 0x4 +_08038FFC: + movs r4, 0 + ldr r6, =0x03005d90 + cmp r4, r3 + bge _08039022 + ldr r1, =0x020229e8 + ldrb r0, [r1] + cmp r0, 0x3 + bne _08039022 + movs r5, 0xFF + adds r2, r1, 0 +_08039010: + adds r2, 0x1C + adds r4, 0x1 + cmp r4, r3 + bge _08039022 + ldrh r1, [r2] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0x3 + beq _08039010 +_08039022: + ldr r0, [r6] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _080390AC + cmp r4, r3 + bne _080390AC + ldr r0, =0x000008d2 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _08039074 + bl FreeAllWindowBuffers + ldr r0, =sub_80392A8 + bl SetMainCallback2 + b _080391C6 + .pool +_08039074: + ldr r2, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _08039090 + ldr r0, [r2, 0x8] + b _080390B0 + .pool +_08039090: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _08039172 + ldr r0, =sub_80B3AF8 + movs r1, 0x5 + bl AddTask + b _08039172 + .pool +_080390AC: + ldr r0, =0x030022c0 + ldr r0, [r0, 0x8] +_080390B0: + bl SetMainCallback2 + bl sub_8057028 + bl dp11_free + bl sub_805F094 + b _080391C6 + .pool +_080390C8: + movs r0, 0 + str r0, [sp, 0x4] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x05006000 + add r0, sp, 0x4 + bl CpuSet + movs r4, 0 +_080390DA: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80363C4 + adds r4, 0x1 + cmp r4, 0x1 + ble _080390DA + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + b _08039172 + .pool +_08039100: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080391C6 +_0803910C: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _080391C6 + .pool +_08039118: + ldr r0, =sub_80B3AF8 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _080391C6 + b _08039172 + .pool +_0803912C: + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080391C6 + bl sub_800ADF8 + ldr r0, =gUnknown_0824978D + movs r1, 0 + bl battle_show_message_maybe + b _08039172 + .pool +_0803914C: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _080391C6 + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080391C6 + b _08039172 +_08039166: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _08039172 + bl sub_800AC34 +_08039172: + ldr r1, =0x02024332 +_08039174: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080391C6 + .pool +_08039184: + ldr r2, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + adds r3, r2, 0 + cmp r0, 0 + beq _080391A6 + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _080391A6 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080391C6 +_080391A6: + ldr r0, =0x00000439 + adds r2, r3, r0 + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, [r3, 0x8] + bl SetMainCallback2 + bl sub_8057028 + bl dp11_free + bl sub_805F094 +_080391C6: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8038F34 + + thumb_func_start sub_80391E0 +sub_80391E0: @ 80391E0 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + cmp r1, 0x6 + bhi _080392A0 + lsls r0, r1, 2 + ldr r1, =_08039200 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08039200: + .4byte _0803921C + .4byte _08039230 + .4byte _08039244 + .4byte _08039258 + .4byte _0803926C + .4byte _08039280 + .4byte _08039294 +_0803921C: + ldr r0, =gUnknown_0831AA08 + lsls r1, r2, 2 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 30 + lsrs r0, 30 + b _080392A0 + .pool +_08039230: + ldr r0, =gUnknown_0831AA08 + lsls r1, r2, 2 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 28 + lsrs r0, 30 + b _080392A0 + .pool +_08039244: + ldr r0, =gUnknown_0831AA08 + lsls r1, r2, 2 + adds r1, r0 + ldrh r0, [r1] + lsls r0, 23 + lsrs r0, 27 + b _080392A0 + .pool +_08039258: + ldr r0, =gUnknown_0831AA08 + lsls r1, r2, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + lsls r0, 29 + lsrs r0, 30 + b _080392A0 + .pool +_0803926C: + ldr r0, =gUnknown_0831AA08 + lsls r1, r2, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + lsls r0, 28 + lsrs r0, 31 + b _080392A0 + .pool +_08039280: + ldr r0, =gUnknown_0831AA08 + lsls r1, r2, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + lsls r0, 26 + lsrs r0, 30 + b _080392A0 + .pool +_08039294: + ldr r0, =gUnknown_0831AA08 + lsls r1, r2, 2 + adds r1, r0 + ldr r0, [r1] + lsls r0, 8 + lsrs r0, 22 +_080392A0: + pop {r1} + bx r1 + .pool + thumb_func_end sub_80391E0 + + thumb_func_start sub_80392A8 +sub_80392A8: @ 80392A8 + push {r4,lr} + sub sp, 0x8 + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + bl SetVBlankCallback + movs r4, 0 + str r4, [sp, 0x4] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x05006000 + add r0, sp, 0x4 + bl CpuSet + bl sub_80A1A74 + ldr r0, =0x02022e14 + strh r4, [r0] + ldr r0, =0x02022e16 + strh r4, [r0] + ldr r0, =0x02022e18 + strh r4, [r0] + ldr r0, =0x02022e1a + strh r4, [r0] + ldr r0, =0x02022e1c + strh r4, [r0] + ldr r0, =0x02022e1e + strh r4, [r0] + ldr r0, =0x02022e20 + strh r4, [r0] + ldr r0, =0x02022e22 + strh r4, [r0] + bl c2_berry_program_update_menu + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + bl sub_803570C +_080392FE: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80363C4 + adds r4, 0x1 + cmp r4, 0x1 + ble _080392FE + bl ResetAllObjectData + bl clear_tasks + bl ResetObjectPaletteAllocator + ldr r1, =0x0300301c + movs r0, 0x4 + strb r0, [r1] + ldr r0, =vblank_cb_08078BB4 + bl SetVBlankCallback + ldr r0, =sub_803937C + bl SetMainCallback2 + movs r0, 0x1 + negs r0, r0 + movs r4, 0 + str r4, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r0, =0x02024332 + strb r4, [r0] + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80392A8 + + thumb_func_start sub_803937C +sub_803937C: @ 803937C + push {lr} + bl sub_803939C + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl RunTextPrinters + bl fade_and_return_progress_probably + bl RunActiveTasks + pop {r0} + bx r0 + thumb_func_end sub_803937C + + thumb_func_start sub_803939C +sub_803939C: @ 803939C + push {r4,r5,lr} + sub sp, 0x4 + ldr r0, =0x02024332 + ldrb r1, [r0] + adds r4, r0, 0 + cmp r1, 0xC + bls _080393AC + b _0803975E +_080393AC: + lsls r0, r1, 2 + ldr r1, =_080393C0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080393C0: + .4byte _080393F4 + .4byte _08039414 + .4byte _08039450 + .4byte _08039470 + .4byte _0803949C + .4byte _080394D8 + .4byte _0803957C + .4byte _08039704 + .4byte _080395CC + .4byte _08039610 + .4byte _08039678 + .4byte _080396A8 + .4byte _08039704 +_080393F4: + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + ldr r1, =0x02024332 + ldrb r0, [r1] + adds r0, 0x1 + b _0803975C + .pool +_08039414: + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08039434 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _08039434 + ldr r0, =sub_80B3AF8 + movs r1, 0x5 + bl AddTask +_08039434: + ldr r1, =0x02024332 + ldrb r0, [r1] + adds r0, 0x1 + b _0803975C + .pool +_08039450: + ldr r0, =sub_80B3AF8 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + beq _0803945E + b _0803975E +_0803945E: + ldr r1, =0x02024332 + ldrb r0, [r1] + adds r0, 0x1 + b _0803975C + .pool +_08039470: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0803947E + b _0803975E +_0803947E: + ldr r0, =gUnknown_085CD28F + movs r1, 0 + bl battle_show_message_maybe + ldr r1, =0x02024332 + ldrb r0, [r1] + adds r0, 0x1 + b _0803975C + .pool +_0803949C: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + beq _080394AC + b _0803975E +_080394AC: + str r0, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + ldr r0, =gUnknown_085CCABB + movs r1, 0xC + bl battle_show_message_maybe + ldr r4, =0x02024332 + movs r0, 0x1 + strb r0, [r4, 0x1] + bl sub_8056B74 + b _080396EA + .pool +_080394D8: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08039500 + ldrb r0, [r4, 0x1] + cmp r0, 0 + bne _080394EC + b _0803975E +_080394EC: + movs r0, 0x5 + bl audio_play + ldrb r0, [r4, 0x1] + bl sub_8056BAC + movs r0, 0 + b _0803951E + .pool +_08039500: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08039526 + ldrb r0, [r4, 0x1] + cmp r0, 0 + beq _08039510 + b _0803975E +_08039510: + movs r0, 0x5 + bl audio_play + ldrb r0, [r4, 0x1] + bl sub_8056BAC + movs r0, 0x1 +_0803951E: + strb r0, [r4, 0x1] + bl sub_8056B74 + b _0803975E +_08039526: + movs r5, 0x1 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _08039560 + movs r0, 0x5 + bl audio_play + ldr r4, =0x02024332 + ldrb r0, [r4, 0x1] + cmp r0, 0 + beq _08039540 + b _080396EA +_08039540: + str r5, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + bl sub_8185338 + strb r0, [r4, 0x1] + movs r0, 0xA + strb r0, [r4] + b _0803975E + .pool +_08039560: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0803956A + b _0803975E +_0803956A: + movs r0, 0x5 + bl audio_play + ldr r1, =0x02024332 + ldrb r0, [r1] + adds r0, 0x1 + b _0803975C + .pool +_0803957C: + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0803958A + b _0803975E +_0803958A: + str r0, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080395B4 + bl sub_800ADF8 + ldr r0, =gUnknown_0824978D + movs r1, 0 + bl battle_show_message_maybe +_080395B4: + ldr r1, =0x02024332 + ldrb r0, [r1] + adds r0, 0x1 + b _0803975C + .pool +_080395CC: + ldrb r0, [r4, 0x1] + subs r0, 0x1 + strb r0, [r4, 0x1] + lsls r0, 24 + cmp r0, 0 + beq _080395DA + b _0803975E +_080395DA: + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080395F6 + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _080395F6 + bl sub_800AC34 +_080395F6: + ldr r1, =0x02024332 + ldrb r0, [r1] + adds r0, 0x1 + b _0803975C + .pool +_08039610: + ldr r2, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + adds r3, r2, 0 + cmp r0, 0 + beq _08039634 + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _08039634 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08039634 + b _0803975E +_08039634: + ldr r0, =0x00000439 + adds r2, r3, r0 + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08039650 + b _0803975E +_08039650: + ldr r0, [r3, 0x8] + bl SetMainCallback2 + bl sub_8057028 + bl dp11_free + bl sub_805F094 + b _0803975E + .pool +_08039678: + ldrb r0, [r4, 0x1] + cmp r0, 0x1 + bne _080396A0 + movs r0, 0x37 + bl audio_play + ldr r0, =gUnknown_085CD2CB +_08039686: + bl get_battle_strings_ + ldr r0, =0x02022e2c + movs r1, 0 + bl battle_show_message_maybe + movs r0, 0x80 + strb r0, [r4, 0x1] + b _080396EA + .pool +_080396A0: + ldr r0, =gUnknown_08242481 + b _08039686 + .pool +_080396A8: + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0803975E + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _0803975E + ldr r4, =0x02024332 + ldrb r0, [r4, 0x1] + subs r0, 0x1 + strb r0, [r4, 0x1] + lsls r0, 24 + cmp r0, 0 + bne _0803975E + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080396EA + bl sub_800ADF8 + ldr r0, =gUnknown_0824978D + movs r1, 0 + bl battle_show_message_maybe +_080396EA: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _0803975E + .pool +_08039704: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + bne _0803975E + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _08039744 + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0803975E + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + b _0803974A + .pool +_08039744: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] +_0803974A: + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, =0x02024332 + movs r0, 0x20 + strb r0, [r1, 0x1] + movs r0, 0x8 +_0803975C: + strb r0, [r1] +_0803975E: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803939C + + thumb_func_start shedinja_something +shedinja_something: @ 803976C + push {r4,r5,lr} + sub sp, 0x10 + adds r4, r0, 0 + add r5, sp, 0xC + movs r0, 0x1 + strb r0, [r5] + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + ldr r1, =0x0000012f + cmp r0, r1 + bne _080397B4 + adds r0, r4, 0 + movs r1, 0x3 + bl pokemon_getattr + ldrb r1, [r5] + cmp r0, r1 + beq _080397B4 + adds r0, r4, 0 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + ldr r1, =gUnknown_0831ACA0 + mov r0, sp + bl CompareStringWithoutExtendedControlCodes + cmp r0, 0 + bne _080397B4 + adds r0, r4, 0 + movs r1, 0x3 + adds r2, r5, 0 + bl pokemon_setattr +_080397B4: + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end shedinja_something + + thumb_func_start sub_80397C4 +sub_80397C4: @ 80397C4 + ldr r2, =gUnknown_0831ABA0 + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + lsls r1, 3 + adds r1, r0 + ldrb r0, [r1, 0x3] + lsls r0, 3 + bx lr + .pool + thumb_func_end sub_80397C4 + + thumb_func_start oac_poke_opponent +oac_poke_opponent: @ 80397DC + push {lr} + sub sp, 0x4 + ldr r1, =sub_803980C + str r1, [r0, 0x1C] + movs r1, 0 + bl StartObjectImageAnimIfDifferent + movs r0, 0x80 + lsls r0, 10 + ldr r1, =0x00002108 + str r1, [sp] + movs r1, 0 + movs r2, 0xA + movs r3, 0xA + bl pal_fade_maybe + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end oac_poke_opponent + + thumb_func_start sub_803980C +sub_803980C: @ 803980C + push {lr} + adds r2, r0, 0 + ldr r0, =0x020243fc + ldrh r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0803982C + ldrh r0, [r2, 0x24] + adds r0, 0x2 + strh r0, [r2, 0x24] + lsls r0, 16 + cmp r0, 0 + bne _0803982C + ldr r0, =sub_8039838 + str r0, [r2, 0x1C] +_0803982C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_803980C + + thumb_func_start sub_8039838 +sub_8039838: @ 8039838 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08039880 + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r0, 24 + bl sub_8076918 + ldr r1, =0x03005d70 + movs r2, 0x2E + ldrsh r0, [r4, r2] + adds r0, r1 + ldrb r0, [r0] + bl sub_80729D0 + ldr r0, =sub_8039894 + str r0, [r4, 0x1C] + adds r0, r4, 0 + movs r1, 0 + bl StartObjectImageAnimIfDifferent + movs r0, 0x80 + lsls r0, 10 + ldr r1, =0x00002108 + str r1, [sp] + movs r1, 0 + movs r2, 0xA + movs r3, 0 + bl pal_fade_maybe +_08039880: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039838 + + thumb_func_start sub_8039894 +sub_8039894: @ 8039894 + push {lr} + adds r2, r0, 0 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080398B0 + ldrh r1, [r2, 0x32] + adds r0, r2, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_806ECEC +_080398B0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039894 + + thumb_func_start nullsub_18 +nullsub_18: @ 80398B8 + bx lr + thumb_func_end nullsub_18 + + thumb_func_start sub_80398BC +sub_80398BC: @ 80398BC + movs r1, 0x6 + strh r1, [r0, 0x34] + movs r1, 0x1 + strh r1, [r0, 0x36] + ldr r1, =sub_80398D0 + str r1, [r0, 0x1C] + bx lr + .pool + thumb_func_end sub_80398BC + + thumb_func_start sub_80398D0 +sub_80398D0: @ 80398D0 + push {r4,lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x36] + subs r0, 0x1 + strh r0, [r3, 0x36] + lsls r0, 16 + cmp r0, 0 + bne _08039924 + movs r0, 0x8 + strh r0, [r3, 0x36] + movs r0, 0x3E + adds r0, r3 + mov r12, r0 + ldrb r2, [r0] + lsls r0, r2, 29 + lsrs r0, 31 + movs r1, 0x1 + eors r1, r0 + lsls r1, 2 + movs r4, 0x5 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] + ldrh r0, [r3, 0x34] + subs r0, 0x1 + strh r0, [r3, 0x34] + lsls r0, 16 + asrs r2, r0, 16 + cmp r2, 0 + bne _08039924 + ldrb r1, [r1] + adds r0, r4, 0 + ands r0, r1 + mov r1, r12 + strb r0, [r1] + ldr r0, =nullsub_18 + str r0, [r3, 0x1C] + ldr r0, =0x02022f88 + str r2, [r0] +_08039924: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80398D0 + + thumb_func_start sub_8039934 +sub_8039934: @ 8039934 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r9, r0 + ldrh r0, [r0, 0x2E] + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r6, 2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2] + cmp r0, 0 + beq _0803995C + adds r4, r0, 0 + b _08039960 + .pool +_0803995C: + mov r0, r9 + ldrh r4, [r0, 0x32] +_08039960: + ldr r1, =0x0202406e + lsls r0, r6, 1 + adds r5, r0, r1 + ldrh r0, [r5] + movs r1, 0x64 + mov r8, r1 + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + ldr r7, =0x02024744 + adds r0, r7 + movs r1, 0 + bl pokemon_getattr + cmp r4, 0xC9 + bne _080399E4 + ldrh r0, [r5] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r7 + movs r1, 0 + bl pokemon_getattr + adds r2, r0, 0 + movs r0, 0xC0 + lsls r0, 18 + ands r0, r2 + lsrs r0, 18 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r2 + lsrs r1, 12 + orrs r0, r1 + movs r1, 0xC0 + lsls r1, 2 + ands r1, r2 + lsrs r1, 6 + orrs r0, r1 + movs r1, 0x3 + ands r1, r2 + orrs r0, r1 + movs r1, 0x1C + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _080399D0 + movs r0, 0xC9 + b _080399DA + .pool +_080399D0: + movs r1, 0xCE + lsls r1, 1 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 +_080399DA: + ldr r1, =gUnknown_08300D38 + lsls r0, 2 + b _08039A1C + .pool +_080399E4: + ldr r0, =0x00000181 + cmp r4, r0 + bne _08039A08 + ldr r0, =gUnknown_08525F78 + ldr r1, =0x020244e4 + adds r1, r6, r1 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + b _08039A20 + .pool +_08039A08: + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + bls _08039A18 + ldr r0, =gUnknown_08300D38 + b _08039A1E + .pool +_08039A18: + ldr r1, =gUnknown_08300D38 + lsls r0, r4, 2 +_08039A1C: + adds r0, r1 +_08039A1E: + ldrb r0, [r0, 0x1] +_08039A20: + lsrs r1, r0, 3 + movs r0, 0x8 + subs r0, r1 + mov r1, r9 + strh r0, [r1, 0x34] + movs r0, 0x1 + strh r0, [r1, 0x36] + ldr r0, =sub_8039A48 + str r0, [r1, 0x1C] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039934 + + thumb_func_start sub_8039A48 +sub_8039A48: @ 8039A48 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x36] + subs r0, 0x1 + strh r0, [r4, 0x36] + lsls r0, 16 + cmp r0, 0 + bne _08039AC8 + movs r0, 0x2 + strh r0, [r4, 0x36] + ldrh r0, [r4, 0x26] + adds r0, 0x8 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x34] + subs r0, 0x1 + strh r0, [r4, 0x34] + lsls r0, 16 + cmp r0, 0 + bge _08039A7C + adds r0, r4, 0 + bl obj_free_rotscale_entry + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + b _08039AC8 +_08039A7C: + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r0, 24 + bl battle_get_per_side_status + ldr r1, =0x020244d4 + ldr r1, [r1] + lsls r0, 24 + lsrs r0, 22 + adds r1, 0x4 + adds r1, r0 + ldr r2, =0x020244e4 + movs r3, 0x2E + ldrsh r0, [r4, r3] + adds r0, r2 + ldrb r0, [r0] + lsls r0, 11 + ldr r1, [r1] + adds r1, r0 + movs r2, 0x34 + ldrsh r0, [r4, r2] + lsls r0, 8 + adds r1, r0 + movs r2, 0 + movs r0, 0xFF +_08039AAE: + strb r2, [r1] + adds r1, 0x1 + subs r0, 0x1 + cmp r0, 0 + bge _08039AAE + ldr r0, =0x020244e4 + movs r3, 0x2E + ldrsh r1, [r4, r3] + adds r1, r0 + ldrb r1, [r1] + adds r0, r4, 0 + bl StartObjectImageAnim +_08039AC8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039A48 + + thumb_func_start sub_8039AD8 +sub_8039AD8: @ 8039AD8 + movs r1, 0x8 + strh r1, [r0, 0x34] + adds r1, r0, 0 + adds r1, 0x3E + ldrb r1, [r1] + lsls r1, 29 + lsrs r1, 31 + strh r1, [r0, 0x36] + ldr r1, =sub_8039AF4 + str r1, [r0, 0x1C] + bx lr + .pool + thumb_func_end sub_8039AD8 + + thumb_func_start sub_8039AF4 +sub_8039AF4: @ 8039AF4 + push {lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x34] + subs r0, 0x1 + strh r0, [r3, 0x34] + lsls r0, 16 + cmp r0, 0 + bne _08039B26 + movs r0, 0x3E + adds r0, r3 + mov r12, r0 + ldrb r2, [r0] + lsls r0, r2, 29 + lsrs r0, 31 + movs r1, 0x1 + eors r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] + movs r0, 0x8 + strh r0, [r3, 0x34] +_08039B26: + pop {r0} + bx r0 + thumb_func_end sub_8039AF4 + + thumb_func_start sub_8039B2C +sub_8039B2C: @ 8039B2C + movs r1, 0x3E + adds r1, r0 + mov r12, r1 + movs r1, 0x1 + ldrh r2, [r0, 0x36] + ands r2, r1 + lsls r2, 2 + mov r1, r12 + ldrb r3, [r1] + movs r1, 0x5 + negs r1, r1 + ands r1, r3 + orrs r1, r2 + mov r2, r12 + strb r1, [r2] + movs r1, 0 + strh r1, [r0, 0x36] + ldr r1, =nullsub_18 + str r1, [r0, 0x1C] + bx lr + .pool + thumb_func_end sub_8039B2C + + thumb_func_start sub_8039B58 +sub_8039B58: @ 8039B58 + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08039BA0 + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08039B80 + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x02000002 + ands r0, r1 + cmp r0, 0 + beq _08039B94 +_08039B80: + ldrh r0, [r4, 0x32] + bl sub_806F0D4 + lsls r0, 24 + cmp r0, 0 + beq _08039B94 + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectImageAnim +_08039B94: + ldrh r1, [r4, 0x32] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x1 + bl sub_806ECEC +_08039BA0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039B58 + + thumb_func_start sub_8039BB4 +sub_8039BB4: @ 8039BB4 + ldr r1, =oac_poke_ally_ + str r1, [r0, 0x1C] + bx lr + .pool + thumb_func_end sub_8039BB4 + + thumb_func_start oac_poke_ally_ +oac_poke_ally_: @ 8039BC0 + push {lr} + adds r2, r0, 0 + ldr r0, =0x020243fc + ldrh r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08039BE4 + ldrh r0, [r2, 0x24] + subs r0, 0x2 + strh r0, [r2, 0x24] + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0 + bne _08039BE4 + ldr r0, =nullsub_19 + str r0, [r2, 0x1C] + strh r1, [r2, 0x30] +_08039BE4: + pop {r0} + bx r0 + .pool + thumb_func_end oac_poke_ally_ + + thumb_func_start sub_8039BF0 +sub_8039BF0: @ 8039BF0 + ldr r1, =nullsub_19 + str r1, [r0, 0x1C] + bx lr + .pool + thumb_func_end sub_8039BF0 + + thumb_func_start nullsub_19 +nullsub_19: @ 8039BFC + bx lr + thumb_func_end nullsub_19 + + thumb_func_start sub_8039C00 +sub_8039C00: @ 8039C00 + push {lr} + adds r2, r0, 0 + ldr r0, =0x020243fc + ldrh r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08039C20 + ldrh r0, [r2, 0x30] + ldrh r1, [r2, 0x24] + adds r0, r1 + strh r0, [r2, 0x24] + ldrh r0, [r2, 0x32] + ldrh r1, [r2, 0x26] + adds r0, r1 + strh r0, [r2, 0x26] +_08039C20: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039C00 + + thumb_func_start dp11b_obj_instanciate +dp11b_obj_instanciate: @ 8039C28 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + lsls r3, 24 + lsrs r3, 24 + mov r10, r3 + cmp r1, 0 + beq _08039C64 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r2, r4, 1 + adds r0, r2, r4 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + b _08039C76 + .pool +_08039C64: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r2, r4, 1 + adds r0, r2, r4 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 +_08039C76: + ands r0, r1 + adds r6, r2, 0 + cmp r0, 0 + bne _08039D2C + ldr r0, =objc_dp11b_pingpong + bl object_new_hidden_with_callback + lsls r0, 24 + lsrs r5, r0, 24 + mov r0, r8 + cmp r0, 0x1 + bne _08039CD0 + ldr r0, =0x03005d70 + adds r0, r4, r0 + ldrb r7, [r0] + ldr r2, =0x020244d0 + ldr r0, [r2] + ldr r0, [r0, 0x4] + adds r1, r6, r4 + lsls r1, 2 + adds r0, r1, r0 + strb r5, [r0, 0x2] + ldr r0, [r2] + ldr r0, [r0, 0x4] + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x2 + orrs r0, r2 + strb r0, [r1] + ldr r2, =0x02020630 + lsls r3, r5, 4 + adds r0, r3, r5 + lsls r0, 2 + adds r0, r2 + movs r1, 0x80 + b _08039CFE + .pool +_08039CD0: + ldr r0, =0x020241e4 + adds r0, r4, r0 + ldrb r7, [r0] + ldr r2, =0x020244d0 + ldr r0, [r2] + ldr r0, [r0, 0x4] + adds r1, r6, r4 + lsls r1, 2 + adds r0, r1, r0 + strb r5, [r0, 0x3] + ldr r0, [r2] + ldr r0, [r0, 0x4] + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + ldr r2, =0x02020630 + lsls r3, r5, 4 + adds r0, r3, r5 + lsls r0, 2 + adds r0, r2 + movs r1, 0xC0 +_08039CFE: + strh r1, [r0, 0x2E] + adds r4, r2, 0 + adds r1, r3, r5 + lsls r1, 2 + adds r1, r4 + mov r2, r9 + lsls r0, r2, 24 + asrs r0, 24 + movs r2, 0 + strh r0, [r1, 0x30] + mov r3, r10 + lsls r0, r3, 24 + asrs r0, 24 + strh r0, [r1, 0x32] + strh r7, [r1, 0x34] + mov r0, r8 + strh r0, [r1, 0x36] + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r0, r4 + strh r2, [r0, 0x24] + strh r2, [r0, 0x26] +_08039D2C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end dp11b_obj_instanciate + + thumb_func_start dp11b_obj_free +dp11b_obj_free: @ 8039D48 + push {r4-r6,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x1 + bne _08039D9C + ldr r6, =0x020244d0 + ldr r0, [r6] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r5, r0, 2 + adds r3, r5, r1 + ldrb r1, [r3] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08039DEA + ldr r2, =0x02020630 + ldrb r1, [r3, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x34] + lsls r1, 24 + lsrs r4, r1, 24 + bl RemoveObjectAndFreeTiles + ldr r0, [r6] + ldr r1, [r0, 0x4] + adds r1, r5, r1 + ldrb r2, [r1] + movs r0, 0x3 + negs r0, r0 + b _08039DD6 + .pool +_08039D9C: + ldr r6, =0x020244d0 + ldr r0, [r6] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r5, r0, 2 + adds r3, r5, r1 + ldrb r1, [r3] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08039DEA + ldr r2, =0x02020630 + ldrb r1, [r3, 0x3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x34] + lsls r1, 24 + lsrs r4, r1, 24 + bl RemoveObjectAndFreeTiles + ldr r0, [r6] + ldr r1, [r0, 0x4] + adds r1, r5, r1 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 +_08039DD6: + ands r0, r2 + strb r0, [r1] + ldr r0, =0x02020630 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r0 + movs r0, 0 + strh r0, [r1, 0x24] + strh r0, [r1, 0x26] +_08039DEA: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end dp11b_obj_free + + thumb_func_start objc_dp11b_pingpong +objc_dp11b_pingpong: @ 8039DF8 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x34] + lsls r0, 24 + lsrs r5, r0, 24 + movs r1, 0x36 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _08039E10 + movs r2, 0x2E + ldrsh r0, [r4, r2] + b _08039E14 +_08039E10: + movs r1, 0x2E + ldrsh r0, [r4, r1] +_08039E14: + movs r2, 0x32 + ldrsh r1, [r4, r2] + bl sine + ldr r2, =0x02020630 + lsls r1, r5, 4 + adds r1, r5 + lsls r1, 2 + adds r1, r2 + ldrh r2, [r4, 0x32] + adds r0, r2 + strh r0, [r1, 0x26] + ldrh r0, [r4, 0x30] + ldrh r1, [r4, 0x2E] + adds r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x2E] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end objc_dp11b_pingpong + + thumb_func_start sub_8039E44 +sub_8039E44: @ 8039E44 + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08039E5C + ldrh r1, [r2, 0x32] + adds r0, r2, 0 + bl sub_806EEB4 +_08039E5C: + pop {r0} + bx r0 + thumb_func_end sub_8039E44 + + thumb_func_start sub_8039E60 +sub_8039E60: @ 8039E60 + push {r4,lr} + adds r4, r0, 0 + bl sub_8039E9C + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08039E7A + ldr r0, =nullsub_19 + str r0, [r4, 0x1C] +_08039E7A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039E60 + + thumb_func_start sub_8039E84 +sub_8039E84: @ 8039E84 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl StartObjectImageAnim + ldr r0, =sub_8039E60 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039E84 + + thumb_func_start sub_8039E9C +sub_8039E9C: @ 8039E9C + push {lr} + adds r2, r0, 0 + adds r0, 0x2C + ldrb r1, [r0] + movs r0, 0x3F + ands r0, r1 + cmp r0, 0 + bne _08039EBE + ldr r1, =gUnknown_0831ACE0 + adds r0, r2, 0 + adds r0, 0x2B + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + adds r0, r2, 0 + adds r0, 0x28 + strb r1, [r0] +_08039EBE: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039E9C + + thumb_func_start nullsub_20 +nullsub_20: @ 8039EC8 + bx lr + thumb_func_end nullsub_20 + + thumb_func_start sub_8039ECC +sub_8039ECC: @ 8039ECC + push {lr} + bl sub_8039F40 + ldr r1, =0x02024332 + movs r0, 0 + strb r0, [r1, 0x1] + ldr r1, =0x03005d04 + ldr r0, =bc_8012FAC + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039ECC + + thumb_func_start sub_8039EF0 +sub_8039EF0: @ 8039EF0 + push {r4,r5,lr} + ldr r0, =0x03005d04 + ldr r0, [r0] + bl _call_via_r0 + ldr r1, =0x02024064 + movs r0, 0 + strb r0, [r1] + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r0, 0 + beq _08039F2A + ldr r5, =0x03005d60 + adds r4, r1, 0 +_08039F0C: + ldrb r0, [r4] + lsls r0, 2 + adds r0, r5 + ldr r0, [r0] + bl _call_via_r0 + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _08039F0C +_08039F2A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039EF0 + + thumb_func_start sub_8039F40 +sub_8039F40: @ 8039F40 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r0, 0 + bl sub_803D580 + bl sub_803D6A0 + movs r2, 0 + movs r3, 0 + ldr r0, =0x02024260 + mov r10, r0 + ldr r1, =0x02024258 + mov r9, r1 + ldr r0, =0x02024250 + mov r8, r0 + ldr r1, =0x02024248 + mov r12, r1 + ldr r5, =0x020242bc + movs r4, 0 + ldr r7, =0x02024240 + ldr r6, =0x02024268 +_08039F70: + ldr r0, =0x020242ac + adds r0, r4, r0 + str r3, [r0] + movs r1, 0 +_08039F78: + adds r0, r5, r1 + strb r3, [r0] + adds r1, 0x1 + cmp r1, 0x1B + bls _08039F78 + movs r0, 0x2 + strb r0, [r5, 0x16] + ldr r1, =0x02024284 + adds r0, r2, r1 + strb r3, [r0] + mov r0, r12 + strh r3, [r0] + mov r1, r8 + strh r3, [r1] + mov r0, r9 + strh r3, [r0] + mov r1, r10 + strh r3, [r1] + ldr r0, =0x02024270 + adds r1, r2, r0 + movs r0, 0xFF + strb r0, [r1] + strh r3, [r6] + strh r3, [r7] + ldr r1, =0x020244a8 + ldr r0, [r1] + ldr r0, [r0, 0x4] + adds r0, r4 + str r3, [r0] + ldr r1, =0x02024230 + adds r0, r4, r1 + str r3, [r0] + movs r0, 0x2 + add r10, r0 + add r9, r0 + add r8, r0 + add r12, r0 + adds r5, 0x1C + adds r4, 0x4 + adds r7, 0x2 + adds r6, 0x2 + adds r2, 0x1 + cmp r2, 0x3 + ble _08039F70 + movs r5, 0 + ldr r3, =0x02024294 + ldr r4, =0x0202428e + movs r2, 0x1 +_08039FD8: + strh r5, [r4] + movs r1, 0 +_08039FDC: + adds r0, r3, r1 + strb r5, [r0] + adds r1, 0x1 + cmp r1, 0xB + bls _08039FDC + adds r3, 0xC + adds r4, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _08039FD8 + movs r1, 0 + ldr r2, =0x0202420b + strb r1, [r2] + ldr r0, =0x0202420c + strb r1, [r0] + ldr r2, =0x020243cc + strh r1, [r2] + ldr r1, =0x020243d0 + movs r2, 0 + movs r3, 0 +_0803A004: + adds r0, r1, r2 + strb r3, [r0] + adds r2, 0x1 + cmp r2, 0x2B + bls _0803A004 + ldr r2, =0x02024280 + movs r0, 0 + str r0, [r2] + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 17 + ands r0, r1 + cmp r0, 0 + bne _0803A090 + movs r0, 0x2 + ands r1, r0 + cmp r1, 0 + bne _0803A0AE + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r1, [r0, 0x15] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0803A0AE + movs r0, 0x80 + b _0803A0AC + .pool +_0803A090: + ldr r0, =0x02000002 + ands r1, r0 + cmp r1, 0 + bne _0803A0AE + bl sub_8185FB8 + lsls r0, 24 + cmp r0, 0 + beq _0803A0AE + ldr r1, =0x02024280 + ldr r0, [r1] + movs r1, 0x80 + orrs r0, r1 + ldr r2, =0x02024280 +_0803A0AC: + str r0, [r2] +_0803A0AE: + ldr r3, =0x02024474 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x15] + lsls r0, 30 + lsrs r0, 31 + movs r1, 0 + strb r0, [r3, 0x1D] + ldr r0, =0x02024212 + strb r1, [r0] + ldr r0, =0x0202433a + strb r1, [r0] + ldr r0, =0x02024068 + str r1, [r0] + ldr r0, =0x0202432e + movs r2, 0 + strh r1, [r0] + ldr r1, =0x020244a8 + ldr r0, [r1] + ldr r0, [r0, 0x8] + adds r0, 0x20 + strb r2, [r0] + ldr r0, [r1] + ldr r0, [r0, 0xC] + adds r0, 0x20 + strb r2, [r0] + ldr r5, =0x0202432c + ldr r6, =0x020241f0 + ldr r7, =0x020243fc + ldr r0, =0x03005d54 + mov r8, r0 + ldr r1, =0x02024210 + mov r9, r1 + ldr r2, =0x02024744 + mov r10, r2 + ldr r1, =0x02024332 + movs r2, 0 + adds r0, r1, 0x7 +_0803A0FA: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _0803A0FA + movs r4, 0 + strh r4, [r5] + movs r0, 0 + str r0, [r6] + strh r0, [r7] + strb r4, [r3, 0x18] + strb r4, [r3, 0x19] + mov r0, r8 + strb r4, [r0] + mov r1, r9 + strb r4, [r1] + ldr r5, =0x0202449c + ldr r0, [r5] + adds r0, 0x6C + strb r4, [r0] + ldr r0, [r5] + adds r0, 0x79 + strb r4, [r0] + ldr r0, [r5] + adds r0, 0x7A + strb r4, [r0] + mov r0, r10 + movs r1, 0xB + bl pokemon_getattr + ldr r6, [r5] + adds r6, 0x7C + ldr r2, =gBaseStats + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r1, [r1, 0x8] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x000004fb + bl __divsi3 + strb r0, [r6] + ldr r0, [r5] + adds r0, 0x7B + movs r1, 0x3 + strb r1, [r0] + ldr r0, [r5] + strb r4, [r0, 0x12] + ldr r0, [r5] + adds r0, 0x4A + movs r1, 0x1 + strb r1, [r0] + movs r2, 0 + movs r1, 0 + adds r6, r5, 0 +_0803A16A: + ldr r0, [r5] + adds r0, r2, r0 + adds r0, 0x98 + strb r1, [r0] + ldr r0, [r5] + adds r0, r2, r0 + adds r0, 0xB8 + strb r1, [r0] + ldr r0, [r5] + adds r0, r2, r0 + adds r0, 0xC8 + strb r1, [r0] + ldr r0, [r5] + adds r0, r2, r0 + adds r0, 0xD0 + strb r1, [r0] + ldr r0, [r5] + adds r0, r2, r0 + adds r0, 0xE0 + strb r1, [r0] + ldr r0, [r5] + adds r0, r2, r0 + adds r0, 0xE8 + strb r1, [r0] + ldr r0, [r5] + adds r0, r2, r0 + adds r0, 0xF0 + strb r1, [r0] + ldr r0, [r5] + adds r0, r2, r0 + adds r0, 0xF8 + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x7 + ble _0803A16A + movs r2, 0 + ldr r4, =0x0202449c + movs r3, 0xA5 + lsls r3, 2 + movs r1, 0x6 +_0803A1BA: + ldr r0, [r4] + adds r0, r2, r0 + adds r0, r3 + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x3 + ble _0803A1BA + ldr r0, [r6] + adds r0, 0xDF + movs r1, 0 + strb r1, [r0] + ldr r0, [r6] + adds r0, 0x92 + strb r1, [r0] + bl GenerateRandomNumber + ldr r1, =0x02024330 + strh r0, [r1] + ldr r1, =0x03005d10 + movs r2, 0 + movs r3, 0 +_0803A1E4: + adds r0, r1, r2 + strb r3, [r0] + adds r2, 0x1 + cmp r2, 0x43 + bls _0803A1E4 + ldr r0, =0x02024744 + bl sub_806EBA4 + ldr r3, =0x03005d10 + movs r1, 0x1 + ands r1, r0 + lsls r1, 6 + ldrb r2, [r3, 0x5] + movs r0, 0x41 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x5] + ldr r2, =0x0202449c + ldr r0, [r2] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + ldr r2, =0x000002a1 + adds r0, r2 + strb r1, [r0] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039F40 + + thumb_func_start sub_803A284 +sub_803A284: @ 803A284 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + ldr r4, =0x020242bc + ldr r5, =0x02024064 + ldrb r1, [r5] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + mov r1, sp + adds r0, r4 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldr r0, [r0] + str r0, [r1] + ldr r2, =gBattleMoves + ldr r3, =0x020241ea + ldrh r1, [r3] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + mov r12, r4 + mov r9, r5 + ldr r6, =0x020242ac + mov r10, r6 + cmp r0, 0x7F + beq _0803A35C + movs r5, 0 + mov r6, r9 + movs r4, 0x58 + ldr r2, =0x02024084 + adds r2, 0x18 + movs r1, 0x6 +_0803A2D4: + ldrb r0, [r6] + muls r0, r4 + adds r0, r5, r0 + adds r0, r2 + strb r1, [r0] + adds r5, 0x1 + cmp r5, 0x7 + ble _0803A2D4 + movs r5, 0 + ldr r7, =0x0202406c + ldrb r7, [r7] + cmp r5, r7 + bge _0803A348 + ldr r0, =0x020240d4 + mov r8, r0 + ldr r4, =0x020242bc + ldr r3, =0x020242ac +_0803A2F6: + movs r0, 0x58 + muls r0, r5 + mov r1, r8 + adds r2, r0, r1 + ldr r1, [r2] + movs r0, 0x80 + lsls r0, 19 + ands r0, r1 + cmp r0, 0 + beq _0803A31A + ldrb r0, [r4, 0x14] + ldr r6, =0x02024064 + ldrb r6, [r6] + cmp r0, r6 + bne _0803A31A + ldr r0, =0xfbffffff + ands r1, r0 + str r1, [r2] +_0803A31A: + ldr r1, [r3] + movs r0, 0x18 + ands r0, r1 + cmp r0, 0 + beq _0803A33A + ldrb r0, [r4, 0x15] + ldr r7, =0x02024064 + ldrb r7, [r7] + cmp r0, r7 + bne _0803A33A + movs r0, 0x19 + negs r0, r0 + ands r1, r0 + str r1, [r3] + movs r0, 0 + strb r0, [r4, 0x15] +_0803A33A: + adds r4, 0x1C + adds r3, 0x4 + adds r5, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r5, r0 + blt _0803A2F6 +_0803A348: + ldr r1, =0x020241ea + ldrh r0, [r1] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + ldr r2, =gBattleMoves + adds r1, r2 + ldrb r0, [r1] + cmp r0, 0x7F + bne _0803A414 +_0803A35C: + mov r3, r9 + ldrb r1, [r3] + movs r0, 0x58 + adds r2, r1, 0 + muls r2, r0 + ldr r0, =0x02024084 + adds r0, 0x50 + adds r2, r0 + ldr r0, [r2] + ldr r1, =0x15100007 + ands r0, r1 + str r0, [r2] + ldrb r1, [r3] + lsls r1, 2 + add r1, r10 + ldr r0, [r1] + ldr r2, =0x0003043f + ands r0, r2 + str r0, [r1] + movs r5, 0 + ldr r6, =0x0202406c + ldrb r6, [r6] + cmp r5, r6 + bge _0803A430 + mov r7, r9 + movs r6, 0 +_0803A390: + ldrb r0, [r7] + bl battle_side_get_owner + adds r4, r0, 0 + lsls r0, r5, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _0803A3D0 + ldr r1, =0x020242ac + lsls r0, r5, 2 + adds r2, r0, r1 + ldr r1, [r2] + movs r0, 0x18 + ands r0, r1 + cmp r0, 0 + beq _0803A3D0 + ldr r0, =0x020242bc + adds r0, r6, r0 + ldrb r0, [r0, 0x15] + ldrb r3, [r7] + cmp r0, r3 + bne _0803A3D0 + movs r0, 0x19 + negs r0, r0 + ands r1, r0 + movs r0, 0x10 + orrs r1, r0 + str r1, [r2] +_0803A3D0: + adds r6, 0x1C + adds r5, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r5, r0 + blt _0803A390 + ldr r6, =0x020242bc + mov r12, r6 + ldr r7, =0x02024064 + mov r9, r7 + b _0803A430 + .pool +_0803A414: + mov r0, r9 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + ldr r1, =0x02024084 + adds r1, 0x50 + adds r0, r1 + movs r1, 0 + str r1, [r0] + mov r2, r9 + ldrb r0, [r2] + lsls r0, 2 + add r0, r10 + str r1, [r0] +_0803A430: + movs r5, 0 + ldr r3, =0x0202449c + mov r8, r3 + ldr r6, =0x020244ac + mov r10, r6 + ldr r7, =0x0202406c + ldrb r7, [r7] + cmp r5, r7 + bge _0803A490 + ldr r3, =0x020240d4 + ldr r7, =gUnknown_0832A328 + ldr r6, =0x02024064 +_0803A448: + movs r0, 0x58 + muls r0, r5 + adds r4, r0, r3 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r7 + ldr r0, [r0] + lsls r2, r0, 16 + ldr r1, [r4] + adds r0, r1, 0 + ands r0, r2 + cmp r0, 0 + beq _0803A466 + bics r1, r2 + str r1, [r4] +_0803A466: + ldr r1, [r4] + movs r0, 0xE0 + lsls r0, 8 + ands r0, r1 + cmp r0, 0 + beq _0803A486 + mov r2, r8 + ldr r0, [r2] + adds r0, r5, r0 + ldrb r0, [r0, 0x14] + ldrb r2, [r6] + cmp r0, r2 + bne _0803A486 + ldr r0, =0xffff1fff + ands r1, r0 + str r1, [r4] +_0803A486: + adds r5, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r5, r0 + blt _0803A448 +_0803A490: + mov r1, r9 + ldrb r0, [r1] + add r0, r10 + movs r1, 0 + strb r1, [r0] + mov r2, r9 + ldrb r0, [r2] + ldr r3, =0x020244b0 + adds r0, r3 + strb r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + mov r6, r12 + adds r1, r0, r6 + movs r5, 0 + movs r2, 0 +_0803A4B4: + adds r0, r1, r5 + strb r2, [r0] + adds r5, 0x1 + cmp r5, 0x1B + bls _0803A4B4 + ldr r7, =0x020241ea + ldrh r0, [r7] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + ldr r0, =gBattleMoves + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x7F + bne _0803A540 + mov r2, r9 + ldrb r1, [r2] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + mov r1, sp + ldrb r1, [r1, 0xA] + strb r1, [r0, 0xA] + ldrb r1, [r2] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + mov r1, sp + ldrb r1, [r1, 0x15] + strb r1, [r0, 0x15] + ldrb r0, [r2] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + add r1, r12 + mov r0, sp + ldrb r2, [r0, 0xF] + lsls r2, 28 + movs r4, 0xF + lsrs r2, 28 + ldrb r3, [r1, 0xF] + movs r0, 0x10 + negs r0, r0 + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0xF] + mov r3, r9 + ldrb r1, [r3] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + mov r1, sp + ldrb r1, [r1, 0xF] + lsrs r1, 4 + lsls r1, 4 + ldrb r2, [r0, 0xF] + ands r4, r2 + orrs r4, r1 + strb r4, [r0, 0xF] + ldrb r1, [r3] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + mov r1, sp + ldrb r1, [r1, 0x14] + strb r1, [r0, 0x14] +_0803A540: + movs r0, 0 + ldr r6, =0x0202427c + strb r0, [r6] + mov r7, r9 + ldrb r1, [r7] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + movs r4, 0 + movs r1, 0x2 + strb r1, [r0, 0x16] + ldrb r0, [r7] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + add r1, r12 + mov r0, sp + ldrb r0, [r0, 0x18] + movs r2, 0x2 + ands r2, r0 + ldrb r3, [r1, 0x18] + movs r0, 0x3 + negs r0, r0 + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0x18] + ldrb r0, [r7] + lsls r0, 1 + ldr r1, =0x02024248 + adds r0, r1 + movs r2, 0 + strh r4, [r0] + ldrb r0, [r7] + lsls r0, 1 + ldr r3, =0x02024250 + adds r0, r3 + strh r4, [r0] + ldrb r0, [r7] + lsls r0, 1 + ldr r6, =0x02024258 + adds r0, r6 + strh r4, [r0] + ldrb r0, [r7] + lsls r0, 1 + ldr r7, =0x02024260 + adds r0, r7 + strh r4, [r0] + mov r1, r9 + ldrb r0, [r1] + lsls r0, 1 + ldr r3, =0x02024240 + adds r0, r3 + strh r4, [r0] + ldrb r0, [r1] + ldr r6, =0x02024270 + adds r0, r6 + movs r1, 0xFF + strb r1, [r0] + mov r7, r9 + ldrb r0, [r7] + mov r3, r8 + ldr r1, [r3] + lsls r0, 1 + adds r0, r1 + adds r0, 0x98 + strb r2, [r0] + ldrb r0, [r7] + ldr r1, [r3] + lsls r0, 1 + adds r0, r1 + adds r0, 0x99 + strb r2, [r0] + ldrb r0, [r7] + ldr r1, [r3] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE0 + strb r2, [r0] + ldrb r0, [r7] + ldr r1, [r3] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE1 + strb r2, [r0] + ldrb r0, [r7] + ldr r1, [r3] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE2 + strb r2, [r0] + ldrb r0, [r7] + ldr r1, [r3] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE3 + strb r2, [r0] + ldrb r0, [r7] + ldr r1, [r3] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE4 + strb r2, [r0] + ldrb r0, [r7] + ldr r1, [r3] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE5 + strb r2, [r0] + ldrb r0, [r7] + ldr r1, [r3] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE6 + strb r2, [r0] + ldrb r0, [r7] + ldr r1, [r3] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE7 + strb r2, [r0] + ldr r1, [r3] + adds r1, 0x92 + ldrb r0, [r7] + lsls r0, 2 + ldr r6, =gUnknown_0832A328 + adds r0, r6 + ldr r2, [r0] + ldrb r0, [r1] + bics r0, r2 + strb r0, [r1] + movs r5, 0 + ldr r7, =0x0202406c + ldrb r7, [r7] + cmp r5, r7 + bge _0803A6B4 + mov r3, r9 + mov r7, r8 + movs r6, 0 +_0803A656: + ldrb r0, [r3] + cmp r5, r0 + beq _0803A68C + lsls r0, r5, 24 + lsrs r0, 24 + str r3, [sp, 0x1C] + bl battle_side_get_owner + adds r4, r0, 0 + ldr r3, [sp, 0x1C] + ldrb r0, [r3] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + ldr r3, [sp, 0x1C] + cmp r4, r0 + beq _0803A68C + ldr r0, [r7] + lsls r1, r5, 1 + adds r0, r1, r0 + adds r0, 0x98 + strb r6, [r0] + ldr r0, [r7] + adds r1, r0 + adds r1, 0x99 + strb r6, [r1] +_0803A68C: + ldrb r0, [r3] + ldr r1, [r7] + lsls r0, 1 + lsls r2, r5, 3 + adds r0, r2 + adds r0, r1 + adds r0, 0xE0 + strb r6, [r0] + ldrb r0, [r3] + ldr r1, [r7] + lsls r0, 1 + adds r0, r2 + adds r0, r1 + adds r0, 0xE1 + strb r6, [r0] + adds r5, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r5, r0 + blt _0803A656 +_0803A6B4: + mov r1, r9 + ldrb r0, [r1] + mov r2, r8 + ldr r1, [r2] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC8 + movs r2, 0 + strb r2, [r0] + mov r3, r9 + ldrb r0, [r3] + mov r6, r8 + ldr r1, [r6] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC9 + strb r2, [r0] + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r1, [r0, 0x4] + ldrb r0, [r3] + lsls r0, 2 + adds r1, r0 + movs r2, 0 + str r2, [r1] + ldr r0, =0x020241ea + strh r2, [r0] + ldr r0, [r6] + adds r0, 0xDA + movs r1, 0xFF + strb r1, [r0] + ldrb r0, [r3] + bl sub_81310F0 + mov r7, r9 + ldrb r0, [r7] + bl sub_8131130 + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803A284 + + thumb_func_start sub_803A75C +sub_803A75C: @ 803A75C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r5, 0 + ldr r6, =0x02024084 + ldr r0, =0x020242ac + mov r8, r0 + ldr r1, =0x0202449c + mov r12, r1 + ldr r2, =0x020244ac + mov r9, r2 + ldr r3, =0x020244b0 + mov r10, r3 + ldr r7, =0x0202433c + ldr r4, =0x02024064 + movs r3, 0x58 + adds r2, r6, 0 + adds r2, 0x18 + movs r1, 0x6 +_0803A788: + ldrb r0, [r4] + muls r0, r3 + adds r0, r5, r0 + adds r0, r2 + strb r1, [r0] + adds r5, 0x1 + cmp r5, 0x7 + ble _0803A788 + ldr r0, =0x02024064 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r2, r6, 0 + adds r2, 0x50 + adds r0, r2 + movs r1, 0 + str r1, [r0] + ldr r3, =0x02024064 + ldrb r0, [r3] + lsls r0, 2 + add r0, r8 + str r1, [r0] + movs r5, 0 + ldr r6, =0x0202406c + ldrb r6, [r6] + cmp r5, r6 + bge _0803A830 + adds r3, r2, 0 + movs r4, 0 + ldr r0, =gUnknown_0832A328 + mov r8, r0 +_0803A7C6: + ldr r1, [r3] + movs r0, 0x80 + lsls r0, 19 + ands r0, r1 + cmp r0, 0 + beq _0803A7E6 + ldr r2, =0x020242bc + adds r0, r4, r2 + ldrb r0, [r0, 0x14] + ldr r6, =0x02024064 + ldrb r6, [r6] + cmp r0, r6 + bne _0803A7E6 + ldr r0, =0xfbffffff + ands r1, r0 + str r1, [r3] +_0803A7E6: + ldr r1, =0x02024064 + ldrb r0, [r1] + lsls r0, 2 + add r0, r8 + ldr r0, [r0] + lsls r2, r0, 16 + ldr r1, [r3] + adds r0, r1, 0 + ands r0, r2 + cmp r0, 0 + beq _0803A800 + bics r1, r2 + str r1, [r3] +_0803A800: + ldr r1, [r3] + movs r0, 0xE0 + lsls r0, 8 + ands r0, r1 + cmp r0, 0 + beq _0803A822 + mov r2, r12 + ldr r0, [r2] + adds r0, r5, r0 + ldrb r0, [r0, 0x14] + ldr r6, =0x02024064 + ldrb r6, [r6] + cmp r0, r6 + bne _0803A822 + ldr r0, =0xffff1fff + ands r1, r0 + str r1, [r3] +_0803A822: + adds r3, 0x58 + adds r4, 0x1C + adds r5, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r5, r0 + blt _0803A7C6 +_0803A830: + ldr r1, =0x02024064 + ldrb r0, [r1] + add r0, r9 + movs r1, 0 + strb r1, [r0] + ldr r2, =0x02024064 + ldrb r0, [r2] + add r0, r10 + strb r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r3, =0x020242bc + adds r1, r0, r3 + movs r5, 0 + movs r2, 0 +_0803A852: + adds r0, r1, r5 + strb r2, [r0] + adds r5, 0x1 + cmp r5, 0x1B + bls _0803A852 + ldr r6, =0x02024064 + ldrb r1, [r6] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1] + movs r0, 0x2 + negs r0, r0 + mov r9, r0 + ands r0, r2 + strb r0, [r1] + ldrb r1, [r6] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1] + movs r3, 0x3 + negs r3, r3 + mov r8, r3 + mov r0, r8 + ands r0, r2 + strb r0, [r1] + ldrb r1, [r6] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1] + movs r6, 0x5 + negs r6, r6 + adds r0, r6, 0 + ands r0, r2 + strb r0, [r1] + ldr r0, =0x02024064 + ldrb r1, [r0] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1] + subs r3, 0x6 + mov r10, r3 + mov r0, r10 + ands r0, r2 + strb r0, [r1] + ldr r0, =0x02024064 + ldrb r1, [r0] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r2, =0x02024064 + ldrb r1, [r2] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1] + movs r5, 0x21 + negs r5, r5 + adds r0, r5, 0 + ands r0, r2 + strb r0, [r1] + ldr r3, =0x02024064 + ldrb r1, [r3] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1] + movs r4, 0x41 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + strb r0, [r1] + ldrb r1, [r3] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1] + movs r3, 0x7F + adds r0, r3, 0 + ands r0, r2 + strb r0, [r1] + ldr r0, =0x02024064 + ldrb r1, [r0] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1, 0x1] + mov r0, r9 + ands r0, r2 + strb r0, [r1, 0x1] + ldr r2, =0x02024064 + ldrb r1, [r2] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1, 0x1] + mov r0, r8 + ands r0, r2 + strb r0, [r1, 0x1] + ldr r0, =0x02024064 + ldrb r1, [r0] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1, 0x1] + adds r0, r6, 0 + ands r0, r2 + strb r0, [r1, 0x1] + ldr r2, =0x02024064 + ldrb r1, [r2] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1, 0x1] + movs r0, 0x19 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + ldr r1, =0x02024064 + ldrb r0, [r1] + lsls r0, 4 + adds r0, r7 + ldrb r1, [r0, 0x1] + ands r5, r1 + strb r5, [r0, 0x1] + ldr r2, =0x02024064 + ldrb r0, [r2] + lsls r0, 4 + adds r0, r7 + ldrb r1, [r0, 0x1] + ands r4, r1 + strb r4, [r0, 0x1] + ldrb r0, [r2] + lsls r0, 4 + adds r0, r7 + ldrb r1, [r0, 0x1] + ands r3, r1 + strb r3, [r0, 0x1] + ldrb r0, [r2] + lsls r0, 4 + adds r0, r7 + ldrb r1, [r0, 0x2] + mov r3, r9 + ands r3, r1 + strb r3, [r0, 0x2] + ldrb r0, [r2] + lsls r0, 4 + adds r0, r7 + ldrb r1, [r0, 0x2] + mov r2, r8 + ands r2, r1 + strb r2, [r0, 0x2] + ldr r3, =0x02024064 + ldrb r0, [r3] + lsls r0, 4 + adds r0, r7 + ldrb r1, [r0, 0x2] + ands r6, r1 + strb r6, [r0, 0x2] + ldrb r0, [r3] + lsls r0, 4 + adds r0, r7 + ldrb r1, [r0, 0x2] + mov r6, r10 + ands r6, r1 + strb r6, [r0, 0x2] + ldrb r1, [r3] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r1, =0x020242bc + adds r0, r1 + movs r2, 0 + movs r1, 0x2 + strb r1, [r0, 0x16] + ldrb r0, [r3] + lsls r0, 1 + ldr r3, =0x02024248 + adds r0, r3 + movs r3, 0 + strh r2, [r0] + ldr r6, =0x02024064 + ldrb r0, [r6] + lsls r0, 1 + ldr r1, =0x02024250 + adds r0, r1 + strh r2, [r0] + ldrb r0, [r6] + lsls r0, 1 + ldr r6, =0x02024258 + adds r0, r6 + strh r2, [r0] + ldr r1, =0x02024064 + ldrb r0, [r1] + lsls r0, 1 + ldr r6, =0x02024260 + adds r0, r6 + strh r2, [r0] + ldrb r0, [r1] + lsls r0, 1 + ldr r1, =0x02024240 + adds r0, r1 + strh r2, [r0] + ldr r2, =0x02024064 + ldrb r0, [r2] + ldr r6, =0x02024270 + adds r0, r6 + movs r1, 0xFF + strb r1, [r0] + ldrb r0, [r2] + mov r2, r12 + ldr r1, [r2] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC8 + strb r3, [r0] + ldr r6, =0x02024064 + ldrb r0, [r6] + ldr r1, [r2] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC9 + strb r3, [r0] + ldrb r0, [r6] + ldr r1, [r2] + lsls r0, 1 + adds r0, r1 + adds r0, 0x98 + strb r3, [r0] + ldrb r0, [r6] + ldr r1, [r2] + lsls r0, 1 + adds r0, r1 + adds r0, 0x99 + strb r3, [r0] + ldrb r0, [r6] + ldr r1, [r2] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE0 + strb r3, [r0] + ldrb r0, [r6] + ldr r1, [r2] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE1 + strb r3, [r0] + ldrb r0, [r6] + ldr r1, [r2] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE2 + strb r3, [r0] + ldrb r0, [r6] + ldr r1, [r2] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE3 + strb r3, [r0] + ldrb r0, [r6] + ldr r1, [r2] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE4 + strb r3, [r0] + ldrb r0, [r6] + ldr r1, [r2] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE5 + strb r3, [r0] + ldrb r0, [r6] + ldr r1, [r2] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE6 + strb r3, [r0] + ldrb r0, [r6] + ldr r1, [r2] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE7 + strb r3, [r0] + ldr r1, [r2] + adds r1, 0x92 + ldrb r0, [r6] + lsls r0, 2 + ldr r2, =gUnknown_0832A328 + adds r0, r2 + ldr r2, [r0] + ldrb r0, [r1] + bics r0, r2 + strb r0, [r1] + movs r5, 0 + ldr r3, =0x0202406c + ldrb r3, [r3] + cmp r5, r3 + bge _0803AB02 + adds r3, r6, 0 + mov r7, r12 + movs r6, 0 +_0803AAA4: + ldrb r0, [r3] + cmp r5, r0 + beq _0803AADA + lsls r0, r5, 24 + lsrs r0, 24 + str r3, [sp] + bl battle_side_get_owner + adds r4, r0, 0 + ldr r3, [sp] + ldrb r0, [r3] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + ldr r3, [sp] + cmp r4, r0 + beq _0803AADA + ldr r0, [r7] + lsls r1, r5, 1 + adds r0, r1, r0 + adds r0, 0x98 + strb r6, [r0] + ldr r0, [r7] + adds r1, r0 + adds r1, 0x99 + strb r6, [r1] +_0803AADA: + ldrb r0, [r3] + ldr r1, [r7] + lsls r0, 1 + lsls r2, r5, 3 + adds r0, r2 + adds r0, r1 + adds r0, 0xE0 + strb r6, [r0] + ldrb r0, [r3] + ldr r1, [r7] + lsls r0, 1 + adds r0, r2 + adds r0, r1 + adds r0, 0xE1 + strb r6, [r0] + adds r5, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r5, r0 + blt _0803AAA4 +_0803AB02: + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r1, [r0, 0x4] + ldr r2, =0x02024064 + ldrb r0, [r2] + lsls r0, 2 + adds r1, r0 + movs r0, 0 + str r0, [r1] + ldr r4, =0x02024084 + ldrb r0, [r2] + movs r3, 0x58 + adds r2, r0, 0 + muls r2, r3 + b _0803AB6C + .pool +_0803AB6C: + adds r2, r4 + ldr r5, =gBaseStats + ldrh r1, [r2] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r0, [r0, 0x6] + adds r2, 0x21 + strb r0, [r2] + ldr r6, =0x02024064 + ldrb r0, [r6] + adds r1, r0, 0 + muls r1, r3 + adds r1, r4 + ldrh r2, [r1] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r5 + ldrb r0, [r0, 0x7] + adds r1, 0x22 + strb r0, [r1] + ldrb r0, [r6] + bl sub_81310F0 + ldrb r0, [r6] + bl sub_8131130 + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803A75C + + thumb_func_start bc_8012FAC +bc_8012FAC: @ 803ABC0 + push {r4,r5,lr} + ldr r5, =0x02024332 + ldrb r0, [r5] + cmp r0, 0 + beq _0803ABD4 + cmp r0, 0x1 + beq _0803ABF8 + b _0803AC2E + .pool +_0803ABD4: + ldr r4, =0x02024064 + ldrb r0, [r5, 0x1] + strb r0, [r4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl dp01_build_cmdbuf_x00_a_b_0 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + b _0803AC2E + .pool +_0803ABF8: + ldr r0, =0x02024068 + ldr r2, [r0] + cmp r2, 0 + bne _0803AC2E + ldrb r0, [r5, 0x1] + adds r0, 0x1 + strb r0, [r5, 0x1] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bne _0803AC2C + ldr r1, =0x03005d04 + ldr r0, =bc_load_battlefield + str r0, [r1] + b _0803AC2E + .pool +_0803AC2C: + strb r2, [r5] +_0803AC2E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end bc_8012FAC + + thumb_func_start bc_load_battlefield +bc_load_battlefield: @ 803AC34 + push {r4,r5,lr} + ldr r0, =0x02024068 + ldr r5, [r0] + cmp r5, 0 + bne _0803AC64 + movs r0, 0 + bl battle_get_side_with_given_state + ldr r4, =0x02024064 + strb r0, [r4] + ldr r0, =0x02022ff0 + ldrb r1, [r0] + movs r0, 0 + bl dp01_build_cmdbuf_x2E_a + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x03005d04 + ldr r0, =sub_803AC84 + str r0, [r1] + ldr r0, =0x02024332 + strb r5, [r0] + strb r5, [r0, 0x1] +_0803AC64: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end bc_load_battlefield + + thumb_func_start sub_803AC84 +sub_803AC84: @ 803AC84 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =0x02024068 + ldr r1, [r0] + cmp r1, 0 + beq _0803AC98 + b _0803AF4E +_0803AC98: + ldr r2, =0x02024064 + strb r1, [r2] + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r1, r0 + bcc _0803ACA6 + b _0803AF48 +_0803ACA6: + movs r7, 0x58 + ldr r0, =0x02024084 + mov r8, r0 + mov r9, r2 + movs r1, 0x48 + add r1, r8 + mov r10, r1 +_0803ACB4: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0803ACFC + ldr r4, =0x02024064 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0803ACFC + ldrb r0, [r4] + muls r0, r7 + mov r2, r8 + adds r3, r0, r2 + movs r2, 0 + movs r1, 0 +_0803ACDA: + adds r0, r3, r2 + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x57 + bls _0803ACDA + b _0803ADCA + .pool +_0803ACFC: + mov r1, r9 + ldrb r0, [r1] + muls r0, r7 + mov r2, r8 + adds r3, r0, r2 + movs r2, 0 + ldr r6, =gBaseStats + ldr r5, =0x02023864 + ldr r4, =0x02024064 +_0803AD0E: + adds r0, r3, r2 + ldrb r1, [r4] + lsls r1, 9 + adds r1, 0x4 + adds r1, r2, r1 + adds r1, r5 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x57 + bls _0803AD0E + mov r1, r9 + ldrb r0, [r1] + adds r2, r0, 0 + muls r2, r7 + add r2, r8 + ldrh r1, [r2] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x6] + adds r2, 0x21 + strb r0, [r2] + mov r2, r9 + ldrb r0, [r2] + adds r2, r0, 0 + muls r2, r7 + add r2, r8 + ldrh r1, [r2] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x7] + adds r2, 0x22 + strb r0, [r2] + mov r1, r9 + ldrb r0, [r1] + adds r1, r0, 0 + muls r1, r7 + add r1, r8 + ldrh r0, [r1] + ldrb r1, [r1, 0x17] + lsrs r1, 7 + bl sub_806B694 + mov r2, r9 + ldrb r1, [r2] + muls r1, r7 + add r1, r8 + adds r1, 0x20 + strb r0, [r1] + ldrb r0, [r2] + bl battle_side_get_owner + ldr r1, =0x0202449c + lsls r0, 24 + lsrs r0, 23 + adds r0, 0xA8 + ldr r1, [r1] + adds r1, r0 + mov r2, r9 + ldrb r0, [r2] + muls r0, r7 + add r0, r8 + ldrh r0, [r0, 0x28] + strh r0, [r1] + movs r2, 0 + ldr r4, =0x02024064 + movs r5, 0x58 + ldr r1, =0x0202409c + adds r6, r4, 0 + movs r0, 0x18 + negs r0, r0 + adds r0, r1 + mov r12, r0 + movs r3, 0x6 +_0803ADAA: + ldrb r0, [r4] + muls r0, r5 + adds r0, r2, r0 + adds r0, r1 + strb r3, [r0] + adds r2, 0x1 + cmp r2, 0x7 + ble _0803ADAA + ldrb r0, [r6] + adds r1, r0, 0 + muls r1, r7 + mov r0, r12 + adds r0, 0x50 + adds r1, r0 + movs r0, 0 + str r0, [r1] +_0803ADCA: + ldr r4, =0x02024064 + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + cmp r0, 0 + bne _0803ADE4 + movs r0, 0 + bl dp01_build_cmdbuf_x07_7_7_7 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803ADE4: + ldr r5, =0x02022fec + ldr r0, [r5] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0803AE60 + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0803AE0A + movs r0, 0 + bl dp01_build_cmdbuf_x07_7_7_7 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803AE0A: + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0803AEC0 + ldr r0, [r5] + ldr r1, =0x063f0902 + ands r0, r1 + cmp r0, 0 + bne _0803AEC0 + ldrb r0, [r4] + muls r0, r7 + add r0, r8 + ldrh r0, [r0] + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r4] + muls r1, r7 + add r1, r10 + ldr r2, [r1] + movs r1, 0x2 + bl SetPokedexFlag + b _0803AEC0 + .pool +_0803AE60: + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0803AEC0 + ldr r0, [r5] + ldr r1, =0x063f0902 + ands r0, r1 + cmp r0, 0 + bne _0803AE96 + ldrb r0, [r4] + muls r0, r7 + add r0, r8 + ldrh r0, [r0] + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r4] + muls r1, r7 + add r1, r10 + ldr r2, [r1] + movs r1, 0x2 + bl SetPokedexFlag +_0803AE96: + movs r0, 0 + bl dp01_build_cmdbuf_x04_4_4_4 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x0202406e + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + ldr r1, =0x03005d10 + strh r0, [r1, 0x20] +_0803AEC0: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0803AEF6 + ldr r4, =0x02024064 + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _0803AEEA + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _0803AEF6 +_0803AEEA: + movs r0, 0 + bl dp01_build_cmdbuf_x07_7_7_7 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803AEF6: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0803AF20 + ldr r4, =0x02024064 + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _0803AF20 + movs r0, 0 + bl dp01_build_cmdbuf_x07_7_7_7 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803AF20: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _0803AF32 + bl sub_81A56B4 +_0803AF32: + mov r1, r9 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcs _0803AF48 + b _0803ACB4 +_0803AF48: + ldr r1, =0x03005d04 + ldr r0, =bc_801333C + str r0, [r1] +_0803AF4E: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803AC84 + + thumb_func_start bc_801333C +bc_801333C: @ 803AF80 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x30 + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + beq _0803AF92 + b _0803B10C +_0803AF92: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + bne _0803AFA0 + b _0803B0AC +_0803AFA0: + movs r7, 0 + add r0, sp, 0x4 + mov r8, r0 + mov r6, r8 + mov r5, sp +_0803AFAA: + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, =0x02024744 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + beq _0803AFD0 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + bne _0803AFE8 +_0803AFD0: + ldr r0, =0x0000ffff + strh r0, [r5] + movs r0, 0 + b _0803AFFA + .pool +_0803AFE8: + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + strh r0, [r5] + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr +_0803AFFA: + str r0, [r6] + adds r6, 0x8 + adds r5, 0x8 + adds r7, 0x1 + cmp r7, 0x5 + ble _0803AFAA + movs r0, 0x1 + bl battle_get_side_with_given_state + ldr r4, =0x02024064 + strb r0, [r4] + movs r0, 0 + mov r1, sp + movs r2, 0x80 + bl dp01_build_cmdbuf_x30_TODO + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + movs r7, 0 + mov r6, r8 + mov r5, sp +_0803B026: + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + beq _0803B04C + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + bne _0803B060 +_0803B04C: + ldr r0, =0x0000ffff + strh r0, [r5] + movs r0, 0 + b _0803B072 + .pool +_0803B060: + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + strh r0, [r5] + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr +_0803B072: + str r0, [r6] + adds r6, 0x8 + adds r5, 0x8 + adds r7, 0x1 + cmp r7, 0x5 + ble _0803B026 + movs r0, 0 + bl battle_get_side_with_given_state + ldr r4, =0x02024064 + strb r0, [r4] + movs r0, 0 + mov r1, sp + movs r2, 0x80 + bl dp01_build_cmdbuf_x30_TODO + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x03005d04 + ldr r0, =bc_battle_begin_message + b _0803B10A + .pool +_0803B0AC: + movs r7, 0 + add r6, sp, 0x4 + mov r5, sp +_0803B0B2: + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + beq _0803B0D8 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + bne _0803B0E8 +_0803B0D8: + ldr r0, =0x0000ffff + strh r0, [r5] + movs r0, 0 + b _0803B0FA + .pool +_0803B0E8: + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + strh r0, [r5] + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr +_0803B0FA: + str r0, [r6] + adds r6, 0x8 + adds r5, 0x8 + adds r7, 0x1 + cmp r7, 0x5 + ble _0803B0B2 + ldr r1, =0x03005d04 + ldr r0, =bc_8013568 +_0803B10A: + str r0, [r1] +_0803B10C: + add sp, 0x30 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end bc_801333C + + thumb_func_start bc_battle_begin_message +bc_battle_begin_message: @ 803B120 + push {lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0803B142 + movs r0, 0x1 + bl battle_get_side_with_given_state + ldr r1, =0x02024064 + strb r0, [r1] + ldrb r1, [r1] + movs r0, 0 + bl b_std_message + ldr r1, =0x03005d04 + ldr r0, =sub_803B180 + str r0, [r1] +_0803B142: + pop {r0} + bx r0 + .pool + thumb_func_end bc_battle_begin_message + + thumb_func_start bc_8013568 +bc_8013568: @ 803B158 + push {lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0803B170 + ldr r1, =0x03005d04 + ldr r0, =sub_803B3CC + str r0, [r1] + movs r0, 0 + movs r1, 0 + bl b_std_message +_0803B170: + pop {r0} + bx r0 + .pool + thumb_func_end bc_8013568 + + thumb_func_start sub_803B180 +sub_803B180: @ 803B180 + push {lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0803B1D0 + ldr r0, =0x02022fec + ldr r2, [r0] + movs r0, 0x80 + lsls r0, 17 + ands r0, r2 + cmp r0, 0 + beq _0803B1B8 + movs r0, 0x80 + lsls r0, 18 + ands r0, r2 + cmp r0, 0 + beq _0803B1B8 + movs r1, 0x80 + lsls r1, 24 + ands r1, r2 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + b _0803B1BA + .pool +_0803B1B8: + movs r0, 0x1 +_0803B1BA: + bl battle_get_side_with_given_state + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x1 + bl b_std_message + ldr r1, =0x03005d04 + ldr r0, =sub_803B25C + str r0, [r1] +_0803B1D0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_803B180 + + thumb_func_start sub_803B1DC +sub_803B1DC: @ 803B1DC + push {r4,r5,lr} + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 17 + ands r0, r1 + cmp r0, 0 + beq _0803B1FC + movs r0, 0x80 + lsls r0, 18 + ands r0, r1 + cmp r0, 0 + beq _0803B1FC + movs r5, 0x2 + cmp r1, 0 + bge _0803B1FE +_0803B1FC: + movs r5, 0x3 +_0803B1FE: + ldr r1, =0x02024064 + movs r0, 0 + strb r0, [r1] + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r0, 0 + beq _0803B23A + adds r4, r1, 0 +_0803B20E: + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, r5 + bne _0803B228 + movs r0, 0 + bl dp01_build_cmdbuf_x2F_2F_2F_2F + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803B228: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803B20E +_0803B23A: + ldr r1, =0x03005d04 + ldr r0, =bc_801362C + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803B1DC + + thumb_func_start sub_803B25C +sub_803B25C: @ 803B25C + push {r4-r6,lr} + ldr r0, =0x02022fec + ldr r2, [r0] + movs r0, 0x80 + lsls r0, 17 + ands r0, r2 + cmp r0, 0 + beq _0803B298 + movs r0, 0x80 + lsls r0, 18 + ands r0, r2 + cmp r0, 0 + beq _0803B298 + movs r1, 0x80 + lsls r1, 24 + ands r1, r2 + negs r0, r1 + orrs r0, r1 + lsrs r5, r0, 31 + b _0803B29A + .pool +_0803B288: + ldr r1, =0x03005d04 + ldr r0, =sub_803B1DC + b _0803B2F0 + .pool +_0803B298: + movs r5, 0x1 +_0803B29A: + ldr r0, =0x02024068 + ldr r2, [r0] + cmp r2, 0 + bne _0803B2F2 + ldr r0, =0x02024064 + strb r2, [r0] + ldr r1, =0x0202406c + adds r4, r0, 0 + ldrb r1, [r1] + cmp r2, r1 + bcs _0803B2EC + adds r6, r4, 0 +_0803B2B2: + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, r5 + bne _0803B2D8 + movs r0, 0 + bl dp01_build_cmdbuf_x2F_2F_2F_2F + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x00008040 + ands r0, r1 + cmp r0, 0 + bne _0803B288 +_0803B2D8: + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x02024064 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803B2B2 +_0803B2EC: + ldr r1, =0x03005d04 + ldr r0, =bc_801362C +_0803B2F0: + str r0, [r1] +_0803B2F2: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803B25C + + thumb_func_start bc_801362C +bc_801362C: @ 803B314 + push {r4-r7,lr} + ldr r0, =0x02024068 + ldr r1, [r0] + cmp r1, 0 + bne _0803B384 + ldr r2, =0x02024064 + strb r1, [r2] + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r1, r0 + bcs _0803B37E + adds r4, r2, 0 + ldr r6, =0x02024084 + movs r5, 0x58 + adds r7, r6, 0 + adds r7, 0x48 +_0803B334: + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0803B36C + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x063f0902 + ands r0, r1 + cmp r0, 0 + bne _0803B36C + ldrb r0, [r4] + muls r0, r5 + adds r0, r6 + ldrh r0, [r0] + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r4] + muls r1, r5 + adds r1, r7 + ldr r2, [r1] + movs r1, 0x2 + bl SetPokedexFlag +_0803B36C: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803B334 +_0803B37E: + ldr r1, =0x03005d04 + ldr r0, =sub_803B3CC + str r0, [r1] +_0803B384: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end bc_801362C + + thumb_func_start sub_803B3AC +sub_803B3AC: @ 803B3AC + push {lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0803B3BC + ldr r1, =0x03005d04 + ldr r0, =sub_803B3CC + str r0, [r1] +_0803B3BC: + pop {r0} + bx r0 + .pool + thumb_func_end sub_803B3AC + + thumb_func_start sub_803B3CC +sub_803B3CC: @ 803B3CC + push {lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0803B418 + ldr r1, =0x02022fec + ldr r2, [r1] + movs r0, 0x80 + lsls r0, 17 + ands r0, r2 + cmp r0, 0 + beq _0803B3F4 + movs r0, 0x80 + lsls r0, 18 + ands r0, r2 + cmp r0, 0 + beq _0803B3F4 + movs r3, 0x1 + cmp r2, 0 + bge _0803B3F6 +_0803B3F4: + movs r3, 0 +_0803B3F6: + ldr r0, [r1] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0803B412 + adds r0, r3, 0 + bl battle_get_side_with_given_state + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x1 + bl b_std_message +_0803B412: + ldr r1, =0x03005d04 + ldr r0, =sub_803B4C8 + str r0, [r1] +_0803B418: + pop {r0} + bx r0 + .pool + thumb_func_end sub_803B3CC + + thumb_func_start sub_803B42C +sub_803B42C: @ 803B42C + push {r4,r5,lr} + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 17 + ands r0, r1 + cmp r0, 0 + beq _0803B44C + movs r0, 0x80 + lsls r0, 18 + ands r0, r1 + cmp r0, 0 + beq _0803B44C + movs r5, 0x3 + cmp r1, 0 + bge _0803B44E +_0803B44C: + movs r5, 0x2 +_0803B44E: + ldr r1, =0x02024064 + movs r0, 0 + strb r0, [r1] + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r0, 0 + beq _0803B48A + adds r4, r1, 0 +_0803B45E: + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, r5 + bne _0803B478 + movs r0, 0 + bl dp01_build_cmdbuf_x2F_2F_2F_2F + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803B478: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803B45E +_0803B48A: + ldr r2, =0x0202449c + ldr r0, [r2] + adds r0, 0x4C + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0xD9 + strb r1, [r0] + ldr r0, [r2] + movs r2, 0xD1 + lsls r2, 1 + adds r0, r2 + strb r1, [r0] + ldr r1, =0x03005d04 + ldr r0, =sub_803B628 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803B42C + + thumb_func_start sub_803B4C8 +sub_803B4C8: @ 803B4C8 + push {r4-r6,lr} + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 17 + ands r0, r1 + cmp r0, 0 + beq _0803B500 + movs r0, 0x80 + lsls r0, 18 + ands r0, r1 + cmp r0, 0 + beq _0803B500 + movs r6, 0x1 + cmp r1, 0 + bge _0803B502 + b _0803B500 + .pool +_0803B4F0: + ldr r1, =0x03005d04 + ldr r0, =sub_803B42C + b _0803B572 + .pool +_0803B500: + movs r6, 0 +_0803B502: + ldr r0, =0x02024068 + ldr r2, [r0] + cmp r2, 0 + bne _0803B574 + ldr r0, =0x02024064 + strb r2, [r0] + ldr r1, =0x0202406c + adds r4, r0, 0 + ldrb r1, [r1] + cmp r2, r1 + bcs _0803B554 + adds r5, r4, 0 +_0803B51A: + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, r6 + bne _0803B540 + movs r0, 0 + bl dp01_build_cmdbuf_x2F_2F_2F_2F + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0803B4F0 +_0803B540: + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x02024064 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803B51A +_0803B554: + ldr r2, =0x0202449c + ldr r0, [r2] + adds r0, 0x4C + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0xD9 + strb r1, [r0] + ldr r0, [r2] + movs r2, 0xD1 + lsls r2, 1 + adds r0, r2 + strb r1, [r0] + ldr r1, =0x03005d04 + ldr r0, =sub_803B628 +_0803B572: + str r0, [r1] +_0803B574: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803B4C8 + + thumb_func_start sub_803B598 +sub_803B598: @ 803B598 + push {r4,r5,lr} + ldr r0, =0x02024068 + ldr r1, [r0] + cmp r1, 0 + bne _0803B606 + ldr r2, =0x02024064 + strb r1, [r2] + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r1, r0 + bcs _0803B5E6 + adds r4, r2, 0 + ldr r5, =0x0202406e +_0803B5B2: + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0803B5D4 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r5 + ldrb r1, [r0] + movs r0, 0 + movs r2, 0 + bl dp01_build_cmdbuf_x05_a_b_c + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803B5D4: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803B5B2 +_0803B5E6: + ldr r2, =0x0202449c + ldr r0, [r2] + adds r0, 0x4C + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0xD9 + strb r1, [r0] + ldr r0, [r2] + movs r2, 0xD1 + lsls r2, 1 + adds r0, r2 + strb r1, [r0] + ldr r1, =0x03005d04 + ldr r0, =sub_803B628 + str r0, [r1] +_0803B606: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803B598 + + thumb_func_start sub_803B628 +sub_803B628: @ 803B628 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r0, 0 + mov r9, r0 + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + beq _0803B642 + b _0803B8B2 +_0803B642: + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x4C + ldrb r0, [r0] + cmp r0, 0 + bne _0803B6C2 + movs r5, 0 + ldr r1, =0x0202406c + mov r10, r1 + ldrb r3, [r1] + cmp r5, r3 + bge _0803B668 + ldr r2, =0x0202407e +_0803B65C: + adds r0, r5, r2 + strb r5, [r0] + adds r5, 0x1 + ldrb r0, [r1] + cmp r5, r0 + blt _0803B65C +_0803B668: + movs r5, 0 + b _0803B6B8 + .pool +_0803B67C: + adds r4, r5, 0x1 + mov r8, r4 + ldrb r1, [r1] + cmp r8, r1 + bge _0803B6B6 + ldr r6, =0x0202407e + ldr r1, =0x0202406c + mov r10, r1 + lsls r7, r5, 24 +_0803B68E: + adds r0, r5, r6 + ldrb r0, [r0] + adds r1, r4, r6 + ldrb r1, [r1] + movs r2, 0x1 + bl b_first_side + lsls r0, 24 + cmp r0, 0 + beq _0803B6AC + lsls r1, r4, 24 + lsrs r1, 24 + lsrs r0, r7, 24 + bl sub_803CEDC +_0803B6AC: + adds r4, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _0803B68E +_0803B6B6: + mov r5, r8 +_0803B6B8: + mov r1, r10 + ldrb r0, [r1] + subs r0, 0x1 + cmp r5, r0 + blt _0803B67C +_0803B6C2: + ldr r5, =0x0202449c + ldr r0, [r5] + movs r4, 0xD1 + lsls r4, 1 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _0803B6FC + str r0, [sp] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0xFF + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _0803B6FC + ldr r0, [r5] + adds r0, r4 + movs r1, 0x1 + strb r1, [r0] + b _0803B8B2 + .pool +_0803B6FC: + ldr r2, =0x0202449c + ldr r0, [r2] + adds r0, 0x4C + ldr r1, =0x0202406c + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bcs _0803B756 + ldr r5, =0x0202407e + adds r4, r2, 0 +_0803B710: + ldr r0, [r4] + adds r0, 0x4C + ldrb r0, [r0] + adds r0, r5 + ldrb r1, [r0] + movs r0, 0 + str r0, [sp] + movs r2, 0 + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _0803B736 + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_0803B736: + ldr r1, [r4] + adds r1, 0x4C + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + mov r3, r9 + cmp r3, 0 + beq _0803B748 + b _0803B8B2 +_0803B748: + ldr r0, [r4] + adds r0, 0x4C + ldr r1, =0x0202406c + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bcc _0803B710 +_0803B756: + movs r0, 0 + str r0, [sp] + movs r0, 0x9 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _0803B770 + b _0803B8B2 +_0803B770: + str r0, [sp] + movs r0, 0xB + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _0803B786 + b _0803B8B2 +_0803B786: + ldr r2, =0x0202449c + ldr r0, [r2] + adds r0, 0xD9 + ldr r1, =0x0202406c + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bcs _0803B7DA + ldr r5, =0x0202407e + adds r4, r2, 0 +_0803B79A: + ldr r0, [r4] + adds r0, 0xD9 + ldrb r0, [r0] + adds r0, r5 + ldrb r1, [r0] + movs r0, 0 + movs r2, 0 + bl berry_effects_maybe + lsls r0, 24 + cmp r0, 0 + beq _0803B7BC + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_0803B7BC: + ldr r1, [r4] + adds r1, 0xD9 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + mov r0, r9 + cmp r0, 0 + bne _0803B8B2 + ldr r0, [r4] + adds r0, 0xD9 + ldr r1, =0x0202406c + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bcc _0803B79A +_0803B7DA: + movs r5, 0 + ldr r1, =0x0202449c + mov r8, r1 + movs r7, 0x6 + ldr r6, =0x0202421c + ldr r2, =0x02024274 + movs r4, 0xFF + movs r3, 0 +_0803B7EA: + mov r1, r8 + ldr r0, [r1] + adds r0, r5, r0 + adds r0, 0x5C + strb r7, [r0] + adds r1, r5, r6 + ldrb r0, [r1] + orrs r0, r4 + strb r0, [r1] + strh r3, [r2] + adds r2, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _0803B7EA + movs r0, 0 + bl sub_803D580 + bl sub_803D6A0 + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x91 + ldr r1, =0x02024210 + ldrb r1, [r1] + strb r1, [r0] + ldr r0, =gUnknown_085CC23E + movs r1, 0 + bl battle_show_message_maybe + ldr r1, =0x03005d04 + ldr r0, =sub_803BE74 + str r0, [r1] + bl sub_803F988 + ldr r1, =0x02024332 + movs r2, 0 + adds r0, r1, 0x7 +_0803B834: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _0803B834 + movs r5, 0 + ldr r3, =0x0202406c + ldr r2, =0x0202449c + ldr r6, =0x02024474 + ldr r7, =0x0202427c + ldrb r0, [r3] + cmp r5, r0 + bge _0803B866 + ldr r0, =0x02024084 + movs r4, 0x9 + negs r4, r4 + adds r1, r0, 0 + adds r1, 0x50 +_0803B856: + ldr r0, [r1] + ands r0, r4 + str r0, [r1] + adds r1, 0x58 + adds r5, 0x1 + ldrb r0, [r3] + cmp r5, r0 + blt _0803B856 +_0803B866: + ldr r0, [r2] + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + strb r1, [r0, 0x1] + ldr r0, [r2] + movs r3, 0xD0 + lsls r3, 1 + adds r0, r3 + strb r1, [r0] + ldr r0, [r2] + adds r3, 0x1 + adds r0, r3 + strb r1, [r0] + movs r1, 0 + strb r1, [r6, 0x14] + ldr r0, [r2] + adds r0, 0x4D + strb r1, [r0] + ldr r0, [r2] + strb r1, [r0, 0x3] + strb r1, [r7] + bl GenerateRandomNumber + ldr r1, =0x02024330 + strh r0, [r1] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _0803B8B2 + bl sub_80A369C + ldr r0, =gUnknown_082DB8BE + bl b_call_bc_move_exec +_0803B8B2: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803B628 + + thumb_func_start bc_8013B1C +bc_8013B1C: @ 803B904 + push {r4-r6,lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0803B994 + ldr r1, =0x03005d04 + ldr r0, =sub_803B9BC + str r0, [r1] + ldr r3, =0x0202406c + ldr r1, =0x02024332 + movs r2, 0 + adds r0, r1, 0x7 +_0803B91C: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _0803B91C + movs r4, 0 + ldrb r3, [r3] + cmp r4, r3 + bge _0803B96E + ldr r5, =0x02024084 + adds r6, r5, 0 + adds r6, 0x4C +_0803B932: + movs r0, 0x58 + adds r2, r4, 0 + muls r2, r0 + adds r1, r5, 0 + adds r1, 0x50 + adds r1, r2, r1 + ldr r3, [r1] + subs r0, 0x61 + ands r3, r0 + str r3, [r1] + adds r2, r6 + ldr r0, [r2] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + beq _0803B964 + movs r0, 0x80 + lsls r0, 5 + ands r3, r0 + cmp r3, 0 + beq _0803B964 + lsls r0, r4, 24 + lsrs r0, 24 + bl b_cancel_multi_turn_move_maybe +_0803B964: + adds r4, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _0803B932 +_0803B96E: + ldr r2, =0x0202449c + ldr r0, [r2] + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + strb r1, [r0, 0x1] + ldr r0, [r2] + movs r3, 0xD0 + lsls r3, 1 + adds r0, r3 + strb r1, [r0] + ldr r0, [r2] + adds r3, 0x1 + adds r0, r3 + strb r1, [r0] + ldr r0, [r2] + strb r1, [r0, 0x3] + ldr r0, =0x0202427c + strb r1, [r0] +_0803B994: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end bc_8013B1C + + thumb_func_start sub_803B9BC +sub_803B9BC: @ 803B9BC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r0, 0x1 + bl sub_803D580 + ldr r0, =0x0202433a + ldrb r0, [r0] + cmp r0, 0 + bne _0803B9EA + bl sub_80401D0 + lsls r0, 24 + cmp r0, 0 + beq _0803B9DE + b _0803BB78 +_0803B9DE: + bl sub_8040924 + lsls r0, 24 + cmp r0, 0 + beq _0803B9EA + b _0803BB78 +_0803B9EA: + bl sub_8041728 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _0803B9F8 + b _0803BB78 +_0803B9F8: + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x4D + strb r1, [r0] + bl sub_8041364 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0803BA0E + b _0803BB78 +_0803BA0E: + movs r0, 0 + bl sub_803D580 + ldr r2, =0x02024280 + ldr r0, [r2] + ldr r1, =0xfffffdff + ands r0, r1 + ldr r1, =0xfff7ffff + ands r0, r1 + ldr r1, =0xffbfffff + ands r0, r1 + ldr r1, =0xffefffff + ands r0, r1 + str r0, [r2] + ldr r0, =0x02024474 + strb r4, [r0, 0x18] + strb r4, [r0, 0x19] + strb r4, [r0, 0x14] + ldr r0, =0x020241f0 + str r4, [r0] + ldr r0, =0x0202427c + strb r4, [r0] + ldr r1, =0x02024332 + movs r2, 0 + adds r0, r1, 0x4 +_0803BA40: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _0803BA40 + ldr r0, =0x0202433a + ldrb r0, [r0] + cmp r0, 0 + beq _0803BA98 + ldr r1, =0x02024083 + movs r0, 0xC + strb r0, [r1] + ldr r1, =0x03005d04 + ldr r0, =bc_bs_exec + str r0, [r1] + b _0803BB78 + .pool +_0803BA98: + ldr r1, =0x03005d10 + ldrb r0, [r1, 0x13] + ldr r2, =0x0202449c + mov r8, r2 + cmp r0, 0xFE + bhi _0803BAB2 + adds r0, 0x1 + strb r0, [r1, 0x13] + ldr r1, [r2] + adds r1, 0xDA + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0803BAB2: + movs r2, 0 + ldr r4, =0x0202406c + ldr r0, =0x02024210 + mov r12, r0 + ldr r1, =gUnknown_085CC23E + mov r9, r1 + ldrb r0, [r4] + cmp r2, r0 + bge _0803BAE0 + ldr r7, =0x0202421c + movs r6, 0xFF + movs r5, 0 + ldr r3, =0x02024274 +_0803BACC: + adds r1, r2, r7 + ldrb r0, [r1] + orrs r0, r6 + strb r0, [r1] + strh r5, [r3] + adds r3, 0x2 + adds r2, 0x1 + ldrb r1, [r4] + cmp r2, r1 + blt _0803BACC +_0803BAE0: + movs r2, 0 + ldr r3, =0x0202449c + movs r1, 0x6 +_0803BAE6: + ldr r0, [r3] + adds r0, r2, r0 + adds r0, 0x5C + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x3 + ble _0803BAE6 + mov r2, r8 + ldr r0, [r2] + adds r0, 0x91 + mov r2, r12 + ldrb r1, [r2] + strb r1, [r0] + mov r0, r9 + movs r1, 0 + bl battle_show_message_maybe + ldr r1, =0x03005d04 + ldr r0, =sub_803BE74 + str r0, [r1] + bl GenerateRandomNumber + ldr r1, =0x02024330 + strh r0, [r1] + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 10 + ands r0, r1 + cmp r0, 0 + beq _0803BB5C + ldr r0, =gUnknown_082DB881 + bl b_call_bc_move_exec + b _0803BB78 + .pool +_0803BB5C: + movs r0, 0x80 + lsls r0, 11 + ands r1, r0 + cmp r1, 0 + beq _0803BB78 + mov r1, r8 + ldr r0, [r1] + adds r0, 0xDA + ldrb r0, [r0] + cmp r0, 0 + bne _0803BB78 + ldr r0, =gUnknown_082DB8BE + bl b_call_bc_move_exec +_0803BB78: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803B9BC + + thumb_func_start sub_803BB88 +sub_803BB88: @ 803BB88 + push {r4-r7,lr} + sub sp, 0x4 + ldr r1, =0x02024084 + ldr r0, =0x02024064 + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2E] + cmp r0, 0xAF + bne _0803BBB8 + ldr r1, =0x02024404 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x7] + b _0803BBC2 + .pool +_0803BBB8: + ldrh r0, [r1, 0x2E] + bl itemid_get_x12 + lsls r0, 24 + lsrs r2, r0, 24 +_0803BBC2: + ldr r1, =0x0202420f + ldr r3, =0x02024064 + ldrb r0, [r3] + strb r0, [r1] + cmp r2, 0x25 + bne _0803BBD0 + b _0803BD4C +_0803BBD0: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0803BBDE + b _0803BD4C +_0803BBDE: + ldr r1, =0x02024084 + ldrb r2, [r3] + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x32 + bne _0803BBF2 + b _0803BD4C +_0803BBF2: + adds r0, r2, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r5, r0 + bge _0803BC86 + movs r7, 0 +_0803BC08: + lsrs r4, r7, 24 + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + beq _0803BC2C + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r5 + adds r0, r1 + adds r2, r0, 0 + adds r2, 0x20 + ldrb r0, [r2] + cmp r0, 0x17 + bne _0803BC2C + b _0803BD54 +_0803BC2C: + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + beq _0803BC76 + ldr r3, =0x02024084 + ldr r0, =0x02024064 + ldrb r0, [r0] + movs r2, 0x58 + muls r0, r2 + adds r1, r0, r3 + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x1A + beq _0803BC76 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0x2 + beq _0803BC76 + adds r0, r1, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0x2 + beq _0803BC76 + adds r0, r5, 0 + muls r0, r2 + adds r0, r3 + adds r2, r0, 0 + adds r2, 0x20 + ldrb r0, [r2] + cmp r0, 0x47 + bne _0803BC76 + b _0803BD70 +_0803BC76: + movs r0, 0x80 + lsls r0, 17 + adds r7, r0 + adds r5, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r5, r0 + blt _0803BC08 +_0803BC86: + ldr r4, =0x02024064 + ldrb r1, [r4] + movs r0, 0 + str r0, [sp] + movs r0, 0xF + movs r2, 0x2A + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + beq _0803BCF8 + ldr r6, =0x02024084 + ldrb r0, [r4] + movs r3, 0x58 + muls r0, r3 + adds r1, r0, r6 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0x8 + beq _0803BCBE + adds r0, r1, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0x8 + bne _0803BCF8 +_0803BCBE: + ldr r0, =0x02024474 + subs r1, r5, 0x1 + strb r1, [r0, 0x17] + ldr r2, =0x0202420a + adds r0, r1, 0 + muls r0, r3 + adds r0, r6 + adds r0, 0x20 + ldrb r0, [r0] + strb r0, [r2] + ldr r1, =0x02024332 + movs r0, 0x2 + b _0803BD90 + .pool +_0803BCF8: + ldr r1, =0x02024084 + ldr r0, =0x02024064 + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + ldr r1, =0x0400e000 + ands r0, r1 + cmp r0, 0 + bne _0803BD22 + ldr r1, =0x020242ac + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 3 + ands r0, r1 + cmp r0, 0 + beq _0803BD40 +_0803BD22: + ldr r1, =0x02024332 + movs r0, 0 + strb r0, [r1, 0x5] + movs r0, 0x1 + b _0803BD92 + .pool +_0803BD40: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x10 + ands r0, r1 + cmp r0, 0 + bne _0803BD8C +_0803BD4C: + movs r0, 0 + b _0803BD92 + .pool +_0803BD54: + ldr r0, =0x02024474 + strb r5, [r0, 0x17] + ldr r1, =0x0202420a + ldrb r0, [r2] + strb r0, [r1] + ldr r1, =0x02024332 + movs r0, 0x2 + b _0803BD90 + .pool +_0803BD70: + ldr r0, =0x02024474 + strb r5, [r0, 0x17] + ldr r1, =0x0202420a + ldrb r0, [r2] + strb r0, [r1] + ldr r1, =0x02024332 + movs r0, 0x2 + b _0803BD90 + .pool +_0803BD8C: + ldr r1, =0x02024332 + movs r0, 0x1 +_0803BD90: + strb r0, [r1, 0x5] +_0803BD92: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_803BB88 + + thumb_func_start sub_803BDA0 +sub_803BDA0: @ 803BDA0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + movs r3, 0 + ldr r0, =0x0202406e + mov r8, r0 + ldr r1, =0x0203cf00 + mov r12, r1 + ldr r7, =0x0202449c + lsls r0, r5, 1 + adds r4, r0, r5 + adds r6, r0, 0 +_0803BDBC: + mov r0, r12 + adds r2, r3, r0 + ldr r1, [r7] + adds r0, r4, r3 + adds r0, r1 + adds r0, 0x60 + ldrb r0, [r0] + strb r0, [r2] + adds r3, 0x1 + cmp r3, 0x2 + ble _0803BDBC + mov r1, r8 + adds r0, r6, r1 + ldrb r0, [r0] + bl pokemon_order_func + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r7, =0x0202449c + ldr r0, [r7] + adds r0, r5, r0 + adds r0, 0x5C + ldrb r0, [r0] + bl pokemon_order_func + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_81B8FB0 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0803BE4C + movs r3, 0 + adds r4, r7, 0 + adds r6, r5 + movs r0, 0x2 + adds r1, r5, 0 + eors r1, r0 + ldr r7, =0x0203cf00 + lsls r0, r1, 1 + adds r5, r0, r1 +_0803BE1A: + ldr r0, [r4] + adds r1, r6, r3 + adds r1, r0 + adds r1, 0x60 + adds r2, r3, r7 + ldrb r0, [r2] + strb r0, [r1] + ldr r1, [r4] + adds r0, r5, r3 + adds r0, r1 + adds r0, 0x60 + ldrb r1, [r2] + strb r1, [r0] + adds r3, 0x1 + cmp r3, 0x2 + ble _0803BE1A + b _0803BE66 + .pool +_0803BE4C: + movs r3, 0 + adds r2, r6, r5 + ldr r4, =0x0203cf00 +_0803BE52: + ldr r0, [r7] + adds r1, r2, r3 + adds r1, r0 + adds r1, 0x60 + adds r0, r3, r4 + ldrb r0, [r0] + strb r0, [r1] + adds r3, 0x1 + cmp r3, 0x2 + ble _0803BE52 +_0803BE66: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803BDA0 + + thumb_func_start sub_803BE74 +sub_803BE74: @ 803BE74 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + ldr r0, =0x02024332 + movs r1, 0 + strb r1, [r0, 0x4] + ldr r0, =0x02024064 + strb r1, [r0] + ldr r0, =0x0202406c + bl _0803CD12 + .pool +_0803BE9C: + ldr r4, =0x02024064 + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x02024332 + ldrb r0, [r4] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x8 + bls _0803BEB8 + bl _0803CD04 +_0803BEB8: + lsls r0, 2 + ldr r1, =_0803BED0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0803BED0: + .4byte _0803BEF4 + .4byte _0803BF0C + .4byte _0803C02C + .4byte _0803C7D8 + .4byte _0803CAD0 + .4byte _0803CB84 + .4byte _0803CBC8 + .4byte _0803CBF4 + .4byte _0803CC38 +_0803BEF4: + bl sub_8185FD0 + ldr r1, =0x02024332 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + bl _0803CC20 + .pool +_0803BF0C: + ldr r0, =0x02024064 + ldrb r1, [r0] + ldr r4, =0x0202449c + ldr r0, [r4] + adds r1, r0 + adds r1, 0x5C + movs r0, 0x6 + strb r0, [r1] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0803BF68 + movs r1, 0x2 + movs r0, 0x2 + ands r0, r5 + cmp r0, 0 + beq _0803BF68 + eors r5, r1 + adds r0, r5, 0 + bl battle_get_side_with_given_state + ldr r1, [r4] + adds r1, 0x91 + ldrb r1, [r1] + ldr r2, =gUnknown_0832A328 + lsls r0, 24 + lsrs r0, 22 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0803BF68 + ldr r4, =0x02024332 + adds r0, r5, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0x5 + beq _0803BF68 + bl _0803CD04 +_0803BF68: + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x91 + ldrb r3, [r0] + ldr r1, =gUnknown_0832A328 + ldr r4, =0x02024064 + ldrb r2, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + ands r3, r0 + cmp r3, 0 + beq _0803BFD0 + ldr r0, =0x0202421c + adds r0, r2, r0 + movs r1, 0xD + strb r1, [r0] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0803BFBC + ldr r0, =0x02024332 + ldrb r1, [r4] + adds r1, r0 + movs r0, 0x5 + strb r0, [r1] + bl _0803CD04 + .pool +_0803BFBC: + ldr r0, =0x02024332 + ldrb r1, [r4] + adds r1, r0 + movs r0, 0x4 + strb r0, [r1] + bl _0803CD04 + .pool +_0803BFD0: + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 5 + ands r0, r1 + cmp r0, 0 + bne _0803BFF0 + movs r0, 0x80 + lsls r0, 15 + ands r1, r0 + cmp r1, 0 + beq _0803C00C +_0803BFF0: + ldr r0, =0x0202421c + adds r0, r2, r0 + strb r3, [r0] + ldr r1, =0x02024332 + ldrb r0, [r4] + bl _0803CC72 + .pool +_0803C00C: + ldr r0, =0x0202421c + ldrb r1, [r0] + ldr r0, =0x02023864 + ldrb r2, [r0, 0x1] + ldrb r0, [r0, 0x2] + lsls r0, 8 + orrs r2, r0 + movs r0, 0 + bl dp01_build_cmdbuf_x12_a_bb + bl _0803CB68 + .pool +_0803C02C: + ldr r3, =0x02024068 + ldr r1, =gUnknown_0832A328 + ldr r6, =0x02024064 + ldrb r5, [r6] + lsls r0, r5, 2 + adds r0, r1 + ldr r2, [r0] + lsls r1, r2, 4 + movs r0, 0xF0 + lsls r0, 24 + orrs r1, r0 + orrs r1, r2 + lsls r0, r2, 8 + orrs r1, r0 + lsls r2, 12 + orrs r1, r2 + ldr r0, [r3] + ands r0, r1 + cmp r0, 0 + beq _0803C058 + bl _0803CD04 +_0803C058: + ldr r4, =0x02023864 + lsls r0, r5, 9 + adds r4, 0x1 + adds r0, r4 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_8184FBC + ldr r1, =0x0202421c + ldrb r0, [r6] + adds r1, r0, r1 + lsls r0, 9 + adds r0, r4 + ldrb r0, [r0] + strb r0, [r1] + ldrb r0, [r6] + lsls r0, 9 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0xC + bls _0803C084 + b _0803C6C4 +_0803C084: + lsls r0, 2 + ldr r1, =_0803C0A8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0803C0A8: + .4byte _0803C0DC + .4byte _0803C230 + .4byte _0803C268 + .4byte _0803C6C4 + .4byte _0803C6C4 + .4byte _0803C440 + .4byte _0803C48C + .4byte _0803C6C4 + .4byte _0803C6C4 + .4byte _0803C6C4 + .4byte _0803C6C4 + .4byte _0803C6C4 + .4byte _0803C4B4 +_0803C0DC: + bl sub_80400C8 + lsls r0, 24 + cmp r0, 0 + beq _0803C134 + ldr r0, =0x02024332 + ldr r3, =0x02024064 + ldrb r1, [r3] + adds r1, r0 + movs r4, 0 + movs r0, 0x6 + strb r0, [r1] + ldrb r1, [r3] + ldr r2, =0x0202449c + ldr r0, [r2] + adds r1, r0 + adds r1, 0x54 + strb r4, [r1] + ldrb r1, [r3] + ldr r0, [r2] + adds r1, r0 + adds r1, 0x84 + movs r0, 0x4 + strb r0, [r1] + ldrb r1, [r3] + ldr r2, [r2] + adds r2, r1, r2 + ldr r0, =0x02023864 + lsls r1, 9 + adds r0, 0x3 + adds r1, r0 + ldrb r0, [r1] + strb r0, [r2, 0xC] + bl _0803CD70 + .pool +_0803C134: + ldr r3, =0x020242bc + ldr r5, =0x02024064 + ldrb r4, [r5] + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r0, r3 + ldrh r2, [r0, 0x6] + cmp r2, 0 + beq _0803C188 + ldr r1, =0x02024274 + lsls r0, r4, 1 + adds r0, r1 + strh r2, [r0] + ldrb r2, [r5] + ldr r0, =0x0202449c + ldr r1, [r0] + adds r1, r2, r1 + adds r1, 0x80 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0xC] + strb r0, [r1] + ldr r1, =0x02024332 + ldrb r0, [r5] + adds r0, r1 + movs r1, 0x4 + strb r1, [r0] + bl _0803CD70 + .pool +_0803C188: + add r2, sp, 0x4 + ldr r3, =0x02024084 + movs r1, 0x58 + adds r0, r4, 0 + muls r0, r1 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r2, 0x10] + ldrb r0, [r5] + muls r0, r1 + adds r0, r3 + adds r0, 0x21 + ldrb r0, [r0] + strb r0, [r2, 0x12] + ldrb r0, [r5] + muls r0, r1 + adds r0, r3 + adds r0, 0x22 + ldrb r0, [r0] + strb r0, [r2, 0x13] + movs r4, 0 + mov r1, sp + adds r1, 0xC + str r1, [sp, 0x18] + add r2, sp, 0x10 + mov r10, r2 + mov r8, r3 + adds r7, r5, 0 + movs r6, 0x58 + movs r0, 0xC + add r0, r8 + mov r9, r0 + add r5, sp, 0x4 +_0803C1CA: + lsls r2, r4, 1 + ldrb r0, [r7] + muls r0, r6 + adds r0, r2, r0 + add r0, r9 + ldrh r0, [r0] + strh r0, [r5] + ldr r1, [sp, 0x18] + adds r3, r1, r4 + ldrb r0, [r7] + muls r0, r6 + adds r0, r4, r0 + mov r1, r8 + adds r1, 0x24 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r3] + ldrb r0, [r7] + adds r1, r0, 0 + muls r1, r6 + adds r2, r1 + add r2, r9 + ldrh r0, [r2] + add r1, r8 + adds r1, 0x3B + ldrb r1, [r1] + lsls r2, r4, 24 + lsrs r2, 24 + bl CalcPPWithPPUps + mov r2, r10 + adds r1, r2, r4 + strb r0, [r1] + adds r5, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + ble _0803C1CA + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x1 + ands r1, r0 + movs r0, 0 + movs r2, 0 + add r3, sp, 0x4 + bl sub_8033E30 + b _0803C42E + .pool +_0803C230: + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x021f0902 + ands r0, r1 + cmp r0, 0 + bne _0803C23E + b _0803C48C +_0803C23E: + ldr r4, =0x02024064 + ldrb r0, [r4] + movs r1, 0x1 + bl sub_8185008 + ldr r1, =0x02024220 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =gUnknown_082DB879 + b _0803C784 + .pool +_0803C268: + ldr r5, =0x02024064 + ldrb r0, [r5] + ldr r3, =0x0202449c + ldr r1, [r3] + adds r1, r0, r1 + adds r1, 0x58 + ldr r2, =0x0202406e + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + strb r0, [r1] + ldr r7, =0x02024084 + ldrb r2, [r5] + movs r6, 0x58 + adds r0, r2, 0 + muls r0, r6 + adds r1, r7, 0 + adds r1, 0x50 + adds r0, r1 + ldr r1, [r0] + ldr r0, =0x0400e000 + ands r1, r0 + cmp r1, 0 + bne _0803C2B8 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + bne _0803C2B8 + ldr r0, =0x020242ac + lsls r1, r2, 2 + adds r1, r0 + ldr r1, [r1] + movs r0, 0x80 + lsls r0, 3 + ands r1, r0 + cmp r1, 0 + beq _0803C2EC +_0803C2B8: + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r1, r0, 1 + adds r1, r0 + adds r1, 0x60 + ldr r0, [r3] + adds r0, r1 + str r0, [sp] + movs r0, 0 + movs r1, 0x2 + movs r2, 0x6 + b _0803C400 + .pool +_0803C2EC: + str r1, [sp] + movs r0, 0xC + adds r1, r2, 0 + movs r2, 0x17 + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0803C374 + ldrb r1, [r5] + str r4, [sp] + movs r0, 0xC + movs r2, 0x47 + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0803C33C + ldrb r0, [r5] + muls r0, r6 + adds r1, r0, r7 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0x2 + beq _0803C33C + adds r0, r1, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0x2 + beq _0803C33C + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x1A + bne _0803C374 +_0803C33C: + ldr r5, =0x02024064 + ldrb r1, [r5] + movs r0, 0 + str r0, [sp] + movs r0, 0xF + movs r2, 0x2A + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0803C3B0 + ldr r2, =0x02024084 + ldrb r1, [r5] + movs r0, 0x58 + muls r0, r1 + adds r1, r0, r2 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0x8 + beq _0803C374 + adds r0, r1, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0x8 + bne _0803C3B0 +_0803C374: + subs r1, r4, 0x1 + lsls r1, 4 + movs r0, 0x4 + orrs r1, r0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =0x0202420a + ldrb r3, [r0] + ldr r4, =0x0202449c + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r2, r0, 1 + adds r2, r0 + adds r2, 0x60 + ldr r0, [r4] + adds r0, r2 + str r0, [sp] + movs r0, 0 + movs r2, 0x6 + bl dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f + b _0803C42E + .pool +_0803C3B0: + ldr r0, =0x02024064 + ldrb r1, [r0] + adds r4, r0, 0 + cmp r1, 0x2 + bne _0803C3D8 + ldr r0, =0x0202421c + ldrb r0, [r0] + cmp r0, 0x2 + bne _0803C3D8 + ldr r0, =0x0202449c + ldr r3, [r0] + adds r0, r3, 0 + adds r0, 0x5C + b _0803C3EE + .pool +_0803C3D8: + ldrb r0, [r4] + cmp r0, 0x3 + bne _0803C410 + ldr r0, =0x0202421c + ldrb r0, [r0, 0x1] + cmp r0, 0x2 + bne _0803C410 + ldr r0, =0x0202449c + ldr r3, [r0] + adds r0, r3, 0 + adds r0, 0x5D +_0803C3EE: + ldrb r2, [r0] + ldrb r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + adds r0, 0x60 + adds r3, r0 + str r3, [sp] + movs r0, 0 + movs r1, 0 +_0803C400: + movs r3, 0 + bl dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f + b _0803C42E + .pool +_0803C410: + ldr r2, =0x0202449c + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r1, r0, 1 + adds r1, r0 + adds r1, 0x60 + ldr r0, [r2] + adds r0, r1 + str r0, [sp] + movs r0, 0 + movs r1, 0 + movs r2, 0x6 + movs r3, 0 + bl dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f +_0803C42E: + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + b _0803C6C4 + .pool +_0803C440: + bl sub_806B8B0 + lsls r0, 24 + cmp r0, 0 + bne _0803C44C + b _0803C6C4 +_0803C44C: + ldr r1, =0x02024220 + ldr r3, =0x02024064 + ldrb r0, [r3] + lsls r0, 2 + adds r0, r1 + ldr r1, =gUnknown_082DAB11 + str r1, [r0] + ldr r0, =0x02024332 + ldrb r1, [r3] + adds r1, r0 + movs r4, 0 + movs r0, 0x6 + strb r0, [r1] + ldrb r1, [r3] + ldr r2, =0x0202449c + ldr r0, [r2] + adds r1, r0 + adds r1, 0x54 + strb r4, [r1] + ldrb r1, [r3] + b _0803C7A0 + .pool +_0803C48C: + ldr r2, =0x0202449c + ldr r4, =0x02024064 + ldrb r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + adds r0, 0x60 + ldr r1, [r2] + adds r1, r0 + movs r0, 0 + bl sub_8033E6C + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + b _0803C6C4 + .pool +_0803C4B4: + ldr r4, =0x02024332 + ldr r5, =0x02024064 + ldrb r0, [r5] + adds r0, r4 + movs r1, 0x7 + strb r1, [r0] + ldrb r0, [r5] + bl battle_get_per_side_status + movs r6, 0x2 + eors r0, r6 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + movs r1, 0x1 + strb r1, [r0] + ldrb r0, [r5] + bl sub_8185008 + ldrb r0, [r5] + bl battle_get_per_side_status + eors r0, r6 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + ldr r1, =0x02024084 + lsls r0, 24 + lsrs r0, 24 + movs r7, 0x58 + muls r0, r7 + adds r4, r1, 0 + adds r4, 0x50 + adds r0, r4 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 5 + ands r0, r1 + cmp r0, 0 + bne _0803C532 + ldrb r0, [r5] + bl battle_get_per_side_status + eors r0, r6 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + muls r0, r7 + adds r0, r4 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _0803C550 +_0803C532: + movs r0, 0 + bl dp01_build_cmdbuf_x32_32_32_32 + ldrb r0, [r5] + bl dp01_battle_side_mark_buffer_for_execution + bl _0803CD70 + .pool +_0803C550: + ldr r4, =0x0202421c + ldrb r0, [r5] + bl battle_get_per_side_status + eors r0, r6 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0x2 + bne _0803C590 + ldrb r0, [r5] + bl battle_get_per_side_status + eors r0, r6 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl sub_8185008 + b _0803C6AE + .pool +_0803C590: + ldrb r0, [r5] + bl battle_get_per_side_status + eors r0, r6 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0x3 + bne _0803C5B6 + ldrb r0, [r5] + bl battle_get_per_side_status + eors r0, r6 + b _0803C668 +_0803C5B6: + ldrb r0, [r5] + bl battle_get_per_side_status + eors r0, r6 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _0803C628 + ldr r4, =0x0202433c + ldrb r0, [r5] + bl battle_get_per_side_status + eors r0, r6 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 20 + adds r0, r4 + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _0803C616 + ldr r4, =0x020242bc + ldrb r0, [r5] + bl battle_get_per_side_status + eors r0, r6 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r4 + ldrh r0, [r1, 0x6] + cmp r0, 0 + beq _0803C628 +_0803C616: + ldrb r0, [r5] + bl battle_get_per_side_status + eors r0, r6 + b _0803C668 + .pool +_0803C628: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _0803C690 + ldr r4, =0x0202421c + ldr r6, =0x02024064 + ldrb r0, [r6] + bl battle_get_per_side_status + movs r5, 0x2 + eors r0, r5 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _0803C690 + ldr r1, =0x03005d80 + ldr r0, =0x0203bd30 + ldr r0, [r0] + str r0, [r1] + ldrb r0, [r6] + bl battle_get_per_side_status + eors r0, r5 +_0803C668: + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_8185008 + b _0803C6AE + .pool +_0803C690: + ldr r0, =0x02024064 + ldrb r0, [r0] + bl battle_get_per_side_status + movs r1, 0x2 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3 + bl sub_8185008 +_0803C6AE: + movs r0, 0 + bl dp01_build_cmdbuf_x32_32_32_32 + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + b _0803CD70 + .pool +_0803C6C4: + ldr r1, =0x02022fec + ldr r2, [r1] + movs r5, 0x8 + adds r0, r2, 0 + ands r0, r5 + adds r3, r1, 0 + cmp r0, 0 + beq _0803C720 + ldr r0, =0x043f0100 + ands r2, r0 + cmp r2, 0 + beq _0803C720 + ldr r0, =0x02023864 + ldr r4, =0x02024064 + ldrb r2, [r4] + lsls r1, r2, 9 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x3 + bne _0803C720 + ldr r1, =0x02024220 + lsls r0, r2, 2 + adds r0, r1 + ldr r1, =gUnknown_082DB9BA + str r1, [r0] + ldr r1, =0x02024332 + ldrb r0, [r4] + adds r0, r1 + movs r3, 0 + strb r5, [r0] + b _0803C792 + .pool +_0803C720: + ldr r0, [r3] + ldr r1, =0x0200000a + ands r0, r1 + cmp r0, 0x8 + bne _0803C760 + ldr r0, =0x02023864 + ldr r4, =0x02024064 + ldrb r1, [r4] + lsls r1, 9 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x3 + bne _0803C760 + ldr r0, =gUnknown_082DAAFE + bl b_call_bc_move_exec + ldr r1, =0x02024332 + ldrb r0, [r4] + adds r0, r1 + b _0803CC20 + .pool +_0803C760: + bl sub_803BB88 + lsls r0, 24 + cmp r0, 0 + beq _0803C7C4 + ldr r0, =0x02023864 + ldr r4, =0x02024064 + ldrb r2, [r4] + lsls r1, r2, 9 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x3 + bne _0803C7C4 + ldr r1, =0x02024220 + lsls r0, r2, 2 + adds r0, r1 + ldr r1, =gUnknown_082DAB0B +_0803C784: + str r1, [r0] + ldr r0, =0x02024332 + ldrb r1, [r4] + adds r1, r0 + movs r3, 0 + movs r0, 0x6 + strb r0, [r1] +_0803C792: + ldrb r1, [r4] + ldr r2, =0x0202449c + ldr r0, [r2] + adds r1, r0 + adds r1, 0x54 + strb r3, [r1] + ldrb r1, [r4] +_0803C7A0: + ldr r0, [r2] + adds r1, r0 + adds r1, 0x84 + movs r0, 0x1 + strb r0, [r1] + b _0803CD70 + .pool +_0803C7C4: + ldr r2, =0x02024332 + ldr r0, =0x02024064 + ldrb r1, [r0] + adds r1, r2 + b _0803CB74 + .pool +_0803C7D8: + ldr r4, =0x02024068 + ldr r1, =gUnknown_0832A328 + ldr r3, =0x02024064 + ldrb r5, [r3] + lsls r0, r5, 2 + adds r0, r1 + ldr r2, [r0] + lsls r0, r2, 4 + movs r1, 0xF0 + lsls r1, 24 + orrs r0, r1 + orrs r0, r2 + lsls r1, r2, 8 + orrs r0, r1 + lsls r2, 12 + orrs r0, r2 + ldr r1, [r4] + ands r1, r0 + adds r4, r3, 0 + cmp r1, 0 + beq _0803C804 + b _0803CD04 +_0803C804: + ldr r1, =0x0202421c + adds r0, r5, r1 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0x9 + bls _0803C812 + b _0803CD04 +_0803C812: + lsls r0, 2 + ldr r1, =_0803C830 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0803C830: + .4byte _0803C858 + .4byte _0803C99C + .4byte _0803C9D4 + .4byte _0803CA0A + .4byte _0803CA2C + .4byte _0803CA40 + .4byte _0803CA54 + .4byte _0803CA84 + .4byte _0803CA98 + .4byte _0803CABC +_0803C858: + ldr r1, =0x02023864 + ldrb r3, [r4] + lsls r0, r3, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r1, [r0] + cmp r1, 0x3 + blt _0803C88A + cmp r1, 0x9 + ble _0803C878 + cmp r1, 0xF + beq _0803C87E + b _0803C88A + .pool +_0803C878: + adds r0, r3, r2 + strb r1, [r0] + b _0803CD70 +_0803C87E: + adds r1, r3, r2 + movs r0, 0x2 + strb r0, [r1] + bl sub_803CDF8 + b _0803CD70 +_0803C88A: + movs r0, 0x2 + bl sub_818603C + ldr r4, =0x02023864 + ldr r6, =0x02024064 + ldrb r3, [r6] + lsls r1, r3, 9 + adds r5, r4, 0x2 + adds r0, r1, r5 + ldrb r2, [r0] + adds r7, r4, 0x3 + adds r1, r7 + ldrb r0, [r1] + lsls r0, 8 + orrs r2, r0 + ldr r0, =0x0000ffff + cmp r2, r0 + bne _0803C8D0 + ldr r0, =0x02024332 + adds r0, r3, r0 + movs r1, 0x1 + strb r1, [r0] + ldrb r0, [r6] + bl sub_8185008 + b _0803CD04 + .pool +_0803C8D0: + bl sub_803FB4C + lsls r0, 24 + cmp r0, 0 + beq _0803C91C + ldrb r0, [r6] + movs r1, 0x1 + bl sub_8185008 + ldr r0, =0x02024332 + ldrb r1, [r6] + adds r1, r0 + movs r3, 0 + movs r0, 0x6 + strb r0, [r1] + ldrb r1, [r6] + ldr r2, =0x0202449c + ldr r0, [r2] + adds r1, r0 + adds r1, 0x54 + strb r3, [r1] + ldrb r0, [r6] + lsls r0, 9 + adds r1, r4, 0x1 + adds r0, r1 + strb r3, [r0] + ldrb r1, [r6] + ldr r0, [r2] + adds r1, r0 + adds r1, 0x84 + movs r0, 0x2 + strb r0, [r1] + b _0803CD70 + .pool +_0803C91C: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + bne _0803C942 + ldrb r0, [r6] + lsls r1, r0, 9 + adds r1, r5 + ldrb r1, [r1] + bl sub_8184FBC + ldrb r0, [r6] + lsls r1, r0, 9 + adds r1, r7 + ldrb r1, [r1] + bl sub_8184FBC +_0803C942: + ldrb r0, [r6] + ldr r4, =0x0202449c + ldr r1, [r4] + adds r1, r0, r1 + adds r1, 0x80 + lsls r0, 9 + adds r0, r5 + ldrb r0, [r0] + strb r0, [r1] + ldr r0, =0x02024274 + ldrb r2, [r6] + lsls r5, r2, 1 + adds r5, r0 + ldr r3, =0x02024084 + ldr r4, [r4] + adds r0, r2, r4 + adds r0, 0x80 + ldrb r0, [r0] + lsls r0, 1 + movs r1, 0x58 + muls r1, r2 + adds r0, r1 + adds r3, 0xC + adds r0, r3 + ldrh r0, [r0] + strh r0, [r5] + ldrb r0, [r6] + adds r4, r0, r4 + lsls r0, 9 + adds r0, r7 + ldrb r0, [r0] + strb r0, [r4, 0xC] + ldr r0, =0x02024332 + ldrb r1, [r6] + b _0803CB72 + .pool +_0803C99C: + ldr r2, =0x02023864 + ldr r5, =0x02024064 + ldrb r4, [r5] + lsls r1, r4, 9 + adds r0, r2, 0x1 + adds r0, r1, r0 + ldrb r3, [r0] + adds r2, 0x2 + adds r1, r2 + ldrb r0, [r1] + lsls r0, 8 + orrs r3, r0 + cmp r3, 0 + bne _0803C9BA + b _0803CC1C +_0803C9BA: + ldr r0, =0x02024208 + strh r3, [r0] + ldr r0, =0x02024332 + ldrb r1, [r5] + b _0803CB72 + .pool +_0803C9D4: + ldr r0, =0x02023864 + ldr r4, =0x02024064 + ldrb r2, [r4] + lsls r1, r2, 9 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x6 + bne _0803CA04 + ldr r0, =0x02024332 + adds r0, r2, r0 + movs r1, 0x1 + strb r1, [r0] + ldrb r0, [r4] + bl sub_8185008 + b _0803CD04 + .pool +_0803CA04: + bl sub_803CDF8 + b _0803CB6E +_0803CA0A: + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 8 + orrs r0, r1 + str r0, [r2] + ldr r2, =0x02024332 + ldr r0, =0x02024064 + ldrb r1, [r0] + adds r1, r2 + b _0803CB74 + .pool +_0803CA2C: + ldr r2, =0x02024332 + ldr r0, =0x02024064 + ldrb r1, [r0] + adds r1, r2 + b _0803CB74 + .pool +_0803CA40: + ldr r2, =0x02024332 + ldr r0, =0x02024064 + ldrb r1, [r0] + adds r1, r2 + b _0803CB74 + .pool +_0803CA54: + ldr r3, =0x02023864 + ldr r0, =0x02024064 + ldrb r4, [r0] + lsls r1, r4, 9 + adds r0, r3, 0x1 + adds r0, r1, r0 + ldrb r2, [r0] + adds r3, 0x2 + adds r1, r3 + ldrb r0, [r1] + lsls r0, 8 + orrs r2, r0 + cmp r2, 0 + bne _0803CA72 + b _0803CC1C +_0803CA72: + ldr r1, =0x02024332 + adds r1, r4, r1 + b _0803CB74 + .pool +_0803CA84: + ldr r2, =0x02024332 + ldr r0, =0x02024064 + ldrb r1, [r0] + adds r1, r2 + b _0803CB74 + .pool +_0803CA98: + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 8 + orrs r0, r1 + str r0, [r2] + ldr r2, =0x02024332 + ldr r0, =0x02024064 + ldrb r1, [r0] + adds r1, r2 + b _0803CB74 + .pool +_0803CABC: + ldr r2, =0x02024332 + ldr r0, =0x02024064 + ldrb r1, [r0] + adds r1, r2 + b _0803CB74 + .pool +_0803CAD0: + ldr r3, =0x02024068 + ldr r6, =gUnknown_0832A328 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r6 + ldr r2, [r0] + lsls r1, r2, 4 + movs r0, 0xF0 + lsls r0, 24 + orrs r1, r0 + orrs r1, r2 + lsls r0, r2, 8 + orrs r1, r0 + lsls r2, 12 + orrs r1, r2 + ldr r0, [r3] + ands r0, r1 + cmp r0, 0 + beq _0803CAFA + b _0803CD04 +_0803CAFA: + bl sub_803CDB8 + lsls r0, 24 + lsrs r0, 24 + negs r1, r0 + orrs r1, r0 + lsrs r4, r1, 31 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x41 + ands r0, r1 + cmp r0, 0x1 + bne _0803CB3C + movs r1, 0x2 + movs r0, 0x2 + ands r0, r5 + cmp r0, 0 + bne _0803CB3C + adds r0, r5, 0 + eors r0, r1 + bl battle_get_side_with_given_state + ldr r1, =0x0202449c + ldr r1, [r1] + adds r1, 0x91 + ldrb r1, [r1] + lsls r0, 24 + lsrs r0, 22 + adds r0, r6 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _0803CB5C +_0803CB3C: + movs r0, 0 + movs r1, 0 + adds r2, r4, 0 + bl sub_8034464 + b _0803CB66 + .pool +_0803CB5C: + movs r0, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl sub_8034464 +_0803CB66: + ldr r4, =0x02024064 +_0803CB68: + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803CB6E: + ldr r0, =0x02024332 + ldrb r1, [r4] +_0803CB72: + adds r1, r0 +_0803CB74: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0803CD04 + .pool +_0803CB84: + ldr r3, =0x02024068 + ldr r1, =gUnknown_0832A328 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r2, [r0] + lsls r1, r2, 4 + movs r0, 0xF0 + lsls r0, 24 + orrs r1, r0 + orrs r1, r2 + lsls r0, r2, 8 + orrs r1, r0 + lsls r2, 12 + orrs r1, r2 + ldr r0, [r3] + ands r0, r1 + cmp r0, 0 + beq _0803CBAE + b _0803CD04 +_0803CBAE: + ldr r1, =0x02024332 + ldrb r0, [r1, 0x4] + adds r0, 0x1 + strb r0, [r1, 0x4] + b _0803CD04 + .pool +_0803CBC8: + ldr r5, =0x02024064 + ldrb r2, [r5] + ldr r0, =0x0202449c + ldr r0, [r0] + adds r1, r2, r0 + adds r0, r1, 0 + adds r0, 0x54 + ldrb r0, [r0] + cmp r0, 0 + beq _0803CCB4 + ldr r0, =0x02024332 + adds r0, r2, r0 + adds r1, 0x84 + ldrb r1, [r1] + strb r1, [r0] + b _0803CD04 + .pool +_0803CBF4: + ldr r3, =0x02024068 + ldr r1, =gUnknown_0832A328 + ldr r0, =0x02024064 + ldrb r4, [r0] + lsls r0, r4, 2 + adds r0, r1 + ldr r2, [r0] + lsls r1, r2, 4 + movs r0, 0xF0 + lsls r0, 24 + orrs r1, r0 + orrs r1, r2 + lsls r0, r2, 8 + orrs r1, r0 + lsls r2, 12 + orrs r1, r2 + ldr r0, [r3] + ands r0, r1 + cmp r0, 0 + bne _0803CD04 +_0803CC1C: + ldr r0, =0x02024332 + adds r0, r4, r0 +_0803CC20: + movs r1, 0x1 + strb r1, [r0] + b _0803CD04 + .pool +_0803CC38: + ldr r5, =0x02024064 + ldrb r2, [r5] + ldr r4, =0x0202449c + ldr r0, [r4] + adds r0, r2, r0 + adds r0, 0x54 + ldrb r0, [r0] + cmp r0, 0 + beq _0803CCB4 + ldr r0, =0x02023864 + lsls r1, r2, 9 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0xD + bne _0803CC94 + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 8 + orrs r0, r1 + str r0, [r2] + ldr r1, =0x0202421c + ldrb r0, [r5] + adds r0, r1 + movs r1, 0x3 + strb r1, [r0] + ldr r1, =0x02024332 + ldrb r0, [r5] +_0803CC72: + adds r0, r1 + movs r1, 0x4 + strb r1, [r0] + b _0803CD04 + .pool +_0803CC94: + adds r0, r2, 0 + movs r1, 0x1 + bl sub_8185008 + ldr r2, =0x02024332 + ldrb r0, [r5] + adds r2, r0, r2 + ldr r1, [r4] + adds r0, r1 + adds r0, 0x84 + ldrb r0, [r0] + strb r0, [r2] + b _0803CD04 + .pool +_0803CCB4: + ldr r0, =0x0202420b + strb r2, [r0] + ldr r7, =0x02024214 + ldr r6, =0x02024220 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r6 + ldr r4, [r0] + str r4, [r7] + ldr r3, =0x02024068 + ldr r1, =gUnknown_0832A328 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r2, [r0] + lsls r1, r2, 4 + movs r0, 0xF0 + lsls r0, 24 + orrs r1, r0 + orrs r1, r2 + lsls r0, r2, 8 + orrs r1, r0 + lsls r2, 12 + orrs r1, r2 + ldr r0, [r3] + ands r0, r1 + cmp r0, 0 + bne _0803CCFA + ldr r0, =gUnknown_0831BD10 + ldrb r1, [r4] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 +_0803CCFA: + ldrb r0, [r5] + lsls r0, 2 + adds r0, r6 + ldr r1, [r7] + str r1, [r0] +_0803CD04: + ldr r0, =0x02024064 + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + ldr r0, =0x0202406c + lsls r1, 24 + lsrs r1, 24 +_0803CD12: + adds r5, r0, 0 + ldrb r0, [r5] + cmp r1, r0 + bcs _0803CD1E + bl _0803BE9C +_0803CD1E: + ldr r0, =0x02024332 + ldrb r0, [r0, 0x4] + ldrb r1, [r5] + cmp r0, r1 + bne _0803CD70 + movs r0, 0x1 + bl sub_818603C + ldr r1, =0x03005d04 + ldr r0, =sub_803D2E8 + str r0, [r1] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _0803CD70 + movs r4, 0 + ldrb r5, [r5] + cmp r4, r5 + bge _0803CD70 +_0803CD4A: + ldr r0, =0x0202421c + adds r0, r4, r0 + ldrb r0, [r0] + cmp r0, 0x2 + bne _0803CD66 + lsls r0, r4, 24 + lsrs r0, 24 + ldr r1, =0x0202449c + ldr r1, [r1] + adds r1, r4, r1 + adds r1, 0x5C + ldrb r1, [r1] + bl sub_80571DC +_0803CD66: + adds r4, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _0803CD4A +_0803CD70: + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803BE74 + + thumb_func_start sub_803CDB8 +sub_803CDB8: @ 803CDB8 + push {r4,r5,lr} + movs r3, 0 + movs r1, 0 + ldr r0, =0x0202406c + ldrb r2, [r0] + adds r5, r0, 0 + cmp r3, r2 + bge _0803CDDA + ldr r4, =0x02024332 +_0803CDCA: + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, 0x5 + bne _0803CDD4 + adds r3, 0x1 +_0803CDD4: + adds r1, 0x1 + cmp r1, r2 + blt _0803CDCA +_0803CDDA: + adds r0, r3, 0x1 + ldrb r5, [r5] + cmp r0, r5 + beq _0803CDF0 + movs r0, 0 + b _0803CDF2 + .pool +_0803CDF0: + movs r0, 0x1 +_0803CDF2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_803CDB8 + + thumb_func_start sub_803CDF8 +sub_803CDF8: @ 803CDF8 + push {r4-r7,lr} + ldr r7, =0x02024064 + ldrb r0, [r7] + ldr r6, =0x0202449c + ldr r1, [r6] + adds r1, r0, r1 + adds r1, 0x5C + ldr r4, =0x02023864 + lsls r0, 9 + adds r2, r4, 0x1 + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + ldrb r0, [r7] + lsls r1, r0, 9 + adds r1, r2 + ldrb r1, [r1] + bl sub_8184FBC + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x42 + ands r0, r1 + cmp r0, 0x42 + bne _0803CEC6 + ldrb r0, [r7] + ldr r2, [r6] + lsls r1, r0, 1 + adds r1, r0 + adds r1, r2 + adds r1, 0x60 + ldrb r2, [r1] + movs r0, 0xF + ands r0, r2 + strb r0, [r1] + ldrb r0, [r7] + ldr r2, [r6] + lsls r1, r0, 1 + adds r1, r0 + adds r1, r2 + adds r1, 0x60 + lsls r0, 9 + adds r5, r4, 0x2 + adds r0, r5 + ldrb r2, [r0] + movs r3, 0xF0 + adds r0, r3, 0 + ands r0, r2 + ldrb r2, [r1] + orrs r0, r2 + strb r0, [r1] + ldrb r1, [r7] + ldr r2, [r6] + lsls r0, r1, 1 + adds r0, r1 + adds r0, r2 + adds r0, 0x61 + lsls r1, 9 + adds r4, 0x3 + mov r12, r4 + add r1, r12 + ldrb r1, [r1] + strb r1, [r0] + ldrb r0, [r7] + movs r4, 0x2 + eors r0, r4 + ldr r2, [r6] + lsls r1, r0, 1 + adds r1, r0 + adds r1, r2 + adds r1, 0x60 + ldrb r2, [r1] + adds r0, r3, 0 + ands r0, r2 + strb r0, [r1] + ldrb r0, [r7] + eors r0, r4 + ldr r2, [r6] + lsls r1, r0, 1 + adds r1, r0 + adds r1, r2 + adds r1, 0x60 + ldrb r0, [r7] + lsls r0, 9 + adds r0, r5 + ldrb r0, [r0] + ands r3, r0 + lsrs r3, 4 + ldrb r0, [r1] + orrs r3, r0 + strb r3, [r1] + ldrb r0, [r7] + eors r4, r0 + ldr r0, [r6] + lsls r1, r4, 1 + adds r1, r4 + adds r1, r0 + adds r1, 0x62 + ldrb r0, [r7] + lsls r0, 9 + add r0, r12 + ldrb r0, [r0] + strb r0, [r1] +_0803CEC6: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803CDF8 + + thumb_func_start sub_803CEDC +sub_803CEDC: @ 803CEDC + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =0x0202407a + adds r4, r0, r2 + ldrb r5, [r4] + adds r2, r1, r2 + ldrb r3, [r2] + strb r3, [r4] + strb r5, [r2] + ldr r2, =0x0202407e + adds r0, r2 + ldrb r5, [r0] + adds r1, r2 + ldrb r2, [r1] + strb r2, [r0] + strb r5, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803CEDC + + thumb_func_start b_first_side +b_first_side: @ 803CF10 + 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 + mov r9, r0 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0xD + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + bne _0803CFD8 + ldr r1, [sp, 0x8] + str r1, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0x4D + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + bne _0803CFD8 + ldr r1, =0x02024084 + movs r0, 0x58 + mov r2, r9 + muls r2, r0 + adds r0, r2, 0 + adds r0, r1 + adds r0, 0x20 + ldrb r3, [r0] + cmp r3, 0x21 + bne _0803CF7C + ldr r0, =0x020243cc + ldrh r1, [r0] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + bne _0803CF8C +_0803CF7C: + cmp r3, 0x22 + bne _0803CF98 + ldr r0, =0x020243cc + ldrh r1, [r0] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _0803CF98 +_0803CF8C: + movs r3, 0x2 + b _0803CF9A + .pool +_0803CF98: + movs r3, 0x1 +_0803CF9A: + movs r0, 0x58 + mov r1, r10 + muls r1, r0 + adds r0, r1, 0 + ldr r2, =0x02024084 + adds r0, r2 + adds r0, 0x20 + ldrb r2, [r0] + cmp r2, 0x21 + bne _0803CFBA + ldr r0, =0x020243cc + ldrh r1, [r0] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + bne _0803CFCA +_0803CFBA: + cmp r2, 0x22 + bne _0803CFDA + ldr r0, =0x020243cc + ldrh r1, [r0] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _0803CFDA +_0803CFCA: + movs r7, 0x2 + b _0803CFDC + .pool +_0803CFD8: + movs r3, 0x1 +_0803CFDA: + movs r7, 0x1 +_0803CFDC: + ldr r1, =0x02024084 + movs r0, 0x58 + mov r2, r9 + muls r2, r0 + adds r0, r2, 0 + adds r4, r0, r1 + ldrh r0, [r4, 0x6] + muls r3, r0 + ldr r2, =gUnknown_08329D2E + movs r1, 0x1B + ldrsb r1, [r4, r1] + lsls r1, 1 + adds r0, r1, r2 + ldrb r0, [r0] + muls r0, r3 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + bl __divsi3 + mov r8, r0 + ldrh r0, [r4, 0x2E] + cmp r0, 0xAF + bne _0803D02C + ldr r1, =0x02024404 + mov r3, r9 + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r6, [r0, 0x7] + ldrb r5, [r0, 0x1A] + b _0803D040 + .pool +_0803D02C: + ldrh r0, [r4, 0x2E] + bl itemid_get_x12 + lsls r0, 24 + lsrs r6, r0, 24 + ldrh r0, [r4, 0x2E] + bl itemid_get_quality + lsls r0, 24 + lsrs r5, r0, 24 +_0803D040: + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x023f0102 + ands r0, r1 + cmp r0, 0 + bne _0803D074 + ldr r0, =0x00000869 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0803D074 + mov r0, r9 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0803D074 + movs r0, 0x6E + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + movs r1, 0x64 + bl __udivsi3 + mov r8, r0 +_0803D074: + cmp r6, 0x18 + bne _0803D07E + mov r2, r8 + lsrs r2, 1 + mov r8, r2 +_0803D07E: + ldr r1, =0x02024084 + movs r0, 0x58 + mov r3, r9 + muls r3, r0 + adds r0, r3, 0 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0803D09C + mov r0, r8 + lsrs r0, 2 + mov r8, r0 +_0803D09C: + cmp r6, 0x1A + bne _0803D0B8 + ldr r0, =0x02024330 + ldrh r4, [r0] + lsls r0, r5, 16 + subs r0, r5 + movs r1, 0x64 + bl __divsi3 + cmp r4, r0 + bge _0803D0B8 + movs r1, 0x1 + negs r1, r1 + mov r8, r1 +_0803D0B8: + ldr r1, =0x02024084 + movs r0, 0x58 + mov r2, r10 + muls r2, r0 + adds r0, r2, 0 + adds r4, r0, r1 + ldrh r0, [r4, 0x6] + adds r3, r0, 0 + muls r3, r7 + ldr r2, =gUnknown_08329D2E + movs r1, 0x1B + ldrsb r1, [r4, r1] + lsls r1, 1 + adds r0, r1, r2 + ldrb r0, [r0] + muls r0, r3 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + bl __divsi3 + adds r7, r0, 0 + ldrh r0, [r4, 0x2E] + cmp r0, 0xAF + bne _0803D118 + ldr r1, =0x02024404 + mov r3, r10 + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r6, [r0, 0x7] + ldrb r5, [r0, 0x1A] + b _0803D12C + .pool +_0803D118: + ldrh r0, [r4, 0x2E] + bl itemid_get_x12 + lsls r0, 24 + lsrs r6, r0, 24 + ldrh r0, [r4, 0x2E] + bl itemid_get_quality + lsls r0, 24 + lsrs r5, r0, 24 +_0803D12C: + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x023f0102 + ands r0, r1 + cmp r0, 0 + bne _0803D15C + ldr r0, =0x00000869 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0803D15C + mov r0, r10 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0803D15C + movs r0, 0x6E + muls r0, r7 + movs r1, 0x64 + bl __udivsi3 + adds r7, r0, 0 +_0803D15C: + cmp r6, 0x18 + bne _0803D162 + lsrs r7, 1 +_0803D162: + ldr r2, =0x02024084 + movs r0, 0x58 + mov r1, r10 + muls r1, r0 + adds r0, r1, 0 + adds r1, r2, 0 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0803D17E + lsrs r7, 2 +_0803D17E: + cmp r6, 0x1A + bne _0803D198 + ldr r0, =0x02024330 + ldrh r4, [r0] + lsls r0, r5, 16 + subs r0, r5 + movs r1, 0x64 + bl __divsi3 + cmp r4, r0 + bge _0803D198 + movs r7, 0x1 + negs r7, r7 +_0803D198: + ldr r2, [sp, 0x4] + cmp r2, 0 + beq _0803D1B8 + movs r3, 0 + b _0803D254 + .pool +_0803D1B8: + ldr r0, =0x0202421c + mov r3, r9 + adds r1, r3, r0 + ldrb r1, [r1] + adds r2, r0, 0 + cmp r1, 0 + bne _0803D208 + ldr r0, =0x0202433c + lsls r1, r3, 4 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 29 + cmp r0, 0 + bge _0803D1E0 + movs r3, 0xA5 + b _0803D20A + .pool +_0803D1E0: + ldr r0, =0x0202449c + ldr r0, [r0] + add r0, r9 + adds r0, 0x80 + ldrb r0, [r0] + lsls r0, 1 + movs r1, 0x58 + mov r3, r9 + muls r3, r1 + adds r1, r3, 0 + adds r0, r1 + ldr r1, =0x02024084 + adds r1, 0xC + adds r0, r1 + ldrh r3, [r0] + b _0803D20A + .pool +_0803D208: + movs r3, 0 +_0803D20A: + mov r1, r10 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _0803D254 + ldr r0, =0x0202433c + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 29 + cmp r0, 0 + bge _0803D22C + movs r2, 0xA5 + b _0803D256 + .pool +_0803D22C: + ldr r0, =0x0202449c + ldr r0, [r0] + add r0, r10 + adds r0, 0x80 + ldrb r0, [r0] + lsls r0, 1 + movs r1, 0x58 + mov r2, r10 + muls r2, r1 + adds r1, r2, 0 + adds r0, r1 + ldr r1, =0x02024084 + adds r1, 0xC + adds r0, r1 + ldrh r2, [r0] + b _0803D256 + .pool +_0803D254: + movs r2, 0 +_0803D256: + ldr r4, =gBattleMoves + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r0, r4 + movs r1, 0x7 + ldrsb r1, [r0, r1] + lsls r3, r2, 1 + cmp r1, 0 + bne _0803D27A + adds r0, r3, r2 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x7] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + beq _0803D2B8 +_0803D27A: + adds r0, r3, r2 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x7] + lsls r0, 24 + asrs r0, 24 + cmp r1, r0 + bne _0803D2AE + cmp r8, r7 + bne _0803D2A4 + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0803D2A4 + movs r3, 0x2 + b _0803D2D4 + .pool +_0803D2A4: + cmp r8, r7 + bcs _0803D2D6 + movs r0, 0x1 + str r0, [sp, 0x8] + b _0803D2D6 +_0803D2AE: + cmp r1, r0 + bge _0803D2D6 + movs r1, 0x1 + str r1, [sp, 0x8] + b _0803D2D6 +_0803D2B8: + cmp r8, r7 + bne _0803D2CE + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0803D2CE + movs r2, 0x2 + str r2, [sp, 0x8] + b _0803D2D6 +_0803D2CE: + cmp r8, r7 + bcs _0803D2D6 + movs r3, 0x1 +_0803D2D4: + str r3, [sp, 0x8] +_0803D2D6: + 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 + thumb_func_end b_first_side + + thumb_func_start sub_803D2E8 +sub_803D2E8: @ 803D2E8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r3, 0 + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0803D354 + ldr r0, =0x02024064 + strb r3, [r0] + ldr r4, =0x0202406c + mov r8, r0 + ldrb r0, [r4] + cmp r3, r0 + bcc _0803D310 + b _0803D54A +_0803D310: + ldr r7, =0x0202407a + ldr r6, =0x0202421c + mov r2, r8 + ldr r5, =0x0202407e +_0803D318: + adds r1, r3, r7 + ldrb r0, [r2] + adds r0, r6 + ldrb r0, [r0] + strb r0, [r1] + adds r1, r3, r5 + ldrb r0, [r2] + strb r0, [r1] + adds r3, 0x1 + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r4] + cmp r0, r1 + bcc _0803D318 + b _0803D54A + .pool +_0803D354: + movs r2, 0x2 + ands r1, r2 + cmp r1, 0 + beq _0803D3A4 + ldr r0, =0x02024064 + strb r3, [r0] + ldr r1, =0x0202406c + mov r8, r0 + adds r2, r1, 0 + ldrb r2, [r2] + cmp r3, r2 + bcs _0803D3C0 + ldr r0, =0x0202421c + ldrb r1, [r0] + adds r4, r0, 0 + cmp r1, 0x3 + beq _0803D3BE +_0803D376: + mov r7, r8 + ldrb r0, [r7] + adds r0, 0x1 + strb r0, [r7] + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0202406c + ldrb r1, [r1] + cmp r0, r1 + bcs _0803D3C0 + ldrb r0, [r7] + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0x3 + bne _0803D376 + b _0803D3BE + .pool +_0803D3A4: + ldr r1, =0x0202421c + ldrb r0, [r1] + ldr r4, =0x02024064 + mov r8, r4 + cmp r0, 0x3 + bne _0803D3B4 + strb r3, [r4] + movs r3, 0x5 +_0803D3B4: + ldrb r0, [r1, 0x2] + cmp r0, 0x3 + bne _0803D3C0 + mov r7, r8 + strb r2, [r7] +_0803D3BE: + movs r3, 0x5 +_0803D3C0: + cmp r3, 0x5 + bne _0803D448 + ldr r6, =0x0202407a + ldr r1, =0x0202421c + mov r2, r8 + ldrb r0, [r2] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r6] + ldr r2, =0x0202407e + mov r3, r8 + ldrb r0, [r3] + strb r0, [r2] + movs r3, 0x1 + movs r5, 0 + adds r4, r1, 0 + ldr r7, =0x03005d04 + mov r10, r7 + ldr r0, =bc_80154A0 + mov r12, r0 + ldr r1, =0x0202449c + mov r9, r1 + ldr r7, =0x0202406c + ldrb r7, [r7] + cmp r5, r7 + bge _0803D41A + adds r7, r6, 0 + adds r6, r4, 0 + adds r4, r2, 0 + ldr r2, =0x0202406c +_0803D3FC: + mov r0, r8 + ldrb r0, [r0] + cmp r5, r0 + beq _0803D412 + adds r1, r3, r7 + adds r0, r5, r6 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r3, r4 + strb r5, [r0] + adds r3, 0x1 +_0803D412: + adds r5, 0x1 + ldrb r1, [r2] + cmp r5, r1 + blt _0803D3FC +_0803D41A: + mov r2, r12 + mov r3, r10 + str r2, [r3] + mov r4, r9 + ldr r0, [r4] + b _0803D554 + .pool +_0803D448: + movs r0, 0 + mov r7, r8 + strb r0, [r7] + ldr r1, =0x0202406c + ldrb r0, [r1] + cmp r0, 0 + beq _0803D48E + ldr r6, =0x0202421c + mov r2, r8 + ldr r5, =0x0202407a + ldr r4, =0x0202407e +_0803D45E: + ldrb r0, [r2] + adds r0, r6 + ldrb r1, [r0] + subs r0, r1, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0803D47C + adds r0, r3, r5 + strb r1, [r0] + adds r1, r3, r4 + mov r7, r8 + ldrb r0, [r7] + strb r0, [r1] + adds r3, 0x1 +_0803D47C: + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0202406c + ldrb r1, [r1] + cmp r0, r1 + bcc _0803D45E +_0803D48E: + movs r0, 0 + mov r2, r8 + strb r0, [r2] + ldr r4, =0x0202406c + ldrb r0, [r4] + cmp r0, 0 + beq _0803D4D2 + ldr r6, =0x0202421c + ldr r5, =0x0202407a + ldr r4, =0x0202407e +_0803D4A2: + ldrb r0, [r2] + adds r0, r6 + ldrb r1, [r0] + subs r0, r1, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _0803D4C0 + adds r0, r3, r5 + strb r1, [r0] + adds r1, r3, r4 + mov r7, r8 + ldrb r0, [r7] + strb r0, [r1] + adds r3, 0x1 +_0803D4C0: + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0202406c + ldrb r1, [r1] + cmp r0, r1 + bcc _0803D4A2 +_0803D4D2: + movs r5, 0 + b _0803D540 + .pool +_0803D4E8: + adds r4, r5, 0x1 + adds r7, r4, 0 + ldrb r1, [r1] + cmp r7, r1 + bge _0803D53E + ldr r6, =0x0202407a + lsls r2, r5, 24 + mov r8, r2 +_0803D4F8: + ldr r0, =0x0202407e + adds r1, r5, r0 + ldrb r3, [r1] + adds r0, r4, r0 + ldrb r1, [r0] + adds r0, r5, r6 + ldrb r2, [r0] + cmp r2, 0x1 + beq _0803D534 + adds r0, r4, r6 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0803D534 + cmp r2, 0x2 + beq _0803D534 + cmp r0, 0x2 + beq _0803D534 + adds r0, r3, 0 + movs r2, 0 + bl b_first_side + lsls r0, 24 + cmp r0, 0 + beq _0803D534 + lsls r1, r4, 24 + lsrs r1, 24 + mov r3, r8 + lsrs r0, r3, 24 + bl sub_803CEDC +_0803D534: + adds r4, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _0803D4F8 +_0803D53E: + adds r5, r7, 0 +_0803D540: + ldr r1, =0x0202406c + ldrb r0, [r1] + subs r0, 0x1 + cmp r5, r0 + blt _0803D4E8 +_0803D54A: + ldr r1, =0x03005d04 + ldr r0, =bc_80154A0 + str r0, [r1] + ldr r0, =0x0202449c + ldr r0, [r0] +_0803D554: + adds r0, 0x48 + movs r1, 0 + strb r1, [r0] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803D2E8 + + thumb_func_start sub_803D580 +sub_803D580: @ 803D580 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r1, =0x02024064 + movs r0, 0 + strb r0, [r1] + ldr r0, =0x0202406c + ldrb r2, [r0] + adds r5, r1, 0 + cmp r2, 0 + beq _0803D678 + ldr r7, =0x0202433c + adds r6, r5, 0 + ldr r0, =0x020240d4 + mov r12, r0 + ldr r1, =0x020242bc + mov r8, r1 + mov r10, r8 +_0803D5AE: + mov r2, r9 + cmp r2, 0 + beq _0803D5EC + ldrb r1, [r6] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldrb r1, [r6] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + b _0803D648 + .pool +_0803D5EC: + ldrb r0, [r6] + lsls r0, 4 + adds r2, r0, r7 + movs r1, 0 + mov r4, r10 + movs r3, 0 +_0803D5F8: + adds r0, r2, r1 + strb r3, [r0] + adds r1, 0x1 + cmp r1, 0xF + bls _0803D5F8 + ldrb r1, [r5] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r1, r0, r4 + ldrb r0, [r1, 0x16] + cmp r0, 0 + beq _0803D616 + subs r0, 0x1 + strb r0, [r1, 0x16] +_0803D616: + ldrb r1, [r5] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r1, r0, r4 + ldrb r0, [r1, 0x19] + cmp r0, 0 + beq _0803D648 + subs r0, 0x1 + strb r0, [r1, 0x19] + ldrb r2, [r5] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x19] + cmp r0, 0 + bne _0803D648 + movs r0, 0x58 + muls r2, r0 + add r2, r12 + ldr r0, [r2] + ldr r1, =0xffbfffff + ands r0, r1 + str r0, [r2] +_0803D648: + ldrb r2, [r5] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + add r0, r8 + ldrb r0, [r0, 0xA] + cmp r0, 0 + bne _0803D666 + movs r0, 0x58 + muls r2, r0 + add r2, r12 + ldr r0, [r2] + ldr r1, =0xfeffffff + ands r0, r1 + str r0, [r2] +_0803D666: + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0202406c + ldrb r1, [r1] + cmp r0, r1 + bcc _0803D5AE +_0803D678: + movs r0, 0 + ldr r2, =0x02024294 + strb r0, [r2, 0x8] + strb r0, [r2, 0x14] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803D580 + + thumb_func_start sub_803D6A0 +sub_803D6A0: @ 803D6A0 + push {r4-r6,lr} + ldr r2, =0x02024064 + movs r0, 0 + strb r0, [r2] + ldr r0, =0x0202406c + ldrb r1, [r0] + adds r6, r0, 0 + cmp r1, 0 + beq _0803D6DE + adds r3, r2, 0 + movs r4, 0 + ldr r5, =0x0202437c +_0803D6B8: + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, r0, r5 + movs r1, 0 +_0803D6C4: + adds r0, r2, r1 + strb r4, [r0] + adds r1, 0x1 + cmp r1, 0x13 + bls _0803D6C4 + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r6] + cmp r0, r1 + bcc _0803D6B8 +_0803D6DE: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803D6A0 + + thumb_func_start bc_80154A0 +bc_80154A0: @ 803D6F0 + push {r4-r7,lr} + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + bne _0803D7AE + ldr r2, =0x0202449c + ldr r0, [r2] + adds r0, 0x48 + ldr r1, =0x0202406c + ldrb r0, [r0] + mov r12, r2 + adds r6, r1, 0 + ldrb r1, [r6] + cmp r0, r1 + bcs _0803D7AE + ldr r5, =0x02024064 + ldr r4, =0x0202420b + movs r7, 0x84 + lsls r7, 1 +_0803D71C: + ldr r1, [r2] + adds r1, 0x48 + ldrb r0, [r1] + strb r0, [r4] + strb r0, [r5] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r1, =0x02024274 + ldrb r3, [r5] + lsls r0, r3, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r7 + bne _0803D7A0 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r3 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + bne _0803D7A0 + ldr r2, =0x020242bc + ldrb r1, [r4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x18] + lsls r0, 31 + cmp r0, 0 + bne _0803D7A0 + ldr r0, =0x0202433c + lsls r1, r3, 4 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 29 + cmp r0, 0 + blt _0803D7A0 + ldr r0, =gUnknown_082DB1FF + bl b_call_bc_move_exec + b _0803D7E8 + .pool +_0803D7A0: + mov r2, r12 + ldr r0, [r2] + adds r0, 0x48 + ldrb r0, [r0] + ldrb r1, [r6] + cmp r0, r1 + bcc _0803D71C +_0803D7AE: + bl b_clear_atk_up_if_hit_flag_unless_enraged + ldr r1, =0x02024082 + movs r0, 0 + strb r0, [r1] + ldr r1, =0x02024083 + ldr r0, =0x0202407a + movs r3, 0 + ldrb r0, [r0] + strb r0, [r1] + ldr r0, =0x02024400 + movs r2, 0 + strh r3, [r0] + ldr r0, =0x0202449c + ldr r0, [r0] + strb r2, [r0, 0x13] + ldr r1, =0x03005d04 + ldr r0, =bc_bs_exec + str r0, [r1] + ldr r0, =0x02024332 + strb r2, [r0, 0x3] + strb r2, [r0, 0x4] + ldr r0, =0x02024474 + strb r2, [r0, 0x16] + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r0, [r0, 0x8] + adds r0, 0x20 + strb r2, [r0] +_0803D7E8: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end bc_80154A0 + + thumb_func_start bc_bs_exec +bc_bs_exec: @ 803D818 + push {r4-r6,lr} + ldr r6, =0x0202433a + ldrb r0, [r6] + ldr r2, =0x02024083 + cmp r0, 0 + beq _0803D828 + movs r0, 0xC + strb r0, [r2] +_0803D828: + ldr r5, =0x0202449c + ldr r0, [r5] + adds r0, 0x4B + ldr r4, =0x02024082 + ldrb r1, [r4] + strb r1, [r0] + ldr r1, =gUnknown_0831BC0C + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, =0x0202406c + ldrb r1, [r4] + ldrb r0, [r0] + cmp r1, r0 + bcc _0803D894 + ldr r2, =0x02024280 + ldr r0, [r2] + ldr r1, =0xffefffff + ands r0, r1 + str r0, [r2] + ldr r3, =0x03005d04 + ldr r2, =gUnknown_0831BC44 + ldrb r1, [r6] + movs r0, 0x7F + ands r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + str r0, [r3] + b _0803D8AC + .pool +_0803D894: + ldr r0, [r5] + adds r0, 0x4B + ldrb r0, [r0] + cmp r0, r1 + beq _0803D8AC + ldr r2, =0x02024280 + ldr r0, [r2] + ldr r1, =0xfffffdff + ands r0, r1 + ldr r1, =0xfff7ffff + ands r0, r1 + str r0, [r2] +_0803D8AC: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end bc_bs_exec + + thumb_func_start sub_803D8C0 +sub_803D8C0: @ 803D8C0 + push {r4,lr} + ldr r1, =0x02024083 + movs r0, 0 + strb r0, [r1] + ldr r1, =0x02022fec + ldr r2, [r1] + ldr r0, =0x02000002 + ands r0, r2 + cmp r0, 0 + beq _0803D920 + ldr r1, =0x020375f0 + ldr r4, =0x0202433a + ldrb r0, [r4] + strh r0, [r1] + ldr r1, =0x02022f58 + ldrb r0, [r4] + strb r0, [r1] + movs r0, 0 + bl battle_get_side_with_given_state + ldr r1, =0x0202420b + strb r0, [r1] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAA35 + str r0, [r1] + ldrb r1, [r4] + movs r0, 0x7F + ands r0, r1 + strb r0, [r4] + b _0803DAA4 + .pool +_0803D920: + movs r0, 0x8 + ands r0, r2 + cmp r0, 0 + beq _0803D95C + ldr r0, =0x043f0900 + ands r2, r0 + cmp r2, 0 + beq _0803D95C + bl sub_805EA60 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAA87 + str r0, [r1] + ldr r0, =0x02038bca + ldrh r1, [r0] + ldr r0, =0x000003fe + cmp r1, r0 + bne _0803D946 + b _0803DA8A +_0803D946: + b _0803DA94 + .pool +_0803D95C: + ldr r0, [r1] + movs r1, 0xA + ands r0, r1 + cmp r0, 0x8 + beq _0803D968 + b _0803DA9E +_0803D968: + bl sub_805EA60 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DA92D + str r0, [r1] + ldr r2, =gTrainers + ldr r0, =0x02038bca + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x1] + subs r0, 0x3 + cmp r0, 0x32 + bls _0803D98A + b _0803DA94 +_0803D98A: + lsls r0, 2 + ldr r1, =_0803D9A8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0803D9A8: + .4byte _0803DA80 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA80 + .4byte _0803DA94 + .4byte _0803DA80 + .4byte _0803DA94 + .4byte _0803DA80 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA74 + .4byte _0803DA8A + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA74 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA80 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA80 +_0803DA74: + ldr r0, =0x00000163 + bl song_play_for_text + b _0803DAA4 + .pool +_0803DA80: + movs r0, 0xD4 + lsls r0, 1 + bl song_play_for_text + b _0803DAA4 +_0803DA8A: + movs r0, 0xB1 + lsls r0, 1 + bl song_play_for_text + b _0803DAA4 +_0803DA94: + movs r0, 0xCE + lsls r0, 1 + bl song_play_for_text + b _0803DAA4 +_0803DA9E: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DA96A + str r0, [r1] +_0803DAA4: + ldr r1, =0x03005d04 + ldr r0, =sub_803DCD8 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803D8C0 + + thumb_func_start sub_803DAC0 +sub_803DAC0: @ 803DAC0 + push {r4,lr} + ldr r1, =0x02024083 + movs r0, 0 + strb r0, [r1] + ldr r0, =0x02022fec + ldr r1, [r0] + ldr r0, =0x02000002 + ands r0, r1 + cmp r0, 0 + beq _0803DB7C + ldr r0, =0x003f0100 + ands r1, r0 + cmp r1, 0 + beq _0803DB44 + ldr r3, =0x0202433a + ldrb r2, [r3] + movs r0, 0x80 + ands r0, r2 + cmp r0, 0 + beq _0803DB2C + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB9C8 + str r0, [r1] + movs r0, 0x7F + ands r0, r2 + strb r0, [r3] + ldr r0, =0x03005d90 + ldr r1, [r0] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x8 + orrs r0, r2 + strb r0, [r1] + b _0803DB82 + .pool +_0803DB2C: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAA0B + str r0, [r1] + movs r0, 0x7F + ands r0, r2 + strb r0, [r3] + b _0803DB82 + .pool +_0803DB44: + ldr r1, =0x02022f58 + ldr r4, =0x0202433a + ldrb r0, [r4] + strb r0, [r1] + movs r0, 0 + bl battle_get_side_with_given_state + ldr r1, =0x0202420b + strb r0, [r1] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAA35 + str r0, [r1] + ldrb r1, [r4] + movs r0, 0x7F + ands r0, r1 + strb r0, [r4] + b _0803DB82 + .pool +_0803DB7C: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DA96D + str r0, [r1] +_0803DB82: + ldr r1, =0x03005d04 + ldr r0, =sub_803DCD8 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803DAC0 + + thumb_func_start sub_803DBA0 +sub_803DBA0: @ 803DBA0 + push {lr} + ldr r1, =0x02024083 + movs r0, 0 + strb r0, [r1] + ldr r1, =0x02022fec + ldr r2, [r1] + ldr r0, =0x003f0100 + ands r0, r2 + cmp r0, 0 + beq _0803DBFC + movs r0, 0x8 + ands r2, r0 + cmp r2, 0 + beq _0803DBFC + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB9C1 + str r0, [r1] + ldr r1, =0x0202433a + movs r0, 0x9 + strb r0, [r1] + ldr r0, =0x03005d90 + ldr r1, [r0] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x8 + orrs r0, r2 + strb r0, [r1] + b _0803DC6A + .pool +_0803DBFC: + ldr r0, [r1] + movs r1, 0x80 + lsls r1, 19 + ands r0, r1 + cmp r0, 0 + beq _0803DC24 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB9C1 + str r0, [r1] + ldr r1, =0x0202433a + movs r0, 0x9 + strb r0, [r1] + b _0803DC6A + .pool +_0803DC24: + ldr r1, =0x0202433c + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x1] + lsls r0, 27 + lsrs r0, 30 + cmp r0, 0x1 + beq _0803DC54 + cmp r0, 0x2 + beq _0803DC64 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAAF0 + b _0803DC68 + .pool +_0803DC54: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAADB + b _0803DC68 + .pool +_0803DC64: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAAE9 +_0803DC68: + str r0, [r1] +_0803DC6A: + ldr r1, =0x03005d04 + ldr r0, =sub_803DCD8 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_803DBA0 + + thumb_func_start bc_80158BC +bc_80158BC: @ 803DC84 + ldr r1, =0x02024083 + movs r0, 0 + strb r0, [r1] + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x7 + strb r0, [r1, 0x1] + ldr r2, =0x0202420b + ldrb r0, [r2] + strb r0, [r1, 0x2] + ldr r3, =0x0202406e + ldrb r0, [r2] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAAF7 + str r0, [r1] + ldr r1, =0x03005d04 + ldr r0, =sub_803DCD8 + str r0, [r1] + bx lr + .pool + thumb_func_end bc_80158BC + + thumb_func_start sub_803DCD8 +sub_803DCD8: @ 803DCD8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =0x02024083 + ldrb r0, [r0] + subs r0, 0xB + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _0803DCEE + b _0803DE10 +_0803DCEE: + ldr r0, =0x02022fec + ldr r1, [r0] + ldr r0, =0x023f0b92 + ands r1, r0 + cmp r1, 0 + bne _0803DDB6 + ldr r2, =0x02024064 + strb r1, [r2] + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r1, r0 + bcs _0803DDB2 + adds r5, r2, 0 + ldr r0, =0x0202406e + mov r8, r0 + movs r7, 0x64 + ldr r6, =0x020244ec +_0803DD10: + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0803DDA0 + ldr r4, =0x03005d10 + ldrh r0, [r4, 0x6] + cmp r0, 0 + bne _0803DD74 + ldrb r0, [r5] + lsls r0, 1 + add r0, r8 + ldrh r0, [r0] + muls r0, r7 + adds r0, r6 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r4, 0x6] + ldrb r0, [r5] + lsls r0, 1 + add r0, r8 + ldrh r0, [r0] + muls r0, r7 + adds r0, r6 + movs r1, 0x2 + adds r2, r4, 0 + adds r2, 0x8 + bl pokemon_getattr + b _0803DDA0 + .pool +_0803DD74: + ldrb r0, [r5] + lsls r0, 1 + add r0, r8 + ldrh r0, [r0] + muls r0, r7 + adds r0, r6 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r4, 0x26] + ldrb r0, [r5] + lsls r0, 1 + add r0, r8 + ldrh r0, [r0] + muls r0, r7 + adds r0, r6 + movs r1, 0x2 + adds r2, r4, 0 + adds r2, 0x14 + bl pokemon_getattr +_0803DDA0: + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803DD10 +_0803DDB2: + bl sub_80EC728 +_0803DDB6: + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x023f0b9a + ands r0, r1 + cmp r0, 0 + bne _0803DDD2 + ldr r0, =0x03005d10 + ldrb r1, [r0, 0x5] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0803DDD2 + bl sub_80EE184 +_0803DDD2: + bl sub_8186444 + movs r0, 0x3 + bl sub_80A2390 + movs r0, 0x5 + bl sub_80A2F50 + ldr r1, =0x03005d04 + ldr r0, =sub_803DE40 + str r0, [r1] + ldr r1, =0x030061e8 + ldr r0, =sub_8038420 + str r0, [r1] + b _0803DE2A + .pool +_0803DE10: + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0803DE2A + ldr r1, =gUnknown_0831BD10 + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 +_0803DE2A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803DCD8 + + thumb_func_start sub_803DE40 +sub_803DE40: @ 803DE40 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0803DE86 + bl ResetAllObjectData + ldr r0, =0x03005d54 + ldrb r0, [r0] + cmp r0, 0 + beq _0803DE62 + ldr r0, =0x0202433a + ldrb r0, [r0] + cmp r0, 0x1 + beq _0803DE80 +_0803DE62: + ldr r1, =0x03005d04 + ldr r0, =c4_overworld + str r0, [r1] + b _0803DEA2 + .pool +_0803DE80: + ldr r1, =0x03005d04 + ldr r0, =bc_evolution_cutscene + str r0, [r1] +_0803DE86: + bl FreeAllWindowBuffers + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0803DEA2 + bl sub_805F094 + bl sub_8057028 + bl dp11_free +_0803DEA2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_803DE40 + + thumb_func_start bc_evolution_cutscene +bc_evolution_cutscene: @ 803DEB4 + push {r4-r6,lr} + ldr r0, =0x03005d54 + ldrb r1, [r0] + adds r3, r0, 0 + cmp r1, 0 + beq _0803DF2E +_0803DEC0: + movs r6, 0 +_0803DEC2: + ldrb r2, [r3] + ldr r0, =gUnknown_0832A328 + lsls r1, r6, 2 + adds r1, r0 + ldr r1, [r1] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _0803DF20 + bics r2, r1 + strb r2, [r3] + movs r0, 0x64 + adds r1, r6, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0 + bl GetEvolutionTargetSpecies + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _0803DF20 + bl FreeAllWindowBuffers + ldr r0, =0x03005d04 + ldr r1, =sub_803DF48 + str r1, [r0] + lsls r3, r6, 24 + lsrs r3, 24 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl evolution_cutscene + b _0803DF34 + .pool +_0803DF20: + adds r6, 0x1 + ldr r3, =0x03005d54 + cmp r6, 0x5 + ble _0803DEC2 + ldrb r0, [r3] + cmp r0, 0 + bne _0803DEC0 +_0803DF2E: + ldr r1, =0x03005d04 + ldr r0, =c4_overworld + str r0, [r1] +_0803DF34: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end bc_evolution_cutscene + + thumb_func_start sub_803DF48 +sub_803DF48: @ 803DF48 + push {lr} + ldr r0, =0x030022c0 + ldr r1, [r0, 0x4] + ldr r0, =sub_8038420 + cmp r1, r0 + bne _0803DF5A + ldr r1, =0x03005d04 + ldr r0, =bc_evolution_cutscene + str r0, [r1] +_0803DF5A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_803DF48 + + thumb_func_start c4_overworld +c4_overworld: @ 803DF70 + push {r4-r6,lr} + ldr r6, =0x02022fec + ldr r0, [r6] + movs r5, 0x2 + ands r0, r5 + cmp r0, 0 + bne _0803DF8C + ldr r4, =0x020244ec + adds r0, r4, 0 + bl sub_806DCB4 + adds r0, r4, 0 + bl sub_806DEC4 +_0803DF8C: + ldr r4, [r6] + adds r0, r4, 0 + ands r0, r5 + cmp r0, 0 + beq _0803DF9E + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _0803DFEC +_0803DF9E: + ldr r1, =0x020375f0 + ldr r5, =0x0202433a + ldrb r0, [r5] + strh r0, [r1] + ldr r3, =0x030022c0 + ldr r0, =0x00000439 + adds r2, r3, r0 + ldrb r1, [r2] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, =0x03005d00 + ldr r0, [r0] + str r0, [r3] + movs r0, 0x80 + lsls r0, 3 + ands r4, r0 + cmp r4, 0 + beq _0803DFDE + ldr r0, =0x02024744 + bl sub_8161F18 + ldrb r1, [r5] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0803DFDA + cmp r1, 0x7 + bne _0803DFDE +_0803DFDA: + bl sub_8161F4C +_0803DFDE: + movs r0, 0x5A + bl m4aSongNumStop + ldr r0, =0x030022c0 + ldr r0, [r0, 0x8] + bl SetMainCallback2 +_0803DFEC: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end c4_overworld + + thumb_func_start bc_move_exec_returning +bc_move_exec_returning: @ 803E018 + push {lr} + ldr r0, =0x02024083 + ldrb r0, [r0] + subs r0, 0xB + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0803E060 + ldr r3, =0x020244a8 + ldr r0, [r3] + ldr r0, [r0, 0xC] + adds r1, r0, 0 + adds r1, 0x20 + ldrb r0, [r1] + cmp r0, 0 + beq _0803E03C + subs r0, 0x1 + strb r0, [r1] +_0803E03C: + ldr r2, =0x03005d04 + ldr r0, [r3] + ldr r1, [r0, 0xC] + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + lsls r0, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r2] + b _0803E07A + .pool +_0803E060: + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0803E07A + ldr r1, =gUnknown_0831BD10 + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 +_0803E07A: + pop {r0} + bx r0 + .pool + thumb_func_end bc_move_exec_returning + + thumb_func_start sub_803E08C +sub_803E08C: @ 803E08C + push {lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0803E0A8 + ldr r1, =gUnknown_0831BD10 + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 +_0803E0A8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_803E08C + + thumb_func_start sub_803E0B8 +sub_803E0B8: @ 803E0B8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r0, 0x4 + str r0, [sp] + ldr r6, =0x0202420b + ldr r1, =0x0202407e + ldr r0, =0x02024082 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r6] + ldr r1, =0x0202449c + ldr r3, [r1] + adds r0, r3, 0 + adds r0, 0x91 + ldrb r2, [r0] + ldr r1, =gUnknown_0832A328 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ands r2, r0 + cmp r2, 0 + beq _0803E110 + ldr r1, =0x02024083 + movs r0, 0xC + b _0803E83C + .pool +_0803E110: + ldr r1, =0x02024211 + movs r0, 0x1 + strb r0, [r1] + ldr r1, =0x02024474 + movs r0, 0x1 + strb r0, [r1, 0xE] + ldr r5, =0x000001a3 + adds r0, r3, r5 + strb r2, [r0] + ldr r0, =0x0202427c + strb r2, [r0] + ldr r0, =0x02024212 + strb r2, [r0] + ldr r0, =0x02024332 + strb r2, [r0, 0x6] + ldr r2, =0x020241e8 + ldr r0, =0x020241e9 + mov r9, r0 + ldrb r0, [r6] + ldr r3, =0x0202449c + ldr r1, [r3] + adds r0, r1 + adds r0, 0x80 + ldrb r0, [r0] + mov r5, r9 + strb r0, [r5] + strb r0, [r2] + ldr r1, =0x0202433c + ldrb r4, [r6] + lsls r0, r4, 4 + adds r3, r0, r1 + ldrb r1, [r3] + lsls r0, r1, 29 + mov r8, r2 + cmp r0, 0 + bge _0803E1BC + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] + ldr r2, =0x020241ea + ldr r1, =0x020241ec + movs r0, 0xA5 + strh r0, [r1] + strh r0, [r2] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 4 + orrs r0, r1 + str r0, [r2] + movs r0, 0xA5 + movs r1, 0 + bl sub_80458E0 + ldrb r1, [r6] + ldr r3, =0x0202449c + ldr r2, [r3] + b _0803E316 + .pool +_0803E1BC: + ldr r5, =0x02024084 + mov r10, r5 + movs r0, 0x58 + adds r5, r4, 0 + muls r5, r0 + mov r0, r10 + adds r0, 0x50 + adds r0, r5, r0 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 5 + ands r0, r1 + cmp r0, 0 + bne _0803E1E2 + movs r7, 0x80 + lsls r7, 15 + ands r7, r1 + cmp r7, 0 + beq _0803E204 +_0803E1E2: + ldr r3, =0x020241ea + ldr r2, =0x020241ec + ldr r1, =0x02024268 + lsls r0, r4, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] + strh r0, [r3] + b _0803E33C + .pool +_0803E204: + ldr r1, =0x020242bc + mov r12, r1 + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + add r0, r12 + ldrh r3, [r0, 0x6] + adds r1, r3, 0 + cmp r1, 0 + beq _0803E2DC + ldrb r2, [r0, 0xC] + lsls r0, r2, 1 + adds r0, r5 + mov r4, r10 + adds r4, 0xC + adds r0, r4 + ldrh r0, [r0] + cmp r1, r0 + bne _0803E268 + ldr r2, =0x020241ea + ldr r0, =0x020241ec + strh r3, [r0] + strh r3, [r2] + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + ldrb r0, [r0, 0xC] + mov r3, r9 + strb r0, [r3] + mov r5, r8 + strb r0, [r5] + ldrh r0, [r2] + movs r1, 0 + bl sub_80458E0 + ldrb r1, [r6] + ldr r3, =0x0202449c + ldr r2, [r3] + b _0803E316 + .pool +_0803E268: + cmp r1, 0 + beq _0803E2DC + cmp r1, r0 + beq _0803E2DC + mov r5, r9 + strb r2, [r5] + mov r0, r8 + strb r2, [r0] + ldr r3, =0x020241ea + ldr r2, =0x020241ec + ldrb r0, [r0] + lsls r0, 1 + ldrb r1, [r6] + movs r5, 0x58 + muls r1, r5 + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + strh r0, [r2] + strh r0, [r3] + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + movs r2, 0 + strh r7, [r0, 0x6] + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + strb r2, [r0, 0xC] + ldrb r0, [r6] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + add r1, r12 + ldrb r2, [r1, 0xE] + movs r0, 0x10 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0xE] + ldrh r0, [r3] + movs r1, 0 + bl sub_80458E0 + ldrb r1, [r6] + ldr r3, =0x0202449c + ldr r2, [r3] + b _0803E316 + .pool +_0803E2DC: + ldr r3, =0x02024084 + mov r5, r8 + ldrb r0, [r5] + lsls r0, 1 + ldr r4, =0x0202420b + ldrb r2, [r4] + movs r1, 0x58 + muls r1, r2 + adds r0, r1 + adds r3, 0xC + adds r0, r3 + ldr r1, =0x02024274 + lsls r2, 1 + adds r2, r1 + ldrh r3, [r0] + ldrh r2, [r2] + cmp r3, r2 + beq _0803E334 + ldr r1, =0x020241ea + ldr r0, =0x020241ec + strh r3, [r0] + strh r3, [r1] + ldrh r0, [r1] + movs r1, 0 + bl sub_80458E0 + ldrb r1, [r4] + ldr r2, =0x0202449c + ldr r2, [r2] +_0803E316: + adds r1, r2 + strb r0, [r1, 0xC] + b _0803E33C + .pool +_0803E334: + ldr r1, =0x020241ea + ldr r0, =0x020241ec + strh r3, [r0] + strh r3, [r1] +_0803E33C: + ldr r2, =0x02024084 + ldr r1, =0x0202420b + ldrb r3, [r1] + movs r0, 0x58 + muls r0, r3 + adds r0, r2 + ldrh r0, [r0, 0x28] + mov r8, r1 + cmp r0, 0 + beq _0803E384 + adds r0, r3, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0803E37C + ldr r0, =0x03005d10 + ldr r1, =0x020241ea + ldrh r1, [r1] + strh r1, [r0, 0x22] + b _0803E384 + .pool +_0803E37C: + ldr r0, =0x03005d10 + ldr r1, =0x020241ea + ldrh r1, [r1] + strh r1, [r0, 0x24] +_0803E384: + mov r1, r8 + ldrb r0, [r1] + bl battle_side_get_owner + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =0x02024294 + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 2 + adds r5, r0, r1 + ldrb r0, [r5, 0x8] + cmp r0, 0 + beq _0803E400 + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x6] + cmp r0, 0 + bne _0803E400 + mov r3, r8 + ldrb r0, [r3] + bl battle_side_get_owner + adds r4, r0, 0 + ldrb r0, [r5, 0x9] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _0803E400 + ldr r1, =0x02024084 + ldrb r2, [r5, 0x9] + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _0803E400 + ldr r0, =0x0202420c + strb r2, [r0] + b _0803E76A + .pool +_0803E400: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + ldr r5, =0x0202420b + mov r8, r5 + cmp r0, 0 + bne _0803E412 + b _0803E6E0 +_0803E412: + ldr r1, =0x02024294 + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 2 + adds r0, r1 + ldrb r5, [r0, 0x8] + cmp r5, 0 + beq _0803E424 + b _0803E630 +_0803E424: + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r4, r0, r2 + ldrb r0, [r4, 0x1] + cmp r0, 0 + bne _0803E440 + ldrb r0, [r4, 0x6] + cmp r0, 0x10 + bne _0803E440 + b _0803E630 +_0803E440: + ldr r3, =0x02024084 + ldr r2, =0x0202420b + ldrb r6, [r2] + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, r6, r0 + ldrb r1, [r0, 0xC] + movs r0, 0x58 + muls r0, r1 + adds r0, r3 + adds r0, 0x20 + ldrb r0, [r0] + mov r8, r2 + cmp r0, 0x1F + bne _0803E460 + b _0803E630 +_0803E460: + ldrb r0, [r4, 0x2] + cmp r0, 0xD + beq _0803E468 + b _0803E630 +_0803E468: + adds r0, r6, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =0x02024064 + strb r5, [r1] + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r5, r0 + bcs _0803E4E0 + adds r4, r1, 0 +_0803E480: + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + beq _0803E4CE + ldr r0, =0x0202420b + ldrb r1, [r0] + ldr r0, =0x0202449c + ldr r0, [r0] + adds r1, r0 + ldrb r0, [r1, 0xC] + ldrb r1, [r4] + cmp r0, r1 + beq _0803E4CE + ldr r1, =0x02024084 + ldrb r2, [r4] + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x1F + bne _0803E4CE + adds r0, r2, 0 + bl sub_8048728 + lsls r0, 24 + lsrs r0, 24 + ldr r3, [sp] + cmp r0, r3 + bcs _0803E4CE + ldrb r0, [r4] + bl sub_8048728 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] +_0803E4CE: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803E480 +_0803E4E0: + ldr r5, [sp] + cmp r5, 0x4 + beq _0803E4E8 + b _0803E5E2 +_0803E4E8: + ldr r2, =gBattleMoves + ldr r0, =0x020241ec + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x6] + ands r5, r0 + cmp r5, 0 + beq _0803E568 + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0803E548 + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0803E544 + movs r0, 0x1 + b _0803E55A + .pool +_0803E544: + movs r0, 0x3 + b _0803E55A +_0803E548: + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0803E558 + movs r0, 0 + b _0803E55A +_0803E558: + movs r0, 0x2 +_0803E55A: + bl battle_get_side_with_given_state + ldr r1, =0x0202420c + strb r0, [r1] + b _0803E578 + .pool +_0803E568: + ldr r2, =0x0202420c + ldr r0, =0x0202420b + ldrb r0, [r0] + ldr r1, =0x0202449c + ldr r1, [r1] + adds r0, r1 + ldrb r0, [r0, 0xC] + strb r0, [r2] +_0803E578: + ldr r7, =0x02024210 + ldrb r0, [r7] + ldr r1, =gUnknown_0832A328 + mov r8, r1 + ldr r5, =0x0202420c + ldrb r1, [r5] + lsls r1, 2 + add r1, r8 + ldr r1, [r1] + ands r0, r1 + cmp r0, 0 + bne _0803E592 + b _0803E76A +_0803E592: + ldr r6, =0x0202420b + ldrb r0, [r6] + bl battle_side_get_owner + adds r4, r0, 0 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _0803E5C4 + ldrb r0, [r5] + b _0803E758 + .pool +_0803E5C4: + ldrb r0, [r6] + bl battle_get_per_side_status + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + strb r0, [r5] + ldrb r1, [r7] + ldrb r2, [r5] + lsls r0, r2, 2 + add r0, r8 + b _0803E74E +_0803E5E2: + ldr r4, =0x02024064 + ldr r0, =0x0202407e + ldr r3, [sp] + adds r0, r3, r0 + ldrb r0, [r0] + strb r0, [r4] + ldrb r0, [r4] + ldr r2, =0x02024084 + movs r1, 0x58 + muls r1, r0 + adds r1, r2 + adds r1, 0x20 + ldrb r1, [r1] + bl b_history__record_ability_usage_of_player + ldr r2, =0x0202437c + ldrb r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r0] + ldr r1, =0x0202420c + ldrb r0, [r4] + strb r0, [r1] + b _0803E76A + .pool +_0803E630: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r4, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0803E6E0 + ldr r2, =gBattleMoves + ldr r0, =0x020241ec + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x6] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0803E6E0 + mov r5, r8 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0803E684 + bl GenerateRandomNumber + adds r1, r4, 0 + ands r1, r0 + cmp r1, 0 + beq _0803E680 + movs r0, 0x1 + b _0803E696 + .pool +_0803E680: + movs r0, 0x3 + b _0803E696 +_0803E684: + bl GenerateRandomNumber + adds r1, r4, 0 + ands r1, r0 + cmp r1, 0 + beq _0803E694 + movs r0, 0 + b _0803E696 +_0803E694: + movs r0, 0x2 +_0803E696: + bl battle_get_side_with_given_state + ldr r1, =0x0202420c + strb r0, [r1] + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + ldr r5, =0x0202420c + ldrb r0, [r5] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _0803E76A + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_side_get_owner + adds r4, r0, 0 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _0803E76A + ldrb r0, [r5] + b _0803E758 + .pool +_0803E6E0: + ldr r5, =0x0202420c + mov r2, r8 + ldrb r0, [r2] + ldr r1, =0x0202449c + ldr r1, [r1] + adds r0, r1 + ldrb r0, [r0, 0xC] + strb r0, [r5] + ldr r6, =0x02024210 + ldrb r1, [r6] + ldr r7, =gUnknown_0832A328 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r7 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _0803E76A + ldrb r0, [r2] + bl battle_side_get_owner + adds r4, r0, 0 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _0803E730 + ldrb r0, [r5] + b _0803E758 + .pool +_0803E730: + mov r1, r8 + ldrb r0, [r1] + bl battle_get_per_side_status + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + strb r0, [r5] + ldrb r1, [r6] + ldrb r2, [r5] + lsls r0, r2, 2 + adds r0, r7 +_0803E74E: + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _0803E76A + adds r0, r2, 0 +_0803E758: + bl battle_get_per_side_status + movs r1, 0x2 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + strb r0, [r5] +_0803E76A: + ldr r0, =0x02022fec + ldr r1, [r0] + movs r2, 0x80 + lsls r2, 10 + ands r1, r2 + adds r5, r0, 0 + cmp r1, 0 + beq _0803E808 + ldr r0, =0x0202433c + ldr r4, =0x0202420b + ldrb r2, [r4] + lsls r1, r2, 4 + adds r1, r0 + ldrb r0, [r1, 0x2] + lsls r0, 27 + cmp r0, 0 + bge _0803E808 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _0803E7B4 + ldr r1, =0x02024083 + movs r0, 0xC + b _0803E83C + .pool +_0803E7B4: + ldr r3, =0x02024230 + lsls r0, r2, 2 + adds r0, r3 + ldr r0, [r0] + cmp r0, 0 + beq _0803E7EC + ldr r1, =0x02024332 + movs r2, 0 + movs r0, 0x4 + strb r0, [r1, 0x5] + ldr r1, =0x02024214 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + str r0, [r1] + ldrb r0, [r4] + lsls r0, 2 + adds r0, r3 + str r2, [r0] + b _0803E824 + .pool +_0803E7EC: + ldr r1, =0x02024332 + movs r0, 0x4 + strb r0, [r1, 0x5] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB6AD + str r0, [r1] + b _0803E824 + .pool +_0803E808: + ldr r4, =0x02024214 + ldr r3, =gUnknown_082D86A8 + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + str r0, [r4] +_0803E824: + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _0803E838 + ldr r0, =0x0202420b + ldrb r0, [r0] + bl sub_81A56E8 +_0803E838: + ldr r1, =0x02024083 + movs r0, 0xA +_0803E83C: + strb r0, [r1] + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803E0B8 + + thumb_func_start bs2_8016374 +bs2_8016374: @ 803E868 + push {r4,lr} + ldr r3, =0x0202420b + ldr r1, =0x0202407e + ldr r0, =0x02024082 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r3] + ldr r0, =0x02022e14 + movs r2, 0 + strh r2, [r0] + ldr r0, =0x02022e16 + strh r2, [r0] + ldr r1, =0x020244ac + ldrb r0, [r3] + adds r0, r1 + strb r2, [r0] + ldr r1, =0x020244b0 + ldrb r0, [r3] + adds r0, r1 + strb r2, [r0] + ldr r2, =0x02022f58 + movs r0, 0xFD + strb r0, [r2] + movs r0, 0x7 + strb r0, [r2, 0x1] + ldrb r4, [r3] + strb r4, [r2, 0x2] + ldrb r0, [r3] + ldr r1, =0x0202449c + ldr r1, [r1] + adds r0, r1 + adds r0, 0x58 + ldrb r0, [r0] + strb r0, [r2, 0x3] + movs r0, 0xFF + strb r0, [r2, 0x4] + ldr r0, =0x02024474 + strb r4, [r0, 0x17] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAB15 + str r0, [r1] + ldr r1, =0x02024083 + movs r0, 0xA + strb r0, [r1] + ldr r1, =0x03005d10 + ldrb r0, [r1, 0x2] + cmp r0, 0xFE + bhi _0803E8CE + adds r0, 0x1 + strb r0, [r1, 0x2] +_0803E8CE: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end bs2_8016374 + + thumb_func_start sub_803E90C +sub_803E90C: @ 803E90C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, =0x0202420b + ldr r2, =0x0202420c + ldr r1, =0x0202407e + ldr r0, =0x02024082 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + strb r0, [r4] + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldrb r0, [r4] + bl sub_8045868 + ldr r5, =0x02024208 + ldr r2, =0x02023864 + ldrb r1, [r4] + lsls r1, 9 + adds r0, r2, 0x1 + adds r0, r1, r0 + ldrb r3, [r0] + adds r2, 0x2 + adds r1, r2 + ldrb r0, [r1] + lsls r0, 8 + orrs r3, r0 + strh r3, [r5] + cmp r3, 0xC + bhi _0803E998 + ldr r2, =0x02024214 + ldr r1, =gUnknown_082DBD08 + ldrh r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [r2] + ldr r0, =0x02024083 + mov r10, r0 + b _0803EBF6 + .pool +_0803E998: + adds r0, r3, 0 + subs r0, 0x50 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _0803E9C0 + ldr r0, =0x02024214 + ldr r1, =gUnknown_082DBD54 + ldr r1, [r1] + str r1, [r0] + ldr r1, =0x02024083 + mov r10, r1 + b _0803EBF6 + .pool +_0803E9C0: + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0803E9E8 + ldr r0, =0x02024214 + ldr r1, =gUnknown_082DBD3C + ldr r1, [r1] + str r1, [r0] + ldr r2, =0x02024083 + mov r10, r2 + b _0803EBF6 + .pool +_0803E9E8: + ldr r3, =0x02024474 + ldrb r0, [r4] + strb r0, [r3, 0x17] + lsls r0, 24 + lsrs r0, 25 + ldr r2, =0x0202449c + ldr r1, [r2] + adds r0, r1 + adds r0, 0xC4 + ldrb r0, [r0] + subs r0, 0x1 + mov r8, r4 + ldr r1, =0x02024214 + mov r9, r1 + ldr r6, =gUnknown_082DBD3C + mov r12, r3 + adds r7, r2, 0 + ldr r2, =0x02024083 + mov r10, r2 + cmp r0, 0x4 + bls _0803EA14 + b _0803EBDE +_0803EA14: + lsls r0, 2 + ldr r1, =_0803EA38 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0803EA38: + .4byte _0803EBDE + .4byte _0803EBDE + .4byte _0803EA4C + .4byte _0803EAE0 + .4byte _0803EBB0 +_0803EA4C: + ldr r5, =0x02024332 + movs r0, 0 + strb r0, [r5, 0x5] + ldr r2, =0x0202420b + ldrb r0, [r2] + lsrs r0, 1 + ldr r1, [r7] + adds r0, r1 + adds r0, 0xC6 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + mov r8, r2 + cmp r0, 0 + beq _0803EA98 + movs r0, 0x3E + ands r0, r1 + ldr r1, =0x02024214 + mov r9, r1 + ldr r6, =gUnknown_082DBD3C + ldr r2, =0x02024083 + mov r10, r2 + cmp r0, 0 + bne _0803EA7E + b _0803EBDE +_0803EA7E: + movs r0, 0x5 + strb r0, [r5, 0x5] + b _0803EBDE + .pool +_0803EA98: + ldr r0, =0x02024214 + mov r9, r0 + ldr r6, =gUnknown_082DBD3C + ldr r1, =0x02024083 + mov r10, r1 + mov r4, r8 + adds r3, r7, 0 + adds r2, r5, 0 +_0803EAA8: + ldrb r1, [r4] + lsrs r1, 1 + ldr r0, [r3] + adds r1, r0 + adds r1, 0xC6 + ldrb r0, [r1] + lsrs r0, 1 + strb r0, [r1] + ldrb r0, [r2, 0x5] + adds r0, 0x1 + strb r0, [r2, 0x5] + ldrb r0, [r4] + lsrs r0, 1 + ldr r1, [r3] + adds r0, r1 + adds r0, 0xC6 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0803EAA8 + b _0803EBDE + .pool +_0803EAE0: + ldr r3, =0x02024332 + movs r0, 0x4 + strb r0, [r3, 0x5] + ldr r2, =0x0202420b + ldrb r0, [r2] + lsrs r0, 1 + ldr r1, [r7] + adds r0, r1 + adds r6, r0, 0 + adds r6, 0xC6 + ldrb r1, [r6] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + mov r8, r2 + cmp r5, 0 + beq _0803EB28 + movs r0, 0x5 + strb r0, [r3, 0x5] + ldr r2, =0x02024214 + mov r9, r2 + ldr r6, =gUnknown_082DBD3C + ldr r0, =0x02024083 + mov r10, r0 + b _0803EBDE + .pool +_0803EB28: + ldr r3, =0x02022f58 + movs r4, 0xFD + strb r4, [r3] + movs r0, 0x5 + strb r0, [r3, 0x1] + movs r2, 0x1 + strb r2, [r3, 0x2] + movs r0, 0xFF + strb r0, [r3, 0x3] + ldr r1, =0x02022f68 + strb r4, [r1] + strb r5, [r1, 0x1] + movs r0, 0xD2 + strb r0, [r1, 0x2] + strb r5, [r1, 0x3] + subs r0, 0xD3 + strb r0, [r1, 0x4] + ldrb r0, [r6] + ands r2, r0 + ldr r1, =0x02024214 + mov r9, r1 + ldr r6, =gUnknown_082DBD3C + ldr r0, =0x02024083 + mov r10, r0 + cmp r2, 0 + bne _0803EB8C + mov r5, r8 + adds r4, r7, 0 + adds r2, r3, 0 +_0803EB62: + ldrb r1, [r5] + lsrs r1, 1 + ldr r0, [r4] + adds r1, r0 + adds r1, 0xC6 + ldrb r0, [r1] + lsrs r0, 1 + strb r0, [r1] + ldrb r0, [r2, 0x2] + adds r0, 0x1 + strb r0, [r2, 0x2] + ldrb r0, [r5] + lsrs r0, 1 + ldr r1, [r4] + adds r0, r1 + adds r0, 0xC6 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0803EB62 +_0803EB8C: + ldrb r0, [r3, 0x2] + adds r0, 0xE + movs r1, 0 + mov r2, r12 + strb r0, [r2, 0x10] + strb r1, [r2, 0x11] + b _0803EBDE + .pool +_0803EBB0: + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0803EBCC + ldr r1, =0x02024332 + movs r0, 0x2 + strb r0, [r1, 0x5] + b _0803EBD0 + .pool +_0803EBCC: + ldr r0, =0x02024332 + strb r1, [r0, 0x5] +_0803EBD0: + ldr r0, =0x0202420b + mov r8, r0 + ldr r1, =0x02024214 + mov r9, r1 + ldr r6, =gUnknown_082DBD3C + ldr r2, =0x02024083 + mov r10, r2 +_0803EBDE: + mov r1, r8 + ldrb r0, [r1] + lsrs r0, 1 + ldr r1, [r7] + adds r0, r1 + adds r0, 0xC4 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + mov r2, r9 + str r0, [r2] +_0803EBF6: + movs r0, 0xA + mov r1, r10 + strb r0, [r1] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803E90C + + thumb_func_start sub_803EC20 +sub_803EC20: @ 803EC20 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r5, r0, 24 + movs r7, 0 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r5 + adds r1, r0, r1 + ldrh r0, [r1, 0x2E] + cmp r0, 0xAF + bne _0803EC54 + ldr r1, =0x02024404 + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x7] + b _0803EC5E + .pool +_0803EC54: + ldrh r0, [r1, 0x2E] + bl itemid_get_x12 + lsls r0, 24 + lsrs r1, r0, 24 +_0803EC5E: + ldr r0, =0x0202420f + strb r5, [r0] + cmp r1, 0x25 + bne _0803EC9C + ldr r2, =0x02024208 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r5 + adds r0, r1 + ldrh r0, [r0, 0x2E] + strh r0, [r2] + ldr r0, =0x0202433c + lsls r2, r5, 4 + adds r2, r0 + ldrb r1, [r2, 0x1] + movs r0, 0x19 + negs r0, r0 + ands r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r2, 0x1] + b _0803ED70 + .pool +_0803EC9C: + ldr r0, =0x02024084 + mov r10, r0 + movs r2, 0x58 + mov r9, r2 + mov r0, r9 + muls r0, r5 + add r0, r10 + mov r8, r0 + adds r0, 0x20 + ldrb r6, [r0] + cmp r6, 0x32 + bne _0803ED5C + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _0803ED38 + ldr r4, =0x0202449c + ldr r1, [r4] + adds r1, 0x6C + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + bl sub_81A9E28 + lsls r0, 24 + lsrs r1, r0, 24 + mov r2, r8 + ldrh r0, [r2, 0x6] + muls r0, r1 + movs r2, 0x1 + adds r1, r5, 0 + eors r1, r2 + mov r2, r9 + muls r2, r1 + adds r1, r2, 0 + add r1, r10 + ldrh r1, [r1, 0x6] + bl __divsi3 + ldr r1, [r4] + adds r1, 0x6C + ldrb r2, [r1] + lsls r1, r2, 4 + subs r1, r2 + lsls r1, 1 + adds r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + bl GenerateRandomNumber + movs r1, 0xFF + ands r1, r0 + cmp r4, r1 + bhi _0803ED0C + b _0803EE12 +_0803ED0C: + ldr r0, =0x0202420a + strb r6, [r0] + ldr r0, =0x0202433c + lsls r2, r5, 4 + adds r2, r0 + ldrb r1, [r2, 0x1] + movs r0, 0x19 + negs r0, r0 + ands r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r2, 0x1] + b _0803ED70 + .pool +_0803ED38: + ldr r0, =0x0202420a + strb r6, [r0] + ldr r0, =0x0202433c + lsls r2, r5, 4 + adds r2, r0 + ldrb r1, [r2, 0x1] + movs r0, 0x19 + negs r0, r0 + ands r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r2, 0x1] + b _0803ED70 + .pool +_0803ED5C: + ldr r1, =0x02022fec + ldr r2, [r1] + ldr r0, =0x043f0100 + ands r0, r2 + cmp r0, 0 + beq _0803ED80 + movs r0, 0x8 + ands r2, r0 + cmp r2, 0 + beq _0803ED80 +_0803ED70: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + b _0803EE12 + .pool +_0803ED80: + ldr r0, [r1] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0803EE06 + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _0803EDBC + bl sub_81A9E28 + lsls r0, 24 + lsrs r1, r0, 24 + ldr r4, =0x02024084 + movs r3, 0x58 + adds r0, r5, 0 + muls r0, r3 + adds r0, r4 + ldrh r0, [r0, 0x6] + muls r0, r1 + movs r2, 0x1 + adds r1, r5, 0 + eors r1, r2 + muls r1, r3 + adds r1, r4 + b _0803EDDA + .pool +_0803EDBC: + ldr r3, =0x02024084 + movs r2, 0x58 + adds r0, r5, 0 + muls r0, r2 + adds r4, r0, r3 + movs r1, 0x1 + adds r0, r5, 0 + eors r0, r1 + muls r0, r2 + adds r1, r0, r3 + ldrh r0, [r4, 0x6] + ldrh r2, [r1, 0x6] + cmp r0, r2 + bcs _0803EE00 + lsls r0, 7 +_0803EDDA: + ldrh r1, [r1, 0x6] + bl __divsi3 + ldr r1, =0x0202449c + ldr r1, [r1] + adds r1, 0x6C + ldrb r2, [r1] + lsls r1, r2, 4 + subs r1, r2 + lsls r1, 1 + adds r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + bl GenerateRandomNumber + movs r1, 0xFF + ands r1, r0 + cmp r4, r1 + bls _0803EE06 +_0803EE00: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 +_0803EE06: + ldr r0, =0x0202449c + ldr r1, [r0] + adds r1, 0x6C + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0803EE12: + cmp r7, 0 + beq _0803EE24 + ldr r1, =0x02024082 + ldr r0, =0x0202406c + ldrb r0, [r0] + strb r0, [r1] + ldr r1, =0x0202433a + movs r0, 0x4 + strb r0, [r1] +_0803EE24: + adds r0, r7, 0 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_803EC20 + + thumb_func_start sub_803EE48 +sub_803EE48: @ 803EE48 + push {r4-r6,lr} + ldr r4, =0x0202420b + ldr r1, =0x0202407e + ldr r5, =0x02024082 + ldrb r0, [r5] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r4] + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x02000002 + ands r0, r1 + cmp r0, 0 + beq _0803EF0C + ldr r0, =0x0202406c + ldrb r1, [r0] + strb r1, [r5] + ldr r2, =0x02024064 + movs r0, 0 + strb r0, [r2] + lsls r1, 24 + cmp r1, 0 + beq _0803EEE0 + adds r4, r2, 0 + ldr r6, =0x0202421c + ldr r5, =0x0202433a +_0803EE7C: + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0803EEBC + ldrb r0, [r4] + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0x3 + bne _0803EECE + ldrb r0, [r5] + movs r1, 0x2 + b _0803EECA + .pool +_0803EEBC: + ldrb r0, [r4] + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0x3 + bne _0803EECE + ldrb r0, [r5] + movs r1, 0x1 +_0803EECA: + orrs r0, r1 + strb r0, [r5] +_0803EECE: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803EE7C +_0803EEE0: + ldr r2, =0x0202433a + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r0, =0x03005d90 + ldr r1, [r0] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x8 + orrs r0, r2 + b _0803EF96 + .pool +_0803EF0C: + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0803EF4C + ldrb r0, [r4] + bl sub_803EC20 + lsls r0, 24 + cmp r0, 0 + bne _0803EF98 + ldrb r0, [r4] + bl sub_8045868 + ldr r1, =0x02024332 + movs r0, 0x3 + strb r0, [r1, 0x5] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAB02 + str r0, [r1] + ldr r1, =0x02024083 + movs r0, 0xA + b _0803EF96 + .pool +_0803EF4C: + ldr r1, =0x02024084 + ldrb r2, [r4] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + ldr r1, =0x0400e000 + ands r0, r1 + cmp r0, 0 + beq _0803EF8C + ldr r1, =0x02024332 + movs r0, 0x4 + strb r0, [r1, 0x5] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAB02 + str r0, [r1] + ldr r1, =0x02024083 + movs r0, 0xA + b _0803EF96 + .pool +_0803EF8C: + ldr r0, =0x0202406c + ldrb r0, [r0] + strb r0, [r5] + ldr r1, =0x0202433a + movs r0, 0x6 +_0803EF96: + strb r0, [r1] +_0803EF98: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803EE48 + + thumb_func_start sub_803EFA8 +sub_803EFA8: @ 803EFA8 + ldr r2, =0x0202420b + ldr r1, =0x0202407e + ldr r0, =0x02024082 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DBD58 + ldr r0, [r0] + str r0, [r1] + ldr r1, =0x02024083 + movs r0, 0xA + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_803EFA8 + + thumb_func_start bs5_8016AC0 +bs5_8016AC0: @ 803EFF0 + ldr r2, =0x0202420b + ldr r1, =0x0202407e + ldr r0, =0x02024082 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r1, =0x0203a04c + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + ldr r1, =0x02024208 + movs r0, 0x5 + strh r0, [r1] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DBD08 + ldr r0, [r0, 0x14] + str r0, [r1] + ldr r1, =0x02024083 + movs r0, 0xA + strb r0, [r1] + bx lr + .pool + thumb_func_end bs5_8016AC0 + + thumb_func_start sub_803F050 +sub_803F050: @ 803F050 + push {r4-r6,lr} + ldr r3, =0x0202420b + ldr r1, =0x0202407e + ldr r0, =0x02024082 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r3] + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r6, =0x02024332 + ldr r2, =0x02023864 + ldrb r0, [r3] + lsls r0, 9 + adds r1, r2, 0x1 + adds r0, r1 + ldrb r0, [r0] + subs r0, 0x1 + strb r0, [r6, 0x5] + ldr r1, =0x02024208 + ldrb r0, [r3] + lsls r0, 9 + adds r2, 0x2 + adds r0, r2 + ldrb r0, [r0] + strh r0, [r1] + ldr r1, =0x03005d10 + ldrb r0, [r1, 0x1F] + cmp r0, 0xFE + bhi _0803F096 + adds r0, 0x1 + strb r0, [r1, 0x1F] +_0803F096: + ldr r2, =0x0202449c + ldr r0, [r2] + adds r1, r0, 0 + adds r1, 0x7A + ldrb r0, [r1] + cmp r0, 0x2 + bhi _0803F0A8 + adds r0, 0x1 + strb r0, [r1] +_0803F0A8: + ldr r0, [r2] + adds r3, r0, 0 + adds r3, 0x7B + ldrb r5, [r3] + adds r4, r5, 0 + cmp r4, 0x1 + bls _0803F100 + ldr r2, =gUnknown_0831BCE0 + adds r0, 0x7A + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + ldrb r6, [r6, 0x5] + adds r0, r6 + adds r0, r2 + ldrb r0, [r0] + cmp r4, r0 + bcs _0803F0FC + movs r0, 0x1 + b _0803F0FE + .pool +_0803F0FC: + subs r0, r5, r0 +_0803F0FE: + strb r0, [r3] +_0803F100: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DBD58 + ldr r0, [r0, 0x8] + str r0, [r1] + ldr r1, =0x02024083 + movs r0, 0xA + strb r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803F050 + + thumb_func_start sub_803F120 +sub_803F120: @ 803F120 + push {r4,lr} + ldr r2, =0x0202420b + ldr r1, =0x0202407e + ldr r0, =0x02024082 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r0, =0x02022e14 + movs r4, 0 + strh r4, [r0] + ldr r0, =0x02022e16 + strh r4, [r0] + ldr r3, =0x0202449c + ldr r0, [r3] + adds r2, r0, 0 + adds r2, 0x7C + ldr r1, =gUnknown_0831BCEF + adds r0, 0x79 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + ldrb r1, [r2] + adds r0, r1 + strb r0, [r2] + ldr r0, [r3] + adds r1, r0, 0 + adds r1, 0x7C + ldrb r0, [r1] + cmp r0, 0x14 + bls _0803F162 + movs r0, 0x14 + strb r0, [r1] +_0803F162: + ldr r0, [r3] + adds r2, r0, 0 + adds r2, 0x7B + ldr r1, =gUnknown_0831BCF3 + adds r0, 0x79 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + ldrb r1, [r2] + adds r0, r1 + strb r0, [r2] + ldr r0, [r3] + adds r1, r0, 0 + adds r1, 0x7B + ldrb r0, [r1] + cmp r0, 0x14 + bls _0803F188 + movs r0, 0x14 + strb r0, [r1] +_0803F188: + ldr r0, [r3] + adds r1, r0, 0 + adds r1, 0x79 + ldrb r0, [r1] + cmp r0, 0x2 + bhi _0803F1C4 + adds r0, 0x1 + strb r0, [r1] + ldr r0, =0x02024332 + strb r4, [r0, 0x5] + b _0803F1CA + .pool +_0803F1C4: + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] +_0803F1CA: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DBD58 + ldr r0, [r0, 0x4] + str r0, [r1] + ldr r1, =0x02024083 + movs r0, 0xA + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803F120 + + thumb_func_start bs8_exit_by_flight +bs8_exit_by_flight: @ 803F1F0 + push {r4,lr} + ldr r2, =0x0202420b + ldr r1, =0x0202407e + ldr r4, =0x02024082 + ldrb r0, [r4] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + movs r0, 0x11 + bl audio_play + ldr r0, =0x0202406c + ldrb r0, [r0] + strb r0, [r4] + ldr r1, =0x0202433a + movs r0, 0x4 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end bs8_exit_by_flight + + thumb_func_start bs9_8016C9C +bs9_8016C9C: @ 803F22C + ldr r3, =0x0202420b + ldr r1, =0x0202407e + ldr r0, =0x02024082 + ldrb r0, [r0] + adds r0, r1 + ldrb r2, [r0] + strb r2, [r3] + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x7 + strb r0, [r1, 0x1] + strb r2, [r1, 0x2] + ldr r2, =0x0202406e + ldrb r0, [r3] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DBD58 + ldr r0, [r0, 0xC] + str r0, [r1] + ldr r1, =0x02024083 + movs r0, 0xA + strb r0, [r1] + ldr r1, =0x0202407a + movs r0, 0xC + strb r0, [r1, 0x1] + bx lr + .pool + thumb_func_end bs9_8016C9C + + thumb_func_start bsB_exit_by_move +bsB_exit_by_move: @ 803F2A4 + push {lr} + bl sub_8041728 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0803F2C0 + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x4D + strb r1, [r0] + ldr r1, =0x02024083 + movs r0, 0xC + strb r0, [r1] +_0803F2C0: + pop {r0} + bx r0 + .pool + thumb_func_end bsB_exit_by_move + + thumb_func_start bsD_proceed +bsD_proceed: @ 803F2CC + ldr r1, =0x02024082 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r3, =0x02024083 + ldr r2, =0x0202407a + ldrb r0, [r1] + adds r0, r2 + ldrb r0, [r0] + strb r0, [r3] + ldr r2, =0x02024280 + ldr r0, [r2] + ldr r1, =0xf1e892af + ands r0, r1 + str r0, [r2] + bx lr + .pool + thumb_func_end bsD_proceed + + thumb_func_start bsC_8016D70 +bsC_8016D70: @ 803F300 + push {r4-r6,lr} + ldr r1, =0x0202407e + ldr r2, =0x02024082 + ldrb r0, [r2] + adds r0, r1 + ldrb r0, [r0] + ldr r6, =0x0202449c + ldr r1, [r6] + adds r0, r1 + adds r0, 0x5C + movs r1, 0x6 + strb r1, [r0] + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + ldr r3, =0x02024083 + ldr r1, =0x0202407a + ldrb r0, [r2] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r3] + bl sub_803D6A0 + ldr r2, =0x02024280 + ldr r0, [r2] + ldr r1, =0xf1e892af + ands r0, r1 + str r0, [r2] + ldr r0, =0x020241ea + movs r1, 0 + strh r1, [r0] + ldr r0, =0x020241f0 + movs r4, 0 + str r4, [r0] + ldr r0, =0x0202427c + strb r1, [r0] + ldr r5, =0x02024474 + strb r1, [r5, 0x18] + strb r1, [r5, 0x19] + ldr r2, =0x02024250 + ldr r3, =0x0202420b + ldrb r0, [r3] + lsls r0, 1 + adds r0, r2 + strh r4, [r0] + ldr r2, =0x02024258 + ldrb r0, [r3] + lsls r0, 1 + adds r0, r2 + strh r4, [r0] + ldr r0, [r6] + strb r1, [r0, 0x13] + ldr r0, =0x02024400 + strh r4, [r0] + strb r1, [r5, 0x14] + ldr r0, =0x02024332 + strb r1, [r0, 0x3] + strb r1, [r0, 0x4] + strb r1, [r5, 0x16] + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r0, [r0, 0x8] + adds r0, 0x20 + strb r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end bsC_8016D70 + + thumb_func_start get_battle_side_of_something +get_battle_side_of_something: @ 803F3CC + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + movs r0, 0 + cmp r1, 0xE + bhi _0803F47A + lsls r0, r1, 2 + ldr r1, =_0803F3E8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0803F3E8: + .4byte _0803F424 + .4byte _0803F430 + .4byte _0803F43C + .4byte _0803F458 + .4byte _0803F464 + .4byte _0803F458 + .4byte _0803F464 + .4byte _0803F448 + .4byte _0803F464 + .4byte _0803F464 + .4byte _0803F44C + .4byte _0803F464 + .4byte _0803F468 + .4byte _0803F46C + .4byte _0803F470 +_0803F424: + ldr r0, =0x0202420c + ldrb r0, [r0] + b _0803F47A + .pool +_0803F430: + ldr r0, =0x0202420b + ldrb r0, [r0] + b _0803F47A + .pool +_0803F43C: + ldr r0, =0x0202420e + ldrb r0, [r0] + b _0803F47A + .pool +_0803F448: + movs r0, 0 + b _0803F47A +_0803F44C: + ldr r0, =0x02024474 + ldrb r0, [r0, 0x17] + b _0803F47A + .pool +_0803F458: + ldr r0, =0x0202420d + ldrb r0, [r0] + b _0803F47A + .pool +_0803F464: + movs r0, 0 + b _0803F472 +_0803F468: + movs r0, 0x1 + b _0803F472 +_0803F46C: + movs r0, 0x2 + b _0803F472 +_0803F470: + movs r0, 0x3 +_0803F472: + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 +_0803F47A: + pop {r1} + bx r1 + thumb_func_end get_battle_side_of_something + + thumb_func_start sub_803F480 +sub_803F480: @ 803F480 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 16 + lsrs r2, 16 + ldr r1, =0x02024084 + movs r4, 0x58 + muls r0, r4 + adds r0, r1 + adds r0, 0x20 + ldrb r0, [r0] + mov r12, r1 + cmp r0, 0x2E + bne _0803F532 + movs r3, 0 + adds r0, r5, 0 + muls r0, r4 + adds r1, 0xC + adds r1, r0, r1 + b _0803F4BC + .pool +_0803F4B4: + adds r1, 0x2 + adds r3, 0x1 + cmp r3, 0x3 + bgt _0803F4C2 +_0803F4BC: + ldrh r0, [r1] + cmp r0, r2 + bne _0803F4B4 +_0803F4C2: + cmp r3, 0x4 + beq _0803F532 + movs r7, 0x58 + adds r2, r5, 0 + muls r2, r7 + adds r0, r3, r2 + mov r6, r12 + adds r6, 0x24 + adds r1, r0, r6 + ldrb r0, [r1] + cmp r0, 0 + beq _0803F4DE + subs r0, 0x1 + strb r0, [r1] +_0803F4DE: + mov r0, r12 + adds r0, 0x50 + adds r0, r2, r0 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 14 + ands r0, r1 + cmp r0, 0 + bne _0803F532 + ldr r1, =0x020242bc + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x18] + lsrs r1, 4 + ldr r2, =gUnknown_0832A328 + lsls r0, r3, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0803F532 + ldr r4, =0x02024064 + strb r5, [r4] + adds r1, r3, 0 + adds r1, 0x9 + lsls r1, 24 + lsrs r1, 24 + ldrb r0, [r4] + muls r0, r7 + adds r0, r6 + adds r0, r3 + str r0, [sp] + movs r0, 0 + movs r2, 0 + movs r3, 0x1 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803F532: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803F480 + + thumb_func_start sub_803F548 +sub_803F548: @ 803F548 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x4 + mov r8, r0 + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r4, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + bge _0803F5F0 + ldr r1, =0x02024084 + movs r0, 0x58 + adds r7, r5, 0 + muls r7, r0 + adds r1, 0xC + mov r10, r1 +_0803F57E: + lsls r0, r4, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + adds r6, r4, 0x1 + cmp r9, r0 + beq _0803F5E6 + ldr r0, =0x02024084 + movs r3, 0x58 + adds r1, r4, 0 + muls r1, r3 + adds r1, r0 + adds r1, 0x20 + ldrb r1, [r1] + adds r4, r0, 0 + cmp r1, 0x2E + bne _0803F5E6 + movs r2, 0 + adds r0, r5, 0 + muls r0, r3 + adds r1, r4, 0 + adds r1, 0xC + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x8F + lsls r1, 1 + cmp r0, r1 + beq _0803F5CE + adds r3, r1, 0 + mov r0, r10 + adds r1, r7, r0 +_0803F5C0: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, 0x3 + bgt _0803F5CE + ldrh r0, [r1] + cmp r0, r3 + bne _0803F5C0 +_0803F5CE: + cmp r2, 0x4 + beq _0803F5E6 + mov r8, r2 + adds r1, r2, r7 + adds r0, r4, 0 + adds r0, 0x24 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _0803F5E6 + subs r0, 0x1 + strb r0, [r1] +_0803F5E6: + adds r4, r6, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _0803F57E +_0803F5F0: + mov r1, r8 + cmp r1, 0x4 + beq _0803F658 + ldr r6, =0x02024084 + movs r3, 0x58 + adds r0, r5, 0 + muls r0, r3 + adds r1, r6, 0 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 14 + ands r0, r1 + cmp r0, 0 + bne _0803F658 + ldr r1, =0x020242bc + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x18] + lsrs r1, 4 + ldr r2, =gUnknown_0832A328 + mov r4, r8 + lsls r0, r4, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0803F658 + ldr r4, =0x02024064 + strb r5, [r4] + mov r1, r8 + adds r1, 0x9 + lsls r1, 24 + lsrs r1, 24 + ldrb r0, [r4] + muls r0, r3 + adds r2, r6, 0 + adds r2, 0x24 + adds r0, r2 + add r0, r8 + str r0, [sp] + movs r0, 0 + movs r2, 0 + movs r3, 0x1 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803F658: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803F548 + + thumb_func_start sub_803F67C +sub_803F67C: @ 803F67C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r3, r0, 24 + movs r6, 0x4 + movs r1, 0 + ldr r0, =0x0202406c + mov r8, r0 + ldrb r0, [r0] + cmp r1, r0 + bge _0803F6FE + ldr r7, =0x02024084 + movs r2, 0x58 + mov r12, r2 + mov r5, r12 + muls r5, r3 + adds r0, r7, 0 + adds r0, 0xC + adds r2, r5, r0 + mov r10, r2 + mov r9, r5 +_0803F6AE: + mov r0, r12 + muls r0, r1 + adds r0, r7 + adds r0, 0x20 + ldrb r0, [r0] + adds r4, r1, 0x1 + cmp r0, 0x2E + bne _0803F6F4 + cmp r1, r3 + beq _0803F6F4 + movs r2, 0 + mov r1, r10 + ldrh r0, [r1] + cmp r0, 0xC3 + beq _0803F6DE + ldr r1, =0x02024090 + add r1, r9 +_0803F6D0: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, 0x3 + bgt _0803F6DE + ldrh r0, [r1] + cmp r0, 0xC3 + bne _0803F6D0 +_0803F6DE: + cmp r2, 0x4 + beq _0803F6F4 + adds r6, r2, 0 + adds r0, r6, r5 + ldr r2, =0x020240a8 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0 + beq _0803F6F4 + subs r0, 0x1 + strb r0, [r1] +_0803F6F4: + adds r1, r4, 0 + mov r0, r8 + ldrb r0, [r0] + cmp r1, r0 + blt _0803F6AE +_0803F6FE: + cmp r6, 0x4 + beq _0803F762 + ldr r7, =0x02024084 + movs r5, 0x58 + adds r0, r3, 0 + muls r0, r5 + adds r1, r7, 0 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 14 + ands r0, r1 + cmp r0, 0 + bne _0803F762 + ldr r1, =0x020242bc + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x18] + lsrs r1, 4 + ldr r2, =gUnknown_0832A328 + lsls r0, r6, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0803F762 + ldr r4, =0x02024064 + strb r3, [r4] + adds r1, r6, 0 + adds r1, 0x9 + lsls r1, 24 + lsrs r1, 24 + ldrb r0, [r4] + muls r0, r5 + adds r2, r7, 0 + adds r2, 0x24 + adds r0, r2 + adds r0, r6 + str r0, [sp] + movs r0, 0 + movs r2, 0 + movs r3, 0x1 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803F762: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803F67C + + thumb_func_start sub_803F790 +sub_803F790: @ 803F790 + push {r4,r5,lr} + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0803F7D0 + movs r2, 0 + ldr r4, =0x0202406c + ldrb r0, [r4] + cmp r2, r0 + bge _0803F7EE + ldr r3, =0x02024068 + ldr r5, =gUnknown_0832A328 +_0803F7AC: + ldm r5!, {r1} + lsls r1, 28 + ldr r0, [r3] + orrs r0, r1 + str r0, [r3] + adds r2, 0x1 + ldrb r0, [r4] + cmp r2, r0 + blt _0803F7AC + b _0803F7EE + .pool +_0803F7D0: + movs r2, 0 + ldr r4, =0x0202406c + ldrb r0, [r4] + cmp r2, r0 + bge _0803F7EE + ldr r3, =0x02024068 + ldr r5, =gUnknown_0832A328 +_0803F7DE: + ldr r0, [r3] + ldm r5!, {r1} + orrs r0, r1 + str r0, [r3] + adds r2, 0x1 + ldrb r0, [r4] + cmp r2, r0 + blt _0803F7DE +_0803F7EE: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803F790 + + thumb_func_start dp01_battle_side_mark_buffer_for_execution +dp01_battle_side_mark_buffer_for_execution: @ 803F800 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0803F834 + ldr r2, =0x02024068 + ldr r1, =gUnknown_0832A328 + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r0] + lsls r1, 28 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + b _0803F844 + .pool +_0803F834: + ldr r2, =0x02024068 + ldr r1, =gUnknown_0832A328 + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r2] + ldr r0, [r0] + orrs r1, r0 + str r1, [r2] +_0803F844: + pop {r0} + bx r0 + .pool + thumb_func_end dp01_battle_side_mark_buffer_for_execution + + thumb_func_start sub_803F850 +sub_803F850: @ 803F850 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + movs r4, 0 + ldr r5, =0x02024068 + ldr r1, =gUnknown_0832A328 + lsls r0, r7, 2 + adds r6, r0, r1 + b _0803F87A + .pool +_0803F86C: + lsls r0, r4, 2 + ldr r1, [r6] + lsls r1, r0 + ldr r0, [r5] + orrs r0, r1 + str r0, [r5] + adds r4, 0x1 +_0803F87A: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + blt _0803F86C + ldr r2, =0x02024068 + movs r1, 0x80 + lsls r1, 21 + lsls r1, r7 + ldr r0, [r2] + bics r0, r1 + str r0, [r2] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803F850 + + thumb_func_start b_cancel_multi_turn_move_maybe +b_cancel_multi_turn_move_maybe: @ 803F8A0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02024084 + movs r2, 0x58 + adds r3, r0, 0 + muls r3, r2 + adds r1, 0x50 + adds r3, r1 + ldr r1, [r3] + ldr r2, =0xffffefff + ands r1, r2 + ldr r2, =0xfffff3ff + ands r1, r2 + movs r2, 0x71 + negs r2, r2 + ands r1, r2 + ldr r2, =0xfffffcff + ands r1, r2 + str r1, [r3] + ldr r1, =0x020242ac + lsls r2, r0, 2 + adds r2, r1 + ldr r1, [r2] + ldr r3, =0xfffbff3f + ands r1, r3 + str r1, [r2] + ldr r2, =0x020242bc + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x11] + movs r0, 0x10 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x11] + movs r0, 0 + strb r0, [r1, 0x10] + bx lr + .pool + thumb_func_end b_cancel_multi_turn_move_maybe + + thumb_func_start sub_803F90C +sub_803F90C: @ 803F90C + push {lr} + lsls r0, 24 + ldr r1, =0x0202433c + lsrs r0, 20 + adds r1, r0, r1 + ldrb r0, [r1] + lsrs r0, 7 + cmp r0, 0 + bne _0803F952 + ldrb r2, [r1, 0x1] + lsls r0, r2, 30 + cmp r0, 0 + blt _0803F952 + lsls r0, r2, 26 + cmp r0, 0 + blt _0803F952 + lsls r0, r2, 25 + cmp r0, 0 + blt _0803F952 + lsrs r0, r2, 7 + cmp r0, 0 + bne _0803F952 + ldrb r1, [r1, 0x2] + lsls r0, r1, 31 + cmp r0, 0 + bne _0803F952 + lsls r0, r1, 30 + cmp r0, 0 + blt _0803F952 + lsls r0, r1, 29 + cmp r0, 0 + blt _0803F952 + lsls r0, r2, 31 + cmp r0, 0 + beq _0803F95C +_0803F952: + movs r0, 0x1 + b _0803F95E + .pool +_0803F95C: + movs r0, 0 +_0803F95E: + pop {r1} + bx r1 + thumb_func_end sub_803F90C + + thumb_func_start b_std_message +b_std_message: @ 803F964 + push {r4,lr} + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + ldr r4, =0x02024064 + strb r1, [r4] + movs r0, 0 + adds r1, r2, 0 + bl dp01_build_cmdbuf_x10_TODO + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end b_std_message + + thumb_func_start sub_803F988 +sub_803F988: @ 803F988 + push {r4-r6,lr} + movs r3, 0 + ldr r0, =0x020243fe + strb r3, [r0] + strb r3, [r0, 0x1] + movs r1, 0 + ldr r0, =0x0202406c + ldrb r2, [r0] + adds r6, r0, 0 + cmp r1, r2 + bge _0803F9B6 + ldr r5, =gUnknown_0832A328 + adds r4, r2, 0 + ldr r2, =0x0202406e +_0803F9A4: + ldrh r0, [r2] + lsls r0, 2 + adds r0, r5 + ldr r0, [r0] + orrs r3, r0 + adds r2, 0x4 + adds r1, 0x2 + cmp r1, r4 + blt _0803F9A4 +_0803F9B6: + movs r1, 0x1 + adds r2, r6, 0 + ldrb r0, [r2] + cmp r1, r0 + bge _0803F9D6 + ldr r5, =0x020243fe + movs r4, 0x2 +_0803F9C4: + adds r0, r1, 0 + ands r0, r4 + asrs r0, 1 + adds r0, r5 + strb r3, [r0] + adds r1, 0x2 + ldrb r0, [r2] + cmp r1, r0 + blt _0803F9C4 +_0803F9D6: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803F988 + + thumb_func_start sub_803F9EC +sub_803F9EC: @ 803F9EC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0803FA50 + movs r0, 0x2 + ands r0, r5 + lsls r0, 24 + lsrs r0, 25 + mov r12, r0 + ldr r1, =0x020243fe + adds r0, r1 + strb r4, [r0] + adds r5, r4, 0 + ldr r0, =0x0202406c + ldrb r2, [r0] + mov r8, r1 + cmp r4, r2 + bge _0803FA4A + ldr r0, =0x02024210 + ldrb r7, [r0] + ldr r1, =gUnknown_0832A328 + adds r6, r2, 0 + ldr r3, =0x0202406e + adds r2, r1, 0 +_0803FA2E: + ldr r0, [r2] + ands r0, r7 + cmp r0, 0 + bne _0803FA40 + ldrh r0, [r3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + orrs r4, r0 +_0803FA40: + adds r3, 0x4 + adds r2, 0x8 + adds r5, 0x2 + cmp r5, r6 + blt _0803FA2E +_0803FA4A: + mov r0, r12 + add r0, r8 + strb r4, [r0] +_0803FA50: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803F9EC + + thumb_func_start sub_803FA70 +sub_803FA70: @ 803FA70 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0803FA8C + adds r0, r4, 0 + bl sub_803F9EC + b _0803FAC2 +_0803FA8C: + movs r3, 0x1 + ldr r5, =0x0202406c + ldrb r0, [r5] + cmp r3, r0 + bge _0803FAC2 + ldr r0, =0x020243fe + mov r12, r0 + movs r7, 0x2 + ldr r6, =gUnknown_0832A328 + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r4, r0, r1 +_0803FAA4: + adds r2, r3, 0 + ands r2, r7 + asrs r2, 1 + add r2, r12 + ldrh r0, [r4] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + adds r3, 0x1 + ldrb r0, [r5] + cmp r3, r0 + blt _0803FAA4 +_0803FAC2: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803FA70 + + thumb_func_start b_movescr_stack_push +b_movescr_stack_push: @ 803FAD8 + push {r4,lr} + ldr r1, =0x020244a8 + ldr r1, [r1] + ldr r3, [r1, 0x8] + adds r4, r3, 0 + adds r4, 0x20 + ldrb r1, [r4] + adds r2, r1, 0x1 + strb r2, [r4] + lsls r1, 24 + lsrs r1, 22 + adds r3, r1 + str r0, [r3] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end b_movescr_stack_push + + thumb_func_start b_movescr_stack_push_cursor +b_movescr_stack_push_cursor: @ 803FAFC + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r2, [r0, 0x8] + adds r3, r2, 0 + adds r3, 0x20 + ldrb r0, [r3] + adds r1, r0, 0x1 + strb r1, [r3] + lsls r0, 24 + lsrs r0, 22 + adds r2, r0 + ldr r0, =0x02024214 + ldr r0, [r0] + str r0, [r2] + bx lr + .pool + thumb_func_end b_movescr_stack_push_cursor + + thumb_func_start b_movescr_stack_pop_cursor +b_movescr_stack_pop_cursor: @ 803FB24 + ldr r3, =0x02024214 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r1, [r0, 0x8] + adds r2, r1, 0 + adds r2, 0x20 + ldrb r0, [r2] + subs r0, 0x1 + strb r0, [r2] + lsls r0, 24 + lsrs r0, 22 + adds r1, r0 + ldr r0, [r1] + str r0, [r3] + bx lr + .pool + thumb_func_end b_movescr_stack_pop_cursor + + thumb_func_start sub_803FB4C +sub_803FB4C: @ 803FB4C + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r6, 0 + ldr r2, =0x02024084 + ldr r1, =0x02023864 + ldr r3, =0x02024064 + ldrb r4, [r3] + lsls r0, r4, 9 + adds r1, 0x2 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 1 + movs r1, 0x58 + muls r1, r4 + adds r0, r1 + adds r2, 0xC + adds r0, r2 + ldrh r5, [r0] + ldr r1, =0x0202449c + lsls r0, r4, 1 + adds r0, 0xC8 + ldr r1, [r1] + adds r1, r0 + mov r8, r1 + ldr r1, =0x020242bc + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x4] + adds r7, r3, 0 + adds r3, r1, 0 + cmp r0, r5 + bne _0803FC06 + cmp r5, 0 + beq _0803FC06 + ldr r0, =0x02024474 + strb r4, [r0, 0x17] + ldr r0, =0x020241ea + strh r5, [r0] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _0803FBF8 + ldr r1, =0x02024230 + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldr r1, =gUnknown_082DAE2A + str r1, [r0] + ldr r0, =0x0202433c + ldrb r1, [r7] + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1, 0x2] + movs r2, 0x10 + orrs r0, r2 + strb r0, [r1, 0x2] + b _0803FC06 + .pool +_0803FBF8: + ldr r0, =0x02024220 + ldrb r1, [r7] + lsls r1, 2 + adds r1, r0 + ldr r0, =gUnknown_082DAE1F + str r0, [r1] + movs r6, 0x1 +_0803FC06: + ldr r1, =0x02024248 + ldrb r2, [r7] + lsls r0, r2, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r5, r0 + bne _0803FC90 + cmp r5, 0xA5 + beq _0803FC90 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + bge _0803FC90 + adds r0, r2, 0 + bl b_cancel_multi_turn_move_maybe + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _0803FC7C + ldr r1, =0x02024230 + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldr r1, =gUnknown_082DB098 + str r1, [r0] + ldr r0, =0x0202433c + ldrb r1, [r7] + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1, 0x2] + movs r2, 0x10 + orrs r0, r2 + strb r0, [r1, 0x2] + b _0803FC8E + .pool +_0803FC7C: + ldr r1, =0x02024220 + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldr r1, =gUnknown_082DB089 + str r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0803FC8E: + ldr r3, =0x020242bc +_0803FC90: + ldrb r0, [r7] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r1, 0x13] + lsls r0, 28 + cmp r0, 0 + beq _0803FD1A + ldr r0, =gBattleMoves + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + cmp r0, 0 + bne _0803FD1A + ldr r0, =0x020241ea + strh r5, [r0] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _0803FD08 + ldr r1, =0x02024230 + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldr r1, =gUnknown_082DB0AF + str r1, [r0] + ldr r0, =0x0202433c + ldrb r1, [r7] + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1, 0x2] + movs r2, 0x10 + orrs r0, r2 + strb r0, [r1, 0x2] + b _0803FD1A + .pool +_0803FD08: + ldr r1, =0x02024220 + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldr r1, =gUnknown_082DB0A0 + str r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0803FD1A: + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r1, r5, 0 + bl sub_8040130 + lsls r0, 24 + cmp r0, 0 + beq _0803FD8E + ldr r0, =0x020241ea + strh r5, [r0] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _0803FD7C + ldr r1, =0x02024230 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =gUnknown_082DB185 + str r1, [r0] + ldr r0, =0x0202433c + ldrb r1, [r4] + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1, 0x2] + movs r2, 0x10 + orrs r0, r2 + strb r0, [r1, 0x2] + b _0803FD8E + .pool +_0803FD7C: + ldr r1, =0x02024220 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =gUnknown_082DB181 + str r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0803FD8E: + ldr r1, =0x02024084 + ldr r0, =0x02024064 + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2E] + cmp r0, 0xAF + bne _0803FDC4 + ldr r1, =0x02024404 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r4, [r0, 0x7] + b _0803FDCE + .pool +_0803FDC4: + ldrh r0, [r1, 0x2E] + bl itemid_get_x12 + lsls r0, 24 + lsrs r4, r0, 24 +_0803FDCE: + ldr r2, =0x0202420f + ldr r1, =0x02024064 + ldrb r0, [r1] + strb r0, [r2] + ldr r0, =0x02024084 + mov r12, r0 + adds r7, r1, 0 + cmp r4, 0x1D + bne _0803FE58 + mov r0, r8 + ldrh r1, [r0] + adds r2, r1, 0 + cmp r2, 0 + beq _0803FE58 + ldr r0, =0x0000ffff + cmp r2, r0 + beq _0803FE58 + cmp r2, r5 + beq _0803FE58 + ldr r0, =0x020241ea + strh r1, [r0] + ldr r2, =0x02024208 + ldrb r1, [r7] + movs r0, 0x58 + muls r0, r1 + add r0, r12 + ldrh r0, [r0, 0x2E] + strh r0, [r2] + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 10 + ands r1, r0 + ldrb r2, [r7] + cmp r1, 0 + beq _0803FE48 + ldr r0, =0x0202433c + lsls r1, r2, 4 + adds r1, r0 + ldrb r0, [r1, 0x2] + movs r2, 0x10 + orrs r0, r2 + strb r0, [r1, 0x2] + b _0803FE58 + .pool +_0803FE48: + ldr r1, =0x02024220 + lsls r0, r2, 2 + adds r0, r1 + ldr r1, =gUnknown_082DB812 + str r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0803FE58: + ldr r0, =0x02023864 + ldrb r3, [r7] + lsls r1, r3, 9 + adds r0, 0x2 + adds r1, r0 + movs r0, 0x58 + muls r0, r3 + ldrb r1, [r1] + adds r0, r1 + mov r1, r12 + adds r1, 0x24 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0803FEB8 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _0803FEA8 + ldr r0, =0x0202433c + lsls r1, r3, 4 + adds r1, r0 + ldrb r0, [r1, 0x2] + movs r2, 0x10 + orrs r0, r2 + strb r0, [r1, 0x2] + b _0803FEB8 + .pool +_0803FEA8: + ldr r1, =0x02024220 + lsls r0, r3, 2 + adds r0, r1 + ldr r1, =gUnknown_082DB076 + str r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0803FEB8: + adds r0, r6, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_803FB4C + + thumb_func_start sub_803FECC +sub_803FECC: @ 803FECC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + lsls r2, 24 + lsrs r3, r2, 24 + ldr r1, =0x0202449c + lsls r0, r7, 1 + adds r0, 0xC8 + ldr r1, [r1] + adds r1, r0 + str r1, [sp, 0x4] + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r7 + adds r1, r0, r1 + ldrh r0, [r1, 0x2E] + cmp r0, 0xAF + bne _0803FF1C + ldr r2, =0x02024404 + lsls r1, r7, 3 + subs r0, r1, r7 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x7] + str r0, [sp] + b _0803FF2E + .pool +_0803FF1C: + ldrh r0, [r1, 0x2E] + str r3, [sp, 0x14] + bl itemid_get_x12 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + lsls r1, r7, 3 + ldr r3, [sp, 0x14] +_0803FF2E: + ldr r0, =0x0202420f + strb r7, [r0] + movs r0, 0 + mov r9, r0 + lsls r2, r7, 1 + str r2, [sp, 0xC] + ldr r5, =0x020242bc + mov r12, r5 + ldr r0, =0x02024084 + movs r2, 0x58 + adds r6, r7, 0 + muls r6, r2 + str r6, [sp, 0x8] + ldr r2, =0x02024090 + adds r5, r6, r2 + movs r6, 0 + str r6, [sp, 0x10] + mov r10, r0 + subs r0, r1, r7 + lsls r0, 2 + mov r8, r0 + ldr r6, =gUnknown_0832A328 +_0803FF5A: + ldrh r0, [r5] + cmp r0, 0 + bne _0803FF70 + movs r0, 0x1 + ands r0, r3 + cmp r0, 0 + beq _0803FF70 + ldr r0, [r6] + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_0803FF70: + ldr r0, [sp, 0x8] + add r0, r9 + mov r1, r10 + adds r1, 0x24 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0803FF90 + movs r0, 0x2 + ands r0, r3 + cmp r0, 0 + beq _0803FF90 + ldr r0, [r6] + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_0803FF90: + mov r1, r8 + add r1, r12 + ldrh r0, [r5] + ldrh r1, [r1, 0x4] + cmp r0, r1 + bne _0803FFAC + movs r0, 0x4 + ands r0, r3 + cmp r0, 0 + beq _0803FFAC + ldr r0, [r6] + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_0803FFAC: + movs r0, 0x58 + adds r2, r7, 0 + muls r2, r0 + ldr r1, [sp, 0x10] + adds r0, r1, r2 + ldr r1, =0x02024090 + adds r0, r1 + mov r12, r0 + ldr r1, =0x02024248 + ldr r0, [sp, 0xC] + adds r1, r0, r1 + str r1, [sp, 0x18] + mov r1, r12 + ldrh r1, [r1] + mov r12, r1 + ldr r0, [sp, 0x18] + ldrh r0, [r0] + cmp r12, r0 + bne _0803FFEE + movs r0, 0x8 + ands r0, r3 + cmp r0, 0 + beq _0803FFEE + mov r0, r10 + adds r0, 0x50 + adds r0, r2, r0 + ldr r0, [r0] + cmp r0, 0 + bge _0803FFEE + ldr r0, [r6] + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_0803FFEE: + ldr r0, =0x020242bc + add r0, r8 + ldrb r0, [r0, 0x13] + lsls r0, 28 + cmp r0, 0 + beq _0804001C + movs r0, 0x10 + ands r0, r3 + cmp r0, 0 + beq _0804001C + ldr r2, =gBattleMoves + ldrh r1, [r5] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0 + bne _0804001C + ldr r0, [r6] + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_0804001C: + ldrh r1, [r5] + adds r0, r7, 0 + str r3, [sp, 0x14] + bl sub_8040130 + lsls r0, 24 + ldr r3, [sp, 0x14] + cmp r0, 0 + beq _0804003E + movs r0, 0x20 + ands r0, r3 + cmp r0, 0 + beq _0804003E + ldr r0, [r6] + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_0804003E: + ldr r1, =0x020242bc + mov r0, r8 + adds r2, r0, r1 + ldrb r0, [r2, 0xE] + lsls r0, 28 + mov r12, r1 + cmp r0, 0 + beq _0804005E + ldrh r0, [r2, 0x6] + ldrh r1, [r5] + cmp r0, r1 + beq _0804005E + ldr r0, [r6] + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_0804005E: + ldr r2, [sp] + cmp r2, 0x1D + bne _08040080 + ldr r0, [sp, 0x4] + ldrh r1, [r0] + cmp r1, 0 + beq _08040080 + ldr r0, =0x0000ffff + cmp r1, r0 + beq _08040080 + ldrh r2, [r5] + cmp r1, r2 + beq _08040080 + ldr r0, [r6] + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_08040080: + adds r6, 0x4 + adds r5, 0x2 + ldr r0, [sp, 0x10] + adds r0, 0x2 + str r0, [sp, 0x10] + movs r1, 0x1 + add r9, r1 + mov r2, r9 + cmp r2, 0x3 + bgt _08040096 + b _0803FF5A +_08040096: + adds r0, r4, 0 + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_803FECC + + thumb_func_start sub_80400C8 +sub_80400C8: @ 80400C8 + push {r4,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + movs r1, 0 + movs r2, 0xFF + bl sub_803FECC + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0xF + bne _0804010C + ldr r0, =0x0202433c + ldrb r1, [r4] + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + ldr r1, =0x02024220 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =gUnknown_082DB072 + str r1, [r0] + b _0804011E + .pool +_0804010C: + ldr r0, =0x0202433c + ldrb r1, [r4] + lsls r1, 4 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] +_0804011E: + movs r0, 0 + cmp r3, 0xF + bne _08040126 + movs r0, 0x1 +_08040126: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80400C8 + + thumb_func_start sub_8040130 +sub_8040130: @ 8040130 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r5, r1, 16 + movs r6, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r4, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r6, r0 + bge _080401B4 + ldr r7, =0x02024090 + mov r8, r7 +_0804015A: + lsls r0, r4, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + adds r3, r4, 0x1 + cmp r9, r0 + beq _080401AA + ldr r1, =0x020242ac + lsls r0, r4, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 6 + ands r0, r1 + cmp r0, 0 + beq _080401AA + movs r2, 0 + movs r0, 0x58 + adds r1, r4, 0 + muls r1, r0 + adds r0, r1, r7 + ldrh r0, [r0] + cmp r5, r0 + beq _080401A0 + mov r4, r8 + adds r0, r1, r4 +_08040192: + adds r0, 0x2 + adds r2, 0x1 + cmp r2, 0x3 + bgt _080401AA + ldrh r1, [r0] + cmp r5, r1 + bne _08040192 +_080401A0: + cmp r2, 0x3 + bgt _080401AA + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_080401AA: + adds r4, r3, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _0804015A +_080401B4: + adds r0, r6, 0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8040130 + + thumb_func_start sub_80401D0 +sub_80401D0: @ 80401D0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r0, 0 + mov r9, r0 + ldr r1, =0x0202420b + mov r2, r9 + strb r2, [r1] + ldr r0, =0x0202406c + ldrb r4, [r0] + adds r6, r1, 0 + mov r10, r0 + ldr r7, =0x0202420c + ldr r3, =0x0202449c + mov r12, r3 + cmp r9, r4 + bcs _08040224 + ldr r2, =0x02024210 + ldrb r1, [r2] + ldr r5, =gUnknown_0832A328 + ldr r0, [r5] + ands r1, r0 + cmp r1, 0 + beq _08040224 + adds r3, r6, 0 +_08040206: + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + lsls r0, 24 + lsrs r0, 24 + cmp r0, r4 + bcs _08040224 + ldrb r0, [r2] + ldrb r1, [r6] + lsls r1, 2 + adds r1, r5 + ldr r1, [r1] + ands r0, r1 + cmp r0, 0 + bne _08040206 +_08040224: + movs r0, 0 + strb r0, [r7] + mov r0, r10 + ldrb r4, [r0] + cmp r4, 0 + beq _0804025E + ldr r2, =0x02024210 + ldrb r1, [r2] + ldr r5, =gUnknown_0832A328 + ldr r0, [r5] + ands r1, r0 + cmp r1, 0 + beq _0804025E + adds r3, r7, 0 +_08040240: + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + lsls r0, 24 + lsrs r0, 24 + cmp r0, r4 + bcs _0804025E + ldrb r0, [r2] + ldrb r1, [r7] + lsls r1, 2 + adds r1, r5 + ldr r1, [r1] + ands r0, r1 + cmp r0, 0 + bne _08040240 +_0804025E: + mov r1, r12 + ldr r0, [r1] + ldrb r0, [r0, 0x3] + cmp r0, 0xA + bls _0804026A + b _080408F6 +_0804026A: + lsls r0, 2 + ldr r1, =_08040290 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08040290: + .4byte _080402BC + .4byte _08040342 + .4byte _08040408 + .4byte _080404D4 + .4byte _080405B0 + .4byte _08040668 + .4byte _0804071C + .4byte _080407A0 + .4byte _08040810 + .4byte _08040868 + .4byte _080408EC +_080402BC: + movs r5, 0 + ldr r1, =0x0202406c + mov r10, r1 + ldrb r2, [r1] + cmp r5, r2 + bge _080402D6 + ldr r2, =0x0202407e +_080402CA: + adds r0, r5, r2 + strb r5, [r0] + adds r5, 0x1 + ldrb r3, [r1] + cmp r5, r3 + blt _080402CA +_080402D6: + movs r5, 0 + b _08040324 + .pool +_080402E4: + adds r4, r5, 0x1 + adds r6, r4, 0 + ldrb r1, [r1] + cmp r6, r1 + bge _08040322 + ldr r7, =0x0202407e + ldr r0, =0x0202406c + mov r10, r0 + lsls r1, r5, 24 + mov r8, r1 +_080402F8: + adds r0, r5, r7 + ldrb r0, [r0] + adds r1, r4, r7 + ldrb r1, [r1] + movs r2, 0 + bl b_first_side + lsls r0, 24 + cmp r0, 0 + beq _08040318 + lsls r1, r4, 24 + lsrs r1, 24 + mov r2, r8 + lsrs r0, r2, 24 + bl sub_803CEDC +_08040318: + adds r4, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _080402F8 +_08040322: + adds r5, r6, 0 +_08040324: + mov r1, r10 + ldrb r0, [r1] + subs r0, 0x1 + cmp r5, r0 + blt _080402E4 + ldr r2, =0x0202449c + ldr r1, [r2] + ldrb r0, [r1, 0x3] + adds r0, 0x1 + strb r0, [r1, 0x3] + ldr r0, [r2] + adds r0, 0xDB + movs r1, 0 + strb r1, [r0] + mov r12, r2 +_08040342: + mov r1, r12 + ldr r0, [r1] + adds r0, 0xDB + ldrb r0, [r0] + cmp r0, 0x1 + bls _08040350 + b _0804062C +_08040350: + ldr r3, =0x02024064 + mov r8, r3 + movs r7, 0 + ldr r6, =0x0202420b + ldr r5, =0x02022f58 +_0804035A: + ldr r0, [r1] + adds r0, 0xDB + ldrb r4, [r0] + ldr r2, =0x02024294 + lsls r1, r4, 1 + adds r0, r1, r4 + lsls r0, 2 + adds r2, r0, r2 + ldrb r0, [r2, 0x1] + strb r0, [r6] + mov r3, r8 + strb r0, [r3] + ldr r0, =0x0202428e + adds r3, r1, r0 + ldrh r1, [r3] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080403BC + ldrb r0, [r2] + subs r0, 0x1 + strb r0, [r2] + movs r4, 0xFF + lsls r0, 24 + cmp r0, 0 + bne _080403BC + ldrh r0, [r3] + ldr r2, =0x0000fffe + adds r1, r2, 0 + ands r0, r1 + strh r0, [r3] + ldr r0, =gUnknown_082DACFA + bl b_call_bc_move_exec + movs r0, 0xFD + strb r0, [r5] + movs r0, 0x2 + strb r0, [r5, 0x1] + movs r0, 0x73 + strb r0, [r5, 0x2] + strb r7, [r5, 0x3] + ldrb r0, [r5, 0x4] + orrs r0, r4 + strb r0, [r5, 0x4] + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_080403BC: + ldr r2, =0x0202449c + ldr r1, [r2] + adds r1, 0xDB + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + mov r12, r2 + mov r3, r9 + cmp r3, 0 + beq _080403D2 + b _080408FE +_080403D2: + mov r1, r12 + ldr r0, [r1] + adds r0, 0xDB + ldrb r0, [r0] + cmp r0, 0x1 + bls _0804035A + b _0804062C + .pool +_08040408: + mov r1, r12 + ldr r0, [r1] + adds r0, 0xDB + ldrb r0, [r0] + cmp r0, 0x1 + bls _08040416 + b _08040570 +_08040416: + movs r0, 0x2 + mov r10, r0 + movs r2, 0 + mov r8, r2 + ldr r7, =0x0202420b + ldr r5, =0x02022f58 +_08040422: + ldr r0, [r1] + adds r0, 0xDB + ldrb r4, [r0] + ldr r2, =0x02024294 + lsls r1, r4, 1 + adds r0, r1, r4 + lsls r0, 2 + adds r2, r0, r2 + ldrb r0, [r2, 0x3] + strb r0, [r7] + ldr r3, =0x02024064 + strb r0, [r3] + ldr r0, =0x0202428e + adds r3, r1, r0 + ldrh r1, [r3] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0804048A + ldrb r0, [r2, 0x2] + subs r0, 0x1 + strb r0, [r2, 0x2] + movs r6, 0xFF + lsls r0, 24 + cmp r0, 0 + bne _0804048A + ldrh r0, [r3] + ldr r2, =0x0000fffd + adds r1, r2, 0 + ands r0, r1 + strh r0, [r3] + ldr r0, =gUnknown_082DACFA + bl b_call_bc_move_exec + ldr r0, =0x02024332 + strb r4, [r0, 0x5] + movs r0, 0xFD + strb r0, [r5] + mov r3, r10 + strb r3, [r5, 0x1] + movs r0, 0x71 + strb r0, [r5, 0x2] + mov r0, r8 + strb r0, [r5, 0x3] + ldrb r0, [r5, 0x4] + orrs r0, r6 + strb r0, [r5, 0x4] + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_0804048A: + ldr r2, =0x0202449c + ldr r1, [r2] + adds r1, 0xDB + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + mov r12, r2 + mov r1, r9 + cmp r1, 0 + beq _080404A0 + b _080408FE +_080404A0: + mov r1, r12 + ldr r0, [r1] + adds r0, 0xDB + ldrb r0, [r0] + cmp r0, 0x1 + bls _08040422 + b _08040570 + .pool +_080404D4: + mov r1, r12 + ldr r0, [r1] + adds r0, 0xDB + ldrb r0, [r0] + cmp r0, 0x1 + bhi _08040570 + ldr r0, =0x02024064 + mov r10, r0 + movs r2, 0 + mov r8, r2 + ldr r7, =0x0202420b + ldr r5, =0x02022f58 +_080404EC: + ldr r0, [r1] + adds r0, 0xDB + ldrb r4, [r0] + ldr r1, =0x02024294 + lsls r3, r4, 1 + adds r0, r3, r4 + lsls r0, 2 + adds r1, r0, r1 + ldrb r0, [r1, 0x5] + strb r0, [r7] + mov r2, r10 + strb r0, [r2] + ldrb r0, [r1, 0x4] + cmp r0, 0 + beq _0804054E + subs r0, 0x1 + strb r0, [r1, 0x4] + movs r6, 0xFF + lsls r0, 24 + cmp r0, 0 + bne _0804054E + ldr r2, =0x0202428e + adds r2, r3, r2 + ldrh r0, [r2] + ldr r3, =0x0000feff + adds r1, r3, 0 + ands r0, r1 + strh r0, [r2] + ldr r0, =gUnknown_082DACFA + bl b_call_bc_move_exec + ldr r0, =0x02024332 + strb r4, [r0, 0x5] + movs r0, 0xFD + strb r0, [r5] + movs r0, 0x2 + strb r0, [r5, 0x1] + movs r0, 0x36 + strb r0, [r5, 0x2] + mov r0, r8 + strb r0, [r5, 0x3] + ldrb r0, [r5, 0x4] + orrs r0, r6 + strb r0, [r5, 0x4] + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_0804054E: + ldr r2, =0x0202449c + ldr r1, [r2] + adds r1, 0xDB + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + mov r12, r2 + mov r1, r9 + cmp r1, 0 + beq _08040564 + b _080408FE +_08040564: + mov r1, r12 + ldr r0, [r1] + adds r0, 0xDB + ldrb r0, [r0] + cmp r0, 0x1 + bls _080404EC +_08040570: + mov r2, r9 + cmp r2, 0 + beq _08040578 + b _080408FE +_08040578: + mov r3, r12 + ldr r0, [r3] + ldrb r1, [r0, 0x3] + adds r1, 0x1 + strb r1, [r0, 0x3] + ldr r0, [r3] + adds r0, 0xDB + strb r2, [r0] + b _080408F6 + .pool +_080405B0: + mov r1, r12 + ldr r0, [r1] + adds r0, 0xDB + ldrb r0, [r0] + cmp r0, 0x1 + bhi _0804062C + ldr r6, =0x02024064 + ldr r5, =0x0202420b +_080405C0: + ldr r0, [r1] + adds r0, 0xDB + ldrb r4, [r0] + ldr r2, =0x02024294 + lsls r1, r4, 1 + adds r0, r1, r4 + lsls r0, 2 + adds r2, r0, r2 + ldrb r0, [r2, 0x7] + strb r0, [r5] + strb r0, [r6] + ldr r0, =0x0202428e + adds r3, r1, r0 + ldrh r1, [r3] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0804060A + ldrb r0, [r2, 0x6] + subs r0, 0x1 + strb r0, [r2, 0x6] + lsls r0, 24 + cmp r0, 0 + bne _0804060A + ldrh r0, [r3] + ldr r2, =0x0000ffdf + adds r1, r2, 0 + ands r0, r1 + strh r0, [r3] + ldr r0, =gUnknown_082DAD0B + bl b_call_bc_move_exec + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_0804060A: + ldr r2, =0x0202449c + ldr r1, [r2] + adds r1, 0xDB + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + mov r12, r2 + mov r3, r9 + cmp r3, 0 + beq _08040620 + b _080408FE +_08040620: + mov r1, r12 + ldr r0, [r1] + adds r0, 0xDB + ldrb r0, [r0] + cmp r0, 0x1 + bls _080405C0 +_0804062C: + mov r0, r9 + cmp r0, 0 + beq _08040634 + b _080408FE +_08040634: + mov r1, r12 + ldr r0, [r1] + ldrb r1, [r0, 0x3] + adds r1, 0x1 + strb r1, [r0, 0x3] + mov r2, r12 + ldr r0, [r2] + adds r0, 0xDB + mov r3, r9 + strb r3, [r0] + b _080408F6 + .pool +_08040668: + mov r2, r12 + ldr r0, [r2] + adds r0, 0xDB + ldr r1, =0x0202406c + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bcs _080406E8 + ldr r4, =0x02024064 + ldr r5, =0x0202407e +_0804067C: + ldr r0, [r2] + adds r0, 0xDB + ldrb r0, [r0] + adds r0, r5 + ldrb r0, [r0] + strb r0, [r4] + ldr r0, =0x020243d0 + adds r0, 0x20 + ldrb r2, [r4] + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0 + beq _080406C4 + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + bne _080406C4 + ldr r1, =0x02024084 + ldrb r2, [r4] + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _080406C4 + ldr r0, =0x0202420c + strb r2, [r0] + ldr r0, =gUnknown_082DB0B7 + bl b_call_bc_move_exec + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_080406C4: + ldr r2, =0x0202449c + ldr r1, [r2] + adds r1, 0xDB + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + mov r12, r2 + mov r3, r9 + cmp r3, 0 + beq _080406DA + b _080408FE +_080406DA: + ldr r0, [r2] + adds r0, 0xDB + ldr r1, =0x0202406c + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bcc _0804067C +_080406E8: + mov r0, r9 + cmp r0, 0 + beq _080406F0 + b _080408FE +_080406F0: + mov r2, r12 + ldr r1, [r2] + ldrb r0, [r1, 0x3] + adds r0, 0x1 + strb r0, [r1, 0x3] + b _080408F6 + .pool +_0804071C: + ldr r3, =0x020243cc + ldrh r2, [r3] + movs r0, 0x7 + ands r0, r2 + cmp r0, 0 + bne _0804072A + b _080408C8 +_0804072A: + movs r0, 0x4 + ands r0, r2 + cmp r0, 0 + bne _08040776 + ldr r1, =0x020243d0 + adds r1, 0x28 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + bne _08040768 + ldr r0, =0x0000fffe + ands r0, r2 + ldr r1, =0x0000fffd + ands r0, r1 + strh r0, [r3] + ldr r1, =0x02024332 + movs r0, 0x2 + strb r0, [r1, 0x5] + b _08040794 + .pool +_08040768: + movs r0, 0x2 + ands r0, r2 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _08040782 + b _08040790 +_08040776: + movs r0, 0x2 + ands r0, r2 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _08040790 +_08040782: + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] + b _08040794 + .pool +_08040790: + ldr r0, =0x02024332 + strb r1, [r0, 0x5] +_08040794: + ldr r0, =gUnknown_082DAC2C + b _080408BA + .pool +_080407A0: + ldr r3, =0x020243cc + ldrh r2, [r3] + movs r0, 0x18 + ands r0, r2 + cmp r0, 0 + bne _080407AE + b _080408C8 +_080407AE: + movs r0, 0x10 + ands r0, r2 + cmp r0, 0 + bne _080407E8 + ldr r1, =0x020243d0 + adds r1, 0x28 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + bne _080407E8 + ldr r0, =0x0000fff7 + ands r0, r2 + strh r0, [r3] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DACC9 + b _080407EC + .pool +_080407E8: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAC47 +_080407EC: + str r0, [r1] + adds r3, r1, 0 + ldr r1, =0x02024474 + movs r2, 0 + movs r0, 0xC + strb r0, [r1, 0x10] + ldr r0, =0x02024332 + strb r2, [r0, 0x5] + b _080408B8 + .pool +_08040810: + ldr r3, =0x020243cc + ldrh r2, [r3] + movs r0, 0x60 + ands r0, r2 + cmp r0, 0 + beq _080408C8 + movs r0, 0x40 + ands r0, r2 + cmp r0, 0 + bne _08040854 + ldr r1, =0x020243d0 + adds r1, 0x28 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + bne _08040854 + ldr r0, =0x0000ffdf + ands r0, r2 + strh r0, [r3] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DACE0 + b _08040858 + .pool +_08040854: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DACD2 +_08040858: + str r0, [r1] + adds r3, r1, 0 + b _080408B8 + .pool +_08040868: + ldr r3, =0x020243cc + ldrh r2, [r3] + movs r0, 0x80 + ands r0, r2 + cmp r0, 0 + beq _080408C8 + ldr r1, =0x020243d0 + adds r1, 0x28 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + bne _080408A4 + ldr r0, =0x0000ff7f + ands r0, r2 + strh r0, [r3] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DACC9 + b _080408A8 + .pool +_080408A4: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAC47 +_080408A8: + str r0, [r1] + adds r3, r1, 0 + ldr r1, =0x02024474 + movs r0, 0xD + strb r0, [r1, 0x10] + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] +_080408B8: + ldr r0, [r3] +_080408BA: + bl b_call_bc_move_exec + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_080408C8: + ldr r2, =0x0202449c + ldr r1, [r2] + ldrb r0, [r1, 0x3] + adds r0, 0x1 + strb r0, [r1, 0x3] + mov r12, r2 + b _080408F6 + .pool +_080408EC: + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_080408F6: + mov r3, r9 + cmp r3, 0 + bne _080408FE + b _0804025E +_080408FE: + ldr r0, =0x03005d04 + ldr r1, [r0] + ldr r0, =sub_803B9BC + eors r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80401D0 + + thumb_func_start sub_8040924 +sub_8040924: @ 8040924 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + movs r0, 0 + mov r9, r0 + ldr r2, =0x02024280 + ldr r0, [r2] + ldr r1, =0x01000020 + orrs r0, r1 + str r0, [r2] + ldr r5, =0x0202449c + ldr r2, [r5] + ldr r0, =0x0202406c + ldrb r1, [r2, 0x1] + adds r7, r5, 0 + mov r8, r0 + ldrb r3, [r0] + cmp r1, r3 + bcc _08040954 + bl _08041338 +_08040954: + bl _0804132E + .pool +_08040968: + ldr r3, =0x02024064 + ldr r4, =0x0202420b + ldr r1, =0x0202407e + ldr r5, [r5] + ldrb r0, [r5, 0x1] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r4] + strb r0, [r3] + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + ldrb r0, [r3] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + adds r6, r3, 0 + cmp r1, 0 + beq _080409B0 + ldrb r0, [r5, 0x1] + adds r0, 0x1 + strb r0, [r5, 0x1] + bl _0804131C + .pool +_080409B0: + ldrb r0, [r5] + cmp r0, 0x13 + bls _080409BA + bl _08041312 +_080409BA: + lsls r0, 2 + ldr r1, =_080409C8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080409C8: + .4byte _08040A18 + .4byte _08040A78 + .4byte _08040A96 + .4byte _08040AC6 + .4byte _08040B44 + .4byte _08040B8C + .4byte _08040C0C + .4byte _08040C54 + .4byte _08040CB8 + .4byte _08040D00 + .4byte _08040E60 + .4byte _08040F7C + .4byte _08041024 + .4byte _080410E8 + .4byte _0804119C + .4byte _080411BC + .4byte _08041208 + .4byte _08041238 + .4byte _08040AAE + .4byte _08041304 +_08040A18: + ldr r1, =0x020242ac + ldrb r3, [r6] + lsls r0, r3, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 3 + ands r0, r1 + cmp r0, 0 + bne _08040A30 + bl _080412DE +_08040A30: + ldr r0, =0x02024084 + movs r1, 0x58 + muls r1, r3 + adds r0, r1, r0 + ldrh r2, [r0, 0x28] + ldrh r5, [r0, 0x2C] + cmp r2, r5 + bne _08040A44 + bl _080412DE +_08040A44: + cmp r2, 0 + bne _08040A4C + bl _080412DE +_08040A4C: + ldr r1, =0x020241f0 + ldrh r0, [r0, 0x2C] + lsrs r0, 4 + str r0, [r1] + cmp r0, 0 + bne _08040A5C + movs r0, 0x1 + str r0, [r1] +_08040A5C: + ldr r0, [r1] + negs r0, r0 + str r0, [r1] + ldr r0, =gUnknown_082DB0EE + bl _080412D0 + .pool +_08040A78: + ldrb r1, [r6] + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + bne _08040A92 + bl _080412DE +_08040A92: + bl _080412D4 +_08040A96: + ldrb r1, [r6] + movs r0, 0x1 + movs r2, 0 + bl berry_effects_maybe + lsls r0, 24 + cmp r0, 0 + bne _08040AAA + bl _080412DE +_08040AAA: + bl _080412D4 +_08040AAE: + ldrb r1, [r6] + movs r0, 0x1 + movs r2, 0x1 + bl berry_effects_maybe + lsls r0, 24 + cmp r0, 0 + bne _08040AC2 + bl _080412DE +_08040AC2: + bl _080412D4 +_08040AC6: + ldr r0, =0x020242ac + ldrb r2, [r6] + lsls r1, r2, 2 + adds r1, r0 + ldr r1, [r1] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _08040ADC + bl _080412DE +_08040ADC: + ldr r3, =0x02024084 + movs r5, 0x3 + ands r5, r1 + movs r1, 0x58 + adds r0, r5, 0 + muls r0, r1 + adds r0, r3 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _08040AF4 + bl _080412DE +_08040AF4: + adds r0, r2, 0 + muls r0, r1 + adds r0, r3 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _08040B04 + bl _080412DE +_08040B04: + ldr r0, =0x0202420c + strb r5, [r0] + ldr r2, =0x020241f0 + ldrb r0, [r6] + muls r0, r1 + adds r0, r3 + ldrh r0, [r0, 0x2C] + lsrs r0, 3 + str r0, [r2] + cmp r0, 0 + bne _08040B1E + movs r0, 0x1 + str r0, [r2] +_08040B1E: + ldr r1, =0x02024474 + strb r5, [r1, 0x10] + ldrb r0, [r4] + strb r0, [r1, 0x11] + ldr r0, =gUnknown_082DAD15 + b _080412D0 + .pool +_08040B44: + ldr r2, =0x02024084 + ldrb r1, [r6] + movs r0, 0x58 + adds r3, r1, 0 + muls r3, r0 + adds r0, r2, 0 + adds r0, 0x4C + adds r0, r3, r0 + ldr r0, [r0] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + bne _08040B60 + b _080412DE +_08040B60: + adds r1, r3, r2 + ldrh r0, [r1, 0x28] + cmp r0, 0 + bne _08040B6A + b _080412DE +_08040B6A: + ldr r2, =0x020241f0 + ldrh r0, [r1, 0x2C] + lsrs r0, 3 + str r0, [r2] + cmp r0, 0 + bne _08040B7A + movs r0, 0x1 + str r0, [r2] +_08040B7A: + ldr r0, =gUnknown_082DB23D + b _080412D0 + .pool +_08040B8C: + ldr r4, =0x02024084 + ldrb r0, [r6] + movs r7, 0x58 + mov r8, r7 + mov r2, r8 + muls r2, r0 + adds r3, r4, 0 + adds r3, 0x4C + adds r0, r2, r3 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08040BAA + b _080412DE +_08040BAA: + adds r1, r2, r4 + ldrh r0, [r1, 0x28] + cmp r0, 0 + bne _08040BB4 + b _080412DE +_08040BB4: + ldr r5, =0x020241f0 + ldrh r0, [r1, 0x2C] + lsrs r0, 4 + str r0, [r5] + cmp r0, 0 + bne _08040BC4 + movs r0, 0x1 + str r0, [r5] +_08040BC4: + ldrb r0, [r6] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r2, r0, r3 + ldr r1, [r2] + movs r4, 0xF0 + lsls r4, 4 + adds r0, r1, 0 + ands r0, r4 + cmp r0, r4 + beq _08040BE4 + movs r7, 0x80 + lsls r7, 1 + adds r0, r1, r7 + str r0, [r2] +_08040BE4: + ldrb r0, [r6] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r3 + ldr r0, [r0] + ands r0, r4 + lsrs r0, 8 + ldr r1, [r5] + muls r0, r1 + str r0, [r5] + ldr r0, =gUnknown_082DB23D + b _080412D0 + .pool +_08040C0C: + ldr r2, =0x02024084 + ldrb r1, [r6] + movs r0, 0x58 + adds r3, r1, 0 + muls r3, r0 + adds r0, r2, 0 + adds r0, 0x4C + adds r0, r3, r0 + ldr r0, [r0] + movs r1, 0x10 + ands r0, r1 + cmp r0, 0 + bne _08040C28 + b _080412DE +_08040C28: + adds r1, r3, r2 + ldrh r0, [r1, 0x28] + cmp r0, 0 + bne _08040C32 + b _080412DE +_08040C32: + ldr r2, =0x020241f0 + ldrh r0, [r1, 0x2C] + lsrs r0, 3 + str r0, [r2] + cmp r0, 0 + bne _08040C42 + movs r0, 0x1 + str r0, [r2] +_08040C42: + ldr r0, =gUnknown_082DB25F + b _080412D0 + .pool +_08040C54: + ldr r4, =0x02024084 + ldrb r1, [r6] + movs r0, 0x58 + muls r1, r0 + adds r0, r4, 0 + adds r0, 0x50 + adds r5, r1, r0 + ldr r2, [r5] + movs r0, 0x80 + lsls r0, 20 + ands r0, r2 + cmp r0, 0 + bne _08040C70 + b _080412DE +_08040C70: + adds r3, r1, r4 + ldrh r0, [r3, 0x28] + cmp r0, 0 + bne _08040C7A + b _080412DE +_08040C7A: + adds r0, r4, 0 + adds r0, 0x4C + adds r0, r1, r0 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + beq _08040CAC + ldr r1, =0x020241f0 + ldrh r0, [r3, 0x2C] + lsrs r0, 2 + str r0, [r1] + cmp r0, 0 + bne _08040C9A + movs r0, 0x1 + str r0, [r1] +_08040C9A: + ldr r0, =gUnknown_082DB33F + b _080412D0 + .pool +_08040CAC: + ldr r0, =0xf7ffffff + ands r2, r0 + str r2, [r5] + b _080412DE + .pool +_08040CB8: + ldr r2, =0x02024084 + ldrb r1, [r6] + movs r0, 0x58 + adds r3, r1, 0 + muls r3, r0 + adds r0, r2, 0 + adds r0, 0x50 + adds r0, r3, r0 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 21 + ands r0, r1 + cmp r0, 0 + bne _08040CD6 + b _080412DE +_08040CD6: + adds r1, r3, r2 + ldrh r0, [r1, 0x28] + cmp r0, 0 + bne _08040CE0 + b _080412DE +_08040CE0: + ldr r2, =0x020241f0 + ldrh r0, [r1, 0x2C] + lsrs r0, 2 + str r0, [r2] + cmp r0, 0 + bne _08040CF0 + movs r0, 0x1 + str r0, [r2] +_08040CF0: + ldr r0, =gUnknown_082DB350 + b _080412D0 + .pool +_08040D00: + ldr r3, =0x02024084 + mov r8, r3 + ldrb r0, [r6] + movs r3, 0x58 + adds r1, r0, 0 + muls r1, r3 + movs r5, 0x50 + add r5, r8 + mov r10, r5 + adds r4, r1, r5 + ldr r2, [r4] + movs r5, 0xE0 + lsls r5, 8 + adds r0, r2, 0 + ands r0, r5 + cmp r0, 0 + bne _08040D24 + b _080412DE +_08040D24: + mov r7, r8 + adds r0, r1, r7 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _08040D30 + b _080412DE +_08040D30: + ldr r1, =0xffffe000 + adds r0, r2, r1 + str r0, [r4] + ldrb r4, [r6] + adds r0, r4, 0 + muls r0, r3 + add r0, r10 + ldr r0, [r0] + ands r0, r5 + cmp r0, 0 + beq _08040DC0 + ldr r1, =0x02024474 + ldr r0, =0x0202449c + ldr r2, [r0] + lsls r0, r4, 1 + adds r0, r2 + ldrb r0, [r0, 0x4] + strb r0, [r1, 0x10] + ldrb r0, [r6] + lsls r0, 1 + adds r0, r2 + ldrb r0, [r0, 0x5] + strb r0, [r1, 0x11] + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x2 + strb r0, [r1, 0x1] + ldrb r0, [r6] + lsls r0, 1 + adds r0, r2 + ldrb r0, [r0, 0x4] + strb r0, [r1, 0x2] + ldrb r0, [r6] + lsls r0, 1 + adds r0, r2 + ldrb r0, [r0, 0x5] + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB30E + str r0, [r1] + ldr r2, =0x020241f0 + ldrb r0, [r6] + muls r0, r3 + add r0, r8 + ldrh r0, [r0, 0x2C] + lsrs r0, 4 + str r0, [r2] + cmp r0, 0 + bne _08040DEC + movs r0, 0x1 + str r0, [r2] + b _08040DEC + .pool +_08040DC0: + ldr r2, =0x02022f58 + movs r0, 0xFD + strb r0, [r2] + movs r0, 0x2 + strb r0, [r2, 0x1] + ldrb r1, [r6] + ldr r0, =0x0202449c + ldr r3, [r0] + lsls r1, 1 + adds r1, r3 + ldrb r0, [r1, 0x4] + strb r0, [r2, 0x2] + ldrb r0, [r6] + lsls r0, 1 + adds r0, r3 + ldrb r0, [r0, 0x5] + strb r0, [r2, 0x3] + movs r0, 0xFF + strb r0, [r2, 0x4] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB320 + str r0, [r1] +_08040DEC: + ldr r0, [r1] + b _080412D0 + .pool +_08040E00: + movs r0, 0x8 + negs r0, r0 + ands r3, r0 + str r3, [r2] + ldrb r0, [r6] + mov r2, r8 + muls r2, r0 + mov r0, r10 + adds r0, 0x50 + adds r2, r0 + ldr r0, [r2] + ldr r1, =0xf7ffffff + ands r0, r1 + str r0, [r2] + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] + ldr r0, =gUnknown_082DB234 + bl b_call_bc_move_exec + ldr r4, =0x02024064 + ldrb r0, [r6] + strb r0, [r4] + ldrb r0, [r4] + mov r3, r8 + muls r3, r0 + adds r0, r3, 0 + add r0, r9 + str r0, [sp] + movs r0, 0 + movs r1, 0x28 + movs r2, 0 + movs r3, 0x4 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + b _08040EC8 + .pool +_08040E60: + ldr r2, =0x02024084 + ldrb r1, [r6] + movs r0, 0x58 + muls r0, r1 + adds r1, r2, 0 + adds r1, 0x50 + adds r0, r1 + ldr r1, [r0] + movs r0, 0x70 + ands r1, r0 + adds r7, r2, 0 + cmp r1, 0 + beq _08040F6A + movs r0, 0 + strb r0, [r4] + mov r5, r8 + ldrb r0, [r5] + cmp r0, 0 + beq _08040EC8 + mov r10, r7 + adds r6, r4, 0 + movs r1, 0x58 + mov r8, r1 + movs r3, 0x4C + adds r3, r7 + mov r9, r3 + str r0, [sp, 0x4] + movs r5, 0x7 + mov r12, r5 +_08040E9A: + ldrb r4, [r6] + mov r1, r8 + muls r1, r4 + mov r0, r9 + adds r2, r1, r0 + ldr r3, [r2] + adds r0, r3, 0 + mov r5, r12 + ands r0, r5 + cmp r0, 0 + beq _08040EBA + adds r0, r1, r7 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x2B + bne _08040E00 +_08040EBA: + adds r0, r4, 0x1 + strb r0, [r6] + lsls r0, 24 + lsrs r0, 24 + ldr r1, [sp, 0x4] + cmp r0, r1 + bcc _08040E9A +_08040EC8: + ldr r2, =0x0202420b + ldr r1, =0x0202406c + ldrb r0, [r2] + ldrb r1, [r1] + cmp r0, r1 + beq _08040EE8 + movs r3, 0x2 + mov r9, r3 + b _08041318 + .pool +_08040EE8: + ldr r5, =0x02024064 + ldrb r0, [r5] + strb r0, [r2] + ldr r2, =0x02024084 + ldrb r0, [r5] + movs r7, 0x58 + adds r1, r0, 0 + muls r1, r7 + adds r6, r2, 0 + adds r6, 0x50 + adds r1, r6 + ldr r0, [r1] + subs r0, 0x10 + str r0, [r1] + ldrb r0, [r5] + bl sub_803F90C + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _08040F2C + ldrb r0, [r5] + bl b_cancel_multi_turn_move_maybe + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] + b _08040F60 + .pool +_08040F2C: + ldrb r3, [r5] + adds r0, r3, 0 + muls r0, r7 + adds r2, r0, r6 + ldr r0, [r2] + movs r1, 0x70 + ands r0, r1 + cmp r0, 0 + beq _08040F54 + ldr r0, =0x02024332 + strb r4, [r0, 0x5] + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 5 + orrs r0, r1 + str r0, [r2] + b _08040F60 + .pool +_08040F54: + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] + adds r0, r3, 0 + bl b_cancel_multi_turn_move_maybe +_08040F60: + ldr r0, =gUnknown_082DB2A6 + bl b_call_bc_move_exec + movs r5, 0x1 + mov r9, r5 +_08040F6A: + mov r7, r9 + cmp r7, 0x2 + bne _08040F72 + b _08041312 +_08040F72: + b _080412DE + .pool +_08040F7C: + ldr r1, =0x02024084 + ldrb r0, [r6] + movs r7, 0x58 + muls r0, r7 + adds r5, r1, 0 + adds r5, 0x50 + adds r2, r0, r5 + ldr r1, [r2] + movs r4, 0xC0 + lsls r4, 4 + adds r0, r1, 0 + ands r0, r4 + cmp r0, 0 + bne _08040F9A + b _080412DE +_08040F9A: + ldr r3, =0xfffffc00 + adds r0, r1, r3 + str r0, [r2] + ldrb r0, [r6] + bl sub_803F90C + lsls r0, 24 + cmp r0, 0 + beq _08040FBC + ldrb r0, [r6] + bl b_cancel_multi_turn_move_maybe + b _080412DE + .pool +_08040FBC: + ldrb r0, [r6] + muls r0, r7 + adds r2, r0, r5 + ldr r1, [r2] + adds r0, r1, 0 + ands r0, r4 + cmp r0, 0 + beq _08040FCE + b _080412DE +_08040FCE: + movs r0, 0x80 + lsls r0, 5 + ands r0, r1 + cmp r0, 0 + bne _08040FDA + b _080412DE +_08040FDA: + ldr r0, =0xffffefff + ands r1, r0 + str r1, [r2] + ldrb r0, [r6] + muls r0, r7 + adds r0, r5 + ldr r0, [r0] + movs r4, 0x7 + ands r0, r4 + cmp r0, 0 + beq _08040FF2 + b _080412DE +_08040FF2: + ldr r1, =0x02024332 + movs r0, 0x47 + strb r0, [r1, 0x3] + movs r0, 0x1 + movs r1, 0 + bl sub_8048760 + ldrb r0, [r6] + muls r0, r7 + adds r0, r5 + ldr r0, [r0] + ands r0, r4 + cmp r0, 0 + bne _08041010 + b _080412D4 +_08041010: + ldr r0, =gUnknown_082DB2AF + bl b_call_bc_move_exec + b _080412D4 + .pool +_08041024: + ldr r0, =0x020242bc + ldrb r3, [r6] + lsls r1, r3, 3 + subs r1, r3 + lsls r1, 2 + adds r5, r1, r0 + ldrb r1, [r5, 0xB] + lsls r1, 28 + adds r7, r0, 0 + cmp r1, 0 + bne _0804103C + b _080412DE +_0804103C: + movs r4, 0 + ldr r2, =0x02024084 + movs r0, 0x58 + adds r1, r3, 0 + muls r1, r0 + adds r2, 0xC + adds r1, r2 + ldrh r0, [r5, 0x4] + ldrh r1, [r1] + cmp r0, r1 + beq _0804107A + mov r12, r7 + mov r8, r2 + adds r5, r6, 0 + movs r3, 0x58 +_0804105A: + adds r4, 0x1 + cmp r4, 0x3 + bgt _0804107A + ldrb r2, [r5] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + add r1, r12 + lsls r0, r4, 1 + muls r2, r3 + adds r0, r2 + add r0, r8 + ldrh r1, [r1, 0x4] + ldrh r0, [r0] + cmp r1, r0 + bne _0804105A +_0804107A: + cmp r4, 0x4 + bne _080410AC + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r7 + movs r1, 0 + strh r1, [r0, 0x4] + ldrb r0, [r6] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r7 + ldrb r2, [r1, 0xB] + movs r0, 0x10 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0xB] + b _080412DE + .pool +_080410AC: + ldrb r0, [r6] + lsls r2, r0, 3 + subs r2, r0 + lsls r2, 2 + adds r2, r7 + ldrb r3, [r2, 0xB] + lsls r1, r3, 28 + lsrs r1, 28 + subs r1, 0x1 + movs r0, 0xF + ands r1, r0 + movs r0, 0x10 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0xB] + adds r2, r1, 0 + cmp r2, 0 + beq _080410D4 + b _080412DE +_080410D4: + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x4] + ldr r0, =gUnknown_082DAE23 + b _080412D0 + .pool +_080410E8: + ldr r3, =0x020242bc + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r2, r0, r3 + ldrb r5, [r2, 0xE] + lsls r4, r5, 28 + cmp r4, 0 + bne _080410FE + b _080412DE +_080410FE: + ldr r7, =0x02024084 + mov r8, r7 + ldrb r0, [r2, 0xC] + lsls r0, 1 + movs r7, 0x58 + muls r1, r7 + adds r0, r1 + mov r1, r8 + adds r1, 0xC + adds r0, r1 + ldrh r0, [r0] + ldrh r1, [r2, 0x6] + cmp r0, r1 + beq _0804113C + movs r0, 0 + strh r0, [r2, 0x6] + ldrb r0, [r6] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r2, [r1, 0xE] + movs r0, 0x10 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0xE] + b _080412DE + .pool +_0804113C: + lsrs r1, r4, 28 + subs r1, 0x1 + movs r0, 0xF + ands r1, r0 + movs r4, 0x10 + negs r4, r4 + adds r0, r4, 0 + ands r0, r5 + orrs r0, r1 + strb r0, [r2, 0xE] + cmp r1, 0 + beq _08041172 + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r3 + muls r1, r7 + ldrb r0, [r0, 0xC] + adds r1, r0 + mov r0, r8 + adds r0, 0x24 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _08041172 + b _080412DE +_08041172: + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0 + strh r1, [r0, 0x6] + ldrb r0, [r6] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r2, [r1, 0xE] + adds r0, r4, 0 + ands r0, r2 + strb r0, [r1, 0xE] + ldr r0, =gUnknown_082DAE37 + b _080412D0 + .pool +_0804119C: + ldr r0, =0x020242ac + ldrb r1, [r6] + lsls r1, 2 + adds r1, r0 + ldr r2, [r1] + movs r0, 0x18 + ands r0, r2 + cmp r0, 0 + beq _080411B4 + adds r0, r2, 0 + subs r0, 0x8 + str r0, [r1] +_080411B4: + ldr r1, [r7] + b _080412E2 + .pool +_080411BC: + ldr r2, =0x020242bc + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r3, r0, r2 + ldrb r2, [r3, 0x12] + lsls r1, r2, 28 + cmp r1, 0 + beq _080411F6 + lsrs r1, 28 + subs r1, 0x1 + movs r0, 0xF + ands r1, r0 + movs r0, 0x10 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x12] + cmp r1, 0 + bne _080411F6 + ldr r0, =0x020242ac + ldrb r2, [r6] + lsls r2, 2 + adds r2, r0 + ldr r0, [r2] + ldr r1, =0xfffffdff + ands r0, r1 + str r0, [r2] +_080411F6: + ldr r1, [r7] + b _080412E2 + .pool +_08041208: + ldr r2, =0x020242bc + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r3, r0, r2 + ldrb r2, [r3, 0x13] + lsls r1, r2, 28 + cmp r1, 0 + beq _0804122E + lsrs r1, 28 + subs r1, 0x1 + movs r0, 0xF + ands r1, r0 + movs r0, 0x10 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x13] +_0804122E: + ldr r1, [r7] + b _080412E2 + .pool +_08041238: + ldr r4, =0x020242ac + ldrb r0, [r6] + lsls r0, 2 + adds r2, r0, r4 + ldr r1, [r2] + movs r3, 0xC0 + lsls r3, 5 + adds r0, r1, 0 + ands r0, r3 + cmp r0, 0 + beq _080412DE + ldr r5, =0xfffff800 + adds r0, r1, r5 + str r0, [r2] + ldrb r2, [r6] + lsls r0, r2, 2 + adds r0, r4 + ldr r0, [r0] + ands r0, r3 + cmp r0, 0 + bne _080412DE + ldr r3, =0x02024084 + movs r5, 0x58 + adds r1, r2, 0 + muls r1, r5 + adds r4, r3, 0 + adds r4, 0x4C + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _080412DE + adds r0, r1, r3 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x48 + beq _080412DE + cmp r0, 0xF + beq _080412DE + adds r0, r2, 0 + bl sub_8050650 + lsls r0, 24 + cmp r0, 0 + bne _080412DE + ldrb r0, [r6] + bl b_cancel_multi_turn_move_maybe + bl GenerateRandomNumber + ldrb r1, [r6] + adds r2, r1, 0 + muls r2, r5 + adds r2, r4 + movs r1, 0x3 + ands r1, r0 + adds r1, 0x2 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + ldrb r0, [r6] + muls r0, r5 + adds r0, r4 + str r0, [sp] + movs r0, 0 + movs r1, 0x28 + movs r2, 0 + movs r3, 0x4 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r6] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x0202420e + ldrb r0, [r6] + strb r0, [r1] + ldr r0, =gUnknown_082DB378 +_080412D0: + bl b_call_bc_move_exec +_080412D4: + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_080412DE: + ldr r0, =0x0202449c + ldr r1, [r0] +_080412E2: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08041312 + .pool +_08041304: + ldr r1, [r7] + movs r0, 0 + strb r0, [r1] + ldr r1, [r7] + ldrb r0, [r1, 0x1] + adds r0, 0x1 + strb r0, [r1, 0x1] +_08041312: + mov r7, r9 + cmp r7, 0 + beq _0804131C +_08041318: + mov r0, r9 + b _08041344 +_0804131C: + ldr r5, =0x0202449c + ldr r2, [r5] + ldr r0, =0x0202406c + ldrb r1, [r2, 0x1] + adds r7, r5, 0 + mov r8, r0 + ldrb r0, [r0] + cmp r1, r0 + bcs _08041338 +_0804132E: + ldrb r0, [r2] + cmp r0, 0x13 + bhi _08041338 + bl _08040968 +_08041338: + ldr r0, =0x02024280 + ldr r1, [r0] + ldr r2, =0xfeffffdf + ands r1, r2 + str r1, [r0] + movs r0, 0 +_08041344: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8040924 + + thumb_func_start sub_8041364 +sub_8041364: @ 8041364 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r2, =0x02024280 + ldr r0, [r2] + ldr r1, =0x01000020 + orrs r0, r1 + str r0, [r2] + ldr r1, =0x0202449c + ldr r3, [r1] + movs r4, 0xD0 + lsls r4, 1 + adds r0, r3, r4 + ldrb r0, [r0] + mov r10, r2 + adds r6, r1, 0 + cmp r0, 0x1 + bne _0804138E + b _08041548 +_0804138E: + cmp r0, 0x1 + bgt _080413A4 + cmp r0, 0 + beq _080413AC + b _08041708 + .pool +_080413A4: + cmp r0, 0x2 + bne _080413AA + b _0804169A +_080413AA: + b _08041708 +_080413AC: + ldr r2, =0x000001a1 + adds r0, r3, r2 + ldr r1, =0x0202406c + ldrb r0, [r0] + mov r8, r1 + ldrb r7, [r1] + cmp r0, r7 + bcc _080413BE + b _08041532 +_080413BE: + ldr r4, =0x02024064 + ldr r5, =0x02022f58 + ldr r7, =0x020243d0 + movs r0, 0x18 + adds r0, r7 + mov r12, r0 +_080413CA: + ldr r0, [r6] + adds r3, r0, r2 + ldrb r0, [r3] + strb r0, [r4] + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _0804140C + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + b _08041520 + .pool +_0804140C: + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + ldr r1, =0x020243d0 + ldrb r0, [r4] + adds r2, r0, r1 + ldrb r0, [r2] + mov r9, r1 + cmp r0, 0 + bne _08041422 + b _08041520 +_08041422: + subs r0, 0x1 + strb r0, [r2] + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + bne _08041520 + ldr r1, =0x02024084 + ldrb r2, [r4] + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _08041520 + lsls r0, r2, 1 + add r0, r12 + ldrh r0, [r0] + cmp r0, 0xF8 + bne _0804145C + ldr r0, =0x02024332 + strb r3, [r0, 0x5] + b _08041462 + .pool +_0804145C: + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] +_08041462: + movs r0, 0xFD + strb r0, [r5] + movs r6, 0x2 + movs r0, 0x2 + strb r0, [r5, 0x1] + ldrb r0, [r4] + lsls r0, 1 + add r0, r12 + ldrh r0, [r0] + strb r0, [r5, 0x2] + ldrb r0, [r4] + lsls r0, 1 + add r0, r12 + ldrh r0, [r0] + lsrs r0, 8 + strb r0, [r5, 0x3] + movs r0, 0xFF + strb r0, [r5, 0x4] + ldr r5, =0x0202420c + ldrb r0, [r4] + strb r0, [r5] + ldr r1, =0x0202420b + adds r0, r7, 0x4 + ldrb r2, [r4] + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + ldr r2, =0x020241f0 + ldrb r0, [r4] + lsls r0, 2 + adds r1, r7, 0 + adds r1, 0x8 + adds r0, r1 + ldr r0, [r0] + str r0, [r2] + ldr r2, =0x0202437c + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x4 + adds r0, r2 + ldr r1, =0x0000ffff + str r1, [r0] + ldr r0, =gUnknown_082DAFE4 + bl b_call_bc_move_exec + ldrb r1, [r4] + adds r0, r1, r7 + ldrb r0, [r0] + cmp r0, 0 + beq _080414CC + b _08041664 +_080414CC: + eors r1, r6 + mov r3, r9 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + beq _080414DA + b _08041664 +_080414DA: + ldrb r0, [r5] + bl battle_get_per_side_status + ldr r2, =0x0202428e + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + ands r0, r1 + lsls r0, 1 + adds r0, r2 + ldrh r1, [r0] + ldr r4, =0x0000ffbf + adds r2, r4, 0 + ands r1, r2 + strh r1, [r0] + b _08041664 + .pool +_08041520: + ldr r0, [r6] + ldr r2, =0x000001a1 + adds r0, r2 + ldrb r0, [r0] + mov r1, r8 + ldrb r1, [r1] + cmp r0, r1 + bcs _08041532 + b _080413CA +_08041532: + ldr r0, [r6] + movs r2, 0xD0 + lsls r2, 1 + adds r0, r2 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r6] + ldr r3, =0x000001a1 + adds r1, r0, r3 + movs r0, 0 + strb r0, [r1] +_08041548: + adds r3, r6, 0 + ldr r0, [r6] + ldr r2, =0x000001a1 + adds r0, r2 + ldr r1, =0x0202406c + ldrb r0, [r0] + mov r8, r1 + ldrb r4, [r1] + cmp r0, r4 + bcc _0804155E + b _08041684 +_0804155E: + ldr r5, =0x02024064 + ldr r4, =0x02022f58 + ldr r7, =0x020242bc + mov r12, r7 + ldr r0, =0x0202420b + mov r9, r0 +_0804156A: + ldr r1, =0x0202407e + ldr r0, [r3] + adds r3, r0, r2 + ldrb r0, [r3] + adds r0, r1 + ldrb r0, [r0] + mov r1, r9 + strb r0, [r1] + strb r0, [r5] + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _080415BC + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + b _08041670 + .pool +_080415BC: + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + ldr r7, =0x020242ac + ldrb r0, [r5] + lsls r0, 2 + adds r0, r7 + ldr r0, [r0] + movs r1, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08041670 + movs r0, 0xFD + strb r0, [r4] + movs r0, 0x1 + strb r0, [r4, 0x1] + strb r0, [r4, 0x2] + strb r0, [r4, 0x3] + ldrb r1, [r5] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + ldrb r0, [r0, 0xF] + lsls r0, 28 + lsrs r0, 28 + strb r0, [r4, 0x4] + movs r0, 0xFF + strb r0, [r4, 0x5] + ldrb r2, [r5] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + mov r3, r12 + adds r4, r0, r3 + ldrb r3, [r4, 0xF] + lsls r1, r3, 28 + cmp r1, 0 + bne _08041644 + lsls r2, 2 + adds r2, r7 + ldr r0, [r2] + movs r1, 0x21 + negs r1, r1 + ands r0, r1 + str r0, [r2] + ldr r3, =0x020241f0 + ldr r2, =0x02024084 + ldrb r1, [r5] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0, 0x28] + str r0, [r3] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAF05 + b _0804165C + .pool +_08041644: + lsrs r1, 28 + subs r1, 0x1 + movs r0, 0xF + ands r1, r0 + movs r7, 0x10 + negs r7, r7 + adds r0, r7, 0 + ands r0, r3 + orrs r0, r1 + strb r0, [r4, 0xF] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAF20 +_0804165C: + str r0, [r1] + ldr r0, [r1] + bl b_call_bc_move_exec +_08041664: + movs r0, 0x1 + b _08041714 + .pool +_08041670: + adds r3, r6, 0 + ldr r0, [r6] + ldr r2, =0x000001a1 + adds r0, r2 + ldrb r0, [r0] + mov r1, r8 + ldrb r1, [r1] + cmp r0, r1 + bcs _08041684 + b _0804156A +_08041684: + ldr r0, [r6] + movs r2, 0xD0 + lsls r2, 1 + adds r0, r2 + movs r1, 0x2 + strb r1, [r0] + ldr r0, [r6] + ldr r3, =0x000001a1 + adds r1, r0, r3 + movs r0, 0 + strb r0, [r1] +_0804169A: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _08041708 + ldr r0, [r6] + adds r0, 0xDA + ldrb r0, [r0] + cmp r0, 0x2 + bne _08041708 + ldr r1, =0x02024084 + ldrh r0, [r1, 0x28] + cmp r0, 0 + beq _08041708 + adds r0, r1, 0 + adds r0, 0x80 + ldrh r0, [r0] + cmp r0, 0 + beq _08041708 + movs r4, 0 +_080416C6: + lsls r0, r4, 24 + lsrs r0, 24 + bl b_cancel_multi_turn_move_maybe + adds r4, 0x1 + cmp r4, 0x1 + ble _080416C6 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB8F3 + str r0, [r1] + bl b_call_bc_move_exec + ldr r0, =0x0202449c + ldr r1, [r0] + movs r4, 0xD0 + lsls r4, 1 + adds r1, r4 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08041664 + .pool +_08041708: + mov r7, r10 + ldr r0, [r7] + ldr r1, =0xfeffffdf + ands r0, r1 + str r0, [r7] + movs r0, 0 +_08041714: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8041364 + + thumb_func_start sub_8041728 +sub_8041728: @ 8041728 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08041770 + b _08041A0A + .pool +_08041744: + ldr r0, =gUnknown_082DA7C4 + bl b_call_bc_move_exec + ldr r0, [r5] + adds r0, 0x4D + movs r1, 0x2 + b _08041764 + .pool +_08041758: + ldr r0, =gUnknown_082DA7CD + bl b_call_bc_move_exec + ldr r0, [r5] + adds r0, 0x4D + movs r1, 0x5 +_08041764: + strb r1, [r0] +_08041766: + movs r0, 0x1 + b _08041A0C + .pool +_08041770: + ldr r0, =0x0202449c + mov r8, r0 +_08041774: + mov r1, r8 + ldr r0, [r1] + adds r0, 0x4D + ldrb r0, [r0] + cmp r0, 0x7 + bls _08041782 + b _080419FC +_08041782: + lsls r0, 2 + ldr r1, =_08041794 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08041794: + .4byte _080417B4 + .4byte _08041806 + .4byte _080418A0 + .4byte _080418E2 + .4byte _080418F6 + .4byte _08041960 + .4byte _08041994 + .4byte _080419FC +_080417B4: + mov r4, r8 + ldr r0, [r4] + adds r0, 0x4E + movs r1, 0 + strb r1, [r0] + ldr r1, [r4] + adds r1, 0x4D + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r5, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r5, r0 + bge _08041806 + ldr r6, =0x02024210 +_080417D4: + ldrb r0, [r6] + ldr r2, =gUnknown_0832A328 + lsls r1, r5, 2 + adds r1, r2 + ldr r4, [r1] + ands r0, r4 + cmp r0, 0 + beq _080417FC + lsls r0, r5, 24 + lsrs r0, 24 + movs r1, 0x6 + movs r2, 0x6 + bl sub_80423F4 + lsls r0, 24 + cmp r0, 0 + bne _080417FC + ldrb r0, [r6] + bics r0, r4 + strb r0, [r6] +_080417FC: + adds r5, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r5, r0 + blt _080417D4 +_08041806: + ldr r0, =0x0202449c + mov r8, r0 + ldr r1, =0x0202420d + mov r12, r1 + ldr r2, =0x0202420c + mov r5, r8 + ldr r7, =0x02024084 + ldr r6, =0x0202406e +_08041816: + ldr r3, [r5] + adds r1, r3, 0 + adds r1, 0x4E + ldrb r0, [r1] + strb r0, [r2] + mov r4, r12 + strb r0, [r4] + ldrb r4, [r1] + movs r0, 0x58 + muls r0, r4 + adds r0, r7 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _0804185E + adds r0, r3, 0 + adds r0, 0xDF + ldrb r1, [r0] + ldr r3, =gUnknown_0832A328 + lsls r0, r4, 1 + adds r0, r6 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0804185E + ldr r0, =0x02024210 + ldrb r1, [r0] + lsls r0, r4, 2 + adds r0, r3 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0804185E + b _08041744 +_0804185E: + ldr r0, [r5] + adds r0, 0x4E + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + ldr r0, =0x0202406c + lsls r1, 24 + lsrs r1, 24 + ldrb r0, [r0] + cmp r1, r0 + bne _08041816 + mov r1, r8 + ldr r0, [r1] + adds r0, 0x4D + movs r1, 0x3 + strb r1, [r0] + b _080419FC + .pool +_080418A0: + ldr r0, =0x0202420d + ldrb r0, [r0] + bl sub_803F9EC + ldr r2, =0x0202449c + ldr r1, [r2] + adds r1, 0x4E + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bne _080418D8 + ldr r0, [r2] + adds r0, 0x4D + movs r1, 0x3 + strb r1, [r0] + b _080419FA + .pool +_080418D8: + ldr r0, [r2] + adds r0, 0x4D + movs r1, 0x1 + strb r1, [r0] + b _080419FA +_080418E2: + mov r4, r8 + ldr r0, [r4] + adds r0, 0x4E + movs r1, 0 + strb r1, [r0] + ldr r1, [r4] + adds r1, 0x4D + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080418F6: + ldr r0, =0x0202420d + mov r12, r0 + ldr r7, =0x0202420c + ldr r5, =0x0202449c + ldr r2, =0x02024084 + ldr r6, =gUnknown_0832A328 +_08041902: + ldr r0, [r5] + adds r4, r0, 0 + adds r4, 0x4E + ldrb r0, [r4] + strb r0, [r7] + mov r1, r12 + strb r0, [r1] + ldrb r3, [r4] + movs r0, 0x58 + muls r0, r3 + adds r0, r2 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _08041930 + ldr r0, =0x02024210 + ldrb r1, [r0] + lsls r0, r3, 2 + adds r0, r6 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08041930 + b _08041758 +_08041930: + adds r0, r3, 0x1 + strb r0, [r4] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bne _08041902 + b _08041978 + .pool +_08041960: + mov r1, r8 + ldr r0, [r1] + adds r0, 0x4E + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + ldr r0, =0x0202406c + lsls r1, 24 + lsrs r1, 24 + ldrb r0, [r0] + cmp r1, r0 + bne _08041988 +_08041978: + mov r4, r8 + ldr r0, [r4] + adds r0, 0x4D + movs r1, 0x6 + strb r1, [r0] + b _080419FC + .pool +_08041988: + mov r1, r8 + ldr r0, [r1] + adds r0, 0x4D + movs r1, 0x4 + strb r1, [r0] + b _080419FC +_08041994: + movs r0, 0 + str r0, [sp] + movs r0, 0x9 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _080419AE + b _08041766 +_080419AE: + str r0, [sp] + movs r0, 0xB + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _080419C4 + b _08041766 +_080419C4: + movs r0, 0x1 + movs r1, 0 + movs r2, 0x1 + bl berry_effects_maybe + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _080419D8 + b _08041766 +_080419D8: + str r0, [sp] + movs r0, 0x6 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _080419EE + b _08041766 +_080419EE: + ldr r2, =0x0202449c + ldr r1, [r2] + adds r1, 0x4D + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080419FA: + mov r8, r2 +_080419FC: + mov r4, r8 + ldr r0, [r4] + adds r0, 0x4D + ldrb r0, [r0] + cmp r0, 0x7 + beq _08041A0A + b _08041774 +_08041A0A: + movs r0, 0 +_08041A0C: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8041728 + + thumb_func_start b_clear_atk_up_if_hit_flag_unless_enraged +b_clear_atk_up_if_hit_flag_unless_enraged: @ 8041A1C + push {r4-r6,lr} + movs r3, 0 + ldr r0, =0x0202406c + adds r5, r0, 0 + ldrb r0, [r5] + cmp r3, r0 + bge _08041A54 + ldr r4, =0x02024274 + movs r6, 0x80 + lsls r6, 16 + ldr r2, =0x020240d4 +_08041A32: + ldr r1, [r2] + adds r0, r1, 0 + ands r0, r6 + cmp r0, 0 + beq _08041A48 + ldrh r0, [r4] + cmp r0, 0x63 + beq _08041A48 + ldr r0, =0xff7fffff + ands r1, r0 + str r1, [r2] +_08041A48: + adds r4, 0x2 + adds r2, 0x58 + adds r3, 0x1 + ldrb r0, [r5] + cmp r3, r0 + blt _08041A32 +_08041A54: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end b_clear_atk_up_if_hit_flag_unless_enraged + + thumb_func_start sub_8041A6C +sub_8041A6C: @ 8041A6C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + movs r0, 0 + mov r9, r0 + ldr r1, =0x02024478 + mov r10, r1 + ldr r2, =0x0202449c + mov r8, r2 + b _08041A9A + .pool +_08041A90: + mov r3, r9 + cmp r3, 0 + beq _08041A9A + bl _08042388 +_08041A9A: + mov r4, r8 + ldr r0, [r4] + ldr r7, =0x000001a3 + adds r0, r7 + ldrb r0, [r0] + cmp r0, 0xE + bls _08041AAC + bl _08042376 +_08041AAC: + lsls r0, 2 + ldr r1, =_08041AC0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08041AC0: + .4byte _08041AFC + .4byte _08041B48 + .4byte _08041C90 + .4byte _08041D50 + .4byte _08041DC4 + .4byte _08041E40 + .4byte _08041EB8 + .4byte _08041F38 + .4byte _08041FC0 + .4byte _08042028 + .4byte _08042114 + .4byte _08042194 + .4byte _08042234 + .4byte _0804231C + .4byte _08042376 +_08041AFC: + ldr r1, =0x02024084 + ldr r3, =0x0202420b + ldrb r2, [r3] + movs r0, 0x58 + muls r2, r0 + adds r1, 0x50 + adds r2, r1 + ldr r0, [r2] + ldr r1, =0xfdffffff + ands r0, r1 + str r0, [r2] + ldr r0, =0x020242ac + ldrb r2, [r3] + lsls r2, 2 + adds r2, r0 + ldr r0, [r2] + ldr r1, =0xffffbfff + ands r0, r1 + str r0, [r2] + mov r1, r8 + ldr r0, [r1] + ldr r2, =0x000001a3 + adds r1, r0, r2 + bl _08042370 + .pool +_08041B48: + ldr r7, =0x02024084 + ldr r4, =0x0202420b + ldrb r1, [r4] + movs r5, 0x58 + adds r0, r1, 0 + muls r0, r5 + adds r6, r7, 0 + adds r6, 0x4C + adds r0, r6 + ldr r0, [r0] + movs r3, 0x7 + mov r8, r3 + ands r0, r3 + cmp r0, 0 + bne _08041B68 + b _08041C6E +_08041B68: + adds r0, r1, 0 + bl sub_8050650 + lsls r0, 24 + cmp r0, 0 + beq _08041BC8 + ldrb r0, [r4] + adds r2, r0, 0 + muls r2, r5 + adds r2, r6 + ldr r0, [r2] + movs r1, 0x8 + negs r1, r1 + ands r0, r1 + str r0, [r2] + ldrb r0, [r4] + adds r2, r0, 0 + muls r2, r5 + adds r0, r7, 0 + adds r0, 0x50 + adds r2, r0 + ldr r0, [r2] + ldr r1, =0xf7ffffff + ands r0, r1 + str r0, [r2] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB220 + str r0, [r1] + movs r4, 0x2 + mov r9, r4 + b _08041C6E + .pool +_08041BC8: + ldrb r0, [r4] + adds r1, r0, 0 + muls r1, r5 + adds r0, r1, r7 + adds r0, 0x20 + ldrb r0, [r0] + movs r3, 0x1 + cmp r0, 0x30 + bne _08041BDC + movs r3, 0x2 +_08041BDC: + adds r2, r1, r6 + ldr r1, [r2] + adds r0, r1, 0 + mov r7, r8 + ands r0, r7 + cmp r0, r3 + bcs _08041BF4 + movs r0, 0x8 + negs r0, r0 + ands r1, r0 + str r1, [r2] + b _08041BF8 +_08041BF4: + subs r0, r1, r3 + str r0, [r2] +_08041BF8: + ldr r2, =0x02024084 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + muls r1, r0 + adds r0, r2, 0 + adds r0, 0x4C + adds r0, r1, r0 + ldr r4, [r0] + movs r0, 0x7 + ands r4, r0 + cmp r4, 0 + beq _08041C50 + ldr r0, =0x020241ea + ldrh r0, [r0] + cmp r0, 0xAD + beq _08041C6E + cmp r0, 0xD6 + beq _08041C6E + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB213 + str r0, [r1] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 12 + orrs r0, r1 + str r0, [r2] + movs r0, 0x2 + mov r9, r0 + b _08041C6E + .pool +_08041C50: + adds r2, 0x50 + adds r2, r1, r2 + ldr r0, [r2] + ldr r1, =0xf7ffffff + ands r0, r1 + str r0, [r2] + bl b_movescr_stack_push_cursor + ldr r0, =0x02024332 + strb r4, [r0, 0x5] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB220 + str r0, [r1] + movs r1, 0x2 + mov r9, r1 +_08041C6E: + ldr r1, =0x0202449c + ldr r0, [r1] + ldr r3, =0x000001a3 + adds r2, r0, r3 + b _0804216A + .pool +_08041C90: + ldr r1, =0x02024084 + ldr r7, =0x0202420b + ldrb r0, [r7] + movs r6, 0x58 + muls r0, r6 + adds r5, r1, 0 + adds r5, 0x4C + adds r0, r5 + ldr r0, [r0] + movs r1, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08041D30 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x5 + bl __umodsi3 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _08041D08 + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0x7D + bne _08041CD6 + b _08042162 +_08041CD6: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB26A + str r0, [r1] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 2 + orrs r0, r1 + str r0, [r2] + b _08041D28 + .pool +_08041D08: + ldrb r0, [r7] + adds r2, r0, 0 + muls r2, r6 + adds r2, r5 + ldr r0, [r2] + movs r1, 0x21 + negs r1, r1 + ands r0, r1 + str r0, [r2] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB277 + str r0, [r1] + ldr r0, =0x02024332 + strb r4, [r0, 0x5] +_08041D28: + movs r7, 0x2 + mov r9, r7 + ldr r0, =0x0202449c + mov r8, r0 +_08041D30: + mov r1, r8 + ldr r0, [r1] + ldr r2, =0x000001a3 + adds r1, r0, r2 + b _08042370 + .pool +_08041D50: + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x36 + beq _08041D66 + b _08042162 +_08041D66: + ldr r0, =0x020242bc + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x18] + lsls r0, 31 + cmp r0, 0 + bne _08041D7A + b _08042162 +_08041D7A: + adds r0, r2, 0 + bl b_cancel_multi_turn_move_maybe + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 12 + orrs r0, r1 + str r0, [r2] + ldr r1, =0x02024332 + movs r0, 0 + strb r0, [r1, 0x5] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB6AD + str r0, [r1] + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + b _0804215E + .pool +_08041DC4: + ldr r1, =0x02024084 + ldr r3, =0x0202420b + ldrb r2, [r3] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r2, r0, r1 + ldr r1, [r2] + movs r0, 0x80 + lsls r0, 15 + ands r0, r1 + cmp r0, 0 + beq _08041E10 + ldr r0, =0xffbfffff + ands r1, r0 + str r1, [r2] + ldr r2, =0x020242bc + ldrb r1, [r3] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strb r1, [r0, 0x19] + ldrb r0, [r3] + bl b_cancel_multi_turn_move_maybe + ldr r1, =0x02024214 + ldr r0, =gUnknown_082D9462 + str r0, [r1] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 12 + orrs r0, r1 + str r0, [r2] + movs r7, 0x1 + mov r9, r7 +_08041E10: + ldr r1, =0x0202449c + ldr r0, [r1] + ldr r3, =0x000001a3 + adds r2, r0, r3 + b _0804216A + .pool +_08041E40: + ldr r1, =0x02024084 + ldr r3, =0x0202420b + ldrb r2, [r3] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r2, r0, r1 + ldr r1, [r2] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08041E8C + movs r0, 0x9 + negs r0, r0 + ands r1, r0 + str r1, [r2] + ldr r0, =0x0202433c + ldrb r2, [r3] + lsls r2, 4 + adds r2, r0 + ldrb r0, [r2, 0x2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0x2] + ldrb r0, [r3] + bl b_cancel_multi_turn_move_maybe + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB29B + str r0, [r1] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 12 + orrs r0, r1 + str r0, [r2] + movs r4, 0x1 + mov r9, r4 +_08041E8C: + ldr r1, =0x0202449c + ldr r0, [r1] + ldr r7, =0x000001a3 + adds r2, r0, r7 + b _0804216A + .pool +_08041EB8: + ldr r0, =0x020242bc + ldr r3, =0x0202420b + ldrb r2, [r3] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldr r0, =0x020241ea + ldrh r1, [r1, 0x4] + ldrh r0, [r0] + cmp r1, r0 + bne _08041F04 + cmp r1, 0 + beq _08041F04 + ldr r0, =0x0202433c + lsls r2, 4 + adds r2, r0 + ldrb r0, [r2, 0x1] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x1] + ldr r1, =0x02024474 + ldrb r0, [r3] + strb r0, [r1, 0x17] + ldrb r0, [r3] + bl b_cancel_multi_turn_move_maybe + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAE14 + str r0, [r1] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 12 + orrs r0, r1 + str r0, [r2] + movs r0, 0x1 + mov r9, r0 +_08041F04: + ldr r1, =0x0202449c + ldr r0, [r1] + ldr r3, =0x000001a3 + adds r2, r0, r3 + b _0804216A + .pool +_08041F38: + ldr r0, =0x020242bc + ldr r4, =0x0202420b + ldrb r3, [r4] + lsls r1, r3, 3 + subs r1, r3 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x13] + lsls r0, 28 + cmp r0, 0 + beq _08041F8C + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0 + bne _08041F8C + ldr r0, =0x0202433c + lsls r2, r3, 4 + adds r2, r0 + ldrb r0, [r2, 0x2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x2] + ldrb r0, [r4] + bl b_cancel_multi_turn_move_maybe + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB0A4 + str r0, [r1] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 12 + orrs r0, r1 + str r0, [r2] + movs r4, 0x1 + mov r9, r4 +_08041F8C: + ldr r1, =0x0202449c + ldr r0, [r1] + ldr r7, =0x000001a3 + adds r2, r0, r7 + b _0804216A + .pool +_08041FC0: + ldr r4, =0x0202420b + ldrb r0, [r4] + ldr r1, =0x020241ea + ldrh r1, [r1] + bl sub_8040130 + lsls r0, 24 + cmp r0, 0 + beq _08041FFE + ldr r0, =0x0202433c + ldrb r2, [r4] + lsls r2, 4 + adds r2, r0 + ldrb r0, [r2, 0x1] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r2, 0x1] + ldrb r0, [r4] + bl b_cancel_multi_turn_move_maybe + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB176 + str r0, [r1] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 12 + orrs r0, r1 + str r0, [r2] + movs r0, 0x1 + mov r9, r0 +_08041FFE: + ldr r1, =0x0202449c + ldr r0, [r1] + ldr r3, =0x000001a3 + adds r2, r0, r3 + b _0804216A + .pool +_08042028: + ldr r7, =0x02024084 + ldr r5, =0x0202420b + ldrb r0, [r5] + movs r6, 0x58 + muls r0, r6 + adds r4, r7, 0 + adds r4, 0x50 + adds r2, r0, r4 + ldr r1, [r2] + movs r3, 0x7 + adds r0, r1, 0 + ands r0, r3 + cmp r0, 0 + beq _080420FA + subs r0, r1, 0x1 + str r0, [r2] + ldrb r0, [r5] + muls r0, r6 + adds r0, r4 + ldr r0, [r0] + ands r0, r3 + cmp r0, 0 + beq _080420E8 + bl GenerateRandomNumber + movs r1, 0x1 + movs r2, 0x1 + ands r2, r0 + cmp r2, 0 + beq _0804207C + ldr r1, =0x02024332 + movs r0, 0 + strb r0, [r1, 0x5] + bl b_movescr_stack_push_cursor + b _080420C6 + .pool +_0804207C: + ldr r0, =0x02024332 + movs r4, 0x1 + strb r1, [r0, 0x5] + ldr r1, =0x0202420c + ldrb r0, [r5] + strb r0, [r1] + ldrb r0, [r5] + adds r1, r0, 0 + muls r1, r6 + adds r1, r7 + movs r0, 0x28 + str r0, [sp] + str r2, [sp, 0x4] + ldrb r0, [r5] + str r0, [sp, 0x8] + ldrb r0, [r5] + str r0, [sp, 0xC] + adds r0, r1, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_806957C + ldr r1, =0x020241f0 + str r0, [r1] + ldr r0, =0x0202433c + ldrb r1, [r5] + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1, 0x1] + orrs r0, r4 + strb r0, [r1, 0x1] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 12 + orrs r0, r1 + str r0, [r2] +_080420C6: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB2BD + b _080420F0 + .pool +_080420E8: + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB300 +_080420F0: + str r0, [r1] + movs r4, 0x1 + mov r9, r4 + ldr r7, =0x0202449c + mov r8, r7 +_080420FA: + mov r1, r8 + ldr r0, [r1] + ldr r2, =0x000001a3 + adds r1, r0, r2 + b _08042370 + .pool +_08042114: + ldr r1, =0x02024084 + ldr r4, =0x0202420b + ldrb r2, [r4] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08042162 + bl GenerateRandomNumber + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + cmp r1, 0 + bne _08042162 + ldr r0, =0x0202433c + ldrb r2, [r4] + lsls r2, 4 + adds r2, r0 + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB28B + str r0, [r1] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 12 + orrs r0, r1 + str r0, [r2] +_0804215E: + movs r3, 0x1 + mov r9, r3 +_08042162: + ldr r1, =0x0202449c + ldr r0, [r1] + ldr r4, =0x000001a3 + adds r2, r0, r4 +_0804216A: + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + mov r8, r1 + b _08042376 + .pool +_08042194: + ldr r1, =0x02024084 + ldr r4, =0x0202420b + ldrb r2, [r4] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r1, [r0] + movs r0, 0xF0 + lsls r0, 12 + ands r1, r0 + cmp r1, 0 + beq _0804220E + lsrs r0, r1, 16 + bl sub_806F8A8 + ldr r1, =0x02024474 + strb r0, [r1, 0x17] + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _080421D8 + bl b_movescr_stack_push_cursor + b _08042200 + .pool +_080421D8: + ldr r0, =gUnknown_082DB334 + bl b_movescr_stack_push + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 12 + orrs r0, r1 + str r0, [r2] + ldr r0, =0x0202433c + ldrb r2, [r4] + lsls r2, 4 + adds r2, r0 + ldrb r0, [r2, 0x1] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2, 0x1] + ldrb r0, [r4] + bl b_cancel_multi_turn_move_maybe +_08042200: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB327 + str r0, [r1] + movs r7, 0x1 + mov r9, r7 + ldr r0, =0x0202449c + mov r8, r0 +_0804220E: + mov r1, r8 + ldr r0, [r1] + ldr r2, =0x000001a3 + adds r1, r0, r2 + b _08042370 + .pool +_08042234: + ldr r1, =0x02024084 + ldr r6, =0x0202420b + ldrb r0, [r6] + movs r5, 0x58 + muls r0, r5 + adds r1, 0x50 + adds r3, r0, r1 + ldr r2, [r3] + movs r4, 0xC0 + lsls r4, 2 + adds r0, r2, 0 + ands r0, r4 + cmp r0, 0 + beq _08042306 + ldr r7, =0xffffff00 + adds r0, r2, r7 + str r0, [r3] + ldrb r2, [r6] + adds r0, r2, 0 + muls r0, r5 + adds r0, r1 + ldr r0, [r0] + ands r0, r4 + cmp r0, 0 + beq _08042280 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAD71 + b _08042300 + .pool +_08042280: + ldr r3, =0x020241f8 + lsls r0, r2, 2 + adds r0, r3 + ldr r0, [r0] + cmp r0, 0 + beq _080422FC + ldr r1, =0x020241ea + movs r0, 0x75 + strh r0, [r1] + ldrb r0, [r6] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + lsls r0, 1 + mov r1, r10 + str r0, [r1] + ldr r4, =0x0202420c + ldr r1, =0x02024288 + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r4] + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _080422CA + movs r0, 0x75 + movs r1, 0x1 + bl sub_80458E0 + strb r0, [r4] +_080422CA: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAD7C + str r0, [r1] + ldr r2, =0x0202449c + mov r8, r2 + b _08042302 + .pool +_080422FC: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DADC4 +_08042300: + str r0, [r1] +_08042302: + movs r3, 0x1 + mov r9, r3 +_08042306: + mov r4, r8 + ldr r0, [r4] + ldr r7, =0x000001a3 + adds r1, r0, r7 + b _08042370 + .pool +_0804231C: + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x4C + adds r4, r0, r1 + ldr r3, [r4] + movs r0, 0x20 + ands r0, r3 + cmp r0, 0 + beq _08042368 + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0x7D + bne _08042360 + movs r0, 0x21 + negs r0, r0 + ands r3, r0 + str r3, [r4] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB277 + str r0, [r1] + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] +_08042360: + movs r0, 0x2 + mov r9, r0 + ldr r1, =0x0202449c + mov r8, r1 +_08042368: + mov r2, r8 + ldr r0, [r2] + ldr r3, =0x000001a3 + adds r1, r0, r3 +_08042370: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_08042376: + mov r4, r8 + ldr r0, [r4] + ldr r7, =0x000001a3 + adds r0, r7 + ldrb r0, [r0] + cmp r0, 0xE + beq _08042388 + bl _08041A90 +_08042388: + mov r0, r9 + cmp r0, 0x2 + bne _080423B4 + ldr r4, =0x02024064 + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r4] + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 + ldr r1, =0x020240d0 + adds r0, r1 + str r0, [sp] + movs r0, 0 + movs r1, 0x28 + movs r2, 0 + movs r3, 0x4 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_080423B4: + mov r0, r9 + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8041A6C + + thumb_func_start sub_80423F4 +sub_80423F4: @ 80423F4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08042424 + movs r0, 0 + b _080426A0 + .pool +_08042424: + movs r0, 0x80 + lsls r0, 15 + ands r0, r1 + cmp r0, 0 + beq _0804249C + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + ldr r1, =0x02024744 + mov r8, r1 + cmp r0, 0 + bne _08042442 + ldr r2, =0x020244ec + mov r8, r2 +_08042442: + movs r0, 0x2 + ands r0, r4 + lsls r0, 24 + lsrs r6, r0, 25 + lsls r0, r6, 1 + adds r4, r0, r6 + adds r0, r4, 0x3 + cmp r4, r0 + bge _0804248C + adds r7, r0, 0 +_08042456: + movs r0, 0x64 + muls r0, r4 + mov r1, r8 + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _08042486 + adds r0, r5, 0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + beq _08042486 + adds r0, r5, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + bne _0804248C +_08042486: + adds r4, 0x1 + cmp r4, r7 + blt _08042456 +_0804248C: + movs r1, 0 + lsls r0, r6, 1 + adds r0, r6 + b _08042556 + .pool +_0804249C: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0804256C + movs r0, 0x80 + lsls r0, 16 + ands r1, r0 + cmp r1, 0 + beq _080424E4 + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080424D0 + ldr r2, =0x020244ec + mov r8, r2 + adds r0, r4, 0 + bl sub_806D864 + lsls r0, 24 + lsrs r7, r0, 24 + b _08042502 + .pool +_080424D0: + ldr r0, =0x02024744 + mov r8, r0 + movs r1, 0x1 + eors r1, r4 + negs r0, r1 + orrs r0, r1 + lsrs r6, r0, 31 + b _0804250C + .pool +_080424E4: + adds r0, r4, 0 + bl sub_806D864 + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + ldr r1, =0x02024744 + mov r8, r1 + cmp r0, 0 + bne _08042502 + ldr r2, =0x020244ec + mov r8, r2 +_08042502: + adds r0, r7, 0 + bl sub_806D82C + lsls r0, 24 + lsrs r6, r0, 24 +_0804250C: + lsls r0, r6, 1 + adds r4, r0, r6 + adds r1, r4, 0x3 + mov r9, r0 + cmp r4, r1 + bge _08042550 + adds r7, r1, 0 +_0804251A: + movs r0, 0x64 + muls r0, r4 + mov r1, r8 + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _0804254A + adds r0, r5, 0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + beq _0804254A + adds r0, r5, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + bne _08042550 +_0804254A: + adds r4, 0x1 + cmp r4, r7 + blt _0804251A +_08042550: + movs r1, 0 + mov r2, r9 + adds r0, r2, r6 +_08042556: + adds r0, 0x3 + cmp r4, r0 + bne _0804255E + movs r1, 0x1 +_0804255E: + adds r0, r1, 0 + b _080426A0 + .pool +_0804256C: + movs r0, 0x80 + lsls r0, 8 + ands r1, r0 + cmp r1, 0 + beq _080425DA + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080425DA + ldr r0, =0x02024744 + mov r8, r0 + movs r6, 0x3 + cmp r4, 0x1 + bne _08042590 + movs r6, 0 +_08042590: + adds r4, r6, 0 + adds r6, r4, 0x3 + b _0804259E + .pool +_0804259C: + adds r4, 0x1 +_0804259E: + cmp r4, r6 + bge _080425D2 + movs r0, 0x64 + muls r0, r4 + mov r1, r8 + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _0804259C + adds r0, r5, 0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + beq _0804259C + adds r0, r5, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _0804259C +_080425D2: + movs r0, 0 + cmp r4, r6 + bne _080426A0 + b _0804269E +_080425DA: + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08042608 + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r7, r0, 24 + movs r0, 0x3 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r6, r0, 24 + ldr r2, =0x02024744 + mov r8, r2 + b _08042620 + .pool +_08042608: + movs r0, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r7, r0, 24 + movs r0, 0x2 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x020244ec + mov r8, r0 +_08042620: + mov r1, r10 + cmp r1, 0x6 + bne _08042630 + ldr r1, =0x0202406e + lsls r0, r7, 1 + adds r0, r1 + ldrb r0, [r0] + mov r10, r0 +_08042630: + mov r2, r9 + cmp r2, 0x6 + bne _08042640 + ldr r1, =0x0202406e + lsls r0, r6, 1 + adds r0, r1 + ldrb r0, [r0] + mov r9, r0 +_08042640: + movs r4, 0 +_08042642: + movs r0, 0x64 + muls r0, r4 + mov r1, r8 + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _08042692 + adds r0, r5, 0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + beq _08042692 + adds r0, r5, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _08042692 + cmp r4, r10 + beq _08042692 + cmp r4, r9 + beq _08042692 + ldr r0, =0x0202449c + ldr r1, [r0] + adds r0, r7, r1 + adds r0, 0x5C + ldrb r0, [r0] + cmp r4, r0 + beq _08042692 + adds r0, r6, r1 + adds r0, 0x5C + ldrb r0, [r0] + cmp r4, r0 + bne _08042698 +_08042692: + adds r4, 0x1 + cmp r4, 0x5 + ble _08042642 +_08042698: + movs r0, 0 + cmp r4, 0x6 + bne _080426A0 +_0804269E: + movs r0, 0x1 +_080426A0: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80423F4 + + thumb_func_start castform_switch +castform_switch: @ 80426BC + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r6 + adds r4, r0, r1 + ldrh r1, [r4] + ldr r0, =0x00000181 + cmp r1, r0 + bne _08042760 + adds r0, r4, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x3B + bne _08042760 + ldrh r0, [r4, 0x28] + cmp r0, 0 + beq _08042760 + str r5, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0xD + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + bne _0804270E + str r5, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0x4D + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _08042734 +_0804270E: + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0 + beq _08042734 + adds r1, r4, 0 + adds r1, 0x22 + ldrb r0, [r1] + cmp r0, 0 + beq _08042734 + strb r5, [r2] + strb r5, [r1] + movs r0, 0x1 + b _08042818 + .pool +_08042734: + movs r0, 0 + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0xD + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08042760 + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0x4D + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _08042764 +_08042760: + movs r0, 0 + b _08042818 +_08042764: + ldr r1, =0x020243cc + ldrh r0, [r1] + movs r2, 0xE7 + ands r2, r0 + adds r4, r1, 0 + cmp r2, 0 + bne _08042792 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r6 + adds r1, r0, r1 + adds r3, r1, 0 + adds r3, 0x21 + ldrb r0, [r3] + cmp r0, 0 + beq _08042792 + adds r1, 0x22 + ldrb r0, [r1] + cmp r0, 0 + beq _08042792 + strb r2, [r3] + strb r2, [r1] + movs r5, 0x1 +_08042792: + ldrh r1, [r4] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _080427BE + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r6 + adds r1, r0, r1 + adds r2, r1, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0xA + beq _080427BE + adds r1, 0x22 + ldrb r0, [r1] + cmp r0, 0xA + beq _080427BE + movs r0, 0xA + strb r0, [r2] + strb r0, [r1] + movs r5, 0x2 +_080427BE: + ldrh r1, [r4] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + beq _080427EA + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r6 + adds r1, r0, r1 + adds r2, r1, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0xB + beq _080427EA + adds r1, 0x22 + ldrb r0, [r1] + cmp r0, 0xB + beq _080427EA + movs r0, 0xB + strb r0, [r2] + strb r0, [r1] + movs r5, 0x3 +_080427EA: + ldrh r1, [r4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08042816 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r6 + adds r1, r0, r1 + adds r2, r1, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0xF + beq _08042816 + adds r1, 0x22 + ldrb r0, [r1] + cmp r0, 0xF + beq _08042816 + movs r0, 0xF + strb r0, [r2] + strb r0, [r1] + movs r5, 0x4 +_08042816: + adds r0, r5, 0 +_08042818: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end castform_switch + + thumb_func_start ability_something +ability_something: @ 8042828 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + ldr r4, [sp, 0x48] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r6, r2, 24 + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0 + mov r9, r0 + ldr r5, =0x0202420b + ldr r1, =0x0202406c + ldrb r0, [r5] + ldrb r1, [r1] + cmp r0, r1 + bcc _08042864 + mov r1, r10 + strb r1, [r5] +_08042864: + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08042894 + ldr r1, =0x0202406e + ldrb r0, [r5] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + b _080428A4 + .pool +_08042894: + ldr r1, =0x0202406e + ldrb r0, [r5] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 +_080428A4: + adds r7, r1, r0 + ldr r5, =0x0202420c + ldr r1, =0x0202406c + ldrb r0, [r5] + ldrb r1, [r1] + cmp r0, r1 + bcc _080428B6 + mov r2, r10 + strb r2, [r5] +_080428B6: + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080428E8 + ldr r1, =0x0202406e + ldrb r0, [r5] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + b _080428F8 + .pool +_080428E8: + ldr r1, =0x0202406e + ldrb r0, [r5] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 +_080428F8: + adds r5, r1, r0 + adds r0, r7, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x8] + adds r0, r7, 0 + movs r1, 0 + bl pokemon_getattr + str r0, [sp, 0x10] + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0xC] + adds r0, r5, 0 + movs r1, 0 + bl pokemon_getattr + str r0, [sp, 0x14] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0804293A + bl _0804443A +_0804293A: + mov r3, r8 + cmp r3, 0 + beq _08042958 + ldr r0, =0x0202420a + strb r3, [r0] + adds r7, r0, 0 + b _0804296E + .pool +_08042958: + ldr r2, =0x0202420a + ldr r1, =0x02024084 + movs r0, 0x58 + mov r5, r10 + muls r5, r0 + adds r0, r5, 0 + adds r0, r1 + adds r0, 0x20 + ldrb r0, [r0] + strb r0, [r2] + adds r7, r2, 0 +_0804296E: + cmp r4, 0 + beq _08042980 + adds r5, r4, 0 + b _08042984 + .pool +_08042980: + ldr r0, =0x020241ea + ldrh r5, [r0] +_08042984: + ldr r1, =0x0202449c + ldr r0, [r1] + ldrb r0, [r0, 0x13] + mov r8, r1 + cmp r0, 0 + beq _080429A0 + movs r3, 0x3F + ands r3, r0 + b _080429AC + .pool +_080429A0: + ldr r1, =gBattleMoves + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r3, [r0, 0x2] +_080429AC: + ldr r0, [sp, 0x4] + cmp r0, 0x13 + bls _080429B6 + bl _0804441E +_080429B6: + lsls r0, 2 + ldr r1, =_080429C8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080429C8: + .4byte _08042A18 + .4byte _08042CDC + .4byte _08042EF8 + .4byte _08042F8C + .4byte _080431AC + .4byte _08043908 + .4byte _08043C6C + .4byte _08043CBC + .4byte _08043D40 + .4byte _08043DC4 + .4byte _08043FE4 + .4byte _08043E08 + .4byte _08044028 + .4byte _08044084 + .4byte _080440E0 + .4byte _080441DC + .4byte _08044220 + .4byte _0804427C + .4byte _080443EC + .4byte _08044196 +_08042A18: + ldr r2, =0x0202420b + ldr r0, =0x0202406c + ldrb r1, [r2] + adds r5, r0, 0 + ldrb r3, [r5] + cmp r1, r3 + bcc _08042A2A + mov r0, r10 + strb r0, [r2] +_08042A2A: + ldrb r0, [r7] + cmp r0, 0x2D + bne _08042A32 + b _08042BA8 +_08042A32: + cmp r0, 0x2D + bgt _08042A64 + cmp r0, 0xD + bne _08042A3C + b _08042CA4 +_08042A3C: + cmp r0, 0xD + bgt _08042A54 + cmp r0, 0x2 + bne _08042A46 + b _08042B78 +_08042A46: + bl _0804441E + .pool +_08042A54: + cmp r0, 0x16 + bne _08042A5A + b _08042C08 +_08042A5A: + cmp r0, 0x24 + bne _08042A60 + b _08042C68 +_08042A60: + bl _0804441E +_08042A64: + cmp r0, 0x46 + bne _08042A6A + b _08042BD8 +_08042A6A: + cmp r0, 0x46 + bgt _08042A78 + cmp r0, 0x3B + bne _08042A74 + b _08042C3C +_08042A74: + bl _0804441E +_08042A78: + cmp r0, 0x4D + bne _08042A7E + b _08042CA4 +_08042A7E: + cmp r0, 0xFF + beq _08042A86 + bl _0804441E +_08042A86: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + bne _08042B4C + bl weather_get_current + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x3 + cmp r0, 0xA + bhi _08042B4C + lsls r0, 2 + ldr r1, =_08042AB4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08042AB4: + .4byte _08042AE0 + .4byte _08042B4C + .4byte _08042AE0 + .4byte _08042B4C + .4byte _08042B4C + .4byte _08042B04 + .4byte _08042B4C + .4byte _08042B4C + .4byte _08042B4C + .4byte _08042B28 + .4byte _08042AE0 +_08042AE0: + ldr r2, =0x020243cc + ldrh r1, [r2] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + bne _08042B4C + movs r0, 0x5 + strh r0, [r2] + ldr r1, =0x02024474 + movs r0, 0xA + strb r0, [r1, 0x10] + mov r2, r10 + strb r2, [r1, 0x17] + b _08042B42 + .pool +_08042B04: + ldr r3, =0x020243cc + ldrh r1, [r3] + movs r2, 0x18 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _08042B4C + strh r2, [r3] + ldr r1, =0x02024474 + movs r0, 0xC + strb r0, [r1, 0x10] + mov r3, r10 + strb r3, [r1, 0x17] + b _08042B42 + .pool +_08042B28: + ldr r3, =0x020243cc + ldrh r1, [r3] + movs r2, 0x60 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _08042B4C + strh r2, [r3] + ldr r1, =0x02024474 + movs r0, 0xB + strb r0, [r1, 0x10] + mov r5, r10 + strb r5, [r1, 0x17] +_08042B42: + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_08042B4C: + mov r0, r9 + cmp r0, 0 + bne _08042B56 + bl _0804443A +_08042B56: + bl weather_get_current + ldr r1, =0x02024332 + strb r0, [r1, 0x5] + ldr r0, =gUnknown_082DACE7 + bl b_push_move_exec + bl _0804441E + .pool +_08042B78: + ldr r2, =0x020243cc + ldrh r1, [r2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08042B88 + bl _0804441E +_08042B88: + movs r0, 0x5 + strh r0, [r2] + ldr r0, =gUnknown_082DB430 + bl b_push_move_exec + ldr r0, =0x02024474 + mov r1, r10 + strb r1, [r0, 0x17] + bl _080443D0 + .pool +_08042BA8: + ldr r2, =0x020243cc + ldrh r1, [r2] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08042BB8 + bl _0804441E +_08042BB8: + movs r0, 0x18 + strh r0, [r2] + ldr r0, =gUnknown_082DB470 + bl b_push_move_exec + ldr r0, =0x02024474 + mov r2, r10 + strb r2, [r0, 0x17] + bl _080443D0 + .pool +_08042BD8: + ldr r2, =0x020243cc + ldrh r1, [r2] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08042BE8 + bl _0804441E +_08042BE8: + movs r0, 0x60 + strh r0, [r2] + ldr r0, =gUnknown_082DB52A + bl b_push_move_exec + ldr r0, =0x02024474 + mov r3, r10 + strb r3, [r0, 0x17] + bl _080443D0 + .pool +_08042C08: + ldr r0, =0x0202437c + mov r5, r10 + lsls r2, r5, 2 + adds r1, r2, r5 + lsls r1, 2 + adds r3, r1, r0 + ldrb r0, [r3] + lsls r0, 28 + cmp r0, 0 + bge _08042C20 + bl _0804441E +_08042C20: + ldr r1, =0x020242ac + adds r1, r2, r1 + ldr r0, [r1] + movs r2, 0x80 + lsls r2, 12 + orrs r0, r2 + str r0, [r1] + ldrb r0, [r3] + movs r1, 0x8 + b _08042C92 + .pool +_08042C3C: + mov r0, r10 + bl castform_switch + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + cmp r0, 0 + bne _08042C50 + bl _0804443A +_08042C50: + ldr r0, =gUnknown_082DB4A9 + bl b_push_move_exec + ldr r0, =0x02024474 + mov r1, r10 + strb r1, [r0, 0x17] + bl _080442E2 + .pool +_08042C68: + ldr r0, =0x0202437c + mov r3, r10 + lsls r2, r3, 2 + adds r1, r2, r3 + lsls r1, 2 + adds r3, r1, r0 + ldrb r0, [r3] + lsls r0, 27 + cmp r0, 0 + bge _08042C80 + bl _0804441E +_08042C80: + ldr r1, =0x020242ac + adds r1, r2, r1 + ldr r0, [r1] + movs r2, 0x80 + lsls r2, 13 + orrs r0, r2 + str r0, [r1] + ldrb r0, [r3] + movs r1, 0x10 +_08042C92: + orrs r0, r1 + strb r0, [r3] + bl _0804441E + .pool +_08042CA4: + movs r6, 0 + ldrb r5, [r5] + cmp r6, r5 + bcc _08042CB0 + bl _0804441E +_08042CB0: + adds r0, r6, 0 + bl castform_switch + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + cmp r0, 0 + beq _08042CC4 + bl _080442D8 +_08042CC4: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r6, r0 + bcc _08042CB0 + bl _0804441E + .pool +_08042CDC: + ldr r5, =0x02024084 + mov r8, r5 + movs r0, 0x58 + mov r6, r10 + muls r6, r0 + adds r4, r6, r5 + ldrh r0, [r4, 0x28] + cmp r0, 0 + bne _08042CF2 + bl _0804441E +_08042CF2: + ldr r0, =0x0202420b + mov r1, r10 + strb r1, [r0] + ldrb r5, [r7] + cmp r5, 0x2C + beq _08042D22 + cmp r5, 0x2C + bgt _08042D14 + cmp r5, 0x3 + bne _08042D08 + b _08042E84 +_08042D08: + bl _0804441E + .pool +_08042D14: + cmp r5, 0x36 + bne _08042D1A + b _08042ED0 +_08042D1A: + cmp r5, 0x3D + beq _08042DA0 + bl _0804441E +_08042D22: + movs r0, 0 + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0xD + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _08042D3E + bl _0804441E +_08042D3E: + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0x4D + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _08042D56 + bl _0804441E +_08042D56: + ldr r0, =0x020243cc + ldrh r1, [r0] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + bne _08042D66 + bl _0804441E +_08042D66: + ldrh r0, [r4, 0x2C] + ldrh r2, [r4, 0x28] + cmp r0, r2 + bhi _08042D72 + bl _0804441E +_08042D72: + strb r5, [r7] + ldr r0, =gUnknown_082DB45C + bl b_push_move_exec + ldr r1, =0x020241f0 + ldrh r0, [r4, 0x2C] + lsrs r0, 4 + str r0, [r1] + cmp r0, 0 + bne _08042D8A + movs r0, 0x1 + str r0, [r1] +_08042D8A: + ldr r0, [r1] + negs r0, r0 + str r0, [r1] + bl _080443D0 + .pool +_08042DA0: + mov r0, r8 + adds r0, 0x4C + adds r5, r6, r0 + ldrb r0, [r5] + cmp r0, 0 + bne _08042DB0 + bl _0804441E +_08042DB0: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _08042DCA + bl _0804441E +_08042DCA: + ldr r0, [r5] + movs r1, 0x88 + ands r0, r1 + cmp r0, 0 + beq _08042DDC + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC70 + bl CopyString +_08042DDC: + ldr r0, [r5] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + beq _08042DEE + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC78 + bl CopyString +_08042DEE: + ldr r0, [r5] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08042E00 + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC80 + bl CopyString +_08042E00: + ldr r0, [r5] + movs r1, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08042E12 + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC88 + bl CopyString +_08042E12: + ldr r0, [r5] + movs r1, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08042E24 + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC90 + bl CopyString +_08042E24: + str r4, [r5] + mov r1, r8 + adds r1, 0x50 + adds r1, r6, r1 + ldr r0, [r1] + ldr r2, =0xf7ffffff + ands r0, r2 + str r0, [r1] + ldr r0, =0x02024474 + ldr r4, =0x02024064 + mov r3, r10 + strb r3, [r4] + strb r3, [r0, 0x17] + ldr r0, =gUnknown_082DB484 + bl b_push_move_exec + str r5, [sp] + movs r0, 0 + movs r1, 0x28 + movs r2, 0 + movs r3, 0x4 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + bl _080443D0 + .pool +_08042E84: + ldrb r2, [r4, 0x1B] + movs r0, 0x1B + ldrsb r0, [r4, r0] + cmp r0, 0xB + ble _08042E92 + bl _0804441E +_08042E92: + ldr r0, =0x020242bc + mov r5, r10 + lsls r1, r5, 3 + subs r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x16] + cmp r0, 0x2 + bne _08042EA8 + bl _0804441E +_08042EA8: + adds r0, r2, 0x1 + movs r1, 0 + strb r0, [r4, 0x1B] + ldr r4, =0x02024474 + movs r0, 0x11 + strb r0, [r4, 0x10] + strb r1, [r4, 0x11] + ldr r0, =gUnknown_082DB444 + bl b_push_move_exec + strb r5, [r4, 0x17] + bl _080443D0 + .pool +_08042ED0: + ldr r2, =0x020242bc + ldrb r0, [r0] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r3, [r1, 0x18] + lsls r0, r3, 31 + lsrs r0, 31 + movs r2, 0x1 + eors r2, r0 + movs r0, 0x2 + negs r0, r0 + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0x18] + bl _0804441E + .pool +_08042EF8: + ldrb r0, [r7] + cmp r0, 0x2B + beq _08042F02 + bl _0804441E +_08042F02: + movs r4, 0 + ldr r0, =gUnknown_0831BCF8 + ldrh r2, [r0] + ldr r3, =0x0000ffff + adds r1, r0, 0 + cmp r2, r3 + bne _08042F14 + bl _0804441E +_08042F14: + cmp r2, r5 + beq _08042F2C + adds r2, r1, 0 +_08042F1A: + adds r2, 0x2 + adds r4, 0x1 + ldrh r0, [r2] + cmp r0, r3 + bne _08042F28 + bl _0804441E +_08042F28: + cmp r0, r5 + bne _08042F1A +_08042F2C: + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _08042F3C + bl _0804441E +_08042F3C: + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 5 + ands r0, r1 + cmp r0, 0 + beq _08042F62 + ldr r0, =0x02024280 + ldr r1, [r0] + movs r2, 0x80 + lsls r2, 4 + orrs r1, r2 + str r1, [r0] +_08042F62: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB61F + str r0, [r1] + movs r0, 0x1 + mov r9, r0 + bl _08044424 + .pool +_08042F8C: + cmp r5, 0 + bne _08042F94 + bl _0804441E +_08042F94: + ldrb r0, [r7] + cmp r0, 0xB + beq _08043004 + cmp r0, 0xB + bgt _08042FA4 + cmp r0, 0xA + beq _08042FAA + b _08043126 +_08042FA4: + cmp r0, 0x12 + beq _0804305C + b _08043126 +_08042FAA: + cmp r3, 0xD + beq _08042FB0 + b _08043126 +_08042FB0: + ldr r0, =gBattleMoves + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + cmp r0, 0 + bne _08042FC2 + b _08043126 +_08042FC2: + ldr r1, =0x0202433c + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x2] + lsls r0, 28 + cmp r0, 0 + bge _08042FF0 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB56F + b _08042FF4 + .pool +_08042FF0: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB56E +_08042FF4: + str r0, [r1] + movs r1, 0x1 + b _08043124 + .pool +_08043004: + cmp r3, 0xB + beq _0804300A + b _08043126 +_0804300A: + ldr r0, =gBattleMoves + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + cmp r0, 0 + bne _0804301C + b _08043126 +_0804301C: + ldr r1, =0x0202433c + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x2] + lsls r0, 28 + cmp r0, 0 + bge _08043048 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB56F + b _0804304C + .pool +_08043048: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB56E +_0804304C: + str r0, [r1] + movs r2, 0x1 + mov r9, r2 + b _08043126 + .pool +_0804305C: + cmp r3, 0xA + bne _08043126 + ldr r1, =0x02024084 + movs r0, 0x58 + mov r3, r10 + muls r3, r0 + adds r0, r3, 0 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x20 + ands r0, r1 + cmp r0, 0 + bne _08043126 + ldr r2, =0x020244a8 + ldr r0, [r2] + ldr r0, [r0, 0x4] + mov r5, r10 + lsls r1, r5, 2 + adds r0, r1 + ldr r3, [r0] + movs r4, 0x1 + ands r3, r4 + adds r5, r1, 0 + cmp r3, 0 + bne _080430EC + ldr r0, =0x02024332 + strb r3, [r0, 0x5] + ldr r1, =0x0202433c + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x2] + lsls r0, 28 + cmp r0, 0 + bge _080430C8 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB5A8 + b _080430CC + .pool +_080430C8: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB5A7 +_080430CC: + str r0, [r1] + ldr r0, [r2] + ldr r1, [r0, 0x4] + adds r1, r5 + ldr r0, [r1] + movs r2, 0x1 + orrs r0, r2 + str r0, [r1] + movs r0, 0x2 + mov r9, r0 + b _08043126 + .pool +_080430EC: + ldr r0, =0x02024332 + strb r4, [r0, 0x5] + ldr r1, =0x0202433c + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x2] + lsls r0, 28 + cmp r0, 0 + bge _0804311C + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB5A8 + b _08043120 + .pool +_0804311C: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB5A7 +_08043120: + str r0, [r1] + movs r1, 0x2 +_08043124: + mov r9, r1 +_08043126: + mov r2, r9 + cmp r2, 0x1 + beq _08043130 + bl _0804441E +_08043130: + ldr r1, =0x02024084 + movs r0, 0x58 + mov r3, r10 + muls r3, r0 + adds r0, r3, 0 + adds r1, r0, r1 + ldrh r0, [r1, 0x2C] + ldrh r5, [r1, 0x28] + cmp r0, r5 + bne _0804318C + ldr r1, =0x0202433c + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x2] + lsls r0, 28 + cmp r0, 0 + bge _08043178 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB592 + str r0, [r1] + bl _0804441E + .pool +_08043178: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB591 + str r0, [r1] + bl _0804441E + .pool +_0804318C: + ldr r2, =0x020241f0 + ldrh r0, [r1, 0x2C] + lsrs r0, 2 + str r0, [r2] + cmp r0, 0 + bne _0804319C + mov r0, r9 + str r0, [r2] +_0804319C: + ldr r0, [r2] + negs r0, r0 + str r0, [r2] + bl _0804441E + .pool +_080431AC: + ldrb r0, [r7] + subs r0, 0x9 + cmp r0, 0x2F + bls _080431B8 + bl _0804441E +_080431B8: + lsls r0, 2 + ldr r1, =_080431C8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080431C8: + .4byte _080435E4 + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _08043288 + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _08043350 + .4byte _0804441E + .4byte _0804441E + .4byte _08043410 + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _08043508 + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _080436C0 + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804379C +_08043288: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _08043298 + bl _0804441E +_08043298: + cmp r5, 0xA5 + bne _080432A0 + bl _0804441E +_080432A0: + ldr r0, =gBattleMoves + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + cmp r0, 0 + bne _080432B4 + bl _0804441E +_080432B4: + ldr r2, =0x0202437c + ldr r0, =0x0202420c + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r1, r0, 2 + adds r0, r2, 0 + adds r0, 0x8 + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _080432DC + adds r0, r2, 0 + adds r0, 0xC + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _080432DC + bl _0804441E +_080432DC: + ldr r1, =0x02024084 + movs r0, 0x58 + mov r2, r10 + muls r2, r0 + adds r0, r2, 0 + adds r1, r0, r1 + adds r4, r1, 0 + adds r4, 0x21 + ldrb r0, [r4] + cmp r0, r3 + bne _080432F6 + bl _0804441E +_080432F6: + adds r2, r1, 0 + adds r2, 0x22 + ldrb r0, [r2] + cmp r0, r3 + bne _08043304 + bl _0804441E +_08043304: + ldrh r0, [r1, 0x28] + cmp r0, 0 + bne _0804330E + bl _0804441E +_0804330E: + strb r3, [r4] + strb r3, [r2] + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x3 + strb r0, [r1, 0x1] + strb r3, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x3] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB64D + str r0, [r1] + bl _080443D0 + .pool +_08043350: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _08043360 + bl _0804441E +_08043360: + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r3, r0, r1 + ldrh r0, [r3, 0x28] + cmp r0, 0 + bne _08043376 + bl _0804441E +_08043376: + ldr r0, =0x0202433c + lsls r1, r2, 4 + adds r1, r0 + ldrb r0, [r1, 0x1] + lsls r0, 31 + cmp r0, 0 + beq _08043388 + bl _0804441E +_08043388: + ldr r2, =0x0202437c + ldr r0, =0x0202420c + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r1, r0, 2 + adds r0, r2, 0 + adds r0, 0x8 + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _080433B0 + adds r0, r2, 0 + adds r0, 0xC + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _080433B0 + bl _0804441E +_080433B0: + ldr r1, =gBattleMoves + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x8] + movs r2, 0x1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _080433CA + bl _0804441E +_080433CA: + ldr r1, =0x020241f0 + ldrh r0, [r3, 0x2C] + lsrs r0, 4 + str r0, [r1] + cmp r0, 0 + bne _080433D8 + str r2, [r1] +_080433D8: + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB654 + str r0, [r1] + bl _080443D0 + .pool +_08043410: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _08043420 + bl _0804441E +_08043420: + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _08043436 + bl _0804441E +_08043436: + ldr r0, =0x0202433c + lsls r1, r2, 4 + adds r1, r0 + ldrb r0, [r1, 0x1] + lsls r0, 31 + cmp r0, 0 + beq _08043448 + bl _0804441E +_08043448: + ldr r2, =0x0202437c + ldr r0, =0x0202420c + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r1, r0, 2 + adds r0, r2, 0 + adds r0, 0x8 + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _08043470 + adds r0, r2, 0 + adds r0, 0xC + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _08043470 + bl _0804441E +_08043470: + ldr r1, =gBattleMoves + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x8] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08043488 + bl _0804441E +_08043488: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + beq _080434A0 + bl _0804441E +_080434A0: + ldr r5, =0x02024332 + movs r4, 0x3 +_080434A4: + bl GenerateRandomNumber + ands r0, r4 + strb r0, [r5, 0x3] + cmp r0, 0 + beq _080434A4 + ldr r1, =0x02024332 + ldrb r0, [r1, 0x3] + cmp r0, 0x3 + bne _080434BC + adds r0, 0x2 + strb r0, [r1, 0x3] +_080434BC: + ldrb r0, [r1, 0x3] + adds r0, 0x40 + strb r0, [r1, 0x3] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB67C + str r0, [r1] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 6 + orrs r0, r1 + str r0, [r2] + bl _080443D0 + .pool +_08043508: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _08043518 + bl _0804441E +_08043518: + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _0804352E + bl _0804441E +_0804352E: + ldr r0, =0x0202433c + lsls r1, r2, 4 + adds r1, r0 + ldrb r0, [r1, 0x1] + lsls r0, 31 + cmp r0, 0 + beq _08043540 + bl _0804441E +_08043540: + ldr r2, =0x0202437c + ldr r0, =0x0202420c + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r1, r0, 2 + adds r0, r2, 0 + adds r0, 0x8 + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _08043568 + adds r0, r2, 0 + adds r0, 0xC + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _08043568 + bl _0804441E +_08043568: + ldr r1, =gBattleMoves + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x8] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08043580 + bl _0804441E +_08043580: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + beq _08043598 + bl _0804441E +_08043598: + ldr r1, =0x02024332 + movs r0, 0x42 + strb r0, [r1, 0x3] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB67C + str r0, [r1] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 6 + orrs r0, r1 + str r0, [r2] + bl _080443D0 + .pool +_080435E4: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _080435F4 + bl _0804441E +_080435F4: + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _0804360A + bl _0804441E +_0804360A: + ldr r0, =0x0202433c + lsls r1, r2, 4 + adds r1, r0 + ldrb r0, [r1, 0x1] + lsls r0, 31 + cmp r0, 0 + beq _0804361C + bl _0804441E +_0804361C: + ldr r2, =0x0202437c + ldr r0, =0x0202420c + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r1, r0, 2 + adds r0, r2, 0 + adds r0, 0x8 + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _08043644 + adds r0, r2, 0 + adds r0, 0xC + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _08043644 + bl _0804441E +_08043644: + ldr r1, =gBattleMoves + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x8] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0804365C + bl _0804441E +_0804365C: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + beq _08043674 + bl _0804441E +_08043674: + ldr r1, =0x02024332 + movs r0, 0x45 + strb r0, [r1, 0x3] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB67C + str r0, [r1] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 6 + orrs r0, r1 + str r0, [r2] + bl _080443D0 + .pool +_080436C0: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _080436D0 + bl _0804441E +_080436D0: + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _080436E6 + bl _0804441E +_080436E6: + ldr r0, =0x0202433c + lsls r1, r2, 4 + adds r1, r0 + ldrb r0, [r1, 0x1] + lsls r0, 31 + cmp r0, 0 + beq _080436F8 + bl _0804441E +_080436F8: + ldr r1, =gBattleMoves + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x8] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08043710 + bl _0804441E +_08043710: + ldr r2, =0x0202437c + ldr r0, =0x0202420c + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r1, r0, 2 + adds r0, r2, 0 + adds r0, 0x8 + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _08043738 + adds r0, r2, 0 + adds r0, 0xC + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _08043738 + bl _0804441E +_08043738: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + beq _08043750 + bl _0804441E +_08043750: + ldr r1, =0x02024332 + movs r0, 0x43 + strb r0, [r1, 0x3] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB67C + str r0, [r1] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 6 + orrs r0, r1 + str r0, [r2] + bl _080443D0 + .pool +_0804379C: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _080437AC + bl _0804441E +_080437AC: + ldr r6, =0x02024084 + ldr r3, =0x0202420b + mov r8, r3 + ldrb r1, [r3] + movs r7, 0x58 + adds r0, r1, 0 + muls r0, r7 + adds r0, r6 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _080437C6 + bl _0804441E +_080437C6: + ldr r0, =0x0202433c + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1, 0x1] + lsls r0, 31 + cmp r0, 0 + beq _080437D8 + bl _0804441E +_080437D8: + ldr r1, =gBattleMoves + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x8] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080437F0 + bl _0804441E +_080437F0: + ldr r3, =0x0202437c + ldr r5, =0x0202420c + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r2, r0, 2 + adds r0, r3, 0 + adds r0, 0x8 + adds r0, r2, r0 + ldr r0, [r0] + cmp r0, 0 + bne _08043818 + adds r0, r3, 0 + adds r0, 0xC + adds r0, r2, r0 + ldr r0, [r0] + cmp r0, 0 + bne _08043818 + bl _0804441E +_08043818: + adds r0, r1, 0 + muls r0, r7 + adds r0, r6 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _08043828 + bl _0804441E +_08043828: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + beq _08043840 + bl _0804441E +_08043840: + mov r1, r8 + ldrb r0, [r1] + muls r0, r7 + adds r0, r6 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0xC + bne _08043854 + bl _0804441E +_08043854: + ldr r0, [sp, 0x8] + ldr r1, [sp, 0x10] + bl pokemon_species_get_gender_info + adds r4, r0, 0 + ldr r0, [sp, 0xC] + ldr r1, [sp, 0x14] + bl pokemon_species_get_gender_info + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _08043872 + bl _0804441E +_08043872: + mov r2, r8 + ldrb r0, [r2] + muls r0, r7 + adds r4, r6, 0 + adds r4, 0x50 + adds r0, r4 + ldr r0, [r0] + movs r1, 0xF0 + lsls r1, 12 + ands r0, r1 + cmp r0, 0 + beq _0804388E + bl _0804441E +_0804388E: + ldr r0, [sp, 0x8] + ldr r1, [sp, 0x10] + bl pokemon_species_get_gender_info + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _080438A2 + bl _0804441E +_080438A2: + ldr r0, [sp, 0xC] + ldr r1, [sp, 0x14] + bl pokemon_species_get_gender_info + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _080438B6 + bl _0804441E +_080438B6: + mov r3, r8 + ldrb r0, [r3] + adds r2, r0, 0 + muls r2, r7 + adds r2, r4 + ldr r1, =gUnknown_0832A328 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + lsls r1, 16 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB66F + str r0, [r1] + bl _080443D0 + .pool +_08043908: + movs r5, 0 + mov r10, r5 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r10, r0 + bcc _08043918 + bl _0804441E +_08043918: + ldr r1, =0x02024084 + movs r0, 0x58 + mov r2, r10 + muls r2, r0 + adds r0, r2, 0 + adds r0, r1 + adds r0, 0x20 + ldrb r0, [r0] + subs r0, 0x7 + adds r2, r1, 0 + cmp r0, 0x41 + bls _08043932 + b _08043B96 +_08043932: + lsls r0, 2 + ldr r1, =_08043948 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08043948: + .4byte _08043AAC + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B70 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043AD4 + .4byte _08043B96 + .4byte _08043A50 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043A7C + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B40 + .4byte _08043B10 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043AD4 +_08043A50: + movs r0, 0x58 + mov r3, r10 + muls r3, r0 + adds r0, r3, 0 + adds r1, r2, 0 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + ldr r1, =0x00000f88 + ands r0, r1 + cmp r0, 0 + bne _08043A6A + b _08043B96 +_08043A6A: + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC70 + b _08043B5C + .pool +_08043A7C: + movs r0, 0x58 + mov r1, r10 + muls r1, r0 + adds r0, r1, 0 + adds r1, r2, 0 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + bne _08043A96 + b _08043B96 +_08043A96: + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC98 + bl CopyString + movs r2, 0x2 + mov r9, r2 + b _08043B9C + .pool +_08043AAC: + movs r0, 0x58 + mov r3, r10 + muls r3, r0 + adds r0, r3, 0 + adds r1, r2, 0 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08043B96 + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC80 + b _08043B5C + .pool +_08043AD4: + movs r0, 0x58 + mov r3, r10 + muls r3, r0 + adds r0, r2, 0 + adds r0, 0x4C + adds r0, r3, r0 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + beq _08043B96 + adds r2, 0x50 + adds r2, r3, r2 + ldr r0, [r2] + ldr r1, =0xf7ffffff + ands r0, r1 + str r0, [r2] + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC78 + bl CopyString + movs r0, 0x1 + mov r9, r0 + b _08043B9C + .pool +_08043B10: + movs r0, 0x58 + mov r1, r10 + muls r1, r0 + adds r0, r1, 0 + adds r1, r2, 0 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08043B96 + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC88 + bl CopyString + movs r2, 0x1 + mov r9, r2 + b _08043B9C + .pool +_08043B40: + movs r0, 0x58 + mov r3, r10 + muls r3, r0 + adds r0, r3, 0 + adds r1, r2, 0 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08043B96 + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC90 +_08043B5C: + bl CopyString + movs r5, 0x1 + mov r9, r5 + b _08043B9C + .pool +_08043B70: + movs r0, 0x58 + mov r1, r10 + muls r1, r0 + adds r0, r1, 0 + adds r1, r2, 0 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0xF0 + lsls r1, 12 + ands r0, r1 + cmp r0, 0 + beq _08043B96 + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BCA0 + bl CopyString + movs r2, 0x3 + mov r9, r2 +_08043B96: + mov r3, r9 + cmp r3, 0 + beq _08043C50 +_08043B9C: + mov r5, r9 + cmp r5, 0x2 + beq _08043BD0 + cmp r5, 0x2 + bgt _08043BB4 + cmp r5, 0x1 + beq _08043BBC + b _08043BFC + .pool +_08043BB4: + mov r0, r9 + cmp r0, 0x3 + beq _08043BE8 + b _08043BFC +_08043BBC: + ldr r1, =0x02024084 + movs r0, 0x58 + mov r2, r10 + muls r2, r0 + adds r1, 0x4C + adds r2, r1 + movs r0, 0 + b _08043BFA + .pool +_08043BD0: + ldr r1, =0x02024084 + movs r0, 0x58 + mov r2, r10 + muls r2, r0 + adds r1, 0x50 + adds r2, r1 + ldr r0, [r2] + movs r1, 0x8 + negs r1, r1 + b _08043BF8 + .pool +_08043BE8: + ldr r1, =0x02024084 + movs r0, 0x58 + mov r2, r10 + muls r2, r0 + adds r1, 0x50 + adds r2, r1 + ldr r0, [r2] + ldr r1, =0xfff0ffff +_08043BF8: + ands r0, r1 +_08043BFA: + str r0, [r2] +_08043BFC: + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB68C + str r0, [r1] + ldr r0, =0x02024474 + mov r1, r10 + strb r1, [r0, 0x17] + ldr r4, =0x02024064 + strb r1, [r4] + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 + ldr r1, =0x020240d0 + adds r0, r1 + str r0, [sp] + movs r0, 0 + movs r1, 0x28 + movs r2, 0 + movs r3, 0x4 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + bl _0804443A + .pool +_08043C50: + mov r0, r10 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r10, r0 + bcs _08043C64 + b _08043918 +_08043C64: + bl _0804441E + .pool +_08043C6C: + movs r2, 0 + mov r10, r2 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r10, r0 + bcc _08043C7A + b _0804441E +_08043C7A: + ldr r4, =0x02024084 +_08043C7C: + movs r0, 0x58 + mov r3, r10 + muls r3, r0 + adds r0, r3, 0 + adds r0, r4 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x3B + bne _08043CA0 + mov r0, r10 + bl castform_switch + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + cmp r0, 0 + beq _08043CA0 + b _080442FC +_08043CA0: + mov r0, r10 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r10, r0 + bcc _08043C7C + b _0804441E + .pool +_08043CBC: + ldrb r0, [r7] + cmp r0, 0x1C + beq _08043CC4 + b _0804441E +_08043CC4: + ldr r4, =0x02024280 + ldr r1, [r4] + movs r0, 0x80 + lsls r0, 7 + ands r0, r1 + cmp r0, 0 + bne _08043CD4 + b _0804441E +_08043CD4: + ldr r0, =0xffffbfff + ands r1, r0 + str r1, [r4] + mov r5, r8 + ldr r1, [r5] + adds r1, 0xB2 + ldrb r2, [r1] + movs r0, 0x3F + ands r0, r2 + strb r0, [r1] + ldr r0, [r5] + adds r1, r0, 0 + adds r1, 0xB2 + ldrb r0, [r1] + cmp r0, 0x6 + bne _08043CF8 + movs r0, 0x2 + strb r0, [r1] +_08043CF8: + ldr r1, =0x02024332 + mov r2, r8 + ldr r0, [r2] + adds r0, 0xB2 + ldrb r0, [r0] + adds r0, 0x40 + strb r0, [r1, 0x3] + ldr r1, =0x02024474 + ldr r0, =0x0202420c + ldrb r0, [r0] + strb r0, [r1, 0x17] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB67F + str r0, [r1] + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 6 + orrs r0, r1 + str r0, [r4] + b _080443D0 + .pool +_08043D40: + ldrb r0, [r7] + cmp r0, 0x1C + beq _08043D48 + b _0804441E +_08043D48: + ldr r4, =0x02024280 + ldr r1, [r4] + movs r0, 0x80 + lsls r0, 7 + ands r0, r1 + cmp r0, 0 + bne _08043D58 + b _0804441E +_08043D58: + ldr r0, =0xffffbfff + ands r1, r0 + str r1, [r4] + mov r3, r8 + ldr r1, [r3] + adds r1, 0xB2 + ldrb r2, [r1] + movs r0, 0x3F + ands r0, r2 + strb r0, [r1] + ldr r0, [r3] + adds r1, r0, 0 + adds r1, 0xB2 + ldrb r0, [r1] + cmp r0, 0x6 + bne _08043D7C + movs r0, 0x2 + strb r0, [r1] +_08043D7C: + ldr r1, =0x02024332 + mov r3, r8 + ldr r0, [r3] + adds r0, 0xB2 + ldrb r0, [r0] + strb r0, [r1, 0x3] + ldr r1, =0x02024474 + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r1, 0x17] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB67F + str r0, [r1] + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 6 + orrs r0, r1 + str r0, [r4] + b _080443D0 + .pool +_08043DC4: + movs r4, 0 + ldr r0, =0x0202406c + ldrb r1, [r0] + cmp r4, r1 + blt _08043DD0 + b _0804441E +_08043DD0: + ldr r0, =0x02024084 + adds r5, r1, 0 + ldr r2, =0x020242ac + adds r3, r0, 0 + adds r3, 0x20 + movs r6, 0x80 + lsls r6, 12 +_08043DDE: + ldrb r1, [r3] + cmp r1, 0x16 + bne _08043DEE + ldr r0, [r2] + ands r0, r6 + cmp r0, 0 + beq _08043DEE + b _08044324 +_08043DEE: + adds r2, 0x4 + adds r3, 0x58 + adds r4, 0x1 + cmp r4, r5 + blt _08043DDE + b _0804441E + .pool +_08043E08: + movs r4, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _08043E14 + b _0804441E +_08043E14: + ldr r5, =0x02024064 + mov r8, r5 + ldr r0, =0x02024084 + adds r0, 0x20 + str r0, [sp, 0x1C] + movs r1, 0 + str r1, [sp, 0x20] +_08043E22: + ldr r2, [sp, 0x1C] + ldrb r0, [r2] + cmp r0, 0x24 + beq _08043E2C + b _08043FBE +_08043E2C: + ldr r0, =0x020242ac + ldr r3, [sp, 0x20] + adds r0, r3, r0 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 13 + ands r1, r0 + str r3, [sp, 0x18] + cmp r1, 0 + bne _08043E42 + b _08043FBE +_08043E42: + lsls r0, r4, 24 + lsrs r0, 24 + bl battle_get_per_side_status + movs r1, 0x1 + adds r5, r0, 0 + eors r5, r1 + ands r5, r1 + adds r0, r5, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r5, 0x2 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r2, 0x1 + ands r0, r2 + cmp r0, 0 + bne _08043E74 + b _08043F84 +_08043E74: + movs r1, 0x58 + adds r0, r6, 0 + muls r0, r1 + ldr r3, =0x02024084 + adds r1, r0, r3 + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0 + beq _08043F40 + ldrh r0, [r1, 0x28] + cmp r0, 0 + beq _08043EFC + movs r1, 0x58 + adds r0, r7, 0 + muls r0, r1 + adds r1, r0, r3 + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0 + beq _08043EFC + ldrh r0, [r1, 0x28] + cmp r0, 0 + beq _08043EFC + str r2, [sp, 0x24] + bl GenerateRandomNumber + ldr r2, [sp, 0x24] + adds r1, r2, 0 + ands r1, r0 + lsls r1, 1 + orrs r5, r1 + adds r0, r5, 0 + bl battle_get_side_with_given_state + mov r2, r8 + strb r0, [r2] + ldrb r0, [r2] + movs r3, 0x58 + muls r0, r3 + ldr r5, =0x02024084 + adds r0, r5 + adds r0, 0x20 + ldrb r0, [r0] + ldr r1, [sp, 0x1C] + strb r0, [r1] + ldrb r0, [r2] + muls r0, r3 + adds r0, r5 + adds r0, 0x20 + ldrb r0, [r0] + ldr r2, =0x0202420a + strb r0, [r2] + b _08043FAC + .pool +_08043EFC: + ldr r3, =0x02024084 + movs r2, 0x58 + adds r0, r6, 0 + muls r0, r2 + adds r1, r0, r3 + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0 + beq _08043F40 + ldrh r0, [r1, 0x28] + cmp r0, 0 + beq _08043F40 + mov r5, r8 + strb r6, [r5] + adds r1, r4, 0 + muls r1, r2 + adds r1, r3 + ldrb r0, [r5] + muls r0, r2 + adds r0, r3 + adds r0, 0x20 + ldrb r0, [r0] + adds r1, 0x20 + strb r0, [r1] + ldrb r0, [r5] + muls r0, r2 + adds r0, r3 + adds r0, 0x20 + ldrb r0, [r0] + b _08043FA8 + .pool +_08043F40: + ldr r3, =0x02024084 + movs r2, 0x58 + adds r0, r7, 0 + muls r0, r2 + adds r1, r0, r3 + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0 + beq _08043FB6 + ldrh r0, [r1, 0x28] + cmp r0, 0 + beq _08043FB6 + mov r5, r8 + strb r7, [r5] + adds r1, r4, 0 + muls r1, r2 + adds r1, r3 + ldrb r0, [r5] + muls r0, r2 + adds r0, r3 + adds r0, 0x20 + ldrb r0, [r0] + adds r1, 0x20 + strb r0, [r1] + ldrb r0, [r5] + muls r0, r2 + adds r0, r3 + adds r0, 0x20 + ldrb r0, [r0] + b _08043FA8 + .pool +_08043F84: + mov r2, r8 + strb r6, [r2] + movs r3, 0x58 + adds r0, r6, 0 + muls r0, r3 + ldr r5, =0x02024084 + adds r0, r5 + adds r2, r0, 0 + adds r2, 0x20 + ldrb r1, [r2] + cmp r1, 0 + beq _08043FB6 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _08043FB6 + ldr r0, [sp, 0x1C] + strb r1, [r0] + ldrb r0, [r2] +_08043FA8: + ldr r1, =0x0202420a + strb r0, [r1] +_08043FAC: + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_08043FB6: + mov r2, r9 + cmp r2, 0 + beq _08043FBE + b _08044340 +_08043FBE: + ldr r3, [sp, 0x1C] + adds r3, 0x58 + str r3, [sp, 0x1C] + ldr r5, [sp, 0x20] + adds r5, 0x4 + str r5, [sp, 0x20] + adds r4, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + bge _08043FD6 + b _08043E22 +_08043FD6: + b _0804441E + .pool +_08043FE4: + movs r4, 0 + ldr r0, =0x0202406c + ldrb r1, [r0] + cmp r4, r1 + blt _08043FF0 + b _0804441E +_08043FF0: + ldr r0, =0x02024084 + adds r5, r1, 0 + ldr r2, =0x020242ac + adds r3, r0, 0 + adds r3, 0x20 + movs r6, 0x80 + lsls r6, 12 +_08043FFE: + ldrb r1, [r3] + cmp r1, 0x16 + bne _0804400E + ldr r0, [r2] + ands r0, r6 + cmp r0, 0 + beq _0804400E + b _080443B4 +_0804400E: + adds r2, 0x4 + adds r3, 0x58 + adds r4, 0x1 + cmp r4, r5 + blt _08043FFE + b _0804441E + .pool +_08044028: + mov r0, r10 + bl battle_side_get_owner + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _0804403E + b _0804441E +_0804403E: + ldr r7, =0x02024084 +_08044040: + lsls r0, r4, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + adds r3, r4, 0x1 + cmp r0, r5 + beq _0804406A + movs r0, 0x58 + muls r0, r4 + adds r0, r7 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, r6 + bne _0804406A + ldr r0, =0x0202420a + strb r6, [r0] + lsls r0, r3, 24 + lsrs r0, 24 + mov r9, r0 +_0804406A: + adds r4, r3, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _08044040 + b _0804441E + .pool +_08044084: + mov r0, r10 + bl battle_side_get_owner + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _0804409A + b _0804441E +_0804409A: + ldr r7, =0x02024084 +_0804409C: + lsls r0, r4, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + adds r3, r4, 0x1 + cmp r0, r5 + bne _080440C6 + movs r0, 0x58 + muls r0, r4 + adds r0, r7 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, r6 + bne _080440C6 + ldr r0, =0x0202420a + strb r6, [r0] + lsls r0, r3, 24 + lsrs r0, 24 + mov r9, r0 +_080440C6: + adds r4, r3, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _0804409C + b _0804441E + .pool +_080440E0: + ldrb r0, [r7] + cmp r0, 0xFD + beq _08044104 + cmp r0, 0xFE + beq _0804413C + movs r4, 0 + ldr r0, =0x0202406c + adds r5, r0, 0 + ldrb r0, [r5] + cmp r4, r0 + blt _080440F8 + b _0804441E +_080440F8: + ldr r2, =0x02024084 + b _08044174 + .pool +_08044104: + movs r4, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _08044110 + b _0804441E +_08044110: + ldr r5, =0x020242ac + movs r2, 0x80 + lsls r2, 9 + adds r1, r0, 0 +_08044118: + lsls r0, r4, 2 + adds r0, r5 + ldr r0, [r0] + ands r0, r2 + adds r3, r4, 0x1 + cmp r0, 0 + beq _0804412C + lsls r0, r3, 24 + lsrs r0, 24 + mov r9, r0 +_0804412C: + adds r4, r3, 0 + cmp r4, r1 + blt _08044118 + b _0804441E + .pool +_0804413C: + movs r4, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _08044148 + b _0804441E +_08044148: + ldr r5, =0x020242ac + movs r2, 0x80 + lsls r2, 10 + adds r1, r0, 0 +_08044150: + lsls r0, r4, 2 + adds r0, r5 + ldr r0, [r0] + ands r0, r2 + adds r3, r4, 0x1 + cmp r0, 0 + beq _08044164 + lsls r0, r3, 24 + lsrs r0, 24 + mov r9, r0 +_08044164: + adds r4, r3, 0 + cmp r4, r1 + blt _08044150 + b _0804441E + .pool +_08044174: + movs r0, 0x58 + muls r0, r4 + adds r0, r2 + adds r0, 0x20 + ldrb r0, [r0] + adds r3, r4, 0x1 + cmp r0, r6 + bne _0804418C + strb r6, [r7] + lsls r0, r3, 24 + lsrs r0, 24 + mov r9, r0 +_0804418C: + adds r4, r3, 0 + ldrb r1, [r5] + cmp r4, r1 + blt _08044174 + b _0804441E +_08044196: + movs r4, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _080441A2 + b _0804441E +_080441A2: + ldr r2, =0x02024084 + mov r8, r2 + adds r2, r0, 0 + movs r5, 0x58 +_080441AA: + adds r0, r4, 0 + muls r0, r5 + mov r3, r8 + adds r1, r0, r3 + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + adds r3, r4, 0x1 + cmp r0, r6 + bne _080441CC + ldrh r0, [r1, 0x28] + cmp r0, 0 + beq _080441CC + strb r6, [r7] + lsls r0, r3, 24 + lsrs r0, 24 + mov r9, r0 +_080441CC: + adds r4, r3, 0 + cmp r4, r2 + blt _080441AA + b _0804441E + .pool +_080441DC: + movs r4, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _080441E8 + b _0804441E +_080441E8: + ldr r7, =0x02024084 + adds r1, r0, 0 + movs r5, 0x58 + ldr r2, =0x0202420a +_080441F0: + adds r0, r4, 0 + muls r0, r5 + adds r0, r7 + adds r0, 0x20 + ldrb r0, [r0] + adds r3, r4, 0x1 + cmp r0, r6 + bne _0804420C + cmp r4, r10 + beq _0804420C + strb r6, [r2] + lsls r0, r3, 24 + lsrs r0, 24 + mov r9, r0 +_0804420C: + adds r4, r3, 0 + cmp r4, r1 + blt _080441F0 + b _0804441E + .pool +_08044220: + mov r0, r10 + bl battle_side_get_owner + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _08044236 + b _0804441E +_08044236: + ldr r7, =0x02024084 +_08044238: + lsls r0, r4, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, r5 + beq _08044264 + movs r0, 0x58 + muls r0, r4 + adds r0, r7 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, r6 + bne _08044264 + ldr r0, =0x0202420a + strb r6, [r0] + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_08044264: + adds r4, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _08044238 + b _0804441E + .pool +_0804427C: + mov r0, r10 + bl battle_side_get_owner + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _08044292 + b _0804441E +_08044292: + ldr r7, =0x02024084 +_08044294: + lsls r0, r4, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, r5 + bne _080442C0 + movs r0, 0x58 + muls r0, r4 + adds r0, r7 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, r6 + bne _080442C0 + ldr r0, =0x0202420a + strb r6, [r0] + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_080442C0: + adds r4, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _08044294 + b _0804441E + .pool +_080442D8: + ldr r0, =gUnknown_082DB4A9 + bl b_push_move_exec + ldr r0, =0x02024474 + strb r6, [r0, 0x17] +_080442E2: + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x7F + mov r1, r9 + subs r1, 0x1 + strb r1, [r0] + b _0804441E + .pool +_080442FC: + ldr r0, =gUnknown_082DB4A9 + bl b_push_move_exec + ldr r0, =0x02024474 + mov r5, r10 + strb r5, [r0, 0x17] + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x7F + mov r1, r9 + subs r1, 0x1 + strb r1, [r0] + b _0804443A + .pool +_08044324: + strb r1, [r7] + ldr r0, [r2] + ldr r1, =0xfff7ffff + ands r0, r1 + str r0, [r2] + ldr r0, =gUnknown_082DB4B8 + bl b_push_move_exec + b _080443C8 + .pool +_08044340: + ldr r0, =gUnknown_082DB452 + bl b_push_move_exec + ldr r1, =0x020242ac + ldr r0, [sp, 0x18] + adds r1, r0, r1 + ldr r0, [r1] + ldr r2, =0xffefffff + ands r0, r2 + str r0, [r1] + ldr r0, =0x02024474 + strb r4, [r0, 0x17] + ldr r1, =0x02022f58 + movs r4, 0xFD + strb r4, [r1] + movs r0, 0x4 + strb r0, [r1, 0x1] + ldr r2, =0x02024064 + ldrb r0, [r2] + strb r0, [r1, 0x2] + ldr r3, =0x0202406e + ldrb r0, [r2] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r1, =0x02022f68 + strb r4, [r1] + movs r0, 0x9 + strb r0, [r1, 0x1] + ldr r0, =0x0202420a + ldrb r0, [r0] + strb r0, [r1, 0x2] + movs r0, 0x1 + negs r0, r0 + strb r0, [r1, 0x3] + b _0804441E + .pool +_080443B4: + strb r1, [r7] + ldr r0, [r2] + ldr r1, =0xfff7ffff + ands r0, r1 + str r0, [r2] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB4C1 + str r0, [r1] +_080443C8: + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0xD8 + strb r4, [r0] +_080443D0: + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + b _0804441E + .pool +_080443EC: + movs r4, 0 + ldr r0, =0x0202406c + ldrb r1, [r0] + cmp r4, r1 + bge _0804441E + ldr r0, =0x02024084 + adds r2, r1, 0 + adds r1, r0, 0 + adds r1, 0x20 + ldr r3, =0x0202420a +_08044400: + ldrb r0, [r1] + cmp r0, r6 + bne _08044416 + cmp r4, r10 + beq _08044416 + strb r6, [r3] + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_08044416: + adds r1, 0x58 + adds r4, 0x1 + cmp r4, r2 + blt _08044400 +_0804441E: + mov r1, r9 + cmp r1, 0 + beq _0804443A +_08044424: + ldr r2, [sp, 0x4] + cmp r2, 0xB + bhi _0804443A + ldr r1, =0x0202420a + ldrb r0, [r1] + cmp r0, 0xFF + beq _0804443A + adds r1, r0, 0 + mov r0, r10 + bl b_history__record_ability_usage_of_player +_0804443A: + mov r0, r9 + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end ability_something + + thumb_func_start b_call_bc_move_exec +b_call_bc_move_exec: @ 8044458 + ldr r1, =0x02024214 + str r0, [r1] + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r2, [r0, 0xC] + adds r3, r2, 0 + adds r3, 0x20 + ldrb r0, [r3] + adds r1, r0, 0x1 + strb r1, [r3] + lsls r0, 24 + lsrs r0, 22 + adds r2, r0 + ldr r1, =0x03005d04 + ldr r0, [r1] + str r0, [r2] + ldr r0, =bc_move_exec_returning + str r0, [r1] + ldr r1, =0x02024083 + movs r0, 0 + strb r0, [r1] + bx lr + .pool + thumb_func_end b_call_bc_move_exec + + thumb_func_start b_push_move_exec +b_push_move_exec: @ 8044498 + push {r4,lr} + adds r4, r0, 0 + bl b_movescr_stack_push_cursor + ldr r0, =0x02024214 + str r4, [r0] + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r2, [r0, 0xC] + adds r3, r2, 0 + adds r3, 0x20 + ldrb r0, [r3] + adds r1, r0, 0x1 + strb r1, [r3] + lsls r0, 24 + lsrs r0, 22 + adds r2, r0 + ldr r1, =0x03005d04 + ldr r0, [r1] + str r0, [r2] + ldr r0, =sub_803E08C + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end b_push_move_exec + + thumb_func_start berry_effects_maybe +berry_effects_maybe: @ 80444DC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + movs r0, 0 + mov r10, r0 + movs r1, 0 + str r1, [sp, 0xC] + add r0, sp, 0x4 + strb r1, [r0] + ldr r4, =0x02024208 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r7 + adds r0, r1 + ldrh r0, [r0, 0x2E] + strh r0, [r4] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xAF + bne _08044534 + ldr r1, =0x02024404 + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + adds r0, r1 + ldrb r5, [r0, 0x7] + ldrb r0, [r0, 0x1A] + b _08044548 + .pool +_08044534: + ldrh r0, [r4] + bl itemid_get_x12 + lsls r0, 24 + lsrs r5, r0, 24 + ldrh r0, [r4] + bl itemid_get_quality + lsls r0, 24 + lsrs r0, 24 +_08044548: + mov r9, r0 + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldrh r0, [r0, 0x2E] + str r0, [sp, 0x14] + cmp r0, 0xAF + bne _0804457C + ldr r1, =0x02024404 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r3, [r0, 0x7] + mov r8, r3 + ldrb r0, [r0, 0x1A] + b _08044592 + .pool +_0804457C: + ldr r0, [sp, 0x14] + bl itemid_get_x12 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, [sp, 0x14] + bl itemid_get_quality + lsls r0, 24 + lsrs r0, 24 +_08044592: + str r0, [sp, 0x10] + ldr r2, =0x02024084 + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r4, [r0, 0x2E] + cmp r4, 0xAF + beq _080445B2 + adds r0, r4, 0 + bl itemid_get_x12 + adds r0, r4, 0 + bl itemid_get_quality +_080445B2: + ldr r0, [sp, 0x8] + cmp r0, 0x4 + bls _080445BC + bl _0804582A +_080445BC: + lsls r0, 2 + ldr r1, =_080445D4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080445D4: + .4byte _080445E8 + .4byte _08044688 + .4byte _0804582A + .4byte _08045280 + .4byte _080456D0 +_080445E8: + cmp r5, 0x17 + beq _08044618 + cmp r5, 0x20 + beq _080445F4 + bl _0804582A +_080445F4: + adds r0, r7, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08044604 + bl _0804582A +_08044604: + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x4A + movs r1, 0x2 + strb r1, [r0] + bl _0804582A + .pool +_08044618: + ldr r1, =0x02024084 + mov r8, r1 + movs r0, 0x58 + adds r1, r7, 0 + muls r1, r0 + mov r0, r8 + adds r0, 0x18 + adds r1, r0 + movs r2, 0x6 + movs r3, 0x7 + mov r10, r3 +_0804462E: + movs r0, 0 + ldrsb r0, [r1, r0] + cmp r0, 0x5 + bgt _0804463C + strb r2, [r1] + movs r5, 0x5 + str r5, [sp, 0xC] +_0804463C: + adds r1, 0x1 + movs r0, 0x1 + negs r0, r0 + add r10, r0 + mov r3, r10 + cmp r3, 0 + bge _0804462E + ldr r5, [sp, 0xC] + cmp r5, 0 + bne _08044654 + bl _0804582A +_08044654: + ldr r0, =0x02024474 + strb r7, [r0, 0x17] + ldr r0, =0x0202420f + strb r7, [r0] + ldr r1, =0x02024064 + ldr r0, =0x0202420b + strb r7, [r0] + strb r7, [r1] + ldr r0, =gUnknown_082DB7AE + bl b_call_bc_move_exec + bl _0804582A + .pool +_08044688: + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r7 + adds r0, r1 + ldrh r0, [r0, 0x28] + mov r8, r1 + cmp r0, 0 + bne _0804469C + bl _0804582A +_0804469C: + subs r0, r5, 0x1 + cmp r0, 0x2A + bls _080446A6 + bl _080451D6 +_080446A6: + lsls r0, 2 + ldr r1, =_080446B8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080446B8: + .4byte _08044764 + .4byte _08044F44 + .4byte _08045008 + .4byte _08044F74 + .4byte _08044FA8 + .4byte _08044FD8 + .4byte _080447B0 + .4byte _08045044 + .4byte _08045074 + .4byte _0804497C + .4byte _080449FC + .4byte _08044A78 + .4byte _08044B0C + .4byte _08044BA0 + .4byte _08044C34 + .4byte _08044C9C + .4byte _08044CF0 + .4byte _08044D44 + .4byte _08044DAC + .4byte _08044E10 + .4byte _08044E5C + .4byte _080451D6 + .4byte _080448B0 + .4byte _080451D6 + .4byte _080451D6 + .4byte _080451D6 + .4byte _080451D6 + .4byte _080451A0 + .4byte _080451D6 + .4byte _080451D6 + .4byte _080451D6 + .4byte _080451D6 + .4byte _080451D6 + .4byte _080451D6 + .4byte _080451D6 + .4byte _080451D6 + .4byte _080451D6 + .4byte _080451D6 + .4byte _080451D6 + .4byte _080451D6 + .4byte _080451D6 + .4byte _080451D6 + .4byte _0804491C +_08044764: + movs r0, 0x58 + muls r0, r7 + mov r1, r8 + adds r2, r0, r1 + ldrh r0, [r2, 0x2C] + ldrh r1, [r2, 0x28] + lsrs r0, 1 + cmp r1, r0 + bls _0804477A + bl _080451D6 +_0804477A: + cmp r6, 0 + beq _08044782 + bl _080451D6 +_08044782: + ldr r4, =0x020241f0 + mov r3, r9 + str r3, [r4] + ldrh r3, [r2, 0x28] + mov r5, r9 + adds r0, r3, r5 + ldrh r1, [r2, 0x2C] + cmp r0, r1 + ble _08044798 + subs r0, r1, r3 + str r0, [r4] +_08044798: + ldr r0, [r4] + negs r0, r0 + str r0, [r4] + ldr r0, =gUnknown_082DB7C4 + bl b_call_bc_move_exec + b _08044B02 + .pool +_080447B0: + cmp r6, 0 + beq _080447B8 + bl _080451D6 +_080447B8: + adds r0, r7, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080447DC + ldr r1, =0x0202406e + lsls r0, r7, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + b _080447EA + .pool +_080447DC: + ldr r1, =0x0202406e + lsls r0, r7, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 +_080447EA: + adds r4, r1, r0 + movs r1, 0 + mov r10, r1 + add r5, sp, 0x4 +_080447F2: + mov r1, r10 + adds r1, 0xD + adds r0, r4, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r6, r0, 16 + mov r1, r10 + adds r1, 0x11 + adds r0, r4, 0 + bl pokemon_getattr + strb r0, [r5] + adds r0, r4, 0 + movs r1, 0x15 + bl pokemon_getattr + lsls r0, 24 + lsrs r1, r0, 24 + cmp r6, 0 + beq _08044822 + ldrb r0, [r5] + cmp r0, 0 + beq _0804482C +_08044822: + movs r2, 0x1 + add r10, r2 + mov r3, r10 + cmp r3, 0x3 + ble _080447F2 +_0804482C: + mov r5, r10 + cmp r5, 0x4 + bne _08044836 + bl _080451D6 +_08044836: + lsls r2, r5, 24 + lsrs r2, 24 + adds r0, r6, 0 + bl CalcPPWithPPUps + lsls r0, 24 + lsrs r2, r0, 24 + add r0, sp, 0x4 + ldrb r0, [r0] + mov r3, r9 + adds r1, r0, r3 + cmp r1, r2 + ble _08044860 + add r0, sp, 0x4 + strb r2, [r0] + b _08044864 + .pool +_08044860: + add r0, sp, 0x4 + strb r1, [r0] +_08044864: + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x2 + strb r0, [r1, 0x1] + strb r6, [r1, 0x2] + lsrs r0, r6, 8 + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r0, =gUnknown_082DB7E1 + bl b_call_bc_move_exec + mov r1, r10 + adds r1, 0x9 + lsls r1, 24 + lsrs r1, 24 + add r5, sp, 0x4 + str r5, [sp] + movs r0, 0 + movs r2, 0 + movs r3, 0x1 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + movs r0, 0x3 + str r0, [sp, 0xC] + bl _080451DE + .pool +_080448B0: + ldr r0, =0x02024084 + movs r1, 0x58 + muls r1, r7 + adds r0, 0x18 + adds r1, r0 + movs r2, 0x6 + movs r3, 0x7 + mov r10, r3 +_080448C0: + movs r0, 0 + ldrsb r0, [r1, r0] + cmp r0, 0x5 + bgt _080448CE + strb r2, [r1] + movs r5, 0x5 + str r5, [sp, 0xC] +_080448CE: + adds r1, 0x1 + movs r0, 0x1 + negs r0, r0 + add r10, r0 + mov r3, r10 + cmp r3, 0 + bge _080448C0 + movs r5, 0x8 + mov r10, r5 + ldr r0, [sp, 0xC] + cmp r0, 0 + bne _080448EA + bl _0804582A +_080448EA: + ldr r0, =0x02024474 + strb r7, [r0, 0x17] + ldr r0, =0x0202420f + strb r7, [r0] + ldr r1, =0x02024064 + ldr r0, =0x0202420b + strb r7, [r0] + strb r7, [r1] + ldr r0, =gUnknown_082DB7AE + bl b_call_bc_move_exec + bl _080451D6 + .pool +_0804491C: + movs r0, 0x58 + muls r0, r7 + mov r2, r8 + adds r1, r0, r2 + ldrh r0, [r1, 0x28] + ldrh r3, [r1, 0x2C] + cmp r0, r3 + bcc _08044930 + bl _080451D6 +_08044930: + cmp r6, 0 + beq _08044938 + bl _080451D6 +_08044938: + ldr r3, =0x020241f0 + ldrh r0, [r1, 0x2C] + lsrs r0, 4 + str r0, [r3] + cmp r0, 0 + bne _08044948 + movs r0, 0x1 + str r0, [r3] +_08044948: + ldrh r2, [r1, 0x28] + ldr r0, [r3] + adds r0, r2, r0 + ldrh r1, [r1, 0x2C] + cmp r0, r1 + ble _08044958 + subs r0, r1, r2 + str r0, [r3] +_08044958: + ldr r0, [r3] + negs r0, r0 + str r0, [r3] + ldr r0, =gUnknown_082DB7F1 + bl b_call_bc_move_exec + movs r0, 0x4 + str r0, [sp, 0xC] + adds r0, r7, 0 + adds r1, r5, 0 + bl b_history__record_item_x12_of_player + bl _080451D6 + .pool +_0804497C: + movs r0, 0x58 + adds r1, r7, 0 + muls r1, r0 + str r1, [sp, 0x18] + adds r4, r1, 0 + add r4, r8 + ldrh r0, [r4, 0x2C] + ldrh r1, [r4, 0x28] + lsrs r0, 1 + cmp r1, r0 + bls _08044996 + bl _080451D6 +_08044996: + cmp r6, 0 + beq _0804499E + bl _080451D6 +_0804499E: + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x8 + strb r0, [r1, 0x1] + strb r6, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x3] + ldr r5, =0x020241f0 + ldrh r0, [r4, 0x2C] + mov r1, r9 + bl __divsi3 + str r0, [r5] + cmp r0, 0 + bne _080449C2 + movs r0, 0x1 + str r0, [r5] +_080449C2: + ldrh r2, [r4, 0x28] + ldr r0, [r5] + adds r0, r2, r0 + ldrh r1, [r4, 0x2C] + cmp r0, r1 + ble _080449D2 + subs r0, r1, r2 + str r0, [r5] +_080449D2: + ldr r0, [r5] + negs r0, r0 + str r0, [r5] + mov r0, r8 + adds r0, 0x48 + ldr r2, [sp, 0x18] + adds r0, r2, r0 + ldr r0, [r0] + movs r1, 0 + bl sub_806E880 + lsls r0, 24 + cmp r0, 0 + bge _080449F0 + b _08044B7C +_080449F0: + b _08044B90 + .pool +_080449FC: + movs r0, 0x58 + adds r5, r7, 0 + muls r5, r0 + str r5, [sp, 0x1C] + add r5, r8 + ldrh r0, [r5, 0x2C] + ldrh r1, [r5, 0x28] + lsrs r0, 1 + cmp r1, r0 + bls _08044A14 + bl _080451D6 +_08044A14: + cmp r6, 0 + beq _08044A1C + bl _080451D6 +_08044A1C: + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x8 + strb r0, [r1, 0x1] + movs r6, 0x1 + strb r6, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x3] + ldr r4, =0x020241f0 + ldrh r0, [r5, 0x2C] + mov r1, r9 + bl __divsi3 + str r0, [r4] + cmp r0, 0 + bne _08044A40 + str r6, [r4] +_08044A40: + ldrh r2, [r5, 0x28] + ldr r0, [r4] + adds r0, r2, r0 + ldrh r1, [r5, 0x2C] + cmp r0, r1 + ble _08044A50 + subs r0, r1, r2 + str r0, [r4] +_08044A50: + ldr r0, [r4] + negs r0, r0 + str r0, [r4] + mov r0, r8 + adds r0, 0x48 + ldr r1, [sp, 0x1C] + adds r0, r1, r0 + ldr r0, [r0] + movs r1, 0x1 + bl sub_806E880 + lsls r0, 24 + cmp r0, 0 + bge _08044A6E + b _08044C0E +_08044A6E: + b _08044C24 + .pool +_08044A78: + movs r0, 0x58 + adds r3, r7, 0 + muls r3, r0 + str r3, [sp, 0x20] + adds r5, r3, 0 + add r5, r8 + ldrh r0, [r5, 0x2C] + ldrh r1, [r5, 0x28] + lsrs r0, 1 + cmp r1, r0 + bls _08044A90 + b _080451D6 +_08044A90: + cmp r6, 0 + beq _08044A96 + b _080451D6 +_08044A96: + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x8 + strb r0, [r1, 0x1] + movs r0, 0x2 + strb r0, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x3] + ldr r4, =0x020241f0 + ldrh r0, [r5, 0x2C] + mov r1, r9 + bl __divsi3 + str r0, [r4] + cmp r0, 0 + bne _08044ABC + movs r0, 0x1 + str r0, [r4] +_08044ABC: + ldrh r2, [r5, 0x28] + ldr r0, [r4] + adds r0, r2, r0 + ldrh r1, [r5, 0x2C] + cmp r0, r1 + ble _08044ACC + subs r0, r1, r2 + str r0, [r4] +_08044ACC: + ldr r0, [r4] + negs r0, r0 + str r0, [r4] + mov r0, r8 + adds r0, 0x48 + ldr r5, [sp, 0x20] + adds r0, r5, r0 + ldr r0, [r0] + movs r1, 0x2 + bl sub_806E880 + lsls r0, 24 + cmp r0, 0 + bge _08044AFC + ldr r0, =gUnknown_082DB824 + bl b_call_bc_move_exec + b _08044B02 + .pool +_08044AFC: + ldr r0, =gUnknown_082DB7C4 + bl b_call_bc_move_exec +_08044B02: + movs r0, 0x4 + str r0, [sp, 0xC] + b _080451DE + .pool +_08044B0C: + movs r0, 0x58 + adds r1, r7, 0 + muls r1, r0 + str r1, [sp, 0x24] + adds r5, r1, 0 + add r5, r8 + ldrh r0, [r5, 0x2C] + ldrh r1, [r5, 0x28] + lsrs r0, 1 + cmp r1, r0 + bls _08044B24 + b _080451D6 +_08044B24: + cmp r6, 0 + beq _08044B2A + b _080451D6 +_08044B2A: + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x8 + strb r0, [r1, 0x1] + movs r0, 0x3 + strb r0, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x3] + ldr r4, =0x020241f0 + ldrh r0, [r5, 0x2C] + mov r1, r9 + bl __divsi3 + str r0, [r4] + cmp r0, 0 + bne _08044B50 + movs r0, 0x1 + str r0, [r4] +_08044B50: + ldrh r2, [r5, 0x28] + ldr r0, [r4] + adds r0, r2, r0 + ldrh r1, [r5, 0x2C] + cmp r0, r1 + ble _08044B60 + subs r0, r1, r2 + str r0, [r4] +_08044B60: + ldr r0, [r4] + negs r0, r0 + str r0, [r4] + mov r0, r8 + adds r0, 0x48 + ldr r2, [sp, 0x24] + adds r0, r2, r0 + ldr r0, [r0] + movs r1, 0x3 + bl sub_806E880 + lsls r0, 24 + cmp r0, 0 + bge _08044B90 +_08044B7C: + ldr r0, =gUnknown_082DB824 + bl b_call_bc_move_exec + b _08044B96 + .pool +_08044B90: + ldr r0, =gUnknown_082DB7C4 + bl b_call_bc_move_exec +_08044B96: + movs r3, 0x4 + str r3, [sp, 0xC] + b _080451DE + .pool +_08044BA0: + movs r0, 0x58 + adds r5, r7, 0 + muls r5, r0 + str r5, [sp, 0x28] + add r5, r8 + ldrh r0, [r5, 0x2C] + ldrh r1, [r5, 0x28] + lsrs r0, 1 + cmp r1, r0 + bls _08044BB6 + b _080451D6 +_08044BB6: + cmp r6, 0 + beq _08044BBC + b _080451D6 +_08044BBC: + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x8 + strb r0, [r1, 0x1] + movs r0, 0x4 + strb r0, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x3] + ldr r4, =0x020241f0 + ldrh r0, [r5, 0x2C] + mov r1, r9 + bl __divsi3 + str r0, [r4] + cmp r0, 0 + bne _08044BE2 + movs r0, 0x1 + str r0, [r4] +_08044BE2: + ldrh r2, [r5, 0x28] + ldr r0, [r4] + adds r0, r2, r0 + ldrh r1, [r5, 0x2C] + cmp r0, r1 + ble _08044BF2 + subs r0, r1, r2 + str r0, [r4] +_08044BF2: + ldr r0, [r4] + negs r0, r0 + str r0, [r4] + mov r0, r8 + adds r0, 0x48 + ldr r1, [sp, 0x28] + adds r0, r1, r0 + ldr r0, [r0] + movs r1, 0x4 + bl sub_806E880 + lsls r0, 24 + cmp r0, 0 + bge _08044C24 +_08044C0E: + ldr r0, =gUnknown_082DB824 + bl b_call_bc_move_exec + b _08044C2A + .pool +_08044C24: + ldr r0, =gUnknown_082DB7C4 + bl b_call_bc_move_exec +_08044C2A: + movs r2, 0x4 + str r2, [sp, 0xC] + b _080451DE + .pool +_08044C34: + movs r0, 0x58 + muls r0, r7 + mov r3, r8 + adds r5, r0, r3 + ldrh r4, [r5, 0x28] + ldrh r0, [r5, 0x2C] + mov r1, r9 + bl __divsi3 + cmp r4, r0 + ble _08044C4C + b _080451D6 +_08044C4C: + cmp r6, 0 + beq _08044C52 + b _080451D6 +_08044C52: + movs r0, 0x19 + ldrsb r0, [r5, r0] + cmp r0, 0xB + ble _08044C5C + b _080451D6 +_08044C5C: + ldr r1, =0x02022f58 + movs r2, 0xFD + strb r2, [r1] + movs r0, 0x5 + strb r0, [r1, 0x1] + movs r0, 0x1 + strb r0, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x3] + ldr r1, =0x02022f68 + strb r2, [r1] + strb r6, [r1, 0x1] + movs r0, 0xD2 + strb r0, [r1, 0x2] + strb r6, [r1, 0x3] + subs r0, 0xD3 + strb r0, [r1, 0x4] + ldr r0, =0x0202420e + strb r7, [r0] + ldr r1, =0x02024474 + movs r0, 0x11 + strb r0, [r1, 0x1A] + movs r0, 0xF + b _08044DF0 + .pool +_08044C9C: + movs r0, 0x58 + muls r0, r7 + mov r1, r8 + adds r5, r0, r1 + ldrh r4, [r5, 0x28] + ldrh r0, [r5, 0x2C] + mov r1, r9 + bl __divsi3 + cmp r4, r0 + ble _08044CB4 + b _080451D6 +_08044CB4: + cmp r6, 0 + beq _08044CBA + b _080451D6 +_08044CBA: + movs r0, 0x1A + ldrsb r0, [r5, r0] + cmp r0, 0xB + ble _08044CC4 + b _080451D6 +_08044CC4: + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x5 + strb r0, [r1, 0x1] + movs r0, 0x2 + strb r0, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x3] + ldr r0, =0x0202420e + strb r7, [r0] + ldr r1, =0x02024474 + movs r0, 0x12 + strb r0, [r1, 0x1A] + movs r0, 0x10 + b _08044D8A + .pool +_08044CF0: + movs r0, 0x58 + muls r0, r7 + mov r3, r8 + adds r5, r0, r3 + ldrh r4, [r5, 0x28] + ldrh r0, [r5, 0x2C] + mov r1, r9 + bl __divsi3 + cmp r4, r0 + ble _08044D08 + b _080451D6 +_08044D08: + cmp r6, 0 + beq _08044D0E + b _080451D6 +_08044D0E: + movs r0, 0x1B + ldrsb r0, [r5, r0] + cmp r0, 0xB + ble _08044D18 + b _080451D6 +_08044D18: + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x5 + strb r0, [r1, 0x1] + movs r0, 0x3 + strb r0, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x3] + ldr r0, =0x0202420e + strb r7, [r0] + ldr r1, =0x02024474 + movs r0, 0x13 + strb r0, [r1, 0x1A] + movs r0, 0x11 + b _08044DF0 + .pool +_08044D44: + movs r0, 0x58 + muls r0, r7 + mov r1, r8 + adds r5, r0, r1 + ldrh r4, [r5, 0x28] + ldrh r0, [r5, 0x2C] + mov r1, r9 + bl __divsi3 + cmp r4, r0 + ble _08044D5C + b _080451D6 +_08044D5C: + cmp r6, 0 + beq _08044D62 + b _080451D6 +_08044D62: + movs r0, 0x1C + ldrsb r0, [r5, r0] + cmp r0, 0xB + ble _08044D6C + b _080451D6 +_08044D6C: + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x5 + strb r0, [r1, 0x1] + movs r0, 0x4 + strb r0, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x3] + ldr r0, =0x0202420e + strb r7, [r0] + ldr r1, =0x02024474 + movs r0, 0x14 + strb r0, [r1, 0x1A] + movs r0, 0x12 +_08044D8A: + strb r0, [r1, 0x10] + strb r6, [r1, 0x11] + ldr r0, =gUnknown_082DB84E + bl b_call_bc_move_exec + movs r2, 0x5 + str r2, [sp, 0xC] + b _080451DE + .pool +_08044DAC: + movs r0, 0x58 + muls r0, r7 + mov r3, r8 + adds r5, r0, r3 + ldrh r4, [r5, 0x28] + ldrh r0, [r5, 0x2C] + mov r1, r9 + bl __divsi3 + cmp r4, r0 + ble _08044DC4 + b _080451D6 +_08044DC4: + cmp r6, 0 + beq _08044DCA + b _080451D6 +_08044DCA: + movs r0, 0x1D + ldrsb r0, [r5, r0] + cmp r0, 0xB + ble _08044DD4 + b _080451D6 +_08044DD4: + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x5 + strb r0, [r1, 0x1] + strb r0, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x3] + ldr r0, =0x0202420e + strb r7, [r0] + ldr r1, =0x02024474 + movs r0, 0x15 + strb r0, [r1, 0x1A] + movs r0, 0x13 +_08044DF0: + strb r0, [r1, 0x10] + strb r6, [r1, 0x11] + ldr r0, =gUnknown_082DB84E + bl b_call_bc_move_exec + movs r5, 0x5 + str r5, [sp, 0xC] + b _080451DE + .pool +_08044E10: + movs r0, 0x58 + adds r5, r7, 0 + muls r5, r0 + mov r1, r8 + adds r0, r5, r1 + ldrh r4, [r0, 0x28] + ldrh r0, [r0, 0x2C] + mov r1, r9 + bl __divsi3 + cmp r4, r0 + ble _08044E2A + b _080451D6 +_08044E2A: + cmp r6, 0 + beq _08044E30 + b _080451D6 +_08044E30: + mov r0, r8 + adds r0, 0x50 + adds r1, r5, r0 + ldr r2, [r1] + movs r3, 0x80 + lsls r3, 13 + adds r0, r2, 0 + ands r0, r3 + cmp r0, 0 + beq _08044E46 + b _080451D6 +_08044E46: + orrs r2, r3 + str r2, [r1] + ldr r0, =gUnknown_082DB869 + bl b_call_bc_move_exec + movs r2, 0x2 + str r2, [sp, 0xC] + b _080451DE + .pool +_08044E5C: + cmp r6, 0 + beq _08044E62 + b _080451D6 +_08044E62: + movs r0, 0x58 + adds r5, r7, 0 + muls r5, r0 + mov r3, r8 + adds r0, r5, r3 + ldrh r4, [r0, 0x28] + ldrh r0, [r0, 0x2C] + mov r1, r9 + bl __divsi3 + cmp r4, r0 + ble _08044E7C + b _080451D6 +_08044E7C: + movs r0, 0 + mov r10, r0 + adds r0, r5, 0x1 + mov r1, r8 + adds r1, 0x18 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0xB + ble _08044EAC + mov r0, r8 + adds r0, 0x19 + adds r1, r5, r0 +_08044E98: + adds r1, 0x1 + movs r2, 0x1 + add r10, r2 + mov r3, r10 + cmp r3, 0x4 + bgt _08044EAC + movs r0, 0 + ldrsb r0, [r1, r0] + cmp r0, 0xB + bgt _08044E98 +_08044EAC: + mov r5, r10 + cmp r5, 0x5 + bne _08044EB4 + b _080451D6 +_08044EB4: + movs r0, 0x58 + muls r0, r7 + adds r4, r0, 0x1 + ldr r5, =0x0202409c +_08044EBC: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x5 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + adds r0, r4 + adds r0, r5 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0xC + beq _08044EBC + ldr r1, =0x02022f58 + movs r2, 0 + movs r3, 0xFD + strb r3, [r1] + movs r0, 0x5 + strb r0, [r1, 0x1] + mov r0, r10 + adds r0, 0x1 + strb r0, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x3] + ldr r0, =0x02022f68 + strb r3, [r0] + strb r2, [r0, 0x1] + movs r1, 0xD1 + strb r1, [r0, 0x2] + strb r2, [r0, 0x3] + strb r2, [r0, 0x4] + movs r1, 0xD2 + strb r1, [r0, 0x5] + strb r2, [r0, 0x6] + subs r1, 0xD3 + strb r1, [r0, 0x7] + ldr r0, =0x0202420e + strb r7, [r0] + ldr r1, =0x02024474 + mov r0, r10 + adds r0, 0x21 + strb r0, [r1, 0x1A] + adds r0, 0x6 + strb r0, [r1, 0x10] + strb r2, [r1, 0x11] + ldr r0, =gUnknown_082DB84E + bl b_call_bc_move_exec + movs r0, 0x5 + str r0, [sp, 0xC] + b _080451DE + .pool +_08044F44: + movs r0, 0x58 + adds r1, r7, 0 + muls r1, r0 + mov r0, r8 + adds r0, 0x4C + adds r1, r0 + ldr r2, [r1] + movs r0, 0x40 + ands r0, r2 + cmp r0, 0 + bne _08044F5C + b _080451D6 +_08044F5C: + movs r0, 0x41 + negs r0, r0 + ands r2, r0 + str r2, [r1] + ldr r0, =gUnknown_082DB706 + bl b_call_bc_move_exec + movs r1, 0x1 + str r1, [sp, 0xC] + b _080451DE + .pool +_08044F74: + movs r0, 0x58 + adds r1, r7, 0 + muls r1, r0 + mov r0, r8 + adds r0, 0x4C + adds r1, r0 + ldr r2, [r1] + movs r0, 0x88 + ands r0, r2 + cmp r0, 0 + bne _08044F8C + b _080451D6 +_08044F8C: + ldr r0, =0xfffff077 + ands r2, r0 + str r2, [r1] + ldr r0, =gUnknown_082DB71E + bl b_call_bc_move_exec + movs r2, 0x1 + str r2, [sp, 0xC] + b _080451DE + .pool +_08044FA8: + movs r0, 0x58 + adds r1, r7, 0 + muls r1, r0 + mov r0, r8 + adds r0, 0x4C + adds r1, r0 + ldr r2, [r1] + movs r0, 0x10 + ands r0, r2 + cmp r0, 0 + bne _08044FC0 + b _080451D6 +_08044FC0: + movs r0, 0x11 + negs r0, r0 + ands r2, r0 + str r2, [r1] + ldr r0, =gUnknown_082DB736 + bl b_call_bc_move_exec + movs r3, 0x1 + str r3, [sp, 0xC] + b _080451DE + .pool +_08044FD8: + movs r0, 0x58 + adds r1, r7, 0 + muls r1, r0 + mov r0, r8 + adds r0, 0x4C + adds r1, r0 + ldr r2, [r1] + movs r0, 0x20 + ands r0, r2 + cmp r0, 0 + bne _08044FF0 + b _080451D6 +_08044FF0: + movs r0, 0x21 + negs r0, r0 + ands r2, r0 + str r2, [r1] + ldr r0, =gUnknown_082DB74E + bl b_call_bc_move_exec + movs r5, 0x1 + str r5, [sp, 0xC] + b _080451DE + .pool +_08045008: + movs r0, 0x58 + adds r3, r7, 0 + muls r3, r0 + mov r0, r8 + adds r0, 0x4C + adds r2, r3, r0 + ldr r1, [r2] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + bne _08045020 + b _080451D6 +_08045020: + movs r0, 0x8 + negs r0, r0 + ands r1, r0 + str r1, [r2] + mov r1, r8 + adds r1, 0x50 + adds r1, r3, r1 + ldr r0, [r1] + ldr r2, =0xf7ffffff + ands r0, r2 + str r0, [r1] + ldr r0, =gUnknown_082DB766 + b _0804518A + .pool +_08045044: + movs r0, 0x58 + adds r1, r7, 0 + muls r1, r0 + mov r0, r8 + adds r0, 0x50 + adds r1, r0 + ldr r2, [r1] + movs r0, 0x7 + ands r0, r2 + cmp r0, 0 + bne _0804505C + b _080451D6 +_0804505C: + movs r0, 0x8 + negs r0, r0 + ands r2, r0 + str r2, [r1] + ldr r0, =gUnknown_082DB77E + bl b_call_bc_move_exec + movs r1, 0x2 + str r1, [sp, 0xC] + b _080451DE + .pool +_08045074: + movs r0, 0x58 + adds r5, r7, 0 + muls r5, r0 + mov r0, r8 + adds r0, 0x4C + adds r4, r5, r0 + ldr r2, [r4] + ldrb r0, [r4] + cmp r0, 0 + bne _0804509A + mov r0, r8 + adds r0, 0x50 + adds r0, r5, r0 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + bne _0804509A + b _080451D6 +_0804509A: + movs r3, 0 + mov r10, r3 + movs r0, 0x88 + ands r2, r0 + cmp r2, 0 + beq _080450B2 + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC70 + bl CopyString + movs r0, 0x1 + mov r10, r0 +_080450B2: + ldr r0, [r4] + movs r1, 0x7 + mov r9, r1 + ands r0, r1 + mov r6, r8 + adds r6, 0x50 + cmp r0, 0 + beq _080450D8 + adds r2, r5, r6 + ldr r0, [r2] + ldr r1, =0xf7ffffff + ands r0, r1 + str r0, [r2] + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC78 + bl CopyString + movs r2, 0x1 + add r10, r2 +_080450D8: + ldr r0, [r4] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080450EE + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC80 + bl CopyString + movs r3, 0x1 + add r10, r3 +_080450EE: + ldr r0, [r4] + movs r1, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08045104 + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC88 + bl CopyString + movs r0, 0x1 + add r10, r0 +_08045104: + ldr r0, [r4] + movs r1, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0804511A + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC90 + bl CopyString + movs r1, 0x1 + add r10, r1 +_0804511A: + adds r0, r5, r6 + ldr r0, [r0] + mov r2, r9 + ands r0, r2 + cmp r0, 0 + beq _08045132 + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC98 + bl CopyString + movs r3, 0x1 + add r10, r3 +_08045132: + mov r5, r10 + cmp r5, 0x1 + bgt _08045164 + ldr r1, =0x02024332 + movs r0, 0 + b _08045168 + .pool +_08045164: + ldr r1, =0x02024332 + movs r0, 0x1 +_08045168: + strb r0, [r1, 0x5] + ldr r2, =0x02024084 + movs r0, 0x58 + adds r3, r7, 0 + muls r3, r0 + adds r0, r2, 0 + adds r0, 0x4C + adds r0, r3, r0 + movs r1, 0 + str r1, [r0] + adds r2, 0x50 + adds r3, r2 + ldr r0, [r3] + subs r1, 0x8 + ands r0, r1 + str r0, [r3] + ldr r0, =gUnknown_082DB794 +_0804518A: + bl b_call_bc_move_exec + movs r0, 0x1 + str r0, [sp, 0xC] + b _080451DE + .pool +_080451A0: + movs r0, 0x58 + adds r1, r7, 0 + muls r1, r0 + mov r0, r8 + adds r0, 0x50 + adds r1, r0 + ldr r2, [r1] + movs r0, 0xF0 + lsls r0, 12 + ands r0, r2 + cmp r0, 0 + beq _080451D6 + ldr r0, =0xfff0ffff + ands r2, r0 + str r2, [r1] + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BCA0 + bl CopyString + ldr r0, =gUnknown_082DB794 + bl b_call_bc_move_exec + ldr r1, =0x02024332 + movs r0, 0 + strb r0, [r1, 0x5] + movs r1, 0x2 + str r1, [sp, 0xC] +_080451D6: + ldr r2, [sp, 0xC] + cmp r2, 0 + bne _080451DE + b _0804582A +_080451DE: + ldr r0, =0x02024474 + strb r7, [r0, 0x17] + ldr r0, =0x0202420f + strb r7, [r0] + ldr r4, =0x02024064 + ldr r0, =0x0202420b + strb r7, [r0] + strb r7, [r4] + ldr r3, [sp, 0xC] + cmp r3, 0x1 + beq _08045220 + cmp r3, 0x3 + beq _08045226 + b _0804582A + .pool +_08045220: + movs r0, 0x58 + muls r0, r7 + b _0804568C +_08045226: + ldr r4, =0x02024084 + movs r0, 0x58 + adds r3, r7, 0 + muls r3, r0 + adds r0, r4, 0 + adds r0, 0x50 + adds r0, r3, r0 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 14 + ands r0, r1 + cmp r0, 0 + beq _08045242 + b _0804582A +_08045242: + ldr r1, =0x020242bc + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x18] + lsrs r1, 4 + ldr r2, =gUnknown_0832A328 + mov r5, r10 + lsls r0, r5, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _08045262 + b _0804582A +_08045262: + adds r1, r5, r3 + adds r0, r4, 0 + adds r0, 0x24 + adds r1, r0 + add r0, sp, 0x4 + ldrb r0, [r0] + strb r0, [r1] + b _0804582A + .pool +_08045280: + movs r7, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r7, r0 + bcc _0804528C + b _0804582A +_0804528C: + ldr r4, =0x02024208 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r7 + adds r0, r1 + ldrh r0, [r0, 0x2E] + strh r0, [r4] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xAF + bne _080452C0 + ldr r1, =0x02024404 + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + adds r0, r1 + ldrb r5, [r0, 0x7] + b _080452D0 + .pool +_080452C0: + ldrh r0, [r4] + bl itemid_get_x12 + lsls r0, 24 + lsrs r5, r0, 24 + ldrh r0, [r4] + bl itemid_get_quality +_080452D0: + subs r0, r5, 0x2 + cmp r0, 0x1A + bls _080452D8 + b _08045674 +_080452D8: + lsls r0, 2 + ldr r1, =_080452E8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080452E8: + .4byte _08045354 + .4byte _08045444 + .4byte _08045390 + .4byte _080453CC + .4byte _08045408 + .4byte _08045674 + .4byte _0804548C + .4byte _08045520 + .4byte _08045674 + .4byte _08045674 + .4byte _08045674 + .4byte _08045674 + .4byte _08045674 + .4byte _08045674 + .4byte _08045674 + .4byte _08045674 + .4byte _08045674 + .4byte _08045674 + .4byte _08045674 + .4byte _08045674 + .4byte _08045674 + .4byte _08045614 + .4byte _08045674 + .4byte _08045674 + .4byte _08045674 + .4byte _08045674 + .4byte _080454C8 +_08045354: + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r7 + adds r1, 0x4C + adds r2, r0, r1 + ldr r1, [r2] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0804536A + b _08045674 +_0804536A: + movs r0, 0x41 + negs r0, r0 + ands r1, r0 + str r1, [r2] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB70C + str r0, [r1] + movs r0, 0x1 + str r0, [sp, 0xC] + b _0804567A + .pool +_08045390: + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r7 + adds r1, 0x4C + adds r2, r0, r1 + ldr r1, [r2] + movs r0, 0x88 + ands r0, r1 + cmp r0, 0 + bne _080453A6 + b _08045674 +_080453A6: + ldr r0, =0xfffff077 + ands r1, r0 + str r1, [r2] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB724 + str r0, [r1] + movs r1, 0x1 + str r1, [sp, 0xC] + b _0804567A + .pool +_080453CC: + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r7 + adds r1, 0x4C + adds r2, r0, r1 + ldr r1, [r2] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _080453E2 + b _08045674 +_080453E2: + movs r0, 0x11 + negs r0, r0 + ands r1, r0 + str r1, [r2] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB73C + str r0, [r1] + movs r2, 0x1 + str r2, [sp, 0xC] + b _0804567A + .pool +_08045408: + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r7 + adds r1, 0x4C + adds r2, r0, r1 + ldr r1, [r2] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _0804541E + b _08045674 +_0804541E: + movs r0, 0x21 + negs r0, r0 + ands r1, r0 + str r1, [r2] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB754 + str r0, [r1] + movs r3, 0x1 + str r3, [sp, 0xC] + b _0804567A + .pool +_08045444: + ldr r2, =0x02024084 + movs r0, 0x58 + adds r4, r7, 0 + muls r4, r0 + adds r0, r2, 0 + adds r0, 0x4C + adds r3, r4, r0 + ldr r1, [r3] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + bne _0804545E + b _08045674 +_0804545E: + movs r0, 0x8 + negs r0, r0 + ands r1, r0 + str r1, [r3] + adds r2, 0x50 + adds r2, r4, r2 + ldr r0, [r2] + ldr r1, =0xf7ffffff + ands r0, r1 + str r0, [r2] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB76C + b _080455DC + .pool +_0804548C: + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r7 + adds r1, 0x50 + adds r2, r0, r1 + ldr r1, [r2] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + bne _080454A2 + b _08045674 +_080454A2: + movs r0, 0x8 + negs r0, r0 + ands r1, r0 + str r1, [r2] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB784 + str r0, [r1] + movs r0, 0x2 + str r0, [sp, 0xC] + b _0804567A + .pool +_080454C8: + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r7 + adds r1, 0x50 + adds r2, r0, r1 + ldr r1, [r2] + movs r0, 0xF0 + lsls r0, 12 + ands r0, r1 + cmp r0, 0 + bne _080454E0 + b _08045674 +_080454E0: + ldr r0, =0xfff0ffff + ands r1, r0 + str r1, [r2] + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BCA0 + bl CopyString + bl b_movescr_stack_push_cursor + ldr r1, =0x02024332 + movs r0, 0 + strb r0, [r1, 0x5] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB79A + str r0, [r1] + movs r1, 0x2 + str r1, [sp, 0xC] + b _0804567A + .pool +_08045520: + ldr r4, =0x02024084 + movs r0, 0x58 + adds r5, r7, 0 + muls r5, r0 + adds r0, r4, 0 + adds r0, 0x4C + adds r6, r5, r0 + ldr r2, [r6] + ldrb r0, [r6] + cmp r0, 0 + bne _08045548 + adds r0, r4, 0 + adds r0, 0x50 + adds r0, r5, r0 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + bne _08045548 + b _08045674 +_08045548: + movs r0, 0x88 + ands r2, r0 + cmp r2, 0 + beq _08045558 + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC70 + bl CopyString +_08045558: + ldr r0, [r6] + movs r2, 0x7 + mov r8, r2 + ands r0, r2 + adds r4, 0x50 + cmp r0, 0 + beq _08045578 + adds r2, r5, r4 + ldr r0, [r2] + ldr r1, =0xf7ffffff + ands r0, r1 + str r0, [r2] + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC78 + bl CopyString +_08045578: + ldr r0, [r6] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0804558A + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC80 + bl CopyString +_0804558A: + ldr r0, [r6] + movs r1, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0804559C + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC88 + bl CopyString +_0804559C: + ldr r0, [r6] + movs r1, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080455AE + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC90 + bl CopyString +_080455AE: + adds r5, r4 + ldr r0, [r5] + mov r3, r8 + ands r0, r3 + cmp r0, 0 + beq _080455C2 + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC98 + bl CopyString +_080455C2: + movs r4, 0 + str r4, [r6] + ldr r0, [r5] + movs r1, 0x8 + negs r1, r1 + ands r0, r1 + str r0, [r5] + bl b_movescr_stack_push_cursor + ldr r0, =0x02024332 + strb r4, [r0, 0x5] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB79A +_080455DC: + str r0, [r1] + movs r5, 0x1 + str r5, [sp, 0xC] + b _0804567A + .pool +_08045614: + ldr r0, =0x02024084 + mov r8, r0 + movs r0, 0x58 + adds r1, r7, 0 + muls r1, r0 + mov r0, r8 + adds r0, 0x18 + adds r1, r0 + movs r2, 0x6 + movs r3, 0x7 + mov r10, r3 +_0804562A: + movs r0, 0 + ldrsb r0, [r1, r0] + cmp r0, 0x5 + bgt _08045638 + strb r2, [r1] + movs r5, 0x5 + str r5, [sp, 0xC] +_08045638: + adds r1, 0x1 + movs r0, 0x1 + negs r0, r0 + add r10, r0 + mov r3, r10 + cmp r3, 0 + bge _0804562A + ldr r5, [sp, 0xC] + cmp r5, 0 + beq _080456B8 + ldr r0, =0x02024474 + strb r7, [r0, 0x17] + ldr r0, =0x0202420f + strb r7, [r0] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB7B4 + str r0, [r1] + b _0804582A + .pool +_08045674: + ldr r0, [sp, 0xC] + cmp r0, 0 + beq _080456B8 +_0804567A: + ldr r0, =0x02024474 + strb r7, [r0, 0x17] + ldr r0, =0x0202420f + strb r7, [r0] + ldr r4, =0x02024064 + strb r7, [r4] + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 +_0804568C: + ldr r1, =0x020240d0 + adds r0, r1 + str r0, [sp] + movs r0, 0 + movs r1, 0x28 + movs r2, 0 + movs r3, 0x4 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + b _0804582A + .pool +_080456B8: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r7, r0 + bcs _080456C8 + b _0804528C +_080456C8: + b _0804582A + .pool +_080456D0: + ldr r7, =0x020241f0 + ldr r0, [r7] + cmp r0, 0 + bne _080456DA + b _0804582A +_080456DA: + mov r1, r8 + cmp r1, 0x1E + beq _080456EC + cmp r1, 0x3E + beq _08045794 + b _0804582A + .pool +_080456EC: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _080456FA + b _0804582A +_080456FA: + ldr r2, =0x0202437c + ldr r4, =0x0202420c + ldrb r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r1, r0, 2 + adds r0, r2, 0 + adds r0, 0x8 + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _08045720 + adds r0, r2, 0 + adds r0, 0xC + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _08045720 + b _0804582A +_08045720: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + ldr r2, [sp, 0x10] + cmp r0, r2 + bcs _0804582A + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x8] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0804582A + ldr r2, =0x02024084 + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _0804582A + ldr r1, =0x02024332 + movs r0, 0x8 + strb r0, [r1, 0x3] + bl b_movescr_stack_push_cursor + movs r0, 0 + movs r1, 0 + bl sub_8048760 + bl b_movescr_stack_pop_cursor + b _0804582A + .pool +_08045794: + ldr r0, =0x0202427c + ldrb r0, [r0] + movs r5, 0x29 + ands r5, r0 + cmp r5, 0 + bne _0804582A + ldr r1, =0x0202437c + ldr r4, =0x0202420c + ldrb r2, [r4] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 2 + adds r6, r1, 0x4 + adds r0, r6 + ldr r1, [r0] + cmp r1, 0 + beq _0804582A + ldr r0, =0x0000ffff + cmp r1, r0 + beq _0804582A + ldr r0, =0x0202420b + ldrb r3, [r0] + cmp r3, r2 + beq _0804582A + ldr r2, =0x02024084 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r1, [r0, 0x28] + ldrh r0, [r0, 0x2C] + cmp r1, r0 + beq _0804582A + cmp r1, 0 + beq _0804582A + ldr r0, =0x02024208 + mov r1, sp + ldrh r1, [r1, 0x14] + strh r1, [r0] + ldr r0, =0x0202420f + strb r3, [r0] + ldr r0, =0x02024474 + strb r3, [r0, 0x17] + ldrb r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + ldr r1, [sp, 0x10] + bl __divsi3 + negs r0, r0 + str r0, [r7] + ldrb r1, [r4] + cmp r0, 0 + bne _0804580C + movs r0, 0x1 + negs r0, r0 + str r0, [r7] +_0804580C: + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + str r5, [r0] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB7F7 + str r0, [r1] + ldr r0, [sp, 0xC] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0xC] +_0804582A: + ldr r0, [sp, 0xC] + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end berry_effects_maybe + + thumb_func_start sub_8045868 +sub_8045868: @ 8045868 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x020242bc + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r2 + movs r2, 0 + strb r2, [r1, 0x10] + ldr r1, =0x02024084 + movs r2, 0x58 + adds r3, r0, 0 + muls r3, r2 + adds r1, 0x50 + adds r3, r1 + ldr r1, [r3] + ldr r2, =0xfdffffff + ands r1, r2 + str r1, [r3] + ldr r1, =0x020242ac + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldr r2, =0xffffbfff + ands r1, r2 + str r1, [r0] + bx lr + .pool + thumb_func_end sub_8045868 + + thumb_func_start sub_80458B4 +sub_80458B4: @ 80458B4 + push {lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _080458D0 + ldr r1, =gUnknown_0831BD10 + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 +_080458D0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80458B4 + + thumb_func_start sub_80458E0 +sub_80458E0: @ 80458E0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 16 + lsrs r7, r0, 16 + lsls r1, 24 + lsrs r0, r1, 24 + movs r5, 0 + cmp r0, 0 + beq _080458FE + subs r0, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + b _0804590A +_080458FE: + ldr r1, =gBattleMoves + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 2 + adds r0, r1 + ldrb r6, [r0, 0x6] +_0804590A: + cmp r6, 0x40 + bls _08045910 + b _08045C20 +_08045910: + lsls r0, r6, 2 + ldr r1, =_08045924 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08045924: + .4byte _08045A28 + .4byte _08045B28 + .4byte _08045C1C + .4byte _08045C20 + .4byte _08045B40 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045B28 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C1C + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045B28 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045B28 +_08045A28: + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_side_get_owner + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x02024294 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r2, r0, r1 + ldrb r0, [r2, 0x8] + cmp r0, 0 + beq _08045A5A + ldr r1, =0x02024084 + ldrb r4, [r2, 0x9] + movs r0, 0x58 + muls r0, r4 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _08045A5A + b _08045B70 +_08045A5A: + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r7, 1 + mov r8, r0 +_08045A6A: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x0202406c + ldrb r1, [r1] + bl __modsi3 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r6, =0x0202420b + ldrb r3, [r6] + cmp r5, r3 + beq _08045A6A + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + beq _08045A6A + ldr r0, =0x02024210 + ldrb r2, [r0] + ldr r1, =gUnknown_0832A328 + lsls r0, r5, 2 + adds r0, r1 + ldr r0, [r0] + ands r2, r0 + cmp r2, 0 + bne _08045A6A + ldr r0, =gBattleMoves + mov r3, r8 + adds r1, r3, r7 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x2] + cmp r0, 0xD + beq _08045AB8 + b _08045C20 +_08045AB8: + ldrb r1, [r6] + str r2, [sp] + movs r0, 0x10 + movs r2, 0x1F + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + bne _08045ACE + b _08045C20 +_08045ACE: + ldr r2, =0x02024084 + movs r1, 0x58 + adds r0, r5, 0 + muls r0, r1 + adds r0, r2 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x1F + bne _08045AE2 + b _08045C20 +_08045AE2: + movs r4, 0x2 + eors r5, r4 + adds r0, r5, 0 + muls r0, r1 + adds r0, r2 + adds r0, 0x20 + ldrb r1, [r0] + adds r0, r5, 0 + bl b_history__record_ability_usage_of_player + ldr r1, =0x0202437c + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + orrs r1, r4 + strb r1, [r0] + b _08045C20 + .pool +_08045B28: + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_get_per_side_status + adds r1, r0, 0 + movs r2, 0x1 + movs r0, 0x1 + ands r0, r1 + eors r0, r2 + b _08045BD2 + .pool +_08045B40: + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_side_get_owner + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x02024294 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r2, r0, r1 + ldrb r0, [r2, 0x8] + cmp r0, 0 + beq _08045B80 + ldr r1, =0x02024084 + ldrb r4, [r2, 0x9] + movs r0, 0x58 + muls r0, r4 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _08045B80 +_08045B70: + adds r5, r4, 0 + b _08045C20 + .pool +_08045B80: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r4, 0x1 + ands r0, r4 + cmp r0, 0 + beq _08045BFC + movs r0, 0x4 + ands r6, r0 + cmp r6, 0 + beq _08045BFC + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08045BC0 + bl GenerateRandomNumber + adds r1, r4, 0 + ands r1, r0 + cmp r1, 0 + beq _08045BBC + movs r0, 0x1 + b _08045BD2 + .pool +_08045BBC: + movs r0, 0x3 + b _08045BD2 +_08045BC0: + bl GenerateRandomNumber + adds r1, r4, 0 + ands r1, r0 + cmp r1, 0 + beq _08045BD0 + movs r0, 0 + b _08045BD2 +_08045BD0: + movs r0, 0x2 +_08045BD2: + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + lsls r0, r5, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _08045C20 + movs r0, 0x2 + eors r5, r0 + b _08045C20 + .pool +_08045BFC: + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_get_per_side_status + adds r1, r0, 0 + movs r2, 0x1 + movs r0, 0x1 + ands r0, r1 + eors r0, r2 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r5, r0, 24 + b _08045C20 + .pool +_08045C1C: + ldr r0, =0x0202420b + ldrb r5, [r0] +_08045C20: + ldr r0, =0x0202420b + ldrb r0, [r0] + ldr r1, =0x0202449c + ldr r1, [r1] + adds r0, r1 + strb r5, [r0, 0xC] + adds r0, r5, 0 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80458E0 + + thumb_func_start sub_8045C44 +sub_8045C44: @ 8045C44 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08045C8A + ldr r0, =0x0202406e + lsls r4, 1 + adds r5, r4, r0 + ldrh r0, [r5] + movs r7, 0x64 + muls r0, r7 + ldr r6, =0x020244ec + adds r0, r6 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + movs r1, 0xCD + lsls r1, 1 + cmp r0, r1 + beq _08045C98 + ldrh r0, [r5] + muls r0, r7 + adds r0, r6 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + cmp r0, 0x97 + beq _08045C98 +_08045C8A: + movs r0, 0x1 + b _08045CAE + .pool +_08045C98: + ldr r0, =0x0202406e + adds r0, r4, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x50 + movs r2, 0 + bl pokemon_getattr +_08045CAE: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8045C44 + + thumb_func_start sub_8045CBC +sub_8045CBC: @ 8045CBC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + movs r6, 0 + ldr r5, =0x02022fec + ldr r0, [r5] + ldr r1, =0x02000002 + ands r0, r1 + cmp r0, 0 + bne _08045DAC + ldr r4, =0x0202420b + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08045DAC + ldrb r0, [r4] + bl sub_8045C44 + cmp r0, 0 + beq _08045D76 + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _08045D08 + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _08045DAC +_08045D08: + ldr r0, =0x02022fec + ldr r1, [r0] + ldr r0, =0x003f0100 + ands r0, r1 + cmp r0, 0 + bne _08045DAC + movs r0, 0x80 + lsls r0, 17 + ands r1, r0 + cmp r1, 0 + bne _08045DAC + ldr r2, =0x02024084 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + muls r1, r0 + adds r0, r2, 0 + adds r0, 0x54 + adds r0, r1, r0 + ldr r0, [r0] + adds r2, 0x3C + adds r1, r2 + bl sub_806E8D4 + lsls r0, 24 + cmp r0, 0 + beq _08045DAC + ldr r0, =0x0000086e + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _08045DAC + movs r6, 0xA + ldr r0, =0x00000868 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _08045D5A + movs r6, 0x1E +_08045D5A: + ldr r0, =0x0000086a + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _08045D68 + movs r6, 0x32 +_08045D68: + ldr r0, =0x0000086c + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _08045D76 + movs r6, 0x46 +_08045D76: + ldr r5, =0x02024084 + ldr r0, =0x0202420b + mov r8, r0 + ldrb r0, [r0] + movs r7, 0x58 + muls r0, r7 + adds r0, r5 + adds r0, 0x2A + ldrb r0, [r0] + cmp r0, r6 + bls _08045DAC + bl GenerateRandomNumber + movs r1, 0xFF + ands r1, r0 + mov r2, r8 + ldrb r0, [r2] + adds r2, r0, 0 + muls r2, r7 + adds r0, r2, r5 + adds r0, 0x2A + ldrb r0, [r0] + adds r0, r6 + muls r0, r1 + asrs r4, r0, 8 + cmp r4, r6 + bge _08045DD4 +_08045DAC: + movs r0, 0 + b _08045FD0 + .pool +_08045DD4: + ldr r3, =0x020241ea + ldrh r0, [r3] + cmp r0, 0x63 + bne _08045DEA + adds r0, r5, 0 + adds r0, 0x50 + adds r0, r2, r0 + ldr r1, [r0] + ldr r2, =0xff7fffff + ands r1, r2 + str r1, [r0] +_08045DEA: + mov r1, r8 + ldrb r0, [r1] + muls r0, r7 + adds r1, r5, 0 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + beq _08045E20 + ldrh r0, [r3] + cmp r0, 0xAD + beq _08045E0A + cmp r0, 0xD6 + bne _08045E20 +_08045E0A: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB695 + b _08045F7A + .pool +_08045E20: + bl GenerateRandomNumber + movs r5, 0xFF + adds r1, r5, 0 + ands r1, r0 + ldr r7, =0x02024084 + ldr r2, =0x0202420b + mov r9, r2 + ldrb r3, [r2] + movs r0, 0x58 + mov r8, r0 + mov r0, r8 + muls r0, r3 + adds r0, r7 + adds r0, 0x2A + ldrb r2, [r0] + adds r0, r2, r6 + muls r0, r1 + asrs r4, r0, 8 + cmp r4, r6 + bge _08045EE8 + ldr r6, =gUnknown_0832A328 + ldr r5, =0x020241e8 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r6 + ldrb r1, [r0] + adds r0, r3, 0 + movs r2, 0xFF + bl sub_803FECC + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bne _08045E68 + b _08045F6A +_08045E68: + ldr r1, =0x020241e9 + mov r8, r1 + movs r7, 0x3 +_08045E6E: + bl GenerateRandomNumber + ands r0, r7 + mov r2, r8 + strb r0, [r2] + strb r0, [r5] + ldrb r0, [r5] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + ands r0, r4 + cmp r0, 0 + bne _08045E6E + ldr r4, =0x020241ee + ldr r3, =0x02024084 + ldr r0, =0x020241e8 + ldrb r0, [r0] + lsls r0, 1 + ldr r1, =0x0202420b + ldrb r2, [r1] + movs r1, 0x58 + muls r1, r2 + adds r0, r1 + adds r3, 0xC + adds r0, r3 + ldrh r0, [r0] + strh r0, [r4] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB6A5 + str r0, [r1] + ldrh r0, [r4] + movs r1, 0 + bl sub_80458E0 + ldr r1, =0x0202420c + strb r0, [r1] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 14 + b _08045FCA + .pool +_08045EE8: + subs r0, r2, r6 + lsls r0, 24 + lsrs r6, r0, 24 + bl GenerateRandomNumber + adds r4, r5, 0 + ands r4, r0 + cmp r4, r6 + bge _08045F64 + mov r1, r9 + ldrb r0, [r1] + mov r1, r8 + muls r1, r0 + adds r0, r7, 0 + adds r0, 0x4C + adds r0, r1, r0 + ldr r0, [r0] + ands r0, r5 + cmp r0, 0 + bne _08045F64 + adds r0, r1, r7 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x48 + beq _08045F64 + cmp r0, 0xF + beq _08045F64 + movs r2, 0 + ldr r0, =0x0202406c + ldrb r3, [r0] + mov r8, r0 + cmp r2, r3 + bge _08045F4A + ldr r0, [r7, 0x50] + movs r1, 0x70 + ands r0, r1 + cmp r0, 0 + bne _08045F4A + adds r1, r7, 0 + adds r1, 0x50 + movs r5, 0x70 +_08045F3A: + adds r1, 0x58 + adds r2, 0x1 + cmp r2, r3 + bge _08045F4A + ldr r0, [r1] + ands r0, r5 + cmp r0, 0 + beq _08045F3A +_08045F4A: + mov r0, r8 + ldrb r0, [r0] + cmp r2, r0 + bne _08045F64 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB6D9 + b _08045F7A + .pool +_08045F64: + subs r4, r6 + cmp r4, r6 + blt _08045F8C +_08045F6A: + bl GenerateRandomNumber + ldr r2, =0x02024332 + movs r1, 0x3 + ands r1, r0 + strb r1, [r2, 0x5] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB6AD +_08045F7A: + str r0, [r1] + movs r0, 0x1 + b _08045FD0 + .pool +_08045F8C: + ldr r4, =0x0202420b + ldrb r1, [r4] + movs r0, 0x58 + muls r1, r0 + ldr r0, =0x02024084 + adds r1, r0 + movs r0, 0x28 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + ldrb r0, [r4] + str r0, [sp, 0x8] + ldrb r0, [r4] + str r0, [sp, 0xC] + adds r0, r1, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_806957C + ldr r1, =0x020241f0 + str r0, [r1] + ldr r1, =0x0202420c + ldrb r0, [r4] + strb r0, [r1] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB6F0 + str r0, [r1] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 12 +_08045FCA: + orrs r0, r1 + str r0, [r2] + movs r0, 0x2 +_08045FD0: + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8045CBC + + thumb_func_start atk00_attackcanceler +atk00_attackcanceler: @ 8045FFC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + ldr r0, =0x0202433a + ldrb r0, [r0] + cmp r0, 0 + beq _08046020 + ldr r1, =0x02024083 + movs r0, 0xC + strb r0, [r1] + b _08046398 + .pool +_08046020: + ldr r2, =0x02024084 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _08046064 + ldr r2, =0x02024280 + ldr r1, [r2] + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + bne _08046064 + movs r0, 0x80 + lsls r0, 12 + orrs r1, r0 + str r1, [r2] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082D8A4E + b _08046396 + .pool +_08046064: + bl sub_8041A6C + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _08046072 + b _08046398 +_08046072: + ldr r0, =0x0202420c + ldrb r1, [r0] + str r2, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _0804608A + b _08046398 +_0804608A: + ldr r4, =0x02024084 + ldr r0, =0x020241e8 + ldrb r1, [r0] + ldr r3, =0x0202420b + ldrb r2, [r3] + movs r0, 0x58 + muls r2, r0 + adds r1, r2 + adds r0, r4, 0 + adds r0, 0x24 + adds r1, r0 + ldrb r0, [r1] + ldr r5, =0x02024280 + cmp r0, 0 + bne _08046108 + ldr r0, =0x020241ea + ldrh r0, [r0] + cmp r0, 0xA5 + beq _08046108 + ldr r0, [r5] + ldr r1, =0x00800200 + ands r0, r1 + cmp r0, 0 + bne _08046108 + adds r0, r4, 0 + adds r0, 0x50 + adds r0, r2, r0 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 5 + ands r0, r1 + cmp r0, 0 + bne _08046108 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB07A + str r0, [r1] + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + b _08046398 + .pool +_08046108: + ldr r0, [r5] + ldr r1, =0xff7fffff + ands r0, r1 + str r0, [r5] + movs r6, 0x80 + lsls r6, 18 + ands r0, r6 + cmp r0, 0 + bne _08046160 + ldrb r1, [r3] + movs r0, 0x58 + muls r0, r1 + adds r1, r4, 0 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 5 + ands r0, r1 + cmp r0, 0 + bne _08046160 + bl sub_8045CBC + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _08046160 + cmp r2, 0x2 + bne _08046150 + ldr r0, [r5] + orrs r0, r6 + str r0, [r5] + b _08046398 + .pool +_08046150: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] + b _08046398 + .pool +_08046160: + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 18 + orrs r0, r1 + str r0, [r2] + ldr r2, =0x0202433c + ldr r1, =0x0202420c + ldrb r3, [r1] + lsls r0, r3, 4 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 27 + mov r8, r1 + mov r9, r2 + cmp r0, 0 + bge _080461E8 + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x8] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080461E8 + ldr r0, =0x0202420b + ldrb r0, [r0] + ldr r2, =0x00000115 + adds r1, r3, 0 + bl sub_803F480 + mov r0, r8 + ldrb r1, [r0] + lsls r1, 4 + add r1, r9 + ldrb r2, [r1] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB194 + b _08046396 + .pool +_080461E8: + movs r2, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r2, r0 + bge _0804622A + ldr r6, =0x0202433c + ldr r1, =gBattleMoves + mov r12, r1 + adds r5, r0, 0 + ldr r7, =0x0202407e +_080461FC: + adds r4, r2, r7 + ldrb r3, [r4] + lsls r0, r3, 4 + adds r0, r6 + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _08046224 + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + add r0, r12 + ldrb r1, [r0, 0x8] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08046224 + b _08046350 +_08046224: + adds r2, 0x1 + cmp r2, r5 + blt _080461FC +_0804622A: + ldr r0, =0x0202437c + mov r1, r8 + ldrb r2, [r1] + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r3, [r1] + lsls r0, r3, 30 + cmp r0, 0 + bge _08046288 + movs r0, 0x3 + negs r0, r0 + ands r0, r3 + strb r0, [r1] + ldr r4, =0x0202420a + movs r0, 0x1F + strb r0, [r4] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB53E + str r0, [r1] + mov r1, r8 + ldrb r0, [r1] + ldrb r1, [r4] + bl b_history__record_ability_usage_of_player + b _08046398 + .pool +_08046288: + lsls r0, r2, 4 + add r0, r9 + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + bne _08046296 + b _08046390 +_08046296: + ldr r1, =gBattleMoves + ldr r2, =0x020241ea + ldrh r3, [r2] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x8] + movs r0, 0x2 + ands r0, r1 + adds r4, r2, 0 + cmp r0, 0 + beq _08046390 + cmp r3, 0xAE + bne _080462D4 + ldr r2, =0x02024084 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r1, r0, r2 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0x7 + beq _080462D4 + adds r0, r1, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0x7 + bne _08046390 +_080462D4: + ldrh r0, [r4] + bl sub_8052F48 + lsls r0, 24 + cmp r0, 0 + beq _080462FA + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 5 + ands r0, r1 + cmp r0, 0 + beq _08046390 +_080462FA: + ldr r0, =0x0202420b + ldrb r0, [r0] + bl b_cancel_multi_turn_move_maybe + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024250 + ldr r3, =0x0202420c + ldrb r0, [r3] + lsls r0, 1 + adds r0, r1 + movs r2, 0 + strh r2, [r0] + ldr r1, =0x02024258 + ldrb r0, [r3] + lsls r0, 1 + adds r0, r1 + strh r2, [r0] + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x6] + b _08046390 + .pool +_08046350: + ldr r0, =0x0202420b + ldrb r0, [r0] + ldr r2, =0x00000121 + adds r1, r3, 0 + bl sub_803F480 + ldrb r1, [r4] + lsls r1, 4 + adds r1, r6 + ldrb r2, [r1] + movs r0, 0x21 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, =0x02024474 + ldrb r0, [r4] + strb r0, [r1, 0x17] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB1AC + b _08046396 + .pool +_08046390: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 +_08046396: + str r0, [r1] +_08046398: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk00_attackcanceler + + thumb_func_start mcmd_jump_if_move_not_executed +mcmd_jump_if_move_not_executed: @ 80463AC + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r6, r1, 16 + ldr r1, =0x02024214 + ldr r5, [r1] + adds r4, r5, r0 + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _0804640C + ldr r1, =0x02024250 + ldr r3, =0x0202420c + ldrb r0, [r3] + lsls r0, 1 + adds r0, r1 + movs r2, 0 + strh r2, [r0] + ldr r1, =0x02024258 + ldrb r0, [r3] + lsls r0, 1 + adds r0, r1 + strh r2, [r0] + ldrb r4, [r5, 0x1] + ldrb r0, [r5, 0x2] + lsls r0, 8 + orrs r4, r0 + ldrb r0, [r5, 0x3] + lsls r0, 16 + orrs r4, r0 + ldrb r0, [r5, 0x4] + lsls r0, 24 + orrs r4, r0 + b _08046426 + .pool +_0804640C: + bl b_feature_update_destiny_bond + ldr r0, =0x0202420c + ldrb r1, [r0] + str r6, [sp] + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + bne _0804642A +_08046426: + ldr r0, =0x02024214 + str r4, [r0] +_0804642A: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end mcmd_jump_if_move_not_executed + + thumb_func_start atk40_801DBA0 +atk40_801DBA0: @ 804643C + push {lr} + ldr r1, =0x0202433c + ldr r0, =0x0202420c + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + beq _0804649C + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x8] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0804649C + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x5 + movs r1, 0 + bl mcmd_jump_if_move_not_executed + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x6] + b _080464A4 + .pool +_0804649C: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_080464A4: + pop {r0} + bx r0 + .pool + thumb_func_end atk40_801DBA0 + + thumb_func_start sub_80464AC +sub_80464AC: @ 80464AC + push {r4,lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r4, 0 + ldr r1, =0x0202433c + ldr r0, =0x0202420c + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + beq _080464F8 + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x8] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080464F8 + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x7 + adds r1, r3, 0 + bl mcmd_jump_if_move_not_executed + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x6] + movs r4, 0x1 +_080464F8: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80464AC + + thumb_func_start sub_8046518 +sub_8046518: @ 8046518 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r2, =0x020242ac + ldr r3, =0x0202420c + ldrb r4, [r3] + lsls r0, r4, 2 + adds r0, r2 + ldr r1, [r0] + movs r0, 0x18 + ands r1, r0 + adds r6, r2, 0 + cmp r1, 0 + beq _0804654A + ldr r1, =0x020242bc + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r0, r1 + ldr r1, =0x0202420b + ldrb r0, [r0, 0x15] + ldrb r1, [r1] + cmp r0, r1 + beq _08046634 +_0804654A: + ldr r0, =0x02024280 + ldr r1, [r0] + movs r2, 0x80 + lsls r2, 9 + ands r1, r2 + adds r2, r0, 0 + cmp r1, 0 + bne _08046590 + ldrb r0, [r3] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08046590 +_0804656A: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] + b _08046634 + .pool +_08046590: + ldr r0, [r2] + ldr r1, =0xfffeffff + ands r0, r1 + str r0, [r2] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + bne _080465B2 + ldrb r0, [r3] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0804656A +_080465B2: + ldr r0, [r2] + ldr r1, =0xfffdffff + ands r0, r1 + str r0, [r2] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + bne _080465D2 + ldrb r0, [r3] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + ands r0, r1 + cmp r0, 0 + bne _0804656A +_080465D2: + ldr r0, [r2] + ldr r1, =0xfffbffff + ands r0, r1 + str r0, [r2] + movs r0, 0 + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0xD + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + lsls r4, r5, 1 + cmp r0, 0 + bne _08046622 + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0x4D + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + bne _08046622 + ldr r0, =0x020243cc + ldrh r1, [r0] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + beq _08046622 + ldr r0, =gBattleMoves + adds r1, r4, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x98 + beq _08046634 +_08046622: + ldr r1, =gBattleMoves + adds r0, r4, r5 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x11 + beq _08046634 + cmp r0, 0x4E + bne _08046654 +_08046634: + movs r0, 0x7 + adds r1, r5, 0 + bl mcmd_jump_if_move_not_executed + movs r0, 0x1 + b _08046656 + .pool +_08046654: + movs r0, 0 +_08046656: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8046518 + + thumb_func_start atk01_accuracycheck +atk01_accuracycheck: @ 8046660 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + ldr r0, =0x02024214 + ldr r5, [r0] + ldrb r6, [r5, 0x5] + ldrb r1, [r5, 0x6] + lsls r1, 8 + orrs r6, r1 + adds r1, r6, 0x2 + lsls r1, 16 + lsrs r1, 16 + adds r7, r0, 0 + cmp r1, 0x1 + bhi _0804671C + ldr r2, =0x020242ac + ldr r3, =0x0202420c + ldrb r4, [r3] + lsls r0, r4, 2 + adds r0, r2 + ldr r1, [r0] + movs r0, 0x18 + ands r1, r0 + cmp r1, 0 + beq _080466D0 + ldr r0, =0x0000ffff + cmp r6, r0 + bne _080466D0 + ldr r1, =0x020242bc + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r0, r1 + ldr r1, =0x0202420b + ldrb r0, [r0, 0x15] + ldrb r1, [r1] + cmp r0, r1 + bne _080466D0 + adds r0, r5, 0x7 + str r0, [r7] + b _080469D2 + .pool +_080466D0: + ldrb r0, [r3] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ldr r1, =0x000400c0 + ands r0, r1 + cmp r0, 0 + beq _08046700 + ldr r2, [r7] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r7] + b _080469D2 + .pool +_08046700: + movs r0, 0 + bl sub_80464AC + lsls r0, 24 + cmp r0, 0 + beq _0804670E + b _080469D2 +_0804670E: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x7 + str r0, [r1] + b _080469D2 + .pool +_0804671C: + cmp r6, 0 + bne _08046724 + ldr r0, =0x020241ea + ldrh r6, [r0] +_08046724: + ldr r0, =0x0202449c + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0 + beq _08046744 + movs r1, 0x3F + mov r10, r1 + mov r2, r10 + ands r2, r0 + mov r10, r2 + b _08046752 + .pool +_08046744: + ldr r1, =gBattleMoves + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x2] + mov r10, r0 +_08046752: + adds r0, r6, 0 + bl sub_80464AC + lsls r0, 24 + cmp r0, 0 + beq _08046760 + b _080469D2 +_08046760: + adds r0, r6, 0 + bl sub_8046518 + lsls r0, 24 + cmp r0, 0 + beq _0804676E + b _080469D2 +_0804676E: + ldr r3, =0x02024084 + ldr r0, =0x0202420c + ldrb r0, [r0] + movs r2, 0x58 + adds r4, r0, 0 + muls r4, r2 + adds r0, r3, 0 + adds r0, 0x50 + adds r0, r4, r0 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 22 + ands r0, r1 + cmp r0, 0 + beq _080467A8 + ldr r0, =0x0202420b + ldrb r0, [r0] + muls r0, r2 + adds r0, r3 + ldrb r5, [r0, 0x1E] + b _080467BE + .pool +_080467A8: + ldr r0, =0x0202420b + ldrb r0, [r0] + muls r0, r2 + adds r0, r3 + ldrb r0, [r0, 0x1E] + adds r0, 0x6 + adds r1, r4, r3 + ldrb r1, [r1, 0x1F] + subs r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 +_080467BE: + lsls r0, r5, 24 + cmp r0, 0 + bge _080467C6 + movs r5, 0 +_080467C6: + lsls r0, r5, 24 + asrs r0, 24 + cmp r0, 0xC + ble _080467D0 + movs r5, 0xC +_080467D0: + ldr r1, =gBattleMoves + lsls r4, r6, 1 + adds r0, r4, r6 + lsls r0, 2 + adds r7, r0, r1 + ldrb r3, [r7, 0x3] + mov r8, r3 + movs r0, 0 + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0xD + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + str r4, [sp, 0x4] + cmp r0, 0 + bne _08046822 + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0x4D + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + bne _08046822 + ldr r0, =0x020243cc + ldrh r1, [r0] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _08046822 + ldrb r0, [r7] + cmp r0, 0x98 + bne _08046822 + movs r0, 0x32 + mov r8, r0 +_08046822: + ldr r1, =gUnknown_0831C0F4 + lsls r0, r5, 24 + asrs r0, 22 + adds r0, r1 + ldrb r1, [r0] + mov r4, r8 + muls r4, r1 + ldrb r1, [r0, 0x1] + adds r0, r4, 0 + bl __divsi3 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r7, =0x02024084 + ldr r0, =0x0202420b + ldrb r0, [r0] + movs r5, 0x58 + muls r0, r5 + adds r0, r7 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0xE + bne _08046860 + lsls r0, r4, 6 + adds r0, r4 + lsls r0, 1 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r4, r0, 16 +_08046860: + movs r0, 0 + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0xD + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _080468B8 + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0x4D + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + bne _080468B8 + ldr r0, =0x0202420c + ldrb r0, [r0] + muls r0, r5 + adds r0, r7 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x8 + bne _080468B8 + ldr r0, =0x020243cc + ldrh r1, [r0] + movs r0, 0x18 + ands r0, r1 + cmp r0, 0 + beq _080468B8 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 4 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r4, r0, 16 +_080468B8: + ldr r2, =0x02024084 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x20 + ldrb r0, [r0] + mov r9, r2 + cmp r0, 0x37 + bne _080468E4 + mov r1, r10 + cmp r1, 0x8 + bhi _080468E4 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 4 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r4, r0, 16 +_080468E4: + ldr r2, =0x0202420c + mov r8, r2 + ldrb r2, [r2] + movs r7, 0x58 + adds r0, r2, 0 + muls r0, r7 + mov r3, r9 + adds r1, r0, r3 + ldrh r0, [r1, 0x2E] + cmp r0, 0xAF + bne _08046928 + ldr r1, =0x02024404 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r5, [r0, 0x7] + ldrb r2, [r0, 0x1A] + b _08046944 + .pool +_08046928: + ldrh r0, [r1, 0x2E] + bl itemid_get_x12 + lsls r0, 24 + lsrs r5, r0, 24 + mov r1, r8 + ldrb r0, [r1] + muls r0, r7 + add r0, r9 + ldrh r0, [r0, 0x2E] + bl itemid_get_quality + lsls r0, 24 + lsrs r2, r0, 24 +_08046944: + ldr r0, =0x0202420f + ldr r1, =0x0202420c + ldrb r1, [r1] + strb r1, [r0] + cmp r5, 0x16 + bne _08046960 + movs r0, 0x64 + subs r0, r2 + muls r0, r4 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r4, r0, 16 +_08046960: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + adds r0, 0x1 + cmp r0, r4 + ble _080469CA + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080469C0 + ldr r1, =gBattleMoves + ldr r2, [sp, 0x4] + adds r0, r2, r6 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x6] + cmp r0, 0x8 + beq _080469A2 + cmp r0, 0x20 + bne _080469C0 +_080469A2: + ldr r1, =0x02024332 + movs r0, 0x2 + b _080469C4 + .pool +_080469C0: + ldr r1, =0x02024332 + movs r0, 0 +_080469C4: + strb r0, [r1, 0x6] + bl b_wonderguard_and_levitate +_080469CA: + movs r0, 0x7 + adds r1, r6, 0 + bl mcmd_jump_if_move_not_executed +_080469D2: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk01_accuracycheck + + thumb_func_start atk02_attackstring +atk02_attackstring: @ 80469E8 + push {r4,r5,lr} + ldr r0, =0x02024068 + ldr r5, [r0] + cmp r5, 0 + bne _08046A20 + ldr r4, =0x02024280 + ldr r0, [r4] + movs r1, 0xC0 + lsls r1, 3 + ands r0, r1 + cmp r0, 0 + bne _08046A14 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x4 + bl b_std_message + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 3 + orrs r0, r1 + str r0, [r4] +_08046A14: + ldr r0, =0x02024214 + ldr r1, [r0] + adds r1, 0x1 + str r1, [r0] + ldr r0, =0x02024332 + strb r5, [r0, 0x7] +_08046A20: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk02_attackstring + + thumb_func_start atk03_ppreduce +atk03_ppreduce: @ 8046A3C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r6, 0x1 + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + beq _08046A54 + b _08046BEE +_08046A54: + ldr r1, =0x0202437c + ldr r2, =0x0202420b + ldrb r3, [r2] + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r4, r0, 31 + mov r9, r2 + cmp r4, 0 + bne _08046AF6 + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x6] + cmp r0, 0x20 + beq _08046AA6 + cmp r0, 0x20 + bgt _08046AA0 + cmp r0, 0x8 + beq _08046ABC + b _08046AD6 + .pool +_08046AA0: + cmp r0, 0x40 + beq _08046ABC + b _08046AD6 +_08046AA6: + str r4, [sp] + movs r0, 0x12 + adds r1, r3, 0 + movs r2, 0x2E + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0x1 + b _08046AF6 +_08046ABC: + mov r0, r9 + ldrb r1, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x10 + movs r2, 0x2E + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + adds r6, r0 + b _08046AF6 +_08046AD6: + ldr r1, =0x0202420c + mov r2, r9 + ldrb r0, [r2] + ldrb r7, [r1] + cmp r0, r7 + beq _08046AF6 + ldr r2, =0x02024084 + ldrb r1, [r1] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x2E + bne _08046AF6 + adds r6, 0x1 +_08046AF6: + ldr r0, =0x02024280 + ldr r4, [r0] + movs r0, 0xA0 + lsls r0, 4 + ands r4, r0 + cmp r4, 0 + bne _08046BDC + ldr r2, =0x02024084 + ldr r3, =0x020241e8 + ldr r1, =0x0202420b + ldrb r5, [r1] + movs r0, 0x58 + mov r8, r0 + mov r0, r8 + muls r0, r5 + ldrb r7, [r3] + adds r0, r7 + movs r7, 0x24 + adds r7, r2 + mov r12, r7 + add r0, r12 + ldrb r0, [r0] + mov r9, r1 + mov r10, r2 + adds r7, r3, 0 + cmp r0, 0 + beq _08046BDC + ldr r0, =0x0202433c + lsls r1, r5, 4 + adds r1, r0 + ldrb r0, [r1, 0x2] + movs r2, 0x8 + orrs r0, r2 + strb r0, [r1, 0x2] + mov r1, r9 + ldrb r0, [r1] + mov r2, r8 + muls r2, r0 + adds r0, r2, 0 + ldrb r1, [r7] + adds r0, r1 + mov r1, r12 + adds r2, r0, r1 + ldrb r0, [r2] + cmp r0, r6 + ble _08046B70 + subs r0, r6 + strb r0, [r2] + b _08046B72 + .pool +_08046B70: + strb r4, [r2] +_08046B72: + mov r2, r9 + ldrb r3, [r2] + movs r4, 0x58 + adds r0, r3, 0 + muls r0, r4 + mov r1, r10 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 14 + ands r0, r1 + cmp r0, 0 + bne _08046BDC + ldr r1, =0x020242bc + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x18] + lsrs r1, 4 + ldr r2, =gUnknown_0832A328 + ldrb r0, [r7] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08046BDC + ldr r0, =0x02024064 + strb r3, [r0] + ldrb r1, [r7] + adds r1, 0x9 + lsls r1, 24 + lsrs r1, 24 + mov r2, r9 + ldrb r0, [r2] + muls r0, r4 + mov r2, r10 + adds r2, 0x24 + adds r0, r2 + ldrb r7, [r7] + adds r0, r7 + str r0, [sp] + movs r0, 0 + movs r2, 0 + movs r3, 0x1 + bl dp01_build_cmdbuf_x02_a_b_varargs + mov r7, r9 + ldrb r0, [r7] + bl dp01_battle_side_mark_buffer_for_execution +_08046BDC: + ldr r2, =0x02024280 + ldr r0, [r2] + ldr r1, =0xfffff7ff + ands r0, r1 + str r0, [r2] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_08046BEE: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk03_ppreduce + + thumb_func_start atk04_critcalc +atk04_critcalc: @ 8046C18 + push {r4-r7,lr} + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldrh r0, [r0, 0x2E] + cmp r0, 0xAF + bne _08046C48 + ldr r1, =0x02024404 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r6, [r0, 0x7] + b _08046C50 + .pool +_08046C48: + bl itemid_get_x12 + lsls r0, 24 + lsrs r6, r0, 24 +_08046C50: + ldr r1, =0x0202420f + ldr r3, =0x0202420b + ldrb r0, [r3] + strb r0, [r1] + ldr r4, =0x02024084 + ldrb r1, [r3] + movs r0, 0x58 + adds r7, r1, 0 + muls r7, r0 + adds r0, r4, 0 + adds r0, 0x50 + adds r0, r7, r0 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 13 + ands r0, r1 + negs r0, r0 + asrs r5, r0, 31 + movs r0, 0x2 + ands r5, r0 + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + mov r12, r3 + cmp r1, 0x2B + bne _08046C90 + adds r5, 0x1 +_08046C90: + adds r0, r5, 0 + cmp r1, 0x4B + bne _08046C98 + adds r0, 0x1 +_08046C98: + cmp r1, 0xC8 + bne _08046C9E + adds r0, 0x1 +_08046C9E: + adds r2, r0, 0 + cmp r1, 0xD1 + bne _08046CA6 + adds r2, 0x1 +_08046CA6: + movs r1, 0 + cmp r6, 0x3F + bne _08046CB6 + adds r0, r7, r4 + ldrh r0, [r0] + cmp r0, 0x71 + bne _08046CB6 + movs r1, 0x1 +_08046CB6: + lsls r5, r1, 1 + movs r3, 0 + cmp r6, 0x42 + bne _08046CD0 + mov r0, r12 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r4 + ldrh r0, [r0] + cmp r0, 0x53 + bne _08046CD0 + movs r3, 0x1 +_08046CD0: + lsls r1, r3, 1 + cmp r6, 0x29 + bne _08046CF0 + adds r0, r5, 0x1 + adds r0, r2, r0 + b _08046CF2 + .pool +_08046CF0: + adds r0, r2, r5 +_08046CF2: + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + adds r5, r0, 0 + cmp r5, 0x4 + bls _08046D00 + movs r5, 0x4 +_08046D00: + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r4 + adds r0, 0x20 + ldrb r4, [r0] + cmp r4, 0x4 + beq _08046D70 + cmp r4, 0x4B + beq _08046D70 + ldr r1, =0x020242ac + mov r2, r12 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + bne _08046D70 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x84 + lsls r1, 2 + ands r0, r1 + cmp r0, 0 + bne _08046D70 + bl GenerateRandomNumber + ldr r2, =gUnknown_0831C128 + lsls r1, r5, 1 + adds r1, r2 + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r1] + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + bne _08046D70 + ldr r1, =0x02024211 + movs r0, 0x2 + b _08046D74 + .pool +_08046D70: + ldr r1, =0x02024211 + movs r0, 0x1 +_08046D74: + strb r0, [r1] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk04_critcalc + + thumb_func_start atk05_cmd5 +atk05_cmd5: @ 8046D8C + push {r4-r7,lr} + sub sp, 0x10 + ldr r4, =0x0202428e + ldr r5, =0x0202420c + ldrb r0, [r5] + bl battle_get_per_side_status + movs r1, 0x1 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + ldrh r3, [r1] + ldr r6, =0x0202420b + ldrb r0, [r6] + movs r4, 0x58 + muls r0, r4 + ldr r2, =0x02024084 + adds r0, r2 + ldrb r1, [r5] + muls r1, r4 + adds r1, r2 + ldr r7, =0x020241ea + ldrh r2, [r7] + ldr r4, =0x02024400 + ldrh r4, [r4] + str r4, [sp] + ldr r4, =0x0202449c + ldr r4, [r4] + ldrb r4, [r4, 0x13] + str r4, [sp, 0x4] + ldrb r4, [r6] + str r4, [sp, 0x8] + ldrb r4, [r5] + str r4, [sp, 0xC] + bl sub_806957C + ldr r4, =0x020241f0 + ldr r1, =0x02024211 + ldrb r1, [r1] + muls r1, r0 + ldr r0, =0x02024474 + ldrb r0, [r0, 0xE] + adds r3, r1, 0 + muls r3, r0 + str r3, [r4] + ldr r1, =0x020242ac + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 2 + ands r0, r1 + cmp r0, 0 + beq _08046E10 + ldr r2, =gBattleMoves + ldrh r1, [r7] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x2] + cmp r0, 0xD + bne _08046E10 + lsls r0, r3, 1 + str r0, [r4] +_08046E10: + ldr r1, =0x0202433c + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 28 + cmp r0, 0 + bge _08046E32 + ldr r4, =0x020241f0 + ldr r1, [r4] + lsls r0, r1, 4 + subs r0, r1 + movs r1, 0xA + bl __divsi3 + str r0, [r4] +_08046E32: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk05_cmd5 + + thumb_func_start sub_8046E7C +sub_8046E7C: @ 8046E7C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + adds r5, r1, 0 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r4, =0x0202428e + adds r0, r5, 0 + bl battle_get_per_side_status + movs r1, 0x1 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + ldrh r3, [r1] + movs r1, 0x58 + adds r0, r7, 0 + muls r0, r1 + ldr r2, =0x02024084 + adds r0, r2 + muls r1, r5 + adds r1, r2 + ldr r2, =0x020241ea + mov r8, r2 + ldrh r2, [r2] + ldr r6, =0x02024400 + ldrh r4, [r6] + str r4, [sp] + ldr r4, =0x0202449c + ldr r4, [r4] + ldrb r4, [r4, 0x13] + str r4, [sp, 0x4] + str r7, [sp, 0x8] + str r5, [sp, 0xC] + bl sub_806957C + ldr r4, =0x020241f0 + movs r1, 0 + strh r1, [r6] + ldr r1, =0x02024211 + ldrb r1, [r1] + muls r1, r0 + ldr r0, =0x02024474 + ldrb r0, [r0, 0xE] + adds r3, r1, 0 + muls r3, r0 + str r3, [r4] + ldr r1, =0x020242ac + lsls r0, r7, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 2 + ands r0, r1 + cmp r0, 0 + beq _08046F0A + ldr r2, =gBattleMoves + mov r0, r8 + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x2] + cmp r0, 0xD + bne _08046F0A + lsls r0, r3, 1 + str r0, [r4] +_08046F0A: + ldr r0, =0x0202433c + lsls r1, r7, 4 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 28 + cmp r0, 0 + bge _08046F28 + ldr r4, =0x020241f0 + ldr r1, [r4] + lsls r0, r1, 4 + subs r0, r1 + movs r1, 0xA + bl __divsi3 + str r0, [r4] +_08046F28: + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8046E7C + + thumb_func_start battle_attack_damage_modulate_by_effectivity +battle_attack_damage_modulate_by_effectivity: @ 8046F60 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r5, =0x020241f0 + ldr r0, [r5] + muls r0, r4 + movs r1, 0xA + bl __divsi3 + str r0, [r5] + cmp r0, 0 + bne _08046F80 + cmp r4, 0 + beq _08046F80 + movs r0, 0x1 + str r0, [r5] +_08046F80: + cmp r4, 0x5 + beq _08046FB0 + cmp r4, 0x5 + bgt _08046F94 + cmp r4, 0 + beq _08046F9A + b _08047032 + .pool +_08046F94: + cmp r4, 0x14 + beq _08046FF0 + b _08047032 +_08046F9A: + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x8 + orrs r0, r1 + movs r1, 0xFB + ands r0, r1 + movs r1, 0xFD + ands r0, r1 + b _08047030 + .pool +_08046FB0: + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0 + beq _08047032 + ldr r2, =0x0202427c + ldrb r1, [r2] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _08047032 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08046FEC + movs r0, 0xFD + ands r0, r1 + b _08047030 + .pool +_08046FEC: + movs r0, 0x4 + b _0804702E +_08046FF0: + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0 + beq _08047032 + ldr r2, =0x0202427c + ldrb r1, [r2] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _08047032 + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0804702C + movs r0, 0xFB + ands r0, r1 + b _08047030 + .pool +_0804702C: + movs r0, 0x2 +_0804702E: + orrs r0, r1 +_08047030: + strb r0, [r2] +_08047032: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end battle_attack_damage_modulate_by_effectivity + + thumb_func_start sub_8047038 +sub_8047038: @ 8047038 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + movs r3, 0 + ldr r1, =0x020241ea + ldrh r0, [r1] + cmp r0, 0xA5 + bne _0804704C + b _08047260 +_0804704C: + ldr r0, =0x0202449c + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0 + beq _08047068 + movs r1, 0x3F + mov r8, r1 + ands r1, r0 + mov r8, r1 + b _08047078 + .pool +_08047068: + ldr r2, =gBattleMoves + ldrh r1, [r1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x2] + mov r8, r0 +_08047078: + ldr r2, =0x02024084 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r1, r0, r2 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r0, [r0] + adds r5, r2, 0 + cmp r0, r8 + beq _0804709A + adds r0, r1, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, r8 + bne _080470B0 +_0804709A: + ldr r4, =0x020241f0 + ldr r1, [r4] + lsls r0, r1, 4 + subs r0, r1 + str r0, [r4] + movs r1, 0xA + str r3, [sp, 0x4] + bl __divsi3 + str r0, [r4] + ldr r3, [sp, 0x4] +_080470B0: + ldr r2, =0x0202420c + ldrb r1, [r2] + movs r0, 0x58 + muls r0, r1 + adds r0, r5 + adds r0, 0x20 + ldrb r0, [r0] + adds r4, r2, 0 + cmp r0, 0x1A + bne _08047128 + mov r1, r8 + cmp r1, 0x4 + bne _08047128 + ldr r3, =0x0202420a + strb r0, [r3] + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x9 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024250 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + movs r2, 0 + strh r2, [r0] + ldr r1, =0x02024258 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + strh r2, [r0] + ldr r0, =0x02024332 + mov r1, r8 + strb r1, [r0, 0x6] + ldrb r0, [r4] + ldrb r1, [r3] + bl b_history__record_ability_usage_of_player + b _080471C4 + .pool +_08047128: + ldr r1, =gUnknown_0831ACE8 + adds r0, r3, r1 + ldrb r0, [r0] + adds r2, r1, 0 + b _080471A4 + .pool +_08047138: + adds r3, 0x3 + b _080471A0 +_0804713C: + ldr r5, =gUnknown_0831ACE8 + adds r0, r3, r5 + ldrb r0, [r0] + cmp r0, r8 + bne _08047198 + adds r1, r3, 0x1 + adds r1, r5 + ldr r2, =0x02024084 + ldr r7, =0x0202420c + ldrb r0, [r7] + movs r6, 0x58 + muls r0, r6 + adds r0, r2 + adds r0, 0x21 + ldrb r4, [r1] + ldrb r0, [r0] + cmp r4, r0 + bne _08047172 + adds r0, r3, 0x2 + adds r0, r5 + ldrb r0, [r0] + str r2, [sp] + str r3, [sp, 0x4] + bl battle_attack_damage_modulate_by_effectivity + ldr r3, [sp, 0x4] + ldr r2, [sp] +_08047172: + ldrb r0, [r7] + muls r0, r6 + adds r0, r2 + adds r1, r0, 0 + adds r1, 0x22 + ldrb r1, [r1] + cmp r4, r1 + bne _08047198 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, r4 + beq _08047198 + adds r0, r3, 0x2 + adds r0, r5 + ldrb r0, [r0] + str r3, [sp, 0x4] + bl battle_attack_damage_modulate_by_effectivity + ldr r3, [sp, 0x4] +_08047198: + adds r3, 0x3 + ldr r5, =0x02024084 + ldr r4, =0x0202420c + ldr r2, =gUnknown_0831ACE8 +_080471A0: + adds r0, r3, r2 + ldrb r0, [r0] +_080471A4: + cmp r0, 0xFF + beq _080471C4 + cmp r0, 0xFE + bne _0804713C + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 + adds r1, r5, 0 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 22 + ands r0, r1 + cmp r0, 0 + beq _08047138 +_080471C4: + ldr r2, =0x02024084 + ldr r5, =0x0202420c + ldrb r1, [r5] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x20 + ldrb r6, [r0] + cmp r6, 0x19 + bne _08047242 + ldr r0, =0x0202420b + ldrb r0, [r0] + ldr r7, =0x020241ea + ldrh r1, [r7] + bl move_weather_interaction + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08047242 + ldr r1, =0x0202427c + mov r8, r1 + ldrb r4, [r1] + ands r0, r4 + cmp r0, 0 + beq _08047200 + movs r0, 0x6 + ands r0, r4 + cmp r0, 0x6 + bne _08047242 +_08047200: + ldr r2, =gBattleMoves + ldrh r1, [r7] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0 + beq _08047242 + ldr r3, =0x0202420a + strb r6, [r3] + movs r0, 0x1 + orrs r0, r4 + mov r1, r8 + strb r0, [r1] + ldr r1, =0x02024250 + ldrb r0, [r5] + lsls r0, 1 + adds r0, r1 + movs r2, 0 + strh r2, [r0] + ldr r1, =0x02024258 + ldrb r0, [r5] + lsls r0, 1 + adds r0, r1 + strh r2, [r0] + ldr r1, =0x02024332 + movs r0, 0x3 + strb r0, [r1, 0x6] + ldrb r0, [r5] + ldrb r1, [r3] + bl b_history__record_ability_usage_of_player +_08047242: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08047260 + ldr r2, =0x0202433c + ldr r0, =0x0202420b + ldrb r1, [r0] + lsls r1, 4 + adds r1, r2 + ldrb r0, [r1, 0x1] + movs r2, 0x2 + orrs r0, r2 + strb r0, [r1, 0x1] +_08047260: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8047038 + + thumb_func_start b_wonderguard_and_levitate +b_wonderguard_and_levitate: @ 80472A8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r6, 0 + movs r5, 0 + ldr r0, =0x020241ea + ldrh r1, [r0] + mov r9, r0 + cmp r1, 0xA5 + bne _080472C0 + b _08047508 +_080472C0: + ldr r2, =gBattleMoves + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + ldrb r0, [r1, 0x1] + cmp r0, 0 + bne _080472D2 + b _08047508 +_080472D2: + ldr r0, =0x0202449c + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0 + beq _080472F4 + movs r1, 0x3F + mov r12, r1 + mov r2, r12 + ands r2, r0 + mov r12, r2 + b _080472F8 + .pool +_080472F4: + ldrb r1, [r1, 0x2] + mov r12, r1 +_080472F8: + ldr r2, =0x02024084 + ldr r3, =0x0202420c + ldrb r1, [r3] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x20 + ldrb r1, [r0] + adds r7, r2, 0 + mov r8, r3 + cmp r1, 0x1A + bne _0804733C + mov r0, r12 + cmp r0, 0x4 + bne _0804733C + ldr r0, =0x0202420a + strb r1, [r0] + ldr r0, =0x02024332 + mov r1, r12 + strb r1, [r0, 0x6] + ldrb r0, [r3] + movs r1, 0x1A + bl b_history__record_ability_usage_of_player + b _08047508 + .pool +_0804733C: + ldr r1, =gUnknown_0831ACE8 + adds r0, r5, r1 + ldrb r0, [r0] + adds r4, r1, 0 + b _0804748E + .pool +_0804734C: + adds r0, r5, r4 + ldrb r0, [r0] + cmp r0, r12 + beq _08047356 + b _08047488 +_08047356: + adds r2, r5, 0x1 + adds r3, r2, r4 + mov r0, r8 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r7 + adds r0, 0x21 + ldrb r1, [r3] + adds r3, r2, 0 + ldrb r0, [r0] + cmp r1, r0 + bne _08047396 + adds r0, r5, 0x2 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _08047396 + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x8 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x0202433c + ldr r0, =0x0202420b + ldrb r2, [r0] + lsls r2, 4 + adds r2, r1 + ldrb r0, [r2, 0x1] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2, 0x1] +_08047396: + adds r2, r3, r4 + mov r0, r8 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r7 + adds r1, r0, 0 + adds r1, 0x22 + ldrb r2, [r2] + ldrb r1, [r1] + cmp r2, r1 + bne _080473DC + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, r2 + beq _080473DC + adds r0, r5, 0x2 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _080473DC + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x8 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x0202433c + ldr r0, =0x0202420b + ldrb r2, [r0] + lsls r2, 4 + adds r2, r1 + ldrb r0, [r2, 0x1] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2, 0x1] +_080473DC: + adds r2, r3, r4 + mov r0, r8 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r7 + adds r0, 0x21 + ldrb r1, [r2] + ldrb r0, [r0] + cmp r1, r0 + bne _08047400 + adds r0, r5, 0x2 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0x14 + bne _08047400 + movs r0, 0x1 + orrs r6, r0 +_08047400: + adds r2, r3, r4 + mov r0, r8 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r7 + adds r1, r0, 0 + adds r1, 0x22 + ldrb r2, [r2] + ldrb r1, [r1] + cmp r2, r1 + bne _0804742E + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, r2 + beq _0804742E + adds r0, r5, 0x2 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0x14 + bne _0804742E + movs r0, 0x1 + orrs r6, r0 +_0804742E: + adds r2, r3, r4 + mov r0, r8 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r7 + adds r0, 0x21 + ldrb r1, [r2] + ldrb r0, [r0] + cmp r1, r0 + bne _08047456 + adds r0, r5, 0x2 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0x5 + bne _08047456 + movs r0, 0x2 + orrs r6, r0 + lsls r0, r6, 24 + lsrs r6, r0, 24 +_08047456: + adds r2, r3, r4 + mov r0, r8 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r7 + adds r1, r0, 0 + adds r1, 0x22 + ldrb r2, [r2] + ldrb r1, [r1] + cmp r2, r1 + bne _08047488 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, r2 + beq _08047488 + adds r0, r5, 0x2 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0x5 + bne _08047488 + movs r0, 0x2 + orrs r6, r0 + lsls r0, r6, 24 + lsrs r6, r0, 24 +_08047488: + adds r5, 0x3 + adds r0, r5, r4 + ldrb r0, [r0] +_0804748E: + cmp r0, 0xFF + beq _080474B2 + cmp r0, 0xFE + beq _08047498 + b _0804734C +_08047498: + mov r2, r8 + ldrb r1, [r2] + movs r0, 0x58 + muls r0, r1 + adds r1, r7, 0 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 22 + ands r0, r1 + cmp r0, 0 + beq _08047488 +_080474B2: + mov r0, r8 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r7 + adds r0, 0x20 + ldrb r4, [r0] + cmp r4, 0x19 + bne _08047508 + ldr r0, =0x0202420b + ldrb r0, [r0] + mov r2, r9 + ldrh r1, [r2] + bl move_weather_interaction + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08047508 + movs r0, 0x3 + ands r6, r0 + cmp r6, 0x1 + beq _08047508 + ldr r2, =gBattleMoves + mov r0, r9 + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0 + beq _08047508 + ldr r0, =0x0202420a + strb r4, [r0] + ldr r1, =0x02024332 + movs r0, 0x3 + strb r0, [r1, 0x6] + mov r1, r8 + ldrb r0, [r1] + movs r1, 0x19 + bl b_history__record_ability_usage_of_player +_08047508: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end b_wonderguard_and_levitate + + thumb_func_start b_attack_effectivity_adapt +b_attack_effectivity_adapt: @ 804752C + push {r4-r7,lr} + adds r6, r2, 0 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 16 + lsrs r5, r1, 16 + ldr r7, =0x020241f0 + ldr r0, [r7] + muls r0, r4 + movs r1, 0xA + bl __divsi3 + str r0, [r7] + cmp r0, 0 + bne _08047552 + cmp r4, 0 + beq _08047552 + movs r0, 0x1 + str r0, [r7] +_08047552: + cmp r4, 0x5 + beq _0804757A + cmp r4, 0x5 + bgt _08047564 + cmp r4, 0 + beq _0804756A + b _080475DE + .pool +_08047564: + cmp r4, 0x14 + beq _080475AC + b _080475DE +_0804756A: + ldrb r0, [r6] + movs r1, 0x8 + orrs r0, r1 + movs r1, 0xFB + ands r0, r1 + movs r1, 0xFD + ands r0, r1 + b _080475DC +_0804757A: + ldr r0, =gBattleMoves + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + cmp r0, 0 + beq _080475DE + ldrb r1, [r6] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _080475DE + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080475A8 + movs r0, 0xFD + ands r0, r1 + b _080475DC + .pool +_080475A8: + movs r0, 0x4 + b _080475DA +_080475AC: + ldr r0, =gBattleMoves + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + cmp r0, 0 + beq _080475DE + ldrb r1, [r6] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _080475DE + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080475D8 + movs r0, 0xFB + ands r0, r1 + b _080475DC + .pool +_080475D8: + movs r0, 0x2 +_080475DA: + orrs r0, r1 +_080475DC: + strb r0, [r6] +_080475DE: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end b_attack_effectivity_adapt + + thumb_func_start move_effectiveness_something +move_effectiveness_something: @ 80475E4 + 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 + mov r10, r0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x4] + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + movs r0, 0 + mov r8, r0 + mov r0, sp + mov r1, r8 + strb r1, [r0] + mov r2, r10 + cmp r2, 0xA5 + bne _08047616 + movs r0, 0 + b _0804779E +_08047616: + ldr r1, =gBattleMoves + mov r3, r10 + lsls r2, r3, 1 + adds r0, r2, r3 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x2] + str r0, [sp, 0x8] + ldr r1, =0x02024084 + movs r0, 0x58 + ldr r3, [sp, 0x4] + muls r0, r3 + adds r3, r0, r1 + adds r0, r3, 0 + adds r0, 0x21 + ldrb r0, [r0] + str r2, [sp, 0xC] + adds r5, r1, 0 + ldr r1, [sp, 0x8] + cmp r0, r1 + beq _0804764A + adds r0, r3, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, r1 + bne _0804765C +_0804764A: + ldr r4, =0x020241f0 + ldr r1, [r4] + lsls r0, r1, 4 + subs r0, r1 + str r0, [r4] + movs r1, 0xA + bl __divsi3 + str r0, [r4] +_0804765C: + movs r0, 0x58 + mov r2, r9 + muls r2, r0 + adds r0, r2, 0 + adds r0, r5 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x1A + bne _08047690 + ldr r3, [sp, 0x8] + cmp r3, 0x4 + bne _08047690 + movs r1, 0x9 + mov r0, sp + ldrb r0, [r0] + orrs r0, r1 + mov r1, sp + strb r0, [r1] + b _08047740 + .pool +_08047690: + ldr r1, =gUnknown_0831ACE8 + mov r2, r8 + adds r0, r2, r1 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0xFF + beq _08047740 + cmp r0, 0xFE + bne _080476B6 + movs r0, 0x58 + mov r3, r9 + muls r3, r0 + adds r0, r3, 0 + b _0804772E + .pool +_080476B0: + movs r0, 0x3 + add r8, r0 + b _08047718 +_080476B6: + ldr r7, =gUnknown_0831ACE8 + mov r1, r8 + adds r0, r1, r7 + ldrb r0, [r0] + ldr r2, [sp, 0x8] + cmp r0, r2 + bne _08047710 + adds r1, 0x1 + adds r1, r7 + ldr r2, =0x02024084 + movs r0, 0x58 + mov r3, r9 + muls r3, r0 + adds r0, r3, 0 + adds r5, r0, r2 + adds r6, r5, 0 + adds r6, 0x21 + ldrb r4, [r1] + ldrb r0, [r6] + cmp r4, r0 + bne _080476F0 + mov r0, r8 + adds r0, 0x2 + adds r0, r7 + ldrb r0, [r0] + mov r1, r10 + mov r2, sp + bl b_attack_effectivity_adapt +_080476F0: + adds r0, r5, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r4, r0 + bne _08047710 + ldrb r0, [r6] + cmp r0, r4 + beq _08047710 + mov r0, r8 + adds r0, 0x2 + adds r0, r7 + ldrb r0, [r0] + mov r1, r10 + mov r2, sp + bl b_attack_effectivity_adapt +_08047710: + movs r1, 0x3 + add r8, r1 + ldr r5, =0x02024084 + ldr r2, =gUnknown_0831ACE8 +_08047718: + mov r3, r8 + adds r0, r3, r2 + ldrb r0, [r0] + cmp r0, 0xFF + beq _08047740 + cmp r0, 0xFE + bne _080476B6 + movs r0, 0x58 + mov r1, r9 + muls r1, r0 + adds r0, r1, 0 +_0804772E: + adds r1, r5, 0 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 22 + ands r0, r1 + cmp r0, 0 + beq _080476B0 +_08047740: + movs r0, 0x58 + mov r2, r9 + muls r2, r0 + adds r0, r2, 0 + adds r0, r5 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x19 + bne _0804779A + mov r0, sp + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0804779A + ldr r0, [sp, 0x4] + mov r1, r10 + bl move_weather_interaction + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x2 + bne _0804779A + mov r0, sp + ldrb r3, [r0] + adds r0, r1, 0 + ands r0, r3 + cmp r0, 0 + beq _08047782 + movs r0, 0x6 + ands r0, r3 + cmp r0, 0x6 + bne _0804779A +_08047782: + ldr r0, =gBattleMoves + ldr r1, [sp, 0xC] + add r1, r10 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + cmp r0, 0 + beq _0804779A + mov r0, sp + movs r1, 0x1 + orrs r1, r3 + strb r1, [r0] +_0804779A: + mov r0, sp + ldrb r0, [r0] +_0804779E: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end move_effectiveness_something + + thumb_func_start ai_rate_move +ai_rate_move: @ 80477BC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x4] + movs r7, 0 + mov r0, sp + strb r7, [r0] + ldr r2, =gBaseStats + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x6] + mov r9, r1 + ldrb r0, [r0, 0x7] + mov r8, r0 + cmp r6, 0xA5 + bne _080477FC + movs r0, 0 + b _080478A0 + .pool +_080477FC: + ldr r2, =gBattleMoves + lsls r1, r6, 1 + adds r0, r1, r6 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x2] + mov r10, r0 + str r1, [sp, 0x8] + ldr r3, [sp, 0x4] + cmp r3, 0x1A + bne _08047824 + cmp r0, 0x4 + bne _08047824 + movs r1, 0x9 + mov r0, sp + strb r1, [r0] + b _0804786A + .pool +_08047824: + ldr r0, =gUnknown_0831ACE8 + adds r1, r7, r0 + ldrb r0, [r1] + cmp r0, 0xFF + beq _0804786A + adds r4, r1, 0 +_08047830: + ldrb r0, [r4] + cmp r0, 0xFE + beq _0804785C + cmp r0, r10 + bne _0804785C + ldrb r5, [r4, 0x1] + cmp r5, r9 + bne _0804784A + ldrb r0, [r4, 0x2] + adds r1, r6, 0 + mov r2, sp + bl b_attack_effectivity_adapt +_0804784A: + cmp r5, r8 + bne _0804785C + cmp r9, r8 + beq _0804785C + ldrb r0, [r4, 0x2] + adds r1, r6, 0 + mov r2, sp + bl b_attack_effectivity_adapt +_0804785C: + adds r4, 0x3 + adds r7, 0x3 + ldr r1, =gUnknown_0831ACE8 + adds r0, r7, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _08047830 +_0804786A: + ldr r3, [sp, 0x4] + cmp r3, 0x19 + bne _0804789C + mov r0, sp + ldrb r2, [r0] + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + beq _08047884 + movs r0, 0x6 + ands r0, r2 + cmp r0, 0x6 + bne _0804789C +_08047884: + ldr r0, =gBattleMoves + ldr r3, [sp, 0x8] + adds r1, r3, r6 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + cmp r0, 0 + beq _0804789C + mov r0, sp + movs r1, 0x8 + orrs r1, r2 + strb r1, [r0] +_0804789C: + mov r0, sp + ldrb r0, [r0] +_080478A0: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end ai_rate_move + + thumb_func_start sub_80478B8 +sub_80478B8: @ 80478B8 + push {r4,lr} + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xF + ands r0, r1 + movs r1, 0x64 + subs r1, r0 + lsls r1, 16 + lsrs r1, 16 + ldr r4, =0x020241f0 + ldr r0, [r4] + cmp r0, 0 + beq _080478EA + muls r0, r1 + str r0, [r4] + movs r1, 0x64 + bl __divsi3 + str r0, [r4] + cmp r0, 0 + bne _080478EA + movs r0, 0x1 + str r0, [r4] +_080478EA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80478B8 + + thumb_func_start atk07_cmd7 +atk07_cmd7: @ 80478F4 + push {r4-r7,lr} + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xF + ands r0, r1 + movs r1, 0x64 + subs r1, r0 + lsls r1, 16 + lsrs r1, 16 + ldr r4, =0x020241f0 + ldr r0, [r4] + cmp r0, 0 + beq _08047926 + muls r0, r1 + str r0, [r4] + movs r1, 0x64 + bl __divsi3 + str r0, [r4] + cmp r0, 0 + bne _08047926 + movs r0, 0x1 + str r0, [r4] +_08047926: + ldr r7, =0x02024084 + ldr r6, =0x0202420c + ldrb r2, [r6] + movs r5, 0x58 + adds r0, r2, 0 + muls r0, r5 + adds r1, r0, r7 + ldrh r0, [r1, 0x2E] + cmp r0, 0xAF + bne _0804795C + ldr r1, =0x02024404 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r4, [r0, 0x7] + ldrb r6, [r0, 0x1A] + b _08047976 + .pool +_0804795C: + ldrh r0, [r1, 0x2E] + bl itemid_get_x12 + lsls r0, 24 + lsrs r4, r0, 24 + ldrb r0, [r6] + muls r0, r5 + adds r0, r7 + ldrh r0, [r0, 0x2E] + bl itemid_get_quality + lsls r0, 24 + lsrs r6, r0, 24 +_08047976: + ldr r1, =0x0202420f + ldr r5, =0x0202420c + ldrb r0, [r5] + strb r0, [r1] + cmp r4, 0x27 + bne _080479B4 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, r6 + bcs _080479B4 + ldrb r0, [r5] + movs r1, 0x27 + bl b_history__record_item_x12_of_player + ldr r2, =0x0202437c + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0] +_080479B4: + ldr r2, =0x02024084 + ldr r3, =0x0202420c + ldrb r4, [r3] + movs r0, 0x58 + muls r0, r4 + adds r1, r2, 0 + adds r1, 0x50 + adds r0, r1 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 17 + ands r1, r0 + adds r5, r2, 0 + cmp r1, 0 + bne _08047A84 + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0x65 + beq _08047A06 + ldr r0, =0x0202433c + lsls r1, r4, 4 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 30 + cmp r0, 0 + blt _08047A06 + ldr r0, =0x0202437c + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + lsrs r0, 7 + cmp r0, 0 + beq _08047A84 +_08047A06: + ldrb r0, [r3] + movs r4, 0x58 + muls r0, r4 + adds r0, r5 + ldrh r1, [r0, 0x28] + ldr r2, =0x020241f0 + ldr r0, [r2] + cmp r1, r0 + bgt _08047A84 + subs r0, r1, 0x1 + str r0, [r2] + ldr r1, =0x0202433c + ldrb r3, [r3] + lsls r0, r3, 4 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + cmp r0, 0 + bge _08047A5C + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + b _08047A84 + .pool +_08047A5C: + ldr r0, =0x0202437c + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + lsrs r0, 7 + cmp r0, 0 + beq _08047A84 + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024208 + adds r0, r3, 0 + muls r0, r4 + adds r0, r5 + ldrh r0, [r0, 0x2E] + strh r0, [r1] +_08047A84: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk07_cmd7 + + thumb_func_start atk08_cmd8 +atk08_cmd8: @ 8047AA4 + push {r4-r7,lr} + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xF + ands r0, r1 + movs r1, 0x64 + subs r1, r0 + lsls r1, 16 + lsrs r1, 16 + ldr r4, =0x020241f0 + ldr r0, [r4] + cmp r0, 0 + beq _08047AD6 + muls r0, r1 + str r0, [r4] + movs r1, 0x64 + bl __divsi3 + str r0, [r4] + cmp r0, 0 + bne _08047AD6 + movs r0, 0x1 + str r0, [r4] +_08047AD6: + ldr r7, =0x02024084 + ldr r6, =0x0202420c + ldrb r2, [r6] + movs r5, 0x58 + adds r0, r2, 0 + muls r0, r5 + adds r1, r0, r7 + ldrh r0, [r1, 0x2E] + cmp r0, 0xAF + bne _08047B0C + ldr r1, =0x02024404 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r4, [r0, 0x7] + ldrb r6, [r0, 0x1A] + b _08047B26 + .pool +_08047B0C: + ldrh r0, [r1, 0x2E] + bl itemid_get_x12 + lsls r0, 24 + lsrs r4, r0, 24 + ldrb r0, [r6] + muls r0, r5 + adds r0, r7 + ldrh r0, [r0, 0x2E] + bl itemid_get_quality + lsls r0, 24 + lsrs r6, r0, 24 +_08047B26: + ldr r1, =0x0202420f + ldr r5, =0x0202420c + ldrb r0, [r5] + strb r0, [r1] + cmp r4, 0x27 + bne _08047B64 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, r6 + bcs _08047B64 + ldrb r0, [r5] + movs r1, 0x27 + bl b_history__record_item_x12_of_player + ldr r2, =0x0202437c + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0] +_08047B64: + ldr r4, =0x02024084 + ldr r6, =0x0202420c + ldrb r2, [r6] + movs r7, 0x58 + adds r3, r2, 0 + muls r3, r7 + adds r0, r4, 0 + adds r0, 0x50 + adds r0, r3, r0 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + bne _08047C10 + ldr r5, =0x0202433c + lsls r0, r2, 4 + adds r0, r5 + ldrb r0, [r0] + lsls r0, 30 + cmp r0, 0 + blt _08047BA2 + ldr r0, =0x0202437c + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + lsrs r0, 7 + cmp r0, 0 + beq _08047C10 +_08047BA2: + adds r0, r3, r4 + ldrh r1, [r0, 0x28] + ldr r2, =0x020241f0 + ldr r0, [r2] + cmp r1, r0 + bgt _08047C10 + subs r0, r1, 0x1 + str r0, [r2] + ldrb r3, [r6] + lsls r0, r3, 4 + adds r0, r5 + ldrb r0, [r0] + lsls r0, 30 + cmp r0, 0 + bge _08047BE8 + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + b _08047C10 + .pool +_08047BE8: + ldr r0, =0x0202437c + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + lsrs r0, 7 + cmp r0, 0 + beq _08047C10 + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024208 + adds r0, r3, 0 + muls r0, r7 + adds r0, r4 + ldrh r0, [r0, 0x2E] + strh r0, [r1] +_08047C10: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk08_cmd8 + + thumb_func_start atk09_attackanimation +atk09_attackanimation: @ 8047C30 + push {r4-r7,lr} + sub sp, 0x10 + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + beq _08047C3E + b _08047DB6 +_08047C3E: + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + ldr r5, =0x020241ea + cmp r0, 0 + beq _08047C8C + ldrh r0, [r5] + cmp r0, 0x90 + beq _08047C8C + cmp r0, 0xA4 + beq _08047C8C + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082DABB9 + str r0, [r4] + ldr r1, =0x02024474 + ldrb r0, [r1, 0x18] + adds r0, 0x1 + strb r0, [r1, 0x18] + ldrb r0, [r1, 0x19] + adds r0, 0x1 + strb r0, [r1, 0x19] + b _08047DB6 + .pool +_08047C8C: + ldr r2, =gBattleMoves + ldrh r1, [r5] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x6] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _08047CB2 + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _08047CB2 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08047CBA +_08047CB2: + ldr r0, =0x02024474 + ldrb r0, [r0, 0x19] + cmp r0, 0 + bne _08047D88 +_08047CBA: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _08047DA8 + ldr r1, =0x02024064 + ldr r3, =0x0202420b + ldrb r0, [r3] + strb r0, [r1] + ldr r2, =0x02024084 + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0x58 + adds r4, r1, 0 + muls r4, r0 + adds r0, r2, 0 + adds r0, 0x50 + adds r0, r4, r0 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 17 + ands r1, r0 + adds r7, r3, 0 + mov r12, r2 + cmp r1, 0 + beq _08047D18 + ldr r0, =0x02024212 + ldrb r6, [r0] + b _08047D42 + .pool +_08047D18: + ldr r3, =0x02024212 + ldrb r0, [r3] + cmp r0, 0x1 + bls _08047D40 + mov r1, r12 + adds r0, r4, r1 + ldrh r2, [r0, 0x28] + ldr r0, =0x020241f0 + ldr r1, [r0] + movs r6, 0x1 + adds r4, r0, 0 + cmp r2, r1 + ble _08047D44 + ldrb r6, [r3] + b _08047D44 + .pool +_08047D40: + ldrb r6, [r3] +_08047D42: + ldr r4, =0x020241f0 +_08047D44: + ldrh r1, [r5] + ldr r5, =0x02024474 + ldrb r2, [r5, 0x18] + ldr r0, =0x020244e0 + ldrh r3, [r0] + ldr r0, [r4] + str r0, [sp] + ldrb r4, [r7] + movs r0, 0x58 + muls r0, r4 + add r0, r12 + adds r0, 0x2B + ldrb r0, [r0] + str r0, [sp, 0x4] + ldrb r4, [r7] + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + ldr r4, =0x020242bc + adds r0, r4 + str r0, [sp, 0x8] + str r6, [sp, 0xC] + movs r0, 0 + bl dp01_build_cmdbuf_x0F_aa_b_cc_dddd_e_mlc_weather_00_x1Cbytes + ldrb r0, [r5, 0x18] + adds r0, 0x1 + strb r0, [r5, 0x18] + ldrb r0, [r5, 0x19] + adds r0, 0x1 + strb r0, [r5, 0x19] + ldrb r0, [r7] + bl dp01_battle_side_mark_buffer_for_execution +_08047D88: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + b _08047DB6 + .pool +_08047DA8: + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082DABB9 + str r0, [r4] +_08047DB6: + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk09_attackanimation + + thumb_func_start sub_8047DC8 +sub_8047DC8: @ 8047DC8 + push {lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _08047DDA + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_08047DDA: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8047DC8 + + thumb_func_start atk0B_graphicalhpupdate +atk0B_graphicalhpupdate: @ 8047DE8 + push {r4,lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _08047EAA + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _08047EA2 + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r2, =0x02024064 + strb r0, [r2] + ldr r1, =0x02024084 + ldrb r2, [r2] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08047E68 + ldr r0, =0x020242bc + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0xA] + cmp r0, 0 + beq _08047E68 + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 1 + ands r0, r1 + cmp r0, 0 + bne _08047E68 + movs r0, 0x80 + adds r1, r2, 0 + bl b_std_message + b _08047EA2 + .pool +_08047E68: + ldr r0, =0x020241f0 + ldr r0, [r0] + ldr r1, =0x00002710 + cmp r0, r1 + bgt _08047E76 + lsls r0, 16 + lsrs r1, r0, 16 +_08047E76: + movs r0, 0 + bl dp01_build_cmdbuf_x18_0_aa_health_bar_update + ldr r4, =0x02024064 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08047EA2 + ldr r0, =0x020241f0 + ldr r0, [r0] + cmp r0, 0 + ble _08047EA2 + ldr r0, =0x03005d10 + ldrb r1, [r0, 0x5] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0, 0x5] +_08047EA2: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] +_08047EAA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk0B_graphicalhpupdate + + thumb_func_start atk0C_datahpupdate +atk0C_datahpupdate: @ 8047EC4 + push {r4-r7,lr} + sub sp, 0x4 + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + beq _08047ED2 + b _080482A2 +_08047ED2: + ldr r0, =0x0202449c + ldr r0, [r0] + ldrb r1, [r0, 0x13] + cmp r1, 0 + beq _08047EF4 + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08047EF4 + movs r6, 0x3F + ands r6, r1 + b _08047F04 + .pool +_08047EF4: + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r6, [r0, 0x2] +_08047F04: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _08047F12 + b _08048274 +_08047F12: + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r7, =0x02024064 + strb r0, [r7] + ldr r1, =0x02024084 + ldrb r2, [r7] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08048028 + ldr r0, =0x020242bc + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r4, r1, r0 + ldrb r1, [r4, 0xA] + mov r12, r0 + cmp r1, 0 + beq _08048028 + ldr r0, =0x02024280 + ldr r3, [r0] + movs r0, 0x80 + lsls r0, 1 + ands r3, r0 + cmp r3, 0 + bne _08048028 + adds r5, r1, 0 + ldr r6, =0x020241f0 + ldr r4, [r6] + cmp r5, r4 + blt _08047FBC + ldr r0, =0x0202437c + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 2 + adds r0, 0x4 + adds r1, r0 + ldr r0, [r1] + cmp r0, 0 + bne _08047F76 + str r4, [r1] +_08047F76: + ldrb r0, [r7] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + add r1, r12 + ldr r2, [r6] + ldrb r0, [r1, 0xA] + subs r0, r2 + strb r0, [r1, 0xA] + ldr r1, =0x020241f4 + ldr r0, [r6] + str r0, [r1] + b _08047FEC + .pool +_08047FBC: + ldr r0, =0x0202437c + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 2 + adds r0, 0x4 + adds r1, r0 + ldr r0, [r1] + cmp r0, 0 + bne _08047FD0 + str r5, [r1] +_08047FD0: + ldr r2, =0x020241f4 + ldrb r1, [r7] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + ldrb r0, [r0, 0xA] + str r0, [r2] + ldrb r1, [r7] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + strb r3, [r0, 0xA] +_08047FEC: + ldr r0, =0x02024064 + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + ldrb r0, [r0, 0xA] + cmp r0, 0 + beq _08048000 + b _0804829A +_08048000: + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] + bl b_movescr_stack_push_cursor + ldr r0, =gUnknown_082DB6FB + str r0, [r4] + b _080482A2 + .pool +_08048028: + ldr r0, =0x02024280 + ldr r2, [r0] + ldr r1, =0xfffffeff + ands r2, r1 + str r2, [r0] + ldr r1, =0x020241f0 + ldr r5, [r1] + mov r12, r0 + adds r7, r1, 0 + cmp r5, 0 + bge _0804807C + ldr r4, =0x02024084 + ldr r2, =0x02024064 + ldrb r0, [r2] + movs r3, 0x58 + adds r1, r0, 0 + muls r1, r3 + adds r1, r4 + ldrh r0, [r1, 0x28] + subs r0, r5 + strh r0, [r1, 0x28] + ldrb r0, [r2] + muls r0, r3 + adds r1, r0, r4 + ldrh r3, [r1, 0x2C] + ldrh r0, [r1, 0x28] + adds r5, r2, 0 + cmp r0, r3 + bhi _08048064 + b _0804823A +_08048064: + strh r3, [r1, 0x28] + b _0804823A + .pool +_0804807C: + movs r0, 0x20 + ands r0, r2 + cmp r0, 0 + beq _08048098 + movs r0, 0x21 + negs r0, r0 + ands r2, r0 + mov r0, r12 + str r2, [r0] + ldr r5, =0x02024064 + b _080480E0 + .pool +_08048098: + ldr r0, =0x020241f8 + ldr r2, =0x02024064 + ldrb r1, [r2] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + adds r0, r5 + str r0, [r1] + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + adds r5, r2, 0 + cmp r0, 0 + bne _080480D4 + ldr r1, =0x02024288 + ldrb r0, [r5] + adds r0, r1 + ldr r1, =0x0202420b + b _080480DC + .pool +_080480D4: + ldr r1, =0x02024288 + ldrb r0, [r5] + adds r0, r1 + ldr r1, =0x0202420c +_080480DC: + ldrb r1, [r1] + strb r1, [r0] +_080480E0: + ldr r4, =0x02024084 + ldrb r0, [r5] + movs r3, 0x58 + muls r0, r3 + adds r2, r0, r4 + ldrh r0, [r2, 0x28] + ldr r1, [r7] + cmp r0, r1 + ble _08048110 + subs r0, r1 + strh r0, [r2, 0x28] + ldr r0, =0x020241f4 + str r1, [r0] + adds r7, r0, 0 + b _08048120 + .pool +_08048110: + ldr r2, =0x020241f4 + str r0, [r2] + ldrb r0, [r5] + muls r0, r3 + adds r0, r4 + movs r1, 0 + strh r1, [r0, 0x28] + adds r7, r2, 0 +_08048120: + ldr r2, =0x0202437c + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r1, r2, 0x4 + adds r3, r0, r1 + ldr r0, [r3] + adds r4, r2, 0 + cmp r0, 0 + bne _08048148 + mov r1, r12 + ldr r0, [r1] + movs r1, 0x80 + lsls r1, 13 + ands r0, r1 + cmp r0, 0 + bne _08048148 + ldr r0, [r7] + str r0, [r3] +_08048148: + cmp r6, 0x8 + bhi _080481D0 + mov r1, r12 + ldr r0, [r1] + movs r1, 0x80 + lsls r1, 13 + ands r0, r1 + cmp r0, 0 + bne _080481CC + ldr r0, =0x020241ea + ldrh r0, [r0] + cmp r0, 0xDC + beq _080481CC + ldr r3, =0x0202433c + ldrb r0, [r5] + lsls r0, 4 + adds r1, r3, 0x4 + adds r0, r1 + ldr r2, [r7] + str r2, [r0] + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x8 + adds r0, r1 + str r2, [r0] + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0 + bne _080481AC + ldrb r0, [r5] + lsls r0, 4 + adds r0, r3 + ldr r2, =0x0202420b + b _080481B4 + .pool +_080481AC: + ldrb r0, [r5] + lsls r0, 4 + adds r0, r3 + ldr r2, =0x0202420c +_080481B4: + ldrb r1, [r2] + strb r1, [r0, 0xC] + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r2] + strb r1, [r0, 0x10] + b _0804823A + .pool +_080481CC: + cmp r6, 0x8 + bls _0804823A +_080481D0: + mov r1, r12 + ldr r0, [r1] + movs r1, 0x80 + lsls r1, 13 + ands r0, r1 + cmp r0, 0 + bne _0804823A + ldr r3, =0x0202433c + ldrb r0, [r5] + lsls r0, 4 + adds r1, r3, 0 + adds r1, 0x8 + adds r0, r1 + ldr r2, [r7] + str r2, [r0] + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0xC + adds r0, r1 + str r2, [r0] + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0 + bne _08048220 + ldrb r0, [r5] + lsls r0, 4 + adds r0, r3 + ldr r2, =0x0202420b + b _08048228 + .pool +_08048220: + ldrb r0, [r5] + lsls r0, 4 + adds r0, r3 + ldr r2, =0x0202420c +_08048228: + ldrb r1, [r2] + strb r1, [r0, 0xD] + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r2] + strb r1, [r0, 0x11] +_0804823A: + mov r1, r12 + ldr r0, [r1] + ldr r1, =0xffefffff + ands r0, r1 + mov r1, r12 + str r0, [r1] + ldrb r1, [r5] + movs r0, 0x58 + muls r0, r1 + ldr r1, =0x020240ac + adds r0, r1 + str r0, [sp] + movs r0, 0 + movs r1, 0x2A + movs r2, 0 + movs r3, 0x2 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r5] + bl dp01_battle_side_mark_buffer_for_execution + b _0804829A + .pool +_08048274: + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r1, =0x02024064 + strb r0, [r1] + ldr r2, =0x0202437c + ldrb r1, [r1] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x4 + adds r1, r0, r2 + ldr r0, [r1] + cmp r0, 0 + bne _0804829A + ldr r0, =0x0000ffff + str r0, [r1] +_0804829A: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] +_080482A2: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk0C_datahpupdate + + thumb_func_start atk0D_critmessage +atk0D_critmessage: @ 80482BC + push {lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _080482F2 + ldr r0, =0x02024211 + ldrb r0, [r0] + cmp r0, 0x2 + bne _080482EA + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _080482EA + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0xD9 + bl b_std_message + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x7] +_080482EA: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_080482F2: + pop {r0} + bx r0 + .pool + thumb_func_end atk0D_critmessage + + thumb_func_start atk0E_missmessage +atk0E_missmessage: @ 8048310 + push {r4,lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _080483D0 + ldr r4, =0x02024064 + ldr r0, =0x0202420c + ldrb r0, [r0] + strb r0, [r4] + ldr r1, =0x0202427c + ldrb r2, [r1] + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + bne _080483C8 + movs r0, 0xFE + ands r0, r2 + cmp r0, 0x10 + beq _08048382 + cmp r0, 0x10 + bgt _0804835E + cmp r0, 0x4 + beq _08048372 + cmp r0, 0x4 + bgt _08048358 + cmp r0, 0x2 + beq _0804836C + b _08048382 + .pool +_08048358: + cmp r0, 0x8 + beq _080483C8 + b _08048382 +_0804835E: + cmp r0, 0x40 + beq _08048382 + cmp r0, 0x40 + bgt _08048382 + cmp r0, 0x20 + beq _080483C8 + b _08048382 +_0804836C: + movs r0, 0 + movs r1, 0xE + b _08048376 +_08048372: + movs r0, 0 + movs r1, 0xC +_08048376: + bl dp01_build_cmdbuf_x2B_aa_0 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + b _080483C8 +_08048382: + ldrb r1, [r1] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08048392 + movs r0, 0 + movs r1, 0xE + b _0804839E +_08048392: + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080483B0 + movs r0, 0 + movs r1, 0xC +_0804839E: + bl dp01_build_cmdbuf_x2B_aa_0 + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + b _080483C8 + .pool +_080483B0: + movs r0, 0x28 + ands r0, r1 + cmp r0, 0 + bne _080483C8 + movs r0, 0 + movs r1, 0xD + bl dp01_build_cmdbuf_x2B_aa_0 + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution +_080483C8: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_080483D0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk0E_missmessage + + thumb_func_start atk0F_resultmessage +atk0F_resultmessage: @ 80483E0 + push {r4-r7,lr} + movs r3, 0 + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + beq _080483EE + b _08048580 +_080483EE: + ldr r1, =0x0202427c + ldrb r2, [r1] + movs r4, 0x1 + adds r0, r4, 0 + ands r0, r2 + adds r6, r1, 0 + ldr r7, =0x02024332 + cmp r0, 0 + beq _0804842C + movs r0, 0x8 + ands r0, r2 + cmp r0, 0 + beq _0804840E + ldrb r0, [r7, 0x6] + cmp r0, 0x2 + bls _0804842C +_0804840E: + ldr r1, =gUnknown_085CC834 + ldrb r0, [r7, 0x6] + lsls r0, 1 + adds r0, r1 + ldrh r3, [r0] + strb r4, [r7, 0x7] + b _0804856A + .pool +_0804842C: + movs r0, 0x1 + strb r0, [r7, 0x7] + ldrb r5, [r6] + movs r0, 0xFE + ands r0, r5 + cmp r0, 0x10 + beq _08048470 + cmp r0, 0x10 + bgt _08048452 + cmp r0, 0x4 + beq _0804846C + cmp r0, 0x4 + bgt _0804844C + cmp r0, 0x2 + beq _08048468 + b _080484B8 +_0804844C: + cmp r0, 0x8 + beq _080484C4 + b _080484B8 +_08048452: + cmp r0, 0x40 + beq _08048474 + cmp r0, 0x40 + bgt _08048462 + cmp r0, 0x20 + bne _08048460 + b _08048564 +_08048460: + b _080484B8 +_08048462: + cmp r0, 0x80 + beq _08048478 + b _080484B8 +_08048468: + movs r3, 0xDE + b _0804856E +_0804846C: + movs r3, 0xDD + b _0804856E +_08048470: + movs r3, 0xDA + b _0804856E +_08048474: + movs r3, 0x99 + b _0804856E +_08048478: + ldr r4, =0x02024208 + ldr r2, =0x02024084 + ldr r3, =0x0202420c + ldrb r1, [r3] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0, 0x2E] + strh r0, [r4] + ldr r1, =0x0202420f + ldrb r0, [r3] + strb r0, [r1] + movs r0, 0x3F + ands r0, r5 + strb r0, [r6] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB816 + b _0804857E + .pool +_080484B8: + adds r2, r6, 0 + ldrb r5, [r2] + movs r0, 0x8 + ands r0, r5 + cmp r0, 0 + beq _080484C8 +_080484C4: + movs r3, 0x1B + b _0804856E +_080484C8: + movs r0, 0x10 + ands r0, r5 + cmp r0, 0 + beq _080484F0 + movs r0, 0xEF + ands r0, r5 + movs r1, 0xFD + ands r0, r1 + movs r1, 0xFB + ands r0, r1 + strb r0, [r2] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB1CE + b _0804857E + .pool +_080484F0: + movs r0, 0x40 + ands r0, r5 + cmp r0, 0 + beq _08048510 + movs r0, 0x3F + ands r0, r5 + strb r0, [r2] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB1C7 + b _0804857E + .pool +_08048510: + movs r0, 0x80 + ands r0, r5 + cmp r0, 0 + beq _08048558 + ldr r4, =0x02024208 + ldr r2, =0x02024084 + ldr r3, =0x0202420c + ldrb r1, [r3] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0, 0x2E] + strh r0, [r4] + ldr r1, =0x0202420f + ldrb r0, [r3] + strb r0, [r1] + movs r0, 0x3F + ands r0, r5 + strb r0, [r6] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB816 + b _0804857E + .pool +_08048558: + movs r0, 0x20 + ands r0, r5 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _08048568 +_08048564: + movs r3, 0xE5 + b _0804856E +_08048568: + strb r0, [r7, 0x7] +_0804856A: + cmp r3, 0 + beq _08048578 +_0804856E: + adds r0, r3, 0 + ldr r1, =0x0202420b + ldrb r1, [r1] + bl b_std_message +_08048578: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 +_0804857E: + str r0, [r1] +_08048580: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk0F_resultmessage + + thumb_func_start atk10_printstring +atk10_printstring: @ 8048590 + push {r4,lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _080485BA + ldr r4, =0x02024214 + ldr r1, [r4] + ldrb r0, [r1, 0x1] + ldrb r1, [r1, 0x2] + lsls r1, 8 + orrs r0, r1 + ldr r1, =0x0202420b + ldrb r1, [r1] + bl b_std_message + ldr r0, [r4] + adds r0, 0x3 + str r0, [r4] + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x7] +_080485BA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk10_printstring + + thumb_func_start atk11_printstring2 +atk11_printstring2: @ 80485D0 + push {r4,r5,lr} + ldr r5, =0x02024064 + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r5] + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r1, [r0, 0x1] + ldrb r0, [r0, 0x2] + lsls r0, 8 + orrs r1, r0 + movs r0, 0 + bl dp01_build_cmdbuf_x11_TODO + ldrb r0, [r5] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r4] + adds r0, 0x3 + str r0, [r4] + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x7] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk11_printstring2 + + thumb_func_start atk12_waitmessage +atk12_waitmessage: @ 8048614 + push {r4-r6,lr} + ldr r0, =0x02024068 + ldr r4, [r0] + cmp r4, 0 + bne _08048662 + ldr r6, =0x02024332 + ldrb r0, [r6, 0x7] + cmp r0, 0 + bne _0804863C + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x3 + str r0, [r1] + b _08048662 + .pool +_0804863C: + ldr r5, =0x02024214 + ldr r2, [r5] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldr r3, =0x0202432c + ldrh r0, [r3] + adds r0, 0x1 + strh r0, [r3] + lsls r0, 16 + lsrs r0, 16 + cmp r0, r1 + bcc _08048662 + movs r1, 0 + strh r4, [r3] + adds r0, r2, 0x3 + str r0, [r5] + strb r1, [r6, 0x7] +_08048662: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atk12_waitmessage + + thumb_func_start atk13_printfromtable +atk13_printfromtable: @ 8048670 + push {r4,r5,lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _080486AE + ldr r4, =0x02024214 + ldr r2, [r4] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + ldr r5, =0x02024332 + ldrb r0, [r5, 0x5] + lsls r0, 1 + adds r1, r0 + ldrh r0, [r1] + ldr r1, =0x0202420b + ldrb r1, [r1] + bl b_std_message + ldr r0, [r4] + adds r0, 0x5 + str r0, [r4] + movs r0, 0x1 + strb r0, [r5, 0x7] +_080486AE: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk13_printfromtable + + thumb_func_start atk14_printfromtable2 +atk14_printfromtable2: @ 80486C4 + push {r4-r6,lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0804870E + ldr r5, =0x02024214 + ldr r2, [r5] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + ldr r6, =0x02024332 + ldrb r0, [r6, 0x5] + lsls r0, 1 + adds r1, r0 + ldr r4, =0x02024064 + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r4] + ldrh r1, [r1] + movs r0, 0 + bl dp01_build_cmdbuf_x11_TODO + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r5] + adds r0, 0x5 + str r0, [r5] + movs r0, 0x1 + strb r0, [r6, 0x7] +_0804870E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atk14_printfromtable2 + + thumb_func_start sub_8048728 +sub_8048728: @ 8048728 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0 + ldr r0, =0x0202406c + ldrb r3, [r0] + cmp r1, r3 + bge _0804874E + ldr r4, =0x0202407e + ldrb r0, [r4] + cmp r0, r2 + beq _0804874E +_08048740: + adds r1, 0x1 + cmp r1, r3 + bge _0804874E + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, r2 + bne _08048740 +_0804874E: + lsls r0, r1, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8048728 + + thumb_func_start sub_8048760 +sub_8048760: @ 8048760 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + movs r0, 0 + mov r10, r0 + movs r7, 0 + movs r1, 0x1 + str r1, [sp, 0x4] + ldr r1, =0x02024332 + ldrb r3, [r1, 0x3] + movs r0, 0x40 + ands r0, r3 + cmp r0, 0 + beq _080487B8 + ldr r2, =0x0202420e + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r2] + movs r0, 0xBF + ands r0, r3 + adds r3, r1, 0 + strb r0, [r3, 0x3] + movs r7, 0x40 + ldr r1, =0x02024474 + ldr r0, =0x0202420c + b _080487C4 + .pool +_080487B8: + ldr r2, =0x0202420e + ldr r0, =0x0202420c + ldrb r0, [r0] + strb r0, [r2] + ldr r1, =0x02024474 + ldr r0, =0x0202420b +_080487C4: + ldrb r0, [r0] + strb r0, [r1, 0x17] + mov r9, r2 + ldr r2, =0x02024084 + mov r4, r9 + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x13 + bne _08048828 + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 6 + ands r0, r1 + cmp r0, 0 + bne _08048828 + cmp r5, 0 + bne _08048828 + ldr r1, =0x02024332 + ldrb r0, [r1, 0x3] + cmp r0, 0x9 + bhi _08048828 + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r2, =0x02024332 + strb r5, [r2, 0x3] + bl _080499B8 + .pool +_08048828: + mov r3, r9 + ldrb r0, [r3] + bl battle_get_per_side_status + ldr r2, =0x0202428e + movs r1, 0x1 + ands r1, r0 + lsls r1, 1 + adds r1, r2 + ldrh r1, [r1] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08048880 + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 6 + ands r0, r1 + cmp r0, 0 + bne _08048880 + cmp r5, 0 + bne _08048880 + ldr r0, =0x02024332 + ldrb r1, [r0, 0x3] + cmp r1, 0x7 + bhi _08048880 + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r4, =0x02024332 + strb r5, [r4, 0x3] + bl _080499B8 + .pool +_08048880: + ldr r3, =0x02024084 + ldr r2, =0x0202420e + ldrb r1, [r2] + movs r0, 0x58 + muls r0, r1 + adds r0, r3 + ldrh r4, [r0, 0x28] + mov r9, r2 + mov r8, r3 + cmp r4, 0 + bne _080488C4 + ldr r1, =0x02024332 + ldrb r0, [r1, 0x3] + cmp r0, 0xB + beq _080488C4 + cmp r0, 0x1F + beq _080488C4 + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r2, =0x02024332 + strb r4, [r2, 0x3] + bl _080499B8 + .pool +_080488C4: + mov r3, r9 + ldrb r1, [r3] + movs r0, 0x58 + muls r0, r1 + mov r1, r8 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _080488FC + cmp r7, 0x40 + beq _080488FC + ldr r0, =0x02024214 + ldr r1, [r0] + adds r1, 0x1 + str r1, [r0] + movs r0, 0 + ldr r4, =0x02024332 + strb r0, [r4, 0x3] + bl _080499B8 + .pool +_080488FC: + ldr r1, =0x02024332 + ldrb r0, [r1, 0x3] + cmp r0, 0x6 + bls _08048906 + b _08048F40 +_08048906: + ldr r1, =gUnknown_0831C134 + ldr r2, =0x02024332 + ldrb r0, [r2, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0x10 + bne _08048918 + b _08048AFC +_08048918: + cmp r0, 0x10 + bhi _08048930 + cmp r0, 0x7 + beq _0804894A + cmp r0, 0x8 + beq _08048A00 + b _08048DF4 + .pool +_08048930: + cmp r0, 0x40 + bne _08048936 + b _08048C84 +_08048936: + cmp r0, 0x40 + bhi _08048942 + cmp r0, 0x20 + bne _08048940 + b _08048BEA +_08048940: + b _08048DF4 +_08048942: + cmp r0, 0x80 + bne _08048948 + b _08048D02 +_08048948: + b _08048DF4 +_0804894A: + mov r3, r9 + ldrb r1, [r3] + movs r0, 0x58 + muls r0, r1 + add r0, r8 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x2B + beq _080489AC + ldr r0, =0x02024064 + movs r1, 0 + strb r1, [r0] + ldr r1, =0x0202406c + ldrb r3, [r1] + adds r7, r0, 0 + mov r12, r1 + cmp r3, 0 + beq _080489B8 + mov r4, r8 + ldr r0, [r4, 0x50] + movs r1, 0x70 + ands r0, r1 + cmp r0, 0 + bne _080489B8 + adds r1, r7, 0 + mov r6, r8 + adds r6, 0x50 + movs r5, 0x58 + movs r4, 0x70 +_08048984: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, r3 + bcs _080489B8 + ldrb r0, [r7] + muls r0, r5 + adds r0, r6 + ldr r0, [r0] + ands r0, r4 + cmp r0, 0 + beq _08048984 + b _080489B8 + .pool +_080489AC: + ldr r0, =0x02024064 + ldr r2, =0x0202406c + ldrb r1, [r2] + strb r1, [r0] + adds r7, r0, 0 + mov r12, r2 +_080489B8: + mov r0, r9 + ldrb r2, [r0] + movs r0, 0x58 + adds r1, r2, 0 + muls r1, r0 + mov r0, r8 + adds r0, 0x4C + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + beq _080489D0 + b _08048DF4 +_080489D0: + ldrb r0, [r7] + mov r3, r12 + ldrb r3, [r3] + cmp r0, r3 + beq _080489DC + b _08048DF4 +_080489DC: + mov r4, r8 + adds r0, r1, r4 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x48 + bne _080489EA + b _08048DF4 +_080489EA: + cmp r0, 0xF + bne _080489F0 + b _08048DF4 +_080489F0: + adds r0, r2, 0 + bl b_cancel_multi_turn_move_maybe + b _08048DE4 + .pool +_08048A00: + mov r2, r9 + ldrb r1, [r2] + movs r0, 0x58 + muls r0, r1 + add r0, r8 + adds r0, 0x20 + ldrb r1, [r0] + cmp r1, 0x11 + bne _08048A70 + cmp r5, 0x1 + beq _08048A1A + cmp r6, 0x80 + bne _08048A70 +_08048A1A: + ldr r0, =0x0202420a + strb r1, [r0] + mov r3, r9 + ldrb r0, [r3] + movs r1, 0x11 + bl b_history__record_ability_usage_of_player + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082DB5E9 + str r0, [r4] + ldr r2, =0x02024280 + ldr r1, [r2] + movs r0, 0x80 + lsls r0, 6 + ands r0, r1 + cmp r0, 0 + bne _08048A46 + b _08048D20 +_08048A46: + movs r0, 0x1 + ldr r4, =0x02024332 + strb r0, [r4, 0x5] +_08048A4C: + ldr r0, =0xffffdfff + ands r1, r0 + str r1, [r2] + bl _080499B2 + .pool +_08048A70: + mov r2, r9 + ldrb r0, [r2] + movs r1, 0x58 + muls r0, r1 + add r0, r8 + adds r1, r0, 0 + adds r1, 0x21 + ldrb r1, [r1] + cmp r1, 0x3 + beq _08048A94 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0x3 + beq _08048A94 + cmp r1, 0x8 + beq _08048A94 + cmp r0, 0x8 + bne _08048AAE +_08048A94: + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 6 + ands r0, r1 + cmp r0, 0 + beq _08048AAE + cmp r5, 0x1 + bne _08048AA8 + b _08048D66 +_08048AA8: + cmp r6, 0x80 + bne _08048AAE + b _08048D66 +_08048AAE: + mov r3, r9 + ldrb r1, [r3] + movs r0, 0x58 + muls r1, r0 + mov r4, r8 + adds r3, r1, r4 + adds r0, r3, 0 + adds r0, 0x21 + ldrb r4, [r0] + cmp r4, 0x3 + bne _08048AC6 + b _08048DF4 +_08048AC6: + adds r0, 0x1 + ldrb r0, [r0] + cmp r0, 0x3 + bne _08048AD0 + b _08048DF4 +_08048AD0: + cmp r4, 0x8 + bne _08048AD6 + b _08048DF4 +_08048AD6: + cmp r0, 0x8 + bne _08048ADC + b _08048DF4 +_08048ADC: + mov r0, r8 + adds r0, 0x4C + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + beq _08048AEA + b _08048DF4 +_08048AEA: + adds r0, r3, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x11 + bne _08048AF6 + b _08048DF4 +_08048AF6: + b _08048DE4 + .pool +_08048AFC: + mov r2, r9 + ldrb r1, [r2] + movs r0, 0x58 + muls r0, r1 + add r0, r8 + adds r0, 0x20 + ldrb r1, [r0] + cmp r1, 0x29 + bne _08048B54 + cmp r5, 0x1 + beq _08048B16 + cmp r6, 0x80 + bne _08048B54 +_08048B16: + ldr r0, =0x0202420a + strb r1, [r0] + mov r3, r9 + ldrb r0, [r3] + movs r1, 0x29 + bl b_history__record_ability_usage_of_player + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082DB5D1 + str r0, [r4] + ldr r2, =0x02024280 + ldr r1, [r2] + movs r0, 0x80 + lsls r0, 6 + ands r0, r1 + cmp r0, 0 + beq _08048B42 + b _08048A46 +_08048B42: + b _08048D20 + .pool +_08048B54: + mov r2, r9 + ldrb r1, [r2] + movs r0, 0x58 + muls r0, r1 + mov r3, r8 + adds r1, r0, r3 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0xA + beq _08048B74 + adds r0, r1, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0xA + bne _08048BA4 +_08048B74: + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 6 + ands r0, r1 + cmp r0, 0 + beq _08048BA4 + cmp r5, 0x1 + beq _08048B8A + cmp r6, 0x80 + bne _08048BA4 +_08048B8A: + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082DB5D1 + b _08048D72 + .pool +_08048BA4: + mov r4, r9 + ldrb r0, [r4] + movs r1, 0x58 + adds r2, r0, 0 + muls r2, r1 + mov r0, r8 + adds r1, r2, r0 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0xA + bne _08048BBE + b _08048DF4 +_08048BBE: + adds r0, r1, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0xA + bne _08048BCA + b _08048DF4 +_08048BCA: + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x29 + bne _08048BD6 + b _08048DF4 +_08048BD6: + mov r0, r8 + adds r0, 0x4C + adds r0, r2, r0 + ldr r0, [r0] + cmp r0, 0 + beq _08048BE4 + b _08048DF4 +_08048BE4: + movs r1, 0x1 + mov r10, r1 + b _08048DF4 +_08048BEA: + movs r0, 0 + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0xD + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08048C26 + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0x4D + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + bne _08048C26 + ldr r0, =0x020243cc + ldrh r1, [r0] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _08048C26 + movs r2, 0 + str r2, [sp, 0x4] +_08048C26: + ldr r4, =0x02024084 + ldr r0, =0x0202420e + ldrb r3, [r0] + movs r0, 0x58 + adds r2, r3, 0 + muls r2, r0 + adds r1, r2, r4 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0xF + bne _08048C40 + b _08048DF4 +_08048C40: + adds r0, r1, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0xF + bne _08048C4C + b _08048DF4 +_08048C4C: + adds r0, r4, 0 + adds r0, 0x4C + adds r0, r2, r0 + ldr r0, [r0] + cmp r0, 0 + beq _08048C5A + b _08048DF4 +_08048C5A: + ldr r4, [sp, 0x4] + cmp r4, 0 + bne _08048C62 + b _08048DF4 +_08048C62: + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x28 + bne _08048C6E + b _08048DF4 +_08048C6E: + adds r0, r3, 0 + bl b_cancel_multi_turn_move_maybe + b _08048DE4 + .pool +_08048C84: + mov r2, r9 + ldrb r1, [r2] + movs r0, 0x58 + muls r1, r0 + mov r3, r8 + adds r0, r1, r3 + adds r0, 0x20 + ldrb r2, [r0] + cmp r2, 0x7 + bne _08048CF4 + cmp r5, 0x1 + beq _08048CA2 + cmp r6, 0x80 + beq _08048CA2 + b _08048DF4 +_08048CA2: + ldr r0, =0x0202420a + strb r2, [r0] + mov r4, r9 + ldrb r0, [r4] + movs r1, 0x7 + bl b_history__record_ability_usage_of_player + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082DB5DD + str r0, [r4] + ldr r2, =0x02024280 + ldr r1, [r2] + movs r0, 0x80 + lsls r0, 6 + ands r0, r1 + cmp r0, 0 + beq _08048CE8 + movs r0, 0x1 + ldr r3, =0x02024332 + strb r0, [r3, 0x5] + b _08048A4C + .pool +_08048CE8: + ldr r4, =0x02024332 + strb r0, [r4, 0x5] + bl _080499B2 + .pool +_08048CF4: + mov r0, r8 + adds r0, 0x4C + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _08048DF4 + b _08048DE4 +_08048D02: + mov r2, r9 + ldrb r1, [r2] + movs r0, 0x58 + muls r0, r1 + add r0, r8 + adds r0, 0x20 + ldrb r1, [r0] + cmp r1, 0x11 + bne _08048D2C + cmp r5, 0x1 + bne _08048D1A + b _08048A1A +_08048D1A: + cmp r6, 0x80 + bne _08048D2C + b _08048A1A +_08048D20: + ldr r1, =0x02024332 + strb r0, [r1, 0x5] + bl _080499B2 + .pool +_08048D2C: + mov r2, r9 + ldrb r0, [r2] + movs r1, 0x58 + muls r0, r1 + add r0, r8 + adds r1, r0, 0 + adds r1, 0x21 + ldrb r1, [r1] + cmp r1, 0x3 + beq _08048D50 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0x3 + beq _08048D50 + cmp r1, 0x8 + beq _08048D50 + cmp r0, 0x8 + bne _08048D94 +_08048D50: + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 6 + ands r0, r1 + cmp r0, 0 + beq _08048D94 + cmp r5, 0x1 + beq _08048D66 + cmp r6, 0x80 + bne _08048D94 +_08048D66: + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082DB5E9 +_08048D72: + str r0, [r4] + ldr r1, =0x02024332 + movs r2, 0 + movs r0, 0x2 + strb r0, [r1, 0x5] + strb r2, [r1, 0x3] + bl _080499B8 + .pool +_08048D94: + mov r3, r9 + ldrb r0, [r3] + movs r6, 0x58 + muls r0, r6 + mov r2, r8 + adds r2, 0x4C + adds r5, r0, r2 + ldr r4, [r5] + cmp r4, 0 + bne _08048DF4 + mov r3, r8 + adds r1, r0, r3 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r3, [r0] + cmp r3, 0x3 + beq _08048DEA + adds r0, 0x1 + ldrb r0, [r0] + cmp r0, 0x3 + beq _08048DEA + cmp r3, 0x8 + beq _08048DEA + cmp r0, 0x8 + beq _08048DEA + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x11 + beq _08048DF4 + mov r4, r9 + ldrb r0, [r4] + adds r1, r0, 0 + muls r1, r6 + adds r1, r2 + ldr r0, [r1] + movs r2, 0x9 + negs r2, r2 + ands r0, r2 + str r0, [r1] +_08048DE4: + movs r0, 0x1 + mov r10, r0 + b _08048DF4 +_08048DEA: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0] +_08048DF4: + mov r1, r10 + cmp r1, 0x1 + beq _08048DFC + b _08048F1C +_08048DFC: + ldr r0, =0x02024214 + ldr r0, [r0] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r1, =gUnknown_0831C134 + ldr r0, =0x02024332 + ldrb r0, [r0, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r3, [r0] + cmp r3, 0x7 + bne _08048E50 + bl GenerateRandomNumber + ldr r2, =0x02024084 + ldr r1, =0x0202420e + ldrb r3, [r1] + movs r1, 0x58 + muls r3, r1 + adds r2, 0x4C + adds r3, r2 + movs r1, 0x3 + ands r1, r0 + adds r1, 0x2 + ldr r0, [r3] + orrs r0, r1 + str r0, [r3] + b _08048E64 + .pool +_08048E50: + ldr r2, =0x02024084 + ldr r0, =0x0202420e + ldrb r1, [r0] + movs r0, 0x58 + muls r1, r0 + adds r2, 0x4C + adds r1, r2 + ldr r0, [r1] + orrs r0, r3 + str r0, [r1] +_08048E64: + ldr r2, =0x02024214 + ldr r1, =gUnknown_0831C224 + ldr r5, =0x02024332 + ldrb r0, [r5, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [r2] + ldr r4, =0x02024064 + ldr r1, =0x0202420e + ldrb r0, [r1] + strb r0, [r4] + ldrb r1, [r1] + movs r0, 0x58 + muls r0, r1 + ldr r1, =0x020240d0 + adds r0, r1 + str r0, [sp] + movs r0, 0 + movs r1, 0x28 + movs r2, 0 + movs r3, 0x4 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r2, =0x02024280 + ldr r1, [r2] + movs r0, 0x80 + lsls r0, 6 + ands r0, r1 + cmp r0, 0 + beq _08048ED8 + movs r0, 0x1 + strb r0, [r5, 0x5] + ldr r0, =0xffffdfff + ands r1, r0 + str r1, [r2] + b _08048EDA + .pool +_08048ED8: + strb r0, [r5, 0x5] +_08048EDA: + ldr r0, =0x02024332 + ldrb r2, [r0, 0x3] + cmp r2, 0x2 + beq _08048EF2 + cmp r2, 0x6 + beq _08048EF2 + cmp r2, 0x5 + beq _08048EF2 + cmp r2, 0x3 + beq _08048EF2 + bl _080499B8 +_08048EF2: + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0xB2 + ldr r2, =0x02024332 + ldrb r1, [r2, 0x3] + strb r1, [r0] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 7 + orrs r0, r1 + str r0, [r2] + bl _080499B8 + .pool +_08048F1C: + mov r3, r10 + cmp r3, 0 + beq _08048F26 + bl _080499B8 +_08048F26: + ldr r0, =0x02024332 + strb r3, [r0, 0x3] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bl _080499B8 + .pool +_08048F40: + mov r4, r9 + ldrb r1, [r4] + movs r0, 0x58 + muls r1, r0 + mov r0, r8 + adds r0, 0x50 + adds r1, r0 + ldr r2, =gUnknown_0831C134 + ldr r0, =0x02024332 + ldrb r3, [r0, 0x3] + lsls r0, r3, 2 + adds r0, r2 + ldr r1, [r1] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _08048F66 + bl _08049994 +_08048F66: + subs r0, r3, 0x7 + cmp r0, 0x34 + bls _08048F70 + bl _080499B2 +_08048F70: + lsls r0, 2 + ldr r1, =_08048F88 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08048F88: + .4byte _0804905C + .4byte _080490D0 + .4byte _08049244 + .4byte _0804915C + .4byte _080491D8 + .4byte _0804927C + .4byte _080492C4 + .4byte _08049390 + .4byte _080493D4 + .4byte _080493D4 + .4byte _080493D4 + .4byte _080493D4 + .4byte _080493D4 + .4byte _080493D4 + .4byte _080493D4 + .4byte _0804941C + .4byte _0804941C + .4byte _0804941C + .4byte _0804941C + .4byte _0804941C + .4byte _0804941C + .4byte _0804941C + .4byte _080494FC + .4byte _08049544 + .4byte _08049564 + .4byte _08049720 + .4byte _0804975C + .4byte _08049778 + .4byte _08049790 + .4byte _080497A8 + .4byte _08049808 + .4byte _08049820 + .4byte _08049468 + .4byte _08049468 + .4byte _08049468 + .4byte _08049468 + .4byte _08049468 + .4byte _08049468 + .4byte _08049468 + .4byte _080494B0 + .4byte _080494B0 + .4byte _080494B0 + .4byte _080494B0 + .4byte _080494B0 + .4byte _080494B0 + .4byte _080494B0 + .4byte _08049864 + .4byte _080498C0 + .4byte _080499B2 + .4byte _080499B2 + .4byte _080499B2 + .4byte _080499B2 + .4byte _080499A4 +_0804905C: + mov r1, r9 + ldrb r0, [r1] + movs r5, 0x58 + adds r1, r0, 0 + muls r1, r5 + mov r2, r8 + adds r0, r1, r2 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x14 + bne _08049076 + bl _08049994 +_08049076: + mov r4, r8 + adds r4, 0x50 + adds r0, r1, r4 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + beq _0804908A + bl _08049994 +_0804908A: + bl GenerateRandomNumber + mov r3, r9 + ldrb r1, [r3] + adds r2, r1, 0 + muls r2, r5 + adds r2, r4 + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + lsrs r1, 16 + adds r1, 0x2 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r1, =gUnknown_0831C224 + ldr r0, =0x02024332 + ldrb r0, [r0, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _080499B0 + .pool +_080490D0: + mov r4, r9 + ldrb r2, [r4] + movs r4, 0x58 + adds r0, r2, 0 + muls r0, r4 + add r0, r8 + adds r0, 0x20 + ldrb r1, [r0] + cmp r1, 0x27 + bne _08049114 + cmp r5, 0x1 + beq _080490F0 + cmp r6, 0x80 + beq _080490F0 + bl _08049994 +_080490F0: + ldr r0, =0x0202420a + strb r1, [r0] + mov r1, r9 + ldrb r0, [r1] + movs r1, 0x27 + bl b_history__record_ability_usage_of_player + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB603 + str r0, [r1] + bl _080499B2 + .pool +_08049114: + adds r0, r2, 0 + bl sub_8048728 + ldr r1, =0x02024082 + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bhi _0804912A + bl _08049994 +_0804912A: + mov r2, r9 + ldrb r0, [r2] + adds r2, r0, 0 + muls r2, r4 + mov r0, r8 + adds r0, 0x50 + adds r2, r0 + ldr r1, =gUnknown_0831C134 + ldr r0, =0x02024332 + ldrb r0, [r0, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r1, [r2] + ldr r0, [r0] + orrs r1, r0 + str r1, [r2] + bl _08049994 + .pool +_0804915C: + mov r3, r9 + ldrb r0, [r3] + movs r5, 0x58 + muls r0, r5 + mov r4, r8 + adds r4, 0x50 + adds r2, r0, r4 + ldr r1, [r2] + movs r0, 0x70 + ands r0, r1 + cmp r0, 0 + beq _08049178 + bl _08049994 +_08049178: + movs r0, 0x80 + lsls r0, 5 + orrs r1, r0 + str r1, [r2] + ldr r1, =0x02024268 + ldrb r0, [r3] + lsls r0, 1 + adds r0, r1 + ldr r1, =0x020241ea + ldrh r1, [r1] + strh r1, [r0] + bl GenerateRandomNumber + mov r2, r9 + ldrb r1, [r2] + adds r2, r1, 0 + muls r2, r5 + adds r2, r4 + movs r1, 0x3 + ands r1, r0 + adds r1, 0x2 + lsls r1, 4 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r1, =gUnknown_0831C224 + ldr r0, =0x02024332 + ldrb r0, [r0, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _080499B0 + .pool +_080491D8: + ldr r5, =0x0202420b + ldrb r0, [r5] + bl battle_get_per_side_status + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + bne _08049210 + ldr r4, =0x0202432e + ldrh r3, [r4] + ldr r2, =0x02024084 + ldrb r1, [r5] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x2A + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + adds r0, r3, r0 + strh r0, [r4] + lsls r0, 16 + lsrs r0, 16 + cmp r3, r0 + bls _08049210 + ldr r3, =0x0000ffff + adds r0, r3, 0 + strh r0, [r4] +_08049210: + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r1, =gUnknown_0831C224 + ldr r0, =0x02024332 + ldrb r0, [r0, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + b _080499B0 + .pool +_08049244: + mov r4, r9 + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 + mov r1, r8 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + beq _0804925A + b _08049994 +_0804925A: + bl GenerateRandomNumber + ldr r4, =0x02024332 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + adds r0, 0x3 + strb r0, [r4, 0x3] + movs r0, 0 + movs r1, 0 + bl sub_8048760 + b _080499B2 + .pool +_0804927C: + mov r0, r9 + ldrb r1, [r0] + movs r0, 0x58 + adds r2, r1, 0 + muls r2, r0 + mov r0, r8 + adds r0, 0x50 + adds r2, r0 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 5 + orrs r0, r1 + str r0, [r2] + ldr r1, =0x02024268 + mov r2, r9 + ldrb r0, [r2] + lsls r0, 1 + adds r0, r1 + ldr r1, =0x020241ea + ldrh r1, [r1] + strh r1, [r0] + ldr r0, =0x0202433c + ldrb r1, [r2] + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1, 0x1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1, 0x1] + b _08049994 + .pool +_080492C4: + mov r3, r9 + ldrb r0, [r3] + movs r6, 0x58 + muls r0, r6 + mov r4, r8 + adds r4, 0x50 + adds r0, r4 + ldr r5, [r0] + movs r0, 0xE0 + lsls r0, 8 + ands r5, r0 + cmp r5, 0 + beq _080492E0 + b _08049994 +_080492E0: + bl GenerateRandomNumber + mov r2, r9 + ldrb r1, [r2] + adds r2, r1, 0 + muls r2, r6 + adds r2, r4 + movs r1, 0x3 + ands r1, r0 + adds r1, 0x3 + lsls r1, 13 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + mov r3, r9 + ldrb r1, [r3] + ldr r2, =0x0202449c + ldr r0, [r2] + lsls r1, 1 + adds r1, r0 + ldr r6, =0x020241ea + ldrh r0, [r6] + strb r0, [r1, 0x4] + ldrb r1, [r3] + ldr r0, [r2] + lsls r1, 1 + adds r1, r0 + ldrh r0, [r6] + lsrs r0, 8 + strb r0, [r1, 0x5] + ldrb r1, [r3] + ldr r0, [r2] + adds r1, r0 + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r1, 0x14] + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r1, =gUnknown_0831C224 + ldr r2, =0x02024332 + ldrb r0, [r2, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [r4] + strb r5, [r2, 0x5] + ldr r3, =gUnknown_085CC982 + ldrh r0, [r3] + ldrh r4, [r6] + cmp r0, r4 + bne _0804934E + b _080499B2 +_0804934E: + adds r1, r2, 0 + adds r2, r6, 0 +_08049352: + ldrb r0, [r1, 0x5] + adds r0, 0x1 + strb r0, [r1, 0x5] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bls _08049362 + b _080499B2 +_08049362: + ldrb r0, [r1, 0x5] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + ldrh r4, [r2] + cmp r0, r4 + bne _08049352 + b _080499B2 + .pool +_08049390: + ldr r1, =0x020241f0 + ldr r0, =0x020241f4 + ldr r0, [r0] + cmp r0, 0 + bge _0804939C + adds r0, 0x3 +_0804939C: + asrs r0, 2 + str r0, [r1] + cmp r0, 0 + bne _080493A8 + movs r0, 0x1 + str r0, [r1] +_080493A8: + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r1, =gUnknown_0831C224 + ldr r0, =0x02024332 + ldrb r0, [r0, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + b _080499B0 + .pool +_080493D4: + ldr r4, =0x02024332 + ldrb r1, [r4, 0x3] + adds r1, 0xF2 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x10 + adds r2, r7, 0 + movs r3, 0 + bl sub_8050A1C + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + beq _080493F2 + b _08049994 +_080493F2: + ldr r2, =0x02024474 + ldrb r1, [r4, 0x3] + movs r0, 0x3F + ands r0, r1 + strb r0, [r2, 0x10] + strb r3, [r2, 0x11] + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082D8CD4 + b _080499B0 + .pool +_0804941C: + movs r0, 0x70 + negs r0, r0 + ldr r4, =0x02024332 + ldrb r1, [r4, 0x3] + adds r1, 0xEB + lsls r1, 24 + lsrs r1, 24 + adds r2, r7, 0 + movs r3, 0 + bl sub_8050A1C + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + beq _0804943C + b _08049994 +_0804943C: + ldr r2, =0x02024474 + ldrb r1, [r4, 0x3] + movs r0, 0x3F + ands r0, r1 + strb r0, [r2, 0x10] + strb r3, [r2, 0x11] + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082D8D65 + b _080499B0 + .pool +_08049468: + ldr r4, =0x02024332 + ldrb r1, [r4, 0x3] + adds r1, 0xDA + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x20 + adds r2, r7, 0 + movs r3, 0 + bl sub_8050A1C + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + beq _08049486 + b _08049994 +_08049486: + ldr r2, =0x02024474 + ldrb r1, [r4, 0x3] + movs r0, 0x3F + ands r0, r1 + strb r0, [r2, 0x10] + strb r3, [r2, 0x11] + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082D8CD4 + b _080499B0 + .pool +_080494B0: + movs r0, 0x60 + negs r0, r0 + ldr r4, =0x02024332 + ldrb r1, [r4, 0x3] + adds r1, 0xD3 + lsls r1, 24 + lsrs r1, 24 + adds r2, r7, 0 + movs r3, 0 + bl sub_8050A1C + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + beq _080494D0 + b _08049994 +_080494D0: + ldr r2, =0x02024474 + ldrb r1, [r4, 0x3] + movs r0, 0x3F + ands r0, r1 + strb r0, [r2, 0x10] + strb r3, [r2, 0x11] + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082D8D65 + b _080499B0 + .pool +_080494FC: + mov r0, r9 + ldrb r1, [r0] + movs r0, 0x58 + adds r2, r1, 0 + muls r2, r0 + mov r0, r8 + adds r0, 0x50 + adds r2, r0 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 15 + orrs r0, r1 + str r0, [r2] + ldr r2, =0x020242bc + mov r3, r9 + ldrb r1, [r3] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x2 + strb r1, [r0, 0x19] + ldr r1, =0x02024268 + ldrb r0, [r3] + lsls r0, 1 + adds r0, r1 + ldr r1, =0x020241ea + ldrh r1, [r1] + strh r1, [r0] + b _08049994 + .pool +_08049544: + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + adds r2, r1, 0 + muls r2, r0 + mov r0, r8 + adds r0, 0x50 + adds r2, r0 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 16 +_0804955A: + orrs r0, r1 + str r0, [r2] + b _08049994 + .pool +_08049564: + ldr r5, =0x02022fec + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 19 + ands r0, r1 + cmp r0, 0 + beq _08049574 + b _08049994 +_08049574: + ldr r6, =0x0202420b + ldrb r0, [r6] + bl battle_side_get_owner + lsls r0, 24 + lsrs r4, r0, 24 + ldrb r0, [r6] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080495A8 + ldr r0, [r5] + ldr r1, =0x0a3f0902 + ands r0, r1 + cmp r0, 0 + bne _080495D4 + b _08049994 + .pool +_080495A8: + ldr r0, [r5] + ldr r1, =0x0a3f0902 + ands r0, r1 + cmp r0, 0 + bne _080495D4 + ldr r0, =0x020243d0 + adds r0, 0x29 + adds r0, r4, r0 + ldrb r1, [r0] + ldr r3, =gUnknown_0832A328 + ldr r2, =0x0202406e + ldrb r0, [r6] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _080495D4 + b _08049994 +_080495D4: + ldr r2, =0x02024084 + ldr r1, =0x0202420c + ldrb r0, [r1] + movs r5, 0x58 + muls r0, r5 + adds r4, r0, r2 + ldrh r0, [r4, 0x2E] + adds r7, r1, 0 + mov r8, r2 + cmp r0, 0 + beq _0804963C + adds r0, r4, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x3C + bne _0804963C + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB682 + str r0, [r1] + ldr r1, =0x0202420a + ldrb r0, [r7] + muls r0, r5 + add r0, r8 + adds r0, 0x20 + ldrb r0, [r0] + strb r0, [r1] + ldrb r0, [r7] + ldrb r1, [r1] + bl b_history__record_ability_usage_of_player + b _080499B2 + .pool +_0804963C: + ldr r4, =0x0202420b + mov r10, r4 + ldrb r2, [r4] + movs r0, 0x58 + mov r9, r0 + mov r0, r9 + muls r0, r2 + add r0, r8 + ldrh r4, [r0, 0x2E] + cmp r4, 0 + beq _08049654 + b _08049994 +_08049654: + ldrb r0, [r7] + mov r1, r9 + muls r1, r0 + adds r0, r1, 0 + add r0, r8 + ldrh r3, [r0, 0x2E] + adds r1, r3, 0 + cmp r1, 0xAF + bne _08049668 + b _08049994 +_08049668: + adds r0, r3, 0 + subs r0, 0x79 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xB + bhi _08049676 + b _08049994 +_08049676: + cmp r1, 0 + bne _0804967C + b _08049994 +_0804967C: + ldr r5, =0x0202449c + lsls r0, r2, 1 + adds r0, 0xD0 + ldr r1, [r5] + adds r1, r0 + ldr r2, =0x02024208 + strh r3, [r1] + strh r3, [r2] + ldrb r0, [r7] + mov r3, r9 + muls r3, r0 + adds r0, r3, 0 + add r0, r8 + movs r6, 0 + strh r4, [r0, 0x2E] + ldr r4, =0x02024064 + mov r1, r10 + ldrb r0, [r1] + strb r0, [r4] + str r2, [sp] + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + movs r3, 0x2 + bl dp01_build_cmdbuf_x02_a_b_varargs + mov r2, r10 + ldrb r0, [r2] + bl dp01_battle_side_mark_buffer_for_execution + ldrb r0, [r7] + strb r0, [r4] + ldrb r0, [r7] + mov r3, r9 + muls r3, r0 + adds r0, r3, 0 + mov r1, r8 + adds r1, 0x2E + adds r0, r1 + str r0, [sp] + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + movs r3, 0x2 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r7] + bl dp01_battle_side_mark_buffer_for_execution + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082DB422 + str r0, [r4] + ldrb r0, [r7] + ldr r1, [r5] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC8 + strb r6, [r0] + ldrb r0, [r7] + ldr r1, [r5] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC9 + strb r6, [r0] + b _080499B2 + .pool +_08049720: + ldr r3, =0x0202420c + ldrb r1, [r3] + movs r0, 0x58 + adds r2, r1, 0 + muls r2, r0 + mov r0, r8 + adds r0, 0x50 + adds r2, r0 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 19 + orrs r0, r1 + str r0, [r2] + ldr r2, =0x020242bc + ldrb r1, [r3] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x0202420b + ldrb r1, [r1] + strb r1, [r0, 0x14] + b _08049994 + .pool +_0804975C: + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0x58 + adds r2, r1, 0 + muls r2, r0 + mov r0, r8 + adds r0, 0x50 + adds r2, r0 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 20 + b _0804955A + .pool +_08049778: + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082DAF27 + b _080499B0 + .pool +_08049790: + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082DAFC3 + b _080499B0 + .pool +_080497A8: + ldr r6, =0x0202420c + ldrb r0, [r6] + movs r2, 0x58 + muls r0, r2 + mov r1, r8 + adds r1, 0x4C + adds r5, r0, r1 + ldr r4, [r5] + movs r0, 0x40 + ands r0, r4 + cmp r0, 0 + bne _080497C2 + b _08049994 +_080497C2: + movs r0, 0x41 + negs r0, r0 + ands r4, r0 + str r4, [r5] + ldr r4, =0x02024064 + ldrb r0, [r6] + strb r0, [r4] + ldrb r0, [r4] + muls r0, r2 + adds r0, r1 + str r0, [sp] + movs r0, 0 + movs r1, 0x28 + movs r2, 0 + movs r3, 0x4 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082DB361 + b _080499B0 + .pool +_08049808: + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082DB117 + b _080499B0 + .pool +_08049820: + ldr r4, =0x020241f0 + ldr r0, =0x020241f4 + ldr r0, [r0] + movs r1, 0x3 + bl __divsi3 + str r0, [r4] + cmp r0, 0 + bne _08049836 + movs r0, 0x1 + str r0, [r4] +_08049836: + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r1, =gUnknown_0831C224 + ldr r0, =0x02024332 + ldrb r0, [r0, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + b _080499B0 + .pool +_08049864: + mov r4, r9 + ldrb r0, [r4] + movs r5, 0x58 + muls r0, r5 + mov r4, r8 + adds r4, 0x50 + adds r2, r0, r4 + ldr r1, [r2] + movs r0, 0xC0 + lsls r0, 4 + ands r0, r1 + cmp r0, 0 + beq _08049880 + b _08049994 +_08049880: + movs r0, 0x80 + lsls r0, 5 + orrs r1, r0 + str r1, [r2] + ldr r1, =0x02024268 + mov r2, r9 + ldrb r0, [r2] + lsls r0, 1 + adds r0, r1 + ldr r1, =0x020241ea + ldrh r1, [r1] + strh r1, [r0] + bl GenerateRandomNumber + mov r3, r9 + ldrb r1, [r3] + adds r2, r1, 0 + muls r2, r5 + adds r2, r4 + movs r1, 0x1 + ands r1, r0 + adds r1, 0x2 + lsls r1, 10 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + b _080499B2 + .pool +_080498C0: + mov r4, r9 + ldrb r3, [r4] + movs r5, 0x58 + adds r0, r3, 0 + muls r0, r5 + mov r2, r8 + adds r1, r0, r2 + adds r0, r1, 0 + adds r0, 0x20 + ldrb r2, [r0] + cmp r2, 0x3C + bne _08049900 + ldrh r0, [r1, 0x2E] + cmp r0, 0 + beq _08049994 + ldr r0, =0x0202420a + strb r2, [r0] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB63F + str r0, [r1] + ldrb r0, [r4] + movs r1, 0x3C + bl b_history__record_ability_usage_of_player + b _080499B2 + .pool +_08049900: + ldrh r0, [r1, 0x2E] + cmp r0, 0 + beq _08049994 + adds r0, r3, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x02024208 + mov r3, r9 + ldrb r0, [r3] + muls r0, r5 + add r0, r8 + ldrh r0, [r0, 0x2E] + strh r0, [r1] + ldrb r0, [r3] + muls r0, r5 + add r0, r8 + movs r5, 0 + movs r1, 0 + strh r1, [r0, 0x2E] + ldr r2, =0x020243d0 + adds r2, 0x29 + adds r2, r4, r2 + ldr r3, =gUnknown_0832A328 + ldr r1, =0x0202406e + mov r4, r9 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082DB168 + str r0, [r4] + mov r1, r9 + ldrb r0, [r1] + ldr r2, =0x0202449c + ldr r1, [r2] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC8 + strb r5, [r0] + mov r3, r9 + ldrb r0, [r3] + ldr r1, [r2] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC9 + strb r5, [r0] + b _080499B2 + .pool +_08049994: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + b _080499B2 + .pool +_080499A4: + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082DB1D5 +_080499B0: + str r0, [r4] +_080499B2: + ldr r1, =0x02024332 + movs r0, 0 + strb r0, [r1, 0x3] +_080499B8: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8048760 + + thumb_func_start atk15_seteffectwithchancetarget +atk15_seteffectwithchancetarget: @ 80499D4 + push {r4,lr} + ldr r2, =0x02024084 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x20 + bne _08049A10 + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x5] + lsls r4, r0, 1 + b _08049A20 + .pool +_08049A10: + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r4, [r0, 0x5] +_08049A20: + ldr r3, =0x02024332 + ldrb r2, [r3, 0x3] + movs r0, 0x80 + ands r0, r2 + cmp r0, 0 + beq _08049A50 + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _08049A50 + movs r0, 0x7F + ands r0, r2 + strb r0, [r3, 0x3] + b _08049A7E + .pool +_08049A50: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, r4 + bcs _08049A9A + ldr r0, =0x02024332 + ldrb r0, [r0, 0x3] + cmp r0, 0 + beq _08049A9A + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _08049A9A + cmp r4, 0x63 + bls _08049A90 +_08049A7E: + movs r0, 0 + movs r1, 0x80 + bl sub_8048760 + b _08049AA2 + .pool +_08049A90: + movs r0, 0 + movs r1, 0 + bl sub_8048760 + b _08049AA2 +_08049A9A: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_08049AA2: + ldr r0, =0x02024332 + movs r1, 0 + strb r1, [r0, 0x3] + ldr r0, =0x02024474 + strb r1, [r0, 0x16] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk15_seteffectwithchancetarget + + thumb_func_start sub_8049AC0 +sub_8049AC0: @ 8049AC0 + push {lr} + movs r0, 0x1 + movs r1, 0 + bl sub_8048760 + pop {r0} + bx r0 + thumb_func_end sub_8049AC0 + + thumb_func_start sub_8049AD0 +sub_8049AD0: @ 8049AD0 + push {lr} + movs r0, 0 + movs r1, 0 + bl sub_8048760 + pop {r0} + bx r0 + thumb_func_end sub_8049AD0 + + thumb_func_start sub_8049AE0 +sub_8049AE0: @ 8049AE0 + push {lr} + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r2, =0x02024064 + strb r0, [r2] + ldr r3, =0x02024332 + ldrb r0, [r3, 0x3] + cmp r0, 0x6 + bhi _08049B14 + ldr r1, =0x02024084 + ldrb r2, [r2] + movs r0, 0x58 + muls r2, r0 + adds r1, 0x4C + b _08049B1E + .pool +_08049B14: + ldr r1, =0x02024084 + ldrb r2, [r2] + movs r0, 0x58 + muls r2, r0 + adds r1, 0x50 +_08049B1E: + adds r2, r1 + ldr r1, =gUnknown_0831C134 + ldrb r0, [r3, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldr r0, [r2] + bics r0, r1 + str r0, [r2] + ldr r0, =0x02024332 + movs r2, 0 + strb r2, [r0, 0x3] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] + ldr r0, =0x02024474 + strb r2, [r0, 0x16] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8049AE0 + + thumb_func_start atk19_faintpokemon +atk19_faintpokemon: @ 8049B5C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + ldr r0, =0x02024214 + ldr r2, [r0] + ldrb r1, [r2, 0x2] + adds r6, r0, 0 + cmp r1, 0 + beq _08049BE0 + ldrb r0, [r2, 0x1] + bl get_battle_side_of_something + ldr r5, =0x02024064 + strb r0, [r5] + ldr r2, =0x02024280 + ldr r1, =gUnknown_0832A328 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + lsls r1, 28 + ldr r0, [r2] + ands r0, r1 + cmp r0, 0 + bne _08049B94 + b _08049E2C +_08049B94: + ldr r1, [r6] + ldrb r4, [r1, 0x3] + ldrb r0, [r1, 0x4] + lsls r0, 8 + orrs r4, r0 + ldrb r0, [r1, 0x5] + lsls r0, 16 + orrs r4, r0 + ldrb r0, [r1, 0x6] + lsls r0, 24 + orrs r4, r0 + bl b_movescr_stack_pop_cursor + str r4, [r6] + ldrb r0, [r5] + bl battle_side_get_owner + ldr r1, =0x0202428e + lsls r0, 24 + lsrs r0, 23 + adds r0, r1 + ldrh r2, [r0] + ldr r1, =0x0000fdff + ands r1, r2 + strh r1, [r0] + b _08049E32 + .pool +_08049BE0: + ldrb r0, [r2, 0x1] + cmp r0, 0x1 + bne _08049C08 + ldr r1, =0x02024064 + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r1] + ldr r0, =0x0202420c + ldrb r0, [r0] + mov r9, r0 + ldr r4, =gUnknown_082DA7AA + b _08049C18 + .pool +_08049C08: + ldr r1, =0x02024064 + ldr r0, =0x0202420c + ldrb r0, [r0] + strb r0, [r1] + ldr r0, =0x0202420b + ldrb r0, [r0] + mov r9, r0 + ldr r4, =gUnknown_082DA7B7 +_08049C18: + mov r8, r1 + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + mov r7, r8 + ldrb r3, [r7] + lsls r0, r3, 2 + adds r0, r2 + ldr r2, [r0] + ands r1, r2 + cmp r1, 0 + beq _08049C32 + b _08049E2C +_08049C32: + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r3 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _08049C42 + b _08049E2C +_08049C42: + ldr r5, =0x02024280 + lsls r1, r2, 28 + ldr r0, [r5] + orrs r0, r1 + str r0, [r5] + ldr r0, [r6] + adds r0, 0x7 + bl b_movescr_stack_push + str r4, [r6] + ldrb r0, [r7] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08049CA4 + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 15 + orrs r0, r1 + str r0, [r5] + ldr r1, =0x03005d10 + ldrb r0, [r1] + cmp r0, 0xFE + bhi _08049C78 + adds r0, 0x1 + strb r0, [r1] +_08049C78: + ldrb r0, [r7] + bl sub_80570F4 + b _08049CCE + .pool +_08049CA4: + ldr r4, =0x03005d10 + ldrb r0, [r4, 0x1] + cmp r0, 0xFE + bhi _08049CB0 + adds r0, 0x1 + strb r0, [r4, 0x1] +_08049CB0: + ldr r1, =0x0202406e + mov r2, r8 + ldrb r0, [r2] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r4, 0x20] +_08049CCE: + ldr r2, =0x02024280 + ldr r1, [r2] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08049D0C + ldr r6, =0x02024084 + ldr r0, =0x0202420b + ldrb r0, [r0] + movs r5, 0x58 + muls r0, r5 + adds r0, r6 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _08049D0C + movs r0, 0x41 + negs r0, r0 + ands r1, r0 + str r1, [r2] + ldr r4, =0x02024214 + ldr r0, [r4] + bl b_movescr_stack_push + ldr r1, =0x020241f0 + mov r0, r9 + muls r0, r5 + adds r0, r6 + ldrh r0, [r0, 0x28] + str r0, [r1] + ldr r0, =gUnknown_082DAE3E + str r0, [r4] +_08049D0C: + ldr r1, =0x020242ac + ldr r6, =0x0202420c + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 7 + ands r0, r1 + cmp r0, 0 + bne _08049D24 + b _08049E32 +_08049D24: + ldr r0, =0x02024280 + ldr r5, [r0] + movs r0, 0x80 + lsls r0, 17 + ands r5, r0 + cmp r5, 0 + beq _08049D34 + b _08049E32 +_08049D34: + ldr r3, =0x0202420b + mov r8, r3 + ldrb r0, [r3] + bl battle_side_get_owner + adds r4, r0, 0 + ldrb r0, [r6] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _08049E32 + ldr r0, =0x02024084 + mov r9, r0 + mov r2, r8 + ldrb r1, [r2] + movs r7, 0x58 + adds r2, r1, 0 + muls r2, r7 + adds r0, r2, r0 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _08049E32 + ldr r0, =0x020241ea + ldrh r0, [r0] + cmp r0, 0xA5 + beq _08049E32 + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, r1, r0 + adds r0, 0x80 + ldrb r4, [r0] + adds r0, r4, r2 + mov r6, r9 + adds r6, 0x24 + adds r0, r6 + strb r5, [r0] + ldr r5, =0x02024214 + ldr r0, [r5] + bl b_movescr_stack_push + ldr r0, =gUnknown_082DB18D + str r0, [r5] + ldr r5, =0x02024064 + mov r3, r8 + ldrb r0, [r3] + strb r0, [r5] + adds r1, r4, 0 + adds r1, 0x9 + lsls r1, 24 + lsrs r1, 24 + ldrb r0, [r5] + muls r0, r7 + adds r0, r6 + adds r0, r4 + str r0, [sp] + movs r0, 0 + movs r2, 0 + movs r3, 0x1 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r5] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x2 + strb r0, [r1, 0x1] + lsls r4, 1 + mov r2, r8 + ldrb r0, [r2] + muls r0, r7 + adds r0, r4, r0 + mov r2, r9 + adds r2, 0xC + adds r0, r2 + ldrh r0, [r0] + strb r0, [r1, 0x2] + mov r3, r8 + ldrb r0, [r3] + muls r0, r7 + adds r4, r0 + adds r4, r2 + ldrh r0, [r4] + lsrs r0, 8 + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + b _08049E32 + .pool +_08049E2C: + ldr r0, [r6] + adds r0, 0x7 + str r0, [r6] +_08049E32: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end atk19_faintpokemon + + thumb_func_start sub_8049E40 +sub_8049E40: @ 8049E40 + push {r4,r5,lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _08049E6A + ldr r5, =0x02024214 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r4, =0x02024064 + strb r0, [r4] + movs r0, 0 + bl dp01_build_cmdbuf_x0A_A_A_A + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r5] + adds r0, 0x2 + str r0, [r5] +_08049E6A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8049E40 + + thumb_func_start sub_8049E7C +sub_8049E7C: @ 8049E7C + push {r4,r5,lr} + sub sp, 0x4 + ldr r0, =0x02024068 + ldr r5, [r0] + cmp r5, 0 + bne _08049EE8 + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r4, =0x02024064 + strb r0, [r4] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _08049EB4 + ldr r2, =0x02024084 + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _08049EDC +_08049EB4: + ldr r1, =0x02024084 + ldrb r0, [r4] + movs r2, 0x58 + muls r0, r2 + adds r1, 0x4C + adds r0, r1 + str r5, [r0] + ldrb r0, [r4] + muls r0, r2 + adds r0, r1 + str r0, [sp] + movs r0, 0 + movs r1, 0x28 + movs r2, 0 + movs r3, 0x4 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_08049EDC: + bl sub_803A75C + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] +_08049EE8: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8049E7C + + thumb_func_start atk1C_jumpifstatus +atk1C_jumpifstatus: @ 8049F04 + push {r4,r5,lr} + ldr r5, =0x02024214 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + lsls r0, 24 + lsrs r0, 24 + ldr r2, [r5] + ldrb r4, [r2, 0x2] + ldrb r1, [r2, 0x3] + lsls r1, 8 + adds r4, r1 + ldrb r1, [r2, 0x4] + lsls r1, 16 + adds r4, r1 + ldrb r1, [r2, 0x5] + lsls r1, 24 + adds r4, r1 + ldrb r3, [r2, 0x6] + ldrb r1, [r2, 0x7] + lsls r1, 8 + adds r3, r1 + ldrb r1, [r2, 0x8] + lsls r1, 16 + adds r3, r1 + ldrb r1, [r2, 0x9] + lsls r1, 24 + adds r3, r1 + ldr r2, =0x02024084 + movs r1, 0x58 + muls r1, r0 + adds r0, r2, 0 + adds r0, 0x4C + adds r0, r1, r0 + ldr r0, [r0] + ands r0, r4 + cmp r0, 0 + beq _08049F68 + adds r0, r1, r2 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _08049F68 + str r3, [r5] + b _08049F70 + .pool +_08049F68: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0xA + str r0, [r1] +_08049F70: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk1C_jumpifstatus + + thumb_func_start atk1D_jumpifsecondarystatus +atk1D_jumpifsecondarystatus: @ 8049F7C + push {r4,r5,lr} + ldr r5, =0x02024214 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + lsls r0, 24 + lsrs r0, 24 + ldr r2, [r5] + ldrb r4, [r2, 0x2] + ldrb r1, [r2, 0x3] + lsls r1, 8 + adds r4, r1 + ldrb r1, [r2, 0x4] + lsls r1, 16 + adds r4, r1 + ldrb r1, [r2, 0x5] + lsls r1, 24 + adds r4, r1 + ldrb r3, [r2, 0x6] + ldrb r1, [r2, 0x7] + lsls r1, 8 + adds r3, r1 + ldrb r1, [r2, 0x8] + lsls r1, 16 + adds r3, r1 + ldrb r1, [r2, 0x9] + lsls r1, 24 + adds r3, r1 + ldr r2, =0x02024084 + movs r1, 0x58 + muls r1, r0 + adds r0, r2, 0 + adds r0, 0x50 + adds r0, r1, r0 + ldr r0, [r0] + ands r0, r4 + cmp r0, 0 + beq _08049FE0 + adds r0, r1, r2 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _08049FE0 + str r3, [r5] + b _08049FE8 + .pool +_08049FE0: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0xA + str r0, [r1] +_08049FE8: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk1D_jumpifsecondarystatus + + thumb_func_start atk1E_jumpifability +atk1E_jumpifability: @ 8049FF4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + ldr r6, =0x02024214 + ldr r2, [r6] + ldrb r5, [r2, 0x2] + mov r8, r5 + ldrb r1, [r2, 0x3] + ldrb r0, [r2, 0x4] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 24 + adds r7, r1, r0 + ldrb r0, [r2, 0x1] + cmp r0, 0x8 + bne _0804A054 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0xD + adds r2, r5, 0 + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0804A0C8 + ldr r1, =0x0202420a + strb r5, [r1] + str r7, [r6] + subs r4, 0x1 + lsls r0, r4, 24 + lsrs r0, 24 + ldrb r1, [r1] + b _0804A0B0 + .pool +_0804A054: + cmp r0, 0x9 + bne _0804A08C + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0xC + adds r2, r5, 0 + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0804A0C8 + ldr r1, =0x0202420a + strb r5, [r1] + str r7, [r6] + subs r4, 0x1 + lsls r0, r4, 24 + lsrs r0, 24 + ldrb r1, [r1] + b _0804A0B0 + .pool +_0804A08C: + ldrb r0, [r2, 0x1] + bl get_battle_side_of_something + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r4 + adds r0, r1 + adds r0, 0x20 + ldrb r1, [r0] + cmp r1, r8 + bne _0804A0C8 + ldr r0, =0x0202420a + strb r1, [r0] + str r7, [r6] + ldrb r1, [r0] + adds r0, r4, 0 +_0804A0B0: + bl b_history__record_ability_usage_of_player + ldr r0, =0x02024474 + strb r4, [r0, 0x15] + b _0804A0CE + .pool +_0804A0C8: + ldr r0, [r6] + adds r0, 0x7 + str r0, [r6] +_0804A0CE: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end atk1E_jumpifability + + thumb_func_start sub_804A0DC +sub_804A0DC: @ 804A0DC + push {r4-r6,lr} + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r4, [r0, 0x1] + cmp r4, 0x1 + bne _0804A0FC + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_get_per_side_status + b _0804A106 + .pool +_0804A0FC: + ldr r0, =0x0202420c + ldrb r0, [r0] + bl battle_get_per_side_status + movs r4, 0x1 +_0804A106: + ands r4, r0 + ldr r6, =0x02024214 + ldr r3, [r6] + ldrb r2, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r2, r0 + ldrb r1, [r3, 0x4] + ldrb r0, [r3, 0x5] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r3, 0x6] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r3, 0x7] + lsls r0, 24 + adds r5, r1, r0 + ldr r1, =0x0202428e + lsls r0, r4, 1 + adds r0, r1 + ldrh r0, [r0] + ands r2, r0 + cmp r2, 0 + beq _0804A148 + str r5, [r6] + b _0804A14E + .pool +_0804A148: + adds r0, r3, 0 + adds r0, 0x8 + str r0, [r6] +_0804A14E: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_804A0DC + + thumb_func_start sub_804A154 +sub_804A154: @ 804A154 + push {r4,r5,lr} + movs r5, 0 + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02024084 + ldr r3, [r4] + movs r1, 0x58 + muls r0, r1 + ldrb r1, [r3, 0x3] + adds r0, r1 + adds r2, 0x18 + adds r0, r2 + ldrb r2, [r0] + ldrb r0, [r3, 0x2] + cmp r0, 0x5 + bhi _0804A212 + lsls r0, 2 + ldr r1, =_0804A194 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0804A194: + .4byte _0804A1AC + .4byte _0804A1BC + .4byte _0804A1CC + .4byte _0804A1DC + .4byte _0804A1EC + .4byte _0804A200 +_0804A1AC: + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r2, r0 + bne _0804A212 + b _0804A20C + .pool +_0804A1BC: + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r2, r0 + beq _0804A212 + b _0804A20C + .pool +_0804A1CC: + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r2, r0 + bls _0804A212 + b _0804A20C + .pool +_0804A1DC: + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r2, r0 + bcs _0804A212 + b _0804A20C + .pool +_0804A1EC: + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + ands r2, r0 + cmp r2, 0 + beq _0804A212 + b _0804A20C + .pool +_0804A200: + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + ands r2, r0 + cmp r2, 0 + bne _0804A212 +_0804A20C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_0804A212: + cmp r5, 0 + beq _0804A238 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x5] + ldrb r0, [r2, 0x6] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x7] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x8] + lsls r0, 24 + adds r1, r0 + str r1, [r3] + b _0804A240 + .pool +_0804A238: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x9 + str r0, [r1] +_0804A240: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_804A154 + + thumb_func_start atk21_jumpifspecialstatusflag +atk21_jumpifspecialstatusflag: @ 804A24C + push {r4-r6,lr} + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r5, =0x02024064 + strb r0, [r5] + ldr r2, [r4] + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + adds r6, r1, r0 + ldrb r1, [r2, 0x7] + ldrb r0, [r2, 0x8] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x9] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0xA] + lsls r0, 24 + adds r3, r1, r0 + ldrb r0, [r2, 0x6] + cmp r0, 0 + beq _0804A2AC + ldr r0, =0x020242ac + ldrb r1, [r5] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + ands r0, r6 + cmp r0, 0 + bne _0804A2C4 + b _0804A2BC + .pool +_0804A2AC: + ldr r0, =0x020242ac + ldrb r1, [r5] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + ands r0, r6 + cmp r0, 0 + beq _0804A2C4 +_0804A2BC: + str r3, [r4] + b _0804A2CA + .pool +_0804A2C4: + adds r0, r2, 0 + adds r0, 0xB + str r0, [r4] +_0804A2CA: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end atk21_jumpifspecialstatusflag + + thumb_func_start sub_804A2D0 +sub_804A2D0: @ 804A2D0 + push {r4-r6,lr} + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + lsls r0, 24 + lsrs r0, 24 + ldr r3, [r4] + ldrb r5, [r3, 0x2] + ldrb r2, [r3, 0x3] + ldrb r1, [r3, 0x4] + lsls r1, 8 + adds r2, r1 + ldrb r1, [r3, 0x5] + lsls r1, 16 + adds r2, r1 + ldrb r1, [r3, 0x6] + lsls r1, 24 + adds r6, r2, r1 + ldr r2, =0x02024084 + movs r1, 0x58 + muls r0, r1 + adds r1, r0, r2 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, r5 + beq _0804A314 + adds r0, r1, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, r5 + bne _0804A320 +_0804A314: + str r6, [r4] + b _0804A324 + .pool +_0804A320: + adds r0, r3, 0x7 + str r0, [r4] +_0804A324: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_804A2D0 + + thumb_func_start sub_804A32C +sub_804A32C: @ 804A32C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r6, 0 + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x50 + mov r9, r0 + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r1, =0x0202420d + strb r0, [r1] + ldr r2, =0x020243fe + movs r1, 0x2 + ands r1, r0 + lsls r1, 24 + lsrs r1, 25 + adds r1, r2 + ldrb r1, [r1] + mov r8, r1 + ldr r0, =0x02024474 + ldrb r0, [r0, 0x1C] + cmp r0, 0x6 + bls _0804A368 + bl _0804ACB2 +_0804A368: + lsls r0, 2 + ldr r1, =_0804A38C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0804A38C: + .4byte _0804A3A8 + .4byte _0804A414 + .4byte _0804A52E + .4byte _0804A850 + .4byte _0804A954 + .4byte _0804AC40 + .4byte _0804AC88 +_0804A3A8: + ldr r4, =0x0202420d + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0804A3BC + bl _0804AC7C +_0804A3BC: + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x063f0982 + ands r0, r1 + cmp r0, 0 + beq _0804A3CC + bl _0804AC7C +_0804A3CC: + ldr r1, =0x02024474 + ldrb r0, [r1, 0x1C] + adds r0, 0x1 + strb r0, [r1, 0x1C] + ldr r0, =0x0202449c + ldr r2, [r0] + adds r2, 0xDF + ldr r3, =gUnknown_0832A328 + ldr r1, =0x0202406e + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + bl _0804ACB2 + .pool +_0804A414: + movs r5, 0 + movs r7, 0 +_0804A418: + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _0804A486 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _0804A486 + ldr r0, =gUnknown_0832A328 + lsls r1, r7, 2 + adds r1, r0 + ldr r0, [r1] + mov r1, r8 + ands r0, r1 + cmp r0, 0 + beq _0804A44C + adds r5, 0x1 +_0804A44C: + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xAF + bne _0804A478 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x00003226 + adds r0, r2 + ldrb r4, [r0] + b _0804A480 + .pool +_0804A478: + bl itemid_get_x12 + lsls r0, 24 + lsrs r4, r0, 24 +_0804A480: + cmp r4, 0x19 + bne _0804A486 + adds r6, 0x1 +_0804A486: + adds r7, 0x1 + cmp r7, 0x5 + ble _0804A418 + ldr r3, =gBaseStats + ldr r2, =0x02024084 + ldr r0, =0x0202420d + ldrb r1, [r0] + movs r0, 0x58 + muls r1, r0 + adds r1, r2 + ldrh r2, [r1] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r3 + ldrb r2, [r0, 0x9] + adds r1, 0x2A + ldrb r0, [r1] + muls r0, r2 + movs r1, 0x7 + bl __divsi3 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r6, 0 + beq _0804A4FC + lsrs r4, r0, 17 + adds r0, r4, 0 + adds r1, r5, 0 + bl __divsi3 + mov r1, r9 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + bne _0804A4D2 + movs r0, 0x1 + strh r0, [r1] +_0804A4D2: + ldr r5, =0x02024402 + adds r0, r4, 0 + adds r1, r6, 0 + bl __divsi3 + strh r0, [r5] + lsls r0, 16 + cmp r0, 0 + bne _0804A516 + movs r0, 0x1 + strh r0, [r5] + b _0804A516 + .pool +_0804A4FC: + adds r0, r1, 0 + adds r1, r5, 0 + bl __divsi3 + mov r2, r9 + strh r0, [r2] + lsls r0, 16 + cmp r0, 0 + bne _0804A512 + movs r0, 0x1 + strh r0, [r2] +_0804A512: + ldr r0, =0x02024402 + strh r6, [r0] +_0804A516: + ldr r1, =0x02024474 + ldrb r0, [r1, 0x1C] + adds r0, 0x1 + movs r2, 0 + strb r0, [r1, 0x1C] + ldr r1, =0x0202449c + ldr r0, [r1] + strb r2, [r0, 0x10] + ldr r0, [r1] + adds r0, 0x53 + mov r4, r8 + strb r4, [r0] +_0804A52E: + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + beq _0804A538 + b _0804ACB2 +_0804A538: + ldr r0, =0x0202449c + ldr r0, [r0] + ldrb r1, [r0, 0x10] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xAF + bne _0804A57C + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003226 + adds r0, r1 + ldrb r4, [r0] + b _0804A584 + .pool +_0804A57C: + bl itemid_get_x12 + lsls r0, 24 + lsrs r4, r0, 24 +_0804A584: + ldr r5, =0x0202449c + cmp r4, 0x19 + beq _0804A5AC + ldr r0, [r5] + adds r1, r0, 0 + adds r1, 0x53 + ldrb r0, [r1] + movs r2, 0x1 + ands r2, r0 + cmp r2, 0 + bne _0804A5AC + lsrs r0, 1 + strb r0, [r1] + ldr r1, =0x02024474 + b _0804A5D0 + .pool +_0804A5AC: + ldr r0, [r5] + ldrb r1, [r0, 0x10] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x38 + bl pokemon_getattr + cmp r0, 0x64 + bne _0804A5E8 + ldr r1, [r5] + adds r1, 0x53 + ldrb r0, [r1] + lsrs r0, 1 + strb r0, [r1] + ldr r1, =0x02024474 + movs r2, 0 +_0804A5D0: + movs r0, 0x5 + strb r0, [r1, 0x1C] + ldr r0, =0x020241f0 + str r2, [r0] + b _0804ACB2 + .pool +_0804A5E8: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + bne _0804A616 + ldr r0, =0x02024084 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _0804A616 + ldr r0, [r5] + ldrb r0, [r0, 0x12] + cmp r0, 0 + bne _0804A616 + bl sub_805EA60 + ldr r0, =0x00000161 + bl song_play_for_text + ldr r1, [r5] + ldrb r0, [r1, 0x12] + adds r0, 0x1 + strb r0, [r1, 0x12] +_0804A616: + ldr r5, =0x0202449c + ldr r0, [r5] + ldrb r1, [r0, 0x10] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + bne _0804A630 + b _0804A824 +_0804A630: + ldr r0, [r5] + adds r0, 0x53 + ldrb r0, [r0] + movs r3, 0x1 + ands r3, r0 + cmp r3, 0 + beq _0804A664 + ldr r1, =0x020241f0 + mov r2, r9 + ldrh r0, [r2] + str r0, [r1] + mov r9, r1 + b _0804A66A + .pool +_0804A664: + ldr r0, =0x020241f0 + str r3, [r0] + mov r9, r0 +_0804A66A: + cmp r4, 0x19 + bne _0804A67A + ldr r0, =0x02024402 + ldrh r1, [r0] + mov r2, r9 + ldr r0, [r2] + adds r0, r1 + str r0, [r2] +_0804A67A: + cmp r4, 0x28 + bne _0804A68E + mov r4, r9 + ldr r1, [r4] + movs r0, 0x96 + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + str r0, [r4] +_0804A68E: + ldr r5, =0x02022fec + ldr r0, [r5] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0804A6AA + ldr r4, =0x020241f0 + ldr r1, [r4] + movs r0, 0x96 + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + str r0, [r4] +_0804A6AA: + ldr r4, =0x0202449c + ldr r0, [r4] + ldrb r1, [r0, 0x10] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + bl sub_806E8A8 + lsls r0, 24 + cmp r0, 0 + beq _0804A714 + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _0804A6F8 + ldr r0, [r4] + ldrb r0, [r0, 0x10] + cmp r0, 0x2 + bls _0804A6F8 + ldr r7, =0x00000149 + ldr r0, =0x020241f0 + mov r9, r0 + b _0804A71A + .pool +_0804A6F8: + ldr r4, =0x020241f0 + ldr r1, [r4] + movs r0, 0x96 + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + str r0, [r4] + movs r7, 0xA5 + lsls r7, 1 + mov r9, r4 + b _0804A71A + .pool +_0804A714: + ldr r7, =0x00000149 + ldr r1, =0x020241f0 + mov r9, r1 +_0804A71A: + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0804A786 + ldr r0, =0x0202406e + ldr r1, =0x0202449c + ldr r4, [r1] + ldrh r0, [r0, 0x4] + adds r5, r1, 0 + ldr r3, =gUnknown_0832A328 + ldr r2, =0x02024210 + ldrb r1, [r4, 0x10] + cmp r0, r1 + bne _0804A76C + ldrb r1, [r2] + ldr r0, [r3, 0x8] + ands r1, r0 + cmp r1, 0 + bne _0804A76C + adds r1, r4, 0 + adds r1, 0x8F + movs r0, 0x2 + strb r0, [r1] + b _0804A78E + .pool +_0804A76C: + ldrb r2, [r2] + ldr r0, [r3] + ands r2, r0 + cmp r2, 0 + bne _0804A77E + ldr r0, [r5] + adds r0, 0x8F + strb r2, [r0] + b _0804A78E +_0804A77E: + ldr r0, [r5] + adds r0, 0x8F + movs r1, 0x2 + b _0804A78C +_0804A786: + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x8F +_0804A78C: + strb r1, [r0] +_0804A78E: + ldr r1, =0x02022f58 + movs r2, 0 + mov r12, r2 + movs r3, 0xFD + strb r3, [r1] + movs r5, 0x4 + strb r5, [r1, 0x1] + ldr r6, =0x0202449c + ldr r2, [r6] + movs r4, 0x8F + adds r4, r2 + mov r8, r4 + ldrb r0, [r4] + strb r0, [r1, 0x2] + ldrb r0, [r2, 0x10] + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r1, =0x02022f68 + strb r3, [r1] + mov r0, r12 + strb r0, [r1, 0x1] + strb r7, [r1, 0x2] + movs r4, 0xFF + lsls r4, 8 + ands r7, r4 + asrs r0, r7, 8 + strb r0, [r1, 0x3] + movs r0, 0x1 + negs r0, r0 + strb r0, [r1, 0x4] + ldr r1, =0x02022f78 + strb r3, [r1] + movs r0, 0x1 + strb r0, [r1, 0x1] + strb r5, [r1, 0x2] + movs r0, 0x5 + strb r0, [r1, 0x3] + mov r0, r9 + ldr r2, [r0] + strb r2, [r1, 0x4] + adds r0, r2, 0 + ands r0, r4 + asrs r0, 8 + strb r0, [r1, 0x5] + movs r0, 0xFF + lsls r0, 16 + ands r0, r2 + asrs r0, 16 + strb r0, [r1, 0x6] + lsrs r2, 24 + strb r2, [r1, 0x7] + movs r0, 0x1 + negs r0, r0 + strb r0, [r1, 0x8] + mov r2, r8 + ldrb r1, [r2] + movs r0, 0xD + bl b_std_message + ldr r0, [r6] + ldrb r1, [r0, 0x10] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldr r3, =0x02024084 + ldr r1, =0x0202420d + ldrb r2, [r1] + movs r1, 0x58 + muls r1, r2 + adds r1, r3 + ldrh r1, [r1] + bl sub_806DADC +_0804A824: + ldr r0, =0x0202449c + ldr r1, [r0] + adds r1, 0x53 + ldrb r0, [r1] + lsrs r0, 1 + strb r0, [r1] + b _0804A92A + .pool +_0804A850: + ldr r0, =0x02024068 + ldr r2, [r0] + cmp r2, 0 + beq _0804A85A + b _0804ACB2 +_0804A85A: + ldr r1, =0x02023864 + ldr r7, =0x0202449c + ldr r0, [r7] + adds r0, 0x8F + ldrb r0, [r0] + lsls r0, 9 + adds r0, r1 + strb r2, [r0] + ldr r0, [r7] + ldrb r0, [r0, 0x10] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x020244ec + adds r0, r5 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _0804A92A + ldr r0, [r7] + ldrb r0, [r0, 0x10] + muls r0, r6 + adds r0, r5 + movs r1, 0x38 + bl pokemon_getattr + cmp r0, 0x64 + beq _0804A92A + ldr r0, [r7] + ldrb r0, [r0, 0x10] + muls r0, r6 + adds r0, r5 + movs r1, 0x3A + bl pokemon_getattr + ldr r4, =0x020244a8 + ldr r1, [r4] + ldr r1, [r1, 0x10] + strh r0, [r1] + ldr r0, [r7] + ldrb r0, [r0, 0x10] + muls r0, r6 + adds r0, r5 + movs r1, 0x3B + bl pokemon_getattr + ldr r1, [r4] + ldr r1, [r1, 0x10] + strh r0, [r1, 0x2] + ldr r0, [r7] + ldrb r0, [r0, 0x10] + muls r0, r6 + adds r0, r5 + movs r1, 0x3C + bl pokemon_getattr + ldr r1, [r4] + ldr r1, [r1, 0x10] + strh r0, [r1, 0x4] + ldr r0, [r7] + ldrb r0, [r0, 0x10] + muls r0, r6 + adds r0, r5 + movs r1, 0x3D + bl pokemon_getattr + ldr r1, [r4] + ldr r1, [r1, 0x10] + strh r0, [r1, 0x6] + ldr r0, [r7] + ldrb r0, [r0, 0x10] + muls r0, r6 + adds r0, r5 + movs r1, 0x3E + bl pokemon_getattr + ldr r1, [r4] + ldr r1, [r1, 0x10] + strh r0, [r1, 0x8] + ldr r0, [r7] + ldrb r0, [r0, 0x10] + muls r0, r6 + adds r0, r5 + movs r1, 0x3F + bl pokemon_getattr + ldr r1, [r4] + ldr r1, [r1, 0x10] + strh r0, [r1, 0xA] + ldr r4, =0x02024064 + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0x8F + ldrb r0, [r0] + strb r0, [r4] + ldrb r1, [r1, 0x10] + ldr r0, =0x020241f0 + ldrh r2, [r0] + movs r0, 0 + bl dp01_build_cmdbuf_x19_a_bb + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0804A92A: + ldr r1, =0x02024474 + ldrb r0, [r1, 0x1C] + adds r0, 0x1 + strb r0, [r1, 0x1C] + b _0804ACB2 + .pool +_0804A954: + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + beq _0804A95E + b _0804ACB2 +_0804A95E: + ldr r1, =0x02024064 + ldr r0, =0x0202449c + ldr r4, [r0] + adds r0, r4, 0 + adds r0, 0x8F + ldrb r0, [r0] + strb r0, [r1] + ldr r3, =0x02023864 + ldrb r2, [r1] + lsls r1, r2, 9 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0x21 + beq _0804A97C + b _0804AC28 +_0804A97C: + adds r0, r3, 0x1 + adds r0, r1, r0 + ldrb r0, [r0] + cmp r0, 0xB + beq _0804A988 + b _0804AC28 +_0804A988: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0804A9B2 + ldr r0, =0x0202406e + lsls r1, r2, 1 + adds r1, r0 + ldrh r0, [r1] + ldrb r4, [r4, 0x10] + cmp r0, r4 + bne _0804A9B2 + adds r1, r0, 0 + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + adds r1, r2, 0 + bl sub_805E990 +_0804A9B2: + ldr r1, =0x02022f58 + movs r3, 0xFD + strb r3, [r1] + movs r0, 0x4 + strb r0, [r1, 0x1] + ldr r6, =0x02024064 + ldrb r0, [r6] + strb r0, [r1, 0x2] + ldr r4, =0x0202449c + mov r9, r4 + ldr r2, [r4] + ldrb r0, [r2, 0x10] + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r4, =0x02022f68 + strb r3, [r4] + movs r0, 0x1 + strb r0, [r4, 0x1] + strb r0, [r4, 0x2] + movs r0, 0x3 + strb r0, [r4, 0x3] + ldrb r0, [r2, 0x10] + movs r1, 0x64 + mov r8, r1 + mov r2, r8 + muls r2, r0 + adds r0, r2, 0 + ldr r7, =0x020244ec + adds r0, r7 + movs r1, 0x38 + bl pokemon_getattr + strb r0, [r4, 0x4] + movs r0, 0x1 + negs r0, r0 + strb r0, [r4, 0x5] + bl b_movescr_stack_push_cursor + ldr r2, =0x03005d54 + ldr r1, =gUnknown_0832A328 + mov r4, r9 + ldr r5, [r4] + ldrb r0, [r5, 0x10] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DABBD + str r0, [r1] + ldr r4, =0x020241f0 + ldr r2, =0x02023864 + ldrb r1, [r6] + lsls r1, 9 + adds r0, r2, 0x2 + adds r0, r1, r0 + ldrb r3, [r0] + adds r2, 0x3 + adds r1, r2 + ldrb r0, [r1] + lsls r0, 8 + orrs r3, r0 + str r3, [r4] + ldrb r0, [r5, 0x10] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r7 + movs r1, 0 + bl happiness_algorithm + ldr r1, =0x0202406e + mov r2, r9 + ldr r0, [r2] + ldrb r2, [r0, 0x10] + ldrh r0, [r1] + cmp r0, r2 + bne _0804AB1E + ldr r4, =0x02024084 + ldrh r0, [r4, 0x28] + cmp r0, 0 + beq _0804AB1E + mov r0, r8 + muls r0, r2 + adds r0, r7 + movs r1, 0x38 + bl pokemon_getattr + adds r1, r4, 0 + adds r1, 0x2A + strb r0, [r1] + mov r1, r9 + ldr r0, [r1] + ldrb r0, [r0, 0x10] + mov r2, r8 + muls r2, r0 + adds r0, r2, 0 + adds r0, r7 + movs r1, 0x39 + bl pokemon_getattr + strh r0, [r4, 0x28] + mov r1, r9 + ldr r0, [r1] + ldrb r0, [r0, 0x10] + mov r2, r8 + muls r2, r0 + adds r0, r2, 0 + adds r0, r7 + movs r1, 0x3A + bl pokemon_getattr + strh r0, [r4, 0x2C] + mov r1, r9 + ldr r0, [r1] + ldrb r0, [r0, 0x10] + mov r2, r8 + muls r2, r0 + adds r0, r2, 0 + adds r0, r7 + movs r1, 0x3B + bl pokemon_getattr + strh r0, [r4, 0x2] + mov r1, r9 + ldr r0, [r1] + ldrb r0, [r0, 0x10] + mov r2, r8 + muls r2, r0 + adds r0, r2, 0 + adds r0, r7 + movs r1, 0x3C + bl pokemon_getattr + strh r0, [r4, 0x4] + mov r1, r9 + ldr r0, [r1] + ldrb r0, [r0, 0x10] + mov r2, r8 + muls r2, r0 + adds r0, r2, 0 + adds r0, r7 + movs r1, 0x3D + bl pokemon_getattr + strh r0, [r4, 0x6] + mov r1, r9 + ldr r0, [r1] + ldrb r0, [r0, 0x10] + mov r2, r8 + muls r2, r0 + adds r0, r2, 0 + adds r0, r7 + movs r1, 0x3D + bl pokemon_getattr + strh r0, [r4, 0x6] + mov r1, r9 + ldr r0, [r1] + ldrb r0, [r0, 0x10] + mov r2, r8 + muls r2, r0 + adds r0, r2, 0 + adds r0, r7 + movs r1, 0x3E + bl pokemon_getattr + strh r0, [r4, 0x8] + mov r1, r9 + ldr r0, [r1] + ldrb r0, [r0, 0x10] + mov r2, r8 + muls r2, r0 + adds r0, r2, 0 + adds r0, r7 + movs r1, 0x3F + bl pokemon_getattr + strh r0, [r4, 0xA] +_0804AB1E: + ldr r0, =0x0202406e + ldr r7, =0x0202449c + ldr r1, [r7] + ldrb r2, [r1, 0x10] + ldrh r0, [r0, 0x4] + cmp r0, r2 + beq _0804AB2E + b _0804AC2E +_0804AB2E: + ldr r6, =0x02024084 + movs r4, 0xD8 + adds r4, r6 + mov r8, r4 + ldrh r0, [r4] + cmp r0, 0 + beq _0804AC2E + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0804AC2E + movs r5, 0x64 + adds r0, r2, 0 + muls r0, r5 + ldr r4, =0x020244ec + adds r0, r4 + movs r1, 0x38 + bl pokemon_getattr + adds r1, r6, 0 + adds r1, 0xDA + strb r0, [r1] + ldr r0, [r7] + ldrb r0, [r0, 0x10] + muls r0, r5 + adds r0, r4 + movs r1, 0x39 + bl pokemon_getattr + mov r1, r8 + strh r0, [r1] + ldr r0, [r7] + ldrb r0, [r0, 0x10] + muls r0, r5 + adds r0, r4 + movs r1, 0x3A + bl pokemon_getattr + adds r1, r6, 0 + adds r1, 0xDC + strh r0, [r1] + ldr r0, [r7] + ldrb r0, [r0, 0x10] + muls r0, r5 + adds r0, r4 + movs r1, 0x3B + bl pokemon_getattr + adds r1, r6, 0 + adds r1, 0xB2 + strh r0, [r1] + ldr r0, [r7] + ldrb r0, [r0, 0x10] + muls r0, r5 + adds r0, r4 + movs r1, 0x3C + bl pokemon_getattr + adds r1, r6, 0 + adds r1, 0xB4 + strh r0, [r1] + ldr r0, [r7] + ldrb r0, [r0, 0x10] + muls r0, r5 + adds r0, r4 + movs r1, 0x3D + bl pokemon_getattr + movs r2, 0xB6 + adds r2, r6 + mov r8, r2 + strh r0, [r2] + ldr r0, [r7] + ldrb r0, [r0, 0x10] + muls r0, r5 + adds r0, r4 + movs r1, 0x3D + bl pokemon_getattr + mov r1, r8 + strh r0, [r1] + ldr r0, [r7] + ldrb r0, [r0, 0x10] + muls r0, r5 + adds r0, r4 + movs r1, 0x3E + bl pokemon_getattr + adds r1, r6, 0 + adds r1, 0xB8 + strh r0, [r1] + b _0804AC2E + .pool +_0804AC28: + ldr r1, =0x020241f0 + movs r0, 0 + str r0, [r1] +_0804AC2E: + ldr r1, =0x02024474 + movs r0, 0x5 + strb r0, [r1, 0x1C] + b _0804ACB2 + .pool +_0804AC40: + ldr r0, =0x020241f0 + ldr r0, [r0] + cmp r0, 0 + beq _0804AC58 + ldr r1, =0x02024474 + movs r0, 0x3 + strb r0, [r1, 0x1C] + b _0804ACB2 + .pool +_0804AC58: + ldr r2, =0x0202449c + ldr r1, [r2] + ldrb r0, [r1, 0x10] + adds r0, 0x1 + strb r0, [r1, 0x10] + ldr r0, [r2] + ldrb r0, [r0, 0x10] + cmp r0, 0x5 + bhi _0804AC7C + ldr r1, =0x02024474 + movs r0, 0x2 + strb r0, [r1, 0x1C] + b _0804ACB2 + .pool +_0804AC7C: + ldr r1, =0x02024474 + movs r0, 0x6 + strb r0, [r1, 0x1C] + b _0804ACB2 + .pool +_0804AC88: + ldr r0, =0x02024068 + ldr r5, [r0] + cmp r5, 0 + bne _0804ACB2 + ldr r4, =0x02024084 + ldr r2, =0x0202420d + ldrb r0, [r2] + movs r1, 0x58 + muls r0, r1 + adds r0, r4 + movs r3, 0 + strh r5, [r0, 0x2E] + ldrb r0, [r2] + muls r0, r1 + adds r0, r4 + adds r0, 0x20 + strb r3, [r0] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] +_0804ACB2: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_804A32C + + thumb_func_start sub_804ACD0 +sub_804ACD0: @ 804ACD0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r6, 0 + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + beq _0804ACE2 + b _0804AF22 +_0804ACE2: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _0804AD48 + ldr r0, =0x02038bce + ldrh r1, [r0] + ldr r0, =0x00000c03 + cmp r1, r0 + bne _0804AD48 + movs r5, 0 +_0804ACFC: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _0804AD2C + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _0804AD2C + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + adds r0, r6, r0 + lsls r0, 16 + lsrs r6, r0, 16 +_0804AD2C: + adds r5, 0x1 + cmp r5, 0x2 + ble _0804ACFC + b _0804ADA8 + .pool +_0804AD48: + movs r5, 0 +_0804AD4A: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _0804ADA2 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _0804ADA2 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _0804AD94 + ldr r0, =0x0202449c + ldr r0, [r0] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + lsls r0, r5, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0804ADA2 +_0804AD94: + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + adds r0, r6, r0 + lsls r0, 16 + lsrs r6, r0, 16 +_0804ADA2: + adds r5, 0x1 + cmp r5, 0x5 + ble _0804AD4A +_0804ADA8: + cmp r6, 0 + bne _0804ADB6 + ldr r0, =0x0202433a + ldrb r1, [r0] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r0] +_0804ADB6: + movs r6, 0 + movs r5, 0 +_0804ADBA: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x02024744 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _0804AE10 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _0804AE10 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _0804AE02 + ldr r0, =0x0202449c + ldr r0, [r0] + ldr r1, =0x000002a1 + adds r0, r1 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + lsls r0, r5, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0804AE10 +_0804AE02: + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + adds r0, r6, r0 + lsls r0, 16 + lsrs r6, r0, 16 +_0804AE10: + adds r5, 0x1 + cmp r5, 0x5 + ble _0804ADBA + ldr r2, =0x0202433a + cmp r6, 0 + bne _0804AE24 + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] +_0804AE24: + ldrb r0, [r2] + cmp r0, 0 + bne _0804AF1A + ldr r0, =0x02022fec + ldr r1, [r0] + ldr r2, =0x02000002 + ands r1, r2 + mov r8, r0 + cmp r1, 0 + beq _0804AF1A + movs r3, 0 + movs r5, 0 + ldr r0, =0x0202406c + ldrb r1, [r0] + mov r12, r0 + ldr r7, =0x02024214 + cmp r3, r1 + bge _0804AE70 + ldr r0, =0x02024280 + movs r6, 0x80 + lsls r6, 21 + ldr r4, [r0] + adds r2, r1, 0 + ldr r1, =0x0202437c +_0804AE54: + adds r0, r6, 0 + lsls r0, r5 + ands r0, r4 + cmp r0, 0 + beq _0804AE68 + ldrb r0, [r1] + lsls r0, 25 + cmp r0, 0 + blt _0804AE68 + adds r3, 0x1 +_0804AE68: + adds r1, 0x28 + adds r5, 0x2 + cmp r5, r2 + blt _0804AE54 +_0804AE70: + movs r2, 0 + movs r5, 0x1 + mov r4, r12 + ldrb r1, [r4] + cmp r5, r1 + bge _0804AEAA + ldr r0, =0x02024280 + movs r4, 0x80 + lsls r4, 21 + mov r12, r4 + ldr r6, [r0] + ldr r0, =0x0202437c + adds r4, r1, 0 + adds r1, r0, 0 + adds r1, 0x14 +_0804AE8E: + mov r0, r12 + lsls r0, r5 + ands r0, r6 + cmp r0, 0 + beq _0804AEA2 + ldrb r0, [r1] + lsls r0, 25 + cmp r0, 0 + blt _0804AEA2 + adds r2, 0x1 +_0804AEA2: + adds r1, 0x28 + adds r5, 0x2 + cmp r5, r4 + blt _0804AE8E +_0804AEAA: + mov r1, r8 + ldr r0, [r1] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0804AEF0 + adds r0, r2, r3 + cmp r0, 0x1 + bgt _0804AEF8 + b _0804AF12 + .pool +_0804AEF0: + cmp r2, 0 + beq _0804AF12 + cmp r3, 0 + beq _0804AF12 +_0804AEF8: + ldr r2, [r7] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + adds r1, r0 + str r1, [r7] + b _0804AF22 +_0804AF12: + ldr r0, [r7] + adds r0, 0x5 + str r0, [r7] + b _0804AF22 +_0804AF1A: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_0804AF22: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_804ACD0 + + thumb_func_start sub_804AF30 +sub_804AF30: @ 804AF30 + ldr r1, =0x0202427c + movs r0, 0 + strb r0, [r1] + ldr r0, =0x02024474 + movs r2, 0 + movs r1, 0x1 + strb r1, [r0, 0xE] + ldr r0, =0x02024211 + strb r1, [r0] + ldr r0, =0x02024332 + strb r2, [r0, 0x3] + strb r2, [r0, 0x6] + ldr r2, =0x02024280 + ldr r0, [r2] + subs r1, 0x42 + ands r0, r1 + ldr r1, =0xffffbfff + ands r0, r1 + str r0, [r2] + bx lr + .pool + thumb_func_end sub_804AF30 + + thumb_func_start atk25_cmd25 +atk25_cmd25: @ 804AF70 + push {lr} + bl sub_804AF30 + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end atk25_cmd25 + + thumb_func_start atk26_80225F0_storebyteforjump +atk26_80225F0_storebyteforjump: @ 804AF88 + ldr r3, =0x02024212 + ldr r2, =0x02024214 + ldr r0, [r2] + ldrb r1, [r0, 0x1] + strb r1, [r3] + adds r0, 0x2 + str r0, [r2] + bx lr + .pool + thumb_func_end atk26_80225F0_storebyteforjump + + thumb_func_start atk27_cmd27 +atk27_cmd27: @ 804AFA0 + push {lr} + ldr r1, =0x02024212 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + bne _0804AFC4 + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _0804AFDE + .pool +_0804AFC4: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + adds r1, r0 + str r1, [r3] +_0804AFDE: + pop {r0} + bx r0 + .pool + thumb_func_end atk27_cmd27 + + thumb_func_start atk28_goto +atk28_goto: @ 804AFE8 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + adds r1, r0 + str r1, [r3] + bx lr + .pool + thumb_func_end atk28_goto + + thumb_func_start atk29_jumpifbyte +atk29_jumpifbyte: @ 804B008 + push {r4-r6,lr} + ldr r3, =0x02024214 + ldr r1, [r3] + ldrb r6, [r1, 0x1] + ldrb r2, [r1, 0x2] + ldrb r0, [r1, 0x3] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r1, 0x4] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r1, 0x5] + lsls r0, 24 + adds r5, r2, r0 + ldrb r4, [r1, 0x6] + ldrb r2, [r1, 0x7] + ldrb r0, [r1, 0x8] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r1, 0x9] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r1, 0xA] + lsls r0, 24 + adds r2, r0 + adds r1, 0xB + str r1, [r3] + cmp r6, 0x5 + bhi _0804B0A0 + lsls r0, r6, 2 + ldr r1, =_0804B054 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0804B054: + .4byte _0804B06C + .4byte _0804B074 + .4byte _0804B07C + .4byte _0804B084 + .4byte _0804B08C + .4byte _0804B096 +_0804B06C: + ldrb r0, [r5] + cmp r0, r4 + bne _0804B0A0 + b _0804B09E +_0804B074: + ldrb r0, [r5] + cmp r0, r4 + beq _0804B0A0 + b _0804B09E +_0804B07C: + ldrb r0, [r5] + cmp r0, r4 + bls _0804B0A0 + b _0804B09E +_0804B084: + ldrb r0, [r5] + cmp r0, r4 + bcs _0804B0A0 + b _0804B09E +_0804B08C: + ldrb r0, [r5] + ands r4, r0 + cmp r4, 0 + beq _0804B0A0 + b _0804B09E +_0804B096: + ldrb r0, [r5] + ands r4, r0 + cmp r4, 0 + bne _0804B0A0 +_0804B09E: + str r2, [r3] +_0804B0A0: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end atk29_jumpifbyte + + thumb_func_start sub_804B0A8 +sub_804B0A8: @ 804B0A8 + push {r4-r6,lr} + ldr r3, =0x02024214 + ldr r1, [r3] + ldrb r6, [r1, 0x1] + ldrb r2, [r1, 0x2] + ldrb r0, [r1, 0x3] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r1, 0x4] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r1, 0x5] + lsls r0, 24 + adds r5, r2, r0 + ldrb r4, [r1, 0x6] + ldrb r0, [r1, 0x7] + lsls r0, 8 + orrs r4, r0 + ldrb r2, [r1, 0x8] + ldrb r0, [r1, 0x9] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r1, 0xA] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r1, 0xB] + lsls r0, 24 + adds r2, r0 + adds r1, 0xC + str r1, [r3] + cmp r6, 0x5 + bhi _0804B148 + lsls r0, r6, 2 + ldr r1, =_0804B0FC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0804B0FC: + .4byte _0804B114 + .4byte _0804B11C + .4byte _0804B124 + .4byte _0804B12C + .4byte _0804B134 + .4byte _0804B13E +_0804B114: + ldrh r0, [r5] + cmp r0, r4 + bne _0804B148 + b _0804B146 +_0804B11C: + ldrh r0, [r5] + cmp r0, r4 + beq _0804B148 + b _0804B146 +_0804B124: + ldrh r0, [r5] + cmp r0, r4 + bls _0804B148 + b _0804B146 +_0804B12C: + ldrh r0, [r5] + cmp r0, r4 + bcs _0804B148 + b _0804B146 +_0804B134: + ldrh r0, [r5] + ands r4, r0 + cmp r4, 0 + beq _0804B148 + b _0804B146 +_0804B13E: + ldrh r0, [r5] + ands r4, r0 + cmp r4, 0 + bne _0804B148 +_0804B146: + str r2, [r3] +_0804B148: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_804B0A8 + + thumb_func_start sub_804B150 +sub_804B150: @ 804B150 + push {r4-r6,lr} + ldr r3, =0x02024214 + ldr r1, [r3] + ldrb r6, [r1, 0x1] + ldrb r2, [r1, 0x2] + ldrb r0, [r1, 0x3] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r1, 0x4] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r1, 0x5] + lsls r0, 24 + adds r5, r2, r0 + ldrb r4, [r1, 0x6] + ldrb r0, [r1, 0x7] + lsls r0, 8 + orrs r4, r0 + ldrb r0, [r1, 0x8] + lsls r0, 16 + orrs r4, r0 + ldrb r0, [r1, 0x9] + lsls r0, 24 + orrs r4, r0 + ldrb r2, [r1, 0xA] + ldrb r0, [r1, 0xB] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r1, 0xC] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r1, 0xD] + lsls r0, 24 + adds r2, r0 + adds r1, 0xE + str r1, [r3] + cmp r6, 0x5 + bhi _0804B1FC + lsls r0, r6, 2 + ldr r1, =_0804B1B0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0804B1B0: + .4byte _0804B1C8 + .4byte _0804B1D0 + .4byte _0804B1D8 + .4byte _0804B1E0 + .4byte _0804B1E8 + .4byte _0804B1F2 +_0804B1C8: + ldr r0, [r5] + cmp r0, r4 + bne _0804B1FC + b _0804B1FA +_0804B1D0: + ldr r0, [r5] + cmp r0, r4 + beq _0804B1FC + b _0804B1FA +_0804B1D8: + ldr r0, [r5] + cmp r0, r4 + bls _0804B1FC + b _0804B1FA +_0804B1E0: + ldr r0, [r5] + cmp r0, r4 + bcs _0804B1FC + b _0804B1FA +_0804B1E8: + ldr r0, [r5] + ands r0, r4 + cmp r0, 0 + beq _0804B1FC + b _0804B1FA +_0804B1F2: + ldr r0, [r5] + ands r0, r4 + cmp r0, 0 + bne _0804B1FC +_0804B1FA: + str r2, [r3] +_0804B1FC: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_804B150 + + thumb_func_start sub_804B204 +sub_804B204: @ 804B204 + push {r4-r7,lr} + ldr r2, =0x02024214 + ldr r3, [r2] + ldrb r1, [r3, 0x1] + ldrb r0, [r3, 0x2] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r3, 0x3] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 24 + adds r5, r1, r0 + ldrb r1, [r3, 0x5] + ldrb r0, [r3, 0x6] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r3, 0x7] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r3, 0x8] + lsls r0, 24 + adds r4, r1, r0 + ldrb r6, [r3, 0x9] + ldrb r1, [r3, 0xA] + ldrb r0, [r3, 0xB] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r3, 0xC] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r3, 0xD] + lsls r0, 24 + adds r1, r0 + mov r12, r1 + movs r1, 0 + cmp r1, r6 + bcs _0804B27C + ldrb r0, [r5] + ldrb r7, [r4] + cmp r0, r7 + beq _0804B260 + adds r0, r3, 0 + b _0804B278 + .pool +_0804B260: + adds r5, 0x1 + adds r4, 0x1 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, r6 + bcs _0804B27C + ldrb r0, [r5] + ldrb r3, [r4] + cmp r0, r3 + beq _0804B260 + ldr r0, [r2] +_0804B278: + adds r0, 0xE + str r0, [r2] +_0804B27C: + cmp r1, r6 + bne _0804B284 + mov r7, r12 + str r7, [r2] +_0804B284: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_804B204 + + thumb_func_start sub_804B28C +sub_804B28C: @ 804B28C + push {r4-r7,lr} + movs r7, 0 + ldr r3, =0x02024214 + ldr r1, [r3] + ldrb r2, [r1, 0x1] + ldrb r0, [r1, 0x2] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r1, 0x3] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r1, 0x4] + lsls r0, 24 + adds r5, r2, r0 + ldrb r2, [r1, 0x5] + ldrb r0, [r1, 0x6] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r1, 0x7] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r1, 0x8] + lsls r0, 24 + adds r4, r2, r0 + ldrb r6, [r1, 0x9] + ldrb r2, [r1, 0xA] + ldrb r0, [r1, 0xB] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r1, 0xC] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r1, 0xD] + lsls r0, 24 + adds r2, r0 + mov r12, r2 + movs r1, 0 + cmp r7, r6 + bcs _0804B2F6 +_0804B2DA: + ldrb r0, [r5] + ldrb r2, [r4] + cmp r0, r2 + bne _0804B2E8 + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 +_0804B2E8: + adds r5, 0x1 + adds r4, 0x1 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, r6 + bcc _0804B2DA +_0804B2F6: + cmp r7, r6 + beq _0804B304 + mov r0, r12 + b _0804B308 + .pool +_0804B304: + ldr r0, [r3] + adds r0, 0xE +_0804B308: + str r0, [r3] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_804B28C + + thumb_func_start sub_804B310 +sub_804B310: @ 804B310 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + adds r1, r0 + ldrb r0, [r2, 0x5] + strb r0, [r1] + ldr r0, [r3] + adds r0, 0x6 + str r0, [r3] + bx lr + .pool + thumb_func_end sub_804B310 + + thumb_func_start sub_804B338 +sub_804B338: @ 804B338 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + adds r1, r0 + ldrb r0, [r2, 0x5] + ldrb r2, [r1] + adds r0, r2 + strb r0, [r1] + ldr r0, [r3] + adds r0, 0x6 + str r0, [r3] + bx lr + .pool + thumb_func_end sub_804B338 + + thumb_func_start sub_804B364 +sub_804B364: @ 804B364 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + adds r1, r0 + ldrb r0, [r1] + ldrb r2, [r2, 0x5] + subs r0, r2 + strb r0, [r1] + ldr r0, [r3] + adds r0, 0x6 + str r0, [r3] + bx lr + .pool + thumb_func_end sub_804B364 + + thumb_func_start atk31_copyarray +atk31_copyarray: @ 804B390 + push {r4-r6,lr} + ldr r3, =0x02024214 + ldr r1, [r3] + ldrb r2, [r1, 0x1] + ldrb r0, [r1, 0x2] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r1, 0x3] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r1, 0x4] + lsls r0, 24 + adds r6, r2, r0 + ldrb r2, [r1, 0x5] + ldrb r0, [r1, 0x6] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r1, 0x7] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r1, 0x8] + lsls r0, 24 + adds r5, r2, r0 + ldrb r4, [r1, 0x9] + movs r2, 0 + cmp r2, r4 + bge _0804B3D4 +_0804B3C6: + adds r0, r6, r2 + adds r1, r5, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, r4 + blt _0804B3C6 +_0804B3D4: + ldr r0, [r3] + adds r0, 0xA + str r0, [r3] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atk31_copyarray + + thumb_func_start atk32_memcpy_with_offset +atk32_memcpy_with_offset: @ 804B3E4 + push {r4-r7,lr} + ldr r3, =0x02024214 + ldr r1, [r3] + ldrb r2, [r1, 0x1] + ldrb r0, [r1, 0x2] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r1, 0x3] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r1, 0x4] + lsls r0, 24 + adds r7, r2, r0 + ldrb r2, [r1, 0x5] + ldrb r0, [r1, 0x6] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r1, 0x7] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r1, 0x8] + lsls r0, 24 + adds r6, r2, r0 + ldrb r2, [r1, 0x9] + ldrb r0, [r1, 0xA] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r1, 0xB] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r1, 0xC] + lsls r0, 24 + adds r5, r2, r0 + ldrb r4, [r1, 0xD] + movs r2, 0 + cmp r2, r4 + bge _0804B440 +_0804B42E: + adds r0, r7, r2 + ldrb r1, [r5] + adds r1, r2, r1 + adds r1, r6, r1 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, r4 + blt _0804B42E +_0804B440: + ldr r0, [r3] + adds r0, 0xE + str r0, [r3] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk32_memcpy_with_offset + + thumb_func_start atk33_orbyte +atk33_orbyte: @ 804B450 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + adds r1, r0 + ldrb r0, [r1] + ldrb r2, [r2, 0x5] + orrs r0, r2 + strb r0, [r1] + ldr r0, [r3] + adds r0, 0x6 + str r0, [r3] + bx lr + .pool + thumb_func_end atk33_orbyte + + thumb_func_start atk34_orhalfword +atk34_orhalfword: @ 804B47C + push {r4,lr} + ldr r4, =0x02024214 + ldr r3, [r4] + ldrb r2, [r3, 0x1] + ldrb r0, [r3, 0x2] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r3, 0x3] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r3, 0x4] + lsls r0, 24 + adds r2, r0 + ldrb r1, [r3, 0x5] + ldrb r0, [r3, 0x6] + lsls r0, 8 + orrs r1, r0 + ldrh r0, [r2] + orrs r1, r0 + strh r1, [r2] + ldr r0, [r4] + adds r0, 0x7 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk34_orhalfword + + thumb_func_start atk35_orword +atk35_orword: @ 804B4B4 + push {r4,lr} + ldr r4, =0x02024214 + ldr r2, [r4] + ldrb r3, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + adds r3, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + adds r3, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + adds r3, r0 + ldrb r1, [r2, 0x5] + ldrb r0, [r2, 0x6] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x7] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x8] + lsls r0, 24 + adds r1, r0 + ldr r0, [r3] + orrs r0, r1 + str r0, [r3] + ldr r0, [r4] + adds r0, 0x9 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk35_orword + + thumb_func_start atk36_bicbyte +atk36_bicbyte: @ 804B4F8 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + adds r1, r0 + ldrb r2, [r2, 0x5] + ldrb r0, [r1] + bics r0, r2 + strb r0, [r1] + ldr r0, [r3] + adds r0, 0x6 + str r0, [r3] + bx lr + .pool + thumb_func_end atk36_bicbyte + + thumb_func_start atk37_bichalfword +atk37_bichalfword: @ 804B524 + push {r4,lr} + ldr r4, =0x02024214 + ldr r3, [r4] + ldrb r1, [r3, 0x1] + ldrb r0, [r3, 0x2] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r3, 0x3] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 24 + adds r1, r0 + ldrb r2, [r3, 0x5] + ldrb r0, [r3, 0x6] + lsls r0, 8 + orrs r2, r0 + ldrh r0, [r1] + bics r0, r2 + strh r0, [r1] + ldr r0, [r4] + adds r0, 0x7 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk37_bichalfword + + thumb_func_start atk38_bicword +atk38_bicword: @ 804B55C + push {r4,lr} + ldr r4, =0x02024214 + ldr r2, [r4] + ldrb r3, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + adds r3, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + adds r3, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + adds r3, r0 + ldrb r1, [r2, 0x5] + ldrb r0, [r2, 0x6] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x7] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x8] + lsls r0, 24 + adds r1, r0 + ldr r0, [r3] + bics r0, r1 + str r0, [r3] + ldr r0, [r4] + adds r0, 0x9 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk38_bicword + + thumb_func_start atk39_pause +atk39_pause: @ 804B5A0 + push {r4,r5,lr} + ldr r0, =0x02024068 + ldr r4, [r0] + cmp r4, 0 + bne _0804B5CC + ldr r5, =0x02024214 + ldr r2, [r5] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldr r3, =0x0202432c + ldrh r0, [r3] + adds r0, 0x1 + strh r0, [r3] + lsls r0, 16 + lsrs r0, 16 + cmp r0, r1 + bcc _0804B5CC + strh r4, [r3] + adds r0, r2, 0x3 + str r0, [r5] +_0804B5CC: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk39_pause + + thumb_func_start sub_804B5E0 +sub_804B5E0: @ 804B5E0 + push {lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0804B5F2 + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_0804B5F2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_804B5E0 + + thumb_func_start atk3B_8022C68 +atk3B_8022C68: @ 804B600 + push {lr} + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0 + bne _0804B620 + ldr r0, =0x02024064 + ldr r1, =0x0202420c + b _0804B624 + .pool +_0804B620: + ldr r0, =0x02024064 + ldr r1, =0x0202420b +_0804B624: + ldrb r1, [r1] + strb r1, [r0] + ldr r0, =0x020241f0 + ldrh r1, [r0] + movs r0, 0 + bl dp01_build_cmdbuf_x18_0_aa_health_bar_update + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end atk3B_8022C68 + + thumb_func_start atk3C_return +atk3C_return: @ 804B658 + push {lr} + bl b_movescr_stack_pop_cursor + pop {r0} + bx r0 + thumb_func_end atk3C_return + + thumb_func_start sub_804B664 +sub_804B664: @ 804B664 + push {lr} + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _0804B67C + ldr r0, =0x0202420b + ldrb r0, [r0] + bl sub_81A5718 +_0804B67C: + ldr r0, =0x0202427c + movs r1, 0 + strb r1, [r0] + ldr r0, =0x02024064 + strb r1, [r0] + ldr r1, =0x02024083 + movs r0, 0xB + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_804B664 + + thumb_func_start atk3E_end2 +atk3E_end2: @ 804B6A4 + ldr r1, =0x02024064 + movs r0, 0 + strb r0, [r1] + ldr r1, =0x02024083 + movs r0, 0xB + strb r0, [r1] + bx lr + .pool + thumb_func_end atk3E_end2 + + thumb_func_start atk3F_end3 +atk3F_end3: @ 804B6BC + push {lr} + bl b_movescr_stack_pop_cursor + ldr r3, =0x020244a8 + ldr r0, [r3] + ldr r0, [r0, 0xC] + adds r1, r0, 0 + adds r1, 0x20 + ldrb r0, [r1] + cmp r0, 0 + beq _0804B6D6 + subs r0, 0x1 + strb r0, [r1] +_0804B6D6: + ldr r2, =0x03005d04 + ldr r0, [r3] + ldr r1, [r0, 0xC] + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + lsls r0, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r2] + pop {r0} + bx r0 + .pool + thumb_func_end atk3F_end3 + + thumb_func_start atk41_call +atk41_call: @ 804B6F8 + push {r4,lr} + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x5 + bl b_movescr_stack_push + ldr r2, [r4] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk41_call + + thumb_func_start atk42_jumpiftype2 +atk42_jumpiftype2: @ 804B728 + push {r4,lr} + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + lsls r0, 24 + lsrs r0, 24 + ldr r3, [r4] + ldr r2, =0x02024084 + movs r1, 0x58 + muls r0, r1 + adds r0, r2 + adds r1, r0, 0 + adds r1, 0x21 + ldrb r2, [r3, 0x2] + ldrb r1, [r1] + cmp r2, r1 + beq _0804B756 + adds r0, 0x22 + ldrb r0, [r0] + cmp r2, r0 + bne _0804B778 +_0804B756: + ldrb r1, [r3, 0x3] + ldrb r0, [r3, 0x4] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x6] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _0804B77C + .pool +_0804B778: + adds r0, r3, 0x7 + str r0, [r4] +_0804B77C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end atk42_jumpiftype2 + + thumb_func_start sub_804B784 +sub_804B784: @ 804B784 + push {r4,lr} + sub sp, 0x4 + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r2, [r0, 0x1] + movs r0, 0 + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _0804B7C0 + ldr r2, [r4] + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _0804B7C6 + .pool +_0804B7C0: + ldr r0, [r4] + adds r0, 0x6 + str r0, [r4] +_0804B7C6: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_804B784 + + thumb_func_start sub_804B7D0 +sub_804B7D0: @ 804B7D0 + ldr r0, =0x0202420b + ldrb r0, [r0] + ldr r1, =0x0202449c + ldr r1, [r1] + adds r0, r1 + adds r0, 0x54 + movs r1, 0x1 + strb r1, [r0] + bx lr + .pool + thumb_func_end sub_804B7D0 + + thumb_func_start atk46_cmd46 +atk46_cmd46: @ 804B7EC + push {r4-r6,lr} + ldr r5, =0x02024214 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r6, =0x02024064 + strb r0, [r6] + ldr r2, [r5] + ldrb r1, [r2, 0x3] + ldrb r0, [r2, 0x4] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 24 + adds r3, r1, r0 + ldrb r4, [r2, 0x2] + adds r0, r4, 0 + cmp r0, 0x1 + beq _0804B822 + cmp r0, 0x11 + beq _0804B822 + cmp r0, 0x2 + bne _0804B848 +_0804B822: + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r1, [r0, 0x2] + ldrh r2, [r3] + movs r0, 0 + bl dp01_build_cmdbuf_x34_a_bb_aka_battle_anim + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r4] + adds r0, 0x7 + str r0, [r4] + b _0804B8AA + .pool +_0804B848: + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0804B868 + adds r0, r2, 0x7 + bl b_movescr_stack_push + ldr r0, =gUnknown_082DABB9 + b _0804B8A8 + .pool +_0804B868: + adds r0, r4, 0 + subs r0, 0xA + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _0804B894 + ldr r1, =0x020242ac + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, =0x000400c0 + ands r0, r1 + cmp r0, 0 + beq _0804B894 + adds r0, r2, 0x7 + b _0804B8A8 + .pool +_0804B894: + ldrb r1, [r2, 0x2] + ldrh r2, [r3] + movs r0, 0 + bl dp01_build_cmdbuf_x34_a_bb_aka_battle_anim + ldrb r0, [r6] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r5] + adds r0, 0x7 +_0804B8A8: + str r0, [r5] +_0804B8AA: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end atk46_cmd46 + + thumb_func_start sub_804B8B0 +sub_804B8B0: @ 804B8B0 + push {r4-r7,lr} + ldr r6, =0x02024214 + ldr r0, [r6] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r7, =0x02024064 + strb r0, [r7] + ldr r2, [r6] + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + adds r3, r1, r0 + ldrb r1, [r2, 0x6] + ldrb r0, [r2, 0x7] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x8] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x9] + lsls r0, 24 + adds r4, r1, r0 + ldrb r5, [r3] + adds r0, r5, 0 + cmp r0, 0x1 + beq _0804B8FA + cmp r0, 0x11 + beq _0804B8FA + cmp r0, 0x2 + bne _0804B920 +_0804B8FA: + ldrb r1, [r3] + ldrh r2, [r4] + movs r0, 0 + bl dp01_build_cmdbuf_x34_a_bb_aka_battle_anim + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0xA + str r0, [r1] + b _0804B976 + .pool +_0804B920: + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0804B934 + adds r0, r2, 0 + b _0804B972 + .pool +_0804B934: + adds r0, r5, 0 + subs r0, 0xA + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _0804B960 + ldr r1, =0x020242ac + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, =0x000400c0 + ands r0, r1 + cmp r0, 0 + beq _0804B960 + adds r0, r2, 0 + b _0804B972 + .pool +_0804B960: + ldrb r1, [r3] + ldrh r2, [r4] + movs r0, 0 + bl dp01_build_cmdbuf_x34_a_bb_aka_battle_anim + ldrb r0, [r7] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r6] +_0804B972: + adds r0, 0xA + str r0, [r6] +_0804B976: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_804B8B0 + + thumb_func_start sub_804B97C +sub_804B97C: @ 804B97C + push {r4,lr} + movs r3, 0 + ldr r1, =0x02024474 + ldrb r0, [r1, 0x1A] + movs r2, 0xF0 + ands r2, r0 + adds r4, r1, 0 + cmp r2, 0x20 + beq _0804B9AA + cmp r2, 0x20 + bgt _0804B99C + cmp r2, 0x10 + beq _0804B9A6 + b _0804B9B4 + .pool +_0804B99C: + cmp r2, 0x90 + beq _0804B9AE + cmp r2, 0xA0 + beq _0804B9B2 + b _0804B9B4 +_0804B9A6: + movs r3, 0xF + b _0804B9B4 +_0804B9AA: + movs r3, 0x27 + b _0804B9B4 +_0804B9AE: + movs r3, 0x16 + b _0804B9B4 +_0804B9B2: + movs r3, 0x2E +_0804B9B4: + ldrb r1, [r4, 0x1A] + movs r0, 0xF + ands r0, r1 + adds r0, r3, r0 + subs r0, 0x1 + movs r1, 0 + strb r0, [r4, 0x10] + strb r1, [r4, 0x11] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_804B97C + + thumb_func_start atk48_playstatchangeanimation +atk48_playstatchangeanimation: @ 804B9D8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r7, 0 + movs r0, 0 + mov r8, r0 + movs r3, 0 + ldr r5, =0x02024214 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + str r3, [sp] + bl get_battle_side_of_something + ldr r2, =0x02024064 + strb r0, [r2] + ldr r0, [r5] + ldrb r4, [r0, 0x2] + ldrb r1, [r0, 0x3] + movs r0, 0x1 + ands r0, r1 + ldr r3, [sp] + cmp r0, 0 + beq _0804BAEC + movs r0, 0x2 + ands r0, r1 + movs r1, 0x15 + cmp r0, 0 + beq _0804BA18 + movs r1, 0x2D +_0804BA18: + cmp r4, 0 + beq _0804BAC0 + movs r0, 0x1 + mov r10, r0 + ldr r0, =0x0202409c + mov r9, r0 + lsls r5, r1, 16 +_0804BA26: + adds r0, r4, 0 + mov r1, r10 + ands r0, r1 + cmp r0, 0 + beq _0804BAB2 + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r1, [r0, 0x3] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0804BA58 + ldr r0, =0x02024064 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r7, r0 + b _0804BAA0 + .pool +_0804BA58: + ldr r6, =0x02024064 + ldrb r0, [r6] + str r3, [sp] + bl battle_get_per_side_status + mov r1, r10 + ands r1, r0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02024294 + adds r0, r1 + ldrb r0, [r0, 0x4] + ldr r3, [sp] + cmp r0, 0 + bne _0804BAB2 + ldr r0, =0x02024084 + ldrb r2, [r6] + movs r1, 0x58 + muls r2, r1 + adds r0, r2, r0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x1D + beq _0804BAB2 + cmp r0, 0x49 + beq _0804BAB2 + cmp r0, 0x33 + bne _0804BA96 + cmp r7, 0x6 + beq _0804BAB2 +_0804BA96: + cmp r0, 0x34 + bne _0804BA9E + cmp r7, 0x1 + beq _0804BAB2 +_0804BA9E: + adds r0, r7, r2 +_0804BAA0: + add r0, r9 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + ble _0804BAB2 + lsrs r0, r5, 16 + mov r8, r0 + adds r3, 0x1 +_0804BAB2: + lsrs r4, 1 + movs r1, 0x80 + lsls r1, 9 + adds r5, r1 + adds r7, 0x1 + cmp r4, 0 + bne _0804BA26 +_0804BAC0: + ldr r0, =0x02024214 + mov r9, r0 + cmp r3, 0x1 + ble _0804BB4E + ldr r0, [r0] + ldrb r1, [r0, 0x3] + movs r0, 0x2 + ands r0, r1 + movs r1, 0x39 + mov r8, r1 + cmp r0, 0 + beq _0804BB4E + movs r0, 0x3A + b _0804BB4C + .pool +_0804BAEC: + movs r0, 0x2 + ands r0, r1 + movs r1, 0xE + cmp r0, 0 + beq _0804BAF8 + movs r1, 0x26 +_0804BAF8: + mov r9, r5 + cmp r4, 0 + beq _0804BB34 + ldr r6, =0x0202409c + adds r5, r2, 0 + lsls r2, r1, 16 +_0804BB04: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0804BB26 + ldrb r1, [r5] + movs r0, 0x58 + muls r0, r1 + adds r0, r7, r0 + adds r0, r6 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0xB + bgt _0804BB26 + lsrs r1, r2, 16 + mov r8, r1 + adds r3, 0x1 +_0804BB26: + lsrs r4, 1 + movs r0, 0x80 + lsls r0, 9 + adds r2, r0 + adds r7, 0x1 + cmp r4, 0 + bne _0804BB04 +_0804BB34: + cmp r3, 0x1 + ble _0804BB4E + mov r1, r9 + ldr r0, [r1] + ldrb r1, [r0, 0x3] + movs r0, 0x2 + ands r0, r1 + movs r1, 0x37 + mov r8, r1 + cmp r0, 0 + beq _0804BB4E + movs r0, 0x38 +_0804BB4C: + mov r8, r0 +_0804BB4E: + mov r1, r9 + ldr r2, [r1] + ldrb r1, [r2, 0x3] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0804BB6C + cmp r3, 0x1 + bgt _0804BB6C + adds r0, r2, 0x4 + mov r1, r9 + b _0804BBBA + .pool +_0804BB6C: + cmp r3, 0 + beq _0804BBB4 + ldr r4, =0x02024474 + ldrb r0, [r4, 0x1B] + cmp r0, 0 + bne _0804BBB4 + movs r0, 0 + movs r1, 0x1 + mov r2, r8 + str r3, [sp] + bl dp01_build_cmdbuf_x34_a_bb_aka_battle_anim + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r1, [r0, 0x3] + movs r0, 0x4 + ands r0, r1 + ldr r3, [sp] + cmp r0, 0 + beq _0804BBA4 + cmp r3, 0x1 + ble _0804BBA4 + movs r0, 0x1 + strb r0, [r4, 0x1B] +_0804BBA4: + ldr r1, =0x02024214 + b _0804BBB6 + .pool +_0804BBB4: + mov r1, r9 +_0804BBB6: + ldr r0, [r1] + adds r0, 0x4 +_0804BBBA: + str r0, [r1] + 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 atk48_playstatchangeanimation + + thumb_func_start sub_804BBCC +sub_804BBCC: @ 804BBCC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + movs r0, 0 + mov r10, r0 + ldr r2, =0x020241ec + ldrh r1, [r2] + ldr r0, =0x0000ffff + movs r3, 0 + str r3, [sp, 0x18] + cmp r1, r0 + beq _0804BBEE + ldrh r2, [r2] + str r2, [sp, 0x18] +_0804BBEE: + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r4, [r0, 0x1] + str r4, [sp, 0x10] + ldrb r0, [r0, 0x2] + str r0, [sp, 0x14] + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2E] + cmp r0, 0xAF + bne _0804BC34 + ldr r1, =0x02024404 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x7] + b _0804BC3E + .pool +_0804BC34: + ldrh r0, [r1, 0x2E] + bl itemid_get_x12 + lsls r0, 24 + lsrs r0, 24 +_0804BC3E: + str r0, [sp, 0x8] + ldr r1, =0x0202449c + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, 0xC8 + ldr r1, [r1] + adds r0, r1, r0 + str r0, [sp, 0xC] + ldrb r0, [r1, 0x13] + cmp r0, 0 + beq _0804BCF0 + movs r5, 0x3F + ands r5, r0 + str r5, [sp, 0x4] + b _0804BD02 + .pool +_0804BC68: + ldr r4, =0x02024064 + strb r2, [r4] + movs r0, 0 + movs r1, 0x1 + bl dp01_build_cmdbuf_x33_a_33_33 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + b _0804C15A + .pool +_0804BC80: + ldr r4, =0x02024064 + strb r2, [r4] + movs r0, 0 + movs r1, 0 + bl dp01_build_cmdbuf_x33_a_33_33 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldrb r1, [r6] + lsls r1, 2 + adds r1, r5 + ldr r0, [r1] + ldr r2, =0xfffbff3f + ands r0, r2 + str r0, [r1] + b _0804C15A + .pool +_0804BCAC: + strb r2, [r7] + ldr r0, [r5] + orrs r0, r6 + str r0, [r5] + ldr r0, =0x02024474 + strb r4, [r0, 0x14] + bl sub_804AF30 + ldr r2, =gUnknown_082D86A8 + mov r0, r8 + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + add r0, r9 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + bl b_movescr_stack_push + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB87D + bl _0804C5B8 + .pool +_0804BCF0: + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x2] + str r0, [sp, 0x4] +_0804BD02: + ldr r1, =0x02024474 + mov r12, r1 + b _0804BD1E + .pool +_0804BD14: + mov r2, r10 + cmp r2, 0 + beq _0804BD1E + bl _0804C5A4 +_0804BD1E: + mov r3, r12 + ldrb r0, [r3, 0x14] + cmp r0, 0x11 + bls _0804BD2A + bl _0804C570 +_0804BD2A: + lsls r0, 2 + ldr r1, =_0804BD38 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0804BD38: + .4byte _0804BD80 + .4byte _0804BE5C + .4byte _0804BF18 + .4byte _0804BF3C + .4byte _0804BF54 + .4byte _0804BF7C + .4byte _0804BFA0 + .4byte _0804C048 + .4byte _0804C0BE + .4byte _0804C0F4 + .4byte _0804C194 + .4byte _0804C088 + .4byte _0804C0A8 + .4byte _0804C1D8 + .4byte _0804C21C + .4byte _0804C3FC + .4byte _0804C4E4 + .4byte _0804C570 +_0804BD80: + ldr r6, =0x02024084 + ldr r5, =0x0202420c + ldrb r3, [r5] + movs r7, 0x58 + adds r2, r3, 0 + muls r2, r7 + adds r0, r6, 0 + adds r0, 0x50 + adds r0, r2, r0 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 16 + ands r0, r1 + cmp r0, 0 + bne _0804BDA0 + b _0804C184 +_0804BDA0: + adds r0, r2, r6 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _0804BDAA + b _0804C184 +_0804BDAA: + ldr r0, =0x0202420b + ldrb r1, [r0] + cmp r1, r3 + bne _0804BDB4 + b _0804C184 +_0804BDB4: + adds r0, r1, 0 + bl battle_side_get_owner + adds r4, r0, 0 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _0804BDCC + b _0804C184 +_0804BDCC: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _0804BDDA + b _0804C184 +_0804BDDA: + ldr r2, =0x0202437c + ldrb r3, [r5] + lsls r0, r3, 2 + adds r0, r3 + lsls r1, r0, 2 + adds r0, r2, 0 + adds r0, 0x8 + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _0804BDFE + adds r0, r2, 0 + adds r0, 0xC + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _0804BDFE + b _0804C184 +_0804BDFE: + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0 + bne _0804BE14 + b _0804C184 +_0804BE14: + adds r0, r3, 0 + muls r0, r7 + adds r1, r0, r6 + ldrb r2, [r1, 0x19] + movs r0, 0x19 + ldrsb r0, [r1, r0] + cmp r0, 0xB + ble _0804BE26 + b _0804C184 +_0804BE26: + adds r0, r2, 0x1 + strb r0, [r1, 0x19] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAE0D + str r0, [r1] + b _0804C0B8 + .pool +_0804BE5C: + ldr r4, =0x02024084 + ldr r6, =0x0202420c + ldrb r2, [r6] + movs r5, 0x58 + mov r12, r5 + mov r1, r12 + muls r1, r2 + adds r7, r4, 0 + adds r7, 0x4C + adds r5, r1, r7 + ldr r3, [r5] + movs r0, 0x20 + ands r0, r3 + cmp r0, 0 + bne _0804BE7C + b _0804C184 +_0804BE7C: + adds r0, r1, r4 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _0804BE86 + b _0804C184 +_0804BE86: + ldr r0, =0x0202420b + ldrb r0, [r0] + cmp r0, r2 + bne _0804BE90 + b _0804C184 +_0804BE90: + ldr r0, =0x0202437c + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 2 + adds r0, 0xC + adds r1, r0 + ldr r0, [r1] + cmp r0, 0 + bne _0804BEA4 + b _0804C184 +_0804BEA4: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _0804BEB2 + b _0804C184 +_0804BEB2: + ldr r0, [sp, 0x4] + cmp r0, 0xA + beq _0804BEBA + b _0804C184 +_0804BEBA: + movs r0, 0x21 + negs r0, r0 + ands r3, r0 + str r3, [r5] + ldr r4, =0x02024064 + ldrb r0, [r6] + strb r0, [r4] + ldrb r0, [r6] + mov r1, r12 + muls r1, r0 + adds r0, r1, 0 + adds r0, r7 + str r0, [sp] + movs r0, 0 + movs r1, 0x28 + movs r2, 0 + movs r3, 0x4 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB282 + str r0, [r1] + movs r2, 0x1 + mov r10, r2 + b _0804C184 + .pool +_0804BF18: + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x7 + movs r2, 0 + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + bne _0804BF32 + b _0804C184 +_0804BF32: + movs r3, 0x1 + mov r10, r3 + b _0804C184 + .pool +_0804BF3C: + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x4 + movs r2, 0 + movs r3, 0 + bl ability_something + b _0804C0B2 + .pool +_0804BF54: + movs r0, 0 + str r0, [sp] + movs r0, 0x5 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + bne _0804BF6C + b _0804C184 +_0804BF6C: + movs r5, 0x1 + mov r10, r5 + ldr r0, =0x02024474 + mov r12, r0 + b _0804C570 + .pool +_0804BF7C: + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x8 + movs r2, 0 + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + bne _0804BF96 + b _0804C184 +_0804BF96: + movs r1, 0x1 + mov r10, r1 + b _0804C184 + .pool +_0804BFA0: + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 18 + ands r0, r1 + cmp r0, 0 + beq _0804BFE4 + ldr r2, [sp, 0x8] + cmp r2, 0x1D + bne _0804BFE4 + ldr r0, =0x020241ec + ldrh r2, [r0] + adds r3, r0, 0 + cmp r2, 0xA5 + beq _0804BFE4 + ldr r4, [sp, 0xC] + ldrh r1, [r4] + cmp r1, 0 + beq _0804BFCC + ldr r0, =0x0000ffff + cmp r1, r0 + bne _0804BFE4 +_0804BFCC: + cmp r2, 0xE2 + bne _0804BFDE + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _0804BFDE + b _0804C4B6 +_0804BFDE: + ldrh r0, [r3] + ldr r1, [sp, 0xC] + strh r0, [r1] +_0804BFE4: + movs r4, 0 + ldr r2, =0x02024084 + ldr r3, =0x0202420b + ldrb r1, [r3] + movs r0, 0x58 + muls r0, r1 + adds r2, 0xC + adds r0, r2 + ldrh r0, [r0] + ldr r5, [sp, 0xC] + ldrh r1, [r5] + mov r9, r3 + cmp r0, r1 + beq _0804C01C + mov r6, r9 + movs r3, 0x58 + adds r5, r1, 0 +_0804C006: + adds r4, 0x1 + cmp r4, 0x3 + bgt _0804C01C + lsls r0, r4, 1 + ldrb r1, [r6] + muls r1, r3 + adds r0, r1 + adds r0, r2 + ldrh r0, [r0] + cmp r0, r5 + bne _0804C006 +_0804C01C: + cmp r4, 0x4 + bne _0804C026 + movs r0, 0 + ldr r1, [sp, 0xC] + strh r0, [r1] +_0804C026: + mov r2, r12 + ldrb r0, [r2, 0x14] + adds r0, 0x1 + strb r0, [r2, 0x14] + b _0804C570 + .pool +_0804C048: + movs r4, 0 + ldr r0, =0x0202406c + ldrb r3, [r0] + cmp r4, r3 + blt _0804C054 + b _0804C202 +_0804C054: + ldr r7, =0x0202449c + movs r6, 0 + movs r3, 0xD0 + adds r5, r0, 0 + ldr r2, =0x02024084 +_0804C05E: + ldr r0, [r7] + adds r0, r3 + ldrh r1, [r0] + cmp r1, 0 + beq _0804C06C + strh r1, [r2, 0x2E] + strh r6, [r0] +_0804C06C: + adds r3, 0x2 + adds r2, 0x58 + adds r4, 0x1 + ldrb r0, [r5] + cmp r4, r0 + blt _0804C05E + b _0804C202 + .pool +_0804C088: + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl berry_effects_maybe + lsls r0, 24 + cmp r0, 0 + beq _0804C184 + movs r2, 0x1 + mov r10, r2 + ldr r3, =0x02024474 + mov r12, r3 + b _0804C570 + .pool +_0804C0A8: + movs r0, 0x4 + movs r1, 0 + movs r2, 0 + bl berry_effects_maybe +_0804C0B2: + lsls r0, 24 + cmp r0, 0 + beq _0804C184 +_0804C0B8: + movs r4, 0x1 + mov r10, r4 + b _0804C184 +_0804C0BE: + ldr r1, =0x020242ac + ldr r0, =0x0202420b + ldrb r2, [r0] + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, =0x000400c0 + ands r0, r1 + cmp r0, 0 + bne _0804C0D4 + b _0804C4B6 +_0804C0D4: + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0804C0E2 + b _0804BC68 +_0804C0E2: + b _0804C4B6 + .pool +_0804C0F4: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _0804C120 + ldr r1, =0x020242ac + ldr r0, =0x0202420b + ldrb r2, [r0] + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, =0x000400c0 + ands r0, r1 + cmp r0, 0 + beq _0804C120 + adds r0, r2, 0 + bl sub_803F90C + lsls r0, 24 + cmp r0, 0 + beq _0804C184 +_0804C120: + ldr r4, =0x02024064 + ldr r5, =0x0202420b + ldrb r0, [r5] + strb r0, [r4] + movs r0, 0 + movs r1, 0 + bl dp01_build_cmdbuf_x33_a_33_33 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, =0x020242ac + ldrb r2, [r5] + lsls r2, 2 + adds r2, r0 + ldr r0, [r2] + ldr r1, =0xfffbff3f + ands r0, r1 + str r0, [r2] + ldr r2, =0x0202437c + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_0804C15A: + ldr r1, =0x02024474 + ldrb r0, [r1, 0x14] + adds r0, 0x1 + strb r0, [r1, 0x14] + b _0804C5BA + .pool +_0804C184: + ldr r1, =0x02024474 + ldrb r0, [r1, 0x14] + adds r0, 0x1 + strb r0, [r1, 0x14] + mov r12, r1 + b _0804C570 + .pool +_0804C194: + ldr r0, =0x0202437c + ldr r6, =0x0202420c + ldrb r2, [r6] + lsls r3, r2, 2 + adds r1, r3, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 29 + cmp r0, 0 + blt _0804C202 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r2, r0 + bcs _0804C202 + ldr r5, =0x020242ac + adds r0, r3, r5 + ldr r0, [r0] + ldr r1, =0x000400c0 + ands r0, r1 + cmp r0, 0 + bne _0804C1C2 + b _0804BC80 +_0804C1C2: + b _0804C202 + .pool +_0804C1D8: + movs r4, 0 + ldr r0, =0x0202406c + ldrb r2, [r0] + cmp r4, r2 + bge _0804C202 + ldr r2, =0x020242bc + ldr r5, =0xfeffffff + adds r3, r0, 0 + ldr r1, =0x020240d4 +_0804C1EA: + ldrb r0, [r2, 0xA] + cmp r0, 0 + bne _0804C1F6 + ldr r0, [r1] + ands r0, r5 + str r0, [r1] +_0804C1F6: + adds r2, 0x1C + adds r1, 0x58 + adds r4, 0x1 + ldrb r0, [r3] + cmp r4, r0 + blt _0804C1EA +_0804C202: + mov r1, r12 + ldrb r0, [r1, 0x14] + adds r0, 0x1 + strb r0, [r1, 0x14] + b _0804C570 + .pool +_0804C21C: + ldr r1, =0x02024280 + ldr r3, [r1] + movs r0, 0x80 + lsls r0, 5 + ands r0, r3 + ldr r2, =0x0202420b + mov r9, r2 + adds r5, r1, 0 + cmp r0, 0 + beq _0804C246 + ldr r0, =0x02024064 + ldrb r2, [r2] + strb r2, [r0] + ldr r1, =0x0202420c + ldrb r0, [r1] + mov r4, r9 + strb r0, [r4] + strb r2, [r1] + ldr r0, =0xffffefff + ands r3, r0 + str r3, [r5] +_0804C246: + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 3 + ands r0, r1 + cmp r0, 0 + beq _0804C262 + ldr r0, =0x02024240 + mov r2, r9 + ldrb r1, [r2] + lsls r1, 1 + adds r1, r0 + ldr r0, =0x020241ec + ldrh r0, [r0] + strh r0, [r1] +_0804C262: + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + mov r3, r9 + ldrb r4, [r3] + lsls r0, r4, 2 + adds r0, r2 + ldr r3, [r0] + ands r1, r3 + adds r6, r2, 0 + cmp r1, 0 + beq _0804C27C + b _0804C3E8 +_0804C27C: + ldr r0, =0x0202449c + ldr r1, [r0] + adds r1, 0x91 + ldrb r1, [r1] + ands r1, r3 + adds r7, r0, 0 + cmp r1, 0 + beq _0804C28E + b _0804C3E8 +_0804C28E: + ldr r0, =gBattleMoves + ldr r2, [sp, 0x18] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r1, [r1] + mov r8, r0 + cmp r1, 0x7F + bne _0804C2A4 + b _0804C3E8 +_0804C2A4: + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 18 + ands r0, r1 + cmp r0, 0 + beq _0804C308 + ldr r0, =0x02024248 + lsls r1, r4, 1 + adds r1, r0 + ldr r0, =0x020241ec + ldrh r0, [r0] + strh r0, [r1] + ldr r0, =0x02024260 + mov r3, r9 + ldrb r1, [r3] + lsls r1, 1 + adds r1, r0 + ldr r0, =0x020241ea + ldrh r0, [r0] + strh r0, [r1] + b _0804C322 + .pool +_0804C308: + ldr r1, =0x02024248 + lsls r0, r4, 1 + adds r0, r1 + ldr r1, =0x0000ffff + strh r1, [r0] + ldr r1, =0x02024260 + mov r4, r9 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + movs r1, 0x1 + negs r1, r1 + strh r1, [r0] +_0804C322: + ldr r2, =0x0202420c + ldrb r3, [r2] + lsls r0, r3, 2 + adds r0, r6 + ldr r0, [r0] + lsls r0, 28 + ldr r1, [r5] + ands r1, r0 + cmp r1, 0 + bne _0804C340 + ldr r0, =0x02024270 + adds r0, r3, r0 + mov r3, r9 + ldrb r1, [r3] + strb r1, [r0] +_0804C340: + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 18 + ands r0, r1 + cmp r0, 0 + beq _0804C3DC + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _0804C3DC + ldr r0, =0x020241ec + ldrh r3, [r0] + ldr r0, =0x0000ffff + cmp r3, r0 + bne _0804C390 + ldr r1, =0x02024250 + ldrb r0, [r2] + lsls r0, 1 + adds r0, r1 + strh r3, [r0] + b _0804C3E8 + .pool +_0804C390: + ldr r0, =0x02024250 + ldrb r1, [r2] + lsls r1, 1 + adds r1, r0 + ldr r4, =0x020241ea + ldrh r0, [r4] + strh r0, [r1] + ldr r0, [r7] + ldrb r3, [r0, 0x13] + cmp r3, 0 + beq _0804C3C0 + ldr r0, =0x02024258 + ldrb r1, [r2] + lsls r1, 1 + adds r1, r0 + movs r0, 0x3F + ands r0, r3 + b _0804C3E6 + .pool +_0804C3C0: + ldr r0, =0x02024258 + ldrb r2, [r2] + lsls r2, 1 + adds r2, r0 + ldrh r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + add r0, r8 + ldrb r0, [r0, 0x2] + strh r0, [r2] + b _0804C3E8 + .pool +_0804C3DC: + ldr r0, =0x02024250 + ldrb r1, [r2] + lsls r1, 1 + adds r1, r0 + ldr r0, =0x0000ffff +_0804C3E6: + strh r0, [r1] +_0804C3E8: + mov r4, r12 + ldrb r0, [r4, 0x14] + adds r0, 0x1 + strb r0, [r4, 0x14] + b _0804C570 + .pool +_0804C3FC: + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r7, =gUnknown_0832A328 + ldr r2, =0x0202420b + ldrb r3, [r2] + lsls r0, r3, 2 + adds r0, r7 + ldr r4, [r0] + ands r1, r4 + mov r9, r2 + cmp r1, 0 + bne _0804C4B6 + ldr r6, =0x0202449c + ldr r5, [r6] + adds r0, r5, 0 + adds r0, 0x91 + ldrb r0, [r0] + ands r0, r4 + cmp r0, 0 + bne _0804C4B6 + ldr r1, =gBattleMoves + ldr r2, [sp, 0x18] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x8] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0804C4B6 + ldr r0, =0x02024280 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 18 + ands r0, r1 + cmp r0, 0 + beq _0804C4B6 + ldr r4, =0x0202420c + ldrb r0, [r4] + cmp r3, r0 + beq _0804C4B6 + ldrb r2, [r4] + lsls r0, r2, 2 + adds r0, r7 + ldr r0, [r0] + lsls r0, 28 + ands r1, r0 + cmp r1, 0 + bne _0804C4B6 + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _0804C4B6 + lsls r1, r2, 1 + adds r1, r5 + adds r1, 0x98 + ldr r3, =0x020241ec + ldrh r0, [r3] + strb r0, [r1] + ldrb r1, [r4] + ldr r0, [r6] + lsls r1, 1 + adds r1, r0 + adds r1, 0x99 + ldrh r0, [r3] + lsrs r0, 8 + strb r0, [r1] + ldrb r0, [r4] + mov r2, r9 + ldrb r1, [r2] + ldr r2, [r6] + lsls r0, 3 + lsls r1, 1 + adds r0, r1 + adds r0, r2 + adds r0, 0xE0 + ldrh r1, [r3] + strb r1, [r0] + ldrb r1, [r4] + mov r4, r9 + ldrb r0, [r4] + ldr r2, [r6] + lsls r1, 3 + lsls r0, 1 + adds r1, r0 + adds r1, r2 + adds r1, 0xE1 + ldrh r0, [r3] + lsrs r0, 8 + strb r0, [r1] +_0804C4B6: + mov r5, r12 + ldrb r0, [r5, 0x14] + adds r0, 0x1 + strb r0, [r5, 0x14] + b _0804C570 + .pool +_0804C4E4: + ldr r5, =0x02024280 + ldr r2, [r5] + movs r0, 0x80 + lsls r0, 12 + ands r0, r2 + cmp r0, 0 + bne _0804C568 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0804C568 + ldr r1, =0x0202433c + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x1] + lsls r0, 29 + cmp r0, 0 + blt _0804C568 + ldr r0, =gBattleMoves + mov r9, r0 + ldr r1, =0x020241ea + mov r8, r1 + ldrh r0, [r1] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + add r1, r9 + ldrb r0, [r1, 0x6] + cmp r0, 0x8 + bne _0804C568 + movs r6, 0x80 + lsls r6, 2 + adds r4, r6, 0 + ands r4, r2 + cmp r4, 0 + bne _0804C568 + ldr r7, =0x0202420c + ldrb r0, [r7] + bl battle_get_per_side_status + movs r1, 0x2 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _0804C55E + bl _0804BCAC +_0804C55E: + ldr r0, [r5] + orrs r0, r6 + str r0, [r5] + ldr r2, =0x02024474 + mov r12, r2 +_0804C568: + mov r3, r12 + ldrb r0, [r3, 0x14] + adds r0, 0x1 + strb r0, [r3, 0x14] +_0804C570: + ldr r4, [sp, 0x10] + cmp r4, 0x1 + bne _0804C582 + mov r5, r10 + cmp r5, 0 + bne _0804C582 + movs r0, 0x11 + mov r1, r12 + strb r0, [r1, 0x14] +_0804C582: + ldr r2, [sp, 0x10] + cmp r2, 0x2 + bne _0804C598 + ldr r4, [sp, 0x14] + mov r3, r12 + ldrb r3, [r3, 0x14] + cmp r4, r3 + bne _0804C598 + movs r0, 0x11 + mov r4, r12 + strb r0, [r4, 0x14] +_0804C598: + mov r5, r12 + ldrb r0, [r5, 0x14] + cmp r0, 0x11 + beq _0804C5A4 + bl _0804BD14 +_0804C5A4: + mov r1, r12 + ldrb r0, [r1, 0x14] + cmp r0, 0x11 + bne _0804C5BA + mov r2, r10 + cmp r2, 0 + bne _0804C5BA + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x3 +_0804C5B8: + str r0, [r1] +_0804C5BA: + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_804BBCC + + thumb_func_start atk4A_damagecalc2 +atk4A_damagecalc2: @ 804C5F4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r4, 0 + movs r5, 0 + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x2] + mov r8, r0 + ldr r2, =0x02024084 + ldr r3, =0x0202420c + ldrb r1, [r3] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x20 + ldrb r0, [r0] + mov r12, r2 + adds r7, r3, 0 + cmp r0, 0x1A + bne _0804C688 + mov r1, r8 + cmp r1, 0x4 + bne _0804C688 + ldr r3, =0x0202420a + strb r0, [r3] + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x9 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024250 + ldrb r0, [r7] + lsls r0, 1 + adds r0, r1 + strh r4, [r0] + ldr r0, =0x02024332 + mov r2, r8 + strb r2, [r0, 0x6] + ldrb r0, [r7] + ldrb r1, [r3] + bl b_history__record_ability_usage_of_player + b _0804C76A + .pool +_0804C678: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0] + b _0804C76A + .pool +_0804C688: + ldr r1, =gUnknown_0831ACE8 + adds r0, r5, r1 + ldrb r0, [r0] + adds r6, r1, 0 + b _0804C74A + .pool +_0804C698: + adds r0, r5, r6 + ldrb r0, [r0] + cmp r0, r8 + bne _0804C744 + adds r2, r5, 0x1 + adds r3, r2, r6 + ldrb r1, [r7] + movs r0, 0x58 + muls r0, r1 + add r0, r12 + adds r0, 0x21 + ldrb r1, [r3] + adds r3, r2, 0 + ldrb r0, [r0] + cmp r1, r0 + bne _0804C6D6 + adds r0, r5, 0x2 + adds r0, r6 + ldrb r1, [r0] + cmp r1, 0 + beq _0804C678 + cmp r1, 0x5 + bne _0804C6CA + movs r0, 0x4 + orrs r4, r0 +_0804C6CA: + cmp r1, 0x14 + bne _0804C6D6 + movs r0, 0x2 + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_0804C6D6: + adds r2, r3, r6 + ldrb r1, [r7] + movs r0, 0x58 + muls r0, r1 + add r0, r12 + adds r1, r0, 0 + adds r1, 0x22 + ldrb r2, [r2] + ldrb r1, [r1] + cmp r2, r1 + bne _0804C744 + adds r0, 0x21 + ldrb r1, [r0] + cmp r1, r2 + beq _0804C6FE + adds r0, r5, 0x2 + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0 + beq _0804C678 +_0804C6FE: + cmp r1, r2 + beq _0804C714 + adds r0, r5, 0x2 + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0x5 + bne _0804C714 + movs r0, 0x4 + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_0804C714: + adds r2, r3, r6 + ldrb r1, [r7] + movs r0, 0x58 + muls r0, r1 + add r0, r12 + adds r1, r0, 0 + adds r1, 0x22 + ldrb r2, [r2] + ldrb r1, [r1] + cmp r2, r1 + bne _0804C744 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, r2 + beq _0804C744 + adds r0, r5, 0x2 + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0x14 + bne _0804C744 + movs r0, 0x2 + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_0804C744: + adds r5, 0x3 + adds r0, r5, r6 + ldrb r0, [r0] +_0804C74A: + cmp r0, 0xFF + beq _0804C76A + cmp r0, 0xFE + bne _0804C698 + ldrb r1, [r7] + movs r0, 0x58 + muls r0, r1 + mov r1, r12 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 22 + ands r0, r1 + cmp r0, 0 + beq _0804C744 +_0804C76A: + ldr r2, =0x02024084 + ldr r0, =0x0202420c + mov r8, r0 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x20 + ldrb r6, [r0] + cmp r6, 0x19 + bne _0804C7E6 + movs r5, 0x29 + ands r5, r4 + cmp r5, 0 + bne _0804C7E6 + ldr r0, =0x0202420b + ldrb r0, [r0] + ldr r7, =0x020241ea + ldrh r1, [r7] + bl move_weather_interaction + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x2 + bne _0804C7E6 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _0804C7AC + movs r0, 0x6 + ands r4, r0 + cmp r4, 0x6 + bne _0804C7E6 +_0804C7AC: + ldr r2, =gBattleMoves + ldrh r1, [r7] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0 + beq _0804C7E6 + ldr r3, =0x0202420a + strb r6, [r3] + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024250 + mov r2, r8 + ldrb r0, [r2] + lsls r0, 1 + adds r0, r1 + strh r5, [r0] + ldr r1, =0x02024332 + movs r0, 0x3 + strb r0, [r1, 0x6] + ldrb r0, [r2] + ldrb r1, [r3] + bl b_history__record_ability_usage_of_player +_0804C7E6: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0804C804 + ldr r2, =0x0202433c + ldr r0, =0x0202420b + ldrb r1, [r0] + lsls r1, 4 + adds r1, r2 + ldrb r0, [r1, 0x1] + movs r2, 0x2 + orrs r0, r2 + strb r0, [r1, 0x1] +_0804C804: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk4A_damagecalc2 + + thumb_func_start atk4B_cmd4b +atk4B_cmd4b: @ 804C844 + push {r4,lr} + ldr r4, =0x02024064 + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r4] + ldr r2, =0x02024280 + ldr r1, =gUnknown_0832A328 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + lsls r1, 28 + ldr r0, [r2] + ands r0, r1 + cmp r0, 0 + bne _0804C872 + movs r0, 0 + movs r1, 0 + bl dp01_build_cmdbuf_x06_a + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0804C872: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk4B_cmd4b + + thumb_func_start atk4C_switch1 +atk4C_switch1: @ 804C894 + push {r4,r5,lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0804C8E4 + ldr r5, =0x02024214 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r4, =0x02024064 + strb r0, [r4] + ldr r3, =0x0202406e + ldrb r0, [r4] + lsls r2, r0, 1 + adds r2, r3 + ldr r1, =0x0202449c + ldr r1, [r1] + adds r0, r1 + adds r0, 0x5C + ldrb r0, [r0] + strh r0, [r2] + ldr r1, =gUnknown_0832A328 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0] + movs r0, 0 + movs r1, 0 + bl dp01_build_cmdbuf_x00_a_b_0 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r5] + adds r0, 0x2 + str r0, [r5] +_0804C8E4: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk4C_switch1 + + thumb_func_start sub_804C904 +sub_804C904: @ 804C904 + push {r4-r7,lr} + sub sp, 0x58 + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + beq _0804C912 + b _0804CAA4 +_0804C912: + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r4, =0x02024064 + strb r0, [r4] + ldr r6, =0x02024084 + ldrb r0, [r4] + movs r5, 0x58 + adds r1, r0, 0 + muls r1, r5 + adds r1, r6 + mov r0, sp + movs r2, 0x58 + bl memcpy + ldrb r0, [r4] + muls r0, r5 + adds r3, r0, r6 + movs r2, 0 + ldr r5, =0x02023864 +_0804C93E: + adds r0, r3, r2 + ldrb r1, [r4] + lsls r1, 9 + adds r1, 0x4 + adds r1, r2, r1 + adds r1, r5 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x57 + bls _0804C93E + ldr r4, =0x02024084 + ldr r6, =0x02024064 + ldrb r0, [r6] + movs r7, 0x58 + adds r2, r0, 0 + muls r2, r7 + adds r2, r4 + ldr r3, =gBaseStats + ldrh r1, [r2] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x6] + adds r2, 0x21 + strb r0, [r2] + ldrb r0, [r6] + adds r1, r0, 0 + muls r1, r7 + adds r1, r4 + ldrh r2, [r1] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x7] + adds r1, 0x22 + strb r0, [r1] + ldrb r0, [r6] + adds r1, r0, 0 + muls r1, r7 + adds r1, r4 + ldrh r0, [r1] + ldrb r1, [r1, 0x17] + lsrs r1, 7 + bl sub_806B694 + ldrb r1, [r6] + muls r1, r7 + adds r1, r4 + adds r1, 0x20 + strb r0, [r1] + ldrb r0, [r6] + bl battle_side_get_owner + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x020243d0 + adds r0, 0x29 + adds r0, r2, r0 + ldrb r1, [r0] + ldr r3, =gUnknown_0832A328 + ldr r2, =0x0202406e + ldrb r5, [r6] + lsls r0, r5, 1 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + ands r1, r0 + mov r12, r4 + cmp r1, 0 + beq _0804C9DE + adds r0, r5, 0 + muls r0, r7 + add r0, r12 + movs r1, 0 + strh r1, [r0, 0x2E] +_0804C9DE: + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0x7F + bne _0804CA26 + movs r2, 0 + adds r4, r6, 0 + movs r6, 0x58 + mov r5, r12 + adds r5, 0x18 + add r3, sp, 0x18 +_0804C9FE: + ldrb r0, [r4] + adds r1, r0, 0 + muls r1, r6 + adds r1, r2, r1 + adds r1, r5 + adds r0, r3, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r2, 0x1 + cmp r2, 0x7 + ble _0804C9FE + ldr r0, =0x02024064 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + mov r1, r12 + adds r1, 0x50 + adds r0, r1 + ldr r1, [sp, 0x50] + str r1, [r0] +_0804CA26: + bl sub_803A284 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _0804CA78 + ldr r4, =0x02024084 + ldr r0, =0x02024064 + ldrb r3, [r0] + movs r0, 0x58 + adds r2, r3, 0 + muls r2, r0 + adds r1, r2, r4 + ldrh r0, [r1, 0x2C] + lsrs r0, 1 + ldrh r1, [r1, 0x28] + cmp r0, r1 + bcc _0804CA78 + cmp r1, 0 + beq _0804CA78 + adds r0, r4, 0 + adds r0, 0x4C + adds r0, r2, r0 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + bne _0804CA78 + ldr r0, =0x0202449c + ldr r2, [r0] + adds r2, 0x92 + ldr r1, =gUnknown_0832A328 + lsls r0, r3, 2 + adds r0, r1 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] +_0804CA78: + ldr r0, =0x02024474 + ldr r3, =0x02024064 + ldrb r2, [r3] + strb r2, [r0, 0x17] + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x7 + strb r0, [r1, 0x1] + strb r2, [r1, 0x2] + ldr r2, =0x0202406e + ldrb r0, [r3] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] +_0804CAA4: + add sp, 0x58 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_804C904 + + thumb_func_start atk4E_switch3 +atk4E_switch3: @ 804CAE8 + push {r4-r6,lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0804CB86 + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r6, =0x02024064 + strb r0, [r6] + ldrb r0, [r6] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0804CB3E + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x063f0902 + ands r0, r1 + cmp r0, 0 + bne _0804CB3E + ldr r4, =0x02024084 + ldrb r0, [r6] + movs r5, 0x58 + muls r0, r5 + adds r0, r4 + ldrh r0, [r0] + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r6] + muls r1, r5 + adds r4, 0x48 + adds r1, r4 + ldr r2, [r1] + movs r1, 0x2 + bl SetPokedexFlag +_0804CB3E: + ldr r2, =0x02024210 + ldr r1, =gUnknown_0832A328 + ldr r5, =0x02024064 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldrb r0, [r2] + bics r0, r1 + strb r0, [r2] + ldr r1, =0x0202406e + ldrb r0, [r5] + lsls r0, 1 + adds r0, r1 + ldrb r1, [r0] + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r2, [r0, 0x2] + movs r0, 0 + bl dp01_build_cmdbuf_x05_a_b_c + ldrb r0, [r5] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r4] + adds r0, 0x3 + str r0, [r4] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _0804CB86 + bl sub_81A56B4 +_0804CB86: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atk4E_switch3 + + thumb_func_start atk4F_jumpifcannotswitch +atk4F_jumpifcannotswitch: @ 804CBB0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r1, [r0, 0x1] + movs r0, 0x7F + ands r0, r1 + bl get_battle_side_of_something + ldr r3, =0x02024064 + strb r0, [r3] + ldr r2, [r4] + ldrb r1, [r2, 0x1] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0804CC28 + ldr r1, =0x02024084 + ldrb r3, [r3] + movs r0, 0x58 + muls r0, r3 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + ldr r1, =0x0400e000 + ands r0, r1 + cmp r0, 0 + bne _0804CBFC + ldr r1, =0x020242ac + lsls r0, r3, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 3 + ands r0, r1 + cmp r0, 0 + beq _0804CC28 +_0804CBFC: + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _0804CF00 + .pool +_0804CC28: + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 15 + ands r0, r1 + cmp r0, 0 + beq _0804CCC0 + ldr r5, =0x02024064 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x020244ec + mov r8, r1 + cmp r0, 0x1 + bne _0804CC4E + ldr r0, =0x02024744 + mov r8, r0 +_0804CC4E: + movs r4, 0 + ldrb r1, [r5] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0804CC5C + movs r4, 0x3 +_0804CC5C: + adds r6, r4, 0x3 + cmp r4, r6 + bge _0804CCA4 + ldr r7, =0x0202406e +_0804CC64: + movs r0, 0x64 + muls r0, r4 + mov r1, r8 + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _0804CC9E + adds r0, r5, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _0804CC9E + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _0804CC9E + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + cmp r0, r4 + bne _0804CCA4 +_0804CC9E: + adds r4, 0x1 + cmp r4, r6 + blt _0804CC64 +_0804CCA4: + cmp r4, r6 + bne _0804CCAA + b _0804CED0 +_0804CCAA: + b _0804CEF8 + .pool +_0804CCC0: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0804CD8C + movs r0, 0x80 + lsls r0, 16 + ands r1, r0 + cmp r1, 0 + beq _0804CD00 + ldr r5, =0x02024064 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0804CCEC + ldr r0, =0x020244ec + b _0804CD16 + .pool +_0804CCEC: + ldr r1, =0x02024744 + mov r8, r1 + ldrb r0, [r5] + movs r4, 0x3 + cmp r0, 0x1 + bne _0804CD32 + movs r4, 0 + b _0804CD32 + .pool +_0804CD00: + ldr r5, =0x02024064 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x020244ec + mov r8, r1 + cmp r0, 0x1 + bne _0804CD18 + ldr r0, =0x02024744 +_0804CD16: + mov r8, r0 +_0804CD18: + movs r4, 0 + ldrb r0, [r5] + bl sub_806D864 + lsls r0, 24 + lsrs r0, 24 + bl sub_806D82C + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bne _0804CD32 + movs r4, 0x3 +_0804CD32: + adds r6, r4, 0x3 + cmp r4, r6 + bge _0804CCA4 + ldr r7, =0x0202406e +_0804CD3A: + movs r0, 0x64 + muls r0, r4 + mov r1, r8 + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _0804CD74 + adds r0, r5, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _0804CD74 + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _0804CD74 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + cmp r0, r4 + bne _0804CCA4 +_0804CD74: + adds r4, 0x1 + cmp r4, r6 + blt _0804CD3A + b _0804CCA4 + .pool +_0804CD8C: + movs r0, 0x80 + lsls r0, 8 + ands r1, r0 + cmp r1, 0 + beq _0804CE10 + ldr r5, =0x02024064 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0804CE10 + ldr r0, =0x02024744 + mov r8, r0 + movs r4, 0 + ldrb r0, [r5] + cmp r0, 0x3 + bne _0804CDB4 + movs r4, 0x3 +_0804CDB4: + adds r6, r4, 0x3 + cmp r4, r6 + blt _0804CDBC + b _0804CCA4 +_0804CDBC: + ldr r7, =0x0202406e +_0804CDBE: + movs r0, 0x64 + muls r0, r4 + mov r1, r8 + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _0804CDFA + adds r0, r5, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _0804CDFA + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _0804CDFA + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + cmp r0, r4 + beq _0804CDFA + b _0804CCA4 +_0804CDFA: + adds r4, 0x1 + cmp r4, r6 + blt _0804CDBE + b _0804CCA4 + .pool +_0804CE10: + ldr r0, =0x02024064 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bne _0804CE54 + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x02022fec + ldr r0, [r0] + ands r0, r4 + cmp r0, 0 + beq _0804CE48 + movs r0, 0x3 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r6, r0, 24 + b _0804CE4A + .pool +_0804CE48: + adds r6, r7, 0 +_0804CE4A: + ldr r0, =0x02024744 + mov r8, r0 + b _0804CE82 + .pool +_0804CE54: + movs r0, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0804CE7C + movs r0, 0x2 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r6, r0, 24 + b _0804CE7E + .pool +_0804CE7C: + adds r6, r7, 0 +_0804CE7E: + ldr r1, =0x020244ec + mov r8, r1 +_0804CE82: + movs r4, 0 +_0804CE84: + movs r0, 0x64 + muls r0, r4 + mov r1, r8 + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _0804CEC6 + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _0804CEC6 + adds r0, r5, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _0804CEC6 + ldr r1, =0x0202406e + lsls r0, r7, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r4, r0 + beq _0804CEC6 + lsls r0, r6, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r4, r0 + bne _0804CECC +_0804CEC6: + adds r4, 0x1 + cmp r4, 0x5 + ble _0804CE84 +_0804CECC: + cmp r4, 0x6 + bne _0804CEF8 +_0804CED0: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _0804CF00 + .pool +_0804CEF8: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x6 + str r0, [r1] +_0804CF00: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk4F_jumpifcannotswitch + + thumb_func_start sub_804CF10 +sub_804CF10: @ 804CF10 + push {r4,r5,lr} + sub sp, 0x4 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r5, =0x02024064 + ldrb r0, [r5] + ldr r4, =0x0202449c + ldr r1, [r4] + adds r1, r0, r1 + adds r1, 0x58 + ldr r3, =0x0202406e + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + strb r0, [r1] + ldrb r0, [r5] + ldr r1, [r4] + adds r0, r1 + adds r0, 0x5C + movs r1, 0x6 + strb r1, [r0] + ldr r1, [r4] + adds r1, 0x93 + ldr r3, =gUnknown_0832A328 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r3 + ldr r3, [r0] + ldrb r0, [r1] + bics r0, r3 + strb r0, [r1] + ldrb r0, [r5] + lsls r1, r0, 1 + adds r1, r0 + adds r1, 0x60 + ldr r0, [r4] + adds r0, r1 + str r0, [sp] + movs r0, 0 + movs r1, 0x1 + movs r3, 0 + bl dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f + ldrb r0, [r5] + bl dp01_battle_side_mark_buffer_for_execution + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_804CF10 + + thumb_func_start atk50_openpartyscreen +atk50_openpartyscreen: @ 804CF88 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + movs r7, 0 + movs r0, 0 + mov r9, r0 + ldr r6, =0x02024214 + ldr r2, [r6] + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + orrs r1, r0 + mov r8, r1 + ldrb r1, [r2, 0x1] + adds r0, r1, 0 + mov r12, r6 + cmp r0, 0x5 + beq _0804CFBE + b _0804D464 +_0804CFBE: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x41 + ands r1, r0 + cmp r1, 0x1 + beq _0804D0B0 + ldr r1, =0x02024064 + strb r7, [r1] + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r7, r0 + bcc _0804CFD8 + b _0804D450 +_0804CFD8: + ldr r7, =0x02024280 + ldr r6, =gUnknown_0832A328 + adds r4, r1, 0 + ldr r2, =0x02024210 + mov r8, r2 +_0804CFE2: + ldrb r2, [r4] + lsls r0, r2, 2 + adds r0, r6 + ldr r1, [r0] + lsls r1, 28 + ldr r0, [r7] + ands r0, r1 + cmp r0, 0 + beq _0804D088 + adds r0, r2, 0 + movs r1, 0x6 + movs r2, 0x6 + bl sub_80423F4 + lsls r0, 24 + cmp r0, 0 + beq _0804D054 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + mov r2, r8 + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + ldrb r0, [r4] + lsls r0, 2 + adds r0, r6 + ldr r1, [r0] + lsls r1, 28 + ldr r0, [r7] + bics r0, r1 + str r0, [r7] + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + bl sub_8034464 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + b _0804D098 + .pool +_0804D054: + ldr r5, =0x0202437c + ldrb r0, [r4] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r0, [r1] + lsls r0, 25 + cmp r0, 0 + blt _0804D098 + movs r0, 0x6 + bl sub_804CF10 + ldrb r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + b _0804D098 + .pool +_0804D088: + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + bl sub_8034464 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0804D098: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _0804CFE2 + b _0804D450 + .pool +_0804D0B0: + ands r0, r1 + cmp r0, 0 + bne _0804D0B8 + b _0804D450 +_0804D0B8: + ldr r0, =0x02024280 + mov r8, r0 + ldr r0, [r0] + lsrs r5, r0, 28 + ldr r6, =gUnknown_0832A328 + ldr r0, [r6] + ands r0, r5 + cmp r0, 0 + beq _0804D170 + ldr r4, =0x02024064 + strb r7, [r4] + movs r0, 0 + movs r1, 0x6 + movs r2, 0x6 + bl sub_80423F4 + lsls r0, 24 + cmp r0, 0 + beq _0804D120 + ldr r2, =0x02024210 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + ldrb r0, [r4] + lsls r0, 2 + adds r0, r6 + ldr r1, [r0] + lsls r1, 28 + mov r2, r8 + ldr r0, [r2] + bics r0, r1 + str r0, [r2] + movs r0, 0 + bl dp01_build_cmdbuf_x2A_2A_2A_2A + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + b _0804D170 + .pool +_0804D120: + ldr r6, =0x0202437c + ldrb r0, [r4] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r0, [r1] + lsls r0, 25 + cmp r0, 0 + blt _0804D15C + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x5E + ldrb r0, [r0] + bl sub_804CF10 + ldrb r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + b _0804D170 + .pool +_0804D15C: + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + bl sub_8034464 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + movs r0, 0x1 + mov r9, r0 +_0804D170: + ldr r6, =gUnknown_0832A328 + ldr r0, [r6, 0x8] + ands r0, r5 + cmp r0, 0 + beq _0804D22E + ldr r0, [r6] + ands r0, r5 + cmp r0, 0 + bne _0804D22E + ldr r4, =0x02024064 + movs r0, 0x2 + strb r0, [r4] + movs r0, 0x2 + movs r1, 0x6 + movs r2, 0x6 + bl sub_80423F4 + lsls r0, 24 + cmp r0, 0 + beq _0804D1D8 + ldr r2, =0x02024210 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + ldr r2, =0x02024280 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r6 + ldr r1, [r0] + lsls r1, 28 + ldr r0, [r2] + bics r0, r1 + str r0, [r2] + movs r0, 0 + bl dp01_build_cmdbuf_x2A_2A_2A_2A + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + b _0804D22E + .pool +_0804D1D8: + ldr r6, =0x0202437c + ldrb r0, [r4] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r0, [r1] + lsls r0, 25 + cmp r0, 0 + blt _0804D214 + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x5C + ldrb r0, [r0] + bl sub_804CF10 + ldrb r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + b _0804D22E + .pool +_0804D214: + movs r0, 0x1 + mov r1, r9 + ands r0, r1 + cmp r0, 0 + bne _0804D22E + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + bl sub_8034464 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0804D22E: + ldr r6, =gUnknown_0832A328 + ldr r0, [r6, 0x4] + ands r0, r5 + cmp r0, 0 + beq _0804D2E4 + ldr r4, =0x02024064 + movs r0, 0x1 + strb r0, [r4] + movs r0, 0x1 + movs r1, 0x6 + movs r2, 0x6 + bl sub_80423F4 + lsls r0, 24 + cmp r0, 0 + beq _0804D290 + ldr r2, =0x02024210 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + ldr r2, =0x02024280 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r6 + ldr r1, [r0] + lsls r1, 28 + ldr r0, [r2] + bics r0, r1 + str r0, [r2] + movs r0, 0 + bl dp01_build_cmdbuf_x2A_2A_2A_2A + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + b _0804D2E4 + .pool +_0804D290: + ldr r6, =0x0202437c + ldrb r0, [r4] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r0, [r1] + lsls r0, 25 + cmp r0, 0 + blt _0804D2CC + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x5F + ldrb r0, [r0] + bl sub_804CF10 + ldrb r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + b _0804D2E4 + .pool +_0804D2CC: + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + bl sub_8034464 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + movs r0, 0x2 + mov r2, r9 + orrs r2, r0 + mov r9, r2 +_0804D2E4: + ldr r6, =gUnknown_0832A328 + ldr r0, [r6, 0xC] + ands r0, r5 + cmp r0, 0 + beq _0804D3A2 + ldr r0, [r6, 0x4] + ands r0, r5 + cmp r0, 0 + bne _0804D3A2 + ldr r4, =0x02024064 + movs r0, 0x3 + strb r0, [r4] + movs r0, 0x3 + movs r1, 0x6 + movs r2, 0x6 + bl sub_80423F4 + lsls r0, 24 + cmp r0, 0 + beq _0804D34C + ldr r2, =0x02024210 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + ldr r2, =0x02024280 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r6 + ldr r1, [r0] + lsls r1, 28 + ldr r0, [r2] + bics r0, r1 + str r0, [r2] + movs r0, 0 + bl dp01_build_cmdbuf_x2A_2A_2A_2A + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + b _0804D3A2 + .pool +_0804D34C: + ldr r6, =0x0202437c + ldrb r0, [r4] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r0, [r1] + lsls r0, 25 + cmp r0, 0 + blt _0804D388 + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x5D + ldrb r0, [r0] + bl sub_804CF10 + ldrb r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + b _0804D3A2 + .pool +_0804D388: + movs r0, 0x2 + mov r1, r9 + ands r1, r0 + cmp r1, 0 + bne _0804D3A2 + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + bl sub_8034464 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0804D3A2: + ldr r1, =0x0202437c + ldrb r0, [r1] + lsls r0, 25 + cmp r0, 0 + blt _0804D3FA + adds r0, r1, 0 + adds r0, 0x28 + ldrb r0, [r0] + lsls r0, 25 + cmp r0, 0 + blt _0804D3FA + cmp r5, 0 + beq _0804D3FA + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r0, =gUnknown_0832A328 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _0804D3E4 + ldr r1, =0x02024064 + movs r0, 0x2 + strb r0, [r1] + b _0804D3E8 + .pool +_0804D3E4: + ldr r0, =0x02024064 + strb r1, [r0] +_0804D3E8: + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + bl sub_8034464 + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution +_0804D3FA: + ldr r1, =0x0202437c + ldrb r0, [r1, 0x14] + lsls r0, 25 + cmp r0, 0 + blt _0804D450 + adds r0, r1, 0 + adds r0, 0x3C + ldrb r0, [r0] + lsls r0, 25 + cmp r0, 0 + blt _0804D450 + cmp r5, 0 + beq _0804D450 + ldr r0, =0x02024210 + ldrb r0, [r0] + ldr r1, =gUnknown_0832A328 + ldr r1, [r1, 0x4] + ands r0, r1 + cmp r0, 0 + beq _0804D438 + ldr r1, =0x02024064 + movs r0, 0x3 + b _0804D43C + .pool +_0804D438: + ldr r1, =0x02024064 + movs r0, 0x1 +_0804D43C: + strb r0, [r1] + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + bl sub_8034464 + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution +_0804D450: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x6 + str r0, [r1] + b _0804D804 + .pool +_0804D464: + cmp r0, 0x6 + beq _0804D46A + b _0804D658 +_0804D46A: + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0804D478 + b _0804D5F4 +_0804D478: + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + bne _0804D482 + b _0804D5F4 +_0804D482: + ldr r7, =0x02024280 + ldr r0, [r7] + lsrs r5, r0, 28 + ldr r4, =gUnknown_0832A328 + ldr r0, [r4, 0x8] + ands r0, r5 + cmp r0, 0 + beq _0804D52A + ldr r0, [r4] + ands r0, r5 + cmp r0, 0 + beq _0804D52A + ldr r6, =0x02024064 + movs r0, 0x2 + strb r0, [r6] + ldr r0, =0x02023864 + ldrb r1, [r0, 0x1] + movs r0, 0x2 + movs r2, 0x6 + bl sub_80423F4 + lsls r0, 24 + cmp r0, 0 + beq _0804D4F8 + ldr r2, =0x02024210 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + ldrb r0, [r6] + lsls r0, 2 + adds r0, r4 + ldr r1, [r0] + lsls r1, 28 + ldr r0, [r7] + bics r0, r1 + str r0, [r7] + movs r0, 0 + bl dp01_build_cmdbuf_x2A_2A_2A_2A + ldrb r0, [r6] + bl dp01_battle_side_mark_buffer_for_execution + b _0804D52A + .pool +_0804D4F8: + ldr r4, =0x0202437c + ldrb r0, [r6] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r1] + lsls r0, 25 + cmp r0, 0 + blt _0804D52A + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x5C + ldrb r0, [r0] + bl sub_804CF10 + ldrb r1, [r6] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] +_0804D52A: + ldr r4, =gUnknown_0832A328 + ldr r0, [r4, 0xC] + ands r0, r5 + cmp r0, 0 + beq _0804D5DA + ldr r0, [r4, 0x4] + ands r5, r0 + cmp r5, 0 + beq _0804D5DA + ldr r5, =0x02024064 + movs r0, 0x3 + strb r0, [r5] + ldr r0, =0x02023864 + ldr r2, =0x00000201 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x3 + movs r2, 0x6 + bl sub_80423F4 + lsls r0, 24 + cmp r0, 0 + beq _0804D5A8 + ldr r2, =0x02024210 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + ldr r2, =0x02024280 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r4 + ldr r1, [r0] + lsls r1, 28 + ldr r0, [r2] + bics r0, r1 + str r0, [r2] + movs r0, 0 + bl dp01_build_cmdbuf_x2A_2A_2A_2A + ldrb r0, [r5] + bl dp01_battle_side_mark_buffer_for_execution + b _0804D5DA + .pool +_0804D5A8: + ldr r4, =0x0202437c + ldrb r0, [r5] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r1] + lsls r0, 25 + cmp r0, 0 + blt _0804D5DA + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x5D + ldrb r0, [r0] + bl sub_804CF10 + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] +_0804D5DA: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x6 + str r0, [r1] + mov r12, r1 + b _0804D5F8 + .pool +_0804D5F4: + adds r0, r2, 0x6 + str r0, [r6] +_0804D5F8: + ldr r0, =0x02024280 + ldr r0, [r0] + lsrs r5, r0, 28 + ldr r1, =0x0202420d + movs r0, 0 + strb r0, [r1] + ldr r4, =gUnknown_0832A328 + ldr r2, [r4] + ands r2, r5 + ldr r6, =0x0202406c + cmp r2, 0 + bne _0804D634 + adds r7, r6, 0 + ldrb r0, [r6] + cmp r2, r0 + bcs _0804D634 + adds r3, r1, 0 +_0804D61A: + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + ldrb r2, [r3] + lsls r0, r2, 2 + adds r0, r4 + ldr r0, [r0] + ands r0, r5 + cmp r0, 0 + bne _0804D634 + ldrb r0, [r7] + cmp r2, r0 + bcc _0804D61A +_0804D634: + ldrb r0, [r1] + ldrb r6, [r6] + cmp r0, r6 + beq _0804D63E + b _0804D804 +_0804D63E: + mov r1, r8 + mov r2, r12 + str r1, [r2] + b _0804D804 + .pool +_0804D658: + movs r0, 0x80 + ands r0, r1 + movs r5, 0x1 + cmp r0, 0 + beq _0804D664 + movs r5, 0 +_0804D664: + movs r0, 0x7F + ands r0, r1 + bl get_battle_side_of_something + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =0x0202437c + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 25 + cmp r0, 0 + bge _0804D690 + ldr r0, [r6] + adds r0, 0x6 + str r0, [r6] + b _0804D804 + .pool +_0804D690: + adds r0, r7, 0 + movs r1, 0x6 + movs r2, 0x6 + bl sub_80423F4 + lsls r0, 24 + cmp r0, 0 + beq _0804D6E0 + ldr r2, =0x02024064 + strb r7, [r2] + ldr r3, =0x02024210 + ldr r4, =gUnknown_0832A328 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + ldrb r1, [r3] + orrs r0, r1 + strb r0, [r3] + ldr r3, =0x02024280 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r4 + ldr r1, [r0] + lsls r1, 28 + ldr r0, [r3] + bics r0, r1 + str r0, [r3] + mov r0, r8 + str r0, [r6] + b _0804D804 + .pool +_0804D6E0: + ldr r4, =0x02024064 + strb r7, [r4] + ldrb r0, [r4] + ldr r3, =0x0202449c + ldr r1, [r3] + adds r1, r0, r1 + adds r1, 0x58 + ldr r2, =0x0202406e + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + strb r0, [r1] + ldrb r0, [r4] + ldr r1, [r3] + adds r0, r1 + adds r0, 0x5C + movs r1, 0x6 + strb r1, [r0] + ldr r1, [r3] + adds r1, 0x93 + ldr r2, =gUnknown_0832A328 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r2 + ldr r2, [r0] + ldrb r0, [r1] + bics r0, r2 + strb r0, [r1] + ldrb r1, [r4] + movs r0, 0x2 + eors r0, r1 + ldr r3, [r3] + adds r0, r3 + adds r0, 0x5C + ldrb r2, [r0] + ldrb r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + adds r0, 0x60 + adds r3, r0 + str r3, [sp] + movs r0, 0 + adds r1, r5, 0 + movs r3, 0 + bl dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r6] + adds r0, 0x6 + str r0, [r6] + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + cmp r0, 0 + bne _0804D760 + ldr r1, =0x03005d10 + ldrb r0, [r1, 0x2] + cmp r0, 0xFE + bhi _0804D760 + adds r0, 0x1 + strb r0, [r1, 0x2] +_0804D760: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0804D7C4 + ldr r1, =0x02024064 + movs r0, 0 + strb r0, [r1] + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r0, 0 + beq _0804D804 + adds r4, r1, 0 +_0804D77C: + ldrb r0, [r4] + cmp r0, r7 + beq _0804D792 + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + bl sub_8034464 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0804D792: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _0804D77C + b _0804D804 + .pool +_0804D7C4: + adds r0, r7, 0 + bl battle_get_per_side_status + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + ldr r4, =0x02024064 + strb r0, [r4] + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + ldrb r3, [r4] + lsls r0, r3, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _0804D7F4 + movs r0, 0x2 + eors r3, r0 + strb r3, [r4] +_0804D7F4: + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + bl sub_8034464 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0804D804: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk50_openpartyscreen + + thumb_func_start atk51_cmd51 +atk51_cmd51: @ 804D820 + push {r4-r7,lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + beq _0804D82C + b _0804DA8A +_0804D82C: + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r5, =0x02024064 + strb r0, [r5] + ldr r0, [r4] + ldrb r0, [r0, 0x2] + cmp r0, 0x1 + beq _0804D8CC + cmp r0, 0x1 + bgt _0804D858 + cmp r0, 0 + beq _0804D862 + b _0804DA82 + .pool +_0804D858: + cmp r0, 0x2 + beq _0804D8E8 + cmp r0, 0x3 + beq _0804D922 + b _0804DA82 +_0804D862: + movs r6, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r6, r0 + blt _0804D86E + b _0804DA82 +_0804D86E: + ldr r7, =0x02023864 +_0804D870: + ldrb r0, [r7] + cmp r0, 0x22 + bne _0804D8AA + ldr r5, =0x0202449c + ldr r0, [r5] + adds r0, r6, r0 + adds r0, 0x5C + ldrb r1, [r7, 0x1] + strb r1, [r0] + ldr r0, [r5] + adds r0, 0x93 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + lsls r0, r6, 2 + adds r0, r2 + ldr r4, [r0] + ands r1, r4 + cmp r1, 0 + bne _0804D8AA + lsls r0, r6, 24 + lsrs r0, 24 + ldrb r1, [r7, 0x1] + bl sub_8184FBC + ldr r1, [r5] + adds r1, 0x93 + ldrb r0, [r1] + orrs r4, r0 + strb r4, [r1] +_0804D8AA: + movs r0, 0x80 + lsls r0, 2 + adds r7, r0 + adds r6, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r6, r0 + blt _0804D870 + b _0804DA82 + .pool +_0804D8CC: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0804D8DA + b _0804DA82 +_0804D8DA: + ldrb r0, [r5] + bl sub_803BDA0 + b _0804DA82 + .pool +_0804D8E8: + ldr r4, =0x0202449c + ldr r0, [r4] + adds r0, 0x93 + ldrb r1, [r0] + ldr r6, =gUnknown_0832A328 + ldrb r2, [r5] + lsls r0, r2, 2 + adds r0, r6 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0804D922 + ldr r0, =0x02023864 + lsls r1, r2, 9 + adds r0, 0x1 + adds r1, r0 + ldrb r1, [r1] + adds r0, r2, 0 + bl sub_8184FBC + ldr r2, [r4] + adds r2, 0x93 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] +_0804D922: + ldr r1, =0x02024332 + ldr r6, =0x02023864 + ldr r7, =0x02024064 + ldrb r0, [r7] + lsls r0, 9 + adds r2, r6, 0x1 + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + ldrb r0, [r7] + ldr r1, =0x0202449c + mov r12, r1 + ldr r1, [r1] + adds r1, r0, r1 + adds r1, 0x5C + lsls r0, 9 + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x42 + ands r0, r1 + cmp r0, 0x42 + bne _0804DA14 + ldrb r0, [r7] + mov r3, r12 + ldr r2, [r3] + lsls r1, r0, 1 + adds r1, r0 + adds r1, r2 + adds r1, 0x60 + ldrb r2, [r1] + movs r0, 0xF + ands r0, r2 + strb r0, [r1] + ldrb r0, [r7] + ldr r2, [r3] + lsls r1, r0, 1 + adds r1, r0 + adds r1, r2 + adds r1, 0x60 + lsls r0, 9 + adds r5, r6, 0x2 + adds r0, r5 + ldrb r2, [r0] + movs r3, 0xF0 + adds r0, r3, 0 + ands r0, r2 + ldrb r2, [r1] + orrs r0, r2 + strb r0, [r1] + ldrb r1, [r7] + mov r0, r12 + ldr r2, [r0] + lsls r0, r1, 1 + adds r0, r1 + adds r0, r2 + adds r0, 0x61 + lsls r1, 9 + adds r6, 0x3 + adds r1, r6 + ldrb r1, [r1] + strb r1, [r0] + ldrb r0, [r7] + movs r4, 0x2 + eors r0, r4 + mov r1, r12 + ldr r2, [r1] + lsls r1, r0, 1 + adds r1, r0 + adds r1, r2 + adds r1, 0x60 + ldrb r2, [r1] + adds r0, r3, 0 + ands r0, r2 + strb r0, [r1] + ldrb r0, [r7] + eors r0, r4 + mov r1, r12 + ldr r2, [r1] + lsls r1, r0, 1 + adds r1, r0 + adds r1, r2 + adds r1, 0x60 + ldrb r0, [r7] + lsls r0, 9 + adds r0, r5 + ldrb r0, [r0] + ands r3, r0 + lsrs r3, 4 + ldrb r0, [r1] + orrs r3, r0 + strb r3, [r1] + ldrb r0, [r7] + eors r4, r0 + mov r2, r12 + ldr r0, [r2] + lsls r1, r4, 1 + adds r1, r4 + adds r1, r0 + adds r1, 0x62 + ldrb r0, [r7] + lsls r0, 9 + adds r0, r6 + ldrb r0, [r0] + strb r0, [r1] + b _0804DA36 + .pool +_0804DA14: + movs r0, 0x80 + lsls r0, 15 + ands r1, r0 + cmp r1, 0 + beq _0804DA30 + ldrb r0, [r7] + mov r3, r12 + ldr r1, [r3] + adds r1, r0, r1 + adds r1, 0x5C + ldrb r1, [r1] + bl sub_80571DC + b _0804DA36 +_0804DA30: + ldrb r0, [r7] + bl sub_803BDA0 +_0804DA36: + ldr r1, =0x02022f58 + movs r5, 0xFD + strb r5, [r1] + movs r0, 0x6 + strb r0, [r1, 0x1] + ldr r4, =0x02024084 + ldr r3, =0x0202420b + ldrb r0, [r3] + movs r2, 0x58 + muls r0, r2 + adds r0, r4 + ldrh r0, [r0] + strb r0, [r1, 0x2] + ldrb r0, [r3] + muls r0, r2 + adds r0, r4 + ldrh r0, [r0] + lsrs r0, 8 + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r2, =0x02022f68 + strb r5, [r2] + movs r0, 0x7 + strb r0, [r2, 0x1] + ldr r3, =0x02024064 + ldrb r0, [r3] + strb r0, [r2, 0x2] + ldr r1, =0x02023864 + ldrb r0, [r3] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2, 0x3] + movs r0, 0x1 + negs r0, r0 + strb r0, [r2, 0x4] +_0804DA82: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x3 + str r0, [r1] +_0804DA8A: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk51_cmd51 + + thumb_func_start atk52_cmd52 +atk52_cmd52: @ 804DAAC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r0, =0x02024214 + mov r9, r0 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r4, =0x02024064 + strb r0, [r4] + ldrb r0, [r4] + bl sub_803FA70 + ldr r1, =0x02024280 + mov r8, r1 + ldr r1, =gUnknown_0832A328 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + lsls r1, 28 + mov r2, r8 + ldr r0, [r2] + bics r0, r1 + str r0, [r2] + ldr r2, =0x0202437c + ldrb r0, [r4] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1] + movs r0, 0x41 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldrb r0, [r4] + bl battle_side_get_owner + ldr r5, =0x0202428e + lsls r0, 24 + lsrs r0, 23 + adds r0, r5 + ldrh r1, [r0] + movs r7, 0x80 + lsls r7, 2 + mov r10, r7 + mov r0, r10 + ands r0, r1 + cmp r0, 0 + beq _0804DB1C + b _0804DC30 +_0804DB1C: + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 23 + adds r0, r5 + ldrh r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _0804DB34 + b _0804DC30 +_0804DB34: + ldr r7, =0x02024084 + ldrb r2, [r4] + movs r6, 0x58 + adds r0, r2, 0 + muls r0, r6 + adds r1, r0, r7 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0x2 + beq _0804DC30 + adds r0, r1, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0x2 + beq _0804DC30 + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x1A + beq _0804DC30 + adds r0, r2, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 23 + adds r0, r5 + ldrh r2, [r0] + mov r1, r10 + orrs r1, r2 + strh r1, [r0] + ldrb r0, [r4] + adds r2, r0, 0 + muls r2, r6 + adds r0, r7, 0 + adds r0, 0x50 + adds r2, r0 + ldr r0, [r2] + ldr r1, =0xfdffffff + ands r0, r1 + str r0, [r2] + mov r1, r8 + ldr r0, [r1] + movs r2, 0x41 + negs r2, r2 + ands r0, r2 + str r0, [r1] + ldrb r0, [r4] + bl battle_side_get_owner + ldr r2, =0x02024294 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0xA] + movs r1, 0x5 + subs r1, r0 + lsls r1, 25 + lsrs r1, 24 + ldr r5, =0x020241f0 + ldrb r0, [r4] + muls r0, r6 + adds r0, r7 + ldrh r0, [r0, 0x2C] + bl __divsi3 + str r0, [r5] + cmp r0, 0 + bne _0804DBC8 + movs r0, 0x1 + str r0, [r5] +_0804DBC8: + ldr r0, =0x02024474 + ldrb r1, [r4] + strb r1, [r0, 0x17] + bl b_movescr_stack_push_cursor + mov r7, r9 + ldr r0, [r7] + ldrb r0, [r0, 0x1] + cmp r0, 0 + bne _0804DC14 + ldr r0, =gUnknown_082DAE90 + str r0, [r7] + b _0804DD8E + .pool +_0804DC14: + cmp r0, 0x1 + bne _0804DC24 + ldr r0, =gUnknown_082DAE59 + mov r1, r9 + str r0, [r1] + b _0804DD8E + .pool +_0804DC24: + ldr r0, =gUnknown_082DAEC7 + mov r2, r9 + str r0, [r2] + b _0804DD8E + .pool +_0804DC30: + ldr r2, =0x02024084 + ldr r1, =0x02024064 + ldrb r3, [r1] + movs r0, 0x58 + muls r0, r3 + adds r0, r2 + adds r0, 0x20 + ldrb r0, [r0] + adds r5, r1, 0 + ldr r4, =0x020242bc + cmp r0, 0x36 + bne _0804DC5E + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r2, r0, r4 + ldrb r1, [r2, 0x18] + lsls r0, r1, 30 + cmp r0, 0 + blt _0804DC5E + movs r0, 0x1 + orrs r0, r1 + strb r0, [r2, 0x18] +_0804DC5E: + ldrb r0, [r5] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r2, [r1, 0x18] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x18] + ldrb r1, [r5] + movs r0, 0 + str r0, [sp] + movs r2, 0 + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _0804DC88 + b _0804DD8E +_0804DC88: + ldrb r1, [r5] + movs r0, 0 + movs r2, 0 + bl berry_effects_maybe + lsls r0, 24 + cmp r0, 0 + bne _0804DD8E + ldrb r0, [r5] + bl battle_side_get_owner + ldr r1, =0x0202428e + lsls r0, 24 + lsrs r0, 23 + adds r0, r1 + ldrh r2, [r0] + ldr r1, =0x0000fdff + ands r1, r2 + strh r1, [r0] + movs r4, 0 + ldr r0, =0x0202406c + ldrb r7, [r0] + cmp r4, r7 + bge _0804DCD8 + ldr r6, =0x0202407e + adds r1, r5, 0 + ldr r5, =0x0202407a + movs r3, 0xC + adds r2, r0, 0 +_0804DCC2: + adds r0, r4, r6 + ldrb r0, [r0] + ldrb r7, [r1] + cmp r0, r7 + bne _0804DCD0 + adds r0, r4, r5 + strb r3, [r0] +_0804DCD0: + adds r4, 0x1 + ldrb r0, [r2] + cmp r4, r0 + blt _0804DCC2 +_0804DCD8: + movs r4, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + bge _0804DD0C + ldr r6, =0x0202449c + ldr r5, =0x02024084 +_0804DCE6: + lsls r0, r4, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 23 + adds r0, 0xA8 + ldr r1, [r6] + adds r1, r0 + movs r0, 0x58 + muls r0, r4 + adds r0, r5 + ldrh r0, [r0, 0x28] + strh r0, [r1] + adds r4, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _0804DCE6 +_0804DD0C: + ldr r0, =0x02024214 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r5, r0, 0 + cmp r1, 0x5 + bne _0804DD88 + ldr r0, =0x02024280 + ldr r0, [r0] + lsrs r4, r0, 28 + ldr r1, =0x0202420d + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r2, =gUnknown_0832A328 + b _0804DD6E + .pool +_0804DD60: + ldr r0, =0x0202406c + ldrb r3, [r1] + ldrb r0, [r0] + cmp r3, r0 + bcs _0804DD88 + adds r0, r3, 0x1 + strb r0, [r1] +_0804DD6E: + ldrb r0, [r1] + lsls r0, 2 + adds r0, r2 + ldr r3, [r0] + adds r0, r4, 0 + ands r0, r3 + cmp r0, 0 + beq _0804DD60 + ldr r0, =0x02024210 + ldrb r0, [r0] + ands r0, r3 + cmp r0, 0 + bne _0804DD60 +_0804DD88: + ldr r0, [r5] + adds r0, 0x2 + str r0, [r5] +_0804DD8E: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk52_cmd52 + + thumb_func_start sub_804DDA8 +sub_804DDA8: @ 804DDA8 + push {r4,r5,lr} + ldr r5, =0x02024214 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl battle_get_side_with_given_state + ldr r4, =0x02024064 + strb r0, [r4] + movs r0, 0 + bl dp01_build_cmdbuf_x08_8_8_8 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r5] + adds r0, 0x2 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_804DDA8 + + thumb_func_start atk54_802511C +atk54_802511C: @ 804DDD8 + push {r4,r5,lr} + ldr r5, =0x02024064 + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r5] + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r1, [r0, 0x1] + ldrb r0, [r0, 0x2] + lsls r0, 8 + orrs r1, r0 + movs r0, 0 + bl dp01_build_cmdbuf_x2B_aa_0 + ldrb r0, [r5] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r4] + adds r0, 0x3 + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk54_802511C + + thumb_func_start sub_804DE14 +sub_804DE14: @ 804DE14 + push {r4,r5,lr} + ldr r5, =0x02024064 + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r5] + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r1, [r0, 0x1] + ldrb r0, [r0, 0x2] + lsls r0, 8 + orrs r1, r0 + movs r0, 0 + movs r2, 0 + bl sub_8034300 + ldrb r0, [r5] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r4] + adds r0, 0x3 + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_804DE14 + + thumb_func_start atk56_8025194 +atk56_8025194: @ 804DE50 + push {r4,r5,lr} + ldr r5, =0x02024214 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r4, =0x02024064 + strb r0, [r4] + movs r0, 0 + bl dp01_build_cmdbuf_x2D_2D_2D_2D + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r5] + adds r0, 0x2 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk56_8025194 + + thumb_func_start atk57_80251C4_flee +atk57_80251C4_flee: @ 804DE80 + push {r4,lr} + movs r0, 0 + bl battle_get_side_with_given_state + ldr r4, =0x02024064 + strb r0, [r4] + ldr r0, =0x0202433a + ldrb r1, [r0] + movs r0, 0 + bl dp01_build_cmdbuf_x37_a + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk57_80251C4_flee + + thumb_func_start atk58_cmd58 +atk58_cmd58: @ 804DEB8 + push {r4,r5,lr} + ldr r5, =0x02024214 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r4, =0x02024064 + strb r0, [r4] + movs r0, 0 + movs r1, 0x1 + bl dp01_build_cmdbuf_x06_a + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r5] + adds r0, 0x2 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk58_cmd58 + + thumb_func_start atk59_8025230 +atk59_8025230: @ 804DEEC + push {r4-r7,lr} + ldr r0, =0x02024214 + ldr r2, [r0] + ldrb r6, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r6, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r6, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r6, r0 + ldrb r4, [r2, 0x5] + ldrb r0, [r2, 0x6] + lsls r0, 8 + orrs r4, r0 + ldrb r0, [r2, 0x7] + lsls r0, 16 + orrs r4, r0 + ldrb r0, [r2, 0x8] + lsls r0, 24 + orrs r4, r0 + ldr r0, =0x0202449c + ldr r0, [r0] + ldrb r1, [r0, 0x10] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldrb r1, [r2, 0x9] + bl sub_8069318 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, =0x0000fffe + cmp r5, r0 + bne _0804DF56 + adds r7, r5, 0 +_0804DF3A: + ldr r0, =0x0202449c + ldr r0, [r0] + ldrb r1, [r0, 0x10] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0 + bl sub_8069318 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, r7 + beq _0804DF3A +_0804DF56: + cmp r5, 0 + bne _0804DF70 + ldr r0, =0x02024214 + str r4, [r0] + b _0804E018 + .pool +_0804DF70: + ldr r0, =0x0000ffff + cmp r5, r0 + bne _0804DF88 + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0xA + str r0, [r1] + b _0804E018 + .pool +_0804DF88: + movs r0, 0 + bl battle_get_side_with_given_state + ldr r1, =0x02024064 + strb r0, [r1] + ldr r2, =0x0202406e + ldrb r3, [r1] + lsls r0, r3, 1 + adds r0, r2 + ldr r1, =0x0202449c + ldr r1, [r1] + ldrh r0, [r0] + ldrb r1, [r1, 0x10] + cmp r0, r1 + bne _0804DFC8 + ldr r4, =0x02024084 + movs r0, 0x58 + adds r2, r3, 0 + muls r2, r0 + adds r0, r4, 0 + adds r0, 0x50 + adds r0, r2, r0 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 14 + ands r0, r1 + cmp r0, 0 + bne _0804DFC8 + adds r0, r2, r4 + adds r1, r5, 0 + bl sub_80691B0 +_0804DFC8: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0804E014 + movs r0, 0x2 + bl battle_get_side_with_given_state + ldr r1, =0x02024064 + strb r0, [r1] + ldr r2, =0x0202406e + ldrb r3, [r1] + lsls r0, r3, 1 + adds r0, r2 + ldr r1, =0x0202449c + ldr r1, [r1] + ldrh r0, [r0] + ldrb r1, [r1, 0x10] + cmp r0, r1 + bne _0804E014 + ldr r4, =0x02024084 + movs r0, 0x58 + adds r2, r3, 0 + muls r2, r0 + adds r0, r4, 0 + adds r0, 0x50 + adds r0, r2, r0 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 14 + ands r0, r1 + cmp r0, 0 + bne _0804E014 + adds r0, r2, r4 + adds r1, r5, 0 + bl sub_80691B0 +_0804E014: + ldr r0, =0x02024214 + str r6, [r0] +_0804E018: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk59_8025230 + + thumb_func_start sub_804E038 +sub_804E038: @ 804E038 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + ldr r0, =0x02024064 + movs r1, 0 + strb r1, [r0] + ldr r0, =0x02024474 + ldrb r1, [r0, 0x1F] + adds r2, r0, 0 + cmp r1, 0x6 + bls _0804E052 + b _0804E3B8 +_0804E052: + lsls r0, r1, 2 + ldr r1, =_0804E068 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0804E068: + .4byte _0804E084 + .4byte _0804E0BC + .4byte _0804E162 + .4byte _0804E1B8 + .4byte _0804E1E4 + .4byte _0804E38C + .4byte _0804E3AC +_0804E084: + movs r4, 0 + str r4, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + ldr r0, =gUnknown_085CCABB + movs r1, 0xC + bl battle_show_message_maybe + ldr r1, =0x02024474 + ldrb r0, [r1, 0x1F] + adds r0, 0x1 + strb r0, [r1, 0x1F] + ldr r0, =0x02024332 + strb r4, [r0, 0x1] + movs r0, 0 + bl sub_8056B74 + b _0804E3B8 + .pool +_0804E0BC: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0804E0E4 + ldr r4, =0x02024332 + ldrb r0, [r4, 0x1] + cmp r0, 0 + beq _0804E0E4 + movs r0, 0x5 + bl audio_play + ldrb r0, [r4, 0x1] + bl sub_8056BAC + movs r0, 0 + strb r0, [r4, 0x1] + bl sub_8056B74 +_0804E0E4: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0804E10C + ldr r4, =0x02024332 + ldrb r0, [r4, 0x1] + cmp r0, 0 + bne _0804E10C + movs r0, 0x5 + bl audio_play + ldrb r0, [r4, 0x1] + bl sub_8056BAC + movs r0, 0x1 + strb r0, [r4, 0x1] + bl sub_8056B74 +_0804E10C: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r5, 0x1 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _0804E150 + movs r0, 0x5 + bl audio_play + ldr r0, =0x02024332 + ldrb r4, [r0, 0x1] + cmp r4, 0 + bne _0804E20A + str r5, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + b _0804E192 + .pool +_0804E150: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0804E15A + b _0804E3B8 +_0804E15A: + movs r0, 0x5 + bl audio_play + b _0804E20A +_0804E162: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0804E170 + b _0804E3B8 +_0804E170: + bl FreeAllWindowBuffers + ldr r0, =0x020244ec + ldr r1, =0x0202449c + ldr r1, [r1] + ldrb r1, [r1, 0x10] + ldr r2, =0x020244e9 + ldrb r2, [r2] + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldr r3, =sub_80A92F8 + ldr r4, =0x020244e2 + ldrh r4, [r4] + str r4, [sp] + bl sub_81BFA38 +_0804E192: + ldr r1, =0x02024474 + ldrb r0, [r1, 0x1F] + adds r0, 0x1 + strb r0, [r1, 0x1F] + b _0804E3B8 + .pool +_0804E1B8: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0804E1C6 + b _0804E3B8 +_0804E1C6: + ldr r0, =0x030022c0 + ldr r1, [r0, 0x4] + ldr r0, =sub_8038420 + cmp r1, r0 + beq _0804E1D2 + b _0804E3B8 +_0804E1D2: + ldrb r0, [r2, 0x1F] + adds r0, 0x1 + b _0804E3B6 + .pool +_0804E1E4: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0804E1F2 + b _0804E3B8 +_0804E1F2: + ldr r0, =0x030022c0 + ldr r1, [r0, 0x4] + ldr r0, =sub_8038420 + cmp r1, r0 + beq _0804E1FE + b _0804E3B8 +_0804E1FE: + bl sub_81C1B94 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x4 + bne _0804E224 +_0804E20A: + ldr r1, =0x02024474 + movs r0, 0x5 + strb r0, [r1, 0x1F] + b _0804E3B8 + .pool +_0804E224: + ldr r6, =0x0202449c + ldr r0, [r6] + ldrb r0, [r0, 0x10] + movs r1, 0x64 + mov r8, r1 + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + ldr r7, =0x020244ec + adds r0, r7 + adds r1, r5, 0 + adds r1, 0xD + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl sub_806E804 + cmp r0, 0 + beq _0804E274 + ldr r0, =0x0000013f + ldr r1, =0x02024064 + ldrb r1, [r1] + bl b_std_message + ldr r1, =0x02024474 + movs r0, 0x6 + strb r0, [r1, 0x1F] + b _0804E3B8 + .pool +_0804E274: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + ldr r1, =0x02022f68 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x2 + strb r0, [r1, 0x1] + strb r4, [r1, 0x2] + lsrs r0, r4, 8 + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r0, [r6] + ldrb r0, [r0, 0x10] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r7 + adds r1, r5, 0 + bl sub_806B9A8 + ldr r0, [r6] + ldrb r0, [r0, 0x10] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r7 + ldr r7, =0x020244e2 + ldrh r1, [r7] + adds r2, r5, 0 + bl sub_80691F4 + ldr r0, =0x0202406e + ldr r1, [r6] + ldrh r0, [r0] + ldrb r1, [r1, 0x10] + cmp r0, r1 + bne _0804E30A + ldr r4, =0x02024084 + ldr r0, [r4, 0x50] + movs r1, 0x80 + lsls r1, 14 + ands r0, r1 + cmp r0, 0 + bne _0804E30A + ldr r0, =0x020242bc + ldrb r1, [r0, 0x18] + lsrs r1, 4 + ldr r2, =gUnknown_0832A328 + lsls r0, r5, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0804E30A + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_806B9E4 + ldrh r1, [r7] + adds r0, r4, 0 + adds r2, r5, 0 + bl sub_8069234 +_0804E30A: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0804E3B8 + ldr r2, =0x0202406e + ldr r0, =0x0202449c + ldr r1, [r0] + ldrh r0, [r2, 0x4] + ldrb r1, [r1, 0x10] + cmp r0, r1 + bne _0804E3B8 + ldr r4, =0x02024084 + movs r1, 0x80 + lsls r1, 1 + adds r0, r4, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 14 + ands r0, r1 + cmp r0, 0 + bne _0804E3B8 + ldr r0, =0x020242bc + adds r0, 0x50 + ldrb r1, [r0] + lsrs r1, 4 + ldr r2, =gUnknown_0832A328 + lsls r0, r5, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0804E3B8 + adds r4, 0xB0 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_806B9E4 + ldr r0, =0x020244e2 + ldrh r1, [r0] + adds r0, r4, 0 + adds r2, r5, 0 + bl sub_8069234 + b _0804E3B8 + .pool +_0804E38C: + movs r0, 0x1 + str r0, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _0804E3B8 + .pool +_0804E3AC: + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0804E3B8 + movs r0, 0x2 +_0804E3B6: + strb r0, [r2, 0x1F] +_0804E3B8: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_804E038 + + thumb_func_start atk5B_80256E0 +atk5B_80256E0: @ 804E3C8 + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, =0x02024474 + ldrb r4, [r5, 0x1F] + cmp r4, 0 + beq _0804E3E0 + cmp r4, 0x1 + beq _0804E410 + b _0804E4FA + .pool +_0804E3E0: + str r4, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + ldr r0, =gUnknown_085CCABB + movs r1, 0xC + bl battle_show_message_maybe + ldrb r0, [r5, 0x1F] + adds r0, 0x1 + strb r0, [r5, 0x1F] + ldr r0, =0x02024332 + strb r4, [r0, 0x1] + movs r0, 0 + bl sub_8056B74 + b _0804E4FA + .pool +_0804E410: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0804E438 + ldr r4, =0x02024332 + ldrb r0, [r4, 0x1] + cmp r0, 0 + beq _0804E438 + movs r0, 0x5 + bl audio_play + ldrb r0, [r4, 0x1] + bl sub_8056BAC + movs r0, 0 + strb r0, [r4, 0x1] + bl sub_8056B74 +_0804E438: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0804E460 + ldr r4, =0x02024332 + ldrb r0, [r4, 0x1] + cmp r0, 0 + bne _0804E460 + movs r0, 0x5 + bl audio_play + ldrb r0, [r4, 0x1] + bl sub_8056BAC + movs r0, 0x1 + strb r0, [r4, 0x1] + bl sub_8056B74 +_0804E460: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r4, 0x1 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _0804E4C4 + movs r0, 0x5 + bl audio_play + ldr r0, =0x02024332 + ldrb r0, [r0, 0x1] + cmp r0, 0 + beq _0804E4A4 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _0804E4AC + .pool +_0804E4A4: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_0804E4AC: + movs r0, 0x1 + str r0, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + b _0804E4FA + .pool +_0804E4C4: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0804E4FA + movs r0, 0x5 + bl audio_play + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + str r4, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C +_0804E4FA: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk5B_80256E0 + + thumb_func_start atk5C_cmd5c +atk5C_cmd5c: @ 804E508 + push {r4,lr} + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r2, =0x02024064 + strb r0, [r2] + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _0804E58C + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 1 + ands r0, r1 + cmp r0, 0 + beq _0804E55A + ldr r1, =0x02024084 + ldrb r2, [r2] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _0804E55A + ldr r0, =0x020242bc + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0xA] + cmp r0, 0 + bne _0804E58C +_0804E55A: + movs r0, 0 + bl dp01_build_cmdbuf_x29_29_29_29 + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] + b _0804E592 + .pool +_0804E58C: + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] +_0804E592: + pop {r4} + pop {r0} + bx r0 + thumb_func_end atk5C_cmd5c + + thumb_func_start sub_804E598 +sub_804E598: @ 804E598 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 16 + lsrs r6, r0, 16 + movs r7, 0 + movs r5, 0 + movs r0, 0x80 + lsls r0, 3 + cmp r6, r0 + bne _0804E5D8 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r0, [r0] + adds r0, 0x94 + ldrb r2, [r0] + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x4A + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + muls r0, r2 + b _0804E6CA + .pool +_0804E5D8: + ldr r0, =gTrainers + lsls r2, r6, 2 + adds r1, r2, r6 + lsls r1, 3 + adds r4, r1, r0 + ldrb r3, [r4] + mov r12, r0 + cmp r3, 0x1 + beq _0804E62E + cmp r3, 0x1 + bgt _0804E5F8 + cmp r3, 0 + beq _0804E602 + b _0804E644 + .pool +_0804E5F8: + cmp r3, 0x2 + beq _0804E618 + cmp r3, 0x3 + beq _0804E62E + b _0804E644 +_0804E602: + mov r0, r12 + adds r0, 0x24 + adds r0, r1, r0 + ldr r1, [r0] + adds r0, r4, 0 + adds r0, 0x20 + ldrb r0, [r0] + lsls r0, 3 + adds r0, r1 + subs r0, 0x8 + b _0804E642 +_0804E618: + mov r0, r12 + adds r0, 0x24 + adds r0, r1, r0 + ldr r1, [r0] + adds r0, r4, 0 + adds r0, 0x20 + ldrb r0, [r0] + lsls r0, 3 + adds r0, r1 + subs r0, 0x8 + b _0804E642 +_0804E62E: + mov r0, r12 + adds r0, 0x24 + adds r0, r1, r0 + ldr r1, [r0] + adds r0, r4, 0 + adds r0, 0x20 + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + subs r0, 0x10 +_0804E642: + ldrb r5, [r0, 0x2] +_0804E644: + ldr r1, =gUnknown_0831AEB8 + lsls r0, r7, 2 + adds r4, r0, r1 + ldrb r3, [r4] + ldr r0, =0x0202449c + mov r8, r0 + mov r9, r1 + ldr r1, =0x02022fec + mov r10, r1 + cmp r3, 0xFF + beq _0804E67A + adds r0, r2, r6 + lsls r0, 3 + add r0, r12 + ldrb r1, [r0, 0x1] + cmp r3, r1 + beq _0804E67A + adds r2, r0, 0 + adds r0, r4, 0 +_0804E66A: + adds r0, 0x4 + adds r7, 0x1 + ldrb r1, [r0] + cmp r1, 0xFF + beq _0804E67A + ldrb r3, [r2, 0x1] + cmp r1, r3 + bne _0804E66A +_0804E67A: + mov r0, r10 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 8 + ands r0, r1 + cmp r0, 0 + bne _0804E6B4 + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0804E6B4 + mov r3, r8 + ldr r0, [r3] + adds r0, 0x4A + ldrb r0, [r0] + lsls r0, 2 + adds r1, r5, 0 + muls r1, r0 + lsls r0, r7, 2 + add r0, r9 + ldrb r0, [r0, 0x1] + lsls r0, 1 + b _0804E6C8 + .pool +_0804E6B4: + mov r1, r8 + ldr r0, [r1] + adds r0, 0x4A + ldrb r0, [r0] + lsls r0, 2 + adds r1, r5, 0 + muls r1, r0 + lsls r0, r7, 2 + add r0, r9 + ldrb r0, [r0, 0x1] +_0804E6C8: + muls r0, r1 +_0804E6CA: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_804E598 + + thumb_func_start sub_804E6D8 +sub_804E6D8: @ 804E6D8 + push {r4,lr} + ldr r0, =0x02038bca + ldrh r0, [r0] + bl sub_804E598 + adds r4, r0, 0 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0804E6FC + ldr r0, =0x02038bcc + ldrh r0, [r0] + bl sub_804E598 + adds r4, r0 +_0804E6FC: + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + adds r1, r4, 0 + bl add_money + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x1 + strb r0, [r1, 0x1] + movs r0, 0x4 + strb r0, [r1, 0x2] + movs r0, 0x5 + strb r0, [r1, 0x3] + strb r4, [r1, 0x4] + movs r0, 0xFF + lsls r0, 8 + ands r0, r4 + lsrs r0, 8 + strb r0, [r1, 0x5] + movs r0, 0xFF + lsls r0, 16 + ands r0, r4 + lsrs r0, 16 + strb r0, [r1, 0x6] + lsrs r0, r4, 24 + strb r0, [r1, 0x7] + movs r0, 0xFF + strb r0, [r1, 0x8] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_804E6D8 + + thumb_func_start atk5E_8025A70 +atk5E_8025A70: @ 804E764 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r6, =0x02024064 + strb r0, [r6] + ldr r5, =0x02024332 + ldrb r0, [r5] + mov r8, r4 + cmp r0, 0 + beq _0804E794 + cmp r0, 0x1 + beq _0804E7AC + b _0804E800 + .pool +_0804E794: + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl dp01_build_cmdbuf_x00_a_b_0 + ldrb r0, [r6] + bl dp01_battle_side_mark_buffer_for_execution + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + b _0804E800 +_0804E7AC: + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0804E800 + ldrb r0, [r6] + lsls r0, 9 + ldr r1, =0x02023868 + adds r0, r1 + mov r12, r0 + movs r2, 0 + adds r4, r6, 0 + movs r5, 0x58 + ldr r6, =0x020240a8 + adds r7, r6, 0 + subs r7, 0x18 + mov r3, r12 + adds r3, 0xC +_0804E7CE: + lsls r1, r2, 1 + ldrb r0, [r4] + muls r0, r5 + adds r1, r0 + adds r1, r7 + ldrh r0, [r3] + strh r0, [r1] + ldrb r0, [r4] + adds r1, r0, 0 + muls r1, r5 + adds r1, r2, r1 + adds r1, r6 + mov r0, r12 + adds r0, 0x24 + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r3, 0x2 + adds r2, 0x1 + cmp r2, 0x3 + ble _0804E7CE + mov r1, r8 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] +_0804E800: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk5E_8025A70 + + thumb_func_start atk5F_8025B24 +atk5F_8025B24: @ 804E818 + push {lr} + ldr r0, =0x02024064 + ldr r2, =0x0202420b + ldrb r3, [r2] + strb r3, [r0] + ldr r1, =0x0202420c + ldrb r0, [r1] + strb r0, [r2] + strb r3, [r1] + ldr r2, =0x02024280 + ldr r1, [r2] + movs r3, 0x80 + lsls r3, 5 + adds r0, r1, 0 + ands r0, r3 + cmp r0, 0 + beq _0804E854 + ldr r0, =0xffffefff + ands r1, r0 + b _0804E856 + .pool +_0804E854: + orrs r1, r3 +_0804E856: + str r1, [r2] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end atk5F_8025B24 + + thumb_func_start atk60_cmd60 +atk60_cmd60: @ 804E868 + push {lr} + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0804E882 + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl sav12_xor_increment +_0804E882: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end atk60_cmd60 + + thumb_func_start atk61_8025BA4 +atk61_8025BA4: @ 804E898 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x30 + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0804E94C + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r1, =0x02024064 + strb r0, [r1] + ldrb r0, [r1] + bl battle_side_get_owner + lsls r0, 24 + ldr r1, =0x02024744 + mov r8, r1 + cmp r0, 0 + bne _0804E8CA + ldr r0, =0x020244ec + mov r8, r0 +_0804E8CA: + movs r7, 0 + add r6, sp, 0x4 + mov r5, sp +_0804E8D0: + movs r0, 0x64 + muls r0, r7 + mov r1, r8 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + beq _0804E8F4 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + bne _0804E914 +_0804E8F4: + ldr r0, =0x0000ffff + strh r0, [r5] + movs r0, 0 + b _0804E926 + .pool +_0804E914: + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + strh r0, [r5] + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr +_0804E926: + str r0, [r6] + adds r6, 0x8 + adds r5, 0x8 + adds r7, 0x1 + cmp r7, 0x5 + ble _0804E8D0 + movs r0, 0 + mov r1, sp + movs r2, 0x1 + bl dp01_build_cmdbuf_x30_TODO + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] +_0804E94C: + add sp, 0x30 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk61_8025BA4 + + thumb_func_start atk62_08025C6C +atk62_08025C6C: @ 804E960 + push {r4,r5,lr} + ldr r5, =0x02024214 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r4, =0x02024064 + strb r0, [r4] + movs r0, 0 + bl dp01_build_cmdbuf_x31_31_31_31 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r5] + adds r0, 0x2 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk62_08025C6C + + thumb_func_start atk63_jumptoattack +atk63_jumptoattack: @ 804E990 + push {r4,lr} + ldr r0, =0x02024214 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r4, r0, 0 + cmp r1, 0 + beq _0804E9B4 + ldr r0, =0x020241ea + ldr r1, =0x020241ee + ldrh r1, [r1] + strh r1, [r0] + b _0804E9C2 + .pool +_0804E9B4: + ldr r2, =0x020241ec + ldr r1, =0x020241ea + ldr r0, =0x020241ee + ldrh r0, [r0] + strh r0, [r1] + strh r0, [r2] + adds r0, r1, 0 +_0804E9C2: + ldr r3, =gUnknown_082D86A8 + ldr r2, =gBattleMoves + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk63_jumptoattack + + thumb_func_start atk64_statusanimation +atk64_statusanimation: @ 804E9F4 + push {r4,lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0804EA5C + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r4, =0x02024064 + strb r0, [r4] + ldr r1, =0x020242ac + ldrb r2, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, =0x000400c0 + ands r0, r1 + cmp r0, 0 + bne _0804EA54 + ldr r0, =0x020242bc + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0xA] + cmp r0, 0 + bne _0804EA54 + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0804EA54 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r2 + adds r1, 0x4C + adds r0, r1 + ldr r2, [r0] + movs r0, 0 + movs r1, 0 + bl dp01_build_cmdbuf_x1B_aaaa_b + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0804EA54: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] +_0804EA5C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk64_statusanimation + + thumb_func_start atk65_8025D90 +atk65_8025D90: @ 804EA84 + push {r4,r5,lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0804EB04 + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r5, =0x02024064 + strb r0, [r5] + ldr r1, [r4] + ldrb r3, [r1, 0x2] + ldrb r0, [r1, 0x3] + lsls r0, 8 + orrs r3, r0 + ldrb r0, [r1, 0x4] + lsls r0, 16 + orrs r3, r0 + ldrb r0, [r1, 0x5] + lsls r0, 24 + orrs r3, r0 + ldr r1, =0x020242ac + ldrb r2, [r5] + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, =0x000400c0 + ands r0, r1 + cmp r0, 0 + bne _0804EAFC + ldr r0, =0x020242bc + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0xA] + cmp r0, 0 + bne _0804EAFC + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0804EAFC + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r2, [r0] + ands r2, r3 + movs r0, 0 + movs r1, 0x1 + bl dp01_build_cmdbuf_x1B_aaaa_b + ldrb r0, [r5] + bl dp01_battle_side_mark_buffer_for_execution +_0804EAFC: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x6 + str r0, [r1] +_0804EB04: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk65_8025D90 + + thumb_func_start atk66_8025E38 +atk66_8025E38: @ 804EB2C + push {r4,r5,lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0804EB9E + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r5, =0x02024064 + strb r0, [r5] + ldr r4, [r4] + ldrb r2, [r4, 0x3] + ldrb r0, [r4, 0x4] + lsls r0, 8 + orrs r2, r0 + ldrb r0, [r4, 0x5] + lsls r0, 16 + orrs r2, r0 + ldrb r0, [r4, 0x6] + lsls r0, 24 + orrs r2, r0 + ldr r1, =0x020242ac + ldrb r3, [r5] + lsls r0, r3, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, =0x000400c0 + ands r0, r1 + cmp r0, 0 + bne _0804EB96 + ldr r0, =0x020242bc + lsls r1, r3, 3 + subs r1, r3 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0xA] + cmp r0, 0 + bne _0804EB96 + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0804EB96 + ldrb r1, [r4, 0x2] + movs r0, 0 + bl dp01_build_cmdbuf_x1B_aaaa_b + ldrb r0, [r5] + bl dp01_battle_side_mark_buffer_for_execution +_0804EB96: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x7 + str r0, [r1] +_0804EB9E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk66_8025E38 + + thumb_func_start atk67_8025ECC +atk67_8025ECC: @ 804EBC0 + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, =0x02024332 + ldrb r4, [r5] + cmp r4, 0 + beq _0804EBD8 + cmp r4, 0x1 + beq _0804EC04 + b _0804EC96 + .pool +_0804EBD8: + str r4, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + ldr r0, =gUnknown_085CCABB + movs r1, 0xC + bl battle_show_message_maybe + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + strb r4, [r5, 0x1] + movs r0, 0 + bl sub_8056B74 + b _0804EC96 + .pool +_0804EC04: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0804EC2A + ldrb r0, [r5, 0x1] + cmp r0, 0 + beq _0804EC2A + movs r0, 0x5 + bl audio_play + ldrb r0, [r5, 0x1] + bl sub_8056BAC + movs r0, 0 + strb r0, [r5, 0x1] + bl sub_8056B74 +_0804EC2A: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0804EC52 + ldr r4, =0x02024332 + ldrb r0, [r4, 0x1] + cmp r0, 0 + bne _0804EC52 + movs r0, 0x5 + bl audio_play + ldrb r0, [r4, 0x1] + bl sub_8056BAC + movs r0, 0x1 + strb r0, [r4, 0x1] + bl sub_8056B74 +_0804EC52: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0804EC70 + ldr r0, =0x02024332 + movs r4, 0x1 + strb r4, [r0, 0x1] + b _0804EC7A + .pool +_0804EC70: + movs r4, 0x1 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _0804EC96 +_0804EC7A: + movs r0, 0x5 + bl audio_play + str r4, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_0804EC96: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk67_8025ECC + + thumb_func_start sub_804ECA4 +sub_804ECA4: @ 804ECA4 + push {r4,r5,lr} + movs r1, 0 + ldr r2, =0x0202406c + ldr r5, =0x02024214 + ldrb r0, [r2] + cmp r1, r0 + bge _0804ECC2 + ldr r4, =0x0202407a + movs r3, 0xC +_0804ECB6: + adds r0, r1, r4 + strb r3, [r0] + adds r1, 0x1 + ldrb r0, [r2] + cmp r1, r0 + blt _0804ECB6 +_0804ECC2: + ldr r0, [r5] + adds r0, 0x1 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_804ECA4 + + thumb_func_start atk69_8025FE0 +atk69_8025FE0: @ 804ECDC + push {r4-r7,lr} + ldr r7, =0x02024084 + ldr r6, =0x0202420c + ldrb r2, [r6] + movs r5, 0x58 + adds r0, r2, 0 + muls r0, r5 + adds r1, r0, r7 + ldrh r0, [r1, 0x2E] + cmp r0, 0xAF + bne _0804ED10 + ldr r1, =0x02024404 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r4, [r0, 0x7] + ldrb r6, [r0, 0x1A] + b _0804ED2A + .pool +_0804ED10: + ldrh r0, [r1, 0x2E] + bl itemid_get_x12 + lsls r0, 24 + lsrs r4, r0, 24 + ldrb r0, [r6] + muls r0, r5 + adds r0, r7 + ldrh r0, [r0, 0x2E] + bl itemid_get_quality + lsls r0, 24 + lsrs r6, r0, 24 +_0804ED2A: + ldr r1, =0x0202420f + ldr r5, =0x0202420c + ldrb r0, [r5] + strb r0, [r1] + cmp r4, 0x27 + bne _0804ED68 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, r6 + bcs _0804ED68 + ldrb r0, [r5] + movs r1, 0x27 + bl b_history__record_item_x12_of_player + ldr r2, =0x0202437c + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0] +_0804ED68: + ldr r2, =0x02024084 + ldr r3, =0x0202420c + ldrb r4, [r3] + movs r0, 0x58 + muls r0, r4 + adds r1, r2, 0 + adds r1, 0x50 + adds r0, r1 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 17 + ands r1, r0 + adds r5, r2, 0 + cmp r1, 0 + bne _0804EE38 + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0x65 + beq _0804EDBA + ldr r0, =0x0202433c + lsls r1, r4, 4 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 30 + cmp r0, 0 + blt _0804EDBA + ldr r0, =0x0202437c + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + lsrs r0, 7 + cmp r0, 0 + beq _0804EE38 +_0804EDBA: + ldrb r0, [r3] + movs r4, 0x58 + muls r0, r4 + adds r0, r5 + ldrh r1, [r0, 0x28] + ldr r2, =0x020241f0 + ldr r0, [r2] + cmp r1, r0 + bgt _0804EE38 + subs r0, r1, 0x1 + str r0, [r2] + ldr r1, =0x0202433c + ldrb r3, [r3] + lsls r0, r3, 4 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + cmp r0, 0 + bge _0804EE10 + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + b _0804EE38 + .pool +_0804EE10: + ldr r0, =0x0202437c + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + lsrs r0, 7 + cmp r0, 0 + beq _0804EE38 + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024208 + adds r0, r3, 0 + muls r0, r4 + adds r0, r5 + ldrh r0, [r0, 0x2E] + strh r0, [r1] +_0804EE38: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk69_8025FE0 + + thumb_func_start atk6A_stash_item_for_side +atk6A_stash_item_for_side: @ 804EE58 + push {r4-r6,lr} + sub sp, 0x4 + ldr r6, =0x02024214 + ldr r0, [r6] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r5, =0x02024064 + strb r0, [r5] + ldr r1, =0x0202449c + ldrb r4, [r5] + lsls r0, r4, 1 + adds r0, 0xB8 + ldr r1, [r1] + adds r1, r0 + ldr r2, =0x02024084 + movs r3, 0x58 + adds r0, r4, 0 + muls r0, r3 + adds r0, r2 + ldrh r0, [r0, 0x2E] + strh r0, [r1] + ldrb r0, [r5] + muls r0, r3 + adds r0, r2 + movs r1, 0 + strh r1, [r0, 0x2E] + ldrb r0, [r5] + muls r0, r3 + adds r2, 0x2E + adds r0, r2 + str r0, [sp] + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + movs r3, 0x2 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r5] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r6] + adds r0, 0x2 + str r0, [r6] + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atk6A_stash_item_for_side + + thumb_func_start atk6B_end_battle_80261CC +atk6B_end_battle_80261CC: @ 804EEC8 + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x7 + strb r0, [r1, 0x1] + ldr r2, =0x0202420b + ldrb r0, [r2] + strb r0, [r1, 0x2] + ldr r3, =0x0202406e + ldrb r0, [r2] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end atk6B_end_battle_80261CC + + thumb_func_start atk6C_8026208 +atk6C_8026208: @ 804EF04 + push {r4,lr} + sub sp, 0x4 + ldr r0, =0x02024474 + ldrb r1, [r0, 0x1E] + adds r4, r0, 0 + cmp r1, 0 + bne _0804EF28 + bl sub_804F498 + cmp r0, 0 + beq _0804EF24 + movs r0, 0x3 + b _0804EF26 + .pool +_0804EF24: + movs r0, 0x1 +_0804EF26: + strb r0, [r4, 0x1E] +_0804EF28: + ldrb r0, [r4, 0x1E] + subs r0, 0x1 + cmp r0, 0x9 + bls _0804EF32 + b _0804F0F2 +_0804EF32: + lsls r0, 2 + ldr r1, =_0804EF40 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0804EF40: + .4byte _0804EF68 + .4byte _0804EF94 + .4byte _0804EFAC + .4byte _0804F000 + .4byte _0804F014 + .4byte _0804F02C + .4byte _0804F014 + .4byte _0804F04C + .4byte _0804F07C + .4byte _0804F0C0 +_0804EF68: + ldr r1, =0x02022e1e + movs r0, 0x60 + strh r0, [r1] + movs r0, 0x2 + movs r1, 0x7 + movs r2, 0 + bl SetBgAttribute + movs r0, 0x2 + bl ShowBg + bl sub_804F17C + ldr r1, =0x02024474 + movs r0, 0x2 + strb r0, [r1, 0x1E] + b _0804F0F2 + .pool +_0804EF94: + bl sub_804F1CC + lsls r0, 24 + cmp r0, 0 + beq _0804EFA0 + b _0804F0F2 +_0804EFA0: + ldr r1, =0x02024474 + movs r0, 0x3 + strb r0, [r1, 0x1E] + b _0804F0F2 + .pool +_0804EFAC: + ldr r1, =0x02022e18 + movs r0, 0 + strh r0, [r1] + ldr r1, =0x02022e1a + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + movs r0, 0 + movs r1, 0x7 + movs r2, 0x1 + bl SetBgAttribute + movs r0, 0x1 + movs r1, 0x7 + movs r2, 0 + bl SetBgAttribute + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x80 + str r0, [sp] + movs r0, 0x12 + movs r1, 0x7 + movs r2, 0x1D + movs r3, 0x13 + bl sub_8056A3C + ldr r1, =0x02024474 + movs r0, 0x4 + strb r0, [r1, 0x1E] + b _0804F0F2 + .pool +_0804F000: + bl sub_804F100 + movs r0, 0xD + bl PutWindowTilemap + movs r0, 0xD + movs r1, 0x3 + bl CopyWindowToVram + b _0804F06A +_0804F014: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0804F0F2 + ldr r0, =0x02022e1a + strh r1, [r0] + b _0804F06A + .pool +_0804F02C: + ldr r0, =0x030022c0 + ldrh r0, [r0, 0x2E] + cmp r0, 0 + beq _0804F0F2 + movs r0, 0x5 + bl audio_play + bl sub_804F144 + movs r0, 0xD + movs r1, 0x2 + bl CopyWindowToVram + b _0804F06A + .pool +_0804F04C: + ldr r0, =0x030022c0 + ldrh r0, [r0, 0x2E] + cmp r0, 0 + beq _0804F0F2 + movs r0, 0x5 + bl audio_play + movs r0, 0x81 + str r0, [sp] + movs r0, 0x12 + movs r1, 0x7 + movs r2, 0x1D + movs r3, 0x13 + bl sub_8056A3C +_0804F06A: + ldr r1, =0x02024474 + ldrb r0, [r1, 0x1E] + adds r0, 0x1 + strb r0, [r1, 0x1E] + b _0804F0F2 + .pool +_0804F07C: + bl sub_804F344 + lsls r0, 24 + cmp r0, 0 + bne _0804F0F2 + movs r0, 0xE + bl ClearWindowTilemap + movs r0, 0xE + movs r1, 0x1 + bl CopyWindowToVram + movs r0, 0xD + bl ClearWindowTilemap + movs r0, 0xD + movs r1, 0x1 + bl CopyWindowToVram + movs r0, 0x2 + movs r1, 0x7 + movs r2, 0x2 + bl SetBgAttribute + movs r0, 0x2 + bl ShowBg + ldr r1, =0x02024474 + movs r0, 0xA + strb r0, [r1, 0x1E] + b _0804F0F2 + .pool +_0804F0C0: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0804F0F2 + movs r0, 0 + movs r1, 0x7 + movs r2, 0 + bl SetBgAttribute + movs r0, 0x1 + movs r1, 0x7 + movs r2, 0x1 + bl SetBgAttribute + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_0804F0F2: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk6C_8026208 + + thumb_func_start sub_804F100 +sub_804F100: @ 804F100 + push {lr} + sub sp, 0x14 + ldr r0, =0x0202449c + ldr r0, [r0] + ldrb r1, [r0, 0x10] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + add r1, sp, 0x8 + bl sub_81D388C + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r1, [r0, 0x10] + movs r0, 0xD + str r0, [sp] + movs r0, 0xF + str r0, [sp, 0x4] + movs r0, 0xD + add r2, sp, 0x8 + movs r3, 0xE + bl sub_81D3640 + add sp, 0x14 + pop {r0} + bx r0 + .pool + thumb_func_end sub_804F100 + + thumb_func_start sub_804F144 +sub_804F144: @ 804F144 + push {lr} + sub sp, 0x10 + ldr r0, =0x0202449c + ldr r0, [r0] + ldrb r1, [r0, 0x10] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + add r1, sp, 0x4 + bl sub_81D388C + movs r0, 0xF + str r0, [sp] + movs r0, 0xD + add r1, sp, 0x4 + movs r2, 0xE + movs r3, 0xD + bl sub_81D3784 + add sp, 0x10 + pop {r0} + bx r0 + .pool + thumb_func_end sub_804F144 + + thumb_func_start sub_804F17C +sub_804F17C: @ 804F17C + push {lr} + ldr r1, =0x02022e1e + movs r0, 0 + strh r0, [r1] + ldr r1, =0x02022e1c + movs r2, 0xD0 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + ldr r0, =gUnknown_0831C2C8 + movs r1, 0x60 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, =gUnknown_0831C2E8 + movs r0, 0xE + movs r2, 0 + movs r3, 0 + bl CopyToWindowPixelBuffer + movs r0, 0xE + bl PutWindowTilemap + movs r0, 0xE + movs r1, 0x3 + bl CopyWindowToVram + bl sub_804F384 + pop {r0} + bx r0 + .pool + thumb_func_end sub_804F17C + + thumb_func_start sub_804F1CC +sub_804F1CC: @ 804F1CC + push {r4,r5,lr} + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _0804F1DC + movs r0, 0x1 + b _0804F216 +_0804F1DC: + ldr r4, =0x02022e1c + ldrh r1, [r4] + movs r5, 0x80 + lsls r5, 2 + cmp r1, r5 + bne _0804F1F0 + movs r0, 0 + b _0804F216 + .pool +_0804F1F0: + movs r0, 0xD0 + lsls r0, 1 + cmp r1, r0 + bne _0804F1FC + bl sub_804F220 +_0804F1FC: + ldrh r0, [r4] + adds r0, 0x8 + strh r0, [r4] + lsls r0, 16 + ldr r1, =0x01ff0000 + cmp r0, r1 + bls _0804F20C + strh r5, [r4] +_0804F20C: + ldrh r1, [r4] + eors r1, r5 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 +_0804F216: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_804F1CC + + thumb_func_start sub_804F220 +sub_804F220: @ 804F220 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + ldr r6, =0x0202449c + ldr r0, [r6] + ldrb r0, [r0, 0x10] + movs r5, 0x64 + muls r0, r5 + ldr r4, =0x020244ec + adds r0, r4 + movs r1, 0x38 + bl pokemon_getattr + mov r8, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, [r6] + ldrb r0, [r0, 0x10] + muls r0, r5 + adds r0, r4 + bl pokemon_get_gender + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, [r6] + ldrb r0, [r0, 0x10] + muls r0, r5 + adds r0, r4 + ldr r5, =0x02021fc4 + adds r1, r5, 0 + bl GetMonNickname + str r5, [sp] + mov r2, sp + movs r1, 0 + movs r0, 0xE + strb r0, [r2, 0x4] + mov r0, sp + strb r1, [r0, 0x5] + movs r4, 0x20 + strb r4, [r0, 0x6] + strb r1, [r0, 0x7] + strb r4, [r0, 0x8] + strb r1, [r0, 0x9] + strb r1, [r0, 0xA] + strb r1, [r0, 0xB] + mov r3, sp + ldrb r2, [r3, 0xC] + subs r1, 0x10 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3, 0xC] + mov r2, sp + movs r0, 0x10 + strb r0, [r2, 0xC] + ldrb r0, [r2, 0xD] + ands r1, r0 + strb r1, [r2, 0xD] + mov r0, sp + strb r4, [r0, 0xD] + movs r1, 0xFF + movs r2, 0 + bl AddTextPrinter + movs r0, 0xF9 + strb r0, [r5] + adds r5, 0x1 + movs r0, 0x5 + strb r0, [r5] + adds r5, 0x1 + adds r4, r5, 0 + adds r0, r4, 0 + mov r1, r8 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + adds r5, r0, 0 + subs r4, r5, r4 + movs r2, 0x4 + subs r2, r4 + lsls r2, 16 + lsrs r2, 16 + movs r1, 0x77 + bl RepeatChar + adds r5, r0, 0 + cmp r7, 0xFF + beq _0804F320 + cmp r7, 0 + bne _0804F300 + movs r1, 0 + movs r2, 0xC + bl WriteColorChangeControlCode + adds r5, r0, 0 + movs r1, 0x1 + movs r2, 0xD + bl WriteColorChangeControlCode + adds r5, r0, 0 + movs r0, 0xB5 + b _0804F318 + .pool +_0804F300: + adds r0, r5, 0 + movs r1, 0 + movs r2, 0xE + bl WriteColorChangeControlCode + adds r5, r0, 0 + movs r1, 0x1 + movs r2, 0xF + bl WriteColorChangeControlCode + adds r5, r0, 0 + movs r0, 0xB6 +_0804F318: + strb r0, [r5] + adds r5, 0x1 + movs r0, 0xFF + strb r0, [r5] +_0804F320: + mov r0, sp + movs r1, 0xA + strb r1, [r0, 0x7] + strb r1, [r0, 0x9] + movs r1, 0xFF + movs r2, 0 + bl AddTextPrinter + movs r0, 0xE + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_804F220 + + thumb_func_start sub_804F344 +sub_804F344: @ 804F344 + push {lr} + ldr r0, =0x02022e1c + ldrh r1, [r0] + movs r3, 0xD0 + lsls r3, 1 + adds r2, r0, 0 + cmp r1, r3 + bne _0804F35C + movs r0, 0 + b _0804F380 + .pool +_0804F35C: + ldrh r0, [r2] + adds r1, r0, 0 + subs r1, 0x10 + ldr r0, =0x0000019f + cmp r1, r0 + bgt _0804F370 + strh r3, [r2] + b _0804F372 + .pool +_0804F370: + strh r1, [r2] +_0804F372: + ldrh r1, [r2] + movs r0, 0xD0 + lsls r0, 1 + eors r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 +_0804F380: + pop {r1} + bx r1 + thumb_func_end sub_804F344 + + thumb_func_start sub_804F384 +sub_804F384: @ 804F384 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x10 + ldr r0, =0x0202449c + mov r8, r0 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x020244ec + adds r0, r5 + movs r1, 0xB + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r1, r8 + ldr r0, [r1] + ldrb r0, [r0, 0x10] + muls r0, r6 + adds r0, r5 + movs r1, 0 + bl pokemon_getattr + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_80D2EDC + str r0, [sp] + ldr r5, =0xffff0000 + ldr r0, [sp, 0x4] + ands r0, r5 + movs r1, 0x80 + lsls r1, 2 + orrs r0, r1 + ldr r1, =0x0000ffff + ands r0, r1 + ldr r1, =0xd75a0000 + orrs r0, r1 + str r0, [sp, 0x4] + adds r0, r4, 0 + bl sub_80D30B0 + str r0, [sp, 0x8] + add r4, sp, 0x8 + ldr r0, [r4, 0x4] + ands r0, r5 + ldr r1, =0x0000d75a + orrs r0, r1 + str r0, [r4, 0x4] + mov r0, sp + bl LoadObjectPic + adds r0, r4, 0 + bl LoadTaggedObjectPalette + ldr r0, =gUnknown_0831C3C0 + movs r1, 0x80 + lsls r1, 1 + movs r2, 0xA + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0x2E] + ldr r0, =0x02022e1c + ldrh r0, [r0] + strh r0, [r1, 0x30] + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_804F384 + + thumb_func_start sub_804F450 +sub_804F450: @ 804F450 + push {r4,lr} + adds r2, r0, 0 + ldr r0, =0x02022e1c + ldrh r1, [r2, 0x30] + ldrh r0, [r0] + subs r1, r0 + strh r1, [r2, 0x24] + lsls r1, 16 + cmp r1, 0 + beq _0804F470 + movs r0, 0x1 + strh r0, [r2, 0x2E] + b _0804F48C + .pool +_0804F470: + movs r1, 0x2E + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _0804F48C + adds r0, r2, 0 + bl RemoveObjectAndFreeTiles + ldr r4, =0x0000d75a + adds r0, r4, 0 + bl FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag +_0804F48C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_804F450 + + thumb_func_start sub_804F498 +sub_804F498: @ 804F498 + push {lr} + ldr r3, =0x0202406e + ldr r0, =0x0202449c + ldr r0, [r0] + ldrh r1, [r3] + ldrb r2, [r0, 0x10] + cmp r1, r2 + beq _0804F4BA + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0804F4CC + ldrh r0, [r3, 0x4] + cmp r0, r2 + bne _0804F4CC +_0804F4BA: + movs r0, 0x1 + b _0804F4CE + .pool +_0804F4CC: + movs r0, 0 +_0804F4CE: + pop {r1} + bx r1 + thumb_func_end sub_804F498 + + thumb_func_start sub_804F4D4 +sub_804F4D4: @ 804F4D4 + push {lr} + bl sub_803F988 + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_804F4D4 + + thumb_func_start atk6E_state0_side_becomes_attacker +atk6E_state0_side_becomes_attacker: @ 804F4EC + push {lr} + movs r0, 0 + bl battle_get_side_with_given_state + ldr r1, =0x0202420b + strb r0, [r1] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end atk6E_state0_side_becomes_attacker + + thumb_func_start atk6F_8026810 +atk6F_8026810: @ 804F50C + push {r4,r5,lr} + ldr r5, =0x02024214 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r4, =0x02024064 + strb r0, [r4] + movs r0, 0 + movs r1, 0 + bl dp01_build_cmdbuf_x33_a_33_33 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r5] + adds r0, 0x2 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk6F_8026810 + + thumb_func_start atk70_record_ability_usage_of_side +atk70_record_ability_usage_of_side: @ 804F540 + push {r4,lr} + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r1, =0x02024064 + strb r0, [r1] + ldrb r0, [r1] + ldr r1, =0x0202420a + ldrb r1, [r1] + bl b_history__record_ability_usage_of_player + ldr r0, [r4] + adds r0, 0x1 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk70_record_ability_usage_of_side + + thumb_func_start sub_804F574 +sub_804F574: @ 804F574 + ldr r2, =0x02022f68 + movs r0, 0xFD + strb r0, [r2] + movs r0, 0x2 + strb r0, [r2, 0x1] + ldr r0, =0x020244e2 + ldrh r1, [r0] + strb r1, [r2, 0x2] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + lsrs r0, 8 + strb r0, [r2, 0x3] + movs r0, 0xFF + strb r0, [r2, 0x4] + bx lr + .pool + thumb_func_end sub_804F574 + + thumb_func_start atk71_80268A0 +atk71_80268A0: @ 804F59C + push {lr} + bl sub_804F574 + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end atk71_80268A0 + + thumb_func_start atk72_flee +atk72_flee: @ 804F5B4 + push {lr} + ldr r0, =0x0202420d + ldrb r0, [r0] + bl sub_803EC20 + lsls r0, 24 + cmp r0, 0 + beq _0804F5E8 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _0804F5F0 + .pool +_0804F5E8: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_0804F5F0: + pop {r0} + bx r0 + .pool + thumb_func_end atk72_flee + + thumb_func_start atk73_cmd73 +atk73_cmd73: @ 804F5F8 + push {r4-r6,lr} + ldr r0, =0x02022fec + ldr r4, [r0] + movs r6, 0x1 + ands r4, r6 + cmp r4, 0 + bne _0804F68E + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r1, =0x02024064 + strb r0, [r1] + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02024084 + movs r1, 0x58 + muls r1, r0 + adds r1, r2 + ldrh r5, [r1, 0x28] + movs r0, 0x64 + muls r0, r5 + ldrh r1, [r1, 0x2C] + bl __divsi3 + cmp r0, 0 + bne _0804F636 + movs r0, 0x1 +_0804F636: + cmp r0, 0x45 + bgt _0804F63E + cmp r5, 0 + bne _0804F65C +_0804F63E: + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0xB1 + strb r4, [r0] + b _0804F68E + .pool +_0804F65C: + cmp r0, 0x27 + ble _0804F670 + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0xB1 + strb r6, [r0] + b _0804F68E + .pool +_0804F670: + cmp r0, 0x9 + ble _0804F684 + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0xB1 + movs r1, 0x2 + b _0804F68C + .pool +_0804F684: + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0xB1 + movs r1, 0x3 +_0804F68C: + strb r1, [r0] +_0804F68E: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atk73_cmd73 + + thumb_func_start atk74_hp_tresholds_2 +atk74_hp_tresholds_2: @ 804F6A4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =0x02022fec + ldr r7, [r0] + movs r0, 0x1 + mov r8, r0 + ands r7, r0 + cmp r7, 0 + bne _0804F73E + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + adds r4, r0, 0 + ldr r0, =0x02024064 + strb r4, [r0] + movs r0, 0x1 + eors r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + ldr r1, =0x0202449c + ldr r6, [r1] + lsrs r0, 23 + adds r0, r6 + adds r0, 0xA8 + ldrb r5, [r0] + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r4 + adds r0, r1 + ldrh r4, [r0, 0x28] + subs r1, r5, r4 + movs r0, 0x64 + muls r0, r1 + adds r1, r5, 0 + bl __divsi3 + adds r1, r0, 0 + cmp r4, r5 + bcc _0804F71C + adds r0, r6, 0 + adds r0, 0xB1 + strb r7, [r0] + b _0804F73E + .pool +_0804F71C: + cmp r0, 0x1D + bgt _0804F72A + adds r0, r6, 0 + adds r0, 0xB1 + mov r1, r8 + strb r1, [r0] + b _0804F73E +_0804F72A: + cmp r1, 0x45 + bgt _0804F736 + adds r1, r6, 0 + adds r1, 0xB1 + movs r0, 0x2 + b _0804F73C +_0804F736: + adds r1, r6, 0 + adds r1, 0xB1 + movs r0, 0x3 +_0804F73C: + strb r0, [r1] +_0804F73E: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk74_hp_tresholds_2 + + thumb_func_start atk75_8026A58 +atk75_8026A58: @ 804F754 + push {lr} + sub sp, 0x4 + ldr r2, =0x020244b8 + ldr r1, =0x0202420b + ldrb r0, [r1] + strb r0, [r2] + ldr r2, =0x0202406e + ldrb r0, [r1] + lsls r0, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r1, =0x02024744 + adds r0, r1 + ldr r1, =0x02024208 + ldrh r1, [r1] + lsls r2, 24 + lsrs r2, 24 + movs r3, 0x1 + str r3, [sp] + movs r3, 0 + bl ExecuteTableBasedItemEffect + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end atk75_8026A58 + + thumb_func_start sub_804F7AC +sub_804F7AC: @ 804F7AC + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r1, =0x02024064 + strb r0, [r1] + ldr r0, [r4] + ldrb r0, [r0, 0x2] + cmp r0, 0x1A + bls _0804F7CA + b _0804FD70 +_0804F7CA: + lsls r0, 2 + ldr r1, =_0804F7E0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0804F7E0: + .4byte _0804F84C + .4byte _0804F85C + .4byte _0804F8BC + .4byte _0804F8CC + .4byte _0804F8E4 + .4byte _0804F920 + .4byte _0804F958 + .4byte _0804F9E0 + .4byte _0804FA20 + .4byte _0804FACC + .4byte _0804FAE8 + .4byte _0804FB3C + .4byte _0804FB94 + .4byte _0804FC18 + .4byte _0804FC2C + .4byte _0804FC32 + .4byte _0804FC38 + .4byte _0804FC60 + .4byte _0804FC6A + .4byte _0804FC78 + .4byte _0804FC8C + .4byte _0804FCC4 + .4byte _0804FCD8 + .4byte _0804FCF0 + .4byte _0804FD1C + .4byte _0804FD30 + .4byte _0804FD5C +_0804F84C: + ldr r0, =0x02024064 + ldrb r0, [r0] + bl b_cancel_multi_turn_move_maybe + b _0804FD70 + .pool +_0804F85C: + ldr r1, =0x0202420b + ldr r4, =0x0202420c + ldrb r0, [r4] + strb r0, [r1] + ldrb r0, [r1] + bl battle_side_get_owner + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02024294 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r2, r1, r2 + ldrb r0, [r2, 0x8] + cmp r0, 0 + beq _0804F8A8 + ldr r1, =0x02024084 + ldrb r2, [r2, 0x9] + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _0804F8A8 + strb r2, [r4] + b _0804FD70 + .pool +_0804F8A8: + ldr r0, =0x0202420c + ldr r1, =0x02024064 + ldrb r1, [r1] + strb r1, [r0] + b _0804FD70 + .pool +_0804F8BC: + bl sub_803BB88 + ldr r1, =0x02024332 + strb r0, [r1] + b _0804FD70 + .pool +_0804F8CC: + ldr r0, =0x020241ea + ldrh r0, [r0] + movs r1, 0 + bl sub_80458E0 + ldr r1, =0x0202420c + strb r0, [r1] + b _0804FD70 + .pool +_0804F8E4: + ldr r2, =0x02024280 + ldr r1, =gUnknown_0832A328 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + lsls r0, 28 + ldr r2, [r2] + ands r2, r0 + cmp r2, 0 + beq _0804F914 + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1] + b _0804FD70 + .pool +_0804F914: + ldr r0, =0x02024332 + strb r2, [r0] + b _0804FD70 + .pool +_0804F920: + ldr r4, =0x0202437c + ldr r3, =0x02024064 + ldrb r0, [r3] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldrb r0, [r3] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r2, [r1] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + b _0804FD70 + .pool +_0804F958: + ldr r4, =0x0202406e + ldr r1, =0x0202449c + ldr r0, [r1] + ldrh r3, [r4] + ldrb r2, [r0, 0x10] + adds r6, r1, 0 + cmp r3, r2 + beq _0804F974 + ldrh r0, [r4, 0x4] + cmp r0, r2 + beq _0804F970 + b _0804FD70 +_0804F970: + cmp r3, r0 + bne _0804F988 +_0804F974: + ldr r1, =0x02024064 + movs r0, 0 + b _0804F98C + .pool +_0804F988: + ldr r1, =0x02024064 + movs r0, 0x2 +_0804F98C: + strb r0, [r1] + adds r5, r1, 0 + ldrb r2, [r5] + lsls r0, r2, 1 + adds r0, 0xC8 + ldr r1, [r6] + adds r4, r1, r0 + movs r3, 0 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r2 + adds r1, 0xC + adds r0, r1 + ldrh r0, [r0] + ldrh r2, [r4] + cmp r0, r2 + beq _0804F9CC + adds r6, r5, 0 + movs r5, 0x58 + adds r2, r1, 0 +_0804F9B4: + adds r3, 0x1 + cmp r3, 0x3 + bgt _0804F9CC + lsls r1, r3, 1 + ldrb r0, [r6] + muls r0, r5 + adds r1, r0 + adds r1, r2 + ldrh r0, [r1] + ldrh r1, [r4] + cmp r0, r1 + bne _0804F9B4 +_0804F9CC: + cmp r3, 0x4 + beq _0804F9D2 + b _0804FD70 +_0804F9D2: + movs r0, 0 + strh r0, [r4] + b _0804FD70 + .pool +_0804F9E0: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0xB + ands r0, r1 + cmp r0, 0x8 + beq _0804F9EE + b _0804FD70 +_0804F9EE: + ldr r1, =0x02024084 + ldrh r0, [r1, 0x28] + cmp r0, 0 + bne _0804F9F8 + b _0804FD70 +_0804F9F8: + adds r0, r1, 0 + adds r0, 0x80 + ldrh r0, [r0] + cmp r0, 0 + bne _0804FA04 + b _0804FD70 +_0804FA04: + ldr r0, =0x02024280 + ldr r1, [r0] + ldr r2, =0xffbfffff + ands r1, r2 + str r1, [r0] + b _0804FD70 + .pool +_0804FA20: + ldr r2, =0x02024332 + mov r8, r2 + movs r0, 0 + strb r0, [r2] + ldr r1, =0x02024474 + ldr r6, =0x02024064 + ldrb r0, [r2, 0x1] + strb r0, [r6] + strb r0, [r1, 0x17] + ldr r0, =0x0202449c + ldr r0, [r0] + adds r7, r0, 0 + adds r7, 0x92 + ldrb r3, [r7] + ldr r1, =gUnknown_0832A328 + ldrb r2, [r6] + lsls r0, r2, 2 + adds r0, r1 + ldr r5, [r0] + adds r0, r3, 0 + ands r0, r5 + cmp r0, 0 + beq _0804FA50 + b _0804FD70 +_0804FA50: + ldr r4, =0x02024084 + movs r0, 0x58 + mov r12, r0 + mov r1, r12 + muls r1, r2 + adds r2, r1, 0 + adds r1, r2, r4 + ldrh r0, [r1, 0x2C] + lsrs r0, 1 + ldrh r1, [r1, 0x28] + cmp r0, r1 + bcs _0804FA6A + b _0804FD70 +_0804FA6A: + cmp r1, 0 + bne _0804FA70 + b _0804FD70 +_0804FA70: + adds r0, r4, 0 + adds r0, 0x4C + adds r0, r2, r0 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + beq _0804FA82 + b _0804FD70 +_0804FA82: + orrs r3, r5 + strb r3, [r7] + movs r0, 0x1 + mov r2, r8 + strb r0, [r2] + ldrb r0, [r6] + mov r1, r12 + muls r1, r0 + adds r0, r1, 0 + adds r1, r4, 0 + adds r1, 0x48 + adds r0, r1 + ldr r0, [r0] + bl GetNatureFromPersonality + ldr r1, =gUnknown_0831C4F8 + lsls r0, 24 + lsrs r0, 24 + adds r0, r1 + ldrb r0, [r0] + mov r2, r8 + strb r0, [r2, 0x5] + b _0804FD70 + .pool +_0804FACC: + ldr r4, =0x02024332 + adds r0, r4, 0 + bl sub_81A5258 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + bne _0804FADE + b _0804FD78 +_0804FADE: + strb r3, [r4, 0x1] + b _0804FD70 + .pool +_0804FAE8: + ldr r0, =0x02024084 + adds r0, 0x80 + movs r1, 0 + strh r1, [r0] + ldr r2, =0x02024280 + ldr r3, =gUnknown_0832A328 + ldr r1, [r3, 0x4] + lsls r1, 28 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + ldr r0, =0x0202449c + ldr r2, [r0] + ldr r0, =0x000002a1 + adds r2, r0 + ldr r0, =0x0202406e + ldrh r0, [r0, 0x2] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x020242bc + adds r1, 0x34 + ldrb r0, [r1] + movs r2, 0x2 + b _0804FBF4 + .pool +_0804FB3C: + ldr r1, =0x02024084 + movs r0, 0 + strh r0, [r1, 0x28] + ldr r2, =0x02024280 + ldr r3, =gUnknown_0832A328 + ldr r1, [r3] + lsls r1, 28 + ldr r0, [r2] + orrs r0, r1 + movs r1, 0x80 + lsls r1, 15 + orrs r0, r1 + str r0, [r2] + ldr r0, =0x0202449c + ldr r2, [r0] + movs r1, 0xA8 + lsls r1, 2 + adds r2, r1 + ldr r0, =0x0202406e + ldrh r0, [r0] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + ldr r2, =0x020242bc + ldrb r0, [r2, 0x18] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2, 0x18] + b _0804FD70 + .pool +_0804FB94: + ldr r0, =0x02024084 + movs r1, 0 + strh r1, [r0, 0x28] + adds r0, 0x80 + strh r1, [r0] + ldr r2, =0x02024280 + ldr r3, =gUnknown_0832A328 + ldr r0, [r3] + lsls r0, 28 + ldr r1, [r2] + orrs r1, r0 + ldr r0, [r3, 0x4] + lsls r0, 28 + orrs r1, r0 + movs r0, 0x80 + lsls r0, 15 + orrs r1, r0 + str r1, [r2] + ldr r5, =0x0202449c + ldr r2, [r5] + movs r0, 0xA8 + lsls r0, 2 + adds r2, r0 + ldr r4, =0x0202406e + ldrh r0, [r4] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + ldr r2, [r5] + ldr r1, =0x000002a1 + adds r2, r1 + ldrh r0, [r4, 0x2] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x020242bc + ldrb r0, [r1, 0x18] + movs r2, 0x2 + orrs r0, r2 + strb r0, [r1, 0x18] + adds r1, 0x34 + ldrb r0, [r1] +_0804FBF4: + orrs r0, r2 + strb r0, [r1] + b _0804FD70 + .pool +_0804FC18: + movs r0, 0 + bl sub_8033E10 + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + b _0804FD70 + .pool +_0804FC2C: + bl sub_81A5BF8 + b _0804FD70 +_0804FC32: + bl sub_81A5D44 + b _0804FD70 +_0804FC38: + ldr r1, =gUnknown_085CD1C8 + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl get_battle_strings_ + ldr r0, =0x02022e2c + movs r1, 0x16 + bl battle_show_message_maybe + b _0804FD70 + .pool +_0804FC60: + movs r0, 0x16 + bl IsTextPrinterActive + lsls r0, 16 + b _0804FD24 +_0804FC6A: + bl sub_80A3678 + lsls r0, 24 + cmp r0, 0 + bne _0804FC76 + b _0804FD78 +_0804FC76: + b _0804FD70 +_0804FC78: + ldr r4, =0x02024064 + movs r0, 0x1 + strb r0, [r4] + ldr r0, =0x02024084 + adds r0, 0x58 + b _0804FCA2 + .pool +_0804FC8C: + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r0, 0x3 + bls _0804FD70 + ldr r4, =0x02024064 + movs r0, 0x3 + strb r0, [r4] + ldr r0, =0x02024084 + movs r2, 0x84 + lsls r2, 1 + adds r0, r2 +_0804FCA2: + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _0804FD70 + movs r0, 0 + movs r1, 0 + bl dp01_build_cmdbuf_x06_a + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + b _0804FD70 + .pool +_0804FCC4: + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x55 + bl MPlayVolumeControl + b _0804FD70 + .pool +_0804FCD8: + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl + b _0804FD70 + .pool +_0804FCF0: + ldr r0, =0x0202449c + ldr r2, [r0] + ldr r0, =0x000002a2 + adds r2, r0 + ldr r1, =gUnknown_0832A328 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + b _0804FD70 + .pool +_0804FD1C: + ldr r0, =0x02024064 + ldrb r0, [r0] + bl sub_805725C +_0804FD24: + cmp r0, 0 + bne _0804FD78 + b _0804FD70 + .pool +_0804FD30: + ldr r0, =0x02024064 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0804FD50 + ldr r1, =0x0202433a + movs r0, 0x5 + strb r0, [r1] + b _0804FD70 + .pool +_0804FD50: + ldr r1, =0x0202433a + movs r0, 0xA + strb r0, [r1] + b _0804FD70 + .pool +_0804FD5C: + movs r1, 0xCE + lsls r1, 1 + movs r0, 0 + movs r2, 0x1 + bl sub_8034300 + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution +_0804FD70: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x3 + str r0, [r1] +_0804FD78: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_804F7AC + + thumb_func_start atk77_setprotect +atk77_setprotect: @ 804FD8C + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r6, 0x1 + ldr r2, =0x02024260 + ldr r1, =0x0202420b + ldrb r3, [r1] + lsls r0, r3, 1 + adds r0, r2 + ldrh r0, [r0] + mov r8, r1 + ldr r7, =0x020242bc + cmp r0, 0xB6 + beq _0804FDBC + cmp r0, 0xC5 + beq _0804FDBC + cmp r0, 0xCB + beq _0804FDBC + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r7 + movs r1, 0 + strb r1, [r0, 0x8] +_0804FDBC: + ldr r0, =0x02024082 + ldrb r1, [r0] + ldr r0, =0x0202406c + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bne _0804FDCC + movs r6, 0 +_0804FDCC: + ldr r2, =gUnknown_0831C3D8 + mov r5, r8 + ldrb r1, [r5] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r7 + ldrb r4, [r0, 0x8] + lsls r4, 1 + adds r4, r2 + bl GenerateRandomNumber + ldrh r1, [r4] + lsls r0, 16 + lsrs r0, 16 + cmp r1, r0 + bcc _0804FE80 + cmp r6, 0 + beq _0804FE80 + ldr r4, =gBattleMoves + ldr r3, =0x020241ea + ldrh r0, [r3] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r1] + cmp r0, 0x6F + bne _0804FE1C + ldr r0, =0x0202433c + ldrb r1, [r5] + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x1 + orrs r0, r2 + strb r0, [r1] + ldr r1, =0x02024332 + movs r0, 0 + strb r0, [r1, 0x5] +_0804FE1C: + ldrh r0, [r3] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r1] + cmp r0, 0x74 + bne _0804FE42 + ldr r0, =0x0202433c + ldrb r1, [r5] + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x2 + orrs r0, r2 + strb r0, [r1] + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] +_0804FE42: + mov r1, r8 + ldrb r0, [r1] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r7 + ldrb r0, [r1, 0x8] + adds r0, 0x1 + strb r0, [r1, 0x8] + b _0804FEA2 + .pool +_0804FE80: + ldr r2, =0x020242bc + ldr r0, =0x0202420b + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strb r1, [r0, 0x8] + ldr r1, =0x02024332 + movs r0, 0x2 + strb r0, [r1, 0x5] + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] +_0804FEA2: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk77_setprotect + + thumb_func_start atk78_faintifabilitynotdamp +atk78_faintifabilitynotdamp: @ 804FEC8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =0x02024068 + ldr r2, [r0] + cmp r2, 0 + bne _0804FFCC + ldr r1, =0x0202420c + strb r2, [r1] + ldr r0, =0x0202406c + ldrb r3, [r0] + adds r5, r1, 0 + mov r8, r0 + ldr r6, =0x02024084 + cmp r2, r3 + bcs _0804FF14 + adds r0, r6, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x6 + beq _0804FF14 + adds r2, r3, 0 + adds r4, r6, 0 + movs r3, 0x58 +_0804FEF8: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, r2 + bcs _0804FF14 + ldrb r0, [r5] + muls r0, r3 + adds r0, r4 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x6 + bne _0804FEF8 +_0804FF14: + ldrb r0, [r5] + mov r1, r8 + ldrb r1, [r1] + cmp r0, r1 + bne _0804FFB0 + ldr r4, =0x02024064 + ldr r7, =0x0202420b + ldrb r0, [r7] + strb r0, [r4] + ldr r2, =0x020241f0 + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 + adds r0, r6 + ldrh r0, [r0, 0x28] + str r0, [r2] + ldr r1, =0x00007fff + movs r0, 0 + bl dp01_build_cmdbuf_x18_0_aa_health_bar_update + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + movs r0, 0 + strb r0, [r5] + mov r2, r8 + ldrb r0, [r2] + cmp r0, 0 + beq _0804FFCC + adds r3, r5, 0 + ldrb r5, [r7] + ldr r7, =gUnknown_0832A328 + adds r4, r0, 0 + ldr r6, =0x02024210 +_0804FF60: + ldrb r2, [r3] + cmp r2, r5 + beq _0804FF76 + ldrb r0, [r6] + ldrb r1, [r3] + lsls r1, 2 + adds r1, r7 + ldr r1, [r1] + ands r0, r1 + cmp r0, 0 + beq _0804FFCC +_0804FF76: + adds r0, r2, 0x1 + strb r0, [r3] + lsls r0, 24 + lsrs r0, 24 + cmp r0, r4 + bcc _0804FF60 + b _0804FFCC + .pool +_0804FFB0: + ldr r1, =0x0202420a + movs r0, 0x6 + strb r0, [r1] + ldrb r0, [r5] + movs r1, 0x58 + muls r1, r0 + adds r1, r6 + adds r1, 0x20 + ldrb r1, [r1] + bl b_history__record_ability_usage_of_player + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB560 + str r0, [r1] +_0804FFCC: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk78_faintifabilitynotdamp + + thumb_func_start atk79_setuserhptozero +atk79_setuserhptozero: @ 804FFE4 + push {r4,lr} + sub sp, 0x4 + ldr r0, =0x02024068 + ldr r3, [r0] + cmp r3, 0 + bne _08050028 + ldr r4, =0x02024064 + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r4] + ldr r1, =0x02024084 + ldrb r0, [r4] + movs r2, 0x58 + muls r0, r2 + adds r0, r1 + strh r3, [r0, 0x28] + ldrb r0, [r4] + muls r0, r2 + adds r1, 0x28 + adds r0, r1 + str r0, [sp] + movs r0, 0 + movs r1, 0x2A + movs r2, 0 + movs r3, 0x2 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_08050028: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk79_setuserhptozero + + thumb_func_start sub_8050044 +sub_8050044: @ 8050044 + push {r4-r7,lr} + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r4, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r4, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r4, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r4, r0 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + adds r7, r3, 0 + cmp r0, 0 + beq _080500DC + ldr r0, =0x0202420c + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + ldr r2, =0x0202420b + lsls r1, 24 + lsrs r1, 24 + adds r3, r0, 0 + ldr r6, =0x02024210 + ldr r5, =gUnknown_0832A328 + ldr r0, =0x0202406c + mov r12, r0 + ldrb r0, [r2] + cmp r1, r0 + bne _0805009A +_0805008A: + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r2] + cmp r0, r1 + beq _0805008A +_0805009A: + ldrb r0, [r6] + ldrb r1, [r3] + lsls r1, 2 + adds r1, r5 + ldr r1, [r1] + ands r0, r1 + cmp r0, 0 + bne _0805008A + ldrb r0, [r3] + mov r2, r12 + ldrb r2, [r2] + cmp r0, r2 + bcc _080500D8 + ldr r0, [r7] + adds r0, 0x5 + str r0, [r7] + b _080500E0 + .pool +_080500D8: + str r4, [r7] + b _080500E0 +_080500DC: + adds r0, r2, 0x5 + str r0, [r3] +_080500E0: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8050044 + + thumb_func_start sub_80500E8 +sub_80500E8: @ 80500E8 + push {r4-r6,lr} + ldr r4, =0x02024214 + ldr r1, [r4] + ldrb r2, [r1, 0x1] + ldrb r0, [r1, 0x2] + lsls r0, 8 + orrs r2, r0 + ldrb r0, [r1, 0x3] + lsls r0, 16 + orrs r2, r0 + ldrb r0, [r1, 0x4] + lsls r0, 24 + orrs r2, r0 + ldrb r0, [r1, 0x5] + ldr r3, =0x0202420c + cmp r0, 0x1 + bne _08050110 + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r3] +_08050110: + ldr r1, =0x020241f0 + ldr r6, =0x02024084 + ldrb r0, [r3] + movs r5, 0x58 + muls r0, r5 + adds r0, r6 + ldrh r0, [r0, 0x2C] + lsrs r0, 1 + str r0, [r1] + cmp r0, 0 + bne _0805012A + movs r0, 0x1 + str r0, [r1] +_0805012A: + ldr r0, [r1] + negs r0, r0 + str r0, [r1] + ldrb r0, [r3] + muls r0, r5 + adds r0, r6 + ldrh r1, [r0, 0x28] + ldrh r0, [r0, 0x2C] + cmp r1, r0 + bne _08050158 + str r2, [r4] + b _0805015E + .pool +_08050158: + ldr r0, [r4] + adds r0, 0x6 + str r0, [r4] +_0805015E: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80500E8 + + thumb_func_start sub_8050164 +sub_8050164: @ 8050164 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + ldr r2, =0x0202406c + ldr r0, =0x0202420b + mov r10, r0 + movs r1, 0 + add r0, sp, 0x4 +_0805017A: + strh r1, [r0] + subs r0, 0x2 + cmp r0, sp + bge _0805017A + movs r1, 0 + mov r8, r1 + movs r5, 0 + ldrb r1, [r2] + cmp r5, r1 + bge _080501D0 + ldr r0, =0x0202420b + ldrb r6, [r0] + ldr r2, =0x0000ffff + mov r9, r2 + lsls r4, r6, 3 + mov r2, sp + ldr r0, =0x0202449c + mov r12, r0 + adds r7, r1, 0 +_080501A0: + cmp r5, r6 + beq _080501C8 + mov r1, r12 + ldr r0, [r1] + adds r0, r4, r0 + adds r1, r0, 0 + adds r1, 0xE0 + ldrb r3, [r1] + adds r0, 0xE1 + ldrb r0, [r0] + lsls r0, 8 + orrs r3, r0 + cmp r3, 0 + beq _080501C8 + cmp r3, r9 + beq _080501C8 + strh r3, [r2] + adds r2, 0x2 + movs r0, 0x1 + add r8, r0 +_080501C8: + adds r4, 0x2 + adds r5, 0x1 + cmp r5, r7 + blt _080501A0 +_080501D0: + mov r1, r10 + ldrb r0, [r1] + ldr r2, =0x0202449c + ldr r1, [r2] + lsls r0, 1 + adds r0, r1 + adds r1, r0, 0 + adds r1, 0x98 + ldrb r3, [r1] + adds r0, 0x99 + ldrb r0, [r0] + lsls r0, 8 + orrs r3, r0 + cmp r3, 0 + beq _08050220 + ldr r0, =0x0000ffff + cmp r3, r0 + beq _08050220 + ldr r2, =0x02024280 + ldr r0, [r2] + ldr r1, =0xfffffbff + ands r0, r1 + str r0, [r2] + ldr r4, =0x020241ea + strh r3, [r4] + b _0805024A + .pool +_08050220: + mov r0, r8 + cmp r0, 0 + beq _08050290 + ldr r2, =0x02024280 + ldr r0, [r2] + ldr r1, =0xfffffbff + ands r0, r1 + str r0, [r2] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + mov r1, r8 + bl __modsi3 + adds r5, r0, 0 + ldr r4, =0x020241ea + lsls r0, r5, 1 + add r0, sp + ldrh r0, [r0] + strh r0, [r4] +_0805024A: + ldrh r0, [r4] + movs r1, 0 + bl sub_80458E0 + ldr r1, =0x0202420c + strb r0, [r1] + ldr r5, =0x02024214 + ldr r3, =gUnknown_082D86A8 + ldr r2, =gBattleMoves + ldrh r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + str r0, [r5] + b _080502AE + .pool +_08050290: + ldr r2, =0x0202437c + mov r0, r10 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_080502AE: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8050164 + + thumb_func_start sub_80502C8 +sub_80502C8: @ 80502C8 + push {lr} + ldr r2, =0x020243cc + ldrh r0, [r2] + movs r1, 0x7 + ands r1, r0 + cmp r1, 0 + beq _080502F4 + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024332 + movs r0, 0x2 + strb r0, [r1, 0x5] + b _08050304 + .pool +_080502F4: + movs r0, 0x1 + strh r0, [r2] + ldr r0, =0x02024332 + strb r1, [r0, 0x5] + ldr r0, =0x020243d0 + adds r0, 0x28 + movs r1, 0x5 + strb r1, [r0] +_08050304: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80502C8 + + thumb_func_start atk7E_setreflect +atk7E_setreflect: @ 805031C + push {r4-r6,lr} + ldr r6, =0x0202420b + ldrb r0, [r6] + bl battle_get_per_side_status + ldr r4, =0x0202428e + movs r5, 0x1 + adds r1, r5, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + ldrh r1, [r1] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _0805035C + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024332 + movs r0, 0 + b _080503D0 + .pool +_0805035C: + ldrb r0, [r6] + bl battle_get_per_side_status + adds r1, r5, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + ldrh r0, [r1] + movs r2, 0x1 + orrs r0, r2 + strh r0, [r1] + ldrb r0, [r6] + bl battle_get_per_side_status + ldr r4, =0x02024294 + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x5 + strb r1, [r0] + ldrb r0, [r6] + bl battle_get_per_side_status + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r6] + strb r1, [r0, 0x1] + ldr r0, =0x02022fec + ldr r0, [r0] + ands r0, r5 + cmp r0, 0 + beq _080503CC + movs r0, 0x1 + bl sub_8069DEC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x2 + bne _080503CC + ldr r0, =0x02024332 + strb r1, [r0, 0x5] + b _080503D2 + .pool +_080503CC: + ldr r1, =0x02024332 + movs r0, 0x1 +_080503D0: + strb r0, [r1, 0x5] +_080503D2: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atk7E_setreflect + + thumb_func_start sub_80503E8 +sub_80503E8: @ 80503E8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r7, =0x0202427c + ldrb r5, [r7] + movs r0, 0x29 + ands r0, r5 + cmp r0, 0 + bne _0805041A + ldr r0, =0x020242ac + mov r9, r0 + ldr r1, =0x0202420c + mov r8, r1 + ldrb r4, [r1] + lsls r0, r4, 2 + mov r2, r9 + adds r6, r0, r2 + ldr r2, [r6] + movs r0, 0x4 + mov r12, r0 + adds r3, r2, 0 + ands r3, r0 + cmp r3, 0 + beq _08050438 +_0805041A: + movs r0, 0x1 + orrs r0, r5 + strb r0, [r7] + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] + b _08050488 + .pool +_08050438: + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r4 + adds r1, r0, r1 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0xC + beq _08050454 + adds r0, r1, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0xC + bne _0805046C +_08050454: + movs r0, 0x1 + orrs r0, r5 + strb r0, [r7] + ldr r1, =0x02024332 + movs r0, 0x2 + strb r0, [r1, 0x5] + b _08050488 + .pool +_0805046C: + ldr r0, =0x0202420b + ldrb r0, [r0] + orrs r2, r0 + str r2, [r6] + mov r2, r8 + ldrb r1, [r2] + lsls r1, 2 + add r1, r9 + ldr r0, [r1] + mov r2, r12 + orrs r0, r2 + str r0, [r1] + ldr r0, =0x02024332 + strb r3, [r0, 0x5] +_08050488: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80503E8 + + thumb_func_start atk80_manipulatedamage +atk80_manipulatedamage: @ 80504A8 + push {r4,lr} + ldr r1, =0x02024214 + ldr r0, [r1] + ldrb r2, [r0, 0x1] + adds r4, r1, 0 + cmp r2, 0x1 + beq _080504D8 + cmp r2, 0x1 + bgt _080504C4 + cmp r2, 0 + beq _080504CA + b _08050518 + .pool +_080504C4: + cmp r2, 0x2 + beq _08050510 + b _08050518 +_080504CA: + ldr r1, =0x020241f0 + ldr r0, [r1] + negs r0, r0 + b _08050516 + .pool +_080504D8: + ldr r3, =0x020241f0 + ldr r0, [r3] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + str r0, [r3] + cmp r0, 0 + bne _080504EA + str r2, [r3] +_080504EA: + ldr r2, =0x02024084 + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0, 0x2C] + lsrs r1, r0, 1 + ldr r0, [r3] + cmp r1, r0 + bge _08050518 + str r1, [r3] + b _08050518 + .pool +_08050510: + ldr r1, =0x020241f0 + ldr r0, [r1] + lsls r0, 1 +_08050516: + str r0, [r1] +_08050518: + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk80_manipulatedamage + + thumb_func_start atk81_setrest +atk81_setrest: @ 8050528 + push {r4-r7,lr} + sub sp, 0x4 + ldr r0, =0x02024214 + mov r12, r0 + ldr r1, [r0] + ldrb r6, [r1, 0x1] + ldrb r0, [r1, 0x2] + lsls r0, 8 + orrs r6, r0 + ldrb r0, [r1, 0x3] + lsls r0, 16 + orrs r6, r0 + ldrb r0, [r1, 0x4] + lsls r0, 24 + orrs r6, r0 + ldr r5, =0x02024064 + ldr r2, =0x0202420c + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r2] + strb r0, [r5] + ldr r4, =0x020241f0 + ldr r1, =0x02024084 + ldrb r0, [r2] + movs r3, 0x58 + muls r0, r3 + adds r0, r1 + ldrh r0, [r0, 0x2C] + negs r0, r0 + str r0, [r4] + ldrb r0, [r2] + adds r4, r0, 0 + muls r4, r3 + adds r0, r4, r1 + ldrh r3, [r0, 0x28] + adds r7, r5, 0 + adds r5, r2, 0 + adds r2, r1, 0 + ldrh r0, [r0, 0x2C] + cmp r3, r0 + bne _08050598 + mov r0, r12 + str r6, [r0] + b _080505E8 + .pool +_08050598: + adds r0, r2, 0 + adds r0, 0x4C + adds r0, r4, r0 + ldr r1, [r0] + movs r0, 0xF8 + ands r1, r0 + cmp r1, 0 + beq _080505B4 + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] + b _080505B8 + .pool +_080505B4: + ldr r0, =0x02024332 + strb r1, [r0, 0x5] +_080505B8: + ldrb r0, [r5] + movs r3, 0x58 + muls r0, r3 + adds r2, 0x4C + adds r0, r2 + movs r1, 0x3 + str r1, [r0] + ldrb r0, [r7] + muls r0, r3 + adds r0, r2 + str r0, [sp] + movs r0, 0 + movs r1, 0x28 + movs r2, 0 + movs r3, 0x4 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r7] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_080505E8: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk81_setrest + + thumb_func_start atk82_jumpifnotfirstturn +atk82_jumpifnotfirstturn: @ 80505F8 + push {r4,r5,lr} + ldr r5, =0x02024214 + ldr r4, [r5] + ldrb r3, [r4, 0x1] + ldrb r0, [r4, 0x2] + lsls r0, 8 + orrs r3, r0 + ldrb r0, [r4, 0x3] + lsls r0, 16 + orrs r3, r0 + ldrb r0, [r4, 0x4] + lsls r0, 24 + orrs r3, r0 + ldr r2, =0x020242bc + ldr r0, =0x0202420b + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x16] + cmp r0, 0 + beq _08050638 + adds r0, r4, 0x5 + str r0, [r5] + b _0805063A + .pool +_08050638: + str r3, [r5] +_0805063A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end atk82_jumpifnotfirstturn + + thumb_func_start sub_8050640 +sub_8050640: @ 8050640 + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_8050640 + + thumb_func_start sub_8050650 +sub_8050650: @ 8050650 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r3, r0, 24 + movs r2, 0 + ldr r0, =0x0202406c + ldrb r1, [r0] + mov r8, r0 + cmp r2, r1 + bge _080506C4 + ldr r0, =0x02024084 + mov r12, r0 + movs r0, 0x58 + muls r0, r3 + add r0, r12 + adds r5, r0, 0 + adds r5, 0x20 + adds r4, r1, 0 + movs r3, 0 + ldr r6, =0x02024474 + ldr r7, =0x02024332 +_0805067C: + mov r0, r12 + adds r0, 0x50 + adds r0, r3, r0 + ldr r0, [r0] + movs r1, 0x70 + ands r0, r1 + cmp r0, 0 + beq _080506BC + ldrb r0, [r5] + cmp r0, 0x2B + beq _080506BC + movs r3, 0 + strb r2, [r6, 0x17] + ldr r1, =0x0202420c + ldrb r0, [r1] + cmp r0, 0xFF + beq _080506DC + cmp r0, r2 + beq _080506D0 + movs r0, 0x1 + strb r0, [r7, 0x5] + b _080506C4 + .pool +_080506BC: + adds r3, 0x58 + adds r2, 0x1 + cmp r2, r4 + blt _0805067C +_080506C4: + mov r1, r8 + ldrb r1, [r1] + cmp r2, r1 + beq _080506E0 + movs r0, 0x1 + b _080506E2 +_080506D0: + ldr r0, =0x02024332 + strb r3, [r0, 0x5] + b _080506C4 + .pool +_080506DC: + strb r2, [r1] + b _080506C4 +_080506E0: + movs r0, 0 +_080506E2: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8050650 + + thumb_func_start sub_80506EC +sub_80506EC: @ 80506EC + push {r4-r6,lr} + ldr r5, =0x02024214 + ldr r1, [r5] + ldrb r4, [r1, 0x1] + ldrb r0, [r1, 0x2] + lsls r0, 8 + orrs r4, r0 + ldrb r0, [r1, 0x3] + lsls r0, 16 + orrs r4, r0 + ldrb r0, [r1, 0x4] + lsls r0, 24 + orrs r4, r0 + ldr r6, =0x0202420c + ldrb r0, [r6] + bl sub_8050650 + lsls r0, 24 + cmp r0, 0 + beq _08050720 + str r4, [r5] + b _08050762 + .pool +_08050720: + ldr r1, =0x02024084 + ldrb r3, [r6] + movs r0, 0x58 + muls r0, r3 + adds r0, r1 + adds r0, 0x20 + ldrb r0, [r0] + adds r1, r0, 0 + cmp r1, 0xF + beq _08050738 + cmp r1, 0x48 + bne _0805075C +_08050738: + ldr r2, =0x0202420a + strb r0, [r2] + ldr r1, =0x02024332 + movs r0, 0x2 + strb r0, [r1, 0x5] + str r4, [r5] + ldrb r1, [r2] + adds r0, r3, 0 + bl b_history__record_ability_usage_of_player + b _08050762 + .pool +_0805075C: + ldr r0, [r5] + adds r0, 0x5 + str r0, [r5] +_08050762: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80506EC + + thumb_func_start sub_8050768 +sub_8050768: @ 8050768 + push {r4,r5,lr} + ldr r5, =0x020242bc + ldr r4, =0x0202420b + ldrb r1, [r4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r1, r0, r5 + ldrb r0, [r1, 0x9] + cmp r0, 0x3 + bne _080507A0 + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] + b _080507CA + .pool +_080507A0: + adds r0, 0x1 + movs r3, 0 + strb r0, [r1, 0x9] + ldr r2, =0x02022f58 + movs r0, 0xFD + strb r0, [r2] + movs r0, 0x1 + strb r0, [r2, 0x1] + strb r0, [r2, 0x2] + strb r0, [r2, 0x3] + ldrb r1, [r4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r0, [r0, 0x9] + strb r0, [r2, 0x4] + movs r0, 0xFF + strb r0, [r2, 0x5] + ldr r0, =0x02024332 + strb r3, [r0, 0x5] +_080507CA: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8050768 + + thumb_func_start atk86_stockpiletobasedamage +atk86_stockpiletobasedamage: @ 80507E4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + ldr r3, =0x02024214 + ldr r1, [r3] + ldrb r2, [r1, 0x1] + ldrb r0, [r1, 0x2] + lsls r0, 8 + orrs r2, r0 + ldrb r0, [r1, 0x3] + lsls r0, 16 + orrs r2, r0 + ldrb r0, [r1, 0x4] + lsls r0, 24 + orrs r2, r0 + ldr r7, =0x020242bc + ldr r6, =0x0202420b + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r7 + ldrb r0, [r0, 0x9] + cmp r0, 0 + bne _08050828 + str r2, [r3] + b _080508CA + .pool +_08050828: + ldr r0, =0x02024332 + ldrb r0, [r0, 0x6] + cmp r0, 0x1 + beq _080508B0 + ldr r0, =0x020241f0 + mov r8, r0 + ldr r4, =0x0202428e + ldr r5, =0x0202420c + ldrb r0, [r5] + bl battle_get_per_side_status + movs r1, 0x1 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + ldrh r3, [r1] + ldrb r0, [r6] + movs r4, 0x58 + muls r0, r4 + ldr r2, =0x02024084 + adds r0, r2 + ldrb r1, [r5] + muls r1, r4 + adds r1, r2 + ldr r2, =0x020241ea + ldrh r2, [r2] + movs r4, 0 + str r4, [sp] + str r4, [sp, 0x4] + ldrb r4, [r6] + str r4, [sp, 0x8] + ldrb r4, [r5] + str r4, [sp, 0xC] + bl sub_806957C + ldrb r2, [r6] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r7 + ldrb r1, [r1, 0x9] + adds r3, r0, 0 + muls r3, r1 + mov r1, r8 + str r3, [r1] + ldr r2, =0x02024474 + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r7 + ldrb r0, [r0, 0x9] + strb r0, [r2, 0x18] + ldr r1, =0x0202433c + ldrb r0, [r6] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 28 + cmp r0, 0 + bge _080508B0 + lsls r0, r3, 4 + subs r0, r3 + movs r1, 0xA + bl __divsi3 + mov r1, r8 + str r0, [r1] +_080508B0: + ldr r2, =0x020242bc + ldr r0, =0x0202420b + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strb r1, [r0, 0x9] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_080508CA: + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk86_stockpiletobasedamage + + thumb_func_start atk87_stockpiletohprecovery +atk87_stockpiletohprecovery: @ 8050904 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r7, =0x02024214 + ldr r1, [r7] + ldrb r2, [r1, 0x1] + ldrb r0, [r1, 0x2] + lsls r0, 8 + orrs r2, r0 + ldrb r0, [r1, 0x3] + lsls r0, 16 + orrs r2, r0 + ldrb r0, [r1, 0x4] + lsls r0, 24 + orrs r2, r0 + ldr r0, =0x020242bc + mov r8, r0 + ldr r6, =0x0202420b + ldrb r3, [r6] + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + mov r1, r8 + adds r4, r0, r1 + ldrb r1, [r4, 0x9] + cmp r1, 0 + bne _08050954 + str r2, [r7] + ldr r0, =0x02024332 + strb r1, [r0, 0x5] + b _080509D0 + .pool +_08050954: + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r3 + adds r1, r0, r1 + ldrh r0, [r1, 0x2C] + ldrh r3, [r1, 0x28] + cmp r0, r3 + bne _08050984 + movs r0, 0 + strb r0, [r4, 0x9] + str r2, [r7] + ldr r1, =0x0202420c + ldrb r0, [r6] + strb r0, [r1] + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] + b _080509D0 + .pool +_08050984: + ldr r5, =0x020241f0 + ldrh r0, [r1, 0x2C] + ldrb r1, [r4, 0x9] + movs r2, 0x3 + subs r2, r1 + movs r4, 0x1 + adds r1, r4, 0 + lsls r1, r2 + bl __divsi3 + str r0, [r5] + cmp r0, 0 + bne _080509A0 + str r4, [r5] +_080509A0: + ldr r0, [r5] + negs r0, r0 + str r0, [r5] + ldr r3, =0x02024474 + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r8 + ldrb r0, [r0, 0x9] + movs r2, 0 + strb r0, [r3, 0x18] + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r8 + strb r2, [r0, 0x9] + ldr r0, [r7] + adds r0, 0x5 + str r0, [r7] + ldr r1, =0x0202420c + ldrb r0, [r6] + strb r0, [r1] +_080509D0: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk87_stockpiletohprecovery + + thumb_func_start atk88_negativedamage +atk88_negativedamage: @ 80509E8 + push {lr} + ldr r2, =0x020241f0 + ldr r0, =0x020241f4 + ldr r0, [r0] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + negs r0, r0 + str r0, [r2] + cmp r0, 0 + bne _08050A04 + movs r0, 0x1 + negs r0, r0 + str r0, [r2] +_08050A04: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end atk88_negativedamage + + thumb_func_start sub_8050A1C +sub_8050A1C: @ 8050A1C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r8, r3 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r5, r2, 24 + movs r0, 0 + mov r9, r0 + mov r10, r0 + movs r0, 0x40 + ands r0, r5 + cmp r0, 0 + beq _08050A50 + ldr r0, =0x02024064 + ldr r1, =0x0202420b + b _08050A54 + .pool +_08050A50: + ldr r0, =0x02024064 + ldr r1, =0x0202420c +_08050A54: + ldrb r1, [r1] + strb r1, [r0] + movs r0, 0xBF + ands r5, r0 + movs r0, 0x80 + ands r0, r5 + cmp r0, 0 + beq _08050A6E + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_08050A6E: + movs r0, 0x7F + ands r5, r0 + movs r0, 0x20 + ands r0, r5 + cmp r0, 0 + beq _08050A84 + mov r0, r10 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 +_08050A84: + movs r0, 0xDF + ands r5, r0 + ldr r1, =0x02022f58 + movs r4, 0 + movs r2, 0xFD + strb r2, [r1] + movs r0, 0x5 + strb r0, [r1, 0x1] + strb r7, [r1, 0x2] + movs r3, 0x1 + negs r3, r3 + mov r12, r3 + movs r0, 0xFF + strb r0, [r1, 0x3] + lsls r0, r6, 24 + cmp r0, 0 + blt _08050AA8 + b _08050D8C +_08050AA8: + ldr r4, =0x02024294 + ldr r1, =0x02024064 + ldrb r0, [r1] + bl battle_get_per_side_status + movs r1, 0x1 + ands r1, r0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _08050B48 + mov r2, r9 + cmp r2, 0 + bne _08050B48 + ldr r0, =0x020241ea + ldrh r0, [r0] + cmp r0, 0xAE + beq _08050B78 + cmp r5, 0x1 + bne _08050B68 + ldr r4, =0x0202437c + ldr r3, =0x02024064 + ldrb r0, [r3] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r1] + lsls r0, 31 + cmp r0, 0 + beq _08050B10 + ldr r0, =0x02024214 + mov r4, r8 + str r4, [r0] + b _08050B68 + .pool +_08050B10: + mov r0, r8 + bl b_movescr_stack_push + ldr r1, =0x02024474 + ldr r6, =0x02024064 + ldrb r0, [r6] + strb r0, [r1, 0x17] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAE03 + str r0, [r1] + ldrb r1, [r6] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] + b _08050B68 + .pool +_08050B48: + ldr r0, =0x020241ea + ldrh r0, [r0] + cmp r0, 0xAE + beq _08050B78 + mov r0, r10 + cmp r0, 0x1 + beq _08050B78 + movs r0, 0 + bl sub_80464AC + lsls r0, 24 + cmp r0, 0 + beq _08050B78 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082D9F1C + str r0, [r1] +_08050B68: + movs r0, 0x1 + b _08050E80 + .pool +_08050B78: + ldr r2, =0x02024084 + ldr r1, =0x02024064 + ldrb r3, [r1] + movs r4, 0x58 + adds r0, r3, 0 + muls r0, r4 + adds r0, r2 + adds r0, 0x20 + ldrb r0, [r0] + mov r10, r2 + cmp r0, 0x1D + beq _08050B94 + cmp r0, 0x49 + bne _08050C2C +_08050B94: + mov r0, r9 + cmp r0, 0 + bne _08050C2C + ldr r0, =0x020241ea + ldrh r0, [r0] + cmp r0, 0xAE + beq _08050C2C + cmp r5, 0x1 + bne _08050B68 + ldr r4, =0x0202437c + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + beq _08050BD4 + ldr r0, =0x02024214 + mov r1, r8 + str r1, [r0] + b _08050B68 + .pool +_08050BD4: + mov r0, r8 + bl b_movescr_stack_push + ldr r1, =0x02024474 + ldr r2, =0x02024064 + ldrb r0, [r2] + strb r0, [r1, 0x17] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB5C7 + str r0, [r1] + ldr r1, =0x0202420a + ldrb r0, [r2] + movs r3, 0x58 + muls r0, r3 + add r0, r10 + adds r0, 0x20 + ldrb r0, [r0] + strb r0, [r1] + ldrb r0, [r2] + ldrb r1, [r1] + bl b_history__record_ability_usage_of_player + ldr r6, =0x02024064 + ldrb r1, [r6] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] + b _08050B68 + .pool +_08050C2C: + ldr r1, =0x02024064 + ldrb r0, [r1] + movs r4, 0x58 + muls r0, r4 + add r0, r10 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x33 + bne _08050C8C + mov r2, r9 + cmp r2, 0 + bne _08050C8C + cmp r7, 0x6 + bne _08050C8C + cmp r5, 0x1 + bne _08050B68 + mov r0, r8 + bl b_movescr_stack_push + ldr r1, =0x02024474 + ldr r3, =0x02024064 + ldrb r0, [r3] + strb r0, [r1, 0x17] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB62F + str r0, [r1] + ldr r1, =0x0202420a + ldrb r0, [r3] + muls r0, r4 + add r0, r10 + adds r0, 0x20 + ldrb r0, [r0] + strb r0, [r1] + ldrb r0, [r3] + ldrb r1, [r1] + bl b_history__record_ability_usage_of_player + b _08050B68 + .pool +_08050C8C: + ldr r4, =0x02024064 + ldrb r0, [r4] + movs r4, 0x58 + muls r0, r4 + add r0, r10 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x34 + bne _08050CF0 + mov r0, r9 + cmp r0, 0 + bne _08050CF0 + cmp r7, 0x1 + bne _08050CF0 + cmp r5, 0x1 + beq _08050CAE + b _08050B68 +_08050CAE: + mov r0, r8 + bl b_movescr_stack_push + ldr r1, =0x02024474 + ldr r2, =0x02024064 + ldrb r0, [r2] + strb r0, [r1, 0x17] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB62F + str r0, [r1] + ldr r1, =0x0202420a + ldrb r0, [r2] + muls r0, r4 + add r0, r10 + adds r0, 0x20 + ldrb r0, [r0] + strb r0, [r1] + ldrb r0, [r2] + ldrb r1, [r1] + bl b_history__record_ability_usage_of_player + b _08050B68 + .pool +_08050CF0: + ldr r3, =0x02024064 + ldrb r1, [r3] + movs r0, 0x58 + muls r0, r1 + add r0, r10 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x13 + bne _08050D08 + cmp r5, 0 + bne _08050D08 + b _08050B68 +_08050D08: + lsls r0, r6, 24 + asrs r0, 28 + movs r1, 0x7 + ands r0, r1 + negs r0, r0 + lsls r0, 24 + ldr r3, =0x02022f68 + movs r4, 0 + movs r1, 0xFD + strb r1, [r3] + movs r2, 0x1 + lsrs r6, r0, 24 + asrs r0, 24 + subs r1, 0xFF + cmp r0, r1 + bne _08050D32 + strb r4, [r3, 0x1] + movs r0, 0xD3 + strb r0, [r3, 0x2] + strb r4, [r3, 0x3] + movs r2, 0x4 +_08050D32: + adds r0, r2, r3 + strb r4, [r0] + adds r2, 0x1 + adds r1, r2, r3 + movs r0, 0xD4 + strb r0, [r1] + adds r2, 0x1 + adds r0, r2, r3 + strb r4, [r0] + adds r2, 0x1 + adds r1, r2, r3 + movs r0, 0xFF + strb r0, [r1] + ldr r4, =0x02024064 + ldrb r2, [r4] + movs r0, 0x58 + muls r0, r2 + adds r0, r7, r0 + mov r1, r10 + adds r1, 0x18 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + beq _08050DE2 + movs r1, 0 + ldr r0, =0x0202420c + ldrb r0, [r0] + ldr r3, =0x02024332 + mov r8, r3 + cmp r0, r2 + bne _08050D76 + movs r1, 0x1 +_08050D76: + mov r4, r8 + strb r1, [r4, 0x5] + b _08050E10 + .pool +_08050D8C: + asrs r6, r0, 28 + movs r0, 0x7 + ands r6, r0 + ldr r3, =0x02022f68 + strb r2, [r3] + movs r2, 0x1 + cmp r6, 0x2 + bne _08050DA6 + strb r4, [r3, 0x1] + movs r0, 0xD1 + strb r0, [r3, 0x2] + strb r4, [r3, 0x3] + movs r2, 0x4 +_08050DA6: + adds r0, r2, r3 + strb r4, [r0] + adds r2, 0x1 + adds r1, r2, r3 + movs r0, 0xD2 + strb r0, [r1] + adds r2, 0x1 + adds r0, r2, r3 + strb r4, [r0] + adds r2, 0x1 + adds r1, r2, r3 + ldrb r0, [r1] + mov r2, r12 + orrs r0, r2 + strb r0, [r1] + ldr r2, =0x02024084 + ldr r4, =0x02024064 + ldrb r3, [r4] + movs r0, 0x58 + muls r0, r3 + adds r0, r7, r0 + adds r1, r2, 0 + adds r1, 0x18 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + mov r10, r2 + cmp r0, 0xC + bne _08050DFC +_08050DE2: + ldr r1, =0x02024332 + movs r0, 0x2 + strb r0, [r1, 0x5] + mov r8, r1 + b _08050E10 + .pool +_08050DFC: + movs r1, 0 + ldr r0, =0x0202420c + ldrb r0, [r0] + ldr r2, =0x02024332 + mov r8, r2 + cmp r0, r3 + bne _08050E0C + movs r1, 0x1 +_08050E0C: + mov r3, r8 + strb r1, [r3, 0x5] +_08050E10: + ldr r2, =0x02024064 + ldrb r0, [r2] + movs r4, 0x58 + adds r1, r0, 0 + muls r1, r4 + adds r1, r7, r1 + mov r3, r10 + adds r3, 0x18 + adds r1, r3 + lsls r0, r6, 24 + asrs r0, 24 + ldrb r6, [r1] + adds r0, r6 + strb r0, [r1] + ldrb r0, [r2] + muls r0, r4 + adds r0, r7, r0 + adds r1, r0, r3 + movs r0, 0 + ldrsb r0, [r1, r0] + cmp r0, 0 + bge _08050E40 + movs r0, 0 + strb r0, [r1] +_08050E40: + ldr r1, =0x02024064 + ldrb r0, [r1] + muls r0, r4 + adds r0, r7, r0 + adds r1, r0, r3 + movs r0, 0 + ldrsb r0, [r1, r0] + cmp r0, 0xC + ble _08050E56 + movs r0, 0xC + strb r0, [r1] +_08050E56: + mov r2, r8 + ldrb r0, [r2, 0x5] + cmp r0, 0x2 + bne _08050E7E + movs r3, 0x1 + ands r3, r5 + cmp r3, 0 + beq _08050E70 + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] +_08050E70: + mov r4, r8 + ldrb r0, [r4, 0x5] + cmp r0, 0x2 + bne _08050E7E + cmp r3, 0 + bne _08050E7E + b _08050B68 +_08050E7E: + movs r0, 0 +_08050E80: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8050A1C + + thumb_func_start atk89_statbuffchange +atk89_statbuffchange: @ 8050EA0 + push {r4,r5,lr} + ldr r5, =0x02024214 + ldr r2, [r5] + ldrb r3, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r3, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + orrs r3, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + orrs r3, r0 + ldr r0, =0x02024474 + ldrb r4, [r0, 0x1A] + movs r0, 0xF0 + ands r0, r4 + lsls r0, 24 + asrs r0, 24 + movs r1, 0xF + ands r1, r4 + ldrb r2, [r2, 0x1] + bl sub_8050A1C + lsls r0, 24 + cmp r0, 0 + bne _08050EDC + ldr r0, [r5] + adds r0, 0x6 + str r0, [r5] +_08050EDC: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk89_statbuffchange + + thumb_func_start atk8A_normalisebuffs +atk8A_normalisebuffs: @ 8050EEC + push {r4-r7,lr} + movs r2, 0 + ldr r0, =0x0202406c + ldrb r1, [r0] + ldr r0, =0x02024214 + mov r12, r0 + cmp r2, r1 + bge _08050F24 + ldr r0, =0x02024084 + movs r4, 0x6 + adds r5, r1, 0 + movs r7, 0x58 + adds r6, r0, 0 + adds r6, 0x18 +_08050F08: + adds r3, r2, 0x1 + movs r1, 0x7 + adds r0, r2, 0 + muls r0, r7 + adds r0, r6 + adds r0, 0x7 +_08050F14: + strb r4, [r0] + subs r0, 0x1 + subs r1, 0x1 + cmp r1, 0 + bge _08050F14 + adds r2, r3, 0 + cmp r2, r5 + blt _08050F08 +_08050F24: + mov r1, r12 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk8A_normalisebuffs + + thumb_func_start atk8B_setbide +atk8B_setbide: @ 8050F40 + push {r4,r5,lr} + ldr r4, =0x02024084 + ldr r3, =0x0202420b + ldrb r0, [r3] + movs r5, 0x58 + adds r2, r0, 0 + muls r2, r5 + adds r4, 0x50 + adds r2, r4 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 5 + orrs r0, r1 + str r0, [r2] + ldr r1, =0x02024268 + ldrb r0, [r3] + lsls r0, 1 + adds r0, r1 + ldr r1, =0x020241ea + ldrh r1, [r1] + movs r2, 0 + strh r1, [r0] + ldr r1, =0x020241f8 + ldrb r0, [r3] + lsls r0, 2 + adds r0, r1 + str r2, [r0] + ldrb r0, [r3] + adds r1, r0, 0 + muls r1, r5 + adds r1, r4 + ldr r0, [r1] + movs r2, 0x80 + lsls r2, 2 + orrs r0, r2 + str r0, [r1] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk8B_setbide + + thumb_func_start atk8C_confuseifrepeatingattackends +atk8C_confuseifrepeatingattackends: @ 8050FB0 + push {lr} + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0xC0 + lsls r1, 4 + ands r0, r1 + cmp r0, 0 + bne _08050FD2 + ldr r1, =0x02024332 + movs r0, 0x75 + strb r0, [r1, 0x3] +_08050FD2: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end atk8C_confuseifrepeatingattackends + + thumb_func_start atk8D_setloopcounter +atk8D_setloopcounter: @ 8050FF0 + push {r4,r5,lr} + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r1, [r0, 0x1] + cmp r1, 0 + beq _0805100C + ldr r0, =0x02024212 + strb r1, [r0] + b _08051026 + .pool +_0805100C: + ldr r4, =0x02024212 + bl GenerateRandomNumber + movs r5, 0x3 + ands r0, r5 + strb r0, [r4] + cmp r0, 0x1 + bls _08051022 + bl GenerateRandomNumber + ands r0, r5 +_08051022: + adds r0, 0x2 + strb r0, [r4] +_08051026: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk8D_setloopcounter + + thumb_func_start atk8E_cmd8e +atk8E_cmd8e: @ 805103C + ldr r1, =0x02024474 + movs r2, 0 + movs r0, 0xFD + strb r0, [r1, 0x8] + movs r0, 0x1 + strb r0, [r1, 0x9] + strb r0, [r1, 0xA] + strb r0, [r1, 0xB] + strb r2, [r1, 0xC] + movs r0, 0xFF + strb r0, [r1, 0xD] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end atk8E_cmd8e + + thumb_func_start sub_8051064 +sub_8051064: @ 8051064 + push {r4-r7,lr} + ldr r6, =0x02024084 + ldr r7, =0x0202420b + ldrb r0, [r7] + movs r5, 0x58 + adds r1, r0, 0 + muls r1, r5 + adds r1, r6 + adds r1, 0x2A + ldr r4, =0x0202420c + ldrb r3, [r4] + adds r0, r3, 0 + muls r0, r5 + adds r0, r6 + adds r0, 0x2A + ldrb r1, [r1] + ldrb r0, [r0] + cmp r1, r0 + bcc _080510AC + ldr r0, =0x0202449c + ldr r1, [r0] + adds r1, r3, r1 + adds r1, 0x58 + ldr r2, =0x0202406e + lsls r0, r3, 1 + b _08051108 + .pool +_080510AC: + bl GenerateRandomNumber + movs r3, 0xFF + ands r3, r0 + ldrb r0, [r7] + muls r0, r5 + adds r0, r6 + adds r0, 0x2A + ldrb r2, [r0] + ldrb r4, [r4] + adds r0, r4, 0 + muls r0, r5 + adds r0, r6 + adds r0, 0x2A + ldrb r1, [r0] + adds r2, r1 + adds r0, r3, 0 + muls r0, r2 + asrs r0, 8 + adds r0, 0x1 + lsrs r1, 2 + cmp r0, r1 + bhi _080510FC + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + movs r0, 0 + b _08051116 + .pool +_080510FC: + ldr r0, =0x0202449c + ldr r1, [r0] + adds r1, r4, r1 + adds r1, 0x58 + ldr r2, =0x0202406e + lsls r0, r4, 1 +_08051108: + adds r0, r2 + ldrh r0, [r0] + strb r0, [r1] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DADD8 + str r0, [r1] + movs r0, 0x1 +_08051116: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8051064 + + thumb_func_start sub_805112C +sub_805112C: @ 805112C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + movs r0, 0 + str r0, [sp, 0x4] + ldr r5, =0x02022fec + ldr r0, [r5] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + bne _0805114A + b _08051410 +_0805114A: + ldr r4, =0x0202420c + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + ldr r1, =0x02024744 + str r1, [sp] + cmp r0, 0 + bne _08051160 + ldr r0, =0x020244ec + str r0, [sp] +_08051160: + ldr r2, [r5] + movs r1, 0x81 + lsls r1, 1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, r1 + beq _08051182 + ldr r1, =0x02000100 + adds r0, r2, 0 + ands r0, r1 + cmp r0, r1 + beq _08051182 + movs r0, 0x80 + lsls r0, 15 + ands r0, r2 + cmp r0, 0 + beq _080511C8 +_08051182: + ldr r2, =0x0202420c + ldrb r1, [r2] + movs r0, 0x2 + ands r0, r1 + adds r1, r2, 0 + cmp r0, 0 + beq _080511AC + movs r0, 0x3 + mov r9, r0 + movs r0, 0x6 + b _080511B2 + .pool +_080511AC: + movs r0, 0 + mov r9, r0 + movs r0, 0x3 +_080511B2: + mov r8, r0 + movs r0, 0x3 + mov r10, r0 + movs r0, 0x1 + str r0, [sp, 0x8] + ldr r2, =0x0202406e + ldrb r1, [r1] + b _0805128E + .pool +_080511C8: + movs r0, 0x42 + ands r0, r2 + cmp r0, 0x42 + beq _080511DA + ldr r1, =0x02000040 + adds r0, r2, 0 + ands r0, r1 + cmp r0, r1 + bne _0805121C +_080511DA: + ldrb r0, [r4] + bl sub_806D864 + lsls r0, 24 + lsrs r0, 24 + bl sub_806D82C + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bne _080511FC + movs r1, 0x3 + mov r9, r1 + movs r0, 0x6 + b _08051202 + .pool +_080511FC: + movs r1, 0 + mov r9, r1 + movs r0, 0x3 +_08051202: + mov r8, r0 + movs r1, 0x3 + mov r10, r1 + movs r0, 0x1 + str r0, [sp, 0x8] + ldr r2, =0x0202406e + ldr r0, =0x0202420c + ldrb r1, [r0] + b _0805128E + .pool +_0805121C: + movs r0, 0x80 + lsls r0, 8 + ands r0, r2 + cmp r0, 0 + beq _08051274 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08051240 + movs r1, 0 + mov r9, r1 + movs r0, 0x6 + mov r8, r0 + mov r10, r0 + movs r1, 0x2 + b _08051260 +_08051240: + ldrb r1, [r4] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08051252 + movs r0, 0x3 + mov r9, r0 + movs r1, 0x6 + b _08051258 +_08051252: + movs r0, 0 + mov r9, r0 + movs r1, 0x3 +_08051258: + mov r8, r1 + movs r0, 0x3 + mov r10, r0 + movs r1, 0x1 +_08051260: + str r1, [sp, 0x8] + ldr r2, =0x0202406e + ldr r0, =0x0202420c + ldrb r1, [r0] + b _0805128E + .pool +_08051274: + movs r0, 0x1 + ands r2, r0 + cmp r2, 0 + beq _080512A4 + movs r0, 0 + mov r9, r0 + movs r1, 0x6 + mov r8, r1 + mov r10, r1 + movs r0, 0x2 + str r0, [sp, 0x8] + ldr r2, =0x0202406e + ldrb r1, [r4] +_0805128E: + lsls r0, r1, 1 + adds r0, r2 + ldrh r7, [r0] + movs r0, 0x2 + eors r1, r0 + lsls r1, 1 + adds r1, r2 + ldrh r5, [r1] + b _080512BE + .pool +_080512A4: + movs r1, 0 + mov r9, r1 + movs r0, 0x6 + mov r8, r0 + mov r10, r0 + movs r1, 0x1 + str r1, [sp, 0x8] + ldr r1, =0x0202406e + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r5, [r0] + adds r7, r5, 0 +_080512BE: + mov r6, r9 + cmp r6, r8 + bge _080512FC +_080512C4: + movs r0, 0x64 + muls r0, r6 + ldr r1, [sp] + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _080512F6 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _080512F6 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _080512F6 + ldr r0, [sp, 0x4] + adds r0, 0x1 + str r0, [sp, 0x4] +_080512F6: + adds r6, 0x1 + cmp r6, r8 + blt _080512C4 +_080512FC: + ldr r1, [sp, 0x4] + ldr r0, [sp, 0x8] + cmp r1, r0 + bgt _08051328 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08051414 + .pool +_08051328: + bl sub_8051064 + lsls r0, 24 + cmp r0, 0 + beq _08051378 +_08051332: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + mov r1, r10 + bl __modsi3 + adds r6, r0, 0 + add r6, r9 + cmp r6, r7 + beq _08051332 + cmp r6, r5 + beq _08051332 + movs r0, 0x64 + muls r0, r6 + ldr r1, [sp] + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _08051332 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0x1 + beq _08051332 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _08051332 +_08051378: + ldr r4, =0x0202420c + ldrb r0, [r4] + ldr r1, =0x0202449c + ldr r1, [r1] + adds r0, r1 + adds r0, 0x5C + strb r6, [r0] + bl sub_81B1250 + lsls r0, 24 + cmp r0, 0 + bne _08051396 + ldrb r0, [r4] + bl sub_803BDA0 +_08051396: + ldr r0, =0x02022fec + ldr r2, [r0] + movs r1, 0x81 + lsls r1, 1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, r1 + beq _080513C0 + movs r0, 0x42 + ands r0, r2 + cmp r0, 0x42 + beq _080513C0 + ldr r1, =0x02000100 + adds r0, r2, 0 + ands r0, r1 + cmp r0, r1 + beq _080513C0 + ldr r0, =0x02000040 + ands r2, r0 + cmp r2, r0 + bne _080513DE +_080513C0: + ldr r5, =0x0202420c + ldrb r0, [r5] + lsls r4, r6, 24 + lsrs r4, 24 + adds r1, r4, 0 + movs r2, 0 + bl sub_81B8E80 + ldrb r1, [r5] + movs r0, 0x2 + eors r0, r1 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_81B8E80 +_080513DE: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _08051414 + ldr r0, =0x0202420c + ldrb r0, [r0] + lsls r1, r6, 24 + lsrs r1, 24 + bl sub_80571DC + b _08051414 + .pool +_08051410: + bl sub_8051064 +_08051414: + 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_805112C + + thumb_func_start sub_8051424 +sub_8051424: @ 8051424 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r6, 0 + ldr r2, =0x02024084 + ldr r3, =0x0202420b + ldrb r1, [r3] + movs r0, 0x58 + muls r0, r1 + adds r1, r2, 0 + adds r1, 0xC + adds r0, r1 + ldrh r0, [r0] + mov r8, r2 + cmp r0, 0 + beq _08051466 + movs r5, 0x58 + adds r2, r1, 0 +_0805144C: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x3 + bhi _08051466 + lsls r1, r6, 1 + ldrb r0, [r3] + muls r0, r5 + adds r1, r0 + adds r1, r2 + ldrh r0, [r1] + cmp r0, 0 + bne _0805144C +_08051466: + movs r3, 0 + cmp r3, r6 + bcs _080514E8 + ldr r0, =gBattleMoves + mov r10, r0 + ldr r5, =0x02024084 + mov r12, r5 + ldr r7, =0x0202420b + ldrb r0, [r7] + movs r4, 0x58 + adds r5, r0, 0 + muls r5, r4 + movs r0, 0xC + add r0, r12 + mov r9, r0 +_08051484: + lsls r0, r3, 1 + adds r0, r5 + add r0, r9 + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + add r0, r10 + ldrb r2, [r0, 0x2] + cmp r2, 0x9 + bne _080514C6 + mov r0, r8 + adds r1, r5, r0 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0x7 + beq _080514B2 + adds r0, r1, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0x7 + bne _080514C4 +_080514B2: + movs r2, 0x7 + b _080514C6 + .pool +_080514C4: + movs r2, 0 +_080514C6: + ldrb r0, [r7] + muls r0, r4 + add r0, r12 + adds r1, r0, 0 + adds r1, 0x21 + ldrb r1, [r1] + cmp r2, r1 + beq _080514DE + adds r0, 0x22 + ldrb r0, [r0] + cmp r2, r0 + bne _080514E8 +_080514DE: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r6 + bcc _08051484 +_080514E8: + cmp r3, r6 + bne _0805150C + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _080515B0 + .pool +_0805150C: + movs r7, 0x3 + ldr r5, =gBattleMoves + mov r9, r5 +_08051512: + bl GenerateRandomNumber + adds r3, r0, 0 + ands r3, r7 + cmp r3, r6 + bcs _08051512 + ldr r4, =0x02024084 + lsls r1, r3, 1 + ldr r3, =0x0202420b + ldrb r2, [r3] + movs r0, 0x58 + adds r5, r2, 0 + muls r5, r0 + adds r1, r5 + adds r0, r4, 0 + adds r0, 0xC + adds r1, r0 + ldrh r1, [r1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + add r0, r9 + ldrb r2, [r0, 0x2] + mov r8, r4 + adds r4, r3, 0 + cmp r2, 0x9 + bne _08051572 + mov r0, r8 + adds r2, r5, r0 + adds r0, r2, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0x7 + beq _08051560 + adds r0, r2, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0x7 + bne _08051570 +_08051560: + movs r2, 0x7 + b _08051572 + .pool +_08051570: + movs r2, 0 +_08051572: + ldrb r0, [r4] + movs r3, 0x58 + muls r0, r3 + add r0, r8 + adds r1, r0, 0 + adds r1, 0x21 + ldrb r5, [r1] + cmp r2, r5 + beq _08051512 + adds r0, 0x22 + ldrb r0, [r0] + cmp r2, r0 + beq _08051512 + strb r2, [r1] + ldrb r0, [r4] + muls r0, r3 + add r0, r8 + adds r0, 0x22 + strb r2, [r0] + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x3 + strb r0, [r1, 0x1] + strb r2, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x3] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_080515B0: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8051424 + + thumb_func_start atk91_givemoney +atk91_givemoney: @ 80515C8 + push {r4,lr} + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x02000002 + ands r0, r1 + cmp r0, 0 + bne _08051650 + ldr r1, =0x0202432e + ldrh r0, [r1] + cmp r0, 0 + beq _08051650 + adds r1, r0, 0 + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x4A + ldrb r0, [r0] + adds r4, r1, 0 + muls r4, r0 + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + adds r1, r4, 0 + bl add_money + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x1 + strb r0, [r1, 0x1] + movs r0, 0x2 + strb r0, [r1, 0x2] + movs r0, 0x5 + strb r0, [r1, 0x3] + strb r4, [r1, 0x4] + movs r0, 0xFF + lsls r0, 8 + ands r4, r0 + lsrs r4, 8 + strb r4, [r1, 0x5] + movs r0, 0xFF + strb r0, [r1, 0x6] + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082DB307 + str r0, [r4] + b _08051658 + .pool +_08051650: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_08051658: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk91_givemoney + + thumb_func_start atk92_setlightscreen +atk92_setlightscreen: @ 8051664 + push {r4-r6,lr} + ldr r5, =0x0202420b + ldrb r0, [r5] + bl battle_get_per_side_status + ldr r4, =0x0202428e + movs r6, 0x1 + adds r1, r6, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + ldrh r1, [r1] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080516A4 + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024332 + movs r0, 0 + b _08051718 + .pool +_080516A4: + ldrb r0, [r5] + bl battle_get_per_side_status + adds r1, r6, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + ldrh r0, [r1] + movs r2, 0x2 + orrs r0, r2 + strh r0, [r1] + ldrb r0, [r5] + bl battle_get_per_side_status + ldr r4, =0x02024294 + adds r1, r6, 0 + ands r1, r0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x5 + strb r1, [r0, 0x2] + ldrb r0, [r5] + bl battle_get_per_side_status + adds r1, r6, 0 + ands r1, r0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r5] + strb r1, [r0, 0x3] + ldr r0, =0x02022fec + ldr r0, [r0] + ands r0, r6 + cmp r0, 0 + beq _08051714 + movs r0, 0x1 + bl sub_8069DEC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08051714 + ldr r1, =0x02024332 + movs r0, 0x4 + b _08051718 + .pool +_08051714: + ldr r1, =0x02024332 + movs r0, 0x3 +_08051718: + strb r0, [r1, 0x5] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atk92_setlightscreen + + thumb_func_start atk93_ko_move +atk93_ko_move: @ 8051730 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r7, =0x02024084 + ldr r6, =0x0202420c + ldrb r2, [r6] + movs r5, 0x58 + adds r0, r2, 0 + muls r0, r5 + adds r1, r0, r7 + ldrh r0, [r1, 0x2E] + cmp r0, 0xAF + bne _08051768 + ldr r1, =0x02024404 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r4, [r0, 0x7] + ldrb r6, [r0, 0x1A] + b _08051782 + .pool +_08051768: + ldrh r0, [r1, 0x2E] + bl itemid_get_x12 + lsls r0, 24 + lsrs r4, r0, 24 + ldrb r0, [r6] + muls r0, r5 + adds r0, r7 + ldrh r0, [r0, 0x2E] + bl itemid_get_quality + lsls r0, 24 + lsrs r6, r0, 24 +_08051782: + ldr r1, =0x0202420f + ldr r5, =0x0202420c + ldrb r0, [r5] + strb r0, [r1] + cmp r4, 0x27 + bne _080517C0 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, r6 + bcs _080517C0 + ldrb r0, [r5] + movs r1, 0x27 + bl b_history__record_item_x12_of_player + ldr r2, =0x0202437c + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0] +_080517C0: + ldr r1, =0x02024084 + ldr r2, =0x0202420c + ldrb r3, [r2] + movs r6, 0x58 + adds r0, r3, 0 + muls r0, r6 + adds r5, r0, r1 + adds r0, r5, 0 + adds r0, 0x20 + ldrb r4, [r0] + mov r8, r1 + mov r9, r2 + cmp r4, 0x5 + bne _0805181C + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r0, =0x0202420a + strb r4, [r0] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB552 + str r0, [r1] + mov r1, r9 + ldrb r0, [r1] + movs r1, 0x5 + bl b_history__record_ability_usage_of_player + b _08051A70 + .pool +_0805181C: + ldr r1, =0x020242ac + lsls r0, r3, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x18 + ands r0, r1 + cmp r0, 0 + bne _080518A0 + ldr r1, =gBattleMoves + ldr r0, =0x020241ea + ldrh r0, [r0] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + adds r2, r1 + ldr r7, =0x0202420b + ldrb r0, [r7] + muls r0, r6 + add r0, r8 + adds r0, 0x2A + ldrb r0, [r0] + adds r1, r5, 0 + adds r1, 0x2A + ldrb r1, [r1] + subs r0, r1 + ldrb r2, [r2, 0x3] + adds r0, r2 + lsls r0, 16 + lsrs r4, r0, 16 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + adds r0, 0x1 + cmp r0, r4 + blt _08051870 + b _08051A08 +_08051870: + ldrb r0, [r7] + adds r1, r0, 0 + muls r1, r6 + add r1, r8 + adds r1, 0x2A + mov r2, r9 + ldrb r0, [r2] + muls r0, r6 + add r0, r8 + adds r0, 0x2A + ldrb r1, [r1] + movs r4, 0x1 + ldrb r0, [r0] + cmp r1, r0 + bcs _08051936 + b _08051A08 + .pool +_080518A0: + ldr r1, =0x020242bc + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldr r1, =0x0202420b + ldrb r0, [r0, 0x15] + adds r7, r1, 0 + ldrb r3, [r7] + cmp r0, r3 + bne _080518CA + ldrb r0, [r7] + muls r0, r6 + add r0, r8 + adds r0, 0x2A + adds r1, r5, 0 + adds r1, 0x2A + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bcs _08051942 +_080518CA: + ldr r1, =gBattleMoves + ldr r0, =0x020241ea + ldrh r0, [r0] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + adds r2, r1 + ldr r6, =0x02024084 + ldrb r0, [r7] + movs r5, 0x58 + muls r0, r5 + adds r0, r6 + adds r0, 0x2A + ldrb r1, [r0] + ldr r0, =0x0202420c + mov r8, r0 + ldrb r0, [r0] + muls r0, r5 + adds r0, r6 + adds r0, 0x2A + ldrb r0, [r0] + subs r1, r0 + ldrb r2, [r2, 0x3] + adds r1, r2 + lsls r1, 16 + lsrs r4, r1, 16 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + adds r0, 0x1 + cmp r0, r4 + bge _08051934 + ldrb r0, [r7] + adds r1, r0, 0 + muls r1, r5 + adds r1, r6 + adds r1, 0x2A + mov r2, r8 + ldrb r0, [r2] + muls r0, r5 + adds r0, r6 + adds r0, 0x2A + ldrb r1, [r1] + movs r4, 0x1 + ldrb r0, [r0] + cmp r1, r0 + bcs _08051936 +_08051934: + movs r4, 0 +_08051936: + ldr r3, =0x02024084 + mov r8, r3 + ldr r0, =0x0202420c + mov r9, r0 + cmp r4, 0 + beq _08051A08 +_08051942: + ldr r0, =0x0202433c + mov r1, r9 + ldrb r2, [r1] + lsls r1, r2, 4 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 30 + cmp r0, 0 + bge _08051990 + ldr r1, =0x020241f0 + movs r0, 0x58 + muls r0, r2 + add r0, r8 + ldrh r0, [r0, 0x28] + subs r0, 0x1 + str r0, [r1] + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x40 + b _080519EE + .pool +_08051990: + ldr r0, =0x0202437c + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + lsrs r0, 7 + cmp r0, 0 + beq _080519DC + ldr r1, =0x020241f0 + movs r3, 0x58 + adds r0, r2, 0 + muls r0, r3 + add r0, r8 + ldrh r0, [r0, 0x28] + subs r0, 0x1 + str r0, [r1] + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024208 + mov r2, r9 + ldrb r0, [r2] + muls r0, r3 + add r0, r8 + ldrh r0, [r0, 0x2E] + strh r0, [r1] + b _080519F2 + .pool +_080519DC: + ldr r1, =0x020241f0 + movs r0, 0x58 + muls r0, r2 + add r0, r8 + ldrh r0, [r0, 0x28] + str r0, [r1] + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x10 +_080519EE: + orrs r0, r1 + strb r0, [r2] +_080519F2: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _08051A70 + .pool +_08051A08: + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r3, =0x02024084 + ldr r0, =0x0202420b + ldrb r0, [r0] + movs r2, 0x58 + adds r1, r0, 0 + muls r1, r2 + adds r1, r3 + adds r1, 0x2A + ldr r0, =0x0202420c + ldrb r0, [r0] + muls r0, r2 + adds r0, r3 + adds r0, 0x2A + ldrb r1, [r1] + ldrb r0, [r0] + cmp r1, r0 + bcc _08051A50 + ldr r1, =0x02024332 + movs r0, 0 + b _08051A54 + .pool +_08051A50: + ldr r1, =0x02024332 + movs r0, 0x1 +_08051A54: + strb r0, [r1, 0x5] + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_08051A70: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk93_ko_move + + thumb_func_start atk94_gethalfcurrentenemyhp +atk94_gethalfcurrentenemyhp: @ 8051A84 + push {lr} + ldr r3, =0x020241f0 + ldr r2, =0x02024084 + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0, 0x28] + lsrs r0, 1 + str r0, [r3] + cmp r0, 0 + bne _08051AA2 + movs r0, 0x1 + str r0, [r3] +_08051AA2: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end atk94_gethalfcurrentenemyhp + + thumb_func_start sub_8051AC0 +sub_8051AC0: @ 8051AC0 + push {lr} + ldr r2, =0x020243cc + ldrh r1, [r2] + movs r0, 0x18 + ands r0, r1 + cmp r0, 0 + beq _08051AEC + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024332 + movs r0, 0x2 + strb r0, [r1, 0x5] + b _08051AFE + .pool +_08051AEC: + movs r0, 0x8 + strh r0, [r2] + ldr r1, =0x02024332 + movs r0, 0x3 + strb r0, [r1, 0x5] + ldr r0, =0x020243d0 + adds r0, 0x28 + movs r1, 0x5 + strb r1, [r0] +_08051AFE: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8051AC0 + + thumb_func_start sub_8051B18 +sub_8051B18: @ 8051B18 + push {r4,r5,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0xD + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _08051B36 + b _08051C48 +_08051B36: + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0x4D + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _08051B4C + b _08051C48 +_08051B4C: + ldr r2, =0x020243cc + ldrh r1, [r2] + movs r0, 0x18 + ands r0, r1 + adds r4, r2, 0 + ldr r5, =0x0202420b + cmp r0, 0 + beq _08051BDA + ldr r0, =0x02024084 + ldrb r2, [r5] + movs r1, 0x58 + muls r1, r2 + adds r3, r1, r0 + adds r0, r3, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0x5 + beq _08051BD4 + cmp r0, 0x8 + beq _08051BD4 + cmp r0, 0x4 + beq _08051BD4 + adds r0, r3, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0x5 + beq _08051BD4 + cmp r0, 0x8 + beq _08051BD4 + cmp r0, 0x4 + beq _08051BD4 + adds r0, r3, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x8 + beq _08051BD4 + ldr r0, =0x020242ac + lsls r1, r2, 2 + adds r1, r0 + ldr r1, [r1] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08051BD4 + movs r0, 0x80 + lsls r0, 11 + ands r1, r0 + cmp r1, 0 + bne _08051BD4 + ldr r1, =0x020241f0 + ldrh r0, [r3, 0x2C] + lsrs r0, 4 + str r0, [r1] + cmp r0, 0 + bne _08051BDA + movs r0, 0x1 + b _08051BD8 + .pool +_08051BD4: + ldr r1, =0x020241f0 + movs r0, 0 +_08051BD8: + str r0, [r1] +_08051BDA: + ldrh r1, [r4] + movs r4, 0x80 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _08051C50 + ldr r1, =0x02024084 + ldrb r3, [r5] + movs r0, 0x58 + muls r0, r3 + adds r2, r0, r1 + adds r0, r2, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0xF + beq _08051C3C + adds r0, r2, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0xF + beq _08051C3C + ldr r0, =0x020242ac + lsls r1, r3, 2 + adds r1, r0 + ldr r1, [r1] + adds r0, r1, 0 + ands r0, r4 + cmp r0, 0 + bne _08051C3C + movs r0, 0x80 + lsls r0, 11 + ands r1, r0 + cmp r1, 0 + bne _08051C3C + ldr r1, =0x020241f0 + ldrh r0, [r2, 0x2C] + lsrs r0, 4 + str r0, [r1] + cmp r0, 0 + bne _08051C50 + movs r0, 0x1 + str r0, [r1] + b _08051C50 + .pool +_08051C3C: + ldr r1, =0x020241f0 + movs r0, 0 + str r0, [r1] + b _08051C50 + .pool +_08051C48: + ldr r1, =0x020241f0 + movs r0, 0 + str r0, [r1] + ldr r5, =0x0202420b +_08051C50: + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _08051C6A + ldr r1, =0x020241f0 + movs r0, 0 + str r0, [r1] +_08051C6A: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8051B18 + + thumb_func_start atk97_tryinfatuatetarget +atk97_tryinfatuatetarget: @ 8051C90 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, =0x0202420b + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08051CC8 + ldr r1, =0x0202406e + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + b _08051CD8 + .pool +_08051CC8: + ldr r1, =0x0202406e + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 +_08051CD8: + adds r5, r1, r0 + ldr r4, =0x0202420c + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08051D0C + ldr r1, =0x0202406e + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + b _08051D1C + .pool +_08051D0C: + ldr r1, =0x0202406e + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 +_08051D1C: + adds r4, r1, r0 + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + adds r0, r5, 0 + movs r1, 0 + bl pokemon_getattr + mov r9, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + adds r7, r0, 0 + ldr r5, =0x0202420c + ldrb r0, [r5] + movs r6, 0x58 + muls r0, r6 + ldr r1, =0x02024084 + adds r0, r1 + adds r0, 0x20 + ldrb r2, [r0] + cmp r2, 0xC + bne _08051D94 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB5F5 + str r0, [r1] + ldr r0, =0x0202420a + strb r2, [r0] + ldrb r0, [r5] + movs r1, 0xC + bl b_history__record_ability_usage_of_player + b _08051E2C + .pool +_08051D94: + mov r0, r10 + mov r1, r9 + bl pokemon_species_get_gender_info + adds r4, r0, 0 + mov r0, r8 + adds r1, r7, 0 + bl pokemon_species_get_gender_info + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _08051DE4 + ldrb r0, [r5] + muls r0, r6 + ldr r4, =0x02024084 + adds r4, 0x50 + adds r0, r4 + ldr r0, [r0] + movs r1, 0xF0 + lsls r1, 12 + ands r0, r1 + cmp r0, 0 + bne _08051DE4 + mov r0, r10 + mov r1, r9 + bl pokemon_species_get_gender_info + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _08051DE4 + mov r0, r8 + adds r1, r7, 0 + bl pokemon_species_get_gender_info + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _08051E08 +_08051DE4: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08051E2C + .pool +_08051E08: + ldrb r0, [r5] + adds r2, r0, 0 + muls r2, r6 + adds r2, r4 + ldr r1, =gUnknown_0832A328 + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + lsls r1, 16 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_08051E2C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk97_tryinfatuatetarget + + thumb_func_start sub_8051E48 +sub_8051E48: @ 8051E48 + push {r4-r7,lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _08051F34 + ldr r5, =0x02024214 + ldr r1, [r5] + ldrb r0, [r1, 0x1] + cmp r0, 0x4 + beq _08051EA0 + bl get_battle_side_of_something + ldr r4, =0x02024064 + strb r0, [r4] + ldr r3, =0x02024084 + ldrb r1, [r4] + movs r0, 0x58 + adds r2, r1, 0 + muls r2, r0 + adds r0, r3, 0 + adds r0, 0x4C + adds r0, r2, r0 + ldr r1, [r0] + adds r3, 0x50 + adds r2, r3 + ldr r2, [r2] + movs r0, 0 + bl dp01_build_cmdbuf_x1A_aaaa_bbbb + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r5] + adds r0, 0x2 + str r0, [r5] + b _08051F34 + .pool +_08051EA0: + ldr r4, =0x02024064 + ldr r5, =0x0202420b + ldrb r0, [r5] + strb r0, [r4] + ldr r6, =0x02024210 + ldrb r1, [r6] + ldr r7, =gUnknown_0832A328 + ldrb r2, [r4] + lsls r0, r2, 2 + adds r0, r7 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08051EDC + ldr r3, =0x02024084 + movs r0, 0x58 + muls r2, r0 + adds r0, r3, 0 + adds r0, 0x4C + adds r0, r2, r0 + ldr r1, [r0] + adds r3, 0x50 + adds r2, r3 + ldr r2, [r2] + movs r0, 0 + bl dp01_build_cmdbuf_x1A_aaaa_bbbb + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_08051EDC: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08051F2C + ldrb r0, [r5] + bl battle_get_per_side_status + movs r1, 0x2 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + strb r0, [r4] + ldrb r1, [r6] + ldrb r2, [r4] + lsls r0, r2, 2 + adds r0, r7 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08051F2C + ldr r3, =0x02024084 + movs r0, 0x58 + muls r2, r0 + adds r0, r3, 0 + adds r0, 0x4C + adds r0, r2, r0 + ldr r1, [r0] + adds r3, 0x50 + adds r2, r3 + ldr r2, [r2] + movs r0, 0 + bl dp01_build_cmdbuf_x1A_aaaa_bbbb + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_08051F2C: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] +_08051F34: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8051E48 + + thumb_func_start atk99_setmisteffect +atk99_setmisteffect: @ 8051F58 + push {r4-r6,lr} + ldr r6, =0x02024294 + ldr r4, =0x0202420b + ldrb r0, [r4] + bl battle_get_per_side_status + movs r5, 0x1 + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _08051F98 + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r2] + ldr r0, =0x02024332 + strb r5, [r0, 0x5] + b _08051FE6 + .pool +_08051F98: + ldrb r0, [r4] + bl battle_get_per_side_status + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x5 + strb r1, [r0, 0x4] + ldrb r0, [r4] + bl battle_get_per_side_status + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r1, [r4] + strb r1, [r0, 0x5] + ldrb r0, [r4] + bl battle_get_per_side_status + ldr r2, =0x0202428e + adds r1, r5, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r3, 0x80 + lsls r3, 1 + adds r0, r3, 0 + movs r3, 0 + orrs r0, r2 + strh r0, [r1] + ldr r0, =0x02024332 + strb r3, [r0, 0x5] +_08051FE6: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atk99_setmisteffect + + thumb_func_start atk9A_setincreasedcriticalchance +atk9A_setincreasedcriticalchance: @ 8052000 + push {lr} + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r1, [r0] + movs r3, 0x80 + lsls r3, 13 + adds r2, r1, 0 + ands r2, r3 + cmp r2, 0 + beq _08052040 + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] + b _08052048 + .pool +_08052040: + orrs r1, r3 + str r1, [r0] + ldr r0, =0x02024332 + strb r2, [r0, 0x5] +_08052048: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end atk9A_setincreasedcriticalchance + + thumb_func_start atk9B_transformdataexecution +atk9B_transformdataexecution: @ 805205C + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r1, =0x020241ec + ldr r2, =0x0000ffff + adds r0, r2, 0 + strh r0, [r1] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r7, =0x02024084 + ldr r0, =0x0202420c + mov r12, r0 + ldrb r1, [r0] + movs r6, 0x58 + adds r0, r1, 0 + muls r0, r6 + adds r5, r7, 0 + adds r5, 0x50 + adds r0, r5 + ldr r0, [r0] + movs r4, 0x80 + lsls r4, 14 + ands r0, r4 + cmp r0, 0 + bne _080520A2 + ldr r0, =0x020242ac + lsls r1, 2 + adds r1, r0 + ldr r2, [r1] + ldr r0, =0x000400c0 + ands r2, r0 + cmp r2, 0 + beq _080520D8 +_080520A2: + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024332 + movs r0, 0x1 + b _080521EC + .pool +_080520D8: + ldr r3, =0x0202420b + ldrb r0, [r3] + adds r1, r0, 0 + muls r1, r6 + adds r1, r5 + ldr r0, [r1] + orrs r0, r4 + str r0, [r1] + ldr r4, =0x020242bc + ldrb r1, [r3] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r4 + strh r2, [r0, 0x4] + ldrb r0, [r3] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r2, [r1, 0xB] + movs r0, 0x10 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0xB] + ldrb r1, [r3] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r4 + mov r2, r12 + ldrb r1, [r2] + muls r1, r6 + adds r2, r7, 0 + adds r2, 0x48 + adds r1, r2 + ldr r1, [r1] + str r1, [r0] + ldrb r0, [r3] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r2, [r1, 0x18] + movs r0, 0xF + ands r0, r2 + strb r0, [r1, 0x18] + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x6 + strb r0, [r1, 0x1] + mov r2, r12 + ldrb r0, [r2] + muls r0, r6 + adds r0, r7 + ldrh r0, [r0] + strb r0, [r1, 0x2] + ldrb r0, [r2] + muls r0, r6 + adds r0, r7 + ldrh r0, [r0] + lsrs r0, 8 + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldrb r0, [r3] + muls r0, r6 + adds r5, r0, r7 + ldrb r0, [r2] + muls r0, r6 + adds r2, r0, r7 + movs r4, 0 + adds r6, r3, 0 + ldr r0, =0x02024064 + mov r8, r0 +_08052170: + adds r0, r5, r4 + adds r1, r2, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x23 + bls _08052170 + movs r4, 0 + ldr r7, =gBattleMoves + ldr r3, =0x02024090 + adds r5, r3, 0 + adds r5, 0x18 +_08052188: + lsls r1, r4, 1 + ldrb r2, [r6] + movs r0, 0x58 + muls r2, r0 + adds r1, r2 + adds r1, r3 + ldrh r1, [r1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrb r1, [r0, 0x4] + cmp r1, 0x4 + bhi _080521C4 + adds r0, r4, r2 + adds r0, r5 + b _080521CA + .pool +_080521C4: + adds r0, r4, r2 + adds r0, r5 + movs r1, 0x5 +_080521CA: + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x3 + ble _08052188 + ldrb r0, [r6] + mov r1, r8 + strb r0, [r1] + movs r0, 0 + movs r1, 0x2 + bl dp01_build_cmdbuf_x38_a + mov r2, r8 + ldrb r0, [r2] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02024332 + movs r0, 0 +_080521EC: + strb r0, [r1, 0x5] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk9B_transformdataexecution + + thumb_func_start sub_80521FC +sub_80521FC: @ 80521FC + push {r4-r7,lr} + ldr r7, =0x02024084 + ldr r6, =0x0202420b + ldrb r0, [r6] + movs r5, 0x58 + muls r0, r5 + adds r3, r0, r7 + ldrh r0, [r3, 0x2C] + lsrs r1, r0, 2 + adds r2, r1, 0 + cmp r1, 0 + bne _08052216 + movs r2, 0x1 +_08052216: + ldrh r0, [r3, 0x28] + cmp r0, r2 + bhi _0805223C + ldr r1, =0x020241f0 + movs r0, 0 + str r0, [r1] + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] + b _08052290 + .pool +_0805223C: + ldr r4, =0x020241f0 + str r1, [r4] + cmp r1, 0 + bne _08052248 + movs r0, 0x1 + str r0, [r4] +_08052248: + ldrb r0, [r6] + adds r2, r0, 0 + muls r2, r5 + adds r3, r7, 0 + adds r3, 0x50 + adds r2, r3 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 17 + orrs r0, r1 + str r0, [r2] + ldrb r0, [r6] + adds r1, r0, 0 + muls r1, r5 + adds r1, r3 + ldr r0, [r1] + ldr r2, =0xffff1fff + ands r0, r2 + str r0, [r1] + ldr r2, =0x020242bc + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, [r4] + movs r2, 0 + strb r1, [r0, 0xA] + ldr r0, =0x02024332 + strb r2, [r0, 0x5] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 1 + orrs r0, r1 + str r0, [r2] +_08052290: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80521FC + + thumb_func_start sub_80522B8 +sub_80522B8: @ 80522B8 + push {r4,r5,lr} + lsls r0, 16 + lsrs r2, r0, 16 + movs r3, 0 + ldr r0, =gUnknown_0831C3E0 + ldrh r1, [r0] + ldr r4, =0x0000fffe + adds r5, r0, 0 + cmp r1, r4 + beq _080522E0 + cmp r1, r2 + beq _080522E0 + adds r1, r5, 0 +_080522D2: + adds r1, 0x2 + adds r3, 0x1 + ldrh r0, [r1] + cmp r0, r4 + beq _080522E0 + cmp r0, r2 + bne _080522D2 +_080522E0: + lsls r0, r3, 1 + adds r0, r5 + ldrh r1, [r0] + ldr r0, =0x0000fffe + eors r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80522B8 + + thumb_func_start atk9D_copyattack +atk9D_copyattack: @ 8052300 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =0x020241ec + ldr r1, =0x0000ffff + adds r7, r1, 0 + strh r7, [r0] + ldr r5, =0x02024248 + ldr r6, =0x0202420c + ldrb r0, [r6] + lsls r0, 1 + adds r0, r5 + ldrh r0, [r0] + bl sub_80522B8 + lsls r0, 24 + cmp r0, 0 + bne _0805235A + ldr r3, =0x02024084 + ldr r2, =0x0202420b + ldrb r1, [r2] + movs r0, 0x58 + adds r4, r1, 0 + muls r4, r0 + adds r0, r3, 0 + adds r0, 0x50 + adds r0, r4, r0 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 14 + ands r1, r0 + mov r12, r3 + mov r9, r2 + cmp r1, 0 + bne _0805235A + ldrb r0, [r6] + lsls r0, 1 + adds r0, r5 + ldrh r1, [r0] + cmp r1, 0 + beq _0805235A + cmp r1, r7 + bne _08052394 +_0805235A: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _080524CC + .pool +_08052394: + movs r2, 0 + mov r3, r12 + adds r3, 0xC + adds r0, r4, r3 + ldrh r0, [r0] + ldr r4, =0x02024214 + mov r10, r4 + cmp r0, r1 + beq _080523CE + mov r8, r3 + adds r7, r5, 0 + adds r5, r6, 0 + mov r4, r9 + movs r3, 0x58 +_080523B0: + adds r2, 0x1 + cmp r2, 0x3 + bgt _080523CE + lsls r1, r2, 1 + ldrb r0, [r4] + muls r0, r3 + adds r1, r0 + add r1, r8 + ldrb r0, [r5] + lsls r0, 1 + adds r0, r7 + ldrh r1, [r1] + ldrh r0, [r0] + cmp r1, r0 + bne _080523B0 +_080523CE: + cmp r2, 0x4 + bne _080524B0 + ldr r5, =0x020241e8 + ldrb r1, [r5] + lsls r1, 1 + mov r2, r9 + ldrb r0, [r2] + movs r6, 0x58 + muls r0, r6 + adds r1, r0 + mov r0, r12 + adds r0, 0xC + adds r1, r0 + ldr r2, =0x02024248 + ldr r3, =0x0202420c + ldrb r0, [r3] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + ldr r4, =gBattleMoves + ldrb r0, [r3] + lsls r0, 1 + adds r0, r2 + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r4, [r0, 0x4] + cmp r4, 0x4 + bhi _08052438 + mov r1, r9 + ldrb r0, [r1] + muls r0, r6 + ldrb r1, [r5] + adds r0, r1 + mov r1, r12 + adds r1, 0x24 + adds r0, r1 + strb r4, [r0] + b _0805244C + .pool +_08052438: + mov r4, r9 + ldrb r0, [r4] + muls r0, r6 + ldrb r1, [r5] + adds r0, r1 + mov r1, r12 + adds r1, 0x24 + adds r0, r1 + movs r1, 0x5 + strb r1, [r0] +_0805244C: + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x2 + strb r0, [r1, 0x1] + ldrb r0, [r3] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + strb r0, [r1, 0x2] + ldrb r0, [r3] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + lsrs r0, 8 + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r1, =0x020242bc + mov r2, r9 + ldrb r0, [r2] + lsls r2, r0, 3 + subs r2, r0 + lsls r2, 2 + adds r2, r1 + ldrb r4, [r2, 0x18] + lsrs r3, r4, 4 + ldr r1, =gUnknown_0832A328 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + orrs r1, r3 + lsls r1, 4 + movs r0, 0xF + ands r0, r4 + orrs r0, r1 + strb r0, [r2, 0x18] + mov r4, r10 + ldr r0, [r4] + adds r0, 0x5 + str r0, [r4] + b _080524CC + .pool +_080524B0: + mov r0, r10 + ldr r2, [r0] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + mov r2, r10 + str r1, [r2] +_080524CC: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end atk9D_copyattack + + thumb_func_start sub_80524DC +sub_80524DC: @ 80524DC + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r7, =0x020241ea + movs r6, 0xB1 + lsls r6, 1 + ldr r5, =gUnknown_0831C3E0 + ldr r0, =0x02024214 + mov r8, r0 +_080524EE: + bl GenerateRandomNumber + ldr r2, =0x000001ff + adds r1, r2, 0 + ands r0, r1 + adds r0, 0x1 + strh r0, [r7] + cmp r0, r6 + bhi _080524EE + movs r0, 0x3 +_08052502: + subs r0, 0x1 + cmp r0, 0 + bge _08052502 + ldr r4, =0x020241ea + ldrh r2, [r4] + ldr r3, =0x0000ffff + subs r0, r5, 0x2 +_08052510: + adds r0, 0x2 + ldrh r1, [r0] + cmp r1, r2 + beq _0805251C + cmp r1, r3 + bne _08052510 +_0805251C: + ldr r0, =0x0000ffff + cmp r1, r0 + bne _080524EE + ldr r2, =0x02024280 + ldr r0, [r2] + ldr r1, =0xfffffbff + ands r0, r1 + str r0, [r2] + ldr r3, =gUnknown_082D86A8 + ldr r2, =gBattleMoves + ldrh r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + mov r1, r8 + str r0, [r1] + ldrh r0, [r4] + movs r1, 0 + bl sub_80458E0 + ldr r1, =0x0202420c + strb r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80524DC + + thumb_func_start atk9F_nightshadedamageeffect +atk9F_nightshadedamageeffect: @ 8052584 + ldr r3, =0x020241f0 + ldr r2, =0x02024084 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x2A + ldrb r0, [r0] + str r0, [r3] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end atk9F_nightshadedamageeffect + + thumb_func_start atkA0_psywavedamageeffect +atkA0_psywavedamageeffect: @ 80525B4 + push {r4,lr} + movs r4, 0xF +_080525B8: + bl GenerateRandomNumber + adds r3, r4, 0 + ands r3, r0 + cmp r3, 0xA + bgt _080525B8 + lsls r0, r3, 2 + adds r0, r3 + lsls r3, r0, 1 + ldr r4, =0x020241f0 + ldr r2, =0x02024084 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x2A + ldrb r1, [r0] + adds r0, r3, 0 + adds r0, 0x32 + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + str r0, [r4] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atkA0_psywavedamageeffect + + thumb_func_start atkA1_counterdamagecalculator +atkA1_counterdamagecalculator: @ 8052608 + push {r4-r6,lr} + ldr r4, =0x0202420b + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r6, r0, 24 + ldr r5, =0x0202433c + ldrb r0, [r4] + lsls r0, 4 + adds r0, r5 + ldrb r0, [r0, 0xC] + bl battle_side_get_owner + lsls r0, 24 + lsrs r2, r0, 24 + ldrb r0, [r4] + lsls r1, r0, 4 + adds r0, r5, 0x4 + adds r0, r1, r0 + ldr r3, [r0] + cmp r3, 0 + beq _080526BC + cmp r6, r2 + beq _080526BC + ldr r6, =0x02024084 + adds r0, r1, r5 + ldrb r0, [r0, 0xC] + movs r4, 0x58 + muls r0, r4 + adds r0, r6 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _080526BC + ldr r1, =0x020241f0 + lsls r0, r3, 1 + str r0, [r1] + ldr r1, =0x02024294 + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r1, r0, r1 + ldrb r0, [r1, 0x8] + cmp r0, 0 + beq _08052690 + ldrb r1, [r1, 0x9] + adds r0, r1, 0 + muls r0, r4 + adds r0, r6 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _08052690 + ldr r0, =0x0202420c + strb r1, [r0] + b _080526A0 + .pool +_08052690: + ldr r2, =0x0202420c + ldr r1, =0x0202433c + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0xC] + strb r0, [r2] +_080526A0: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _080526EC + .pool +_080526BC: + ldr r2, =0x0202437c + ldr r0, =0x0202420b + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0] + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_080526EC: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atkA1_counterdamagecalculator + + thumb_func_start atkA2_mirrorcoatdamagecalculator +atkA2_mirrorcoatdamagecalculator: @ 8052700 + push {r4-r6,lr} + ldr r4, =0x0202420b + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r6, r0, 24 + ldr r5, =0x0202433c + ldrb r0, [r4] + lsls r0, 4 + adds r0, r5 + ldrb r0, [r0, 0xD] + bl battle_side_get_owner + lsls r0, 24 + lsrs r2, r0, 24 + ldrb r0, [r4] + lsls r1, r0, 4 + adds r0, r5, 0 + adds r0, 0x8 + adds r0, r1, r0 + ldr r3, [r0] + cmp r3, 0 + beq _080527B4 + cmp r6, r2 + beq _080527B4 + ldr r6, =0x02024084 + adds r0, r1, r5 + ldrb r0, [r0, 0xD] + movs r4, 0x58 + muls r0, r4 + adds r0, r6 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _080527B4 + ldr r1, =0x020241f0 + lsls r0, r3, 1 + str r0, [r1] + ldr r1, =0x02024294 + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r1, r0, r1 + ldrb r0, [r1, 0x8] + cmp r0, 0 + beq _08052788 + ldrb r1, [r1, 0x9] + adds r0, r1, 0 + muls r0, r4 + adds r0, r6 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _08052788 + ldr r0, =0x0202420c + strb r1, [r0] + b _08052798 + .pool +_08052788: + ldr r2, =0x0202420c + ldr r1, =0x0202433c + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0xD] + strb r0, [r2] +_08052798: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _080527E4 + .pool +_080527B4: + ldr r2, =0x0202437c + ldr r0, =0x0202420b + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0] + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_080527E4: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atkA2_mirrorcoatdamagecalculator + + thumb_func_start atkA3_disablelastusedattack +atkA3_disablelastusedattack: @ 80527F8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r4, 0 + ldr r2, =0x02024084 + ldr r3, =0x0202420c + ldrb r1, [r3] + movs r0, 0x58 + muls r0, r1 + adds r7, r2, 0 + adds r7, 0xC + adds r0, r7 + ldr r5, =0x02024248 + lsls r1, 1 + adds r1, r5 + ldrh r0, [r0] + mov r9, r2 + adds r6, r3, 0 + ldr r2, =0x020242bc + mov r8, r2 + ldrh r1, [r1] + cmp r0, r1 + beq _0805284C + mov r12, r6 + movs r3, 0x58 +_0805282C: + adds r4, 0x1 + cmp r4, 0x3 + bgt _0805284C + lsls r2, r4, 1 + mov r0, r12 + ldrb r1, [r0] + adds r0, r1, 0 + muls r0, r3 + adds r2, r0 + adds r2, r7 + lsls r1, 1 + adds r1, r5 + ldrh r0, [r2] + ldrh r1, [r1] + cmp r0, r1 + bne _0805282C +_0805284C: + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r8 + ldrh r0, [r0, 0x4] + cmp r0, 0 + bne _08052910 + cmp r4, 0x4 + beq _08052910 + movs r5, 0x58 + adds r0, r1, 0 + muls r0, r5 + adds r0, r4, r0 + mov r1, r9 + adds r1, 0x24 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08052910 + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x2 + strb r0, [r1, 0x1] + lsls r2, r4, 1 + ldrb r0, [r6] + muls r0, r5 + adds r0, r2, r0 + mov r3, r9 + adds r3, 0xC + adds r0, r3 + ldrh r0, [r0] + strb r0, [r1, 0x2] + ldrb r0, [r6] + muls r0, r5 + adds r0, r2, r0 + adds r0, r3 + ldrh r0, [r0] + lsrs r0, 8 + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r8 + muls r1, r5 + adds r2, r1 + adds r2, r3 + ldrh r1, [r2] + strh r1, [r0, 0x4] + bl GenerateRandomNumber + ldrb r2, [r6] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + add r1, r8 + movs r2, 0x3 + ands r2, r0 + adds r2, 0x2 + ldrb r3, [r1, 0xB] + movs r0, 0x10 + negs r0, r0 + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0xB] + ldrb r0, [r6] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + add r1, r8 + ldrb r3, [r1, 0xB] + lsls r2, r3, 28 + lsrs r2, 24 + movs r0, 0xF + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0xB] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _0805292A + .pool +_08052910: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_0805292A: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkA3_disablelastusedattack + + thumb_func_start atkA4_setencore +atkA4_setencore: @ 805293C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r5, 0 + ldr r3, =0x02024084 + ldr r4, =0x0202420c + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 + adds r6, r3, 0 + adds r6, 0xC + adds r0, r6 + ldr r2, =0x02024248 + lsls r1, 1 + adds r1, r2 + ldrh r0, [r0] + mov r10, r3 + mov r8, r2 + ldr r2, =0x020242bc + mov r9, r2 + ldrh r1, [r1] + cmp r0, r1 + beq _08052996 + mov r12, r4 + adds r7, r6, 0 + mov r6, r8 + movs r3, 0x58 +_08052976: + adds r5, 0x1 + cmp r5, 0x3 + bgt _08052996 + lsls r2, r5, 1 + mov r0, r12 + ldrb r1, [r0] + adds r0, r1, 0 + muls r0, r3 + adds r2, r0 + adds r2, r7 + lsls r1, 1 + adds r1, r6 + ldrh r0, [r2] + ldrh r1, [r1] + cmp r0, r1 + bne _08052976 +_08052996: + ldrb r0, [r4] + lsls r0, 1 + add r0, r8 + ldrh r2, [r0] + cmp r2, 0xA5 + beq _080529AA + cmp r2, 0xE3 + beq _080529AA + cmp r2, 0x77 + bne _080529AC +_080529AA: + movs r5, 0x4 +_080529AC: + ldrb r1, [r4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + mov r2, r9 + adds r3, r0, r2 + ldrh r0, [r3, 0x6] + cmp r0, 0 + bne _08052A44 + cmp r5, 0x4 + beq _08052A44 + movs r0, 0x58 + adds r2, r1, 0 + muls r2, r0 + adds r0, r5, r2 + mov r1, r10 + adds r1, 0x24 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08052A44 + lsls r0, r5, 1 + adds r0, r2 + subs r1, 0x18 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r3, 0x6] + ldrb r1, [r4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r9 + strb r5, [r0, 0xC] + bl GenerateRandomNumber + ldrb r2, [r4] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + add r1, r9 + movs r2, 0x3 + ands r2, r0 + adds r2, 0x3 + ldrb r3, [r1, 0xE] + movs r0, 0x10 + negs r0, r0 + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0xE] + ldrb r0, [r4] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + add r1, r9 + ldrb r3, [r1, 0xE] + lsls r2, r3, 28 + lsrs r2, 24 + movs r0, 0xF + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0xE] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _08052A5E + .pool +_08052A44: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_08052A5E: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkA4_setencore + + thumb_func_start sub_8052A70 +sub_8052A70: @ 8052A70 + push {r4-r7,lr} + ldr r6, =0x02024084 + ldr r0, =0x0202420c + mov r12, r0 + ldrb r0, [r0] + movs r7, 0x58 + adds r2, r0, 0 + muls r2, r7 + adds r0, r6, 0 + adds r0, 0x50 + adds r0, r2, r0 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + bne _08052B10 + ldr r5, =0x0202420b + ldrb r0, [r5] + muls r0, r7 + adds r0, r6 + ldrh r3, [r0, 0x28] + adds r0, r2, r6 + ldrh r1, [r0, 0x28] + adds r3, r1 + asrs r3, 1 + ldr r4, =0x020241f0 + subs r1, r3 + str r1, [r4] + ldr r2, =0x02024474 + strb r1, [r2] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + asrs r0, 8 + strb r0, [r2, 0x1] + movs r0, 0xFF + lsls r0, 16 + ands r0, r1 + asrs r0, 16 + strb r0, [r2, 0x2] + lsrs r1, 24 + strb r1, [r2, 0x3] + ldrb r0, [r5] + muls r0, r7 + adds r0, r6 + ldrh r0, [r0, 0x28] + subs r0, r3 + str r0, [r4] + ldr r2, =0x0202437c + mov r0, r12 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x4 + adds r0, r2 + ldr r1, =0x0000ffff + str r1, [r0] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _08052B2A + .pool +_08052B10: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_08052B2A: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8052A70 + + thumb_func_start atkA6_settypetorandomresistance +atkA6_settypetorandomresistance: @ 8052B34 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r1, =0x02024250 + ldr r4, =0x0202420b + ldrb r0, [r4] + lsls r0, 1 + adds r2, r0, r1 + ldrh r1, [r2] + cmp r1, 0 + beq _08052B7E + ldr r0, =0x0000ffff + cmp r1, r0 + beq _08052B7E + ldrh r0, [r2] + bl sub_8052F48 + lsls r0, 24 + cmp r0, 0 + beq _08052C1C + ldr r1, =0x02024084 + ldr r2, =0x02024270 + ldrb r0, [r4] + adds r0, r2 + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 5 + ands r0, r1 + cmp r0, 0 + beq _08052C1C +_08052B7E: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08052D08 + .pool +_08052BB4: + mov r0, r12 + strb r5, [r0] + mov r1, r10 + ldrb r0, [r1] + muls r0, r2 + adds r0, r7 + adds r0, 0x22 + strb r5, [r0] + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x3 + strb r0, [r1, 0x1] + strb r5, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x3] + ldr r1, =0x02024214 + b _08052C0A + .pool +_08052BE0: + mov r0, r8 + adds r0, 0x1 + adds r0, r3 + ldrb r2, [r0] + strb r2, [r4] + mov r4, r10 + ldrb r0, [r4] + muls r0, r6 + ldr r7, =0x02024084 + adds r0, r7 + adds r0, 0x22 + strb r2, [r0] + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x3 + strb r0, [r1, 0x1] + strb r2, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x3] + mov r1, r12 +_08052C0A: + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _08052D08 + .pool +_08052C1C: + movs r4, 0 + mov r8, r4 + movs r7, 0x7F + mov r9, r7 +_08052C24: + bl GenerateRandomNumber + mov r4, r9 + ands r4, r0 + cmp r4, 0x70 + bhi _08052C24 + lsls r0, r4, 1 + adds r4, r0, r4 + ldr r6, =gUnknown_0831ACE8 + adds r3, r4, r6 + ldr r1, =0x02024258 + ldr r2, =0x0202420b + ldrb r5, [r2] + lsls r0, r5, 1 + adds r0, r1 + ldrb r1, [r3] + mov r10, r2 + ldrh r0, [r0] + cmp r1, r0 + bne _08052C80 + adds r0, r4, 0x2 + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0x5 + bhi _08052C80 + ldr r7, =0x02024084 + movs r2, 0x58 + adds r0, r5, 0 + muls r0, r2 + adds r3, r0, r7 + movs r0, 0x21 + adds r0, r3 + mov r12, r0 + adds r0, r4, 0x1 + adds r0, r6 + ldrb r5, [r0] + mov r1, r12 + ldrb r0, [r1] + adds r1, r5, 0 + cmp r0, r1 + beq _08052C80 + adds r0, r3, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, r1 + bne _08052BB4 +_08052C80: + movs r7, 0x1 + add r8, r7 + ldr r0, =0x000003e7 + cmp r8, r0 + ble _08052C24 + movs r0, 0 + mov r8, r0 + ldr r1, =0x02024214 + mov r12, r1 + ldr r3, =gUnknown_0831ACE8 + adds r0, r4, 0x1 + adds r0, r3 + mov r9, r0 + adds r5, r3, 0 +_08052C9C: + ldrb r1, [r5] + cmp r1, 0xFF + bgt _08052CA6 + cmp r1, 0xFE + bge _08052CE0 +_08052CA6: + mov r4, r10 + ldrb r2, [r4] + lsls r0, r2, 1 + ldr r7, =0x02024258 + adds r0, r7 + ldrh r0, [r0] + cmp r1, r0 + bne _08052CE0 + ldrb r0, [r5, 0x2] + cmp r0, 0x5 + bhi _08052CE0 + movs r6, 0x58 + adds r0, r2, 0 + muls r0, r6 + ldr r1, =0x02024084 + adds r2, r0, r1 + adds r4, r2, 0 + adds r4, 0x21 + ldrb r0, [r4] + mov r7, r9 + ldrb r1, [r7] + cmp r0, r1 + beq _08052CE0 + adds r0, r2, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, r1 + beq _08052CE0 + b _08052BE0 +_08052CE0: + adds r5, 0x3 + movs r0, 0x3 + add r8, r0 + ldr r0, =0x0000014f + cmp r8, r0 + bls _08052C9C + mov r1, r12 + ldr r2, [r1] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + mov r4, r12 + str r1, [r4] +_08052D08: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkA6_settypetorandomresistance + + thumb_func_start atkA7_setalwayshitflag +atkA7_setalwayshitflag: @ 8052D34 + push {r4,lr} + ldr r4, =0x020242ac + ldr r3, =0x0202420c + ldrb r1, [r3] + lsls r1, 2 + adds r1, r4 + ldr r0, [r1] + movs r2, 0x19 + negs r2, r2 + ands r0, r2 + str r0, [r1] + ldrb r1, [r3] + lsls r1, 2 + adds r1, r4 + ldr r0, [r1] + movs r2, 0x10 + orrs r0, r2 + str r0, [r1] + ldr r2, =0x020242bc + ldrb r1, [r3] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x0202420b + ldrb r1, [r1] + strb r1, [r0, 0x15] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atkA7_setalwayshitflag + + thumb_func_start atkA8_copymovepermanently +atkA8_copymovepermanently: @ 8052D8C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + ldr r0, =0x020241ec + ldr r1, =0x0000ffff + adds r5, r1, 0 + strh r5, [r0] + ldr r3, =0x02024084 + ldr r2, =0x0202420b + ldrb r1, [r2] + movs r0, 0x58 + adds r4, r1, 0 + muls r4, r0 + adds r0, r3, 0 + adds r0, 0x50 + adds r0, r4, r0 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 14 + ands r1, r0 + mov r12, r3 + mov r10, r2 + cmp r1, 0 + beq _08052DC4 + b _08052F18 +_08052DC4: + ldr r0, =0x02024240 + ldr r2, =0x0202420c + ldrb r1, [r2] + lsls r1, 1 + adds r1, r0 + ldrh r1, [r1] + mov r9, r0 + mov r8, r2 + cmp r1, 0xA5 + bne _08052DDA + b _08052F18 +_08052DDA: + cmp r1, 0 + bne _08052DE0 + b _08052F18 +_08052DE0: + cmp r1, r5 + bne _08052DE6 + b _08052F18 +_08052DE6: + cmp r1, 0xA6 + bne _08052DEC + b _08052F18 +_08052DEC: + movs r7, 0 + mov r5, r9 + mov r0, r12 + adds r0, 0xC + adds r1, r4, r0 + mov r3, r8 +_08052DF8: + ldrh r2, [r1] + cmp r2, 0xA6 + beq _08052E0A + ldrb r0, [r3] + lsls r0, 1 + adds r0, r5 + ldrh r0, [r0] + cmp r2, r0 + beq _08052E12 +_08052E0A: + adds r1, 0x2 + adds r7, 0x1 + cmp r7, 0x3 + ble _08052DF8 +_08052E12: + cmp r7, 0x4 + beq _08052E18 + b _08052F18 +_08052E18: + ldr r4, =0x020241e8 + ldrb r1, [r4] + lsls r1, 1 + mov r2, r10 + ldrb r0, [r2] + movs r3, 0x58 + muls r0, r3 + adds r1, r0 + mov r6, r12 + adds r6, 0xC + adds r1, r6 + mov r2, r8 + ldrb r0, [r2] + lsls r0, 1 + add r0, r9 + ldrh r0, [r0] + strh r0, [r1] + mov r1, r10 + ldrb r0, [r1] + adds r2, r0, 0 + muls r2, r3 + ldrb r4, [r4] + adds r2, r4 + mov r5, r12 + adds r5, 0x24 + adds r2, r5 + ldr r4, =gBattleMoves + mov r1, r8 + ldrb r0, [r1] + lsls r0, 1 + add r0, r9 + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x4] + strb r0, [r2] + ldr r1, =0x02024064 + mov r2, r10 + ldrb r0, [r2] + strb r0, [r1] + movs r7, 0 + ldrb r0, [r2] + muls r0, r3 + adds r4, r0, r5 + adds r3, r0, 0 + add r2, sp, 0x4 + add r5, sp, 0xC +_08052E7A: + adds r0, r3, r6 + ldrh r0, [r0] + strh r0, [r2] + adds r1, r5, r7 + ldrb r0, [r4] + strb r0, [r1] + adds r4, 0x1 + adds r3, 0x2 + adds r2, 0x2 + adds r7, 0x1 + cmp r7, 0x3 + ble _08052E7A + add r2, sp, 0x4 + mov r0, r10 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + add r0, r12 + adds r0, 0x3B + ldrb r0, [r0] + strb r0, [r2, 0xC] + str r2, [sp] + movs r0, 0 + movs r1, 0x3 + movs r2, 0 + movs r3, 0x10 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x2 + strb r0, [r1, 0x1] + ldr r3, =0x02024240 + ldr r2, =0x0202420c + ldrb r0, [r2] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + strb r0, [r1, 0x2] + ldrb r0, [r2] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + lsrs r0, 8 + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _08052F32 + .pool +_08052F18: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_08052F32: + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkA8_copymovepermanently + + thumb_func_start sub_8052F48 +sub_8052F48: @ 8052F48 + push {lr} + lsls r0, 16 + lsrs r0, 16 + ldr r2, =gBattleMoves + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1] + cmp r0, 0x91 + beq _08052F72 + cmp r0, 0x27 + beq _08052F72 + cmp r0, 0x4B + beq _08052F72 + cmp r0, 0x97 + beq _08052F72 + cmp r0, 0x9B + beq _08052F72 + cmp r0, 0x1A + bne _08052F7C +_08052F72: + movs r0, 0x1 + b _08052F7E + .pool +_08052F7C: + movs r0, 0 +_08052F7E: + pop {r1} + bx r1 + thumb_func_end sub_8052F48 + + thumb_func_start sub_8052F84 +sub_8052F84: @ 8052F84 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _08052FA2 + cmp r1, 0xD6 + beq _08052FA2 + movs r0, 0x89 + lsls r0, 1 + cmp r1, r0 + beq _08052FA2 + cmp r1, 0x77 + beq _08052FA2 + cmp r1, 0x76 + bne _08052FA6 +_08052FA2: + movs r0, 0x1 + b _08052FA8 +_08052FA6: + movs r0, 0 +_08052FA8: + pop {r1} + bx r1 + thumb_func_end sub_8052F84 + + thumb_func_start move_weather_interaction +move_weather_interaction: @ 8052FAC + push {lr} + lsls r1, 16 + lsrs r2, r1, 16 + ldr r1, =gBattleMoves + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0] + adds r3, r1, 0 + cmp r0, 0x97 + bne _08052FD0 + ldr r0, =0x020243cc + ldrh r1, [r0] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + bne _08053010 +_08052FD0: + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0x91 + beq _08052FF2 + cmp r0, 0x27 + beq _08052FF2 + cmp r0, 0x4B + beq _08052FF2 + cmp r0, 0x97 + beq _08052FF2 + cmp r0, 0x9B + beq _08052FF2 + cmp r0, 0x1A + bne _08053010 +_08052FF2: + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 20 + ands r0, r1 + cmp r0, 0 + beq _08053010 + movs r0, 0x1 + b _08053012 + .pool +_08053010: + movs r0, 0x2 +_08053012: + pop {r1} + bx r1 + thumb_func_end move_weather_interaction + + thumb_func_start sub_8053018 +sub_8053018: @ 8053018 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r6, 0 + movs r5, 0 + ldr r0, =0x0202420b + mov r9, r0 + movs r1, 0x58 + mov r8, r1 + ldr r7, =0x02024090 + movs r0, 0x84 + lsls r0, 1 + mov r10, r0 +_08053036: + lsls r4, r5, 1 + mov r1, r9 + ldrb r0, [r1] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r4, r0 + adds r0, r7 + ldrh r0, [r0] + bl sub_8052F84 + lsls r0, 24 + cmp r0, 0 + bne _08053076 + mov r1, r9 + ldrb r0, [r1] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r4, r0 + adds r0, r7 + ldrh r1, [r0] + cmp r1, r10 + beq _08053076 + cmp r1, 0xFD + beq _08053076 + adds r0, r1, 0 + bl sub_8052F48 + lsls r0, 24 + cmp r0, 0 + beq _08053084 +_08053076: + ldr r1, =gUnknown_0832A328 + lsls r0, r5, 2 + adds r0, r1 + ldr r0, [r0] + orrs r6, r0 + lsls r0, r6, 24 + lsrs r6, r0, 24 +_08053084: + adds r5, 0x1 + cmp r5, 0x3 + ble _08053036 + ldr r0, =0x0202420b + ldrb r0, [r0] + adds r1, r6, 0 + movs r2, 0xFD + bl sub_803FECC + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0xF + bne _080530B8 + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _0805311C + .pool +_080530B8: + movs r7, 0x3 + ldr r4, =gUnknown_0832A328 +_080530BC: + bl GenerateRandomNumber + adds r5, r7, 0 + ands r5, r0 + lsls r0, r5, 2 + adds r0, r4 + ldr r0, [r0] + ands r0, r6 + cmp r0, 0 + bne _080530BC + ldr r4, =0x020241ee + ldr r2, =0x02024084 + lsls r1, r5, 1 + ldr r0, =0x0202420b + ldrb r3, [r0] + movs r0, 0x58 + muls r0, r3 + adds r1, r0 + adds r2, 0xC + adds r1, r2 + ldrh r0, [r1] + strh r0, [r4] + ldr r0, =0x020241e8 + strb r5, [r0] + ldr r2, =0x02024280 + ldr r0, [r2] + ldr r1, =0xfffffbff + ands r0, r1 + str r0, [r2] + ldrh r0, [r4] + movs r1, 0 + bl sub_80458E0 + ldr r1, =0x0202420c + strb r0, [r1] + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_0805311C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8053018 + + thumb_func_start atkAA_destinybondeffect +atkAA_destinybondeffect: @ 8053150 + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r2, r0 + adds r1, 0x50 + adds r2, r1 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 18 + orrs r0, r1 + str r0, [r2] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end atkAA_destinybondeffect + + thumb_func_start b_feature_update_destiny_bond +b_feature_update_destiny_bond: @ 8053180 + push {r4,r5,lr} + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =0x0202420c + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, =0x02024084 + ldrb r2, [r4] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 18 + ands r0, r1 + cmp r0, 0 + beq _080531CA + cmp r5, r3 + beq _080531CA + ldr r2, =0x02024280 + ldr r1, [r2] + movs r0, 0x80 + lsls r0, 17 + ands r0, r1 + cmp r0, 0 + bne _080531CA + movs r0, 0x40 + orrs r1, r0 + str r1, [r2] +_080531CA: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end b_feature_update_destiny_bond + + thumb_func_start atkAB_802A458 +atkAB_802A458: @ 80531E0 + push {lr} + bl b_feature_update_destiny_bond + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end atkAB_802A458 + + thumb_func_start atkAC_remaininghptopower +atkAC_remaininghptopower: @ 80531F8 + push {lr} + ldr r2, =0x02024084 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + muls r1, r0 + adds r1, r2 + movs r2, 0x28 + ldrsh r0, [r1, r2] + movs r2, 0x2C + ldrsh r1, [r1, r2] + movs r2, 0x30 + bl sub_8075034 + lsls r0, 24 + lsrs r1, r0, 24 + movs r3, 0 + ldr r0, =gUnknown_0831C408 + ldrb r2, [r0] + cmp r1, r2 + ble _08053232 + adds r2, r0, 0 +_08053224: + adds r3, 0x2 + cmp r3, 0xB + bgt _08053232 + adds r0, r3, r2 + ldrb r0, [r0] + cmp r1, r0 + bgt _08053224 +_08053232: + ldr r2, =0x02024400 + ldr r1, =gUnknown_0831C408 + adds r0, r3, 0x1 + adds r0, r1 + ldrb r0, [r0] + strh r0, [r2] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end atkAC_remaininghptopower + + thumb_func_start atkAD_reducepprandom +atkAD_reducepprandom: @ 8053260 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r4, =0x02024248 + ldr r1, =0x0202420c + ldrb r3, [r1] + lsls r0, r3, 1 + adds r0, r4 + ldrh r2, [r0] + mov r8, r1 + cmp r2, 0 + bne _08053280 + b _08053408 +_08053280: + ldr r0, =0x0000ffff + cmp r2, r0 + bne _08053288 + b _08053408 +_08053288: + movs r7, 0 + ldr r0, =0x02024084 + movs r1, 0x58 + muls r1, r3 + adds r3, r0, 0 + adds r3, 0xC + adds r1, r3 + ldrh r1, [r1] + cmp r2, r1 + beq _080532C0 + adds r6, r4, 0 + mov r5, r8 + adds r4, r3, 0 + movs r3, 0x58 +_080532A4: + adds r7, 0x1 + cmp r7, 0x3 + bgt _080532C0 + ldrb r0, [r5] + lsls r2, r0, 1 + adds r2, r6 + lsls r1, r7, 1 + muls r0, r3 + adds r1, r0 + adds r1, r4 + ldrh r0, [r2] + ldrh r1, [r1] + cmp r0, r1 + bne _080532A4 +_080532C0: + cmp r7, 0x4 + bne _080532C6 + b _08053408 +_080532C6: + mov r4, r8 + ldrb r0, [r4] + movs r1, 0x58 + mov r9, r1 + mov r3, r9 + muls r3, r0 + adds r0, r3, 0 + adds r0, r7, r0 + ldr r1, =0x02024084 + adds r1, 0x24 + mov r10, r1 + add r0, r10 + ldrb r0, [r0] + cmp r0, 0x1 + bhi _080532E6 + b _08053408 +_080532E6: + bl GenerateRandomNumber + movs r1, 0x3 + ands r1, r0 + adds r6, r1, 0x2 + ldrb r0, [r4] + mov r3, r9 + muls r3, r0 + adds r0, r3, 0 + adds r0, r7, r0 + add r0, r10 + ldrb r0, [r0] + cmp r0, r6 + bge _08053304 + adds r6, r0, 0 +_08053304: + ldr r1, =0x02022f58 + movs r5, 0xFD + strb r5, [r1] + movs r0, 0x2 + strb r0, [r1, 0x1] + ldr r2, =0x02024248 + mov r3, r8 + ldrb r0, [r3] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + strb r0, [r1, 0x2] + ldrb r0, [r3] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + lsrs r0, 8 + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r4, =0x02022f68 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0x1 + bl ConvertIntToDecimalString + strb r5, [r4] + movs r0, 0x1 + strb r0, [r4, 0x1] + strb r0, [r4, 0x2] + strb r0, [r4, 0x3] + strb r6, [r4, 0x4] + subs r0, 0x2 + strb r0, [r4, 0x5] + mov r1, r8 + ldrb r0, [r1] + mov r1, r9 + muls r1, r0 + adds r1, r7, r1 + add r1, r10 + ldrb r0, [r1] + subs r0, r6 + strb r0, [r1] + ldr r4, =0x02024064 + mov r3, r8 + ldrb r0, [r3] + strb r0, [r4] + ldr r1, =0x020242bc + ldrb r3, [r4] + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x18] + lsrs r1, 4 + ldr r2, =gUnknown_0832A328 + lsls r0, r7, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _080533B8 + mov r2, r9 + muls r2, r3 + ldr r0, =0x02024084 + adds r0, 0x50 + adds r0, r2, r0 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 14 + ands r0, r1 + cmp r0, 0 + bne _080533B8 + adds r1, r7, 0 + adds r1, 0x9 + lsls r1, 24 + lsrs r1, 24 + mov r3, r10 + adds r0, r2, r3 + adds r0, r7 + str r0, [sp] + movs r0, 0 + movs r2, 0 + movs r3, 0x1 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_080533B8: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + ldr r1, =0x02024084 + ldr r0, =0x0202420c + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r0, r7, r0 + adds r1, 0x24 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08053422 + adds r0, r2, 0 + bl b_cancel_multi_turn_move_maybe + b _08053422 + .pool +_08053408: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_08053422: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkAD_reducepprandom + + thumb_func_start atkAE_clearstatusifnotsoundproofed +atkAE_clearstatusifnotsoundproofed: @ 8053438 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + movs r4, 0 + str r4, [sp, 0x4] + mov r8, r4 + ldr r0, =0x020241ea + ldrh r0, [r0] + cmp r0, 0xD7 + beq _08053454 + b _0805363E +_08053454: + ldr r6, =0x02024332 + mov r0, r8 + strb r0, [r6, 0x5] + ldr r5, =0x0202420b + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + ldr r1, =0x02024744 + mov r10, r1 + cmp r0, 0 + bne _08053470 + ldr r2, =0x020244ec + mov r10, r2 +_08053470: + ldr r4, =0x02024084 + ldrb r3, [r5] + movs r7, 0x58 + adds r2, r3, 0 + muls r2, r7 + adds r0, r2, r4 + adds r1, r0, 0 + adds r1, 0x20 + ldrb r0, [r1] + cmp r0, 0x2B + beq _080534C4 + adds r0, r4, 0 + adds r0, 0x4C + adds r0, r2, r0 + mov r1, r8 + str r1, [r0] + ldrb r0, [r5] + adds r2, r0, 0 + muls r2, r7 + adds r0, r4, 0 + adds r0, 0x50 + adds r2, r0 + ldr r0, [r2] + ldr r1, =0xf7ffffff + ands r0, r1 + str r0, [r2] + b _080534D4 + .pool +_080534C4: + ldrb r1, [r1] + adds r0, r3, 0 + bl b_history__record_ability_usage_of_player + ldrb r0, [r6, 0x5] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r6, 0x5] +_080534D4: + ldr r7, =0x02024064 + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_get_per_side_status + movs r2, 0x2 + mov r9, r2 + mov r1, r9 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + ldr r1, =0x02024474 + strb r0, [r1, 0x17] + strb r0, [r7] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0805357A + ldr r0, =0x02024210 + ldrb r2, [r0] + ldr r1, =gUnknown_0832A328 + ldrb r3, [r7] + lsls r0, r3, 2 + adds r0, r1 + ldr r0, [r0] + ands r2, r0 + cmp r2, 0 + bne _0805357A + ldr r5, =0x02024084 + movs r6, 0x58 + adds r4, r3, 0 + muls r4, r6 + adds r0, r4, r5 + adds r1, r0, 0 + adds r1, 0x20 + ldrb r0, [r1] + cmp r0, 0x2B + beq _08053568 + adds r0, r5, 0 + adds r0, 0x4C + adds r0, r4, r0 + str r2, [r0] + ldrb r0, [r7] + adds r2, r0, 0 + muls r2, r6 + adds r0, r5, 0 + adds r0, 0x50 + adds r2, r0 + ldr r0, [r2] + ldr r1, =0xf7ffffff + ands r0, r1 + str r0, [r2] + b _0805357A + .pool +_08053568: + ldrb r1, [r1] + adds r0, r3, 0 + bl b_history__record_ability_usage_of_player + ldr r1, =0x02024332 + ldrb r0, [r1, 0x5] + mov r2, r9 + orrs r0, r2 + strb r0, [r1, 0x5] +_0805357A: + movs r6, 0 + ldr r7, =0x02024084 +_0805357E: + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + add r4, r10 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + movs r1, 0x2E + bl pokemon_getattr + lsls r0, 24 + lsrs r4, r0, 24 + cmp r5, 0 + beq _08053636 + movs r0, 0xCE + lsls r0, 1 + cmp r5, r0 + beq _08053636 + ldr r2, =0x0202406e + ldr r0, =0x0202420b + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r2 + ldrh r0, [r0] + cmp r0, r6 + bne _080535D0 + movs r0, 0x58 + muls r0, r1 + b _08053600 + .pool +_080535D0: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08053618 + ldr r0, =0x02024064 + ldrb r3, [r0] + lsls r0, r3, 1 + adds r0, r2 + ldrh r0, [r0] + cmp r0, r6 + bne _08053618 + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + lsls r0, r3, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08053618 + movs r0, 0x58 + muls r0, r3 +_08053600: + adds r0, r7 + adds r0, 0x20 + ldrb r0, [r0] + b _08053624 + .pool +_08053618: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_806B694 + lsls r0, 24 + lsrs r0, 24 +_08053624: + cmp r0, 0x2B + beq _08053636 + movs r0, 0x1 + lsls r0, r6 + mov r1, r8 + orrs r1, r0 + lsls r0, r1, 24 + lsrs r0, 24 + mov r8, r0 +_08053636: + adds r6, 0x1 + cmp r6, 0x5 + ble _0805357E + b _080536BC +_0805363E: + ldr r1, =0x02024332 + movs r0, 0x4 + strb r0, [r1, 0x5] + movs r2, 0x3F + mov r8, r2 + ldr r3, =0x02024084 + ldr r2, =0x0202420b + ldrb r0, [r2] + movs r5, 0x58 + muls r0, r5 + movs r1, 0x4C + adds r1, r3 + mov r9, r1 + add r0, r9 + str r4, [r0] + ldrb r0, [r2] + adds r1, r0, 0 + muls r1, r5 + adds r7, r3, 0 + adds r7, 0x50 + adds r1, r7 + ldr r0, [r1] + ldr r6, =0xf7ffffff + ands r0, r6 + str r0, [r1] + ldrb r0, [r2] + bl battle_get_per_side_status + movs r1, 0x2 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + ldr r4, =0x02024064 + strb r0, [r4] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080536BC + ldr r0, =0x02024210 + ldrb r2, [r0] + ldr r1, =gUnknown_0832A328 + ldrb r3, [r4] + lsls r0, r3, 2 + adds r0, r1 + ldr r0, [r0] + ands r2, r0 + cmp r2, 0 + bne _080536BC + adds r0, r3, 0 + muls r0, r5 + add r0, r9 + str r2, [r0] + ldrb r0, [r4] + adds r1, r0, 0 + muls r1, r5 + adds r1, r7 + ldr r0, [r1] + ands r0, r6 + str r0, [r1] +_080536BC: + mov r2, r8 + cmp r2, 0 + beq _080536DE + ldr r4, =0x02024064 + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r4] + add r0, sp, 0x4 + str r0, [sp] + movs r0, 0 + movs r1, 0x28 + movs r3, 0x4 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_080536DE: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkAE_clearstatusifnotsoundproofed + + thumb_func_start atkAF_cursetarget +atkAF_cursetarget: @ 805371C + push {r4,r5,lr} + ldr r5, =0x02024084 + ldr r0, =0x0202420c + ldrb r0, [r0] + movs r4, 0x58 + adds r1, r0, 0 + muls r1, r4 + adds r0, r5, 0 + adds r0, 0x50 + adds r1, r0 + ldr r2, [r1] + movs r3, 0x80 + lsls r3, 21 + adds r0, r2, 0 + ands r0, r3 + cmp r0, 0 + beq _08053768 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _0805378C + .pool +_08053768: + orrs r2, r3 + str r2, [r1] + ldr r1, =0x020241f0 + ldr r0, =0x0202420b + ldrb r0, [r0] + muls r0, r4 + adds r0, r5 + ldrh r0, [r0, 0x2C] + lsrs r0, 1 + str r0, [r1] + cmp r0, 0 + bne _08053784 + movs r0, 0x1 + str r0, [r1] +_08053784: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_0805378C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atkAF_cursetarget + + thumb_func_start atkB0_setspikes +atkB0_setspikes: @ 80537A0 + push {r4,lr} + ldr r4, =0x0202420b + ldrb r0, [r4] + bl battle_side_get_owner + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02024294 + lsls r2, r0, 1 + adds r0, r2, r0 + lsls r0, 2 + adds r3, r0, r1 + ldrb r0, [r3, 0xA] + cmp r0, 0x3 + bne _08053804 + ldr r2, =0x0202437c + ldrb r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0] + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _0805381E + .pool +_08053804: + ldr r1, =0x0202428e + adds r1, r2, r1 + ldrh r2, [r1] + movs r0, 0x10 + orrs r0, r2 + strh r0, [r1] + ldrb r0, [r3, 0xA] + adds r0, 0x1 + strb r0, [r3, 0xA] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_0805381E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atkB0_setspikes + + thumb_func_start atkB1_setforesight +atkB1_setforesight: @ 805382C + ldr r1, =0x02024084 + ldr r0, =0x0202420c + ldrb r2, [r0] + movs r0, 0x58 + muls r2, r0 + adds r1, 0x50 + adds r2, r1 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 22 + orrs r0, r1 + str r0, [r2] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end atkB1_setforesight + + thumb_func_start atkB2_setperishsong +atkB2_setperishsong: @ 805385C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r6, 0 + movs r3, 0 + ldr r0, =0x0202406c + adds r7, r0, 0 + ldr r0, =0x0202420b + mov r8, r0 + ldrb r1, [r7] + cmp r6, r1 + bge _080538C8 + movs r5, 0x20 + ldr r0, =0x02024084 + mov r12, r0 + ldr r0, =0x020242bc + adds r4, r0, 0 + adds r4, 0xF + ldr r2, =0x020242ac +_08053884: + ldr r1, [r2] + adds r0, r1, 0 + ands r0, r5 + cmp r0, 0 + bne _0805389C + movs r0, 0x58 + muls r0, r3 + add r0, r12 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x2B + bne _080538B4 +_0805389C: + adds r6, 0x1 + b _080538BC + .pool +_080538B4: + orrs r1, r5 + str r1, [r2] + movs r0, 0x33 + strb r0, [r4] +_080538BC: + adds r4, 0x1C + adds r2, 0x4 + adds r3, 0x1 + ldrb r0, [r7] + cmp r3, r0 + blt _08053884 +_080538C8: + mov r1, r8 + ldrb r0, [r1] + bl sub_803F67C + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r6, r0 + bne _080538FC + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08053904 + .pool +_080538FC: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_08053904: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkB2_setperishsong + + thumb_func_start atkB3_rolloutdamagecalculation +atkB3_rolloutdamagecalculation: @ 8053914 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _08053948 + ldr r0, =0x0202420b + ldrb r0, [r0] + bl b_cancel_multi_turn_move_maybe + ldr r1, =0x02024214 + ldr r0, =gUnknown_082D8A60 + str r0, [r1] + b _08053A60 + .pool +_08053948: + ldr r2, =0x02024084 + ldr r1, =0x0202420b + ldrb r3, [r1] + movs r5, 0x58 + adds r0, r3, 0 + muls r0, r5 + adds r4, r2, 0 + adds r4, 0x50 + adds r0, r4 + ldr r0, [r0] + movs r7, 0x80 + lsls r7, 5 + ands r0, r7 + adds r6, r1, 0 + mov r9, r2 + ldr r1, =0x020242bc + mov r12, r1 + ldr r2, =0x020241ea + mov r8, r2 + cmp r0, 0 + bne _080539BA + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + add r0, r12 + ldrb r2, [r0, 0x11] + movs r1, 0x10 + negs r1, r1 + ands r1, r2 + movs r2, 0x5 + orrs r1, r2 + strb r1, [r0, 0x11] + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + ldrb r2, [r0, 0x11] + movs r1, 0xF + ands r1, r2 + movs r2, 0x50 + orrs r1, r2 + strb r1, [r0, 0x11] + ldrb r0, [r6] + adds r1, r0, 0 + muls r1, r5 + adds r1, r4 + ldr r0, [r1] + orrs r0, r7 + str r0, [r1] + ldr r1, =0x02024268 + ldrb r0, [r6] + lsls r0, 1 + adds r0, r1 + mov r2, r8 + ldrh r1, [r2] + strh r1, [r0] +_080539BA: + ldrb r0, [r6] + lsls r2, r0, 3 + subs r2, r0 + lsls r2, 2 + add r2, r12 + ldrb r3, [r2, 0x11] + lsls r1, r3, 28 + lsrs r1, 28 + subs r1, 0x1 + movs r0, 0xF + ands r1, r0 + movs r0, 0x10 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x11] + cmp r1, 0 + bne _080539EE + ldrb r0, [r6] + adds r1, r0, 0 + muls r1, r5 + adds r1, r4 + ldr r0, [r1] + ldr r2, =0xffffefff + ands r0, r2 + str r0, [r1] +_080539EE: + ldr r3, =0x02024400 + ldr r2, =gBattleMoves + mov r0, r8 + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + strh r0, [r3] + movs r2, 0x1 + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + mov r1, r12 + adds r4, r0, r1 + ldrb r0, [r4, 0x11] + lsls r0, 28 + lsrs r0, 28 + movs r1, 0x5 + subs r1, r0 + ldr r7, =0x02024214 + adds r5, r3, 0 + cmp r2, r1 + bge _08053A3C + adds r1, r5, 0 + adds r3, r4, 0 + movs r4, 0x5 +_08053A28: + ldrh r0, [r1] + lsls r0, 1 + strh r0, [r1] + adds r2, 0x1 + ldrb r0, [r3, 0x11] + lsls r0, 28 + lsrs r0, 28 + subs r0, r4, r0 + cmp r2, r0 + blt _08053A28 +_08053A3C: + ldrb r1, [r6] + movs r0, 0x58 + muls r0, r1 + mov r1, r9 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 23 + ands r0, r1 + cmp r0, 0 + beq _08053A5A + ldrh r0, [r5] + lsls r0, 1 + strh r0, [r5] +_08053A5A: + ldr r0, [r7] + adds r0, 0x1 + str r0, [r7] +_08053A60: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkB3_rolloutdamagecalculation + + thumb_func_start atkB4_jumpifconfusedandattackmaxed +atkB4_jumpifconfusedandattackmaxed: @ 8053A90 + push {r4,r5,lr} + ldr r5, =0x02024084 + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0x58 + adds r3, r1, 0 + muls r3, r0 + adds r0, r5, 0 + adds r0, 0x50 + adds r0, r3, r0 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + ldr r4, =0x02024214 + cmp r0, 0 + beq _08053AEC + ldr r2, [r4] + ldrb r0, [r2, 0x1] + adds r0, r3 + adds r1, r5, 0 + adds r1, 0x18 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0xC + bne _08053AEC + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08053AF2 + .pool +_08053AEC: + ldr r0, [r4] + adds r0, 0x6 + str r0, [r4] +_08053AF2: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end atkB4_jumpifconfusedandattackmaxed + + thumb_func_start sub_8053AF8 +sub_8053AF8: @ 8053AF8 + push {r4,r5,lr} + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _08053B34 + ldr r2, =0x020242bc + ldr r0, =0x0202420b + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strb r1, [r0, 0x10] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082D8A60 + str r0, [r1] + b _08053B8C + .pool +_08053B34: + ldr r5, =0x020242bc + ldr r4, =0x0202420b + ldrb r1, [r4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r1, r0, r5 + ldrb r0, [r1, 0x10] + cmp r0, 0x5 + beq _08053B4C + adds r0, 0x1 + strb r0, [r1, 0x10] +_08053B4C: + ldr r3, =0x02024400 + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + strh r0, [r3] + movs r2, 0x1 + ldrb r1, [r4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r4, =0x02024214 + ldrb r1, [r0, 0x10] + cmp r2, r1 + bge _08053B86 + adds r1, r3, 0 + adds r3, r0, 0 +_08053B78: + ldrh r0, [r1] + lsls r0, 1 + strh r0, [r1] + adds r2, 0x1 + ldrb r0, [r3, 0x10] + cmp r2, r0 + blt _08053B78 +_08053B86: + ldr r0, [r4] + adds r0, 0x1 + str r0, [r4] +_08053B8C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8053AF8 + + thumb_func_start atkB6_happinesstodamagecalculation +atkB6_happinesstodamagecalculation: @ 8053BAC + push {r4,lr} + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0x79 + bne _08053BEC + ldr r4, =0x02024400 + ldr r2, =0x02024084 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x2B + ldrb r1, [r0] + b _08053C02 + .pool +_08053BEC: + ldr r4, =0x02024400 + ldr r2, =0x02024084 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x2B + ldrb r0, [r0] + movs r1, 0xFF + subs r1, r0 +_08053C02: + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + movs r1, 0x19 + bl __divsi3 + strh r0, [r4] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atkB6_happinesstodamagecalculation + + thumb_func_start atkB7_presentdamagecalculation +atkB7_presentdamagecalculation: @ 8053C30 + push {r4,lr} + bl GenerateRandomNumber + movs r4, 0xFF + ands r4, r0 + cmp r4, 0x65 + bgt _08053C4C + ldr r1, =0x02024400 + movs r0, 0x28 + strh r0, [r1] + b _08053C8E + .pool +_08053C4C: + cmp r4, 0xB1 + bgt _08053C5C + ldr r1, =0x02024400 + movs r0, 0x50 + strh r0, [r1] + b _08053C8E + .pool +_08053C5C: + cmp r4, 0xCB + bgt _08053C6C + ldr r1, =0x02024400 + movs r0, 0x78 + strh r0, [r1] + b _08053C8E + .pool +_08053C6C: + ldr r3, =0x020241f0 + ldr r2, =0x02024084 + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0, 0x2C] + lsrs r0, 2 + str r0, [r3] + cmp r0, 0 + bne _08053C88 + movs r0, 0x1 + str r0, [r3] +_08053C88: + ldr r0, [r3] + negs r0, r0 + str r0, [r3] +_08053C8E: + cmp r4, 0xCB + bgt _08053CAC + ldr r1, =0x02024214 + ldr r0, =gUnknown_082D8A30 + b _08053CE6 + .pool +_08053CAC: + ldr r2, =0x02024084 + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r1, [r0, 0x2C] + ldrh r0, [r0, 0x28] + cmp r1, r0 + bne _08053CD8 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082D9EFB + b _08053CE6 + .pool +_08053CD8: + ldr r2, =0x0202427c + ldrb r1, [r2] + movs r0, 0xF7 + ands r0, r1 + strb r0, [r2] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082D9EE1 +_08053CE6: + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atkB7_presentdamagecalculation + + thumb_func_start atkB8_setsafeguard +atkB8_setsafeguard: @ 8053CFC + push {r4-r7,lr} + ldr r7, =0x0202420b + ldrb r0, [r7] + bl battle_get_per_side_status + ldr r4, =0x0202428e + movs r6, 0x1 + adds r1, r6, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + ldrh r1, [r1] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08053D40 + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024332 + movs r0, 0 + strb r0, [r1, 0x5] + b _08053D88 + .pool +_08053D40: + ldrb r0, [r7] + bl battle_get_per_side_status + adds r1, r6, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + ldrh r0, [r1] + movs r2, 0x20 + orrs r0, r2 + strh r0, [r1] + ldrb r0, [r7] + bl battle_get_per_side_status + ldr r5, =0x02024294 + adds r1, r6, 0 + ands r1, r0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r4, 0x5 + strb r4, [r0, 0x6] + ldrb r0, [r7] + bl battle_get_per_side_status + adds r1, r6, 0 + ands r1, r0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r1, [r7] + strb r1, [r0, 0x7] + ldr r0, =0x02024332 + strb r4, [r0, 0x5] +_08053D88: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkB8_setsafeguard + + thumb_func_start atkB9_magnitudedamagecalculation +atkB9_magnitudedamagecalculation: @ 8053DA4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x4 + bgt _08053DD0 + ldr r1, =0x02024400 + movs r0, 0xA + strh r0, [r1] + movs r3, 0x4 + b _08053E3C + .pool +_08053DD0: + cmp r3, 0xE + bgt _08053DE4 + ldr r1, =0x02024400 + movs r0, 0x1E + strh r0, [r1] + movs r3, 0x5 + b _08053E3C + .pool +_08053DE4: + cmp r3, 0x22 + bgt _08053DF8 + ldr r1, =0x02024400 + movs r0, 0x32 + strh r0, [r1] + movs r3, 0x6 + b _08053E3C + .pool +_08053DF8: + cmp r3, 0x40 + bgt _08053E0C + ldr r1, =0x02024400 + movs r0, 0x46 + strh r0, [r1] + movs r3, 0x7 + b _08053E3C + .pool +_08053E0C: + cmp r3, 0x54 + bgt _08053E20 + ldr r1, =0x02024400 + movs r0, 0x5A + strh r0, [r1] + movs r3, 0x8 + b _08053E3C + .pool +_08053E20: + cmp r3, 0x5E + bgt _08053E34 + ldr r1, =0x02024400 + movs r0, 0x6E + strh r0, [r1] + movs r3, 0x9 + b _08053E3C + .pool +_08053E34: + ldr r1, =0x02024400 + movs r0, 0x96 + strh r0, [r1] + movs r3, 0xA +_08053E3C: + ldr r1, =0x02022f58 + movs r2, 0 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x1 + strb r0, [r1, 0x1] + strb r0, [r1, 0x2] + movs r0, 0x2 + strb r0, [r1, 0x3] + strb r3, [r1, 0x4] + movs r0, 0xFF + strb r0, [r1, 0x5] + ldr r1, =0x0202420c + strb r2, [r1] + ldr r0, =0x0202406c + ldrb r3, [r0] + adds r6, r1, 0 + ldr r0, =0x02024214 + mov r8, r0 + cmp r2, r3 + bcs _08053E94 + adds r4, r6, 0 + ldr r0, =0x0202420b + ldrb r5, [r0] + ldr r1, =gUnknown_0832A328 + mov r12, r1 + ldr r7, =0x02024210 +_08053E72: + ldrb r2, [r4] + cmp r2, r5 + beq _08053E88 + ldrb r0, [r7] + ldrb r1, [r6] + lsls r1, 2 + add r1, r12 + ldr r1, [r1] + ands r0, r1 + cmp r0, 0 + beq _08053E94 +_08053E88: + adds r0, r2, 0x1 + strb r0, [r4] + lsls r0, 24 + lsrs r0, 24 + cmp r0, r3 + bcc _08053E72 +_08053E94: + mov r1, r8 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkB9_magnitudedamagecalculation + + thumb_func_start atkBA_802B140 +atkBA_802B140: @ 8053EC8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =0x02024212 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08053EF8 + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08053EF4 + movs r0, 0x1 + b _08053F12 + .pool +_08053EF4: + movs r0, 0 + b _08053F12 +_08053EF8: + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08053F10 + movs r0, 0x3 + b _08053F12 + .pool +_08053F10: + movs r0, 0x2 +_08053F12: + bl battle_get_side_with_given_state + ldr r1, =0x0202420c + strb r0, [r1] + ldr r0, =0x0202421c + ldr r1, =0x0202420c + ldrb r3, [r1] + adds r0, r3, r0 + ldrb r0, [r0] + cmp r0, 0 + beq _08053F2A + b _08054030 +_08053F2A: + ldr r5, =0x0202420b + ldr r0, =0x0202449c + ldr r1, [r0] + adds r1, r3, r1 + ldrb r2, [r5] + ldrb r1, [r1, 0xC] + cmp r2, r1 + bne _08054030 + ldr r4, =0x02024084 + movs r2, 0x58 + adds r0, r3, 0 + muls r0, r2 + adds r1, r4, 0 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x27 + ands r0, r1 + cmp r0, 0 + bne _08054030 + ldrb r0, [r5] + muls r0, r2 + adds r0, r4 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _08054030 + ldr r0, =0x020242bc + lsls r1, r3, 3 + subs r1, r3 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x18] + lsls r0, 31 + cmp r0, 0 + bne _08054030 + ldr r0, =0x02024274 + lsls r1, r3, 1 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0xE4 + bne _08054030 + movs r1, 0 + ldr r0, =0x0202406c + ldr r2, =0x020241ea + mov r8, r2 + ldr r7, =0x020241e8 + mov r10, r7 + ldr r2, =0x020241e9 + mov r9, r2 + ldr r7, =0x02024280 + mov r12, r7 + ldrb r2, [r0] + cmp r1, r2 + bge _08053FB6 + ldr r6, =0x0202407e + ldr r5, =0x0202420c + ldr r4, =0x0202407a + movs r3, 0xB + adds r2, r0, 0 +_08053FA0: + adds r0, r1, r6 + ldrb r0, [r0] + ldrb r7, [r5] + cmp r0, r7 + bne _08053FAE + adds r0, r1, r4 + strb r3, [r0] +_08053FAE: + adds r1, 0x1 + ldrb r0, [r2] + cmp r1, r0 + blt _08053FA0 +_08053FB6: + movs r0, 0xE4 + mov r1, r8 + strh r0, [r1] + ldr r2, =0x0202420c + ldrb r0, [r2] + ldr r7, =0x0202449c + ldr r1, [r7] + adds r0, r1 + adds r0, 0x80 + ldrb r0, [r0] + mov r1, r9 + strb r0, [r1] + mov r2, r10 + strb r0, [r2] + ldr r7, =0x02024214 + ldr r0, [r7] + adds r0, 0x5 + str r0, [r7] + movs r0, 0x1 + ldr r1, =0x02024474 + strb r0, [r1, 0x18] + mov r2, r12 + ldr r0, [r2] + ldr r1, =0xfffffbff + ands r0, r1 + str r0, [r2] + b _0805404A + .pool +_08054030: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_0805404A: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkBA_802B140 + + thumb_func_start sub_805405C +sub_805405C: @ 805405C + push {lr} + ldr r2, =0x020243cc + ldrh r1, [r2] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _08054088 + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024332 + movs r0, 0x2 + strb r0, [r1, 0x5] + b _0805409A + .pool +_08054088: + movs r0, 0x20 + strh r0, [r2] + ldr r1, =0x02024332 + movs r0, 0x4 + strb r0, [r1, 0x5] + ldr r0, =0x020243d0 + adds r0, 0x28 + movs r1, 0x5 + strb r1, [r0] +_0805409A: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_805405C + + thumb_func_start atkBC_maxattackhalvehp +atkBC_maxattackhalvehp: @ 80540B4 + push {r4,r5,lr} + ldr r5, =0x02024084 + ldr r4, =0x0202420b + ldrb r0, [r4] + movs r3, 0x58 + muls r0, r3 + adds r2, r0, r5 + ldrh r0, [r2, 0x2C] + lsrs r1, r0, 1 + cmp r1, 0 + bne _080540CC + movs r1, 0x1 +_080540CC: + movs r0, 0x19 + ldrsb r0, [r2, r0] + cmp r0, 0xB + bgt _08054110 + ldrh r0, [r2, 0x28] + cmp r0, r1 + bls _08054110 + movs r0, 0xC + strb r0, [r2, 0x19] + ldr r1, =0x020241f0 + ldrb r0, [r4] + muls r0, r3 + adds r0, r5 + ldrh r0, [r0, 0x2C] + lsrs r0, 1 + str r0, [r1] + cmp r0, 0 + bne _080540F4 + movs r0, 0x1 + str r0, [r1] +_080540F4: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _0805412A + .pool +_08054110: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_0805412A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atkBC_maxattackhalvehp + + thumb_func_start atkBD_copyfoestats +atkBD_copyfoestats: @ 8054134 + push {r4-r7,lr} + movs r2, 0 + ldr r7, =0x02024214 + ldr r6, =0x0202420b + movs r4, 0x58 + ldr r3, =0x0202409c + ldr r5, =0x0202420c +_08054142: + ldrb r0, [r6] + adds r1, r0, 0 + muls r1, r4 + adds r1, r2, r1 + adds r1, r3 + ldrb r0, [r5] + muls r0, r4 + adds r0, r2, r0 + adds r0, r3 + ldrb r0, [r0] + strb r0, [r1] + adds r2, 0x1 + cmp r2, 0x7 + ble _08054142 + ldr r0, [r7] + adds r0, 0x5 + str r0, [r7] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkBD_copyfoestats + + thumb_func_start atkBE_breakfree +atkBE_breakfree: @ 805417C + push {r4-r6,lr} + ldr r1, =0x02024084 + ldr r5, =0x0202420b + ldrb r2, [r5] + movs r6, 0x58 + adds r0, r2, 0 + muls r0, r6 + adds r4, r1, 0 + adds r4, 0x50 + adds r0, r4 + ldr r0, [r0] + movs r1, 0xE0 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _08054210 + ldr r1, =0x02024474 + ldr r3, =0x0202420c + ldrb r0, [r3] + strb r0, [r1, 0x17] + ldrb r0, [r5] + adds r1, r0, 0 + muls r1, r6 + adds r1, r4 + ldr r0, [r1] + ldr r2, =0xffff1fff + ands r0, r2 + str r0, [r1] + ldrb r0, [r5] + ldr r1, =0x0202449c + ldr r2, [r1] + adds r0, r2 + ldrb r0, [r0, 0x14] + strb r0, [r3] + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x2 + strb r0, [r1, 0x1] + ldrb r0, [r5] + lsls r0, 1 + adds r0, r2 + ldrb r0, [r0, 0x4] + strb r0, [r1, 0x2] + ldrb r0, [r5] + lsls r0, 1 + adds r0, r2 + ldrb r0, [r0, 0x5] + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAFC5 + b _080542BA + .pool +_08054210: + ldr r4, =0x020242ac + lsls r0, r2, 2 + adds r3, r0, r4 + ldr r1, [r3] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08054250 + movs r0, 0x5 + negs r0, r0 + ands r1, r0 + str r1, [r3] + ldrb r1, [r5] + lsls r1, 2 + adds r1, r4 + ldr r0, [r1] + movs r2, 0x4 + negs r2, r2 + ands r0, r2 + str r0, [r1] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAFD6 + b _080542BA + .pool +_08054250: + adds r0, r2, 0 + bl battle_side_get_owner + ldr r4, =0x0202428e + lsls r0, 24 + lsrs r0, 23 + adds r0, r4 + ldrh r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080542B4 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 23 + adds r0, r4 + ldrh r2, [r0] + ldr r1, =0x0000ffef + ands r1, r2 + movs r4, 0 + strh r1, [r0] + ldrb r0, [r5] + bl battle_side_get_owner + ldr r2, =0x02024294 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + strb r4, [r1, 0xA] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAFDD + b _080542BA + .pool +_080542B4: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 +_080542BA: + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atkBE_breakfree + + thumb_func_start atkBF_setcurled +atkBF_setcurled: @ 80542C8 + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r2, r0 + adds r1, 0x50 + adds r2, r1 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 23 + orrs r0, r1 + str r0, [r2] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end atkBF_setcurled + + thumb_func_start atkC0_recoverbasedonsunlight +atkC0_recoverbasedonsunlight: @ 80542F8 + push {r4-r7,lr} + sub sp, 0x4 + ldr r1, =0x0202420c + ldr r5, =0x0202420b + ldrb r0, [r5] + strb r0, [r1] + ldr r7, =0x02024084 + ldrb r0, [r5] + movs r6, 0x58 + muls r0, r6 + adds r0, r7 + ldrh r1, [r0, 0x28] + ldrh r0, [r0, 0x2C] + cmp r1, r0 + beq _080543D8 + ldr r4, =0x020243cc + ldrh r0, [r4] + cmp r0, 0 + beq _0805434A + movs r0, 0 + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0xD + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0805434A + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0x4D + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _08054378 +_0805434A: + ldr r3, =0x020241f0 + ldr r2, =0x02024084 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0, 0x2C] + lsrs r0, 1 + str r0, [r3] + adds r1, r3, 0 + b _080543B2 + .pool +_08054378: + ldrh r1, [r4] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _080543A4 + ldr r4, =0x020241f0 + ldrb r0, [r5] + muls r0, r6 + adds r0, r7 + ldrh r1, [r0, 0x2C] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + movs r1, 0x1E + bl __divsi3 + str r0, [r4] + adds r1, r4, 0 + b _080543B2 + .pool +_080543A4: + ldr r1, =0x020241f0 + ldrb r0, [r5] + muls r0, r6 + adds r0, r7 + ldrh r0, [r0, 0x2C] + lsrs r0, 2 + str r0, [r1] +_080543B2: + adds r2, r1, 0 + ldr r0, [r2] + cmp r0, 0 + bne _080543BE + movs r0, 0x1 + str r0, [r2] +_080543BE: + ldr r0, [r1] + negs r0, r0 + str r0, [r1] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _080543F2 + .pool +_080543D8: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_080543F2: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkC0_recoverbasedonsunlight + + thumb_func_start sub_8054400 +sub_8054400: @ 8054400 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r2, =0x02024084 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + adds r4, r1, 0 + muls r4, r0 + adds r4, r2 + ldrb r0, [r4, 0x14] + mov r10, r0 + mov r7, r10 + lsls r7, 27 + adds r0, r7, 0 + lsrs r0, 27 + mov r10, r0 + movs r1, 0x2 + mov r2, r10 + ands r2, r1 + asrs r2, 1 + ldrh r7, [r4, 0x14] + mov r9, r7 + mov r0, r9 + lsls r0, 22 + mov r9, r0 + lsrs r3, r0, 27 + adds r0, r1, 0 + ands r0, r3 + orrs r2, r0 + ldrb r7, [r4, 0x15] + mov r8, r7 + mov r0, r8 + lsls r0, 25 + mov r8, r0 + lsrs r3, r0, 27 + adds r0, r1, 0 + ands r0, r3 + lsls r0, 1 + orrs r2, r0 + ldr r6, [r4, 0x14] + lsls r6, 12 + lsrs r3, r6, 27 + adds r0, r1, 0 + ands r0, r3 + lsls r0, 2 + orrs r2, r0 + ldrh r5, [r4, 0x16] + lsls r5, 23 + lsrs r3, r5, 27 + adds r0, r1, 0 + ands r0, r3 + lsls r0, 3 + orrs r2, r0 + ldrb r3, [r4, 0x17] + lsls r3, 26 + lsrs r0, r3, 27 + ands r1, r0 + lsls r1, 4 + orrs r2, r1 + movs r1, 0x1 + adds r4, r1, 0 + mov r7, r10 + ands r4, r7 + mov r0, r9 + lsrs r0, 27 + mov r9, r0 + adds r0, r1, 0 + mov r7, r9 + ands r0, r7 + lsls r0, 1 + orrs r4, r0 + mov r0, r8 + lsrs r0, 27 + mov r8, r0 + adds r0, r1, 0 + mov r7, r8 + ands r0, r7 + lsls r0, 2 + orrs r4, r0 + lsrs r6, 27 + adds r0, r1, 0 + ands r0, r6 + lsls r0, 3 + orrs r4, r0 + lsrs r5, 27 + adds r0, r1, 0 + ands r0, r5 + lsls r0, 4 + orrs r4, r0 + lsrs r3, 27 + ands r1, r3 + lsls r1, 5 + orrs r4, r1 + ldr r5, =0x02024400 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + movs r1, 0x3F + bl __divsi3 + adds r0, 0x1E + strh r0, [r5] + ldr r6, =0x0202449c + ldr r5, [r6] + lsls r0, r4, 4 + subs r0, r4 + movs r1, 0x3F + bl __divsi3 + adds r0, 0x1 + strb r0, [r5, 0x13] + ldr r1, [r6] + ldrb r0, [r1, 0x13] + cmp r0, 0x8 + bls _080544F0 + adds r0, 0x1 + strb r0, [r1, 0x13] +_080544F0: + ldr r2, [r6] + ldrb r0, [r2, 0x13] + movs r1, 0xC0 + orrs r0, r1 + strb r0, [r2, 0x13] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8054400 + + thumb_func_start atkC2_selectnexttarget +atkC2_selectnexttarget: @ 8054524 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =0x0202420c + movs r1, 0 + strb r1, [r0] + ldr r1, =0x0202406c + ldrb r1, [r1] + adds r6, r0, 0 + ldr r0, =0x02024214 + mov r8, r0 + cmp r1, 0 + beq _0805456E + adds r3, r6, 0 + ldr r0, =0x0202420b + ldrb r5, [r0] + ldr r0, =gUnknown_0832A328 + mov r12, r0 + adds r4, r1, 0 + ldr r7, =0x02024210 +_0805454C: + ldrb r2, [r3] + cmp r2, r5 + beq _08054562 + ldrb r0, [r7] + ldrb r1, [r6] + lsls r1, 2 + add r1, r12 + ldr r1, [r1] + ands r0, r1 + cmp r0, 0 + beq _0805456E +_08054562: + adds r0, r2, 0x1 + strb r0, [r3] + lsls r0, 24 + lsrs r0, 24 + cmp r0, r4 + bcc _0805454C +_0805456E: + mov r1, r8 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkC2_selectnexttarget + + thumb_func_start atkC3_setfutureattack +atkC3_setfutureattack: @ 8054598 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + ldr r0, =0x020243d0 + mov r8, r0 + ldr r6, =0x0202420c + ldrb r1, [r6] + adds r0, r1, r0 + ldrb r7, [r0] + cmp r7, 0 + beq _080545DC + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _080546CC + .pool +_080545DC: + adds r0, r1, 0 + bl battle_get_per_side_status + ldr r4, =0x0202428e + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + mov r10, r1 + ands r0, r1 + lsls r0, 1 + adds r0, r4 + ldrh r2, [r0] + movs r1, 0x40 + movs r5, 0 + mov r3, sp + strh r5, [r3, 0x10] + orrs r1, r2 + strh r1, [r0] + ldrb r0, [r6] + lsls r0, 1 + mov r1, r8 + adds r1, 0x18 + adds r0, r1 + ldr r1, =0x020241ea + mov r9, r1 + ldrh r1, [r1] + strh r1, [r0] + mov r0, r8 + adds r0, 0x4 + ldrb r2, [r6] + adds r0, r2 + ldr r5, =0x0202420b + ldrb r1, [r5] + strb r1, [r0] + ldrb r0, [r6] + add r0, r8 + movs r1, 0x3 + strb r1, [r0] + ldrb r0, [r6] + bl battle_get_per_side_status + mov r1, r10 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + ldrh r3, [r1] + ldrb r0, [r5] + movs r4, 0x58 + muls r0, r4 + ldr r2, =0x02024084 + adds r0, r2 + ldrb r1, [r6] + muls r1, r4 + adds r1, r2 + mov r4, r9 + ldrh r2, [r4] + str r7, [sp] + str r7, [sp, 0x4] + ldrb r4, [r5] + str r4, [sp, 0x8] + ldrb r4, [r6] + str r4, [sp, 0xC] + bl sub_806957C + ldrb r1, [r6] + lsls r1, 2 + mov r2, r8 + adds r2, 0x8 + adds r1, r2 + str r0, [r1] + ldr r1, =0x0202433c + ldrb r0, [r5] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 28 + cmp r0, 0 + bge _0805468C + ldrb r4, [r6] + lsls r4, 2 + adds r4, r2 + ldr r1, [r4] + lsls r0, r1, 4 + subs r0, r1 + movs r1, 0xA + bl __divsi3 + str r0, [r4] +_0805468C: + mov r5, r9 + ldrh r1, [r5] + ldr r0, =0x00000161 + cmp r1, r0 + bne _080546BC + ldr r0, =0x02024332 + mov r1, r10 + strb r1, [r0, 0x5] + b _080546C4 + .pool +_080546BC: + ldr r0, =0x02024332 + mov r2, sp + ldrb r2, [r2, 0x10] + strb r2, [r0, 0x5] +_080546C4: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_080546CC: + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkC3_setfutureattack + + thumb_func_start atkC4_802B910 +atkC4_802B910: @ 80546E4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + ldr r7, =0x02024744 + cmp r0, 0 + bne _080546FE + ldr r7, =0x020244ec +_080546FE: + ldr r2, =0x02024084 + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _08054740 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + b _080548DC + .pool +_08054740: + ldr r6, =0x02024332 + ldrb r0, [r6] + mov r8, r0 + cmp r0, 0x5 + bls _0805474C + b _080548A8 +_0805474C: + adds r4, r6, 0 + movs r5, 0x64 +_08054750: + ldrb r0, [r4] + muls r0, r5 + adds r0, r7, r0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _08054794 + ldrb r0, [r6] + muls r0, r5 + adds r0, r7, r0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + beq _08054794 + ldrb r0, [r4] + muls r0, r5 + adds r0, r7, r0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _08054794 + ldrb r0, [r4] + muls r0, r5 + adds r0, r7, r0 + movs r1, 0x37 + bl pokemon_getattr + cmp r0, 0 + beq _080547A4 +_08054794: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + adds r6, r4, 0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bls _08054750 +_080547A4: + ldr r1, =0x02024332 + mov r9, r1 + ldrb r2, [r1] + cmp r2, 0x5 + bhi _080548A8 + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x4 + strb r0, [r1, 0x1] + ldr r6, =0x0202420b + ldrb r0, [r6] + strb r0, [r1, 0x2] + strb r2, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x9 + str r0, [r1] + ldr r2, =0x020241f0 + mov r8, r2 + ldr r5, =gBaseStats + mov r1, r9 + ldrb r0, [r1] + movs r4, 0x64 + muls r0, r4 + adds r0, r7, r0 + movs r1, 0xB + bl pokemon_getattr + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r3, [r1, 0x1] + mov r2, r8 + str r3, [r2] + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + muls r0, r3 + mov r1, r8 + str r0, [r1] + mov r2, r9 + ldrb r0, [r2] + muls r0, r4 + adds r0, r7, r0 + movs r1, 0x38 + bl pokemon_getattr + lsls r0, 1 + movs r1, 0x5 + bl __udivsi3 + adds r0, 0x2 + mov r2, r8 + ldr r1, [r2] + muls r0, r1 + str r0, [r2] + ldr r3, =0x02024084 + ldr r1, =0x0202420c + ldrb r2, [r1] + movs r1, 0x58 + muls r1, r2 + adds r1, r3 + ldrh r2, [r1] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r5 + ldrb r1, [r1, 0x2] + bl __divsi3 + mov r1, r8 + str r0, [r1] + movs r1, 0x32 + bl __divsi3 + adds r2, r0, 0x2 + mov r0, r8 + str r2, [r0] + ldr r1, =0x0202433c + ldrb r0, [r6] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 28 + cmp r0, 0 + bge _08054870 + lsls r0, r2, 4 + subs r0, r2 + movs r1, 0xA + bl __divsi3 + mov r1, r8 + str r0, [r1] +_08054870: + mov r2, r9 + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + b _080548E2 + .pool +_080548A8: + mov r0, r8 + cmp r0, 0 + beq _080548C8 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + b _080548DC + .pool +_080548C8: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x5] + ldrb r0, [r2, 0x6] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x7] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x8] +_080548DC: + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_080548E2: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkC4_802B910 + + thumb_func_start atkC5_hidepreattack +atkC5_hidepreattack: @ 80548F4 + push {lr} + ldr r0, =0x020241ea + ldrh r1, [r0] + cmp r1, 0x5B + beq _08054934 + cmp r1, 0x5B + bgt _0805490C + cmp r1, 0x13 + beq _08054918 + b _08054960 + .pool +_0805490C: + ldr r0, =0x00000123 + cmp r1, r0 + beq _0805494C + adds r0, 0x31 + cmp r1, r0 + bne _08054960 +_08054918: + ldr r2, =0x020242ac + ldr r0, =0x0202420b + ldrb r1, [r0] + lsls r1, 2 + adds r1, r2 + ldr r0, [r1] + movs r2, 0x40 + b _0805495C + .pool +_08054934: + ldr r2, =0x020242ac + ldr r0, =0x0202420b + ldrb r1, [r0] + lsls r1, 2 + adds r1, r2 + ldr r0, [r1] + movs r2, 0x80 + b _0805495C + .pool +_0805494C: + ldr r2, =0x020242ac + ldr r0, =0x0202420b + ldrb r1, [r0] + lsls r1, 2 + adds r1, r2 + ldr r0, [r1] + movs r2, 0x80 + lsls r2, 11 +_0805495C: + orrs r0, r2 + str r0, [r1] +_08054960: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end atkC5_hidepreattack + + thumb_func_start atkC6_unhidepostattack +atkC6_unhidepostattack: @ 8054978 + push {lr} + ldr r0, =0x020241ea + ldrh r1, [r0] + cmp r1, 0x5B + beq _080549BC + cmp r1, 0x5B + bgt _08054990 + cmp r1, 0x13 + beq _0805499C + b _080549EA + .pool +_08054990: + ldr r0, =0x00000123 + cmp r1, r0 + beq _080549D8 + adds r0, 0x31 + cmp r1, r0 + bne _080549EA +_0805499C: + ldr r2, =0x020242ac + ldr r0, =0x0202420b + ldrb r1, [r0] + lsls r1, 2 + adds r1, r2 + ldr r0, [r1] + movs r2, 0x41 + negs r2, r2 + b _080549E6 + .pool +_080549BC: + ldr r2, =0x020242ac + ldr r0, =0x0202420b + ldrb r1, [r0] + lsls r1, 2 + adds r1, r2 + ldr r0, [r1] + movs r2, 0x81 + negs r2, r2 + b _080549E6 + .pool +_080549D8: + ldr r2, =0x020242ac + ldr r0, =0x0202420b + ldrb r1, [r0] + lsls r1, 2 + adds r1, r2 + ldr r0, [r1] + ldr r2, =0xfffbffff +_080549E6: + ands r0, r2 + str r0, [r1] +_080549EA: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end atkC6_unhidepostattack + + thumb_func_start atkC7_setminimize +atkC7_setminimize: @ 8054A08 + push {lr} + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 18 + ands r0, r1 + cmp r0, 0 + beq _08054A2C + ldr r2, =0x020242ac + ldr r0, =0x0202420b + ldrb r1, [r0] + lsls r1, 2 + adds r1, r2 + ldr r0, [r1] + movs r2, 0x80 + lsls r2, 1 + orrs r0, r2 + str r0, [r1] +_08054A2C: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end atkC7_setminimize + + thumb_func_start sub_8054A48 +sub_8054A48: @ 8054A48 + push {lr} + ldr r3, =0x020243cc + ldrh r1, [r3] + movs r2, 0x80 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _08054A78 + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024332 + movs r0, 0x2 + strb r0, [r1, 0x5] + b _08054A86 + .pool +_08054A78: + strh r2, [r3] + ldr r0, =0x02024332 + movs r1, 0x5 + strb r1, [r0, 0x5] + ldr r0, =0x020243d0 + adds r0, 0x28 + strb r1, [r0] +_08054A86: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8054A48 + + thumb_func_start atkC9_jumpifattackandspecialattackcannotfall +atkC9_jumpifattackandspecialattackcannotfall: @ 8054AA0 + push {r4,lr} + ldr r2, =0x02024084 + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r1, r0, r2 + movs r0, 0x19 + ldrsb r0, [r1, r0] + adds r3, r2, 0 + cmp r0, 0 + bne _08054AF4 + movs r0, 0x1C + ldrsb r0, [r1, r0] + cmp r0, 0 + bne _08054AF4 + ldr r0, =0x02024332 + ldrb r0, [r0, 0x6] + cmp r0, 0x1 + beq _08054AF4 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08054B20 + .pool +_08054AF4: + ldr r4, =0x02024064 + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r4] + ldr r2, =0x020241f0 + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 + adds r0, r3 + ldrh r0, [r0, 0x28] + str r0, [r2] + ldr r1, =0x00007fff + movs r0, 0 + bl dp01_build_cmdbuf_x18_0_aa_health_bar_update + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_08054B20: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atkC9_jumpifattackandspecialattackcannotfall + + thumb_func_start atkCA_setforcedtarget +atkCA_setforcedtarget: @ 8054B3C + push {r4,r5,lr} + ldr r4, =0x0202420b + ldrb r0, [r4] + bl battle_side_get_owner + ldr r5, =0x02024294 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + movs r0, 0x1 + strb r0, [r1, 0x8] + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r0, [r4] + strb r0, [r1, 0x9] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atkCA_setforcedtarget + + thumb_func_start atkCB_setcharge +atkCB_setcharge: @ 8054B88 + push {r4,lr} + ldr r0, =0x020242ac + ldr r3, =0x0202420b + ldrb r1, [r3] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + movs r2, 0x80 + lsls r2, 2 + orrs r0, r2 + str r0, [r1] + ldr r4, =0x020242bc + ldrb r1, [r3] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r2, [r0, 0x12] + movs r1, 0x10 + negs r1, r1 + ands r1, r2 + movs r2, 0x2 + orrs r1, r2 + strb r1, [r0, 0x12] + ldrb r1, [r3] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r2, [r0, 0x12] + movs r1, 0xF + ands r1, r2 + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0, 0x12] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atkCB_setcharge + + thumb_func_start atkCC_callterrainattack +atkCC_callterrainattack: @ 8054BEC + push {r4,lr} + ldr r2, =0x02024280 + ldr r0, [r2] + ldr r1, =0xfffffbff + ands r0, r1 + str r0, [r2] + ldr r4, =0x020241ea + ldr r1, =gUnknown_0831C414 + ldr r0, =0x02022ff0 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r4] + ldrh r0, [r4] + movs r1, 0 + bl sub_80458E0 + ldr r1, =0x0202420c + strb r0, [r1] + ldr r3, =gUnknown_082D86A8 + ldr r2, =gBattleMoves + ldrh r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + bl b_movescr_stack_push + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atkCC_callterrainattack + + thumb_func_start atkCD_cureifburnedparalysedorpoisoned +atkCD_cureifburnedparalysedorpoisoned: @ 8054C60 + push {r4-r6,lr} + sub sp, 0x4 + ldr r1, =0x02024084 + ldr r3, =0x0202420b + ldrb r0, [r3] + movs r6, 0x58 + muls r0, r6 + adds r5, r1, 0 + adds r5, 0x4C + adds r2, r0, r5 + ldr r0, [r2] + movs r1, 0xD8 + ands r0, r1 + cmp r0, 0 + beq _08054CBC + movs r0, 0 + str r0, [r2] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + ldr r4, =0x02024064 + ldrb r0, [r3] + strb r0, [r4] + ldrb r0, [r4] + muls r0, r6 + adds r0, r5 + str r0, [sp] + movs r0, 0 + movs r1, 0x28 + movs r2, 0 + movs r3, 0x4 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + b _08054CD6 + .pool +_08054CBC: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_08054CD6: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atkCD_cureifburnedparalysedorpoisoned + + thumb_func_start atkCE_settorment +atkCE_settorment: @ 8054CE4 + push {lr} + ldr r1, =0x02024084 + ldr r0, =0x0202420c + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r1, [r0] + movs r2, 0x80 + lsls r2, 24 + cmp r1, 0 + bge _08054D28 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08054D34 + .pool +_08054D28: + orrs r1, r2 + str r1, [r0] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_08054D34: + pop {r0} + bx r0 + .pool + thumb_func_end atkCE_settorment + + thumb_func_start atkCF_jumpifnodamage +atkCF_jumpifnodamage: @ 8054D3C + push {lr} + ldr r2, =0x0202433c + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r1, r0, 4 + adds r0, r2, 0x4 + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _08054D5C + adds r0, r2, 0 + adds r0, 0x8 + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + beq _08054D74 +_08054D5C: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _08054D8E + .pool +_08054D74: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_08054D8E: + pop {r0} + bx r0 + .pool + thumb_func_end atkCF_jumpifnodamage + + thumb_func_start atkD0_settaunt +atkD0_settaunt: @ 8054D98 + push {r4,lr} + ldr r4, =0x020242bc + ldr r3, =0x0202420c + ldrb r0, [r3] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r2, r1, r4 + ldrb r1, [r2, 0x13] + lsls r0, r1, 28 + cmp r0, 0 + bne _08054DE8 + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2, 0x13] + ldrb r1, [r3] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r2, [r0, 0x13] + movs r1, 0xF + ands r1, r2 + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0, 0x13] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _08054E02 + .pool +_08054DE8: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_08054E02: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atkD0_settaunt + + thumb_func_start atkD1_sethelpinghand +atkD1_sethelpinghand: @ 8054E0C + push {r4,lr} + ldr r4, =0x0202420b + ldrb r0, [r4] + bl battle_get_per_side_status + movs r1, 0x2 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + ldr r3, =0x0202420c + strb r0, [r3] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08054E90 + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + ldrb r3, [r3] + lsls r0, r3, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08054E90 + ldr r1, =0x0202433c + ldrb r0, [r4] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 28 + cmp r0, 0 + blt _08054E90 + lsls r0, r3, 4 + adds r2, r0, r1 + ldrb r1, [r2] + lsls r0, r1, 28 + cmp r0, 0 + blt _08054E90 + movs r0, 0x8 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _08054EAA + .pool +_08054E90: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_08054EAA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atkD1_sethelpinghand + + thumb_func_start sub_8054EB4 +sub_8054EB4: @ 8054EB4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r4, =0x02022fec + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 19 + ands r0, r1 + cmp r0, 0 + bne _08054F9A + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08054EE8 + ldr r0, [r4] + ldr r1, =0x0a3f0902 + ands r0, r1 + cmp r0, 0 + beq _08054F9A +_08054EE8: + ldr r6, =0x0202420b + ldrb r0, [r6] + bl battle_side_get_owner + lsls r0, 24 + lsrs r4, r0, 24 + ldr r7, =0x0202420c + ldrb r0, [r7] + bl battle_side_get_owner + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x0a3f0902 + ands r0, r1 + cmp r0, 0 + bne _08054F46 + ldr r0, =0x020243d0 + adds r2, r0, 0 + adds r2, 0x29 + adds r0, r4, r2 + ldrb r1, [r0] + ldr r4, =gUnknown_0832A328 + ldr r3, =0x0202406e + ldrb r0, [r6] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08054F9A + adds r0, r5, r2 + ldrb r1, [r0] + ldrb r0, [r7] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08054F9A +_08054F46: + ldr r0, =0x02024084 + mov r8, r0 + ldr r1, =0x0202420b + ldrb r4, [r1] + movs r5, 0x58 + adds r0, r4, 0 + muls r0, r5 + add r0, r8 + mov r9, r0 + ldrh r3, [r0, 0x2E] + adds r1, r3, 0 + cmp r1, 0 + bne _08054F6E + ldr r0, =0x0202420c + ldrb r0, [r0] + muls r0, r5 + add r0, r8 + ldrh r0, [r0, 0x2E] + cmp r0, 0 + beq _08054F9A +_08054F6E: + cmp r1, 0xAF + beq _08054F9A + ldr r7, =0x0202420c + ldrb r0, [r7] + muls r0, r5 + mov r2, r8 + adds r1, r0, r2 + ldrh r2, [r1, 0x2E] + cmp r2, 0xAF + beq _08054F9A + adds r0, r3, 0 + subs r0, 0x79 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xB + bls _08054F9A + adds r0, r2, 0 + subs r0, 0x79 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xB + bhi _08054FDC +_08054F9A: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08055132 + .pool +_08054FDC: + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x3C + bne _08055010 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB63F + str r0, [r1] + ldr r1, =0x0202420a + ldrb r0, [r7] + muls r0, r5 + add r0, r8 + adds r0, 0x20 + ldrb r0, [r0] + strb r0, [r1] + ldrb r0, [r7] + ldrb r1, [r1] + bl b_history__record_ability_usage_of_player + b _08055132 + .pool +_08055010: + ldr r3, =0x0202449c + mov r10, r3 + lsls r0, r4, 1 + adds r0, 0xD0 + ldr r1, [r3] + adds r6, r1, r0 + mov r0, r9 + ldrh r0, [r0, 0x2E] + mov r9, r0 + strh r2, [r6] + ldr r1, =0x0202420b + ldrb r0, [r1] + muls r0, r5 + add r0, r8 + movs r1, 0 + strh r1, [r0, 0x2E] + ldrb r0, [r7] + muls r0, r5 + add r0, r8 + mov r2, r9 + strh r2, [r0, 0x2E] + ldr r4, =0x02024064 + ldr r3, =0x0202420b + ldrb r0, [r3] + strb r0, [r4] + str r6, [sp] + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + movs r3, 0x2 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldr r1, =0x0202420b + ldrb r0, [r1] + bl dp01_battle_side_mark_buffer_for_execution + ldrb r0, [r7] + strb r0, [r4] + ldrb r0, [r7] + muls r0, r5 + mov r1, r8 + adds r1, 0x2E + adds r0, r1 + str r0, [sp] + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + movs r3, 0x2 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r7] + bl dp01_battle_side_mark_buffer_for_execution + ldrb r0, [r7] + mov r2, r10 + ldr r1, [r2] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC8 + movs r3, 0 + strb r3, [r0] + ldrb r0, [r7] + ldr r1, [r2] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC9 + strb r3, [r0] + ldr r1, =0x0202420b + ldrb r0, [r1] + ldr r1, [r2] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC8 + strb r3, [r0] + ldr r2, =0x0202420b + ldrb r0, [r2] + mov r3, r10 + ldr r1, [r3] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC9 + movs r1, 0 + strb r1, [r0] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + ldr r1, =0x02022f58 + movs r3, 0xFD + strb r3, [r1] + movs r2, 0xA + strb r2, [r1, 0x1] + ldrh r0, [r6] + strb r0, [r1, 0x2] + ldrh r0, [r6] + lsrs r0, 8 + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r1, =0x02022f68 + strb r3, [r1] + strb r2, [r1, 0x1] + mov r2, r9 + strb r2, [r1, 0x2] + mov r3, r9 + lsrs r0, r3, 8 + strb r0, [r1, 0x3] + movs r0, 0x1 + negs r0, r0 + strb r0, [r1, 0x4] + cmp r3, 0 + beq _08055118 + ldrh r0, [r6] + cmp r0, 0 + beq _0805512C + ldr r1, =0x02024332 + movs r0, 0x2 + b _08055130 + .pool +_08055118: + ldrh r0, [r6] + cmp r0, 0 + beq _0805512C + ldr r0, =0x02024332 + movs r1, 0 + strb r1, [r0, 0x5] + b _08055132 + .pool +_0805512C: + ldr r1, =0x02024332 + movs r0, 0x1 +_08055130: + strb r0, [r1, 0x5] +_08055132: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8054EB4 + + thumb_func_start sub_8055148 +sub_8055148: @ 8055148 + push {r4,lr} + ldr r3, =0x02024084 + ldr r4, =0x0202420c + ldrb r0, [r4] + movs r2, 0x58 + muls r0, r2 + adds r0, r3 + adds r0, 0x20 + ldrb r1, [r0] + adds r0, r1, 0 + cmp r0, 0 + beq _0805519C + cmp r0, 0x19 + beq _0805519C + ldr r0, =0x0202420b + ldrb r0, [r0] + muls r0, r2 + adds r0, r3 + adds r0, 0x20 + strb r1, [r0] + ldr r1, =0x0202420a + ldrb r0, [r4] + muls r0, r2 + adds r0, r3 + adds r0, 0x20 + ldrb r0, [r0] + strb r0, [r1] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _080551B6 + .pool +_0805519C: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_080551B6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8055148 + + thumb_func_start atkD4_802C408 +atkD4_802C408: @ 80551C0 + push {r4-r7,lr} + ldr r7, =0x02024214 + ldr r2, [r7] + ldrb r3, [r2, 0x1] + cmp r3, 0 + beq _080551D8 + cmp r3, 0x1 + beq _08055210 + b _0805528C + .pool +_080551D8: + ldr r1, =0x020243d0 + ldr r4, =0x0202420b + adds r0, r1, 0 + adds r0, 0x20 + ldrb r5, [r4] + adds r3, r0, r5 + ldrb r0, [r3] + cmp r0, 0 + bne _0805525C + movs r0, 0x2 + strb r0, [r3] + ldrb r0, [r4] + adds r1, 0x24 + adds r1, r0, r1 + ldr r2, =0x0202406e + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + strb r0, [r1] + ldr r0, [r7] + adds r0, 0x6 + b _0805528A + .pool +_08055210: + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x4 + strb r0, [r1, 0x1] + ldr r4, =0x0202420c + ldrb r0, [r4] + strb r0, [r1, 0x2] + ldr r0, =0x020243d0 + adds r0, 0x24 + ldrb r5, [r4] + adds r0, r5 + ldrb r0, [r0] + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r1, =0x020241f0 + ldr r6, =0x02024084 + ldrb r0, [r4] + movs r5, 0x58 + muls r0, r5 + adds r0, r6 + ldrh r0, [r0, 0x2C] + lsrs r0, 1 + str r0, [r1] + cmp r0, 0 + bne _08055248 + str r3, [r1] +_08055248: + ldr r0, [r1] + negs r0, r0 + str r0, [r1] + ldrb r0, [r4] + muls r0, r5 + adds r0, r6 + ldrh r1, [r0, 0x28] + ldrh r0, [r0, 0x2C] + cmp r1, r0 + bne _08055288 +_0805525C: + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r7] + b _0805528C + .pool +_08055288: + adds r0, r2, 0x6 +_0805528A: + str r0, [r7] +_0805528C: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end atkD4_802C408 + + thumb_func_start sub_8055294 +sub_8055294: @ 8055294 + push {lr} + ldr r1, =0x020242ac + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 2 + adds r2, r0, r1 + ldr r1, [r2] + movs r3, 0x80 + lsls r3, 3 + adds r0, r1, 0 + ands r0, r3 + cmp r0, 0 + beq _080552D8 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _080552E4 + .pool +_080552D8: + orrs r1, r3 + str r1, [r2] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_080552E4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8055294 + + thumb_func_start atkD6_doubledamagedealtifdamaged +atkD6_doubledamagedealtifdamaged: @ 80552EC + push {lr} + ldr r3, =0x0202433c + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r2, r0, 4 + adds r0, r3, 0x4 + adds r0, r2, r0 + ldr r0, [r0] + cmp r0, 0 + beq _0805530C + adds r0, r2, r3 + ldr r1, =0x0202420c + ldrb r0, [r0, 0xC] + ldrb r1, [r1] + cmp r0, r1 + beq _08055324 +_0805530C: + adds r0, r3, 0 + adds r0, 0x8 + adds r0, r2, r0 + ldr r0, [r0] + cmp r0, 0 + beq _0805532A + adds r0, r2, r3 + ldr r1, =0x0202420c + ldrb r0, [r0, 0xD] + ldrb r1, [r1] + cmp r0, r1 + bne _0805532A +_08055324: + ldr r1, =0x02024474 + movs r0, 0x2 + strb r0, [r1, 0xE] +_0805532A: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end atkD6_doubledamagedealtifdamaged + + thumb_func_start sub_805534C +sub_805534C: @ 805534C + push {r4,lr} + ldr r1, =0x020242ac + ldr r0, =0x0202420c + ldrb r3, [r0] + lsls r0, r3, 2 + adds r4, r0, r1 + ldr r2, [r4] + movs r0, 0xC0 + lsls r0, 5 + ands r0, r2 + cmp r0, 0 + bne _08055374 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r3 + adds r1, 0x4C + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080553A0 +_08055374: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _080553B0 + .pool +_080553A0: + movs r0, 0x80 + lsls r0, 5 + orrs r2, r0 + str r2, [r4] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_080553B0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805534C + + thumb_func_start atkD8_setdamagetohealthdifference +atkD8_setdamagetohealthdifference: @ 80553BC + push {lr} + ldr r2, =0x02024084 + ldr r0, =0x0202420c + ldrb r0, [r0] + movs r1, 0x58 + muls r0, r1 + adds r3, r0, r2 + ldr r0, =0x0202420b + ldrb r0, [r0] + muls r0, r1 + adds r1, r0, r2 + ldrh r0, [r3, 0x28] + ldrh r2, [r1, 0x28] + cmp r0, r2 + bhi _08055408 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _0805541A + .pool +_08055408: + ldr r2, =0x020241f0 + ldrh r0, [r3, 0x28] + ldrh r1, [r1, 0x28] + subs r0, r1 + str r0, [r2] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_0805541A: + pop {r0} + bx r0 + .pool + thumb_func_end atkD8_setdamagetohealthdifference + + thumb_func_start atkD9_scaledamagebyhealthratio +atkD9_scaledamagebyhealthratio: @ 8055428 + push {r4,lr} + ldr r4, =0x02024400 + ldrh r0, [r4] + cmp r0, 0 + bne _08055464 + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r3, [r0, 0x1] + ldr r2, =0x02024084 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + muls r1, r0 + adds r1, r2 + ldrh r0, [r1, 0x28] + muls r0, r3 + ldrh r1, [r1, 0x2C] + bl __divsi3 + strh r0, [r4] + lsls r0, 16 + cmp r0, 0 + bne _08055464 + movs r0, 0x1 + strh r0, [r4] +_08055464: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atkD9_scaledamagebyhealthratio + + thumb_func_start atkDA_abilityswap +atkDA_abilityswap: @ 805548C + push {r4-r6,lr} + ldr r5, =0x02024084 + ldr r0, =0x0202420b + ldrb r0, [r0] + movs r4, 0x58 + muls r0, r4 + adds r0, r5 + adds r2, r0, 0 + adds r2, 0x20 + ldrb r1, [r2] + cmp r1, 0 + bne _080554B4 + ldr r0, =0x0202420c + ldrb r0, [r0] + muls r0, r4 + adds r0, r5 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0 + beq _080554D4 +_080554B4: + cmp r1, 0x19 + beq _080554D4 + ldr r6, =0x0202420c + ldrb r0, [r6] + muls r0, r4 + adds r0, r5 + adds r0, 0x20 + ldrb r3, [r0] + cmp r3, 0x19 + beq _080554D4 + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _08055504 +_080554D4: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _0805551A + .pool +_08055504: + ldrb r1, [r2] + strb r3, [r2] + ldrb r0, [r6] + muls r0, r4 + adds r0, r5 + adds r0, 0x20 + strb r1, [r0] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_0805551A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atkDA_abilityswap + + thumb_func_start atkDB_imprisoneffect +atkDB_imprisoneffect: @ 8055524 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r1, =0x020242ac + ldr r4, =0x0202420b + ldrb r2, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 6 + ands r0, r1 + cmp r0, 0 + beq _08055574 + b _080555F6 + .pool +_0805554C: + ldr r0, =0x020242ac + mov r2, r9 + ldrb r1, [r2] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + movs r2, 0x80 + lsls r2, 6 + orrs r0, r2 + str r0, [r1] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _080555EE + .pool +_08055574: + adds r0, r2, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldrb r0, [r4] + bl sub_803F548 + movs r6, 0 + b _080555E6 +_0805558A: + adds r0, r6, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r8, r0 + beq _080555E0 + movs r4, 0 + ldr r7, =0x0202420b + mov r9, r7 + ldr r0, =0x02024084 + mov r12, r0 + mov r1, r9 + ldrb r0, [r1] + mov r2, r12 + adds r2, 0xC + movs r1, 0x58 + muls r0, r1 + adds r3, r0, r2 + adds r5, r6, 0 + muls r5, r1 +_080555B4: + movs r2, 0 + ldrh r1, [r3] + mov r0, r12 + adds r0, 0xC + adds r0, r5, r0 +_080555BE: + ldrh r7, [r0] + cmp r1, r7 + bne _080555C8 + cmp r1, 0 + bne _080555D0 +_080555C8: + adds r0, 0x2 + adds r2, 0x1 + cmp r2, 0x3 + ble _080555BE +_080555D0: + cmp r2, 0x4 + bne _080555DC + adds r3, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + ble _080555B4 +_080555DC: + cmp r4, 0x4 + bne _0805554C +_080555E0: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_080555E6: + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r6, r0 + bcc _0805558A +_080555EE: + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r6, r0 + bne _08055610 +_080555F6: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_08055610: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkDB_imprisoneffect + + thumb_func_start atkDC_setgrudge +atkDC_setgrudge: @ 805562C + push {lr} + ldr r1, =0x020242ac + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 2 + adds r2, r0, r1 + ldr r1, [r2] + movs r3, 0x80 + lsls r3, 7 + adds r0, r1, 0 + ands r0, r3 + cmp r0, 0 + beq _08055670 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _0805567C + .pool +_08055670: + orrs r1, r3 + str r1, [r2] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_0805567C: + pop {r0} + bx r0 + .pool + thumb_func_end atkDC_setgrudge + + thumb_func_start atkDD_weightdamagecalculation +atkDD_weightdamagecalculation: @ 8055684 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r5, 0 + ldr r2, =gUnknown_0831C428 + ldrh r0, [r2] + ldr r1, =0x0000ffff + cmp r0, r1 + beq _080556FC + adds r6, r2, 0 + ldr r0, =0x02024084 + mov r8, r0 + adds r7, r1, 0 + adds r4, r6, 0 +_080556A0: + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + add r0, r8 + ldrh r0, [r0] + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl sub_80C0630 + ldrh r1, [r4] + lsls r0, 16 + lsrs r0, 16 + cmp r1, r0 + bhi _080556CE + adds r4, 0x4 + adds r5, 0x2 + ldrh r0, [r4] + cmp r0, r7 + bne _080556A0 +_080556CE: + lsls r0, r5, 1 + adds r0, r6 + ldrh r1, [r0] + ldr r0, =0x0000ffff + cmp r1, r0 + beq _080556FC + ldr r0, =0x02024400 + adds r1, r5, 0x1 + lsls r1, 1 + adds r1, r6 + ldrh r1, [r1] + strh r1, [r0] + b _08055702 + .pool +_080556FC: + ldr r1, =0x02024400 + movs r0, 0x78 + strh r0, [r1] +_08055702: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkDD_weightdamagecalculation + + thumb_func_start atkDE_asistattackselect +atkDE_asistattackselect: @ 805571C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + movs r0, 0 + mov r10, r0 + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x18 + str r0, [sp, 0x4] + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_get_per_side_status + movs r1, 0x1 + ands r1, r0 + ldr r0, =0x020244ec + str r0, [sp] + cmp r1, 0 + beq _0805574C + ldr r1, =0x02024744 + str r1, [sp] +_0805574C: + movs r2, 0 +_0805574E: + ldr r1, =0x0202406e + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + adds r1, r2, 0x1 + str r1, [sp, 0x8] + ldrh r0, [r0] + cmp r2, r0 + beq _080557F4 + movs r0, 0x64 + adds r6, r2, 0 + muls r6, r0 + ldr r0, [sp] + adds r4, r0, r6 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + beq _080557F4 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _080557F4 + movs r5, 0 + ldr r1, =0x0000ffff + mov r8, r1 + mov r9, r6 + mov r1, r10 + lsls r0, r1, 1 + ldr r1, [sp, 0x4] + adds r6, r0, r1 +_08055798: + movs r7, 0 + adds r1, r5, 0 + adds r1, 0xD + ldr r0, [sp] + add r0, r9 + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl sub_8052F84 + lsls r0, 24 + adds r1, r5, 0x1 + cmp r0, 0 + bne _080557EE + ldr r0, =gUnknown_0831C3E0 + ldrh r2, [r0] + adds r3, r0, 0 + cmp r2, r8 + beq _080557E2 + cmp r4, r2 + beq _080557D8 + ldr r5, =0x0000ffff + adds r2, r3, 0 +_080557CA: + adds r2, 0x2 + adds r7, 0x1 + ldrh r0, [r2] + cmp r0, r5 + beq _080557E2 + cmp r4, r0 + bne _080557CA +_080557D8: + lsls r0, r7, 1 + adds r0, r3 + ldrh r0, [r0] + cmp r0, r8 + bne _080557EE +_080557E2: + cmp r4, 0 + beq _080557EE + strh r4, [r6] + adds r6, 0x2 + movs r0, 0x1 + add r10, r0 +_080557EE: + adds r5, r1, 0 + cmp r5, 0x3 + ble _08055798 +_080557F4: + ldr r2, [sp, 0x8] + cmp r2, 0x5 + ble _0805574E + mov r1, r10 + cmp r1, 0 + beq _0805586C + ldr r2, =0x02024280 + ldr r0, [r2] + ldr r1, =0xfffffbff + ands r0, r1 + str r0, [r2] + ldr r4, =0x020241ee + bl GenerateRandomNumber + movs r1, 0xFF + ands r1, r0 + mov r0, r10 + muls r0, r1 + asrs r0, 8 + lsls r0, 1 + ldr r1, [sp, 0x4] + adds r0, r1 + ldrh r0, [r0] + strh r0, [r4] + ldrh r0, [r4] + movs r1, 0 + bl sub_80458E0 + ldr r1, =0x0202420c + strb r0, [r1] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _08055886 + .pool +_0805586C: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_08055886: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkDE_asistattackselect + + thumb_func_start atkDF_setmagiccoat +atkDF_setmagiccoat: @ 805589C + push {lr} + ldr r1, =0x0202420c + ldr r3, =0x0202420b + ldrb r0, [r3] + strb r0, [r1] + ldr r2, =0x0202437c + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0] + ldr r0, =0x02024082 + ldrb r1, [r0] + ldr r0, =0x0202406c + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bne _080558FC + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08055914 + .pool +_080558FC: + ldr r0, =0x0202433c + ldrb r1, [r3] + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x10 + orrs r0, r2 + strb r0, [r1] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_08055914: + pop {r0} + bx r0 + .pool + thumb_func_end atkDF_setmagiccoat + + thumb_func_start atkE0_setstealstatchange +atkE0_setstealstatchange: @ 8055920 + push {lr} + ldr r2, =0x0202437c + ldr r3, =0x0202420b + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0] + ldr r0, =0x02024082 + ldrb r1, [r0] + ldr r0, =0x0202406c + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bne _08055978 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _0805598E + .pool +_08055978: + ldr r0, =0x0202433c + ldrb r1, [r3] + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1] + orrs r0, r2 + strb r0, [r1] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_0805598E: + pop {r0} + bx r0 + .pool + thumb_func_end atkE0_setstealstatchange + + thumb_func_start atkE1_802CBE4 +atkE1_802CBE4: @ 805599C + push {r4-r6,lr} + ldr r4, =0x02024474 + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0xD8 + ldrb r0, [r0] + strb r0, [r4, 0x17] + ldrb r0, [r4, 0x17] + bl battle_side_get_owner + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, =0x02022f58 + movs r0, 0xFD + strb r0, [r2] + movs r0, 0x9 + strb r0, [r2, 0x1] + ldr r3, =0x02024084 + ldrb r1, [r4, 0x17] + movs r0, 0x58 + muls r0, r1 + adds r0, r3 + adds r0, 0x20 + ldrb r0, [r0] + strb r0, [r2, 0x2] + movs r0, 0xFF + strb r0, [r2, 0x3] + ldr r2, =0x0202420c + ldr r1, =0x0202406c + ldrb r0, [r2] + ldrb r1, [r1] + cmp r0, r1 + bcs _08055A22 + adds r4, r2, 0 + ldr r6, =gUnknown_0832A328 +_080559E2: + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, r5 + beq _08055A04 + ldr r0, =0x02024210 + ldrb r1, [r0] + ldrb r0, [r4] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + ands r1, r0 + ldr r2, =0x0202406c + cmp r1, 0 + beq _08055A18 +_08055A04: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + adds r2, r1, 0 + ldrb r1, [r2] + cmp r0, r1 + bcc _080559E2 +_08055A18: + ldr r0, =0x0202420c + ldrb r0, [r0] + ldrb r2, [r2] + cmp r0, r2 + bcc _08055A64 +_08055A22: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08055A6C + .pool +_08055A64: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_08055A6C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atkE1_802CBE4 + + thumb_func_start atkE2_cmde2 +atkE2_cmde2: @ 8055A78 + push {r4-r6,lr} + sub sp, 0x4 + ldr r5, =0x02024214 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r4, =0x02024064 + strb r0, [r4] + ldr r3, =0x02024084 + ldrb r0, [r4] + movs r6, 0x58 + adds r1, r0, 0 + muls r1, r6 + adds r0, r1, r3 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x1E + bne _08055AD2 + adds r3, 0x4C + adds r1, r3 + movs r0, 0 + str r0, [r1] + ldr r2, =gUnknown_0832A328 + ldrb r1, [r4] + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, r1, r0 + adds r0, 0x58 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r2 + ldrb r2, [r0] + adds r0, r1, 0 + muls r0, r6 + adds r0, r3 + str r0, [sp] + movs r0, 0 + movs r1, 0x28 + movs r3, 0x4 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_08055AD2: + ldr r0, [r5] + adds r0, 0x2 + str r0, [r5] + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atkE2_cmde2 + + thumb_func_start atkE3_jumpiffainted +atkE3_jumpiffainted: @ 8055AF4 + push {r4,lr} + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r1, =0x02024064 + strb r0, [r1] + ldr r2, =0x02024084 + ldrb r1, [r1] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _08055B3C + ldr r2, [r4] + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08055B42 + .pool +_08055B3C: + ldr r0, [r4] + adds r0, 0x6 + str r0, [r4] +_08055B42: + pop {r4} + pop {r0} + bx r0 + thumb_func_end atkE3_jumpiffainted + + thumb_func_start sub_8055B48 +sub_8055B48: @ 8055B48 + push {lr} + ldr r0, =0x02022ff0 + ldrb r0, [r0] + cmp r0, 0x7 + bhi _08055BE4 + lsls r0, 2 + ldr r1, =_08055B64 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08055B64: + .4byte _08055B84 + .4byte _08055B90 + .4byte _08055B9C + .4byte _08055BA8 + .4byte _08055BB4 + .4byte _08055BC0 + .4byte _08055BCC + .4byte _08055BD8 +_08055B84: + ldr r1, =0x02024332 + movs r0, 0x2 + b _08055BE8 + .pool +_08055B90: + ldr r1, =0x02024332 + movs r0, 0x1 + b _08055BE8 + .pool +_08055B9C: + ldr r1, =0x02024332 + movs r0, 0x1B + b _08055BE8 + .pool +_08055BA8: + ldr r1, =0x02024332 + movs r0, 0x17 + b _08055BE8 + .pool +_08055BB4: + ldr r1, =0x02024332 + movs r0, 0x16 + b _08055BE8 + .pool +_08055BC0: + ldr r1, =0x02024332 + movs r0, 0x18 + b _08055BE8 + .pool +_08055BCC: + ldr r1, =0x02024332 + movs r0, 0x7 + b _08055BE8 + .pool +_08055BD8: + ldr r1, =0x02024332 + movs r0, 0x8 + b _08055BE8 + .pool +_08055BE4: + ldr r1, =0x02024332 + movs r0, 0x5 +_08055BE8: + strb r0, [r1, 0x3] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8055B48 + + thumb_func_start atkE5_pickupitemcalculation +atkE5_pickupitemcalculation: @ 8055C00 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + bl InBattlePike + lsls r0, 24 + cmp r0, 0 + beq _08055C18 + b _08055DD8 +_08055C18: + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _08055CC4 + movs r6, 0 + mov r7, sp + ldr r0, =gBaseStats + mov r8, r0 +_08055C2A: + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr + strh r0, [r7] + adds r0, r4, 0 + movs r1, 0x2E + bl pokemon_getattr + cmp r0, 0 + beq _08055C6C + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + add r0, r8 + ldrb r0, [r0, 0x17] + b _08055C76 + .pool +_08055C6C: + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + add r0, r8 + ldrb r0, [r0, 0x16] +_08055C76: + cmp r0, 0x35 + bne _08055CB6 + cmp r5, 0 + beq _08055CB6 + movs r0, 0xCE + lsls r0, 1 + cmp r5, r0 + beq _08055CB6 + ldrh r0, [r7] + cmp r0, 0 + bne _08055CB6 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + bne _08055CB6 + bl CalculateBattlePyramidPickupItemId + strh r0, [r7] + movs r0, 0x64 + muls r0, r6 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr +_08055CB6: + adds r6, 0x1 + cmp r6, 0x5 + ble _08055C2A + b _08055DD8 + .pool +_08055CC4: + movs r6, 0 + movs r1, 0x64 + mov r8, r1 + ldr r7, =0x020244ec + mov r10, sp +_08055CCE: + mov r4, r8 + muls r4, r6 + adds r4, r7 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr + mov r1, r10 + strh r0, [r1] + adds r0, r4, 0 + movs r1, 0x2E + bl pokemon_getattr + cmp r0, 0 + beq _08055D30 + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + ldr r1, =gBaseStats + adds r0, r1 + ldrb r0, [r0, 0x17] + b _08055D3C + .pool +_08055D10: + mov r0, r8 + muls r0, r6 + adds r0, r7 + adds r2, r1, 0 + adds r2, 0x63 + subs r2, r4 + lsls r2, 1 + ldr r1, =gRarePickupItems + adds r2, r1 + movs r1, 0xC + bl pokemon_setattr + b _08055DD0 + .pool +_08055D30: + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + ldr r1, =gBaseStats + adds r0, r1 + ldrb r0, [r0, 0x16] +_08055D3C: + adds r1, r6, 0x1 + mov r9, r1 + cmp r0, 0x35 + bne _08055DD0 + cmp r5, 0 + beq _08055DD0 + movs r0, 0xCE + lsls r0, 1 + cmp r5, r0 + beq _08055DD0 + mov r1, r10 + ldrh r0, [r1] + cmp r0, 0 + bne _08055DD0 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + bne _08055DD0 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r4, r0, 16 + mov r0, r8 + muls r0, r6 + adds r0, r7 + movs r1, 0x38 + bl pokemon_getattr + subs r0, 0x1 + movs r1, 0xA + bl __udivsi3 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x9 + bls _08055D9C + movs r1, 0x9 +_08055D9C: + movs r2, 0 + b _08055DAE + .pool +_08055DA4: + adds r0, r4, 0 + subs r0, 0x62 + cmp r0, 0x1 + bls _08055D10 + adds r2, 0x1 +_08055DAE: + cmp r2, 0x8 + bgt _08055DD0 + ldr r0, =gPickupProbabilities + adds r0, r2, r0 + ldrb r0, [r0] + cmp r0, r4 + ble _08055DA4 + mov r0, r8 + muls r0, r6 + adds r0, r7 + adds r2, r1, r2 + lsls r2, 1 + ldr r1, =gPickupItems + adds r2, r1 + movs r1, 0xC + bl pokemon_setattr +_08055DD0: + mov r6, r9 + cmp r6, 0x5 + bgt _08055DD8 + b _08055CCE +_08055DD8: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkE5_pickupitemcalculation + + thumb_func_start atkE6_castform_transform +atkE6_castform_transform: @ 8055DFC + push {r4,lr} + ldr r4, =0x02024064 + ldr r0, =0x02024474 + ldrb r0, [r0, 0x17] + strb r0, [r4] + ldr r1, =0x02024084 + ldrb r2, [r4] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + ldr r3, =0x0202449c + cmp r0, 0 + beq _08055E2C + ldr r0, [r3] + adds r0, 0x7F + ldrb r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0] +_08055E2C: + ldr r0, [r3] + adds r0, 0x7F + ldrb r2, [r0] + movs r0, 0 + movs r1, 0 + bl dp01_build_cmdbuf_x34_a_bb_aka_battle_anim + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atkE6_castform_transform + + thumb_func_start atkE7_castform_switch +atkE7_castform_switch: @ 8055E64 + push {r4,lr} + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r0, =0x02024474 + ldrb r0, [r0, 0x17] + bl castform_switch + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _08055E8E + ldr r0, =gUnknown_082DB4A9 + bl b_push_move_exec + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x7F + subs r1, r4, 0x1 + strb r1, [r0] +_08055E8E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atkE7_castform_switch + + thumb_func_start atkE8_settypebasedhalvers +atkE8_settypebasedhalvers: @ 8055EA4 + push {r4,lr} + movs r4, 0 + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0xC9 + bne _08055EF4 + ldr r1, =0x020242ac + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 2 + adds r2, r0, r1 + ldr r1, [r2] + movs r3, 0x80 + lsls r3, 9 + adds r0, r1, 0 + ands r0, r3 + cmp r0, 0 + bne _08055F18 + orrs r1, r3 + str r1, [r2] + ldr r0, =0x02024332 + strb r4, [r0, 0x5] + b _08055F1C + .pool +_08055EF4: + ldr r1, =0x020242ac + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 2 + adds r2, r0, r1 + ldr r1, [r2] + movs r3, 0x80 + lsls r3, 10 + adds r0, r1, 0 + ands r0, r3 + cmp r0, 0 + bne _08055F18 + orrs r1, r3 + str r1, [r2] + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] + movs r4, 0x1 +_08055F18: + cmp r4, 0 + beq _08055F38 +_08055F1C: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _08055F52 + .pool +_08055F38: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_08055F52: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atkE8_settypebasedhalvers + + thumb_func_start atkE9_seteffectbyweather +atkE9_seteffectbyweather: @ 8055F5C + push {lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0xD + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08055FFC + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0x4D + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + bne _08055FFC + ldr r2, =0x020243cc + ldrb r0, [r2] + cmp r0, 0 + beq _08055F9A + ldr r1, =0x02024474 + movs r0, 0x2 + strb r0, [r1, 0xE] +_08055F9A: + ldrh r1, [r2] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + beq _08055FB8 + ldr r0, =0x0202449c + ldr r1, [r0] + movs r0, 0x8B + b _08055FFA + .pool +_08055FB8: + movs r0, 0x18 + ands r0, r1 + cmp r0, 0 + beq _08055FCC + ldr r0, =0x0202449c + ldr r1, [r0] + movs r0, 0x85 + b _08055FFA + .pool +_08055FCC: + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _08055FE0 + ldr r0, =0x0202449c + ldr r1, [r0] + movs r0, 0x8A + b _08055FFA + .pool +_08055FE0: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08055FF4 + ldr r0, =0x0202449c + ldr r1, [r0] + movs r0, 0x8F + b _08055FFA + .pool +_08055FF4: + ldr r0, =0x0202449c + ldr r1, [r0] + movs r0, 0x80 +_08055FFA: + strb r0, [r1, 0x13] +_08055FFC: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end atkE9_seteffectbyweather + + thumb_func_start atkEA_recycleitem +atkEA_recycleitem: @ 8056014 + push {r4-r7,lr} + sub sp, 0x4 + ldr r7, =0x02024064 + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r7] + ldr r1, =0x0202449c + ldrb r2, [r7] + lsls r0, r2, 1 + adds r0, 0xB8 + ldr r1, [r1] + adds r6, r1, r0 + ldrh r5, [r6] + cmp r5, 0 + beq _08056094 + ldr r4, =0x02024084 + movs r3, 0x58 + adds r0, r2, 0 + muls r0, r3 + adds r0, r4 + ldrh r0, [r0, 0x2E] + cmp r0, 0 + bne _08056094 + ldr r1, =0x02024208 + strh r5, [r1] + strh r0, [r6] + ldrb r0, [r7] + muls r0, r3 + adds r0, r4 + ldrh r1, [r1] + strh r1, [r0, 0x2E] + ldrb r0, [r7] + muls r0, r3 + adds r1, r4, 0 + adds r1, 0x2E + adds r0, r1 + str r0, [sp] + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + movs r3, 0x2 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r7] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _080560AE + .pool +_08056094: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_080560AE: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkEA_recycleitem + + thumb_func_start atkEB_settypetoterrain +atkEB_settypetoterrain: @ 80560BC + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =0x02024084 + mov r8, r0 + ldr r7, =0x0202420b + ldrb r0, [r7] + movs r6, 0x58 + muls r0, r6 + mov r1, r8 + adds r3, r0, r1 + movs r0, 0x21 + adds r0, r3 + mov r12, r0 + ldr r5, =gUnknown_0831C483 + ldr r4, =0x02022ff0 + ldrb r0, [r4] + adds r0, r5 + ldrb r2, [r0] + mov r1, r12 + ldrb r0, [r1] + adds r1, r2, 0 + cmp r0, r1 + beq _08056144 + adds r0, r3, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, r1 + beq _08056144 + mov r0, r12 + strb r2, [r0] + ldrb r0, [r7] + adds r1, r0, 0 + muls r1, r6 + add r1, r8 + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + adds r1, 0x22 + strb r0, [r1] + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x3 + strb r0, [r1, 0x1] + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + strb r0, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x3] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _0805615E + .pool +_08056144: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_0805615E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkEB_settypetoterrain + + thumb_func_start atkEC_802D2A0 +atkEC_802D2A0: @ 805616C + push {r4-r6,lr} + ldr r5, =0x0202420b + ldrb r0, [r5] + bl battle_get_per_side_status + movs r1, 0x2 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + ldr r4, =0x02024064 + strb r0, [r4] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r6, 0x1 + ands r0, r6 + cmp r0, 0 + beq _0805620C + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + ldrb r3, [r4] + lsls r0, r3, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0805620C + ldr r0, =0x0202421c + adds r0, r3, r0 + ldrb r0, [r0] + cmp r0, 0 + bne _0805620C + ldr r1, =0x02024274 + lsls r0, r3, 1 + adds r0, r1 + ldrh r2, [r0] + cmp r2, 0xE4 + bne _0805620C + ldr r0, =0x0202407a + adds r0, r3, r0 + movs r1, 0xB + strb r1, [r0] + ldr r0, =0x020241ea + strh r2, [r0] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + ldr r0, =0x02024474 + strb r6, [r0, 0x18] + ldrb r1, [r5] + adds r0, 0x20 + strb r1, [r0] + ldrb r0, [r4] + strb r0, [r5] + b _08056226 + .pool +_0805620C: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_08056226: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atkEC_802D2A0 + + thumb_func_start atkED_802D364 +atkED_802D364: @ 8056230 + push {r4,lr} + ldr r1, =0x0202420e + ldr r3, =0x0202420b + ldrb r0, [r3] + strb r0, [r1] + ldr r2, =0x0202420c + lsls r0, 24 + lsrs r0, 24 + adds r4, r1, 0 + ldrb r1, [r2] + cmp r0, r1 + bne _08056264 + ldr r1, =0x02024474 + ldrb r0, [r1, 0x17] + strb r0, [r2] + strb r0, [r3] + b _0805626A + .pool +_08056264: + ldr r1, =0x02024474 + ldrb r0, [r1, 0x17] + strb r0, [r2] +_0805626A: + ldrb r0, [r4] + strb r0, [r1, 0x17] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atkED_802D364 + + thumb_func_start atkEE_removereflectlightscreen +atkEE_removereflectlightscreen: @ 8056284 + push {r4,lr} + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_side_get_owner + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02024294 + lsls r3, r0, 1 + adds r0, r3, r0 + lsls r0, 2 + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0 + bne _080562AC + ldrb r1, [r4, 0x2] + cmp r1, 0 + beq _080562E4 +_080562AC: + ldr r2, =0x0202428e + adds r2, r3, r2 + ldrh r1, [r2] + ldr r0, =0x0000fffe + ands r0, r1 + movs r3, 0 + ldr r1, =0x0000fffd + ands r0, r1 + strh r0, [r2] + strb r3, [r4] + strb r3, [r4, 0x2] + ldr r1, =0x02024474 + movs r0, 0x1 + strb r0, [r1, 0x18] + strb r0, [r1, 0x19] + b _080562EA + .pool +_080562E4: + ldr r0, =0x02024474 + strb r1, [r0, 0x18] + strb r1, [r0, 0x19] +_080562EA: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atkEE_removereflectlightscreen + + thumb_func_start sub_8056300 +sub_8056300: @ 8056300 + push {r4-r6,lr} + movs r4, 0 + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + beq _0805630E + b _08056696 +_0805630E: + ldr r5, =0x02024064 + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r5] + ldr r6, =0x0202420c + movs r1, 0x1 + eors r0, r1 + strb r0, [r6] + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0805635C + movs r0, 0 + movs r1, 0x5 + bl dp01_build_cmdbuf_x0D_a + ldrb r0, [r5] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DBE02 + b _08056694 + .pool +_0805635C: + movs r0, 0x80 + lsls r0, 2 + ands r1, r0 + cmp r1, 0 + beq _08056384 + movs r0, 0 + movs r1, 0x4 + bl dp01_build_cmdbuf_x0D_a + ldrb r0, [r5] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DBDCA + b _08056694 + .pool +_08056384: + ldr r0, =0x02024208 + ldrh r0, [r0] + cmp r0, 0x5 + bne _080563B0 + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x7C + ldrb r0, [r0] + lsls r1, r0, 2 + adds r1, r0 + lsls r0, r1, 8 + subs r0, r1 + movs r1, 0x64 + bl __divsi3 + lsls r0, 24 + lsrs r5, r0, 24 + b _080563C8 + .pool +_080563B0: + ldr r3, =gBaseStats + ldr r2, =0x02024084 + ldrb r1, [r6] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r5, [r0, 0x8] +_080563C8: + ldr r2, =0x02024208 + ldrh r0, [r2] + cmp r0, 0x5 + bhi _080563D2 + b _080564C8 +_080563D2: + subs r0, 0x6 + cmp r0, 0x6 + bls _080563DA + b _080564D2 +_080563DA: + lsls r0, 2 + ldr r1, =_080563F4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080563F4: + .4byte _08056410 + .4byte _08056440 + .4byte _08056452 + .4byte _08056480 + .4byte _080564B0 + .4byte _08056472 + .4byte _08056472 +_08056410: + ldr r2, =0x02024084 + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r1, r0, 0 + adds r1, 0x21 + ldrb r1, [r1] + cmp r1, 0xB + beq _080564A4 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0xB + beq _080564A4 + cmp r1, 0x6 + beq _080564A4 + cmp r0, 0x6 + beq _080564A4 + b _08056472 + .pool +_08056440: + bl sav1_map_get_light_level + lsls r0, 24 + lsrs r0, 24 + movs r4, 0xA + cmp r0, 0x5 + bne _080564D2 + movs r4, 0x23 + b _080564D2 +_08056452: + ldr r2, =0x02024084 + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x2A + ldrb r1, [r0] + cmp r1, 0x27 + bhi _08056472 + movs r0, 0x28 + subs r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x9 + bhi _080564D2 +_08056472: + movs r4, 0xA + b _080564D2 + .pool +_08056480: + ldr r2, =0x02024084 + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0] + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + movs r4, 0xA + cmp r0, 0 + beq _080564D2 +_080564A4: + movs r4, 0x1E + b _080564D2 + .pool +_080564B0: + ldr r0, =0x03005d10 + ldrb r0, [r0, 0x13] + adds r0, 0xA + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x28 + bls _080564D2 + movs r4, 0x28 + b _080564D2 + .pool +_080564C8: + ldr r1, =gUnknown_0831C48D + ldrh r0, [r2] + subs r0, 0x2 + adds r0, r1 + ldrb r4, [r0] +_080564D2: + adds r0, r5, 0 + muls r0, r4 + movs r1, 0xA + bl __divsi3 + ldr r5, =0x02024084 + ldr r1, =0x0202420c + ldrb r2, [r1] + movs r1, 0x58 + adds r4, r2, 0 + muls r4, r1 + adds r3, r4, r5 + ldrh r2, [r3, 0x2C] + lsls r1, r2, 1 + adds r1, r2 + ldrh r2, [r3, 0x28] + lsls r2, 1 + subs r2, r1, r2 + muls r0, r2 + bl __divsi3 + adds r6, r0, 0 + adds r5, 0x4C + adds r4, r5 + ldr r4, [r4] + movs r0, 0x27 + ands r0, r4 + cmp r0, 0 + beq _0805650E + lsls r6, 1 +_0805650E: + movs r0, 0xD8 + ands r4, r0 + cmp r4, 0 + beq _08056522 + lsls r0, r6, 4 + subs r0, r6 + movs r1, 0xA + bl __udivsi3 + adds r6, r0, 0 +_08056522: + ldr r1, =0x02024208 + ldrh r0, [r1] + cmp r0, 0x5 + beq _08056564 + cmp r0, 0x1 + bne _08056550 + ldr r0, =0x03005d10 + ldrb r1, [r0, 0x5] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r0, 0x5] + b _08056564 + .pool +_08056550: + ldr r0, =0x03005d10 + ldrh r1, [r1] + adds r0, r1 + adds r1, r0, 0 + adds r1, 0x34 + ldrb r0, [r1] + cmp r0, 0xFE + bhi _08056564 + adds r0, 0x1 + strb r0, [r1] +_08056564: + cmp r6, 0xFE + bls _080565C8 + movs r0, 0 + movs r1, 0x4 + bl dp01_build_cmdbuf_x0D_a + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DBD84 + str r0, [r1] + ldr r1, =0x0202406e + ldr r0, =0x0202420c + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + ldr r2, =0x02024208 + movs r1, 0x26 + bl pokemon_setattr + bl calc_player_party_count + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6 + beq _08056656 + b _08056680 + .pool +_080565C8: + movs r0, 0xFF + lsls r0, 16 + adds r1, r6, 0 + bl __udivsi3 + bl Sqrt + lsls r0, 16 + lsrs r0, 16 + bl Sqrt + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =0x000ffff0 + adds r1, r6, 0 + bl __udivsi3 + adds r6, r0, 0 + movs r4, 0 + b _080565FA + .pool +_080565F4: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_080565FA: + cmp r4, 0x3 + bhi _0805660A + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + cmp r0, r6 + bcc _080565F4 +_0805660A: + ldr r5, =0x02024208 + ldrh r0, [r5] + cmp r0, 0x1 + bne _08056614 + movs r4, 0x4 +_08056614: + movs r0, 0 + adds r1, r4, 0 + bl dp01_build_cmdbuf_x0D_a + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + cmp r4, 0x4 + bne _0805668C + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DBD84 + str r0, [r1] + ldr r1, =0x0202406e + ldr r0, =0x0202420c + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x26 + adds r2, r5, 0 + bl pokemon_setattr + bl calc_player_party_count + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6 + bne _08056680 +_08056656: + ldr r1, =0x02024332 + movs r0, 0 + strb r0, [r1, 0x5] + b _08056696 + .pool +_08056680: + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] + b _08056696 + .pool +_0805668C: + ldr r0, =0x02024332 + strb r4, [r0, 0x5] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DBDD4 +_08056694: + str r0, [r1] +_08056696: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8056300 + + thumb_func_start atkF0_catch_pokemon +atkF0_catch_pokemon: @ 80566A8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =0x0202406e + mov r9, r0 + ldr r5, =0x0202420b + ldrb r0, [r5] + movs r6, 0x1 + eors r0, r6 + lsls r0, 1 + add r0, r9 + ldrh r0, [r0] + movs r7, 0x64 + muls r0, r7 + ldr r1, =0x02024744 + mov r8, r1 + add r0, r8 + bl pokemon_catch + lsls r0, 24 + cmp r0, 0 + beq _08056792 + bl sub_813B21C + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _08056734 + ldr r0, =0x02024332 + strb r1, [r0, 0x5] + ldr r4, =0x02021cc4 + ldr r0, =0x00004036 + bl VarGet + lsls r0, 24 + lsrs r0, 24 + bl sav3_get_box_name + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + ldrb r0, [r5] + eors r0, r6 + lsls r0, 1 + add r0, r9 + ldrh r0, [r0] + muls r0, r7 + add r0, r8 + ldr r2, =0x02021dc4 + movs r1, 0x2 + bl pokemon_getattr + b _0805677E + .pool +_08056734: + ldr r4, =0x02021cc4 + ldr r0, =0x00004036 + bl VarGet + lsls r0, 24 + lsrs r0, 24 + bl sav3_get_box_name + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + ldrb r0, [r5] + eors r0, r6 + lsls r0, 1 + add r0, r9 + ldrh r0, [r0] + muls r0, r7 + add r0, r8 + ldr r2, =0x02021dc4 + movs r1, 0x2 + bl pokemon_getattr + ldr r4, =0x02021ec4 + bl get_unknown_box_id + lsls r0, 24 + lsrs r0, 24 + bl sav3_get_box_name + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + ldr r1, =0x02024332 + movs r0, 0x2 + strb r0, [r1, 0x5] +_0805677E: + ldr r0, =0x000008ab + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _08056792 + ldr r1, =0x02024332 + ldrb r0, [r1, 0x5] + adds r0, 0x1 + strb r0, [r1, 0x5] +_08056792: + ldr r0, =0x0202406e + mov r10, r0 + ldr r1, =0x0202420b + mov r9, r1 + ldrb r0, [r1] + movs r4, 0x1 + eors r0, r4 + lsls r0, 1 + add r0, r10 + ldrh r0, [r0] + movs r1, 0x64 + mov r8, r1 + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + ldr r6, =0x02024744 + adds r0, r6 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + ldr r5, =0x03005d10 + strh r0, [r5, 0x28] + mov r1, r9 + ldrb r0, [r1] + eors r0, r4 + lsls r0, 1 + add r0, r10 + ldrh r0, [r0] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r6 + adds r2, r5, 0 + adds r2, 0x2A + movs r1, 0x2 + bl pokemon_getattr + mov r1, r9 + ldrb r0, [r1] + eors r4, r0 + lsls r4, 1 + add r4, r10 + ldrh r0, [r4] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r6 + movs r1, 0x26 + movs r2, 0 + bl pokemon_getattr + movs r1, 0xF + ands r0, r1 + lsls r0, 2 + ldrb r2, [r5, 0x5] + movs r1, 0x3D + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r5, 0x5] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkF0_catch_pokemon + + thumb_func_start atkF1_802D95C +atkF1_802D95C: @ 8056850 + push {r4,r5,lr} + ldr r4, =0x02024744 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + adds r0, r5, 0 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _080568A8 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _080568C2 + .pool +_080568A8: + adds r0, r5, 0 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + adds r2, r4, 0 + bl SetPokedexFlag + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_080568C2: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atkF1_802D95C + + thumb_func_start sub_80568CC +sub_80568CC: @ 80568CC + push {r4,lr} + sub sp, 0x4 + ldr r0, =0x02024744 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x02024332 + ldrb r0, [r0] + cmp r0, 0x5 + bls _080568E8 + b _08056A2C +_080568E8: + lsls r0, 2 + ldr r1, =_08056900 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08056900: + .4byte _08056918 + .4byte _0805692A + .4byte _08056978 + .4byte _080569C8 + .4byte _080569E0 + .4byte _08056A18 +_08056918: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + b _08056A06 +_0805692A: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08056938 + b _08056A2C +_08056938: + bl FreeAllWindowBuffers + adds r0, r4, 0 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + ldr r3, =0x02024084 + ldr r1, =0x0202420c + ldrb r2, [r1] + movs r1, 0x58 + muls r2, r1 + adds r1, r3, 0 + adds r1, 0x54 + adds r1, r2, r1 + ldr r1, [r1] + adds r3, 0x48 + adds r2, r3 + ldr r2, [r2] + bl sub_80BFDF4 + ldr r1, =0x02024332 + strb r0, [r1, 0x1] + b _08056A08 + .pool +_08056978: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08056A2C + ldr r0, =0x030022c0 + ldr r1, [r0, 0x4] + ldr r0, =sub_8038420 + cmp r1, r0 + bne _08056A2C + ldr r2, =0x03005e00 + ldr r4, =0x02024332 + ldrb r1, [r4, 0x1] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _08056A2C + ldr r0, =vblank_cb_08078BB4 + bl SetVBlankCallback + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _08056A2C + .pool +_080569C8: + bl c2_berry_program_update_menu + bl sub_8035AA4 + ldr r1, =0x02022e20 + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + b _08056A06 + .pool +_080569E0: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _08056A2C + ldr r0, =0x0000ffff + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + movs r0, 0 + bl ShowBg + movs r0, 0x3 + bl ShowBg +_08056A06: + ldr r1, =0x02024332 +_08056A08: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08056A2C + .pool +_08056A18: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08056A2C + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_08056A2C: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80568CC + + thumb_func_start sub_8056A3C +sub_8056A3C: @ 8056A3C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + ldr r4, [sp, 0x40] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x10] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x1C] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x14] + lsls r4, 24 + lsrs r4, 24 + mov r10, r4 + movs r1, 0 + add r0, sp, 0xC + strh r1, [r0] + ldr r6, [sp, 0x10] + cmp r6, r3 + ble _08056A76 + b _08056B62 +_08056A76: + mov r4, r8 + adds r0, r6, 0x1 + str r0, [sp, 0x18] + ldr r2, [sp, 0x1C] + cmp r4, r2 + bgt _08056B58 + add r5, sp, 0xC + lsls r7, r6, 24 + mov r9, r7 +_08056A88: + ldr r0, [sp, 0x10] + cmp r6, r0 + bne _08056AB4 + cmp r4, r8 + bne _08056A9C + ldr r0, =0x00001022 + b _08056AFE + .pool +_08056A9C: + ldr r2, [sp, 0x1C] + cmp r4, r2 + bne _08056AAC + ldr r0, =0x00001024 + b _08056AFE + .pool +_08056AAC: + ldr r0, =0x00001023 + b _08056AFE + .pool +_08056AB4: + ldr r7, [sp, 0x14] + cmp r6, r7 + bne _08056AE0 + cmp r4, r8 + bne _08056AC8 + ldr r0, =0x00001028 + b _08056AFE + .pool +_08056AC8: + ldr r0, [sp, 0x1C] + cmp r4, r0 + bne _08056AD8 + ldr r0, =0x0000102a + b _08056AFE + .pool +_08056AD8: + ldr r0, =0x00001029 + b _08056AFE + .pool +_08056AE0: + cmp r4, r8 + bne _08056AEC + ldr r0, =0x00001025 + b _08056AFE + .pool +_08056AEC: + ldr r2, [sp, 0x1C] + cmp r4, r2 + bne _08056AFC + ldr r0, =0x00001027 + b _08056AFE + .pool +_08056AFC: + ldr r0, =0x00001026 +_08056AFE: + strh r0, [r5] + movs r1, 0x1 + mov r0, r10 + ands r0, r1 + cmp r0, 0 + beq _08056B0E + movs r0, 0 + strh r0, [r5] +_08056B0E: + movs r0, 0x80 + mov r7, r10 + ands r0, r7 + cmp r0, 0 + beq _08056B38 + lsls r2, r4, 24 + lsrs r2, 24 + str r1, [sp] + str r1, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + add r1, sp, 0xC + mov r7, r9 + lsrs r3, r7, 24 + bl CopyToBgTilemapBufferRect_ChangePalette + b _08056B50 + .pool +_08056B38: + lsls r2, r4, 24 + lsrs r2, 24 + str r1, [sp] + str r1, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + add r1, sp, 0xC + mov r7, r9 + lsrs r3, r7, 24 + bl CopyToBgTilemapBufferRect_ChangePalette +_08056B50: + adds r4, 0x1 + ldr r0, [sp, 0x1C] + cmp r4, r0 + ble _08056A88 +_08056B58: + ldr r6, [sp, 0x18] + ldr r2, [sp, 0x14] + cmp r6, r2 + bgt _08056B62 + b _08056A76 +_08056B62: + 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_8056A3C + + thumb_func_start sub_8056B74 +sub_8056B74: @ 8056B74 + push {lr} + sub sp, 0x10 + adds r3, r0, 0 + add r0, sp, 0xC + movs r2, 0x1 + strh r2, [r0] + movs r1, 0x2 + strh r1, [r0, 0x2] + lsls r3, 25 + movs r0, 0x90 + lsls r0, 20 + adds r3, r0 + lsrs r3, 24 + str r2, [sp] + str r1, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + add r1, sp, 0xC + movs r2, 0x19 + bl CopyToBgTilemapBufferRect_ChangePalette + movs r0, 0 + bl CopyBgTilemapBufferToVram + add sp, 0x10 + pop {r0} + bx r0 + thumb_func_end sub_8056B74 + + thumb_func_start sub_8056BAC +sub_8056BAC: @ 8056BAC + push {lr} + sub sp, 0x10 + adds r3, r0, 0 + add r0, sp, 0xC + ldr r1, =0x00001016 + strh r1, [r0] + strh r1, [r0, 0x2] + lsls r3, 25 + movs r0, 0x90 + lsls r0, 20 + adds r3, r0 + lsrs r3, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + add r1, sp, 0xC + movs r2, 0x19 + bl CopyToBgTilemapBufferRect_ChangePalette + movs r0, 0 + bl CopyBgTilemapBufferToVram + add sp, 0x10 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8056BAC + + thumb_func_start atkF3_receive_new_pokemon_maybe +atkF3_receive_new_pokemon_maybe: @ 8056BEC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + ldr r0, =0x02024332 + ldrb r1, [r0] + adds r4, r0, 0 + cmp r1, 0x4 + bls _08056C04 + b _08056E62 +_08056C04: + lsls r0, r1, 2 + ldr r1, =_08056C18 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08056C18: + .4byte _08056C2C + .4byte _08056C60 + .4byte _08056CFC + .4byte _08056DD4 + .4byte _08056E2C +_08056C2C: + movs r4, 0 + str r4, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + ldr r0, =gUnknown_085CCABB + movs r1, 0xC + bl battle_show_message_maybe + ldr r1, =0x02024332 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + strb r4, [r1, 0x1] + movs r0, 0 + bl sub_8056B74 + b _08056E62 + .pool +_08056C60: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08056C86 + ldrb r0, [r4, 0x1] + cmp r0, 0 + beq _08056C86 + movs r0, 0x5 + bl audio_play + ldrb r0, [r4, 0x1] + bl sub_8056BAC + movs r0, 0 + strb r0, [r4, 0x1] + bl sub_8056B74 +_08056C86: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08056CAE + ldr r4, =0x02024332 + ldrb r0, [r4, 0x1] + cmp r0, 0 + bne _08056CAE + movs r0, 0x5 + bl audio_play + ldrb r0, [r4, 0x1] + bl sub_8056BAC + movs r0, 0x1 + strb r0, [r4, 0x1] + bl sub_8056B74 +_08056CAE: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08056CE0 + movs r0, 0x5 + bl audio_play + ldr r1, =0x02024332 + ldrb r0, [r1, 0x1] + cmp r0, 0 + bne _08056CF2 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r0, 0x3 + bl sub_80A2390 + b _08056E62 + .pool +_08056CE0: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08056CEA + b _08056E62 +_08056CEA: + movs r0, 0x5 + bl audio_play + ldr r1, =0x02024332 +_08056CF2: + movs r0, 0x4 + strb r0, [r1] + b _08056E62 + .pool +_08056CFC: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08056D0A + b _08056E62 +_08056D0A: + ldr r7, =0x0202406e + ldr r0, =0x0202420b + mov r10, r0 + ldrb r0, [r0] + movs r4, 0x1 + eors r0, r4 + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + movs r1, 0x64 + mov r9, r1 + mov r2, r9 + muls r2, r0 + adds r0, r2, 0 + ldr r1, =0x02024744 + mov r8, r1 + add r0, r8 + ldr r1, =0x0202449c + ldr r2, [r1] + adds r2, 0x6D + movs r1, 0x2 + bl pokemon_getattr + bl FreeAllWindowBuffers + mov r2, r10 + ldrb r0, [r2] + eors r0, r4 + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + mov r1, r9 + muls r1, r0 + adds r0, r1, 0 + add r0, r8 + movs r1, 0xB + bl pokemon_getattr + adds r6, r0, 0 + lsls r6, 16 + lsrs r6, 16 + mov r2, r10 + ldrb r0, [r2] + eors r0, r4 + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + mov r1, r9 + muls r1, r0 + adds r0, r1, 0 + add r0, r8 + bl pokemon_get_gender + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + mov r2, r10 + ldrb r0, [r2] + eors r4, r0 + lsls r4, 1 + adds r4, r7 + ldrh r0, [r4] + mov r1, r9 + muls r1, r0 + adds r0, r1, 0 + add r0, r8 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + ldr r2, =0x0202449c + ldr r1, [r2] + adds r1, 0x6D + str r0, [sp] + ldr r0, =sub_8038420 + str r0, [sp, 0x4] + movs r0, 0x2 + adds r2, r6, 0 + adds r3, r5, 0 + bl do_choose_name_or_words_screen + ldr r1, =0x02024332 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08056E62 + .pool +_08056DD4: + ldr r0, =0x030022c0 + ldr r1, [r0, 0x4] + ldr r0, =sub_8038420 + cmp r1, r0 + bne _08056E62 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08056E62 + ldr r2, =0x0202406e + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x1 + eors r0, r1 + lsls r0, 1 + adds r0, r2 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + ldr r1, =0x0202449c + ldr r2, [r1] + adds r2, 0x6D + movs r1, 0x2 + bl pokemon_setattr + b _08056E48 + .pool +_08056E2C: + bl calc_player_party_count + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6 + bne _08056E48 + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _08056E62 + .pool +_08056E48: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_08056E62: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkF3_receive_new_pokemon_maybe + + thumb_func_start sub_8056E78 +sub_8056E78: @ 8056E78 + ldr r2, =0x02024084 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + muls r1, r0 + adds r1, r2 + ldr r0, =0x020241f0 + ldr r2, [r0] + ldrh r0, [r1, 0x28] + subs r0, r2 + strh r0, [r1, 0x28] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_8056E78 + + thumb_func_start atkF5_reset_attacker_bd_x4C +atkF5_reset_attacker_bd_x4C: @ 8056EA8 + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x4C + adds r0, r1 + movs r1, 0 + str r1, [r0] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end atkF5_reset_attacker_bd_x4C + + thumb_func_start sub_8056ED0 +sub_8056ED0: @ 8056ED0 + ldr r1, =0x02024083 + movs r0, 0xC + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_8056ED0 + + thumb_func_start sub_8056EDC +sub_8056EDC: @ 8056EDC + ldr r1, =0x02024083 + movs r0, 0xC + strb r0, [r1] + ldr r1, =0x02024082 + ldr r0, =0x0202406c + ldrb r0, [r0] + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_8056EDC + + thumb_func_start sub_8056EF8 +sub_8056EF8: @ 8056EF8 + push {r4,r5,lr} + ldr r5, =0x02024214 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl battle_get_side_with_given_state + ldr r4, =0x02024064 + strb r0, [r4] + movs r0, 0 + bl dp01_build_cmdbuf_x09_9_9_9 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r5] + adds r0, 0x2 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8056EF8 + + thumb_func_start sub_8056F28 +sub_8056F28: @ 8056F28 + push {r4-r6,lr} + ldr r5, =0x020244a8 + ldr r6, =0x02022fec + ldr r0, [r6] + movs r1, 0x80 + lsls r1, 19 + ands r0, r1 + cmp r0, 0 + beq _08056F3E + bl sub_81D55D0 +_08056F3E: + ldr r4, =0x0202449c + movs r0, 0xA9 + lsls r0, 2 + bl AllocZeroed + str r0, [r4] + movs r0, 0x20 + bl AllocZeroed + str r0, [r5] + movs r0, 0xA0 + bl AllocZeroed + ldr r1, [r5] + str r0, [r1] + movs r0, 0x10 + bl AllocZeroed + ldr r1, [r5] + str r0, [r1, 0x4] + movs r0, 0x24 + bl AllocZeroed + ldr r1, [r5] + str r0, [r1, 0x8] + movs r0, 0x24 + bl AllocZeroed + ldr r1, [r5] + str r0, [r1, 0xC] + movs r0, 0xC + bl AllocZeroed + ldr r1, [r5] + str r0, [r1, 0x10] + movs r0, 0x1C + bl AllocZeroed + ldr r1, [r5] + str r0, [r1, 0x14] + movs r0, 0x54 + bl AllocZeroed + ldr r1, [r5] + str r0, [r1, 0x18] + movs r0, 0x24 + bl AllocZeroed + ldr r1, [r5] + str r0, [r1, 0x1C] + ldr r4, =0x020244a0 + movs r5, 0x80 + lsls r5, 5 + adds r0, r5, 0 + bl AllocZeroed + str r0, [r4] + ldr r4, =0x020244a4 + adds r0, r5, 0 + bl AllocZeroed + str r0, [r4] + ldr r4, =0x0202305c + movs r0, 0x80 + lsls r0, 6 + bl AllocZeroed + str r0, [r4] + ldr r4, =0x02023060 + adds r0, r5, 0 + bl AllocZeroed + str r0, [r4] + ldr r0, [r6] + movs r1, 0x80 + lsls r1, 20 + ands r0, r1 + cmp r0, 0 + beq _08056FFA + ldr r0, =0x00004054 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + ldr r2, =0x03005d8c + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 5 + ldr r0, =0x00001a9c + adds r1, r0 + ldr r0, [r2] + adds r0, r1 + bl create_enemy_party +_08056FFA: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8056F28 + + thumb_func_start sub_8057028 +sub_8057028: @ 8057028 + push {r4-r6,lr} + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 19 + ands r0, r1 + cmp r0, 0 + beq _0805703C + bl sub_81D5694 +_0805703C: + ldr r6, =0x020244a8 + ldr r0, [r6] + cmp r0, 0 + beq _080570D0 + ldr r4, =0x0202449c + ldr r0, [r4] + bl Free + movs r5, 0 + str r5, [r4] + ldr r0, [r6] + ldr r0, [r0] + bl Free + ldr r0, [r6] + str r5, [r0] + ldr r0, [r0, 0x4] + bl Free + ldr r0, [r6] + str r5, [r0, 0x4] + ldr r0, [r0, 0x8] + bl Free + ldr r0, [r6] + str r5, [r0, 0x8] + ldr r0, [r0, 0xC] + bl Free + ldr r0, [r6] + str r5, [r0, 0xC] + ldr r0, [r0, 0x10] + bl Free + ldr r0, [r6] + str r5, [r0, 0x10] + ldr r0, [r0, 0x14] + bl Free + ldr r0, [r6] + str r5, [r0, 0x14] + ldr r0, [r0, 0x18] + bl Free + ldr r0, [r6] + str r5, [r0, 0x18] + ldr r0, [r0, 0x1C] + bl Free + ldr r0, [r6] + str r5, [r0, 0x1C] + bl Free + str r5, [r6] + ldr r4, =0x020244a0 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x020244a4 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0202305c + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x02023060 + ldr r0, [r4] + bl Free + str r5, [r4] +_080570D0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8057028 + + thumb_func_start sub_80570F4 +sub_80570F4: @ 80570F4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08057140 + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x3 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, =0x02024084 + movs r0, 0x58 + adds r1, r3, 0 + muls r1, r0 + adds r1, r2 + adds r1, 0x2A + muls r0, r4 + adds r0, r2 + adds r0, 0x2A + ldrb r1, [r1] + ldrb r0, [r0] + cmp r1, r0 + bls _0805714A + adds r4, r3, 0 + b _0805714A + .pool +_08057140: + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r4, r0, 24 +_0805714A: + ldr r2, =0x02024084 + movs r1, 0x58 + adds r0, r4, 0 + muls r0, r1 + adds r0, r2 + adds r3, r0, 0 + adds r3, 0x2A + adds r0, r5, 0 + muls r0, r1 + adds r0, r2 + adds r1, r0, 0 + adds r1, 0x2A + ldrb r0, [r3] + ldrb r2, [r1] + cmp r0, r2 + bls _080571B8 + ldrb r1, [r1] + subs r0, r1 + cmp r0, 0x1D + ble _08057198 + ldr r1, =0x0202406e + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x8 + bl happiness_algorithm + b _080571CE + .pool +_08057198: + ldr r1, =0x0202406e + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x6 + bl happiness_algorithm + b _080571CE + .pool +_080571B8: + ldr r1, =0x0202406e + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x6 + bl happiness_algorithm +_080571CE: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80570F4 + + thumb_func_start sub_80571DC +sub_80571DC: @ 80571DC + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08057248 + movs r2, 0 + ldr r6, =0x0202406e + lsls r3, r4, 1 + ldr r5, =0x0203cf00 + ldr r4, =0x0202449c +_080571FE: + adds r0, r2, r5 + ldr r1, [r4] + adds r1, r2, r1 + adds r1, 0x60 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x2 + ble _080571FE + adds r0, r3, r6 + ldrb r0, [r0] + bl pokemon_order_func + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r7, 0 + bl pokemon_order_func + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_81B8FB0 + movs r2, 0 + ldr r4, =0x0202449c + ldr r3, =0x0203cf00 +_08057236: + ldr r0, [r4] + adds r0, r2, r0 + adds r0, 0x60 + adds r1, r2, r3 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x2 + ble _08057236 +_08057248: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80571DC + + thumb_func_start sub_805725C +sub_805725C: @ 805725C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r0, 0 + mov r8, r0 + ldr r1, =0x02024332 + mov r10, r1 + b _08057284 + .pool +_0805727C: + mov r2, r8 + cmp r2, 0 + beq _08057284 + b _08057406 +_08057284: + mov r1, r10 + ldrb r0, [r1] + cmp r0, 0x1 + bne _0805728E + b _08057390 +_0805728E: + cmp r0, 0x1 + ble _08057294 + b _080573FC +_08057294: + cmp r0, 0 + beq _0805729A + b _080573FC +_0805729A: + ldr r6, =0x02024084 + movs r0, 0x58 + mov r5, r9 + muls r5, r0 + adds r0, r6, 0 + adds r0, 0x4C + adds r4, r5, r0 + ldr r0, [r4] + movs r7, 0x7 + ands r0, r7 + cmp r0, 0 + beq _08057372 + mov r0, r9 + bl sub_8050650 + lsls r0, 24 + cmp r0, 0 + beq _080572FC + ldr r0, [r4] + movs r1, 0x8 + negs r1, r1 + ands r0, r1 + str r0, [r4] + adds r2, r6, 0 + adds r2, 0x50 + adds r2, r5, r2 + ldr r0, [r2] + ldr r1, =0xf7ffffff + ands r0, r1 + str r0, [r2] + bl b_movescr_stack_push_cursor + movs r0, 0x1 + mov r2, r10 + strb r0, [r2, 0x5] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB220 + str r0, [r1] + movs r0, 0x2 + mov r8, r0 + b _08057372 + .pool +_080572FC: + adds r0, r5, r6 + adds r0, 0x20 + ldrb r0, [r0] + movs r2, 0x1 + cmp r0, 0x30 + bne _0805730A + movs r2, 0x2 +_0805730A: + ldr r1, [r4] + adds r0, r1, 0 + ands r0, r7 + cmp r0, r2 + bcs _0805731E + movs r0, 0x8 + negs r0, r0 + ands r1, r0 + str r1, [r4] + b _08057322 +_0805731E: + subs r0, r1, r2 + str r0, [r4] +_08057322: + ldr r2, =0x02024084 + movs r0, 0x58 + mov r1, r9 + muls r1, r0 + adds r0, r2, 0 + adds r0, 0x4C + adds r0, r1, r0 + ldr r4, [r0] + movs r0, 0x7 + ands r4, r0 + cmp r4, 0 + beq _08057354 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB213 + str r0, [r1] + movs r1, 0x2 + mov r8, r1 + b _08057372 + .pool +_08057354: + adds r2, 0x50 + adds r2, r1, r2 + ldr r0, [r2] + ldr r1, =0xf7ffffff + ands r0, r1 + str r0, [r2] + bl b_movescr_stack_push_cursor + ldr r0, =0x02024332 + strb r4, [r0, 0x5] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB220 + str r0, [r1] + movs r2, 0x2 + mov r8, r2 +_08057372: + ldr r1, =0x02024332 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + mov r10, r1 + b _080573FC + .pool +_08057390: + ldr r1, =0x02024084 + movs r0, 0x58 + mov r2, r9 + muls r2, r0 + adds r0, r2, 0 + adds r1, 0x4C + adds r4, r0, r1 + ldr r0, [r4] + movs r1, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080573F4 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x5 + bl __umodsi3 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + beq _080573D4 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB26A + str r0, [r1] + b _080573EC + .pool +_080573D4: + ldr r0, [r4] + movs r1, 0x21 + negs r1, r1 + ands r0, r1 + str r0, [r4] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB277 + str r0, [r1] + mov r0, r10 + strb r5, [r0, 0x5] +_080573EC: + movs r1, 0x2 + mov r8, r1 + ldr r2, =0x02024332 + mov r10, r2 +_080573F4: + mov r1, r10 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080573FC: + mov r2, r10 + ldrb r0, [r2] + cmp r0, 0x2 + beq _08057406 + b _0805727C +_08057406: + mov r0, r8 + cmp r0, 0x2 + bne _08057430 + ldr r4, =0x02024064 + mov r1, r9 + strb r1, [r4] + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 + ldr r1, =0x020240d0 + adds r0, r1 + str r0, [sp] + movs r0, 0 + movs r1, 0x28 + movs r2, 0 + movs r3, 0x4 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_08057430: + 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 + .pool + thumb_func_end sub_805725C + + thumb_func_start nullsub_21 +nullsub_21: @ 8057458 + bx lr + thumb_func_end nullsub_21 + + thumb_func_start sub_805745C +sub_805745C: @ 805745C + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_exec_buffer_A_ch0_tbl1 + str r1, [r0] + ldr r0, =0x020244b9 + movs r1, 0 + strb r1, [r0] + ldr r0, =0x020244cc + strb r1, [r0] + bx lr + .pool + thumb_func_end sub_805745C + + thumb_func_start dp01_tbl1_exec_completed +dp01_tbl1_exec_completed: @ 805748C + push {r4,lr} + sub sp, 0x4 + ldr r1, =0x03005d60 + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_exec_buffer_A_ch0_tbl1 + str r1, [r0] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080574E0 + bl link_get_multiplayer_id + mov r1, sp + strb r0, [r1] + movs r0, 0x2 + movs r1, 0x4 + mov r2, sp + bl dp01_prepare_buffer_wireless_probably + ldr r1, =0x02023064 + ldrb r0, [r4] + lsls r0, 9 + adds r0, r1 + movs r1, 0x38 + strb r1, [r0] + b _080574F2 + .pool +_080574E0: + ldr r2, =0x02024068 + ldr r1, =gUnknown_0832A328 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldr r0, [r2] + bics r0, r1 + str r0, [r2] +_080574F2: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_tbl1_exec_completed + + thumb_func_start bx_exec_buffer_A_ch0_tbl1 +bx_exec_buffer_A_ch0_tbl1: @ 8057504 + push {lr} + ldr r2, =0x02024068 + ldr r1, =gUnknown_0832A328 + ldr r0, =0x02024064 + ldrb r3, [r0] + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _08057550 + ldr r0, =0x02023064 + lsls r1, r3, 9 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x38 + bhi _0805754C + ldr r0, =gUnknown_0831C514 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 + b _08057550 + .pool +_0805754C: + bl dp01_tbl1_exec_completed +_08057550: + pop {r0} + bx r0 + thumb_func_end bx_exec_buffer_A_ch0_tbl1 + + thumb_func_start bx_0802E404 +bx_0802E404: @ 8057554 + push {lr} + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x24 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08057576 + bl dp01_tbl1_exec_completed +_08057576: + pop {r0} + bx r0 + .pool + thumb_func_end bx_0802E404 + + thumb_func_start sub_8057588 +sub_8057588: @ 8057588 + push {r4-r7,lr} + ldr r3, =0x02023064 + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r2, r0, 9 + adds r1, r3, 0x2 + adds r1, r2, r1 + ldrb r5, [r1] + adds r3, 0x3 + adds r2, r3 + ldrb r1, [r2] + lsls r1, 8 + orrs r5, r1 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x1 + bl dp11b_obj_instanciate + ldrb r0, [r4] + movs r1, 0 + movs r2, 0x7 + movs r3, 0x1 + bl dp11b_obj_instanciate + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x30] + movs r0, 0xF0 + ands r0, r1 + cmp r0, 0 + beq _080575EC + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x2 + bne _080575EC + ldr r1, =0x020244cc + ldrb r0, [r1] + adds r0, 0x1 + b _080575F0 + .pool +_080575EC: + ldr r1, =0x020244cc + movs r0, 0 +_080575F0: + strb r0, [r1] + ldr r0, =0x030022c0 + ldrh r2, [r0, 0x2E] + movs r3, 0x1 + adds r0, r3, 0 + ands r0, r2 + cmp r0, 0 + beq _08057658 + movs r0, 0x5 + bl audio_play + ldr r1, =0x020244ac + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08057640 + cmp r0, 0x1 + bgt _08057630 + cmp r0, 0 + beq _0805763A + b _080577C2 + .pool +_08057630: + cmp r0, 0x2 + beq _08057646 + cmp r0, 0x3 + beq _0805764C + b _080577C2 +_0805763A: + movs r0, 0x1 + movs r1, 0 + b _080577BC +_08057640: + movs r0, 0x1 + movs r1, 0x1 + b _080577BC +_08057646: + movs r0, 0x1 + movs r1, 0x2 + b _080577BC +_0805764C: + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb + b _080577C2 +_08057658: + movs r0, 0x20 + ands r0, r2 + cmp r0, 0 + beq _08057698 + ldr r5, =0x020244ac + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _08057674 + b _080577E8 +_08057674: + movs r0, 0x5 + bl audio_play + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + bl sub_8059CF8 + ldrb r1, [r4] + adds r1, r5 + ldrb r0, [r1] + movs r2, 0x1 + b _08057732 + .pool +_08057698: + movs r0, 0x10 + ands r0, r2 + cmp r0, 0 + beq _080576D8 + ldr r5, =0x020244ac + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _080576B4 + b _080577E8 +_080576B4: + movs r0, 0x5 + bl audio_play + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + bl sub_8059CF8 + ldrb r1, [r4] + adds r1, r5 + ldrb r0, [r1] + movs r2, 0x1 + b _08057732 + .pool +_080576D8: + movs r7, 0x40 + adds r0, r7, 0 + ands r0, r2 + cmp r0, 0 + beq _08057700 + ldr r5, =0x020244ac + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080577E8 + b _0805771A + .pool +_08057700: + movs r0, 0x80 + ands r0, r2 + cmp r0, 0 + beq _0805774C + ldr r5, =0x020244ac + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080577E8 +_0805771A: + movs r0, 0x5 + bl audio_play + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + bl sub_8059CF8 + ldrb r1, [r4] + adds r1, r5 + ldrb r0, [r1] + movs r2, 0x2 +_08057732: + eors r0, r2 + strb r0, [r1] + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + movs r1, 0 + bl sub_8059CB4 + b _080577E8 + .pool +_0805774C: + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + bne _0805775A + ldrb r0, [r1] + cmp r0, 0x3B + bls _080577DC +_0805775A: + ldr r4, =0x02022fec + ldr r0, [r4] + ands r0, r3 + cmp r0, 0 + beq _080577E8 + ldr r6, =0x02024064 + ldrb r0, [r6] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _080577E8 + movs r0, 0 + bl battle_get_side_with_given_state + ldr r1, =0x02024210 + ldrb r1, [r1] + ldr r2, =gUnknown_0832A328 + lsls r0, 24 + lsrs r0, 22 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _080577E8 + ldr r0, [r4] + ands r0, r7 + cmp r0, 0 + bne _080577E8 + ldr r0, =0x02023064 + ldrb r1, [r6] + lsls r1, 9 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x1 + bne _080577B2 + cmp r5, 0xC + bhi _080577E8 + adds r0, r5, 0 + movs r1, 0x1 + bl bag_add_item +_080577B2: + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + movs r1, 0xC +_080577BC: + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb +_080577C2: + bl dp01_tbl1_exec_completed + b _080577E8 + .pool +_080577DC: + movs r0, 0x8 + ands r0, r2 + cmp r0, 0 + beq _080577E8 + bl sub_8073314 +_080577E8: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8057588 + + thumb_func_start sub_80577F0 +sub_80577F0: @ 80577F0 + push {r4,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + movs r1, 0x1 + bl dp11b_obj_free + ldrb r0, [r4] + movs r1, 0 + bl dp11b_obj_free + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8057824 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80577F0 + + thumb_func_start sub_8057824 +sub_8057824: @ 8057824 + push {r4,r5,lr} + sub sp, 0x4 + ldr r1, =gUnknown_0831C5F8 + mov r0, sp + movs r2, 0x4 + bl memcpy + ldr r0, =0x03005d74 + ldrb r0, [r0] + movs r1, 0x1 + movs r2, 0xF + movs r3, 0x1 + bl dp11b_obj_instanciate + movs r4, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r0, 0 + beq _08057866 +_0805784A: + ldr r0, =0x03005d74 + ldrb r0, [r0] + cmp r4, r0 + beq _0805785C + lsls r0, r4, 24 + lsrs r0, 24 + movs r1, 0x1 + bl dp11b_obj_free +_0805785C: + adds r4, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _0805784A +_08057866: + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x2C] + movs r0, 0xF0 + ands r0, r1 + cmp r0, 0 + beq _0805789C + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x2 + bne _0805789C + ldr r1, =0x020244cc + ldrb r0, [r1] + adds r0, 0x1 + b _080578A0 + .pool +_0805789C: + ldr r1, =0x020244cc + movs r0, 0 +_080578A0: + strb r0, [r1] + ldrh r2, [r2, 0x2E] + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _08057910 + movs r0, 0x5 + bl audio_play + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r4, =0x03005d74 + ldrb r0, [r4] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_8039B2C + str r1, [r0] + ldr r1, =0x020244b0 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r2, [r0] + ldrb r0, [r4] + lsls r0, 8 + orrs r2, r0 + movs r0, 0x1 + movs r1, 0xA + bl dp01_build_cmdbuf_x21_a_bb + ldrb r0, [r4] + movs r1, 0x1 + bl dp11b_obj_free + bl dp01_tbl1_exec_completed + b _08057BC8 + .pool +_08057910: + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + bne _0805791E + ldrb r0, [r1] + cmp r0, 0x3B + bls _0805798C +_0805791E: + movs r0, 0x5 + bl audio_play + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r5, =0x03005d74 + ldrb r0, [r5] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_8039B2C + str r1, [r0] + ldr r1, =0x03005d60 + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8057BFC + str r1, [r0] + ldrb r0, [r4] + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x1 + bl dp11b_obj_instanciate + ldrb r0, [r4] + movs r1, 0 + movs r2, 0x7 + movs r3, 0x1 + bl dp11b_obj_instanciate + ldrb r0, [r5] + movs r1, 0x1 + bl dp11b_obj_free + b _08057BC8 + .pool +_0805798C: + movs r0, 0x60 + ands r0, r2 + cmp r0, 0 + bne _08057996 + b _08057AB0 +_08057996: + movs r0, 0x5 + bl audio_play + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r3, =0x03005d74 + ldrb r0, [r3] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_8039B2C + str r1, [r0] + adds r5, r3, 0 +_080579B8: + ldrb r0, [r5] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r1, r0, 24 + movs r4, 0 + mov r0, sp + b _080579E2 + .pool +_080579D8: + adds r4, 0x1 + cmp r4, 0x3 + bgt _080579E8 + mov r2, sp + adds r0, r2, r4 +_080579E2: + ldrb r0, [r0] + cmp r1, r0 + bne _080579D8 +_080579E8: + subs r4, 0x1 + cmp r4, 0 + bge _080579F0 + movs r4, 0x4 +_080579F0: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + bl battle_get_side_with_given_state + strb r0, [r5] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + beq _080579E8 + movs r4, 0 + ldrb r0, [r5] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08057A6E + cmp r0, 0x1 + bgt _08057A28 + cmp r0, 0 + beq _08057A32 + b _08057A70 + .pool +_08057A28: + cmp r0, 0x2 + beq _08057A32 + cmp r0, 0x3 + beq _08057A6E + b _08057A70 +_08057A32: + ldr r2, =0x02024064 + ldrb r0, [r2] + ldrb r1, [r5] + cmp r0, r1 + bne _08057A6E + ldr r1, =0x0202406e + ldrb r2, [r2] + lsls r0, r2, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x020244b0 + adds r2, r1 + ldrb r1, [r2] + adds r1, 0xD + bl pokemon_getattr + ldr r2, =gBattleMoves + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r1, [r1, 0x6] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08057A70 +_08057A6E: + adds r4, 0x1 +_08057A70: + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + ldr r0, =0x03005d74 + cmp r1, 0 + beq _08057A88 + movs r4, 0 +_08057A88: + cmp r4, 0 + beq _080579B8 + b _08057BB0 + .pool +_08057AB0: + movs r0, 0x90 + ands r0, r2 + cmp r0, 0 + bne _08057ABA + b _08057BC8 +_08057ABA: + movs r0, 0x5 + bl audio_play + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r3, =0x03005d74 + ldrb r0, [r3] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_8039B2C + str r1, [r0] + adds r5, r3, 0 +_08057ADC: + ldrb r0, [r5] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r1, r0, 24 + movs r4, 0 + mov r0, sp + b _08057B06 + .pool +_08057AFC: + adds r4, 0x1 + cmp r4, 0x3 + bgt _08057B0C + mov r2, sp + adds r0, r2, r4 +_08057B06: + ldrb r0, [r0] + cmp r1, r0 + bne _08057AFC +_08057B0C: + adds r4, 0x1 + cmp r4, 0x3 + ble _08057B14 + movs r4, 0 +_08057B14: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + bl battle_get_side_with_given_state + strb r0, [r5] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + beq _08057B0C + movs r4, 0 + ldrb r0, [r5] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08057B92 + cmp r0, 0x1 + bgt _08057B4C + cmp r0, 0 + beq _08057B56 + b _08057B94 + .pool +_08057B4C: + cmp r0, 0x2 + beq _08057B56 + cmp r0, 0x3 + beq _08057B92 + b _08057B94 +_08057B56: + ldr r2, =0x02024064 + ldrb r0, [r2] + ldrb r1, [r5] + cmp r0, r1 + bne _08057B92 + ldr r1, =0x0202406e + ldrb r2, [r2] + lsls r0, r2, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x020244b0 + adds r2, r1 + ldrb r1, [r2] + adds r1, 0xD + bl pokemon_getattr + ldr r2, =gBattleMoves + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r1, [r1, 0x6] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08057B94 +_08057B92: + adds r4, 0x1 +_08057B94: + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + ldr r0, =0x03005d74 + cmp r1, 0 + beq _08057BAC + movs r4, 0 +_08057BAC: + cmp r4, 0 + beq _08057ADC +_08057BB0: + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_8039AD8 + str r1, [r0] +_08057BC8: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8057824 + + thumb_func_start sub_8057BFC +sub_8057BFC: @ 8057BFC + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r0, 0 + mov r8, r0 + ldr r3, =0x02024064 + ldrb r0, [r3] + lsls r0, 9 + ldr r1, =0x02023068 + adds r6, r0, r1 + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x2C] + movs r0, 0xF0 + ands r0, r1 + adds r7, r3, 0 + cmp r0, 0 + beq _08057C44 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x2 + bne _08057C44 + ldr r1, =0x020244cc + ldrb r0, [r1] + adds r0, 0x1 + b _08057C48 + .pool +_08057C44: + ldr r1, =0x020244cc + movs r0, 0 +_08057C48: + strb r0, [r1] + ldrh r2, [r2, 0x2E] + movs r5, 0x1 + adds r0, r5, 0 + ands r0, r2 + cmp r0, 0 + bne _08057C58 + b _08057E04 +_08057C58: + movs r0, 0x5 + bl audio_play + ldr r1, =0x020244b0 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + lsls r0, 1 + adds r1, r6, r0 + ldrh r0, [r1] + cmp r0, 0xAE + bne _08057C98 + ldrb r0, [r6, 0x12] + movs r4, 0 + cmp r0, 0x7 + beq _08057CA6 + ldrb r1, [r6, 0x13] + movs r0, 0x7 + eors r1, r0 + negs r0, r1 + orrs r0, r1 + asrs r4, r0, 31 + movs r0, 0x10 + ands r4, r0 + b _08057CA6 + .pool +_08057C98: + ldr r2, =gBattleMoves + ldrh r1, [r1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r4, [r0, 0x6] +_08057CA6: + movs r0, 0x10 + ands r0, r4 + cmp r0, 0 + beq _08057CC4 + ldr r0, =0x03005d74 + ldr r1, =0x02024064 + ldrb r1, [r1] + strb r1, [r0] + b _08057CDE + .pool +_08057CC4: + ldr r0, =0x02024064 + ldrb r0, [r0] + bl battle_get_per_side_status + adds r1, r0, 0 + movs r2, 0x1 + movs r0, 0x1 + ands r0, r1 + eors r0, r2 + bl battle_get_side_with_given_state + ldr r1, =0x03005d74 + strb r0, [r1] +_08057CDE: + ldr r5, =0x02023064 + ldr r0, =0x02024064 + ldrb r3, [r0] + lsls r2, r3, 9 + adds r1, r5, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r7, r0, 0 + cmp r1, 0 + bne _08057D18 + movs r0, 0x2 + ands r0, r4 + cmp r0, 0 + beq _08057D5A + adds r0, r5, 0x2 + adds r0, r2, r0 + ldrb r0, [r0] + cmp r0, 0 + bne _08057D5A + movs r0, 0x1 + add r8, r0 + b _08057D5A + .pool +_08057D18: + movs r0, 0x7D + ands r0, r4 + cmp r0, 0 + bne _08057D24 + movs r0, 0x1 + add r8, r0 +_08057D24: + ldr r0, =0x020244b0 + adds r0, r3, r0 + adds r1, r6, 0 + adds r1, 0x8 + ldrb r0, [r0] + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _08057D62 + movs r0, 0x12 + ands r0, r4 + cmp r0, 0 + bne _08057D5A + movs r0, 0 + bl sub_8069DEC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _08057D5A + ldrb r0, [r7] + bl sub_8069F34 + ldr r1, =0x03005d74 + strb r0, [r1] + movs r0, 0 + mov r8, r0 +_08057D5A: + ldr r7, =0x02024064 + mov r0, r8 + cmp r0, 0 + bne _08057D80 +_08057D62: + ldr r1, =0x020244b0 + ldrb r0, [r7] + adds r0, r1 + ldrb r2, [r0] + ldr r0, =0x03005d74 + ldrb r0, [r0] + lsls r0, 8 + orrs r2, r0 + b _08057E1C + .pool +_08057D80: + ldr r1, =0x03005d60 + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8057824 + str r1, [r0] + movs r0, 0x12 + ands r4, r0 + cmp r4, 0 + beq _08057DA8 + ldr r1, =0x03005d74 + ldrb r0, [r7] + b _08057DD8 + .pool +_08057DA8: + movs r0, 0x1 + bl battle_get_side_with_given_state + ldr r1, =0x02024210 + ldrb r1, [r1] + ldr r2, =gUnknown_0832A328 + lsls r0, 24 + lsrs r0, 22 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _08057DD0 + movs r0, 0x3 + b _08057DD2 + .pool +_08057DD0: + movs r0, 0x1 +_08057DD2: + bl battle_get_side_with_given_state + ldr r1, =0x03005d74 +_08057DD8: + strb r0, [r1] + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r0, =0x03005d74 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_8039AD8 + b _08057F9C + .pool +_08057E04: + movs r6, 0x2 + adds r0, r6, 0 + ands r0, r2 + cmp r0, 0 + bne _08057E14 + ldrb r0, [r1] + cmp r0, 0x3B + bls _08057E30 +_08057E14: + movs r0, 0x5 + bl audio_play + ldr r2, =0x0000ffff +_08057E1C: + movs r0, 0x1 + movs r1, 0xA + bl dp01_build_cmdbuf_x21_a_bb + bl dp01_tbl1_exec_completed + b _08057F9E + .pool +_08057E30: + movs r0, 0x20 + ands r0, r2 + cmp r0, 0 + beq _08057E60 + ldr r4, =0x020244b0 + ldrb r0, [r7] + adds r2, r0, r4 + ldrb r1, [r2] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _08057E4A + b _08057F9E +_08057E4A: + ldrb r0, [r2] + bl battle_menu_cursor_related + ldrb r1, [r7] + adds r1, r4 + ldrb r0, [r1] + movs r2, 0x1 + eors r0, r2 + b _08057F08 + .pool +_08057E60: + movs r0, 0x10 + ands r0, r2 + cmp r0, 0 + beq _08057EA4 + ldr r4, =0x020244b0 + ldrb r0, [r7] + adds r3, r0, r4 + ldrb r2, [r3] + movs r6, 0x1 + adds r0, r5, 0 + ands r0, r2 + cmp r0, 0 + beq _08057E7C + b _08057F9E +_08057E7C: + ldr r1, =0x03005d78 + adds r0, r6, 0 + eors r0, r2 + ldrb r1, [r1] + cmp r0, r1 + bcc _08057E8A + b _08057F9E +_08057E8A: + ldrb r0, [r3] + bl battle_menu_cursor_related + ldrb r1, [r7] + adds r1, r4 + ldrb r0, [r1] + eors r0, r6 + b _08057F08 + .pool +_08057EA4: + movs r0, 0x40 + ands r0, r2 + cmp r0, 0 + beq _08057ED4 + ldr r4, =0x020244b0 + ldrb r0, [r7] + adds r2, r0, r4 + ldrb r1, [r2] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _08057F9E + ldrb r0, [r2] + bl battle_menu_cursor_related + ldrb r1, [r7] + adds r1, r4 + ldrb r0, [r1] + movs r2, 0x2 + eors r0, r2 + b _08057F08 + .pool +_08057ED4: + movs r0, 0x80 + ands r0, r2 + cmp r0, 0 + beq _08057F30 + ldr r4, =0x020244b0 + ldrb r0, [r7] + adds r3, r0, r4 + ldrb r2, [r3] + movs r5, 0x2 + adds r0, r6, 0 + ands r0, r2 + cmp r0, 0 + bne _08057F9E + ldr r1, =0x03005d78 + adds r0, r5, 0 + eors r0, r2 + ldrb r1, [r1] + cmp r0, r1 + bcs _08057F9E + ldrb r0, [r3] + bl battle_menu_cursor_related + ldrb r1, [r7] + adds r1, r4 + ldrb r0, [r1] + eors r0, r5 +_08057F08: + strb r0, [r1] + movs r0, 0x5 + bl audio_play + ldrb r0, [r7] + adds r0, r4 + ldrb r0, [r0] + movs r1, 0 + bl battle_menu_cursor_related_2 + bl sub_8059B3C + bl sub_8059BB0 + b _08057F9E + .pool +_08057F30: + movs r0, 0x4 + ands r0, r2 + cmp r0, 0 + beq _08057F9E + ldr r0, =0x03005d78 + ldrb r0, [r0] + cmp r0, 0x1 + bls _08057F9E + ldr r0, =0x02022fec + ldr r5, [r0] + ands r5, r6 + cmp r5, 0 + bne _08057F9E + ldr r4, =0x020244b0 + ldrb r0, [r7] + adds r0, r4 + ldrb r0, [r0] + movs r1, 0x1D + bl battle_menu_cursor_related_2 + ldrb r0, [r7] + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _08057F78 + ldr r0, =0x03005d74 + strb r5, [r0] + b _08057F80 + .pool +_08057F78: + ldr r1, =0x03005d74 + adds r0, 0x1 + strb r0, [r1] + adds r0, r1, 0 +_08057F80: + ldrb r0, [r0] + movs r1, 0x1B + bl battle_menu_cursor_related_2 + ldr r0, =gUnknown_085CCACA + movs r1, 0xB + bl battle_show_message_maybe + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8058138 +_08057F9C: + str r1, [r0] +_08057F9E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8057BFC + + thumb_func_start sub_8057FBC +sub_8057FBC: @ 8057FBC + push {r4-r7,lr} + movs r7, 0 + ldr r4, =0x030022c0 + ldrh r1, [r4, 0x2E] + movs r6, 0x1 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _08057FD6 + movs r0, 0x5 + bl audio_play + movs r7, 0x1 +_08057FD6: + ldrh r1, [r4, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08057FF8 + movs r0, 0x5 + bl audio_play + ldr r1, =0x02022e14 + movs r0, 0 + strh r0, [r1] + ldr r1, =0x02022e16 + movs r2, 0xA0 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + movs r7, 0xFF +_08057FF8: + ldrh r1, [r4, 0x2E] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08058038 + ldr r5, =0x020244b0 + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r2, r0, r5 + ldrb r1, [r2] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _08058038 + ldrb r0, [r2] + bl battle_menu_cursor_related + ldrb r1, [r4] + adds r1, r5 + ldrb r0, [r1] + movs r2, 0x1 + eors r0, r2 + strb r0, [r1] + movs r0, 0x5 + bl audio_play + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + movs r1, 0 + bl battle_menu_cursor_related_2 +_08058038: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08058086 + ldr r5, =0x020244b0 + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r3, r0, r5 + ldrb r2, [r3] + movs r6, 0x1 + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + bne _08058086 + ldr r1, =0x03005d78 + adds r0, r6, 0 + eors r0, r2 + ldrb r1, [r1] + cmp r0, r1 + bcs _08058086 + ldrb r0, [r3] + bl battle_menu_cursor_related + ldrb r1, [r4] + adds r1, r5 + ldrb r0, [r1] + eors r0, r6 + strb r0, [r1] + movs r0, 0x5 + bl audio_play + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + movs r1, 0 + bl battle_menu_cursor_related_2 +_08058086: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080580C8 + ldr r5, =0x020244b0 + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r2, r0, r5 + ldrb r1, [r2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080580C8 + ldrb r0, [r2] + bl battle_menu_cursor_related + ldrb r1, [r4] + adds r1, r5 + ldrb r0, [r1] + movs r2, 0x2 + eors r0, r2 + strb r0, [r1] + movs r0, 0x5 + bl audio_play + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + movs r1, 0 + bl battle_menu_cursor_related_2 +_080580C8: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08058116 + ldr r5, =0x020244b0 + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r3, r0, r5 + ldrb r2, [r3] + movs r6, 0x2 + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + bne _08058116 + ldr r1, =0x03005d78 + adds r0, r6, 0 + eors r0, r2 + ldrb r1, [r1] + cmp r0, r1 + bcs _08058116 + ldrb r0, [r3] + bl battle_menu_cursor_related + ldrb r1, [r4] + adds r1, r5 + ldrb r0, [r1] + eors r0, r6 + strb r0, [r1] + movs r0, 0x5 + bl audio_play + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + movs r1, 0 + bl battle_menu_cursor_related_2 +_08058116: + adds r0, r7, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8057FBC + + thumb_func_start sub_8058138 +sub_8058138: @ 8058138 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x5 + ands r0, r1 + cmp r0, 0 + bne _08058152 + b _08058500 +_08058152: + movs r0, 0x5 + bl audio_play + ldr r0, =0x020244b0 + mov r10, r0 + ldr r1, =0x02024064 + mov r8, r1 + ldrb r1, [r1] + adds r2, r1, r0 + ldr r5, =0x03005d74 + ldrb r0, [r2] + ldrb r3, [r5] + cmp r0, r3 + bne _08058170 + b _080584A8 +_08058170: + lsls r1, 9 + ldr r0, =0x02023068 + adds r1, r0 + mov r9, r1 + ldrb r1, [r2] + lsls r1, 1 + add r1, r9 + ldrh r6, [r1] + ldrb r0, [r5] + lsls r0, 1 + add r0, r9 + ldrh r0, [r0] + strh r0, [r1] + ldrb r0, [r5] + lsls r0, 1 + add r0, r9 + strh r6, [r0] + mov r1, r8 + ldrb r0, [r1] + add r0, r10 + ldrb r1, [r0] + mov r7, r9 + adds r7, 0x8 + adds r1, r7, r1 + ldrb r6, [r1] + ldrb r0, [r5] + adds r0, r7, r0 + ldrb r0, [r0] + strb r0, [r1] + ldrb r0, [r5] + adds r0, r7, r0 + strb r6, [r0] + mov r2, r8 + ldrb r0, [r2] + add r0, r10 + ldrb r1, [r0] + mov r2, r9 + adds r2, 0xC + adds r1, r2, r1 + ldrb r6, [r1] + ldrb r0, [r5] + adds r0, r2, r0 + ldrb r0, [r0] + strb r0, [r1] + ldrb r0, [r5] + adds r2, r0 + strb r6, [r2] + mov r3, r8 + ldrb r1, [r3] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r2, =0x020242bc + adds r6, r0, r2 + ldrb r4, [r6, 0x18] + lsls r3, r4, 24 + lsrs r2, r3, 28 + ldr r0, =gUnknown_0832A328 + mov r12, r0 + add r1, r10 + ldrb r0, [r1] + lsls r0, 2 + add r0, r12 + ldr r0, [r0] + ands r2, r0 + cmp r2, 0 + beq _0805822A + lsrs r1, r3, 28 + bics r1, r0 + lsls r1, 4 + movs r2, 0xF + adds r0, r2, 0 + ands r0, r4 + orrs r0, r1 + strb r0, [r6, 0x18] + mov r1, r8 + ldrb r0, [r1] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r3, =0x020242bc + adds r1, r3 + ldrb r4, [r1, 0x18] + lsrs r3, r4, 4 + ldrb r0, [r5] + lsls r0, 2 + add r0, r12 + ldr r0, [r0] + orrs r0, r3 + lsls r0, 4 + ands r2, r4 + orrs r2, r0 + strb r2, [r1, 0x18] +_0805822A: + bl sub_8059AAC + movs r6, 0 + mov r12, r7 + mov r5, sp + adds r5, 0x18 + str r5, [sp, 0x1C] + ldr r2, =0x02024084 + mov r0, r8 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r4, r0, 0 + adds r4, 0x3B + mov r7, r8 + mov r10, r2 + movs r5, 0x3 +_0805824E: + mov r1, sp + adds r3, r1, r6 + ldrb r1, [r4] + lsls r2, r6, 1 + adds r0, r5, 0 + lsls r0, r2 + ands r1, r0 + asrs r1, r2 + strb r1, [r3] + adds r6, 0x1 + cmp r6, 0x3 + ble _0805824E + ldr r1, =0x020244b0 + ldrb r0, [r7] + adds r0, r1 + ldrb r0, [r0] + add r0, sp + ldrb r0, [r0] + ldr r2, [sp, 0x1C] + strb r0, [r2] + ldrb r0, [r7] + adds r0, r1 + ldrb r0, [r0] + mov r3, sp + adds r2, r3, r0 + ldr r1, =0x03005d74 + ldrb r0, [r1] + add r0, sp + ldrb r0, [r0] + movs r3, 0 + strb r0, [r2] + ldrb r0, [r1] + mov r5, sp + adds r1, r5, r0 + ldr r2, [sp, 0x1C] + ldrb r0, [r2] + strb r0, [r1] + strb r3, [r2] + movs r6, 0 + ldr r2, [sp, 0x1C] +_0805829E: + mov r3, sp + adds r0, r3, r6 + ldrb r1, [r0] + lsls r0, r6, 1 + lsls r1, r0 + ldrb r0, [r2] + orrs r0, r1 + strb r0, [r2] + adds r6, 0x1 + cmp r6, 0x3 + ble _0805829E + ldrb r1, [r7] + movs r0, 0x58 + muls r0, r1 + add r0, r10 + adds r0, 0x3B + ldr r5, [sp, 0x1C] + ldrb r1, [r5] + strb r1, [r0] + movs r6, 0 + adds r4, r7, 0 + movs r3, 0x58 + movs r0, 0x24 + add r0, r10 + mov r8, r0 + mov r2, r9 + mov r7, r10 + adds r7, 0xC + mov r5, r12 +_080582D8: + lsls r1, r6, 1 + ldrb r0, [r4] + muls r0, r3 + adds r1, r0 + adds r1, r7 + ldrh r0, [r2] + strh r0, [r1] + ldrb r0, [r4] + adds r1, r0, 0 + muls r1, r3 + adds r1, r6, r1 + add r1, r8 + adds r0, r5, r6 + ldrb r0, [r0] + strb r0, [r1] + adds r2, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _080582D8 + ldr r2, =0x02024064 + ldrb r1, [r2] + movs r0, 0x58 + muls r0, r1 + mov r1, r10 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 14 + ands r0, r1 + cmp r0, 0 + beq _0805831A + b _080584A8 +_0805831A: + movs r6, 0 + mov r1, sp + adds r1, 0x4 + str r1, [sp, 0x20] + add r3, sp, 0xC + mov r10, r3 + ldr r5, =0x0202406e + mov r9, r5 + mov r8, r2 + movs r7, 0x64 + ldr r5, =0x020244ec + adds r4, r1, 0 +_08058332: + mov r1, r8 + ldrb r0, [r1] + lsls r0, 1 + add r0, r9 + ldrh r0, [r0] + muls r0, r7 + adds r0, r5 + adds r1, r6, 0 + adds r1, 0xD + bl pokemon_getattr + strh r0, [r4] + mov r2, r8 + ldrb r0, [r2] + lsls r0, 1 + add r0, r9 + ldrh r0, [r0] + muls r0, r7 + adds r0, r5 + adds r1, r6, 0 + adds r1, 0x11 + bl pokemon_getattr + mov r3, r10 + adds r1, r3, r6 + strb r0, [r1] + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _08058332 + ldr r1, =0x0202406e + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + ldr r5, [sp, 0x1C] + strb r0, [r5] + movs r6, 0 + movs r5, 0x3 + ldr r4, [sp, 0x1C] +_08058392: + mov r0, sp + adds r3, r0, r6 + lsls r2, r6, 1 + adds r1, r5, 0 + lsls r1, r2 + ldrb r0, [r4] + ands r0, r1 + asrs r0, r2 + strb r0, [r3] + adds r6, 0x1 + cmp r6, 0x3 + ble _08058392 + ldr r4, =0x020244b0 + ldr r3, =0x02024064 + ldrb r0, [r3] + adds r0, r4 + ldrb r1, [r0] + lsls r1, 1 + ldr r2, [sp, 0x20] + adds r1, r2, r1 + ldrh r6, [r1] + ldr r2, =0x03005d74 + ldrb r0, [r2] + lsls r0, 1 + ldr r5, [sp, 0x20] + adds r0, r5, r0 + ldrh r0, [r0] + movs r5, 0 + strh r0, [r1] + ldrb r0, [r2] + lsls r0, 1 + ldr r1, [sp, 0x20] + adds r0, r1, r0 + strh r6, [r0] + ldrb r0, [r3] + adds r0, r4 + ldrb r1, [r0] + add r1, r10 + ldrb r6, [r1] + ldrb r0, [r2] + add r0, r10 + ldrb r0, [r0] + strb r0, [r1] + ldrb r0, [r2] + add r0, r10 + strb r6, [r0] + ldrb r0, [r3] + adds r0, r4 + ldrb r0, [r0] + add r0, sp + ldrb r0, [r0] + ldr r1, [sp, 0x1C] + strb r0, [r1] + ldrb r0, [r3] + adds r0, r4 + ldrb r0, [r0] + mov r3, sp + adds r1, r3, r0 + ldrb r0, [r2] + add r0, sp + ldrb r0, [r0] + strb r0, [r1] + ldrb r0, [r2] + adds r1, r3, r0 + ldr r2, [sp, 0x1C] + ldrb r0, [r2] + strb r0, [r1] + strb r5, [r2] + movs r6, 0 + ldr r2, [sp, 0x1C] +_0805841E: + mov r3, sp + adds r0, r3, r6 + ldrb r1, [r0] + lsls r0, r6, 1 + lsls r1, r0 + ldrb r0, [r2] + orrs r0, r1 + strb r0, [r2] + adds r6, 0x1 + cmp r6, 0x3 + ble _0805841E + movs r6, 0 + ldr r5, =0x0202406e + mov r10, r5 + ldr r0, =0x02024064 + mov r9, r0 + movs r1, 0x64 + mov r8, r1 + ldr r7, =0x020244ec + ldr r5, [sp, 0x20] + adds r5, 0x8 + ldr r4, [sp, 0x20] +_0805844A: + mov r2, r9 + ldrb r0, [r2] + lsls r0, 1 + add r0, r10 + ldrh r0, [r0] + mov r3, r8 + muls r3, r0 + adds r0, r3, 0 + adds r0, r7 + adds r1, r6, 0 + adds r1, 0xD + adds r2, r4, 0 + bl pokemon_setattr + mov r1, r9 + ldrb r0, [r1] + lsls r0, 1 + add r0, r10 + ldrh r0, [r0] + mov r2, r8 + muls r2, r0 + adds r0, r2, 0 + adds r0, r7 + adds r1, r6, 0 + adds r1, 0x11 + adds r2, r5, 0 + bl pokemon_setattr + adds r5, 0x1 + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _0805844A + ldr r1, =0x0202406e + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x15 + ldr r2, [sp, 0x1C] + bl pokemon_setattr +_080584A8: + ldr r1, =0x03005d60 + ldr r2, =0x02024064 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8057BFC + str r1, [r0] + ldr r3, =0x020244b0 + ldrb r0, [r2] + adds r0, r3 + ldr r1, =0x03005d74 + ldrb r1, [r1] + strb r1, [r0] + ldrb r0, [r2] + adds r0, r3 + ldrb r0, [r0] + movs r1, 0 + bl battle_menu_cursor_related_2 + b _08058532 + .pool +_08058500: + movs r0, 0x6 + ands r0, r1 + cmp r0, 0 + beq _08058554 + movs r0, 0x5 + bl audio_play + ldr r0, =0x03005d74 + ldrb r0, [r0] + bl battle_menu_cursor_related + ldr r1, =0x020244b0 + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r1 + ldrb r0, [r0] + movs r1, 0 + bl battle_menu_cursor_related_2 + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8057BFC + str r1, [r0] +_08058532: + bl sub_8059B18 + bl sub_8059B3C + bl sub_8059BB0 + b _080586E8 + .pool +_08058554: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080585A4 + ldr r3, =0x03005d74 + ldrb r2, [r3] + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + bne _0805856A + b _080586E8 +_0805856A: + ldr r0, =0x020244b0 + ldr r1, =0x02024064 + ldrb r1, [r1] + adds r1, r0 + ldrb r5, [r1] + cmp r2, r5 + bne _08058590 +_08058578: + ldrb r0, [r1] + movs r1, 0x1D + bl battle_menu_cursor_related_2 + b _08058596 + .pool +_08058590: + ldrb r0, [r3] + bl battle_menu_cursor_related +_08058596: + ldr r4, =0x03005d74 + ldrb r0, [r4] + movs r1, 0x1 + b _0805862C + .pool +_080585A4: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080585E8 + ldr r3, =0x03005d74 + ldrb r2, [r3] + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _080585BA + b _080586E8 +_080585BA: + ldr r1, =0x03005d78 + movs r0, 0x1 + eors r0, r2 + ldrb r1, [r1] + cmp r0, r1 + bcc _080585C8 + b _080586E8 +_080585C8: + ldr r0, =0x020244b0 + ldr r1, =0x02024064 + ldrb r1, [r1] + adds r1, r0 + ldrb r0, [r1] + cmp r2, r0 + beq _08058578 + b _08058590 + .pool +_080585E8: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0805865C + ldr r3, =0x03005d74 + ldrb r2, [r3] + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + beq _080586E8 + ldr r0, =0x020244b0 + ldr r1, =0x02024064 + ldrb r1, [r1] + adds r1, r0 + ldrb r5, [r1] + cmp r2, r5 + bne _08058620 + ldrb r0, [r1] + movs r1, 0x1D + bl battle_menu_cursor_related_2 + b _08058626 + .pool +_08058620: + ldrb r0, [r3] + bl battle_menu_cursor_related +_08058626: + ldr r4, =0x03005d74 + ldrb r0, [r4] + movs r1, 0x2 +_0805862C: + eors r0, r1 + strb r0, [r4] + movs r0, 0x5 + bl audio_play + ldr r1, =0x020244b0 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r4] + ldrb r0, [r0] + cmp r1, r0 + beq _080586CA + ldrb r0, [r4] + movs r1, 0x1B + bl battle_menu_cursor_related_2 + b _080586E8 + .pool +_0805865C: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080586E8 + ldr r3, =0x03005d74 + ldrb r2, [r3] + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + bne _080586E8 + ldr r1, =0x03005d78 + movs r0, 0x2 + eors r0, r2 + ldrb r1, [r1] + cmp r0, r1 + bcs _080586E8 + ldr r0, =0x020244b0 + ldr r1, =0x02024064 + ldrb r1, [r1] + adds r1, r0 + ldrb r0, [r1] + cmp r2, r0 + bne _080586A4 + ldrb r0, [r1] + movs r1, 0x1D + bl battle_menu_cursor_related_2 + b _080586AA + .pool +_080586A4: + ldrb r0, [r3] + bl battle_menu_cursor_related +_080586AA: + ldr r4, =0x03005d74 + ldrb r0, [r4] + movs r1, 0x2 + eors r0, r1 + strb r0, [r4] + movs r0, 0x5 + bl audio_play + ldr r1, =0x020244b0 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r4] + ldrb r0, [r0] + cmp r1, r0 + bne _080586E0 +_080586CA: + adds r0, r1, 0 + movs r1, 0 + bl battle_menu_cursor_related_2 + b _080586E8 + .pool +_080586E0: + ldrb r0, [r4] + movs r1, 0x1B + bl battle_menu_cursor_related_2 +_080586E8: + 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_8058138 + + thumb_func_start sub_80586F8 +sub_80586F8: @ 80586F8 + push {lr} + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _0805875C + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _08058798 + movs r0, 0x5A + bl m4aSongNumStop + ldr r3, =0x030022c0 + ldr r0, =0x00000439 + adds r2, r3, r0 + ldrb r1, [r2] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, =0x03005d00 + ldr r0, [r0] + str r0, [r3] + ldr r0, =sub_8038D64 + bl SetMainCallback2 + ldr r0, =0x0202433a + ldrb r0, [r0] + cmp r0, 0x1 + bne _08058738 + bl sub_817E3F4 +_08058738: + bl FreeAllWindowBuffers + b _08058798 + .pool +_0805875C: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08058798 + movs r0, 0x5A + bl m4aSongNumStop + ldr r3, =0x030022c0 + ldr r0, =0x00000439 + adds r2, r3, r0 + ldrb r1, [r2] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, =0x03005d00 + ldr r0, [r0] + str r0, [r3] + ldr r0, =sub_8038D64 + bl SetMainCallback2 + ldr r0, =0x0202433a + ldrb r0, [r0] + cmp r0, 0x1 + bne _08058794 + bl sub_817E3F4 +_08058794: + bl FreeAllWindowBuffers +_08058798: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80586F8 + + thumb_func_start sub_80587B0 +sub_80587B0: @ 80587B0 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08058832 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08058810 + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08058832 + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _080587F0 + bl sub_800AC34 + b _080587F4 + .pool +_080587F0: + bl sub_800ADF8 +_080587F4: + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_80586F8 + str r1, [r0] + b _08058832 + .pool +_08058810: + movs r0, 0x5A + bl m4aSongNumStop + ldr r2, =0x030022c0 + ldr r0, =0x00000439 + adds r3, r2, r0 + ldrb r1, [r3] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r3] + ldr r0, =0x03005d00 + ldr r0, [r0] + str r0, [r2] + ldr r0, [r2, 0x8] + bl SetMainCallback2 +_08058832: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80587B0 + + thumb_func_start sub_8058844 +sub_8058844: @ 8058844 + push {lr} + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + bne _08058868 + bl dp01_tbl1_exec_completed +_08058868: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8058844 + + thumb_func_start sub_805887C +sub_805887C: @ 805887C + push {lr} + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + bne _080588A0 + bl dp01_tbl1_exec_completed +_080588A0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_805887C + + thumb_func_start bx_802F7A0 +bx_802F7A0: @ 80588B4 + push {r4-r6,lr} + ldr r6, =0x02020630 + ldr r5, =0x020241e4 + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r6, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + bne _08058908 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + bl nullsub_25 + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl obj_free_rotscale_entry + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl RemoveObjectAndFreeTiles + bl dp01_tbl1_exec_completed +_08058908: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end bx_802F7A0 + + thumb_func_start sub_8058924 +sub_8058924: @ 8058924 + push {r4,lr} + ldr r4, =0x020244d0 + ldr r1, [r4] + ldr r3, =0x02024064 + ldrb r0, [r3] + ldr r2, [r1, 0x4] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x9] + subs r0, 0x1 + strb r0, [r1, 0x9] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _0805895C + ldr r0, [r4] + ldrb r1, [r3] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strb r1, [r0, 0x9] + bl dp01_tbl1_exec_completed +_0805895C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8058924 + + thumb_func_start sub_805896C +sub_805896C: @ 805896C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r7, 0 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08058998 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _080589D0 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080589D0 +_08058998: + ldr r2, =0x02020630 + ldr r1, =0x03005d70 + ldr r3, =0x02024064 + ldrb r0, [r3] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + mov r10, r3 + cmp r1, r0 + bne _08058A0A + b _08058A0E + .pool +_080589D0: + ldr r3, =0x02020630 + ldr r6, =0x03005d70 + ldr r2, =0x02024064 + ldrb r4, [r2] + adds r0, r4, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r5, r3, 0 + adds r5, 0x1C + adds r0, r5 + ldr r3, [r0] + ldr r0, =DummyObjectCallback + mov r10, r2 + cmp r3, r0 + bne _08058A0A + movs r0, 0x2 + eors r4, r0 + adds r0, r4, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r0, [r0] + cmp r0, r3 + bne _08058A0A + movs r7, 0x1 +_08058A0A: + cmp r7, 0 + beq _08058B08 +_08058A0E: + ldr r0, =0x020244d0 + mov r9, r0 + ldr r0, [r0] + mov r6, r10 + ldrb r2, [r6] + ldr r3, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r4, r0, r3 + ldrb r1, [r4, 0x1] + movs r5, 0x1 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _08058B08 + movs r1, 0x2 + mov r8, r1 + mov r1, r8 + eors r1, r2 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r1, [r0, 0x1] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _08058B08 + ldrb r1, [r4] + movs r3, 0x7F + adds r0, r3, 0 + ands r0, r1 + strb r0, [r4] + mov r2, r9 + ldr r0, [r2] + ldrb r2, [r6] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r4, 0x2 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + strb r0, [r1, 0x1] + mov r0, r9 + ldr r2, [r0] + ldrb r0, [r6] + mov r1, r8 + eors r1, r0 + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + ands r3, r1 + strb r3, [r0] + mov r1, r9 + ldr r2, [r1] + ldrb r0, [r6] + mov r1, r8 + eors r1, r0 + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1] + ands r4, r1 + strb r4, [r0, 0x1] + ldr r4, =0x000027f9 + adds r0, r4, 0 + bl FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + ldr r7, =0x0202406e + ldrb r1, [r6] + lsls r0, r1, 1 + adds r0, r7 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r4, =0x020244ec + adds r0, r4 + bl sub_805E990 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08058AE4 + ldrb r0, [r6] + mov r1, r8 + eors r1, r0 + lsls r0, r1, 1 + adds r0, r7 + ldrh r0, [r0] + muls r0, r5 + adds r0, r4 + bl sub_805E990 +_08058AE4: + mov r2, r9 + ldr r0, [r2] + mov r2, r10 + ldrb r1, [r2] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x3 + strb r1, [r0, 0x9] + ldr r1, =0x03005d60 + mov r2, r10 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8058924 + str r1, [r0] +_08058B08: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805896C + + thumb_func_start sub_8058B40 +sub_8058B40: @ 8058B40 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r0, 0 + mov r9, r0 + mov r8, r0 + ldr r4, =0x020244d0 + ldr r0, [r4] + ldr r7, =0x02024064 + ldrb r2, [r7] + ldr r1, [r0, 0x4] + lsls r3, r2, 1 + adds r0, r3, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r5, 0x88 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _08058B80 + ldr r0, =0x0202406e + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_08058B80: + ldr r1, [r4] + ldrb r0, [r7] + movs r6, 0x2 + adds r2, r6, 0 + eors r2, r0 + ldr r1, [r1, 0x4] + lsls r3, r2, 1 + adds r0, r3, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _08058BB2 + ldr r0, =0x0202406e + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_08058BB2: + ldr r0, [r4] + ldrb r2, [r7] + ldr r3, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r4, r0, r3 + ldrb r1, [r4] + movs r5, 0x8 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _08058C82 + adds r1, r6, 0 + eors r1, r2 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r1, [r0] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _08058C82 + ldrb r1, [r4, 0x1] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08058C68 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08058C38 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08058C38 + ldr r4, =0x03005d70 + ldrb r0, [r7] + adds r1, r6, 0 + eors r1, r0 + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x020244ec + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe + ldrb r0, [r7] + eors r0, r6 + bl sub_8076918 + ldrb r0, [r7] + eors r0, r6 + adds r0, r4 + ldrb r0, [r0] + bl sub_80729D0 +_08058C38: + ldr r5, =0x03005d70 + ldr r4, =0x02024064 + ldrb r1, [r4] + adds r0, r1, r5 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x020244ec + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe + ldrb r0, [r4] + bl sub_8076918 + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + bl sub_80729D0 +_08058C68: + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0, 0x1] +_08058C82: + ldr r5, =0x020244d0 + ldr r0, [r5] + ldr r4, =0x02024064 + ldrb r2, [r4] + ldr r3, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r3 + ldrb r1, [r0, 0x1] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0x80 + bne _08058D32 + movs r1, 0x2 + eors r1, r2 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r1, [r0, 0x1] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08058D32 + bl sub_80A36C8 + lsls r0, 24 + cmp r0, 0 + bne _08058D32 + ldr r0, [r5] + ldrb r1, [r4] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _08058D14 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x42 + ands r0, r1 + cmp r0, 0x42 + bne _08058D08 + ldr r0, =0x03007420 + bl m4aMPlayContinue + b _08058D14 + .pool +_08058D08: + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl +_08058D14: + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0, 0x1] + movs r0, 0x1 + mov r9, r0 +_08058D32: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08058D52 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08058DAC + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08058DAC +_08058D52: + ldr r2, =0x02020630 + ldr r0, =0x03005d7c + ldr r1, =0x02024064 + ldrb r4, [r1] + adds r0, r4, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r3, [r0] + ldr r0, =DummyObjectCallback + cmp r3, r0 + bne _08058E0A + ldr r0, =0x020241e4 + adds r0, r4, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + cmp r0, r3 + bne _08058E0A + b _08058E06 + .pool +_08058DAC: + ldr r2, =0x02020630 + ldr r7, =0x03005d7c + ldr r0, =0x02024064 + ldrb r3, [r0] + adds r0, r3, r7 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r4, [r0] + ldr r0, =DummyObjectCallback + cmp r4, r0 + bne _08058E0A + ldr r6, =0x020241e4 + adds r0, r3, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r5, [r0] + cmp r5, r4 + bne _08058E0A + movs r0, 0x2 + eors r3, r0 + adds r0, r3, r7 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r4, [r0] + cmp r4, r5 + bne _08058E0A + adds r0, r3, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + cmp r0, r4 + bne _08058E0A +_08058E06: + movs r0, 0x1 + mov r8, r0 +_08058E0A: + mov r0, r9 + cmp r0, 0 + beq _08058EAA + mov r0, r8 + cmp r0, 0 + beq _08058EAA + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08058E48 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08058E48 + ldr r2, =0x03005d7c + ldr r0, =0x02024064 + ldrb r1, [r0] + movs r0, 0x2 + eors r0, r1 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles +_08058E48: + ldr r1, =0x03005d7c + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + ldr r3, =0x020244d0 + ldr r0, [r3] + ldr r2, [r0, 0x8] + ldrb r1, [r2, 0x9] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x9] + ldr r0, [r3] + ldrb r2, [r4] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r0, 0x21 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + ldr r0, [r3] + ldrb r2, [r4] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r0, 0x7F + ands r0, r2 + strb r0, [r1, 0x1] + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805896C + str r1, [r0] +_08058EAA: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8058B40 + + thumb_func_start sub_8058EDC +sub_8058EDC: @ 8058EDC + push {r4-r6,lr} + ldr r2, =0x02020630 + ldr r0, =0x03005d70 + ldr r6, =0x02024064 + ldrb r3, [r6] + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r4, [r0] + ldr r0, =DummyObjectCallback + cmp r4, r0 + bne _08058F94 + ldr r5, =0x020244d0 + ldr r0, [r5] + ldr r1, [r0, 0x4] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x1] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08058F94 + ldr r0, =0x020241e4 + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + cmp r0, r4 + bne _08058F94 + adds r0, r3, 0 + bl sub_805E408 + ldr r0, [r5] + ldrb r2, [r6] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x7F + ands r0, r2 + strb r0, [r1] + ldr r0, [r5] + ldrb r2, [r6] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + ldr r4, =0x000027f9 + adds r0, r4, 0 + bl FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + ldr r0, [r5] + ldrb r2, [r6] + ldr r1, [r0] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08058F88 + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x6 + bl move_anim_start_t4 +_08058F88: + ldr r0, =0x03005d60 + ldrb r1, [r6] + lsls r1, 2 + adds r1, r0 + ldr r0, =sub_8058FC0 + str r0, [r1] +_08058F94: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8058EDC + + thumb_func_start sub_8058FC0 +sub_8058FC0: @ 8058FC0 + push {r4,lr} + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r4, =0x02024064 + ldrb r1, [r4] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0805900E + bl sub_80A36C8 + lsls r0, 24 + cmp r0, 0 + bne _0805900E + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl + ldr r2, =0x0202406e + ldrb r1, [r4] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =0x020244ec + adds r0, r2 + bl sub_805E990 + bl dp01_tbl1_exec_completed +_0805900E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8058FC0 + + thumb_func_start sub_805902C +sub_805902C: @ 805902C + push {r4-r6,lr} + ldr r6, =0x020244d0 + ldr r0, [r6] + ldr r5, =0x02024064 + ldrb r2, [r5] + ldr r1, [r0, 0x4] + lsls r3, r2, 1 + adds r0, r3, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x88 + ands r0, r1 + cmp r0, 0 + bne _0805905E + ldr r0, =0x0202406e + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_0805905E: + ldr r4, =0x02020630 + ldr r0, =0x03005d7c + ldrb r2, [r5] + adds r0, r2, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r3, r0, 2 + adds r0, r4, 0 + adds r0, 0x1C + adds r0, r3, r0 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + bne _080590D2 + ldr r0, [r6] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _080590D2 + adds r0, r3, r4 + bl RemoveObjectAndFreeTiles + ldr r4, =0x03005d70 + ldrb r1, [r5] + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x020244ec + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe + ldrb r0, [r5] + bl sub_8076918 + ldrb r0, [r5] + adds r0, r4 + ldrb r0, [r0] + bl sub_80729D0 + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8058EDC + str r1, [r0] +_080590D2: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805902C + + thumb_func_start c3_0802FDF4 +c3_0802FDF4: @ 8059100 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80A36C8 + lsls r0, 24 + cmp r0, 0 + bne _08059122 + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl + adds r0, r4, 0 + bl remove_task +_08059122: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end c3_0802FDF4 + + thumb_func_start bx_t1_healthbar_update +bx_t1_healthbar_update: @ 8059130 + push {r4-r6,lr} + ldr r5, =0x02024064 + ldrb r0, [r5] + ldr r6, =0x03005d70 + adds r1, r0, r6 + ldrb r1, [r1] + movs r2, 0 + movs r3, 0 + bl sub_8074AA0 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldrb r0, [r5] + adds r0, r6 + ldrb r0, [r0] + bl sub_80729D0 + lsls r4, 16 + asrs r1, r4, 16 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08059178 + ldrb r0, [r5] + adds r0, r6 + ldrb r0, [r0] + movs r2, 0 + bl heathbar_draw_hp + b _08059192 + .pool +_08059178: + ldr r2, =0x0202406e + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =0x020244ec + adds r0, r2 + bl sub_805E990 + bl dp01_tbl1_exec_completed +_08059192: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end bx_t1_healthbar_update + + thumb_func_start sub_80591A0 +sub_80591A0: @ 80591A0 + push {lr} + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _080591B2 + bl dp01_tbl1_exec_completed +_080591B2: + pop {r0} + bx r0 + thumb_func_end sub_80591A0 + + thumb_func_start sub_80591B8 +sub_80591B8: @ 80591B8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r1, =0x03005e00 + lsls r0, 2 + add r0, r9 + lsls r0, 3 + adds r0, r1 + mov r8, r0 + ldrb r0, [r0, 0x8] + mov r10, r0 + mov r1, r8 + ldrb r7, [r1, 0xC] + str r7, [sp, 0x8] + ldrh r2, [r1, 0xA] + str r2, [sp, 0xC] + bl battle_type_is_double + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080591FE + ldr r1, =0x0202406e + lsls r0, r7, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r10, r0 + bne _080591FE + b _08059314 +_080591FE: + movs r0, 0x64 + mov r1, r10 + muls r1, r0 + ldr r0, =0x020244ec + adds r6, r1, r0 + adds r0, r6, 0 + movs r1, 0xB + bl pokemon_getattr + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r6, 0 + movs r1, 0x38 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + movs r1, 0x19 + bl pokemon_getattr + str r0, [sp, 0x4] + ldr r3, =gExperienceTables + adds r4, 0x1 + lsls r4, 2 + ldr r2, =gBaseStats + lsls r1, r5, 3 + subs r1, r5 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x13] + movs r1, 0xCA + lsls r1, 1 + muls r1, r2 + adds r4, r1 + adds r4, r3 + ldr r2, [r4] + str r2, [sp] + ldr r3, [sp, 0xC] + lsls r1, r3, 16 + asrs r1, 16 + adds r0, r1 + cmp r0, r2 + bcc _080592EC + adds r0, r6, 0 + movs r1, 0x19 + mov r2, sp + bl pokemon_setattr + adds r0, r6, 0 + bl pokemon_calc_effective_stats + ldr r2, [sp] + add r0, sp, 0x4 + ldrh r0, [r0] + subs r2, r0 + ldr r0, [sp, 0xC] + subs r2, r0, r2 + ldr r4, =0x02024064 + ldrb r5, [r4] + strb r7, [r4] + lsls r2, 16 + lsrs r2, 16 + movs r0, 0x1 + movs r1, 0xB + bl dp01_build_cmdbuf_x21_a_bb + strb r5, [r4] + bl battle_type_is_double + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080592D4 + ldr r2, =0x0202406e + lsls r0, r7, 1 + adds r0, r2 + mov r1, r10 + ldrh r0, [r0] + cmp r1, r0 + beq _080592B2 + movs r0, 0x2 + eors r7, r0 + lsls r0, r7, 1 + adds r0, r2 + ldrh r0, [r0] + cmp r1, r0 + bne _080592D4 +_080592B2: + ldr r0, =sub_8059544 + b _08059316 + .pool +_080592D4: + ldr r0, =0x03005e00 + mov r2, r9 + lsls r1, r2, 2 + add r1, r9 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_805965C + b _08059318 + .pool +_080592EC: + str r0, [sp, 0x4] + add r2, sp, 0x4 + adds r0, r6, 0 + movs r1, 0x19 + bl pokemon_setattr + ldr r1, =0x03005d60 + ldr r3, [sp, 0x8] + lsls r0, r3, 2 + adds r0, r1 + ldr r1, =sub_80591A0 + str r1, [r0] + mov r0, r9 + bl remove_task + b _0805931A + .pool +_08059314: + ldr r0, =sub_8059330 +_08059316: + mov r1, r8 +_08059318: + str r0, [r1] +_0805931A: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80591B8 + + thumb_func_start sub_8059330 +sub_8059330: @ 8059330 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005e00 + lsls r2, r0, 2 + mov r8, r2 + add r8, r0 + mov r0, r8 + lsls r0, 3 + mov r8, r0 + add r8, r1 + mov r2, r8 + ldrb r1, [r2, 0x8] + movs r0, 0xA + ldrsh r2, [r2, r0] + mov r9, r2 + mov r2, r8 + ldrb r2, [r2, 0xC] + mov r10, r2 + movs r0, 0x64 + adds r6, r1, 0 + muls r6, r0 + ldr r0, =0x020244ec + adds r6, r0 + adds r0, r6, 0 + movs r1, 0x38 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + movs r1, 0xB + bl pokemon_getattr + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r6, 0 + movs r1, 0x19 + bl pokemon_getattr + adds r3, r0, 0 + ldr r6, =gExperienceTables + lsls r1, r4, 2 + ldr r2, =gBaseStats + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r0, r2 + ldrb r2, [r0, 0x13] + movs r0, 0xCA + lsls r0, 1 + muls r0, r2 + adds r1, r0 + adds r1, r6 + ldr r1, [r1] + subs r3, r1 + adds r4, 0x1 + lsls r4, 2 + adds r4, r0 + adds r4, r6 + ldr r2, [r4] + subs r2, r1 + ldr r0, =0x03005d70 + add r0, r10 + ldrb r1, [r0] + mov r0, r9 + negs r0, r0 + str r0, [sp] + mov r0, r10 + bl sub_807294C + movs r0, 0x21 + bl audio_play + ldr r0, =sub_8059400 + mov r1, r8 + str r0, [r1] + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8059330 + + thumb_func_start sub_8059400 +sub_8059400: @ 8059400 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, =0x03005e00 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r6, r0, r1 + ldrh r1, [r6, 0x1C] + movs r2, 0x1C + ldrsh r0, [r6, r2] + cmp r0, 0xC + bgt _08059430 + adds r0, r1, 0x1 + strh r0, [r6, 0x1C] + b _0805952C + .pool +_08059430: + ldrb r0, [r6, 0x8] + mov r9, r0 + ldrh r2, [r6, 0xA] + mov r10, r2 + ldrb r7, [r6, 0xC] + ldr r5, =0x03005d70 + adds r5, r7, r5 + ldrb r1, [r5] + adds r0, r7, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_8074AA0 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldrb r0, [r5] + bl sub_80729D0 + lsls r4, 16 + asrs r4, 16 + movs r0, 0x1 + negs r0, r0 + cmp r4, r0 + bne _0805952C + movs r0, 0x21 + bl m4aSongNumStop + movs r0, 0x64 + mov r1, r9 + muls r1, r0 + ldr r0, =0x020244ec + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0x38 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x19 + bl pokemon_getattr + str r0, [sp, 0x4] + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + ldr r3, =gExperienceTables + adds r4, 0x1 + lsls r4, 2 + ldr r2, =gBaseStats + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r1, [r1, 0x13] + movs r0, 0xCA + lsls r0, 1 + muls r0, r1 + adds r4, r0 + adds r4, r3 + ldr r1, [r4] + str r1, [sp] + mov r2, r10 + lsls r0, r2, 16 + asrs r4, r0, 16 + ldr r0, [sp, 0x4] + adds r0, r4 + cmp r0, r1 + blt _08059510 + adds r0, r5, 0 + movs r1, 0x19 + mov r2, sp + bl pokemon_setattr + adds r0, r5, 0 + bl pokemon_calc_effective_stats + ldr r2, [sp] + add r0, sp, 0x4 + ldrh r0, [r0] + subs r2, r0 + subs r2, r4, r2 + ldr r4, =0x02024064 + ldrb r5, [r4] + strb r7, [r4] + lsls r2, 16 + lsrs r2, 16 + movs r0, 0x1 + movs r1, 0xB + bl dp01_build_cmdbuf_x21_a_bb + strb r5, [r4] + ldr r0, =sub_8059544 + str r0, [r6] + b _0805952C + .pool +_08059510: + str r0, [sp, 0x4] + add r2, sp, 0x4 + adds r0, r5, 0 + movs r1, 0x19 + bl pokemon_setattr + ldr r1, =0x03005d60 + lsls r0, r7, 2 + adds r0, r1 + ldr r1, =sub_80591A0 + str r1, [r0] + mov r0, r8 + bl remove_task +_0805952C: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8059400 + + thumb_func_start sub_8059544 +sub_8059544: @ 8059544 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldrb r4, [r0, 0xC] + ldrb r6, [r0, 0x8] + bl battle_type_is_double + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08059578 + ldr r1, =0x0202406e + movs r0, 0x2 + adds r2, r4, 0 + eors r2, r0 + lsls r0, r2, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r6, r0 + bne _08059578 + adds r4, r2, 0 +_08059578: + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r4, 0 + movs r3, 0 + bl move_anim_start_t4 + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80595A4 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8059544 + + thumb_func_start sub_80595A4 +sub_80595A4: @ 80595A4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r2, r0, r1 + ldrb r5, [r2, 0xC] + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08059646 + ldrb r4, [r2, 0x8] + movs r0, 0x64 + adds r1, r4, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r7, r1, r0 + adds r0, r7, 0 + movs r1, 0x38 + bl pokemon_getattr + bl battle_type_is_double + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08059624 + ldr r1, =0x0202406e + movs r0, 0x2 + adds r2, r5, 0 + eors r2, r0 + lsls r0, r2, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r4, r0 + bne _08059624 + ldr r0, =0x03005d70 + adds r0, r2, r0 + ldrb r0, [r0] + adds r1, r7, 0 + movs r2, 0 + bl healthbar_draw_field_maybe + b _08059638 + .pool +_08059624: + ldr r0, =0x03005d70 + adds r0, r5, r0 + ldrb r0, [r0] + movs r1, 0x64 + muls r1, r4 + ldr r2, =0x020244ec + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe +_08059638: + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_805965C + str r0, [r1] +_08059646: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80595A4 + + thumb_func_start sub_805965C +sub_805965C: @ 805965C + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =0x03005e00 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + ldrb r1, [r4, 0x8] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x38 + bl pokemon_getattr + ldrb r0, [r4, 0xC] + ldr r1, =0x03005d60 + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_80591A0 + str r1, [r0] + adds r0, r5, 0 + bl remove_task + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805965C + + thumb_func_start sub_80596A8 +sub_80596A8: @ 80596A8 + push {r4-r6,lr} + ldr r6, =0x02020630 + ldr r5, =0x020241e4 + ldr r4, =0x02024064 + ldrb r2, [r4] + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r3, 0x22 + ldrsh r1, [r0, r3] + movs r3, 0x26 + ldrsh r0, [r0, r3] + adds r1, r0 + cmp r1, 0xA0 + ble _08059724 + ldr r1, =0x0202406e + lsls r0, r2, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + bl nullsub_24 + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl RemoveObjectAndFreeTiles + ldr r1, =0x03005d70 + ldrb r0, [r4] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl dp01_tbl1_exec_completed +_08059724: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80596A8 + + thumb_func_start sub_8059744 +sub_8059744: @ 8059744 + push {r4-r6,lr} + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r6, =0x02024064 + ldrb r2, [r6] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08059798 + ldr r5, =0x020241e4 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl obj_free_rotscale_entry + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r1, =0x03005d70 + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl dp01_tbl1_exec_completed +_08059798: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8059744 + + thumb_func_start sub_80597B4 +sub_80597B4: @ 80597B4 + push {lr} + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _080597C6 + bl dp01_tbl1_exec_completed +_080597C6: + pop {r0} + bx r0 + thumb_func_end sub_80597B4 + + thumb_func_start sub_80597CC +sub_80597CC: @ 80597CC + push {r4,lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0805980A + ldr r1, =0x03005d60 + ldr r2, =0x02024064 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8059828 + str r1, [r0] + ldr r3, =0x03005e00 + ldr r1, =0x03005d7c + ldrb r0, [r2] + adds r0, r1 + ldrb r0, [r0] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r3 + ldrb r4, [r1, 0x8] + bl remove_task + bl FreeAllWindowBuffers + adds r0, r4, 0 + bl sub_81B89AC +_0805980A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80597CC + + thumb_func_start sub_8059828 +sub_8059828: @ 8059828 + push {lr} + ldr r0, =0x030022c0 + ldr r1, [r0, 0x4] + ldr r0, =sub_8038420 + cmp r1, r0 + bne _08059898 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08059898 + ldr r0, =0x0203cee8 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08059870 + ldr r0, =0x0203cee9 + ldrb r1, [r0] + ldr r2, =0x0203cf00 + movs r0, 0x1 + bl dp01_build_cmdbuf_x22_a_three_bytes + b _0805987A + .pool +_08059870: + movs r0, 0x1 + movs r1, 0x6 + movs r2, 0 + bl dp01_build_cmdbuf_x22_a_three_bytes +_0805987A: + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x1 + bne _08059894 + bl b_link_standby_message +_08059894: + bl dp01_tbl1_exec_completed +_08059898: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8059828 + + thumb_func_start sub_80598A4 +sub_80598A4: @ 80598A4 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080598CC + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_80598E0 + str r1, [r0] + bl nullsub_35 + bl FreeAllWindowBuffers + bl sub_81AABB0 +_080598CC: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80598A4 + + thumb_func_start sub_80598E0 +sub_80598E0: @ 80598E0 + push {lr} + ldr r0, =0x030022c0 + ldr r1, [r0, 0x4] + ldr r0, =sub_8038420 + cmp r1, r0 + bne _08059906 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08059906 + ldr r0, =0x0203ce7c + ldrh r1, [r0] + movs r0, 0x1 + bl dp01_build_cmdbuf_x23_aa_0 + bl dp01_tbl1_exec_completed +_08059906: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80598E0 + + thumb_func_start bx_wait_t1 +bx_wait_t1: @ 805991C + push {lr} + ldr r0, =0x020244b9 + ldrb r0, [r0] + cmp r0, 0 + beq _08059942 + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08059946 +_08059942: + bl dp01_tbl1_exec_completed +_08059946: + pop {r0} + bx r0 + .pool + thumb_func_end bx_wait_t1 + + thumb_func_start bx_blink_t1 +bx_blink_t1: @ 8059958 + push {r4,lr} + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + ldr r2, =0x02020630 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, r0, r2 + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0x20 + bne _080599A4 + movs r3, 0 + movs r0, 0 + strh r0, [r4, 0x30] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + subs r0, 0x5 + ands r0, r1 + strb r0, [r2] + ldr r0, =0x020244b9 + strb r3, [r0] + bl dp01_tbl1_exec_completed + b _080599CE + .pool +_080599A4: + ldrh r0, [r4, 0x30] + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _080599C8 + adds r3, r4, 0 + adds r3, 0x3E + ldrb r2, [r3] + lsls r0, r2, 29 + lsrs r0, 31 + movs r1, 0x1 + eors r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] +_080599C8: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] +_080599CE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end bx_blink_t1 + + thumb_func_start sub_80599D4 +sub_80599D4: @ 80599D4 + push {r4,lr} + sub sp, 0x4 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08059A02 + ldr r4, =0x03005d74 + ldrb r0, [r4] + cmp r0, 0 + beq _08059A02 + movs r0, 0x5 + bl audio_play + ldrb r0, [r4] + bl sub_8056BAC + movs r0, 0 + strb r0, [r4] + movs r0, 0 + bl sub_8056B74 +_08059A02: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08059A2C + ldr r4, =0x03005d74 + ldrb r0, [r4] + cmp r0, 0 + bne _08059A2C + movs r0, 0x5 + bl audio_play + ldrb r0, [r4] + bl sub_8056BAC + movs r0, 0x1 + strb r0, [r4] + movs r0, 0x1 + bl sub_8056B74 +_08059A2C: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r2, 0x1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _08059A7A + str r2, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + movs r0, 0x5 + bl audio_play + ldr r0, =0x03005d74 + ldrb r0, [r0] + cmp r0, 0 + beq _08059A6C + movs r0, 0x1 + movs r1, 0xE + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb + b _08059A76 + .pool +_08059A6C: + movs r0, 0x1 + movs r1, 0xD + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb +_08059A76: + bl dp01_tbl1_exec_completed +_08059A7A: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08059AA0 + movs r0, 0x1 + str r0, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + movs r0, 0x5 + bl audio_play + bl dp01_tbl1_exec_completed +_08059AA0: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80599D4 + + thumb_func_start sub_8059AAC +sub_8059AAC: @ 8059AAC + push {r4-r7,lr} + ldr r0, =0x02024064 + ldrb r1, [r0] + lsls r1, 9 + ldr r3, =0x02023068 + ldr r2, =0x03005d78 + movs r0, 0 + strb r0, [r2] + movs r5, 0 + ldr r7, =0x02022e2c + adds r4, r1, r3 + adds r6, r2, 0 +_08059AC4: + lsls r0, r5, 24 + lsrs r0, 24 + bl battle_menu_cursor_related + ldrh r1, [r4] + movs r0, 0xD + muls r1, r0 + ldr r0, =gMoveNames + adds r1, r0 + adds r0, r7, 0 + bl CopyString + adds r1, r5, 0x3 + lsls r1, 24 + lsrs r1, 24 + adds r0, r7, 0 + bl battle_show_message_maybe + ldrh r0, [r4] + cmp r0, 0 + beq _08059AF4 + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] +_08059AF4: + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _08059AC4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8059AAC + + thumb_func_start sub_8059B18 +sub_8059B18: @ 8059B18 + push {r4,lr} + ldr r4, =0x02022e2c + ldr r1, =gUnknown_085CCA6F + adds r0, r4, 0 + bl CopyString + adds r0, r4, 0 + movs r1, 0x7 + bl battle_show_message_maybe + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8059B18 + + thumb_func_start sub_8059B3C +sub_8059B3C: @ 8059B3C + push {r4-r7,lr} + ldr r5, =0x02023064 + ldr r7, =0x02024064 + ldrb r0, [r7] + lsls r0, 9 + adds r1, r5, 0x2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08059B98 + bl sub_814FBAC + ldrb r1, [r7] + lsls r4, r1, 9 + adds r0, r5, 0x4 + adds r4, r0 + ldr r6, =0x02022e2c + ldr r5, =0x020244b0 + adds r1, r5 + adds r0, r4, 0 + adds r0, 0x8 + ldrb r1, [r1] + adds r0, r1 + ldrb r1, [r0] + adds r0, r6, 0 + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalString + movs r1, 0xBA + strb r1, [r0] + adds r0, 0x1 + ldrb r1, [r7] + adds r1, r5 + adds r4, 0xC + ldrb r1, [r1] + adds r4, r1 + ldrb r1, [r4] + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalString + adds r0, r6, 0 + movs r1, 0x9 + bl battle_show_message_maybe +_08059B98: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8059B3C + + thumb_func_start sub_8059BB0 +sub_8059BB0: @ 8059BB0 + push {r4-r6,lr} + ldr r5, =0x02024064 + ldrb r4, [r5] + lsls r4, 9 + ldr r0, =0x02023068 + adds r4, r0 + ldr r6, =0x02022e2c + ldr r1, =gUnknown_085CCA73 + adds r0, r6, 0 + bl CopyString + movs r1, 0xFC + strb r1, [r0] + adds r0, 0x1 + movs r1, 0x6 + strb r1, [r0] + adds r0, 0x1 + movs r1, 0x1 + strb r1, [r0] + adds r0, 0x1 + ldr r3, =gBattleMoves + ldr r2, =0x020244b0 + ldrb r1, [r5] + adds r1, r2 + ldrb r1, [r1] + lsls r1, 1 + adds r4, r1 + ldrh r2, [r4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r3 + ldrb r2, [r1, 0x2] + lsls r1, r2, 3 + subs r1, r2 + ldr r2, =gTypeNames + adds r1, r2 + bl CopyString + adds r0, r6, 0 + movs r1, 0xA + bl battle_show_message_maybe + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8059BB0 + + thumb_func_start battle_menu_cursor_related_2 +battle_menu_cursor_related_2: @ 8059C28 + push {lr} + sub sp, 0x10 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + lsls r1, 24 + lsrs r1, 24 + add r2, sp, 0xC + adds r0, r1, 0x1 + strh r0, [r2] + adds r0, r2, 0 + adds r1, 0x2 + strh r1, [r0, 0x2] + movs r1, 0x1 + adds r0, r3, 0 + ands r0, r1 + lsls r2, r0, 3 + adds r2, r0 + adds r2, 0x1 + movs r0, 0x2 + ands r3, r0 + adds r3, 0x37 + str r1, [sp] + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + add r1, sp, 0xC + bl CopyToBgTilemapBufferRect_ChangePalette + movs r0, 0 + bl CopyBgTilemapBufferToVram + add sp, 0x10 + pop {r0} + bx r0 + thumb_func_end battle_menu_cursor_related_2 + + thumb_func_start battle_menu_cursor_related +battle_menu_cursor_related: @ 8059C70 + push {lr} + sub sp, 0x10 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + add r0, sp, 0xC + ldr r1, =0x00001016 + strh r1, [r0] + strh r1, [r0, 0x2] + movs r1, 0x1 + adds r0, r3, 0 + ands r0, r1 + lsls r2, r0, 3 + adds r2, r0 + adds r2, 0x1 + movs r0, 0x2 + ands r3, r0 + adds r3, 0x37 + str r1, [sp] + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + add r1, sp, 0xC + bl CopyToBgTilemapBufferRect_ChangePalette + movs r0, 0 + bl CopyBgTilemapBufferToVram + add sp, 0x10 + pop {r0} + bx r0 + .pool + thumb_func_end battle_menu_cursor_related + + thumb_func_start sub_8059CB4 +sub_8059CB4: @ 8059CB4 + push {r4,lr} + sub sp, 0x10 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + add r0, sp, 0xC + movs r4, 0x1 + strh r4, [r0] + movs r1, 0x2 + strh r1, [r0, 0x2] + adds r0, r3, 0 + ands r0, r4 + lsls r2, r0, 3 + subs r2, r0 + adds r2, 0x10 + lsls r2, 24 + lsrs r2, 24 + ands r3, r1 + adds r3, 0x23 + str r4, [sp] + str r1, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + add r1, sp, 0xC + bl CopyToBgTilemapBufferRect_ChangePalette + movs r0, 0 + bl CopyBgTilemapBufferToVram + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8059CB4 + + thumb_func_start sub_8059CF8 +sub_8059CF8: @ 8059CF8 + push {lr} + sub sp, 0x10 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + add r0, sp, 0xC + ldr r1, =0x00001016 + strh r1, [r0] + strh r1, [r0, 0x2] + movs r1, 0x1 + adds r0, r3, 0 + ands r0, r1 + lsls r2, r0, 3 + subs r2, r0 + adds r2, 0x10 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x2 + ands r3, r0 + adds r3, 0x23 + str r1, [sp] + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + add r1, sp, 0xC + bl CopyToBgTilemapBufferRect_ChangePalette + movs r0, 0 + bl CopyBgTilemapBufferToVram + add sp, 0x10 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8059CF8 + + thumb_func_start sub_8059D40 +sub_8059D40: @ 8059D40 + push {lr} + ldr r0, =sub_80A92F8 + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8059D40 + + thumb_func_start sub_8059D50 +sub_8059D50: @ 8059D50 + push {lr} + ldr r0, =sub_80A92F8 + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8059D50 + + thumb_func_start sub_8059D60 +sub_8059D60: @ 8059D60 + push {lr} + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _08059D82 + bl dp01_tbl1_exec_completed +_08059D82: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8059D60 + + thumb_func_start bx_8030B2C +bx_8030B2C: @ 8059D90 + push {lr} + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _08059DB2 + bl dp01_tbl1_exec_completed +_08059DB2: + pop {r0} + bx r0 + .pool + thumb_func_end bx_8030B2C + + thumb_func_start b_link_standby_message +b_link_standby_message: @ 8059DC0 + push {lr} + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08059DE0 + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r0, =gUnknown_085CCA29 + movs r1, 0 + bl battle_show_message_maybe +_08059DE0: + pop {r0} + bx r0 + .pool + thumb_func_end b_link_standby_message + + thumb_func_start dp01t_00_1_getattr +dp01t_00_1_getattr: @ 8059DF4 + push {r4-r6,lr} + sub sp, 0x100 + movs r6, 0 + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _08059E2C + ldr r0, =0x0202406e + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + mov r1, sp + bl dp01_getattr_by_ch1_for_player_pokemon_ + adds r6, r0, 0 + b _08059E4E + .pool +_08059E2C: + ldrb r4, [r1] + movs r5, 0 +_08059E30: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _08059E46 + lsls r0, r5, 24 + lsrs r0, 24 + mov r2, sp + adds r1, r2, r6 + bl dp01_getattr_by_ch1_for_player_pokemon_ + adds r6, r0 +_08059E46: + lsrs r4, 1 + adds r5, 0x1 + cmp r5, 0x5 + ble _08059E30 +_08059E4E: + lsls r1, r6, 16 + lsrs r1, 16 + movs r0, 0x1 + mov r2, sp + bl dp01_build_cmdbuf_x1D_1D_numargs_varargs + bl dp01_tbl1_exec_completed + add sp, 0x100 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end dp01t_00_1_getattr + + thumb_func_start dp01_getattr_by_ch1_for_player_pokemon_ +dp01_getattr_by_ch1_for_player_pokemon_: @ 8059E68 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x90 + adds r7, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + movs r6, 0 + ldr r2, =0x02023064 + ldr r3, =0x02024064 + ldrb r0, [r3] + lsls r0, 9 + adds r1, r2, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3B + bls _08059E92 + bl _0805A5FE +_08059E92: + lsls r0, 2 + ldr r1, =_08059EA8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08059EA8: + .4byte _08059F98 + .4byte _0805A1BC + .4byte _0805A1CC + .4byte _0805A1DC + .4byte _0805A244 + .4byte _0805A244 + .4byte _0805A244 + .4byte _0805A244 + .4byte _0805A260 + .4byte _0805A29C + .4byte _0805A29C + .4byte _0805A29C + .4byte _0805A29C + .4byte _0805A5FE + .4byte _0805A5FE + .4byte _0805A5FE + .4byte _0805A5FE + .4byte _0805A2B8 + .4byte _0805A2C8 + .4byte _0805A2F8 + .4byte _0805A308 + .4byte _0805A318 + .4byte _0805A328 + .4byte _0805A338 + .4byte _0805A348 + .4byte _0805A358 + .4byte _0805A368 + .4byte _0805A378 + .4byte _0805A388 + .4byte _0805A398 + .4byte _0805A3A8 + .4byte _0805A3B8 + .4byte _0805A408 + .4byte _0805A418 + .4byte _0805A428 + .4byte _0805A438 + .4byte _0805A448 + .4byte _0805A458 + .4byte _0805A468 + .4byte _0805A478 + .4byte _0805A488 + .4byte _0805A4BC + .4byte _0805A4CC + .4byte _0805A4DC + .4byte _0805A4EC + .4byte _0805A4FC + .4byte _0805A50C + .4byte _0805A51C + .4byte _0805A52C + .4byte _0805A54C + .4byte _0805A55C + .4byte _0805A56C + .4byte _0805A57C + .4byte _0805A58C + .4byte _0805A59C + .4byte _0805A5AC + .4byte _0805A5BC + .4byte _0805A5CC + .4byte _0805A5DC + .4byte _0805A5EC +_08059F98: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + mov r1, sp + strh r0, [r1] + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x2E] + movs r6, 0 + add r0, sp, 0x24 + mov r9, r0 + movs r1, 0x3B + add r1, sp + mov r10, r1 + mov r2, sp + adds r2, 0x2B + str r2, [sp, 0x80] + mov r0, sp + adds r0, 0x2A + str r0, [sp, 0x7C] + mov r1, sp + adds r1, 0x68 + str r1, [sp, 0x8C] + adds r2, 0x5 + str r2, [sp, 0x84] + adds r0, 0x12 + str r0, [sp, 0x88] + mov r8, r4 + add r4, sp, 0xC +_08059FE4: + adds r1, r6, 0 + adds r1, 0xD + mov r0, r8 + bl pokemon_getattr + strh r0, [r4] + adds r1, r6, 0 + adds r1, 0x11 + mov r0, r8 + bl pokemon_getattr + mov r2, r9 + adds r1, r2, r6 + strb r0, [r1] + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _08059FE4 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x15 + bl pokemon_getattr + mov r1, r10 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x20 + bl pokemon_getattr + ldr r2, [sp, 0x80] + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0x19 + bl pokemon_getattr + str r0, [sp, 0x44] + adds r0, r4, 0 + movs r1, 0x27 + bl pokemon_getattr + mov r3, sp + movs r5, 0x1F + ands r0, r5 + ldrb r2, [r3, 0x14] + movs r1, 0x20 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x14] + adds r0, r4, 0 + movs r1, 0x28 + bl pokemon_getattr + mov r3, sp + movs r6, 0x1F + ands r0, r6 + lsls r0, 5 + ldrh r2, [r3, 0x14] + ldr r1, =0xfffffc1f + ands r1, r2 + orrs r1, r0 + strh r1, [r3, 0x14] + adds r0, r4, 0 + movs r1, 0x29 + bl pokemon_getattr + mov r3, sp + ands r0, r5 + lsls r0, 2 + ldrb r2, [r3, 0x15] + movs r1, 0x7D + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x15] + adds r0, r4, 0 + movs r1, 0x2A + bl pokemon_getattr + movs r1, 0x1F + ands r1, r0 + lsls r1, 15 + ldr r0, [sp, 0x14] + ldr r2, =0xfff07fff + ands r0, r2 + orrs r0, r1 + str r0, [sp, 0x14] + adds r0, r4, 0 + movs r1, 0x2B + bl pokemon_getattr + mov r3, sp + ands r0, r6 + lsls r0, 4 + ldrh r2, [r3, 0x16] + ldr r1, =0xfffffe0f + ands r1, r2 + orrs r1, r0 + strh r1, [r3, 0x16] + adds r0, r4, 0 + movs r1, 0x2C + bl pokemon_getattr + mov r3, sp + ands r0, r5 + lsls r0, 1 + ldrb r2, [r3, 0x17] + movs r1, 0x3F + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x17] + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + str r0, [sp, 0x48] + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr + str r0, [sp, 0x4C] + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + ldr r1, [sp, 0x7C] + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x28] + adds r0, r4, 0 + movs r1, 0x3A + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x2C] + adds r0, r4, 0 + movs r1, 0x3B + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x2] + adds r0, r4, 0 + movs r1, 0x3C + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x4] + adds r0, r4, 0 + movs r1, 0x3D + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x6] + adds r0, r4, 0 + movs r1, 0x3E + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x8] + adds r0, r4, 0 + movs r1, 0x3F + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0xA] + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + mov r3, sp + movs r1, 0x1 + ands r0, r1 + lsls r0, 6 + ldrb r2, [r3, 0x17] + movs r1, 0x41 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x17] + adds r0, r4, 0 + movs r1, 0x2E + bl pokemon_getattr + mov r3, sp + lsls r0, 7 + ldrb r2, [r3, 0x17] + movs r1, 0x7F + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x17] + adds r0, r4, 0 + movs r1, 0x1 + bl pokemon_getattr + str r0, [sp, 0x54] + adds r0, r4, 0 + movs r1, 0x2 + ldr r2, [sp, 0x8C] + bl pokemon_getattr + ldr r0, [sp, 0x84] + ldr r1, [sp, 0x8C] + bl CopyString_Limit10 + adds r0, r4, 0 + movs r1, 0x7 + ldr r2, [sp, 0x88] + bl pokemon_getattr + mov r2, sp + movs r6, 0 +_0805A19C: + adds r0, r7, r6 + adds r1, r2, r6 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + cmp r6, 0x57 + bls _0805A19C + b _0805A5FE + .pool +_0805A1BC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + b _0805A536 + .pool +_0805A1CC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xC + b _0805A536 + .pool +_0805A1DC: + movs r6, 0 + add r2, sp, 0x58 + mov r9, r2 + add r0, sp, 0x60 + mov r10, r0 + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + mov r8, r9 +_0805A1F2: + adds r1, r6, 0 + adds r1, 0xD + adds r0, r4, 0 + bl pokemon_getattr + mov r1, r8 + strh r0, [r1] + adds r1, r6, 0 + adds r1, 0x11 + adds r0, r4, 0 + bl pokemon_getattr + mov r2, r10 + adds r1, r2, r6 + strb r0, [r1] + movs r0, 0x2 + add r8, r0 + adds r6, 0x1 + cmp r6, 0x3 + ble _0805A1F2 + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + mov r1, r9 + strb r0, [r1, 0xC] + mov r2, r9 + movs r6, 0 +_0805A230: + adds r0, r7, r6 + adds r1, r2, r6 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + cmp r6, 0xF + bls _0805A230 + b _0805A5FE + .pool +_0805A244: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x9 + b _0805A536 + .pool +_0805A260: + movs r6, 0 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r2, =0x020244ec + mov r8, r2 +_0805A26C: + adds r1, r6, 0 + adds r1, 0x11 + mov r2, r8 + adds r0, r4, r2 + bl pokemon_getattr + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + cmp r6, 0x3 + ble _0805A26C + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + b _0805A5FE + .pool +_0805A29C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x8 + b _0805A5F6 + .pool +_0805A2B8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1 + b _0805A2D2 + .pool +_0805A2C8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x19 +_0805A2D2: + bl pokemon_getattr + adds r1, r0, 0 + strb r1, [r7] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + lsrs r0, 8 + strb r0, [r7, 0x1] + movs r0, 0xFF + lsls r0, 16 + ands r0, r1 + lsrs r0, 16 + strb r0, [r7, 0x2] + movs r6, 0x3 + b _0805A5FE + .pool +_0805A2F8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1A + b _0805A5F6 + .pool +_0805A308: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1B + b _0805A5F6 + .pool +_0805A318: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1C + b _0805A5F6 + .pool +_0805A328: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1D + b _0805A5F6 + .pool +_0805A338: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1E + b _0805A5F6 + .pool +_0805A348: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1F + b _0805A5F6 + .pool +_0805A358: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x20 + b _0805A5F6 + .pool +_0805A368: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x22 + b _0805A5F6 + .pool +_0805A378: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x23 + b _0805A5F6 + .pool +_0805A388: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x24 + b _0805A5F6 + .pool +_0805A398: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x25 + b _0805A5F6 + .pool +_0805A3A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x26 + b _0805A5F6 + .pool +_0805A3B8: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x27 + bl pokemon_getattr + strb r0, [r7] + adds r0, r4, 0 + movs r1, 0x28 + bl pokemon_getattr + strb r0, [r7, 0x1] + adds r0, r4, 0 + movs r1, 0x29 + bl pokemon_getattr + strb r0, [r7, 0x2] + adds r0, r4, 0 + movs r1, 0x2A + bl pokemon_getattr + strb r0, [r7, 0x3] + adds r0, r4, 0 + movs r1, 0x2B + bl pokemon_getattr + strb r0, [r7, 0x4] + adds r0, r4, 0 + movs r1, 0x2C + bl pokemon_getattr + strb r0, [r7, 0x5] + movs r6, 0x6 + b _0805A5FE + .pool +_0805A408: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x27 + b _0805A5F6 + .pool +_0805A418: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x28 + b _0805A5F6 + .pool +_0805A428: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x29 + b _0805A5F6 + .pool +_0805A438: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2A + b _0805A5F6 + .pool +_0805A448: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2B + b _0805A5F6 + .pool +_0805A458: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2C + b _0805A5F6 + .pool +_0805A468: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0 + b _0805A492 + .pool +_0805A478: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x9 + b _0805A536 + .pool +_0805A488: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x37 +_0805A492: + bl pokemon_getattr + adds r1, r0, 0 + strb r1, [r7] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + lsrs r0, 8 + strb r0, [r7, 0x1] + movs r0, 0xFF + lsls r0, 16 + ands r0, r1 + lsrs r0, 16 + strb r0, [r7, 0x2] + lsrs r0, r1, 24 + strb r0, [r7, 0x3] + movs r6, 0x4 + b _0805A5FE + .pool +_0805A4BC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x38 + b _0805A5F6 + .pool +_0805A4CC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x39 + b _0805A536 + .pool +_0805A4DC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3A + b _0805A536 + .pool +_0805A4EC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3B + b _0805A536 + .pool +_0805A4FC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3C + b _0805A536 + .pool +_0805A50C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3D + b _0805A536 + .pool +_0805A51C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3E + b _0805A536 + .pool +_0805A52C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3F +_0805A536: + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + strb r0, [r7] + lsrs r0, 8 + strb r0, [r7, 0x1] + movs r6, 0x2 + b _0805A5FE + .pool +_0805A54C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x16 + b _0805A5F6 + .pool +_0805A55C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x17 + b _0805A5F6 + .pool +_0805A56C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x18 + b _0805A5F6 + .pool +_0805A57C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x21 + b _0805A5F6 + .pool +_0805A58C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2F + b _0805A5F6 + .pool +_0805A59C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x30 + b _0805A5F6 + .pool +_0805A5AC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x32 + b _0805A5F6 + .pool +_0805A5BC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x33 + b _0805A5F6 + .pool +_0805A5CC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x34 + b _0805A5F6 + .pool +_0805A5DC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x35 + b _0805A5F6 + .pool +_0805A5EC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x36 +_0805A5F6: + bl pokemon_getattr + strb r0, [r7] + movs r6, 0x1 +_0805A5FE: + adds r0, r6, 0 + add sp, 0x90 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end dp01_getattr_by_ch1_for_player_pokemon_ + + thumb_func_start sub_805A614 +sub_805A614: @ 805A614 + push {r4-r7,lr} + sub sp, 0x58 + ldr r2, =0x0202406e + ldr r5, =0x02024064 + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + adds r4, r2, 0 + muls r4, r0 + ldr r3, =0x02023064 + lsls r1, 9 + adds r0, r3, 0x1 + adds r0, r1, r0 + ldrb r2, [r0] + ldr r0, =0x020244ec + adds r0, r2, r0 + adds r6, r4, r0 + mov r0, sp + adds r4, r0, r2 + movs r2, 0 + adds r0, r3, 0x2 + adds r1, r0 + adds r7, r5, 0 + mov r12, r3 + ldrb r1, [r1] + cmp r2, r1 + bcs _0805A66A + adds r3, r0, 0 +_0805A650: + adds r1, r4, r2 + adds r0, r6, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + ldrb r0, [r5] + lsls r0, 9 + adds r0, r3 + ldrb r0, [r0] + cmp r2, r0 + bcc _0805A650 +_0805A66A: + ldrb r0, [r7] + lsls r0, 9 + mov r1, r12 + adds r1, 0x2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + adds r2, r4, 0 + bl dp01_build_cmdbuf_x1D_1D_numargs_varargs + bl dp01_tbl1_exec_completed + add sp, 0x58 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805A614 + + thumb_func_start dp01t_02_1_setattr +dp01t_02_1_setattr: @ 805A69C + push {r4,r5,lr} + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _0805A6CC + ldr r0, =0x0202406e + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + bl dp01_setattr_by_ch1_for_player_pokemon + b _0805A6EA + .pool +_0805A6CC: + ldrb r4, [r1] + movs r5, 0 +_0805A6D0: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0805A6DE + adds r0, r5, 0 + bl dp01_setattr_by_ch1_for_player_pokemon +_0805A6DE: + lsrs r4, 1 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _0805A6D0 +_0805A6EA: + bl dp01_tbl1_exec_completed + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end dp01t_02_1_setattr + + thumb_func_start dp01_setattr_by_ch1_for_player_pokemon +dp01_setattr_by_ch1_for_player_pokemon: @ 805A6F4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x34 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 9 + ldr r2, =0x02023067 + adds r3, r0, r2 + adds r6, r3, 0 + subs r1, r2, 0x2 + adds r0, r1 + ldrb r0, [r0] + adds r7, r2, 0 + cmp r0, 0x3B + bls _0805A720 + bl _0805B0BA +_0805A720: + lsls r0, 2 + ldr r1, =_0805A738 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0805A738: + .4byte _0805A828 + .4byte _0805A9C0 + .4byte _0805A9E0 + .4byte _0805AA00 + .4byte _0805AA58 + .4byte _0805AA58 + .4byte _0805AA58 + .4byte _0805AA58 + .4byte _0805AA80 + .4byte _0805AAE4 + .4byte _0805AAE4 + .4byte _0805AAE4 + .4byte _0805AAE4 + .4byte _0805B0BA + .4byte _0805B0BA + .4byte _0805B0BA + .4byte _0805B0BA + .4byte _0805AB14 + .4byte _0805AB34 + .4byte _0805AB54 + .4byte _0805AB74 + .4byte _0805AB94 + .4byte _0805ABB4 + .4byte _0805ABD4 + .4byte _0805ABF4 + .4byte _0805AC14 + .4byte _0805AC34 + .4byte _0805AC54 + .4byte _0805AC74 + .4byte _0805AC94 + .4byte _0805ACB4 + .4byte _0805ACD4 + .4byte _0805AD44 + .4byte _0805AD64 + .4byte _0805AD84 + .4byte _0805ADA4 + .4byte _0805ADC4 + .4byte _0805ADE4 + .4byte _0805AE04 + .4byte _0805AE24 + .4byte _0805AE44 + .4byte _0805AE64 + .4byte _0805AE84 + .4byte _0805AEA4 + .4byte _0805AEC4 + .4byte _0805AEE4 + .4byte _0805AF04 + .4byte _0805AF24 + .4byte _0805AF44 + .4byte _0805AF64 + .4byte _0805AF84 + .4byte _0805AFA4 + .4byte _0805AFC4 + .4byte _0805AFE4 + .4byte _0805B004 + .4byte _0805B024 + .4byte _0805B044 + .4byte _0805B064 + .4byte _0805B084 + .4byte _0805B0A4 +_0805A828: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + adds r2, r6, 0 + bl pokemon_setattr + adds r2, r6, 0 + adds r2, 0x2E + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_setattr + movs r0, 0 + mov r8, r0 + movs r0, 0x3B + adds r0, r6 + mov r10, r0 + adds r0, r6, 0 + adds r0, 0x2B + str r0, [sp, 0x20] + adds r0, 0x19 + str r0, [sp, 0x28] + adds r0, 0x4 + str r0, [sp, 0x2C] + adds r0, 0x4 + str r0, [sp, 0x30] + subs r0, 0x22 + str r0, [sp, 0x1C] + subs r0, 0x2 + str r0, [sp, 0x18] + adds r0, 0x4 + str r0, [sp, 0x24] + adds r0, r6, 0x2 + str r0, [sp, 0x4] + adds r0, r6, 0x4 + str r0, [sp, 0x8] + adds r0, r6, 0x6 + str r0, [sp, 0xC] + adds r0, 0x2 + str r0, [sp, 0x10] + adds r0, 0x2 + str r0, [sp, 0x14] + mov r9, r4 + adds r7, r6, 0 + adds r7, 0x24 + adds r4, r6, 0 + adds r4, 0xC +_0805A88E: + mov r1, r8 + adds r1, 0xD + mov r0, r9 + adds r2, r4, 0 + bl pokemon_setattr + mov r1, r8 + adds r1, 0x11 + mov r0, r9 + adds r2, r7, 0 + bl pokemon_setattr + adds r7, 0x1 + adds r4, 0x2 + movs r0, 0x1 + add r8, r0 + mov r0, r8 + cmp r0, 0x3 + ble _0805A88E + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x15 + mov r2, r10 + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x20 + ldr r2, [sp, 0x20] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x19 + ldr r2, [sp, 0x28] + bl pokemon_setattr + ldrb r0, [r6, 0x14] + lsls r0, 27 + lsrs r0, 27 + mov r1, sp + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x27 + mov r2, sp + bl pokemon_setattr + mov r1, sp + ldrh r0, [r6, 0x14] + lsls r0, 22 + lsrs r0, 27 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x28 + mov r2, sp + bl pokemon_setattr + mov r1, sp + ldrb r0, [r6, 0x15] + lsls r0, 25 + lsrs r0, 27 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x29 + mov r2, sp + bl pokemon_setattr + mov r1, sp + ldr r0, [r6, 0x14] + lsls r0, 12 + lsrs r0, 27 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x2A + mov r2, sp + bl pokemon_setattr + mov r1, sp + ldrh r0, [r6, 0x16] + lsls r0, 23 + lsrs r0, 27 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x2B + mov r2, sp + bl pokemon_setattr + mov r1, sp + ldrb r0, [r6, 0x17] + lsls r0, 26 + lsrs r0, 27 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x2C + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0 + ldr r2, [sp, 0x2C] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x37 + ldr r2, [sp, 0x30] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x38 + ldr r2, [sp, 0x1C] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x39 + ldr r2, [sp, 0x18] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3A + ldr r2, [sp, 0x24] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3B + ldr r2, [sp, 0x4] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3C + ldr r2, [sp, 0x8] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3D + ldr r2, [sp, 0xC] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3E + ldr r2, [sp, 0x10] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3F + ldr r2, [sp, 0x14] + bl pokemon_setattr + b _0805B0BA + .pool +_0805A9C0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0xB + bl pokemon_setattr + b _0805B0BA + .pool +_0805A9E0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0xC + bl pokemon_setattr + b _0805B0BA + .pool +_0805AA00: + movs r0, 0 + mov r8, r0 + movs r0, 0xC + adds r0, r3 + mov r9, r0 + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r7, r1, r0 + adds r6, r3, 0 + adds r6, 0x8 + adds r4, r3, 0 +_0805AA1A: + mov r1, r8 + adds r1, 0xD + adds r0, r7, 0 + adds r2, r4, 0 + bl pokemon_setattr + mov r1, r8 + adds r1, 0x11 + adds r0, r7, 0 + adds r2, r6, 0 + bl pokemon_setattr + adds r6, 0x1 + adds r4, 0x2 + movs r0, 0x1 + add r8, r0 + mov r0, r8 + cmp r0, 0x3 + ble _0805AA1A + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x15 + mov r2, r9 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AA58: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r3, =0x02023064 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x9 + b _0805AAFC + .pool +_0805AA80: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + ldr r5, =0x02024064 + ldrb r2, [r5] + lsls r2, 9 + adds r2, r7 + adds r0, r4, 0 + movs r1, 0x11 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x1 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x12 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x2 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x13 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x3 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x14 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x4 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x15 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AAE4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r3, =0x02023064 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x8 +_0805AAFC: + adds r3, 0x3 + adds r2, r3 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AB14: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AB34: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x19 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AB54: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1A + bl pokemon_setattr + b _0805B0BA + .pool +_0805AB74: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1B + bl pokemon_setattr + b _0805B0BA + .pool +_0805AB94: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1C + bl pokemon_setattr + b _0805B0BA + .pool +_0805ABB4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1D + bl pokemon_setattr + b _0805B0BA + .pool +_0805ABD4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1E + bl pokemon_setattr + b _0805B0BA + .pool +_0805ABF4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1F + bl pokemon_setattr + b _0805B0BA + .pool +_0805AC14: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x20 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AC34: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x22 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AC54: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x23 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AC74: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x24 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AC94: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x25 + bl pokemon_setattr + b _0805B0BA + .pool +_0805ACB4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x26 + bl pokemon_setattr + b _0805B0BA + .pool +_0805ACD4: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + ldr r5, =0x02024064 + ldrb r2, [r5] + lsls r2, 9 + adds r2, r7 + adds r0, r4, 0 + movs r1, 0x27 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x1 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x28 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x2 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x29 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x3 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x2A + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x4 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x2B + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x5 + adds r2, r0 + adds r0, r4, 0 + b _0805ADF4 + .pool +_0805AD44: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x27 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AD64: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x28 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AD84: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x29 + bl pokemon_setattr + b _0805B0BA + .pool +_0805ADA4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2A + bl pokemon_setattr + b _0805B0BA + .pool +_0805ADC4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2B + bl pokemon_setattr + b _0805B0BA + .pool +_0805ADE4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 +_0805ADF4: + movs r1, 0x2C + bl pokemon_setattr + b _0805B0BA + .pool +_0805AE04: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AE24: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x9 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AE44: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x37 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AE64: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x38 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AE84: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x39 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AEA4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3A + bl pokemon_setattr + b _0805B0BA + .pool +_0805AEC4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3B + bl pokemon_setattr + b _0805B0BA + .pool +_0805AEE4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3C + bl pokemon_setattr + b _0805B0BA + .pool +_0805AF04: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3D + bl pokemon_setattr + b _0805B0BA + .pool +_0805AF24: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3E + bl pokemon_setattr + b _0805B0BA + .pool +_0805AF44: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3F + bl pokemon_setattr + b _0805B0BA + .pool +_0805AF64: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x16 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AF84: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x17 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AFA4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x18 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AFC4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x21 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AFE4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2F + bl pokemon_setattr + b _0805B0BA + .pool +_0805B004: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x30 + bl pokemon_setattr + b _0805B0BA + .pool +_0805B024: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x32 + bl pokemon_setattr + b _0805B0BA + .pool +_0805B044: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x33 + bl pokemon_setattr + b _0805B0BA + .pool +_0805B064: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x34 + bl pokemon_setattr + b _0805B0BA + .pool +_0805B084: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x35 + bl pokemon_setattr + b _0805B0BA + .pool +_0805B0A4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x36 + bl pokemon_setattr +_0805B0BA: + ldr r2, =0x0202406e + ldr r0, =0x02024064 + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =0x020244ec + adds r0, r2 + bl sub_805E990 + add sp, 0x34 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_setattr_by_ch1_for_player_pokemon + + thumb_func_start sub_805B0F0 +sub_805B0F0: @ 805B0F0 + push {r4-r7,lr} + ldr r1, =0x0202406e + ldr r7, =0x02024064 + ldrb r2, [r7] + lsls r0, r2, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + adds r3, r1, 0 + muls r3, r0 + ldr r4, =0x02023064 + lsls r2, 9 + adds r0, r4, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + ldr r1, =0x020244ec + adds r0, r1 + adds r5, r3, r0 + movs r3, 0 + adds r0, r4, 0x2 + adds r2, r0 + ldrb r2, [r2] + cmp r3, r2 + bcs _0805B148 + adds r6, r4, 0 + adds r2, r7, 0 + adds r4, r0, 0 +_0805B126: + adds r1, r5, r3 + ldrb r0, [r2] + lsls r0, 9 + adds r0, 0x3 + adds r0, r3, r0 + adds r0, r6 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + ldrb r0, [r2] + lsls r0, 9 + adds r0, r4 + ldrb r0, [r0] + cmp r3, r0 + bcc _0805B126 +_0805B148: + bl dp01_tbl1_exec_completed + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805B0F0 + + thumb_func_start sub_805B164 +sub_805B164: @ 805B164 + push {r4,lr} + ldr r2, =0x0202406e + ldr r4, =0x02024064 + ldrb r1, [r4] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =0x020244ec + adds r0, r2 + bl sub_805DD7C + ldr r2, =0x02020630 + ldr r0, =0x020241e4 + ldrb r3, [r4] + adds r0, r3, r0 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + lsls r3, 4 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x5] + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_0802E404 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805B164 + + thumb_func_start sub_805B1CC +sub_805B1CC: @ 805B1CC + push {r4-r6,lr} + ldr r5, =0x02024064 + ldrb r0, [r5] + ldr r4, =0x02023064 + lsls r1, r0, 9 + adds r6, r4, 0x2 + adds r1, r6 + ldrb r1, [r1] + bl sub_805EF84 + ldr r2, =0x0202406e + ldrb r0, [r5] + lsls r1, r0, 1 + adds r1, r2 + lsls r0, 9 + adds r4, 0x1 + adds r0, r4 + ldrb r0, [r0] + movs r4, 0 + strh r0, [r1] + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =0x020244ec + adds r0, r2 + bl sub_805DD7C + ldr r1, =0x020244ac + ldrb r0, [r5] + adds r0, r1 + strb r4, [r0] + ldr r1, =0x020244b0 + ldrb r0, [r5] + adds r0, r1 + strb r4, [r0] + ldrb r0, [r5] + lsls r1, r0, 9 + adds r1, r6 + ldrb r1, [r1] + bl sub_805B258 + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805902C + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805B1CC + + thumb_func_start sub_805B258 +sub_805B258: @ 805B258 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + bl sub_805EF84 + ldr r0, =0x0202406e + lsls r2, r6, 1 + adds r2, r0 + ldr r0, =0x02023064 + lsls r1, r6, 9 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + strh r0, [r2] + ldrh r1, [r2] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + mov r8, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, =sub_805D714 + bl object_new_hidden_with_callback + ldr r1, =0x03005d7c + mov r9, r1 + add r9, r6 + mov r1, r9 + strb r0, [r1] + adds r0, r6, 0 + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, r8 + bl sub_806A068 + ldr r0, =0x0202499c + mov r10, r0 + adds r0, r6, 0 + movs r1, 0x2 + bl sub_80A5C6C + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r6, 0 + bl sub_80A6138 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + bl sub_80A82E4 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + mov r0, r10 + adds r1, r5, 0 + adds r2, r4, 0 + bl AddObjectToFront + ldr r4, =0x020241e4 + adds r4, r6, r4 + strb r0, [r4] + ldr r5, =0x02020630 + mov r0, r9 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r1, [r4] + strh r1, [r0, 0x30] + mov r0, r9 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r6, [r0, 0x32] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r6, [r0, 0x2E] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + mov r1, r8 + strh r1, [r0, 0x32] + ldrb r0, [r4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + lsls r3, r6, 4 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x5] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =0x020244e4 + adds r6, r1 + ldrb r1, [r6] + bl StartObjectImageAnim + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r5, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =DummyObjectCallback + str r1, [r0] + movs r0, 0 + movs r1, 0xFF + bl sub_80753E8 + mov r1, r9 + ldrb r2, [r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r5 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0x2E] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805B258 + + thumb_func_start sub_805B3D4 +sub_805B3D4: @ 805B3D4 + push {r4-r6,lr} + ldr r1, =0x02023064 + ldr r6, =0x02024064 + ldrb r2, [r6] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r3, [r0] + cmp r3, 0 + bne _0805B41C + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + strb r3, [r0, 0x4] + ldr r1, =0x03005d60 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805B464 + str r1, [r0] + b _0805B452 + .pool +_0805B41C: + ldr r5, =0x020241e4 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl obj_free_rotscale_entry + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r1, =0x03005d70 + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl dp01_tbl1_exec_completed +_0805B452: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805B3D4 + + thumb_func_start sub_805B464 +sub_805B464: @ 805B464 + push {r4-r6,lr} + ldr r6, =0x020244d0 + ldr r4, [r6] + ldr r5, =0x02024064 + ldrb r2, [r5] + ldr r1, [r4, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r3, r0, r1 + ldrb r0, [r3, 0x4] + cmp r0, 0 + beq _0805B48C + cmp r0, 0x1 + beq _0805B4BA + b _0805B4E2 + .pool +_0805B48C: + ldr r1, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0805B4A6 + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_0805B4A6: + ldr r0, [r6] + ldrb r1, [r5] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x1 + strb r1, [r0, 0x4] + b _0805B4E2 +_0805B4BA: + ldrb r1, [r3] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0805B4E2 + strb r0, [r3, 0x4] + ldrb r2, [r5] + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x1 + bl move_anim_start_t4 + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8059744 + str r1, [r0] +_0805B4E2: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805B464 + + thumb_func_start sub_805B4F0 +sub_805B4F0: @ 805B4F0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0805B5B4 + bl link_get_multiplayer_id + ldr r5, =0x020229e8 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + movs r4, 0xFF + ldrb r0, [r1] + cmp r0, 0x4 + beq _0805B538 + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrh r1, [r1] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0x5 + bne _0805B558 +_0805B538: + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r0, [r1, 0x13] + adds r4, r0, 0x2 + b _0805B5BA + .pool +_0805B558: + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrh r1, [r1] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0x2 + beq _0805B58A + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrh r0, [r1] + ands r4, r0 + cmp r4, 0x1 + bne _0805B5A0 +_0805B58A: + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r0, [r1, 0x13] + adds r4, r0, 0x4 + b _0805B5BA +_0805B5A0: + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r4, [r1, 0x13] + b _0805B5BA +_0805B5B4: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r4, [r0, 0x8] +_0805B5BA: + ldr r0, =0x02022fec + ldr r1, [r0] + movs r2, 0x40 + ands r1, r2 + adds r5, r0, 0 + cmp r1, 0 + beq _0805B63C + ldr r0, =0x02024064 + ldrb r0, [r0] + bl battle_get_per_side_status + movs r1, 0x2 + ands r1, r0 + movs r0, 0x20 + mov r9, r0 + cmp r1, 0 + beq _0805B5E0 + movs r1, 0x5A + mov r9, r1 +_0805B5E0: + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _0805B618 + ldr r0, =0x02038bce + ldrh r1, [r0] + ldr r0, =0x00000c03 + cmp r1, r0 + beq _0805B618 + movs r0, 0x5A + mov r9, r0 + ldr r1, =gUnknown_083054E0 + b _0805B642 + .pool +_0805B618: + ldr r1, =gUnknown_08305D2C + lsls r0, r4, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x8 + subs r0, r1 + lsls r0, 18 + movs r1, 0xA0 + lsls r1, 15 + adds r0, r1 + lsrs r7, r0, 16 + ldr r5, =0x02022fec + b _0805B656 + .pool +_0805B63C: + movs r0, 0x50 + mov r9, r0 + ldr r1, =gUnknown_08305D2C +_0805B642: + lsls r0, r4, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x8 + subs r0, r1 + lsls r0, 18 + movs r1, 0xA0 + lsls r1, 15 + adds r0, r1 + lsrs r7, r0, 16 +_0805B656: + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + bne _0805B664 + b _0805B794 +_0805B664: + ldr r0, =0x02038bce + ldrh r1, [r0] + ldr r0, =0x00000c03 + cmp r1, r0 + bne _0805B670 + b _0805B794 +_0805B670: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + bl sub_806F000 + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + ldr r6, =0x02024064 + ldrb r1, [r6] + adds r0, r5, 0 + bl sub_805DF38 + ldrb r0, [r6] + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl sub_806A1C0 + ldr r0, =0x0202499c + mov r8, r0 + lsls r4, r7, 16 + asrs r4, 16 + ldrb r0, [r6] + bl sub_80A82E4 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + mov r0, r8 + mov r1, r9 + adds r2, r4, 0 + bl AddObjectToFront + ldr r4, =0x020241e4 + ldrb r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r0, =gTrainerFrontPicPaletteTable + lsls r5, 3 + adds r5, r0 + ldrh r0, [r5, 0x4] + bl IndexOfObjectPaletteTag + ldr r5, =0x02020630 + ldrb r1, [r6] + adds r1, r4 + ldrb r1, [r1] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r5 + lsls r0, 4 + ldrb r3, [r2, 0x5] + movs r1, 0xF + ands r1, r3 + orrs r1, r0 + strb r1, [r2, 0x5] + ldrb r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0xF0 + strh r1, [r0, 0x24] + ldrb r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x30 + strh r1, [r0, 0x26] + ldrb r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =0x0000fffe + strh r1, [r0, 0x2E] + ldrb r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r5, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_805D7AC + str r1, [r0] + ldrb r0, [r6] + adds r0, r4 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r2, [r1, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + ldrb r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3F + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] + b _0805B82A + .pool +_0805B794: + ldr r5, =0x02024064 + ldrb r1, [r5] + adds r0, r4, 0 + bl sub_805DF84 + ldrb r0, [r5] + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl template_build_for_pokemon_or_trainer + ldr r6, =0x0202499c + mov r8, r9 + lsls r4, r7, 16 + asrs r4, 16 + ldrb r0, [r5] + bl sub_80A82E4 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r6, 0 + mov r1, r8 + adds r2, r4, 0 + bl AddObjectToFront + ldr r6, =0x020241e4 + ldrb r1, [r5] + adds r1, r6 + strb r0, [r1] + ldr r4, =0x02020630 + ldrb r3, [r5] + adds r0, r3, r6 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + lsls r3, 4 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x5] + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xF0 + strh r1, [r0, 0x24] + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =0x0000fffe + strh r1, [r0, 0x2E] + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, 0x1C + adds r0, r4 + ldr r1, =sub_805D7AC + str r1, [r0] +_0805B82A: + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8058844 + str r1, [r0] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805B4F0 + + thumb_func_start dp01t_08_1_8032428 +dp01t_08_1_8032428: @ 805B864 + push {r4-r6,lr} + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0805B920 + bl link_get_multiplayer_id + ldr r5, =0x020229e8 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + movs r4, 0xFF + ldrb r0, [r1] + cmp r0, 0x4 + beq _0805B8A6 + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrh r1, [r1] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0x5 + bne _0805B8C4 +_0805B8A6: + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r0, [r1, 0x13] + adds r4, r0, 0x2 + b _0805B926 + .pool +_0805B8C4: + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrh r1, [r1] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0x2 + beq _0805B8F6 + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrh r0, [r1] + ands r4, r0 + cmp r4, 0x1 + bne _0805B90C +_0805B8F6: + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r0, [r1, 0x13] + adds r4, r0, 0x4 + b _0805B926 +_0805B90C: + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r4, [r1, 0x13] + b _0805B926 +_0805B920: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r4, [r0, 0x8] +_0805B926: + ldr r5, =0x02024064 + ldrb r1, [r5] + adds r0, r4, 0 + bl sub_805DF84 + ldrb r0, [r5] + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl template_build_for_pokemon_or_trainer + ldr r0, =0x0202499c + ldr r1, =gUnknown_08305D2C + lsls r4, 2 + adds r4, r1 + ldrb r1, [r4] + movs r2, 0x8 + subs r2, r1 + lsls r2, 18 + movs r1, 0xA0 + lsls r1, 15 + adds r2, r1 + asrs r2, 16 + movs r1, 0x50 + movs r3, 0x1E + bl AddObjectToFront + ldr r6, =0x020241e4 + ldrb r1, [r5] + adds r1, r6 + strb r0, [r1] + ldr r4, =0x02020630 + ldrb r3, [r5] + adds r0, r3, r6 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + lsls r3, 4 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x5] + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =0x0000ffa0 + strh r1, [r0, 0x24] + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x2 + strh r1, [r0, 0x2E] + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, 0x1C + adds r0, r4 + ldr r1, =sub_805D7AC + str r1, [r0] + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805887C + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_08_1_8032428 + + thumb_func_start sub_805B9F8 +sub_805B9F8: @ 805B9F8 + push {r4-r6,lr} + ldr r5, =0x020241e4 + ldr r6, =0x02024064 + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl oamt_add_pos2_onto_pos1 + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x32 + strh r1, [r0, 0x2E] + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =0x0000ffd8 + strh r1, [r0, 0x32] + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x22] + strh r1, [r0, 0x36] + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_80A6EEC + str r1, [r0] + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =DummyObjectCallback + bl oamt_set_x3A_32 + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl StartObjectImageAnim + ldr r1, =0x03005d60 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_802F7A0 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805B9F8 + + thumb_func_start sub_805BAB8 +sub_805BAB8: @ 805BAB8 + push {r4-r6,lr} + ldr r6, =0x020244d0 + ldr r4, [r6] + ldr r5, =0x02024064 + ldrb r2, [r5] + ldr r0, [r4, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r3, r1, r0 + ldrb r0, [r3, 0x4] + cmp r0, 0 + bne _0805BB0C + ldr r1, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0805BAEC + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_0805BAEC: + ldr r0, [r6] + ldrb r1, [r5] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x4] + adds r1, 0x1 + strb r1, [r0, 0x4] + b _0805BB82 + .pool +_0805BB0C: + ldrb r1, [r3] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0805BB82 + strb r4, [r3, 0x4] + ldr r2, =0x0202406e + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =0x020244ec + adds r0, r2 + bl sub_805E990 + movs r1, 0x40 + negs r1, r1 + movs r0, 0x10 + bl audio_play_and_stuff + ldr r2, =0x02020630 + ldr r3, =0x020241e4 + ldrb r0, [r5] + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r4, [r0, 0x30] + ldrb r0, [r5] + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x5 + strh r1, [r0, 0x32] + ldrb r0, [r5] + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_8039C00 + str r1, [r0] + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_80596A8 + str r1, [r0] +_0805BB82: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805BAB8 + + thumb_func_start sub_805BBA4 +sub_805BBA4: @ 805BBA4 + push {lr} + sub sp, 0x4 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r1, 0x2 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + bl dp01_tbl1_exec_completed + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_805BBA4 + + thumb_func_start sub_805BBC4 +sub_805BBC4: @ 805BBC4 + push {r4,r5,lr} + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0, 0x8] + movs r0, 0x4 + strb r0, [r1, 0x8] + ldr r1, =0x020244b9 + movs r0, 0x1 + strb r0, [r1] + ldr r5, =0x02024064 + ldrb r4, [r5] + movs r0, 0x1 + bl battle_get_side_with_given_state + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r4, 0 + movs r3, 0x3 + bl move_anim_start_t4 + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_wait_t1 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805BBC4 + + thumb_func_start sub_805BC18 +sub_805BC18: @ 805BC18 + push {r4,r5,lr} + ldr r1, =0x02023064 + ldr r5, =0x02024064 + ldrb r0, [r5] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r1, [r0] + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + strb r1, [r0, 0x8] + ldr r1, =0x020244b9 + movs r0, 0x1 + strb r0, [r1] + ldrb r4, [r5] + movs r0, 0x1 + bl battle_get_side_with_given_state + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r4, 0 + movs r3, 0x3 + bl move_anim_start_t4 + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_wait_t1 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805BC18 + + thumb_func_start sub_805BC78 +sub_805BC78: @ 805BC78 + push {lr} + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0805BC96 +_0805BC8C: + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0805BC8C +_0805BC96: + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_805BC78 + + thumb_func_start dp01t_0F_1_move_anim +dp01t_0F_1_move_anim: @ 805BCA8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r5, =0x02024064 + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + beq _0805BCBE + b _0805BDE4 +_0805BCBE: + ldr r0, =0x02023064 + mov r12, r0 + ldrb r1, [r5] + lsls r1, 9 + adds r0, 0x1 + adds r0, r1, r0 + ldrb r6, [r0] + mov r0, r12 + adds r0, 0x2 + adds r0, r1, r0 + ldrb r0, [r0] + lsls r0, 8 + orrs r6, r0 + ldr r0, =0x02038432 + mov r8, r0 + mov r0, r12 + adds r0, 0x3 + adds r1, r0 + ldrb r0, [r1] + mov r1, r8 + strb r0, [r1] + ldr r3, =0x02038408 + ldrb r1, [r5] + lsls r1, 9 + mov r0, r12 + adds r0, 0x4 + adds r0, r1, r0 + ldrb r2, [r0] + mov r0, r12 + adds r0, 0x5 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 8 + orrs r2, r0 + strh r2, [r3] + ldr r3, =0x02038404 + ldrb r1, [r5] + lsls r1, 9 + mov r0, r12 + adds r0, 0x6 + adds r0, r1, r0 + ldrb r2, [r0] + mov r0, r12 + adds r0, 0x7 + adds r0, r1, r0 + ldrb r0, [r0] + lsls r0, 8 + orrs r2, r0 + mov r0, r12 + adds r0, 0x8 + adds r0, r1, r0 + ldrb r0, [r0] + lsls r0, 16 + orrs r2, r0 + mov r0, r12 + adds r0, 0x9 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 24 + orrs r2, r0 + str r2, [r3] + ldr r2, =0x0203841a + ldrb r0, [r5] + lsls r0, 9 + mov r1, r12 + adds r1, 0xA + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r4, =0x0203841c + ldrb r1, [r5] + lsls r1, 9 + mov r0, r12 + adds r0, 0xC + adds r0, r1, r0 + ldrb r2, [r0] + mov r0, r12 + adds r0, 0xD + adds r1, r0 + ldrb r0, [r1] + lsls r0, 8 + orrs r2, r0 + strh r2, [r4] + ldr r7, =0x02038400 + ldrb r1, [r5] + lsls r1, 9 + mov r0, r12 + adds r0, 0x10 + adds r1, r0 + str r1, [r7] + ldr r2, =0x020244bc + ldrb r0, [r5] + lsls r0, 2 + adds r0, r2 + ldr r1, [r1] + str r1, [r0] + mov r0, r8 + ldrb r1, [r0] + adds r0, r6, 0 + bl sub_805DB8C + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + beq _0805BDBC + bl dp01_tbl1_exec_completed + b _0805BDE4 + .pool +_0805BDBC: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldrb r1, [r5] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strb r3, [r0, 0x4] + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_move_anim_1 + str r1, [r0] + ldrh r1, [r4] + ldr r2, [r7] + adds r0, r6, 0 + bl sub_817E0FC +_0805BDE4: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_0F_1_move_anim + + thumb_func_start bx_move_anim_1 +bx_move_anim_1: @ 805BDFC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r2, =0x02023064 + ldr r6, =0x02024064 + ldrb r3, [r6] + lsls r1, r3, 9 + adds r0, r2, 0x1 + mov r10, r0 + adds r0, r1, r0 + ldrb r4, [r0] + adds r5, r2, 0x2 + mov r9, r5 + adds r0, r1, r5 + ldrb r0, [r0] + lsls r0, 8 + orrs r4, r0 + adds r2, 0xB + adds r1, r2 + ldrb r1, [r1] + mov r8, r1 + ldr r7, =0x020244d0 + ldr r5, [r7] + ldr r1, [r5, 0x4] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x4] + cmp r2, 0x1 + beq _0805BE94 + cmp r2, 0x1 + bgt _0805BE54 + cmp r2, 0 + beq _0805BE5E + b _0805BF70 + .pool +_0805BE54: + cmp r2, 0x2 + beq _0805BEBE + cmp r2, 0x3 + beq _0805BF34 + b _0805BF70 +_0805BE5E: + ldr r1, [r5] + lsls r0, r3, 2 + adds r1, r0, r1 + ldrb r2, [r1] + movs r0, 0xC + ands r0, r2 + cmp r0, 0x4 + bne _0805BE80 + movs r0, 0x8 + orrs r0, r2 + strb r0, [r1] + ldrb r2, [r6] + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_0805BE80: + ldr r0, [r7] + ldrb r1, [r6] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x1 + strb r1, [r0, 0x4] + b _0805BF70 +_0805BE94: + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0805BF70 + movs r0, 0 + bl sub_805EB9C + adds r0, r4, 0 + bl move_anim_start_t1 + ldr r0, [r7] + ldrb r1, [r6] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x2 + strb r1, [r0, 0x4] + b _0805BF70 +_0805BEBE: + ldr r0, =0x020383f8 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, =0x020383fd + ldrb r0, [r0] + cmp r0, 0 + bne _0805BF70 + movs r0, 0x1 + bl sub_805EB9C + ldr r0, [r7] + ldrb r2, [r6] + ldr r1, [r0] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0805BF0C + mov r0, r8 + cmp r0, 0x1 + bhi _0805BF0C + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x6 + bl move_anim_start_t4 + ldr r0, [r7] + ldrb r1, [r6] + ldr r0, [r0] + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] +_0805BF0C: + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x3 + strb r1, [r0, 0x4] + b _0805BF70 + .pool +_0805BF34: + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0805BF70 + bl sub_805E394 + ldrb r0, [r6] + lsls r2, r0, 9 + mov r3, r10 + adds r1, r2, r3 + ldrb r1, [r1] + add r2, r9 + ldrb r2, [r2] + lsls r2, 8 + orrs r1, r2 + bl sub_805E94C + ldr r0, [r7] + ldrb r1, [r6] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strb r4, [r0, 0x4] + bl dp01_tbl1_exec_completed +_0805BF70: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end bx_move_anim_1 + + thumb_func_start sub_805BF80 +sub_805BF80: @ 805BF80 + push {r4,r5,lr} + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r5, =0x02024064 + ldrb r4, [r5] + lsls r4, 9 + ldr r0, =0x02023066 + adds r4, r0 + ldrh r0, [r4] + bl battle_pick_message + ldr r0, =0x02022e2c + movs r1, 0 + bl battle_show_message_maybe + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_80597B4 + str r1, [r0] + ldrh r0, [r4] + bl sub_817C95C + ldrb r0, [r5] + ldrh r1, [r4] + bl sub_81A57E4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805BF80 + + thumb_func_start dp01t_11_1_message_for_player_only +dp01t_11_1_message_for_player_only: @ 805BFE0 + push {lr} + ldr r0, =0x02024064 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0805BFFC + bl sub_805BF80 + b _0805C000 + .pool +_0805BFFC: + bl dp01_tbl1_exec_completed +_0805C000: + pop {r0} + bx r0 + thumb_func_end dp01t_11_1_message_for_player_only + + thumb_func_start sub_805C004 +sub_805C004: @ 805C004 + push {lr} + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0805C02A + ldr r0, =0x02022e14 + strh r1, [r0] + ldr r1, =0x02022e16 + movs r0, 0xA0 + strh r0, [r1] + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8057588 + str r1, [r0] +_0805C02A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C004 + + thumb_func_start dp01t_12_6_battle_menu +dp01t_12_6_battle_menu: @ 805C044 + push {r4,lr} + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805C004 + str r1, [r0] + bl sub_817F2A8 + ldr r0, =gUnknown_085CCA3A + movs r1, 0x2 + bl battle_show_message_maybe + movs r4, 0 +_0805C062: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8059CF8 + adds r4, 0x1 + cmp r4, 0x3 + ble _0805C062 + ldr r1, =0x020244ac + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + movs r1, 0 + bl sub_8059CB4 + ldr r0, =gUnknown_085CC9F3 + bl get_battle_strings_ + ldr r0, =0x02022e2c + movs r1, 0x1 + bl battle_show_message_maybe + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_12_6_battle_menu + + thumb_func_start sub_805C0B0 +sub_805C0B0: @ 805C0B0 + push {r4,lr} + sub sp, 0x4 + ldr r4, =0x02024064 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0805C108 + str r0, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + ldr r0, =gUnknown_085CCABB + movs r1, 0xC + bl battle_show_message_maybe + ldr r1, =0x03005d74 + movs r0, 0x1 + strb r0, [r1] + movs r0, 0x1 + bl sub_8056B74 + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_80599D4 + str r1, [r0] + b _0805C10C + .pool +_0805C108: + bl dp01_tbl1_exec_completed +_0805C10C: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_805C0B0 + + thumb_func_start sub_805C114 +sub_805C114: @ 805C114 + push {lr} + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0805C13E + ldr r0, =0x02022e14 + strh r1, [r0] + ldr r1, =0x02022e16 + movs r2, 0xA0 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8057BFC + str r1, [r0] +_0805C13E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C114 + + thumb_func_start sub_805C158 +sub_805C158: @ 805C158 + push {lr} + ldr r0, =0x02024064 + ldrb r1, [r0] + ldr r0, =0x0202449c + ldr r0, [r0] + adds r1, r0 + movs r0, 0xA6 + lsls r0, 2 + adds r1, r0 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + bne _0805C194 + ldr r1, =0x0203bd30 + ldr r0, =0x03005d80 + ldr r0, [r0] + str r0, [r1] + bl sub_805D19C + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + movs r0, 0x1 + movs r1, 0xA + bl dp01_build_cmdbuf_x21_a_bb + bl dp01_tbl1_exec_completed +_0805C194: + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C158 + + thumb_func_start dp01t_14_5_move_menu_pokedude +dp01t_14_5_move_menu_pokedude: @ 805C1A8 + push {lr} + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _0805C1EC + ldr r2, =0x02024064 + ldrb r0, [r2] + ldr r1, =0x0202449c + ldr r1, [r1] + adds r0, r1 + movs r1, 0xA6 + lsls r1, 2 + adds r0, r1 + movs r1, 0x8 + strb r1, [r0] + ldr r1, =0x03005d60 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805C158 + b _0805C1FC + .pool +_0805C1EC: + bl sub_805C210 + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805C114 +_0805C1FC: + str r1, [r0] + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_14_5_move_menu_pokedude + + thumb_func_start sub_805C210 +sub_805C210: @ 805C210 + push {lr} + bl sub_8059AAC + ldr r1, =0x03005d74 + movs r0, 0xFF + strb r0, [r1] + ldr r1, =0x020244b0 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + movs r1, 0 + bl battle_menu_cursor_related_2 + bl sub_8059B18 + bl sub_8059B3C + bl sub_8059BB0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C210 + + thumb_func_start sub_805C248 +sub_805C248: @ 805C248 + push {r4,r5,lr} + sub sp, 0x4 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, =0x03005d60 + ldr r2, =0x02024064 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_80598A4 + str r1, [r0] + ldr r1, =0x020244b8 + ldrb r0, [r2] + strb r0, [r1] + movs r3, 0 + ldr r5, =0x0203cf00 + ldr r4, =0x02023064 +_0805C276: + adds r0, r3, r5 + ldrb r1, [r2] + lsls r1, 9 + adds r1, 0x1 + adds r1, r3, r1 + adds r1, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r3, 0x1 + cmp r3, 0x2 + ble _0805C276 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C248 + + thumb_func_start sub_805C2AC +sub_805C2AC: @ 805C2AC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + movs r3, 0 + ldr r0, =0x0203cf00 + mov r12, r0 + ldr r1, =0x02023064 + mov r8, r1 + ldr r2, =0x02024064 + ldr r7, =0x02022fec + mov r6, r12 + mov r5, r8 + adds r4, r2, 0 +_0805C2C8: + adds r0, r3, r6 + ldrb r1, [r4] + lsls r1, 9 + adds r1, 0x4 + adds r1, r3, r1 + adds r1, r5 + ldrb r1, [r1] + strb r1, [r0] + adds r3, 0x1 + cmp r3, 0x2 + ble _0805C2C8 + ldr r0, [r7] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _0805C330 + ldrb r3, [r2] + lsls r0, r3, 9 + mov r1, r8 + adds r1, 0x1 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x2 + beq _0805C330 + ldr r1, =0x0202406e + lsls r0, r3, 1 + adds r0, r1 + ldrb r1, [r0] + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x1 + mov r2, r12 + bl dp01_build_cmdbuf_x22_a_three_bytes + bl dp01_tbl1_exec_completed + b _0805C3BC + .pool +_0805C330: + ldr r0, =nullsub_4 + movs r1, 0xFF + bl AddTask + ldr r3, =0x03005d7c + ldr r4, =0x02024064 + ldrb r1, [r4] + adds r1, r3 + movs r2, 0 + mov r8, r2 + strb r0, [r1] + ldr r5, =0x03005e00 + ldrb r2, [r4] + adds r3, r2, r3 + ldrb r0, [r3] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r5 + ldr r5, =0x02023064 + lsls r2, 9 + adds r6, r5, 0x1 + adds r2, r6 + ldrb r2, [r2] + movs r0, 0xF + ands r0, r2 + strh r0, [r1, 0x8] + ldr r3, =0x0202449c + ldr r1, [r3] + adds r1, 0x49 + ldrb r0, [r4] + lsls r0, 9 + adds r0, r6 + ldrb r0, [r0] + lsrs r0, 4 + strb r0, [r1] + ldr r2, [r3] + adds r2, 0x8B + ldrb r0, [r4] + lsls r0, 9 + adds r1, r5, 0x2 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r1, [r3] + adds r1, 0xB0 + ldrb r0, [r4] + lsls r0, 9 + adds r5, 0x3 + adds r0, r5 + ldrb r0, [r0] + strb r0, [r1] + movs r0, 0x1 + negs r0, r0 + mov r1, r8 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_80597CC + str r1, [r0] + ldr r1, =0x020244b8 + ldrb r0, [r4] + strb r0, [r1] +_0805C3BC: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C2AC + + thumb_func_start sub_805C3EC +sub_805C3EC: @ 805C3EC + push {lr} + sub sp, 0x4 + bl sub_805EA60 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r1, 0x2 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + bl dp01_tbl1_exec_completed + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_805C3EC + + thumb_func_start sub_805C410 +sub_805C410: @ 805C410 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + movs r0, 0 + bl load_gfxc_health_bar + ldr r3, =0x02023064 + ldr r0, =0x02024064 + mov r9, r0 + ldrb r1, [r0] + lsls r1, 9 + adds r0, r3, 0x2 + adds r0, r1, r0 + ldrb r2, [r0] + adds r3, 0x3 + adds r1, r3 + ldrb r0, [r1] + lsls r0, 8 + orrs r2, r0 + lsls r2, 16 + asrs r7, r2, 16 + cmp r7, 0 + ble _0805C44A + ldr r1, =0x0203cd70 + ldr r0, [r1] + adds r0, r7 + str r0, [r1] +_0805C44A: + ldr r0, =0x00007fff + cmp r7, r0 + beq _0805C4B4 + ldr r6, =0x0202406e + mov r1, r9 + ldrb r0, [r1] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r4, =0x020244ec + adds r0, r4 + movs r1, 0x3A + bl pokemon_getattr + mov r8, r0 + mov r2, r9 + ldrb r0, [r2] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + muls r0, r5 + adds r0, r4 + movs r1, 0x39 + bl pokemon_getattr + adds r3, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r1, =0x03005d70 + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + mov r2, r8 + bl sub_807294C + b _0805C4F2 + .pool +_0805C4B4: + ldr r1, =0x0202406e + mov r2, r9 + ldrb r0, [r2] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3A + bl pokemon_getattr + adds r2, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r4, =0x03005d70 + adds r1, r0, r4 + ldrb r1, [r1] + str r7, [sp] + movs r3, 0 + bl sub_807294C + mov r2, r9 + ldrb r0, [r2] + adds r0, r4 + ldrb r0, [r0] + movs r1, 0 + movs r2, 0 + bl heathbar_draw_hp +_0805C4F2: + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_t1_healthbar_update + str r1, [r0] + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C410 + + thumb_func_start sub_805C528 +sub_805C528: @ 805C528 + push {r4-r7,lr} + ldr r5, =0x02023064 + ldr r6, =0x02024064 + ldrb r0, [r6] + lsls r0, 9 + adds r1, r5, 0x1 + adds r0, r1 + ldrb r7, [r0] + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + cmp r0, 0x63 + bls _0805C560 + bl dp01_tbl1_exec_completed + b _0805C5AC + .pool +_0805C560: + movs r0, 0x1 + bl load_gfxc_health_bar + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + ldrb r1, [r6] + lsls r1, 9 + adds r0, r5, 0x2 + adds r0, r1, r0 + ldrb r4, [r0] + adds r0, r5, 0x3 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 8 + orrs r4, r0 + ldr r0, =sub_80591B8 + movs r1, 0xA + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r7, [r1, 0x8] + strh r4, [r1, 0xA] + ldrb r0, [r6] + strh r0, [r1, 0xC] + ldr r1, =0x03005d60 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =nullsub_21 + str r1, [r0] +_0805C5AC: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C528 + + thumb_func_start sub_805C5C4 +sub_805C5C4: @ 805C5C4 + push {r4,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _0805C618 + ldr r0, =0x03005d70 + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x020244ec + adds r1, r2 + movs r2, 0x9 + bl healthbar_draw_field_maybe + ldrb r2, [r4] + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8059D60 + str r1, [r0] +_0805C618: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C5C4 + + thumb_func_start sub_805C63C +sub_805C63C: @ 805C63C + push {r4,r5,lr} + ldr r5, =0x02024064 + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _0805C68C + ldr r4, =0x02023064 + ldrb r3, [r5] + lsls r3, 9 + adds r0, r4, 0x1 + adds r0, r3, r0 + ldrb r0, [r0] + adds r1, r4, 0x2 + adds r1, r3, r1 + ldrb r1, [r1] + adds r2, r4, 0x3 + adds r2, r3, r2 + ldrb r2, [r2] + lsls r2, 8 + orrs r1, r2 + adds r2, r4, 0x4 + adds r2, r3, r2 + ldrb r2, [r2] + lsls r2, 16 + orrs r1, r2 + adds r4, 0x5 + adds r3, r4 + ldrb r2, [r3] + lsls r2, 24 + orrs r1, r2 + bl move_anim_start_t2_for_situation + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8059D60 + str r1, [r0] +_0805C68C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C63C + + thumb_func_start sub_805C6A4 +sub_805C6A4: @ 805C6A4 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + ldr r0, =0x0202406e + mov r8, r0 + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r0, 1 + add r0, r8 + ldrh r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x020244ec + adds r0, r5 + movs r1, 0x37 + bl pokemon_getattr + ldr r2, =0x02023064 + ldrb r1, [r4] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + eors r0, r1 + mov r1, sp + strb r0, [r1] + ldrb r0, [r4] + lsls r0, 1 + add r0, r8 + ldrh r0, [r0] + muls r0, r6 + adds r0, r5 + movs r1, 0x37 + mov r2, sp + bl pokemon_setattr + bl dp01_tbl1_exec_completed + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C6A4 + + thumb_func_start sub_805C710 +sub_805C710: @ 805C710 + push {lr} + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_805C710 + + thumb_func_start sub_805C71C +sub_805C71C: @ 805C71C + push {r4,r5,lr} + ldr r3, =0x02023064 + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r2, 9 + adds r0, r3, 0x1 + adds r0, r2, r0 + ldrb r5, [r0] + adds r0, r3, 0x2 + adds r0, r2, r0 + ldrb r0, [r0] + lsls r0, 8 + orrs r5, r0 + adds r0, r3, 0x3 + adds r0, r2, r0 + ldrb r0, [r0] + lsls r0, 16 + orrs r5, r0 + adds r0, r3, 0x4 + adds r0, r2, r0 + ldrb r4, [r0] + lsls r4, 24 + adds r0, r3, 0x5 + adds r0, r2, r0 + ldrb r1, [r0] + adds r0, r3, 0x6 + adds r0, r2, r0 + ldrb r0, [r0] + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + adds r3, 0x7 + adds r2, r3 + orrs r5, r4 + lsrs r4, r1, 16 + movs r0, 0x80 + lsls r0, 5 + cmp r4, r0 + bhi _0805C78C + ldr r0, =0x040000d4 + str r2, [r0] + str r5, [r0, 0x4] + lsrs r1, 17 + movs r2, 0x80 + lsls r2, 24 + orrs r1, r2 + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] + b _0805C7B8 + .pool +_0805C78C: + ldr r3, =0x040000d4 + str r2, [r3] + str r5, [r3, 0x4] + ldr r0, =0x80000800 + str r0, [r3, 0x8] + ldr r0, [r3, 0x8] + movs r0, 0x80 + lsls r0, 5 + adds r2, r0 + adds r5, r0 + ldr r1, =0xfffff000 + adds r4, r1 + cmp r4, r0 + bhi _0805C78C + str r2, [r3] + str r5, [r3, 0x4] + lsrs r0, r4, 1 + movs r1, 0x80 + lsls r1, 24 + orrs r0, r1 + str r0, [r3, 0x8] + ldr r0, [r3, 0x8] +_0805C7B8: + bl dp01_tbl1_exec_completed + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C71C + + thumb_func_start sub_805C7D0 +sub_805C7D0: @ 805C7D0 + push {lr} + ldr r2, =0x02023064 + ldr r0, =0x02024064 + ldrb r1, [r0] + lsls r1, 9 + adds r0, r2, 0x1 + adds r0, r1, r0 + ldrb r0, [r0] + adds r2, 0x2 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 8 + orrs r0, r1 + bl song_play_for_text + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C7D0 + + thumb_func_start sub_805C800 +sub_805C800: @ 805C800 + push {lr} + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_805C800 + + thumb_func_start sub_805C80C +sub_805C80C: @ 805C80C + push {lr} + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_805C80C + + thumb_func_start sub_805C820 +sub_805C820: @ 805C820 + push {lr} + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl dp01_build_cmdbuf_x22_a_three_bytes + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_805C820 + + thumb_func_start sub_805C834 +sub_805C834: @ 805C834 + push {lr} + movs r0, 0x1 + movs r1, 0 + bl dp01_build_cmdbuf_x23_aa_0 + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_805C834 + + thumb_func_start sub_805C848 +sub_805C848: @ 805C848 + push {lr} + movs r0, 0x1 + movs r1, 0 + bl dp01_build_cmdbuf_x24_aa_0 + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_805C848 + + thumb_func_start sub_805C85C +sub_805C85C: @ 805C85C + push {lr} + ldr r2, =0x02022d0c + ldrb r1, [r2] + movs r0, 0x80 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C85C + + thumb_func_start sub_805C878 +sub_805C878: @ 805C878 + push {lr} + ldr r3, =0x02022d0c + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0x7F + ands r1, r0 + ldrb r2, [r3] + movs r0, 0x80 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C878 + + thumb_func_start sub_805C8B0 +sub_805C8B0: @ 805C8B0 + push {lr} + ldr r2, =0x02022d0c + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C8B0 + + thumb_func_start sub_805C8C8 +sub_805C8C8: @ 805C8C8 + push {lr} + ldr r3, =0x02022d0c + ldr r1, [r3] + lsls r1, 24 + lsrs r1, 31 + movs r0, 0x1 + eors r1, r0 + lsls r1, 7 + ldrb r2, [r3] + movs r0, 0x7F + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C8C8 + + thumb_func_start dp01t_29_1_blink +dp01t_29_1_blink: @ 805C8F0 + push {r4,lr} + ldr r3, =0x02020630 + ldr r2, =0x020241e4 + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _0805C924 + bl dp01_tbl1_exec_completed + b _0805C94E + .pool +_0805C924: + ldr r1, =0x020244b9 + movs r0, 0x1 + strb r0, [r1] + ldrb r0, [r4] + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0 + strh r1, [r0, 0x30] + ldrb r0, [r4] + bl sub_80769F4 + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_blink_t1 + str r1, [r0] +_0805C94E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_29_1_blink + + thumb_func_start sub_805C960 +sub_805C960: @ 805C960 + push {lr} + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_805C960 + + thumb_func_start sub_805C96C +sub_805C96C: @ 805C96C + push {r4,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + movs r3, 0x3F + cmp r0, 0 + bne _0805C980 + movs r3, 0xC0 +_0805C980: + ldr r2, =0x02023064 + ldrb r1, [r4] + lsls r1, 9 + adds r0, r2, 0x1 + adds r0, r1, r0 + ldrb r0, [r0] + adds r2, 0x2 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 8 + orrs r0, r1 + lsls r1, r3, 24 + asrs r1, 24 + bl audio_play_and_stuff + bl dp01_tbl1_exec_completed + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C96C + + thumb_func_start sub_805C9B0 +sub_805C9B0: @ 805C9B0 + push {r4,r5,lr} + ldr r4, =0x02023064 + ldr r5, =0x02024064 + ldrb r0, [r5] + lsls r3, r0, 9 + adds r0, r4, 0x3 + adds r0, r3, r0 + ldrb r0, [r0] + cmp r0, 0 + beq _0805C9EC + bl sub_805EA60 + ldrb r1, [r5] + lsls r1, 9 + adds r0, r4, 0x1 + adds r0, r1, r0 + ldrb r0, [r0] + adds r2, r4, 0x2 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 8 + orrs r0, r1 + bl song_play_for_text + b _0805CA00 + .pool +_0805C9EC: + adds r0, r4, 0x1 + adds r0, r3, r0 + ldrb r0, [r0] + adds r1, r4, 0x2 + adds r1, r3, r1 + ldrb r1, [r1] + lsls r1, 8 + orrs r0, r1 + bl fanfare_play +_0805CA00: + bl dp01_tbl1_exec_completed + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_805C9B0 + + thumb_func_start sub_805CA0C +sub_805CA0C: @ 805CA0C + push {lr} + ldr r1, =0x0202406e + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x19 + negs r1, r1 + movs r2, 0x5 + bl sub_80A32E4 + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_805CA0C + + thumb_func_start dp01t_2E_1_battle_intro +dp01t_2E_1_battle_intro: @ 805CA4C + push {lr} + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + bl battle_intro_launch + ldr r2, =0x020243fc + ldrh r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_2E_1_battle_intro + + thumb_func_start dp01t_2F_1_pokemon_enter +dp01t_2F_1_pokemon_enter: @ 805CA80 + push {r4-r7,lr} + ldr r6, =0x020241e4 + ldr r7, =0x02024064 + ldrb r0, [r7] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, =0x02020630 + adds r0, r5 + bl oamt_add_pos2_onto_pos1 + ldrb r0, [r7] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x32 + strh r1, [r0, 0x2E] + ldrb r0, [r7] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =0x0000ffd8 + strh r1, [r0, 0x32] + ldrb r0, [r7] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrh r1, [r0, 0x22] + strh r1, [r0, 0x36] + ldrb r0, [r7] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r5, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_80A6EEC + str r1, [r0] + ldrb r2, [r7] + adds r0, r2, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x38] + ldrb r0, [r7] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =sub_805CC00 + bl oamt_set_x3A_32 + ldrb r0, [r7] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x1 + bl StartObjectImageAnim + ldr r0, =0x0000d6f8 + bl AllocObjectPalette + adds r4, r0, 0 + lsls r4, 24 + ldr r1, =gTrainerBackPicPaletteTable + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 3 + adds r0, r1 + ldr r0, [r0] + lsrs r4, 20 + movs r2, 0x80 + lsls r2, 1 + adds r1, r4, r2 + movs r2, 0x20 + bl decompress_palette + ldrb r0, [r7] + adds r0, r6 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r4 + strb r0, [r1, 0x5] + ldr r0, =task05_08033660 + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + ldrb r0, [r7] + strh r0, [r1, 0x8] + ldr r3, =0x020244d0 + ldr r0, [r3] + ldrb r2, [r7] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0805CBA2 + ldr r0, =0x020244b4 + adds r0, r2, r0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + ldr r1, =sub_8073C30 + str r1, [r0] +_0805CBA2: + ldr r0, [r3] + ldr r2, [r0, 0x8] + ldrb r0, [r2, 0x9] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x9] + ldr r1, =0x03005d60 + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldr r1, =nullsub_21 + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_2F_1_pokemon_enter + + thumb_func_start sub_805CC00 +sub_805CC00: @ 805CC00 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r4, [r5, 0x38] + lsls r4, 24 + lsrs r4, 24 + bl obj_free_rotscale_entry + ldrb r0, [r5, 0x5] + lsrs r0, 4 + bl GetObjectPaletteTagBySlot + lsls r0, 16 + lsrs r0, 16 + bl FreeObjectPaletteByTag + adds r0, r5, 0 + bl RemoveObjectAndFreeTiles + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + adds r1, r4, 0 + bl sub_805DD7C + ldr r0, =0x020241e4 + adds r4, r0 + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r1, 0 + bl StartObjectImageAnim + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805CC00 + + thumb_func_start task05_08033660 +task05_08033660: @ 805CC68 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, =0x03005e00 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r1, r0, r1 + ldrh r2, [r1, 0xA] + movs r3, 0xA + ldrsh r0, [r1, r3] + cmp r0, 0x1E + bgt _0805CC94 + adds r0, r2, 0x1 + strh r0, [r1, 0xA] + b _0805CD50 + .pool +_0805CC94: + ldr r7, =0x02024064 + ldrb r0, [r7] + mov r9, r0 + ldrh r0, [r1, 0x8] + strb r0, [r7] + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0805CCB4 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0805CCE4 +_0805CCB4: + ldr r0, =0x02023064 + ldrb r1, [r7] + lsls r2, r1, 9 + adds r0, 0x1 + adds r2, r0 + ldr r0, =0x0202406e + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + strb r0, [r2] + ldrb r0, [r7] + movs r1, 0 + bl sub_805B258 + b _0805CD38 + .pool +_0805CCE4: + ldr r4, =0x02023064 + ldrb r0, [r7] + lsls r1, r0, 9 + adds r4, 0x1 + adds r1, r4 + ldr r5, =0x0202406e + lsls r0, 1 + adds r0, r5 + ldrh r0, [r0] + strb r0, [r1] + ldrb r0, [r7] + movs r1, 0 + bl sub_805B258 + ldrb r0, [r7] + movs r6, 0x2 + eors r0, r6 + strb r0, [r7] + ldrb r0, [r7] + lsls r1, r0, 9 + adds r1, r4 + lsls r0, 1 + adds r0, r5 + ldrh r0, [r0] + strb r0, [r1] + ldrb r1, [r7] + lsls r0, r1, 1 + adds r0, r5 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =0x020244ec + adds r0, r2 + bl sub_805DD7C + ldrb r0, [r7] + movs r1, 0 + bl sub_805B258 + ldrb r0, [r7] + eors r0, r6 + strb r0, [r7] +_0805CD38: + ldr r1, =0x03005d60 + ldr r2, =0x02024064 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8058B40 + str r1, [r0] + mov r3, r9 + strb r3, [r2] + mov r0, r8 + bl remove_task +_0805CD50: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end task05_08033660 + + thumb_func_start sub_805CD74 +sub_805CD74: @ 805CD74 + push {r4-r6,lr} + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0805CDA4 + adds r0, r2, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0805CDA4 + bl dp01_tbl1_exec_completed + b _0805CE18 + .pool +_0805CDA4: + ldr r6, =0x020244d0 + ldr r0, [r6] + ldr r5, =0x02024064 + ldrb r1, [r5] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] + ldrb r0, [r5] + lsls r3, r0, 9 + ldr r4, =0x02023068 + adds r1, r3, r4 + subs r2, r4, 0x3 + adds r2, r3, r2 + ldrb r2, [r2] + subs r4, 0x2 + adds r3, r4 + ldrb r3, [r3] + bl sub_80735DC + ldr r2, =0x020244b4 + ldrb r1, [r5] + adds r1, r2 + movs r3, 0 + strb r0, [r1] + ldr r0, [r6] + ldrb r1, [r5] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strb r3, [r0, 0x5] + ldrb r2, [r5] + lsls r0, r2, 9 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _0805CE0C + ldr r0, [r6] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + movs r1, 0x5D + strb r1, [r0, 0x5] +_0805CE0C: + ldr r0, =0x03005d60 + ldrb r1, [r5] + lsls r1, 2 + adds r1, r0 + ldr r0, =sub_805CE38 + str r0, [r1] +_0805CE18: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805CD74 + + thumb_func_start sub_805CE38 +sub_805CE38: @ 805CE38 + push {r4,lr} + ldr r4, =0x020244d0 + ldr r0, [r4] + ldr r3, =0x02024064 + ldrb r1, [r3] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x5] + adds r2, r1, 0x1 + strb r2, [r0, 0x5] + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x5C + bls _0805CE70 + ldr r0, [r4] + ldrb r1, [r3] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strb r1, [r0, 0x5] + bl dp01_tbl1_exec_completed +_0805CE70: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805CE38 + + thumb_func_start sub_805CE80 +sub_805CE80: @ 805CE80 + push {lr} + ldr r0, =0x020244d0 + ldr r1, [r0] + ldr r0, =0x02024064 + ldrb r3, [r0] + ldr r1, [r1, 0x4] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0805CEB2 + ldr r2, =0x03005e00 + ldr r0, =0x020244b4 + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, =sub_8073C30 + str r1, [r0] +_0805CEB2: + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_805CE80 + + thumb_func_start sub_805CED0 +sub_805CED0: @ 805CED0 + push {r4,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + movs r1, 0x1 + bl dp11b_obj_free + ldrb r0, [r4] + movs r1, 0 + bl dp11b_obj_free + bl dp01_tbl1_exec_completed + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805CED0 + + thumb_func_start dp01t_33_1_enemy_move +dp01t_33_1_enemy_move: @ 805CEF4 + push {r4,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + bl sub_80A6A90 + lsls r0, 24 + cmp r0, 0 + beq _0805CF3A + ldr r3, =0x02020630 + ldr r0, =0x020241e4 + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + ldr r0, =0x02023064 + lsls r1, 9 + adds r0, 0x1 + adds r1, r0 + adds r2, 0x3E + movs r0, 0x1 + ldrb r1, [r1] + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldrb r0, [r4] + bl sub_805E408 +_0805CF3A: + bl dp01_tbl1_exec_completed + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_33_1_enemy_move + + thumb_func_start sub_805CF54 +sub_805CF54: @ 805CF54 + push {r4-r6,lr} + sub sp, 0x4 + ldr r5, =0x02024064 + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _0805CFB6 + ldr r4, =0x02023064 + ldrb r2, [r5] + lsls r1, r2, 9 + adds r0, r4, 0x1 + adds r0, r1, r0 + ldrb r6, [r0] + adds r0, r4, 0x2 + adds r0, r1, r0 + ldrb r3, [r0] + adds r4, 0x3 + adds r1, r4 + ldrb r0, [r1] + lsls r0, 8 + orrs r3, r0 + str r3, [sp] + adds r0, r2, 0 + adds r1, r2, 0 + adds r3, r6, 0 + bl move_anim_start_t3 + lsls r0, 24 + cmp r0, 0 + beq _0805CFA4 + bl dp01_tbl1_exec_completed + b _0805CFB0 + .pool +_0805CFA4: + ldr r0, =0x03005d60 + ldrb r1, [r5] + lsls r1, 2 + adds r1, r0 + ldr r0, =bx_8030B2C + str r0, [r1] +_0805CFB0: + adds r0, r6, 0 + bl sub_817E32C +_0805CFB6: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805CF54 + + thumb_func_start dp01t_35_1_link_standby_message_and_free_vram +dp01t_35_1_link_standby_message_and_free_vram: @ 805CFC8 + push {r4,r5,lr} + ldr r5, =0x02024064 + ldrb r0, [r5] + lsls r0, 9 + ldr r4, =0x02023066 + adds r0, r4 + bl sub_81851A8 + ldrb r0, [r5] + lsls r0, 9 + subs r4, 0x1 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0805D002 + cmp r0, 0x1 + bgt _0805CFF8 + cmp r0, 0 + beq _0805CFFE + b _0805D020 + .pool +_0805CFF8: + cmp r0, 0x2 + beq _0805D01C + b _0805D020 +_0805CFFE: + bl b_link_standby_message +_0805D002: + ldr r4, =0x02024064 + ldrb r0, [r4] + movs r1, 0x1 + bl dp11b_obj_free + ldrb r0, [r4] + movs r1, 0 + bl dp11b_obj_free + b _0805D020 + .pool +_0805D01C: + bl b_link_standby_message +_0805D020: + bl dp01_tbl1_exec_completed + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end dp01t_35_1_link_standby_message_and_free_vram + + thumb_func_start sub_805D02C +sub_805D02C: @ 805D02C + push {r4,lr} + ldr r1, =0x02023064 + ldr r4, =0x02024064 + ldrb r3, [r4] + lsls r0, r3, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r2, [r0] + cmp r2, 0x1 + beq _0805D074 + cmp r2, 0x1 + bgt _0805D054 + cmp r2, 0 + beq _0805D05A + b _0805D084 + .pool +_0805D054: + cmp r2, 0x2 + beq _0805D07C + b _0805D084 +_0805D05A: + ldr r0, =0x020244ac + adds r0, r3, r0 + strb r2, [r0] + ldr r1, =0x020244b0 + ldrb r0, [r4] + adds r0, r1 + strb r2, [r0] + b _0805D084 + .pool +_0805D074: + ldr r0, =0x020244ac + b _0805D07E + .pool +_0805D07C: + ldr r0, =0x020244b0 +_0805D07E: + adds r0, r3, r0 + movs r1, 0 + strb r1, [r0] +_0805D084: + bl dp01_tbl1_exec_completed + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805D02C + + thumb_func_start sub_805D094 +sub_805D094: @ 805D094 + push {r4,r5,lr} + ldr r5, =0x02024064 + ldrb r0, [r5] + lsls r0, 9 + ldr r4, =0x02023068 + adds r0, r4 + bl sub_81851A8 + ldr r2, =0x0202433a + ldrb r0, [r5] + lsls r0, 9 + subs r1, r4, 0x3 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r0, =0x03005d90 + ldr r3, [r0] + ldrb r0, [r5] + lsls r0, 9 + subs r4, 0x2 + adds r0, r4 + ldrb r0, [r0] + ldr r1, =0x00000ca9 + adds r3, r1 + movs r1, 0x1 + ands r1, r0 + lsls r1, 3 + ldrb r2, [r3] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + movs r0, 0x5 + bl sub_80A2F50 + movs r0, 0x3 + bl sub_80A2390 + bl dp01_tbl1_exec_completed + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_80587B0 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805D094 + + thumb_func_start nullsub_22 +nullsub_22: @ 805D114 + bx lr + thumb_func_end nullsub_22 + + thumb_func_start dp11_init +dp11_init: @ 805D118 + push {r4,lr} + ldr r4, =0x020244d0 + movs r0, 0x10 + bl AllocZeroed + str r0, [r4] + movs r0, 0x10 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1] + movs r0, 0x30 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1, 0x4] + movs r0, 0x10 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1, 0x8] + movs r0, 0x50 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1, 0xC] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp11_init + + thumb_func_start dp11_free +dp11_free: @ 805D158 + push {r4,r5,lr} + ldr r5, =0x020244d0 + ldr r0, [r5] + cmp r0, 0 + beq _0805D192 + ldr r0, [r0, 0xC] + bl Free + ldr r0, [r5] + movs r4, 0 + str r4, [r0, 0xC] + ldr r0, [r0, 0x8] + bl Free + ldr r0, [r5] + str r4, [r0, 0x8] + ldr r0, [r0, 0x4] + bl Free + ldr r0, [r5] + str r4, [r0, 0x4] + ldr r0, [r0] + bl Free + ldr r0, [r5] + str r4, [r0] + bl Free + str r4, [r5] +_0805D192: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end dp11_free + + thumb_func_start sub_805D19C +sub_805D19C: @ 805D19C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r0, 0x1 + negs r0, r0 + mov r9, r0 + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r2, r0, 9 + ldr r1, =0x02023068 + adds r2, r1 + mov r10, r2 + movs r1, 0 + movs r2, 0xFF + bl sub_803FECC + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x92 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + negs r0, r1 + orrs r0, r1 + asrs r4, r0, 31 + movs r0, 0x2 + ands r4, r0 + adds r6, r4, 0 + adds r5, r4, 0x2 + b _0805D20E + .pool +_0805D20C: + adds r4, 0x1 +_0805D20E: + cmp r4, r5 + bge _0805D234 + ldr r0, =0x02024064 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + ldr r1, =0x020240cc + adds r0, r1 + ldr r0, [r0] + bl GetNatureFromPersonality + lsls r0, 24 + lsrs r0, 22 + adds r0, r4, r0 + ldr r2, =gUnknown_0831C494 + adds r0, r2 + ldrb r0, [r0] + cmp r0, r7 + ble _0805D20C +_0805D234: + subs r7, r4, r6 + cmp r4, r5 + bne _0805D23C + movs r7, 0x2 +_0805D23C: + movs r6, 0 + movs r4, 0 + mov r1, r10 + ldrh r0, [r1] + cmp r0, 0 + beq _0805D27C + mov r5, r10 +_0805D24A: + ldrh r0, [r5] + bl sub_805D4A8 + lsls r0, 24 + lsrs r0, 24 + cmp r7, r0 + bne _0805D26E + mov r0, r10 + adds r0, 0x8 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _0805D26E + ldr r0, =gUnknown_0832A328 + lsls r1, r4, 2 + adds r1, r0 + ldr r0, [r1] + orrs r6, r0 +_0805D26E: + adds r5, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + bgt _0805D27C + ldrh r0, [r5] + cmp r0, 0 + bne _0805D24A +_0805D27C: + cmp r6, 0 + beq _0805D2AC + ldr r3, =0x0202449c + ldr r1, [r3] + adds r1, 0x92 + ldrb r2, [r1] + movs r0, 0xF + ands r0, r2 + strb r0, [r1] + ldr r1, [r3] + adds r1, 0x92 + lsls r0, r6, 4 + ldrb r2, [r1] + orrs r0, r2 + strb r0, [r1] + lsls r0, r6, 24 + lsrs r0, 24 + bl sub_8130950 + bl sub_8130BA4 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_0805D2AC: + movs r0, 0x1 + negs r0, r0 + cmp r9, r0 + beq _0805D2B6 + b _0805D40C +_0805D2B6: + mov r2, r8 + cmp r2, 0xF + bne _0805D2BE + b _0805D3EA +_0805D2BE: + movs r5, 0 + movs r6, 0 + ldr r7, =gUnknown_0832A328 + mov r4, r10 +_0805D2C6: + ldrh r0, [r4] + bl sub_805D4A8 + lsls r0, 24 + cmp r0, 0 + bne _0805D2DE + ldr r0, [r7] + mov r1, r8 + ands r0, r1 + cmp r0, 0 + bne _0805D2DE + adds r5, 0x1 +_0805D2DE: + ldrh r0, [r4] + bl sub_805D4A8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0805D2F8 + ldr r0, [r7] + mov r2, r8 + ands r0, r2 + cmp r0, 0 + bne _0805D2F8 + adds r5, 0x10 +_0805D2F8: + ldrh r0, [r4] + bl sub_805D4A8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _0805D316 + ldr r0, [r7] + mov r1, r8 + ands r0, r1 + cmp r0, 0 + bne _0805D316 + movs r2, 0x80 + lsls r2, 1 + adds r5, r2 +_0805D316: + adds r7, 0x4 + adds r4, 0x2 + ldr r0, =gUnknown_0832A328 + adds r0, 0xC + cmp r7, r0 + ble _0805D2C6 + movs r1, 0xF + ands r1, r5 + cmp r1, 0x1 + ble _0805D32C + adds r6, 0x1 +_0805D32C: + movs r0, 0xF0 + ands r0, r5 + cmp r0, 0x1F + ble _0805D336 + adds r6, 0x1 +_0805D336: + ldr r2, =0x000001ff + cmp r0, r2 + ble _0805D33E + adds r6, 0x1 +_0805D33E: + cmp r6, 0x1 + bgt _0805D346 + cmp r6, 0 + bne _0805D388 +_0805D346: + ldr r5, =gUnknown_0832A328 +_0805D348: + bl GenerateRandomNumber + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + lsrs r4, r1, 16 + lsls r0, r4, 2 + adds r0, r5 + ldr r0, [r0] + mov r1, r8 + ands r0, r1 + cmp r0, 0 + bne _0805D366 + mov r9, r4 +_0805D366: + movs r0, 0x1 + negs r0, r0 + cmp r9, r0 + beq _0805D348 + b _0805D3D4 + .pool +_0805D388: + cmp r1, 0x1 + ble _0805D38E + movs r6, 0 +_0805D38E: + cmp r0, 0x1F + ble _0805D394 + movs r6, 0x1 +_0805D394: + cmp r0, r2 + ble _0805D39A + movs r6, 0x2 +_0805D39A: + bl GenerateRandomNumber + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + lsrs r4, r1, 16 + ldr r1, =gUnknown_0832A328 + lsls r0, r4, 2 + adds r0, r1 + ldr r0, [r0] + mov r2, r8 + ands r0, r2 + cmp r0, 0 + bne _0805D3CC + lsls r0, r4, 1 + add r0, r10 + ldrh r0, [r0] + bl sub_805D4A8 + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + bne _0805D3CC + mov r9, r4 +_0805D3CC: + movs r0, 0x1 + negs r0, r0 + cmp r9, r0 + beq _0805D39A +_0805D3D4: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x31 + bls _0805D40C +_0805D3EA: + ldr r2, =0x0202433c + ldr r0, =0x02024064 + ldrb r1, [r0] + lsls r1, 4 + adds r1, r2 + ldrb r0, [r1, 0x2] + movs r2, 0x10 + orrs r0, r2 + strb r0, [r1, 0x2] + movs r0, 0 + b _0805D496 + .pool +_0805D40C: + mov r1, r9 + lsls r0, r1, 1 + mov r2, r10 + adds r1, r2, r0 + ldrh r0, [r1] + cmp r0, 0xAE + bne _0805D434 + ldrb r0, [r2, 0x12] + movs r5, 0 + cmp r0, 0x7 + beq _0805D442 + ldrb r1, [r2, 0x13] + movs r0, 0x7 + eors r1, r0 + negs r0, r1 + orrs r0, r1 + asrs r5, r0, 31 + movs r0, 0x10 + ands r5, r0 + b _0805D442 +_0805D434: + ldr r2, =gBattleMoves + ldrh r1, [r1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r5, [r0, 0x6] +_0805D442: + movs r0, 0x10 + ands r0, r5 + cmp r0, 0 + beq _0805D45C + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 8 + b _0805D48A + .pool +_0805D45C: + cmp r5, 0 + bne _0805D470 + bl sub_805D5F4 + lsls r0, 16 + lsrs r0, 16 + mov r2, r9 + orrs r2, r0 + mov r9, r2 + b _0805D490 +_0805D470: + ldr r0, =0x02024064 + ldrb r0, [r0] + bl battle_get_per_side_status + adds r1, r0, 0 + movs r2, 0x1 + movs r0, 0x1 + ands r0, r1 + eors r0, r2 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 16 +_0805D48A: + mov r1, r9 + orrs r1, r0 + mov r9, r1 +_0805D490: + mov r2, r9 + lsls r0, r2, 16 + lsrs r0, 16 +_0805D496: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_805D19C + + thumb_func_start sub_805D4A8 +sub_805D4A8: @ 805D4A8 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + ldr r1, =gBattleMoves + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x6] + adds r3, r1, 0 + cmp r0, 0x40 + bls _0805D4C2 + b _0805D5EE +_0805D4C2: + lsls r0, 2 + ldr r1, =_0805D4D4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0805D4D4: + .4byte _0805D5D8 + .4byte _0805D5E6 + .4byte _0805D5D8 + .4byte _0805D5EE + .4byte _0805D5D8 + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5D8 + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EA + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5D8 + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5E6 +_0805D5D8: + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x1] + cmp r0, 0 + bne _0805D5EE +_0805D5E6: + movs r0, 0x2 + b _0805D5F0 +_0805D5EA: + movs r0, 0x1 + b _0805D5F0 +_0805D5EE: + movs r0, 0 +_0805D5F0: + pop {r1} + bx r1 + thumb_func_end sub_805D4A8 + + thumb_func_start sub_805D5F4 +sub_805D5F4: @ 805D5F4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0805D6FA + ldr r0, =0x02024064 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0805D630 + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r0, 0x3 + b _0805D63E + .pool +_0805D630: + movs r0, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r0, 0x2 +_0805D63E: + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =0x02024084 + movs r2, 0x58 + mov r0, r8 + muls r0, r2 + adds r5, r0, r1 + adds r0, r7, 0 + muls r0, r2 + adds r6, r0, r1 + ldrh r0, [r5, 0x28] + ldrh r3, [r6, 0x28] + cmp r0, r3 + bne _0805D680 + bl GenerateRandomNumber + adds r3, r0, 0 + ldr r0, =0x02024064 + ldrb r1, [r0] + movs r2, 0x1 + movs r0, 0x1 + ands r0, r1 + eors r0, r2 + movs r1, 0x2 + ands r1, r3 + adds r0, r1 + b _0805D702 + .pool +_0805D680: + ldr r4, =gUnknown_0831C604 + ldr r0, =0x02024064 + mov r9, r0 + ldrb r0, [r0] + muls r0, r2 + adds r1, 0x48 + adds r0, r1 + ldr r0, [r0] + bl GetNatureFromPersonality + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r4, [r0] + cmp r4, 0x1 + beq _0805D6CC + cmp r4, 0x1 + bgt _0805D6B4 + cmp r4, 0 + beq _0805D6BA + b _0805D6FA + .pool +_0805D6B4: + cmp r4, 0x2 + beq _0805D6DE + b _0805D6FA +_0805D6BA: + ldrh r0, [r5, 0x28] + ldrh r6, [r6, 0x28] + cmp r0, r6 + bls _0805D6C8 + mov r1, r8 + lsls r0, r1, 8 + b _0805D704 +_0805D6C8: + lsls r0, r7, 8 + b _0805D704 +_0805D6CC: + ldrh r0, [r5, 0x28] + ldrh r6, [r6, 0x28] + cmp r0, r6 + bcs _0805D6DA + mov r3, r8 + lsls r0, r3, 8 + b _0805D704 +_0805D6DA: + lsls r0, r7, 8 + b _0805D704 +_0805D6DE: + bl GenerateRandomNumber + adds r3, r0, 0 + mov r0, r9 + ldrb r1, [r0] + movs r2, 0x1 + movs r0, 0x1 + ands r0, r1 + eors r0, r2 + ands r4, r3 + adds r0, r4 + lsls r0, 24 + lsrs r0, 16 + b _0805D704 +_0805D6FA: + ldr r0, =0x02024064 + ldrb r1, [r0] + movs r0, 0x1 + eors r0, r1 +_0805D702: + lsls r0, 8 +_0805D704: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_805D5F4 + + thumb_func_start sub_805D714 +sub_805D714: @ 805D714 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x30] + lsls r1, 24 + lsrs r1, 24 + ldr r2, =0x02020630 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + adds r0, r1, 0 + adds r0, 0x3F + ldrb r3, [r0] + lsls r0, r3, 26 + cmp r0, 0 + bge _0805D766 + adds r0, r1, 0 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _0805D766 + adds r2, r1, 0 + adds r2, 0x2C + ldrb r1, [r2] + lsls r0, r1, 25 + cmp r0, 0 + bge _0805D75C + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + b _0805D766 + .pool +_0805D75C: + lsls r0, r3, 27 + cmp r0, 0 + bge _0805D766 + ldr r0, =DummyObjectCallback + str r0, [r4, 0x1C] +_0805D766: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805D714 + + thumb_func_start sub_805D770 +sub_805D770: @ 805D770 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 24 + adds r3, r4, 0 + adds r3, 0x2C + ldrb r0, [r3] + movs r2, 0x40 + orrs r0, r2 + strb r0, [r3] + ldr r0, =DummyObjectCallback + str r0, [r4, 0x1C] + cmp r1, 0 + bne _0805D798 + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim + b _0805D7A0 + .pool +_0805D798: + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim +_0805D7A0: + adds r0, r4, 0 + bl AnimateObject + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_805D770 + + thumb_func_start sub_805D7AC +sub_805D7AC: @ 805D7AC + push {lr} + adds r2, r0, 0 + ldr r0, =0x020243fc + ldrh r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0805D7E4 + ldrh r0, [r2, 0x2E] + ldrh r1, [r2, 0x24] + adds r0, r1 + strh r0, [r2, 0x24] + lsls r0, 16 + cmp r0, 0 + bne _0805D7E4 + movs r1, 0x26 + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _0805D7E0 + ldr r0, =sub_805D7EC + b _0805D7E2 + .pool +_0805D7E0: + ldr r0, =DummyObjectCallback +_0805D7E2: + str r0, [r2, 0x1C] +_0805D7E4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_805D7AC + + thumb_func_start sub_805D7EC +sub_805D7EC: @ 805D7EC + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x26] + subs r0, 0x2 + strh r0, [r1, 0x26] + lsls r0, 16 + cmp r0, 0 + bne _0805D800 + ldr r0, =DummyObjectCallback + str r0, [r1, 0x1C] +_0805D800: + pop {r0} + bx r0 + .pool + thumb_func_end sub_805D7EC + + thumb_func_start move_anim_start_t2_for_situation +move_anim_start_t2_for_situation: @ 805D808 + push {r4-r6,lr} + adds r4, r1, 0 + lsls r0, 24 + ldr r6, =0x020244d0 + ldr r1, [r6] + ldr r5, =0x02024064 + ldrb r2, [r5] + ldr r3, [r1, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r3 + ldrb r2, [r1] + movs r3, 0x10 + orrs r2, r3 + strb r2, [r1] + cmp r0, 0 + bne _0805D888 + cmp r4, 0x20 + bne _0805D844 + ldrb r0, [r5] + movs r1, 0x6 + bl move_anim_start_t2 + b _0805D902 + .pool +_0805D844: + cmp r4, 0x8 + beq _0805D850 + movs r0, 0x80 + ands r0, r4 + cmp r0, 0 + beq _0805D85A +_0805D850: + ldrb r0, [r5] + movs r1, 0 + bl move_anim_start_t2 + b _0805D902 +_0805D85A: + cmp r4, 0x10 + bne _0805D868 + ldrb r0, [r5] + movs r1, 0x2 + bl move_anim_start_t2 + b _0805D902 +_0805D868: + movs r0, 0x7 + ands r0, r4 + cmp r0, 0 + beq _0805D87A + ldrb r0, [r5] + movs r1, 0x4 + bl move_anim_start_t2 + b _0805D902 +_0805D87A: + cmp r4, 0x40 + bne _0805D8EA + ldrb r0, [r5] + movs r1, 0x5 + bl move_anim_start_t2 + b _0805D902 +_0805D888: + movs r0, 0xF0 + lsls r0, 12 + ands r0, r4 + cmp r0, 0 + beq _0805D89C + ldrb r0, [r5] + movs r1, 0x3 + bl move_anim_start_t2 + b _0805D902 +_0805D89C: + movs r0, 0x7 + ands r0, r4 + cmp r0, 0 + beq _0805D8AE + ldrb r0, [r5] + movs r1, 0x1 + bl move_anim_start_t2 + b _0805D902 +_0805D8AE: + movs r0, 0x80 + lsls r0, 21 + ands r0, r4 + cmp r0, 0 + beq _0805D8C2 + ldrb r0, [r5] + movs r1, 0x7 + bl move_anim_start_t2 + b _0805D902 +_0805D8C2: + movs r0, 0x80 + lsls r0, 20 + ands r0, r4 + cmp r0, 0 + beq _0805D8D6 + ldrb r0, [r5] + movs r1, 0x8 + bl move_anim_start_t2 + b _0805D902 +_0805D8D6: + movs r0, 0xE0 + lsls r0, 8 + ands r0, r4 + cmp r0, 0 + beq _0805D8EA + ldrb r0, [r5] + movs r1, 0x9 + bl move_anim_start_t2 + b _0805D902 +_0805D8EA: + ldr r0, [r6] + ldrb r2, [r5] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + strb r0, [r1] +_0805D902: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end move_anim_start_t2_for_situation + + thumb_func_start move_anim_start_t3 +move_anim_start_t3: @ 805D908 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r4, [sp, 0x24] + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp] + lsls r3, 24 + lsrs r5, r3, 24 + lsls r4, 16 + lsrs r7, r4, 16 + cmp r5, 0 + bne _0805D950 + movs r0, 0x80 + ands r0, r7 + cmp r0, 0 + beq _0805D950 + ldr r0, =0x020244e4 + adds r0, r6, r0 + movs r2, 0x7F + adds r1, r7, 0 + ands r1, r2 + strb r1, [r0] + movs r0, 0x1 + b _0805DA1E + .pool +_0805D950: + ldr r0, =0x020244d0 + mov r9, r0 + ldr r0, [r0] + ldr r0, [r0] + lsls r4, r6, 2 + adds r0, r4, r0 + ldrb r1, [r0] + movs r2, 0x4 + mov r8, r2 + mov r0, r8 + ands r0, r1 + cmp r0, 0 + beq _0805D9CC + adds r0, r5, 0 + bl sub_805DAA0 + lsls r0, 24 + cmp r0, 0 + bne _0805D980 + movs r0, 0x1 + b _0805DA1E + .pool +_0805D980: + mov r1, r9 + ldr r0, [r1] + ldr r0, [r0] + adds r0, r4, r0 + ldrb r1, [r0] + mov r0, r8 + ands r0, r1 + cmp r0, 0 + beq _0805D9CC + cmp r5, 0x2 + bne _0805D9CC + ldr r1, =0x02020630 + ldr r0, =0x020241e4 + adds r0, r6, r0 + ldrb r2, [r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _0805D9CC + adds r0, r6, 0 + movs r1, 0x1 + bl refresh_graphics_maybe + adds r0, r6, 0 + bl sub_805E974 + movs r0, 0x1 + b _0805DA1E + .pool +_0805D9CC: + ldr r0, =0x02038436 + mov r2, r10 + strb r2, [r0] + ldr r0, =0x02038437 + mov r1, sp + ldrb r1, [r1] + strb r1, [r0] + ldr r4, =0x020244d0 + ldr r0, [r4] + ldr r0, [r0, 0x8] + strh r7, [r0] + ldr r0, =gUnknown_082C9320 + adds r1, r5, 0 + movs r2, 0 + bl move_something + ldr r0, =task0A_0803415C + movs r1, 0xA + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r6, [r1, 0x8] + ldr r0, [r4] + movs r2, 0x8 + ldrsh r1, [r1, r2] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0] + movs r0, 0 +_0805DA1E: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end move_anim_start_t3 + + thumb_func_start task0A_0803415C +task0A_0803415C: @ 805DA48 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x020383f8 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, =0x020383fd + ldrb r0, [r0] + cmp r0, 0 + bne _0805DA8A + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + ldrsh r0, [r0, r1] + ldr r2, [r2, 0x4] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1] + movs r0, 0x21 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + adds r0, r4, 0 + bl remove_task +_0805DA8A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task0A_0803415C + + thumb_func_start sub_805DAA0 +sub_805DAA0: @ 805DAA0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xD + bgt _0805DAB4 + cmp r0, 0xA + bge _0805DAB8 + cmp r0, 0x2 + beq _0805DAB8 + b _0805DABC +_0805DAB4: + cmp r0, 0x11 + bne _0805DABC +_0805DAB8: + movs r0, 0x1 + b _0805DABE +_0805DABC: + movs r0, 0 +_0805DABE: + pop {r1} + bx r1 + thumb_func_end sub_805DAA0 + + thumb_func_start move_anim_start_t4 +move_anim_start_t4: @ 805DAC4 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =0x02038436 + strb r1, [r0] + ldr r0, =0x02038437 + strb r2, [r0] + ldr r0, =gUnknown_082C937C + adds r1, r3, 0 + movs r2, 0 + bl move_something + ldr r0, =task0A_08034248 + movs r1, 0xA + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + ldr r0, =0x020244d0 + ldr r0, [r0] + movs r2, 0x8 + ldrsh r1, [r1, r2] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end move_anim_start_t4 + + thumb_func_start task0A_08034248 +task0A_08034248: @ 805DB34 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x020383f8 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, =0x020383fd + ldrb r0, [r0] + cmp r0, 0 + bne _0805DB76 + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + ldrsh r0, [r0, r1] + ldr r2, [r2, 0x4] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1] + movs r0, 0x41 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + adds r0, r4, 0 + bl remove_task +_0805DB76: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task0A_08034248 + + thumb_func_start sub_805DB8C +sub_805DB8C: @ 805DB8C + movs r0, 0 + bx lr + thumb_func_end sub_805DB8C + + thumb_func_start mplay_80342A4 +mplay_80342A4: @ 805DB90 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r5, 0 + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + beq _0805DBD8 + ldr r2, =0x020244d0 + ldr r0, [r2] + ldr r1, [r0, 0x4] + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x8] + adds r1, 0x1 + strb r1, [r0, 0x8] + ldr r2, [r2] + ldr r0, =0x02024064 + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x8] + cmp r0, 0x1D + bls _0805DBDC + ldr r0, =0x030075f0 + bl MPlayStop_rev01 + ldr r0, =0x03007630 + bl MPlayStop_rev01 +_0805DBD8: + cmp r5, 0 + beq _0805DBF0 +_0805DBDC: + movs r0, 0x1 + b _0805DC02 + .pool +_0805DBF0: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + strb r5, [r0, 0x8] + movs r0, 0 +_0805DC02: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end mplay_80342A4 + + thumb_func_start sub_805DC0C +sub_805DC0C: @ 805DC0C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r4, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + movs r1, 0 + bl pokemon_getattr + str r0, [sp] + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0] + mov r2, r8 + lsls r1, r2, 2 + adds r2, r1, r0 + ldrh r0, [r2, 0x2] + cmp r0, 0 + bne _0805DC50 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + ldr r6, [sp] + b _0805DC58 + .pool +_0805DC50: + ldrh r5, [r2, 0x2] + ldr r0, =0x020244bc + adds r0, r1, r0 + ldr r6, [r0] +_0805DC58: + adds r0, r4, 0 + movs r1, 0x1 + bl pokemon_getattr + mov r10, r0 + mov r0, r8 + bl battle_get_per_side_status + lsls r0, 24 + lsls r2, r5, 3 + ldr r1, =gMonFrontPicTable + adds r2, r1 + ldr r1, =0x020244d4 + ldr r1, [r1] + lsrs r0, 22 + adds r1, 0x4 + adds r1, r0 + ldr r1, [r1] + adds r0, r2, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack + mov r3, r8 + lsls r2, r3, 4 + movs r0, 0x80 + lsls r0, 1 + adds r7, r2, r0 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0] + lsls r1, r3, 2 + adds r0, r1, r0 + ldrh r0, [r0, 0x2] + str r1, [sp, 0x4] + mov r9, r2 + cmp r0, 0 + bne _0805DCBC + adds r0, r4, 0 + bl pokemon_get_pal + b _0805DCC6 + .pool +_0805DCBC: + adds r0, r5, 0 + mov r1, r10 + ldr r2, [sp] + bl species_and_otid_get_pal +_0805DCC6: + adds r6, r0, 0 + ldr r4, =0x0201c000 + adds r0, r6, 0 + adds r1, r4, 0 + bl LZDecompressWram + adds r0, r4, 0 + adds r1, r7, 0 + movs r2, 0x20 + bl gpu_pal_apply + mov r1, r9 + adds r1, 0x80 + adds r0, r4, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =0x00000181 + cmp r5, r0 + bne _0805DD1A + movs r7, 0x80 + lsls r7, 1 + add r7, r9 + ldr r5, =0x0202449c + ldr r1, [r5] + movs r4, 0x80 + lsls r4, 1 + adds r1, r4 + adds r0, r6, 0 + bl LZDecompressWram + ldr r0, =0x020244e4 + add r0, r8 + ldrb r1, [r0] + lsls r1, 5 + adds r1, r4 + ldr r0, [r5] + adds r0, r1 + adds r1, r7, 0 + movs r2, 0x20 + bl gpu_pal_apply +_0805DD1A: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0] + ldr r1, [sp, 0x4] + adds r0, r1, r0 + ldrh r0, [r0, 0x2] + cmp r0, 0 + beq _0805DD46 + ldr r3, =0x00007fff + adds r0, r7, 0 + movs r1, 0x10 + movs r2, 0x6 + bl pal_fade_1 + lsls r1, r7, 1 + ldr r0, =0x02037b14 + adds r0, r1, r0 + ldr r2, =0x02037714 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet +_0805DD46: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805DC0C + + thumb_func_start sub_805DD7C +sub_805DD7C: @ 805DD7C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r6, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + movs r1, 0 + bl pokemon_getattr + str r0, [sp] + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0] + mov r2, r8 + lsls r1, r2, 2 + adds r2, r1, r0 + ldrh r0, [r2, 0x2] + cmp r0, 0 + bne _0805DDC0 + adds r0, r6, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + ldr r4, [sp] + b _0805DDC8 + .pool +_0805DDC0: + ldrh r5, [r2, 0x2] + ldr r0, =0x020244bc + adds r0, r1, r0 + ldr r4, [r0] +_0805DDC8: + adds r0, r6, 0 + movs r1, 0x1 + bl pokemon_getattr + str r0, [sp, 0x4] + mov r0, r8 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r7, r0, 24 + movs r0, 0x1 + mov r1, r8 + bl sub_80688F8 + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + lsls r1, 2 + mov r10, r1 + cmp r0, 0x1 + beq _0805DE00 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0] + add r0, r10 + ldrh r0, [r0, 0x2] + cmp r0, 0 + beq _0805DE2C +_0805DE00: + lsls r0, r5, 3 + ldr r1, =gMonBackPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r1, [r1] + lsls r2, r7, 2 + adds r1, 0x4 + adds r1, r2 + ldr r1, [r1] + adds r2, r5, 0 + adds r3, r4, 0 + bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack + b _0805DE46 + .pool +_0805DE2C: + lsls r0, r5, 3 + ldr r1, =gMonBackPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r1, [r1] + lsls r2, r7, 2 + adds r1, 0x4 + adds r1, r2 + ldr r1, [r1] + adds r2, r5, 0 + adds r3, r4, 0 + bl DecompressMonPic_DetectFrontOrBack +_0805DE46: + mov r2, r8 + lsls r1, r2, 4 + movs r0, 0x80 + lsls r0, 1 + adds r7, r1, r0 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0] + add r0, r10 + ldrh r0, [r0, 0x2] + mov r9, r1 + cmp r0, 0 + bne _0805DE74 + adds r0, r6, 0 + bl pokemon_get_pal + b _0805DE7E + .pool +_0805DE74: + adds r0, r5, 0 + ldr r1, [sp, 0x4] + ldr r2, [sp] + bl species_and_otid_get_pal +_0805DE7E: + adds r6, r0, 0 + ldr r4, =0x0201c000 + adds r0, r6, 0 + adds r1, r4, 0 + bl LZDecompressWram + adds r0, r4, 0 + adds r1, r7, 0 + movs r2, 0x20 + bl gpu_pal_apply + mov r1, r9 + adds r1, 0x80 + adds r0, r4, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =0x00000181 + cmp r5, r0 + bne _0805DED2 + movs r7, 0x80 + lsls r7, 1 + add r7, r9 + ldr r5, =0x0202449c + ldr r1, [r5] + movs r4, 0x80 + lsls r4, 1 + adds r1, r4 + adds r0, r6, 0 + bl LZDecompressWram + ldr r0, =0x020244e4 + add r0, r8 + ldrb r1, [r0] + lsls r1, 5 + adds r1, r4 + ldr r0, [r5] + adds r0, r1 + adds r1, r7, 0 + movs r2, 0x20 + bl gpu_pal_apply +_0805DED2: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0] + add r0, r10 + ldrh r0, [r0, 0x2] + cmp r0, 0 + beq _0805DEFC + ldr r3, =0x00007fff + adds r0, r7, 0 + movs r1, 0x10 + movs r2, 0x6 + bl pal_fade_1 + lsls r1, r7, 1 + ldr r0, =0x02037b14 + adds r0, r1, r0 + ldr r2, =0x02037714 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet +_0805DEFC: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805DD7C + + thumb_func_start nullsub_23 +nullsub_23: @ 805DF30 + bx lr + thumb_func_end nullsub_23 + + thumb_func_start nullsub_24 +nullsub_24: @ 805DF34 + bx lr + thumb_func_end nullsub_24 + + thumb_func_start sub_805DF38 +sub_805DF38: @ 805DF38 + push {r4,lr} + adds r4, r0, 0 + adds r0, r1, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_per_side_status + lsls r0, 24 + lsls r4, 3 + ldr r2, =gTrainerFrontPicTable + adds r2, r4, r2 + ldr r1, =0x020244d4 + ldr r1, [r1] + lsrs r0, 22 + adds r1, 0x4 + adds r1, r0 + ldr r1, [r1] + adds r0, r2, 0 + movs r2, 0 + bl DecompressPicFromTable_2 + ldr r0, =gTrainerFrontPicPaletteTable + adds r4, r0 + adds r0, r4, 0 + bl LoadCompressedObjectPalette + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805DF38 + + thumb_func_start sub_805DF84 +sub_805DF84: @ 805DF84 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + lsls r5, 16 + lsrs r5, 16 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl battle_get_per_side_status + lsls r0, 24 + lsls r5, 3 + ldr r2, =gTrainerBackPicTable + adds r2, r5, r2 + ldr r1, =0x020244d4 + ldr r1, [r1] + lsrs r0, 22 + adds r1, 0x4 + adds r1, r0 + ldr r1, [r1] + adds r0, r2, 0 + movs r2, 0 + bl DecompressPicFromTable_2 + ldr r0, =gTrainerBackPicPaletteTable + adds r5, r0 + ldr r0, [r5] + lsls r4, 20 + movs r1, 0x80 + lsls r1, 17 + adds r4, r1 + lsrs r4, 16 + adds r1, r4, 0 + movs r2, 0x20 + bl decompress_palette + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805DF84 + + thumb_func_start nullsub_25 +nullsub_25: @ 805DFE0 + bx lr + thumb_func_end nullsub_25 + + thumb_func_start sub_805DFE4 +sub_805DFE4: @ 805DFE4 + push {lr} + lsls r0, 16 + ldr r1, =gTrainerFrontPicPaletteTable + lsrs r0, 13 + adds r0, r1 + ldrh r0, [r0, 0x4] + bl FreeObjectPaletteByTag + pop {r0} + bx r0 + .pool + thumb_func_end sub_805DFE4 + + thumb_func_start sub_805DFFC +sub_805DFFC: @ 805DFFC + push {r4-r7,lr} + ldr r4, =gUnknown_0832C128 + adds r0, r4, 0 + bl LoadTaggedObjectPalette + adds r4, 0x8 + adds r0, r4, 0 + bl LoadTaggedObjectPalette + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _0805E034 + ldr r0, =gUnknown_0832C0D0 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0832C0D8 + bl LoadCompressedObjectPic + movs r5, 0x2 + b _0805E056 + .pool +_0805E034: + ldr r4, =gUnknown_0832C0E0 + adds r0, r4, 0 + bl LoadCompressedObjectPic + adds r4, 0x8 + adds r0, r4, 0 + bl LoadCompressedObjectPic + ldr r4, =gUnknown_0832C0F0 + adds r0, r4, 0 + bl LoadCompressedObjectPic + adds r4, 0x8 + adds r0, r4, 0 + bl LoadCompressedObjectPic + movs r5, 0x4 +_0805E056: + movs r4, 0 + cmp r4, r5 + bcs _0805E076 + ldr r7, =0x02024076 + ldr r6, =gUnknown_0832C108 +_0805E060: + adds r0, r4, r7 + ldrb r0, [r0] + lsls r0, 3 + adds r0, r6 + bl LoadCompressedObjectPic + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _0805E060 +_0805E076: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805DFFC + + thumb_func_start sub_805E08C +sub_805E08C: @ 805E08C + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + movs r6, 0 + cmp r4, 0 + bne _0805E09C + b _0805E1AE +_0805E09C: + cmp r4, 0x1 + bne _0805E0B8 + ldr r4, =gUnknown_0832C128 + adds r0, r4, 0 + bl LoadTaggedObjectPalette + adds r4, 0x8 + adds r0, r4, 0 + bl LoadTaggedObjectPalette + b _0805E1AE + .pool +_0805E0B8: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _0805E120 + cmp r4, 0x2 + bne _0805E0F0 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0805E0E4 + ldr r0, =gUnknown_0832C100 + bl LoadCompressedObjectPic + b _0805E1AE + .pool +_0805E0E4: + ldr r0, =gUnknown_0832C0D0 + bl LoadCompressedObjectPic + b _0805E1AE + .pool +_0805E0F0: + cmp r4, 0x3 + bne _0805E100 + ldr r0, =gUnknown_0832C0D8 + bl LoadCompressedObjectPic + b _0805E1AE + .pool +_0805E100: + cmp r4, 0x4 + bne _0805E110 + ldr r0, =0x02024076 + ldrb r0, [r0] + b _0805E198 + .pool +_0805E110: + cmp r4, 0x5 + bne _0805E1AC + ldr r0, =0x02024076 + ldrb r0, [r0, 0x1] + b _0805E198 + .pool +_0805E120: + cmp r4, 0x2 + bne _0805E130 + ldr r0, =gUnknown_0832C0E0 + bl LoadCompressedObjectPic + b _0805E1AE + .pool +_0805E130: + cmp r4, 0x3 + bne _0805E140 + ldr r0, =gUnknown_0832C0E8 + bl LoadCompressedObjectPic + b _0805E1AE + .pool +_0805E140: + cmp r4, 0x4 + bne _0805E150 + ldr r0, =gUnknown_0832C0F0 + bl LoadCompressedObjectPic + b _0805E1AE + .pool +_0805E150: + cmp r4, 0x5 + bne _0805E160 + ldr r0, =gUnknown_0832C0F8 + bl LoadCompressedObjectPic + b _0805E1AE + .pool +_0805E160: + cmp r4, 0x6 + bne _0805E170 + ldr r0, =0x02024076 + ldrb r0, [r0] + b _0805E198 + .pool +_0805E170: + cmp r4, 0x7 + bne _0805E180 + ldr r0, =0x02024076 + ldrb r0, [r0, 0x1] + b _0805E198 + .pool +_0805E180: + cmp r4, 0x8 + bne _0805E190 + ldr r0, =0x02024076 + ldrb r0, [r0, 0x2] + b _0805E198 + .pool +_0805E190: + cmp r5, 0x9 + bne _0805E1AC + ldr r0, =0x02024076 + ldrb r0, [r0, 0x3] +_0805E198: + lsls r0, 3 + ldr r1, =gUnknown_0832C108 + adds r0, r1 + bl LoadCompressedObjectPic + b _0805E1AE + .pool +_0805E1AC: + movs r6, 0x1 +_0805E1AE: + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_805E08C + + thumb_func_start load_gfxc_health_bar +load_gfxc_health_bar: @ 805E1B8 + push {lr} + ldr r0, =gUnknown_08C093F0 + ldr r1, =0x020244d4 + ldr r1, [r1] + movs r2, 0xBA + lsls r2, 1 + adds r1, r2 + ldr r1, [r1] + bl LZDecompressWram + pop {r0} + bx r0 + .pool + thumb_func_end load_gfxc_health_bar + + thumb_func_start battle_load_something +battle_load_something: @ 805E1D8 + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r6, 0 + ldrb r0, [r5] + cmp r0, 0x6 + bls _0805E1E8 + b _0805E346 +_0805E1E8: + lsls r0, 2 + ldr r1, =_0805E1F8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0805E1F8: + .4byte _0805E214 + .4byte _0805E21A + .4byte _0805E324 + .4byte _0805E230 + .4byte _0805E260 + .4byte _0805E29C + .4byte _0805E33C +_0805E214: + bl sub_805E378 + b _0805E324 +_0805E21A: + ldrb r0, [r4] + bl sub_805E08C + lsls r0, 24 + cmp r0, 0 + beq _0805E228 + b _0805E320 +_0805E228: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _0805E346 +_0805E230: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0805E24C + ldrb r0, [r4] + cmp r0, 0 + bne _0805E24C + bl battle_make_oam_safari_battle + b _0805E252 + .pool +_0805E24C: + ldrb r0, [r4] + bl battle_make_oam_normal_battle +_0805E252: + ldr r2, =0x03005d70 + ldrb r1, [r4] + adds r1, r2 + strb r0, [r1] + b _0805E30E + .pool +_0805E260: + ldrb r0, [r4] + bl sub_8072B18 + ldr r0, =0x02024076 + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + cmp r0, 0x1 + bhi _0805E288 + ldr r0, =0x03005d70 + adds r0, r1, r0 + ldrb r0, [r0] + movs r1, 0 + bl nullsub_30 + b _0805E30E + .pool +_0805E288: + ldr r0, =0x03005d70 + adds r0, r1, r0 + ldrb r0, [r0] + movs r1, 0x1 + bl nullsub_30 + b _0805E30E + .pool +_0805E29C: + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0805E2E4 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0805E302 + ldr r0, =0x03005d70 + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x020244ec + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe + b _0805E302 + .pool +_0805E2E4: + ldr r0, =0x03005d70 + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x02024744 + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe +_0805E302: + ldr r1, =0x03005d70 + ldrb r0, [r4] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 +_0805E30E: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bne _0805E346 +_0805E320: + movs r0, 0 + strb r0, [r4] +_0805E324: + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + b _0805E346 + .pool +_0805E33C: + bl sub_805EC84 + bl sub_81B8C68 + movs r6, 0x1 +_0805E346: + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end battle_load_something + + thumb_func_start sub_805E350 +sub_805E350: @ 805E350 + push {r4,lr} + ldr r4, =0x020244d0 + ldr r0, [r4] + ldr r0, [r0, 0x4] + movs r1, 0 + movs r2, 0x30 + bl memset + ldr r0, [r4] + ldr r0, [r0, 0x8] + movs r1, 0 + movs r2, 0x10 + bl memset + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805E350 + + thumb_func_start sub_805E378 +sub_805E378: @ 805E378 + push {lr} + bl sub_805E350 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0] + movs r1, 0 + movs r2, 0x10 + bl memset + pop {r0} + bx r0 + .pool + thumb_func_end sub_805E378 + + thumb_func_start sub_805E394 +sub_805E394: @ 805E394 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r4, 0 + ldr r5, =0x0202406c + ldrb r0, [r5] + cmp r4, r0 + bge _0805E3EA + ldr r0, =0x02020630 + mov r9, r0 + movs r0, 0x1 + mov r12, r0 + movs r0, 0x2 + negs r0, r0 + mov r8, r0 + ldr r7, =0x020244d0 + ldr r6, =0x020241e4 +_0805E3B8: + ldr r0, [r7] + ldr r0, [r0] + lsls r3, r4, 2 + adds r3, r0 + adds r0, r4, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r9 + adds r0, 0x3E + ldrb r1, [r0] + lsls r1, 29 + lsrs r1, 31 + mov r0, r12 + ands r1, r0 + ldrb r2, [r3] + mov r0, r8 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + adds r4, 0x1 + ldrb r0, [r5] + cmp r4, r0 + blt _0805E3B8 +_0805E3EA: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805E394 + + thumb_func_start sub_805E408 +sub_805E408: @ 805E408 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x020244d0 + ldr r1, [r1] + ldr r1, [r1] + lsls r3, r0, 2 + adds r3, r1 + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r1, [r0] + lsls r1, 29 + lsrs r1, 31 + ldrb r2, [r3] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + bx lr + .pool + thumb_func_end sub_805E408 + + thumb_func_start sub_805E448 +sub_805E448: @ 805E448 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + lsls r2, 24 + cmp r2, 0 + beq _0805E51C + ldr r0, =0x020241e4 + adds r5, r7, r0 + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + mov r8, r1 + add r0, r8 + ldr r4, =0x020244d0 + ldr r1, [r4] + ldr r1, [r1, 0x8] + ldrb r1, [r1] + bl StartObjectImageAnim + lsls r0, r7, 20 + movs r2, 0x80 + lsls r2, 17 + adds r0, r2 + lsrs r6, r0, 16 + ldr r2, =0x0202449c + ldr r0, [r4] + ldr r0, [r0, 0x8] + ldrh r1, [r0] + lsls r1, 5 + movs r3, 0x80 + lsls r3, 1 + adds r1, r3 + ldr r0, [r2] + adds r0, r1 + adds r1, r6, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, =0x020244e4 + adds r1, r7, r1 + ldr r0, [r4] + ldr r0, [r0, 0x8] + ldrh r0, [r0] + strb r0, [r1] + ldr r0, [r4] + ldr r1, [r0] + lsls r0, r7, 2 + adds r0, r1 + ldrh r0, [r0, 0x2] + cmp r0, 0 + beq _0805E4DE + ldr r3, =0x00007fff + adds r0, r6, 0 + movs r1, 0x10 + movs r2, 0x6 + bl pal_fade_1 + lsls r1, r6, 1 + ldr r0, =0x02037b14 + adds r0, r1, r0 + ldr r2, =0x02037714 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet +_0805E4DE: + adds r0, r7, 0 + bl sub_80A6138 + ldrb r2, [r5] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0x22] + b _0805E77A + .pool +_0805E51C: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0805E558 + movs r0, 0 + mov r10, r0 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0, 0x18] + ldrh r1, [r2, 0x2] + mov r8, r1 + ldr r3, [r2, 0x8] + mov r9, r3 + ldr r4, [r2, 0xC] + lsls r0, r1, 3 + ldr r1, =gMonBackPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r1, [r1] + ldr r1, [r1, 0x4] + ldr r3, [r2, 0x10] + b _0805E5FA + .pool +_0805E558: + adds r0, r7, 0 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r0, [sp] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0805E58C + ldr r1, =0x0202406e + ldr r2, [sp] + lsls r0, r2, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + b _0805E59C + .pool +_0805E58C: + ldr r1, =0x0202406e + ldr r3, [sp] + lsls r0, r3, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec +_0805E59C: + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + adds r0, r7, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0805E618 + ldr r0, =0x0202406e + lsls r4, r7, 1 + adds r4, r0 + ldrh r0, [r4] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x020244ec + adds r0, r5 + movs r1, 0 + bl pokemon_getattr + mov r9, r0 + ldrh r0, [r4] + muls r0, r6 + adds r0, r5 + movs r1, 0x1 + bl pokemon_getattr + adds r4, r0, 0 + mov r1, r8 + lsls r0, r1, 3 + ldr r1, =gMonBackPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r1, [r1] + mov r3, r10 + lsls r2, r3, 2 + adds r1, 0x4 + adds r1, r2 + ldr r1, [r1] + ldr r3, =0x020244bc + lsls r2, r7, 2 + adds r2, r3 + ldr r3, [r2] +_0805E5FA: + mov r2, r8 + bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack + b _0805E662 + .pool +_0805E618: + ldr r0, =0x0202406e + lsls r4, r7, 1 + adds r4, r0 + ldrh r0, [r4] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x02024744 + adds r0, r5 + movs r1, 0 + bl pokemon_getattr + mov r9, r0 + ldrh r0, [r4] + muls r0, r6 + adds r0, r5 + movs r1, 0x1 + bl pokemon_getattr + adds r4, r0, 0 + mov r1, r8 + lsls r0, r1, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r1, [r1] + mov r3, r10 + lsls r2, r3, 2 + adds r1, 0x4 + adds r1, r2 + ldr r1, [r1] + ldr r3, =0x020244bc + lsls r2, r7, 2 + adds r2, r3 + ldr r3, [r2] + mov r2, r8 + bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack +_0805E662: + ldr r0, =0x020244d4 + ldr r0, [r0] + mov r2, r10 + lsls r1, r2, 2 + adds r0, 0x4 + adds r0, r1 + ldr r2, [r0] + ldr r0, =0x020241e4 + adds r0, r7 + mov r10, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r3, =0x02020630 + adds r0, r3 + ldrh r0, [r0, 0x4] + lsls r0, 22 + lsrs r0, 17 + ldr r1, =0x06010000 + adds r0, r1 + ldr r1, =0x040000d4 + str r2, [r1] + str r0, [r1, 0x4] + ldr r0, =0x84000200 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + lsls r0, r7, 20 + movs r1, 0x80 + lsls r1, 17 + adds r0, r1 + lsrs r6, r0, 16 + mov r0, r8 + adds r1, r4, 0 + mov r2, r9 + bl species_and_otid_get_pal + mov r9, r0 + ldr r4, =0x0201c000 + adds r1, r4, 0 + bl LZDecompressWram + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =0x00000181 + cmp r8, r0 + bne _0805E70A + mov r2, r10 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r1, 0x8 + adds r0, r1 + ldr r1, =gUnknown_08309AAC + mov r3, r8 + lsls r2, r3, 2 + adds r1, r2 + ldr r1, [r1] + str r1, [r0] + ldr r5, =0x0202449c + ldr r1, [r5] + movs r4, 0x80 + lsls r4, 1 + adds r1, r4 + mov r0, r9 + bl LZDecompressWram + ldr r0, =0x020244e4 + ldr r1, [sp] + adds r0, r1, r0 + ldrb r1, [r0] + lsls r1, 5 + adds r1, r4 + ldr r0, [r5] + adds r0, r1 + adds r1, r6, 0 + movs r2, 0x20 + bl gpu_pal_apply +_0805E70A: + ldr r3, =0x00007fff + adds r0, r6, 0 + movs r1, 0x10 + movs r2, 0x6 + bl pal_fade_1 + lsls r1, r6, 1 + ldr r0, =0x02037b14 + adds r0, r1, r0 + ldr r2, =0x02037714 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0805E74A + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r7, 2 + adds r0, r1 + mov r2, r8 + strh r2, [r0, 0x2] + ldr r0, =0x020244e4 + adds r1, r7, r0 + ldr r3, [sp] + adds r0, r3, r0 + ldrb r0, [r0] + strb r0, [r1] +_0805E74A: + adds r0, r7, 0 + bl sub_80A6138 + mov r1, r10 + ldrb r2, [r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + ldr r2, =0x02020630 + adds r1, r2 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0x22] + mov r3, r10 + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x020244e4 + adds r1, r7, r1 + ldrb r1, [r1] + bl StartObjectImageAnim +_0805E77A: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805E448 + + thumb_func_start sub_805E7DC +sub_805E7DC: @ 805E7DC + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + lsls r1, 24 + cmp r1, 0 + bne _0805E898 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0805E7F8 + movs r4, 0 + b _0805E802 +_0805E7F8: + adds r0, r4, 0 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r4, r0, 24 +_0805E802: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0805E814 + ldr r0, =gUnknown_08C2D120 + b _0805E822 + .pool +_0805E814: + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0805E83C + ldr r0, =gUnknown_08C2CEE0 +_0805E822: + ldr r1, =0x020244d4 + ldr r1, [r1] + lsls r4, 2 + adds r1, 0x4 + adds r1, r4 + ldr r1, [r1] + bl LZDecompressVram + b _0805E84E + .pool +_0805E83C: + ldr r0, =gUnknown_08C2D120 + ldr r1, =0x020244d4 + ldr r1, [r1] + lsls r4, 2 + adds r1, 0x4 + adds r1, r4 + ldr r1, [r1] + bl LZDecompressVram +_0805E84E: + movs r3, 0x1 + lsls r6, r5, 4 + ldr r7, =gUnknown_08C2CEBC + ldr r0, =0x020244d4 + ldr r0, [r0] + adds r0, 0x4 + adds r4, r0, r4 + ldr r2, =0x040000d4 + ldr r5, =0x84000200 +_0805E860: + ldr r0, [r4] + lsls r1, r3, 11 + adds r1, r0, r1 + str r0, [r2] + str r1, [r2, 0x4] + str r5, [r2, 0x8] + ldr r0, [r2, 0x8] + adds r3, 0x1 + cmp r3, 0x3 + ble _0805E860 + movs r0, 0x80 + lsls r0, 1 + adds r1, r6, r0 + adds r0, r7, 0 + movs r2, 0x20 + bl decompress_palette + b _0805E8E6 + .pool +_0805E898: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0805E8E6 + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0805E8D0 + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + adds r1, r4, 0 + bl sub_805DC0C + b _0805E8E6 + .pool +_0805E8D0: + ldr r1, =0x0202406e + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + adds r1, r5, 0 + bl sub_805DD7C +_0805E8E6: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805E7DC + + thumb_func_start refresh_graphics_maybe +refresh_graphics_maybe: @ 805E8F4 + push {r4-r6,lr} + adds r5, r1, 0 + adds r4, r2, 0 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_805E7DC + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, =0x02020630 + adds r4, r0, r1 + ldr r0, =0x020244e4 + adds r0, r6, r0 + ldrb r1, [r0] + adds r0, r4, 0 + bl StartObjectImageAnim + cmp r5, 0 + bne _0805E938 + adds r0, r6, 0 + bl sub_80A614C + b _0805E93E + .pool +_0805E938: + adds r0, r6, 0 + bl sub_80A6138 +_0805E93E: + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x22] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end refresh_graphics_maybe + + thumb_func_start sub_805E94C +sub_805E94C: @ 805E94C + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 16 + lsrs r1, 16 + cmp r1, 0xA4 + bne _0805E96C + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0] + lsls r1, r2, 2 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] +_0805E96C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_805E94C + + thumb_func_start sub_805E974 +sub_805E974: @ 805E974 + lsls r0, 24 + ldr r1, =0x020244d0 + ldr r1, [r1] + ldr r1, [r1] + lsrs r0, 22 + adds r0, r1 + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + bx lr + .pool + thumb_func_end sub_805E974 + + thumb_func_start sub_805E990 +sub_805E990: @ 805E990 + push {r4-r7,lr} + adds r5, r0, 0 + lsls r1, 24 + lsrs r6, r1, 24 + adds r7, r6, 0 + movs r1, 0x39 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x3A + bl pokemon_getattr + adds r1, r0, 0 + lsls r4, 16 + asrs r4, 16 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + bl sub_8075060 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0805EA08 + ldr r7, =0x020244d0 + ldr r0, [r7] + ldr r2, [r0] + lsls r4, r6, 2 + adds r0, r4, r2 + ldrb r1, [r0] + movs r5, 0x2 + movs r3, 0x2 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _0805EA5A + adds r0, r6, 0 + eors r0, r5 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _0805E9F6 + movs r0, 0x5A + bl audio_play +_0805E9F6: + ldr r0, [r7] + ldr r1, [r0] + adds r1, r4, r1 + ldrb r0, [r1] + orrs r0, r5 + strb r0, [r1] + b _0805EA5A + .pool +_0805EA08: + ldr r4, =0x020244d0 + ldr r0, [r4] + ldr r0, [r0] + lsls r1, r6, 2 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _0805EA34 + movs r0, 0x5A + bl m4aSongNumStop + b _0805EA5A + .pool +_0805EA34: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0805EA5A + ldr r1, [r4] + movs r0, 0x2 + eors r7, r0 + ldr r1, [r1] + lsls r0, r7, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0805EA5A + movs r0, 0x5A + bl m4aSongNumStop +_0805EA5A: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_805E990 + + thumb_func_start sub_805EA60 +sub_805EA60: @ 805EA60 + push {r4-r6,lr} + movs r0, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r4, r0, 24 + ldr r5, =0x020244d0 + ldr r0, [r5] + ldr r0, [r0] + lsls r1, r4, 2 + adds r1, r0 + ldrb r2, [r1] + movs r6, 0x3 + negs r6, r6 + adds r0, r6, 0 + ands r0, r2 + strb r0, [r1] + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0805EAA2 + ldr r2, [r5] + movs r0, 0x2 + adds r1, r4, 0 + eors r1, r0 + ldr r0, [r2] + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1] + adds r0, r6, 0 + ands r0, r2 + strb r0, [r1] +_0805EAA2: + movs r0, 0x5A + bl m4aSongNumStop + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805EA60 + + thumb_func_start sub_805EAB4 +sub_805EAB4: @ 805EAB4 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x39 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x3A + bl pokemon_getattr + adds r1, r0, 0 + lsls r4, 16 + asrs r4, 16 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + bl sub_8075060 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_805EAB4 + + thumb_func_start sub_805EAE8 +sub_805EAE8: @ 805EAE8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0805EB7E + movs r0, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r0, 0x2 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r5, =0x0202406e + mov r1, r8 + lsls r0, r1, 1 + adds r0, r5 + ldrb r0, [r0] + bl pokemon_order_func + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + mov r1, r9 + lsls r0, r1, 1 + adds r0, r5 + ldrb r0, [r0] + bl pokemon_order_func + lsls r0, 24 + lsrs r5, r0, 24 + movs r7, 0x64 + adds r0, r4, 0 + muls r0, r7 + ldr r6, =0x020244ec + adds r4, r0, r6 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _0805EB5A + adds r0, r4, 0 + mov r1, r8 + bl sub_805E990 +_0805EB5A: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0805EB7E + adds r0, r5, 0 + muls r0, r7 + adds r4, r0, r6 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _0805EB7E + adds r0, r4, 0 + mov r1, r9 + bl sub_805E990 +_0805EB7E: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805EAE8 + + thumb_func_start sub_805EB9C +sub_805EB9C: @ 805EB9C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r5, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r5, r0 + bge _0805EC6C + movs r0, 0x3 + mov r10, r8 + mov r1, r10 + ands r1, r0 + mov r10, r1 + movs r6, 0 + movs r2, 0x3F + negs r2, r2 + mov r9, r2 +_0805EBC8: + lsls r0, r5, 24 + lsrs r0, 24 + bl sub_80A6A90 + lsls r0, 24 + cmp r0, 0 + beq _0805EC60 + ldr r4, =0x02020630 + ldr r0, =0x020241e4 + adds r3, r5, r0 + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0, 0x1] + movs r7, 0x4 + negs r7, r7 + adds r2, r7, 0 + ands r1, r2 + mov r2, r10 + orrs r1, r2 + strb r1, [r0, 0x1] + mov r7, r8 + cmp r7, 0 + bne _0805EC3C + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r2, [r0, 0x4] + adds r2, r6, r2 + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + strb r0, [r2, 0x6] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0, 0x3] + mov r2, r9 + ands r1, r2 + strb r1, [r0, 0x3] + b _0805EC60 + .pool +_0805EC3C: + ldrb r0, [r3] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r4 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x4] + adds r0, r6, r0 + ldrb r1, [r0, 0x6] + movs r0, 0x1F + ands r1, r0 + lsls r1, 1 + ldrb r0, [r2, 0x3] + mov r3, r9 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x3] +_0805EC60: + adds r6, 0xC + adds r5, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r5, r0 + blt _0805EBC8 +_0805EC6C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805EB9C + + thumb_func_start sub_805EC84 +sub_805EC84: @ 805EC84 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =gUnknown_0831C6A0 + bl LoadCompressedObjectPic + movs r0, 0x1 + bl battle_get_side_with_given_state + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_0831C6B0 + mov r8, r0 + adds r0, r5, 0 + movs r1, 0 + bl sub_80A5C6C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A5C6C + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 8 + movs r0, 0xE8 + lsls r0, 13 + adds r2, r0 + asrs r2, 16 + mov r0, r8 + adds r1, r4, 0 + movs r3, 0xC8 + bl AddObjectToFront + ldr r6, =0x020244d0 + ldr r1, [r6] + ldr r2, [r1, 0x4] + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 2 + adds r2, r1, r2 + strb r0, [r2, 0x7] + ldr r7, =0x02020630 + ldr r0, [r6] + ldr r0, [r0, 0x4] + adds r1, r0 + ldrb r1, [r1, 0x7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r5, [r0, 0x2E] + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0805ED56 + movs r0, 0x3 + bl battle_get_side_with_given_state + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r5, 0 + movs r1, 0 + bl sub_80A5C6C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A5C6C + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 8 + movs r0, 0xE8 + lsls r0, 13 + adds r2, r0 + asrs r2, 16 + mov r0, r8 + adds r1, r4, 0 + movs r3, 0xC8 + bl AddObjectToFront + ldr r1, [r6] + ldr r2, [r1, 0x4] + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 2 + adds r2, r1, r2 + strb r0, [r2, 0x7] + ldr r0, [r6] + ldr r0, [r0, 0x4] + adds r1, r0 + ldrb r1, [r1, 0x7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r5, [r0, 0x2E] +_0805ED56: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805EC84 + + thumb_func_start sub_805ED70 +@ int sub_805ED70(obj *a1) +sub_805ED70: @ 805ED70 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + movs r0, 0 + mov r8, r0 + ldrh r0, [r5, 0x2E] + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x020241e4 + adds r0, r4, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r7, r0, r1 + adds r6, r7, 0 + adds r6, 0x3E + ldrb r1, [r6] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0805EDAC + adds r0, r4, 0 + bl sub_80A6A90 + lsls r0, 24 + cmp r0, 0 + bne _0805EDC0 +_0805EDAC: + ldr r0, =sub_805EE48 + str r0, [r5, 0x1C] + b _0805EE36 + .pool +_0805EDC0: + ldr r0, =0x020383fd + ldrb r0, [r0] + cmp r0, 0 + bne _0805EDD2 + ldrb r1, [r6] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0805EDE4 +_0805EDD2: + movs r0, 0x1 + mov r8, r0 + ldr r2, =0x020244d0 + lsls r4, 2 + b _0805EE06 + .pool +_0805EDE4: + ldr r2, =0x020244d0 + ldr r0, [r2] + ldr r0, [r0] + lsls r1, r4, 2 + adds r3, r1, r0 + ldrh r0, [r3, 0x2] + adds r4, r1, 0 + cmp r0, 0 + beq _0805EE06 + ldr r0, =gUnknown_08305DCC + ldrh r1, [r3, 0x2] + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + bne _0805EE06 + movs r0, 0x1 + mov r8, r0 +_0805EE06: + ldr r0, [r2] + ldr r0, [r0] + adds r0, r4, r0 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0805EE1A + movs r0, 0x1 + mov r8, r0 +_0805EE1A: + ldrh r0, [r7, 0x20] + strh r0, [r5, 0x20] + ldrh r0, [r7, 0x24] + strh r0, [r5, 0x24] + adds r2, r5, 0 + adds r2, 0x3E + mov r0, r8 + lsls r3, r0, 2 + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + orrs r0, r3 + strb r0, [r2] +_0805EE36: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805ED70 + + thumb_func_start sub_805EE48 +sub_805EE48: @ 805EE48 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + bx lr + thumb_func_end sub_805EE48 + + thumb_func_start sub_805EE54 +sub_805EE54: @ 805EE54 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + lsls r1, 16 + lsrs r5, r1, 16 + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0805EED0 + ldr r0, =0x020244d0 + ldr r3, [r0] + ldr r1, [r3] + lsls r0, r4, 2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2] + cmp r0, 0 + beq _0805EE7E + adds r5, r0, 0 +_0805EE7E: + ldr r0, =gUnknown_08305DCC + adds r0, r5, r0 + ldrb r0, [r0] + cmp r0, 0 + beq _0805EEB4 + ldr r2, =0x02020630 + ldr r1, [r3, 0x4] + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_805ED70 + b _0805EECE + .pool +_0805EEB4: + ldr r2, =0x02020630 + ldr r1, [r3, 0x4] + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_805EE48 +_0805EECE: + str r1, [r0] +_0805EED0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805EE54 + + thumb_func_start sub_805EEE0 +sub_805EEE0: @ 805EEE0 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02020630 + ldr r1, =0x020244d0 + ldr r1, [r1] + ldr r3, [r1, 0x4] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r1, [r1, 0x7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_805EE48 + str r1, [r0] + bx lr + .pool + thumb_func_end sub_805EEE0 + + thumb_func_start sub_805EF14 +sub_805EF14: @ 805EF14 + push {r4-r6,lr} + ldr r3, =0x06000240 + movs r0, 0 + movs r6, 0xF0 + lsls r6, 8 +_0805EF1E: + adds r5, r0, 0x1 + movs r4, 0xF +_0805EF22: + ldrh r1, [r3] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _0805EF32 + adds r0, r6, 0 + orrs r0, r1 + strh r0, [r3] +_0805EF32: + ldrh r1, [r3] + movs r2, 0xF0 + lsls r2, 4 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _0805EF46 + adds r0, r2, 0 + orrs r0, r1 + strh r0, [r3] +_0805EF46: + ldrh r1, [r3] + movs r2, 0xF0 + movs r0, 0xF0 + ands r0, r1 + cmp r0, 0 + bne _0805EF58 + adds r0, r1, 0 + orrs r0, r2 + strh r0, [r3] +_0805EF58: + ldrh r1, [r3] + movs r2, 0xF + movs r0, 0xF + ands r0, r1 + cmp r0, 0 + bne _0805EF6A + adds r0, r1, 0 + orrs r0, r2 + strh r0, [r3] +_0805EF6A: + adds r3, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _0805EF22 + adds r0, r5, 0 + cmp r0, 0x8 + ble _0805EF1E + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805EF14 + + thumb_func_start sub_805EF84 +sub_805EF84: @ 805EF84 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r2, [r0] + lsls r0, r4, 2 + adds r0, r2 + movs r3, 0 + movs r2, 0 + strh r2, [r0, 0x2] + ldr r0, =0x020244e4 + adds r0, r4, r0 + strb r3, [r0] + cmp r1, 0 + bne _0805EFAC + adds r0, r4, 0 + bl sub_805E974 +_0805EFAC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805EF84 + + thumb_func_start init_uns_table_pokemon_copy +init_uns_table_pokemon_copy: @ 805EFBC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r6, 0 + ldr r4, =0x020244d4 + str r6, [r4] + movs r0, 0xC0 + lsls r0, 1 + bl AllocZeroed + str r0, [r4] + movs r0, 0x80 + lsls r0, 8 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1] +_0805EFE2: + ldr r0, =0x020244d4 + ldr r1, [r0] + lsls r4, r6, 2 + adds r2, r1, 0x4 + adds r2, r4 + lsls r3, r6, 13 + ldr r0, [r1] + adds r0, r3 + str r0, [r2] + lsls r3, r6, 1 + adds r0, r3, r6 + lsls r0, 3 + adds r1, r0, r1 + ldr r2, =gUnknown_08329D98 + adds r1, 0x14 + adds r0, r2 + ldm r0!, {r2,r5,r7} + stm r1!, {r2,r5,r7} + ldm r0!, {r2,r5,r7} + stm r1!, {r2,r5,r7} + movs r5, 0 + mov r9, r3 + lsls r0, r6, 5 + mov r8, r0 + adds r1, r6, 0x1 + mov r10, r1 + mov r12, r8 + adds r7, r4, 0 +_0805F01A: + ldr r2, =0x020244d4 + ldr r1, [r2] + lsls r4, r5, 3 + add r4, r12 + adds r3, r1, 0 + adds r3, 0x74 + adds r3, r4 + adds r0, r1, 0x4 + adds r0, r7 + lsls r2, r5, 11 + ldr r0, [r0] + adds r0, r2 + str r0, [r3] + adds r1, r4 + adds r1, 0x78 + movs r0, 0x80 + lsls r0, 4 + strh r0, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _0805F01A + ldr r1, =0x020244d4 + ldr r2, [r1] + mov r5, r9 + adds r0, r5, r6 + lsls r0, 3 + adds r1, r2, 0 + adds r1, 0x20 + adds r1, r0 + mov r0, r8 + adds r0, 0x74 + adds r2, r0 + str r2, [r1] + mov r7, r10 + lsls r0, r7, 24 + lsrs r6, r0, 24 + cmp r6, 0x3 + bls _0805EFE2 + movs r0, 0x80 + lsls r0, 5 + bl AllocZeroed + ldr r1, =0x020244d4 + ldr r1, [r1] + movs r2, 0xBA + lsls r2, 1 + adds r1, r2 + str r0, [r1] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end init_uns_table_pokemon_copy + + thumb_func_start sub_805F094 +sub_805F094: @ 805F094 + push {r4-r6,lr} + ldr r6, =0x020244d4 + ldr r0, [r6] + cmp r0, 0 + beq _0805F106 + movs r1, 0xBE + lsls r1, 1 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + beq _0805F0BA + bl Free + ldr r0, [r6] + movs r1, 0xBE + lsls r1, 1 + adds r0, r1 + movs r1, 0 + str r1, [r0] +_0805F0BA: + ldr r0, [r6] + movs r1, 0xBC + lsls r1, 1 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + beq _0805F0D8 + bl Free + ldr r0, [r6] + movs r1, 0xBC + lsls r1, 1 + adds r0, r1 + movs r1, 0 + str r1, [r0] +_0805F0D8: + ldr r0, [r6] + movs r5, 0xBA + lsls r5, 1 + adds r0, r5 + ldr r0, [r0] + bl Free + ldr r0, [r6] + adds r5, r0, r5 + movs r4, 0 + str r4, [r5] + ldr r0, [r0] + bl Free + ldr r0, [r6] + str r4, [r0] + str r4, [r0, 0x4] + str r4, [r0, 0x8] + str r4, [r0, 0xC] + str r4, [r0, 0x10] + bl Free + str r4, [r6] +_0805F106: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805F094 + + thumb_func_start sub_805F110 +sub_805F110: @ 805F110 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x37 + bl pokemon_getattr + ldr r1, =0x00000fff + ands r1, r0 + cmp r1, 0 + bne _0805F158 + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x3A + bl pokemon_getattr + adds r1, r0, 0 + lsls r4, 16 + asrs r4, 16 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + bl sub_8075060 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + ble _0805F158 + movs r0, 0x1 + b _0805F15A + .pool +_0805F158: + movs r0, 0 +_0805F15A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_805F110 + + thumb_func_start nullsub_26 +nullsub_26: @ 805F160 + bx lr + thumb_func_end nullsub_26 + + thumb_func_start sub_805F164 +sub_805F164: @ 805F164 + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_exec_buffer_A_ch0_tbl7 + str r1, [r0] + bx lr + .pool + thumb_func_end sub_805F164 + + thumb_func_start bx_exec_buffer_A_ch0_tbl7 +bx_exec_buffer_A_ch0_tbl7: @ 805F180 + push {lr} + ldr r2, =0x02024068 + ldr r1, =gUnknown_0832A328 + ldr r0, =0x02024064 + ldrb r3, [r0] + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _0805F1CC + ldr r0, =0x02023064 + lsls r1, r3, 9 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x38 + bhi _0805F1C8 + ldr r0, =gUnknown_0831C6C8 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 + b _0805F1CC + .pool +_0805F1C8: + bl dp01_tbl7_exec_completed +_0805F1CC: + pop {r0} + bx r0 + thumb_func_end bx_exec_buffer_A_ch0_tbl7 + + thumb_func_start sub_805F1D0 +sub_805F1D0: @ 805F1D0 + push {lr} + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + bne _0805F1F4 + bl dp01_tbl7_exec_completed +_0805F1F4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_805F1D0 + + thumb_func_start sub_805F208 +sub_805F208: @ 805F208 + push {lr} + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + bne _0805F22C + bl dp01_tbl7_exec_completed +_0805F22C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_805F208 + + thumb_func_start sub_805F240 +sub_805F240: @ 805F240 + push {r4-r6,lr} + ldr r5, =0x02020630 + ldr r6, =0x020241e4 + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r2, r0, 2 + adds r0, r5, 0 + adds r0, 0x1C + adds r0, r2, r0 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + bne _0805F292 + adds r0, r2, r5 + ldrh r0, [r0, 0x6] + bl sub_805DFE4 + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl obj_free_rotscale_entry + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl RemoveObjectAndFreeTiles + bl dp01_tbl7_exec_completed +_0805F292: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805F240 + + thumb_func_start sub_805F2A8 +sub_805F2A8: @ 805F2A8 + push {r4,lr} + ldr r4, =0x020244d0 + ldr r1, [r4] + ldr r3, =0x02024064 + ldrb r0, [r3] + ldr r2, [r1, 0x4] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x9] + subs r0, 0x1 + strb r0, [r1, 0x9] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _0805F2E0 + ldr r0, [r4] + ldrb r1, [r3] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strb r1, [r0, 0x9] + bl dp01_tbl7_exec_completed +_0805F2E0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805F2A8 + + thumb_func_start sub_805F2F0 +sub_805F2F0: @ 805F2F0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r0, 0 + mov r10, r0 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0805F32C + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0805F31E + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0805F32C +_0805F31E: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0805F368 +_0805F32C: + ldr r2, =0x02020630 + ldr r1, =0x03005d70 + ldr r3, =0x02024064 + ldrb r0, [r3] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + bne _0805F34E + movs r1, 0x1 + mov r10, r1 +_0805F34E: + movs r6, 0 + b _0805F3A2 + .pool +_0805F368: + ldr r3, =0x02020630 + ldr r6, =0x03005d70 + ldr r2, =0x02024064 + ldrb r4, [r2] + adds r0, r4, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r3, 0x1C + adds r0, r3 + ldr r5, [r0] + ldr r0, =DummyObjectCallback + cmp r5, r0 + bne _0805F3A0 + movs r0, 0x2 + eors r4, r0 + adds r0, r4, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + cmp r0, r5 + bne _0805F3A0 + movs r0, 0x1 + mov r10, r0 +_0805F3A0: + movs r6, 0x1 +_0805F3A2: + ldr r3, =0x020244d8 + ldr r1, =0x020244d0 + mov r8, r1 + ldr r2, [r1] + ldr r7, =0x02024064 + ldrb r1, [r7] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r5, [r2, 0x4] + adds r0, r5, r0 + str r0, [r3] + ldr r2, =0x020244dc + ldrb r0, [r7] + movs r1, 0x2 + mov r9, r1 + mov r1, r9 + eors r1, r0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r5, r0 + str r0, [r2] + mov r0, r10 + cmp r0, 0 + bne _0805F3D8 + b _0805F53C +_0805F3D8: + cmp r6, 0x1 + bne _0805F494 + ldrb r2, [r7] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r4, r0, r5 + ldrb r1, [r4, 0x1] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _0805F3F2 + b _0805F53C +_0805F3F2: + mov r0, r9 + eors r0, r2 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r0, [r1, 0x1] + ands r6, r0 + cmp r6, 0 + bne _0805F408 + b _0805F53C +_0805F408: + ldrb r1, [r4] + movs r3, 0x7F + adds r0, r3, 0 + ands r0, r1 + strb r0, [r4] + mov r1, r8 + ldr r0, [r1] + ldrb r2, [r7] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r4, 0x2 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + strb r0, [r1, 0x1] + mov r0, r8 + ldr r2, [r0] + ldrb r0, [r7] + mov r1, r9 + eors r1, r0 + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + ands r3, r1 + strb r3, [r0] + mov r1, r8 + ldr r2, [r1] + ldrb r0, [r7] + mov r1, r9 + eors r1, r0 + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1] + ands r4, r1 + strb r4, [r0, 0x1] + ldr r4, =0x000027f9 + adds r0, r4, 0 + bl FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + b _0805F51A + .pool +_0805F494: + ldrb r2, [r7] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r5 + ldrb r1, [r0, 0x1] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0805F53C + adds r0, r2, 0 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _0805F4E4 + mov r0, r8 + ldr r2, [r0] + ldrb r0, [r7] + mov r1, r9 + eors r1, r0 + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0] + movs r0, 0xC0 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + bne _0805F53C + ldr r4, =0x000027f9 + adds r0, r4, 0 + bl FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag +_0805F4E4: + mov r1, r8 + ldr r0, [r1] + ldr r1, =0x02024064 + ldrb r2, [r1] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x7F + ands r0, r2 + strb r0, [r1] + mov r1, r8 + ldr r0, [r1] + ldr r1, =0x02024064 + ldrb r2, [r1] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] +_0805F51A: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r3, =0x02024064 + ldrb r1, [r3] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x3 + strb r1, [r0, 0x9] + ldr r1, =0x03005d60 + ldrb r0, [r3] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805F2A8 + str r1, [r0] +_0805F53C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805F2F0 + + thumb_func_start sub_805F560 +sub_805F560: @ 805F560 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + mov r10, r0 + ldr r5, =0x020244d0 + ldr r0, [r5] + ldr r4, =0x02024064 + ldrb r2, [r4] + ldr r1, [r0, 0x4] + lsls r3, r2, 1 + adds r0, r3, r2 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0] + movs r6, 0xC4 + lsls r6, 1 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _0805F5A6 + ldr r0, =0x0202406e + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_0805F5A6: + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x00008040 + ands r0, r1 + cmp r0, 0 + bne _0805F5EE + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0805F5EE + ldr r2, [r5] + ldrb r1, [r4] + movs r0, 0x2 + adds r3, r0, 0 + eors r3, r1 + ldr r1, [r2, 0x4] + lsls r2, r3, 1 + adds r0, r2, r3 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _0805F5EE + ldr r0, =0x0202406e + adds r0, r2, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 + adds r1, r0 + adds r0, r3, 0 + bl sub_8172EF0 +_0805F5EE: + ldr r2, =0x020244d0 + ldr r0, [r2] + ldr r1, =0x02024064 + mov r8, r1 + ldrb r4, [r1] + ldr r5, [r0, 0x4] + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r3, r0, r5 + ldrb r1, [r3] + movs r6, 0x8 + adds r0, r6, 0 + ands r0, r1 + mov r9, r2 + cmp r0, 0 + bne _0805F6D0 + movs r7, 0x2 + adds r1, r7, 0 + eors r1, r4 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r1, [r0] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _0805F6D0 + ldrb r1, [r3, 0x1] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0805F6B4 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0805F684 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0805F684 + ldr r4, =0x03005d70 + mov r1, r8 + ldrb r0, [r1] + adds r1, r7, 0 + eors r1, r0 + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x02024744 + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe + mov r1, r8 + ldrb r0, [r1] + eors r0, r7 + bl sub_8076918 + mov r1, r8 + ldrb r0, [r1] + eors r0, r7 + adds r0, r4 + ldrb r0, [r0] + bl sub_80729D0 +_0805F684: + ldr r5, =0x03005d70 + ldr r4, =0x02024064 + ldrb r1, [r4] + adds r0, r1, r5 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x02024744 + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe + ldrb r0, [r4] + bl sub_8076918 + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + bl sub_80729D0 +_0805F6B4: + ldr r3, =0x020244d0 + ldr r2, [r3] + ldr r0, =0x02024064 + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0, 0x1] + mov r9, r3 +_0805F6D0: + mov r1, r9 + ldr r0, [r1] + ldr r4, =0x02024064 + ldrb r2, [r4] + ldr r3, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r3 + ldrb r1, [r0, 0x1] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0x80 + bne _0805F792 + movs r1, 0x2 + eors r1, r2 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r1, [r0, 0x1] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0805F792 + bl sub_80A36C8 + lsls r0, 24 + cmp r0, 0 + bne _0805F792 + mov r1, r9 + ldr r0, [r1] + ldrb r4, [r4] + ldr r1, [r0, 0x4] + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x1] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _0805F774 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x42 + ands r0, r1 + cmp r0, 0x42 + bne _0805F768 + adds r0, r4, 0 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0805F774 + ldr r0, =0x03007420 + bl m4aMPlayContinue + b _0805F774 + .pool +_0805F768: + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl +_0805F774: + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0, 0x1] + movs r0, 0x1 + str r0, [sp] +_0805F792: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0805F7B2 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0805F810 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0805F810 +_0805F7B2: + ldr r2, =0x02020630 + ldr r0, =0x03005d7c + ldr r1, =0x02024064 + ldrb r4, [r1] + adds r0, r4, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r3, [r0] + ldr r0, =DummyObjectCallback + cmp r3, r0 + bne _0805F86E + ldr r0, =0x020241e4 + adds r0, r4, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + cmp r0, r3 + bne _0805F86E + movs r1, 0x1 + mov r10, r1 + b _0805F86E + .pool +_0805F810: + ldr r2, =0x02020630 + ldr r7, =0x03005d7c + ldr r0, =0x02024064 + ldrb r3, [r0] + adds r0, r3, r7 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r4, [r0] + ldr r0, =DummyObjectCallback + cmp r4, r0 + bne _0805F86E + ldr r6, =0x020241e4 + adds r0, r3, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r5, [r0] + cmp r5, r4 + bne _0805F86E + movs r0, 0x2 + eors r3, r0 + adds r0, r3, r7 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r4, [r0] + cmp r4, r5 + bne _0805F86E + adds r0, r3, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + cmp r0, r4 + bne _0805F86E + movs r0, 0x1 + mov r10, r0 +_0805F86E: + ldr r1, [sp] + cmp r1, 0 + beq _0805F958 + mov r0, r10 + cmp r0, 0 + beq _0805F958 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0805F8D2 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0805F8D2 + ldr r1, =0x03005d7c + ldr r5, =0x02024064 + ldrb r0, [r5] + movs r4, 0x2 + eors r0, r4 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + ldrb r0, [r5] + eors r4, r0 + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_805EE54 +_0805F8D2: + ldr r1, =0x03005d7c + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + ldrb r5, [r4] + ldr r1, =0x0202406e + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + bl sub_805EE54 + ldr r3, =0x020244d0 + ldr r0, [r3] + ldr r2, [r0, 0x8] + ldrb r1, [r2, 0x9] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x9] + ldr r0, [r3] + ldrb r2, [r4] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r0, 0x21 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + ldr r0, [r3] + ldrb r2, [r4] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r0, 0x7F + ands r0, r2 + strb r0, [r1, 0x1] + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805F2F0 + str r1, [r0] +_0805F958: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805F560 + + thumb_func_start sub_805F994 +sub_805F994: @ 805F994 + push {r4,r5,lr} + ldr r2, =0x02020630 + ldr r0, =0x020241e4 + ldr r1, =0x02024064 + ldrb r3, [r1] + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x24 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0805F9E0 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r2, r3, 1 + adds r0, r2, r3 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0xC0 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + bne _0805F9E0 + ldr r0, =0x0202406e + adds r0, r2, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 + adds r1, r0 + adds r0, r3, 0 + bl sub_8172EF0 +_0805F9E0: + ldr r2, =0x02020630 + ldr r0, =0x020241e4 + ldr r5, =0x02024064 + ldrb r3, [r5] + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + bne _0805FA48 + ldr r4, =0x020244d0 + ldr r0, [r4] + ldr r1, [r0, 0x4] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r2, r0, r1 + ldrb r1, [r2, 0x1] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0805FA48 + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + ldr r0, [r4] + ldrb r2, [r5] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + ldr r4, =0x000027f9 + adds r0, r4, 0 + bl FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + bl dp01_tbl7_exec_completed +_0805FA48: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805F994 + + thumb_func_start sub_805FA70 +sub_805FA70: @ 805FA70 + push {r4-r6,lr} + ldr r6, =0x02024064 + ldrb r0, [r6] + ldr r5, =0x03005d70 + adds r1, r0, r5 + ldrb r1, [r1] + movs r2, 0 + movs r3, 0 + bl sub_8074AA0 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldrb r0, [r6] + adds r0, r5 + ldrb r0, [r0] + bl sub_80729D0 + lsls r4, 16 + asrs r1, r4, 16 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0805FAB8 + ldrb r0, [r6] + adds r0, r5 + ldrb r0, [r0] + movs r2, 0 + bl heathbar_draw_hp + b _0805FABC + .pool +_0805FAB8: + bl dp01_tbl7_exec_completed +_0805FABC: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_805FA70 + + thumb_func_start sub_805FAC4 +sub_805FAC4: @ 805FAC4 + push {lr} + ldr r2, =0x02020630 + ldr r0, =0x020241e4 + ldr r1, =0x02024064 + ldrb r3, [r1] + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + bne _0805FAF2 + ldr r0, =0x03005d70 + adds r0, r3, r0 + ldrb r0, [r0] + bl sub_8072984 + bl dp01_tbl7_exec_completed +_0805FAF2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_805FAC4 + + thumb_func_start sub_805FB08 +sub_805FB08: @ 805FB08 + push {r4-r6,lr} + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r6, =0x02024064 + ldrb r2, [r6] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0805FB62 + ldr r5, =0x020241e4 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl obj_free_rotscale_entry + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldrb r0, [r6] + bl sub_805EEE0 + ldr r1, =0x03005d70 + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl dp01_tbl7_exec_completed +_0805FB62: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805FB08 + + thumb_func_start bx_t7_button_a +bx_t7_button_a: @ 805FB7C + push {lr} + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _0805FB8E + bl dp01_tbl7_exec_completed +_0805FB8E: + pop {r0} + bx r0 + thumb_func_end bx_t7_button_a + + thumb_func_start bx_blink_t7 +bx_blink_t7: @ 805FB94 + push {r4,lr} + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + ldr r2, =0x02020630 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, r0, r2 + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0x20 + bne _0805FBE0 + movs r3, 0 + movs r0, 0 + strh r0, [r4, 0x30] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + subs r0, 0x5 + ands r0, r1 + strb r0, [r2] + ldr r0, =0x020244b9 + strb r3, [r0] + bl dp01_tbl7_exec_completed + b _0805FC0A + .pool +_0805FBE0: + ldrh r0, [r4, 0x30] + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _0805FC04 + adds r3, r4, 0 + adds r3, 0x3E + ldrb r2, [r3] + lsls r0, r2, 29 + lsrs r0, 31 + movs r1, 0x1 + eors r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] +_0805FC04: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] +_0805FC0A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end bx_blink_t7 + + thumb_func_start sub_805FC10 +sub_805FC10: @ 805FC10 + push {r4,lr} + ldr r2, =0x02020630 + ldr r0, =0x03005d70 + ldr r4, =0x02024064 + ldrb r3, [r4] + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + bne _0805FC5C + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r3, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0805FC50 + adds r0, r3, 0 + adds r1, r3, 0 + adds r2, r3, 0 + movs r3, 0x6 + bl move_anim_start_t4 +_0805FC50: + ldr r0, =0x03005d60 + ldrb r1, [r4] + lsls r1, 2 + adds r1, r0 + ldr r0, =bx_803AEDC + str r0, [r1] +_0805FC5C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805FC10 + + thumb_func_start bx_803AEDC +bx_803AEDC: @ 805FC80 + push {r4,lr} + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r4, =0x02024064 + ldrb r1, [r4] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0805FCDA + bl sub_80A36C8 + lsls r0, 24 + cmp r0, 0 + bne _0805FCDA + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldrb r0, [r4] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + beq _0805FCCA + ldr r0, =nullsub_18 + cmp r1, r0 + bne _0805FCDA +_0805FCCA: + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl + bl dp01_tbl7_exec_completed +_0805FCDA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end bx_803AEDC + + thumb_func_start sub_805FD00 +sub_805FD00: @ 805FD00 + push {r4-r7,lr} + ldr r4, =0x020244d0 + ldr r0, [r4] + ldr r5, =0x02024064 + ldrb r2, [r5] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r3, r0, r1 + ldrb r1, [r3, 0x1] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0805FDBC + ldr r7, =0x02020630 + ldr r6, =0x020241e4 + adds r0, r2, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r7, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + bne _0805FDBC + ldrb r1, [r3] + movs r0, 0x7F + ands r0, r1 + strb r0, [r3] + ldr r0, [r4] + ldrb r2, [r5] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + ldr r4, =0x000027f9 + adds r0, r4, 0 + bl FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + movs r1, 0 + bl StartObjectImageAnim + ldr r4, =0x03005d70 + ldrb r1, [r5] + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x02024744 + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe + ldrb r0, [r5] + bl sub_8076918 + ldrb r0, [r5] + adds r0, r4 + ldrb r0, [r0] + bl sub_80729D0 + ldrb r0, [r5] + bl sub_805E408 + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805FC10 + str r1, [r0] +_0805FDBC: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805FD00 + + thumb_func_start sub_805FDF0 +sub_805FDF0: @ 805FDF0 + push {r4-r6,lr} + ldr r6, =0x020244d0 + ldr r0, [r6] + ldr r5, =0x02024064 + ldrb r2, [r5] + ldr r1, [r0, 0x4] + lsls r3, r2, 1 + adds r0, r3, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x88 + ands r0, r1 + cmp r0, 0 + bne _0805FE22 + ldr r0, =0x0202406e + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_0805FE22: + ldr r4, =0x02020630 + ldr r0, =0x03005d7c + ldrb r2, [r5] + adds r0, r2, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r3, r0, 2 + adds r0, r4, 0 + adds r0, 0x1C + adds r0, r3, r0 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + bne _0805FE8C + ldr r0, [r6] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _0805FE8C + adds r0, r3, r4 + bl RemoveObjectAndFreeTiles + ldrb r4, [r5] + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_805EE54 + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805FD00 + str r1, [r0] +_0805FE8C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805FDF0 + + thumb_func_start sub_805FEB8 +sub_805FEB8: @ 805FEB8 + push {lr} + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _0805FEDA + bl dp01_tbl7_exec_completed +_0805FEDA: + pop {r0} + bx r0 + .pool + thumb_func_end sub_805FEB8 + + thumb_func_start bx_803B0F4 +bx_803B0F4: @ 805FEE8 + push {lr} + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _0805FF0A + bl dp01_tbl7_exec_completed +_0805FF0A: + pop {r0} + bx r0 + .pool + thumb_func_end bx_803B0F4 + + thumb_func_start dp01_tbl7_exec_completed +dp01_tbl7_exec_completed: @ 805FF18 + push {r4,lr} + sub sp, 0x4 + ldr r1, =0x03005d60 + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_exec_buffer_A_ch0_tbl7 + str r1, [r0] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0805FF6C + bl link_get_multiplayer_id + mov r1, sp + strb r0, [r1] + movs r0, 0x2 + movs r1, 0x4 + mov r2, sp + bl dp01_prepare_buffer_wireless_probably + ldr r1, =0x02023064 + ldrb r0, [r4] + lsls r0, 9 + adds r0, r1 + movs r1, 0x38 + strb r1, [r0] + b _0805FF7E + .pool +_0805FF6C: + ldr r2, =0x02024068 + ldr r1, =gUnknown_0832A328 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldr r0, [r2] + bics r0, r1 + str r0, [r2] +_0805FF7E: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_tbl7_exec_completed + + thumb_func_start dp01t_00_7_getattr +dp01t_00_7_getattr: @ 805FF90 + push {r4-r6,lr} + sub sp, 0x100 + movs r6, 0 + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _0805FFC8 + ldr r0, =0x0202406e + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + mov r1, sp + bl sub_8060004 + adds r6, r0, 0 + b _0805FFEA + .pool +_0805FFC8: + ldrb r4, [r1] + movs r5, 0 +_0805FFCC: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0805FFE2 + lsls r0, r5, 24 + lsrs r0, 24 + mov r2, sp + adds r1, r2, r6 + bl sub_8060004 + adds r6, r0 +_0805FFE2: + lsrs r4, 1 + adds r5, 0x1 + cmp r5, 0x5 + ble _0805FFCC +_0805FFEA: + lsls r1, r6, 16 + lsrs r1, 16 + movs r0, 0x1 + mov r2, sp + bl dp01_build_cmdbuf_x1D_1D_numargs_varargs + bl dp01_tbl7_exec_completed + add sp, 0x100 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end dp01t_00_7_getattr + + thumb_func_start sub_8060004 +sub_8060004: @ 8060004 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x90 + adds r7, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + movs r6, 0 + ldr r2, =0x02023064 + ldr r3, =0x02024064 + ldrb r0, [r3] + lsls r0, 9 + adds r1, r2, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3B + bls _0806002E + bl _0806079A +_0806002E: + lsls r0, 2 + ldr r1, =_08060044 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08060044: + .4byte _08060134 + .4byte _08060358 + .4byte _08060368 + .4byte _08060378 + .4byte _080603E0 + .4byte _080603E0 + .4byte _080603E0 + .4byte _080603E0 + .4byte _080603FC + .4byte _08060438 + .4byte _08060438 + .4byte _08060438 + .4byte _08060438 + .4byte _0806079A + .4byte _0806079A + .4byte _0806079A + .4byte _0806079A + .4byte _08060454 + .4byte _08060464 + .4byte _08060494 + .4byte _080604A4 + .4byte _080604B4 + .4byte _080604C4 + .4byte _080604D4 + .4byte _080604E4 + .4byte _080604F4 + .4byte _08060504 + .4byte _08060514 + .4byte _08060524 + .4byte _08060534 + .4byte _08060544 + .4byte _08060554 + .4byte _080605A4 + .4byte _080605B4 + .4byte _080605C4 + .4byte _080605D4 + .4byte _080605E4 + .4byte _080605F4 + .4byte _08060604 + .4byte _08060614 + .4byte _08060624 + .4byte _08060658 + .4byte _08060668 + .4byte _08060678 + .4byte _08060688 + .4byte _08060698 + .4byte _080606A8 + .4byte _080606B8 + .4byte _080606C8 + .4byte _080606E8 + .4byte _080606F8 + .4byte _08060708 + .4byte _08060718 + .4byte _08060728 + .4byte _08060738 + .4byte _08060748 + .4byte _08060758 + .4byte _08060768 + .4byte _08060778 + .4byte _08060788 +_08060134: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + mov r1, sp + strh r0, [r1] + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x2E] + movs r6, 0 + add r0, sp, 0x24 + mov r9, r0 + movs r1, 0x3B + add r1, sp + mov r10, r1 + mov r2, sp + adds r2, 0x2B + str r2, [sp, 0x80] + mov r0, sp + adds r0, 0x2A + str r0, [sp, 0x7C] + mov r1, sp + adds r1, 0x68 + str r1, [sp, 0x8C] + adds r2, 0x5 + str r2, [sp, 0x84] + adds r0, 0x12 + str r0, [sp, 0x88] + mov r8, r4 + add r4, sp, 0xC +_08060180: + adds r1, r6, 0 + adds r1, 0xD + mov r0, r8 + bl pokemon_getattr + strh r0, [r4] + adds r1, r6, 0 + adds r1, 0x11 + mov r0, r8 + bl pokemon_getattr + mov r2, r9 + adds r1, r2, r6 + strb r0, [r1] + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _08060180 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x15 + bl pokemon_getattr + mov r1, r10 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x20 + bl pokemon_getattr + ldr r2, [sp, 0x80] + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0x19 + bl pokemon_getattr + str r0, [sp, 0x44] + adds r0, r4, 0 + movs r1, 0x27 + bl pokemon_getattr + mov r3, sp + movs r5, 0x1F + ands r0, r5 + ldrb r2, [r3, 0x14] + movs r1, 0x20 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x14] + adds r0, r4, 0 + movs r1, 0x28 + bl pokemon_getattr + mov r3, sp + movs r6, 0x1F + ands r0, r6 + lsls r0, 5 + ldrh r2, [r3, 0x14] + ldr r1, =0xfffffc1f + ands r1, r2 + orrs r1, r0 + strh r1, [r3, 0x14] + adds r0, r4, 0 + movs r1, 0x29 + bl pokemon_getattr + mov r3, sp + ands r0, r5 + lsls r0, 2 + ldrb r2, [r3, 0x15] + movs r1, 0x7D + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x15] + adds r0, r4, 0 + movs r1, 0x2A + bl pokemon_getattr + movs r1, 0x1F + ands r1, r0 + lsls r1, 15 + ldr r0, [sp, 0x14] + ldr r2, =0xfff07fff + ands r0, r2 + orrs r0, r1 + str r0, [sp, 0x14] + adds r0, r4, 0 + movs r1, 0x2B + bl pokemon_getattr + mov r3, sp + ands r0, r6 + lsls r0, 4 + ldrh r2, [r3, 0x16] + ldr r1, =0xfffffe0f + ands r1, r2 + orrs r1, r0 + strh r1, [r3, 0x16] + adds r0, r4, 0 + movs r1, 0x2C + bl pokemon_getattr + mov r3, sp + ands r0, r5 + lsls r0, 1 + ldrb r2, [r3, 0x17] + movs r1, 0x3F + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x17] + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + str r0, [sp, 0x48] + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr + str r0, [sp, 0x4C] + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + ldr r1, [sp, 0x7C] + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x28] + adds r0, r4, 0 + movs r1, 0x3A + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x2C] + adds r0, r4, 0 + movs r1, 0x3B + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x2] + adds r0, r4, 0 + movs r1, 0x3C + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x4] + adds r0, r4, 0 + movs r1, 0x3D + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x6] + adds r0, r4, 0 + movs r1, 0x3E + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x8] + adds r0, r4, 0 + movs r1, 0x3F + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0xA] + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + mov r3, sp + movs r1, 0x1 + ands r0, r1 + lsls r0, 6 + ldrb r2, [r3, 0x17] + movs r1, 0x41 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x17] + adds r0, r4, 0 + movs r1, 0x2E + bl pokemon_getattr + mov r3, sp + lsls r0, 7 + ldrb r2, [r3, 0x17] + movs r1, 0x7F + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x17] + adds r0, r4, 0 + movs r1, 0x1 + bl pokemon_getattr + str r0, [sp, 0x54] + adds r0, r4, 0 + movs r1, 0x2 + ldr r2, [sp, 0x8C] + bl pokemon_getattr + ldr r0, [sp, 0x84] + ldr r1, [sp, 0x8C] + bl CopyString_Limit10 + adds r0, r4, 0 + movs r1, 0x7 + ldr r2, [sp, 0x88] + bl pokemon_getattr + mov r2, sp + movs r6, 0 +_08060338: + adds r0, r7, r6 + adds r1, r2, r6 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + cmp r6, 0x57 + bls _08060338 + b _0806079A + .pool +_08060358: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + b _080606D2 + .pool +_08060368: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xC + b _080606D2 + .pool +_08060378: + movs r6, 0 + add r2, sp, 0x58 + mov r9, r2 + add r0, sp, 0x60 + mov r10, r0 + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x02024744 + adds r4, r1, r0 + mov r8, r9 +_0806038E: + adds r1, r6, 0 + adds r1, 0xD + adds r0, r4, 0 + bl pokemon_getattr + mov r1, r8 + strh r0, [r1] + adds r1, r6, 0 + adds r1, 0x11 + adds r0, r4, 0 + bl pokemon_getattr + mov r2, r10 + adds r1, r2, r6 + strb r0, [r1] + movs r0, 0x2 + add r8, r0 + adds r6, 0x1 + cmp r6, 0x3 + ble _0806038E + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + mov r1, r9 + strb r0, [r1, 0xC] + mov r2, r9 + movs r6, 0 +_080603CC: + adds r0, r7, r6 + adds r1, r2, r6 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + cmp r6, 0xF + bls _080603CC + b _0806079A + .pool +_080603E0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x9 + b _080606D2 + .pool +_080603FC: + movs r6, 0 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r2, =0x02024744 + mov r8, r2 +_08060408: + adds r1, r6, 0 + adds r1, 0x11 + mov r2, r8 + adds r0, r4, r2 + bl pokemon_getattr + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + cmp r6, 0x3 + ble _08060408 + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + b _0806079A + .pool +_08060438: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x8 + b _08060792 + .pool +_08060454: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x1 + b _0806046E + .pool +_08060464: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x19 +_0806046E: + bl pokemon_getattr + adds r1, r0, 0 + strb r1, [r7] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + lsrs r0, 8 + strb r0, [r7, 0x1] + movs r0, 0xFF + lsls r0, 16 + ands r0, r1 + lsrs r0, 16 + strb r0, [r7, 0x2] + movs r6, 0x3 + b _0806079A + .pool +_08060494: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x1A + b _08060792 + .pool +_080604A4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x1B + b _08060792 + .pool +_080604B4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x1C + b _08060792 + .pool +_080604C4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x1D + b _08060792 + .pool +_080604D4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x1E + b _08060792 + .pool +_080604E4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x1F + b _08060792 + .pool +_080604F4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x20 + b _08060792 + .pool +_08060504: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x22 + b _08060792 + .pool +_08060514: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x23 + b _08060792 + .pool +_08060524: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x24 + b _08060792 + .pool +_08060534: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x25 + b _08060792 + .pool +_08060544: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x26 + b _08060792 + .pool +_08060554: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x27 + bl pokemon_getattr + strb r0, [r7] + adds r0, r4, 0 + movs r1, 0x28 + bl pokemon_getattr + strb r0, [r7, 0x1] + adds r0, r4, 0 + movs r1, 0x29 + bl pokemon_getattr + strb r0, [r7, 0x2] + adds r0, r4, 0 + movs r1, 0x2A + bl pokemon_getattr + strb r0, [r7, 0x3] + adds r0, r4, 0 + movs r1, 0x2B + bl pokemon_getattr + strb r0, [r7, 0x4] + adds r0, r4, 0 + movs r1, 0x2C + bl pokemon_getattr + strb r0, [r7, 0x5] + movs r6, 0x6 + b _0806079A + .pool +_080605A4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x27 + b _08060792 + .pool +_080605B4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x28 + b _08060792 + .pool +_080605C4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x29 + b _08060792 + .pool +_080605D4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x2A + b _08060792 + .pool +_080605E4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x2B + b _08060792 + .pool +_080605F4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x2C + b _08060792 + .pool +_08060604: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0 + b _0806062E + .pool +_08060614: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x9 + b _080606D2 + .pool +_08060624: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x37 +_0806062E: + bl pokemon_getattr + adds r1, r0, 0 + strb r1, [r7] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + lsrs r0, 8 + strb r0, [r7, 0x1] + movs r0, 0xFF + lsls r0, 16 + ands r0, r1 + lsrs r0, 16 + strb r0, [r7, 0x2] + lsrs r0, r1, 24 + strb r0, [r7, 0x3] + movs r6, 0x4 + b _0806079A + .pool +_08060658: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x38 + b _08060792 + .pool +_08060668: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x39 + b _080606D2 + .pool +_08060678: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3A + b _080606D2 + .pool +_08060688: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3B + b _080606D2 + .pool +_08060698: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3C + b _080606D2 + .pool +_080606A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3D + b _080606D2 + .pool +_080606B8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3E + b _080606D2 + .pool +_080606C8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3F +_080606D2: + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + strb r0, [r7] + lsrs r0, 8 + strb r0, [r7, 0x1] + movs r6, 0x2 + b _0806079A + .pool +_080606E8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x16 + b _08060792 + .pool +_080606F8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x17 + b _08060792 + .pool +_08060708: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x18 + b _08060792 + .pool +_08060718: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x21 + b _08060792 + .pool +_08060728: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x2F + b _08060792 + .pool +_08060738: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x30 + b _08060792 + .pool +_08060748: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x32 + b _08060792 + .pool +_08060758: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x33 + b _08060792 + .pool +_08060768: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x34 + b _08060792 + .pool +_08060778: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x35 + b _08060792 + .pool +_08060788: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x36 +_08060792: + bl pokemon_getattr + strb r0, [r7] + movs r6, 0x1 +_0806079A: + adds r0, r6, 0 + add sp, 0x90 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8060004 + + thumb_func_start dp01t_01_2_read_pokmon_data_slice +dp01t_01_2_read_pokmon_data_slice: @ 80607B0 + push {r4-r7,lr} + sub sp, 0x58 + ldr r2, =0x0202406e + ldr r5, =0x02024064 + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + adds r4, r2, 0 + muls r4, r0 + ldr r3, =0x02023064 + lsls r1, 9 + adds r0, r3, 0x1 + adds r0, r1, r0 + ldrb r2, [r0] + ldr r0, =0x02024744 + adds r0, r2, r0 + adds r6, r4, r0 + mov r0, sp + adds r4, r0, r2 + movs r2, 0 + adds r0, r3, 0x2 + adds r1, r0 + adds r7, r5, 0 + mov r12, r3 + ldrb r1, [r1] + cmp r2, r1 + bcs _08060806 + adds r3, r0, 0 +_080607EC: + adds r1, r4, r2 + adds r0, r6, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + ldrb r0, [r5] + lsls r0, 9 + adds r0, r3 + ldrb r0, [r0] + cmp r2, r0 + bcc _080607EC +_08060806: + ldrb r0, [r7] + lsls r0, 9 + mov r1, r12 + adds r1, 0x2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + adds r2, r4, 0 + bl dp01_build_cmdbuf_x1D_1D_numargs_varargs + bl dp01_tbl7_exec_completed + add sp, 0x58 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_01_2_read_pokmon_data_slice + + thumb_func_start dp01t_02_7_setattr +dp01t_02_7_setattr: @ 8060838 + push {r4,r5,lr} + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _08060868 + ldr r0, =0x0202406e + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + bl sub_8060890 + b _08060886 + .pool +_08060868: + ldrb r4, [r1] + movs r5, 0 +_0806086C: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0806087A + adds r0, r5, 0 + bl sub_8060890 +_0806087A: + lsrs r4, 1 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _0806086C +_08060886: + bl dp01_tbl7_exec_completed + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end dp01t_02_7_setattr + + thumb_func_start sub_8060890 +sub_8060890: @ 8060890 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x38 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r3, =0x02024064 + ldrb r0, [r3] + lsls r0, 9 + ldr r2, =0x02023067 + adds r4, r0, r2 + adds r7, r4, 0 + subs r1, r2, 0x2 + adds r0, r1 + ldrb r0, [r0] + adds r6, r3, 0 + adds r3, r2, 0 + cmp r0, 0x3B + bls _080608BE + bl _0806119C +_080608BE: + lsls r0, 2 + ldr r1, =_080608D4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080608D4: + .4byte _080609C4 + .4byte _08060B5C + .4byte _08060B78 + .4byte _08060B94 + .4byte _08060BE8 + .4byte _08060BE8 + .4byte _08060BE8 + .4byte _08060BE8 + .4byte _08060C08 + .4byte _08060C70 + .4byte _08060C70 + .4byte _08060C70 + .4byte _08060C70 + .4byte _0806119C + .4byte _0806119C + .4byte _0806119C + .4byte _0806119C + .4byte _08060C98 + .4byte _08060CB4 + .4byte _08060CD0 + .4byte _08060CEC + .4byte _08060D08 + .4byte _08060D24 + .4byte _08060D40 + .4byte _08060D5C + .4byte _08060D78 + .4byte _08060D94 + .4byte _08060DB0 + .4byte _08060DCC + .4byte _08060DE8 + .4byte _08060E04 + .4byte _08060E20 + .4byte _08060E94 + .4byte _08060EB0 + .4byte _08060ECC + .4byte _08060EE8 + .4byte _08060F04 + .4byte _08060F20 + .4byte _08060F3C + .4byte _08060F58 + .4byte _08060F74 + .4byte _08060F90 + .4byte _08060FAC + .4byte _08060FC8 + .4byte _08060FE4 + .4byte _08061000 + .4byte _0806101C + .4byte _08061038 + .4byte _08061054 + .4byte _08061070 + .4byte _0806108C + .4byte _080610A8 + .4byte _080610C4 + .4byte _080610E0 + .4byte _080610FC + .4byte _08061118 + .4byte _08061134 + .4byte _08061150 + .4byte _0806116C + .4byte _08061188 +_080609C4: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + adds r2, r7, 0 + bl pokemon_setattr + adds r2, r7, 0 + adds r2, 0x2E + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_setattr + movs r0, 0 + mov r8, r0 + movs r0, 0x3B + adds r0, r7 + mov r10, r0 + adds r0, r7, 0 + adds r0, 0x2B + str r0, [sp, 0x20] + adds r0, 0x19 + str r0, [sp, 0x28] + adds r0, 0x4 + str r0, [sp, 0x2C] + adds r0, 0x4 + str r0, [sp, 0x30] + subs r0, 0x22 + str r0, [sp, 0x1C] + subs r0, 0x2 + str r0, [sp, 0x18] + adds r0, 0x4 + str r0, [sp, 0x24] + adds r0, r7, 0x2 + str r0, [sp, 0x4] + adds r0, r7, 0x4 + str r0, [sp, 0x8] + adds r0, r7, 0x6 + str r0, [sp, 0xC] + adds r0, 0x2 + str r0, [sp, 0x10] + adds r0, 0x2 + str r0, [sp, 0x14] + mov r9, r4 + adds r6, r7, 0 + adds r6, 0x24 + adds r4, r7, 0 + adds r4, 0xC +_08060A2A: + mov r1, r8 + adds r1, 0xD + mov r0, r9 + adds r2, r4, 0 + bl pokemon_setattr + mov r1, r8 + adds r1, 0x11 + mov r0, r9 + adds r2, r6, 0 + bl pokemon_setattr + adds r6, 0x1 + adds r4, 0x2 + movs r0, 0x1 + add r8, r0 + mov r0, r8 + cmp r0, 0x3 + ble _08060A2A + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x15 + mov r2, r10 + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x20 + ldr r2, [sp, 0x20] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x19 + ldr r2, [sp, 0x28] + bl pokemon_setattr + ldrb r0, [r7, 0x14] + lsls r0, 27 + lsrs r0, 27 + mov r1, sp + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x27 + mov r2, sp + bl pokemon_setattr + mov r1, sp + ldrh r0, [r7, 0x14] + lsls r0, 22 + lsrs r0, 27 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x28 + mov r2, sp + bl pokemon_setattr + mov r1, sp + ldrb r0, [r7, 0x15] + lsls r0, 25 + lsrs r0, 27 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x29 + mov r2, sp + bl pokemon_setattr + mov r1, sp + ldr r0, [r7, 0x14] + lsls r0, 12 + lsrs r0, 27 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x2A + mov r2, sp + bl pokemon_setattr + mov r1, sp + ldrh r0, [r7, 0x16] + lsls r0, 23 + lsrs r0, 27 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x2B + mov r2, sp + bl pokemon_setattr + mov r1, sp + ldrb r0, [r7, 0x17] + lsls r0, 26 + lsrs r0, 27 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x2C + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0 + ldr r2, [sp, 0x2C] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x37 + ldr r2, [sp, 0x30] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x38 + ldr r2, [sp, 0x1C] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x39 + ldr r2, [sp, 0x18] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3A + ldr r2, [sp, 0x24] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3B + ldr r2, [sp, 0x4] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3C + ldr r2, [sp, 0x8] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3D + ldr r2, [sp, 0xC] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3E + ldr r2, [sp, 0x10] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3F + ldr r2, [sp, 0x14] + bl pokemon_setattr + b _0806119C + .pool +_08060B5C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0xB + bl pokemon_setattr + b _0806119C + .pool +_08060B78: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0xC + bl pokemon_setattr + b _0806119C + .pool +_08060B94: + movs r0, 0 + mov r8, r0 + movs r0, 0xC + adds r0, r4 + mov r9, r0 + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x02024744 + adds r7, r1, r0 + adds r6, r4, 0 + adds r6, 0x8 +_08060BAC: + mov r1, r8 + adds r1, 0xD + adds r0, r7, 0 + adds r2, r4, 0 + bl pokemon_setattr + mov r1, r8 + adds r1, 0x11 + adds r0, r7, 0 + adds r2, r6, 0 + bl pokemon_setattr + adds r6, 0x1 + adds r4, 0x2 + movs r0, 0x1 + add r8, r0 + mov r0, r8 + cmp r0, 0x3 + ble _08060BAC + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x15 + mov r2, r9 + bl pokemon_setattr + b _0806119C + .pool +_08060BE8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldr r3, =0x02023064 + ldrb r2, [r6] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x9 + b _08060C86 + .pool +_08060C08: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + adds r0, r4, 0 + movs r1, 0x11 + str r3, [sp, 0x34] + bl pokemon_setattr + ldrb r2, [r6] + lsls r2, 9 + ldr r3, [sp, 0x34] + adds r0, r3, 0x1 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x12 + bl pokemon_setattr + ldrb r2, [r6] + lsls r2, 9 + ldr r3, [sp, 0x34] + adds r0, r3, 0x2 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x13 + bl pokemon_setattr + ldrb r2, [r6] + lsls r2, 9 + ldr r3, [sp, 0x34] + adds r0, r3, 0x3 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x14 + bl pokemon_setattr + ldrb r2, [r6] + lsls r2, 9 + ldr r3, [sp, 0x34] + adds r0, r3, 0x4 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x15 + bl pokemon_setattr + b _0806119C + .pool +_08060C70: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldr r3, =0x02023064 + ldrb r2, [r6] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x8 +_08060C86: + adds r3, 0x3 + adds r2, r3 + bl pokemon_setattr + b _0806119C + .pool +_08060C98: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1 + bl pokemon_setattr + b _0806119C + .pool +_08060CB4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x19 + bl pokemon_setattr + b _0806119C + .pool +_08060CD0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1A + bl pokemon_setattr + b _0806119C + .pool +_08060CEC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1B + bl pokemon_setattr + b _0806119C + .pool +_08060D08: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1C + bl pokemon_setattr + b _0806119C + .pool +_08060D24: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1D + bl pokemon_setattr + b _0806119C + .pool +_08060D40: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1E + bl pokemon_setattr + b _0806119C + .pool +_08060D5C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1F + bl pokemon_setattr + b _0806119C + .pool +_08060D78: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x20 + bl pokemon_setattr + b _0806119C + .pool +_08060D94: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x22 + bl pokemon_setattr + b _0806119C + .pool +_08060DB0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x23 + bl pokemon_setattr + b _0806119C + .pool +_08060DCC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x24 + bl pokemon_setattr + b _0806119C + .pool +_08060DE8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x25 + bl pokemon_setattr + b _0806119C + .pool +_08060E04: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x26 + bl pokemon_setattr + b _0806119C + .pool +_08060E20: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + adds r0, r4, 0 + movs r1, 0x27 + str r3, [sp, 0x34] + bl pokemon_setattr + ldrb r2, [r6] + lsls r2, 9 + ldr r3, [sp, 0x34] + adds r0, r3, 0x1 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x28 + bl pokemon_setattr + ldrb r2, [r6] + lsls r2, 9 + ldr r3, [sp, 0x34] + adds r0, r3, 0x2 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x29 + bl pokemon_setattr + ldrb r2, [r6] + lsls r2, 9 + ldr r3, [sp, 0x34] + adds r0, r3, 0x3 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x2A + bl pokemon_setattr + ldrb r2, [r6] + lsls r2, 9 + ldr r3, [sp, 0x34] + adds r0, r3, 0x4 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x2B + bl pokemon_setattr + ldrb r2, [r6] + lsls r2, 9 + ldr r3, [sp, 0x34] + adds r0, r3, 0x5 + adds r2, r0 + adds r0, r4, 0 + b _08060F2E + .pool +_08060E94: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x27 + bl pokemon_setattr + b _0806119C + .pool +_08060EB0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x28 + bl pokemon_setattr + b _0806119C + .pool +_08060ECC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x29 + bl pokemon_setattr + b _0806119C + .pool +_08060EE8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x2A + bl pokemon_setattr + b _0806119C + .pool +_08060F04: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x2B + bl pokemon_setattr + b _0806119C + .pool +_08060F20: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 +_08060F2E: + movs r1, 0x2C + bl pokemon_setattr + b _0806119C + .pool +_08060F3C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0 + bl pokemon_setattr + b _0806119C + .pool +_08060F58: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x9 + bl pokemon_setattr + b _0806119C + .pool +_08060F74: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x37 + bl pokemon_setattr + b _0806119C + .pool +_08060F90: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x38 + bl pokemon_setattr + b _0806119C + .pool +_08060FAC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x39 + bl pokemon_setattr + b _0806119C + .pool +_08060FC8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3A + bl pokemon_setattr + b _0806119C + .pool +_08060FE4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3B + bl pokemon_setattr + b _0806119C + .pool +_08061000: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3C + bl pokemon_setattr + b _0806119C + .pool +_0806101C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3D + bl pokemon_setattr + b _0806119C + .pool +_08061038: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3E + bl pokemon_setattr + b _0806119C + .pool +_08061054: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3F + bl pokemon_setattr + b _0806119C + .pool +_08061070: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x16 + bl pokemon_setattr + b _0806119C + .pool +_0806108C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x17 + bl pokemon_setattr + b _0806119C + .pool +_080610A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x18 + bl pokemon_setattr + b _0806119C + .pool +_080610C4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x21 + bl pokemon_setattr + b _0806119C + .pool +_080610E0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x2F + bl pokemon_setattr + b _0806119C + .pool +_080610FC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x30 + bl pokemon_setattr + b _0806119C + .pool +_08061118: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x32 + bl pokemon_setattr + b _0806119C + .pool +_08061134: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x33 + bl pokemon_setattr + b _0806119C + .pool +_08061150: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x34 + bl pokemon_setattr + b _0806119C + .pool +_0806116C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x35 + bl pokemon_setattr + b _0806119C + .pool +_08061188: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x36 + bl pokemon_setattr +_0806119C: + add sp, 0x38 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8060890 + + thumb_func_start sub_80611B0 +sub_80611B0: @ 80611B0 + push {r4-r7,lr} + ldr r1, =0x0202406e + ldr r7, =0x02024064 + ldrb r2, [r7] + lsls r0, r2, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + adds r3, r1, 0 + muls r3, r0 + ldr r4, =0x02023064 + lsls r2, 9 + adds r0, r4, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + ldr r1, =0x02024744 + adds r0, r1 + adds r5, r3, r0 + movs r3, 0 + adds r0, r4, 0x2 + adds r2, r0 + ldrb r2, [r2] + cmp r3, r2 + bcs _08061208 + adds r6, r4, 0 + adds r2, r7, 0 + adds r4, r0, 0 +_080611E6: + adds r1, r5, r3 + ldrb r0, [r2] + lsls r0, 9 + adds r0, 0x3 + adds r0, r3, r0 + adds r0, r6 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + ldrb r0, [r2] + lsls r0, 9 + adds r0, r4 + ldrb r0, [r0] + cmp r3, r0 + bcc _080611E6 +_08061208: + bl dp01_tbl7_exec_completed + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80611B0 + + thumb_func_start sub_8061224 +sub_8061224: @ 8061224 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r6, =0x02024064 + ldrb r0, [r6] + lsls r0, 1 + ldr r1, =0x0202406e + adds r0, r1 + ldrh r0, [r0] + movs r7, 0x64 + muls r0, r7 + ldr r2, =0x02024744 + mov r10, r2 + add r0, r10 + movs r1, 0xB + bl pokemon_getattr + mov r8, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldrb r1, [r6] + lsls r0, r1, 1 + ldr r2, =0x0202406e + adds r0, r2 + ldrh r0, [r0] + muls r0, r7 + add r0, r10 + bl sub_805DC0C + ldrb r0, [r6] + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, r8 + bl sub_806A068 + ldr r0, =0x0202499c + mov r9, r0 + ldrb r0, [r6] + movs r1, 0x2 + bl sub_80A5C6C + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldrb r0, [r6] + bl sub_80A6138 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r6] + bl sub_80A82E4 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + mov r0, r9 + adds r1, r5, 0 + adds r2, r4, 0 + bl AddObjectToFront + ldr r4, =0x020241e4 + ldrb r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r5, =0x02020630 + ldrb r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =0x0000ff10 + strh r1, [r0, 0x24] + ldrb r2, [r6] + adds r0, r2, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x2E] + ldrb r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + mov r1, r8 + strh r1, [r0, 0x32] + ldrb r3, [r6] + adds r0, r3, r4 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + lsls r3, 4 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x5] + ldrb r2, [r6] + adds r4, r2, r4 + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =0x020244e4 + adds r2, r1 + ldrb r1, [r2] + bl StartObjectImageAnim + ldrb r4, [r6] + lsls r0, r4, 1 + ldr r2, =0x0202406e + adds r0, r2 + ldrh r0, [r0] + muls r0, r7 + add r0, r10 + movs r1, 0xB + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_805EE54 + ldr r1, =0x03005d60 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805F994 + str r1, [r0] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8061224 + + thumb_func_start sub_806137C +sub_806137C: @ 806137C + push {r4,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + ldr r1, =0x0202449c + ldr r1, [r1] + adds r0, r1 + adds r0, 0x5C + movs r1, 0x6 + strb r1, [r0] + ldr r1, =0x0202406e + ldrb r0, [r4] + lsls r2, r0, 1 + adds r2, r1 + ldr r3, =0x02023064 + lsls r0, 9 + adds r1, r3, 0x1 + adds r0, r1 + ldrb r0, [r0] + strh r0, [r2] + ldrb r0, [r4] + lsls r1, r0, 9 + adds r3, 0x2 + adds r1, r3 + ldrb r1, [r1] + bl sub_80613DC + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805FDF0 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806137C + + thumb_func_start sub_80613DC +sub_80613DC: @ 80613DC + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + bl sub_805EF84 + ldr r0, =0x0202406e + lsls r4, r6, 1 + adds r4, r0 + ldr r0, =0x02023064 + lsls r1, r6, 9 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + strh r0, [r4] + ldrh r0, [r4] + movs r1, 0x64 + mov r9, r1 + mov r1, r9 + muls r1, r0 + adds r0, r1, 0 + ldr r5, =0x02024744 + adds r0, r5 + movs r1, 0xB + bl pokemon_getattr + mov r8, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, =sub_805D714 + bl object_new_hidden_with_callback + ldr r1, =0x03005d7c + mov r10, r1 + add r10, r6 + mov r1, r10 + strb r0, [r1] + ldrh r0, [r4] + mov r1, r9 + muls r1, r0 + adds r0, r1, 0 + adds r0, r5 + adds r1, r6, 0 + bl sub_805DC0C + adds r0, r6, 0 + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, r8 + bl sub_806A068 + ldr r0, =0x0202499c + mov r9, r0 + adds r0, r6, 0 + movs r1, 0x2 + bl sub_80A5C6C + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r6, 0 + bl sub_80A6138 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + bl sub_80A82E4 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + mov r0, r9 + adds r1, r5, 0 + adds r2, r4, 0 + bl AddObjectToFront + ldr r4, =0x020241e4 + adds r4, r6, r4 + strb r0, [r4] + ldr r5, =0x02020630 + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r6, [r0, 0x2E] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + mov r1, r8 + strh r1, [r0, 0x32] + mov r0, r10 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r1, [r4] + strh r1, [r0, 0x30] + mov r0, r10 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r6, [r0, 0x32] + ldrb r0, [r4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + lsls r3, r6, 4 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x5] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =0x020244e4 + adds r6, r1 + ldrb r1, [r6] + bl StartObjectImageAnim + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r5, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =DummyObjectCallback + str r1, [r0] + movs r0, 0 + movs r1, 0xFE + bl sub_80753E8 + mov r1, r10 + ldrb r2, [r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r5 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0x2E] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80613DC + + thumb_func_start sub_806156C +sub_806156C: @ 806156C + push {r4-r6,lr} + ldr r1, =0x02023064 + ldr r6, =0x02024064 + ldrb r2, [r6] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r3, [r0] + cmp r3, 0 + bne _080615B4 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + strb r3, [r0, 0x4] + ldr r1, =0x03005d60 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8061604 + str r1, [r0] + b _080615F0 + .pool +_080615B4: + ldr r5, =0x020241e4 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl obj_free_rotscale_entry + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldrb r0, [r6] + bl sub_805EEE0 + ldr r1, =0x03005d70 + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl dp01_tbl7_exec_completed +_080615F0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806156C + + thumb_func_start sub_8061604 +sub_8061604: @ 8061604 + push {r4-r6,lr} + ldr r6, =0x020244d0 + ldr r4, [r6] + ldr r5, =0x02024064 + ldrb r2, [r5] + ldr r1, [r4, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r3, r0, r1 + ldrb r0, [r3, 0x4] + cmp r0, 0 + beq _0806162C + cmp r0, 0x1 + beq _0806165A + b _08061682 + .pool +_0806162C: + ldr r1, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08061646 + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_08061646: + ldr r0, [r6] + ldrb r1, [r5] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x1 + strb r1, [r0, 0x4] + b _08061682 +_0806165A: + ldrb r1, [r3] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08061682 + strb r0, [r3, 0x4] + ldrb r2, [r5] + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x2 + bl move_anim_start_t4 + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805FB08 + str r1, [r0] +_08061682: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8061604 + + thumb_func_start sub_8061690 +sub_8061690: @ 8061690 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r0, =0x02022fec + ldr r2, [r0] + movs r0, 0x80 + lsls r0, 20 + ands r0, r2 + cmp r0, 0 + beq _080616B0 + bl sub_806B830 + b _0806175A + .pool +_080616B0: + ldr r3, =0x02038bca + ldrh r1, [r3] + ldr r0, =0x000003fe + cmp r1, r0 + bne _080616C8 + bl sub_81A4CB0 + b _0806175A + .pool +_080616C8: + movs r0, 0x80 + lsls r0, 19 + ands r0, r2 + cmp r0, 0 + beq _08061708 + movs r0, 0x80 + lsls r0, 8 + ands r2, r0 + cmp r2, 0 + beq _08061700 + ldr r0, =0x02024064 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080616F0 + ldrh r0, [r3] + bl sub_81D5588 + b _0806175A + .pool +_080616F0: + ldr r0, =0x02038bcc + ldrh r0, [r0] + bl sub_81D5588 + b _0806175A + .pool +_08061700: + ldrh r0, [r3] + bl sub_81D5588 + b _0806175A +_08061708: + ldr r0, =0x003f0100 + ands r0, r2 + cmp r0, 0 + beq _0806174C + ldr r0, =0x00808000 + ands r2, r0 + cmp r2, 0 + beq _08061744 + ldr r0, =0x02024064 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08061734 + ldrh r0, [r3] + bl sub_8162AA0 + b _0806175A + .pool +_08061734: + ldr r0, =0x02038bcc + ldrh r0, [r0] + bl sub_8162AA0 + b _0806175A + .pool +_08061744: + ldrh r0, [r3] + bl sub_8162AA0 + b _0806175A +_0806174C: + movs r0, 0x80 + lsls r0, 4 + ands r0, r2 + cmp r0, 0 + beq _08061760 + bl sub_8165244 +_0806175A: + lsls r0, 24 + lsrs r4, r0, 24 + b _08061796 +_08061760: + movs r0, 0x80 + lsls r0, 8 + ands r2, r0 + cmp r2, 0 + beq _08061788 + ldr r0, =0x02024064 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08061788 + ldr r2, =gTrainers + ldr r0, =0x02038bcc + ldrh r1, [r0] + b _0806178C + .pool +_08061788: + ldr r2, =gTrainers + ldrh r1, [r3] +_0806178C: + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r4, [r0, 0x3] +_08061796: + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x00008040 + ands r0, r1 + cmp r0, 0 + beq _080617C8 + ldr r0, =0x02024064 + ldrb r0, [r0] + bl battle_get_per_side_status + movs r1, 0x2 + ands r1, r0 + movs r7, 0xC8 + cmp r1, 0 + beq _080617CA + movs r7, 0x98 + b _080617CA + .pool +_080617C8: + movs r7, 0xB0 +_080617CA: + mov r8, r4 + ldr r5, =0x02024064 + ldrb r1, [r5] + mov r0, r8 + bl sub_805DF38 + ldrb r0, [r5] + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, r8 + bl template_build_for_pokemon_or_trainer + ldr r6, =0x0202499c + mov r9, r7 + ldr r1, =gUnknown_083054E0 + mov r2, r8 + lsls r0, r2, 2 + adds r0, r1 + ldrb r0, [r0] + movs r4, 0x8 + subs r4, r0 + lsls r4, 18 + movs r0, 0xA0 + lsls r0, 14 + adds r4, r0 + asrs r4, 16 + ldrb r0, [r5] + bl sub_80A82E4 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r6, 0 + mov r1, r9 + adds r2, r4, 0 + bl AddObjectToFront + ldr r6, =0x020241e4 + ldrb r1, [r5] + adds r1, r6 + strb r0, [r1] + ldr r4, =0x02020630 + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =0x0000ff10 + strh r1, [r0, 0x24] + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x2 + strh r1, [r0, 0x2E] + ldr r1, =gTrainerFrontPicPaletteTable + mov r2, r8 + lsls r0, r2, 3 + adds r0, r1 + ldrh r0, [r0, 0x4] + bl IndexOfObjectPaletteTag + ldrb r1, [r5] + adds r1, r6 + ldrb r1, [r1] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r4 + lsls r0, 4 + ldrb r3, [r2, 0x5] + movs r1, 0xF + ands r1, r3 + orrs r1, r0 + strb r1, [r2, 0x5] + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + mov r1, r8 + strh r1, [r0, 0x6] + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, 0x1C + adds r0, r4 + ldr r1, =sub_805D7AC + str r1, [r0] + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805F1D0 + str r1, [r0] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8061690 + + thumb_func_start sub_80618D8 +sub_80618D8: @ 80618D8 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, =0x02022fec + ldr r2, [r0] + movs r0, 0x80 + lsls r0, 20 + ands r0, r2 + cmp r0, 0 + beq _080618F8 + bl sub_806B830 + b _080619A2 + .pool +_080618F8: + ldr r3, =0x02038bca + ldrh r1, [r3] + ldr r0, =0x000003fe + cmp r1, r0 + bne _08061910 + bl sub_81A4CB0 + b _080619A2 + .pool +_08061910: + movs r0, 0x80 + lsls r0, 19 + ands r0, r2 + cmp r0, 0 + beq _08061950 + movs r0, 0x80 + lsls r0, 8 + ands r2, r0 + cmp r2, 0 + beq _08061948 + ldr r0, =0x02024064 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08061938 + ldrh r0, [r3] + bl sub_81D5588 + b _080619A2 + .pool +_08061938: + ldr r0, =0x02038bcc + ldrh r0, [r0] + bl sub_81D5588 + b _080619A2 + .pool +_08061948: + ldrh r0, [r3] + bl sub_81D5588 + b _080619A2 +_08061950: + ldr r0, =0x003f0100 + ands r0, r2 + cmp r0, 0 + beq _08061994 + ldr r0, =0x00808000 + ands r2, r0 + cmp r2, 0 + beq _0806198C + ldr r0, =0x02024064 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0806197C + ldrh r0, [r3] + bl sub_8162AA0 + b _080619A2 + .pool +_0806197C: + ldr r0, =0x02038bcc + ldrh r0, [r0] + bl sub_8162AA0 + b _080619A2 + .pool +_0806198C: + ldrh r0, [r3] + bl sub_8162AA0 + b _080619A2 +_08061994: + movs r0, 0x80 + lsls r0, 4 + ands r0, r2 + cmp r0, 0 + beq _080619A8 + bl sub_8165244 +_080619A2: + lsls r0, 24 + lsrs r0, 24 + b _080619DE +_080619A8: + movs r0, 0x80 + lsls r0, 8 + ands r2, r0 + cmp r2, 0 + beq _080619D0 + ldr r0, =0x02024064 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080619D0 + ldr r2, =gTrainers + ldr r0, =0x02038bcc + ldrh r1, [r0] + b _080619D4 + .pool +_080619D0: + ldr r2, =gTrainers + ldrh r1, [r3] +_080619D4: + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x3] +_080619DE: + mov r8, r0 + ldr r6, =0x02024064 + ldrb r1, [r6] + bl sub_805DF38 + ldrb r0, [r6] + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, r8 + bl template_build_for_pokemon_or_trainer + ldr r0, =0x0202499c + ldr r2, =gUnknown_083054E0 + mov r3, r8 + lsls r1, r3, 2 + adds r1, r2 + ldrb r1, [r1] + movs r2, 0x8 + subs r2, r1 + lsls r2, 18 + movs r1, 0xA0 + lsls r1, 14 + adds r2, r1 + asrs r2, 16 + movs r1, 0xB0 + movs r3, 0x1E + bl AddObjectToFront + ldr r5, =0x020241e4 + ldrb r1, [r6] + adds r1, r5 + strb r0, [r1] + ldr r4, =0x02020630 + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x60 + strh r1, [r0, 0x24] + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x20] + adds r1, 0x20 + strh r1, [r0, 0x20] + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =0x0000fffe + strh r1, [r0, 0x2E] + ldr r1, =gTrainerFrontPicPaletteTable + mov r2, r8 + lsls r0, r2, 3 + adds r0, r1 + ldrh r0, [r0, 0x4] + bl IndexOfObjectPaletteTag + ldrb r1, [r6] + adds r1, r5 + ldrb r1, [r1] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r4 + lsls r0, 4 + ldrb r3, [r2, 0x5] + movs r1, 0xF + ands r1, r3 + orrs r1, r0 + strb r1, [r2, 0x5] + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + mov r3, r8 + strh r3, [r0, 0x6] + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, 0x1C + adds r0, r4 + ldr r1, =sub_805D7AC + str r1, [r0] + ldr r1, =0x03005d60 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805F208 + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80618D8 + + thumb_func_start sub_8061AF0 +sub_8061AF0: @ 8061AF0 + push {r4-r6,lr} + ldr r6, =0x020241e4 + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, =0x02020630 + adds r0, r5 + bl oamt_add_pos2_onto_pos1 + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x23 + strh r1, [r0, 0x2E] + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x8C + lsls r1, 1 + strh r1, [r0, 0x32] + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrh r1, [r0, 0x22] + strh r1, [r0, 0x36] + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r5, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_80A6EEC + str r1, [r0] + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =DummyObjectCallback + bl oamt_set_x3A_32 + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805F240 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8061AF0 + + thumb_func_start sub_8061B9C +sub_8061B9C: @ 8061B9C + push {r4-r6,lr} + ldr r6, =0x020244d0 + ldr r4, [r6] + ldr r5, =0x02024064 + ldrb r2, [r5] + ldr r0, [r4, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r3, r1, r0 + ldrb r0, [r3, 0x4] + cmp r0, 0 + bne _08061BF0 + ldr r1, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08061BD0 + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_08061BD0: + ldr r0, [r6] + ldrb r1, [r5] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x4] + adds r1, 0x1 + strb r1, [r0, 0x4] + b _08061C2C + .pool +_08061BF0: + ldrb r1, [r3] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08061C2C + strb r0, [r3, 0x4] + movs r0, 0x10 + movs r1, 0x3F + bl audio_play_and_stuff + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldrb r0, [r5] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_8039934 + str r1, [r0] + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805FAC4 + str r1, [r0] +_08061C2C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8061B9C + + thumb_func_start sub_8061C48 +sub_8061C48: @ 8061C48 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8061C48 + + thumb_func_start sub_8061C54 +sub_8061C54: @ 8061C54 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8061C54 + + thumb_func_start sub_8061C60 +sub_8061C60: @ 8061C60 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8061C60 + + thumb_func_start sub_8061C6C +sub_8061C6C: @ 8061C6C + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8061C6C + + thumb_func_start sub_8061C78 +sub_8061C78: @ 8061C78 + push {r4-r6,lr} + ldr r6, =0x02024064 + ldrb r0, [r6] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + beq _08061C8A + b _08061D9E +_08061C8A: + ldr r0, =0x02023064 + mov r12, r0 + ldrb r2, [r6] + lsls r2, 9 + adds r0, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + mov r1, r12 + adds r1, 0x2 + adds r1, r2, r1 + ldrb r1, [r1] + lsls r1, 8 + orrs r0, r1 + ldr r5, =0x02038432 + mov r1, r12 + adds r1, 0x3 + adds r2, r1 + ldrb r1, [r2] + strb r1, [r5] + ldr r4, =0x02038408 + ldrb r2, [r6] + lsls r2, 9 + mov r1, r12 + adds r1, 0x4 + adds r1, r2, r1 + ldrb r3, [r1] + mov r1, r12 + adds r1, 0x5 + adds r2, r1 + ldrb r1, [r2] + lsls r1, 8 + orrs r3, r1 + strh r3, [r4] + ldr r4, =0x02038404 + ldrb r2, [r6] + lsls r2, 9 + mov r1, r12 + adds r1, 0x6 + adds r1, r2, r1 + ldrb r3, [r1] + mov r1, r12 + adds r1, 0x7 + adds r1, r2, r1 + ldrb r1, [r1] + lsls r1, 8 + orrs r3, r1 + mov r1, r12 + adds r1, 0x8 + adds r1, r2, r1 + ldrb r1, [r1] + lsls r1, 16 + orrs r3, r1 + mov r1, r12 + adds r1, 0x9 + adds r2, r1 + ldrb r1, [r2] + lsls r1, 24 + orrs r3, r1 + str r3, [r4] + ldr r3, =0x0203841a + ldrb r1, [r6] + lsls r1, 9 + mov r2, r12 + adds r2, 0xA + adds r1, r2 + ldrb r1, [r1] + strb r1, [r3] + ldr r4, =0x0203841c + ldrb r2, [r6] + lsls r2, 9 + mov r1, r12 + adds r1, 0xC + adds r1, r2, r1 + ldrb r3, [r1] + mov r1, r12 + adds r1, 0xD + adds r2, r1 + ldrb r1, [r2] + lsls r1, 8 + orrs r3, r1 + strh r3, [r4] + ldr r3, =0x02038400 + ldrb r2, [r6] + lsls r2, 9 + mov r1, r12 + adds r1, 0x10 + adds r2, r1 + str r2, [r3] + ldr r3, =0x020244bc + ldrb r1, [r6] + lsls r1, 2 + adds r1, r3 + ldr r2, [r2] + str r2, [r1] + ldrb r1, [r5] + bl sub_805DB8C + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + beq _08061D80 + bl dp01_tbl7_exec_completed + b _08061D9E + .pool +_08061D80: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldrb r1, [r6] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strb r3, [r0, 0x4] + ldr r1, =0x03005d60 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_move_anim_7 + str r1, [r0] +_08061D9E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8061C78 + + thumb_func_start bx_move_anim_7 +bx_move_anim_7: @ 8061DB0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r2, =0x02023064 + ldr r6, =0x02024064 + ldrb r3, [r6] + lsls r1, r3, 9 + adds r0, r2, 0x1 + mov r10, r0 + adds r0, r1, r0 + ldrb r4, [r0] + adds r5, r2, 0x2 + mov r9, r5 + adds r0, r1, r5 + ldrb r0, [r0] + lsls r0, 8 + orrs r4, r0 + adds r2, 0xB + adds r1, r2 + ldrb r1, [r1] + mov r8, r1 + ldr r7, =0x020244d0 + ldr r5, [r7] + ldr r1, [r5, 0x4] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x4] + cmp r2, 0x1 + beq _08061E48 + cmp r2, 0x1 + bgt _08061E08 + cmp r2, 0 + beq _08061E12 + b _08061F24 + .pool +_08061E08: + cmp r2, 0x2 + beq _08061E72 + cmp r2, 0x3 + beq _08061EE8 + b _08061F24 +_08061E12: + ldr r1, [r5] + lsls r0, r3, 2 + adds r1, r0, r1 + ldrb r2, [r1] + movs r0, 0xC + ands r0, r2 + cmp r0, 0x4 + bne _08061E34 + movs r0, 0x8 + orrs r0, r2 + strb r0, [r1] + ldrb r2, [r6] + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_08061E34: + ldr r0, [r7] + ldrb r1, [r6] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x1 + strb r1, [r0, 0x4] + b _08061F24 +_08061E48: + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08061F24 + movs r0, 0 + bl sub_805EB9C + adds r0, r4, 0 + bl move_anim_start_t1 + ldr r0, [r7] + ldrb r1, [r6] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x2 + strb r1, [r0, 0x4] + b _08061F24 +_08061E72: + ldr r0, =0x020383f8 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, =0x020383fd + ldrb r0, [r0] + cmp r0, 0 + bne _08061F24 + movs r0, 0x1 + bl sub_805EB9C + ldr r0, [r7] + ldrb r2, [r6] + ldr r1, [r0] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08061EC0 + mov r0, r8 + cmp r0, 0x1 + bhi _08061EC0 + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x6 + bl move_anim_start_t4 + ldr r0, [r7] + ldrb r1, [r6] + ldr r0, [r0] + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] +_08061EC0: + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x3 + strb r1, [r0, 0x4] + b _08061F24 + .pool +_08061EE8: + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _08061F24 + bl sub_805E394 + ldrb r0, [r6] + lsls r2, r0, 9 + mov r3, r10 + adds r1, r2, r3 + ldrb r1, [r1] + add r2, r9 + ldrb r2, [r2] + lsls r2, 8 + orrs r1, r2 + bl sub_805E94C + ldr r0, [r7] + ldrb r1, [r6] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strb r4, [r0, 0x4] + bl dp01_tbl7_exec_completed +_08061F24: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end bx_move_anim_7 + + thumb_func_start sub_8061F34 +sub_8061F34: @ 8061F34 + push {r4,r5,lr} + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r5, =0x02024064 + ldrb r4, [r5] + lsls r4, 9 + ldr r0, =0x02023066 + adds r4, r0 + ldrh r0, [r4] + bl battle_pick_message + ldr r0, =0x02022e2c + movs r1, 0 + bl battle_show_message_maybe + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_t7_button_a + str r1, [r0] + ldrb r0, [r5] + ldrh r1, [r4] + bl sub_81A57E4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8061F34 + + thumb_func_start sub_8061F90 +sub_8061F90: @ 8061F90 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8061F90 + + thumb_func_start sub_8061F9C +sub_8061F9C: @ 8061F9C + push {lr} + bl sub_8063880 + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8061F9C + + thumb_func_start sub_8061FAC +sub_8061FAC: @ 8061FAC + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8061FAC + + thumb_func_start sub_8061FB8 +sub_8061FB8: @ 8061FB8 + push {r4-r6,lr} + ldr r0, =0x02022fec + ldr r2, [r0] + movs r0, 0x80 + lsls r0, 10 + ands r0, r2 + cmp r0, 0 + beq _08061FE4 + bl sub_805D19C + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + movs r0, 0x1 + movs r1, 0xA +_08061FD6: + bl dp01_build_cmdbuf_x21_a_bb +_08061FDA: + bl dp01_tbl7_exec_completed + b _08062156 + .pool +_08061FE4: + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 9 + ldr r1, =0x02023068 + adds r5, r0, r1 + movs r0, 0x93 + lsls r0, 3 + ands r2, r0 + cmp r2, 0 + beq _080620C4 + movs r0, 0xF + bl sub_8130950 + bl sub_8130BA4 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + beq _08062022 + cmp r4, 0x5 + bgt _0806201C + cmp r4, 0x4 + beq _08062028 + b _08062040 + .pool +_0806201C: + cmp r4, 0x6 + beq _08062030 + b _08062040 +_08062022: + movs r0, 0x1 + movs r1, 0x4 + b _0806202C +_08062028: + movs r0, 0x1 + movs r1, 0x3 +_0806202C: + movs r2, 0 + b _08061FD6 +_08062030: + ldr r0, =0x0202420c + ldrb r2, [r0] + movs r0, 0x1 + movs r1, 0xF + b _08061FD6 + .pool +_08062040: + ldr r3, =gBattleMoves + lsls r0, r4, 1 + adds r2, r5, r0 + ldrh r1, [r2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r1, [r0, 0x6] + movs r0, 0x12 + ands r0, r1 + cmp r0, 0 + beq _08062062 + ldr r0, =0x0202420c + ldr r1, =0x02024064 + ldrb r1, [r1] + strb r1, [r0] +_08062062: + ldrh r1, [r2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r1, [r0, 0x6] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0806209C + movs r0, 0 + bl battle_get_side_with_given_state + ldr r5, =0x0202420c + strb r0, [r5] + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _0806209C + movs r0, 0x2 + bl battle_get_side_with_given_state + strb r0, [r5] +_0806209C: + ldr r0, =0x0202420c + ldrb r0, [r0] + lsls r0, 8 + orrs r4, r0 + movs r0, 0x1 + movs r1, 0xA + adds r2, r4, 0 + bl dp01_build_cmdbuf_x21_a_bb + b _08061FDA + .pool +_080620C4: + movs r6, 0x3 +_080620C6: + bl GenerateRandomNumber + adds r4, r0, 0 + ands r4, r6 + lsls r0, r4, 1 + adds r0, r5, r0 + ldrh r2, [r0] + cmp r2, 0 + beq _080620C6 + ldr r1, =gBattleMoves + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x6] + movs r0, 0x12 + ands r0, r1 + cmp r0, 0 + beq _08062108 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 8 + orrs r4, r0 + movs r0, 0x1 + movs r1, 0xA + adds r2, r4, 0 + bl dp01_build_cmdbuf_x21_a_bb + b _08062152 + .pool +_08062108: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0806213C + bl GenerateRandomNumber + movs r1, 0x2 + ands r1, r0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r1, 0 + bl battle_get_side_with_given_state + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 16 + orrs r2, r4 + movs r0, 0x1 + movs r1, 0xA + bl dp01_build_cmdbuf_x21_a_bb + b _08062152 + .pool +_0806213C: + movs r0, 0 + bl battle_get_side_with_given_state + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 16 + orrs r2, r4 + movs r0, 0x1 + movs r1, 0xA + bl dp01_build_cmdbuf_x21_a_bb +_08062152: + bl dp01_tbl7_exec_completed +_08062156: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8061FB8 + + thumb_func_start sub_806215C +sub_806215C: @ 806215C + push {lr} + ldr r0, =0x02024064 + ldrb r0, [r0] + lsrs r0, 1 + ldr r1, =0x0202449c + ldr r1, [r1] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC0 + ldrb r1, [r0] + movs r0, 0x1 + bl dp01_build_cmdbuf_x23_aa_0 + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_806215C + + thumb_func_start sub_8062188 +sub_8062188: @ 8062188 + push {r4-r7,lr} + ldr r0, =0x02024064 + ldrb r0, [r0] + ldr r1, =0x0202449c + ldr r1, [r1] + adds r0, r1 + movs r2, 0xA5 + lsls r2, 2 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0x6 + bne _08062254 + bl sub_8063A90 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x6 + bne _0806225A + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080621D4 + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r5, r0, 24 + adds r7, r5, 0 + b _080621E8 + .pool +_080621D4: + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r7, r0, 24 + movs r0, 0x3 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r5, r0, 24 +_080621E8: + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x00808000 + ands r0, r1 + cmp r0, 0 + beq _08062214 + ldr r0, =0x02024064 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08062210 + movs r0, 0 + movs r6, 0x3 + b _08062218 + .pool +_08062210: + movs r0, 0x3 + b _08062216 +_08062214: + movs r0, 0 +_08062216: + movs r6, 0x6 +_08062218: + adds r4, r0, 0 + b _0806221E +_0806221C: + adds r4, 0x1 +_0806221E: + cmp r4, r6 + bge _0806225A + movs r0, 0x64 + muls r0, r4 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _0806221C + ldr r1, =0x0202406e + lsls r0, r7, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r4, r0 + beq _0806221C + lsls r0, r5, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r4, r0 + beq _0806221C + b _0806225A + .pool +_08062254: + ldrb r4, [r1] + movs r0, 0x6 + strb r0, [r1] +_0806225A: + ldr r0, =0x02024064 + ldrb r0, [r0] + ldr r1, =0x0202449c + ldr r1, [r1] + adds r0, r1 + adds r0, 0x5C + strb r4, [r0] + lsls r1, r4, 24 + lsrs r1, 24 + movs r0, 0x1 + movs r2, 0 + bl dp01_build_cmdbuf_x22_a_three_bytes + bl dp01_tbl7_exec_completed + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8062188 + + thumb_func_start sub_8062288 +sub_8062288: @ 8062288 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8062288 + + thumb_func_start sub_8062294 +sub_8062294: @ 8062294 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + movs r0, 0 + bl load_gfxc_health_bar + ldr r3, =0x02023064 + ldr r0, =0x02024064 + mov r9, r0 + ldrb r4, [r0] + lsls r2, r4, 9 + adds r0, r3, 0x3 + adds r0, r2, r0 + ldrb r1, [r0] + lsls r1, 8 + adds r3, 0x2 + adds r2, r3 + ldrb r0, [r2] + orrs r0, r1 + lsls r0, 16 + asrs r7, r0, 16 + ldr r0, =0x00007fff + cmp r7, r0 + beq _08062324 + ldr r6, =0x0202406e + lsls r0, r4, 1 + adds r0, r6 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r4, =0x02024744 + adds r0, r4 + movs r1, 0x3A + bl pokemon_getattr + mov r8, r0 + mov r1, r9 + ldrb r0, [r1] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + muls r0, r5 + adds r0, r4 + movs r1, 0x39 + bl pokemon_getattr + adds r3, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r1, =0x03005d70 + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + mov r2, r8 + bl sub_807294C + b _0806234E + .pool +_08062324: + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3A + bl pokemon_getattr + adds r2, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r1, =0x03005d70 + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + movs r3, 0 + bl sub_807294C +_0806234E: + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805FA70 + str r1, [r0] + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8062294 + + thumb_func_start sub_8062384 +sub_8062384: @ 8062384 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8062384 + + thumb_func_start sub_8062390 +sub_8062390: @ 8062390 + push {r4,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _080623E4 + ldr r0, =0x03005d70 + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x02024744 + adds r1, r2 + movs r2, 0x9 + bl healthbar_draw_field_maybe + ldrb r2, [r4] + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805FEB8 + str r1, [r0] +_080623E4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8062390 + + thumb_func_start sub_8062408 +sub_8062408: @ 8062408 + push {r4,r5,lr} + ldr r5, =0x02024064 + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _08062458 + ldr r4, =0x02023064 + ldrb r3, [r5] + lsls r3, 9 + adds r0, r4, 0x1 + adds r0, r3, r0 + ldrb r0, [r0] + adds r1, r4, 0x2 + adds r1, r3, r1 + ldrb r1, [r1] + adds r2, r4, 0x3 + adds r2, r3, r2 + ldrb r2, [r2] + lsls r2, 8 + orrs r1, r2 + adds r2, r4, 0x4 + adds r2, r3, r2 + ldrb r2, [r2] + lsls r2, 16 + orrs r1, r2 + adds r4, 0x5 + adds r3, r4 + ldrb r2, [r3] + lsls r2, 24 + orrs r1, r2 + bl move_anim_start_t2_for_situation + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805FEB8 + str r1, [r0] +_08062458: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8062408 + + thumb_func_start sub_8062470 +sub_8062470: @ 8062470 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8062470 + + thumb_func_start sub_806247C +sub_806247C: @ 806247C + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_806247C + + thumb_func_start sub_8062488 +sub_8062488: @ 8062488 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8062488 + + thumb_func_start sub_8062494 +sub_8062494: @ 8062494 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8062494 + + thumb_func_start sub_80624A0 +sub_80624A0: @ 80624A0 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_80624A0 + + thumb_func_start sub_80624AC +sub_80624AC: @ 80624AC + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_80624AC + + thumb_func_start sub_80624B8 +sub_80624B8: @ 80624B8 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_80624B8 + + thumb_func_start sub_80624C4 +sub_80624C4: @ 80624C4 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_80624C4 + + thumb_func_start sub_80624D0 +sub_80624D0: @ 80624D0 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_80624D0 + + thumb_func_start sub_80624DC +sub_80624DC: @ 80624DC + push {lr} + ldr r2, =0x02022d0c + ldrb r1, [r2] + movs r0, 0x80 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_80624DC + + thumb_func_start sub_80624F8 +sub_80624F8: @ 80624F8 + push {lr} + ldr r3, =0x02022d0c + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0x7F + ands r1, r0 + ldrb r2, [r3] + movs r0, 0x80 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_80624F8 + + thumb_func_start sub_8062530 +sub_8062530: @ 8062530 + push {lr} + ldr r2, =0x02022d0c + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_8062530 + + thumb_func_start sub_8062548 +sub_8062548: @ 8062548 + push {lr} + ldr r3, =0x02022d0c + ldr r1, [r3] + lsls r1, 24 + lsrs r1, 31 + movs r0, 0x1 + eors r1, r0 + lsls r1, 7 + ldrb r2, [r3] + movs r0, 0x7F + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_8062548 + + thumb_func_start dp01t_29_7_blink +dp01t_29_7_blink: @ 8062570 + push {r4,lr} + ldr r3, =0x02020630 + ldr r2, =0x020241e4 + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _080625A4 + bl dp01_tbl7_exec_completed + b _080625CE + .pool +_080625A4: + ldr r1, =0x020244b9 + movs r0, 0x1 + strb r0, [r1] + ldrb r0, [r4] + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0 + strh r1, [r0, 0x30] + ldrb r0, [r4] + bl sub_80769F4 + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_blink_t7 + str r1, [r0] +_080625CE: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_29_7_blink + + thumb_func_start sub_80625E0 +sub_80625E0: @ 80625E0 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_80625E0 + + thumb_func_start sub_80625EC +sub_80625EC: @ 80625EC + push {r4,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + movs r3, 0x3F + cmp r0, 0 + bne _08062600 + movs r3, 0xC0 +_08062600: + ldr r2, =0x02023064 + ldrb r1, [r4] + lsls r1, 9 + adds r0, r2, 0x1 + adds r0, r1, r0 + ldrb r0, [r0] + adds r2, 0x2 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 8 + orrs r0, r1 + lsls r1, r3, 24 + asrs r1, 24 + bl audio_play_and_stuff + bl dp01_tbl7_exec_completed + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80625EC + + thumb_func_start sub_8062630 +sub_8062630: @ 8062630 + push {r4,r5,lr} + ldr r4, =0x02023064 + ldr r5, =0x02024064 + ldrb r0, [r5] + lsls r3, r0, 9 + adds r0, r4, 0x3 + adds r0, r3, r0 + ldrb r0, [r0] + cmp r0, 0 + beq _0806266C + bl sub_805EA60 + ldrb r1, [r5] + lsls r1, 9 + adds r0, r4, 0x1 + adds r0, r1, r0 + ldrb r0, [r0] + adds r2, r4, 0x2 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 8 + orrs r0, r1 + bl song_play_for_text + b _08062680 + .pool +_0806266C: + adds r0, r4, 0x1 + adds r0, r3, r0 + ldrb r0, [r0] + adds r1, r4, 0x2 + adds r1, r3, r1 + ldrb r1, [r1] + lsls r1, 8 + orrs r0, r1 + bl fanfare_play +_08062680: + bl dp01_tbl7_exec_completed + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8062630 + + thumb_func_start sub_806268C +sub_806268C: @ 806268C + push {lr} + ldr r1, =0x0202406e + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x19 + movs r2, 0x5 + bl sub_80A32E4 + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_806268C + + thumb_func_start dp01t_2E_7_battle_intro +dp01t_2E_7_battle_intro: @ 80626C8 + push {lr} + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + bl battle_intro_launch + ldr r2, =0x020243fc + ldrh r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_2E_7_battle_intro + + thumb_func_start sub_80626FC +sub_80626FC: @ 80626FC + push {r4-r6,lr} + ldr r5, =0x020241e4 + ldr r6, =0x02024064 + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl oamt_add_pos2_onto_pos1 + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x23 + strh r1, [r0, 0x2E] + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x8C + lsls r1, 1 + strh r1, [r0, 0x32] + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x22] + strh r1, [r0, 0x36] + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_80A6EEC + str r1, [r0] + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_806280C + bl oamt_set_x3A_32 + ldr r0, =sub_8062828 + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + ldrb r0, [r6] + strh r0, [r1, 0x8] + ldr r3, =0x020244d0 + ldr r0, [r3] + ldrb r2, [r6] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080627BE + ldr r0, =0x020244b4 + adds r0, r2, r0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + ldr r1, =sub_8073C30 + str r1, [r0] +_080627BE: + ldr r0, [r3] + ldr r2, [r0, 0x8] + ldrb r0, [r2, 0x9] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x9] + ldr r1, =0x03005d60 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =nullsub_26 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80626FC + + thumb_func_start sub_806280C +sub_806280C: @ 806280C + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x6] + bl sub_805DFE4 + adds r0, r4, 0 + bl obj_free_rotscale_entry + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_806280C + + thumb_func_start sub_8062828 +sub_8062828: @ 8062828 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r7, =0x02024064 + ldrb r0, [r7] + mov r9, r0 + ldr r1, =0x03005e00 + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x8] + strb r0, [r7] + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0806286C + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0806286C + movs r0, 0x80 + lsls r0, 8 + ands r1, r0 + cmp r1, 0 + beq _080628A0 +_0806286C: + ldr r0, =0x02023064 + ldrb r1, [r7] + lsls r2, r1, 9 + adds r0, 0x1 + adds r2, r0 + ldr r0, =0x0202406e + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + strb r0, [r2] + ldrb r0, [r7] + movs r1, 0 + bl sub_80613DC + b _080628E0 + .pool +_080628A0: + ldr r4, =0x02023064 + ldrb r0, [r7] + lsls r1, r0, 9 + adds r4, 0x1 + adds r1, r4 + ldr r6, =0x0202406e + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + strb r0, [r1] + ldrb r0, [r7] + movs r1, 0 + bl sub_80613DC + ldrb r0, [r7] + movs r5, 0x2 + eors r0, r5 + strb r0, [r7] + ldrb r0, [r7] + lsls r1, r0, 9 + adds r1, r4 + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + strb r0, [r1] + ldrb r0, [r7] + movs r1, 0 + bl sub_80613DC + ldrb r0, [r7] + eors r0, r5 + strb r0, [r7] +_080628E0: + ldr r1, =0x03005d60 + ldr r2, =0x02024064 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805F560 + str r1, [r0] + mov r0, r9 + strb r0, [r2] + mov r0, r8 + bl remove_task + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8062828 + + thumb_func_start dp01t_30_7_0803D67C +dp01t_30_7_0803D67C: @ 8062918 + push {r4-r7,lr} + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08062948 + adds r0, r2, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08062948 + bl dp01_tbl7_exec_completed + b _08062A12 + .pool +_08062948: + ldr r4, =0x020244d0 + ldr r0, [r4] + ldr r3, =0x02024064 + ldrb r1, [r3] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] + ldr r1, =0x02023064 + ldrb r2, [r3] + lsls r0, r2, 9 + adds r1, 0x2 + adds r0, r1 + ldrb r0, [r0] + adds r7, r3, 0 + cmp r0, 0 + beq _080629B4 + ldr r0, [r4] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r3, r0, r1 + ldrb r2, [r3, 0x1] + lsls r1, r2, 27 + lsrs r0, r1, 28 + cmp r0, 0x1 + bhi _080629AC + adds r0, 0x1 + movs r1, 0xF + ands r0, r1 + lsls r0, 1 + movs r1, 0x1F + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x1] + b _08062A12 + .pool +_080629AC: + movs r0, 0x1F + negs r0, r0 + ands r0, r2 + strb r0, [r3, 0x1] +_080629B4: + adds r5, r7, 0 + ldrb r0, [r5] + lsls r3, r0, 9 + ldr r4, =0x02023068 + adds r1, r3, r4 + subs r2, r4, 0x3 + adds r2, r3, r2 + ldrb r2, [r2] + subs r4, 0x2 + adds r3, r4 + ldrb r3, [r3] + bl sub_80735DC + ldr r2, =0x020244b4 + ldrb r1, [r5] + adds r1, r2 + movs r3, 0 + strb r0, [r1] + ldr r6, =0x020244d0 + ldr r0, [r6] + ldrb r1, [r5] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strb r3, [r0, 0x5] + ldrb r2, [r5] + lsls r0, r2, 9 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _08062A06 + ldr r0, [r6] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + movs r1, 0x5D + strb r1, [r0, 0x5] +_08062A06: + ldr r0, =0x03005d60 + ldrb r1, [r7] + lsls r1, 2 + adds r1, r0 + ldr r0, =bx_0803D790_t7 + str r0, [r1] +_08062A12: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_30_7_0803D67C + + thumb_func_start bx_0803D790_t7 +bx_0803D790_t7: @ 8062A2C + push {r4,lr} + ldr r4, =0x020244d0 + ldr r0, [r4] + ldr r3, =0x02024064 + ldrb r1, [r3] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x5] + adds r2, r1, 0x1 + strb r2, [r0, 0x5] + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x5C + bls _08062A64 + ldr r0, [r4] + ldrb r1, [r3] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strb r1, [r0, 0x5] + bl dp01_tbl7_exec_completed +_08062A64: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end bx_0803D790_t7 + + thumb_func_start sub_8062A74 +sub_8062A74: @ 8062A74 + push {lr} + ldr r0, =0x020244d0 + ldr r1, [r0] + ldr r0, =0x02024064 + ldrb r3, [r0] + ldr r1, [r1, 0x4] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08062AA6 + ldr r2, =0x03005e00 + ldr r0, =0x020244b4 + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, =sub_8073C30 + str r1, [r0] +_08062AA6: + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_8062A74 + + thumb_func_start sub_8062AC4 +sub_8062AC4: @ 8062AC4 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8062AC4 + + thumb_func_start sub_8062AD0 +sub_8062AD0: @ 8062AD0 + push {r4,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + bl sub_80A6A90 + lsls r0, 24 + cmp r0, 0 + beq _08062B16 + ldr r3, =0x02020630 + ldr r0, =0x020241e4 + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + ldr r0, =0x02023064 + lsls r1, 9 + adds r0, 0x1 + adds r1, r0 + adds r2, 0x3E + movs r0, 0x1 + ldrb r1, [r1] + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldrb r0, [r4] + bl sub_805E408 +_08062B16: + bl dp01_tbl7_exec_completed + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8062AD0 + + thumb_func_start dp01t_34_7_move_anim_start_t3 +dp01t_34_7_move_anim_start_t3: @ 8062B30 + push {r4-r6,lr} + sub sp, 0x4 + ldr r6, =0x02024064 + ldrb r0, [r6] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _08062B88 + ldr r5, =0x02023064 + ldrb r2, [r6] + lsls r1, r2, 9 + adds r0, r5, 0x1 + adds r0, r1, r0 + ldrb r3, [r0] + adds r0, r5, 0x2 + adds r0, r1, r0 + ldrb r4, [r0] + adds r5, 0x3 + adds r1, r5 + ldrb r0, [r1] + lsls r0, 8 + orrs r4, r0 + str r4, [sp] + adds r0, r2, 0 + adds r1, r2, 0 + bl move_anim_start_t3 + lsls r0, 24 + cmp r0, 0 + beq _08062B7C + bl dp01_tbl7_exec_completed + b _08062B88 + .pool +_08062B7C: + ldr r0, =0x03005d60 + ldrb r1, [r6] + lsls r1, 2 + adds r1, r0 + ldr r0, =bx_803B0F4 + str r0, [r1] +_08062B88: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_34_7_move_anim_start_t3 + + thumb_func_start sub_8062B98 +sub_8062B98: @ 8062B98 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8062B98 + + thumb_func_start sub_8062BA4 +sub_8062BA4: @ 8062BA4 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8062BA4 + + thumb_func_start sub_8062BB0 +sub_8062BB0: @ 8062BB0 + push {lr} + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x6 + ands r0, r1 + cmp r0, 0x2 + bne _08062BDA + ldr r2, =0x030022c0 + ldr r0, =0x00000439 + adds r3, r2, r0 + ldrb r1, [r3] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r3] + ldr r0, =0x03005d00 + ldr r0, [r0] + str r0, [r2] + ldr r0, [r2, 0x8] + bl SetMainCallback2 +_08062BDA: + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_8062BB0 + + thumb_func_start nullsub_91 +nullsub_91: @ 8062BF4 + bx lr + thumb_func_end nullsub_91 + + thumb_func_start ai_switch_perish_song +ai_switch_perish_song: @ 8062BF8 + push {lr} + ldr r1, =0x020242ac + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08062C50 + ldr r0, =0x020242bc + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0xF] + lsls r0, 28 + cmp r0, 0 + bne _08062C50 + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, r2, r0 + movs r1, 0xA5 + lsls r1, 2 + adds r0, r1 + movs r1, 0x6 + strb r1, [r0] + movs r0, 0x1 + movs r1, 0x2 + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb + movs r0, 0x1 + b _08062C52 + .pool +_08062C50: + movs r0, 0 +_08062C52: + pop {r1} + bx r1 + thumb_func_end ai_switch_perish_song + + thumb_func_start sub_8062C58 +sub_8062C58: @ 8062C58 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08062C72 + b _08062E2C +_08062C72: + ldr r0, =0x02024064 + ldrb r0, [r0] + bl battle_get_per_side_status + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r4, =0x02024084 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x58 + muls r0, r1 + adds r0, r4 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x19 + beq _08062C9E + b _08062E2C +_08062C9E: + mov r0, r10 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r2, r0, 24 + movs r6, 0 + mov r8, r4 + movs r7, 0x58 + adds r0, r2, 0 + muls r0, r7 + adds r4, r0, r4 + movs r0, 0x20 + adds r0, r4 + mov r9, r0 +_08062CBA: + lsls r1, r6, 1 + ldr r5, =0x02024064 + ldrb r0, [r5] + muls r0, r7 + adds r1, r0 + mov r0, r8 + adds r0, 0xC + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _08062CE8 + ldrh r1, [r4] + mov r3, r9 + ldrb r2, [r3] + bl ai_rate_move + lsls r0, 24 + lsrs r1, r0, 24 + movs r0, 0x2 + ands r1, r0 + cmp r1, 0 + beq _08062CE8 + b _08062E2C +_08062CE8: + adds r6, 0x1 + cmp r6, 0x3 + ble _08062CBA + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x00808000 + ands r0, r1 + cmp r0, 0 + beq _08062D50 + ldrb r1, [r5] + movs r0, 0x2 + ands r0, r1 + adds r1, r5, 0 + cmp r0, 0 + bne _08062D20 + movs r4, 0 + movs r0, 0x3 + str r0, [sp] + b _08062D58 + .pool +_08062D20: + movs r4, 0x3 + movs r3, 0x6 + str r3, [sp] + b _08062D58 +_08062D28: + ldr r0, =0x02024064 + ldrb r0, [r0] + ldr r1, =0x0202449c + ldr r1, [r1] + adds r0, r1 + movs r1, 0xA5 + lsls r1, 2 + adds r0, r1 + strb r6, [r0] + movs r0, 0x1 + movs r1, 0x2 + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb + movs r0, 0x1 + b _08062E2E + .pool +_08062D50: + movs r4, 0 + movs r3, 0x6 + str r3, [sp] + adds r1, r5, 0 +_08062D58: + ldrb r0, [r1] + bl battle_side_get_owner + lsls r0, 24 + ldr r1, =0x02024744 + mov r9, r1 + cmp r0, 0 + bne _08062D6C + ldr r3, =0x020244ec + mov r9, r3 +_08062D6C: + adds r6, r4, 0 + ldr r0, [sp] + cmp r6, r0 + bge _08062E2C +_08062D74: + movs r0, 0x64 + adds r5, r6, 0 + muls r5, r0 + mov r1, r9 + adds r4, r1, r5 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _08062E24 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + beq _08062E24 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _08062E24 + ldr r1, =0x0202406e + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r6, r0 + beq _08062E24 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + adds r0, r4, 0 + movs r1, 0x2E + bl pokemon_getattr + mov r0, r10 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r2, r0, 24 + movs r4, 0 + mov r8, r5 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r2 + adds r5, r0, r1 + adds r7, r5, 0 + adds r7, 0x20 +_08062DE0: + adds r1, r4, 0 + adds r1, 0xD + mov r0, r9 + add r0, r8 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + beq _08062E1E + ldrh r1, [r5] + ldrb r2, [r7] + bl ai_rate_move + lsls r0, 24 + lsrs r1, r0, 24 + movs r0, 0x2 + ands r1, r0 + cmp r1, 0 + beq _08062E1E + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _08062D28 +_08062E1E: + adds r4, 0x1 + cmp r4, 0x3 + ble _08062DE0 +_08062E24: + adds r6, 0x1 + ldr r3, [sp] + cmp r6, r3 + blt _08062D74 +_08062E2C: + movs r0, 0 +_08062E2E: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8062C58 + + thumb_func_start sub_8062E54 +sub_8062E54: @ 8062E54 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + movs r0, 0x1 + bl ai_has_super_effective_move_on_field + lsls r0, 24 + cmp r0, 0 + beq _08062E82 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + beq _08062E82 + b _080630AC +_08062E82: + ldr r1, =0x02024250 + ldr r5, =0x02024064 + ldrb r3, [r5] + lsls r0, r3, 1 + adds r4, r0, r1 + ldrh r1, [r4] + cmp r1, 0 + bne _08062E94 + b _080630AC +_08062E94: + ldr r0, =0x0000ffff + cmp r1, r0 + bne _08062E9C + b _080630AC +_08062E9C: + ldr r2, =gBattleMoves + ldrh r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0 + bne _08062EB0 + b _080630AC +_08062EB0: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08062F1A + mov r8, r3 + mov r0, r8 + bl battle_get_per_side_status + movs r4, 0x2 + eors r0, r4 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + ldr r1, =0x02024210 + ldrb r1, [r1] + ldr r2, =gUnknown_0832A328 + lsls r0, 24 + lsrs r0, 22 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _08062F04 + ldrb r7, [r5] + b _08062F1E + .pool +_08062F04: + ldrb r0, [r5] + bl battle_get_per_side_status + eors r0, r4 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r7, r0, 24 + b _08062F1E +_08062F1A: + adds r7, r3, 0 + mov r8, r7 +_08062F1E: + ldr r3, =gBattleMoves + ldr r1, =0x02024250 + ldr r2, =0x02024064 + ldrb r0, [r2] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x2] + cmp r0, 0xA + bne _08062F4C + movs r0, 0x12 + b _08062F5E + .pool +_08062F4C: + cmp r0, 0xB + bne _08062F56 + movs r1, 0xB + str r1, [sp] + b _08062F60 +_08062F56: + cmp r0, 0xD + beq _08062F5C + b _080630AC +_08062F5C: + movs r0, 0xA +_08062F5E: + str r0, [sp] +_08062F60: + ldr r1, =0x02024084 + ldrb r3, [r2] + movs r0, 0x58 + muls r0, r3 + adds r0, r1 + adds r0, 0x20 + ldrb r0, [r0] + ldr r1, [sp] + cmp r0, r1 + bne _08062F76 + b _080630AC +_08062F76: + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x00808000 + ands r0, r1 + cmp r0, 0 + beq _08062FCC + movs r0, 0x2 + ands r3, r0 + cmp r3, 0 + bne _08062F9C + movs r4, 0 + movs r0, 0x3 + b _08062FD0 + .pool +_08062F9C: + movs r4, 0x3 + movs r1, 0x6 + mov r10, r1 + b _08062FD2 +_08062FA4: + ldr r0, =0x02024064 + ldrb r0, [r0] + ldr r1, =0x0202449c + ldr r1, [r1] + adds r0, r1 + movs r2, 0xA5 + lsls r2, 2 + adds r0, r2 + strb r5, [r0] + movs r0, 0x1 + movs r1, 0x2 + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb + movs r0, 0x1 + b _080630AE + .pool +_08062FCC: + movs r4, 0 + movs r0, 0x6 +_08062FD0: + mov r10, r0 +_08062FD2: + ldrb r0, [r2] + bl battle_side_get_owner + lsls r0, 24 + ldr r1, =0x02024744 + str r1, [sp, 0x4] + cmp r0, 0 + bne _08062FE6 + ldr r2, =0x020244ec + str r2, [sp, 0x4] +_08062FE6: + adds r5, r4, 0 + cmp r5, r10 + bge _080630AC + ldr r0, =gBaseStats + mov r9, r0 +_08062FF0: + movs r0, 0x64 + muls r0, r5 + ldr r1, [sp, 0x4] + adds r6, r1, r0 + adds r0, r6, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _080630A6 + adds r0, r6, 0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + beq _080630A6 + adds r0, r6, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _080630A6 + ldr r1, =0x0202406e + mov r2, r8 + lsls r0, r2, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r5, r0 + beq _080630A6 + lsls r0, r7, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r5, r0 + beq _080630A6 + ldr r0, =0x0202449c + ldr r1, [r0] + adds r0, r2, r1 + adds r0, 0x5C + ldrb r0, [r0] + cmp r5, r0 + beq _080630A6 + adds r0, r7, r1 + adds r0, 0x5C + ldrb r0, [r0] + cmp r5, r0 + beq _080630A6 + adds r0, r6, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r6, 0 + movs r1, 0x2E + bl pokemon_getattr + cmp r0, 0 + beq _08063088 + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + add r0, r9 + ldrb r0, [r0, 0x17] + b _08063092 + .pool +_08063088: + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + add r0, r9 + ldrb r0, [r0, 0x16] +_08063092: + ldr r1, [sp] + cmp r1, r0 + bne _080630A6 + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _080630A6 + b _08062FA4 +_080630A6: + adds r5, 0x1 + cmp r5, r10 + blt _08062FF0 +_080630AC: + movs r0, 0 +_080630AE: + 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_8062E54 + + thumb_func_start ai_switchout_natural_cure +ai_switchout_natural_cure: @ 80630C0 + push {r4,r5,lr} + ldr r3, =0x02024084 + ldr r5, =0x02024064 + ldrb r4, [r5] + movs r0, 0x58 + adds r2, r4, 0 + muls r2, r0 + adds r0, r3, 0 + adds r0, 0x4C + adds r0, r2, r0 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + beq _08063188 + adds r1, r2, r3 + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x1E + bne _08063188 + ldrh r0, [r1, 0x2C] + ldrh r1, [r1, 0x28] + lsrs r0, 1 + cmp r1, r0 + bcc _08063188 + ldr r1, =0x02024250 + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + cmp r1, 0 + beq _08063106 + ldr r0, =0x0000ffff + cmp r1, r0 + bne _08063128 +_08063106: + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _08063128 + ldrb r0, [r5] + b _08063190 + .pool +_08063128: + ldr r2, =gBattleMoves + ldr r1, =0x02024250 + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0 + bne _08063160 + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _08063160 + ldrb r0, [r4] + b _08063190 + .pool +_08063160: + movs r0, 0x8 + movs r1, 0x1 + bl ai_switchout_something + lsls r0, 24 + cmp r0, 0 + bne _080631AA + movs r0, 0x4 + movs r1, 0x1 + bl ai_switchout_something + lsls r0, 24 + cmp r0, 0 + bne _080631AA + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + bne _0806318C +_08063188: + movs r0, 0 + b _080631AC +_0806318C: + ldr r0, =0x02024064 + ldrb r0, [r0] +_08063190: + ldr r1, =0x0202449c + ldr r1, [r1] + adds r0, r1 + movs r1, 0xA5 + lsls r1, 2 + adds r0, r1 + movs r1, 0x6 + strb r1, [r0] + movs r0, 0x1 + movs r1, 0x2 + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb +_080631AA: + movs r0, 0x1 +_080631AC: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end ai_switchout_natural_cure + + thumb_func_start ai_has_super_effective_move_on_field +ai_has_super_effective_move_on_field: @ 80631BC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r0, =0x02024064 + ldrb r0, [r0] + bl battle_get_per_side_status + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + lsls r0, r3, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08063256 + movs r4, 0 + ldr r6, =0x02024084 + movs r7, 0x58 + adds r0, r3, 0 + muls r0, r7 + adds r5, r0, r6 + movs r0, 0x20 + adds r0, r5 + mov r8, r0 +_0806320A: + lsls r1, r4, 1 + ldr r0, =0x02024064 + ldrb r0, [r0] + muls r0, r7 + adds r1, r0 + adds r0, r6, 0 + adds r0, 0xC + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _08063250 + ldrh r1, [r5] + mov r3, r8 + ldrb r2, [r3] + bl ai_rate_move + lsls r0, 24 + lsrs r1, r0, 24 + movs r0, 0x2 + ands r1, r0 + cmp r1, 0 + beq _08063250 + mov r0, r9 + cmp r0, 0 + bne _08063278 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + bne _08063278 +_08063250: + adds r4, 0x1 + cmp r4, 0x3 + ble _0806320A +_08063256: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0806327C + b _080632FA + .pool +_08063278: + movs r0, 0x1 + b _080632FC +_0806327C: + movs r1, 0x2 + mov r0, r10 + eors r0, r1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + lsls r0, r3, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _080632FA + movs r4, 0 + ldr r6, =0x02024084 + movs r7, 0x58 + adds r0, r3, 0 + muls r0, r7 + adds r5, r0, r6 + movs r3, 0x20 + adds r3, r5 + mov r8, r3 +_080632AE: + lsls r1, r4, 1 + ldr r0, =0x02024064 + ldrb r0, [r0] + muls r0, r7 + adds r1, r0 + adds r0, r6, 0 + adds r0, 0xC + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _080632F4 + ldrh r1, [r5] + mov r3, r8 + ldrb r2, [r3] + bl ai_rate_move + lsls r0, 24 + lsrs r1, r0, 24 + movs r0, 0x2 + ands r1, r0 + cmp r1, 0 + beq _080632F4 + mov r0, r9 + cmp r0, 0 + bne _08063278 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + bne _08063278 +_080632F4: + adds r4, 0x1 + cmp r4, 0x3 + ble _080632AE +_080632FA: + movs r0, 0 +_080632FC: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end ai_has_super_effective_move_on_field + + thumb_func_start ai_is_too_invested_in_stat_buffs +ai_is_too_invested_in_stat_buffs: @ 806331C + push {r4,lr} + movs r4, 0 + ldr r1, =0x02024084 + ldr r0, =0x02024064 + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x18 + adds r2, r0, r1 + movs r3, 0x7 +_08063330: + ldrb r1, [r2] + movs r0, 0 + ldrsb r0, [r2, r0] + cmp r0, 0x6 + ble _08063346 + subs r1, 0x6 + lsls r0, r4, 24 + asrs r0, 24 + adds r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 +_08063346: + adds r2, 0x1 + subs r3, 0x1 + cmp r3, 0 + bge _08063330 + movs r0, 0 + cmp r4, 0x3 + bls _08063356 + movs r0, 0x1 +_08063356: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end ai_is_too_invested_in_stat_buffs + + thumb_func_start ai_switchout_something +ai_switchout_something: @ 8063364 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x4] + ldr r2, =0x02024250 + ldr r1, =0x02024064 + ldrb r3, [r1] + lsls r0, r3, 1 + adds r4, r0, r2 + ldrh r2, [r4] + adds r5, r1, 0 + cmp r2, 0 + bne _08063390 + b _080635EE +_08063390: + ldr r0, =0x0000ffff + cmp r2, r0 + bne _08063398 + b _080635EE +_08063398: + ldr r0, =0x02024270 + adds r0, r3, r0 + ldrb r0, [r0] + cmp r0, 0xFF + bne _080633A4 + b _080635EE +_080633A4: + ldr r2, =gBattleMoves + ldrh r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0 + bne _080633B8 + b _080635EE +_080633B8: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0806342C + mov r9, r3 + mov r0, r9 + bl battle_get_per_side_status + movs r4, 0x2 + eors r0, r4 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + ldr r1, =0x02024210 + ldrb r1, [r1] + ldr r2, =gUnknown_0832A328 + lsls r0, 24 + lsrs r0, 22 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _08063414 + ldrb r5, [r5] + mov r10, r5 + b _08063430 + .pool +_08063414: + ldrb r0, [r5] + bl battle_get_per_side_status + eors r0, r4 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + b _08063430 +_0806342C: + mov r9, r3 + mov r10, r9 +_08063430: + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x00808000 + ands r0, r1 + cmp r0, 0 + beq _08063490 + ldr r2, =0x02024064 + ldrb r1, [r2] + movs r0, 0x2 + ands r0, r1 + adds r5, r2, 0 + cmp r0, 0 + bne _08063460 + movs r4, 0 + movs r0, 0x3 + str r0, [sp, 0x8] + b _08063498 + .pool +_08063460: + movs r4, 0x3 + movs r1, 0x6 + str r1, [sp, 0x8] + b _08063498 +_08063468: + ldr r0, =0x02024064 + ldrb r0, [r0] + ldr r1, =0x0202449c + ldr r1, [r1] + adds r0, r1 + movs r2, 0xA5 + lsls r2, 2 + adds r0, r2 + strb r6, [r0] + movs r0, 0x1 + movs r1, 0x2 + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb + movs r0, 0x1 + b _080635F0 + .pool +_08063490: + movs r4, 0 + movs r0, 0x6 + str r0, [sp, 0x8] + ldr r5, =0x02024064 +_08063498: + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + ldr r1, =0x02024744 + str r1, [sp, 0xC] + cmp r0, 0 + bne _080634AC + ldr r2, =0x020244ec + str r2, [sp, 0xC] +_080634AC: + adds r6, r4, 0 + b _080635E6 + .pool +_080634BC: + movs r0, 0x64 + muls r0, r6 + ldr r1, [sp, 0xC] + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + bne _080634D2 + b _080635E4 +_080634D2: + adds r0, r5, 0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + bne _080634E0 + b _080635E4 +_080634E0: + adds r0, r5, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _080635E4 + ldr r1, =0x0202406e + mov r2, r9 + lsls r0, r2, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r6, r0 + beq _080635E4 + mov r2, r10 + lsls r0, r2, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r6, r0 + beq _080635E4 + ldr r0, =0x0202449c + ldr r1, [r0] + mov r2, r9 + adds r0, r2, r1 + adds r0, 0x5C + ldrb r0, [r0] + cmp r6, r0 + beq _080635E4 + mov r2, r10 + adds r0, r2, r1 + adds r0, 0x5C + ldrb r0, [r0] + cmp r6, r0 + beq _080635E4 + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r5, 0 + movs r1, 0x2E + bl pokemon_getattr + cmp r0, 0 + beq _08063558 + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + ldr r1, =gBaseStats + adds r0, r1 + ldrb r2, [r0, 0x17] + b _08063564 + .pool +_08063558: + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + ldr r2, =gBaseStats + adds r0, r2 + ldrb r2, [r0, 0x16] +_08063564: + ldr r1, =0x02024250 + ldr r5, =0x02024064 + ldrb r0, [r5] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + adds r1, r4, 0 + bl ai_rate_move + ldr r1, [sp] + ands r1, r0 + cmp r1, 0 + beq _080635E4 + ldr r1, =0x02024270 + ldrb r0, [r5] + adds r0, r1 + ldrb r0, [r0] + mov r9, r0 + movs r4, 0 + movs r0, 0x64 + adds r1, r6, 0 + muls r1, r0 + mov r8, r1 + ldr r1, =0x02024084 + movs r0, 0x58 + mov r2, r9 + muls r2, r0 + adds r0, r2, 0 + adds r5, r0, r1 + adds r7, r5, 0 + adds r7, 0x20 +_080635A2: + adds r1, r4, 0 + adds r1, 0xD + ldr r0, [sp, 0xC] + add r0, r8 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + beq _080635DE + ldrh r1, [r5] + ldrb r2, [r7] + bl ai_rate_move + lsls r0, 24 + lsrs r1, r0, 24 + movs r0, 0x2 + ands r1, r0 + cmp r1, 0 + beq _080635DE + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + ldr r1, [sp, 0x4] + bl __modsi3 + cmp r0, 0 + bne _080635DE + b _08063468 +_080635DE: + adds r4, 0x1 + cmp r4, 0x3 + ble _080635A2 +_080635E4: + adds r6, 0x1 +_080635E6: + ldr r0, [sp, 0x8] + cmp r6, r0 + bge _080635EE + b _080634BC +_080635EE: + movs r0, 0 +_080635F0: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end ai_switchout_something + + thumb_func_start sub_8063614 +sub_8063614: @ 8063614 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r6, =0x02024084 + ldr r4, =0x02024064 + ldrb r2, [r4] + movs r5, 0x58 + adds r0, r2, 0 + muls r0, r5 + adds r1, r6, 0 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + ldr r1, =0x0400e000 + ands r0, r1 + cmp r0, 0 + beq _0806363E + b _0806386C +_0806363E: + ldr r0, =0x020242ac + lsls r1, r2, 2 + adds r1, r0 + ldr r1, [r1] + movs r0, 0x80 + lsls r0, 3 + ands r1, r0 + cmp r1, 0 + beq _08063652 + b _0806386C +_08063652: + str r1, [sp] + movs r0, 0xC + adds r1, r2, 0 + movs r2, 0x17 + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _0806366A + b _0806386C +_0806366A: + ldrb r1, [r4] + str r0, [sp] + movs r0, 0xC + movs r2, 0x47 + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _08063682 + b _0806386C +_08063682: + str r0, [sp] + movs r0, 0xE + movs r1, 0 + movs r2, 0x2A + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _080636B4 + ldrb r0, [r4] + muls r0, r5 + adds r1, r0, r6 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0x8 + bne _080636A8 + b _0806386C +_080636A8: + adds r0, r1, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0x8 + bne _080636B4 + b _0806386C +_080636B4: + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 11 + ands r0, r1 + cmp r0, 0 + beq _080636C4 + b _0806386C +_080636C4: + movs r0, 0 + mov r10, r0 + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0806372E + ldrb r7, [r4] + adds r0, r7, 0 + bl battle_get_per_side_status + movs r5, 0x2 + eors r0, r5 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + ldr r1, =0x02024210 + ldrb r1, [r1] + ldr r2, =gUnknown_0832A328 + lsls r0, 24 + lsrs r0, 22 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _08063718 + ldrb r6, [r4] + b _08063732 + .pool +_08063718: + ldrb r0, [r4] + bl battle_get_per_side_status + eors r0, r5 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r6, r0, 24 + b _08063732 +_0806372E: + ldrb r6, [r4] + adds r7, r6, 0 +_08063732: + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x00808000 + ands r0, r1 + cmp r0, 0 + beq _08063768 + ldr r2, =0x02024064 + ldrb r1, [r2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08063760 + movs r4, 0 + movs r1, 0x3 + mov r8, r1 + b _08063770 + .pool +_08063760: + movs r4, 0x3 + movs r0, 0x6 + mov r8, r0 + b _08063770 +_08063768: + movs r4, 0 + movs r1, 0x6 + mov r8, r1 + ldr r2, =0x02024064 +_08063770: + ldrb r0, [r2] + bl battle_side_get_owner + lsls r0, 24 + ldr r1, =0x02024744 + mov r9, r1 + cmp r0, 0 + bne _08063784 + ldr r0, =0x020244ec + mov r9, r0 +_08063784: + adds r5, r4, 0 + cmp r5, r8 + bge _080637F2 +_0806378A: + movs r0, 0x64 + muls r0, r5 + mov r1, r9 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _080637EC + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + beq _080637EC + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _080637EC + ldr r1, =0x0202406e + lsls r0, r7, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r5, r0 + beq _080637EC + lsls r0, r6, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r5, r0 + beq _080637EC + ldr r0, =0x0202449c + ldr r1, [r0] + adds r0, r7, r1 + adds r0, 0x5C + ldrb r0, [r0] + cmp r5, r0 + beq _080637EC + adds r0, r6, r1 + adds r0, 0x5C + ldrb r0, [r0] + cmp r5, r0 + beq _080637EC + movs r0, 0x1 + add r10, r0 +_080637EC: + adds r5, 0x1 + cmp r5, r8 + blt _0806378A +_080637F2: + mov r1, r10 + cmp r1, 0 + beq _0806386C + bl ai_switch_perish_song + lsls r0, 24 + cmp r0, 0 + bne _08063852 + bl sub_8062C58 + lsls r0, 24 + cmp r0, 0 + bne _08063852 + bl sub_8062E54 + lsls r0, 24 + cmp r0, 0 + bne _08063852 + bl ai_switchout_natural_cure + lsls r0, 24 + cmp r0, 0 + bne _08063852 + movs r0, 0 + bl ai_has_super_effective_move_on_field + lsls r0, 24 + cmp r0, 0 + bne _0806386C + bl ai_is_too_invested_in_stat_buffs + lsls r0, 24 + cmp r0, 0 + bne _0806386C + movs r0, 0x8 + movs r1, 0x2 + bl ai_switchout_something + lsls r0, 24 + cmp r0, 0 + bne _08063852 + movs r0, 0x4 + movs r1, 0x3 + bl ai_switchout_something + lsls r0, 24 + cmp r0, 0 + beq _0806386C +_08063852: + movs r0, 0x1 + b _0806386E + .pool +_0806386C: + movs r0, 0 +_0806386E: + 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_8063614 + + thumb_func_start sub_8063880 +sub_8063880: @ 8063880 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, =0x02024064 + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r6, r0, 24 + adds r5, r6, 0 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + ldr r1, =0x02024744 + mov r8, r1 + cmp r0, 0 + bne _080638A8 + ldr r2, =0x020244ec + mov r8, r2 +_080638A8: + ldr r7, =0x02022fec + ldr r0, [r7] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + bne _080638B6 + b _080639E6 +_080638B6: + bl sub_8063614 + lsls r0, 24 + cmp r0, 0 + bne _080638C2 + b _080639DC +_080638C2: + ldrb r0, [r4] + ldr r2, =0x0202449c + ldr r1, [r2] + adds r0, r1 + movs r1, 0xA5 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x6 + bne _080639B8 + bl sub_8063A90 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x6 + bne _080639A6 + ldr r0, [r7] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08063910 + adds r0, r6, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + b _08063928 + .pool +_08063910: + adds r0, r5, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0x2 + eors r5, r0 + adds r0, r5, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r5, r0, 24 +_08063928: + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x00808000 + ands r0, r1 + cmp r0, 0 + beq _08063958 + ldr r0, =0x02024064 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08063954 + movs r0, 0 + movs r7, 0x3 + b _0806395C + .pool +_08063954: + movs r0, 0x3 + b _0806395A +_08063958: + movs r0, 0 +_0806395A: + movs r7, 0x6 +_0806395C: + adds r4, r0, 0 + cmp r4, r7 + bge _080639A6 +_08063962: + movs r0, 0x64 + muls r0, r4 + add r0, r8 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _080639A0 + ldr r1, =0x0202406e + lsls r0, r6, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r4, r0 + beq _080639A0 + lsls r0, r5, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r4, r0 + beq _080639A0 + ldr r0, =0x0202449c + ldr r1, [r0] + adds r0, r6, r1 + adds r0, 0x5C + ldrb r0, [r0] + cmp r4, r0 + beq _080639A0 + adds r0, r5, r1 + adds r0, 0x5C + ldrb r0, [r0] + cmp r4, r0 + bne _080639A6 +_080639A0: + adds r4, 0x1 + cmp r4, r7 + blt _08063962 +_080639A6: + ldr r0, =0x02024064 + ldrb r0, [r0] + ldr r2, =0x0202449c + ldr r1, [r2] + adds r0, r1 + movs r1, 0xA5 + lsls r1, 2 + adds r0, r1 + strb r4, [r0] +_080639B8: + ldr r0, =0x02024064 + ldrb r1, [r0] + ldr r0, [r2] + adds r0, r1, r0 + adds r1, r0, 0 + adds r1, 0x5C + movs r2, 0xA5 + lsls r2, 2 + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + b _080639F8 + .pool +_080639DC: + bl sub_8063EE0 + lsls r0, 24 + cmp r0, 0 + bne _080639F8 +_080639E6: + ldr r0, =0x02024064 + ldrb r0, [r0] + movs r2, 0x1 + eors r2, r0 + lsls r2, 8 + movs r0, 0x1 + movs r1, 0 + bl dp01_build_cmdbuf_x21_a_bb +_080639F8: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8063880 + + thumb_func_start sub_8063A08 +sub_8063A08: @ 8063A08 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r6, r3, 0 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + movs r7, 0 + ldr r0, =gUnknown_0831ACE8 + mov r10, r0 + ldrb r0, [r0] + cmp r0, 0xFF + beq _08063A7A + mov r5, r10 +_08063A36: + ldrb r0, [r5] + cmp r0, 0xFE + beq _08063A6C + ldr r1, [sp] + cmp r0, r1 + bne _08063A6C + ldrb r4, [r5, 0x1] + cmp r4, r9 + bne _08063A56 + ldrb r1, [r6] + ldrb r0, [r5, 0x2] + muls r0, r1 + movs r1, 0xA + bl __divsi3 + strb r0, [r6] +_08063A56: + cmp r4, r8 + bne _08063A6C + cmp r9, r8 + beq _08063A6C + ldrb r1, [r6] + ldrb r0, [r5, 0x2] + muls r0, r1 + movs r1, 0xA + bl __divsi3 + strb r0, [r6] +_08063A6C: + adds r5, 0x3 + adds r7, 0x3 + mov r1, r10 + adds r0, r7, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _08063A36 +_08063A7A: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8063A08 + + thumb_func_start sub_8063A90 +sub_8063A90: @ 8063A90 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + ldr r4, =0x02024064 + ldrb r2, [r4] + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, r2, r0 + adds r1, r0, 0 + adds r1, 0x5C + ldrb r0, [r1] + cmp r0, 0x6 + beq _08063AB2 + b _08063E50 +_08063AB2: + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 11 + ands r0, r1 + cmp r0, 0 + beq _08063AE0 + ldr r1, =0x0202406e + lsls r0, r2, 1 + adds r0, r1 + ldrb r0, [r0] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + b _08063E50 + .pool +_08063AE0: + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + beq _08063B6C + str r2, [sp, 0x10] + adds r0, r2, 0 + bl battle_get_per_side_status + movs r5, 0x2 + eors r0, r5 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + ldr r1, =0x02024210 + ldrb r1, [r1] + ldr r2, =gUnknown_0832A328 + lsls r0, 24 + lsrs r0, 22 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _08063B20 + ldrb r4, [r4] + str r4, [sp, 0x14] + b _08063B36 + .pool +_08063B20: + ldrb r0, [r4] + bl battle_get_per_side_status + eors r0, r5 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x14] +_08063B36: + bl GenerateRandomNumber + movs r3, 0x2 + ands r0, r3 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + ldr r4, [sp, 0x4] + lsls r0, r4, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _08063B8A + eors r4, r3 + lsls r0, r4, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + b _08063B8A + .pool +_08063B6C: + adds r0, r2, 0 + bl battle_get_per_side_status + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + ldrb r4, [r4] + str r4, [sp, 0x14] + str r4, [sp, 0x10] +_08063B8A: + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x00808000 + ands r0, r1 + cmp r0, 0 + beq _08063BC2 + ldr r2, =0x02024064 + ldrb r1, [r2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08063BB8 + movs r0, 0 + str r0, [sp, 0x18] + movs r1, 0x3 + str r1, [sp, 0x1C] + b _08063BCC + .pool +_08063BB8: + movs r4, 0x3 + str r4, [sp, 0x18] + movs r0, 0x6 + str r0, [sp, 0x1C] + b _08063BCC +_08063BC2: + movs r1, 0 + str r1, [sp, 0x18] + movs r2, 0x6 + str r2, [sp, 0x1C] + ldr r2, =0x02024064 +_08063BCC: + ldrb r0, [r2] + bl battle_side_get_owner + lsls r0, 24 + ldr r4, =0x02024744 + str r4, [sp, 0x20] + cmp r0, 0 + bne _08063BE0 + ldr r0, =0x020244ec + str r0, [sp, 0x20] +_08063BE0: + movs r1, 0 + mov r9, r1 +_08063BE4: + movs r2, 0 + str r2, [sp, 0x8] + movs r4, 0x6 + str r4, [sp, 0xC] + ldr r7, [sp, 0x18] + ldr r0, [sp, 0x1C] + cmp r7, r0 + blt _08063BF6 + b _08063CF2 +_08063BF6: + lsls r0, r7, 2 + ldr r1, =gUnknown_0832A328 + adds r0, r1 + mov r8, r0 + mov r10, sp +_08063C00: + movs r0, 0x64 + muls r0, r7 + ldr r2, [sp, 0x20] + adds r4, r2, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + beq _08063CD8 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _08063CD8 + mov r4, r8 + ldr r0, [r4] + mov r1, r9 + ands r0, r1 + cmp r0, 0 + bne _08063CD8 + ldr r1, =0x0202406e + ldr r2, [sp, 0x10] + lsls r0, r2, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r7 + beq _08063CD8 + ldr r4, [sp, 0x14] + lsls r0, r4, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r7 + beq _08063CD8 + ldr r0, =0x0202449c + ldr r1, [r0] + adds r0, r2, r1 + adds r0, 0x5C + ldrb r0, [r0] + cmp r7, r0 + beq _08063CD8 + adds r0, r4, r1 + adds r0, 0x5C + ldrb r0, [r0] + cmp r7, r0 + beq _08063CD8 + ldr r1, =gBaseStats + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r5, [r0, 0x6] + ldrb r6, [r0, 0x7] + movs r0, 0xA + mov r1, r10 + strb r0, [r1] + movs r0, 0x58 + ldr r2, [sp, 0x4] + adds r4, r2, 0 + muls r4, r0 + ldr r0, =0x02024084 + adds r4, r0 + adds r0, r4, 0 + adds r0, 0x21 + ldrb r0, [r0] + adds r1, r5, 0 + adds r2, r6, 0 + mov r3, sp + bl sub_8063A08 + adds r4, 0x22 + ldrb r0, [r4] + adds r1, r5, 0 + adds r2, r6, 0 + mov r3, sp + bl sub_8063A08 + ldr r2, [sp, 0x8] + mov r1, r10 + ldrb r1, [r1] + cmp r2, r1 + bcs _08063CE6 + mov r2, r10 + ldrb r2, [r2] + str r2, [sp, 0x8] + lsls r0, r7, 24 + lsrs r0, 24 + str r0, [sp, 0xC] + b _08063CE6 + .pool +_08063CD8: + mov r4, r8 + ldr r0, [r4] + mov r1, r9 + orrs r1, r0 + lsls r0, r1, 24 + lsrs r0, 24 + mov r9, r0 +_08063CE6: + movs r2, 0x4 + add r8, r2 + adds r7, 0x1 + ldr r4, [sp, 0x1C] + cmp r7, r4 + blt _08063C00 +_08063CF2: + ldr r0, [sp, 0xC] + cmp r0, 0x6 + beq _08063D54 + movs r7, 0 + movs r0, 0x64 + ldr r1, [sp, 0xC] + adds r5, r1, 0 + muls r5, r0 +_08063D02: + adds r1, r7, 0 + adds r1, 0xD + ldr r2, [sp, 0x20] + adds r0, r2, r5 + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _08063D2A + ldr r0, =0x02024064 + ldrb r1, [r0] + adds r0, r4, 0 + ldr r2, [sp, 0x4] + bl move_effectiveness_something + movs r1, 0x2 + ands r1, r0 + cmp r1, 0 + bne _08063D30 +_08063D2A: + adds r7, 0x1 + cmp r7, 0x3 + ble _08063D02 +_08063D30: + cmp r7, 0x4 + beq _08063D36 + b _08063E4E +_08063D36: + ldr r4, [sp, 0xC] + lsls r0, r4, 2 + ldr r1, =gUnknown_0832A328 + adds r0, r1 + ldr r0, [r0] + mov r2, r9 + orrs r2, r0 + lsls r0, r2, 24 + lsrs r0, 24 + mov r9, r0 + b _08063D58 + .pool +_08063D54: + movs r4, 0x3F + mov r9, r4 +_08063D58: + mov r0, r9 + cmp r0, 0x3F + beq _08063D60 + b _08063BE4 +_08063D60: + ldr r0, =0x02024400 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x0202449c + ldr r0, [r0] + strb r1, [r0, 0x13] + ldr r0, =0x02024474 + movs r2, 0x1 + strb r2, [r0, 0xE] + ldr r0, =0x0202427c + strb r1, [r0] + ldr r0, =0x02024211 + strb r2, [r0] + movs r1, 0 + str r1, [sp, 0x8] + movs r2, 0x6 + str r2, [sp, 0xC] + ldr r7, [sp, 0x18] + ldr r4, [sp, 0x1C] + cmp r7, r4 + bge _08063E4E +_08063D8A: + movs r0, 0x64 + adds r6, r7, 0 + muls r6, r0 + ldr r0, [sp, 0x20] + adds r4, r0, r6 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + adds r1, r7, 0x1 + mov r10, r1 + cmp r0, 0 + beq _08063E46 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _08063E46 + ldr r1, =0x0202406e + ldr r2, [sp, 0x10] + lsls r0, r2, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r7 + beq _08063E46 + ldr r4, [sp, 0x14] + lsls r0, r4, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r7 + beq _08063E46 + ldr r0, =0x0202449c + ldr r1, [r0] + adds r0, r2, r1 + adds r0, 0x5C + ldrb r0, [r0] + cmp r7, r0 + beq _08063E46 + adds r0, r4, r1 + adds r0, 0x5C + ldrb r0, [r0] + cmp r7, r0 + beq _08063E46 + movs r5, 0 + mov r9, r6 + ldr r0, =0x020241f0 + mov r8, r0 + ldr r6, =0x02024064 +_08063DEE: + adds r1, r5, 0 + adds r1, 0xD + ldr r0, [sp, 0x20] + add r0, r9 + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0 + mov r1, r8 + str r0, [r1] + cmp r4, 0 + beq _08063E2A + ldr r0, =gBattleMoves + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + cmp r0, 0x1 + beq _08063E2A + ldrb r0, [r6] + ldr r1, [sp, 0x4] + bl sub_8046E7C + ldrb r1, [r6] + adds r0, r4, 0 + ldr r2, [sp, 0x4] + bl move_effectiveness_something +_08063E2A: + mov r2, r8 + ldr r0, [r2] + ldr r4, [sp, 0x8] + cmp r4, r0 + bge _08063E40 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] + lsls r0, r7, 24 + lsrs r0, 24 + str r0, [sp, 0xC] +_08063E40: + adds r5, 0x1 + cmp r5, 0x3 + ble _08063DEE +_08063E46: + mov r7, r10 + ldr r0, [sp, 0x1C] + cmp r7, r0 + blt _08063D8A +_08063E4E: + ldr r0, [sp, 0xC] +_08063E50: + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8063A90 + + thumb_func_start ai_identify_item_effect +ai_identify_item_effect: @ 8063E84 + push {r4,lr} + adds r2, r1, 0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x13 + bne _08063E94 + movs r0, 0x1 + b _08063EDA +_08063E94: + ldrb r1, [r2, 0x4] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08063EA2 + movs r0, 0x2 + b _08063EDA +_08063EA2: + ldrb r4, [r2, 0x3] + movs r3, 0x3F + adds r0, r3, 0 + ands r0, r4 + cmp r0, 0 + beq _08063EB2 + movs r0, 0x3 + b _08063EDA +_08063EB2: + ldrb r1, [r2] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _08063EC8 + ldrb r0, [r2, 0x1] + cmp r0, 0 + bne _08063EC8 + ldrb r0, [r2, 0x2] + cmp r0, 0 + beq _08063ECC +_08063EC8: + movs r0, 0x4 + b _08063EDA +_08063ECC: + movs r0, 0x80 + ands r0, r4 + cmp r0, 0 + bne _08063ED8 + movs r0, 0x6 + b _08063EDA +_08063ED8: + movs r0, 0x5 +_08063EDA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end ai_identify_item_effect + + thumb_func_start sub_8063EE0 +sub_8063EE0: @ 8063EE0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r0, 0 + mov r10, r0 + movs r7, 0 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _08063F12 + ldr r0, =0x02024064 + ldrb r0, [r0] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08063F12 + b _0806437C +_08063F12: + ldr r0, =0x02024064 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + ldr r5, =0x02024744 + cmp r0, 0 + bne _08063F24 + ldr r5, =0x020244ec +_08063F24: + movs r1, 0 + mov r8, r1 +_08063F28: + movs r0, 0x64 + mov r2, r8 + muls r2, r0 + adds r0, r2, 0 + adds r4, r5, r0 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _08063F64 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + beq _08063F64 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _08063F64 + mov r0, r10 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 +_08063F64: + movs r0, 0x1 + add r8, r0 + mov r1, r8 + cmp r1, 0x5 + ble _08063F28 + movs r2, 0 + mov r8, r2 +_08063F72: + ldr r1, =0x020244a8 + mov r0, r8 + cmp r0, 0 + beq _08063F8E + ldr r0, [r1] + ldr r0, [r0, 0x18] + adds r0, 0x50 + ldrb r0, [r0] + mov r2, r8 + subs r0, r2 + adds r0, 0x1 + cmp r10, r0 + ble _08063F8E + b _08064370 +_08063F8E: + ldr r0, [r1] + ldr r0, [r0, 0x18] + mov r2, r8 + lsls r1, r2, 1 + adds r0, 0x48 + adds r0, r1 + ldrh r0, [r0] + mov r9, r0 + str r1, [sp] + cmp r0, 0 + bne _08063FA6 + b _08064370 +_08063FA6: + ldr r1, =gItemEffectInfoPointers + subs r0, 0xD + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + cmp r1, 0 + bne _08063FB6 + b _08064370 +_08063FB6: + mov r0, r9 + cmp r0, 0xAF + bne _08063FE8 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003214 + adds r5, r0, r1 + b _08063FEA + .pool +_08063FE8: + adds r5, r1, 0 +_08063FEA: + mov r2, r9 + lsls r0, r2, 24 + lsrs r0, 24 + adds r1, r5, 0 + bl ai_identify_item_effect + ldr r4, =0x02024064 + ldrb r1, [r4] + lsrs r1, 1 + ldr r3, =0x0202449c + ldr r2, [r3] + adds r1, r2 + adds r1, 0xC4 + strb r0, [r1] + ldrb r0, [r4] + lsrs r0, 1 + ldr r1, [r3] + adds r0, r1 + adds r0, 0xC4 + ldrb r0, [r0] + subs r0, 0x1 + cmp r0, 0x5 + bls _0806401A + b _08064324 +_0806401A: + lsls r0, 2 + ldr r1, =_08064030 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08064030: + .4byte _08064048 + .4byte _08064074 + .4byte _080640BC + .4byte _08064214 + .4byte _080642F4 + .4byte _0806437C +_08064048: + ldr r2, =0x02024084 + ldr r0, =0x02024064 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r1, [r0, 0x2C] + ldrh r0, [r0, 0x28] + lsrs r1, 2 + cmp r0, r1 + bcc _08064060 + b _08064324 +_08064060: + cmp r0, 0 + bne _08064066 + b _08064324 +_08064066: + movs r7, 0x1 + b _08064328 + .pool +_08064074: + mov r0, r9 + movs r1, 0x4 + movs r2, 0x4 + bl sub_806CDDC + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _08064088 + b _08064324 +_08064088: + ldr r2, =0x02024084 + ldr r0, =0x02024064 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r1, r0, r2 + ldrh r2, [r1, 0x28] + cmp r2, 0 + bne _0806409C + b _08064324 +_0806409C: + ldrh r3, [r1, 0x2C] + lsrs r0, r3, 2 + cmp r2, r0 + bcc _08064066 + adds r0, r2, 0 + subs r0, r3, r0 + adds r1, r5, r4 + ldrb r1, [r1] + cmp r0, r1 + bgt _080640B2 + b _08064324 +_080640B2: + b _08064066 + .pool +_080640BC: + ldr r3, =0x02024064 + ldrb r0, [r3] + lsrs r0, 1 + ldr r2, =0x0202449c + ldr r1, [r2] + adds r0, r1 + adds r0, 0xC6 + movs r1, 0 + strb r1, [r0] + ldrb r1, [r5, 0x3] + movs r6, 0x20 + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08064100 + ldr r1, =0x02024084 + ldrb r4, [r3] + movs r0, 0x58 + muls r0, r4 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + beq _08064100 + lsrs r1, r4, 1 + ldr r0, [r2] + adds r1, r0 + adds r1, 0xC6 + ldrb r0, [r1] + orrs r0, r6 + strb r0, [r1] + movs r7, 0x1 +_08064100: + ldrb r1, [r5, 0x3] + movs r6, 0x10 + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0806413A + ldr r1, =0x02024084 + ldrb r4, [r3] + movs r0, 0x58 + muls r0, r4 + adds r1, 0x4C + adds r0, r1 + ldr r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _0806412A + movs r0, 0x80 + ands r1, r0 + cmp r1, 0 + beq _0806413A +_0806412A: + lsrs r1, r4, 1 + ldr r0, [r2] + adds r1, r0 + adds r1, 0xC6 + ldrb r0, [r1] + orrs r0, r6 + strb r0, [r1] + movs r7, 0x1 +_0806413A: + ldrb r1, [r5, 0x3] + movs r6, 0x8 + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0806416C + ldr r1, =0x02024084 + ldrb r4, [r3] + movs r0, 0x58 + muls r0, r4 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0806416C + lsrs r1, r4, 1 + ldr r0, [r2] + adds r1, r0 + adds r1, 0xC6 + ldrb r0, [r1] + orrs r0, r6 + strb r0, [r1] + movs r7, 0x1 +_0806416C: + ldrb r1, [r5, 0x3] + movs r6, 0x4 + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0806419E + ldr r1, =0x02024084 + ldrb r4, [r3] + movs r0, 0x58 + muls r0, r4 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0806419E + lsrs r1, r4, 1 + ldr r0, [r2] + adds r1, r0 + adds r1, 0xC6 + ldrb r0, [r1] + orrs r0, r6 + strb r0, [r1] + movs r7, 0x1 +_0806419E: + ldrb r1, [r5, 0x3] + movs r6, 0x2 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080641D0 + ldr r1, =0x02024084 + ldrb r4, [r3] + movs r0, 0x58 + muls r0, r4 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080641D0 + lsrs r1, r4, 1 + ldr r0, [r2] + adds r1, r0 + adds r1, 0xC6 + ldrb r0, [r1] + orrs r0, r6 + strb r0, [r1] + movs r7, 0x1 +_080641D0: + ldrb r1, [r5, 0x3] + movs r4, 0x1 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080641DE + b _08064324 +_080641DE: + ldr r1, =0x02024084 + ldrb r3, [r3] + movs r0, 0x58 + muls r0, r3 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + bne _080641F6 + b _08064324 +_080641F6: + lsrs r1, r3, 1 + ldr r0, [r2] + adds r1, r0 + adds r1, 0xC6 + ldrb r0, [r1] + orrs r0, r4 + strb r0, [r1] + b _08064066 + .pool +_08064214: + ldr r4, =0x02024064 + ldrb r0, [r4] + lsrs r0, 1 + ldr r3, =0x0202449c + ldr r1, [r3] + adds r0, r1 + adds r0, 0xC6 + movs r1, 0 + strb r1, [r0] + ldr r1, =0x020242bc + ldrb r2, [r4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x16] + cmp r0, 0 + beq _08064324 + ldrb r1, [r5] + movs r6, 0xF + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _08064254 + lsrs r2, 1 + ldr r0, [r3] + adds r2, r0 + adds r2, 0xC6 + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] +_08064254: + ldrb r1, [r5, 0x1] + movs r7, 0xF0 + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _08064272 + ldrb r0, [r4] + lsrs r0, 1 + ldr r1, [r3] + adds r0, r1 + adds r0, 0xC6 + ldrb r1, [r0] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r0] +_08064272: + ldrb r1, [r5, 0x1] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _0806428E + ldrb r0, [r4] + lsrs r0, 1 + ldr r1, [r3] + adds r0, r1 + adds r0, 0xC6 + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_0806428E: + ldrb r1, [r5, 0x2] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _080642AA + ldrb r0, [r4] + lsrs r0, 1 + ldr r1, [r3] + adds r0, r1 + adds r0, 0xC6 + ldrb r1, [r0] + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0] +_080642AA: + ldrb r1, [r5, 0x2] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _080642C6 + ldrb r0, [r4] + lsrs r0, 1 + ldr r1, [r3] + adds r0, r1 + adds r0, 0xC6 + ldrb r1, [r0] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0] +_080642C6: + ldrb r1, [r5] + movs r0, 0x30 + ands r0, r1 + cmp r0, 0 + bne _080642D2 + b _08064066 +_080642D2: + ldrb r0, [r4] + lsrs r0, 1 + ldr r1, [r3] + adds r0, r1 + adds r0, 0xC6 + ldrb r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0] + b _08064066 + .pool +_080642F4: + ldr r4, =0x02024064 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, =0x020242bc + ldrb r1, [r4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x16] + cmp r0, 0 + beq _08064324 + ldr r0, =0x02024294 + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x4] + cmp r0, 0 + bne _08064324 + b _08064066 +_08064324: + cmp r7, 0 + beq _08064370 +_08064328: + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb + ldr r0, =0x02024064 + ldrb r0, [r0] + lsrs r0, 1 + ldr r1, =0x0202449c + ldr r1, [r1] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC0 + mov r1, r9 + strb r1, [r0] + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r0, [r0, 0x18] + adds r0, 0x48 + ldr r2, [sp] + adds r0, r2 + movs r1, 0 + strh r1, [r0] + adds r0, r7, 0 + b _0806437E + .pool +_08064370: + movs r0, 0x1 + add r8, r0 + mov r1, r8 + cmp r1, 0x3 + bgt _0806437C + b _08063F72 +_0806437C: + movs r0, 0 +_0806437E: + 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_8063EE0 + + thumb_func_start nullsub_28 +nullsub_28: @ 8064390 + bx lr + thumb_func_end nullsub_28 + + thumb_func_start sub_8064394 +sub_8064394: @ 8064394 + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_80643B0 + str r1, [r0] + bx lr + .pool + thumb_func_end sub_8064394 + + thumb_func_start sub_80643B0 +sub_80643B0: @ 80643B0 + push {lr} + ldr r2, =0x02024068 + ldr r1, =gUnknown_0832A328 + ldr r0, =0x02024064 + ldrb r3, [r0] + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _080643FC + ldr r0, =0x02023064 + lsls r1, r3, 9 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x38 + bhi _080643F8 + ldr r0, =gUnknown_0831C7B4 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 + b _080643FC + .pool +_080643F8: + bl sub_8065068 +_080643FC: + pop {r0} + bx r0 + thumb_func_end sub_80643B0 + + thumb_func_start sub_8064400 +sub_8064400: @ 8064400 + push {lr} + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + bne _08064424 + bl sub_8065068 +_08064424: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8064400 + + thumb_func_start sub_8064438 +sub_8064438: @ 8064438 + push {lr} + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + bne _0806445C + bl sub_8065068 +_0806445C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8064438 + + thumb_func_start sub_8064470 +sub_8064470: @ 8064470 + push {r4-r6,lr} + ldr r5, =0x02020630 + ldr r6, =0x020241e4 + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r2, r0, 2 + adds r0, r5, 0 + adds r0, 0x1C + adds r0, r2, r0 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + bne _080644C2 + adds r0, r2, r5 + ldrh r0, [r0, 0x6] + bl sub_805DFE4 + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl obj_free_rotscale_entry + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl RemoveObjectAndFreeTiles + bl sub_8065068 +_080644C2: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8064470 + + thumb_func_start sub_80644D8 +sub_80644D8: @ 80644D8 + push {r4,lr} + ldr r4, =0x020244d0 + ldr r1, [r4] + ldr r3, =0x02024064 + ldrb r0, [r3] + ldr r2, [r1, 0x4] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x9] + subs r0, 0x1 + strb r0, [r1, 0x9] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _08064510 + ldr r0, [r4] + ldrb r1, [r3] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strb r1, [r0, 0x9] + bl sub_8065068 +_08064510: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80644D8 + + thumb_func_start sub_8064520 +sub_8064520: @ 8064520 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r0, 0 + mov r8, r0 + movs r4, 0 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0806454C + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08064584 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08064584 +_0806454C: + ldr r2, =0x02020630 + ldr r1, =0x03005d70 + ldr r3, =0x02024064 + ldrb r0, [r3] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + adds r7, r3, 0 + cmp r1, r0 + bne _080645C2 + b _080645CA + .pool +_08064584: + ldr r3, =0x02020630 + ldr r6, =0x03005d70 + ldr r2, =0x02024064 + ldrb r4, [r2] + adds r0, r4, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r5, r3, 0 + adds r5, 0x1C + adds r0, r5 + ldr r3, [r0] + ldr r0, =DummyObjectCallback + adds r7, r2, 0 + cmp r3, r0 + bne _080645C0 + movs r0, 0x2 + eors r4, r0 + adds r0, r4, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r0, [r0] + cmp r0, r3 + bne _080645C0 + movs r1, 0x1 + mov r8, r1 +_080645C0: + movs r4, 0x1 +_080645C2: + mov r0, r8 + cmp r0, 0 + bne _080645CA + b _08064714 +_080645CA: + cmp r4, 0 + bne _080645DE + ldrb r1, [r7] + movs r0, 0x2 + eors r0, r1 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + bne _0806469C +_080645DE: + ldr r1, =0x020244d0 + mov r12, r1 + ldr r0, [r1] + ldr r7, =0x02024064 + ldrb r2, [r7] + ldr r3, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r4, r0, r3 + ldrb r1, [r4, 0x1] + movs r5, 0x1 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _08064600 + b _08064714 +_08064600: + movs r6, 0x2 + adds r1, r6, 0 + eors r1, r2 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r1, [r0, 0x1] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _08064714 + ldrb r1, [r4] + movs r3, 0x7F + adds r0, r3, 0 + ands r0, r1 + strb r0, [r4] + mov r1, r12 + ldr r0, [r1] + ldrb r2, [r7] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r4, 0x2 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + strb r0, [r1, 0x1] + mov r0, r12 + ldr r2, [r0] + ldrb r0, [r7] + adds r1, r6, 0 + eors r1, r0 + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + ands r3, r1 + strb r3, [r0] + mov r1, r12 + ldr r2, [r1] + ldrb r0, [r7] + adds r1, r6, 0 + eors r1, r0 + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1] + ands r4, r1 + strb r4, [r0, 0x1] + ldr r4, =0x000027f9 + adds r0, r4, 0 + bl FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + b _080646F2 + .pool +_0806469C: + ldr r3, =0x020244d0 + ldr r0, [r3] + ldrb r1, [r7] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r2, r0, r2 + ldrb r1, [r2, 0x1] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08064714 + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + ldr r0, [r3] + ldrb r2, [r7] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + ldrb r0, [r7] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _080646F2 + ldr r4, =0x000027f9 + adds r0, r4, 0 + bl FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag +_080646F2: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r3, =0x02024064 + ldrb r1, [r3] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x3 + strb r1, [r0, 0x9] + ldr r1, =0x03005d60 + ldrb r0, [r3] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_80644D8 + str r1, [r0] +_08064714: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8064520 + + thumb_func_start sub_8064734 +sub_8064734: @ 8064734 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r0, 0 + mov r10, r0 + ldr r5, =0x020244d0 + ldr r0, [r5] + ldr r4, =0x02024064 + ldrb r2, [r4] + ldr r1, [r0, 0x4] + lsls r3, r2, 1 + adds r0, r3, r2 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0] + movs r6, 0xC4 + lsls r6, 1 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _08064776 + ldr r0, =0x0202406e + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_08064776: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _080647B4 + ldr r2, [r5] + ldrb r1, [r4] + movs r0, 0x2 + adds r3, r0, 0 + eors r3, r1 + ldr r1, [r2, 0x4] + lsls r2, r3, 1 + adds r0, r2, r3 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _080647B4 + ldr r0, =0x0202406e + adds r0, r2, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 + adds r1, r0 + adds r0, r3, 0 + bl sub_8172EF0 +_080647B4: + ldr r3, =0x020244d0 + ldr r0, [r3] + ldr r2, =0x02024064 + ldrb r5, [r2] + ldr r4, [r0, 0x4] + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r6, r0, r4 + ldrb r1, [r6] + movs r0, 0x8 + mov r12, r0 + ands r0, r1 + mov r8, r3 + mov r9, r2 + cmp r0, 0 + bne _08064898 + movs r7, 0x2 + adds r1, r7, 0 + eors r1, r5 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0] + mov r0, r12 + ands r0, r1 + cmp r0, 0 + bne _08064898 + ldrb r1, [r6, 0x1] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0806487A + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0806484A + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0806484A + ldr r4, =0x03005d70 + mov r1, r9 + ldrb r0, [r1] + adds r1, r7, 0 + eors r1, r0 + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x02024744 + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe + mov r1, r9 + ldrb r0, [r1] + eors r0, r7 + bl sub_8076918 + mov r1, r9 + ldrb r0, [r1] + eors r0, r7 + adds r0, r4 + ldrb r0, [r0] + bl sub_80729D0 +_0806484A: + ldr r5, =0x03005d70 + ldr r4, =0x02024064 + ldrb r1, [r4] + adds r0, r1, r5 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x02024744 + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe + ldrb r0, [r4] + bl sub_8076918 + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + bl sub_80729D0 +_0806487A: + ldr r4, =0x020244d0 + ldr r0, [r4] + ldr r3, =0x02024064 + ldrb r1, [r3] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0, 0x1] + mov r8, r4 + mov r9, r3 +_08064898: + mov r1, r8 + ldr r0, [r1] + mov r1, r9 + ldrb r2, [r1] + ldr r3, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r3 + ldrb r1, [r0, 0x1] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0x80 + bne _0806495A + movs r1, 0x2 + eors r1, r2 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r1, [r0, 0x1] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0806495A + bl sub_80A36C8 + lsls r0, 24 + cmp r0, 0 + bne _0806495A + mov r1, r8 + ldr r0, [r1] + mov r1, r9 + ldrb r2, [r1] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x1] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _0806493C + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x42 + ands r0, r1 + cmp r0, 0x42 + bne _08064930 + adds r0, r2, 0 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0806493C + ldr r0, =0x03007420 + bl m4aMPlayContinue + b _0806493C + .pool +_08064930: + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl +_0806493C: + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0, 0x1] + movs r0, 0x1 + mov r10, r0 +_0806495A: + mov r1, r10 + cmp r1, 0 + bne _08064962 + b _08064AC0 +_08064962: + ldr r2, =0x02020630 + ldr r0, =0x03005d7c + ldr r5, =0x02024064 + ldrb r3, [r5] + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r4, [r0] + ldr r0, =DummyObjectCallback + cmp r4, r0 + beq _08064982 + b _08064AC0 +_08064982: + ldr r0, =0x020241e4 + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + cmp r0, r4 + beq _08064998 + b _08064AC0 +_08064998: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080649E2 + adds r0, r3, 0 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _080649E2 + ldr r3, =0x020244d0 + ldr r0, [r3] + ldrb r2, [r5] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x9] + adds r0, 0x1 + strb r0, [r1, 0x9] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08064AC0 + ldr r0, [r3] + ldrb r1, [r5] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strb r1, [r0, 0x9] +_080649E2: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08064A3A + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08064A3A + ldr r1, =0x03005d7c + ldr r5, =0x02024064 + ldrb r0, [r5] + movs r4, 0x2 + eors r0, r4 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + ldrb r0, [r5] + eors r4, r0 + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_805EE54 +_08064A3A: + ldr r1, =0x03005d7c + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + ldrb r5, [r4] + ldr r1, =0x0202406e + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + bl sub_805EE54 + ldr r3, =0x020244d0 + ldr r0, [r3] + ldr r2, [r0, 0x8] + ldrb r1, [r2, 0x9] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x9] + ldr r0, [r3] + ldrb r2, [r4] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r0, 0x21 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + ldr r0, [r3] + ldrb r2, [r4] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r0, 0x7F + ands r0, r2 + strb r0, [r1, 0x1] + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8064520 + str r1, [r0] +_08064AC0: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8064734 + + thumb_func_start sub_8064B04 +sub_8064B04: @ 8064B04 + push {r4-r7,lr} + ldr r4, =0x02020630 + ldr r0, =0x020241e4 + ldr r7, =0x02024064 + ldrb r3, [r7] + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r2, r0, 2 + adds r0, r4, 0 + adds r0, 0x1C + adds r0, r2, r0 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + bne _08064BB6 + adds r0, r2, r4 + movs r1, 0x24 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08064BB6 + ldr r6, =0x020244d0 + ldr r0, [r6] + ldr r1, [r0, 0x4] + lsls r4, r3, 1 + adds r0, r4, r3 + lsls r0, 2 + adds r2, r0, r1 + ldrb r5, [r2] + movs r0, 0x80 + ands r0, r5 + cmp r0, 0 + bne _08064B7C + ldr r0, =0x0202406e + adds r0, r4, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 + adds r1, r0 + adds r0, r3, 0 + bl sub_8172EF0 + b _08064BB6 + .pool +_08064B7C: + ldrb r1, [r2, 0x1] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08064BB6 + movs r0, 0x7F + ands r0, r5 + strb r0, [r2] + ldr r0, [r6] + ldrb r2, [r7] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + ldr r4, =0x000027f9 + adds r0, r4, 0 + bl FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + bl sub_8065068 +_08064BB6: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8064B04 + + thumb_func_start sub_8064BC0 +sub_8064BC0: @ 8064BC0 + push {r4-r6,lr} + ldr r6, =0x02024064 + ldrb r0, [r6] + ldr r5, =0x03005d70 + adds r1, r0, r5 + ldrb r1, [r1] + movs r2, 0 + movs r3, 0 + bl sub_8074AA0 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldrb r0, [r6] + adds r0, r5 + ldrb r0, [r0] + bl sub_80729D0 + lsls r4, 16 + asrs r1, r4, 16 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08064C08 + ldrb r0, [r6] + adds r0, r5 + ldrb r0, [r0] + movs r2, 0 + bl heathbar_draw_hp + b _08064C0C + .pool +_08064C08: + bl sub_8065068 +_08064C0C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8064BC0 + + thumb_func_start sub_8064C14 +sub_8064C14: @ 8064C14 + push {lr} + ldr r2, =0x02020630 + ldr r0, =0x020241e4 + ldr r1, =0x02024064 + ldrb r3, [r1] + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + bne _08064C42 + ldr r0, =0x03005d70 + adds r0, r3, r0 + ldrb r0, [r0] + bl sub_8072984 + bl sub_8065068 +_08064C42: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8064C14 + + thumb_func_start sub_8064C58 +sub_8064C58: @ 8064C58 + push {r4-r6,lr} + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r6, =0x02024064 + ldrb r2, [r6] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08064CB2 + ldr r5, =0x020241e4 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl obj_free_rotscale_entry + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldrb r0, [r6] + bl sub_805EEE0 + ldr r1, =0x03005d70 + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl sub_8065068 +_08064CB2: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8064C58 + + thumb_func_start sub_8064CCC +sub_8064CCC: @ 8064CCC + push {lr} + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _08064CDE + bl sub_8065068 +_08064CDE: + pop {r0} + bx r0 + thumb_func_end sub_8064CCC + + thumb_func_start sub_8064CE4 +sub_8064CE4: @ 8064CE4 + push {r4,lr} + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + ldr r2, =0x02020630 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, r0, r2 + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0x20 + bne _08064D30 + movs r3, 0 + movs r0, 0 + strh r0, [r4, 0x30] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + subs r0, 0x5 + ands r0, r1 + strb r0, [r2] + ldr r0, =0x020244b9 + strb r3, [r0] + bl sub_8065068 + b _08064D5A + .pool +_08064D30: + ldrh r0, [r4, 0x30] + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _08064D54 + adds r3, r4, 0 + adds r3, 0x3E + ldrb r2, [r3] + lsls r0, r2, 29 + lsrs r0, 31 + movs r1, 0x1 + eors r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] +_08064D54: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] +_08064D5A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8064CE4 + + thumb_func_start sub_8064D60 +sub_8064D60: @ 8064D60 + push {r4,lr} + ldr r2, =0x02020630 + ldr r0, =0x03005d70 + ldr r4, =0x02024064 + ldrb r3, [r4] + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + bne _08064DAC + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r3, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08064DA0 + adds r0, r3, 0 + adds r1, r3, 0 + adds r2, r3, 0 + movs r3, 0x6 + bl move_anim_start_t4 +_08064DA0: + ldr r0, =0x03005d60 + ldrb r1, [r4] + lsls r1, 2 + adds r1, r0 + ldr r0, =sub_8064DD0 + str r0, [r1] +_08064DAC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8064D60 + + thumb_func_start sub_8064DD0 +sub_8064DD0: @ 8064DD0 + push {r4,lr} + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r4, =0x02024064 + ldrb r1, [r4] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08064E2A + bl sub_80A36C8 + lsls r0, 24 + cmp r0, 0 + bne _08064E2A + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldrb r0, [r4] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + beq _08064E1A + ldr r0, =nullsub_18 + cmp r1, r0 + bne _08064E2A +_08064E1A: + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl + bl sub_8065068 +_08064E2A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8064DD0 + + thumb_func_start sub_8064E50 +sub_8064E50: @ 8064E50 + push {r4-r7,lr} + ldr r4, =0x020244d0 + ldr r0, [r4] + ldr r5, =0x02024064 + ldrb r2, [r5] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r3, r0, r1 + ldrb r1, [r3, 0x1] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08064F0C + ldr r7, =0x02020630 + ldr r6, =0x020241e4 + adds r0, r2, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r7, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + bne _08064F0C + ldrb r1, [r3] + movs r0, 0x7F + ands r0, r1 + strb r0, [r3] + ldr r0, [r4] + ldrb r2, [r5] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + ldr r4, =0x000027f9 + adds r0, r4, 0 + bl FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + movs r1, 0 + bl StartObjectImageAnim + ldr r4, =0x03005d70 + ldrb r1, [r5] + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x02024744 + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe + ldrb r0, [r5] + bl sub_8076918 + ldrb r0, [r5] + adds r0, r4 + ldrb r0, [r0] + bl sub_80729D0 + ldrb r0, [r5] + bl sub_805E408 + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8064D60 + str r1, [r0] +_08064F0C: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8064E50 + + thumb_func_start sub_8064F40 +sub_8064F40: @ 8064F40 + push {r4-r6,lr} + ldr r6, =0x020244d0 + ldr r0, [r6] + ldr r5, =0x02024064 + ldrb r2, [r5] + ldr r1, [r0, 0x4] + lsls r3, r2, 1 + adds r0, r3, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x88 + ands r0, r1 + cmp r0, 0 + bne _08064F72 + ldr r0, =0x0202406e + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_08064F72: + ldr r4, =0x02020630 + ldr r0, =0x03005d7c + ldrb r2, [r5] + adds r0, r2, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r3, r0, 2 + adds r0, r4, 0 + adds r0, 0x1C + adds r0, r3, r0 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + bne _08064FDC + ldr r0, [r6] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _08064FDC + adds r0, r3, r4 + bl RemoveObjectAndFreeTiles + ldrb r4, [r5] + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_805EE54 + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8064E50 + str r1, [r0] +_08064FDC: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8064F40 + + thumb_func_start sub_8065008 +sub_8065008: @ 8065008 + push {lr} + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _0806502A + bl sub_8065068 +_0806502A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8065008 + + thumb_func_start sub_8065038 +sub_8065038: @ 8065038 + push {lr} + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _0806505A + bl sub_8065068 +_0806505A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8065038 + + thumb_func_start sub_8065068 +sub_8065068: @ 8065068 + push {r4,lr} + sub sp, 0x4 + ldr r1, =0x03005d60 + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_80643B0 + str r1, [r0] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080650BC + bl link_get_multiplayer_id + mov r1, sp + strb r0, [r1] + movs r0, 0x2 + movs r1, 0x4 + mov r2, sp + bl dp01_prepare_buffer_wireless_probably + ldr r1, =0x02023064 + ldrb r0, [r4] + lsls r0, 9 + adds r0, r1 + movs r1, 0x38 + strb r1, [r0] + b _080650CE + .pool +_080650BC: + ldr r2, =0x02024068 + ldr r1, =gUnknown_0832A328 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldr r0, [r2] + bics r0, r1 + str r0, [r2] +_080650CE: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8065068 + + thumb_func_start dp01t_00_2_getattr +dp01t_00_2_getattr: @ 80650E0 + push {r4-r6,lr} + sub sp, 0x100 + movs r6, 0 + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _08065118 + ldr r0, =0x0202406e + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + mov r1, sp + bl dp01_getattr_by_ch1_for_opponent_pokemon + adds r6, r0, 0 + b _0806513A + .pool +_08065118: + ldrb r4, [r1] + movs r5, 0 +_0806511C: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _08065132 + lsls r0, r5, 24 + lsrs r0, 24 + mov r2, sp + adds r1, r2, r6 + bl dp01_getattr_by_ch1_for_opponent_pokemon + adds r6, r0 +_08065132: + lsrs r4, 1 + adds r5, 0x1 + cmp r5, 0x5 + ble _0806511C +_0806513A: + lsls r1, r6, 16 + lsrs r1, 16 + movs r0, 0x1 + mov r2, sp + bl dp01_build_cmdbuf_x1D_1D_numargs_varargs + bl sub_8065068 + add sp, 0x100 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end dp01t_00_2_getattr + + thumb_func_start dp01_getattr_by_ch1_for_opponent_pokemon +dp01_getattr_by_ch1_for_opponent_pokemon: @ 8065154 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x90 + adds r7, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + movs r6, 0 + ldr r2, =0x02023064 + ldr r3, =0x02024064 + ldrb r0, [r3] + lsls r0, 9 + adds r1, r2, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3B + bls _0806517E + bl _080658EA +_0806517E: + lsls r0, 2 + ldr r1, =_08065194 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08065194: + .4byte _08065284 + .4byte _080654A8 + .4byte _080654B8 + .4byte _080654C8 + .4byte _08065530 + .4byte _08065530 + .4byte _08065530 + .4byte _08065530 + .4byte _0806554C + .4byte _08065588 + .4byte _08065588 + .4byte _08065588 + .4byte _08065588 + .4byte _080658EA + .4byte _080658EA + .4byte _080658EA + .4byte _080658EA + .4byte _080655A4 + .4byte _080655B4 + .4byte _080655E4 + .4byte _080655F4 + .4byte _08065604 + .4byte _08065614 + .4byte _08065624 + .4byte _08065634 + .4byte _08065644 + .4byte _08065654 + .4byte _08065664 + .4byte _08065674 + .4byte _08065684 + .4byte _08065694 + .4byte _080656A4 + .4byte _080656F4 + .4byte _08065704 + .4byte _08065714 + .4byte _08065724 + .4byte _08065734 + .4byte _08065744 + .4byte _08065754 + .4byte _08065764 + .4byte _08065774 + .4byte _080657A8 + .4byte _080657B8 + .4byte _080657C8 + .4byte _080657D8 + .4byte _080657E8 + .4byte _080657F8 + .4byte _08065808 + .4byte _08065818 + .4byte _08065838 + .4byte _08065848 + .4byte _08065858 + .4byte _08065868 + .4byte _08065878 + .4byte _08065888 + .4byte _08065898 + .4byte _080658A8 + .4byte _080658B8 + .4byte _080658C8 + .4byte _080658D8 +_08065284: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + mov r1, sp + strh r0, [r1] + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x2E] + movs r6, 0 + add r0, sp, 0x24 + mov r9, r0 + movs r1, 0x3B + add r1, sp + mov r10, r1 + mov r2, sp + adds r2, 0x2B + str r2, [sp, 0x80] + mov r0, sp + adds r0, 0x2A + str r0, [sp, 0x7C] + mov r1, sp + adds r1, 0x68 + str r1, [sp, 0x8C] + adds r2, 0x5 + str r2, [sp, 0x84] + adds r0, 0x12 + str r0, [sp, 0x88] + mov r8, r4 + add r4, sp, 0xC +_080652D0: + adds r1, r6, 0 + adds r1, 0xD + mov r0, r8 + bl pokemon_getattr + strh r0, [r4] + adds r1, r6, 0 + adds r1, 0x11 + mov r0, r8 + bl pokemon_getattr + mov r2, r9 + adds r1, r2, r6 + strb r0, [r1] + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _080652D0 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x15 + bl pokemon_getattr + mov r1, r10 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x20 + bl pokemon_getattr + ldr r2, [sp, 0x80] + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0x19 + bl pokemon_getattr + str r0, [sp, 0x44] + adds r0, r4, 0 + movs r1, 0x27 + bl pokemon_getattr + mov r3, sp + movs r5, 0x1F + ands r0, r5 + ldrb r2, [r3, 0x14] + movs r1, 0x20 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x14] + adds r0, r4, 0 + movs r1, 0x28 + bl pokemon_getattr + mov r3, sp + movs r6, 0x1F + ands r0, r6 + lsls r0, 5 + ldrh r2, [r3, 0x14] + ldr r1, =0xfffffc1f + ands r1, r2 + orrs r1, r0 + strh r1, [r3, 0x14] + adds r0, r4, 0 + movs r1, 0x29 + bl pokemon_getattr + mov r3, sp + ands r0, r5 + lsls r0, 2 + ldrb r2, [r3, 0x15] + movs r1, 0x7D + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x15] + adds r0, r4, 0 + movs r1, 0x2A + bl pokemon_getattr + movs r1, 0x1F + ands r1, r0 + lsls r1, 15 + ldr r0, [sp, 0x14] + ldr r2, =0xfff07fff + ands r0, r2 + orrs r0, r1 + str r0, [sp, 0x14] + adds r0, r4, 0 + movs r1, 0x2B + bl pokemon_getattr + mov r3, sp + ands r0, r6 + lsls r0, 4 + ldrh r2, [r3, 0x16] + ldr r1, =0xfffffe0f + ands r1, r2 + orrs r1, r0 + strh r1, [r3, 0x16] + adds r0, r4, 0 + movs r1, 0x2C + bl pokemon_getattr + mov r3, sp + ands r0, r5 + lsls r0, 1 + ldrb r2, [r3, 0x17] + movs r1, 0x3F + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x17] + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + str r0, [sp, 0x48] + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr + str r0, [sp, 0x4C] + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + ldr r1, [sp, 0x7C] + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x28] + adds r0, r4, 0 + movs r1, 0x3A + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x2C] + adds r0, r4, 0 + movs r1, 0x3B + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x2] + adds r0, r4, 0 + movs r1, 0x3C + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x4] + adds r0, r4, 0 + movs r1, 0x3D + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x6] + adds r0, r4, 0 + movs r1, 0x3E + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x8] + adds r0, r4, 0 + movs r1, 0x3F + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0xA] + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + mov r3, sp + movs r1, 0x1 + ands r0, r1 + lsls r0, 6 + ldrb r2, [r3, 0x17] + movs r1, 0x41 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x17] + adds r0, r4, 0 + movs r1, 0x2E + bl pokemon_getattr + mov r3, sp + lsls r0, 7 + ldrb r2, [r3, 0x17] + movs r1, 0x7F + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x17] + adds r0, r4, 0 + movs r1, 0x1 + bl pokemon_getattr + str r0, [sp, 0x54] + adds r0, r4, 0 + movs r1, 0x2 + ldr r2, [sp, 0x8C] + bl pokemon_getattr + ldr r0, [sp, 0x84] + ldr r1, [sp, 0x8C] + bl CopyString_Limit10 + adds r0, r4, 0 + movs r1, 0x7 + ldr r2, [sp, 0x88] + bl pokemon_getattr + mov r2, sp + movs r6, 0 +_08065488: + adds r0, r7, r6 + adds r1, r2, r6 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + cmp r6, 0x57 + bls _08065488 + b _080658EA + .pool +_080654A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + b _08065822 + .pool +_080654B8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xC + b _08065822 + .pool +_080654C8: + movs r6, 0 + add r2, sp, 0x58 + mov r9, r2 + add r0, sp, 0x60 + mov r10, r0 + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x02024744 + adds r4, r1, r0 + mov r8, r9 +_080654DE: + adds r1, r6, 0 + adds r1, 0xD + adds r0, r4, 0 + bl pokemon_getattr + mov r1, r8 + strh r0, [r1] + adds r1, r6, 0 + adds r1, 0x11 + adds r0, r4, 0 + bl pokemon_getattr + mov r2, r10 + adds r1, r2, r6 + strb r0, [r1] + movs r0, 0x2 + add r8, r0 + adds r6, 0x1 + cmp r6, 0x3 + ble _080654DE + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + mov r1, r9 + strb r0, [r1, 0xC] + mov r2, r9 + movs r6, 0 +_0806551C: + adds r0, r7, r6 + adds r1, r2, r6 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + cmp r6, 0xF + bls _0806551C + b _080658EA + .pool +_08065530: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x9 + b _08065822 + .pool +_0806554C: + movs r6, 0 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r2, =0x02024744 + mov r8, r2 +_08065558: + adds r1, r6, 0 + adds r1, 0x11 + mov r2, r8 + adds r0, r4, r2 + bl pokemon_getattr + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + cmp r6, 0x3 + ble _08065558 + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + b _080658EA + .pool +_08065588: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x8 + b _080658E2 + .pool +_080655A4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x1 + b _080655BE + .pool +_080655B4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x19 +_080655BE: + bl pokemon_getattr + adds r1, r0, 0 + strb r1, [r7] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + lsrs r0, 8 + strb r0, [r7, 0x1] + movs r0, 0xFF + lsls r0, 16 + ands r0, r1 + lsrs r0, 16 + strb r0, [r7, 0x2] + movs r6, 0x3 + b _080658EA + .pool +_080655E4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x1A + b _080658E2 + .pool +_080655F4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x1B + b _080658E2 + .pool +_08065604: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x1C + b _080658E2 + .pool +_08065614: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x1D + b _080658E2 + .pool +_08065624: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x1E + b _080658E2 + .pool +_08065634: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x1F + b _080658E2 + .pool +_08065644: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x20 + b _080658E2 + .pool +_08065654: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x22 + b _080658E2 + .pool +_08065664: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x23 + b _080658E2 + .pool +_08065674: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x24 + b _080658E2 + .pool +_08065684: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x25 + b _080658E2 + .pool +_08065694: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x26 + b _080658E2 + .pool +_080656A4: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x27 + bl pokemon_getattr + strb r0, [r7] + adds r0, r4, 0 + movs r1, 0x28 + bl pokemon_getattr + strb r0, [r7, 0x1] + adds r0, r4, 0 + movs r1, 0x29 + bl pokemon_getattr + strb r0, [r7, 0x2] + adds r0, r4, 0 + movs r1, 0x2A + bl pokemon_getattr + strb r0, [r7, 0x3] + adds r0, r4, 0 + movs r1, 0x2B + bl pokemon_getattr + strb r0, [r7, 0x4] + adds r0, r4, 0 + movs r1, 0x2C + bl pokemon_getattr + strb r0, [r7, 0x5] + movs r6, 0x6 + b _080658EA + .pool +_080656F4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x27 + b _080658E2 + .pool +_08065704: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x28 + b _080658E2 + .pool +_08065714: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x29 + b _080658E2 + .pool +_08065724: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x2A + b _080658E2 + .pool +_08065734: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x2B + b _080658E2 + .pool +_08065744: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x2C + b _080658E2 + .pool +_08065754: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0 + b _0806577E + .pool +_08065764: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x9 + b _08065822 + .pool +_08065774: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x37 +_0806577E: + bl pokemon_getattr + adds r1, r0, 0 + strb r1, [r7] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + lsrs r0, 8 + strb r0, [r7, 0x1] + movs r0, 0xFF + lsls r0, 16 + ands r0, r1 + lsrs r0, 16 + strb r0, [r7, 0x2] + lsrs r0, r1, 24 + strb r0, [r7, 0x3] + movs r6, 0x4 + b _080658EA + .pool +_080657A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x38 + b _080658E2 + .pool +_080657B8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x39 + b _08065822 + .pool +_080657C8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3A + b _08065822 + .pool +_080657D8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3B + b _08065822 + .pool +_080657E8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3C + b _08065822 + .pool +_080657F8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3D + b _08065822 + .pool +_08065808: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3E + b _08065822 + .pool +_08065818: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3F +_08065822: + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + strb r0, [r7] + lsrs r0, 8 + strb r0, [r7, 0x1] + movs r6, 0x2 + b _080658EA + .pool +_08065838: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x16 + b _080658E2 + .pool +_08065848: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x17 + b _080658E2 + .pool +_08065858: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x18 + b _080658E2 + .pool +_08065868: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x21 + b _080658E2 + .pool +_08065878: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x2F + b _080658E2 + .pool +_08065888: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x30 + b _080658E2 + .pool +_08065898: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x32 + b _080658E2 + .pool +_080658A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x33 + b _080658E2 + .pool +_080658B8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x34 + b _080658E2 + .pool +_080658C8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x35 + b _080658E2 + .pool +_080658D8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x36 +_080658E2: + bl pokemon_getattr + strb r0, [r7] + movs r6, 0x1 +_080658EA: + adds r0, r6, 0 + add sp, 0x90 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end dp01_getattr_by_ch1_for_opponent_pokemon + + thumb_func_start sub_8065900 +sub_8065900: @ 8065900 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_8065900 + + thumb_func_start sub_806590C +sub_806590C: @ 806590C + push {r4,r5,lr} + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _0806593C + ldr r0, =0x0202406e + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + bl sub_8065964 + b _0806595A + .pool +_0806593C: + ldrb r4, [r1] + movs r5, 0 +_08065940: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0806594E + adds r0, r5, 0 + bl sub_8065964 +_0806594E: + lsrs r4, 1 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _08065940 +_0806595A: + bl sub_8065068 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_806590C + + thumb_func_start sub_8065964 +sub_8065964: @ 8065964 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x38 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r3, =0x02024064 + ldrb r0, [r3] + lsls r0, 9 + ldr r2, =0x02023067 + adds r4, r0, r2 + adds r7, r4, 0 + subs r1, r2, 0x2 + adds r0, r1 + ldrb r0, [r0] + adds r6, r3, 0 + adds r3, r2, 0 + cmp r0, 0x3B + bls _08065992 + bl _08066270 +_08065992: + lsls r0, 2 + ldr r1, =_080659A8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080659A8: + .4byte _08065A98 + .4byte _08065C30 + .4byte _08065C4C + .4byte _08065C68 + .4byte _08065CBC + .4byte _08065CBC + .4byte _08065CBC + .4byte _08065CBC + .4byte _08065CDC + .4byte _08065D44 + .4byte _08065D44 + .4byte _08065D44 + .4byte _08065D44 + .4byte _08066270 + .4byte _08066270 + .4byte _08066270 + .4byte _08066270 + .4byte _08065D6C + .4byte _08065D88 + .4byte _08065DA4 + .4byte _08065DC0 + .4byte _08065DDC + .4byte _08065DF8 + .4byte _08065E14 + .4byte _08065E30 + .4byte _08065E4C + .4byte _08065E68 + .4byte _08065E84 + .4byte _08065EA0 + .4byte _08065EBC + .4byte _08065ED8 + .4byte _08065EF4 + .4byte _08065F68 + .4byte _08065F84 + .4byte _08065FA0 + .4byte _08065FBC + .4byte _08065FD8 + .4byte _08065FF4 + .4byte _08066010 + .4byte _0806602C + .4byte _08066048 + .4byte _08066064 + .4byte _08066080 + .4byte _0806609C + .4byte _080660B8 + .4byte _080660D4 + .4byte _080660F0 + .4byte _0806610C + .4byte _08066128 + .4byte _08066144 + .4byte _08066160 + .4byte _0806617C + .4byte _08066198 + .4byte _080661B4 + .4byte _080661D0 + .4byte _080661EC + .4byte _08066208 + .4byte _08066224 + .4byte _08066240 + .4byte _0806625C +_08065A98: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + adds r2, r7, 0 + bl pokemon_setattr + adds r2, r7, 0 + adds r2, 0x2E + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_setattr + movs r0, 0 + mov r8, r0 + movs r0, 0x3B + adds r0, r7 + mov r10, r0 + adds r0, r7, 0 + adds r0, 0x2B + str r0, [sp, 0x20] + adds r0, 0x19 + str r0, [sp, 0x28] + adds r0, 0x4 + str r0, [sp, 0x2C] + adds r0, 0x4 + str r0, [sp, 0x30] + subs r0, 0x22 + str r0, [sp, 0x1C] + subs r0, 0x2 + str r0, [sp, 0x18] + adds r0, 0x4 + str r0, [sp, 0x24] + adds r0, r7, 0x2 + str r0, [sp, 0x4] + adds r0, r7, 0x4 + str r0, [sp, 0x8] + adds r0, r7, 0x6 + str r0, [sp, 0xC] + adds r0, 0x2 + str r0, [sp, 0x10] + adds r0, 0x2 + str r0, [sp, 0x14] + mov r9, r4 + adds r6, r7, 0 + adds r6, 0x24 + adds r4, r7, 0 + adds r4, 0xC +_08065AFE: + mov r1, r8 + adds r1, 0xD + mov r0, r9 + adds r2, r4, 0 + bl pokemon_setattr + mov r1, r8 + adds r1, 0x11 + mov r0, r9 + adds r2, r6, 0 + bl pokemon_setattr + adds r6, 0x1 + adds r4, 0x2 + movs r0, 0x1 + add r8, r0 + mov r0, r8 + cmp r0, 0x3 + ble _08065AFE + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x15 + mov r2, r10 + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x20 + ldr r2, [sp, 0x20] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x19 + ldr r2, [sp, 0x28] + bl pokemon_setattr + ldrb r0, [r7, 0x14] + lsls r0, 27 + lsrs r0, 27 + mov r1, sp + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x27 + mov r2, sp + bl pokemon_setattr + mov r1, sp + ldrh r0, [r7, 0x14] + lsls r0, 22 + lsrs r0, 27 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x28 + mov r2, sp + bl pokemon_setattr + mov r1, sp + ldrb r0, [r7, 0x15] + lsls r0, 25 + lsrs r0, 27 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x29 + mov r2, sp + bl pokemon_setattr + mov r1, sp + ldr r0, [r7, 0x14] + lsls r0, 12 + lsrs r0, 27 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x2A + mov r2, sp + bl pokemon_setattr + mov r1, sp + ldrh r0, [r7, 0x16] + lsls r0, 23 + lsrs r0, 27 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x2B + mov r2, sp + bl pokemon_setattr + mov r1, sp + ldrb r0, [r7, 0x17] + lsls r0, 26 + lsrs r0, 27 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x2C + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0 + ldr r2, [sp, 0x2C] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x37 + ldr r2, [sp, 0x30] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x38 + ldr r2, [sp, 0x1C] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x39 + ldr r2, [sp, 0x18] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3A + ldr r2, [sp, 0x24] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3B + ldr r2, [sp, 0x4] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3C + ldr r2, [sp, 0x8] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3D + ldr r2, [sp, 0xC] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3E + ldr r2, [sp, 0x10] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3F + ldr r2, [sp, 0x14] + bl pokemon_setattr + b _08066270 + .pool +_08065C30: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0xB + bl pokemon_setattr + b _08066270 + .pool +_08065C4C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0xC + bl pokemon_setattr + b _08066270 + .pool +_08065C68: + movs r0, 0 + mov r8, r0 + movs r0, 0xC + adds r0, r4 + mov r9, r0 + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x02024744 + adds r7, r1, r0 + adds r6, r4, 0 + adds r6, 0x8 +_08065C80: + mov r1, r8 + adds r1, 0xD + adds r0, r7, 0 + adds r2, r4, 0 + bl pokemon_setattr + mov r1, r8 + adds r1, 0x11 + adds r0, r7, 0 + adds r2, r6, 0 + bl pokemon_setattr + adds r6, 0x1 + adds r4, 0x2 + movs r0, 0x1 + add r8, r0 + mov r0, r8 + cmp r0, 0x3 + ble _08065C80 + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x15 + mov r2, r9 + bl pokemon_setattr + b _08066270 + .pool +_08065CBC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldr r3, =0x02023064 + ldrb r2, [r6] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x9 + b _08065D5A + .pool +_08065CDC: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + adds r0, r4, 0 + movs r1, 0x11 + str r3, [sp, 0x34] + bl pokemon_setattr + ldrb r2, [r6] + lsls r2, 9 + ldr r3, [sp, 0x34] + adds r0, r3, 0x1 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x12 + bl pokemon_setattr + ldrb r2, [r6] + lsls r2, 9 + ldr r3, [sp, 0x34] + adds r0, r3, 0x2 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x13 + bl pokemon_setattr + ldrb r2, [r6] + lsls r2, 9 + ldr r3, [sp, 0x34] + adds r0, r3, 0x3 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x14 + bl pokemon_setattr + ldrb r2, [r6] + lsls r2, 9 + ldr r3, [sp, 0x34] + adds r0, r3, 0x4 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x15 + bl pokemon_setattr + b _08066270 + .pool +_08065D44: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldr r3, =0x02023064 + ldrb r2, [r6] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x8 +_08065D5A: + adds r3, 0x3 + adds r2, r3 + bl pokemon_setattr + b _08066270 + .pool +_08065D6C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1 + bl pokemon_setattr + b _08066270 + .pool +_08065D88: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x19 + bl pokemon_setattr + b _08066270 + .pool +_08065DA4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1A + bl pokemon_setattr + b _08066270 + .pool +_08065DC0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1B + bl pokemon_setattr + b _08066270 + .pool +_08065DDC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1C + bl pokemon_setattr + b _08066270 + .pool +_08065DF8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1D + bl pokemon_setattr + b _08066270 + .pool +_08065E14: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1E + bl pokemon_setattr + b _08066270 + .pool +_08065E30: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1F + bl pokemon_setattr + b _08066270 + .pool +_08065E4C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x20 + bl pokemon_setattr + b _08066270 + .pool +_08065E68: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x22 + bl pokemon_setattr + b _08066270 + .pool +_08065E84: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x23 + bl pokemon_setattr + b _08066270 + .pool +_08065EA0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x24 + bl pokemon_setattr + b _08066270 + .pool +_08065EBC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x25 + bl pokemon_setattr + b _08066270 + .pool +_08065ED8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x26 + bl pokemon_setattr + b _08066270 + .pool +_08065EF4: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + adds r0, r4, 0 + movs r1, 0x27 + str r3, [sp, 0x34] + bl pokemon_setattr + ldrb r2, [r6] + lsls r2, 9 + ldr r3, [sp, 0x34] + adds r0, r3, 0x1 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x28 + bl pokemon_setattr + ldrb r2, [r6] + lsls r2, 9 + ldr r3, [sp, 0x34] + adds r0, r3, 0x2 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x29 + bl pokemon_setattr + ldrb r2, [r6] + lsls r2, 9 + ldr r3, [sp, 0x34] + adds r0, r3, 0x3 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x2A + bl pokemon_setattr + ldrb r2, [r6] + lsls r2, 9 + ldr r3, [sp, 0x34] + adds r0, r3, 0x4 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x2B + bl pokemon_setattr + ldrb r2, [r6] + lsls r2, 9 + ldr r3, [sp, 0x34] + adds r0, r3, 0x5 + adds r2, r0 + adds r0, r4, 0 + b _08066002 + .pool +_08065F68: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x27 + bl pokemon_setattr + b _08066270 + .pool +_08065F84: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x28 + bl pokemon_setattr + b _08066270 + .pool +_08065FA0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x29 + bl pokemon_setattr + b _08066270 + .pool +_08065FBC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x2A + bl pokemon_setattr + b _08066270 + .pool +_08065FD8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x2B + bl pokemon_setattr + b _08066270 + .pool +_08065FF4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 +_08066002: + movs r1, 0x2C + bl pokemon_setattr + b _08066270 + .pool +_08066010: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0 + bl pokemon_setattr + b _08066270 + .pool +_0806602C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x9 + bl pokemon_setattr + b _08066270 + .pool +_08066048: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x37 + bl pokemon_setattr + b _08066270 + .pool +_08066064: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x38 + bl pokemon_setattr + b _08066270 + .pool +_08066080: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x39 + bl pokemon_setattr + b _08066270 + .pool +_0806609C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3A + bl pokemon_setattr + b _08066270 + .pool +_080660B8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3B + bl pokemon_setattr + b _08066270 + .pool +_080660D4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3C + bl pokemon_setattr + b _08066270 + .pool +_080660F0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3D + bl pokemon_setattr + b _08066270 + .pool +_0806610C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3E + bl pokemon_setattr + b _08066270 + .pool +_08066128: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3F + bl pokemon_setattr + b _08066270 + .pool +_08066144: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x16 + bl pokemon_setattr + b _08066270 + .pool +_08066160: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x17 + bl pokemon_setattr + b _08066270 + .pool +_0806617C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x18 + bl pokemon_setattr + b _08066270 + .pool +_08066198: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x21 + bl pokemon_setattr + b _08066270 + .pool +_080661B4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x2F + bl pokemon_setattr + b _08066270 + .pool +_080661D0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x30 + bl pokemon_setattr + b _08066270 + .pool +_080661EC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x32 + bl pokemon_setattr + b _08066270 + .pool +_08066208: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x33 + bl pokemon_setattr + b _08066270 + .pool +_08066224: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x34 + bl pokemon_setattr + b _08066270 + .pool +_08066240: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x35 + bl pokemon_setattr + b _08066270 + .pool +_0806625C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x36 + bl pokemon_setattr +_08066270: + add sp, 0x38 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8065964 + + thumb_func_start sub_8066284 +sub_8066284: @ 8066284 + push {r4-r7,lr} + ldr r1, =0x0202406e + ldr r7, =0x02024064 + ldrb r2, [r7] + lsls r0, r2, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + adds r3, r1, 0 + muls r3, r0 + ldr r4, =0x02023064 + lsls r2, 9 + adds r0, r4, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + ldr r1, =0x02024744 + adds r0, r1 + adds r5, r3, r0 + movs r3, 0 + adds r0, r4, 0x2 + adds r2, r0 + ldrb r2, [r2] + cmp r3, r2 + bcs _080662DC + adds r6, r4, 0 + adds r2, r7, 0 + adds r4, r0, 0 +_080662BA: + adds r1, r5, r3 + ldrb r0, [r2] + lsls r0, 9 + adds r0, 0x3 + adds r0, r3, r0 + adds r0, r6 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + ldrb r0, [r2] + lsls r0, 9 + adds r0, r4 + ldrb r0, [r0] + cmp r3, r0 + bcc _080662BA +_080662DC: + bl sub_8065068 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8066284 + + thumb_func_start sub_80662F8 +sub_80662F8: @ 80662F8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r7, =0x0202406e + ldr r6, =0x02024064 + ldrb r0, [r6] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + movs r1, 0x64 + mov r10, r1 + mov r2, r10 + muls r2, r0 + adds r0, r2, 0 + ldr r1, =0x02024744 + mov r9, r1 + add r0, r9 + movs r1, 0xB + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldrb r1, [r6] + lsls r0, r1, 1 + adds r0, r7 + ldrh r0, [r0] + mov r2, r10 + muls r2, r0 + adds r0, r2, 0 + add r0, r9 + bl sub_805DC0C + ldrb r0, [r6] + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_806A068 + ldr r0, =0x0202499c + mov r8, r0 + ldrb r0, [r6] + movs r1, 0x2 + bl sub_80A5C6C + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldrb r0, [r6] + bl sub_80A6138 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r6] + bl sub_80A82E4 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + mov r0, r8 + adds r1, r5, 0 + adds r2, r4, 0 + bl AddObjectToFront + ldr r4, =0x020241e4 + ldrb r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r5, =0x02020630 + ldrb r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =0x0000ff10 + strh r1, [r0, 0x24] + ldrb r2, [r6] + adds r0, r2, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x2E] + ldrb r3, [r6] + adds r0, r3, r4 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + lsls r3, 4 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x5] + ldrb r2, [r6] + adds r4, r2, r4 + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =0x020244e4 + adds r2, r1 + ldrb r1, [r2] + bl StartObjectImageAnim + ldrb r4, [r6] + lsls r0, r4, 1 + adds r0, r7 + ldrh r0, [r0] + mov r1, r10 + muls r1, r0 + adds r0, r1, 0 + add r0, r9 + movs r1, 0xB + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_805EE54 + ldr r1, =0x03005d60 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8064B04 + str r1, [r0] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80662F8 + + thumb_func_start sub_8066448 +sub_8066448: @ 8066448 + push {r4,lr} + ldr r1, =0x0202406e + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r2, r0, 1 + adds r2, r1 + ldr r3, =0x02023064 + lsls r0, 9 + adds r1, r3, 0x1 + adds r0, r1 + ldrb r0, [r0] + strh r0, [r2] + ldrb r0, [r4] + lsls r1, r0, 9 + adds r3, 0x2 + adds r1, r3 + ldrb r1, [r1] + bl sub_8066494 + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8064F40 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8066448 + + thumb_func_start sub_8066494 +sub_8066494: @ 8066494 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + bl sub_805EF84 + ldr r0, =0x0202406e + lsls r4, r6, 1 + adds r4, r0 + ldr r0, =0x02023064 + lsls r1, r6, 9 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + strh r0, [r4] + ldrh r0, [r4] + movs r1, 0x64 + mov r9, r1 + mov r1, r9 + muls r1, r0 + adds r0, r1, 0 + ldr r5, =0x02024744 + adds r0, r5 + movs r1, 0xB + bl pokemon_getattr + mov r8, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, =sub_805D714 + bl object_new_hidden_with_callback + ldr r1, =0x03005d7c + mov r10, r1 + add r10, r6 + mov r1, r10 + strb r0, [r1] + ldrh r0, [r4] + mov r1, r9 + muls r1, r0 + adds r0, r1, 0 + adds r0, r5 + adds r1, r6, 0 + bl sub_805DC0C + adds r0, r6, 0 + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, r8 + bl sub_806A068 + ldr r0, =0x0202499c + mov r9, r0 + adds r0, r6, 0 + movs r1, 0x2 + bl sub_80A5C6C + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r6, 0 + bl sub_80A6138 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + bl sub_80A82E4 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + mov r0, r9 + adds r1, r5, 0 + adds r2, r4, 0 + bl AddObjectToFront + ldr r4, =0x020241e4 + adds r4, r6, r4 + strb r0, [r4] + ldr r5, =0x02020630 + mov r0, r10 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r1, [r4] + strh r1, [r0, 0x30] + mov r0, r10 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r6, [r0, 0x32] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r6, [r0, 0x2E] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + mov r1, r8 + strh r1, [r0, 0x32] + ldrb r0, [r4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + lsls r3, r6, 4 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x5] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =0x020244e4 + adds r6, r1 + ldrb r1, [r6] + bl StartObjectImageAnim + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r5, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =DummyObjectCallback + str r1, [r0] + movs r0, 0 + movs r1, 0xFE + bl sub_80753E8 + mov r1, r10 + ldrb r2, [r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r5 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0x2E] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8066494 + + thumb_func_start sub_8066624 +sub_8066624: @ 8066624 + push {r4-r6,lr} + ldr r1, =0x02023064 + ldr r6, =0x02024064 + ldrb r2, [r6] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r3, [r0] + cmp r3, 0 + bne _0806666C + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + strb r3, [r0, 0x4] + ldr r1, =0x03005d60 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_80666BC + str r1, [r0] + b _080666A8 + .pool +_0806666C: + ldr r5, =0x020241e4 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl obj_free_rotscale_entry + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldrb r0, [r6] + bl sub_805EEE0 + ldr r1, =0x03005d70 + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl sub_8065068 +_080666A8: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8066624 + + thumb_func_start sub_80666BC +sub_80666BC: @ 80666BC + push {r4-r6,lr} + ldr r6, =0x020244d0 + ldr r4, [r6] + ldr r5, =0x02024064 + ldrb r2, [r5] + ldr r1, [r4, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r3, r0, r1 + ldrb r0, [r3, 0x4] + cmp r0, 0 + beq _080666E4 + cmp r0, 0x1 + beq _08066712 + b _0806673A + .pool +_080666E4: + ldr r1, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080666FE + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_080666FE: + ldr r0, [r6] + ldrb r1, [r5] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x1 + strb r1, [r0, 0x4] + b _0806673A +_08066712: + ldrb r1, [r3] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0806673A + strb r0, [r3, 0x4] + ldrb r2, [r5] + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x2 + bl move_anim_start_t4 + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8064C58 + str r1, [r0] +_0806673A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80666BC + + thumb_func_start sub_8066748 +sub_8066748: @ 8066748 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r4, =0x02022fec + ldr r0, [r4] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08066840 + ldr r5, =0x02024064 + ldrb r0, [r5] + bl battle_get_per_side_status + movs r1, 0x2 + ands r1, r0 + movs r7, 0xC8 + cmp r1, 0 + beq _08066770 + movs r7, 0x98 +_08066770: + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 1 + ands r0, r1 + cmp r0, 0 + beq _080667A8 + ldrb r0, [r5] + cmp r0, 0x1 + bne _08066794 + ldr r0, =0x02038bca + b _08066796 + .pool +_08066794: + ldr r0, =0x02038bcc +_08066796: + ldrh r0, [r0] + bl sub_8162AA0 + lsls r0, 24 + lsrs r0, 24 + b _0806694C + .pool +_080667A8: + ldrb r0, [r5] + bl sub_806D864 + ldr r6, =0x020229e8 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + movs r4, 0xFF + ldrb r0, [r1] + cmp r0, 0x4 + beq _080667D8 + ldrb r0, [r5] + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + ldrh r1, [r1] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0x5 + bne _080667F4 +_080667D8: + ldrb r0, [r5] + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r0, [r1, 0x13] + cmp r0, 0 + bne _080668AA + b _080668BC + .pool +_080667F4: + ldrb r0, [r5] + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + ldrh r1, [r1] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0x2 + beq _08066822 + ldrb r0, [r5] + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + ldrh r0, [r1] + ands r4, r0 + cmp r4, 0x1 + bne _08066838 +_08066822: + ldrb r0, [r5] + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r0, [r1, 0x13] + cmp r0, 0 + bne _08066916 + b _08066924 +_08066838: + ldrb r0, [r5] + bl sub_806D864 + b _0806693A +_08066840: + movs r7, 0xB0 + ldr r0, =0x02038bca + ldrh r1, [r0] + movs r0, 0xC0 + lsls r0, 4 + cmp r1, r0 + bne _08066858 + bl sub_8068B48 + b _08066948 + .pool +_08066858: + bl link_get_multiplayer_id + ldr r6, =0x020229e8 + movs r5, 0x1 + eors r0, r5 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + movs r4, 0xFF + ldrb r0, [r1] + cmp r0, 0x4 + beq _08066892 + bl link_get_multiplayer_id + eors r0, r5 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + ldrh r1, [r1] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0x5 + bne _080668C8 +_08066892: + bl link_get_multiplayer_id + eors r0, r5 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r0, [r1, 0x13] + cmp r0, 0 + beq _080668BC +_080668AA: + ldr r0, =gTrainerPicIndices + adds r0, 0x4F + ldrb r0, [r0] + b _0806694C + .pool +_080668BC: + ldr r0, =gTrainerPicIndices + adds r0, 0x4E + ldrb r0, [r0] + b _0806694C + .pool +_080668C8: + bl link_get_multiplayer_id + eors r0, r5 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + ldrh r1, [r1] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0x2 + beq _080668FE + bl link_get_multiplayer_id + eors r0, r5 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + ldrh r0, [r1] + ands r4, r0 + cmp r4, 0x1 + bne _08066930 +_080668FE: + bl link_get_multiplayer_id + eors r0, r5 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r0, [r1, 0x13] + cmp r0, 0 + beq _08066924 +_08066916: + ldr r0, =gTrainerPicIndices + adds r0, 0x51 + ldrb r0, [r0] + b _0806694C + .pool +_08066924: + ldr r0, =gTrainerPicIndices + adds r0, 0x50 + ldrb r0, [r0] + b _0806694C + .pool +_08066930: + bl link_get_multiplayer_id + eors r0, r5 + lsls r0, 24 + lsrs r0, 24 +_0806693A: + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r0, [r1, 0x13] + bl sub_806F000 +_08066948: + lsls r0, 16 + lsrs r0, 16 +_0806694C: + mov r8, r0 + ldr r5, =0x02024064 + ldrb r1, [r5] + bl sub_805DF38 + ldrb r0, [r5] + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, r8 + bl template_build_for_pokemon_or_trainer + ldr r6, =0x0202499c + mov r9, r7 + ldr r1, =gUnknown_083054E0 + mov r2, r8 + lsls r0, r2, 2 + adds r0, r1 + ldrb r0, [r0] + movs r4, 0x8 + subs r4, r0 + lsls r4, 18 + movs r0, 0xA0 + lsls r0, 14 + adds r4, r0 + asrs r4, 16 + ldrb r0, [r5] + bl sub_80A82E4 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r6, 0 + mov r1, r9 + adds r2, r4, 0 + bl AddObjectToFront + ldr r6, =0x020241e4 + ldrb r1, [r5] + adds r1, r6 + strb r0, [r1] + ldr r4, =0x02020630 + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =0x0000ff10 + strh r1, [r0, 0x24] + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x2 + strh r1, [r0, 0x2E] + ldr r1, =gTrainerFrontPicPaletteTable + mov r2, r8 + lsls r0, r2, 3 + adds r0, r1 + ldrh r0, [r0, 0x4] + bl IndexOfObjectPaletteTag + ldrb r1, [r5] + adds r1, r6 + ldrb r1, [r1] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r4 + lsls r0, 4 + ldrb r3, [r2, 0x5] + movs r1, 0xF + ands r1, r3 + orrs r1, r0 + strb r1, [r2, 0x5] + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + mov r1, r8 + strh r1, [r0, 0x6] + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, 0x1C + adds r0, r4 + ldr r1, =sub_805D7AC + str r1, [r0] + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8064400 + str r1, [r0] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8066748 + + thumb_func_start sub_8066A58 +sub_8066A58: @ 8066A58 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, =0x02024064 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08066A74 + ldr r0, =0x02038bca + b _08066A76 + .pool +_08066A74: + ldr r0, =0x02038bcc +_08066A76: + ldrh r0, [r0] + bl sub_8162AA0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r6, =0x02024064 + ldrb r1, [r6] + bl sub_805DF38 + ldrb r0, [r6] + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, r8 + bl template_build_for_pokemon_or_trainer + ldr r0, =0x0202499c + ldr r2, =gUnknown_083054E0 + mov r3, r8 + lsls r1, r3, 2 + adds r1, r2 + ldrb r1, [r1] + movs r2, 0x8 + subs r2, r1 + lsls r2, 18 + movs r1, 0xA0 + lsls r1, 14 + adds r2, r1 + asrs r2, 16 + movs r1, 0xB0 + movs r3, 0x1E + bl AddObjectToFront + ldr r5, =0x020241e4 + ldrb r1, [r6] + adds r1, r5 + strb r0, [r1] + ldr r4, =0x02020630 + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x60 + strh r1, [r0, 0x24] + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x20] + adds r1, 0x20 + strh r1, [r0, 0x20] + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =0x0000fffe + strh r1, [r0, 0x2E] + ldr r1, =gTrainerFrontPicPaletteTable + mov r2, r8 + lsls r0, r2, 3 + adds r0, r1 + ldrh r0, [r0, 0x4] + bl IndexOfObjectPaletteTag + ldrb r1, [r6] + adds r1, r5 + ldrb r1, [r1] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r4 + lsls r0, 4 + ldrb r3, [r2, 0x5] + movs r1, 0xF + ands r1, r3 + orrs r1, r0 + strb r1, [r2, 0x5] + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + mov r3, r8 + strh r3, [r0, 0x6] + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, 0x1C + adds r0, r4 + ldr r1, =sub_805D7AC + str r1, [r0] + ldr r1, =0x03005d60 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8064438 + str r1, [r0] + bl sub_8065068 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8066A58 + + thumb_func_start sub_8066B94 +sub_8066B94: @ 8066B94 + push {r4-r6,lr} + ldr r6, =0x020241e4 + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, =0x02020630 + adds r0, r5 + bl oamt_add_pos2_onto_pos1 + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x23 + strh r1, [r0, 0x2E] + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x8C + lsls r1, 1 + strh r1, [r0, 0x32] + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrh r1, [r0, 0x22] + strh r1, [r0, 0x36] + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r5, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_80A6EEC + str r1, [r0] + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =DummyObjectCallback + bl oamt_set_x3A_32 + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8064470 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8066B94 + + thumb_func_start sub_8066C40 +sub_8066C40: @ 8066C40 + push {r4-r6,lr} + ldr r6, =0x020244d0 + ldr r4, [r6] + ldr r5, =0x02024064 + ldrb r2, [r5] + ldr r0, [r4, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r3, r1, r0 + ldrb r0, [r3, 0x4] + cmp r0, 0 + bne _08066C94 + ldr r1, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08066C74 + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_08066C74: + ldr r0, [r6] + ldrb r1, [r5] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x4] + adds r1, 0x1 + strb r1, [r0, 0x4] + b _08066CD0 + .pool +_08066C94: + ldrb r1, [r3] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08066CD0 + strb r0, [r3, 0x4] + movs r0, 0x10 + movs r1, 0x3F + bl audio_play_and_stuff + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldrb r0, [r5] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_8039934 + str r1, [r0] + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8064C14 + str r1, [r0] +_08066CD0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8066C40 + + thumb_func_start sub_8066CEC +sub_8066CEC: @ 8066CEC + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_8066CEC + + thumb_func_start sub_8066CF8 +sub_8066CF8: @ 8066CF8 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_8066CF8 + + thumb_func_start sub_8066D04 +sub_8066D04: @ 8066D04 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_8066D04 + + thumb_func_start sub_8066D10 +sub_8066D10: @ 8066D10 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_8066D10 + + thumb_func_start sub_8066D1C +sub_8066D1C: @ 8066D1C + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r5, =0x02024064 + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + beq _08066D32 + b _08066E58 +_08066D32: + ldr r0, =0x02023064 + mov r12, r0 + ldrb r1, [r5] + lsls r1, 9 + adds r0, 0x1 + adds r0, r1, r0 + ldrb r6, [r0] + mov r0, r12 + adds r0, 0x2 + adds r0, r1, r0 + ldrb r0, [r0] + lsls r0, 8 + orrs r6, r0 + ldr r0, =0x02038432 + mov r8, r0 + mov r0, r12 + adds r0, 0x3 + adds r1, r0 + ldrb r0, [r1] + mov r1, r8 + strb r0, [r1] + ldr r3, =0x02038408 + ldrb r1, [r5] + lsls r1, 9 + mov r0, r12 + adds r0, 0x4 + adds r0, r1, r0 + ldrb r2, [r0] + mov r0, r12 + adds r0, 0x5 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 8 + orrs r2, r0 + strh r2, [r3] + ldr r3, =0x02038404 + ldrb r1, [r5] + lsls r1, 9 + mov r0, r12 + adds r0, 0x6 + adds r0, r1, r0 + ldrb r2, [r0] + mov r0, r12 + adds r0, 0x7 + adds r0, r1, r0 + ldrb r0, [r0] + lsls r0, 8 + orrs r2, r0 + mov r0, r12 + adds r0, 0x8 + adds r0, r1, r0 + ldrb r0, [r0] + lsls r0, 16 + orrs r2, r0 + mov r0, r12 + adds r0, 0x9 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 24 + orrs r2, r0 + str r2, [r3] + ldr r2, =0x0203841a + ldrb r0, [r5] + lsls r0, 9 + mov r1, r12 + adds r1, 0xA + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r4, =0x0203841c + ldrb r1, [r5] + lsls r1, 9 + mov r0, r12 + adds r0, 0xC + adds r0, r1, r0 + ldrb r2, [r0] + mov r0, r12 + adds r0, 0xD + adds r1, r0 + ldrb r0, [r1] + lsls r0, 8 + orrs r2, r0 + strh r2, [r4] + ldr r7, =0x02038400 + ldrb r1, [r5] + lsls r1, 9 + mov r0, r12 + adds r0, 0x10 + adds r1, r0 + str r1, [r7] + ldr r2, =0x020244bc + ldrb r0, [r5] + lsls r0, 2 + adds r0, r2 + ldr r1, [r1] + str r1, [r0] + mov r0, r8 + ldrb r1, [r0] + adds r0, r6, 0 + bl sub_805DB8C + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + beq _08066E30 + bl sub_8065068 + b _08066E58 + .pool +_08066E30: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldrb r1, [r5] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strb r3, [r0, 0x4] + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8066E70 + str r1, [r0] + ldrh r1, [r4] + ldr r2, [r7] + adds r0, r6, 0 + bl sub_817E0FC +_08066E58: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8066D1C + + thumb_func_start sub_8066E70 +sub_8066E70: @ 8066E70 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r2, =0x02023064 + ldr r6, =0x02024064 + ldrb r3, [r6] + lsls r1, r3, 9 + adds r0, r2, 0x1 + mov r10, r0 + adds r0, r1, r0 + ldrb r4, [r0] + adds r5, r2, 0x2 + mov r9, r5 + adds r0, r1, r5 + ldrb r0, [r0] + lsls r0, 8 + orrs r4, r0 + adds r2, 0xB + adds r1, r2 + ldrb r1, [r1] + mov r8, r1 + ldr r7, =0x020244d0 + ldr r5, [r7] + ldr r1, [r5, 0x4] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x4] + cmp r2, 0x1 + beq _08066F08 + cmp r2, 0x1 + bgt _08066EC8 + cmp r2, 0 + beq _08066ED2 + b _08066FE4 + .pool +_08066EC8: + cmp r2, 0x2 + beq _08066F32 + cmp r2, 0x3 + beq _08066FA8 + b _08066FE4 +_08066ED2: + ldr r1, [r5] + lsls r0, r3, 2 + adds r1, r0, r1 + ldrb r2, [r1] + movs r0, 0xC + ands r0, r2 + cmp r0, 0x4 + bne _08066EF4 + movs r0, 0x8 + orrs r0, r2 + strb r0, [r1] + ldrb r2, [r6] + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_08066EF4: + ldr r0, [r7] + ldrb r1, [r6] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x1 + strb r1, [r0, 0x4] + b _08066FE4 +_08066F08: + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08066FE4 + movs r0, 0 + bl sub_805EB9C + adds r0, r4, 0 + bl move_anim_start_t1 + ldr r0, [r7] + ldrb r1, [r6] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x2 + strb r1, [r0, 0x4] + b _08066FE4 +_08066F32: + ldr r0, =0x020383f8 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, =0x020383fd + ldrb r0, [r0] + cmp r0, 0 + bne _08066FE4 + movs r0, 0x1 + bl sub_805EB9C + ldr r0, [r7] + ldrb r2, [r6] + ldr r1, [r0] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08066F80 + mov r0, r8 + cmp r0, 0x1 + bhi _08066F80 + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x6 + bl move_anim_start_t4 + ldr r0, [r7] + ldrb r1, [r6] + ldr r0, [r0] + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] +_08066F80: + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x3 + strb r1, [r0, 0x4] + b _08066FE4 + .pool +_08066FA8: + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _08066FE4 + bl sub_805E394 + ldrb r0, [r6] + lsls r2, r0, 9 + mov r3, r10 + adds r1, r2, r3 + ldrb r1, [r1] + add r2, r9 + ldrb r2, [r2] + lsls r2, 8 + orrs r1, r2 + bl sub_805E94C + ldr r0, [r7] + ldrb r1, [r6] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strb r4, [r0, 0x4] + bl sub_8065068 +_08066FE4: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8066E70 + + thumb_func_start sub_8066FF4 +sub_8066FF4: @ 8066FF4 + push {r4,r5,lr} + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r5, =0x02024064 + ldrb r4, [r5] + lsls r4, 9 + ldr r0, =0x02023066 + adds r4, r0 + ldrh r0, [r4] + bl battle_pick_message + ldr r0, =0x02022e2c + movs r1, 0 + bl battle_show_message_maybe + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8064CCC + str r1, [r0] + ldrh r0, [r4] + bl sub_817C95C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8066FF4 + + thumb_func_start sub_806704C +sub_806704C: @ 806704C + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_806704C + + thumb_func_start sub_8067058 +sub_8067058: @ 8067058 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_8067058 + + thumb_func_start sub_8067064 +sub_8067064: @ 8067064 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_8067064 + + thumb_func_start sub_8067070 +sub_8067070: @ 8067070 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_8067070 + + thumb_func_start sub_806707C +sub_806707C: @ 806707C + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_806707C + + thumb_func_start sub_8067088 +sub_8067088: @ 8067088 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_8067088 + + thumb_func_start sub_8067094 +sub_8067094: @ 8067094 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_8067094 + + thumb_func_start sub_80670A0 +sub_80670A0: @ 80670A0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + movs r0, 0 + bl load_gfxc_health_bar + ldr r3, =0x02023064 + ldr r0, =0x02024064 + mov r9, r0 + ldrb r4, [r0] + lsls r2, r4, 9 + adds r0, r3, 0x2 + adds r0, r2, r0 + ldrb r1, [r0] + adds r3, 0x3 + adds r2, r3 + ldrb r0, [r2] + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + asrs r7, r1, 16 + ldr r0, =0x00007fff + cmp r7, r0 + beq _08067130 + ldr r6, =0x0202406e + lsls r0, r4, 1 + adds r0, r6 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r4, =0x02024744 + adds r0, r4 + movs r1, 0x3A + bl pokemon_getattr + mov r8, r0 + mov r1, r9 + ldrb r0, [r1] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + muls r0, r5 + adds r0, r4 + movs r1, 0x39 + bl pokemon_getattr + adds r3, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r1, =0x03005d70 + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + mov r2, r8 + bl sub_807294C + b _0806715A + .pool +_08067130: + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3A + bl pokemon_getattr + adds r2, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r1, =0x03005d70 + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + movs r3, 0 + bl sub_807294C +_0806715A: + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8064BC0 + str r1, [r0] + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80670A0 + + thumb_func_start sub_8067190 +sub_8067190: @ 8067190 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_8067190 + + thumb_func_start sub_806719C +sub_806719C: @ 806719C + push {r4,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _080671F0 + ldr r0, =0x03005d70 + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x02024744 + adds r1, r2 + movs r2, 0x9 + bl healthbar_draw_field_maybe + ldrb r2, [r4] + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8065008 + str r1, [r0] +_080671F0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806719C + + thumb_func_start sub_8067214 +sub_8067214: @ 8067214 + push {r4,r5,lr} + ldr r5, =0x02024064 + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _08067264 + ldr r4, =0x02023064 + ldrb r3, [r5] + lsls r3, 9 + adds r0, r4, 0x1 + adds r0, r3, r0 + ldrb r0, [r0] + adds r1, r4, 0x2 + adds r1, r3, r1 + ldrb r1, [r1] + adds r2, r4, 0x3 + adds r2, r3, r2 + ldrb r2, [r2] + lsls r2, 8 + orrs r1, r2 + adds r2, r4, 0x4 + adds r2, r3, r2 + ldrb r2, [r2] + lsls r2, 16 + orrs r1, r2 + adds r4, 0x5 + adds r3, r4 + ldrb r2, [r3] + lsls r2, 24 + orrs r1, r2 + bl move_anim_start_t2_for_situation + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8065008 + str r1, [r0] +_08067264: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8067214 + + thumb_func_start sub_806727C +sub_806727C: @ 806727C + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_806727C + + thumb_func_start sub_8067288 +sub_8067288: @ 8067288 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_8067288 + + thumb_func_start sub_8067294 +sub_8067294: @ 8067294 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_8067294 + + thumb_func_start sub_80672A0 +sub_80672A0: @ 80672A0 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_80672A0 + + thumb_func_start sub_80672AC +sub_80672AC: @ 80672AC + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_80672AC + + thumb_func_start sub_80672B8 +sub_80672B8: @ 80672B8 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_80672B8 + + thumb_func_start sub_80672C4 +sub_80672C4: @ 80672C4 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_80672C4 + + thumb_func_start sub_80672D0 +sub_80672D0: @ 80672D0 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_80672D0 + + thumb_func_start sub_80672DC +sub_80672DC: @ 80672DC + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_80672DC + + thumb_func_start sub_80672E8 +sub_80672E8: @ 80672E8 + push {lr} + ldr r2, =0x02022d0c + ldrb r1, [r2] + movs r0, 0x80 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + bl sub_8065068 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80672E8 + + thumb_func_start sub_8067304 +sub_8067304: @ 8067304 + push {lr} + ldr r3, =0x02022d0c + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0x7F + ands r1, r0 + ldrb r2, [r3] + movs r0, 0x80 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + bl sub_8065068 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8067304 + + thumb_func_start sub_806733C +sub_806733C: @ 806733C + push {lr} + ldr r2, =0x02022d0c + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + bl sub_8065068 + pop {r0} + bx r0 + .pool + thumb_func_end sub_806733C + + thumb_func_start sub_8067354 +sub_8067354: @ 8067354 + push {lr} + ldr r3, =0x02022d0c + ldr r1, [r3] + lsls r1, 24 + lsrs r1, 31 + movs r0, 0x1 + eors r1, r0 + lsls r1, 7 + ldrb r2, [r3] + movs r0, 0x7F + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + bl sub_8065068 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8067354 + + thumb_func_start sub_806737C +sub_806737C: @ 806737C + push {r4,lr} + ldr r3, =0x02020630 + ldr r2, =0x020241e4 + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _080673B0 + bl sub_8065068 + b _080673DA + .pool +_080673B0: + ldr r1, =0x020244b9 + movs r0, 0x1 + strb r0, [r1] + ldrb r0, [r4] + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0 + strh r1, [r0, 0x30] + ldrb r0, [r4] + bl sub_80769F4 + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8064CE4 + str r1, [r0] +_080673DA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806737C + + thumb_func_start sub_80673EC +sub_80673EC: @ 80673EC + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_80673EC + + thumb_func_start sub_80673F8 +sub_80673F8: @ 80673F8 + push {r4,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + movs r3, 0x3F + cmp r0, 0 + bne _0806740C + movs r3, 0xC0 +_0806740C: + ldr r2, =0x02023064 + ldrb r1, [r4] + lsls r1, 9 + adds r0, r2, 0x1 + adds r0, r1, r0 + ldrb r0, [r0] + adds r2, 0x2 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 8 + orrs r0, r1 + lsls r1, r3, 24 + asrs r1, 24 + bl audio_play_and_stuff + bl sub_8065068 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80673F8 + + thumb_func_start sub_806743C +sub_806743C: @ 806743C + push {r4,r5,lr} + ldr r4, =0x02023064 + ldr r5, =0x02024064 + ldrb r0, [r5] + lsls r3, r0, 9 + adds r0, r4, 0x3 + adds r0, r3, r0 + ldrb r0, [r0] + cmp r0, 0 + beq _08067478 + bl sub_805EA60 + ldrb r1, [r5] + lsls r1, 9 + adds r0, r4, 0x1 + adds r0, r1, r0 + ldrb r0, [r0] + adds r2, r4, 0x2 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 8 + orrs r0, r1 + bl song_play_for_text + b _0806748C + .pool +_08067478: + adds r0, r4, 0x1 + adds r0, r3, r0 + ldrb r0, [r0] + adds r1, r4, 0x2 + adds r1, r3, r1 + ldrb r1, [r1] + lsls r1, 8 + orrs r0, r1 + bl fanfare_play +_0806748C: + bl sub_8065068 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_806743C + + thumb_func_start sub_8067498 +sub_8067498: @ 8067498 + push {lr} + ldr r1, =0x0202406e + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x19 + movs r2, 0x5 + bl sub_80A32E4 + bl sub_8065068 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8067498 + + thumb_func_start sub_80674D4 +sub_80674D4: @ 80674D4 + push {lr} + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + bl battle_intro_launch + ldr r2, =0x020243fc + ldrh r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] + bl sub_8065068 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80674D4 + + thumb_func_start sub_8067508 +sub_8067508: @ 8067508 + push {r4-r6,lr} + ldr r5, =0x020241e4 + ldr r6, =0x02024064 + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl oamt_add_pos2_onto_pos1 + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x23 + strh r1, [r0, 0x2E] + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x8C + lsls r1, 1 + strh r1, [r0, 0x32] + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x22] + strh r1, [r0, 0x36] + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_80A6EEC + str r1, [r0] + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_80676FC + bl oamt_set_x3A_32 + ldr r0, =c3_08038DC4 + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + ldrb r0, [r6] + strh r0, [r1, 0x8] + ldr r3, =0x020244d0 + ldr r0, [r3] + ldrb r2, [r6] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080675CA + ldr r0, =0x020244b4 + adds r0, r2, r0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + ldr r1, =sub_8073C30 + str r1, [r0] +_080675CA: + ldr r0, [r3] + ldr r2, [r0, 0x8] + ldrb r0, [r2, 0x9] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x9] + ldr r1, =0x03005d60 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =nullsub_28 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8067508 + + thumb_func_start c3_08038DC4 +c3_08038DC4: @ 8067618 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r7, =0x02024064 + ldrb r0, [r7] + mov r9, r0 + ldr r1, =0x03005e00 + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x8] + strb r0, [r7] + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08067652 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08067684 +_08067652: + ldr r0, =0x02023064 + ldrb r1, [r7] + lsls r2, r1, 9 + adds r0, 0x1 + adds r2, r0 + ldr r0, =0x0202406e + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + strb r0, [r2] + ldrb r0, [r7] + movs r1, 0 + bl sub_8066494 + b _080676C4 + .pool +_08067684: + ldr r4, =0x02023064 + ldrb r0, [r7] + lsls r1, r0, 9 + adds r4, 0x1 + adds r1, r4 + ldr r6, =0x0202406e + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + strb r0, [r1] + ldrb r0, [r7] + movs r1, 0 + bl sub_8066494 + ldrb r0, [r7] + movs r5, 0x2 + eors r0, r5 + strb r0, [r7] + ldrb r0, [r7] + lsls r1, r0, 9 + adds r1, r4 + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + strb r0, [r1] + ldrb r0, [r7] + movs r1, 0 + bl sub_8066494 + ldrb r0, [r7] + eors r0, r5 + strb r0, [r7] +_080676C4: + ldr r1, =0x03005d60 + ldr r2, =0x02024064 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8064734 + str r1, [r0] + mov r0, r9 + strb r0, [r2] + mov r0, r8 + bl remove_task + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end c3_08038DC4 + + thumb_func_start sub_80676FC +sub_80676FC: @ 80676FC + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x6] + bl sub_805DFE4 + adds r0, r4, 0 + bl obj_free_rotscale_entry + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80676FC + + thumb_func_start sub_8067718 +sub_8067718: @ 8067718 + push {r4-r7,lr} + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08067748 + adds r0, r2, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08067748 + bl sub_8065068 + b _08067812 + .pool +_08067748: + ldr r4, =0x020244d0 + ldr r0, [r4] + ldr r3, =0x02024064 + ldrb r1, [r3] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] + ldr r1, =0x02023064 + ldrb r2, [r3] + lsls r0, r2, 9 + adds r1, 0x2 + adds r0, r1 + ldrb r0, [r0] + adds r7, r3, 0 + cmp r0, 0 + beq _080677B4 + ldr r0, [r4] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r3, r0, r1 + ldrb r2, [r3, 0x1] + lsls r1, r2, 27 + lsrs r0, r1, 28 + cmp r0, 0x1 + bhi _080677AC + adds r0, 0x1 + movs r1, 0xF + ands r0, r1 + lsls r0, 1 + movs r1, 0x1F + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x1] + b _08067812 + .pool +_080677AC: + movs r0, 0x1F + negs r0, r0 + ands r0, r2 + strb r0, [r3, 0x1] +_080677B4: + adds r5, r7, 0 + ldrb r0, [r5] + lsls r3, r0, 9 + ldr r4, =0x02023068 + adds r1, r3, r4 + subs r2, r4, 0x3 + adds r2, r3, r2 + ldrb r2, [r2] + subs r4, 0x2 + adds r3, r4 + ldrb r3, [r3] + bl sub_80735DC + ldr r2, =0x020244b4 + ldrb r1, [r5] + adds r1, r2 + movs r3, 0 + strb r0, [r1] + ldr r6, =0x020244d0 + ldr r0, [r6] + ldrb r1, [r5] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strb r3, [r0, 0x5] + ldrb r2, [r5] + lsls r0, r2, 9 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _08067806 + ldr r0, [r6] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + movs r1, 0x5D + strb r1, [r0, 0x5] +_08067806: + ldr r0, =0x03005d60 + ldrb r1, [r7] + lsls r1, 2 + adds r1, r0 + ldr r0, =sub_806782C + str r0, [r1] +_08067812: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8067718 + + thumb_func_start sub_806782C +sub_806782C: @ 806782C + push {r4,lr} + ldr r4, =0x020244d0 + ldr r0, [r4] + ldr r3, =0x02024064 + ldrb r1, [r3] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x5] + adds r2, r1, 0x1 + strb r2, [r0, 0x5] + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x5C + bls _08067864 + ldr r0, [r4] + ldrb r1, [r3] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strb r1, [r0, 0x5] + bl sub_8065068 +_08067864: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806782C + + thumb_func_start sub_8067874 +sub_8067874: @ 8067874 + push {lr} + ldr r0, =0x020244d0 + ldr r1, [r0] + ldr r0, =0x02024064 + ldrb r3, [r0] + ldr r1, [r1, 0x4] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080678A6 + ldr r2, =0x03005e00 + ldr r0, =0x020244b4 + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, =sub_8073C30 + str r1, [r0] +_080678A6: + bl sub_8065068 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8067874 + + thumb_func_start sub_80678C4 +sub_80678C4: @ 80678C4 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_80678C4 + + thumb_func_start sub_80678D0 +sub_80678D0: @ 80678D0 + push {r4,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + bl sub_80A6A90 + lsls r0, 24 + cmp r0, 0 + beq _08067916 + ldr r3, =0x02020630 + ldr r0, =0x020241e4 + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + ldr r0, =0x02023064 + lsls r1, 9 + adds r0, 0x1 + adds r1, r0 + adds r2, 0x3E + movs r0, 0x1 + ldrb r1, [r1] + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldrb r0, [r4] + bl sub_805E408 +_08067916: + bl sub_8065068 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80678D0 + + thumb_func_start sub_8067930 +sub_8067930: @ 8067930 + push {r4-r6,lr} + sub sp, 0x4 + ldr r5, =0x02024064 + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _08067992 + ldr r4, =0x02023064 + ldrb r2, [r5] + lsls r1, r2, 9 + adds r0, r4, 0x1 + adds r0, r1, r0 + ldrb r6, [r0] + adds r0, r4, 0x2 + adds r0, r1, r0 + ldrb r3, [r0] + adds r4, 0x3 + adds r1, r4 + ldrb r0, [r1] + lsls r0, 8 + orrs r3, r0 + str r3, [sp] + adds r0, r2, 0 + adds r1, r2, 0 + adds r3, r6, 0 + bl move_anim_start_t3 + lsls r0, 24 + cmp r0, 0 + beq _08067980 + bl sub_8065068 + b _0806798C + .pool +_08067980: + ldr r0, =0x03005d60 + ldrb r1, [r5] + lsls r1, 2 + adds r1, r0 + ldr r0, =sub_8065038 + str r0, [r1] +_0806798C: + adds r0, r6, 0 + bl sub_817E32C +_08067992: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8067930 + + thumb_func_start sub_80679A4 +sub_80679A4: @ 80679A4 + push {lr} + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 9 + ldr r1, =0x02023066 + adds r0, r1 + bl sub_81851A8 + bl sub_8065068 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80679A4 + + thumb_func_start sub_80679C4 +sub_80679C4: @ 80679C4 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_80679C4 + + thumb_func_start sub_80679D0 +sub_80679D0: @ 80679D0 + push {r4,r5,lr} + ldr r5, =0x02024064 + ldrb r0, [r5] + lsls r0, 9 + ldr r4, =0x02023068 + adds r0, r4 + bl sub_81851A8 + ldrb r0, [r5] + lsls r0, 9 + subs r4, 0x3 + adds r0, r4 + ldrb r2, [r0] + cmp r2, 0x3 + bne _08067A00 + ldr r0, =0x0202433a + strb r2, [r0] + b _08067A08 + .pool +_08067A00: + ldr r0, =0x0202433a + movs r1, 0x3 + eors r1, r2 + strb r1, [r0] +_08067A08: + ldr r0, =0x03005d90 + ldr r3, [r0] + ldr r1, =0x02023064 + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r0, 9 + adds r1, 0x2 + adds r0, r1 + ldrb r0, [r0] + ldr r1, =0x00000ca9 + adds r3, r1 + movs r1, 0x1 + ands r1, r0 + lsls r1, 3 + ldrb r2, [r3] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + movs r0, 0x5 + bl sub_80A2F50 + movs r0, 0x3 + bl sub_80A2390 + bl sub_8065068 + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_80587B0 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80679D0 + + thumb_func_start nullsub_92 +nullsub_92: @ 8067A70 + bx lr + thumb_func_end nullsub_92 + + thumb_func_start zero_pokemon_boxed_data +@ void zero_pokemon_boxed_data(pokemon *mon) +zero_pokemon_boxed_data: @ 8067A74 + push {lr} + adds r2, r0, 0 + movs r1, 0 + movs r3, 0 +_08067A7C: + adds r0, r2, r1 + strb r3, [r0] + adds r1, 0x1 + cmp r1, 0x4F + bls _08067A7C + pop {r0} + bx r0 + thumb_func_end zero_pokemon_boxed_data + + thumb_func_start zero_pokemon_struct +@ void zero_pokemon_struct(pokemon *mon) +zero_pokemon_struct: @ 8067A8C + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + bl zero_pokemon_boxed_data + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r1, 0x37 + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x38 + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x39 + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3A + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3B + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3C + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3D + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3E + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3F + mov r2, sp + bl pokemon_setattr + movs r0, 0xFF + str r0, [sp] + adds r0, r4, 0 + movs r1, 0x40 + mov r2, sp + bl pokemon_setattr + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end zero_pokemon_struct + + thumb_func_start zero_player_party_data +@ void zero_player_party_data() +zero_player_party_data: @ 8067B0C + push {r4,r5,lr} + ldr r4, =0x020244ec + movs r0, 0xFA + lsls r0, 1 + adds r5, r4, r0 +_08067B16: + adds r0, r4, 0 + bl zero_pokemon_struct + adds r4, 0x64 + cmp r4, r5 + ble _08067B16 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end zero_player_party_data + + thumb_func_start zero_enemy_party_data +zero_enemy_party_data: @ 8067B2C + push {r4,r5,lr} + ldr r4, =0x02024744 + movs r0, 0xFA + lsls r0, 1 + adds r5, r4, r0 +_08067B36: + adds r0, r4, 0 + bl zero_pokemon_struct + adds r4, 0x64 + cmp r4, r5 + ble _08067B36 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end zero_enemy_party_data + + thumb_func_start create_pokemon_set_level +@ void create_pokemon_set_level(pokemon *mon, s16 species_num, u8 level, u8 forced_iv, char pokemon_id_is_nonrandom, int pokemon_id, u8 trainer_id_mode, int trainer_id) +create_pokemon_set_level: @ 8067B4C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x1C + mov r8, r0 + adds r6, r1, 0 + ldr r4, [sp, 0x34] + ldr r7, [sp, 0x38] + ldr r5, [sp, 0x3C] + lsls r6, 16 + lsrs r6, 16 + add r0, sp, 0x10 + strb r2, [r0] + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + mov r0, r8 + str r3, [sp, 0x18] + bl zero_pokemon_struct + str r4, [sp] + str r7, [sp, 0x4] + str r5, [sp, 0x8] + ldr r0, [sp, 0x40] + str r0, [sp, 0xC] + mov r0, r8 + adds r1, r6, 0 + add r2, sp, 0x10 + ldrb r2, [r2] + ldr r3, [sp, 0x18] + bl create_pokemon + mov r0, r8 + movs r1, 0x38 + add r2, sp, 0x10 + bl pokemon_setattr + movs r0, 0xFF + str r0, [sp, 0x14] + add r2, sp, 0x14 + mov r0, r8 + movs r1, 0x40 + bl pokemon_setattr + mov r0, r8 + bl pokemon_calc_effective_stats + add sp, 0x1C + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end create_pokemon_set_level + + thumb_func_start create_pokemon +@ void create_pokemon(pokemon *mon, s16 species_num, u8 level, u8 forced_iv, char pokemon_id_is_nonrandom, int pokemon_id, u8 trainer_id_mode, int trainer_id) +create_pokemon: @ 8067BBC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + adds r7, r0, 0 + ldr r4, [sp, 0x40] + ldr r0, [sp, 0x48] + movs r5, 0xE + add r5, sp + strh r1, [r5] + add r6, sp, 0x10 + strb r2, [r6] + mov r5, sp + adds r5, 0x11 + strb r3, [r5] + lsls r4, 24 + lsrs r4, 24 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + adds r0, r7, 0 + bl zero_pokemon_boxed_data + cmp r4, 0 + beq _08067BF8 + ldr r0, [sp, 0x44] + str r0, [sp, 0x14] + b _08067C0C +_08067BF8: + bl GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsrs r4, 16 + lsls r0, 16 + orrs r4, r0 + str r4, [sp, 0x14] +_08067C0C: + add r2, sp, 0x14 + adds r0, r7, 0 + movs r1, 0 + bl pokemon_setattr_encrypted + add r0, sp, 0x18 + mov r9, r0 + add r5, sp, 0xC + mov r1, r10 + cmp r1, 0x2 + bne _08067C64 + ldr r2, =0xffff0000 + mov r8, r2 + ldr r6, =0x0000ffff +_08067C28: + bl GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsrs r4, 16 + lsls r0, 16 + orrs r4, r0 + str r4, [sp, 0x18] + adds r1, r4, 0 + mov r3, r8 + ands r1, r3 + lsrs r1, 16 + ands r4, r6 + eors r1, r4 + ldr r2, [sp, 0x14] + adds r0, r2, 0 + ands r0, r3 + lsrs r0, 16 + eors r1, r0 + ands r2, r6 + eors r1, r2 + cmp r1, 0x7 + bls _08067C28 + b _08067C8A + .pool +_08067C64: + mov r0, r10 + cmp r0, 0x1 + bne _08067C70 + ldr r0, [sp, 0x4C] + str r0, [sp, 0x18] + b _08067C8A +_08067C70: + ldr r0, =0x03005d90 + ldr r2, [r0] + ldrb r1, [r2, 0xA] + ldrb r0, [r2, 0xB] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0xC] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0xD] + lsls r0, 24 + orrs r1, r0 + str r1, [sp, 0x18] +_08067C8A: + adds r0, r7, 0 + movs r1, 0x1 + mov r2, r9 + bl pokemon_setattr_encrypted + adds r0, r7, 0 + bl pokemon_calc_checksum + strh r0, [r5] + adds r0, r7, 0 + movs r1, 0x9 + adds r2, r5, 0 + bl pokemon_setattr_encrypted + adds r0, r7, 0 + bl pokemon_encrypt + mov r0, sp + ldrh r1, [r0, 0xE] + bl GetSpeciesName + adds r0, r7, 0 + movs r1, 0x2 + mov r2, sp + bl pokemon_setattr_encrypted + ldr r2, =gUnknown_82E9531 + adds r0, r7, 0 + movs r1, 0x3 + bl pokemon_setattr_encrypted + ldr r5, =0x03005d90 + ldr r2, [r5] + adds r0, r7, 0 + movs r1, 0x7 + bl pokemon_setattr_encrypted + adds r0, r7, 0 + movs r1, 0xB + mov r2, sp + adds r2, 0xE + bl pokemon_setattr_encrypted + ldr r4, =gBaseStats + mov r2, sp + ldrh r1, [r2, 0xE] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0, 0x13] + movs r0, 0xCA + lsls r0, 1 + adds r2, r1, 0 + muls r2, r0 + mov r3, sp + ldrb r0, [r3, 0x10] + lsls r0, 2 + ldr r1, =gExperienceTables + adds r0, r1 + adds r2, r0 + adds r0, r7, 0 + movs r1, 0x19 + bl pokemon_setattr_encrypted + mov r1, sp + ldrh r0, [r1, 0xE] + lsls r2, r0, 3 + subs r2, r0 + lsls r2, 2 + adds r4, 0x12 + adds r2, r4 + adds r0, r7, 0 + movs r1, 0x20 + bl pokemon_setattr_encrypted + bl sav1_map_get_name + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x18] + adds r0, r7, 0 + movs r1, 0x23 + mov r2, r9 + bl pokemon_setattr_encrypted + adds r0, r7, 0 + movs r1, 0x24 + add r2, sp, 0x10 + bl pokemon_setattr_encrypted + ldr r2, =gUnknown_82E9530 + adds r0, r7, 0 + movs r1, 0x25 + bl pokemon_setattr_encrypted + movs r0, 0x4 + str r0, [sp, 0x18] + adds r0, r7, 0 + movs r1, 0x26 + mov r2, r9 + bl pokemon_setattr_encrypted + ldr r2, [r5] + adds r2, 0x8 + adds r0, r7, 0 + movs r1, 0x31 + bl pokemon_setattr_encrypted + mov r2, sp + ldrb r0, [r2, 0x11] + cmp r0, 0x1F + bhi _08067DC8 + adds r0, r7, 0 + movs r1, 0x27 + adds r2, 0x11 + bl pokemon_setattr_encrypted + adds r0, r7, 0 + movs r1, 0x28 + mov r2, sp + adds r2, 0x11 + bl pokemon_setattr_encrypted + adds r0, r7, 0 + movs r1, 0x29 + mov r2, sp + adds r2, 0x11 + bl pokemon_setattr_encrypted + adds r0, r7, 0 + movs r1, 0x2A + mov r2, sp + adds r2, 0x11 + bl pokemon_setattr_encrypted + adds r0, r7, 0 + movs r1, 0x2B + mov r2, sp + adds r2, 0x11 + bl pokemon_setattr_encrypted + adds r0, r7, 0 + movs r1, 0x2C + mov r2, sp + adds r2, 0x11 + bl pokemon_setattr_encrypted + b _08067E50 + .pool +_08067DC8: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x18] + movs r3, 0x1F + mov r8, r3 + ands r0, r3 + str r0, [sp, 0x1C] + add r4, sp, 0x1C + adds r0, r7, 0 + movs r1, 0x27 + adds r2, r4, 0 + bl pokemon_setattr_encrypted + ldr r0, [sp, 0x18] + movs r6, 0xF8 + lsls r6, 2 + ands r0, r6 + lsrs r0, 5 + str r0, [sp, 0x1C] + adds r0, r7, 0 + movs r1, 0x28 + adds r2, r4, 0 + bl pokemon_setattr_encrypted + ldr r0, [sp, 0x18] + movs r5, 0xF8 + lsls r5, 7 + ands r0, r5 + lsrs r0, 10 + str r0, [sp, 0x1C] + adds r0, r7, 0 + movs r1, 0x29 + adds r2, r4, 0 + bl pokemon_setattr_encrypted + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x18] + mov r1, r8 + ands r0, r1 + str r0, [sp, 0x1C] + adds r0, r7, 0 + movs r1, 0x2A + adds r2, r4, 0 + bl pokemon_setattr_encrypted + ldr r0, [sp, 0x18] + ands r0, r6 + lsrs r0, 5 + str r0, [sp, 0x1C] + adds r0, r7, 0 + movs r1, 0x2B + adds r2, r4, 0 + bl pokemon_setattr_encrypted + ldr r0, [sp, 0x18] + ands r0, r5 + lsrs r0, 10 + str r0, [sp, 0x1C] + adds r0, r7, 0 + movs r1, 0x2C + adds r2, r4, 0 + bl pokemon_setattr_encrypted +_08067E50: + ldr r2, =gBaseStats + mov r3, sp + ldrh r1, [r3, 0xE] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x17] + cmp r0, 0 + beq _08067E76 + ldr r0, [sp, 0x14] + movs r1, 0x1 + ands r0, r1 + str r0, [sp, 0x18] + adds r0, r7, 0 + movs r1, 0x2E + mov r2, r9 + bl pokemon_setattr_encrypted +_08067E76: + adds r0, r7, 0 + bl sub_8069270 + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end create_pokemon + + thumb_func_start pokemon_make_with_nature +pokemon_make_with_nature: @ 8067E90 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + mov r9, r0 + ldr r0, [sp, 0x2C] + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + lsls r2, 24 + lsrs r7, r2, 24 + lsls r3, 24 + lsrs r6, r3, 24 + lsls r0, 24 + lsrs r5, r0, 24 +_08067EB0: + bl GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsrs r4, 16 + lsls r0, 16 + orrs r4, r0 + adds r0, r4, 0 + bl GetNatureFromPersonality + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + bne _08067EB0 + movs r0, 0x1 + str r0, [sp] + str r4, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + str r0, [sp, 0xC] + mov r0, r9 + mov r1, r8 + adds r2, r7, 0 + adds r3, r6, 0 + bl create_pokemon_set_level + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end pokemon_make_with_nature + + thumb_func_start sub_8067EF8 +sub_8067EF8: @ 8067EF8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + str r0, [sp, 0x10] + ldr r4, [sp, 0x38] + ldr r5, [sp, 0x3C] + ldr r0, [sp, 0x40] + lsls r1, 16 + lsrs r7, r1, 16 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x14] + lsls r3, 24 + lsrs r3, 24 + mov r10, r3 + lsls r4, 24 + lsrs r4, 24 + mov r8, r4 + lsls r5, 24 + lsrs r6, r5, 24 + lsls r0, 24 + lsrs r1, r0, 24 + mov r9, r1 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1B + bhi _08067F9E +_08067F38: + bl GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsrs r4, 16 + lsls r0, 16 + orrs r4, r0 + movs r0, 0xC0 + lsls r0, 18 + ands r0, r4 + lsrs r0, 18 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r4 + lsrs r1, 12 + orrs r0, r1 + movs r1, 0xC0 + lsls r1, 2 + ands r1, r4 + lsrs r1, 6 + orrs r0, r1 + movs r1, 0x3 + ands r1, r4 + orrs r0, r1 + movs r1, 0x1C + bl __umodsi3 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + bl GetNatureFromPersonality + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + bne _08067F38 + adds r0, r7, 0 + adds r1, r4, 0 + bl pokemon_species_get_gender_info + lsls r0, 24 + lsrs r0, 24 + cmp r8, r0 + bne _08067F38 + mov r0, r9 + subs r0, 0x1 + cmp r5, r0 + bne _08067F38 + b _08067FCE +_08067F9E: + bl GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsrs r4, 16 + lsls r0, 16 + orrs r4, r0 + adds r0, r4, 0 + bl GetNatureFromPersonality + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + bne _08067F9E + adds r0, r7, 0 + adds r1, r4, 0 + bl pokemon_species_get_gender_info + lsls r0, 24 + lsrs r0, 24 + cmp r8, r0 + bne _08067F9E +_08067FCE: + movs r0, 0x1 + str r0, [sp] + str r4, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + str r0, [sp, 0xC] + ldr r0, [sp, 0x10] + adds r1, r7, 0 + ldr r2, [sp, 0x14] + mov r3, r10 + bl create_pokemon_set_level + 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_8067EF8 + + thumb_func_start sub_8067FF8 +sub_8067FF8: @ 8067FF8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + mov r8, r0 + lsls r1, 16 + lsrs r6, r1, 16 + lsls r2, 24 + lsrs r7, r2, 24 +_0806800A: + bl GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsrs r5, r4, 16 + lsls r0, 16 + orrs r5, r0 + bl GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsrs r4, 16 + lsls r0, 16 + orrs r4, r0 + adds r0, r6, 0 + adds r1, r4, 0 + bl pokemon_species_get_gender_info + lsls r0, 24 + cmp r0, 0 + bne _0806800A + movs r0, 0x1 + str r0, [sp] + str r4, [sp, 0x4] + str r0, [sp, 0x8] + str r5, [sp, 0xC] + mov r0, r8 + adds r1, r6, 0 + adds r2, r7, 0 + movs r3, 0x20 + bl create_pokemon_set_level + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8067FF8 + + thumb_func_start sub_8068060 +sub_8068060: @ 8068060 + push {r4,lr} + sub sp, 0x14 + adds r4, r0, 0 + str r3, [sp, 0x10] + ldr r3, [sp, 0x1C] + lsls r1, 16 + lsrs r1, 16 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x1 + str r0, [sp] + str r3, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + str r0, [sp, 0xC] + adds r0, r4, 0 + movs r3, 0 + bl create_pokemon_set_level + adds r0, r4, 0 + movs r1, 0x42 + add r2, sp, 0x10 + bl pokemon_setattr + adds r0, r4, 0 + bl pokemon_calc_effective_stats + add sp, 0x14 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8068060 + + thumb_func_start sub_80680A0 +sub_80680A0: @ 80680A0 + push {r4,r5,lr} + sub sp, 0x10 + adds r5, r0, 0 + adds r4, r3, 0 + ldr r3, [sp, 0x1C] + lsls r1, 16 + lsrs r1, 16 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + str r3, [sp, 0xC] + adds r0, r5, 0 + movs r3, 0 + bl create_pokemon_set_level + adds r0, r5, 0 + movs r1, 0x27 + adds r2, r4, 0 + bl pokemon_setattr + adds r2, r4, 0x1 + adds r0, r5, 0 + movs r1, 0x28 + bl pokemon_setattr + adds r2, r4, 0x2 + adds r0, r5, 0 + movs r1, 0x29 + bl pokemon_setattr + adds r2, r4, 0x3 + adds r0, r5, 0 + movs r1, 0x2A + bl pokemon_setattr + adds r2, r4, 0x4 + adds r0, r5, 0 + movs r1, 0x2B + bl pokemon_setattr + adds r4, 0x5 + adds r0, r5, 0 + movs r1, 0x2C + adds r2, r4, 0 + bl pokemon_setattr + adds r0, r5, 0 + bl pokemon_calc_effective_stats + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80680A0 + + thumb_func_start pokemon_make_ev_something +pokemon_make_ev_something: @ 8068114 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + adds r7, r0, 0 + ldr r0, [sp, 0x2C] + lsls r1, 16 + lsrs r1, 16 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r6, 0 + str r6, [sp] + str r6, [sp, 0x4] + str r6, [sp, 0x8] + str r6, [sp, 0xC] + adds r0, r7, 0 + bl create_pokemon_set_level + mov r4, r8 + movs r1, 0x1 + movs r5, 0x5 +_08068148: + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _08068152 + adds r6, 0x1 +_08068152: + lsrs r4, 1 + subs r5, 0x1 + cmp r5, 0 + bge _08068148 + movs r0, 0xFF + lsls r0, 1 + adds r1, r6, 0 + bl __divsi3 + add r1, sp, 0x10 + strh r0, [r1] + movs r4, 0x1 + movs r5, 0 +_0806816C: + mov r0, r8 + ands r0, r4 + cmp r0, 0 + beq _08068180 + adds r1, r5, 0 + adds r1, 0x1A + adds r0, r7, 0 + add r2, sp, 0x10 + bl pokemon_setattr +_08068180: + lsls r0, r4, 25 + lsrs r4, r0, 24 + adds r5, 0x1 + cmp r5, 0x5 + ble _0806816C + adds r0, r7, 0 + bl pokemon_calc_effective_stats + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end pokemon_make_ev_something + + thumb_func_start sub_806819C +sub_806819C: @ 806819C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x34 + adds r7, r0, 0 + adds r6, r1, 0 + ldrh r1, [r6] + ldrb r2, [r6, 0xC] + movs r3, 0x1 + str r3, [sp] + ldr r0, [r6, 0x1C] + str r0, [sp, 0x4] + str r3, [sp, 0x8] + ldr r0, [r6, 0x14] + str r0, [sp, 0xC] + adds r0, r7, 0 + movs r3, 0 + bl create_pokemon_set_level + movs r5, 0 + add r0, sp, 0x30 + mov r9, r0 + movs r1, 0x31 + add r1, sp + mov r8, r1 + adds r4, r6, 0x4 +_080681D2: + ldrh r1, [r4] + lsls r2, r5, 24 + lsrs r2, 24 + adds r0, r7, 0 + bl sub_80691F4 + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _080681D2 + adds r2, r6, 0 + adds r2, 0xD + adds r0, r7, 0 + movs r1, 0x15 + bl pokemon_setattr + adds r2, r6, 0x2 + adds r0, r7, 0 + movs r1, 0xC + bl pokemon_setattr + adds r2, r6, 0 + adds r2, 0x2B + adds r0, r7, 0 + movs r1, 0x20 + bl pokemon_setattr + adds r1, r6, 0 + adds r1, 0x20 + add r0, sp, 0x10 + bl CopyString + add r0, sp, 0x10 + ldrb r0, [r0] + cmp r0, 0xFC + bne _08068230 + add r0, sp, 0x10 + ldrb r0, [r0, 0x1] + cmp r0, 0x15 + bne _08068230 + movs r0, 0x1 + mov r1, r9 + strb r0, [r1] + add r0, sp, 0x10 + bl StripExtendedControlCodes + b _08068236 +_08068230: + movs r0, 0x2 + mov r1, r9 + strb r0, [r1] +_08068236: + adds r0, r7, 0 + movs r1, 0x3 + mov r2, r9 + bl pokemon_setattr + adds r0, r7, 0 + movs r1, 0x2 + add r2, sp, 0x10 + bl pokemon_setattr + adds r2, r6, 0 + adds r2, 0xE + adds r0, r7, 0 + movs r1, 0x1A + bl pokemon_setattr + adds r2, r6, 0 + adds r2, 0xF + adds r0, r7, 0 + movs r1, 0x1B + bl pokemon_setattr + adds r2, r6, 0 + adds r2, 0x10 + adds r0, r7, 0 + movs r1, 0x1C + bl pokemon_setattr + adds r2, r6, 0 + adds r2, 0x11 + adds r0, r7, 0 + movs r1, 0x1D + bl pokemon_setattr + adds r2, r6, 0 + adds r2, 0x12 + adds r0, r7, 0 + movs r1, 0x1E + bl pokemon_setattr + adds r2, r6, 0 + adds r2, 0x13 + adds r0, r7, 0 + movs r1, 0x1F + bl pokemon_setattr + ldrb r0, [r6, 0x1B] + lsrs r0, 7 + mov r1, r8 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x2E + mov r2, r8 + bl pokemon_setattr + ldrb r0, [r6, 0x18] + lsls r0, 27 + lsrs r0, 27 + mov r1, r8 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x27 + mov r2, r8 + bl pokemon_setattr + ldrh r0, [r6, 0x18] + lsls r0, 22 + lsrs r0, 27 + mov r1, r8 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x28 + mov r2, r8 + bl pokemon_setattr + ldrb r0, [r6, 0x19] + lsls r0, 25 + lsrs r0, 27 + mov r1, r8 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x29 + mov r2, r8 + bl pokemon_setattr + ldr r0, [r6, 0x18] + lsls r0, 12 + lsrs r0, 27 + mov r1, r8 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x2A + mov r2, r8 + bl pokemon_setattr + ldrh r0, [r6, 0x1A] + lsls r0, 23 + lsrs r0, 27 + mov r1, r8 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x2B + mov r2, r8 + bl pokemon_setattr + ldrb r0, [r6, 0x1B] + lsls r0, 26 + lsrs r0, 27 + mov r1, r8 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x2C + mov r2, r8 + bl pokemon_setattr + adds r0, r7, 0 + bl sub_806E924 + adds r0, r7, 0 + bl pokemon_calc_effective_stats + add sp, 0x34 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_806819C + + thumb_func_start sub_8068338 +sub_8068338: @ 8068338 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x58 + adds r7, r0, 0 + adds r6, r1, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _08068374 + lsls r0, r1, 30 + lsrs r0, 30 + bl sub_8165C90 + lsls r0, 24 + lsrs r3, r0, 24 + b _0806837C + .pool +_08068374: + movs r3, 0x32 + cmp r2, 0 + bne _0806837C + ldrb r3, [r6, 0xC] +_0806837C: + ldrh r1, [r6] + movs r2, 0x1 + str r2, [sp] + ldr r0, [r6, 0x1C] + str r0, [sp, 0x4] + str r2, [sp, 0x8] + ldr r0, [r6, 0x14] + str r0, [sp, 0xC] + adds r0, r7, 0 + adds r2, r3, 0 + movs r3, 0 + bl create_pokemon_set_level + movs r5, 0 + movs r0, 0xD + adds r0, r6 + mov r10, r0 + adds r1, r6, 0x2 + str r1, [sp, 0x38] + adds r0, r6, 0 + adds r0, 0x2B + str r0, [sp, 0x34] + adds r1, 0x1E + str r1, [sp, 0x54] + add r0, sp, 0x30 + mov r9, r0 + subs r1, 0x12 + str r1, [sp, 0x3C] + adds r0, r6, 0 + adds r0, 0xF + str r0, [sp, 0x40] + adds r1, 0x2 + str r1, [sp, 0x44] + adds r0, 0x2 + str r0, [sp, 0x48] + adds r1, 0x2 + str r1, [sp, 0x4C] + adds r0, 0x2 + str r0, [sp, 0x50] + movs r1, 0x31 + add r1, sp + mov r8, r1 + adds r4, r6, 0x4 +_080683D2: + ldrh r1, [r4] + lsls r2, r5, 24 + lsrs r2, 24 + adds r0, r7, 0 + bl sub_80691F4 + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _080683D2 + adds r0, r7, 0 + movs r1, 0x15 + mov r2, r10 + bl pokemon_setattr + adds r0, r7, 0 + movs r1, 0xC + ldr r2, [sp, 0x38] + bl pokemon_setattr + adds r0, r7, 0 + movs r1, 0x20 + ldr r2, [sp, 0x34] + bl pokemon_setattr + add r0, sp, 0x10 + ldr r1, [sp, 0x54] + bl CopyString + add r0, sp, 0x10 + ldrb r0, [r0] + cmp r0, 0xFC + bne _0806842A + add r0, sp, 0x10 + ldrb r0, [r0, 0x1] + cmp r0, 0x15 + bne _0806842A + movs r0, 0x1 + mov r1, r9 + strb r0, [r1] + add r0, sp, 0x10 + bl StripExtendedControlCodes + b _08068430 +_0806842A: + movs r0, 0x2 + mov r1, r9 + strb r0, [r1] +_08068430: + adds r0, r7, 0 + movs r1, 0x3 + mov r2, r9 + bl pokemon_setattr + adds r0, r7, 0 + movs r1, 0x2 + add r2, sp, 0x10 + bl pokemon_setattr + adds r0, r7, 0 + movs r1, 0x1A + ldr r2, [sp, 0x3C] + bl pokemon_setattr + adds r0, r7, 0 + movs r1, 0x1B + ldr r2, [sp, 0x40] + bl pokemon_setattr + adds r0, r7, 0 + movs r1, 0x1C + ldr r2, [sp, 0x44] + bl pokemon_setattr + adds r0, r7, 0 + movs r1, 0x1D + ldr r2, [sp, 0x48] + bl pokemon_setattr + adds r0, r7, 0 + movs r1, 0x1E + ldr r2, [sp, 0x4C] + bl pokemon_setattr + adds r0, r7, 0 + movs r1, 0x1F + ldr r2, [sp, 0x50] + bl pokemon_setattr + ldrb r0, [r6, 0x1B] + lsrs r0, 7 + mov r1, r8 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x2E + mov r2, r8 + bl pokemon_setattr + ldrb r0, [r6, 0x18] + lsls r0, 27 + lsrs r0, 27 + mov r1, r8 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x27 + mov r2, r8 + bl pokemon_setattr + ldrh r0, [r6, 0x18] + lsls r0, 22 + lsrs r0, 27 + mov r1, r8 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x28 + mov r2, r8 + bl pokemon_setattr + ldrb r0, [r6, 0x19] + lsls r0, 25 + lsrs r0, 27 + mov r1, r8 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x29 + mov r2, r8 + bl pokemon_setattr + ldr r0, [r6, 0x18] + lsls r0, 12 + lsrs r0, 27 + mov r1, r8 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x2A + mov r2, r8 + bl pokemon_setattr + ldrh r0, [r6, 0x1A] + lsls r0, 23 + lsrs r0, 27 + mov r1, r8 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x2B + mov r2, r8 + bl pokemon_setattr + ldrb r0, [r6, 0x1B] + lsls r0, 26 + lsrs r0, 27 + mov r1, r8 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x2C + mov r2, r8 + bl pokemon_setattr + adds r0, r7, 0 + bl sub_806E924 + adds r0, r7, 0 + bl pokemon_calc_effective_stats + 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_8068338 + + thumb_func_start sub_8068528 +sub_8068528: @ 8068528 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + adds r7, r0, 0 + mov r9, r1 + lsls r2, 24 + lsrs r2, 24 + ldr r6, =gUnknown_08610970 + ldrb r0, [r1] + lsls r3, r0, 27 + lsrs r1, r3, 27 + movs r5, 0x58 + muls r1, r5 + adds r1, r6 + ldrh r1, [r1, 0x30] + mov r8, r1 + lsrs r1, r3, 27 + muls r1, r5 + adds r1, r6 + ldrh r4, [r1, 0x30] + lsrs r4, 8 + lsrs r3, 27 + adds r1, r3, 0 + muls r1, r5 + adds r1, r6 + ldrh r3, [r1, 0x30] + movs r1, 0xFF + ands r1, r3 + lsls r1, 8 + lsls r5, r2, 1 + adds r5, r2 + lsls r5, 2 + mov r2, r9 + adds r6, r2, r5 + orrs r4, r1 + ldrh r1, [r6, 0x4] + adds r4, r1 + ldrb r1, [r2, 0x2] + adds r4, r1 + lsls r0, 25 + lsrs r0, 30 + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + bl sub_8165C90 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldrh r1, [r6, 0x4] + movs r0, 0x1 + str r0, [sp] + str r4, [sp, 0x4] + str r0, [sp, 0x8] + mov r0, r8 + str r0, [sp, 0xC] + adds r0, r7, 0 + movs r3, 0x1F + bl create_pokemon_set_level + mov r1, r9 + adds r2, r5, r1 + adds r2, 0xE + adds r0, r7, 0 + movs r1, 0xC + bl pokemon_setattr + movs r4, 0 + movs r2, 0x12 + add r2, sp + mov r8, r2 + mov r6, r9 + adds r6, 0x6 +_080685BE: + adds r0, r6, r5 + ldrh r1, [r0] + lsls r2, r4, 24 + lsrs r2, 24 + adds r0, r7, 0 + bl sub_80691F4 + adds r5, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + ble _080685BE + movs r1, 0x55 + add r0, sp, 0x10 + strh r1, [r0] + movs r4, 0 + mov r5, r9 + adds r5, 0x3F +_080685E0: + adds r1, r4, 0 + adds r1, 0x1A + adds r0, r7, 0 + add r2, sp, 0x10 + bl pokemon_setattr + adds r4, 0x1 + cmp r4, 0x5 + ble _080685E0 + ldrb r0, [r5] + mov r1, r8 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x3 + mov r2, r8 + bl pokemon_setattr + mov r2, r9 + ldrb r0, [r2] + lsls r0, 27 + lsrs r0, 27 + mov r2, r8 + ldrb r1, [r2] + bl sub_81A1650 + adds r2, r0, 0 + adds r0, r7, 0 + movs r1, 0x7 + bl pokemon_setattr + adds r0, r7, 0 + bl pokemon_calc_effective_stats + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8068528 + + thumb_func_start sub_8068634 +sub_8068634: @ 8068634 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + adds r7, r0, 0 + ldr r0, [sp, 0x38] + ldr r4, [sp, 0x3C] + lsls r1, 16 + lsrs r1, 16 + str r1, [sp, 0x14] + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + lsls r3, 24 + lsrs r5, r3, 24 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r4, 24 + lsrs r4, 24 + mov r8, r4 + movs r6, 0 +_08068664: + bl GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsrs r4, 16 + lsls r0, 16 + orrs r4, r0 + adds r0, r4, 0 + bl GetNatureFromPersonality + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + bne _08068664 + movs r0, 0x1 + str r0, [sp] + str r4, [sp, 0x4] + str r0, [sp, 0x8] + ldr r0, [sp, 0x40] + str r0, [sp, 0xC] + adds r0, r7, 0 + ldr r1, [sp, 0x14] + mov r2, r10 + mov r3, r9 + bl create_pokemon_set_level + mov r5, r8 + movs r1, 0x1 + movs r4, 0x5 +_080686A2: + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _080686AC + adds r6, 0x1 +_080686AC: + lsrs r5, 1 + subs r4, 0x1 + cmp r4, 0 + bge _080686A2 + movs r0, 0xFF + lsls r0, 1 + adds r1, r6, 0 + bl __divsi3 + add r1, sp, 0x10 + strh r0, [r1] + movs r5, 0x1 + movs r4, 0 +_080686C6: + mov r0, r8 + ands r0, r5 + cmp r0, 0 + beq _080686DA + adds r1, r4, 0 + adds r1, 0x1A + adds r0, r7, 0 + add r2, sp, 0x10 + bl pokemon_setattr +_080686DA: + lsls r0, r5, 25 + lsrs r5, r0, 24 + adds r4, 0x1 + cmp r4, 0x5 + ble _080686C6 + adds r0, r7, 0 + bl pokemon_calc_effective_stats + 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_8068634 + + thumb_func_start sub_80686FC +sub_80686FC: @ 80686FC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r7, r0, 0 + adds r6, r1, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r6] + adds r0, r7, 0 + movs r1, 0xC + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xAF + bne _08068726 + movs r0, 0 +_08068726: + strh r0, [r6, 0x2] + movs r5, 0 + movs r0, 0x2B + adds r0, r6 + mov r8, r0 + movs r1, 0x20 + adds r1, r6 + mov r9, r1 + adds r4, r6, 0x4 +_08068738: + adds r1, r5, 0 + adds r1, 0xD + adds r0, r7, 0 + movs r2, 0 + bl pokemon_getattr + strh r0, [r4] + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _08068738 + adds r0, r7, 0 + movs r1, 0x38 + movs r2, 0 + bl pokemon_getattr + strb r0, [r6, 0xC] + adds r0, r7, 0 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + strb r0, [r6, 0xD] + adds r0, r7, 0 + movs r1, 0x1 + movs r2, 0 + bl pokemon_getattr + str r0, [r6, 0x14] + adds r0, r7, 0 + movs r1, 0x1A + movs r2, 0 + bl pokemon_getattr + strb r0, [r6, 0xE] + adds r0, r7, 0 + movs r1, 0x1B + movs r2, 0 + bl pokemon_getattr + strb r0, [r6, 0xF] + adds r0, r7, 0 + movs r1, 0x1C + movs r2, 0 + bl pokemon_getattr + strb r0, [r6, 0x10] + adds r0, r7, 0 + movs r1, 0x1D + movs r2, 0 + bl pokemon_getattr + strb r0, [r6, 0x11] + adds r0, r7, 0 + movs r1, 0x1E + movs r2, 0 + bl pokemon_getattr + strb r0, [r6, 0x12] + adds r0, r7, 0 + movs r1, 0x1F + movs r2, 0 + bl pokemon_getattr + strb r0, [r6, 0x13] + adds r0, r7, 0 + movs r1, 0x20 + movs r2, 0 + bl pokemon_getattr + mov r1, r8 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x27 + movs r2, 0 + bl pokemon_getattr + movs r4, 0x1F + ands r0, r4 + ldrb r2, [r6, 0x18] + movs r1, 0x20 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r6, 0x18] + adds r0, r7, 0 + movs r1, 0x28 + movs r2, 0 + bl pokemon_getattr + movs r5, 0x1F + ands r0, r5 + lsls r0, 5 + ldrh r2, [r6, 0x18] + ldr r1, =0xfffffc1f + ands r1, r2 + orrs r1, r0 + strh r1, [r6, 0x18] + adds r0, r7, 0 + movs r1, 0x29 + movs r2, 0 + bl pokemon_getattr + ands r0, r4 + lsls r0, 2 + ldrb r2, [r6, 0x19] + movs r1, 0x7D + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r6, 0x19] + adds r0, r7, 0 + movs r1, 0x2A + movs r2, 0 + bl pokemon_getattr + movs r1, 0x1F + ands r1, r0 + lsls r1, 15 + ldr r0, [r6, 0x18] + ldr r2, =0xfff07fff + ands r0, r2 + orrs r0, r1 + str r0, [r6, 0x18] + adds r0, r7, 0 + movs r1, 0x2B + movs r2, 0 + bl pokemon_getattr + ands r0, r5 + lsls r0, 4 + ldrh r2, [r6, 0x1A] + ldr r1, =0xfffffe0f + ands r1, r2 + orrs r1, r0 + strh r1, [r6, 0x1A] + adds r0, r7, 0 + movs r1, 0x2C + movs r2, 0 + bl pokemon_getattr + ands r0, r4 + lsls r0, 1 + ldrb r2, [r6, 0x1B] + movs r1, 0x3F + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r6, 0x1B] + adds r0, r7, 0 + movs r1, 0x2E + movs r2, 0 + bl pokemon_getattr + lsls r0, 7 + ldrb r2, [r6, 0x1B] + movs r1, 0x7F + ands r1, r2 + orrs r1, r0 + strb r1, [r6, 0x1B] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + str r0, [r6, 0x1C] + adds r0, r7, 0 + movs r1, 0x2 + mov r2, r9 + bl pokemon_getattr + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80686FC + + thumb_func_start sub_80688A8 +sub_80688A8: @ 80688A8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + mov r8, r0 + ldr r4, [sp, 0x2C] + ldr r6, [sp, 0x30] + ldr r5, [sp, 0x34] + ldr r7, [sp, 0x38] + lsls r1, 16 + lsrs r1, 16 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0x1 + str r0, [sp, 0x10] + str r4, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + str r7, [sp, 0xC] + mov r0, r8 + bl create_pokemon_set_level + mov r0, r8 + movs r1, 0x50 + add r2, sp, 0x10 + bl pokemon_setattr + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80688A8 + + thumb_func_start sub_80688F8 +sub_80688F8: @ 80688F8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + cmp r0, 0x5 + bhi _080689CE + lsls r0, 2 + ldr r1, =_08068914 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08068914: + .4byte _080689CE + .4byte _0806892C + .4byte _08068A00 + .4byte _08068958 + .4byte _08068A00 + .4byte _08068990 +_0806892C: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080689CE + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080689CE + b _080689B6 + .pool +_08068958: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080689CE + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080689CE + cmp r5, 0x1 + beq _08068A00 + cmp r5, 0x4 + beq _08068A00 + cmp r5, 0x5 + beq _08068A00 + b _080689CE + .pool +_08068990: + ldr r0, =0x02022fec + ldr r2, [r0] + movs r3, 0x2 + adds r0, r2, 0 + ands r0, r3 + cmp r0, 0 + beq _080689E4 + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _080689CE + movs r0, 0x40 + ands r2, r0 + cmp r2, 0 + beq _080689F4 +_080689B6: + ldr r4, =0x020229e8 + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r4 + ldrh r0, [r1, 0x18] + cmp r0, r5 + bne _08068A00 +_080689CE: + movs r0, 0 + b _08068A02 + .pool +_080689E4: + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _080689CE +_080689F4: + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080689CE +_08068A00: + movs r0, 0x1 +_08068A02: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80688F8 + + thumb_func_start get_pokemon_data_3 +get_pokemon_data_3: @ 8068A10 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x20 + ands r0, r1 + cmp r0, 0 + bne _08068A34 + adds r0, r5, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + movs r1, 0xCD + lsls r1, 1 + cmp r0, r1 + beq _08068A3C +_08068A34: + movs r0, 0 + b _08068A9A + .pool +_08068A3C: + adds r1, r6, 0 + adds r1, 0x27 + adds r0, r5, 0 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + adds r1, r6, 0 + adds r1, 0x1A + adds r0, r5, 0 + movs r2, 0 + bl pokemon_getattr + ldr r2, =gUnknown_08329D48 + lsls r1, r6, 1 + adds r1, r2 + ldrh r1, [r1] + lsls r1, 1 + adds r1, r4 + cmp r0, 0 + bge _08068A68 + adds r0, 0x3 +_08068A68: + asrs r0, 2 + adds r0, r1, r0 + adds r1, r5, 0 + adds r1, 0x54 + ldrb r1, [r1] + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + adds r0, 0x5 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r5, 0 + bl GetNature + lsls r0, 24 + lsrs r0, 24 + lsls r2, r6, 24 + lsrs r2, 24 + adds r1, r4, 0 + bl nature_stat_mod + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 +_08068A9A: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end get_pokemon_data_3 + + thumb_func_start sub_8068AA4 +sub_8068AA4: @ 8068AA4 + push {r4,r5,lr} + sub sp, 0x4 + movs r5, 0 +_08068AAA: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + movs r1, 0xCD + lsls r1, 1 + cmp r0, r1 + bne _08068B34 + adds r0, r4, 0 + movs r1, 0x3B + movs r2, 0 + bl pokemon_getattr + str r0, [sp] + adds r0, r4, 0 + movs r1, 0x3B + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3C + movs r2, 0 + bl pokemon_getattr + str r0, [sp] + adds r0, r4, 0 + movs r1, 0x3C + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3D + movs r2, 0 + bl pokemon_getattr + str r0, [sp] + adds r0, r4, 0 + movs r1, 0x3D + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3E + movs r2, 0 + bl pokemon_getattr + str r0, [sp] + adds r0, r4, 0 + movs r1, 0x3E + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3F + movs r2, 0 + bl pokemon_getattr + str r0, [sp] + adds r0, r4, 0 + movs r1, 0x3F + mov r2, sp + bl pokemon_setattr +_08068B34: + adds r5, 0x1 + cmp r5, 0x5 + ble _08068AAA + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8068AA4 + + thumb_func_start sub_8068B48 +sub_8068B48: @ 8068B48 + push {lr} + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 18 + ands r0, r1 + cmp r0, 0 + beq _08068B6C + ldr r0, =0x0203c7b4 + ldrb r1, [r0] + movs r0, 0x1 + eors r0, r1 + b _08068B78 + .pool +_08068B6C: + bl link_get_multiplayer_id + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 +_08068B78: + ldr r3, =0x020229e8 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r0, r3, 0x4 + adds r0, r1, r0 + ldr r2, [r0] + movs r0, 0x7 + ands r2, r0 + adds r1, r3 + ldrb r0, [r1, 0x13] + lsls r0, 3 + orrs r2, r0 + ldr r0, =gUnknown_08329D54 + lsls r2, 1 + adds r2, r0 + ldrh r0, [r2] + bl TrainerClassToTrainerPic + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8068B48 + + thumb_func_start sub_8068BB0 +sub_8068BB0: @ 8068BB0 + push {lr} + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 18 + ands r0, r1 + cmp r0, 0 + beq _08068BD4 + ldr r0, =0x0203c7b4 + ldrb r1, [r0] + movs r0, 0x1 + eors r0, r1 + b _08068BE0 + .pool +_08068BD4: + bl link_get_multiplayer_id + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 +_08068BE0: + ldr r3, =0x020229e8 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r0, r3, 0x4 + adds r0, r1, r0 + ldr r2, [r0] + movs r0, 0x7 + ands r2, r0 + adds r1, r3 + ldrb r0, [r1, 0x13] + lsls r0, 3 + orrs r2, r0 + ldr r1, =gTrainerClassNameIndices + ldr r0, =gUnknown_08329D54 + lsls r2, 1 + adds r2, r0 + ldrh r0, [r2] + adds r0, r1 + ldrb r0, [r0] + pop {r1} + bx r1 + .pool + thumb_func_end sub_8068BB0 + + thumb_func_start DoScriptedWildBattle +DoScriptedWildBattle: @ 8068C18 + push {r4-r7,lr} + sub sp, 0x14 + ldr r0, =0x020375e0 + ldrh r5, [r0] + ldr r0, =0x020375e2 + ldrh r4, [r0] + ldr r0, =0x020375e4 + ldrh r6, [r0] + bl zero_enemy_party_data + ldr r7, =0x02024744 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + adds r0, r7, 0 + adds r1, r5, 0 + adds r2, r4, 0 + movs r3, 0x20 + bl sub_80688A8 + cmp r6, 0 + beq _08068C60 + add r0, sp, 0x10 + strb r6, [r0] + adds r1, r0, 0 + asrs r0, r6, 8 + strb r0, [r1, 0x1] + adds r0, r7, 0 + movs r1, 0xC + add r2, sp, 0x10 + bl pokemon_setattr +_08068C60: + add sp, 0x14 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end DoScriptedWildBattle + + thumb_func_start pokemon_calc_checksum +@ int pokemon_calc_checksum(pokemon *mon) +pokemon_calc_checksum: @ 8068C78 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + movs r6, 0 + ldr r1, [r4] + movs r2, 0 + bl pokemon_data_permutator + adds r5, r0, 0 + ldr r1, [r4] + adds r0, r4, 0 + movs r2, 0x1 + bl pokemon_data_permutator + adds r7, r0, 0 + ldr r1, [r4] + adds r0, r4, 0 + movs r2, 0x2 + bl pokemon_data_permutator + mov r8, r0 + ldr r1, [r4] + adds r0, r4, 0 + movs r2, 0x3 + bl pokemon_data_permutator + adds r3, r0, 0 + movs r1, 0x5 +_08068CB2: + ldrh r0, [r5] + adds r0, r6, r0 + lsls r0, 16 + lsrs r6, r0, 16 + adds r5, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _08068CB2 + adds r2, r7, 0 + movs r1, 0x5 +_08068CC6: + ldrh r0, [r2] + adds r0, r6, r0 + lsls r0, 16 + lsrs r6, r0, 16 + adds r2, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _08068CC6 + mov r2, r8 + movs r1, 0x5 +_08068CDA: + ldrh r0, [r2] + adds r0, r6, r0 + lsls r0, 16 + lsrs r6, r0, 16 + adds r2, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _08068CDA + adds r2, r3, 0 + movs r1, 0x5 +_08068CEE: + ldrh r0, [r2] + adds r0, r6, r0 + lsls r0, 16 + lsrs r6, r0, 16 + adds r2, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _08068CEE + adds r0, r6, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end pokemon_calc_checksum + + thumb_func_start pokemon_calc_effective_stats +pokemon_calc_effective_stats: @ 8068D0C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x40 + adds r5, r0, 0 + movs r1, 0x3A + movs r2, 0 + bl pokemon_getattr + mov r8, r0 + adds r0, r5, 0 + movs r1, 0x39 + movs r2, 0 + bl pokemon_getattr + str r0, [sp, 0x1C] + adds r0, r5, 0 + movs r1, 0x27 + movs r2, 0 + bl pokemon_getattr + adds r6, r0, 0 + adds r0, r5, 0 + movs r1, 0x1A + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + adds r0, r5, 0 + movs r1, 0x28 + movs r2, 0 + bl pokemon_getattr + mov r10, r0 + adds r0, r5, 0 + movs r1, 0x1B + movs r2, 0 + bl pokemon_getattr + mov r9, r0 + adds r0, r5, 0 + movs r1, 0x29 + movs r2, 0 + bl pokemon_getattr + str r0, [sp, 0x20] + adds r0, r5, 0 + movs r1, 0x1C + movs r2, 0 + bl pokemon_getattr + str r0, [sp, 0x24] + adds r0, r5, 0 + movs r1, 0x2A + movs r2, 0 + bl pokemon_getattr + str r0, [sp, 0x28] + adds r0, r5, 0 + movs r1, 0x1D + movs r2, 0 + bl pokemon_getattr + str r0, [sp, 0x2C] + adds r0, r5, 0 + movs r1, 0x2B + movs r2, 0 + bl pokemon_getattr + str r0, [sp, 0x30] + adds r0, r5, 0 + movs r1, 0x1E + movs r2, 0 + bl pokemon_getattr + str r0, [sp, 0x34] + adds r0, r5, 0 + movs r1, 0x2C + movs r2, 0 + bl pokemon_getattr + str r0, [sp, 0x38] + adds r0, r5, 0 + movs r1, 0x1F + movs r2, 0 + bl pokemon_getattr + str r0, [sp, 0x3C] + adds r0, r5, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r7, r0, 16 + adds r0, r5, 0 + bl level_by_exp + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + adds r0, r5, 0 + movs r1, 0x38 + mov r2, sp + bl pokemon_setattr + ldr r0, =0x0000012f + cmp r7, r0 + bne _08068DF8 + movs r0, 0x1 + str r0, [sp, 0x4] + lsls r6, r7, 3 + b _08068E26 + .pool +_08068DF8: + ldr r1, =gBaseStats + lsls r2, r7, 3 + subs r0, r2, r7 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 1 + adds r1, r0, r6 + adds r0, r4, 0 + adds r6, r2, 0 + cmp r0, 0 + bge _08068E12 + adds r0, 0x3 +_08068E12: + asrs r0, 2 + adds r0, r1, r0 + ldr r4, [sp] + muls r0, r4 + movs r1, 0x64 + bl __divsi3 + adds r0, r4 + adds r0, 0xA + str r0, [sp, 0x4] +_08068E26: + ldr r1, =0x02024474 + add r2, sp, 0x4 + ldrb r0, [r2] + mov r3, r8 + subs r0, r3 + adds r1, 0x23 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + bne _08068E3E + movs r0, 0x1 + strb r0, [r1] +_08068E3E: + adds r0, r5, 0 + movs r1, 0x3A + bl pokemon_setattr + ldr r0, =gBaseStats + subs r1, r6, r7 + lsls r1, 2 + adds r6, r1, r0 + ldrb r0, [r6, 0x1] + lsls r0, 1 + mov r2, r10 + adds r1, r0, r2 + mov r0, r9 + cmp r0, 0 + bge _08068E5E + adds r0, 0x3 +_08068E5E: + asrs r0, 2 + adds r0, r1, r0 + ldr r1, [sp] + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + adds r0, 0x5 + str r0, [sp, 0x8] + adds r0, r5, 0 + bl GetNature + lsls r0, 24 + lsrs r0, 24 + add r4, sp, 0x8 + ldrh r1, [r4] + movs r2, 0x1 + bl nature_stat_mod + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0x3B + adds r2, r4, 0 + bl pokemon_setattr + ldrb r0, [r6, 0x2] + lsls r0, 1 + ldr r3, [sp, 0x20] + adds r1, r0, r3 + ldr r0, [sp, 0x24] + cmp r0, 0 + bge _08068EA4 + adds r0, 0x3 +_08068EA4: + asrs r0, 2 + adds r0, r1, r0 + ldr r1, [sp] + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + adds r0, 0x5 + str r0, [sp, 0xC] + adds r0, r5, 0 + bl GetNature + lsls r0, 24 + lsrs r0, 24 + add r4, sp, 0xC + ldrh r1, [r4] + movs r2, 0x2 + bl nature_stat_mod + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0xC] + adds r0, r5, 0 + movs r1, 0x3C + adds r2, r4, 0 + bl pokemon_setattr + ldrb r0, [r6, 0x3] + lsls r0, 1 + ldr r2, [sp, 0x28] + adds r1, r0, r2 + ldr r0, [sp, 0x2C] + cmp r0, 0 + bge _08068EEA + adds r0, 0x3 +_08068EEA: + asrs r0, 2 + adds r0, r1, r0 + ldr r1, [sp] + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + adds r0, 0x5 + str r0, [sp, 0x10] + adds r0, r5, 0 + bl GetNature + lsls r0, 24 + lsrs r0, 24 + add r4, sp, 0x10 + ldrh r1, [r4] + movs r2, 0x3 + bl nature_stat_mod + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x10] + adds r0, r5, 0 + movs r1, 0x3D + adds r2, r4, 0 + bl pokemon_setattr + ldrb r0, [r6, 0x4] + lsls r0, 1 + ldr r3, [sp, 0x30] + adds r1, r0, r3 + ldr r0, [sp, 0x34] + cmp r0, 0 + bge _08068F30 + adds r0, 0x3 +_08068F30: + asrs r0, 2 + adds r0, r1, r0 + ldr r1, [sp] + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + adds r0, 0x5 + str r0, [sp, 0x14] + adds r0, r5, 0 + bl GetNature + lsls r0, 24 + lsrs r0, 24 + add r4, sp, 0x14 + ldrh r1, [r4] + movs r2, 0x4 + bl nature_stat_mod + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x14] + adds r0, r5, 0 + movs r1, 0x3E + adds r2, r4, 0 + bl pokemon_setattr + ldrb r0, [r6, 0x5] + lsls r0, 1 + ldr r2, [sp, 0x38] + adds r1, r0, r2 + ldr r0, [sp, 0x3C] + cmp r0, 0 + bge _08068F76 + adds r0, 0x3 +_08068F76: + asrs r0, 2 + adds r0, r1, r0 + ldr r1, [sp] + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + adds r0, 0x5 + str r0, [sp, 0x18] + adds r0, r5, 0 + bl GetNature + lsls r0, 24 + lsrs r0, 24 + add r4, sp, 0x18 + ldrh r1, [r4] + movs r2, 0x5 + bl nature_stat_mod + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x18] + adds r0, r5, 0 + movs r1, 0x3F + adds r2, r4, 0 + bl pokemon_setattr + ldr r0, =0x0000012f + cmp r7, r0 + bne _08068FD0 + ldr r0, [sp, 0x1C] + cmp r0, 0 + bne _08068FBE + mov r3, r8 + cmp r3, 0 + bne _08068FF4 +_08068FBE: + movs r0, 0x1 + b _08068FE8 + .pool +_08068FD0: + ldr r1, [sp, 0x1C] + cmp r1, 0 + bne _08068FE0 + mov r0, r8 + cmp r0, 0 + bne _08068FF4 + ldr r0, [sp, 0x4] + b _08068FE8 +_08068FE0: + ldr r0, [sp, 0x4] + mov r2, r8 + subs r0, r2 + adds r0, r1, r0 +_08068FE8: + str r0, [sp, 0x1C] + add r2, sp, 0x1C + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_setattr +_08068FF4: + add sp, 0x40 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end pokemon_calc_effective_stats + + thumb_func_start sub_8069004 +sub_8069004: @ 8069004 + push {r4,lr} + sub sp, 0x4 + adds r2, r0, 0 + adds r4, r1, 0 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + adds r1, r2, 0 + movs r2, 0x50 + bl memcpy + adds r0, r4, 0 + movs r1, 0x37 + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x39 + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3A + mov r2, sp + bl pokemon_setattr + movs r0, 0xFF + str r0, [sp] + adds r0, r4, 0 + movs r1, 0x40 + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + bl pokemon_calc_effective_stats + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8069004 + + thumb_func_start level_by_exp +level_by_exp: @ 8069054 + push {r4-r6,lr} + adds r5, r0, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x19 + movs r2, 0 + bl pokemon_getattr + adds r3, r0, 0 + movs r2, 0x1 + ldr r6, =gExperienceTables + ldr r1, =gBaseStats + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r1, r0, r1 + ldrb r0, [r1, 0x13] + movs r5, 0xCA + lsls r5, 1 + muls r0, r5 + adds r0, 0x4 + adds r0, r6 + ldr r0, [r0] + cmp r0, r3 + bhi _080690AA + adds r4, r1, 0 +_08069094: + adds r2, 0x1 + cmp r2, 0x64 + bgt _080690AA + lsls r1, r2, 2 + ldrb r0, [r4, 0x13] + muls r0, r5 + adds r1, r0 + adds r1, r6 + ldr r0, [r1] + cmp r0, r3 + bls _08069094 +_080690AA: + subs r0, r2, 0x1 + lsls r0, 24 + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end level_by_exp + + thumb_func_start sub_80690C0 +sub_80690C0: @ 80690C0 + push {r4-r6,lr} + adds r5, r0, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr_encrypted + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x19 + movs r2, 0 + bl pokemon_getattr_encrypted + adds r3, r0, 0 + movs r2, 0x1 + ldr r6, =gExperienceTables + ldr r1, =gBaseStats + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r1, r0, r1 + ldrb r0, [r1, 0x13] + movs r5, 0xCA + lsls r5, 1 + muls r0, r5 + adds r0, 0x4 + adds r0, r6 + ldr r0, [r0] + cmp r0, r3 + bhi _08069116 + adds r4, r1, 0 +_08069100: + adds r2, 0x1 + cmp r2, 0x64 + bgt _08069116 + lsls r1, r2, 2 + ldrb r0, [r4, 0x13] + muls r0, r5 + adds r1, r0 + adds r1, r6 + ldr r0, [r1] + cmp r0, r3 + bls _08069100 +_08069116: + subs r0, r2, 0x1 + lsls r0, 24 + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80690C0 + + thumb_func_start pokemon_moveset_pad_ +pokemon_moveset_pad_: @ 806912C + push {lr} + lsls r1, 16 + lsrs r1, 16 + bl pokemon_moveset_pad + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end pokemon_moveset_pad_ + + thumb_func_start pokemon_moveset_pad +pokemon_moveset_pad: @ 8069140 + push {r4-r7,lr} + sub sp, 0x4 + adds r7, r0, 0 + mov r0, sp + strh r1, [r0] + movs r5, 0 + mov r6, sp +_0806914E: + adds r4, r5, 0 + adds r4, 0xD + adds r0, r7, 0 + adds r1, r4, 0 + movs r2, 0 + bl pokemon_getattr_encrypted + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _0806918C + adds r0, r7, 0 + adds r1, r4, 0 + mov r2, sp + bl pokemon_setattr_encrypted + adds r1, r5, 0 + adds r1, 0x11 + ldrh r0, [r6] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + ldr r0, =gBattleMoves + 0x4 @ PP offset + adds r2, r0 + adds r0, r7, 0 + bl pokemon_setattr_encrypted + ldrh r0, [r6] + b _080691A4 + .pool +_0806918C: + ldrh r1, [r6] + cmp r0, r1 + bne _0806919C + ldr r0, =0x0000fffe + b _080691A4 + .pool +_0806919C: + adds r5, 0x1 + cmp r5, 0x3 + ble _0806914E + ldr r0, =0x0000ffff +_080691A4: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end pokemon_moveset_pad + + thumb_func_start sub_80691B0 +sub_80691B0: @ 80691B0 + push {r4,r5,lr} + lsls r1, 16 + lsrs r4, r1, 16 + movs r3, 0 + adds r5, r0, 0 + adds r5, 0x24 + ldr r2, =gBattleMoves + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 2 + adds r2, r1, r2 + adds r1, r0, 0 + adds r1, 0xC +_080691CA: + ldrh r0, [r1] + cmp r0, 0 + bne _080691E0 + strh r4, [r1] + adds r1, r5, r3 + ldrb r0, [r2, 0x4] + strb r0, [r1] + adds r0, r4, 0 + b _080691EA + .pool +_080691E0: + adds r1, 0x2 + adds r3, 0x1 + cmp r3, 0x3 + ble _080691CA + ldr r0, =0x0000ffff +_080691EA: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80691B0 + + thumb_func_start sub_80691F4 +sub_80691F4: @ 80691F4 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r4, r2, 0 + mov r0, sp + strh r1, [r0] + lsls r4, 24 + lsrs r4, 24 + adds r1, r4, 0 + adds r1, 0xD + adds r0, r5, 0 + mov r2, sp + bl pokemon_setattr + adds r4, 0x11 + mov r0, sp + ldrh r0, [r0] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + ldr r0, =gBattleMoves + 0x4 @ PP offset + adds r2, r0 + adds r0, r5, 0 + adds r1, r4, 0 + bl pokemon_setattr + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80691F4 + + thumb_func_start sub_8069234 +sub_8069234: @ 8069234 + push {r4,lr} + lsls r1, 16 + lsrs r1, 16 + lsls r2, 24 + lsrs r2, 24 + lsls r4, r2, 1 + adds r3, r0, 0 + adds r3, 0xC + adds r3, r4 + strh r1, [r3] + adds r0, 0x24 + adds r0, r2 + ldr r3, =gBattleMoves + lsls r2, r1, 1 + adds r2, r1 + lsls r2, 2 + adds r2, r3 + ldrb r1, [r2, 0x4] + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8069234 + + thumb_func_start sub_8069264 +sub_8069264: @ 8069264 + push {lr} + bl sub_8069270 + pop {r0} + bx r0 + thumb_func_end sub_8069264 + + thumb_func_start sub_8069270 +sub_8069270: @ 8069270 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r8, r0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr_encrypted + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, r8 + bl sub_80690C0 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r0, =gLevelUpLearnsetPointers + lsls r6, r4, 2 + adds r0, r6, r0 + ldr r0, [r0] + ldrh r1, [r0] + ldr r2, =0xffff0000 + lsrs r0, r2, 16 + cmp r1, r0 + beq _080692FC + mov r9, r2 + movs r3, 0 +_080692AE: + ldr r0, =gLevelUpLearnsetPointers + adds r7, r6, r0 + ldr r0, [r7] + adds r0, r3, r0 + ldrh r2, [r0] + movs r1, 0xFE + lsls r1, 8 + adds r0, r1, 0 + ands r0, r2 + mov r4, r10 + lsls r1, r4, 9 + cmp r0, r1 + bgt _080692FC + ldr r1, =0x000001ff + adds r0, r1, 0 + adds r4, r0, 0 + ands r4, r2 + mov r0, r8 + adds r1, r4, 0 + str r3, [sp] + bl pokemon_moveset_pad + lsls r0, 16 + mov r1, r9 + lsrs r5, r1, 16 + ldr r3, [sp] + cmp r0, r9 + bne _080692F0 + mov r0, r8 + adds r1, r4, 0 + bl sub_80694D0 + ldr r3, [sp] +_080692F0: + adds r3, 0x2 + ldr r0, [r7] + adds r0, r3, r0 + ldrh r0, [r0] + cmp r0, r5 + bne _080692AE +_080692FC: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8069270 + + thumb_func_start sub_8069318 +sub_8069318: @ 8069318 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r8, r0 + lsls r4, r1, 24 + lsrs r4, 24 + movs r0, 0 + str r0, [sp] + mov r0, r8 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + mov r0, r8 + movs r1, 0x38 + movs r2, 0 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + cmp r4, 0 + beq _080693B0 + ldr r4, =0x020244e8 + mov r1, sp + ldrb r1, [r1] + strb r1, [r4] + ldr r2, =gLevelUpLearnsetPointers + mov r5, r9 + lsls r3, r5, 2 + adds r5, r3, r2 + ldr r0, [r5] + ldrh r1, [r0] + movs r7, 0xFE + lsls r7, 8 + adds r0, r7, 0 + ands r0, r1 + adds r6, r4, 0 + mov r12, r2 + mov r1, r10 + lsls r4, r1, 9 + cmp r0, r4 + beq _080693D8 + adds r2, r6, 0 + ldr r0, =0x0000ffff + mov r12, r0 + adds r6, r7, 0 + adds r3, r5, 0 +_08069384: + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + ldrb r0, [r2] + ldr r1, [r3] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + cmp r1, r12 + bne _080693A8 + movs r0, 0 + b _08069404 + .pool +_080693A8: + adds r0, r6, 0 + ands r0, r1 + cmp r0, r4 + bne _08069384 +_080693B0: + ldr r3, =gLevelUpLearnsetPointers + mov r1, r9 + lsls r4, r1, 2 + adds r1, r4, r3 + ldr r2, =0x020244e8 + ldrb r0, [r2] + ldr r1, [r1] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0xFE + lsls r0, 8 + ands r0, r1 + mov r5, r10 + lsls r1, r5, 9 + adds r6, r2, 0 + mov r12, r3 + adds r3, r4, 0 + cmp r0, r1 + bne _08069402 +_080693D8: + ldr r2, =0x020244e2 + mov r0, r12 + adds r1, r3, r0 + ldrb r0, [r6] + ldr r1, [r1] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + ldr r0, =0x000001ff + ands r0, r1 + strh r0, [r2] + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] + ldrh r1, [r2] + mov r0, r8 + bl pokemon_moveset_pad_ + lsls r0, 16 + lsrs r0, 16 + str r0, [sp] +_08069402: + ldr r0, [sp] +_08069404: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8069318 + + thumb_func_start sub_8069424 +sub_8069424: @ 8069424 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + adds r6, r0, 0 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + movs r4, 0 + add r7, sp, 0x8 + add r0, sp, 0xC + mov r9, r0 + mov r5, sp +_08069440: + adds r1, r4, 0 + adds r1, 0xE + adds r0, r6, 0 + movs r2, 0 + bl pokemon_getattr + strh r0, [r5] + adds r1, r4, 0 + adds r1, 0x12 + adds r0, r6, 0 + movs r2, 0 + bl pokemon_getattr + adds r1, r7, r4 + strb r0, [r1] + adds r5, 0x2 + adds r4, 0x1 + cmp r4, 0x2 + ble _08069440 + adds r0, r6, 0 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + mov r1, r9 + strb r0, [r1] + ldrb r0, [r1] + lsrs r0, 2 + strb r0, [r1] + mov r0, sp + mov r2, r8 + strh r2, [r0, 0x6] + ldr r1, =gBattleMoves + mov r2, r8 + lsls r0, r2, 1 + add r0, r8 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x4] + strb r0, [r7, 0x3] + movs r4, 0 + mov r5, sp +_08069494: + adds r1, r4, 0 + adds r1, 0xD + adds r0, r6, 0 + adds r2, r5, 0 + bl pokemon_setattr + adds r1, r4, 0 + adds r1, 0x11 + adds r2, r7, r4 + adds r0, r6, 0 + bl pokemon_setattr + adds r5, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + ble _08069494 + adds r0, r6, 0 + movs r1, 0x15 + mov r2, r9 + bl pokemon_setattr + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8069424 + + thumb_func_start sub_80694D0 +sub_80694D0: @ 80694D0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + adds r6, r0, 0 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + movs r4, 0 + add r7, sp, 0x8 + add r0, sp, 0xC + mov r9, r0 + mov r5, sp +_080694EC: + adds r1, r4, 0 + adds r1, 0xE + adds r0, r6, 0 + movs r2, 0 + bl pokemon_getattr_encrypted + strh r0, [r5] + adds r1, r4, 0 + adds r1, 0x12 + adds r0, r6, 0 + movs r2, 0 + bl pokemon_getattr_encrypted + adds r1, r7, r4 + strb r0, [r1] + adds r5, 0x2 + adds r4, 0x1 + cmp r4, 0x2 + ble _080694EC + adds r0, r6, 0 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr_encrypted + mov r1, r9 + strb r0, [r1] + ldrb r0, [r1] + lsrs r0, 2 + strb r0, [r1] + mov r0, sp + mov r2, r8 + strh r2, [r0, 0x6] + ldr r1, =gBattleMoves + mov r2, r8 + lsls r0, r2, 1 + add r0, r8 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x4] + strb r0, [r7, 0x3] + movs r4, 0 + mov r5, sp +_08069540: + adds r1, r4, 0 + adds r1, 0xD + adds r0, r6, 0 + adds r2, r5, 0 + bl pokemon_setattr_encrypted + adds r1, r4, 0 + adds r1, 0x11 + adds r2, r7, r4 + adds r0, r6, 0 + bl pokemon_setattr_encrypted + adds r5, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + ble _08069540 + adds r0, r6, 0 + movs r1, 0x15 + mov r2, r9 + bl pokemon_setattr_encrypted + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80694D0 + + thumb_func_start sub_806957C +sub_806957C: @ 806957C + 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, 0x4] + str r2, [sp, 0x8] + ldr r0, [sp, 0x50] + ldr r1, [sp, 0x54] + ldr r2, [sp, 0x58] + ldr r4, [sp, 0x5C] + lsls r3, 16 + lsrs r3, 16 + str r3, [sp, 0xC] + lsls r0, 16 + lsrs r3, r0, 16 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x10] + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x14] + movs r5, 0 + cmp r3, 0 + bne _080695D4 + ldr r2, =0x020244e0 + ldr r1, =gBattleMoves + ldr r3, [sp, 0x8] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x1] + strh r0, [r2] + b _080695D8 + .pool +_080695D4: + ldr r0, =0x020244e0 + strh r3, [r0] +_080695D8: + cmp r7, 0 + bne _080695F8 + ldr r1, =gBattleMoves + ldr r7, [sp, 0x8] + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x2] + mov r10, r0 + b _08069602 + .pool +_080695F8: + movs r0, 0x3F + mov r10, r0 + mov r1, r10 + ands r1, r7 + mov r10, r1 +_08069602: + ldrh r7, [r6, 0x2] + ldr r2, [sp, 0x4] + ldrh r2, [r2, 0x4] + str r2, [sp, 0x18] + ldrh r3, [r6, 0x8] + mov r8, r3 + ldr r0, [sp, 0x4] + ldrh r0, [r0, 0xA] + str r0, [sp, 0x1C] + ldrh r0, [r6, 0x2E] + cmp r0, 0xAF + bne _08069634 + ldr r1, =0x02024404 + ldr r2, [sp, 0x10] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r3, [r0, 0x7] + mov r9, r3 + ldrb r0, [r0, 0x1A] + b _0806964A + .pool +_08069634: + ldrh r0, [r6, 0x2E] + bl itemid_get_x12 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldrh r0, [r6, 0x2E] + bl itemid_get_quality + lsls r0, 24 + lsrs r0, 24 +_0806964A: + str r0, [sp, 0x24] + ldr r1, [sp, 0x4] + ldrh r0, [r1, 0x2E] + cmp r0, 0xAF + bne _0806967E + ldr r1, =0x02024404 + ldr r2, [sp, 0x14] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x7] + str r0, [sp, 0x20] + b _08069694 + .pool +_0806966C: + ldr r0, [sp, 0x24] + adds r0, 0x64 + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r7, r0, 16 + b _0806977C +_0806967E: + ldr r3, [sp, 0x4] + ldrh r0, [r3, 0x2E] + bl itemid_get_x12 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x20] + ldr r1, [sp, 0x4] + ldrh r0, [r1, 0x2E] + bl itemid_get_quality +_08069694: + adds r0, r6, 0 + adds r0, 0x20 + ldrb r1, [r0] + str r0, [sp, 0x28] + cmp r1, 0x25 + beq _080696A4 + cmp r1, 0x4A + bne _080696A8 +_080696A4: + lsls r0, r7, 17 + lsrs r7, r0, 16 +_080696A8: + ldr r0, =0x00000867 + ldr r1, [sp, 0x10] + bl sub_8069ED8 + lsls r0, 24 + cmp r0, 0 + beq _080696C4 + movs r0, 0x6E + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r7, r0, 16 +_080696C4: + ldr r0, =0x0000086b + ldr r1, [sp, 0x14] + bl sub_8069ED8 + lsls r0, 24 + cmp r0, 0 + beq _080696E4 + movs r0, 0x6E + ldr r2, [sp, 0x18] + muls r0, r2 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x18] +_080696E4: + ldr r4, =0x0000086d + adds r0, r4, 0 + ldr r1, [sp, 0x10] + bl sub_8069ED8 + lsls r0, 24 + cmp r0, 0 + beq _08069708 + movs r0, 0x6E + mov r3, r8 + muls r3, r0 + adds r0, r3, 0 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 +_08069708: + adds r0, r4, 0 + ldr r1, [sp, 0x14] + bl sub_8069ED8 + lsls r0, 24 + cmp r0, 0 + beq _08069728 + movs r0, 0x6E + ldr r1, [sp, 0x1C] + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x1C] +_08069728: + movs r2, 0 + ldr r4, =gUnknown_08329D74 + ldr r3, [sp, 0x4] + adds r3, 0x20 + str r3, [sp, 0x2C] + adds r3, r4, 0 +_08069734: + lsls r1, r2, 1 + ldrb r0, [r3] + cmp r9, r0 + bne _08069774 + adds r0, r4, 0x1 + adds r0, r1, r0 + ldrb r0, [r0] + cmp r10, r0 + bne _08069774 + mov r1, r10 + cmp r1, 0x8 + bls _0806966C + ldr r0, [sp, 0x24] + adds r0, 0x64 + mov r2, r8 + muls r2, r0 + adds r0, r2, 0 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + b _0806977C + .pool +_08069774: + adds r3, 0x2 + adds r2, 0x1 + cmp r2, 0x10 + bls _08069734 +_0806977C: + mov r3, r9 + cmp r3, 0x1D + bne _08069790 + movs r0, 0x96 + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r7, r0, 16 +_08069790: + mov r0, r9 + cmp r0, 0x22 + bne _080697C6 + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x003f0100 + ands r0, r1 + cmp r0, 0 + bne _080697C6 + ldr r1, =0xfffffe69 + adds r0, r1, 0 + ldrh r2, [r6] + adds r0, r2 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _080697C6 + movs r0, 0x96 + mov r3, r8 + muls r3, r0 + adds r0, r3, 0 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 +_080697C6: + ldr r0, [sp, 0x20] + cmp r0, 0x22 + bne _080697FC + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x003f0100 + ands r0, r1 + cmp r0, 0 + bne _080697FC + ldr r1, =0xfffffe69 + adds r0, r1, 0 + ldr r2, [sp, 0x4] + ldrh r2, [r2] + adds r0, r2 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _080697FC + movs r0, 0x96 + ldr r3, [sp, 0x1C] + muls r0, r3 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x1C] +_080697FC: + mov r0, r9 + cmp r0, 0x23 + bne _08069812 + ldrh r1, [r6] + ldr r0, =0x00000175 + cmp r1, r0 + bne _08069812 + mov r1, r8 + lsls r0, r1, 17 + lsrs r0, 16 + mov r8, r0 +_08069812: + ldr r2, [sp, 0x20] + cmp r2, 0x24 + bne _0806982A + ldr r3, [sp, 0x4] + ldrh r1, [r3] + ldr r0, =0x00000175 + cmp r1, r0 + bne _0806982A + ldr r1, [sp, 0x1C] + lsls r0, r1, 17 + lsrs r0, 16 + str r0, [sp, 0x1C] +_0806982A: + mov r2, r9 + cmp r2, 0x2D + bne _0806983E + ldrh r0, [r6] + cmp r0, 0x19 + bne _0806983E + mov r3, r8 + lsls r0, r3, 17 + lsrs r0, 16 + mov r8, r0 +_0806983E: + ldr r0, [sp, 0x20] + cmp r0, 0x40 + bne _08069854 + ldr r1, [sp, 0x4] + ldrh r0, [r1] + cmp r0, 0x84 + bne _08069854 + ldr r2, [sp, 0x18] + lsls r0, r2, 17 + lsrs r0, 16 + str r0, [sp, 0x18] +_08069854: + mov r3, r9 + cmp r3, 0x41 + bne _0806986A + ldrh r0, [r6] + subs r0, 0x68 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _0806986A + lsls r0, r7, 17 + lsrs r7, r0, 16 +_0806986A: + ldr r1, [sp, 0x2C] + ldrb r0, [r1] + cmp r0, 0x2F + bne _08069882 + mov r2, r10 + cmp r2, 0xA + beq _0806987C + cmp r2, 0xF + bne _08069882 +_0806987C: + mov r3, r8 + lsrs r3, 1 + mov r8, r3 +_08069882: + ldr r0, [sp, 0x28] + ldrb r4, [r0] + cmp r4, 0x37 + bne _08069898 + movs r0, 0x96 + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r7, r0, 16 +_08069898: + cmp r4, 0x39 + bne _080698C6 + movs r0, 0 + str r0, [sp] + movs r0, 0xE + movs r1, 0 + movs r2, 0x3A + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _080698C6 + movs r0, 0x96 + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 +_080698C6: + ldr r2, [sp, 0x28] + ldrb r0, [r2] + cmp r0, 0x3A + bne _080698F8 + movs r0, 0 + str r0, [sp] + movs r0, 0xE + movs r1, 0 + movs r2, 0x39 + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _080698F8 + movs r0, 0x96 + mov r3, r8 + muls r3, r0 + adds r0, r3, 0 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 +_080698F8: + ldr r1, [sp, 0x28] + ldrb r0, [r1] + cmp r0, 0x3E + bne _08069914 + ldr r0, [r6, 0x4C] + cmp r0, 0 + beq _08069914 + movs r0, 0x96 + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r7, r0, 16 +_08069914: + ldr r2, [sp, 0x2C] + ldrb r0, [r2] + cmp r0, 0x3F + bne _08069936 + ldr r3, [sp, 0x4] + ldr r0, [r3, 0x4C] + cmp r0, 0 + beq _08069936 + movs r0, 0x96 + ldr r1, [sp, 0x18] + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x18] +_08069936: + mov r2, r10 + cmp r2, 0xD + bne _0806995A + movs r0, 0 + str r0, [sp] + movs r0, 0xE + movs r1, 0 + movs r2, 0 + movs r3, 0xFD + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _0806995A + ldr r1, =0x020244e0 + ldrh r0, [r1] + lsrs r0, 1 + strh r0, [r1] +_0806995A: + mov r3, r10 + cmp r3, 0xA + bne _0806997E + movs r0, 0 + str r0, [sp] + movs r0, 0xE + movs r1, 0 + movs r2, 0 + movs r3, 0xFE + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _0806997E + ldr r1, =0x020244e0 + ldrh r0, [r1] + lsrs r0, 1 + strh r0, [r1] +_0806997E: + mov r0, r10 + cmp r0, 0xC + bne _080699AE + ldr r1, [sp, 0x28] + ldrb r0, [r1] + cmp r0, 0x41 + bne _080699AE + ldrh r0, [r6, 0x2C] + movs r1, 0x3 + bl __udivsi3 + ldrh r1, [r6, 0x28] + lsls r0, 16 + lsrs r0, 16 + cmp r1, r0 + bhi _080699AE + ldr r4, =0x020244e0 + ldrh r1, [r4] + movs r0, 0x96 + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + strh r0, [r4] +_080699AE: + mov r2, r10 + cmp r2, 0xA + bne _080699DE + ldr r3, [sp, 0x28] + ldrb r0, [r3] + cmp r0, 0x42 + bne _080699DE + ldrh r0, [r6, 0x2C] + movs r1, 0x3 + bl __udivsi3 + ldrh r1, [r6, 0x28] + lsls r0, 16 + lsrs r0, 16 + cmp r1, r0 + bhi _080699DE + ldr r4, =0x020244e0 + ldrh r1, [r4] + movs r0, 0x96 + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + strh r0, [r4] +_080699DE: + mov r0, r10 + cmp r0, 0xB + bne _08069A0E + ldr r1, [sp, 0x28] + ldrb r0, [r1] + cmp r0, 0x43 + bne _08069A0E + ldrh r0, [r6, 0x2C] + movs r1, 0x3 + bl __udivsi3 + ldrh r1, [r6, 0x28] + lsls r0, 16 + lsrs r0, 16 + cmp r1, r0 + bhi _08069A0E + ldr r4, =0x020244e0 + ldrh r1, [r4] + movs r0, 0x96 + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + strh r0, [r4] +_08069A0E: + mov r2, r10 + cmp r2, 0x6 + bne _08069A3E + ldr r3, [sp, 0x28] + ldrb r0, [r3] + cmp r0, 0x44 + bne _08069A3E + ldrh r0, [r6, 0x2C] + movs r1, 0x3 + bl __udivsi3 + ldrh r1, [r6, 0x28] + lsls r0, 16 + lsrs r0, 16 + cmp r1, r0 + bhi _08069A3E + ldr r4, =0x020244e0 + ldrh r1, [r4] + movs r0, 0x96 + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + strh r0, [r4] +_08069A3E: + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0x7 + bne _08069A58 + ldr r0, [sp, 0x18] + lsrs r0, 1 + str r0, [sp, 0x18] +_08069A58: + mov r1, r10 + cmp r1, 0x8 + bls _08069A60 + b _08069BC2 +_08069A60: + ldr r0, =0x02024211 + ldrb r1, [r0] + adds r4, r0, 0 + cmp r1, 0x2 + bne _08069AA0 + movs r0, 0x19 + ldrsb r0, [r6, r0] + cmp r0, 0x6 + ble _08069A9C + ldr r2, =gUnknown_08329D2E + b _08069AA6 + .pool +_08069A9C: + adds r5, r7, 0 + b _08069ABE +_08069AA0: + ldr r2, =gUnknown_08329D2E + movs r0, 0x19 + ldrsb r0, [r6, r0] +_08069AA6: + lsls r0, 1 + adds r1, r0, r2 + ldrb r1, [r1] + adds r5, r7, 0 + muls r5, r1 + adds r2, 0x1 + adds r0, r2 + ldrb r1, [r0] + adds r0, r5, 0 + bl __divsi3 + adds r5, r0, 0 +_08069ABE: + ldr r0, =0x020244e0 + ldrh r0, [r0] + muls r5, r0 + adds r0, r6, 0 + adds r0, 0x2A + ldrb r0, [r0] + lsls r0, 1 + movs r1, 0x5 + bl __divsi3 + adds r0, 0x2 + muls r5, r0 + ldrb r0, [r4] + cmp r0, 0x2 + bne _08069AFC + ldr r2, [sp, 0x4] + movs r0, 0x1A + ldrsb r0, [r2, r0] + cmp r0, 0x5 + bgt _08069AF8 + ldr r2, =gUnknown_08329D2E + ldr r3, [sp, 0x4] + movs r0, 0x1A + ldrsb r0, [r3, r0] + b _08069B04 + .pool +_08069AF8: + ldr r3, [sp, 0x18] + b _08069B1E +_08069AFC: + ldr r2, =gUnknown_08329D2E + ldr r1, [sp, 0x4] + movs r0, 0x1A + ldrsb r0, [r1, r0] +_08069B04: + lsls r0, 1 + adds r1, r0, r2 + ldrb r1, [r1] + ldr r7, [sp, 0x18] + adds r3, r7, 0 + muls r3, r1 + adds r2, 0x1 + adds r0, r2 + ldrb r1, [r0] + adds r0, r3, 0 + bl __divsi3 + adds r3, r0, 0 +_08069B1E: + adds r0, r5, 0 + adds r1, r3, 0 + bl __divsi3 + adds r5, r0, 0 + movs r1, 0x32 + bl __divsi3 + adds r5, r0, 0 + ldr r0, [r6, 0x4C] + movs r1, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08069B48 + ldr r1, [sp, 0x28] + ldrb r0, [r1] + cmp r0, 0x3E + beq _08069B48 + lsrs r0, r5, 31 + adds r0, r5, r0 + asrs r5, r0, 1 +_08069B48: + movs r0, 0x1 + ldr r2, [sp, 0xC] + ands r0, r2 + cmp r0, 0 + beq _08069B8A + ldrb r1, [r4] + cmp r1, 0x1 + bne _08069B8A + ldr r0, =0x02022fec + ldr r0, [r0] + ands r0, r1 + cmp r0, 0 + beq _08069B84 + movs r0, 0x2 + bl sub_8069DEC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08069B84 + adds r0, r5, 0 + movs r1, 0x3 + bl __divsi3 + lsls r5, r0, 1 + b _08069B8A + .pool +_08069B84: + lsrs r0, r5, 31 + adds r0, r5, r0 + asrs r5, r0, 1 +_08069B8A: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08069BBC + ldr r0, =gBattleMoves + ldr r3, [sp, 0x8] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x6] + cmp r0, 0x8 + bne _08069BBC + movs r0, 0x2 + bl sub_8069DEC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08069BBC + lsrs r0, r5, 31 + adds r0, r5, r0 + asrs r5, r0, 1 +_08069BBC: + cmp r5, 0 + bne _08069BC2 + movs r5, 0x1 +_08069BC2: + mov r7, r10 + cmp r7, 0x9 + bne _08069BCA + movs r5, 0 +_08069BCA: + mov r0, r10 + cmp r0, 0x9 + bhi _08069BD2 + b _08069DD4 +_08069BD2: + ldr r0, =0x02024211 + ldrb r1, [r0] + adds r4, r0, 0 + cmp r1, 0x2 + bne _08069BFC + movs r0, 0x1C + ldrsb r0, [r6, r0] + cmp r0, 0x6 + ble _08069BF8 + ldr r2, =gUnknown_08329D2E + b _08069C02 + .pool +_08069BF8: + mov r5, r8 + b _08069C1A +_08069BFC: + ldr r2, =gUnknown_08329D2E + movs r0, 0x1C + ldrsb r0, [r6, r0] +_08069C02: + lsls r0, 1 + adds r1, r0, r2 + ldrb r1, [r1] + mov r5, r8 + muls r5, r1 + adds r2, 0x1 + adds r0, r2 + ldrb r1, [r0] + adds r0, r5, 0 + bl __divsi3 + adds r5, r0, 0 +_08069C1A: + ldr r0, =0x020244e0 + ldrh r0, [r0] + muls r5, r0 + adds r0, r6, 0 + adds r0, 0x2A + ldrb r0, [r0] + lsls r0, 1 + movs r1, 0x5 + bl __divsi3 + adds r0, 0x2 + muls r5, r0 + ldrb r0, [r4] + cmp r0, 0x2 + bne _08069C54 + ldr r1, [sp, 0x4] + movs r0, 0x1D + ldrsb r0, [r1, r0] + cmp r0, 0x5 + bgt _08069C50 + ldr r2, =gUnknown_08329D2E + b _08069C5C + .pool +_08069C50: + ldr r3, [sp, 0x1C] + b _08069C76 +_08069C54: + ldr r2, =gUnknown_08329D2E + ldr r7, [sp, 0x4] + movs r0, 0x1D + ldrsb r0, [r7, r0] +_08069C5C: + lsls r0, 1 + adds r1, r0, r2 + ldrb r1, [r1] + ldr r6, [sp, 0x1C] + adds r3, r6, 0 + muls r3, r1 + adds r2, 0x1 + adds r0, r2 + ldrb r1, [r0] + adds r0, r3, 0 + bl __divsi3 + adds r3, r0, 0 +_08069C76: + adds r0, r5, 0 + adds r1, r3, 0 + bl __divsi3 + adds r5, r0, 0 + movs r1, 0x32 + bl __divsi3 + adds r5, r0, 0 + movs r0, 0x2 + ldr r7, [sp, 0xC] + ands r0, r7 + cmp r0, 0 + beq _08069CCA + ldrb r1, [r4] + cmp r1, 0x1 + bne _08069CCA + ldr r0, =0x02022fec + ldr r0, [r0] + ands r0, r1 + cmp r0, 0 + beq _08069CC4 + movs r0, 0x2 + bl sub_8069DEC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08069CC4 + adds r0, r5, 0 + movs r1, 0x3 + bl __divsi3 + lsls r5, r0, 1 + b _08069CCA + .pool +_08069CC4: + lsrs r0, r5, 31 + adds r0, r5, r0 + asrs r5, r0, 1 +_08069CCA: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08069CFC + ldr r0, =gBattleMoves + ldr r2, [sp, 0x8] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x6] + cmp r0, 0x8 + bne _08069CFC + movs r0, 0x2 + bl sub_8069DEC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08069CFC + lsrs r0, r5, 31 + adds r0, r5, r0 + asrs r5, r0, 1 +_08069CFC: + movs r0, 0 + str r0, [sp] + movs r0, 0xE + movs r1, 0 + movs r2, 0xD + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08069DAC + str r0, [sp] + movs r0, 0xE + movs r1, 0 + movs r2, 0x4D + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + bne _08069DAC + ldr r2, =0x020243cc + ldrh r1, [r2] + movs r0, 0x1 + ands r0, r1 + adds r4, r2, 0 + cmp r0, 0 + beq _08069D64 + mov r3, r10 + cmp r3, 0xA + beq _08069D50 + cmp r3, 0xB + beq _08069D58 + b _08069D64 + .pool +_08069D50: + lsrs r0, r5, 31 + adds r0, r5, r0 + asrs r5, r0, 1 + b _08069D64 +_08069D58: + lsls r0, r5, 4 + subs r0, r5 + movs r1, 0xA + bl __divsi3 + adds r5, r0, 0 +_08069D64: + ldrh r1, [r4] + movs r0, 0x9F + ands r0, r1 + cmp r0, 0 + beq _08069D7C + ldr r0, =0x020241ea + ldrh r0, [r0] + cmp r0, 0x4C + bne _08069D7C + lsrs r0, r5, 31 + adds r0, r5, r0 + asrs r5, r0, 1 +_08069D7C: + ldrh r1, [r4] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _08069DAC + mov r6, r10 + cmp r6, 0xA + beq _08069D98 + cmp r6, 0xB + beq _08069DA6 + b _08069DAC + .pool +_08069D98: + lsls r0, r5, 4 + subs r0, r5 + movs r1, 0xA + bl __divsi3 + adds r5, r0, 0 + b _08069DAC +_08069DA6: + lsrs r0, r5, 31 + adds r0, r5, r0 + asrs r5, r0, 1 +_08069DAC: + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r0, [r0, 0x4] + ldr r7, [sp, 0x10] + lsls r1, r7, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08069DD4 + mov r0, r10 + cmp r0, 0xA + bne _08069DD4 + lsls r0, r5, 4 + subs r0, r5 + movs r1, 0xA + bl __divsi3 + adds r5, r0, 0 +_08069DD4: + adds r0, r5, 0x2 + add sp, 0x30 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806957C + + thumb_func_start sub_8069DEC +sub_8069DEC: @ 8069DEC + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + movs r6, 0 + cmp r0, 0x1 + beq _08069E40 + cmp r0, 0x1 + bgt _08069E04 + cmp r0, 0 + beq _08069E0A + b _08069EC2 +_08069E04: + cmp r1, 0x2 + beq _08069E88 + b _08069EC2 +_08069E0A: + movs r5, 0 + ldr r0, =0x02024064 + ldrb r3, [r0] + ldr r4, =0x02024210 + ldr r2, =gUnknown_0832A328 +_08069E14: + cmp r5, r3 + beq _08069E28 + ldrb r0, [r4] + ldr r1, [r2] + ands r0, r1 + cmp r0, 0 + bne _08069E28 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_08069E28: + adds r2, 0x4 + adds r5, 0x1 + cmp r5, 0x3 + ble _08069E14 + b _08069EC2 + .pool +_08069E40: + movs r5, 0 +_08069E42: + lsls r0, r5, 24 + lsrs r0, 24 + bl battle_side_get_owner + adds r4, r0, 0 + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _08069E74 + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + lsls r0, r5, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08069E74 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_08069E74: + adds r5, 0x1 + cmp r5, 0x3 + ble _08069E42 + b _08069EC2 + .pool +_08069E88: + movs r5, 0 +_08069E8A: + lsls r0, r5, 24 + lsrs r0, 24 + bl battle_side_get_owner + adds r4, r0, 0 + ldr r0, =0x0202420c + ldrb r0, [r0] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _08069EBC + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + lsls r0, r5, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08069EBC + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_08069EBC: + adds r5, 0x1 + cmp r5, 0x3 + ble _08069E8A +_08069EC2: + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8069DEC + + thumb_func_start sub_8069ED8 +sub_8069ED8: @ 8069ED8 + push {r4,r5,lr} + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 24 + lsrs r2, r1, 24 + ldr r4, =0x02022fec + ldr r0, [r4] + ldr r1, =0x023f0902 + ands r0, r1 + cmp r0, 0 + bne _08069F1C + adds r0, r2, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08069F1C + ldr r0, [r4] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08069F10 + ldr r0, =0x02038bca + ldrh r1, [r0] + movs r0, 0x80 + lsls r0, 3 + cmp r1, r0 + beq _08069F1C +_08069F10: + adds r0, r5, 0 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _08069F2C +_08069F1C: + movs r0, 0 + b _08069F2E + .pool +_08069F2C: + movs r0, 0x1 +_08069F2E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8069ED8 + + thumb_func_start sub_8069F34 +sub_8069F34: @ 8069F34 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + bl battle_get_per_side_status + movs r1, 0x1 + movs r6, 0x1 + adds r4, r6, 0 + ands r4, r0 + eors r4, r1 + adds r5, r4, 0 + ldr r0, =0x02022fec + ldr r0, [r0] + ands r0, r6 + cmp r0, 0 + bne _08069F5C + adds r0, r4, 0 + b _08069FA6 + .pool +_08069F5C: + movs r0, 0 + bl sub_8069DEC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _08069F80 + bl GenerateRandomNumber + adds r1, r6, 0 + ands r1, r0 + cmp r1, 0 + bne _08069F7C + movs r0, 0x2 + eors r0, r4 + b _08069FA6 +_08069F7C: + adds r0, r4, 0 + b _08069FA6 +_08069F80: + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + lsls r0, r4, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08069FA0 + adds r0, r4, 0 + b _08069FA6 + .pool +_08069FA0: + movs r0, 0x2 + eors r5, r0 + adds r0, r5, 0 +_08069FA6: + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8069F34 + + thumb_func_start pokemon_get_gender +pokemon_get_gender: @ 8069FB4 + push {lr} + bl pokemon_roll_gender + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end pokemon_get_gender + + thumb_func_start pokemon_roll_gender +pokemon_roll_gender: @ 8069FC4 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr_encrypted + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr_encrypted + adds r2, r0, 0 + ldr r1, =gBaseStats + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x10] + cmp r0, 0 + beq _0806A01A + cmp r0, 0 + blt _08069FFC + cmp r0, 0xFF + bgt _08069FFC + cmp r0, 0xFE + bge _0806A01A +_08069FFC: + ldr r1, =gBaseStats + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x10] + movs r0, 0xFF + ands r0, r2 + cmp r1, r0 + bhi _0806A018 + movs r0, 0 + b _0806A01A + .pool +_0806A018: + movs r0, 0xFE +_0806A01A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end pokemon_roll_gender + + thumb_func_start pokemon_species_get_gender_info +pokemon_species_get_gender_info: @ 806A020 + push {lr} + adds r3, r1, 0 + lsls r0, 16 + lsrs r2, r0, 16 + ldr r1, =gBaseStats + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x10] + cmp r0, 0 + beq _0806A062 + cmp r0, 0 + blt _0806A044 + cmp r0, 0xFF + bgt _0806A044 + cmp r0, 0xFE + bge _0806A062 +_0806A044: + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x10] + movs r0, 0xFF + ands r0, r3 + cmp r1, r0 + bhi _0806A060 + movs r0, 0 + b _0806A062 + .pool +_0806A060: + movs r0, 0xFE +_0806A062: + pop {r1} + bx r1 + thumb_func_end pokemon_species_get_gender_info + + thumb_func_start sub_806A068 +sub_806A068: @ 806A068 + push {r4-r7,lr} + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 24 + lsrs r4, r1, 24 + ldr r0, =0x020244d4 + ldr r2, [r0] + cmp r2, 0 + beq _0806A09C + ldr r0, =0x0202499c + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 3 + adds r1, r2, r1 + adds r2, r0, 0 + adds r1, 0x14 + ldm r1!, {r3,r6,r7} + stm r2!, {r3,r6,r7} + ldm r1!, {r3,r6,r7} + stm r2!, {r3,r6,r7} + adds r3, r0, 0 + b _0806A0DA + .pool +_0806A09C: + ldr r1, =0x020249b4 + ldr r0, [r1] + cmp r0, 0 + beq _0806A0B4 + ldr r3, =0x0202499c + ldr r2, [r0, 0xC] + b _0806A0C8 + .pool +_0806A0B4: + ldr r0, [r1, 0x4] + cmp r0, 0 + beq _0806A0C4 + ldr r3, =0x0202499c + ldr r2, [r0, 0xC] + b _0806A0C8 + .pool +_0806A0C4: + ldr r3, =0x0202499c + ldr r2, =gUnknown_08329D98 +_0806A0C8: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + adds r1, r3, 0 + adds r0, r2 + ldm r0!, {r2,r6,r7} + stm r1!, {r2,r6,r7} + ldm r0!, {r2,r6,r7} + stm r1!, {r2,r6,r7} +_0806A0DA: + adds r2, r3, 0 + strh r5, [r2, 0x2] + cmp r4, 0 + beq _0806A0E6 + cmp r4, 0x2 + bne _0806A0F8 +_0806A0E6: + ldr r0, =gUnknown_082FF70C + str r0, [r2, 0x8] + b _0806A122 + .pool +_0806A0F8: + movs r0, 0xFA + lsls r0, 1 + cmp r5, r0 + bls _0806A118 + ldr r0, =gUnknown_08309AAC + ldr r3, =0xfffffe0c + adds r1, r5, r3 + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x8] + b _0806A122 + .pool +_0806A118: + ldr r0, =gUnknown_08309AAC + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r3, 0x8] +_0806A122: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806A068 + + thumb_func_start template_build_for_pokemon_or_trainer +template_build_for_pokemon_or_trainer: @ 806A12C + push {r4-r6,lr} + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 24 + lsrs r3, r1, 24 + ldr r0, =0x0202499c + strh r4, [r0, 0x2] + adds r5, r0, 0 + cmp r3, 0 + beq _0806A144 + cmp r3, 0x2 + bne _0806A170 +_0806A144: + ldr r2, =gUnknown_08329DF8 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + adds r1, r5, 0 + adds r0, r2 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldr r1, =gUnknown_08305D0C + lsls r0, r4, 2 + adds r0, r1 + ldr r0, [r0] + b _0806A1B0 + .pool +_0806A170: + ldr r0, =0x020244d4 + ldr r1, [r0] + cmp r1, 0 + beq _0806A194 + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 3 + adds r0, r1, r0 + adds r1, r5, 0 + adds r0, 0x14 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + b _0806A1A8 + .pool +_0806A194: + ldr r0, =gUnknown_08329D98 + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 3 + adds r2, r5, 0 + adds r1, r0 + ldm r1!, {r0,r3,r6} + stm r2!, {r0,r3,r6} + ldm r1!, {r0,r3,r6} + stm r2!, {r0,r3,r6} +_0806A1A8: + ldr r0, =gUnknown_0830536C + lsls r1, r4, 2 + adds r1, r0 + ldr r0, [r1] +_0806A1B0: + str r0, [r5, 0x8] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end template_build_for_pokemon_or_trainer + + thumb_func_start sub_806A1C0 +sub_806A1C0: @ 806A1C0 + push {r4-r6,lr} + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 24 + lsrs r4, r1, 24 + ldr r0, =0x020244d4 + ldr r2, [r0] + cmp r2, 0 + beq _0806A1F4 + ldr r0, =0x0202499c + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 3 + adds r1, r2, r1 + adds r2, r0, 0 + adds r1, 0x14 + ldm r1!, {r3,r4,r6} + stm r2!, {r3,r4,r6} + ldm r1!, {r3,r4,r6} + stm r2!, {r3,r4,r6} + adds r3, r0, 0 + b _0806A20A + .pool +_0806A1F4: + ldr r3, =0x0202499c + ldr r2, =gUnknown_08329D98 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + adds r1, r3, 0 + adds r0, r2 + ldm r0!, {r2,r4,r6} + stm r1!, {r2,r4,r6} + ldm r0!, {r2,r4,r6} + stm r1!, {r2,r4,r6} +_0806A20A: + strh r5, [r3, 0x2] + ldr r0, =gUnknown_0830536C + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r3, 0x8] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806A1C0 + + thumb_func_start pokemon_encrypt +@ void pokemon_encrypt(pokemon *mon) +pokemon_encrypt: @ 806A228 + push {r4,lr} + adds r3, r0, 0 + movs r4, 0 + adds r2, r3, 0 + adds r2, 0x20 +_0806A232: + ldr r0, [r2] + ldr r1, [r3] + eors r0, r1 + str r0, [r2] + ldr r1, [r3, 0x4] + eors r0, r1 + stm r2!, {r0} + adds r4, 0x1 + cmp r4, 0xB + bls _0806A232 + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemon_encrypt + + thumb_func_start pokemon_decrypt +@ void pokemon_decrypt(pokemon *mon) +pokemon_decrypt: @ 806A24C + push {r4,lr} + adds r3, r0, 0 + movs r4, 0 + adds r2, r3, 0 + adds r2, 0x20 +_0806A256: + ldr r0, [r2] + ldr r1, [r3, 0x4] + eors r0, r1 + str r0, [r2] + ldr r1, [r3] + eors r0, r1 + stm r2!, {r0} + adds r4, 0x1 + cmp r4, 0xB + bls _0806A256 + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemon_decrypt + + thumb_func_start pokemon_data_permutator +@ int pokemon_data_permutator(pokemon *mon, int a2, u8 a3) +pokemon_data_permutator: @ 806A270 + push {r4-r6,lr} + adds r5, r0, 0 + adds r0, r1, 0 + lsls r2, 24 + lsrs r4, r2, 24 + movs r6, 0 + movs r1, 0x18 + bl __umodsi3 + cmp r0, 0x17 + bls _0806A288 + b _0806A510 +_0806A288: + lsls r0, 2 + ldr r1, =_0806A298 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0806A298: + .4byte _0806A2F8 + .4byte _0806A31C + .4byte _0806A338 + .4byte _0806A34E + .4byte _0806A364 + .4byte _0806A380 + .4byte _0806A396 + .4byte _0806A3AC + .4byte _0806A3BC + .4byte _0806A3DA + .4byte _0806A3F2 + .4byte _0806A402 + .4byte _0806A416 + .4byte _0806A428 + .4byte _0806A43A + .4byte _0806A44C + .4byte _0806A45E + .4byte _0806A470 + .4byte _0806A482 + .4byte _0806A498 + .4byte _0806A4AC + .4byte _0806A4BA + .4byte _0806A4CC + .4byte _0806A4E0 +_0806A2F8: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + bne _0806A302 + b _0806A508 +_0806A302: + cmp r4, 0x1 + bgt _0806A30E +_0806A306: + cmp r4, 0 + bne _0806A30C + b _0806A50E +_0806A30C: + b _0806A510 +_0806A30E: + cmp r4, 0x2 + bne _0806A314 + b _0806A502 +_0806A314: + cmp r4, 0x3 + beq _0806A31A + b _0806A510 +_0806A31A: + b _0806A4FC +_0806A31C: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + bne _0806A326 + b _0806A508 +_0806A326: + cmp r4, 0x1 + ble _0806A306 +_0806A32A: + cmp r4, 0x2 + bne _0806A330 + b _0806A4FC +_0806A330: + cmp r4, 0x3 + beq _0806A336 + b _0806A510 +_0806A336: + b _0806A502 +_0806A338: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + bne _0806A342 + b _0806A502 +_0806A342: + cmp r4, 0x1 + ble _0806A306 + cmp r4, 0x2 + bne _0806A34C + b _0806A508 +_0806A34C: + b _0806A314 +_0806A34E: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + bne _0806A358 + b _0806A4FC +_0806A358: + cmp r4, 0x1 + ble _0806A306 + cmp r4, 0x2 + bne _0806A362 + b _0806A508 +_0806A362: + b _0806A330 +_0806A364: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + bne _0806A36E + b _0806A502 +_0806A36E: + cmp r4, 0x1 + ble _0806A306 +_0806A372: + cmp r4, 0x2 + bne _0806A378 + b _0806A4FC +_0806A378: + cmp r4, 0x3 + beq _0806A37E + b _0806A510 +_0806A37E: + b _0806A508 +_0806A380: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + bne _0806A38A + b _0806A4FC +_0806A38A: + cmp r4, 0x1 + ble _0806A306 + cmp r4, 0x2 + bne _0806A394 + b _0806A502 +_0806A394: + b _0806A378 +_0806A396: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + bne _0806A3A0 + b _0806A50E +_0806A3A0: + cmp r4, 0x1 + bgt _0806A30E +_0806A3A4: + cmp r4, 0 + bne _0806A3AA + b _0806A508 +_0806A3AA: + b _0806A510 +_0806A3AC: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + bne _0806A3B6 + b _0806A50E +_0806A3B6: + cmp r4, 0x1 + ble _0806A3A4 + b _0806A32A +_0806A3BC: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + bne _0806A3C6 + b _0806A50E +_0806A3C6: + cmp r4, 0x1 + bgt _0806A3D2 +_0806A3CA: + cmp r4, 0 + bne _0806A3D0 + b _0806A502 +_0806A3D0: + b _0806A510 +_0806A3D2: + cmp r4, 0x2 + bne _0806A3D8 + b _0806A508 +_0806A3D8: + b _0806A314 +_0806A3DA: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + bne _0806A3E4 + b _0806A50E +_0806A3E4: + cmp r4, 0x1 + bgt _0806A3EA + b _0806A4EC +_0806A3EA: + cmp r4, 0x2 + bne _0806A3F0 + b _0806A508 +_0806A3F0: + b _0806A330 +_0806A3F2: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + bne _0806A3FC + b _0806A50E +_0806A3FC: + cmp r4, 0x1 + ble _0806A3CA + b _0806A372 +_0806A402: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + bne _0806A40C + b _0806A50E +_0806A40C: + cmp r4, 0x1 + ble _0806A4EC + cmp r4, 0x2 + beq _0806A502 + b _0806A378 +_0806A416: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + beq _0806A502 + cmp r4, 0x1 + ble _0806A3A4 + cmp r4, 0x2 + beq _0806A50E + b _0806A314 +_0806A428: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + beq _0806A4FC + cmp r4, 0x1 + ble _0806A3A4 + cmp r4, 0x2 + beq _0806A50E + b _0806A330 +_0806A43A: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + beq _0806A508 + cmp r4, 0x1 + ble _0806A3CA + cmp r4, 0x2 + beq _0806A50E + b _0806A314 +_0806A44C: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + beq _0806A508 + cmp r4, 0x1 + ble _0806A4EC + cmp r4, 0x2 + beq _0806A50E + b _0806A330 +_0806A45E: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + beq _0806A4FC + cmp r4, 0x1 + ble _0806A3CA + cmp r4, 0x2 + beq _0806A50E + b _0806A378 +_0806A470: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + beq _0806A502 + cmp r4, 0x1 + ble _0806A4EC + cmp r4, 0x2 + beq _0806A50E + b _0806A378 +_0806A482: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + beq _0806A502 + cmp r4, 0x1 + ble _0806A3A4 +_0806A48E: + cmp r4, 0x2 + beq _0806A4FC +_0806A492: + cmp r4, 0x3 + bne _0806A510 + b _0806A50E +_0806A498: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + beq _0806A4FC + cmp r4, 0x1 + bgt _0806A4A6 + b _0806A3A4 +_0806A4A6: + cmp r4, 0x2 + beq _0806A502 + b _0806A492 +_0806A4AC: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + beq _0806A508 + cmp r4, 0x1 + ble _0806A3CA + b _0806A48E +_0806A4BA: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + beq _0806A508 + cmp r4, 0x1 + ble _0806A4EC + cmp r4, 0x2 + beq _0806A502 + b _0806A492 +_0806A4CC: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + beq _0806A4FC + cmp r4, 0x1 + bgt _0806A4DA + b _0806A3CA +_0806A4DA: + cmp r4, 0x2 + beq _0806A508 + b _0806A492 +_0806A4E0: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + beq _0806A502 + cmp r4, 0x1 + bgt _0806A4F2 +_0806A4EC: + cmp r4, 0 + beq _0806A4FC + b _0806A510 +_0806A4F2: + cmp r4, 0x2 + beq _0806A508 + cmp r4, 0x3 + beq _0806A50E + b _0806A510 +_0806A4FC: + adds r6, r5, 0 + adds r6, 0x44 + b _0806A510 +_0806A502: + adds r6, r5, 0 + adds r6, 0x38 + b _0806A510 +_0806A508: + adds r6, r5, 0 + adds r6, 0x2C + b _0806A510 +_0806A50E: + adds r6, r0, 0 +_0806A510: + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end pokemon_data_permutator + + thumb_func_start pokemon_getattr +@ int pokemon_getattr(pokemon *mon, enum pokemon_data_request req, void *data) +pokemon_getattr: @ 806A518 + push {r4,lr} + adds r4, r0, 0 + adds r3, r1, 0 + adds r0, r3, 0 + subs r0, 0x37 + cmp r0, 0x21 + bls _0806A528 + b _0806A666 +_0806A528: + lsls r0, 2 + ldr r1, =_0806A538 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0806A538: + .4byte _0806A5C0 + .4byte _0806A5C4 + .4byte _0806A5CC + .4byte _0806A5D4 + .4byte _0806A5DC + .4byte _0806A5EE + .4byte _0806A600 + .4byte _0806A612 + .4byte _0806A624 + .4byte _0806A65E + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A636 + .4byte _0806A63E + .4byte _0806A646 + .4byte _0806A64E + .4byte _0806A656 +_0806A5C0: + ldr r0, [r4, 0x50] + b _0806A66E +_0806A5C4: + adds r0, r4, 0 + adds r0, 0x54 + ldrb r0, [r0] + b _0806A66E +_0806A5CC: + adds r0, r4, 0 + adds r0, 0x56 + ldrh r0, [r0] + b _0806A66E +_0806A5D4: + adds r0, r4, 0 + adds r0, 0x58 + ldrh r0, [r0] + b _0806A66E +_0806A5DC: + adds r0, r4, 0 + movs r1, 0x1 + bl get_pokemon_data_3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _0806A66E + b _0806A636 +_0806A5EE: + adds r0, r4, 0 + movs r1, 0x2 + bl get_pokemon_data_3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _0806A66E + b _0806A63E +_0806A600: + adds r0, r4, 0 + movs r1, 0x3 + bl get_pokemon_data_3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _0806A66E + b _0806A646 +_0806A612: + adds r0, r4, 0 + movs r1, 0x4 + bl get_pokemon_data_3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _0806A66E + b _0806A64E +_0806A624: + adds r0, r4, 0 + movs r1, 0x5 + bl get_pokemon_data_3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _0806A66E + b _0806A656 +_0806A636: + adds r0, r4, 0 + adds r0, 0x5A + ldrh r0, [r0] + b _0806A66E +_0806A63E: + adds r0, r4, 0 + adds r0, 0x5C + ldrh r0, [r0] + b _0806A66E +_0806A646: + adds r0, r4, 0 + adds r0, 0x5E + ldrh r0, [r0] + b _0806A66E +_0806A64E: + adds r0, r4, 0 + adds r0, 0x60 + ldrh r0, [r0] + b _0806A66E +_0806A656: + adds r0, r4, 0 + adds r0, 0x62 + ldrh r0, [r0] + b _0806A66E +_0806A65E: + adds r0, r4, 0 + adds r0, 0x55 + ldrb r0, [r0] + b _0806A66E +_0806A666: + adds r0, r4, 0 + adds r1, r3, 0 + bl pokemon_getattr_encrypted +_0806A66E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end pokemon_getattr + + thumb_func_start pokemon_getattr_encrypted +@ int pokemon_getattr_encrypted(pokemon *mon, enum pokemon_data_request req, void *data) +pokemon_getattr_encrypted: @ 806A674 + 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] + adds r6, r2, 0 + movs r4, 0 + mov r9, r4 + mov r10, r4 + movs r7, 0 + movs r5, 0 + cmp r1, 0xA + ble _0806A6F2 + ldr r1, [r0] + movs r2, 0 + bl pokemon_data_permutator + mov r9, r0 + mov r0, r8 + ldr r1, [r0] + movs r2, 0x1 + bl pokemon_data_permutator + mov r10, r0 + mov r2, r8 + ldr r1, [r2] + mov r0, r8 + movs r2, 0x2 + bl pokemon_data_permutator + adds r7, r0, 0 + mov r0, r8 + ldr r1, [r0] + movs r2, 0x3 + bl pokemon_data_permutator + adds r5, r0, 0 + mov r0, r8 + bl pokemon_decrypt + mov r0, r8 + bl pokemon_calc_checksum + lsls r0, 16 + lsrs r0, 16 + mov r1, r8 + ldrh r1, [r1, 0x1C] + cmp r0, r1 + beq _0806A6F2 + mov r2, r8 + ldrb r0, [r2, 0x13] + movs r1, 0x1 + orrs r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0x13] + ldrb r0, [r5, 0x7] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r5, 0x7] +_0806A6F2: + ldr r0, [sp] + cmp r0, 0x53 + bls _0806A6FA + b _0806AC8C +_0806A6FA: + lsls r0, 2 + ldr r1, =_0806A708 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0806A708: + .4byte _0806A858 + .4byte _0806A85E + .4byte _0806A864 + .4byte _0806A918 + .4byte _0806A91E + .4byte _0806A924 + .4byte _0806A92A + .4byte _0806A930 + .4byte _0806A94C + .4byte _0806A952 + .4byte _0806A958 + .4byte _0806A95E + .4byte _0806A976 + .4byte _0806A98E + .4byte _0806A98E + .4byte _0806A98E + .4byte _0806A98E + .4byte _0806A99A + .4byte _0806A99A + .4byte _0806A99A + .4byte _0806A99A + .4byte _0806A982 + .4byte _0806A9BC + .4byte _0806A9C0 + .4byte _0806A9C4 + .4byte _0806A97C + .4byte _0806A9A4 + .4byte _0806A9A8 + .4byte _0806A9AC + .4byte _0806A9B0 + .4byte _0806A9B4 + .4byte _0806A9B8 + .4byte _0806A988 + .4byte _0806A9C8 + .4byte _0806A9D4 + .4byte _0806A9D8 + .4byte _0806A9DC + .4byte _0806A9E4 + .4byte _0806A9EC + .4byte _0806A9F6 + .4byte _0806A9FE + .4byte _0806AA06 + .4byte _0806AA0E + .4byte _0806AA16 + .4byte _0806AA1E + .4byte _0806AA26 + .4byte _0806AA2A + .4byte _0806A9CC + .4byte _0806A9D0 + .4byte _0806A9F0 + .4byte _0806AA30 + .4byte _0806AA38 + .4byte _0806AA40 + .4byte _0806AA48 + .4byte _0806AA50 + .4byte _0806AC8C + .4byte _0806AC8C + .4byte _0806AC8C + .4byte _0806AC8C + .4byte _0806AC8C + .4byte _0806AC8C + .4byte _0806AC8C + .4byte _0806AC8C + .4byte _0806AC8C + .4byte _0806AC8C + .4byte _0806AAB6 + .4byte _0806AADC + .4byte _0806AA58 + .4byte _0806AA5E + .4byte _0806AA62 + .4byte _0806AA66 + .4byte _0806AA6A + .4byte _0806AA72 + .4byte _0806AA7A + .4byte _0806AA82 + .4byte _0806AA8A + .4byte _0806AA90 + .4byte _0806AA98 + .4byte _0806AAA0 + .4byte _0806AAA8 + .4byte _0806AAB0 + .4byte _0806AB16 + .4byte _0806AB70 + .4byte _0806ABF2 +_0806A858: + mov r1, r8 + ldr r4, [r1] + b _0806AC8C +_0806A85E: + mov r2, r8 + ldr r4, [r2, 0x4] + b _0806AC8C +_0806A864: + mov r0, r8 + ldrb r1, [r0, 0x13] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0806A89C + movs r4, 0 + ldr r0, =gUnknown_085CCB90 + ldrb r1, [r0] + adds r2, r0, 0 + cmp r1, 0xFF + beq _0806A944 + adds r3, r2, 0 +_0806A87E: + adds r0, r6, r4 + adds r1, r4, r3 + ldrb r1, [r1] + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x9 + bhi _0806A944 + adds r0, r4, r2 + ldrb r0, [r0] + cmp r0, 0xFF + bne _0806A87E + b _0806A944 + .pool +_0806A89C: + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0806A8BC + ldr r1, =gUnknown_085E8264 + adds r0, r6, 0 + bl CopyString + adds r0, r6, 0 + bl GetStringLength + lsls r0, 16 + lsrs r4, r0, 16 + b _0806AC8C + .pool +_0806A8BC: + mov r1, r8 + ldrb r0, [r1, 0x12] + cmp r0, 0x1 + bne _0806A902 + movs r0, 0xFC + strb r0, [r6] + movs r0, 0x15 + strb r0, [r6, 0x1] + movs r4, 0x2 + movs r3, 0 + ldrb r0, [r1, 0x8] + cmp r0, 0xFF + beq _0806A8F0 + mov r2, r8 + adds r2, 0x8 +_0806A8DA: + adds r1, r6, r4 + ldrb r0, [r2] + strb r0, [r1] + adds r4, 0x1 + adds r2, 0x1 + adds r3, 0x1 + cmp r3, 0x4 + bgt _0806A8F0 + ldrb r0, [r2] + cmp r0, 0xFF + bne _0806A8DA +_0806A8F0: + adds r1, r6, r4 + movs r0, 0xFC + strb r0, [r1] + adds r4, 0x1 + adds r1, r6, r4 + movs r0, 0x16 + strb r0, [r1] + adds r4, 0x1 + b _0806A944 +_0806A902: + movs r4, 0 + mov r2, r8 + adds r2, 0x8 +_0806A908: + adds r0, r6, r4 + adds r1, r2, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x9 + bls _0806A908 + b _0806A944 +_0806A918: + mov r2, r8 + ldrb r4, [r2, 0x12] + b _0806AC8C +_0806A91E: + mov r6, r8 + ldrb r0, [r6, 0x13] + b _0806AA92 +_0806A924: + mov r1, r8 + ldrb r0, [r1, 0x13] + b _0806AA9A +_0806A92A: + mov r2, r8 + ldrb r0, [r2, 0x13] + b _0806AAA2 +_0806A930: + movs r4, 0 + mov r2, r8 + adds r2, 0x14 +_0806A936: + adds r0, r6, r4 + adds r1, r2, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x6 + bls _0806A936 +_0806A944: + adds r1, r6, r4 + movs r0, 0xFF + strb r0, [r1] + b _0806AC8C +_0806A94C: + mov r6, r8 + ldrb r4, [r6, 0x1B] + b _0806AC8C +_0806A952: + mov r0, r8 + ldrh r4, [r0, 0x1C] + b _0806AC8C +_0806A958: + mov r1, r8 + ldrh r4, [r1, 0x1E] + b _0806AC8C +_0806A95E: + mov r2, r8 + ldrb r1, [r2, 0x13] + movs r0, 0x1 + ands r0, r1 + movs r4, 0xCE + lsls r4, 1 + cmp r0, 0 + beq _0806A970 + b _0806AC8C +_0806A970: + mov r6, r9 + ldrh r4, [r6] + b _0806AC8C +_0806A976: + mov r0, r9 + ldrh r4, [r0, 0x2] + b _0806AC8C +_0806A97C: + mov r1, r9 + ldr r4, [r1, 0x4] + b _0806AC8C +_0806A982: + mov r2, r9 + ldrb r4, [r2, 0x8] + b _0806AC8C +_0806A988: + mov r6, r9 + ldrb r4, [r6, 0x9] + b _0806AC8C +_0806A98E: + ldr r0, [sp] + subs r0, 0xD + lsls r0, 1 + add r0, r10 + ldrh r4, [r0] + b _0806AC8C +_0806A99A: + ldr r0, [sp] + add r0, r10 + subs r0, 0x9 + ldrb r4, [r0] + b _0806AC8C +_0806A9A4: + ldrb r4, [r7] + b _0806AC8C +_0806A9A8: + ldrb r4, [r7, 0x1] + b _0806AC8C +_0806A9AC: + ldrb r4, [r7, 0x2] + b _0806AC8C +_0806A9B0: + ldrb r4, [r7, 0x3] + b _0806AC8C +_0806A9B4: + ldrb r4, [r7, 0x4] + b _0806AC8C +_0806A9B8: + ldrb r4, [r7, 0x5] + b _0806AC8C +_0806A9BC: + ldrb r4, [r7, 0x6] + b _0806AC8C +_0806A9C0: + ldrb r4, [r7, 0x7] + b _0806AC8C +_0806A9C4: + ldrb r4, [r7, 0x8] + b _0806AC8C +_0806A9C8: + ldrb r4, [r7, 0x9] + b _0806AC8C +_0806A9CC: + ldrb r4, [r7, 0xA] + b _0806AC8C +_0806A9D0: + ldrb r4, [r7, 0xB] + b _0806AC8C +_0806A9D4: + ldrb r4, [r5] + b _0806AC8C +_0806A9D8: + ldrb r4, [r5, 0x1] + b _0806AC8C +_0806A9DC: + ldrb r0, [r5, 0x2] + lsls r0, 25 + lsrs r4, r0, 25 + b _0806AC8C +_0806A9E4: + ldrh r0, [r5, 0x2] + lsls r0, 21 + lsrs r4, r0, 28 + b _0806AC8C +_0806A9EC: + ldrb r0, [r5, 0x3] + b _0806AAAA +_0806A9F0: + ldrb r0, [r5, 0x3] + lsrs r4, r0, 7 + b _0806AC8C +_0806A9F6: + ldrb r0, [r5, 0x4] + lsls r0, 27 + lsrs r4, r0, 27 + b _0806AC8C +_0806A9FE: + ldrh r0, [r5, 0x4] + lsls r0, 22 + lsrs r4, r0, 27 + b _0806AC8C +_0806AA06: + ldrb r0, [r5, 0x5] + lsls r0, 25 + lsrs r4, r0, 27 + b _0806AC8C +_0806AA0E: + ldr r0, [r5, 0x4] + lsls r0, 12 + lsrs r4, r0, 27 + b _0806AC8C +_0806AA16: + ldrh r0, [r5, 0x6] + lsls r0, 23 + lsrs r4, r0, 27 + b _0806AC8C +_0806AA1E: + ldrb r0, [r5, 0x7] + lsls r0, 26 + lsrs r4, r0, 27 + b _0806AC8C +_0806AA26: + ldrb r0, [r5, 0x7] + b _0806AA84 +_0806AA2A: + ldrb r0, [r5, 0x7] + lsrs r4, r0, 7 + b _0806AC8C +_0806AA30: + ldrb r0, [r5, 0x8] + lsls r0, 29 + lsrs r4, r0, 29 + b _0806AC8C +_0806AA38: + ldrb r0, [r5, 0x8] + lsls r0, 26 + lsrs r4, r0, 29 + b _0806AC8C +_0806AA40: + ldrh r0, [r5, 0x8] + lsls r0, 23 + lsrs r4, r0, 29 + b _0806AC8C +_0806AA48: + ldrb r0, [r5, 0x9] + lsls r0, 28 + lsrs r4, r0, 29 + b _0806AC8C +_0806AA50: + ldrb r0, [r5, 0x9] + lsls r0, 25 + lsrs r4, r0, 29 + b _0806AC8C +_0806AA58: + ldrb r0, [r5, 0x9] + lsrs r4, r0, 7 + b _0806AC8C +_0806AA5E: + ldrb r0, [r5, 0xA] + b _0806AA92 +_0806AA62: + ldrb r0, [r5, 0xA] + b _0806AA9A +_0806AA66: + ldrb r0, [r5, 0xA] + b _0806AAA2 +_0806AA6A: + ldrb r0, [r5, 0xA] + lsls r0, 28 + lsrs r4, r0, 31 + b _0806AC8C +_0806AA72: + ldrb r0, [r5, 0xA] + lsls r0, 27 + lsrs r4, r0, 31 + b _0806AC8C +_0806AA7A: + ldrb r0, [r5, 0xA] + lsls r0, 26 + lsrs r4, r0, 31 + b _0806AC8C +_0806AA82: + ldrb r0, [r5, 0xA] +_0806AA84: + lsls r0, 25 + lsrs r4, r0, 31 + b _0806AC8C +_0806AA8A: + ldrb r0, [r5, 0xA] + lsrs r4, r0, 7 + b _0806AC8C +_0806AA90: + ldrb r0, [r5, 0xB] +_0806AA92: + lsls r0, 31 + lsrs r4, r0, 31 + b _0806AC8C +_0806AA98: + ldrb r0, [r5, 0xB] +_0806AA9A: + lsls r0, 30 + lsrs r4, r0, 31 + b _0806AC8C +_0806AAA0: + ldrb r0, [r5, 0xB] +_0806AAA2: + lsls r0, 29 + lsrs r4, r0, 31 + b _0806AC8C +_0806AAA8: + ldrb r0, [r5, 0xB] +_0806AAAA: + lsls r0, 25 + lsrs r4, r0, 28 + b _0806AC8C +_0806AAB0: + ldrb r0, [r5, 0xB] + lsrs r4, r0, 7 + b _0806AC8C +_0806AAB6: + mov r0, r9 + ldrh r4, [r0] + cmp r4, 0 + bne _0806AAC0 + b _0806AC8C +_0806AAC0: + ldrb r0, [r5, 0x7] + lsls r0, 25 + cmp r0, 0 + blt _0806AAD6 + mov r2, r8 + ldrb r1, [r2, 0x13] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0806AAD6 + b _0806AC8C +_0806AAD6: + movs r4, 0xCE + lsls r4, 1 + b _0806AC8C +_0806AADC: + ldrb r0, [r5, 0x4] + lsls r0, 27 + lsrs r4, r0, 27 + ldrh r1, [r5, 0x4] + movs r0, 0xF8 + lsls r0, 2 + ands r0, r1 + orrs r4, r0 + ldrb r0, [r5, 0x5] + lsls r0, 25 + lsrs r0, 27 + lsls r0, 10 + orrs r4, r0 + ldr r0, [r5, 0x4] + movs r1, 0xF8 + lsls r1, 12 + ands r0, r1 + orrs r4, r0 + ldrh r0, [r5, 0x6] + lsls r0, 23 + lsrs r0, 27 + lsls r0, 20 + orrs r4, r0 + ldrb r0, [r5, 0x7] + lsls r0, 26 + lsrs r0, 27 + lsls r0, 25 + orrs r4, r0 + b _0806AC8C +_0806AB16: + mov r1, r9 + ldrh r0, [r1] + cmp r0, 0 + bne _0806AB20 + b _0806AC8C +_0806AB20: + ldrb r0, [r5, 0x7] + lsls r0, 25 + cmp r0, 0 + bge _0806AB2A + b _0806AC8C +_0806AB2A: + ldrh r0, [r6] + ldr r1, =0x00000163 + cmp r0, r1 + bne _0806AB34 + b _0806AC8C +_0806AB34: + mov r2, r10 + ldrh r5, [r2] + adds r7, r1, 0 + adds r2, r6, 0 + ldr r1, =gUnknown_0832A328 +_0806AB3E: + ldrh r3, [r2] + cmp r5, r3 + beq _0806AB58 + mov r6, r10 + ldrh r0, [r6, 0x2] + cmp r0, r3 + beq _0806AB58 + ldrh r0, [r6, 0x4] + cmp r0, r3 + beq _0806AB58 + ldrh r0, [r6, 0x6] + cmp r0, r3 + bne _0806AB5C +_0806AB58: + ldr r0, [r1] + orrs r4, r0 +_0806AB5C: + adds r2, 0x2 + adds r1, 0x4 + ldrh r0, [r2] + cmp r0, r7 + bne _0806AB3E + b _0806AC8C + .pool +_0806AB70: + movs r4, 0 + mov r1, r9 + ldrh r0, [r1] + cmp r0, 0 + bne _0806AB7C + b _0806AC8C +_0806AB7C: + ldrb r0, [r5, 0x7] + lsls r0, 25 + cmp r0, 0 + bge _0806AB86 + b _0806AC8C +_0806AB86: + ldrb r0, [r5, 0x8] + lsls r1, r0, 29 + lsrs r4, r1, 29 + lsls r0, 26 + lsrs r0, 29 + adds r4, r0 + ldrh r0, [r5, 0x8] + lsls r0, 23 + lsrs r0, 29 + adds r4, r0 + ldrb r1, [r5, 0x9] + lsls r0, r1, 28 + lsrs r0, 29 + adds r4, r0 + lsls r0, r1, 25 + lsrs r0, 29 + adds r4, r0 + lsrs r1, 7 + adds r4, r1 + ldrb r1, [r5, 0xA] + lsls r0, r1, 31 + lsrs r0, 31 + adds r4, r0 + lsls r0, r1, 30 + lsrs r0, 31 + adds r4, r0 + lsls r0, r1, 29 + lsrs r0, 31 + adds r4, r0 + lsls r0, r1, 28 + lsrs r0, 31 + adds r4, r0 + lsls r0, r1, 27 + lsrs r0, 31 + adds r4, r0 + lsls r0, r1, 26 + lsrs r0, 31 + adds r4, r0 + lsls r0, r1, 25 + lsrs r0, 31 + adds r4, r0 + lsrs r1, 7 + adds r4, r1 + ldrb r1, [r5, 0xB] + lsls r0, r1, 31 + lsrs r0, 31 + adds r4, r0 + lsls r0, r1, 30 + lsrs r0, 31 + adds r4, r0 + lsls r1, 29 + lsrs r1, 31 + adds r4, r1 + b _0806AC8C +_0806ABF2: + movs r4, 0 + mov r2, r9 + ldrh r0, [r2] + cmp r0, 0 + beq _0806AC8C + ldrb r0, [r5, 0x7] + lsls r0, 25 + cmp r0, 0 + blt _0806AC8C + ldrb r2, [r5, 0x9] + lsrs r4, r2, 7 + ldrb r1, [r5, 0x8] + lsls r0, r1, 29 + lsrs r0, 28 + orrs r4, r0 + lsls r1, 26 + lsrs r1, 29 + lsls r1, 4 + orrs r4, r1 + ldrh r0, [r5, 0x8] + lsls r0, 23 + lsrs r0, 29 + lsls r0, 7 + orrs r4, r0 + lsls r0, r2, 28 + lsrs r0, 29 + lsls r0, 10 + orrs r4, r0 + lsls r2, 25 + lsrs r2, 29 + lsls r2, 13 + orrs r4, r2 + ldrb r1, [r5, 0xA] + lsls r0, r1, 31 + lsrs r0, 31 + lsls r0, 16 + orrs r4, r0 + lsls r0, r1, 30 + lsrs r0, 31 + lsls r0, 17 + orrs r4, r0 + lsls r0, r1, 29 + lsrs r0, 31 + lsls r0, 18 + orrs r4, r0 + lsls r0, r1, 28 + lsrs r0, 31 + lsls r0, 19 + orrs r4, r0 + lsls r0, r1, 27 + lsrs r0, 31 + lsls r0, 20 + orrs r4, r0 + lsls r0, r1, 26 + lsrs r0, 31 + lsls r0, 21 + orrs r4, r0 + lsls r0, r1, 25 + lsrs r0, 31 + lsls r0, 22 + orrs r4, r0 + lsrs r1, 7 + lsls r1, 23 + orrs r4, r1 + ldrb r1, [r5, 0xB] + lsls r0, r1, 31 + lsrs r0, 31 + lsls r0, 24 + orrs r4, r0 + lsls r0, r1, 30 + lsrs r0, 31 + lsls r0, 25 + orrs r4, r0 + lsls r1, 29 + lsrs r1, 31 + lsls r1, 26 + orrs r4, r1 +_0806AC8C: + ldr r6, [sp] + cmp r6, 0xA + ble _0806AC98 + mov r0, r8 + bl pokemon_encrypt +_0806AC98: + adds r0, r4, 0 + 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 pokemon_getattr_encrypted + + thumb_func_start pokemon_setattr +@ int pokemon_setattr(pokemon *mon, enum pokemon_data_request req, void *data) +pokemon_setattr: @ 806ACAC + push {lr} + adds r3, r0, 0 + adds r0, r1, 0 + subs r0, 0x37 + cmp r0, 0xA + bhi _0806AD90 + lsls r0, 2 + ldr r1, =_0806ACC8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0806ACC8: + .4byte _0806ACF4 + .4byte _0806AD0C + .4byte _0806AD16 + .4byte _0806AD26 + .4byte _0806AD36 + .4byte _0806AD46 + .4byte _0806AD56 + .4byte _0806AD66 + .4byte _0806AD76 + .4byte _0806AD86 + .4byte _0806AD96 +_0806ACF4: + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + adds r1, r0 + str r1, [r3, 0x50] + b _0806AD96 +_0806AD0C: + ldrb r1, [r2] + adds r0, r3, 0 + adds r0, 0x54 + strb r1, [r0] + b _0806AD96 +_0806AD16: + ldrb r0, [r2] + ldrb r1, [r2, 0x1] + lsls r1, 8 + adds r0, r1 + adds r1, r3, 0 + adds r1, 0x56 + strh r0, [r1] + b _0806AD96 +_0806AD26: + ldrb r0, [r2] + ldrb r1, [r2, 0x1] + lsls r1, 8 + adds r0, r1 + adds r1, r3, 0 + adds r1, 0x58 + strh r0, [r1] + b _0806AD96 +_0806AD36: + ldrb r0, [r2] + ldrb r1, [r2, 0x1] + lsls r1, 8 + adds r0, r1 + adds r1, r3, 0 + adds r1, 0x5A + strh r0, [r1] + b _0806AD96 +_0806AD46: + ldrb r0, [r2] + ldrb r1, [r2, 0x1] + lsls r1, 8 + adds r0, r1 + adds r1, r3, 0 + adds r1, 0x5C + strh r0, [r1] + b _0806AD96 +_0806AD56: + ldrb r0, [r2] + ldrb r1, [r2, 0x1] + lsls r1, 8 + adds r0, r1 + adds r1, r3, 0 + adds r1, 0x5E + strh r0, [r1] + b _0806AD96 +_0806AD66: + ldrb r0, [r2] + ldrb r1, [r2, 0x1] + lsls r1, 8 + adds r0, r1 + adds r1, r3, 0 + adds r1, 0x60 + strh r0, [r1] + b _0806AD96 +_0806AD76: + ldrb r0, [r2] + ldrb r1, [r2, 0x1] + lsls r1, 8 + adds r0, r1 + adds r1, r3, 0 + adds r1, 0x62 + strh r0, [r1] + b _0806AD96 +_0806AD86: + ldrb r1, [r2] + adds r0, r3, 0 + adds r0, 0x55 + strb r1, [r0] + b _0806AD96 +_0806AD90: + adds r0, r3, 0 + bl pokemon_setattr_encrypted +_0806AD96: + pop {r0} + bx r0 + thumb_func_end pokemon_setattr + + thumb_func_start pokemon_setattr_encrypted +@ int pokemon_setattr_encrypted(pokemon *mon, enum pokemon_data_request req, void *data) +pokemon_setattr_encrypted: @ 806AD9C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r7, r0, 0 + mov r10, r1 + adds r4, r2, 0 + movs r0, 0 + mov r8, r0 + mov r9, r0 + movs r6, 0 + movs r5, 0 + cmp r1, 0xA + ble _0806AE1C + ldr r1, [r7] + adds r0, r7, 0 + movs r2, 0 + bl pokemon_data_permutator + mov r8, r0 + ldr r1, [r7] + adds r0, r7, 0 + movs r2, 0x1 + bl pokemon_data_permutator + mov r9, r0 + ldr r1, [r7] + adds r0, r7, 0 + movs r2, 0x2 + bl pokemon_data_permutator + adds r6, r0, 0 + ldr r1, [r7] + adds r0, r7, 0 + movs r2, 0x3 + bl pokemon_data_permutator + adds r5, r0, 0 + adds r0, r7, 0 + bl pokemon_decrypt + adds r0, r7, 0 + bl pokemon_calc_checksum + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r7, 0x1C] + cmp r0, r1 + beq _0806AE1C + ldrb r0, [r7, 0x13] + movs r1, 0x1 + orrs r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r7, 0x13] + ldrb r0, [r5, 0x7] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r5, 0x7] + adds r0, r7, 0 + bl pokemon_encrypt + b _0806B3EC +_0806AE1C: + mov r0, r10 + cmp r0, 0x50 + bls _0806AE24 + b _0806B3D8 +_0806AE24: + lsls r0, 2 + ldr r1, =_0806AE34 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0806AE34: + .4byte _0806AF78 + .4byte _0806AF90 + .4byte _0806AFA8 + .4byte _0806AFBE + .4byte _0806AFC4 + .4byte _0806AFD4 + .4byte _0806AFE6 + .4byte _0806AFF8 + .4byte _0806B00E + .4byte _0806B014 + .4byte _0806B020 + .4byte _0806B02C + .4byte _0806B04C + .4byte _0806B084 + .4byte _0806B084 + .4byte _0806B084 + .4byte _0806B084 + .4byte _0806B098 + .4byte _0806B098 + .4byte _0806B098 + .4byte _0806B098 + .4byte _0806B074 + .4byte _0806B0C8 + .4byte _0806B0CE + .4byte _0806B0D4 + .4byte _0806B05A + .4byte _0806B0A4 + .4byte _0806B0AA + .4byte _0806B0B0 + .4byte _0806B0B6 + .4byte _0806B0BC + .4byte _0806B0C2 + .4byte _0806B07C + .4byte _0806B0DA + .4byte _0806B0EC + .4byte _0806B0F2 + .4byte _0806B0F8 + .4byte _0806B10C + .4byte _0806B124 + .4byte _0806B14A + .4byte _0806B15E + .4byte _0806B178 + .4byte _0806B18E + .4byte _0806B1A8 + .4byte _0806B1C0 + .4byte _0806B1D4 + .4byte _0806B204 + .4byte _0806B0E0 + .4byte _0806B0E6 + .4byte _0806B13A + .4byte _0806B214 + .4byte _0806B222 + .4byte _0806B238 + .4byte _0806B250 + .4byte _0806B260 + .4byte _0806B3D8 + .4byte _0806B3D8 + .4byte _0806B3D8 + .4byte _0806B3D8 + .4byte _0806B3D8 + .4byte _0806B3D8 + .4byte _0806B3D8 + .4byte _0806B3D8 + .4byte _0806B3D8 + .4byte _0806B3D8 + .4byte _0806B3D8 + .4byte _0806B35E + .4byte _0806B276 + .4byte _0806B286 + .4byte _0806B294 + .4byte _0806B2A4 + .4byte _0806B2B4 + .4byte _0806B2C4 + .4byte _0806B2D4 + .4byte _0806B2E4 + .4byte _0806B2FA + .4byte _0806B30A + .4byte _0806B318 + .4byte _0806B328 + .4byte _0806B338 + .4byte _0806B34E +_0806AF78: + ldrb r1, [r4] + ldrb r0, [r4, 0x1] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r4, 0x2] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r4, 0x3] + lsls r0, 24 + adds r1, r0 + str r1, [r7] + b _0806B3D8 +_0806AF90: + ldrb r1, [r4] + ldrb r0, [r4, 0x1] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r4, 0x2] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r4, 0x3] + lsls r0, 24 + adds r1, r0 + str r1, [r7, 0x4] + b _0806B3D8 +_0806AFA8: + movs r2, 0 + adds r3, r7, 0 + adds r3, 0x8 +_0806AFAE: + adds r0, r3, r2 + adds r1, r4, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x9 + ble _0806AFAE + b _0806B3D8 +_0806AFBE: + ldrb r0, [r4] + strb r0, [r7, 0x12] + b _0806B3D8 +_0806AFC4: + ldrb r0, [r4] + movs r1, 0x1 + ands r1, r0 + ldrb r2, [r7, 0x13] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + b _0806B1F2 +_0806AFD4: + ldrb r0, [r4] + movs r1, 0x1 + ands r1, r0 + lsls r1, 1 + ldrb r2, [r7, 0x13] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + b _0806B1F2 +_0806AFE6: + ldrb r0, [r4] + movs r1, 0x1 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r7, 0x13] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + b _0806B1F2 +_0806AFF8: + movs r2, 0 + adds r3, r7, 0 + adds r3, 0x14 +_0806AFFE: + adds r0, r3, r2 + adds r1, r4, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x6 + ble _0806AFFE + b _0806B3D8 +_0806B00E: + ldrb r0, [r4] + strb r0, [r7, 0x1B] + b _0806B3D8 +_0806B014: + ldrb r1, [r4] + ldrb r0, [r4, 0x1] + lsls r0, 8 + adds r1, r0 + strh r1, [r7, 0x1C] + b _0806B3D8 +_0806B020: + ldrb r1, [r4] + ldrb r0, [r4, 0x1] + lsls r0, 8 + adds r1, r0 + strh r1, [r7, 0x1E] + b _0806B3D8 +_0806B02C: + ldrb r1, [r4] + ldrb r0, [r4, 0x1] + lsls r0, 8 + adds r1, r0 + mov r0, r8 + strh r1, [r0] + lsls r1, 16 + cmp r1, 0 + beq _0806B044 + ldrb r0, [r7, 0x13] + movs r1, 0x2 + b _0806B1F2 +_0806B044: + ldrb r1, [r7, 0x13] + movs r0, 0x3 + negs r0, r0 + b _0806B1FE +_0806B04C: + ldrb r1, [r4] + ldrb r0, [r4, 0x1] + lsls r0, 8 + adds r1, r0 + mov r0, r8 + strh r1, [r0, 0x2] + b _0806B3D8 +_0806B05A: + ldrb r1, [r4] + ldrb r0, [r4, 0x1] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r4, 0x2] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r4, 0x3] + lsls r0, 24 + adds r1, r0 + mov r0, r8 + str r1, [r0, 0x4] + b _0806B3D8 +_0806B074: + ldrb r0, [r4] + mov r1, r8 + strb r0, [r1, 0x8] + b _0806B3D8 +_0806B07C: + ldrb r0, [r4] + mov r1, r8 + strb r0, [r1, 0x9] + b _0806B3D8 +_0806B084: + mov r2, r10 + subs r2, 0xD + lsls r2, 1 + add r2, r9 + ldrb r1, [r4] + ldrb r0, [r4, 0x1] + lsls r0, 8 + adds r1, r0 + strh r1, [r2] + b _0806B3D8 +_0806B098: + mov r0, r9 + add r0, r10 + subs r0, 0x9 + ldrb r1, [r4] + strb r1, [r0] + b _0806B3D8 +_0806B0A4: + ldrb r0, [r4] + strb r0, [r6] + b _0806B3D8 +_0806B0AA: + ldrb r0, [r4] + strb r0, [r6, 0x1] + b _0806B3D8 +_0806B0B0: + ldrb r0, [r4] + strb r0, [r6, 0x2] + b _0806B3D8 +_0806B0B6: + ldrb r0, [r4] + strb r0, [r6, 0x3] + b _0806B3D8 +_0806B0BC: + ldrb r0, [r4] + strb r0, [r6, 0x4] + b _0806B3D8 +_0806B0C2: + ldrb r0, [r4] + strb r0, [r6, 0x5] + b _0806B3D8 +_0806B0C8: + ldrb r0, [r4] + strb r0, [r6, 0x6] + b _0806B3D8 +_0806B0CE: + ldrb r0, [r4] + strb r0, [r6, 0x7] + b _0806B3D8 +_0806B0D4: + ldrb r0, [r4] + strb r0, [r6, 0x8] + b _0806B3D8 +_0806B0DA: + ldrb r0, [r4] + strb r0, [r6, 0x9] + b _0806B3D8 +_0806B0E0: + ldrb r0, [r4] + strb r0, [r6, 0xA] + b _0806B3D8 +_0806B0E6: + ldrb r0, [r4] + strb r0, [r6, 0xB] + b _0806B3D8 +_0806B0EC: + ldrb r0, [r4] + strb r0, [r5] + b _0806B3D8 +_0806B0F2: + ldrb r0, [r4] + strb r0, [r5, 0x1] + b _0806B3D8 +_0806B0F8: + ldrb r1, [r4] + movs r0, 0x7F + ands r1, r0 + ldrb r2, [r5, 0x2] + movs r0, 0x80 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x2] + b _0806B3D8 +_0806B10C: + ldrb r1, [r4] + movs r0, 0xF + ands r1, r0 + lsls r1, 7 + ldrh r2, [r5, 0x2] + ldr r0, =0xfffff87f + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x2] + b _0806B3D8 + .pool +_0806B124: + ldrb r1, [r4] + movs r0, 0xF + ands r1, r0 + lsls r1, 3 + ldrb r2, [r5, 0x3] + movs r0, 0x79 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x3] + b _0806B3D8 +_0806B13A: + ldrb r0, [r4] + lsls r0, 7 + ldrb r2, [r5, 0x3] + movs r1, 0x7F + ands r1, r2 + orrs r1, r0 + strb r1, [r5, 0x3] + b _0806B3D8 +_0806B14A: + ldrb r1, [r4] + movs r0, 0x1F + ands r1, r0 + ldrb r2, [r5, 0x4] + movs r0, 0x20 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x4] + b _0806B3D8 +_0806B15E: + ldrb r1, [r4] + movs r0, 0x1F + ands r1, r0 + lsls r1, 5 + ldrh r2, [r5, 0x4] + ldr r0, =0xfffffc1f + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x4] + b _0806B3D8 + .pool +_0806B178: + ldrb r1, [r4] + movs r0, 0x1F + ands r1, r0 + lsls r1, 2 + ldrb r2, [r5, 0x5] + movs r0, 0x7D + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] + b _0806B3D8 +_0806B18E: + ldrb r2, [r4] + movs r0, 0x1F + ands r2, r0 + lsls r2, 15 + ldr r0, [r5, 0x4] + ldr r1, =0xfff07fff + ands r0, r1 + orrs r0, r2 + str r0, [r5, 0x4] + b _0806B3D8 + .pool +_0806B1A8: + ldrb r1, [r4] + movs r0, 0x1F + ands r1, r0 + lsls r1, 4 + ldrh r2, [r5, 0x6] + ldr r0, =0xfffffe0f + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x6] + b _0806B3D8 + .pool +_0806B1C0: + ldrb r1, [r4] + movs r0, 0x1F + ands r1, r0 + lsls r1, 1 + ldrb r2, [r5, 0x7] + movs r0, 0x3F + negs r0, r0 + ands r0, r2 + orrs r0, r1 + b _0806B3D6 +_0806B1D4: + ldrb r1, [r4] + movs r0, 0x1 + ands r1, r0 + lsls r1, 6 + ldrb r2, [r5, 0x7] + movs r0, 0x41 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x7] + lsls r0, 25 + cmp r0, 0 + bge _0806B1F8 + ldrb r0, [r7, 0x13] + movs r1, 0x4 +_0806B1F2: + orrs r0, r1 + strb r0, [r7, 0x13] + b _0806B3D8 +_0806B1F8: + ldrb r1, [r7, 0x13] + movs r0, 0x5 + negs r0, r0 +_0806B1FE: + ands r0, r1 + strb r0, [r7, 0x13] + b _0806B3D8 +_0806B204: + ldrb r0, [r4] + lsls r0, 7 + ldrb r2, [r5, 0x7] + movs r1, 0x7F + ands r1, r2 + orrs r1, r0 + strb r1, [r5, 0x7] + b _0806B3D8 +_0806B214: + ldrb r1, [r4] + movs r0, 0x7 + ands r1, r0 + ldrb r2, [r5, 0x8] + movs r0, 0x8 + negs r0, r0 + b _0806B230 +_0806B222: + ldrb r1, [r4] + movs r0, 0x7 + ands r1, r0 + lsls r1, 3 + ldrb r2, [r5, 0x8] + movs r0, 0x39 + negs r0, r0 +_0806B230: + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x8] + b _0806B3D8 +_0806B238: + ldrb r1, [r4] + movs r0, 0x7 + ands r1, r0 + lsls r1, 6 + ldrh r2, [r5, 0x8] + ldr r0, =0xfffffe3f + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x8] + b _0806B3D8 + .pool +_0806B250: + ldrb r1, [r4] + movs r0, 0x7 + ands r1, r0 + lsls r1, 1 + ldrb r2, [r5, 0x9] + movs r0, 0xF + negs r0, r0 + b _0806B26E +_0806B260: + ldrb r1, [r4] + movs r0, 0x7 + ands r1, r0 + lsls r1, 4 + ldrb r2, [r5, 0x9] + movs r0, 0x71 + negs r0, r0 +_0806B26E: + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x9] + b _0806B3D8 +_0806B276: + ldrb r0, [r4] + lsls r0, 7 + ldrb r2, [r5, 0x9] + movs r1, 0x7F + ands r1, r2 + orrs r1, r0 + strb r1, [r5, 0x9] + b _0806B3D8 +_0806B286: + ldrb r1, [r4] + movs r0, 0x1 + ands r1, r0 + ldrb r2, [r5, 0xA] + movs r0, 0x2 + negs r0, r0 + b _0806B2F2 +_0806B294: + ldrb r1, [r4] + movs r0, 0x1 + ands r1, r0 + lsls r1, 1 + ldrb r2, [r5, 0xA] + movs r0, 0x3 + negs r0, r0 + b _0806B2F2 +_0806B2A4: + ldrb r1, [r4] + movs r0, 0x1 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r5, 0xA] + movs r0, 0x5 + negs r0, r0 + b _0806B2F2 +_0806B2B4: + ldrb r1, [r4] + movs r0, 0x1 + ands r1, r0 + lsls r1, 3 + ldrb r2, [r5, 0xA] + movs r0, 0x9 + negs r0, r0 + b _0806B2F2 +_0806B2C4: + ldrb r1, [r4] + movs r0, 0x1 + ands r1, r0 + lsls r1, 4 + ldrb r2, [r5, 0xA] + movs r0, 0x11 + negs r0, r0 + b _0806B2F2 +_0806B2D4: + ldrb r1, [r4] + movs r0, 0x1 + ands r1, r0 + lsls r1, 5 + ldrb r2, [r5, 0xA] + movs r0, 0x21 + negs r0, r0 + b _0806B2F2 +_0806B2E4: + ldrb r1, [r4] + movs r0, 0x1 + ands r1, r0 + lsls r1, 6 + ldrb r2, [r5, 0xA] + movs r0, 0x41 + negs r0, r0 +_0806B2F2: + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0xA] + b _0806B3D8 +_0806B2FA: + ldrb r0, [r4] + lsls r0, 7 + ldrb r2, [r5, 0xA] + movs r1, 0x7F + ands r1, r2 + orrs r1, r0 + strb r1, [r5, 0xA] + b _0806B3D8 +_0806B30A: + ldrb r1, [r4] + movs r0, 0x1 + ands r1, r0 + ldrb r2, [r5, 0xB] + movs r0, 0x2 + negs r0, r0 + b _0806B346 +_0806B318: + ldrb r1, [r4] + movs r0, 0x1 + ands r1, r0 + lsls r1, 1 + ldrb r2, [r5, 0xB] + movs r0, 0x3 + negs r0, r0 + b _0806B346 +_0806B328: + ldrb r1, [r4] + movs r0, 0x1 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r5, 0xB] + movs r0, 0x5 + negs r0, r0 + b _0806B346 +_0806B338: + ldrb r1, [r4] + movs r0, 0xF + ands r1, r0 + lsls r1, 3 + ldrb r2, [r5, 0xB] + movs r0, 0x79 + negs r0, r0 +_0806B346: + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0xB] + b _0806B3D8 +_0806B34E: + ldrb r0, [r4] + lsls r0, 7 + ldrb r2, [r5, 0xB] + movs r1, 0x7F + ands r1, r2 + orrs r1, r0 + strb r1, [r5, 0xB] + b _0806B3D8 +_0806B35E: + ldrb r3, [r4] + ldrb r0, [r4, 0x1] + lsls r0, 8 + orrs r3, r0 + ldrb r0, [r4, 0x2] + lsls r0, 16 + orrs r3, r0 + ldrb r0, [r4, 0x3] + lsls r0, 24 + orrs r3, r0 + movs r4, 0x1F + adds r1, r3, 0 + ands r1, r4 + ldrb r2, [r5, 0x4] + movs r0, 0x20 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x4] + lsrs r1, r3, 5 + ands r1, r4 + lsls r1, 5 + ldrh r2, [r5, 0x4] + ldr r0, =0xfffffc1f + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x4] + lsrs r1, r3, 10 + ands r1, r4 + lsls r1, 2 + ldrb r2, [r5, 0x5] + movs r0, 0x7D + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] + lsrs r1, r3, 15 + ands r1, r4 + lsls r1, 15 + ldr r0, [r5, 0x4] + ldr r2, =0xfff07fff + ands r0, r2 + orrs r0, r1 + str r0, [r5, 0x4] + lsrs r1, r3, 20 + ands r1, r4 + lsls r1, 4 + ldrh r2, [r5, 0x6] + ldr r0, =0xfffffe0f + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x6] + lsrs r3, 25 + ands r3, r4 + lsls r3, 1 + ldrb r1, [r5, 0x7] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + orrs r0, r3 +_0806B3D6: + strb r0, [r5, 0x7] +_0806B3D8: + mov r0, r10 + cmp r0, 0xA + ble _0806B3EC + adds r0, r7, 0 + bl pokemon_calc_checksum + strh r0, [r7, 0x1C] + adds r0, r7, 0 + bl pokemon_encrypt +_0806B3EC: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end pokemon_setattr_encrypted + + thumb_func_start memcpy_pokemon +@ void *memcpy_pokemon(void *dest, void *src, unsigned int size) +memcpy_pokemon: @ 806B408 + push {lr} + bl memcpy + pop {r0} + bx r0 + thumb_func_end memcpy_pokemon + + thumb_func_start pokemon_catch +@ int pokemon_catch(pokemon *mon) +pokemon_catch: @ 806B414 + push {r4-r6,lr} + adds r6, r0, 0 + ldr r4, =0x03005d90 + ldr r2, [r4] + movs r1, 0x7 + bl pokemon_setattr + ldr r2, [r4] + adds r2, 0x8 + adds r0, r6, 0 + movs r1, 0x31 + bl pokemon_setattr + ldr r2, [r4] + adds r2, 0xA + adds r0, r6, 0 + movs r1, 0x1 + bl pokemon_setattr + movs r5, 0 + b _0806B446 + .pool +_0806B444: + adds r5, 0x1 +_0806B446: + cmp r5, 0x5 + bgt _0806B480 + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + bne _0806B444 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0x64 + bl memcpy_pokemon + ldr r1, =0x020244e9 + adds r0, r5, 0x1 + strb r0, [r1] + movs r0, 0 + b _0806B48A + .pool +_0806B480: + adds r0, r6, 0 + bl pokemon_add_to_pc + lsls r0, 24 + lsrs r0, 24 +_0806B48A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end pokemon_catch + + thumb_func_start pokemon_add_to_pc +@ int pokemon_add_to_pc(pokemon *mon) +pokemon_add_to_pc: @ 806B490 + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + ldr r0, =0x00004036 + bl VarGet + lsls r0, 24 + lsrs r0, 24 + bl set_unknown_box_id + bl get_preferred_box + lsls r0, 24 + lsrs r5, r0, 24 +_0806B4AE: + movs r6, 0 + lsls r7, r5, 24 +_0806B4B2: + lsls r1, r6, 24 + lsrs r1, 24 + lsrs r0, r7, 24 + bl get_pokemon_by_box_and_pos + adds r4, r0, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr_encrypted + cmp r0, 0 + bne _0806B514 + mov r0, r8 + bl sub_806E924 + adds r0, r4, 0 + mov r1, r8 + movs r2, 0x50 + bl memcpy_pokemon + ldr r0, =0x020375f6 + strh r5, [r0] + ldr r0, =0x020375f8 + strh r6, [r0] + bl get_unknown_box_id + lsls r0, 16 + lsrs r0, 16 + cmp r0, r5 + beq _0806B4F4 + ldr r0, =0x000008d7 + bl FlagReset +_0806B4F4: + lsls r1, r5, 16 + ldr r0, =0x00004036 + lsrs r1, 16 + bl VarSet + movs r0, 0x1 + b _0806B530 + .pool +_0806B514: + adds r6, 0x1 + cmp r6, 0x1D + ble _0806B4B2 + adds r5, 0x1 + cmp r5, 0xE + bne _0806B522 + movs r5, 0 +_0806B522: + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + bne _0806B4AE + movs r0, 0x2 +_0806B530: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end pokemon_add_to_pc + + thumb_func_start calc_player_party_count +@ u8 calc_player_party_count() +calc_player_party_count: @ 806B53C + push {r4,lr} + ldr r0, =0x020244e9 + movs r1, 0 + strb r1, [r0] + b _0806B554 + .pool +_0806B54C: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + adds r0, r4, 0 +_0806B554: + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0x5 + bhi _0806B572 + adds r1, r0, 0 + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + bne _0806B54C +_0806B572: + ldrb r0, [r4] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end calc_player_party_count + + thumb_func_start calc_enemy_party_count +@ u8 calc_enemy_party_count() +calc_enemy_party_count: @ 806B580 + push {r4,lr} + ldr r0, =0x020244ea + movs r1, 0 + strb r1, [r0] + b _0806B598 + .pool +_0806B590: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + adds r0, r4, 0 +_0806B598: + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0x5 + bhi _0806B5B6 + adds r1, r0, 0 + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + bne _0806B590 +_0806B5B6: + ldrb r0, [r4] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end calc_enemy_party_count + + thumb_func_start sub_806B5C4 +sub_806B5C4: @ 806B5C4 + push {r4-r6,lr} + movs r6, 0 + bl calc_player_party_count + ldr r1, =0x020244e9 + ldrb r0, [r1] + cmp r0, 0x1 + beq _0806B628 + movs r5, 0 + ldrb r1, [r1] + cmp r6, r1 + bge _0806B620 +_0806B5DC: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _0806B616 + adds r0, r4, 0 + movs r1, 0x39 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + beq _0806B616 + adds r0, r4, 0 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + beq _0806B616 + adds r6, 0x1 +_0806B616: + adds r5, 0x1 + ldr r0, =0x020244e9 + ldrb r0, [r0] + cmp r5, r0 + blt _0806B5DC +_0806B620: + movs r0, 0 + cmp r6, 0x1 + bgt _0806B628 + movs r0, 0x2 +_0806B628: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806B5C4 + + thumb_func_start CheckPlayerPartySize +@ u8 CheckPlayerPartySize() +CheckPlayerPartySize: @ 806B638 + push {r4-r6,lr} + movs r6, 0 + movs r5, 0 +_0806B63E: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + beq _0806B670 + cmp r1, 0 + beq _0806B670 + adds r0, r4, 0 + movs r1, 0x39 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + beq _0806B670 + adds r6, 0x1 +_0806B670: + adds r5, 0x1 + cmp r5, 0x5 + ble _0806B63E + cmp r6, 0x1 + bne _0806B684 + movs r0, 0x1 + b _0806B68C + .pool +_0806B684: + movs r0, 0 + cmp r6, 0x1 + bgt _0806B68C + movs r0, 0x2 +_0806B68C: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end CheckPlayerPartySize + + thumb_func_start sub_806B694 +@ int sub_806B694(u16 a1, int a2) +sub_806B694: @ 806B694 + push {lr} + lsls r0, 16 + lsrs r3, r0, 16 + lsls r1, 24 + cmp r1, 0 + beq _0806B6B8 + ldr r2, =0x0202420a + ldr r1, =gBaseStats + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x17] + b _0806B6C6 + .pool +_0806B6B8: + ldr r2, =0x0202420a + ldr r1, =gBaseStats + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x16] +_0806B6C6: + strb r0, [r2] + ldrb r0, [r2] + pop {r1} + bx r1 + .pool + thumb_func_end sub_806B694 + + thumb_func_start GetMonAbility +@ u8 GetMonAbility(pokemon *mon) +GetMonAbility: @ 806B6D8 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x2E + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_806B694 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end GetMonAbility + + thumb_func_start create_enemy_party +create_enemy_party: @ 806B70C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + adds r5, r0, 0 + bl zero_enemy_party_data + ldr r4, =0x020244a8 + ldr r0, [r4] + ldr r0, [r0] + adds r1, r5, 0 + movs r2, 0xA0 + bl memcpy + movs r0, 0 + mov r9, r0 +_0806B730: + ldr r1, =0x020244a8 + ldr r3, [r1] + ldr r2, [r3] + mov r4, r9 + lsls r7, r4, 1 + adds r0, r2, 0 + adds r0, 0x7C + adds r1, r0, r7 + ldrh r0, [r1] + adds r4, 0x1 + str r4, [sp, 0x10] + cmp r0, 0 + beq _0806B80A + movs r0, 0x64 + mov r6, r9 + muls r6, r0 + ldr r4, =0x02024744 + mov r8, r4 + adds r5, r6, r4 + ldrh r1, [r1] + adds r0, r2, 0 + adds r0, 0x94 + add r0, r9 + ldrb r2, [r0] + movs r0, 0x1 + str r0, [sp] + ldr r0, [r3] + mov r3, r9 + lsls r4, r3, 2 + adds r0, 0x34 + adds r0, r4 + ldr r0, [r0] + str r0, [sp, 0x4] + movs r0, 0x2 + str r0, [sp, 0x8] + movs r0, 0 + str r0, [sp, 0xC] + adds r0, r5, 0 + movs r3, 0xF + bl create_pokemon_set_level + ldr r1, =0x020244a8 + ldr r0, [r1] + adds r1, r7, 0 + adds r1, 0x88 + ldr r2, [r0] + adds r2, r1 + adds r0, r5, 0 + movs r1, 0xC + bl pokemon_setattr + movs r5, 0 + mov r10, r4 + mov r7, r9 + adds r7, 0x9A + mov r4, r8 +_0806B7A0: + adds r1, r5, 0 + adds r1, 0x1A + ldr r2, =0x020244a8 + ldr r0, [r2] + ldr r2, [r0] + adds r2, r7 + adds r0, r6, r4 + bl pokemon_setattr + adds r5, 0x1 + cmp r5, 0x5 + ble _0806B7A0 + movs r5, 0 + movs r3, 0x64 + mov r0, r9 + muls r0, r3 + ldr r1, =0x02024744 + adds r7, r0, r1 + mov r4, r10 + lsls r0, r4, 1 + adds r6, r0, 0 + adds r6, 0x4C + adds r4, r0, 0 +_0806B7CE: + adds r1, r5, 0 + adds r1, 0xD + ldr r2, =0x020244a8 + ldr r0, [r2] + ldr r2, [r0] + adds r2, r6 + adds r0, r7, 0 + bl pokemon_setattr + adds r1, r5, 0 + adds r1, 0x11 + ldr r3, =0x020244a8 + ldr r0, [r3] + ldr r0, [r0] + adds r0, 0x4C + adds r0, r4 + ldrh r0, [r0] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + ldr r0, =gBattleMoves + 0x4 @ PP offset + adds r2, r0 + adds r0, r7, 0 + bl pokemon_setattr + adds r6, 0x2 + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _0806B7CE +_0806B80A: + ldr r4, [sp, 0x10] + mov r9, r4 + cmp r4, 0x5 + ble _0806B730 + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end create_enemy_party + + thumb_func_start sub_806B830 +sub_806B830: @ 806B830 + push {r4,r5,lr} + ldr r5, =gUnknown_08329EB8 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r4, [r0] + ldrb r0, [r4, 0x9] + movs r1, 0x5 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + ldrb r2, [r4, 0x1] + lsls r2, 27 + lsrs r2, 31 + lsls r1, r2, 2 + adds r1, r2 + adds r0, r1 + adds r0, r5 + ldrb r0, [r0] + ldr r1, =gTrainerPicIndices + adds r0, r1 + ldrb r0, [r0] + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806B830 + + thumb_func_start sub_806B870 +sub_806B870: @ 806B870 + push {r4,r5,lr} + ldr r5, =gUnknown_08329EB8 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r4, [r0] + ldrb r0, [r4, 0x9] + movs r1, 0x5 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + ldrb r2, [r4, 0x1] + lsls r2, 27 + lsrs r2, 31 + lsls r1, r2, 2 + adds r1, r2 + adds r0, r1 + adds r0, r5 + ldrb r0, [r0] + ldr r1, =gTrainerClassNameIndices + adds r0, r1 + ldrb r0, [r0] + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806B870 + + thumb_func_start sub_806B8B0 +sub_806B8B0: @ 806B8B0 + push {r4,lr} + movs r4, 0 +_0806B8B4: + movs r0, 0x64 + muls r0, r4 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + bne _0806B8D0 + movs r0, 0 + b _0806B8DE + .pool +_0806B8D0: + adds r4, 0x1 + cmp r4, 0x5 + ble _0806B8B4 + bl sub_806B8E4 + lsls r0, 24 + lsrs r0, 24 +_0806B8DE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_806B8B0 + + thumb_func_start sub_806B8E4 +sub_806B8E4: @ 806B8E4 + push {r4-r6,lr} + movs r6, 0 +_0806B8E8: + movs r4, 0 + lsls r5, r6, 24 +_0806B8EC: + lsls r1, r4, 24 + lsrs r1, 24 + lsrs r0, r5, 24 + movs r2, 0xB + bl get_pokemon_data_from_any_box + cmp r0, 0 + bne _0806B900 + movs r0, 0 + b _0806B90E +_0806B900: + adds r4, 0x1 + cmp r4, 0x1D + ble _0806B8EC + adds r6, 0x1 + cmp r6, 0xD + ble _0806B8E8 + movs r0, 0x1 +_0806B90E: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_806B8E4 + + thumb_func_start GetSpeciesName +@ void GetSpeciesName(u8 *dest, u16 speciesId) +GetSpeciesName: @ 806B914 + push {r4-r7,lr} + adds r6, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + movs r1, 0 + movs r0, 0xCE + lsls r0, 1 + mov r12, r0 + ldr r7, =gSpeciesNames + movs r0, 0xB + muls r0, r5 + adds r3, r0, r7 + adds r2, r6, 0 + b _0806B93A + .pool +_0806B934: + adds r3, 0x1 + adds r2, 0x1 + adds r1, 0x1 +_0806B93A: + adds r4, r6, r1 + cmp r1, 0xA + bgt _0806B954 + cmp r5, r12 + bls _0806B94A + adds r0, r1, r7 + ldrb r0, [r0] + b _0806B94C +_0806B94A: + ldrb r0, [r3] +_0806B94C: + strb r0, [r2] + ldrb r0, [r4] + cmp r0, 0xFF + bne _0806B934 +_0806B954: + movs r0, 0xFF + strb r0, [r4] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end GetSpeciesName + + thumb_func_start CalcPPWithPPUps +@ u16 CalcPPWithPPUps(u16 moveId, s32 ppUpCounts, u8 monMoveIndex) +CalcPPWithPPUps: @ 806B960 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + lsls r2, 24 + lsrs r2, 24 + ldr r4, =gBattleMoves + lsls r3, r0, 1 + adds r3, r0 + lsls r3, 2 + adds r3, r4 + ldrb r4, [r3, 0x4] + ldr r0, =gUnknown_08329D22 + adds r0, r2, r0 + ldrb r3, [r0] + ands r3, r1 + lsls r2, 1 + asrs r3, r2 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 2 + muls r0, r4 + movs r1, 0x64 + bl __divsi3 + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end CalcPPWithPPUps + + thumb_func_start sub_806B9A8 +sub_806B9A8: @ 806B9A8 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + lsls r4, r1, 24 + lsrs r4, 24 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + strb r0, [r1] + ldr r1, =gUnknown_08329D26 + adds r4, r1 + ldrb r1, [r4] + ands r1, r0 + mov r0, sp + strb r1, [r0] + adds r0, r5, 0 + movs r1, 0x15 + mov r2, sp + bl pokemon_setattr + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806B9A8 + + thumb_func_start sub_806B9E4 +sub_806B9E4: @ 806B9E4 + lsls r1, 24 + lsrs r1, 24 + adds r0, 0x3B + ldr r2, =gUnknown_08329D26 + adds r1, r2 + ldrb r2, [r0] + ldrb r1, [r1] + ands r1, r2 + strb r1, [r0] + bx lr + .pool + thumb_func_end sub_806B9E4 + + thumb_func_start battle_data_fill +battle_data_fill: @ 806B9FC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x14] + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + movs r0, 0x64 + mov r5, r9 + muls r5, r0 + ldr r0, =0x020244ec + adds r5, r0 + adds r0, r5, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + ldr r1, =0x02024084 + mov r8, r1 + movs r1, 0x58 + ldr r2, [sp, 0x14] + adds r4, r2, 0 + muls r4, r1 + mov r3, r8 + adds r6, r4, r3 + strh r0, [r6] + adds r0, r5, 0 + movs r1, 0xC + movs r2, 0 + bl pokemon_getattr + strh r0, [r6, 0x2E] + movs r6, 0 + mov r0, r8 + adds r0, 0x24 + adds r7, r4, r0 +_0806BA4E: + adds r1, r6, 0 + adds r1, 0xD + adds r0, r5, 0 + movs r2, 0 + bl pokemon_getattr + movs r1, 0xC + add r1, r8 + mov r10, r1 + adds r1, r4, r1 + strh r0, [r1] + adds r1, r6, 0 + adds r1, 0x11 + adds r0, r5, 0 + movs r2, 0 + bl pokemon_getattr + strb r0, [r7] + adds r7, 0x1 + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _0806BA4E + movs r0, 0x64 + mov r4, r9 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + movs r2, 0xC + negs r2, r2 + add r2, r10 + mov r9, r2 + movs r1, 0x58 + ldr r3, [sp, 0x14] + adds r5, r3, 0 + muls r5, r1 + adds r7, r5, r2 + adds r1, r7, 0 + adds r1, 0x3B + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x20 + movs r2, 0 + bl pokemon_getattr + adds r1, r7, 0 + adds r1, 0x2B + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x19 + movs r2, 0 + bl pokemon_getattr + mov r1, r10 + adds r1, 0x38 + adds r1, r5, r1 + str r0, [r1] + adds r0, r4, 0 + movs r1, 0x27 + movs r2, 0 + bl pokemon_getattr + movs r6, 0x1F + ands r0, r6 + ldrb r2, [r7, 0x14] + movs r1, 0x20 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r7, 0x14] + adds r0, r4, 0 + movs r1, 0x28 + movs r2, 0 + bl pokemon_getattr + movs r1, 0x1F + mov r8, r1 + mov r2, r8 + ands r0, r2 + lsls r0, 5 + ldrh r2, [r7, 0x14] + ldr r1, =0xfffffc1f + ands r1, r2 + orrs r1, r0 + strh r1, [r7, 0x14] + adds r0, r4, 0 + movs r1, 0x29 + movs r2, 0 + bl pokemon_getattr + ands r0, r6 + lsls r0, 2 + ldrb r2, [r7, 0x15] + movs r1, 0x7D + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r7, 0x15] + adds r0, r4, 0 + movs r1, 0x2A + movs r2, 0 + bl pokemon_getattr + movs r1, 0x1F + ands r1, r0 + lsls r1, 15 + ldr r0, [r7, 0x14] + ldr r2, =0xfff07fff + ands r0, r2 + orrs r0, r1 + str r0, [r7, 0x14] + adds r0, r4, 0 + movs r1, 0x2B + movs r2, 0 + bl pokemon_getattr + mov r3, r8 + ands r0, r3 + lsls r0, 4 + ldrh r2, [r7, 0x16] + ldr r1, =0xfffffe0f + ands r1, r2 + orrs r1, r0 + strh r1, [r7, 0x16] + adds r0, r4, 0 + movs r1, 0x2C + movs r2, 0 + bl pokemon_getattr + ands r0, r6 + lsls r0, 1 + ldrb r2, [r7, 0x17] + movs r1, 0x3F + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r7, 0x17] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + mov r1, r10 + adds r1, 0x3C + adds r1, r5, r1 + str r0, [r1] + adds r0, r4, 0 + movs r1, 0x37 + movs r2, 0 + bl pokemon_getattr + mov r1, r10 + adds r1, 0x40 + adds r1, r5, r1 + str r0, [r1] + adds r0, r4, 0 + movs r1, 0x38 + movs r2, 0 + bl pokemon_getattr + adds r1, r7, 0 + adds r1, 0x2A + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x39 + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0x28] + adds r0, r4, 0 + movs r1, 0x3A + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0x2C] + adds r0, r4, 0 + movs r1, 0x3B + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0x2] + adds r0, r4, 0 + movs r1, 0x3C + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0x4] + adds r0, r4, 0 + movs r1, 0x3D + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0x6] + adds r0, r4, 0 + movs r1, 0x3E + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0x8] + adds r0, r4, 0 + movs r1, 0x3F + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0xA] + adds r0, r4, 0 + movs r1, 0x2D + movs r2, 0 + bl pokemon_getattr + movs r1, 0x1 + ands r0, r1 + lsls r0, 6 + ldrb r2, [r7, 0x17] + movs r1, 0x41 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r7, 0x17] + adds r0, r4, 0 + movs r1, 0x2E + movs r2, 0 + bl pokemon_getattr + lsls r0, 7 + ldrb r2, [r7, 0x17] + movs r1, 0x7F + ands r1, r2 + orrs r1, r0 + strb r1, [r7, 0x17] + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl pokemon_getattr + mov r1, r10 + adds r1, 0x48 + adds r1, r5, r1 + str r0, [r1] + ldr r2, =gBaseStats + ldrh r1, [r7] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x6] + adds r1, r7, 0 + adds r1, 0x21 + strb r0, [r1] + ldrh r1, [r7] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x7] + adds r1, r7, 0 + adds r1, 0x22 + strb r0, [r1] + ldrh r0, [r7] + ldrb r1, [r7, 0x17] + lsrs r1, 7 + bl sub_806B694 + adds r1, r7, 0 + adds r1, 0x20 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + mov r0, r10 + adds r0, 0x24 + adds r0, r5, r0 + mov r1, sp + bl CopyString_Limit10 + mov r2, r10 + adds r2, 0x30 + adds r2, r5, r2 + adds r0, r4, 0 + movs r1, 0x7 + bl pokemon_getattr + ldr r0, [sp, 0x14] + bl battle_side_get_owner + ldr r1, =0x0202449c + lsls r0, 24 + lsrs r0, 23 + adds r0, 0xA8 + ldr r1, [r1] + adds r1, r0 + ldrh r0, [r7, 0x28] + strh r0, [r1] + movs r2, 0x6 + mov r1, r9 + movs r6, 0x7 + add r5, r10 + adds r0, r5, 0 + adds r0, 0x13 +_0806BCB2: + strb r2, [r0] + subs r0, 0x1 + subs r6, 0x1 + cmp r6, 0 + bge _0806BCB2 + movs r2, 0 + movs r0, 0x58 + ldr r3, [sp, 0x14] + muls r0, r3 + adds r1, 0x50 + adds r0, r1 + str r2, [r0] + ldr r0, [sp, 0x14] + bl sub_803FA70 + ldr r0, [sp, 0x14] + movs r1, 0 + bl sub_805EF84 + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end battle_data_fill + + thumb_func_start ExecuteTableBasedItemEffect_ +@ bool8 ExecuteTableBasedItemEffect_(struct pokemon *mon, u16 itemId, u8 a3, u8 monMoveIndex) +ExecuteTableBasedItemEffect_: @ 806BD04 + push {r4,lr} + sub sp, 0x4 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + movs r4, 0 + str r4, [sp] + bl ExecuteTableBasedItemEffect + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end ExecuteTableBasedItemEffect_ + + thumb_func_start ExecuteTableBasedItemEffect +@ bool8 ExecuteTableBasedItemEffect(struct pokemon *mon, u16 itemId, u8 a3, u8 monMoveIndex, u8 a5) +ExecuteTableBasedItemEffect: @ 806BD28 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x44 + mov r8, r0 + ldr r0, [sp, 0x64] + lsls r1, 16 + lsrs r1, 16 + str r1, [sp, 0xC] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x10] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x14] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x18] + movs r0, 0x1 + str r0, [sp, 0x20] + movs r1, 0x6 + str r1, [sp, 0x28] + movs r2, 0 + str r2, [sp, 0x30] + movs r3, 0x4 + str r3, [sp, 0x38] + movs r5, 0 + str r5, [sp, 0x3C] + mov r0, r8 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xAF + bne _0806BDBC + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806BDA8 + ldr r2, =0x02024404 + ldr r0, =0x020244b8 + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x7] + b _0806BDC4 + .pool +_0806BDA8: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x00003226 + adds r0, r2 + ldrb r0, [r0] + b _0806BDC4 + .pool +_0806BDBC: + bl itemid_get_x12 + lsls r0, 24 + lsrs r0, 24 +_0806BDC4: + str r0, [sp, 0x34] + ldr r1, =0x0202420f + ldr r0, =0x020244b8 + ldrb r2, [r0] + strb r2, [r1] + ldr r0, =0x030022c0 + ldr r3, =0x00000439 + adds r0, r3 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _0806BE64 + ldr r0, =0x02024064 + strb r2, [r0] + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + negs r1, r0 + orrs r1, r0 + lsrs r1, 31 + str r1, [sp, 0x1C] + ldr r0, =0x0202406c + ldr r4, [sp, 0xC] + subs r4, 0xD + ldrb r0, [r0] + cmp r1, r0 + bge _0806BE70 + ldr r2, =0x0202406e + lsls r0, r1, 1 + adds r0, r2 + ldrh r3, [r0] + ldr r5, [sp, 0x10] + lsls r0, r5, 16 + lsrs r1, r0, 16 + adds r5, r0, 0 + cmp r3, r1 + bne _0806BE3C + ldr r0, [sp, 0x1C] + str r0, [sp, 0x38] + b _0806BE70 + .pool +_0806BE3C: + ldr r1, [sp, 0x1C] + adds r1, 0x2 + str r1, [sp, 0x1C] + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r1, r0 + bge _0806BE70 + lsls r0, r1, 1 + adds r0, r2 + ldrh r1, [r0] + lsrs r0, r5, 16 + cmp r1, r0 + bne _0806BE3C + ldr r2, [sp, 0x1C] + lsls r0, r2, 24 + lsrs r0, 24 + str r0, [sp, 0x38] + b _0806BE70 + .pool +_0806BE64: + ldr r0, =0x02024064 + strb r1, [r0] + movs r3, 0x4 + str r3, [sp, 0x38] + ldr r4, [sp, 0xC] + subs r4, 0xD +_0806BE70: + lsls r0, r4, 16 + lsrs r0, 16 + cmp r0, 0xA5 + bhi _0806BEF0 + ldr r1, =gItemEffectInfoPointers + lsls r0, r4, 2 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + bne _0806BE94 + ldr r5, [sp, 0xC] + cmp r5, 0xAF + beq _0806BE9A + b _0806BEF0 + .pool +_0806BE94: + ldr r1, [sp, 0xC] + cmp r1, 0xAF + bne _0806BEF6 +_0806BE9A: + ldr r0, =0x030022c0 + ldr r2, =0x00000439 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806BECC + ldr r0, =0x02024064 + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r1, =0x0202440c + adds r0, r1 + b _0806BEF6 + .pool +_0806BECC: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r3, =0x00003214 + adds r3, r0, r3 + str r3, [sp, 0x24] + b _0806BEF8 + .pool +_0806BEE0: + mov r0, r8 + movs r2, 0 + ldr r3, [sp, 0x10] + bl sub_813DA40 + movs r0, 0 + bl _0806CD5C +_0806BEF0: + movs r0, 0x1 + bl _0806CD5C +_0806BEF6: + str r0, [sp, 0x24] +_0806BEF8: + movs r5, 0 + str r5, [sp, 0x1C] +_0806BEFC: + ldr r0, [sp, 0x1C] + cmp r0, 0x5 + bls _0806BF06 + bl _0806CD4C +_0806BF06: + lsls r0, 2 + ldr r1, =_0806BF14 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0806BF14: + .4byte _0806BF2C + .4byte _0806BFFC + .4byte _0806C08C + .4byte _0806C120 + .4byte _0806C300 + .4byte _0806C9BE +_0806BF2C: + ldr r1, [sp, 0x24] + ldr r3, [sp, 0x1C] + adds r2, r1, r3 + ldrb r1, [r2] + movs r0, 0x80 + ands r0, r1 + adds r6, r2, 0 + cmp r0, 0 + beq _0806BF76 + ldr r0, =0x030022c0 + ldr r5, =0x00000439 + adds r0, r5 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806BF76 + ldr r0, [sp, 0x38] + cmp r0, 0x4 + beq _0806BF76 + ldr r1, =0x02024084 + movs r0, 0x58 + ldr r2, [sp, 0x38] + muls r0, r2 + adds r1, 0x50 + adds r2, r0, r1 + ldr r1, [r2] + movs r0, 0xF0 + lsls r0, 12 + ands r0, r1 + cmp r0, 0 + beq _0806BF76 + ldr r0, =0xfff0ffff + ands r1, r0 + str r1, [r2] + movs r3, 0 + str r3, [sp, 0x20] +_0806BF76: + ldrb r1, [r6] + movs r0, 0x30 + ands r0, r1 + cmp r0, 0 + beq _0806BFA4 + ldr r1, =0x02024084 + ldr r0, =0x02024064 + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r2, r0, r1 + ldr r1, [r2] + movs r3, 0x80 + lsls r3, 13 + adds r0, r1, 0 + ands r0, r3 + cmp r0, 0 + bne _0806BFA4 + orrs r1, r3 + str r1, [r2] + movs r5, 0 + str r5, [sp, 0x20] +_0806BFA4: + ldrb r0, [r6] + movs r3, 0xF + ands r3, r0 + cmp r3, 0 + bne _0806BFB2 + bl _0806CD4C +_0806BFB2: + ldr r6, =0x02024084 + ldr r5, =0x02024064 + ldrb r0, [r5] + movs r4, 0x58 + muls r0, r4 + adds r1, r0, r6 + ldrb r2, [r1, 0x19] + movs r0, 0x19 + ldrsb r0, [r1, r0] + cmp r0, 0xB + ble _0806BFCC + bl _0806CD4C +_0806BFCC: + adds r0, r2, r3 + strb r0, [r1, 0x19] + ldrb r0, [r5] + muls r0, r4 + adds r1, r0, r6 + movs r0, 0x19 + ldrsb r0, [r1, r0] + cmp r0, 0xC + bgt _0806BFE0 + b _0806C110 +_0806BFE0: + movs r0, 0xC + strb r0, [r1, 0x19] + b _0806C110 + .pool +_0806BFFC: + ldr r1, [sp, 0x24] + ldr r3, [sp, 0x1C] + adds r2, r1, r3 + ldrb r1, [r2] + movs r0, 0xF0 + ands r0, r1 + lsls r3, r0, 24 + adds r6, r2, 0 + cmp r3, 0 + beq _0806C042 + ldr r7, =0x02024084 + ldr r5, =0x02024064 + ldrb r0, [r5] + movs r4, 0x58 + muls r0, r4 + adds r1, r0, r7 + ldrb r2, [r1, 0x1A] + movs r0, 0x1A + ldrsb r0, [r1, r0] + cmp r0, 0xB + bgt _0806C042 + lsrs r0, r3, 28 + adds r0, r2, r0 + strb r0, [r1, 0x1A] + ldrb r0, [r5] + muls r0, r4 + adds r1, r0, r7 + movs r0, 0x1A + ldrsb r0, [r1, r0] + cmp r0, 0xC + ble _0806C03E + movs r0, 0xC + strb r0, [r1, 0x1A] +_0806C03E: + movs r5, 0 + str r5, [sp, 0x20] +_0806C042: + ldrb r0, [r6] + movs r3, 0xF + ands r3, r0 + cmp r3, 0 + bne _0806C050 + bl _0806CD4C +_0806C050: + ldr r6, =0x02024084 + ldr r5, =0x02024064 + ldrb r0, [r5] + movs r4, 0x58 + muls r0, r4 + adds r1, r0, r6 + ldrb r2, [r1, 0x1B] + movs r0, 0x1B + ldrsb r0, [r1, r0] + cmp r0, 0xB + ble _0806C06A + bl _0806CD4C +_0806C06A: + adds r0, r2, r3 + strb r0, [r1, 0x1B] + ldrb r0, [r5] + muls r0, r4 + adds r1, r0, r6 + movs r0, 0x1B + ldrsb r0, [r1, r0] + cmp r0, 0xC + ble _0806C110 + movs r0, 0xC + strb r0, [r1, 0x1B] + b _0806C110 + .pool +_0806C08C: + ldr r1, [sp, 0x24] + ldr r3, [sp, 0x1C] + adds r2, r1, r3 + ldrb r1, [r2] + movs r0, 0xF0 + ands r0, r1 + lsls r3, r0, 24 + adds r6, r2, 0 + cmp r3, 0 + beq _0806C0D2 + ldr r7, =0x02024084 + ldr r5, =0x02024064 + ldrb r0, [r5] + movs r4, 0x58 + muls r0, r4 + adds r1, r0, r7 + ldrb r2, [r1, 0x1E] + movs r0, 0x1E + ldrsb r0, [r1, r0] + cmp r0, 0xB + bgt _0806C0D2 + lsrs r0, r3, 28 + adds r0, r2, r0 + strb r0, [r1, 0x1E] + ldrb r0, [r5] + muls r0, r4 + adds r1, r0, r7 + movs r0, 0x1E + ldrsb r0, [r1, r0] + cmp r0, 0xC + ble _0806C0CE + movs r0, 0xC + strb r0, [r1, 0x1E] +_0806C0CE: + movs r5, 0 + str r5, [sp, 0x20] +_0806C0D2: + ldrb r0, [r6] + movs r3, 0xF + ands r3, r0 + cmp r3, 0 + bne _0806C0E0 + bl _0806CD4C +_0806C0E0: + ldr r6, =0x02024084 + ldr r5, =0x02024064 + ldrb r0, [r5] + movs r4, 0x58 + muls r0, r4 + adds r1, r0, r6 + ldrb r2, [r1, 0x1C] + movs r0, 0x1C + ldrsb r0, [r1, r0] + cmp r0, 0xB + ble _0806C0FA + bl _0806CD4C +_0806C0FA: + adds r0, r2, r3 + strb r0, [r1, 0x1C] + ldrb r0, [r5] + muls r0, r4 + adds r1, r0, r6 + movs r0, 0x1C + ldrsb r0, [r1, r0] + cmp r0, 0xC + ble _0806C110 + movs r0, 0xC + strb r0, [r1, 0x1C] +_0806C110: + movs r0, 0 + str r0, [sp, 0x20] + bl _0806CD4C + .pool +_0806C120: + ldr r1, [sp, 0x24] + ldr r3, [sp, 0x1C] + adds r2, r1, r3 + ldrb r1, [r2] + movs r0, 0x80 + ands r0, r1 + adds r6, r2, 0 + cmp r0, 0 + beq _0806C168 + ldr r5, =0x02024294 + ldr r4, =0x02024064 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r0, [r1, 0x4] + cmp r0, 0 + bne _0806C168 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + movs r0, 0x5 + strb r0, [r1, 0x4] + movs r5, 0 + str r5, [sp, 0x20] +_0806C168: + ldrb r1, [r6] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0806C1CA + mov r0, r8 + movs r1, 0x38 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0x64 + beq _0806C1CA + ldr r5, =gExperienceTables + mov r0, r8 + movs r1, 0x38 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + mov r0, r8 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r4, 0x1 + lsls r4, 2 + ldr r2, =gBaseStats + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r1, [r1, 0x13] + movs r0, 0xCA + lsls r0, 1 + muls r0, r1 + adds r4, r0 + adds r4, r5 + ldr r0, [r4] + str r0, [sp] + mov r0, r8 + movs r1, 0x19 + mov r2, sp + bl pokemon_setattr + mov r0, r8 + bl pokemon_calc_effective_stats + movs r0, 0 + str r0, [sp, 0x20] +_0806C1CA: + ldrb r1, [r6] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0806C206 + mov r0, r8 + ldr r1, [sp, 0x10] + movs r2, 0x7 + ldr r3, [sp, 0x38] + bl HealStatusConditions + lsls r0, 24 + cmp r0, 0 + bne _0806C206 + ldr r1, [sp, 0x38] + cmp r1, 0x4 + beq _0806C202 + ldr r1, =0x02024084 + movs r0, 0x58 + ldr r3, [sp, 0x38] + adds r2, r3, 0 + muls r2, r0 + adds r1, 0x50 + adds r2, r1 + ldr r0, [r2] + ldr r1, =0xf7ffffff + ands r0, r1 + str r0, [r2] +_0806C202: + movs r5, 0 + str r5, [sp, 0x20] +_0806C206: + ldrb r1, [r6] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0806C226 + ldr r2, =0x00000f88 + mov r0, r8 + ldr r1, [sp, 0x10] + ldr r3, [sp, 0x38] + bl HealStatusConditions + lsls r0, 24 + cmp r0, 0 + bne _0806C226 + movs r0, 0 + str r0, [sp, 0x20] +_0806C226: + ldrb r1, [r6] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0806C246 + mov r0, r8 + ldr r1, [sp, 0x10] + movs r2, 0x10 + ldr r3, [sp, 0x38] + bl HealStatusConditions + lsls r0, 24 + cmp r0, 0 + bne _0806C246 + movs r1, 0 + str r1, [sp, 0x20] +_0806C246: + ldrb r1, [r6] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0806C266 + mov r0, r8 + ldr r1, [sp, 0x10] + movs r2, 0x20 + ldr r3, [sp, 0x38] + bl HealStatusConditions + lsls r0, 24 + cmp r0, 0 + bne _0806C266 + movs r2, 0 + str r2, [sp, 0x20] +_0806C266: + ldrb r1, [r6] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806C286 + mov r0, r8 + ldr r1, [sp, 0x10] + movs r2, 0x40 + ldr r3, [sp, 0x38] + bl HealStatusConditions + lsls r0, 24 + cmp r0, 0 + bne _0806C286 + movs r3, 0 + str r3, [sp, 0x20] +_0806C286: + ldrb r1, [r6] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0806C294 + bl _0806CD4C +_0806C294: + ldr r0, =0x030022c0 + ldr r5, =0x00000439 + adds r0, r5 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0806C2A8 + bl _0806CD4C +_0806C2A8: + ldr r0, [sp, 0x38] + cmp r0, 0x4 + bne _0806C2B2 + bl _0806CD4C +_0806C2B2: + ldr r1, =0x02024084 + movs r0, 0x58 + ldr r2, [sp, 0x38] + muls r0, r2 + adds r1, 0x50 + adds r2, r0, r1 + ldr r1, [r2] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + bne _0806C2CC + bl _0806CD4C +_0806C2CC: + movs r0, 0x8 + negs r0, r0 + ands r1, r0 + str r1, [r2] + movs r3, 0 + str r3, [sp, 0x20] + bl _0806CD4C + .pool +_0806C300: + ldr r5, [sp, 0x24] + ldr r1, [sp, 0x1C] + adds r0, r5, r1 + ldrb r0, [r0] + mov r10, r0 + movs r0, 0x20 + mov r2, r10 + ands r0, r2 + cmp r0, 0 + beq _0806C3D8 + movs r0, 0xDF + ands r2, r0 + mov r10, r2 + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + ldr r1, =gUnknown_08329D22 + ldr r3, [sp, 0x14] + adds r1, r3, r1 + ldrb r1, [r1] + ands r0, r1 + lsls r1, r3, 1 + lsrs r0, r1 + str r0, [sp] + adds r5, r3, 0 + adds r5, 0xD + mov r0, r8 + adds r1, r5, 0 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + ldr r2, [sp, 0x14] + bl CalcPPWithPPUps + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x2C] + ldr r0, [sp] + cmp r0, 0x2 + bhi _0806C3D8 + ldr r0, [sp, 0x2C] + cmp r0, 0x4 + bls _0806C3D8 + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + ldr r1, =gUnknown_08329D2A + ldr r2, [sp, 0x14] + adds r1, r2, r1 + ldrb r1, [r1] + adds r0, r1 + str r0, [sp] + mov r0, r8 + movs r1, 0x15 + mov r2, sp + bl pokemon_setattr + mov r0, r8 + adds r1, r5, 0 + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + ldr r1, [sp] + lsls r1, 24 + lsrs r1, 24 + ldr r2, [sp, 0x14] + bl CalcPPWithPPUps + lsls r0, 24 + lsrs r0, 24 + ldr r3, [sp, 0x2C] + subs r0, r3 + str r0, [sp] + ldr r4, [sp, 0x14] + adds r4, 0x11 + mov r0, r8 + adds r1, r4, 0 + movs r2, 0 + bl pokemon_getattr + ldr r1, [sp] + adds r0, r1 + str r0, [sp] + mov r0, r8 + adds r1, r4, 0 + mov r2, sp + bl pokemon_setattr + movs r5, 0 + str r5, [sp, 0x20] +_0806C3D8: + movs r0, 0 + str r0, [sp, 0x2C] + mov r1, r10 + cmp r1, 0 + bne _0806C3E6 + bl _0806CD4C +_0806C3E6: + movs r0, 0x1 + mov r2, r10 + ands r0, r2 + cmp r0, 0 + bne _0806C3F2 + b _0806C9AA +_0806C3F2: + ldr r3, [sp, 0x2C] + cmp r3, 0x7 + bls _0806C3FA + b _0806C9AA +_0806C3FA: + lsls r0, r3, 2 + ldr r1, =_0806C410 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0806C410: + .4byte _0806C430 + .4byte _0806C430 + .4byte _0806C4DC + .4byte _0806C700 + .4byte _0806C9AA + .4byte _0806C9AA + .4byte _0806C9AA + .4byte _0806C994 +_0806C430: + mov r0, r8 + bl sub_806DC8C + lsls r0, 16 + lsrs r6, r0, 16 + ldr r5, [sp, 0x24] + ldr r1, [sp, 0x28] + adds r0, r5, r1 + ldrb r5, [r0] + ldr r0, =gUnknown_08329EC2 + ldr r2, [sp, 0x2C] + adds r0, r2, r0 + ldrb r1, [r0] + mov r0, r8 + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + str r1, [sp, 0x4] + lsls r0, r5, 24 + asrs r2, r0, 24 + cmp r2, 0 + ble _0806C498 + ldr r0, =0x000001fd + cmp r6, r0 + bls _0806C466 + b _0806BEF0 +_0806C466: + adds r3, r1, 0 + cmp r3, 0x63 + ble _0806C46E + b _0806C9AA +_0806C46E: + adds r1, r3, r2 + cmp r1, 0x64 + ble _0806C484 + adds r0, r2, 0 + adds r0, 0x64 + subs r5, r0, r1 + b _0806C486 + .pool +_0806C484: + adds r5, r2, 0 +_0806C486: + adds r1, r6, r5 + movs r0, 0xFF + lsls r0, 1 + cmp r1, r0 + bls _0806C494 + adds r0, r5, r0 + subs r5, r0, r1 +_0806C494: + adds r0, r3, r5 + b _0806C4B2 +_0806C498: + cmp r1, 0 + bne _0806C4A8 + movs r3, 0x1 + str r3, [sp, 0x3C] + ldr r0, [sp, 0x28] + adds r0, 0x1 + lsls r0, 24 + b _0806C83E +_0806C4A8: + adds r0, r1, r2 + str r0, [sp, 0x4] + cmp r0, 0 + bge _0806C4B4 + movs r0, 0 +_0806C4B2: + str r0, [sp, 0x4] +_0806C4B4: + ldr r0, =gUnknown_08329EC2 + ldr r5, [sp, 0x2C] + adds r0, r5, r0 + ldrb r1, [r0] + add r2, sp, 0x4 + mov r0, r8 + bl pokemon_setattr + mov r0, r8 + bl pokemon_calc_effective_stats + ldr r0, [sp, 0x28] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x28] + b _0806C978 + .pool +_0806C4DC: + movs r0, 0x10 + mov r1, r10 + ands r0, r1 + cmp r0, 0 + beq _0806C59C + mov r0, r8 + movs r1, 0x39 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + beq _0806C4FC + ldr r0, [sp, 0x28] + adds r0, 0x1 + lsls r0, 24 + b _0806C83E +_0806C4FC: + ldr r0, =0x030022c0 + ldr r2, =0x00000439 + adds r0, r2 + ldrb r1, [r0] + movs r4, 0x2 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806C5B2 + ldr r3, [sp, 0x38] + cmp r3, 0x4 + beq _0806C55C + ldr r2, =0x02024210 + ldr r1, =gUnknown_0832A328 + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r0] + ldrb r0, [r2] + bics r0, r1 + strb r0, [r2] + ldr r1, =0x0202406e + lsls r0, r3, 1 + adds r0, r1 + ldrb r0, [r0] + bl pokemon_order_func + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, [sp, 0x38] + bl battle_data_fill + ldr r0, =0x02024064 + ldrb r0, [r0] + b _0806C574 + .pool +_0806C55C: + ldr r3, =0x02024210 + ldr r1, =gUnknown_0832A328 + ldr r2, =0x02024064 + ldrb r0, [r2] + eors r0, r4 + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldrb r0, [r3] + bics r0, r1 + strb r0, [r3] + ldrb r0, [r2] +_0806C574: + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0806C5B2 + ldr r1, =0x03005d10 + ldrb r0, [r1, 0x4] + cmp r0, 0xFE + bhi _0806C5B2 + adds r0, 0x1 + strb r0, [r1, 0x4] + b _0806C5B2 + .pool +_0806C59C: + mov r0, r8 + movs r1, 0x39 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + bne _0806C5B2 + ldr r0, [sp, 0x28] + adds r0, 0x1 + lsls r0, 24 + b _0806C83E +_0806C5B2: + ldr r1, [sp, 0x28] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x28] + ldr r5, [sp, 0x24] + adds r1, r5, r1 + ldrb r1, [r1] + str r1, [sp] + adds r0, r1, 0 + cmp r0, 0xFE + beq _0806C5F4 + cmp r0, 0xFE + bhi _0806C5D4 + cmp r0, 0xFD + beq _0806C60A + b _0806C612 +_0806C5D4: + cmp r1, 0xFF + bne _0806C612 + mov r0, r8 + movs r1, 0x3A + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + mov r0, r8 + movs r1, 0x39 + movs r2, 0 + bl pokemon_getattr + subs r4, r0 + str r4, [sp] + b _0806C612 +_0806C5F4: + mov r0, r8 + movs r1, 0x3A + movs r2, 0 + bl pokemon_getattr + lsrs r0, 1 + str r0, [sp] + cmp r0, 0 + bne _0806C612 + movs r0, 0x1 + b _0806C610 +_0806C60A: + ldr r0, =0x02024474 + adds r0, 0x23 + ldrb r0, [r0] +_0806C610: + str r0, [sp] +_0806C612: + mov r0, r8 + movs r1, 0x3A + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + mov r0, r8 + movs r1, 0x39 + movs r2, 0 + bl pokemon_getattr + cmp r4, r0 + beq _0806C6F0 + ldr r0, [sp, 0x18] + cmp r0, 0 + bne _0806C6E4 + mov r0, r8 + movs r1, 0x39 + movs r2, 0 + bl pokemon_getattr + ldr r1, [sp] + adds r0, r1 + str r0, [sp] + mov r0, r8 + movs r1, 0x3A + movs r2, 0 + bl pokemon_getattr + ldr r1, [sp] + cmp r1, r0 + bls _0806C65E + mov r0, r8 + movs r1, 0x3A + movs r2, 0 + bl pokemon_getattr + str r0, [sp] +_0806C65E: + mov r0, r8 + movs r1, 0x39 + mov r2, sp + bl pokemon_setattr + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806C6EC + ldr r2, [sp, 0x38] + cmp r2, 0x4 + beq _0806C6EC + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldr r1, [sp] + strh r1, [r0, 0x28] + movs r0, 0x10 + mov r3, r10 + ands r0, r3 + cmp r0, 0 + bne _0806C6EC + ldr r4, =0x02024064 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0806C6EC + ldr r1, =0x03005d10 + ldrb r0, [r1, 0x3] + cmp r0, 0xFE + bhi _0806C6AE + adds r0, 0x1 + strb r0, [r1, 0x3] +_0806C6AE: + ldrb r5, [r4] + add r0, sp, 0x38 + ldrb r0, [r0] + strb r0, [r4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl dp01_build_cmdbuf_x00_a_b_0 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + strb r5, [r4] + b _0806C6EC + .pool +_0806C6E4: + ldr r1, =0x020241f0 + ldr r0, [sp] + negs r0, r0 + str r0, [r1] +_0806C6EC: + movs r1, 0 + str r1, [sp, 0x20] +_0806C6F0: + movs r0, 0xEF + mov r2, r10 + ands r2, r0 + mov r10, r2 + b _0806C9AA + .pool +_0806C700: + movs r7, 0x2 + mov r0, r10 + ands r0, r7 + cmp r0, 0 + beq _0806C70C + b _0806C858 +_0806C70C: + movs r5, 0 + ldr r3, [sp, 0x28] + adds r3, 0x1 + str r3, [sp, 0x40] +_0806C714: + movs r0, 0x11 + adds r0, r5 + mov r9, r0 + mov r0, r8 + mov r1, r9 + movs r2, 0 + bl pokemon_getattr + str r0, [sp] + adds r7, r5, 0 + adds r7, 0xD + mov r0, r8 + adds r1, r7, 0 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r5, 24 + lsrs r6, r0, 24 + adds r0, r4, 0 + adds r2, r6, 0 + bl CalcPPWithPPUps + lsls r0, 24 + lsrs r0, 24 + ldr r1, [sp] + cmp r1, r0 + beq _0806C832 + ldr r2, [sp, 0x24] + ldr r3, [sp, 0x28] + adds r0, r2, r3 + ldrb r0, [r0] + adds r0, r1, r0 + str r0, [sp] + mov r0, r8 + adds r1, r7, 0 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + adds r2, r6, 0 + bl CalcPPWithPPUps + lsls r0, 24 + lsrs r0, 24 + ldr r1, [sp] + cmp r1, r0 + bls _0806C7CC + mov r0, r8 + adds r1, r7, 0 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + adds r2, r6, 0 + bl CalcPPWithPPUps + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] +_0806C7CC: + mov r0, r8 + mov r1, r9 + mov r2, sp + bl pokemon_setattr + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806C82E + ldr r2, [sp, 0x38] + cmp r2, 0x4 + beq _0806C82E + ldr r4, =0x02024084 + movs r0, 0x58 + adds r3, r2, 0 + muls r3, r0 + adds r0, r4, 0 + adds r0, 0x50 + adds r0, r3, r0 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 14 + ands r1, r0 + cmp r1, 0 + bne _0806C82E + ldr r1, =0x020242bc + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x18] + lsrs r1, 4 + ldr r2, =gUnknown_0832A328 + lsls r0, r5, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0806C82E + adds r0, r5, r3 + adds r1, r4, 0 + adds r1, 0x24 + adds r0, r1 + ldr r1, [sp] + strb r1, [r0] +_0806C82E: + movs r3, 0 + str r3, [sp, 0x20] +_0806C832: + adds r5, 0x1 + cmp r5, 0x3 + bgt _0806C83A + b _0806C714 +_0806C83A: + ldr r5, [sp, 0x40] + lsls r0, r5, 24 +_0806C83E: + lsrs r0, 24 + str r0, [sp, 0x28] + b _0806C9AA + .pool +_0806C858: + ldr r6, [sp, 0x14] + adds r6, 0x11 + mov r0, r8 + adds r1, r6, 0 + movs r2, 0 + bl pokemon_getattr + str r0, [sp] + ldr r5, [sp, 0x14] + adds r5, 0xD + mov r0, r8 + adds r1, r5, 0 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + ldr r2, [sp, 0x14] + bl CalcPPWithPPUps + lsls r0, 24 + lsrs r0, 24 + ldr r2, [sp] + cmp r2, r0 + bne _0806C8A0 + b _0806C9AA +_0806C8A0: + ldr r1, [sp, 0x28] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x28] + ldr r0, [sp, 0x24] + adds r1, r0, r1 + ldrb r0, [r1] + adds r0, r2, r0 + str r0, [sp] + mov r0, r8 + adds r1, r5, 0 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + ldr r2, [sp, 0x14] + bl CalcPPWithPPUps + lsls r0, 24 + lsrs r0, 24 + ldr r1, [sp] + cmp r1, r0 + bls _0806C914 + mov r0, r8 + adds r1, r5, 0 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + ldr r2, [sp, 0x14] + bl CalcPPWithPPUps + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] +_0806C914: + mov r0, r8 + adds r1, r6, 0 + mov r2, sp + bl pokemon_setattr + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _0806C978 + ldr r2, [sp, 0x38] + cmp r2, 0x4 + beq _0806C978 + ldr r4, =0x02024084 + movs r0, 0x58 + adds r3, r2, 0 + muls r3, r0 + adds r0, r4, 0 + adds r0, 0x50 + adds r0, r3, r0 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 14 + ands r0, r1 + cmp r0, 0 + bne _0806C978 + ldr r1, =0x020242bc + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x18] + lsrs r1, 4 + ldr r2, =gUnknown_0832A328 + ldr r5, [sp, 0x14] + lsls r0, r5, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0806C978 + adds r0, r5, r3 + adds r1, r4, 0 + adds r1, 0x24 + adds r0, r1 + ldr r1, [sp] + strb r1, [r0] +_0806C978: + movs r0, 0 + str r0, [sp, 0x20] + b _0806C9AA + .pool +_0806C994: + mov r0, r8 + movs r1, 0x2 + ldr r2, [sp, 0xC] + bl GetEvolutionTargetSpecies + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _0806C9AA + bl _0806BEE0 +_0806C9AA: + ldr r1, [sp, 0x2C] + adds r1, 0x1 + str r1, [sp, 0x2C] + mov r2, r10 + lsrs r2, 1 + mov r10, r2 + cmp r2, 0 + beq _0806C9BC + b _0806C3E6 +_0806C9BC: + b _0806CD4C +_0806C9BE: + ldr r3, [sp, 0x24] + ldr r5, [sp, 0x1C] + adds r0, r3, r5 + ldrb r0, [r0] + mov r10, r0 + movs r0, 0 + str r0, [sp, 0x2C] + mov r1, r10 + cmp r1, 0 + bne _0806C9D4 + b _0806CD4C +_0806C9D4: + movs r0, 0x1 + mov r2, r10 + ands r0, r2 + cmp r0, 0 + bne _0806C9E0 + b _0806CD3A +_0806C9E0: + ldr r3, [sp, 0x2C] + cmp r3, 0x7 + bls _0806C9E8 + b _0806CD3A +_0806C9E8: + lsls r0, r3, 2 + ldr r1, =_0806C9F8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0806C9F8: + .4byte _0806CA18 + .4byte _0806CA18 + .4byte _0806CA18 + .4byte _0806CA18 + .4byte _0806CAB8 + .4byte _0806CB94 + .4byte _0806CC00 + .4byte _0806CC68 +_0806CA18: + mov r0, r8 + bl sub_806DC8C + lsls r0, 16 + lsrs r6, r0, 16 + ldr r5, [sp, 0x24] + ldr r1, [sp, 0x28] + adds r0, r5, r1 + ldrb r5, [r0] + ldr r0, =gUnknown_08329EC2 + ldr r4, [sp, 0x2C] + adds r4, 0x2 + adds r0, r4, r0 + ldrb r1, [r0] + mov r0, r8 + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + str r1, [sp, 0x4] + lsls r0, r5, 24 + asrs r2, r0, 24 + cmp r2, 0 + ble _0806CA84 + ldr r0, =0x000001fd + cmp r6, r0 + bls _0806CA52 + bl _0806BEF0 +_0806CA52: + adds r3, r1, 0 + cmp r3, 0x63 + ble _0806CA5A + b _0806CD3A +_0806CA5A: + adds r1, r3, r2 + cmp r1, 0x64 + ble _0806CA70 + adds r0, r2, 0 + adds r0, 0x64 + subs r5, r0, r1 + b _0806CA72 + .pool +_0806CA70: + adds r5, r2, 0 +_0806CA72: + adds r1, r6, r5 + movs r0, 0xFF + lsls r0, 1 + cmp r1, r0 + bls _0806CA80 + adds r0, r5, r0 + subs r5, r0, r1 +_0806CA80: + adds r0, r3, r5 + b _0806CA98 +_0806CA84: + cmp r1, 0 + bne _0806CA8E + movs r2, 0x1 + str r2, [sp, 0x3C] + b _0806CD30 +_0806CA8E: + adds r0, r1, r2 + str r0, [sp, 0x4] + cmp r0, 0 + bge _0806CA9A + movs r0, 0 +_0806CA98: + str r0, [sp, 0x4] +_0806CA9A: + ldr r0, =gUnknown_08329EC2 + adds r0, r4, r0 + ldrb r1, [r0] + add r2, sp, 0x4 + mov r0, r8 + bl pokemon_setattr + mov r0, r8 + bl pokemon_calc_effective_stats + movs r3, 0 + str r3, [sp, 0x20] + b _0806CD30 + .pool +_0806CAB8: + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + ldr r1, =gUnknown_08329D22 + ldr r5, [sp, 0x14] + adds r1, r5, r1 + ldrb r1, [r1] + ands r0, r1 + lsls r1, r5, 1 + lsrs r0, r1 + str r0, [sp] + adds r6, r5, 0 + adds r6, 0xD + mov r0, r8 + adds r1, r6, 0 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + ldr r2, [sp, 0x14] + bl CalcPPWithPPUps + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [sp] + cmp r0, 0x2 + bls _0806CB0A + b _0806CD3A +_0806CB0A: + cmp r5, 0x4 + bhi _0806CB10 + b _0806CD3A +_0806CB10: + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + str r0, [sp] + ldr r1, =gUnknown_08329D26 + ldr r2, [sp, 0x14] + adds r1, r2, r1 + ldrb r2, [r1] + ands r2, r0 + str r2, [sp] + ldr r0, =gUnknown_08329D2A + ldr r3, [sp, 0x14] + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + adds r2, r0 + str r2, [sp] + mov r0, r8 + movs r1, 0x15 + mov r2, sp + bl pokemon_setattr + mov r0, r8 + adds r1, r6, 0 + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + ldr r1, [sp] + lsls r1, 24 + lsrs r1, 24 + ldr r2, [sp, 0x14] + bl CalcPPWithPPUps + lsls r0, 24 + lsrs r0, 24 + subs r0, r5 + str r0, [sp] + ldr r4, [sp, 0x14] + adds r4, 0x11 + mov r0, r8 + adds r1, r4, 0 + movs r2, 0 + bl pokemon_getattr + ldr r1, [sp] + adds r0, r1 + str r0, [sp] + mov r0, r8 + adds r1, r4, 0 + mov r2, sp + bl pokemon_setattr + movs r5, 0 + str r5, [sp, 0x20] + b _0806CD3A + .pool +_0806CB94: + mov r0, r8 + movs r1, 0x20 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0x63 + bls _0806CBA4 + b _0806CD30 +_0806CBA4: + ldr r0, [sp, 0x20] + cmp r0, 0 + beq _0806CBB2 + ldr r1, [sp, 0x3C] + cmp r1, 0 + bne _0806CBB2 + b _0806CD30 +_0806CBB2: + bl sub_806F104 + lsls r0, 24 + cmp r0, 0 + beq _0806CBBE + b _0806CD30 +_0806CBBE: + ldr r2, [sp, 0x30] + cmp r2, 0 + beq _0806CBC6 + b _0806CD30 +_0806CBC6: + ldr r3, [sp, 0x24] + ldr r5, [sp, 0x28] + adds r0, r3, r5 + ldrb r0, [r0] + str r0, [sp, 0x30] + mov r0, r8 + movs r1, 0x20 + movs r2, 0 + bl pokemon_getattr + adds r5, r0, 0 + str r5, [sp, 0x8] + ldr r0, [sp, 0x30] + lsls r4, r0, 24 + asrs r1, r4, 24 + cmp r1, 0 + ble _0806CCCC + ldr r2, [sp, 0x34] + cmp r2, 0x1B + bne _0806CCCC + movs r0, 0x96 + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + adds r0, r5, r0 + str r0, [sp, 0x8] + adds r2, r4, 0 + b _0806CCD8 +_0806CC00: + mov r0, r8 + movs r1, 0x20 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0x63 + bhi _0806CC10 + b _0806CD30 +_0806CC10: + mov r0, r8 + movs r1, 0x20 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0xC7 + bls _0806CC20 + b _0806CD30 +_0806CC20: + ldr r0, [sp, 0x20] + cmp r0, 0 + beq _0806CC2E + ldr r1, [sp, 0x3C] + cmp r1, 0 + bne _0806CC2E + b _0806CD30 +_0806CC2E: + bl sub_806F104 + lsls r0, 24 + cmp r0, 0 + bne _0806CD30 + ldr r2, [sp, 0x30] + cmp r2, 0 + bne _0806CD30 + ldr r3, [sp, 0x24] + ldr r5, [sp, 0x28] + adds r0, r3, r5 + ldrb r0, [r0] + str r0, [sp, 0x30] + mov r0, r8 + movs r1, 0x20 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + str r4, [sp, 0x8] + ldr r0, [sp, 0x30] + lsls r5, r0, 24 + asrs r1, r5, 24 + cmp r1, 0 + ble _0806CCCC + ldr r2, [sp, 0x34] + cmp r2, 0x1B + beq _0806CCBA + b _0806CCCC +_0806CC68: + mov r0, r8 + movs r1, 0x20 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0xC7 + bls _0806CD30 + ldr r0, [sp, 0x20] + cmp r0, 0 + beq _0806CC82 + ldr r1, [sp, 0x3C] + cmp r1, 0 + beq _0806CD30 +_0806CC82: + bl sub_806F104 + lsls r0, 24 + cmp r0, 0 + bne _0806CD30 + ldr r2, [sp, 0x30] + cmp r2, 0 + bne _0806CD30 + ldr r3, [sp, 0x24] + ldr r5, [sp, 0x28] + adds r0, r3, r5 + ldrb r0, [r0] + str r0, [sp, 0x30] + mov r0, r8 + movs r1, 0x20 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + str r4, [sp, 0x8] + ldr r0, [sp, 0x30] + lsls r5, r0, 24 + asrs r1, r5, 24 + cmp r1, 0 + ble _0806CCCC + ldr r2, [sp, 0x34] + cmp r2, 0x1B + bne _0806CCCC +_0806CCBA: + movs r0, 0x96 + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + adds r0, r4, r0 + str r0, [sp, 0x8] + adds r2, r5, 0 + b _0806CCD8 +_0806CCCC: + ldr r3, [sp, 0x30] + lsls r2, r3, 24 + asrs r1, r2, 24 + ldr r0, [sp, 0x8] + adds r0, r1 + str r0, [sp, 0x8] +_0806CCD8: + cmp r2, 0 + ble _0806CD0E + mov r0, r8 + movs r1, 0x26 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0xB + bne _0806CCF0 + ldr r0, [sp, 0x8] + adds r0, 0x1 + str r0, [sp, 0x8] +_0806CCF0: + mov r0, r8 + movs r1, 0x23 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + bl sav1_map_get_name + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _0806CD0E + ldr r0, [sp, 0x8] + adds r0, 0x1 + str r0, [sp, 0x8] +_0806CD0E: + ldr r0, [sp, 0x8] + cmp r0, 0 + bge _0806CD18 + movs r0, 0 + str r0, [sp, 0x8] +_0806CD18: + ldr r0, [sp, 0x8] + cmp r0, 0xFF + ble _0806CD22 + movs r0, 0xFF + str r0, [sp, 0x8] +_0806CD22: + add r2, sp, 0x8 + mov r0, r8 + movs r1, 0x20 + bl pokemon_setattr + movs r5, 0 + str r5, [sp, 0x20] +_0806CD30: + ldr r0, [sp, 0x28] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x28] +_0806CD3A: + ldr r0, [sp, 0x2C] + adds r0, 0x1 + str r0, [sp, 0x2C] + mov r1, r10 + lsrs r1, 1 + mov r10, r1 + cmp r1, 0 + beq _0806CD4C + b _0806C9D4 +_0806CD4C: + ldr r2, [sp, 0x1C] + adds r2, 0x1 + str r2, [sp, 0x1C] + cmp r2, 0x5 + bgt _0806CD5A + bl _0806BEFC +_0806CD5A: + ldr r0, [sp, 0x20] +_0806CD5C: + add sp, 0x44 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end ExecuteTableBasedItemEffect + + thumb_func_start HealStatusConditions +@ bool8 HealStatusConditions(struct pokemon *a1, int a2, u32 healMask, u8 a4) +HealStatusConditions: @ 806CD6C + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r4, r2, 0 + lsls r3, 24 + lsrs r6, r3, 24 + movs r1, 0x37 + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + str r1, [sp] + ands r0, r4 + cmp r0, 0 + beq _0806CDD0 + mvns r4, r4 + ands r1, r4 + str r1, [sp] + adds r0, r5, 0 + movs r1, 0x37 + mov r2, sp + bl pokemon_setattr + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806CDBE + cmp r6, 0x4 + beq _0806CDBE + ldr r0, =0x02024084 + movs r1, 0x58 + muls r1, r6 + adds r0, 0x4C + adds r1, r0 + ldr r0, [r1] + ands r0, r4 + str r0, [r1] +_0806CDBE: + movs r0, 0 + b _0806CDD2 + .pool +_0806CDD0: + movs r0, 0x1 +_0806CDD2: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end HealStatusConditions + + thumb_func_start sub_806CDDC +sub_806CDDC: @ 806CDDC + push {r4-r7,lr} + lsls r0, 16 + lsrs r3, r0, 16 + lsls r1, 24 + lsrs r4, r1, 24 + lsls r2, 24 + lsrs r5, r2, 24 + movs r7, 0x6 + ldr r1, =gItemEffectInfoPointers + adds r0, r3, 0 + subs r0, 0xD + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + bne _0806CE08 + cmp r3, 0xAF + beq _0806CE0C +_0806CE00: + movs r0, 0 + b _0806CF1C + .pool +_0806CE08: + cmp r3, 0xAF + bne _0806CE1A +_0806CE0C: + ldr r0, =0x02024064 + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r1, =0x0202440c + adds r0, r1 +_0806CE1A: + mov r12, r0 + movs r2, 0 +_0806CE1E: + cmp r2, 0x4 + beq _0806CE3E + cmp r2, 0x4 + ble _0806CE34 + cmp r2, 0x5 + beq _0806CEC8 + b _0806CF12 + .pool +_0806CE34: + cmp r2, 0 + blt _0806CF12 + cmp r2, r4 + bne _0806CF12 + b _0806CE00 +_0806CE3E: + mov r0, r12 + ldrb r3, [r0, 0x4] + movs r0, 0x20 + ands r0, r3 + cmp r0, 0 + beq _0806CE4E + movs r0, 0xDF + ands r3, r0 +_0806CE4E: + movs r6, 0 + cmp r3, 0 + beq _0806CF12 +_0806CE54: + movs r0, 0x1 + ands r0, r3 + cmp r0, 0 + beq _0806CEB4 + cmp r6, 0x7 + bhi _0806CEB4 + lsls r0, r6, 2 + ldr r1, =_0806CE70 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0806CE70: + .4byte _0806CE9C + .4byte _0806CE9C + .4byte _0806CE90 + .4byte _0806CE9C + .4byte _0806CEB4 + .4byte _0806CEB4 + .4byte _0806CEB4 + .4byte _0806CEB0 +_0806CE90: + movs r0, 0x10 + ands r0, r3 + cmp r0, 0 + beq _0806CE9C + movs r0, 0xEF + ands r3, r0 +_0806CE9C: + cmp r2, r4 + bne _0806CEA8 + adds r0, r3, 0 + ands r0, r5 + cmp r0, 0 + bne _0806CF1A +_0806CEA8: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + b _0806CEB4 +_0806CEB0: + cmp r2, r4 + beq _0806CE00 +_0806CEB4: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + lsrs r3, 1 + cmp r2, r4 + bne _0806CEC2 + lsrs r5, 1 +_0806CEC2: + cmp r3, 0 + bne _0806CE54 + b _0806CF12 +_0806CEC8: + mov r0, r12 + ldrb r3, [r0, 0x5] + movs r6, 0 +_0806CECE: + cmp r3, 0 + beq _0806CF12 + movs r0, 0x1 + ands r0, r3 + cmp r0, 0 + beq _0806CF02 + cmp r6, 0 + blt _0806CF02 + cmp r6, 0x6 + ble _0806CEE8 + cmp r6, 0x7 + beq _0806CEFC + b _0806CF02 +_0806CEE8: + cmp r2, r4 + bne _0806CEF4 + adds r0, r3, 0 + ands r0, r5 + cmp r0, 0 + bne _0806CF1A +_0806CEF4: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + b _0806CF02 +_0806CEFC: + cmp r2, r4 + bne _0806CF02 + b _0806CE00 +_0806CF02: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + lsrs r3, 1 + cmp r2, r4 + bne _0806CECE + lsrs r5, 1 + b _0806CECE +_0806CF12: + adds r2, 0x1 + cmp r2, 0x5 + bgt _0806CF1A + b _0806CE1E +_0806CF1A: + adds r0, r7, 0 +_0806CF1C: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_806CDDC + + thumb_func_start sub_806CF24 +sub_806CF24: @ 806CF24 + push {lr} + ldr r2, =0x0202420c + ldr r1, =0x020244b8 + ldrb r1, [r1] + strb r1, [r2] + ldr r3, =0x02022f58 + ldr r2, =gUnknown_085CBE00 + ldr r1, =gUnknown_08329EC8 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r2 + ldr r1, [r0] + adds r0, r3, 0 + bl CopyString + ldr r0, =0x02022f68 + ldr r1, =gUnknown_085CB38A + bl CopyString + ldr r0, =gUnknown_085CB3AA + bl get_battle_strings_ + pop {r0} + bx r0 + .pool + thumb_func_end sub_806CF24 + + thumb_func_start sub_806CF78 +sub_806CF78: @ 806CF78 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xAF + bne _0806CFCC + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806CFB8 + ldr r2, =0x020244b8 + ldrb r1, [r2] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r1, =0x0202440c + adds r7, r0, r1 + b _0806CFD8 + .pool +_0806CFB8: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003214 + adds r7, r0, r1 + b _0806CFD6 + .pool +_0806CFCC: + ldr r1, =gItemEffectInfoPointers + subs r0, 0xD + lsls r0, 2 + adds r0, r1 + ldr r7, [r0] +_0806CFD6: + ldr r2, =0x020244b8 +_0806CFD8: + ldr r1, =0x0202420f + ldrb r0, [r2] + strb r0, [r1] + movs r5, 0 + ldr r0, =0x0202420b + mov r8, r0 + movs r6, 0 +_0806CFE6: + adds r4, r7, r5 + ldrb r1, [r4] + movs r0, 0xF + ands r0, r1 + cmp r0, 0 + beq _0806CFF8 + adds r0, r6, 0 + bl sub_806CF24 +_0806CFF8: + ldrb r1, [r4] + movs r0, 0xF0 + ands r0, r1 + cmp r0, 0 + beq _0806D02E + cmp r5, 0 + beq _0806D020 + adds r0, r6, 0x1 + bl sub_806CF24 + b _0806D02E + .pool +_0806D020: + ldr r0, =0x020244b8 + ldrb r0, [r0] + mov r1, r8 + strb r0, [r1] + ldr r0, =gUnknown_085CA459 + bl get_battle_strings_ +_0806D02E: + adds r6, 0x2 + adds r5, 0x1 + cmp r5, 0x2 + ble _0806CFE6 + ldrb r1, [r7, 0x3] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0806D04E + ldr r1, =0x0202420b + ldr r0, =0x020244b8 + ldrb r0, [r0] + strb r0, [r1] + ldr r0, =gUnknown_085CA424 + bl get_battle_strings_ +_0806D04E: + ldr r0, =0x02022e2c + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806CF78 + + thumb_func_start GetNature +@ u8 GetNature(pokemon *mon) +GetNature: @ 806D070 + push {lr} + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + movs r1, 0x19 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end GetNature + + thumb_func_start GetNatureFromPersonality +@ u8 GetNatureFromPersonality(u32 personality) +GetNatureFromPersonality: @ 806D088 + push {lr} + movs r1, 0x19 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end GetNatureFromPersonality + + thumb_func_start GetEvolutionTargetSpecies +GetEvolutionTargetSpecies: @ 806D098 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + mov r8, r0 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 16 + lsrs r2, 16 + mov r9, r2 + movs r0, 0 + mov r10, r0 + mov r0, r8 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r7, r0, 16 + mov r0, r8 + movs r1, 0xC + movs r2, 0 + bl pokemon_getattr + mov r1, sp + strh r0, [r1] + mov r0, r8 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + mov r0, r8 + movs r1, 0x17 + movs r2, 0 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0xC] + lsrs r4, 16 + str r4, [sp, 0x10] + mov r0, sp + ldrh r0, [r0] + cmp r0, 0xAF + bne _0806D10C + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003226 + adds r0, r1 + ldrb r0, [r0] + b _0806D114 + .pool +_0806D10C: + bl itemid_get_x12 + lsls r0, 24 + lsrs r0, 24 +_0806D114: + cmp r0, 0x26 + bne _0806D120 + cmp r5, 0x3 + beq _0806D120 + movs r0, 0 + b _0806D3B0 +_0806D120: + cmp r5, 0x1 + bne _0806D126 + b _0806D340 +_0806D126: + cmp r5, 0x1 + bgt _0806D130 + cmp r5, 0 + beq _0806D144 + b _0806D3AE +_0806D130: + cmp r5, 0x3 + ble _0806D136 + b _0806D3AE +_0806D136: + movs r2, 0 + str r2, [sp, 0x4] + ldr r3, =gEvolutionTable + lsls r6, r7, 2 + b _0806D38E + .pool +_0806D144: + mov r0, r8 + movs r1, 0x38 + movs r2, 0 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + mov r0, r8 + movs r1, 0x20 + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x8] + movs r0, 0 + str r0, [sp, 0x4] + lsls r6, r7, 2 +_0806D16A: + ldr r1, =gEvolutionTable + ldr r0, [sp, 0x4] + lsls r2, r0, 3 + adds r0, r6, r7 + lsls r0, 3 + adds r0, r2, r0 + adds r0, r1 + ldrh r0, [r0] + subs r0, 0x1 + adds r3, r1, 0 + adds r4, r2, 0 + cmp r0, 0xE + bls _0806D186 + b _0806D332 +_0806D186: + lsls r0, 2 + ldr r1, =_0806D198 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0806D198: + .4byte _0806D1D4 + .4byte _0806D1E6 + .4byte _0806D208 + .4byte _0806D238 + .4byte _0806D332 + .4byte _0806D332 + .4byte _0806D332 + .4byte _0806D248 + .4byte _0806D272 + .4byte _0806D29C + .4byte _0806D2CA + .4byte _0806D2EA + .4byte _0806D30E + .4byte _0806D332 + .4byte _0806D31E +_0806D1D4: + ldr r1, [sp, 0x8] + cmp r1, 0xDB + bhi _0806D1DC + b _0806D332 +_0806D1DC: + adds r0, r6, r7 + lsls r0, 3 + adds r0, r4, r0 + adds r0, r3 + b _0806D228 +_0806D1E6: + bl GameFreakRTC_CalcLocalDateTime + ldr r0, =0x03005cf8 + ldrb r0, [r0, 0x2] + subs r0, 0xC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xB + bls _0806D1FA + b _0806D332 +_0806D1FA: + ldr r2, [sp, 0x8] + cmp r2, 0xDB + bhi _0806D202 + b _0806D332 +_0806D202: + b _0806D21E + .pool +_0806D208: + bl GameFreakRTC_CalcLocalDateTime + ldr r0, =0x03005cf8 + ldrb r0, [r0, 0x2] + cmp r0, 0xB + bls _0806D216 + b _0806D332 +_0806D216: + ldr r0, [sp, 0x8] + cmp r0, 0xDB + bhi _0806D21E + b _0806D332 +_0806D21E: + ldr r1, =gEvolutionTable + adds r0, r6, r7 + lsls r0, 3 + adds r0, r4, r0 + adds r0, r1 +_0806D228: + ldrh r0, [r0, 0x4] + mov r10, r0 + b _0806D332 + .pool +_0806D238: + adds r0, r6, r7 + lsls r0, 3 + adds r0, r4, r0 + adds r1, r0, r3 + ldrh r0, [r1, 0x2] + cmp r0, r9 + bhi _0806D332 + b _0806D32E +_0806D248: + adds r0, r6, r7 + lsls r0, 3 + adds r0, r4, r0 + adds r5, r0, r3 + ldrh r0, [r5, 0x2] + cmp r0, r9 + bhi _0806D332 + mov r0, r8 + movs r1, 0x3B + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + mov r0, r8 + movs r1, 0x3C + movs r2, 0 + bl pokemon_getattr + cmp r4, r0 + bls _0806D332 + b _0806D2C4 +_0806D272: + adds r0, r6, r7 + lsls r0, 3 + adds r0, r4, r0 + adds r5, r0, r3 + ldrh r0, [r5, 0x2] + cmp r0, r9 + bhi _0806D332 + mov r0, r8 + movs r1, 0x3B + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + mov r0, r8 + movs r1, 0x3C + movs r2, 0 + bl pokemon_getattr + cmp r4, r0 + bne _0806D332 + b _0806D2C4 +_0806D29C: + adds r0, r6, r7 + lsls r0, 3 + adds r0, r4, r0 + adds r5, r0, r3 + ldrh r0, [r5, 0x2] + cmp r0, r9 + bhi _0806D332 + mov r0, r8 + movs r1, 0x3B + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + mov r0, r8 + movs r1, 0x3C + movs r2, 0 + bl pokemon_getattr + cmp r4, r0 + bcs _0806D332 +_0806D2C4: + ldrh r5, [r5, 0x4] + mov r10, r5 + b _0806D332 +_0806D2CA: + adds r0, r6, r7 + lsls r0, 3 + adds r0, r4, r0 + adds r4, r0, r3 + ldrh r0, [r4, 0x2] + cmp r0, r9 + bhi _0806D332 + ldr r0, [sp, 0x10] + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x4 + bhi _0806D332 + b _0806D308 +_0806D2EA: + adds r0, r6, r7 + lsls r0, 3 + adds r0, r4, r0 + adds r4, r0, r3 + ldrh r0, [r4, 0x2] + cmp r0, r9 + bhi _0806D332 + ldr r0, [sp, 0x10] + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x4 + bls _0806D332 +_0806D308: + ldrh r4, [r4, 0x4] + mov r10, r4 + b _0806D332 +_0806D30E: + adds r0, r6, r7 + lsls r0, 3 + adds r0, r4, r0 + adds r1, r0, r3 + ldrh r0, [r1, 0x2] + cmp r0, r9 + bhi _0806D332 + b _0806D32E +_0806D31E: + adds r0, r6, r7 + lsls r0, 3 + adds r0, r4, r0 + adds r1, r0, r3 + ldrh r0, [r1, 0x2] + ldr r2, [sp, 0xC] + cmp r0, r2 + bhi _0806D332 +_0806D32E: + ldrh r1, [r1, 0x4] + mov r10, r1 +_0806D332: + ldr r0, [sp, 0x4] + adds r0, 0x1 + str r0, [sp, 0x4] + cmp r0, 0x4 + bgt _0806D33E + b _0806D16A +_0806D33E: + b _0806D3AE +_0806D340: + lsls r6, r7, 2 + ldr r1, =gEvolutionTable + adds r0, r6, r7 + lsls r0, 3 + adds r4, r0, r1 + mov r5, sp + movs r1, 0x4 + str r1, [sp, 0x4] +_0806D350: + ldrh r0, [r4] + cmp r0, 0x5 + beq _0806D370 + cmp r0, 0x6 + bne _0806D374 + ldrh r0, [r4, 0x2] + ldrh r1, [r5] + cmp r0, r1 + bne _0806D374 + movs r0, 0 + strh r0, [r5] + mov r0, r8 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr +_0806D370: + ldrh r2, [r4, 0x4] + mov r10, r2 +_0806D374: + adds r4, 0x8 + ldr r0, [sp, 0x4] + subs r0, 0x1 + str r0, [sp, 0x4] + cmp r0, 0 + bge _0806D350 + b _0806D3AE + .pool +_0806D388: + ldrh r1, [r1, 0x4] + mov r10, r1 + b _0806D3AE +_0806D38E: + adds r0, r6, r7 + ldr r1, [sp, 0x4] + adds r0, r1 + lsls r0, 3 + adds r1, r0, r3 + ldrh r0, [r1] + cmp r0, 0x7 + bne _0806D3A4 + ldrh r0, [r1, 0x2] + cmp r0, r9 + beq _0806D388 +_0806D3A4: + ldr r2, [sp, 0x4] + adds r2, 0x1 + str r2, [sp, 0x4] + cmp r2, 0x4 + ble _0806D38E +_0806D3AE: + mov r0, r10 +_0806D3B0: + 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 GetEvolutionTargetSpecies + + thumb_func_start HoennPokedexNumToSpecies +HoennPokedexNumToSpecies: @ 806D3C0 + push {r4,lr} + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0 + beq _0806D404 + movs r1, 0 + ldr r3, =gSpeciesToHoennPokedexNum + ldrh r0, [r3] + cmp r0, r2 + beq _0806D3EC + movs r4, 0xCD + lsls r4, 1 +_0806D3D8: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r4 + bhi _0806D3EC + lsls r0, r1, 1 + adds r0, r3 + ldrh r0, [r0] + cmp r0, r2 + bne _0806D3D8 +_0806D3EC: + ldr r0, =0x0000019b + cmp r1, r0 + beq _0806D404 + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r0, 16 + b _0806D406 + .pool +_0806D404: + movs r0, 0 +_0806D406: + pop {r4} + pop {r1} + bx r1 + thumb_func_end HoennPokedexNumToSpecies + + thumb_func_start NationalPokedexNumToSpecies +NationalPokedexNumToSpecies: @ 806D40C + push {r4,lr} + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0 + beq _0806D450 + movs r1, 0 + ldr r3, =gSpeciesToNationalPokedexNum + ldrh r0, [r3] + cmp r0, r2 + beq _0806D438 + movs r4, 0xCD + lsls r4, 1 +_0806D424: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r4 + bhi _0806D438 + lsls r0, r1, 1 + adds r0, r3 + ldrh r0, [r0] + cmp r0, r2 + bne _0806D424 +_0806D438: + ldr r0, =0x0000019b + cmp r1, r0 + beq _0806D450 + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r0, 16 + b _0806D452 + .pool +_0806D450: + movs r0, 0 +_0806D452: + pop {r4} + pop {r1} + bx r1 + thumb_func_end NationalPokedexNumToSpecies + + thumb_func_start NationalToHoennOrder +NationalToHoennOrder: @ 806D458 + push {r4,lr} + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0 + beq _0806D49C + movs r1, 0 + ldr r3, =gHoennToNationalOrder + ldrh r0, [r3] + cmp r0, r2 + beq _0806D484 + movs r4, 0xCD + lsls r4, 1 +_0806D470: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r4 + bhi _0806D484 + lsls r0, r1, 1 + adds r0, r3 + ldrh r0, [r0] + cmp r0, r2 + bne _0806D470 +_0806D484: + ldr r0, =0x0000019b + cmp r1, r0 + beq _0806D49C + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r0, 16 + b _0806D49E + .pool +_0806D49C: + movs r0, 0 +_0806D49E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end NationalToHoennOrder + + thumb_func_start SpeciesToNationalPokedexNum +SpeciesToNationalPokedexNum: @ 806D4A4 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _0806D4C0 + ldr r0, =gSpeciesToNationalPokedexNum + subs r1, 0x1 + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + b _0806D4C2 + .pool +_0806D4C0: + movs r0, 0 +_0806D4C2: + pop {r1} + bx r1 + thumb_func_end SpeciesToNationalPokedexNum + + thumb_func_start SpeciesToHoennPokedexNum +SpeciesToHoennPokedexNum: @ 806D4C8 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _0806D4E4 + ldr r0, =gSpeciesToHoennPokedexNum + subs r1, 0x1 + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + b _0806D4E6 + .pool +_0806D4E4: + movs r0, 0 +_0806D4E6: + pop {r1} + bx r1 + thumb_func_end SpeciesToHoennPokedexNum + + thumb_func_start HoennToNationalOrder +HoennToNationalOrder: @ 806D4EC + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _0806D508 + ldr r0, =gHoennToNationalOrder + subs r1, 0x1 + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + b _0806D50A + .pool +_0806D508: + movs r0, 0 +_0806D50A: + pop {r1} + bx r1 + thumb_func_end HoennToNationalOrder + + thumb_func_start speciesid_conv +speciesid_conv: @ 806D510 + push {lr} + lsls r0, 16 + lsrs r0, 16 + adds r1, r0, 0 + cmp r0, 0xFA + bls _0806D53E + ldr r0, =0x00000113 + cmp r1, r0 + bls _0806D53C + ldr r0, =gUnknown_0831F61C + ldr r2, =0xfffffeec + adds r1, r2 + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + b _0806D53E + .pool +_0806D53C: + movs r0, 0xC8 +_0806D53E: + pop {r1} + bx r1 + thumb_func_end speciesid_conv + + thumb_func_start sub_806D544 +sub_806D544: @ 806D544 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r6, r1, 0 + mov r10, r2 + lsls r0, 16 + movs r1, 0x9A + lsls r1, 17 + cmp r0, r1 + bne _0806D652 + ldr r0, =0x020244d4 + ldr r1, [r0] + ldr r0, [r1, 0x4] + cmp r10, r0 + beq _0806D652 + ldr r0, [r1, 0xC] + cmp r10, r0 + beq _0806D652 + movs r5, 0 +_0806D570: + lsls r3, r5, 3 + adds r3, r5 + lsls r3, 2 + ldr r0, =gSpindaSpotGraphics + adds r4, r3, r0 + ldrb r1, [r4] + adds r1, 0xF8 + movs r2, 0xF + adds r0, r6, 0 + ands r0, r2 + adds r1, r0 + lsls r1, 24 + lsrs r1, 24 + mov r12, r1 + ldrb r1, [r4, 0x1] + adds r1, 0xF8 + movs r0, 0xF0 + ands r0, r6 + lsrs r0, 4 + adds r1, r0 + lsls r1, 24 + lsrs r1, 24 + movs r2, 0 + lsrs r6, 8 + str r6, [sp, 0x4] + adds r5, 0x1 + str r5, [sp] + mov r9, r3 +_0806D5A8: + lsls r0, r2, 1 + add r0, r9 + ldr r3, =gSpindaSpotGraphics + 0x2 + adds r0, r3 + ldrh r3, [r0] + mov r4, r12 + adds r0, r4, 0 + adds r0, 0x10 + adds r7, r1, 0x1 + adds r2, 0x1 + mov r8, r2 + cmp r4, r0 + bge _0806D640 + lsrs r0, r1, 3 + lsls r6, r0, 8 + movs r0, 0x7 + ands r1, r0 + lsls r5, r1, 2 +_0806D5CC: + adds r0, r4, 0 + cmp r4, 0 + bge _0806D5D4 + adds r0, r4, 0x7 +_0806D5D4: + asrs r0, 3 + lsls r2, r0, 5 + add r2, r10 + lsls r0, 3 + subs r0, r4, r0 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + adds r2, r0 + adds r2, r6 + adds r2, r5 + movs r1, 0x1 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _0806D634 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _0806D620 + ldrb r1, [r2] + movs r0, 0xF0 + ands r0, r1 + subs r0, 0x10 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x20 + bhi _0806D634 + adds r0, r1, 0 + adds r0, 0x40 + b _0806D632 + .pool +_0806D620: + ldrb r1, [r2] + movs r0, 0xF + ands r0, r1 + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bhi _0806D634 + adds r0, r1, 0x4 +_0806D632: + strb r0, [r2] +_0806D634: + asrs r3, 1 + adds r4, 0x1 + mov r0, r12 + adds r0, 0x10 + cmp r4, r0 + blt _0806D5CC +_0806D640: + lsls r0, r7, 24 + lsrs r1, r0, 24 + mov r2, r8 + cmp r2, 0xF + ble _0806D5A8 + ldr r6, [sp, 0x4] + ldr r5, [sp] + cmp r5, 0x3 + ble _0806D570 +_0806D652: + 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_806D544 + + thumb_func_start DrawSpindaSpots +@ void DrawSpindaSpots(u16 species, u32 personality, u8 *pixels, u8 isFrontPic) +DrawSpindaSpots: @ 806D664 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r5, r1, 0 + str r2, [sp] + lsls r0, 16 + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x9A + lsls r1, 17 + cmp r0, r1 + bne _0806D766 + cmp r3, 0 + beq _0806D766 + movs r6, 0 +_0806D688: + lsls r3, r6, 3 + adds r3, r6 + lsls r3, 2 + ldr r0, =gSpindaSpotGraphics + adds r4, r3, r0 + ldrb r1, [r4] + adds r1, 0xF8 + movs r2, 0xF + adds r0, r5, 0 + ands r0, r2 + adds r1, r0 + lsls r1, 24 + lsrs r1, 24 + mov r12, r1 + ldrb r1, [r4, 0x1] + adds r1, 0xF8 + movs r0, 0xF0 + ands r0, r5 + lsrs r0, 4 + adds r1, r0 + lsls r1, 24 + lsrs r1, 24 + movs r2, 0 + lsrs r5, 8 + str r5, [sp, 0x4] + adds r6, 0x1 + mov r10, r6 + mov r9, r3 +_0806D6C0: + lsls r0, r2, 1 + add r0, r9 + ldr r3, =gSpindaSpotGraphics + 0x2 + adds r0, r3 + ldrh r3, [r0] + mov r4, r12 + adds r0, r4, 0 + adds r0, 0x10 + adds r7, r1, 0x1 + adds r2, 0x1 + mov r8, r2 + cmp r4, r0 + bge _0806D754 + lsrs r0, r1, 3 + lsls r6, r0, 8 + movs r0, 0x7 + ands r1, r0 + lsls r5, r1, 2 +_0806D6E4: + adds r0, r4, 0 + cmp r4, 0 + bge _0806D6EC + adds r0, r4, 0x7 +_0806D6EC: + asrs r0, 3 + lsls r2, r0, 5 + ldr r1, [sp] + adds r2, r1, r2 + lsls r0, 3 + subs r0, r4, r0 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + adds r2, r0 + adds r2, r6 + adds r2, r5 + movs r1, 0x1 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _0806D748 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _0806D734 + ldrb r1, [r2] + movs r0, 0xF0 + ands r0, r1 + subs r0, 0x10 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x20 + bhi _0806D748 + adds r0, r1, 0 + adds r0, 0x40 + b _0806D746 + .pool +_0806D734: + ldrb r1, [r2] + movs r0, 0xF + ands r0, r1 + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bhi _0806D748 + adds r0, r1, 0x4 +_0806D746: + strb r0, [r2] +_0806D748: + asrs r3, 1 + adds r4, 0x1 + mov r0, r12 + adds r0, 0x10 + cmp r4, r0 + blt _0806D6E4 +_0806D754: + lsls r0, r7, 24 + lsrs r1, r0, 24 + mov r2, r8 + cmp r2, 0xF + ble _0806D6C0 + ldr r5, [sp, 0x4] + mov r6, r10 + cmp r6, 0x3 + ble _0806D688 +_0806D766: + 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 DrawSpindaSpots + + thumb_func_start sub_806D778 +sub_806D778: @ 806D778 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + adds r5, r0, 0 + lsls r1, 16 + lsrs r7, r1, 16 + lsls r2, 16 + lsrs r2, 16 + mov r8, r2 + ldr r0, =0x02021cc4 + mov r9, r0 + adds r0, r5, 0 + movs r1, 0x2 + mov r2, r9 + bl pokemon_getattr + mov r4, sp + adds r0, r5, 0 + movs r1, 0x3 + mov r2, sp + bl pokemon_getattr + strb r0, [r4] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _0806D7D4 + movs r6, 0xB + adds r0, r7, 0 + muls r0, r6 + ldr r4, =gSpeciesNames + adds r0, r4 + mov r1, r9 + bl CompareString + cmp r0, 0 + bne _0806D7D4 + mov r2, r8 + muls r2, r6 + adds r2, r4 + adds r0, r5, 0 + movs r1, 0x2 + bl pokemon_setattr +_0806D7D4: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806D778 + + thumb_func_start sub_806D7EC +sub_806D7EC: @ 806D7EC + push {r4,r5,lr} + movs r5, 0 + ldr r4, =0x020229e8 + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r4 + ldrh r0, [r1, 0x18] + cmp r0, 0x2 + bgt _0806D818 + cmp r0, 0x1 + bge _0806D820 + cmp r0, 0 + beq _0806D81C + b _0806D822 + .pool +_0806D818: + cmp r0, 0x3 + bne _0806D822 +_0806D81C: + movs r5, 0 + b _0806D822 +_0806D820: + movs r5, 0x1 +_0806D822: + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_806D7EC + + thumb_func_start sub_806D82C +sub_806D82C: @ 806D82C + push {lr} + lsls r0, 24 + lsrs r0, 24 + movs r3, 0 + ldr r2, =0x020229e8 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1, 0x18] + cmp r0, 0x2 + bgt _0806D854 + cmp r0, 0x1 + bge _0806D85C + cmp r0, 0 + beq _0806D858 + b _0806D85E + .pool +_0806D854: + cmp r0, 0x3 + bne _0806D85E +_0806D858: + movs r3, 0 + b _0806D85E +_0806D85C: + movs r3, 0x1 +_0806D85E: + adds r0, r3, 0 + pop {r1} + bx r1 + thumb_func_end sub_806D82C + + thumb_func_start sub_806D864 +sub_806D864: @ 806D864 + push {lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + ldr r1, =0x020229e8 + b _0806D87C + .pool +_0806D874: + adds r1, 0x1C + adds r2, 0x1 + cmp r2, 0x3 + bgt _0806D882 +_0806D87C: + ldrh r0, [r1, 0x18] + cmp r0, r3 + bne _0806D874 +_0806D882: + adds r0, r2, 0 + pop {r1} + bx r1 + thumb_func_end sub_806D864 + + thumb_func_start GetTrainerEncounterMusicId +@ u8 GetTrainerEncounterMusicId(u16 trainerOpponentId) +GetTrainerEncounterMusicId: @ 806D888 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _0806D8A2 + adds r0, r4, 0 + bl sub_81A9F3C + b _0806D8CA +_0806D8A2: + bl sub_81D5C18 + lsls r0, 24 + cmp r0, 0 + bne _0806D8C4 + ldr r1, =gTrainers + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x2] + movs r0, 0x7F + ands r0, r1 + b _0806D8CE + .pool +_0806D8C4: + adds r0, r5, 0 + bl sub_81D63C8 +_0806D8CA: + lsls r0, 24 + lsrs r0, 24 +_0806D8CE: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end GetTrainerEncounterMusicId + + thumb_func_start nature_stat_mod +nature_stat_mod: @ 806D8D4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 16 + lsrs r3, r1, 16 + lsls r2, 24 + lsrs r5, r2, 24 + movs r0, 0xFF + lsls r0, 24 + adds r2, r0 + lsrs r2, 24 + cmp r2, 0x4 + bls _0806D8F2 + adds r0, r3, 0 + b _0806D92E +_0806D8F2: + ldr r0, =gNatureStatTable + lsls r1, r4, 2 + adds r1, r4 + subs r1, 0x1 + adds r1, r5, r1 + adds r1, r0 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0806D918 + cmp r1, 0x1 + bne _0806D92C + movs r0, 0x6E + b _0806D91A + .pool +_0806D918: + movs r0, 0x5A +_0806D91A: + muls r0, r3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + b _0806D92E +_0806D92C: + adds r0, r3, 0 +_0806D92E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end nature_stat_mod + + thumb_func_start happiness_algorithm +happiness_algorithm: @ 806D934 + push {r4-r7,lr} + sub sp, 0x4 + adds r7, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + bl sub_806F104 + lsls r0, 24 + cmp r0, 0 + beq _0806D94A + b _0806DAC2 +_0806D94A: + adds r0, r7, 0 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r6, r0, 16 + adds r0, r7, 0 + movs r1, 0xC + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xAF + bne _0806D9A0 + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806D98C + ldr r0, =0x02024404 + ldrb r4, [r0, 0x7] + b _0806D9A8 + .pool +_0806D98C: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003226 + adds r0, r1 + ldrb r4, [r0] + b _0806D9A8 + .pool +_0806D9A0: + bl itemid_get_x12 + lsls r0, 24 + lsrs r4, r0, 24 +_0806D9A8: + cmp r6, 0 + bne _0806D9AE + b _0806DAC2 +_0806D9AE: + movs r0, 0xCE + lsls r0, 1 + cmp r6, r0 + bne _0806D9B8 + b _0806DAC2 +_0806D9B8: + movs r6, 0 + adds r0, r7, 0 + movs r1, 0x20 + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + mov r1, sp + strh r0, [r1] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x63 + ble _0806D9D6 + movs r6, 0x1 +_0806D9D6: + cmp r0, 0xC7 + ble _0806D9E0 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0806D9E0: + cmp r5, 0x5 + bne _0806D9F0 + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + bne _0806DAC2 +_0806D9F0: + cmp r5, 0x3 + bne _0806DA20 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0806DAC2 + ldr r2, =gTrainers + ldr r0, =0x02038bca + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r1, [r0, 0x1] + adds r0, r1, 0 + subs r0, 0x1F + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _0806DA20 + cmp r1, 0x26 + bne _0806DAC2 +_0806DA20: + ldr r1, =gUnknown_08329ECE + lsls r0, r5, 1 + adds r0, r5 + adds r0, r6, r0 + adds r0, r1 + ldrb r2, [r0] + movs r1, 0 + ldrsb r1, [r0, r1] + cmp r1, 0 + ble _0806DA46 + cmp r4, 0x1B + bne _0806DA46 + movs r0, 0x96 + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + lsls r0, 24 + lsrs r2, r0, 24 +_0806DA46: + lsls r2, 24 + asrs r2, 24 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + adds r0, r2 + mov r1, sp + strh r0, [r1] + cmp r2, 0 + ble _0806DA98 + adds r0, r7, 0 + movs r1, 0x26 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0xB + bne _0806DA74 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + adds r0, 0x1 + mov r1, sp + strh r0, [r1] +_0806DA74: + adds r0, r7, 0 + movs r1, 0x23 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + bl sav1_map_get_name + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _0806DA98 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + adds r0, 0x1 + mov r1, sp + strh r0, [r1] +_0806DA98: + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _0806DAA8 + movs r1, 0 + mov r0, sp + strh r1, [r0] +_0806DAA8: + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0xFF + ble _0806DAB8 + movs r1, 0xFF + mov r0, sp + strh r1, [r0] +_0806DAB8: + adds r0, r7, 0 + movs r1, 0x20 + mov r2, sp + bl pokemon_setattr +_0806DAC2: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end happiness_algorithm + + thumb_func_start sub_806DADC +sub_806DADC: @ 806DADC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + mov r8, r0 + lsls r1, 16 + lsrs r5, r1, 16 + movs r4, 0 + movs r7, 0 + movs r6, 0 +_0806DAF0: + adds r1, r6, 0 + adds r1, 0x1A + mov r0, r8 + movs r2, 0 + bl pokemon_getattr + mov r2, sp + adds r1, r2, r6 + strb r0, [r1] + ldrb r0, [r1] + adds r0, r7, r0 + lsls r0, 16 + lsrs r7, r0, 16 + adds r6, 0x1 + cmp r6, 0x5 + ble _0806DAF0 + movs r6, 0 + b _0806DC72 +_0806DB14: + mov r0, r8 + movs r1, 0 + bl sub_806DDE4 + lsls r0, 24 + movs r2, 0x1 + cmp r0, 0 + beq _0806DB26 + movs r2, 0x2 +_0806DB26: + cmp r6, 0x5 + bhi _0806DBC8 + lsls r0, r6, 2 + ldr r1, =_0806DB38 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0806DB38: + .4byte _0806DB50 + .4byte _0806DB64 + .4byte _0806DB78 + .4byte _0806DB8C + .4byte _0806DBA0 + .4byte _0806DBB4 +_0806DB50: + ldr r0, =gBaseStats + lsls r1, r5, 3 + subs r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0xA] + lsls r0, 30 + b _0806DBC2 + .pool +_0806DB64: + ldr r0, =gBaseStats + lsls r1, r5, 3 + subs r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0xA] + b _0806DBC0 + .pool +_0806DB78: + ldr r0, =gBaseStats + lsls r1, r5, 3 + subs r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0xA] + lsls r0, 26 + b _0806DBC2 + .pool +_0806DB8C: + ldr r0, =gBaseStats + lsls r1, r5, 3 + subs r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0xA] + lsrs r0, 6 + b _0806DBC4 + .pool +_0806DBA0: + ldr r0, =gBaseStats + lsls r1, r5, 3 + subs r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0xB] + lsls r0, 30 + b _0806DBC2 + .pool +_0806DBB4: + ldr r0, =gBaseStats + lsls r1, r5, 3 + subs r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0xB] +_0806DBC0: + lsls r0, 28 +_0806DBC2: + lsrs r0, 30 +_0806DBC4: + adds r4, r0, 0 + muls r4, r2 +_0806DBC8: + mov r0, r8 + movs r1, 0xC + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xAF + bne _0806DC14 + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806DC00 + ldr r0, =0x02024404 + ldrb r0, [r0, 0x7] + b _0806DC1C + .pool +_0806DC00: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x00003226 + adds r0, r2 + ldrb r0, [r0] + b _0806DC1C + .pool +_0806DC14: + bl itemid_get_x12 + lsls r0, 24 + lsrs r0, 24 +_0806DC1C: + cmp r0, 0x18 + bne _0806DC24 + lsls r0, r4, 17 + lsrs r4, r0, 16 +_0806DC24: + lsls r0, r4, 16 + asrs r2, r0, 16 + adds r1, r7, r2 + movs r0, 0xFF + lsls r0, 1 + cmp r1, r0 + ble _0806DC3C + adds r0, r2, r0 + adds r1, r7, r4 + subs r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 +_0806DC3C: + mov r0, sp + adds r2, r0, r6 + ldrb r3, [r2] + lsls r0, r4, 16 + asrs r1, r0, 16 + adds r0, r3, r1 + cmp r0, 0xFF + ble _0806DC58 + adds r0, r1, 0 + adds r0, 0xFF + adds r1, r3, r4 + subs r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 +_0806DC58: + adds r0, r3, r4 + strb r0, [r2] + adds r0, r7, r4 + lsls r0, 16 + lsrs r7, r0, 16 + adds r1, r6, 0 + adds r1, 0x1A + mov r0, r8 + bl pokemon_setattr + adds r6, 0x1 + cmp r6, 0x5 + bgt _0806DC7A +_0806DC72: + ldr r0, =0x000001fd + cmp r7, r0 + bhi _0806DC7A + b _0806DB14 +_0806DC7A: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806DADC + + thumb_func_start sub_806DC8C +sub_806DC8C: @ 806DC8C + push {r4-r6,lr} + adds r6, r0, 0 + movs r5, 0 + movs r4, 0 +_0806DC94: + adds r1, r4, 0 + adds r1, 0x1A + adds r0, r6, 0 + movs r2, 0 + bl pokemon_getattr + adds r0, r5, r0 + lsls r0, 16 + lsrs r5, r0, 16 + adds r4, 0x1 + cmp r4, 0x5 + ble _0806DC94 + adds r0, r5, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_806DC8C + + thumb_func_start sub_806DCB4 +sub_806DCB4: @ 806DCB4 + push {r4-r6,lr} + sub sp, 0x4 + adds r6, r0, 0 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r5, r0, 16 + movs r0, 0x80 + lsls r0, 7 + cmp r5, r0 + beq _0806DCDA + movs r0, 0x80 + lsls r0, 8 + cmp r5, r0 + beq _0806DCDA + movs r0, 0xC0 + lsls r0, 8 + cmp r5, r0 + bne _0806DD70 +_0806DCDA: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x6 + bl __umodsi3 + lsls r0, 16 + lsrs r5, r0, 16 + movs r0, 0x64 + muls r0, r5 + adds r4, r6, r0 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + beq _0806DCDA + adds r0, r4, 0 + movs r1, 0x2D + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + bne _0806DCDA + ldr r1, =gUnknown_0832A328 + lsls r0, r5, 2 + adds r0, r1 + ldrb r1, [r0] + adds r0, r6, 0 + bl sub_806DDE4 + lsls r0, 24 + cmp r0, 0 + bne _0806DD70 + movs r4, 0x7 +_0806DD24: + bl GenerateRandomNumber + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + strb r0, [r1] + adds r2, r0, 0 + adds r1, r2, 0 + ands r1, r4 + cmp r1, 0 + beq _0806DD24 + movs r0, 0xF0 + ands r0, r2 + cmp r0, 0 + beq _0806DD46 + mov r0, sp + strb r1, [r0] +_0806DD46: + mov r0, sp + ldrb r0, [r0] + lsls r1, r0, 4 + orrs r0, r1 + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + strb r0, [r1] + movs r1, 0xF3 + ands r1, r0 + mov r0, sp + strb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + movs r0, 0x64 + muls r0, r5 + adds r0, r6, r0 + movs r1, 0x22 + mov r2, sp + bl pokemon_setattr +_0806DD70: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806DCB4 + + thumb_func_start sub_806DD7C +sub_806DD7C: @ 806DD7C + push {r4-r7,lr} + sub sp, 0x4 + adds r7, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + movs r3, 0 + movs r6, 0x1 + movs r5, 0 + cmp r4, 0 + beq _0806DDC4 +_0806DD90: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0806DDB8 + movs r0, 0x64 + muls r0, r3 + adds r0, r7, r0 + movs r1, 0x22 + movs r2, 0 + str r3, [sp] + bl pokemon_getattr + movs r1, 0xF + ands r1, r0 + ldr r3, [sp] + cmp r1, 0 + beq _0806DDB8 + orrs r5, r6 + lsls r0, r5, 24 + lsrs r5, r0, 24 +_0806DDB8: + adds r3, 0x1 + lsls r6, 1 + lsrs r4, 1 + cmp r4, 0 + bne _0806DD90 + b _0806DDD8 +_0806DDC4: + adds r0, r7, 0 + movs r1, 0x22 + movs r2, 0 + bl pokemon_getattr + movs r1, 0xF + ands r1, r0 + cmp r1, 0 + beq _0806DDD8 + movs r5, 0x1 +_0806DDD8: + adds r0, r5, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_806DD7C + + thumb_func_start sub_806DDE4 +sub_806DDE4: @ 806DDE4 + push {r4-r7,lr} + sub sp, 0x4 + adds r7, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + movs r3, 0 + movs r6, 0x1 + movs r5, 0 + cmp r4, 0 + beq _0806DE28 +_0806DDF8: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0806DE1C + movs r0, 0x64 + muls r0, r3 + adds r0, r7, r0 + movs r1, 0x22 + movs r2, 0 + str r3, [sp] + bl pokemon_getattr + ldr r3, [sp] + cmp r0, 0 + beq _0806DE1C + orrs r5, r6 + lsls r0, r5, 24 + lsrs r5, r0, 24 +_0806DE1C: + adds r3, 0x1 + lsls r6, 1 + lsrs r4, 1 + cmp r4, 0 + bne _0806DDF8 + b _0806DE38 +_0806DE28: + adds r0, r7, 0 + movs r1, 0x22 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + beq _0806DE38 + movs r5, 0x1 +_0806DE38: + adds r0, r5, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_806DDE4 + + thumb_func_start sub_806DE44 +sub_806DE44: @ 806DE44 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r7, r0, 16 + movs r6, 0 + mov r5, sp +_0806DE50: + movs r0, 0x64 + adds r1, r6, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + beq _0806DEB2 + adds r0, r4, 0 + movs r1, 0x22 + movs r2, 0 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + strb r0, [r5] + movs r1, 0xF + adds r2, r0, 0 + ands r1, r2 + cmp r1, 0 + beq _0806DEB2 + cmp r1, r7 + bcc _0806DE8A + cmp r7, 0x4 + bls _0806DE94 +_0806DE8A: + movs r0, 0xF0 + ands r0, r2 + b _0806DE96 + .pool +_0806DE94: + subs r0, r2, r7 +_0806DE96: + strb r0, [r5] + ldrb r0, [r5] + cmp r0, 0 + bne _0806DEA2 + movs r0, 0x10 + strb r0, [r5] +_0806DEA2: + movs r0, 0x64 + muls r0, r6 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x22 + mov r2, sp + bl pokemon_setattr +_0806DEB2: + adds r6, 0x1 + cmp r6, 0x5 + ble _0806DE50 + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806DE44 + + thumb_func_start sub_806DEC4 +sub_806DEC4: @ 806DEC4 + push {r4-r7,lr} + sub sp, 0x4 + adds r7, r0, 0 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + bne _0806DF6A + movs r5, 0 +_0806DEE0: + movs r0, 0x64 + adds r6, r5, 0 + muls r6, r0 + adds r4, r7, r6 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + beq _0806DF64 + adds r0, r4, 0 + movs r1, 0x22 + movs r2, 0 + bl pokemon_getattr + lsls r0, 24 + lsrs r1, r0, 24 + mov r0, sp + strb r1, [r0] + cmp r1, 0 + beq _0806DF64 + movs r0, 0xF + ands r0, r1 + cmp r0, 0 + beq _0806DF64 + cmp r5, 0 + beq _0806DF3A + adds r0, r6, 0 + subs r0, 0x64 + adds r4, r7, r0 + adds r0, r4, 0 + movs r1, 0x22 + movs r2, 0 + bl pokemon_getattr + movs r1, 0xF0 + ands r1, r0 + cmp r1, 0 + bne _0806DF3A + adds r0, r4, 0 + movs r1, 0x22 + mov r2, sp + bl pokemon_setattr +_0806DF3A: + cmp r5, 0x5 + beq _0806DF64 + movs r0, 0x64 + muls r0, r5 + adds r0, 0x64 + adds r4, r7, r0 + adds r0, r4, 0 + movs r1, 0x22 + movs r2, 0 + bl pokemon_getattr + movs r1, 0xF0 + ands r1, r0 + cmp r1, 0 + bne _0806DF64 + adds r0, r4, 0 + movs r1, 0x22 + mov r2, sp + bl pokemon_setattr + adds r5, 0x1 +_0806DF64: + adds r5, 0x1 + cmp r5, 0x5 + ble _0806DEE0 +_0806DF6A: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_806DEC4 + + thumb_func_start sub_806DF74 +sub_806DF74: @ 806DF74 + push {r4-r6,lr} + sub sp, 0x8 + adds r5, r0, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x38 + movs r2, 0 + bl pokemon_getattr + adds r0, 0x1 + mov r1, sp + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0x19 + movs r2, 0 + bl pokemon_getattr + str r0, [sp, 0x4] + ldr r6, =gExperienceTables + ldr r2, =gBaseStats + lsls r1, r4, 3 + subs r1, r4 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x13] + movs r1, 0xCA + lsls r1, 1 + adds r4, r2, 0 + muls r4, r1 + movs r2, 0xC8 + lsls r2, 1 + adds r1, r6, r2 + adds r1, r4, r1 + ldr r1, [r1] + cmp r0, r1 + bls _0806DFD4 + str r1, [sp, 0x4] + add r2, sp, 0x4 + adds r0, r5, 0 + movs r1, 0x19 + bl pokemon_setattr +_0806DFD4: + mov r0, sp + ldrb r0, [r0] + cmp r0, 0x64 + bhi _0806DFEA + lsls r0, 2 + adds r0, r4 + adds r0, r6 + ldr r1, [sp, 0x4] + ldr r0, [r0] + cmp r1, r0 + bcs _0806DFF8 +_0806DFEA: + movs r0, 0 + b _0806E004 + .pool +_0806DFF8: + adds r0, r5, 0 + movs r1, 0x38 + mov r2, sp + bl pokemon_setattr + movs r0, 0x1 +_0806E004: + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_806DF74 + + thumb_func_start sub_806E00C +sub_806E00C: @ 806E00C + push {r4,r5,lr} + lsls r1, 24 + lsrs r4, r1, 24 + adds r5, r4, 0 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r1, r0, 16 + adds r3, r1, 0 + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + bne _0806E02E + movs r0, 0 + b _0806E05A +_0806E02E: + cmp r4, 0x1F + bls _0806E04C + adds r0, r4, 0 + subs r0, 0x20 + movs r2, 0x1 + lsls r2, r0 + ldr r0, =gTMHMLearnsets + lsls r1, 3 + adds r0, 0x4 + adds r1, r0 + ldr r0, [r1] + ands r0, r2 + b _0806E05A + .pool +_0806E04C: + movs r1, 0x1 + lsls r1, r5 + ldr r2, =gTMHMLearnsets + lsls r0, r3, 3 + adds r0, r2 + ldr r0, [r0] + ands r0, r1 +_0806E05A: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806E00C + + thumb_func_start sub_806E064 +sub_806E064: @ 806E064 + push {r4,lr} + lsls r0, 16 + lsrs r3, r0, 16 + adds r4, r3, 0 + lsls r1, 24 + lsrs r1, 24 + adds r2, r1, 0 + movs r0, 0xCE + lsls r0, 1 + cmp r3, r0 + bne _0806E07E + movs r0, 0 + b _0806E0AA +_0806E07E: + cmp r1, 0x1F + bls _0806E09C + adds r0, r1, 0 + subs r0, 0x20 + movs r2, 0x1 + lsls r2, r0 + ldr r0, =gTMHMLearnsets + lsls r1, r3, 3 + adds r0, 0x4 + adds r1, r0 + ldr r0, [r1] + ands r0, r2 + b _0806E0AA + .pool +_0806E09C: + movs r1, 0x1 + lsls r1, r2 + ldr r2, =gTMHMLearnsets + lsls r0, r4, 3 + adds r0, r2 + ldr r0, [r0] + ands r0, r1 +_0806E0AA: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806E064 + + thumb_func_start sub_806E0B4 +sub_806E0B4: @ 806E0B4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + adds r6, r0, 0 + str r1, [sp, 0x8] + movs r0, 0 + mov r10, r0 + adds r0, r6, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r7, r0, 16 + adds r0, r6, 0 + movs r1, 0x38 + movs r2, 0 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0xC] + movs r5, 0 + mov r4, sp +_0806E0EA: + adds r1, r5, 0 + adds r1, 0xD + adds r0, r6, 0 + movs r2, 0 + bl pokemon_getattr + strh r0, [r4] + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _0806E0EA + movs r5, 0 + ldr r6, =gLevelUpLearnsetPointers + lsls r1, r7, 2 + adds r2, r1, r6 + ldr r3, [r2] + ldrh r0, [r3] + ldr r4, =0x0000ffff + str r1, [sp, 0x14] + cmp r0, r4 + beq _0806E1E4 + mov r9, r2 + str r3, [sp, 0x10] +_0806E118: + lsls r2, r5, 1 + ldr r1, [sp, 0x10] + adds r0, r2, r1 + ldrh r3, [r0] + movs r0, 0xFE + lsls r0, 8 + ands r0, r3 + ldr r4, [sp, 0xC] + lsls r1, r4, 9 + adds r7, r2, 0 + adds r5, 0x1 + mov r12, r5 + cmp r0, r1 + bgt _0806E1CE + movs r4, 0 + mov r0, sp + ldrh r1, [r0] + ldr r0, =0x000001ff + ands r0, r3 + cmp r1, r0 + beq _0806E168 + ldr r0, [sp, 0x14] + ldr r1, =gLevelUpLearnsetPointers + adds r6, r0, r1 + ldr r2, =0x000001ff + mov r8, r2 + mov r3, sp + adds r5, r7, 0 +_0806E150: + adds r3, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + bgt _0806E168 + ldr r0, [r6] + adds r0, r5, r0 + ldrh r1, [r0] + ldrh r2, [r3] + mov r0, r8 + ands r0, r1 + cmp r2, r0 + bne _0806E150 +_0806E168: + cmp r4, 0x4 + bne _0806E1CE + movs r4, 0 + cmp r4, r10 + bge _0806E1AC + mov r1, r9 + ldr r0, [r1] + adds r0, r7, r0 + ldrh r1, [r0] + ldr r0, [sp, 0x8] + ldrh r2, [r0] + ldr r0, =0x000001ff + ands r0, r1 + cmp r2, r0 + beq _0806E1AC + ldr r1, [sp, 0x14] + ldr r2, =gLevelUpLearnsetPointers + adds r6, r1, r2 + ldr r0, =0x000001ff + mov r8, r0 + ldr r3, [sp, 0x8] + adds r5, r7, 0 +_0806E194: + adds r3, 0x2 + adds r4, 0x1 + cmp r4, r10 + bge _0806E1AC + ldr r0, [r6] + adds r0, r5, r0 + ldrh r1, [r0] + ldrh r2, [r3] + mov r0, r8 + ands r0, r1 + cmp r2, r0 + bne _0806E194 +_0806E1AC: + cmp r4, r10 + bne _0806E1CE + mov r0, r10 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r2, r4, 1 + ldr r1, [sp, 0x8] + adds r2, r1 + mov r4, r9 + ldr r0, [r4] + adds r0, r7, r0 + ldrh r1, [r0] + ldr r0, =0x000001ff + ands r0, r1 + strh r0, [r2] +_0806E1CE: + mov r5, r12 + cmp r5, 0x13 + bgt _0806E1E4 + mov r1, r9 + ldr r0, [r1] + lsls r1, r5, 1 + adds r1, r0 + ldrh r0, [r1] + ldr r2, =0x0000ffff + cmp r0, r2 + bne _0806E118 +_0806E1E4: + mov r0, r10 + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806E0B4 + + thumb_func_start sub_806E204 +sub_806E204: @ 806E204 + push {r4-r7,lr} + adds r6, r1, 0 + lsls r0, 16 + movs r5, 0 + movs r4, 0 + ldr r1, =gLevelUpLearnsetPointers + lsrs r0, 14 + adds r0, r1 + ldr r2, [r0] + ldrh r0, [r2] + ldr r1, =0x0000ffff + cmp r0, r1 + beq _0806E248 + ldr r0, =0x000001ff + mov r12, r0 + adds r7, r1, 0 + adds r3, r2, 0 +_0806E226: + adds r1, r5, 0 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 1 + adds r1, r6 + ldrh r2, [r3] + mov r0, r12 + ands r0, r2 + strh r0, [r1] + adds r3, 0x2 + adds r4, 0x1 + cmp r4, 0x13 + bgt _0806E248 + ldrh r0, [r3] + cmp r0, r7 + bne _0806E226 +_0806E248: + adds r0, r5, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806E204 + + thumb_func_start sub_806E25C +sub_806E25C: @ 806E25C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x3C + adds r6, r0, 0 + movs r0, 0 + mov r10, r0 + adds r0, r6, 0 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r6, 0 + movs r1, 0x38 + movs r2, 0 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x30] + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + bne _0806E298 + movs r0, 0 + b _0806E3A2 +_0806E298: + movs r5, 0 + lsls r4, 2 + str r4, [sp, 0x38] + mov r4, sp +_0806E2A0: + adds r1, r5, 0 + adds r1, 0xD + adds r0, r6, 0 + movs r2, 0 + bl pokemon_getattr + strh r0, [r4] + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _0806E2A0 + movs r5, 0 + ldr r3, =gLevelUpLearnsetPointers + ldr r2, [sp, 0x38] + adds r1, r2, r3 + ldr r0, [r1] + ldrh r0, [r0] + ldr r2, =0x0000ffff + cmp r0, r2 + beq _0806E3A0 + mov r9, r1 + mov r4, sp + adds r4, 0x8 + str r4, [sp, 0x34] +_0806E2D0: + mov r1, r9 + ldr r0, [r1] + lsls r2, r5, 1 + adds r0, r2, r0 + ldrh r3, [r0] + movs r0, 0xFE + lsls r0, 8 + ands r0, r3 + ldr r4, [sp, 0x30] + lsls r1, r4, 9 + adds r7, r2, 0 + adds r5, 0x1 + mov r12, r5 + cmp r0, r1 + bgt _0806E38A + movs r4, 0 + mov r0, sp + ldrh r1, [r0] + ldr r0, =0x000001ff + ands r0, r3 + cmp r1, r0 + beq _0806E322 + ldr r0, [sp, 0x38] + ldr r1, =gLevelUpLearnsetPointers + adds r6, r0, r1 + ldr r2, =0x000001ff + mov r8, r2 + mov r3, sp + adds r5, r7, 0 +_0806E30A: + adds r3, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + bgt _0806E322 + ldr r0, [r6] + adds r0, r5, r0 + ldrh r1, [r0] + ldrh r2, [r3] + mov r0, r8 + ands r0, r1 + cmp r2, r0 + bne _0806E30A +_0806E322: + cmp r4, 0x4 + bne _0806E38A + movs r4, 0 + cmp r4, r10 + bge _0806E368 + mov r1, r9 + ldr r0, [r1] + adds r0, r7, r0 + ldrh r1, [r0] + ldr r0, [sp, 0x34] + ldrh r2, [r0] + ldr r0, =0x000001ff + ands r0, r1 + add r1, sp, 0x8 + cmp r2, r0 + beq _0806E368 + ldr r2, [sp, 0x38] + ldr r0, =gLevelUpLearnsetPointers + adds r6, r2, r0 + ldr r2, =0x000001ff + mov r8, r2 + adds r3, r1, 0 + adds r5, r7, 0 +_0806E350: + adds r3, 0x2 + adds r4, 0x1 + cmp r4, r10 + bge _0806E368 + ldr r0, [r6] + adds r0, r5, r0 + ldrh r1, [r0] + ldrh r2, [r3] + mov r0, r8 + ands r0, r1 + cmp r2, r0 + bne _0806E350 +_0806E368: + cmp r4, r10 + bne _0806E38A + mov r0, r10 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r2, r4, 1 + ldr r4, [sp, 0x34] + adds r2, r4, r2 + mov r1, r9 + ldr r0, [r1] + adds r0, r7, r0 + ldrh r1, [r0] + ldr r0, =0x000001ff + ands r0, r1 + strh r0, [r2] +_0806E38A: + mov r5, r12 + cmp r5, 0x13 + bgt _0806E3A0 + mov r2, r9 + ldr r0, [r2] + lsls r1, r5, 1 + adds r1, r0 + ldrh r0, [r1] + ldr r4, =0x0000ffff + cmp r0, r4 + bne _0806E2D0 +_0806E3A0: + mov r0, r10 +_0806E3A2: + add sp, 0x3C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806E25C + + thumb_func_start sub_806E3C0 +sub_806E3C0: @ 806E3C0 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + bl sub_809D42C + cmp r0, 0 + beq _0806E3DA + adds r0, r4, 0 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + b _0806E3F2 +_0806E3DA: + adds r0, r4, 0 + bl SpeciesToHoennPokedexNum + adds r4, r0, 0 + cmp r4, 0xCA + bls _0806E3F0 + ldr r0, =0x0000ffff + b _0806E3F2 + .pool +_0806E3F0: + adds r0, r4, 0 +_0806E3F2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_806E3C0 + + thumb_func_start sub_806E3F8 +sub_806E3F8: @ 806E3F8 + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl SpeciesToHoennPokedexNum + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xCA + bhi _0806E40E + movs r0, 0x1 + b _0806E410 +_0806E40E: + movs r0, 0 +_0806E410: + pop {r1} + bx r1 + thumb_func_end sub_806E3F8 + + thumb_func_start sub_806E414 +sub_806E414: @ 806E414 + push {lr} + ldr r1, =0x020244e4 + movs r2, 0 + adds r0, r1, 0x3 +_0806E41C: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _0806E41C + pop {r0} + bx r0 + .pool + thumb_func_end sub_806E414 + + thumb_func_start song_id_for_battle +song_id_for_battle: @ 806E42C + push {lr} + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 5 + ands r0, r1 + cmp r0, 0 + beq _0806E448 + movs r0, 0xF0 + lsls r0, 1 + b _0806E646 + .pool +_0806E448: + movs r0, 0x80 + lsls r0, 7 + ands r0, r1 + cmp r0, 0 + beq _0806E45C + ldr r0, =0x000001df + b _0806E646 + .pool +_0806E45C: + ldr r0, =0x02000002 + ands r0, r1 + cmp r0, 0 + beq _0806E466 + b _0806E63C +_0806E466: + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _0806E470 + b _0806E642 +_0806E470: + ldr r0, =0x003f0100 + ands r0, r1 + cmp r0, 0 + beq _0806E494 + ldr r0, =0x02038bca + ldrh r0, [r0] + bl sub_8162BD8 + lsls r0, 24 + lsrs r0, 24 + b _0806E4B2 + .pool +_0806E494: + movs r0, 0x80 + lsls r0, 19 + ands r1, r0 + cmp r1, 0 + beq _0806E4A2 + movs r0, 0xA + b _0806E4B2 +_0806E4A2: + ldr r2, =gTrainers + ldr r0, =0x02038bca + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x1] +_0806E4B2: + subs r0, 0x3 + cmp r0, 0x3D + bls _0806E4BA + b _0806E63C +_0806E4BA: + lsls r0, 2 + ldr r1, =_0806E4D0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0806E4D0: + .4byte _0806E5D0 + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E5D0 + .4byte _0806E63C + .4byte _0806E5D0 + .4byte _0806E63C + .4byte _0806E5C8 + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E62C + .4byte _0806E5D8 + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E5E0 + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E5D0 + .4byte _0806E5E6 + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E5C8 + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E632 + .4byte _0806E632 + .4byte _0806E632 + .4byte _0806E632 + .4byte _0806E632 + .4byte _0806E632 + .4byte _0806E632 +_0806E5C8: + ldr r0, =0x000001e3 + b _0806E646 + .pool +_0806E5D0: + ldr r0, =0x000001db + b _0806E646 + .pool +_0806E5D8: + ldr r0, =0x000001dd + b _0806E646 + .pool +_0806E5E0: + movs r0, 0xEF + lsls r0, 1 + b _0806E646 +_0806E5E6: + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x003f0100 + ands r0, r1 + cmp r0, 0 + beq _0806E604 +_0806E5F2: + ldr r0, =0x000001e1 + b _0806E646 + .pool +_0806E604: + ldr r0, =0x02038bca + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, =gTrainers + 0x4 @ name offset + adds r0, r1 + ldr r1, =gUnknown_085CCB98 + bl CompareString + cmp r0, 0 + beq _0806E63C + b _0806E5F2 + .pool +_0806E62C: + movs r0, 0xF1 + lsls r0, 1 + b _0806E646 +_0806E632: + ldr r0, =0x000001d7 + b _0806E646 + .pool +_0806E63C: + movs r0, 0xEE + lsls r0, 1 + b _0806E646 +_0806E642: + movs r0, 0xED + lsls r0, 1 +_0806E646: + pop {r1} + bx r1 + thumb_func_end song_id_for_battle + + thumb_func_start sub_806E64C +sub_806E64C: @ 806E64C + push {lr} + bl map_music_set_to_zero + bl m4aMPlayAllStop + bl song_id_for_battle + lsls r0, 16 + lsrs r0, 16 + bl song_play_for_text + pop {r0} + bx r0 + thumb_func_end sub_806E64C + + thumb_func_start current_map_music_set__default_for_battle +current_map_music_set__default_for_battle: @ 806E668 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + bl map_music_set_to_zero + bl m4aMPlayAllStop + cmp r4, 0 + beq _0806E682 + adds r0, r4, 0 + bl current_map_music_set + b _0806E68E +_0806E682: + bl song_id_for_battle + lsls r0, 16 + lsrs r0, 16 + bl current_map_music_set +_0806E68E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end current_map_music_set__default_for_battle + + thumb_func_start sub_806E694 +sub_806E694: @ 806E694 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl map_music_set_to_zero + bl m4aMPlayAllStop + ldr r0, =sub_806E6CC + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806E694 + + thumb_func_start sub_806E6CC +sub_806E6CC: @ 806E6CC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r1 + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _0806E6F0 + ldrh r0, [r1, 0x8] + bl current_map_music_set + b _0806E6FC + .pool +_0806E6F0: + bl song_id_for_battle + lsls r0, 16 + lsrs r0, 16 + bl current_map_music_set +_0806E6FC: + adds r0, r4, 0 + bl remove_task + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_806E6CC + + thumb_func_start pokemon_get_pal +pokemon_get_pal: @ 806E708 + push {r4-r6,lr} + adds r5, r0, 0 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x1 + movs r2, 0 + bl pokemon_getattr + adds r6, r0, 0 + adds r0, r5, 0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + adds r2, r0, 0 + adds r0, r4, 0 + adds r1, r6, 0 + bl species_and_otid_get_pal + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end pokemon_get_pal + + thumb_func_start species_and_otid_get_pal +species_and_otid_get_pal: @ 806E740 + push {r4,r5,lr} + adds r3, r2, 0 + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + bls _0806E75C + ldr r0, =gMonPaletteTable + ldr r0, [r0] + b _0806E788 + .pool +_0806E75C: + lsrs r0, r1, 16 + ldr r2, =0x0000ffff + ands r1, r2 + eors r0, r1 + lsrs r1, r3, 16 + eors r0, r1 + ands r3, r2 + eors r0, r3 + cmp r0, 0x7 + bls _0806E780 + ldr r0, =gMonPaletteTable + lsls r1, r4, 3 + b _0806E784 + .pool +_0806E780: + ldr r0, =gMonShinyPaletteTable + lsls r1, r5, 3 +_0806E784: + adds r1, r0 + ldr r0, [r1] +_0806E788: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end species_and_otid_get_pal + + thumb_func_start sub_806E794 +sub_806E794: @ 806E794 + push {r4-r6,lr} + adds r5, r0, 0 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x1 + movs r2, 0 + bl pokemon_getattr + adds r6, r0, 0 + adds r0, r5, 0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + adds r2, r0, 0 + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_806E7CC + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_806E794 + + thumb_func_start sub_806E7CC +sub_806E7CC: @ 806E7CC + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + lsrs r0, r1, 16 + ldr r3, =0x0000ffff + ands r1, r3 + eors r0, r1 + lsrs r1, r2, 16 + eors r0, r1 + ands r2, r3 + eors r0, r2 + cmp r0, 0x7 + bls _0806E7F4 + lsls r0, r4, 3 + ldr r1, =gMonPaletteTable + b _0806E7F8 + .pool +_0806E7F4: + lsls r0, r4, 3 + ldr r1, =gMonShinyPaletteTable +_0806E7F8: + adds r0, r1 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806E7CC + + thumb_func_start sub_806E804 +sub_806E804: @ 806E804 + push {r4,lr} + lsls r0, 16 + lsrs r3, r0, 16 + ldr r2, =gUnknown_08329EEA + ldrh r0, [r2] + ldr r1, =0x0000ffff + cmp r0, r1 + beq _0806E836 + adds r4, r1, 0 + adds r1, r2, 0 +_0806E818: + ldrh r0, [r2] + adds r1, 0x2 + adds r2, 0x2 + cmp r0, r3 + bne _0806E830 + movs r0, 0x1 + b _0806E838 + .pool +_0806E830: + ldrh r0, [r1] + cmp r0, r4 + bne _0806E818 +_0806E836: + movs r0, 0 +_0806E838: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_806E804 + + thumb_func_start sub_806E840 +sub_806E840: @ 806E840 + lsls r0, 16 + lsrs r0, 16 + ldr r2, =gBaseStats + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x19] + lsrs r0, 7 + bx lr + .pool + thumb_func_end sub_806E840 + + thumb_func_start sub_806E858 +sub_806E858: @ 806E858 + push {r4,lr} + lsls r4, r1, 24 + lsrs r4, 24 + bl GetNature + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gUnknown_085B25A0 + lsls r1, r0, 2 + adds r1, r0 + adds r1, r4 + adds r1, r2 + movs r0, 0 + ldrsb r0, [r1, r0] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806E858 + + thumb_func_start sub_806E880 +sub_806E880: @ 806E880 + push {r4,lr} + lsls r4, r1, 24 + lsrs r4, 24 + bl GetNatureFromPersonality + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gUnknown_085B25A0 + lsls r1, r0, 2 + adds r1, r0 + adds r1, r4 + adds r1, r2 + movs r0, 0 + ldrsb r0, [r1, r0] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806E880 + + thumb_func_start sub_806E8A8 +sub_806E8A8: @ 806E8A8 + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + movs r1, 0x7 + mov r2, sp + bl pokemon_getattr + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl pokemon_getattr + mov r1, sp + bl sub_806E8D4 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_806E8A8 + + thumb_func_start sub_806E8D4 +sub_806E8D4: @ 806E8D4 + push {r4,r5,lr} + adds r5, r1, 0 + ldr r1, =0x03005d90 + ldr r3, [r1] + ldrb r2, [r3, 0xA] + ldrb r1, [r3, 0xB] + lsls r1, 8 + orrs r2, r1 + ldrb r1, [r3, 0xC] + lsls r1, 16 + orrs r2, r1 + ldrb r1, [r3, 0xD] + lsls r1, 24 + orrs r2, r1 + cmp r0, r2 + bne _0806E91C + movs r4, 0 + ldrb r0, [r5] + cmp r0, 0xFF + beq _0806E912 + adds r2, r5, 0 +_0806E8FE: + adds r1, r3, r4 + ldrb r0, [r2] + ldrb r1, [r1] + cmp r0, r1 + bne _0806E91C + adds r2, 0x1 + adds r4, 0x1 + ldrb r0, [r2] + cmp r0, 0xFF + bne _0806E8FE +_0806E912: + movs r0, 0 + b _0806E91E + .pool +_0806E91C: + movs r0, 0x1 +_0806E91E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_806E8D4 + + thumb_func_start sub_806E924 +sub_806E924: @ 806E924 + push {lr} + bl pokemon_restore_pp + pop {r0} + bx r0 + thumb_func_end sub_806E924 + + thumb_func_start pokemon_restore_pp +pokemon_restore_pp: @ 806E930 + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r6, 0 +_0806E938: + adds r4, r6, 0 + adds r4, 0xD + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _0806E984 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + bl pokemon_getattr_encrypted + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr_encrypted + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r2, r6, 24 + lsrs r2, 24 + adds r0, r4, 0 + bl CalcPPWithPPUps + mov r1, sp + strb r0, [r1] + adds r1, r6, 0 + adds r1, 0x11 + adds r0, r5, 0 + mov r2, sp + bl pokemon_setattr_encrypted +_0806E984: + adds r6, 0x1 + cmp r6, 0x3 + ble _0806E938 + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end pokemon_restore_pp + + thumb_func_start sub_806E994 +sub_806E994: @ 806E994 + push {r4,r5,lr} + ldr r2, =0x0202420a + ldr r5, =0x0202449c + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0xB0 + ldrb r0, [r0] + strb r0, [r2] + ldr r4, =0x02022f58 + movs r0, 0xFD + strb r0, [r4] + movs r0, 0x4 + strb r0, [r4, 0x1] + adds r1, 0x49 + ldrb r0, [r1] + strb r0, [r4, 0x2] + movs r0, 0xFF + strb r0, [r4, 0x4] + ldrb r0, [r1] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0806E9E8 + ldr r1, =0x0202406e + ldr r0, [r5] + adds r0, 0x49 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrb r0, [r0] + bl pokemon_order_func + b _0806E9F6 + .pool +_0806E9E8: + ldr r1, =0x0202406e + ldr r0, [r5] + adds r0, 0x49 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] +_0806E9F6: + strb r0, [r4, 0x3] + ldr r4, =0x02022f68 + movs r0, 0xFD + strb r0, [r4] + movs r0, 0x4 + strb r0, [r4, 0x1] + ldr r1, =0x020244b8 + ldrb r0, [r1] + strb r0, [r4, 0x2] + ldr r2, =0x0202406e + ldrb r0, [r1] + lsls r0, 1 + adds r0, r2 + ldrb r0, [r0] + bl pokemon_order_func + strb r0, [r4, 0x3] + movs r0, 0xFF + strb r0, [r4, 0x4] + ldr r0, =gUnknown_085CB2A1 + ldr r1, =0x02021fc4 + bl get_battle_strings + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806E994 + + thumb_func_start sub_806EA40 +sub_806EA40: @ 806EA40 + push {lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r1, 0 + ldr r2, =gUnknown_08329EFC +_0806EA4A: + ldrh r0, [r2] + cmp r0, r3 + bne _0806EA58 + adds r0, r1, 0 + b _0806EA62 + .pool +_0806EA58: + adds r2, 0x4 + adds r1, 0x1 + cmp r1, 0x8 + ble _0806EA4A + movs r0, 0 +_0806EA62: + pop {r1} + bx r1 + thumb_func_end sub_806EA40 + + thumb_func_start sub_806EA68 +sub_806EA68: @ 806EA68 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x00302008 + ands r0, r1 + cmp r0, 0 + beq _0806EA7C + b _0806EB90 +_0806EA7C: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =0x02024744 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x2D + mov r8, r0 + movs r7, 0x5F + ldr r5, =0x020244ec + adds r0, r5, 0 + movs r1, 0x6 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + bne _0806EAC6 + adds r0, r5, 0 + bl GetMonAbility + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xE + bne _0806EAC6 + movs r2, 0x14 + mov r8, r2 + movs r7, 0x50 +_0806EAC6: + ldr r0, =0x02037318 + ldrh r1, [r0, 0x12] + movs r0, 0xD2 + lsls r0, 1 + cmp r1, r0 + bne _0806EB2C + adds r0, r4, 0 + bl sub_806EA40 + adds r2, r0, 0 + cmp r2, 0 + beq _0806EB04 + cmp r6, r7 + bcc _0806EB90 + ldr r0, =0x02024744 + lsls r2, 2 + ldr r1, =gUnknown_08329EFE + b _0806EB6C + .pool +_0806EB04: + cmp r6, r8 + bcc _0806EB90 + cmp r6, r7 + bcs _0806EB18 + ldr r0, =0x02024744 + lsls r2, r4, 3 + b _0806EB66 + .pool +_0806EB18: + ldr r0, =0x02024744 + lsls r2, r4, 3 + subs r2, r4 + lsls r2, 2 + ldr r1, =gBaseStats + 0xe @ item 2 offset + b _0806EB6C + .pool +_0806EB2C: + ldr r0, =gBaseStats + mov r12, r0 + lsls r0, r4, 3 + subs r1, r0, r4 + lsls r5, r1, 2 + mov r2, r12 + adds r1, r5, r2 + ldrh r3, [r1, 0xC] + adds r2, r0, 0 + ldrh r1, [r1, 0xE] + cmp r3, r1 + bne _0806EB5C + cmp r3, 0 + beq _0806EB5C + ldr r0, =0x02024744 + mov r2, r12 + adds r2, 0xC + adds r2, r5, r2 + b _0806EB6E + .pool +_0806EB5C: + cmp r6, r8 + bcc _0806EB90 + cmp r6, r7 + bcs _0806EB80 + ldr r0, =0x02024744 +_0806EB66: + subs r2, r4 + lsls r2, 2 + ldr r1, =gBaseStats + 0xc @ item 1 offset +_0806EB6C: + adds r2, r1 +_0806EB6E: + movs r1, 0xC + bl pokemon_setattr + b _0806EB90 + .pool +_0806EB80: + ldr r0, =0x02024744 + subs r2, r4 + lsls r2, 2 + ldr r1, =gBaseStats + 0xe @ item 2 offset + adds r2, r1 + movs r1, 0xC + bl pokemon_setattr +_0806EB90: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806EA68 + + thumb_func_start sub_806EBA4 +sub_806EBA4: @ 806EBA4 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x1 + movs r2, 0 + bl pokemon_getattr + adds r5, r0, 0 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + adds r0, r5, 0 + bl sub_806EBD0 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_806EBA4 + + thumb_func_start sub_806EBD0 +sub_806EBD0: @ 806EBD0 + push {r4,lr} + movs r4, 0 + lsrs r2, r0, 16 + ldr r3, =0x0000ffff + ands r0, r3 + eors r2, r0 + lsrs r0, r1, 16 + eors r2, r0 + ands r1, r3 + eors r2, r1 + cmp r2, 0x7 + bhi _0806EBEA + movs r4, 0x1 +_0806EBEA: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806EBD0 + + thumb_func_start sub_806EBF8 +sub_806EBF8: @ 806EBF8 + push {r4,lr} + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _0806EC3C + ldr r2, =0x02038bce + ldrh r1, [r2] + ldr r0, =0x00000c03 + cmp r1, r0 + bne _0806EC28 + ldr r0, =gTrainers + TRAINER_STEVEN * 0x28 + 0x4 @ Steven's name + b _0806EC64 + .pool +_0806EC28: + ldr r4, =0x02021cc4 + ldrh r1, [r2] + adds r0, r4, 0 + bl sub_8162E20 + adds r0, r4, 0 + b _0806EC64 + .pool +_0806EC3C: + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x020229e8 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1, 0x18] + movs r0, 0x2 + eors r0, r1 + bl sub_806D864 + adds r1, r0, 0 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r4, 0x8 + adds r0, r4 +_0806EC64: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806EBF8 + + thumb_func_start sub_806EC70 +sub_806EC70: @ 806EC70 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r1 + ldrh r0, [r2, 0xE] + subs r0, 0x1 + strh r0, [r2, 0xE] + lsls r0, 16 + cmp r0, 0 + bne _0806ECA0 + ldrh r0, [r2, 0x8] + ldrh r1, [r2, 0xA] + lsls r1, 16 + orrs r0, r1 + ldrb r1, [r2, 0xC] + bl sub_817F544 + adds r0, r4, 0 + bl remove_task +_0806ECA0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806EC70 + + thumb_func_start sub_806ECAC +sub_806ECAC: @ 806ECAC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r1 + ldrh r0, [r2, 0xE] + subs r0, 0x1 + strh r0, [r2, 0xE] + lsls r0, 16 + cmp r0, 0 + bne _0806ECE2 + ldrh r0, [r2, 0x8] + ldrh r1, [r2, 0xA] + lsls r1, 16 + orrs r0, r1 + ldrb r1, [r2, 0xC] + bl sub_817F578 + movs r0, 0xFF + bl sub_81C488C + adds r0, r4, 0 + bl remove_task +_0806ECE2: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806ECAC + + thumb_func_start sub_806ECEC +sub_806ECEC: @ 806ECEC + push {r4,r5,lr} + adds r5, r0, 0 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0806ED30 + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x02000002 + ands r0, r1 + cmp r0, 0 + bne _0806ED30 + movs r0, 0x80 + orrs r3, r0 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_806ED40 + b _0806ED38 + .pool +_0806ED30: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_806ED40 +_0806ED38: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_806ECEC + + thumb_func_start sub_806ED40 +sub_806ED40: @ 806ED40 + push {r4-r6,lr} + adds r5, r0, 0 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x7F + ands r0, r3 + cmp r0, 0 + beq _0806ED60 + cmp r0, 0x1 + beq _0806ED64 + movs r1, 0 + b _0806ED66 +_0806ED60: + movs r1, 0xE7 + b _0806ED66 +_0806ED64: + movs r1, 0x19 +_0806ED66: + movs r0, 0x80 + ands r0, r3 + cmp r0, 0 + beq _0806ED84 + cmp r2, 0 + bne _0806ED7C + lsls r1, 24 + asrs r1, 24 + adds r0, r4, 0 + bl cry_related +_0806ED7C: + ldr r0, =DummyObjectCallback + b _0806EDFA + .pool +_0806ED84: + cmp r2, 0 + bne _0806EDA6 + lsls r1, 24 + asrs r1, 24 + adds r0, r4, 0 + bl cry_related + adds r0, r4, 0 + bl sub_806F0D4 + lsls r0, 24 + cmp r0, 0 + beq _0806EDA6 + adds r0, r5, 0 + movs r1, 0x1 + bl StartObjectImageAnim +_0806EDA6: + ldr r0, =gUnknown_08329B87 + subs r4, 0x1 + adds r6, r4, r0 + ldrb r0, [r6] + cmp r0, 0 + beq _0806EDEC + ldr r0, =sub_806EC70 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r5, [r1, 0x8] + lsrs r0, r5, 16 + strh r0, [r1, 0xA] + ldr r0, =gUnknown_083299EC + adds r0, r4, r0 + ldrb r0, [r0] + strh r0, [r1, 0xC] + ldrb r0, [r6] + strh r0, [r1, 0xE] + b _0806EDF8 + .pool +_0806EDEC: + ldr r0, =gUnknown_083299EC + adds r0, r4, r0 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_817F544 +_0806EDF8: + ldr r0, =nullsub_18 +_0806EDFA: + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806ED40 + + thumb_func_start sub_806EE0C +sub_806EE0C: @ 806EE0C + push {r4-r6,lr} + adds r5, r0, 0 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 24 + cmp r2, 0 + bne _0806EE2E + adds r0, r4, 0 + bl sub_806F0D4 + lsls r0, 24 + cmp r0, 0 + beq _0806EE2E + adds r0, r5, 0 + movs r1, 0x1 + bl StartObjectImageAnim +_0806EE2E: + ldr r0, =gUnknown_08329B87 + subs r4, 0x1 + adds r6, r4, r0 + ldrb r0, [r6] + cmp r0, 0 + beq _0806EE80 + ldr r0, =sub_806ECAC + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005e00 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + adds r2, r1 + strh r5, [r2, 0x8] + lsrs r1, r5, 16 + strh r1, [r2, 0xA] + ldr r1, =gUnknown_083299EC + adds r1, r4, r1 + ldrb r1, [r1] + strh r1, [r2, 0xC] + ldrb r1, [r6] + strh r1, [r2, 0xE] + bl sub_81C488C + adds r0, r5, 0 + bl sub_817F60C + b _0806EE8C + .pool +_0806EE80: + ldr r0, =gUnknown_083299EC + adds r0, r4, r0 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_817F578 +_0806EE8C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806EE0C + + thumb_func_start sub_806EE98 +sub_806EE98: @ 806EE98 + push {lr} + ldr r0, =sub_806ECAC + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _0806EEAC + bl remove_task +_0806EEAC: + pop {r0} + bx r0 + .pool + thumb_func_end sub_806EE98 + + thumb_func_start sub_806EEB4 +sub_806EEB4: @ 806EEB4 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r2, r1, 16 + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0806EEE8 + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x02000002 + ands r0, r1 + cmp r0, 0 + bne _0806EEE8 + ldr r0, =DummyObjectCallback + b _0806EEFC + .pool +_0806EEE8: + adds r0, r2, 0 + bl sub_817F474 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_817F594 + ldr r0, =nullsub_18 +_0806EEFC: + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806EEB4 + + thumb_func_start sub_806EF08 +sub_806EF08: @ 806EF08 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r5, 0 + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x020229e8 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1, 0x18] + cmp r0, 0x1 + beq _0806EF4C + cmp r0, 0x1 + bgt _0806EF38 + cmp r0, 0 + beq _0806EF42 + b _0806EF56 + .pool +_0806EF38: + cmp r0, 0x2 + beq _0806EF42 + cmp r0, 0x3 + beq _0806EF4C + b _0806EF56 +_0806EF42: + movs r5, 0x3 + cmp r4, 0 + beq _0806EF56 + movs r5, 0x1 + b _0806EF56 +_0806EF4C: + negs r0, r4 + orrs r0, r4 + asrs r5, r0, 31 + movs r0, 0x2 + ands r5, r0 +_0806EF56: + movs r2, 0 + ldr r4, =0x020229e8 + ldrh r0, [r4, 0x18] + adds r1, r5, 0 + cmp r0, r1 + beq _0806EF74 + adds r3, r1, 0 + adds r1, r4, 0 +_0806EF66: + adds r1, 0x1C + adds r2, 0x1 + cmp r2, 0x3 + bgt _0806EF74 + ldrh r0, [r1, 0x18] + cmp r0, r3 + bne _0806EF66 +_0806EF74: + lsls r0, r2, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806EF08 + + thumb_func_start sub_806EF84 +sub_806EF84: @ 806EF84 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r1, 24 + movs r4, 0 + ldr r2, =0x020229e8 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x18] + cmp r0, 0x1 + beq _0806EFC4 + cmp r0, 0x1 + bgt _0806EFB0 + cmp r0, 0 + beq _0806EFBA + b _0806EFCE + .pool +_0806EFB0: + cmp r0, 0x2 + beq _0806EFBA + cmp r0, 0x3 + beq _0806EFC4 + b _0806EFCE +_0806EFBA: + movs r4, 0x3 + cmp r3, 0 + beq _0806EFCE + movs r4, 0x1 + b _0806EFCE +_0806EFC4: + negs r0, r3 + orrs r0, r3 + asrs r4, r0, 31 + movs r0, 0x2 + ands r4, r0 +_0806EFCE: + movs r3, 0 + ldrh r0, [r2, 0x18] + adds r1, r4, 0 + cmp r0, r1 + beq _0806EFE6 +_0806EFD8: + adds r2, 0x1C + adds r3, 0x1 + cmp r3, 0x3 + bgt _0806EFE6 + ldrh r0, [r2, 0x18] + cmp r0, r1 + bne _0806EFD8 +_0806EFE6: + lsls r0, r3, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_806EF84 + + thumb_func_start TrainerClassToTrainerPic +@ u8 TrainerClassToTrainerPic(u16 trainerClassId) +TrainerClassToTrainerPic: @ 806EFF0 + lsls r0, 16 + lsrs r0, 16 + ldr r1, =gTrainerPicIndices + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end TrainerClassToTrainerPic + + thumb_func_start sub_806F000 +sub_806F000: @ 806F000 + push {lr} + lsls r0, 24 + cmp r0, 0 + bne _0806F00C + movs r0, 0x3C + b _0806F00E +_0806F00C: + movs r0, 0x3F +_0806F00E: + bl TrainerClassToTrainerPic + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_806F000 + + thumb_func_start SetPokedexFlag +@ void SetPokedexFlag(u16 nationalPokedexNum, u8 op, u32 personality) +SetPokedexFlag: @ 806F01C + push {r4-r7,lr} + adds r7, r2, 0 + lsls r0, 16 + lsrs r4, r0, 16 + adds r6, r4, 0 + lsls r1, 24 + lsrs r5, r1, 24 + movs r0, 0x2 + eors r0, r5 + negs r1, r0 + orrs r1, r0 + lsrs r1, 31 + adds r0, r4, 0 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + bne _0806F072 + adds r0, r4, 0 + adds r1, r5, 0 + bl pokedex_flag_operation + adds r0, r4, 0 + bl NationalPokedexNumToSpecies + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xC9 + bne _0806F05C + ldr r0, =0x03005d90 + ldr r0, [r0] + str r7, [r0, 0x1C] +_0806F05C: + adds r0, r6, 0 + bl NationalPokedexNumToSpecies + lsls r0, 16 + movs r1, 0x9A + lsls r1, 17 + cmp r0, r1 + bne _0806F072 + ldr r0, =0x03005d90 + ldr r0, [r0] + str r7, [r0, 0x20] +_0806F072: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end SetPokedexFlag + + thumb_func_start sub_806F07C +sub_806F07C: @ 806F07C + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, =0x00000356 + cmp r2, r0 + bls _0806F08A + movs r2, 0 +_0806F08A: + ldr r1, =gTrainers + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x1] + movs r0, 0xD + muls r0, r1 + ldr r1, =gTrainerClassNames + adds r0, r1 + pop {r1} + bx r1 + .pool + thumb_func_end sub_806F07C + + thumb_func_start sub_806F0B0 +sub_806F0B0: @ 806F0B0 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =0x00000356 + cmp r1, r0 + bls _0806F0BE + movs r1, 0 +_0806F0BE: + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, =gTrainers + 0x4 @ name offset + adds r0, r1 + pop {r1} + bx r1 + .pool + thumb_func_end sub_806F0B0 + + thumb_func_start sub_806F0D4 +sub_806F0D4: @ 806F0D4 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + movs r1, 0 + ldr r0, =0x00000181 + cmp r2, r0 + beq _0806F0F8 + adds r0, 0x19 + cmp r2, r0 + beq _0806F0F8 + subs r0, 0x66 + cmp r2, r0 + beq _0806F0F8 + movs r1, 0xC9 + eors r1, r2 + negs r0, r1 + orrs r0, r1 + lsrs r1, r0, 31 +_0806F0F8: + adds r0, r1, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_806F0D4 + + thumb_func_start sub_806F104 +sub_806F104: @ 806F104 + push {lr} + ldr r2, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806F122 + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x003f0100 + ands r0, r1 + cmp r0, 0 + bne _0806F144 +_0806F122: + ldr r1, =0x00000439 + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0806F158 + bl InBattlePike + lsls r0, 24 + cmp r0, 0 + bne _0806F144 + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _0806F158 +_0806F144: + movs r0, 0x1 + b _0806F15A + .pool +_0806F158: + movs r0, 0 +_0806F15A: + pop {r1} + bx r1 + thumb_func_end sub_806F104 + + thumb_func_start sub_806F160 +sub_806F160: @ 806F160 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r6, r0, 0 + ldrb r0, [r6] + lsls r0, 28 + movs r4, 0 + cmp r0, 0 + beq _0806F1EA +_0806F176: + ldr r0, [r6, 0xC] + lsls r2, r4, 1 + adds r1, r2, r4 + lsls r1, 3 + adds r0, r1, r0 + ldr r3, =gUnknown_08329D98 + adds r1, r3 + ldm r1!, {r3,r5,r7} + stm r0!, {r3,r5,r7} + ldm r1!, {r3,r5,r7} + stm r0!, {r3,r5,r7} + movs r5, 0 + ldrb r3, [r6, 0x1] + ldr r7, [r6, 0xC] + mov r9, r7 + mov r8, r2 + ldr r0, [r6, 0x10] + mov r12, r0 + adds r1, r4, 0x1 + mov r10, r1 + cmp r5, r3 + bcs _0806F1C8 + mov r7, r12 + ldr r1, [r6, 0x8] + lsls r0, r4, 2 + adds r0, r1 + ldr r2, [r0] +_0806F1AC: + adds r0, r4, 0 + muls r0, r3 + adds r0, r5 + lsls r0, 3 + adds r0, r7 + lsls r1, r5, 11 + adds r1, r2, r1 + str r1, [r0] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + ldrb r3, [r6, 0x1] + cmp r5, r3 + bcc _0806F1AC +_0806F1C8: + mov r3, r8 + adds r1, r3, r4 + lsls r1, 3 + add r1, r9 + ldrb r0, [r6, 0x1] + muls r0, r4 + lsls r0, 3 + add r0, r12 + str r0, [r1, 0xC] + mov r5, r10 + lsls r0, r5, 16 + lsrs r4, r0, 16 + ldrb r0, [r6] + lsls r0, 28 + lsrs r0, 28 + cmp r4, r0 + blt _0806F176 +_0806F1EA: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806F160 + + thumb_func_start sub_806F1FC +sub_806F1FC: @ 806F1FC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r4, r0, 0 + ldrb r0, [r4] + lsls r0, 28 + movs r3, 0 + cmp r0, 0 + beq _0806F296 + ldr r0, =gUnknown_08329F28 + mov r10, r0 +_0806F216: + ldr r0, [r4, 0xC] + lsls r2, r3, 1 + adds r1, r2, r3 + lsls r1, 3 + adds r1, r0 + mov r0, r10 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + movs r5, 0 + ldr r0, [r4, 0xC] + mov r8, r0 + mov r12, r2 + ldr r7, [r4, 0x10] + adds r1, r3, 0x1 + mov r9, r1 + ldrb r6, [r4, 0x1] + cmp r5, r6 + bcs _0806F26A + adds r6, r7, 0 + ldr r1, [r4, 0x8] + lsls r0, r3, 2 + adds r0, r1 + ldr r2, [r0] +_0806F248: + ldrb r0, [r4] + lsls r0, 28 + lsrs r0, 28 + adds r1, r3, 0 + muls r1, r0 + adds r1, r5 + lsls r1, 3 + adds r1, r6 + lsls r0, r5, 11 + adds r0, r2, r0 + str r0, [r1] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + ldrb r0, [r4, 0x1] + cmp r5, r0 + bcc _0806F248 +_0806F26A: + mov r5, r12 + adds r1, r5, r3 + lsls r1, 3 + add r1, r8 + ldrb r0, [r4] + lsls r0, 28 + lsrs r0, 28 + muls r0, r3 + lsls r0, 3 + adds r0, r7, r0 + str r0, [r1, 0xC] + ldr r6, =gUnknown_082FF70C + str r6, [r1, 0x8] + strh r3, [r1, 0x2] + mov r7, r9 + lsls r0, r7, 16 + lsrs r3, r0, 16 + ldrb r0, [r4] + lsls r0, 28 + lsrs r0, 28 + cmp r3, r0 + blt _0806F216 +_0806F296: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806F1FC + + thumb_func_start sub_806F2AC +sub_806F2AC: @ 806F2AC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + movs r7, 0 + movs r0, 0x1 + ands r6, r0 + movs r0, 0x14 + bl AllocZeroed + adds r4, r0, 0 + cmp r4, 0 + bne _0806F2D0 + movs r0, 0 + b _0806F46E +_0806F2D0: + cmp r5, 0 + beq _0806F2E6 + cmp r5, 0x2 + bne _0806F2E6 + movs r0, 0x77 + strb r0, [r4] + movs r0, 0x4 + strb r0, [r4, 0x1] + movs r0, 0x21 + strb r0, [r4, 0x3] + b _0806F30E +_0806F2E6: + ldrb r1, [r4] + movs r2, 0x10 + negs r2, r2 + adds r0, r2, 0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + movs r3, 0xF + ands r0, r3 + movs r1, 0x40 + orrs r0, r1 + strb r0, [r4] + movs r0, 0x4 + strb r0, [r4, 0x1] + ldrb r0, [r4, 0x3] + ands r2, r0 + movs r0, 0x1 + orrs r2, r0 + ands r2, r3 + strb r2, [r4, 0x3] +_0806F30E: + ldrb r1, [r4, 0x3] + lsls r1, 28 + lsrs r1, 28 + ldrb r0, [r4] + lsls r0, 28 + lsrs r0, 15 + muls r0, r1 + bl AllocZeroed + str r0, [r4, 0x4] + ldrb r0, [r4] + lsls r0, 28 + lsrs r0, 23 + bl AllocZeroed + adds r1, r0, 0 + str r1, [r4, 0x8] + ldr r2, [r4, 0x4] + cmp r2, 0 + beq _0806F33A + cmp r1, 0 + bne _0806F344 +_0806F33A: + movs r0, 0x1 + orrs r7, r0 + lsls r6, 2 + mov r8, r6 + b _0806F378 +_0806F344: + ldrb r0, [r4] + lsls r0, 28 + movs r3, 0 + lsls r6, 2 + mov r8, r6 + cmp r0, 0 + beq _0806F378 + adds r6, r1, 0 + adds r5, r2, 0 +_0806F356: + lsls r2, r3, 2 + adds r2, r6 + ldrb r0, [r4, 0x3] + lsls r0, 28 + lsrs r0, 28 + lsls r1, r3, 13 + muls r0, r1 + adds r0, r5, r0 + str r0, [r2] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + ldrb r0, [r4] + lsls r0, 28 + lsrs r0, 28 + cmp r3, r0 + blt _0806F356 +_0806F378: + ldrb r1, [r4] + lsls r1, 28 + lsrs r1, 28 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + bl AllocZeroed + str r0, [r4, 0xC] + ldrb r1, [r4] + lsls r1, 28 + lsrs r1, 28 + ldrb r0, [r4, 0x1] + lsls r0, 3 + muls r0, r1 + bl AllocZeroed + adds r1, r0, 0 + str r1, [r4, 0x10] + ldr r0, [r4, 0xC] + cmp r0, 0 + beq _0806F3A8 + cmp r1, 0 + bne _0806F3B2 +_0806F3A8: + movs r0, 0x2 + orrs r7, r0 + lsls r0, r7, 24 + lsrs r7, r0, 24 + b _0806F400 +_0806F3B2: + movs r3, 0 + ldrb r0, [r4, 0x1] + ldrb r1, [r4] + lsls r1, 28 + lsrs r1, 28 + muls r0, r1 + cmp r3, r0 + bge _0806F3E2 + movs r2, 0x80 + lsls r2, 4 +_0806F3C6: + ldr r1, [r4, 0x10] + lsls r0, r3, 3 + adds r0, r1 + strh r2, [r0, 0x4] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + ldrb r1, [r4, 0x1] + ldrb r0, [r4] + lsls r0, 28 + lsrs r0, 28 + muls r0, r1 + cmp r3, r0 + blt _0806F3C6 +_0806F3E2: + ldrb r0, [r4, 0x3] + lsrs r0, 4 + cmp r0, 0 + blt _0806F3FA + cmp r0, 0x1 + ble _0806F3FA + cmp r0, 0x2 + bne _0806F3FA + adds r0, r4, 0 + bl sub_806F1FC + b _0806F400 +_0806F3FA: + adds r0, r4, 0 + bl sub_806F160 +_0806F400: + movs r0, 0x2 + ands r0, r7 + cmp r0, 0 + beq _0806F424 + ldr r0, [r4, 0x10] + cmp r0, 0 + beq _0806F416 + bl Free + movs r0, 0 + str r0, [r4, 0x10] +_0806F416: + ldr r0, [r4, 0xC] + cmp r0, 0 + beq _0806F424 + bl Free + movs r0, 0 + str r0, [r4, 0xC] +_0806F424: + movs r0, 0x1 + ands r0, r7 + cmp r0, 0 + beq _0806F448 + ldr r0, [r4, 0x8] + cmp r0, 0 + beq _0806F43A + bl Free + movs r0, 0 + str r0, [r4, 0x8] +_0806F43A: + ldr r0, [r4, 0x4] + cmp r0, 0 + beq _0806F448 + bl Free + movs r0, 0 + str r0, [r4, 0x4] +_0806F448: + cmp r7, 0 + beq _0806F45E + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x14 + bl memset + adds r0, r4, 0 + bl Free + b _0806F468 +_0806F45E: + movs r0, 0xA3 + strb r0, [r4, 0x2] + ldr r0, =0x020249b4 + add r0, r8 + str r4, [r0] +_0806F468: + ldr r0, =0x020249b4 + add r0, r8 + ldr r0, [r0] +_0806F46E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806F2AC + + thumb_func_start sub_806F47C +sub_806F47C: @ 806F47C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + ands r0, r1 + ldr r1, =0x020249b4 + lsls r0, 2 + adds r0, r1 + ldr r4, [r0] + cmp r4, 0 + beq _0806F4F0 + ldrb r0, [r4, 0x2] + cmp r0, 0xA3 + beq _0806F4A8 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x14 + bl memset + b _0806F4F0 + .pool +_0806F4A8: + ldr r0, [r4, 0x10] + cmp r0, 0 + beq _0806F4B6 + bl Free + movs r0, 0 + str r0, [r4, 0x10] +_0806F4B6: + ldr r0, [r4, 0xC] + cmp r0, 0 + beq _0806F4C4 + bl Free + movs r0, 0 + str r0, [r4, 0xC] +_0806F4C4: + ldr r0, [r4, 0x8] + cmp r0, 0 + beq _0806F4D2 + bl Free + movs r0, 0 + str r0, [r4, 0x8] +_0806F4D2: + ldr r0, [r4, 0x4] + cmp r0, 0 + beq _0806F4E0 + bl Free + movs r0, 0 + str r0, [r4, 0x4] +_0806F4E0: + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x14 + bl memset + adds r0, r4, 0 + bl Free +_0806F4F0: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_806F47C + + thumb_func_start sub_806F4F8 +sub_806F4F8: @ 806F4F8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + ldr r2, =0x020249b4 + movs r1, 0x1 + ands r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, [r0] + ldrb r0, [r1, 0x2] + cmp r0, 0xA3 + beq _0806F51C + movs r0, 0 + b _0806F530 + .pool +_0806F51C: + ldrb r0, [r1] + lsls r0, 28 + lsrs r0, 28 + cmp r3, r0 + blt _0806F528 + movs r3, 0 +_0806F528: + ldr r0, [r1, 0x8] + lsls r1, r3, 2 + adds r1, r0 + ldr r0, [r1] +_0806F530: + pop {r1} + bx r1 + thumb_func_end sub_806F4F8 + + thumb_func_start sine +@ s16 sine(s16 t, s16 amplitude) +sine: @ 806F534 + lsls r1, 16 + asrs r1, 16 + ldr r2, =gUnknown_08329F40 + lsls r0, 16 + asrs r0, 15 + adds r0, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + muls r0, r1 + lsls r0, 8 + asrs r0, 16 + bx lr + .pool + thumb_func_end sine + + thumb_func_start cosine +@ s16 cosine(s16 t, s16 amplitude) +cosine: @ 806F550 + lsls r1, 16 + asrs r1, 16 + ldr r2, =gUnknown_08329F40 + lsls r0, 16 + asrs r0, 15 + adds r0, 0x80 + adds r0, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + muls r0, r1 + lsls r0, 8 + asrs r0, 16 + bx lr + .pool + thumb_func_end cosine + + thumb_func_start sine2 +@ s16 sine2(u16 angle) +sine2: @ 806F570 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r5, 0 + movs r1, 0xB4 + bl __umodsi3 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0xB4 + bl __udivsi3 + movs r1, 0x1 + ands r0, r1 + ldr r1, =gUnknown_0832A1C0 + lsls r4, 1 + adds r4, r1 + ldrh r1, [r4] + cmp r0, 0 + bne _0806F5A8 + lsls r0, r1, 16 + b _0806F5AC + .pool +_0806F5A8: + lsls r0, r1, 16 + negs r0, r0 +_0806F5AC: + asrs r0, 16 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sine2 + + thumb_func_start cosine2 +@ s16 cosine2(u16 angle) +cosine2: @ 806F5B4 + push {lr} + lsls r0, 16 + movs r1, 0xB4 + lsls r1, 15 + adds r0, r1 + lsrs r0, 16 + bl sine2 + lsls r0, 16 + asrs r0, 16 + pop {r1} + bx r1 + thumb_func_end cosine2 + + thumb_func_start GenerateRandomNumber +@ u16 GenerateRandomNumber() +GenerateRandomNumber: @ 806F5CC + ldr r2, =0x03005d80 + ldr r1, [r2] + ldr r0, =0x41c64e6d + muls r0, r1 + ldr r1, =0x00006073 + adds r0, r1 + str r0, [r2] + ldr r2, =0x020249c0 + ldr r1, [r2] + adds r1, 0x1 + str r1, [r2] + lsrs r0, 16 + bx lr + .pool + thumb_func_end GenerateRandomNumber + + thumb_func_start SeedRng +@ void SeedRng(u16 seed) +SeedRng: @ 806F5F8 + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x03005d80 + str r0, [r1] + ldr r1, =0x020249bc + movs r0, 0 + strb r0, [r1] + bx lr + .pool + thumb_func_end SeedRng + + thumb_func_start SeedRng2 +SeedRng2: @ 806F610 + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x03005d84 + str r0, [r1] + bx lr + .pool + thumb_func_end SeedRng2 + + thumb_func_start GenerateRandomNumber2 +GenerateRandomNumber2: @ 806F620 + ldr r2, =0x03005d84 + ldr r1, [r2] + ldr r0, =0x41c64e6d + muls r0, r1 + ldr r1, =0x00006073 + adds r0, r1 + str r0, [r2] + lsrs r0, 16 + bx lr + .pool + thumb_func_end GenerateRandomNumber2 + + thumb_func_start object_new_hidden_with_callback +object_new_hidden_with_callback: @ 806F640 + push {r4-r6,lr} + adds r6, r0, 0 + ldr r0, =gUnknown_0832A3A8 + movs r1, 0xF8 + movs r2, 0xA8 + movs r3, 0xE + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r5, =0x02020630 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r3, r2, r5 + adds r3, 0x3E + ldrb r1, [r3] + movs r4, 0x4 + orrs r1, r4 + strb r1, [r3] + adds r5, 0x1C + adds r2, r5 + str r6, [r2] + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end object_new_hidden_with_callback + + thumb_func_start sub_806F67C +sub_806F67C: @ 806F67C + strh r1, [r0] + lsrs r1, 16 + strh r1, [r0, 0x2] + bx lr + thumb_func_end sub_806F67C + + thumb_func_start sub_806F684 +sub_806F684: @ 806F684 + ldrh r2, [r0] + movs r3, 0x2 + ldrsh r0, [r0, r3] + lsls r0, 16 + orrs r2, r0 + str r2, [r1] + bx lr + thumb_func_end sub_806F684 + + thumb_func_start sub_806F694 +sub_806F694: @ 806F694 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, [sp, 0x18] + ldr r5, [sp, 0x1C] + ldr r6, [sp, 0x20] + ldr r7, [sp, 0x24] + mov r8, r7 + str r1, [r0] + str r2, [r0, 0x4] + strh r3, [r0, 0x8] + strh r4, [r0, 0xA] + strh r5, [r0, 0xC] + strh r6, [r0, 0xE] + mov r1, r8 + strh r1, [r0, 0x10] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_806F694 + + thumb_func_start sub_806F6C0 +sub_806F6C0: @ 806F6C0 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x24 + mov r8, r0 + ldr r0, [sp, 0x38] + ldr r4, [sp, 0x3C] + ldr r5, [sp, 0x40] + ldr r6, [sp, 0x44] + lsls r6, 16 + lsrs r6, 16 + lsls r3, 16 + asrs r3, 16 + lsls r0, 16 + asrs r0, 16 + str r0, [sp] + lsls r4, 16 + asrs r4, 16 + str r4, [sp, 0x4] + lsls r5, 16 + asrs r5, 16 + str r5, [sp, 0x8] + str r6, [sp, 0xC] + add r0, sp, 0x10 + bl sub_806F694 + add r0, sp, 0x10 + mov r1, r8 + movs r2, 0x1 + bl BgAffineSet + add sp, 0x24 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_806F6C0 + + thumb_func_start rfu_MBOOT_CHILD_inheritanceLinkStatus +rfu_MBOOT_CHILD_inheritanceLinkStatus: @ 806F70C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x38 + str r2, [sp, 0x20] + adds r4, r3, 0 + ldr r7, [sp, 0x58] + lsls r0, 24 + lsls r1, 24 + ldr r2, =gUnknown_0832A3C0 + lsrs r1, 23 + lsrs r0, 21 + adds r1, r0 + adds r0, r2, 0x1 + adds r0, r1, r0 + ldrb r0, [r0] + str r0, [sp, 0x24] + adds r1, r2 + ldrb r1, [r1] + str r1, [sp, 0x28] + movs r0, 0 + b _0806F88C + .pool +_0806F740: + movs r5, 0 + adds r0, 0x1 + str r0, [sp, 0x30] + b _0806F874 +_0806F748: + ldrh r0, [r4] + ldr r2, =0x000003ff + adds r1, r2, 0 + ands r1, r0 + lsls r1, 5 + mov r8, r1 + movs r2, 0xC0 + lsls r2, 4 + adds r1, r2, 0 + ands r1, r0 + mov r2, sp + strh r0, [r2, 0x34] + cmp r1, 0 + bne _0806F788 + ldr r0, [sp, 0x20] + add r0, r8 + adds r1, r7, 0 + ldr r2, =0x04000008 + bl CpuSet + adds r4, 0x2 + str r4, [sp, 0x2C] + adds r7, 0x20 + mov r10, r7 + adds r5, 0x1 + mov r9, r5 + b _0806F86A + .pool +_0806F788: + movs r0, 0x80 + lsls r0, 4 + cmp r1, r0 + bne _0806F7CC + movs r1, 0 + adds r4, 0x2 + str r4, [sp, 0x2C] + movs r2, 0x20 + adds r2, r7 + mov r10, r2 + adds r5, 0x1 + mov r9, r5 +_0806F7A0: + lsls r4, r1, 24 + asrs r4, 24 + movs r0, 0x7 + subs r0, r4 + lsls r0, 2 + add r0, r8 + ldr r1, [sp, 0x20] + adds r0, r1, r0 + lsls r1, r4, 2 + adds r1, r7, r1 + ldr r2, =0x04000001 + bl CpuSet + adds r4, 0x1 + lsls r4, 24 + lsrs r1, r4, 24 + asrs r4, 24 + cmp r4, 0x7 + ble _0806F7A0 + b _0806F86A + .pool +_0806F7CC: + movs r1, 0 + adds r4, 0x2 + str r4, [sp, 0x2C] + movs r2, 0x20 + adds r2, r7 + mov r10, r2 + adds r5, 0x1 + mov r9, r5 + movs r0, 0xF + mov r12, r0 +_0806F7E0: + movs r2, 0 + lsls r4, r1, 24 + lsls r0, r4, 2 + lsrs r0, 24 + adds r6, r0, 0x3 + mov r1, r8 + adds r5, r1, r0 +_0806F7EE: + lsls r1, r2, 24 + asrs r1, 24 + subs r0, r6, r1 + mov r2, sp + adds r3, r2, r0 + adds r0, r5, r1 + ldr r2, [sp, 0x20] + adds r0, r2, r0 + ldrb r2, [r0] + mov r0, r12 + ands r0, r2 + lsls r0, 4 + lsrs r2, 4 + orrs r0, r2 + strb r0, [r3] + adds r1, 0x1 + lsls r1, 24 + lsrs r2, r1, 24 + asrs r1, 24 + cmp r1, 0x3 + ble _0806F7EE + movs r1, 0x80 + lsls r1, 17 + adds r0, r4, r1 + lsrs r1, r0, 24 + asrs r0, 24 + cmp r0, 0x7 + ble _0806F7E0 + mov r2, sp + ldrh r0, [r2, 0x34] + movs r2, 0x80 + lsls r2, 4 + ands r0, r2 + cmp r0, 0 + beq _0806F860 + movs r1, 0 +_0806F836: + lsls r4, r1, 24 + asrs r4, 24 + movs r0, 0x7 + subs r0, r4 + lsls r0, 2 + add r0, sp + lsls r1, r4, 2 + adds r1, r7, r1 + ldr r2, =0x04000001 + bl CpuSet + adds r4, 0x1 + lsls r4, 24 + lsrs r1, r4, 24 + asrs r4, 24 + cmp r4, 0x7 + ble _0806F836 + b _0806F86A + .pool +_0806F860: + mov r0, sp + adds r1, r7, 0 + ldr r2, =0x04000008 + bl CpuSet +_0806F86A: + ldr r4, [sp, 0x2C] + mov r7, r10 + mov r1, r9 + lsls r0, r1, 24 + lsrs r5, r0, 24 +_0806F874: + ldr r2, [sp, 0x28] + cmp r5, r2 + bcs _0806F87C + b _0806F748 +_0806F87C: + movs r0, 0x20 + ldr r1, [sp, 0x28] + subs r0, r1 + lsls r0, 1 + adds r4, r0 + ldr r2, [sp, 0x30] + lsls r0, r2, 24 + lsrs r0, 24 +_0806F88C: + ldr r1, [sp, 0x24] + cmp r0, r1 + bcs _0806F894 + b _0806F740 +_0806F894: + add sp, 0x38 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end rfu_MBOOT_CHILD_inheritanceLinkStatus + + thumb_func_start sub_806F8A8 +sub_806F8A8: @ 806F8A8 + push {lr} + adds r2, r0, 0 + movs r1, 0 + movs r3, 0x1 +_0806F8B0: + adds r0, r2, 0 + ands r0, r3 + cmp r0, 0 + beq _0806F8BC + adds r0, r1, 0 + b _0806F8CA +_0806F8BC: + lsrs r2, 1 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1F + bls _0806F8B0 + movs r0, 0 +_0806F8CA: + pop {r1} + bx r1 + thumb_func_end sub_806F8A8 + + thumb_func_start sub_806F8D0 +sub_806F8D0: @ 806F8D0 + push {r4-r7,lr} + adds r7, r0, 0 + adds r4, r1, 0 + ldr r2, =0x00001121 + movs r3, 0 + cmp r3, r4 + bge _0806F91C + movs r6, 0x1 + ldr r0, =0x00008408 + adds r5, r0, 0 +_0806F8E4: + adds r0, r7, r3 + ldrb r0, [r0] + eors r2, r0 + movs r1, 0 + adds r3, 0x1 +_0806F8EE: + adds r0, r2, 0 + ands r0, r6 + cmp r0, 0 + beq _0806F908 + lsrs r0, r2, 1 + eors r0, r5 + lsls r0, 16 + lsrs r2, r0, 16 + b _0806F90A + .pool +_0806F908: + lsrs r2, 1 +_0806F90A: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x7 + bls _0806F8EE + lsls r0, r3, 16 + lsrs r3, r0, 16 + cmp r3, r4 + blt _0806F8E4 +_0806F91C: + mvns r0, r2 + lsls r0, 16 + lsrs r0, 16 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_806F8D0 + + thumb_func_start sub_806F928 +sub_806F928: @ 806F928 + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldr r2, =0x00001121 + movs r3, 0 + cmp r3, r4 + bcs _0806F956 + ldr r6, =gUnknown_0832A3D8 +_0806F938: + lsrs r1, r2, 8 + adds r0, r5, r3 + ldrb r0, [r0] + eors r2, r0 + lsls r0, r2, 24 + lsrs r0, 23 + adds r0, r6 + ldrh r0, [r0] + adds r2, r0, 0 + eors r2, r1 + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r4 + bcc _0806F938 +_0806F956: + mvns r0, r2 + lsls r0, 16 + lsrs r0, 16 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806F928 + + thumb_func_start sub_806F96C +sub_806F96C: @ 806F96C + push {r4,lr} + adds r4, r0, 0 + movs r3, 0 + movs r2, 0 + cmp r3, r1 + bcs _0806F984 +_0806F978: + adds r0, r4, r2 + ldrb r0, [r0] + adds r3, r0 + adds r2, 0x1 + cmp r2, r1 + bcc _0806F978 +_0806F984: + adds r0, r3, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_806F96C + + thumb_func_start pal_fade_1 +pal_fade_1: @ 806F98C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r1, 16 + lsrs r1, 16 + mov r12, r1 + lsls r2, 24 + lsrs r7, r2, 24 + mov r0, sp + strh r3, [r0] + movs r6, 0 + cmp r6, r12 + bcs _0806FA12 + ldr r0, =0x02037714 + mov r10, r0 + ldr r1, =0x02037b14 + mov r9, r1 +_0806F9BA: + mov r0, r8 + adds r5, r6, r0 + lsls r5, 16 + lsrs r5, 15 + mov r1, r10 + adds r0, r5, r1 + ldr r3, [r0] + lsls r4, r3, 27 + lsls r2, r3, 22 + lsls r3, 17 + add r5, r9 + lsrs r4, 27 + ldr r1, [sp] + lsls r0, r1, 27 + lsrs r0, 27 + subs r0, r4 + muls r0, r7 + asrs r0, 4 + adds r4, r0 + lsrs r2, 27 + lsls r0, r1, 22 + lsrs r0, 27 + subs r0, r2 + muls r0, r7 + asrs r0, 4 + adds r2, r0 + lsls r2, 5 + orrs r4, r2 + lsrs r3, 27 + lsls r1, 17 + lsrs r1, 27 + subs r1, r3 + adds r0, r1, 0 + muls r0, r7 + asrs r0, 4 + adds r3, r0 + lsls r3, 10 + orrs r4, r3 + strh r4, [r5] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, r12 + bcc _0806F9BA +_0806FA12: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end pal_fade_1 + + thumb_func_start pokemon_get_nick +pokemon_get_nick: @ 806FA2C + push {r4,lr} + sub sp, 0x14 + adds r4, r1, 0 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + adds r0, r4, 0 + mov r1, sp + bl CopyString_Limit10 + add sp, 0x14 + pop {r4} + pop {r1} + bx r1 + thumb_func_end pokemon_get_nick + + thumb_func_start pokemon_get_nick_ +pokemon_get_nick_: @ 806FA4C + push {r4,lr} + sub sp, 0x14 + adds r4, r1, 0 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr_encrypted + adds r0, r4, 0 + mov r1, sp + bl CopyString_Limit10 + add sp, 0x14 + pop {r4} + pop {r1} + bx r1 + thumb_func_end pokemon_get_nick_ + + thumb_func_start daycare_count_pokemon +daycare_count_pokemon: @ 806FA6C + push {r4-r6,lr} + adds r6, r0, 0 + movs r5, 0 + movs r4, 0 +_0806FA74: + movs r0, 0x8C + muls r0, r4 + adds r0, r6, r0 + movs r1, 0xB + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _0806FA8A + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_0806FA8A: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0806FA74 + adds r0, r5, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end daycare_count_pokemon + + thumb_func_start sub_806FA9C +sub_806FA9C: @ 806FA9C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r9, r0 + mov r10, r1 + movs r7, 0 + movs r5, 0 + mov r6, r10 + adds r6, 0x74 + movs r0, 0x1 + mov r8, r0 +_0806FAB6: + movs r0, 0x8C + muls r0, r5 + mov r1, r9 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _0806FAE4 + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr_encrypted + adds r1, r0, 0 + cmp r1, 0 + bne _0806FAE4 + lsls r0, r5, 1 + adds r0, r6, r0 + b _0806FAEA +_0806FAE4: + lsls r0, r5, 1 + adds r0, r6, r0 + mov r1, r8 +_0806FAEA: + strh r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bls _0806FAB6 + mov r0, r10 + str r7, [r0, 0x70] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_806FA9C + + thumb_func_start daycare_empty_slot +@ u8 daycare_empty_slot(struct daycare_mon *dayCareMons) +daycare_empty_slot: @ 806FB08 + push {r4,r5,lr} + adds r5, r0, 0 + movs r4, 0 +_0806FB0E: + movs r0, 0x8C + muls r0, r4 + adds r0, r5, r0 + movs r1, 0xB + bl pokemon_getattr_encrypted + cmp r0, 0 + bne _0806FB24 + lsls r0, r4, 24 + asrs r0, 24 + b _0806FB32 +_0806FB24: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0806FB0E + movs r0, 0x1 + negs r0, r0 +_0806FB32: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end daycare_empty_slot + + thumb_func_start sub_806FB38 +@ void sub_806FB38(struct pokemon *mon, struct daycare_mon *dayCareMon) +sub_806FB38: @ 806FB38 + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r1, 0 + bl sub_80D43F0 + lsls r0, 24 + cmp r0, 0 + beq _0806FBBC + adds r0, r5, 0 + adds r0, 0x74 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + adds r4, r5, 0 + adds r4, 0x7C + adds r0, r6, 0 + adds r1, r4, 0 + bl pokemon_get_nick + adds r0, r4, 0 + bl StripExtendedControlCodes + adds r4, 0xB + ldrb r1, [r4] + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + adds r0, r6, 0 + movs r1, 0x3 + bl pokemon_getattr + lsls r0, 4 + ldrb r2, [r4] + movs r1, 0xF + ands r1, r2 + orrs r1, r0 + strb r1, [r4] + adds r0, r6, 0 + movs r1, 0x40 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005d8c + ldr r1, [r1] + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 2 + adds r1, r2 + adds r0, r5, 0 + adds r0, 0x50 + ldr r2, =0x00002be0 + adds r1, r2 + ldm r1!, {r2-r4} + stm r0!, {r2-r4} + ldm r1!, {r2-r4} + stm r0!, {r2-r4} + ldm r1!, {r2-r4} + stm r0!, {r2-r4} + adds r0, r6, 0 + bl sub_80D4680 +_0806FBBC: + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0x50 + bl memcpy + adds r0, r5, 0 + bl pokemon_restore_pp + adds r1, r5, 0 + adds r1, 0x88 + movs r0, 0 + str r0, [r1] + adds r0, r6, 0 + bl zero_pokemon_struct + bl party_compaction + bl calc_player_party_count + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806FB38 + + thumb_func_start daycare_send +@ void daycare_send(struct pokemon *mon, struct daycare_mon *dayCareMons) +daycare_send: @ 806FBF4 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl daycare_empty_slot + lsls r0, 24 + asrs r0, 24 + movs r1, 0x8C + muls r0, r1 + adds r4, r0 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_806FB38 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end daycare_send + + thumb_func_start daycare_send_selected_pokemon +daycare_send_selected_pokemon: @ 806FC18 + push {lr} + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x03005d8c + ldr r1, [r1] + ldr r2, =0x00003030 + adds r1, r2 + bl daycare_send + pop {r0} + bx r0 + .pool + thumb_func_end daycare_send_selected_pokemon + + thumb_func_start sub_806FC48 +sub_806FC48: @ 806FC48 + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r5, 0 + adds r4, 0x8C + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _0806FC9E + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr_encrypted + adds r6, r0, 0 + cmp r6, 0 + bne _0806FC9E + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x50 + bl memcpy + adds r0, r4, 0 + bl zero_pokemon_boxed_data + adds r4, 0x50 + adds r0, r5, 0 + adds r0, 0x50 + adds r1, r4, 0 + movs r2, 0x38 + bl memcpy + adds r2, r5, 0 + adds r2, 0x88 + movs r0, 0x8A + lsls r0, 1 + adds r1, r5, r0 + ldr r0, [r1] + str r0, [r2] + str r6, [r1] + adds r0, r4, 0 + bl sub_806FF80 +_0806FC9E: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_806FC48 + + thumb_func_start sub_806FCA4 +sub_806FCA4: @ 806FCA4 + push {r4-r7,lr} + adds r4, r0, 0 + movs r5, 0 + ldr r7, =0x0000ffff +_0806FCAC: + adds r0, r4, 0 + bl sub_806DF74 + lsls r0, 24 + cmp r0, 0 + beq _0806FCE8 + movs r6, 0x1 + adds r5, 0x1 + b _0806FCD4 + .pool +_0806FCC4: + movs r6, 0 + cmp r0, r7 + bne _0806FCD4 + ldr r0, =0x020244e2 + ldrh r1, [r0] + adds r0, r4, 0 + bl sub_8069424 +_0806FCD4: + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_8069318 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _0806FCC4 + cmp r5, 0x63 + ble _0806FCAC +_0806FCE8: + adds r0, r4, 0 + bl pokemon_calc_effective_stats + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806FCA4 + + thumb_func_start sub_806FCF8 +sub_806FCF8: @ 806FCF8 + push {r4-r7,lr} + sub sp, 0x68 + adds r5, r0, 0 + ldr r1, =0x02021cc4 + bl pokemon_get_nick_ + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr_encrypted + lsls r0, 16 + lsrs r7, r0, 16 + adds r0, r5, 0 + mov r1, sp + bl sub_8069004 + mov r0, sp + movs r1, 0x38 + bl pokemon_getattr + cmp r0, 0x64 + beq _0806FD46 + mov r0, sp + movs r1, 0x19 + bl pokemon_getattr + adds r1, r5, 0 + adds r1, 0x88 + ldr r1, [r1] + adds r0, r1 + str r0, [sp, 0x64] + add r2, sp, 0x64 + mov r0, sp + movs r1, 0x19 + bl pokemon_setattr + mov r0, sp + bl sub_806FCA4 +_0806FD46: + ldr r0, =0x020244ec + movs r1, 0xFA + lsls r1, 1 + adds r6, r0, r1 + adds r0, r6, 0 + mov r1, sp + movs r2, 0x64 + bl memcpy + adds r0, r5, 0 + adds r0, 0x70 + ldrh r0, [r0] + cmp r0, 0 + beq _0806FD74 + adds r4, r5, 0 + adds r4, 0x50 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80D460C + adds r0, r4, 0 + bl sub_806FF80 +_0806FD74: + adds r0, r5, 0 + bl zero_pokemon_boxed_data + adds r1, r5, 0 + adds r1, 0x88 + movs r0, 0 + str r0, [r1] + bl party_compaction + bl calc_player_party_count + adds r0, r7, 0 + add sp, 0x68 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806FCF8 + + thumb_func_start sub_806FD9C +sub_806FD9C: @ 806FD9C + push {r4,r5,lr} + adds r5, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x8C + muls r0, r1 + adds r0, r5, r0 + bl sub_806FCF8 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl sub_806FC48 + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_806FD9C + + thumb_func_start sub_806FDC4 +sub_806FDC4: @ 806FDC4 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003030 + adds r0, r1 + ldr r1, =0x020375e0 + ldrb r1, [r1] + bl sub_806FD9C + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .pool + thumb_func_end sub_806FDC4 + + thumb_func_start sub_806FDEC +sub_806FDEC: @ 806FDEC + push {r4,r5,lr} + sub sp, 0x54 + adds r4, r0, 0 + adds r5, r1, 0 + mov r0, sp + adds r1, r4, 0 + movs r2, 0x50 + bl memcpy + adds r0, r4, 0 + movs r1, 0x19 + bl pokemon_getattr_encrypted + adds r0, r5 + str r0, [sp, 0x50] + add r2, sp, 0x50 + mov r0, sp + movs r1, 0x19 + bl pokemon_setattr_encrypted + mov r0, sp + bl sub_80690C0 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x54 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_806FDEC + + thumb_func_start sub_806FE28 +sub_806FE28: @ 806FE28 + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_80690C0 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + adds r0, 0x88 + ldr r1, [r0] + adds r0, r5, 0 + bl sub_806FDEC + lsls r0, 24 + lsrs r0, 24 + subs r0, r4 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_806FE28 + + thumb_func_start sub_806FE54 +sub_806FE54: @ 806FE54 + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_806FE28 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x02021dc4 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r1, =0x02021cc4 + adds r0, r5, 0 + bl pokemon_get_nick_ + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806FE54 + + thumb_func_start sub_806FE88 +sub_806FE88: @ 806FE88 + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_806FE28 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =0x02021cc4 + adds r0, r5, 0 + bl pokemon_get_nick_ + movs r0, 0x64 + muls r4, r0 + adds r4, 0x64 + ldr r0, =0x02021dc4 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x5 + bl ConvertIntToDecimalString + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806FE88 + + thumb_func_start sub_806FEC0 +sub_806FEC0: @ 806FEC0 + push {lr} + lsls r1, 24 + lsrs r1, 24 + movs r2, 0x8C + muls r1, r2 + adds r0, r1 + bl sub_806FE88 + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_806FEC0 + + thumb_func_start sub_806FED8 +sub_806FED8: @ 806FED8 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003030 + adds r0, r1 + ldr r1, =0x020375e0 + ldrb r1, [r1] + bl sub_806FEC0 + ldr r1, =0x020375e2 + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_806FED8 + + thumb_func_start sub_806FF04 +sub_806FF04: @ 806FF04 + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x03005d8c + ldr r2, [r1] + ldr r1, =0x000030b8 + adds r3, r2, r1 + ldr r1, [r3] + adds r1, r0 + str r1, [r3] + ldr r1, =0x00003144 + adds r2, r1 + ldr r1, [r2] + adds r1, r0 + str r1, [r2] + bx lr + .pool + thumb_func_end sub_806FF04 + + thumb_func_start sub_806FF30 +sub_806FF30: @ 806FF30 + push {r4-r6,lr} + ldr r6, =0x03005d8c + ldr r5, =0x020375e0 + ldrh r0, [r5] + movs r4, 0x8C + adds r1, r0, 0 + muls r1, r4 + ldr r0, =0x00003030 + adds r1, r0 + ldr r0, [r6] + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr_encrypted + cmp r0, 0 + bne _0806FF60 + movs r0, 0 + b _0806FF76 + .pool +_0806FF60: + ldrh r0, [r5] + adds r1, r0, 0 + muls r1, r4 + ldr r0, =0x00003030 + adds r1, r0 + ldr r0, [r6] + adds r0, r1 + bl sub_806FE54 + lsls r0, 24 + lsrs r0, 24 +_0806FF76: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806FF30 + + thumb_func_start sub_806FF80 +sub_806FF80: @ 806FF80 + push {lr} + movs r3, 0 + movs r2, 0x7 + adds r1, r0, 0 + adds r1, 0x2B +_0806FF8A: + strb r3, [r1] + subs r1, 0x1 + subs r2, 0x1 + cmp r2, 0 + bge _0806FF8A + adds r2, r0, 0 + adds r2, 0x2C + movs r3, 0 + adds r1, r0, 0 + adds r1, 0x36 +_0806FF9E: + strb r3, [r1] + subs r1, 0x1 + cmp r1, r2 + bge _0806FF9E + bl sub_80D439C + pop {r0} + bx r0 + thumb_func_end sub_806FF80 + + thumb_func_start sub_806FFB0 +sub_806FFB0: @ 806FFB0 + push {r4,lr} + adds r4, r0, 0 + bl zero_pokemon_boxed_data + adds r1, r4, 0 + adds r1, 0x88 + movs r0, 0 + str r0, [r1] + adds r4, 0x50 + adds r0, r4, 0 + bl sub_806FF80 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_806FFB0 + + thumb_func_start sub_806FFD0 +sub_806FFD0: @ 806FFD0 + push {r4-r6,lr} + adds r5, r0, 0 + movs r4, 0 + movs r6, 0x8C +_0806FFD8: + adds r0, r4, 0 + muls r0, r6 + adds r0, r5, r0 + bl sub_806FFB0 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0806FFD8 + movs r1, 0x8C + lsls r1, 1 + adds r0, r5, r1 + movs r1, 0 + str r1, [r0] + movs r2, 0x8E + lsls r2, 1 + adds r0, r5, r2 + strb r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_806FFD0 + + thumb_func_start sub_8070004 +sub_8070004: @ 8070004 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r2, r0, 16 + movs r0, 0 + mov r8, r0 + ldr r0, =gEvolutionTable + mov r12, r0 +_08070016: + movs r7, 0 + movs r6, 0x1 + movs r4, 0x80 + lsls r4, 9 + movs r5, 0x28 + mov r3, r12 + adds r3, 0x28 +_08070024: + movs r1, 0 + ldrh r0, [r3, 0x4] + cmp r0, r2 + bne _08070034 + lsrs r2, r4, 16 + b _08070060 + .pool +_08070034: + adds r1, 0x1 + cmp r1, 0x4 + bgt _0807004A + lsls r0, r1, 3 + adds r0, r5 + add r0, r12 + ldrh r0, [r0, 0x4] + cmp r0, r2 + bne _08070034 + lsrs r2, r4, 16 + movs r7, 0x1 +_0807004A: + cmp r7, 0 + bne _08070060 + movs r0, 0x80 + lsls r0, 9 + adds r4, r0 + adds r5, 0x28 + adds r3, 0x28 + adds r6, 0x1 + ldr r0, =0x0000019b + cmp r6, r0 + ble _08070024 +_08070060: + movs r0, 0xCE + lsls r0, 1 + cmp r6, r0 + beq _08070072 + movs r0, 0x1 + add r8, r0 + mov r0, r8 + cmp r0, 0x4 + ble _08070016 +_08070072: + adds r0, r2, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8070004 + + thumb_func_start sub_8070084 +sub_8070084: @ 8070084 + push {r4-r7,lr} + sub sp, 0x8 + adds r6, r0, 0 + movs r7, 0x1 + negs r7, r7 + movs r4, 0 +_08070090: + movs r0, 0x8C + muls r0, r4 + adds r0, r6, r0 + bl pokemon_roll_gender + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFE + bne _080700A4 + adds r7, r4, 0 +_080700A4: + adds r4, 0x1 + cmp r4, 0x1 + ble _08070090 + movs r5, 0 + movs r4, 0 +_080700AE: + movs r0, 0x8C + muls r0, r4 + adds r0, r6, r0 + movs r1, 0xB + bl pokemon_getattr_encrypted + lsls r1, r4, 2 + add r1, sp + str r0, [r1] + cmp r0, 0x84 + bne _080700C8 + adds r5, 0x1 + adds r7, r4, 0 +_080700C8: + adds r4, 0x1 + cmp r4, 0x1 + ble _080700AE + cmp r5, 0x2 + bne _080700E2 + bl GenerateRandomNumber + lsls r0, 16 + ldr r1, =0x7ffe0000 + movs r7, 0x1 + cmp r0, r1 + bls _080700E2 + movs r7, 0 +_080700E2: + movs r0, 0x8C + muls r0, r7 + adds r0, r6, r0 + movs r1, 0xC + bl pokemon_getattr_encrypted + cmp r0, 0xC3 + bne _080700FE + bl GenerateRandomNumber + lsls r0, 16 + ldr r1, =0x7ffe0000 + cmp r0, r1 + bls _08070108 +_080700FE: + movs r0, 0x1 + negs r0, r0 + b _0807010A + .pool +_08070108: + adds r0, r7, 0 +_0807010A: + add sp, 0x8 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8070084 + + thumb_func_start sub_8070114 +sub_8070114: @ 8070114 + push {r4-r7,lr} + adds r5, r0, 0 + movs r6, 0 + ldr r0, =0x030022c0 + ldrh r0, [r0, 0x24] + bl SeedRng2 + adds r0, r5, 0 + bl sub_8070084 + adds r1, r0, 0 + cmp r1, 0 + bge _08070160 + bl GenerateRandomNumber2 + adds r4, r0, 0 + bl GenerateRandomNumber + movs r1, 0x8C + lsls r1, 1 + adds r5, r1 + lsls r4, 16 + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x0000fffe + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + adds r0, 0x1 + orrs r4, r0 + str r4, [r5] + b _080701AC + .pool +_08070160: + movs r0, 0x8C + muls r0, r1 + adds r0, r5, r0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr_encrypted + bl GetNatureFromPersonality + lsls r0, 24 + lsrs r7, r0, 24 +_08070176: + bl GenerateRandomNumber2 + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsls r0, 16 + lsrs r0, 16 + orrs r4, r0 + adds r0, r4, 0 + bl GetNatureFromPersonality + lsls r0, 24 + lsrs r0, 24 + cmp r7, r0 + bne _0807019A + cmp r4, 0 + bne _080701A4 +_0807019A: + adds r6, 0x1 + movs r0, 0x96 + lsls r0, 4 + cmp r6, r0 + ble _08070176 +_080701A4: + movs r1, 0x8C + lsls r1, 1 + adds r0, r5, r1 + str r4, [r0] +_080701AC: + movs r0, 0x86 + bl FlagSet + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8070114 + + thumb_func_start sub_80701B8 +sub_80701B8: @ 80701B8 + push {r4,lr} + adds r4, r0, 0 + bl GenerateRandomNumber + movs r1, 0x8C + lsls r1, 1 + adds r4, r1 + movs r2, 0x80 + lsls r2, 8 + adds r1, r2, 0 + orrs r0, r1 + lsls r0, 16 + lsrs r0, 16 + str r0, [r4] + movs r0, 0x86 + bl FlagSet + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80701B8 + + thumb_func_start sub_80701E0 +sub_80701E0: @ 80701E0 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003030 + adds r0, r1 + bl sub_8070114 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80701E0 + + thumb_func_start sub_80701FC +sub_80701FC: @ 80701FC + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003030 + adds r0, r1 + bl sub_80701B8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80701FC + + thumb_func_start sub_8070218 +sub_8070218: @ 8070218 + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r1, r4, r1 + movs r0, 0xFF + strb r0, [r1] + movs r2, 0 +_0807022A: + mov r1, sp + adds r0, r1, r2 + adds r1, r4, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x5 + ble _0807022A + movs r3, 0 + movs r2, 0 +_0807023E: + mov r1, sp + adds r0, r1, r2 + ldrb r1, [r0] + adds r0, r1, 0 + cmp r0, 0xFF + beq _08070250 + adds r0, r4, r3 + strb r1, [r0] + adds r3, 0x1 +_08070250: + adds r2, 0x1 + cmp r2, 0x5 + ble _0807023E + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8070218 + + thumb_func_start sub_8070260 +sub_8070260: @ 8070260 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + mov r9, r0 + mov r8, r1 + movs r5, 0 + add r1, sp, 0x4 + add r7, sp, 0xC + adds r2, r1, 0 +_08070276: + adds r0, r2, r5 + strb r5, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _08070276 + movs r5, 0 + adds r6, r1, 0 +_08070288: + bl GenerateRandomNumber + mov r1, sp + adds r4, r1, r5 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x6 + subs r1, r5 + bl __modsi3 + adds r0, r6, r0 + ldrb r0, [r0] + strb r0, [r4] + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_8070218 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _08070288 + movs r5, 0 + movs r4, 0x1 +_080702B8: + bl GenerateRandomNumber + adds r1, r7, r5 + lsls r0, 16 + lsrs r0, 16 + ands r0, r4 + strb r0, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _080702B8 + movs r5, 0 +_080702D2: + mov r1, sp + adds r0, r1, r5 + ldrb r0, [r0] + cmp r0, 0x5 + bhi _080703AE + lsls r0, 2 + ldr r1, =_080702EC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080702EC: + .4byte _08070304 + .4byte _08070322 + .4byte _0807033C + .4byte _08070356 + .4byte _08070370 + .4byte _08070390 +_08070304: + adds r0, r7, r5 + ldrb r1, [r0] + movs r0, 0x8C + muls r0, r1 + add r0, r8 + movs r1, 0x27 + bl pokemon_getattr_encrypted + add r2, sp, 0x10 + strb r0, [r2] + mov r0, r9 + movs r1, 0x27 + bl pokemon_setattr + b _080703AE +_08070322: + add r4, sp, 0x10 + adds r0, r7, r5 + ldrb r1, [r0] + movs r0, 0x8C + muls r0, r1 + add r0, r8 + movs r1, 0x28 + bl pokemon_getattr_encrypted + strb r0, [r4] + mov r0, r9 + movs r1, 0x28 + b _08070388 +_0807033C: + add r4, sp, 0x10 + adds r0, r7, r5 + ldrb r1, [r0] + movs r0, 0x8C + muls r0, r1 + add r0, r8 + movs r1, 0x29 + bl pokemon_getattr_encrypted + strb r0, [r4] + mov r0, r9 + movs r1, 0x29 + b _08070388 +_08070356: + add r4, sp, 0x10 + adds r0, r7, r5 + ldrb r1, [r0] + movs r0, 0x8C + muls r0, r1 + add r0, r8 + movs r1, 0x2A + bl pokemon_getattr_encrypted + strb r0, [r4] + mov r0, r9 + movs r1, 0x2A + b _08070388 +_08070370: + add r4, sp, 0x10 + adds r0, r7, r5 + ldrb r1, [r0] + movs r0, 0x8C + muls r0, r1 + add r0, r8 + movs r1, 0x2B + bl pokemon_getattr_encrypted + strb r0, [r4] + mov r0, r9 + movs r1, 0x2B +_08070388: + adds r2, r4, 0 + bl pokemon_setattr + b _080703AE +_08070390: + add r4, sp, 0x10 + adds r0, r7, r5 + ldrb r1, [r0] + movs r0, 0x8C + muls r0, r1 + add r0, r8 + movs r1, 0x2C + bl pokemon_getattr_encrypted + strb r0, [r4] + mov r0, r9 + movs r1, 0x2C + adds r2, r4, 0 + bl pokemon_setattr +_080703AE: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _080702D2 + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8070260 + + thumb_func_start pokemon_get_eggmoves +pokemon_get_eggmoves: @ 80703C8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r1 + movs r6, 0 + movs r4, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + ldr r5, =gEggMoves + ldrh r1, [r5] + ldr r7, =0x00004e20 + adds r0, r3, r7 + cmp r1, r0 + bne _080703F8 + movs r4, 0x1 + b _0807041A + .pool +_080703F8: + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, =0x00000471 + ldr r5, =gEggMoves + cmp r2, r0 + bhi _0807041A + lsls r0, r2, 1 + adds r0, r5 + ldrh r1, [r0] + ldr r7, =0x00004e20 + adds r0, r3, r7 + cmp r1, r0 + bne _080703F8 + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_0807041A: + movs r2, 0 + lsls r0, r4, 1 + adds r0, r5 + ldrh r0, [r0] + ldr r1, =0x00004e20 + cmp r0, r1 + bhi _08070456 + adds r7, r5, 0 + adds r3, r1, 0 +_0807042C: + lsls r1, r2, 1 + add r1, r8 + adds r0, r4, r2 + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x9 + bhi _08070456 + adds r0, r4, r2 + lsls r0, 1 + adds r0, r5 + ldrh r0, [r0] + cmp r0, r3 + bls _0807042C +_08070456: + lsls r0, r6, 24 + lsrs r0, 24 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end pokemon_get_eggmoves + + thumb_func_start daycare_build_child_moveset +daycare_build_child_moveset: @ 8070470 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + adds r7, r0, 0 + mov r10, r1 + mov r9, r2 + movs r0, 0 + str r0, [sp] + movs r6, 0 + ldr r5, =0x02024a4c + movs r2, 0 + ldr r4, =0x02024a28 + ldr r3, =0x02024a30 +_08070490: + lsls r1, r6, 1 + adds r0, r1, r5 + strh r2, [r0] + adds r0, r1, r4 + strh r2, [r0] + adds r1, r3 + strh r2, [r1] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x3 + bls _08070490 + movs r6, 0 + ldr r2, =0x02024a38 + movs r1, 0 +_080704AE: + lsls r0, r6, 1 + adds r0, r2 + strh r1, [r0] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x9 + bls _080704AE + movs r6, 0 + ldr r2, =0x020249c4 + movs r1, 0 +_080704C4: + lsls r0, r6, 1 + adds r0, r2 + strh r1, [r0] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x31 + bls _080704C4 + adds r0, r7, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x020249c4 + bl sub_806E204 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + movs r6, 0 + ldr r1, =0x02024a28 + mov r8, r1 +_080704F2: + adds r5, r6, 0 + adds r5, 0xD + mov r0, r10 + adds r1, r5, 0 + bl pokemon_getattr_encrypted + lsls r4, r6, 1 + mov r2, r8 + adds r1, r4, r2 + strh r0, [r1] + mov r0, r9 + adds r1, r5, 0 + bl pokemon_getattr_encrypted + ldr r1, =0x02024a4c + adds r4, r1 + strh r0, [r4] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x3 + bls _080704F2 + ldr r1, =0x02024a38 + adds r0, r7, 0 + bl pokemon_get_eggmoves + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r6, 0 +_0807052E: + ldr r0, =0x02024a28 + lsls r1, r6, 1 + adds r2, r1, r0 + ldrh r1, [r2] + mov r9, r0 + cmp r1, 0 + beq _080705A4 + movs r5, 0 + cmp r5, r8 + bcs _08070596 + adds r4, r2, 0 + ldr r2, =0x0000ffff +_08070546: + ldr r0, =0x02024a38 + lsls r1, r5, 1 + adds r1, r0 + ldrh r0, [r4] + ldrh r1, [r1] + cmp r0, r1 + bne _0807058C + adds r1, r0, 0 + adds r0, r7, 0 + str r2, [sp, 0x8] + bl pokemon_moveset_pad_ + lsls r0, 16 + lsrs r0, 16 + ldr r2, [sp, 0x8] + cmp r0, r2 + bne _08070596 + ldrh r1, [r4] + adds r0, r7, 0 + bl sub_8069424 + b _08070596 + .pool +_0807058C: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, r8 + bcc _08070546 +_08070596: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r3, =0x02024a28 + mov r9, r3 + cmp r6, 0x3 + bls _0807052E +_080705A4: + movs r6, 0 +_080705A6: + lsls r0, r6, 1 + mov r2, r9 + adds r1, r0, r2 + ldrh r1, [r1] + adds r2, r0, 0 + adds r6, 0x1 + mov r8, r6 + cmp r1, 0 + beq _08070608 + movs r5, 0 + ldr r0, =0x02024a28 + adds r4, r2, r0 + ldr r6, =0x0000ffff + mov r9, r0 +_080705C2: + ldr r3, =0x00000121 + adds r0, r5, r3 + lsls r0, 16 + lsrs r0, 16 + bl ItemIdToBattleMoveId + ldrh r1, [r4] + lsls r0, 16 + lsrs r0, 16 + cmp r1, r0 + bne _080705FE + lsls r1, r5, 24 + lsrs r1, 24 + adds r0, r7, 0 + bl sub_806E00C + cmp r0, 0 + beq _080705FE + ldrh r1, [r4] + adds r0, r7, 0 + bl pokemon_moveset_pad_ + lsls r0, 16 + lsrs r0, 16 + cmp r0, r6 + bne _080705FE + ldrh r1, [r4] + adds r0, r7, 0 + bl sub_8069424 +_080705FE: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x39 + bls _080705C2 +_08070608: + mov r1, r8 + lsls r0, r1, 16 + lsrs r6, r0, 16 + cmp r6, 0x3 + bls _080705A6 + movs r6, 0 + mov r2, r9 + ldrh r0, [r2] + ldr r3, =0x02024a30 + mov r10, r3 + cmp r0, 0 + beq _08070672 + mov r4, r9 + ldr r0, =0x02024a4c + mov r9, r0 + mov r12, r10 +_08070628: + movs r5, 0 + lsls r2, r6, 1 + adds r6, 0x1 + mov r8, r6 + adds r3, r2, r4 +_08070632: + lsls r0, r5, 1 + add r0, r9 + ldrh r2, [r3] + adds r1, r2, 0 + ldrh r0, [r0] + cmp r1, r0 + bne _08070654 + cmp r1, 0 + beq _08070654 + ldr r1, [sp] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp] + lsls r1, 1 + add r1, r12 + strh r2, [r1] +_08070654: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x3 + bls _08070632 + mov r1, r8 + lsls r0, r1, 16 + lsrs r6, r0, 16 + cmp r6, 0x3 + bhi _08070672 + lsls r0, r6, 1 + adds r0, r4 + ldrh r0, [r0] + cmp r0, 0 + bne _08070628 +_08070672: + movs r6, 0 + mov r2, r10 + ldrh r0, [r2] + cmp r0, 0 + beq _080706FC +_0807067C: + movs r5, 0 + adds r3, r6, 0x1 + mov r8, r3 + ldr r0, [sp, 0x4] + cmp r5, r0 + bcs _080706E4 + ldr r2, =0x0000ffff +_0807068A: + ldr r1, =0x020249c4 + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + cmp r1, 0 + beq _080706D8 + lsls r0, r6, 1 + mov r3, r10 + adds r4, r0, r3 + ldrh r0, [r4] + cmp r0, r1 + bne _080706D8 + adds r1, r0, 0 + adds r0, r7, 0 + str r2, [sp, 0x8] + bl pokemon_moveset_pad_ + lsls r0, 16 + lsrs r0, 16 + ldr r2, [sp, 0x8] + cmp r0, r2 + bne _080706E4 + ldrh r1, [r4] + adds r0, r7, 0 + bl sub_8069424 + b _080706E4 + .pool +_080706D8: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, [sp, 0x4] + cmp r5, r0 + bcc _0807068A +_080706E4: + mov r1, r8 + lsls r0, r1, 16 + lsrs r6, r0, 16 + cmp r6, 0x3 + bhi _080706FC + ldr r0, =0x02024a30 + lsls r1, r6, 1 + adds r1, r0 + ldrh r1, [r1] + mov r10, r0 + cmp r1, 0 + bne _0807067C +_080706FC: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end daycare_build_child_moveset + + thumb_func_start sub_8070710 +sub_8070710: @ 8070710 + adds r2, r0, 0 + movs r1, 0x8C + lsls r1, 1 + adds r0, r2, r1 + movs r1, 0 + str r1, [r0] + movs r3, 0x8E + lsls r3, 1 + adds r0, r2, r3 + strb r1, [r0] + bx lr + thumb_func_end sub_8070710 + + thumb_func_start sub_8070728 +sub_8070728: @ 8070728 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003030 + adds r0, r1 + bl sub_8070710 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8070728 + + thumb_func_start incense_effects +incense_effects: @ 8070744 + push {r4-r7,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrh r1, [r4] + movs r7, 0xB4 + lsls r7, 1 + cmp r1, r7 + beq _0807075C + movs r0, 0xAF + lsls r0, 1 + cmp r1, r0 + bne _0807079E +_0807075C: + adds r0, r5, 0 + movs r1, 0xC + bl pokemon_getattr_encrypted + lsls r0, 16 + lsrs r6, r0, 16 + adds r0, r5, 0 + adds r0, 0x8C + movs r1, 0xC + bl pokemon_getattr_encrypted + lsls r0, 16 + lsrs r2, r0, 16 + ldrh r0, [r4] + cmp r0, r7 + bne _08070788 + cmp r6, 0xDD + beq _08070788 + cmp r2, 0xDD + beq _08070788 + movs r0, 0xCA + strh r0, [r4] +_08070788: + ldrh r1, [r4] + movs r0, 0xAF + lsls r0, 1 + cmp r1, r0 + bne _0807079E + cmp r6, 0xDC + beq _0807079E + cmp r2, 0xDC + beq _0807079E + movs r0, 0xB7 + strh r0, [r4] +_0807079E: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end incense_effects + + thumb_func_start sub_80707A4 +sub_80707A4: @ 80707A4 + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr_encrypted + adds r5, r0, 0 + adds r4, 0x8C + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr_encrypted + cmp r5, 0xCA + beq _080707C6 + cmp r0, 0xCA + bne _080707E2 +_080707C6: + movs r4, 0xAC + lsls r4, 1 + adds r0, r6, 0 + adds r1, r4, 0 + bl pokemon_moveset_pad_ + lsls r0, 16 + ldr r1, =0xffff0000 + cmp r0, r1 + bne _080707E2 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_8069424 +_080707E2: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80707A4 + + thumb_func_start sub_80707EC +sub_80707EC: @ 80707EC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r7, r0, 0 + adds r6, r1, 0 + movs r4, 0 + movs r0, 0x1 + mov r8, r0 +_080707FE: + movs r0, 0x8C + muls r0, r4 + adds r5, r7, r0 + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr_encrypted + lsls r1, r4, 1 + add r1, sp + strh r0, [r1] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x84 + bne _08070826 + adds r0, r4, 0 + mov r1, r8 + eors r0, r1 + strb r0, [r6] + strb r4, [r6, 0x1] + b _0807083E +_08070826: + adds r0, r5, 0 + bl pokemon_roll_gender + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFE + bne _0807083E + strb r4, [r6] + adds r0, r4, 0 + mov r1, r8 + eors r0, r1 + strb r0, [r6, 0x1] +_0807083E: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x1 + bls _080707FE + ldrb r0, [r6] + lsls r0, 1 + add r0, sp + ldrh r0, [r0] + bl sub_8070004 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x1D + bne _08070870 + movs r1, 0x8C + lsls r1, 1 + adds r0, r7, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _08070870 + movs r4, 0x20 +_08070870: + ldr r0, =0x00000183 + cmp r4, r0 + bne _0807088C + movs r1, 0x8C + lsls r1, 1 + adds r0, r7, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0807088C + movs r4, 0xC1 + lsls r4, 1 +_0807088C: + ldrb r0, [r6, 0x1] + lsls r0, 1 + add r0, sp + ldrh r0, [r0] + cmp r0, 0x84 + bne _080708B4 + ldrb r1, [r6] + movs r0, 0x8C + muls r0, r1 + adds r0, r7, r0 + bl pokemon_roll_gender + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFE + beq _080708B4 + ldrb r1, [r6, 0x1] + ldrb r0, [r6] + strb r0, [r6, 0x1] + strb r1, [r6] +_080708B4: + adds r0, r4, 0 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80707EC + + thumb_func_start sub_80708C8 +sub_80708C8: @ 80708C8 + push {r4-r6,lr} + sub sp, 0x6C + adds r6, r0, 0 + add r5, sp, 0x64 + adds r1, r5, 0 + bl sub_80707EC + add r4, sp, 0x68 + strh r0, [r4] + adds r0, r4, 0 + adds r1, r6, 0 + bl incense_effects + ldrh r1, [r4] + mov r0, sp + adds r2, r6, 0 + bl sub_8070A0C + mov r0, sp + adds r1, r6, 0 + bl sub_8070260 + ldrb r0, [r5, 0x1] + movs r2, 0x8C + adds r1, r0, 0 + muls r1, r2 + adds r1, r6, r1 + ldrb r0, [r5] + muls r2, r0 + adds r2, r6, r2 + mov r0, sp + bl daycare_build_child_moveset + ldrh r0, [r4] + cmp r0, 0xAC + bne _08070918 + mov r0, sp + adds r1, r6, 0 + bl sub_80707A4 +_08070918: + mov r2, sp + adds r2, 0x6A + movs r0, 0x1 + strb r0, [r2] + mov r0, sp + movs r1, 0x2D + bl pokemon_setattr + ldr r0, =0x020244ec + movs r1, 0xFA + lsls r1, 1 + adds r0, r1 + mov r1, sp + movs r2, 0x64 + bl memcpy + bl party_compaction + bl calc_player_party_count + adds r0, r6, 0 + bl sub_8070710 + add sp, 0x6C + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80708C8 + + thumb_func_start sub_8070954 +sub_8070954: @ 8070954 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x18 + adds r7, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 24 + lsrs r6, 24 + movs r4, 0 + str r4, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + str r4, [sp, 0xC] + adds r1, r5, 0 + movs r2, 0x5 + movs r3, 0x20 + bl create_pokemon_set_level + movs r0, 0x12 + add r0, sp + mov r8, r0 + strb r4, [r0] + movs r1, 0x4 + add r0, sp, 0x10 + strh r1, [r0] + mov r4, sp + adds r4, 0x13 + movs r0, 0x1 + mov r9, r0 + mov r0, r9 + strb r0, [r4] + adds r0, r7, 0 + movs r1, 0x26 + add r2, sp, 0x10 + bl pokemon_setattr + ldr r2, =gEggName + adds r0, r7, 0 + movs r1, 0x2 + bl pokemon_setattr + lsls r2, r5, 3 + subs r2, r5 + lsls r2, 2 + ldr r0, =gBaseStats + 0x11 @ egg cycles offset + adds r2, r0 + adds r0, r7, 0 + movs r1, 0x20 + bl pokemon_setattr + adds r0, r7, 0 + movs r1, 0x24 + mov r2, r8 + bl pokemon_setattr + adds r0, r7, 0 + movs r1, 0x3 + adds r2, r4, 0 + bl pokemon_setattr + cmp r6, 0 + beq _080709E6 + add r2, sp, 0x14 + movs r0, 0xFD + strb r0, [r2] + adds r0, r7, 0 + movs r1, 0x23 + bl pokemon_setattr +_080709E6: + mov r2, sp + adds r2, 0x15 + mov r0, r9 + strb r0, [r2] + adds r0, r7, 0 + movs r1, 0x2D + bl pokemon_setattr + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8070954 + + thumb_func_start sub_8070A0C +sub_8070A0C: @ 8070A0C + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x14 + adds r6, r0, 0 + adds r5, r1, 0 + lsls r5, 16 + lsrs r5, 16 + movs r0, 0x8C + lsls r0, 1 + adds r2, r0 + ldr r0, [r2] + movs r1, 0x1 + mov r8, r1 + str r1, [sp] + str r0, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + str r4, [sp, 0xC] + adds r0, r6, 0 + adds r1, r5, 0 + movs r2, 0x5 + movs r3, 0x20 + bl create_pokemon_set_level + movs r0, 0x12 + add r0, sp + mov r9, r0 + strb r4, [r0] + movs r1, 0x4 + add r0, sp, 0x10 + strh r1, [r0] + mov r4, sp + adds r4, 0x13 + mov r1, r8 + strb r1, [r4] + adds r0, r6, 0 + movs r1, 0x26 + add r2, sp, 0x10 + bl pokemon_setattr + ldr r2, =gEggName + adds r0, r6, 0 + movs r1, 0x2 + bl pokemon_setattr + lsls r2, r5, 3 + subs r2, r5 + lsls r2, 2 + ldr r0, =gBaseStats + 0x11 @ egg cycles offset + adds r2, r0 + adds r0, r6, 0 + movs r1, 0x20 + bl pokemon_setattr + adds r0, r6, 0 + movs r1, 0x24 + mov r2, r9 + bl pokemon_setattr + adds r0, r6, 0 + movs r1, 0x3 + adds r2, r4, 0 + bl pokemon_setattr + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8070A0C + + thumb_func_start sp0B8_daycare +sp0B8_daycare: @ 8070AA8 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003030 + adds r0, r1 + bl sub_80708C8 + pop {r0} + bx r0 + .pool + thumb_func_end sp0B8_daycare + + thumb_func_start sub_8070AC4 +sub_8070AC4: @ 8070AC4 + push {r4-r7,lr} + sub sp, 0x4 + adds r6, r0, 0 + movs r7, 0 + movs r5, 0 +_08070ACE: + movs r0, 0x8C + adds r4, r5, 0 + muls r4, r0 + adds r0, r6, r4 + movs r1, 0x5 + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _08070AEE + adds r1, r6, 0 + adds r1, 0x88 + adds r1, r4 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + adds r7, 0x1 +_08070AEE: + adds r5, 0x1 + cmp r5, 0x1 + bls _08070ACE + movs r1, 0x8C + lsls r1, 1 + adds r0, r6, r1 + ldr r0, [r0] + cmp r0, 0 + bne _08070B34 + cmp r7, 0x2 + bne _08070B34 + subs r1, 0x4 + adds r0, r6, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _08070B34 + adds r0, r6, 0 + bl daycare_relationship_score + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + muls r0, r1 + ldr r1, =0x0000ffff + bl __udivsi3 + cmp r4, r0 + bls _08070B34 + bl sub_80701E0 +_08070B34: + movs r0, 0x8E + lsls r0, 1 + adds r1, r6, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _08070BC0 + bl sub_807228C + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + ldr r0, =0x020244e9 + ldrb r0, [r0] + cmp r5, r0 + bcs _08070BC0 + ldr r4, =0x020244ec +_08070B5C: + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + beq _08070BB4 + adds r0, r4, 0 + movs r1, 0x4 + bl pokemon_getattr + cmp r0, 0 + bne _08070BB4 + adds r0, r4, 0 + movs r1, 0x20 + bl pokemon_getattr + adds r1, r0, 0 + str r1, [sp] + cmp r0, 0 + beq _08070BA8 + cmp r0, r6 + bcc _08070B98 + subs r0, r6 + b _08070B9A + .pool +_08070B98: + subs r0, r1, 0x1 +_08070B9A: + str r0, [sp] + adds r0, r4, 0 + movs r1, 0x20 + mov r2, sp + bl pokemon_setattr + b _08070BB4 +_08070BA8: + ldr r0, =0x020375e0 + strh r5, [r0] + movs r0, 0x1 + b _08070BC2 + .pool +_08070BB4: + adds r4, 0x64 + adds r5, 0x1 + ldr r0, =0x020244e9 + ldrb r0, [r0] + cmp r5, r0 + bcc _08070B5C +_08070BC0: + movs r0, 0 +_08070BC2: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8070AC4 + + thumb_func_start sub_8070BD0 +sub_8070BD0: @ 8070BD0 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003030 + adds r0, r1 + bl sub_8070AC4 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8070BD0 + + thumb_func_start sub_8070BF0 +sub_8070BF0: @ 8070BF0 + push {lr} + movs r1, 0x8C + lsls r1, 1 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + beq _08070C00 + movs r0, 0x1 +_08070C00: + pop {r1} + bx r1 + thumb_func_end sub_8070BF0 + + thumb_func_start sub_8070C04 +sub_8070C04: @ 8070C04 + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + movs r1, 0xB + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _08070C2E + ldr r1, =0x02021cc4 + adds r0, r4, 0 + bl pokemon_get_nick_ + adds r0, r4, 0 + movs r1, 0x7 + mov r2, sp + bl pokemon_getattr_encrypted + ldr r0, =0x02021ec4 + mov r1, sp + bl CopyString +_08070C2E: + adds r4, 0x8C + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _08070C44 + ldr r1, =0x02021dc4 + adds r0, r4, 0 + bl pokemon_get_nick_ +_08070C44: + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8070C04 + + thumb_func_start sub_8070C58 +sub_8070C58: @ 8070C58 + push {r4,r5,lr} + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + movs r5, 0x64 + muls r0, r5 + ldr r4, =0x020244ec + adds r0, r4 + ldr r1, =0x02021cc4 + bl pokemon_get_nick_ + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + muls r0, r5 + adds r0, r4 + movs r1, 0xB + bl pokemon_getattr_encrypted + lsls r0, 16 + lsrs r0, 16 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8070C58 + + thumb_func_start sp0B5_daycare +sp0B5_daycare: @ 8070C94 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003030 + adds r0, r1 + bl sub_8070C04 + pop {r0} + bx r0 + .pool + thumb_func_end sp0B5_daycare + + thumb_func_start sp0B6_daycare +sp0B6_daycare: @ 8070CB0 + push {r4,lr} + ldr r4, =0x03005d8c + ldr r0, [r4] + ldr r1, =0x00003030 + adds r0, r1 + bl sub_8070BF0 + lsls r0, 24 + cmp r0, 0 + beq _08070CD0 + movs r0, 0x1 + b _08070CF2 + .pool +_08070CD0: + ldr r0, [r4] + ldr r1, =0x00003030 + adds r0, r1 + bl daycare_count_pokemon + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08070CEC + movs r0, 0 + b _08070CF2 + .pool +_08070CEC: + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 +_08070CF2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sp0B6_daycare + + thumb_func_start sub_8070CF8 +sub_8070CF8: @ 8070CF8 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003030 + adds r0, r1 + bl daycare_count_pokemon + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08070D10 + movs r0, 0 +_08070D10: + pop {r1} + bx r1 + .pool + thumb_func_end sub_8070CF8 + + thumb_func_start sub_8070D1C +sub_8070D1C: @ 8070D1C + push {r4-r6,lr} + adds r5, r1, 0 + movs r4, 0 + adds r1, r0, 0 +_08070D24: + movs r3, 0 + ldrh r0, [r1] + adds r2, r5, 0 +_08070D2A: + ldrh r6, [r2] + cmp r0, r6 + bne _08070D34 + movs r0, 0x1 + b _08070D46 +_08070D34: + adds r2, 0x2 + adds r3, 0x1 + cmp r3, 0x1 + ble _08070D2A + adds r1, 0x2 + adds r4, 0x1 + cmp r4, 0x1 + ble _08070D24 + movs r0, 0 +_08070D46: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8070D1C + + thumb_func_start daycare_relationship_score +daycare_relationship_score: @ 8070D4C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x30 + str r0, [sp, 0x1C] + movs r7, 0 + mov r0, sp + adds r0, 0x8 + str r0, [sp, 0x20] + add r1, sp, 0xC + mov r9, r1 + mov r2, sp + adds r2, 0x14 + str r2, [sp, 0x24] + subs r0, 0x6 + ldr r1, =gBaseStats + mov r10, r1 + ldr r5, [sp, 0x20] + mov r8, r0 + mov r6, sp + str r2, [sp, 0x28] + mov r2, r9 + str r2, [sp, 0x2C] +_08070D7E: + movs r0, 0x8C + adds r4, r7, 0 + muls r4, r0 + ldr r0, [sp, 0x1C] + adds r4, r0, r4 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr_encrypted + strh r0, [r5] + adds r0, r4, 0 + movs r1, 0x1 + bl pokemon_getattr_encrypted + ldr r1, [sp, 0x2C] + stm r1!, {r0} + str r1, [sp, 0x2C] + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr_encrypted + adds r1, r0, 0 + ldrh r0, [r5] + bl pokemon_species_get_gender_info + lsls r0, 24 + lsrs r0, 24 + ldr r2, [sp, 0x28] + stm r2!, {r0} + str r2, [sp, 0x28] + ldrh r1, [r5] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r10 + ldrb r0, [r0, 0x14] + strh r0, [r6] + ldrh r1, [r5] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r10 + ldrb r0, [r0, 0x15] + mov r1, r8 + strh r0, [r1] + adds r5, 0x2 + movs r2, 0x4 + add r8, r2 + adds r6, 0x4 + adds r7, 0x1 + cmp r7, 0x1 + bls _08070D7E + mov r0, sp + ldrh r1, [r0] + cmp r1, 0xF + beq _08070DFC + ldrh r0, [r0, 0x4] + cmp r0, 0xF + beq _08070DFC + cmp r1, 0xD + bne _08070E04 + cmp r0, 0xD + bne _08070E08 +_08070DFC: + movs r0, 0 + b _08070E5C + .pool +_08070E04: + cmp r0, 0xD + bne _08070E14 +_08070E08: + ldr r1, [sp, 0xC] + mov r2, r9 + ldr r0, [r2, 0x4] + cmp r1, r0 + beq _08070E56 + b _08070E5A +_08070E14: + ldr r0, [sp, 0x14] + ldr r2, [sp, 0x24] + ldr r1, [r2, 0x4] + cmp r0, r1 + beq _08070DFC + cmp r0, 0xFF + beq _08070DFC + cmp r1, 0xFF + beq _08070DFC + add r1, sp, 0x4 + mov r0, sp + bl sub_8070D1C + lsls r0, 24 + cmp r0, 0 + beq _08070DFC + ldr r0, [sp, 0x20] + ldrh r1, [r0, 0x2] + ldrh r0, [r0] + cmp r0, r1 + bne _08070E4C + ldr r1, [sp, 0xC] + mov r2, r9 + ldr r0, [r2, 0x4] + cmp r1, r0 + beq _08070E5A + movs r0, 0x46 + b _08070E5C +_08070E4C: + ldr r1, [sp, 0xC] + mov r2, r9 + ldr r0, [r2, 0x4] + cmp r1, r0 + bne _08070E5A +_08070E56: + movs r0, 0x14 + b _08070E5C +_08070E5A: + movs r0, 0x32 +_08070E5C: + 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 daycare_relationship_score + + thumb_func_start daycare_relationship_score_from_savegame +daycare_relationship_score_from_savegame: @ 8070E6C + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003030 + adds r0, r1 + bl daycare_relationship_score + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end daycare_relationship_score_from_savegame + + thumb_func_start sp0B9_daycare_relationship_comment +sp0B9_daycare_relationship_comment: @ 8070E8C + push {lr} + bl daycare_relationship_score_from_savegame + lsls r0, 24 + lsrs r0, 24 + adds r2, r0, 0 + movs r1, 0 + cmp r0, 0 + bne _08070EA0 + movs r1, 0x3 +_08070EA0: + cmp r0, 0x14 + bne _08070EA6 + movs r1, 0x2 +_08070EA6: + cmp r0, 0x32 + bne _08070EAC + movs r1, 0x1 +_08070EAC: + cmp r2, 0x46 + bne _08070EB2 + movs r1, 0 +_08070EB2: + ldr r0, =0x02021fc4 + ldr r2, =gUnknown_0832B6F8 + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl CopyString + pop {r0} + bx r0 + .pool + thumb_func_end sp0B9_daycare_relationship_comment + + thumb_func_start sub_8070ECC +sub_8070ECC: @ 8070ECC + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + mov r2, sp + mov r1, sp + movs r0, 0 + strb r0, [r1, 0x1] + strb r0, [r2] + movs r3, 0 + ldrb r0, [r4] + cmp r0, 0xFF + beq _08070F10 +_08070EE8: + adds r1, r4, r3 + ldrb r0, [r1] + cmp r0, 0xB5 + bne _08070EF6 + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] +_08070EF6: + ldrb r0, [r1] + cmp r0, 0xB6 + bne _08070F02 + ldrb r0, [r2, 0x1] + adds r0, 0x1 + strb r0, [r2, 0x1] +_08070F02: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + adds r0, r4, r3 + ldrb r0, [r0] + cmp r0, 0xFF + bne _08070EE8 +_08070F10: + cmp r5, 0 + bne _08070F24 + mov r0, sp + ldrb r0, [r0] + cmp r0, 0 + beq _08070F24 + mov r0, sp + ldrb r0, [r0, 0x1] + cmp r0, 0 + beq _08070F38 +_08070F24: + cmp r5, 0xFE + bne _08070F3C + mov r0, sp + ldrb r0, [r0, 0x1] + cmp r0, 0 + beq _08070F3C + mov r0, sp + ldrb r0, [r0] + cmp r0, 0 + bne _08070F3C +_08070F38: + movs r0, 0x1 + b _08070F3E +_08070F3C: + movs r0, 0 +_08070F3E: + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8070ECC + + thumb_func_start sub_8070F48 +sub_8070F48: @ 8070F48 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0 + bne _08070F68 + movs r1, 0 + bl sub_8070ECC + lsls r0, 24 + cmp r0, 0 + bne _08070F84 + ldr r1, =gUnknown_0832DAC7 + b _08070F86 + .pool +_08070F68: + cmp r1, 0xFE + bne _08070F84 + adds r0, r4, 0 + movs r1, 0xFE + bl sub_8070ECC + lsls r0, 24 + cmp r0, 0 + bne _08070F84 + ldr r1, =gUnknown_0832DAC9 + b _08070F86 + .pool +_08070F84: + ldr r1, =gUnknown_0832DACB +_08070F86: + adds r0, r4, 0 + bl AppendString + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8070F48 + + thumb_func_start sub_8070F98 +sub_8070F98: @ 8070F98 + push {r4,lr} + adds r4, r0, 0 + adds r0, r1, 0 + bl pokemon_roll_gender + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_8070F48 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8070F98 + + thumb_func_start sub_8070FB4 +sub_8070FB4: @ 8070FB4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x28 + mov r8, r0 + adds r7, r1, 0 + movs r0, 0xFF + strb r0, [r7] + movs r6, 0 + add r0, sp, 0x14 + mov r9, r0 +_08070FCC: + movs r0, 0x8C + adds r4, r6, 0 + muls r4, r0 + add r4, r8 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 2 + mov r1, sp + adds r5, r1, r0 + adds r0, r4, 0 + adds r1, r5, 0 + bl pokemon_get_nick_ + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8070F98 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x1 + bls _08070FCC + adds r0, r7, 0 + mov r1, sp + bl CopyString + ldr r4, =gUnknown_085EF881 + adds r0, r7, 0 + adds r1, r4, 0 + bl AppendString + adds r0, r7, 0 + mov r1, r9 + bl AppendString + adds r0, r7, 0 + adds r1, r4, 0 + bl AppendString + ldr r1, =gUnknown_085EF883 + adds r0, r7, 0 + bl AppendString + add sp, 0x28 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8070FB4 + + thumb_func_start sub_8071038 +sub_8071038: @ 8071038 + push {r4-r6,lr} + sub sp, 0x14 + adds r6, r0, 0 + adds r4, r1, 0 + movs r0, 0xFF + strb r0, [r4] + movs r5, 0 +_08071046: + adds r0, r4, 0 + ldr r1, =gUnknown_085EF888 + bl AppendString + movs r0, 0x8C + adds r2, r5, 0 + muls r2, r0 + adds r0, r6, r2 + adds r1, r6, 0 + adds r1, 0x88 + adds r1, r2 + ldr r1, [r1] + bl sub_806FDEC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, sp + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + adds r0, r4, 0 + mov r1, sp + bl AppendString + adds r0, r4, 0 + ldr r1, =gUnknown_085EF881 + bl AppendString + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bls _08071046 + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8071038 + + thumb_func_start sub_807109C +sub_807109C: @ 807109C + push {r4-r6,lr} + sub sp, 0x10 + str r1, [sp] + mov r1, sp + movs r5, 0 + strb r0, [r1, 0x4] + mov r0, sp + movs r6, 0x1 + movs r4, 0x1 + strb r4, [r0, 0x5] + strb r2, [r0, 0x6] + strb r3, [r0, 0x7] + strb r2, [r0, 0x8] + strb r3, [r0, 0x9] + mov r3, sp + ldrb r1, [r3, 0xC] + movs r2, 0x10 + negs r2, r2 + adds r0, r2, 0 + ands r0, r1 + strb r0, [r3, 0xC] + ldr r3, =0x03003014 + ldrb r1, [r3] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r3] + mov r0, sp + strb r5, [r0, 0xA] + strb r4, [r0, 0xB] + mov r3, sp + ldrb r1, [r3, 0xC] + movs r4, 0xF + adds r0, r4, 0 + ands r0, r1 + movs r1, 0x20 + orrs r0, r1 + strb r0, [r3, 0xC] + mov r1, sp + ldrb r0, [r1, 0xD] + ands r2, r0 + orrs r2, r6 + strb r2, [r1, 0xD] + ands r2, r4 + movs r0, 0x30 + orrs r2, r0 + strb r2, [r1, 0xD] + mov r0, sp + movs r1, 0xFF + movs r2, 0 + bl AddTextPrinter + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807109C + + thumb_func_start sub_8071110 +sub_8071110: @ 8071110 + push {r4-r6,lr} + sub sp, 0x14 + adds r5, r0, 0 + adds r4, r1, 0 + adds r6, r3, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x8C + muls r0, r2 + adds r5, r0 + adds r0, r5, 0 + mov r1, sp + bl pokemon_get_nick_ + mov r0, sp + adds r1, r5, 0 + bl sub_8070F98 + adds r0, r4, 0 + mov r1, sp + movs r2, 0x8 + adds r3, r6, 0 + bl sub_807109C + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8071110 + + thumb_func_start sub_8071148 +sub_8071148: @ 8071148 + 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 r5, 24 + lsrs r5, 24 + ldr r1, =gUnknown_085EF888 + mov r0, sp + bl CopyString + movs r0, 0x8C + adds r1, r6, 0 + muls r1, r0 + adds r0, r4, r1 + adds r4, 0x88 + adds r4, r1 + ldr r1, [r4] + bl sub_806FDEC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + add r4, sp, 0xC + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + mov r0, sp + adds r1, r4, 0 + bl AppendString + movs r0, 0x1 + mov r1, sp + movs r2, 0x70 + bl GetStringRightAlignXOffset + adds r2, r0, 0 + adds r0, r5, 0 + mov r1, sp + mov r3, r8 + bl sub_807109C + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8071148 + + thumb_func_start sub_80711B8 +sub_80711B8: @ 80711B8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r1, 0 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r2, 24 + lsrs r5, r2, 24 + cmp r6, 0x1 + bhi _080711F0 + ldr r0, =0x03005d8c + mov r8, r0 + ldr r0, [r0] + ldr r4, =0x00003030 + adds r0, r4 + adds r1, r7, 0 + adds r2, r6, 0 + adds r3, r5, 0 + bl sub_8071110 + mov r1, r8 + ldr r0, [r1] + adds r0, r4 + adds r1, r7, 0 + adds r2, r6, 0 + adds r3, r5, 0 + bl sub_8071148 +_080711F0: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80711B8 + + thumb_func_start c3_080469FC +c3_080469FC: @ 8071204 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrb r0, [r4, 0x8] + bl ListMenuHandleInput + adds r1, r0, 0 + ldr r0, =0x030022c0 + ldrh r2, [r0, 0x2E] + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _08071284 + cmp r1, 0x1 + bls _0807123C + cmp r1, 0x5 + beq _08071248 + b _0807124E + .pool +_0807123C: + ldr r0, =0x020375f0 + strh r1, [r0] + b _0807124E + .pool +_08071248: + ldr r1, =0x020375f0 + movs r0, 0x2 + strh r0, [r1] +_0807124E: + ldr r0, =0x03005e00 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + ldrb r0, [r4, 0x8] + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + ldrb r0, [r4, 0xA] + movs r1, 0x1 + bl sub_819746C + ldrb r0, [r4, 0xA] + bl RemoveWindow + adds r0, r5, 0 + bl remove_task + bl script_env_2_enable_and_set_ctx_running + b _080712B4 + .pool +_08071284: + movs r1, 0x2 + adds r0, r1, 0 + ands r0, r2 + cmp r0, 0 + beq _080712B4 + ldr r0, =0x020375f0 + strh r1, [r0] + ldrb r0, [r4, 0x8] + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + ldrb r0, [r4, 0xA] + movs r1, 0x1 + bl sub_819746C + ldrb r0, [r4, 0xA] + bl RemoveWindow + adds r0, r5, 0 + bl remove_task + bl script_env_2_enable_and_set_ctx_running +_080712B4: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end c3_080469FC + + thumb_func_start sub_80712C0 +sub_80712C0: @ 80712C0 + push {r4,r5,lr} + sub sp, 0x18 + ldr r0, =gUnknown_0832B6C0 + bl AddWindow + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0 + bl sub_81973FC + mov r1, sp + ldr r0, =gUnknown_0832B6E0 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + mov r0, sp + strb r4, [r0, 0x10] + movs r1, 0 + movs r2, 0 + bl ListMenuInit + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + ldr r0, =c3_080469FC + movs r1, 0x3 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r5, [r1, 0x8] + strh r4, [r1, 0xA] + add sp, 0x18 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80712C0 + + thumb_func_start sub_8071330 +sub_8071330: @ 8071330 + push {lr} + bl sub_81B9328 + ldr r1, =0x030022c0 + ldr r0, =c2_exit_to_overworld_2_switch + str r0, [r1, 0x8] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8071330 + + thumb_func_start sub_8071348 +sub_8071348: @ 8071348 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x50 + adds r5, r0, 0 + adds r6, r1, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x3C] + movs r4, 0 + add r7, sp, 0x18 + add r0, sp, 0x30 + mov r8, r0 + movs r1, 0x31 + add r1, sp + mov r10, r1 + mov r0, sp + adds r0, 0x32 + str r0, [sp, 0x40] + mov r1, sp + adds r1, 0x34 + str r1, [sp, 0x48] + adds r0, 0x1 + str r0, [sp, 0x44] + adds r1, 0x4 + str r1, [sp, 0x4C] +_08071386: + adds r1, r4, 0 + adds r1, 0xD + adds r0, r5, 0 + bl pokemon_getattr + lsls r1, r4, 1 + add r1, sp + adds r1, 0x10 + strh r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _08071386 + adds r0, r5, 0 + movs r1, 0 + bl pokemon_getattr + mov r9, r0 + movs r4, 0 +_080713AE: + adds r1, r4, 0 + adds r1, 0x27 + adds r0, r5, 0 + bl pokemon_getattr + lsls r1, r4, 2 + adds r1, r7, r1 + str r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _080713AE + adds r0, r5, 0 + movs r1, 0x3 + bl pokemon_getattr + mov r1, r8 + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0x25 + bl pokemon_getattr + mov r1, r10 + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0x8 + bl pokemon_getattr + ldr r1, [sp, 0x40] + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0x22 + bl pokemon_getattr + str r0, [sp, 0x38] + adds r0, r5, 0 + movs r1, 0x50 + bl pokemon_getattr + ldr r1, [sp, 0x48] + strb r0, [r1] + movs r0, 0x1 + str r0, [sp] + mov r0, r9 + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + str r0, [sp, 0xC] + adds r0, r6, 0 + ldr r1, [sp, 0x3C] + movs r2, 0x5 + movs r3, 0x20 + bl create_pokemon_set_level + movs r4, 0 +_0807141E: + adds r1, r4, 0 + adds r1, 0xD + lsls r0, r4, 1 + mov r2, sp + adds r2, r0 + adds r2, 0x10 + adds r0, r6, 0 + bl pokemon_setattr + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _0807141E + movs r4, 0 +_0807143C: + adds r1, r4, 0 + adds r1, 0x27 + lsls r2, r4, 2 + adds r2, r7, r2 + adds r0, r6, 0 + bl pokemon_setattr + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _0807143C + movs r0, 0x2 + mov r1, r8 + strb r0, [r1] + adds r0, r6, 0 + movs r1, 0x3 + mov r2, r8 + bl pokemon_setattr + adds r0, r6, 0 + movs r1, 0x25 + mov r2, r10 + bl pokemon_setattr + adds r0, r6, 0 + movs r1, 0x8 + ldr r2, [sp, 0x40] + bl pokemon_setattr + movs r0, 0x78 + ldr r1, [sp, 0x44] + strb r0, [r1] + adds r0, r6, 0 + movs r1, 0x20 + ldr r2, [sp, 0x44] + bl pokemon_setattr + adds r0, r6, 0 + movs r1, 0x22 + ldr r2, [sp, 0x4C] + bl pokemon_setattr + adds r0, r6, 0 + movs r1, 0x50 + ldr r2, [sp, 0x48] + bl pokemon_setattr + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0x64 + bl memcpy + add sp, 0x50 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8071348 + + thumb_func_start sub_80714B8 +sub_80714B8: @ 80714B8 + push {r4,r5,lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + add r4, sp, 0xC + movs r1, 0x46 + strb r1, [r4] + movs r1, 0x64 + adds r5, r0, 0 + muls r5, r1 + ldr r0, =0x020244ec + adds r5, r0 + ldr r1, =0x02024744 + adds r0, r5, 0 + bl sub_8071348 + adds r0, r5, 0 + movs r1, 0x2D + adds r2, r4, 0 + bl pokemon_setattr + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, sp + adds r1, r4, 0 + bl GetSpeciesName + adds r0, r5, 0 + movs r1, 0x2 + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + bl SpeciesToNationalPokedexNum + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r4, 0 + movs r1, 0x2 + bl pokedex_flag_operation + adds r0, r4, 0 + movs r1, 0x3 + bl pokedex_flag_operation + ldr r1, =0x02021cc4 + adds r0, r5, 0 + bl pokemon_get_nick + mov r2, sp + adds r2, 0xE + movs r0, 0x4 + strh r0, [r2] + adds r0, r5, 0 + movs r1, 0x26 + bl pokemon_setattr + add r2, sp, 0x10 + movs r0, 0 + strh r0, [r2] + adds r0, r5, 0 + movs r1, 0x24 + bl pokemon_setattr + bl sav1_map_get_name + mov r2, sp + adds r2, 0x12 + strb r0, [r2] + adds r0, r5, 0 + movs r1, 0x23 + bl pokemon_setattr + adds r0, r5, 0 + bl sub_806E924 + adds r0, r5, 0 + bl pokemon_calc_effective_stats + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80714B8 + + thumb_func_start sub_8071578 +sub_8071578: @ 8071578 + push {lr} + ldr r0, =0x020375e0 + ldrb r0, [r0] + bl sub_80714B8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8071578 + + thumb_func_start sub_807158C +sub_807158C: @ 807158C + push {r4-r6,lr} + sub sp, 0x20 + lsls r1, 24 + lsrs r1, 24 + movs r2, 0x8C + muls r1, r2 + adds r4, r0, r1 + adds r0, r4, 0 + mov r1, sp + bl pokemon_get_nick_ + adds r0, r4, 0 + adds r0, 0x70 + ldrh r0, [r0] + cmp r0, 0 + beq _08071608 + adds r6, r4, 0 + adds r6, 0x7C + mov r0, sp + adds r1, r6, 0 + bl CompareStringWithoutExtendedControlCodes + adds r5, r4, 0 + adds r5, 0x74 + cmp r0, 0 + bne _080715CE + ldr r0, =0x03005d90 + ldr r0, [r0] + adds r1, r5, 0 + bl CompareStringWithoutExtendedControlCodes + cmp r0, 0 + beq _08071608 +_080715CE: + ldr r0, =0x02021cc4 + mov r1, sp + bl CopyString + ldr r0, =0x02021dc4 + adds r4, 0x87 + ldrb r2, [r4] + lsls r2, 28 + lsrs r2, 28 + adds r1, r5, 0 + bl sub_81DB5E8 + ldr r0, =0x02021ec4 + ldrb r2, [r4] + lsrs r2, 4 + adds r1, r6, 0 + bl sub_81DB5E8 + movs r0, 0x1 + b _0807160A + .pool +_08071608: + movs r0, 0 +_0807160A: + add sp, 0x20 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_807158C + + thumb_func_start sub_8071614 +sub_8071614: @ 8071614 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003030 + adds r0, r1 + ldr r1, =0x020375e0 + ldrb r1, [r1] + bl sub_807158C + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8071614 + + thumb_func_start sub_807163C +sub_807163C: @ 807163C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r9, r3 + lsls r0, 24 + lsrs r3, r0, 24 + mov r8, r3 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r1, r2, 24 + adds r2, r1, 0 + movs r4, 0 + movs r7, 0 + movs r5, 0 + cmp r3, 0 + bne _0807166A + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r5, r1, r0 + movs r4, 0x1 +_0807166A: + cmp r3, 0x1 + bne _0807167A + movs r0, 0x64 + adds r1, r2, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r5, r1, r0 + movs r4, 0x3 +_0807167A: + cmp r6, 0 + beq _08071688 + cmp r6, 0x1 + beq _080716D8 + b _08071712 + .pool +_08071688: + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0 + bl pokemon_getattr + adds r3, r0, 0 + lsls r0, r4, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r2, [r1] + mov r6, r8 + lsls r1, r6, 1 + adds r1, 0x1 + lsls r1, 2 + adds r2, 0x4 + adds r2, r1 + ldr r1, [r2] + adds r2, r4, 0 + bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack + adds r0, r5, 0 + bl sub_806E794 + bl LoadCompressedObjectPalette + mov r0, r9 + strh r4, [r0] + b _08071712 + .pool +_080716D8: + adds r0, r5, 0 + bl sub_806E794 + ldrh r0, [r0, 0x4] + adds r1, r4, 0 + bl sub_806A068 + ldr r0, =0x0202499c + movs r1, 0x78 + movs r2, 0x4B + movs r3, 0x6 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, =0x02020630 + lsls r1, r7, 4 + adds r1, r7 + lsls r1, 2 + adds r2, r1, r4 + adds r2, 0x3E + ldrb r0, [r2] + movs r3, 0x4 + orrs r0, r3 + strb r0, [r2] + adds r4, 0x1C + adds r1, r4 + ldr r0, =DummyObjectCallback + str r0, [r1] +_08071712: + adds r0, r7, 0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_807163C + + thumb_func_start sub_807172C +sub_807172C: @ 807172C + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_807172C + + thumb_func_start sub_8071740 +sub_8071740: @ 8071740 + push {lr} + bl script_env_2_enable + ldr r0, =sub_8071760 + movs r1, 0xA + bl AddTask + movs r0, 0x1 + movs r1, 0 + bl fade_screen + pop {r0} + bx r0 + .pool + thumb_func_end sub_8071740 + + thumb_func_start sub_8071760 +sub_8071760: @ 8071760 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08071788 + bl overworld_free_bg_tilemaps + ldr r0, =c1_hatching_egg + bl SetMainCallback2 + ldr r1, =0x03005dac + ldr r0, =sub_80AF168 + str r0, [r1] + adds r0, r4, 0 + bl remove_task +_08071788: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8071760 + + thumb_func_start c1_hatching_egg +c1_hatching_egg: @ 80717A0 + push {r4,lr} + sub sp, 0x4 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x8 + bls _080717B4 + b _080719D6 +_080717B4: + lsls r0, 2 + ldr r1, =_080717C8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080717C8: + .4byte _080717EC + .4byte _080718B8 + .4byte _080718D0 + .4byte _08071904 + .4byte _08071924 + .4byte _0807193C + .4byte _08071954 + .4byte _08071970 + .4byte _080719C8 +_080717EC: + movs r0, 0 + movs r1, 0 + bl SetGpuReg + ldr r4, =0x03000de0 + movs r0, 0x14 + bl Alloc + str r0, [r4] + bl init_uns_table_pokemon_copy + ldr r2, [r4] + ldr r0, =0x020375e0 + ldrh r0, [r0] + movs r1, 0 + strb r0, [r2, 0x4] + ldr r0, [r4] + strb r1, [r0, 0x7] + ldr r0, =sub_807172C + bl SetVBlankCallback + bl current_map_music_get + ldr r1, =0x020375e2 + strh r0, [r1] + bl reset_temp_tile_data_buffers + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0832C064 + movs r0, 0 + movs r2, 0x2 + bl InitBgsFromTemplates + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x1 + movs r1, 0x7 + movs r2, 0x2 + bl SetBgAttribute + movs r0, 0x80 + lsls r0, 5 + bl Alloc + adds r1, r0, 0 + movs r0, 0x1 + bl SetBgTilemapBuffer + movs r0, 0x80 + lsls r0, 6 + bl Alloc + adds r1, r0, 0 + movs r0, 0 + bl SetBgTilemapBuffer + bl DeactivateAllTextPrinters + bl sub_80A1A74 + bl ResetObjectPaletteAllocator + bl ResetAllObjectData + bl clear_tasks + bl remove_some_task + bl SoundVSyncOn_rev01 + b _080719A6 + .pool +_080718B8: + ldr r0, =gUnknown_0832C06C + bl InitWindows + ldr r0, =0x03000de0 + ldr r1, [r0] + movs r0, 0 + strb r0, [r1, 0x8] + b _080719A6 + .pool +_080718D0: + ldr r1, =gUnknown_08C00000 + movs r0, 0 + str r0, [sp] + movs r2, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, =gUnknown_08C00524 + movs r0, 0 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + ldr r0, =gUnknown_08C004E0 + movs r1, 0 + movs r2, 0x20 + bl decompress_palette + b _080719A6 + .pool +_08071904: + ldr r0, =gUnknown_0832BFE4 + bl LoadObjectPic + ldr r0, =gUnknown_0832BFEC + bl LoadObjectPic + ldr r0, =gUnknown_0832BFF4 + bl LoadTaggedObjectPalette + b _080719A6 + .pool +_08071924: + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldr r0, =0x03000de0 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + bl sub_80714B8 + b _080719A6 + .pool +_0807193C: + ldr r0, =0x03000de0 + ldr r3, [r0] + ldrb r2, [r3, 0x4] + adds r3, 0xC + movs r0, 0 + movs r1, 0 + bl sub_807163C + b _080719A6 + .pool +_08071954: + ldr r4, =0x03000de0 + ldr r3, [r4] + ldrb r2, [r3, 0x4] + adds r3, 0xC + movs r0, 0 + movs r1, 0x1 + bl sub_807163C + ldr r1, [r4] + strb r0, [r1, 0x1] + b _080719A6 + .pool +_08071970: + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + ldr r0, =gUnknown_08DD7300 + movs r1, 0x10 + movs r2, 0xA0 + bl gpu_pal_apply + ldr r1, =gUnknown_08DD7360 + movs r2, 0xA1 + lsls r2, 5 + movs r0, 0x1 + movs r3, 0 + bl LoadBgTiles + ldr r1, =gUnknown_08331F60 + movs r2, 0x80 + lsls r2, 5 + movs r0, 0x1 + movs r3, 0 + bl CopyToBgTilemapBuffer + movs r0, 0x1 + bl CopyBgTilemapBufferToVram +_080719A6: + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080719D6 + .pool +_080719C8: + ldr r0, =sub_8071A94 + bl SetMainCallback2 + ldr r0, =0x03000de0 + ldr r1, [r0] + movs r0, 0 + strb r0, [r1, 0x2] +_080719D6: + bl RunActiveTasks + bl RunTextPrinters + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end c1_hatching_egg + + thumb_func_start sub_80719FC +sub_80719FC: @ 80719FC + push {lr} + ldr r0, =0x020375e0 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldr r2, =0x02021ec4 + movs r1, 0x2 + bl pokemon_setattr + bl sub_805F094 + ldr r0, =0x03000de0 + ldr r0, [r0] + bl Free + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80719FC + + thumb_func_start c3_080472E4 +c3_080472E4: @ 8071A3C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08071A5C + bl sub_80A2F30 + bl play_some_sound +_08071A5C: + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _08071A6C + movs r0, 0xBC + lsls r0, 1 + bl song_play_for_text +_08071A6C: + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x3C + ble _08071A80 + ldr r0, =0x00000179 + bl song_play_for_text + adds r0, r5, 0 + bl remove_task +_08071A80: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end c3_080472E4 + + thumb_func_start sub_8071A94 +sub_8071A94: @ 8071A94 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + ldr r1, =0x03000de0 + ldr r0, [r1] + ldrb r0, [r0, 0x2] + adds r5, r1, 0 + cmp r0, 0xC + bls _08071AAC + b _08071E06 +_08071AAC: + lsls r0, 2 + ldr r1, =_08071AC0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08071AC0: + .4byte _08071AF4 + .4byte _08071B40 + .4byte _08071B68 + .4byte _08071BA0 + .4byte _08071BF8 + .4byte _08071C24 + .4byte _08071C88 + .4byte _08071C96 + .4byte _08071CA4 + .4byte _08071CE8 + .4byte _08071D1C + .4byte _08071DB4 + .4byte _08071DD4 +_08071AF4: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r0, =gUnknown_0832BFFC + movs r1, 0x78 + movs r2, 0x4B + movs r3, 0x5 + bl AddObjectToFront + ldr r4, =0x03000de0 + ldr r1, [r4] + strb r0, [r1] + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + ldr r1, [r4] + ldrb r0, [r1, 0x2] + adds r0, 0x1 + strb r0, [r1, 0x2] + ldr r0, =c3_080472E4 + movs r1, 0x5 + bl AddTask + b _08071E06 + .pool +_08071B40: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _08071B52 + b _08071E06 +_08071B52: + ldr r0, [r5] + ldrb r0, [r0, 0x8] + movs r1, 0 + bl FillWindowPixelBuffer + ldr r0, [r5] + strb r4, [r0, 0x3] + ldr r1, [r5] + b _08071DC8 + .pool +_08071B68: + ldr r1, [r5] + ldrb r0, [r1, 0x3] + adds r0, 0x1 + strb r0, [r1, 0x3] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1E + bhi _08071B7A + b _08071E06 +_08071B7A: + ldr r1, [r5] + ldrb r0, [r1, 0x2] + adds r0, 0x1 + strb r0, [r1, 0x2] + ldr r2, =0x02020630 + ldr r0, [r5] + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_8071E34 + str r1, [r0] + b _08071E06 + .pool +_08071BA0: + ldr r4, =0x02020630 + ldr r2, [r5] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + beq _08071BBC + b _08071E06 +_08071BBC: + ldrb r1, [r2, 0x4] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, [r5] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r1, r7, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_806ED40 + ldr r1, [r5] + b _08071DC8 + .pool +_08071BF8: + ldr r2, =0x02020630 + ldr r3, [r5] + ldrb r1, [r3, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + beq _08071C12 + b _08071E06 +_08071C12: + ldrb r0, [r3, 0x2] + adds r0, 0x1 + strb r0, [r3, 0x2] + b _08071E06 + .pool +_08071C24: + ldr r0, [r5] + ldrb r1, [r0, 0x4] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02021cc4 + bl pokemon_get_nick + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085ED5A5 + adds r0, r4, 0 + bl ExpandStringRefs + ldr r0, [r5] + ldrb r0, [r0, 0x8] + movs r1, 0xFF + str r1, [sp] + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x3 + bl sub_8072214 + ldr r0, =0x00000173 + bl fanfare_play + ldr r1, [r5] + ldrb r0, [r1, 0x2] + adds r0, 0x1 + strb r0, [r1, 0x2] + ldr r0, [r5] + ldrb r0, [r0, 0x8] + bl PutWindowTilemap + ldr r0, [r5] + ldrb r0, [r0, 0x8] + movs r1, 0x3 + bl CopyWindowToVram + b _08071E06 + .pool +_08071C88: + bl task_is_not_running_overworld_fanfare + lsls r0, 24 + cmp r0, 0 + bne _08071C94 + b _08071E06 +_08071C94: + b _08071DC4 +_08071C96: + bl task_is_not_running_overworld_fanfare + lsls r0, 24 + cmp r0, 0 + bne _08071CA2 + b _08071E06 +_08071CA2: + b _08071DC4 +_08071CA4: + ldr r0, [r5] + ldrb r1, [r0, 0x4] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02021cc4 + bl pokemon_get_nick + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085ED5BE + adds r0, r4, 0 + bl ExpandStringRefs + ldr r0, [r5] + ldrb r0, [r0, 0x8] + movs r1, 0x1 + str r1, [sp] + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x2 + bl sub_8072214 + ldr r1, [r5] + b _08071DC8 + .pool +_08071CE8: + ldr r0, [r5] + ldrb r0, [r0, 0x8] + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + beq _08071CF8 + b _08071E06 +_08071CF8: + ldr r0, [r5] + ldrb r0, [r0, 0x8] + movs r4, 0xA0 + lsls r4, 1 + adds r1, r4, 0 + movs r2, 0xE0 + bl sub_809882C + ldr r0, =gUnknown_0832C07C + adds r1, r4, 0 + movs r2, 0xE + movs r3, 0 + bl CreateYesNoMenu + ldr r1, [r5] + b _08071DC8 + .pool +_08071D1C: + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _08071D3C + cmp r1, 0 + bgt _08071D36 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08071DC4 + b _08071E06 +_08071D36: + cmp r1, 0x1 + beq _08071DC4 + b _08071E06 +_08071D3C: + ldr r0, =0x03000de0 + mov r8, r0 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x020244ec + adds r0, r5 + ldr r1, =0x02021ec4 + mov r9, r1 + bl pokemon_get_nick + mov r1, r8 + ldr r0, [r1] + ldrb r0, [r0, 0x4] + muls r0, r6 + adds r0, r5 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r7, r0, 16 + mov r1, r8 + ldr r0, [r1] + ldrb r0, [r0, 0x4] + muls r0, r6 + adds r0, r5 + bl pokemon_get_gender + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + mov r1, r8 + ldr r0, [r1] + ldrb r0, [r0, 0x4] + muls r0, r6 + adds r0, r5 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + str r0, [sp] + ldr r0, =sub_80719FC + str r0, [sp, 0x4] + movs r0, 0x3 + mov r1, r9 + adds r2, r7, 0 + adds r3, r4, 0 + bl do_choose_name_or_words_screen + b _08071E06 + .pool +_08071DB4: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe +_08071DC4: + ldr r0, =0x03000de0 + ldr r1, [r0] +_08071DC8: + ldrb r0, [r1, 0x2] + adds r0, 0x1 + strb r0, [r1, 0x2] + b _08071E06 + .pool +_08071DD4: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08071E06 + bl sub_805F094 + ldr r4, =0x03000de0 + ldr r0, [r4] + ldrb r0, [r0, 0x8] + bl RemoveWindow + movs r0, 0 + bl UnsetBgTilemapBuffer + movs r0, 0x1 + bl UnsetBgTilemapBuffer + ldr r0, [r4] + bl Free + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 +_08071E06: + bl RunActiveTasks + bl RunTextPrinters + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8071A94 + + thumb_func_start sub_8071E34 +sub_8071E34: @ 8071E34 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _08071E54 + ldr r0, =sub_8071E8C + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x2E] + b _08071E84 + .pool +_08071E54: + ldrh r0, [r4, 0x30] + adds r0, 0x14 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x30] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x1 + bl sine + strh r0, [r4, 0x24] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0xF + bne _08071E84 + movs r0, 0x17 + bl audio_play + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectImageAnim + bl sub_8072140 +_08071E84: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8071E34 + + thumb_func_start sub_8071E8C +sub_8071E8C: @ 8071E8C + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1E + ble _08071EE8 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _08071EBC + ldr r0, =sub_8071EF0 + str r0, [r4, 0x1C] + strh r1, [r4, 0x2E] + strh r1, [r4, 0x32] + b _08071EE8 + .pool +_08071EBC: + ldrh r0, [r4, 0x30] + adds r0, 0x14 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x30] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x2 + bl sine + strh r0, [r4, 0x24] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0xF + bne _08071EE8 + movs r0, 0x17 + bl audio_play + adds r0, r4, 0 + movs r1, 0x2 + bl StartObjectImageAnim +_08071EE8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8071E8C + + thumb_func_start sub_8071EF0 +sub_8071EF0: @ 8071EF0 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + movs r5, 0 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1E + ble _08071F9E + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x26 + ble _08071F5C + ldr r0, =sub_8071FA4 + str r0, [r4, 0x1C] + strh r5, [r4, 0x2E] + ldr r4, =0x03000de0 + ldr r0, [r4] + ldrb r1, [r0, 0x4] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + ldr r3, =0x02020630 + ldr r2, [r4] + ldrb r1, [r2, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r5, [r0, 0x24] + ldrb r1, [r2, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r5, [r0, 0x26] + b _08071F9E + .pool +_08071F5C: + ldrh r0, [r4, 0x30] + adds r0, 0x14 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x30] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x2 + bl sine + strh r0, [r4, 0x24] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0xF + bne _08071F90 + movs r0, 0x17 + bl audio_play + adds r0, r4, 0 + movs r1, 0x2 + bl StartObjectImageAnim + bl sub_8072140 + bl sub_8072140 +_08071F90: + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1E + bne _08071F9E + movs r0, 0x17 + bl audio_play +_08071F9E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8071EF0 + + thumb_func_start sub_8071FA4 +sub_8071FA4: @ 8071FA4 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x32 + ble _08071FBE + ldr r0, =sub_8071FC8 + str r0, [r1, 0x1C] + movs r0, 0 + strh r0, [r1, 0x2E] +_08071FBE: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8071FA4 + + thumb_func_start sub_8071FC8 +sub_8071FC8: @ 8071FC8 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _08071FE8 + movs r1, 0x1 + negs r1, r1 + ldr r0, =0x0000ffff + str r0, [sp] + adds r0, r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe +_08071FE8: + ldrh r0, [r5, 0x2E] + cmp r0, 0x3 + bhi _08072004 + movs r4, 0 +_08071FF0: + bl sub_8072140 + lsls r0, r4, 16 + movs r1, 0x80 + lsls r1, 9 + adds r0, r1 + lsrs r4, r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _08071FF0 +_08072004: + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _08072032 + movs r0, 0x71 + bl audio_play + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =sub_8072048 + str r0, [r5, 0x1C] + strh r4, [r5, 0x2E] +_08072032: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8071FC8 + + thumb_func_start sub_8072048 +sub_8072048: @ 8072048 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _08072084 + ldr r4, =0x02020630 + ldr r3, =0x03000de0 + ldr r0, [r3] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + ldr r0, [r3] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl StartObjectRotScalAnim +_08072084: + movs r2, 0x2E + ldrsh r0, [r5, r2] + cmp r0, 0x8 + bne _0807209E + movs r1, 0x1 + negs r1, r1 + ldr r0, =0x0000ffff + str r0, [sp] + adds r0, r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe +_0807209E: + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0x9 + bgt _080720BC + ldr r2, =0x02020630 + ldr r0, =0x03000de0 + ldr r0, [r0] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x22] + subs r1, 0x1 + strh r1, [r0, 0x22] +_080720BC: + ldrh r1, [r5, 0x2E] + movs r2, 0x2E + ldrsh r0, [r5, r2] + cmp r0, 0x28 + ble _080720CA + ldr r0, =DummyObjectCallback + str r0, [r5, 0x1C] +_080720CA: + adds r0, r1, 0x1 + strh r0, [r5, 0x2E] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8072048 + + thumb_func_start sub_80720E8 +sub_80720E8: @ 80720E8 + push {r4,lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x30] + ldrh r1, [r2, 0x36] + adds r0, r1 + strh r0, [r2, 0x36] + ldrh r1, [r2, 0x32] + ldrh r3, [r2, 0x38] + adds r0, r1, r3 + strh r0, [r2, 0x38] + movs r4, 0x36 + ldrsh r0, [r2, r4] + cmp r0, 0 + bge _08072106 + adds r0, 0xFF +_08072106: + asrs r0, 8 + strh r0, [r2, 0x24] + movs r3, 0x38 + ldrsh r0, [r2, r3] + cmp r0, 0 + bge _08072114 + adds r0, 0xFF +_08072114: + asrs r0, 8 + strh r0, [r2, 0x26] + ldrh r0, [r2, 0x34] + adds r3, r1, r0 + strh r3, [r2, 0x32] + movs r4, 0x22 + ldrsh r1, [r2, r4] + movs r4, 0x26 + ldrsh r0, [r2, r4] + adds r0, r1, r0 + adds r1, 0x14 + cmp r0, r1 + ble _0807213A + lsls r0, r3, 16 + cmp r0, 0 + ble _0807213A + adds r0, r2, 0 + bl RemoveObjectAndFreeTiles +_0807213A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80720E8 + + thumb_func_start sub_8072140 +sub_8072140: @ 8072140 + push {r4-r6,lr} + sub sp, 0x8 + ldr r2, =gUnknown_0832C084 + ldr r0, =0x03000de0 + ldr r6, [r0] + ldrb r3, [r6, 0x7] + lsls r0, r3, 2 + adds r1, r0, r2 + ldrh r5, [r1] + adds r2, 0x2 + adds r0, r2 + ldrh r4, [r0] + adds r3, 0x1 + strb r3, [r6, 0x7] + bl GenerateRandomNumber + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + lsls r5, 16 + asrs r5, 16 + lsls r4, 16 + asrs r4, 16 + movs r0, 0x64 + str r0, [sp] + lsrs r1, 16 + str r1, [sp, 0x4] + movs r0, 0x78 + movs r1, 0x3C + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_8072194 + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8072140 + + thumb_func_start sub_8072194 +sub_8072194: @ 8072194 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + mov r8, r3 + ldr r0, [sp, 0x1C] + mov r9, r0 + ldr r1, [sp, 0x20] + mov r10, r1 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 16 + lsrs r6, 16 + mov r0, r8 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + mov r1, r9 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + mov r0, r10 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r0, =gUnknown_0832C04C + adds r1, r4, 0 + adds r2, r5, 0 + movs r3, 0x4 + bl AddObjectToFront + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =0x02020630 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r6, [r0, 0x30] + mov r1, r8 + strh r1, [r0, 0x32] + mov r1, r9 + strh r1, [r0, 0x34] + mov r1, r10 + bl StartObjectImageAnim + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8072194 + + thumb_func_start sub_8072214 +sub_8072214: @ 8072214 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x14 + adds r5, r0, 0 + mov r9, r1 + adds r6, r2, 0 + mov r8, r3 + ldr r4, [sp, 0x2C] + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0xFF + bl FillWindowPixelBuffer + ldr r3, =0x03000de0 + ldr r0, [r3] + movs r2, 0 + strb r2, [r0, 0xE] + ldr r1, [r3] + movs r0, 0x5 + strb r0, [r1, 0xF] + ldr r1, [r3] + movs r0, 0x6 + strb r0, [r1, 0x10] + str r2, [sp] + str r2, [sp, 0x4] + ldr r0, [r3] + adds r0, 0xE + str r0, [sp, 0x8] + lsls r4, 24 + asrs r4, 24 + str r4, [sp, 0xC] + mov r0, r9 + str r0, [sp, 0x10] + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r6, 0 + mov r3, r8 + bl AddTextPrinterParametrized2 + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8072214 + + thumb_func_start sub_807228C +sub_807228C: @ 807228C + push {r4-r6,lr} + bl calc_player_party_count + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + cmp r5, r6 + bcs _080722D6 +_0807229C: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x6 + bl pokemon_getattr + cmp r0, 0 + bne _080722CC + adds r0, r4, 0 + bl GetMonAbility + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x28 + beq _080722C4 + cmp r0, 0x31 + bne _080722CC +_080722C4: + movs r0, 0x2 + b _080722D8 + .pool +_080722CC: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r6 + bcc _0807229C +_080722D6: + movs r0, 0x1 +_080722D8: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_807228C + + thumb_func_start sub_80722E0 +sub_80722E0: @ 80722E0 + push {r4,lr} + bl sub_80D22D0 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0x6 + bl sub_80C7050 + lsls r0, 24 + lsrs r0, 24 + adds r4, r0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80722E0 + + thumb_func_start sub_8072304 +sub_8072304: @ 8072304 + movs r0, 0x9 + bx lr + thumb_func_end sub_8072304 + + thumb_func_start sub_8072308 +sub_8072308: @ 8072308 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r7, r1, 0 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + movs r3, 0 + movs r2, 0 +_08072324: + lsls r0, r3, 24 + asrs r0, 24 + mov r3, sp + adds r1, r3, r0 + strb r2, [r1] + adds r0, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + asrs r0, 24 + cmp r0, 0x3 + ble _08072324 + movs r3, 0x3 + movs r0, 0x1 + negs r0, r0 + mov r9, r0 + mov r8, sp +_08072344: + lsls r0, r5, 16 + asrs r6, r0, 16 + cmp r6, 0 + ble _08072372 + lsls r4, r3, 24 + asrs r4, 24 + mov r1, sp + adds r5, r1, r4 + adds r0, r6, 0 + movs r1, 0xA + bl __modsi3 + strb r0, [r5] + adds r0, r6, 0 + movs r1, 0xA + bl __divsi3 + lsls r0, 16 + lsrs r5, r0, 16 + subs r4, 0x1 + lsls r4, 24 + lsrs r3, r4, 24 + b _08072344 +_08072372: + lsls r1, r3, 24 + asrs r0, r1, 24 + cmp r0, r9 + ble _08072396 + movs r4, 0xFF + movs r3, 0x1 + negs r3, r3 +_08072380: + asrs r2, r1, 24 + mov r5, sp + adds r1, r5, r2 + ldrb r0, [r1] + orrs r0, r4 + strb r0, [r1] + subs r2, 0x1 + lsls r1, r2, 24 + asrs r0, r1, 24 + cmp r0, r3 + bgt _08072380 +_08072396: + mov r1, r8 + ldrb r0, [r1, 0x3] + cmp r0, 0xFF + bne _080723A2 + movs r0, 0 + strb r0, [r1, 0x3] +_080723A2: + mov r2, r10 + cmp r2, 0 + bne _08072432 + movs r3, 0 + movs r1, 0 + movs r6, 0xFC + lsls r6, 8 + movs r5, 0x1E + mov r12, r5 +_080723B4: + lsls r1, 24 + asrs r2, r1, 24 + mov r0, sp + adds r5, r0, r2 + ldrb r0, [r5] + mov r8, r1 + cmp r0, 0xFF + bne _080723EA + lsls r1, r2, 1 + adds r1, r7 + ldrh r2, [r1] + adds r0, r6, 0 + ands r0, r2 + mov r2, r12 + orrs r0, r2 + strh r0, [r1] + lsls r3, 24 + asrs r1, r3, 23 + adds r1, r7 + adds r1, 0x40 + ldrh r2, [r1] + adds r0, r6, 0 + ands r0, r2 + mov r5, r12 + orrs r0, r5 + strh r0, [r1] + b _0807241A +_080723EA: + lsls r2, 1 + adds r2, r7 + ldrh r0, [r2] + adds r1, r6, 0 + ands r1, r0 + ldrb r0, [r5] + adds r0, 0x14 + orrs r1, r0 + strh r1, [r2] + lsls r4, r3, 24 + asrs r3, r4, 24 + lsls r2, r3, 1 + adds r2, r7 + adds r2, 0x40 + ldrh r0, [r2] + adds r1, r6, 0 + ands r1, r0 + mov r5, sp + adds r0, r5, r3 + ldrb r0, [r0] + adds r0, 0x34 + orrs r1, r0 + strh r1, [r2] + adds r3, r4, 0 +_0807241A: + movs r0, 0x80 + lsls r0, 17 + add r0, r8 + lsrs r1, r0, 24 + movs r2, 0x80 + lsls r2, 17 + adds r0, r3, r2 + lsrs r3, r0, 24 + asrs r0, 24 + cmp r0, 0x3 + ble _080723B4 + b _08072496 +_08072432: + movs r3, 0 + movs r4, 0xFC + lsls r4, 8 + movs r6, 0x1E +_0807243A: + lsls r1, r3, 24 + asrs r2, r1, 24 + mov r3, sp + adds r5, r3, r2 + ldrb r0, [r5] + adds r3, r1, 0 + cmp r0, 0xFF + bne _08072466 + lsls r1, r2, 1 + adds r1, r7 + ldrh r2, [r1] + adds r0, r4, 0 + ands r0, r2 + orrs r0, r6 + strh r0, [r1] + adds r1, 0x40 + ldrh r2, [r1] + adds r0, r4, 0 + ands r0, r2 + orrs r0, r6 + strh r0, [r1] + b _08072488 +_08072466: + lsls r2, 1 + adds r2, r7 + ldrh r0, [r2] + adds r1, r4, 0 + ands r1, r0 + ldrb r0, [r5] + adds r0, 0x14 + orrs r1, r0 + strh r1, [r2] + adds r2, 0x40 + ldrh r0, [r2] + adds r1, r4, 0 + ands r1, r0 + ldrb r0, [r5] + adds r0, 0x34 + orrs r1, r0 + strh r1, [r2] +_08072488: + movs r5, 0x80 + lsls r5, 17 + adds r0, r3, r5 + lsrs r3, r0, 24 + asrs r0, 24 + cmp r0, 0x3 + ble _0807243A +_08072496: + 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_8072308 + + thumb_func_start sub_80724A8 +sub_80724A8: @ 80724A8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r0, r1, 0 + adds r5, r2, 0 + lsls r4, 16 + lsrs r4, 16 + movs r1, 0x1E + strh r1, [r5, 0x8] + lsls r0, 16 + asrs r0, 16 + adds r1, r5, 0 + movs r2, 0 + bl sub_8072308 + lsls r4, 16 + asrs r4, 16 + adds r5, 0xA + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_8072308 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80724A8 + + thumb_func_start battle_make_oam_normal_battle +battle_make_oam_normal_battle: @ 80724DC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + movs r0, 0 + str r0, [sp] + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _080725F0 + mov r0, r10 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08072574 + ldr r4, =gUnknown_0832C140 + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0xA0 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0xA0 + movs r3, 0x1 + bl AddObjectToBack + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, =0x02020630 + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r1, r4 + ldrb r2, [r1, 0x1] + movs r3, 0x3F + adds r0, r3, 0 + ands r0, r2 + strb r0, [r1, 0x1] + lsls r2, r7, 4 + adds r2, r7 + lsls r2, 2 + adds r2, r4 + ldrb r0, [r2, 0x1] + ands r3, r0 + strb r3, [r2, 0x1] + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x40 + ldr r4, =0x000003ff + adds r0, r4, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r3 + orrs r0, r1 + strh r0, [r2, 0x4] + b _080725BA + .pool +_08072574: + ldr r4, =gUnknown_0832C170 + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0xA0 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0xA0 + movs r3, 0x1 + bl AddObjectToBack + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x02020630 + lsls r2, r7, 4 + adds r2, r7 + lsls r2, 2 + adds r2, r0 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x20 + ldr r5, =0x000003ff + adds r0, r5, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r3 + orrs r0, r1 + strh r0, [r2, 0x4] + movs r0, 0x2 + str r0, [sp] +_080725BA: + ldr r2, =0x02020630 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r0, r2 + strh r7, [r0, 0x6] + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r1, r0, r2 + strh r6, [r1, 0x38] + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_8072924 + str r1, [r0] + b _08072718 + .pool +_080725F0: + mov r0, r10 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08072694 + mov r0, r10 + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 25 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + ldr r4, =gUnknown_0832C140 + adds r0, r4 + movs r1, 0xF0 + movs r2, 0xA0 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + mov r0, r10 + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 25 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r1, 0xF0 + movs r2, 0xA0 + movs r3, 0x1 + bl AddObjectToBack + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, =0x02020630 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r0, r4 + strh r7, [r0, 0x6] + lsls r2, r7, 4 + adds r2, r7 + lsls r2, 2 + adds r3, r2, r4 + strh r6, [r3, 0x38] + ldrh r1, [r3, 0x4] + mov r8, r1 + mov r5, r8 + lsls r1, r5, 22 + lsrs r1, 22 + adds r1, 0x20 + ldr r5, =0x000003ff + adds r0, r5, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + mov r5, r8 + ands r0, r5 + orrs r0, r1 + strh r0, [r3, 0x4] + adds r4, 0x1C + adds r2, r4 + ldr r0, =sub_8072924 + str r0, [r2] + movs r0, 0x1 + b _08072716 + .pool +_08072694: + mov r0, r10 + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 25 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + ldr r4, =gUnknown_0832C170 + adds r0, r4 + movs r1, 0xF0 + movs r2, 0xA0 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + mov r0, r10 + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 25 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r1, 0xF0 + movs r2, 0xA0 + movs r3, 0x1 + bl AddObjectToBack + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, =0x02020630 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r0, r4 + strh r7, [r0, 0x6] + lsls r2, r7, 4 + adds r2, r7 + lsls r2, 2 + adds r3, r2, r4 + strh r6, [r3, 0x38] + ldrh r1, [r3, 0x4] + mov r8, r1 + mov r5, r8 + lsls r1, r5, 22 + lsrs r1, 22 + adds r1, 0x20 + ldr r5, =0x000003ff + adds r0, r5, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + mov r5, r8 + ands r0, r5 + orrs r0, r1 + strh r0, [r3, 0x4] + adds r4, 0x1C + adds r2, r4 + ldr r0, =sub_8072924 + str r0, [r2] + movs r0, 0x2 +_08072716: + str r0, [sp] +_08072718: + ldr r0, =0x02024076 + add r0, r10 + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + ldr r1, =gUnknown_0832C1C0 + adds r0, r1 + movs r1, 0x8C + movs r2, 0x3C + movs r3, 0 + bl AddObjectToBack + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + ldr r1, =0x02020630 + mov r8, r1 + add r4, r8 + mov r0, r10 + bl battle_side_get_owner + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 21 + ldr r0, =gUnknown_0832C28C + adds r1, r0 + adds r0, r4, 0 + bl SetSpriteOamTables_NoPriorityFromTable + adds r2, r4, 0 + adds r2, 0x42 + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldrb r1, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r2, 0x4 + mov r9, r2 + mov r1, r9 + orrs r0, r1 + strb r0, [r4, 0x5] + movs r0, 0x1 + bl sub_80728A4 + ldrh r1, [r4, 0x4] + lsls r1, 22 + lsrs r1, 17 + ldr r2, =0x06010000 + adds r1, r2 + ldr r2, =0x04000010 + bl CpuSet + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + add r0, r8 + strh r5, [r0, 0x38] + mov r2, r10 + strh r2, [r0, 0x3A] + adds r0, 0x3E + ldrb r1, [r0] + mov r5, r9 + orrs r1, r5 + strb r1, [r0] + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + add r0, r8 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r5 + strb r1, [r0] + strh r6, [r4, 0x38] + mov r0, sp + ldrh r0, [r0] + strh r0, [r4, 0x3A] + adds r4, 0x3E + ldrb r0, [r4] + orrs r0, r5 + strb r0, [r4] + 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 + .pool + thumb_func_end battle_make_oam_normal_battle + + thumb_func_start battle_make_oam_safari_battle +battle_make_oam_safari_battle: @ 8072804 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r4, =gUnknown_0832C1A0 + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0xA0 + movs r3, 0x1 + bl AddObjectToFront + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0xA0 + movs r3, 0x1 + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02020630 + mov r9, r1 + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + add r4, r9 + ldrb r3, [r4, 0x1] + movs r2, 0x3F + adds r1, r2, 0 + ands r1, r3 + strb r1, [r4, 0x1] + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + mov r7, r9 + adds r5, r3, r7 + ldrb r1, [r5, 0x1] + ands r2, r1 + strb r2, [r5, 0x1] + ldrh r1, [r5, 0x4] + mov r8, r1 + mov r7, r8 + lsls r2, r7, 22 + lsrs r2, 22 + adds r2, 0x40 + ldr r7, =0x000003ff + adds r1, r7, 0 + ands r2, r1 + ldr r1, =0xfffffc00 + mov r7, r8 + ands r1, r7 + orrs r1, r2 + strh r1, [r5, 0x4] + strh r0, [r4, 0x6] + strh r6, [r5, 0x38] + movs r0, 0x1C + add r9, r0 + add r3, r9 + ldr r0, =sub_8072924 + str r0, [r3] + adds r0, r6, 0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end battle_make_oam_safari_battle + + thumb_func_start sub_80728A4 +sub_80728A4: @ 80728A4 + lsls r0, 24 + lsrs r0, 19 + ldr r1, =gUnknown_08C11BDC + adds r0, r1 + bx lr + .pool + thumb_func_end sub_80728A4 + + thumb_func_start sub_80728B4 +sub_80728B4: @ 80728B4 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x38] + lsls r0, 24 + lsrs r5, r0, 24 + movs r1, 0x3A + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080728E4 + cmp r0, 0x1 + bgt _080728F8 + cmp r0, 0 + bne _080728F8 + ldr r2, =0x02020630 + lsls r3, r5, 4 + adds r1, r3, r5 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1, 0x20] + adds r0, 0x10 + b _08072906 + .pool +_080728E4: + ldr r2, =0x02020630 + lsls r3, r5, 4 + adds r1, r3, r5 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1, 0x20] + adds r0, 0x10 + b _08072906 + .pool +_080728F8: + ldr r2, =0x02020630 + lsls r3, r5, 4 + adds r1, r3, r5 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1, 0x20] + adds r0, 0x8 +_08072906: + strh r0, [r4, 0x20] + ldrh r0, [r1, 0x22] + strh r0, [r4, 0x22] + adds r0, r3, r5 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x24] + strh r1, [r4, 0x24] + ldrh r0, [r0, 0x26] + strh r0, [r4, 0x26] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80728B4 + + thumb_func_start sub_8072924 +sub_8072924: @ 8072924 + ldrh r1, [r0, 0x38] + lsls r1, 24 + lsrs r1, 24 + ldr r3, =0x02020630 + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r3 + ldrh r1, [r2, 0x20] + adds r1, 0x40 + strh r1, [r0, 0x20] + ldrh r1, [r2, 0x22] + strh r1, [r0, 0x22] + ldrh r1, [r2, 0x24] + strh r1, [r0, 0x24] + ldrh r1, [r2, 0x26] + strh r1, [r0, 0x26] + bx lr + .pool + thumb_func_end sub_8072924 + + thumb_func_start sub_807294C +sub_807294C: @ 807294C + push {r4-r7,lr} + ldr r7, [sp, 0x14] + lsls r0, 24 + lsrs r0, 24 + ldr r6, =0x020244d0 + ldr r4, [r6] + ldr r5, [r4, 0xC] + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 2 + adds r5, r4, r5 + strb r1, [r5] + ldr r0, [r6] + ldr r0, [r0, 0xC] + adds r4, r0 + str r2, [r4, 0x4] + str r3, [r4, 0x8] + str r7, [r4, 0xC] + ldr r0, =0xffff8000 + str r0, [r4, 0x10] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807294C + + thumb_func_start sub_8072984 +sub_8072984: @ 8072984 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x02020630 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r4 + adds r1, r2, 0 + adds r1, 0x3E + ldrb r0, [r1] + movs r3, 0x4 + orrs r0, r3 + strb r0, [r1] + movs r0, 0x38 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r3 + strb r1, [r0] + ldrh r1, [r2, 0x6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r3 + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8072984 + + thumb_func_start sub_80729D0 +sub_80729D0: @ 80729D0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =0x02020630 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r5 + adds r4, r2, 0 + adds r4, 0x3E + ldrb r1, [r4] + movs r3, 0x5 + negs r3, r3 + adds r0, r3, 0 + ands r0, r1 + strb r0, [r4] + movs r0, 0x38 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r4, [r0] + adds r1, r3, 0 + ands r1, r4 + strb r1, [r0] + ldrh r1, [r2, 0x6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + ands r3, r1 + strb r3, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80729D0 + + thumb_func_start sub_8072A24 +sub_8072A24: @ 8072A24 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x02020630 + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + adds r3, r4 + strh r1, [r3, 0x20] + strh r2, [r3, 0x22] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8072A24 + + thumb_func_start sub_8072A44 +sub_8072A44: @ 8072A44 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =0x02020630 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + adds r4, r5 + ldrh r1, [r4, 0x6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl RemoveObjectAndFreeTiles + movs r0, 0x38 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl RemoveObjectAndFreeTiles + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8072A44 + + thumb_func_start nullsub_30 +nullsub_30: @ 8072A84 + bx lr + thumb_func_end nullsub_30 + + thumb_func_start sub_8072A88 +sub_8072A88: @ 8072A88 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + movs r6, 0 + ldr r1, =0x0202406c + mov r8, r1 + ldrb r2, [r1] + cmp r6, r2 + bge _08072B00 + ldr r1, =0x02020630 + mov r12, r1 + movs r1, 0x3 + ands r0, r1 + lsls r5, r0, 2 + movs r7, 0xD + negs r7, r7 + ldr r2, =0x03005d70 + mov r9, r2 +_08072AB2: + mov r1, r9 + adds r0, r6, r1 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r12 + ldrb r4, [r1, 0x6] + ldrh r3, [r1, 0x38] + lsls r3, 24 + lsrs r3, 24 + ldrb r2, [r1, 0x5] + adds r0, r7, 0 + ands r0, r2 + orrs r0, r5 + strb r0, [r1, 0x5] + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + add r1, r12 + ldrb r2, [r1, 0x5] + adds r0, r7, 0 + ands r0, r2 + orrs r0, r5 + strb r0, [r1, 0x5] + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + add r1, r12 + ldrb r2, [r1, 0x5] + adds r0, r7, 0 + ands r0, r2 + orrs r0, r5 + strb r0, [r1, 0x5] + adds r6, 0x1 + mov r2, r8 + ldrb r2, [r2] + cmp r6, r2 + blt _08072AB2 +_08072B00: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8072A88 + + thumb_func_start sub_8072B18 +sub_8072B18: @ 8072B18 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + movs r4, 0 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _08072B44 + adds r0, r6, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08072B3E + movs r5, 0x2C + movs r4, 0x1E + b _08072B7C +_08072B3E: + movs r5, 0x9E + movs r4, 0x58 + b _08072B7C +_08072B44: + adds r0, r6, 0 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08072B72 + cmp r0, 0x1 + bgt _08072B5C + cmp r0, 0 + beq _08072B66 + b _08072B7C +_08072B5C: + cmp r0, 0x2 + beq _08072B6C + cmp r0, 0x3 + beq _08072B78 + b _08072B7C +_08072B66: + movs r5, 0x9F + movs r4, 0x4C + b _08072B7C +_08072B6C: + movs r5, 0xAB + movs r4, 0x65 + b _08072B7C +_08072B72: + movs r5, 0x2C + movs r4, 0x13 + b _08072B7C +_08072B78: + movs r5, 0x20 + movs r4, 0x2C +_08072B7C: + ldr r0, =0x03005d70 + adds r0, r6, r0 + ldrb r0, [r0] + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_8072A24 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8072B18 + + thumb_func_start healthbar_draw_level +healthbar_draw_level: @ 8072B94 + push {r4,r5,lr} + sub sp, 0x18 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r1, 24 + add r2, sp, 0x4 + movs r0, 0xF9 + strb r0, [r2] + movs r0, 0x5 + strb r0, [r2, 0x1] + mov r0, sp + adds r0, 0x6 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + adds r1, r0, 0 + subs r1, 0x2 + add r0, sp, 0x4 + subs r1, r0 + movs r0, 0x3 + subs r0, r1 + lsls r1, r0, 2 + adds r1, r0 + add r0, sp, 0x14 + str r0, [sp] + add r0, sp, 0x4 + movs r2, 0x3 + movs r3, 0x2 + bl write_to_rbox + adds r5, r0, 0 + ldr r0, =0x02020630 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x4] + lsls r0, 22 + lsrs r4, r0, 17 + ldrh r0, [r1, 0x3A] + lsls r0, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08072C18 + bl battle_type_is_double + lsls r0, 24 + ldr r2, =0x06010420 + adds r1, r4, r2 + cmp r0, 0 + bne _08072C1C + ldr r0, =0x06010820 + adds r1, r4, r0 + b _08072C1C + .pool +_08072C18: + ldr r2, =0x06010400 + adds r1, r4, r2 +_08072C1C: + adds r0, r1, 0 + adds r1, r5, 0 + movs r2, 0x3 + bl sub_8075198 + ldr r0, [sp, 0x14] + bl sub_807512C + add sp, 0x18 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end healthbar_draw_level + + thumb_func_start heathbar_draw_hp +heathbar_draw_hp: @ 8072C38 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + ldr r1, =0x02020630 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r4, r0, r1 + ldrh r0, [r4, 0x3A] + lsls r0, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08072D10 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _08072D10 + ldrh r0, [r4, 0x4] + lsls r0, 22 + lsrs r5, r0, 17 + mov r0, r8 + cmp r0, 0 + beq _08072CB8 + mov r2, r9 + lsls r1, r2, 16 + asrs r1, 16 + add r0, sp, 0x4 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + add r0, sp, 0x24 + str r0, [sp] + add r0, sp, 0x4 + movs r1, 0 + movs r2, 0x5 + movs r3, 0x2 + bl write_to_rbox + adds r4, r0, 0 + ldr r1, =0x06010b40 + adds r0, r5, r1 + adds r1, r4, 0 + b _08072CF8 + .pool +_08072CB8: + mov r2, r9 + lsls r1, r2, 16 + asrs r1, 16 + add r0, sp, 0x4 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + add r1, sp, 0x4 + movs r0, 0xBA + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + add r0, sp, 0x24 + str r0, [sp] + adds r0, r1, 0 + movs r1, 0x4 + movs r2, 0x5 + movs r3, 0x2 + bl write_to_rbox + adds r4, r0, 0 + ldr r1, =0x060103e0 + adds r0, r5, r1 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_8075170 + ldr r2, =0x06010b00 + adds r0, r5, r2 + adds r1, r4, 0 + adds r1, 0x20 +_08072CF8: + movs r2, 0x2 + bl sub_8075170 + ldr r0, [sp, 0x24] + bl sub_807512C + b _08072DEA + .pool +_08072D10: + ldr r1, =gUnknown_0832C3C4 + add r0, sp, 0x4 + movs r2, 0x14 + bl memcpy + ldr r1, =0x02020630 + lsls r4, r7, 4 + adds r0, r4, r7 + lsls r0, 2 + adds r6, r0, r1 + ldrh r0, [r6, 0x3A] + lsls r0, 24 + lsrs r5, r0, 24 + bl battle_type_is_double + lsls r0, 24 + lsrs r0, 24 + mov r10, r4 + cmp r0, 0x1 + beq _08072D46 + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08072D60 +_08072D46: + mov r0, r9 + lsls r1, r0, 16 + asrs r1, 16 + adds r0, r7, 0 + mov r2, r8 + bl sub_8072E0C + b _08072DEA + .pool +_08072D60: + ldrh r0, [r6, 0x3A] + lsls r0, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08072D7C + movs r6, 0x59 + mov r1, r8 + cmp r1, 0 + bne _08072D86 + movs r6, 0x1D + b _08072D86 +_08072D7C: + movs r6, 0x30 + mov r2, r8 + cmp r2, 0 + bne _08072D86 + movs r6, 0x14 +_08072D86: + mov r0, sp + adds r0, 0xA + mov r2, r9 + lsls r1, r2, 16 + asrs r1, 16 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r0, =0x020244d4 + ldr r0, [r0] + movs r1, 0xBA + lsls r1, 1 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x9 + add r2, sp, 0x4 + bl RenderTextFont9 + movs r4, 0 + ldr r1, =0x02020630 + mov r2, r10 + adds r0, r2, r7 + lsls r0, 2 + adds r5, r0, r1 +_08072DB8: + ldr r0, =0x020244d4 + ldr r0, [r0] + movs r1, 0xBA + lsls r1, 1 + adds r0, r1 + lsls r1, r4, 6 + adds r1, 0x20 + ldr r0, [r0] + adds r0, r1 + ldrh r1, [r5, 0x4] + lsls r1, 22 + lsrs r1, 22 + adds r1, r6 + adds r1, r4 + lsls r1, 5 + ldr r2, =0x06010000 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _08072DB8 +_08072DEA: + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end heathbar_draw_hp + + thumb_func_start sub_8072E0C +sub_8072E0C: @ 8072E0C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x30 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r1, 16 + lsrs r4, r1, 16 + mov r10, r4 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + ldr r5, =0x02020630 + lsls r0, 4 + add r0, r9 + lsls r0, 2 + adds r7, r0, r5 + ldrh r0, [r7, 0x3A] + lsls r0, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08072F28 + ldr r0, =0x020244d0 + ldr r1, [r0] + movs r2, 0x3A + ldrsh r0, [r7, r2] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _08072E5E + b _080730B8 +_08072E5E: + movs r3, 0x38 + ldrsh r1, [r7, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrh r0, [r0, 0x4] + lsls r0, 22 + lsrs r5, r0, 17 + ldr r0, =0x06010000 + adds r6, r5, r0 + mov r0, r8 + cmp r0, 0 + beq _08072EDC + lsls r1, r4, 16 + asrs r1, 16 + add r0, sp, 0x4 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + add r0, sp, 0x28 + str r0, [sp] + add r0, sp, 0x4 + movs r1, 0 + movs r2, 0x5 + movs r3, 0 + bl write_to_rbox + adds r4, r0, 0 + ldr r1, =0x060100c0 + adds r0, r5, r1 + adds r1, r4, 0 + movs r2, 0x2 + bl sub_8075170 + ldr r0, [sp, 0x28] + bl sub_807512C + movs r0, 0x74 + bl sub_80728A4 + ldrh r1, [r7, 0x4] + lsls r1, 22 + lsrs r1, 17 + ldr r2, =0x06010680 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet + b _080730B8 + .pool +_08072EDC: + lsls r1, r4, 16 + asrs r1, 16 + add r0, sp, 0x4 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + add r1, sp, 0x4 + movs r0, 0xBA + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + add r0, sp, 0x28 + str r0, [sp] + adds r0, r1, 0 + movs r1, 0x4 + movs r2, 0x5 + movs r3, 0 + bl write_to_rbox + adds r4, r0, 0 + adds r0, r6, 0 + movs r1, 0 + movs r2, 0x3 + bl sub_807513C + ldr r3, =0x06010060 + adds r0, r5, r3 + adds r1, r4, 0 + movs r2, 0x3 + bl sub_8075170 + ldr r0, [sp, 0x28] + bl sub_807512C + b _080730B8 + .pool +_08072F28: + ldr r1, =gUnknown_0832C3D8 + add r0, sp, 0x4 + movs r2, 0x14 + bl memcpy + ldrh r0, [r7, 0x3A] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x2C] + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0] + ldr r2, [sp, 0x2C] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _08072F52 + b _080730B8 +_08072F52: + movs r6, 0x4 + mov r3, r8 + negs r0, r3 + orrs r0, r3 + asrs r0, 31 + ands r6, r0 + ldrh r0, [r7, 0x38] + lsls r0, 24 + lsrs r7, r0, 24 + mov r0, sp + adds r0, 0xA + mov r2, r10 + lsls r1, r2, 16 + asrs r1, 16 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + mov r3, r8 + cmp r3, 0 + bne _08072F82 + ldr r1, =gUnknown_085E8D3E + bl CopyString +_08072F82: + ldr r0, =0x020244d4 + ldr r0, [r0] + movs r1, 0xBA + lsls r1, 1 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x9 + add r2, sp, 0x4 + bl RenderTextFont9 + adds r4, r6, 0 + adds r0, r4, 0x3 + cmp r4, r0 + bge _08073024 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r5, r0, r5 +_08072FA6: + cmp r4, 0x2 + bhi _08072FF0 + ldr r0, =0x020244d4 + ldr r0, [r0] + movs r2, 0xBA + lsls r2, 1 + adds r0, r2 + subs r1, r4, r6 + lsls r1, 6 + adds r1, 0x20 + ldr r0, [r0] + adds r0, r1 + ldrh r1, [r5, 0x4] + lsls r1, 22 + lsrs r1, 22 + adds r4, 0x1 + adds r1, r4 + lsls r1, 5 + ldr r3, =0x06010000 + adds r1, r3 + ldr r2, =0x04000008 + bl CpuSet + b _0807301A + .pool +_08072FF0: + ldr r0, =0x020244d4 + ldr r0, [r0] + movs r1, 0xBA + lsls r1, 1 + adds r0, r1 + subs r1, r4, r6 + lsls r1, 6 + adds r1, 0x20 + ldr r0, [r0] + adds r0, r1 + ldrh r1, [r5, 0x4] + lsls r1, 22 + lsrs r1, 22 + adds r1, r4, r1 + lsls r1, 5 + ldr r2, =0x06010020 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet + adds r4, 0x1 +_0807301A: + lsls r0, r4, 24 + lsrs r4, r0, 24 + adds r0, r6, 0x3 + cmp r4, r0 + blt _08072FA6 +_08073024: + mov r3, r8 + cmp r3, 0 + bne _08073084 + ldr r0, =0x020244d4 + ldr r0, [r0] + movs r1, 0xBA + lsls r1, 1 + adds r0, r1 + ldr r0, [r0] + adds r0, 0xE0 + ldr r1, =0x02020630 + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + adds r4, r1 + ldrh r1, [r4, 0x4] + lsls r1, 22 + lsrs r1, 17 + adds r1, 0x80 + ldr r5, =0x06010000 + adds r1, r5 + ldr r2, =0x04000008 + bl CpuSet + mov r2, r8 + str r2, [sp, 0x24] + add r0, sp, 0x24 + ldrh r1, [r4, 0x4] + lsls r1, 22 + lsrs r1, 17 + adds r1, r5 + ldr r2, =0x05000008 + bl CpuSet + b _080730B8 + .pool +_08073084: + ldr r0, [sp, 0x2C] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080730B8 + movs r0, 0x74 + bl sub_80728A4 + ldr r2, =0x02020630 + mov r3, r9 + lsls r1, r3, 4 + add r1, r9 + lsls r1, 2 + adds r1, r2 + ldrh r1, [r1, 0x4] + lsls r1, 22 + lsrs r1, 17 + movs r2, 0xD0 + lsls r2, 3 + adds r1, r2 + ldr r2, =0x06010000 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet +_080730B8: + add sp, 0x30 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8072E0C + + thumb_func_start sub_80730D4 +sub_80730D4: @ 80730D4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x14] + ldr r1, =gUnknown_0832C3C4 + mov r0, sp + movs r2, 0x14 + bl memcpy + ldr r1, =0x02020630 + ldr r2, [sp, 0x14] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x3A] + lsls r0, 24 + lsrs r0, 24 + bl battle_get_per_side_status + ldr r1, =0x020244d4 + ldr r2, [r1] + movs r3, 0xBA + lsls r3, 1 + adds r2, r3 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 7 + movs r0, 0xA4 + lsls r0, 3 + adds r1, r0 + ldr r0, [r2] + adds r6, r0, r1 + movs r1, 0x5 + mov r8, r1 + adds r0, r4, 0 + bl GetNature + lsls r0, 24 + mov r4, sp + adds r4, 0x6 + ldr r1, =gNatureNamePointers + lsrs r0, 22 + adds r0, r1 + ldr r1, [r0] + adds r0, r4, 0 + bl CopyString + adds r0, r6, 0 + movs r1, 0x9 + mov r2, sp + bl RenderTextFont9 + movs r7, 0x6 + movs r5, 0 + mov r2, sp + adds r2, 0x9 + str r2, [sp, 0x1C] +_08073158: + mov r3, sp + adds r0, r3, r7 + ldrb r1, [r0] + adds r0, r1, 0 + subs r0, 0x37 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x13 + bls _08073176 + adds r0, r1, 0 + adds r0, 0x79 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x13 + bhi _0807318C +_08073176: + movs r0, 0x2C + b _080731AA + .pool +_0807318C: + adds r0, r1, 0 + subs r0, 0x4B + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bls _080731A4 + adds r0, r1, 0 + adds r0, 0x65 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bhi _080731A8 +_080731A4: + movs r0, 0x2D + b _080731AA +_080731A8: + movs r0, 0x2B +_080731AA: + bl sub_80728A4 + lsls r1, r5, 6 + adds r1, r6, r1 + ldr r2, =0x04000008 + bl CpuSet + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r7, 0x1 + cmp r5, r8 + bcc _08073158 + movs r7, 0x1 + ldr r0, [sp, 0x14] + lsls r0, 4 + str r0, [sp, 0x18] + movs r1, 0x1 + add r1, r8 + mov r9, r1 + cmp r7, r9 + bge _08073236 + ldr r1, =0x02020630 + ldr r2, =0x04000008 + mov r10, r2 + ldr r3, [sp, 0x14] + adds r0, r3 + lsls r0, 2 + adds r0, r1 + mov r8, r0 +_080731E6: + mov r1, r8 + ldrh r0, [r1, 0x4] + lsls r0, 22 + lsrs r0, 22 + adds r5, r7, 0 + cmp r7, 0 + bge _080731F6 + adds r5, r7, 0x7 +_080731F6: + asrs r5, 3 + lsls r4, r5, 3 + subs r4, r7, r4 + adds r0, r4 + lsls r5, 6 + adds r0, r5 + lsls r0, 5 + ldr r2, =0x06010000 + adds r1, r0, r2 + adds r0, r6, 0 + mov r2, r10 + bl CpuSet + adds r6, 0x20 + mov r3, r8 + ldrh r0, [r3, 0x4] + lsls r0, 22 + lsrs r0, 22 + adds r4, 0x8 + adds r0, r4 + adds r0, r5 + lsls r0, 5 + ldr r2, =0x06010000 + adds r1, r0, r2 + adds r0, r6, 0 + mov r2, r10 + bl CpuSet + adds r6, 0x20 + adds r7, 0x1 + cmp r7, r9 + blt _080731E6 +_08073236: + ldr r6, =0x02020630 + ldr r3, [sp, 0x18] + ldr r1, [sp, 0x14] + adds r0, r3, r1 + lsls r0, 2 + adds r0, r6 + ldrh r4, [r0, 0x38] + lsls r4, 24 + lsrs r4, 24 + ldr r5, =0x0202449c + ldr r0, [r5] + adds r0, 0x7C + ldrb r1, [r0] + mov r0, sp + adds r0, 0x6 + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r0, [r5] + adds r0, 0x7B + ldrb r1, [r0] + ldr r0, [sp, 0x1C] + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalString + mov r1, sp + movs r0, 0 + strb r0, [r1, 0x5] + movs r0, 0xBA + strb r0, [r1, 0x8] + ldr r5, =0x020244d4 + ldr r0, [r5] + movs r2, 0xBA + lsls r2, 1 + adds r0, r2 + ldr r0, [r0] + movs r1, 0x9 + mov r2, sp + bl RenderTextFont9 + movs r7, 0 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r6, r0, r6 + movs r4, 0x20 +_08073296: + cmp r7, 0x1 + bgt _080732D4 + ldr r0, [r5] + movs r3, 0xBA + lsls r3, 1 + adds r0, r3 + ldr r0, [r0] + adds r0, r4 + ldrh r1, [r6, 0x4] + lsls r1, 22 + lsrs r1, 22 + adds r2, r7, 0x2 + adds r1, r2 + lsls r1, 5 + ldr r2, =0x06010000 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet + b _080732F4 + .pool +_080732D4: + ldr r0, [r5] + movs r3, 0xBA + lsls r3, 1 + adds r0, r3 + ldr r0, [r0] + adds r0, r4 + ldrh r1, [r6, 0x4] + lsls r1, 22 + lsrs r1, 22 + adds r1, r7, r1 + lsls r1, 5 + ldr r2, =0x060100c0 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet +_080732F4: + adds r4, 0x40 + adds r7, 0x1 + cmp r7, 0x4 + ble _08073296 + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80730D4 + + thumb_func_start sub_8073314 +sub_8073314: @ 8073314 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r0, 0 + mov r9, r0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r9, r0 + blt _0807332E + b _080735BA +_0807332E: + ldr r1, =0x02020630 + mov r10, r1 + ldr r2, =0x0202406e + mov r8, r2 +_08073336: + ldr r0, =0x03005d70 + mov r1, r9 + adds r6, r1, r0 + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + mov r1, r10 + adds r1, 0x1C + adds r0, r1 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + beq _08073354 + b _080735A8 +_08073354: + mov r2, r9 + lsls r0, r2, 24 + lsrs r7, r0, 24 + adds r0, r7, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0807336A + b _080735A8 +_0807336A: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _08073382 + adds r0, r7, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08073382 + b _080735A8 +_08073382: + ldr r5, =0x020244d0 + ldr r0, [r5] + ldr r3, [r0] + mov r0, r9 + lsls r4, r0, 2 + adds r3, r4, r3 + ldr r0, [r3] + lsls r0, 27 + lsrs r0, 31 + movs r2, 0x1 + eors r2, r0 + lsls r2, 4 + mov r12, r2 + ldrb r0, [r3] + movs r2, 0x11 + negs r2, r2 + adds r1, r2, 0 + ands r0, r1 + mov r1, r12 + orrs r0, r1 + strb r0, [r3] + ldr r0, [r5] + ldr r0, [r0] + adds r4, r0 + ldr r0, [r4] + lsls r0, 27 + lsrs r4, r0, 31 + adds r0, r7, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080734B0 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _080733D0 + b _080735A8 +_080733D0: + ldr r0, =0x02022fec + ldr r2, [r0] + movs r0, 0x80 + ands r2, r0 + cmp r2, 0 + beq _080733DE + b _080735A8 +_080733DE: + cmp r4, 0x1 + bne _08073468 + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r10 + ldrh r0, [r0, 0x38] + lsls r0, 24 + lsrs r1, r0, 24 + str r2, [sp] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r10 + ldrh r1, [r0, 0x4] + lsls r1, 22 + lsrs r1, 17 + ldr r2, =0x06010000 + adds r1, r2 + mov r0, sp + ldr r2, =0x05000040 + bl CpuSet + ldrb r4, [r6] + mov r1, r8 + ldrh r0, [r1] + movs r2, 0x64 + muls r0, r2 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x39 + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + movs r2, 0 + bl sub_8072E0C + ldrb r4, [r6] + mov r2, r8 + ldrh r0, [r2] + movs r1, 0x64 + muls r0, r1 + ldr r2, =0x020244ec + b _08073536 + .pool +_08073468: + ldrb r0, [r6] + bl draw_status_ailment_maybe + ldrb r0, [r6] + mov r2, r8 + ldrh r1, [r2] + movs r2, 0x64 + muls r1, r2 + ldr r2, =0x020244ec + adds r1, r2 + movs r2, 0x5 + bl healthbar_draw_field_maybe + movs r0, 0x75 + bl sub_80728A4 + ldrb r2, [r6] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r10 + ldrh r1, [r1, 0x4] + lsls r1, 22 + lsrs r1, 17 + ldr r2, =0x06010680 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet + b _08073592 + .pool +_080734B0: + cmp r4, 0x1 + bne _0807355C + ldr r0, =0x02022fec + ldr r2, [r0] + movs r0, 0x80 + ands r2, r0 + cmp r2, 0 + beq _080734DC + ldrb r0, [r6] + mov r2, r8 + ldrh r1, [r2] + movs r2, 0x64 + muls r1, r2 + ldr r2, =0x02024744 + adds r1, r2 + bl sub_80730D4 + b _08073592 + .pool +_080734DC: + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r10 + ldrh r0, [r0, 0x38] + lsls r0, 24 + lsrs r1, r0, 24 + str r2, [sp] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r10 + ldrh r1, [r0, 0x4] + lsls r1, 22 + lsrs r1, 17 + ldr r0, =0x06010000 + adds r1, r0 + mov r0, sp + ldr r2, =0x05000040 + bl CpuSet + ldrb r4, [r6] + mov r1, r8 + ldrh r0, [r1] + movs r2, 0x64 + muls r0, r2 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x39 + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + movs r2, 0 + bl sub_8072E0C + ldrb r4, [r6] + mov r2, r8 + ldrh r0, [r2] + movs r1, 0x64 + muls r0, r1 + ldr r2, =0x02024744 +_08073536: + adds r0, r2 + movs r1, 0x3A + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_8072E0C + b _08073592 + .pool +_0807355C: + ldrb r0, [r6] + bl draw_status_ailment_maybe + ldrb r0, [r6] + mov r2, r8 + ldrh r1, [r2] + movs r5, 0x64 + muls r1, r5 + ldr r4, =0x02024744 + adds r1, r4 + movs r2, 0x5 + bl healthbar_draw_field_maybe + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08073592 + ldrb r0, [r6] + mov r2, r8 + ldrh r1, [r2] + muls r1, r5 + adds r1, r4 + movs r2, 0x4 + bl healthbar_draw_field_maybe +_08073592: + ldr r0, =0x03005d70 + add r0, r9 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r10 + ldrh r1, [r0, 0x3C] + movs r2, 0x1 + eors r1, r2 + strh r1, [r0, 0x3C] +_080735A8: + movs r0, 0x2 + add r8, r0 + movs r1, 0x1 + add r9, r1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r9, r0 + bge _080735BA + b _08073336 +_080735BA: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8073314 + + thumb_func_start sub_80735DC +sub_80735DC: @ 80735DC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + str r1, [sp, 0xC] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] + lsls r2, 24 + lsrs r2, 24 + adds r4, r2, 0 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x10] + cmp r4, 0 + beq _0807360C + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + beq _0807365C +_0807360C: + ldr r0, [sp, 0x8] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08073630 + movs r0, 0 + mov r9, r0 + movs r5, 0x88 + movs r4, 0x60 + movs r1, 0x64 + mov r10, r1 + ldr r2, =0x0000fffb + mov r8, r2 + b _0807366C + .pool +_08073630: + movs r3, 0x1 + mov r9, r3 + cmp r4, 0 + beq _08073642 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _08073648 +_08073642: + movs r5, 0x68 + movs r4, 0x28 + b _0807364C +_08073648: + movs r5, 0x68 + movs r4, 0x10 +_0807364C: + ldr r6, =0x0000ff9c + mov r10, r6 + movs r0, 0x5 + mov r8, r0 + b _0807366C + .pool +_0807365C: + movs r1, 0x1 + mov r9, r1 + movs r5, 0x68 + movs r4, 0x28 + ldr r2, =0x0000ff9c + mov r10, r2 + movs r3, 0x5 + mov r8, r3 +_0807366C: + ldr r0, =gUnknown_0832C334 + bl LoadCompressedObjectPicUsingHeap + ldr r0, =gUnknown_0832C34C + bl LoadObjectPic + ldr r0, =gUnknown_0832C33C + bl LoadTaggedObjectPalette + ldr r0, =gUnknown_0832C344 + bl LoadTaggedObjectPalette + mov r0, r9 + lsls r6, r0, 1 + adds r0, r6, r0 + lsls r0, 3 + ldr r1, =gUnknown_0832C364 + adds r0, r1 + lsls r5, 16 + asrs r1, r5, 16 + lsls r4, 16 + asrs r2, r4, 16 + movs r3, 0xA + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x14] + lsls r0, 4 + ldr r1, [sp, 0x14] + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r7, r0, r1 + ldr r1, =gUnknown_0832C2C4 + adds r0, r7, 0 + bl SetSpriteOamTables_NoPriorityFromTable + mov r2, r10 + strh r2, [r7, 0x24] + mov r3, r8 + strh r3, [r7, 0x2E] + str r5, [sp, 0x1C] + str r4, [sp, 0x20] + mov r5, r9 + cmp r5, 0 + beq _08073700 + ldrh r0, [r7, 0x20] + subs r0, 0x60 + strh r0, [r7, 0x20] + ldrb r1, [r7, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r7, 0x3] + b _08073706 + .pool +_08073700: + ldrh r0, [r7, 0x20] + adds r0, 0x60 + strh r0, [r7, 0x20] +_08073706: + movs r0, 0 + mov r8, r0 + ldr r1, =0x02020630 + mov r10, r1 + mov r7, sp + mov r2, r9 + adds r0, r6, r2 + lsls r0, 3 + str r0, [sp, 0x18] + movs r6, 0xA + movs r5, 0 +_0807371C: + ldr r0, =gUnknown_0832C394 + ldr r3, [sp, 0x20] + ldr r1, =0xfffc0000 + adds r2, r3, r1 + ldr r3, [sp, 0x18] + adds r0, r3, r0 + ldr r3, [sp, 0x1C] + asrs r1, r3, 16 + asrs r2, 16 + movs r3, 0x9 + bl AddObjectToBack + strb r0, [r7] + ldr r0, [sp, 0x10] + cmp r0, 0 + bne _0807374C + ldrb r0, [r7] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r2, =0x0202064c + adds r1, r2 + ldr r0, =sub_80741C8 + str r0, [r1] +_0807374C: + ldr r4, =0x02020630 + mov r3, r9 + cmp r3, 0 + bne _0807376E + ldrb r1, [r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r10 + strh r3, [r0, 0x24] + ldrb r1, [r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r10 + mov r1, r9 + strh r1, [r0, 0x26] +_0807376E: + ldrb r1, [r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0 + mov r2, sp + ldrh r2, [r2, 0x14] + strh r2, [r0, 0x2E] + mov r3, r9 + cmp r3, 0 + bne _080737C8 + ldrb r0, [r7] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrh r0, [r1, 0x20] + adds r0, 0x18 + adds r0, r5 + strh r0, [r1, 0x20] + ldrb r1, [r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r6, [r0, 0x30] + ldrb r1, [r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x78 + b _0807380A + .pool +_080737C8: + ldrb r0, [r7] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r4 + ldrh r3, [r2, 0x20] + subs r3, 0x18 + movs r1, 0x5 + mov r0, r8 + subs r1, r0 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + subs r3, r0 + strh r3, [r2, 0x20] + ldrb r0, [r7] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r4 + movs r1, 0x6 + mov r3, r8 + subs r1, r3 + lsls r0, r1, 3 + subs r0, r1 + adds r0, 0xA + strh r0, [r2, 0x30] + ldrb r1, [r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =0x0000ff88 +_0807380A: + strh r1, [r0, 0x24] + ldrb r1, [r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + mov r1, r9 + strh r1, [r0, 0x32] + adds r7, 0x1 + adds r6, 0x7 + adds r5, 0xA + movs r2, 0x1 + add r8, r2 + mov r3, r8 + cmp r3, 0x5 + bgt _0807382C + b _0807371C +_0807382C: + ldr r0, [sp, 0x8] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0807383A + b _080739E8 +_0807383A: + ldr r0, =0x02022fec + ldr r1, [r0] + movs r2, 0x40 + ands r1, r2 + cmp r1, 0 + beq _080738F4 + ldr r5, =0x0000ffff + mov r10, r5 + ldr r6, =0x02020630 + ldr r0, =0x000003ff + adds r7, r0, 0 + ldr r1, =0xfffffc00 + mov r9, r1 + mov r4, sp + ldr r5, [sp, 0xC] + movs r2, 0x5 + mov r8, r2 +_0807385C: + ldrh r0, [r5] + cmp r0, r10 + bne _080738A8 + ldrb r0, [r4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r6 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x1 + ands r1, r7 + mov r0, r9 + ands r0, r3 + orrs r0, r1 + strh r0, [r2, 0x4] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x1 + strh r1, [r0, 0x3C] + b _080738E2 + .pool +_080738A8: + cmp r0, 0 + bne _080738C0 + ldrb r0, [r4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r6 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x3 + b _080738D8 +_080738C0: + ldr r0, [r5, 0x4] + cmp r0, 0 + beq _080738E2 + ldrb r0, [r4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r6 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x2 +_080738D8: + ands r1, r7 + mov r0, r9 + ands r0, r3 + orrs r0, r1 + strh r0, [r2, 0x4] +_080738E2: + adds r4, 0x1 + adds r5, 0x8 + movs r3, 0x1 + negs r3, r3 + add r8, r3 + mov r0, r8 + cmp r0, 0 + bge _0807385C + b _08073B9A +_080738F4: + movs r1, 0x5 + mov r10, r1 + movs r7, 0 + ldr r2, =0x02020630 + mov r8, r2 + ldr r3, =0x000003ff + mov r9, r3 + ldr r5, =0xfffffc00 + mov r12, r5 + ldr r6, [sp, 0xC] + mov r5, sp +_0807390A: + ldrh r0, [r6] + ldr r1, =0x0000ffff + cmp r0, r1 + bne _08073958 + mov r4, sp + add r4, r10 + ldrb r0, [r4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + add r2, r8 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x1 + mov r0, r9 + ands r1, r0 + mov r0, r12 + ands r0, r3 + orrs r0, r1 + strh r0, [r2, 0x4] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + movs r1, 0x1 + strh r1, [r0, 0x3C] + subs r1, 0x2 + add r10, r1 + b _080739DE + .pool +_08073958: + cmp r0, 0 + bne _08073970 + ldrb r0, [r5] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + add r2, r8 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x3 + b _080739D0 +_08073970: + ldr r1, =0x02022fec + ldr r0, [r1] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _080739B8 + ldr r0, =0x0202449c + ldr r0, [r0] + movs r2, 0xA8 + lsls r2, 2 + adds r0, r2 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + lsls r0, r7, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _080739B8 + ldrb r0, [r5] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + add r2, r8 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x3 + b _080739D0 + .pool +_080739B8: + ldr r0, [r6, 0x4] + cmp r0, 0 + beq _080739DC + ldrb r0, [r5] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + add r2, r8 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x2 +_080739D0: + mov r0, r9 + ands r1, r0 + mov r0, r12 + ands r0, r3 + orrs r0, r1 + strh r0, [r2, 0x4] +_080739DC: + adds r5, 0x1 +_080739DE: + adds r6, 0x8 + adds r7, 0x1 + cmp r7, 0x5 + ble _0807390A + b _08073B9A +_080739E8: + ldr r0, =0x02022fec + ldr r1, [r0] + ldr r2, =0x00008040 + ands r1, r2 + cmp r1, 0 + beq _08073AA4 + ldr r1, =0x0000ffff + mov r10, r1 + ldr r6, =0x02020630 + ldr r2, =0x000003ff + adds r7, r2, 0 + ldr r3, =0xfffffc00 + mov r9, r3 + ldr r5, [sp, 0xC] + mov r4, sp + adds r4, 0x5 + movs r0, 0x5 + mov r8, r0 +_08073A0C: + ldrh r0, [r5] + cmp r0, r10 + bne _08073A58 + ldrb r0, [r4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r6 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x1 + ands r1, r7 + mov r0, r9 + ands r0, r3 + orrs r0, r1 + strh r0, [r2, 0x4] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x1 + strh r1, [r0, 0x3C] + b _08073A92 + .pool +_08073A58: + cmp r0, 0 + bne _08073A70 + ldrb r0, [r4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r6 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x3 + b _08073A88 +_08073A70: + ldr r0, [r5, 0x4] + cmp r0, 0 + beq _08073A92 + ldrb r0, [r4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r6 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x2 +_08073A88: + ands r1, r7 + mov r0, r9 + ands r0, r3 + orrs r0, r1 + strh r0, [r2, 0x4] +_08073A92: + subs r4, 0x1 + adds r5, 0x8 + movs r1, 0x1 + negs r1, r1 + add r8, r1 + mov r2, r8 + cmp r2, 0 + bge _08073A0C + b _08073B9A +_08073AA4: + movs r3, 0 + mov r8, r3 + movs r7, 0 + ldr r5, =0x02020630 + mov r9, r5 + ldr r6, =0x000003ff + mov r12, r6 + ldr r0, =0xfffffc00 + mov r10, r0 + ldr r6, [sp, 0xC] + mov r5, sp + adds r5, 0x5 +_08073ABC: + ldrh r0, [r6] + ldr r1, =0x0000ffff + cmp r0, r1 + bne _08073B08 + mov r4, sp + add r4, r8 + ldrb r0, [r4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + add r2, r9 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x1 + mov r0, r12 + ands r1, r0 + mov r0, r10 + ands r0, r3 + orrs r0, r1 + strh r0, [r2, 0x4] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r9 + movs r1, 0x1 + strh r1, [r0, 0x3C] + add r8, r1 + b _08073B92 + .pool +_08073B08: + cmp r0, 0 + bne _08073B20 + ldrb r0, [r5] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + add r2, r9 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x3 + b _08073B84 +_08073B20: + ldr r1, =0x02022fec + ldr r0, [r1] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _08073B6C + ldr r2, =0x0202449c + ldr r0, [r2] + ldr r3, =0x000002a1 + adds r0, r3 + ldrb r1, [r0] + lsls r0, r7, 2 + ldr r2, =gUnknown_0832A328 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _08073B6C + ldrb r0, [r5] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + add r2, r9 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x3 + b _08073B84 + .pool +_08073B6C: + ldr r0, [r6, 0x4] + cmp r0, 0 + beq _08073B90 + ldrb r0, [r5] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + add r2, r9 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x2 +_08073B84: + mov r0, r12 + ands r1, r0 + mov r0, r10 + ands r0, r3 + orrs r0, r1 + strh r0, [r2, 0x4] +_08073B90: + subs r5, 0x1 +_08073B92: + adds r6, 0x8 + adds r7, 0x1 + cmp r7, 0x5 + ble _08073ABC +_08073B9A: + ldr r0, =nullsub_4 + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r4, r0, 24 + ldr r2, =0x03005e00 + lsls r3, r4, 2 + adds r1, r3, r4 + lsls r1, 3 + adds r0, r1, r2 + mov r5, sp + ldrh r5, [r5, 0x8] + strh r5, [r0, 0x8] + mov r6, sp + ldrh r6, [r6, 0x14] + strh r6, [r0, 0xA] + movs r0, 0 + mov r8, r0 + adds r0, r2, 0 + adds r0, 0xE + adds r1, r0 +_08073BC6: + mov r0, sp + add r0, r8 + ldrb r0, [r0] + strh r0, [r1] + adds r1, 0x2 + movs r5, 0x1 + add r8, r5 + mov r6, r8 + cmp r6, 0x5 + ble _08073BC6 + adds r0, r3, r4 + lsls r0, 3 + adds r0, r2 + mov r1, sp + ldrh r1, [r1, 0x10] + strh r1, [r0, 0x1C] + ldr r2, [sp, 0x10] + cmp r2, 0 + beq _08073C0A + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r3, [r0, 0x8] + ldrb r2, [r3, 0x9] + lsls r1, r2, 27 + lsrs r1, 29 + adds r1, 0x1 + movs r0, 0x7 + ands r1, r0 + lsls r1, 2 + movs r0, 0x1D + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x9] +_08073C0A: + movs r0, 0x72 + movs r1, 0 + bl audio_play_and_stuff + adds r0, r4, 0 + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80735DC + + thumb_func_start sub_8073C30 +sub_8073C30: @ 8073C30 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r2, =0x03005e00 + lsls r3, r0, 2 + adds r1, r3, r0 + lsls r1, 3 + adds r0, r1, r2 + ldrb r7, [r0, 0x1C] + ldrb r4, [r0, 0xA] + mov r10, r4 + ldrb r0, [r0, 0x8] + str r0, [sp, 0x8] + movs r5, 0 + str r3, [sp, 0xC] + adds r2, 0xE + adds r2, r1, r2 +_08073C5E: + mov r0, sp + adds r1, r0, r5 + ldrh r0, [r2] + strb r0, [r1] + adds r2, 0x2 + adds r5, 0x1 + cmp r5, 0x5 + ble _08073C5E + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0x10 + bl SetGpuReg + ldr r1, =0x03005e00 + ldr r0, [sp, 0xC] + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x10 + strh r1, [r0, 0x26] + movs r5, 0 + mov r1, r10 + lsls r1, 4 + str r1, [sp, 0x10] + ldr r3, =0x02020630 + movs r6, 0xD + negs r6, r6 + mov r12, r3 + movs r4, 0x4 +_08073CA0: + mov r2, sp + adds r0, r2, r5 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r2, [r1, 0x1] + adds r0, r6, 0 + ands r0, r2 + orrs r0, r4 + strb r0, [r1, 0x1] + adds r5, 0x1 + cmp r5, 0x5 + ble _08073CA0 + ldr r2, [sp, 0x10] + add r2, r10 + lsls r2, 2 + add r2, r12 + ldrb r1, [r2, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0x1] + cmp r7, 0 + bne _08073CDA + b _08073DE0 +_08073CDA: + movs r5, 0 + mov r6, r12 + mov r9, r5 + adds r3, r6, 0 + adds r3, 0x1C + mov r4, sp + movs r7, 0 +_08073CE8: + ldr r0, [sp, 0x8] + str r3, [sp, 0x14] + bl battle_side_get_owner + lsls r0, 24 + lsrs r2, r0, 24 + ldr r3, [sp, 0x14] + cmp r2, 0 + beq _08073D4C + movs r0, 0x5 + subs r0, r5 + mov r1, sp + adds r2, r1, r0 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r7, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + mov r1, r9 + strh r1, [r0, 0x34] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + mov r1, r9 + strh r1, [r0, 0x36] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldr r1, =sub_8074158 + str r1, [r0] + ldr r2, =0x02020630 + mov r12, r2 + b _08073D82 + .pool +_08073D4C: + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r7, [r0, 0x30] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x34] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x36] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldr r1, =sub_8074158 + str r1, [r0] + ldr r0, =0x02020630 + mov r12, r0 +_08073D82: + adds r4, 0x1 + adds r7, 0x7 + adds r5, 0x1 + cmp r5, 0x5 + ble _08073CE8 + ldr r3, [sp, 0x10] + add r3, r10 + lsls r3, 2 + mov r1, r12 + adds r0, r3, r1 + movs r2, 0x2E + ldrsh r1, [r0, r2] + lsrs r2, r1, 31 + adds r1, r2 + asrs r1, 1 + movs r2, 0 + strh r1, [r0, 0x2E] + strh r2, [r0, 0x30] + mov r1, r12 + adds r1, 0x1C + adds r3, r1 + ldr r1, =sub_8074090 + str r1, [r3] + ldr r1, =gUnknown_0832C2CC + bl SetSpriteOamTables_NoPriorityFromTable + ldr r1, =0x03005e00 + ldr r0, [sp, 0xC] + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldr r1, =task_battle_throw_own_ball + str r1, [r0] + b _08073DEE + .pool +_08073DE0: + ldr r0, =0x03005e00 + ldr r1, [sp, 0xC] + add r1, r8 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_8073F98 + str r0, [r1] +_08073DEE: + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8073C30 + + thumb_func_start task_battle_throw_own_ball +task_battle_throw_own_ball: @ 8073E08 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r0, [r4, 0x1E] + adds r1, r0, 0x1 + strh r1, [r4, 0x1E] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08073E48 + ldrh r0, [r4, 0x26] + subs r1, r0, 0x1 + strh r1, [r4, 0x26] + lsls r0, r1, 16 + cmp r0, 0 + blt _08073E54 + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg +_08073E48: + movs r1, 0x26 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08073E54 + ldr r0, =sub_8073E64 + str r0, [r4] +_08073E54: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task_battle_throw_own_ball + + thumb_func_start sub_8073E64 +sub_8073E64: @ 8073E64 + push {r4-r7,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r7, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r3, r0, 3 + adds r4, r3, r7 + ldrb r2, [r4, 0x8] + ldrh r0, [r4, 0x26] + subs r0, 0x1 + strh r0, [r4, 0x26] + lsls r0, 16 + asrs r1, r0, 16 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _08073F54 + ldrb r5, [r4, 0xA] + movs r4, 0 + ldr r6, =0x020244d0 + adds r0, r7, 0 + adds r0, 0xE + adds r2, r3, r0 +_08073E96: + mov r0, sp + adds r1, r0, r4 + ldrh r0, [r2] + strb r0, [r1] + adds r2, 0x2 + adds r4, 0x1 + cmp r4, 0x5 + ble _08073E96 + ldr r0, [r6] + ldr r3, [r0, 0x8] + ldrb r2, [r3, 0x9] + lsls r1, r2, 27 + lsrs r1, 29 + subs r1, 0x1 + movs r0, 0x7 + ands r1, r0 + lsls r1, 2 + movs r0, 0x1D + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x9] + ldr r0, [r6] + ldr r0, [r0, 0x8] + ldrb r1, [r0, 0x9] + movs r0, 0x1C + ands r0, r1 + cmp r0, 0 + bne _08073EFC + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl RemoveObjectAndFreeResources + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeResources + b _08073F32 + .pool +_08073EFC: + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + ldr r5, =0x02020630 + adds r4, r5 + adds r0, r4, 0 + bl obj_free_rotscale_entry + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl obj_free_rotscale_entry + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl RemoveObjectAndFreeTiles +_08073F32: + movs r4, 0x1 + ldr r5, =0x02020630 +_08073F36: + mov r1, sp + adds r0, r1, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl RemoveObjectAndFreeTiles + adds r4, 0x1 + cmp r4, 0x5 + ble _08073F36 + b _08073F8A + .pool +_08073F54: + movs r0, 0x3 + negs r0, r0 + cmp r1, r0 + bne _08073F8A + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + adds r0, r5, 0 + bl remove_task +_08073F8A: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8073E64 + + thumb_func_start sub_8073F98 +sub_8073F98: @ 8073F98 + push {r4-r7,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + ldr r7, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r6, r0, 3 + adds r3, r6, r7 + ldrb r5, [r3, 0x8] + ldrh r0, [r3, 0x26] + subs r1, r0, 0x1 + strh r1, [r3, 0x26] + lsls r0, r1, 16 + asrs r2, r0, 16 + cmp r2, 0 + blt _08073FD4 + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + b _0807406A + .pool +_08073FD4: + movs r0, 0x1 + negs r0, r0 + cmp r2, r0 + bne _08074034 + ldrb r3, [r3, 0xA] + movs r5, 0 + adds r0, r7, 0 + adds r0, 0xE + adds r2, r6, r0 +_08073FE6: + mov r0, sp + adds r1, r0, r5 + ldrh r0, [r2] + strb r0, [r1] + adds r2, 0x2 + adds r5, 0x1 + cmp r5, 0x5 + ble _08073FE6 + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl RemoveObjectAndFreeResources + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeResources + movs r5, 0x1 +_08074016: + mov r1, sp + adds r0, r1, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + adds r5, 0x1 + cmp r5, 0x5 + ble _08074016 + b _0807406A + .pool +_08074034: + movs r0, 0x3 + negs r0, r0 + cmp r2, r0 + bne _0807406A + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x4] + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + adds r0, r4, 0 + bl remove_task +_0807406A: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8073F98 + + thumb_func_start sub_8074078 +sub_8074078: @ 8074078 + push {lr} + adds r1, r0, 0 + ldrh r2, [r1, 0x24] + movs r3, 0x24 + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _0807408C + ldrh r0, [r1, 0x2E] + adds r0, r2, r0 + strh r0, [r1, 0x24] +_0807408C: + pop {r0} + bx r0 + thumb_func_end sub_8074078 + + thumb_func_start sub_8074090 +sub_8074090: @ 8074090 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x30] + adds r1, r0, 0 + adds r1, 0x20 + strh r1, [r2, 0x30] + movs r3, 0x2E + ldrsh r0, [r2, r3] + cmp r0, 0 + ble _080740AE + lsls r0, r1, 16 + asrs r0, 20 + ldrh r1, [r2, 0x24] + adds r0, r1 + b _080740B6 +_080740AE: + lsls r1, 16 + asrs r1, 20 + ldrh r0, [r2, 0x24] + subs r0, r1 +_080740B6: + strh r0, [r2, 0x24] + ldrh r1, [r2, 0x30] + movs r0, 0xF + ands r0, r1 + strh r0, [r2, 0x30] + pop {r0} + bx r0 + thumb_func_end sub_8074090 + + thumb_func_start sub_80740C4 +sub_80740C4: @ 80740C4 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x30] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _080740D8 + subs r0, r1, 0x1 + strh r0, [r4, 0x30] + b _0807414E +_080740D8: + ldrh r0, [r4, 0x32] + lsls r0, 24 + lsrs r3, r0, 24 + ldrh r2, [r4, 0x34] + adds r0, r2, 0 + adds r0, 0x38 + lsls r1, r0, 16 + lsrs r2, r1, 16 + ldr r0, =0x0000fff0 + ands r2, r0 + strh r2, [r4, 0x34] + cmp r3, 0 + beq _0807410C + lsrs r0, r1, 20 + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + lsls r0, 16 + cmp r0, 0 + ble _0807411C + movs r0, 0 + strh r0, [r4, 0x24] + b _0807411C + .pool +_0807410C: + lsrs r1, 20 + ldrh r0, [r4, 0x24] + subs r0, r1 + strh r0, [r4, 0x24] + lsls r0, 16 + cmp r0, 0 + bge _0807411C + strh r3, [r4, 0x24] +_0807411C: + movs r2, 0x24 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _0807414E + movs r1, 0x3F + cmp r3, 0 + beq _0807412C + movs r1, 0xC0 +_0807412C: + movs r2, 0x3C + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08074140 + lsls r1, 24 + asrs r1, 24 + movs r0, 0x74 + bl sub_80A383C + b _0807414A +_08074140: + lsls r1, 24 + asrs r1, 24 + movs r0, 0x73 + bl sub_80A3808 +_0807414A: + ldr r0, =DummyObjectCallback + str r0, [r4, 0x1C] +_0807414E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80740C4 + + thumb_func_start sub_8074158 +sub_8074158: @ 8074158 + push {r4,lr} + adds r3, r0, 0 + ldrh r1, [r3, 0x30] + movs r2, 0x30 + ldrsh r0, [r3, r2] + cmp r0, 0 + ble _0807416C + subs r0, r1, 0x1 + strh r0, [r3, 0x30] + b _080741BC +_0807416C: + ldrh r0, [r3, 0x32] + lsls r0, 24 + ldrh r2, [r3, 0x34] + adds r1, r2, 0 + adds r1, 0x38 + lsls r4, r1, 16 + lsrs r2, r4, 16 + ldr r1, =0x0000fff0 + ands r2, r1 + strh r2, [r3, 0x34] + cmp r0, 0 + beq _08074190 + lsrs r0, r4, 20 + ldrh r1, [r3, 0x24] + adds r0, r1 + b _08074196 + .pool +_08074190: + lsrs r1, r4, 20 + ldrh r0, [r3, 0x24] + subs r0, r1 +_08074196: + strh r0, [r3, 0x24] + movs r2, 0x24 + ldrsh r0, [r3, r2] + movs r2, 0x20 + ldrsh r1, [r3, r2] + adds r0, r1 + adds r0, 0x8 + movs r1, 0x80 + lsls r1, 1 + cmp r0, r1 + bls _080741BC + adds r2, r3, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =DummyObjectCallback + str r0, [r3, 0x1C] +_080741BC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8074158 + + thumb_func_start sub_80741C8 +sub_80741C8: @ 80741C8 + ldrh r2, [r0, 0x2E] + lsls r2, 24 + lsrs r2, 24 + ldr r3, =0x02020630 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r3 + ldrh r2, [r1, 0x24] + strh r2, [r0, 0x24] + ldrh r1, [r1, 0x26] + strh r1, [r0, 0x26] + bx lr + .pool + thumb_func_end sub_80741C8 + + thumb_func_start sub_80741E8 +sub_80741E8: @ 80741E8 + push {r4-r7,lr} + sub sp, 0x14 + adds r4, r1, 0 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r5, =0x02022e2c + ldr r1, =gUnknown_085ED228 + adds r0, r5, 0 + bl CopyString + adds r0, r4, 0 + movs r1, 0x2 + add r2, sp, 0x4 + bl pokemon_getattr + add r0, sp, 0x4 + bl GetStringEnd_Limit7 + adds r0, r5, 0 + add r1, sp, 0x4 + bl AppendString + adds r5, r0, 0 + adds r0, r4, 0 + bl pokemon_get_gender + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + adds r1, r0, 0 + cmp r0, 0x1D + beq _08074236 + cmp r0, 0x20 + bne _0807424A +_08074236: + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + add r0, sp, 0x4 + bl CompareString + cmp r0, 0 + bne _0807424A + movs r6, 0x64 +_0807424A: + cmp r6, 0 + beq _08074268 + cmp r6, 0xFE + beq _08074270 + ldr r1, =gUnknown_085ED238 + b _08074272 + .pool +_08074268: + ldr r1, =gUnknown_085ED22E + b _08074272 + .pool +_08074270: + ldr r1, =gUnknown_085ED233 +_08074272: + adds r0, r5, 0 + bl CopyString + ldr r0, =0x02022e2c + add r1, sp, 0x10 + str r1, [sp] + movs r1, 0 + movs r2, 0x3 + movs r3, 0x2 + bl write_to_rbox + adds r6, r0, 0 + ldr r0, =0x02020630 + lsls r1, r7, 4 + adds r1, r7 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x4] + lsls r0, 22 + lsrs r4, r0, 17 + ldrh r0, [r1, 0x3A] + lsls r0, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080742F0 + ldr r1, =0x06010040 + adds r0, r4, r1 + adds r1, r6, 0 + movs r2, 0x6 + bl sub_8075198 + bl battle_type_is_double + lsls r0, 24 + ldr r1, =0x06010400 + adds r5, r4, r1 + cmp r0, 0 + bne _080742C8 + ldr r0, =0x06010800 + adds r5, r4, r0 +_080742C8: + adds r1, r6, 0 + adds r1, 0xC0 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_8075198 + b _080742FC + .pool +_080742F0: + ldr r1, =0x06010020 + adds r0, r4, r1 + adds r1, r6, 0 + movs r2, 0x7 + bl sub_8075198 +_080742FC: + ldr r0, [sp, 0x10] + bl sub_807512C + add sp, 0x14 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80741E8 + + thumb_func_start sub_8074310 +sub_8074310: @ 8074310 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + bne _080743E6 + movs r0, 0x8 + ands r1, r0 + cmp r1, 0 + bne _080743E6 + ldr r6, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r5, r0, r6 + ldrh r0, [r5, 0x3A] + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080743E6 + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _080743E6 + ldrh r0, [r5, 0x38] + lsls r0, 24 + lsrs r4, r0, 24 + cmp r7, 0 + beq _080743C4 + movs r0, 0x46 + bl sub_80728A4 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r6 + ldrh r1, [r1, 0x4] + lsls r1, 22 + lsrs r1, 17 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2 + ldr r2, =0x06010000 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet + b _080743E6 + .pool +_080743C4: + str r7, [sp] + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r6 + ldrh r1, [r0, 0x4] + lsls r1, 22 + lsrs r1, 17 + movs r0, 0x80 + lsls r0, 1 + adds r1, r0 + ldr r0, =0x06010000 + adds r1, r0 + ldr r2, =0x05000008 + mov r0, sp + bl CpuSet +_080743E6: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8074310 + + thumb_func_start draw_status_ailment_maybe +draw_status_ailment_maybe: @ 80743F8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r0, =0x02020630 + mov r2, r9 + lsls r1, r2, 4 + add r1, r9 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x3A] + lsls r0, 24 + lsrs r7, r0, 24 + ldrh r0, [r1, 0x38] + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + adds r0, r7, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08074468 + ldr r1, =0x0202406e + lsls r0, r7, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x37 + bl pokemon_getattr + adds r4, r0, 0 + bl battle_type_is_double + lsls r0, 24 + movs r3, 0x12 + mov r8, r3 + cmp r0, 0 + bne _08074484 + movs r0, 0x1A + mov r8, r0 + b _08074484 + .pool +_08074468: + ldr r1, =0x0202406e + lsls r0, r7, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x37 + bl pokemon_getattr + adds r4, r0, 0 + movs r1, 0x11 + mov r8, r1 +_08074484: + movs r0, 0x7 + ands r0, r4 + cmp r0, 0 + beq _080744AC + movs r0, 0x1B + adds r1, r7, 0 + bl sub_80746A8 + lsls r0, 24 + lsrs r0, 24 + bl sub_80728A4 + adds r6, r0, 0 + movs r0, 0x2 + b _080745B8 + .pool +_080744AC: + movs r0, 0x88 + ands r0, r4 + cmp r0, 0 + beq _080744CA + movs r0, 0x15 + adds r1, r7, 0 + bl sub_80746A8 + lsls r0, 24 + lsrs r0, 24 + bl sub_80728A4 + adds r6, r0, 0 + movs r0, 0 + b _080745B8 +_080744CA: + movs r0, 0x10 + ands r0, r4 + cmp r0, 0 + beq _080744E8 + movs r0, 0x21 + adds r1, r7, 0 + bl sub_80746A8 + lsls r0, 24 + lsrs r0, 24 + bl sub_80728A4 + adds r6, r0, 0 + movs r0, 0x4 + b _080745B8 +_080744E8: + movs r0, 0x20 + ands r0, r4 + cmp r0, 0 + beq _08074506 + movs r0, 0x1E + adds r1, r7, 0 + bl sub_80746A8 + lsls r0, 24 + lsrs r0, 24 + bl sub_80728A4 + adds r6, r0, 0 + movs r0, 0x3 + b _080745B8 +_08074506: + movs r0, 0x40 + ands r0, r4 + cmp r0, 0 + beq _08074524 + movs r0, 0x18 + adds r1, r7, 0 + bl sub_80746A8 + lsls r0, 24 + lsrs r0, 24 + bl sub_80728A4 + adds r6, r0, 0 + movs r0, 0x1 + b _080745B8 +_08074524: + movs r0, 0x27 + bl sub_80728A4 + adds r6, r0, 0 + movs r4, 0 + mov r2, r9 + lsls r0, r2, 4 + mov r3, r8 + lsls r3, 16 + mov r8, r3 + lsls r7, 2 + ldr r1, =0x02020630 + add r0, r9 + lsls r0, 2 + adds r5, r0, r1 +_08074542: + ldrh r1, [r5, 0x4] + lsls r1, 22 + lsrs r1, 22 + mov r2, r8 + asrs r0, r2, 16 + adds r1, r0 + adds r1, r4 + lsls r1, 5 + ldr r3, =0x06010000 + adds r1, r3 + adds r0, r6, 0 + ldr r2, =0x04000008 + bl CpuSet + adds r4, 0x1 + cmp r4, 0x2 + ble _08074542 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0] + adds r0, r7, r0 + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _08074598 + movs r0, 0x1 + bl sub_80728A4 + ldr r2, =0x02020630 + mov r3, r10 + lsls r1, r3, 4 + add r1, r10 + lsls r1, 2 + adds r1, r2 + ldrh r1, [r1, 0x4] + lsls r1, 22 + lsrs r1, 17 + ldr r2, =0x06010000 + adds r1, r2 + ldr r2, =0x04000010 + bl CpuSet +_08074598: + mov r0, r9 + movs r1, 0x1 + bl sub_8074310 + b _0807467A + .pool +_080745B8: + mov r1, r9 + lsls r5, r1, 4 + add r5, r9 + lsls r5, 2 + ldr r2, =0x02020630 + adds r5, r2 + ldrb r4, [r5, 0x5] + lsrs r4, 4 + lsls r4, 4 + adds r4, 0xC + adds r4, r7 + ldr r1, =gUnknown_0832C3EC + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + movs r3, 0x80 + lsls r3, 1 + adds r1, r4, r3 + movs r2, 0x2 + bl rboxid_80040B8 + lsls r4, 1 + ldr r0, =0x02037914 + adds r0, r4, r0 + ldr r1, =0x05000200 + adds r4, r1 + adds r1, r4, 0 + movs r2, 0x1 + bl CpuSet + ldrh r1, [r5, 0x4] + lsls r1, 22 + lsrs r1, 22 + add r1, r8 + lsls r1, 5 + ldr r2, =0x06010000 + mov r8, r2 + add r1, r8 + ldr r2, =0x04000018 + adds r0, r6, 0 + bl CpuSet + bl battle_type_is_double + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08074626 + adds r0, r7, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08074672 +_08074626: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r7, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _08074672 + movs r0, 0 + bl sub_80728A4 + mov r3, r10 + lsls r4, r3, 4 + add r4, r10 + lsls r4, 2 + ldr r1, =0x02020630 + adds r4, r1 + ldrh r1, [r4, 0x4] + lsls r1, 22 + lsrs r1, 17 + add r1, r8 + ldr r5, =0x04000008 + adds r2, r5, 0 + bl CpuSet + movs r0, 0x41 + bl sub_80728A4 + ldrh r1, [r4, 0x4] + lsls r1, 22 + lsrs r1, 17 + adds r1, 0x20 + add r1, r8 + adds r2, r5, 0 + bl CpuSet +_08074672: + mov r0, r9 + movs r1, 0 + bl sub_8074310 +_0807467A: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end draw_status_ailment_maybe + + thumb_func_start sub_80746A8 +sub_80746A8: @ 80746A8 + push {lr} + lsls r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + lsrs r2, r0, 24 + adds r0, r2, 0 + subs r0, 0x15 + cmp r0, 0xC + bhi _08074768 + lsls r0, 2 + ldr r1, =_080746C8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080746C8: + .4byte _080746FC + .4byte _08074768 + .4byte _08074768 + .4byte _08074712 + .4byte _08074768 + .4byte _08074768 + .4byte _08074728 + .4byte _08074768 + .4byte _08074768 + .4byte _0807473E + .4byte _08074768 + .4byte _08074768 + .4byte _08074754 +_080746FC: + movs r2, 0x15 + cmp r3, 0 + beq _08074768 + movs r2, 0x47 + cmp r3, 0x1 + beq _08074768 + movs r2, 0x65 + cmp r3, 0x2 + bne _08074768 + movs r2, 0x56 + b _08074768 +_08074712: + movs r2, 0x18 + cmp r3, 0 + beq _08074768 + movs r2, 0x4A + cmp r3, 0x1 + beq _08074768 + movs r2, 0x68 + cmp r3, 0x2 + bne _08074768 + movs r2, 0x59 + b _08074768 +_08074728: + movs r2, 0x1B + cmp r3, 0 + beq _08074768 + movs r2, 0x4D + cmp r3, 0x1 + beq _08074768 + movs r2, 0x6B + cmp r3, 0x2 + bne _08074768 + movs r2, 0x5C + b _08074768 +_0807473E: + movs r2, 0x1E + cmp r3, 0 + beq _08074768 + movs r2, 0x50 + cmp r3, 0x1 + beq _08074768 + movs r2, 0x6E + cmp r3, 0x2 + bne _08074768 + movs r2, 0x5F + b _08074768 +_08074754: + movs r2, 0x21 + cmp r3, 0 + beq _08074768 + movs r2, 0x53 + cmp r3, 0x1 + beq _08074768 + movs r2, 0x71 + cmp r3, 0x2 + bne _08074768 + movs r2, 0x62 +_08074768: + adds r0, r2, 0 + pop {r1} + bx r1 + thumb_func_end sub_80746A8 + + thumb_func_start sub_8074770 +sub_8074770: @ 8074770 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_085CCB2C + add r1, sp, 0x4 + str r1, [sp] + movs r1, 0 + movs r2, 0x3 + movs r3, 0x2 + bl write_to_rbox + adds r5, r0, 0 + ldr r1, =0x02020630 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + ldrh r4, [r0, 0x4] + lsls r4, 22 + lsrs r4, 17 + ldr r1, =0x06010040 + adds r0, r4, r1 + adds r1, r5, 0 + movs r2, 0x6 + bl sub_8075198 + ldr r0, =0x06010800 + adds r4, r0 + adds r5, 0xC0 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x2 + bl sub_8075198 + ldr r0, [sp, 0x4] + bl sub_807512C + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8074770 + + thumb_func_start sub_80747D8 +sub_80747D8: @ 80747D8 + push {r4,r5,lr} + sub sp, 0x18 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =gUnknown_085CCB3C + add r0, sp, 0x4 + bl CopyString + ldr r1, =0x0203a04c + ldrb r1, [r1] + movs r2, 0 + movs r3, 0x2 + bl ConvertIntToDecimalString + movs r0, 0 + add r1, sp, 0x4 + movs r2, 0x2F + bl GetStringRightAlignXOffset + adds r1, r0, 0 + add r0, sp, 0x14 + str r0, [sp] + add r0, sp, 0x4 + movs r2, 0x3 + movs r3, 0x2 + bl write_to_rbox + adds r5, r0, 0 + ldr r1, =0x02020630 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + ldrh r4, [r0, 0x4] + lsls r4, 22 + lsrs r4, 17 + ldr r1, =0x060102c0 + adds r0, r4, r1 + adds r1, r5, 0 + movs r2, 0x2 + bl sub_80751E4 + ldr r0, =0x06010a00 + adds r4, r0 + adds r5, 0x40 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x4 + bl sub_80751E4 + ldr r0, [sp, 0x14] + bl sub_807512C + add sp, 0x18 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80747D8 + + thumb_func_start healthbar_draw_field_maybe +healthbar_draw_field_maybe: @ 8074860 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r8, r1 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r2, 24 + lsrs r7, r2, 24 + ldr r1, =0x02020630 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x3A] + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + cmp r7, 0 + bne _0807489C + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _0807489C + mov r0, r9 + bl battle_side_get_owner +_0807489C: + ldr r1, =0x02020630 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x3A] + lsls r0, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080748B8 + b _08074A18 +_080748B8: + cmp r7, 0x3 + beq _080748C0 + cmp r7, 0 + bne _080748D4 +_080748C0: + mov r0, r8 + movs r1, 0x38 + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + bl healthbar_draw_level +_080748D4: + cmp r7, 0x1 + bhi _080748EE + mov r0, r8 + movs r1, 0x39 + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r6, 0 + movs r2, 0 + bl heathbar_draw_hp +_080748EE: + cmp r7, 0x2 + beq _080748F6 + cmp r7, 0 + bne _0807490C +_080748F6: + mov r0, r8 + movs r1, 0x3A + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r6, 0 + movs r2, 0x1 + bl heathbar_draw_hp +_0807490C: + cmp r7, 0x5 + beq _08074914 + cmp r7, 0 + bne _08074948 +_08074914: + movs r0, 0 + bl load_gfxc_health_bar + mov r0, r8 + movs r1, 0x3A + bl pokemon_getattr + adds r4, r0, 0 + mov r0, r8 + movs r1, 0x39 + bl pokemon_getattr + adds r3, r0, 0 + movs r0, 0 + str r0, [sp] + mov r0, r9 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_807294C + mov r0, r9 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0 + bl sub_8074AA0 +_08074948: + bl battle_type_is_double + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + cmp r0, 0 + bne _080749CE + cmp r7, 0x6 + beq _0807495E + cmp r7, 0 + bne _080749CE +_0807495E: + movs r0, 0x3 + bl load_gfxc_health_bar + mov r0, r8 + movs r1, 0xB + bl pokemon_getattr + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + mov r0, r8 + movs r1, 0x38 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + mov r0, r8 + movs r1, 0x19 + bl pokemon_getattr + adds r3, r0, 0 + ldr r0, =gExperienceTables + mov r12, r0 + lsls r1, r4, 2 + ldr r2, =gBaseStats + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r0, r2 + ldrb r2, [r0, 0x13] + movs r0, 0xCA + lsls r0, 1 + muls r0, r2 + adds r1, r0 + add r1, r12 + ldr r1, [r1] + subs r3, r1 + adds r4, 0x1 + lsls r4, 2 + adds r4, r0 + add r4, r12 + ldr r2, [r4] + subs r2, r1 + mov r0, r10 + str r0, [sp] + mov r0, r9 + adds r1, r6, 0 + bl sub_807294C + mov r0, r9 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_8074AA0 +_080749CE: + cmp r7, 0x4 + beq _080749D6 + cmp r7, 0 + bne _080749DE +_080749D6: + adds r0, r6, 0 + mov r1, r8 + bl sub_80741E8 +_080749DE: + cmp r7, 0x9 + beq _080749E6 + cmp r7, 0 + bne _080749EC +_080749E6: + adds r0, r6, 0 + bl draw_status_ailment_maybe +_080749EC: + cmp r7, 0xA + bne _080749F6 + adds r0, r6, 0 + bl sub_8074770 +_080749F6: + adds r0, r7, 0 + subs r0, 0xA + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _08074A8E + adds r0, r6, 0 + bl sub_80747D8 + b _08074A8E + .pool +_08074A18: + cmp r7, 0x3 + beq _08074A20 + cmp r7, 0 + bne _08074A34 +_08074A20: + mov r0, r8 + movs r1, 0x38 + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + bl healthbar_draw_level +_08074A34: + cmp r7, 0x5 + beq _08074A3C + cmp r7, 0 + bne _08074A70 +_08074A3C: + movs r0, 0 + bl load_gfxc_health_bar + mov r0, r8 + movs r1, 0x3A + bl pokemon_getattr + adds r4, r0, 0 + mov r0, r8 + movs r1, 0x39 + bl pokemon_getattr + adds r3, r0, 0 + movs r0, 0 + str r0, [sp] + mov r0, r9 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_807294C + mov r0, r9 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0 + bl sub_8074AA0 +_08074A70: + cmp r7, 0x4 + beq _08074A78 + cmp r7, 0 + bne _08074A80 +_08074A78: + adds r0, r6, 0 + mov r1, r8 + bl sub_80741E8 +_08074A80: + cmp r7, 0x9 + beq _08074A88 + cmp r7, 0 + bne _08074A8E +_08074A88: + adds r0, r6, 0 + bl draw_status_ailment_maybe +_08074A8E: + 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 healthbar_draw_field_maybe + + thumb_func_start sub_8074AA0 +sub_8074AA0: @ 8074AA0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + cmp r2, 0 + bne _08074AEC + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0xC] + mov r1, r8 + lsls r5, r1, 2 + adds r3, r5, r1 + lsls r3, 2 + adds r3, r0 + ldr r0, [r3, 0x4] + ldr r1, [r3, 0x8] + ldr r2, [r3, 0xC] + adds r3, 0x10 + movs r4, 0x6 + str r4, [sp] + movs r4, 0x1 + str r4, [sp, 0x4] + bl sub_8074DB8 + adds r4, r0, 0 + adds r7, r5, 0 + b _08074B48 + .pool +_08074AEC: + ldr r2, =0x020244d0 + mov r10, r2 + ldr r0, [r2] + ldr r2, [r0, 0xC] + mov r0, r8 + lsls r4, r0, 2 + adds r0, r4, r0 + lsls r6, r0, 2 + adds r2, r6, r2 + ldr r0, [r2, 0x8] + ldr r1, [r2, 0xC] + ldr r2, [r2, 0x4] + movs r3, 0x8 + bl sub_8074FE8 + lsls r0, 24 + lsrs r5, r0, 24 + adds r7, r4, 0 + cmp r5, 0 + bne _08074B16 + movs r5, 0x1 +_08074B16: + mov r1, r10 + ldr r0, [r1] + ldr r0, [r0, 0xC] + adds r4, r6, r0 + ldr r6, [r4, 0xC] + adds r0, r6, 0 + adds r1, r5, 0 + bl __divsi3 + cmp r0, 0 + bge _08074B2E + negs r0, r0 +_08074B2E: + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, [r4, 0x4] + ldr r1, [r4, 0x8] + adds r3, r4, 0 + adds r3, 0x10 + movs r2, 0x8 + str r2, [sp] + str r5, [sp, 0x4] + adds r2, r6, 0 + bl sub_8074DB8 + adds r4, r0, 0 +_08074B48: + mov r2, r9 + cmp r2, 0x1 + beq _08074B64 + cmp r2, 0 + bne _08074B6C + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0] + adds r0, r7, r0 + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _08074B6C +_08074B64: + mov r0, r8 + mov r1, r9 + bl sub_8074B9C +_08074B6C: + movs r0, 0x1 + negs r0, r0 + cmp r4, r0 + bne _08074B86 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0, 0xC] + mov r2, r8 + adds r0, r7, r2 + lsls r0, 2 + adds r0, r1 + movs r1, 0 + str r1, [r0, 0x10] +_08074B86: + adds r0, r4, 0 + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8074AA0 + + thumb_func_start sub_8074B9C +sub_8074B9C: @ 8074B9C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0 + beq _08074BB8 + cmp r1, 0x1 + beq _08074CA0 + b _08074D9E +_08074BB8: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0xC] + lsls r5, r6, 2 + adds r3, r5, r6 + lsls r3, 2 + adds r3, r0 + ldr r0, [r3, 0x4] + ldr r1, [r3, 0x8] + ldr r2, [r3, 0xC] + adds r3, 0x10 + add r4, sp, 0x8 + str r4, [sp] + movs r4, 0x6 + str r4, [sp, 0x4] + bl sub_8074E8C + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3 + mov r9, r1 + adds r7, r5, 0 + cmp r0, 0x18 + bhi _08074BF4 + movs r2, 0x38 + mov r9, r2 + cmp r0, 0x9 + bls _08074BF4 + movs r4, 0x2F + mov r9, r4 +_08074BF4: + movs r5, 0 + ldr r0, =0x02020630 + mov r8, r0 +_08074BFA: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0, 0xC] + adds r0, r7, r6 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + ldrh r0, [r0, 0x38] + lsls r0, 24 + lsrs r4, r0, 24 + cmp r5, 0x1 + bhi _08074C5C + mov r0, r9 + bl sub_80728A4 + mov r1, sp + adds r1, r5 + adds r1, 0x8 + ldrb r1, [r1] + lsls r1, 5 + adds r0, r1 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + add r1, r8 + ldrh r1, [r1, 0x4] + lsls r1, 22 + lsrs r1, 22 + adds r2, r5, 0x2 + adds r1, r2 + lsls r1, 5 + ldr r2, =0x06010000 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet + b _08074C8A + .pool +_08074C5C: + mov r0, r9 + bl sub_80728A4 + mov r1, sp + adds r1, r5 + adds r1, 0x8 + ldrb r1, [r1] + lsls r1, 5 + adds r0, r1 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + add r1, r8 + ldrh r1, [r1, 0x4] + lsls r1, 22 + lsrs r1, 22 + adds r1, r5, r1 + lsls r1, 5 + ldr r4, =0x06010040 + adds r1, r4 + ldr r2, =0x04000008 + bl CpuSet +_08074C8A: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _08074BFA + b _08074D9E + .pool +_08074CA0: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0xC] + lsls r5, r6, 2 + adds r3, r5, r6 + lsls r3, 2 + adds r3, r0 + ldr r0, [r3, 0x4] + ldr r1, [r3, 0x8] + ldr r2, [r3, 0xC] + adds r3, 0x10 + add r4, sp, 0x8 + str r4, [sp] + movs r4, 0x8 + str r4, [sp, 0x4] + bl sub_8074E8C + ldr r1, =0x0202406e + lsls r0, r6, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x38 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + adds r7, r5, 0 + cmp r0, 0x64 + bne _08074CF8 + movs r5, 0 + movs r1, 0 +_08074CE6: + mov r0, sp + adds r0, r5 + adds r0, 0x8 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x7 + bls _08074CE6 +_08074CF8: + movs r5, 0 + ldr r0, =0x02020630 + mov r8, r0 + adds r0, r7, r6 + lsls r4, r0, 2 +_08074D02: + cmp r5, 0x3 + bhi _08074D5C + movs r0, 0xC + bl sub_80728A4 + mov r1, sp + adds r1, r5 + adds r1, 0x8 + ldrb r1, [r1] + lsls r1, 5 + adds r0, r1 + ldr r1, =0x020244d0 + ldr r1, [r1] + ldr r1, [r1, 0xC] + adds r1, r4, r1 + ldrb r2, [r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r8 + ldrh r1, [r1, 0x4] + lsls r1, 22 + lsrs r1, 22 + adds r2, r5, 0 + adds r2, 0x24 + adds r1, r2 + lsls r1, 5 + ldr r2, =0x06010000 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet + b _08074D94 + .pool +_08074D5C: + movs r0, 0xC + bl sub_80728A4 + mov r1, sp + adds r1, r5 + adds r1, 0x8 + ldrb r1, [r1] + lsls r1, 5 + adds r0, r1 + ldr r1, =0x020244d0 + ldr r1, [r1] + ldr r1, [r1, 0xC] + adds r1, r4, r1 + ldrb r2, [r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r8 + ldrh r1, [r1, 0x4] + lsls r1, 22 + lsrs r1, 22 + adds r1, r5, r1 + lsls r1, 5 + ldr r2, =0x06010b80 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet +_08074D94: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x7 + bls _08074D02 +_08074D9E: + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8074B9C + + thumb_func_start sub_8074DB8 +sub_8074DB8: @ 8074DB8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + adds r4, r1, 0 + mov r8, r2 + adds r5, r3, 0 + ldr r1, [sp, 0x18] + ldr r0, [sp, 0x1C] + lsls r0, 16 + lsrs r3, r0, 16 + lsls r1, 27 + lsrs r2, r1, 24 + ldr r1, [r5] + ldr r0, =0xffff8000 + cmp r1, r0 + bne _08074DEA + cmp r7, r2 + bge _08074DE8 + lsls r0, r4, 8 + str r0, [r5] + b _08074DEA + .pool +_08074DE8: + str r4, [r5] +_08074DEA: + mov r0, r8 + subs r4, r0 + cmp r4, 0 + bge _08074DF6 + movs r4, 0 + b _08074DFC +_08074DF6: + cmp r4, r7 + ble _08074DFC + adds r4, r7, 0 +_08074DFC: + cmp r7, r2 + bge _08074E18 + ldr r0, [r5] + asrs r1, r0, 8 + adds r6, r0, 0 + cmp r4, r1 + bne _08074E24 + movs r0, 0xFF + ands r0, r6 + cmp r0, 0 + bne _08074E24 + movs r0, 0x1 + negs r0, r0 + b _08074E80 +_08074E18: + ldr r6, [r5] + cmp r4, r6 + bne _08074E24 + movs r0, 0x1 + negs r0, r0 + b _08074E80 +_08074E24: + cmp r7, r2 + bge _08074E5E + lsls r0, r7, 8 + adds r1, r2, 0 + bl __divsi3 + mov r1, r8 + cmp r1, 0 + bge _08074E42 + adds r0, r6, r0 + str r0, [r5] + asrs r2, r0, 8 + cmp r2, r4 + blt _08074E7E + b _08074E56 +_08074E42: + subs r0, r6, r0 + str r0, [r5] + asrs r2, r0, 8 + movs r1, 0xFF + ands r0, r1 + cmp r0, 0 + ble _08074E52 + adds r2, 0x1 +_08074E52: + cmp r2, r4 + bgt _08074E7E +_08074E56: + lsls r0, r4, 8 + str r0, [r5] + adds r2, r4, 0 + b _08074E7E +_08074E5E: + mov r0, r8 + cmp r0, 0 + bge _08074E70 + ldr r0, [r5] + adds r0, r3 + str r0, [r5] + cmp r0, r4 + ble _08074E7C + b _08074E7A +_08074E70: + ldr r0, [r5] + subs r0, r3 + str r0, [r5] + cmp r0, r4 + bge _08074E7C +_08074E7A: + str r4, [r5] +_08074E7C: + ldr r2, [r5] +_08074E7E: + adds r0, r2, 0 +_08074E80: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8074DB8 + + thumb_func_start sub_8074E8C +sub_8074E8C: @ 8074E8C + push {r4-r7,lr} + adds r4, r0, 0 + mov r12, r3 + ldr r7, [sp, 0x14] + ldr r0, [sp, 0x18] + lsls r0, 24 + lsrs r6, r0, 24 + subs r5, r1, r2 + cmp r5, 0 + bge _08074EA4 + movs r5, 0 + b _08074EAA +_08074EA4: + cmp r5, r4 + ble _08074EAA + adds r5, r4, 0 +_08074EAA: + lsls r0, r6, 27 + lsrs r3, r0, 24 + movs r1, 0 + cmp r1, r6 + bcs _08074EC4 + movs r2, 0 +_08074EB6: + adds r0, r7, r1 + strb r2, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, r6 + bcc _08074EB6 +_08074EC4: + cmp r4, r3 + bge _08074ED8 + mov r1, r12 + ldr r0, [r1] + muls r0, r3 + adds r1, r4, 0 + bl __divsi3 + asrs r0, 8 + b _08074EE4 +_08074ED8: + mov r1, r12 + ldr r0, [r1] + muls r0, r3 + adds r1, r4, 0 + bl __divsi3 +_08074EE4: + lsls r0, 24 + lsrs r2, r0, 24 + adds r3, r2, 0 + cmp r3, 0 + bne _08074EFA + cmp r5, 0 + ble _08074EFA + movs r0, 0x1 + strb r0, [r7] + movs r3, 0x1 + b _08074F1E +_08074EFA: + movs r1, 0 + movs r4, 0x8 +_08074EFE: + cmp r1, r6 + bcs _08074F1E + cmp r2, 0x7 + bls _08074F1A + adds r0, r7, r1 + strb r4, [r0] + adds r0, r2, 0 + subs r0, 0x8 + lsls r0, 24 + lsrs r2, r0, 24 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + b _08074EFE +_08074F1A: + adds r0, r7, r1 + strb r2, [r0] +_08074F1E: + adds r0, r3, 0 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8074E8C + + thumb_func_start sub_8074F28 +sub_8074F28: @ 8074F28 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r5, r0, 0 + adds r6, r1, 0 + adds r4, r2, 0 + mov r8, r3 + ldr r0, [r5] + ldr r1, [r5, 0x4] + ldr r2, [r5, 0x8] + movs r3, 0x6 + str r3, [sp] + movs r3, 0x1 + str r3, [sp, 0x4] + adds r3, r6, 0 + bl sub_8074DB8 + lsls r0, 16 + lsrs r7, r0, 16 + adds r0, r5, 0 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_8074F88 + ldr r0, [r5] + cmp r0, 0x2F + bgt _08074F68 + ldr r0, [r6] + lsls r0, 8 + lsrs r1, r0, 16 + b _08074F6A +_08074F68: + ldrh r1, [r6] +_08074F6A: + movs r2, 0 + ldrsh r0, [r5, r2] + lsls r1, 16 + asrs r1, 16 + mov r2, r8 + bl sub_8072304 + lsls r0, r7, 16 + asrs r0, 16 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8074F28 + + thumb_func_start sub_8074F88 +sub_8074F88: @ 8074F88 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x1C + adds r5, r0, 0 + adds r3, r1, 0 + mov r8, r2 + ldr r0, [r5] + ldr r1, [r5, 0x4] + ldr r2, [r5, 0x8] + add r4, sp, 0x8 + str r4, [sp] + movs r4, 0x6 + str r4, [sp, 0x4] + bl sub_8074E8C + movs r3, 0 + add r7, sp, 0x10 + mov r12, r7 + ldrb r0, [r5, 0xC] + lsls r6, r0, 27 + ldr r4, [r5, 0x10] +_08074FB4: + lsls r2, r3, 1 + add r2, r12 + lsrs r1, r6, 15 + mov r0, sp + adds r0, r3 + adds r0, 0x8 + ldrb r0, [r0] + adds r0, r4, r0 + orrs r1, r0 + strh r1, [r2] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x5 + bls _08074FB4 + adds r0, r7, 0 + mov r1, r8 + movs r2, 0x6 + bl CpuSet + add sp, 0x1C + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8074F88 + + thumb_func_start sub_8074FE8 +sub_8074FE8: @ 8074FE8 + push {r4-r7,lr} + adds r6, r2, 0 + lsls r3, 27 + lsrs r7, r3, 24 + subs r5, r0, r1 + cmp r5, 0 + bge _08074FFA + movs r5, 0 + b _08075000 +_08074FFA: + cmp r5, r6 + ble _08075000 + adds r5, r6, 0 +_08075000: + muls r0, r7 + adds r1, r6, 0 + bl __divsi3 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + muls r0, r7 + adds r1, r6, 0 + bl __divsi3 + lsls r4, 24 + asrs r4, 24 + lsls r0, 24 + asrs r0, 24 + subs r0, r4, r0 + cmp r0, 0 + bge _08075028 + negs r0, r0 +_08075028: + lsls r0, 24 + lsrs r0, 24 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8074FE8 + + thumb_func_start sub_8075034 +sub_8075034: @ 8075034 + push {r4,lr} + lsls r2, 24 + lsrs r2, 24 + lsls r0, 16 + asrs r4, r0, 16 + adds r0, r4, 0 + muls r0, r2 + lsls r1, 16 + asrs r1, 16 + bl __divsi3 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08075058 + cmp r4, 0 + ble _08075058 + movs r0, 0x1 +_08075058: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8075034 + + thumb_func_start sub_8075060 +sub_8075060: @ 8075060 + push {lr} + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + cmp r0, r1 + bne _08075072 + movs r0, 0x4 + b _0807508E +_08075072: + movs r2, 0x30 + bl sub_8075034 + lsls r0, 24 + lsrs r1, r0, 24 + movs r0, 0x3 + cmp r1, 0x18 + bhi _0807508E + movs r0, 0x2 + cmp r1, 0x9 + bhi _0807508E + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 +_0807508E: + pop {r1} + bx r1 + thumb_func_end sub_8075060 + + thumb_func_start write_to_rbox +write_to_rbox: @ 8075094 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + mov r10, r0 + mov r8, r1 + mov r9, r2 + adds r5, r3, 0 + ldr r7, [sp, 0x40] + ldr r0, =gUnknown_0832C3F8 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x18] + str r1, [sp, 0x1C] + add r0, sp, 0x18 + bl AddWindow + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r6, r4, 24 + lsrs r6, 24 + lsls r1, r5, 4 + orrs r1, r5 + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + bl FillWindowPixelBuffer + add r0, sp, 0x14 + movs r2, 0 + strb r5, [r0] + adds r1, r0, 0 + movs r0, 0x1 + strb r0, [r1, 0x1] + movs r0, 0x3 + strb r0, [r1, 0x2] + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + str r2, [sp] + str r2, [sp, 0x4] + str r1, [sp, 0x8] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0xC] + mov r0, r10 + str r0, [sp, 0x10] + adds r0, r6, 0 + movs r1, 0 + mov r2, r8 + mov r3, r9 + bl AddTextPrinterParametrized2 + str r4, [r7] + adds r0, r6, 0 + movs r1, 0x7 + bl GetWindowAttribute + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end write_to_rbox + + thumb_func_start sub_807512C +sub_807512C: @ 807512C + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl RemoveWindow + pop {r0} + bx r0 + thumb_func_end sub_807512C + + thumb_func_start sub_807513C +sub_807513C: @ 807513C + push {lr} + sub sp, 0x4 + adds r3, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r1, r0, 8 + adds r0, r1 + lsls r1, r0, 16 + adds r0, r1 + str r0, [sp] + lsls r2, 3 + ldr r0, =0x001fffff + ands r2, r0 + 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 + .pool + thumb_func_end sub_807513C + + thumb_func_start sub_8075170 +sub_8075170: @ 8075170 + push {lr} + adds r3, r0, 0 + adds r0, r1, 0 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + lsls r2, 3 + ldr r1, =0x001fffff + ands r2, r1 + movs r1, 0x80 + lsls r1, 19 + orrs r2, r1 + adds r1, r3, 0 + bl CpuSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_8075170 + + thumb_func_start sub_8075198 +sub_8075198: @ 8075198 + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r1, 0 + adds r4, r2, 0 + movs r1, 0x80 + lsls r1, 1 + adds r0, r5, r1 + adds r1, r6, r1 + lsls r2, r4, 3 + ldr r3, =0x001fffff + ands r2, r3 + movs r3, 0x80 + lsls r3, 19 + orrs r2, r3 + bl CpuSet + cmp r4, 0 + ble _080751D4 +_080751BC: + adds r0, r5, 0 + adds r0, 0x14 + adds r1, r6, 0 + adds r1, 0x14 + ldr r2, =0x04000003 + bl CpuSet + adds r6, 0x20 + adds r5, 0x20 + subs r4, 0x1 + cmp r4, 0 + bne _080751BC +_080751D4: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8075198 + + thumb_func_start sub_80751E4 +sub_80751E4: @ 80751E4 + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r1, 0 + lsls r4, r2, 3 + ldr r0, =0x001fffff + ands r4, r0 + movs r0, 0x80 + lsls r0, 19 + orrs r4, r0 + adds r0, r5, 0 + adds r1, r6, 0 + adds r2, r4, 0 + bl CpuSet + movs r0, 0x80 + lsls r0, 1 + adds r5, r0 + adds r6, r0 + adds r0, r5, 0 + adds r1, r6, 0 + adds r2, r4, 0 + bl CpuSet + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80751E4 + + thumb_func_start sub_807521C +sub_807521C: @ 807521C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 16 + lsrs r7, r1, 16 + lsls r2, 24 + lsrs r4, r2, 24 + ldr r5, =gUnknown_0831C620 + ldrh r0, [r5, 0x6] + bl GetObjectTileRangeStartByTag + lsls r0, 16 + ldr r1, =0xffff0000 + cmp r0, r1 + bne _0807524E + adds r0, r5, 0 + bl LoadCompressedObjectPicUsingHeap + ldr r0, =gUnknown_0831C628 + bl LoadCompressedObjectPaletteUsingHeap +_0807524E: + ldr r0, =sub_8075370 + bl object_new_hidden_with_callback + mov r8, r0 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r5, r0, 4 + add r5, r8 + lsls r5, 2 + ldr r0, =0x02020630 + adds r5, r0 + strh r4, [r5, 0x30] + ldr r0, =gUnknown_0831C688 + mov r9, r0 + lsls r6, 16 + asrs r0, r6, 16 + mov r10, r0 + ldr r0, =0xfff00000 + adds r6, r0 + asrs r6, 16 + lsls r4, r7, 16 + asrs r7, r4, 16 + adds r4, r0 + asrs r4, 16 + mov r0, r9 + adds r1, r6, 0 + adds r2, r4, 0 + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + mov r0, r8 + strh r0, [r1, 0x2E] + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + adds r0, r1, 0 + bl AnimateObject + mov r0, r9 + mov r1, r10 + adds r2, r4, 0 + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + mov r0, r8 + strh r0, [r4, 0x2E] + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectImageAnim + adds r0, r4, 0 + bl AnimateObject + mov r0, r9 + adds r1, r6, 0 + adds r2, r7, 0 + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + mov r0, r8 + strh r0, [r4, 0x2E] + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + adds r0, r4, 0 + movs r1, 0x2 + bl StartObjectImageAnim + adds r0, r4, 0 + bl AnimateObject + mov r0, r9 + mov r1, r10 + adds r2, r7, 0 + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + mov r0, r8 + strh r0, [r4, 0x2E] + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + adds r0, r4, 0 + movs r1, 0x3 + bl StartObjectImageAnim + adds r0, r4, 0 + bl AnimateObject + mov r0, r8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_807521C + + thumb_func_start sub_8075370 +sub_8075370: @ 8075370 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080753A8 + ldr r0, =gUnknown_0831C620 + ldrh r0, [r0, 0x6] + bl FreeObjectTilesByTag + ldr r0, =gUnknown_0831C628 + ldrh r0, [r0, 0x4] + bl FreeObjectPaletteByTag + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080753A4 + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + b _080753A8 + .pool +_080753A4: + ldr r0, =DummyObjectCallback + str r0, [r4, 0x1C] +_080753A8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8075370 + + thumb_func_start sub_80753B4 +sub_80753B4: @ 80753B4 + push {lr} + adds r3, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080753DE + ldr r2, =0x02020630 + movs r0, 0x2E + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x2E] + subs r1, 0x1 + strh r1, [r0, 0x2E] + adds r0, r3, 0 + bl RemoveObjectAndFreeTiles +_080753DE: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80753B4 + + thumb_func_start sub_80753E8 +sub_80753E8: @ 80753E8 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + ldr r1, =0x020244b9 + movs r0, 0x1 + strb r0, [r1] + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r6, =0x02024064 + ldrb r1, [r6] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0] + ldr r0, =sub_8075450 + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0xA] + strh r5, [r1, 0xC] + ldrb r0, [r6] + strh r0, [r1, 0xE] + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80753E8 + + thumb_func_start sub_8075450 +sub_8075450: @ 8075450 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + movs r0, 0 + str r0, [sp] + ldr r1, =0x03005e00 + mov r2, r10 + lsls r0, r2, 2 + add r0, r10 + lsls r0, 3 + adds r1, r0, r1 + ldrh r2, [r1, 0x8] + movs r3, 0x8 + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _08075488 + adds r0, r2, 0x1 + strh r0, [r1, 0x8] + b _08075602 + .pool +_08075488: + ldrh r0, [r1, 0xC] + mov r8, r0 + ldrb r5, [r1, 0xE] + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080754B4 + ldr r1, =0x0202406e + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + b _080754C2 + .pool +_080754B4: + ldr r1, =0x0202406e + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec +_080754C2: + adds r0, r1 + movs r1, 0x26 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + bl ball_number_to_ball_processing_index + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_8076A78 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + ldr r1, =gUnknown_0832C588 + adds r0, r1 + movs r1, 0x20 + movs r2, 0x50 + movs r3, 0x1D + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + ldr r2, =0x02020630 + mov r9, r2 + lsls r0, r7, 4 + adds r0, r7 + lsls r6, r0, 2 + adds r4, r6, r2 + movs r0, 0x80 + strh r0, [r4, 0x2E] + movs r3, 0 + strh r3, [r4, 0x30] + mov r0, r8 + strh r0, [r4, 0x3C] + mov r2, r8 + cmp r2, 0xFE + beq _08075548 + cmp r2, 0xFF + bne _08075584 + ldr r0, =0x0202420c + strb r5, [r0] + movs r0, 0x18 + strh r0, [r4, 0x20] + movs r0, 0x44 + strh r0, [r4, 0x22] + mov r0, r9 + adds r0, 0x1C + adds r0, r6, r0 + ldr r1, =sub_80761B4 + str r1, [r0] + b _08075592 + .pool +_08075548: + adds r0, r5, 0 + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x20] + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x18 + strh r0, [r4, 0x22] + ldr r0, =0x0202420c + strb r5, [r0] + movs r3, 0 + strh r3, [r4, 0x2E] + mov r0, r9 + adds r0, 0x1C + adds r0, r6, r0 + ldr r1, =sub_8076398 + str r1, [r0] + b _08075592 + .pool +_08075584: + movs r0, 0x1 + bl battle_get_side_with_given_state + ldr r1, =0x0202420c + strb r0, [r1] + movs r0, 0x1 + str r0, [sp] +_08075592: + ldr r0, =0x02020630 + lsls r1, r7, 4 + adds r1, r7 + lsls r1, 2 + adds r4, r1, r0 + ldr r5, =0x0202420c + ldrb r0, [r5] + strh r0, [r4, 0x3A] + ldr r2, [sp] + cmp r2, 0 + bne _080755B8 + mov r0, r10 + bl remove_task + b _08075602 + .pool +_080755B8: + movs r0, 0x22 + strh r0, [r4, 0x2E] + ldrb r0, [r5] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x32] + ldrb r0, [r5] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x10 + strh r0, [r4, 0x36] + ldr r0, =0x0000ffd8 + strh r0, [r4, 0x38] + adds r0, r4, 0 + bl sub_80A68D4 + mov r3, r10 + strh r3, [r4, 0x6] + ldr r1, =0x03005e00 + mov r2, r10 + lsls r0, r2, 2 + add r0, r10 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r5] + strh r1, [r0, 0x10] + ldr r1, =nullsub_4 + str r1, [r0] + movs r0, 0x3D + bl audio_play +_08075602: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8075450 + + thumb_func_start objc_0804ABD4 +objc_0804ABD4: @ 8075620 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r7, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _080756C0 + ldrb r6, [r7, 0x6] + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldrb r5, [r0, 0x10] + ldrb r0, [r0, 0xC] + mov r8, r0 + adds r0, r7, 0 + movs r1, 0x1 + bl StartObjectImageAnim + adds r2, r7, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r7, 0x24] + ldrh r1, [r7, 0x20] + adds r0, r1 + movs r1, 0 + strh r0, [r7, 0x20] + ldrh r0, [r7, 0x26] + ldrh r2, [r7, 0x22] + adds r0, r2 + strh r0, [r7, 0x22] + strh r1, [r7, 0x24] + strh r1, [r7, 0x26] + strh r1, [r7, 0x38] + adds r0, r5, 0 + bl sub_8076B14 + lsls r0, 16 + lsrs r0, 16 + bl ball_number_to_ball_processing_index + adds r4, r0, 0 + ldrh r0, [r7, 0x20] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r7, 0x22] + subs r1, 0x5 + lsls r1, 24 + lsrs r1, 24 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp] + movs r2, 0x1 + movs r3, 0x1C + bl sub_8171D98 + movs r0, 0 + adds r1, r5, 0 + movs r2, 0xE + adds r3, r4, 0 + bl sub_81729E8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7, 0x2E] + strh r5, [r7, 0x3A] + mov r0, r8 + strh r0, [r7, 0x3C] + adds r0, r6, 0 + bl remove_task + ldr r0, =sub_80756D4 + str r0, [r7, 0x1C] +_080756C0: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end objc_0804ABD4 + + thumb_func_start sub_80756D4 +sub_80756D4: @ 80756D4 + ldr r1, =sub_80756E0 + str r1, [r0, 0x1C] + bx lr + .pool + thumb_func_end sub_80756D4 + + thumb_func_start sub_80756E0 +sub_80756E0: @ 80756E0 + push {r4-r7,lr} + adds r6, r0, 0 + ldrh r0, [r6, 0x38] + adds r0, 0x1 + movs r7, 0 + strh r0, [r6, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bne _0807573A + strh r7, [r6, 0x38] + ldr r0, =sub_807574C + str r0, [r6, 0x1C] + ldr r5, =0x020241e4 + movs r1, 0x3A + ldrsh r0, [r6, r1] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + movs r1, 0x2 + bl StartObjectRotScalAnim + movs r1, 0x3A + ldrsh r0, [r6, r1] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl AnimateObject + movs r1, 0x3A + ldrsh r0, [r6, r1] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r7, [r0, 0x30] +_0807573A: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80756E0 + + thumb_func_start sub_807574C +sub_807574C: @ 807574C + push {r4-r6,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB + bne _08075764 + movs r0, 0x3C + bl audio_play +_08075764: + ldr r6, =0x02020630 + ldr r5, =0x020241e4 + movs r1, 0x3A + ldrsh r0, [r4, r1] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r6 + adds r0, r1, 0 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _080757BC + adds r0, r4, 0 + movs r1, 0x2 + bl StartObjectImageAnim + movs r2, 0x3A + ldrsh r0, [r4, r2] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + movs r0, 0 + strh r0, [r4, 0x38] + ldr r0, =sub_80757E4 + str r0, [r4, 0x1C] + b _080757DC + .pool +_080757BC: + ldrh r0, [r1, 0x30] + adds r0, 0x60 + strh r0, [r1, 0x30] + movs r1, 0x3A + ldrsh r0, [r4, r1] + adds r0, r5 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + movs r2, 0x30 + ldrsh r0, [r1, r2] + negs r0, r0 + asrs r0, 8 + strh r0, [r1, 0x26] +_080757DC: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_807574C + + thumb_func_start sub_80757E4 +sub_80757E4: @ 80757E4 + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0807582C + ldrh r0, [r4, 0x38] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _0807582C + strh r1, [r4, 0x34] + movs r0, 0x20 + strh r0, [r4, 0x36] + strh r1, [r4, 0x38] + movs r0, 0 + movs r1, 0x20 + bl cosine + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + movs r0, 0x36 + ldrsh r1, [r4, r0] + movs r0, 0 + bl cosine + negs r0, r0 + strh r0, [r4, 0x26] + ldr r0, =sub_8075838 + str r0, [r4, 0x1C] +_0807582C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80757E4 + + thumb_func_start sub_8075838 +sub_8075838: @ 8075838 + push {r4,r5,lr} + adds r4, r0, 0 + movs r5, 0 + ldrh r0, [r4, 0x34] + movs r1, 0xFF + ands r1, r0 + cmp r1, 0 + beq _0807584E + cmp r1, 0x1 + beq _080758C2 + b _080758EE +_0807584E: + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r2, 0x36 + ldrsh r1, [r4, r2] + bl cosine + negs r0, r0 + strh r0, [r4, 0x26] + ldrh r1, [r4, 0x38] + adds r1, 0x4 + ldrh r2, [r4, 0x34] + lsls r0, r2, 16 + asrs r0, 24 + adds r1, r0 + strh r1, [r4, 0x38] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x3F + ble _080758EE + ldrh r0, [r4, 0x36] + subs r0, 0xA + strh r0, [r4, 0x36] + ldr r1, =0x00000101 + adds r0, r2, r1 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 24 + cmp r0, 0x4 + bne _0807588A + movs r5, 0x1 +_0807588A: + cmp r0, 0x2 + beq _080758AA + cmp r0, 0x2 + bgt _0807589C + cmp r0, 0x1 + beq _080758A2 + b _080758BA + .pool +_0807589C: + cmp r0, 0x3 + beq _080758B2 + b _080758BA +_080758A2: + movs r0, 0x38 + bl audio_play + b _080758EE +_080758AA: + movs r0, 0x39 + bl audio_play + b _080758EE +_080758B2: + movs r0, 0x3A + bl audio_play + b _080758EE +_080758BA: + movs r0, 0x3B + bl audio_play + b _080758EE +_080758C2: + movs r2, 0x38 + ldrsh r0, [r4, r2] + movs r2, 0x36 + ldrsh r1, [r4, r2] + bl cosine + negs r0, r0 + strh r0, [r4, 0x26] + ldrh r1, [r4, 0x38] + subs r1, 0x4 + ldrh r2, [r4, 0x34] + lsls r0, r2, 16 + asrs r0, 24 + subs r1, r0 + strh r1, [r4, 0x38] + lsls r1, 16 + cmp r1, 0 + bgt _080758EE + strh r5, [r4, 0x38] + ldr r0, =0xffffff00 + ands r0, r2 + strh r0, [r4, 0x34] +_080758EE: + cmp r5, 0 + beq _08075926 + movs r5, 0 + strh r5, [r4, 0x34] + movs r0, 0x40 + movs r1, 0x20 + bl cosine + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + strh r5, [r4, 0x26] + movs r2, 0x3C + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _0807591C + ldr r0, =sub_8075D14 + str r0, [r4, 0x1C] + b _08075926 + .pool +_0807591C: + ldr r0, =sub_8075930 + str r0, [r4, 0x1C] + movs r0, 0x1 + strh r0, [r4, 0x36] + strh r5, [r4, 0x38] +_08075926: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8075838 + + thumb_func_start sub_8075930 +sub_8075930: @ 8075930 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1F + bne _08075964 + movs r0, 0 + strh r0, [r4, 0x34] + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim + ldr r0, =sub_8075970 + str r0, [r4, 0x1C] + movs r0, 0x17 + bl audio_play +_08075964: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8075930 + + thumb_func_start sub_8075970 +sub_8075970: @ 8075970 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x34] + movs r1, 0xFF + ands r1, r0 + cmp r1, 0x4 + bhi _08075A70 + lsls r0, r1, 2 + ldr r1, =_0807598C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0807598C: + .4byte _080759A0 + .4byte _080759D2 + .4byte _080759A0 + .4byte _08075A26 + .4byte _08075A70 +_080759A0: + ldrh r0, [r4, 0x36] + ldrh r2, [r4, 0x24] + adds r1, r0, r2 + strh r1, [r4, 0x24] + ldrh r1, [r4, 0x38] + adds r0, r1 + strh r0, [r4, 0x38] + adds r2, r4, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + ldrh r0, [r4, 0x38] + adds r0, 0x3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x6 + bls _08075AB6 + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + movs r0, 0 + strh r0, [r4, 0x38] + b _08075AB6 +_080759D2: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _08075A18 + movs r0, 0 + strh r0, [r4, 0x38] + ldrh r0, [r4, 0x36] + negs r0, r0 + strh r0, [r4, 0x36] + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + adds r2, r4, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + movs r2, 0x36 + ldrsh r0, [r4, r2] + cmp r0, 0 + bge _08075A0E + adds r0, r4, 0 + movs r1, 0x2 + bl sub_80082B8 + b _08075AB6 +_08075A0E: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80082B8 + b _08075AB6 +_08075A18: + adds r0, r4, 0 + adds r0, 0x2C + ldrb r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0] + b _08075AB6 +_08075A26: + movs r1, 0x80 + lsls r1, 1 + adds r0, r1, 0 + ldrh r2, [r4, 0x34] + adds r0, r2 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 24 + movs r2, 0x3C + ldrsh r1, [r4, r2] + cmp r0, r1 + bne _08075A48 + ldr r0, =sub_8075D14 + str r0, [r4, 0x1C] + b _08075AB6 + .pool +_08075A48: + cmp r1, 0x4 + bne _08075A5C + cmp r0, 0x3 + bne _08075A5C + ldr r0, =sub_8075FB4 + str r0, [r4, 0x1C] + b _08075A62 + .pool +_08075A5C: + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] +_08075A62: + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + b _08075AB6 +_08075A70: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1F + bne _08075AB6 + movs r0, 0 + strh r0, [r4, 0x38] + ldrh r1, [r4, 0x34] + ldr r0, =0xffffff00 + ands r0, r1 + strh r0, [r4, 0x34] + adds r0, r4, 0 + movs r1, 0x3 + bl StartObjectRotScalAnim + movs r1, 0x36 + ldrsh r0, [r4, r1] + cmp r0, 0 + bge _08075AA8 + adds r0, r4, 0 + movs r1, 0x2 + bl StartObjectRotScalAnim + b _08075AB0 + .pool +_08075AA8: + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim +_08075AB0: + movs r0, 0x17 + bl audio_play +_08075AB6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8075970 + + thumb_func_start c3_0804B070 +c3_0804B070: @ 8075ABC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r2, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r2 + ldrb r1, [r0, 0xC] + mov r12, r1 + ldrb r5, [r0, 0xA] + ldrh r6, [r0, 0x8] + ldrb r3, [r0, 0xE] + mov r8, r3 + ldrb r7, [r0, 0x10] + movs r3, 0x12 + ldrsh r1, [r0, r3] + lsls r3, r1, 16 + ldrh r1, [r0, 0x14] + orrs r3, r1 + movs r1, 0x26 + ldrsh r0, [r0, r1] + cmp r0, 0x20 + bhi _08075B88 + lsls r0, 2 + ldr r1, =_08075B04 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08075B04: + .4byte _08075B88 + .4byte _08075BB4 + .4byte _08075BDA + .4byte _08075C54 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075BF8 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075C66 + .4byte _08075C7E + .4byte _08075CA8 +_08075B88: + ldr r0, =0x02020630 + lsls r1, r7, 4 + adds r1, r7 + lsls r1, 2 + adds r1, r0 + adds r1, 0x3F + ldrb r0, [r1] + lsls r0, 26 + cmp r0, 0 + blt _08075B9E + b _08075D04 +_08075B9E: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r2 + mov r1, r12 + adds r1, 0x1 + strh r1, [r0, 0x26] + b _08075D04 + .pool +_08075BB4: + adds r0, r3, 0 + bl sub_805F110 + cmp r0, 0x1 + bne _08075BCC + lsls r1, r5, 24 + asrs r1, 24 + adds r0, r6, 0 + movs r2, 0 + bl sub_80A32E4 + b _08075C2E +_08075BCC: + lsls r1, r5, 24 + asrs r1, 24 + adds r0, r6, 0 + movs r2, 0xB + bl sub_80A32E4 + b _08075C2E +_08075BDA: + bl sub_80A369C + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0x3 + strh r1, [r0, 0x1C] + movs r1, 0x14 + strh r1, [r0, 0x26] + b _08075D04 + .pool +_08075BF8: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r2 + ldrh r2, [r1, 0x1C] + movs r7, 0x1C + ldrsh r0, [r1, r7] + cmp r0, 0 + bne _08075CBA + adds r0, r3, 0 + bl sub_805F110 + cmp r0, 0x1 + bne _08075C22 + lsls r1, r5, 24 + asrs r1, 24 + adds r0, r6, 0 + movs r2, 0x1 + bl sub_80A3344 + b _08075C2E +_08075C22: + lsls r1, r5, 24 + asrs r1, 24 + adds r0, r6, 0 + movs r2, 0xC + bl sub_80A3344 +_08075C2E: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x4] + mov r2, r8 + lsls r1, r2, 1 + add r1, r8 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r0, 0x41 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + adds r0, r4, 0 + bl remove_task + b _08075D04 + .pool +_08075C54: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r2 + movs r1, 0x6 + strh r1, [r0, 0x1C] + movs r1, 0x1E + strh r1, [r0, 0x26] + b _08075D04 +_08075C66: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r2 + ldrh r2, [r1, 0x1C] + movs r3, 0x1C + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _08075CBA + ldrh r0, [r1, 0x26] + adds r0, 0x1 + strh r0, [r1, 0x26] +_08075C7E: + bl sub_80A36C8 + lsls r0, 24 + cmp r0, 0 + bne _08075D04 + bl sub_80A369C + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0x3 + strh r0, [r1, 0x1C] + ldrh r0, [r1, 0x26] + adds r0, 0x1 + strh r0, [r1, 0x26] + b _08075D04 + .pool +_08075CA8: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r2 + ldrh r2, [r1, 0x1C] + movs r7, 0x1C + ldrsh r0, [r1, r7] + cmp r0, 0 + beq _08075CC0 +_08075CBA: + subs r0, r2, 0x1 + strh r0, [r1, 0x1C] + b _08075D04 +_08075CC0: + adds r0, r3, 0 + bl sub_805F110 + cmp r0, 0x1 + bne _08075CD8 + lsls r1, r5, 24 + asrs r1, 24 + adds r0, r6, 0 + movs r2, 0 + bl sub_80A3344 + b _08075CE4 +_08075CD8: + lsls r1, r5, 24 + asrs r1, 24 + adds r0, r6, 0 + movs r2, 0xB + bl sub_80A3344 +_08075CE4: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x4] + mov r2, r8 + lsls r1, r2, 1 + add r1, r8 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r0, 0x41 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + adds r0, r4, 0 + bl remove_task +_08075D04: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end c3_0804B070 + + thumb_func_start sub_8075D14 +sub_8075D14: @ 8075D14 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r6, r0, 0 + ldrh r0, [r6, 0x3A] + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r6, 0 + movs r1, 0x1 + bl StartObjectImageAnim + adds r0, r5, 0 + bl sub_8076B14 + lsls r0, 16 + lsrs r0, 16 + bl ball_number_to_ball_processing_index + adds r4, r0, 0 + ldrh r0, [r6, 0x20] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6, 0x22] + subs r1, 0x5 + lsls r1, 24 + lsrs r1, 24 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp] + movs r2, 0x1 + movs r3, 0x1C + bl sub_8171D98 + ldrh r1, [r6, 0x3A] + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x1 + movs r2, 0xE + adds r3, r4, 0 + bl sub_81729E8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x2E] + ldr r0, =sub_8075FD4 + str r0, [r6, 0x1C] + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08075D88 + b _08075EF4 +_08075D88: + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08075DC0 + ldr r0, =0x0202406e + lsls r2, r5, 1 + adds r0, r2, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 + adds r7, r1, r0 + movs r4, 0x19 + mov r10, r4 + b _08075DD4 + .pool +_08075DC0: + ldr r0, =0x0202406e + lsls r2, r5, 1 + adds r0, r2, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r7, r1, r0 + movs r0, 0xE7 + mov r10, r0 +_08075DD4: + mov r8, r2 + adds r0, r7, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + movs r0, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + beq _08075E00 + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + bne _08075E56 +_08075E00: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08075E56 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r1, [r0, 0x9] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08075E56 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x42 + ands r0, r1 + cmp r0, 0x42 + bne _08075E4C + bl sub_80A38E4 + lsls r0, 24 + cmp r0, 0 + beq _08075E56 + ldr r0, =0x03007420 + bl MPlayStop_rev01 + b _08075E56 + .pool +_08075E4C: + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x80 + bl MPlayVolumeControl +_08075E56: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08075E70 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r1, [r0, 0x9] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08075E80 +_08075E70: + movs r4, 0 + b _08075EA2 + .pool +_08075E80: + movs r0, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + beq _08075E9C + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + bne _08075EA0 +_08075E9C: + movs r4, 0x1 + b _08075EA2 +_08075EA0: + movs r4, 0x2 +_08075EA2: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x4] + mov r2, r8 + adds r1, r2, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + movs r2, 0x40 + orrs r0, r2 + strb r0, [r1, 0x1] + ldr r0, =c3_0804B070 + movs r1, 0x3 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r3, 0 + mov r0, r9 + strh r0, [r1, 0x8] + mov r2, r10 + lsls r0, r2, 24 + asrs r0, 24 + strh r0, [r1, 0xA] + strh r4, [r1, 0xC] + strh r5, [r1, 0xE] + ldr r2, =0x020241e4 + movs r4, 0x3A + ldrsh r0, [r6, r4] + adds r0, r2 + ldrb r0, [r0] + strh r0, [r1, 0x10] + lsrs r0, r7, 16 + strh r0, [r1, 0x12] + strh r7, [r1, 0x14] + strh r3, [r1, 0x26] +_08075EF4: + ldr r4, =0x020241e4 + movs r1, 0x3A + ldrsh r0, [r6, r1] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, =0x02020630 + adds r0, r5 + movs r1, 0x1 + bl StartObjectRotScalAnim + ldrh r0, [r6, 0x3A] + lsls r0, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08075F50 + movs r2, 0x3A + ldrsh r0, [r6, r2] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r5, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_8039B58 + b _08075F66 + .pool +_08075F50: + movs r1, 0x3A + ldrsh r0, [r6, r1] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r5, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_8039E44 +_08075F66: + str r1, [r0] + ldr r5, =0x020241e4 + movs r2, 0x3A + ldrsh r0, [r6, r2] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl AnimateObject + movs r1, 0x3A + ldrsh r0, [r6, r1] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x80 + lsls r1, 5 + strh r1, [r0, 0x30] + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8075D14 + + thumb_func_start sub_8075FB4 +sub_8075FB4: @ 8075FB4 + adds r3, r0, 0 + adds r3, 0x2C + ldrb r1, [r3] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r3] + ldr r1, =sub_80760F8 + str r1, [r0, 0x1C] + movs r1, 0 + strh r1, [r0, 0x34] + strh r1, [r0, 0x36] + strh r1, [r0, 0x38] + bx lr + .pool + thumb_func_end sub_8075FB4 + + thumb_func_start sub_8075FD4 +sub_8075FD4: @ 8075FD4 + push {r4-r7,lr} + adds r5, r0, 0 + movs r7, 0 + ldrh r0, [r5, 0x3A] + lsls r0, 24 + lsrs r6, r0, 24 + ldr r4, =0x02020630 + ldr r0, =0x020241e4 + adds r3, r6, r0 + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + adds r0, r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08076016 + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_08076016: + ldrb r0, [r3] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + adds r0, r1, 0 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _08076040 + adds r0, r1, 0 + movs r1, 0 + bl StartObjectRotScalAnim + movs r7, 0x1 + b _0807605C + .pool +_08076040: + ldr r2, =0xfffffee0 + adds r0, r2, 0 + ldrh r2, [r1, 0x30] + adds r0, r2 + strh r0, [r1, 0x30] + ldrb r0, [r3] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrh r0, [r1, 0x30] + lsls r0, 16 + asrs r0, 24 + strh r0, [r1, 0x26] +_0807605C: + adds r0, r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080760DE + cmp r7, 0 + beq _080760DE + ldr r2, =0x02020630 + ldr r0, =0x020241e4 + adds r0, r6, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r2, 0 + movs r1, 0 + strh r1, [r0, 0x26] + ldr r0, =0x020244b9 + strb r2, [r0] + ldr r4, =0x020244d0 + ldr r0, [r4] + ldr r0, [r0, 0x4] + lsls r1, r6, 1 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + adds r0, r5, 0 + bl obj_free_rotscale_entry + adds r0, r5, 0 + bl RemoveObjectAndFreeTiles + movs r3, 0 + ldr r0, [r4] + ldr r2, [r0, 0x4] + movs r5, 0x8 + movs r4, 0x3 +_080760B6: + ldrb r1, [r2] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _080760C2 + adds r3, 0x1 +_080760C2: + adds r2, 0xC + subs r4, 0x1 + cmp r4, 0 + bge _080760B6 + cmp r3, 0x4 + bne _080760DE + movs r4, 0 +_080760D0: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8076AE8 + adds r4, 0x1 + cmp r4, 0xB + ble _080760D0 +_080760DE: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8075FD4 + + thumb_func_start sub_80760F8 +sub_80760F8: @ 80760F8 + push {r4-r7,lr} + adds r6, r0, 0 + ldrh r0, [r6, 0x3A] + lsls r0, 24 + lsrs r7, r0, 24 + ldrh r0, [r6, 0x36] + adds r0, 0x1 + strh r0, [r6, 0x36] + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0x28 + beq _08076196 + cmp r1, 0x5F + bne _08076130 + ldr r0, =0x020244b9 + movs r1, 0 + strb r1, [r0] + bl m4aMPlayAllStop + ldr r0, =0x00000173 + bl audio_play + b _08076196 + .pool +_08076130: + ldr r0, =0x0000013b + cmp r1, r0 + bne _08076196 + ldr r5, =0x02020630 + ldr r4, =0x020241e4 + movs r1, 0x3A + ldrsh r0, [r6, r1] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + movs r1, 0x3A + ldrsh r0, [r6, r1] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl RemoveObjectAndFreeTiles + adds r0, r6, 0 + bl RemoveObjectAndFreeResources + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08076196 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x4] + lsls r1, r7, 1 + adds r1, r7 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] +_08076196: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80760F8 + + thumb_func_start sub_80761B4 +sub_80761B4: @ 80761B4 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x19 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x3A] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x3A] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x18 + strh r0, [r4, 0x36] + ldr r0, =0x0000ffe2 + strh r0, [r4, 0x38] + ldrh r0, [r4, 0x3A] + strh r0, [r4, 0x6] + adds r0, r4, 0 + bl sub_80A68D4 + ldr r0, =sub_8076204 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80761B4 + + thumb_func_start sub_8076204 +sub_8076204: @ 8076204 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + ldrh r0, [r5, 0x3C] + movs r1, 0xFF + mov r8, r1 + lsrs r0, 8 + subs r0, 0x23 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2C + bhi _080762F8 + ldrh r1, [r5, 0x6] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + cmp r0, 0 + bne _08076266 + ldrh r0, [r5, 0x30] + movs r1, 0x1 + adds r6, r1, 0 + ands r6, r0 + ldrh r0, [r5, 0x32] + adds r7, r1, 0 + ands r7, r0 + movs r2, 0x30 + ldrsh r0, [r5, r2] + movs r1, 0x3 + bl __divsi3 + movs r1, 0x2 + negs r1, r1 + adds r4, r1, 0 + ands r0, r4 + orrs r6, r0 + strh r6, [r5, 0x30] + movs r2, 0x32 + ldrsh r0, [r5, r2] + movs r1, 0x3 + bl __divsi3 + ands r0, r4 + orrs r7, r0 + strh r7, [r5, 0x32] + adds r0, r5, 0 + movs r1, 0x4 + bl StartObjectRotScalAnim +_08076266: + ldrh r4, [r5, 0x2E] + adds r0, r5, 0 + bl sub_80A6F3C + movs r1, 0x3A + ldrsh r0, [r5, r1] + movs r1, 0x3 + bl __divsi3 + adds r1, r0, 0 + ldrh r0, [r5, 0x3C] + adds r0, r1 + strh r0, [r5, 0x3C] + lsls r0, 16 + asrs r0, 24 + mov r2, r8 + ands r0, r2 + movs r2, 0x38 + ldrsh r1, [r5, r2] + bl sine + ldrh r1, [r5, 0x26] + adds r0, r1 + strh r0, [r5, 0x26] + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + ldrh r1, [r5, 0x6] + adds r0, r1 + strh r0, [r5, 0x6] + lsls r0, 16 + lsrs r0, 24 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + beq _080762B6 + strh r4, [r5, 0x2E] + b _080762BE +_080762B6: + lsls r0, r4, 16 + asrs r0, 16 + subs r0, 0x1 + strh r0, [r5, 0x2E] +_080762BE: + ldrh r0, [r5, 0x3C] + lsrs r0, 8 + cmp r0, 0x4F + ble _08076364 + ldrh r0, [r5, 0x30] + movs r1, 0x1 + adds r6, r1, 0 + ands r6, r0 + ldrh r0, [r5, 0x32] + adds r7, r1, 0 + ands r7, r0 + movs r2, 0x30 + ldrsh r1, [r5, r2] + lsls r0, r1, 1 + adds r0, r1 + movs r1, 0x2 + negs r1, r1 + adds r2, r1, 0 + ands r0, r2 + orrs r0, r6 + strh r0, [r5, 0x30] + movs r0, 0x32 + ldrsh r1, [r5, r0] + lsls r0, r1, 1 + adds r0, r1 + ands r0, r2 + orrs r0, r7 + strh r0, [r5, 0x32] + b _08076364 +_080762F8: + adds r0, r5, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _08076364 + ldrh r0, [r5, 0x24] + ldrh r1, [r5, 0x20] + adds r0, r1 + movs r1, 0 + strh r0, [r5, 0x20] + ldrh r0, [r5, 0x26] + ldrh r2, [r5, 0x22] + adds r0, r2 + strh r0, [r5, 0x22] + strh r1, [r5, 0x26] + strh r1, [r5, 0x24] + ldrb r0, [r5, 0x6] + strh r0, [r5, 0x3A] + strh r1, [r5, 0x2E] + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08076358 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r1, [r0, 0x9] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08076358 + movs r0, 0x3A + ldrsh r4, [r5, r0] + movs r0, 0x2 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _08076358 + ldr r0, =sub_8076374 + b _0807635A + .pool +_08076358: + ldr r0, =sub_8075D14 +_0807635A: + str r0, [r5, 0x1C] + adds r0, r5, 0 + movs r1, 0 + bl StartObjectRotScalAnim +_08076364: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8076204 + + thumb_func_start sub_8076374 +sub_8076374: @ 8076374 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x2E] + adds r1, r0, 0x1 + strh r1, [r2, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x18 + ble _0807638E + movs r0, 0 + strh r0, [r2, 0x2E] + ldr r0, =sub_8075D14 + str r0, [r2, 0x1C] +_0807638E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8076374 + + thumb_func_start sub_8076398 +sub_8076398: @ 8076398 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + ble _080763EC + movs r0, 0 + strh r0, [r5, 0x2E] + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _080763E8 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r1, [r0, 0x9] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080763E8 + movs r0, 0x3A + ldrsh r4, [r5, r0] + movs r0, 0x3 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _080763E8 + ldr r0, =sub_8076374 + b _080763EA + .pool +_080763E8: + ldr r0, =sub_8075D14 +_080763EA: + str r0, [r5, 0x1C] +_080763EC: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8076398 + + thumb_func_start sub_80763F8 +sub_80763F8: @ 80763F8 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + movs r4, 0 + str r4, [sp] + bl sub_8171D98 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80763F8 + + thumb_func_start sub_8076420 +sub_8076420: @ 8076420 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + movs r3, 0 + bl sub_81729E8 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_8076420 + + thumb_func_start sub_8076438 +sub_8076438: @ 8076438 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r5, r0, 0 + mov r9, r2 + mov r10, r3 + ldr r6, [sp, 0x28] + ldr r4, [sp, 0x2C] + ldr r0, [sp, 0x30] + ldr r2, [sp, 0x38] + lsls r5, 24 + lsrs r5, 24 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + mov r1, r9 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + lsls r3, 24 + lsrs r3, 24 + mov r10, r3 + lsls r6, 24 + lsrs r6, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + lsls r0, r2, 16 + lsrs r7, r0, 16 + ldr r0, =gUnknown_0832C400 + bl LoadCompressedObjectPicUsingHeap + ldr r0, =gUnknown_0832C460 + bl LoadCompressedObjectPaletteUsingHeap + ldr r0, =gUnknown_0832C588 + mov r1, r9 + mov r2, r10 + adds r3, r4, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02020630 + mov r8, r1 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + adds r2, r4, r1 + strh r5, [r2, 0x2E] + lsls r1, r5, 4 + adds r1, r5 + lsls r1, 2 + add r1, r8 + ldrh r0, [r1, 0x20] + strh r0, [r2, 0x38] + ldrh r0, [r1, 0x22] + strh r0, [r2, 0x3A] + mov r3, r9 + strh r3, [r1, 0x20] + mov r0, r10 + strh r0, [r1, 0x22] + strh r7, [r1, 0x3C] + mov r3, sp + ldrh r3, [r3, 0x4] + strh r3, [r2, 0x30] + mov r0, sp + ldrh r0, [r0] + strh r0, [r2, 0x32] + mov r3, sp + ldrh r3, [r3, 0x34] + strh r3, [r2, 0x34] + ldr r3, [sp, 0x34] + lsrs r0, r3, 16 + strh r0, [r2, 0x36] + movs r0, 0x3 + ands r6, r0 + lsls r6, 2 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r6 + strb r0, [r2, 0x5] + movs r0, 0x1C + add r8, r0 + add r4, r8 + ldr r0, =sub_8076524 + str r0, [r4] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + 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 + .pool + thumb_func_end sub_8076438 + + thumb_func_start sub_8076524 +sub_8076524: @ 8076524 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + ldrh r1, [r6, 0x30] + movs r2, 0x30 + ldrsh r0, [r6, r2] + cmp r0, 0 + bne _080765D0 + ldrh r0, [r6, 0x2E] + lsls r0, 24 + lsrs r7, r0, 24 + ldrh r0, [r6, 0x32] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldrh r4, [r6, 0x34] + ldrh r0, [r6, 0x36] + lsls r0, 16 + orrs r4, r0 + adds r0, r6, 0 + adds r0, 0x43 + ldrb r0, [r0] + cmp r0, 0 + beq _0807655E + subs r0, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + b _08076560 +_0807655E: + movs r5, 0 +_08076560: + adds r0, r6, 0 + movs r1, 0x1 + bl StartObjectImageAnim + ldrh r0, [r6, 0x20] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6, 0x22] + subs r1, 0x5 + lsls r1, 24 + lsrs r1, 24 + ldrb r2, [r6, 0x5] + lsls r2, 28 + lsrs r2, 30 + adds r3, r5, 0 + bl sub_80763F8 + movs r0, 0x1 + mov r1, r8 + adds r2, r4, 0 + bl sub_8076420 + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + strh r0, [r6, 0x30] + ldr r0, =sub_80765E0 + str r0, [r6, 0x1C] + ldr r0, =0x02020630 + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + adds r4, r0 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim + adds r0, r4, 0 + bl AnimateObject + movs r0, 0x80 + lsls r0, 5 + strh r0, [r4, 0x30] + strh r5, [r6, 0x3C] + b _080765D4 + .pool +_080765D0: + subs r0, r1, 0x1 + strh r0, [r6, 0x30] +_080765D4: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8076524 + + thumb_func_start sub_80765E0 +sub_80765E0: @ 80765E0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r4, r0, 0 + movs r0, 0 + mov r12, r0 + movs r7, 0 + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08076610 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_08076610: + ldr r1, =0x02020630 + lsls r2, r6, 4 + adds r0, r2, r6 + lsls r0, 2 + adds r5, r0, r1 + adds r0, r5, 0 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 26 + mov r8, r2 + cmp r0, 0 + bge _08076634 + adds r0, r5, 0 + movs r1, 0 + bl StartObjectRotScalAnim + movs r1, 0x1 + mov r12, r1 +_08076634: + movs r2, 0x38 + ldrsh r0, [r4, r2] + movs r3, 0x20 + ldrsh r1, [r4, r3] + subs r0, r1 + movs r1, 0x3C + ldrsh r2, [r4, r1] + muls r0, r2 + cmp r0, 0 + bge _0807664A + adds r0, 0x7F +_0807664A: + asrs r0, 7 + ldrh r3, [r4, 0x20] + adds r0, r3 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + movs r1, 0x3A + ldrsh r0, [r4, r1] + movs r3, 0x22 + ldrsh r1, [r4, r3] + subs r0, r1 + muls r0, r2 + cmp r0, 0 + bge _08076668 + adds r0, 0x7F +_08076668: + asrs r0, 7 + ldrh r1, [r4, 0x22] + adds r0, r1 + mov r2, r9 + strh r2, [r5, 0x20] + strh r0, [r5, 0x22] + ldrh r2, [r4, 0x3C] + movs r3, 0x3C + ldrsh r0, [r4, r3] + cmp r0, 0x7F + bgt _080766AC + ldr r1, =gUnknown_08329F40 + lsls r0, r2, 24 + lsrs r0, 23 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _08076690 + adds r0, 0x7 +_08076690: + asrs r0, 3 + negs r0, r0 + lsls r0, 16 + lsrs r0, 16 + adds r1, r2, 0x4 + strh r1, [r4, 0x3C] + strh r0, [r5, 0x24] + strh r0, [r5, 0x26] + b _080766BA + .pool +_080766AC: + ldrh r0, [r4, 0x38] + strh r0, [r5, 0x20] + ldrh r0, [r4, 0x3A] + strh r0, [r5, 0x22] + strh r7, [r5, 0x24] + strh r7, [r5, 0x26] + movs r7, 0x1 +_080766BA: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0807670E + mov r2, r12 + cmp r2, 0 + beq _0807670E + cmp r7, 0 + beq _0807670E + ldr r1, =0x02020630 + mov r3, r8 + adds r0, r3, r6 + lsls r0, 2 + adds r2, r0, r1 + movs r0, 0x3C + ldrsh r1, [r2, r0] + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + bne _080766FC + ldrh r1, [r2, 0x3C] + adds r0, r2, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_806ED40 + b _08076708 + .pool +_080766FC: + ldrh r1, [r2, 0x3C] + adds r0, r2, 0 + movs r2, 0 + movs r3, 0 + bl sub_806ED40 +_08076708: + adds r0, r4, 0 + bl RemoveObjectAndFreeResources +_0807670E: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80765E0 + + thumb_func_start sub_807671C +sub_807671C: @ 807671C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r10, r0 + adds r6, r2, 0 + mov r8, r3 + ldr r5, [sp, 0x20] + ldr r4, [sp, 0x24] + ldr r0, [sp, 0x28] + mov r9, r0 + mov r0, r10 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r6, 24 + lsrs r6, 24 + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r5, 24 + lsrs r5, 24 + lsls r4, 24 + lsrs r4, 24 + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r0, =gUnknown_0832C400 + bl LoadCompressedObjectPicUsingHeap + ldr r0, =gUnknown_0832C460 + bl LoadCompressedObjectPaletteUsingHeap + ldr r0, =gUnknown_0832C588 + adds r1, r6, 0 + mov r2, r8 + adds r3, r4, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r6, =0x02020630 + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + adds r2, r3, r6 + mov r1, r10 + strh r1, [r2, 0x2E] + mov r4, r9 + strh r4, [r2, 0x30] + strh r7, [r2, 0x32] + mov r1, sp + ldrh r1, [r1, 0x2C] + strh r1, [r2, 0x34] + ldr r4, [sp, 0x2C] + lsrs r1, r4, 16 + strh r1, [r2, 0x36] + movs r1, 0x3 + ands r5, r1 + lsls r5, 2 + ldrb r4, [r2, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r4 + orrs r1, r5 + strb r1, [r2, 0x5] + adds r6, 0x1C + adds r3, r6 + ldr r1, =sub_80767D4 + str r1, [r3] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_807671C + + thumb_func_start sub_80767D4 +sub_80767D4: @ 80767D4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + ldrh r1, [r4, 0x30] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _0807686C + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r7, r0, 24 + ldrh r0, [r4, 0x32] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldrh r5, [r4, 0x34] + ldrh r0, [r4, 0x36] + lsls r0, 16 + orrs r5, r0 + adds r0, r4, 0 + adds r0, 0x43 + ldrb r0, [r0] + cmp r0, 0 + beq _0807680E + subs r0, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + b _08076810 +_0807680E: + movs r6, 0 +_08076810: + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectImageAnim + ldrh r0, [r4, 0x20] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x22] + subs r1, 0x5 + lsls r1, 24 + lsrs r1, 24 + ldrb r2, [r4, 0x5] + lsls r2, 28 + lsrs r2, 30 + adds r3, r6, 0 + bl sub_80763F8 + movs r0, 0x1 + mov r1, r8 + adds r2, r5, 0 + bl sub_8076420 + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + strh r0, [r4, 0x30] + ldr r0, =sub_807687C + str r0, [r4, 0x1C] + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x2 + bl StartObjectRotScalAnim + adds r0, r4, 0 + bl AnimateObject + strh r5, [r4, 0x30] + b _08076870 + .pool +_0807686C: + subs r0, r1, 0x1 + strh r0, [r4, 0x30] +_08076870: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80767D4 + + thumb_func_start sub_807687C +sub_807687C: @ 807687C + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0x38] + adds r0, 0x1 + strh r0, [r5, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB + bne _08076894 + movs r0, 0x3C + bl audio_play +_08076894: + ldrh r1, [r5, 0x2E] + lsls r1, 24 + lsrs r1, 24 + ldr r2, =0x02020630 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, r0, r2 + adds r0, r4, 0 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _080768D8 + adds r0, r5, 0 + movs r1, 0x2 + bl StartObjectImageAnim + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + movs r0, 0 + strh r0, [r5, 0x38] + ldr r0, =sub_80768F0 + str r0, [r5, 0x1C] + b _080768E8 + .pool +_080768D8: + ldrh r0, [r4, 0x30] + adds r0, 0x60 + strh r0, [r4, 0x30] + movs r1, 0x30 + ldrsh r0, [r4, r1] + negs r0, r0 + asrs r0, 8 + strh r0, [r4, 0x26] +_080768E8: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_807687C + + thumb_func_start sub_80768F0 +sub_80768F0: @ 80768F0 + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08076904 + ldr r0, =DummyObjectCallback + str r0, [r2, 0x1C] +_08076904: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80768F0 + + thumb_func_start obj_delete_and_free_associated_resources_ +obj_delete_and_free_associated_resources_: @ 807690C + push {lr} + bl RemoveObjectAndFreeResources + pop {r0} + bx r0 + thumb_func_end obj_delete_and_free_associated_resources_ + + thumb_func_start sub_8076918 +sub_8076918: @ 8076918 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r0, =0x03005d70 + adds r0, r5, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r6, =0x02020630 + adds r4, r0, r6 + movs r1, 0 + movs r0, 0x5 + strh r0, [r4, 0x2E] + strh r1, [r4, 0x30] + movs r0, 0x73 + strh r0, [r4, 0x24] + strh r1, [r4, 0x26] + ldr r0, =sub_80769CC + str r0, [r4, 0x1C] + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08076966 + ldrh r0, [r4, 0x2E] + negs r0, r0 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x30] + negs r0, r0 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x24] + negs r0, r0 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x26] + negs r0, r0 + strh r0, [r4, 0x26] +_08076966: + movs r0, 0x38 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r6, 0 + adds r1, 0x1C + adds r1, r0, r1 + adds r0, r6 + ldr r1, [r1] + bl _call_via_r1 + adds r0, r5, 0 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08076990 + ldr r0, =sub_80769A8 + str r0, [r4, 0x1C] +_08076990: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8076918 + + thumb_func_start sub_80769A8 +sub_80769A8: @ 80769A8 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x30] + adds r0, 0x1 + strh r0, [r1, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + bne _080769C2 + movs r0, 0 + strh r0, [r1, 0x30] + ldr r0, =sub_80769CC + str r0, [r1, 0x1C] +_080769C2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80769A8 + + thumb_func_start sub_80769CC +sub_80769CC: @ 80769CC + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x24] + ldrh r1, [r2, 0x2E] + subs r0, r1 + strh r0, [r2, 0x24] + ldrh r0, [r2, 0x26] + ldrh r1, [r2, 0x30] + subs r0, r1 + strh r0, [r2, 0x26] + ldr r0, [r2, 0x24] + cmp r0, 0 + bne _080769EA + ldr r0, =DummyObjectCallback + str r0, [r2, 0x1C] +_080769EA: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80769CC + + thumb_func_start sub_80769F4 +sub_80769F4: @ 80769F4 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =oamc_804BEB4 + adds r0, r5, 0 + bl object_new_hidden_with_callback + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r3, r1, r2 + movs r0, 0x1 + strh r0, [r3, 0x2E] + ldr r0, =0x03005d70 + adds r4, r0 + ldrb r0, [r4] + strh r0, [r3, 0x30] + adds r2, 0x1C + adds r1, r2 + str r5, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80769F4 + + thumb_func_start oamc_804BEB4 +oamc_804BEB4: @ 8076A38 + push {lr} + adds r3, r0, 0 + ldrh r1, [r3, 0x30] + lsls r1, 24 + lsrs r1, 24 + ldr r2, =0x02020630 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + ldrh r0, [r3, 0x2E] + movs r2, 0 + strh r0, [r1, 0x26] + ldrh r0, [r3, 0x2E] + negs r0, r0 + strh r0, [r3, 0x2E] + ldrh r0, [r3, 0x32] + adds r0, 0x1 + strh r0, [r3, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x15 + bne _08076A70 + strh r2, [r1, 0x24] + strh r2, [r1, 0x26] + adds r0, r3, 0 + bl RemoveObjectAndFreeTiles +_08076A70: + pop {r0} + bx r0 + .pool + thumb_func_end oamc_804BEB4 + + thumb_func_start sub_8076A78 +sub_8076A78: @ 8076A78 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gUnknown_0832C400 + lsls r6, r4, 3 + adds r5, r6, r0 + ldrh r0, [r5, 0x6] + bl GetObjectTileRangeStartByTag + lsls r0, 16 + ldr r1, =0xffff0000 + cmp r0, r1 + bne _08076AA0 + adds r0, r5, 0 + bl LoadCompressedObjectPicUsingHeap + ldr r0, =gUnknown_0832C460 + adds r0, r6, r0 + bl LoadCompressedObjectPaletteUsingHeap +_08076AA0: + cmp r4, 0x6 + beq _08076ACC + cmp r4, 0x6 + blt _08076AB0 + cmp r4, 0xB + bgt _08076AB0 + cmp r4, 0xA + bge _08076ACC +_08076AB0: + ldr r1, =gUnknown_0832C400 + lsls r0, r4, 3 + adds r0, r1 + ldrh r0, [r0, 0x6] + bl GetObjectTileRangeStartByTag + adds r1, r0, 0 + lsls r1, 16 + ldr r0, =gUnknown_08C02300 + lsrs r1, 11 + ldr r2, =0x06010100 + adds r1, r2 + bl LZDecompressVram +_08076ACC: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8076A78 + + thumb_func_start sub_8076AE8 +sub_8076AE8: @ 8076AE8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + ldr r0, =gUnknown_0832C400 + lsrs r4, 21 + adds r0, r4, r0 + ldrh r0, [r0, 0x6] + bl FreeObjectTilesByTag + ldr r0, =gUnknown_0832C460 + adds r4, r0 + ldrh r0, [r4, 0x4] + bl FreeObjectPaletteByTag + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8076AE8 + + thumb_func_start sub_8076B14 +sub_8076B14: @ 8076B14 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08076B40 + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + b _08076B4E + .pool +_08076B40: + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec +_08076B4E: + adds r0, r1 + movs r1, 0x26 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8076B14 + + thumb_func_start CheckForFlashMemory +@ void CheckForFlashMemory() +CheckForFlashMemory: @ 8076B68 + push {lr} + bl IdentifyFlash + lsls r0, 16 + cmp r0, 0 + bne _08076B84 + ldr r1, =0x03005d88 + movs r0, 0x1 + str r0, [r1] + bl StartFlashMemoryTimer + b _08076B8A + .pool +_08076B84: + ldr r1, =0x03005d88 + movs r0, 0 + str r0, [r1] +_08076B8A: + pop {r0} + bx r0 + .pool + thumb_func_end CheckForFlashMemory + + thumb_func_start memclr_stdsav2 +memclr_stdsav2: @ 8076B94 + push {lr} + sub sp, 0x4 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, =0x02024a54 + ldr r2, =0x010007d6 + mov r0, sp + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end memclr_stdsav2 + + thumb_func_start clear_sav1 +clear_sav1: @ 8076BB8 + push {lr} + sub sp, 0x4 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, =0x02025a00 + ldr r2, =0x01001f04 + mov r0, sp + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end clear_sav1 + + thumb_func_start InitSaveBlockPointersWithRandomOffset +@ void InitSaveBlockPointersWithRandomOffset(u8 offset) +InitSaveBlockPointersWithRandomOffset: @ 8076BDC + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r5, =0x03005d8c + bl GenerateRandomNumber + adds r4, r0 + movs r0, 0x7C + ands r4, r0 + ldr r1, =0x03005d90 + ldr r0, =0x02024a54 + adds r0, r4, r0 + str r0, [r1] + ldr r0, =0x02025a00 + adds r0, r4, r0 + str r0, [r5] + ldr r1, =0x03005d94 + ldr r0, =0x02029808 + adds r4, r0 + str r4, [r1] + bl init_bag_pockets + bl sub_81617F4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end InitSaveBlockPointersWithRandomOffset + + thumb_func_start saveblock_randomize_and_relocate +saveblock_randomize_and_relocate: @ 8076C2C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + ldr r5, =0x030022c0 + ldr r0, [r5, 0xC] + str r0, [sp] + ldr r1, [r5, 0x10] + str r1, [sp, 0x4] + movs r0, 0 + str r0, [r5, 0xC] + str r0, [r5, 0x10] + ldr r1, =0x0203cf5c + str r0, [r1] + ldr r4, =0x02000000 + ldr r0, =0x03005d90 + ldr r1, [r0] + ldr r6, =0x00000f2c + adds r0, r4, 0 + adds r2, r6, 0 + bl memcpy + ldr r1, =0x03005d8c + mov r10, r1 + ldr r1, [r1] + ldr r7, =0x00003d88 + ldr r0, =0x02000f2c + adds r2, r7, 0 + bl memcpy + ldr r0, =0x03005d94 + mov r8, r0 + ldr r1, [r0] + ldr r0, =0x000083d0 + mov r9, r0 + ldr r0, =0x02004cb4 + mov r2, r9 + bl memcpy + ldrb r1, [r4, 0xA] + ldrb r0, [r4, 0xB] + adds r1, r0 + ldrb r0, [r4, 0xC] + adds r1, r0 + ldrb r0, [r4, 0xD] + adds r0, r1 + bl InitSaveBlockPointersWithRandomOffset + ldr r1, =0x03005d90 + ldr r0, [r1] + adds r1, r4, 0 + adds r2, r6, 0 + bl memcpy + mov r1, r10 + ldr r0, [r1] + ldr r1, =0x02000f2c + adds r2, r7, 0 + bl memcpy + mov r1, r8 + ldr r0, [r1] + ldr r1, =0x02004cb4 + mov r2, r9 + bl memcpy + movs r1, 0xE0 + lsls r1, 9 + adds r0, r4, 0 + bl InitHeap + ldr r0, [sp, 0x4] + str r0, [r5, 0x10] + ldr r1, [sp] + str r1, [r5, 0xC] + bl GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsls r0, 16 + lsrs r0, 16 + adds r4, r0 + adds r0, r4, 0 + bl saveblock_apply_crypto + ldr r1, =0x03005d90 + ldr r0, [r1] + adds r0, 0xAC + str r4, [r0] + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end saveblock_randomize_and_relocate + + thumb_func_start sav2_x1_query_bit1 +sav2_x1_query_bit1: @ 8076D24 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r1, [r0, 0x9] + movs r0, 0x1 + ands r0, r1 + bx lr + .pool + thumb_func_end sav2_x1_query_bit1 + + thumb_func_start sav2_x9_clear_bit1 +sav2_x9_clear_bit1: @ 8076D34 + ldr r0, =0x03005d90 + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0xFE + ands r0, r1 + strb r0, [r2, 0x9] + bx lr + .pool + thumb_func_end sav2_x9_clear_bit1 + + thumb_func_start sub_8076D48 +sub_8076D48: @ 8076D48 + ldr r0, =0x03005d90 + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0x1 + orrs r0, r1 + strb r0, [r2, 0x9] + bx lr + .pool + thumb_func_end sub_8076D48 + + thumb_func_start sub_8076D5C +sub_8076D5C: @ 8076D5C + push {lr} + movs r0, 0 + bl sub_8084FAC + ldr r0, =0x03005d90 + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0x1 + orrs r0, r1 + strb r0, [r2, 0x9] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8076D5C + + thumb_func_start sav2_gender2_inplace_and_xFE +sav2_gender2_inplace_and_xFE: @ 8076D78 + ldr r0, =0x03005d90 + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0xFE + ands r0, r1 + strb r0, [r2, 0x9] + bx lr + .pool + thumb_func_end sav2_gender2_inplace_and_xFE + + thumb_func_start copy_player_party_to_sav1 +@ void copy_player_party_to_sav1() +copy_player_party_to_sav1: @ 8076D8C + push {r4,lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x020244e9 + ldrb r1, [r1] + movs r2, 0x8D + lsls r2, 2 + adds r0, r2 + strb r1, [r0] + movs r4, 0 +_08076DA0: + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r1, 0x64 + muls r1, r4 + adds r0, r1 + movs r2, 0x8E + lsls r2, 2 + adds r0, r2 + ldr r2, =0x020244ec + adds r1, r2 + movs r2, 0x64 + bl memcpy + adds r4, 0x1 + cmp r4, 0x5 + ble _08076DA0 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end copy_player_party_to_sav1 + + thumb_func_start copy_player_party_from_sav1 +copy_player_party_from_sav1: @ 8076DD4 + push {r4,r5,lr} + ldr r1, =0x020244e9 + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r2, 0x8D + lsls r2, 2 + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + movs r4, 0 + ldr r5, =0x020244ec +_08076DEA: + movs r0, 0x64 + adds r2, r4, 0 + muls r2, r0 + adds r0, r2, r5 + ldr r1, =0x03005d8c + ldr r1, [r1] + adds r1, r2 + movs r2, 0x8E + lsls r2, 2 + adds r1, r2 + movs r2, 0x64 + bl memcpy + adds r4, 0x1 + cmp r4, 0x5 + ble _08076DEA + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end copy_player_party_from_sav1 + + thumb_func_start save_serialize_npcs +save_serialize_npcs: @ 8076E1C + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =0x03005d8c + mov r12, r0 + movs r5, 0xA3 + lsls r5, 4 + mov r8, r5 + ldr r4, =0x02037350 + movs r3, 0 + movs r2, 0xF +_08076E32: + 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} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r4, 0x24 + adds r3, 0x24 + subs r2, 0x1 + cmp r2, 0 + bge _08076E32 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end save_serialize_npcs + + thumb_func_start save_deserialize_npcs +save_deserialize_npcs: @ 8076E64 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =0x03005d8c + mov r12, r0 + movs r5, 0xA3 + lsls r5, 4 + mov r8, r5 + ldr r4, =0x02037350 + movs r3, 0 + movs r2, 0xF +_08076E7A: + mov r6, r12 + ldr r1, [r6] + adds r1, r3 + adds r0, r4, 0 + add r1, r8 + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + adds r4, 0x24 + adds r3, 0x24 + subs r2, 0x1 + cmp r2, 0 + bge _08076E7A + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end save_deserialize_npcs + + thumb_func_start save_serialize_game +save_serialize_game: @ 8076EAC + push {lr} + bl copy_player_party_to_sav1 + bl save_serialize_npcs + pop {r0} + bx r0 + thumb_func_end save_serialize_game + + thumb_func_start save_deserialize_game +save_deserialize_game: @ 8076EBC + push {lr} + bl copy_player_party_from_sav1 + bl save_deserialize_npcs + pop {r0} + bx r0 + thumb_func_end save_deserialize_game + + thumb_func_start copy_bags_and_unk_data_from_save_blocks +copy_bags_and_unk_data_from_save_blocks: @ 8076ECC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r2, 0 + ldr r0, =0x02032180 + mov r12, r0 + ldr r1, =0x03005d90 + mov r10, r1 + ldr r5, =0x03005d8c + movs r3, 0xAC + lsls r3, 3 + ldr r4, =0x02031c58 +_08076EE8: + lsls r0, r2, 2 + ldr r1, [r5] + adds r1, r3 + adds r1, r0 + ldr r0, [r1] + stm r4!, {r0} + adds r2, 0x1 + cmp r2, 0x1D + ble _08076EE8 + movs r2, 0 + ldr r0, =0x02031c58 + ldr r5, =0x03005d8c + movs r3, 0xBB + lsls r3, 3 + adds r4, r0, 0 + adds r4, 0x78 +_08076F08: + lsls r0, r2, 2 + ldr r1, [r5] + adds r1, r3 + adds r1, r0 + ldr r0, [r1] + stm r4!, {r0} + adds r2, 0x1 + cmp r2, 0x1D + ble _08076F08 + movs r2, 0 + ldr r0, =0x02031c58 + ldr r5, =0x03005d8c + movs r3, 0xCA + lsls r3, 3 + adds r4, r0, 0 + adds r4, 0xF0 +_08076F28: + lsls r0, r2, 2 + ldr r1, [r5] + adds r1, r3 + adds r1, r0 + ldr r0, [r1] + stm r4!, {r0} + adds r2, 0x1 + cmp r2, 0xF + ble _08076F28 + movs r2, 0 + ldr r0, =0x02031c58 + ldr r5, =0x03005d8c + movs r6, 0x98 + lsls r6, 1 + adds r4, r0, r6 + movs r3, 0xD2 + lsls r3, 3 +_08076F4A: + lsls r0, r2, 2 + ldr r1, [r5] + adds r1, r3 + adds r1, r0 + ldr r0, [r1] + stm r4!, {r0} + adds r2, 0x1 + cmp r2, 0x3F + ble _08076F4A + movs r2, 0 + ldr r0, =0x02031c58 + ldr r5, =0x03005d8c + movs r7, 0x8C + lsls r7, 2 + adds r4, r0, r7 + movs r3, 0xF2 + lsls r3, 3 +_08076F6C: + lsls r0, r2, 2 + ldr r1, [r5] + adds r1, r3 + adds r1, r0 + ldr r0, [r1] + stm r4!, {r0} + adds r2, 0x1 + cmp r2, 0x2D + ble _08076F6C + ldr r0, =0x02031c58 + ldr r1, =0x03005d8c + mov r8, r1 + movs r5, 0xBA + lsls r5, 2 + adds r4, r0, r5 + movs r3, 0 + ldr r6, =0x00002be0 + mov r9, r6 + movs r2, 0xF +_08076F92: + mov r7, r8 + ldr r1, [r7] + adds r1, r3 + adds r0, r4, 0 + add r1, r9 + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + adds r4, 0x24 + adds r3, 0x24 + subs r2, 0x1 + cmp r2, 0 + bge _08076F92 + mov r1, r10 + ldr r0, [r1] + adds r0, 0xAC + ldr r0, [r0] + mov r5, r12 + str r0, [r5] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end copy_bags_and_unk_data_from_save_blocks + + thumb_func_start copy_bags_and_unk_data_to_save_blocks +copy_bags_and_unk_data_to_save_blocks: @ 8076FE0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r2, 0 + ldr r0, =0x03005d90 + mov r8, r0 + ldr r1, =0x02032180 + mov r12, r1 + ldr r5, =0x03005d8c + movs r3, 0xAC + lsls r3, 3 + ldr r4, =0x02031c58 +_08076FFC: + ldr r0, [r5] + lsls r1, r2, 2 + adds r0, r3 + adds r0, r1 + ldm r4!, {r1} + str r1, [r0] + adds r2, 0x1 + cmp r2, 0x1D + ble _08076FFC + movs r2, 0 + ldr r5, =0x03005d8c + movs r4, 0xBB + lsls r4, 3 + ldr r0, =0x02031c58 + adds r3, r0, 0 + adds r3, 0x78 +_0807701C: + ldr r0, [r5] + lsls r1, r2, 2 + adds r0, r4 + adds r0, r1 + ldm r3!, {r1} + str r1, [r0] + adds r2, 0x1 + cmp r2, 0x1D + ble _0807701C + movs r2, 0 + ldr r5, =0x03005d8c + movs r4, 0xCA + lsls r4, 3 + ldr r0, =0x02031c58 + adds r3, r0, 0 + adds r3, 0xF0 +_0807703C: + ldr r0, [r5] + lsls r1, r2, 2 + adds r0, r4 + adds r0, r1 + ldm r3!, {r1} + str r1, [r0] + adds r2, 0x1 + cmp r2, 0xF + ble _0807703C + movs r2, 0 + ldr r5, =0x03005d8c + movs r4, 0xD2 + lsls r4, 3 + ldr r0, =0x02031c58 + movs r6, 0x98 + lsls r6, 1 + adds r3, r0, r6 +_0807705E: + ldr r0, [r5] + lsls r1, r2, 2 + adds r0, r4 + adds r0, r1 + ldm r3!, {r1} + str r1, [r0] + adds r2, 0x1 + cmp r2, 0x3F + ble _0807705E + movs r2, 0 + ldr r5, =0x03005d8c + movs r4, 0xF2 + lsls r4, 3 + ldr r0, =0x02031c58 + movs r7, 0x8C + lsls r7, 2 + adds r3, r0, r7 +_08077080: + ldr r0, [r5] + lsls r1, r2, 2 + adds r0, r4 + adds r0, r1 + ldm r3!, {r1} + str r1, [r0] + adds r2, 0x1 + cmp r2, 0x2D + ble _08077080 + ldr r0, =0x03005d8c + mov r9, r0 + ldr r1, =0x00002be0 + mov r10, r1 + ldr r4, =0x02031c58 + movs r3, 0 + movs r2, 0xF +_080770A0: + mov r5, r9 + ldr r1, [r5] + adds r1, r3 + add r1, r10 + movs r6, 0xBA + lsls r6, 2 + adds r0, r4, r6 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r4, 0x24 + adds r3, 0x24 + subs r2, 0x1 + cmp r2, 0 + bge _080770A0 + mov r7, r8 + ldr r0, [r7] + adds r0, 0xAC + ldr r4, [r0] + mov r2, r12 + ldr r1, [r2] + str r1, [r0] + adds r0, r4, 0 + bl encrypt_decrypt_all_item_quantities + ldr r0, [r7] + adds r0, 0xAC + str r4, [r0] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end copy_bags_and_unk_data_to_save_blocks + + thumb_func_start apply_u16_xor_crypto +apply_u16_xor_crypto: @ 8077100 + ldr r2, =0x03005d90 + ldr r2, [r2] + adds r2, 0xAC + ldr r2, [r2] + ldrh r3, [r0] + eors r2, r3 + eors r2, r1 + strh r2, [r0] + bx lr + .pool + thumb_func_end apply_u16_xor_crypto + + thumb_func_start apply_u32_xor_crypto +apply_u32_xor_crypto: @ 8077118 + ldr r2, =0x03005d90 + ldr r3, [r2] + adds r3, 0xAC + ldr r2, [r0] + ldr r3, [r3] + eors r2, r3 + eors r2, r1 + str r2, [r0] + bx lr + .pool + thumb_func_end apply_u32_xor_crypto + + thumb_func_start saveblock_apply_crypto +saveblock_apply_crypto: @ 8077130 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_8084864 + adds r0, r4, 0 + bl call_encrypt_decrypt_all_item_quantities + adds r0, r4, 0 + bl sub_8024690 + ldr r5, =0x03005d8c + ldr r0, [r5] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + adds r1, r4, 0 + bl apply_u32_xor_crypto + ldr r0, [r5] + ldr r1, =0x00000494 + adds r0, r1 + adds r1, r4, 0 + bl apply_u16_xor_crypto + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end saveblock_apply_crypto + + thumb_func_start sub_8077170 +sub_8077170: @ 8077170 + push {r4,lr} + adds r4, r0, 0 + adds r3, r1, 0 + ldr r0, =0x02022c2c + ldrb r0, [r0] + cmp r0, 0x1D + beq _08077194 + lsls r2, r3, 16 + lsrs r2, 16 + movs r0, 0 + adds r1, r4, 0 + bl link_0800A448 + lsls r0, 24 + lsrs r0, 24 + b _080771A2 + .pool +_08077194: + ldr r0, =0x03004140 + ldrb r0, [r0] + movs r1, 0x54 + adds r2, r4, 0 + bl rfu_NI_setSendData + movs r0, 0x1 +_080771A2: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8077170 + + thumb_func_start sub_80771AC +sub_80771AC: @ 80771AC + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_800A4D8 + pop {r0} + bx r0 + thumb_func_end sub_80771AC + + thumb_func_start sub_80771BC +sub_80771BC: @ 80771BC + push {r4,lr} + ldr r0, =0x02022c2c + ldrb r0, [r0] + cmp r0, 0x1D + bne _080771F0 + ldr r4, =0x03007880 + ldr r0, =0x03004140 + ldrb r0, [r0] + bl sub_800E87C + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + ldrh r0, [r0] + cmp r0, 0 + bne _080771EC + movs r0, 0x1 + b _080771F8 + .pool +_080771EC: + movs r0, 0 + b _080771F8 +_080771F0: + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 +_080771F8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80771BC + + thumb_func_start sub_8077200 +sub_8077200: @ 8077200 + push {lr} + bl sub_800A550 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_8077200 + + thumb_func_start sub_8077210 +sub_8077210: @ 8077210 + push {lr} + bl sub_8077260 + cmp r0, 0 + beq _0807722C + ldr r0, =0x03004140 + ldrb r1, [r0] + movs r0, 0xC + bl rfu_clearSlot + b _08077230 + .pool +_0807722C: + bl sub_800A5B4 +_08077230: + pop {r0} + bx r0 + thumb_func_end sub_8077210 + + thumb_func_start sub_8077234 +sub_8077234: @ 8077234 + push {r4,lr} + adds r4, r0, 0 + bl sub_8077260 + cmp r0, 0 + beq _08077250 + ldr r0, =0x03004140 + ldrb r1, [r0] + movs r0, 0xC + bl rfu_clearSlot + b _08077258 + .pool +_08077250: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_800A5EC +_08077258: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8077234 + + thumb_func_start sub_8077260 +sub_8077260: @ 8077260 + push {lr} + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08077280 + ldr r0, =0x02022c2c + ldrb r0, [r0] + cmp r0, 0x1D + bne _08077280 + movs r0, 0x1 + b _08077282 + .pool +_08077280: + movs r0, 0 +_08077282: + pop {r1} + bx r1 + thumb_func_end sub_8077260 + + thumb_func_start sub_8077288 +sub_8077288: @ 8077288 + push {lr} + bl sub_800ADF8 + pop {r0} + bx r0 + thumb_func_end sub_8077288 + + thumb_func_start sub_8077294 +sub_8077294: @ 8077294 + push {lr} + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_8077294 + + thumb_func_start sub_80772A4 +sub_80772A4: @ 80772A4 + push {r4,r5,lr} + sub sp, 0xC + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + bl clear_tasks + bl sub_80A1A74 + ldr r2, =0x02037fd4 + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + ldr r0, =sub_807811C + bl SetVBlankCallback + ldr r4, =gUnknown_0860F074 + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0x14 + bl gpu_pal_apply + adds r0, r4, 0 + movs r1, 0xD0 + movs r2, 0x14 + bl gpu_pal_apply + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0832DEE4 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + ldr r0, =0x0203229c + ldr r1, [r0] + movs r0, 0x8F + lsls r0, 4 + adds r1, r0 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r0, =gUnknown_0832DEF4 + bl InitWindows + lsls r0, 16 + cmp r0, 0 + beq _0807738C + bl DeactivateAllTextPrinters + movs r5, 0 +_08077310: + lsls r4, r5, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl ClearWindowTilemap + adds r0, r4, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r5, 0x1 + cmp r5, 0x11 + bls _08077310 + movs r0, 0x1E + str r0, [sp] + movs r0, 0x14 + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect + movs r0, 0 + movs r1, 0x14 + movs r2, 0xC0 + bl box_border_load_tiles_and_pal + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0xE0 + bl sub_809882C + bl sub_80D2F04 + ldr r2, =0x0203229c + ldr r0, [r2] + adds r0, 0x69 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0x6F + strb r1, [r0] + ldr r0, [r2] + adds r0, 0x70 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0x74 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0x75 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0x7A + strb r1, [r0] + ldr r0, [r2] + adds r0, 0x7B + strb r1, [r0] + ldr r0, [r2] + adds r0, 0xA8 + strb r1, [r0] +_0807738C: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80772A4 + + thumb_func_start sub_80773AC +sub_80773AC: @ 80773AC + push {lr} + ldr r0, =sub_80773D0 + bl SetMainCallback2 + ldr r0, =0x030022c0 + movs r1, 0 + str r1, [r0] + ldr r0, =0x020244ea + strb r1, [r0] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80773AC + + thumb_func_start sub_80773D0 +sub_80773D0: @ 80773D0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x28 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r3, r1, 0 + cmp r0, 0x16 + bls _080773EA + b _08077B46 +_080773EA: + lsls r0, 2 + ldr r1, =_080773FC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080773FC: + .4byte _08077458 + .4byte _080774A4 + .4byte _08077560 + .4byte _0807758C + .4byte _080775E8 + .4byte _08077648 + .4byte _08077688 + .4byte _080776A8 + .4byte _080777E8 + .4byte _08077810 + .4byte _08077834 + .4byte _080778BC + .4byte _080778CA + .4byte _08077970 + .4byte _08077A40 + .4byte _08077A80 + .4byte _08077A9A + .4byte _08077AA8 + .4byte _08077ABC + .4byte _08077ADC + .4byte _08077AFC + .4byte _08077B10 + .4byte _08077B30 +_08077458: + ldr r4, =0x0203229c + ldr r0, =0x000010f0 + bl AllocZeroed + str r0, [r4] + bl sub_80772A4 + ldr r4, =0x02032184 + movs r0, 0xE0 + lsls r0, 4 + bl AllocZeroed + str r0, [r4] + movs r6, 0 + ldr r2, =0x02032188 +_08077476: + lsls r1, r6, 8 + ldr r0, [r4] + adds r0, r1 + stm r2!, {r0} + adds r6, 0x1 + cmp r6, 0xD + ble _08077476 + ldr r1, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _08077B22 + .pool +_080774A4: + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] + movs r6, 0 + movs r4, 0 +_080774B2: + movs r0, 0x64 + muls r0, r6 + ldr r1, =0x02024744 + adds r0, r1 + str r4, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + str r4, [sp, 0xC] + movs r1, 0 + movs r2, 0 + movs r3, 0x20 + bl create_pokemon_set_level + adds r6, 0x1 + cmp r6, 0x5 + ble _080774B2 + movs r0, 0 + bl sub_807A19C + movs r0, 0 + bl ShowBg + ldr r0, =0x03003124 + ldrb r2, [r0] + cmp r2, 0 + bne _0807754C + ldr r1, =0x020229c6 + ldr r5, =0x00001122 + adds r0, r5, 0 + strh r0, [r1] + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0xA8 + strb r2, [r0] + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08077528 + bl sub_800B488 + bl sub_8009734 + bl sub_8011BA4 + b _08077B46 + .pool +_08077528: + bl sub_8009734 + ldr r0, =0x030022c0 + movs r7, 0x87 + lsls r7, 3 + adds r0, r7 + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + ldr r0, =task00_08081A90 + movs r1, 0x1 + bl AddTask + b _08077B46 + .pool +_0807754C: + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x4 + strb r1, [r0] + b _08077B46 + .pool +_08077560: + ldr r2, =0x0203229c + ldr r1, [r2] + adds r1, 0xA8 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r2] + adds r1, r0, 0 + adds r1, 0xA8 + ldrb r0, [r1] + cmp r0, 0xB + bhi _0807757A + b _08077B46 +_0807757A: + movs r0, 0 + strb r0, [r1] + movs r2, 0x87 + lsls r2, 3 + adds r1, r3, r2 + b _08077B22 + .pool +_0807758C: + bl sub_800ABAC + adds r4, r0, 0 + bl sub_800AA48 + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bcs _080775A0 + b _08077B46 +_080775A0: + bl sub_800ABBC + lsls r0, 24 + cmp r0, 0 + beq _080775D8 + ldr r0, =0x0203229c + ldr r1, [r0] + adds r1, 0xA8 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1E + bhi _080775C0 + b _08077B46 +_080775C0: + bl sub_800A620 + ldr r1, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _08077B22 + .pool +_080775D8: + ldr r1, =0x030022c0 + movs r5, 0x87 + lsls r5, 3 + adds r1, r5 + b _08077B22 + .pool +_080775E8: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080775F2 + b _08077B46 +_080775F2: + bl sub_800A23C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08077600 + b _08077B46 +_08077600: + bl sub_8011BD0 + bl calc_player_party_count + ldr r1, =0x030022c0 + movs r7, 0x87 + lsls r7, 3 + adds r1, r7 + ldrb r0, [r1] + adds r0, 0x1 + movs r2, 0 + strb r0, [r1] + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0xA8 + strb r2, [r0] + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _0807762A + b _08077B46 +_0807762A: + movs r0, 0x1 + bl sub_801048C + bl sub_800ADF8 + b _08077B46 + .pool +_08077648: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08077680 + bl sub_8010500 + lsls r0, 24 + cmp r0, 0 + bne _0807765C + b _08077B46 +_0807765C: + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + bl sub_800E0E8 + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + b _08077B46 + .pool +_08077680: + movs r2, 0x87 + lsls r2, 3 + adds r1, r3, r2 + b _08077B22 +_08077688: + bl shedinja_maker_maybe + lsls r0, 24 + cmp r0, 0 + bne _08077694 + b _08077B46 +_08077694: + bl sub_807A5B0 + ldr r1, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _08077B22 + .pool +_080776A8: + bl calc_enemy_party_count + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + ldr r2, =0x0203229c + ldr r0, [r2] + ldr r1, =0x020244e9 + ldrb r1, [r1] + adds r0, 0x36 + strb r1, [r0] + ldr r0, [r2] + ldr r1, =0x020244ea + ldrb r1, [r1] + adds r0, 0x37 + strb r1, [r0] + movs r6, 0 + ldr r0, [r2] + adds r0, 0x36 + ldrb r0, [r0] + cmp r6, r0 + bge _08077740 + mov r8, r2 + ldr r7, =gUnknown_0832DE24 +_080776E2: + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + ldrb r2, [r7] + lsls r2, 19 + movs r1, 0xE0 + lsls r1, 12 + adds r2, r1 + asrs r2, 16 + ldrb r3, [r7, 0x1] + lsls r3, 19 + ldr r1, =0xfff40000 + adds r3, r1 + asrs r3, 16 + movs r1, 0x1 + str r1, [sp] + str r0, [sp, 0x4] + str r1, [sp, 0x8] + adds r0, r5, 0 + ldr r1, =sub_80D3014 + bl sub_80D2CC4 + mov r2, r8 + ldr r1, [r2] + adds r1, 0x28 + adds r1, r6 + strb r0, [r1] + adds r7, 0x2 + adds r6, 0x1 + ldr r0, [r2] + adds r0, 0x36 + ldrb r0, [r0] + cmp r6, r0 + blt _080776E2 +_08077740: + movs r6, 0 + ldr r1, =0x0203229c + ldr r0, [r1] + adds r0, 0x37 + ldrb r0, [r0] + cmp r6, r0 + bge _080777B8 + ldr r0, =gUnknown_0832DE24 + mov r8, r1 + adds r7, r0, 0 + adds r7, 0xC +_08077756: + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + ldrb r2, [r7] + lsls r2, 19 + movs r3, 0xE0 + lsls r3, 12 + adds r2, r3 + asrs r2, 16 + ldrb r3, [r7, 0x1] + lsls r3, 19 + ldr r1, =0xfff40000 + adds r3, r1 + asrs r3, 16 + movs r1, 0x1 + str r1, [sp] + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r5, 0 + ldr r1, =sub_80D3014 + bl sub_80D2CC4 + mov r2, r8 + ldr r1, [r2] + adds r1, 0x2E + adds r1, r6 + strb r0, [r1] + adds r7, 0x2 + adds r6, 0x1 + ldr r0, [r2] + adds r0, 0x37 + ldrb r0, [r0] + cmp r6, r0 + blt _08077756 +_080777B8: + ldr r1, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _08077B22 + .pool +_080777E8: + bl sub_81B5D30 + ldr r0, =0x0203229c + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x36 + adds r1, 0x28 + movs r2, 0 + bl sub_81B5D4C + ldr r1, =0x030022c0 + movs r5, 0x87 + lsls r5, 3 + adds r1, r5 + b _08077B22 + .pool +_08077810: + ldr r0, =0x0203229c + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x36 + adds r1, 0x28 + movs r2, 0x1 + bl sub_81B5D4C + ldr r1, =0x030022c0 + movs r7, 0x87 + lsls r7, 3 + adds r1, r7 + b _08077B22 + .pool +_08077834: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r5, =0x02032188 + ldr r1, [r5] + movs r4, 0x3 + str r4, [sp] + movs r2, 0 + movs r3, 0 + bl sub_80C6D80 + bl link_get_multiplayer_id + lsls r0, 24 + movs r1, 0x80 + lsls r1, 17 + eors r1, r0 + lsrs r1, 24 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r1, =0x020229f0 + adds r0, r1 + ldr r1, [r5, 0xC] + str r4, [sp] + movs r2, 0 + movs r3, 0 + bl sub_80C6D80 + ldr r4, =gUnknown_0832DE94 + ldr r0, [r4] + ldr r1, [r5, 0x18] + movs r2, 0x2 + str r2, [sp] + movs r2, 0 + movs r3, 0 + bl sub_80C6D80 + ldr r0, [r4, 0x4] + ldr r1, [r5, 0x20] + movs r2, 0x18 + bl sub_807A308 + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + movs r2, 0 + strb r0, [r1] + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0xA8 + strb r2, [r0] + b _08077B46 + .pool +_080778BC: + bl sub_807A1F0 + lsls r0, 24 + cmp r0, 0 + bne _080778C8 + b _08077B46 +_080778C8: + b _08077B1A +_080778CA: + ldr r0, =0x03005d90 + ldr r1, [r0] + movs r0, 0x1 + movs r2, 0x78 + bl GetStringCenterAlignXOffset + movs r6, 0 + add r5, sp, 0x10 + adds r4, r0, 0 + adds r4, 0x10 +_080778DE: + add r1, sp, 0x10 + ldr r0, =gUnknown_0832DCAC + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldrh r0, [r5] + adds r0, r6 + strh r0, [r5] + lsls r1, r4, 16 + asrs r1, 16 + add r0, sp, 0x10 + movs r2, 0xA + movs r3, 0x1 + bl AddObjectToFront + adds r4, 0x20 + adds r6, 0x1 + cmp r6, 0x2 + ble _080778DE + bl link_get_multiplayer_id + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r0, =0x020229f0 + adds r1, r0 + movs r0, 0x1 + movs r2, 0x78 + bl GetStringCenterAlignXOffset + movs r6, 0 + add r5, sp, 0x10 + adds r4, r0, 0 + adds r4, 0x88 +_0807792C: + add r1, sp, 0x10 + ldr r0, =gUnknown_0832DCAC + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + adds r0, r6, 0x3 + ldrh r3, [r5] + adds r0, r3 + strh r0, [r5] + lsls r1, r4, 16 + asrs r1, 16 + add r0, sp, 0x10 + movs r2, 0xA + movs r3, 0x1 + bl AddObjectToFront + adds r4, 0x20 + adds r6, 0x1 + cmp r6, 0x2 + ble _0807792C + ldr r1, =0x030022c0 + movs r5, 0x87 + lsls r5, 3 + adds r1, r5 + b _08077B22 + .pool +_08077970: + ldr r4, =gUnknown_0832DCAC + add r1, sp, 0x10 + adds r0, r4, 0 + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r5,r7} + stm r1!, {r2,r5,r7} + add r1, sp, 0x10 + adds r0, r1, 0 + ldrh r0, [r0] + adds r0, 0x6 + strh r0, [r1] + adds r0, r1, 0 + movs r1, 0xD7 + movs r2, 0x98 + movs r3, 0x1 + bl AddObjectToFront + add r0, sp, 0x10 + ldm r4!, {r3,r5,r7} + stm r0!, {r3,r5,r7} + ldm r4!, {r1-r3} + stm r0!, {r1-r3} + add r1, sp, 0x10 + adds r0, r1, 0 + ldrh r0, [r0] + adds r0, 0x7 + strh r0, [r1] + adds r0, r1, 0 + movs r1, 0xF7 + movs r2, 0x98 + movs r3, 0x1 + bl AddObjectToFront + movs r6, 0 + add r4, sp, 0x10 + movs r5, 0xC0 + lsls r5, 13 +_080779BC: + add r1, sp, 0x10 + ldr r0, =gUnknown_0832DCAC + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + adds r0, r6, 0 + adds r0, 0x8 + ldrh r7, [r4] + adds r0, r7 + strh r0, [r4] + asrs r1, r5, 16 + add r0, sp, 0x10 + movs r2, 0x96 + movs r3, 0x1 + bl AddObjectToFront + movs r0, 0x80 + lsls r0, 14 + adds r5, r0 + adds r6, 0x1 + cmp r6, 0x5 + ble _080779BC + ldr r0, =gUnknown_0832DC94 + ldr r2, =gUnknown_0832DE24 + ldrb r1, [r2] + lsls r1, 19 + movs r3, 0x80 + lsls r3, 14 + adds r1, r3 + asrs r1, 16 + ldrb r2, [r2, 0x1] + lsls r2, 3 + movs r3, 0x2 + bl AddObjectToFront + ldr r2, =0x0203229c + ldr r1, [r2] + adds r1, 0x34 + movs r3, 0 + strb r0, [r1] + ldr r0, [r2] + adds r0, 0x35 + strb r3, [r0] + ldr r1, =0x030022c0 + movs r5, 0x87 + lsls r5, 3 + adds r1, r5 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r0, 0 + bl rbox_fill_rectangle + b _08077B46 + .pool +_08077A40: + movs r0, 0 + bl sub_807A320 + movs r0, 0 + bl sub_8079BE0 + ldr r2, =0x0203229c + ldr r0, [r2] + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + strb r1, [r0, 0x1] + bl sub_8078388 + ldr r1, =0x030022c0 + movs r7, 0x87 + lsls r7, 3 + adds r1, r7 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, =0x000001b3 + bl song_play_for_text + b _08077B46 + .pool +_08077A80: + movs r0, 0x1 + bl sub_807A320 + movs r0, 0x1 + bl sub_8079BE0 + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_08077A9A: + movs r0, 0 + bl sub_80782B8 + b _08077B1A + .pool +_08077AA8: + movs r0, 0x1 + bl sub_80782B8 + ldr r1, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _08077B22 + .pool +_08077ABC: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r1, =0x030022c0 + movs r5, 0x87 + lsls r5, 3 + adds r1, r5 + b _08077B22 + .pool +_08077ADC: + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0x2 + bl sub_80782B8 + ldr r1, =0x030022c0 + movs r7, 0x87 + lsls r7, 3 + adds r1, r7 + b _08077B22 + .pool +_08077AFC: + movs r0, 0 + bl sub_807A468 + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _08077B22 + .pool +_08077B10: + movs r0, 0x1 + bl sub_807A468 + bl sub_807A53C +_08077B1A: + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 +_08077B22: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08077B46 + .pool +_08077B30: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08077B46 + ldr r0, =sub_8078C34 + str r0, [r3] + ldr r0, =sub_807825C + bl SetMainCallback2 +_08077B46: + bl RunTextPrinters + bl RunActiveTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + add sp, 0x28 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80773D0 + + thumb_func_start sub_8077B74 +sub_8077B74: @ 8077B74 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x24 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0x16 + bls _08077B8E + b _080780F6 +_08077B8E: + lsls r0, 2 + ldr r1, =_08077BA0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08077BA0: + .4byte _08077BFC + .4byte _08077C10 + .4byte _08077C18 + .4byte _08077C20 + .4byte _08077C28 + .4byte _08077C3C + .4byte _08077C64 + .4byte _08077C6C + .4byte _08077DB0 + .4byte _08077DD8 + .4byte _08077DFC + .4byte _08077E84 + .4byte _08077EA0 + .4byte _08077F48 + .4byte _080780F6 + .4byte _080780F6 + .4byte _08078038 + .4byte _08078040 + .4byte _08078068 + .4byte _080780A4 + .4byte _080780C4 + .4byte _080780CC + .4byte _080780E4 +_08077BFC: + bl sub_80772A4 + ldr r1, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _080780D8 + .pool +_08077C10: + movs r5, 0x87 + lsls r5, 3 + adds r1, r2, r5 + b _08077E58 +_08077C18: + movs r7, 0x87 + lsls r7, 3 + adds r1, r2, r7 + b _080780D8 +_08077C20: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + b _080780D8 +_08077C28: + bl calc_player_party_count + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _080780D8 + .pool +_08077C3C: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08077C50 + bl sub_800E0E8 + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 +_08077C50: + ldr r1, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _080780D8 + .pool +_08077C64: + movs r5, 0x87 + lsls r5, 3 + adds r1, r2, r5 + b _080780D8 +_08077C6C: + bl calc_enemy_party_count + ldr r4, =0x0203229c + ldr r0, [r4] + ldr r1, =0x020244e9 + ldrb r1, [r1] + adds r0, 0x36 + strb r1, [r0] + ldr r0, [r4] + ldr r1, =0x020244ea + ldrb r1, [r1] + adds r0, 0x37 + strb r1, [r0] + movs r0, 0 + bl ClearWindowTilemap + movs r0, 0 + bl sub_8079BE0 + movs r0, 0x1 + bl sub_8079BE0 + movs r6, 0 + ldr r0, [r4] + adds r0, 0x36 + ldrb r0, [r0] + cmp r6, r0 + bge _08077D08 + mov r8, r4 + ldr r7, =gUnknown_0832DE24 +_08077CA8: + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + ldrb r2, [r7] + lsls r2, 19 + movs r1, 0xE0 + lsls r1, 12 + adds r2, r1 + asrs r2, 16 + ldrb r3, [r7, 0x1] + lsls r3, 19 + ldr r1, =0xfff40000 + adds r3, r1 + asrs r3, 16 + movs r1, 0x1 + str r1, [sp] + str r0, [sp, 0x4] + str r1, [sp, 0x8] + adds r0, r5, 0 + ldr r1, =sub_80D3014 + bl sub_80D2CC4 + mov r2, r8 + ldr r1, [r2] + adds r1, 0x28 + adds r1, r6 + strb r0, [r1] + adds r7, 0x2 + adds r6, 0x1 + ldr r0, [r2] + adds r0, 0x36 + ldrb r0, [r0] + cmp r6, r0 + blt _08077CA8 +_08077D08: + movs r6, 0 + ldr r1, =0x0203229c + ldr r0, [r1] + adds r0, 0x37 + ldrb r0, [r0] + cmp r6, r0 + bge _08077D80 + ldr r0, =gUnknown_0832DE24 + mov r8, r1 + adds r7, r0, 0 + adds r7, 0xC +_08077D1E: + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + ldrb r2, [r7] + lsls r2, 19 + movs r3, 0xE0 + lsls r3, 12 + adds r2, r3 + asrs r2, 16 + ldrb r3, [r7, 0x1] + lsls r3, 19 + ldr r1, =0xfff40000 + adds r3, r1 + asrs r3, 16 + movs r1, 0x1 + str r1, [sp] + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r5, 0 + ldr r1, =sub_80D3014 + bl sub_80D2CC4 + mov r2, r8 + ldr r1, [r2] + adds r1, 0x2E + adds r1, r6 + strb r0, [r1] + adds r7, 0x2 + adds r6, 0x1 + ldr r0, [r2] + adds r0, 0x37 + ldrb r0, [r0] + cmp r6, r0 + blt _08077D1E +_08077D80: + ldr r1, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _080780D8 + .pool +_08077DB0: + bl sub_81B5D30 + ldr r0, =0x0203229c + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x36 + adds r1, 0x28 + movs r2, 0 + bl sub_81B5D4C + ldr r1, =0x030022c0 + movs r5, 0x87 + lsls r5, 3 + adds r1, r5 + b _080780D8 + .pool +_08077DD8: + ldr r0, =0x0203229c + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x36 + adds r1, 0x28 + movs r2, 0x1 + bl sub_81B5D4C + ldr r1, =0x030022c0 + movs r7, 0x87 + lsls r7, 3 + adds r1, r7 + b _080780D8 + .pool +_08077DFC: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r5, =0x02032188 + ldr r1, [r5] + movs r4, 0x3 + str r4, [sp] + movs r2, 0 + movs r3, 0 + bl sub_80C6D80 + bl link_get_multiplayer_id + lsls r0, 24 + movs r1, 0x80 + lsls r1, 17 + eors r1, r0 + lsrs r1, 24 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r1, =0x020229f0 + adds r0, r1 + ldr r1, [r5, 0xC] + str r4, [sp] + movs r2, 0 + movs r3, 0 + bl sub_80C6D80 + ldr r4, =gUnknown_0832DE94 + ldr r0, [r4] + ldr r1, [r5, 0x18] + movs r2, 0x2 + str r2, [sp] + movs r2, 0 + movs r3, 0 + bl sub_80C6D80 + ldr r0, [r4, 0x4] + ldr r1, [r5, 0x20] + movs r2, 0x18 + bl sub_807A308 + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 +_08077E58: + ldrb r0, [r1] + adds r0, 0x1 + movs r2, 0 + strb r0, [r1] + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0xA8 + strb r2, [r0] + b _080780F6 + .pool +_08077E84: + bl sub_807A1F0 + lsls r0, 24 + cmp r0, 0 + bne _08077E90 + b _080780F6 +_08077E90: + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _080780D8 + .pool +_08077EA0: + ldr r0, =0x03005d90 + ldr r1, [r0] + movs r0, 0x1 + movs r2, 0x78 + bl GetStringCenterAlignXOffset + movs r6, 0 + add r5, sp, 0xC + adds r4, r0, 0 + adds r4, 0x10 +_08077EB4: + add r1, sp, 0xC + ldr r0, =gUnknown_0832DCAC + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldrh r0, [r5] + adds r0, r6 + strh r0, [r5] + lsls r1, r4, 16 + asrs r1, 16 + add r0, sp, 0xC + movs r2, 0xA + movs r3, 0x1 + bl AddObjectToFront + adds r4, 0x20 + adds r6, 0x1 + cmp r6, 0x2 + ble _08077EB4 + bl link_get_multiplayer_id + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r0, =0x020229f0 + adds r1, r0 + movs r0, 0x1 + movs r2, 0x78 + bl GetStringCenterAlignXOffset + movs r6, 0 + add r5, sp, 0xC + adds r4, r0, 0 + adds r4, 0x88 +_08077F02: + add r1, sp, 0xC + ldr r0, =gUnknown_0832DCAC + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + adds r0, r6, 0x3 + ldrh r3, [r5] + adds r0, r3 + strh r0, [r5] + lsls r1, r4, 16 + asrs r1, 16 + add r0, sp, 0xC + movs r2, 0xA + movs r3, 0x1 + bl AddObjectToFront + adds r4, 0x20 + adds r6, 0x1 + cmp r6, 0x2 + ble _08077F02 + ldr r1, =0x030022c0 + movs r5, 0x87 + lsls r5, 3 + adds r1, r5 + b _080780D8 + .pool +_08077F48: + ldr r4, =gUnknown_0832DCAC + add r1, sp, 0xC + adds r0, r4, 0 + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r5,r7} + stm r1!, {r2,r5,r7} + add r1, sp, 0xC + adds r0, r1, 0 + ldrh r0, [r0] + adds r0, 0x6 + strh r0, [r1] + adds r0, r1, 0 + movs r1, 0xD7 + movs r2, 0x98 + movs r3, 0x1 + bl AddObjectToFront + add r0, sp, 0xC + ldm r4!, {r3,r5,r7} + stm r0!, {r3,r5,r7} + ldm r4!, {r1-r3} + stm r0!, {r1-r3} + add r1, sp, 0xC + adds r0, r1, 0 + ldrh r0, [r0] + adds r0, 0x7 + strh r0, [r1] + adds r0, r1, 0 + movs r1, 0xF7 + movs r2, 0x98 + movs r3, 0x1 + bl AddObjectToFront + movs r6, 0 + add r4, sp, 0xC + movs r5, 0xC0 + lsls r5, 13 +_08077F94: + add r1, sp, 0xC + ldr r0, =gUnknown_0832DCAC + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + adds r0, r6, 0 + adds r0, 0x8 + ldrh r7, [r4] + adds r0, r7 + strh r0, [r4] + asrs r1, r5, 16 + add r0, sp, 0xC + movs r2, 0x96 + movs r3, 0x1 + bl AddObjectToFront + movs r0, 0x80 + lsls r0, 14 + adds r5, r0 + adds r6, 0x1 + cmp r6, 0x5 + ble _08077F94 + ldr r0, =0x0203229c + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0x35 + ldrb r1, [r2] + adds r4, r0, 0 + cmp r1, 0x5 + bhi _08077FE4 + ldr r0, =0x0203cf20 + ldrb r0, [r0] + b _08077FEA + .pool +_08077FE4: + ldr r0, =0x0203cf20 + ldrb r0, [r0] + adds r0, 0x6 +_08077FEA: + strb r0, [r2] + ldr r0, =gUnknown_0832DC94 + ldr r3, =gUnknown_0832DE24 + ldr r1, [r4] + adds r1, 0x35 + ldrb r2, [r1] + lsls r2, 1 + adds r1, r2, r3 + ldrb r1, [r1] + lsls r1, 19 + movs r5, 0x80 + lsls r5, 14 + adds r1, r5 + asrs r1, 16 + adds r3, 0x1 + adds r2, r3 + ldrb r2, [r2] + lsls r2, 3 + movs r3, 0x2 + bl AddObjectToFront + ldr r1, [r4] + adds r1, 0x34 + strb r0, [r1] + ldr r0, =0x030022c0 + movs r7, 0x87 + lsls r7, 3 + adds r0, r7 + movs r1, 0x10 + strb r1, [r0] + b _080780F6 + .pool +_08078038: + movs r0, 0 + bl sub_80782B8 + b _080780D0 +_08078040: + movs r0, 0x1 + bl sub_80782B8 + ldr r2, =0x0203229c + ldr r0, [r2] + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + strb r1, [r0, 0x1] + bl sub_8078388 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _080780D8 + .pool +_08078068: + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] + movs r4, 0x1 + negs r4, r4 + adds r0, r4, 0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r1, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _080780D8 + .pool +_080780A4: + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0x2 + bl sub_80782B8 + ldr r1, =0x030022c0 + movs r5, 0x87 + lsls r5, 3 + adds r1, r5 + b _080780D8 + .pool +_080780C4: + movs r7, 0x87 + lsls r7, 3 + adds r1, r2, r7 + b _080780D8 +_080780CC: + bl sub_807A53C +_080780D0: + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 +_080780D8: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080780F6 + .pool +_080780E4: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080780F6 + ldr r0, =sub_807825C + bl SetMainCallback2 +_080780F6: + bl RunActiveTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + add sp, 0x24 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8077B74 + + thumb_func_start sub_807811C +sub_807811C: @ 807811C + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_807811C + + thumb_func_start sub_8078130 +sub_8078130: @ 8078130 + push {r4,lr} + sub sp, 0x4 + ldr r4, =0x0203229c + ldr r1, [r4] + adds r1, 0xA8 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xF + bls _08078160 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, [r4] + adds r0, 0x6F + movs r1, 0xA + strb r1, [r0] +_08078160: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8078130 + + thumb_func_start sub_807816C +sub_807816C: @ 807816C + push {r4,lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080781C2 + ldr r1, =0x02032298 + ldr r4, =0x0203229c + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x35 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r2, 0 + adds r0, 0x7E + ldrb r0, [r0] + strb r0, [r1, 0x1] + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _080781B4 + adds r1, r2, 0 + adds r1, 0x6F + movs r0, 0x10 + strb r0, [r1] + b _080781C2 + .pool +_080781B4: + movs r0, 0x20 + bl sub_800ABF4 + ldr r0, [r4] + adds r0, 0x6F + movs r1, 0xD + strb r1, [r0] +_080781C2: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_807816C + + thumb_func_start sub_80781C8 +sub_80781C8: @ 80781C8 + push {r4,r5,lr} + ldr r5, =0x030022c0 + ldr r0, =sub_80773AC + str r0, [r5, 0x8] + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08078220 + bl sub_8010500 + lsls r0, 24 + cmp r0, 0 + beq _08078244 + ldr r0, =0x02032184 + ldr r0, [r0] + bl Free + bl FreeAllWindowBuffers + ldr r0, =0x0203229c + ldr r0, [r0] + bl Free + movs r0, 0 + str r0, [r5] + bl sub_800E084 + ldr r0, =sub_807AE50 + bl SetMainCallback2 + b _08078244 + .pool +_08078220: + ldr r0, =0x03003124 + ldrb r4, [r0] + cmp r4, 0 + bne _08078244 + ldr r0, =0x02032184 + ldr r0, [r0] + bl Free + bl FreeAllWindowBuffers + ldr r0, =0x0203229c + ldr r0, [r0] + bl Free + str r4, [r5] + ldr r0, =sub_807AE50 + bl SetMainCallback2 +_08078244: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80781C8 + + thumb_func_start sub_807825C +sub_807825C: @ 807825C + push {r4,lr} + bl sub_80795AC + bl sub_807A0C4 + movs r0, 0 + bl sub_80796B4 + movs r0, 0x1 + bl sub_80796B4 + ldr r4, =0x0203229c + ldr r2, [r4] + ldrb r1, [r2] + adds r0, r1, 0x1 + strb r0, [r2] + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x18 + bl SetGpuReg + ldr r2, [r4] + ldrb r1, [r2, 0x1] + adds r0, r1, 0 + adds r0, 0xFF + strb r0, [r2, 0x1] + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x1C + bl SetGpuReg + bl sub_8197224 + bl RunActiveTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807825C + + thumb_func_start sub_80782B8 +sub_80782B8: @ 80782B8 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + beq _08078324 + cmp r4, 0x1 + bgt _080782CE + cmp r4, 0 + beq _080782D4 + b _0807837E +_080782CE: + cmp r4, 0x2 + beq _0807834C + b _0807837E +_080782D4: + ldr r0, =gUnknown_08DDB3E4 + movs r1, 0 + movs r2, 0x60 + bl gpu_pal_apply + ldr r1, =gUnknown_08DDB464 + movs r2, 0x94 + lsls r2, 5 + movs r0, 0x1 + movs r3, 0 + bl LoadBgTiles + ldr r1, =gUnknown_08DDCF04 + movs r0, 0x20 + str r0, [sp] + movs r0, 0x14 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBufferRect_ChangePalette + ldr r1, =gUnknown_0832CABC + movs r2, 0x80 + lsls r2, 4 + movs r0, 0x2 + movs r3, 0 + bl LoadBgTilemap + b _0807837E + .pool +_08078324: + ldr r1, =gUnknown_0832D2BC + movs r2, 0x80 + lsls r2, 4 + movs r0, 0x3 + movs r3, 0 + bl LoadBgTilemap + movs r0, 0 + bl sub_8079E44 + movs r0, 0x1 + bl sub_8079E44 + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + b _0807837E + .pool +_0807834C: + movs r5, 0x80 + lsls r5, 21 + movs r4, 0x3 +_08078352: + lsrs r0, r5, 24 + movs r1, 0 + bl SetGpuReg + movs r0, 0x80 + lsls r0, 18 + adds r5, r0 + subs r4, 0x1 + cmp r4, 0 + bge _08078352 + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg +_0807837E: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80782B8 + + thumb_func_start sub_8078388 +sub_8078388: @ 8078388 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r3, 0 + ldr r5, =0x0203229c + mov r8, r5 + ldr r0, =0x02020630 + mov r12, r0 + movs r1, 0x5 + negs r1, r1 + mov r9, r1 + movs r4, 0x6 + movs r7, 0x1 + movs r6, 0 +_080783A6: + mov r1, r8 + ldr r0, [r1] + adds r1, r0, 0 + adds r1, 0x36 + ldrb r1, [r1] + cmp r3, r1 + bge _080783E0 + adds r0, 0x28 + adds r0, r3 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r12 + adds r1, 0x3E + ldrb r2, [r1] + mov r0, r9 + ands r0, r2 + strb r0, [r1] + ldr r0, [r5] + adds r0, 0x38 + adds r0, r3 + strb r7, [r0] + b _080783E6 + .pool +_080783E0: + adds r0, 0x38 + adds r0, r3 + strb r6, [r0] +_080783E6: + mov r1, r8 + ldr r0, [r1] + adds r1, r0, 0 + adds r1, 0x37 + ldrb r1, [r1] + cmp r3, r1 + bge _08078416 + adds r0, 0x2E + adds r0, r3 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r12 + adds r1, 0x3E + ldrb r2, [r1] + mov r0, r9 + ands r0, r2 + strb r0, [r1] + ldr r0, [r5] + adds r0, 0x38 + adds r0, r4 + strb r7, [r0] + b _0807841C +_08078416: + adds r0, 0x38 + adds r0, r4 + strb r6, [r0] +_0807841C: + adds r4, 0x1 + adds r3, 0x1 + cmp r3, 0x5 + ble _080783A6 + ldr r0, [r5] + adds r0, 0x44 + movs r1, 0x1 + strb r1, [r0] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8078388 + + thumb_func_start sub_8078438 +sub_8078438: @ 8078438 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r3, 0 + cmp r3, r2 + bcs _08078452 +_08078444: + adds r0, r5, r3 + adds r1, r4, r3 + ldrb r1, [r1] + strb r1, [r0] + adds r3, 0x1 + cmp r3, r2 + bcc _08078444 +_08078452: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8078438 + + thumb_func_start shedinja_maker_maybe +shedinja_maker_maybe: @ 8078458 + push {r4-r6,lr} + sub sp, 0xC + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x69 + ldrb r0, [r0] + cmp r0, 0x15 + bls _08078472 + b _080787AA +_08078472: + lsls r0, 2 + ldr r1, =_08078484 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08078484: + .4byte _080784DC + .4byte _08078508 + .4byte _08078784 + .4byte _08078534 + .4byte _08078548 + .4byte _0807857C + .4byte _08078784 + .4byte _08078598 + .4byte _080785AC + .4byte _080785E0 + .4byte _08078784 + .4byte _080785FC + .4byte _08078610 + .4byte _08078644 + .4byte _08078784 + .4byte _0807866C + .4byte _08078680 + .4byte _080786B4 + .4byte _08078784 + .4byte _080786DC + .4byte _080786F0 + .4byte _08078720 +_080784DC: + ldr r0, =0x020228c4 + ldr r1, =0x020244ec + movs r2, 0xC8 + bl sub_8078438 + ldr r3, =0x0203229c + ldr r1, [r3] + adds r1, 0x69 + ldrb r0, [r1] + adds r0, 0x1 + movs r2, 0 + strb r0, [r1] + ldr r0, [r3] + adds r0, 0xA8 + strb r2, [r0] + b _080787AA + .pool +_08078508: + bl sub_80771BC + cmp r0, 0 + bne _08078512 + b _080787AA +_08078512: + bl sub_8077200 + cmp r0, 0 + bne _08078524 + ldr r0, =0x0203229c + ldr r1, [r0] + b _080787A2 + .pool +_08078524: + bl sub_8077210 + ldr r0, =0x0203229c + ldr r1, [r0] + b _080787A2 + .pool +_08078534: + cmp r5, 0 + bne _0807853E + movs r0, 0x1 + bl sub_80771AC +_0807853E: + ldr r0, =0x0203229c + ldr r1, [r0] + b _080787A2 + .pool +_08078548: + bl sub_8077200 + cmp r0, 0x3 + beq _08078552 + b _080787AA +_08078552: + ldr r0, =0x02024744 + movs r2, 0x1 + adds r1, r5, 0 + eors r1, r2 + lsls r1, 8 + ldr r2, =0x020223c4 + adds r1, r2 + movs r2, 0xC8 + bl sub_8078438 + bl sub_8077210 + ldr r0, =0x0203229c + ldr r1, [r0] + b _080787A2 + .pool +_0807857C: + ldr r0, =0x020228c4 + ldr r1, =0x020245b4 + movs r2, 0xC8 + bl sub_8078438 + ldr r0, =0x0203229c + ldr r1, [r0] + b _080787A2 + .pool +_08078598: + cmp r5, 0 + bne _080785A2 + movs r0, 0x1 + bl sub_80771AC +_080785A2: + ldr r0, =0x0203229c + ldr r1, [r0] + b _080787A2 + .pool +_080785AC: + bl sub_8077200 + cmp r0, 0x3 + beq _080785B6 + b _080787AA +_080785B6: + ldr r0, =0x0202480c + movs r2, 0x1 + adds r1, r5, 0 + eors r1, r2 + lsls r1, 8 + ldr r2, =0x020223c4 + adds r1, r2 + movs r2, 0xC8 + bl sub_8078438 + bl sub_8077210 + ldr r0, =0x0203229c + ldr r1, [r0] + b _080787A2 + .pool +_080785E0: + ldr r0, =0x020228c4 + ldr r1, =0x0202467c + movs r2, 0xC8 + bl sub_8078438 + ldr r0, =0x0203229c + ldr r1, [r0] + b _080787A2 + .pool +_080785FC: + cmp r5, 0 + bne _08078606 + movs r0, 0x1 + bl sub_80771AC +_08078606: + ldr r0, =0x0203229c + ldr r1, [r0] + b _080787A2 + .pool +_08078610: + bl sub_8077200 + cmp r0, 0x3 + beq _0807861A + b _080787AA +_0807861A: + ldr r0, =0x020248d4 + movs r2, 0x1 + adds r1, r5, 0 + eors r1, r2 + lsls r1, 8 + ldr r2, =0x020223c4 + adds r1, r2 + movs r2, 0xC8 + bl sub_8078438 + bl sub_8077210 + ldr r0, =0x0203229c + ldr r1, [r0] + b _080787A2 + .pool +_08078644: + ldr r0, =0x020228c4 + ldr r1, =0x03005d8c + ldr r1, [r1] + ldr r2, =0x00002be0 + adds r1, r2 + movs r2, 0xDC + bl sub_8078438 + ldr r0, =0x0203229c + ldr r1, [r0] + b _080787A2 + .pool +_0807866C: + cmp r5, 0 + bne _08078676 + movs r0, 0x3 + bl sub_80771AC +_08078676: + ldr r0, =0x0203229c + ldr r1, [r0] + b _080787A2 + .pool +_08078680: + bl sub_8077200 + cmp r0, 0x3 + beq _0807868A + b _080787AA +_0807868A: + ldr r0, =0x020321c0 + movs r2, 0x1 + adds r1, r5, 0 + eors r1, r2 + lsls r1, 8 + ldr r2, =0x020223c4 + adds r1, r2 + movs r2, 0xD8 + bl sub_8078438 + bl sub_8077210 + ldr r0, =0x0203229c + ldr r1, [r0] + b _080787A2 + .pool +_080786B4: + ldr r0, =0x020228c4 + ldr r1, =0x03005d8c + ldr r1, [r1] + ldr r2, =0x000031a8 + adds r1, r2 + movs r2, 0xB + bl sub_8078438 + ldr r0, =0x0203229c + ldr r1, [r0] + b _080787A2 + .pool +_080786DC: + cmp r5, 0 + bne _080786E6 + movs r0, 0x4 + bl sub_80771AC +_080786E6: + ldr r0, =0x0203229c + ldr r1, [r0] + b _080787A2 + .pool +_080786F0: + bl sub_8077200 + cmp r0, 0x3 + bne _080787AA + ldr r4, =0x0203229c + ldr r0, [r4] + adds r0, 0xA9 + movs r2, 0x1 + adds r1, r5, 0 + eors r1, r2 + lsls r1, 8 + ldr r2, =0x020223c4 + adds r1, r2 + movs r2, 0xB + bl sub_8078438 + bl sub_8077210 + ldr r1, [r4] + b _080787A2 + .pool +_08078720: + ldr r4, =0x02024744 + ldr r6, =0x0000012f + movs r5, 0x5 +_08078726: + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + beq _08078766 + cmp r0, r6 + bne _08078766 + adds r0, r4, 0 + movs r1, 0x3 + bl pokemon_getattr + cmp r0, 0x1 + beq _08078766 + adds r0, r4, 0 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + mov r0, sp + ldr r1, =gUnknown_0832DF94 + bl CompareStringWithoutExtendedControlCodes + cmp r0, 0 + bne _08078766 + adds r0, r4, 0 + movs r1, 0x2 + ldr r2, =gSpeciesNames + SPECIES_SHEDINJA * POKEMON_NAME_LENGTH + bl pokemon_setattr +_08078766: + adds r4, 0x64 + subs r5, 0x1 + cmp r5, 0 + bge _08078726 + movs r0, 0x1 + b _080787AC + .pool +_08078784: + ldr r2, =0x0203229c + ldr r1, [r2] + adds r1, 0xA8 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r2] + adds r1, r0, 0 + adds r1, 0xA8 + ldrb r0, [r1] + cmp r0, 0xA + bls _080787AA + movs r0, 0 + strb r0, [r1] + ldr r1, [r2] +_080787A2: + adds r1, 0x69 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080787AA: + movs r0, 0 +_080787AC: + add sp, 0xC + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end shedinja_maker_maybe + + thumb_func_start sub_80787B8 +sub_80787B8: @ 80787B8 + push {lr} + ldr r0, =gUnknown_0832DAE5 + ldr r1, =0x0203229c + ldr r1, [r1] + adds r1, 0x72 + ldrh r1, [r1] + lsls r1, 5 + ldr r2, =0x06010000 + adds r1, r2 + movs r2, 0x18 + bl sub_807A308 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80787B8 + + thumb_func_start sub_80787E0 +sub_80787E0: @ 80787E0 + push {r4,lr} + lsls r1, 24 + lsrs r4, r1, 24 + movs r2, 0x1 + adds r0, r4, 0 + ands r0, r2 + cmp r0, 0 + beq _08078864 + ldr r0, =0x020223c4 + ldrh r1, [r0] + ldr r0, =0x0000bbbb + cmp r1, r0 + beq _08078844 + cmp r1, r0 + bgt _08078814 + ldr r0, =0x0000aabb + cmp r1, r0 + beq _08078834 + b _0807885E + .pool +_08078814: + ldr r0, =0x0000bbcc + cmp r1, r0 + beq _08078854 + ldr r0, =0x0000eeaa + cmp r1, r0 + bne _0807885E + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x78 + b _0807885A + .pool +_08078834: + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x78 + strb r2, [r0] + b _0807885E + .pool +_08078844: + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x7A + strb r2, [r0] + b _0807885E + .pool +_08078854: + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x7A +_0807885A: + movs r1, 0x2 + strb r1, [r0] +_0807885E: + movs r0, 0 + bl sub_8077234 +_08078864: + movs r2, 0x2 + adds r0, r4, 0 + ands r0, r2 + cmp r0, 0 + beq _080788F6 + ldr r3, =0x020223c4 + movs r1, 0x80 + lsls r1, 1 + adds r0, r3, r1 + ldrh r1, [r0] + ldr r0, =0x0000bbbb + cmp r1, r0 + beq _080788D8 + cmp r1, r0 + bgt _0807889C + ldr r0, =0x0000aabb + cmp r1, r0 + beq _080788BC + b _080788F0 + .pool +_0807889C: + ldr r0, =0x0000bbcc + cmp r1, r0 + beq _080788E8 + ldr r0, =0x0000eeaa + cmp r1, r0 + bne _080788F0 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x79 + b _080788EE + .pool +_080788BC: + ldr r2, =0x0203229c + ldr r1, [r2] + movs r4, 0x81 + lsls r4, 1 + adds r0, r3, r4 + ldrb r0, [r0] + adds r0, 0x6 + adds r1, 0x7E + strb r0, [r1] + ldr r0, [r2] + adds r0, 0x79 + b _080788DE + .pool +_080788D8: + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x7B +_080788DE: + movs r1, 0x1 + strb r1, [r0] + b _080788F0 + .pool +_080788E8: + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x7B +_080788EE: + strb r2, [r0] +_080788F0: + movs r0, 0x1 + bl sub_8077234 +_080788F6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80787E0 + + thumb_func_start sub_8078900 +sub_8078900: @ 8078900 + push {r4,r5,lr} + sub sp, 0x4 + lsls r1, 24 + lsrs r5, r1, 24 + movs r0, 0x1 + ands r0, r5 + cmp r0, 0 + beq _080789E2 + ldr r2, =0x020223c4 + ldrh r1, [r2] + ldr r0, =0x0000ddee + cmp r1, r0 + beq _080789CC + cmp r1, r0 + bgt _0807893C + ldr r0, =0x0000ccdd + cmp r1, r0 + beq _080789AC + ldr r0, =0x0000dddd + cmp r1, r0 + beq _08078978 + b _080789DC + .pool +_0807893C: + ldr r0, =0x0000eebb + cmp r1, r0 + beq _08078950 + adds r0, 0x11 + cmp r1, r0 + beq _08078974 + b _080789DC + .pool +_08078950: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + movs r0, 0x4 + bl sub_807A19C + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0xB + b _080789DA + .pool +_08078974: + movs r0, 0x5 + b _080789CE +_08078978: + ldr r4, =0x0203229c + ldr r1, [r4] + ldrb r0, [r2, 0x2] + adds r0, 0x6 + adds r1, 0x7E + strb r0, [r1] + movs r0, 0 + bl rbox_fill_rectangle + ldr r0, [r4] + adds r0, 0x35 + ldrb r0, [r0] + bl sub_807967C + ldr r0, [r4] + adds r0, 0x7E + ldrb r0, [r0] + bl sub_807967C + ldr r0, [r4] + adds r0, 0x6F + movs r1, 0x7 + b _080789DA + .pool +_080789AC: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0xA + b _080789DA + .pool +_080789CC: + movs r0, 0x1 +_080789CE: + bl sub_807A19C + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0x8 +_080789DA: + strb r1, [r0] +_080789DC: + movs r0, 0 + bl sub_8077234 +_080789E2: + movs r0, 0x2 + ands r0, r5 + cmp r0, 0 + beq _080789F0 + movs r0, 0x1 + bl sub_8077234 +_080789F0: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8078900 + + thumb_func_start sub_80789FC +sub_80789FC: @ 80789FC + push {r4-r6,lr} + sub sp, 0x4 + ldr r6, =0x0203229c + ldr r2, [r6] + adds r1, r2, 0 + adds r1, 0x78 + ldrb r0, [r1] + cmp r0, 0 + bne _08078A10 + b _08078B44 +_08078A10: + adds r0, r2, 0 + adds r0, 0x79 + ldrb r0, [r0] + cmp r0, 0 + bne _08078A1C + b _08078B44 +_08078A1C: + ldrh r1, [r1] + ldr r0, =0x00000101 + cmp r1, r0 + bne _08078A64 + adds r1, r2, 0 + adds r1, 0x6F + movs r0, 0x6 + strb r0, [r1] + ldr r2, [r6] + adds r1, r2, 0 + adds r1, 0x80 + movs r4, 0 + ldr r0, =0x0000dddd + strh r0, [r1] + adds r0, r2, 0 + adds r0, 0x35 + ldrb r1, [r0] + adds r0, 0x4D + strh r1, [r0] + movs r0, 0x5 + movs r1, 0 + bl sub_807A048 + ldr r0, [r6] + adds r2, r0, 0 + adds r2, 0x79 + strb r4, [r2] + adds r0, 0x78 + strb r4, [r0] + b _08078B44 + .pool +_08078A64: + ldr r0, =0x00000201 + cmp r1, r0 + bne _08078AB4 + movs r0, 0x1 + bl sub_807A19C + ldr r1, [r6] + adds r2, r1, 0 + adds r2, 0x80 + movs r4, 0 + movs r3, 0 + ldr r0, =0x0000eecc + strh r0, [r2] + adds r1, 0x82 + strh r3, [r1] + movs r0, 0x5 + movs r1, 0 + bl sub_807A048 + ldr r0, [r6] + adds r1, r0, 0 + adds r1, 0x7B + strb r4, [r1] + adds r0, 0x7A + strb r4, [r0] + ldr r0, [r6] + adds r1, r0, 0 + adds r1, 0x79 + strb r4, [r1] + adds r0, 0x78 + strb r4, [r0] + ldr r0, [r6] + adds r0, 0x6F + movs r1, 0x8 + b _08078B42 + .pool +_08078AB4: + movs r0, 0x81 + lsls r0, 1 + cmp r1, r0 + bne _08078B00 + movs r0, 0x5 + bl sub_807A19C + ldr r1, [r6] + adds r2, r1, 0 + adds r2, 0x80 + movs r4, 0 + movs r3, 0 + ldr r0, =0x0000ddee + strh r0, [r2] + adds r1, 0x82 + strh r3, [r1] + movs r0, 0x5 + movs r1, 0 + bl sub_807A048 + ldr r0, [r6] + adds r1, r0, 0 + adds r1, 0x7B + strb r4, [r1] + adds r0, 0x7A + strb r4, [r0] + ldr r0, [r6] + adds r1, r0, 0 + adds r1, 0x79 + strb r4, [r1] + adds r0, 0x78 + strb r4, [r0] + ldr r0, [r6] + adds r0, 0x6F + movs r1, 0x8 + b _08078B42 + .pool +_08078B00: + ldr r0, =0x00000202 + cmp r1, r0 + bne _08078B44 + adds r1, r2, 0 + adds r1, 0x80 + movs r5, 0 + movs r4, 0 + ldr r0, =0x0000eebb + strh r0, [r1] + adds r0, r2, 0 + adds r0, 0x82 + strh r4, [r0] + movs r0, 0x5 + movs r1, 0 + bl sub_807A048 + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, [r6] + adds r1, r0, 0 + adds r1, 0x79 + strb r5, [r1] + adds r0, 0x78 + strb r5, [r0] + ldr r0, [r6] + adds r0, 0x6F + movs r1, 0xB +_08078B42: + strb r1, [r0] +_08078B44: + ldr r5, =0x0203229c + ldr r3, [r5] + adds r1, r3, 0 + adds r1, 0x7A + ldrb r0, [r1] + cmp r0, 0 + beq _08078BDC + adds r0, r3, 0 + adds r0, 0x7B + ldrb r0, [r0] + cmp r0, 0 + beq _08078BDC + ldrh r1, [r1] + ldr r0, =0x00000101 + cmp r1, r0 + bne _08078B92 + adds r1, r3, 0 + adds r1, 0x80 + movs r4, 0 + movs r2, 0 + ldr r0, =0x0000ccdd + strh r0, [r1] + adds r0, r3, 0 + adds r0, 0x82 + strh r2, [r0] + movs r0, 0x5 + movs r1, 0 + bl sub_807A048 + ldr r0, [r5] + adds r0, 0x7A + strb r4, [r0] + ldr r0, [r5] + adds r0, 0x7B + strb r4, [r0] + ldr r0, [r5] + adds r0, 0x6F + movs r1, 0x9 + strb r1, [r0] +_08078B92: + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0x7A + ldrb r0, [r0] + cmp r0, 0x2 + beq _08078BA8 + adds r0, r1, 0 + adds r0, 0x7B + ldrb r0, [r0] + cmp r0, 0x2 + bne _08078BDC +_08078BA8: + movs r0, 0x1 + bl sub_807A19C + ldr r1, [r5] + adds r2, r1, 0 + adds r2, 0x80 + movs r4, 0 + movs r3, 0 + ldr r0, =0x0000ddee + strh r0, [r2] + adds r1, 0x82 + strh r3, [r1] + movs r0, 0x5 + movs r1, 0 + bl sub_807A048 + ldr r0, [r5] + adds r0, 0x7A + strb r4, [r0] + ldr r0, [r5] + adds r0, 0x7B + strb r4, [r0] + ldr r0, [r5] + adds r0, 0x6F + movs r1, 0x8 + strb r1, [r0] +_08078BDC: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80789FC + + thumb_func_start sub_8078BFC +sub_8078BFC: @ 8078BFC + push {lr} + strh r1, [r0] + strh r2, [r0, 0x2] + movs r0, 0x5 + movs r1, 0 + bl sub_807A048 + pop {r0} + bx r0 + thumb_func_end sub_8078BFC + + thumb_func_start sub_8078C10 +sub_8078C10: @ 8078C10 + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + lsls r3, 16 + lsrs r3, 16 + lsls r2, 16 + lsrs r2, 16 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x80 + adds r1, r3, 0 + bl sub_8078BFC + pop {r0} + bx r0 + .pool + thumb_func_end sub_8078C10 + + thumb_func_start sub_8078C34 +sub_8078C34: @ 8078C34 + push {r4,lr} + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8077200 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _08078C5C + cmp r4, 0 + bne _08078C56 + movs r0, 0 + bl sub_80787E0 + b _08078C5C +_08078C56: + adds r0, r4, 0 + bl sub_8078900 +_08078C5C: + cmp r4, 0 + bne _08078C64 + bl sub_80789FC +_08078C64: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8078C34 + + thumb_func_start sub_8078C6C +sub_8078C6C: @ 8078C6C + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + movs r6, 0 + movs r5, 0 + ldr r2, =0x0203229c + ldr r3, [r2] + ldr r4, =gUnknown_0832DCEC + lsls r2, r1, 1 + adds r2, r1 + lsls r2, 1 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r3, 0x38 + adds r2, r1 + adds r2, r4 +_08078C92: + ldrb r1, [r2] + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08078CA8 + adds r6, r1, 0 + b _08078CB0 + .pool +_08078CA8: + adds r2, 0x1 + adds r5, 0x1 + cmp r5, 0x5 + ble _08078C92 +_08078CB0: + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8078C6C + + thumb_func_start sub_8078CB8 +sub_8078CB8: @ 8078CB8 + push {r4-r7,lr} + adds r7, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldrb r0, [r7] + bl sub_8078C6C + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0xC + bne _08078D10 + ldr r5, =0x0203229c + ldr r0, [r5] + adds r0, 0x34 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + movs r1, 0x1 + bl StartObjectImageAnim + ldr r2, [r5] + adds r2, 0x34 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xE0 + strh r1, [r0, 0x20] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xA0 + strh r1, [r0, 0x22] + b _08078D58 + .pool +_08078D10: + ldr r4, =0x0203229c + ldr r0, [r4] + adds r0, 0x34 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, =0x02020630 + adds r0, r5 + movs r1, 0 + bl StartObjectImageAnim + ldr r4, [r4] + adds r4, 0x34 + ldrb r0, [r4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldr r2, =gUnknown_0832DE24 + lsls r3, r6, 1 + adds r0, r3, r2 + ldrb r0, [r0] + lsls r0, 3 + adds r0, 0x20 + strh r0, [r1, 0x20] + ldrb r0, [r4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + adds r2, 0x1 + adds r3, r2 + ldrb r0, [r3] + lsls r0, 3 + strh r0, [r1, 0x22] +_08078D58: + ldrb r0, [r7] + cmp r0, r6 + beq _08078D64 + movs r0, 0x5 + bl audio_play +_08078D64: + strb r6, [r7] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8078CB8 + + thumb_func_start sub_8078D78 +sub_8078D78: @ 8078D78 + push {r4,lr} + movs r0, 0 + bl sub_807A19C + ldr r4, =0x0203229c + ldr r0, [r4] + adds r0, 0x6F + movs r1, 0x64 + strb r1, [r0] + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08078DAC + ldr r0, =0x0000aabb + ldr r1, [r4] + adds r1, 0x35 + ldrb r1, [r1] + bl sub_8078C10 + b _08078DB4 + .pool +_08078DAC: + ldr r0, [r4] + adds r0, 0x78 + movs r1, 0x1 + strb r1, [r0] +_08078DB4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8078D78 + + thumb_func_start sub_8078DBC +sub_8078DBC: @ 8078DBC + push {r4,lr} + sub sp, 0x4 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08078DE4 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x35 + movs r1, 0 + bl sub_8078CB8 + b _08078E30 + .pool +_08078DE4: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08078E00 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x35 + movs r1, 0x1 + bl sub_8078CB8 + b _08078E30 + .pool +_08078E00: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08078E1C + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x35 + movs r1, 0x2 + bl sub_8078CB8 + b _08078E30 + .pool +_08078E1C: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08078E30 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x35 + movs r1, 0x3 + bl sub_8078CB8 +_08078E30: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08078EE4 + movs r0, 0x5 + bl audio_play + ldr r4, =0x0203229c + ldr r0, [r4] + adds r0, 0x35 + ldrb r0, [r0] + cmp r0, 0x5 + bhi _08078E98 + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0xE + bl sub_8098858 + movs r0, 0x1 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r2, =gUnknown_0832DEAC + movs r0, 0x1 + movs r1, 0x2 + bl PrintMenuTable + movs r0, 0x1 + movs r1, 0x2 + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0x1 + movs r1, 0x3 + bl CopyWindowToVram + ldr r0, [r4] + adds r0, 0x6F + movs r1, 0x1 + strb r1, [r0] + b _08078EE4 + .pool +_08078E98: + cmp r0, 0xB + bhi _08078EB6 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, [r4] + adds r0, 0x6F + movs r1, 0x2 + strb r1, [r0] + b _08078EE4 +_08078EB6: + cmp r0, 0xC + bne _08078EE4 + ldr r0, =gUnknown_0832DF8C + movs r1, 0x1 + movs r2, 0xE + movs r3, 0 + bl CreateYesNoMenu + ldr r0, [r4] + adds r0, 0x6F + movs r1, 0x4 + strb r1, [r0] + ldr r0, =gUnknown_0832DE94 + ldr r0, [r0, 0x10] + ldr r1, [r4] + adds r1, 0x72 + ldrh r1, [r1] + lsls r1, 5 + ldr r2, =0x06010000 + adds r1, r2 + movs r2, 0x18 + bl sub_807A308 +_08078EE4: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8078DBC + + thumb_func_start sub_8078EF8 +sub_8078EF8: @ 8078EF8 + push {lr} + bl sub_8079F74 + ldr r3, =0x0203229c + ldr r0, [r3] + adds r0, 0x6F + movs r1, 0 + strb r1, [r0] + ldr r2, =0x02020630 + ldr r0, [r3] + adds r0, 0x34 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + ldr r0, =gUnknown_0832DE94 + ldr r0, [r0, 0x4] + ldr r1, [r3] + adds r1, 0x72 + ldrh r1, [r1] + lsls r1, 5 + ldr r2, =0x06010000 + adds r1, r2 + movs r2, 0x18 + bl sub_807A308 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8078EF8 + + thumb_func_start sub_8078F50 +sub_8078F50: @ 8078F50 + push {lr} + sub sp, 0x4 + bl ProcessMenuInputNoWrapAround + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _08078F72 + cmp r0, r1 + ble _0807902A + cmp r0, 0 + beq _08078F7E + cmp r0, 0x1 + beq _08078F9C + b _0807902A +_08078F72: + movs r0, 0x5 + bl audio_play + bl sub_8078EF8 + b _0807902A +_08078F7E: + str r0, [sp] + adds r0, r1, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0x2 + b _08079028 + .pool +_08078F9C: + ldr r0, =0x020244ec + ldr r1, =0x020244e9 + ldrb r1, [r1] + ldr r2, =0x0203229c + ldr r2, [r2] + adds r2, 0x35 + ldrb r2, [r2] + bl sub_807A5F4 + cmp r0, 0x5 + bhi _0807902A + lsls r0, 2 + ldr r1, =_08078FCC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08078FCC: + .4byte _08078FE4 + .4byte _0807900C + .4byte _08079012 + .4byte _08079018 + .4byte _08079012 + .4byte _08079018 +_08078FE4: + bl sub_8078D78 + ldr r2, =0x02020630 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x34 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + b _08079028 + .pool +_0807900C: + movs r0, 0x3 + movs r1, 0x3 + b _0807901C +_08079012: + movs r0, 0x3 + movs r1, 0x6 + b _0807901C +_08079018: + movs r0, 0x3 + movs r1, 0x7 +_0807901C: + bl sub_807A048 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0x8 +_08079028: + strb r1, [r0] +_0807902A: + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8078F50 + + thumb_func_start sub_8079034 +sub_8079034: @ 8079034 + push {lr} + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0807904A + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08079054 +_0807904A: + movs r0, 0x5 + bl audio_play + bl sub_8078EF8 +_08079054: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8079034 + + thumb_func_start sub_807905C +sub_807905C: @ 807905C + push {lr} + sub sp, 0x4 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080790C4 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r3, r0, 0 + adds r3, 0x35 + ldrb r2, [r3] + cmp r2, 0x5 + bhi _080790A4 + ldr r1, =0x020244ec + ldrb r2, [r3] + adds r0, 0x36 + ldrb r3, [r0] + subs r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =sub_8077B74 + str r0, [sp] + movs r0, 0x1 + bl sub_81BF8EC + b _080790C0 + .pool +_080790A4: + ldr r1, =0x02024744 + subs r2, 0x6 + lsls r2, 24 + lsrs r2, 24 + adds r0, 0x37 + ldrb r3, [r0] + subs r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =sub_8077B74 + str r0, [sp] + movs r0, 0x1 + bl sub_81BF8EC +_080790C0: + bl FreeAllWindowBuffers +_080790C4: + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_807905C + + thumb_func_start sub_80790D4 +sub_80790D4: @ 80790D4 + push {r4-r7,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r6, r3, 24 + movs r5, 0 + movs r3, 0 + ldr r7, =0x02024744 + cmp r5, r1 + bge _08079102 +_080790EE: + cmp r2, r3 + beq _080790FC + adds r0, r4, r3 + ldrb r0, [r0] + adds r0, r5, r0 + lsls r0, 24 + lsrs r5, r0, 24 +_080790FC: + adds r3, 0x1 + cmp r3, r1 + blt _080790EE +_08079102: + adds r0, r6, 0 + movs r1, 0x6 + bl __umodsi3 + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0x64 + muls r0, r6 + adds r7, r0, r7 + adds r0, r7, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0xCD + lsls r0, 1 + cmp r4, r0 + beq _0807912C + cmp r4, 0x97 + bne _08079138 +_0807912C: + adds r0, r7, 0 + movs r1, 0x50 + bl pokemon_getattr + cmp r0, 0 + beq _08079158 +_08079138: + bl sub_809D42C + cmp r0, 0 + bne _08079164 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x57 + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0 + bne _08079158 + adds r0, r4, 0 + bl sub_806E3F8 + cmp r0, 0 + bne _08079164 +_08079158: + movs r0, 0x2 + b _0807916C + .pool +_08079164: + cmp r5, 0 + beq _0807916A + movs r5, 0x1 +_0807916A: + adds r0, r5, 0 +_0807916C: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80790D4 + + thumb_func_start sub_8079174 +sub_8079174: @ 8079174 + push {r4,r5,lr} + sub sp, 0xC + movs r2, 0 + ldr r0, =0x0203229c + ldr r1, [r0] + adds r3, r1, 0 + adds r3, 0x36 + adds r5, r0, 0 + ldrb r0, [r3] + cmp r2, r0 + bge _080791A0 + adds r4, r1, 0 + adds r4, 0x45 +_0807918E: + mov r1, sp + adds r0, r1, r2 + adds r1, r4, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + ldrb r0, [r3] + cmp r2, r0 + blt _0807918E +_080791A0: + ldr r0, [r5] + adds r1, r0, 0 + adds r1, 0x36 + ldrb r1, [r1] + adds r2, r0, 0 + adds r2, 0x35 + ldrb r2, [r2] + adds r0, 0x7E + ldrb r3, [r0] + mov r0, sp + bl sub_80790D4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080791E8 + cmp r0, 0x1 + bgt _080791D0 + cmp r0, 0 + beq _080791D6 + b _0807920C + .pool +_080791D0: + cmp r0, 0x2 + beq _08079200 + b _0807920C +_080791D6: + movs r0, 0x3 + movs r1, 0x3 + bl sub_807A048 + ldr r0, =0x0000bbcc + b _080791F2 + .pool +_080791E8: + movs r0, 0x3 + movs r1, 0x1 + bl sub_807A048 + ldr r0, =0x0000bbbb +_080791F2: + movs r1, 0 + bl sub_8078C10 + b _0807920C + .pool +_08079200: + movs r0, 0x3 + movs r1, 0x8 + bl sub_807A048 + movs r0, 0x1 + b _0807920E +_0807920C: + movs r0, 0 +_0807920E: + add sp, 0xC + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8079174 + + thumb_func_start sub_8079218 +sub_8079218: @ 8079218 + push {lr} + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _0807923A + cmp r1, 0 + bgt _08079234 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08079268 + b _08079290 +_08079234: + cmp r1, 0x1 + beq _08079268 + b _08079290 +_0807923A: + bl sub_8079174 + cmp r0, 0 + bne _08079250 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0x64 + b _08079258 + .pool +_08079250: + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0x11 +_08079258: + strb r1, [r0] + movs r0, 0x11 + bl PutWindowTilemap + b _08079290 + .pool +_08079268: + movs r0, 0x3 + movs r1, 0x1 + bl sub_807A048 + bl sub_80771BC + cmp r0, 0 + beq _08079280 + ldr r0, =0x0000bbcc + movs r1, 0 + bl sub_8078C10 +_08079280: + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0x64 + strb r1, [r0] + movs r0, 0x11 + bl PutWindowTilemap +_08079290: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8079218 + + thumb_func_start sub_807929C +sub_807929C: @ 807929C + push {r4-r6,lr} + movs r5, 0 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x37 + ldrb r0, [r0] + subs r0, 0x4 + cmp r5, r0 + bge _080792D8 + movs r6, 0xC0 + lsls r6, 20 +_080792B2: + lsrs r4, r6, 24 + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x1 + bl CopyWindowToVram + movs r0, 0x80 + lsls r0, 17 + adds r6, r0 + adds r5, 0x1 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x37 + ldrb r0, [r0] + subs r0, 0x4 + cmp r5, r0 + blt _080792B2 +_080792D8: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807929C + + thumb_func_start sub_80792E4 +sub_80792E4: @ 80792E4 + push {lr} + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _08079306 + cmp r1, 0 + bgt _08079300 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0807934C + b _08079356 +_08079300: + cmp r1, 0x1 + beq _0807934C + b _08079356 +_08079306: + movs r0, 0x4 + bl sub_807A19C + ldr r0, =0x0000eeaa + movs r1, 0 + bl sub_8078C10 + ldr r2, =0x02020630 + ldr r3, =0x0203229c + ldr r0, [r3] + adds r0, 0x34 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r3] + adds r0, 0x6F + movs r1, 0x64 + strb r1, [r0] + bl sub_807929C + b _08079356 + .pool +_0807934C: + movs r0, 0x5 + bl audio_play + bl sub_8078EF8 +_08079356: + pop {r0} + bx r0 + thumb_func_end sub_80792E4 + + thumb_func_start sub_807935C +sub_807935C: @ 807935C + push {r4,lr} + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _08079384 + movs r0, 0 + bl rbox_fill_rectangle + ldr r4, =0x0203229c + ldr r0, [r4] + adds r0, 0x35 + ldrb r0, [r0] + bl sub_807967C + ldr r0, [r4] + adds r0, 0x7E + ldrb r0, [r0] + bl sub_807967C +_08079384: + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0x7 + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807935C + + thumb_func_start sub_8079398 +sub_8079398: @ 8079398 + push {r4,lr} + ldr r4, =0x0203229c + ldr r0, [r4] + adds r0, 0x74 + ldrh r1, [r0] + ldr r0, =0x00000505 + cmp r1, r0 + bne _080793B4 + bl sub_80787B8 + ldr r0, [r4] + adds r0, 0x6F + movs r1, 0xE + strb r1, [r0] +_080793B4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8079398 + + thumb_func_start sub_80793C4 +sub_80793C4: @ 80793C4 + push {r4,lr} + ldr r4, =0x0203229c + ldr r1, [r4] + adds r1, 0xA8 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r4] + adds r0, 0xA8 + ldrb r0, [r0] + cmp r0, 0x78 + bls _080793F8 + ldr r0, =gUnknown_0832DF8C + movs r1, 0x1 + movs r2, 0xE + movs r3, 0 + bl CreateYesNoMenu + ldr r0, [r4] + adds r0, 0xA8 + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x6F + movs r1, 0x3 + strb r1, [r0] +_080793F8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80793C4 + + thumb_func_start sub_8079408 +sub_8079408: @ 8079408 + push {r4-r6,lr} + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0807947C + movs r0, 0x5 + bl audio_play + movs r0, 0 + bl rbox_fill_rectangle + movs r0, 0x1 + bl rbox_fill_rectangle + movs r6, 0 + movs r5, 0xE0 + lsls r5, 20 +_0807942E: + lsrs r4, r5, 24 + adds r0, r4, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r0, r4, 0 + bl rbox_fill_rectangle + movs r0, 0x80 + lsls r0, 17 + adds r5, r0 + adds r6, 0x1 + cmp r6, 0x3 + ble _0807942E + movs r0, 0 + bl sub_8079F88 + movs r0, 0x1 + bl sub_8079F88 + ldr r2, =0x0203229c + ldr r0, [r2] + adds r0, 0x6F + movs r1, 0 + strb r1, [r0] + ldr r3, =0x02020630 + ldr r0, [r2] + adds r0, 0x34 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] +_0807947C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8079408 + + thumb_func_start sub_8079490 +sub_8079490: @ 8079490 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080794C4 + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _080794B4 + bl sub_800ADF8 + b _080794BA + .pool +_080794B4: + movs r0, 0xC + bl sub_800ABF4 +_080794BA: + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0xC + strb r1, [r0] +_080794C4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8079490 + + thumb_func_start sub_80794CC +sub_80794CC: @ 80794CC + push {lr} + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08079518 + bl sub_80771BC + cmp r0, 0 + beq _0807953A + bl sub_807A09C + cmp r0, 0 + bne _0807953A + ldr r0, =0x02032184 + ldr r0, [r0] + bl Free + ldr r0, =0x0203229c + ldr r0, [r0] + bl Free + bl FreeAllWindowBuffers + bl sub_800E084 + ldr r0, =c2_8056854 + bl SetMainCallback2 + b _0807953A + .pool +_08079518: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _0807953A + ldr r0, =0x02032184 + ldr r0, [r0] + bl Free + ldr r0, =0x0203229c + ldr r0, [r0] + bl Free + bl FreeAllWindowBuffers + ldr r0, =c2_8056854 + bl SetMainCallback2 +_0807953A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80794CC + + thumb_func_start sub_8079550 +sub_8079550: @ 8079550 + push {lr} + movs r0, 0 + bl sub_801048C + lsls r0, 24 + cmp r0, 0 + bne _08079574 + bl sub_807A09C + cmp r0, 0 + bne _08079574 + bl sub_800ADF8 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0xD + strb r1, [r0] +_08079574: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8079550 + + thumb_func_start sub_807957C +sub_807957C: @ 807957C + push {lr} + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0807959C + ldr r0, =0x0000bbcc + movs r1, 0 + bl sub_8078C10 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0x64 + strb r1, [r0] +_0807959C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_807957C + + thumb_func_start sub_80795AC +sub_80795AC: @ 80795AC + push {lr} + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x6F + ldrb r0, [r0] + cmp r0, 0x11 + bhi _08079678 + lsls r0, 2 + ldr r1, =_080795CC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080795CC: + .4byte _08079614 + .4byte _0807961A + .4byte _08079620 + .4byte _08079626 + .4byte _0807962C + .4byte _08079678 + .4byte _08079632 + .4byte _08079638 + .4byte _0807963E + .4byte _08079644 + .4byte _0807964A + .4byte _08079650 + .4byte _08079656 + .4byte _0807965C + .4byte _08079662 + .4byte _08079668 + .4byte _0807966E + .4byte _08079674 +_08079614: + bl sub_8078DBC + b _08079678 +_0807961A: + bl sub_8078F50 + b _08079678 +_08079620: + bl sub_807905C + b _08079678 +_08079626: + bl sub_8079218 + b _08079678 +_0807962C: + bl sub_80792E4 + b _08079678 +_08079632: + bl sub_807935C + b _08079678 +_08079638: + bl sub_8079398 + b _08079678 +_0807963E: + bl sub_8079408 + b _08079678 +_08079644: + bl sub_8078130 + b _08079678 +_0807964A: + bl sub_807816C + b _08079678 +_08079650: + bl sub_8079490 + b _08079678 +_08079656: + bl sub_80794CC + b _08079678 +_0807965C: + bl sub_80781C8 + b _08079678 +_08079662: + bl sub_80793C4 + b _08079678 +_08079668: + bl sub_8079034 + b _08079678 +_0807966E: + bl sub_8079550 + b _08079678 +_08079674: + bl sub_807957C +_08079678: + pop {r0} + bx r0 + thumb_func_end sub_80795AC + + thumb_func_start sub_807967C +sub_807967C: @ 807967C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + movs r1, 0x6 + bl __udivsi3 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r3, =0x0203229c + ldr r0, [r3] + adds r0, 0x74 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0 + bne _080796A8 + movs r0, 0x1 + strb r0, [r1] + ldr r0, [r3] + adds r0, 0x76 + adds r0, r2 + strb r4, [r0] +_080796A8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807967C + + thumb_func_start sub_80796B4 +sub_80796B4: @ 80796B4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x68 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x0203229c + ldr r4, [r0] + adds r0, r4, 0 + adds r0, 0x76 + adds r0, r7 + ldrb r0, [r0] + movs r1, 0x1 + str r1, [sp, 0x60] + cmp r0, 0x5 + bhi _080796DC + movs r2, 0 + str r2, [sp, 0x60] +_080796DC: + movs r1, 0x6 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + movs r0, 0 + mov r8, r0 + adds r0, r4, 0 + adds r0, 0x74 + adds r3, r0, r7 + ldrb r0, [r3] + cmp r0, 0x2 + bne _080796FA + b _08079884 +_080796FA: + cmp r0, 0x2 + bgt _08079708 + cmp r0, 0x1 + beq _08079716 + b _08079A24 + .pool +_08079708: + cmp r0, 0x3 + bne _0807970E + b _080798BC +_0807970E: + cmp r0, 0x4 + bne _08079714 + b _080799EC +_08079714: + b _08079A24 +_08079716: + movs r5, 0 + adds r0, r4, 0 + adds r0, 0x36 + adds r0, r7 + ldr r1, [sp, 0x60] + lsls r1, 1 + mov r9, r1 + lsls r6, r7, 1 + lsls r2, r7, 4 + str r2, [sp, 0x64] + ldrb r0, [r0] + cmp r8, r0 + bcs _0807976A + ldr r0, =0x02020630 + mov r8, r0 + ldr r4, =0x0203229c + ldr r0, [sp, 0x60] + add r0, r9 + lsls r2, r0, 1 + movs r3, 0x4 +_0807973E: + ldr r0, [r4] + adds r1, r5, r2 + adds r0, 0x28 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r3 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [r4] + adds r0, 0x36 + adds r0, r7 + ldrb r0, [r0] + cmp r5, r0 + bcc _0807973E +_0807976A: + movs r5, 0 + adds r0, r6, r7 + lsls r0, 1 + adds r4, r0, 0x2 +_08079772: + lsls r0, r5, 24 + asrs r0, 24 + adds r0, r4 + lsls r0, 24 + lsrs r0, 24 + bl ClearWindowTilemap + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _08079772 + ldr r1, =0x02020630 + mov r8, r1 + ldr r2, =0x0203229c + ldr r0, [r2] + ldr r6, [sp, 0x60] + add r6, r9 + lsls r3, r6, 1 + add r10, r3 + adds r0, 0x28 + add r0, r10 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + ldr r0, =0x0203229c + ldr r4, [r0] + adds r4, 0x28 + add r4, r10 + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + movs r1, 0x14 + strh r1, [r0, 0x2E] + ldrb r0, [r4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + add r2, r8 + ldr r5, =gUnknown_0832DE24 + lsls r6, 2 + adds r0, r6, r5 + ldrb r0, [r0] + adds r3, 0x1 + lsls r3, 1 + adds r3, r5 + ldrb r1, [r3] + adds r0, r1 + asrs r0, 1 + lsls r0, 3 + adds r0, 0xE + strh r0, [r2, 0x32] + ldrb r0, [r4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r8 + adds r5, 0x1 + adds r6, r5 + ldrb r0, [r6] + lsls r0, 3 + subs r0, 0xC + strh r0, [r1, 0x36] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + ldr r1, =sub_80D3014 + bl oamt_set_x3A_32 + ldr r2, =0x0203229c + ldr r1, [r2] + adds r1, 0x74 + adds r1, r7 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r2] + adds r0, 0x28 + add r0, r10 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + bl sub_80A6DEC + ldr r1, =gUnknown_0832C8BE + ldr r0, [sp, 0x64] + subs r2, r0, r7 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0xF + str r0, [sp] + movs r0, 0x11 + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r3, 0 + bl CopyToBgTilemapBufferRect_ChangePalette + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldr r1, [sp, 0x60] + cmp r1, 0 + beq _08079868 + b _08079A24 +_08079868: + bl sub_8079F74 + b _08079A24 + .pool +_08079884: + ldr r2, =0x02020630 + ldr r1, [sp, 0x60] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + add r0, r10 + adds r1, r4, 0 + adds r1, 0x28 + adds r1, r0 + ldrb r1, [r1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =sub_80D3014 + cmp r1, r0 + beq _080798AC + b _08079A24 +_080798AC: + movs r0, 0x3 + strb r0, [r3] + b _08079A24 + .pool +_080798BC: + ldr r1, =gUnknown_0832C6C0 + ldr r0, [sp, 0x60] + lsls r2, r0, 4 + subs r2, r0 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0xF + str r0, [sp] + movs r0, 0x11 + str r0, [sp, 0x4] + mov r0, r8 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r3, 0 + bl CopyToBgTilemapBufferRect_ChangePalette + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + ldr r6, =0x02020630 + ldr r1, =0x0203229c + ldr r4, [r1] + ldr r2, [sp, 0x60] + lsls r3, r2, 1 + adds r3, r2 + lsls r1, r3, 1 + mov r2, r10 + adds r0, r2, r1 + adds r4, 0x28 + adds r4, r0 + ldrb r0, [r4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r6 + ldr r5, =gUnknown_0832DE24 + lsls r3, 2 + adds r0, r3, r5 + ldrb r0, [r0] + adds r1, 0x1 + lsls r1, 1 + adds r1, r5 + ldrb r1, [r1] + adds r0, r1 + asrs r0, 1 + lsls r0, 3 + adds r0, 0xE + strh r0, [r2, 0x20] + ldrb r0, [r4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + adds r5, 0x1 + adds r3, r5 + ldrb r0, [r3] + lsls r0, 3 + subs r0, 0xC + strh r0, [r1, 0x22] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + mov r1, r8 + strh r1, [r0, 0x24] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + mov r2, r8 + strh r2, [r0, 0x26] + add r0, sp, 0x14 + ldr r1, [sp, 0x60] + mov r2, r10 + bl sub_8079A3C + lsls r4, r7, 1 + adds r5, r4, 0 + adds r5, 0xE + lsls r5, 24 + lsrs r5, 24 + lsls r0, 24 + asrs r0, 24 + movs r2, 0x50 + subs r2, r0 + lsrs r0, r2, 31 + adds r2, r0 + asrs r2, 1 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_0832DEE0 + mov r8, r0 + str r0, [sp] + movs r1, 0 + str r1, [sp, 0x4] + add r0, sp, 0x14 + str r0, [sp, 0x8] + adds r0, r5, 0 + movs r3, 0x4 + bl box_print + add r6, sp, 0x28 + adds r0, r6, 0 + ldr r1, [sp, 0x60] + mov r2, r10 + bl sub_8079AA4 + adds r4, 0xF + lsls r4, 24 + lsrs r4, 24 + movs r1, 0 + str r1, [sp] + str r1, [sp, 0x4] + mov r2, r8 + str r2, [sp, 0x8] + str r1, [sp, 0xC] + str r6, [sp, 0x10] + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + movs r3, 0 + bl AddTextPrinterParametrized2 + adds r0, r5, 0 + bl PutWindowTilemap + adds r0, r5, 0 + movs r1, 0x3 + bl CopyWindowToVram + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + ldr r0, =0x0203229c + ldr r1, [r0] + b _08079A1A + .pool +_080799EC: + ldr r0, =gUnknown_0832DF99 + lsls r1, r7, 1 + adds r4, r1, r0 + ldrb r2, [r4] + adds r2, 0x4 + lsls r2, 24 + lsrs r2, 24 + adds r0, 0x1 + adds r1, r0 + ldrb r3, [r1] + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + ldrb r0, [r4] + str r0, [sp] + ldrb r0, [r1] + str r0, [sp, 0x4] + adds r0, r7, 0 + mov r1, r10 + bl sub_8079C4C + ldr r2, =0x0203229c + ldr r1, [r2] +_08079A1A: + adds r1, 0x74 + adds r1, r7 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_08079A24: + add sp, 0x68 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80796B4 + + thumb_func_start sub_8079A3C +sub_8079A3C: @ 8079A3C + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + lsls r1, 24 + lsls r2, 24 + lsrs r2, 24 + cmp r1, 0 + bne _08079A64 + movs r0, 0x64 + muls r0, r2 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + b _08079A74 + .pool +_08079A64: + movs r0, 0x64 + muls r0, r2 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr +_08079A74: + adds r0, r4, 0 + mov r1, sp + bl CopyString_Limit10 + movs r0, 0 + movs r1, 0x2 + bl GetFontAttribute + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0 + adds r1, r4, 0 + bl GetStringWidth + lsls r0, 24 + lsrs r0, 24 + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8079A3C + + thumb_func_start sub_8079AA4 +sub_8079AA4: @ 8079AA4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + adds r6, r0, 0 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =0x0203229c + ldr r1, [r0] + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 1 + adds r0, r2, r0 + adds r1, 0x51 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + bne _08079B5C + movs r4, 0 + movs r0, 0x64 + adds r5, r2, 0 + muls r5, r0 + ldr r0, =0x020244ec + mov r9, r0 + ldr r2, =0x02024744 + mov r8, r2 +_08079ADE: + cmp r7, 0 + bne _08079AF8 + adds r1, r4, 0 + adds r1, 0xD + mov r2, r9 + b _08079AFE + .pool +_08079AF8: + adds r1, r4, 0 + adds r1, 0xD + mov r2, r8 +_08079AFE: + adds r0, r5, r2 + movs r2, 0 + bl pokemon_getattr + lsls r1, r4, 1 + add r1, sp + strh r0, [r1] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x3 + bls _08079ADE + ldr r1, =gUnknown_0832DABC + adds r0, r6, 0 + bl CopyString + movs r4, 0 +_08079B20: + lsls r0, r4, 1 + mov r2, sp + adds r1, r2, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _08079B3C + adds r1, r0, 0 + movs r0, 0xD + muls r1, r0 + ldr r0, =gMoveNames + adds r1, r0 + adds r0, r6, 0 + bl AppendString +_08079B3C: + adds r0, r6, 0 + ldr r1, =gUnknown_0832DAD2 + bl AppendString + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x3 + bls _08079B20 + b _08079B6C + .pool +_08079B5C: + ldr r1, =gUnknown_0832DABC + adds r0, r6, 0 + bl CopyString + ldr r1, =gUnknown_0832DADF + adds r0, r6, 0 + bl AppendString +_08079B6C: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8079AA4 + + thumb_func_start sub_8079B84 +sub_8079B84: @ 8079B84 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r1, 0 + adds r5, r2, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 1 + adds r1, 0x2 + lsls r4, 24 + asrs r4, 24 + adds r4, r1 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + adds r1, r5, 0 + movs r2, 0x40 + bl GetStringCenterAlignXOffset + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_0832DEE0 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r5, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0 + movs r3, 0x4 + bl box_print + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8079B84 + + thumb_func_start sub_8079BE0 +sub_8079BE0: @ 8079BE0 + push {r4-r7,lr} + sub sp, 0x34 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r7, =0x02024744 + cmp r6, 0 + bne _08079BF0 + ldr r7, =0x020244ec +_08079BF0: + movs r4, 0 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x36 + adds r0, r6 + ldrb r0, [r0] + cmp r4, r0 + bcs _08079C36 + add r5, sp, 0x14 +_08079C02: + movs r0, 0x64 + muls r0, r4 + adds r0, r7, r0 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + adds r0, r5, 0 + mov r1, sp + bl CopyString_Limit10 + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_8079B84 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x36 + adds r0, r6 + ldrb r0, [r0] + cmp r4, r0 + bcc _08079C02 +_08079C36: + add sp, 0x34 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8079BE0 + + thumb_func_start sub_8079C4C +sub_8079C4C: @ 8079C4C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + ldr r4, [sp, 0x3C] + ldr r5, [sp, 0x40] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + lsls r3, 24 + lsrs r3, 24 + mov r10, r3 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r1, =gUnknown_08DDD704 + movs r0, 0x6 + str r0, [sp] + movs r0, 0x3 + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + movs r0, 0x1 + adds r2, r4, 0 + adds r3, r5, 0 + bl CopyToBgTilemapBufferRect_ChangePalette + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + mov r0, r8 + cmp r0, 0 + bne _08079CB0 + movs r0, 0x64 + muls r0, r7 + ldr r1, =0x020244ec + b _08079CB6 + .pool +_08079CB0: + movs r0, 0x64 + muls r0, r7 + ldr r1, =0x02024744 +_08079CB6: + adds r0, r1 + movs r1, 0x38 + movs r2, 0 + bl pokemon_getattr + lsls r0, 24 + lsrs r6, r0, 24 + ldr r4, =0x0203229c + ldr r5, [r4] + mov r1, r8 + lsls r2, r1, 1 + adds r1, r2, r1 + lsls r1, 1 + adds r1, r7, r1 + adds r0, r5, 0 + adds r0, 0x51 + adds r0, r1 + ldrb r0, [r0] + str r2, [sp, 0x18] + cmp r0, 0 + bne _08079D34 + adds r0, r6, 0 + movs r1, 0xA + bl __udivsi3 + lsls r0, 24 + lsrs r2, r0, 24 + mov r0, r10 + lsls r3, r0, 5 + cmp r2, 0 + beq _08079D08 + mov r1, r9 + adds r0, r1, r3 + lsls r0, 1 + movs r1, 0x8F + lsls r1, 4 + adds r5, r1 + adds r1, r5, r0 + adds r0, r2, 0 + adds r0, 0x60 + strh r0, [r1] +_08079D08: + ldr r4, [r4] + mov r1, r9 + adds r0, r1, r3 + adds r0, 0x1 + lsls r0, 1 + movs r3, 0x8F + lsls r3, 4 + adds r4, r3 + adds r4, r0 + adds r0, r6, 0 + movs r1, 0xA + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x70 + strh r0, [r4] + b _08079D72 + .pool +_08079D34: + mov r1, r10 + lsls r0, r1, 5 + mov r1, r9 + adds r3, r1, r0 + adds r1, r3, 0 + subs r1, 0x20 + lsls r1, 1 + movs r0, 0x8F + lsls r0, 4 + adds r2, r5, r0 + adds r1, r2, r1 + adds r0, r3, 0 + subs r0, 0x21 + lsls r0, 1 + adds r0, r2, r0 + ldrh r0, [r0] + strh r0, [r1] + adds r1, r3, 0 + subs r1, 0x1F + lsls r1, 1 + adds r1, r2, r1 + adds r0, r3, 0 + subs r0, 0x24 + lsls r0, 1 + adds r2, r0 + ldrh r2, [r2] + movs r3, 0x80 + lsls r3, 3 + adds r0, r3, 0 + orrs r0, r2 + strh r0, [r1] +_08079D72: + ldr r0, =0x0203229c + ldr r1, [r0] + ldr r0, [sp, 0x18] + add r0, r8 + lsls r0, 1 + adds r0, r7, r0 + adds r1, 0x51 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _08079D94 + movs r2, 0x90 + lsls r2, 3 + b _08079E16 + .pool +_08079D94: + mov r0, r8 + cmp r0, 0 + bne _08079DC0 + movs r0, 0x64 + adds r4, r7, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + bl pokemon_get_gender + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + movs r1, 0x2 + add r2, sp, 0xC + bl pokemon_getattr + b _08079DDE + .pool +_08079DC0: + movs r0, 0x64 + adds r4, r7, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + bl pokemon_get_gender + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + movs r1, 0x2 + add r2, sp, 0xC + bl pokemon_getattr +_08079DDE: + cmp r5, 0 + beq _08079DF0 + cmp r5, 0xFE + beq _08079E04 + movs r2, 0x83 + b _08079E16 + .pool +_08079DF0: + add r0, sp, 0xC + movs r1, 0 + bl sub_8070ECC + lsls r0, 24 + movs r2, 0x83 + cmp r0, 0 + bne _08079E16 + movs r2, 0x84 + b _08079E16 +_08079E04: + add r0, sp, 0xC + movs r1, 0xFE + bl sub_8070ECC + lsls r0, 24 + movs r2, 0x83 + cmp r0, 0 + bne _08079E16 + movs r2, 0x85 +_08079E16: + ldr r0, =0x0203229c + ldr r1, [r0] + mov r0, r10 + subs r0, 0x1 + lsls r0, 5 + add r0, r9 + adds r0, 0x1 + lsls r0, 1 + movs r3, 0x8F + lsls r3, 4 + adds r1, r3 + adds r1, r0 + strh r2, [r1] + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8079C4C + + thumb_func_start sub_8079E44 +sub_8079E44: @ 8079E44 + push {r4-r7,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r6, r0, 24 + movs r7, 0 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x36 + adds r0, r6 + ldrb r0, [r0] + cmp r7, r0 + bge _08079E94 + lsls r0, r6, 1 + adds r0, r6 + ldr r1, =gUnknown_0832DE3E + lsls r0, 2 + adds r5, r0, r1 + ldr r1, =gUnknown_0832DE56 + adds r4, r0, r1 +_08079E6A: + lsls r1, r7, 24 + lsrs r1, 24 + ldrb r2, [r5] + ldrb r3, [r5, 0x1] + ldrb r0, [r4] + str r0, [sp] + ldrb r0, [r4, 0x1] + str r0, [sp, 0x4] + adds r0, r6, 0 + bl sub_8079C4C + adds r5, 0x2 + adds r4, 0x2 + adds r7, 0x1 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x36 + adds r0, r6 + ldrb r0, [r0] + cmp r7, r0 + blt _08079E6A +_08079E94: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8079E44 + + thumb_func_start sub_8079EA8 +sub_8079EA8: @ 8079EA8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + mov r12, r0 + movs r7, 0 + ldr r3, =0x0203229c + ldr r0, [r3] + adds r0, 0x36 + add r0, r12 + ldrb r0, [r0] + cmp r7, r0 + bge _08079F5A + ldr r6, =0x02020630 + mov r9, r3 + mov r1, r12 + lsls r0, r1, 1 + add r0, r12 + lsls r2, r0, 1 + mov r10, r2 + ldr r1, =gUnknown_0832DE24 + movs r2, 0 + mov r8, r2 + lsls r0, 2 + adds r5, r0, r1 +_08079EE0: + mov r1, r9 + ldr r0, [r1] + mov r2, r10 + adds r4, r7, r2 + adds r0, 0x28 + adds r0, r4 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + adds r1, 0x3E + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + mov r0, r9 + ldr r3, [r0] + adds r2, r3, 0 + adds r2, 0x28 + adds r2, r4 + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r0, [r5] + lsls r0, 3 + adds r0, 0xE + strh r0, [r1, 0x20] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r0, [r5, 0x1] + lsls r0, 3 + subs r0, 0xC + strh r0, [r1, 0x22] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + mov r1, r8 + strh r1, [r0, 0x24] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + mov r2, r8 + strh r2, [r0, 0x26] + adds r5, 0x2 + adds r7, 0x1 + adds r3, 0x36 + add r3, r12 + ldrb r3, [r3] + cmp r7, r3 + blt _08079EE0 +_08079F5A: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8079EA8 + + thumb_func_start sub_8079F74 +sub_8079F74: @ 8079F74 + push {lr} + movs r0, 0x1 + bl rbox_fill_rectangle + movs r0, 0x1 + bl sub_8079BE0 + pop {r0} + bx r0 + thumb_func_end sub_8079F74 + + thumb_func_start sub_8079F88 +sub_8079F88: @ 8079F88 + push {r4-r6,lr} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =gUnknown_0832C8BE + lsls r2, r4, 4 + subs r2, r4 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0xF + str r0, [sp] + movs r0, 0x11 + str r0, [sp, 0x4] + movs r6, 0 + str r6, [sp, 0x8] + movs r0, 0x1 + movs r3, 0 + bl CopyToBgTilemapBufferRect_ChangePalette + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + adds r0, r4, 0 + bl sub_8079E44 + adds r0, r4, 0 + bl sub_8079BE0 + adds r0, r4, 0 + bl sub_8079EA8 + ldr r0, =gUnknown_0832DE94 + ldr r0, [r0, 0x4] + ldr r5, =0x0203229c + ldr r1, [r5] + adds r1, 0x72 + ldrh r1, [r1] + lsls r1, 5 + ldr r2, =0x06010000 + adds r1, r2 + movs r2, 0x18 + bl sub_807A308 + ldr r0, [r5] + adds r0, 0x74 + adds r0, r4 + strb r6, [r0] + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8079F88 + + thumb_func_start sub_807A000 +sub_807A000: @ 807A000 + push {lr} + sub sp, 0x8 + movs r0, 0x1E + str r0, [sp] + movs r0, 0x14 + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0 + bl CopyBgTilemapBufferToVram + add sp, 0x8 + pop {r0} + bx r0 + thumb_func_end sub_807A000 + + thumb_func_start sub_807A024 +sub_807A024: @ 807A024 + push {lr} + sub sp, 0x8 + movs r0, 0x1E + str r0, [sp] + movs r0, 0x14 + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0 + bl CopyBgTilemapBufferToVram + add sp, 0x8 + pop {r0} + bx r0 + thumb_func_end sub_807A024 + + thumb_func_start sub_807A048 +sub_807A048: @ 807A048 + push {r4-r7,lr} + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 24 + lsrs r6, r1, 24 + movs r3, 0 + ldr r4, =0x0203229c + mov r12, r4 + movs r7, 0x8D + lsls r7, 4 +_0807A05C: + mov r1, r12 + ldr r0, [r1] + lsls r1, r3, 3 + adds r2, r0, r1 + adds r0, r2, r7 + ldrb r0, [r0] + cmp r0, 0 + bne _0807A090 + ldr r3, =0x000008d2 + adds r0, r2, r3 + strh r5, [r0] + adds r3, 0x2 + adds r0, r2, r3 + strb r6, [r0] + ldr r0, [r4] + adds r0, r1 + movs r1, 0x8D + lsls r1, 4 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + b _0807A096 + .pool +_0807A090: + adds r3, 0x1 + cmp r3, 0x3 + ble _0807A05C +_0807A096: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_807A048 + + thumb_func_start sub_807A09C +sub_807A09C: @ 807A09C + push {lr} + movs r3, 0 + ldr r0, =0x0203229c + ldr r0, [r0] + movs r2, 0x8D + lsls r2, 4 + adds r1, r0, r2 + movs r2, 0x3 +_0807A0AC: + ldrb r0, [r1] + adds r3, r0 + adds r1, 0x8 + subs r2, 0x1 + cmp r2, 0 + bge _0807A0AC + adds r0, r3, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_807A09C + + thumb_func_start sub_807A0C4 +sub_807A0C4: @ 807A0C4 + push {r4,r5,lr} + movs r4, 0 + ldr r3, =0x0203229c +_0807A0CA: + ldr r0, [r3] + lsls r1, r4, 3 + adds r2, r0, r1 + movs r5, 0x8D + lsls r5, 4 + adds r0, r2, r5 + ldrb r0, [r0] + adds r5, r1, 0 + cmp r0, 0 + beq _0807A18C + ldr r0, =0x000008d2 + adds r1, r2, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _0807A0F8 + subs r0, 0x1 + strh r0, [r1] + b _0807A18C + .pool +_0807A0F8: + ldr r1, =0x000008d4 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x8 + bhi _0807A17A + lsls r0, 2 + ldr r1, =_0807A114 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0807A114: + .4byte _0807A138 + .4byte _0807A14C + .4byte _0807A154 + .4byte _0807A15C + .4byte _0807A15C + .4byte _0807A15C + .4byte _0807A164 + .4byte _0807A16C + .4byte _0807A174 +_0807A138: + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x80 + movs r1, 0x14 + bl sub_8077170 + b _0807A17A + .pool +_0807A14C: + movs r0, 0 + bl sub_807A19C + b _0807A17A +_0807A154: + movs r0, 0x2 + bl sub_807A19C + b _0807A17A +_0807A15C: + movs r0, 0x3 + bl sub_807A19C + b _0807A17A +_0807A164: + movs r0, 0x6 + bl sub_807A19C + b _0807A17A +_0807A16C: + movs r0, 0x7 + bl sub_807A19C + b _0807A17A +_0807A174: + movs r0, 0x8 + bl sub_807A19C +_0807A17A: + ldr r0, =0x0203229c + ldr r1, [r0] + adds r1, r5 + movs r2, 0x8D + lsls r2, 4 + adds r1, r2 + movs r2, 0 + strb r2, [r1] + adds r3, r0, 0 +_0807A18C: + adds r4, 0x1 + cmp r4, 0x3 + ble _0807A0CA + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807A0C4 + + thumb_func_start sub_807A19C +sub_807A19C: @ 807A19C + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r0, =gUnknown_0832DEBC + lsls r4, 2 + adds r4, r0 + ldr r2, [r4] + movs r0, 0x1 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0 + movs r1, 0x14 + movs r2, 0xC + bl sub_8098858 + movs r0, 0 + bl PutWindowTilemap + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807A19C + + thumb_func_start sub_807A1F0 +sub_807A1F0: @ 807A1F0 + push {r4,lr} + sub sp, 0x8 + ldr r0, =0x0203229c + ldr r1, [r0] + adds r3, r1, 0 + adds r3, 0xA8 + ldrb r1, [r3] + adds r4, r0, 0 + cmp r1, 0xD + bhi _0807A22C + ldr r1, =0x02032188 + ldrb r0, [r3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [sp] + ldr r0, =0xffff0000 + ldr r2, [sp, 0x4] + ands r2, r0 + movs r0, 0x80 + lsls r0, 1 + orrs r2, r0 + str r2, [sp, 0x4] + ldrb r1, [r3] + adds r1, 0xC8 + lsls r1, 16 + ldr r0, =0x0000ffff + ands r0, r2 + orrs r0, r1 + str r0, [sp, 0x4] +_0807A22C: + ldr r0, [r4] + adds r0, 0xA8 + ldrb r0, [r0] + cmp r0, 0x11 + bhi _0807A2FC + lsls r0, 2 + ldr r1, =_0807A254 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0807A254: + .4byte _0807A29C + .4byte _0807A29C + .4byte _0807A29C + .4byte _0807A29C + .4byte _0807A29C + .4byte _0807A29C + .4byte _0807A29C + .4byte _0807A29C + .4byte _0807A2A0 + .4byte _0807A2B8 + .4byte _0807A2B8 + .4byte _0807A2B8 + .4byte _0807A2B8 + .4byte _0807A2B8 + .4byte _0807A2BC + .4byte _0807A2C8 + .4byte _0807A2D4 + .4byte _0807A2F0 +_0807A29C: + mov r0, sp + b _0807A2D6 +_0807A2A0: + mov r0, sp + bl LoadObjectPic + ldr r1, =0x0203229c + ldr r1, [r1] + adds r2, r1, 0 + adds r2, 0x72 + strh r0, [r2] + b _0807A2DE + .pool +_0807A2B8: + mov r0, sp + b _0807A2D6 +_0807A2BC: + ldr r0, =gUnknown_0832DCE4 + bl LoadTaggedObjectPalette + b _0807A2DA + .pool +_0807A2C8: + ldr r0, =gUnknown_0832DC44 + bl LoadTaggedObjectPalette + b _0807A2DA + .pool +_0807A2D4: + ldr r0, =gUnknown_0832DC3C +_0807A2D6: + bl LoadObjectPic +_0807A2DA: + ldr r0, =0x0203229c + ldr r1, [r0] +_0807A2DE: + adds r1, 0xA8 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0807A2FC + .pool +_0807A2F0: + ldr r0, [r4] + adds r0, 0xA8 + movs r1, 0 + strb r1, [r0] + movs r0, 0x1 + b _0807A2FE +_0807A2FC: + movs r0, 0 +_0807A2FE: + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_807A1F0 + + thumb_func_start sub_807A308 +sub_807A308: @ 807A308 + push {lr} + sub sp, 0x4 + movs r2, 0x6 + str r2, [sp] + movs r2, 0 + movs r3, 0 + bl sub_80C6D80 + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_807A308 + + thumb_func_start sub_807A320 +sub_807A320: @ 807A320 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0 + beq _0807A338 + cmp r0, 0x1 + beq _0807A3CC + b _0807A458 +_0807A338: + movs r7, 0 + ldr r1, =0x0203229c + ldr r0, [r1] + adds r0, 0x36 + ldrb r0, [r0] + cmp r7, r0 + blt _0807A348 + b _0807A458 +_0807A348: + adds r6, r1, 0 + movs r5, 0 + mov r9, r5 +_0807A34E: + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + adds r1, r0, 0 + cmp r1, 0x1 + bne _0807A380 + ldr r0, [r6] + adds r0, 0x45 + adds r0, r5 + mov r2, r9 + strb r2, [r0] + ldr r0, [r6] + adds r0, 0x51 + adds r0, r5 + b _0807A3B0 + .pool +_0807A380: + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + adds r1, r0, 0 + cmp r1, 0 + bne _0807A39E + ldr r0, [r6] + adds r0, 0x45 + adds r0, r5 + strb r1, [r0] + ldr r0, [r6] + adds r0, 0x51 + adds r0, r5 + b _0807A3B0 +_0807A39E: + ldr r0, [r6] + adds r0, 0x45 + adds r0, r5 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r6] + adds r0, 0x51 + adds r0, r5 + mov r1, r9 +_0807A3B0: + strb r1, [r0] + ldr r0, =0x0203229c + adds r5, 0x1 + adds r7, 0x1 + ldr r0, [r0] + adds r0, 0x36 + add r0, r8 + ldrb r0, [r0] + cmp r7, r0 + blt _0807A34E + b _0807A458 + .pool +_0807A3CC: + movs r7, 0 + ldr r1, =0x0203229c + ldr r0, [r1] + adds r0, 0x37 + ldrb r0, [r0] + cmp r7, r0 + bge _0807A458 + adds r6, r1, 0 + movs r5, 0x6 + movs r2, 0 + mov r9, r2 +_0807A3E2: + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, =0x02024744 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + adds r1, r0, 0 + cmp r1, 0x1 + bne _0807A414 + ldr r0, [r6] + adds r0, 0x45 + adds r0, r5 + mov r2, r9 + strb r2, [r0] + ldr r0, [r6] + adds r0, 0x51 + adds r0, r5 + b _0807A444 + .pool +_0807A414: + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + adds r1, r0, 0 + cmp r1, 0 + bne _0807A432 + ldr r0, [r6] + adds r0, 0x45 + adds r0, r5 + strb r1, [r0] + ldr r0, [r6] + adds r0, 0x51 + adds r0, r5 + b _0807A444 +_0807A432: + ldr r0, [r6] + adds r0, 0x45 + adds r0, r5 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r6] + adds r0, 0x51 + adds r0, r5 + mov r1, r9 +_0807A444: + strb r1, [r0] + ldr r0, =0x0203229c + adds r5, 0x1 + adds r7, 0x1 + ldr r0, [r0] + adds r0, 0x36 + add r0, r8 + ldrb r0, [r0] + cmp r7, r0 + blt _0807A3E2 +_0807A458: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807A320 + + thumb_func_start sub_807A468 +sub_807A468: @ 807A468 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _0807A478 + cmp r0, 0x1 + beq _0807A4D8 + b _0807A52C +_0807A478: + movs r6, 0 + ldr r1, =0x0203229c + ldr r0, [r1] + adds r0, 0x36 + ldrb r0, [r0] + cmp r6, r0 + bcs _0807A52C + adds r7, r1, 0 +_0807A488: + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + movs r1, 0x3A + bl pokemon_getattr + adds r1, r0, 0 + lsls r0, r5, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + bl sub_8075060 + ldr r1, [r7] + adds r1, 0x5D + adds r1, r6 + strb r0, [r1] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, [r7] + adds r0, 0x36 + ldrb r0, [r0] + cmp r6, r0 + bcc _0807A488 + b _0807A52C + .pool +_0807A4D8: + movs r6, 0 + ldr r1, =0x0203229c + ldr r0, [r1] + adds r0, 0x37 + ldrb r0, [r0] + cmp r6, r0 + bcs _0807A52C + adds r7, r1, 0 +_0807A4E8: + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + movs r1, 0x3A + bl pokemon_getattr + adds r1, r0, 0 + lsls r0, r5, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + bl sub_8075060 + ldr r1, [r7] + adds r1, 0x63 + adds r1, r6 + strb r0, [r1] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, [r7] + adds r0, 0x37 + ldrb r0, [r0] + cmp r6, r0 + bcc _0807A4E8 +_0807A52C: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807A468 + + thumb_func_start sub_807A53C +sub_807A53C: @ 807A53C + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r5, 0 +_0807A544: + movs r4, 0 + ldr r2, =0x0203229c + ldr r0, [r2] + adds r0, 0x36 + adds r0, r5 + adds r1, r5, 0x1 + mov r8, r1 + ldrb r0, [r0] + cmp r4, r0 + bge _0807A596 + adds r6, r2, 0 + lsls r0, r5, 1 + adds r0, r5 + lsls r7, r0, 1 +_0807A560: + ldr r2, [r6] + adds r3, r4, r7 + adds r0, r2, 0 + adds r0, 0x28 + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + adds r2, 0x5D + adds r2, r3 + ldrb r2, [r2] + movs r1, 0x4 + subs r1, r2 + lsls r1, 24 + lsrs r1, 24 + bl sub_80D32C8 + adds r4, 0x1 + ldr r0, [r6] + adds r0, 0x36 + adds r0, r5 + ldrb r0, [r0] + cmp r4, r0 + blt _0807A560 +_0807A596: + mov r5, r8 + cmp r5, 0x1 + ble _0807A544 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807A53C + + thumb_func_start sub_807A5B0 +sub_807A5B0: @ 807A5B0 + push {r4,r5,lr} + movs r3, 0 + ldr r5, =0x03005d8c + ldr r4, =0x000031a8 +_0807A5B8: + ldr r0, [r5] + adds r0, r4 + adds r2, r0, r3 + ldrb r0, [r2] + cmp r0, 0 + bne _0807A5DA + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0xA9 + adds r0, r3 + ldrb r0, [r0] + adds r1, r0, 0 + cmp r1, 0 + beq _0807A5DA + cmp r1, 0x3F + bhi _0807A5DA + strb r0, [r2] +_0807A5DA: + adds r3, 0x1 + cmp r3, 0xA + ble _0807A5B8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807A5B0 + + thumb_func_start sub_807A5F4 +sub_807A5F4: @ 807A5F4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x30 + mov r8, r0 + adds r7, r1, 0 + mov r9, r2 + movs r5, 0 + cmp r5, r7 + bge _0807A62E + mov r6, sp +_0807A60C: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + add r4, r8 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + str r0, [r6, 0x18] + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + stm r6!, {r0} + adds r5, 0x1 + cmp r5, r7 + blt _0807A60C +_0807A62E: + bl sub_809D42C + mov r1, r9 + lsls r4, r1, 2 + cmp r0, 0 + bne _0807A65C + add r0, sp, 0x18 + adds r0, r4 + ldr r1, [r0] + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + bne _0807A64C + movs r0, 0x3 + b _0807A718 +_0807A64C: + lsls r0, r1, 16 + lsrs r0, 16 + bl sub_806E3F8 + cmp r0, 0 + bne _0807A65C + movs r0, 0x2 + b _0807A718 +_0807A65C: + bl link_get_multiplayer_id + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r0, =0x020229e8 + adds r1, r0 + ldrb r0, [r1] + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _0807A6AC + ldrb r1, [r1, 0x12] + movs r0, 0xF + ands r0, r1 + cmp r0, 0 + bne _0807A6AC + add r0, sp, 0x18 + adds r0, r4 + ldr r1, [r0] + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + bne _0807A6A0 + movs r0, 0x5 + b _0807A718 + .pool +_0807A6A0: + lsls r0, r1, 16 + lsrs r0, 16 + bl sub_806E3F8 + cmp r0, 0 + beq _0807A6D2 +_0807A6AC: + mov r1, sp + adds r0, r1, r4 + ldr r1, [r0] + movs r0, 0xCD + lsls r0, 1 + cmp r1, r0 + beq _0807A6BE + cmp r1, 0x97 + bne _0807A6D6 +_0807A6BE: + movs r0, 0x64 + mov r1, r9 + muls r1, r0 + adds r0, r1, 0 + add r0, r8 + movs r1, 0x50 + bl pokemon_getattr + cmp r0, 0 + bne _0807A6D6 +_0807A6D2: + movs r0, 0x4 + b _0807A718 +_0807A6D6: + cmp r7, 0 + ble _0807A6F4 + movs r3, 0xCE + lsls r3, 1 + movs r2, 0 + add r1, sp, 0x18 + adds r5, r7, 0 +_0807A6E4: + ldr r0, [r1] + cmp r0, r3 + bne _0807A6EC + str r2, [r1] +_0807A6EC: + adds r1, 0x4 + subs r5, 0x1 + cmp r5, 0 + bne _0807A6E4 +_0807A6F4: + movs r2, 0 + movs r5, 0 + cmp r2, r7 + bge _0807A70E + add r1, sp, 0x18 +_0807A6FE: + cmp r5, r9 + beq _0807A706 + ldr r0, [r1] + adds r2, r0 +_0807A706: + adds r1, 0x4 + adds r5, 0x1 + cmp r5, r7 + blt _0807A6FE +_0807A70E: + cmp r2, 0 + bne _0807A716 + movs r0, 0x1 + b _0807A718 +_0807A716: + movs r0, 0 +_0807A718: + add sp, 0x30 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_807A5F4 + + thumb_func_start sub_807A728 +sub_807A728: @ 807A728 + push {r4-r7,lr} + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _0807A7B4 + movs r4, 0 + bl link_get_multiplayer_id + ldr r5, =0x020229e8 + movs r7, 0x1 + eors r0, r7 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r1, [r1] + subs r0, r1, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bls _0807A7B4 + subs r0, r1, 0x4 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _0807A762 + movs r4, 0x2 +_0807A762: + cmp r4, 0 + ble _0807A7B4 + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r1, [r1, 0x12] + movs r6, 0xF0 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _0807A7B0 + cmp r4, 0x2 + bne _0807A7B4 + bl link_get_multiplayer_id + eors r0, r7 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r1, [r1, 0x12] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _0807A7B4 + movs r0, 0x2 + b _0807A7B6 + .pool +_0807A7B0: + movs r0, 0x1 + b _0807A7B6 +_0807A7B4: + movs r0, 0 +_0807A7B6: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_807A728 + + thumb_func_start sub_807A7BC +sub_807A7BC: @ 807A7BC + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0xCD + lsls r0, 1 + cmp r2, r0 + beq _0807A7D2 + cmp r2, 0x97 + bne _0807A7DA +_0807A7D2: + cmp r1, 0 + bne _0807A7DA + movs r0, 0x1 + b _0807A7DC +_0807A7DA: + movs r0, 0 +_0807A7DC: + pop {r1} + bx r1 + thumb_func_end sub_807A7BC + + thumb_func_start sub_807A7E0 +sub_807A7E0: @ 807A7E0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, [sp, 0x20] + ldr r5, [sp, 0x24] + ldr r6, [sp, 0x28] + lsls r2, 16 + lsrs r7, r2, 16 + lsls r3, 16 + lsrs r3, 16 + mov r8, r3 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 24 + lsrs r6, 24 + lsls r2, r0, 23 + lsrs r2, 31 + mov r9, r2 + lsls r0, 24 + lsrs r2, r0, 31 + lsls r0, r1, 23 + lsrs r0, 31 + mov r10, r0 + lsls r0, r1, 24 + lsrs r0, 31 + lsls r1, 18 + lsrs r1, 28 + cmp r1, 0x3 + beq _0807A832 + cmp r2, 0 + bne _0807A82A + movs r0, 0x8 + b _0807A8C0 +_0807A82A: + cmp r0, 0 + bne _0807A832 + movs r0, 0x9 + b _0807A8C0 +_0807A832: + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_807A7BC + cmp r0, 0 + bne _0807A898 + movs r0, 0xCE + lsls r0, 1 + cmp r8, r0 + bne _0807A84E + cmp r7, r8 + beq _0807A86C + movs r0, 0x2 + b _0807A8C0 +_0807A84E: + ldr r0, =gBaseStats + lsls r1, r7, 3 + subs r1, r7 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x6] + cmp r0, r4 + beq _0807A86C + ldrb r0, [r1, 0x7] + cmp r0, r4 + beq _0807A86C + movs r0, 0x1 + b _0807A8C0 + .pool +_0807A86C: + movs r0, 0xCE + lsls r0, 1 + cmp r7, r0 + bne _0807A87C + cmp r7, r8 + beq _0807A87C + movs r0, 0x3 + b _0807A8C0 +_0807A87C: + mov r0, r9 + cmp r0, 0 + bne _0807A8AA + movs r0, 0xCE + lsls r0, 1 + cmp r7, r0 + bne _0807A88E + movs r0, 0x6 + b _0807A8C0 +_0807A88E: + adds r0, r7, 0 + bl sub_806E3F8 + cmp r0, 0 + bne _0807A89C +_0807A898: + movs r0, 0x4 + b _0807A8C0 +_0807A89C: + mov r0, r8 + bl sub_806E3F8 + cmp r0, 0 + bne _0807A8AA + movs r0, 0x5 + b _0807A8C0 +_0807A8AA: + mov r0, r10 + cmp r0, 0 + bne _0807A8BE + adds r0, r7, 0 + bl sub_806E3F8 + cmp r0, 0 + bne _0807A8BE + movs r0, 0x7 + b _0807A8C0 +_0807A8BE: + movs r0, 0 +_0807A8C0: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_807A7E0 + + thumb_func_start sub_807A8D0 +sub_807A8D0: @ 807A8D0 + push {r4-r6,lr} + lsls r1, 16 + lsrs r5, r1, 16 + adds r6, r5, 0 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 24 + lsrs r3, 24 + lsls r0, 23 + lsrs r4, r0, 31 + adds r0, r2, 0 + adds r1, r3, 0 + bl sub_807A7BC + cmp r0, 0 + bne _0807A90A + cmp r4, 0 + bne _0807A90E + movs r0, 0xCE + lsls r0, 1 + cmp r5, r0 + bne _0807A900 + movs r0, 0x2 + b _0807A910 +_0807A900: + adds r0, r6, 0 + bl sub_806E3F8 + cmp r0, 0 + bne _0807A90E +_0807A90A: + movs r0, 0x1 + b _0807A910 +_0807A90E: + movs r0, 0 +_0807A910: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_807A8D0 + + thumb_func_start sub_807A918 +sub_807A918: @ 807A918 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x18 + adds r6, r0, 0 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + movs r5, 0 + ldr r0, =0x020244e9 + ldrb r0, [r0] + cmp r5, r0 + bge _0807A95A + mov r4, sp +_0807A934: + movs r0, 0x64 + muls r0, r5 + adds r0, r6, r0 + movs r1, 0x41 + bl pokemon_getattr + str r0, [r4] + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + bne _0807A94E + movs r0, 0 + str r0, [r4] +_0807A94E: + adds r4, 0x4 + adds r5, 0x1 + ldr r0, =0x020244e9 + ldrb r0, [r0] + cmp r5, r0 + blt _0807A934 +_0807A95A: + movs r7, 0 + movs r6, 0x1 + movs r5, 0 + ldr r4, =0x020229e8 + b _0807A980 + .pool +_0807A96C: + ldrb r0, [r4] + subs r0, 0x4 + cmp r0, 0x1 + bhi _0807A978 + movs r7, 0 + b _0807A97C +_0807A978: + movs r0, 0x1 + orrs r7, r0 +_0807A97C: + adds r4, 0x1C + adds r5, 0x1 +_0807A980: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + blt _0807A96C + movs r5, 0 + movs r4, 0 + b _0807A9B4 +_0807A992: + ldr r0, =0x020229e8 + adds r2, r4, r0 + ldrb r1, [r2, 0x10] + movs r0, 0xF + ands r0, r1 + cmp r0, 0 + bne _0807A9A2 + movs r6, 0 +_0807A9A2: + cmp r7, 0 + beq _0807A9B0 + ldrb r0, [r2, 0x10] + lsrs r0, 4 + cmp r0, 0 + beq _0807A9B0 + movs r6, 0 +_0807A9B0: + adds r4, 0x1C + adds r5, 0x1 +_0807A9B4: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + blt _0807A992 + cmp r6, 0 + bne _0807A9EA + mov r1, r8 + lsls r0, r1, 2 + mov r1, sp + adds r4, r1, r0 + ldrh r0, [r4] + bl sub_806E3F8 + cmp r0, 0 + bne _0807A9E0 + movs r0, 0x2 + b _0807AA1A + .pool +_0807A9E0: + ldr r0, [r4] + cmp r0, 0 + bne _0807A9EA + movs r0, 0x3 + b _0807AA1A +_0807A9EA: + movs r2, 0 + movs r5, 0 + ldr r0, =0x020244e9 + ldrb r0, [r0] + cmp r2, r0 + bge _0807AA0A + adds r3, r0, 0 + mov r1, sp +_0807A9FA: + cmp r8, r5 + beq _0807AA02 + ldr r0, [r1] + adds r2, r0 +_0807AA02: + adds r1, 0x4 + adds r5, 0x1 + cmp r5, r3 + blt _0807A9FA +_0807AA0A: + cmp r2, 0 + beq _0807AA18 + movs r0, 0 + b _0807AA1A + .pool +_0807AA18: + movs r0, 0x1 +_0807AA1A: + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_807A918 + + thumb_func_start sub_807AA28 +sub_807AA28: @ 807AA28 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bne _0807AA44 + movs r0, 0x17 + bl audio_play + movs r0, 0 + strh r0, [r4, 0x2E] +_0807AA44: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_807AA28 + + thumb_func_start sub_807AA4C +sub_807AA4C: @ 807AA4C + push {r4,r5,lr} + adds r4, r0, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0807AA76 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bne _0807AA76 + movs r0, 0xC2 + bl audio_play + strh r5, [r4, 0x2E] +_0807AA76: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_807AA4C + + thumb_func_start sub_807AA7C +sub_807AA7C: @ 807AA7C + push {lr} + adds r2, r0, 0 + movs r0, 0x30 + ldrsh r1, [r2, r0] + cmp r1, 0 + bne _0807AAB2 + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xC + bne _0807AA98 + strh r1, [r2, 0x2E] +_0807AA98: + movs r1, 0x2E + ldrsh r0, [r2, r1] + lsls r0, 1 + ldr r1, =gUnknown_08338EA4 + adds r0, r1 + ldrb r1, [r2, 0x5] + lsrs r1, 4 + adds r1, 0x10 + lsls r1, 4 + adds r1, 0x4 + movs r2, 0x2 + bl gpu_pal_apply +_0807AAB2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_807AA7C + + thumb_func_start sub_807AABC +sub_807AABC: @ 807AABC + push {lr} + adds r2, r0, 0 + ldrh r1, [r2, 0x2E] + adds r1, 0x1 + strh r1, [r2, 0x2E] + ldrh r0, [r2, 0x26] + adds r0, 0x1 + strh r0, [r2, 0x26] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0xA + bne _0807AADA + adds r0, r2, 0 + bl RemoveObjectAndFreeTiles +_0807AADA: + pop {r0} + bx r0 + thumb_func_end sub_807AABC + + thumb_func_start sub_807AAE0 +sub_807AAE0: @ 807AAE0 + push {lr} + adds r2, r0, 0 + ldrh r1, [r2, 0x2E] + adds r1, 0x1 + strh r1, [r2, 0x2E] + ldrh r0, [r2, 0x26] + subs r0, 0x1 + strh r0, [r2, 0x26] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0xA + bne _0807AAFE + adds r0, r2, 0 + bl RemoveObjectAndFreeTiles +_0807AAFE: + pop {r0} + bx r0 + thumb_func_end sub_807AAE0 + + thumb_func_start sub_807AB04 +sub_807AB04: @ 807AB04 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + bne _0807AB20 + movs r0, 0xCC + bl audio_play + movs r0, 0 + strh r0, [r4, 0x2E] +_0807AB20: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_807AB04 + + thumb_func_start sub_807AB28 +sub_807AB28: @ 807AB28 + push {r4,r5,lr} + sub sp, 0x20 + ldr r0, =0x020322a0 + ldr r0, [r0] + mov r12, r0 + adds r0, 0xD4 + ldrh r1, [r0] + lsls r1, 8 + adds r0, 0x2 + ldrh r2, [r0] + lsls r2, 8 + adds r0, 0x6 + movs r4, 0 + ldrsh r3, [r0, r4] + adds r0, 0x2 + movs r5, 0 + ldrsh r0, [r0, r5] + str r0, [sp] + mov r4, r12 + adds r4, 0xE8 + movs r5, 0 + ldrsh r0, [r4, r5] + str r0, [sp, 0x4] + movs r5, 0 + ldrsh r0, [r4, r5] + str r0, [sp, 0x8] + mov r0, r12 + adds r0, 0xEC + ldrh r0, [r0] + str r0, [sp, 0xC] + add r0, sp, 0x10 + bl sub_806F6C0 + add r0, sp, 0x10 + ldrh r1, [r0] + movs r0, 0x20 + bl SetGpuReg + add r0, sp, 0x10 + ldrh r1, [r0, 0x2] + movs r0, 0x22 + bl SetGpuReg + add r0, sp, 0x10 + ldrh r1, [r0, 0x4] + movs r0, 0x24 + bl SetGpuReg + add r0, sp, 0x10 + ldrh r1, [r0, 0x6] + movs r0, 0x26 + bl SetGpuReg + ldr r1, [sp, 0x18] + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x28 + bl SetGpuReg + ldr r1, [sp, 0x18] + lsrs r1, 16 + movs r0, 0x2A + bl SetGpuReg + ldr r1, [sp, 0x1C] + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x2C + bl SetGpuReg + ldr r1, [sp, 0x1C] + lsrs r1, 16 + movs r0, 0x2E + bl SetGpuReg + add sp, 0x20 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807AB28 + + thumb_func_start sub_807ABCC +sub_807ABCC: @ 807ABCC + push {r4,lr} + ldr r4, =0x020322a0 + ldr r0, [r4] + adds r0, 0xE0 + ldrh r1, [r0] + movs r0, 0x16 + bl SetGpuReg + ldr r0, [r4] + adds r0, 0xE2 + ldrh r1, [r0] + movs r0, 0x14 + bl SetGpuReg + movs r0, 0 + bl GetGpuReg + lsls r0, 16 + movs r1, 0xE0 + lsls r1, 11 + ands r1, r0 + cmp r1, 0 + bne _0807AC18 + ldr r0, [r4] + adds r0, 0xE4 + ldrh r1, [r0] + movs r0, 0x1A + bl SetGpuReg + ldr r0, [r4] + adds r0, 0xE6 + ldrh r1, [r0] + movs r0, 0x18 + bl SetGpuReg + b _0807AC1C + .pool +_0807AC18: + bl sub_807AB28 +_0807AC1C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_807ABCC + + thumb_func_start sub_807AC24 +sub_807AC24: @ 807AC24 + push {lr} + bl sub_807ABCC + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_807AC24 + + thumb_func_start sub_807AC3C +sub_807AC3C: @ 807AC3C + push {r4,lr} + ldr r3, =0x020322a0 + ldr r1, [r3] + movs r0, 0x8A + adds r0, r1 + mov r12, r0 + movs r2, 0 + movs r0, 0 + mov r4, r12 + strh r0, [r4] + adds r1, 0x88 + strb r2, [r1] + ldr r0, [r3] + adds r0, 0x89 + strb r2, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807AC3C + + thumb_func_start sub_807AC64 +sub_807AC64: @ 807AC64 + push {r4,r5,lr} + ldr r0, =0x020322a0 + ldr r2, [r0] + adds r1, r2, 0 + adds r1, 0x88 + adds r3, r2, 0 + adds r3, 0x89 + ldrb r1, [r1] + adds r5, r0, 0 + ldrb r3, [r3] + cmp r1, r3 + bne _0807AC8C + adds r1, r2, 0 + adds r1, 0x8A + ldrh r0, [r1] + adds r0, 0x1 + b _0807AC92 + .pool +_0807AC8C: + adds r1, r2, 0 + adds r1, 0x8A + movs r0, 0 +_0807AC92: + strh r0, [r1] + adds r4, r5, 0 + ldr r0, [r4] + adds r0, 0x8A + ldrh r1, [r0] + movs r0, 0x96 + lsls r0, 1 + cmp r1, r0 + bls _0807ACC4 + bl sub_80097E8 + ldr r0, =c2_800ACD4 + bl SetMainCallback2 + ldr r1, [r4] + adds r3, r1, 0 + adds r3, 0x8A + movs r2, 0 + movs r0, 0 + strh r0, [r3] + adds r1, 0x89 + strb r2, [r1] + ldr r0, [r4] + adds r0, 0x88 + strb r2, [r0] +_0807ACC4: + ldr r0, [r5] + adds r1, r0, 0 + adds r1, 0x88 + ldrb r1, [r1] + adds r0, 0x89 + strb r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807AC64 + + thumb_func_start sub_807ACDC +sub_807ACDC: @ 807ACDC + push {lr} + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _0807ACF0 + movs r0, 0 + b _0807ACF8 + .pool +_0807ACF0: + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 +_0807ACF8: + pop {r1} + bx r1 + thumb_func_end sub_807ACDC + + thumb_func_start sub_807ACFC +sub_807ACFC: @ 807ACFC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + movs r4, 0 + mov r8, r4 + cmp r6, 0 + bne _0807AD22 + ldr r0, =0x02032298 + ldrb r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r1, r0 + mov r8, r1 + movs r4, 0x1 +_0807AD22: + cmp r6, 0x1 + bne _0807AD40 + ldr r0, =0x02032298 + ldrb r0, [r0, 0x1] + movs r1, 0x6 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r1, r0 + ldr r0, =0x02024744 + adds r1, r0 + mov r8, r1 + movs r4, 0x3 +_0807AD40: + cmp r5, 0 + beq _0807AD58 + cmp r5, 0x1 + beq _0807ADE0 + b _0807AE36 + .pool +_0807AD58: + mov r0, r8 + movs r1, 0x41 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + mov r0, r8 + movs r1, 0 + bl pokemon_getattr + adds r7, r0, 0 + cmp r6, 0 + bne _0807AD94 + lsls r0, r5, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r1, [r1] + ldr r1, [r1, 0x8] + adds r2, r5, 0 + adds r3, r7, 0 + bl DecompressMonPic_DetectFrontOrBack_2 + movs r4, 0 + b _0807ADB2 + .pool +_0807AD94: + lsls r0, r5, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r2, [r1] + lsls r4, r6, 1 + adds r1, r4, 0x1 + lsls r1, 2 + adds r2, 0x4 + adds r2, r1 + ldr r1, [r2] + adds r2, r5, 0 + adds r3, r7, 0 + bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack +_0807ADB2: + mov r0, r8 + bl sub_806E794 + bl LoadCompressedObjectPalette + ldr r0, =0x020322a0 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xF0 + adds r0, r4 + strh r5, [r0] + lsls r0, r6, 2 + adds r1, 0x68 + adds r1, r0 + str r7, [r1] + b _0807AE36 + .pool +_0807ADE0: + mov r0, r8 + bl sub_806E794 + ldrh r0, [r0, 0x4] + adds r1, r4, 0 + bl sub_806A068 + ldr r0, =0x0202499c + movs r1, 0x78 + movs r2, 0x3C + movs r3, 0x6 + bl AddObjectToFront + ldr r4, =0x020322a0 + ldr r1, [r4] + adds r1, 0x8E + adds r1, r6 + strb r0, [r1] + ldr r3, =0x02020630 + ldr r0, [r4] + adds r0, 0x8E + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x8E + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r3, 0x1C + adds r0, r3 + ldr r1, =DummyObjectCallback + str r1, [r0] +_0807AE36: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807ACFC + + thumb_func_start sub_807AE50 +sub_807AE50: @ 807AE50 + push {r4,r5,lr} + sub sp, 0x4 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0xC + bls _0807AE66 + b _0807B116 +_0807AE66: + lsls r0, 2 + ldr r1, =_0807AE78 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0807AE78: + .4byte _0807AEAC + .4byte _0807AF58 + .4byte _0807AF9C + .4byte _0807AFBC + .4byte _0807B006 + .4byte _0807B034 + .4byte _0807B058 + .4byte _0807B070 + .4byte _0807B07A + .4byte _0807B094 + .4byte _0807B0B0 + .4byte _0807B0D4 + .4byte _0807B0F0 +_0807AEAC: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _0807AEC0 + ldr r1, =0x020229c6 + ldr r2, =0x00001144 + adds r0, r2, 0 + strh r0, [r1] + bl sub_80097E8 +_0807AEC0: + ldr r4, =0x020322a0 + movs r5, 0x80 + lsls r5, 1 + adds r0, r5, 0 + bl AllocZeroed + str r0, [r4] + bl init_uns_table_pokemon_copy + bl clear_tasks + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + ldr r0, =sub_807AC24 + bl SetVBlankCallback + bl sub_807B170 + bl sub_807AC3C + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + movs r2, 0 + strb r0, [r1] + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x8C + strh r2, [r0] + adds r0, 0x8 + strh r2, [r0] + adds r1, 0xEE + movs r0, 0x1 + strb r0, [r1] + ldr r3, [r4] + adds r0, r3, 0 + adds r0, 0xD4 + movs r1, 0x40 + strh r1, [r0] + adds r0, 0x2 + strh r1, [r0] + adds r0, 0x2 + strh r2, [r0] + adds r0, 0x2 + strh r2, [r0] + adds r1, r3, 0 + adds r1, 0xDC + movs r0, 0x78 + strh r0, [r1] + adds r1, 0x2 + movs r0, 0x50 + strh r0, [r1] + adds r0, r3, 0 + adds r0, 0xE8 + strh r5, [r0] + adds r0, 0x4 + strh r2, [r0] + b _0807B116 + .pool +_0807AF58: + ldr r0, =0x03003124 + ldrb r5, [r0] + cmp r5, 0 + bne _0807AF90 + ldr r4, =0x020322a0 + ldr r0, [r4] + adds r0, 0xFA + movs r1, 0x1 + strb r1, [r0] + bl sub_8009734 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r4] + str r5, [r0, 0x64] + b _0807B116 + .pool +_0807AF90: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + movs r0, 0x4 + strb r0, [r1] + b _0807B116 +_0807AF9C: + ldr r0, =0x020322a0 + ldr r1, [r0] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0x3C + bhi _0807AFAC + b _0807B116 +_0807AFAC: + movs r0, 0 + str r0, [r1, 0x64] + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + b _0807B0E4 + .pool +_0807AFBC: + bl sub_800ABBC + lsls r0, 24 + cmp r0, 0 + bne _0807AFC8 + b _0807B0DC +_0807AFC8: + bl sub_800ABAC + adds r4, r0, 0 + bl sub_800AA48 + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bcc _0807B000 + ldr r0, =0x020322a0 + ldr r1, [r0] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0x1E + bhi _0807AFEA + b _0807B116 +_0807AFEA: + bl sub_800A620 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _0807B0E4 + .pool +_0807B000: + bl sub_807AC64 + b _0807B116 +_0807B006: + bl sub_807AC64 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0807B014 + b _0807B116 +_0807B014: + bl sub_800A23C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0807B022 + b _0807B116 +_0807B022: + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _0807B0E4 + .pool +_0807B034: + ldr r2, =0x020322a0 + ldr r0, [r2] + adds r0, 0x72 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0x73 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0x93 + strb r1, [r0] + movs r0, 0 + bl sub_807ACFC + b _0807B0DC + .pool +_0807B058: + movs r0, 0 + movs r1, 0x1 + bl sub_807ACFC + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _0807B0E4 + .pool +_0807B070: + movs r0, 0x1 + movs r1, 0 + bl sub_807ACFC + b _0807B0DC +_0807B07A: + movs r0, 0x1 + movs r1, 0x1 + bl sub_807ACFC + bl sub_807B154 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _0807B0E4 + .pool +_0807B094: + bl sub_807BA94 + ldr r0, =gUnknown_08338D18 + bl LoadObjectPic + ldr r0, =gUnknown_08338D20 + bl LoadTaggedObjectPalette + b _0807B0DC + .pool +_0807B0B0: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + movs r0, 0 + bl ShowBg + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _0807B0E4 + .pool +_0807B0D4: + bl sub_807B140 + bl sub_807BAD8 +_0807B0DC: + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 +_0807B0E4: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0807B116 + .pool +_0807B0F0: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0807B116 + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _0807B110 + bl sub_800E0E8 + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 +_0807B110: + ldr r0, =sub_807EA2C + bl SetMainCallback2 +_0807B116: + bl RunActiveTasks + bl RunTextPrinters + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807AE50 + + thumb_func_start sub_807B140 +sub_807B140: @ 807B140 + push {lr} + movs r0, 0x5 + bl sub_807B62C + movs r0, 0 + bl sub_807B62C + pop {r0} + bx r0 + thumb_func_end sub_807B140 + + thumb_func_start sub_807B154 +sub_807B154: @ 807B154 + push {lr} + movs r0, 0 + movs r1, 0xFF + bl FillWindowPixelBuffer + movs r0, 0 + bl PutWindowTilemap + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + pop {r0} + bx r0 + thumb_func_end sub_807B154 + + thumb_func_start sub_807B170 +sub_807B170: @ 807B170 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x4 + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_08339014 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r5, 0x80 + lsls r5, 4 + adds r0, r5, 0 + bl Alloc + adds r1, r0, 0 + movs r0, 0 + bl SetBgTilemapBuffer + adds r0, r5, 0 + bl Alloc + adds r1, r0, 0 + movs r0, 0x1 + bl SetBgTilemapBuffer + adds r0, r5, 0 + bl Alloc + adds r1, r0, 0 + movs r0, 0x3 + bl SetBgTilemapBuffer + bl DeactivateAllTextPrinters + ldr r0, =gUnknown_08C00000 + mov r10, r0 + movs r0, 0 + mov r9, r0 + str r0, [sp] + mov r1, r10 + movs r2, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r0, =gUnknown_08C00524 + mov r8, r0 + ldr r4, =0x0201c000 + adds r1, r4, 0 + bl LZDecompressWram + movs r0, 0 + adds r1, r4, 0 + adds r2, r5, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + ldr r6, =gUnknown_08C004E0 + adds r0, r6, 0 + movs r1, 0 + movs r2, 0x20 + bl decompress_palette + ldr r0, =gUnknown_08338FFC + bl InitWindows + mov r0, r9 + str r0, [sp] + movs r0, 0 + mov r1, r10 + movs r2, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + mov r0, r8 + adds r1, r4, 0 + bl LZDecompressWram + movs r0, 0 + adds r1, r4, 0 + adds r2, r5, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + adds r0, r6, 0 + movs r1, 0 + movs r2, 0x20 + bl decompress_palette + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807B170 + + thumb_func_start sub_807B270 +sub_807B270: @ 807B270 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0xC + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xC + bls _0807B288 + b _0807B43E +_0807B288: + lsls r0, 2 + ldr r1, =_0807B29C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0807B29C: + .4byte _0807B2D0 + .4byte _0807B43E + .4byte _0807B43E + .4byte _0807B43E + .4byte _0807B43E + .4byte _0807B3AC + .4byte _0807B3B6 + .4byte _0807B3C0 + .4byte _0807B3D0 + .4byte _0807B3F0 + .4byte _0807B40C + .4byte _0807B414 + .4byte _0807B438 +_0807B2D0: + ldr r1, =0x02032298 + ldr r0, =0x020375e2 + ldrh r0, [r0] + movs r6, 0 + strb r0, [r1] + movs r0, 0x6 + strb r0, [r1, 0x1] + ldr r4, =0x020229f0 + ldr r0, =0x03005d90 + ldr r1, [r0] + adds r0, r4, 0 + bl CopyString + ldr r5, =0x02024744 + adds r0, r5, 0 + movs r1, 0x7 + mov r2, sp + bl pokemon_getattr + adds r0, r4, 0 + adds r0, 0x1C + mov r1, sp + bl CopyString + subs r4, 0x8 + movs r0, 0 + mov r8, r0 + movs r0, 0x2 + strh r0, [r4, 0x1A] + adds r0, r5, 0 + movs r1, 0x3 + bl pokemon_getattr + strh r0, [r4, 0x36] + ldr r4, =0x020322a0 + movs r5, 0x80 + lsls r5, 1 + adds r0, r5, 0 + bl AllocZeroed + str r0, [r4] + bl init_uns_table_pokemon_copy + bl clear_tasks + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + ldr r0, =sub_807AC24 + bl SetVBlankCallback + bl sub_807B170 + ldr r0, [r4] + adds r0, 0xEE + mov r1, r8 + strb r1, [r0] + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x8C + strh r6, [r0] + adds r0, 0x8 + strh r6, [r0] + adds r0, 0x40 + movs r1, 0x40 + strh r1, [r0] + adds r0, 0x2 + strh r1, [r0] + adds r0, 0x2 + strh r6, [r0] + adds r0, 0x2 + strh r6, [r0] + adds r1, r2, 0 + adds r1, 0xDC + movs r0, 0x78 + strh r0, [r1] + adds r1, 0x2 + movs r0, 0x50 + strh r0, [r1] + adds r0, r2, 0 + adds r0, 0xE8 + strh r5, [r0] + adds r0, 0x4 + strh r6, [r0] + str r6, [r2, 0x64] + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x5 + strb r1, [r0] + b _0807B43E + .pool +_0807B3AC: + movs r0, 0 + movs r1, 0 + bl sub_807ACFC + b _0807B424 +_0807B3B6: + movs r0, 0 + movs r1, 0x1 + bl sub_807ACFC + b _0807B424 +_0807B3C0: + movs r0, 0x1 + movs r1, 0 + bl sub_807ACFC + movs r0, 0 + bl ShowBg + b _0807B424 +_0807B3D0: + movs r0, 0x1 + movs r1, 0x1 + bl sub_807ACFC + movs r0, 0 + movs r1, 0xFF + bl FillWindowPixelBuffer + movs r0, 0 + bl PutWindowTilemap + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + b _0807B424 +_0807B3F0: + bl sub_807BA94 + ldr r0, =gUnknown_08338D18 + bl LoadObjectPic + ldr r0, =gUnknown_08338D20 + bl LoadTaggedObjectPalette + b _0807B424 + .pool +_0807B40C: + movs r0, 0 + bl ShowBg + b _0807B424 +_0807B414: + movs r0, 0x5 + bl sub_807B62C + movs r0, 0 + bl sub_807B62C + bl sub_807BAD8 +_0807B424: + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0807B43E + .pool +_0807B438: + ldr r0, =sub_807B60C + bl SetMainCallback2 +_0807B43E: + bl RunActiveTasks + bl RunTextPrinters + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807B270 + + thumb_func_start sub_807B464 +sub_807B464: @ 807B464 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _0807B4B8 + adds r0, r5, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + adds r5, r0, 0 + adds r0, r4, 0 + bl SpeciesToNationalPokedexNum + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r4, 0 + movs r1, 0x2 + bl pokedex_flag_operation + adds r0, r4, 0 + movs r1, 0x3 + adds r2, r5, 0 + bl SetPokedexFlag +_0807B4B8: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807B464 + + thumb_func_start sub_807B4C4 +sub_807B4C4: @ 807B4C4 + push {lr} + bl link_get_multiplayer_id + pop {r0} + bx r0 + thumb_func_end sub_807B4C4 + + thumb_func_start sub_807B4D0 +sub_807B4D0: @ 807B4D0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r4, 24 + lsrs r4, 24 + movs r5, 0x64 + mov r1, r9 + muls r1, r5 + ldr r0, =0x020244ec + adds r7, r1, r0 + adds r0, r7, 0 + movs r1, 0x40 + bl pokemon_getattr + lsls r0, 16 + lsrs r6, r0, 16 + adds r1, r4, 0 + muls r1, r5 + ldr r0, =0x02024744 + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0x40 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r6, 0xFF + beq _0807B52A + ldr r0, =0x03005d8c + lsls r1, r6, 3 + adds r1, r6 + lsls r1, 2 + ldr r2, =0x00002be0 + adds r1, r2 + ldr r0, [r0] + adds r0, r1 + bl sub_80D439C +_0807B52A: + ldr r4, =0x020322a0 + ldr r0, [r4] + adds r1, r7, 0 + movs r2, 0x64 + bl memcpy + adds r0, r7, 0 + adds r1, r5, 0 + movs r2, 0x64 + bl memcpy + ldr r1, [r4] + adds r0, r5, 0 + movs r2, 0x64 + bl memcpy + movs r1, 0x46 + mov r0, sp + strb r1, [r0] + adds r0, r7, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _0807B566 + adds r0, r7, 0 + movs r1, 0x20 + mov r2, sp + bl pokemon_setattr +_0807B566: + mov r0, r8 + cmp r0, 0xFF + beq _0807B57C + lsls r1, r0, 3 + add r1, r8 + lsls r1, 2 + ldr r0, =0x020321c0 + adds r1, r0 + adds r0, r7, 0 + bl sub_80D460C +_0807B57C: + mov r0, r9 + bl sub_807B464 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _0807B58E + bl sub_807B4C4 +_0807B58E: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807B4D0 + + thumb_func_start sub_807B5B8 +sub_807B5B8: @ 807B5B8 + push {r4,lr} + ldr r4, =0x020322a0 + ldr r0, [r4] + adds r0, 0x93 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0807B5D0 + cmp r0, 0x2 + beq _0807B5F6 + b _0807B600 + .pool +_0807B5D0: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _0807B5F6 + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, [r4] + adds r1, 0x74 + movs r2, 0x14 + bl link_0800A448 + ldr r1, [r4] + adds r1, 0x93 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0807B5F6: + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0x93 + movs r1, 0 + strb r1, [r0] +_0807B600: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807B5B8 + + thumb_func_start sub_807B60C +sub_807B60C: @ 807B60C + push {lr} + bl sub_807BBC8 + bl RunActiveTasks + bl RunTextPrinters + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_807B60C + + thumb_func_start sub_807B62C +sub_807B62C: @ 807B62C + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x7 + bls _0807B638 + b _0807BA68 +_0807B638: + lsls r0, 2 + ldr r1, =_0807B648 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0807B648: + .4byte _0807B668 + .4byte _0807B6DC + .4byte _0807B784 + .4byte _0807B7F8 + .4byte _0807B840 + .4byte _0807B90C + .4byte _0807B924 + .4byte _0807B9FC +_0807B668: + ldr r0, =0x020322a0 + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0xE4 + movs r0, 0 + strh r0, [r2] + adds r1, 0xE6 + movs r0, 0xB4 + strh r0, [r1] + movs r1, 0xAA + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + ldr r1, =0x00005206 + movs r0, 0xC + bl SetGpuReg + ldr r0, =gUnknown_08DD7300 + movs r1, 0x10 + movs r2, 0x60 + bl gpu_pal_apply + ldr r3, =gUnknown_08DD7360 + ldr r4, =0x06004000 + movs r5, 0xA1 + lsls r5, 5 + ldr r1, =0x040000d4 + ldr r6, =0x80000800 + movs r2, 0x80 + lsls r2, 5 + movs r7, 0x80 + lsls r7, 24 +_0807B6AA: + str r3, [r1] + str r4, [r1, 0x4] + str r6, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r3, r2 + adds r4, r2 + subs r5, r2 + cmp r5, r2 + bhi _0807B6AA + b _0807BA4C + .pool +_0807B6DC: + ldr r4, =0x020322a0 + ldr r2, [r4] + adds r1, r2, 0 + adds r1, 0xE2 + movs r0, 0 + strh r0, [r1] + adds r2, 0xE0 + movs r1, 0xAE + lsls r1, 1 + strh r1, [r2] + movs r0, 0x16 + bl SetGpuReg + ldr r1, =0x00008502 + movs r0, 0xA + bl SetGpuReg + ldr r1, =0x00009206 + movs r0, 0xC + bl SetGpuReg + ldr r0, [r4] + adds r0, 0xFA + ldrb r0, [r0] + cmp r0, 0 + beq _0807B724 + ldr r1, =gUnknown_083369A0 + b _0807B726 + .pool +_0807B724: + ldr r1, =gUnknown_083359A0 +_0807B726: + ldr r2, =0x06002800 + ldr r0, =0x040000d4 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, =0x80000800 + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] + ldr r3, =gUnknown_08DD7360 + movs r4, 0xC0 + lsls r4, 19 + movs r5, 0xA1 + lsls r5, 5 + ldr r1, =0x040000d4 + ldr r6, =0x80000800 + movs r2, 0x80 + lsls r2, 5 + movs r7, 0x80 + lsls r7, 24 +_0807B74A: + str r3, [r1] + str r4, [r1, 0x4] + str r6, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r3, r2 + adds r4, r2 + subs r5, r2 + cmp r5, r2 + bhi _0807B74A + str r3, [r1] + str r4, [r1, 0x4] + lsrs r0, r5, 1 + orrs r0, r7 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r1, 0x92 + lsls r1, 5 + b _0807B820 + .pool +_0807B784: + ldr r0, =0x020322a0 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0xE0 + movs r1, 0 + strh r1, [r0] + adds r0, 0x2 + strh r1, [r0] + adds r0, 0x18 + ldrb r0, [r0] + cmp r0, 0 + bne _0807B7C0 + ldr r1, =0x00001241 + movs r0, 0 + bl SetGpuReg + ldr r0, =gUnknown_083379A0 + ldr r1, =0x06002800 + bl LZ77UnCompVram + movs r0, 0x8 + b _0807B7DA + .pool +_0807B7C0: + ldr r1, =0x00001241 + movs r0, 0 + bl SetGpuReg + ldr r1, =gUnknown_0832FFC0 + ldr r2, =0x06002800 + ldr r0, =0x040000d4 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, =0x80000400 + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] + movs r0, 0x1 +_0807B7DA: + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + b _0807BA68 + .pool +_0807B7F8: + ldr r0, =gUnknown_08337EA0 + movs r1, 0x30 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_08337EC0 + ldr r1, =0x06004000 + bl LZ77UnCompVram + ldr r0, =gUnknown_08338550 + ldr r1, =0x06009000 + bl LZ77UnCompVram + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0xE4 + movs r1, 0x50 + strh r1, [r0] + movs r1, 0xB2 + lsls r1, 5 +_0807B820: + movs r0, 0 + bl SetGpuReg + b _0807BA68 + .pool +_0807B840: + ldr r1, =0x00001441 + movs r0, 0 + bl SetGpuReg + ldr r1, =0x00001287 + movs r0, 0xC + bl SetGpuReg + ldr r0, =0x020322a0 + ldr r3, [r0] + adds r1, r3, 0 + adds r1, 0xD4 + movs r2, 0 + movs r0, 0x40 + strh r0, [r1] + adds r1, 0x2 + movs r0, 0x5C + strh r0, [r1] + adds r1, 0x12 + movs r0, 0x20 + strh r0, [r1] + adds r1, 0x2 + movs r0, 0x80 + lsls r0, 3 + strh r0, [r1] + adds r0, r3, 0 + adds r0, 0xEC + strh r2, [r0] + ldr r3, =gUnknown_08332F60 + ldr r4, =0x06004000 + movs r5, 0xA1 + lsls r5, 6 + ldr r1, =0x040000d4 + ldr r6, =0x80000800 + movs r2, 0x80 + lsls r2, 5 + movs r7, 0x80 + lsls r7, 24 +_0807B88C: + str r3, [r1] + str r4, [r1, 0x4] + str r6, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r3, r2 + adds r4, r2 + subs r5, r2 + cmp r5, r2 + bhi _0807B88C + str r3, [r1] + str r4, [r1, 0x4] + lsrs r0, r5, 1 + orrs r0, r7 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0xFA + ldrb r0, [r0] + cmp r0, 0 + beq _0807B8EC + ldr r1, =gUnknown_083357A0 + ldr r2, =0x06009000 + ldr r0, =0x040000d4 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, =0x80000080 + b _0807BA64 + .pool +_0807B8EC: + ldr r1, =gUnknown_083358A0 + ldr r2, =0x06009000 + ldr r0, =0x040000d4 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, =0x80000080 + b _0807BA64 + .pool +_0807B90C: + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0xE0 + movs r2, 0 + strh r2, [r1] + adds r0, 0xE2 + strh r2, [r0] + b _0807BA68 + .pool +_0807B924: + ldr r1, =0x00001441 + movs r0, 0 + bl SetGpuReg + ldr r1, =0x00001287 + movs r0, 0xC + bl SetGpuReg + ldr r0, =0x020322a0 + ldr r3, [r0] + adds r1, r3, 0 + adds r1, 0xD4 + movs r2, 0 + movs r0, 0x40 + strh r0, [r1] + adds r1, 0x2 + movs r0, 0x5C + strh r0, [r1] + adds r1, 0x12 + adds r0, 0xA4 + strh r0, [r1] + adds r1, 0x2 + movs r0, 0x80 + strh r0, [r1] + subs r1, 0xE + movs r0, 0x78 + strh r0, [r1] + adds r1, 0x2 + movs r0, 0x50 + strh r0, [r1] + adds r0, r3, 0 + adds r0, 0xEC + strh r2, [r0] + ldr r3, =gUnknown_08332F60 + ldr r4, =0x06004000 + movs r5, 0xA1 + lsls r5, 6 + ldr r1, =0x040000d4 + ldr r6, =0x80000800 + movs r2, 0x80 + lsls r2, 5 + movs r7, 0x80 + lsls r7, 24 +_0807B97A: + str r3, [r1] + str r4, [r1, 0x4] + str r6, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r3, r2 + adds r4, r2 + subs r5, r2 + cmp r5, r2 + bhi _0807B97A + str r3, [r1] + str r4, [r1, 0x4] + lsrs r0, r5, 1 + orrs r0, r7 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0xFA + ldrb r0, [r0] + cmp r0, 0 + beq _0807B9DC + ldr r1, =gUnknown_083357A0 + ldr r2, =0x06009000 + ldr r0, =0x040000d4 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, =0x80000080 + b _0807BA64 + .pool +_0807B9DC: + ldr r1, =gUnknown_083358A0 + ldr r2, =0x06009000 + ldr r0, =0x040000d4 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, =0x80000080 + b _0807BA64 + .pool +_0807B9FC: + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0xE4 + movs r2, 0 + strh r2, [r1] + adds r0, 0xE6 + strh r2, [r0] + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + ldr r1, =0x00005206 + movs r0, 0xC + bl SetGpuReg + ldr r0, =gUnknown_08DD7300 + movs r1, 0x10 + movs r2, 0x60 + bl gpu_pal_apply + ldr r3, =gUnknown_08DD7360 + ldr r4, =0x06004000 + movs r5, 0xA1 + lsls r5, 5 + ldr r1, =0x040000d4 + ldr r6, =0x80000800 + movs r2, 0x80 + lsls r2, 5 + movs r7, 0x80 + lsls r7, 24 +_0807BA3A: + str r3, [r1] + str r4, [r1, 0x4] + str r6, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r3, r2 + adds r4, r2 + subs r5, r2 + cmp r5, r2 + bhi _0807BA3A +_0807BA4C: + str r3, [r1] + str r4, [r1, 0x4] + lsrs r0, r5, 1 + orrs r0, r7 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + ldr r1, =gUnknown_08331F60 + ldr r2, =0x06009000 + ldr r0, =0x040000d4 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, =0x80000800 +_0807BA64: + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] +_0807BA68: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807B62C + + thumb_func_start sub_807BA94 +sub_807BA94: @ 807BA94 + push {lr} + ldr r0, =gUnknown_08338D70 + bl LoadObjectPic + ldr r0, =gUnknown_08338DC0 + bl LoadObjectPic + ldr r0, =gUnknown_08338DF4 + bl LoadObjectPic + ldr r0, =gUnknown_08338E6C + bl LoadObjectPic + ldr r0, =gUnknown_08338D78 + bl LoadTaggedObjectPalette + ldr r0, =gUnknown_08338D80 + bl LoadTaggedObjectPalette + pop {r0} + bx r0 + .pool + thumb_func_end sub_807BA94 + + thumb_func_start sub_807BAD8 +sub_807BAD8: @ 807BAD8 + push {r4,r5,lr} + sub sp, 0x14 + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0xEE + ldrb r0, [r0] + cmp r0, 0 + beq _0807BB68 + bl link_get_multiplayer_id + lsls r0, 24 + ldr r3, =0x02021cc4 + movs r2, 0x80 + lsls r2, 17 + eors r2, r0 + lsrs r2, 24 + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + ldr r0, =0x020229f0 + adds r1, r0 + adds r0, r3, 0 + bl CopyString + ldr r5, =0x02032298 + ldrb r0, [r5, 0x1] + movs r1, 0x6 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + movs r4, 0x64 + muls r0, r4 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + ldr r0, =0x02021ec4 + mov r1, sp + bl CopyString_Limit10 + ldrb r0, [r5] + muls r0, r4 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + ldr r0, =0x02021dc4 + mov r1, sp + bl CopyString_Limit10 + b _0807BBA4 + .pool +_0807BB68: + ldr r0, =0x020375e0 + ldrh r0, [r0] + lsls r4, r0, 4 + subs r4, r0 + lsls r4, 2 + ldr r0, =gUnknown_08338ED0 + adds r4, r0 + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x2B + bl CopyString + ldr r0, =0x02021ec4 + adds r1, r4, 0 + bl CopyString_Limit10 + ldr r0, =0x020375e2 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + ldr r0, =0x02021dc4 + mov r1, sp + bl CopyString_Limit10 +_0807BBA4: + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807BAD8 + + thumb_func_start sub_807BBC8 +sub_807BBC8: @ 807BBC8 + push {lr} + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0xFA + ldrb r0, [r0] + cmp r0, 0 + bne _0807BBE0 + bl sub_807CFC8 + b _0807BBE4 + .pool +_0807BBE0: + bl sub_807BBEC +_0807BBE4: + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_807BBC8 + + thumb_func_start sub_807BBEC +sub_807BBEC: @ 807BBEC + push {r4-r7,lr} + sub sp, 0x14 + ldr r0, =0x020322a0 + ldr r1, [r0] + adds r1, 0x94 + ldrh r5, [r1] + ldr r1, =0x0000010b + adds r7, r0, 0 + cmp r5, r1 + bls _0807BC04 + bl _0807CFB4 +_0807BC04: + lsls r0, r5, 2 + ldr r1, =_0807BC1C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0807BC1C: + .4byte _0807C04C + .4byte _0807C0C4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807C120 + .4byte _0807C168 + .4byte _0807C1DC + .4byte _0807CFB4 + .4byte _0807C248 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807C26C + .4byte _0807C29C + .4byte _0807C2AE + .4byte _0807C2D0 + .4byte _0807C318 + .4byte _0807C348 + .4byte _0807C390 + .4byte _0807C3E0 + .4byte _0807C434 + .4byte _0807C4B8 + .4byte _0807C4DC + .4byte _0807C528 + .4byte _0807C574 + .4byte _0807C5D0 + .4byte _0807C630 + .4byte _0807C644 + .4byte _0807C658 + .4byte _0807C66C + .4byte _0807C794 + .4byte _0807C864 + .4byte _0807C8EC + .4byte _0807C964 + .4byte _0807C974 + .4byte _0807C994 + .4byte _0807C9E4 + .4byte _0807CA02 + .4byte _0807CA40 + .4byte _0807CA50 + .4byte _0807CAC8 + .4byte _0807CFB4 + .4byte _0807CAF0 + .4byte _0807CB30 + .4byte _0807CB70 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CB90 + .4byte _0807CBB8 + .4byte _0807CBD4 + .4byte _0807CBF4 + .4byte _0807CC9C + .4byte _0807CCD0 + .4byte _0807CD1C + .4byte _0807CDDC + .4byte _0807CE54 + .4byte _0807CEA0 + .4byte _0807CEB0 + .4byte _0807CEB6 + .4byte _0807CEDC + .4byte _0807CF38 + .4byte _0807CF5C + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CE18 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807C460 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CE38 +_0807C04C: + ldr r3, =0x02020630 + ldr r0, [r7] + adds r0, 0x8E + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + ldr r4, [r7] + adds r2, r4, 0 + adds r2, 0x8E + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldr r1, =0x0000ff4c + strh r1, [r0, 0x24] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldr r2, =gUnknown_08300D38 + adds r0, r4, 0 + adds r0, 0xF0 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + strh r0, [r1, 0x26] + adds r1, r4, 0 + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + bl current_map_music_get + ldr r1, [r7] + adds r1, 0xF4 + strh r0, [r1] + ldr r0, =0x00000179 + bl current_map_music_set + bl _0807CFB4 + .pool +_0807C0C4: + ldr r5, [r7] + adds r6, r5, 0 + adds r6, 0xE6 + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + ble _0807C0F8 + ldr r2, =0x02020630 + adds r0, r5, 0 + adds r0, 0x8E + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x24] + adds r1, 0x3 + strh r1, [r0, 0x24] + ldrh r0, [r6] + subs r0, 0x3 + strh r0, [r6] + bl _0807CFB4 + .pool +_0807C0F8: + ldr r2, =0x02020630 + adds r0, r5, 0 + adds r0, 0x8E + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strh r1, [r0, 0x24] + strh r1, [r6] + adds r1, r5, 0 + adds r1, 0x94 + movs r0, 0xA + strh r0, [r1] + bl _0807CFB4 + .pool +_0807C120: + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EE942 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807F1A8 + ldr r4, =0x020322a0 + ldr r0, [r4] + adds r2, r0, 0 + adds r2, 0xF0 + ldrh r1, [r2] + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + beq _0807C14E + adds r0, r1, 0 + movs r1, 0 + bl cry_related +_0807C14E: + ldr r3, [r4] + adds r1, r3, 0 + adds r1, 0x94 + movs r2, 0 + movs r0, 0xB + bl _0807CE06 + .pool +_0807C168: + ldr r1, [r7] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0x50 + beq _0807C178 + bl _0807CFB4 +_0807C178: + adds r0, r1, 0 + adds r0, 0x8E + ldrb r0, [r0] + ldr r2, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r1, [r1, 0x5] + lsrs r1, 4 + movs r2, 0x2 + str r2, [sp] + movs r2, 0x1 + str r2, [sp, 0x4] + movs r2, 0x14 + str r2, [sp, 0x8] + ldr r2, =0x000fffff + str r2, [sp, 0xC] + movs r2, 0x78 + movs r3, 0x20 + bl sub_807671C + ldr r1, [r7] + adds r1, 0xD2 + strb r0, [r1] + ldr r1, [r7] + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EE959 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807F1A8 + bl _0807CFB4 + .pool +_0807C1DC: + ldr r5, =0x02020630 + ldr r0, [r7] + adds r0, 0xD2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, r5, 0 + adds r4, 0x1C + adds r0, r4 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + beq _0807C1FC + bl _0807CFB4 +_0807C1FC: + ldr r0, =gUnknown_08338D28 + movs r1, 0x78 + movs r2, 0x20 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r7] + adds r1, 0xD3 + strb r0, [r1] + ldr r2, [r7] + adds r0, r2, 0 + adds r0, 0xD3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_807E5D8 + str r1, [r0] + adds r2, 0xD2 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl RemoveObjectAndFreeTiles + ldr r1, [r7] + bl _0807CF4C + .pool +_0807C248: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0x94 + movs r1, 0x14 + strh r1, [r0] + bl _0807CFB4 + .pool +_0807C26C: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0807C27C + bl _0807CFB4 +_0807C27C: + movs r0, 0x4 + bl sub_807B62C + movs r0, 0 + movs r1, 0xFF + bl FillWindowPixelBuffer + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + bl _0807CF48 + .pool +_0807C29C: + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0x10 + movs r3, 0 + bl _0807CF44 +_0807C2AE: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0807C2BE + bl _0807CFB4 +_0807C2BE: + ldr r0, [r7] + adds r0, 0x94 + movs r1, 0x17 + strh r1, [r0] + bl _0807CFB4 + .pool +_0807C2D0: + ldr r4, =0x020322a0 + ldr r0, [r4] + adds r2, r0, 0 + adds r2, 0xEA + ldrh r1, [r2] + movs r0, 0x80 + lsls r0, 1 + cmp r1, r0 + bls _0807C2F0 + adds r0, r1, 0 + subs r0, 0x34 + strh r0, [r2] + b _0807C30C + .pool +_0807C2F0: + movs r0, 0x1 + bl sub_807B62C + ldr r3, [r4] + adds r1, r3, 0 + adds r1, 0xEA + movs r2, 0 + movs r0, 0x80 + strh r0, [r1] + subs r1, 0x56 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + str r2, [r3, 0x64] +_0807C30C: + ldr r0, =0x020322a0 + ldr r4, [r0] + bl _0807CB5C + .pool +_0807C318: + ldr r1, [r7] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0x14 + bhi _0807C328 + bl _0807CFB4 +_0807C328: + bl sub_807AB28 + ldr r0, =gUnknown_08338E74 + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r7] + adds r1, 0x91 + strb r0, [r1] + ldr r1, [r7] + bl _0807CF4C + .pool +_0807C348: + ldr r2, =0x02020630 + ldr r0, [r7] + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + adds r0, r1, 0 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 27 + cmp r0, 0 + blt _0807C368 + bl _0807CFB4 +_0807C368: + adds r0, r1, 0 + bl RemoveObjectAndFreeTiles + movs r1, 0xC8 + lsls r1, 3 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x0000040c + movs r0, 0x52 + bl SetGpuReg + ldr r1, [r7] + bl _0807CF4C + .pool +_0807C390: + ldr r2, [r7] + adds r0, r2, 0 + adds r0, 0xE0 + ldrh r1, [r0] + subs r1, 0x1 + strh r1, [r0] + lsls r1, 16 + movs r0, 0x9E + lsls r0, 17 + cmp r1, r0 + bne _0807C3B0 + adds r1, r2, 0 + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0807C3B0: + ldr r0, [r7] + adds r0, 0xE0 + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0xA4 + lsls r0, 1 + cmp r1, r0 + beq _0807C3C4 + bl _0807CFB4 +_0807C3C4: + ldr r0, =gUnknown_08338DFC + movs r1, 0x80 + movs r2, 0x41 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r7] + adds r1, 0x92 + strb r0, [r1] + bl _0807CFB4 + .pool +_0807C3E0: + ldr r0, =gUnknown_08338D88 + movs r1, 0x80 + movs r2, 0x50 + movs r3, 0x3 + bl AddObjectToFront + ldr r4, =0x020322a0 + ldr r1, [r4] + adds r1, 0x90 + strb r0, [r1] + ldr r0, =gUnknown_08338DC8 + movs r1, 0x80 + movs r2, 0x50 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r4] + adds r1, 0x91 + strb r0, [r1] + ldr r0, [r4] + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r1, 0x1 + bl StartObjectImageAnim + ldr r1, [r4] + bl _0807CF4C + .pool +_0807C434: + ldr r2, [r7] + adds r1, r2, 0 + adds r1, 0xE0 + ldrh r0, [r1] + subs r0, 0x2 + strh r0, [r1] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA6 + bne _0807C44E + subs r1, 0x4C + movs r0, 0xC8 + strh r0, [r1] +_0807C44E: + ldr r1, =0x00001241 + movs r0, 0 + bl SetGpuReg + bl _0807CFB4 + .pool +_0807C460: + ldr r2, =0x02020630 + ldr r4, [r7] + adds r3, r4, 0 + adds r3, 0x90 + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x22] + subs r1, 0x2 + strh r1, [r0, 0x22] + adds r0, r4, 0 + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x22] + subs r1, 0x2 + strh r1, [r0, 0x22] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r3, 0x22 + ldrsh r1, [r0, r3] + movs r0, 0x8 + negs r0, r0 + cmp r1, r0 + blt _0807C4A6 + bl _0807CFB4 +_0807C4A6: + adds r1, r4, 0 + adds r1, 0x94 + movs r0, 0x1D + strh r0, [r1] + bl _0807CFB4 + .pool +_0807C4B8: + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0x94 + movs r1, 0x1E + strh r1, [r0] + bl _0807CFB4 + .pool +_0807C4DC: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0807C4EC + bl _0807CFB4 +_0807C4EC: + ldr r0, [r7] + adds r0, 0x90 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r0, [r7] + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + movs r0, 0x2 + bl sub_807B62C + ldr r1, [r7] + bl _0807CF4C + .pool +_0807C528: + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r5, =gUnknown_08338DC8 + adds r0, r5, 0 + movs r1, 0x6F + movs r2, 0xAA + movs r3, 0 + bl AddObjectToFront + ldr r4, =0x020322a0 + ldr r1, [r4] + adds r1, 0x90 + strb r0, [r1] + movs r2, 0xA + negs r2, r2 + adds r0, r5, 0 + movs r1, 0x81 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r4] + adds r1, 0x91 + strb r0, [r1] + ldr r1, [r4] + bl _0807CF4C + .pool +_0807C574: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0807C592 + movs r0, 0x2E + bl audio_play + ldr r0, =0x020322a0 + ldr r1, [r0] + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0807C592: + ldr r3, =0x02020630 + ldr r0, =0x020322a0 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x90 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x26] + subs r1, 0x3 + strh r1, [r0, 0x26] + adds r2, 0x91 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x26] + adds r1, 0x3 + strh r1, [r0, 0x26] + bl _0807CFB4 + .pool +_0807C5D0: + ldr r5, =0x02020630 + ldr r4, [r7] + adds r2, r4, 0 + adds r2, 0x90 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrh r1, [r0, 0x26] + subs r1, 0x3 + strh r1, [r0, 0x26] + adds r6, r4, 0 + adds r6, 0x91 + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrh r1, [r0, 0x26] + adds r1, 0x3 + strh r1, [r0, 0x26] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r3, r0, r5 + movs r0, 0x26 + ldrsh r1, [r3, r0] + movs r0, 0x5A + negs r0, r0 + cmp r1, r0 + ble _0807C616 + bl _0807CFB4 +_0807C616: + movs r2, 0x1 + strh r2, [r3, 0x30] + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x30] + adds r1, r4, 0 + bl _0807CF4C + .pool +_0807C630: + ldr r2, =0x0000ffff + movs r0, 0x1 + movs r1, 0x10 + bl sub_80A2A20 + bl _0807CF48 + .pool +_0807C644: + ldr r2, =0x0000ffff + movs r0, 0x1 + movs r1, 0 + bl sub_80A2A20 + bl _0807CF48 + .pool +_0807C658: + ldr r2, =0x0000ffff + movs r0, 0x1 + movs r1, 0x10 + bl sub_80A2A20 + bl _0807CF48 + .pool +_0807C66C: + ldr r5, =0x020322a0 + ldr r0, [r5] + adds r0, 0xF0 + ldrh r0, [r0] + bl sub_806E840 + lsls r0, 24 + cmp r0, 0 + bne _0807C6E4 + ldr r4, =0x02020630 + ldr r2, [r5] + adds r2, 0x8E + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x10 + adds r0, r1 + ldr r1, =gUnknown_08338ECC + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0, 0x1] + movs r2, 0x3 + orrs r1, r2 + strb r1, [r0, 0x1] + ldr r0, [r5] + adds r0, 0x8E + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0 + movs r2, 0x3 + movs r3, 0x3 + bl CalcVecFromObjectCenterToObjectUpperLeft + ldr r0, [r5] + adds r0, 0x8E + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0 + bl StartObjectRotScalAnim + b _0807C6FA + .pool +_0807C6E4: + ldr r0, [r5] + adds r0, 0x8E + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r1, 0 + bl StartObjectRotScalAnim +_0807C6FA: + ldr r5, =0x020322a0 + ldr r0, [r5] + adds r0, 0x8F + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + movs r1, 0 + bl StartObjectRotScalAnim + ldr r2, [r5] + adds r3, r2, 0 + adds r3, 0x8E + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x3C + strh r1, [r0, 0x20] + adds r2, 0x8F + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xB4 + strh r1, [r0, 0x20] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xC0 + strh r1, [r0, 0x22] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =0x0000ffe0 + strh r1, [r0, 0x22] + ldrb r0, [r3] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + ldr r0, [r5] + adds r0, 0x8F + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + ldr r1, [r5] + bl _0807CF4C + .pool +_0807C794: + ldr r4, =0x02020630 + ldr r2, [r7] + adds r3, r2, 0 + adds r3, 0x8E + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x26] + subs r1, 0x3 + movs r5, 0 + strh r1, [r0, 0x26] + adds r2, 0x8F + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x26] + adds r1, 0x3 + strh r1, [r0, 0x26] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x26] + adds r0, 0xA3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bhi _0807C7DC + movs r0, 0x2D + bl audio_play +_0807C7DC: + ldr r2, [r7] + adds r3, r2, 0 + adds r3, 0x8E + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r6, 0x26 + ldrsh r1, [r0, r6] + movs r0, 0xDE + negs r0, r0 + cmp r1, r0 + blt _0807C7FC + bl _0807CFB4 +_0807C7FC: + adds r0, r2, 0 + adds r0, 0x90 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r5, [r0, 0x30] + adds r0, r2, 0 + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r5, [r0, 0x30] + adds r1, r2, 0 + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r7] + adds r0, 0x8F + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + ldr r2, =0x0000ffff + movs r0, 0x1 + movs r1, 0 + bl sub_80A2A20 + b _0807CFB4 + .pool +_0807C864: + ldr r4, =0x02020630 + ldr r2, [r7] + adds r3, r2, 0 + adds r3, 0x90 + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x26] + subs r1, 0x3 + strh r1, [r0, 0x26] + adds r2, 0x91 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x26] + adds r1, 0x3 + strh r1, [r0, 0x26] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r2, 0x26 + ldrsh r1, [r0, r2] + movs r0, 0xDE + negs r0, r0 + cmp r1, r0 + ble _0807C8A6 + b _0807CFB4 +_0807C8A6: + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, [r7] + adds r2, r1, 0 + adds r2, 0x94 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + adds r1, 0x90 + ldrb r1, [r1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r0, [r7] + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + b _0807CFB4 + .pool +_0807C8EC: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0807C8FA + b _0807CFB4 +_0807C8FA: + ldr r1, [r7] + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + movs r0, 0x1 + bl sub_807B62C + ldr r0, [r7] + adds r0, 0xE0 + movs r1, 0xA6 + strh r1, [r0] + ldr r0, =gUnknown_08338D88 + movs r4, 0x14 + negs r4, r4 + movs r1, 0x80 + adds r2, r4, 0 + movs r3, 0x3 + bl AddObjectToFront + ldr r1, [r7] + adds r1, 0x90 + strb r0, [r1] + ldr r0, =gUnknown_08338DC8 + movs r1, 0x80 + adds r2, r4, 0 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r7] + adds r1, 0x91 + strb r0, [r1] + ldr r0, [r7] + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r1, 0x1 + bl StartObjectImageAnim + b _0807CFB4 + .pool +_0807C964: + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0x10 + movs r3, 0 + b _0807CF44 +_0807C974: + movs r1, 0x92 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0807C98C + b _0807CFB4 +_0807C98C: + b _0807CF48 + .pool +_0807C994: + ldr r2, =0x02020630 + ldr r4, [r7] + adds r3, r4, 0 + adds r3, 0x90 + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x26] + adds r1, 0x3 + strh r1, [r0, 0x26] + adds r0, r4, 0 + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x26] + adds r1, 0x3 + strh r1, [r0, 0x26] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r3, 0x26 + ldrsh r1, [r0, r3] + movs r6, 0x22 + ldrsh r0, [r0, r6] + adds r1, r0 + cmp r1, 0x40 + beq _0807C9DA + b _0807CFB4 +_0807C9DA: + adds r1, r4, 0 + b _0807CF4C + .pool +_0807C9E4: + ldr r1, [r7] + adds r5, r1, 0 + adds r5, 0xE0 + ldrh r0, [r5] + adds r0, 0x2 + strh r0, [r5] + lsls r0, 16 + asrs r0, 16 + movs r6, 0x9E + lsls r6, 1 + cmp r0, r6 + bgt _0807C9FE + b _0807CFB4 +_0807C9FE: + strh r6, [r5] + b _0807CF4C +_0807CA02: + ldr r0, [r7] + adds r0, 0x90 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r0, [r7] + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r3, [r7] + adds r2, r3, 0 + adds r2, 0x94 + ldrh r0, [r2] + adds r0, 0x1 + movs r1, 0 + strh r0, [r2] + str r1, [r3, 0x64] + b _0807CFB4 + .pool +_0807CA40: + ldr r1, [r7] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0xA + beq _0807CA4E + b _0807CFB4 +_0807CA4E: + b _0807CF4C +_0807CA50: + ldr r1, [r7] + adds r2, r1, 0 + adds r2, 0xE0 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + lsls r0, 16 + asrs r0, 16 + movs r3, 0xAE + lsls r3, 1 + cmp r0, r3 + ble _0807CA72 + strh r3, [r2] + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0807CA72: + ldr r2, [r7] + adds r0, r2, 0 + adds r0, 0xE0 + movs r3, 0 + ldrsh r1, [r0, r3] + movs r0, 0xA4 + lsls r0, 1 + cmp r1, r0 + beq _0807CA86 + b _0807CFB4 +_0807CA86: + adds r0, r2, 0 + adds r0, 0xFA + ldrb r0, [r0] + cmp r0, 0 + bne _0807CA92 + b _0807CFB4 +_0807CA92: + ldr r0, =gUnknown_08338DFC + movs r1, 0x80 + movs r2, 0x41 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r7] + adds r1, 0x92 + strb r0, [r1] + ldr r2, =0x02020630 + ldr r0, [r7] + adds r0, 0x92 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_807AAE0 + str r1, [r0] + b _0807CFB4 + .pool +_0807CAC8: + ldr r0, =gUnknown_08338E74 + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0 + bl AddObjectToFront + ldr r2, =0x020322a0 + ldr r1, [r2] + adds r1, 0x91 + strb r0, [r1] + ldr r0, [r2] + adds r0, 0x94 + movs r1, 0x32 + strh r1, [r0] + b _0807CFB4 + .pool +_0807CAF0: + ldr r2, =0x02020630 + ldr r0, [r7] + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + adds r0, r1, 0 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 27 + cmp r0, 0 + blt _0807CB0E + b _0807CFB4 +_0807CB0E: + adds r0, r1, 0 + bl RemoveObjectAndFreeTiles + movs r0, 0x6 + bl sub_807B62C + ldr r1, [r7] + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + movs r0, 0x9F + bl audio_play + b _0807CFB4 + .pool +_0807CB30: + ldr r1, [r7] + adds r2, r1, 0 + adds r2, 0xEA + ldrh r3, [r2] + ldr r0, =0x000003ff + cmp r3, r0 + bhi _0807CB4C + adds r0, r3, 0 + adds r0, 0x34 + strh r0, [r2] + b _0807CB5A + .pool +_0807CB4C: + movs r0, 0x80 + lsls r0, 3 + strh r0, [r2] + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0807CB5A: + ldr r4, [r7] +_0807CB5C: + adds r0, r4, 0 + adds r0, 0xEA + ldrh r1, [r0] + movs r0, 0x80 + lsls r0, 8 + bl __divsi3 + adds r4, 0xE8 + strh r0, [r4] + b _0807CFB4 +_0807CB70: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0x94 + movs r1, 0x3C + strh r1, [r0] + b _0807CFB4 + .pool +_0807CB90: + ldr r4, =0x02037fd4 + ldrb r1, [r4, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0807CB9E + b _0807CFB4 +_0807CB9E: + movs r0, 0x5 + bl sub_807B62C + movs r0, 0x7 + bl sub_807B62C + ldrb r0, [r4, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r4, 0x8] + b _0807CF48 + .pool +_0807CBB8: + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + b _0807CF44 + .pool +_0807CBD4: + movs r1, 0xA2 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0807CBEC + b _0807CFB4 +_0807CBEC: + b _0807CF48 + .pool +_0807CBF4: + ldr r0, =gUnknown_08338D28 + movs r2, 0x8 + negs r2, r2 + movs r1, 0x78 + movs r3, 0 + bl AddObjectToFront + ldr r5, =0x020322a0 + ldr r1, [r5] + adds r1, 0xD3 + movs r6, 0 + strb r0, [r1] + ldr r4, =0x02020630 + ldr r2, [r5] + adds r2, 0xD3 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x4A + strh r1, [r0, 0x34] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_807E6AC + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl StartObjectImageAnim + ldr r0, [r5] + adds r0, 0xD3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x2 + bl StartObjectRotScalAnim + ldr r0, [r5] + adds r0, 0xD3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0, 0x5] + lsrs r1, 4 + adds r1, 0x10 + movs r0, 0x1 + lsls r0, r1 + ldr r2, =0x0000ffff + movs r1, 0x10 + bl sub_80A2A20 + ldr r2, [r5] + adds r1, r2, 0 + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + str r6, [r2, 0x64] + b _0807CFB4 + .pool +_0807CC9C: + ldr r2, =0x02020630 + ldr r0, [r7] + adds r0, 0xD3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x5] + lsrs r1, 4 + adds r1, 0x10 + movs r0, 0x1 + lsls r0, r1 + ldr r1, =0x0000ffff + str r1, [sp] + movs r1, 0x1 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r1, [r7] + b _0807CF4C + .pool +_0807CCD0: + ldr r2, =0x02020630 + ldr r3, [r7] + adds r0, r3, 0 + adds r0, 0xD3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + beq _0807CCEE + b _0807CFB4 +_0807CCEE: + adds r0, r3, 0 + adds r0, 0xF2 + ldrh r2, [r0] + lsls r0, r2, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r1, [r1] + ldr r1, [r1, 0x10] + ldr r3, [r3, 0x6C] + bl DecompressMonPic_DetectFrontOrBack_2 + ldr r1, [r7] + b _0807CF4C + .pool +_0807CD1C: + ldr r4, =0x02020630 + ldr r2, [r7] + adds r6, r2, 0 + adds r6, 0x8F + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r5, 0 + movs r1, 0x78 + strh r1, [r0, 0x20] + ldrb r0, [r6] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldr r3, =gUnknown_08300D38 + adds r2, 0xF2 + ldrh r0, [r2] + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x1] + adds r0, 0x3C + strh r0, [r1, 0x22] + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r5, [r0, 0x24] + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r5, [r0, 0x26] + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0 + bl StartObjectImageAnim + ldr r3, [r7] + adds r0, r3, 0 + adds r0, 0x8F + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r1, [r1, 0x5] + lsrs r1, 4 + movs r2, 0x2 + str r2, [sp] + movs r2, 0x1 + str r2, [sp, 0x4] + movs r2, 0x14 + str r2, [sp, 0x8] + ldr r2, =0x000fffff + str r2, [sp, 0xC] + adds r3, 0xF2 + ldrh r2, [r3] + str r2, [sp, 0x10] + movs r2, 0x78 + movs r3, 0x54 + bl sub_8076438 + ldr r0, [r7] + adds r0, 0xD3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl obj_free_rotscale_entry + ldr r0, [r7] + adds r0, 0xD3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r1, [r7] + b _0807CF4C + .pool +_0807CDDC: + movs r1, 0xAA + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EE966 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807F1A8 + ldr r0, =0x020322a0 + ldr r3, [r0] + adds r1, r3, 0 + adds r1, 0x94 + movs r2, 0 + movs r0, 0xA7 +_0807CE06: + strh r0, [r1] + str r2, [r3, 0x64] + b _0807CFB4 + .pool +_0807CE18: + ldr r3, [r7] + ldr r0, [r3, 0x64] + adds r0, 0x1 + str r0, [r3, 0x64] + cmp r0, 0x3C + bhi _0807CE26 + b _0807CFB4 +_0807CE26: + adds r0, r3, 0 + adds r0, 0x94 + movs r2, 0 + ldr r1, =0x0000010b + strh r1, [r0] + str r2, [r3, 0x64] + b _0807CFB4 + .pool +_0807CE38: + bl sub_80A3678 + lsls r0, 24 + cmp r0, 0 + bne _0807CE44 + b _0807CFB4 +_0807CE44: + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0x94 + movs r1, 0x44 + strh r1, [r0] + b _0807CFB4 + .pool +_0807CE54: + ldr r1, [r7] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0xA + bne _0807CE66 + ldr r0, =0x00000173 + bl fanfare_play +_0807CE66: + ldr r1, [r7] + ldr r0, [r1, 0x64] + cmp r0, 0xFA + beq _0807CE70 + b _0807CFB4 +_0807CE70: + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + movs r5, 0 + strh r0, [r1] + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EE977 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807F1A8 + ldr r0, [r7] + str r5, [r0, 0x64] + b _0807CFB4 + .pool +_0807CEA0: + ldr r1, [r7] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0x3C + beq _0807CEAE + b _0807CFB4 +_0807CEAE: + b _0807CF4C +_0807CEB0: + bl sub_807F14C + b _0807CF48 +_0807CEB6: + ldr r2, [r7] + adds r0, r2, 0 + adds r0, 0xEE + ldrb r0, [r0] + cmp r0, 0 + beq _0807CEC6 + movs r0, 0x1 + b _0807CFB6 +_0807CEC6: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0807CFB4 + adds r1, r2, 0 + b _0807CF4C + .pool +_0807CEDC: + ldr r0, =0x020375e2 + ldrb r0, [r0] + movs r1, 0 + bl sub_807B4D0 + ldr r1, =0x030061e8 + ldr r0, =sub_807B60C + str r0, [r1] + ldr r7, =0x02032298 + ldrb r0, [r7] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x020244ec + adds r0, r5 + movs r1, 0x1 + movs r2, 0 + bl GetEvolutionTargetSpecies + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _0807CF48 + ldrb r3, [r7] + adds r0, r3, 0 + muls r0, r6 + adds r0, r5 + ldr r1, =0x020322a0 + ldr r1, [r1] + adds r1, 0x8F + ldrb r2, [r1] + adds r1, r4, 0 + bl sub_813E1D4 + b _0807CF48 + .pool +_0807CF38: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 +_0807CF44: + bl pal_fade_maybe +_0807CF48: + ldr r0, =0x020322a0 + ldr r1, [r0] +_0807CF4C: + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0807CFB4 + .pool +_0807CF5C: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0807CFB4 + ldr r0, [r7] + adds r0, 0xF4 + ldrh r0, [r0] + bl current_map_music_set + ldr r0, [r7] + cmp r0, 0 + beq _0807CFAA + bl FreeAllWindowBuffers + movs r0, 0x3 + bl GetBgTilemapBuffer + bl Free + movs r0, 0x1 + bl GetBgTilemapBuffer + bl Free + movs r0, 0 + bl GetBgTilemapBuffer + bl Free + bl sub_805F094 + ldr r0, [r7] + bl Free + str r4, [r7] +_0807CFAA: + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + bl sub_807E784 +_0807CFB4: + movs r0, 0 +_0807CFB6: + add sp, 0x14 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_807BBEC + + thumb_func_start sub_807CFC8 +sub_807CFC8: @ 807CFC8 + push {r4-r7,lr} + sub sp, 0x14 + ldr r0, =0x020322a0 + ldr r1, [r0] + adds r1, 0x94 + ldrh r5, [r1] + ldr r1, =0x0000010b + adds r7, r0, 0 + cmp r5, r1 + bls _0807CFE0 + bl _0807E400 +_0807CFE0: + lsls r0, r5, 2 + ldr r1, =_0807CFF8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0807CFF8: + .4byte _0807D428 + .4byte _0807D4A0 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807D4FC + .4byte _0807D544 + .4byte _0807D5B8 + .4byte _0807E400 + .4byte _0807D624 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807D648 + .4byte _0807D678 + .4byte _0807D68A + .4byte _0807D6AC + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807D7A4 + .4byte _0807D7C4 + .4byte _0807D830 + .4byte _0807D8B4 + .4byte _0807D8D8 + .4byte _0807D924 + .4byte _0807D970 + .4byte _0807D9CC + .4byte _0807DA38 + .4byte _0807DA4C + .4byte _0807DA60 + .4byte _0807DA74 + .4byte _0807DB9C + .4byte _0807DC6C + .4byte _0807DCF4 + .4byte _0807DD94 + .4byte _0807DDA4 + .4byte _0807DDC4 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807DEE8 + .4byte _0807DEF8 + .4byte _0807DF16 + .4byte _0807E400 + .4byte _0807DF3C + .4byte _0807DF7C + .4byte _0807DFBC + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807DFDC + .4byte _0807E004 + .4byte _0807E020 + .4byte _0807E040 + .4byte _0807E0E8 + .4byte _0807E11C + .4byte _0807E168 + .4byte _0807E228 + .4byte _0807E2A0 + .4byte _0807E2EC + .4byte _0807E2FC + .4byte _0807E302 + .4byte _0807E328 + .4byte _0807E384 + .4byte _0807E3A8 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807D6F4 + .4byte _0807D728 + .4byte _0807D77C + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807DE1C + .4byte _0807DE84 + .4byte _0807DEC0 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E264 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807D85C + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E284 +_0807D428: + ldr r3, =0x02020630 + ldr r0, [r7] + adds r0, 0x8E + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + ldr r4, [r7] + adds r2, r4, 0 + adds r2, 0x8E + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldr r1, =0x0000ff4c + strh r1, [r0, 0x24] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldr r2, =gUnknown_08300D38 + adds r0, r4, 0 + adds r0, 0xF0 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + strh r0, [r1, 0x26] + adds r1, r4, 0 + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + bl current_map_music_get + ldr r1, [r7] + adds r1, 0xF4 + strh r0, [r1] + ldr r0, =0x00000179 + bl current_map_music_set + bl _0807E400 + .pool +_0807D4A0: + ldr r5, [r7] + adds r6, r5, 0 + adds r6, 0xE6 + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + ble _0807D4D4 + ldr r2, =0x02020630 + adds r0, r5, 0 + adds r0, 0x8E + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x24] + adds r1, 0x3 + strh r1, [r0, 0x24] + ldrh r0, [r6] + subs r0, 0x3 + strh r0, [r6] + bl _0807E400 + .pool +_0807D4D4: + ldr r2, =0x02020630 + adds r0, r5, 0 + adds r0, 0x8E + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strh r1, [r0, 0x24] + strh r1, [r6] + adds r1, r5, 0 + adds r1, 0x94 + movs r0, 0xA + strh r0, [r1] + bl _0807E400 + .pool +_0807D4FC: + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EE942 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807F1A8 + ldr r4, =0x020322a0 + ldr r0, [r4] + adds r2, r0, 0 + adds r2, 0xF0 + ldrh r1, [r2] + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + beq _0807D52A + adds r0, r1, 0 + movs r1, 0 + bl cry_related +_0807D52A: + ldr r3, [r4] + adds r1, r3, 0 + adds r1, 0x94 + movs r2, 0 + movs r0, 0xB + bl _0807E252 + .pool +_0807D544: + ldr r1, [r7] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0x50 + beq _0807D554 + bl _0807E400 +_0807D554: + adds r0, r1, 0 + adds r0, 0x8E + ldrb r0, [r0] + ldr r2, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r1, [r1, 0x5] + lsrs r1, 4 + movs r2, 0x2 + str r2, [sp] + movs r2, 0x1 + str r2, [sp, 0x4] + movs r2, 0x14 + str r2, [sp, 0x8] + ldr r2, =0x000fffff + str r2, [sp, 0xC] + movs r2, 0x78 + movs r3, 0x20 + bl sub_807671C + ldr r1, [r7] + adds r1, 0xD2 + strb r0, [r1] + ldr r1, [r7] + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EE959 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807F1A8 + bl _0807E400 + .pool +_0807D5B8: + ldr r5, =0x02020630 + ldr r0, [r7] + adds r0, 0xD2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, r5, 0 + adds r4, 0x1C + adds r0, r4 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + beq _0807D5D8 + bl _0807E400 +_0807D5D8: + ldr r0, =gUnknown_08338D28 + movs r1, 0x78 + movs r2, 0x20 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r7] + adds r1, 0xD3 + strb r0, [r1] + ldr r2, [r7] + adds r0, r2, 0 + adds r0, 0xD3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_807E5D8 + str r1, [r0] + adds r2, 0xD2 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl RemoveObjectAndFreeTiles + ldr r1, [r7] + bl _0807E398 + .pool +_0807D624: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0x94 + movs r1, 0x14 + strh r1, [r0] + bl _0807E400 + .pool +_0807D648: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0807D658 + bl _0807E400 +_0807D658: + movs r0, 0x4 + bl sub_807B62C + movs r0, 0 + movs r1, 0xFF + bl FillWindowPixelBuffer + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + bl _0807E394 + .pool +_0807D678: + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0x10 + movs r3, 0 + bl _0807E390 +_0807D68A: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0807D69A + bl _0807E400 +_0807D69A: + ldr r0, [r7] + adds r0, 0x94 + movs r1, 0x17 + strh r1, [r0] + bl _0807E400 + .pool +_0807D6AC: + ldr r4, =0x020322a0 + ldr r0, [r4] + adds r2, r0, 0 + adds r2, 0xEA + ldrh r1, [r2] + movs r0, 0x80 + lsls r0, 1 + cmp r1, r0 + bls _0807D6CC + adds r0, r1, 0 + subs r0, 0x34 + strh r0, [r2] + b _0807D6E6 + .pool +_0807D6CC: + movs r0, 0x1 + bl sub_807B62C + ldr r3, [r4] + adds r1, r3, 0 + adds r1, 0xEA + movs r2, 0 + movs r0, 0x80 + strh r0, [r1] + subs r1, 0x56 + movs r0, 0x7C + strh r0, [r1] + str r2, [r3, 0x64] +_0807D6E6: + ldr r0, =0x020322a0 + ldr r4, [r0] + bl _0807DFA8 + .pool +_0807D6F4: + ldr r1, [r7] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0x14 + bhi _0807D704 + bl _0807E400 +_0807D704: + movs r0, 0x3 + bl sub_807B62C + ldr r0, =gUnknown_08338E8C + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r7] + adds r1, 0x91 + strb r0, [r1] + ldr r1, [r7] + bl _0807E398 + .pool +_0807D728: + ldr r2, =0x02020630 + ldr r0, [r7] + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + adds r0, r1, 0 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 27 + cmp r0, 0 + blt _0807D748 + bl _0807E400 +_0807D748: + adds r0, r1, 0 + bl RemoveObjectAndFreeTiles + ldr r1, =0x00000452 + movs r0, 0x50 + bl SetGpuReg + movs r1, 0x82 + lsls r1, 3 + movs r0, 0x52 + bl SetGpuReg + ldr r0, =c3_08054588 + movs r1, 0x5 + bl AddTask + ldr r1, [r7] + bl _0807E398 + .pool +_0807D77C: + ldr r0, =c3_08054588 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + beq _0807D78C + bl _0807E400 +_0807D78C: + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0x94 + movs r1, 0x1A + strh r1, [r0] + bl _0807E400 + .pool +_0807D7A4: + ldr r2, [r7] + adds r0, r2, 0 + adds r0, 0xE0 + ldrh r1, [r0] + subs r1, 0x1 + strh r1, [r0] + lsls r1, 16 + movs r0, 0x9E + lsls r0, 17 + cmp r1, r0 + beq _0807D7BE + bl _0807E400 +_0807D7BE: + adds r1, r2, 0 + bl _0807E398 +_0807D7C4: + ldr r0, =gUnknown_08338D88 + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0x3 + bl AddObjectToFront + ldr r4, =0x020322a0 + ldr r1, [r4] + adds r1, 0x90 + strb r0, [r1] + ldr r5, =0x02020630 + ldr r0, [r4] + adds r0, 0x90 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r5, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_807AA4C + str r1, [r0] + ldr r0, =gUnknown_08338DC8 + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r4] + adds r1, 0x91 + strb r0, [r1] + ldr r0, [r4] + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x1 + bl StartObjectImageAnim + ldr r1, [r4] + bl _0807E398 + .pool +_0807D830: + ldr r2, [r7] + adds r1, r2, 0 + adds r1, 0xE0 + ldrh r0, [r1] + subs r0, 0x3 + strh r0, [r1] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA6 + bne _0807D84A + subs r1, 0x4C + movs r0, 0xC8 + strh r0, [r1] +_0807D84A: + ldr r1, =0x00001241 + movs r0, 0 + bl SetGpuReg + bl _0807E400 + .pool +_0807D85C: + ldr r2, =0x02020630 + ldr r4, [r7] + adds r3, r4, 0 + adds r3, 0x90 + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x22] + subs r1, 0x2 + strh r1, [r0, 0x22] + adds r0, r4, 0 + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x22] + subs r1, 0x2 + strh r1, [r0, 0x22] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r2, 0x22 + ldrsh r1, [r0, r2] + movs r0, 0x8 + negs r0, r0 + cmp r1, r0 + blt _0807D8A2 + bl _0807E400 +_0807D8A2: + adds r1, r4, 0 + adds r1, 0x94 + movs r0, 0x1D + strh r0, [r1] + bl _0807E400 + .pool +_0807D8B4: + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0x94 + movs r1, 0x1E + strh r1, [r0] + bl _0807E400 + .pool +_0807D8D8: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0807D8E8 + bl _0807E400 +_0807D8E8: + ldr r0, [r7] + adds r0, 0x90 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r0, [r7] + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + movs r0, 0x2 + bl sub_807B62C + ldr r1, [r7] + bl _0807E398 + .pool +_0807D924: + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r5, =gUnknown_08338DC8 + adds r0, r5, 0 + movs r1, 0x6F + movs r2, 0xAA + movs r3, 0 + bl AddObjectToFront + ldr r4, =0x020322a0 + ldr r1, [r4] + adds r1, 0x90 + strb r0, [r1] + movs r2, 0xA + negs r2, r2 + adds r0, r5, 0 + movs r1, 0x81 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r4] + adds r1, 0x91 + strb r0, [r1] + ldr r1, [r4] + bl _0807E398 + .pool +_0807D970: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0807D98E + movs r0, 0x2E + bl audio_play + ldr r0, =0x020322a0 + ldr r1, [r0] + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0807D98E: + ldr r3, =0x02020630 + ldr r0, =0x020322a0 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x90 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x26] + subs r1, 0x3 + strh r1, [r0, 0x26] + adds r2, 0x91 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x26] + adds r1, 0x3 + strh r1, [r0, 0x26] + bl _0807E400 + .pool +_0807D9CC: + ldr r5, =0x02020630 + ldr r4, [r7] + adds r2, r4, 0 + adds r2, 0x90 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrh r1, [r0, 0x26] + subs r1, 0x3 + strh r1, [r0, 0x26] + adds r6, r4, 0 + adds r6, 0x91 + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrh r1, [r0, 0x26] + adds r1, 0x3 + strh r1, [r0, 0x26] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r3, r0, r5 + movs r0, 0x26 + ldrsh r1, [r3, r0] + movs r0, 0x5A + negs r0, r0 + cmp r1, r0 + ble _0807DA12 + bl _0807E400 +_0807DA12: + movs r2, 0x1 + strh r2, [r3, 0x30] + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x30] + adds r1, r4, 0 + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + ldr r0, =c3_0805465C + b _0807DC5A + .pool +_0807DA38: + ldr r2, =0x0000ffff + movs r0, 0x8 + movs r1, 0x10 + bl sub_80A2A20 + bl _0807E394 + .pool +_0807DA4C: + ldr r2, =0x0000ffff + movs r0, 0x8 + movs r1, 0x10 + bl sub_80A2A20 + bl _0807E394 + .pool +_0807DA60: + ldr r2, =0x0000ffff + movs r0, 0x8 + movs r1, 0x10 + bl sub_80A2A20 + bl _0807E394 + .pool +_0807DA74: + ldr r5, =0x020322a0 + ldr r0, [r5] + adds r0, 0xF0 + ldrh r0, [r0] + bl sub_806E840 + lsls r0, 24 + cmp r0, 0 + bne _0807DAEC + ldr r4, =0x02020630 + ldr r2, [r5] + adds r2, 0x8E + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x10 + adds r0, r1 + ldr r1, =gUnknown_08338ECC + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0, 0x1] + movs r2, 0x3 + orrs r1, r2 + strb r1, [r0, 0x1] + ldr r0, [r5] + adds r0, 0x8E + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0 + movs r2, 0x3 + movs r3, 0x3 + bl CalcVecFromObjectCenterToObjectUpperLeft + ldr r0, [r5] + adds r0, 0x8E + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0 + bl StartObjectRotScalAnim + b _0807DB02 + .pool +_0807DAEC: + ldr r0, [r5] + adds r0, 0x8E + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r1, 0 + bl StartObjectRotScalAnim +_0807DB02: + ldr r5, =0x020322a0 + ldr r0, [r5] + adds r0, 0x8F + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + movs r1, 0 + bl StartObjectRotScalAnim + ldr r2, [r5] + adds r3, r2, 0 + adds r3, 0x8E + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x28 + strh r1, [r0, 0x20] + adds r2, 0x8F + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xC8 + strh r1, [r0, 0x20] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xC0 + strh r1, [r0, 0x22] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =0x0000ffe0 + strh r1, [r0, 0x22] + ldrb r0, [r3] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + ldr r0, [r5] + adds r0, 0x8F + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + ldr r1, [r5] + bl _0807E398 + .pool +_0807DB9C: + ldr r4, =0x02020630 + ldr r2, [r7] + adds r3, r2, 0 + adds r3, 0x8E + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x26] + subs r1, 0x3 + movs r5, 0 + strh r1, [r0, 0x26] + adds r2, 0x8F + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x26] + adds r1, 0x3 + strh r1, [r0, 0x26] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x26] + adds r0, 0xA3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bhi _0807DBE4 + movs r0, 0x2D + bl audio_play +_0807DBE4: + ldr r2, [r7] + adds r3, r2, 0 + adds r3, 0x8E + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r6, 0x26 + ldrsh r1, [r0, r6] + movs r0, 0xDE + negs r0, r0 + cmp r1, r0 + blt _0807DC04 + bl _0807E400 +_0807DC04: + adds r0, r2, 0 + adds r0, 0x90 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r5, [r0, 0x30] + adds r0, r2, 0 + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r5, [r0, 0x30] + adds r1, r2, 0 + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r7] + adds r0, 0x8F + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + ldr r0, =sub_807F39C +_0807DC5A: + movs r1, 0x5 + bl AddTask + b _0807E400 + .pool +_0807DC6C: + ldr r4, =0x02020630 + ldr r2, [r7] + adds r3, r2, 0 + adds r3, 0x90 + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x26] + subs r1, 0x3 + strh r1, [r0, 0x26] + adds r2, 0x91 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x26] + adds r1, 0x3 + strh r1, [r0, 0x26] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r2, 0x26 + ldrsh r1, [r0, r2] + movs r0, 0xDE + negs r0, r0 + cmp r1, r0 + ble _0807DCAE + b _0807E400 +_0807DCAE: + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, [r7] + adds r2, r1, 0 + adds r2, 0x94 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + adds r1, 0x90 + ldrb r1, [r1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r0, [r7] + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + b _0807E400 + .pool +_0807DCF4: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0807DD02 + b _0807E400 +_0807DD02: + ldr r1, [r7] + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + movs r0, 0x1 + bl sub_807B62C + ldr r0, [r7] + adds r0, 0xE0 + movs r1, 0xA6 + strh r1, [r0] + movs r0, 0x3 + bl sub_807B62C + ldr r0, [r7] + adds r0, 0xE4 + movs r1, 0xCE + lsls r1, 1 + strh r1, [r0] + ldr r0, =gUnknown_08338D88 + movs r4, 0x14 + negs r4, r4 + movs r1, 0x78 + adds r2, r4, 0 + movs r3, 0x3 + bl AddObjectToFront + ldr r1, [r7] + adds r1, 0x90 + strb r0, [r1] + ldr r5, =0x02020630 + ldr r0, [r7] + adds r0, 0x90 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r5, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_807AA4C + str r1, [r0] + ldr r0, =gUnknown_08338DC8 + movs r1, 0x78 + adds r2, r4, 0 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r7] + adds r1, 0x91 + strb r0, [r1] + ldr r0, [r7] + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x1 + bl StartObjectImageAnim + b _0807E400 + .pool +_0807DD94: + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0x10 + movs r3, 0 + b _0807E390 +_0807DDA4: + movs r1, 0x92 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0807DDBC + b _0807E400 +_0807DDBC: + b _0807E394 + .pool +_0807DDC4: + ldr r2, =0x02020630 + ldr r4, [r7] + adds r3, r4, 0 + adds r3, 0x90 + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x26] + adds r1, 0x4 + strh r1, [r0, 0x26] + adds r0, r4, 0 + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x26] + adds r1, 0x4 + strh r1, [r0, 0x26] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r6, 0x26 + ldrsh r1, [r0, r6] + movs r2, 0x22 + ldrsh r0, [r0, r2] + adds r1, r0 + cmp r1, 0x40 + beq _0807DE0A + b _0807E400 +_0807DE0A: + adds r0, r4, 0 + adds r0, 0x94 + movs r1, 0x90 + strh r1, [r0] + movs r0, 0 + str r0, [r4, 0x64] + b _0807E400 + .pool +_0807DE1C: + movs r1, 0xB2 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + ldr r4, =0x020322a0 + ldr r2, [r4] + adds r1, r2, 0 + adds r1, 0xE0 + ldrh r0, [r1] + adds r0, 0x3 + strh r0, [r1] + adds r1, 0x4 + ldrh r0, [r1] + adds r0, 0x3 + strh r0, [r1] + ldr r0, [r2, 0x64] + adds r0, 0x1 + str r0, [r2, 0x64] + cmp r0, 0xA + bne _0807DE60 + ldr r0, =c3_08054588 + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0x1 + strh r0, [r1, 0xC] +_0807DE60: + ldr r1, [r4] + adds r3, r1, 0 + adds r3, 0xE0 + movs r6, 0 + ldrsh r0, [r3, r6] + movs r2, 0x9E + lsls r2, 1 + cmp r0, r2 + bgt _0807DE74 + b _0807E400 +_0807DE74: + strh r2, [r3] + b _0807E398 + .pool +_0807DE84: + ldr r0, [r7] + adds r0, 0x90 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r0, [r7] + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r3, [r7] + adds r2, r3, 0 + adds r2, 0x94 + ldrh r0, [r2] + adds r0, 0x1 + movs r1, 0 + strh r0, [r2] + str r1, [r3, 0x64] + b _0807E400 + .pool +_0807DEC0: + ldr r0, =c3_08054588 + bl is_function_an_active_task + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + beq _0807DED0 + b _0807E400 +_0807DED0: + ldr r0, =0x020322a0 + ldr r2, [r0] + adds r1, r2, 0 + adds r1, 0x94 + movs r0, 0x2E + strh r0, [r1] + str r3, [r2, 0x64] + b _0807E400 + .pool +_0807DEE8: + ldr r1, [r7] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0xA + beq _0807DEF6 + b _0807E400 +_0807DEF6: + b _0807E398 +_0807DEF8: + ldr r1, [r7] + adds r5, r1, 0 + adds r5, 0xE0 + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + lsls r0, 16 + asrs r0, 16 + movs r6, 0xAE + lsls r6, 1 + cmp r0, r6 + bgt _0807DF12 + b _0807E400 +_0807DF12: + strh r6, [r5] + b _0807E398 +_0807DF16: + ldr r0, =gUnknown_08338E74 + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0 + bl AddObjectToFront + ldr r2, =0x020322a0 + ldr r1, [r2] + adds r1, 0x91 + strb r0, [r1] + ldr r0, [r2] + adds r0, 0x94 + movs r1, 0x32 + strh r1, [r0] + b _0807E400 + .pool +_0807DF3C: + ldr r2, =0x02020630 + ldr r0, [r7] + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + adds r0, r1, 0 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 27 + cmp r0, 0 + blt _0807DF5A + b _0807E400 +_0807DF5A: + adds r0, r1, 0 + bl RemoveObjectAndFreeTiles + movs r0, 0x6 + bl sub_807B62C + ldr r1, [r7] + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + movs r0, 0x9F + bl audio_play + b _0807E400 + .pool +_0807DF7C: + ldr r1, [r7] + adds r2, r1, 0 + adds r2, 0xEA + ldrh r3, [r2] + ldr r0, =0x000003ff + cmp r3, r0 + bhi _0807DF98 + adds r0, r3, 0 + adds r0, 0x34 + strh r0, [r2] + b _0807DFA6 + .pool +_0807DF98: + movs r0, 0x80 + lsls r0, 3 + strh r0, [r2] + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0807DFA6: + ldr r4, [r7] +_0807DFA8: + adds r0, r4, 0 + adds r0, 0xEA + ldrh r1, [r0] + movs r0, 0x80 + lsls r0, 8 + bl __divsi3 + adds r4, 0xE8 + strh r0, [r4] + b _0807E400 +_0807DFBC: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0x94 + movs r1, 0x3C + strh r1, [r0] + b _0807E400 + .pool +_0807DFDC: + ldr r4, =0x02037fd4 + ldrb r1, [r4, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0807DFEA + b _0807E400 +_0807DFEA: + movs r0, 0x5 + bl sub_807B62C + movs r0, 0x7 + bl sub_807B62C + ldrb r0, [r4, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r4, 0x8] + b _0807E394 + .pool +_0807E004: + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + b _0807E390 + .pool +_0807E020: + movs r1, 0xA2 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0807E038 + b _0807E400 +_0807E038: + b _0807E394 + .pool +_0807E040: + ldr r0, =gUnknown_08338D28 + movs r2, 0x8 + negs r2, r2 + movs r1, 0x78 + movs r3, 0 + bl AddObjectToFront + ldr r5, =0x020322a0 + ldr r1, [r5] + adds r1, 0xD3 + movs r6, 0 + strb r0, [r1] + ldr r4, =0x02020630 + ldr r2, [r5] + adds r2, 0xD3 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x4A + strh r1, [r0, 0x34] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_807E6AC + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl StartObjectImageAnim + ldr r0, [r5] + adds r0, 0xD3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x2 + bl StartObjectRotScalAnim + ldr r0, [r5] + adds r0, 0xD3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0, 0x5] + lsrs r1, 4 + adds r1, 0x10 + movs r0, 0x1 + lsls r0, r1 + ldr r2, =0x0000ffff + movs r1, 0x10 + bl sub_80A2A20 + ldr r2, [r5] + adds r1, r2, 0 + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + str r6, [r2, 0x64] + b _0807E400 + .pool +_0807E0E8: + ldr r2, =0x02020630 + ldr r0, [r7] + adds r0, 0xD3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x5] + lsrs r1, 4 + adds r1, 0x10 + movs r0, 0x1 + lsls r0, r1 + ldr r1, =0x0000ffff + str r1, [sp] + movs r1, 0x1 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r1, [r7] + b _0807E398 + .pool +_0807E11C: + ldr r2, =0x02020630 + ldr r3, [r7] + adds r0, r3, 0 + adds r0, 0xD3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + beq _0807E13A + b _0807E400 +_0807E13A: + adds r0, r3, 0 + adds r0, 0xF2 + ldrh r2, [r0] + lsls r0, r2, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r1, [r1] + ldr r1, [r1, 0x10] + ldr r3, [r3, 0x6C] + bl DecompressMonPic_DetectFrontOrBack_2 + ldr r1, [r7] + b _0807E398 + .pool +_0807E168: + ldr r4, =0x02020630 + ldr r2, [r7] + adds r6, r2, 0 + adds r6, 0x8F + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r5, 0 + movs r1, 0x78 + strh r1, [r0, 0x20] + ldrb r0, [r6] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldr r3, =gUnknown_08300D38 + adds r2, 0xF2 + ldrh r0, [r2] + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x1] + adds r0, 0x3C + strh r0, [r1, 0x22] + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r5, [r0, 0x24] + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r5, [r0, 0x26] + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0 + bl StartObjectImageAnim + ldr r3, [r7] + adds r0, r3, 0 + adds r0, 0x8F + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r1, [r1, 0x5] + lsrs r1, 4 + movs r2, 0x2 + str r2, [sp] + movs r2, 0x1 + str r2, [sp, 0x4] + movs r2, 0x14 + str r2, [sp, 0x8] + ldr r2, =0x000fffff + str r2, [sp, 0xC] + adds r3, 0xF2 + ldrh r2, [r3] + str r2, [sp, 0x10] + movs r2, 0x78 + movs r3, 0x54 + bl sub_8076438 + ldr r0, [r7] + adds r0, 0xD3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl obj_free_rotscale_entry + ldr r0, [r7] + adds r0, 0xD3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r1, [r7] + b _0807E398 + .pool +_0807E228: + movs r1, 0xAA + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EE966 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807F1A8 + ldr r0, =0x020322a0 + ldr r3, [r0] + adds r1, r3, 0 + adds r1, 0x94 + movs r2, 0 + movs r0, 0xA7 +_0807E252: + strh r0, [r1] + str r2, [r3, 0x64] + b _0807E400 + .pool +_0807E264: + ldr r3, [r7] + ldr r0, [r3, 0x64] + adds r0, 0x1 + str r0, [r3, 0x64] + cmp r0, 0x3C + bhi _0807E272 + b _0807E400 +_0807E272: + adds r0, r3, 0 + adds r0, 0x94 + movs r2, 0 + ldr r1, =0x0000010b + strh r1, [r0] + str r2, [r3, 0x64] + b _0807E400 + .pool +_0807E284: + bl sub_80A3678 + lsls r0, 24 + cmp r0, 0 + bne _0807E290 + b _0807E400 +_0807E290: + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0x94 + movs r1, 0x44 + strh r1, [r0] + b _0807E400 + .pool +_0807E2A0: + ldr r1, [r7] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0xA + bne _0807E2B2 + ldr r0, =0x00000173 + bl fanfare_play +_0807E2B2: + ldr r1, [r7] + ldr r0, [r1, 0x64] + cmp r0, 0xFA + beq _0807E2BC + b _0807E400 +_0807E2BC: + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + movs r5, 0 + strh r0, [r1] + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EE977 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807F1A8 + ldr r0, [r7] + str r5, [r0, 0x64] + b _0807E400 + .pool +_0807E2EC: + ldr r1, [r7] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0x3C + beq _0807E2FA + b _0807E400 +_0807E2FA: + b _0807E398 +_0807E2FC: + bl sub_807F14C + b _0807E394 +_0807E302: + ldr r2, [r7] + adds r0, r2, 0 + adds r0, 0xEE + ldrb r0, [r0] + cmp r0, 0 + beq _0807E312 + movs r0, 0x1 + b _0807E402 +_0807E312: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0807E400 + adds r1, r2, 0 + b _0807E398 + .pool +_0807E328: + ldr r0, =0x020375e2 + ldrb r0, [r0] + movs r1, 0 + bl sub_807B4D0 + ldr r1, =0x030061e8 + ldr r0, =sub_807B60C + str r0, [r1] + ldr r7, =0x02032298 + ldrb r0, [r7] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x020244ec + adds r0, r5 + movs r1, 0x1 + movs r2, 0 + bl GetEvolutionTargetSpecies + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _0807E394 + ldrb r3, [r7] + adds r0, r3, 0 + muls r0, r6 + adds r0, r5 + ldr r1, =0x020322a0 + ldr r1, [r1] + adds r1, 0x8F + ldrb r2, [r1] + adds r1, r4, 0 + bl sub_813E1D4 + b _0807E394 + .pool +_0807E384: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 +_0807E390: + bl pal_fade_maybe +_0807E394: + ldr r0, =0x020322a0 + ldr r1, [r0] +_0807E398: + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0807E400 + .pool +_0807E3A8: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0807E400 + ldr r0, [r7] + adds r0, 0xF4 + ldrh r0, [r0] + bl current_map_music_set + ldr r0, [r7] + cmp r0, 0 + beq _0807E3F6 + bl FreeAllWindowBuffers + movs r0, 0x3 + bl GetBgTilemapBuffer + bl Free + movs r0, 0x1 + bl GetBgTilemapBuffer + bl Free + movs r0, 0 + bl GetBgTilemapBuffer + bl Free + bl sub_805F094 + ldr r0, [r7] + bl Free + str r4, [r7] +_0807E3F6: + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + bl sub_807E784 +_0807E400: + movs r0, 0 +_0807E402: + add sp, 0x14 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_807CFC8 + + thumb_func_start c2_08053788 +c2_08053788: @ 807E414 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0 + beq _0807E434 + cmp r0, 0x4 + beq _0807E444 + b _0807E4B4 + .pool +_0807E434: + movs r0, 0x4 + strb r0, [r1] + ldr r1, =0x03002700 + movs r0, 0x1 + b _0807E4B2 + .pool +_0807E444: + ldr r0, =0x030061e8 + ldr r1, =sub_807EB50 + mov r8, r1 + str r1, [r0] + ldr r7, =0x02032298 + ldrb r0, [r7] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x020244ec + adds r0, r5 + movs r1, 0x1 + movs r2, 0 + bl GetEvolutionTargetSpecies + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _0807E494 + ldrb r3, [r7] + adds r0, r3, 0 + muls r0, r6 + adds r0, r5 + ldr r1, =0x020322a0 + ldr r1, [r1] + adds r1, 0x8F + ldrb r2, [r1] + adds r1, r4, 0 + bl sub_813E1D4 + b _0807E4AE + .pool +_0807E494: + bl sub_8077260 + cmp r0, 0 + beq _0807E4A8 + ldr r0, =sub_807F464 + bl SetMainCallback2 + b _0807E4AE + .pool +_0807E4A8: + mov r0, r8 + bl SetMainCallback2 +_0807E4AE: + ldr r1, =0x02032298 + movs r0, 0xFF +_0807E4B2: + strb r0, [r1] +_0807E4B4: + bl sub_800B33C + lsls r0, 24 + cmp r0, 0 + bne _0807E4C2 + bl RunActiveTasks +_0807E4C2: + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end c2_08053788 + + thumb_func_start sub_807E4DC +sub_807E4DC: @ 807E4DC + push {r4-r6,lr} + bl sub_807ACDC + bl sub_800A550 + lsls r0, 24 + lsrs r5, r0, 24 + movs r6, 0x1 + adds r0, r5, 0 + ands r0, r6 + cmp r0, 0 + beq _0807E51A + ldr r4, =0x020223c4 + ldrh r1, [r4] + ldr r0, =0x0000dcba + cmp r1, r0 + bne _0807E504 + ldr r0, =c2_08053788 + bl SetMainCallback2 +_0807E504: + ldrh r1, [r4] + ldr r0, =0x0000abcd + cmp r1, r0 + bne _0807E514 + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0x72 + strb r6, [r0] +_0807E514: + movs r0, 0 + bl sub_800A5EC +_0807E51A: + movs r0, 0x2 + ands r0, r5 + cmp r0, 0 + beq _0807E542 + ldr r0, =0x020223c4 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + ldrh r1, [r0] + ldr r0, =0x0000abcd + cmp r1, r0 + bne _0807E53C + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0x73 + movs r1, 0x1 + strb r1, [r0] +_0807E53C: + movs r0, 0x1 + bl sub_800A5EC +_0807E542: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807E4DC + + thumb_func_start sub_807E55C +sub_807E55C: @ 807E55C + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + movs r1, 0xA + bl __divsi3 + ldrh r4, [r5, 0x22] + adds r4, r0 + strh r4, [r5, 0x22] + ldrh r0, [r5, 0x30] + ldrh r2, [r5, 0x38] + adds r0, r2 + strh r0, [r5, 0x38] + movs r1, 0x38 + ldrsh r0, [r5, r1] + movs r1, 0xA + bl __divsi3 + strh r0, [r5, 0x20] + lsls r4, 16 + asrs r4, 16 + cmp r4, 0x4C + ble _0807E5AA + movs r0, 0x4C + strh r0, [r5, 0x22] + movs r2, 0x2E + ldrsh r1, [r5, r2] + movs r2, 0x32 + ldrsh r0, [r5, r2] + muls r0, r1 + negs r0, r0 + movs r1, 0x64 + bl __divsi3 + strh r0, [r5, 0x2E] + ldrh r0, [r5, 0x34] + adds r0, 0x1 + strh r0, [r5, 0x34] +_0807E5AA: + movs r1, 0x20 + ldrsh r0, [r5, r1] + cmp r0, 0x78 + bne _0807E5B6 + movs r0, 0 + strh r0, [r5, 0x30] +_0807E5B6: + ldrh r0, [r5, 0x36] + ldrh r2, [r5, 0x2E] + adds r0, r2 + strh r0, [r5, 0x2E] + movs r1, 0x34 + ldrsh r0, [r5, r1] + cmp r0, 0x4 + bne _0807E5CE + movs r0, 0x1 + strh r0, [r5, 0x3C] + ldr r0, =DummyObjectCallback + str r0, [r5, 0x1C] +_0807E5CE: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807E55C + + thumb_func_start sub_807E5D8 +sub_807E5D8: @ 807E5D8 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldr r1, =gUnknown_08339024 + movs r2, 0x2E + ldrsh r0, [r4, r2] + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0x16 + bne _0807E600 + movs r0, 0x38 + bl audio_play +_0807E600: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2C + bne _0807E636 + movs r0, 0x8C + bl audio_play + ldr r0, =sub_807E64C + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x2E] + ldrb r1, [r4, 0x5] + lsrs r1, 4 + adds r1, 0x10 + movs r0, 0x1 + lsls r0, r1 + movs r1, 0x1 + negs r1, r1 + ldr r2, =0x0000ffff + str r2, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe +_0807E636: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807E5D8 + + thumb_func_start sub_807E64C +sub_807E64C: @ 807E64C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0x14 + bne _0807E660 + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim +_0807E660: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _0807E69E + ldr r1, =gUnknown_08339024 + movs r2, 0x2E + ldrsh r0, [r4, r2] + adds r0, r1 + movs r1, 0 + ldrsb r1, [r0, r1] + ldrh r0, [r4, 0x26] + subs r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x17 + bne _0807E69E + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0x94 + movs r1, 0xE + strh r1, [r0] +_0807E69E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807E64C + + thumb_func_start sub_807E6AC +sub_807E6AC: @ 807E6AC + push {r4,lr} + adds r4, r0, 0 + ldrh r2, [r4, 0x32] + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0807E6DC + ldrh r0, [r4, 0x22] + adds r0, 0x4 + strh r0, [r4, 0x22] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x34 + ldrsh r1, [r4, r3] + cmp r0, r1 + ble _0807E72C + adds r0, r2, 0x1 + strh r0, [r4, 0x32] + movs r0, 0x16 + strh r0, [r4, 0x2E] + movs r0, 0x38 + bl audio_play + b _0807E72C +_0807E6DC: + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x42 + bne _0807E6EA + movs r0, 0x39 + bl audio_play +_0807E6EA: + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0x5C + bne _0807E6F8 + movs r0, 0x3A + bl audio_play +_0807E6F8: + movs r3, 0x2E + ldrsh r0, [r4, r3] + cmp r0, 0x6B + bne _0807E706 + movs r0, 0x3B + bl audio_play +_0807E706: + ldr r1, =gUnknown_08339024 + movs r2, 0x2E + ldrsh r0, [r4, r2] + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrh r3, [r4, 0x26] + adds r0, r3 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6C + bne _0807E72C + ldr r0, =DummyObjectCallback + str r0, [r4, 0x1C] +_0807E72C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807E6AC + + thumb_func_start sub_807E73C +sub_807E73C: @ 807E73C + push {r4-r6,lr} + ldr r0, =0x020375e0 + ldrh r0, [r0] + lsls r4, r0, 4 + subs r4, r0 + lsls r4, 2 + ldr r0, =gUnknown_08338ED0 + adds r4, r0 + ldr r0, =0x02021cc4 + ldrh r1, [r4, 0x38] + movs r6, 0xB + muls r1, r6 + ldr r5, =gSpeciesNames + adds r1, r5 + bl CopyString + ldr r0, =0x02021dc4 + ldrh r1, [r4, 0xC] + muls r1, r6 + adds r1, r5 + bl CopyString + ldrh r0, [r4, 0x38] + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_807E73C + + thumb_func_start sub_807E784 +sub_807E784: @ 807E784 + push {r4,lr} + sub sp, 0x20 + ldr r0, =0x020375e0 + ldrh r0, [r0] + lsls r4, r0, 4 + subs r4, r0 + lsls r4, 2 + ldr r0, =gUnknown_08338ED0 + adds r4, r0 + ldr r0, =0x020375e2 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + ldr r0, =0x02021cc4 + mov r1, sp + bl CopyString_Limit10 + ldr r0, =0x02021dc4 + ldrh r2, [r4, 0xC] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + add sp, 0x20 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807E784 + + thumb_func_start sub_807E7E8 +sub_807E7E8: @ 807E7E8 + push {r4-r7,lr} + sub sp, 0x38 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, r1, 4 + subs r2, r1 + lsls r2, 2 + ldr r1, =gUnknown_08338ED0 + adds r5, r2, r1 + movs r1, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x38 + bl pokemon_getattr + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + add r4, sp, 0x34 + movs r0, 0xFE + strb r0, [r4] + ldr r6, =0x02024744 + ldrh r1, [r5, 0xC] + movs r3, 0x1 + str r3, [sp] + ldr r0, [r5, 0x24] + str r0, [sp, 0x4] + str r3, [sp, 0x8] + ldr r0, [r5, 0x18] + str r0, [sp, 0xC] + adds r0, r6, 0 + movs r3, 0x20 + bl create_pokemon_set_level + adds r2, r5, 0 + adds r2, 0xE + adds r0, r6, 0 + movs r1, 0x27 + bl pokemon_setattr + adds r2, r5, 0 + adds r2, 0xF + adds r0, r6, 0 + movs r1, 0x28 + bl pokemon_setattr + adds r2, r5, 0 + adds r2, 0x10 + adds r0, r6, 0 + movs r1, 0x29 + bl pokemon_setattr + adds r2, r5, 0 + adds r2, 0x11 + adds r0, r6, 0 + movs r1, 0x2A + bl pokemon_setattr + adds r2, r5, 0 + adds r2, 0x12 + adds r0, r6, 0 + movs r1, 0x2B + bl pokemon_setattr + adds r2, r5, 0 + adds r2, 0x13 + adds r0, r6, 0 + movs r1, 0x2C + bl pokemon_setattr + adds r0, r6, 0 + movs r1, 0x2 + adds r2, r5, 0 + bl pokemon_setattr + adds r2, r5, 0 + adds r2, 0x2B + adds r0, r6, 0 + movs r1, 0x7 + bl pokemon_setattr + adds r2, r5, 0 + adds r2, 0x36 + adds r0, r6, 0 + movs r1, 0x31 + bl pokemon_setattr + adds r2, r5, 0 + adds r2, 0x14 + adds r0, r6, 0 + movs r1, 0x2E + bl pokemon_setattr + adds r2, r5, 0 + adds r2, 0x1D + adds r0, r6, 0 + movs r1, 0x17 + bl pokemon_setattr + adds r2, r5, 0 + adds r2, 0x1E + adds r0, r6, 0 + movs r1, 0x18 + bl pokemon_setattr + adds r2, r5, 0 + adds r2, 0x1C + adds r0, r6, 0 + movs r1, 0x16 + bl pokemon_setattr + adds r2, r5, 0 + adds r2, 0x1F + adds r0, r6, 0 + movs r1, 0x21 + bl pokemon_setattr + adds r2, r5, 0 + adds r2, 0x20 + adds r0, r6, 0 + movs r1, 0x2F + bl pokemon_setattr + adds r2, r5, 0 + adds r2, 0x37 + adds r0, r6, 0 + movs r1, 0x30 + bl pokemon_setattr + adds r0, r6, 0 + movs r1, 0x23 + adds r2, r4, 0 + bl pokemon_setattr + mov r4, sp + adds r4, 0x35 + movs r0, 0 + strb r0, [r4] + ldrh r0, [r5, 0x28] + cmp r0, 0 + beq _0807E960 + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _0807E954 + add r0, sp, 0x10 + adds r1, r5, 0 + bl sub_807E974 + ldr r0, =0x020321c0 + add r1, sp, 0x10 + ldm r1!, {r2,r3,r7} + stm r0!, {r2,r3,r7} + ldm r1!, {r2,r3,r7} + stm r0!, {r2,r3,r7} + ldm r1!, {r2,r3,r7} + stm r0!, {r2,r3,r7} + adds r0, r6, 0 + movs r1, 0x40 + adds r2, r4, 0 + bl pokemon_setattr + adds r2, r5, 0 + adds r2, 0x28 + adds r0, r6, 0 + movs r1, 0xC + bl pokemon_setattr + b _0807E960 + .pool +_0807E954: + adds r2, r5, 0 + adds r2, 0x28 + adds r0, r6, 0 + movs r1, 0xC + bl pokemon_setattr +_0807E960: + ldr r0, =0x02024744 + bl pokemon_calc_effective_stats + add sp, 0x38 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807E7E8 + + thumb_func_start sub_807E974 +sub_807E974: @ 807E974 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + ldr r2, =gUnknown_08338FC0 + adds r0, r6, 0 + adds r0, 0x2A + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, r0, r2 + adds r1, r5, 0 + movs r3, 0x8 +_0807E98E: + ldrh r0, [r2] + strh r0, [r1] + adds r2, 0x2 + adds r1, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _0807E98E + adds r4, r5, 0 + adds r4, 0x12 + adds r1, r6, 0 + adds r1, 0x2B + adds r0, r4, 0 + bl CopyString + adds r0, r4, 0 + movs r1, 0 + bl sub_81DB4DC + ldr r1, [r6, 0x18] + lsrs r0, r1, 24 + strb r0, [r5, 0x1A] + lsrs r0, r1, 16 + strb r0, [r5, 0x1B] + lsrs r0, r1, 8 + strb r0, [r5, 0x1C] + strb r1, [r5, 0x1D] + ldrh r0, [r6, 0xC] + strh r0, [r5, 0x1E] + ldrh r0, [r6, 0x28] + strh r0, [r5, 0x20] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807E974 + + thumb_func_start sub_807E9D4 +sub_807E9D4: @ 807E9D4 + push {r4-r6,lr} + ldr r6, =0x020375e2 + ldrh r0, [r6] + movs r5, 0x64 + muls r0, r5 + ldr r4, =0x020244ec + adds r0, r4 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _0807EA08 + ldrh r0, [r6] + muls r0, r5 + adds r0, r4 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + b _0807EA0A + .pool +_0807EA08: + movs r0, 0 +_0807EA0A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_807E9D4 + + thumb_func_start sub_807EA10 +sub_807EA10: @ 807EA10 + push {lr} + ldr r0, =0x020375e2 + ldrb r0, [r0] + ldr r1, =0x020375e0 + ldrb r1, [r1] + bl sub_807E7E8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_807EA10 + + thumb_func_start sub_807EA2C +sub_807EA2C: @ 807EA2C + push {r4-r6,lr} + bl sub_807BBC8 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x1 + bne _0807EA96 + ldr r5, =0x020322a0 + ldr r0, [r5] + adds r0, 0x8E + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r0, [r5] + adds r0, 0x8F + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl obj_free_rotscale_entry + ldr r0, =0x02032298 + ldrb r4, [r0] + ldrb r0, [r0, 0x1] + movs r1, 0x6 + bl __umodsi3 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_807B4D0 + bl sub_8077260 + cmp r0, 0 + bne _0807EA90 + ldr r0, [r5] + adds r2, r0, 0 + adds r2, 0x74 + ldr r1, =0x0000abcd + strh r1, [r2] + adds r0, 0x93 + strb r6, [r0] +_0807EA90: + ldr r0, =sub_807EACC + bl SetMainCallback2 +_0807EA96: + bl sub_807B5B8 + bl sub_807E4DC + bl RunActiveTasks + bl RunTextPrinters + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807EA2C + + thumb_func_start sub_807EACC +sub_807EACC: @ 807EACC + push {r4,lr} + bl sub_807ACDC + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8077260 + cmp r0, 0 + beq _0807EAEC + ldr r0, =c2_08053788 + bl SetMainCallback2 + b _0807EB2C + .pool +_0807EAEC: + bl sub_807E4DC + cmp r4, 0 + bne _0807EB2C + ldr r4, =0x020322a0 + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x72 + ldrh r1, [r0] + ldr r0, =0x00000101 + cmp r1, r0 + bne _0807EB2C + adds r1, r2, 0 + adds r1, 0x74 + ldr r0, =0x0000dcba + strh r0, [r1] + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, [r4] + adds r1, 0x74 + movs r2, 0x14 + bl link_0800A448 + ldr r0, [r4] + adds r0, 0x72 + movs r1, 0x2 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x73 + strb r1, [r0] +_0807EB2C: + bl RunActiveTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807EACC + + thumb_func_start sub_807EB50 +sub_807EB50: @ 807EB50 + push {r4,lr} + sub sp, 0x4 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0x65 + bls _0807EB66 + b _0807F03A +_0807EB66: + lsls r0, 2 + ldr r1, =_0807EB78 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0807EB78: + .4byte _0807ED10 + .4byte _0807ED2C + .4byte _0807ED98 + .4byte _0807F03A + .4byte _0807EE78 + .4byte _0807EF3C + .4byte _0807EF64 + .4byte _0807EF7E + .4byte _0807EFA4 + .4byte _0807EFF0 + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807EE9C + .4byte _0807EEEC + .4byte _0807EF1A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807EDC0 + .4byte _0807EE1C + .4byte _0807EE38 + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807ED44 + .4byte _0807ED7C +_0807ED10: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EF6D2 + b _0807EDA6 + .pool +_0807ED2C: + movs r0, 0 + bl sub_8077288 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r2, 0 + movs r1, 0x64 + b _0807EE88 + .pool +_0807ED44: + ldr r0, =0x020322a0 + ldr r3, [r0] + ldr r0, [r3, 0x64] + adds r0, 0x1 + str r0, [r3, 0x64] + cmp r0, 0xB4 + bls _0807ED60 + movs r1, 0x87 + lsls r1, 3 + adds r0, r2, r1 + movs r2, 0 + movs r1, 0x65 + strb r1, [r0] + str r2, [r3, 0x64] +_0807ED60: + bl sub_8077294 + cmp r0, 0 + bne _0807ED6A + b _0807F03A +_0807ED6A: + ldr r0, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + b _0807ED8E + .pool +_0807ED7C: + bl sub_8077294 + cmp r0, 0 + bne _0807ED86 + b _0807F03A +_0807ED86: + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 +_0807ED8E: + movs r1, 0x2 + strb r1, [r0] + b _0807F03A + .pool +_0807ED98: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + movs r0, 0x32 + strb r0, [r1] + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_082C8959 +_0807EDA6: + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807F1A8 + b _0807F03A + .pool +_0807EDC0: + bl InUnionRoom + cmp r0, 0 + bne _0807EDCE + movs r0, 0x15 + bl sav12_xor_increment +_0807EDCE: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _0807EDF6 + ldr r4, =0x020229e8 + bl link_get_multiplayer_id + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r4, 0x4 + adds r1, r4 + ldr r1, [r1] + movs r0, 0x2 + bl sub_801B990 +_0807EDF6: + bl sub_8076D5C + bl sub_8153380 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + ldrb r0, [r1] + adds r0, 0x1 + movs r2, 0 + strb r0, [r1] + b _0807EE8A + .pool +_0807EE1C: + ldr r0, =0x020322a0 + ldr r1, [r0] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0x5 + beq _0807EE2C + b _0807F03A +_0807EE2C: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + b _0807EFE4 + .pool +_0807EE38: + bl sub_81533AC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _0807EE5C + bl sav2_gender2_inplace_and_xFE + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x4 + strb r1, [r0] + b _0807F03A + .pool +_0807EE5C: + ldr r0, =0x020322a0 + ldr r0, [r0] + str r1, [r0, 0x64] + ldr r0, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x33 + strb r1, [r0] + b _0807F03A + .pool +_0807EE78: + bl sub_81533E0 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r2, 0 + movs r1, 0x28 +_0807EE88: + strb r1, [r0] +_0807EE8A: + ldr r0, =0x020322a0 + ldr r0, [r0] + str r2, [r0, 0x64] + b _0807F03A + .pool +_0807EE9C: + ldr r4, =0x020322a0 + ldr r1, [r4] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0x32 + bhi _0807EEAC + b _0807F03A +_0807EEAC: + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _0807EED4 + bl GenerateRandomNumber + ldr r4, [r4] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1E + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + str r0, [r4, 0x64] + b _0807EEDA + .pool +_0807EED4: + ldr r1, [r4] + movs r0, 0 + str r0, [r1, 0x64] +_0807EEDA: + ldr r0, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x29 + strb r1, [r0] + b _0807F03A + .pool +_0807EEEC: + ldr r0, =0x020322a0 + ldr r1, [r0] + ldr r0, [r1, 0x64] + cmp r0, 0 + bne _0807EF14 + movs r0, 0x1 + bl sub_8077288 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x2A + strb r1, [r0] + b _0807F03A + .pool +_0807EF14: + subs r0, 0x1 + str r0, [r1, 0x64] + b _0807F03A +_0807EF1A: + bl sub_8077294 + cmp r0, 0 + bne _0807EF24 + b _0807F03A +_0807EF24: + bl sub_8153408 + ldr r0, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x5 + strb r1, [r0] + b _0807F03A + .pool +_0807EF3C: + ldr r0, =0x020322a0 + ldr r1, [r0] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0x3C + bls _0807F03A + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r0, 0x2 + bl sub_8077288 + b _0807F03A + .pool +_0807EF64: + bl sub_8077294 + cmp r0, 0 + beq _0807F03A + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + b _0807EFDC +_0807EF7E: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0807F03A + movs r0, 0x3 + bl play_sound_effect + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0807EFE4 + .pool +_0807EFA4: + bl sub_80A3258 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0807F03A + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _0807EFD8 + ldr r0, =0x030022c0 + ldr r1, [r0, 0x8] + ldr r0, =sub_80773AC + cmp r1, r0 + bne _0807EFD8 + movs r0, 0x3 + bl sub_8077288 + b _0807EFDC + .pool +_0807EFD8: + bl sub_800AC34 +_0807EFDC: + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 +_0807EFE4: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0807F03A + .pool +_0807EFF0: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _0807F028 + ldr r1, [r2, 0x8] + ldr r0, =sub_80773AC + cmp r1, r0 + bne _0807F028 + bl sub_8077294 + cmp r0, 0 + beq _0807F03A + ldr r0, =0x03002700 + movs r1, 0 + strb r1, [r0] + ldr r0, =c2_080543C4 + bl SetMainCallback2 + b _0807F03A + .pool +_0807F028: + ldr r0, =0x03003124 + ldrb r1, [r0] + cmp r1, 0 + bne _0807F03A + ldr r0, =0x03002700 + strb r1, [r0] + ldr r0, =c2_080543C4 + bl SetMainCallback2 +_0807F03A: + bl sub_800B33C + lsls r0, 24 + cmp r0, 0 + bne _0807F048 + bl RunActiveTasks +_0807F048: + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807EB50 + + thumb_func_start c2_080543C4 +c2_080543C4: @ 807F068 + push {r4,r5,lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0807F0BE + bl FreeAllWindowBuffers + movs r0, 0x3 + bl GetBgTilemapBuffer + bl Free + movs r0, 0x1 + bl GetBgTilemapBuffer + bl Free + movs r0, 0 + bl GetBgTilemapBuffer + bl Free + bl sub_805F094 + ldr r4, =0x020322a0 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _0807F0B6 + bl sub_800E084 +_0807F0B6: + ldr r0, =0x030022c0 + ldr r0, [r0, 0x8] + bl SetMainCallback2 +_0807F0BE: + bl RunActiveTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end c2_080543C4 + + thumb_func_start sub_807F0E4 +sub_807F0E4: @ 807F0E4 + push {lr} + sub sp, 0x4 + bl script_env_2_enable + ldr r0, =sub_807F110 + movs r1, 0xA + bl AddTask + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_807F0E4 + + thumb_func_start sub_807F110 +sub_807F110: @ 807F110 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0807F134 + ldr r0, =sub_807B270 + bl SetMainCallback2 + ldr r1, =0x03005dac + ldr r0, =sub_80AF168 + str r0, [r1] + adds r0, r4, 0 + bl remove_task +_0807F134: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807F110 + + thumb_func_start sub_807F14C +sub_807F14C: @ 807F14C + push {r4,r5,lr} + movs r5, 0 + movs r4, 0 +_0807F152: + ldr r0, =0x02032298 + ldrb r0, [r0, 0x1] + movs r1, 0x6 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + adds r1, r4, 0 + adds r1, 0x43 + bl pokemon_getattr + adds r0, r5, r0 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xB + bls _0807F152 + cmp r5, 0 + beq _0807F18A + ldr r0, =0x0000089b + bl FlagSet +_0807F18A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807F14C + + thumb_func_start sub_807F19C +sub_807F19C: @ 807F19C + push {lr} + bl sub_807B170 + pop {r0} + bx r0 + thumb_func_end sub_807F19C + + thumb_func_start sub_807F1A8 +sub_807F1A8: @ 807F1A8 + push {r4-r6,lr} + sub sp, 0x14 + adds r5, r0, 0 + adds r6, r1, 0 + adds r4, r2, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0xFF + bl FillWindowPixelBuffer + ldr r2, =0x020322a0 + ldr r0, [r2] + adds r0, 0xF6 + movs r3, 0 + movs r1, 0xF + strb r1, [r0] + ldr r0, [r2] + adds r0, 0xF7 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0xF8 + movs r1, 0x6 + strb r1, [r0] + str r3, [sp] + str r3, [sp, 0x4] + ldr r0, [r2] + adds r0, 0xF6 + str r0, [sp, 0x8] + lsls r4, 24 + asrs r4, 24 + str r4, [sp, 0xC] + str r6, [sp, 0x10] + adds r0, r5, 0 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x2 + bl AddTextPrinterParametrized2 + adds r0, r5, 0 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807F1A8 + + thumb_func_start c3_08054588 +c3_08054588: @ 807F210 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + ldr r1, =gUnknown_08339090 + movs r2, 0 + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r0, r1 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r2, r1, 0 + movs r3, 0x4 + ldrsh r0, [r4, r3] + cmp r0, 0 + bne _0807F254 + movs r0, 0x80 + lsls r0, 1 + cmp r1, r0 + beq _0807F25C + lsls r0, r1, 1 + ldr r1, =gUnknown_08337AA0 + adds r0, r1 + b _0807F25E + .pool +_0807F254: + movs r0, 0x80 + lsls r0, 1 + cmp r1, r0 + bne _0807F26C +_0807F25C: + ldr r0, =gUnknown_08337EA0 +_0807F25E: + movs r1, 0x30 + movs r2, 0x20 + bl gpu_pal_apply + b _0807F27A + .pool +_0807F26C: + lsls r0, r2, 1 + ldr r1, =gUnknown_08337CA0 + adds r0, r1 + movs r1, 0x30 + movs r2, 0x20 + bl gpu_pal_apply +_0807F27A: + ldr r0, =gUnknown_08339090 + movs r2, 0 + ldrsh r1, [r4, r2] + lsls r1, 1 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + bne _0807F298 + movs r3, 0x2 + ldrsh r0, [r4, r3] + cmp r0, 0 + bne _0807F298 + movs r0, 0xC3 + bl audio_play +_0807F298: + movs r0, 0x2 + ldrsh r2, [r4, r0] + ldr r1, =gUnknown_08339090 + movs r3, 0 + ldrsh r0, [r4, r3] + lsls r0, 1 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r2, r0 + bne _0807F2D8 + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + movs r0, 0 + strh r0, [r4, 0x2] + movs r2, 0 + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _0807F2DE + adds r0, r5, 0 + bl remove_task + b _0807F2DE + .pool +_0807F2D8: + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] +_0807F2DE: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end c3_08054588 + + thumb_func_start c3_0805465C +c3_0805465C: @ 807F2E4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r5, r0, r1 + movs r0, 0 + ldrsh r4, [r5, r0] + cmp r4, 0 + bne _0807F336 + ldr r2, =0x020322a0 + ldr r0, [r2] + adds r3, r0, 0 + adds r3, 0xFD + movs r1, 0x78 + strb r1, [r3] + adds r0, 0xFB + strb r1, [r0] + ldr r0, [r2] + adds r0, 0xFC + strb r4, [r0] + ldr r0, [r2] + adds r0, 0xFE + movs r1, 0xA0 + strb r1, [r0] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl SetGpuRegBits + movs r0, 0x4A + movs r1, 0x10 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0x13 + bl SetGpuReg +_0807F336: + ldr r4, =0x020322a0 + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0xFD + ldrb r1, [r1] + adds r0, 0xFB + ldrb r0, [r0] + lsls r0, 8 + orrs r1, r0 + movs r0, 0x40 + bl SetGpuReg + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0xFE + ldrb r1, [r1] + adds r0, 0xFC + ldrb r0, [r0] + lsls r0, 8 + orrs r1, r0 + movs r0, 0x44 + bl SetGpuReg + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + ldr r1, [r4] + adds r1, 0xFB + ldrb r0, [r1] + subs r0, 0x5 + strb r0, [r1] + ldr r1, [r4] + adds r1, 0xFD + ldrb r0, [r1] + adds r0, 0x5 + strb r0, [r1] + ldr r0, [r4] + adds r0, 0xFB + ldrb r0, [r0] + cmp r0, 0x4F + bhi _0807F38E + adds r0, r6, 0 + bl remove_task +_0807F38E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end c3_0805465C + + thumb_func_start sub_807F39C +sub_807F39C: @ 807F39C + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r5, r0, r1 + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0807F3D8 + ldr r2, =0x020322a0 + ldr r0, [r2] + adds r0, 0xFB + movs r1, 0x50 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0xFD + movs r1, 0xA0 + strb r1, [r0] + movs r0, 0x4A + movs r1, 0x10 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0x13 + bl SetGpuReg +_0807F3D8: + ldr r4, =0x020322a0 + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0xFD + ldrb r1, [r1] + adds r0, 0xFB + ldrb r0, [r0] + lsls r0, 8 + orrs r1, r0 + movs r0, 0x40 + bl SetGpuReg + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0xFE + ldrb r1, [r1] + adds r0, 0xFC + ldrb r0, [r0] + lsls r0, 8 + orrs r1, r0 + movs r0, 0x44 + bl SetGpuReg + ldr r0, [r4] + adds r0, 0xFB + ldrb r0, [r0] + cmp r0, 0x78 + beq _0807F44C + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + ldr r1, [r4] + adds r1, 0xFB + ldrb r0, [r1] + adds r0, 0x5 + strb r0, [r1] + ldr r1, [r4] + adds r1, 0xFD + ldrb r0, [r1] + subs r0, 0x5 + strb r0, [r1] + ldr r0, [r4] + adds r0, 0xFB + ldrb r0, [r0] + cmp r0, 0x73 + bls _0807F45C + ldr r2, =0x0000ffff + movs r0, 0x8 + movs r1, 0 + bl sub_80A2A20 + b _0807F45C + .pool +_0807F44C: + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl ClearGpuRegBits + adds r0, r6, 0 + bl remove_task +_0807F45C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_807F39C + + thumb_func_start sub_807F464 +sub_807F464: @ 807F464 + push {r4,r5,lr} + sub sp, 0x4 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0xC + bls _0807F47A + b _0807F70C +_0807F47A: + lsls r0, 2 + ldr r1, =_0807F48C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0807F48C: + .4byte _0807F4C0 + .4byte _0807F4E8 + .4byte _0807F500 + .4byte _0807F550 + .4byte _0807F570 + .4byte _0807F5AC + .4byte _0807F5D0 + .4byte _0807F620 + .4byte _0807F64E + .4byte _0807F66C + .4byte _0807F694 + .4byte _0807F6C4 + .4byte _0807F6F8 +_0807F4C0: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + movs r0, 0x1 + strb r0, [r1] + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EF6D2 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807F1A8 + b _0807F70C + .pool +_0807F4E8: + movs r0, 0 + bl sub_8077288 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r2, 0 + movs r1, 0x2 + b _0807F5BC + .pool +_0807F500: + bl sub_8077294 + cmp r0, 0 + bne _0807F50A + b _0807F70C +_0807F50A: + ldr r0, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r5, 0 + movs r1, 0x3 + strb r1, [r0] + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_082C8959 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807F1A8 + movs r0, 0x15 + bl sav12_xor_increment + bl sub_8153380 + ldr r0, =0x020322a0 + ldr r0, [r0] + str r5, [r0, 0x64] + b _0807F70C + .pool +_0807F550: + ldr r0, =0x020322a0 + ldr r1, [r0] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0x5 + beq _0807F560 + b _0807F70C +_0807F560: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + movs r0, 0x4 + strb r0, [r1] + b _0807F70C + .pool +_0807F570: + bl sub_81533AC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _0807F590 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x5 + strb r1, [r0] + b _0807F70C + .pool +_0807F590: + ldr r0, =0x020322a0 + ldr r0, [r0] + str r1, [r0, 0x64] + ldr r0, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x3 + strb r1, [r0] + b _0807F70C + .pool +_0807F5AC: + bl sub_81533E0 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r2, 0 + movs r1, 0x6 +_0807F5BC: + strb r1, [r0] + ldr r0, =0x020322a0 + ldr r0, [r0] + str r2, [r0, 0x64] + b _0807F70C + .pool +_0807F5D0: + ldr r4, =0x020322a0 + ldr r1, [r4] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0xA + bhi _0807F5E0 + b _0807F70C +_0807F5E0: + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _0807F608 + bl GenerateRandomNumber + ldr r4, [r4] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1E + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + str r0, [r4, 0x64] + b _0807F60E + .pool +_0807F608: + ldr r1, [r4] + movs r0, 0 + str r0, [r1, 0x64] +_0807F60E: + ldr r0, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x7 + strb r1, [r0] + b _0807F70C + .pool +_0807F620: + ldr r0, =0x020322a0 + ldr r1, [r0] + ldr r0, [r1, 0x64] + cmp r0, 0 + bne _0807F648 + movs r0, 0x1 + bl sub_8077288 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x8 + strb r1, [r0] + b _0807F70C + .pool +_0807F648: + subs r0, 0x1 + str r0, [r1, 0x64] + b _0807F70C +_0807F64E: + bl sub_8077294 + cmp r0, 0 + beq _0807F70C + bl sub_8153408 + ldr r0, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x9 + strb r1, [r0] + b _0807F70C + .pool +_0807F66C: + ldr r0, =0x020322a0 + ldr r1, [r0] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0x3C + bls _0807F70C + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r0, 0x2 + bl sub_8077288 + b _0807F70C + .pool +_0807F694: + bl sub_8077294 + cmp r0, 0 + beq _0807F70C + movs r0, 0x3 + bl play_sound_effect + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0xB + strb r1, [r0] + b _0807F70C + .pool +_0807F6C4: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0807F70C + bl sub_80A3258 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0807F70C + movs r0, 0x3 + bl sub_8077288 + ldr r0, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0xC + strb r1, [r0] + b _0807F70C + .pool +_0807F6F8: + bl sub_8077294 + cmp r0, 0 + beq _0807F70C + ldr r0, =0x03002700 + movs r1, 0 + strb r1, [r0] + ldr r0, =c2_080543C4 + bl SetMainCallback2 +_0807F70C: + bl sub_800B33C + lsls r0, 24 + cmp r0, 0 + bne _0807F71A + bl RunActiveTasks +_0807F71A: + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807F464 + + thumb_func_start sub_807F738 +sub_807F738: @ 807F738 + push {lr} + ldr r0, =0x03007630 + ldr r1, =0x0000ffff + ldr r2, =0x020322a4 + ldr r2, [r2] + adds r2, 0x4C + movs r3, 0 + ldrsh r2, [r2, r3] + subs r2, 0x80 + lsls r2, 17 + asrs r2, 16 + bl MPlayPitchControl + pop {r0} + bx r0 + .pool + thumb_func_end sub_807F738 + + thumb_func_start sub_807F764 +sub_807F764: @ 807F764 + push {r4,lr} + sub sp, 0x10 + bl sub_8082DF4 + ldr r0, =0x020322a4 + ldr r0, [r0] + mov r12, r0 + movs r0, 0xA0 + lsls r0, 1 + add r0, r12 + ldr r1, [r0] + movs r0, 0xA2 + lsls r0, 1 + add r0, r12 + ldr r2, [r0] + movs r0, 0xA4 + lsls r0, 1 + add r0, r12 + movs r4, 0 + ldrsh r3, [r0, r4] + movs r0, 0xA5 + lsls r0, 1 + add r0, r12 + movs r4, 0 + ldrsh r0, [r0, r4] + str r0, [sp] + movs r0, 0xA6 + lsls r0, 1 + add r0, r12 + movs r4, 0 + ldrsh r0, [r0, r4] + str r0, [sp, 0x4] + movs r0, 0xA7 + lsls r0, 1 + add r0, r12 + movs r4, 0 + ldrsh r0, [r0, r4] + str r0, [sp, 0x8] + movs r0, 0xA8 + lsls r0, 1 + add r0, r12 + ldrh r0, [r0] + str r0, [sp, 0xC] + movs r0, 0x2 + bl SetBgAffine + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807F764 + + thumb_func_start sub_807F7D8 +sub_807F7D8: @ 807F7D8 + push {r4,r5,lr} + ldr r1, =0x020322a4 + ldr r0, [r1] + ldrb r0, [r0, 0x1] + adds r5, r1, 0 + cmp r0, 0x9 + bls _0807F7E8 + b _0807F9C8 +_0807F7E8: + lsls r0, 2 + ldr r1, =_0807F7FC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0807F7FC: + .4byte _0807F824 + .4byte _0807F854 + .4byte _0807F880 + .4byte _0807F8AC + .4byte _0807F8C8 + .4byte _0807F8F4 + .4byte _0807F910 + .4byte _0807F940 + .4byte _0807F950 + .4byte _0807F980 +_0807F824: + ldr r5, =gUnknown_08D91598 + adds r0, r5, 0 + bl sub_8034974 + adds r0, 0x64 + bl AllocZeroed + adds r1, r0, 0 + ldr r4, =0x020322a4 + ldr r0, [r4] + ldr r2, =0x000011bc + adds r0, r2 + str r1, [r0] + adds r0, r5, 0 + bl LZDecompressWram + ldr r1, [r4] + b _0807F966 + .pool +_0807F854: + ldr r1, =gUnknown_083390F4 + movs r2, 0x80 + lsls r2, 3 + movs r0, 0x2 + movs r3, 0 + bl CopyToBgTilemapBuffer + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + ldr r0, =gUnknown_083390D4 + movs r2, 0x80 + lsls r2, 1 + movs r1, 0 + bl gpu_pal_apply + b _0807F962 + .pool +_0807F880: + ldr r0, [r5] + ldr r1, =0x000011bc + adds r0, r1 + ldr r4, [r0] + ldr r0, =gUnknown_08D91598 + bl sub_8034974 + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + movs r0, 0x2 + adds r1, r4, 0 + movs r3, 0 + bl LoadBgTiles + ldr r1, [r5] + b _0807F966 + .pool +_0807F8AC: + ldr r0, =gUnknown_08D91DB8 + ldr r1, [r5] + ldr r2, =0x000011bc + adds r1, r2 + ldr r1, [r1] + bl LZDecompressWram + ldr r1, [r5] + b _0807F966 + .pool +_0807F8C8: + ldr r0, [r5] + ldr r1, =0x000011bc + adds r0, r1 + ldr r4, [r0] + ldr r0, =gUnknown_08D91DB8 + bl sub_8034974 + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + movs r0, 0x1 + adds r1, r4, 0 + movs r3, 0 + bl LoadBgTiles + ldr r1, [r5] + b _0807F966 + .pool +_0807F8F4: + ldr r0, =gUnknown_08D927EC + ldr r1, [r5] + ldr r2, =0x000011bc + adds r1, r2 + ldr r1, [r1] + bl LZDecompressWram + ldr r1, [r5] + b _0807F966 + .pool +_0807F910: + ldr r0, [r5] + ldr r1, =0x000011bc + adds r0, r1 + ldr r4, [r0] + ldr r0, =gUnknown_08D927EC + bl sub_8034974 + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + movs r0, 0x1 + adds r1, r4, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + ldr r1, [r5] + b _0807F966 + .pool +_0807F940: + ldr r0, =gUnknown_083394F4 + movs r1, 0x80 + movs r2, 0x20 + bl gpu_pal_apply + b _0807F962 + .pool +_0807F950: + ldr r0, =gUnknown_08339AC0 + bl LoadObjectPic + ldr r0, =gUnknown_08339BD8 + bl LoadObjectPic + ldr r0, =gUnknown_08339B38 + bl LoadObjectPic +_0807F962: + ldr r0, =0x020322a4 + ldr r1, [r0] +_0807F966: + ldrb r0, [r1, 0x1] + adds r0, 0x1 + strb r0, [r1, 0x1] + b _0807F9C8 + .pool +_0807F980: + ldr r0, =gUnknown_08339C24 + bl LoadObjectPic + ldr r0, =gUnknown_08339C58 + bl LoadObjectPic + ldr r0, =gUnknown_08339AD0 + bl LoadTaggedObjectPalette + ldr r0, =gUnknown_08339AC8 + bl LoadTaggedObjectPalette + ldr r4, =0x020322a4 + ldr r0, [r4] + ldr r2, =0x000011bc + adds r0, r2 + ldr r0, [r0] + bl Free + ldr r1, [r4] + movs r0, 0 + strb r0, [r1, 0x1] + movs r0, 0x1 + b _0807F9CA + .pool +_0807F9C8: + movs r0, 0 +_0807F9CA: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_807F7D8 + + thumb_func_start sub_807F9D0 +sub_807F9D0: @ 807F9D0 + push {lr} + sub sp, 0x8 + movs r0, 0x1E + str r0, [sp] + movs r0, 0x14 + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuRegBits + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + add sp, 0x8 + pop {r0} + bx r0 + thumb_func_end sub_807F9D0 + + thumb_func_start sub_807FA34 +sub_807FA34: @ 807FA34 + push {r4,lr} + sub sp, 0x8 + ldr r0, =gUnknown_08339980 + bl InitWindows + lsls r0, 16 + cmp r0, 0 + beq _0807FA74 + bl DeactivateAllTextPrinters + movs r4, 0 +_0807FA4A: + lsls r0, r4, 24 + lsrs r0, 24 + movs r1, 0 + bl FillWindowPixelBuffer + adds r4, 0x1 + cmp r4, 0x4 + ble _0807FA4A + movs r0, 0x1E + str r0, [sp] + movs r0, 0x14 + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0xE0 + bl sub_81978B0 +_0807FA74: + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807FA34 + + thumb_func_start sub_807FA80 +sub_807FA80: @ 807FA80 + push {r4,lr} + ldr r4, =0x020322a4 + ldr r0, [r4] + cmp r0, 0 + bne _0807FA94 + movs r0, 0x8F + lsls r0, 5 + bl AllocZeroed + str r0, [r4] +_0807FA94: + ldr r0, [r4] + adds r0, 0x63 + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x63 + strb r1, [r0] + ldr r0, =0x020375e0 + ldrb r0, [r0] + bl sub_807FE54 + ldr r0, =sub_807FAC8 + bl SetMainCallback2 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807FA80 + + thumb_func_start sub_807FAC8 +sub_807FAC8: @ 807FAC8 + push {r4-r6,lr} + sub sp, 0x4 + ldr r1, =0x020322a4 + ldr r0, [r1] + ldrb r0, [r0] + adds r6, r1, 0 + cmp r0, 0x6 + bls _0807FADA + b _0807FCE2 +_0807FADA: + lsls r0, 2 + ldr r1, =_0807FAEC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0807FAEC: + .4byte _0807FB08 + .4byte _0807FBAC + .4byte _0807FC38 + .4byte _0807FC4E + .4byte _0807FC64 + .4byte _0807FC90 + .4byte _0807FCB0 +_0807FB08: + movs r0, 0 + movs r1, 0 + bl SetGpuReg + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_08339974 + movs r0, 0x1 + movs r2, 0x3 + bl InitBgsFromTemplates + ldr r4, =0x020322a4 + ldr r1, [r4] + movs r0, 0xDC + lsls r0, 1 + adds r1, r0 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x000009b8 + adds r1, r0 + movs r0, 0x2 + bl SetBgTilemapBuffer + movs r0, 0 + movs r1, 0x1 + movs r2, 0xD0 + bl sub_809882C + movs r0, 0 + movs r1, 0x14 + movs r2, 0xF0 + bl copy_textbox_border_tile_patterns_to_vram + bl sub_807FA34 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + movs r2, 0 + strb r0, [r1] + ldr r3, [r4] + movs r1, 0x8C + lsls r1, 1 + adds r0, r3, r1 + movs r1, 0 + strh r2, [r0] + movs r4, 0x8B + lsls r4, 1 + adds r0, r3, r4 + strh r2, [r0] + movs r0, 0x8D + lsls r0, 1 + adds r4, r3, r0 + movs r0, 0x50 + strh r0, [r4] + movs r4, 0x8E + lsls r4, 1 + adds r0, r3, r4 + strh r2, [r0] + adds r4, 0x2 + adds r0, r3, r4 + strh r2, [r0] + strb r1, [r3, 0x1] + bl sub_8082D28 + b _0807FCE2 + .pool +_0807FBAC: + bl sub_807F7D8 + lsls r0, 24 + cmp r0, 0 + bne _0807FBB8 + b _0807FCE2 +_0807FBB8: + movs r4, 0 + ldr r5, =gUnknown_083399C8 + ldr r6, =0x020322a4 +_0807FBBE: + ldrb r1, [r5] + ldrb r2, [r5, 0x1] + ldr r0, =gUnknown_08339AD8 + movs r3, 0x1 + bl AddObjectToFront + ldr r1, [r6] + adds r1, 0x50 + adds r1, r4 + strb r0, [r1] + ldr r0, [r6] + adds r0, 0x50 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + adds r1, r4, 0 + adds r1, 0x8 + lsls r1, 24 + lsrs r1, 24 + bl StartObjectImageAnim + adds r5, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + ble _0807FBBE + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _0807FC14 + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _0807FC14 + bl sub_800E0E8 + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 +_0807FC14: + ldr r0, =sub_807F764 + bl SetVBlankCallback + b _0807FCA0 + .pool +_0807FC38: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + bl sub_8082D28 + b _0807FCA0 +_0807FC4E: + bl sub_807F9D0 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0807FCE2 + b _0807FCA0 + .pool +_0807FC64: + ldr r4, [r6] + ldr r0, =0x000011b8 + adds r4, r0 + ldr r5, =gUnknown_0833973A + bl sav2_get_text_speed + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_808417C + cmp r0, 0 + beq _0807FCE2 + ldr r1, [r6] + b _0807FCA4 + .pool +_0807FC90: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe +_0807FCA0: + ldr r0, =0x020322a4 + ldr r1, [r0] +_0807FCA4: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0807FCE2 + .pool +_0807FCB0: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0807FCE2 + bl FreeAllWindowBuffers + movs r0, 0x2 + bl UnsetBgTilemapBuffer + movs r0, 0x1 + bl UnsetBgTilemapBuffer + movs r0, 0 + bl SetVBlankCallback + ldr r0, =sub_807FFA4 + bl sub_81AABF0 + ldr r0, =0x020322a4 + ldr r0, [r0] + strb r4, [r0] +_0807FCE2: + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl RunTextPrinters + bl fade_and_return_progress_probably + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807FAC8 + + thumb_func_start sub_807FD08 +sub_807FD08: @ 807FD08 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x3A] + ldrh r1, [r4, 0x30] + adds r0, r1 + strh r0, [r4, 0x30] + ldrh r1, [r4, 0x32] + ldrh r2, [r4, 0x36] + subs r1, r2 + ldrh r0, [r4, 0x3C] + adds r1, r0 + strh r1, [r4, 0x32] + ldrh r3, [r4, 0x2E] + adds r0, r3 + strh r0, [r4, 0x2E] + subs r2, 0x1 + strh r2, [r4, 0x36] + lsls r0, 16 + lsls r1, 16 + cmp r0, r1 + bge _0807FD56 + ldrh r0, [r4, 0x34] + subs r0, 0x1 + strh r0, [r4, 0x36] + strh r0, [r4, 0x34] + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _0807FD50 + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + b _0807FD56 +_0807FD50: + movs r0, 0x74 + bl audio_play +_0807FD56: + ldrh r0, [r4, 0x30] + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x32] + strh r0, [r4, 0x22] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_807FD08 + + thumb_func_start sub_807FD64 +sub_807FD64: @ 807FD64 + push {r4-r6,lr} + ldr r5, [sp, 0x10] + ldr r6, [sp, 0x14] + lsls r2, 16 + lsrs r2, 16 + movs r4, 0 + strh r2, [r0, 0x2E] + strh r1, [r0, 0x30] + strh r2, [r0, 0x32] + strh r3, [r0, 0x34] + movs r1, 0xA + strh r1, [r0, 0x36] + strh r4, [r0, 0x38] + strh r5, [r0, 0x3A] + strh r6, [r0, 0x3C] + ldr r1, =sub_807FD08 + str r1, [r0, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807FD64 + + thumb_func_start sub_807FD90 +sub_807FD90: @ 807FD90 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x8 + adds r6, r1, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r0, 24 + movs r1, 0xF6 + lsls r1, 23 + adds r0, r1 + lsrs r0, 24 + movs r3, 0x1 + ands r3, r6 + movs r1, 0 + movs r2, 0x50 + bl sub_80D511C + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 4 + mov r8, r2 + add r8, r0 + mov r3, r8 + lsls r3, 2 + mov r8, r3 + ldr r0, =0x02020630 + add r8, r0 + ldr r5, =gUnknown_08339C78 + lsls r4, r6, 2 + adds r4, r6 + lsls r4, 1 + adds r0, r4, r5 + movs r6, 0 + ldrsh r1, [r0, r6] + adds r0, r5, 0x2 + adds r0, r4, r0 + movs r3, 0 + ldrsh r2, [r0, r3] + adds r0, r5, 0x4 + adds r0, r4, r0 + movs r6, 0 + ldrsh r3, [r0, r6] + adds r0, r5, 0x6 + adds r0, r4, r0 + movs r6, 0 + ldrsh r0, [r0, r6] + str r0, [sp] + adds r5, 0x8 + adds r4, r5 + movs r5, 0 + ldrsh r0, [r4, r5] + str r0, [sp, 0x4] + mov r0, r8 + bl sub_807FD64 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807FD90 + + thumb_func_start sub_807FE14 +sub_807FE14: @ 807FE14 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r5, r1, 16 + lsrs r5, 16 + adds r0, r5, 0 + adds r0, 0x7C + lsls r0, 24 + lsrs r0, 24 + bl GetBerryInfo + adds r4, r0, 0 + strh r5, [r6] + adds r0, r6, 0x2 + adds r1, r4, 0 + bl CopyString + ldrb r0, [r4, 0x15] + strb r0, [r6, 0x9] + ldrb r0, [r4, 0x16] + strb r0, [r6, 0xA] + ldrb r0, [r4, 0x17] + strb r0, [r6, 0xB] + ldrb r0, [r4, 0x18] + strb r0, [r6, 0xC] + ldrb r0, [r4, 0x19] + strb r0, [r6, 0xD] + ldrb r0, [r4, 0x1A] + strb r0, [r6, 0xE] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_807FE14 + + thumb_func_start sub_807FE54 +sub_807FE54: @ 807FE54 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + beq _0807FE7C + cmp r5, 0x1 + bgt _0807FE68 + cmp r5, 0 + beq _0807FE72 + b _0807FF88 +_0807FE68: + cmp r5, 0x2 + beq _0807FEE8 + cmp r5, 0x3 + beq _0807FF3C + b _0807FF88 +_0807FE72: + ldr r0, =0x03005d98 + strb r5, [r0] + b _0807FF88 + .pool +_0807FE7C: + ldr r0, =0x03005d98 + strb r5, [r0] + ldr r0, =0x020322a4 + ldr r0, [r0] + adds r0, 0x7C + movs r1, 0x2 + strb r1, [r0] + ldr r4, =0x020229f0 + ldr r0, =0x03005d90 + ldr r1, [r0] + adds r0, r4, 0 + bl CopyString + movs r0, 0xD0 + lsls r0, 2 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _0807FEC8 + adds r0, r4, 0 + adds r0, 0x1C + ldr r1, =gUnknown_083397D0 + ldr r1, [r1, 0xC] + bl CopyString + b _0807FED4 + .pool +_0807FEC8: + adds r0, r4, 0 + adds r0, 0x1C + ldr r1, =gUnknown_083397D0 + ldr r1, [r1] + bl CopyString +_0807FED4: + ldr r1, =0x020229e8 + movs r0, 0x2 + strh r0, [r1, 0x1A] + strh r0, [r1, 0x36] + b _0807FF88 + .pool +_0807FEE8: + ldr r0, =0x03005d98 + strb r5, [r0] + ldr r0, =0x020322a4 + ldr r0, [r0] + adds r0, 0x7C + movs r1, 0x3 + strb r1, [r0] + ldr r6, =0x020229f0 + ldr r0, =0x03005d90 + ldr r1, [r0] + adds r0, r6, 0 + bl CopyString + adds r0, r6, 0 + adds r0, 0x1C + ldr r4, =gUnknown_083397D0 + ldr r1, [r4, 0x10] + bl CopyString + adds r0, r6, 0 + adds r0, 0x38 + ldr r1, [r4, 0x8] + bl CopyString + adds r0, r6, 0 + subs r0, 0x8 + strh r5, [r0, 0x1A] + strh r5, [r0, 0x36] + adds r0, 0x52 + strh r5, [r0] + b _0807FF88 + .pool +_0807FF3C: + ldr r0, =0x03005d98 + strb r5, [r0] + ldr r0, =0x020322a4 + ldr r0, [r0] + adds r0, 0x7C + movs r1, 0x4 + strb r1, [r0] + ldr r5, =0x020229f0 + ldr r0, =0x03005d90 + ldr r1, [r0] + adds r0, r5, 0 + bl CopyString + adds r0, r5, 0 + adds r0, 0x1C + ldr r4, =gUnknown_083397D0 + ldr r1, [r4, 0x14] + bl CopyString + adds r0, r5, 0 + adds r0, 0x38 + ldr r1, [r4, 0x4] + bl CopyString + adds r0, r5, 0 + adds r0, 0x54 + ldr r1, [r4, 0x8] + bl CopyString + adds r0, r5, 0 + subs r0, 0x8 + movs r1, 0x2 + strh r1, [r0, 0x1A] + strh r1, [r0, 0x36] + adds r0, 0x52 + strh r1, [r0] + adds r0, 0x1C + strh r1, [r0] +_0807FF88: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807FE54 + + thumb_func_start sub_807FFA4 +sub_807FFA4: @ 807FFA4 + push {r4,r5,lr} + movs r0, 0 + movs r1, 0 + bl SetGpuReg + ldr r4, =0x020322a4 + ldr r0, [r4] + cmp r0, 0 + bne _0807FFC0 + movs r0, 0x8F + lsls r0, 5 + bl AllocZeroed + str r0, [r4] +_0807FFC0: + ldr r0, [r4] + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + movs r2, 0x86 + lsls r2, 1 + adds r0, r2 + str r1, [r0] + movs r2, 0 + ldr r5, =0x020375e0 + movs r3, 0 +_0807FFD6: + ldr r0, [r4] + lsls r1, r2, 1 + adds r0, 0x74 + adds r0, r1 + strh r3, [r0] + adds r2, 0x1 + cmp r2, 0x3 + ble _0807FFD6 + ldrb r0, [r5] + bl sub_807FE54 + ldrh r0, [r5] + cmp r0, 0 + bne _08080008 + ldr r0, =sub_8080018 + bl SetMainCallback2 + b _0808000E + .pool +_08080008: + ldr r0, =sub_80808D4 + bl SetMainCallback2 +_0808000E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807FFA4 + + thumb_func_start sub_8080018 +sub_8080018: @ 8080018 + push {r4-r7,lr} + sub sp, 0x4 + ldr r1, =0x020322a4 + ldr r0, [r1] + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0x15 + bls _0808002A + b _08080546 +_0808002A: + lsls r0, 2 + ldr r1, =_0808003C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0808003C: + .4byte _08080094 + .4byte _08080100 + .4byte _08080120 + .4byte _0808019C + .4byte _080801AE + .4byte _080801C8 + .4byte _08080546 + .4byte _08080546 + .4byte _080801F8 + .4byte _08080248 + .4byte _0808026C + .4byte _08080302 + .4byte _0808035C + .4byte _080803D4 + .4byte _08080408 + .4byte _0808049C + .4byte _080804D0 + .4byte _08080546 + .4byte _080804F8 + .4byte _080804E4 + .4byte _080804EA + .4byte _08080508 +_08080094: + bl sub_8080588 + ldr r1, =0x020229c6 + ldr r2, =0x00004422 + adds r0, r2, 0 + strh r0, [r1] + ldr r2, =0x020322a4 + ldr r0, [r2] + adds r0, 0x72 + movs r1, 0 + strb r1, [r0] + movs r5, 0 + movs r6, 0 + movs r7, 0x92 + lsls r7, 1 +_080800B2: + ldr r0, [r2] + lsls r1, r5, 1 + adds r0, 0x64 + adds r0, r1 + strh r6, [r0] + adds r4, r5, 0x1 + adds r1, r5 + lsls r1, 1 + movs r3, 0x2 +_080800C4: + ldr r0, [r2] + adds r0, r7 + adds r0, r1 + strh r6, [r0] + adds r1, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _080800C4 + adds r5, r4, 0 + cmp r5, 0x3 + ble _080800B2 + ldr r3, =0x020322a4 + ldr r4, [r3] + adds r1, r4, 0 + adds r1, 0x70 + movs r2, 0 + movs r0, 0 + strh r0, [r1] + subs r1, 0x22 + strh r0, [r1] + strb r2, [r4, 0x1] + ldr r1, [r3] + b _080804FC + .pool +_08080100: + bl sub_807F7D8 + lsls r0, 24 + cmp r0, 0 + bne _0808010C + b _08080546 +_0808010C: + ldr r0, =0x020322a4 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + bl sub_8082D28 + b _08080546 + .pool +_08080120: + movs r5, 0 + ldr r4, =gUnknown_083399C8 + ldr r6, =0x020322a4 +_08080126: + ldrb r1, [r4] + ldrb r2, [r4, 0x1] + ldr r0, =gUnknown_08339AD8 + movs r3, 0x1 + bl AddObjectToFront + ldr r1, [r6] + adds r1, 0x54 + adds r1, r5 + strb r0, [r1] + ldr r0, [r6] + adds r0, 0x54 + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + adds r1, r5, 0 + adds r1, 0x8 + lsls r1, 24 + lsrs r1, 24 + bl StartObjectImageAnim + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _08080126 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _0808016A + b _080804F8 +_0808016A: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _08080174 + b _080804F8 +_08080174: + bl sub_800E0E8 + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + b _080804F8 + .pool +_0808019C: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + b _080804F8 +_080801AE: + bl sub_807F9D0 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080801C0 + b _08080546 +_080801C0: + b _080804F8 + .pool +_080801C8: + ldr r4, =0x020322a4 + ldr r0, [r4] + ldr r3, =0x000011b8 + adds r0, r3 + ldr r1, =gUnknown_0833981A + movs r2, 0 + bl sub_808417C + ldr r1, [r4] + movs r2, 0 + movs r0, 0x8 + strb r0, [r1] + ldr r0, [r4] + movs r1, 0x84 + lsls r1, 1 + adds r0, r1 + str r2, [r0] + b _08080546 + .pool +_080801F8: + ldr r4, =0x020322a4 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + movs r6, 0 + strb r0, [r1] + ldr r0, [r4] + movs r2, 0x8A + lsls r2, 1 + adds r0, r2 + strb r6, [r0] + ldr r0, [r4] + movs r5, 0xAC + lsls r5, 1 + adds r0, r5 + ldr r1, =0x0203ce7c + ldrh r1, [r1] + bl sub_807FE14 + ldr r0, =0x020228c4 + ldr r1, [r4] + adds r1, r5 + movs r2, 0x10 + bl memcpy + bl sub_800ADF8 + ldr r0, [r4] + movs r3, 0x84 + lsls r3, 1 + adds r0, r3 + str r6, [r0] + b _08080546 + .pool +_08080248: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _08080254 + b _08080546 +_08080254: + bl sub_800A5B4 + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + beq _08080264 + b _080804F8 +_08080264: + movs r0, 0x4 + bl sub_800A4D8 + b _080804F8 +_0808026C: + ldr r6, =0x020322a4 + ldr r1, [r6] + movs r0, 0x84 + lsls r0, 1 + adds r1, r0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + cmp r0, 0x14 + bgt _08080282 + b _08080546 +_08080282: + movs r0, 0x4 + movs r1, 0x1 + bl sub_8197DF8 + bl sub_800A550 + adds r4, r0, 0 + bl sub_800A9D8 + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _0808029E + b _08080546 +_0808029E: + movs r5, 0 + adds r7, r6, 0 + movs r6, 0xAC + lsls r6, 1 + b _080802D4 + .pool +_080802AC: + ldr r0, [r7] + lsls r4, r5, 4 + adds r0, r4, r0 + adds r0, r6 + lsls r1, r5, 8 + ldr r2, =0x020223c4 + adds r1, r2 + movs r2, 0x10 + bl memcpy + ldr r0, [r7] + lsls r2, r5, 1 + adds r1, r0, 0 + adds r1, 0x74 + adds r1, r2 + adds r0, r4 + adds r0, r6 + ldrh r0, [r0] + strh r0, [r1] + adds r5, 0x1 +_080802D4: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + blt _080802AC + bl sub_800A5B4 + b _080804F8 + .pool +_080802EC: + ldrb r1, [r4] + lsls r1, 1 + adds r0, r2, 0 + adds r0, 0x74 + adds r0, r1 + ldrh r0, [r0] + lsls r1, r5, 24 + lsrs r1, 24 + bl sub_807FD90 + b _08080336 +_08080302: + bl sub_8009FCC + ldr r2, =0x020322a4 + ldr r1, [r2] + adds r1, 0x7C + strb r0, [r1] + movs r5, 0 + ldr r2, [r2] + movs r1, 0x8A + lsls r1, 1 + adds r4, r2, r1 + ldr r1, =gUnknown_083399D0 + adds r0, r2, 0 + adds r0, 0x7C + ldrb r0, [r0] + subs r0, 0x2 + lsls r0, 2 + ldrb r3, [r4] + adds r0, r1 +_08080328: + ldrb r1, [r0] + cmp r3, r1 + beq _080802EC + adds r0, 0x1 + adds r5, 0x1 + cmp r5, 0x3 + ble _08080328 +_08080336: + ldr r3, =0x020322a4 + ldr r1, [r3] + movs r0, 0x84 + lsls r0, 1 + adds r2, r1, r0 + movs r0, 0 + str r0, [r2] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r1, [r3] + movs r2, 0x8A + lsls r2, 1 + adds r1, r2 + b _080804FC + .pool +_0808035C: + ldr r3, [r2] + movs r0, 0x84 + lsls r0, 1 + adds r1, r3, r0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + cmp r0, 0x3C + bgt _08080370 + b _08080546 +_08080370: + movs r1, 0x8A + lsls r1, 1 + adds r0, r3, r1 + adds r1, r3, 0 + adds r1, 0x7C + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bcc _080803B8 + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + ldr r2, [r2] + ldr r3, =gUnknown_083399DC + ldr r1, =gUnknown_083399E4 + adds r0, r2, 0 + adds r0, 0x7C + ldrb r0, [r0] + subs r0, 0x2 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r3 + ldr r3, =0xffffa800 + adds r1, r3, 0 + ldrh r0, [r0] + adds r1, r0 + adds r2, 0x4A + strh r1, [r2] + b _080803BE + .pool +_080803B8: + ldrb r0, [r3] + subs r0, 0x1 + strb r0, [r3] +_080803BE: + ldr r0, =0x020322a4 + ldr r0, [r0] + movs r1, 0x84 + lsls r1, 1 + adds r0, r1 + movs r1, 0 + str r1, [r0] + b _08080546 + .pool +_080803D4: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _080803E0 + b _08080546 +_080803E0: + ldr r2, =0x020322a4 + ldr r1, [r2] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r2] + movs r2, 0xA0 + lsls r2, 1 + adds r0, r2 + bl sub_8082CB4 + movs r0, 0x2B + bl audio_play + movs r0, 0x2 + bl ShowBg + b _08080546 + .pool +_08080408: + movs r1, 0x80 + lsls r1, 3 + movs r0, 0 + bl SetGpuRegBits + ldr r4, =0x020322a4 + ldr r2, [r4] + adds r1, r2, 0 + adds r1, 0x4A + movs r3, 0x80 + lsls r3, 2 + adds r0, r3, 0 + ldrh r3, [r1] + adds r0, r3 + strh r0, [r1] + movs r0, 0x8D + lsls r0, 1 + adds r1, r2, r0 + ldrh r0, [r1] + adds r0, 0x4 + strh r0, [r1] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xFF + bls _0808048C + movs r0, 0xC + movs r1, 0x2 + bl SetGpuRegBits + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r3, [r4] + movs r2, 0x8D + lsls r2, 1 + adds r1, r3, r2 + movs r0, 0x80 + lsls r0, 1 + strh r0, [r1] + ldr r2, =gUnknown_083399DC + ldr r1, =gUnknown_083399E4 + adds r0, r3, 0 + adds r0, 0x7C + ldrb r0, [r0] + subs r0, 0x2 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + adds r1, r3, 0 + adds r1, 0x4A + strh r0, [r1] + movs r0, 0x84 + lsls r0, 1 + adds r1, r3, r0 + movs r0, 0 + str r0, [r1] + movs r0, 0x34 + bl audio_play + bl sub_808074C + bl sub_80807BC +_0808048C: + ldr r0, [r4] + b _080804BE + .pool +_0808049C: + bl sub_8083380 + lsls r0, 24 + cmp r0, 0 + beq _080804BA + ldr r0, =0x020322a4 + ldr r1, [r0] + movs r3, 0x84 + lsls r3, 1 + adds r2, r1, r3 + movs r0, 0 + str r0, [r2] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080804BA: + ldr r0, =0x020322a4 + ldr r0, [r0] +_080804BE: + movs r1, 0xA0 + lsls r1, 1 + adds r0, r1 + bl sub_8082CB4 + b _08080546 + .pool +_080804D0: + ldr r0, =gUnknown_08339C2C + movs r2, 0x10 + negs r2, r2 + movs r1, 0x78 + movs r3, 0x3 + bl AddObjectToFront + b _080804F8 + .pool +_080804E4: + bl sub_800ADF8 + b _080804F8 +_080804EA: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08080546 + bl sub_800A418 +_080804F8: + ldr r0, =0x020322a4 + ldr r1, [r0] +_080804FC: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08080546 + .pool +_08080508: + ldr r5, =0x020322a4 + ldr r3, [r5] + adds r1, r3, 0 + adds r1, 0x4C + movs r2, 0 + movs r0, 0x80 + strh r0, [r1] + movs r1, 0x82 + lsls r1, 1 + adds r0, r3, r1 + str r2, [r0] + ldr r0, =sub_8081898 + bl SetMainCallback2 + bl current_map_music_get + lsls r0, 16 + lsrs r0, 16 + ldr r4, =0x00000193 + cmp r0, r4 + beq _08080540 + bl current_map_music_get + ldr r1, [r5] + movs r2, 0xAA + lsls r2, 1 + adds r1, r2 + strh r0, [r1] +_08080540: + adds r0, r4, 0 + bl song_play_for_text +_08080546: + ldr r0, =0x020322a4 + ldr r1, [r0] + movs r3, 0x8E + lsls r3, 1 + adds r0, r1, r3 + movs r2, 0 + ldrsh r0, [r0, r2] + adds r3, 0x2 + adds r1, r3 + movs r2, 0 + ldrsh r1, [r1, r2] + bl nullsub_31 + bl RunActiveTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl RunTextPrinters + bl fade_and_return_progress_probably + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8080018 + + thumb_func_start sub_8080588 +sub_8080588: @ 8080588 + push {r4,lr} + movs r0, 0 + movs r1, 0 + bl SetGpuReg + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + bl clear_tasks + ldr r0, =sub_807F764 + bl SetVBlankCallback + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_08339974 + movs r0, 0x1 + movs r2, 0x3 + bl InitBgsFromTemplates + ldr r4, =0x020322a4 + ldr r1, [r4] + movs r0, 0xDC + lsls r0, 1 + adds r1, r0 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r3, =0x000009b8 + adds r1, r3 + movs r0, 0x2 + bl SetBgTilemapBuffer + movs r0, 0 + movs r1, 0x1 + movs r2, 0xD0 + bl sub_809882C + movs r0, 0 + movs r1, 0x14 + movs r2, 0xF0 + bl copy_textbox_border_tile_patterns_to_vram + bl sub_807FA34 + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x44 + movs r1, 0 + strh r1, [r0] + adds r0, 0x8 + strh r1, [r0] + subs r0, 0x2 + strh r1, [r0] + adds r0, 0x4 + strh r1, [r0] + movs r3, 0x8E + lsls r3, 1 + adds r0, r2, r3 + strh r1, [r0] + adds r3, 0x2 + adds r0, r2, r3 + strh r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8080588 + + thumb_func_start task_tutorial_oak_boy_girl +task_tutorial_oak_boy_girl: @ 8080624 + push {lr} + lsls r0, 16 + lsls r1, 24 + lsrs r0, 24 + adds r2, r0, 0 + adds r2, 0x18 + ldr r0, =0x020322a4 + ldr r0, [r0] + lsrs r1, 23 + adds r0, 0x96 + adds r0, r1 + ldrb r0, [r0] + ldr r1, =gUnknown_083399E7 + adds r0, r1 + ldrb r1, [r0] + cmp r2, r1 + bcc _0808066C + adds r0, r1, 0 + adds r0, 0x30 + cmp r2, r0 + bcs _0808066C + subs r0, 0x1C + cmp r2, r0 + bcc _08080668 + adds r0, 0x8 + cmp r2, r0 + bcs _08080668 + movs r0, 0x2 + b _0808066E + .pool +_08080668: + movs r0, 0x1 + b _0808066E +_0808066C: + movs r0, 0 +_0808066E: + pop {r1} + bx r1 + thumb_func_end task_tutorial_oak_boy_girl + + thumb_func_start sub_8080674 +sub_8080674: @ 8080674 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 24 + lsrs r1, 24 + movs r6, 0 + cmp r5, 0xAF + bne _080806AC + movs r4, 0 + subs r7, r1, 0x1 + adds r2, 0x9 +_08080690: + adds r0, r2, r6 + adds r1, r2, r4 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bls _0808069E + adds r6, r4, 0 +_0808069E: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x4 + bls _08080690 + adds r0, r6, 0x5 + b _080806C4 +_080806AC: + adds r0, r5, 0 + subs r0, 0x85 + lsls r0, 16 + lsrs r6, r0, 16 + subs r7, r1, 0x1 + cmp r6, 0x4 + bls _080806C8 + adds r0, r6, 0 + movs r1, 0x5 + bl __umodsi3 + adds r0, 0x5 +_080806C4: + lsls r0, 16 + lsrs r6, r0, 16 +_080806C8: + movs r4, 0 + cmp r4, r7 + bge _08080734 + ldr r0, =gUnknown_08339CA0 + mov r9, r0 + adds r0, r5, 0 + subs r0, 0xA3 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 +_080806DC: + lsls r0, r6, 1 + adds r0, r6 + adds r0, r4, r0 + add r0, r9 + ldrb r5, [r0] + movs r0, 0xD0 + lsls r0, 2 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _0808071A + ldr r0, =0x020375e0 + ldrh r0, [r0] + cmp r0, 0x1 + bne _0808071A + adds r0, r6, 0 + movs r1, 0x5 + bl __umodsi3 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =gUnknown_08339CBE + adds r0, r6, r0 + ldrb r5, [r0] + mov r0, r8 + cmp r0, 0x4 + bhi _0808071A + subs r0, r5, 0x5 + lsls r0, 16 + lsrs r5, r0, 16 +_0808071A: + adds r4, 0x1 + lsls r0, r4, 24 + lsrs r0, 24 + adds r1, r5, 0 + adds r1, 0x85 + lsls r1, 16 + lsrs r1, 16 + bl sub_8082FDC + lsls r4, 16 + lsrs r4, 16 + cmp r4, r7 + blt _080806DC +_08080734: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8080674 + + thumb_func_start sub_808074C +sub_808074C: @ 808074C + push {r4-r7,lr} + movs r4, 0 + ldr r7, =0x020322a4 + movs r6, 0xFF + ldr r5, =gUnknown_083399D0 +_08080756: + ldr r3, [r7] + lsls r2, r4, 1 + adds r0, r3, 0 + adds r0, 0x96 + adds r0, r2 + strh r6, [r0] + adds r1, r3, 0 + adds r1, 0x8E + adds r1, r2 + adds r0, r3, 0 + adds r0, 0x7C + ldrb r0, [r0] + subs r0, 0x2 + lsls r0, 2 + adds r0, r4, r0 + adds r0, r5 + ldrb r0, [r0] + strh r0, [r1] + adds r4, 0x1 + cmp r4, 0x3 + ble _08080756 + movs r3, 0 + ldr r7, =0x020322a4 +_08080784: + movs r4, 0 + adds r6, r3, 0x1 + lsls r5, r3, 1 +_0808078A: + ldr r2, [r7] + lsls r0, r4, 1 + adds r1, r2, 0 + adds r1, 0x8E + adds r1, r0 + ldrh r0, [r1] + cmp r0, r3 + bne _080807A2 + adds r0, r2, 0 + adds r0, 0x96 + adds r0, r5 + strh r4, [r0] +_080807A2: + adds r4, 0x1 + cmp r4, 0x3 + ble _0808078A + adds r3, r6, 0 + cmp r3, 0x3 + ble _08080784 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808074C + + thumb_func_start sub_80807BC +sub_80807BC: @ 80807BC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + movs r0, 0 + mov r10, r0 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _080807DE + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 +_080807DE: + movs r6, 0 + ldr r7, =0x020322a4 + mov r8, r6 +_080807E4: + ldr r2, [r7] + lsls r5, r6, 1 + adds r0, r2, 0 + adds r0, 0x8E + adds r3, r0, r5 + ldrh r0, [r3] + cmp r0, 0xFF + beq _080808B6 + adds r1, r2, 0 + adds r1, 0x50 + ldrh r3, [r3] + adds r1, r3 + adds r0, r2, 0 + adds r0, 0x54 + adds r0, r6 + ldrb r0, [r0] + movs r2, 0 + mov r9, r2 + strb r0, [r1] + ldr r0, [r7] + adds r1, r0, 0 + adds r1, 0x8E + adds r1, r5 + adds r0, 0x50 + ldrh r1, [r1] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + mov r1, r8 + lsrs r4, r1, 24 + adds r1, r4, 0 + bl StartObjectImageAnim + add r1, sp, 0x8 + movs r0, 0xFF + strb r0, [r1] + ldr r0, [r7] + adds r0, 0x8E + adds r0, r5 + ldrh r0, [r0] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r0, =0x020229f0 + adds r1, r0 + add r0, sp, 0x8 + bl CopyString + movs r0, 0x1 + add r1, sp, 0x8 + movs r2, 0x38 + bl GetStringCenterAlignXOffset + adds r2, r0, 0 + ldr r0, [r7] + adds r0, 0x8E + adds r0, r5 + mov r5, r8 + ldrh r0, [r0] + cmp r10, r0 + bne _08080890 + lsls r2, 24 + lsrs r2, 24 + mov r0, r9 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + adds r0, r4, 0 + add r1, sp, 0x8 + movs r3, 0x1 + bl sub_80840D4 + b _080808A6 + .pool +_08080890: + lsls r2, 24 + lsrs r2, 24 + mov r1, r9 + str r1, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + adds r0, r4, 0 + add r1, sp, 0x8 + movs r3, 0x1 + bl sub_80840D4 +_080808A6: + lsrs r4, r5, 24 + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram +_080808B6: + movs r2, 0x80 + lsls r2, 17 + add r8, r2 + adds r6, 0x1 + cmp r6, 0x3 + ble _080807E4 + 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_80807BC + + thumb_func_start sub_80808D4 +sub_80808D4: @ 80808D4 + push {r4-r7,lr} + sub sp, 0x4 + ldr r1, =0x020322a4 + ldr r0, [r1] + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0x15 + bls _080808E6 + b _08080DAE +_080808E6: + lsls r0, 2 + ldr r1, =_080808F8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080808F8: + .4byte _08080950 + .4byte _080809E4 + .4byte _08080A04 + .4byte _08080A58 + .4byte _08080A84 + .4byte _08080DAE + .4byte _08080DAE + .4byte _08080DAE + .4byte _08080ABC + .4byte _08080DAE + .4byte _08080DAE + .4byte _08080AEC + .4byte _08080B3C + .4byte _08080BB0 + .4byte _08080BDC + .4byte _08080C78 + .4byte _08080CA0 + .4byte _08080DAE + .4byte _08080CAE + .4byte _08080CAE + .4byte _08080CAE + .4byte _08080CC4 +_08080950: + bl sub_800B4C0 + bl sub_8080588 + ldr r4, =0x0203ce7c + ldrh r1, [r4] + movs r0, 0 + bl sub_8082FDC + ldr r5, =0x020322a4 + ldr r0, [r5] + movs r6, 0xAC + lsls r6, 1 + adds r0, r6 + ldrh r1, [r4] + bl sub_807FE14 + ldrh r0, [r4] + ldr r2, [r5] + adds r1, r2, 0 + adds r1, 0x7C + ldrb r1, [r1] + adds r2, r6 + bl sub_8080674 + movs r4, 0 + movs r6, 0 + ldr r0, =0x020229c6 + mov r12, r0 + movs r7, 0x92 + lsls r7, 1 +_0808098E: + ldr r0, [r5] + lsls r1, r4, 1 + adds r0, 0x64 + adds r0, r1 + strh r6, [r0] + adds r3, r4, 0x1 + adds r1, r4 + lsls r1, 1 + movs r2, 0x2 +_080809A0: + ldr r0, [r5] + adds r0, r7 + adds r0, r1 + strh r6, [r0] + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _080809A0 + adds r4, r3, 0 + cmp r4, 0x3 + ble _0808098E + ldr r4, =0x020322a4 + ldr r3, [r4] + adds r1, r3, 0 + adds r1, 0x70 + movs r2, 0 + movs r0, 0 + strh r0, [r1] + strb r2, [r3, 0x1] + ldr r1, =0x00004422 + adds r0, r1, 0 + mov r2, r12 + strh r0, [r2] + ldr r1, [r4] + b _08080CB2 + .pool +_080809E4: + bl sub_807F7D8 + lsls r0, 24 + cmp r0, 0 + bne _080809F0 + b _08080DAE +_080809F0: + ldr r0, =0x020322a4 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + bl sub_8082D28 + b _08080DAE + .pool +_08080A04: + movs r4, 0 + ldr r5, =gUnknown_083399C8 + ldr r6, =0x020322a4 +_08080A0A: + ldrb r1, [r5] + ldrb r2, [r5, 0x1] + ldr r0, =gUnknown_08339AD8 + movs r3, 0x1 + bl AddObjectToFront + ldr r1, [r6] + adds r1, 0x54 + adds r1, r4 + strb r0, [r1] + ldr r0, [r6] + adds r0, 0x54 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + adds r1, r4, 0 + adds r1, 0x8 + lsls r1, 24 + lsrs r1, 24 + bl StartObjectImageAnim + adds r5, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + ble _08080A0A + b _08080CAE + .pool +_08080A58: + movs r0, 0x1 + negs r0, r0 + movs r4, 0 + str r4, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r2, =0x020322a4 + ldr r1, [r2] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r2] + movs r3, 0x84 + lsls r3, 1 + adds r0, r3 + str r4, [r0] + b _08080DAE + .pool +_08080A84: + ldr r4, =0x020322a4 + ldr r1, [r4] + movs r5, 0x84 + lsls r5, 1 + adds r1, r5 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + cmp r0, 0x2 + bne _08080A9C + bl sub_807F9D0 +_08080A9C: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08080AAA + b _08080DAE +_08080AAA: + ldr r1, [r4] + movs r0, 0x8 + strb r0, [r1] + b _08080DAE + .pool +_08080ABC: + ldr r2, =0x020322a4 + ldr r1, [r2] + movs r3, 0 + movs r0, 0xB + strb r0, [r1] + ldr r0, [r2] + movs r1, 0x8A + lsls r1, 1 + adds r0, r1 + strb r3, [r0] + b _08080DAE + .pool +_08080AD8: + lsls r1, 1 + adds r0, r3, 0 + adds r0, 0x74 + adds r0, r1 + ldrh r0, [r0] + lsls r1, r4, 24 + lsrs r1, 24 + bl sub_807FD90 + b _08080B16 +_08080AEC: + movs r4, 0 + ldr r2, =gUnknown_083399D0 + ldr r0, =0x020322a4 + ldr r3, [r0] + adds r0, r3, 0 + adds r0, 0x7C + ldrb r0, [r0] + subs r0, 0x2 + lsls r0, 2 + movs r5, 0x8A + lsls r5, 1 + adds r1, r3, r5 + ldrb r1, [r1] + adds r0, r2 +_08080B08: + ldrb r2, [r0] + cmp r1, r2 + beq _08080AD8 + adds r0, 0x1 + adds r4, 0x1 + cmp r4, 0x3 + ble _08080B08 +_08080B16: + ldr r3, =0x020322a4 + ldr r1, [r3] + movs r5, 0x84 + lsls r5, 1 + adds r2, r1, r5 + movs r0, 0 + str r0, [r2] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r1, [r3] + movs r0, 0x8A + lsls r0, 1 + adds r1, r0 + b _08080CB2 + .pool +_08080B3C: + ldr r3, [r2] + movs r2, 0x84 + lsls r2, 1 + adds r1, r3, r2 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + cmp r0, 0x3C + bgt _08080B50 + b _08080DAE +_08080B50: + movs r5, 0x8A + lsls r5, 1 + adds r0, r3, r5 + adds r4, r3, 0 + adds r4, 0x7C + ldrb r0, [r0] + ldrb r1, [r4] + cmp r0, r1 + bcc _08080B94 + ldr r2, =gUnknown_083399DC + ldr r1, =gUnknown_083399E4 + ldrb r0, [r4] + subs r0, 0x2 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r2 + ldr r2, =0xffffa800 + adds r1, r2, 0 + ldrh r0, [r0] + adds r1, r0 + adds r0, r3, 0 + adds r0, 0x4A + strh r1, [r0] + ldrb r0, [r3] + adds r0, 0x1 + b _08080B98 + .pool +_08080B94: + ldrb r0, [r3] + subs r0, 0x1 +_08080B98: + strb r0, [r3] + ldr r0, =0x020322a4 + ldr r0, [r0] + movs r3, 0x84 + lsls r3, 1 + adds r0, r3 + movs r1, 0 + str r1, [r0] + b _08080DAE + .pool +_08080BB0: + ldr r4, =0x020322a4 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + bl sub_808074C + movs r0, 0x2B + bl audio_play + ldr r0, [r4] + movs r5, 0xA0 + lsls r5, 1 + adds r0, r5 + bl sub_8082CB4 + movs r0, 0x2 + bl ShowBg + b _08080DAE + .pool +_08080BDC: + movs r1, 0x80 + lsls r1, 3 + movs r0, 0 + bl SetGpuRegBits + ldr r4, =0x020322a4 + ldr r2, [r4] + adds r1, r2, 0 + adds r1, 0x4A + movs r3, 0x80 + lsls r3, 2 + adds r0, r3, 0 + ldrh r5, [r1] + adds r0, r5 + strh r0, [r1] + movs r0, 0x8D + lsls r0, 1 + adds r1, r2, r0 + ldrh r0, [r1] + adds r0, 0x4 + strh r0, [r1] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xFF + bls _08080C5C + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + ldr r3, [r4] + movs r2, 0x8D + lsls r2, 1 + adds r1, r3, r2 + movs r0, 0x80 + lsls r0, 1 + strh r0, [r1] + ldr r2, =gUnknown_083399DC + ldr r1, =gUnknown_083399E4 + adds r0, r3, 0 + adds r0, 0x7C + ldrb r0, [r0] + subs r0, 0x2 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r2 + ldrh r1, [r0] + adds r0, r3, 0 + adds r0, 0x4A + strh r1, [r0] + movs r0, 0xC + movs r1, 0x2 + bl SetGpuRegBits + ldr r0, [r4] + movs r3, 0x84 + lsls r3, 1 + adds r0, r3 + movs r1, 0 + str r1, [r0] + movs r0, 0x34 + bl audio_play + bl sub_80807BC +_08080C5C: + ldr r0, [r4] + movs r5, 0xA0 + lsls r5, 1 + adds r0, r5 + bl sub_8082CB4 + b _08080DAE + .pool +_08080C78: + bl sub_8083380 + lsls r0, 24 + cmp r0, 0 + beq _08080C8C + ldr r0, =0x020322a4 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_08080C8C: + ldr r0, =0x020322a4 + ldr r0, [r0] + movs r1, 0xA0 + lsls r1, 1 + adds r0, r1 + bl sub_8082CB4 + b _08080DAE + .pool +_08080CA0: + ldr r0, =gUnknown_08339C2C + movs r2, 0x10 + negs r2, r2 + movs r1, 0x78 + movs r3, 0x3 + bl AddObjectToFront +_08080CAE: + ldr r0, =0x020322a4 + ldr r1, [r0] +_08080CB2: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08080DAE + .pool +_08080CC4: + bl sub_8080DF8 + ldr r5, =0x020322a4 + ldr r4, [r5] + adds r1, r4, 0 + adds r1, 0x4C + movs r3, 0 + movs r2, 0 + movs r0, 0x80 + strh r0, [r1] + movs r1, 0x82 + lsls r1, 1 + adds r0, r4, r1 + str r2, [r0] + ldr r2, =0x00000123 + adds r0, r4, r2 + strb r3, [r0] + ldr r0, [r5] + adds r0, 0x72 + strb r3, [r0] + ldr r0, =sub_8081898 + bl SetMainCallback2 + ldr r0, =0x020375e0 + ldrh r0, [r0] + cmp r0, 0x1 + bne _08080D44 + movs r0, 0xD0 + lsls r0, 2 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _08080D30 + ldr r0, =sub_8081224 + movs r1, 0xA + bl AddTask + ldr r1, [r5] + movs r3, 0x90 + lsls r3, 1 + adds r1, r3 + b _08080D42 + .pool +_08080D30: + ldr r0, =gUnknown_083399EC + ldr r0, [r0] + movs r1, 0xA + bl AddTask + ldr r1, [r5] + movs r5, 0x90 + lsls r5, 1 + adds r1, r5 +_08080D42: + strb r0, [r1] +_08080D44: + ldr r1, =0x020375e0 + ldrh r0, [r1] + cmp r0, 0x1 + bls _08080D80 + movs r4, 0 + ldrh r1, [r1] + cmp r4, r1 + bge _08080D80 + movs r5, 0xA0 + lsls r5, 20 + ldr r6, =gUnknown_083399EC +_08080D5A: + ldm r6!, {r0} + lsrs r1, r5, 24 + bl AddTask + ldr r1, =0x020322a4 + ldr r1, [r1] + movs r2, 0x90 + lsls r2, 1 + adds r1, r2 + adds r1, r4 + strb r0, [r1] + movs r3, 0x80 + lsls r3, 17 + adds r5, r3 + adds r4, 0x1 + ldr r0, =0x020375e0 + ldrh r0, [r0] + cmp r4, r0 + blt _08080D5A +_08080D80: + bl current_map_music_get + lsls r0, 16 + lsrs r0, 16 + ldr r4, =0x00000193 + cmp r0, r4 + beq _08080D9E + bl current_map_music_get + ldr r1, =0x020322a4 + ldr r1, [r1] + movs r5, 0xAA + lsls r5, 1 + adds r1, r5 + strh r0, [r1] +_08080D9E: + adds r0, r4, 0 + bl song_play_for_text + movs r0, 0x35 + bl audio_play + bl sub_807F738 +_08080DAE: + ldr r0, =0x020322a4 + ldr r1, [r0] + movs r2, 0x8E + lsls r2, 1 + adds r0, r1, r2 + movs r3, 0 + ldrsh r0, [r0, r3] + movs r5, 0x8F + lsls r5, 1 + adds r1, r5 + movs r2, 0 + ldrsh r1, [r1, r2] + bl nullsub_31 + bl RunActiveTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl RunTextPrinters + bl fade_and_return_progress_probably + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80808D4 + + thumb_func_start sub_8080DF8 +sub_8080DF8: @ 8080DF8 + push {lr} + ldr r3, =0x03003110 + movs r0, 0 + ldr r1, =0x03003090 + movs r2, 0x3 +_08080E02: + strh r0, [r3] + strh r0, [r3, 0x4] + strh r0, [r1] + strh r0, [r1, 0x4] + adds r1, 0x10 + subs r2, 0x1 + cmp r2, 0 + bge _08080E02 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8080DF8 + + thumb_func_start sub_8080E20 +sub_8080E20: @ 8080E20 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r2, r0, r1 + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + lsls r0, 16 + asrs r0, 16 + movs r4, 0xA + ldrsh r1, [r2, r4] + cmp r0, r1 + ble _08080E58 + ldr r0, =0x03003090 + movs r4, 0xC + ldrsh r1, [r2, r4] + lsls r1, 4 + adds r0, 0x4 + adds r1, r0 + ldr r0, =0x00002345 + strh r0, [r1] + adds r0, r3, 0 + bl remove_task +_08080E58: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8080E20 + + thumb_func_start sub_8080E6C +sub_8080E6C: @ 8080E6C + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =sub_8080E20 + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0xA] + strh r5, [r1, 0xC] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8080E6C + + thumb_func_start sub_8080EA4 +sub_8080EA4: @ 8080EA4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =0x020322a4 + ldr r0, [r4] + adds r0, 0x4A + ldrh r0, [r0] + movs r1, 0x1 + bl task_tutorial_oak_boy_girl + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _08080EC2 + b _08080FB8 +_08080EC2: + ldr r2, =0x03005e00 + lsls r1, r5, 2 + adds r0, r1, r5 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r6, r1, 0 + cmp r0, 0 + beq _08080ED8 + b _08080FC6 +_08080ED8: + ldr r0, [r4] + ldr r1, =0x00000123 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08080F9A + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x0000028f + bl __udivsi3 + lsls r0, 24 + lsrs r1, r0, 24 + adds r3, r1, 0 + ldr r0, [r4] + adds r0, 0x4C + movs r4, 0 + ldrsh r2, [r0, r4] + ldr r0, =0x000001f3 + cmp r2, r0 + bgt _08080F40 + cmp r1, 0x4B + bls _08080F2C + ldr r1, =0x03003090 + ldr r0, =0x00004523 + b _08080F30 + .pool +_08080F2C: + ldr r1, =0x03003090 + ldr r0, =0x00005432 +_08080F30: + strh r0, [r1, 0x14] + ldr r0, =0x00005432 + b _08080F9E + .pool +_08080F40: + ldr r0, =0x000005db + cmp r2, r0 + bgt _08080F6E + cmp r1, 0x50 + bhi _08080F9A + adds r0, r1, 0 + subs r0, 0x15 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3B + bhi _08080F68 + ldr r1, =0x03003090 + ldr r0, =0x00005432 + b _08080F9E + .pool +_08080F68: + cmp r1, 0x9 + bhi _08080FA0 + b _08080F90 +_08080F6E: + cmp r1, 0x5A + bhi _08080F9A + adds r0, r1, 0 + subs r0, 0x47 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x13 + bhi _08080F8C + ldr r1, =0x03003090 + ldr r0, =0x00005432 + b _08080F9E + .pool +_08080F8C: + cmp r3, 0x1D + bhi _08080FA0 +_08080F90: + movs r0, 0x1 + movs r1, 0x5 + bl sub_8080E6C + b _08080FA0 +_08080F9A: + ldr r1, =0x03003090 + ldr r0, =0x00004523 +_08080F9E: + strh r0, [r1, 0x14] +_08080FA0: + ldr r0, =0x03005e00 + adds r1, r6, r5 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + b _08080FC4 + .pool +_08080FB8: + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + movs r0, 0 +_08080FC4: + strh r0, [r1, 0x8] +_08080FC6: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8080EA4 + + thumb_func_start sub_8080FD0 +sub_8080FD0: @ 8080FD0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r6, =0x020322a4 + ldr r3, [r6] + adds r0, r3, 0 + adds r0, 0x4A + ldrh r0, [r0] + movs r1, 0xC0 + lsls r1, 5 + adds r0, r1 + ldr r1, =0x0000ffff + ands r0, r1 + adds r1, r3, 0 + adds r1, 0x9A + ldrb r1, [r1] + lsrs r2, r0, 8 + ldr r0, =gUnknown_083399E7 + adds r1, r0 + ldrb r1, [r1] + adds r0, r1, 0 + adds r0, 0x14 + cmp r2, r0 + bls _080810E0 + adds r0, 0x14 + cmp r2, r0 + bcs _080810E0 + ldr r2, =0x03005e00 + lsls r1, r4, 2 + adds r0, r1, r4 + lsls r0, 3 + adds r2, r0, r2 + movs r5, 0x8 + ldrsh r0, [r2, r5] + adds r5, r1, 0 + cmp r0, 0 + bne _080810EE + ldr r1, =0x00000123 + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080810CC + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x0000028f + bl __udivsi3 + lsls r0, 24 + lsrs r2, r0, 24 + adds r3, r2, 0 + ldr r0, [r6] + adds r0, 0x4C + movs r6, 0 + ldrsh r1, [r0, r6] + ldr r0, =0x000001f3 + cmp r1, r0 + bgt _08081088 + cmp r2, 0x42 + bls _08081078 + ldr r1, =0x03003090 + ldr r0, =0x00004523 + strh r0, [r1, 0x24] + b _080810B0 + .pool +_08081078: + ldr r1, =0x03003090 + ldr r0, =0x00005432 + strh r0, [r1, 0x24] + b _080810B0 + .pool +_08081088: + cmp r2, 0x41 + bls _08081092 + ldr r1, =0x03003090 + ldr r0, =0x00004523 + strh r0, [r1, 0x24] +_08081092: + adds r0, r2, 0 + subs r0, 0x29 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x18 + bhi _080810A4 + ldr r1, =0x03003090 + ldr r0, =0x00005432 + strh r0, [r1, 0x24] +_080810A4: + cmp r3, 0x9 + bhi _080810B0 + movs r0, 0x2 + movs r1, 0x5 + bl sub_8080E6C +_080810B0: + ldr r0, =0x03005e00 + adds r1, r5, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + b _080810EC + .pool +_080810CC: + ldr r0, =0x03003090 + ldr r1, =0x00004523 + strh r1, [r0, 0x24] + movs r0, 0x1 + strh r0, [r2, 0x8] + b _080810EE + .pool +_080810E0: + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0 +_080810EC: + strh r0, [r1, 0x8] +_080810EE: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8080FD0 + + thumb_func_start sub_80810F8 +sub_80810F8: @ 80810F8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r5, =0x020322a4 + ldr r3, [r5] + adds r0, r3, 0 + adds r0, 0x4A + ldrh r0, [r0] + movs r1, 0xC0 + lsls r1, 5 + adds r0, r1 + ldr r1, =0x0000ffff + ands r0, r1 + adds r1, r3, 0 + adds r1, 0x9C + ldrb r1, [r1] + lsrs r2, r0, 8 + ldr r0, =gUnknown_083399E7 + adds r1, r0 + ldrb r1, [r1] + adds r0, r1, 0 + adds r0, 0x14 + cmp r2, r0 + bls _0808120C + adds r0, 0x14 + cmp r2, r0 + bcs _0808120C + ldr r2, =0x03005e00 + lsls r1, r4, 2 + adds r0, r1, r4 + lsls r0, 3 + adds r2, r0, r2 + movs r6, 0x8 + ldrsh r0, [r2, r6] + adds r6, r1, 0 + cmp r0, 0 + bne _0808121A + ldr r1, =0x00000123 + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080811F8 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x0000028f + bl __udivsi3 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, [r5] + adds r0, 0x4C + movs r3, 0 + ldrsh r1, [r0, r3] + ldr r0, =0x000001f3 + cmp r1, r0 + bgt _080811AC + cmp r2, 0x58 + bls _0808119C + ldr r1, =0x03003090 + ldr r0, =0x00004523 + strh r0, [r1, 0x34] + b _080811DE + .pool +_0808119C: + ldr r1, =0x03003090 + ldr r0, =0x00005432 + strh r0, [r1, 0x34] + b _080811DE + .pool +_080811AC: + cmp r2, 0x3C + bls _080811C0 + ldr r1, =0x03003090 + ldr r0, =0x00004523 + b _080811D0 + .pool +_080811C0: + adds r0, r2, 0 + subs r0, 0x38 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bhi _080811D2 + ldr r1, =0x03003090 + ldr r0, =0x00005432 +_080811D0: + strh r0, [r1, 0x34] +_080811D2: + cmp r2, 0x4 + bhi _080811DE + movs r0, 0x3 + movs r1, 0x5 + bl sub_8080E6C +_080811DE: + ldr r0, =0x03005e00 + adds r1, r6, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + b _08081218 + .pool +_080811F8: + ldr r0, =0x03003090 + ldr r1, =0x00004523 + strh r1, [r0, 0x34] + movs r0, 0x1 + strh r0, [r2, 0x8] + b _0808121A + .pool +_0808120C: + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0 +_08081218: + strh r0, [r1, 0x8] +_0808121A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80810F8 + + thumb_func_start sub_8081224 +sub_8081224: @ 8081224 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x020322a4 + ldr r0, [r0] + adds r0, 0x4A + ldrh r0, [r0] + movs r1, 0x1 + bl task_tutorial_oak_boy_girl + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08081270 + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r2, r1, r0 + movs r1, 0x8 + ldrsh r0, [r2, r1] + cmp r0, 0 + bne _0808127E + ldr r0, =0x03003090 + ldr r1, =0x00004523 + strh r1, [r0, 0x14] + movs r0, 0x1 + strh r0, [r2, 0x8] + b _0808127E + .pool +_08081270: + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0 + strh r0, [r1, 0x8] +_0808127E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8081224 + + thumb_func_start sub_8081288 +sub_8081288: @ 8081288 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r7, r0, 16 + mov r8, r7 + lsls r1, 24 + ldr r0, =gUnknown_08339B40 + ldr r4, =gUnknown_083399C8 + lsrs r1, 23 + adds r2, r1, r4 + ldrb r6, [r2] + ldr r5, =gUnknown_083399C0 + adds r2, r1, r5 + movs r3, 0 + ldrsb r3, [r2, r3] + lsls r2, r3, 2 + adds r2, r3 + lsls r2, 1 + subs r6, r2 + adds r4, 0x1 + adds r4, r1, r4 + ldrb r2, [r4] + adds r5, 0x1 + adds r1, r5 + movs r3, 0 + ldrsb r3, [r1, r3] + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 1 + subs r2, r1 + adds r1, r6, 0 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + adds r2, r1, 0 + ldr r0, =0x00004523 + cmp r7, r0 + bne _08081314 + lsls r4, r1, 4 + adds r4, r1 + lsls r4, 2 + ldr r5, =0x02020630 + adds r0, r4, r5 + movs r1, 0x2 + bl StartObjectImageAnim + adds r5, 0x1C + adds r4, r5 + ldr r0, =sub_8082F9C + str r0, [r4] + movs r0, 0x28 + bl audio_play + b _08081358 + .pool +_08081314: + ldr r0, =0x00005432 + cmp r7, r0 + bne _0808133C + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r1, 0 + bl StartObjectImageAnim + movs r0, 0x1F + bl audio_play + b _08081358 + .pool +_0808133C: + ldr r0, =0x00002345 + cmp r8, r0 + bne _08081358 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r1, 0x1 + bl StartObjectImageAnim + movs r0, 0x20 + bl audio_play +_08081358: + bl sub_8082E84 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8081288 + + thumb_func_start sub_8081370 +sub_8081370: @ 8081370 + push {r4-r7,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + bl sub_807F738 + ldr r0, =0x00004523 + cmp r4, r0 + beq _080813A4 + cmp r4, r0 + bgt _08081398 + ldr r0, =0x00002345 + cmp r4, r0 + beq _08081474 + b _080814A0 + .pool +_08081398: + ldr r0, =0x00005432 + cmp r5, r0 + beq _0808143C + b _080814A0 + .pool +_080813A4: + ldr r7, =0x020322a4 + ldr r4, [r7] + adds r5, r4, 0 + adds r5, 0x4C + ldrh r6, [r5] + movs r0, 0 + ldrsh r1, [r5, r0] + ldr r0, =0x000005db + cmp r1, r0 + bgt _080813E0 + ldr r1, =gUnknown_08339CC3 + adds r0, r4, 0 + adds r0, 0x7C + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + movs r0, 0xC0 + lsls r0, 1 + bl __divsi3 + adds r0, r6, r0 + strh r0, [r5] + b _080814A0 + .pool +_080813E0: + ldr r1, =gUnknown_08339CC3 + adds r0, r4, 0 + adds r0, 0x7C + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x80 + bl __divsi3 + adds r0, r6, r0 + strh r0, [r5] + movs r1, 0x8E + lsls r1, 1 + adds r4, r1 + movs r1, 0 + ldrsh r0, [r5, r1] + movs r1, 0x64 + bl __divsi3 + adds r1, r0, 0 + subs r1, 0xA + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_80832BC + ldr r0, [r7] + movs r1, 0x8F + lsls r1, 1 + adds r4, r0, r1 + adds r0, 0x4C + movs r1, 0 + ldrsh r0, [r0, r1] + movs r1, 0x64 + bl __divsi3 + adds r1, r0, 0 + subs r1, 0xA + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_80832BC + b _080814A0 + .pool +_0808143C: + ldr r0, =0x020322a4 + ldr r2, [r0] + adds r4, r2, 0 + adds r4, 0x4C + ldrh r5, [r4] + movs r0, 0 + ldrsh r1, [r4, r0] + ldr r0, =0x000005db + cmp r1, r0 + bgt _080814A0 + ldr r1, =gUnknown_08339CC3 + adds r0, r2, 0 + adds r0, 0x7C + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x80 + lsls r0, 1 + bl __divsi3 + adds r0, r5, r0 + b _0808149E + .pool +_08081474: + ldr r0, =0x020322a4 + ldr r0, [r0] + adds r4, r0, 0 + adds r4, 0x4C + ldr r1, =gUnknown_08339CC3 + adds r0, 0x7C + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x80 + lsls r0, 1 + bl __divsi3 + ldrh r1, [r4] + subs r1, r0 + strh r1, [r4] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x7F + bgt _080814A0 + movs r0, 0x80 +_0808149E: + strh r0, [r4] +_080814A0: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8081370 + + thumb_func_start sub_80814B0 +sub_80814B0: @ 80814B0 + push {lr} + lsls r0, 16 + lsrs r3, r0, 16 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _080814E4 + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _080814E4 + movs r0, 0xFF + lsls r0, 8 + ands r0, r3 + cmp r0, r2 + bne _080814EC + movs r0, 0x1 + b _080814EE + .pool +_080814E4: + cmp r3, r1 + bne _080814EC + movs r0, 0x1 + b _080814EE +_080814EC: + movs r0, 0 +_080814EE: + pop {r1} + bx r1 + thumb_func_end sub_80814B0 + + thumb_func_start sub_80814F4 +sub_80814F4: @ 80814F4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + ldr r0, =0x020375e0 + ldrh r0, [r0] + cmp r0, 0 + beq _0808153C + ldr r3, =0x03003110 + ldrh r0, [r3, 0x4] + ldr r2, =0x03003090 + cmp r0, 0 + beq _0808151C + movs r1, 0 + strh r0, [r2, 0x4] + ldr r0, =0x00004444 + strh r0, [r2] + strh r1, [r3, 0x4] +_0808151C: + ldr r0, =0x03003090 + ldr r3, =0x00004444 + adds r1, r2, 0 + adds r1, 0x10 + adds r2, r0, 0 + adds r2, 0x14 + movs r7, 0x2 +_0808152A: + ldrh r0, [r2] + cmp r0, 0 + beq _08081532 + strh r3, [r1] +_08081532: + adds r1, 0x10 + adds r2, 0x10 + subs r7, 0x1 + cmp r7, 0 + bge _0808152A +_0808153C: + movs r7, 0 + ldr r1, =0x020322a4 + ldr r0, [r1] + adds r0, 0x7C + ldrb r0, [r0] + cmp r7, r0 + blt _0808154C + b _080816F6 +_0808154C: + ldr r0, =0x03003090 + adds r2, r0, 0 + adds r2, 0x20 + str r2, [sp] + movs r1, 0 + mov r9, r1 + movs r2, 0 + str r2, [sp, 0x4] + mov r8, r0 + ldr r0, =0x00005432 + mov r10, r0 +_08081562: + mov r1, r8 + ldrh r0, [r1] + ldr r1, =0x00004444 + movs r2, 0x88 + lsls r2, 7 + bl sub_80814B0 + cmp r0, 0 + bne _08081576 + b _080816D2 +_08081576: + ldr r6, =0x020322a4 + ldr r0, [r6] + adds r0, 0x96 + ldr r2, [sp, 0x4] + adds r0, r2 + ldrh r5, [r0] + mov r0, r8 + ldrh r4, [r0, 0x4] + ldr r1, =0x00004523 + cmp r4, r1 + bne _080815F4 + adds r0, r1, 0 + bl sub_8081370 + ldr r0, [r6] + movs r2, 0x8B + lsls r2, 1 + adds r4, r0, r2 + adds r0, 0x4C + movs r1, 0 + ldrsh r0, [r0, r1] + movs r1, 0x37 + bl __divsi3 + ldrh r1, [r4] + adds r1, r0 + strh r1, [r4] + lsls r1, 16 + ldr r0, =0x03e70000 + cmp r1, r0 + bls _080815BA + movs r0, 0xFA + lsls r0, 2 + strh r0, [r4] +_080815BA: + lsls r1, r5, 24 + lsrs r1, 24 + ldr r0, =0x00004523 + bl sub_8081288 + ldr r1, [r6] + movs r2, 0x92 + lsls r2, 1 + adds r1, r2 + add r1, r9 + ldrh r0, [r1] + adds r0, 0x1 + b _0808165E + .pool +_080815F4: + cmp r4, r10 + bne _08081632 + mov r0, r10 + bl sub_8081370 + ldr r0, [r6] + movs r1, 0x8B + lsls r1, 1 + adds r4, r0, r1 + adds r0, 0x4C + movs r2, 0 + ldrsh r0, [r0, r2] + movs r1, 0x46 + bl __divsi3 + ldrh r1, [r4] + adds r1, r0 + strh r1, [r4] + lsls r1, r5, 24 + lsrs r1, 24 + mov r0, r10 + bl sub_8081288 + ldr r1, [r6] + movs r0, 0x93 + lsls r0, 1 + adds r1, r0 + add r1, r9 + ldrh r0, [r1] + adds r0, 0x1 + b _0808165E +_08081632: + ldr r0, =0x00002345 + cmp r4, r0 + bne _0808166A + lsls r1, r5, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_8081288 + adds r0, r4, 0 + bl sub_8081370 + ldr r0, [r6] + movs r1, 0x94 + lsls r1, 1 + adds r0, r1 + mov r2, r9 + adds r1, r0, r2 + ldrh r2, [r1] + ldr r0, =0x000003e6 + cmp r2, r0 + bhi _08081660 + adds r0, r2, 0x1 +_0808165E: + strh r0, [r1] +_08081660: + mov r0, r8 + ldrh r1, [r0, 0x4] + ldr r0, =0x00002345 + cmp r1, r0 + beq _08081678 +_0808166A: + ldr r1, [sp] + ldrh r0, [r1] + ldr r2, =0x00004523 + cmp r0, r2 + beq _08081678 + cmp r0, r10 + bne _080816D2 +_08081678: + ldr r0, =0x020322a4 + ldr r0, [r0] + adds r2, r0, 0 + adds r2, 0x4C + movs r0, 0 + ldrsh r1, [r2, r0] + ldr r0, =0x000005dc + cmp r1, r0 + ble _080816C8 + adds r0, r1, 0 + ldr r2, =0xfffffd12 + adds r0, r2 + movs r1, 0x14 + bl __divsi3 + adds r1, r0, 0 + movs r0, 0x80 + lsls r0, 1 + adds r1, r0 + lsls r1, 16 + lsrs r1, 16 + ldr r0, =0x03007420 + bl MPlayTempoControl + b _080816D2 + .pool +_080816C8: + ldr r0, =0x03007420 + movs r1, 0x80 + lsls r1, 1 + bl MPlayTempoControl +_080816D2: + ldr r1, [sp] + adds r1, 0x2 + str r1, [sp] + movs r2, 0x6 + add r9, r2 + ldr r0, [sp, 0x4] + adds r0, 0x2 + str r0, [sp, 0x4] + movs r1, 0x10 + add r8, r1 + adds r7, 0x1 + ldr r0, =0x020322a4 + ldr r0, [r0] + adds r0, 0x7C + ldrb r0, [r0] + cmp r7, r0 + bge _080816F6 + b _08081562 +_080816F6: + ldr r0, =0x020375e0 + ldrh r0, [r0] + cmp r0, 0 + beq _08081722 + movs r7, 0 + ldr r3, =0x020322a4 + ldr r0, [r3] + adds r0, 0x7C + ldrb r0, [r0] + cmp r7, r0 + bge _08081722 + movs r2, 0 + ldr r1, =0x03003090 +_08081710: + strh r2, [r1] + strh r2, [r1, 0x4] + adds r1, 0x10 + adds r7, 0x1 + ldr r0, [r3] + adds r0, 0x7C + ldrb r0, [r0] + cmp r7, r0 + blt _08081710 +_08081722: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80814F4 + + thumb_func_start sub_8081744 +sub_8081744: @ 8081744 + push {r4-r6,lr} + movs r4, 0 + movs r6, 0 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _0808175A + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r6, r0, 24 +_0808175A: + ldr r3, =0x020322a4 + ldr r1, [r3] + lsls r2, r6, 1 + adds r0, r1, 0 + adds r0, 0x96 + adds r0, r2 + ldrb r5, [r0] + adds r1, 0x63 + ldrb r0, [r1] + cmp r0, 0 + bne _0808182C + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x2 + bne _080817A8 + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080817B6 + ldrh r2, [r2, 0x28] + ldr r1, =0x00000201 + adds r0, r1, 0 + ands r0, r2 + cmp r0, r1 + beq _080817B6 + b _080817BA + .pool +_080817A8: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080817B6 + movs r4, 0x1 +_080817B6: + cmp r4, 0 + beq _0808182C +_080817BA: + ldr r4, =0x020322a4 + ldr r1, [r4] + lsls r2, r5, 1 + adds r0, r1, 0 + adds r0, 0x8E + adds r0, r2 + adds r1, 0x50 + ldrh r0, [r0] + adds r1, r0 + ldrb r1, [r1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + adds r1, r5, 0x4 + lsls r1, 24 + lsrs r1, 24 + bl StartObjectImageAnim + ldr r0, [r4] + adds r0, 0x4A + ldrh r0, [r0] + adds r1, r6, 0 + bl task_tutorial_oak_boy_girl + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08081810 + ldr r1, =0x03003110 + ldr r0, =0x00004523 + b _08081828 + .pool +_08081810: + cmp r0, 0x1 + bne _08081824 + ldr r1, =0x03003110 + ldr r0, =0x00005432 + b _08081828 + .pool +_08081824: + ldr r1, =0x03003110 + ldr r0, =0x00002345 +_08081828: + strh r0, [r1, 0x4] + adds r3, r4, 0 +_0808182C: + ldr r1, [r3] + adds r1, 0x72 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bls _0808185A + ldr r0, [r3] + adds r1, r0, 0 + adds r1, 0x4C + ldrh r2, [r1] + movs r4, 0 + ldrsh r0, [r1, r4] + cmp r0, 0x80 + ble _08081852 + subs r0, r2, 0x1 + strh r0, [r1] +_08081852: + ldr r0, [r3] + adds r0, 0x72 + movs r1, 0 + strb r1, [r0] +_0808185A: + ldr r0, =0x020322d5 + ldrb r0, [r0] + cmp r0, 0 + beq _0808187E + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + beq _0808187E + ldr r0, [r3] + ldr r1, =0x00000123 + adds r2, r0, r1 + ldrb r0, [r2] + movs r1, 0x1 + eors r0, r1 + strb r0, [r2] +_0808187E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8081744 + + thumb_func_start sub_8081898 +sub_8081898: @ 8081898 + push {r4-r6,lr} + bl sub_8082D28 + ldr r4, =0x020322a4 + ldr r0, [r4] + movs r1, 0x82 + lsls r1, 1 + adds r2, r0, r1 + ldr r1, [r2] + ldr r0, =0x00057e03 + cmp r1, r0 + bhi _080818B4 + adds r0, r1, 0x1 + str r0, [r2] +_080818B4: + bl sub_8081744 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x4C + ldrh r0, [r0] + movs r5, 0x8B + lsls r5, 1 + adds r1, r5 + ldrh r1, [r1] + bl sub_800A994 + bl sub_80814F4 + ldr r0, [r4] + adds r0, r5 + ldrh r0, [r0] + movs r6, 0xFA + lsls r6, 2 + adds r1, r6, 0 + bl sub_8083140 + ldr r0, [r4] + adds r0, 0x4C + ldrh r0, [r0] + bl sub_8083230 + bl sub_808330C + bl sub_8082AD4 + ldr r2, [r4] + adds r3, r2, 0 + adds r3, 0x63 + ldrb r0, [r3] + cmp r0, 0 + bne _0808191A + movs r1, 0x8C + lsls r1, 1 + adds r0, r2, r1 + ldrh r1, [r0] + ldr r0, =0x000003e7 + cmp r1, r0 + bls _0808191A + adds r0, r2, r5 + strh r6, [r0] + movs r0, 0x1 + strb r0, [r3] + ldr r0, =sub_8081FC8 + bl SetMainCallback2 +_0808191A: + ldr r0, =0x020322a4 + ldr r1, [r0] + movs r2, 0x8E + lsls r2, 1 + adds r0, r1, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + movs r2, 0x8F + lsls r2, 1 + adds r1, r2 + movs r2, 0 + ldrsh r1, [r1, r2] + bl nullsub_31 + bl RunActiveTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl RunTextPrinters + bl fade_and_return_progress_probably + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8081898 + + thumb_func_start nullsub_31 +nullsub_31: @ 8081960 + bx lr + thumb_func_end nullsub_31 + + thumb_func_start help_system_is_not_first_time +help_system_is_not_first_time: @ 8081964 + push {r4,r5,lr} + lsls r1, 24 + lsls r2, 24 + lsrs r1, 20 + adds r4, r1, r0 + lsrs r2, 20 + adds r5, r2, r0 + ldrh r0, [r4] + ldrh r1, [r5] + cmp r0, r1 + bne _080819A2 + adds r0, r4, 0x2 + adds r1, r5, 0x2 + bl CompareString + cmp r0, 0 + bne _080819B0 + ldr r0, [r4, 0x8] + ldr r2, =0xffffff00 + ands r0, r2 + ldr r1, [r5, 0x8] + ands r1, r2 + cmp r0, r1 + bne _080819B0 + ldr r0, [r4, 0xC] + ldr r2, =0x00ffffff + ands r0, r2 + ldr r1, [r5, 0xC] + ands r1, r2 + cmp r0, r1 + bne _080819B0 +_080819A2: + movs r0, 0x1 + b _080819B2 + .pool +_080819B0: + movs r0, 0 +_080819B2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end help_system_is_not_first_time + + thumb_func_start sub_80819B8 +sub_80819B8: @ 80819B8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + mov r10, r0 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x10] + lsls r3, 24 + lsrs r3, 24 + mov r2, sp + movs r4, 0x5 +_080819D4: + ldrh r0, [r1] + strh r0, [r2] + adds r1, 0x2 + adds r2, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _080819D4 + movs r6, 0 + mov r1, sp + movs r4, 0x4 +_080819E8: + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _080819F2 + adds r6, 0x1 +_080819F2: + adds r1, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _080819E8 + cmp r6, 0x5 + beq _08081A46 + cmp r3, 0x3 + bhi _08081A46 + movs r4, 0 + ldr r3, [sp, 0x10] + cmp r4, r3 + bge _08081A5E + mov r3, r10 +_08081A0C: + movs r6, 0 + ldr r7, [sp, 0x10] + cmp r6, r7 + bge _08081A54 + mov r9, r3 + mov r5, r10 + lsls r0, r4, 24 + mov r8, r0 +_08081A1C: + mov r1, r9 + ldrh r0, [r1] + ldrh r2, [r5] + cmp r0, r2 + bne _08081A4A + cmp r4, r6 + beq _08081A4A + cmp r0, 0xAF + bne _08081A46 + lsls r2, r6, 24 + lsrs r2, 24 + mov r0, r10 + mov r7, r8 + lsrs r1, r7, 24 + str r3, [sp, 0xC] + bl help_system_is_not_first_time + lsls r0, 24 + ldr r3, [sp, 0xC] + cmp r0, 0 + beq _08081A4A +_08081A46: + movs r0, 0xC + b _08081B9E +_08081A4A: + adds r5, 0x10 + adds r6, 0x1 + ldr r0, [sp, 0x10] + cmp r6, r0 + blt _08081A1C +_08081A54: + adds r3, 0x10 + adds r4, 0x1 + ldr r1, [sp, 0x10] + cmp r4, r1 + blt _08081A0C +_08081A5E: + movs r2, 0 + mov r1, sp + movs r4, 0x4 +_08081A64: + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0 + ble _08081A72 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 +_08081A72: + adds r1, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _08081A64 + cmp r2, 0x3 + bls _08081A82 + movs r0, 0xD + b _08081B9E +_08081A82: + cmp r2, 0x3 + bne _08081A8A + movs r0, 0xB + b _08081B9E +_08081A8A: + movs r4, 0 + mov r1, sp +_08081A8E: + movs r7, 0 + ldrsh r0, [r1, r7] + cmp r0, 0x32 + ble _08081A98 + b _08081B98 +_08081A98: + adds r1, 0x2 + adds r4, 0x1 + cmp r4, 0x4 + ble _08081A8E + cmp r2, 0x1 + bne _08081AEA + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + ble _08081AB2 + movs r0, 0x1 + b _08081B9E +_08081AB2: + mov r0, sp + ldrh r0, [r0, 0x2] + lsls r0, 16 + cmp r0, 0 + ble _08081AC0 + movs r0, 0x2 + b _08081B9E +_08081AC0: + mov r0, sp + movs r3, 0x4 + ldrsh r0, [r0, r3] + cmp r0, 0 + ble _08081ACE + movs r0, 0x3 + b _08081B9E +_08081ACE: + mov r0, sp + movs r4, 0x6 + ldrsh r0, [r0, r4] + cmp r0, 0 + ble _08081ADC + movs r0, 0x4 + b _08081B9E +_08081ADC: + mov r0, sp + movs r7, 0x8 + ldrsh r0, [r0, r7] + cmp r0, 0 + ble _08081AEA + movs r0, 0x5 + b _08081B9E +_08081AEA: + cmp r2, 0x2 + bne _08081B9C + movs r4, 0 + ldr r5, =0x03000df8 + mov r1, sp + adds r2, r5, 0 +_08081AF6: + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0 + ble _08081B02 + strh r4, [r2] + adds r2, 0x2 +_08081B02: + adds r1, 0x2 + adds r4, 0x1 + cmp r4, 0x4 + ble _08081AF6 + movs r4, 0 + ldrsh r3, [r5, r4] + lsls r0, r3, 1 + mov r7, sp + adds r1, r7, r0 + movs r0, 0x2 + ldrsh r2, [r5, r0] + lsls r0, r2, 1 + add r0, sp + movs r4, 0 + ldrsh r1, [r1, r4] + movs r7, 0 + ldrsh r0, [r0, r7] + cmp r1, r0 + blt _08081B58 + adds r0, r3, 0 + cmp r0, 0 + bne _08081B38 + lsls r0, r2, 16 + b _08081B62 + .pool +_08081B38: + cmp r0, 0x1 + bne _08081B40 + lsls r0, r2, 16 + b _08081B6E +_08081B40: + cmp r0, 0x2 + bne _08081B48 + lsls r0, r2, 16 + b _08081B7A +_08081B48: + cmp r0, 0x3 + bne _08081B50 + lsls r0, r2, 16 + b _08081B86 +_08081B50: + cmp r0, 0x4 + bne _08081B9C + lsls r0, r2, 16 + b _08081B92 +_08081B58: + movs r2, 0x2 + ldrsh r0, [r5, r2] + cmp r0, 0 + bne _08081B68 + lsls r0, r3, 16 +_08081B62: + movs r1, 0x6 + orrs r0, r1 + b _08081B9E +_08081B68: + cmp r0, 0x1 + bne _08081B74 + lsls r0, r3, 16 +_08081B6E: + movs r1, 0x7 + orrs r0, r1 + b _08081B9E +_08081B74: + cmp r0, 0x2 + bne _08081B80 + lsls r0, r3, 16 +_08081B7A: + movs r1, 0x8 + orrs r0, r1 + b _08081B9E +_08081B80: + cmp r0, 0x3 + bne _08081B8C + lsls r0, r3, 16 +_08081B86: + movs r1, 0x9 + orrs r0, r1 + b _08081B9E +_08081B8C: + cmp r0, 0x4 + bne _08081B9C + lsls r0, r3, 16 +_08081B92: + movs r1, 0xA + orrs r0, r1 + b _08081B9E +_08081B98: + movs r0, 0xE + b _08081B9E +_08081B9C: + movs r0, 0 +_08081B9E: + 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_80819B8 + + thumb_func_start sub_8081BB0 +sub_8081BB0: @ 8081BB0 + ldr r1, =0x03000e04 + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_8081BB0 + + thumb_func_start sub_8081BBC +sub_8081BBC: @ 8081BBC + ldr r0, =0x03000e04 + movs r1, 0 + ldrsh r0, [r0, r1] + bx lr + .pool + thumb_func_end sub_8081BBC + + thumb_func_start sub_8081BC8 +sub_8081BC8: @ 8081BC8 + ldr r1, =0x03000e06 + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_8081BC8 + + thumb_func_start sub_8081BD4 +sub_8081BD4: @ 8081BD4 + ldr r0, =0x03000e06 + movs r1, 0 + ldrsh r0, [r0, r1] + bx lr + .pool + thumb_func_end sub_8081BD4 + + thumb_func_start sub_8081BE0 +sub_8081BE0: @ 8081BE0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + str r0, [sp] + mov r8, r1 + str r3, [sp, 0x4] + ldr r0, [sp, 0x30] + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x8] + ldr r7, =0x03000de8 + adds r2, r7, 0 + movs r1, 0 + adds r0, r7, 0 + adds r0, 0xA +_08081C0A: + strh r1, [r0] + subs r0, 0x2 + cmp r0, r2 + bge _08081C0A + movs r6, 0 + cmp r6, r9 + bge _08081C40 + ldr r0, =0x03000de8 + mov r12, r0 + ldr r5, [sp] + adds r5, 0x9 +_08081C20: + movs r3, 0 + adds r4, r5, 0 + mov r2, r12 +_08081C26: + adds r1, r4, r3 + ldrh r0, [r2] + ldrb r1, [r1] + adds r0, r1 + strh r0, [r2] + adds r2, 0x2 + adds r3, 0x1 + cmp r3, 0x5 + ble _08081C26 + adds r5, 0x10 + adds r6, 0x1 + cmp r6, r9 + blt _08081C20 +_08081C40: + movs r1, 0 + ldrsh r3, [r7, r1] + ldrh r0, [r7] + ldrh r1, [r7, 0x2] + subs r0, r1 + strh r0, [r7] + ldrh r0, [r7, 0x4] + subs r1, r0 + strh r1, [r7, 0x2] + ldrh r1, [r7, 0x6] + subs r0, r1 + strh r0, [r7, 0x4] + ldrh r0, [r7, 0x8] + subs r1, r0 + strh r1, [r7, 0x6] + subs r0, r3 + strh r0, [r7, 0x8] + movs r3, 0 + movs r2, 0 + adds r1, r7, 0 + movs r6, 0x4 +_08081C6A: + movs r4, 0 + ldrsh r0, [r1, r4] + cmp r0, 0 + bge _08081C76 + strh r2, [r1] + adds r3, 0x1 +_08081C76: + adds r1, 0x2 + subs r6, 0x1 + cmp r6, 0 + bge _08081C6A + lsls r0, r3, 24 + lsrs r0, 24 + mov r10, r0 + movs r4, 0 + ldr r1, =0x03000de8 + movs r6, 0x4 +_08081C8A: + ldrh r2, [r1] + movs r5, 0 + ldrsh r0, [r1, r5] + cmp r0, 0 + ble _08081CA4 + cmp r0, r3 + bge _08081CA0 + strh r4, [r1] + b _08081CA4 + .pool +_08081CA0: + subs r0, r2, r3 + strh r0, [r1] +_08081CA4: + adds r1, 0x2 + subs r6, 0x1 + cmp r6, 0 + bge _08081C8A + ldr r1, =0x03000de8 + ldr r2, =0x020322a8 + movs r6, 0x4 +_08081CB2: + movs r3, 0 + ldrsh r0, [r1, r3] + stm r2!, {r0} + adds r1, 0x2 + subs r6, 0x1 + cmp r6, 0 + bge _08081CB2 + ldr r1, =0x0000014d + ldr r0, [sp, 0x8] + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + adds r3, r0, 0 + adds r3, 0x64 + ldr r4, =0x020322d0 + str r3, [r4] + movs r6, 0x4 +_08081CD6: + movs r0, 0 + ldrsh r5, [r7, r0] + adds r0, r5, 0 + muls r0, r3 + movs r1, 0xA + str r3, [sp, 0xC] + bl __divsi3 + adds r5, r0, 0 + movs r1, 0xA + bl __modsi3 + adds r4, r0, 0 + adds r0, r5, 0 + movs r1, 0xA + bl __divsi3 + adds r5, r0, 0 + ldr r3, [sp, 0xC] + cmp r4, 0x4 + ble _08081D02 + adds r5, 0x1 +_08081D02: + strh r5, [r7] + adds r7, 0x2 + subs r6, 0x1 + cmp r6, 0 + bge _08081CD6 + ldr r1, =0x03000de8 + ldr r2, =0x020322bc + movs r6, 0x4 +_08081D12: + movs r3, 0 + ldrsh r0, [r1, r3] + stm r2!, {r0} + adds r1, 0x2 + subs r6, 0x1 + cmp r6, 0 + bge _08081D12 + ldr r4, =0x03000de8 + ldr r0, [sp] + adds r1, r4, 0 + mov r2, r9 + mov r3, r10 + bl sub_80819B8 + mov r5, r8 + strb r0, [r5] + movs r1, 0xA + ldrsh r0, [r4, r1] + mov r1, r9 + bl __divsi3 + mov r3, r9 + subs r0, r3 + strh r0, [r4, 0xA] + lsls r0, 16 + cmp r0, 0 + bge _08081D4C + movs r0, 0 + strh r0, [r4, 0xA] +_08081D4C: + mov r5, r8 + ldrb r0, [r5] + cmp r0, 0xC + bne _08081DA6 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + lsrs r3, r0, 16 + movs r6, 0 + ldr r0, =gUnknown_08339CC8 + adds r0, r3, r0 + ldrb r0, [r0] + adds r1, r4, 0 + movs r4, 0x1 + movs r3, 0x2 +_08081D74: + adds r2, r0, 0 + asrs r2, r6 + ands r2, r4 + cmp r2, 0 + beq _08081D9C + strh r3, [r1] + b _08081D9E + .pool +_08081D9C: + strh r2, [r1] +_08081D9E: + adds r1, 0x2 + adds r6, 0x1 + cmp r6, 0x4 + ble _08081D74 +_08081DA6: + ldr r7, =0x03000de8 + movs r2, 0xFF + adds r1, r7, 0 + movs r6, 0x5 +_08081DAE: + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0xFF + ble _08081DB8 + strh r2, [r1] +_08081DB8: + adds r1, 0x2 + subs r6, 0x1 + cmp r6, 0 + bge _08081DAE + ldrh r0, [r7] + mov r4, r8 + strb r0, [r4, 0x1] + ldrh r0, [r7, 0x2] + strb r0, [r4, 0x2] + ldrh r0, [r7, 0x4] + strb r0, [r4, 0x3] + ldrh r0, [r7, 0x6] + strb r0, [r4, 0x4] + ldrh r0, [r7, 0x8] + strb r0, [r4, 0x5] + ldrh r0, [r7, 0xA] + strb r0, [r4, 0x6] + movs r6, 0 + adds r2, r7, 0 +_08081DDE: + ldr r5, [sp, 0x4] + adds r1, r5, r6 + ldrh r0, [r2] + strb r0, [r1] + adds r2, 0x2 + adds r6, 0x1 + cmp r6, 0x5 + ble _08081DDE + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8081BE0 + + thumb_func_start sub_8081E04 +sub_8081E04: @ 8081E04 + push {r4,lr} + sub sp, 0x4 + ldr r4, [sp, 0xC] + lsls r2, 24 + lsrs r2, 24 + lsls r4, 16 + lsrs r4, 16 + str r4, [sp] + bl sub_8081BE0 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8081E04 + + thumb_func_start sub_8081E20 +sub_8081E20: @ 8081E20 + push {r4-r6,lr} + ldr r0, =0x020322a4 + ldr r0, [r0] + movs r2, 0x82 + lsls r2, 1 + adds r1, r0, r2 + ldrh r1, [r1] + adds r0, 0x4E + ldrh r4, [r0] + movs r2, 0 + ldr r5, =0x00000383 + cmp r1, r5 + bhi _08081E48 + movs r2, 0x5 + b _08081E9A + .pool +_08081E48: + ldr r3, =0xfffffc7c + adds r0, r1, r3 + lsls r0, 16 + lsrs r0, 16 + ldr r3, =0x00000257 + cmp r0, r3 + bhi _08081E64 + movs r2, 0x4 + b _08081E9A + .pool +_08081E64: + ldr r6, =0xfffffa24 + adds r0, r1, r6 + lsls r0, 16 + lsrs r0, 16 + cmp r0, r3 + bhi _08081E78 + movs r2, 0x3 + b _08081E9A + .pool +_08081E78: + ldr r3, =0xfffff7cc + adds r0, r1, r3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, r5 + bhi _08081E8C + movs r2, 0x2 + b _08081E9A + .pool +_08081E8C: + ldr r6, =0xfffff31c + adds r0, r1, r6 + lsls r0, 16 + ldr r1, =0x012b0000 + cmp r0, r1 + bhi _08081E9A + movs r2, 0x1 +_08081E9A: + lsls r0, r2, 16 + asrs r0, 16 + bl sub_8081BC8 + movs r2, 0 + cmp r4, 0x40 + bhi _08081F7C + adds r0, r4, 0 + subs r0, 0x32 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x31 + bhi _08081EC4 + ldr r2, =0x0000ffff + b _08081F7C + .pool +_08081EC4: + adds r0, r4, 0 + subs r0, 0x64 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x31 + bhi _08081ED8 + ldr r2, =0x0000fffe + b _08081F7C + .pool +_08081ED8: + adds r0, r4, 0 + subs r0, 0x96 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x31 + bhi _08081EEC + ldr r2, =0x0000fffd + b _08081F7C + .pool +_08081EEC: + adds r0, r4, 0 + subs r0, 0xC8 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x31 + bhi _08081F00 + ldr r2, =0x0000fffc + b _08081F7C + .pool +_08081F00: + adds r0, r4, 0 + subs r0, 0xFA + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x31 + bhi _08081F14 + ldr r2, =0x0000fffb + b _08081F7C + .pool +_08081F14: + ldr r1, =0xfffffea2 + adds r0, r4, r1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x31 + bhi _08081F2C + ldr r2, =0x0000fffa + b _08081F7C + .pool +_08081F2C: + ldr r3, =0xfffffe70 + adds r0, r4, r3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x31 + bhi _08081F44 + ldr r2, =0x0000fff9 + b _08081F7C + .pool +_08081F44: + ldr r6, =0xfffffe0c + adds r0, r4, r6 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x31 + bhi _08081F5C + ldr r2, =0x0000fff8 + b _08081F7C + .pool +_08081F5C: + ldr r1, =0xfffffdda + adds r0, r4, r1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x31 + bhi _08081F74 + ldr r2, =0x0000fff7 + b _08081F7C + .pool +_08081F74: + ldr r0, =0x00000257 + cmp r4, r0 + bls _08081F7C + ldr r2, =0x0000fff6 +_08081F7C: + lsls r0, r2, 16 + asrs r0, 16 + bl sub_8081BB0 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8081E20 + + thumb_func_start sub_8081F94 +sub_8081F94: @ 8081F94 + push {lr} + adds r1, r0, 0 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _08081FB8 + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08081FB8 + movs r2, 0xBC + lsls r2, 6 + b _08081FBA + .pool +_08081FB8: + ldr r2, =0x00002fff +_08081FBA: + adds r0, r2, 0 + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8081F94 + + thumb_func_start sub_8081FC8 +sub_8081FC8: @ 8081FC8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, =0x020322a4 + ldr r0, [r4] + adds r0, 0x63 + ldrb r0, [r0] + cmp r0, 0x2 + bhi _08081FDE + bl sub_8082D28 +_08081FDE: + bl link_get_multiplayer_id + ldr r0, [r4] + adds r0, 0x63 + ldrb r0, [r0] + subs r0, 0x1 + cmp r0, 0xC + bls _08081FF0 + b _0808249E +_08081FF0: + lsls r0, 2 + ldr r1, =_08082004 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08082004: + .4byte _08082038 + .4byte _08082078 + .4byte _080820D4 + .4byte _080821C8 + .4byte _08082278 + .4byte _08082286 + .4byte _080822B0 + .4byte _08082458 + .4byte _080822E4 + .4byte _08082308 + .4byte _080823B0 + .4byte _08082430 + .4byte _0808246C +_08082038: + ldr r0, =0x03007420 + movs r1, 0x80 + lsls r1, 1 + bl MPlayTempoControl + movs r4, 0 + b _08082064 + .pool +_0808204C: + ldr r0, =0x020322a4 + ldr r0, [r0] + movs r1, 0x90 + lsls r1, 1 + adds r0, r1 + adds r0, r4 + ldrb r0, [r0] + bl remove_task + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_08082064: + ldr r0, =0x020375e0 + ldrh r0, [r0] + cmp r4, r0 + bcc _0808204C + b _08082458 + .pool +_08082078: + ldr r4, =0x020322a4 + ldr r1, [r4] + adds r1, 0x4C + ldrh r0, [r1] + subs r0, 0x20 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + bgt _080820C6 + bl sub_8009F8C + ldr r2, [r4] + adds r1, r2, 0 + adds r1, 0x4C + movs r0, 0 + strh r0, [r1] + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _080820B0 + adds r1, 0x17 + ldrb r0, [r1] + adds r0, 0x1 + b _080820B6 + .pool +_080820B0: + adds r1, r2, 0 + adds r1, 0x63 + movs r0, 0x5 +_080820B6: + strb r0, [r1] + ldr r0, =0x020322a4 + ldr r1, [r0] + movs r0, 0 + strb r0, [r1] + ldr r0, =0x03007630 + bl MPlayStop_rev01 +_080820C6: + bl sub_807F738 + b _0808249E + .pool +_080820D4: + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + beq _080820E0 + b _08082458 +_080820E0: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _080820EC + b _0808249E +_080820EC: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _0808218C + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _0808218C + ldr r3, =0x020322a4 + ldr r1, [r3] + movs r4, 0x8E + lsls r4, 5 + adds r2, r1, r4 + movs r5, 0x82 + lsls r5, 1 + adds r0, r1, r5 + ldr r0, [r0] + str r0, [r2] + adds r0, r1, 0 + adds r0, 0x4E + ldrh r0, [r0] + ldr r2, =0x000011c4 + adds r1, r2 + strh r0, [r1] + movs r4, 0 + mov r8, r3 + mov r12, r8 + ldr r7, =0x000011c8 + movs r6, 0x92 + lsls r6, 1 +_08082128: + movs r3, 0 + adds r5, r4, 0x1 + lsls r0, r4, 1 + adds r0, r4 + lsls r4, r0, 1 +_08082132: + mov r1, r12 + ldr r0, [r1] + lsls r1, r3, 1 + adds r1, r4 + adds r2, r0, r7 + adds r2, r1 + adds r0, r6 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x2 + bls _08082132 + lsls r0, r5, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _08082128 + mov r2, r8 + ldr r1, [r2] + movs r4, 0x8E + lsls r4, 5 + adds r1, r4 + movs r0, 0 + movs r2, 0x20 + bl link_0800A448 + lsls r0, 24 + cmp r0, 0 + bne _08082172 + b _0808249E +_08082172: + mov r5, r8 + ldr r1, [r5] + b _0808245C + .pool +_0808218C: + ldr r4, =0x020322a4 + ldr r3, [r4] + movs r0, 0xCC + lsls r0, 1 + adds r1, r3, r0 + movs r2, 0x82 + lsls r2, 1 + adds r0, r3, r2 + ldr r0, [r0] + str r0, [r1] + adds r0, r3, 0 + adds r0, 0x4E + ldrh r2, [r0] + movs r5, 0xCE + lsls r5, 1 + adds r0, r3, r5 + strh r2, [r0] + movs r0, 0 + movs r2, 0x28 + bl link_0800A448 + lsls r0, 24 + cmp r0, 0 + bne _080821BE + b _0808249E +_080821BE: + ldr r1, [r4] + b _0808245C + .pool +_080821C8: + bl sub_800A550 + lsls r0, 24 + cmp r0, 0 + bne _080821D4 + b _0808249E +_080821D4: + bl sub_800A5B4 + ldr r5, =0x020322a4 + ldr r1, [r5] + adds r1, 0x63 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _08082254 + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08082254 + ldr r2, =0x020223c4 + ldr r3, [r5] + ldrh r0, [r2, 0x4] + adds r1, r3, 0 + adds r1, 0x4E + strh r0, [r1] + movs r0, 0x82 + lsls r0, 1 + adds r1, r3, r0 + ldr r0, [r2] + str r0, [r1] + movs r4, 0 + adds r7, r2, 0 + adds r7, 0x8 + adds r6, r5, 0 + movs r2, 0x92 + lsls r2, 1 +_08082216: + movs r3, 0 + adds r5, r4, 0x1 + lsls r0, r4, 1 + adds r0, r4 + lsls r4, r0, 1 +_08082220: + ldr r1, [r6] + lsls r0, r3, 1 + adds r0, r4 + adds r1, r2 + adds r1, r0 + adds r0, r7, r0 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x2 + bls _08082220 + lsls r0, r5, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _08082216 + b _0808249E + .pool +_08082254: + ldr r2, =0x020223c4 + ldr r0, =0x020322a4 + ldr r3, [r0] + ldrh r0, [r2, 0x4] + adds r1, r3, 0 + adds r1, 0x4E + strh r0, [r1] + movs r4, 0x82 + lsls r4, 1 + adds r1, r3, r4 + ldr r0, [r2] + str r0, [r1] + b _0808249E + .pool +_08082278: + bl sub_8083B08 + lsls r0, 24 + cmp r0, 0 + bne _08082284 + b _0808249E +_08082284: + b _08082458 +_08082286: + bl berry_blender_related + lsls r0, 24 + cmp r0, 0 + bne _08082292 + b _0808249E +_08082292: + ldr r0, =0x03005d98 + ldrb r0, [r0] + cmp r0, 0 + bne _080822A8 + movs r0, 0x22 + bl sav12_xor_increment + b _08082458 + .pool +_080822A8: + movs r0, 0x21 + bl sav12_xor_increment + b _08082458 +_080822B0: + ldr r6, =0x020322a4 + ldr r4, [r6] + ldr r5, =0x000011b8 + adds r4, r5 + ldr r5, =gUnknown_08339831 + bl sav2_get_text_speed + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_808417C + cmp r0, 0 + bne _080822D2 + b _0808249E +_080822D2: + ldr r1, [r6] + b _0808245C + .pool +_080822E4: + ldr r4, =0x020322a4 + ldr r0, [r4] + adds r0, 0x9E + movs r1, 0 + strb r1, [r0] + ldr r0, =gUnknown_083399B8 + movs r1, 0x1 + movs r2, 0xD + movs r3, 0 + bl CreateYesNoMenu + ldr r1, [r4] + b _0808245C + .pool +_08082308: + bl sub_8198C58 + lsls r0, 24 + asrs r2, r0, 24 + cmp r2, 0 + beq _0808236C + cmp r2, 0 + bgt _08082322 + movs r0, 0x1 + negs r0, r0 + cmp r2, r0 + beq _08082328 + b _0808249E +_08082322: + cmp r2, 0x1 + beq _08082328 + b _0808249E +_08082328: + ldr r2, =0x020322a4 + ldr r0, [r2] + adds r0, 0x9E + movs r1, 0x1 + strb r1, [r0] + ldr r1, [r2] + adds r1, 0x63 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r4, 0 +_0808233E: + ldr r0, =0x020322a4 + ldr r0, [r0] + lsls r1, r4, 1 + adds r0, 0x8E + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0xFF + beq _0808235C + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram +_0808235C: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _0808233E + b _0808249E + .pool +_0808236C: + ldr r1, =0x020322a4 + ldr r0, [r1] + adds r0, 0x9E + strb r2, [r0] + ldr r1, [r1] + adds r1, 0x63 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r4, 0 +_08082380: + ldr r0, =0x020322a4 + ldr r0, [r0] + lsls r1, r4, 1 + adds r0, 0x8E + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0xFF + beq _0808239E + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram +_0808239E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _08082380 + b _0808249E + .pool +_080823B0: + ldr r6, =0x03003110 + adds r0, r6, 0 + bl sub_8081F94 + ldr r4, =0x020322a4 + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x9E + ldrb r5, [r0] + cmp r5, 0 + bne _0808241C + movs r0, 0x4 + bl IsBagPocketNonEmpty + lsls r0, 24 + cmp r0, 0 + bne _080823EC + ldr r0, [r4] + adds r0, 0x70 + movs r1, 0x2 + strh r1, [r0] + ldr r0, =0x00009999 + b _08082414 + .pool +_080823EC: + bl sub_8136EF4 + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0808240C + ldr r0, [r4] + adds r0, 0x70 + movs r1, 0x3 + strh r1, [r0] + ldr r0, =0x0000aaaa + b _08082414 + .pool +_0808240C: + ldr r0, [r4] + adds r0, 0x70 + strh r5, [r0] + ldr r0, =0x00007779 +_08082414: + strh r0, [r6, 0x2] + b _08082458 + .pool +_0808241C: + adds r1, r2, 0 + adds r1, 0x70 + movs r0, 0x1 + strh r0, [r1] + ldr r0, =0x00008888 + strh r0, [r6, 0x2] + subs r1, 0xD + b _0808245E + .pool +_08082430: + ldr r0, =0x03005d98 + ldrb r0, [r0] + cmp r0, 0 + beq _08082458 + ldr r0, =sub_8082924 + bl SetMainCallback2 + ldr r2, =0x020322a4 + ldr r0, [r2] + adds r0, 0x63 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + b _0808249C + .pool +_08082458: + ldr r0, =0x020322a4 + ldr r1, [r0] +_0808245C: + adds r1, 0x63 +_0808245E: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0808249E + .pool +_0808246C: + ldr r6, =0x020322a4 + ldr r4, [r6] + ldr r0, =0x000011b8 + adds r4, r0 + ldr r5, =gUnknown_0833981A + bl sav2_get_text_speed + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_808417C + cmp r0, 0 + beq _0808249E + ldr r0, =sub_8082644 + bl SetMainCallback2 + ldr r0, [r6] + adds r0, 0x63 + movs r1, 0 + strb r1, [r0] + ldr r0, [r6] +_0808249C: + strb r1, [r0] +_0808249E: + bl sub_808330C + ldr r4, =0x020322a4 + ldr r0, [r4] + adds r0, 0x4C + ldrh r0, [r0] + bl sub_8083230 + bl sub_8082AD4 + ldr r1, [r4] + movs r2, 0x8E + lsls r2, 1 + adds r0, r1, r2 + movs r4, 0 + ldrsh r0, [r0, r4] + movs r5, 0x8F + lsls r5, 1 + adds r1, r5 + movs r2, 0 + ldrsh r1, [r1, r2] + bl nullsub_31 + bl RunActiveTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl RunTextPrinters + bl fade_and_return_progress_probably + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8081FC8 + + thumb_func_start sub_80824FC +sub_80824FC: @ 80824FC + push {r4,lr} + ldr r1, =0x020322a4 + ldr r0, [r1] + movs r2, 0xD0 + lsls r2, 1 + adds r0, r2 + ldr r0, [r0] + adds r4, r1, 0 + cmp r0, 0x6 + bls _08082512 + b _0808263C +_08082512: + lsls r0, 2 + ldr r1, =_08082524 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08082524: + .4byte _08082540 + .4byte _08082558 + .4byte _08082584 + .4byte _08082594 + .4byte _080825BA + .4byte _08082600 + .4byte _0808261A +_08082540: + bl sub_800ADF8 + ldr r0, =0x020322a4 + ldr r2, [r0] + movs r3, 0xD0 + lsls r3, 1 + adds r1, r2, r3 + movs r0, 0x1 + b _0808260C + .pool +_08082558: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _0808263C + ldr r0, =0x020322a4 + ldr r1, [r0] + movs r2, 0xD0 + lsls r2, 1 + adds r1, r2 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r1, =0x03002700 + movs r0, 0x1 + strb r0, [r1] + b _0808263C + .pool +_08082584: + bl sub_8153430 + ldr r0, =0x020322a4 + ldr r2, [r0] + b _08082602 + .pool +_08082594: + ldr r1, [r4] + movs r2, 0x84 + lsls r2, 1 + adds r1, r2 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + cmp r0, 0xA + bne _0808263C + bl sub_800ADF8 + ldr r1, [r4] + movs r3, 0xD0 + lsls r3, 1 + adds r1, r3 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + b _0808263C +_080825BA: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _0808263C + bl sub_8153474 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _080825E4 + ldr r0, =0x020322a4 + ldr r0, [r0] + movs r1, 0xD0 + lsls r1, 1 + adds r0, r1 + movs r1, 0x5 + str r1, [r0] + b _0808263C + .pool +_080825E4: + ldr r0, =0x020322a4 + ldr r1, [r0] + movs r3, 0x84 + lsls r3, 1 + adds r0, r1, r3 + str r2, [r0] + movs r0, 0xD0 + lsls r0, 1 + adds r1, r0 + movs r0, 0x3 + str r0, [r1] + b _0808263C + .pool +_08082600: + ldr r2, [r4] +_08082602: + movs r3, 0xD0 + lsls r3, 1 + adds r1, r2, r3 + ldr r0, [r1] + adds r0, 0x1 +_0808260C: + str r0, [r1] + movs r0, 0x84 + lsls r0, 1 + adds r1, r2, r0 + movs r0, 0 + str r0, [r1] + b _0808263C +_0808261A: + ldr r1, [r4] + movs r2, 0x84 + lsls r2, 1 + adds r1, r2 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + cmp r0, 0x5 + ble _0808263C + ldr r1, =0x03002700 + movs r0, 0 + strb r0, [r1] + movs r0, 0x1 + b _0808263E + .pool +_0808263C: + movs r0, 0 +_0808263E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80824FC + + thumb_func_start sub_8082644 +sub_8082644: @ 8082644 + push {r4-r6,lr} + sub sp, 0x4 + ldr r1, =0x020322a4 + ldr r0, [r1] + adds r0, 0x63 + ldrb r0, [r0] + adds r6, r1, 0 + cmp r0, 0xC + bls _08082658 + b _080828DC +_08082658: + lsls r0, 2 + ldr r1, =_0808266C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0808266C: + .4byte _080826A0 + .4byte _080826EC + .4byte _0808271C + .4byte _08082754 + .4byte _0808278C + .4byte _080827AA + .4byte _080827C8 + .4byte _080827FC + .4byte _08082818 + .4byte _08082828 + .4byte _0808284C + .4byte _080828A4 + .4byte _080828C6 +_080826A0: + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0x64 + ldrh r2, [r0] + ldr r0, =0x00002222 + cmp r2, r0 + bne _080826B0 + b _080827A2 +_080826B0: + ldr r0, =0x00001111 + cmp r2, r0 + beq _080826B8 + b _080828DC +_080826B8: + adds r0, r1, 0 + adds r0, 0x6C + ldrh r2, [r0] + ldr r0, =0x00009999 + cmp r2, r0 + bne _080826D8 + adds r1, 0x63 + movs r0, 0x2 + strb r0, [r1] + b _080828DC + .pool +_080826D8: + ldr r0, =0x0000aaaa + cmp r2, r0 + bne _080827A2 + adds r1, 0x63 + movs r0, 0x1 + strb r0, [r1] + b _080828DC + .pool +_080826EC: + ldr r0, [r6] + adds r0, 0x63 + movs r1, 0x3 + strb r1, [r0] + ldr r4, =0x02021fc4 + ldr r0, [r6] + adds r0, 0x6E + ldrh r0, [r0] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r0, =0x020229f0 + adds r1, r0 + adds r0, r4, 0 + bl CopyString + ldr r1, =gUnknown_083398DD + b _08082740 + .pool +_0808271C: + ldr r1, [r6] + adds r1, 0x63 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r4, =0x02021fc4 + ldr r0, [r6] + adds r0, 0x6E + ldrh r0, [r0] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r0, =0x020229f0 + adds r1, r0 + adds r0, r4, 0 + bl CopyString + ldr r1, =gUnknown_083398B0 +_08082740: + adds r0, r4, 0 + bl AppendString + b _080828DC + .pool +_08082754: + ldr r4, [r6] + ldr r0, =0x000011b8 + adds r4, r0 + ldr r5, =0x02021fc4 + bl sav2_get_text_speed + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_808417C + cmp r0, 0 + bne _08082774 + b _080828DC +_08082774: + ldr r1, [r6] + movs r0, 0x84 + lsls r0, 1 + adds r2, r1, r0 + movs r0, 0 + str r0, [r2] + b _080828BC + .pool +_0808278C: + ldr r4, [r6] + movs r2, 0x84 + lsls r2, 1 + adds r1, r4, r2 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + cmp r0, 0x3C + bgt _080827A0 + b _080828DC +_080827A0: + adds r1, r4, 0 +_080827A2: + adds r1, 0x63 + movs r0, 0x5 + strb r0, [r1] + b _080828DC +_080827AA: + ldr r0, [r6] + ldr r1, =0x000011b8 + adds r0, r1 + ldr r1, =gUnknown_085EE42D + movs r2, 0 + bl sub_808417C + bl sub_800ADF8 + b _080828BA + .pool +_080827C8: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _080827D4 + b _080828DC +_080827D4: + ldr r3, =0x020322a4 + ldr r1, [r3] + movs r2, 0x84 + lsls r2, 1 + adds r0, r1, r2 + movs r2, 0 + str r2, [r0] + adds r1, 0x63 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r3] + movs r1, 0xD0 + lsls r1, 1 + adds r0, r1 + str r2, [r0] + b _080828DC + .pool +_080827FC: + bl sub_80824FC + lsls r0, 24 + cmp r0, 0 + beq _080828DC + movs r0, 0x37 + bl audio_play + ldr r0, =0x020322a4 + ldr r1, [r0] + b _080828BC + .pool +_08082818: + ldr r1, [r6] + adds r1, 0x63 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + bl sub_800ADF8 + b _080828DC +_08082828: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080828DC + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x020322a4 + ldr r1, [r0] + b _080828BC + .pool +_0808284C: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080828DC + ldr r2, [r6] + adds r0, r2, 0 + adds r0, 0x64 + ldrh r1, [r0] + ldr r0, =0x00002222 + cmp r1, r0 + bne _08082898 + bl FreeAllWindowBuffers + movs r0, 0x2 + bl UnsetBgTilemapBuffer + movs r0, 0x1 + bl UnsetBgTilemapBuffer + ldr r0, [r6] + bl Free + str r4, [r6] + ldr r0, =sub_807FA80 + bl SetMainCallback2 + b _080828DC + .pool +_08082898: + movs r1, 0x84 + lsls r1, 1 + adds r0, r2, r1 + str r4, [r0] + adds r1, r2, 0 + b _080828BC +_080828A4: + ldr r1, [r6] + movs r2, 0x84 + lsls r2, 1 + adds r1, r2 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + cmp r0, 0x1E + ble _080828DC + bl sub_800AC34 +_080828BA: + ldr r1, [r6] +_080828BC: + adds r1, 0x63 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080828DC +_080828C6: + ldr r0, =0x03003124 + ldrb r4, [r0] + cmp r4, 0 + bne _080828DC + ldr r0, [r6] + bl Free + str r4, [r6] + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 +_080828DC: + bl sub_8082AD4 + ldr r0, =0x020322a4 + ldr r1, [r0] + movs r2, 0x8E + lsls r2, 1 + adds r0, r1, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + movs r2, 0x8F + lsls r2, 1 + adds r1, r2 + movs r2, 0 + ldrsh r1, [r1, r2] + bl nullsub_31 + bl RunActiveTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl RunTextPrinters + bl fade_and_return_progress_probably + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8082644 + + thumb_func_start sub_8082924 +sub_8082924: @ 8082924 + push {r4-r6,lr} + ldr r1, =0x020322a4 + ldr r0, [r1] + adds r0, 0x63 + ldrb r0, [r0] + adds r6, r1, 0 + cmp r0, 0xA + bls _08082936 + b _08082A92 +_08082936: + lsls r0, 2 + ldr r1, =_08082948 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08082948: + .4byte _08082974 + .4byte _080829AA + .4byte _080829D4 + .4byte _08082A00 + .4byte _08082A92 + .4byte _08082A92 + .4byte _08082A92 + .4byte _08082A92 + .4byte _08082A92 + .4byte _08082A30 + .4byte _08082A48 +_08082974: + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0x70 + ldrh r0, [r0] + cmp r0, 0x1 + bhi _08082986 + adds r1, 0x63 + movs r0, 0x9 + strb r0, [r1] +_08082986: + ldr r2, [r6] + adds r0, r2, 0 + adds r0, 0x70 + ldrh r1, [r0] + cmp r1, 0x2 + bne _08082996 + subs r0, 0xD + strb r1, [r0] +_08082996: + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0x70 + ldrh r0, [r0] + cmp r0, 0x3 + bne _08082A92 + adds r1, 0x63 + movs r0, 0x1 + strb r0, [r1] + b _08082A92 +_080829AA: + ldr r0, [r6] + adds r0, 0x63 + movs r2, 0 + movs r1, 0x3 + strb r1, [r0] + ldr r0, [r6] + ldr r1, =0x000011b8 + adds r0, r1 + strh r2, [r0] + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_08339896 + bl CopyString + b _08082A92 + .pool +_080829D4: + ldr r1, [r6] + adds r1, 0x63 + ldrb r0, [r1] + adds r0, 0x1 + movs r2, 0 + strb r0, [r1] + ldr r0, [r6] + ldr r1, =0x000011b8 + adds r0, r1 + strh r2, [r0] + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_08339858 + bl CopyString + b _08082A92 + .pool +_08082A00: + ldr r4, [r6] + ldr r2, =0x000011b8 + adds r4, r2 + ldr r5, =0x02021fc4 + bl sav2_get_text_speed + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_808417C + cmp r0, 0 + beq _08082A92 + ldr r0, [r6] + adds r0, 0x63 + movs r1, 0x9 + strb r1, [r0] + b _08082A92 + .pool +_08082A30: + movs r0, 0x3 + bl sub_80A2390 + ldr r0, =0x020322a4 + ldr r1, [r0] + adds r1, 0x63 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08082A92 + .pool +_08082A48: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08082A92 + ldr r0, [r6] + adds r0, 0x70 + ldrh r0, [r0] + cmp r0, 0 + bne _08082A70 + ldr r0, =sub_807FA80 + bl SetMainCallback2 + b _08082A76 + .pool +_08082A70: + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 +_08082A76: + bl FreeAllWindowBuffers + movs r0, 0x2 + bl UnsetBgTilemapBuffer + movs r0, 0x1 + bl UnsetBgTilemapBuffer + ldr r4, =0x020322a4 + ldr r0, [r4] + bl Free + movs r0, 0 + str r0, [r4] +_08082A92: + bl sub_8082AD4 + ldr r0, =0x020322a4 + ldr r1, [r0] + movs r2, 0x8E + lsls r2, 1 + adds r0, r1, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + movs r2, 0x8F + lsls r2, 1 + adds r1, r2 + movs r2, 0 + ldrsh r1, [r1, r2] + bl nullsub_31 + bl RunActiveTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl RunTextPrinters + bl fade_and_return_progress_probably + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8082924 + + thumb_func_start sub_8082AD4 +sub_8082AD4: @ 8082AD4 + push {r4-r7,lr} + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _08082AE0 + b _08082CA4 +_08082AE0: + ldr r4, =0x03003090 + ldrh r0, [r4] + ldr r1, =0x00002fff + movs r2, 0xBC + lsls r2, 6 + bl sub_80814B0 + cmp r0, 0 + beq _08082B66 + ldrh r1, [r4, 0x2] + ldr r0, =0x00001111 + cmp r1, r0 + bne _08082B58 + ldrh r3, [r4, 0x4] + ldr r0, =0x00009999 + cmp r3, r0 + beq _08082B38 + cmp r3, r0 + bgt _08082B24 + ldr r0, =0x00008888 + b _08082B26 + .pool +_08082B24: + ldr r0, =0x0000aaaa +_08082B26: + cmp r3, r0 + beq _08082B38 + ldr r2, =0x020322a4 + b _08082B48 + .pool +_08082B38: + ldr r2, =0x020322a4 + ldr r0, [r2] + adds r1, r0, 0 + adds r1, 0x6C + strh r3, [r1] + ldrh r1, [r4, 0x6] + adds r0, 0x6E + strh r1, [r0] +_08082B48: + ldr r0, [r2] + adds r0, 0x64 + ldr r1, =0x00001111 + b _08082B64 + .pool +_08082B58: + ldr r0, =0x00002222 + cmp r1, r0 + bne _08082B66 + ldr r0, =0x020322a4 + ldr r0, [r0] + adds r0, 0x64 +_08082B64: + strh r1, [r0] +_08082B66: + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + beq _08082B72 + b _08082CA4 +_08082B72: + ldr r2, =0x020322a4 + ldr r0, [r2] + adds r0, 0x64 + ldrh r1, [r0] + ldr r0, =0x00001111 + cmp r1, r0 + bne _08082B82 + b _08082CA4 +_08082B82: + ldr r0, =0x00002222 + cmp r1, r0 + bne _08082B8A + b _08082CA4 +_08082B8A: + movs r5, 0 + adds r7, r2, 0 + b _08082BF4 + .pool +_08082B9C: + ldr r6, =0x03003090 + lsls r4, r5, 4 + adds r0, r4, r6 + ldrh r0, [r0] + ldr r1, =0x00002fff + movs r2, 0xBC + lsls r2, 6 + bl sub_80814B0 + cmp r0, 0 + beq _08082BEE + adds r0, r6, 0x2 + adds r0, r4, r0 + ldrh r2, [r0] + ldr r0, =0x00008888 + cmp r2, r0 + beq _08082BE4 + cmp r2, r0 + bgt _08082BD8 + ldr r0, =0x00007779 + b _08082BE0 + .pool +_08082BD8: + ldr r0, =0x00009999 + cmp r2, r0 + beq _08082BE4 + ldr r0, =0x0000aaaa +_08082BE0: + cmp r2, r0 + bne _08082BEE +_08082BE4: + ldr r0, [r7] + lsls r1, r5, 1 + adds r0, 0x64 + adds r0, r1 + strh r2, [r0] +_08082BEE: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_08082BF4: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + bcc _08082B9C + movs r5, 0 + b _08082C12 + .pool +_08082C0C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_08082C12: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + bcs _08082C2E + ldr r0, =0x020322a4 + ldr r0, [r0] + lsls r1, r5, 1 + adds r0, 0x64 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + bne _08082C0C +_08082C2E: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + bne _08082CA4 + movs r5, 0 + ldr r4, =0x00007779 + b _08082C4E + .pool +_08082C48: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_08082C4E: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + bcs _08082C6A + ldr r0, =0x020322a4 + ldr r0, [r0] + lsls r1, r5, 1 + adds r0, 0x64 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r4 + beq _08082C48 +_08082C6A: + ldr r4, =0x03003110 + adds r0, r4, 0 + bl sub_8081F94 + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + bne _08082C90 + ldr r0, =0x00002222 + strh r0, [r4, 0x2] + b _08082CA4 + .pool +_08082C90: + ldr r0, =0x00001111 + strh r0, [r4, 0x2] + ldr r0, =0x020322a4 + ldr r0, [r0] + lsls r1, r5, 1 + adds r0, 0x64 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r4, 0x4] + strh r5, [r4, 0x6] +_08082CA4: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8082AD4 + + thumb_func_start sub_8082CB4 +sub_8082CB4: @ 8082CB4 + push {r4,lr} + sub sp, 0x14 + movs r1, 0xF0 + lsls r1, 7 + str r1, [sp] + movs r1, 0xA0 + lsls r1, 7 + str r1, [sp, 0x4] + mov r3, sp + ldr r1, =0x020322a4 + ldr r1, [r1] + mov r12, r1 + movs r1, 0x8E + lsls r1, 1 + add r1, r12 + ldrh r2, [r1] + movs r1, 0x78 + subs r1, r2 + strh r1, [r3, 0x8] + movs r1, 0x8F + lsls r1, 1 + add r1, r12 + ldrh r2, [r1] + movs r1, 0x50 + subs r1, r2 + strh r1, [r3, 0xA] + mov r2, sp + movs r3, 0x8D + lsls r3, 1 + add r3, r12 + ldrh r1, [r3] + strh r1, [r2, 0xC] + ldrh r1, [r3] + strh r1, [r2, 0xE] + mov r1, r12 + adds r1, 0x4A + ldrh r1, [r1] + strh r1, [r2, 0x10] + mov r1, sp + ldm r1!, {r2-r4} + stm r0!, {r2-r4} + ldm r1!, {r2,r3} + stm r0!, {r2,r3} + add sp, 0x14 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8082CB4 + + thumb_func_start sub_8082D18 +sub_8082D18: @ 8082D18 + ldr r0, =0x020322a4 + ldr r0, [r0] + adds r0, 0x4A + ldrh r0, [r0] + bx lr + .pool + thumb_func_end sub_8082D18 + + thumb_func_start sub_8082D28 +sub_8082D28: @ 8082D28 + push {r4,lr} + movs r1, 0 + ldr r4, =0x03003124 + ldrb r0, [r4] + cmp r0, 0 + beq _08082D3C + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r1, r0, 24 +_08082D3C: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08082DCC + ldrb r0, [r4] + cmp r0, 0 + beq _08082DCC + cmp r1, 0 + bne _08082D90 + ldr r0, =0x020322a4 + ldr r3, [r0] + adds r2, r3, 0 + adds r2, 0x4A + adds r0, r3, 0 + adds r0, 0x4C + ldrh r0, [r0] + ldrh r1, [r2] + adds r0, r1 + strh r0, [r2] + ldr r1, =0x03003110 + movs r4, 0x8B + lsls r4, 1 + adds r0, r3, r4 + ldrh r0, [r0] + strh r0, [r1, 0xA] + ldrh r0, [r2] + strh r0, [r1, 0xC] + movs r1, 0xA0 + lsls r1, 1 + adds r0, r3, r1 + bl sub_8082CB4 + b _08082DEA + .pool +_08082D90: + ldr r3, =0x03003090 + ldrh r0, [r3] + movs r1, 0xFF + lsls r1, 8 + ands r1, r0 + movs r0, 0x88 + lsls r0, 7 + cmp r1, r0 + bne _08082DEA + ldr r0, =0x020322a4 + ldr r2, [r0] + ldrh r0, [r3, 0xA] + movs r4, 0x8B + lsls r4, 1 + adds r1, r2, r4 + strh r0, [r1] + ldrh r0, [r3, 0xC] + adds r1, r2, 0 + adds r1, 0x4A + strh r0, [r1] + movs r1, 0xA0 + lsls r1, 1 + adds r0, r2, r1 + bl sub_8082CB4 + b _08082DEA + .pool +_08082DCC: + ldr r0, =0x020322a4 + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0x4A + adds r0, r1, 0 + adds r0, 0x4C + ldrh r0, [r0] + ldrh r3, [r2] + adds r0, r3 + strh r0, [r2] + movs r4, 0xA0 + lsls r4, 1 + adds r0, r1, r4 + bl sub_8082CB4 +_08082DEA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8082D28 + + thumb_func_start sub_8082DF4 +sub_8082DF4: @ 8082DF4 + push {r4-r6,lr} + ldr r4, =0x020322a4 + ldr r0, [r4] + movs r6, 0x8E + lsls r6, 1 + adds r0, r6 + ldrh r1, [r0] + movs r0, 0x14 + bl SetGpuReg + ldr r0, [r4] + movs r5, 0x8F + lsls r5, 1 + adds r0, r5 + ldrh r1, [r0] + movs r0, 0x16 + bl SetGpuReg + ldr r0, [r4] + adds r0, r6 + ldrh r1, [r0] + movs r0, 0x10 + bl SetGpuReg + ldr r0, [r4] + adds r0, r5 + ldrh r1, [r0] + movs r0, 0x12 + bl SetGpuReg + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8082DF4 + + thumb_func_start sub_8082E3C +sub_8082E3C: @ 8082E3C + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x2E] + ldrh r1, [r2, 0x32] + adds r0, r1 + strh r0, [r2, 0x32] + ldrh r0, [r2, 0x30] + ldrh r1, [r2, 0x34] + adds r0, r1 + strh r0, [r2, 0x34] + movs r1, 0x32 + ldrsh r0, [r2, r1] + cmp r0, 0 + bge _08082E5A + adds r0, 0x7 +_08082E5A: + asrs r0, 3 + strh r0, [r2, 0x24] + movs r1, 0x34 + ldrsh r0, [r2, r1] + cmp r0, 0 + bge _08082E68 + adds r0, 0x7 +_08082E68: + asrs r0, 3 + strh r0, [r2, 0x26] + adds r0, r2, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08082E80 + adds r0, r2, 0 + bl RemoveObjectAndFreeTiles +_08082E80: + pop {r0} + bx r0 + thumb_func_end sub_8082E3C + + thumb_func_start sub_8082E84 +sub_8082E84: @ 8082E84 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + bl GenerateRandomNumber + lsls r0, 16 + lsrs r1, r0, 16 + movs r0, 0x1 + ands r1, r0 + adds r0, r1, 0x1 + cmp r0, 0 + beq _08082F40 + ldr r0, =gUnknown_08329F40 + mov r9, r0 + ldr r2, =0x02020630 + mov r10, r2 + adds r6, r1, 0x1 + movs r3, 0x1F + mov r8, r3 + movs r7, 0x10 +_08082EB0: + bl GenerateRandomNumber + ldr r1, =0x020322a4 + ldr r4, [r1] + adds r4, 0x4A + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x14 + bl __umodsi3 + ldrh r1, [r4] + adds r1, r0 + lsls r1, 16 + movs r0, 0xFF + lsls r0, 16 + ands r0, r1 + lsrs r2, r0, 16 + adds r0, r2, 0 + adds r0, 0x40 + lsls r0, 1 + add r0, r9 + movs r3, 0 + ldrsh r1, [r0, r3] + cmp r1, 0 + bge _08082EE4 + adds r1, 0x3 +_08082EE4: + asrs r1, 2 + lsls r0, r2, 1 + add r0, r9 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + bge _08082EF4 + adds r0, 0x3 +_08082EF4: + asrs r2, r0, 2 + adds r1, 0x78 + adds r2, 0x50 + ldr r0, =gUnknown_08339BE0 + movs r3, 0x1 + bl AddObjectToFront + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl GenerateRandomNumber + lsls r5, r4, 4 + adds r5, r4 + lsls r5, 2 + mov r3, r10 + adds r4, r5, r3 + lsls r0, 16 + lsrs r0, 16 + mov r1, r8 + ands r0, r1 + subs r0, r7, r0 + strh r0, [r4, 0x2E] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + mov r2, r8 + ands r0, r2 + subs r0, r7, r0 + strh r0, [r4, 0x30] + ldr r3, =0x0202064c + adds r5, r3 + ldr r0, =sub_8082E3C + str r0, [r5] + subs r6, 0x1 + cmp r6, 0 + bne _08082EB0 +_08082F40: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8082E84 + + thumb_func_start sub_8082F68 +sub_8082F68: @ 8082F68 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r1, 0x3 + bl __divsi3 + negs r0, r0 + strh r0, [r4, 0x26] + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08082F94 + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_08082F94: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8082F68 + + thumb_func_start sub_8082F9C +sub_8082F9C: @ 8082F9C + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + movs r1, 0x2E + ldrsh r0, [r2, r1] + lsls r0, 1 + negs r0, r0 + strh r0, [r2, 0x26] + lsls r0, 16 + asrs r0, 16 + movs r1, 0xC + negs r1, r1 + cmp r0, r1 + bge _08082FC0 + ldr r0, =0x0000fff4 + strh r0, [r2, 0x26] +_08082FC0: + adds r0, r2, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08082FD4 + adds r0, r2, 0 + bl RemoveObjectAndFreeTiles +_08082FD4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8082F9C + + thumb_func_start sub_8082FDC +sub_8082FDC: @ 8082FDC + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + ldr r2, =0x020322a4 + ldr r3, [r2] + lsls r4, r0, 1 + adds r2, r3, 0 + adds r2, 0x74 + adds r2, r4 + strh r1, [r2] + lsls r0, 4 + movs r2, 0xAC + lsls r2, 1 + adds r0, r2 + adds r3, r0 + adds r0, r3, 0 + bl sub_807FE14 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8082FDC + + thumb_func_start sub_8083010 +sub_8083010: @ 8083010 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0808304C + cmp r0, 0x1 + bgt _08083026 + cmp r0, 0 + beq _0808302C + b _080830B2 +_08083026: + cmp r0, 0x2 + beq _08083066 + b _080830B2 +_0808302C: + ldrh r0, [r4, 0x30] + adds r0, 0x8 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x58 + ble _080830B2 + movs r0, 0x58 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r0, 0x38 + bl audio_play + b _080830B2 +_0808304C: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _080830B2 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r0, 0 + strh r0, [r4, 0x32] + b _080830B2 +_08083066: + ldrh r0, [r4, 0x30] + adds r0, 0x4 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB0 + ble _080830B2 + ldrh r0, [r4, 0x34] + adds r0, 0x1 + adds r1, r0, 0 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + bne _080830A0 + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + ldr r0, =gUnknown_08339C60 + movs r2, 0x14 + negs r2, r2 + movs r1, 0x78 + movs r3, 0x2 + bl AddObjectToFront + b _080830B2 + .pool +_080830A0: + movs r0, 0 + strh r0, [r4, 0x2E] + ldr r0, =0x0000fff0 + strh r0, [r4, 0x30] + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim +_080830B2: + ldrh r0, [r4, 0x30] + strh r0, [r4, 0x26] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8083010 + + thumb_func_start sub_80830C0 +sub_80830C0: @ 80830C0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080830FC + cmp r0, 0x1 + bgt _080830D6 + cmp r0, 0 + beq _080830DC + b _08083130 +_080830D6: + cmp r0, 0x2 + beq _08083112 + b _08083130 +_080830DC: + ldrh r0, [r4, 0x30] + adds r0, 0x8 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5C + ble _08083130 + movs r0, 0x5C + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r0, 0x15 + bl audio_play + b _08083130 +_080830FC: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _08083130 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _08083130 +_08083112: + ldrh r0, [r4, 0x30] + adds r0, 0x4 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB0 + ble _08083130 + ldr r0, =0x020322a4 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_08083130: + ldrh r0, [r4, 0x30] + strh r0, [r4, 0x26] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80830C0 + + thumb_func_start sub_8083140 +sub_8083140: @ 8083140 + push {lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r3, r1, 16 + ldr r1, =0x020322a4 + ldr r1, [r1] + movs r2, 0x8C + lsls r2, 1 + adds r1, r2 + ldrh r2, [r1] + cmp r2, r0 + bcs _08083166 + adds r0, r2, 0x2 + strh r0, [r1] + ldrh r0, [r1] + adds r1, r3, 0 + bl sub_8083170 +_08083166: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8083140 + + thumb_func_start sub_8083170 +sub_8083170: @ 8083170 + push {r4-r7,lr} + lsls r0, 16 + lsls r1, 16 + lsrs r1, 16 + ldr r7, =0x06006000 + lsrs r0, 10 + bl __divsi3 + adds r1, r0, 0 + cmp r1, 0 + bge _08083188 + adds r0, r1, 0x7 +_08083188: + asrs r4, r0, 3 + movs r3, 0 + cmp r3, r4 + bge _080831B0 + ldr r0, =0x000080e9 + adds r6, r0, 0 + adds r0, 0x10 + adds r5, r0, 0 + adds r2, r7, 0 + adds r2, 0x56 + adds r0, r7, 0 + adds r3, r4, 0 +_080831A0: + strh r6, [r0, 0x16] + strh r5, [r2] + adds r2, 0x2 + adds r0, 0x2 + subs r3, 0x1 + cmp r3, 0 + bne _080831A0 + adds r3, r4, 0 +_080831B0: + adds r0, r1, 0 + cmp r1, 0 + bge _080831B8 + adds r0, r1, 0x7 +_080831B8: + asrs r2, r0, 3 + lsls r0, r2, 3 + subs r2, r1, r0 + cmp r2, 0 + beq _080831D6 + lsls r0, r3, 1 + adds r0, r7 + ldr r4, =0xffff80e1 + adds r1, r2, r4 + strh r1, [r0, 0x16] + adds r0, 0x56 + adds r4, 0x10 + adds r1, r2, r4 + strh r1, [r0] + adds r3, 0x1 +_080831D6: + cmp r3, 0x7 + bgt _080831FA + ldr r0, =0x000080e1 + adds r4, r0, 0 + adds r0, 0x10 + adds r2, r0, 0 + lsls r1, r3, 1 + adds r0, r1, 0 + adds r0, 0x56 + adds r0, r7 + adds r1, r7 +_080831EC: + strh r4, [r1, 0x16] + strh r2, [r0] + adds r0, 0x2 + adds r1, 0x2 + adds r3, 0x1 + cmp r3, 0x7 + ble _080831EC +_080831FA: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8083170 + + thumb_func_start sub_8083210 +sub_8083210: @ 8083210 + push {lr} + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x00057e40 + muls r0, r1 + cmp r0, 0 + bge _08083222 + ldr r1, =0x0000ffff + adds r0, r1 +_08083222: + asrs r0, 16 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8083210 + + thumb_func_start sub_8083230 +sub_8083230: @ 8083230 + push {r4-r6,lr} + sub sp, 0x8 + lsls r0, 16 + lsrs r0, 16 + bl sub_8083210 + adds r5, r0, 0 + ldr r0, =0x020322a4 + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0x4E + ldrh r0, [r1] + cmp r0, r5 + bcs _0808324E + strh r5, [r1] +_0808324E: + movs r6, 0 +_08083250: + mov r0, sp + adds r4, r0, r6 + adds r0, r5, 0 + movs r1, 0xA + bl __umodsi3 + strb r0, [r4] + adds r0, r5, 0 + movs r1, 0xA + bl __udivsi3 + adds r5, r0, 0 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x4 + bls _08083250 + ldr r2, =0x06006458 + mov r0, sp + ldr r3, =0x00008072 + adds r1, r3, 0 + ldrb r0, [r0, 0x4] + adds r0, r1, r0 + strh r0, [r2] + adds r2, 0x2 + mov r0, sp + ldrb r0, [r0, 0x3] + adds r0, r1 + strh r0, [r2] + adds r2, 0x2 + mov r0, sp + ldrb r0, [r0, 0x2] + adds r0, r1 + strh r0, [r2] + adds r2, 0x4 + mov r0, sp + ldrb r0, [r0, 0x1] + adds r0, r1 + strh r0, [r2] + adds r2, 0x2 + mov r0, sp + ldrb r0, [r0] + adds r1, r0 + strh r1, [r2] + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8083230 + + thumb_func_start sub_80832BC +sub_80832BC: @ 80832BC + push {r4-r6,lr} + adds r6, r0, 0 + lsls r4, r1, 16 + lsrs r5, r4, 16 + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _080832E0 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + bl __umodsi3 + lsrs r1, r4, 17 + subs r0, r1 + strh r0, [r6] +_080832E0: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80832BC + + thumb_func_start sub_80832E8 +sub_80832E8: @ 80832E8 + push {lr} + adds r1, r0, 0 + ldrh r2, [r1] + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0 + bge _080832FA + adds r0, r2, 0x1 + strh r0, [r1] +_080832FA: + ldrh r2, [r1] + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0 + ble _08083308 + subs r0, r2, 0x1 + strh r0, [r1] +_08083308: + pop {r0} + bx r0 + thumb_func_end sub_80832E8 + + thumb_func_start sub_808330C +sub_808330C: @ 808330C + push {r4,lr} + ldr r4, =0x020322a4 + ldr r0, [r4] + movs r1, 0x8E + lsls r1, 1 + adds r0, r1 + bl sub_80832E8 + ldr r0, [r4] + movs r1, 0x8F + lsls r1, 1 + adds r0, r1 + bl sub_80832E8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808330C + + thumb_func_start sub_8083334 +sub_8083334: @ 8083334 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r1, 16 + movs r5, 0x8 + cmp r1, 0x9 + bhi _08083344 + movs r5, 0x10 +_08083344: + ldrh r0, [r4] + movs r2, 0 + ldrsh r1, [r4, r2] + cmp r1, 0 + bne _08083362 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + bl __modsi3 + lsrs r1, r5, 1 + subs r0, r1 + b _08083376 +_08083362: + cmp r1, 0 + bge _0808336A + adds r0, 0x1 + strh r0, [r4] +_0808336A: + ldrh r1, [r4] + movs r2, 0 + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _08083378 + subs r0, r1, 0x1 +_08083376: + strh r0, [r4] +_08083378: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8083334 + + thumb_func_start sub_8083380 +sub_8083380: @ 8083380 + push {r4,r5,lr} + ldr r5, =0x020322a4 + ldr r2, [r5] + movs r4, 0x84 + lsls r4, 1 + adds r0, r2, r4 + ldr r1, [r0] + cmp r1, 0 + bne _080833A0 + movs r3, 0x8E + lsls r3, 1 + adds r0, r2, r3 + strh r1, [r0] + adds r3, 0x2 + adds r0, r2, r3 + strh r1, [r0] +_080833A0: + ldr r0, [r5] + adds r2, r0, r4 + ldr r1, [r2] + adds r1, 0x1 + str r1, [r2] + movs r2, 0x8E + lsls r2, 1 + adds r0, r2 + lsls r1, 16 + lsrs r1, 16 + bl sub_8083334 + ldr r1, [r5] + movs r3, 0x8F + lsls r3, 1 + adds r0, r1, r3 + adds r1, r4 + ldrh r1, [r1] + bl sub_8083334 + ldr r2, [r5] + adds r0, r2, r4 + ldr r0, [r0] + cmp r0, 0x14 + beq _080833DC + movs r0, 0 + b _080833F0 + .pool +_080833DC: + movs r1, 0x8E + lsls r1, 1 + adds r0, r2, r1 + movs r1, 0 + strh r1, [r0] + movs r3, 0x8F + lsls r3, 1 + adds r0, r2, r3 + strh r1, [r0] + movs r0, 0x1 +_080833F0: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8083380 + + thumb_func_start sub_80833F8 +sub_80833F8: @ 80833F8 + ldr r1, =0x020322a4 + ldr r2, [r1] + movs r3, 0x8E + lsls r3, 1 + adds r1, r2, r3 + ldrh r1, [r1] + negs r1, r1 + strh r1, [r0, 0x24] + adds r3, 0x2 + adds r1, r2, r3 + ldrh r1, [r1] + negs r1, r1 + strh r1, [r0, 0x26] + bx lr + .pool + thumb_func_end sub_80833F8 + + thumb_func_start UpdateBerryBlenderRecord +@ void UpdateBerryBlenderRecord() +UpdateBerryBlenderRecord: @ 8083418 + push {lr} + ldr r0, =0x03005d8c + ldr r2, [r0] + ldr r0, =0x020322a4 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x7C + ldrb r0, [r0] + subs r0, 0x2 + lsls r0, 1 + ldr r3, =0x000009bc + adds r2, r3 + adds r2, r0 + adds r1, 0x4E + ldrh r1, [r1] + ldrh r0, [r2] + cmp r0, r1 + bcs _0808343E + strh r1, [r2] +_0808343E: + pop {r0} + bx r0 + .pool + thumb_func_end UpdateBerryBlenderRecord + + thumb_func_start berry_blender_related +berry_blender_related: @ 8083450 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4C + ldr r1, =0x020322a4 + ldr r0, [r1] + ldrb r0, [r0] + adds r4, r1, 0 + cmp r0, 0x6 + bls _0808346A + b _08083898 +_0808346A: + lsls r0, 2 + ldr r1, =_0808347C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0808347C: + .4byte _08083498 + .4byte _080834AE + .4byte _080834C8 + .4byte _08083518 + .4byte _08083790 + .4byte _080837A8 + .4byte _0808386C +_08083498: + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r4] + movs r1, 0x84 + lsls r1, 1 + adds r0, r1 + movs r1, 0x11 + str r1, [r0] + b _08083898 +_080834AE: + ldr r1, [r4] + movs r3, 0x84 + lsls r3, 1 + adds r2, r1, r3 + ldr r0, [r2] + subs r0, 0xA + str r0, [r2] + cmp r0, 0 + blt _080834C2 + b _08083898 +_080834C2: + movs r0, 0 + str r0, [r2] + b _08083854 +_080834C8: + ldr r1, [r4] + movs r0, 0x84 + lsls r0, 1 + adds r1, r0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + cmp r0, 0x14 + bgt _080834DC + b _08083898 +_080834DC: + movs r6, 0 +_080834DE: + ldr r4, =0x020322a4 + ldr r0, [r4] + adds r0, 0x46 + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x2 + bls _080834DE + ldr r1, [r4] + movs r3, 0x84 + lsls r3, 1 + adds r2, r1, r3 + movs r0, 0 + str r0, [r2] + b _08083854 + .pool +_08083518: + ldr r4, =gUnknown_083398F5 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xA8 + bl GetStringCenterAlignXOffset + lsls r2, r0, 24 + lsrs r2, 24 + movs r0, 0xFF + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + movs r0, 0x5 + adds r1, r4, 0 + movs r3, 0x1 + bl sub_80840D4 + ldr r1, =0x020322a4 + ldr r0, [r1] + adds r2, r0, 0 + adds r2, 0x7C + ldrb r0, [r2] + movs r3, 0x15 + mov r9, r3 + cmp r0, 0x4 + bne _08083550 + movs r0, 0x11 + mov r9, r0 +_08083550: + movs r6, 0 + mov r3, sp + adds r3, 0x10 + str r3, [sp, 0x48] + ldrb r2, [r2] + cmp r6, r2 + bcs _0808361A + adds r7, r1, 0 + movs r0, 0x3 + mov r10, r0 +_08083564: + ldr r0, [r7] + movs r2, 0x9E + lsls r2, 1 + adds r1, r0, r2 + adds r1, r6 + ldrb r5, [r1] + adds r0, 0x9F + adds r6, 0x1 + mov r8, r6 + mov r1, r8 + movs r2, 0 + movs r3, 0x1 + bl ConvertIntToDecimalString + ldr r0, [r7] + adds r0, 0x9F + ldr r1, =gUnknown_08339941 + bl AppendString + ldr r0, [r7] + adds r0, 0x9F + ldr r1, =gUnknown_085E8D5E + bl AppendString + ldr r0, [r7] + adds r0, 0x9F + lsls r4, r5, 3 + subs r4, r5 + lsls r4, 2 + ldr r3, =0x020229f0 + adds r1, r4, r3 + bl AppendString + ldr r1, [r7] + adds r1, 0x9F + mov r0, r9 + lsls r6, r0, 24 + lsrs r6, 24 + movs r2, 0xFF + str r2, [sp] + mov r3, r10 + str r3, [sp, 0x4] + movs r0, 0x5 + movs r2, 0x8 + adds r3, r6, 0 + bl sub_80840D4 + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0x9F + lsls r5, 4 + adds r5, r1 + movs r1, 0xAD + lsls r1, 1 + adds r5, r1 + adds r1, r5, 0 + bl CopyString + ldr r0, [r7] + adds r0, 0x9F + ldr r2, =0x020229e8 + adds r4, r2 + ldrb r1, [r4, 0x1A] + bl StopMusicWhileStringIsPrinted + ldr r0, [r7] + adds r0, 0x9F + ldr r1, =gUnknown_08339914 + bl AppendString + ldr r1, [r7] + adds r1, 0x9F + movs r3, 0xFF + str r3, [sp] + mov r0, r10 + str r0, [sp, 0x4] + movs r0, 0x5 + movs r2, 0x54 + adds r3, r6, 0 + bl sub_80840D4 + movs r1, 0x10 + add r9, r1 + mov r2, r8 + lsls r2, 16 + lsrs r6, r2, 16 + ldr r0, [r7] + adds r0, 0x7C + ldrb r0, [r0] + cmp r6, r0 + bcc _08083564 +_0808361A: + ldr r1, =gUnknown_0833992E + movs r3, 0xFF + mov r10, r3 + str r3, [sp] + movs r0, 0x3 + mov r9, r0 + str r0, [sp, 0x4] + movs r0, 0x5 + movs r2, 0 + movs r3, 0x51 + bl sub_80840D4 + ldr r6, =0x020322a4 + ldr r0, [r6] + adds r4, r0, 0 + adds r4, 0x9F + adds r0, 0x4E + ldrh r0, [r0] + movs r1, 0x64 + bl __udivsi3 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r0, [r6] + adds r0, 0x9F + ldr r1, =gUnknown_08339941 + bl AppendString + ldr r0, [r6] + adds r0, 0x4E + ldrh r0, [r0] + movs r1, 0x64 + bl __umodsi3 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x48] + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r0, [r6] + adds r0, 0x9F + ldr r1, [sp, 0x48] + bl AppendString + ldr r0, [r6] + adds r0, 0x9F + ldr r1, =gUnknown_0833993C + bl AppendString + ldr r1, [r6] + adds r1, 0x9F + movs r0, 0x1 + movs r2, 0xA8 + bl GetStringRightAlignXOffset + ldr r1, [r6] + adds r1, 0x9F + lsls r2, r0, 24 + lsrs r2, 24 + mov r3, r10 + str r3, [sp] + mov r0, r9 + str r0, [sp, 0x4] + movs r0, 0x5 + movs r3, 0x51 + bl sub_80840D4 + ldr r1, =gUnknown_0833991B + mov r2, r10 + str r2, [sp] + mov r3, r9 + str r3, [sp, 0x4] + movs r0, 0x5 + movs r2, 0 + movs r3, 0x61 + bl sub_80840D4 + ldr r5, [r6] + movs r1, 0x82 + lsls r1, 1 + adds r0, r5, r1 + ldr r0, [r0] + mov r8, r0 + movs r1, 0x3C + bl __udivsi3 + movs r1, 0x3C + bl __umodsi3 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + movs r1, 0xE1 + lsls r1, 4 + mov r0, r8 + bl __udivsi3 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r5, 0x9F + adds r0, r5, 0 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r0, [r6] + adds r0, 0x9F + ldr r1, =gUnknown_08339921 + bl AppendString + adds r1, r4, 0 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r0, [r6] + adds r0, 0x9F + ldr r1, =gUnknown_08339928 + bl AppendString + ldr r1, [r6] + adds r1, 0x9F + movs r0, 0x1 + movs r2, 0xA8 + bl GetStringRightAlignXOffset + ldr r1, [r6] + adds r1, 0x9F + lsls r2, r0, 24 + lsrs r2, 24 + mov r3, r10 + str r3, [sp] + mov r0, r9 + str r0, [sp, 0x4] + movs r0, 0x5 + movs r3, 0x61 + bl sub_80840D4 + ldr r1, [r6] + movs r3, 0x84 + lsls r3, 1 + adds r2, r1, r3 + movs r0, 0 + str r0, [r2] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r0, 0x5 + movs r1, 0x2 + bl CopyWindowToVram + b _08083898 + .pool +_08083790: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0808379E + b _08083898 +_0808379E: + ldr r1, [r4] + b _08083854 + .pool +_080837A8: + movs r0, 0x5 + movs r1, 0x1 + bl sub_8198070 + movs r6, 0 + add r7, sp, 0x40 + ldr r5, =0x020322a4 +_080837B6: + ldr r0, [r5] + lsls r2, r6, 1 + adds r0, 0x74 + adds r0, r2 + ldrh r1, [r0] + cmp r1, 0 + beq _080837CC + add r0, sp, 0x38 + adds r0, r2 + subs r1, 0x85 + strh r1, [r0] +_080837CC: + ldr r0, [r5] + adds r0, 0x8E + adds r0, r2 + ldrh r0, [r0] + cmp r0, 0xFF + beq _080837EA + lsls r4, r6, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram +_080837EA: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x3 + bls _080837B6 + bl sub_8081E20 + ldr r4, =0x020322a4 + ldr r3, [r4] + movs r1, 0xAC + lsls r1, 1 + adds r0, r3, r1 + adds r1, r3, 0 + adds r1, 0x7C + ldrb r2, [r1] + subs r1, 0x2E + ldrh r1, [r1] + str r1, [sp] + adds r1, r7, 0 + add r3, sp, 0x8 + bl sub_8081BE0 + ldr r1, [r4] + adds r1, 0x9F + adds r0, r7, 0 + bl sub_80838AC + ldr r1, [r4] + movs r2, 0xD4 + lsls r2, 1 + adds r1, r2 + adds r0, r7, 0 + bl sub_8083F94 + ldr r0, =sub_8083F3C + movs r1, 0x6 + bl AddTask + bl sub_80EECEC + ldr r0, =0x0203ce7c + ldrh r0, [r0] + movs r1, 0x1 + bl remove_item + adds r0, r7, 0 + bl sub_8136F2C + ldr r1, [r4] + ldr r3, =0x000011b8 + adds r2, r1, r3 + movs r0, 0 + strh r0, [r2] +_08083854: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08083898 + .pool +_0808386C: + ldr r4, [r4] + ldr r0, =0x000011b8 + adds r5, r4, r0 + adds r4, 0x9F + bl sav2_get_text_speed + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_808417C + cmp r0, 0 + beq _08083898 + bl UpdateBerryBlenderRecord + movs r0, 0x1 + b _0808389A + .pool +_08083898: + movs r0, 0 +_0808389A: + add sp, 0x4C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end berry_blender_related + + thumb_func_start sub_80838AC +sub_80838AC: @ 80838AC + push {r4-r6,lr} + sub sp, 0xC + adds r5, r0, 0 + adds r6, r1, 0 + movs r0, 0xFF + strb r0, [r6] + ldr r1, =gUnknown_085B262C + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r6, 0 + bl CopyString + ldr r1, =gUnknown_0833979D + adds r0, r6, 0 + bl AppendString + ldr r1, =gUnknown_08339943 + adds r0, r6, 0 + bl AppendString + adds r0, r5, 0 + bl sub_8136EA4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + bl sub_8136EDC + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r1, =gUnknown_0833994F + adds r0, r6, 0 + bl AppendString + mov r0, sp + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + adds r0, r6, 0 + mov r1, sp + bl AppendString + ldr r1, =gUnknown_0833995D + adds r0, r6, 0 + bl AppendString + mov r0, sp + adds r1, r5, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + adds r0, r6, 0 + mov r1, sp + bl AppendString + ldr r1, =gUnknown_08339970 + adds r0, r6, 0 + bl AppendString + ldr r1, =gUnknown_0833979B + adds r0, r6, 0 + bl AppendString + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80838AC + + thumb_func_start sub_808395C +sub_808395C: @ 808395C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r9, r0 + mov r12, r2 + lsls r1, 24 + lsrs r7, r1, 24 + movs r0, 0 + cmp r0, r7 + bge _080839A8 +_08083972: + movs r5, 0 + adds r1, r0, 0x1 + mov r8, r1 + cmp r5, r7 + bge _080839A2 + mov r1, r9 + adds r6, r1, r0 +_08083980: + ldrb r4, [r6] + lsls r1, r4, 2 + add r1, r12 + mov r0, r9 + adds r2, r0, r5 + ldrb r3, [r2] + lsls r0, r3, 2 + add r0, r12 + ldr r1, [r1] + ldr r0, [r0] + cmp r1, r0 + bls _0808399C + strb r3, [r6] + strb r4, [r2] +_0808399C: + adds r5, 0x1 + cmp r5, r7 + blt _08083980 +_080839A2: + mov r0, r8 + cmp r0, r7 + blt _08083972 +_080839A8: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_808395C + + thumb_func_start sub_80839B4 +sub_80839B4: @ 80839B4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + movs r5, 0 + ldr r2, =0x020322a4 + ldr r0, [r2] + adds r0, 0x7C + adds r1, r2, 0 + add r3, sp, 0x4 + mov r10, r3 + b _080839E4 + .pool +_080839D4: + mov r4, sp + adds r0, r4, r5 + strb r5, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [r2] + adds r0, 0x7C +_080839E4: + ldrb r0, [r0] + cmp r5, r0 + bcc _080839D4 + movs r5, 0 + ldr r0, [r1] + adds r1, r0, 0 + adds r1, 0x7C + ldrb r2, [r1] + cmp r5, r2 + bcs _08083A5E + mov r9, r10 + movs r3, 0x92 + lsls r3, 1 + adds r3, r0 + mov r8, r3 + mov r12, r1 + movs r4, 0x93 + lsls r4, 1 + adds r7, r0, r4 + movs r1, 0x94 + lsls r1, 1 + adds r6, r0, r1 +_08083A10: + lsls r4, r5, 2 + add r4, r9 + lsls r3, r5, 1 + adds r3, r5 + lsls r3, 1 + mov r2, r8 + adds r0, r2, r3 + ldrh r2, [r0] + lsls r0, r2, 5 + subs r0, r2 + lsls r1, r0, 6 + subs r1, r0 + lsls r1, 3 + adds r1, r2 + lsls r1, 6 + str r1, [r4] + adds r0, r7, r3 + ldrh r2, [r0] + lsls r0, r2, 5 + subs r0, r2 + lsls r0, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + str r1, [r4] + movs r0, 0xFA + lsls r0, 2 + adds r1, r0 + adds r3, r6, r3 + ldrh r0, [r3] + subs r1, r0 + str r1, [r4] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + mov r1, r12 + ldrb r1, [r1] + cmp r5, r1 + bcc _08083A10 +_08083A5E: + ldr r4, =0x020322a4 + ldr r0, [r4] + adds r0, 0x7C + ldrb r1, [r0] + mov r0, sp + mov r2, r10 + bl sub_808395C + movs r5, 0 + ldr r0, [r4] + adds r0, 0x7C + ldrb r0, [r0] + cmp r5, r0 + bcs _08083A9E + adds r2, r4, 0 + movs r3, 0x9E + lsls r3, 1 +_08083A80: + ldr r1, [r2] + adds r1, r3 + adds r1, r5 + mov r4, sp + adds r0, r4, r5 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [r2] + adds r0, 0x7C + ldrb r0, [r0] + cmp r5, r0 + bcc _08083A80 +_08083A9E: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _08083AB4 + movs r3, 0 + b _08083ABC + .pool +_08083AB4: + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r3, r0, 24 +_08083ABC: + movs r5, 0 + ldr r1, =0x020322a4 + ldr r0, [r1] + adds r0, 0x7C + ldrb r0, [r0] + cmp r5, r0 + bcs _08083AF2 + movs r6, 0x9E + lsls r6, 1 + movs r4, 0xD2 + lsls r4, 1 +_08083AD2: + ldr r2, [r1] + adds r0, r2, r6 + adds r0, r5 + ldrb r0, [r0] + cmp r0, r3 + bne _08083AE2 + adds r0, r2, r4 + strb r5, [r0] +_08083AE2: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [r1] + adds r0, 0x7C + ldrb r0, [r0] + cmp r5, r0 + bcc _08083AD2 +_08083AF2: + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80839B4 + + thumb_func_start sub_8083B08 +sub_8083B08: @ 8083B08 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + ldr r1, =0x020322a4 + ldr r0, [r1] + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0x6 + bls _08083B22 + b _08083E12 +_08083B22: + lsls r0, 2 + ldr r1, =_08083B34 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08083B34: + .4byte _08083B50 + .4byte _08083B66 + .4byte _08083B80 + .4byte _08083B9A + .4byte _08083DC8 + .4byte _08083DE2 + .4byte _08083E08 +_08083B50: + ldr r1, [r2] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r2] + movs r1, 0x84 + lsls r1, 1 + adds r0, r1 + movs r1, 0xFF + str r1, [r0] + b _08083E12 +_08083B66: + ldr r1, [r2] + movs r3, 0x84 + lsls r3, 1 + adds r2, r1, r3 + ldr r0, [r2] + subs r0, 0xA + str r0, [r2] + cmp r0, 0 + blt _08083B7A + b _08083E12 +_08083B7A: + movs r0, 0 + str r0, [r2] + b _08083DF8 +_08083B80: + ldr r1, [r2] + movs r0, 0x84 + lsls r0, 1 + adds r2, r1, r0 + ldr r0, [r2] + adds r0, 0x1 + str r0, [r2] + cmp r0, 0x14 + bgt _08083B94 + b _08083E12 +_08083B94: + movs r0, 0 + str r0, [r2] + b _08083DF8 +_08083B9A: + movs r0, 0x5 + movs r1, 0 + movs r2, 0x1 + movs r3, 0xD + bl SetWindowBorderStyle + ldr r4, =gUnknown_08339947 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xA8 + bl GetStringCenterAlignXOffset + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0xFF + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + movs r0, 0x5 + adds r1, r4, 0 + movs r3, 0x1 + bl sub_80840D4 + ldr r1, =gUnknown_08339B40 + mov r8, r1 + mov r0, r8 + movs r1, 0x80 + movs r2, 0x34 + movs r3, 0 + bl AddObjectToFront + ldr r7, =0x020322a4 + ldr r1, [r7] + adds r1, 0x46 + strb r0, [r1] + ldr r0, [r7] + adds r0, 0x46 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r6, =0x02020630 + adds r0, r6 + movs r1, 0x3 + bl StartObjectImageAnim + ldr r0, [r7] + adds r0, 0x46 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r5, r6, 0 + adds r5, 0x1C + adds r0, r5 + ldr r4, =DummyObjectCallback + str r4, [r0] + mov r0, r8 + movs r1, 0xA0 + movs r2, 0x34 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r7] + adds r1, 0x47 + strb r0, [r1] + ldr r0, [r7] + adds r0, 0x47 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + str r4, [r0] + mov r0, r8 + movs r1, 0xC0 + movs r2, 0x34 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r7] + adds r1, 0x48 + strb r0, [r1] + ldr r0, [r7] + adds r0, 0x48 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x1 + bl StartObjectImageAnim + ldr r0, [r7] + adds r0, 0x48 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + str r4, [r0] + bl sub_80839B4 + movs r2, 0x29 + str r2, [sp, 0x8] + movs r2, 0 + ldr r0, [r7] + adds r0, 0x7C + ldrb r0, [r0] + cmp r2, r0 + bcc _08083C7C + b _08083D8A +_08083C7C: + movs r3, 0xFF + mov r10, r3 + movs r0, 0x3 + mov r9, r0 +_08083C84: + ldr r0, [r7] + movs r3, 0x9E + lsls r3, 1 + adds r1, r0, r3 + adds r1, r2 + ldrb r5, [r1] + adds r0, 0x9F + adds r2, 0x1 + mov r8, r2 + mov r1, r8 + movs r2, 0 + movs r3, 0x1 + bl ConvertIntToDecimalString + ldr r0, [r7] + adds r0, 0x9F + ldr r1, =gUnknown_08339941 + bl AppendString + ldr r0, [r7] + adds r0, 0x9F + ldr r1, =gUnknown_085E8D5E + bl AppendString + ldr r0, [r7] + adds r0, 0x9F + lsls r1, r5, 3 + subs r1, r5 + lsls r1, 2 + ldr r2, =0x020229f0 + adds r1, r2 + bl AppendString + ldr r1, [r7] + adds r1, 0x9F + ldr r0, [sp, 0x8] + lsls r6, r0, 24 + lsrs r6, 24 + mov r2, r10 + str r2, [sp] + mov r3, r9 + str r3, [sp, 0x4] + movs r0, 0x5 + movs r2, 0 + adds r3, r6, 0 + bl sub_80840D4 + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0x9F + lsls r4, r5, 1 + adds r4, r5 + lsls r4, 1 + movs r2, 0x92 + lsls r2, 1 + adds r1, r2 + adds r1, r4 + ldrh r1, [r1] + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r1, [r7] + adds r1, 0x9F + mov r3, r10 + str r3, [sp] + mov r0, r9 + str r0, [sp, 0x4] + movs r0, 0x5 + movs r2, 0x4E + adds r3, r6, 0 + bl sub_80840D4 + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0x9F + movs r2, 0x93 + lsls r2, 1 + adds r1, r2 + adds r1, r4 + ldrh r1, [r1] + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r1, [r7] + adds r1, 0x9F + mov r3, r10 + str r3, [sp] + mov r0, r9 + str r0, [sp, 0x4] + movs r0, 0x5 + movs r2, 0x6E + adds r3, r6, 0 + bl sub_80840D4 + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0x9F + movs r2, 0x94 + lsls r2, 1 + adds r1, r2 + adds r1, r4 + ldrh r1, [r1] + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r1, [r7] + adds r1, 0x9F + mov r3, r10 + str r3, [sp] + mov r0, r9 + str r0, [sp, 0x4] + movs r0, 0x5 + movs r2, 0x8E + adds r3, r6, 0 + bl sub_80840D4 + ldr r1, [sp, 0x8] + adds r1, 0x10 + str r1, [sp, 0x8] + mov r2, r8 + lsls r2, 16 + lsrs r2, 16 + ldr r0, [r7] + adds r0, 0x7C + ldrb r0, [r0] + cmp r2, r0 + bcs _08083D8A + b _08083C84 +_08083D8A: + movs r0, 0x5 + bl PutWindowTilemap + movs r0, 0x5 + movs r1, 0x3 + bl CopyWindowToVram + ldr r0, =0x020322a4 + ldr r1, [r0] + movs r3, 0x84 + lsls r3, 1 + adds r2, r1, r3 + movs r0, 0 + str r0, [r2] + b _08083DF8 + .pool +_08083DC8: + ldr r2, [r2] + movs r0, 0x84 + lsls r0, 1 + adds r1, r2, r0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + cmp r0, 0x14 + ble _08083E12 + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + b _08083E12 +_08083DE2: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08083E12 + movs r0, 0x5 + bl audio_play + ldr r0, =0x020322a4 + ldr r1, [r0] +_08083DF8: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08083E12 + .pool +_08083E08: + ldr r1, [r2] + movs r0, 0 + strb r0, [r1] + movs r0, 0x1 + b _08083E14 +_08083E12: + movs r0, 0 +_08083E14: + 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_8083B08 + + thumb_func_start ShowBerryBlenderRecordWindow +ShowBerryBlenderRecordWindow: @ 8083E24 + push {r4-r7,lr} + sub sp, 0x34 + ldr r0, =gUnknown_08339D14 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x2C] + str r1, [sp, 0x30] + ldr r5, =0x0203ab74 + add r0, sp, 0x2C + bl AddWindow + strb r0, [r5] + ldrb r0, [r5] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r5] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r6, =gUnknown_085EE44F + movs r0, 0x1 + adds r1, r6, 0 + movs r2, 0x90 + bl GetStringCenterAlignXOffset + adds r3, r0, 0 + ldrb r0, [r5] + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x1 + str r1, [sp] + movs r4, 0 + str r4, [sp, 0x4] + str r4, [sp, 0x8] + adds r2, r6, 0 + bl Print + ldrb r0, [r5] + ldr r2, =gUnknown_085EE473 + movs r1, 0x29 + str r1, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x4 + bl Print + movs r6, 0 + movs r7, 0xA4 + lsls r7, 22 +_08083E8A: + ldr r0, =0x03005d8c + ldr r0, [r0] + lsls r1, r6, 1 + ldr r2, =0x000009bc + adds r0, r2 + adds r0, r1 + ldrh r4, [r0] + adds r0, r4, 0 + movs r1, 0x64 + bl __udivsi3 + adds r1, r0, 0 + add r0, sp, 0xC + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + adds r5, r0, 0 + ldr r1, =gUnknown_08339941 + bl AppendString + adds r5, r0, 0 + adds r0, r4, 0 + movs r1, 0x64 + bl __umodsi3 + adds r1, r0, 0 + adds r0, r5, 0 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalString + adds r5, r0, 0 + ldr r1, =gUnknown_0833993C + bl AppendString + movs r0, 0x1 + add r1, sp, 0xC + movs r2, 0x8C + bl GetStringRightAlignXOffset + adds r3, r0, 0 + ldr r4, =0x0203ab74 + ldrb r0, [r4] + lsls r3, 24 + lsrs r3, 24 + lsrs r1, r7, 24 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x1 + add r2, sp, 0xC + bl Print + movs r0, 0x80 + lsls r0, 21 + adds r7, r0 + adds r6, 0x1 + cmp r6, 0x2 + ble _08083E8A + ldrb r0, [r4] + bl PutWindowTilemap + ldrb r0, [r4] + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0x34 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end ShowBerryBlenderRecordWindow + + thumb_func_start sub_8083F3C +sub_8083F3C: @ 8083F3C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08083F62 + ldr r0, =0x0000016f + bl fanfare_play + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_08083F62: + bl task_is_not_running_overworld_fanfare + lsls r0, 24 + cmp r0, 0 + beq _08083F82 + ldr r0, =0x020322a4 + ldr r0, [r0] + movs r1, 0xAA + lsls r1, 1 + adds r0, r1 + ldrh r0, [r0] + bl song_play_for_text + adds r0, r5, 0 + bl remove_task +_08083F82: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8083F3C + + thumb_func_start sub_8083F94 +sub_8083F94: @ 8083F94 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + adds r6, r0, 0 + adds r7, r1, 0 + bl sub_8136EA4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + bl sub_8136EDC + adds r1, r0, 0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 1 + lsls r1, 24 + lsrs r1, 24 + bl __divsi3 + lsls r0, 16 + lsrs r3, r0, 16 + strb r3, [r7, 0xD] + ldrb r0, [r6] + strb r0, [r7, 0xC] + movs r0, 0xFF + strb r0, [r7] + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _080840C4 + ldr r0, =0x020322a4 + ldr r2, [r0] + movs r4, 0xD2 + lsls r4, 1 + adds r1, r2, r4 + ldrb r1, [r1] + mov r8, r0 + cmp r1, 0 + bne _08084058 + cmp r3, 0x14 + bls _08084058 + adds r0, r2, 0 + adds r0, 0x7C + ldrb r1, [r0] + subs r1, 0x1 + movs r0, 0x9E + lsls r0, 1 + mov r9, r0 + adds r0, r2, r0 + adds r0, r1 + ldrb r0, [r0] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r5, =0x020229f0 + adds r1, r5 + adds r0, r7, 0 + bl CopyString + adds r0, r6, 0 + bl sub_81370B4 + strb r0, [r7, 0xB] + ldrb r1, [r7, 0xB] + ldrb r2, [r7, 0xC] + ldrb r3, [r7, 0xD] + mov r6, r8 + ldr r4, [r6] + adds r0, r4, 0 + adds r0, 0x7C + ldrb r0, [r0] + subs r0, 0x1 + add r4, r9 + adds r4, r0 + ldrb r4, [r4] + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r5, r0 + ldrb r0, [r5, 0x12] + str r0, [sp] + adds r0, r7, 0 + bl sub_80ECC04 + lsls r0, 24 + cmp r0, 0 + bne _080840BA + b _080840C4 + .pool +_08084058: + mov r0, r8 + ldr r2, [r0] + movs r1, 0xD2 + lsls r1, 1 + adds r0, r2, r1 + ldrb r1, [r0] + adds r0, r2, 0 + adds r0, 0x7C + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bne _080840C4 + cmp r3, 0x14 + bhi _080840C4 + movs r4, 0x9E + lsls r4, 1 + adds r0, r2, r4 + ldrb r0, [r0] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r5, =0x020229f0 + adds r1, r5 + adds r0, r7, 0 + bl CopyString + adds r0, r6, 0 + bl sub_81370B4 + strb r0, [r7, 0xB] + ldrb r1, [r7, 0xB] + ldrb r2, [r7, 0xC] + ldrb r3, [r7, 0xD] + mov r6, r8 + ldr r0, [r6] + adds r0, r4 + ldrb r4, [r0] + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r5, r0 + ldrb r0, [r5, 0x12] + str r0, [sp] + adds r0, r7, 0 + bl sub_80ECC04 + lsls r0, 24 + cmp r0, 0 + beq _080840C4 +_080840BA: + movs r0, 0x1 + b _080840C6 + .pool +_080840C4: + movs r0, 0 +_080840C6: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8083F94 + + thumb_func_start sub_80840D4 +sub_80840D4: @ 80840D4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x18 + mov r9, r1 + ldr r4, [sp, 0x38] + lsls r0, 24 + lsrs r6, r0, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r7, r3, 24 + movs r5, 0 + cmp r4, 0x1 + beq _08084116 + cmp r4, 0x1 + bgt _08084100 + cmp r4, 0 + beq _08084108 + b _08084132 +_08084100: + cmp r4, 0x2 + beq _08084124 + cmp r4, 0x3 + bne _08084136 +_08084108: + add r1, sp, 0x14 + movs r0, 0x1 + strb r0, [r1] + movs r0, 0x2 + strb r0, [r1, 0x1] + movs r0, 0x3 + b _08084130 +_08084116: + add r0, sp, 0x14 + strb r5, [r0] + adds r1, r0, 0 + movs r0, 0x2 + strb r0, [r1, 0x1] + movs r0, 0x3 + b _08084130 +_08084124: + add r0, sp, 0x14 + strb r5, [r0] + adds r1, r0, 0 + movs r0, 0x4 + strb r0, [r1, 0x1] + movs r0, 0x5 +_08084130: + strb r0, [r1, 0x2] +_08084132: + cmp r4, 0x3 + beq _08084148 +_08084136: + add r0, sp, 0x14 + ldrb r0, [r0] + lsls r1, r0, 4 + orrs r1, r0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + bl FillWindowPixelBuffer +_08084148: + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + add r0, sp, 0x14 + str r0, [sp, 0x8] + ldr r0, [sp, 0x34] + lsls r0, 24 + asrs r0, 24 + str r0, [sp, 0xC] + mov r0, r9 + str r0, [sp, 0x10] + adds r0, r6, 0 + movs r1, 0x1 + mov r2, r8 + adds r3, r7, 0 + bl AddTextPrinterParametrized2 + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80840D4 + + thumb_func_start sub_808417C +sub_808417C: @ 808417C + push {r4-r7,lr} + sub sp, 0x8 + adds r5, r0, 0 + adds r7, r1, 0 + adds r6, r2, 0 + movs r0, 0 + ldrsh r4, [r5, r0] + cmp r4, 0 + beq _08084194 + cmp r4, 0x1 + beq _080841C6 + b _080841DA +_08084194: + movs r0, 0x4 + movs r1, 0 + movs r2, 0x14 + movs r3, 0xF + bl sub_8197B1C + str r6, [sp] + str r4, [sp, 0x4] + movs r0, 0x4 + adds r1, r7, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_80840D4 + movs r0, 0x4 + bl PutWindowTilemap + movs r0, 0x4 + movs r1, 0x3 + bl CopyWindowToVram + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + b _080841DA +_080841C6: + movs r0, 0x4 + bl IsTextPrinterActive + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _080841DA + strh r0, [r5] + movs r0, 0x1 + b _080841DC +_080841DA: + movs r0, 0 +_080841DC: + add sp, 0x8 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808417C + + thumb_func_start reset_playtime +reset_playtime: @ 80841E4 + ldr r1, =0x03000e08 + movs r0, 0 + strb r0, [r1] + ldr r2, =0x03005d90 + ldr r3, [r2] + movs r1, 0 + movs r0, 0 + strh r0, [r3, 0xE] + strb r1, [r3, 0x10] + ldr r0, [r2] + strb r1, [r0, 0x11] + ldr r0, [r2] + strb r1, [r0, 0x12] + bx lr + .pool + thumb_func_end reset_playtime + + thumb_func_start set_max_playtime_if_appropriate +set_max_playtime_if_appropriate: @ 8084208 + push {lr} + ldr r1, =0x03000e08 + movs r0, 0x1 + strb r0, [r1] + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrh r1, [r0, 0xE] + ldr r0, =0x000003e7 + cmp r1, r0 + bls _08084220 + bl set_max_playtime +_08084220: + pop {r0} + bx r0 + .pool + thumb_func_end set_max_playtime_if_appropriate + + thumb_func_start sub_8084230 +sub_8084230: @ 8084230 + ldr r1, =0x03000e08 + movs r0, 0 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_8084230 + + thumb_func_start gametime_increment +gametime_increment: @ 808423C + push {lr} + ldr r0, =0x03000e08 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08084294 + ldr r2, =0x03005d90 + ldr r0, [r2] + ldrb r1, [r0, 0x12] + adds r1, 0x1 + movs r3, 0 + strb r1, [r0, 0x12] + ldr r1, [r2] + ldrb r0, [r1, 0x12] + cmp r0, 0x3B + bls _08084294 + strb r3, [r1, 0x12] + ldr r0, [r2] + ldrb r1, [r0, 0x11] + adds r1, 0x1 + strb r1, [r0, 0x11] + ldr r1, [r2] + ldrb r0, [r1, 0x11] + cmp r0, 0x3B + bls _08084294 + strb r3, [r1, 0x11] + ldr r0, [r2] + ldrb r1, [r0, 0x10] + adds r1, 0x1 + strb r1, [r0, 0x10] + ldr r1, [r2] + ldrb r0, [r1, 0x10] + cmp r0, 0x3B + bls _08084294 + strb r3, [r1, 0x10] + ldr r0, [r2] + ldrh r1, [r0, 0xE] + adds r1, 0x1 + strh r1, [r0, 0xE] + lsls r1, 16 + ldr r0, =0x03e70000 + cmp r1, r0 + bls _08084294 + bl set_max_playtime +_08084294: + pop {r0} + bx r0 + .pool + thumb_func_end gametime_increment + + thumb_func_start set_max_playtime +set_max_playtime: @ 80842A4 + ldr r1, =0x03000e08 + movs r0, 0x2 + strb r0, [r1] + ldr r2, =0x03005d90 + ldr r3, [r2] + ldr r0, =0x000003e7 + strh r0, [r3, 0xE] + movs r1, 0x3B + strb r1, [r3, 0x10] + ldr r0, [r2] + strb r1, [r0, 0x11] + ldr r0, [r2] + strb r1, [r0, 0x12] + bx lr + .pool + thumb_func_end set_max_playtime + + thumb_func_start write_word_to_mem +@ void write_word_to_mem(int value, int *mem) +write_word_to_mem: @ 80842CC + strb r0, [r1] + lsrs r2, r0, 8 + strb r2, [r1, 0x1] + lsrs r2, r0, 16 + strb r2, [r1, 0x2] + lsrs r0, 24 + strb r0, [r1, 0x3] + bx lr + thumb_func_end write_word_to_mem + + thumb_func_start sub_80842DC +sub_80842DC: @ 80842DC + adds r2, r0, 0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + ldrb r1, [r2, 0x2] + lsls r1, 16 + orrs r0, r1 + ldrb r1, [r2, 0x1] + lsls r1, 8 + orrs r0, r1 + ldrb r1, [r2] + orrs r0, r1 + bx lr + thumb_func_end sub_80842DC + + thumb_func_start sub_80842F4 +sub_80842F4: @ 80842F4 + push {r4,lr} + adds r4, r0, 0 + adds r3, r1, 0 + movs r2, 0 +_080842FC: + adds r0, r4, r2 + adds r1, r3, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x3 + ble _080842FC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80842F4 + + thumb_func_start set_player_trainer_id +set_player_trainer_id: @ 8084310 + push {r4,lr} + bl GenerateRandomNumber + adds r4, r0, 0 + bl GetTrainerId + lsls r4, 16 + lsls r0, 16 + lsrs r0, 16 + orrs r4, r0 + ldr r0, =0x03005d90 + ldr r1, [r0] + adds r1, 0xA + adds r0, r4, 0 + bl write_word_to_mem + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end set_player_trainer_id + + thumb_func_start init_options +init_options: @ 808433C + ldr r3, =0x03005d90 + ldr r2, [r3] + ldrb r1, [r2, 0x14] + movs r0, 0x8 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x14] + ldr r2, [r3] + ldrb r1, [r2, 0x14] + movs r0, 0x7 + ands r0, r1 + strb r0, [r2, 0x14] + ldr r2, [r3] + ldrb r1, [r2, 0x15] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x15] + ldr r2, [r3] + ldrb r1, [r2, 0x15] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x15] + ldr r2, [r3] + ldrb r1, [r2, 0x15] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x15] + ldr r2, [r3] + ldrb r1, [r2, 0x15] + movs r0, 0x9 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x15] + bx lr + .pool + thumb_func_end init_options + + thumb_func_start sub_8084390 +sub_8084390: @ 8084390 + push {r4,lr} + ldr r1, =0x030060b0 + movs r0, 0 + strb r0, [r1] + ldr r4, =0x03005d90 + ldr r0, [r4] + adds r0, 0x28 + movs r1, 0 + movs r2, 0x34 + bl memset + ldr r0, [r4] + adds r0, 0x5C + movs r1, 0 + movs r2, 0x34 + bl memset + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8084390 + + thumb_func_start sub_80843C0 +sub_80843C0: @ 80843C0 + push {r4-r7,lr} + bl sub_80DF040 + movs r2, 0x8 + ldr r0, =0x03005d8c + mov r12, r0 + ldr r4, =0x00002e90 + ldr r3, =gUnknown_08339D1C +_080843D0: + mov r1, r12 + ldr r0, [r1] + lsls r1, r2, 5 + adds r0, r1 + adds r0, r4 + adds r1, r3, 0 + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldm r1!, {r5,r6} + stm r0!, {r5,r6} + adds r2, 0x1 + cmp r2, 0xC + ble _080843D0 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80843C0 + + thumb_func_start sub_8084400 +sub_8084400: @ 8084400 + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + ldr r4, =0x03005d90 + ldr r1, [r4] + ldr r0, =0x0000064c + adds r1, r0 + ldr r2, =0x05000238 + mov r0, sp + bl CpuSet + ldr r0, [r4] + ldr r1, =0x00000ee1 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r4] + ldr r1, =0x00000ee9 + adds r0, r1 + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8084400 + + thumb_func_start sub_808444C +sub_808444C: @ 808444C + push {lr} + sub sp, 0x4 + movs r3, 0x1 + negs r3, r3 + str r3, [sp] + movs r0, 0x19 + movs r1, 0x28 + adds r2, r3, 0 + bl warp1_set + bl warp_in + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_808444C + + thumb_func_start init_sav2 +init_sav2: @ 808446C + push {lr} + bl memclr_stdsav2 + bl init_options + pop {r0} + bx r0 + thumb_func_end init_sav2 + + thumb_func_start sub_808447C +sub_808447C: @ 808447C + push {lr} + ldr r1, =0x020322d4 + movs r0, 0 + strb r0, [r1] + bl sub_80BB358 + bl zero_player_party_data + bl zero_enemy_party_data + bl sub_81AAB70 + bl sub_813624C + pop {r0} + bx r0 + .pool + thumb_func_end sub_808447C + + thumb_func_start NewGameInitData +@ void NewGameInitData() +NewGameInitData: @ 80844A0 + push {r4,r5,lr} + ldr r0, =0x03006210 + ldrh r0, [r0] + cmp r0, 0 + beq _080844AE + cmp r0, 0x2 + bne _080844B2 +_080844AE: + bl GameFreakRTC_Reset +_080844B2: + ldr r1, =0x020322d4 + movs r0, 0x1 + strb r0, [r1] + ldr r4, =0x03005d90 + ldr r0, [r4] + adds r0, 0xAC + movs r5, 0 + str r5, [r0] + bl zero_player_party_data + bl zero_enemy_party_data + bl sub_80BB2D0 + bl sub_8084400 + bl clear_sav1 + bl sub_80D436C + ldr r0, [r4] + strb r5, [r0, 0x9] + ldr r0, [r4] + adds r0, 0xA8 + str r5, [r0] + bl set_player_trainer_id + bl reset_playtime + bl sub_8084390 + bl sub_809D300 + bl sub_80EBEE0 + bl GabbyAndTyNewGameInitData + bl sub_80E8B28 + bl RemoveAllBerryTrees + ldr r4, =0x03005d8c + ldr r0, [r4] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + ldr r1, =0x00000bb8 + bl EncryptMoney + movs r0, 0 + bl SetCoins + bl sub_80D766C + bl sub_80847A8 + bl sub_80843C0 + bl sub_813C1F8 + bl sub_80F9A7C + bl sub_80F9AD4 + ldr r0, =0x020244e9 + strb r5, [r0] + bl zero_player_party_data + bl sub_80C7770 + bl sub_8161B34 + bl sub_8161B60 + ldr r0, [r4] + ldr r1, =0x00000496 + adds r0, r1 + strh r5, [r0] + bl sub_80D7094 + bl sub_816ADF4 + bl sub_8136E88 + bl sub_81618B4 + bl sub_811F184 + bl sub_8120160 + bl sub_81224D4 + bl sub_813BA10 + bl sub_8177558 + bl sub_808444C + ldr r0, =gUnknown_082715DE + bl script_env_2_execute_new_script + bl sub_80845CC + bl copy_strings_to_sav1 + bl sub_818DA30 + bl sub_819FAA0 + bl sub_81A4B14 + bl sub_8195E10 + bl sub_801AFD8 + bl sub_800E5AC + bl sub_81D54BC + bl sub_80DED74 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end NewGameInitData + + thumb_func_start sub_80845CC +sub_80845CC: @ 80845CC + push {r4-r6,lr} + sub sp, 0x4 + mov r0, sp + movs r5, 0 + strh r5, [r0] + ldr r4, =0x03005d90 + ldr r1, [r4] + movs r0, 0xF6 + lsls r0, 1 + adds r1, r0 + ldr r6, =0x01000008 + mov r0, sp + adds r2, r6, 0 + bl CpuSet + ldr r0, [r4] + movs r1, 0xFA + lsls r1, 1 + adds r0, r1 + movs r1, 0 + bl sub_802467C + bl sub_802E33C + mov r0, sp + adds r0, 0x2 + strh r5, [r0] + ldr r1, [r4] + movs r2, 0x83 + lsls r2, 2 + adds r1, r2 + adds r2, r6, 0 + bl CpuSet + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80845CC + + thumb_func_start sub_8084620 +sub_8084620: @ 8084620 + push {r4,lr} + ldr r0, =gUnknown_08271857 + bl script_env_2_execute_new_script + ldr r0, =0x03005d8c + ldr r4, [r0] + movs r0, 0x92 + lsls r0, 3 + adds r4, r0 + adds r0, r4, 0 + bl DecryptMoney + adds r1, r0, 0 + lsrs r1, 1 + adds r0, r4, 0 + bl EncryptMoney + bl sp000_heal_pokemon + bl sub_8084720 + bl copy_saved_warp3_bank_and_enter_x_to_warp1 + bl warp_in + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8084620 + + thumb_func_start flag_var_implications_of_teleport_ +flag_var_implications_of_teleport_: @ 8084660 + push {lr} + bl player_avatar_init_params_reset + ldr r0, =0x0000088b + bl FlagReset + ldr r0, =0x0000088d + bl FlagReset + ldr r0, =0x0000088c + bl FlagReset + ldr r0, =0x00000889 + bl FlagReset + ldr r0, =0x00000888 + bl FlagReset + pop {r0} + bx r0 + .pool + thumb_func_end flag_var_implications_of_teleport_ + + thumb_func_start sub_808469C +sub_808469C: @ 808469C + push {lr} + bl player_avatar_init_params_reset + ldr r0, =0x0000088b + bl FlagReset + ldr r0, =0x0000088d + bl FlagReset + ldr r0, =0x0000088c + bl FlagReset + ldr r0, =0x00000889 + bl FlagReset + ldr r0, =0x00000888 + bl FlagReset + ldr r0, =gUnknown_08271862 + bl script_env_2_execute_new_script + pop {r0} + bx r0 + .pool + thumb_func_end sub_808469C + + thumb_func_start flagmods_08054D70 +flagmods_08054D70: @ 80846E4 + push {lr} + bl player_avatar_init_params_reset + ldr r0, =0x0000088b + bl FlagReset + ldr r0, =0x0000088d + bl FlagReset + ldr r0, =0x0000088c + bl FlagReset + ldr r0, =0x00000889 + bl FlagReset + ldr r0, =0x00000888 + bl FlagReset + pop {r0} + bx r0 + .pool + thumb_func_end flagmods_08054D70 + + thumb_func_start sub_8084720 +sub_8084720: @ 8084720 + push {r4,lr} + bl player_avatar_init_params_reset + ldr r0, =0x0000088b + bl FlagReset + ldr r0, =0x0000088d + bl FlagReset + ldr r0, =0x0000088c + bl FlagReset + ldr r0, =0x00000889 + bl FlagReset + ldr r0, =0x00000888 + bl FlagReset + ldr r4, =0x00004039 + adds r0, r4, 0 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bne _08084764 + adds r0, r4, 0 + movs r1, 0 + bl VarSet + ldr r0, =0x00004037 + movs r1, 0 + bl VarSet +_08084764: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8084720 + + thumb_func_start sub_8084788 +sub_8084788: @ 8084788 + push {lr} + ldr r0, =0x0000088c + bl FlagReset + bl sub_8085B2C + bl wild_pokemon_reroll + bl mapnumbers_history_shift_sav1_0_2_4_out + bl sub_8161D00 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8084788 + + thumb_func_start sub_80847A8 +sub_80847A8: @ 80847A8 + push {r4,lr} + movs r4, 0 +_080847AC: + lsls r0, r4, 24 + lsrs r0, 24 + movs r1, 0 + bl sav12_xor_set + adds r4, 0x1 + cmp r4, 0x3F + ble _080847AC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80847A8 + + thumb_func_start sav12_xor_increment +@ void sav12_xor_increment(u8 a1) +sav12_xor_increment: @ 80847C4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x33 + bhi _080847EC + adds r0, r4, 0 + bl sub_80847F8 + adds r1, r0, 0 + ldr r0, =0x00fffffe + cmp r1, r0 + bhi _080847E4 + adds r1, 0x1 + b _080847E6 + .pool +_080847E4: + ldr r1, =0x00ffffff +_080847E6: + adds r0, r4, 0 + bl sav12_xor_set +_080847EC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sav12_xor_increment + + thumb_func_start sub_80847F8 +sub_80847F8: @ 80847F8 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x33 + bhi _08084828 + ldr r0, =0x03005d8c + ldr r2, [r0] + lsls r0, r1, 2 + ldr r1, =0x0000159c + adds r2, r1 + adds r2, r0 + ldr r0, =0x03005d90 + ldr r1, [r0] + adds r1, 0xAC + ldr r0, [r2] + ldr r1, [r1] + eors r0, r1 + b _0808482A + .pool +_08084828: + movs r0, 0 +_0808482A: + pop {r1} + bx r1 + thumb_func_end sub_80847F8 + + thumb_func_start sav12_xor_set +sav12_xor_set: @ 8084830 + push {lr} + adds r3, r1, 0 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x33 + bhi _08084854 + ldr r0, =0x03005d8c + ldr r1, [r0] + lsls r0, r2, 2 + ldr r2, =0x0000159c + adds r1, r2 + adds r1, r0 + ldr r0, =0x03005d90 + ldr r0, [r0] + adds r0, 0xAC + ldr r0, [r0] + eors r0, r3 + str r0, [r1] +_08084854: + pop {r0} + bx r0 + .pool + thumb_func_end sav12_xor_set + + thumb_func_start sub_8084864 +sub_8084864: @ 8084864 + push {r4-r6,lr} + adds r5, r0, 0 + movs r4, 0 + ldr r6, =0x03005d8c +_0808486C: + lsls r1, r4, 2 + ldr r0, =0x0000159c + adds r1, r0 + ldr r0, [r6] + adds r0, r1 + adds r1, r5, 0 + bl apply_u32_xor_crypto + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3F + bls _0808486C + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8084864 + + thumb_func_start CopyFieldObjectTemplatesToSav1 +@ void CopyFieldObjectTemplatesToSav1() +CopyFieldObjectTemplatesToSav1: @ 8084894 + push {r4,r5,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + ldr r5, =0x03005d8c + ldr r1, [r5] + movs r4, 0xC7 + lsls r4, 4 + adds r1, r4 + ldr r2, =0x05000180 + mov r0, sp + bl CpuSet + ldr r0, =0x02037318 + ldr r2, [r0, 0x4] + ldr r0, [r2, 0x4] + ldr r1, [r5] + adds r1, r4 + ldrb r3, [r2] + lsls r2, r3, 1 + adds r2, r3 + lsls r2, 1 + movs r3, 0x80 + lsls r3, 19 + orrs r2, r3 + bl CpuSet + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end CopyFieldObjectTemplatesToSav1 + + thumb_func_start CopyFieldObjectTemplateCoordsToSav1 +@ void CopyFieldObjectTemplateCoordsToSav1() +CopyFieldObjectTemplateCoordsToSav1: @ 80848E0 + push {lr} + ldr r0, =0x02037318 + ldr r1, [r0, 0x4] + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, [r1, 0x4] + movs r3, 0xC7 + lsls r3, 4 + adds r1, r0, r3 + movs r3, 0x3F +_080848F4: + ldr r0, [r2, 0x10] + str r0, [r1, 0x10] + adds r2, 0x18 + adds r1, 0x18 + subs r3, 0x1 + cmp r3, 0 + bge _080848F4 + pop {r0} + bx r0 + .pool + thumb_func_end CopyFieldObjectTemplateCoordsToSav1 + + thumb_func_start update_saveblock1_field_object_coords +update_saveblock1_field_object_coords: @ 8084910 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 16 + lsrs r2, 16 + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r1, 0 + movs r6, 0xC7 + lsls r6, 4 + adds r3, r0, r6 +_0808492A: + ldrb r0, [r3] + cmp r0, r5 + bne _0808493C + strh r4, [r3, 0x4] + strh r2, [r3, 0x6] + b _08084944 + .pool +_0808493C: + adds r3, 0x18 + adds r1, 0x1 + cmp r1, 0x3F + ble _0808492A +_08084944: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end update_saveblock1_field_object_coords + + thumb_func_start update_saveblock1_field_object_movement_behavior +update_saveblock1_field_object_movement_behavior: @ 808494C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r3, 0 + movs r5, 0xC7 + lsls r5, 4 + adds r2, r0, r5 +_08084962: + ldrb r0, [r2] + cmp r0, r4 + bne _08084970 + strb r1, [r2, 0x9] + b _08084978 + .pool +_08084970: + adds r2, 0x18 + adds r3, 0x1 + cmp r3, 0x3F + ble _08084962 +_08084978: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end update_saveblock1_field_object_movement_behavior + + thumb_func_start mapdata_load_assets_to_gpu_and_full_redraw +mapdata_load_assets_to_gpu_and_full_redraw: @ 8084980 + push {r4,lr} + bl move_tilemap_camera_to_upper_left_corner + ldr r4, =0x02037318 + ldr r0, [r4] + bl copy_map_tileset1_tileset2_to_vram + ldr r0, [r4] + bl apply_map_tileset1_tileset2_palette + bl DrawWholeMapView + bl cur_mapheader_run_tileset_funcs_after_some_cpuset + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end mapdata_load_assets_to_gpu_and_full_redraw + + thumb_func_start get_mapdata_header +@ mapdata_header *get_mapdata_header() +get_mapdata_header: @ 80849A8 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r1, [r0, 0x32] + cmp r1, 0 + bne _080849BC + movs r0, 0 + b _080849C6 + .pool +_080849BC: + ldr r0, =gUnknown_08481DD4 + subs r1, 0x1 + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] +_080849C6: + pop {r1} + bx r1 + .pool + thumb_func_end get_mapdata_header + + thumb_func_start warp_shift +@ void warp_shift() +warp_shift: @ 80849D0 + ldr r3, =0x020322dc + ldr r0, =0x03005d8c + ldr r2, [r0] + ldr r0, [r2, 0x4] + ldr r1, [r2, 0x8] + str r0, [r3] + str r1, [r3, 0x4] + ldr r0, =0x020322e4 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r2, 0x4] + str r1, [r2, 0x8] + ldr r2, =0x020322ec + ldr r0, =gUnknown_08339D3C + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r2] + str r1, [r2, 0x4] + ldr r2, =0x020322f4 + str r0, [r2] + str r1, [r2, 0x4] + bx lr + .pool + thumb_func_end warp_shift + + thumb_func_start set_warp2_warp3_to_neg_1 +@ void set_warp2_warp3_to_neg_1() +set_warp2_warp3_to_neg_1: @ 8084A14 + ldr r2, =0x020322ec + ldr r0, =gUnknown_08339D3C + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r2] + str r1, [r2, 0x4] + ldr r2, =0x020322f4 + str r0, [r2] + str r1, [r2, 0x4] + bx lr + .pool + thumb_func_end set_warp2_warp3_to_neg_1 + + thumb_func_start warp_set +@ void warp_set(warpdata *warp, char bank, char map, char warpid, char enter_x, char enter_y) +warp_set: @ 8084A34 + push {r4,r5,lr} + ldr r4, [sp, 0xC] + ldr r5, [sp, 0x10] + strb r1, [r0] + strb r2, [r0, 0x1] + strb r3, [r0, 0x2] + lsls r4, 24 + asrs r4, 24 + strh r4, [r0, 0x4] + lsls r5, 24 + asrs r5, 24 + strh r5, [r0, 0x6] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end warp_set + + thumb_func_start warp_data_is_not_neg_1 +@ int warp_data_is_not_neg_1(warpdata *warp) +warp_data_is_not_neg_1: @ 8084A54 + push {lr} + adds r1, r0, 0 + movs r2, 0 + ldrsb r2, [r1, r2] + movs r0, 0x1 + negs r0, r0 + cmp r2, r0 + bne _08084A88 + movs r0, 0x1 + ldrsb r0, [r1, r0] + cmp r0, r2 + bne _08084A88 + movs r2, 0x2 + ldrsb r2, [r1, r2] + cmp r2, r0 + bne _08084A88 + movs r0, 0x4 + ldrsh r3, [r1, r0] + cmp r3, r2 + bne _08084A88 + movs r2, 0x6 + ldrsh r0, [r1, r2] + cmp r0, r3 + bne _08084A88 + movs r0, 0x1 + b _08084A8A +_08084A88: + movs r0, 0 +_08084A8A: + pop {r1} + bx r1 + thumb_func_end warp_data_is_not_neg_1 + + thumb_func_start get_mapheader_by_bank_and_number +@ struct mapheader *get_mapheader_by_bank_and_number(unsigned int bank, unsigned int num) +get_mapheader_by_bank_and_number: @ 8084A90 + lsls r0, 16 + lsls r1, 16 + ldr r2, =gUnknown_08486578 + lsrs r0, 14 + adds r0, r2 + ldr r0, [r0] + lsrs r1, 14 + adds r1, r0 + ldr r0, [r1] + bx lr + .pool + thumb_func_end get_mapheader_by_bank_and_number + + thumb_func_start warp1_get_mapheader +@ struct mapheader *warp1_get_mapheader() +warp1_get_mapheader: @ 8084AA8 + push {lr} + ldr r1, =0x020322e4 + movs r0, 0 + ldrsb r0, [r1, r0] + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1, 0x1] + lsls r1, 24 + asrs r1, 24 + lsls r1, 16 + lsrs r1, 16 + bl get_mapheader_by_bank_and_number + pop {r1} + bx r1 + .pool + thumb_func_end warp1_get_mapheader + + thumb_func_start set_current_map_header_from_sav1_save_old_name +@ void set_current_map_header_from_sav1_save_old_name() +set_current_map_header_from_sav1_save_old_name: @ 8084ACC + push {r4-r6,lr} + ldr r1, =0x020322fc + ldr r4, =0x02037318 + ldrb r0, [r4, 0x14] + strh r0, [r1] + ldr r5, =0x03005d8c + ldr r1, [r5] + movs r0, 0x4 + ldrsb r0, [r1, r0] + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1, 0x5] + lsls r1, 24 + asrs r1, 24 + lsls r1, 16 + lsrs r1, 16 + bl get_mapheader_by_bank_and_number + adds r1, r4, 0 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldr r0, [r0] + str r0, [r1] + ldr r1, [r5] + ldrh r0, [r4, 0x12] + strh r0, [r1, 0x32] + bl get_mapdata_header + str r0, [r4] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end set_current_map_header_from_sav1_save_old_name + + thumb_func_start set_current_map_header_from_sav1 +set_current_map_header_from_sav1: @ 8084B1C + push {r4,r5,lr} + ldr r4, =0x02037318 + ldr r0, =0x03005d8c + ldr r1, [r0] + movs r0, 0x4 + ldrsb r0, [r1, r0] + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1, 0x5] + lsls r1, 24 + asrs r1, 24 + lsls r1, 16 + lsrs r1, 16 + bl get_mapheader_by_bank_and_number + adds r1, r4, 0 + 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] + bl get_mapdata_header + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end set_current_map_header_from_sav1 + + thumb_func_start update_camera_pos_from_warpid +@ void update_camera_pos_from_warpid() +update_camera_pos_from_warpid: @ 8084B5C + push {r4,r5,lr} + ldr r0, =0x03005d8c + ldr r2, [r0] + movs r1, 0x6 + ldrsb r1, [r2, r1] + adds r4, r0, 0 + cmp r1, 0 + blt _08084B94 + ldr r3, =0x02037318 + ldr r0, [r3, 0x4] + ldrb r5, [r0, 0x1] + cmp r1, r5 + bge _08084B94 + ldr r0, [r0, 0x8] + lsls r1, 3 + adds r0, r1, r0 + ldrh r0, [r0] + strh r0, [r2] + ldr r0, [r3, 0x4] + ldr r0, [r0, 0x8] + adds r1, r0 + ldrh r0, [r1, 0x2] + strh r0, [r2, 0x2] + b _08084BCC + .pool +_08084B94: + ldr r1, [r4] + ldrh r3, [r1, 0x8] + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0 + blt _08084BB0 + ldrh r2, [r1, 0xA] + movs r5, 0xA + ldrsh r0, [r1, r5] + cmp r0, 0 + blt _08084BB0 + strh r3, [r1] + strh r2, [r1, 0x2] + b _08084BCC +_08084BB0: + ldr r3, [r4] + ldr r2, =0x02037318 + ldr r0, [r2] + ldr r0, [r0] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + strh r0, [r3] + ldr r0, [r2] + ldr r0, [r0, 0x4] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + strh r0, [r3, 0x2] +_08084BCC: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end update_camera_pos_from_warpid + + thumb_func_start warp_in +warp_in: @ 8084BD8 + push {lr} + bl warp_shift + bl set_current_map_header_from_sav1_save_old_name + bl update_camera_pos_from_warpid + pop {r0} + bx r0 + thumb_func_end warp_in + + thumb_func_start warp1_set +@ void warp1_set(char bank, char map, char warpid, char enter_x, char enter_y) +warp1_set: @ 8084BEC + 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, =0x020322e4 + lsls r4, 24 + asrs r4, 24 + lsls r5, 24 + asrs r5, 24 + lsls r6, 24 + asrs r6, 24 + lsls r3, 24 + asrs r3, 24 + str r3, [sp] + lsls r1, 24 + asrs r1, 24 + str r1, [sp, 0x4] + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl warp_set + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end warp1_set + + thumb_func_start warp1_set_2 +@ void warp1_set_2(char bank, char map, char warpid) +warp1_set_2: @ 8084C28 + push {lr} + sub sp, 0x4 + lsls r0, 24 + asrs r0, 24 + lsls r1, 24 + asrs r1, 24 + lsls r2, 24 + asrs r2, 24 + movs r3, 0x1 + negs r3, r3 + str r3, [sp] + bl warp1_set + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end warp1_set_2 + + thumb_func_start saved_warp2_set +@ void saved_warp2_set(char bank, char map, char warpid) +saved_warp2_set: @ 8084C48 + push {r4,r5,lr} + sub sp, 0x8 + ldr r0, =0x03005d8c + ldr r5, [r0] + adds r0, r5, 0 + adds r0, 0x14 + lsls r1, 24 + asrs r1, 24 + lsls r2, 24 + asrs r2, 24 + lsls r3, 24 + asrs r3, 24 + movs r4, 0 + ldrsb r4, [r5, r4] + str r4, [sp] + movs r4, 0x2 + ldrsb r4, [r5, r4] + str r4, [sp, 0x4] + bl warp_set + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end saved_warp2_set + + thumb_func_start saved_warp2_set_2 +saved_warp2_set_2: @ 8084C7C + push {r4,r5,lr} + sub sp, 0x8 + ldr r4, [sp, 0x14] + ldr r5, [sp, 0x18] + ldr r0, =0x03005d8c + ldr r0, [r0] + adds r0, 0x14 + lsls r1, 24 + asrs r1, 24 + lsls r2, 24 + asrs r2, 24 + lsls r3, 24 + asrs r3, 24 + lsls r4, 24 + asrs r4, 24 + str r4, [sp] + lsls r5, 24 + asrs r5, 24 + str r5, [sp, 0x4] + bl warp_set + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end saved_warp2_set_2 + + thumb_func_start copy_saved_warp2_bank_and_enter_x_to_warp1 +copy_saved_warp2_bank_and_enter_x_to_warp1: @ 8084CB4 + ldr r2, =0x020322e4 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, [r0, 0x18] + ldr r0, [r0, 0x14] + str r0, [r2] + str r1, [r2, 0x4] + bx lr + .pool + thumb_func_end copy_saved_warp2_bank_and_enter_x_to_warp1 + + thumb_func_start sub_8084CCC +@ void sub_8084CCC(int a1) +sub_8084CCC: @ 8084CCC + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + bl sub_8122CBC + adds r4, r0, 0 + cmp r4, 0 + beq _08084CFA + movs r0, 0 + ldrsb r0, [r4, r0] + movs r1, 0x1 + ldrsb r1, [r4, r1] + movs r2, 0x1 + negs r2, r2 + movs r3, 0x2 + ldrsb r3, [r4, r3] + ldrb r4, [r4, 0x4] + lsls r4, 24 + asrs r4, 24 + str r4, [sp] + bl warp1_set +_08084CFA: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8084CCC + + thumb_func_start copy_saved_warp3_bank_and_enter_x_to_warp1 +@ void copy_saved_warp3_bank_and_enter_x_to_warp1() +copy_saved_warp3_bank_and_enter_x_to_warp1: @ 8084D04 + ldr r2, =0x020322e4 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, [r0, 0x20] + ldr r0, [r0, 0x1C] + str r0, [r2] + str r1, [r2, 0x4] + bx lr + .pool + thumb_func_end copy_saved_warp3_bank_and_enter_x_to_warp1 + + thumb_func_start sub_8084D1C +sub_8084D1C: @ 8084D1C + push {r4,r5,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + bl sub_8122CBC + adds r5, r0, 0 + cmp r5, 0 + beq _08084D50 + ldr r0, =0x03005d8c + ldr r0, [r0] + adds r0, 0x1C + movs r1, 0 + ldrsb r1, [r5, r1] + movs r2, 0x1 + ldrsb r2, [r5, r2] + movs r3, 0x1 + negs r3, r3 + movs r4, 0x2 + ldrsb r4, [r5, r4] + str r4, [sp] + movs r4, 0x4 + ldrsb r4, [r5, r4] + str r4, [sp, 0x4] + bl warp_set +_08084D50: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8084D1C + + thumb_func_start sub_8084D5C +sub_8084D5C: @ 8084D5C + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 16 + lsrs r7, r1, 16 + bl sav1_map_get_light_level + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =0x020322e4 + movs r0, 0 + ldrsb r0, [r1, r0] + ldrb r1, [r1, 0x1] + lsls r1, 24 + asrs r1, 24 + bl get_map_light_level_by_bank_and_number + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + bl is_light_level_1_2_3_5_or_6 + lsls r0, 24 + cmp r0, 0 + beq _08084DC4 + adds r0, r5, 0 + bl is_light_level_1_2_3_5_or_6 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08084DC4 + ldr r0, =0x03005d8c + ldr r1, [r0] + movs r0, 0x4 + ldrsb r0, [r1, r0] + ldrb r1, [r1, 0x5] + lsls r1, 24 + asrs r1, 24 + movs r2, 0x1 + negs r2, r2 + subs r3, r6, 0x7 + lsls r3, 24 + asrs r3, 24 + subs r4, r7, 0x6 + lsls r4, 24 + asrs r4, 24 + str r4, [sp] + bl sub_8084DD4 +_08084DC4: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8084D5C + + thumb_func_start sub_8084DD4 +sub_8084DD4: @ 8084DD4 + 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, =0x03005d8c + ldr r0, [r0] + adds r0, 0x24 + lsls r4, 24 + asrs r4, 24 + lsls r5, 24 + asrs r5, 24 + lsls r6, 24 + asrs r6, 24 + lsls r3, 24 + asrs r3, 24 + str r3, [sp] + lsls r1, 24 + asrs r1, 24 + str r1, [sp, 0x4] + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl warp_set + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8084DD4 + + thumb_func_start sub_8084E14 +sub_8084E14: @ 8084E14 + ldr r2, =0x020322e4 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, [r0, 0x28] + ldr r0, [r0, 0x24] + str r0, [r2] + str r1, [r2, 0x4] + bx lr + .pool + thumb_func_end sub_8084E14 + + thumb_func_start sub_8084E2C +sub_8084E2C: @ 8084E2C + 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, =0x020322ec + lsls r4, 24 + asrs r4, 24 + lsls r5, 24 + asrs r5, 24 + lsls r6, 24 + asrs r6, 24 + lsls r3, 24 + asrs r3, 24 + str r3, [sp] + lsls r1, 24 + asrs r1, 24 + str r1, [sp, 0x4] + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl warp_set + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8084E2C + + thumb_func_start warp1_set_to_warp2 +warp1_set_to_warp2: @ 8084E68 + ldr r2, =0x020322e4 + ldr r0, =0x020322ec + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r2] + str r1, [r2, 0x4] + bx lr + .pool + thumb_func_end warp1_set_to_warp2 + + thumb_func_start sub_8084E80 +sub_8084E80: @ 8084E80 + 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, =0x020322f4 + lsls r4, 24 + asrs r4, 24 + lsls r5, 24 + asrs r5, 24 + lsls r6, 24 + asrs r6, 24 + lsls r3, 24 + asrs r3, 24 + str r3, [sp] + lsls r1, 24 + asrs r1, 24 + str r1, [sp, 0x4] + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl warp_set + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8084E80 + + thumb_func_start sub_8084EBC +sub_8084EBC: @ 8084EBC + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 16 + lsrs r6, r1, 16 + ldr r4, =0x020322f4 + adds r0, r4, 0 + bl warp_data_is_not_neg_1 + cmp r0, 0x1 + bne _08084EF0 + ldr r2, =0x020322e4 + ldr r0, =0x020322dc + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r2] + str r1, [r2, 0x4] + b _08084F0A + .pool +_08084EF0: + movs r0, 0 + ldrsb r0, [r4, r0] + movs r1, 0x1 + ldrsb r1, [r4, r1] + movs r2, 0x1 + negs r2, r2 + lsls r3, r5, 24 + asrs r3, 24 + lsls r4, r6, 24 + asrs r4, 24 + str r4, [sp] + bl warp1_set +_08084F0A: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8084EBC + + thumb_func_start warp1_set_to_sav1w +warp1_set_to_sav1w: @ 8084F14 + ldr r2, =0x020322e4 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, [r0, 0x10] + ldr r0, [r0, 0xC] + str r0, [r2] + str r1, [r2, 0x4] + bx lr + .pool + thumb_func_end warp1_set_to_sav1w + + thumb_func_start sub_8084F2C +sub_8084F2C: @ 8084F2C + 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, =0x03005d8c + ldr r0, [r0] + adds r0, 0xC + lsls r4, 24 + asrs r4, 24 + lsls r5, 24 + asrs r5, 24 + lsls r6, 24 + asrs r6, 24 + lsls r3, 24 + asrs r3, 24 + str r3, [sp] + lsls r1, 24 + asrs r1, 24 + str r1, [sp, 0x4] + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl warp_set + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8084F2C + + thumb_func_start sub_8084F6C +sub_8084F6C: @ 8084F6C + push {r4,r5,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + bl sub_8122CBC + adds r5, r0, 0 + cmp r5, 0 + beq _08084FA0 + ldr r0, =0x03005d8c + ldr r0, [r0] + adds r0, 0xC + movs r1, 0 + ldrsb r1, [r5, r1] + movs r2, 0x1 + ldrsb r2, [r5, r2] + movs r3, 0x1 + negs r3, r3 + movs r4, 0x2 + ldrsb r4, [r5, r4] + str r4, [sp] + movs r4, 0x4 + ldrsb r4, [r5, r4] + str r4, [sp, 0x4] + bl warp_set +_08084FA0: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8084F6C + + thumb_func_start sub_8084FAC +sub_8084FAC: @ 8084FAC + ldr r0, =0x03005d8c + ldr r2, [r0] + ldr r0, [r2, 0x14] + ldr r1, [r2, 0x18] + str r0, [r2, 0xC] + str r1, [r2, 0x10] + bx lr + .pool + thumb_func_end sub_8084FAC + + thumb_func_start sub_8084FC0 +sub_8084FC0: @ 8084FC0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037318 + ldr r0, [r0, 0xC] + ldr r3, [r0] + ldr r1, [r0, 0x4] + cmp r1, 0 + bne _08084FDC + b _08084FF0 + .pool +_08084FD8: + adds r0, r1, 0 + b _08084FF2 +_08084FDC: + movs r2, 0 + cmp r2, r3 + bge _08084FF0 +_08084FE2: + ldrb r0, [r1] + cmp r0, r4 + beq _08084FD8 + adds r2, 0x1 + adds r1, 0xC + cmp r2, r3 + blt _08084FE2 +_08084FF0: + movs r0, 0 +_08084FF2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8084FC0 + + thumb_func_start sub_8084FF8 +sub_8084FF8: @ 8084FF8 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 16 + lsrs r5, r2, 16 + bl sub_8084FC0 + adds r1, r0, 0 + cmp r1, 0 + beq _08085030 + movs r0, 0x8 + ldrsb r0, [r1, r0] + ldrb r1, [r1, 0x9] + lsls r1, 24 + asrs r1, 24 + movs r2, 0x1 + negs r2, r2 + lsls r3, r4, 24 + asrs r3, 24 + lsls r4, r5, 24 + asrs r4, 24 + str r4, [sp] + bl warp1_set + b _0808504C +_08085030: + bl mapheader_run_script_with_tag_x6 + ldr r0, =0x020322ec + bl warp_data_is_not_neg_1 + cmp r0, 0 + beq _08085048 + movs r0, 0 + b _0808504E + .pool +_08085048: + bl warp1_set_to_warp2 +_0808504C: + movs r0, 0x1 +_0808504E: + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8084FF8 + + thumb_func_start sub_8085058 +sub_8085058: @ 8085058 + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + lsls r3, 16 + lsrs r3, 16 + lsls r2, 16 + lsrs r2, 16 + movs r0, 0x6 + adds r1, r3, 0 + bl sub_8084FF8 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_8085058 + + thumb_func_start sub_8085078 +sub_8085078: @ 8085078 + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + lsls r3, 16 + lsrs r3, 16 + lsls r2, 16 + lsrs r2, 16 + movs r0, 0x5 + adds r1, r3, 0 + bl sub_8084FF8 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_8085078 + + thumb_func_start mliX_load_map +mliX_load_map: @ 8085098 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r5, r1, 0 + lsls r0, r6, 24 + asrs r0, 24 + lsls r1, r5, 24 + asrs r1, 24 + movs r3, 0x1 + negs r3, r3 + str r3, [sp] + adds r2, r3, 0 + bl warp1_set + ldr r4, =0x02037318 + ldrb r0, [r4, 0x14] + cmp r0, 0x3A + beq _080850C8 + bl sub_8085810 +_080850C8: + bl warp_shift + bl set_current_map_header_from_sav1_save_old_name + bl CopyFieldObjectTemplatesToSav1 + bl sav2_set_x9_depending_on_sav1_map + bl sub_809D344 + bl wild_pokemon_reroll + bl prev_quest_postbuffer_cursor_backup_reset + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80B21B4 + bl sub_809E7B0 + bl sub_80AEDBC + bl sub_8085B2C + bl update_sav1_flash_used_on_map + bl sav1_reset_battle_music_maybe + bl mapheader_run_script_with_tag_x3 + bl not_trainer_hill_battle_pyramid + ldr r0, [r4] + bl copy_map_tileset2_to_vram_2 + ldr r0, [r4] + bl apply_map_tileset2_palette + movs r4, 0x6 +_08085116: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80ABF00 + adds r4, 0x1 + cmp r4, 0xC + ble _08085116 + bl sub_80A0A2C + bl mapnumbers_history_shift_sav1_0_2_4_out + bl sub_8161D54 + bl sub_80AEE20 + bl wild_encounter_reset_coro_args + bl mapheader_run_script_with_tag_x5 + ldr r2, =0x02037318 + ldrb r0, [r2, 0x14] + cmp r0, 0x3A + bne _0808514C + ldr r1, =0x020322fc + ldrh r1, [r1] + cmp r0, r1 + beq _08085150 +_0808514C: + bl AddMapNamePopUpWindowTask +_08085150: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end mliX_load_map + + thumb_func_start mli0_load_map +mli0_load_map: @ 8085160 + push {r4-r7,lr} + adds r7, r0, 0 + bl set_current_map_header_from_sav1_save_old_name + ldr r0, =0x020322d8 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080851A2 + ldr r0, =0x02037318 + ldrh r1, [r0, 0x12] + ldr r0, =0x00000169 + cmp r1, r0 + bne _08085190 + bl sub_81AA1D8 + b _080851A2 + .pool +_08085190: + bl InTrainerHill + cmp r0, 0 + beq _0808519E + bl sub_81D5DF8 + b _080851A2 +_0808519E: + bl CopyFieldObjectTemplatesToSav1 +_080851A2: + ldr r4, =0x02037318 + ldrb r0, [r4, 0x17] + bl is_light_level_1_2_3_5_or_6 + lsls r0, 24 + lsrs r5, r0, 24 + ldrb r0, [r4, 0x17] + bl is_light_level_8_or_9 + lsls r0, 24 + lsrs r6, r0, 24 + bl sub_80EB218 + bl sav2_set_x9_depending_on_sav1_map + bl sub_809D344 + bl wild_pokemon_reroll + bl prev_quest_postbuffer_cursor_backup_reset + ldr r0, =0x03005d8c + ldr r1, [r0] + movs r0, 0x4 + ldrsb r0, [r1, r0] + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1, 0x5] + lsls r1, 24 + asrs r1, 24 + lsls r1, 16 + lsrs r1, 16 + bl sub_80B21B4 + cmp r7, 0x1 + beq _080851EE + bl sub_809E7B0 +_080851EE: + bl sub_80AEDBC + bl sub_8085B2C + cmp r5, 0 + beq _08085200 + ldr r0, =0x00000888 + bl FlagReset +_08085200: + bl update_sav1_flash_used_on_map + bl sav1_reset_battle_music_maybe + bl mapheader_run_script_with_tag_x3 + bl mapnumbers_history_shift_sav1_0_2_4_out + bl sub_8161D00 + ldrh r1, [r4, 0x12] + ldr r0, =0x00000169 + cmp r1, r0 + bne _08085234 + movs r0, 0 + bl battle_pyramid_map_load_related + b _08085246 + .pool +_08085234: + bl InTrainerHill + cmp r0, 0 + beq _08085242 + bl trainer_hill_map_load_related + b _08085246 +_08085242: + bl not_trainer_hill_battle_pyramid +_08085246: + cmp r7, 0x1 + beq _0808525E + cmp r6, 0 + beq _0808525E + ldr r1, =0x03005dc0 + ldr r0, [r1] + ldr r1, [r1, 0x4] + bl UpdateTVScreensOnMap + movs r0, 0x1 + bl sub_80E9238 +_0808525E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end mli0_load_map + + thumb_func_start player_avatar_init_params_reset +player_avatar_init_params_reset: @ 8085268 + ldr r1, =0x02032300 + movs r0, 0x1 + strb r0, [r1, 0x1] + strb r0, [r1] + bx lr + .pool + thumb_func_end player_avatar_init_params_reset + + thumb_func_start walkrun_find_lowest_active_bit_in_bitfield +walkrun_find_lowest_active_bit_in_bitfield: @ 8085278 + push {r4,lr} + bl player_get_direction_lower_nybble + ldr r4, =0x02032300 + strb r0, [r4, 0x1] + movs r0, 0x2 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + beq _08085298 + movs r0, 0x2 + b _080852CA + .pool +_08085298: + movs r0, 0x4 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + beq _080852A8 + movs r0, 0x4 + b _080852CA +_080852A8: + movs r0, 0x8 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + beq _080852B8 + movs r0, 0x8 + b _080852CA +_080852B8: + movs r0, 0x10 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + beq _080852C8 + movs r0, 0x10 + b _080852CA +_080852C8: + movs r0, 0x1 +_080852CA: + strb r0, [r4] + pop {r4} + pop {r0} + bx r0 + thumb_func_end walkrun_find_lowest_active_bit_in_bitfield + + thumb_func_start sub_80852D4 +sub_80852D4: @ 80852D4 + push {r4-r7,lr} + bl sav1_map_get_light_level + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + bl cur_mapdata_block_role_at_screen_center_acc_to_sav1 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r6, =0x02032300 + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_808532C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =0xffffff00 + ands r7, r0 + orrs r7, r1 + adds r0, r6, 0 + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_808538C + lsls r0, 24 + lsrs r0, 16 + ldr r1, =0xffff00ff + ands r7, r1 + orrs r7, r0 + str r7, [r6] + adds r0, r6, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80852D4 + + thumb_func_start sub_808532C +sub_808532C: @ 808532C + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + lsls r2, 24 + lsrs r4, r2, 24 + cmp r4, 0x8 + beq _08085348 + ldr r0, =0x0000088d + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _08085382 +_08085348: + cmp r4, 0x5 + bne _08085354 + movs r0, 0x10 + b _08085384 + .pool +_08085354: + lsls r0, r5, 24 + lsrs r0, 24 + bl MetatileBehavior_IsSurfableWaterOrUnderwater + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08085368 + movs r0, 0x8 + b _08085384 +_08085368: + bl sav1_map_is_biking_allowed + cmp r0, 0x1 + bne _08085382 + ldrb r0, [r6] + cmp r0, 0x2 + bne _0808537A + movs r0, 0x2 + b _08085384 +_0808537A: + cmp r0, 0x4 + bne _08085382 + movs r0, 0x4 + b _08085384 +_08085382: + movs r0, 0x1 +_08085384: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_808532C + + thumb_func_start sub_808538C +sub_808538C: @ 808538C + push {r4-r7,lr} + adds r6, r0, 0 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 16 + lsrs r4, r2, 16 + lsls r3, 24 + lsrs r5, r3, 24 + ldr r0, =0x0000088d + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _080853AC + cmp r5, 0x6 + beq _0808540C +_080853AC: + lsls r4, 24 + lsrs r5, r4, 24 + adds r0, r5, 0 + bl sub_8088F74 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080853E8 + adds r0, r5, 0 + bl sub_8088F58 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08085442 + adds r0, r5, 0 + bl sub_8088EFC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08085442 + adds r0, r5, 0 + bl MetatileBehavior_IsSouthArrowWarp + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080853F0 +_080853E8: + movs r0, 0x2 + b _08085448 + .pool +_080853F0: + adds r0, r5, 0 + bl MetatileBehavior_IsNorthArrowWarp + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08085442 + adds r0, r5, 0 + bl MetatileBehavior_IsWestArrowWarp + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08085410 +_0808540C: + movs r0, 0x4 + b _08085448 +_08085410: + adds r0, r5, 0 + bl MetatileBehavior_IsEastArrowWarp + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08085422 + movs r0, 0x3 + b _08085448 +_08085422: + ldrb r0, [r6] + cmp r0, 0x10 + bne _0808542C + cmp r7, 0x8 + beq _08085446 +_0808542C: + cmp r0, 0x8 + bne _08085434 + cmp r7, 0x10 + beq _08085446 +_08085434: + lsrs r0, r4, 24 + bl MetatileBehavior_IsLadder + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08085446 +_08085442: + movs r0, 0x1 + b _08085448 +_08085446: + ldrb r0, [r6, 0x1] +_08085448: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808538C + + thumb_func_start cur_mapdata_block_role_at_screen_center_acc_to_sav1 +cur_mapdata_block_role_at_screen_center_acc_to_sav1: @ 8085450 + push {lr} + ldr r0, =0x03005d8c + ldr r1, [r0] + movs r2, 0 + ldrsh r0, [r1, r2] + adds r0, 0x7 + movs r2, 0x2 + ldrsh r1, [r1, r2] + adds r1, 0x7 + bl MapGridGetMetatileBehaviorAt + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .pool + thumb_func_end cur_mapdata_block_role_at_screen_center_acc_to_sav1 + + thumb_func_start sav1_map_is_biking_allowed +sav1_map_is_biking_allowed: @ 8085474 + push {lr} + ldr r0, =0x02037318 + ldrb r1, [r0, 0x1A] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0808548C + movs r0, 0x1 + b _0808548E + .pool +_0808548C: + movs r0, 0 +_0808548E: + pop {r1} + bx r1 + thumb_func_end sav1_map_is_biking_allowed + + thumb_func_start update_sav1_flash_used_on_map +update_sav1_flash_used_on_map: @ 8085494 + push {lr} + ldr r0, =0x02037318 + ldrb r1, [r0, 0x15] + cmp r1, 0 + bne _080854B0 + ldr r0, =0x03005d8c + ldr r0, [r0] + adds r0, 0x30 + strb r1, [r0] + b _080854DE + .pool +_080854B0: + ldr r0, =0x00000888 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _080854D0 + ldr r0, =0x03005d8c + ldr r0, [r0] + adds r0, 0x30 + movs r1, 0x1 + strb r1, [r0] + b _080854DE + .pool +_080854D0: + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r0, =gUnknown_0854FE78 + ldr r0, [r0] + subs r0, 0x1 + adds r1, 0x30 + strb r0, [r1] +_080854DE: + pop {r0} + bx r0 + .pool + thumb_func_end update_sav1_flash_used_on_map + + thumb_func_start sub_80854EC +sub_80854EC: @ 80854EC + push {lr} + adds r1, r0, 0 + cmp r1, 0 + blt _080854FC + ldr r0, =gUnknown_0854FE78 + ldr r0, [r0] + cmp r1, r0 + ble _080854FE +_080854FC: + movs r1, 0 +_080854FE: + ldr r0, =0x03005d8c + ldr r0, [r0] + adds r0, 0x30 + strb r1, [r0] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80854EC + + thumb_func_start sav1_get_flash_used_on_map +sav1_get_flash_used_on_map: @ 8085514 + ldr r0, =0x03005d8c + ldr r0, [r0] + adds r0, 0x30 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sav1_get_flash_used_on_map + + thumb_func_start sub_8085524 +sub_8085524: @ 8085524 + push {lr} + ldr r1, =0x03005d8c + ldr r1, [r1] + strh r0, [r1, 0x32] + bl get_mapdata_header + ldr r1, =0x02037318 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8085524 + + thumb_func_start sub_8085540 +sub_8085540: @ 8085540 + ldr r1, =0x020322d8 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_8085540 + + thumb_func_start sub_808554C +sub_808554C: @ 808554C + ldr r0, =0x020322d8 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_808554C + + thumb_func_start sub_8085558 +sub_8085558: @ 8085558 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x0000088a + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _080855AC + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0 + bne _080855AC + movs r0, 0x1 + ldrsb r0, [r4, r0] + cmp r0, 0x5 + blt _08085584 + cmp r0, 0x8 + ble _0808559E + cmp r0, 0x2B + bgt _08085584 + cmp r0, 0x27 + bge _0808559E +_08085584: + ldr r0, =0x0000405e + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x3 + bls _080855AC + movs r0, 0x1 + ldrsb r0, [r4, r0] + cmp r0, 0x2E + bgt _080855AC + cmp r0, 0x2C + blt _080855AC +_0808559E: + movs r0, 0x1 + b _080855AE + .pool +_080855AC: + movs r0, 0 +_080855AE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8085558 + + thumb_func_start sub_80855B4 +sub_80855B4: @ 80855B4 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x000040ca + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bne _080855D6 + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0 + bne _080855D6 + movs r0, 0x1 + ldrsb r0, [r4, r0] + cmp r0, 0x7 + beq _080855E0 +_080855D6: + movs r0, 0 + b _080855E2 + .pool +_080855E0: + movs r0, 0x1 +_080855E2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80855B4 + + thumb_func_start sub_80855E8 +sub_80855E8: @ 80855E8 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x000040b3 + bl VarGet + lsls r0, 16 + cmp r0, 0 + bne _08085606 + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0x20 + bne _08085606 + ldrb r0, [r4, 0x1] + cmp r0, 0x1 + bls _08085610 +_08085606: + movs r0, 0 + b _08085612 + .pool +_08085610: + movs r0, 0x1 +_08085612: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80855E8 + + thumb_func_start sub_8085618 +sub_8085618: @ 8085618 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x0000405d + adds r0, r4, 0 + bl VarGet + lsls r0, 16 + cmp r0, 0 + beq _0808564C + adds r0, r4, 0 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bhi _0808564C + movs r0, 0 + ldrsb r0, [r5, r0] + cmp r0, 0xE + bne _0808564C + ldrb r0, [r5, 0x1] + subs r0, 0x9 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _08085654 +_0808564C: + movs r0, 0 + b _08085656 + .pool +_08085654: + movs r0, 0x1 +_08085656: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8085618 + + thumb_func_start warp_target_get_music +warp_target_get_music: @ 808565C + push {r4,lr} + adds r4, r0, 0 + bl sub_80855B4 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bne _08085674 + ldr r0, =0x0000ffff + b _080856CE + .pool +_08085674: + adds r0, r4, 0 + bl sub_8085558 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bne _0808568C + ldr r0, =0x000001bb + b _080856CE + .pool +_0808568C: + adds r0, r4, 0 + bl sub_8085618 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bne _080856A4 + ldr r0, =0x000001b9 + b _080856CE + .pool +_080856A4: + adds r0, r4, 0 + bl sub_80855E8 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + beq _080856CA + movs r0, 0 + ldrsb r0, [r4, r0] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ldrsb r1, [r4, r1] + lsls r1, 16 + lsrs r1, 16 + bl get_mapheader_by_bank_and_number + ldrh r0, [r0, 0x10] + b _080856CE +_080856CA: + movs r0, 0xCB + lsls r0, 1 +_080856CE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end warp_target_get_music + + thumb_func_start sav1_map_get_music +sav1_map_get_music: @ 80856D4 + push {r4,lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r1, [r0, 0x4] + movs r0, 0xD0 + lsls r0, 5 + cmp r1, r0 + bne _080856FC + bl sav1_get_weather_probably + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x8 + bne _080856FC + ldr r0, =0x00000199 + b _08085730 + .pool +_080856FC: + ldr r4, =0x03005d8c + ldr r0, [r4] + adds r0, 0x4 + bl warp_target_get_music + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =0x00007fff + cmp r1, r0 + beq _0808571C + adds r0, r1, 0 + b _08085730 + .pool +_0808571C: + ldr r0, [r4] + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x17 + ble _0808572C + movs r0, 0xC9 + lsls r0, 1 + b _08085730 +_0808572C: + movs r0, 0xB4 + lsls r0, 1 +_08085730: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sav1_map_get_music + + thumb_func_start warp1_target_get_music +warp1_target_get_music: @ 8085738 + push {lr} + ldr r0, =0x020322e4 + bl warp_target_get_music + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =0x00007fff + cmp r1, r0 + beq _08085758 + adds r0, r1, 0 + b _08085774 + .pool +_08085758: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r1, [r0, 0x4] + movs r0, 0x80 + lsls r0, 2 + cmp r1, r0 + beq _08085770 + subs r0, 0x6E + b _08085774 + .pool +_08085770: + movs r0, 0xB4 + lsls r0, 1 +_08085774: + pop {r1} + bx r1 + thumb_func_end warp1_target_get_music + + thumb_func_start call_map_music_set_to_zero +call_map_music_set_to_zero: @ 8085778 + push {lr} + bl map_music_set_to_zero + pop {r0} + bx r0 + thumb_func_end call_map_music_set_to_zero + + thumb_func_start sub_8085784 +sub_8085784: @ 8085784 + push {r4,lr} + bl sav1_map_get_music + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x000001bb + cmp r4, r0 + beq _080857D6 + ldr r0, =0x0000ffff + cmp r4, r0 + beq _080857D6 + ldr r0, =0x03005d8c + ldr r1, [r0] + ldrh r0, [r1, 0x2C] + cmp r0, 0 + beq _080857B4 + adds r4, r0, 0 + b _080857D6 + .pool +_080857B4: + bl sav1_map_get_light_level + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bne _080857C8 + ldr r4, =0x0000019b + b _080857D6 + .pool +_080857C8: + movs r0, 0x8 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + beq _080857D6 + ldr r4, =0x0000016d +_080857D6: + bl current_map_music_get + lsls r0, 16 + lsrs r0, 16 + cmp r4, r0 + beq _080857E8 + adds r0, r4, 0 + bl current_map_music_set +_080857E8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8085784 + + thumb_func_start sav1_set_battle_music_maybe +sav1_set_battle_music_maybe: @ 80857F4 + ldr r1, =0x03005d8c + ldr r1, [r1] + strh r0, [r1, 0x2C] + bx lr + .pool + thumb_func_end sav1_set_battle_music_maybe + + thumb_func_start sav1_reset_battle_music_maybe +sav1_reset_battle_music_maybe: @ 8085800 + ldr r0, =0x03005d8c + ldr r1, [r0] + movs r0, 0 + strh r0, [r1, 0x2C] + bx lr + .pool + thumb_func_end sav1_reset_battle_music_maybe + + thumb_func_start sub_8085810 +sub_8085810: @ 8085810 + push {r4-r6,lr} + ldr r0, =0x00004001 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08085890 + bl warp1_target_get_music + lsls r0, 16 + lsrs r4, r0, 16 + bl current_map_music_get + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, =0x000001bb + cmp r4, r0 + beq _08085856 + ldr r0, =0x0000ffff + cmp r4, r0 + beq _08085856 + ldr r0, =0x0000019b + cmp r5, r0 + beq _08085890 + ldr r6, =0x0000016d + cmp r5, r6 + beq _08085890 + movs r0, 0x8 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + beq _08085856 + adds r4, r6, 0 +_08085856: + cmp r4, r5 + beq _08085890 + movs r0, 0x6 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + beq _08085888 + adds r0, r4, 0 + movs r1, 0x4 + movs r2, 0x4 + bl sub_80A2FBC + b _08085890 + .pool +_08085888: + adds r0, r4, 0 + movs r1, 0x8 + bl sub_80A2F88 +_08085890: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8085810 + + thumb_func_start sub_8085898 +sub_8085898: @ 8085898 + push {r4,lr} + bl current_map_music_get + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl sav1_map_get_music + lsls r0, 16 + lsrs r0, 16 + cmp r4, r0 + beq _080858BE + bl sav1_map_get_music + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x8 + bl sub_80A2F88 +_080858BE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8085898 + + thumb_func_start sub_80858C4 +sub_80858C4: @ 80858C4 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + bl current_map_music_get + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r4 + beq _080858E4 + ldr r0, =0x000001bb + cmp r1, r0 + beq _080858E4 + adds r0, r4, 0 + movs r1, 0x8 + bl sub_80A2F88 +_080858E4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80858C4 + + thumb_func_start is_warp1_light_level_8_or_9 +is_warp1_light_level_8_or_9: @ 80858F0 + push {lr} + bl warp1_get_mapheader + ldrb r0, [r0, 0x17] + bl is_light_level_8_or_9 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08085908 + movs r0, 0x4 + b _0808590A +_08085908: + movs r0, 0x2 +_0808590A: + pop {r1} + bx r1 + thumb_func_end is_warp1_light_level_8_or_9 + + thumb_func_start music_something +music_something: @ 8085910 + push {r4,r5,lr} + bl current_map_music_get + lsls r0, 16 + lsrs r5, r0, 16 + bl warp1_target_get_music + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x00004001 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0808597E + bl current_map_music_get + lsls r0, 16 + lsrs r0, 16 + cmp r4, r0 + beq _0808597E + ldr r0, =0x0000016d + cmp r5, r0 + bne _08085972 + ldr r0, =0x000040ca + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bne _08085972 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x0000ffff + ldrh r2, [r0, 0x4] + movs r0, 0xE0 + lsls r0, 3 + cmp r2, r0 + bne _08085972 + ldr r3, =0x020322e4 + ldrh r0, [r3] + ands r1, r0 + cmp r1, r2 + bne _08085972 + ldr r1, [r3, 0x4] + ldr r0, =0x0035001d + cmp r1, r0 + beq _0808597E +_08085972: + bl is_warp1_light_level_8_or_9 + lsls r0, 24 + lsrs r0, 24 + bl sub_80A2F50 +_0808597E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end music_something + + thumb_func_start sub_80859A0 +sub_80859A0: @ 80859A0 + push {lr} + bl sub_80A303C + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_80859A0 + + thumb_func_start sub_80859B0 +sub_80859B0: @ 80859B0 + push {lr} + movs r0, 0x4 + bl sub_80A2F50 + pop {r0} + bx r0 + thumb_func_end sub_80859B0 + + thumb_func_start sub_80859BC +sub_80859BC: @ 80859BC + push {r4,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + ldr r0, =0x02032306 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080859F0 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl MetatileBehavior_IsSurfableWaterOrUnderwater + lsls r0, 24 + cmp r0, 0 + beq _08085A2C +_080859F0: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x58 + bl __umodsi3 + adds r4, r0, 0 + adds r4, 0xD4 + lsls r4, 24 + lsrs r4, 24 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1E + bl __umodsi3 + adds r2, r0, 0 + adds r2, 0x32 + ldr r0, =0x02032304 + ldrh r0, [r0] + lsls r4, 24 + asrs r4, 24 + lsls r2, 24 + asrs r2, 24 + adds r1, r4, 0 + movs r3, 0x1 + bl sub_80A32C0 +_08085A2C: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80859BC + + thumb_func_start wild_encounter_related +wild_encounter_related: @ 8085A3C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r6, r0, 0 + adds r7, r1, 0 + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0x4 + bhi _08085B20 + lsls r0, 2 + ldr r1, =_08085A60 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08085A60: + .4byte _08085A74 + .4byte _08085A88 + .4byte _08085AA4 + .4byte _08085B0C + .4byte _08085B20 +_08085A74: + ldr r0, =0x02032304 + ldrh r0, [r0] + cmp r0, 0 + bne _08085A84 + movs r0, 0x4 + b _08085B1E + .pool +_08085A84: + movs r0, 0x1 + b _08085B1E +_08085A88: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x96 + lsls r1, 4 + bl __umodsi3 + movs r1, 0x96 + lsls r1, 3 + adds r0, r1 + strh r0, [r7] + movs r0, 0x3 + b _08085B1E +_08085AA4: + movs r0, 0x1 + mov r9, r0 + bl calc_player_party_count + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r5, 0 + b _08085ABC +_08085AB6: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_08085ABC: + cmp r5, r8 + bcs _08085AE4 + movs r0, 0x64 + muls r0, r5 + ldr r4, =0x020244ec + adds r0, r4 + movs r1, 0x6 + bl pokemon_getattr + cmp r0, 0 + bne _08085AB6 + adds r0, r4, 0 + bl GetMonAbility + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x44 + bne _08085AB6 + movs r1, 0x2 + mov r9, r1 +_08085AE4: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r4, 0x96 + lsls r4, 3 + adds r1, r4, 0 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + adds r0, r4 + mov r1, r9 + bl __divsi3 + strh r0, [r7] + movs r0, 0x3 + b _08085B1E + .pool +_08085B0C: + ldrh r0, [r7] + subs r0, 0x1 + strh r0, [r7] + lsls r0, 16 + cmp r0, 0 + bne _08085B20 + bl sub_80859BC + movs r0, 0x2 +_08085B1E: + strh r0, [r6] +_08085B20: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end wild_encounter_related + + thumb_func_start sub_8085B2C +sub_8085B2C: @ 8085B2C + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r1, [r0, 0x4] + movs r0, 0xB4 + lsls r0, 6 + cmp r1, r0 + bne _08085B5C + bl sub_813793C + lsls r0, 24 + cmp r0, 0 + bne _08085B5C + ldr r1, =0x02032306 + movs r0, 0x1 + strb r0, [r1] + bl sub_80B582C + b _08085B62 + .pool +_08085B5C: + ldr r0, =0x02032306 + bl wild_pokemon_rand_for_map +_08085B62: + ldr r1, =0x02032304 + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8085B2C + + thumb_func_start get_map_light_level_by_bank_and_number +@ int get_map_light_level_by_bank_and_number(int bank, int number) +get_map_light_level_by_bank_and_number: @ 8085B74 + push {lr} + lsls r0, 24 + asrs r0, 8 + lsrs r0, 16 + lsls r1, 24 + asrs r1, 8 + lsrs r1, 16 + bl get_mapheader_by_bank_and_number + ldrb r0, [r0, 0x17] + pop {r1} + bx r1 + thumb_func_end get_map_light_level_by_bank_and_number + + thumb_func_start get_map_light_level_from_warp +@ int get_map_light_level_from_warp(warpdata *warp) +get_map_light_level_from_warp: @ 8085B8C + push {lr} + movs r2, 0 + ldrsb r2, [r0, r2] + movs r1, 0x1 + ldrsb r1, [r0, r1] + adds r0, r2, 0 + bl get_map_light_level_by_bank_and_number + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end get_map_light_level_from_warp + + thumb_func_start sav1_map_get_light_level +sav1_map_get_light_level: @ 8085BA4 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + adds r0, 0x4 + bl get_map_light_level_from_warp + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sav1_map_get_light_level + + thumb_func_start get_map_light_from_warp0 +get_map_light_from_warp0: @ 8085BBC + push {lr} + ldr r0, =0x020322dc + bl get_map_light_level_from_warp + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end get_map_light_from_warp0 + + thumb_func_start is_light_level_1_2_3_5_or_6 +is_light_level_1_2_3_5_or_6: @ 8085BD0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + beq _08085BEA + cmp r0, 0x1 + beq _08085BEA + cmp r0, 0x5 + beq _08085BEA + cmp r0, 0x2 + beq _08085BEA + cmp r0, 0x6 + bne _08085BEE +_08085BEA: + movs r0, 0x1 + b _08085BF0 +_08085BEE: + movs r0, 0 +_08085BF0: + pop {r1} + bx r1 + thumb_func_end is_light_level_1_2_3_5_or_6 + + thumb_func_start is_light_level_1_2_3_or_6 +is_light_level_1_2_3_or_6: @ 8085BF4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + beq _08085C0A + cmp r0, 0x1 + beq _08085C0A + cmp r0, 0x6 + beq _08085C0A + cmp r0, 0x2 + bne _08085C0E +_08085C0A: + movs r0, 0x1 + b _08085C10 +_08085C0E: + movs r0, 0 +_08085C10: + pop {r1} + bx r1 + thumb_func_end is_light_level_1_2_3_or_6 + + thumb_func_start is_light_level_8_or_9 +is_light_level_8_or_9: @ 8085C14 + push {lr} + lsls r0, 24 + movs r1, 0xF8 + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bls _08085C28 + movs r0, 0 + b _08085C2A +_08085C28: + movs r0, 0x1 +_08085C2A: + pop {r1} + bx r1 + thumb_func_end is_light_level_8_or_9 + + thumb_func_start sav1_saved_warp2_map_get_name +sav1_saved_warp2_map_get_name: @ 8085C30 + push {lr} + ldr r0, =0x03005d8c + ldr r1, [r0] + movs r0, 0x14 + ldrsb r0, [r1, r0] + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1, 0x15] + lsls r1, 24 + asrs r1, 24 + lsls r1, 16 + lsrs r1, 16 + bl get_mapheader_by_bank_and_number + ldrb r0, [r0, 0x14] + pop {r1} + bx r1 + .pool + thumb_func_end sav1_saved_warp2_map_get_name + + thumb_func_start sav1_map_get_name +sav1_map_get_name: @ 8085C58 + push {lr} + ldr r0, =0x03005d8c + ldr r1, [r0] + movs r0, 0x4 + ldrsb r0, [r1, r0] + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1, 0x5] + lsls r1, 24 + asrs r1, 24 + lsls r1, 16 + lsrs r1, 16 + bl get_mapheader_by_bank_and_number + ldrb r0, [r0, 0x14] + pop {r1} + bx r1 + .pool + thumb_func_end sav1_map_get_name + + thumb_func_start sav1_map_get_battletype +sav1_map_get_battletype: @ 8085C80 + push {lr} + ldr r0, =0x03005d8c + ldr r1, [r0] + movs r0, 0x4 + ldrsb r0, [r1, r0] + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1, 0x5] + lsls r1, 24 + asrs r1, 24 + lsls r1, 16 + lsrs r1, 16 + bl get_mapheader_by_bank_and_number + ldrb r0, [r0, 0x1B] + pop {r1} + bx r1 + .pool + thumb_func_end sav1_map_get_battletype + + thumb_func_start overworld_bg_setup +@ void overworld_bg_setup() +overworld_bg_setup: @ 8085CA8 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r1, =gUnknown_08339DAC + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + movs r0, 0x1 + movs r1, 0x5 + movs r2, 0x1 + bl SetBgAttribute + movs r0, 0x2 + movs r1, 0x5 + movs r2, 0x1 + bl SetBgAttribute + movs r0, 0x3 + movs r1, 0x5 + movs r2, 0x1 + bl SetBgAttribute + ldr r0, =0x03005da0 + mov r8, r0 + movs r4, 0x80 + lsls r4, 4 + adds r0, r4, 0 + bl AllocZeroed + mov r1, r8 + str r0, [r1] + ldr r6, =0x03005d9c + adds r0, r4, 0 + bl AllocZeroed + str r0, [r6] + ldr r5, =0x03005da4 + adds r0, r4, 0 + bl AllocZeroed + str r0, [r5] + mov r0, r8 + ldr r1, [r0] + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, [r6] + movs r0, 0x2 + bl SetBgTilemapBuffer + ldr r1, [r5] + movs r0, 0x3 + bl SetBgTilemapBuffer + bl sub_81971D0 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end overworld_bg_setup + + thumb_func_start overworld_free_bg_tilemaps +overworld_free_bg_tilemaps: @ 8085D34 + push {r4,lr} + bl sub_81BE72C + bl sub_81971F4 + ldr r4, =0x03005da4 + ldr r0, [r4] + cmp r0, 0 + beq _08085D4E + bl Free + movs r0, 0 + str r0, [r4] +_08085D4E: + ldr r4, =0x03005d9c + ldr r0, [r4] + cmp r0, 0 + beq _08085D5E + bl Free + movs r0, 0 + str r0, [r4] +_08085D5E: + ldr r4, =0x03005da0 + ldr r0, [r4] + cmp r0, 0 + beq _08085D6E + bl Free + movs r0, 0 + str r0, [r4] +_08085D6E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end overworld_free_bg_tilemaps + + thumb_func_start ResetSafariZoneFlag_ +ResetSafariZoneFlag_: @ 8085D80 + push {lr} + bl ResetSafariZoneFlag + pop {r0} + bx r0 + thumb_func_end ResetSafariZoneFlag_ + + thumb_func_start is_c1_link_related_active +@ _BOOL4 is_c1_link_related_active() +is_c1_link_related_active: @ 8085D8C + push {lr} + ldr r0, =0x030022c0 + ldr r1, [r0] + ldr r0, =c1_link_related + cmp r1, r0 + beq _08085DA4 + movs r0, 0 + b _08085DA6 + .pool +_08085DA4: + movs r0, 0x1 +_08085DA6: + pop {r1} + bx r1 + thumb_func_end is_c1_link_related_active + + thumb_func_start c1_overworld_normal +@ void c1_overworld_normal(int buttons_new, int buttons_held) +c1_overworld_normal: @ 8085DAC + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r0, 16 + adds r5, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r4, r1, 0 + bl sub_808B578 + mov r6, sp + mov r0, sp + bl sub_809BEDC + mov r0, sp + adds r1, r5, 0 + adds r2, r4, 0 + bl process_overworld_input + bl script_env_2_is_enabled + lsls r0, 24 + cmp r0, 0 + bne _08085DFA + mov r0, sp + bl sub_809C014 + cmp r0, 0x1 + bne _08085DF0 + bl script_env_2_enable + bl HideMapNamePopUpWindow + b _08085DFA +_08085DF0: + ldrb r0, [r6, 0x2] + adds r1, r5, 0 + adds r2, r4, 0 + bl player_step +_08085DFA: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end c1_overworld_normal + + thumb_func_start c1_overworld +c1_overworld: @ 8085E04 + push {lr} + ldr r2, =0x030022c0 + ldr r1, [r2, 0x4] + ldr r0, =c2_overworld + cmp r1, r0 + bne _08085E18 + ldrh r0, [r2, 0x2E] + ldrh r1, [r2, 0x2C] + bl c1_overworld_normal +_08085E18: + pop {r0} + bx r0 + .pool + thumb_func_end c1_overworld + + thumb_func_start c2_overworld_basic +@ void c2_overworld_basic() +c2_overworld_basic: @ 8085E24 + push {lr} + bl script_env_2_run_current_script + bl RunActiveTasks + bl CallObjectCallbacks + bl CameraUpdate + bl UpdateCameraPanning + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + bl sub_80A0A38 + bl do_scheduled_bg_tilemap_copies_to_vram + pop {r0} + bx r0 + thumb_func_end c2_overworld_basic + + thumb_func_start sub_8085E50 +sub_8085E50: @ 8085E50 + push {lr} + bl c2_overworld_basic + pop {r0} + bx r0 + thumb_func_end sub_8085E50 + + thumb_func_start c2_overworld +c2_overworld: @ 8085E5C + push {r4,lr} + ldr r0, =0x02037fd4 + ldrb r0, [r0, 0x7] + lsrs r0, 7 + adds r4, r0, 0 + cmp r4, 0 + beq _08085E70 + movs r0, 0 + bl SetVBlankCallback +_08085E70: + bl c2_overworld_basic + cmp r4, 0 + beq _08085E7C + bl SetFieldVBlankCallback +_08085E7C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end c2_overworld + + thumb_func_start set_callback1 +set_callback1: @ 8085E88 + ldr r1, =0x030022c0 + str r0, [r1] + bx lr + .pool + thumb_func_end set_callback1 + + thumb_func_start sub_8085E94 +sub_8085E94: @ 8085E94 + ldr r1, =0x03000e0c + str r0, [r1] + bx lr + .pool + thumb_func_end sub_8085E94 + + thumb_func_start map_post_load_hook_exec +map_post_load_hook_exec: @ 8085EA0 + push {r4,lr} + ldr r4, =0x03005db0 + ldr r0, [r4] + cmp r0, 0 + beq _08085ECC + bl _call_via_r0 + lsls r0, 24 + cmp r0, 0 + bne _08085EBC + movs r0, 0 + b _08085EEC + .pool +_08085EBC: + movs r1, 0 + str r1, [r4] + ldr r0, =0x03005dac + str r1, [r0] + b _08085EEA + .pool +_08085ECC: + ldr r0, =0x03005dac + ldr r0, [r0] + cmp r0, 0 + beq _08085EE0 + bl _call_via_r0 + b _08085EE4 + .pool +_08085EE0: + bl mapldr_default +_08085EE4: + ldr r1, =0x03005dac + movs r0, 0 + str r0, [r1] +_08085EEA: + movs r0, 0x1 +_08085EEC: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end map_post_load_hook_exec + + thumb_func_start CB2_NewGame +CB2_NewGame: @ 8085EF8 + push {lr} + bl sub_808631C + bl sub_80A2F30 + bl ResetSafariZoneFlag_ + bl NewGameInitData + bl player_avatar_init_params_reset + bl set_max_playtime_if_appropriate + bl script_env_1_init + bl script_env_2_disable + ldr r1, =0x03005dac + ldr r0, =sub_80FB4E0 + str r0, [r1] + ldr r1, =0x03005db0 + movs r0, 0 + str r0, [r1] + ldr r0, =0x030026f8 + bl do_load_map_stuff_loop + bl SetFieldVBlankCallback + ldr r0, =c1_overworld + bl set_callback1 + ldr r0, =c2_overworld + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end CB2_NewGame + + thumb_func_start c2_whiteout +c2_whiteout: @ 8085F58 + push {lr} + sub sp, 0x4 + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x77 + bls _08085FB0 + bl sub_808631C + bl sub_80A2F30 + bl ResetSafariZoneFlag_ + bl sub_8084620 + bl player_avatar_init_params_reset + bl script_env_1_init + bl script_env_2_disable + ldr r1, =0x03005dac + ldr r0, =sub_80AF3C8 + str r0, [r1] + mov r1, sp + movs r0, 0 + strb r0, [r1] + mov r0, sp + bl do_load_map_stuff_loop + bl SetFieldVBlankCallback + ldr r0, =c1_overworld + bl set_callback1 + ldr r0, =c2_overworld + bl SetMainCallback2 +_08085FB0: + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end c2_whiteout + + thumb_func_start c2_load_new_map +c2_load_new_map: @ 8085FCC + push {lr} + bl sub_808631C + bl script_env_1_init + bl script_env_2_disable + movs r0, 0 + bl set_callback1 + ldr r0, =c2_change_map + bl SetMainCallback2 + ldr r1, =0x030022c0 + ldr r0, =c2_load_new_map_2 + str r0, [r1, 0x8] + pop {r0} + bx r0 + .pool + thumb_func_end c2_load_new_map + + thumb_func_start c2_load_new_map_2 +c2_load_new_map_2: @ 8085FFC + push {lr} + ldr r0, =0x030026f8 + bl do_load_map_stuff_loop + bl SetFieldVBlankCallback + ldr r0, =c1_overworld + bl set_callback1 + ldr r0, =c2_overworld + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end c2_load_new_map_2 + + thumb_func_start sub_8086024 +sub_8086024: @ 8086024 + push {r4,lr} + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0 + bne _08086046 + bl sub_808631C + bl script_env_1_init + bl script_env_2_disable + movs r0, 0 + bl set_callback1 +_08086046: + adds r0, r4, 0 + movs r1, 0x1 + bl load_map_stuff + cmp r0, 0 + beq _08086062 + bl SetFieldVBlankCallback + ldr r0, =c1_overworld + bl set_callback1 + ldr r0, =c2_overworld + bl SetMainCallback2 +_08086062: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086024 + + thumb_func_start sub_8086074 +sub_8086074: @ 8086074 + push {lr} + bl sub_808631C + ldr r0, =0x03005dac + ldr r1, =sub_80AF314 + str r1, [r0] + ldr r0, =c2_80567AC + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086074 + + thumb_func_start c2_80567AC +c2_80567AC: @ 8086098 + push {lr} + ldr r0, =0x030026f8 + bl map_loading_iteration_3 + cmp r0, 0 + beq _080860B8 + bl SetFieldVBlankCallback + ldr r0, =c1_link_related + bl set_callback1 + bl sub_8086C2C + ldr r0, =c2_overworld + bl SetMainCallback2 +_080860B8: + pop {r0} + bx r0 + .pool + thumb_func_end c2_80567AC + + thumb_func_start c2_exit_to_overworld_2_switch +c2_exit_to_overworld_2_switch: @ 80860C8 + push {lr} + bl is_c1_link_related_active + cmp r0, 0x1 + bne _080860E0 + ldr r0, =c2_exit_to_overworld_2_link + bl SetMainCallback2 + b _080860EA + .pool +_080860E0: + bl sub_808631C + ldr r0, =c2_exit_to_overworld_2_local + bl SetMainCallback2 +_080860EA: + pop {r0} + bx r0 + .pool + thumb_func_end c2_exit_to_overworld_2_switch + + thumb_func_start c2_exit_to_overworld_2_local +c2_exit_to_overworld_2_local: @ 80860F4 + push {lr} + ldr r0, =0x030026f8 + bl sub_8086638 + cmp r0, 0 + beq _0808610A + bl SetFieldVBlankCallback + ldr r0, =c2_overworld + bl SetMainCallback2 +_0808610A: + pop {r0} + bx r0 + .pool + thumb_func_end c2_exit_to_overworld_2_local + + thumb_func_start c2_exit_to_overworld_2_link +c2_exit_to_overworld_2_link: @ 8086118 + push {lr} + bl sub_8087598 + cmp r0, 0 + bne _08086132 + ldr r0, =0x030026f8 + bl map_loading_iteration_2_link + cmp r0, 0 + beq _08086132 + ldr r0, =c2_overworld + bl SetMainCallback2 +_08086132: + pop {r0} + bx r0 + .pool + thumb_func_end c2_exit_to_overworld_2_link + + thumb_func_start c2_8056854 +c2_8056854: @ 8086140 + push {lr} + bl sub_808631C + bl sub_80A2F30 + ldr r0, =c1_link_related + bl set_callback1 + bl sub_8086C2C + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08086174 + ldr r1, =0x03005dac + ldr r0, =sub_80AF314 + b _08086178 + .pool +_08086174: + ldr r1, =0x03005dac + ldr r0, =sub_80AF214 +_08086178: + str r0, [r1] + bl script_env_1_init + bl script_env_2_disable + bl c2_exit_to_overworld_2_switch + pop {r0} + bx r0 + .pool + thumb_func_end c2_8056854 + + thumb_func_start sub_8086194 +sub_8086194: @ 8086194 + push {lr} + bl sub_808631C + ldr r1, =0x03005db0 + ldr r0, =sub_80AF6A4 + str r0, [r1] + bl c2_exit_to_overworld_2_switch + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086194 + + thumb_func_start sub_80861B0 +sub_80861B0: @ 80861B0 + push {lr} + bl sub_808631C + ldr r1, =0x03005dac + ldr r0, =sub_80AF188 + str r0, [r1] + bl c2_exit_to_overworld_2_switch + pop {r0} + bx r0 + .pool + thumb_func_end sub_80861B0 + + thumb_func_start c2_exit_to_overworld_1_continue_scripts_restart_music +c2_exit_to_overworld_1_continue_scripts_restart_music: @ 80861CC + push {lr} + bl sub_808631C + ldr r1, =0x03005dac + ldr r0, =sub_80AF168 + str r0, [r1] + bl c2_exit_to_overworld_2_switch + pop {r0} + bx r0 + .pool + thumb_func_end c2_exit_to_overworld_1_continue_scripts_restart_music + + thumb_func_start sub_80861E8 +sub_80861E8: @ 80861E8 + push {lr} + bl sub_808631C + ldr r1, =0x03005dac + ldr r0, =sub_80AF3C8 + str r0, [r1] + bl c2_exit_to_overworld_2_switch + pop {r0} + bx r0 + .pool + thumb_func_end sub_80861E8 + + thumb_func_start sub_8086204 +sub_8086204: @ 8086204 + push {lr} + ldr r0, =0x02037318 + ldrb r1, [r0, 0x1A] + movs r0, 0xF8 + ands r0, r1 + cmp r0, 0x8 + bne _08086222 + bl sub_80E909C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08086222 + bl AddMapNamePopUpWindowTask +_08086222: + bl sub_80AF3C8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086204 + + thumb_func_start sub_8086230 +sub_8086230: @ 8086230 + push {r4,lr} + bl sub_808631C + bl sub_80A2F30 + bl ResetSafariZoneFlag_ + ldr r0, =0x03006210 + ldrh r0, [r0] + cmp r0, 0xFF + bne _0808624A + bl sub_81A3908 +_0808624A: + bl set_current_map_header_from_sav1 + bl set_warp2_warp3_to_neg_1 + bl GetCurrentTrainerHillMapId + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037318 + ldrh r1, [r0, 0x12] + ldr r0, =0x00000169 + cmp r1, r0 + bne _08086278 + bl sub_81AA2F8 + b _0808628A + .pool +_08086278: + cmp r4, 0 + beq _08086286 + cmp r4, 0x6 + beq _08086286 + bl sub_81D5F48 + b _0808628A +_08086286: + bl CopyFieldObjectTemplateCoordsToSav1 +_0808628A: + bl sub_809757C + bl sub_809E7B0 + bl sub_8084788 + ldr r0, =0x02037318 + ldrh r1, [r0, 0x12] + ldr r0, =0x00000169 + cmp r1, r0 + bne _080862B0 + movs r0, 0x1 + bl battle_pyramid_map_load_related + b _080862BE + .pool +_080862B0: + cmp r4, 0 + beq _080862BA + bl trainer_hill_map_load_related + b _080862BE +_080862BA: + bl sub_8087D74 +_080862BE: + bl set_max_playtime_if_appropriate + bl script_env_1_init + bl script_env_2_disable + bl sub_8195E10 + bl sav2_x1_query_bit1 + cmp r0, 0x1 + bne _080862F4 + bl sav2_x9_clear_bit1 + bl warp1_set_to_sav1w + bl warp_in + bl sub_80EDB44 + ldr r0, =c2_load_new_map + bl SetMainCallback2 + b _08086308 + .pool +_080862F4: + bl sub_80EDB44 + ldr r0, =0x03005dac + ldr r1, =sub_8086204 + str r1, [r0] + ldr r0, =c1_overworld + bl set_callback1 + bl c2_exit_to_overworld_2_switch +_08086308: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086230 + + thumb_func_start sub_808631C +@ void sub_808631C() +sub_808631C: @ 808631C + push {r4,lr} + bl warp0_in_pokecenter + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0808632E + bl sub_80097E8 +_0808632E: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08086348 + movs r0, 0xC5 + bl EnableInterrupts + movs r0, 0x2 + bl DisableInterrupts + b _08086362 + .pool +_08086348: + ldr r4, =0x04000208 + ldrh r3, [r4] + strh r0, [r4] + ldr r2, =0x04000200 + ldrh r1, [r2] + ldr r0, =0x0000fffd + ands r0, r1 + strh r0, [r2] + ldrh r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] + strh r3, [r4] +_08086362: + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + bl SetHBlankCallback + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808631C + + thumb_func_start SetFieldVBlankCallback +@ void SetFieldVBlankCallback() +SetFieldVBlankCallback: @ 8086380 + push {lr} + ldr r0, =VBlankCB_Field + bl SetVBlankCallback + pop {r0} + bx r0 + .pool + thumb_func_end SetFieldVBlankCallback + + thumb_func_start VBlankCB_Field +VBlankCB_Field: @ 8086390 + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl sub_80BA0A8 + bl FieldUpdateBgTilemapScroll + bl copy_pal_bg_faded_to_pal_ram + bl sub_80A09D0 + pop {r0} + bx r0 + thumb_func_end VBlankCB_Field + + thumb_func_start sub_80863B0 +sub_80863B0: @ 80863B0 + push {lr} + bl sub_81A9E6C + lsls r0, 24 + cmp r0, 0 + beq _080863D4 + bl door_upload_tiles + ldr r2, =gUnknown_08339DBC + ldr r0, [r2] + ldr r1, [r2, 0x4] + ldr r2, [r2, 0x8] + bl sub_80BA038 + b _080863F0 + .pool +_080863D4: + bl sav1_get_flash_used_on_map + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _080863F0 + bl sub_80B00E8 + ldr r2, =gUnknown_08339DBC + ldr r0, [r2] + ldr r1, [r2, 0x4] + ldr r2, [r2, 0x8] + bl sub_80BA038 +_080863F0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80863B0 + + thumb_func_start map_loading_iteration_3 +map_loading_iteration_3: @ 80863F8 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0xD + bls _08086404 + b _08086512 +_08086404: + lsls r0, 2 + ldr r1, =_08086414 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08086414: + .4byte _0808644C + .4byte _08086462 + .4byte _0808646A + .4byte _08086472 + .4byte _08086484 + .4byte _08086492 + .4byte _08086498 + .4byte _080864A8 + .4byte _080864B8 + .4byte _080864D4 + .4byte _080864DA + .4byte _080864E0 + .4byte _080864FC + .4byte _0808650E +_0808644C: + bl overworld_bg_setup + bl script_env_1_init + bl script_env_2_disable + bl saveblock_randomize_and_relocate_ + bl sub_80867D8 + b _08086506 +_08086462: + movs r0, 0x1 + bl mli0_load_map + b _08086506 +_0808646A: + movs r0, 0x1 + bl sub_8086988 + b _08086506 +_08086472: + bl sub_8086AE4 + bl sub_80869DC + bl sub_8086B14 + bl sub_8086AAC + b _08086506 +_08086484: + bl sub_80863B0 + bl map_loading_lcd_reset + bl sub_8197200 + b _08086506 +_08086492: + bl move_tilemap_camera_to_upper_left_corner + b _08086506 +_08086498: + ldr r0, =0x02037318 + ldr r0, [r0] + bl copy_map_tileset1_to_vram + b _08086506 + .pool +_080864A8: + ldr r0, =0x02037318 + ldr r0, [r0] + bl copy_map_tileset2_to_vram + b _08086506 + .pool +_080864B8: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08086512 + ldr r0, =0x02037318 + ldr r0, [r0] + bl apply_map_tileset1_tileset2_palette + b _08086506 + .pool +_080864D4: + bl DrawWholeMapView + b _08086506 +_080864DA: + bl cur_mapheader_run_tileset_funcs_after_some_cpuset + b _08086506 +_080864E0: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08086506 + bl sub_800E0E8 + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + b _08086506 + .pool +_080864FC: + bl map_post_load_hook_exec + lsls r0, 24 + cmp r0, 0 + beq _08086512 +_08086506: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _08086512 +_0808650E: + movs r0, 0x1 + b _08086514 +_08086512: + movs r0, 0 +_08086514: + pop {r4} + pop {r1} + bx r1 + thumb_func_end map_loading_iteration_3 + + thumb_func_start load_map_stuff +@ int load_map_stuff(u8 *a1, int a2) +load_map_stuff: @ 808651C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4] + cmp r0, 0xD + bls _0808652A + b _0808662E +_0808652A: + lsls r0, 2 + ldr r1, =_08086538 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08086538: + .4byte _08086570 + .4byte _0808657C + .4byte _08086586 + .4byte _0808658E + .4byte _08086598 + .4byte _080865A6 + .4byte _080865AC + .4byte _080865BC + .4byte _080865CC + .4byte _080865E8 + .4byte _080865EE + .4byte _080865F4 + .4byte _08086618 + .4byte _0808662A +_08086570: + bl sub_808631C + adds r0, r5, 0 + bl mli0_load_map + b _08086622 +_0808657C: + bl saveblock_randomize_and_relocate_ + bl sub_80867D8 + b _08086622 +_08086586: + adds r0, r5, 0 + bl sub_8086988 + b _08086622 +_0808658E: + bl mli4_mapscripts_and_other + bl sub_8086A80 + b _08086622 +_08086598: + bl sub_80863B0 + bl map_loading_lcd_reset + bl sub_8197200 + b _08086622 +_080865A6: + bl move_tilemap_camera_to_upper_left_corner + b _08086622 +_080865AC: + ldr r0, =0x02037318 + ldr r0, [r0] + bl copy_map_tileset1_to_vram + b _08086622 + .pool +_080865BC: + ldr r0, =0x02037318 + ldr r0, [r0] + bl copy_map_tileset2_to_vram + b _08086622 + .pool +_080865CC: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0808662E + ldr r0, =0x02037318 + ldr r0, [r0] + bl apply_map_tileset1_tileset2_palette + b _08086622 + .pool +_080865E8: + bl DrawWholeMapView + b _08086622 +_080865EE: + bl cur_mapheader_run_tileset_funcs_after_some_cpuset + b _08086622 +_080865F4: + ldr r0, =0x02037318 + ldrb r1, [r0, 0x1A] + movs r0, 0xF8 + ands r0, r1 + cmp r0, 0x8 + bne _08086622 + bl sub_80E909C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08086622 + bl AddMapNamePopUpWindowTask + b _08086622 + .pool +_08086618: + bl map_post_load_hook_exec + lsls r0, 24 + cmp r0, 0 + beq _0808662E +_08086622: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _0808662E +_0808662A: + movs r0, 0x1 + b _08086630 +_0808662E: + movs r0, 0 +_08086630: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end load_map_stuff + + thumb_func_start sub_8086638 +sub_8086638: @ 8086638 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0x1 + beq _0808666E + cmp r0, 0x1 + bgt _0808664C + cmp r0, 0 + beq _08086656 + b _0808668E +_0808664C: + cmp r0, 0x2 + beq _08086678 + cmp r0, 0x3 + beq _0808668A + b _0808668E +_08086656: + bl saveblock_randomize_and_relocate_ + bl sub_80867D8 + movs r0, 0 + bl sub_8086988 + bl sub_8086A68 + bl sub_8086A80 + b _08086682 +_0808666E: + bl sub_8086860 + bl sub_81D64C0 + b _08086682 +_08086678: + bl map_post_load_hook_exec + lsls r0, 24 + cmp r0, 0 + beq _0808668E +_08086682: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _0808668E +_0808668A: + movs r0, 0x1 + b _08086690 +_0808668E: + movs r0, 0 +_08086690: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8086638 + + thumb_func_start map_loading_iteration_2_link +map_loading_iteration_2_link: @ 8086698 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0xD + bls _080866A4 + b _080867A8 +_080866A4: + lsls r0, 2 + ldr r1, =_080866B4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080866B4: + .4byte _080866EC + .4byte _080866FA + .4byte _08086702 + .4byte _08086710 + .4byte _0808671E + .4byte _08086724 + .4byte _08086734 + .4byte _08086744 + .4byte _08086760 + .4byte _08086766 + .4byte _08086792 + .4byte _0808676C + .4byte _08086788 + .4byte _0808679A +_080866EC: + bl sub_808631C + bl saveblock_randomize_and_relocate_ + bl sub_80867D8 + b _08086792 +_080866FA: + movs r0, 0x1 + bl sub_8086988 + b _08086792 +_08086702: + bl sub_8086B9C + bl sub_8086A68 + bl sub_8086AC8 + b _08086792 +_08086710: + bl sub_80863B0 + bl map_loading_lcd_reset + bl sub_8197200 + b _08086792 +_0808671E: + bl move_tilemap_camera_to_upper_left_corner + b _08086792 +_08086724: + ldr r0, =0x02037318 + ldr r0, [r0] + bl copy_map_tileset1_to_vram + b _08086792 + .pool +_08086734: + ldr r0, =0x02037318 + ldr r0, [r0] + bl copy_map_tileset2_to_vram + b _08086792 + .pool +_08086744: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080867A8 + ldr r0, =0x02037318 + ldr r0, [r0] + bl apply_map_tileset1_tileset2_palette + b _08086792 + .pool +_08086760: + bl DrawWholeMapView + b _08086792 +_08086766: + bl cur_mapheader_run_tileset_funcs_after_some_cpuset + b _08086792 +_0808676C: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08086792 + bl sub_800E0E8 + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + b _08086792 + .pool +_08086788: + bl map_post_load_hook_exec + lsls r0, 24 + cmp r0, 0 + beq _080867A8 +_08086792: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _080867A8 +_0808679A: + bl SetFieldVBlankCallback + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + movs r0, 0x1 + b _080867AA +_080867A8: + movs r0, 0 +_080867AA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end map_loading_iteration_2_link + + thumb_func_start do_load_map_stuff_loop +do_load_map_stuff_loop: @ 80867B0 + push {r4,lr} + adds r4, r0, 0 +_080867B4: + adds r0, r4, 0 + movs r1, 0 + bl load_map_stuff + cmp r0, 0 + beq _080867B4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end do_load_map_stuff_loop + + thumb_func_start saveblock_randomize_and_relocate_ +saveblock_randomize_and_relocate_: @ 80867C8 + push {lr} + bl sub_81BE6AC + bl saveblock_randomize_and_relocate + pop {r0} + bx r0 + thumb_func_end saveblock_randomize_and_relocate_ + + thumb_func_start sub_80867D8 +sub_80867D8: @ 80867D8 + push {r4-r7,lr} + sub sp, 0x4 + movs r0, 0 + movs r1, 0 + bl SetGpuReg + bl remove_some_task + ldr r2, =0x05000002 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, =0x040000d4 + mov r0, sp + str r0, [r1] + str r2, [r1, 0x4] + ldr r0, =0x810001ff + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r2, 0xC0 + lsls r2, 19 + movs r3, 0xC0 + lsls r3, 9 + mov r4, sp + movs r6, 0 + movs r5, 0x80 + lsls r5, 5 + ldr r7, =0x81000800 + movs r0, 0x81 + lsls r0, 24 + mov r12, r0 +_08086816: + strh r6, [r4] + mov r0, sp + str r0, [r1] + str r2, [r1, 0x4] + str r7, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r2, r5 + subs r3, r5 + cmp r3, r5 + bhi _08086816 + strh r6, [r4] + mov r0, sp + str r0, [r1] + str r2, [r1, 0x4] + lsrs r0, r3, 1 + mov r2, r12 + orrs r0, r2 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r0, 0 + movs r1, 0x80 + bl ResetSpriteRange + bl LoadOamFromSprites + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80867D8 + + thumb_func_start sub_8086860 +sub_8086860: @ 8086860 + push {lr} + bl sub_80863B0 + bl map_loading_lcd_reset + bl sub_8197200 + bl mapdata_load_assets_to_gpu_and_full_redraw + pop {r0} + bx r0 + thumb_func_end sub_8086860 + + thumb_func_start map_loading_lcd_reset +map_loading_lcd_reset: @ 8086878 + push {r4,lr} + bl clear_scheduled_bg_copies_to_vram + bl reset_temp_tile_data_buffers + movs r0, 0x4C + movs r1, 0 + bl SetGpuReg + ldr r1, =0x00001f1f + movs r0, 0x48 + bl SetGpuReg + ldr r1, =0x00000101 + movs r0, 0x4A + bl SetGpuReg + movs r0, 0x40 + movs r1, 0xFF + bl SetGpuReg + movs r0, 0x44 + movs r1, 0xFF + bl SetGpuReg + ldr r4, =0x0000ffff + movs r0, 0x42 + adds r1, r4, 0 + bl SetGpuReg + movs r0, 0x46 + adds r1, r4, 0 + bl SetGpuReg + ldr r0, =gUnknown_82EC7C4 + ldrh r1, [r0, 0x2] + ldrh r2, [r0, 0x4] + orrs r1, r2 + ldrh r0, [r0, 0x6] + orrs r1, r0 + movs r2, 0x82 + lsls r2, 5 + adds r0, r2, 0 + orrs r1, r0 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x0000070d + movs r0, 0x52 + bl SetGpuReg + bl overworld_bg_setup + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x3 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + ldr r1, =0x00007060 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + bl sub_8098128 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end map_loading_lcd_reset + + thumb_func_start sub_8086988 +sub_8086988: @ 8086988 + push {r4,lr} + adds r4, r0, 0 + bl clear_tasks + bl ResetAllObjectData + bl sub_80A1A74 + bl dp12_8087EA4 + bl dp13_810BB8C + bl ResetCameraUpdateInfo + bl InstallCameraPanAheadCallback + cmp r4, 0 + bne _080869B4 + movs r0, 0 + bl npc_paltag_set_load + b _080869BA +_080869B4: + movs r0, 0x1 + bl npc_paltag_set_load +_080869BA: + bl FieldEffectActiveListClear + bl sub_80AAFA4 + bl sub_80AEE84 + cmp r4, 0 + bne _080869CE + bl overworld_ensure_per_step_coros_running +_080869CE: + bl mapheader_run_script_with_tag_x5 + bl sub_81BE6B8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8086988 + + thumb_func_start sub_80869DC +sub_80869DC: @ 80869DC + push {lr} + ldr r0, =0x03005dec + movs r1, 0 + strh r1, [r0] + ldr r0, =0x03005de8 + strh r1, [r0] + bl sub_808D438 + movs r0, 0 + movs r1, 0 + bl SpawnFieldObjectsInView + bl mapheader_run_first_tag4_script_list_match + pop {r0} + bx r0 + .pool + thumb_func_end sub_80869DC + + thumb_func_start mli4_mapscripts_and_other +mli4_mapscripts_and_other: @ 8086A04 + push {r4,r5,lr} + sub sp, 0x4 + ldr r0, =0x03005dec + movs r1, 0 + strh r1, [r0] + ldr r0, =0x03005de8 + strh r1, [r0] + bl sub_808D438 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl sav1_camera_get_focus_coords + bl sub_80852D4 + adds r5, r0, 0 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + ldrb r2, [r5, 0x1] + ldr r3, =0x03005d90 + ldr r3, [r3] + ldrb r3, [r3, 0x8] + bl InitPlayerAvatar + ldrb r0, [r5] + bl SetPlayerAvatarTransitionFlags + bl player_avatar_init_params_reset + movs r0, 0 + movs r1, 0 + bl SpawnFieldObjectsInView + bl mapheader_run_first_tag4_script_list_match + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end mli4_mapscripts_and_other + + thumb_func_start sub_8086A68 +sub_8086A68: @ 8086A68 + push {lr} + movs r0, 0 + movs r1, 0 + bl sub_808E16C + bl sub_80FBED0 + bl mapheader_run_script_with_tag_x7 + pop {r0} + bx r0 + thumb_func_end sub_8086A68 + + thumb_func_start sub_8086A80 +sub_8086A80: @ 8086A80 + push {lr} + ldr r2, =0x02037350 + ldr r3, =0x02037590 + ldrb r1, [r3, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0, 0x1] + ldrb r0, [r3, 0x4] + bl InitCameraUpdateCallback + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086A80 + + thumb_func_start sub_8086AAC +sub_8086AAC: @ 8086AAC + push {lr} + ldr r0, =0x03005db4 + ldrb r0, [r0] + bl sub_8087858 + lsls r0, 24 + lsrs r0, 24 + bl InitCameraUpdateCallback + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086AAC + + thumb_func_start sub_8086AC8 +sub_8086AC8: @ 8086AC8 + push {lr} + ldr r0, =0x03005db4 + ldrb r0, [r0] + bl sub_8087858 + lsls r0, 24 + lsrs r0, 24 + bl InitCameraUpdateCallback + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086AC8 + + thumb_func_start sub_8086AE4 +sub_8086AE4: @ 8086AE4 + push {r4,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl sav1_camera_get_focus_coords + mov r2, sp + ldr r0, =0x03005db4 + ldrb r1, [r0] + ldrh r0, [r2] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r4] + bl sub_8088B3C + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086AE4 + + thumb_func_start sub_8086B14 +sub_8086B14: @ 8086B14 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl sav1_camera_get_focus_coords + mov r3, sp + mov r2, sp + ldr r0, =0x03005db4 + ldrb r1, [r0] + ldrh r0, [r2] + subs r0, r1 + strh r0, [r3] + movs r6, 0 + ldr r0, =0x03005db8 + mov r8, r4 + ldrb r0, [r0] + cmp r6, r0 + bcs _08086B7E + ldr r7, =0x020229e8 +_08086B44: + lsls r5, r6, 24 + lsrs r5, 24 + mov r0, sp + ldrh r1, [r0] + adds r1, r6, r1 + lsls r1, 16 + asrs r1, 16 + mov r0, r8 + movs r3, 0 + ldrsh r2, [r0, r3] + lsls r4, r6, 3 + subs r4, r6 + lsls r4, 2 + adds r4, r7 + ldrb r3, [r4, 0x13] + adds r0, r5, 0 + bl sub_80876F0 + ldrb r1, [r4] + adds r0, r5, 0 + bl sub_8087BCC + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =0x03005db8 + ldrb r0, [r0] + cmp r6, r0 + bcc _08086B44 +_08086B7E: + bl sub_8086C40 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086B14 + + thumb_func_start sub_8086B9C +sub_8086B9C: @ 8086B9C + push {r4,r5,lr} + movs r4, 0 + ldr r0, =0x03005db8 + ldrb r0, [r0] + cmp r4, r0 + bcs _08086BCA + ldr r5, =0x020229e8 +_08086BAA: + lsls r0, r4, 24 + lsrs r0, 24 + lsls r1, r4, 3 + subs r1, r4 + lsls r1, 2 + adds r1, r5 + ldrb r1, [r1] + bl sub_8087BCC + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x03005db8 + ldrb r0, [r0] + cmp r4, r0 + bcc _08086BAA +_08086BCA: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086B9C + + thumb_func_start c1_link_related +c1_link_related: @ 8086BD8 + push {r4,lr} + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08086BF2 + bl sub_800F0B8 + cmp r0, 0 + beq _08086BF2 + bl sub_8009F3C + cmp r0, 0 + bne _08086C14 +_08086BF2: + ldr r0, =0x03005db4 + ldrb r4, [r0] + ldr r0, =0x03003020 + adds r1, r4, 0 + bl sub_8086F38 + ldr r0, =0x03000e14 + ldr r1, [r0] + adds r0, r4, 0 + bl _call_via_r1 + lsls r0, 16 + lsrs r0, 16 + bl sub_8086FA0 + bl sub_8086C40 +_08086C14: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end c1_link_related + + thumb_func_start sub_8086C2C +sub_8086C2C: @ 8086C2C + push {lr} + bl sub_8086C90 + ldr r0, =sub_80870B0 + bl c1_link_related_func_set + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086C2C + + thumb_func_start sub_8086C40 +sub_8086C40: @ 8086C40 + push {lr} + ldr r0, =0x03003020 + bl sub_808709C + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086C40 + + thumb_func_start c1_link_related_func_set +c1_link_related_func_set: @ 8086C50 + ldr r2, =0x03000e19 + movs r1, 0 + strb r1, [r2] + ldr r1, =0x03000e14 + str r0, [r1] + bx lr + .pool + thumb_func_end c1_link_related_func_set + + thumb_func_start sub_8086C64 +sub_8086C64: @ 8086C64 + push {lr} + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08086C82 + ldr r1, =0x03000e19 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3C + bls _08086C82 + bl sub_8010198 +_08086C82: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086C64 + + thumb_func_start sub_8086C90 +sub_8086C90: @ 8086C90 + push {lr} + ldr r1, =0x03000e10 + movs r2, 0x80 + adds r0, r1, 0x3 +_08086C98: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _08086C98 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086C90 + + thumb_func_start sub_8086CA8 +sub_8086CA8: @ 8086CA8 + push {r4,lr} + lsls r0, 16 + lsrs r3, r0, 16 + ldr r0, =0x03005db8 + ldrb r2, [r0] + movs r1, 0 + cmp r1, r2 + bge _08086CD6 + ldr r4, =0x03000e10 +_08086CBA: + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, r3 + beq _08086CD0 + movs r0, 0 + b _08086CD8 + .pool +_08086CD0: + adds r1, 0x1 + cmp r1, r2 + blt _08086CBA +_08086CD6: + movs r0, 0x1 +_08086CD8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8086CA8 + + thumb_func_start sub_8086CE0 +sub_8086CE0: @ 8086CE0 + push {r4,lr} + lsls r0, 16 + lsrs r3, r0, 16 + ldr r0, =0x03005db8 + ldrb r2, [r0] + movs r1, 0 + cmp r1, r2 + bge _08086D0E + ldr r4, =0x03000e10 +_08086CF2: + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, r3 + bne _08086D08 + movs r0, 0x1 + b _08086D10 + .pool +_08086D08: + adds r1, 0x1 + cmp r1, r2 + blt _08086CF2 +_08086D0E: + movs r0, 0 +_08086D10: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8086CE0 + + thumb_func_start sub_8086D18 +sub_8086D18: @ 8086D18 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r7, r0, 0 + adds r6, r2, 0 + mov r9, r3 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + ldr r0, =0x03000e10 + adds r5, r7, r0 + ldrb r0, [r5] + cmp r0, 0x80 + beq _08086D38 + b _08086EB2 +_08086D38: + adds r0, r6, 0 + bl sub_8087370 + adds r4, r0, 0 + cmp r4, 0 + beq _08086D70 + bl sub_8087480 + mov r1, r9 + strh r0, [r1] + movs r0, 0x81 + strb r0, [r5] + ldrb r0, [r6, 0x1] + cmp r0, 0 + bne _08086D58 + b _08086F26 +_08086D58: + ldr r0, =sub_80870F8 + bl c1_link_related_func_set + adds r0, r4, 0 + bl sub_8087530 + b _08086F26 + .pool +_08086D70: + movs r0, 0x83 + bl sub_8086CE0 + cmp r0, 0x1 + bne _08086D98 + movs r0, 0x81 + strb r0, [r5] + ldrb r0, [r6, 0x1] + cmp r0, 0 + bne _08086D86 + b _08086F26 +_08086D86: + ldr r0, =sub_80870F8 + bl c1_link_related_func_set + bl sub_8087584 + b _08086F26 + .pool +_08086D98: + mov r0, r8 + subs r0, 0x12 + cmp r0, 0xA + bls _08086DA2 + b _08086EB2 +_08086DA2: + lsls r0, 2 + ldr r1, =_08086DB0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08086DB0: + .4byte _08086E08 + .4byte _08086EB2 + .4byte _08086EB2 + .4byte _08086EB2 + .4byte _08086EB2 + .4byte _08086EB2 + .4byte _08086DDC + .4byte _08086E34 + .4byte _08086EB2 + .4byte _08086E64 + .4byte _08086E90 +_08086DDC: + adds r0, r6, 0 + bl sub_8087358 + cmp r0, 0 + beq _08086EB2 + ldr r0, =0x03000e10 + adds r0, r7, r0 + movs r1, 0x81 + strb r1, [r0] + ldrb r0, [r6, 0x1] + cmp r0, 0 + beq _08086EB2 + ldr r0, =sub_80870F8 + bl c1_link_related_func_set + bl sub_808751C + b _08086EB2 + .pool +_08086E08: + adds r0, r6, 0 + bl sub_8087388 + cmp r0, 0x1 + bne _08086EB2 + ldr r0, =0x03000e10 + adds r0, r7, r0 + movs r1, 0x81 + strb r1, [r0] + ldrb r0, [r6, 0x1] + cmp r0, 0 + beq _08086EB2 + ldr r0, =sub_80870F8 + bl c1_link_related_func_set + bl sub_808754C + b _08086EB2 + .pool +_08086E34: + adds r0, r6, 0 + bl sub_80873B4 + adds r4, r0, 0 + cmp r4, 0 + beq _08086EB2 + ldr r0, =0x03000e10 + adds r0, r7, r0 + movs r1, 0x81 + strb r1, [r0] + ldrb r0, [r6, 0x1] + cmp r0, 0 + beq _08086EB2 + ldr r0, =sub_80870F8 + bl c1_link_related_func_set + adds r0, r4, 0 + bl sub_8087568 + b _08086EB2 + .pool +_08086E64: + adds r0, r6, 0 + bl sub_8087340 + cmp r0, 0 + beq _08086EB2 + ldr r0, =0x03000e10 + adds r0, r7, r0 + movs r1, 0x81 + strb r1, [r0] + ldrb r0, [r6, 0x1] + cmp r0, 0 + beq _08086EB2 + ldr r0, =sub_808711C + bl c1_link_related_func_set + bl sub_8087510 + b _08086EB2 + .pool +_08086E90: + adds r0, r6, 0 + bl sub_8087340 + cmp r0, 0 + beq _08086EB2 + ldr r0, =0x03000e10 + adds r0, r7, r0 + movs r1, 0x81 + strb r1, [r0] + ldrb r0, [r6, 0x1] + cmp r0, 0 + beq _08086EB2 + ldr r0, =sub_8087140 + bl c1_link_related_func_set + bl sub_8087510 +_08086EB2: + mov r0, r8 + cmp r0, 0x17 + beq _08086ED8 + cmp r0, 0x17 + bgt _08086ECC + cmp r0, 0x16 + beq _08086EE8 + b _08086F26 + .pool +_08086ECC: + mov r1, r8 + cmp r1, 0x1A + beq _08086EF8 + cmp r1, 0x1D + beq _08086F18 + b _08086F26 +_08086ED8: + ldr r0, =0x03000e10 + adds r0, r7, r0 + movs r1, 0x83 + strb r1, [r0] + b _08086F26 + .pool +_08086EE8: + ldr r0, =0x03000e10 + adds r0, r7, r0 + movs r1, 0x82 + strb r1, [r0] + b _08086F26 + .pool +_08086EF8: + ldr r0, =0x03000e10 + adds r0, r7, r0 + movs r1, 0x80 + strb r1, [r0] + ldrb r0, [r6, 0x1] + cmp r0, 0 + beq _08086F26 + ldr r0, =sub_80870B0 + bl c1_link_related_func_set + b _08086F26 + .pool +_08086F18: + ldr r0, =0x03000e10 + adds r1, r7, r0 + ldrb r0, [r1] + cmp r0, 0x82 + bne _08086F26 + movs r0, 0x81 + strb r0, [r1] +_08086F26: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086D18 + + thumb_func_start sub_8086F38 +sub_8086F38: @ 8086F38 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + mov r8, r1 + movs r6, 0 + add r5, sp, 0x10 + mov r9, r5 + adds r7, r0, 0 +_08086F4C: + ldrb r4, [r7] + movs r0, 0 + strh r0, [r5] + adds r0, r6, 0 + mov r1, r8 + mov r2, sp + bl sub_80872D8 + adds r0, r6, 0 + adds r1, r4, 0 + mov r2, sp + adds r3, r5, 0 + bl sub_8086D18 + ldr r0, =0x03000e10 + adds r0, r6, r0 + ldrb r0, [r0] + cmp r0, 0x80 + bne _08086F7C + adds r0, r4, 0 + bl sub_8087068 + mov r1, r9 + strh r0, [r1] +_08086F7C: + lsls r0, r6, 24 + lsrs r0, 24 + ldrb r1, [r5] + bl sub_808796C + adds r7, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _08086F4C + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086F38 + + thumb_func_start sub_8086FA0 +sub_8086FA0: @ 8086FA0 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + ldr r1, =0xffef0000 + adds r0, r1 + lsrs r0, 16 + cmp r0, 0xC + bhi _08086FC0 + ldr r0, =0x03005da8 + strh r4, [r0] + b _08086FC6 + .pool +_08086FC0: + ldr r1, =0x03005da8 + movs r0, 0x11 + strh r0, [r1] +_08086FC6: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08086FFC + bl sub_8087690 + cmp r0, 0x1 + bls _08086FFC + bl is_c1_link_related_active + cmp r0, 0x1 + bne _08086FFC + bl sub_8009F3C + cmp r0, 0x1 + bne _08086FFC + cmp r4, 0x11 + blt _08086FFC + cmp r4, 0x15 + ble _08086FF6 + cmp r4, 0x19 + bgt _08086FFC + cmp r4, 0x18 + blt _08086FFC +_08086FF6: + ldr r1, =0x03005da8 + movs r0, 0 + strh r0, [r1] +_08086FFC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086FA0 + + thumb_func_start sub_808700C +sub_808700C: @ 808700C + push {lr} + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x2C] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08087024 + movs r0, 0x13 + b _08087064 + .pool +_08087024: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08087030 + movs r0, 0x12 + b _08087064 +_08087030: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0808703C + movs r0, 0x14 + b _08087064 +_0808703C: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08087048 + movs r0, 0x15 + b _08087064 +_08087048: + ldrh r1, [r2, 0x2E] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08087056 + movs r0, 0x18 + b _08087064 +_08087056: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08087062 + movs r0, 0x11 + b _08087064 +_08087062: + movs r0, 0x19 +_08087064: + pop {r1} + bx r1 + thumb_func_end sub_808700C + + thumb_func_start sub_8087068 +sub_8087068: @ 8087068 + push {lr} + lsls r0, 16 + lsrs r0, 16 + adds r1, r0, 0 + cmp r0, 0x13 + beq _0808708E + cmp r0, 0x13 + bgt _0808707E + cmp r0, 0x12 + beq _08087092 + b _08087096 +_0808707E: + cmp r1, 0x14 + beq _0808708A + cmp r1, 0x15 + bne _08087096 + movs r0, 0x4 + b _08087098 +_0808708A: + movs r0, 0x3 + b _08087098 +_0808708E: + movs r0, 0x1 + b _08087098 +_08087092: + movs r0, 0x2 + b _08087098 +_08087096: + movs r0, 0 +_08087098: + pop {r1} + bx r1 + thumb_func_end sub_8087068 + + thumb_func_start sub_808709C +sub_808709C: @ 808709C + push {lr} + movs r2, 0x11 + adds r1, r0, 0x6 +_080870A2: + strh r2, [r1] + subs r1, 0x2 + cmp r1, r0 + bge _080870A2 + pop {r0} + bx r0 + thumb_func_end sub_808709C + + thumb_func_start sub_80870B0 +sub_80870B0: @ 80870B0 + push {r4,lr} + adds r4, r0, 0 + bl script_env_2_is_enabled + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080870C4 + movs r0, 0x11 + b _080870E6 +_080870C4: + bl sub_800B4DC + cmp r0, 0x4 + bls _080870D0 + movs r0, 0x1B + b _080870E6 +_080870D0: + bl sub_8087690 + cmp r0, 0x4 + bls _080870DC + movs r0, 0x1C + b _080870E6 +_080870DC: + adds r0, r4, 0 + bl sub_808700C + lsls r0, 16 + lsrs r0, 16 +_080870E6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80870B0 + + thumb_func_start sub_80870EC +sub_80870EC: @ 80870EC + push {lr} + bl sub_8086C64 + movs r0, 0x11 + pop {r1} + bx r1 + thumb_func_end sub_80870EC + + thumb_func_start sub_80870F8 +sub_80870F8: @ 80870F8 + push {r4,lr} + bl script_env_2_is_enabled + lsls r0, 24 + lsrs r0, 24 + movs r4, 0x11 + cmp r0, 0x1 + beq _08087110 + movs r4, 0x1A + ldr r0, =sub_80870EC + bl c1_link_related_func_set +_08087110: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80870F8 + + thumb_func_start sub_808711C +sub_808711C: @ 808711C + push {r4,lr} + bl sub_800B4DC + movs r4, 0x11 + cmp r0, 0x2 + bhi _08087134 + movs r4, 0x1A + bl script_env_2_disable + ldr r0, =sub_80870EC + bl c1_link_related_func_set +_08087134: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_808711C + + thumb_func_start sub_8087140 +sub_8087140: @ 8087140 + push {r4,lr} + bl sub_8087690 + movs r4, 0x11 + cmp r0, 0x2 + bhi _08087158 + movs r4, 0x1A + bl script_env_2_disable + ldr r0, =sub_80870EC + bl c1_link_related_func_set +_08087158: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8087140 + + thumb_func_start sub_8087164 +sub_8087164: @ 8087164 + push {lr} + bl sub_8086C64 + movs r0, 0x11 + pop {r1} + bx r1 + thumb_func_end sub_8087164 + + thumb_func_start sub_8087170 +sub_8087170: @ 8087170 + push {lr} + ldr r1, =0x03000e10 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x82 + bne _080871A0 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080871A4 + ldr r0, =sub_8087164 + bl c1_link_related_func_set + movs r0, 0x1D + b _080871A6 + .pool +_080871A0: + bl sub_8086C64 +_080871A4: + movs r0, 0x11 +_080871A6: + pop {r1} + bx r1 + thumb_func_end sub_8087170 + + thumb_func_start sub_80871AC +sub_80871AC: @ 80871AC + push {lr} + ldr r0, =sub_8087170 + bl c1_link_related_func_set + movs r0, 0x16 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80871AC + + thumb_func_start sub_80871C0 +sub_80871C0: @ 80871C0 + movs r0, 0x11 + bx lr + thumb_func_end sub_80871C0 + + thumb_func_start sub_80871C4 +sub_80871C4: @ 80871C4 + push {lr} + ldr r1, =0x03000e10 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x83 + beq _080871D4 + bl sub_8086C64 +_080871D4: + movs r0, 0x83 + bl sub_8086CA8 + cmp r0, 0x1 + bne _080871EA + ldr r0, =gUnknown_08277513 + bl script_env_1_execute_new_script + ldr r0, =sub_80871C0 + bl c1_link_related_func_set +_080871EA: + movs r0, 0x11 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80871C4 + + thumb_func_start sub_80871FC +sub_80871FC: @ 80871FC + push {lr} + ldr r0, =sub_80871C4 + bl c1_link_related_func_set + movs r0, 0x17 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80871FC + + thumb_func_start sub_8087210 +sub_8087210: @ 8087210 + movs r0, 0x11 + bx lr + thumb_func_end sub_8087210 + + thumb_func_start sub_8087214 +sub_8087214: @ 8087214 + push {lr} + movs r0, 0x83 + bl sub_8086CE0 + cmp r0, 0x1 + beq _08087250 + ldr r0, =0x03000e14 + ldr r2, [r0] + ldr r1, =sub_8087170 + adds r3, r0, 0 + cmp r2, r1 + bne _0808723A + ldr r1, =0x03000e10 + ldr r0, =0x03005db4 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x82 + bne _08087272 +_0808723A: + ldr r1, [r3] + ldr r0, =sub_8087164 + cmp r1, r0 + bne _08087268 + ldr r1, =0x03000e10 + ldr r0, =0x03005db4 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x81 + bne _08087268 +_08087250: + movs r0, 0x2 + b _08087278 + .pool +_08087268: + movs r0, 0x82 + bl sub_8086CA8 + cmp r0, 0 + bne _08087276 +_08087272: + movs r0, 0 + b _08087278 +_08087276: + movs r0, 0x1 +_08087278: + pop {r1} + bx r1 + thumb_func_end sub_8087214 + + thumb_func_start sub_808727C +sub_808727C: @ 808727C + push {lr} + movs r0, 0x83 + bl sub_8086CE0 + pop {r1} + bx r1 + thumb_func_end sub_808727C + + thumb_func_start sub_8087288 +sub_8087288: @ 8087288 + push {lr} + ldr r0, =sub_80871AC + bl c1_link_related_func_set + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8087288 + + thumb_func_start sub_808729C +sub_808729C: @ 808729C + push {lr} + ldr r0, =sub_80870F8 + bl c1_link_related_func_set + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_808729C + + thumb_func_start sub_80872B0 +sub_80872B0: @ 80872B0 + push {lr} + ldr r0, =sub_80871FC + bl c1_link_related_func_set + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80872B0 + + thumb_func_start sub_80872C4 +sub_80872C4: @ 80872C4 + push {lr} + ldr r0, =sub_8087210 + bl c1_link_related_func_set + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80872C4 + + thumb_func_start sub_80872D8 +sub_80872D8: @ 80872D8 + push {r4-r6,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r6, r2, 0 + strb r4, [r6] + movs r0, 0 + cmp r4, r1 + bne _080872EA + movs r0, 0x1 +_080872EA: + strb r0, [r6, 0x1] + ldr r1, =0x02032308 + lsls r0, r4, 2 + adds r0, r1 + ldrb r0, [r0, 0x3] + strb r0, [r6, 0x2] + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_80878A0 + strb r0, [r6, 0x3] + mov r5, sp + adds r5, 0x2 + adds r0, r4, 0 + mov r1, sp + adds r2, r5, 0 + bl sub_8087878 + mov r0, sp + ldrh r0, [r0] + strh r0, [r6, 0x4] + ldrh r0, [r5] + strh r0, [r6, 0x6] + adds r0, r4, 0 + bl sub_80878C0 + strb r0, [r6, 0x8] + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r5, r2] + bl MapGridGetMetatileBehaviorAt + strh r0, [r6, 0xC] + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80872D8 + + thumb_func_start sub_8087340 +sub_8087340: @ 8087340 + push {lr} + ldrb r0, [r0, 0x2] + cmp r0, 0x2 + beq _0808734C + cmp r0, 0 + bne _08087350 +_0808734C: + movs r0, 0x1 + b _08087352 +_08087350: + movs r0, 0 +_08087352: + pop {r1} + bx r1 + thumb_func_end sub_8087340 + + thumb_func_start sub_8087358 +sub_8087358: @ 8087358 + push {lr} + ldrb r0, [r0, 0x2] + cmp r0, 0x2 + beq _08087364 + cmp r0, 0 + bne _08087368 +_08087364: + movs r0, 0x1 + b _0808736A +_08087368: + movs r0, 0 +_0808736A: + pop {r1} + bx r1 + thumb_func_end sub_8087358 + + thumb_func_start sub_8087370 +sub_8087370: @ 8087370 + push {lr} + adds r1, r0, 0 + ldrb r0, [r1, 0x2] + cmp r0, 0x2 + bne _08087382 + adds r0, r1, 0x4 + bl sub_809D0F4 + b _08087384 +_08087382: + movs r0, 0 +_08087384: + pop {r1} + bx r1 + thumb_func_end sub_8087370 + + thumb_func_start sub_8087388 +sub_8087388: @ 8087388 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0x2] + cmp r0, 0x2 + beq _08087396 + cmp r0, 0 + bne _080873AC +_08087396: + ldrb r0, [r4, 0xC] + bl MetatileBehavior_IsSouthArrowWarp + lsls r0, 24 + cmp r0, 0 + beq _080873AC + ldrb r0, [r4, 0x3] + cmp r0, 0x1 + bne _080873AC + movs r0, 0x1 + b _080873AE +_080873AC: + movs r0, 0 +_080873AE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8087388 + + thumb_func_start sub_80873B4 +sub_80873B4: @ 80873B4 + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldrb r0, [r4, 0x2] + cmp r0, 0 + beq _080873C8 + cmp r0, 0x2 + beq _080873C8 + movs r0, 0 + b _08087476 +_080873C8: + ldr r0, [r4, 0x4] + ldr r1, [r4, 0x8] + str r0, [sp] + str r1, [sp, 0x4] + ldr r3, =gUnknown_08339D64 + ldrb r0, [r4, 0x3] + lsls r0, 3 + adds r0, r3 + ldr r0, [r0] + mov r1, sp + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0xffff0000 + ldr r2, [sp] + ands r2, r1 + orrs r2, r0 + str r2, [sp] + asrs r1, r2, 16 + ldrb r0, [r4, 0x3] + lsls r0, 3 + adds r3, 0x4 + adds r0, r3 + ldr r0, [r0] + adds r0, r1 + lsls r0, 16 + ldr r1, =0x0000ffff + ands r1, r2 + orrs r1, r0 + str r1, [sp] + ldr r2, =0xffffff00 + ldr r0, [sp, 0x4] + ands r0, r2 + str r0, [sp, 0x4] + mov r0, sp + movs r2, 0 + ldrsh r0, [r0, r2] + asrs r1, 16 + bl sub_808790C + lsls r0, 24 + lsrs r1, r0, 24 + adds r2, r1, 0 + cmp r1, 0x4 + beq _0808746C + ldrb r0, [r4, 0x1] + cmp r0, 0 + beq _08087434 + ldr r0, =0x03000e10 + adds r0, r1, r0 + ldrb r0, [r0] + cmp r0, 0x80 + beq _08087450 +_08087434: + ldr r0, =gUnknown_0827749C + b _08087476 + .pool +_08087450: + adds r0, r2, 0 + bl sub_80B39D4 + cmp r0, 0 + bne _08087464 + ldr r0, =gUnknown_0827747E + b _08087476 + .pool +_08087464: + ldr r0, =gUnknown_0827748D + b _08087476 + .pool +_0808746C: + ldrb r1, [r4, 0xC] + ldrb r2, [r4, 0x3] + mov r0, sp + bl sub_809C2C8 +_08087476: + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80873B4 + + thumb_func_start sub_8087480 +sub_8087480: @ 8087480 + push {lr} + adds r1, r0, 0 + ldr r0, =gUnknown_08277388 + cmp r1, r0 + beq _080874C6 + ldr r0, =gUnknown_082773A3 + cmp r1, r0 + beq _08087508 + ldr r0, =gUnknown_082773BE + cmp r1, r0 + beq _080874C6 + ldr r0, =gUnknown_082773D9 + cmp r1, r0 + beq _08087508 + ldr r0, =gUnknown_0827741D + cmp r1, r0 + beq _080874C6 + ldr r0, =gUnknown_08277432 + cmp r1, r0 + beq _08087508 + ldr r0, =gUnknown_08277447 + cmp r1, r0 + beq _080874C6 + ldr r0, =gUnknown_0827745C + cmp r1, r0 + beq _08087508 + ldr r0, =gUnknown_08277374 + cmp r1, r0 + beq _080874C6 + ldr r0, =gUnknown_0827737E + cmp r1, r0 + beq _08087508 + ldr r0, =gUnknown_082773F5 + cmp r1, r0 + bne _080874F8 +_080874C6: + movs r0, 0xA + b _0808750A + .pool +_080874F8: + ldr r0, =gUnknown_082773FF + cmp r1, r0 + beq _08087508 + movs r0, 0 + b _0808750A + .pool +_08087508: + movs r0, 0x9 +_0808750A: + pop {r1} + bx r1 + thumb_func_end sub_8087480 + + thumb_func_start sub_8087510 +sub_8087510: @ 8087510 + push {lr} + bl script_env_2_enable + pop {r0} + bx r0 + thumb_func_end sub_8087510 + + thumb_func_start sub_808751C +sub_808751C: @ 808751C + push {lr} + movs r0, 0x6 + bl audio_play + bl sub_809FA9C + bl script_env_2_enable + pop {r0} + bx r0 + thumb_func_end sub_808751C + + thumb_func_start sub_8087530 +sub_8087530: @ 8087530 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x5 + bl audio_play + adds r0, r4, 0 + bl script_env_1_execute_new_script + bl script_env_2_enable + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8087530 + + thumb_func_start sub_808754C +sub_808754C: @ 808754C + push {lr} + movs r0, 0x6 + bl audio_play + ldr r0, =gUnknown_082774EF + bl script_env_1_execute_new_script + bl script_env_2_enable + pop {r0} + bx r0 + .pool + thumb_func_end sub_808754C + + thumb_func_start sub_8087568 +sub_8087568: @ 8087568 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x5 + bl audio_play + adds r0, r4, 0 + bl script_env_1_execute_new_script + bl script_env_2_enable + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8087568 + + thumb_func_start sub_8087584 +sub_8087584: @ 8087584 + push {lr} + ldr r0, =gUnknown_08277509 + bl script_env_1_execute_new_script + bl script_env_2_enable + pop {r0} + bx r0 + .pool + thumb_func_end sub_8087584 + + thumb_func_start sub_8087598 +sub_8087598: @ 8087598 + push {lr} + bl is_c1_link_related_active + cmp r0, 0 + bne _080875A6 + movs r0, 0 + b _080875C0 +_080875A6: + bl sub_800B4DC + cmp r0, 0x2 + bls _080875B8 + ldr r1, =0x03000e18 + movs r0, 0x1 + b _080875BC + .pool +_080875B8: + ldr r1, =0x03000e18 + movs r0, 0 +_080875BC: + strb r0, [r1] + ldrb r0, [r1] +_080875C0: + pop {r1} + bx r1 + .pool + thumb_func_end sub_8087598 + + thumb_func_start sub_80875C8 +sub_80875C8: @ 80875C8 + push {lr} + bl sub_800B4DC + cmp r0, 0x1 + bls _0808762C + bl is_c1_link_related_active + cmp r0, 0x1 + bne _0808762C + bl sub_8009F3C + cmp r0, 0x1 + bne _0808762C + ldr r0, =0x03000e14 + ldr r1, [r0] + ldr r0, =sub_808711C + cmp r1, r0 + beq _08087614 + ldr r0, =sub_80870F8 + cmp r1, r0 + bne _0808762C + ldr r0, =0x03000e18 + ldrb r2, [r0] + movs r1, 0 + strb r1, [r0] + cmp r2, 0x1 + beq _08087614 + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0808762C + ldrb r1, [r2, 0xA] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0808762C +_08087614: + movs r0, 0x1 + b _0808762E + .pool +_0808762C: + movs r0, 0 +_0808762E: + pop {r1} + bx r1 + thumb_func_end sub_80875C8 + + thumb_func_start sub_8087634 +sub_8087634: @ 8087634 + push {lr} + bl sub_8087690 + cmp r0, 0x1 + bls _08087658 + bl is_c1_link_related_active + cmp r0, 0x1 + bne _08087658 + bl sub_8009F3C + cmp r0, 0x1 + bne _08087658 + ldr r0, =0x03000e14 + ldr r1, [r0] + ldr r0, =sub_8087140 + cmp r1, r0 + beq _08087664 +_08087658: + movs r0, 0 + b _08087666 + .pool +_08087664: + movs r0, 0x1 +_08087666: + pop {r1} + bx r1 + thumb_func_end sub_8087634 + + thumb_func_start sub_808766C +sub_808766C: @ 808766C + push {lr} + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _08087688 + bl sub_8009F3C + cmp r0, 0 + beq _08087688 + movs r0, 0x1 + b _0808768A + .pool +_08087688: + movs r0, 0 +_0808768A: + pop {r1} + bx r1 + thumb_func_end sub_808766C + + thumb_func_start sub_8087690 +sub_8087690: @ 8087690 + push {lr} + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _080876B0 + ldr r0, =0x03003170 + ldr r1, =0x00000339 + adds r0, r1 + ldrb r0, [r0] + b _080876B8 + .pool +_080876B0: + ldr r0, =0x03005000 + ldr r1, =0x00000c1a + adds r0, r1 + ldrb r0, [r0] +_080876B8: + pop {r1} + bx r1 + .pool + thumb_func_end sub_8087690 + + thumb_func_start sub_80876C4 +sub_80876C4: @ 80876C4 + movs r1, 0 + str r1, [r0] + bx lr + thumb_func_end sub_80876C4 + + thumb_func_start strange_npc_table_clear +strange_npc_table_clear: @ 80876CC + push {lr} + ldr r0, =0x02032308 + movs r1, 0 + movs r2, 0x10 + bl memset + pop {r0} + bx r0 + .pool + thumb_func_end strange_npc_table_clear + + thumb_func_start sub_80876E0 +sub_80876E0: @ 80876E0 + push {lr} + movs r1, 0 + movs r2, 0x24 + bl memset + pop {r0} + bx r0 + thumb_func_end sub_80876E0 + + thumb_func_start sub_80876F0 +sub_80876F0: @ 80876F0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r9, r1 + mov r10, r2 + mov r8, r3 + lsls r0, 24 + lsrs r7, r0, 24 + mov r0, r9 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + mov r1, r10 + lsls r1, 16 + lsrs r1, 16 + mov r10, r1 + mov r2, r8 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + bl sub_808D4F4 + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r4, r7, 2 + ldr r0, =0x02032308 + adds r4, r0 + lsls r5, r6, 3 + adds r5, r6 + lsls r5, 2 + ldr r0, =0x02037350 + adds r5, r0 + adds r0, r4, 0 + bl sub_80876C4 + adds r0, r5, 0 + bl sub_80876E0 + movs r2, 0 + movs r1, 0x1 + movs r0, 0x1 + strb r0, [r4] + strb r7, [r4, 0x1] + strb r6, [r4, 0x2] + strb r2, [r4, 0x3] + ldrb r0, [r5] + orrs r0, r1 + mov r2, r8 + ands r2, r1 + lsls r2, 1 + movs r1, 0x3 + negs r1, r1 + ands r0, r1 + orrs r0, r2 + strb r0, [r5] + movs r0, 0x2 + strb r0, [r5, 0x19] + movs r0, 0x40 + strb r0, [r5, 0x4] + mov r0, r9 + lsls r0, 16 + asrs r0, 16 + mov r9, r0 + mov r1, r10 + lsls r1, 16 + asrs r1, 16 + mov r10, r1 + adds r0, r5, 0 + mov r1, r9 + mov r2, r10 + bl sub_808779C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80876F0 + + thumb_func_start sub_808779C +sub_808779C: @ 808779C + push {r4,lr} + adds r4, r0, 0 + adds r0, r1, 0 + adds r1, r2, 0 + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r1, 16 + strh r0, [r4, 0x10] + strh r1, [r4, 0x12] + strh r0, [r4, 0x14] + strh r1, [r4, 0x16] + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + adds r2, r4, 0 + adds r2, 0xC + adds r3, r4, 0 + adds r3, 0xE + bl sub_8093038 + ldrh r0, [r4, 0xC] + adds r0, 0x8 + strh r0, [r4, 0xC] + adds r0, r4, 0 + bl FieldObjectUpdateZCoord + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_808779C + + thumb_func_start sub_80877DC +sub_80877DC: @ 80877DC + push {lr} + lsls r0, 24 + lsls r1, 24 + lsrs r2, r1, 24 + ldr r1, =0x02032308 + lsrs r0, 22 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + beq _080877FE + ldrb r0, [r1, 0x2] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02037350 + adds r1, r0 + strb r2, [r1, 0x19] +_080877FE: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80877DC + + thumb_func_start sub_808780C +sub_808780C: @ 808780C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 22 + ldr r1, =0x02032308 + adds r5, r0, r1 + ldrb r1, [r5, 0x2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + ldrb r0, [r4, 0x4] + cmp r0, 0x40 + beq _08087838 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles +_08087838: + movs r0, 0 + strb r0, [r5] + ldrb r1, [r4] + subs r0, 0x2 + ands r0, r1 + strb r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808780C + + thumb_func_start sub_8087858 +sub_8087858: @ 8087858 + lsls r0, 24 + ldr r1, =0x02032308 + lsrs r0, 22 + adds r0, r1 + ldrb r1, [r0, 0x2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + ldrb r0, [r0, 0x4] + bx lr + .pool + thumb_func_end sub_8087858 + + thumb_func_start sub_8087878 +sub_8087878: @ 8087878 + lsls r0, 24 + ldr r3, =0x02032308 + lsrs r0, 22 + adds r0, r3 + ldrb r3, [r0, 0x2] + lsls r0, r3, 3 + adds r0, r3 + lsls r0, 2 + ldr r3, =0x02037350 + adds r0, r3 + ldrh r3, [r0, 0x10] + strh r3, [r1] + ldrh r0, [r0, 0x12] + strh r0, [r2] + bx lr + .pool + thumb_func_end sub_8087878 + + thumb_func_start sub_80878A0 +sub_80878A0: @ 80878A0 + lsls r0, 24 + ldr r1, =0x02032308 + lsrs r0, 22 + adds r0, r1 + ldrb r1, [r0, 0x2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + ldrb r0, [r0, 0x19] + bx lr + .pool + thumb_func_end sub_80878A0 + + thumb_func_start sub_80878C0 +sub_80878C0: @ 80878C0 + lsls r0, 24 + ldr r1, =0x02032308 + lsrs r0, 22 + adds r0, r1 + ldrb r1, [r0, 0x2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + ldrb r0, [r0, 0xB] + lsls r0, 28 + lsrs r0, 28 + bx lr + .pool + thumb_func_end sub_80878C0 + + thumb_func_start sub_80878E4 +sub_80878E4: @ 80878E4 + lsls r0, 24 + ldr r1, =0x02032308 + lsrs r0, 22 + adds r0, r1 + ldrb r1, [r0, 0x2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + adds r0, 0x21 + movs r1, 0 + ldrsb r1, [r0, r1] + movs r0, 0x10 + subs r0, r1 + bx lr + .pool + thumb_func_end sub_80878E4 + + thumb_func_start sub_808790C +sub_808790C: @ 808790C + push {r4-r6,lr} + movs r2, 0 + ldr r5, =0x02032308 + lsls r0, 16 + asrs r4, r0, 16 + lsls r1, 16 + asrs r3, r1, 16 +_0808791A: + lsls r0, r2, 2 + adds r1, r0, r5 + ldrb r0, [r1] + cmp r0, 0 + beq _08087958 + ldrb r0, [r1, 0x3] + cmp r0, 0 + beq _0808792E + cmp r0, 0x2 + bne _08087958 +_0808792E: + ldrb r1, [r1, 0x2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r1, r0, r1 + movs r6, 0x10 + ldrsh r0, [r1, r6] + cmp r0, r4 + bne _08087958 + movs r6, 0x12 + ldrsh r0, [r1, r6] + cmp r0, r3 + bne _08087958 + adds r0, r2, 0 + b _08087964 + .pool +_08087958: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _0808791A + movs r0, 0x4 +_08087964: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_808790C + + thumb_func_start sub_808796C +sub_808796C: @ 808796C + push {r4-r6,lr} + lsls r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + adds r2, r3, 0 + lsrs r0, 22 + ldr r1, =0x02032308 + adds r5, r0, r1 + ldrb r1, [r5, 0x2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r6, r0, r1 + ldrb r0, [r5] + cmp r0, 0 + beq _080879C8 + cmp r3, 0xA + bls _080879A4 + ldrb r0, [r6] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r6] + b _080879C8 + .pool +_080879A4: + ldr r4, =gUnknown_08339E00 + ldr r1, =gUnknown_08339DC8 + ldrb r0, [r5, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r3, [r0] + adds r0, r5, 0 + adds r1, r6, 0 + bl _call_via_r3 + lsls r0, 24 + lsrs r0, 22 + adds r0, r4 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r6, 0 + bl _call_via_r2 +_080879C8: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808796C + + thumb_func_start sub_80879D8 +sub_80879D8: @ 80879D8 + push {r4,lr} + lsls r2, 24 + lsrs r2, 24 + ldr r4, =gUnknown_08339DD4 + lsls r3, r2, 2 + adds r3, r4 + ldr r3, [r3] + bl _call_via_r3 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80879D8 + + thumb_func_start sub_80879F8 +sub_80879F8: @ 80879F8 + movs r0, 0x1 + bx lr + thumb_func_end sub_80879F8 + + thumb_func_start sub_80879FC +sub_80879FC: @ 80879FC + push {r4,lr} + lsls r2, 24 + lsrs r2, 24 + ldr r4, =gUnknown_08339DD4 + lsls r3, r2, 2 + adds r3, r4 + ldr r3, [r3] + bl _call_via_r3 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80879FC + + thumb_func_start sub_8087A1C +sub_8087A1C: @ 8087A1C + movs r0, 0 + bx lr + thumb_func_end sub_8087A1C + + thumb_func_start sub_8087A20 +sub_8087A20: @ 8087A20 + push {r4-r6,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + lsls r0, r2, 24 + lsrs r0, 24 + ldrb r1, [r5, 0x19] + bl npc_something3 + strb r0, [r5, 0x19] + ldrb r1, [r5, 0x19] + mov r6, sp + adds r6, 0x2 + adds r0, r5, 0 + mov r2, sp + adds r3, r6, 0 + bl FieldObjectMoveDestCoords + ldrb r0, [r4, 0x2] + ldrb r1, [r5, 0x19] + mov r2, sp + movs r3, 0 + ldrsh r2, [r2, r3] + movs r4, 0 + ldrsh r3, [r6, r4] + bl npc_080587EC + lsls r0, 24 + cmp r0, 0 + bne _08087A7E + adds r1, r5, 0 + adds r1, 0x21 + movs r0, 0x10 + strb r0, [r1] + mov r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + movs r3, 0 + ldrsh r2, [r6, r3] + adds r0, r5, 0 + bl npc_coords_shift + adds r0, r5, 0 + bl FieldObjectUpdateZCoord + movs r0, 0x1 + b _08087A80 +_08087A7E: + movs r0, 0 +_08087A80: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8087A20 + + thumb_func_start sub_8087A88 +sub_8087A88: @ 8087A88 + push {r4,lr} + adds r4, r1, 0 + lsls r0, r2, 24 + lsrs r0, 24 + ldrb r1, [r4, 0x19] + bl npc_something3 + strb r0, [r4, 0x19] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8087A88 + + thumb_func_start sub_8087AA0 +sub_8087AA0: @ 8087AA0 + movs r1, 0 + strb r1, [r0, 0x3] + bx lr + thumb_func_end sub_8087AA0 + + thumb_func_start sub_8087AA8 +sub_8087AA8: @ 8087AA8 + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r5, r4, 0 + adds r5, 0x21 + ldrb r0, [r5] + subs r0, 0x1 + strb r0, [r5] + movs r0, 0x1 + strb r0, [r6, 0x3] + ldrb r0, [r4, 0x19] + adds r1, 0xC + adds r2, r4, 0 + adds r2, 0xE + bl MoveCoords + ldrb r0, [r5] + cmp r0, 0 + bne _08087AD8 + adds r0, r4, 0 + bl npc_coords_shift_still + movs r0, 0x2 + strb r0, [r6, 0x3] +_08087AD8: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8087AA8 + + thumb_func_start npc_something3 +npc_something3: @ 8087AE0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r2, r1, 24 + subs r0, 0x1 + cmp r0, 0x9 + bhi _08087B38 + lsls r0, 2 + ldr r1, =_08087B00 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08087B00: + .4byte _08087B28 + .4byte _08087B2C + .4byte _08087B30 + .4byte _08087B34 + .4byte _08087B38 + .4byte _08087B38 + .4byte _08087B28 + .4byte _08087B2C + .4byte _08087B30 + .4byte _08087B34 +_08087B28: + movs r0, 0x2 + b _08087B3A +_08087B2C: + movs r0, 0x1 + b _08087B3A +_08087B30: + movs r0, 0x3 + b _08087B3A +_08087B34: + movs r0, 0x4 + b _08087B3A +_08087B38: + adds r0, r2, 0 +_08087B3A: + pop {r1} + bx r1 + thumb_func_end npc_something3 + + thumb_func_start npc_080587EC +npc_080587EC: @ 8087B40 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r2, 16 + lsrs r2, 16 + mov r12, r2 + lsls r3, 16 + movs r4, 0 + ldr r0, =0x02037350 + mov r9, r0 + lsrs r2, r3, 16 + mov r10, r2 + asrs r6, r3, 16 +_08087B64: + mov r7, r12 + lsls r3, r7, 16 + mov r0, r10 + lsls r5, r0, 16 + cmp r4, r8 + beq _08087BA8 + lsls r0, r4, 3 + adds r0, r4 + lsls r0, 2 + mov r2, r9 + adds r1, r0, r2 + movs r7, 0x10 + ldrsh r0, [r1, r7] + asrs r2, r3, 16 + cmp r0, r2 + bne _08087B8C + movs r7, 0x12 + ldrsh r0, [r1, r7] + cmp r0, r6 + beq _08087B9E +_08087B8C: + movs r7, 0x14 + ldrsh r0, [r1, r7] + cmp r0, r2 + bne _08087BA8 + movs r0, 0x16 + ldrsh r1, [r1, r0] + asrs r0, r5, 16 + cmp r1, r0 + bne _08087BA8 +_08087B9E: + movs r0, 0x1 + b _08087BBE + .pool +_08087BA8: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _08087B64 + asrs r0, r3, 16 + asrs r1, r5, 16 + bl MapGridIsImpassableAt + lsls r0, 24 + lsrs r0, 24 +_08087BBE: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end npc_080587EC + + thumb_func_start sub_8087BCC +sub_8087BCC: @ 8087BCC + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + lsls r2, r5, 2 + ldr r0, =0x02032308 + adds r2, r0 + ldrb r1, [r2, 0x2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + ldrb r0, [r2] + cmp r0, 0 + beq _08087C7A + subs r0, r3, 0x1 + cmp r0, 0x4 + bhi _08087C56 + lsls r0, 2 + ldr r1, =_08087C0C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08087C0C: + .4byte _08087C2C + .4byte _08087C2C + .4byte _08087C38 + .4byte _08087C20 + .4byte _08087C20 +_08087C20: + ldrb r0, [r4] + lsls r0, 30 + lsrs r0, 31 + bl sub_808BD6C + b _08087C44 +_08087C2C: + ldrb r0, [r4] + lsls r0, 30 + lsrs r0, 31 + bl sub_808BD7C + b _08087C44 +_08087C38: + ldrb r1, [r4] + lsls r1, 30 + lsrs r1, 31 + movs r0, 0 + bl sub_808BD3C +_08087C44: + lsls r0, 24 + lsrs r0, 24 + ldr r1, =sub_8087C8C + movs r2, 0 + str r2, [sp] + movs r3, 0 + bl AddPseudoFieldObject + strb r0, [r4, 0x4] +_08087C56: + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + adds r3, r0, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r3] + strh r5, [r0, 0x2E] + ldrb r1, [r4] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r4] +_08087C7A: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8087BCC + + thumb_func_start sub_8087C8C +sub_8087C8C: @ 8087C8C + push {r4-r6,lr} + adds r5, r0, 0 + movs r0, 0x2E + ldrsh r4, [r5, r0] + lsls r4, 2 + ldr r0, =0x02032308 + adds r4, r0 + ldrb r1, [r4, 0x2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r6, r0, r1 + ldrh r0, [r6, 0xC] + strh r0, [r5, 0x20] + ldrh r0, [r6, 0xE] + strh r0, [r5, 0x22] + ldrb r0, [r6, 0xB] + lsrs r0, 4 + adds r1, r5, 0 + movs r2, 0x1 + bl SetObjectSubpriorityByZCoord + ldrb r0, [r6, 0xB] + lsrs r0, 4 + bl ZCoordToPriority + movs r1, 0x3 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r5, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] + ldrb r0, [r4, 0x3] + cmp r0, 0 + bne _08087CF8 + ldrb r0, [r6, 0x19] + bl FieldObjectDirectionToImageAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl StartObjectImageAnim + b _08087D0A + .pool +_08087CF8: + ldrb r0, [r6, 0x19] + bl get_go_image_anim_num + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl StartObjectImageAnimIfDifferent +_08087D0A: + adds r0, r5, 0 + movs r1, 0 + bl sub_80979D4 + ldrb r0, [r6] + lsls r0, 29 + cmp r0, 0 + bge _08087D3C + ldrh r0, [r5, 0x3C] + movs r1, 0x4 + ands r1, r0 + lsls r1, 16 + adds r3, r5, 0 + adds r3, 0x3E + lsrs r1, 18 + lsls r1, 2 + ldrb r2, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + ldrh r0, [r5, 0x3C] + adds r0, 0x1 + strh r0, [r5, 0x3C] +_08087D3C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8087C8C + + thumb_func_start mapconnection_get_mapheader +mapconnection_get_mapheader: @ 8087D44 + push {lr} + ldrb r2, [r0, 0x8] + ldrb r1, [r0, 0x9] + adds r0, r2, 0 + bl get_mapheader_by_bank_and_number + pop {r1} + bx r1 + thumb_func_end mapconnection_get_mapheader + + thumb_func_start not_trainer_hill_battle_pyramid +not_trainer_hill_battle_pyramid: @ 8087D54 + push {r4,lr} + ldr r4, =0x02037318 + adds r0, r4, 0 + bl mapheader_copy_mapdata_with_padding + ldr r0, [r4, 0x4] + bl sub_80E8EE0 + bl mapheader_run_script_with_tag_x1 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end not_trainer_hill_battle_pyramid + + thumb_func_start sub_8087D74 +sub_8087D74: @ 8087D74 + push {r4,lr} + ldr r4, =0x02037318 + adds r0, r4, 0 + bl mapheader_copy_mapdata_with_padding + movs r0, 0 + bl sub_80E9238 + ldr r0, [r4, 0x4] + bl sub_80E8EE0 + bl mapdata_from_sav2 + bl mapheader_run_script_with_tag_x1 + ldr r1, =0x03005dc0 + ldr r0, [r1] + ldr r1, [r1, 0x4] + bl UpdateTVScreensOnMap + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8087D74 + + thumb_func_start battle_pyramid_map_load_related +battle_pyramid_map_load_related: @ 8087DAC + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x03ff03ff + str r0, [sp] + ldr r5, =0x02032318 + ldr r2, =0x01001400 + mov r0, sp + adds r1, r5, 0 + bl CpuFastSet + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81AA078 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end battle_pyramid_map_load_related + + thumb_func_start trainer_hill_map_load_related +trainer_hill_map_load_related: @ 8087DE4 + push {r4,lr} + sub sp, 0x4 + ldr r0, =0x03ff03ff + str r0, [sp] + ldr r4, =0x02032318 + ldr r2, =0x01001400 + mov r0, sp + adds r1, r4, 0 + bl CpuFastSet + adds r0, r4, 0 + bl sub_81D5FB4 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end trainer_hill_map_load_related + + thumb_func_start mapheader_copy_mapdata_with_padding +@ void mapheader_copy_mapdata_with_padding(struct mapheader *mapHeader) +mapheader_copy_mapdata_with_padding: @ 8087E14 + push {r4-r6,lr} + sub sp, 0x4 + adds r6, r0, 0 + ldr r5, [r6] + ldr r0, =0x03ff03ff + str r0, [sp] + ldr r4, =0x02032318 + ldr r2, =0x01001400 + mov r0, sp + adds r1, r4, 0 + bl CpuFastSet + ldr r2, =0x03005dc0 + str r4, [r2, 0x8] + ldr r1, [r5] + adds r1, 0xF + str r1, [r2] + ldr r0, [r5, 0x4] + adds r0, 0xE + str r0, [r2, 0x4] + muls r1, r0 + movs r0, 0xA0 + lsls r0, 6 + cmp r1, r0 + bgt _08087E56 + ldr r0, [r5, 0xC] + ldrh r1, [r5] + ldrh r2, [r5, 0x4] + bl map_copy_with_padding + adds r0, r6, 0 + bl mapheader_copy_mapdata_of_adjacent_maps +_08087E56: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end mapheader_copy_mapdata_with_padding + + thumb_func_start map_copy_with_padding +@ int map_copy_with_padding(void *src) +map_copy_with_padding: @ 8087E70 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r7, r0, 0 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + lsls r2, 16 + lsrs r2, 16 + ldr r0, =0x03005dc0 + ldr r4, [r0, 0x8] + ldr r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 1 + adds r0, 0xE + adds r4, r0 + cmp r2, 0 + beq _08087EB8 + mov r0, r8 + lsls r6, r0, 1 + adds r5, r2, 0 + movs r0, 0x1E + adds r0, r6 + mov r9, r0 +_08087EA4: + adds r0, r7, 0 + adds r1, r4, 0 + mov r2, r8 + bl CpuSet + add r4, r9 + adds r7, r6 + subs r5, 0x1 + cmp r5, 0 + bne _08087EA4 +_08087EB8: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end map_copy_with_padding + + thumb_func_start mapheader_copy_mapdata_of_adjacent_maps +@ void mapheader_copy_mapdata_of_adjacent_maps(struct mapheader *mapHeader) +mapheader_copy_mapdata_of_adjacent_maps: @ 8087EC8 + push {r4-r7,lr} + adds r6, r0, 0 + ldr r0, [r6, 0xC] + cmp r0, 0 + beq _08087F4C + ldr r1, [r0] + ldr r5, [r0, 0x4] + ldr r2, =0x02037340 + ldr r0, =gUnknown_08486EF8 + ldr r0, [r0] + str r0, [r2] + cmp r1, 0 + ble _08087F4C + adds r4, r2, 0 + adds r7, r1, 0 +_08087EE6: + adds r0, r5, 0 + bl mapconnection_get_mapheader + adds r1, r0, 0 + ldr r2, [r5, 0x4] + ldrb r0, [r5] + cmp r0, 0x2 + beq _08087F1E + cmp r0, 0x2 + bgt _08087F08 + cmp r0, 0x1 + beq _08087F12 + b _08087F44 + .pool +_08087F08: + cmp r0, 0x3 + beq _08087F2A + cmp r0, 0x4 + beq _08087F36 + b _08087F44 +_08087F12: + adds r0, r6, 0 + bl sub_8087FB8 + ldrb r0, [r4] + movs r1, 0x1 + b _08087F40 +_08087F1E: + adds r0, r6, 0 + bl sub_8088020 + ldrb r0, [r4] + movs r1, 0x2 + b _08087F40 +_08087F2A: + adds r0, r6, 0 + bl sub_8088080 + ldrb r0, [r4] + movs r1, 0x4 + b _08087F40 +_08087F36: + adds r0, r6, 0 + bl sub_80880E0 + ldrb r0, [r4] + movs r1, 0x8 +_08087F40: + orrs r0, r1 + strb r0, [r4] +_08087F44: + subs r7, 0x1 + adds r5, 0xC + cmp r7, 0 + bne _08087EE6 +_08087F4C: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end mapheader_copy_mapdata_of_adjacent_maps + + thumb_func_start sub_8087F54 +sub_8087F54: @ 8087F54 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r5, [sp, 0x18] + ldr r4, [r2] + ldr r7, [r4] + adds r2, r7, 0 + muls r2, r5 + adds r2, r3 + lsls r2, 1 + ldr r3, [r4, 0xC] + adds r6, r3, r2 + ldr r3, =0x03005dc0 + ldr r2, [r3] + muls r1, r2 + adds r1, r0 + lsls r1, 1 + ldr r0, [r3, 0x8] + adds r5, r0, r1 + ldr r0, [sp, 0x20] + cmp r0, 0 + ble _08087FA6 + adds r4, r0, 0 + ldr r3, =0x001fffff + mov r8, r3 +_08087F86: + adds r0, r6, 0 + adds r1, r5, 0 + ldr r2, [sp, 0x1C] + mov r3, r8 + ands r2, r3 + bl CpuSet + ldr r0, =0x03005dc0 + ldr r0, [r0] + lsls r0, 1 + adds r5, r0 + lsls r0, r7, 1 + adds r6, r0 + subs r4, 0x1 + cmp r4, 0 + bne _08087F86 +_08087FA6: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8087F54 + + thumb_func_start sub_8087FB8 +sub_8087FB8: @ 8087FB8 + push {r4-r7,lr} + sub sp, 0xC + adds r3, r0, 0 + adds r5, r1, 0 + cmp r5, 0 + beq _08088012 + ldr r0, [r5] + ldr r4, [r0] + adds r2, 0x7 + ldr r0, [r3] + ldr r0, [r0, 0x4] + adds r7, r0, 0x7 + cmp r2, 0 + bge _08087FEC + negs r6, r2 + adds r2, r4 + ldr r0, =0x03005dc0 + ldr r3, [r0] + cmp r2, r3 + bge _08087FE2 + adds r3, r2, 0 +_08087FE2: + movs r2, 0 + b _08087FFC + .pool +_08087FEC: + movs r6, 0 + adds r0, r2, r4 + ldr r1, =0x03005dc0 + ldr r1, [r1] + subs r3, r1, r2 + cmp r0, r1 + bge _08087FFC + adds r3, r4, 0 +_08087FFC: + movs r0, 0 + str r0, [sp] + str r3, [sp, 0x4] + movs r0, 0x7 + str r0, [sp, 0x8] + adds r0, r2, 0 + adds r1, r7, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_8087F54 +_08088012: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8087FB8 + + thumb_func_start sub_8088020 +sub_8088020: @ 8088020 + push {r4-r7,lr} + sub sp, 0xC + adds r5, r1, 0 + cmp r5, 0 + beq _08088074 + ldr r0, [r5] + ldr r4, [r0] + ldr r0, [r0, 0x4] + adds r2, 0x7 + subs r7, r0, 0x7 + cmp r2, 0 + bge _08088050 + negs r6, r2 + adds r2, r4 + ldr r0, =0x03005dc0 + ldr r3, [r0] + cmp r2, r3 + bge _08088046 + adds r3, r2, 0 +_08088046: + movs r2, 0 + b _08088060 + .pool +_08088050: + movs r6, 0 + adds r0, r2, r4 + ldr r1, =0x03005dc0 + ldr r1, [r1] + subs r3, r1, r2 + cmp r0, r1 + bge _08088060 + adds r3, r4, 0 +_08088060: + str r7, [sp] + str r3, [sp, 0x4] + movs r0, 0x7 + str r0, [sp, 0x8] + adds r0, r2, 0 + movs r1, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_8087F54 +_08088074: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8088020 + + thumb_func_start sub_8088080 +sub_8088080: @ 8088080 + push {r4-r7,lr} + sub sp, 0xC + adds r5, r1, 0 + cmp r5, 0 + beq _080880D4 + ldr r0, [r5] + ldr r1, [r0] + ldr r4, [r0, 0x4] + adds r2, 0x7 + subs r7, r1, 0x7 + cmp r2, 0 + bge _080880B0 + negs r6, r2 + adds r1, r2, r4 + ldr r0, =0x03005dc0 + ldr r3, [r0, 0x4] + cmp r1, r3 + bge _080880A6 + adds r3, r1, 0 +_080880A6: + movs r2, 0 + b _080880C0 + .pool +_080880B0: + movs r6, 0 + adds r0, r2, r4 + ldr r1, =0x03005dc0 + ldr r1, [r1, 0x4] + subs r3, r1, r2 + cmp r0, r1 + bge _080880C0 + adds r3, r4, 0 +_080880C0: + str r6, [sp] + movs r0, 0x7 + str r0, [sp, 0x4] + str r3, [sp, 0x8] + movs r0, 0 + adds r1, r2, 0 + adds r2, r5, 0 + adds r3, r7, 0 + bl sub_8087F54 +_080880D4: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8088080 + + thumb_func_start sub_80880E0 +sub_80880E0: @ 80880E0 + push {r4-r7,lr} + sub sp, 0xC + adds r3, r0, 0 + adds r5, r1, 0 + cmp r5, 0 + beq _08088138 + ldr r0, [r5] + ldr r4, [r0, 0x4] + ldr r0, [r3] + ldr r0, [r0] + adds r7, r0, 0x7 + adds r2, 0x7 + cmp r2, 0 + bge _08088114 + negs r6, r2 + adds r1, r2, r4 + ldr r0, =0x03005dc0 + ldr r3, [r0, 0x4] + cmp r1, r3 + bge _0808810A + adds r3, r1, 0 +_0808810A: + movs r2, 0 + b _08088124 + .pool +_08088114: + movs r6, 0 + adds r0, r2, r4 + ldr r1, =0x03005dc0 + ldr r1, [r1, 0x4] + subs r3, r1, r2 + cmp r0, r1 + bge _08088124 + adds r3, r4, 0 +_08088124: + str r6, [sp] + movs r0, 0x8 + str r0, [sp, 0x4] + str r3, [sp, 0x8] + adds r0, r7, 0 + adds r1, r2, 0 + adds r2, r5, 0 + movs r3, 0 + bl sub_8087F54 +_08088138: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80880E0 + + thumb_func_start MapGridGetZCoordAt +@ u8 MapGridGetZCoordAt(s32 x, s32 y) +MapGridGetZCoordAt: @ 8088144 + push {r4,lr} + adds r2, r0, 0 + adds r4, r1, 0 + cmp r2, 0 + blt _08088174 + ldr r1, =0x03005dc0 + ldr r3, [r1] + cmp r2, r3 + bge _08088174 + cmp r4, 0 + blt _08088174 + ldr r0, [r1, 0x4] + cmp r4, r0 + bge _08088174 + adds r0, r3, 0 + muls r0, r4 + adds r0, r2, r0 + ldr r1, [r1, 0x8] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + b _08088196 + .pool +_08088174: + ldr r0, =0x02037318 + ldr r3, [r0] + adds r1, r2, 0x1 + movs r2, 0x1 + ands r1, r2 + adds r0, r4, 0x1 + ands r0, r2 + lsls r0, 1 + adds r1, r0 + ldr r0, [r3, 0x8] + lsls r1, 1 + adds r1, r0 + ldrh r1, [r1] + movs r2, 0xC0 + lsls r2, 4 + adds r0, r2, 0 + orrs r1, r0 +_08088196: + ldr r0, =0x000003ff + cmp r1, r0 + beq _080881A8 + lsrs r0, r1, 12 + b _080881AA + .pool +_080881A8: + movs r0, 0 +_080881AA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end MapGridGetZCoordAt + + thumb_func_start MapGridIsImpassableAt +@ u8 MapGridIsImpassableAt(s32 x, s32 y) +MapGridIsImpassableAt: @ 80881B0 + push {r4,lr} + adds r2, r0, 0 + adds r4, r1, 0 + cmp r2, 0 + blt _080881E0 + ldr r1, =0x03005dc0 + ldr r3, [r1] + cmp r2, r3 + bge _080881E0 + cmp r4, 0 + blt _080881E0 + ldr r0, [r1, 0x4] + cmp r4, r0 + bge _080881E0 + adds r0, r3, 0 + muls r0, r4 + adds r0, r2, r0 + ldr r1, [r1, 0x8] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + b _08088202 + .pool +_080881E0: + ldr r0, =0x02037318 + ldr r3, [r0] + adds r1, r2, 0x1 + movs r2, 0x1 + ands r1, r2 + adds r0, r4, 0x1 + ands r0, r2 + lsls r0, 1 + adds r1, r0 + ldr r0, [r3, 0x8] + lsls r1, 1 + adds r1, r0 + ldrh r1, [r1] + movs r2, 0xC0 + lsls r2, 4 + adds r0, r2, 0 + orrs r1, r0 +_08088202: + ldr r0, =0x000003ff + cmp r1, r0 + beq _0808821C + movs r0, 0xC0 + lsls r0, 4 + ands r1, r0 + lsrs r0, r1, 10 + b _0808821E + .pool +_0808821C: + movs r0, 0x1 +_0808821E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end MapGridIsImpassableAt + + thumb_func_start MapGridGetMetatileIdAt +@ u16 MapGridGetMetatileIdAt(s32 x, s32 y) +MapGridGetMetatileIdAt: @ 8088224 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + cmp r5, 0 + blt _08088254 + ldr r1, =0x03005dc0 + ldr r2, [r1] + cmp r5, r2 + bge _08088254 + cmp r6, 0 + blt _08088254 + ldr r0, [r1, 0x4] + cmp r6, r0 + bge _08088254 + adds r0, r2, 0 + muls r0, r6 + adds r0, r5, r0 + ldr r1, [r1, 0x8] + lsls r0, 1 + adds r0, r1 + ldrh r4, [r0] + b _08088278 + .pool +_08088254: + ldr r0, =0x02037318 + ldr r3, [r0] + adds r1, r5, 0x1 + movs r2, 0x1 + ands r1, r2 + adds r0, r6, 0x1 + ands r0, r2 + lsls r0, 1 + adds r1, r0 + ldr r0, [r3, 0x8] + lsls r1, 1 + adds r1, r0 + ldrh r1, [r1] + movs r2, 0xC0 + lsls r2, 4 + adds r0, r2, 0 + adds r4, r0, 0 + orrs r4, r1 +_08088278: + ldr r0, =0x000003ff + cmp r4, r0 + beq _0808828C + ands r4, r0 + adds r0, r4, 0 + b _080882B0 + .pool +_0808828C: + ldr r0, =0x02037318 + ldr r3, [r0] + adds r1, r5, 0x1 + movs r2, 0x1 + ands r1, r2 + adds r0, r6, 0x1 + ands r0, r2 + lsls r0, 1 + adds r1, r0 + ldr r0, [r3, 0x8] + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + movs r2, 0xC0 + lsls r2, 4 + adds r1, r2, 0 + orrs r0, r1 + ands r0, r4 +_080882B0: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end MapGridGetMetatileIdAt + + thumb_func_start MapGridGetMetatileBehaviorAt +@ u8 MapGridGetMetatileBehaviorAt(s32 x, s32 y) +MapGridGetMetatileBehaviorAt: @ 80882BC + push {lr} + bl MapGridGetMetatileIdAt + lsls r0, 16 + lsrs r0, 16 + bl GetBehaviorByMetatileId + adds r1, r0, 0 + movs r0, 0xFF + ands r0, r1 + pop {r1} + bx r1 + thumb_func_end MapGridGetMetatileBehaviorAt + + thumb_func_start MapGridGetMetatileLayerTypeAt +@ u8 MapGridGetMetatileLayerTypeAt(s32 x, s32 y) +MapGridGetMetatileLayerTypeAt: @ 80882D4 + push {lr} + bl MapGridGetMetatileIdAt + lsls r0, 16 + lsrs r0, 16 + bl GetBehaviorByMetatileId + adds r1, r0, 0 + movs r0, 0xF0 + lsls r0, 8 + ands r0, r1 + lsrs r0, 12 + pop {r1} + bx r1 + thumb_func_end MapGridGetMetatileLayerTypeAt + + thumb_func_start MapGridSetMetatileIdAt +@ void MapGridSetMetatileIdAt(s32 x, s32 y, u16 metatileId) +MapGridSetMetatileIdAt: @ 80882F0 + push {r4,r5,lr} + adds r3, r0, 0 + lsls r2, 16 + lsrs r5, r2, 16 + cmp r3, 0 + blt _08088328 + ldr r2, =0x03005dc0 + ldr r4, [r2] + cmp r3, r4 + bge _08088328 + cmp r1, 0 + blt _08088328 + ldr r0, [r2, 0x4] + cmp r1, r0 + bge _08088328 + muls r1, r4 + adds r1, r3, r1 + ldr r0, [r2, 0x8] + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + movs r2, 0xF0 + lsls r2, 8 + ands r2, r0 + ldr r0, =0x00000fff + ands r0, r5 + orrs r2, r0 + strh r2, [r1] +_08088328: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end MapGridSetMetatileIdAt + + thumb_func_start MapGridSetMetatileEntryAt +@ void MapGridSetMetatileEntryAt(s32 x, s32 y, u16 metatileEntry) +MapGridSetMetatileEntryAt: @ 8088338 + push {r4,r5,lr} + adds r3, r0, 0 + lsls r2, 16 + lsrs r5, r2, 16 + cmp r3, 0 + blt _08088364 + ldr r2, =0x03005dc0 + ldr r4, [r2] + cmp r3, r4 + bge _08088364 + cmp r1, 0 + blt _08088364 + ldr r0, [r2, 0x4] + cmp r1, r0 + bge _08088364 + adds r0, r4, 0 + muls r0, r1 + adds r0, r3, r0 + ldr r1, [r2, 0x8] + lsls r0, 1 + adds r0, r1 + strh r5, [r0] +_08088364: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end MapGridSetMetatileEntryAt + + thumb_func_start GetBehaviorByMetatileId +@ u16 GetBehaviorByMetatileId(u16 metatileId) +GetBehaviorByMetatileId: @ 8088370 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + adds r3, r2, 0 + ldr r0, =0x000001ff + cmp r2, r0 + bhi _08088394 + ldr r0, =0x02037318 + ldr r0, [r0] + ldr r0, [r0, 0x10] + ldr r1, [r0, 0x10] + lsls r0, r2, 1 + b _080883B2 + .pool +_08088394: + ldr r0, =0x000003ff + cmp r2, r0 + bls _080883A4 + movs r0, 0xFF + b _080883B6 + .pool +_080883A4: + ldr r0, =0x02037318 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldr r1, [r0, 0x10] + lsls r0, r3, 1 + adds r0, r1 + ldr r1, =0xfffffc00 +_080883B2: + adds r0, r1 + ldrh r0, [r0] +_080883B6: + pop {r1} + bx r1 + .pool + thumb_func_end GetBehaviorByMetatileId + + thumb_func_start save_serialize_map +save_serialize_map: @ 80883C4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r0, =0x03005d8c + ldr r1, [r0] + adds r4, r1, 0 + adds r4, 0x34 + ldr r0, =0x03005dc0 + ldr r0, [r0] + mov r8, r0 + movs r0, 0 + ldrsh r6, [r1, r0] + movs r2, 0x2 + ldrsh r0, [r1, r2] + adds r1, r0, 0 + adds r1, 0xE + cmp r0, r1 + bge _08088420 + mov r12, r1 + ldr r1, =0x02032318 + mov r9, r1 + lsls r7, r6, 1 +_080883F2: + adds r1, r6, 0 + adds r3, r1, 0 + adds r3, 0xF + adds r5, r0, 0x1 + cmp r1, r3 + bge _0808841A + mov r2, r8 + muls r2, r0 + adds r0, r2, 0 + lsls r0, 1 + add r0, r9 + adds r2, r7, r0 + subs r1, r3, r1 +_0808840C: + ldrh r0, [r2] + strh r0, [r4] + adds r4, 0x2 + adds r2, 0x2 + subs r1, 0x1 + cmp r1, 0 + bne _0808840C +_0808841A: + adds r0, r5, 0 + cmp r0, r12 + blt _080883F2 +_08088420: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end save_serialize_map + + thumb_func_start sub_8088438 +sub_8088438: @ 8088438 + push {r4,lr} + movs r2, 0 + movs r1, 0 + ldr r0, =0x03005d8c + ldr r0, [r0] + adds r3, r0, 0 + adds r3, 0x34 + ldr r4, =0x000001ff +_08088448: + lsls r0, r1, 1 + adds r0, r3, r0 + ldrh r0, [r0] + orrs r2, r0 + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r4 + bls _08088448 + cmp r2, 0 + beq _0808846C + movs r0, 0 + b _0808846E + .pool +_0808846C: + movs r0, 0x1 +_0808846E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8088438 + + thumb_func_start sav2_mapdata_clear +sav2_mapdata_clear: @ 8088474 + push {lr} + sub sp, 0x4 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r0, =0x03005d8c + ldr r1, [r0] + adds r1, 0x34 + ldr r2, =0x01000100 + mov r0, sp + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sav2_mapdata_clear + + thumb_func_start mapdata_from_sav2 +mapdata_from_sav2: @ 808849C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + ldr r4, =0x03005d8c + ldr r0, [r4] + adds r7, r0, 0 + adds r7, 0x34 + bl sub_8088438 + cmp r0, 0 + bne _080885AC + ldr r0, =0x03005dc0 + ldr r0, [r0] + str r0, [sp] + ldr r0, [r4] + movs r2, 0 + ldrsh r1, [r0, r2] + mov r10, r1 + movs r2, 0x2 + ldrsh r1, [r0, r2] + mov r8, r1 + mov r6, r8 + adds r0, r6, 0 + adds r0, 0xE + cmp r6, r0 + bge _0808855A +_080884D6: + cmp r6, r8 + bne _080884EC + cmp r6, 0 + beq _080884EC + movs r0, 0 + mov r9, r0 + b _08088508 + .pool +_080884EC: + mov r0, r8 + adds r0, 0xD + movs r1, 0xFF + mov r9, r1 + cmp r6, r0 + bne _08088508 + ldr r0, =0x02037318 + ldr r0, [r0] + ldr r0, [r0, 0x4] + subs r0, 0x1 + cmp r6, r0 + beq _08088508 + movs r2, 0x1 + mov r9, r2 +_08088508: + mov r5, r10 + adds r0, r5, 0 + adds r0, 0xF + mov r1, r8 + adds r1, 0xE + str r1, [sp, 0x8] + adds r2, r6, 0x1 + str r2, [sp, 0x4] + cmp r5, r0 + bge _08088552 + ldr r0, [sp] + lsls r3, r0, 16 +_08088520: + ldr r1, [sp] + adds r0, r1, 0 + muls r0, r6 + adds r0, r5, r0 + lsls r0, 1 + ldr r1, =0x02032318 + adds r4, r0, r1 + adds r0, r4, 0 + lsrs r1, r3, 16 + mov r2, r9 + str r3, [sp, 0xC] + bl sub_8088BF0 + lsls r0, 24 + ldr r3, [sp, 0xC] + cmp r0, 0 + bne _08088546 + ldrh r0, [r7] + strh r0, [r4] +_08088546: + adds r7, 0x2 + adds r5, 0x1 + mov r0, r10 + adds r0, 0xF + cmp r5, r0 + blt _08088520 +_08088552: + ldr r6, [sp, 0x4] + ldr r2, [sp, 0x8] + cmp r6, r2 + blt _080884D6 +_0808855A: + mov r5, r10 + adds r0, r5, 0 + adds r0, 0xF + cmp r5, r0 + bge _080885A8 + mov r0, r8 + subs r0, 0x1 + lsls r0, 16 + mov r9, r0 + lsls r4, r5, 16 + mov r0, r8 + adds r0, 0xD + lsls r7, r0, 16 +_08088574: + mov r0, r8 + cmp r0, 0 + beq _08088584 + asrs r0, r4, 16 + mov r2, r9 + asrs r1, r2, 16 + bl sub_80D423C +_08088584: + ldr r0, =0x02037318 + ldr r0, [r0] + ldr r0, [r0, 0x4] + subs r0, 0x1 + cmp r6, r0 + bge _08088598 + asrs r0, r4, 16 + asrs r1, r7, 16 + bl sub_80D42B8 +_08088598: + movs r0, 0x80 + lsls r0, 9 + adds r4, r0 + adds r5, 0x1 + mov r0, r10 + adds r0, 0xF + cmp r5, r0 + blt _08088574 +_080885A8: + bl sav2_mapdata_clear +_080885AC: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end mapdata_from_sav2 + + thumb_func_start sub_80885C4 +sub_80885C4: @ 80885C4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 24 + lsrs r3, r0, 24 + adds r2, r3, 0 + ldr r0, =0x03005d8c + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x34 + str r0, [sp, 0x4] + ldr r0, =0x03005dc0 + ldr r0, [r0] + str r0, [sp] + movs r4, 0 + mov r9, r4 + mov r8, r4 + movs r0, 0 + ldrsh r6, [r1, r0] + str r6, [sp, 0x8] + movs r4, 0x2 + ldrsh r5, [r1, r4] + movs r7, 0xF + movs r6, 0xE + mov r12, r6 + cmp r3, 0x2 + beq _0808861E + cmp r3, 0x2 + bgt _08088614 + cmp r3, 0x1 + beq _08088626 + b _0808863E + .pool +_08088614: + cmp r2, 0x3 + beq _08088630 + cmp r2, 0x4 + beq _08088638 + b _0808863E +_0808861E: + adds r5, 0x1 + movs r0, 0xD + mov r12, r0 + b _0808863E +_08088626: + movs r1, 0x1 + mov r8, r1 + movs r3, 0xD + mov r12, r3 + b _0808863E +_08088630: + ldr r4, [sp, 0x8] + adds r4, 0x1 + str r4, [sp, 0x8] + b _0808863C +_08088638: + movs r6, 0x1 + mov r9, r6 +_0808863C: + movs r7, 0xE +_0808863E: + movs r1, 0 + cmp r1, r12 + bge _08088682 + ldr r0, =0x02032318 + mov r10, r0 +_08088648: + adds r4, r1, 0x1 + cmp r7, 0 + beq _0808867C + adds r0, r1, r5 + ldr r3, [sp] + adds r2, r3, 0 + muls r2, r0 + add r1, r8 + lsls r0, r1, 4 + subs r0, r1 + add r0, r9 + ldr r6, [sp, 0x8] + adds r2, r6, r2 + adds r3, r7, 0 + lsls r2, 1 + add r2, r10 + lsls r0, 1 + ldr r6, [sp, 0x4] + adds r1, r0, r6 +_0808866E: + ldrh r0, [r1] + strh r0, [r2] + adds r1, 0x2 + adds r2, 0x2 + subs r3, 0x1 + cmp r3, 0 + bne _0808866E +_0808867C: + adds r1, r4, 0 + cmp r1, r12 + blt _08088648 +_08088682: + bl sav2_mapdata_clear + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80885C4 + + thumb_func_start GetMapBorderIdAt +@ u32 GetMapBorderIdAt(s32 x, s32 y) +GetMapBorderIdAt: @ 808869C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + cmp r4, 0 + blt _080886D8 + ldr r1, =0x03005dc0 + ldr r2, [r1] + cmp r4, r2 + bge _080886D8 + cmp r5, 0 + blt _080886D8 + ldr r0, [r1, 0x4] + cmp r5, r0 + bge _080886D8 + adds r0, r2, 0 + muls r0, r5 + adds r0, r4, r0 + ldr r1, [r1, 0x8] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + ldr r0, =0x000003ff + cmp r1, r0 + beq _08088770 + b _08088700 + .pool +_080886D8: + ldr r0, =0x02037318 + ldr r3, [r0] + adds r1, r4, 0x1 + movs r2, 0x1 + ands r1, r2 + adds r0, r5, 0x1 + ands r0, r2 + lsls r0, 1 + adds r1, r0 + ldr r0, [r3, 0x8] + lsls r1, 1 + adds r1, r0 + ldrh r1, [r1] + movs r2, 0xC0 + lsls r2, 4 + adds r0, r2, 0 + orrs r0, r1 + ldr r1, =0x000003ff + cmp r0, r1 + beq _08088770 +_08088700: + ldr r1, =0x03005dc0 + ldr r0, [r1] + subs r0, 0x8 + cmp r4, r0 + blt _0808872C + ldr r0, =0x02037340 + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08088770 + movs r0, 0x4 + b _08088782 + .pool +_0808872C: + cmp r4, 0x6 + bgt _08088744 + ldr r0, =0x02037340 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08088770 + movs r0, 0x3 + b _08088782 + .pool +_08088744: + ldr r0, [r1, 0x4] + subs r0, 0x7 + cmp r5, r0 + blt _08088760 + ldr r0, =0x02037340 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08088770 + movs r0, 0x1 + b _08088782 + .pool +_08088760: + cmp r5, 0x6 + bgt _08088780 + ldr r0, =0x02037340 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0808877C +_08088770: + movs r0, 0x1 + negs r0, r0 + b _08088782 + .pool +_0808877C: + movs r0, 0x2 + b _08088782 +_08088780: + movs r0, 0 +_08088782: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end GetMapBorderIdAt + + thumb_func_start GetPostCameraMoveMapBorderId +@ u32 GetPostCameraMoveMapBorderId(s32 deltaX, s32 deltaY) +GetPostCameraMoveMapBorderId: @ 8088788 + push {r4,lr} + adds r3, r1, 0 + ldr r1, =0x03005d8c + ldr r1, [r1] + movs r4, 0 + ldrsh r2, [r1, r4] + adds r0, 0x7 + adds r2, r0 + movs r0, 0x2 + ldrsh r1, [r1, r0] + adds r3, 0x7 + adds r1, r3 + adds r0, r2, 0 + bl GetMapBorderIdAt + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end GetPostCameraMoveMapBorderId + + thumb_func_start CanCameraMoveInDirection +@ bool32 CanCameraMoveInDirection(u8 direction) +CanCameraMoveInDirection: @ 80887B0 + push {r4,r5,lr} + ldr r1, =0x03005d8c + ldr r4, [r1] + movs r1, 0 + ldrsh r3, [r4, r1] + ldr r2, =gUnknown_08339D64 + lsls r0, 3 + adds r1, r0, r2 + ldr r1, [r1] + adds r1, 0x7 + adds r3, r1 + movs r5, 0x2 + ldrsh r1, [r4, r5] + adds r2, 0x4 + adds r0, r2 + ldr r0, [r0] + adds r0, 0x7 + adds r1, r0 + adds r0, r3, 0 + bl GetMapBorderIdAt + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080887F0 + movs r0, 0x1 + b _080887F2 + .pool +_080887F0: + movs r0, 0 +_080887F2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end CanCameraMoveInDirection + + thumb_func_start sub_80887F8 +sub_80887F8: @ 80887F8 + push {r4-r7,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r6, r2, 0 + adds r7, r3, 0 + bl mapconnection_get_mapheader + adds r3, r0, 0 + cmp r4, 0x2 + beq _08088860 + cmp r4, 0x2 + bgt _08088816 + cmp r4, 0x1 + beq _0808884C + b _08088872 +_08088816: + cmp r4, 0x3 + beq _08088834 + cmp r4, 0x4 + bne _08088872 + ldr r0, =0x03005d8c + ldr r1, [r0] + negs r0, r6 + strh r0, [r1] + ldr r2, [r5, 0x4] + ldrh r0, [r1, 0x2] + subs r0, r2 + b _08088870 + .pool +_08088834: + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r0, [r3] + ldr r0, [r0] + strh r0, [r1] + ldr r2, [r5, 0x4] + ldrh r0, [r1, 0x2] + subs r0, r2 + b _08088870 + .pool +_0808884C: + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r2, [r5, 0x4] + ldrh r0, [r1] + subs r0, r2 + strh r0, [r1] + negs r0, r7 + b _08088870 + .pool +_08088860: + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r2, [r5, 0x4] + ldrh r0, [r1] + subs r0, r2 + strh r0, [r1] + ldr r0, [r3] + ldr r0, [r0, 0x4] +_08088870: + strh r0, [r1, 0x2] +_08088872: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80887F8 + + thumb_func_start CameraMove +@ u8 CameraMove(s32 deltaX, s32 deltaY) +CameraMove: @ 808887C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r10, r0 + mov r9, r1 + ldr r1, =0x02037334 + ldrb r0, [r1] + movs r1, 0x2 + negs r1, r1 + ands r1, r0 + ldr r2, =0x02037334 + strb r1, [r2] + mov r0, r10 + mov r1, r9 + bl GetPostCameraMoveMapBorderId + adds r7, r0, 0 + adds r0, r7, 0x1 + cmp r0, 0x1 + bhi _080888C4 + ldr r0, =0x03005d8c + ldr r1, [r0] + ldrh r0, [r1] + add r0, r10 + strh r0, [r1] + ldrh r0, [r1, 0x2] + add r0, r9 + strh r0, [r1, 0x2] + b _08088932 + .pool +_080888C4: + bl save_serialize_map + bl sub_81BE72C + ldr r1, =0x03005d8c + ldr r0, [r1] + movs r2, 0 + ldrsh r5, [r0, r2] + movs r1, 0x2 + ldrsh r6, [r0, r1] + lsls r2, r7, 24 + lsrs r2, 24 + mov r8, r2 + mov r0, r8 + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_8088950 + adds r4, r0, 0 + adds r1, r7, 0 + mov r2, r10 + mov r3, r9 + bl sub_80887F8 + ldrb r0, [r4, 0x8] + ldrb r1, [r4, 0x9] + bl mliX_load_map + ldr r1, =0x02037334 + ldrb r0, [r1] + movs r1, 0x1 + orrs r0, r1 + ldr r2, =0x02037334 + strb r0, [r2] + ldr r0, =0x03005d8c + ldr r1, [r0] + movs r2, 0 + ldrsh r0, [r1, r2] + subs r5, r0 + ldr r0, =0x02037334 + str r5, [r0, 0x4] + movs r2, 0x2 + ldrsh r0, [r1, r2] + subs r6, r0 + ldr r0, =0x02037334 + str r6, [r0, 0x8] + ldrh r0, [r1] + add r0, r10 + strh r0, [r1] + ldrh r0, [r1, 0x2] + add r0, r9 + strh r0, [r1, 0x2] + mov r0, r8 + bl sub_80885C4 +_08088932: + ldr r0, =0x02037334 + ldrb r0, [r0] + lsls r0, 31 + lsrs r0, 31 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end CameraMove + + thumb_func_start sub_8088950 +sub_8088950: @ 8088950 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r9, r1 + mov r8, r2 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x02037318 + ldr r0, [r0, 0xC] + ldr r7, [r0] + ldr r4, [r0, 0x4] + movs r5, 0 + cmp r5, r7 + bge _08088998 +_0808896E: + ldrb r0, [r4] + cmp r0, r6 + bne _08088990 + adds r0, r6, 0 + mov r1, r9 + mov r2, r8 + adds r3, r4, 0 + bl sub_80889A8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08088990 + adds r0, r4, 0 + b _0808899A + .pool +_08088990: + adds r5, 0x1 + adds r4, 0xC + cmp r5, r7 + blt _0808896E +_08088998: + movs r0, 0 +_0808899A: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8088950 + + thumb_func_start sub_80889A8 +sub_80889A8: @ 80889A8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r1, 0 + mov r8, r2 + adds r5, r3, 0 + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + adds r0, r5, 0 + bl mapconnection_get_mapheader + adds r2, r0, 0 + cmp r4, 0x1 + blt _08088A00 + cmp r4, 0x2 + bgt _080889E0 + ldr r0, =0x02037318 + ldr r0, [r0] + ldr r1, [r0] + ldr r0, [r2] + ldr r2, [r0] + ldr r3, [r5, 0x4] + adds r0, r7, 0 + b _080889F2 + .pool +_080889E0: + cmp r6, 0x4 + bgt _08088A00 + ldr r0, =0x02037318 + ldr r0, [r0] + ldr r1, [r0, 0x4] + ldr r0, [r2] + ldr r2, [r0, 0x4] + ldr r3, [r5, 0x4] + mov r0, r8 +_080889F2: + bl sub_8088A0C + lsls r0, 24 + lsrs r0, 24 + b _08088A02 + .pool +_08088A00: + movs r0, 0 +_08088A02: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80889A8 + + thumb_func_start sub_8088A0C +sub_8088A0C: @ 8088A0C + push {r4,lr} + adds r4, r0, 0 + adds r0, r2, 0 + adds r2, r3, 0 + cmp r3, 0 + bge _08088A1A + movs r3, 0 +_08088A1A: + adds r2, r0, r2 + cmp r2, r1 + bge _08088A22 + adds r1, r2, 0 +_08088A22: + cmp r3, r4 + bgt _08088A2E + cmp r4, r1 + bgt _08088A2E + movs r0, 0x1 + b _08088A30 +_08088A2E: + movs r0, 0 +_08088A30: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8088A0C + + thumb_func_start sub_8088A38 +sub_8088A38: @ 8088A38 + push {lr} + cmp r0, 0 + blt _08088A46 + cmp r0, r1 + bge _08088A46 + movs r0, 0x1 + b _08088A48 +_08088A46: + movs r0, 0 +_08088A48: + pop {r1} + bx r1 + thumb_func_end sub_8088A38 + + thumb_func_start sub_8088A4C +sub_8088A4C: @ 8088A4C + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + bl mapconnection_get_mapheader + adds r1, r0, 0 + ldrb r0, [r4] + cmp r0, 0x1 + blt _08088A84 + cmp r0, 0x2 + bgt _08088A72 + ldr r0, [r4, 0x4] + subs r0, r5, r0 + ldr r1, [r1] + ldr r1, [r1] + bl sub_8088A38 + b _08088A86 +_08088A72: + cmp r0, 0x4 + bgt _08088A84 + ldr r0, [r4, 0x4] + subs r0, r6, r0 + ldr r1, [r1] + ldr r1, [r1, 0x4] + bl sub_8088A38 + b _08088A86 +_08088A84: + movs r0, 0 +_08088A86: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8088A4C + + thumb_func_start sub_8088A8C +sub_8088A8C: @ 8088A8C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r1, 16 + lsrs r1, 16 + ldr r2, =0x02037318 + ldr r0, [r2, 0xC] + cmp r0, 0 + bne _08088AB4 + b _08088B2A + .pool +_08088AB0: + adds r0, r4, 0 + b _08088B2C +_08088AB4: + ldr r7, [r0] + ldr r4, [r0, 0x4] + movs r6, 0 + cmp r6, r7 + bge _08088B2A + lsls r0, r1, 16 + asrs r5, r0, 16 + mov r9, r2 + mov r1, r8 + lsls r0, r1, 16 + asrs r0, 16 + mov r10, r0 +_08088ACC: + ldrb r1, [r4] + adds r3, r1, 0 + subs r0, r1, 0x5 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _08088B22 + cmp r1, 0x2 + bne _08088AE2 + cmp r5, 0x6 + bgt _08088B22 +_08088AE2: + cmp r1, 0x1 + bne _08088AF2 + mov r2, r9 + ldr r0, [r2] + ldr r0, [r0, 0x4] + adds r0, 0x7 + cmp r5, r0 + blt _08088B22 +_08088AF2: + mov r0, r8 + lsls r2, r0, 16 + cmp r1, 0x3 + bne _08088B00 + mov r1, r10 + cmp r1, 0x6 + bgt _08088B22 +_08088B00: + cmp r3, 0x4 + bne _08088B12 + asrs r1, r2, 16 + mov r3, r9 + ldr r0, [r3] + ldr r0, [r0] + adds r0, 0x7 + cmp r1, r0 + blt _08088B22 +_08088B12: + asrs r1, r2, 16 + subs r1, 0x7 + adds r0, r4, 0 + subs r2, r5, 0x7 + bl sub_8088A4C + cmp r0, 0x1 + beq _08088AB0 +_08088B22: + adds r6, 0x1 + adds r4, 0xC + cmp r6, r7 + blt _08088ACC +_08088B2A: + movs r0, 0 +_08088B2C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8088A8C + + thumb_func_start sub_8088B3C +sub_8088B3C: @ 8088B3C + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r1, 16 + ldr r2, =0x03005d8c + ldr r2, [r2] + subs r0, 0x7 + strh r0, [r2] + subs r1, 0x7 + strh r1, [r2, 0x2] + bx lr + .pool + thumb_func_end sub_8088B3C + + thumb_func_start sav1_camera_get_focus_coords +sav1_camera_get_focus_coords: @ 8088B58 + ldr r2, =0x03005d8c + ldr r3, [r2] + ldrh r2, [r3] + adds r2, 0x7 + strh r2, [r0] + ldrh r0, [r3, 0x2] + adds r0, 0x7 + strh r0, [r1] + bx lr + .pool + thumb_func_end sav1_camera_get_focus_coords + + thumb_func_start SetCameraCoords +@ void SetCameraCoords(u16 x, u16 y) +SetCameraCoords: @ 8088B70 + ldr r2, =0x03005d8c + ldr r2, [r2] + strh r0, [r2] + strh r1, [r2, 0x2] + bx lr + .pool + thumb_func_end SetCameraCoords + + thumb_func_start GetCameraCoords +@ void GetCameraCoords(u16 *x, u16 *y) +GetCameraCoords: @ 8088B80 + ldr r2, =0x03005d8c + ldr r3, [r2] + ldrh r2, [r3] + strh r2, [r0] + ldrh r0, [r3, 0x2] + strh r0, [r1] + bx lr + .pool + thumb_func_end GetCameraCoords + + thumb_func_start sub_8088B94 +sub_8088B94: @ 8088B94 + push {r4,r5,lr} + adds r4, r0, 0 + adds r3, r1, 0 + adds r5, r2, 0 + cmp r4, 0 + blt _08088BE6 + ldr r2, =0x03005dc0 + ldr r1, [r2] + cmp r4, r1 + bge _08088BE6 + cmp r3, 0 + blt _08088BE6 + ldr r0, [r2, 0x4] + cmp r3, r0 + bge _08088BE6 + cmp r5, 0 + beq _08088BD4 + adds r0, r1, 0 + muls r0, r3 + adds r0, r4, r0 + ldr r1, [r2, 0x8] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r3, 0xC0 + lsls r3, 4 + adds r2, r3, 0 + orrs r1, r2 + strh r1, [r0] + b _08088BE6 + .pool +_08088BD4: + muls r1, r3 + adds r1, r4, r1 + ldr r0, [r2, 0x8] + lsls r1, 1 + adds r1, r0 + ldrh r2, [r1] + ldr r0, =0x0000f3ff + ands r0, r2 + strh r0, [r1] +_08088BE6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8088B94 + + thumb_func_start sub_8088BF0 +sub_8088BF0: @ 8088BF0 + push {lr} + adds r3, r0, 0 + lsls r1, 16 + lsrs r0, r1, 16 + adds r1, r0, 0 + lsls r2, 24 + lsrs r2, 24 + cmp r2, 0xFF + beq _08088C24 + cmp r2, 0 + bne _08088C0C + lsls r0, 1 + subs r3, r0 + b _08088C10 +_08088C0C: + lsls r0, r1, 1 + adds r3, r0 +_08088C10: + ldrh r1, [r3] + ldr r0, =0x000003ff + ands r0, r1 + adds r1, r2, 0 + bl sub_80FADE4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08088C2C +_08088C24: + movs r0, 0 + b _08088C2E + .pool +_08088C2C: + movs r0, 0x1 +_08088C2E: + pop {r1} + bx r1 + thumb_func_end sub_8088BF0 + + thumb_func_start copy_tileset_patterns_to_vram +@ void copy_tileset_patterns_to_vram(tileset *tileset, int num_tiles, int offset) +copy_tileset_patterns_to_vram: @ 8088C34 + push {r4-r7,lr} + sub sp, 0x4 + adds r3, r0, 0 + lsls r1, 16 + lsrs r4, r1, 16 + adds r6, r4, 0 + lsls r2, 16 + lsrs r5, r2, 16 + adds r7, r5, 0 + cmp r3, 0 + beq _08088C70 + ldrb r0, [r3] + cmp r0, 0 + bne _08088C60 + ldr r1, [r3, 0x4] + lsls r2, r4, 21 + lsrs r2, 16 + movs r0, 0x2 + adds r3, r5, 0 + bl LoadBgTiles + b _08088C70 +_08088C60: + ldr r1, [r3, 0x4] + lsls r2, r6, 5 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + adds r3, r7, 0 + bl decompress_and_copy_tile_data_to_vram +_08088C70: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end copy_tileset_patterns_to_vram + + thumb_func_start copy_tileset_patterns_to_vram2 +@ void copy_tileset_patterns_to_vram2(tileset *tileset, int num_tiles, int offset) +copy_tileset_patterns_to_vram2: @ 8088C78 + push {r4-r7,lr} + sub sp, 0x4 + adds r3, r0, 0 + lsls r1, 16 + lsrs r4, r1, 16 + adds r6, r4, 0 + lsls r2, 16 + lsrs r5, r2, 16 + adds r7, r5, 0 + cmp r3, 0 + beq _08088CB4 + ldrb r0, [r3] + cmp r0, 0 + bne _08088CA4 + ldr r1, [r3, 0x4] + lsls r2, r4, 21 + lsrs r2, 16 + movs r0, 0x2 + adds r3, r5, 0 + bl LoadBgTiles + b _08088CB4 +_08088CA4: + ldr r1, [r3, 0x4] + lsls r2, r6, 5 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + adds r3, r7, 0 + bl copy_decompressed_tile_data_to_vram_autofree +_08088CB4: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end copy_tileset_patterns_to_vram2 + + thumb_func_start nullsub_3 +nullsub_3: @ 8088CBC + bx lr + thumb_func_end nullsub_3 + + thumb_func_start nullsub_90 +nullsub_90: @ 8088CC0 + bx lr + thumb_func_end nullsub_90 + + thumb_func_start apply_map_tileset_palette +@ void apply_map_tileset_palette(tileset *tileset, int dest_offset, int size) +apply_map_tileset_palette: @ 8088CC4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + mov r8, r5 + lsls r6, r2, 16 + lsrs r7, r6, 16 + adds r2, r7, 0 + movs r1, 0 + mov r0, sp + strh r1, [r0] + cmp r4, 0 + beq _08088D42 + ldrb r0, [r4, 0x1] + cmp r0, 0 + bne _08088D18 + mov r0, sp + adds r1, r5, 0 + movs r2, 0x2 + bl gpu_pal_apply + ldr r0, [r4, 0x8] + adds r0, 0x2 + adds r5, 0x1 + lsls r5, 16 + lsrs r5, 16 + subs r4, r7, 0x2 + lsls r2, r4, 16 + lsrs r2, 16 + adds r1, r5, 0 + bl gpu_pal_apply + lsls r4, 15 + lsrs r4, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl nullsub_3 + b _08088D42 +_08088D18: + cmp r0, 0x1 + bne _08088D32 + ldr r0, [r4, 0x8] + adds r0, 0xC0 + adds r1, r5, 0 + adds r2, r7, 0 + bl gpu_pal_apply + lsrs r1, r6, 17 + adds r0, r5, 0 + bl nullsub_3 + b _08088D42 +_08088D32: + ldr r0, [r4, 0x8] + mov r1, r8 + bl decompress_palette + lsrs r1, r6, 17 + mov r0, r8 + bl nullsub_3 +_08088D42: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end apply_map_tileset_palette + + thumb_func_start copy_map_tileset1_to_vram +@ void copy_map_tileset1_to_vram(mapdata_header *a1) +copy_map_tileset1_to_vram: @ 8088D50 + push {lr} + ldr r0, [r0, 0x10] + movs r1, 0x80 + lsls r1, 2 + movs r2, 0 + bl copy_tileset_patterns_to_vram + pop {r0} + bx r0 + thumb_func_end copy_map_tileset1_to_vram + + thumb_func_start copy_map_tileset2_to_vram +@ void copy_map_tileset2_to_vram(mapdata_header *a1) +copy_map_tileset2_to_vram: @ 8088D64 + push {lr} + ldr r0, [r0, 0x14] + movs r2, 0x80 + lsls r2, 2 + adds r1, r2, 0 + bl copy_tileset_patterns_to_vram + pop {r0} + bx r0 + thumb_func_end copy_map_tileset2_to_vram + + thumb_func_start copy_map_tileset2_to_vram_2 +@ void copy_map_tileset2_to_vram_2(mapdata_header *a1) +copy_map_tileset2_to_vram_2: @ 8088D78 + push {lr} + ldr r0, [r0, 0x14] + movs r2, 0x80 + lsls r2, 2 + adds r1, r2, 0 + bl copy_tileset_patterns_to_vram2 + pop {r0} + bx r0 + thumb_func_end copy_map_tileset2_to_vram_2 + + thumb_func_start apply_map_tileset1_palette +@ void apply_map_tileset1_palette(mapdata_header *a1) +apply_map_tileset1_palette: @ 8088D8C + push {lr} + ldr r0, [r0, 0x10] + movs r1, 0 + movs r2, 0xC0 + bl apply_map_tileset_palette + pop {r0} + bx r0 + thumb_func_end apply_map_tileset1_palette + + thumb_func_start apply_map_tileset2_palette +@ void apply_map_tileset2_palette(mapdata_header *a1) +apply_map_tileset2_palette: @ 8088D9C + push {lr} + ldr r0, [r0, 0x14] + movs r1, 0x60 + movs r2, 0xE0 + bl apply_map_tileset_palette + pop {r0} + bx r0 + thumb_func_end apply_map_tileset2_palette + + thumb_func_start copy_map_tileset1_tileset2_to_vram +@ void copy_map_tileset1_tileset2_to_vram(mapdata_header *a1) +copy_map_tileset1_tileset2_to_vram: @ 8088DAC + push {r4,r5,lr} + adds r5, r0, 0 + cmp r5, 0 + beq _08088DCC + ldr r0, [r5, 0x10] + movs r4, 0x80 + lsls r4, 2 + adds r1, r4, 0 + movs r2, 0 + bl copy_tileset_patterns_to_vram2 + ldr r0, [r5, 0x14] + adds r1, r4, 0 + adds r2, r4, 0 + bl copy_tileset_patterns_to_vram2 +_08088DCC: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end copy_map_tileset1_tileset2_to_vram + + thumb_func_start apply_map_tileset1_tileset2_palette +@ void apply_map_tileset1_tileset2_palette(mapdata_header *a1) +apply_map_tileset1_tileset2_palette: @ 8088DD4 + push {r4,lr} + adds r4, r0, 0 + cmp r4, 0 + beq _08088DE6 + bl apply_map_tileset1_palette + adds r0, r4, 0 + bl apply_map_tileset2_palette +_08088DE6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end apply_map_tileset1_tileset2_palette + + thumb_func_start ShouldDoJumpLandingDustEffect +ShouldDoJumpLandingDustEffect: @ 8088DEC + movs r0, 0x1 + bx lr + thumb_func_end ShouldDoJumpLandingDustEffect + + thumb_func_start sub_8088DF0 +sub_8088DF0: @ 8088DF0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_08486EFC + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08088E0C + movs r0, 0 + b _08088E0E + .pool +_08088E0C: + movs r0, 0x1 +_08088E0E: + pop {r1} + bx r1 + thumb_func_end sub_8088DF0 + + thumb_func_start MetatileBehavior_IsJumpEast +MetatileBehavior_IsJumpEast: @ 8088E14 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x38 + beq _08088E22 + movs r0, 0 + b _08088E24 +_08088E22: + movs r0, 0x1 +_08088E24: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsJumpEast + + thumb_func_start MetatileBehavior_IsJumpWest +MetatileBehavior_IsJumpWest: @ 8088E28 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x39 + beq _08088E36 + movs r0, 0 + b _08088E38 +_08088E36: + movs r0, 0x1 +_08088E38: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsJumpWest + + thumb_func_start MetatileBehavior_IsJumpNorth +MetatileBehavior_IsJumpNorth: @ 8088E3C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3A + beq _08088E4A + movs r0, 0 + b _08088E4C +_08088E4A: + movs r0, 0x1 +_08088E4C: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsJumpNorth + + thumb_func_start MetatileBehavior_IsJumpSouth +MetatileBehavior_IsJumpSouth: @ 8088E50 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3B + beq _08088E5E + movs r0, 0 + b _08088E60 +_08088E5E: + movs r0, 0x1 +_08088E60: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsJumpSouth + + thumb_func_start sub_8088E64 +sub_8088E64: @ 8088E64 + push {lr} + lsls r0, 24 + movs r1, 0xFE + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bls _08088E78 + movs r0, 0 + b _08088E7A +_08088E78: + movs r0, 0x1 +_08088E7A: + pop {r1} + bx r1 + thumb_func_end sub_8088E64 + + thumb_func_start MetatileBehavior_IsSandOrDeepSand +MetatileBehavior_IsSandOrDeepSand: @ 8088E80 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x21 + beq _08088E8E + cmp r0, 0x6 + bne _08088E92 +_08088E8E: + movs r0, 0x1 + b _08088E94 +_08088E92: + movs r0, 0 +_08088E94: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsSandOrDeepSand + + thumb_func_start MetatileBehavior_IsDeepSand +MetatileBehavior_IsDeepSand: @ 8088E98 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6 + beq _08088EA6 + movs r0, 0 + b _08088EA8 +_08088EA6: + movs r0, 0x1 +_08088EA8: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsDeepSand + + thumb_func_start MetatileBehavior_IsReflective +MetatileBehavior_IsReflective: @ 8088EAC + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x10 + beq _08088ECA + cmp r0, 0x16 + beq _08088ECA + cmp r0, 0x1A + beq _08088ECA + cmp r0, 0x20 + beq _08088ECA + cmp r0, 0x14 + beq _08088ECA + cmp r0, 0x2B + bne _08088ECE +_08088ECA: + movs r0, 0x1 + b _08088ED0 +_08088ECE: + movs r0, 0 +_08088ED0: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsReflective + + thumb_func_start MetatileBehavior_IsIce +MetatileBehavior_IsIce: @ 8088ED4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x20 + beq _08088EE2 + movs r0, 0 + b _08088EE4 +_08088EE2: + movs r0, 0x1 +_08088EE4: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsIce + + thumb_func_start is_tile_x69_2_warp_door +is_tile_x69_2_warp_door: @ 8088EE8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x69 + beq _08088EF6 + movs r0, 0 + b _08088EF8 +_08088EF6: + movs r0, 0x1 +_08088EF8: + pop {r1} + bx r1 + thumb_func_end is_tile_x69_2_warp_door + + thumb_func_start sub_8088EFC +sub_8088EFC: @ 8088EFC + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x8D + beq _08088F0A + cmp r0, 0x69 + bne _08088F0E +_08088F0A: + movs r0, 0x1 + b _08088F10 +_08088F0E: + movs r0, 0 +_08088F10: + pop {r1} + bx r1 + thumb_func_end sub_8088EFC + + thumb_func_start MetatileBehavior_IsEscalator +MetatileBehavior_IsEscalator: @ 8088F14 + push {lr} + lsls r0, 24 + movs r1, 0x96 + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bls _08088F28 + movs r0, 0 + b _08088F2A +_08088F28: + movs r0, 0x1 +_08088F2A: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsEscalator + + thumb_func_start sub_8088F30 +sub_8088F30: @ 8088F30 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + beq _08088F3E + movs r0, 0 + b _08088F40 +_08088F3E: + movs r0, 0x1 +_08088F40: + pop {r1} + bx r1 + thumb_func_end sub_8088F30 + + thumb_func_start MetatileBehavior_IsLadder +MetatileBehavior_IsLadder: @ 8088F44 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x61 + beq _08088F52 + movs r0, 0 + b _08088F54 +_08088F52: + movs r0, 0x1 +_08088F54: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsLadder + + thumb_func_start sub_8088F58 +sub_8088F58: @ 8088F58 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x60 + beq _08088F6A + cmp r0, 0x6C + beq _08088F6A + cmp r0, 0x6E + bne _08088F6E +_08088F6A: + movs r0, 0x1 + b _08088F70 +_08088F6E: + movs r0, 0 +_08088F70: + pop {r1} + bx r1 + thumb_func_end sub_8088F58 + + thumb_func_start sub_8088F74 +sub_8088F74: @ 8088F74 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6E + beq _08088F82 + movs r0, 0 + b _08088F84 +_08088F82: + movs r0, 0x1 +_08088F84: + pop {r1} + bx r1 + thumb_func_end sub_8088F74 + + thumb_func_start MetatileBehavior_IsSurfableWaterOrUnderwater +MetatileBehavior_IsSurfableWaterOrUnderwater: @ 8088F88 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_08486EFC + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08088FA4 + movs r0, 0 + b _08088FA6 + .pool +_08088FA4: + movs r0, 0x1 +_08088FA6: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsSurfableWaterOrUnderwater + + thumb_func_start MetatileBehavior_IsEastArrowWarp +MetatileBehavior_IsEastArrowWarp: @ 8088FAC + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x62 + beq _08088FBA + movs r0, 0 + b _08088FBC +_08088FBA: + movs r0, 0x1 +_08088FBC: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsEastArrowWarp + + thumb_func_start MetatileBehavior_IsWestArrowWarp +MetatileBehavior_IsWestArrowWarp: @ 8088FC0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x63 + beq _08088FCE + movs r0, 0 + b _08088FD0 +_08088FCE: + movs r0, 0x1 +_08088FD0: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsWestArrowWarp + + thumb_func_start MetatileBehavior_IsNorthArrowWarp +MetatileBehavior_IsNorthArrowWarp: @ 8088FD4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x64 + beq _08088FE2 + cmp r0, 0x1B + bne _08088FE6 +_08088FE2: + movs r0, 0x1 + b _08088FE8 +_08088FE6: + movs r0, 0 +_08088FE8: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsNorthArrowWarp + + thumb_func_start MetatileBehavior_IsSouthArrowWarp +MetatileBehavior_IsSouthArrowWarp: @ 8088FEC + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x65 + beq _08088FFE + cmp r0, 0x6D + beq _08088FFE + cmp r0, 0x1C + bne _08089002 +_08088FFE: + movs r0, 0x1 + b _08089004 +_08089002: + movs r0, 0 +_08089004: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsSouthArrowWarp + + thumb_func_start sub_8089008 +sub_8089008: @ 8089008 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r5, 0 + adds r0, r4, 0 + bl MetatileBehavior_IsEastArrowWarp + lsls r0, 24 + cmp r0, 0 + bne _08089040 + adds r0, r4, 0 + bl MetatileBehavior_IsWestArrowWarp + lsls r0, 24 + cmp r0, 0 + bne _08089040 + adds r0, r4, 0 + bl MetatileBehavior_IsNorthArrowWarp + lsls r0, 24 + cmp r0, 0 + bne _08089040 + adds r0, r4, 0 + bl MetatileBehavior_IsSouthArrowWarp + lsls r0, 24 + cmp r0, 0 + beq _08089042 +_08089040: + movs r5, 0x1 +_08089042: + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8089008 + + thumb_func_start sub_808904C +sub_808904C: @ 808904C + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0xC0 + lsls r2, 24 + adds r0, r2 + lsrs r0, 24 + cmp r0, 0x8 + bls _08089082 + adds r0, r1, 0 + subs r0, 0x50 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _08089082 + cmp r1, 0xD0 + beq _08089082 + cmp r1, 0xD2 + beq _08089082 + cmp r1, 0x13 + beq _08089082 + cmp r1, 0x20 + beq _08089082 + cmp r1, 0xBB + beq _08089082 + cmp r1, 0xBC + bne _08089086 +_08089082: + movs r0, 0x1 + b _08089088 +_08089086: + movs r0, 0 +_08089088: + pop {r1} + bx r1 + thumb_func_end sub_808904C + + thumb_func_start MetatileBehavior_IsIce_2 +@ bool8 MetatileBehavior_IsIce_2(u8 metatileBehavior) +MetatileBehavior_IsIce_2: @ 808908C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x20 + beq _0808909A + movs r0, 0 + b _0808909C +_0808909A: + movs r0, 0x1 +_0808909C: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsIce_2 + + thumb_func_start MetatileBehavior_IsTrickHouseSlipperyFloor +@ bool8 MetatileBehavior_IsTrickHouseSlipperyFloor(u8 metatileBehavior) +MetatileBehavior_IsTrickHouseSlipperyFloor: @ 80890A0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x48 + beq _080890AE + movs r0, 0 + b _080890B0 +_080890AE: + movs r0, 0x1 +_080890B0: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsTrickHouseSlipperyFloor + + thumb_func_start MetatileBehavior_0x05 +MetatileBehavior_0x05: @ 80890B4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + beq _080890C2 + movs r0, 0 + b _080890C4 +_080890C2: + movs r0, 0x1 +_080890C4: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_0x05 + + thumb_func_start MetatileBehavior_IsWalkNorth +@ bool8 MetatileBehavior_IsWalkNorth(u8 metatileBehavior) +MetatileBehavior_IsWalkNorth: @ 80890C8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x42 + beq _080890D6 + movs r0, 0 + b _080890D8 +_080890D6: + movs r0, 0x1 +_080890D8: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsWalkNorth + + thumb_func_start MetatileBehavior_IsWalkSouth +@ bool8 MetatileBehavior_IsWalkSouth(u8 metatileBehavior) +MetatileBehavior_IsWalkSouth: @ 80890DC + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x43 + beq _080890EA + movs r0, 0 + b _080890EC +_080890EA: + movs r0, 0x1 +_080890EC: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsWalkSouth + + thumb_func_start MetatileBehavior_IsWalkWest +@ bool8 MetatileBehavior_IsWalkWest(u8 metatileBehavior) +MetatileBehavior_IsWalkWest: @ 80890F0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x41 + beq _080890FE + movs r0, 0 + b _08089100 +_080890FE: + movs r0, 0x1 +_08089100: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsWalkWest + + thumb_func_start MetatileBehavior_IsWalkEast +@ bool8 MetatileBehavior_IsWalkEast(u8 metatileBehavior) +MetatileBehavior_IsWalkEast: @ 8089104 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _08089112 + movs r0, 0 + b _08089114 +_08089112: + movs r0, 0x1 +_08089114: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsWalkEast + + thumb_func_start MetatileBehavior_IsNorthwardCurrent +@ bool8 MetatileBehavior_IsNorthwardCurrent(u8 metatileBehavior) +MetatileBehavior_IsNorthwardCurrent: @ 8089118 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x52 + beq _08089126 + movs r0, 0 + b _08089128 +_08089126: + movs r0, 0x1 +_08089128: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsNorthwardCurrent + + thumb_func_start MetatileBehavior_IsSouthwardCurrent +@ bool8 MetatileBehavior_IsSouthwardCurrent(u8 metatileBehavior) +MetatileBehavior_IsSouthwardCurrent: @ 808912C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x53 + beq _0808913A + movs r0, 0 + b _0808913C +_0808913A: + movs r0, 0x1 +_0808913C: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsSouthwardCurrent + + thumb_func_start MetatileBehavior_IsWestwardCurrent +@ bool8 MetatileBehavior_IsWestwardCurrent(u8 metatileBehavior) +MetatileBehavior_IsWestwardCurrent: @ 8089140 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x51 + beq _0808914E + movs r0, 0 + b _08089150 +_0808914E: + movs r0, 0x1 +_08089150: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsWestwardCurrent + + thumb_func_start MetatileBehavior_IsEastwardCurrent +@ bool8 MetatileBehavior_IsEastwardCurrent(u8 metatileBehavior) +MetatileBehavior_IsEastwardCurrent: @ 8089154 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x50 + beq _08089162 + movs r0, 0 + b _08089164 +_08089162: + movs r0, 0x1 +_08089164: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsEastwardCurrent + + thumb_func_start MetatileBehavior_IsSlideNorth +@ bool8 MetatileBehavior_IsSlideNorth(u8 metatileBehavior) +MetatileBehavior_IsSlideNorth: @ 8089168 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x46 + beq _08089176 + movs r0, 0 + b _08089178 +_08089176: + movs r0, 0x1 +_08089178: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsSlideNorth + + thumb_func_start MetatileBehavior_IsSlideSouth +@ bool8 MetatileBehavior_IsSlideSouth(u8 metatileBehavior) +MetatileBehavior_IsSlideSouth: @ 808917C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x47 + beq _0808918A + movs r0, 0 + b _0808918C +_0808918A: + movs r0, 0x1 +_0808918C: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsSlideSouth + + thumb_func_start MetatileBehavior_IsSlideWest +@ bool8 MetatileBehavior_IsSlideWest(u8 metatileBehavior) +MetatileBehavior_IsSlideWest: @ 8089190 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x45 + beq _0808919E + movs r0, 0 + b _080891A0 +_0808919E: + movs r0, 0x1 +_080891A0: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsSlideWest + + thumb_func_start MetatileBehavior_IsSlideEast +@ bool8 MetatileBehavior_IsSlideEast(u8 metatileBehavior) +MetatileBehavior_IsSlideEast: @ 80891A4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x44 + beq _080891B2 + movs r0, 0 + b _080891B4 +_080891B2: + movs r0, 0x1 +_080891B4: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsSlideEast + + thumb_func_start MetatileBehavior_IsCounter +MetatileBehavior_IsCounter: @ 80891B8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x80 + beq _080891C6 + movs r0, 0 + b _080891C8 +_080891C6: + movs r0, 0x1 +_080891C8: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsCounter + + thumb_func_start MetatileBehavior_IsPlayerFacingTVScreen +@ bool8 MetatileBehavior_IsPlayerFacingTVScreen(u8 behavior, u8 direction) +MetatileBehavior_IsPlayerFacingTVScreen: @ 80891CC + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x2 + bne _080891DE + cmp r0, 0x86 + beq _080891E2 +_080891DE: + movs r0, 0 + b _080891E4 +_080891E2: + movs r0, 0x1 +_080891E4: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsPlayerFacingTVScreen + + thumb_func_start MetatileBehavior_IsPC +MetatileBehavior_IsPC: @ 80891E8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x83 + beq _080891F6 + movs r0, 0 + b _080891F8 +_080891F6: + movs r0, 0x1 +_080891F8: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsPC + + thumb_func_start is_tile_x84 +is_tile_x84: @ 80891FC + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x84 + beq _0808920A + movs r0, 0 + b _0808920C +_0808920A: + movs r0, 0x1 +_0808920C: + pop {r1} + bx r1 + thumb_func_end is_tile_x84 + + thumb_func_start sub_8089210 +sub_8089210: @ 8089210 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x91 + beq _08089232 + cmp r0, 0x93 + beq _08089232 + cmp r0, 0x95 + beq _08089232 + cmp r0, 0x97 + beq _08089232 + cmp r0, 0x99 + beq _08089232 + cmp r0, 0x9B + beq _08089232 + cmp r0, 0x9D + bne _08089236 +_08089232: + movs r0, 0x1 + b _08089238 +_08089236: + movs r0, 0 +_08089238: + pop {r1} + bx r1 + thumb_func_end sub_8089210 + + thumb_func_start sub_808923C +sub_808923C: @ 808923C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x90 + beq _08089252 + cmp r0, 0x92 + beq _08089252 + cmp r0, 0x94 + beq _08089252 + cmp r0, 0x9A + bne _08089256 +_08089252: + movs r0, 0x1 + b _08089258 +_08089256: + movs r0, 0 +_08089258: + pop {r1} + bx r1 + thumb_func_end sub_808923C + + thumb_func_start sub_808925C +sub_808925C: @ 808925C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x96 + beq _0808926A + cmp r0, 0x9C + bne _0808926E +_0808926A: + movs r0, 0x1 + b _08089270 +_0808926E: + movs r0, 0 +_08089270: + pop {r1} + bx r1 + thumb_func_end sub_808925C + + thumb_func_start is_tile_x98 +is_tile_x98: @ 8089274 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x98 + beq _08089282 + movs r0, 0 + b _08089284 +_08089282: + movs r0, 0x1 +_08089284: + pop {r1} + bx r1 + thumb_func_end is_tile_x98 + + thumb_func_start sub_8089288 +sub_8089288: @ 8089288 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xB0 + beq _08089296 + movs r0, 0 + b _08089298 +_08089296: + movs r0, 0x1 +_08089298: + pop {r1} + bx r1 + thumb_func_end sub_8089288 + + thumb_func_start sub_808929C +sub_808929C: @ 808929C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xB1 + beq _080892AA + movs r0, 0 + b _080892AC +_080892AA: + movs r0, 0x1 +_080892AC: + pop {r1} + bx r1 + thumb_func_end sub_808929C + + thumb_func_start sub_80892B0 +sub_80892B0: @ 80892B0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xB2 + beq _080892BE + movs r0, 0 + b _080892C0 +_080892BE: + movs r0, 0x1 +_080892C0: + pop {r1} + bx r1 + thumb_func_end sub_80892B0 + + thumb_func_start sub_80892C4 +sub_80892C4: @ 80892C4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xB3 + beq _080892D2 + movs r0, 0 + b _080892D4 +_080892D2: + movs r0, 0x1 +_080892D4: + pop {r1} + bx r1 + thumb_func_end sub_80892C4 + + thumb_func_start sub_80892D8 +sub_80892D8: @ 80892D8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xB9 + beq _080892E6 + movs r0, 0 + b _080892E8 +_080892E6: + movs r0, 0x1 +_080892E8: + pop {r1} + bx r1 + thumb_func_end sub_80892D8 + + thumb_func_start sub_80892EC +sub_80892EC: @ 80892EC + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xC6 + beq _080892FA + movs r0, 0 + b _080892FC +_080892FA: + movs r0, 0x1 +_080892FC: + pop {r1} + bx r1 + thumb_func_end sub_80892EC + + thumb_func_start sub_8089300 +sub_8089300: @ 8089300 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xC7 + beq _0808930E + movs r0, 0 + b _08089310 +_0808930E: + movs r0, 0x1 +_08089310: + pop {r1} + bx r1 + thumb_func_end sub_8089300 + + thumb_func_start sub_8089314 +sub_8089314: @ 8089314 + push {lr} + lsls r0, 24 + cmp r0, 0 + beq _08089320 + movs r0, 0 + b _08089322 +_08089320: + movs r0, 0x1 +_08089322: + pop {r1} + bx r1 + thumb_func_end sub_8089314 + + thumb_func_start sub_8089328 +sub_8089328: @ 8089328 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xB7 + beq _08089336 + movs r0, 0 + b _08089338 +_08089336: + movs r0, 0x1 +_08089338: + pop {r1} + bx r1 + thumb_func_end sub_8089328 + + thumb_func_start sub_808933C +sub_808933C: @ 808933C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xB2 + beq _0808934A + movs r0, 0 + b _0808934C +_0808934A: + movs r0, 0x1 +_0808934C: + pop {r1} + bx r1 + thumb_func_end sub_808933C + + thumb_func_start sub_8089350 +sub_8089350: @ 8089350 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xB5 + beq _0808935E + movs r0, 0 + b _08089360 +_0808935E: + movs r0, 0x1 +_08089360: + pop {r1} + bx r1 + thumb_func_end sub_8089350 + + thumb_func_start sub_8089364 +sub_8089364: @ 8089364 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xC3 + beq _08089372 + movs r0, 0 + b _08089374 +_08089372: + movs r0, 0x1 +_08089374: + pop {r1} + bx r1 + thumb_func_end sub_8089364 + + thumb_func_start sub_8089378 +sub_8089378: @ 8089378 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xC2 + beq _08089386 + movs r0, 0 + b _08089388 +_08089386: + movs r0, 0x1 +_08089388: + pop {r1} + bx r1 + thumb_func_end sub_8089378 + + thumb_func_start sub_808938C +sub_808938C: @ 808938C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xB8 + beq _0808939A + movs r0, 0 + b _0808939C +_0808939A: + movs r0, 0x1 +_0808939C: + pop {r1} + bx r1 + thumb_func_end sub_808938C + + thumb_func_start sub_80893A0 +sub_80893A0: @ 80893A0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xBE + beq _080893AE + movs r0, 0 + b _080893B0 +_080893AE: + movs r0, 0x1 +_080893B0: + pop {r1} + bx r1 + thumb_func_end sub_80893A0 + + thumb_func_start sub_80893B4 +sub_80893B4: @ 80893B4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xBD + beq _080893C2 + movs r0, 0 + b _080893C4 +_080893C2: + movs r0, 0x1 +_080893C4: + pop {r1} + bx r1 + thumb_func_end sub_80893B4 + + thumb_func_start sub_80893C8 +sub_80893C8: @ 80893C8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xBA + beq _080893D6 + movs r0, 0 + b _080893D8 +_080893D6: + movs r0, 0x1 +_080893D8: + pop {r1} + bx r1 + thumb_func_end sub_80893C8 + + thumb_func_start sub_80893DC +sub_80893DC: @ 80893DC + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xBF + beq _080893EA + movs r0, 0 + b _080893EC +_080893EA: + movs r0, 0x1 +_080893EC: + pop {r1} + bx r1 + thumb_func_end sub_80893DC + + thumb_func_start sub_80893F0 +sub_80893F0: @ 80893F0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xC4 + beq _080893FE + movs r0, 0 + b _08089400 +_080893FE: + movs r0, 0x1 +_08089400: + pop {r1} + bx r1 + thumb_func_end sub_80893F0 + + thumb_func_start sub_8089404 +sub_8089404: @ 8089404 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xC5 + beq _08089412 + movs r0, 0 + b _08089414 +_08089412: + movs r0, 0x1 +_08089414: + pop {r1} + bx r1 + thumb_func_end sub_8089404 + + thumb_func_start MetatileBehavior_HasRipples +MetatileBehavior_HasRipples: @ 8089418 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x10 + beq _0808942A + cmp r0, 0x16 + beq _0808942A + cmp r0, 0x14 + bne _0808942E +_0808942A: + movs r0, 0x1 + b _08089430 +_0808942E: + movs r0, 0 +_08089430: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_HasRipples + + thumb_func_start MetatileBehavior_IsPuddle +MetatileBehavior_IsPuddle: @ 8089434 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x16 + beq _08089442 + movs r0, 0 + b _08089444 +_08089442: + movs r0, 0x1 +_08089444: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsPuddle + + thumb_func_start MetatileBehavior_IsTallGrass +MetatileBehavior_IsTallGrass: @ 8089448 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _08089456 + movs r0, 0 + b _08089458 +_08089456: + movs r0, 0x1 +_08089458: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsTallGrass + + thumb_func_start MetatileBehavior_IsLongGrass +MetatileBehavior_IsLongGrass: @ 808945C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + beq _0808946A + movs r0, 0 + b _0808946C +_0808946A: + movs r0, 0x1 +_0808946C: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsLongGrass + + thumb_func_start MetatileBehavior_IsBerryTreeSoil +MetatileBehavior_IsBerryTreeSoil: @ 8089470 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xA0 + beq _0808947E + movs r0, 0 + b _08089480 +_0808947E: + movs r0, 0x1 +_08089480: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsBerryTreeSoil + + thumb_func_start MetatileBehavior_IsAsh +MetatileBehavior_IsAsh: @ 8089484 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x24 + beq _08089492 + movs r0, 0 + b _08089494 +_08089492: + movs r0, 0x1 +_08089494: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsAsh + + thumb_func_start MetatileBehavior_IsUnusedFootprintMetatile +MetatileBehavior_IsUnusedFootprintMetatile: @ 8089498 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x25 + beq _080894A6 + movs r0, 0 + b _080894A8 +_080894A6: + movs r0, 0x1 +_080894A8: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsUnusedFootprintMetatile + + thumb_func_start sub_80894AC +sub_80894AC: @ 80894AC + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0x90 + lsls r2, 24 + adds r0, r2 + lsrs r0, 24 + cmp r0, 0x3 + bls _080894CA + adds r0, r1, 0 + subs r0, 0x7C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bhi _080894CE +_080894CA: + movs r0, 0x1 + b _080894D0 +_080894CE: + movs r0, 0 +_080894D0: + pop {r1} + bx r1 + thumb_func_end sub_80894AC + + thumb_func_start sub_80894D4 +sub_80894D4: @ 80894D4 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + adds r2, r1, 0 + adds r0, r1, 0 + subs r0, 0x70 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _0808950A + adds r0, r1, 0 + subs r0, 0x7A + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _080894F8 + movs r0, 0x2 + b _0808950A +_080894F8: + adds r0, r2, 0 + subs r0, 0x7C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _08089508 + movs r0, 0 + b _0808950A +_08089508: + movs r0, 0x3 +_0808950A: + pop {r1} + bx r1 + thumb_func_end sub_80894D4 + + thumb_func_start sub_8089510 +sub_8089510: @ 8089510 + push {lr} + lsls r0, 24 + movs r1, 0x90 + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x3 + bls _08089524 + movs r0, 0 + b _08089526 +_08089524: + movs r0, 0x1 +_08089526: + pop {r1} + bx r1 + thumb_func_end sub_8089510 + + thumb_func_start sub_808952C +sub_808952C: @ 808952C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl MetatileBehavior_IsSurfableWaterOrUnderwater + lsls r0, 24 + cmp r0, 0 + bne _08089550 + adds r0, r4, 0 + bl sub_8088DF0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08089550 + movs r0, 0x1 + b _08089552 +_08089550: + movs r0, 0 +_08089552: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_808952C + + thumb_func_start sub_8089558 +sub_8089558: @ 8089558 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl MetatileBehavior_IsSurfableWaterOrUnderwater + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0808957E + adds r0, r4, 0 + bl sub_8088DF0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0808957E + movs r0, 0x1 + b _08089580 +_0808957E: + movs r0, 0 +_08089580: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8089558 + + thumb_func_start sub_8089588 +sub_8089588: @ 8089588 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xB + beq _08089596 + movs r0, 0 + b _08089598 +_08089596: + movs r0, 0x1 +_08089598: + pop {r1} + bx r1 + thumb_func_end sub_8089588 + + thumb_func_start sub_808959C +sub_808959C: @ 808959C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xC + beq _080895AA + movs r0, 0 + b _080895AC +_080895AA: + movs r0, 0x1 +_080895AC: + pop {r1} + bx r1 + thumb_func_end sub_808959C + + thumb_func_start sub_80895B0 +sub_80895B0: @ 80895B0 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0xEF + lsls r2, 24 + adds r0, r2 + lsrs r0, 24 + cmp r0, 0x1 + bls _080895C6 + cmp r1, 0x14 + bne _080895CA +_080895C6: + movs r0, 0x1 + b _080895CC +_080895CA: + movs r0, 0 +_080895CC: + pop {r1} + bx r1 + thumb_func_end sub_80895B0 + + thumb_func_start sub_80895D0 +sub_80895D0: @ 80895D0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x19 + beq _080895DE + cmp r0, 0x2A + bne _080895E2 +_080895DE: + movs r0, 0x1 + b _080895E4 +_080895E2: + movs r0, 0 +_080895E4: + pop {r1} + bx r1 + thumb_func_end sub_80895D0 + + thumb_func_start MetatileBehavior_IsShallowFlowingWater +MetatileBehavior_IsShallowFlowingWater: @ 80895E8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x17 + beq _080895FA + cmp r0, 0x1B + beq _080895FA + cmp r0, 0x1C + bne _080895FE +_080895FA: + movs r0, 0x1 + b _08089600 +_080895FE: + movs r0, 0 +_08089600: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsShallowFlowingWater + + thumb_func_start sub_8089604 +sub_8089604: @ 8089604 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x26 + beq _08089612 + movs r0, 0 + b _08089614 +_08089612: + movs r0, 0x1 +_08089614: + pop {r1} + bx r1 + thumb_func_end sub_8089604 + + thumb_func_start sub_8089618 +sub_8089618: @ 8089618 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x27 + beq _08089626 + movs r0, 0 + b _08089628 +_08089626: + movs r0, 0x1 +_08089628: + pop {r1} + bx r1 + thumb_func_end sub_8089618 + + thumb_func_start sub_808962C +sub_808962C: @ 808962C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x15 + beq _0808963E + cmp r0, 0x11 + beq _0808963E + cmp r0, 0x12 + bne _08089642 +_0808963E: + movs r0, 0x1 + b _08089644 +_08089642: + movs r0, 0 +_08089644: + pop {r1} + bx r1 + thumb_func_end sub_808962C + + thumb_func_start sub_8089648 +sub_8089648: @ 8089648 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x18 + beq _08089656 + cmp r0, 0x1A + bne _0808965A +_08089656: + movs r0, 0x1 + b _0808965C +_0808965A: + movs r0, 0 +_0808965C: + pop {r1} + bx r1 + thumb_func_end sub_8089648 + + thumb_func_start sub_8089660 +sub_8089660: @ 8089660 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl MetatileBehavior_IsSurfableWaterOrUnderwater + lsls r0, 24 + cmp r0, 0 + beq _08089682 + adds r0, r4, 0 + bl MetatileBehavior_IsWaterfall + lsls r0, 24 + cmp r0, 0 + bne _08089682 + movs r0, 0x1 + b _08089684 +_08089682: + movs r0, 0 +_08089684: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8089660 + + thumb_func_start MetatileBehavior_IsEastBlocked +MetatileBehavior_IsEastBlocked: @ 808968C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x30 + beq _080896A6 + cmp r0, 0x34 + beq _080896A6 + cmp r0, 0x36 + beq _080896A6 + cmp r0, 0xC1 + beq _080896A6 + cmp r0, 0xBE + bne _080896AA +_080896A6: + movs r0, 0x1 + b _080896AC +_080896AA: + movs r0, 0 +_080896AC: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsEastBlocked + + thumb_func_start MetatileBehavior_IsWestBlocked +MetatileBehavior_IsWestBlocked: @ 80896B0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x31 + beq _080896CA + cmp r0, 0x35 + beq _080896CA + cmp r0, 0x37 + beq _080896CA + cmp r0, 0xC1 + beq _080896CA + cmp r0, 0xBE + bne _080896CE +_080896CA: + movs r0, 0x1 + b _080896D0 +_080896CE: + movs r0, 0 +_080896D0: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsWestBlocked + + thumb_func_start MetatileBehavior_IsNorthBlocked +MetatileBehavior_IsNorthBlocked: @ 80896D4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x32 + beq _080896EA + cmp r0, 0x34 + beq _080896EA + cmp r0, 0x35 + beq _080896EA + cmp r0, 0xC0 + bne _080896EE +_080896EA: + movs r0, 0x1 + b _080896F0 +_080896EE: + movs r0, 0 +_080896F0: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsNorthBlocked + + thumb_func_start MetatileBehavior_IsSouthBlocked +MetatileBehavior_IsSouthBlocked: @ 80896F4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x33 + beq _0808970A + cmp r0, 0x36 + beq _0808970A + cmp r0, 0x37 + beq _0808970A + cmp r0, 0xC0 + bne _0808970E +_0808970A: + movs r0, 0x1 + b _08089710 +_0808970E: + movs r0, 0 +_08089710: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsSouthBlocked + + thumb_func_start MetatileBehavior_IsShortGrass +MetatileBehavior_IsShortGrass: @ 8089714 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x7 + beq _08089722 + movs r0, 0 + b _08089724 +_08089722: + movs r0, 0x1 +_08089724: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsShortGrass + + thumb_func_start MetatileBehavior_IsHotSprings +MetatileBehavior_IsHotSprings: @ 8089728 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x28 + beq _08089736 + movs r0, 0 + b _08089738 +_08089736: + movs r0, 0x1 +_08089738: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsHotSprings + + thumb_func_start MetatileBehavior_IsWaterfall +@ bool8 MetatileBehavior_IsWaterfall(u8 metatileBehavior) +MetatileBehavior_IsWaterfall: @ 808973C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x13 + beq _0808974A + movs r0, 0 + b _0808974C +_0808974A: + movs r0, 0x1 +_0808974C: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsWaterfall + + thumb_func_start MetatileBehavior_IsFortreeBridge +MetatileBehavior_IsFortreeBridge: @ 8089750 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x78 + beq _0808975E + movs r0, 0 + b _08089760 +_0808975E: + movs r0, 0x1 +_08089760: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsFortreeBridge + + thumb_func_start sub_8089764 +sub_8089764: @ 8089764 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x74 + beq _08089772 + movs r0, 0 + b _08089774 +_08089772: + movs r0, 0x1 +_08089774: + pop {r1} + bx r1 + thumb_func_end sub_8089764 + + thumb_func_start sub_8089778 +sub_8089778: @ 8089778 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x75 + beq _08089786 + movs r0, 0 + b _08089788 +_08089786: + movs r0, 0x1 +_08089788: + pop {r1} + bx r1 + thumb_func_end sub_8089778 + + thumb_func_start sub_808978C +sub_808978C: @ 808978C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x76 + beq _0808979A + movs r0, 0 + b _0808979C +_0808979A: + movs r0, 0x1 +_0808979C: + pop {r1} + bx r1 + thumb_func_end sub_808978C + + thumb_func_start sub_80897A0 +sub_80897A0: @ 80897A0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x77 + beq _080897AE + movs r0, 0 + b _080897B0 +_080897AE: + movs r0, 0x1 +_080897B0: + pop {r1} + bx r1 + thumb_func_end sub_80897A0 + + thumb_func_start MetatileBehavior_IsPacifidlogLog +MetatileBehavior_IsPacifidlogLog: @ 80897B4 + push {lr} + lsls r0, 24 + movs r1, 0x8C + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x3 + bls _080897C8 + movs r0, 0 + b _080897CA +_080897C8: + movs r0, 0x1 +_080897CA: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsPacifidlogLog + + thumb_func_start is_tile_x8C +is_tile_x8C: @ 80897D0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x8C + beq _080897DE + movs r0, 0 + b _080897E0 +_080897DE: + movs r0, 0x1 +_080897E0: + pop {r1} + bx r1 + thumb_func_end is_tile_x8C + + thumb_func_start is_tile_x85 +is_tile_x85: @ 80897E4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x85 + beq _080897F2 + movs r0, 0 + b _080897F4 +_080897F2: + movs r0, 0x1 +_080897F4: + pop {r1} + bx r1 + thumb_func_end is_tile_x85 + + thumb_func_start is_tile_x8B +is_tile_x8B: @ 80897F8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x8B + beq _08089806 + movs r0, 0 + b _08089808 +_08089806: + movs r0, 0x1 +_08089808: + pop {r1} + bx r1 + thumb_func_end is_tile_x8B + + thumb_func_start is_tile_xEA +is_tile_xEA: @ 808980C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xEA + beq _0808981A + movs r0, 0 + b _0808981C +_0808981A: + movs r0, 0x1 +_0808981C: + pop {r1} + bx r1 + thumb_func_end is_tile_xEA + + thumb_func_start is_tile_x8A +is_tile_x8A: @ 8089820 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x8A + beq _0808982E + movs r0, 0 + b _08089830 +_0808982E: + movs r0, 0x1 +_08089830: + pop {r1} + bx r1 + thumb_func_end is_tile_x8A + + thumb_func_start is_tile_x87 +is_tile_x87: @ 8089834 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x87 + beq _08089842 + movs r0, 0 + b _08089844 +_08089842: + movs r0, 0x1 +_08089844: + pop {r1} + bx r1 + thumb_func_end is_tile_x87 + + thumb_func_start MetatileBehavior_0xBB +@ bool8 MetatileBehavior_0xBB(u8 metatileBehavior) +MetatileBehavior_0xBB: @ 8089848 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xBB + beq _08089856 + movs r0, 0 + b _08089858 +_08089856: + movs r0, 0x1 +_08089858: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_0xBB + + thumb_func_start MetatileBehavior_0xBC +@ bool8 MetatileBehavior_0xBC(u8 metatileBehavior) +MetatileBehavior_0xBC: @ 808985C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xBC + beq _0808986A + movs r0, 0 + b _0808986C +_0808986A: + movs r0, 0x1 +_0808986C: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_0xBC + + thumb_func_start sub_8089870 +sub_8089870: @ 8089870 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x29 + beq _0808987E + movs r0, 0 + b _08089880 +_0808987E: + movs r0, 0x1 +_08089880: + pop {r1} + bx r1 + thumb_func_end sub_8089870 + + thumb_func_start is_role_x68 +is_role_x68: @ 8089884 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x68 + beq _08089892 + movs r0, 0 + b _08089894 +_08089892: + movs r0, 0x1 +_08089894: + pop {r1} + bx r1 + thumb_func_end is_role_x68 + + thumb_func_start MetatileBehavior_IsAquaHideoutWarp +MetatileBehavior_IsAquaHideoutWarp: @ 8089898 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x67 + beq _080898A6 + movs r0, 0 + b _080898A8 +_080898A6: + movs r0, 0x1 +_080898A8: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsAquaHideoutWarp + + thumb_func_start sub_80898AC +sub_80898AC: @ 80898AC + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x70 + beq _080898BA + movs r0, 0 + b _080898BC +_080898BA: + movs r0, 0x1 +_080898BC: + pop {r1} + bx r1 + thumb_func_end sub_80898AC + + thumb_func_start sub_80898C0 +sub_80898C0: @ 80898C0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xE + beq _080898CE + movs r0, 0 + b _080898D0 +_080898CE: + movs r0, 0x1 +_080898D0: + pop {r1} + bx r1 + thumb_func_end sub_80898C0 + + thumb_func_start MetatileBehavior_IsSurfableFishableWater +MetatileBehavior_IsSurfableFishableWater: @ 80898D4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x10 + beq _080898F8 + cmp r0, 0x15 + beq _080898F8 + cmp r0, 0x11 + beq _080898F8 + cmp r0, 0x12 + beq _080898F8 + cmp r0, 0x14 + beq _080898F8 + subs r0, 0x50 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bhi _080898FC +_080898F8: + movs r0, 0x1 + b _080898FE +_080898FC: + movs r0, 0 +_080898FE: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsSurfableFishableWater + + thumb_func_start sub_8089904 +sub_8089904: @ 8089904 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xF + beq _08089912 + movs r0, 0 + b _08089914 +_08089912: + movs r0, 0x1 +_08089914: + pop {r1} + bx r1 + thumb_func_end sub_8089904 + + thumb_func_start sub_8089918 +sub_8089918: @ 8089918 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x66 + beq _08089926 + movs r0, 0 + b _08089928 +_08089926: + movs r0, 0x1 +_08089928: + pop {r1} + bx r1 + thumb_func_end sub_8089918 + + thumb_func_start sub_808992C +sub_808992C: @ 808992C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xD2 + beq _0808993A + movs r0, 0 + b _0808993C +_0808993A: + movs r0, 0x1 +_0808993C: + pop {r1} + bx r1 + thumb_func_end sub_808992C + + thumb_func_start MetatileBehavior_IsMuddySlope +@ bool8 MetatileBehavior_IsMuddySlope(u8 metatileBehavior) +MetatileBehavior_IsMuddySlope: @ 8089940 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xD0 + beq _0808994E + movs r0, 0 + b _08089950 +_0808994E: + movs r0, 0x1 +_08089950: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsMuddySlope + + thumb_func_start MetatileBehavior_IsBumpySlope +MetatileBehavior_IsBumpySlope: @ 8089954 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xD1 + beq _08089962 + movs r0, 0 + b _08089964 +_08089962: + movs r0, 0x1 +_08089964: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsBumpySlope + + thumb_func_start MetatileBehavior_IsIsolatedVerticalRail +MetatileBehavior_IsIsolatedVerticalRail: @ 8089968 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xD3 + beq _08089976 + movs r0, 0 + b _08089978 +_08089976: + movs r0, 0x1 +_08089978: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsIsolatedVerticalRail + + thumb_func_start MetatileBehavior_IsIsolatedHorizontalRail +MetatileBehavior_IsIsolatedHorizontalRail: @ 808997C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xD4 + beq _0808998A + movs r0, 0 + b _0808998C +_0808998A: + movs r0, 0x1 +_0808998C: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsIsolatedHorizontalRail + + thumb_func_start MetatileBehavior_IsVerticalRail +MetatileBehavior_IsVerticalRail: @ 8089990 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xD5 + beq _0808999E + movs r0, 0 + b _080899A0 +_0808999E: + movs r0, 0x1 +_080899A0: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsVerticalRail + + thumb_func_start MetatileBehavior_IsHorizontalRail +MetatileBehavior_IsHorizontalRail: @ 80899A4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xD6 + beq _080899B2 + movs r0, 0 + b _080899B4 +_080899B2: + movs r0, 0x1 +_080899B4: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsHorizontalRail + + thumb_func_start MetatileBehavior_IsSeaweed +MetatileBehavior_IsSeaweed: @ 80899B8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x22 + beq _080899C6 + cmp r0, 0x2A + bne _080899CA +_080899C6: + movs r0, 0x1 + b _080899CC +_080899CA: + movs r0, 0 +_080899CC: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsSeaweed + + thumb_func_start MetatileBehavior_IsRunningDisallowed +MetatileBehavior_IsRunningDisallowed: @ 80899D0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xA + beq _080899EC + cmp r0, 0x3 + beq _080899EC + cmp r0, 0x28 + beq _080899EC + bl MetatileBehavior_IsPacifidlogLog + lsls r0, 24 + cmp r0, 0 + beq _080899F0 +_080899EC: + movs r0, 0x1 + b _080899F2 +_080899F0: + movs r0, 0 +_080899F2: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsRunningDisallowed + + thumb_func_start sub_80899F8 +sub_80899F8: @ 80899F8 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0xFE + lsls r2, 24 + adds r0, r2 + lsrs r0, 24 + cmp r0, 0x1 + bls _08089A12 + cmp r1, 0x24 + beq _08089A12 + cmp r1, 0x9 + bne _08089A16 +_08089A12: + movs r0, 0x1 + b _08089A18 +_08089A16: + movs r0, 0 +_08089A18: + pop {r1} + bx r1 + thumb_func_end sub_80899F8 + + thumb_func_start sub_8089A1C +sub_8089A1C: @ 8089A1C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x8E + beq _08089A2A + movs r0, 0 + b _08089A2C +_08089A2A: + movs r0, 0x1 +_08089A2C: + pop {r1} + bx r1 + thumb_func_end sub_8089A1C + + thumb_func_start sub_8089A30 +sub_8089A30: @ 8089A30 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xE0 + beq _08089A3E + movs r0, 0 + b _08089A40 +_08089A3E: + movs r0, 0x1 +_08089A40: + pop {r1} + bx r1 + thumb_func_end sub_8089A30 + + thumb_func_start sub_8089A44 +sub_8089A44: @ 8089A44 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xE1 + beq _08089A52 + movs r0, 0 + b _08089A54 +_08089A52: + movs r0, 0x1 +_08089A54: + pop {r1} + bx r1 + thumb_func_end sub_8089A44 + + thumb_func_start sub_8089A58 +sub_8089A58: @ 8089A58 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xE2 + beq _08089A66 + movs r0, 0 + b _08089A68 +_08089A66: + movs r0, 0x1 +_08089A68: + pop {r1} + bx r1 + thumb_func_end sub_8089A58 + + thumb_func_start sub_8089A6C +sub_8089A6C: @ 8089A6C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xE3 + beq _08089A7A + movs r0, 0 + b _08089A7C +_08089A7A: + movs r0, 0x1 +_08089A7C: + pop {r1} + bx r1 + thumb_func_end sub_8089A6C + + thumb_func_start sub_8089A80 +sub_8089A80: @ 8089A80 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xE4 + beq _08089A8E + movs r0, 0 + b _08089A90 +_08089A8E: + movs r0, 0x1 +_08089A90: + pop {r1} + bx r1 + thumb_func_end sub_8089A80 + + thumb_func_start sub_8089A94 +sub_8089A94: @ 8089A94 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xE5 + beq _08089AA2 + movs r0, 0 + b _08089AA4 +_08089AA2: + movs r0, 0x1 +_08089AA4: + pop {r1} + bx r1 + thumb_func_end sub_8089A94 + + thumb_func_start sub_8089AA8 +sub_8089AA8: @ 8089AA8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xE6 + beq _08089AB6 + movs r0, 0 + b _08089AB8 +_08089AB6: + movs r0, 0x1 +_08089AB8: + pop {r1} + bx r1 + thumb_func_end sub_8089AA8 + + thumb_func_start sub_8089ABC +sub_8089ABC: @ 8089ABC + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xD + beq _08089ACA + movs r0, 0 + b _08089ACC +_08089ACA: + movs r0, 0x1 +_08089ACC: + pop {r1} + bx r1 + thumb_func_end sub_8089ABC + + thumb_func_start sub_8089AD0 +sub_8089AD0: @ 8089AD0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x2 + bne _08089AE2 + cmp r0, 0xE8 + beq _08089AE6 +_08089AE2: + movs r0, 0 + b _08089AE8 +_08089AE6: + movs r0, 0x1 +_08089AE8: + pop {r1} + bx r1 + thumb_func_end sub_8089AD0 + + thumb_func_start sub_8089AEC +sub_8089AEC: @ 8089AEC + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x2 + bne _08089AFE + cmp r0, 0xE7 + beq _08089B02 +_08089AFE: + movs r0, 0 + b _08089B04 +_08089B02: + movs r0, 0x1 +_08089B04: + pop {r1} + bx r1 + thumb_func_end sub_8089AEC + + thumb_func_start MetatileBehavior_IsQuestionnaire +MetatileBehavior_IsQuestionnaire: @ 8089B08 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x8F + beq _08089B16 + movs r0, 0 + b _08089B18 +_08089B16: + movs r0, 0x1 +_08089B18: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsQuestionnaire + + thumb_func_start MetatileBehavior_IsLongGrass2 +MetatileBehavior_IsLongGrass2: @ 8089B1C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + beq _08089B2A + movs r0, 0 + b _08089B2C +_08089B2A: + movs r0, 0x1 +_08089B2C: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsLongGrass2 + + thumb_func_start MetatileBehavior_IsLongGrassSouthEdge +MetatileBehavior_IsLongGrassSouthEdge: @ 8089B30 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x9 + beq _08089B3E + movs r0, 0 + b _08089B40 +_08089B3E: + movs r0, 0x1 +_08089B40: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsLongGrassSouthEdge + + thumb_func_start MetatileBehavior_IsTrainerHillTimer +MetatileBehavior_IsTrainerHillTimer: @ 8089B44 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xE9 + beq _08089B52 + movs r0, 0 + b _08089B54 +_08089B52: + movs r0, 0x1 +_08089B54: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsTrainerHillTimer + + thumb_func_start move_tilemap_camera_to_upper_left_corner_ +@ void move_tilemap_camera_to_upper_left_corner_(struc_28 *a1) +move_tilemap_camera_to_upper_left_corner_: @ 8089B58 + movs r1, 0 + strb r1, [r0, 0x2] + strb r1, [r0, 0x3] + strb r1, [r0] + strb r1, [r0, 0x1] + movs r1, 0x1 + strb r1, [r0, 0x4] + bx lr + thumb_func_end move_tilemap_camera_to_upper_left_corner_ + + thumb_func_start tilemap_move_something +@ void tilemap_move_something(struct struc_28 *, u8 deltaX, u8 deltaY) +tilemap_move_something: @ 8089B68 + ldrb r3, [r0, 0x2] + adds r3, r1 + strb r3, [r0, 0x2] + ldrb r1, [r0, 0x2] + movs r3, 0x1F + ands r1, r3 + strb r1, [r0, 0x2] + ldrb r1, [r0, 0x3] + adds r1, r2 + strb r1, [r0, 0x3] + ldrb r1, [r0, 0x3] + ands r1, r3 + strb r1, [r0, 0x3] + bx lr + thumb_func_end tilemap_move_something + + thumb_func_start coords8_add +@ void coords8_add(struct coords8 *coords, u8 x, u8 y) +coords8_add: @ 8089B84 + ldrb r3, [r0] + adds r3, r1 + strb r3, [r0] + ldrb r1, [r0, 0x1] + adds r1, r2 + strb r1, [r0, 0x1] + bx lr + thumb_func_end coords8_add + + thumb_func_start move_tilemap_camera_to_upper_left_corner +@ void move_tilemap_camera_to_upper_left_corner() +move_tilemap_camera_to_upper_left_corner: @ 8089B94 + push {lr} + ldr r0, =0x03000e20 + bl move_tilemap_camera_to_upper_left_corner_ + pop {r0} + bx r0 + .pool + thumb_func_end move_tilemap_camera_to_upper_left_corner + + thumb_func_start FieldUpdateBgTilemapScroll +@ void FieldUpdateBgTilemapScroll() +FieldUpdateBgTilemapScroll: @ 8089BA4 + push {r4,r5,lr} + ldr r1, =0x03000e20 + ldr r0, =0x03000e28 + movs r2, 0 + ldrsh r5, [r0, r2] + ldrb r0, [r1] + adds r5, r0 + ldr r0, =0x03000e2a + movs r2, 0 + ldrsh r4, [r0, r2] + ldrb r1, [r1, 0x1] + adds r4, r1 + adds r4, 0x8 + lsls r5, 16 + lsrs r5, 16 + movs r0, 0x14 + adds r1, r5, 0 + bl SetGpuReg + lsls r4, 16 + lsrs r4, 16 + movs r0, 0x16 + adds r1, r4, 0 + bl SetGpuReg + movs r0, 0x18 + adds r1, r5, 0 + bl SetGpuReg + movs r0, 0x1A + adds r1, r4, 0 + bl SetGpuReg + movs r0, 0x1C + adds r1, r5, 0 + bl SetGpuReg + movs r0, 0x1E + adds r1, r4, 0 + bl SetGpuReg + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end FieldUpdateBgTilemapScroll + + thumb_func_start sub_8089C08 +sub_8089C08: @ 8089C08 + push {r4,lr} + ldr r3, =0x03000e20 + ldr r2, =0x03000e28 + ldrh r2, [r2] + ldrb r4, [r3] + adds r2, r4 + strh r2, [r0] + ldr r0, =0x03000e2a + ldrh r0, [r0] + ldrb r3, [r3, 0x1] + adds r0, r3 + adds r0, 0x8 + strh r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8089C08 + + thumb_func_start DrawWholeMapView +@ void DrawWholeMapView() +DrawWholeMapView: @ 8089C34 + push {lr} + ldr r0, =0x03005d8c + ldr r1, [r0] + movs r2, 0 + ldrsh r0, [r1, r2] + movs r2, 0x2 + ldrsh r1, [r1, r2] + ldr r2, =0x02037318 + ldr r2, [r2] + bl DrawWholeMapViewInternal + ldr r1, =0x03000e20 + movs r0, 0x1 + strb r0, [r1, 0x4] + pop {r0} + bx r0 + .pool + thumb_func_end DrawWholeMapView + + thumb_func_start DrawWholeMapViewInternal +@ void DrawWholeMapViewInternal(s32 x, s32 y, struct mapdata_header *mapGrid) +DrawWholeMapViewInternal: @ 8089C60 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r10, r0 + mov r9, r1 + mov r8, r2 + movs r1, 0 +_08089C74: + ldr r2, =0x03000e20 + ldrb r0, [r2, 0x3] + adds r0, r1, r0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1F + bls _08089C88 + subs r0, 0x20 + lsls r0, 24 + lsrs r0, 24 +_08089C88: + lsls r6, r0, 5 + movs r4, 0 + adds r7, r1, 0x2 + str r7, [sp] + lsrs r5, r1, 1 +_08089C92: + ldr r1, =0x03000e20 + ldrb r0, [r1, 0x2] + adds r0, r4, r0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1F + bls _08089CA6 + subs r0, 0x20 + lsls r0, 24 + lsrs r0, 24 +_08089CA6: + adds r1, r6, r0 + lsls r1, 16 + lsrs r1, 16 + lsrs r2, r4, 1 + add r2, r10 + mov r0, r8 + mov r7, r9 + adds r3, r7, r5 + bl DrawMetatileAt + adds r0, r4, 0x2 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1F + bls _08089C92 + ldr r1, [sp] + lsls r0, r1, 24 + lsrs r1, r0, 24 + cmp r1, 0x1F + bls _08089C74 + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end DrawWholeMapViewInternal + + thumb_func_start RedrawMapSlicesForCameraUpdate +@ void RedrawMapSlicesForCameraUpdate(struct struc_28 *, u8 deltaX, u8 deltaY) +RedrawMapSlicesForCameraUpdate: @ 8089CE4 + push {r4-r7,lr} + adds r5, r0, 0 + adds r6, r1, 0 + adds r7, r2, 0 + ldr r0, =0x02037318 + ldr r4, [r0] + cmp r6, 0 + ble _08089CFC + adds r0, r5, 0 + adds r1, r4, 0 + bl RedrawMapSliceWest +_08089CFC: + cmp r6, 0 + bge _08089D08 + adds r0, r5, 0 + adds r1, r4, 0 + bl RedrawMapSliceEast +_08089D08: + cmp r7, 0 + ble _08089D14 + adds r0, r5, 0 + adds r1, r4, 0 + bl RedrawMapSliceNorth +_08089D14: + cmp r7, 0 + bge _08089D20 + adds r0, r5, 0 + adds r1, r4, 0 + bl RedrawMapSliceSouth +_08089D20: + movs r0, 0x1 + strb r0, [r5, 0x4] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end RedrawMapSlicesForCameraUpdate + + thumb_func_start RedrawMapSliceNorth +@ void RedrawMapSliceNorth(struct struc_28 *, struct mapdata_header *mapGrid) +RedrawMapSliceNorth: @ 8089D30 + push {r4-r7,lr} + adds r5, r0, 0 + adds r7, r1, 0 + ldrb r0, [r5, 0x3] + adds r0, 0x1C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1F + bls _08089D48 + subs r0, 0x20 + lsls r0, 24 + lsrs r0, 24 +_08089D48: + lsls r6, r0, 5 + movs r4, 0 +_08089D4C: + ldrb r0, [r5, 0x2] + adds r0, r4, r0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1F + bls _08089D5E + subs r0, 0x20 + lsls r0, 24 + lsrs r0, 24 +_08089D5E: + adds r1, r6, r0 + lsls r1, 16 + lsrs r1, 16 + ldr r0, =0x03005d8c + ldr r3, [r0] + movs r0, 0 + ldrsh r2, [r3, r0] + lsrs r0, r4, 1 + adds r2, r0 + movs r0, 0x2 + ldrsh r3, [r3, r0] + adds r3, 0xE + adds r0, r7, 0 + bl DrawMetatileAt + adds r0, r4, 0x2 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1F + bls _08089D4C + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end RedrawMapSliceNorth + + thumb_func_start RedrawMapSliceSouth +@ void RedrawMapSliceSouth(struct struc_28 *, struct mapdata_header *mapGrid) +RedrawMapSliceSouth: @ 8089D90 + push {r4-r7,lr} + adds r5, r0, 0 + adds r7, r1, 0 + ldrb r0, [r5, 0x3] + lsls r6, r0, 5 + movs r4, 0 +_08089D9C: + ldrb r0, [r5, 0x2] + adds r0, r4, r0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1F + bls _08089DAE + subs r0, 0x20 + lsls r0, 24 + lsrs r0, 24 +_08089DAE: + adds r1, r6, r0 + ldr r0, =0x03005d8c + ldr r3, [r0] + movs r0, 0 + ldrsh r2, [r3, r0] + lsrs r0, r4, 1 + adds r2, r0 + movs r0, 0x2 + ldrsh r3, [r3, r0] + adds r0, r7, 0 + bl DrawMetatileAt + adds r0, r4, 0x2 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1F + bls _08089D9C + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end RedrawMapSliceSouth + + thumb_func_start RedrawMapSliceEast +@ void RedrawMapSliceEast(struct struc_28 *, struct mapdata_header *mapGrid) +RedrawMapSliceEast: @ 8089DDC + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + mov r8, r1 + ldrb r6, [r5, 0x2] + movs r4, 0 +_08089DEA: + ldrb r0, [r5, 0x3] + adds r0, r4, r0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1F + bls _08089DFC + subs r0, 0x20 + lsls r0, 24 + lsrs r0, 24 +_08089DFC: + lsls r1, r0, 5 + adds r1, r6 + lsls r1, 16 + lsrs r1, 16 + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r3, 0 + ldrsh r2, [r0, r3] + movs r7, 0x2 + ldrsh r3, [r0, r7] + lsrs r0, r4, 1 + adds r3, r0 + mov r0, r8 + bl DrawMetatileAt + adds r0, r4, 0x2 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1F + bls _08089DEA + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end RedrawMapSliceEast + + thumb_func_start RedrawMapSliceWest +@ void RedrawMapSliceWest(struct struc_28 *, struct mapdata_header *mapGrid) +RedrawMapSliceWest: @ 8089E34 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + mov r8, r1 + ldrb r0, [r6, 0x2] + adds r0, 0x1C + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1F + bls _08089E52 + adds r0, r5, 0 + subs r0, 0x20 + lsls r0, 24 + lsrs r5, r0, 24 +_08089E52: + movs r4, 0 +_08089E54: + ldrb r0, [r6, 0x3] + adds r0, r4, r0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1F + bls _08089E66 + subs r0, 0x20 + lsls r0, 24 + lsrs r0, 24 +_08089E66: + lsls r1, r0, 5 + adds r1, r5 + lsls r1, 16 + lsrs r1, 16 + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r3, 0 + ldrsh r2, [r0, r3] + adds r2, 0xE + movs r7, 0x2 + ldrsh r3, [r0, r7] + lsrs r0, r4, 1 + adds r3, r0 + mov r0, r8 + bl DrawMetatileAt + adds r0, r4, 0x2 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1F + bls _08089E54 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end RedrawMapSliceWest + + thumb_func_start CurrentMapDrawMetatileAt +@ void CurrentMapDrawMetatileAt(u32 x, u32 y) +CurrentMapDrawMetatileAt: @ 8089EA0 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r6, =0x03000e20 + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl MapPosToBgTilemapOffset + adds r1, r0, 0 + cmp r1, 0 + blt _08089ECC + ldr r0, =0x02037318 + ldr r0, [r0] + lsls r1, 16 + lsrs r1, 16 + adds r2, r4, 0 + adds r3, r5, 0 + bl DrawMetatileAt + movs r0, 0x1 + strb r0, [r6, 0x4] +_08089ECC: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end CurrentMapDrawMetatileAt + + thumb_func_start DrawDoorMetatileAt +@ void DrawDoorMetatileAt(u32 x, u32 y, u16 *metatile) +DrawDoorMetatileAt: @ 8089EDC + push {r4-r6,lr} + adds r3, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + ldr r6, =0x03000e20 + adds r0, r6, 0 + adds r1, r3, 0 + adds r2, r4, 0 + bl MapPosToBgTilemapOffset + cmp r0, 0 + blt _08089F04 + lsls r2, r0, 16 + lsrs r2, 16 + movs r0, 0x1 + adds r1, r5, 0 + bl DrawMetatile + movs r0, 0x1 + strb r0, [r6, 0x4] +_08089F04: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end DrawDoorMetatileAt + + thumb_func_start DrawMetatileAt +@ void DrawMetatileAt(struct mapdata_header *mapGrid, u16 offset, s32 x, s32 y) +DrawMetatileAt: @ 8089F10 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + adds r6, r2, 0 + adds r7, r3, 0 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + adds r0, r6, 0 + adds r1, r7, 0 + bl MapGridGetMetatileIdAt + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x80 + lsls r0, 3 + cmp r4, r0 + bls _08089F38 + movs r4, 0 +_08089F38: + ldr r0, =0x000001ff + cmp r4, r0 + bhi _08089F48 + ldr r0, [r5, 0x10] + ldr r5, [r0, 0xC] + b _08089F54 + .pool +_08089F48: + ldr r0, [r5, 0x14] + ldr r5, [r0, 0xC] + ldr r1, =0xfffffe00 + adds r0, r4, r1 + lsls r0, 16 + lsrs r4, r0, 16 +_08089F54: + adds r0, r6, 0 + adds r1, r7, 0 + bl MapGridGetMetatileLayerTypeAt + lsls r0, 24 + lsrs r0, 24 + lsls r1, r4, 4 + adds r1, r5, r1 + mov r2, r8 + bl DrawMetatile + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end DrawMetatileAt + + thumb_func_start DrawMetatile +@ void DrawMetatile(u32 layerType, u16 *metatile, u16 offset) +DrawMetatile: @ 8089F78 + push {r4,lr} + adds r4, r1, 0 + lsls r2, 16 + lsrs r2, 16 + cmp r0, 0x1 + beq _08089FD0 + cmp r0, 0x1 + bgt _08089F8E + cmp r0, 0 + beq _0808A030 + b _0808A082 +_08089F8E: + cmp r0, 0x2 + bne _0808A082 + ldr r0, =0x03005da4 + ldr r0, [r0] + lsls r3, r2, 1 + adds r0, r3, r0 + ldrh r1, [r4] + strh r1, [r0] + ldrh r1, [r4, 0x2] + strh r1, [r0, 0x2] + adds r2, r0, 0 + adds r2, 0x40 + ldrh r1, [r4, 0x4] + strh r1, [r2] + adds r0, 0x42 + ldrh r1, [r4, 0x6] + strh r1, [r0] + ldr r0, =0x03005d9c + ldr r0, [r0] + adds r0, r3, r0 + movs r2, 0 + strh r2, [r0] + strh r2, [r0, 0x2] + adds r1, r0, 0 + adds r1, 0x40 + strh r2, [r1] + adds r0, 0x42 + strh r2, [r0] + b _0808A066 + .pool +_08089FD0: + ldr r0, =0x03005da4 + ldr r0, [r0] + lsls r3, r2, 1 + adds r0, r3, r0 + ldrh r1, [r4] + strh r1, [r0] + ldrh r1, [r4, 0x2] + strh r1, [r0, 0x2] + adds r2, r0, 0 + adds r2, 0x40 + ldrh r1, [r4, 0x4] + strh r1, [r2] + adds r0, 0x42 + ldrh r1, [r4, 0x6] + strh r1, [r0] + ldr r0, =0x03005d9c + ldr r0, [r0] + adds r0, r3, r0 + ldrh r1, [r4, 0x8] + strh r1, [r0] + ldrh r1, [r4, 0xA] + strh r1, [r0, 0x2] + adds r2, r0, 0 + adds r2, 0x40 + ldrh r1, [r4, 0xC] + strh r1, [r2] + adds r0, 0x42 + ldrh r1, [r4, 0xE] + strh r1, [r0] + ldr r0, =0x03005da0 + ldr r0, [r0] + adds r3, r0 + movs r1, 0 + strh r1, [r3] + strh r1, [r3, 0x2] + adds r0, r3, 0 + adds r0, 0x40 + strh r1, [r0] + adds r3, 0x42 + strh r1, [r3] + b _0808A082 + .pool +_0808A030: + ldr r0, =0x03005da4 + ldr r0, [r0] + lsls r3, r2, 1 + adds r0, r3, r0 + ldr r1, =0x00003014 + adds r2, r1, 0 + strh r2, [r0] + strh r2, [r0, 0x2] + adds r1, r0, 0 + adds r1, 0x40 + strh r2, [r1] + adds r0, 0x42 + strh r2, [r0] + ldr r0, =0x03005d9c + ldr r0, [r0] + adds r0, r3, r0 + ldrh r1, [r4] + strh r1, [r0] + ldrh r1, [r4, 0x2] + strh r1, [r0, 0x2] + adds r2, r0, 0 + adds r2, 0x40 + ldrh r1, [r4, 0x4] + strh r1, [r2] + adds r0, 0x42 + ldrh r1, [r4, 0x6] + strh r1, [r0] +_0808A066: + ldr r0, =0x03005da0 + ldr r0, [r0] + adds r3, r0 + ldrh r0, [r4, 0x8] + strh r0, [r3] + ldrh r0, [r4, 0xA] + strh r0, [r3, 0x2] + adds r1, r3, 0 + adds r1, 0x40 + ldrh r0, [r4, 0xC] + strh r0, [r1] + adds r3, 0x42 + ldrh r0, [r4, 0xE] + strh r0, [r3] +_0808A082: + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x3 + bl schedule_bg_copy_tilemap_to_vram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end DrawMetatile + + thumb_func_start MapPosToBgTilemapOffset +@ u32 MapPosToBgTilemapOffset(struct struc_28 *, u32 x, u32 y) +MapPosToBgTilemapOffset: @ 808A0AC + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, =0x03005d8c + ldr r3, [r0] + movs r5, 0 + ldrsh r0, [r3, r5] + subs r1, r0 + lsls r1, 1 + cmp r1, 0x1F + bhi _0808A0D6 + ldrb r0, [r4, 0x2] + adds r1, r0 + cmp r1, 0x1F + ble _0808A0CA + subs r1, 0x20 +_0808A0CA: + movs r5, 0x2 + ldrsh r0, [r3, r5] + subs r0, r2, r0 + lsls r2, r0, 1 + cmp r2, 0x1F + bls _0808A0E0 +_0808A0D6: + movs r0, 0x1 + negs r0, r0 + b _0808A0EE + .pool +_0808A0E0: + ldrb r0, [r4, 0x3] + adds r2, r0 + cmp r2, 0x1F + ble _0808A0EA + subs r2, 0x20 +_0808A0EA: + lsls r0, r2, 5 + adds r0, r1 +_0808A0EE: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end MapPosToBgTilemapOffset + + thumb_func_start CameraUpdateCallback +@ void CameraUpdateCallback(struct CameraUpdateInfo *info) +CameraUpdateCallback: @ 808A0F4 + push {lr} + adds r3, r0, 0 + ldr r2, [r3, 0x4] + cmp r2, 0 + beq _0808A114 + ldr r1, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + movs r2, 0x32 + ldrsh r1, [r0, r2] + str r1, [r3, 0x8] + movs r1, 0x34 + ldrsh r0, [r0, r1] + str r0, [r3, 0xC] +_0808A114: + pop {r0} + bx r0 + .pool + thumb_func_end CameraUpdateCallback + + thumb_func_start ResetCameraUpdateInfo +@ void ResetCameraUpdateInfo() +ResetCameraUpdateInfo: @ 808A11C + ldr r1, =0x03005dd0 + movs r0, 0 + str r0, [r1, 0x8] + str r0, [r1, 0xC] + str r0, [r1, 0x10] + str r0, [r1, 0x14] + str r0, [r1, 0x4] + str r0, [r1] + bx lr + .pool + thumb_func_end ResetCameraUpdateInfo + + thumb_func_start InitCameraUpdateCallback +@ u8 InitCameraUpdateCallback(u8 followedObjectId) +InitCameraUpdateCallback: @ 808A134 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =0x03005dd0 + ldr r1, [r4, 0x4] + cmp r1, 0 + beq _0808A150 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles +_0808A150: + adds r0, r5, 0 + bl AddCameraObject + lsls r0, 24 + lsrs r0, 24 + str r0, [r4, 0x4] + ldr r0, =CameraUpdateCallback + str r0, [r4] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end InitCameraUpdateCallback + + thumb_func_start CameraUpdate +@ void CameraUpdate() +CameraUpdate: @ 808A174 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r6, =0x03005dd0 + ldr r1, [r6] + cmp r1, 0 + beq _0808A188 + adds r0, r6, 0 + bl _call_via_r1 +_0808A188: + ldr r7, [r6, 0x8] + ldr r0, [r6, 0xC] + mov r8, r0 + movs r4, 0 + movs r5, 0 + ldr r1, [r6, 0x10] + ldr r0, [r6, 0x14] + cmp r1, 0 + bne _0808A1A6 + cmp r7, 0 + beq _0808A1A6 + subs r4, 0x1 + cmp r7, 0 + ble _0808A1A6 + movs r4, 0x1 +_0808A1A6: + cmp r0, 0 + bne _0808A1BA + mov r2, r8 + cmp r2, 0 + beq _0808A1BA + movs r5, 0x1 + negs r5, r5 + cmp r2, 0 + ble _0808A1BA + movs r5, 0x1 +_0808A1BA: + cmp r1, 0 + beq _0808A1CC + cmn r1, r7 + bne _0808A1CC + movs r4, 0x1 + negs r4, r4 + cmp r7, 0 + ble _0808A1CC + movs r4, 0x1 +_0808A1CC: + cmp r0, 0 + beq _0808A1E0 + mov r3, r8 + cmn r0, r3 + bne _0808A1E0 + movs r4, 0x1 + negs r4, r4 + cmp r3, 0 + ble _0808A1E0 + movs r4, 0x1 +_0808A1E0: + ldr r2, =0x03005dd0 + ldr r0, [r2, 0x10] + adds r1, r0, r7 + str r1, [r2, 0x10] + adds r0, r1, 0 + cmp r1, 0 + bge _0808A1F0 + adds r0, 0xF +_0808A1F0: + asrs r0, 4 + lsls r0, 4 + subs r0, r1, r0 + str r0, [r2, 0x10] + ldr r0, [r2, 0x14] + mov r3, r8 + adds r1, r0, r3 + str r1, [r2, 0x14] + adds r0, r1, 0 + cmp r1, 0 + bge _0808A208 + adds r0, 0xF +_0808A208: + asrs r0, 4 + lsls r0, 4 + subs r0, r1, r0 + str r0, [r2, 0x14] + cmp r4, 0 + bne _0808A218 + cmp r5, 0 + beq _0808A24E +_0808A218: + adds r0, r4, 0 + adds r1, r5, 0 + bl CameraMove + adds r0, r4, 0 + adds r1, r5, 0 + bl UpdateFieldObjectsForCameraUpdate + adds r0, r4, 0 + adds r1, r5, 0 + bl RotatingGatePuzzleCameraUpdate + bl ResetBerryTreeSparkleFlags + ldr r6, =0x03000e20 + lsls r4, 1 + lsls r5, 1 + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl tilemap_move_something + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl RedrawMapSlicesForCameraUpdate +_0808A24E: + ldr r0, =0x03000e20 + adds r1, r7, 0 + mov r2, r8 + bl coords8_add + ldr r1, =0x03005dec + ldrh r0, [r1] + subs r0, r7 + strh r0, [r1] + ldr r1, =0x03005de8 + ldrh r0, [r1] + mov r2, r8 + subs r0, r2 + strh r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end CameraUpdate + + thumb_func_start sub_808A284 +sub_808A284: @ 808A284 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl CameraMove + lsls r0, r4, 16 + asrs r0, 16 + lsls r1, r5, 16 + asrs r1, 16 + bl UpdateFieldObjectsForCameraUpdate + bl DrawWholeMapView + ldr r1, =0x03005dec + lsls r4, 4 + ldrh r0, [r1] + subs r0, r4 + strh r0, [r1] + ldr r1, =0x03005de8 + lsls r5, 4 + ldrh r0, [r1] + subs r0, r5 + strh r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808A284 + + thumb_func_start SetCameraPanningCallback +@ void SetCameraPanningCallback(void ( *callback)()) +SetCameraPanningCallback: @ 808A2C0 + ldr r1, =0x03000e30 + str r0, [r1] + bx lr + .pool + thumb_func_end SetCameraPanningCallback + + thumb_func_start SetCameraPanning +@ void SetCameraPanning(s16 x, s16 y) +SetCameraPanning: @ 808A2CC + ldr r2, =0x03000e28 + strh r0, [r2] + ldr r0, =0x03000e2a + lsls r1, 16 + asrs r1, 16 + adds r1, 0x20 + strh r1, [r0] + bx lr + .pool + thumb_func_end SetCameraPanning + + thumb_func_start InstallCameraPanAheadCallback +@ void InstallCameraPanAheadCallback() +InstallCameraPanAheadCallback: @ 808A2E4 + ldr r1, =0x03000e30 + ldr r0, =CameraPanningCB_PanAhead + str r0, [r1] + ldr r1, =0x03000e2c + movs r0, 0 + strb r0, [r1] + ldr r1, =0x03000e28 + movs r0, 0 + strh r0, [r1] + ldr r1, =0x03000e2a + movs r0, 0x20 + strh r0, [r1] + bx lr + .pool + thumb_func_end InstallCameraPanAheadCallback + + thumb_func_start UpdateCameraPanning +@ void UpdateCameraPanning() +UpdateCameraPanning: @ 808A314 + push {lr} + ldr r0, =0x03000e30 + ldr r0, [r0] + cmp r0, 0 + beq _0808A322 + bl _call_via_r0 +_0808A322: + ldr r2, =0x02021bbc + ldr r0, =0x03005dec + ldr r1, =0x03000e28 + ldrh r0, [r0] + ldrh r1, [r1] + subs r0, r1 + strh r0, [r2] + ldr r2, =0x02021bbe + ldr r0, =0x03005de8 + ldr r1, =0x03000e2a + ldrh r0, [r0] + ldrh r1, [r1] + subs r0, r1 + subs r0, 0x8 + strh r0, [r2] + pop {r0} + bx r0 + .pool + thumb_func_end UpdateCameraPanning + + thumb_func_start CameraPanningCB_PanAhead +@ void CameraPanningCB_PanAhead() +CameraPanningCB_PanAhead: @ 808A360 + push {lr} + ldr r0, =0x02037348 + ldrb r0, [r0] + cmp r0, 0 + bne _0808A374 + bl InstallCameraPanAheadCallback + b _0808A3FC + .pool +_0808A374: + ldr r0, =0x02037590 + ldrb r0, [r0, 0x3] + cmp r0, 0x1 + bne _0808A394 + ldr r0, =0x03000e2c + ldrb r1, [r0] + movs r2, 0x1 + eors r1, r2 + strb r1, [r0] + cmp r1, 0 + beq _0808A3FC + b _0808A39A + .pool +_0808A394: + ldr r1, =0x03000e2c + movs r0, 0 + strb r0, [r1] +_0808A39A: + bl player_get_direction_upper_nybble + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _0808A3C4 + ldr r2, =0x03000e2a + ldrh r3, [r2] + movs r0, 0 + ldrsh r1, [r2, r0] + movs r0, 0x8 + negs r0, r0 + cmp r1, r0 + ble _0808A3FC + subs r0, r3, 0x2 + b _0808A3FA + .pool +_0808A3C4: + cmp r0, 0x1 + bne _0808A3E0 + ldr r1, =0x03000e2a + ldrh r2, [r1] + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0x47 + bgt _0808A3FC + adds r0, r2, 0x2 + strh r0, [r1] + b _0808A3FC + .pool +_0808A3E0: + ldr r2, =0x03000e2a + ldrh r0, [r2] + movs r3, 0 + ldrsh r1, [r2, r3] + cmp r1, 0x1F + bgt _0808A3F4 + adds r0, 0x2 + b _0808A3FA + .pool +_0808A3F4: + cmp r1, 0x20 + ble _0808A3FC + subs r0, 0x2 +_0808A3FA: + strh r0, [r2] +_0808A3FC: + pop {r0} + bx r0 + thumb_func_end CameraPanningCB_PanAhead + + thumb_func_start sub_808A400 +sub_808A400: @ 808A400 + push {lr} + adds r2, r0, 0 + ldrb r0, [r2, 0x3] + cmp r0, 0x2 + bne _0808A420 + ldrh r1, [r1, 0x2] + ldr r0, [r2, 0x4] + adds r0, r1 + ldr r1, =0x06007e00 + movs r2, 0x80 + bl CpuFastSet + b _0808A42E + .pool +_0808A420: + ldrh r1, [r1, 0x2] + ldr r0, [r2, 0x4] + adds r0, r1 + ldr r1, =0x06007f00 + movs r2, 0x40 + bl CpuFastSet +_0808A42E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_808A400 + + thumb_func_start door_build_blockdef +door_build_blockdef: @ 808A438 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + movs r4, 0 + adds r1, r6, 0 +_0808A444: + ldrb r0, [r2] + lsls r0, 28 + lsrs r3, r0, 16 + adds r2, 0x1 + adds r0, r5, r4 + orrs r3, r0 + strh r3, [r1] + adds r1, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + ble _0808A444 + cmp r4, 0x7 + bgt _0808A472 + lsls r0, r4, 1 + adds r1, r0, r6 +_0808A462: + ldrb r0, [r2] + lsls r3, r0, 12 + adds r2, 0x1 + strh r3, [r1] + adds r1, 0x2 + adds r4, 0x1 + cmp r4, 0x7 + ble _0808A462 +_0808A472: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end door_build_blockdef + + thumb_func_start door_patch_tilemap +door_patch_tilemap: @ 808A478 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x30 + adds r7, r1, 0 + mov r9, r2 + adds r5, r3, 0 + ldrb r0, [r0, 0x3] + cmp r0, 0x2 + bne _0808A4F4 + add r4, sp, 0x10 + movs r1, 0xFC + lsls r1, 2 + adds r0, r4, 0 + adds r2, r5, 0 + bl door_build_blockdef + mov r6, r9 + subs r6, 0x1 + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r4, 0 + bl DrawDoorMetatileAt + movs r1, 0xFD + lsls r1, 2 + adds r0, r5, 0x4 + mov r8, r0 + adds r0, r4, 0 + mov r2, r8 + bl door_build_blockdef + adds r0, r7, 0 + mov r1, r9 + adds r2, r4, 0 + bl DrawDoorMetatileAt + movs r1, 0xFE + lsls r1, 2 + adds r0, r4, 0 + adds r2, r5, 0 + bl door_build_blockdef + adds r5, r7, 0x1 + adds r0, r5, 0 + adds r1, r6, 0 + adds r2, r4, 0 + bl DrawDoorMetatileAt + movs r1, 0xFF + lsls r1, 2 + adds r0, r4, 0 + mov r2, r8 + bl door_build_blockdef + adds r0, r5, 0 + mov r1, r9 + adds r2, r4, 0 + bl DrawDoorMetatileAt + b _0808A522 +_0808A4F4: + movs r1, 0xFE + lsls r1, 2 + mov r0, sp + adds r2, r5, 0 + bl door_build_blockdef + mov r1, r9 + subs r1, 0x1 + adds r0, r7, 0 + mov r2, sp + bl DrawDoorMetatileAt + movs r1, 0xFF + lsls r1, 2 + adds r2, r5, 0x4 + mov r0, sp + bl door_build_blockdef + adds r0, r7, 0 + mov r1, r9 + mov r2, sp + bl DrawDoorMetatileAt +_0808A522: + add sp, 0x30 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end door_patch_tilemap + + thumb_func_start sub_808A530 +sub_808A530: @ 808A530 + push {r4-r7,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + subs r7, r6, 0x1 + adds r0, r5, 0 + adds r1, r7, 0 + bl CurrentMapDrawMetatileAt + adds r0, r5, 0 + adds r1, r6, 0 + bl CurrentMapDrawMetatileAt + ldrb r0, [r4, 0x3] + cmp r0, 0x2 + bne _0808A562 + adds r4, r5, 0x1 + adds r0, r4, 0 + adds r1, r7, 0 + bl CurrentMapDrawMetatileAt + adds r0, r4, 0 + adds r1, r6, 0 + bl CurrentMapDrawMetatileAt +_0808A562: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_808A530 + + thumb_func_start sub_808A568 +sub_808A568: @ 808A568 + push {r4-r7,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + adds r7, r3, 0 + ldrh r1, [r5, 0x2] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _0808A5B0 + adds r0, r4, 0 + adds r1, r6, 0 + adds r2, r7, 0 + bl sub_808A530 + bl sub_808A964 + lsls r0, 24 + cmp r0, 0 + beq _0808A5E2 + ldr r0, =0x020375e0 + ldrh r1, [r0] + adds r1, 0x7 + ldr r0, =0x020375e2 + ldrh r2, [r0] + adds r2, 0x7 + adds r0, r4, 0 + bl sub_808A530 + b _0808A5E2 + .pool +_0808A5B0: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_808A400 + ldr r3, [r4, 0x8] + adds r0, r4, 0 + adds r1, r6, 0 + adds r2, r7, 0 + bl door_patch_tilemap + bl sub_808A964 + lsls r0, 24 + cmp r0, 0 + beq _0808A5E2 + ldr r0, =0x020375e0 + ldrh r1, [r0] + adds r1, 0x7 + ldr r0, =0x020375e2 + ldrh r2, [r0] + adds r2, 0x7 + ldr r3, [r4, 0x8] + adds r0, r4, 0 + bl door_patch_tilemap +_0808A5E2: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808A568 + + thumb_func_start sub_808A5F0 +sub_808A5F0: @ 808A5F0 + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r1, 0 + adds r4, r2, 0 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0808A616 + movs r2, 0x8 + ldrsh r1, [r4, r2] + lsls r1, 2 + adds r1, r5, r1 + movs r0, 0xC + ldrsh r2, [r4, r0] + movs r0, 0xE + ldrsh r3, [r4, r0] + adds r0, r6, 0 + bl sub_808A568 +_0808A616: + movs r2, 0xA + ldrsh r1, [r4, r2] + movs r2, 0x8 + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r5 + ldrb r0, [r0] + cmp r1, r0 + bne _0808A644 + movs r0, 0 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r1, 0x8 + ldrsh r0, [r4, r1] + lsls r0, 2 + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0 + bne _0808A64A + movs r0, 0 + b _0808A64C +_0808A644: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] +_0808A64A: + movs r0, 0x1 +_0808A64C: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_808A5F0 + + thumb_func_start task50_overworld_door +task50_overworld_door: @ 808A654 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r2, r4, 2 + adds r2, r4 + lsls r2, 3 + ldr r0, =0x03005e08 + adds r2, r0 + ldrh r1, [r2] + lsls r1, 16 + ldrh r0, [r2, 0x2] + orrs r1, r0 + ldrh r0, [r2, 0x4] + lsls r0, 16 + ldrh r3, [r2, 0x6] + orrs r0, r3 + bl sub_808A5F0 + cmp r0, 0 + bne _0808A682 + adds r0, r4, 0 + bl remove_task +_0808A682: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task50_overworld_door + + thumb_func_start door_frame_last +door_frame_last: @ 808A68C + push {lr} + adds r1, r0, 0 + b _0808A694 +_0808A692: + adds r1, 0x4 +_0808A694: + ldrb r0, [r1] + cmp r0, 0 + bne _0808A692 + subs r0, r1, 0x4 + pop {r1} + bx r1 + thumb_func_end door_frame_last + + thumb_func_start door_find +door_find: @ 808A6A0 + push {lr} + adds r2, r0, 0 + lsls r1, 16 + lsrs r1, 16 + b _0808A6B6 +_0808A6AA: + ldrh r0, [r2] + cmp r0, r1 + bne _0808A6B4 + adds r0, r2, 0 + b _0808A6BE +_0808A6B4: + adds r2, 0xC +_0808A6B6: + ldr r0, [r2, 0x4] + cmp r0, 0 + bne _0808A6AA + movs r0, 0 +_0808A6BE: + pop {r1} + bx r1 + thumb_func_end door_find + + thumb_func_start task_overworld_door_add_if_inactive +task_overworld_door_add_if_inactive: @ 808A6C4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + adds r5, r1, 0 + adds r7, r2, 0 + mov r8, r3 + ldr r4, =task50_overworld_door + adds r0, r4, 0 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0808A718 + adds r0, r4, 0 + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r2, =0x03005e08 + adds r1, r2 + strh r7, [r1, 0xC] + mov r2, r8 + strh r2, [r1, 0xE] + strh r5, [r1, 0x2] + lsrs r2, r5, 16 + strh r2, [r1] + strh r6, [r1, 0x6] + lsrs r2, r6, 16 + strh r2, [r1, 0x4] + lsls r0, 24 + asrs r0, 24 + b _0808A71C + .pool +_0808A718: + movs r0, 0x1 + negs r0, r0 +_0808A71C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end task_overworld_door_add_if_inactive + + thumb_func_start sub_808A728 +sub_808A728: @ 808A728 + push {lr} + bl sub_808A530 + pop {r0} + bx r0 + thumb_func_end sub_808A728 + + thumb_func_start sub_808A734 +sub_808A734: @ 808A734 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + adds r0, r5, 0 + adds r1, r6, 0 + bl MapGridGetMetatileIdAt + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl door_find + adds r4, r0, 0 + cmp r4, 0 + beq _0808A76A + ldr r1, =gUnknown_08496F8C + adds r0, r1, 0 + bl door_frame_last + adds r1, r0, 0 + adds r0, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_808A568 +_0808A76A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808A734 + + thumb_func_start task_overworld_door_add_for_opening_door_at +@ s32 task_overworld_door_add_for_opening_door_at(void *a1, s32 x, s32 y) +task_overworld_door_add_for_opening_door_at: @ 808A774 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + adds r0, r5, 0 + adds r1, r6, 0 + bl MapGridGetMetatileIdAt + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl door_find + adds r2, r0, 0 + adds r4, r2, 0 + cmp r2, 0 + bne _0808A79E + movs r0, 0x1 + negs r0, r0 + b _0808A7C0 +_0808A79E: + ldrb r0, [r2, 0x3] + cmp r0, 0x2 + beq _0808A7B0 + ldr r1, =gUnknown_08496F8C + adds r0, r2, 0 + b _0808A7B4 + .pool +_0808A7B0: + ldr r1, =gUnknown_08496FB4 + adds r0, r4, 0 +_0808A7B4: + adds r2, r5, 0 + adds r3, r6, 0 + bl task_overworld_door_add_if_inactive + lsls r0, 24 + asrs r0, 24 +_0808A7C0: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end task_overworld_door_add_for_opening_door_at + + thumb_func_start sub_808A7CC +sub_808A7CC: @ 808A7CC + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + adds r0, r5, 0 + adds r1, r6, 0 + bl MapGridGetMetatileIdAt + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl door_find + cmp r0, 0 + beq _0808A800 + ldr r1, =gUnknown_08496FA0 + adds r2, r5, 0 + adds r3, r6, 0 + bl task_overworld_door_add_if_inactive + lsls r0, 24 + asrs r0, 24 + b _0808A804 + .pool +_0808A800: + movs r0, 0x1 + negs r0, r0 +_0808A804: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_808A7CC + + thumb_func_start cur_mapdata_get_door_x2_at +cur_mapdata_get_door_x2_at: @ 808A80C + push {r4,lr} + adds r4, r0, 0 + adds r0, r1, 0 + adds r1, r2, 0 + bl MapGridGetMetatileIdAt + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl door_find + cmp r0, 0 + beq _0808A830 + ldrb r0, [r0, 0x2] + lsls r0, 24 + asrs r0, 24 + b _0808A834 +_0808A830: + movs r0, 0x1 + negs r0, r0 +_0808A834: + pop {r4} + pop {r1} + bx r1 + thumb_func_end cur_mapdata_get_door_x2_at + + thumb_func_start sub_808A83C +sub_808A83C: @ 808A83C + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + ldr r0, =gUnknown_08497174 + adds r1, r3, 0 + bl task_overworld_door_add_for_opening_door_at + pop {r0} + bx r0 + .pool + thumb_func_end sub_808A83C + + thumb_func_start sub_808A854 +sub_808A854: @ 808A854 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl sub_8088EFC + lsls r0, 24 + cmp r0, 0 + beq _0808A876 + ldr r0, =gUnknown_08497174 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_808A734 +_0808A876: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808A854 + + thumb_func_start sub_808A880 +sub_808A880: @ 808A880 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl sub_8088EFC + lsls r0, 24 + cmp r0, 0 + beq _0808A8A2 + ldr r0, =gUnknown_08497174 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_808A728 +_0808A8A2: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808A880 + + thumb_func_start sub_808A8AC +sub_808A8AC: @ 808A8AC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl sub_8088EFC + lsls r0, 24 + cmp r0, 0 + beq _0808A8D8 + ldr r0, =gUnknown_08497174 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_808A7CC + lsls r0, 24 + asrs r0, 24 + b _0808A8DC + .pool +_0808A8D8: + movs r0, 0x1 + negs r0, r0 +_0808A8DC: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808A8AC + + thumb_func_start task_overworld_door_add_if_role_69_for_opening_door_at +task_overworld_door_add_if_role_69_for_opening_door_at: @ 808A8E4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl sub_8088EFC + lsls r0, 24 + cmp r0, 0 + beq _0808A910 + ldr r0, =gUnknown_08497174 + adds r1, r4, 0 + adds r2, r5, 0 + bl task_overworld_door_add_for_opening_door_at + lsls r0, 24 + asrs r0, 24 + b _0808A914 + .pool +_0808A910: + movs r0, 0x1 + negs r0, r0 +_0808A914: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end task_overworld_door_add_if_role_69_for_opening_door_at + + thumb_func_start sub_808A91C +sub_808A91C: @ 808A91C + push {lr} + ldr r0, =task50_overworld_door + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_808A91C + + thumb_func_start cur_mapdata_get_door_sound_at +cur_mapdata_get_door_sound_at: @ 808A930 + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + ldr r0, =gUnknown_08497174 + adds r1, r3, 0 + bl cur_mapdata_get_door_x2_at + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + beq _0808A958 + cmp r0, 0x1 + bne _0808A954 + movs r0, 0x12 + b _0808A95E + .pool +_0808A954: + cmp r0, 0x2 + beq _0808A95C +_0808A958: + movs r0, 0x8 + b _0808A95E +_0808A95C: + movs r0, 0x2F +_0808A95E: + pop {r1} + bx r1 + thumb_func_end cur_mapdata_get_door_sound_at + + thumb_func_start sub_808A964 +sub_808A964: @ 808A964 + push {lr} + ldr r0, =0x00004002 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0808A990 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r1, [r0, 0x4] + ldr r0, =0x0000101a + cmp r1, r0 + bne _0808A990 + movs r0, 0x1 + b _0808A992 + .pool +_0808A990: + movs r0, 0 +_0808A992: + pop {r1} + bx r1 + thumb_func_end sub_808A964 + + thumb_func_start FieldObjectCB_NoMovement2 +@ void FieldObjectCB_NoMovement2(struct obj *object) +FieldObjectCB_NoMovement2: @ 808A998 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =FieldObjectCB2_NoMovement2 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_NoMovement2 + + thumb_func_start FieldObjectCB2_NoMovement2 +FieldObjectCB2_NoMovement2: @ 808A9BC + movs r0, 0 + bx lr + thumb_func_end FieldObjectCB2_NoMovement2 + + thumb_func_start player_step +@ void player_step(int dpad_direction, int buttons_new, int buttons_held) +player_step: @ 808A9C0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 16 + lsrs r7, r1, 16 + lsls r2, 16 + lsrs r6, r2, 16 + ldr r4, =0x02037590 + ldrb r1, [r4, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r5, r0, r1 + adds r0, r5, 0 + bl sub_808C280 + ldrb r0, [r4, 0x6] + cmp r0, 0 + bne _0808AA26 + adds r0, r7, 0 + adds r1, r6, 0 + bl sub_8119C3C + adds r0, r5, 0 + mov r1, r8 + bl TryInterruptFieldObjectSpecialAnim + lsls r0, 24 + cmp r0, 0 + bne _0808AA26 + adds r0, r5, 0 + bl npc_clear_strange_bits + bl DoPlayerAvatarTransition + bl TryDoMetatileBehaviorForcedMovment + lsls r0, 24 + cmp r0, 0 + bne _0808AA26 + mov r0, r8 + adds r1, r7, 0 + adds r2, r6, 0 + bl MovePlayerAvatarUsingKeypadInput + bl PlayerAllowForcedMovementIfMovingSameDirection +_0808AA26: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end player_step + + thumb_func_start TryInterruptFieldObjectSpecialAnim +@ bool8 TryInterruptFieldObjectSpecialAnim(struct npc_state *fieldObject, u8 direction) +TryInterruptFieldObjectSpecialAnim: @ 808AA38 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + adds r6, r5, 0 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + cmp r0, 0 + beq _0808AA92 + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + bne _0808AA92 + adds r0, r4, 0 + bl FieldObjectGetSpecialAnim + lsls r0, 24 + movs r1, 0xE7 + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x3 + bhi _0808AA70 + cmp r5, 0 + bne _0808AA74 +_0808AA70: + movs r0, 0x1 + b _0808AA94 +_0808AA74: + ldrb r0, [r4, 0x18] + lsrs r0, 4 + cmp r0, r5 + beq _0808AA84 +_0808AA7C: + adds r0, r4, 0 + bl FieldObjectClearAnim + b _0808AA92 +_0808AA84: + adds r0, r6, 0 + bl sub_808B028 + lsls r0, 24 + cmp r0, 0 + beq _0808AA7C + b _0808AA70 +_0808AA92: + movs r0, 0 +_0808AA94: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end TryInterruptFieldObjectSpecialAnim + + thumb_func_start npc_clear_strange_bits +@ void npc_clear_strange_bits(struct npc_state *fieldObject) +npc_clear_strange_bits: @ 808AA9C + ldrb r2, [r0, 0x1] + movs r1, 0x11 + negs r1, r1 + ands r1, r2 + movs r2, 0x5 + negs r2, r2 + ands r1, r2 + adds r2, 0x2 + ands r1, r2 + strb r1, [r0, 0x1] + ldr r2, =0x02037590 + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + bx lr + .pool + thumb_func_end npc_clear_strange_bits + + thumb_func_start MovePlayerAvatarUsingKeypadInput +@ void MovePlayerAvatarUsingKeypadInput(int dpad_direction, int buttons_new, int buttons_held) +MovePlayerAvatarUsingKeypadInput: @ 808AAC0 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 16 + lsrs r2, 16 + ldr r0, =0x02037590 + ldrb r1, [r0] + movs r0, 0x6 + ands r0, r1 + cmp r0, 0 + beq _0808AAE8 + adds r0, r3, 0 + adds r1, r4, 0 + bl MovePlayerOnBike + b _0808AAF0 + .pool +_0808AAE8: + adds r0, r3, 0 + adds r1, r2, 0 + bl MovePlayerNotOnBike +_0808AAF0: + pop {r4} + pop {r0} + bx r0 + thumb_func_end MovePlayerAvatarUsingKeypadInput + + thumb_func_start PlayerAllowForcedMovementIfMovingSameDirection +@ void PlayerAllowForcedMovementIfMovingSameDirection() +PlayerAllowForcedMovementIfMovingSameDirection: @ 808AAF8 + push {lr} + ldr r2, =0x02037590 + ldrb r0, [r2, 0x2] + cmp r0, 0x2 + bne _0808AB0A + ldrb r1, [r2] + movs r0, 0xDF + ands r0, r1 + strb r0, [r2] +_0808AB0A: + pop {r0} + bx r0 + .pool + thumb_func_end PlayerAllowForcedMovementIfMovingSameDirection + + thumb_func_start TryDoMetatileBehaviorForcedMovment +@ bool8 TryDoMetatileBehaviorForcedMovment() +TryDoMetatileBehaviorForcedMovment: @ 808AB14 + push {r4,lr} + ldr r4, =gUnknown_08497444 + bl GetForcedMovementByMetatileBehavior + lsls r0, 24 + lsrs r0, 22 + adds r0, r4 + ldr r0, [r0] + bl _call_via_r0 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end TryDoMetatileBehaviorForcedMovment + + thumb_func_start GetForcedMovementByMetatileBehavior +@ u8 GetForcedMovementByMetatileBehavior() +GetForcedMovementByMetatileBehavior: @ 808AB38 + push {r4-r6,lr} + ldr r3, =0x02037590 + ldrb r1, [r3] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _0808AB8A + ldr r2, =0x02037350 + ldrb r1, [r3, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r5, [r0, 0x1E] + movs r4, 0 + ldr r6, =gUnknown_084973FC +_0808AB58: + lsls r0, r4, 2 + adds r0, r6 + ldr r1, [r0] + adds r0, r5, 0 + bl _call_via_r1 + lsls r0, 24 + cmp r0, 0 + beq _0808AB80 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r0, 24 + b _0808AB8C + .pool +_0808AB80: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x11 + bls _0808AB58 +_0808AB8A: + movs r0, 0 +_0808AB8C: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end GetForcedMovementByMetatileBehavior + + thumb_func_start ForcedMovement_None +ForcedMovement_None: @ 808AB94 + push {r4,lr} + ldr r4, =0x02037590 + ldrb r1, [r4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0808ABCE + ldrb r1, [r4, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + ldrb r2, [r0, 0x1] + movs r1, 0x3 + negs r1, r1 + ands r1, r2 + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0, 0x1] + ldrb r1, [r0, 0x18] + lsls r1, 28 + lsrs r1, 28 + bl FieldObjectSetDirection + ldrb r1, [r4] + movs r0, 0xBF + ands r0, r1 + strb r0, [r4] +_0808ABCE: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end ForcedMovement_None + + thumb_func_start DoForcedMovement +DoForcedMovement: @ 808ABE0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r9, r1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r6, =0x02037590 + adds r0, r5, 0 + bl CheckForPlayerAvatarCollision + lsls r0, 24 + lsrs r4, r0, 24 + adds r7, r4, 0 + ldrb r0, [r6] + movs r1, 0x40 + mov r10, r1 + movs r1, 0 + mov r8, r1 + mov r1, r10 + orrs r0, r1 + strb r0, [r6] + cmp r4, 0 + beq _0808AC3C + bl ForcedMovement_None + cmp r4, 0x4 + bhi _0808AC24 + movs r0, 0 + b _0808AC48 + .pool +_0808AC24: + cmp r7, 0x6 + bne _0808AC2E + adds r0, r5, 0 + bl PlayerJumpLedge +_0808AC2E: + ldrb r0, [r6] + mov r1, r10 + orrs r0, r1 + strb r0, [r6] + movs r0, 0x2 + strb r0, [r6, 0x2] + b _0808AC46 +_0808AC3C: + movs r0, 0x2 + strb r0, [r6, 0x2] + adds r0, r5, 0 + bl _call_via_r9 +_0808AC46: + movs r0, 0x1 +_0808AC48: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end DoForcedMovement + + thumb_func_start DoForcedMovementInCurrentDirection +DoForcedMovementInCurrentDirection: @ 808AC58 + push {lr} + adds r1, r0, 0 + ldr r0, =0x02037590 + ldrb r2, [r0, 0x5] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldrb r2, [r0, 0x1] + movs r3, 0x4 + orrs r2, r3 + strb r2, [r0, 0x1] + ldrb r0, [r0, 0x18] + lsrs r0, 4 + bl DoForcedMovement + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end DoForcedMovementInCurrentDirection + + thumb_func_start ForcedMovement_Slip +ForcedMovement_Slip: @ 808AC8C + push {lr} + ldr r0, =PlayerGoSpeed1 + bl DoForcedMovementInCurrentDirection + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end ForcedMovement_Slip + + thumb_func_start ForcedMovement_WalkSouth +ForcedMovement_WalkSouth: @ 808ACA0 + push {lr} + ldr r1, =PlayerGoSpeed0 + movs r0, 0x1 + bl DoForcedMovement + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end ForcedMovement_WalkSouth + + thumb_func_start ForcedMovement_WalkNorth +ForcedMovement_WalkNorth: @ 808ACB8 + push {lr} + ldr r1, =PlayerGoSpeed0 + movs r0, 0x2 + bl DoForcedMovement + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end ForcedMovement_WalkNorth + + thumb_func_start ForcedMovement_WalkWest +ForcedMovement_WalkWest: @ 808ACD0 + push {lr} + ldr r1, =PlayerGoSpeed0 + movs r0, 0x3 + bl DoForcedMovement + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end ForcedMovement_WalkWest + + thumb_func_start ForcedMovement_WalkEast +ForcedMovement_WalkEast: @ 808ACE8 + push {lr} + ldr r1, =PlayerGoSpeed0 + movs r0, 0x4 + bl DoForcedMovement + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end ForcedMovement_WalkEast + + thumb_func_start ForcedMovement_PushedSouthByCurrent +ForcedMovement_PushedSouthByCurrent: @ 808AD00 + push {lr} + ldr r1, =PlayerGoSpeed2 + movs r0, 0x1 + bl DoForcedMovement + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end ForcedMovement_PushedSouthByCurrent + + thumb_func_start ForcedMovement_PushedNorthByCurrent +ForcedMovement_PushedNorthByCurrent: @ 808AD18 + push {lr} + ldr r1, =PlayerGoSpeed2 + movs r0, 0x2 + bl DoForcedMovement + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end ForcedMovement_PushedNorthByCurrent + + thumb_func_start ForcedMovement_PushedWestByCurrent +ForcedMovement_PushedWestByCurrent: @ 808AD30 + push {lr} + ldr r1, =PlayerGoSpeed2 + movs r0, 0x3 + bl DoForcedMovement + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end ForcedMovement_PushedWestByCurrent + + thumb_func_start ForcedMovement_PushedEastByCurrent +ForcedMovement_PushedEastByCurrent: @ 808AD48 + push {lr} + ldr r1, =PlayerGoSpeed2 + movs r0, 0x4 + bl DoForcedMovement + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end ForcedMovement_PushedEastByCurrent + + thumb_func_start ForcedMovement_Slide +ForcedMovement_Slide: @ 808AD60 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02037590 + ldrb r3, [r2, 0x5] + lsls r2, r3, 3 + adds r2, r3 + lsls r2, 2 + ldr r3, =0x02037350 + adds r2, r3 + ldrb r3, [r2, 0x1] + movs r4, 0x4 + orrs r3, r4 + movs r4, 0x2 + orrs r3, r4 + strb r3, [r2, 0x1] + bl DoForcedMovement + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end ForcedMovement_Slide + + thumb_func_start ForcedMovement_SlideSouth +ForcedMovement_SlideSouth: @ 808AD98 + push {lr} + ldr r1, =PlayerGoSpeed1 + movs r0, 0x1 + bl ForcedMovement_Slide + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end ForcedMovement_SlideSouth + + thumb_func_start ForcedMovement_SlideNorth +ForcedMovement_SlideNorth: @ 808ADB0 + push {lr} + ldr r1, =PlayerGoSpeed1 + movs r0, 0x2 + bl ForcedMovement_Slide + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end ForcedMovement_SlideNorth + + thumb_func_start ForcedMovement_SlideWest +ForcedMovement_SlideWest: @ 808ADC8 + push {lr} + ldr r1, =PlayerGoSpeed1 + movs r0, 0x3 + bl ForcedMovement_Slide + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end ForcedMovement_SlideWest + + thumb_func_start ForcedMovement_SlideEast +ForcedMovement_SlideEast: @ 808ADE0 + push {lr} + ldr r1, =PlayerGoSpeed1 + movs r0, 0x4 + bl ForcedMovement_Slide + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end ForcedMovement_SlideEast + + thumb_func_start ForcedMovement_0xBB +ForcedMovement_0xBB: @ 808ADF8 + push {lr} + bl sub_808C4D8 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end ForcedMovement_0xBB + + thumb_func_start ForcedMovement_0xBC +ForcedMovement_0xBC: @ 808AE04 + push {lr} + bl sub_808C5B0 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end ForcedMovement_0xBC + + thumb_func_start ForcedMovement_MuddySlope +ForcedMovement_MuddySlope: @ 808AE10 + push {r4,lr} + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + ldrb r1, [r4, 0x18] + movs r0, 0xF0 + ands r0, r1 + cmp r0, 0x20 + bne _0808AE36 + bl sub_811A138 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + bgt _0808AE60 +_0808AE36: + movs r0, 0 + bl sub_811A114 + ldrb r0, [r4, 0x1] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4, 0x1] + ldr r1, =PlayerGoSpeed1 + movs r0, 0x1 + bl DoForcedMovement + lsls r0, 24 + lsrs r0, 24 + b _0808AE62 + .pool +_0808AE60: + movs r0, 0 +_0808AE62: + pop {r4} + pop {r1} + bx r1 + thumb_func_end ForcedMovement_MuddySlope + + thumb_func_start MovePlayerNotOnBike +@ void MovePlayerNotOnBike(u8 direction, u8 heldKeys) +MovePlayerNotOnBike: @ 808AE68 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 16 + lsrs r5, 16 + ldr r6, =gUnknown_08497490 + adds r0, r4, 0 + bl CheckMovementInputNotOnBike + lsls r0, 24 + lsrs r0, 22 + adds r0, r6 + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl _call_via_r2 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end MovePlayerNotOnBike + + thumb_func_start CheckMovementInputNotOnBike +@ u8 CheckMovementInputNotOnBike(u8 direction) +CheckMovementInputNotOnBike: @ 808AE98 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0808AEB0 + ldr r0, =0x02037590 + strb r4, [r0, 0x2] + movs r0, 0 + b _0808AED2 + .pool +_0808AEB0: + bl player_get_direction_upper_nybble + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + beq _0808AECC + ldr r1, =0x02037590 + ldrb r0, [r1, 0x2] + cmp r0, 0x2 + beq _0808AECC + movs r0, 0x1 + b _0808AED0 + .pool +_0808AECC: + ldr r1, =0x02037590 + movs r0, 0x2 +_0808AED0: + strb r0, [r1, 0x2] +_0808AED2: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end CheckMovementInputNotOnBike + + thumb_func_start PlayerNotOnBikeNotMoving +@ void PlayerNotOnBikeNotMoving(u8 direction, u8 heldKeys) +PlayerNotOnBikeNotMoving: @ 808AEDC + push {lr} + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + bl PlayerFaceDirection + pop {r0} + bx r0 + thumb_func_end PlayerNotOnBikeNotMoving + + thumb_func_start PlayerNotOnBikeTurningInPlace +@ void PlayerNotOnBikeTurningInPlace(u8 direction, u8 heldKeys) +PlayerNotOnBikeTurningInPlace: @ 808AEF0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl PlayerTurnInPlace + pop {r0} + bx r0 + thumb_func_end PlayerNotOnBikeTurningInPlace + + thumb_func_start PlayerNotOnBikeMoving +@ void PlayerNotOnBikeMoving(u8 direction, u8 heldKeys) +PlayerNotOnBikeMoving: @ 808AF00 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 16 + lsrs r6, r1, 16 + adds r0, r5, 0 + bl CheckForPlayerAvatarCollision + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0808AF4E + cmp r4, 0x6 + bne _0808AF24 + adds r0, r5, 0 + bl PlayerJumpLedge + b _0808AFB6 +_0808AF24: + cmp r4, 0x4 + bne _0808AF3C + adds r0, r5, 0 + bl IsPlayerCollidingWithFarawayIslandMew + lsls r0, 24 + cmp r0, 0 + beq _0808AF3C + adds r0, r5, 0 + bl PlayerNotOnBikeCollideWithFarawayIslandMew + b _0808AFB6 +_0808AF3C: + subs r0, r4, 0x5 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _0808AFB6 + adds r0, r5, 0 + bl PlayerNotOnBikeCollide + b _0808AFB6 +_0808AF4E: + ldr r4, =0x02037590 + ldrb r1, [r4] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0808AF68 + adds r0, r5, 0 + bl PlayerGoSpeed1 + b _0808AFB6 + .pool +_0808AF68: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _0808AFB0 + movs r0, 0x2 + ands r6, r0 + cmp r6, 0 + beq _0808AFB0 + movs r0, 0x8C + lsls r0, 4 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0808AFB0 + ldr r2, =0x02037350 + ldrb r1, [r4, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1E] + bl IsRunningDisallowed + cmp r0, 0 + bne _0808AFB0 + adds r0, r5, 0 + bl PlayerRun + ldrb r1, [r4] + movs r0, 0x80 + orrs r0, r1 + strb r0, [r4] + b _0808AFB6 + .pool +_0808AFB0: + adds r0, r5, 0 + bl PlayerGoSpeed0 +_0808AFB6: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end PlayerNotOnBikeMoving + + thumb_func_start CheckForPlayerAvatarCollision +CheckForPlayerAvatarCollision: @ 808AFBC + push {r4-r6,lr} + sub sp, 0x8 + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + ldr r0, =0x02037590 + ldrb r0, [r0, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02037350 + adds r4, r0 + ldrh r1, [r4, 0x10] + add r0, sp, 0x4 + strh r1, [r0] + ldrh r0, [r4, 0x12] + mov r5, sp + adds r5, 0x6 + strh r0, [r5] + adds r0, r6, 0 + add r1, sp, 0x4 + adds r2, r5, 0 + bl MoveCoords + add r0, sp, 0x4 + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r5, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + add r1, sp, 0x4 + movs r3, 0 + ldrsh r1, [r1, r3] + movs r3, 0 + ldrsh r2, [r5, r3] + str r0, [sp] + adds r0, r4, 0 + adds r3, r6, 0 + bl CheckForFieldObjectCollision + lsls r0, 24 + lsrs r0, 24 + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end CheckForPlayerAvatarCollision + + thumb_func_start sub_808B028 +sub_808B028: @ 808B028 + push {r4-r6,lr} + sub sp, 0x8 + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + ldr r0, =0x02037590 + ldrb r0, [r0, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02037350 + adds r4, r0 + ldrh r1, [r4, 0x10] + add r0, sp, 0x4 + strh r1, [r0] + ldrh r0, [r4, 0x12] + mov r5, sp + adds r5, 0x6 + strh r0, [r5] + adds r0, r6, 0 + add r1, sp, 0x4 + adds r2, r5, 0 + bl MoveCoords + add r0, sp, 0x4 + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r5, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + add r1, sp, 0x4 + movs r3, 0 + ldrsh r1, [r1, r3] + movs r3, 0 + ldrsh r2, [r5, r3] + str r0, [sp] + adds r0, r4, 0 + adds r3, r6, 0 + bl sub_808B164 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_808B028 + + thumb_func_start CheckForFieldObjectCollision +@ u8 CheckForFieldObjectCollision(struct npc_state *fieldObject, u16 x, u16 y, u8 direction, u8 metatileBehavior) +CheckForFieldObjectCollision: @ 808B094 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r4, [sp, 0x24] + lsls r1, 16 + lsls r2, 16 + lsls r3, 24 + lsrs r6, r3, 24 + lsls r4, 24 + lsrs r4, 24 + mov r10, r4 + lsrs r7, r1, 16 + asrs r5, r1, 16 + lsrs r1, r2, 16 + mov r9, r1 + asrs r4, r2, 16 + adds r1, r5, 0 + adds r2, r4, 0 + adds r3, r6, 0 + bl npc_block_way + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + strb r0, [r1] + cmp r0, 0x3 + bne _0808B0E4 + adds r0, r5, 0 + adds r1, r4, 0 + adds r2, r6, 0 + bl sub_808B1BC + lsls r0, 24 + cmp r0, 0 + beq _0808B0E4 + movs r0, 0x5 + b _0808B152 +_0808B0E4: + lsls r5, r7, 16 + asrs r0, r5, 16 + mov r8, r0 + mov r1, r9 + lsls r4, r1, 16 + asrs r7, r4, 16 + adds r1, r7, 0 + adds r2, r6, 0 + bl ShouldJumpLedge + lsls r0, 24 + cmp r0, 0 + beq _0808B108 + movs r0, 0x2B + bl sav12_xor_increment + movs r0, 0x6 + b _0808B152 +_0808B108: + mov r0, sp + ldrb r0, [r0] + cmp r0, 0x4 + bne _0808B124 + mov r0, r8 + adds r1, r7, 0 + adds r2, r6, 0 + bl sub_808B238 + lsls r0, 24 + cmp r0, 0 + beq _0808B124 + movs r0, 0x7 + b _0808B152 +_0808B124: + mov r0, sp + ldrb r0, [r0] + cmp r0, 0 + bne _0808B14E + asrs r5, 16 + asrs r4, 16 + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl CheckForRotatingGatePuzzleCollision + cmp r0, 0 + beq _0808B142 + movs r0, 0x8 + b _0808B152 +_0808B142: + adds r0, r5, 0 + adds r1, r4, 0 + mov r2, r10 + mov r3, sp + bl check_acro_bike_metatile +_0808B14E: + mov r0, sp + ldrb r0, [r0] +_0808B152: + 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 CheckForFieldObjectCollision + + thumb_func_start sub_808B164 +sub_808B164: @ 808B164 + push {r4-r7,lr} + sub sp, 0x4 + ldr r4, [sp, 0x18] + lsls r3, 24 + lsrs r6, r3, 24 + lsls r4, 24 + lsrs r7, r4, 24 + lsls r1, 16 + asrs r5, r1, 16 + lsls r2, 16 + asrs r4, r2, 16 + adds r1, r5, 0 + adds r2, r4, 0 + adds r3, r6, 0 + bl npc_block_way + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + strb r0, [r1] + cmp r0, 0 + bne _0808B1AE + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_80FBFD4 + cmp r0, 0 + beq _0808B1A2 + movs r0, 0x8 + b _0808B1B2 +_0808B1A2: + adds r0, r5, 0 + adds r1, r4, 0 + adds r2, r7, 0 + mov r3, sp + bl check_acro_bike_metatile +_0808B1AE: + mov r0, sp + ldrb r0, [r0] +_0808B1B2: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808B164 + + thumb_func_start sub_808B1BC +@ bool8 sub_808B1BC(u16 x, u16 y, u8 direction) +sub_808B1BC: @ 808B1BC + push {r4-r6,lr} + lsls r0, 16 + lsrs r3, r0, 16 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r0, =0x02037590 + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0808B20C + lsls r5, r3, 16 + asrs r0, r5, 16 + lsls r4, 16 + asrs r1, r4, 16 + bl MapGridGetZCoordAt + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _0808B20C + lsrs r0, r5, 16 + lsrs r1, r4, 16 + movs r2, 0x3 + bl GetFieldObjectIdByXYZ + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x10 + bne _0808B20C + adds r0, r6, 0 + bl sub_808C750 + movs r0, 0x1 + b _0808B20E + .pool +_0808B20C: + movs r0, 0 +_0808B20E: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_808B1BC + + thumb_func_start ShouldJumpLedge +@ bool8 ShouldJumpLedge(s16 x, s16 y, u8 direction) +ShouldJumpLedge: @ 808B214 + push {lr} + lsls r2, 24 + lsrs r2, 24 + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + bl GetLedgeJumpDirection + lsls r0, 24 + cmp r0, 0 + bne _0808B230 + movs r0, 0 + b _0808B232 +_0808B230: + movs r0, 0x1 +_0808B232: + pop {r1} + bx r1 + thumb_func_end ShouldJumpLedge + + thumb_func_start sub_808B238 +sub_808B238: @ 808B238 + push {r4-r7,lr} + sub sp, 0x4 + mov r3, sp + strh r0, [r3] + mov r5, sp + adds r5, 0x2 + strh r1, [r5] + lsls r2, 24 + lsrs r7, r2, 24 + ldr r0, =0x00000889 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0808B2D8 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r5, r2] + bl GetFieldObjectIdByXY + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x10 + beq _0808B2D8 + ldr r0, =0x02037350 + lsls r1, r6, 3 + adds r1, r6 + lsls r1, 2 + adds r4, r1, r0 + ldrb r0, [r4, 0x5] + cmp r0, 0x57 + bne _0808B2D8 + ldrh r1, [r4, 0x10] + mov r0, sp + strh r1, [r0] + ldrh r0, [r4, 0x12] + strh r0, [r5] + adds r0, r7, 0 + mov r1, sp + adds r2, r5, 0 + bl MoveCoords + mov r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0 + ldrsh r2, [r5, r0] + adds r0, r4, 0 + adds r3, r7, 0 + bl npc_block_way + lsls r0, 24 + cmp r0, 0 + bne _0808B2D8 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r5, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl sub_8088F58 + lsls r0, 24 + cmp r0, 0 + bne _0808B2D8 + adds r0, r6, 0 + adds r1, r7, 0 + bl task_add_bump_boulder + movs r0, 0x1 + b _0808B2DA + .pool +_0808B2D8: + movs r0, 0 +_0808B2DA: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808B238 + + thumb_func_start check_acro_bike_metatile +@ void check_acro_bike_metatile(s16 x, s16 y, u8 metatileBehavior, u8 *returnValue) +check_acro_bike_metatile: @ 808B2E4 + push {r4-r7,lr} + adds r6, r3, 0 + lsls r2, 24 + lsrs r5, r2, 24 + movs r4, 0 + ldr r7, =gUnknown_0849749C +_0808B2F0: + lsls r0, r4, 2 + adds r0, r7 + ldr r1, [r0] + adds r0, r5, 0 + bl _call_via_r1 + lsls r0, 24 + cmp r0, 0 + beq _0808B314 + ldr r0, =gUnknown_084974B0 + adds r0, r4, r0 + ldrb r0, [r0] + strb r0, [r6] + b _0808B31E + .pool +_0808B314: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _0808B2F0 +_0808B31E: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end check_acro_bike_metatile + + thumb_func_start IsPlayerCollidingWithFarawayIslandMew +@ bool8 IsPlayerCollidingWithFarawayIslandMew(u8 direction) +IsPlayerCollidingWithFarawayIslandMew: @ 808B324 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02037590 + ldrb r2, [r1, 0x5] + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 2 + ldr r5, =0x02037350 + adds r3, r1, r5 + ldrh r2, [r3, 0x10] + mov r1, sp + strh r2, [r1] + ldrh r1, [r3, 0x12] + mov r4, sp + adds r4, 0x2 + strh r1, [r4] + mov r1, sp + adds r2, r4, 0 + bl MoveCoords + movs r0, 0x1 + movs r1, 0x39 + movs r2, 0x1A + bl GetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + lsrs r1, r0, 24 + adds r6, r4, 0 + cmp r1, 0x10 + beq _0808B3C0 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r3, r0, r5 + mov r0, sp + movs r1, 0x14 + ldrsh r2, [r3, r1] + movs r4, 0 + ldrsh r0, [r0, r4] + cmp r2, r0 + bne _0808B3C0 + movs r5, 0x16 + ldrsh r1, [r3, r5] + movs r4, 0 + ldrsh r0, [r6, r4] + ldrh r4, [r3, 0x16] + cmp r1, r0 + bne _0808B398 + movs r5, 0x10 + ldrsh r0, [r3, r5] + cmp r0, r2 + bne _0808B398 + movs r2, 0x12 + ldrsh r0, [r3, r2] + cmp r0, r1 + beq _0808B3C0 +_0808B398: + mov r0, sp + movs r5, 0x14 + ldrsh r1, [r3, r5] + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r1, r0 + bne _0808B3C0 + lsls r0, r4, 16 + asrs r0, 16 + movs r4, 0 + ldrsh r1, [r6, r4] + cmp r0, r1 + bne _0808B3C0 + movs r0, 0x1 + b _0808B3C2 + .pool +_0808B3C0: + movs r0, 0 +_0808B3C2: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end IsPlayerCollidingWithFarawayIslandMew + + thumb_func_start SetPlayerAvatarTransitionFlags +@ void SetPlayerAvatarTransitionFlags(u16 transitionFlags) +SetPlayerAvatarTransitionFlags: @ 808B3CC + push {lr} + lsls r0, 16 + lsrs r0, 16 + ldr r2, =0x02037590 + ldrb r1, [r2, 0x1] + orrs r0, r1 + strb r0, [r2, 0x1] + bl DoPlayerAvatarTransition + pop {r0} + bx r0 + .pool + thumb_func_end SetPlayerAvatarTransitionFlags + + thumb_func_start DoPlayerAvatarTransition +@ void DoPlayerAvatarTransition() +DoPlayerAvatarTransition: @ 808B3E8 + push {r4,r5,lr} + ldr r0, =0x02037590 + ldrb r4, [r0, 0x1] + cmp r4, 0 + beq _0808B428 + movs r5, 0 +_0808B3F4: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0808B416 + ldr r0, =gUnknown_084974B8 + lsls r2, r5, 2 + adds r2, r0 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + ldr r1, [r2] + bl _call_via_r1 +_0808B416: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + lsrs r4, 1 + cmp r5, 0x7 + bls _0808B3F4 + ldr r1, =0x02037590 + movs r0, 0 + strb r0, [r1, 0x1] +_0808B428: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end DoPlayerAvatarTransition + + thumb_func_start PlayerAvatarTransition_Dummy +@ void PlayerAvatarTransition_Dummy(struct npc_state *fieldObject) +PlayerAvatarTransition_Dummy: @ 808B43C + bx lr + thumb_func_end PlayerAvatarTransition_Dummy + + thumb_func_start PlayerAvatarTransition_Normal +@ void PlayerAvatarTransition_Normal(struct npc_state *fieldObject) +PlayerAvatarTransition_Normal: @ 808B440 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0 + bl GetPlayerAvatarGraphicsIdByStateId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetGraphicsId + ldrb r1, [r4, 0x18] + lsrs r1, 4 + adds r0, r4, 0 + bl FieldObjectTurn + movs r0, 0x1 + bl SetPlayerAvatarStateMask + pop {r4} + pop {r0} + bx r0 + thumb_func_end PlayerAvatarTransition_Normal + + thumb_func_start PlayerAvatarTransition_MachBike +@ void PlayerAvatarTransition_MachBike(struct npc_state *fieldObject) +PlayerAvatarTransition_MachBike: @ 808B46C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x1 + bl GetPlayerAvatarGraphicsIdByStateId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetGraphicsId + ldrb r1, [r4, 0x18] + lsrs r1, 4 + adds r0, r4, 0 + bl FieldObjectTurn + movs r0, 0x2 + bl SetPlayerAvatarStateMask + movs r0, 0 + movs r1, 0 + bl sub_811A0D0 + pop {r4} + pop {r0} + bx r0 + thumb_func_end PlayerAvatarTransition_MachBike + + thumb_func_start PlayerAvatarTransition_AcroBike +@ void PlayerAvatarTransition_AcroBike(struct npc_state *fieldObject) +PlayerAvatarTransition_AcroBike: @ 808B4A0 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x2 + bl GetPlayerAvatarGraphicsIdByStateId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetGraphicsId + ldrb r1, [r4, 0x18] + lsrs r1, 4 + adds r0, r4, 0 + bl FieldObjectTurn + movs r0, 0x4 + bl SetPlayerAvatarStateMask + movs r0, 0 + movs r1, 0 + bl sub_811A0D0 + bl sub_811A188 + pop {r4} + pop {r0} + bx r0 + thumb_func_end PlayerAvatarTransition_AcroBike + + thumb_func_start PlayerAvatarTransition_Surfing +@ void PlayerAvatarTransition_Surfing(struct npc_state *fieldObject) +PlayerAvatarTransition_Surfing: @ 808B4D8 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x3 + bl GetPlayerAvatarGraphicsIdByStateId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetGraphicsId + ldrb r1, [r4, 0x18] + lsrs r1, 4 + adds r0, r4, 0 + bl FieldObjectTurn + movs r0, 0x8 + bl SetPlayerAvatarStateMask + ldr r1, =0x02038c08 + movs r2, 0x10 + ldrsh r0, [r4, r2] + str r0, [r1] + movs r2, 0x12 + ldrsh r0, [r4, r2] + str r0, [r1, 0x4] + ldr r0, =0x02037590 + ldrb r0, [r0, 0x5] + str r0, [r1, 0x8] + movs r0, 0x8 + bl FieldEffectStart + lsls r0, 24 + lsrs r0, 24 + strb r0, [r4, 0x1A] + movs r1, 0x1 + bl sub_81555AC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end PlayerAvatarTransition_Surfing + + thumb_func_start PlayerAvatarTransition_Underwater +@ void PlayerAvatarTransition_Underwater(struct npc_state *fieldObject) +PlayerAvatarTransition_Underwater: @ 808B534 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x4 + bl GetPlayerAvatarGraphicsIdByStateId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetGraphicsId + ldrb r1, [r4, 0x18] + lsrs r1, 4 + adds r0, r4, 0 + bl FieldObjectTurn + movs r0, 0x10 + bl SetPlayerAvatarStateMask + ldrb r0, [r4, 0x4] + bl sub_8155800 + strb r0, [r4, 0x1A] + pop {r4} + pop {r0} + bx r0 + thumb_func_end PlayerAvatarTransition_Underwater + + thumb_func_start PlayerAvatarTransition_ReturnToField +@ void PlayerAvatarTransition_ReturnToField(struct npc_state *fieldObject) +PlayerAvatarTransition_ReturnToField: @ 808B568 + ldr r2, =0x02037590 + ldrb r1, [r2] + movs r0, 0x20 + orrs r0, r1 + strb r0, [r2] + bx lr + .pool + thumb_func_end PlayerAvatarTransition_ReturnToField + + thumb_func_start sub_808B578 +sub_808B578: @ 808B578 + push {r4,lr} + ldr r4, =0x02037590 + movs r0, 0 + strb r0, [r4, 0x3] + bl PlayerIsAnimActive + lsls r0, 24 + cmp r0, 0 + beq _0808B5B6 + bl PlayerCheckIfAnimFinishedOrInactive + lsls r0, 24 + cmp r0, 0 + bne _0808B5A8 + bl player_is_anim_in_certain_ranges + lsls r0, 24 + cmp r0, 0 + bne _0808B5B6 + movs r0, 0x1 + b _0808B5B4 + .pool +_0808B5A8: + bl sub_808B618 + lsls r0, 24 + cmp r0, 0 + bne _0808B5B6 + movs r0, 0x2 +_0808B5B4: + strb r0, [r4, 0x3] +_0808B5B6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_808B578 + + thumb_func_start player_is_anim_in_certain_ranges +player_is_anim_in_certain_ranges: @ 808B5BC + push {lr} + ldr r2, =0x02037350 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1C] + cmp r1, 0x3 + bls _0808B602 + adds r0, r1, 0 + subs r0, 0x10 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bls _0808B602 + adds r0, r1, 0 + subs r0, 0x19 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xF + bls _0808B602 + adds r0, r1, 0 + subs r0, 0x64 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xB + bls _0808B602 + adds r0, r1, 0 + subs r0, 0x7C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bhi _0808B610 +_0808B602: + movs r0, 0x1 + b _0808B612 + .pool +_0808B610: + movs r0, 0 +_0808B612: + pop {r1} + bx r1 + thumb_func_end player_is_anim_in_certain_ranges + + thumb_func_start sub_808B618 +sub_808B618: @ 808B618 + push {lr} + bl player_is_anim_in_certain_ranges + lsls r0, 24 + cmp r0, 0 + beq _0808B634 + ldr r0, =0x02037590 + ldrb r0, [r0, 0x2] + cmp r0, 0x1 + beq _0808B634 + movs r0, 0x1 + b _0808B636 + .pool +_0808B634: + movs r0, 0 +_0808B636: + pop {r1} + bx r1 + thumb_func_end sub_808B618 + + thumb_func_start PlayerIsAnimActive +@ bool8 PlayerIsAnimActive() +PlayerIsAnimActive: @ 808B63C + push {lr} + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end PlayerIsAnimActive + + thumb_func_start PlayerCheckIfAnimFinishedOrInactive +@ bool8 PlayerCheckIfAnimFinishedOrInactive() +PlayerCheckIfAnimFinishedOrInactive: @ 808B660 + push {lr} + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + bl FieldObjectCheckIfSpecialAnimFinishedOrInactive + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end PlayerCheckIfAnimFinishedOrInactive + + thumb_func_start player_set_x22 +player_set_x22: @ 808B684 + ldr r3, =0x02037350 + ldr r1, =0x02037590 + ldrb r2, [r1, 0x5] + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 2 + adds r1, r3 + adds r1, 0x22 + strb r0, [r1] + bx lr + .pool + thumb_func_end player_set_x22 + + thumb_func_start player_get_x22 +player_get_x22: @ 808B6A0 + ldr r2, =0x02037350 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x22 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end player_get_x22 + + thumb_func_start sub_808B6BC +sub_808B6BC: @ 808B6BC + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =0x02037590 + ldrb r2, [r0, 0x5] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + bl FieldObjectForceSetSpecialAnim + pop {r0} + bx r0 + .pool + thumb_func_end sub_808B6BC + + thumb_func_start player_npc_set_state_and_x22_etc +@ void player_npc_set_state_and_x22_etc(u8 animState, u8 a2) +player_npc_set_state_and_x22_etc: @ 808B6E4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + bl PlayerIsAnimActive + lsls r0, 24 + cmp r0, 0 + bne _0808B712 + adds r0, r4, 0 + bl player_set_x22 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + adds r1, r5, 0 + bl FieldObjectSetSpecialAnim +_0808B712: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end player_npc_set_state_and_x22_etc + + thumb_func_start PlayerGoSpeed0 +@ void PlayerGoSpeed0(u8 direction) +PlayerGoSpeed0: @ 808B720 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl GetGoSpeed0AnimId + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl player_npc_set_state_and_x22_etc + pop {r0} + bx r0 + thumb_func_end PlayerGoSpeed0 + + thumb_func_start PlayerGoSpeed1 +@ void PlayerGoSpeed1(u8 direction) +PlayerGoSpeed1: @ 808B738 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl GetGoSpeed1AnimId + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl player_npc_set_state_and_x22_etc + pop {r0} + bx r0 + thumb_func_end PlayerGoSpeed1 + + thumb_func_start PlayerGoSpeed2 +@ void PlayerGoSpeed2(u8 direction) +PlayerGoSpeed2: @ 808B750 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl GetGoSpeed2AnimId + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl player_npc_set_state_and_x22_etc + pop {r0} + bx r0 + thumb_func_end PlayerGoSpeed2 + + thumb_func_start PlayerGoSpeed3 +@ void PlayerGoSpeed3(u8 direction) +PlayerGoSpeed3: @ 808B768 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl GetGoSpeed3AnimId + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl player_npc_set_state_and_x22_etc + pop {r0} + bx r0 + thumb_func_end PlayerGoSpeed3 + + thumb_func_start PlayerRun +@ void PlayerRun(u8 direction) +PlayerRun: @ 808B780 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl GetRunAnimId + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl player_npc_set_state_and_x22_etc + pop {r0} + bx r0 + thumb_func_end PlayerRun + + thumb_func_start PlayerOnBikeCollide +@ void PlayerOnBikeCollide(u8 direction) +PlayerOnBikeCollide: @ 808B798 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl PlayCollisionSoundIfNotFacingWarp + adds r0, r4, 0 + bl GetStepInPlaceDelay16AnimId + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl player_npc_set_state_and_x22_etc + pop {r4} + pop {r0} + bx r0 + thumb_func_end PlayerOnBikeCollide + + thumb_func_start PlayerOnBikeCollideWithFarawayIslandMew +@ void PlayerOnBikeCollideWithFarawayIslandMew(u8 direction) +PlayerOnBikeCollideWithFarawayIslandMew: @ 808B7BC + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl GetStepInPlaceDelay16AnimId + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl player_npc_set_state_and_x22_etc + pop {r0} + bx r0 + thumb_func_end PlayerOnBikeCollideWithFarawayIslandMew + + thumb_func_start PlayerNotOnBikeCollide +@ void PlayerNotOnBikeCollide(u8 direction) +PlayerNotOnBikeCollide: @ 808B7D4 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl PlayCollisionSoundIfNotFacingWarp + adds r0, r4, 0 + bl GetStepInPlaceDelay32AnimId + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl player_npc_set_state_and_x22_etc + pop {r4} + pop {r0} + bx r0 + thumb_func_end PlayerNotOnBikeCollide + + thumb_func_start PlayerNotOnBikeCollideWithFarawayIslandMew +@ void PlayerNotOnBikeCollideWithFarawayIslandMew(u8 direction) +PlayerNotOnBikeCollideWithFarawayIslandMew: @ 808B7F8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl GetStepInPlaceDelay32AnimId + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl player_npc_set_state_and_x22_etc + pop {r0} + bx r0 + thumb_func_end PlayerNotOnBikeCollideWithFarawayIslandMew + + thumb_func_start PlayerFaceDirection +@ void PlayerFaceDirection(u8 direction) +PlayerFaceDirection: @ 808B810 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl GetFaceDirectionAnimId + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl player_npc_set_state_and_x22_etc + pop {r0} + bx r0 + thumb_func_end PlayerFaceDirection + + thumb_func_start PlayerTurnInPlace +@ void PlayerTurnInPlace(u8 direction) +PlayerTurnInPlace: @ 808B828 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl GetStepInPlaceDelay8AnimId + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl player_npc_set_state_and_x22_etc + pop {r0} + bx r0 + thumb_func_end PlayerTurnInPlace + + thumb_func_start PlayerJumpLedge +@ void PlayerJumpLedge(u8 direction) +PlayerJumpLedge: @ 808B840 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0xA + bl audio_play + adds r0, r4, 0 + bl GetJumpLedgeAnimId + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x8 + bl player_npc_set_state_and_x22_etc + pop {r4} + pop {r0} + bx r0 + thumb_func_end PlayerJumpLedge + + thumb_func_start sub_808B864 +sub_808B864: @ 808B864 + push {r4,lr} + ldr r4, =0x02037590 + ldrb r0, [r4, 0x3] + cmp r0, 0x2 + beq _0808B872 + cmp r0, 0 + bne _0808B89A +_0808B872: + bl player_should_look_direction_be_enforced_upon_movement + lsls r0, 24 + cmp r0, 0 + beq _0808B89A + ldr r2, =0x02037350 + ldrb r1, [r4, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + lsls r0, 24 + lsrs r0, 24 + bl sub_808B6BC +_0808B89A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808B864 + + thumb_func_start sub_808B8A8 +sub_808B8A8: @ 808B8A8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_8093648 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl player_npc_set_state_and_x22_etc + pop {r0} + bx r0 + thumb_func_end sub_808B8A8 + + thumb_func_start sub_808B8C0 +sub_808B8C0: @ 808B8C0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_8093674 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl player_npc_set_state_and_x22_etc + pop {r0} + bx r0 + thumb_func_end sub_808B8C0 + + thumb_func_start sub_808B8D8 +sub_808B8D8: @ 808B8D8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_80936A0 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl player_npc_set_state_and_x22_etc + pop {r0} + bx r0 + thumb_func_end sub_808B8D8 + + thumb_func_start sub_808B8F0 +sub_808B8F0: @ 808B8F0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x22 + bl audio_play + adds r0, r4, 0 + bl sub_80936CC + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl player_npc_set_state_and_x22_etc + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_808B8F0 + + thumb_func_start sub_808B914 +sub_808B914: @ 808B914 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x22 + bl audio_play + adds r0, r4, 0 + bl sub_80936F8 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl player_npc_set_state_and_x22_etc + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_808B914 + + thumb_func_start sub_808B938 +sub_808B938: @ 808B938 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x22 + bl audio_play + adds r0, r4, 0 + bl sub_8093724 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x8 + bl player_npc_set_state_and_x22_etc + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_808B938 + + thumb_func_start sub_808B95C +sub_808B95C: @ 808B95C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x22 + bl audio_play + adds r0, r4, 0 + bl sub_80934E8 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl player_npc_set_state_and_x22_etc + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_808B95C + + thumb_func_start sub_808B980 +sub_808B980: @ 808B980 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x7 + bl audio_play + adds r0, r4, 0 + bl sub_8093750 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl player_npc_set_state_and_x22_etc + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_808B980 + + thumb_func_start sub_808B9A4 +sub_808B9A4: @ 808B9A4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_809377C + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl player_npc_set_state_and_x22_etc + pop {r0} + bx r0 + thumb_func_end sub_808B9A4 + + thumb_func_start sub_808B9BC +sub_808B9BC: @ 808B9BC + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_80937A8 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl player_npc_set_state_and_x22_etc + pop {r0} + bx r0 + thumb_func_end sub_808B9BC + + thumb_func_start npc_use_some_d2s +npc_use_some_d2s: @ 808B9D4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl d2s_08064034 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl player_npc_set_state_and_x22_etc + pop {r0} + bx r0 + thumb_func_end npc_use_some_d2s + + thumb_func_start PlayCollisionSoundIfNotFacingWarp +@ void PlayCollisionSoundIfNotFacingWarp(u8 direction) +PlayCollisionSoundIfNotFacingWarp: @ 808B9EC + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r2, =0x02037350 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1E] + ldr r2, =gUnknown_084974D8 + subs r1, r4, 0x1 + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl _call_via_r1 + lsls r0, 24 + cmp r0, 0 + bne _0808BA54 + cmp r4, 0x2 + bne _0808BA4E + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + movs r0, 0x2 + mov r1, sp + adds r2, r4, 0 + bl MoveCoords + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl is_tile_x69_2_warp_door + lsls r0, 24 + cmp r0, 0 + bne _0808BA54 +_0808BA4E: + movs r0, 0x7 + bl audio_play +_0808BA54: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end PlayCollisionSoundIfNotFacingWarp + + thumb_func_start GetXYCoordsOneStepInFrontOfPlayer +GetXYCoordsOneStepInFrontOfPlayer: @ 808BA68 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r3, =0x02037350 + ldr r2, =0x02037590 + ldrb r1, [r2, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r0, [r0, 0x10] + strh r0, [r4] + ldrb r1, [r2, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r0, [r0, 0x12] + strh r0, [r5] + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + adds r2, r5, 0 + bl MoveCoords + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end GetXYCoordsOneStepInFrontOfPlayer + + thumb_func_start PlayerGetDestCoords +@ void PlayerGetDestCoords(u16 *x, u16 *y) +PlayerGetDestCoords: @ 808BAAC + push {r4,r5,lr} + ldr r5, =0x02037350 + ldr r4, =0x02037590 + ldrb r3, [r4, 0x5] + lsls r2, r3, 3 + adds r2, r3 + lsls r2, 2 + adds r2, r5 + ldrh r2, [r2, 0x10] + strh r2, [r0] + ldrb r2, [r4, 0x5] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + adds r0, r5 + ldrh r0, [r0, 0x12] + strh r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end PlayerGetDestCoords + + thumb_func_start plaer_get_pos_including_state_based_drift +plaer_get_pos_including_state_based_drift: @ 808BADC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r3, r0, r1 + ldrb r1, [r3] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0x40 + beq _0808BAFC + b _0808BC24 +_0808BAFC: + ldr r2, =0x02020630 + ldrb r1, [r3, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x32 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _0808BB12 + b _0808BC24 +_0808BB12: + ldrh r0, [r3, 0x10] + strh r0, [r4] + ldrh r0, [r3, 0x12] + strh r0, [r5] + ldrb r0, [r3, 0x1C] + subs r0, 0x8 + cmp r0, 0x30 + bls _0808BB24 + b _0808BC24 +_0808BB24: + lsls r0, 2 + ldr r1, =_0808BB40 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0808BB40: + .4byte _0808BC04 + .4byte _0808BC0A + .4byte _0808BC14 + .4byte _0808BC1A + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC04 + .4byte _0808BC0A + .4byte _0808BC14 + .4byte _0808BC1A +_0808BC04: + ldrh r0, [r5] + adds r0, 0x1 + b _0808BC0E +_0808BC0A: + ldrh r0, [r5] + subs r0, 0x1 +_0808BC0E: + strh r0, [r5] + movs r0, 0x1 + b _0808BC30 +_0808BC14: + ldrh r0, [r4] + subs r0, 0x1 + b _0808BC1E +_0808BC1A: + ldrh r0, [r4] + adds r0, 0x1 +_0808BC1E: + strh r0, [r4] + movs r0, 0x1 + b _0808BC30 +_0808BC24: + movs r1, 0x1 + negs r1, r1 + adds r0, r1, 0 + strh r0, [r4] + strh r0, [r5] + movs r0, 0 +_0808BC30: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end plaer_get_pos_including_state_based_drift + + thumb_func_start player_get_direction_lower_nybble +@ u8 player_get_direction_lower_nybble() +player_get_direction_lower_nybble: @ 808BC38 + ldr r2, =0x02037350 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x18] + lsls r0, 28 + lsrs r0, 28 + bx lr + .pool + thumb_func_end player_get_direction_lower_nybble + + thumb_func_start player_get_direction_upper_nybble +@ u8 player_get_direction_upper_nybble() +player_get_direction_upper_nybble: @ 808BC58 + ldr r2, =0x02037350 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x18] + lsrs r0, 4 + bx lr + .pool + thumb_func_end player_get_direction_upper_nybble + + thumb_func_start PlayerGetZCoord +@ u8 PlayerGetZCoord() +PlayerGetZCoord: @ 808BC74 + ldr r2, =0x02037350 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0xB] + lsrs r0, 4 + bx lr + .pool + thumb_func_end PlayerGetZCoord + + thumb_func_start sub_808BC90 +sub_808BC90: @ 808BC90 + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + lsls r3, 16 + asrs r3, 16 + lsls r2, 16 + asrs r2, 16 + adds r1, r3, 0 + bl sub_808EB08 + pop {r0} + bx r0 + .pool + thumb_func_end sub_808BC90 + + thumb_func_start TestPlayerAvatarFlags +@ u32 TestPlayerAvatarFlags(u32 mask) +TestPlayerAvatarFlags: @ 808BCC0 + ldr r1, =0x02037590 + ldrb r1, [r1] + ands r1, r0 + adds r0, r1, 0 + bx lr + .pool + thumb_func_end TestPlayerAvatarFlags + + thumb_func_start sub_808BCD0 +sub_808BCD0: @ 808BCD0 + ldr r0, =0x02037590 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_808BCD0 + + thumb_func_start GetPlayerAvatarObjectId +@ u8 GetPlayerAvatarObjectId() +GetPlayerAvatarObjectId: @ 808BCDC + ldr r0, =0x02037590 + ldrb r0, [r0, 0x4] + bx lr + .pool + thumb_func_end GetPlayerAvatarObjectId + + thumb_func_start sub_808BCE8 +sub_808BCE8: @ 808BCE8 + push {lr} + bl ForcedMovement_None + pop {r0} + bx r0 + thumb_func_end sub_808BCE8 + + thumb_func_start sub_808BCF4 +sub_808BCF4: @ 808BCF4 + push {r4,lr} + ldr r0, =0x02037590 + ldrb r0, [r0, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02037350 + adds r4, r0 + adds r0, r4, 0 + bl npc_clear_strange_bits + ldrb r1, [r4, 0x18] + lsls r1, 28 + lsrs r1, 28 + adds r0, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x6 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + beq _0808BD2C + bl sub_811A188 + movs r0, 0 + bl sub_811A114 +_0808BD2C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808BCF4 + + thumb_func_start sub_808BD3C +sub_808BD3C: @ 808BD3C + lsls r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_084974E8 + lsrs r0, 23 + adds r1, r0 + adds r1, r2 + ldrb r0, [r1] + bx lr + .pool + thumb_func_end sub_808BD3C + + thumb_func_start GetPlayerAvatarGraphicsIdByStateIdAndGender +@ u8 GetPlayerAvatarGraphicsIdByStateIdAndGender(u8 stateId, u8 gender) +GetPlayerAvatarGraphicsIdByStateIdAndGender: @ 808BD54 + lsls r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_084974F8 + lsrs r0, 23 + adds r1, r0 + adds r1, r2 + ldrb r0, [r1] + bx lr + .pool + thumb_func_end GetPlayerAvatarGraphicsIdByStateIdAndGender + + thumb_func_start sub_808BD6C +sub_808BD6C: @ 808BD6C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_08497508 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_808BD6C + + thumb_func_start sub_808BD7C +sub_808BD7C: @ 808BD7C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0849750A + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_808BD7C + + thumb_func_start GetPlayerAvatarGraphicsIdByStateId +@ u8 GetPlayerAvatarGraphicsIdByStateId(u8 stateId) +GetPlayerAvatarGraphicsIdByStateId: @ 808BD8C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02037590 + ldrb r1, [r1, 0x7] + bl GetPlayerAvatarGraphicsIdByStateIdAndGender + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end GetPlayerAvatarGraphicsIdByStateId + + thumb_func_start sub_808BDA8 +sub_808BDA8: @ 808BDA8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x70 + beq _0808BDCA + cmp r0, 0x70 + bgt _0808BDC2 + cmp r0, 0x6D + bgt _0808BDCE + cmp r0, 0x69 + blt _0808BDCE + b _0808BDCA +_0808BDC2: + cmp r1, 0x8A + beq _0808BDCA + cmp r1, 0xC0 + bne _0808BDCE +_0808BDCA: + movs r0, 0x1 + b _0808BDD0 +_0808BDCE: + movs r0, 0 +_0808BDD0: + pop {r1} + bx r1 + thumb_func_end sub_808BDA8 + + thumb_func_start GetPlayerAvatarGenderByGraphicsId +@ u8 GetPlayerAvatarGenderByGraphicsId(u8 graphicsId) +GetPlayerAvatarGenderByGraphicsId: @ 808BDD4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x70 + beq _0808BDF6 + cmp r0, 0x70 + bgt _0808BDEE + cmp r0, 0x5D + bgt _0808BDFA + cmp r0, 0x59 + blt _0808BDFA + b _0808BDF6 +_0808BDEE: + cmp r1, 0x8A + beq _0808BDF6 + cmp r1, 0xC0 + bne _0808BDFA +_0808BDF6: + movs r0, 0x1 + b _0808BDFC +_0808BDFA: + movs r0, 0 +_0808BDFC: + pop {r1} + bx r1 + thumb_func_end GetPlayerAvatarGenderByGraphicsId + + thumb_func_start PartyHasMonWithSurf +@ bool8 PartyHasMonWithSurf() +PartyHasMonWithSurf: @ 808BE00 + push {r4,r5,lr} + movs r0, 0x8 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + bne _0808BE44 + movs r5, 0 + b _0808BE2A +_0808BE12: + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_has_move + lsls r0, 24 + cmp r0, 0 + beq _0808BE24 + movs r0, 0x1 + b _0808BE46 +_0808BE24: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_0808BE2A: + cmp r5, 0x5 + bhi _0808BE44 + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + bne _0808BE12 +_0808BE44: + movs r0, 0 +_0808BE46: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end PartyHasMonWithSurf + + thumb_func_start IsPlayerSurfingNorth +@ bool8 IsPlayerSurfingNorth() +IsPlayerSurfingNorth: @ 808BE50 + push {lr} + bl player_get_direction_upper_nybble + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _0808BE6E + movs r0, 0x8 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + beq _0808BE6E + movs r0, 0x1 + b _0808BE70 +_0808BE6E: + movs r0, 0 +_0808BE70: + pop {r1} + bx r1 + thumb_func_end IsPlayerSurfingNorth + + thumb_func_start IsPlayerFacingSurfableFishableWater +@ bool8 IsPlayerFacingSurfableFishableWater() +IsPlayerFacingSurfableFishableWater: @ 808BE74 + push {r4,r5,lr} + sub sp, 0x4 + ldr r0, =0x02037590 + ldrb r0, [r0, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02037350 + adds r4, r0 + ldrh r1, [r4, 0x10] + mov r0, sp + strh r1, [r0] + ldrh r0, [r4, 0x12] + mov r5, sp + adds r5, 0x2 + strh r0, [r5] + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + mov r1, sp + adds r2, r5, 0 + bl MoveCoords + mov r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0 + ldrsh r2, [r5, r0] + ldrb r3, [r4, 0x18] + lsls r3, 28 + lsrs r3, 28 + adds r0, r4, 0 + bl npc_block_way + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _0808BEF4 + bl PlayerGetZCoord + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _0808BEF4 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r5, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl MetatileBehavior_IsSurfableFishableWater + lsls r0, 24 + cmp r0, 0 + beq _0808BEF4 + movs r0, 0x1 + b _0808BEF6 + .pool +_0808BEF4: + movs r0, 0 +_0808BEF6: + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end IsPlayerFacingSurfableFishableWater + + thumb_func_start ClearPlayerAvatarInfo +@ void ClearPlayerAvatarInfo() +ClearPlayerAvatarInfo: @ 808BF00 + push {lr} + ldr r0, =0x02037590 + movs r1, 0 + movs r2, 0x24 + bl memset + pop {r0} + bx r0 + .pool + thumb_func_end ClearPlayerAvatarInfo + + thumb_func_start SetPlayerAvatarStateMask +@ void SetPlayerAvatarStateMask(u8 stateMask) +SetPlayerAvatarStateMask: @ 808BF14 + lsls r0, 24 + lsrs r0, 24 + ldr r3, =0x02037590 + ldrb r2, [r3] + movs r1, 0xE0 + ands r1, r2 + orrs r0, r1 + strb r0, [r3] + bx lr + .pool + thumb_func_end SetPlayerAvatarStateMask + + thumb_func_start GetPlayerAvatarStateTransitionByGraphicsId +@ u8 GetPlayerAvatarStateTransitionByGraphicsId(u8 graphicsId, u8 gender) +GetPlayerAvatarStateTransitionByGraphicsId: @ 808BF2C + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r1, 24 + movs r2, 0 + ldr r3, =gUnknown_0849750C + lsls r0, r1, 2 + adds r0, r1 + lsls r4, r0, 1 + adds r6, r3, 0x1 +_0808BF42: + lsls r0, r2, 1 + adds r1, r0, r4 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r5 + bne _0808BF58 + adds r0, r1, r6 + ldrb r0, [r0] + b _0808BF64 + .pool +_0808BF58: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x4 + bls _0808BF42 + movs r0, 0x1 +_0808BF64: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end GetPlayerAvatarStateTransitionByGraphicsId + + thumb_func_start GetPlayerAvatarGraphicsIdByCurrentState +@ u8 GetPlayerAvatarGraphicsIdByCurrentState() +GetPlayerAvatarGraphicsIdByCurrentState: @ 808BF6C + push {r4-r6,lr} + ldr r0, =0x02037590 + ldrb r5, [r0] + movs r2, 0 + ldr r3, =gUnknown_0849750C + ldrb r1, [r0, 0x7] + lsls r0, r1, 2 + adds r0, r1 + lsls r4, r0, 1 + adds r6, r3, 0x1 +_0808BF80: + lsls r0, r2, 1 + adds r1, r0, r4 + adds r0, r1, r6 + ldrb r0, [r0] + ands r0, r5 + cmp r0, 0 + beq _0808BF9C + adds r0, r1, r3 + ldrb r0, [r0] + b _0808BFA8 + .pool +_0808BF9C: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x4 + bls _0808BF80 + movs r0, 0 +_0808BFA8: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end GetPlayerAvatarGraphicsIdByCurrentState + + thumb_func_start SetPlayerAvatarExtraStateTransition +@ void SetPlayerAvatarExtraStateTransition(u8 graphicsId, u8 state) +SetPlayerAvatarExtraStateTransition: @ 808BFB0 + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =0x02037590 + ldrb r1, [r5, 0x7] + bl GetPlayerAvatarStateTransitionByGraphicsId + lsls r0, 24 + lsrs r0, 24 + orrs r0, r4 + ldrb r1, [r5, 0x1] + orrs r0, r1 + strb r0, [r5, 0x1] + bl DoPlayerAvatarTransition + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end SetPlayerAvatarExtraStateTransition + + thumb_func_start InitPlayerAvatar +@ void InitPlayerAvatar(u16 x, u16 y, u8 direction, u8 gender) +InitPlayerAvatar: @ 808BFE0 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x18 + adds r4, r0, 0 + adds r5, r1, 0 + mov r9, r2 + mov r8, r3 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + mov r1, sp + movs r0, 0xFF + strb r0, [r1] + movs r0, 0 + mov r1, r8 + bl GetPlayerAvatarGraphicsIdByStateIdAndGender + mov r1, sp + movs r3, 0 + strb r0, [r1, 0x1] + mov r0, sp + lsls r4, 16 + asrs r4, 16 + subs r4, 0x7 + movs r6, 0 + strh r4, [r0, 0x4] + lsls r5, 16 + asrs r5, 16 + subs r5, 0x7 + strh r5, [r0, 0x6] + strb r6, [r0, 0x8] + movs r0, 0xB + strb r0, [r1, 0x9] + mov r2, sp + ldrb r1, [r2, 0xA] + subs r0, 0x1B + ands r0, r1 + strb r0, [r2, 0xA] + mov r0, sp + strb r6, [r0, 0xA] + strh r3, [r0, 0xC] + strh r3, [r0, 0xE] + str r3, [sp, 0x10] + strh r3, [r0, 0x14] + bl SpawnSpecialFieldObject + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 3 + adds r4, r5 + lsls r4, 2 + ldr r0, =0x02037350 + adds r4, r0 + ldrb r0, [r4, 0x2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r4, 0x2] + bl sub_8154228 + strb r0, [r4, 0x1B] + adds r0, r4, 0 + mov r1, r9 + bl FieldObjectTurn + bl ClearPlayerAvatarInfo + ldr r0, =0x02037590 + strb r6, [r0, 0x2] + strb r6, [r0, 0x3] + strb r5, [r0, 0x5] + ldrb r1, [r4, 0x4] + strb r1, [r0, 0x4] + mov r1, r8 + strb r1, [r0, 0x7] + movs r0, 0x21 + bl SetPlayerAvatarStateMask + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end InitPlayerAvatar + + thumb_func_start sub_808C0A8 +sub_808C0A8: @ 808C0A8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r6, =0x02037350 + ldr r5, =0x02037590 + ldrb r0, [r5, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + movs r0, 0x1 + ands r4, r0 + lsls r3, r4, 5 + ldrb r2, [r1, 0x1] + movs r0, 0x21 + negs r0, r0 + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x1] + movs r0, 0x8 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + beq _0808C100 + ldr r2, =0x02020630 + ldrb r1, [r5, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x1A] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x3E + lsls r3, r4, 2 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r3 + strb r0, [r1] +_0808C100: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808C0A8 + + thumb_func_start sub_808C114 +sub_808C114: @ 808C114 + push {r4,r5,lr} + ldr r5, =0x02037590 + ldrb r0, [r5, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02037350 + adds r4, r0 + movs r0, 0x5 + bl GetPlayerAvatarGraphicsIdByStateId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetGraphicsId + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r1, 0 + bl StartObjectImageAnim + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808C114 + + thumb_func_start sub_808C15C +sub_808C15C: @ 808C15C + push {r4-r6,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r6, =0x02037590 + ldrb r0, [r6, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02037350 + adds r4, r0 + movs r0, 0x6 + bl GetPlayerAvatarGraphicsIdByStateId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetGraphicsId + ldrb r0, [r6, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + adds r0, r5, 0 + bl sub_8092A0C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808C15C + + thumb_func_start sub_808C1B4 +sub_808C1B4: @ 808C1B4 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r6, =0x02037590 + ldrb r0, [r6, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02037350 + adds r4, r0 + movs r0, 0x2 + bl GetPlayerAvatarGraphicsIdByStateId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetGraphicsId + ldrb r0, [r6, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + mov r8, r0 + add r4, r8 + adds r0, r5, 0 + bl sub_80929BC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + ldrb r1, [r6, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + movs r1, 0x1 + bl SeekObjectImageAnim + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808C1B4 + + thumb_func_start sub_808C228 +sub_808C228: @ 808C228 + push {r4-r6,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r6, =0x02037590 + ldrb r0, [r6, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02037350 + adds r4, r0 + movs r0, 0x7 + bl GetPlayerAvatarGraphicsIdByStateId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetGraphicsId + ldrb r0, [r6, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + adds r0, r5, 0 + bl FieldObjectDirectionToImageAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808C228 + + thumb_func_start sub_808C280 +sub_808C280: @ 808C280 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + adds r5, r0, 0 + ldrb r0, [r5, 0x1E] + mov r8, r0 + movs r1, 0 + mov r0, sp + strh r1, [r0] + movs r6, 0x1 + ldr r1, =gUnknown_08497520 + mov r9, r1 + mov r4, sp + mov r7, sp + adds r7, 0x2 +_0808C2A2: + movs r1, 0 + ldrsh r0, [r4, r1] + lsls r0, 2 + add r0, r9 + ldr r1, [r0] + mov r0, r8 + bl _call_via_r1 + lsls r0, 24 + cmp r0, 0 + beq _0808C2E8 + ldrb r0, [r5, 0x18] + lsrs r0, 4 + cmp r6, r0 + bne _0808C2E8 + ldrh r0, [r5, 0x10] + strh r0, [r4] + ldrh r0, [r5, 0x12] + strh r0, [r7] + adds r0, r6, 0 + mov r1, sp + adds r2, r7, 0 + bl MoveCoords + ldrb r0, [r5, 0x1B] + movs r1, 0 + ldrsh r2, [r4, r1] + movs r1, 0 + ldrsh r3, [r7, r1] + adds r1, r6, 0 + bl sub_8154298 + b _0808C302 + .pool +_0808C2E8: + ldrh r1, [r4] + adds r1, 0x1 + strh r1, [r4] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x3 + ble _0808C2A2 + ldrb r0, [r5, 0x1B] + bl objid_set_invisible +_0808C302: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_808C280 + + thumb_func_start task_add_bump_boulder +task_add_bump_boulder: @ 808C310 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r6, =taskFF_bump_boulder + adds r0, r6, 0 + movs r1, 0xFF + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0xA] + strh r5, [r1, 0xC] + bl _call_via_r6 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end task_add_bump_boulder + + thumb_func_start taskFF_bump_boulder +taskFF_bump_boulder: @ 808C34C + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r6, =gUnknown_08497530 + ldr r2, =0x03005e00 + ldr r5, =0x02037350 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0808C360: + movs r0, 0x8 + ldrsh r3, [r4, r0] + lsls r3, 2 + adds r3, r6 + ldr r0, =0x02037590 + ldrb r0, [r0, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + movs r2, 0xA + ldrsh r0, [r4, r2] + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 2 + adds r2, r5 + ldr r3, [r3] + adds r0, r4, 0 + bl _call_via_r3 + lsls r0, 24 + cmp r0, 0 + bne _0808C360 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end taskFF_bump_boulder + + thumb_func_start sub_808C3A4 +sub_808C3A4: @ 808C3A4 + push {r4,lr} + adds r4, r0, 0 + bl script_env_2_enable + ldr r1, =0x02037590 + movs r0, 0x1 + strb r0, [r1, 0x6] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_808C3A4 + + thumb_func_start do_boulder_dust +@ int do_boulder_dust(int a1, struct npc_state *a2, struct npc_state *a3) +do_boulder_dust: @ 808C3C4 + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r1, 0 + adds r4, r2, 0 + adds r0, r5, 0 + bl FieldObjectIsSpecialAnimActive + lsls r0, 24 + cmp r0, 0 + beq _0808C3DE + adds r0, r5, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished +_0808C3DE: + adds r0, r4, 0 + bl FieldObjectIsSpecialAnimActive + lsls r0, 24 + cmp r0, 0 + beq _0808C3F0 + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished +_0808C3F0: + adds r0, r5, 0 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + cmp r0, 0 + bne _0808C472 + adds r0, r4, 0 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + cmp r0, 0 + bne _0808C472 + adds r0, r5, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + ldrb r0, [r6, 0xC] + bl GetStepInPlaceDelay16AnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl FieldObjectSetSpecialAnim + ldrb r0, [r6, 0xC] + bl GetSimpleGoAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim + ldr r2, =0x02038c08 + movs r1, 0x10 + ldrsh r0, [r4, r1] + str r0, [r2] + movs r1, 0x12 + ldrsh r0, [r4, r1] + str r0, [r2, 0x4] + ldrb r0, [r4, 0xB] + lsrs r0, 4 + str r0, [r2, 0x8] + ldr r3, =0x02020630 + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x5] + lsls r0, 28 + lsrs r0, 30 + str r0, [r2, 0xC] + movs r0, 0xA + bl FieldEffectStart + movs r0, 0xD6 + bl audio_play + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] +_0808C472: + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end do_boulder_dust + + thumb_func_start sub_808C484 +sub_808C484: @ 808C484 + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + adds r0, r4, 0 + bl FieldObjectCheckIfSpecialAnimFinishedOrInactive + lsls r0, 24 + cmp r0, 0 + beq _0808C4C6 + adds r0, r5, 0 + bl FieldObjectCheckIfSpecialAnimFinishedOrInactive + lsls r0, 24 + cmp r0, 0 + beq _0808C4C6 + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + adds r0, r5, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + ldr r1, =0x02037590 + movs r0, 0 + strb r0, [r1, 0x6] + bl script_env_2_disable + ldr r0, =taskFF_bump_boulder + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_0808C4C6: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_808C484 + + thumb_func_start sub_808C4D8 +sub_808C4D8: @ 808C4D8 + push {r4,lr} + ldr r4, =sub_808C4F8 + adds r0, r4, 0 + movs r1, 0xFF + bl AddTask + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808C4D8 + + thumb_func_start sub_808C4F8 +sub_808C4F8: @ 808C4F8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_0849753C + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0808C50A: + movs r0, 0x8 + ldrsh r2, [r4, r0] + lsls r2, 2 + adds r2, r5 + ldr r0, =0x02037590 + ldrb r0, [r0, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02037350 + adds r1, r0 + ldr r2, [r2] + adds r0, r4, 0 + bl _call_via_r2 + lsls r0, 24 + cmp r0, 0 + bne _0808C50A + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808C4F8 + + thumb_func_start sub_808C544 +sub_808C544: @ 808C544 + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + ldr r5, =0x02037590 + movs r0, 0x1 + strb r0, [r5, 0x6] + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _0808C5A0 + movs r0, 0xA + bl audio_play + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl sub_80934BC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim + ldrh r0, [r6, 0xA] + adds r0, 0x1 + strh r0, [r6, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0808C5A0 + movs r0, 0 + strb r0, [r5, 0x6] + ldrb r0, [r5, 0x1] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r5, 0x1] + ldr r0, =sub_808C4F8 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_0808C5A0: + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_808C544 + + thumb_func_start sub_808C5B0 +sub_808C5B0: @ 808C5B0 + push {r4,lr} + ldr r4, =sub_808C5D0 + adds r0, r4, 0 + movs r1, 0xFF + bl AddTask + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808C5B0 + + thumb_func_start sub_808C5D0 +sub_808C5D0: @ 808C5D0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_08497540 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0808C5E2: + movs r0, 0x8 + ldrsh r2, [r4, r0] + lsls r2, 2 + adds r2, r5 + ldr r0, =0x02037590 + ldrb r0, [r0, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02037350 + adds r1, r0 + ldr r2, [r2] + adds r0, r4, 0 + bl _call_via_r2 + lsls r0, 24 + cmp r0, 0 + bne _0808C5E2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808C5D0 + + thumb_func_start sub_808C61C +sub_808C61C: @ 808C61C + push {lr} + ldrh r2, [r0, 0x8] + adds r2, 0x1 + strh r2, [r0, 0x8] + ldrb r1, [r1, 0x18] + lsrs r1, 4 + strh r1, [r0, 0xA] + ldr r1, =0x02037590 + movs r0, 0x1 + strb r0, [r1, 0x6] + bl script_env_2_enable + movs r0, 0x2D + bl audio_play + movs r0, 0x1 + pop {r1} + bx r1 + .pool + thumb_func_end sub_808C61C + + thumb_func_start sub_808C644 +sub_808C644: @ 808C644 + push {r4-r6,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_08497550 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r0, r5, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _0808C6AC + ldrb r0, [r5, 0x18] + lsrs r0, 4 + subs r0, 0x1 + add r0, sp + ldrb r6, [r0] + adds r0, r6, 0 + bl GetFaceDirectionAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl FieldObjectSetSpecialAnim + ldrb r0, [r4, 0xA] + cmp r6, r0 + bne _0808C68A + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] +_0808C68A: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0x3 + ble _0808C6AC + ldrb r0, [r4, 0xA] + bl GetOppositeDirection + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + bne _0808C6AC + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0808C6AC: + movs r0, 0 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_808C644 + + thumb_func_start sub_808C6BC +sub_808C6BC: @ 808C6BC + push {r4,r5,lr} + sub sp, 0x8 + adds r5, r0, 0 + adds r4, r1, 0 + ldr r1, =gUnknown_08497554 + mov r0, sp + movs r2, 0x5 + bl memcpy + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _0808C6EC + movs r1, 0xC + ldrsh r0, [r5, r1] + add r0, sp + ldrb r1, [r0] + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim + movs r0, 0x1 + strh r0, [r5, 0x8] +_0808C6EC: + movs r0, 0 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_808C6BC + + thumb_func_start sub_808C6FC +sub_808C6FC: @ 808C6FC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _0808C740 + ldrb r0, [r4, 0xA] + bl GetOppositeDirection + lsls r0, 24 + lsrs r0, 24 + bl GetSimpleGoAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl FieldObjectSetSpecialAnim + bl script_env_2_disable + ldr r1, =0x02037590 + movs r0, 0 + strb r0, [r1, 0x6] + ldr r0, =sub_808C5D0 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_0808C740: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_808C6FC + + thumb_func_start sub_808C750 +sub_808C750: @ 808C750 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl script_env_2_enable + bl sav1_reset_battle_music_maybe + bl sub_8085898 + ldr r2, =0x02037590 + ldrb r1, [r2] + movs r0, 0xF7 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x1 + strb r0, [r2, 0x6] + ldr r5, =taskFF_0805D1D4 + adds r0, r5, 0 + movs r1, 0xFF + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + bl _call_via_r5 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808C750 + + thumb_func_start taskFF_0805D1D4 +taskFF_0805D1D4: @ 808C7A8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r5, r0, r1 + adds r0, r5, 0 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + cmp r0, 0 + beq _0808C7D4 + adds r0, r5, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _0808C7FC +_0808C7D4: + ldrb r0, [r5, 0x1A] + movs r1, 0x2 + bl sub_81555AC + ldr r0, =0x03005e00 + lsls r4, r6, 2 + adds r4, r6 + lsls r4, 3 + adds r4, r0 + ldrb r0, [r4, 0x8] + bl sub_8093540 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl FieldObjectSetSpecialAnim + ldr r0, =sub_808C814 + str r0, [r4] +_0808C7FC: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end taskFF_0805D1D4 + + thumb_func_start sub_808C814 +sub_808C814: @ 808C814 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r6, =0x02037590 + ldrb r1, [r6, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _0808C87A + movs r0, 0 + bl GetPlayerAvatarGraphicsIdByStateId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetGraphicsId + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim + movs r0, 0 + strb r0, [r6, 0x6] + bl script_env_2_disable + ldrb r1, [r4, 0x1A] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + adds r0, r5, 0 + bl remove_task +_0808C87A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808C814 + + thumb_func_start StartFishing +StartFishing: @ 808C88C + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =Task_Fish + adds r0, r5, 0 + movs r1, 0xFF + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x26] + bl _call_via_r5 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end StartFishing + + thumb_func_start Task_Fish +Task_Fish: @ 808C8C0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_0849755C + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0808C8D2: + movs r1, 0x8 + ldrsh r0, [r4, r1] + lsls r0, 2 + adds r0, r5 + ldr r1, [r0] + adds r0, r4, 0 + bl _call_via_r1 + lsls r0, 24 + cmp r0, 0 + bne _0808C8D2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end Task_Fish + + thumb_func_start fish0 +fish0: @ 808C8F8 + push {r4,lr} + adds r4, r0, 0 + bl script_env_2_enable + ldr r1, =0x02037590 + movs r0, 0x1 + strb r0, [r1, 0x6] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end fish0 + + thumb_func_start fish1 +fish1: @ 808C918 + push {r4-r6,lr} + sub sp, 0x10 + adds r5, r0, 0 + ldr r1, =gUnknown_0849759C + mov r0, sp + movs r2, 0x6 + bl memcpy + add r4, sp, 0x8 + ldr r1, =gUnknown_084975A2 + adds r0, r4, 0 + movs r2, 0x6 + bl memcpy + movs r0, 0 + strh r0, [r5, 0x20] + bl GenerateRandomNumber + movs r2, 0x26 + ldrsh r1, [r5, r2] + lsls r1, 1 + mov r2, sp + adds r6, r2, r1 + lsls r0, 16 + lsrs r0, 16 + adds r4, r1 + movs r2, 0 + ldrsh r1, [r4, r2] + bl __modsi3 + ldrh r1, [r6] + adds r1, r0 + strh r1, [r5, 0x22] + ldr r3, =0x02037350 + ldr r2, =0x02037590 + ldrb r1, [r2, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x5] + strh r0, [r5, 0x24] + ldrb r0, [r2, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + adds r4, r3 + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimActive + ldrb r0, [r4, 0x1] + movs r1, 0x8 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl sub_808C15C + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0 + add sp, 0x10 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end fish1 + + thumb_func_start fish2 +fish2: @ 808C9B0 + push {r4,lr} + adds r4, r0, 0 + bl sub_808CF78 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3B + ble _0808C9CC + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0808C9CC: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end fish2 + + thumb_func_start fish3 +fish3: @ 808C9D4 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0 + movs r1, 0x1 + bl sub_819786C + ldrh r0, [r4, 0x8] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x8] + strh r1, [r4, 0xA] + strh r1, [r4, 0xC] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + adds r1, r0, 0 + adds r0, r1, 0x1 + strh r0, [r4, 0xE] + movs r2, 0x20 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _0808CA0C + adds r0, r1, 0x4 + strh r0, [r4, 0xE] +_0808CA0C: + movs r1, 0xE + ldrsh r0, [r4, r1] + cmp r0, 0x9 + ble _0808CA18 + movs r0, 0xA + strh r0, [r4, 0xE] +_0808CA18: + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + thumb_func_end fish3 + + thumb_func_start fish4 +fish4: @ 808CA20 + push {r4,r5,lr} + sub sp, 0x10 + adds r4, r0, 0 + ldr r1, =gUnknown_084975A8 + add r0, sp, 0xC + movs r2, 0x2 + bl memcpy + bl sub_808CF78 + ldrh r0, [r4, 0xA] + adds r1, r0, 0x1 + strh r1, [r4, 0xA] + ldr r0, =0x030022c0 + ldrh r0, [r0, 0x2E] + movs r5, 0x1 + adds r2, r5, 0 + ands r2, r0 + cmp r2, 0 + beq _0808CA64 + movs r0, 0xB + strh r0, [r4, 0x8] + movs r1, 0x20 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0808CA58 + movs r0, 0xC + strh r0, [r4, 0x8] +_0808CA58: + movs r0, 0x1 + b _0808CAB4 + .pool +_0808CA64: + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x13 + ble _0808CAB2 + strh r2, [r4, 0xA] + movs r3, 0xC + ldrsh r1, [r4, r3] + movs r3, 0xE + ldrsh r0, [r4, r3] + cmp r1, r0 + blt _0808CA94 + ldrh r0, [r4, 0x8] + adds r1, r0, 0x1 + strh r1, [r4, 0x8] + ldrh r2, [r4, 0x20] + movs r3, 0x20 + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _0808CA8E + adds r0, r1, 0x1 + strh r0, [r4, 0x8] +_0808CA8E: + adds r0, r2, 0x1 + strh r0, [r4, 0x20] + b _0808CAB2 +_0808CA94: + movs r0, 0xC + ldrsh r3, [r4, r0] + lsls r3, 27 + lsrs r3, 24 + str r5, [sp] + str r2, [sp, 0x4] + str r2, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + add r2, sp, 0xC + bl Print + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] +_0808CAB2: + movs r0, 0 +_0808CAB4: + add sp, 0x10 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end fish4 + + thumb_func_start fish5 +fish5: @ 808CABC + push {r4-r6,lr} + adds r5, r0, 0 + bl sub_808CF78 + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r6, 0 + bl GetFishingWildMonListHeader + lsls r0, 24 + cmp r0, 0 + bne _0808CADC + movs r0, 0xB + strh r0, [r5, 0x8] + b _0808CB5C +_0808CADC: + ldr r4, =0x020244ec + adds r0, r4, 0 + movs r1, 0x6 + bl pokemon_getattr + cmp r0, 0 + bne _0808CB14 + adds r0, r4, 0 + bl GetMonAbility + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x15 + beq _0808CAFC + cmp r0, 0x3C + bne _0808CB14 +_0808CAFC: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xE + bls _0808CB14 + movs r6, 0x1 +_0808CB14: + cmp r6, 0 + bne _0808CB32 + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0808CB30 + movs r0, 0xB + strh r0, [r5, 0x8] + b _0808CB32 + .pool +_0808CB30: + movs r6, 0x1 +_0808CB32: + cmp r6, 0x1 + bne _0808CB5C + ldr r0, =0x02037590 + ldrb r0, [r0, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + bl sub_8092A2C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim +_0808CB5C: + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end fish5 + + thumb_func_start fish6 +fish6: @ 808CB6C + push {r4,r5,lr} + sub sp, 0xC + adds r5, r0, 0 + bl sub_808CF78 + ldr r2, =gUnknown_085EE8F7 + movs r0, 0x11 + str r0, [sp] + movs r4, 0 + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r3, 0 + bl Print + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + strh r4, [r5, 0xA] + movs r0, 0 + add sp, 0xC + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end fish6 + + thumb_func_start fish7 +fish7: @ 808CBA4 + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r1, =gUnknown_084975AA + mov r0, sp + movs r2, 0x6 + bl memcpy + bl sub_808CF78 + ldrh r1, [r4, 0xA] + adds r1, 0x1 + strh r1, [r4, 0xA] + movs r2, 0x26 + ldrsh r0, [r4, r2] + lsls r0, 1 + add r0, sp + lsls r1, 16 + asrs r1, 16 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r1, r0 + blt _0808CBDC + movs r0, 0xC + b _0808CBEC + .pool +_0808CBDC: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0808CBEE + ldrh r0, [r4, 0x8] + adds r0, 0x1 +_0808CBEC: + strh r0, [r4, 0x8] +_0808CBEE: + movs r0, 0 + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end fish7 + + thumb_func_start fish8 +fish8: @ 808CBFC + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + ldr r1, =gUnknown_084975B0 + mov r0, sp + movs r2, 0xC + bl memcpy + bl sub_808CF78 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x20 + ldrsh r1, [r4, r0] + movs r2, 0x22 + ldrsh r0, [r4, r2] + cmp r1, r0 + blt _0808CC52 + cmp r1, 0x1 + bgt _0808CC56 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + movs r3, 0x20 + ldrsh r2, [r4, r3] + lsls r2, 1 + movs r3, 0x26 + ldrsh r1, [r4, r3] + lsls r1, 2 + adds r2, r1 + mov r3, sp + adds r1, r3, r2 + movs r2, 0 + ldrsh r1, [r1, r2] + lsls r0, 16 + asrs r0, 16 + cmp r1, r0 + ble _0808CC56 +_0808CC52: + movs r0, 0x3 + strh r0, [r4, 0x8] +_0808CC56: + movs r0, 0 + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end fish8 + + thumb_func_start fish9 +fish9: @ 808CC64 + push {r4,r5,lr} + sub sp, 0x10 + adds r4, r0, 0 + bl sub_808CF78 + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r2, =gUnknown_085EE903 + movs r5, 0 + str r5, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0 + movs r1, 0x1 + movs r3, 0x1 + bl AddTextPrinterParametrized + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + strh r5, [r4, 0xA] + movs r0, 0 + add sp, 0x10 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end fish9 + + thumb_func_start fishA_wait_for_a_pressed +fishA_wait_for_a_pressed: @ 808CCA8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0808CCBC + bl sub_808CF78 +_0808CCBC: + bl RunTextPrinters + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0808CD58 + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0 + bne _0808CD50 + ldr r7, =0x02037590 + ldrb r0, [r7, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02037350 + mov r8, r0 + add r4, r8 + ldrh r1, [r5, 0x24] + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetGraphicsId + ldrb r1, [r4, 0x18] + lsrs r1, 4 + adds r0, r4, 0 + bl FieldObjectTurn + ldrb r1, [r7] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0808CD1A + ldrb r0, [r7, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + add r1, r8 + ldrb r0, [r1, 0x1A] + movs r1, 0 + movs r2, 0 + bl sub_8155604 +_0808CD1A: + ldr r2, =0x02020630 + ldrb r1, [r7, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r6, [r0, 0x24] + ldrb r1, [r7, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r6, [r0, 0x26] + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + ldrh r0, [r5, 0xA] + adds r0, 0x1 + strh r0, [r5, 0xA] + b _0808CD80 + .pool +_0808CD50: + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _0808CD80 +_0808CD58: + ldr r1, =0x02037590 + movs r0, 0 + strb r0, [r1, 0x6] + bl script_env_2_disable + ldrh r0, [r5, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl sub_80B5734 + movs r0, 0x1 + bl sub_80ED950 + ldr r0, =Task_Fish + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_0808CD80: + movs r0, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end fishA_wait_for_a_pressed + + thumb_func_start fishB +fishB: @ 808CD94 + push {r4,r5,lr} + sub sp, 0x10 + adds r5, r0, 0 + bl sub_808CF78 + ldr r0, =0x02037590 + ldrb r0, [r0, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + bl sub_8092A1C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r2, =gUnknown_085EE91E + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0 + movs r1, 0x1 + movs r3, 0x1 + bl AddTextPrinterParametrized + movs r0, 0xD + strh r0, [r5, 0x8] + movs r0, 0x1 + add sp, 0x10 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end fishB + + thumb_func_start fishC +fishC: @ 808CE04 + push {r4,r5,lr} + sub sp, 0x10 + adds r5, r0, 0 + bl sub_808CF78 + ldr r0, =0x02037590 + ldrb r0, [r0, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + bl sub_8092A1C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r2, =gUnknown_085EE933 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0 + movs r1, 0x1 + movs r3, 0x1 + bl AddTextPrinterParametrized + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0x1 + add sp, 0x10 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end fishC + + thumb_func_start fishD +fishD: @ 808CE74 + push {r4,lr} + adds r4, r0, 0 + bl sub_808CF78 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end fishD + + thumb_func_start fishE +fishE: @ 808CE8C + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + bl sub_808CF78 + ldr r7, =0x02020630 + ldr r5, =0x02037590 + ldrb r0, [r5, 0x4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + adds r1, 0x3F + ldrb r0, [r1] + lsls r0, 27 + cmp r0, 0 + bge _0808CF12 + ldrb r0, [r5, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02037350 + mov r8, r0 + add r4, r8 + ldrh r1, [r6, 0x24] + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetGraphicsId + ldrb r1, [r4, 0x18] + lsrs r1, 4 + adds r0, r4, 0 + bl FieldObjectTurn + ldrb r1, [r5] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0808CEF2 + ldrb r0, [r5, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + add r1, r8 + ldrb r0, [r1, 0x1A] + movs r1, 0 + movs r2, 0 + bl sub_8155604 +_0808CEF2: + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + movs r2, 0 + strh r2, [r0, 0x24] + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] +_0808CF12: + movs r0, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end fishE + + thumb_func_start fishF +fishF: @ 808CF2C + push {lr} + bl RunTextPrinters + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _0808CF68 + ldr r0, =0x02037590 + strb r1, [r0, 0x6] + bl script_env_2_disable + bl sub_809757C + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + movs r0, 0 + bl sub_80ED950 + ldr r0, =Task_Fish + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_0808CF68: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end fishF + + thumb_func_start sub_808CF78 +sub_808CF78: @ 808CF78 + push {r4-r7,lr} + ldr r0, =0x02037590 + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r4, r0, r1 + adds r0, r4, 0 + bl AnimateObject + movs r0, 0 + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + adds r0, r4, 0 + adds r0, 0x2B + ldrb r5, [r0] + movs r0, 0x2A + adds r0, r4 + mov r12, r0 + ldrb r0, [r0] + ldr r1, [r4, 0x8] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + lsls r6, r5, 2 + adds r0, r6, r0 + movs r1, 0 + ldrsh r0, [r0, r1] + movs r7, 0x1 + negs r7, r7 + cmp r0, r7 + beq _0808CFEA + adds r3, r4, 0 + adds r3, 0x2C + ldrb r2, [r3] + lsls r1, r2, 26 + lsrs r1, 26 + adds r1, 0x1 + movs r0, 0x3F + ands r1, r0 + movs r0, 0x40 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + mov r1, r12 + ldrb r0, [r1] + ldr r1, [r4, 0x8] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + adds r0, r6, r0 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, r7 + bne _0808CFF0 +_0808CFEA: + subs r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_0808CFF0: + adds r0, r4, 0 + adds r0, 0x2A + ldrb r0, [r0] + ldr r1, [r4, 0x8] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + lsls r0, r5, 2 + adds r0, r1 + ldrb r5, [r0] + subs r0, r5, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bhi _0808D022 + movs r0, 0x8 + strh r0, [r4, 0x24] + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _0808D022 + ldr r0, =0x0000fff8 + strh r0, [r4, 0x24] +_0808D022: + cmp r5, 0x5 + bne _0808D02A + ldr r0, =0x0000fff8 + strh r0, [r4, 0x26] +_0808D02A: + adds r0, r5, 0 + subs r0, 0xA + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0808D03A + movs r0, 0x8 + strh r0, [r4, 0x26] +_0808D03A: + ldr r3, =0x02037590 + ldrb r1, [r3] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0808D05E + ldr r2, =0x02037350 + ldrb r1, [r3, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1A] + movs r1, 0x26 + ldrsh r2, [r4, r1] + movs r1, 0x1 + bl sub_8155604 +_0808D05E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808CF78 + + thumb_func_start sub_808D074 +sub_808D074: @ 808D074 + ldr r1, =0x0203734c + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_808D074 + + thumb_func_start sub_808D080 +sub_808D080: @ 808D080 + push {lr} + ldr r1, =0x0203734c + ldrb r0, [r1] + cmp r0, 0 + bne _0808D08C + movs r0, 0x1 +_0808D08C: + pop {r1} + bx r1 + .pool + thumb_func_end sub_808D080 + + thumb_func_start sub_808D094 +sub_808D094: @ 808D094 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + adds r2, r0, 0 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r7, r0, r1 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r5, r0, r1 + movs r0, 0 + ldrsh r6, [r5, r0] + cmp r6, 0x1 + beq _0808D14A + cmp r6, 0x1 + bgt _0808D0E8 + cmp r6, 0 + beq _0808D0EE + b _0808D18A + .pool +_0808D0E8: + cmp r6, 0x2 + beq _0808D184 + b _0808D18A +_0808D0EE: + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _0808D18A + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl sub_808D074 + movs r1, 0 + mov r8, r1 + strh r6, [r5, 0x2] + movs r0, 0x1 + strh r0, [r5, 0x4] + ldrh r0, [r7, 0x26] + ldrh r2, [r7, 0x22] + adds r0, r2 + lsls r0, 4 + strh r0, [r5, 0x6] + strh r6, [r7, 0x26] + bl CameraObjectReset2 + ldrb r0, [r4, 0x3] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4, 0x3] + ldrb r1, [r7, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + strb r0, [r7, 0x5] + adds r0, r7, 0 + adds r0, 0x43 + mov r1, r8 + strb r1, [r0] + adds r2, r7, 0 + adds r2, 0x42 + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + strb r0, [r2] + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] +_0808D14A: + adds r1, r5, 0x2 + adds r0, r4, 0 + bl sub_808D38C + ldrh r0, [r5, 0x6] + ldrh r1, [r5, 0x4] + subs r0, r1 + strh r0, [r5, 0x6] + adds r1, 0x3 + strh r1, [r5, 0x4] + lsls r0, 16 + asrs r0, 20 + strh r0, [r7, 0x22] + movs r2, 0x22 + ldrsh r1, [r7, r2] + ldr r0, =0x03005de8 + movs r2, 0 + ldrsh r0, [r0, r2] + adds r1, r0 + movs r0, 0x20 + negs r0, r0 + cmp r1, r0 + bge _0808D18A + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + b _0808D18A + .pool +_0808D184: + adds r0, r2, 0 + bl remove_task +_0808D18A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_808D094 + + thumb_func_start sub_808D194 +sub_808D194: @ 808D194 + push {r4,lr} + ldr r4, =sub_808D1FC + adds r0, r4, 0 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808D194 + + thumb_func_start sub_808D1B4 +sub_808D1B4: @ 808D1B4 + push {lr} + ldr r0, =sub_808D1FC + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_808D1B4 + + thumb_func_start sub_808D1C8 +sub_808D1C8: @ 808D1C8 + push {r4,lr} + ldr r4, =sub_808D094 + adds r0, r4, 0 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808D1C8 + + thumb_func_start sub_808D1E8 +sub_808D1E8: @ 808D1E8 + push {lr} + ldr r0, =sub_808D094 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_808D1E8 + + thumb_func_start sub_808D1FC +sub_808D1FC: @ 808D1FC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r7, r0, r1 + mov r1, r8 + lsls r0, r1, 2 + add r0, r8 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r5, r0, r1 + movs r2, 0 + ldrsh r6, [r5, r2] + cmp r6, 0x1 + beq _0808D2DE + cmp r6, 0x1 + bgt _0808D254 + cmp r6, 0 + beq _0808D25E + b _0808D37E + .pool +_0808D254: + cmp r6, 0x2 + beq _0808D31C + cmp r6, 0x3 + beq _0808D33A + b _0808D37E +_0808D25E: + bl sub_808D080 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0xA] + ldr r1, =gUnknown_084975BC + movs r3, 0xA + ldrsh r0, [r5, r3] + adds r0, r1 + ldrb r0, [r0] + bl GetFaceDirectionAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectForceSetSpecialAnim + movs r0, 0 + mov r9, r0 + strh r6, [r5, 0x2] + movs r0, 0x74 + strh r0, [r5, 0x4] + ldrh r0, [r7, 0x22] + strh r0, [r5, 0x8] + ldrb r0, [r7, 0x5] + lsls r0, 28 + lsrs r0, 30 + strh r0, [r5, 0xC] + movs r1, 0x43 + adds r1, r7 + mov r8, r1 + ldrb r0, [r1] + strh r0, [r5, 0xE] + ldrh r0, [r7, 0x26] + adds r0, 0x20 + negs r0, r0 + lsls r0, 4 + strh r0, [r5, 0x6] + strh r6, [r7, 0x26] + bl CameraObjectReset2 + ldrb r0, [r4, 0x3] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r4, 0x3] + ldrb r1, [r7, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + orrs r0, r2 + strb r0, [r7, 0x5] + mov r3, r9 + mov r2, r8 + strb r3, [r2] + adds r2, r7, 0 + adds r2, 0x42 + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + strb r0, [r2] + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] +_0808D2DE: + adds r1, r5, 0x2 + adds r0, r4, 0 + bl sub_808D38C + ldrh r0, [r5, 0x4] + ldrh r2, [r5, 0x6] + adds r1, r0, r2 + strh r1, [r5, 0x6] + subs r0, 0x3 + strh r0, [r5, 0x4] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + bgt _0808D2FE + movs r0, 0x4 + strh r0, [r5, 0x4] +_0808D2FE: + ldrh r0, [r5, 0x6] + lsls r0, 16 + asrs r0, 20 + strh r0, [r7, 0x22] + ldrh r2, [r5, 0x8] + movs r3, 0x8 + ldrsh r1, [r5, r3] + cmp r0, r1 + blt _0808D37E + strh r2, [r7, 0x22] + movs r0, 0 + strh r0, [r5, 0x10] + b _0808D332 + .pool +_0808D31C: + adds r1, r5, 0x2 + adds r0, r4, 0 + bl sub_808D38C + ldrh r0, [r5, 0x10] + adds r0, 0x1 + strh r0, [r5, 0x10] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _0808D37E +_0808D332: + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + b _0808D37E +_0808D33A: + movs r0, 0xA + ldrsh r6, [r5, r0] + adds r1, r5, 0x2 + adds r0, r4, 0 + bl sub_808D38C + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + bne _0808D37E + ldrb r1, [r4, 0x3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x3] + movs r0, 0x3 + ldrb r1, [r5, 0xC] + ands r1, r0 + lsls r1, 2 + ldrb r2, [r7, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r7, 0x5] + ldrh r1, [r5, 0xE] + adds r0, r7, 0 + adds r0, 0x43 + strb r1, [r0] + bl CameraObjectReset1 + mov r0, r8 + bl remove_task +_0808D37E: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_808D1FC + + thumb_func_start sub_808D38C +sub_808D38C: @ 808D38C + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + ldrh r1, [r6] + movs r2, 0 + ldrsh r0, [r6, r2] + cmp r0, 0x7 + bgt _0808D3A8 + adds r0, r1, 0x1 + strh r0, [r6] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _0808D3E4 +_0808D3A8: + adds r0, r5, 0 + bl FieldObjectCheckIfSpecialAnimFinishedOrInactive + lsls r0, 24 + cmp r0, 0 + beq _0808D3E4 + ldr r4, =gUnknown_084975BC + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + adds r0, r4 + ldrb r0, [r0] + bl GetFaceDirectionAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl FieldObjectForceSetSpecialAnim + movs r0, 0 + strh r0, [r6] + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + adds r0, r4 + ldrb r0, [r0] + b _0808D3EA + .pool +_0808D3E4: + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 +_0808D3EA: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_808D38C + + thumb_func_start npc_clear_ids_and_state +npc_clear_ids_and_state: @ 808D3F0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0 + movs r2, 0x24 + bl memset + movs r0, 0xFF + strb r0, [r4, 0x8] + movs r0, 0x1 + negs r0, r0 + strb r0, [r4, 0x9] + strb r0, [r4, 0xA] + strb r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + thumb_func_end npc_clear_ids_and_state + + thumb_func_start npcs_clear_ids_and_state +npcs_clear_ids_and_state: @ 808D410 + push {r4,r5,lr} + movs r4, 0 + ldr r5, =0x02037350 +_0808D416: + lsls r0, r4, 3 + adds r0, r4 + lsls r0, 2 + adds r0, r5 + bl npc_clear_ids_and_state + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _0808D416 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end npcs_clear_ids_and_state + + thumb_func_start sub_808D438 +sub_808D438: @ 808D438 + push {lr} + bl strange_npc_table_clear + bl npcs_clear_ids_and_state + bl ClearPlayerAvatarInfo + bl sub_808D450 + pop {r0} + bx r0 + thumb_func_end sub_808D438 + + thumb_func_start sub_808D450 +sub_808D450: @ 808D450 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + ldr r0, =gFieldEffectObjectTemplatePointers + ldr r0, [r0, 0x54] + mov r9, r0 + movs r1, 0 + movs r2, 0 + movs r3, 0x1F + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02020630 + mov r10, r1 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + add r4, r10 + ldrb r1, [r4, 0x1] + movs r5, 0x4 + negs r5, r5 + adds r0, r5, 0 + ands r0, r1 + movs r1, 0x1 + mov r8, r1 + mov r1, r8 + orrs r0, r1 + strb r0, [r4, 0x1] + adds r0, r4, 0 + bl obj_alloc_rotscale_entry + adds r0, r4, 0 + movs r1, 0 + bl StartObjectRotScalAnim + adds r4, 0x3E + ldrb r0, [r4] + movs r6, 0x4 + orrs r0, r6 + strb r0, [r4] + mov r0, r9 + movs r1, 0 + movs r2, 0 + movs r3, 0x1F + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + add r4, r10 + ldrb r0, [r4, 0x1] + ands r5, r0 + mov r0, r8 + orrs r5, r0 + strb r5, [r4, 0x1] + adds r0, r4, 0 + bl obj_alloc_rotscale_entry + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim + adds r4, 0x3E + ldrb r0, [r4] + orrs r0, r6 + strb r0, [r4] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808D450 + + thumb_func_start sub_808D4F4 +sub_808D4F4: @ 808D4F4 + push {lr} + movs r1, 0 + ldr r2, =0x02037350 + ldrb r0, [r2] + b _0808D518 + .pool +_0808D504: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xF + bhi _0808D51E + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] +_0808D518: + lsls r0, 31 + cmp r0, 0 + bne _0808D504 +_0808D51E: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end sub_808D4F4 + + thumb_func_start GetFieldObjectIdByLocalIdAndMap +@ u8 GetFieldObjectIdByLocalIdAndMap(u8 localId, u8 mapId, u8 mapGroupId) +GetFieldObjectIdByLocalIdAndMap: @ 808D524 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + cmp r0, 0xFE + bls _0808D53C + bl GetFieldObjectIdByLocalId + b _0808D540 +_0808D53C: + bl GetFieldObjectIdByLocalIdAndMapInternal +_0808D540: + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end GetFieldObjectIdByLocalIdAndMap + + thumb_func_start TryGetFieldObjectIdByLocalIdAndMap +@ bool8 TryGetFieldObjectIdByLocalIdAndMap(u8 localId, u8 mapId, u8 mapGroupId, u8 *fieldObjectId) +TryGetFieldObjectIdByLocalIdAndMap: @ 808D548 + push {r4,lr} + adds r4, r3, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + bl GetFieldObjectIdByLocalIdAndMap + strb r0, [r4] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x10 + beq _0808D56A + movs r0, 0 + b _0808D56C +_0808D56A: + movs r0, 0x1 +_0808D56C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end TryGetFieldObjectIdByLocalIdAndMap + + thumb_func_start GetFieldObjectIdByXY +@ u8 GetFieldObjectIdByXY(s16 x, s16 y) +GetFieldObjectIdByXY: @ 808D574 + push {r4-r6,lr} + movs r3, 0 + ldr r5, =0x02037350 + lsls r0, 16 + asrs r4, r0, 16 + lsls r1, 16 + asrs r1, 16 +_0808D582: + lsls r0, r3, 3 + adds r0, r3 + lsls r0, 2 + adds r2, r0, r5 + ldrb r0, [r2] + lsls r0, 31 + cmp r0, 0 + beq _0808D5A2 + movs r6, 0x10 + ldrsh r0, [r2, r6] + cmp r0, r4 + bne _0808D5A2 + movs r6, 0x12 + ldrsh r0, [r2, r6] + cmp r0, r1 + beq _0808D5AC +_0808D5A2: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0xF + bls _0808D582 +_0808D5AC: + adds r0, r3, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end GetFieldObjectIdByXY + + thumb_func_start GetFieldObjectIdByLocalIdAndMapInternal +@ u8 GetFieldObjectIdByLocalIdAndMapInternal(u8 localId, u8 mapId, u8 mapGroupId) +GetFieldObjectIdByLocalIdAndMapInternal: @ 808D5B8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + lsls r2, 24 + lsrs r2, 24 + movs r1, 0 + ldr r6, =0x02037350 +_0808D5CA: + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r3, r0, r6 + ldrb r0, [r3] + lsls r0, 31 + cmp r0, 0 + beq _0808D5F4 + ldrb r0, [r3, 0x8] + cmp r0, r5 + bne _0808D5F4 + ldrb r0, [r3, 0x9] + cmp r0, r4 + bne _0808D5F4 + ldrb r0, [r3, 0xA] + cmp r0, r2 + bne _0808D5F4 + adds r0, r1, 0 + b _0808D600 + .pool +_0808D5F4: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xF + bls _0808D5CA + movs r0, 0x10 +_0808D600: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end GetFieldObjectIdByLocalIdAndMapInternal + + thumb_func_start GetFieldObjectIdByLocalId +@ u8 GetFieldObjectIdByLocalId(u8 localId) +GetFieldObjectIdByLocalId: @ 808D608 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + movs r2, 0 + ldr r4, =0x02037350 +_0808D612: + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + adds r1, r0, r4 + ldrb r0, [r1] + lsls r0, 31 + cmp r0, 0 + beq _0808D630 + ldrb r0, [r1, 0x8] + cmp r0, r3 + bne _0808D630 + adds r0, r2, 0 + b _0808D63C + .pool +_0808D630: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xF + bls _0808D612 + movs r0, 0x10 +_0808D63C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end GetFieldObjectIdByLocalId + + thumb_func_start InitFieldObjectStateFromTemplate +@ u8 InitFieldObjectStateFromTemplate(struct FieldObjectTemplate *fieldObjectTemplate, u8 mapId, u8 mapGroupId) +InitFieldObjectStateFromTemplate: @ 808D644 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + adds r5, r0, 0 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r7, r2, 24 + ldrb r0, [r5] + adds r1, r6, 0 + adds r2, r7, 0 + mov r3, sp + bl GetAvailableFieldObjectSlot + lsls r0, 24 + cmp r0, 0 + beq _0808D66E + movs r0, 0x10 + b _0808D762 +_0808D66E: + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + adds r0, r4, 0 + bl npc_clear_ids_and_state + ldrh r3, [r5, 0x4] + adds r3, 0x7 + lsls r3, 16 + lsrs r3, 16 + ldrh r2, [r5, 0x6] + adds r2, 0x7 + lsls r2, 16 + lsrs r2, 16 + ldrb r0, [r4] + movs r1, 0x1 + orrs r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4] + ldrb r0, [r5, 0x1] + strb r0, [r4, 0x5] + ldrb r0, [r5, 0x9] + strb r0, [r4, 0x6] + ldrb r0, [r5] + strb r0, [r4, 0x8] + strb r6, [r4, 0x9] + strb r7, [r4, 0xA] + strh r3, [r4, 0xC] + strh r2, [r4, 0xE] + strh r3, [r4, 0x10] + strh r2, [r4, 0x12] + strh r3, [r4, 0x14] + strh r2, [r4, 0x16] + ldrb r0, [r5, 0x8] + movs r7, 0xF + adds r1, r7, 0 + ands r1, r0 + ldrb r2, [r4, 0xB] + movs r0, 0x10 + negs r0, r0 + mov r8, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0xB] + ldrb r1, [r5, 0x8] + lsls r1, 4 + ands r0, r7 + orrs r0, r1 + strb r0, [r4, 0xB] + ldrb r1, [r5, 0xA] + lsls r1, 28 + movs r0, 0xF + mov r9, r0 + lsrs r1, 28 + ldrb r2, [r4, 0x19] + mov r0, r8 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x19] + ldrb r1, [r5, 0xA] + lsrs r1, 4 + lsls r1, 4 + ands r0, r7 + orrs r0, r1 + strb r0, [r4, 0x19] + ldrh r0, [r5, 0xC] + strb r0, [r4, 0x7] + ldrh r0, [r5, 0xE] + strb r0, [r4, 0x1D] + ldr r1, =gUnknown_085055CD + ldrb r0, [r5, 0x9] + adds r0, r1 + ldrb r1, [r0] + adds r0, r4, 0 + adds r0, 0x20 + strb r1, [r0] + ldrb r1, [r0] + adds r0, r4, 0 + bl FieldObjectSetDirection + adds r0, r4, 0 + bl FieldObjectHandleDynamicGraphicsId + ldr r1, =gUnknown_0850557C + ldrb r0, [r4, 0x6] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0808D75E + ldrb r2, [r4, 0x19] + adds r0, r7, 0 + ands r0, r2 + cmp r0, 0 + bne _0808D746 + lsls r0, r2, 28 + lsrs r0, 28 + adds r0, 0x1 + mov r1, r9 + ands r0, r1 + mov r1, r8 + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0x19] +_0808D746: + ldrb r2, [r4, 0x19] + movs r0, 0xF0 + ands r0, r2 + cmp r0, 0 + bne _0808D75E + lsrs r1, r2, 4 + adds r1, 0x1 + lsls r1, 4 + adds r0, r7, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x19] +_0808D75E: + mov r0, sp + ldrb r0, [r0] +_0808D762: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end InitFieldObjectStateFromTemplate + + thumb_func_start sub_808D77C +sub_808D77C: @ 808D77C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r4, =0x02037318 + ldr r0, [r4, 0x4] + cmp r0, 0 + beq _0808D7FE + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _0808D7A8 + bl sub_81AAA40 + lsls r0, 24 + lsrs r6, r0, 24 + b _0808D7CA + .pool +_0808D7A8: + bl InTrainerHill + cmp r0, 0 + beq _0808D7C6 + movs r6, 0x2 + b _0808D7CA +_0808D7B4: + ldr r0, [r7] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + adds r0, r4, 0 + bl InitFieldObjectStateFromTemplate + lsls r0, 24 + lsrs r0, 24 + b _0808D800 +_0808D7C6: + ldr r0, [r4, 0x4] + ldrb r6, [r0] +_0808D7CA: + movs r5, 0 + cmp r5, r6 + bcs _0808D7FE + ldr r7, =0x03005d8c +_0808D7D2: + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 3 + movs r1, 0xC7 + lsls r1, 4 + adds r0, r1 + ldr r1, [r7] + adds r4, r1, r0 + ldrb r0, [r4] + cmp r0, r8 + bne _0808D7F4 + ldrh r0, [r4, 0x14] + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0808D7B4 +_0808D7F4: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r6 + bcc _0808D7D2 +_0808D7FE: + movs r0, 0x10 +_0808D800: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_808D77C + + thumb_func_start GetAvailableFieldObjectSlot +@ bool8 GetAvailableFieldObjectSlot(u16 localId, u8 mapId, u8 mapGroupId, u8 *fieldObjectId) +GetAvailableFieldObjectSlot: @ 808D810 + push {r4-r7,lr} + mov r12, r3 + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r4, r2, 24 + movs r2, 0 + ldr r1, =0x02037350 + ldrb r0, [r1] + lsls r0, 31 + adds r7, r1, 0 + cmp r0, 0 + beq _0808D864 + adds r3, r1, 0 +_0808D830: + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + adds r1, r0, r3 + ldrb r0, [r1, 0x8] + cmp r0, r6 + bne _0808D84A + ldrb r0, [r1, 0x9] + cmp r0, r5 + bne _0808D84A + ldrb r0, [r1, 0xA] + cmp r0, r4 + beq _0808D868 +_0808D84A: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xF + bhi _0808D868 + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + adds r0, r7 + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + bne _0808D830 +_0808D864: + cmp r2, 0xF + bls _0808D870 +_0808D868: + movs r0, 0x1 + b _0808D8A4 + .pool +_0808D870: + mov r0, r12 + strb r2, [r0] + ldr r1, =0x02037350 +_0808D876: + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + adds r3, r0, r1 + ldrb r0, [r3] + lsls r0, 31 + cmp r0, 0 + beq _0808D898 + ldrb r0, [r3, 0x8] + cmp r0, r6 + bne _0808D898 + ldrb r0, [r3, 0x9] + cmp r0, r5 + bne _0808D898 + ldrb r0, [r3, 0xA] + cmp r0, r4 + beq _0808D868 +_0808D898: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xF + bls _0808D876 + movs r0, 0 +_0808D8A4: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end GetAvailableFieldObjectSlot + + thumb_func_start RemoveFieldObject +@ void RemoveFieldObject(npc_state *fieldObject) +RemoveFieldObject: @ 808D8B0 + push {lr} + ldrb r2, [r0] + movs r1, 0x2 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + bl RemoveFieldObjectInternal + pop {r0} + bx r0 + thumb_func_end RemoveFieldObject + + thumb_func_start RemoveFieldObjectByLocalIdAndMap +@ void RemoveFieldObjectByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapBank) +RemoveFieldObjectByLocalIdAndMap: @ 808D8C4 + push {lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _0808D902 + mov r0, sp + ldrb r0, [r0] + bl GetFieldObjectFlagIdByFieldObjectId + lsls r0, 16 + lsrs r0, 16 + bl FlagSet + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + bl RemoveFieldObject +_0808D902: + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end RemoveFieldObjectByLocalIdAndMap + + thumb_func_start RemoveFieldObjectInternal +@ void RemoveFieldObjectInternal(npc_state *fieldObject) +RemoveFieldObjectInternal: @ 808D90C + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldrb r0, [r4, 0x5] + bl GetFieldObjectGraphicsInfo + ldrh r2, [r0, 0x6] + ldr r1, =0xffff0000 + ldr r0, [sp, 0x4] + ands r0, r1 + orrs r0, r2 + str r0, [sp, 0x4] + ldr r2, =0x02020630 + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r2, 0 + adds r1, 0xC + adds r0, r1 + mov r1, sp + str r1, [r0] + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + bl RemoveObjectAndFreeTiles + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end RemoveFieldObjectInternal + + thumb_func_start sub_808D958 +sub_808D958: @ 808D958 + push {r4,lr} + movs r4, 0 +_0808D95C: + ldr r0, =0x02037590 + ldrb r0, [r0, 0x5] + cmp r4, r0 + beq _0808D972 + lsls r0, r4, 3 + adds r0, r4 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + bl RemoveFieldObject +_0808D972: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _0808D95C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808D958 + + thumb_func_start SpawnFieldObjectInternal +@ u8 SpawnFieldObjectInternal(struct FieldObjectTemplate *romFieldObject, struct objtemplate *template, int mapId, int mapGroupId, u16 movingCameraOffsetX, u16 movingCameraOffsetY) +SpawnFieldObjectInternal: @ 808D98C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r8, r1 + adds r1, r2, 0 + adds r2, r3, 0 + ldr r3, [sp, 0x24] + ldr r4, [sp, 0x28] + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 16 + lsrs r3, 16 + mov r10, r3 + lsls r4, 16 + lsrs r4, 16 + str r4, [sp] + bl InitFieldObjectStateFromTemplate + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + cmp r0, 0x10 + bne _0808D9C8 + movs r0, 0x10 + b _0808DB2C +_0808D9C8: + mov r0, r9 + lsls r4, r0, 3 + adds r0, r4, r0 + lsls r0, 2 + ldr r1, =0x02037350 + adds r6, r0, r1 + ldrb r0, [r6, 0x5] + bl GetFieldObjectGraphicsInfo + adds r7, r0, 0 + ldrb r0, [r7, 0xC] + lsls r0, 28 + lsrs r5, r0, 28 + cmp r5, 0 + bne _0808D9F4 + ldrh r0, [r7, 0x2] + movs r1, 0 + bl npc_load_two_palettes__no_record + b _0808DA16 + .pool +_0808D9F4: + cmp r5, 0xA + bne _0808DA02 + ldrh r0, [r7, 0x2] + movs r1, 0xA + bl npc_load_two_palettes__and_record + b _0808DA16 +_0808DA02: + cmp r5, 0xF + bls _0808DA16 + adds r0, r5, 0 + subs r0, 0x10 + lsls r0, 24 + lsrs r5, r0, 24 + ldrh r0, [r7, 0x2] + adds r1, r5, 0 + bl sub_808EAB0 +_0808DA16: + ldrb r0, [r6, 0x6] + cmp r0, 0x4C + bne _0808DA24 + ldrb r0, [r6, 0x1] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r6, 0x1] +_0808DA24: + ldr r1, =0x0000ffff + adds r0, r1, 0 + mov r2, r8 + strh r0, [r2, 0x2] + mov r0, r8 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x40 + bne _0808DA64 + ldr r0, =0x02037350 + mov r2, r9 + adds r1, r4, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + movs r0, 0x10 + b _0808DB2C + .pool +_0808DA64: + mov r1, r8 + lsls r0, r1, 4 + add r0, r8 + lsls r0, 2 + ldr r1, =0x02020630 + adds r4, r0, r1 + mov r2, r10 + lsls r0, r2, 16 + asrs r0, 16 + ldrh r1, [r6, 0x10] + adds r0, r1 + lsls r0, 16 + asrs r0, 16 + ldr r2, [sp] + lsls r1, r2, 16 + asrs r1, 16 + ldrh r2, [r6, 0x12] + adds r1, r2 + lsls r1, 16 + asrs r1, 16 + adds r2, r4, 0 + adds r2, 0x20 + adds r3, r4, 0 + adds r3, 0x22 + bl sub_8092FF0 + ldrh r0, [r7, 0x8] + lsls r0, 16 + asrs r0, 17 + negs r0, r0 + adds r1, r4, 0 + adds r1, 0x28 + strb r0, [r1] + ldrh r0, [r7, 0xA] + lsls r0, 16 + asrs r0, 17 + negs r0, r0 + adds r2, r4, 0 + adds r2, 0x29 + strb r0, [r2] + ldrh r0, [r4, 0x20] + adds r0, 0x8 + strh r0, [r4, 0x20] + ldrh r1, [r4, 0x22] + adds r1, 0x10 + movs r0, 0 + ldrsb r0, [r2, r0] + adds r0, r1 + strh r0, [r4, 0x22] + lsls r2, r5, 4 + ldrb r1, [r4, 0x5] + movs r0, 0xF + ands r0, r1 + orrs r0, r2 + strb r0, [r4, 0x5] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2] + mov r0, r9 + strh r0, [r4, 0x2E] + mov r1, r8 + strb r1, [r6, 0x4] + ldrb r1, [r7, 0xC] + lsls r1, 25 + lsrs r1, 31 + lsls r1, 4 + ldrb r2, [r6, 0x1] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r6, 0x1] + lsls r0, 27 + cmp r0, 0 + blt _0808DB16 + ldrb r0, [r6, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl FieldObjectDirectionToImageAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim +_0808DB16: + ldrb r0, [r6, 0xB] + lsrs r0, 4 + adds r1, r4, 0 + movs r2, 0x1 + bl SetObjectSubpriorityByZCoord + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_8096518 + mov r0, r9 +_0808DB2C: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end SpawnFieldObjectInternal + + thumb_func_start SpawnFieldObject +@ u8 SpawnFieldObject(struct FieldObjectTemplate *romNpc, u8 mapId, u8 mapGroupId, u16 movingCameraOffsetX, u16 movingCameraOffsetY) +SpawnFieldObject: @ 808DB40 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x2C + mov r9, r0 + adds r6, r1, 0 + mov r8, r2 + adds r4, r3, 0 + ldr r5, [sp, 0x48] + lsls r6, 24 + lsrs r6, 24 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + movs r0, 0 + str r0, [sp, 0x20] + mov r1, r9 + ldrb r0, [r1, 0x1] + bl GetFieldObjectGraphicsInfo + adds r7, r0, 0 + add r2, sp, 0x20 + mov r0, r9 + add r1, sp, 0x8 + bl MakeObjectTemplateFromFieldObjectTemplate + ldrh r3, [r7, 0x6] + ldr r2, =0xffff0000 + add r1, sp, 0x24 + ldr r0, [r1, 0x4] + ands r0, r2 + orrs r0, r3 + str r0, [r1, 0x4] + str r1, [sp, 0x14] + lsls r4, 16 + asrs r4, 16 + str r4, [sp] + lsls r5, 16 + asrs r5, 16 + str r5, [sp, 0x4] + mov r0, r9 + add r1, sp, 0x8 + adds r2, r6, 0 + mov r3, r8 + bl SpawnFieldObjectInternal + lsls r0, 24 + lsrs r2, r0, 24 + adds r5, r2, 0 + cmp r2, 0x10 + bne _0808DBBC + movs r0, 0x10 + b _0808DBF2 + .pool +_0808DBBC: + ldr r4, =0x02020630 + ldr r1, =0x02037350 + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + adds r3, r0, r1 + ldrb r1, [r3, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0xC + adds r0, r1 + ldr r1, [r7, 0x1C] + str r1, [r0] + ldr r2, [sp, 0x20] + cmp r2, 0 + beq _0808DBF0 + ldrb r1, [r3, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r1, r2, 0 + bl SetSpriteOamTables_NoPriorityFromTable +_0808DBF0: + adds r0, r5, 0 +_0808DBF2: + add sp, 0x2C + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end SpawnFieldObject + + thumb_func_start SpawnSpecialFieldObject +@ u8 SpawnSpecialFieldObject(struct FieldObjectTemplate *romFieldObject) +SpawnSpecialFieldObject: @ 808DC08 + push {r4-r6,lr} + sub sp, 0x8 + adds r5, r0, 0 + mov r4, sp + adds r4, 0x6 + add r0, sp, 0x4 + adds r1, r4, 0 + bl GetFieldObjectMovingCameraOffset + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + add r0, sp, 0x4 + movs r6, 0 + ldrsh r3, [r0, r6] + movs r6, 0 + ldrsh r0, [r4, r6] + str r0, [sp] + adds r0, r5, 0 + bl SpawnFieldObject + lsls r0, 24 + lsrs r0, 24 + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end SpawnSpecialFieldObject + + thumb_func_start SpawnSpecialFieldObjectParametrized +@ u8 SpawnSpecialFieldObjectParametrized(u8 graphicsId, u8 movementBehavior, u8 localId, u16 x, u16 y, u8 z) +SpawnSpecialFieldObjectParametrized: @ 808DC44 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x18 + ldr r4, [sp, 0x2C] + ldr r5, [sp, 0x30] + mov r8, r5 + lsls r0, 24 + lsrs r0, 24 + lsls r3, 16 + ldr r5, =0xfff90000 + adds r3, r5 + lsrs r3, 16 + lsls r4, 16 + adds r4, r5 + lsrs r4, 16 + mov r5, sp + movs r6, 0 + strb r2, [r5] + mov r2, sp + strb r0, [r2, 0x1] + mov r0, sp + strb r6, [r0, 0x2] + movs r5, 0 + strh r3, [r0, 0x4] + strh r4, [r0, 0x6] + mov r2, r8 + strb r2, [r0, 0x8] + strb r1, [r0, 0x9] + mov r2, sp + ldrb r1, [r2, 0xA] + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0xA] + mov r0, sp + strb r5, [r0, 0xA] + strh r6, [r0, 0xC] + strh r6, [r0, 0xE] + bl SpawnSpecialFieldObject + lsls r0, 24 + lsrs r0, 24 + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end SpawnSpecialFieldObjectParametrized + + thumb_func_start show_sprite +show_sprite: @ 808DCAC + push {r4-r7,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + adds r1, r7, 0 + adds r2, r6, 0 + bl GetFieldObjectTemplateByLocalIdAndMap + adds r5, r0, 0 + cmp r5, 0 + beq _0808DCF2 + mov r4, sp + adds r4, 0x6 + add r0, sp, 0x4 + adds r1, r4, 0 + bl GetFieldObjectMovingCameraOffset + add r0, sp, 0x4 + movs r1, 0 + ldrsh r3, [r0, r1] + movs r1, 0 + ldrsh r0, [r4, r1] + str r0, [sp] + adds r0, r5, 0 + adds r1, r7, 0 + adds r2, r6, 0 + bl SpawnFieldObject + lsls r0, 24 + lsrs r0, 24 + b _0808DCF4 +_0808DCF2: + movs r0, 0x10 +_0808DCF4: + add sp, 0x8 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end show_sprite + + thumb_func_start MakeObjectTemplateFromFieldObjectGraphicsInfo +@ void MakeObjectTemplateFromFieldObjectGraphicsInfo(u8 graphicsId, void ( *callback)(), struct objtemplate *objectTemplate, SpriteOamTable **spriteOamTables) +MakeObjectTemplateFromFieldObjectGraphicsInfo: @ 808DCFC + push {r4-r6,lr} + adds r5, r1, 0 + adds r4, r2, 0 + adds r6, r3, 0 + lsls r0, 24 + lsrs r0, 24 + bl GetFieldObjectGraphicsInfo + ldrh r1, [r0] + strh r1, [r4] + ldrh r1, [r0, 0x2] + strh r1, [r4, 0x2] + ldr r1, [r0, 0x10] + str r1, [r4, 0x4] + ldr r1, [r0, 0x18] + str r1, [r4, 0x8] + ldr r1, [r0, 0x1C] + str r1, [r4, 0xC] + ldr r1, [r0, 0x20] + str r1, [r4, 0x10] + str r5, [r4, 0x14] + ldr r0, [r0, 0x14] + str r0, [r6] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end MakeObjectTemplateFromFieldObjectGraphicsInfo + + thumb_func_start MakeObjectTemplateFromFieldObjectGraphicsInfoWithCallbackIndex +@ void MakeObjectTemplateFromFieldObjectGraphicsInfoWithCallbackIndex(u16 graphicsId, u16 callbackIndex, struct objtemplate *objectTemplate, SpriteOamTable **spriteOamTables) +MakeObjectTemplateFromFieldObjectGraphicsInfoWithCallbackIndex: @ 808DD30 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + ldr r4, =gUnknown_08505438 + lsrs r1, 14 + adds r1, r4 + ldr r1, [r1] + bl MakeObjectTemplateFromFieldObjectGraphicsInfo + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end MakeObjectTemplateFromFieldObjectGraphicsInfoWithCallbackIndex + + thumb_func_start MakeObjectTemplateFromFieldObjectTemplate +@ void MakeObjectTemplateFromFieldObjectTemplate(struct FieldObjectTemplate *fieldObjectTemplate, struct objtemplate *objectTemplate, SpriteOamTable **spriteOamTables) +MakeObjectTemplateFromFieldObjectTemplate: @ 808DD50 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r3, r2, 0 + ldrb r0, [r4, 0x1] + ldrb r1, [r4, 0x9] + adds r2, r5, 0 + bl MakeObjectTemplateFromFieldObjectGraphicsInfoWithCallbackIndex + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end MakeObjectTemplateFromFieldObjectTemplate + + thumb_func_start AddPseudoFieldObject +@ void AddPseudoFieldObject(u8 graphicsId, void ( *callback)(), u16 x, u16 y, u8 subpriority) +AddPseudoFieldObject: @ 808DD68 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, [sp, 0x20] + lsls r4, 16 + lsrs r4, 16 + lsls r2, 16 + lsrs r2, 16 + mov r8, r2 + lsls r3, 16 + lsrs r7, r3, 16 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r0, 0x18 + bl Alloc + adds r6, r0, 0 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + mov r3, sp + bl MakeObjectTemplateFromFieldObjectGraphicsInfo + ldrh r1, [r6, 0x2] + ldr r0, =0x0000ffff + cmp r1, r0 + beq _0808DDAE + adds r0, r1, 0 + bl sub_808E894 +_0808DDAE: + mov r0, r8 + lsls r1, r0, 16 + asrs r1, 16 + lsls r2, r7, 16 + asrs r2, 16 + adds r0, r6, 0 + mov r3, r9 + bl AddObjectToFront + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r6, 0 + bl Free + cmp r5, 0x40 + beq _0808DDF2 + ldr r1, [sp] + cmp r1, 0 + beq _0808DDF2 + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + adds r0, r4, 0 + bl SetSpriteOamTables_NoPriorityFromTable + adds r4, 0x42 + ldrb r1, [r4] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x80 + orrs r0, r1 + strb r0, [r4] +_0808DDF2: + adds r0, r5, 0 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end AddPseudoFieldObject + + thumb_func_start sprite_new +sprite_new: @ 808DE0C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + adds r5, r0, 0 + ldr r0, [sp, 0x40] + ldr r4, [sp, 0x44] + lsls r5, 24 + lsrs r5, 24 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + add r1, sp, 0x18 + mov r8, r1 + strh r2, [r1] + mov r6, sp + adds r6, 0x1A + strh r3, [r6] + lsls r0, 24 + lsrs r7, r0, 24 + lsls r4, 24 + lsrs r4, 24 + mov r10, r4 + adds r0, r5, 0 + bl GetFieldObjectGraphicsInfo + adds r4, r0, 0 + ldr r1, =sub_8097AC8 + add r3, sp, 0x1C + adds r0, r5, 0 + mov r2, sp + bl MakeObjectTemplateFromFieldObjectGraphicsInfo + mov r1, sp + ldr r2, =0x0000ffff + adds r0, r2, 0 + strh r0, [r1, 0x2] + mov r1, r8 + movs r2, 0 + ldrsh r0, [r1, r2] + adds r0, 0x7 + strh r0, [r1] + movs r1, 0 + ldrsh r0, [r6, r1] + adds r0, 0x7 + strh r0, [r6] + mov r0, r8 + adds r1, r6, 0 + movs r2, 0x8 + movs r3, 0x10 + bl sub_80930E0 + mov r2, r8 + movs r0, 0 + ldrsh r1, [r2, r0] + movs r0, 0 + ldrsh r2, [r6, r0] + mov r0, sp + movs r3, 0 + bl AddObjectToBack + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x40 + beq _0808DF6C + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + ldr r1, =0x02020630 + adds r5, r0, r1 + ldrh r0, [r4, 0x8] + lsls r0, 16 + asrs r0, 17 + negs r0, r0 + adds r1, r5, 0 + adds r1, 0x28 + strb r0, [r1] + ldrh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 17 + negs r0, r0 + adds r1, 0x1 + strb r0, [r1] + movs r0, 0 + ldrsb r0, [r1, r0] + ldrh r1, [r5, 0x22] + adds r0, r1 + strh r0, [r5, 0x22] + ldrb r0, [r4, 0xC] + lsls r0, 28 + lsrs r0, 24 + ldrb r1, [r5, 0x5] + movs r3, 0xF + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + strb r2, [r5, 0x5] + lsls r1, r2, 24 + lsrs r0, r1, 28 + cmp r0, 0xF + bls _0808DEE4 + subs r0, 0x10 + lsls r0, 4 + ands r2, r3 + orrs r2, r0 + strb r2, [r5, 0x5] +_0808DEE4: + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2] + mov r2, r9 + strh r2, [r5, 0x2E] + strh r7, [r5, 0x30] + ldrb r1, [r4, 0xC] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0xA + bne _0808DF18 + ldrh r0, [r4, 0x2] + lsls r1, 28 + lsrs r1, 28 + bl npc_load_two_palettes__and_record + b _0808DF2C + .pool +_0808DF18: + lsls r1, 28 + lsrs r0, r1, 28 + cmp r0, 0xF + bls _0808DF2C + ldrh r0, [r4, 0x2] + lsrs r2, r1, 28 + movs r1, 0xF0 + orrs r1, r2 + bl sub_808EAB0 +_0808DF2C: + ldr r1, [sp, 0x1C] + cmp r1, 0 + beq _0808DF48 + adds r0, r5, 0 + bl SetSpriteOamTables_NoPriorityFromTable + adds r2, r5, 0 + adds r2, 0x42 + ldrb r0, [r2] + movs r1, 0x3F + ands r1, r0 + movs r0, 0x80 + orrs r1, r0 + strb r1, [r2] +_0808DF48: + adds r0, r5, 0 + adds r1, r7, 0 + bl InitObjectPriorityByZCoord + adds r0, r7, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl SetObjectSubpriorityByZCoord + mov r0, r10 + bl FieldObjectDirectionToImageAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl StartObjectImageAnim +_0808DF6C: + adds r0, r6, 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 sprite_new + + thumb_func_start SpawnFieldObjectsInView +@ void SpawnFieldObjectsInView(u16 movingCameraOffsetX, u16 movingCameraOffsetY) +SpawnFieldObjectsInView: @ 808DF80 + 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 + str r0, [sp, 0x4] + lsls r1, 16 + lsrs r1, 16 + str r1, [sp, 0x8] + ldr r5, =0x02037318 + ldr r0, [r5, 0x4] + cmp r0, 0 + beq _0808E078 + ldr r0, =0x03005d8c + ldr r2, [r0] + ldrh r1, [r2] + subs r0, r1, 0x2 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + adds r1, 0x11 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp, 0xC] + ldrh r4, [r2, 0x2] + adds r0, r4, 0 + adds r0, 0x10 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _0808DFE0 + bl sub_81AAA40 + lsls r0, 24 + lsrs r6, r0, 24 + b _0808DFF0 + .pool +_0808DFE0: + bl InTrainerHill + cmp r0, 0 + beq _0808DFEC + movs r6, 0x2 + b _0808DFF0 +_0808DFEC: + ldr r0, [r5, 0x4] + ldrb r6, [r0] +_0808DFF0: + movs r5, 0 + cmp r5, r6 + bcs _0808E078 + lsls r0, r4, 16 + asrs r0, 16 + mov r9, r0 + mov r1, r8 + lsls r0, r1, 16 + asrs r0, 16 + mov r8, r0 +_0808E004: + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 3 + movs r2, 0xC7 + lsls r2, 4 + adds r0, r2 + ldr r3, =0x03005d8c + ldr r1, [r3] + adds r4, r1, r0 + ldrh r0, [r4, 0x4] + adds r0, 0x7 + lsls r0, 16 + lsrs r2, r0, 16 + ldrh r0, [r4, 0x6] + adds r0, 0x7 + lsls r0, 16 + asrs r1, r0, 16 + cmp r9, r1 + bgt _0808E06E + mov r7, r10 + lsls r0, r7, 16 + asrs r0, 16 + cmp r0, r1 + blt _0808E06E + lsls r0, r2, 16 + asrs r1, r0, 16 + cmp r8, r1 + bgt _0808E06E + ldr r2, [sp, 0xC] + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, r1 + blt _0808E06E + ldrh r0, [r4, 0x14] + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _0808E06E + ldr r3, =0x03005d8c + ldr r0, [r3] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + ldr r7, [sp, 0x4] + lsls r3, r7, 16 + ldr r7, [sp, 0x8] + lsls r0, r7, 16 + asrs r0, 16 + str r0, [sp] + adds r0, r4, 0 + asrs r3, 16 + bl SpawnFieldObject +_0808E06E: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r6 + bcc _0808E004 +_0808E078: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end SpawnFieldObjectsInView + + thumb_func_start RemoveFieldObjectsOutsideView +@ void RemoveFieldObjectsOutsideView() +RemoveFieldObjectsOutsideView: @ 808E08C + push {r4-r6,lr} + movs r3, 0 + ldr r6, =0x02032308 +_0808E092: + movs r2, 0 + movs r4, 0 + adds r5, r3, 0x1 +_0808E098: + lsls r0, r2, 2 + adds r1, r0, r6 + ldrb r0, [r1] + cmp r0, 0 + beq _0808E0AA + ldrb r1, [r1, 0x2] + cmp r3, r1 + bne _0808E0AA + movs r4, 0x1 +_0808E0AA: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _0808E098 + cmp r4, 0 + bne _0808E0D2 + lsls r0, r3, 3 + adds r0, r3 + lsls r0, 2 + ldr r1, =0x02037350 + adds r2, r0, r1 + ldr r0, [r2] + ldr r1, =0x00010001 + ands r0, r1 + cmp r0, 0x1 + bne _0808E0D2 + adds r0, r2, 0 + bl RemoveFieldObjectIfOutsideView +_0808E0D2: + lsls r0, r5, 24 + lsrs r3, r0, 24 + cmp r3, 0xF + bls _0808E092 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end RemoveFieldObjectsOutsideView + + thumb_func_start RemoveFieldObjectIfOutsideView +@ void RemoveFieldObjectIfOutsideView(npc_state *fieldObject) +RemoveFieldObjectIfOutsideView: @ 808E0EC + push {r4-r7,lr} + adds r3, r0, 0 + ldr r0, =0x03005d8c + ldr r2, [r0] + ldrh r0, [r2] + subs r1, r0, 0x2 + lsls r1, 16 + adds r0, 0x11 + lsls r0, 16 + lsrs r5, r0, 16 + ldrh r4, [r2, 0x2] + adds r0, r4, 0 + adds r0, 0x10 + lsls r0, 16 + lsrs r6, r0, 16 + movs r0, 0x10 + ldrsh r2, [r3, r0] + lsrs r7, r1, 16 + asrs r1, 16 + cmp r2, r1 + blt _0808E132 + lsls r0, r5, 16 + asrs r0, 16 + cmp r2, r0 + bgt _0808E132 + movs r0, 0x12 + ldrsh r1, [r3, r0] + lsls r0, r4, 16 + asrs r0, 16 + cmp r1, r0 + blt _0808E132 + lsls r0, r6, 16 + asrs r0, 16 + cmp r1, r0 + ble _0808E160 +_0808E132: + movs r0, 0xC + ldrsh r1, [r3, r0] + lsls r0, r7, 16 + asrs r0, 16 + cmp r1, r0 + blt _0808E15A + lsls r0, r5, 16 + asrs r0, 16 + cmp r1, r0 + bgt _0808E15A + movs r0, 0xE + ldrsh r1, [r3, r0] + lsls r0, r4, 16 + asrs r0, 16 + cmp r1, r0 + blt _0808E15A + lsls r0, r6, 16 + asrs r0, 16 + cmp r1, r0 + ble _0808E160 +_0808E15A: + adds r0, r3, 0 + bl RemoveFieldObject +_0808E160: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end RemoveFieldObjectIfOutsideView + + thumb_func_start sub_808E16C +sub_808E16C: @ 808E16C + push {r4-r7,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + bl ClearPlayerAvatarInfo + movs r6, 0 + ldr r7, =0x02037350 + lsls r4, 16 + lsls r5, 16 +_0808E186: + lsls r0, r6, 3 + adds r0, r6 + lsls r0, 2 + adds r0, r7 + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + beq _0808E1A0 + adds r0, r6, 0 + asrs r1, r4, 16 + asrs r2, r5, 16 + bl sub_808E1B8 +_0808E1A0: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0xF + bls _0808E186 + bl sub_808D450 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808E16C + + thumb_func_start sub_808E1B8 +sub_808E1B8: @ 808E1B8 + 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 r9, r0 + lsls r1, 16 + lsrs r1, 16 + mov r10, r1 + lsls r2, 16 + lsrs r2, 16 + str r2, [sp, 0x24] + movs r7, 0 + ldr r2, =0x02032308 +_0808E1DA: + lsls r0, r7, 2 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0 + beq _0808E1EC + ldrb r1, [r1, 0x2] + cmp r9, r1 + bne _0808E1EC + b _0808E374 +_0808E1EC: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x3 + bls _0808E1DA + mov r1, r9 + lsls r0, r1, 3 + add r0, r9 + lsls r0, 2 + ldr r1, =0x02037350 + adds r6, r0, r1 + movs r0, 0 + str r0, [sp, 0x20] + ldrb r0, [r6, 0x5] + bl GetFieldObjectGraphicsInfo + adds r5, r0, 0 + ldrh r2, [r5, 0x6] + ldr r1, =0xffff0000 + add r4, sp, 0x18 + ldr r0, [r4, 0x4] + ands r0, r1 + orrs r0, r2 + str r0, [r4, 0x4] + ldrb r0, [r6, 0x5] + ldrb r1, [r6, 0x6] + add r3, sp, 0x20 + mov r2, sp + bl MakeObjectTemplateFromFieldObjectGraphicsInfoWithCallbackIndex + str r4, [sp, 0xC] + mov r1, sp + ldr r2, =0x0000ffff + adds r0, r2, 0 + strh r0, [r1, 0x2] + ldrb r0, [r5, 0xC] + lsls r1, r0, 28 + lsrs r0, r1, 28 + mov r8, r0 + cmp r0, 0 + bne _0808E258 + ldrh r0, [r5, 0x2] + lsrs r1, 28 + bl npc_load_two_palettes__no_record + b _0808E27E + .pool +_0808E258: + mov r2, r8 + cmp r2, 0xA + bne _0808E268 + ldrh r0, [r5, 0x2] + lsrs r1, 28 + bl npc_load_two_palettes__and_record + b _0808E27E +_0808E268: + mov r0, r8 + cmp r0, 0xF + bls _0808E27E + subs r0, 0x10 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldrh r0, [r5, 0x2] + mov r1, r8 + bl sub_808EAB0 +_0808E27E: + mov r1, sp + ldr r2, =0x0000ffff + adds r0, r2, 0 + strh r0, [r1, 0x2] + mov r0, sp + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x40 + beq _0808E374 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r1, =0x02020630 + adds r4, r0, r1 + mov r1, r10 + lsls r0, r1, 16 + asrs r0, 16 + ldrh r2, [r6, 0x10] + adds r0, r2 + lsls r0, 16 + asrs r0, 16 + ldr r2, [sp, 0x24] + lsls r1, r2, 16 + asrs r1, 16 + ldrh r2, [r6, 0x12] + adds r1, r2 + lsls r1, 16 + asrs r1, 16 + adds r2, r4, 0 + adds r2, 0x20 + adds r3, r4, 0 + adds r3, 0x22 + bl sub_8092FF0 + ldrh r0, [r5, 0x8] + lsls r0, 16 + asrs r0, 17 + negs r0, r0 + adds r1, r4, 0 + adds r1, 0x28 + strb r0, [r1] + ldrh r0, [r5, 0xA] + lsls r0, 16 + asrs r0, 17 + negs r0, r0 + adds r2, r4, 0 + adds r2, 0x29 + strb r0, [r2] + ldrh r0, [r4, 0x20] + adds r0, 0x8 + strh r0, [r4, 0x20] + ldrh r1, [r4, 0x22] + adds r1, 0x10 + movs r0, 0 + ldrsb r0, [r2, r0] + adds r0, r1 + strh r0, [r4, 0x22] + ldr r0, [r5, 0x1C] + str r0, [r4, 0xC] + ldrb r0, [r6, 0x6] + cmp r0, 0xB + bne _0808E312 + mov r0, r9 + adds r1, r7, 0 + bl SetPlayerAvatarFieldObjectIdAndObjectId + bl sub_8154228 + strb r0, [r6, 0x1B] +_0808E312: + ldr r1, [sp, 0x20] + cmp r1, 0 + beq _0808E31E + adds r0, r4, 0 + bl SetSpriteOamTables_NoPriorityFromTable +_0808E31E: + mov r0, r8 + lsls r2, r0, 4 + ldrb r1, [r4, 0x5] + movs r0, 0xF + ands r0, r1 + orrs r0, r2 + strb r0, [r4, 0x5] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2] + mov r1, r9 + strh r1, [r4, 0x2E] + strb r7, [r6, 0x4] + ldrb r0, [r6, 0x1] + lsls r0, 27 + cmp r0, 0 + blt _0808E362 + ldrb r0, [r6, 0x6] + cmp r0, 0xB + beq _0808E362 + ldrb r0, [r6, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl FieldObjectDirectionToImageAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim +_0808E362: + adds r0, r6, 0 + bl sub_808E38C + ldrb r0, [r6, 0xB] + lsrs r0, 4 + adds r1, r4, 0 + movs r2, 0x1 + bl SetObjectSubpriorityByZCoord +_0808E374: + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808E1B8 + + thumb_func_start sub_808E38C +@ void sub_808E38C(struct npc_state *fieldObject) +sub_808E38C: @ 808E38C + push {lr} + ldrb r2, [r0] + movs r3, 0x3 + negs r3, r3 + adds r1, r3, 0 + ands r1, r2 + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldrb r2, [r0, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r2 + ands r1, r3 + movs r2, 0x5 + negs r2, r2 + ands r1, r2 + subs r2, 0x4 + ands r1, r2 + subs r2, 0x8 + ands r1, r2 + subs r2, 0x10 + ands r1, r2 + strb r1, [r0, 0x2] + bl FieldObjectClearAnim + pop {r0} + bx r0 + thumb_func_end sub_808E38C + + thumb_func_start SetPlayerAvatarFieldObjectIdAndObjectId +@ void SetPlayerAvatarFieldObjectIdAndObjectId(u8 fieldObjectId, u8 objectId) +SetPlayerAvatarFieldObjectIdAndObjectId: @ 808E3C4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =0x02037590 + strb r0, [r5, 0x5] + strb r1, [r5, 0x4] + ldr r1, =0x02037350 + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + adds r4, r1 + ldrb r0, [r4, 0x5] + bl GetPlayerAvatarGenderByGraphicsId + strb r0, [r5, 0x7] + ldrb r0, [r4, 0x5] + movs r1, 0x20 + bl SetPlayerAvatarExtraStateTransition + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end SetPlayerAvatarFieldObjectIdAndObjectId + + thumb_func_start FieldObjectSetGraphicsId +@ void FieldObjectSetGraphicsId(npc_state *npcState, u8 graphicsId) +FieldObjectSetGraphicsId: @ 808E3F8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + mov r0, r8 + bl GetFieldObjectGraphicsInfo + adds r6, r0, 0 + ldrb r1, [r7, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r4, r0, r1 + ldrb r0, [r6, 0xC] + lsls r1, r0, 28 + lsrs r5, r1, 28 + cmp r5, 0 + bne _0808E434 + ldrh r0, [r6, 0x2] + adds r1, r5, 0 + bl pal_patch_for_npc + b _0808E456 + .pool +_0808E434: + cmp r5, 0xA + bne _0808E442 + ldrh r0, [r6, 0x2] + lsrs r1, 28 + bl npc_load_two_palettes__and_record + b _0808E456 +_0808E442: + cmp r5, 0xF + bls _0808E456 + adds r0, r5, 0 + subs r0, 0x10 + lsls r0, 24 + lsrs r5, r0, 24 + ldrh r0, [r6, 0x2] + adds r1, r5, 0 + bl sub_808EAB0 +_0808E456: + ldr r0, [r6, 0x10] + ldrb r2, [r0, 0x1] + lsrs r2, 6 + lsls r2, 6 + ldrb r3, [r4, 0x1] + movs r1, 0x3F + adds r0, r1, 0 + ands r0, r3 + orrs r0, r2 + strb r0, [r4, 0x1] + ldr r0, [r6, 0x10] + ldrb r0, [r0, 0x3] + lsrs r0, 6 + lsls r0, 6 + ldrb r2, [r4, 0x3] + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0x3] + ldr r0, [r6, 0x1C] + str r0, [r4, 0xC] + ldr r0, [r6, 0x18] + str r0, [r4, 0x8] + ldr r0, [r6, 0x14] + str r0, [r4, 0x18] + lsls r2, r5, 4 + ldrb r1, [r4, 0x5] + movs r0, 0xF + ands r0, r1 + orrs r0, r2 + strb r0, [r4, 0x5] + ldrb r1, [r6, 0xC] + lsls r1, 25 + lsrs r1, 31 + lsls r1, 4 + ldrb r2, [r7, 0x1] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r7, 0x1] + mov r0, r8 + strb r0, [r7, 0x5] + movs r1, 0x10 + ldrsh r0, [r7, r1] + movs r2, 0x12 + ldrsh r1, [r7, r2] + adds r2, r4, 0 + adds r2, 0x20 + adds r3, r4, 0 + adds r3, 0x22 + bl sub_8093038 + ldrh r0, [r6, 0x8] + lsls r0, 16 + asrs r0, 17 + negs r0, r0 + adds r1, r4, 0 + adds r1, 0x28 + strb r0, [r1] + ldrh r0, [r6, 0xA] + lsls r0, 16 + asrs r0, 17 + negs r0, r0 + adds r2, r4, 0 + adds r2, 0x29 + strb r0, [r2] + ldrh r0, [r4, 0x20] + adds r0, 0x8 + strh r0, [r4, 0x20] + ldrh r1, [r4, 0x22] + adds r1, 0x10 + movs r0, 0 + ldrsb r0, [r2, r0] + adds r0, r1 + strh r0, [r4, 0x22] + ldrb r0, [r7, 0x1] + lsrs r0, 7 + cmp r0, 0 + beq _0808E4F8 + bl CameraObjectReset1 +_0808E4F8: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end FieldObjectSetGraphicsId + + thumb_func_start sub_808E504 +sub_808E504: @ 808E504 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r4, r3, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _0808E538 + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + adds r1, r4, 0 + bl FieldObjectSetGraphicsId +_0808E538: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808E504 + + thumb_func_start FieldObjectTurn +@ void FieldObjectTurn(struct npc_state *fieldObject, u8 direction) +FieldObjectTurn: @ 808E544 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 24 + lsrs r1, 24 + bl FieldObjectSetDirection + ldrb r0, [r6, 0x1] + lsls r0, 27 + cmp r0, 0 + blt _0808E58A + ldrb r0, [r6, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r5, =0x02020630 + adds r4, r5 + ldrb r0, [r6, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl FieldObjectDirectionToImageAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + ldrb r1, [r6, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0 + bl SeekObjectImageAnim +_0808E58A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectTurn + + thumb_func_start FieldObjectTurnByLocalIdAndMap +@ void FieldObjectTurnByLocalIdAndMap(u8 localId, u8 mapId, u8 mapGroupId) +FieldObjectTurnByLocalIdAndMap: @ 808E594 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r4, r3, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _0808E5C8 + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + adds r1, r4, 0 + bl FieldObjectTurn +_0808E5C8: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectTurnByLocalIdAndMap + + thumb_func_start sub_808E5D4 +sub_808E5D4: @ 808E5D4 + push {lr} + lsls r1, 24 + lsrs r1, 24 + ldrb r2, [r0, 0x5] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + bl FieldObjectTurn + pop {r0} + bx r0 + .pool + thumb_func_end sub_808E5D4 + + thumb_func_start get_berry_tree_graphics +@ void get_berry_tree_graphics(npc_state *npcState, struct obj *obj) +get_berry_tree_graphics: @ 808E5F4 + push {r4-r7,lr} + adds r5, r0, 0 + adds r7, r1, 0 + ldrb r0, [r5, 0x1] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r5, 0x1] + adds r4, r7, 0 + adds r4, 0x3E + ldrb r0, [r4] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4] + ldrb r0, [r5, 0x1D] + bl GetStageByBerryTreeId + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + beq _0808E680 + ldrb r1, [r5, 0x1] + movs r0, 0x21 + negs r0, r0 + ands r0, r1 + strb r0, [r5, 0x1] + ldrb r1, [r4] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r4] + ldrb r0, [r5, 0x1D] + bl GetBerryTypeByBerryTreeId + subs r0, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + subs r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r4, 0x2B + bls _0808E648 + movs r4, 0 +_0808E648: + ldr r0, =gBerryTreeFieldObjectGraphicsIdTablePointers + lsls r4, 2 + adds r0, r4, r0 + ldr r0, [r0] + adds r0, r6 + ldrb r1, [r0] + adds r0, r5, 0 + bl FieldObjectSetGraphicsId + ldr r0, =gBerryTreePicTablePointers + adds r0, r4, r0 + ldr r0, [r0] + str r0, [r7, 0xC] + ldr r0, =gBerryTreePaletteSlotTablePointers + adds r4, r0 + ldr r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r1, 4 + ldrb r2, [r7, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r1 + strb r0, [r7, 0x5] + adds r0, r7, 0 + adds r1, r6, 0 + bl StartObjectImageAnim +_0808E680: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end get_berry_tree_graphics + + thumb_func_start GetFieldObjectGraphicsInfo +@ FieldObjectGraphicsInfo *GetFieldObjectGraphicsInfo(u8 graphicsId) +GetFieldObjectGraphicsInfo: @ 808E694 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xEF + bls _0808E6AC + adds r0, r1, 0 + adds r0, 0x10 + lsls r0, 24 + lsrs r0, 24 + bl VarGetFieldObjectGraphicsId + adds r1, r0, 0 +_0808E6AC: + cmp r1, 0x45 + bne _0808E6C4 + bl sub_81201C8 + lsls r0, 24 + ldr r1, =gMauvilleOldManGraphicsInfoPointers + lsrs r0, 22 + adds r0, r1 + ldr r0, [r0] + b _0808E6D2 + .pool +_0808E6C4: + cmp r1, 0xEE + bls _0808E6CA + movs r1, 0x5 +_0808E6CA: + ldr r0, =gFieldObjectGraphicsInfoPointers + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] +_0808E6D2: + pop {r1} + bx r1 + .pool + thumb_func_end GetFieldObjectGraphicsInfo + + thumb_func_start FieldObjectHandleDynamicGraphicsId +@ void FieldObjectHandleDynamicGraphicsId(struct npc_state *fieldObject) +FieldObjectHandleDynamicGraphicsId: @ 808E6DC + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0x5] + cmp r0, 0xEF + bls _0808E6F2 + adds r0, 0x10 + lsls r0, 24 + lsrs r0, 24 + bl VarGetFieldObjectGraphicsId + strb r0, [r4, 0x5] +_0808E6F2: + pop {r4} + pop {r0} + bx r0 + thumb_func_end FieldObjectHandleDynamicGraphicsId + + thumb_func_start npc_by_local_id_and_map_set_field_1_bit_x20 +npc_by_local_id_and_map_set_field_1_bit_x20: @ 808E6F8 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r4, r3, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _0808E73A + ldr r2, =0x02037350 + mov r0, sp + ldrb r0, [r0] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x1 + adds r2, r4, 0 + ands r2, r0 + lsls r2, 5 + ldrb r3, [r1, 0x1] + movs r0, 0x21 + negs r0, r0 + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0x1] +_0808E73A: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end npc_by_local_id_and_map_set_field_1_bit_x20 + + thumb_func_start FieldObjectGetLocalIdAndMap +@ void FieldObjectGetLocalIdAndMap(struct npc_state *fieldObject, u8 *localId, u8 *mapId, u8 *mapGroupId) +FieldObjectGetLocalIdAndMap: @ 808E748 + push {r4,lr} + ldrb r4, [r0, 0x8] + strb r4, [r1] + ldrb r1, [r0, 0x9] + strb r1, [r2] + ldrb r0, [r0, 0xA] + strb r0, [r3] + pop {r4} + pop {r0} + bx r0 + thumb_func_end FieldObjectGetLocalIdAndMap + + thumb_func_start sub_808E75C +sub_808E75C: @ 808E75C + push {lr} + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + bl GetFieldObjectIdByXY + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x10 + beq _0808E784 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_0808E784: + pop {r0} + bx r0 + .pool + thumb_func_end sub_808E75C + + thumb_func_start sub_808E78C +sub_808E78C: @ 808E78C + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r4, r3, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _0808E7D2 + mov r0, sp + ldrb r0, [r0] + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 2 + ldr r0, =0x02037350 + adds r2, r0 + ldrb r1, [r2, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + ldrb r1, [r2, 0x3] + movs r3, 0x4 + orrs r1, r3 + strb r1, [r2, 0x3] + adds r0, 0x43 + strb r4, [r0] +_0808E7D2: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808E78C + + thumb_func_start sub_808E7E4 +sub_808E7E4: @ 808E7E4 + push {lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _0808E820 + mov r0, sp + ldrb r0, [r0] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02037350 + adds r1, r0 + ldrb r2, [r1, 0x3] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x3] + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] +_0808E820: + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_808E7E4 + + thumb_func_start sub_808E82C +sub_808E82C: @ 808E82C + push {r4,r5,lr} + sub sp, 0x4 + ldr r4, [sp, 0x10] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 16 + lsrs r5, r3, 16 + lsls r4, 16 + lsrs r4, 16 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _0808E870 + ldr r2, =0x02037350 + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + strh r5, [r0, 0x24] + strh r4, [r0, 0x26] +_0808E870: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808E82C + + thumb_func_start gpu_pal_allocator_reset__manage_upper_four +gpu_pal_allocator_reset__manage_upper_four: @ 808E880 + push {lr} + bl ResetObjectPaletteAllocator + ldr r1, =0x0300301c + movs r0, 0xC + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end gpu_pal_allocator_reset__manage_upper_four + + thumb_func_start sub_808E894 +sub_808E894: @ 808E894 + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl FindFieldObjectPaletteIndexByTag + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, =0x000011ff + cmp r1, r0 + beq _0808E8B2 + lsls r0, r1, 3 + ldr r1, =gUnknown_0850BBC8 + adds r0, r1 + bl sub_808E8F4 +_0808E8B2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_808E894 + + thumb_func_start sub_808E8C0 +sub_808E8C0: @ 808E8C0 + push {r4-r6,lr} + adds r5, r0, 0 + movs r4, 0 + ldrh r0, [r5] + ldr r1, =0x000011ff + cmp r0, r1 + beq _0808E8EA + adds r6, r1, 0 +_0808E8D0: + lsls r0, r4, 1 + adds r0, r5 + ldrh r0, [r0] + bl sub_808E894 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 1 + adds r0, r5 + ldrh r0, [r0] + cmp r0, r6 + bne _0808E8D0 +_0808E8EA: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808E8C0 + + thumb_func_start sub_808E8F4 +@ u8 sub_808E8F4(struct TaggedObjectPalette *taggedPalette) +sub_808E8F4: @ 808E8F4 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x4] + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _0808E912 + adds r0, r4, 0 + bl LoadTaggedObjectPalette + lsls r0, 24 + lsrs r0, 24 + b _0808E914 +_0808E912: + movs r0, 0xFF +_0808E914: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_808E8F4 + + thumb_func_start pal_patch_for_npc +@ void pal_patch_for_npc(u16 tag, u8 slot) +pal_patch_for_npc: @ 808E91C + push {r4,lr} + adds r4, r1, 0 + lsls r0, 16 + lsrs r0, 16 + lsls r4, 24 + lsrs r4, 24 + bl FindFieldObjectPaletteIndexByTag + lsls r0, 24 + ldr r1, =gUnknown_0850BBC8 + lsrs r0, 21 + adds r0, r1 + ldr r0, [r0] + lsls r4, 20 + movs r1, 0x80 + lsls r1, 17 + adds r4, r1 + lsrs r4, 16 + adds r1, r4, 0 + movs r2, 0x20 + bl gpu_pal_apply + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pal_patch_for_npc + + thumb_func_start pal_patch_for_npc_range +@ void pal_patch_for_npc_range(u16 *tags, u8 minSlot, u8 maxSlot) +pal_patch_for_npc_range: @ 808E954 + push {r4-r6,lr} + adds r5, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + cmp r4, r6 + bcs _0808E978 +_0808E964: + ldrh r0, [r5] + adds r1, r4, 0 + bl pal_patch_for_npc + adds r5, 0x2 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r6 + bcc _0808E964 +_0808E978: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end pal_patch_for_npc_range + + thumb_func_start FindFieldObjectPaletteIndexByTag +@ u8 FindFieldObjectPaletteIndexByTag(u16 tag) +FindFieldObjectPaletteIndexByTag: @ 808E980 + push {r4-r6,lr} + lsls r0, 16 + lsrs r5, r0, 16 + movs r2, 0 + ldr r0, =gUnknown_0850BBC8 + ldrh r1, [r0, 0x4] + ldr r3, =0x000011ff + adds r4, r0, 0 + cmp r1, r3 + beq _0808E9C0 + adds r6, r4, 0 + adds r1, r3, 0 +_0808E998: + lsls r0, r2, 3 + adds r0, r6 + ldrh r0, [r0, 0x4] + cmp r0, r5 + bne _0808E9B0 + adds r0, r2, 0 + b _0808E9C2 + .pool +_0808E9B0: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 3 + adds r0, r4 + ldrh r0, [r0, 0x4] + cmp r0, r1 + bne _0808E998 +_0808E9C0: + movs r0, 0xFF +_0808E9C2: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end FindFieldObjectPaletteIndexByTag + + thumb_func_start npc_load_two_palettes__no_record +@ void npc_load_two_palettes__no_record(u16 tag, u8 slot) +npc_load_two_palettes__no_record: @ 808E9C8 + push {r4-r6,lr} + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 24 + lsrs r5, r1, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl pal_patch_for_npc + movs r3, 0 + ldr r1, =gUnknown_0850BD00 + ldrh r0, [r1] + ldr r2, =0x000011ff + cmp r0, r2 + beq _0808EA30 + ldr r0, =gUnknown_084975C4 + adds r5, r0 + adds r6, r2, 0 +_0808E9EC: + lsls r2, r3, 3 + adds r0, r2, r1 + ldrh r0, [r0] + cmp r0, r4 + bne _0808EA20 + adds r1, 0x4 + adds r1, r2, r1 + ldr r0, =0x020375b4 + ldrb r0, [r0] + ldr r1, [r1] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + ldrb r1, [r5] + bl pal_patch_for_npc + b _0808EA30 + .pool +_0808EA20: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 3 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r6 + bne _0808E9EC +_0808EA30: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end npc_load_two_palettes__no_record + + thumb_func_start npc_load_two_palettes__and_record +@ void npc_load_two_palettes__and_record(u16 tag, u8 slot) +npc_load_two_palettes__and_record: @ 808EA38 + push {r4-r6,lr} + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r0, =0x020375b6 + strh r4, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl pal_patch_for_npc + movs r3, 0 + ldr r1, =gUnknown_0850BD78 + ldrh r0, [r1] + ldr r2, =0x000011ff + cmp r0, r2 + beq _0808EAA8 + ldr r0, =gUnknown_084975C4 + adds r5, r0 + adds r6, r2, 0 +_0808EA60: + lsls r2, r3, 3 + adds r0, r2, r1 + ldrh r0, [r0] + cmp r0, r4 + bne _0808EA98 + adds r1, 0x4 + adds r1, r2, r1 + ldr r0, =0x020375b4 + ldrb r0, [r0] + ldr r1, [r1] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + ldrb r1, [r5] + bl pal_patch_for_npc + b _0808EAA8 + .pool +_0808EA98: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 3 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r6 + bne _0808EA60 +_0808EAA8: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end npc_load_two_palettes__and_record + + thumb_func_start sub_808EAB0 +sub_808EAB0: @ 808EAB0 + push {lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 24 + lsrs r1, 24 + bl pal_patch_for_npc + pop {r0} + bx r0 + thumb_func_end sub_808EAB0 + + thumb_func_start sub_808EAC4 +sub_808EAC4: @ 808EAC4 + push {r4,lr} + ldrh r3, [r0, 0x10] + strh r3, [r0, 0x14] + ldrh r4, [r0, 0x12] + strh r4, [r0, 0x16] + lsls r1, 16 + asrs r1, 16 + adds r1, r3 + strh r1, [r0, 0x10] + lsls r2, 16 + asrs r2, 16 + adds r2, r4 + strh r2, [r0, 0x12] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_808EAC4 + + thumb_func_start npc_coords_shift +@ void npc_coords_shift(struct npc_state *fieldObject, u16 x, u16 y) +npc_coords_shift: @ 808EAE4 + ldrh r3, [r0, 0x10] + strh r3, [r0, 0x14] + ldrh r3, [r0, 0x12] + strh r3, [r0, 0x16] + strh r1, [r0, 0x10] + strh r2, [r0, 0x12] + bx lr + thumb_func_end npc_coords_shift + + thumb_func_start npc_coords_set +@ void npc_coords_set(struct npc_state *fieldObject, u16 x, u16 y) +npc_coords_set: @ 808EAF4 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + strh r1, [r0, 0x14] + strh r2, [r0, 0x16] + strh r1, [r0, 0x10] + strh r2, [r0, 0x12] + bx lr + thumb_func_end npc_coords_set + + thumb_func_start sub_808EB08 +sub_808EB08: @ 808EB08 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + ldrb r1, [r6, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r7, r0, r1 + ldrb r0, [r6, 0x5] + bl GetFieldObjectGraphicsInfo + mov r8, r0 + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl npc_coords_set + movs r1, 0x10 + ldrsh r0, [r6, r1] + movs r2, 0x12 + ldrsh r1, [r6, r2] + adds r2, r7, 0 + adds r2, 0x20 + adds r3, r7, 0 + adds r3, 0x22 + bl sub_8093038 + mov r1, r8 + ldrh r0, [r1, 0x8] + lsls r0, 16 + asrs r0, 17 + negs r0, r0 + adds r1, r7, 0 + adds r1, 0x28 + strb r0, [r1] + mov r2, r8 + ldrh r0, [r2, 0xA] + lsls r0, 16 + asrs r0, 17 + negs r0, r0 + adds r2, r7, 0 + adds r2, 0x29 + strb r0, [r2] + ldrh r0, [r7, 0x20] + adds r0, 0x8 + strh r0, [r7, 0x20] + ldrh r1, [r7, 0x22] + adds r1, 0x10 + movs r0, 0 + ldrsb r0, [r2, r0] + adds r0, r1 + strh r0, [r7, 0x22] + adds r0, r6, 0 + bl sub_808E38C + ldrb r0, [r6, 0x1] + lsrs r0, 7 + cmp r0, 0 + beq _0808EB9A + bl CameraObjectReset1 +_0808EB9A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808EB08 + + thumb_func_start sub_808EBA8 +sub_808EBA8: @ 808EBA8 + push {r4,r5,lr} + sub sp, 0x4 + ldr r4, [sp, 0x10] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 16 + lsrs r5, r3, 16 + lsls r4, 16 + lsrs r4, 16 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _0808EBF0 + lsls r1, r5, 16 + lsls r2, r4, 16 + mov r0, sp + ldrb r3, [r0] + lsls r0, r3, 3 + adds r0, r3 + lsls r0, 2 + ldr r3, =0x02037350 + adds r0, r3 + movs r3, 0xE0 + lsls r3, 11 + adds r1, r3 + asrs r1, 16 + adds r2, r3 + asrs r2, 16 + bl sub_808EB08 +_0808EBF0: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808EBA8 + + thumb_func_start npc_coords_shift_still +@ void npc_coords_shift_still(struct npc_state *fieldObject) +npc_coords_shift_still: @ 808EBFC + push {lr} + movs r2, 0x10 + ldrsh r1, [r0, r2] + movs r3, 0x12 + ldrsh r2, [r0, r3] + bl npc_coords_shift + pop {r0} + bx r0 + thumb_func_end npc_coords_shift_still + + thumb_func_start UpdateFieldObjectCoordsForCameraUpdate +@ void UpdateFieldObjectCoordsForCameraUpdate() +UpdateFieldObjectCoordsForCameraUpdate: @ 808EC10 + push {r4,r5,lr} + ldr r2, =0x02037334 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0808EC68 + movs r3, 0 + ldr r5, =0x02037350 + movs r0, 0x4 + ldrsh r4, [r2, r0] + movs r0, 0x8 + ldrsh r1, [r2, r0] +_0808EC2A: + lsls r0, r3, 3 + adds r0, r3 + lsls r0, 2 + adds r2, r0, r5 + ldrb r0, [r2] + lsls r0, 31 + cmp r0, 0 + beq _0808EC5E + ldrh r0, [r2, 0xC] + subs r0, r4 + strh r0, [r2, 0xC] + ldrh r0, [r2, 0xE] + subs r0, r1 + strh r0, [r2, 0xE] + ldrh r0, [r2, 0x10] + subs r0, r4 + strh r0, [r2, 0x10] + ldrh r0, [r2, 0x12] + subs r0, r1 + strh r0, [r2, 0x12] + ldrh r0, [r2, 0x14] + subs r0, r4 + strh r0, [r2, 0x14] + ldrh r0, [r2, 0x16] + subs r0, r1 + strh r0, [r2, 0x16] +_0808EC5E: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0xF + bls _0808EC2A +_0808EC68: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end UpdateFieldObjectCoordsForCameraUpdate + + thumb_func_start GetFieldObjectIdByXYZ +@ u8 GetFieldObjectIdByXYZ(u16 x, u16 y, u8 z) +GetFieldObjectIdByXYZ: @ 808EC78 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r7, r0, 16 + lsls r1, 16 + lsrs r6, r1, 16 + lsls r2, 24 + lsrs r5, r2, 24 + movs r4, 0 + ldr r0, =0x02037350 + mov r8, r0 +_0808EC90: + lsls r0, r4, 3 + adds r0, r4 + lsls r0, 2 + mov r2, r8 + adds r1, r0, r2 + ldrb r0, [r1] + lsls r0, 31 + cmp r0, 0 + beq _0808ECC8 + movs r2, 0x10 + ldrsh r0, [r1, r2] + cmp r0, r7 + bne _0808ECC8 + movs r2, 0x12 + ldrsh r0, [r1, r2] + cmp r0, r6 + bne _0808ECC8 + adds r0, r1, 0 + adds r1, r5, 0 + bl FieldObjectDoesZCoordMatch + lsls r0, 24 + cmp r0, 0 + beq _0808ECC8 + adds r0, r4, 0 + b _0808ECD4 + .pool +_0808ECC8: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _0808EC90 + movs r0, 0x10 +_0808ECD4: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end GetFieldObjectIdByXYZ + + thumb_func_start FieldObjectDoesZCoordMatch +@ bool8 FieldObjectDoesZCoordMatch(struct npc_state *fieldObject) +FieldObjectDoesZCoordMatch: @ 808ECE0 + push {lr} + lsls r1, 24 + lsrs r1, 24 + ldrb r2, [r0, 0xB] + movs r0, 0xF + ands r0, r2 + cmp r0, 0 + beq _0808ED00 + cmp r1, 0 + beq _0808ED00 + lsls r0, r2, 28 + lsrs r0, 28 + cmp r0, r1 + beq _0808ED00 + movs r0, 0 + b _0808ED02 +_0808ED00: + movs r0, 0x1 +_0808ED02: + pop {r1} + bx r1 + thumb_func_end FieldObjectDoesZCoordMatch + + thumb_func_start UpdateFieldObjectsForCameraUpdate +@ void UpdateFieldObjectsForCameraUpdate(u16 movingCameraOffsetX, u16 movingCameraOffsetY) +UpdateFieldObjectsForCameraUpdate: @ 808ED08 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + bl UpdateFieldObjectCoordsForCameraUpdate + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + adds r0, r4, 0 + adds r1, r5, 0 + bl SpawnFieldObjectsInView + bl RemoveFieldObjectsOutsideView + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end UpdateFieldObjectsForCameraUpdate + + thumb_func_start AddCameraObject +@ u8 AddCameraObject(u8 followedObjectId) +AddCameraObject: @ 808ED34 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_084975D4 + movs r1, 0 + movs r2, 0 + movs r3, 0x4 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r2, 0x3E + adds r2, r1 + mov r12, r2 + ldrb r2, [r2] + movs r3, 0x4 + orrs r2, r3 + mov r3, r12 + strb r2, [r3] + strh r4, [r1, 0x2E] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end AddCameraObject + + thumb_func_start ObjectCB_CameraObject +@ void ObjectCB_CameraObject(struct obj *object) +ObjectCB_CameraObject: @ 808ED78 + push {r4,r5,lr} + sub sp, 0xC + mov r2, sp + ldr r1, =gUnknown_084975EC + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + movs r2, 0x30 + ldrsh r1, [r0, r2] + lsls r1, 2 + add r1, sp + ldr r1, [r1] + bl _call_via_r1 + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ObjectCB_CameraObject + + thumb_func_start CameraObject_0 +@ void CameraObject_0(struct obj *object) +CameraObject_0: @ 808EDA0 + push {lr} + ldr r3, =0x02020630 + movs r1, 0x2E + ldrsh r2, [r0, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r3 + ldrh r1, [r1, 0x20] + strh r1, [r0, 0x20] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r3 + ldrh r1, [r1, 0x22] + strh r1, [r0, 0x22] + adds r3, r0, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r3] + movs r1, 0x1 + strh r1, [r0, 0x30] + bl CameraObject_1 + pop {r0} + bx r0 + .pool + thumb_func_end CameraObject_0 + + thumb_func_start CameraObject_1 +@ void CameraObject_1(struct obj *object) +CameraObject_1: @ 808EDDC + push {r4,r5,lr} + ldr r3, =0x02020630 + movs r1, 0x2E + ldrsh r2, [r0, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r3 + ldrh r3, [r1, 0x22] + ldrh r2, [r0, 0x20] + ldrh r4, [r1, 0x20] + movs r5, 0x20 + ldrsh r1, [r1, r5] + subs r1, r2 + strh r1, [r0, 0x32] + ldrh r2, [r0, 0x22] + lsls r1, r3, 16 + asrs r1, 16 + subs r1, r2 + strh r1, [r0, 0x34] + strh r4, [r0, 0x20] + strh r3, [r0, 0x22] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end CameraObject_1 + + thumb_func_start CameraObject_2 +@ void CameraObject_2(struct obj *object) +CameraObject_2: @ 808EE14 + push {r4,lr} + ldr r4, =0x02020630 + movs r1, 0x2E + ldrsh r2, [r0, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1, 0x20] + movs r3, 0 + strh r1, [r0, 0x20] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1, 0x22] + strh r1, [r0, 0x22] + strh r3, [r0, 0x32] + strh r3, [r0, 0x34] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end CameraObject_2 + + thumb_func_start FindCameraObject +@ struct obj *FindCameraObject() +FindCameraObject: @ 808EE44 + push {r4,r5,lr} + movs r3, 0 + ldr r4, =0x02020630 + adds r5, r4, 0 + adds r5, 0x1C +_0808EE4E: + lsls r0, r3, 4 + adds r0, r3 + lsls r1, r0, 2 + adds r2, r1, r4 + adds r0, r2, 0 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + beq _0808EE78 + adds r0, r1, r5 + ldr r1, [r0] + ldr r0, =ObjectCB_CameraObject + cmp r1, r0 + bne _0808EE78 + adds r0, r2, 0 + b _0808EE84 + .pool +_0808EE78: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3F + bls _0808EE4E + movs r0, 0 +_0808EE84: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end FindCameraObject + + thumb_func_start CameraObjectReset1 +@ void CameraObjectReset1() +CameraObjectReset1: @ 808EE8C + push {lr} + bl FindCameraObject + adds r2, r0, 0 + cmp r2, 0 + beq _0808EEA4 + movs r0, 0 + strh r0, [r2, 0x30] + ldr r1, [r2, 0x1C] + adds r0, r2, 0 + bl _call_via_r1 +_0808EEA4: + pop {r0} + bx r0 + thumb_func_end CameraObjectReset1 + + thumb_func_start CameraObjectSetFollowedObjectId +@ void CameraObjectSetFollowedObjectId(u8 objectId) +CameraObjectSetFollowedObjectId: @ 808EEA8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl FindCameraObject + cmp r0, 0 + beq _0808EEBC + strh r4, [r0, 0x2E] + bl CameraObjectReset1 +_0808EEBC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end CameraObjectSetFollowedObjectId + + thumb_func_start CameraObjectGetFollowedObjectId +@ u8 CameraObjectGetFollowedObjectId() +CameraObjectGetFollowedObjectId: @ 808EEC4 + push {lr} + bl FindCameraObject + cmp r0, 0 + beq _0808EED6 + ldrh r0, [r0, 0x2E] + lsls r0, 24 + lsrs r0, 24 + b _0808EED8 +_0808EED6: + movs r0, 0x40 +_0808EED8: + pop {r1} + bx r1 + thumb_func_end CameraObjectGetFollowedObjectId + + thumb_func_start CameraObjectReset2 +@ void CameraObjectReset2() +CameraObjectReset2: @ 808EEDC + push {lr} + bl FindCameraObject + movs r1, 0x2 + strh r1, [r0, 0x30] + pop {r0} + bx r0 + thumb_func_end CameraObjectReset2 + + thumb_func_start sub_808EEEC +sub_808EEEC: @ 808EEEC + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r12, r0 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + lsls r2, 16 + lsrs r6, r2, 16 + lsls r3, 24 + lsrs r7, r3, 24 + movs r5, 0 + ldr r1, =0x02020630 +_0808EF06: + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r4, r0, r1 + adds r0, r4, 0 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + bne _0808EF38 + adds r0, r4, 0 + mov r1, r12 + movs r2, 0x44 + bl memcpy + mov r0, r8 + strh r0, [r4, 0x20] + strh r6, [r4, 0x22] + adds r0, r4, 0 + adds r0, 0x43 + strb r7, [r0] + b _0808EF42 + .pool +_0808EF38: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3F + bls _0808EF06 +_0808EF42: + adds r0, r5, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808EEEC + + thumb_func_start obj_unfreeze +obj_unfreeze: @ 808EF50 + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r12, r0 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + lsls r2, 16 + lsrs r6, r2, 16 + lsls r3, 24 + lsrs r7, r3, 24 + movs r5, 0x3F + ldr r3, =0x02020630 + movs r2, 0x1 + negs r2, r2 +_0808EF6E: + lsls r0, r5, 16 + asrs r1, r0, 16 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, r0, r3 + adds r0, r4, 0 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + bne _0808EFA8 + adds r0, r4, 0 + mov r1, r12 + movs r2, 0x44 + bl memcpy + mov r0, r8 + strh r0, [r4, 0x20] + strh r6, [r4, 0x22] + adds r0, r4, 0 + adds r0, 0x43 + strb r7, [r0] + lsls r0, r5, 24 + lsrs r0, 24 + b _0808EFB6 + .pool +_0808EFA8: + subs r0, r1, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, r2 + bgt _0808EF6E + movs r0, 0x40 +_0808EFB6: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end obj_unfreeze + + thumb_func_start FieldObjectSetDirection +@ void FieldObjectSetDirection(struct npc_state *fieldObject, u8 direction) +FieldObjectSetDirection: @ 808EFC0 + push {r4,lr} + adds r3, r0, 0 + lsls r1, 24 + lsrs r2, r1, 24 + adds r4, r2, 0 + ldrb r0, [r3, 0x18] + lsls r0, 28 + lsrs r0, 28 + adds r1, r3, 0 + adds r1, 0x20 + strb r0, [r1] + ldrb r0, [r3, 0x1] + lsls r0, 30 + cmp r0, 0 + blt _0808EFF0 + movs r0, 0xF + adds r1, r2, 0 + ands r1, r0 + ldrb r2, [r3, 0x18] + movs r0, 0x10 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x18] +_0808EFF0: + lsls r2, r4, 4 + ldrb r1, [r3, 0x18] + movs r0, 0xF + ands r0, r1 + orrs r0, r2 + strb r0, [r3, 0x18] + pop {r4} + pop {r0} + bx r0 + thumb_func_end FieldObjectSetDirection + + thumb_func_start GetFieldObjectScriptPointerByLocalIdAndMap +@ u32 GetFieldObjectScriptPointerByLocalIdAndMap(u8 localId, u8 mapId, u8 mapGroupId) +GetFieldObjectScriptPointerByLocalIdAndMap: @ 808F004 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + bl GetFieldObjectTemplateByLocalIdAndMap + ldr r0, [r0, 0x10] + pop {r1} + bx r1 + thumb_func_end GetFieldObjectScriptPointerByLocalIdAndMap + + thumb_func_start GetFieldObjectScriptPointerByFieldObjectId +@ u32 GetFieldObjectScriptPointerByFieldObjectId(u8 fieldObjectId) +GetFieldObjectScriptPointerByFieldObjectId: @ 808F01C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02037350 + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 2 + adds r2, r1 + ldrb r0, [r2, 0x8] + ldrb r1, [r2, 0x9] + ldrb r2, [r2, 0xA] + bl GetFieldObjectScriptPointerByLocalIdAndMap + pop {r1} + bx r1 + .pool + thumb_func_end GetFieldObjectScriptPointerByFieldObjectId + + thumb_func_start GetFieldObjectFlagIdByLocalIdAndMap +@ u16 GetFieldObjectFlagIdByLocalIdAndMap(u8 localId, u8 mapId, u8 mapGroupId) +GetFieldObjectFlagIdByLocalIdAndMap: @ 808F040 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + bl GetFieldObjectTemplateByLocalIdAndMap + ldrh r0, [r0, 0x14] + pop {r1} + bx r1 + thumb_func_end GetFieldObjectFlagIdByLocalIdAndMap + + thumb_func_start GetFieldObjectFlagIdByFieldObjectId +@ u16 GetFieldObjectFlagIdByFieldObjectId(u8 fieldObjectId) +GetFieldObjectFlagIdByFieldObjectId: @ 808F058 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02037350 + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 2 + adds r2, r1 + ldrb r0, [r2, 0x8] + ldrb r1, [r2, 0x9] + ldrb r2, [r2, 0xA] + bl GetFieldObjectFlagIdByLocalIdAndMap + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .pool + thumb_func_end GetFieldObjectFlagIdByFieldObjectId + + thumb_func_start sub_808F080 +sub_808F080: @ 808F080 + push {lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _0808F0B4 + ldr r2, =0x02037350 + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x7] + b _0808F0B6 + .pool +_0808F0B4: + movs r0, 0xFF +_0808F0B6: + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_808F080 + + thumb_func_start sub_808F0BC +sub_808F0BC: @ 808F0BC + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02037350 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x7] + bx lr + .pool + thumb_func_end sub_808F0BC + + thumb_func_start sub_808F0D4 +sub_808F0D4: @ 808F0D4 + push {lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _0808F108 + ldr r2, =0x02037350 + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1D] + b _0808F10A + .pool +_0808F108: + movs r0, 0xFF +_0808F10A: + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_808F0D4 + + thumb_func_start FieldObjectGetBerryTreeId +@ u8 FieldObjectGetBerryTreeId(u8 fieldObjectId) +FieldObjectGetBerryTreeId: @ 808F110 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02037350 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x1D] + bx lr + .pool + thumb_func_end FieldObjectGetBerryTreeId + + thumb_func_start GetFieldObjectTemplateByLocalIdAndMap +@ struct FieldObjectTemplate *GetFieldObjectTemplateByLocalIdAndMap(u8 localId, u8 mapId, u8 mapGroupId) +GetFieldObjectTemplateByLocalIdAndMap: @ 808F128 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =0x03005d8c + ldr r1, [r0] + movs r0, 0x5 + ldrsb r0, [r1, r0] + cmp r0, r3 + bne _0808F160 + movs r0, 0x4 + ldrsb r0, [r1, r0] + cmp r0, r2 + bne _0808F160 + movs r0, 0xC7 + lsls r0, 4 + adds r1, r0 + ldr r0, =0x02037318 + ldr r0, [r0, 0x4] + b _0808F16C + .pool +_0808F160: + adds r0, r2, 0 + adds r1, r3, 0 + bl get_mapheader_by_bank_and_number + ldr r0, [r0, 0x4] + ldr r1, [r0, 0x4] +_0808F16C: + ldrb r2, [r0] + adds r0, r4, 0 + bl FindFieldObjectTemplateInArrayByLocalId + pop {r4} + pop {r1} + bx r1 + thumb_func_end GetFieldObjectTemplateByLocalIdAndMap + + thumb_func_start FindFieldObjectTemplateInArrayByLocalId +@ struct FieldObjectTemplate *FindFieldObjectTemplateInArrayByLocalId(u8 localId, struct FieldObjectTemplate *templates, u8 numTemplates) +FindFieldObjectTemplateInArrayByLocalId: @ 808F17C + push {r4,r5,lr} + adds r5, r1, 0 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r2, 24 + lsrs r2, 24 + movs r1, 0 + cmp r1, r2 + bcs _0808F1AA +_0808F18E: + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r3, r0, r5 + ldrb r0, [r3] + cmp r0, r4 + bne _0808F1A0 + adds r0, r3, 0 + b _0808F1AC +_0808F1A0: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, r2 + bcc _0808F18E +_0808F1AA: + movs r0, 0 +_0808F1AC: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end FindFieldObjectTemplateInArrayByLocalId + + thumb_func_start sub_808F1B4 +@ int sub_808F1B4(struct npc_state *fieldObject) +sub_808F1B4: @ 808F1B4 + push {r4,r5,lr} + adds r3, r0, 0 + ldrb r0, [r3, 0x9] + ldr r1, =0x03005d8c + ldr r2, [r1] + movs r1, 0x5 + ldrsb r1, [r2, r1] + cmp r0, r1 + bne _0808F200 + ldrb r1, [r3, 0xA] + movs r0, 0x4 + ldrsb r0, [r2, r0] + cmp r1, r0 + beq _0808F1E2 + b _0808F200 + .pool +_0808F1D8: + movs r1, 0xC7 + lsls r1, 4 + adds r0, r1 + adds r0, r4, r0 + b _0808F202 +_0808F1E2: + movs r1, 0 + adds r4, r2, 0 + ldrb r3, [r3, 0x8] + movs r5, 0xC7 + lsls r5, 4 + adds r2, r4, r5 + movs r0, 0 +_0808F1F0: + ldrb r5, [r2] + cmp r3, r5 + beq _0808F1D8 + adds r2, 0x18 + adds r0, 0x18 + adds r1, 0x1 + cmp r1, 0x3F + ble _0808F1F0 +_0808F200: + movs r0, 0 +_0808F202: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808F1B4 + + thumb_func_start sub_808F208 +@ void sub_808F208(struct npc_state *fieldObject) +sub_808F208: @ 808F208 + push {r4,lr} + adds r4, r0, 0 + bl sub_808F1B4 + adds r1, r0, 0 + cmp r1, 0 + beq _0808F222 + ldrh r0, [r4, 0x10] + subs r0, 0x7 + strh r0, [r1, 0x4] + ldrh r0, [r4, 0x12] + subs r0, 0x7 + strh r0, [r1, 0x6] +_0808F222: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_808F208 + + thumb_func_start sub_808F228 +sub_808F228: @ 808F228 + push {r4,lr} + adds r4, r1, 0 + bl sub_808F1B4 + cmp r0, 0 + beq _0808F236 + str r4, [r0, 0x10] +_0808F236: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_808F228 + + thumb_func_start sub_808F23C +sub_808F23C: @ 808F23C + push {r4,lr} + lsls r1, 24 + lsrs r4, r1, 24 + bl sub_808F1B4 + cmp r0, 0 + beq _0808F24C + strb r4, [r0, 0x9] +_0808F24C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_808F23C + + thumb_func_start sub_808F254 +@ void sub_808F254(u8 localId, u8 mapId, u8 mapGroupId) +sub_808F254: @ 808F254 + push {lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _0808F282 + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + bl sub_808F208 +_0808F282: + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_808F254 + + thumb_func_start sub_808F28C +sub_808F28C: @ 808F28C + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r4, r3, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _0808F2E8 + cmp r4, 0x6 + beq _0808F2B6 + cmp r4, 0x7 + beq _0808F2D4 + b _0808F2E8 +_0808F2B6: + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + ldr r1, =gUnknown_082766A2 + bl sub_808F228 + b _0808F2E8 + .pool +_0808F2D4: + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + ldr r1, =gUnknown_082766A6 + bl sub_808F228 +_0808F2E8: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808F28C + + thumb_func_start npc_paltag_set_load +npc_paltag_set_load: @ 808F2F8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl gpu_pal_allocator_reset__manage_upper_four + ldr r1, =0x020375b6 + ldr r2, =0x000011ff + adds r0, r2, 0 + strh r0, [r1] + ldr r2, =0x020375b4 + strb r4, [r2] + cmp r4, 0x1 + bne _0808F344 + ldr r1, =gUnknown_0850BE38 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + movs r2, 0x6 + bl pal_patch_for_npc_range + ldr r1, =0x0300301c + movs r0, 0x8 + strb r0, [r1] + b _0808F356 + .pool +_0808F344: + ldr r0, =gUnknown_0850BE38 + ldrb r1, [r2] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + movs r1, 0 + movs r2, 0xA + bl pal_patch_for_npc_range +_0808F356: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end npc_paltag_set_load + + thumb_func_start npc_paltag_by_palslot +npc_paltag_by_palslot: @ 808F360 + push {r4-r6,lr} + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x9 + bhi _0808F39C + ldr r1, =gUnknown_0850BE38 + ldr r0, =0x020375b4 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + lsls r0, r2, 1 + b _0808F390 + .pool +_0808F384: + adds r1, r4, 0x4 + adds r1, r2, r1 + ldr r0, =0x020375b4 + ldrb r0, [r0] + ldr r1, [r1] + lsls r0, 1 +_0808F390: + adds r0, r1 + ldrh r0, [r0] + b _0808F3CE + .pool +_0808F39C: + movs r3, 0 + ldr r0, =gUnknown_0850BD78 + ldrh r1, [r0] + ldr r2, =0x000011ff + adds r4, r0, 0 + cmp r1, r2 + beq _0808F3CC + adds r6, r4, 0 + ldr r0, =0x020375b6 + ldrh r1, [r0] + adds r5, r2, 0 +_0808F3B2: + lsls r2, r3, 3 + adds r0, r2, r6 + ldrh r0, [r0] + cmp r0, r1 + beq _0808F384 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 3 + adds r0, r4 + ldrh r0, [r0] + cmp r0, r5 + bne _0808F3B2 +_0808F3CC: + ldr r0, =0x000011ff +_0808F3CE: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end npc_paltag_by_palslot + + thumb_func_start FieldObjectCB_NoMovement1 +FieldObjectCB_NoMovement1: @ 808F3E0 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =FieldObjectCB2_NoMovement1 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_NoMovement1 + + thumb_func_start FieldObjectCB2_NoMovement1 +FieldObjectCB2_NoMovement1: @ 808F404 + movs r0, 0 + bx lr + thumb_func_end FieldObjectCB2_NoMovement1 + + thumb_func_start FieldObjectCB_GoRandomDirections +FieldObjectCB_GoRandomDirections: @ 808F408 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =FieldObjectCB2_GoRandomDirections + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoRandomDirections + + thumb_func_start FieldObjectCB2_GoRandomDirections +FieldObjectCB2_GoRandomDirections: @ 808F42C + push {r4,lr} + ldr r3, =gUnknown_0850D6F4 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end FieldObjectCB2_GoRandomDirections + + thumb_func_start sub_808F44C +sub_808F44C: @ 808F44C + push {r4,lr} + adds r4, r1, 0 + bl npc_reset + movs r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_808F44C + + thumb_func_start sub_808F460 +sub_808F460: @ 808F460 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808F460 + + thumb_func_start sub_808F48C +sub_808F48C: @ 808F48C + push {r4-r6,lr} + adds r6, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _0808F4C0 + ldr r5, =gUnknown_0850D6DC + bl GenerateRandomNumber + movs r4, 0x3 + adds r1, r4, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r5 + movs r0, 0 + ldrsh r1, [r1, r0] + adds r0, r6, 0 + bl sub_8097978 + strh r4, [r6, 0x30] + movs r0, 0x1 + b _0808F4C2 + .pool +_0808F4C0: + movs r0, 0 +_0808F4C2: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_808F48C + + thumb_func_start sub_808F4C8 +sub_808F4C8: @ 808F4C8 + push {r4,lr} + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + bne _0808F4DC + movs r0, 0 + b _0808F4E2 +_0808F4DC: + movs r0, 0x4 + strh r0, [r4, 0x30] + movs r0, 0x1 +_0808F4E2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_808F4C8 + + thumb_func_start sub_808F4E8 +sub_808F4E8: @ 808F4E8 + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + ldr r1, =gUnknown_0850D710 + mov r0, sp + movs r2, 0x4 + bl memcpy + bl GenerateRandomNumber + movs r1, 0x3 + ands r1, r0 + mov r2, sp + adds r0, r2, r1 + ldrb r4, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x5 + strh r0, [r6, 0x30] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8092B88 + lsls r0, 24 + cmp r0, 0 + beq _0808F526 + movs r0, 0x1 + strh r0, [r6, 0x30] +_0808F526: + movs r0, 0x1 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_808F4E8 + + thumb_func_start sub_808F534 +sub_808F534: @ 808F534 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl GetGoSpeed0AnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + movs r0, 0x6 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808F534 + + thumb_func_start sub_808F564 +sub_808F564: @ 808F564 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _0808F582 + ldrb r0, [r4] + movs r1, 0x3 + negs r1, r1 + ands r1, r0 + strb r1, [r4] + movs r0, 0x1 + strh r0, [r5, 0x30] +_0808F582: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808F564 + + thumb_func_start FieldObjectIsTrainerAndCloseToPlayer +@ bool8 FieldObjectIsTrainerAndCloseToPlayer(struct npc_state *fieldObject) +FieldObjectIsTrainerAndCloseToPlayer: @ 808F58C + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r0, 0x80 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + beq _0808F5F8 + ldrb r0, [r5, 0x7] + cmp r0, 0x1 + beq _0808F5A8 + cmp r0, 0x3 + bne _0808F5F8 +_0808F5A8: + mov r7, sp + adds r7, 0x2 + mov r0, sp + adds r1, r7, 0 + bl PlayerGetDestCoords + ldrh r2, [r5, 0x10] + ldrh r4, [r5, 0x12] + ldrb r1, [r5, 0x1D] + subs r3, r2, r1 + subs r0, r4, r1 + lsls r0, 16 + lsrs r5, r0, 16 + adds r2, r1, r2 + lsls r2, 16 + lsrs r2, 16 + adds r1, r4 + lsls r1, 16 + lsrs r6, r1, 16 + mov r0, sp + lsls r3, 16 + asrs r3, 16 + movs r1, 0 + ldrsh r4, [r0, r1] + cmp r3, r4 + bgt _0808F5F8 + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, r4 + blt _0808F5F8 + lsls r0, r5, 16 + asrs r0, 16 + movs r2, 0 + ldrsh r1, [r7, r2] + cmp r0, r1 + bgt _0808F5F8 + lsls r0, r6, 16 + asrs r0, 16 + cmp r0, r1 + bge _0808F5FC +_0808F5F8: + movs r0, 0 + b _0808F5FE +_0808F5FC: + movs r0, 0x1 +_0808F5FE: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end FieldObjectIsTrainerAndCloseToPlayer + + thumb_func_start sub_808F608 +sub_808F608: @ 808F608 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 16 + lsrs r0, r1, 16 + lsls r2, 16 + lsls r3, 16 + cmp r2, r3 + ble _0808F626 + movs r2, 0x4 + lsls r0, r4, 16 + cmp r0, 0 + bge _0808F630 + movs r2, 0x3 + b _0808F630 +_0808F626: + movs r2, 0x1 + lsls r0, 16 + cmp r0, 0 + bge _0808F630 + movs r2, 0x2 +_0808F630: + adds r0, r2, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_808F608 + + thumb_func_start sub_808F638 +sub_808F638: @ 808F638 + push {lr} + movs r0, 0x1 + lsls r1, 16 + cmp r1, 0 + bge _0808F644 + movs r0, 0x2 +_0808F644: + pop {r1} + bx r1 + thumb_func_end sub_808F638 + + thumb_func_start sub_808F648 +sub_808F648: @ 808F648 + push {lr} + movs r1, 0x4 + lsls r0, 16 + cmp r0, 0 + bge _0808F654 + movs r1, 0x3 +_0808F654: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end sub_808F648 + + thumb_func_start sub_808F65C +sub_808F65C: @ 808F65C + push {r4-r7,lr} + lsls r0, 16 + asrs r4, r0, 16 + lsls r1, 16 + asrs r5, r1, 16 + lsls r2, 16 + asrs r6, r2, 16 + lsls r3, 16 + asrs r7, r3, 16 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + adds r3, r7, 0 + bl sub_808F608 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0808F698 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + adds r3, r7, 0 + bl sub_808F648 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bne _0808F6B2 + b _0808F6B0 +_0808F698: + cmp r0, 0x4 + bne _0808F6B2 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + adds r3, r7, 0 + bl sub_808F638 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0808F6B2 +_0808F6B0: + movs r0, 0x2 +_0808F6B2: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808F65C + + thumb_func_start sub_808F6B8 +sub_808F6B8: @ 808F6B8 + push {r4-r7,lr} + lsls r0, 16 + asrs r4, r0, 16 + lsls r1, 16 + asrs r5, r1, 16 + lsls r2, 16 + asrs r6, r2, 16 + lsls r3, 16 + asrs r7, r3, 16 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + adds r3, r7, 0 + bl sub_808F608 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0808F6F4 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + adds r3, r7, 0 + bl sub_808F648 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _0808F70E + b _0808F70C +_0808F6F4: + cmp r0, 0x3 + bne _0808F70E + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + adds r3, r7, 0 + bl sub_808F638 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0808F70E +_0808F70C: + movs r0, 0x2 +_0808F70E: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808F6B8 + + thumb_func_start sub_808F714 +sub_808F714: @ 808F714 + push {r4-r7,lr} + lsls r0, 16 + asrs r4, r0, 16 + lsls r1, 16 + asrs r5, r1, 16 + lsls r2, 16 + asrs r6, r2, 16 + lsls r3, 16 + asrs r7, r3, 16 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + adds r3, r7, 0 + bl sub_808F608 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _0808F750 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + adds r3, r7, 0 + bl sub_808F648 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bne _0808F76A + b _0808F768 +_0808F750: + cmp r0, 0x4 + bne _0808F76A + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + adds r3, r7, 0 + bl sub_808F638 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _0808F76A +_0808F768: + movs r0, 0x1 +_0808F76A: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808F714 + + thumb_func_start sub_808F770 +sub_808F770: @ 808F770 + push {r4-r7,lr} + lsls r0, 16 + asrs r4, r0, 16 + lsls r1, 16 + asrs r5, r1, 16 + lsls r2, 16 + asrs r6, r2, 16 + lsls r3, 16 + asrs r7, r3, 16 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + adds r3, r7, 0 + bl sub_808F608 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _0808F7AC + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + adds r3, r7, 0 + bl sub_808F648 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _0808F7C6 + b _0808F7C4 +_0808F7AC: + cmp r0, 0x3 + bne _0808F7C6 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + adds r3, r7, 0 + bl sub_808F638 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _0808F7C6 +_0808F7C4: + movs r0, 0x1 +_0808F7C6: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808F770 + + thumb_func_start sub_808F7CC +sub_808F7CC: @ 808F7CC + push {r4-r7,lr} + lsls r0, 16 + asrs r7, r0, 16 + lsls r1, 16 + asrs r6, r1, 16 + lsls r2, 16 + asrs r5, r2, 16 + lsls r3, 16 + asrs r4, r3, 16 + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_808F608 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bne _0808F802 + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_808F638 + lsls r0, 24 + lsrs r0, 24 +_0808F802: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808F7CC + + thumb_func_start sub_808F808 +sub_808F808: @ 808F808 + push {r4-r7,lr} + lsls r0, 16 + asrs r7, r0, 16 + lsls r1, 16 + asrs r6, r1, 16 + lsls r2, 16 + asrs r5, r2, 16 + lsls r3, 16 + asrs r4, r3, 16 + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_808F608 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _0808F83E + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_808F638 + lsls r0, 24 + lsrs r0, 24 +_0808F83E: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808F808 + + thumb_func_start sub_808F844 +sub_808F844: @ 808F844 + push {r4-r7,lr} + lsls r0, 16 + asrs r7, r0, 16 + lsls r1, 16 + asrs r6, r1, 16 + lsls r2, 16 + asrs r5, r2, 16 + lsls r3, 16 + asrs r4, r3, 16 + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_808F608 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0808F87A + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_808F648 + lsls r0, 24 + lsrs r0, 24 +_0808F87A: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808F844 + + thumb_func_start sub_808F880 +sub_808F880: @ 808F880 + push {r4-r7,lr} + lsls r0, 16 + asrs r7, r0, 16 + lsls r1, 16 + asrs r6, r1, 16 + lsls r2, 16 + asrs r5, r2, 16 + lsls r3, 16 + asrs r4, r3, 16 + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_808F608 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _0808F8B6 + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_808F648 + lsls r0, 24 + lsrs r0, 24 +_0808F8B6: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808F880 + + thumb_func_start sub_808F8BC +sub_808F8BC: @ 808F8BC + push {r4-r6,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r1, 24 + lsrs r6, r1, 24 + bl FieldObjectIsTrainerAndCloseToPlayer + lsls r0, 24 + cmp r0, 0 + bne _0808F8D4 + movs r0, 0 + b _0808F938 +_0808F8D4: + mov r5, sp + adds r5, 0x2 + mov r0, sp + adds r1, r5, 0 + bl PlayerGetDestCoords + mov r2, sp + mov r0, sp + ldrh r0, [r0] + ldrh r1, [r4, 0x10] + subs r0, r1 + strh r0, [r2] + ldrh r0, [r5] + ldrh r1, [r4, 0x12] + subs r0, r1 + strh r0, [r5] + mov r0, sp + ldrh r3, [r5] + ldrh r2, [r0] + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _0808F908 + negs r0, r0 + lsls r0, 16 + lsrs r2, r0, 16 +_0808F908: + lsls r0, r3, 16 + asrs r0, 16 + cmp r0, 0 + bge _0808F916 + negs r0, r0 + lsls r0, 16 + lsrs r3, r0, 16 +_0808F916: + ldr r0, =gUnknown_0850D714 + lsls r4, r6, 2 + adds r4, r0 + mov r0, sp + movs r6, 0 + ldrsh r0, [r0, r6] + movs r6, 0 + ldrsh r1, [r5, r6] + lsls r2, 16 + asrs r2, 16 + lsls r3, 16 + asrs r3, 16 + ldr r4, [r4] + bl _call_via_r4 + lsls r0, 24 + lsrs r0, 24 +_0808F938: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_808F8BC + + thumb_func_start FieldObjectCB_LookRandomDirections +FieldObjectCB_LookRandomDirections: @ 808F944 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =FieldObjectCB2_LookRandomDirections + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_LookRandomDirections + + thumb_func_start FieldObjectCB2_LookRandomDirections +@ bool8 FieldObjectCB2_LookRandomDirections(struct npc_state *fieldObject, struct obj *object) +FieldObjectCB2_LookRandomDirections: @ 808F968 + push {r4,lr} + ldr r3, =gUnknown_0850D740 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end FieldObjectCB2_LookRandomDirections + + thumb_func_start sub_808F988 +@ bool8 sub_808F988(struct npc_state *fieldObject, struct obj *object) +sub_808F988: @ 808F988 + push {r4,lr} + adds r4, r1, 0 + bl npc_reset + movs r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_808F988 + + thumb_func_start sub_808F99C +@ bool8 sub_808F99C(struct npc_state *fieldObject, struct obj *object) +sub_808F99C: @ 808F99C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808F99C + + thumb_func_start sub_808F9C8 +@ bool8 sub_808F9C8(struct npc_state *fieldObject, struct obj *object) +sub_808F9C8: @ 808F9C8 + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _0808F9FE + ldr r4, =gUnknown_0850D6DC + bl GenerateRandomNumber + movs r5, 0x3 + adds r1, r5, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + movs r0, 0 + ldrsh r1, [r1, r0] + adds r0, r7, 0 + bl sub_8097978 + ldrb r1, [r6] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r6] + strh r5, [r7, 0x30] +_0808F9FE: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_808F9C8 + + thumb_func_start sub_808FA0C +@ bool8 sub_808FA0C(struct npc_state *fieldObject, struct obj *object) +sub_808FA0C: @ 808FA0C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + bne _0808FA2A + adds r0, r4, 0 + bl FieldObjectIsTrainerAndCloseToPlayer + lsls r0, 24 + cmp r0, 0 + beq _0808FA32 +_0808FA2A: + movs r0, 0x4 + strh r0, [r5, 0x30] + movs r0, 0x1 + b _0808FA34 +_0808FA32: + movs r0, 0 +_0808FA34: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808FA0C + + thumb_func_start sub_808FA3C +@ bool8 sub_808FA3C(struct npc_state *fieldObject, struct obj *object) +sub_808FA3C: @ 808FA3C + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D710 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r0, r4, 0 + movs r1, 0 + bl sub_808F8BC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0808FA6C + bl GenerateRandomNumber + movs r1, 0x3 + ands r1, r0 + mov r2, sp + adds r0, r2, r1 + ldrb r1, [r0] +_0808FA6C: + adds r0, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x1 + strh r0, [r5, 0x30] + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_808FA3C + + thumb_func_start FieldObjectCB_RandomlyGoNorthOrSouth +FieldObjectCB_RandomlyGoNorthOrSouth: @ 808FA84 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =FieldObjectCB2_RandomlyGoNorthOrSouth + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_RandomlyGoNorthOrSouth + + thumb_func_start FieldObjectCB2_RandomlyGoNorthOrSouth +FieldObjectCB2_RandomlyGoNorthOrSouth: @ 808FAA8 + push {r4,lr} + ldr r3, =gUnknown_0850D754 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end FieldObjectCB2_RandomlyGoNorthOrSouth + + thumb_func_start sub_808FAC8 +sub_808FAC8: @ 808FAC8 + push {r4,lr} + adds r4, r1, 0 + bl npc_reset + movs r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_808FAC8 + + thumb_func_start sub_808FADC +sub_808FADC: @ 808FADC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808FADC + + thumb_func_start sub_808FB08 +@ bool8 sub_808FB08(struct npc_state *fieldObject, struct obj *object) +sub_808FB08: @ 808FB08 + push {r4-r6,lr} + adds r6, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _0808FB3C + ldr r5, =gUnknown_0850D6DC + bl GenerateRandomNumber + movs r4, 0x3 + adds r1, r4, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r5 + movs r0, 0 + ldrsh r1, [r1, r0] + adds r0, r6, 0 + bl sub_8097978 + strh r4, [r6, 0x30] + movs r0, 0x1 + b _0808FB3E + .pool +_0808FB3C: + movs r0, 0 +_0808FB3E: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_808FB08 + + thumb_func_start sub_808FB44 +@ bool8 sub_808FB44(struct npc_state *fieldObject, struct obj *object) +sub_808FB44: @ 808FB44 + push {r4,lr} + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + bne _0808FB58 + movs r0, 0 + b _0808FB5E +_0808FB58: + movs r0, 0x4 + strh r0, [r4, 0x30] + movs r0, 0x1 +_0808FB5E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_808FB44 + + thumb_func_start sub_808FB64 +@ bool8 sub_808FB64(struct npc_state *fieldObject, struct obj *object) +sub_808FB64: @ 808FB64 + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + ldr r1, =gUnknown_0850D770 + mov r0, sp + movs r2, 0x2 + bl memcpy + bl GenerateRandomNumber + movs r7, 0x1 + adds r1, r7, 0 + ands r1, r0 + mov r2, sp + adds r0, r2, r1 + ldrb r4, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x5 + strh r0, [r6, 0x30] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8092B88 + lsls r0, 24 + cmp r0, 0 + beq _0808FBA2 + strh r7, [r6, 0x30] +_0808FBA2: + movs r0, 0x1 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_808FB64 + + thumb_func_start sub_808FBB0 +sub_808FBB0: @ 808FBB0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl GetGoSpeed0AnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + movs r0, 0x6 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808FBB0 + + thumb_func_start sub_808FBE0 +sub_808FBE0: @ 808FBE0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _0808FBFE + ldrb r0, [r4] + movs r1, 0x3 + negs r1, r1 + ands r1, r0 + strb r1, [r4] + movs r0, 0x1 + strh r0, [r5, 0x30] +_0808FBFE: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808FBE0 + + thumb_func_start FieldObjectCB_RandomlyGoEastOrWest +FieldObjectCB_RandomlyGoEastOrWest: @ 808FC08 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =FieldObjectCB2_RandomlyGoEastOrWest + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_RandomlyGoEastOrWest + + thumb_func_start FieldObjectCB2_RandomlyGoEastOrWest +FieldObjectCB2_RandomlyGoEastOrWest: @ 808FC2C + push {r4,lr} + ldr r3, =gUnknown_0850D774 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end FieldObjectCB2_RandomlyGoEastOrWest + + thumb_func_start sub_808FC4C +sub_808FC4C: @ 808FC4C + push {r4,lr} + adds r4, r1, 0 + bl npc_reset + movs r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_808FC4C + + thumb_func_start sub_808FC60 +sub_808FC60: @ 808FC60 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808FC60 + + thumb_func_start sub_808FC8C +sub_808FC8C: @ 808FC8C + push {r4-r6,lr} + adds r6, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _0808FCC0 + ldr r5, =gUnknown_0850D6DC + bl GenerateRandomNumber + movs r4, 0x3 + adds r1, r4, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r5 + movs r0, 0 + ldrsh r1, [r1, r0] + adds r0, r6, 0 + bl sub_8097978 + strh r4, [r6, 0x30] + movs r0, 0x1 + b _0808FCC2 + .pool +_0808FCC0: + movs r0, 0 +_0808FCC2: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_808FC8C + + thumb_func_start sub_808FCC8 +sub_808FCC8: @ 808FCC8 + push {r4,lr} + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + bne _0808FCDC + movs r0, 0 + b _0808FCE2 +_0808FCDC: + movs r0, 0x4 + strh r0, [r4, 0x30] + movs r0, 0x1 +_0808FCE2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_808FCC8 + + thumb_func_start sub_808FCE8 +sub_808FCE8: @ 808FCE8 + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + ldr r1, =gUnknown_0850D790 + mov r0, sp + movs r2, 0x2 + bl memcpy + bl GenerateRandomNumber + movs r7, 0x1 + adds r1, r7, 0 + ands r1, r0 + mov r2, sp + adds r0, r2, r1 + ldrb r4, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x5 + strh r0, [r6, 0x30] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8092B88 + lsls r0, 24 + cmp r0, 0 + beq _0808FD26 + strh r7, [r6, 0x30] +_0808FD26: + movs r0, 0x1 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_808FCE8 + + thumb_func_start sub_808FD34 +sub_808FD34: @ 808FD34 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl GetGoSpeed0AnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + movs r0, 0x6 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808FD34 + + thumb_func_start sub_808FD64 +sub_808FD64: @ 808FD64 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _0808FD82 + ldrb r0, [r4] + movs r1, 0x3 + negs r1, r1 + ands r1, r0 + strb r1, [r4] + movs r0, 0x1 + strh r0, [r5, 0x30] +_0808FD82: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808FD64 + + thumb_func_start FieldObjectCB_FaceFixedDirection +FieldObjectCB_FaceFixedDirection: @ 808FD8C + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =FieldObjectCB2_FaceFixedDirection + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_FaceFixedDirection + + thumb_func_start FieldObjectCB2_FaceFixedDirection +@ bool8 FieldObjectCB2_FaceFixedDirection(struct npc_state *fieldObject, struct obj *object) +FieldObjectCB2_FaceFixedDirection: @ 808FDB0 + push {r4,lr} + ldr r3, =gUnknown_0850D794 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end FieldObjectCB2_FaceFixedDirection + + thumb_func_start sub_808FDD0 +@ bool8 sub_808FDD0(struct npc_state *fieldObject, struct obj *object) +sub_808FDD0: @ 808FDD0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl npc_reset + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x1 + strh r0, [r5, 0x30] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808FDD0 + + thumb_func_start sub_808FDFC +@ bool8 sub_808FDFC(struct npc_state *fieldObject, struct obj *object) +sub_808FDFC: @ 808FDFC + push {r4,lr} + adds r4, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + bne _0808FE0E + movs r0, 0 + b _0808FE14 +_0808FE0E: + movs r0, 0x2 + strh r0, [r4, 0x30] + movs r0, 0x1 +_0808FE14: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_808FDFC + + thumb_func_start sub_808FE1C +@ bool8 sub_808FE1C(struct npc_state *fieldObject, struct obj *object) +sub_808FE1C: @ 808FE1C + ldrb r2, [r0] + movs r1, 0x3 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + movs r0, 0 + bx lr + thumb_func_end sub_808FE1C + + thumb_func_start FieldObjectCB_BerryTree +FieldObjectCB_BerryTree: @ 808FE2C + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r5, r0, r1 + ldrh r1, [r4, 0x3C] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0808FE58 + adds r0, r5, 0 + adds r1, r4, 0 + bl get_berry_tree_graphics + ldrh r1, [r4, 0x3C] + movs r0, 0x1 + orrs r0, r1 + strh r0, [r4, 0x3C] +_0808FE58: + ldr r2, =FieldObjectCB2_BerryTree + adds r0, r5, 0 + adds r1, r4, 0 + bl FieldObjectStep + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_BerryTree + + thumb_func_start FieldObjectCB2_BerryTree +FieldObjectCB2_BerryTree: @ 808FE70 + push {r4,lr} + ldr r3, =gUnknown_0850D7A0 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end FieldObjectCB2_BerryTree + + thumb_func_start do_berry_tree_growth_sparkle_1 +@ bool8 do_berry_tree_growth_sparkle_1(struct npc_state *fieldObject, struct obj *object) +do_berry_tree_growth_sparkle_1: @ 808FE90 + push {r4-r7,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl npc_reset + ldrb r0, [r4, 0x1] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r4, 0x1] + adds r6, r5, 0 + adds r6, 0x3E + ldrb r0, [r6] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r6] + ldrb r0, [r4, 0x1D] + bl GetStageByBerryTreeId + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0 + bne _0808FF00 + ldrh r1, [r5, 0x3C] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _0808FEF6 + subs r6, 0x14 + ldrb r0, [r6] + cmp r0, 0x4 + bne _0808FEF6 + ldr r1, =0x02038c08 + movs r2, 0x10 + ldrsh r0, [r4, r2] + str r0, [r1] + movs r2, 0x12 + ldrsh r0, [r4, r2] + str r0, [r1, 0x4] + adds r0, r5, 0 + adds r0, 0x43 + ldrb r0, [r0] + subs r0, 0x1 + str r0, [r1, 0x8] + ldrb r0, [r5, 0x5] + lsls r0, 28 + lsrs r0, 30 + str r0, [r1, 0xC] + movs r0, 0x17 + bl FieldEffectStart + strb r7, [r6] +_0808FEF6: + movs r0, 0 + b _0808FF42 + .pool +_0808FF00: + ldrb r1, [r4, 0x1] + movs r0, 0x21 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x1] + ldrb r1, [r6] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r6] + subs r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r5, 0 + adds r0, 0x2A + ldrb r0, [r0] + cmp r0, r7 + bne _0808FF3C + adds r0, r4, 0 + adds r1, r5, 0 + bl get_berry_tree_graphics + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x39 + bl FieldObjectSetRegularAnim + movs r0, 0x1 + strh r0, [r5, 0x30] + b _0808FF42 +_0808FF3C: + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 +_0808FF42: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end do_berry_tree_growth_sparkle_1 + + thumb_func_start sub_808FF48 +@ bool8 sub_808FF48(struct npc_state *fieldObject, struct obj *object) +sub_808FF48: @ 808FF48 + push {r4,lr} + adds r4, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + bne _0808FF5A + movs r0, 0 + b _0808FF60 +_0808FF5A: + movs r0, 0 + strh r0, [r4, 0x30] + movs r0, 0x1 +_0808FF60: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_808FF48 + + thumb_func_start do_berry_tree_growth_sparkle_2 +@ bool8 do_berry_tree_growth_sparkle_2(struct npc_state *fieldObject, struct obj *object) +do_berry_tree_growth_sparkle_2: @ 808FF68 + push {r4,lr} + ldrb r2, [r0] + movs r3, 0x2 + orrs r2, r3 + strb r2, [r0] + movs r3, 0 + movs r2, 0x3 + strh r2, [r1, 0x30] + strh r3, [r1, 0x32] + ldrh r3, [r1, 0x3C] + movs r2, 0x2 + orrs r2, r3 + strh r2, [r1, 0x3C] + ldr r3, =0x02038c08 + movs r4, 0x10 + ldrsh r2, [r0, r4] + str r2, [r3] + movs r2, 0x12 + ldrsh r0, [r0, r2] + str r0, [r3, 0x4] + adds r0, r1, 0 + adds r0, 0x43 + ldrb r0, [r0] + subs r0, 0x1 + str r0, [r3, 0x8] + ldrb r0, [r1, 0x5] + lsls r0, 28 + lsrs r0, 30 + str r0, [r3, 0xC] + movs r0, 0x17 + bl FieldEffectStart + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end do_berry_tree_growth_sparkle_2 + + thumb_func_start sub_808FFB4 +@ bool8 sub_808FFB4(struct npc_state *fieldObject, struct obj *object) +sub_808FFB4: @ 808FFB4 + push {r4,lr} + adds r3, r0, 0 + adds r4, r1, 0 + ldrh r1, [r4, 0x32] + adds r1, 0x1 + strh r1, [r4, 0x32] + movs r0, 0x2 + ands r1, r0 + lsls r1, 16 + lsrs r1, 17 + lsls r1, 5 + ldrb r2, [r3, 0x1] + subs r0, 0x23 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x1] + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x40 + bgt _0808FFEC + movs r0, 0 + b _0808FFFE +_0808FFEC: + adds r0, r3, 0 + adds r1, r4, 0 + bl get_berry_tree_graphics + movs r0, 0x4 + strh r0, [r4, 0x30] + movs r0, 0 + strh r0, [r4, 0x32] + movs r0, 0x1 +_0808FFFE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_808FFB4 + + thumb_func_start sub_8090004 +@ bool8 sub_8090004(struct npc_state *fieldObject, struct obj *object) +sub_8090004: @ 8090004 + push {r4,lr} + adds r4, r1, 0 + ldrh r2, [r4, 0x32] + adds r2, 0x1 + strh r2, [r4, 0x32] + movs r1, 0x2 + ands r2, r1 + lsls r2, 16 + lsrs r2, 17 + lsls r2, 5 + ldrb r3, [r0, 0x1] + subs r1, 0x23 + ands r1, r3 + orrs r1, r2 + strb r1, [r0, 0x1] + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x40 + bgt _0809003A + movs r0, 0 + b _08090048 +_0809003A: + movs r0, 0 + strh r0, [r4, 0x30] + ldrh r1, [r4, 0x3C] + subs r0, 0x3 + ands r0, r1 + strh r0, [r4, 0x3C] + movs r0, 0x1 +_08090048: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8090004 + + thumb_func_start FieldObjectCB_RandomlyLookNorthOrSouth +FieldObjectCB_RandomlyLookNorthOrSouth: @ 8090050 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =FieldObjectCB2_RandomlyLookNorthOrSouth + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_RandomlyLookNorthOrSouth + + thumb_func_start FieldObjectCB2_RandomlyLookNorthOrSouth +FieldObjectCB2_RandomlyLookNorthOrSouth: @ 8090074 + push {r4,lr} + ldr r3, =gUnknown_0850D7B4 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end FieldObjectCB2_RandomlyLookNorthOrSouth + + thumb_func_start sub_8090094 +sub_8090094: @ 8090094 + push {r4,lr} + adds r4, r1, 0 + bl npc_reset + movs r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8090094 + + thumb_func_start sub_80900A8 +sub_80900A8: @ 80900A8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80900A8 + + thumb_func_start sub_80900D4 +sub_80900D4: @ 80900D4 + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _0809010A + ldr r4, =gUnknown_0850D6DC + bl GenerateRandomNumber + movs r5, 0x3 + adds r1, r5, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + movs r0, 0 + ldrsh r1, [r1, r0] + adds r0, r7, 0 + bl sub_8097978 + ldrb r1, [r6] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r6] + strh r5, [r7, 0x30] +_0809010A: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80900D4 + + thumb_func_start sub_8090118 +sub_8090118: @ 8090118 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + bne _08090136 + adds r0, r4, 0 + bl FieldObjectIsTrainerAndCloseToPlayer + lsls r0, 24 + cmp r0, 0 + beq _0809013E +_08090136: + movs r0, 0x4 + strh r0, [r5, 0x30] + movs r0, 0x1 + b _08090140 +_0809013E: + movs r0, 0 +_08090140: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090118 + + thumb_func_start sub_8090148 +sub_8090148: @ 8090148 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D770 + mov r0, sp + movs r2, 0x2 + bl memcpy + adds r0, r4, 0 + movs r1, 0x1 + bl sub_808F8BC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _08090178 + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + mov r2, sp + adds r0, r2, r1 + ldrb r1, [r0] +_08090178: + adds r0, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x1 + strh r0, [r5, 0x30] + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090148 + + thumb_func_start FieldObjectCB_RandomlyLookEastOrWest +FieldObjectCB_RandomlyLookEastOrWest: @ 8090190 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =FieldObjectCB2_RandomlyLookEastOrWest + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_RandomlyLookEastOrWest + + thumb_func_start FieldObjectCB2_RandomlyLookEastOrWest +FieldObjectCB2_RandomlyLookEastOrWest: @ 80901B4 + push {r4,lr} + ldr r3, =gUnknown_0850D7C8 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end FieldObjectCB2_RandomlyLookEastOrWest + + thumb_func_start sub_80901D4 +sub_80901D4: @ 80901D4 + push {r4,lr} + adds r4, r1, 0 + bl npc_reset + movs r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80901D4 + + thumb_func_start sub_80901E8 +sub_80901E8: @ 80901E8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80901E8 + + thumb_func_start sub_8090214 +sub_8090214: @ 8090214 + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _0809024A + ldr r4, =gUnknown_0850D6DC + bl GenerateRandomNumber + movs r5, 0x3 + adds r1, r5, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + movs r0, 0 + ldrsh r1, [r1, r0] + adds r0, r7, 0 + bl sub_8097978 + ldrb r1, [r6] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r6] + strh r5, [r7, 0x30] +_0809024A: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090214 + + thumb_func_start sub_8090258 +sub_8090258: @ 8090258 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + bne _08090276 + adds r0, r4, 0 + bl FieldObjectIsTrainerAndCloseToPlayer + lsls r0, 24 + cmp r0, 0 + beq _0809027E +_08090276: + movs r0, 0x4 + strh r0, [r5, 0x30] + movs r0, 0x1 + b _08090280 +_0809027E: + movs r0, 0 +_08090280: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090258 + + thumb_func_start sub_8090288 +sub_8090288: @ 8090288 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D790 + mov r0, sp + movs r2, 0x2 + bl memcpy + adds r0, r4, 0 + movs r1, 0x2 + bl sub_808F8BC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _080902B8 + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + mov r2, sp + adds r0, r2, r1 + ldrb r1, [r0] +_080902B8: + adds r0, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x1 + strh r0, [r5, 0x30] + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090288 + + thumb_func_start FieldObjectCB_RandomlyLookNorthOrWest +FieldObjectCB_RandomlyLookNorthOrWest: @ 80902D0 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =FieldObjectCB2_RandomlyLookNorthOrWest + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_RandomlyLookNorthOrWest + + thumb_func_start FieldObjectCB2_RandomlyLookNorthOrWest +FieldObjectCB2_RandomlyLookNorthOrWest: @ 80902F4 + push {r4,lr} + ldr r3, =gUnknown_0850D7DC + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end FieldObjectCB2_RandomlyLookNorthOrWest + + thumb_func_start sub_8090314 +sub_8090314: @ 8090314 + push {r4,lr} + adds r4, r1, 0 + bl npc_reset + movs r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8090314 + + thumb_func_start sub_8090328 +sub_8090328: @ 8090328 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090328 + + thumb_func_start sub_8090354 +sub_8090354: @ 8090354 + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _0809038A + ldr r4, =gUnknown_0850D6EC + bl GenerateRandomNumber + movs r5, 0x3 + adds r1, r5, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + movs r0, 0 + ldrsh r1, [r1, r0] + adds r0, r7, 0 + bl sub_8097978 + ldrb r1, [r6] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r6] + strh r5, [r7, 0x30] +_0809038A: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090354 + + thumb_func_start sub_8090398 +sub_8090398: @ 8090398 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + bne _080903B6 + adds r0, r4, 0 + bl FieldObjectIsTrainerAndCloseToPlayer + lsls r0, 24 + cmp r0, 0 + beq _080903BE +_080903B6: + movs r0, 0x4 + strh r0, [r5, 0x30] + movs r0, 0x1 + b _080903C0 +_080903BE: + movs r0, 0 +_080903C0: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090398 + + thumb_func_start sub_80903C8 +sub_80903C8: @ 80903C8 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D7F0 + mov r0, sp + movs r2, 0x2 + bl memcpy + adds r0, r4, 0 + movs r1, 0x3 + bl sub_808F8BC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _080903F8 + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + mov r2, sp + adds r0, r2, r1 + ldrb r1, [r0] +_080903F8: + adds r0, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x1 + strh r0, [r5, 0x30] + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80903C8 + + thumb_func_start FieldObjectCB_RandomlyLookNorthOrEast +FieldObjectCB_RandomlyLookNorthOrEast: @ 8090410 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8090434 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_RandomlyLookNorthOrEast + + thumb_func_start sub_8090434 +sub_8090434: @ 8090434 + push {r4,lr} + ldr r3, =gUnknown_0850D7F4 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090434 + + thumb_func_start sub_8090454 +sub_8090454: @ 8090454 + push {r4,lr} + adds r4, r1, 0 + bl npc_reset + movs r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8090454 + + thumb_func_start sub_8090468 +sub_8090468: @ 8090468 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090468 + + thumb_func_start sub_8090494 +sub_8090494: @ 8090494 + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _080904CA + ldr r4, =gUnknown_0850D6EC + bl GenerateRandomNumber + movs r5, 0x3 + adds r1, r5, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + movs r0, 0 + ldrsh r1, [r1, r0] + adds r0, r7, 0 + bl sub_8097978 + ldrb r1, [r6] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r6] + strh r5, [r7, 0x30] +_080904CA: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090494 + + thumb_func_start sub_80904D8 +sub_80904D8: @ 80904D8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + bne _080904F6 + adds r0, r4, 0 + bl FieldObjectIsTrainerAndCloseToPlayer + lsls r0, 24 + cmp r0, 0 + beq _080904FE +_080904F6: + movs r0, 0x4 + strh r0, [r5, 0x30] + movs r0, 0x1 + b _08090500 +_080904FE: + movs r0, 0 +_08090500: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80904D8 + + thumb_func_start sub_8090508 +sub_8090508: @ 8090508 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D808 + mov r0, sp + movs r2, 0x2 + bl memcpy + adds r0, r4, 0 + movs r1, 0x4 + bl sub_808F8BC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _08090538 + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + mov r2, sp + adds r0, r2, r1 + ldrb r1, [r0] +_08090538: + adds r0, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x1 + strh r0, [r5, 0x30] + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090508 + + thumb_func_start FieldObjectCB_RandomlyLookSouthOrWest +FieldObjectCB_RandomlyLookSouthOrWest: @ 8090550 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8090574 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_RandomlyLookSouthOrWest + + thumb_func_start sub_8090574 +sub_8090574: @ 8090574 + push {r4,lr} + ldr r3, =gUnknown_0850D80C + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090574 + + thumb_func_start sub_8090594 +sub_8090594: @ 8090594 + push {r4,lr} + adds r4, r1, 0 + bl npc_reset + movs r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8090594 + + thumb_func_start sub_80905A8 +sub_80905A8: @ 80905A8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80905A8 + + thumb_func_start sub_80905D4 +sub_80905D4: @ 80905D4 + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _0809060A + ldr r4, =gUnknown_0850D6EC + bl GenerateRandomNumber + movs r5, 0x3 + adds r1, r5, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + movs r0, 0 + ldrsh r1, [r1, r0] + adds r0, r7, 0 + bl sub_8097978 + ldrb r1, [r6] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r6] + strh r5, [r7, 0x30] +_0809060A: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80905D4 + + thumb_func_start sub_8090618 +sub_8090618: @ 8090618 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + bne _08090636 + adds r0, r4, 0 + bl FieldObjectIsTrainerAndCloseToPlayer + lsls r0, 24 + cmp r0, 0 + beq _0809063E +_08090636: + movs r0, 0x4 + strh r0, [r5, 0x30] + movs r0, 0x1 + b _08090640 +_0809063E: + movs r0, 0 +_08090640: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090618 + + thumb_func_start sub_8090648 +sub_8090648: @ 8090648 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D820 + mov r0, sp + movs r2, 0x2 + bl memcpy + adds r0, r4, 0 + movs r1, 0x5 + bl sub_808F8BC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _08090678 + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + mov r2, sp + adds r0, r2, r1 + ldrb r1, [r0] +_08090678: + adds r0, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x1 + strh r0, [r5, 0x30] + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090648 + + thumb_func_start FieldObjectCB_RandomlyLookSouthOrEast +FieldObjectCB_RandomlyLookSouthOrEast: @ 8090690 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_80906B4 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_RandomlyLookSouthOrEast + + thumb_func_start sub_80906B4 +sub_80906B4: @ 80906B4 + push {r4,lr} + ldr r3, =gUnknown_0850D824 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80906B4 + + thumb_func_start sub_80906D4 +sub_80906D4: @ 80906D4 + push {r4,lr} + adds r4, r1, 0 + bl npc_reset + movs r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80906D4 + + thumb_func_start sub_80906E8 +sub_80906E8: @ 80906E8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80906E8 + + thumb_func_start sub_8090714 +sub_8090714: @ 8090714 + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _0809074A + ldr r4, =gUnknown_0850D6EC + bl GenerateRandomNumber + movs r5, 0x3 + adds r1, r5, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + movs r0, 0 + ldrsh r1, [r1, r0] + adds r0, r7, 0 + bl sub_8097978 + ldrb r1, [r6] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r6] + strh r5, [r7, 0x30] +_0809074A: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090714 + + thumb_func_start sub_8090758 +sub_8090758: @ 8090758 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + bne _08090776 + adds r0, r4, 0 + bl FieldObjectIsTrainerAndCloseToPlayer + lsls r0, 24 + cmp r0, 0 + beq _0809077E +_08090776: + movs r0, 0x4 + strh r0, [r5, 0x30] + movs r0, 0x1 + b _08090780 +_0809077E: + movs r0, 0 +_08090780: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090758 + + thumb_func_start sub_8090788 +sub_8090788: @ 8090788 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D838 + mov r0, sp + movs r2, 0x2 + bl memcpy + adds r0, r4, 0 + movs r1, 0x6 + bl sub_808F8BC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _080907B8 + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + mov r2, sp + adds r0, r2, r1 + ldrb r1, [r0] +_080907B8: + adds r0, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x1 + strh r0, [r5, 0x30] + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090788 + + thumb_func_start FieldObjectCB_RandomlyLookNorthOrSouthOrWest +FieldObjectCB_RandomlyLookNorthOrSouthOrWest: @ 80907D0 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_80907F4 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_RandomlyLookNorthOrSouthOrWest + + thumb_func_start sub_80907F4 +sub_80907F4: @ 80907F4 + push {r4,lr} + ldr r3, =gUnknown_0850D83C + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80907F4 + + thumb_func_start sub_8090814 +sub_8090814: @ 8090814 + push {r4,lr} + adds r4, r1, 0 + bl npc_reset + movs r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8090814 + + thumb_func_start sub_8090828 +sub_8090828: @ 8090828 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090828 + + thumb_func_start sub_8090854 +sub_8090854: @ 8090854 + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _0809088A + ldr r4, =gUnknown_0850D6EC + bl GenerateRandomNumber + movs r5, 0x3 + adds r1, r5, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + movs r0, 0 + ldrsh r1, [r1, r0] + adds r0, r7, 0 + bl sub_8097978 + ldrb r1, [r6] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r6] + strh r5, [r7, 0x30] +_0809088A: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090854 + + thumb_func_start sub_8090898 +sub_8090898: @ 8090898 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + bne _080908B6 + adds r0, r4, 0 + bl FieldObjectIsTrainerAndCloseToPlayer + lsls r0, 24 + cmp r0, 0 + beq _080908BE +_080908B6: + movs r0, 0x4 + strh r0, [r5, 0x30] + movs r0, 0x1 + b _080908C0 +_080908BE: + movs r0, 0 +_080908C0: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090898 + + thumb_func_start sub_80908C8 +sub_80908C8: @ 80908C8 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D850 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r0, r4, 0 + movs r1, 0x7 + bl sub_808F8BC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _080908F8 + bl GenerateRandomNumber + movs r1, 0x3 + ands r1, r0 + mov r2, sp + adds r0, r2, r1 + ldrb r1, [r0] +_080908F8: + adds r0, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x1 + strh r0, [r5, 0x30] + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80908C8 + + thumb_func_start FieldObjectCB_RandomlyLookNorthOrSouthOrEast +FieldObjectCB_RandomlyLookNorthOrSouthOrEast: @ 8090910 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8090934 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_RandomlyLookNorthOrSouthOrEast + + thumb_func_start sub_8090934 +sub_8090934: @ 8090934 + push {r4,lr} + ldr r3, =gUnknown_0850D854 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090934 + + thumb_func_start sub_8090954 +sub_8090954: @ 8090954 + push {r4,lr} + adds r4, r1, 0 + bl npc_reset + movs r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8090954 + + thumb_func_start sub_8090968 +sub_8090968: @ 8090968 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090968 + + thumb_func_start sub_8090994 +sub_8090994: @ 8090994 + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _080909CA + ldr r4, =gUnknown_0850D6EC + bl GenerateRandomNumber + movs r5, 0x3 + adds r1, r5, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + movs r0, 0 + ldrsh r1, [r1, r0] + adds r0, r7, 0 + bl sub_8097978 + ldrb r1, [r6] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r6] + strh r5, [r7, 0x30] +_080909CA: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090994 + + thumb_func_start sub_80909D8 +sub_80909D8: @ 80909D8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + bne _080909F6 + adds r0, r4, 0 + bl FieldObjectIsTrainerAndCloseToPlayer + lsls r0, 24 + cmp r0, 0 + beq _080909FE +_080909F6: + movs r0, 0x4 + strh r0, [r5, 0x30] + movs r0, 0x1 + b _08090A00 +_080909FE: + movs r0, 0 +_08090A00: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80909D8 + + thumb_func_start sub_8090A08 +sub_8090A08: @ 8090A08 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D868 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r0, r4, 0 + movs r1, 0x8 + bl sub_808F8BC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _08090A38 + bl GenerateRandomNumber + movs r1, 0x3 + ands r1, r0 + mov r2, sp + adds r0, r2, r1 + ldrb r1, [r0] +_08090A38: + adds r0, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x1 + strh r0, [r5, 0x30] + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090A08 + + thumb_func_start FieldObjectCB_RandomlyLookNorthOrEastOrWest +FieldObjectCB_RandomlyLookNorthOrEastOrWest: @ 8090A50 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8090A74 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_RandomlyLookNorthOrEastOrWest + + thumb_func_start sub_8090A74 +sub_8090A74: @ 8090A74 + push {r4,lr} + ldr r3, =gUnknown_0850D86C + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090A74 + + thumb_func_start sub_8090A94 +sub_8090A94: @ 8090A94 + push {r4,lr} + adds r4, r1, 0 + bl npc_reset + movs r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8090A94 + + thumb_func_start sub_8090AA8 +sub_8090AA8: @ 8090AA8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090AA8 + + thumb_func_start sub_8090AD4 +sub_8090AD4: @ 8090AD4 + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _08090B0A + ldr r4, =gUnknown_0850D6EC + bl GenerateRandomNumber + movs r5, 0x3 + adds r1, r5, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + movs r0, 0 + ldrsh r1, [r1, r0] + adds r0, r7, 0 + bl sub_8097978 + ldrb r1, [r6] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r6] + strh r5, [r7, 0x30] +_08090B0A: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090AD4 + + thumb_func_start sub_8090B18 +sub_8090B18: @ 8090B18 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + bne _08090B36 + adds r0, r4, 0 + bl FieldObjectIsTrainerAndCloseToPlayer + lsls r0, 24 + cmp r0, 0 + beq _08090B3E +_08090B36: + movs r0, 0x4 + strh r0, [r5, 0x30] + movs r0, 0x1 + b _08090B40 +_08090B3E: + movs r0, 0 +_08090B40: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090B18 + + thumb_func_start sub_8090B48 +sub_8090B48: @ 8090B48 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D880 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r0, r4, 0 + movs r1, 0x9 + bl sub_808F8BC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _08090B78 + bl GenerateRandomNumber + movs r1, 0x3 + ands r1, r0 + mov r2, sp + adds r0, r2, r1 + ldrb r1, [r0] +_08090B78: + adds r0, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x1 + strh r0, [r5, 0x30] + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090B48 + + thumb_func_start FieldObjectCB_RandomlyLookSouthOrEastOrWest +FieldObjectCB_RandomlyLookSouthOrEastOrWest: @ 8090B90 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8090BB4 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_RandomlyLookSouthOrEastOrWest + + thumb_func_start sub_8090BB4 +sub_8090BB4: @ 8090BB4 + push {r4,lr} + ldr r3, =gUnknown_0850D884 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090BB4 + + thumb_func_start sub_8090BD4 +sub_8090BD4: @ 8090BD4 + push {r4,lr} + adds r4, r1, 0 + bl npc_reset + movs r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8090BD4 + + thumb_func_start sub_8090BE8 +sub_8090BE8: @ 8090BE8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090BE8 + + thumb_func_start sub_8090C14 +sub_8090C14: @ 8090C14 + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _08090C4A + ldr r4, =gUnknown_0850D6EC + bl GenerateRandomNumber + movs r5, 0x3 + adds r1, r5, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + movs r0, 0 + ldrsh r1, [r1, r0] + adds r0, r7, 0 + bl sub_8097978 + ldrb r1, [r6] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r6] + strh r5, [r7, 0x30] +_08090C4A: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090C14 + + thumb_func_start sub_8090C58 +sub_8090C58: @ 8090C58 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + bne _08090C76 + adds r0, r4, 0 + bl FieldObjectIsTrainerAndCloseToPlayer + lsls r0, 24 + cmp r0, 0 + beq _08090C7E +_08090C76: + movs r0, 0x4 + strh r0, [r5, 0x30] + movs r0, 0x1 + b _08090C80 +_08090C7E: + movs r0, 0 +_08090C80: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090C58 + + thumb_func_start sub_8090C88 +sub_8090C88: @ 8090C88 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D898 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r0, r4, 0 + movs r1, 0xA + bl sub_808F8BC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _08090CB8 + bl GenerateRandomNumber + movs r1, 0x3 + ands r1, r0 + mov r2, sp + adds r0, r2, r1 + ldrb r1, [r0] +_08090CB8: + adds r0, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x1 + strh r0, [r5, 0x30] + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090C88 + + thumb_func_start FieldObjectCB_LookAroundCounterclockwise +FieldObjectCB_LookAroundCounterclockwise: @ 8090CD0 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8090CF4 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_LookAroundCounterclockwise + + thumb_func_start sub_8090CF4 +sub_8090CF4: @ 8090CF4 + push {r4,lr} + ldr r3, =gUnknown_0850D89C + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090CF4 + + thumb_func_start sub_8090D14 +sub_8090D14: @ 8090D14 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl npc_reset + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x1 + strh r0, [r5, 0x30] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090D14 + + thumb_func_start sub_8090D40 +sub_8090D40: @ 8090D40 + push {r4,lr} + adds r4, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _08090D5A + adds r0, r4, 0 + movs r1, 0x30 + bl sub_8097978 + movs r0, 0x2 + strh r0, [r4, 0x30] +_08090D5A: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8090D40 + + thumb_func_start sub_8090D64 +sub_8090D64: @ 8090D64 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + bne _08090D82 + adds r0, r4, 0 + bl FieldObjectIsTrainerAndCloseToPlayer + lsls r0, 24 + cmp r0, 0 + beq _08090D86 +_08090D82: + movs r0, 0x3 + strh r0, [r5, 0x30] +_08090D86: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090D64 + + thumb_func_start sub_8090D90 +@ bool8 sub_8090D90(struct npc_state *fieldObject, struct obj *object) +sub_8090D90: @ 8090D90 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D8AC + mov r0, sp + movs r2, 0x5 + bl memcpy + adds r0, r4, 0 + movs r1, 0 + bl sub_808F8BC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _08090DBC + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + add r0, sp + ldrb r1, [r0] +_08090DBC: + adds r0, r4, 0 + bl FieldObjectSetDirection + movs r0, 0 + strh r0, [r5, 0x30] + movs r0, 0x1 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090D90 + + thumb_func_start FieldObjectCB_LookAroundClockwise +FieldObjectCB_LookAroundClockwise: @ 8090DD4 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8090DF8 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_LookAroundClockwise + + thumb_func_start sub_8090DF8 +sub_8090DF8: @ 8090DF8 + push {r4,lr} + ldr r3, =gUnknown_0850D8B4 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090DF8 + + thumb_func_start sub_8090E18 +sub_8090E18: @ 8090E18 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl npc_reset + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x1 + strh r0, [r5, 0x30] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090E18 + + thumb_func_start sub_8090E44 +sub_8090E44: @ 8090E44 + push {r4,lr} + adds r4, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _08090E5E + adds r0, r4, 0 + movs r1, 0x30 + bl sub_8097978 + movs r0, 0x2 + strh r0, [r4, 0x30] +_08090E5E: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8090E44 + + thumb_func_start sub_8090E68 +sub_8090E68: @ 8090E68 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + bne _08090E86 + adds r0, r4, 0 + bl FieldObjectIsTrainerAndCloseToPlayer + lsls r0, 24 + cmp r0, 0 + beq _08090E8A +_08090E86: + movs r0, 0x3 + strh r0, [r5, 0x30] +_08090E8A: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090E68 + + thumb_func_start sub_8090E94 +sub_8090E94: @ 8090E94 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D8C4 + mov r0, sp + movs r2, 0x5 + bl memcpy + adds r0, r4, 0 + movs r1, 0 + bl sub_808F8BC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _08090EC0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + add r0, sp + ldrb r1, [r0] +_08090EC0: + adds r0, r4, 0 + bl FieldObjectSetDirection + movs r0, 0 + strh r0, [r5, 0x30] + movs r0, 0x1 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090E94 + + thumb_func_start FieldObjectCB_AlternatelyGoInOppositeDirections +FieldObjectCB_AlternatelyGoInOppositeDirections: @ 8090ED8 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8090EFC + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_AlternatelyGoInOppositeDirections + + thumb_func_start sub_8090EFC +sub_8090EFC: @ 8090EFC + push {r4,lr} + ldr r3, =gUnknown_0850D8CC + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090EFC + + thumb_func_start sub_8090F1C +sub_8090F1C: @ 8090F1C + push {r4,lr} + adds r4, r1, 0 + bl npc_reset + movs r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8090F1C + + thumb_func_start sub_8090F30 +@ bool8 sub_8090F30(struct npc_state *fieldObject, struct obj *object) +sub_8090F30: @ 8090F30 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, =gUnknown_085055CD + ldrb r1, [r4, 0x6] + adds r1, r0 + ldrb r1, [r1] + adds r0, r4, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0 + beq _08090F52 + adds r0, r1, 0 + bl GetOppositeDirection + lsls r0, 24 + lsrs r1, r0, 24 +_08090F52: + adds r0, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090F30 + + thumb_func_start sub_8090F68 +@ bool8 sub_8090F68(struct npc_state *fieldObject, struct obj *object) +sub_8090F68: @ 8090F68 + push {r4-r7,lr} + adds r4, r0, 0 + adds r7, r1, 0 + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0 + beq _08090F98 + ldr r1, [r4, 0xC] + ldr r0, [r4, 0x10] + cmp r1, r0 + bne _08090F98 + movs r0, 0 + strb r0, [r2] + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl GetOppositeDirection + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetDirection +_08090F98: + ldrb r1, [r4, 0x18] + lsrs r1, 4 + adds r0, r4, 0 + bl sub_8092B88 + lsls r0, 24 + lsrs r5, r0, 24 + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl GetGoSpeed0AnimId + lsls r0, 24 + lsrs r6, r0, 24 + cmp r5, 0x1 + bne _08090FEE + adds r1, r4, 0 + adds r1, 0x21 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl GetOppositeDirection + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetDirection + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl GetGoSpeed0AnimId + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r1, [r4, 0x18] + lsrs r1, 4 + adds r0, r4, 0 + bl sub_8092B88 + lsls r0, 24 + lsrs r5, r0, 24 +_08090FEE: + cmp r5, 0 + beq _08091000 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetStepInPlaceDelay16AnimId + lsls r0, 24 + lsrs r6, r0, 24 +_08091000: + adds r0, r4, 0 + adds r1, r7, 0 + adds r2, r6, 0 + bl FieldObjectSetRegularAnim + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + movs r0, 0x3 + strh r0, [r7, 0x30] + movs r0, 0x1 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8090F68 + + thumb_func_start sub_8091020 +@ bool8 sub_8091020(struct npc_state *fieldObject, struct obj *object) +sub_8091020: @ 8091020 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _0809103E + ldrb r0, [r4] + movs r1, 0x3 + negs r1, r1 + ands r1, r0 + strb r1, [r4] + movs r0, 0x1 + strh r0, [r5, 0x30] +_0809103E: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8091020 + + thumb_func_start sub_8091048 +@ bool8 sub_8091048(struct npc_state *fieldObject, struct obj *object) +sub_8091048: @ 8091048 + push {r4,lr} + adds r4, r1, 0 + bl npc_reset + movs r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8091048 + + thumb_func_start MoveFieldObjectInNextDirectionInSequence +@ bool8 MoveFieldObjectInNextDirectionInSequence(struct npc_state *fieldObject, struct obj *object, u8 *directions) +MoveFieldObjectInNextDirectionInSequence: @ 809105C + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + mov r8, r1 + adds r7, r2, 0 + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x3 + bne _0809107E + ldr r1, [r4, 0xC] + ldr r0, [r4, 0x10] + cmp r1, r0 + bne _0809107E + movs r0, 0 + strb r0, [r2] +_0809107E: + adds r5, r4, 0 + adds r5, 0x21 + ldrb r0, [r5] + adds r0, r7, r0 + ldrb r1, [r0] + adds r0, r4, 0 + bl FieldObjectSetDirection + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl GetGoSpeed0AnimId + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r1, [r4, 0x18] + lsrs r1, 4 + adds r0, r4, 0 + bl sub_8092B88 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080910D8 + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + ldrb r0, [r5] + adds r0, r7, r0 + ldrb r1, [r0] + adds r0, r4, 0 + bl FieldObjectSetDirection + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl GetGoSpeed0AnimId + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r1, [r4, 0x18] + lsrs r1, 4 + adds r0, r4, 0 + bl sub_8092B88 + lsls r0, 24 + lsrs r0, 24 +_080910D8: + cmp r0, 0 + beq _080910EA + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetStepInPlaceDelay16AnimId + lsls r0, 24 + lsrs r6, r0, 24 +_080910EA: + adds r0, r4, 0 + mov r1, r8 + adds r2, r6, 0 + bl FieldObjectSetRegularAnim + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + movs r0, 0x2 + mov r1, r8 + strh r0, [r1, 0x30] + movs r0, 0x1 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end MoveFieldObjectInNextDirectionInSequence + + thumb_func_start sub_8091110 +@ bool8 sub_8091110(struct npc_state *fieldObject, struct obj *object) +sub_8091110: @ 8091110 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _0809112E + ldrb r0, [r4] + movs r1, 0x3 + negs r1, r1 + ands r1, r0 + strb r1, [r4] + movs r0, 0x1 + strh r0, [r5, 0x30] +_0809112E: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8091110 + + thumb_func_start FieldObjectCB_GoInDirectionSequence1 +FieldObjectCB_GoInDirectionSequence1: @ 8091138 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_809115C + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence1 + + thumb_func_start sub_809115C +sub_809115C: @ 809115C + push {r4,lr} + ldr r3, =gUnknown_0850D8DC + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809115C + + thumb_func_start sub_809117C +sub_809117C: @ 809117C + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D8E8 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x2 + bne _080911A8 + movs r0, 0xC + ldrsh r1, [r4, r0] + movs r3, 0x10 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _080911A8 + movs r0, 0x3 + strb r0, [r2] +_080911A8: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809117C + + thumb_func_start FieldObjectCB_GoInDirectionSequence2 +FieldObjectCB_GoInDirectionSequence2: @ 80911C4 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_80911E8 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence2 + + thumb_func_start sub_80911E8 +sub_80911E8: @ 80911E8 + push {r4,lr} + ldr r3, =gUnknown_0850D8EC + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80911E8 + + thumb_func_start sub_8091208 +sub_8091208: @ 8091208 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D8F8 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x1 + bne _08091234 + movs r0, 0xC + ldrsh r1, [r4, r0] + movs r3, 0x10 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _08091234 + movs r0, 0x2 + strb r0, [r2] +_08091234: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091208 + + thumb_func_start FieldObjectCB_GoInDirectionSequence3 +FieldObjectCB_GoInDirectionSequence3: @ 8091250 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091274 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence3 + + thumb_func_start sub_8091274 +sub_8091274: @ 8091274 + push {r4,lr} + ldr r3, =gUnknown_0850D8FC + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091274 + + thumb_func_start sub_8091294 +sub_8091294: @ 8091294 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D908 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x1 + bne _080912C0 + movs r0, 0xE + ldrsh r1, [r4, r0] + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _080912C0 + movs r0, 0x2 + strb r0, [r2] +_080912C0: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091294 + + thumb_func_start FieldObjectCB_GoInDirectionSequence4 +FieldObjectCB_GoInDirectionSequence4: @ 80912DC + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091300 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence4 + + thumb_func_start sub_8091300 +sub_8091300: @ 8091300 + push {r4,lr} + ldr r3, =gUnknown_0850D90C + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091300 + + thumb_func_start sub_8091320 +sub_8091320: @ 8091320 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D918 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x2 + bne _0809134C + movs r0, 0xE + ldrsh r1, [r4, r0] + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _0809134C + movs r0, 0x3 + strb r0, [r2] +_0809134C: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091320 + + thumb_func_start FieldObjectCB_GoInDirectionSequence5 +FieldObjectCB_GoInDirectionSequence5: @ 8091368 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_809138C + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence5 + + thumb_func_start sub_809138C +sub_809138C: @ 809138C + push {r4,lr} + ldr r3, =gUnknown_0850D91C + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809138C + + thumb_func_start sub_80913AC +@ bool8 sub_80913AC(struct npc_state *fieldObject, struct obj *object) +sub_80913AC: @ 80913AC + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D928 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x2 + bne _080913D8 + movs r0, 0xC + ldrsh r1, [r4, r0] + movs r3, 0x10 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _080913D8 + movs r0, 0x3 + strb r0, [r2] +_080913D8: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80913AC + + thumb_func_start FieldObjectCB_GoInDirectionSequence6 +FieldObjectCB_GoInDirectionSequence6: @ 80913F4 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091418 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence6 + + thumb_func_start sub_8091418 +sub_8091418: @ 8091418 + push {r4,lr} + ldr r3, =gUnknown_0850D92C + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091418 + + thumb_func_start sub_8091438 +sub_8091438: @ 8091438 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D938 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x1 + bne _08091464 + movs r0, 0xC + ldrsh r1, [r4, r0] + movs r3, 0x10 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _08091464 + movs r0, 0x2 + strb r0, [r2] +_08091464: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091438 + + thumb_func_start FieldObjectCB_GoInDirectionSequence7 +FieldObjectCB_GoInDirectionSequence7: @ 8091480 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_80914A4 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence7 + + thumb_func_start sub_80914A4 +sub_80914A4: @ 80914A4 + push {r4,lr} + ldr r3, =gUnknown_0850D93C + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80914A4 + + thumb_func_start sub_80914C4 +sub_80914C4: @ 80914C4 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D710 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x1 + bne _080914F0 + movs r0, 0xE + ldrsh r1, [r4, r0] + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _080914F0 + movs r0, 0x2 + strb r0, [r2] +_080914F0: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80914C4 + + thumb_func_start FieldObjectCB_GoInDirectionSequence8 +FieldObjectCB_GoInDirectionSequence8: @ 809150C + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091530 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence8 + + thumb_func_start sub_8091530 +sub_8091530: @ 8091530 + push {r4,lr} + ldr r3, =gUnknown_0850D948 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091530 + + thumb_func_start sub_8091550 +sub_8091550: @ 8091550 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D954 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x2 + bne _0809157C + movs r0, 0xE + ldrsh r1, [r4, r0] + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _0809157C + movs r0, 0x3 + strb r0, [r2] +_0809157C: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091550 + + thumb_func_start FieldObjectCB_GoInDirectionSequence9 +FieldObjectCB_GoInDirectionSequence9: @ 8091598 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_80915BC + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence9 + + thumb_func_start sub_80915BC +sub_80915BC: @ 80915BC + push {r4,lr} + ldr r3, =gUnknown_0850D958 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80915BC + + thumb_func_start sub_80915DC +sub_80915DC: @ 80915DC + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D964 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x2 + bne _08091608 + movs r0, 0xE + ldrsh r1, [r4, r0] + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _08091608 + movs r0, 0x3 + strb r0, [r2] +_08091608: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80915DC + + thumb_func_start FieldObjectCB_GoInDirectionSequence10 +FieldObjectCB_GoInDirectionSequence10: @ 8091624 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091648 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence10 + + thumb_func_start sub_8091648 +sub_8091648: @ 8091648 + push {r4,lr} + ldr r3, =gUnknown_0850D968 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091648 + + thumb_func_start sub_8091668 +sub_8091668: @ 8091668 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D974 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x1 + bne _08091694 + movs r0, 0xE + ldrsh r1, [r4, r0] + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _08091694 + movs r0, 0x2 + strb r0, [r2] +_08091694: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091668 + + thumb_func_start FieldObjectCB_GoInDirectionSequence11 +FieldObjectCB_GoInDirectionSequence11: @ 80916B0 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_80916D4 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence11 + + thumb_func_start sub_80916D4 +sub_80916D4: @ 80916D4 + push {r4,lr} + ldr r3, =gUnknown_0850D978 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80916D4 + + thumb_func_start sub_80916F4 +sub_80916F4: @ 80916F4 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D984 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x1 + bne _08091720 + movs r0, 0xC + ldrsh r1, [r4, r0] + movs r3, 0x10 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _08091720 + movs r0, 0x2 + strb r0, [r2] +_08091720: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80916F4 + + thumb_func_start FieldObjectCB_GoInDirectionSequence12 +FieldObjectCB_GoInDirectionSequence12: @ 809173C + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091760 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence12 + + thumb_func_start sub_8091760 +sub_8091760: @ 8091760 + push {r4,lr} + ldr r3, =gUnknown_0850D988 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091760 + + thumb_func_start sub_8091780 +sub_8091780: @ 8091780 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D994 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x2 + bne _080917AC + movs r0, 0xC + ldrsh r1, [r4, r0] + movs r3, 0x10 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _080917AC + movs r0, 0x3 + strb r0, [r2] +_080917AC: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091780 + + thumb_func_start FieldObjectCB_GoInDirectionSequence13 +FieldObjectCB_GoInDirectionSequence13: @ 80917C8 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_80917EC + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence13 + + thumb_func_start sub_80917EC +sub_80917EC: @ 80917EC + push {r4,lr} + ldr r3, =gUnknown_0850D998 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80917EC + + thumb_func_start sub_809180C +sub_809180C: @ 809180C + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D9A4 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x2 + bne _08091838 + movs r0, 0xE + ldrsh r1, [r4, r0] + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _08091838 + movs r0, 0x3 + strb r0, [r2] +_08091838: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809180C + + thumb_func_start FieldObjectCB_GoInDirectionSequence14 +FieldObjectCB_GoInDirectionSequence14: @ 8091854 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091878 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence14 + + thumb_func_start sub_8091878 +sub_8091878: @ 8091878 + push {r4,lr} + ldr r3, =gUnknown_0850D9A8 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091878 + + thumb_func_start sub_8091898 +sub_8091898: @ 8091898 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D9B4 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x1 + bne _080918C4 + movs r0, 0xE + ldrsh r1, [r4, r0] + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _080918C4 + movs r0, 0x2 + strb r0, [r2] +_080918C4: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091898 + + thumb_func_start FieldObjectCB_GoInDirectionSequence15 +FieldObjectCB_GoInDirectionSequence15: @ 80918E0 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091904 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence15 + + thumb_func_start sub_8091904 +sub_8091904: @ 8091904 + push {r4,lr} + ldr r3, =gUnknown_0850D9B8 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091904 + + thumb_func_start sub_8091924 +sub_8091924: @ 8091924 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D9C4 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x1 + bne _08091950 + movs r0, 0xC + ldrsh r1, [r4, r0] + movs r3, 0x10 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _08091950 + movs r0, 0x2 + strb r0, [r2] +_08091950: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091924 + + thumb_func_start FieldObjectCB_GoInDirectionSequence16 +FieldObjectCB_GoInDirectionSequence16: @ 809196C + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091990 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence16 + + thumb_func_start sub_8091990 +sub_8091990: @ 8091990 + push {r4,lr} + ldr r3, =gUnknown_0850D9C8 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091990 + + thumb_func_start sub_80919B0 +sub_80919B0: @ 80919B0 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D9D4 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x2 + bne _080919DC + movs r0, 0xC + ldrsh r1, [r4, r0] + movs r3, 0x10 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _080919DC + movs r0, 0x3 + strb r0, [r2] +_080919DC: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80919B0 + + thumb_func_start FieldObjectCB_GoInDirectionSequence17 +FieldObjectCB_GoInDirectionSequence17: @ 80919F8 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091A1C + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence17 + + thumb_func_start sub_8091A1C +sub_8091A1C: @ 8091A1C + push {r4,lr} + ldr r3, =gUnknown_0850D9D8 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091A1C + + thumb_func_start sub_8091A3C +sub_8091A3C: @ 8091A3C + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D9E4 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x2 + bne _08091A68 + movs r0, 0xE + ldrsh r1, [r4, r0] + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _08091A68 + movs r0, 0x3 + strb r0, [r2] +_08091A68: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091A3C + + thumb_func_start FieldObjectCB_GoInDirectionSequence18 +FieldObjectCB_GoInDirectionSequence18: @ 8091A84 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091AA8 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence18 + + thumb_func_start sub_8091AA8 +sub_8091AA8: @ 8091AA8 + push {r4,lr} + ldr r3, =gUnknown_0850D9E8 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091AA8 + + thumb_func_start sub_8091AC8 +sub_8091AC8: @ 8091AC8 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D9F4 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x2 + bne _08091AF4 + movs r0, 0xE + ldrsh r1, [r4, r0] + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _08091AF4 + movs r0, 0x3 + strb r0, [r2] +_08091AF4: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091AC8 + + thumb_func_start FieldObjectCB_GoInDirectionSequence19 +FieldObjectCB_GoInDirectionSequence19: @ 8091B10 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091B34 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence19 + + thumb_func_start sub_8091B34 +sub_8091B34: @ 8091B34 + push {r4,lr} + ldr r3, =gUnknown_0850D9F8 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091B34 + + thumb_func_start sub_8091B54 +sub_8091B54: @ 8091B54 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850DA04 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x2 + bne _08091B80 + movs r0, 0xC + ldrsh r1, [r4, r0] + movs r3, 0x10 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _08091B80 + movs r0, 0x3 + strb r0, [r2] +_08091B80: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091B54 + + thumb_func_start FieldObjectCB_GoInDirectionSequence20 +FieldObjectCB_GoInDirectionSequence20: @ 8091B9C + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091BC0 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence20 + + thumb_func_start sub_8091BC0 +sub_8091BC0: @ 8091BC0 + push {r4,lr} + ldr r3, =gUnknown_0850DA08 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091BC0 + + thumb_func_start sub_8091BE0 +sub_8091BE0: @ 8091BE0 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850DA14 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x2 + bne _08091C0C + movs r0, 0xC + ldrsh r1, [r4, r0] + movs r3, 0x10 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _08091C0C + movs r0, 0x3 + strb r0, [r2] +_08091C0C: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091BE0 + + thumb_func_start FieldObjectCB_GoInDirectionSequence21 +FieldObjectCB_GoInDirectionSequence21: @ 8091C28 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091C4C + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence21 + + thumb_func_start sub_8091C4C +sub_8091C4C: @ 8091C4C + push {r4,lr} + ldr r3, =gUnknown_0850DA18 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091C4C + + thumb_func_start sub_8091C6C +sub_8091C6C: @ 8091C6C + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850DA24 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x2 + bne _08091C98 + movs r0, 0xE + ldrsh r1, [r4, r0] + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _08091C98 + movs r0, 0x3 + strb r0, [r2] +_08091C98: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091C6C + + thumb_func_start FieldObjectCB_GoInDirectionSequence22 +FieldObjectCB_GoInDirectionSequence22: @ 8091CB4 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091CD8 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence22 + + thumb_func_start sub_8091CD8 +sub_8091CD8: @ 8091CD8 + push {r4,lr} + ldr r3, =gUnknown_0850DA28 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091CD8 + + thumb_func_start sub_8091CF8 +sub_8091CF8: @ 8091CF8 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850DA34 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x2 + bne _08091D24 + movs r0, 0xE + ldrsh r1, [r4, r0] + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _08091D24 + movs r0, 0x3 + strb r0, [r2] +_08091D24: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091CF8 + + thumb_func_start FieldObjectCB_GoInDirectionSequence23 +FieldObjectCB_GoInDirectionSequence23: @ 8091D40 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091D64 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence23 + + thumb_func_start sub_8091D64 +sub_8091D64: @ 8091D64 + push {r4,lr} + ldr r3, =gUnknown_0850DA38 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091D64 + + thumb_func_start sub_8091D84 +sub_8091D84: @ 8091D84 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850DA44 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x2 + bne _08091DB0 + movs r0, 0xC + ldrsh r1, [r4, r0] + movs r3, 0x10 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _08091DB0 + movs r0, 0x3 + strb r0, [r2] +_08091DB0: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091D84 + + thumb_func_start FieldObjectCB_GoInDirectionSequence24 +FieldObjectCB_GoInDirectionSequence24: @ 8091DCC + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091DF0 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence24 + + thumb_func_start sub_8091DF0 +sub_8091DF0: @ 8091DF0 + push {r4,lr} + ldr r3, =gUnknown_0850DA48 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091DF0 + + thumb_func_start sub_8091E10 +sub_8091E10: @ 8091E10 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850DA54 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x2 + bne _08091E3C + movs r0, 0xC + ldrsh r1, [r4, r0] + movs r3, 0x10 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _08091E3C + movs r0, 0x3 + strb r0, [r2] +_08091E3C: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091E10 + + thumb_func_start FieldObjectCB_CopyPlayer1 +FieldObjectCB_CopyPlayer1: @ 8091E58 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091E7C + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_CopyPlayer1 + + thumb_func_start sub_8091E7C +sub_8091E7C: @ 8091E7C + push {r4,lr} + ldr r3, =gUnknown_0850DA58 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091E7C + + thumb_func_start mss_npc_reset_oampriv3_1_unk2_unk3 +@ bool8 mss_npc_reset_oampriv3_1_unk2_unk3(struct npc_state *fieldObject, struct obj *object) +mss_npc_reset_oampriv3_1_unk2_unk3: @ 8091E9C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl npc_reset + adds r4, 0x21 + ldrb r0, [r4] + cmp r0, 0 + bne _08091EB4 + bl player_get_direction_lower_nybble + strb r0, [r4] +_08091EB4: + movs r0, 0x1 + strh r0, [r5, 0x30] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end mss_npc_reset_oampriv3_1_unk2_unk3 + + thumb_func_start sub_8091EC0 +@ bool8 sub_8091EC0(struct npc_state *fieldObject, struct obj *object) +sub_8091EC0: @ 8091EC0 + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + ldr r2, =0x02037350 + ldr r3, =0x02037590 + ldrb r1, [r3, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1C] + cmp r0, 0xFF + beq _08091EE0 + ldrb r0, [r3, 0x3] + cmp r0, 0x2 + bne _08091EEC +_08091EE0: + movs r0, 0 + b _08091F14 + .pool +_08091EEC: + ldr r5, =gUnknown_0850DA64 + bl player_get_x22 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 22 + adds r4, r5 + bl player_get_direction_upper_nybble + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r4, [r4] + adds r0, r6, 0 + adds r1, r7, 0 + movs r3, 0 + bl _call_via_r4 + lsls r0, 24 + lsrs r0, 24 +_08091F14: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091EC0 + + thumb_func_start sub_8091F20 +sub_8091F20: @ 8091F20 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _08091F3E + ldrb r0, [r4] + movs r1, 0x3 + negs r1, r1 + ands r1, r0 + strb r1, [r4] + movs r0, 0x1 + strh r0, [r5, 0x30] +_08091F3E: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8091F20 + + thumb_func_start sub_8091F48 +sub_8091F48: @ 8091F48 + movs r0, 0 + bx lr + thumb_func_end sub_8091F48 + + thumb_func_start sub_8091F4C +sub_8091F4C: @ 8091F4C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r1, =gUnknown_085055CD + ldrb r0, [r4, 0x6] + adds r0, r1 + ldrb r0, [r0] + adds r1, r4, 0 + adds r1, 0x21 + ldrb r1, [r1] + bl state_to_direction + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091F4C + + thumb_func_start sub_8091F94 +sub_8091F94: @ 8091F94 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + adds r7, r1, 0 + mov r8, r3 + lsls r2, 24 + lsrs r5, r2, 24 + adds r6, r5, 0 + bl FieldObjectIsFarawayIslandMew + lsls r0, 24 + cmp r0, 0 + beq _08091FFC + bl sub_81D427C + adds r5, r0, 0 + cmp r5, 0 + bne _08092012 + adds r5, r6, 0 + ldr r1, =gUnknown_085055CD + ldrb r0, [r4, 0x6] + adds r0, r1 + ldrb r0, [r0] + adds r1, r4, 0 + adds r1, 0x21 + ldrb r1, [r1] + adds r2, r5, 0 + bl state_to_direction + adds r5, r0, 0 + mov r3, sp + adds r3, 0x2 + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl FieldObjectMoveDestCoords + adds r0, r5, 0 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl FieldObjectSetRegularAnim + b _08092084 + .pool +_08091FFC: + ldr r1, =gUnknown_085055CD + ldrb r0, [r4, 0x6] + adds r0, r1 + ldrb r0, [r0] + adds r1, r4, 0 + adds r1, 0x21 + ldrb r1, [r1] + adds r2, r5, 0 + bl state_to_direction + adds r5, r0, 0 +_08092012: + mov r6, sp + adds r6, 0x2 + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + adds r3, r6, 0 + bl FieldObjectMoveDestCoords + adds r0, r5, 0 + bl GetGoSpeed0AnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl FieldObjectSetRegularAnim + mov r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0 + ldrsh r2, [r6, r0] + adds r0, r4, 0 + adds r3, r5, 0 + bl npc_block_way + lsls r0, 24 + cmp r0, 0 + bne _08092070 + mov r1, r8 + cmp r1, 0 + beq _08092084 + mov r0, sp + movs r2, 0 + ldrsh r0, [r0, r2] + movs r2, 0 + ldrsh r1, [r6, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r8 + lsls r0, 24 + cmp r0, 0 + bne _08092084 +_08092070: + adds r0, r5, 0 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl FieldObjectSetRegularAnim +_08092084: + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + movs r0, 0x2 + strh r0, [r7, 0x30] + movs r0, 0x1 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091F94 + + thumb_func_start sub_80920A4 +sub_80920A4: @ 80920A4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + adds r7, r1, 0 + mov r8, r3 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r1, =gUnknown_085055CD + ldrb r0, [r4, 0x6] + adds r0, r1 + ldrb r0, [r0] + adds r1, r4, 0 + adds r1, 0x21 + ldrb r1, [r1] + adds r2, r6, 0 + bl state_to_direction + adds r6, r0, 0 + mov r5, sp + adds r5, 0x2 + adds r0, r4, 0 + adds r1, r6, 0 + mov r2, sp + adds r3, r5, 0 + bl FieldObjectMoveDestCoords + adds r0, r6, 0 + bl GetGoSpeed1AnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl FieldObjectSetRegularAnim + mov r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0 + ldrsh r2, [r5, r0] + adds r0, r4, 0 + adds r3, r6, 0 + bl npc_block_way + lsls r0, 24 + cmp r0, 0 + bne _0809212A + mov r1, r8 + cmp r1, 0 + beq _0809213E + mov r0, sp + movs r2, 0 + ldrsh r0, [r0, r2] + movs r2, 0 + ldrsh r1, [r5, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r8 + lsls r0, 24 + cmp r0, 0 + bne _0809213E +_0809212A: + adds r0, r6, 0 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl FieldObjectSetRegularAnim +_0809213E: + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + movs r0, 0x2 + strh r0, [r7, 0x30] + movs r0, 0x1 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80920A4 + + thumb_func_start sub_809215C +sub_809215C: @ 809215C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + adds r7, r1, 0 + mov r8, r3 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r1, =gUnknown_085055CD + ldrb r0, [r4, 0x6] + adds r0, r1 + ldrb r0, [r0] + adds r1, r4, 0 + adds r1, 0x21 + ldrb r1, [r1] + adds r2, r6, 0 + bl state_to_direction + adds r6, r0, 0 + mov r5, sp + adds r5, 0x2 + adds r0, r4, 0 + adds r1, r6, 0 + mov r2, sp + adds r3, r5, 0 + bl FieldObjectMoveDestCoords + adds r0, r6, 0 + bl GetGoSpeed3AnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl FieldObjectSetRegularAnim + mov r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0 + ldrsh r2, [r5, r0] + adds r0, r4, 0 + adds r3, r6, 0 + bl npc_block_way + lsls r0, 24 + cmp r0, 0 + bne _080921E2 + mov r1, r8 + cmp r1, 0 + beq _080921F6 + mov r0, sp + movs r2, 0 + ldrsh r0, [r0, r2] + movs r2, 0 + ldrsh r1, [r5, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r8 + lsls r0, 24 + cmp r0, 0 + bne _080921F6 +_080921E2: + adds r0, r6, 0 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl FieldObjectSetRegularAnim +_080921F6: + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + movs r0, 0x2 + strh r0, [r7, 0x30] + movs r0, 0x1 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809215C + + thumb_func_start sub_8092214 +sub_8092214: @ 8092214 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + adds r7, r1, 0 + mov r8, r3 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r1, =gUnknown_085055CD + ldrb r0, [r4, 0x6] + adds r0, r1 + ldrb r0, [r0] + adds r1, r4, 0 + adds r1, 0x21 + ldrb r1, [r1] + adds r2, r6, 0 + bl state_to_direction + adds r6, r0, 0 + mov r5, sp + adds r5, 0x2 + adds r0, r4, 0 + adds r1, r6, 0 + mov r2, sp + adds r3, r5, 0 + bl FieldObjectMoveDestCoords + adds r0, r6, 0 + bl sub_8093438 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl FieldObjectSetRegularAnim + mov r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0 + ldrsh r2, [r5, r0] + adds r0, r4, 0 + adds r3, r6, 0 + bl npc_block_way + lsls r0, 24 + cmp r0, 0 + bne _0809229A + mov r1, r8 + cmp r1, 0 + beq _080922AE + mov r0, sp + movs r2, 0 + ldrsh r0, [r0, r2] + movs r2, 0 + ldrsh r1, [r5, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r8 + lsls r0, 24 + cmp r0, 0 + bne _080922AE +_0809229A: + adds r0, r6, 0 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl FieldObjectSetRegularAnim +_080922AE: + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + movs r0, 0x2 + strh r0, [r7, 0x30] + movs r0, 0x1 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8092214 + + thumb_func_start cph_IM_DIFFERENT +cph_IM_DIFFERENT: @ 80922CC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r1, =gUnknown_085055CD + ldrb r0, [r4, 0x6] + adds r0, r1 + ldrb r0, [r0] + adds r1, r4, 0 + adds r1, 0x21 + ldrb r1, [r1] + bl state_to_direction + bl sub_80934BC + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end cph_IM_DIFFERENT + + thumb_func_start sub_8092314 +sub_8092314: @ 8092314 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + adds r7, r1, 0 + mov r8, r3 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r1, =gUnknown_085055CD + ldrb r0, [r4, 0x6] + adds r0, r1 + ldrb r0, [r0] + adds r1, r4, 0 + adds r1, 0x21 + ldrb r1, [r1] + adds r2, r6, 0 + bl state_to_direction + adds r6, r0, 0 + mov r5, sp + adds r5, 0x2 + adds r0, r4, 0 + adds r1, r6, 0 + mov r2, sp + adds r3, r5, 0 + bl FieldObjectMoveDestCoords + adds r0, r6, 0 + bl sub_8093514 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl FieldObjectSetRegularAnim + mov r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0 + ldrsh r2, [r5, r0] + adds r0, r4, 0 + adds r3, r6, 0 + bl npc_block_way + lsls r0, 24 + cmp r0, 0 + bne _0809239A + mov r1, r8 + cmp r1, 0 + beq _080923AE + mov r0, sp + movs r2, 0 + ldrsh r0, [r0, r2] + movs r2, 0 + ldrsh r1, [r5, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r8 + lsls r0, 24 + cmp r0, 0 + bne _080923AE +_0809239A: + adds r0, r6, 0 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl FieldObjectSetRegularAnim +_080923AE: + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + movs r0, 0x2 + strh r0, [r7, 0x30] + movs r0, 0x1 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8092314 + + thumb_func_start oac_hopping +oac_hopping: @ 80923CC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r4, r0, 0 + adds r7, r1, 0 + mov r8, r3 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r1, =gUnknown_085055CD + ldrb r0, [r4, 0x6] + adds r0, r1 + ldrb r0, [r0] + adds r1, r4, 0 + adds r1, 0x21 + ldrb r1, [r1] + adds r2, r6, 0 + bl state_to_direction + adds r6, r0, 0 + ldrh r1, [r4, 0x10] + add r0, sp, 0x4 + strh r1, [r0] + ldrh r0, [r4, 0x12] + mov r5, sp + adds r5, 0x6 + strh r0, [r5] + movs r0, 0x2 + str r0, [sp] + adds r0, r6, 0 + add r1, sp, 0x4 + adds r2, r5, 0 + movs r3, 0x2 + bl sub_8092F88 + adds r0, r6, 0 + bl GetJumpLedgeAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl FieldObjectSetRegularAnim + add r0, sp, 0x4 + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0 + ldrsh r2, [r5, r0] + adds r0, r4, 0 + adds r3, r6, 0 + bl npc_block_way + lsls r0, 24 + cmp r0, 0 + bne _08092460 + mov r1, r8 + cmp r1, 0 + beq _08092474 + add r0, sp, 0x4 + movs r2, 0 + ldrsh r0, [r0, r2] + movs r2, 0 + ldrsh r1, [r5, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r8 + lsls r0, 24 + cmp r0, 0 + bne _08092474 +_08092460: + adds r0, r6, 0 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl FieldObjectSetRegularAnim +_08092474: + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + movs r0, 0x2 + strh r0, [r7, 0x30] + movs r0, 0x1 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end oac_hopping + + thumb_func_start FieldObjectCB_CopyPlayer2 +FieldObjectCB_CopyPlayer2: @ 8092494 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_80924B8 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_CopyPlayer2 + + thumb_func_start sub_80924B8 +sub_80924B8: @ 80924B8 + push {r4,lr} + ldr r3, =gUnknown_0850DA90 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80924B8 + + thumb_func_start mss_08062EA4 +mss_08062EA4: @ 80924D8 + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + ldr r2, =0x02037350 + ldr r3, =0x02037590 + ldrb r1, [r3, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1C] + cmp r0, 0xFF + beq _080924F8 + ldrb r0, [r3, 0x3] + cmp r0, 0x2 + bne _08092504 +_080924F8: + movs r0, 0 + b _0809252C + .pool +_08092504: + ldr r5, =gUnknown_0850DA64 + bl player_get_x22 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 22 + adds r4, r5 + bl player_get_direction_upper_nybble + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r3, =sub_8088E64 + ldr r4, [r4] + adds r0, r6, 0 + adds r1, r7, 0 + bl _call_via_r4 + lsls r0, 24 + lsrs r0, 24 +_0809252C: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end mss_08062EA4 + + thumb_func_start FieldObjectCB_TreeDisguise +@ void FieldObjectCB_TreeDisguise(struct obj *object) +FieldObjectCB_TreeDisguise: @ 809253C + push {r4-r6,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02037350 + adds r4, r1, r0 + adds r6, r4, 0 + adds r6, 0x21 + ldrb r0, [r6] + cmp r0, 0 + beq _08092564 + cmp r0, 0x1 + bne _08092584 + movs r1, 0x3C + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _08092584 +_08092564: + ldr r1, =0x02038c08 + adds r2, r1, 0x4 + adds r3, r1, 0 + adds r3, 0x8 + adds r0, r4, 0 + bl FieldObjectGetLocalIdAndMap + movs r0, 0x1C + bl FieldEffectStart + strb r0, [r4, 0x1A] + movs r0, 0x1 + strb r0, [r6] + ldrh r0, [r5, 0x3C] + adds r0, 0x1 + strh r0, [r5, 0x3C] +_08092584: + movs r0, 0x2E + ldrsh r1, [r5, r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + ldr r2, =sub_80925AC + adds r1, r5, 0 + bl FieldObjectStep + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_TreeDisguise + + thumb_func_start sub_80925AC +sub_80925AC: @ 80925AC + push {lr} + bl npc_reset + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_80925AC + + thumb_func_start FieldObjectCB_MountainDisguise +FieldObjectCB_MountainDisguise: @ 80925B8 + push {r4-r6,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02037350 + adds r4, r1, r0 + adds r6, r4, 0 + adds r6, 0x21 + ldrb r0, [r6] + cmp r0, 0 + beq _080925E0 + cmp r0, 0x1 + bne _08092600 + movs r1, 0x3C + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _08092600 +_080925E0: + ldr r1, =0x02038c08 + adds r2, r1, 0x4 + adds r3, r1, 0 + adds r3, 0x8 + adds r0, r4, 0 + bl FieldObjectGetLocalIdAndMap + movs r0, 0x1D + bl FieldEffectStart + strb r0, [r4, 0x1A] + movs r0, 0x1 + strb r0, [r6] + ldrh r0, [r5, 0x3C] + adds r0, 0x1 + strh r0, [r5, 0x3C] +_08092600: + movs r0, 0x2E + ldrsh r1, [r5, r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + ldr r2, =sub_80925AC + adds r1, r5, 0 + bl FieldObjectStep + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_MountainDisguise + + thumb_func_start FieldObjectCB_Hidden1 +@ void FieldObjectCB_Hidden1(struct obj *object) +FieldObjectCB_Hidden1: @ 8092628 + push {r4,lr} + adds r3, r0, 0 + movs r1, 0x3C + ldrsh r0, [r3, r1] + ldr r4, =0x02037350 + cmp r0, 0 + bne _08092668 + movs r0, 0x2E + ldrsh r1, [r3, r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0, 0x3] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0, 0x3] + adds r2, r3, 0 + adds r2, 0x42 + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldrb r0, [r3, 0x5] + movs r1, 0xC + orrs r0, r1 + strb r0, [r3, 0x5] + ldrh r0, [r3, 0x3C] + adds r0, 0x1 + strh r0, [r3, 0x3C] +_08092668: + movs r0, 0x2E + ldrsh r1, [r3, r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r2, =sub_809268C + adds r1, r3, 0 + bl FieldObjectStep + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_Hidden1 + + thumb_func_start sub_809268C +sub_809268C: @ 809268C + push {r4,lr} + ldr r3, =gUnknown_0850DA9C + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809268C + + thumb_func_start sub_80926AC +sub_80926AC: @ 80926AC + push {lr} + bl npc_reset + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_80926AC + + thumb_func_start sub_80926B8 +@ bool8 sub_80926B8(struct npc_state *fieldObject, struct obj *object) +sub_80926B8: @ 80926B8 + push {r4,lr} + adds r4, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _080926CA + movs r0, 0 + strh r0, [r4, 0x30] +_080926CA: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80926B8 + + thumb_func_start FieldObjectCB_WalkInPlace1 +FieldObjectCB_WalkInPlace1: @ 80926D4 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_80926F8 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_WalkInPlace1 + + thumb_func_start sub_80926F8 +sub_80926F8: @ 80926F8 + push {r4,lr} + ldr r3, =gUnknown_0850DAA0 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80926F8 + + thumb_func_start sub_8092718 +sub_8092718: @ 8092718 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl npc_reset + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetStepInPlaceDelay16AnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x1 + strh r0, [r5, 0x30] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8092718 + + thumb_func_start FieldObjectCB_WalkInPlace4 +FieldObjectCB_WalkInPlace4: @ 8092744 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8092768 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_WalkInPlace4 + + thumb_func_start sub_8092768 +sub_8092768: @ 8092768 + push {r4,lr} + ldr r3, =gUnknown_0850DAA8 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8092768 + + thumb_func_start sub_8092788 +sub_8092788: @ 8092788 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl npc_reset + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetStepInPlaceDelay32AnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x1 + strh r0, [r5, 0x30] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8092788 + + thumb_func_start FieldObjectCB_WalkInPlace2 +FieldObjectCB_WalkInPlace2: @ 80927B4 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_80927D8 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_WalkInPlace2 + + thumb_func_start sub_80927D8 +sub_80927D8: @ 80927D8 + push {r4,lr} + ldr r3, =gUnknown_0850DAB0 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80927D8 + + thumb_func_start sub_80927F8 +@ bool8 sub_80927F8(struct npc_state *fieldObject, struct obj *object) +sub_80927F8: @ 80927F8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl npc_reset + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetStepInPlaceDelay8AnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x1 + strh r0, [r5, 0x30] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80927F8 + + thumb_func_start FieldObjectCB_WalkInPlace3 +FieldObjectCB_WalkInPlace3: @ 8092824 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8092848 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_WalkInPlace3 + + thumb_func_start sub_8092848 +sub_8092848: @ 8092848 + push {r4,lr} + ldr r3, =gUnknown_0850DAB8 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8092848 + + thumb_func_start sub_8092868 +sub_8092868: @ 8092868 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl npc_reset + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetStepInPlaceDelay4AnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x1 + strh r0, [r5, 0x30] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8092868 + + thumb_func_start FieldObjectCB_Hidden2 +FieldObjectCB_Hidden2: @ 8092894 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_80928B8 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_Hidden2 + + thumb_func_start sub_80928B8 +sub_80928B8: @ 80928B8 + push {r4,lr} + ldr r3, =gUnknown_0850DAC0 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80928B8 + + thumb_func_start sub_80928D8 +sub_80928D8: @ 80928D8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl npc_reset + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + ldrb r0, [r4, 0x1] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r4, 0x1] + movs r0, 0x1 + strh r0, [r5, 0x30] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80928D8 + + thumb_func_start sub_809290C +sub_809290C: @ 809290C + push {r4,lr} + adds r4, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + bne _0809291E + movs r0, 0 + b _08092924 +_0809291E: + movs r0, 0x2 + strh r0, [r4, 0x30] + movs r0, 0x1 +_08092924: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809290C + + thumb_func_start sub_809292C +sub_809292C: @ 809292C + ldrb r2, [r0] + movs r1, 0x3 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + movs r0, 0 + bx lr + thumb_func_end sub_809292C + + thumb_func_start npc_reset +@ void npc_reset(struct npc_state *fieldObject, struct obj *object) +npc_reset: @ 809293C + ldrb r3, [r0] + movs r2, 0x3 + negs r2, r2 + ands r2, r3 + movs r3, 0x41 + negs r3, r3 + ands r2, r3 + movs r3, 0x7F + ands r2, r3 + strb r2, [r0] + movs r2, 0xFF + strb r2, [r0, 0x1C] + movs r0, 0 + strh r0, [r1, 0x30] + bx lr + thumb_func_end npc_reset + + thumb_func_start FieldObjectDirectionToImageAnimId +@ u8 FieldObjectDirectionToImageAnimId(u8 direction) +FieldObjectDirectionToImageAnimId: @ 809295C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850DACC + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end FieldObjectDirectionToImageAnimId + + thumb_func_start get_go_image_anim_num +get_go_image_anim_num: @ 809296C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850DAD5 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end get_go_image_anim_num + + thumb_func_start get_go_fast_image_anim_num +get_go_fast_image_anim_num: @ 809297C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850DADE + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end get_go_fast_image_anim_num + + thumb_func_start get_go_faster_image_anim_num +get_go_faster_image_anim_num: @ 809298C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850DAE7 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end get_go_faster_image_anim_num + + thumb_func_start get_go_fastest_image_anim_num +get_go_fastest_image_anim_num: @ 809299C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850DAF0 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end get_go_fastest_image_anim_num + + thumb_func_start sub_80929AC +sub_80929AC: @ 80929AC + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850DAF9 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_80929AC + + thumb_func_start sub_80929BC +sub_80929BC: @ 80929BC + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850DB02 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_80929BC + + thumb_func_start sub_80929CC +sub_80929CC: @ 80929CC + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850DB0B + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_80929CC + + thumb_func_start sub_80929DC +sub_80929DC: @ 80929DC + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850DB14 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_80929DC + + thumb_func_start sub_80929EC +sub_80929EC: @ 80929EC + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850DB1D + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_80929EC + + thumb_func_start sub_80929FC +sub_80929FC: @ 80929FC + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850DB26 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_80929FC + + thumb_func_start sub_8092A0C +sub_8092A0C: @ 8092A0C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850DB2F + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_8092A0C + + thumb_func_start sub_8092A1C +sub_8092A1C: @ 8092A1C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850DB38 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_8092A1C + + thumb_func_start sub_8092A2C +sub_8092A2C: @ 8092A2C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850DB41 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_8092A2C + + thumb_func_start get_run_image_anim_num +get_run_image_anim_num: @ 8092A3C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850DB4A + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end get_run_image_anim_num + + thumb_func_start sub_8092A4C +sub_8092A4C: @ 8092A4C + push {lr} + adds r2, r0, 0 + ldr r1, =gUnknown_085094AC + b _08092A64 + .pool +_08092A58: + ldr r0, [r1] + cmp r0, r2 + bne _08092A62 + adds r0, r1, 0 + b _08092A6C +_08092A62: + adds r1, 0x8 +_08092A64: + ldr r0, [r1] + cmp r0, 0 + bne _08092A58 + movs r0, 0 +_08092A6C: + pop {r1} + bx r1 + thumb_func_end sub_8092A4C + + thumb_func_start npc_apply_anim_looping +@ void npc_apply_anim_looping(struct npc_state *fieldObject, struct obj *object, u8 anim) +npc_apply_anim_looping: @ 8092A70 + push {r4,lr} + adds r4, r1, 0 + lsls r2, 24 + lsrs r2, 24 + ldrb r0, [r0, 0x1] + lsls r0, 27 + cmp r0, 0 + blt _08092AB2 + adds r0, r4, 0 + adds r0, 0x2A + strb r2, [r0] + ldr r0, [r4, 0x8] + bl sub_8092A4C + adds r1, r4, 0 + adds r1, 0x2B + cmp r0, 0 + beq _08092AAA + ldrb r2, [r1] + ldrb r3, [r0, 0x4] + cmp r2, r3 + bne _08092AA0 + ldrb r0, [r0, 0x7] + b _08092AA8 +_08092AA0: + ldrb r3, [r0, 0x5] + cmp r2, r3 + bne _08092AAA + ldrb r0, [r0, 0x6] +_08092AA8: + strb r0, [r1] +_08092AAA: + ldrb r1, [r1] + adds r0, r4, 0 + bl SeekObjectImageAnim +_08092AB2: + pop {r4} + pop {r0} + bx r0 + thumb_func_end npc_apply_anim_looping + + thumb_func_start obj_npc_animation_step +@ void obj_npc_animation_step(struct npc_state *fieldObject, struct obj *object, u8 anim) +obj_npc_animation_step: @ 8092AB8 + push {r4,lr} + adds r4, r1, 0 + lsls r2, 24 + lsrs r2, 24 + ldrb r0, [r0, 0x1] + lsls r0, 27 + cmp r0, 0 + blt _08092AF0 + adds r0, r4, 0 + adds r0, 0x2A + strb r2, [r0] + ldr r0, [r4, 0x8] + bl sub_8092A4C + adds r2, r0, 0 + cmp r2, 0 + beq _08092AF0 + ldrb r1, [r2, 0x5] + adds r0, r4, 0 + adds r0, 0x2B + ldrb r0, [r0] + ldrb r3, [r2, 0x4] + cmp r0, r3 + bhi _08092AEA + ldrb r1, [r2, 0x4] +_08092AEA: + adds r0, r4, 0 + bl SeekObjectImageAnim +_08092AF0: + pop {r4} + pop {r0} + bx r0 + thumb_func_end obj_npc_animation_step + + thumb_func_start sub_8092AF8 +sub_8092AF8: @ 8092AF8 + push {lr} + lsls r1, 16 + lsrs r1, 16 + lsls r3, 16 + lsrs r3, 16 + lsls r0, 16 + asrs r0, 16 + lsls r2, 16 + asrs r2, 16 + cmp r0, r2 + ble _08092B12 + movs r0, 0x3 + b _08092B28 +_08092B12: + cmp r0, r2 + bge _08092B1A + movs r0, 0x4 + b _08092B28 +_08092B1A: + lsls r1, 16 + lsls r0, r3, 16 + cmp r1, r0 + bgt _08092B26 + movs r0, 0x1 + b _08092B28 +_08092B26: + movs r0, 0x2 +_08092B28: + pop {r1} + bx r1 + thumb_func_end sub_8092AF8 + + thumb_func_start npc_set_running_behaviour_etc +npc_set_running_behaviour_etc: @ 8092B2C + push {r4,lr} + mov r12, r0 + lsls r1, 24 + lsrs r1, 24 + movs r3, 0 + strb r1, [r0, 0x6] + adds r0, 0x21 + strb r3, [r0] + adds r0, 0x1 + strb r3, [r0] + ldr r4, =0x02020630 + mov r0, r12 + ldrb r2, [r0, 0x4] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r2, r4, 0 + adds r2, 0x1C + adds r0, r2 + ldr r2, =gUnknown_08505438 + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + str r1, [r0] + mov r0, r12 + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r3, [r0, 0x30] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end npc_set_running_behaviour_etc + + thumb_func_start npc_running_behaviour_by_direction +npc_running_behaviour_by_direction: @ 8092B78 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850DB53 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end npc_running_behaviour_by_direction + + thumb_func_start sub_8092B88 +sub_8092B88: @ 8092B88 + push {r4-r6,lr} + sub sp, 0x4 + adds r6, r0, 0 + lsls r5, r1, 24 + lsrs r5, 24 + ldrh r1, [r6, 0x10] + mov r0, sp + strh r1, [r0] + ldrh r0, [r6, 0x12] + mov r4, sp + adds r4, 0x2 + strh r0, [r4] + adds r0, r5, 0 + mov r1, sp + adds r2, r4, 0 + bl MoveCoords + mov r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0 + ldrsh r2, [r4, r0] + adds r0, r6, 0 + adds r3, r5, 0 + bl npc_block_way + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8092B88 + + thumb_func_start npc_block_way +@ u8 npc_block_way(struct npc_state *fieldObject, u16 x, u16 y, u8 direction) +npc_block_way: @ 8092BC8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r6, r0, 0 + lsls r1, 16 + lsls r2, 16 + lsls r3, 24 + lsrs r7, r3, 24 + mov r8, r7 + lsrs r0, r1, 16 + mov r9, r0 + asrs r5, r1, 16 + lsrs r0, r2, 16 + mov r10, r0 + asrs r4, r2, 16 + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl IsCoordOutsideFieldObjectMovementRect + lsls r0, 24 + cmp r0, 0 + beq _08092BFE + movs r0, 0x1 + b _08092C7E +_08092BFE: + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridIsImpassableAt + lsls r0, 24 + cmp r0, 0 + bne _08092C40 + adds r0, r5, 0 + adds r1, r4, 0 + bl GetMapBorderIdAt + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _08092C40 + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + adds r3, r7, 0 + bl IsMetatileDirectionallyImpassable + lsls r0, 24 + cmp r0, 0 + bne _08092C40 + ldrb r0, [r6, 0x1] + lsrs r0, 7 + cmp r0, 0 + beq _08092C44 + mov r0, r8 + bl CanCameraMoveInDirection + cmp r0, 0 + bne _08092C44 +_08092C40: + movs r0, 0x2 + b _08092C7E +_08092C44: + ldrb r0, [r6, 0xB] + lsls r0, 28 + lsrs r0, 28 + mov r2, r9 + lsls r1, r2, 16 + asrs r5, r1, 16 + mov r2, r10 + lsls r1, r2, 16 + asrs r4, r1, 16 + adds r1, r5, 0 + adds r2, r4, 0 + bl IsZCoordMismatchAt + lsls r0, 24 + cmp r0, 0 + beq _08092C68 + movs r0, 0x3 + b _08092C7E +_08092C68: + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl CheckForCollisionBetweenFieldObjects + lsls r0, 24 + cmp r0, 0 + bne _08092C7C + movs r0, 0 + b _08092C7E +_08092C7C: + movs r0, 0x4 +_08092C7E: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end npc_block_way + + thumb_func_start sub_8092C8C +sub_8092C8C: @ 8092C8C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r7, r0, 0 + lsls r1, 16 + lsls r2, 16 + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + lsrs r0, r1, 16 + mov r9, r0 + asrs r6, r1, 16 + lsrs r0, r2, 16 + mov r10, r0 + asrs r5, r2, 16 + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r5, 0 + bl IsCoordOutsideFieldObjectMovementRect + lsls r0, 24 + lsrs r0, 24 + negs r1, r0 + orrs r1, r0 + lsrs r4, r1, 31 + adds r0, r6, 0 + adds r1, r5, 0 + bl MapGridIsImpassableAt + lsls r0, 24 + cmp r0, 0 + bne _08092D04 + adds r0, r6, 0 + adds r1, r5, 0 + bl GetMapBorderIdAt + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _08092D04 + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r5, 0 + mov r3, r8 + bl IsMetatileDirectionallyImpassable + lsls r0, 24 + cmp r0, 0 + bne _08092D04 + ldrb r0, [r7, 0x1] + lsrs r0, 7 + cmp r0, 0 + beq _08092D08 + mov r0, r8 + bl CanCameraMoveInDirection + cmp r0, 0 + bne _08092D08 +_08092D04: + movs r0, 0x2 + orrs r4, r0 +_08092D08: + ldrb r0, [r7, 0xB] + lsls r0, 28 + lsrs r0, 28 + mov r2, r9 + lsls r1, r2, 16 + asrs r6, r1, 16 + mov r2, r10 + lsls r1, r2, 16 + asrs r5, r1, 16 + adds r1, r6, 0 + adds r2, r5, 0 + bl IsZCoordMismatchAt + lsls r0, 24 + cmp r0, 0 + beq _08092D30 + movs r0, 0x4 + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_08092D30: + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r5, 0 + bl CheckForCollisionBetweenFieldObjects + lsls r0, 24 + cmp r0, 0 + beq _08092D48 + movs r0, 0x8 + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_08092D48: + adds r0, r4, 0 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8092C8C + + thumb_func_start IsCoordOutsideFieldObjectMovementRect +@ bool8 IsCoordOutsideFieldObjectMovementRect(struct npc_state *fieldObject, u16 x, u16 y) +IsCoordOutsideFieldObjectMovementRect: @ 8092D58 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r3, r1, 16 + lsls r2, 16 + lsrs r5, r2, 16 + ldrb r1, [r4, 0x19] + movs r0, 0xF + ands r0, r1 + cmp r0, 0 + beq _08092D90 + lsls r1, 28 + lsrs r2, r1, 28 + ldrh r0, [r4, 0xC] + subs r2, r0, r2 + lsrs r1, 28 + adds r0, r1 + lsls r0, 16 + lsrs r1, r0, 16 + lsls r2, 16 + lsls r0, r3, 16 + asrs r3, r0, 16 + cmp r2, r0 + bgt _08092DBC + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, r3 + blt _08092DBC +_08092D90: + ldrb r1, [r4, 0x19] + movs r0, 0xF0 + ands r0, r1 + cmp r0, 0 + beq _08092DC0 + lsls r1, 24 + lsrs r2, r1, 28 + ldrh r0, [r4, 0xE] + subs r2, r0, r2 + lsrs r1, 28 + adds r0, r1 + lsls r0, 16 + lsrs r1, r0, 16 + lsls r2, 16 + lsls r0, r5, 16 + asrs r3, r0, 16 + cmp r2, r0 + bgt _08092DBC + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, r3 + bge _08092DC0 +_08092DBC: + movs r0, 0x1 + b _08092DC2 +_08092DC0: + movs r0, 0 +_08092DC2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end IsCoordOutsideFieldObjectMovementRect + + thumb_func_start IsMetatileDirectionallyImpassable +@ bool8 IsMetatileDirectionallyImpassable(struct npc_state *fieldObject, u16 x, u16 y, u8 direction) +IsMetatileDirectionallyImpassable: @ 8092DC8 + push {r4-r7,lr} + lsls r1, 16 + lsrs r6, r1, 16 + lsls r2, 16 + lsrs r7, r2, 16 + lsls r3, 24 + ldr r1, =gUnknown_0850DB5C + lsrs r3, 22 + subs r5, r3, 0x4 + adds r1, r5, r1 + ldrb r0, [r0, 0x1E] + ldr r1, [r1] + bl _call_via_r1 + lsls r0, 24 + cmp r0, 0 + bne _08092E0A + ldr r4, =gUnknown_0850DB6C + adds r4, r5, r4 + lsls r0, r6, 16 + asrs r0, 16 + lsls r1, r7, 16 + asrs r1, 16 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + ldr r1, [r4] + bl _call_via_r1 + lsls r0, 24 + cmp r0, 0 + beq _08092E18 +_08092E0A: + movs r0, 0x1 + b _08092E1A + .pool +_08092E18: + movs r0, 0 +_08092E1A: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end IsMetatileDirectionallyImpassable + + thumb_func_start CheckForCollisionBetweenFieldObjects +@ bool8 CheckForCollisionBetweenFieldObjects(struct npc_state *fieldObject, u16 x, u16 y) +CheckForCollisionBetweenFieldObjects: @ 8092E20 + push {r4-r7,lr} + adds r6, r0, 0 + lsls r1, 16 + lsrs r7, r1, 16 + movs r4, 0 + lsls r2, 16 + asrs r5, r2, 16 +_08092E2E: + lsls r0, r4, 3 + adds r0, r4 + lsls r0, 2 + ldr r1, =0x02037350 + adds r2, r0, r1 + ldrb r0, [r2] + lsls r0, 31 + cmp r0, 0 + beq _08092E88 + cmp r2, r6 + beq _08092E88 + movs r0, 0x10 + ldrsh r1, [r2, r0] + lsls r0, r7, 16 + asrs r3, r0, 16 + cmp r1, r3 + bne _08092E58 + movs r1, 0x12 + ldrsh r0, [r2, r1] + cmp r0, r5 + beq _08092E68 +_08092E58: + movs r1, 0x14 + ldrsh r0, [r2, r1] + cmp r0, r3 + bne _08092E88 + movs r1, 0x16 + ldrsh r0, [r2, r1] + cmp r0, r5 + bne _08092E88 +_08092E68: + ldrb r0, [r6, 0xB] + lsls r0, 28 + lsrs r0, 28 + ldrb r1, [r2, 0xB] + lsls r1, 28 + lsrs r1, 28 + bl AreZCoordsCompatible + lsls r0, 24 + cmp r0, 0 + beq _08092E88 + movs r0, 0x1 + b _08092E94 + .pool +_08092E88: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _08092E2E + movs r0, 0 +_08092E94: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end CheckForCollisionBetweenFieldObjects + + thumb_func_start sub_8092E9C +sub_8092E9C: @ 8092E9C + push {lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _08092EE8 + ldr r3, =0x02020630 + ldr r2, =0x02037350 + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x3C] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08092EE8 + movs r0, 0x1 + b _08092EEA + .pool +_08092EE8: + movs r0, 0 +_08092EEA: + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_8092E9C + + thumb_func_start sub_8092EF0 +sub_8092EF0: @ 8092EF0 + push {lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _08092F2E + ldr r3, =0x02020630 + ldr r2, =0x02037350 + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r2, [r1, 0x3C] + movs r0, 0x4 + orrs r0, r2 + strh r0, [r1, 0x3C] +_08092F2E: + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8092EF0 + + thumb_func_start MoveCoords +@ void MoveCoords(u8 direction, u16 *x, u16 *y) +MoveCoords: @ 8092F3C + push {r4,lr} + lsls r0, 24 + ldr r3, =gUnknown_0850DB7C + lsrs r0, 22 + adds r0, r3 + ldrh r3, [r0] + ldrh r4, [r1] + adds r3, r4 + strh r3, [r1] + ldrh r0, [r0, 0x2] + ldrh r1, [r2] + adds r0, r1 + strh r0, [r2] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end MoveCoords + + thumb_func_start sub_8092F60 +sub_8092F60: @ 8092F60 + push {r4,lr} + lsls r0, 24 + ldr r3, =gUnknown_0850DB7C + lsrs r0, 22 + adds r0, r3 + ldrh r3, [r0] + lsls r3, 4 + ldrh r4, [r1] + adds r3, r4 + strh r3, [r1] + ldrh r0, [r0, 0x2] + lsls r0, 4 + ldrh r1, [r2] + adds r0, r1 + strh r0, [r2] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8092F60 + + thumb_func_start sub_8092F88 +sub_8092F88: @ 8092F88 + push {r4-r7,lr} + adds r4, r1, 0 + ldr r1, [sp, 0x14] + lsls r0, 24 + lsls r3, 16 + lsrs r3, 16 + adds r7, r3, 0 + lsls r1, 16 + lsrs r6, r1, 16 + mov r12, r6 + ldr r1, =gUnknown_0850DB7C + lsrs r0, 22 + adds r5, r0, r1 + movs r0, 0 + ldrsh r1, [r5, r0] + cmp r1, 0 + ble _08092FB4 + lsls r0, r3, 16 + asrs r0, 16 + ldrh r3, [r4] + adds r0, r3 + strh r0, [r4] +_08092FB4: + cmp r1, 0 + bge _08092FC2 + ldrh r1, [r4] + lsls r0, r7, 16 + asrs r0, 16 + subs r1, r0 + strh r1, [r4] +_08092FC2: + movs r0, 0x2 + ldrsh r1, [r5, r0] + cmp r1, 0 + ble _08092FD4 + lsls r0, r6, 16 + asrs r0, 16 + ldrh r3, [r2] + adds r0, r3 + strh r0, [r2] +_08092FD4: + cmp r1, 0 + bge _08092FE4 + ldrh r1, [r2] + mov r3, r12 + lsls r0, r3, 16 + asrs r0, 16 + subs r1, r0 + strh r1, [r2] +_08092FE4: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8092F88 + + thumb_func_start sub_8092FF0 +sub_8092FF0: @ 8092FF0 + push {r4,r5,lr} + ldr r5, =0x03005d8c + ldr r4, [r5] + ldrh r4, [r4] + lsls r0, 16 + asrs r0, 16 + subs r0, r4 + lsls r0, 4 + strh r0, [r2] + ldr r0, [r5] + ldrh r0, [r0, 0x2] + lsls r1, 16 + asrs r1, 16 + subs r1, r0 + lsls r1, 4 + strh r1, [r3] + ldr r1, =0x03005dec + ldrh r0, [r2] + ldrh r1, [r1] + subs r0, r1 + strh r0, [r2] + ldr r1, =0x03005de8 + ldrh r0, [r3] + ldrh r1, [r1] + subs r0, r1 + strh r0, [r3] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8092FF0 + + thumb_func_start sub_8093038 +sub_8093038: @ 8093038 + push {r4-r7,lr} + adds r7, r2, 0 + mov r12, r3 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 16 + lsrs r6, r1, 16 + ldr r0, =0x03005dec + ldrh r0, [r0] + negs r0, r0 + ldr r1, =0x03005dd0 + ldr r2, [r1, 0x10] + subs r0, r2 + lsls r0, 16 + lsrs r3, r0, 16 + ldr r0, =0x03005de8 + ldrh r0, [r0] + negs r0, r0 + ldr r1, [r1, 0x14] + subs r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r2, 0 + ble _08093072 + lsls r0, r3, 16 + movs r3, 0x80 + lsls r3, 13 + adds r0, r3 + lsrs r3, r0, 16 +_08093072: + cmp r2, 0 + bge _0809307E + lsls r0, r3, 16 + ldr r2, =0xfff00000 + adds r0, r2 + lsrs r3, r0, 16 +_0809307E: + cmp r1, 0 + ble _0809308C + lsls r0, r4, 16 + movs r2, 0x80 + lsls r2, 13 + adds r0, r2 + lsrs r4, r0, 16 +_0809308C: + cmp r1, 0 + bge _08093098 + lsls r0, r4, 16 + ldr r1, =0xfff00000 + adds r0, r1 + lsrs r4, r0, 16 +_08093098: + ldr r2, =0x03005d8c + ldr r0, [r2] + ldrh r1, [r0] + lsls r0, r5, 16 + asrs r0, 16 + subs r0, r1 + lsls r0, 4 + lsls r1, r3, 16 + asrs r1, 16 + adds r1, r0 + strh r1, [r7] + ldr r0, [r2] + ldrh r1, [r0, 0x2] + lsls r0, r6, 16 + asrs r0, 16 + subs r0, r1 + lsls r0, 4 + lsls r1, r4, 16 + asrs r1, 16 + adds r1, r0 + mov r2, r12 + strh r1, [r2] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8093038 + + thumb_func_start sub_80930E0 +sub_80930E0: @ 80930E0 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r6, r0, 0 + mov r8, r1 + adds r4, r2, 0 + adds r5, r3, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + movs r1, 0 + ldrsh r0, [r6, r1] + mov r2, r8 + movs r3, 0 + ldrsh r1, [r2, r3] + adds r2, r6, 0 + mov r3, r8 + bl sub_8093038 + lsls r4, 16 + asrs r4, 16 + ldrh r0, [r6] + adds r4, r0 + strh r4, [r6] + lsls r5, 16 + asrs r5, 16 + mov r1, r8 + ldrh r1, [r1] + adds r5, r1 + mov r2, r8 + strh r5, [r2] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80930E0 + + thumb_func_start GetFieldObjectMovingCameraOffset +@ void GetFieldObjectMovingCameraOffset(s16 *x, s16 *y) +GetFieldObjectMovingCameraOffset: @ 809312C + push {lr} + adds r2, r0, 0 + movs r0, 0 + strh r0, [r2] + strh r0, [r1] + ldr r3, =0x03005dd0 + ldr r0, [r3, 0x10] + cmp r0, 0 + ble _08093142 + movs r0, 0x1 + strh r0, [r2] +_08093142: + ldr r0, [r3, 0x10] + cmp r0, 0 + bge _0809314E + ldrh r0, [r2] + subs r0, 0x1 + strh r0, [r2] +_0809314E: + ldr r2, [r3, 0x14] + cmp r2, 0 + ble _0809315A + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0809315A: + cmp r2, 0 + bge _08093164 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] +_08093164: + pop {r0} + bx r0 + .pool + thumb_func_end GetFieldObjectMovingCameraOffset + + thumb_func_start FieldObjectMoveDestCoords +@ void FieldObjectMoveDestCoords(struct npc_state *fieldObject, u8 direction) +FieldObjectMoveDestCoords: @ 809316C + push {r4,lr} + lsls r1, 24 + lsrs r1, 24 + ldrh r4, [r0, 0x10] + strh r4, [r2] + ldrh r0, [r0, 0x12] + strh r0, [r3] + adds r0, r1, 0 + adds r1, r2, 0 + adds r2, r3, 0 + bl MoveCoords + pop {r4} + pop {r0} + bx r0 + thumb_func_end FieldObjectMoveDestCoords + + thumb_func_start FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive +@ bool8 FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive(struct npc_state *fieldObject) +FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive: @ 809318C + push {lr} + ldrb r1, [r0] + movs r0, 0x42 + ands r0, r1 + cmp r0, 0 + bne _0809319C + movs r0, 0 + b _0809319E +_0809319C: + movs r0, 0x1 +_0809319E: + pop {r1} + bx r1 + thumb_func_end FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + + thumb_func_start FieldObjectIsSpecialAnimActive +@ bool8 FieldObjectIsSpecialAnimActive(struct npc_state *fieldObject) +FieldObjectIsSpecialAnimActive: @ 80931A4 + push {lr} + adds r1, r0, 0 + ldrb r0, [r1] + lsls r0, 25 + cmp r0, 0 + bge _080931BA + ldrb r0, [r1, 0x1C] + cmp r0, 0xFF + beq _080931BA + movs r0, 0x1 + b _080931BC +_080931BA: + movs r0, 0 +_080931BC: + pop {r1} + bx r1 + thumb_func_end FieldObjectIsSpecialAnimActive + + thumb_func_start FieldObjectSetSpecialAnim +@ bool8 FieldObjectSetSpecialAnim(struct npc_state *fieldObject, u8 animId) +FieldObjectSetSpecialAnim: @ 80931C0 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _08093200 + adds r0, r4, 0 + bl npc_sync_anim_pause_bits + strb r5, [r4, 0x1C] + ldrb r0, [r4] + movs r1, 0x40 + orrs r0, r1 + movs r1, 0x7F + ands r0, r1 + strb r0, [r4] + ldr r2, =0x02020630 + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r6, [r0, 0x32] + movs r0, 0 + b _08093202 + .pool +_08093200: + movs r0, 0x1 +_08093202: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end FieldObjectSetSpecialAnim + + thumb_func_start FieldObjectForceSetSpecialAnim +@ void FieldObjectForceSetSpecialAnim(struct npc_state *fieldObject, u8 animId) +FieldObjectForceSetSpecialAnim: @ 8093208 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r4, r1, 24 + lsrs r4, 24 + bl FieldObjectClearAnimIfSpecialAnimActive + adds r0, r5, 0 + adds r1, r4, 0 + bl FieldObjectSetSpecialAnim + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end FieldObjectForceSetSpecialAnim + + thumb_func_start FieldObjectClearAnimIfSpecialAnimActive +@ void FieldObjectClearAnimIfSpecialAnimActive(struct npc_state *fieldObject) +FieldObjectClearAnimIfSpecialAnimActive: @ 8093224 + push {lr} + adds r1, r0, 0 + ldrb r0, [r1] + lsls r0, 25 + cmp r0, 0 + bge _08093236 + adds r0, r1, 0 + bl FieldObjectClearAnim +_08093236: + pop {r0} + bx r0 + thumb_func_end FieldObjectClearAnimIfSpecialAnimActive + + thumb_func_start FieldObjectClearAnim +@ void FieldObjectClearAnim(struct npc_state *fieldObject) +FieldObjectClearAnim: @ 809323C + movs r1, 0xFF + strb r1, [r0, 0x1C] + ldrb r2, [r0] + movs r1, 0x41 + negs r1, r1 + ands r1, r2 + movs r2, 0x7F + ands r1, r2 + strb r1, [r0] + ldr r3, =0x02020630 + ldrb r2, [r0, 0x4] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r3 + movs r2, 0 + strh r2, [r1, 0x30] + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r2, [r0, 0x32] + bx lr + .pool + thumb_func_end FieldObjectClearAnim + + thumb_func_start FieldObjectCheckIfSpecialAnimFinishedOrInactive +@ u8 FieldObjectCheckIfSpecialAnimFinishedOrInactive(struct npc_state *fieldObject) +FieldObjectCheckIfSpecialAnimFinishedOrInactive: @ 8093270 + push {lr} + ldrb r1, [r0] + lsls r0, r1, 25 + cmp r0, 0 + blt _0809327E + movs r0, 0x10 + b _08093280 +_0809327E: + lsrs r0, r1, 7 +_08093280: + pop {r1} + bx r1 + thumb_func_end FieldObjectCheckIfSpecialAnimFinishedOrInactive + + thumb_func_start FieldObjectClearAnimIfSpecialAnimFinished +@ u8 FieldObjectClearAnimIfSpecialAnimFinished(struct npc_state *fieldObject) +FieldObjectClearAnimIfSpecialAnimFinished: @ 8093284 + push {r4,r5,lr} + adds r5, r0, 0 + bl FieldObjectCheckIfSpecialAnimFinishedOrInactive + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0809329E + cmp r4, 0x10 + beq _0809329E + adds r0, r5, 0 + bl FieldObjectClearAnimIfSpecialAnimActive +_0809329E: + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end FieldObjectClearAnimIfSpecialAnimFinished + + thumb_func_start FieldObjectGetSpecialAnim +@ u8 FieldObjectGetSpecialAnim(struct npc_state *fieldObject) +FieldObjectGetSpecialAnim: @ 80932A8 + push {lr} + adds r1, r0, 0 + ldrb r0, [r1] + lsls r0, 25 + cmp r0, 0 + blt _080932B8 + movs r0, 0xFF + b _080932BA +_080932B8: + ldrb r0, [r1, 0x1C] +_080932BA: + pop {r1} + bx r1 + thumb_func_end FieldObjectGetSpecialAnim + + thumb_func_start FieldObjectStep +@ void FieldObjectStep(struct npc_state *fieldObject, struct obj *object, bool8 ( *callback)(struct npc_state *fieldObject, struct obj *object)) +FieldObjectStep: @ 80932C0 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + bl DoGroundEffects_OnSpawn + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80964E8 + adds r0, r4, 0 + bl FieldObjectIsSpecialAnimActive + lsls r0, 24 + cmp r0, 0 + beq _080932EA + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectExecSpecialAnim + b _08093300 +_080932EA: + ldrb r0, [r4, 0x1] + lsls r0, 31 + cmp r0, 0 + bne _08093300 +_080932F2: + adds r0, r4, 0 + adds r1, r5, 0 + bl _call_via_r6 + lsls r0, 24 + cmp r0, 0 + bne _080932F2 +_08093300: + adds r0, r4, 0 + adds r1, r5, 0 + bl DoGroundEffects_OnBeginStep + adds r0, r4, 0 + adds r1, r5, 0 + bl DoGroundEffects_OnFinishStep + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_obj_transfer_image_anim_pause_flag + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8096518 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectUpdateSubpriority + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end FieldObjectStep + + thumb_func_start GetFaceDirectionAnimId +@ u8 GetFaceDirectionAnimId(u8 direction) +GetFaceDirectionAnimId: @ 8093330 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBA0 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _08093348 + movs r4, 0 +_08093348: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end GetFaceDirectionAnimId + + thumb_func_start GetSimpleGoAnimId +@ u8 GetSimpleGoAnimId(u8 direction) +GetSimpleGoAnimId: @ 809335C + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBA5 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _08093374 + movs r4, 0 +_08093374: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end GetSimpleGoAnimId + + thumb_func_start GetGoSpeed0AnimId +@ u8 GetGoSpeed0AnimId(u8 direction) +GetGoSpeed0AnimId: @ 8093388 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBAA + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _080933A0 + movs r4, 0 +_080933A0: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end GetGoSpeed0AnimId + + thumb_func_start GetGoSpeed1AnimId +@ u8 GetGoSpeed1AnimId(u8 direction) +GetGoSpeed1AnimId: @ 80933B4 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBAF + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _080933CC + movs r4, 0 +_080933CC: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end GetGoSpeed1AnimId + + thumb_func_start GetGoSpeed2AnimId +@ u8 GetGoSpeed2AnimId(u8 direction) +GetGoSpeed2AnimId: @ 80933E0 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBB4 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _080933F8 + movs r4, 0 +_080933F8: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end GetGoSpeed2AnimId + + thumb_func_start GetGoSpeed3AnimId +@ u8 GetGoSpeed3AnimId(u8 direction) +GetGoSpeed3AnimId: @ 809340C + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBB9 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _08093424 + movs r4, 0 +_08093424: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end GetGoSpeed3AnimId + + thumb_func_start sub_8093438 +@ u8 sub_8093438(u8 direction) +sub_8093438: @ 8093438 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBBE + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _08093450 + movs r4, 0 +_08093450: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8093438 + + thumb_func_start GetRunAnimId +@ u8 GetRunAnimId(u8 direction) +GetRunAnimId: @ 8093464 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBC3 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _0809347C + movs r4, 0 +_0809347C: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end GetRunAnimId + + thumb_func_start GetJumpLedgeAnimId +@ u8 GetJumpLedgeAnimId(u8 direction) +GetJumpLedgeAnimId: @ 8093490 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBC8 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _080934A8 + movs r4, 0 +_080934A8: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end GetJumpLedgeAnimId + + thumb_func_start sub_80934BC +@ u8 sub_80934BC(u8 direction) +sub_80934BC: @ 80934BC + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBCD + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _080934D4 + movs r4, 0 +_080934D4: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80934BC + + thumb_func_start sub_80934E8 +@ u8 sub_80934E8(u8 direction) +sub_80934E8: @ 80934E8 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBD2 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _08093500 + movs r4, 0 +_08093500: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80934E8 + + thumb_func_start sub_8093514 +@ u8 sub_8093514(u8 direction) +sub_8093514: @ 8093514 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBD7 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _0809352C + movs r4, 0 +_0809352C: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8093514 + + thumb_func_start sub_8093540 +@ u8 sub_8093540(u8 direction) +sub_8093540: @ 8093540 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBDC + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _08093558 + movs r4, 0 +_08093558: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8093540 + + thumb_func_start GetStepInPlaceDelay32AnimId +@ u8 GetStepInPlaceDelay32AnimId(u8 direction) +GetStepInPlaceDelay32AnimId: @ 809356C + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBE1 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _08093584 + movs r4, 0 +_08093584: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end GetStepInPlaceDelay32AnimId + + thumb_func_start GetStepInPlaceDelay16AnimId +@ u8 GetStepInPlaceDelay16AnimId(u8 direction) +GetStepInPlaceDelay16AnimId: @ 8093598 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBE6 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _080935B0 + movs r4, 0 +_080935B0: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end GetStepInPlaceDelay16AnimId + + thumb_func_start GetStepInPlaceDelay8AnimId +@ u8 GetStepInPlaceDelay8AnimId(u8 direction) +GetStepInPlaceDelay8AnimId: @ 80935C4 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBEB + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _080935DC + movs r4, 0 +_080935DC: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end GetStepInPlaceDelay8AnimId + + thumb_func_start GetStepInPlaceDelay4AnimId +@ u8 GetStepInPlaceDelay4AnimId(u8 direction) +GetStepInPlaceDelay4AnimId: @ 80935F0 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBF0 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _08093608 + movs r4, 0 +_08093608: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end GetStepInPlaceDelay4AnimId + + thumb_func_start FieldObjectFaceOppositeDirection +@ bool8 FieldObjectFaceOppositeDirection(struct npc_state *fieldObject, u8 direction) +FieldObjectFaceOppositeDirection: @ 809361C + push {r4,lr} + adds r4, r0, 0 + lsls r0, r1, 24 + lsrs r0, 24 + bl GetOppositeDirection + lsls r0, 24 + lsrs r0, 24 + bl GetFaceDirectionAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + thumb_func_end FieldObjectFaceOppositeDirection + + thumb_func_start sub_8093648 +sub_8093648: @ 8093648 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBF5 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _08093660 + movs r4, 0 +_08093660: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8093648 + + thumb_func_start sub_8093674 +sub_8093674: @ 8093674 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBFA + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _0809368C + movs r4, 0 +_0809368C: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8093674 + + thumb_func_start sub_80936A0 +sub_80936A0: @ 80936A0 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBFF + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _080936B8 + movs r4, 0 +_080936B8: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80936A0 + + thumb_func_start sub_80936CC +sub_80936CC: @ 80936CC + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DC04 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _080936E4 + movs r4, 0 +_080936E4: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80936CC + + thumb_func_start sub_80936F8 +sub_80936F8: @ 80936F8 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DC09 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _08093710 + movs r4, 0 +_08093710: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80936F8 + + thumb_func_start sub_8093724 +sub_8093724: @ 8093724 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DC0E + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _0809373C + movs r4, 0 +_0809373C: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8093724 + + thumb_func_start sub_8093750 +sub_8093750: @ 8093750 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DC13 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _08093768 + movs r4, 0 +_08093768: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8093750 + + thumb_func_start sub_809377C +sub_809377C: @ 809377C + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DC18 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _08093794 + movs r4, 0 +_08093794: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809377C + + thumb_func_start sub_80937A8 +sub_80937A8: @ 80937A8 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DC1D + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _080937C0 + movs r4, 0 +_080937C0: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80937A8 + + thumb_func_start d2s_08064034 +d2s_08064034: @ 80937D4 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DC22 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _080937EC + movs r4, 0 +_080937EC: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end d2s_08064034 + + thumb_func_start GetOppositeDirection +@ u8 GetOppositeDirection(u8 direction) +GetOppositeDirection: @ 8093800 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DC27 + mov r0, sp + movs r2, 0x8 + bl memcpy + subs r1, r4, 0x1 + lsls r0, r1, 24 + lsrs r0, 24 + cmp r0, 0x7 + bhi _08093828 + mov r2, sp + adds r0, r2, r1 + ldrb r0, [r0] + b _0809382A + .pool +_08093828: + adds r0, r4, 0 +_0809382A: + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + thumb_func_end GetOppositeDirection + + thumb_func_start zffu_offset_calc +zffu_offset_calc: @ 8093834 + lsls r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_0850DC2F + lsrs r0, 22 + subs r0, 0x5 + adds r1, r0 + adds r1, r2 + ldrb r0, [r1] + bx lr + .pool + thumb_func_end zffu_offset_calc + + thumb_func_start state_to_direction +state_to_direction: @ 809384C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r1, 24 + adds r0, r1, 0 + lsls r2, 24 + lsrs r2, 24 + cmp r1, 0 + beq _0809386C + cmp r2, 0 + beq _0809386C + cmp r1, 0x4 + bhi _0809386C + cmp r2, 0x4 + bls _08093870 +_0809386C: + movs r0, 0 + b _08093882 +_08093870: + adds r1, r2, 0 + bl zffu_offset_calc + ldr r2, =gUnknown_0850DC3F + lsls r1, r4, 2 + subs r1, 0x5 + adds r0, r1 + adds r0, r2 + ldrb r0, [r0] +_08093882: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end state_to_direction + + thumb_func_start FieldObjectExecSpecialAnim +@ void FieldObjectExecSpecialAnim(struct npc_state *fieldObject, struct obj *object) +FieldObjectExecSpecialAnim: @ 809388C + push {r4,lr} + adds r4, r0, 0 + ldr r2, =gUnknown_0850DC50 + ldrb r0, [r4, 0x1C] + lsls r0, 2 + adds r0, r2 + movs r3, 0x32 + ldrsh r2, [r1, r3] + ldr r0, [r0] + lsls r2, 2 + adds r2, r0 + ldr r2, [r2] + adds r0, r4, 0 + bl _call_via_r2 + lsls r0, 24 + cmp r0, 0 + beq _080938B8 + ldrb r0, [r4] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r4] +_080938B8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectExecSpecialAnim + + thumb_func_start FieldObjectExecRegularAnim +@ bool8 FieldObjectExecRegularAnim(struct npc_state *fieldObject, struct obj *object) +FieldObjectExecRegularAnim: @ 80938C4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850DC50 + ldrb r0, [r4, 0x1C] + lsls r0, 2 + adds r0, r1 + movs r2, 0x32 + ldrsh r1, [r5, r2] + ldr r0, [r0] + lsls r1, 2 + adds r1, r0 + ldr r2, [r1] + adds r0, r4, 0 + adds r1, r5, 0 + bl _call_via_r2 + lsls r0, 24 + cmp r0, 0 + bne _080938F4 + movs r0, 0 + b _080938FE + .pool +_080938F4: + movs r0, 0xFF + strb r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r5, 0x32] + movs r0, 0x1 +_080938FE: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end FieldObjectExecRegularAnim + + thumb_func_start FieldObjectSetRegularAnim +@ void FieldObjectSetRegularAnim(struct npc_state *fieldObject, struct obj *object, u8 animState) +FieldObjectSetRegularAnim: @ 8093904 + movs r3, 0 + strb r2, [r0, 0x1C] + strh r3, [r1, 0x32] + bx lr + thumb_func_end FieldObjectSetRegularAnim + + thumb_func_start an_look_any +@ void an_look_any(struct npc_state *fieldObject, struct obj *object, u8 direction) +an_look_any: @ 809390C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r1, r2, 24 + lsrs r1, 24 + bl FieldObjectSetDirection + adds r0, r4, 0 + bl npc_coords_shift_still + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl get_go_image_anim_num + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl obj_npc_animation_step + adds r2, r5, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x1 + strh r0, [r5, 0x32] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end an_look_any + + thumb_func_start sub_8093950 +sub_8093950: @ 8093950 + push {lr} + movs r2, 0x1 + bl an_look_any + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8093950 + + thumb_func_start sub_8093960 +sub_8093960: @ 8093960 + push {lr} + movs r2, 0x2 + bl an_look_any + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8093960 + + thumb_func_start sub_8093970 +sub_8093970: @ 8093970 + push {lr} + movs r2, 0x3 + bl an_look_any + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8093970 + + thumb_func_start sub_8093980 +sub_8093980: @ 8093980 + push {lr} + movs r2, 0x4 + bl an_look_any + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8093980 + + thumb_func_start npc_apply_direction +@ void npc_apply_direction(struct npc_state *fieldObject, struct obj *object, u8 direction, u8 speed) +npc_apply_direction: @ 8093990 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r7, r0, 0 + mov r8, r1 + adds r4, r2, 0 + adds r6, r3, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r6, 24 + lsrs r6, 24 + ldrh r1, [r7, 0x10] + mov r0, sp + strh r1, [r0] + ldrh r0, [r7, 0x12] + mov r5, sp + adds r5, 0x2 + strh r0, [r5] + adds r0, r7, 0 + adds r1, r4, 0 + bl FieldObjectSetDirection + adds r0, r4, 0 + mov r1, sp + adds r2, r5, 0 + bl MoveCoords + mov r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0 + ldrsh r2, [r5, r0] + adds r0, r7, 0 + bl npc_coords_shift + mov r0, r8 + adds r1, r4, 0 + adds r2, r6, 0 + bl oamt_npc_ministep_reset + mov r4, r8 + adds r4, 0x2C + ldrb r1, [r4] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r4] + ldr r0, =0x020375b8 + ldr r0, [r0] + cmp r0, 0 + beq _08093A0E + adds r0, r7, 0 + bl sub_8097F78 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x10 + beq _08093A0E + ldrb r0, [r4] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r4] +_08093A0E: + ldrb r0, [r7] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r7] + movs r0, 0x1 + mov r1, r8 + strh r0, [r1, 0x32] + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end npc_apply_direction + + thumb_func_start do_go_anim +@ void do_go_anim(struct npc_state *fieldObject, struct obj *object, u8 direction, u8 speed) +do_go_anim: @ 8093A2C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + adds r5, r0, 0 + mov r8, r1 + adds r4, r3, 0 + lsls r2, 24 + lsrs r2, 24 + lsls r4, 24 + lsrs r4, 24 + mov r1, sp + ldr r0, =gUnknown_0850DEE8 + ldm r0!, {r3,r6,r7} + stm r1!, {r3,r6,r7} + ldm r0!, {r3,r6} + stm r1!, {r3,r6} + adds r0, r5, 0 + mov r1, r8 + adds r3, r4, 0 + bl npc_apply_direction + lsls r4, 2 + mov r7, sp + adds r1, r7, r4 + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + ldr r1, [r1] + bl _call_via_r1 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r5, 0 + mov r1, r8 + bl npc_apply_anim_looping + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end do_go_anim + + thumb_func_start do_run_anim +@ void do_run_anim(struct npc_state *fieldObject, struct obj *object, u8 direction) +do_run_anim: @ 8093A88 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r2, 24 + lsrs r2, 24 + movs r3, 0x1 + bl npc_apply_direction + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl get_run_image_anim_num + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_apply_anim_looping + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end do_run_anim + + thumb_func_start npc_obj_ministep_stop_on_arrival +@ bool8 npc_obj_ministep_stop_on_arrival(struct npc_state *fieldObject, struct obj *object) +npc_obj_ministep_stop_on_arrival: @ 8093AB8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl obj_npc_ministep + lsls r0, 24 + cmp r0, 0 + bne _08093ACE + movs r0, 0 + b _08093AEA +_08093ACE: + adds r0, r4, 0 + bl npc_coords_shift_still + ldrb r0, [r4] + movs r1, 0x8 + orrs r0, r1 + strb r0, [r4] + adds r2, r5, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x1 +_08093AEA: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end npc_obj_ministep_stop_on_arrival + + thumb_func_start sub_8093AF0 +@ void sub_8093AF0(struct npc_state *fieldObject, struct obj *object, u8 direction) +sub_8093AF0: @ 8093AF0 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + adds r6, r0, 0 + mov r8, r1 + lsls r5, r2, 24 + lsrs r5, 24 + ldrh r1, [r6, 0x10] + mov r0, sp + strh r1, [r0] + ldrh r0, [r6, 0x12] + mov r4, sp + adds r4, 0x2 + strh r0, [r4] + adds r0, r6, 0 + adds r1, r5, 0 + bl FieldObjectSetDirection + adds r0, r5, 0 + mov r1, sp + adds r2, r4, 0 + bl MoveCoords + mov r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0 + ldrsh r2, [r4, r0] + adds r0, r6, 0 + bl npc_coords_shift + mov r0, r8 + adds r1, r5, 0 + bl sub_80976DC + mov r2, r8 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldrb r0, [r6] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r6] + movs r0, 0x1 + mov r1, r8 + strh r0, [r1, 0x32] + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8093AF0 + + thumb_func_start sub_8093B60 +@ void sub_8093B60(struct npc_state *fieldObject, struct obj *object, u8 direction) +sub_8093B60: @ 8093B60 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r2, 24 + lsrs r2, 24 + bl sub_8093AF0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl get_go_image_anim_num + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_apply_anim_looping + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8093B60 + + thumb_func_start an_walk_any_2 +@ bool8 an_walk_any_2(struct npc_state *fieldObject, struct obj *object) +an_walk_any_2: @ 8093B8C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_80976EC + lsls r0, 24 + cmp r0, 0 + bne _08093BA2 + movs r0, 0 + b _08093BBE +_08093BA2: + adds r0, r4, 0 + bl npc_coords_shift_still + ldrb r0, [r4] + movs r1, 0x8 + orrs r0, r1 + strb r0, [r4] + adds r2, r5, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x1 +_08093BBE: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end an_walk_any_2 + + thumb_func_start sub_8093BC4 +sub_8093BC4: @ 8093BC4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x7 + bl sub_8093B60 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8093BE4 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8093BC4 + + thumb_func_start sub_8093BE4 +sub_8093BE4: @ 8093BE4 + push {r4,lr} + adds r4, r1, 0 + bl an_walk_any_2 + lsls r0, 24 + cmp r0, 0 + bne _08093BF6 + movs r0, 0 + b _08093BFC +_08093BF6: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08093BFC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093BE4 + + thumb_func_start sub_8093C04 +sub_8093C04: @ 8093C04 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x8 + bl sub_8093B60 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8093C24 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8093C04 + + thumb_func_start sub_8093C24 +sub_8093C24: @ 8093C24 + push {r4,lr} + adds r4, r1, 0 + bl an_walk_any_2 + lsls r0, 24 + cmp r0, 0 + bne _08093C36 + movs r0, 0 + b _08093C3C +_08093C36: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08093C3C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093C24 + + thumb_func_start sub_8093C44 +sub_8093C44: @ 8093C44 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x5 + bl sub_8093B60 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8093C64 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8093C44 + + thumb_func_start sub_8093C64 +sub_8093C64: @ 8093C64 + push {r4,lr} + adds r4, r1, 0 + bl an_walk_any_2 + lsls r0, 24 + cmp r0, 0 + bne _08093C76 + movs r0, 0 + b _08093C7C +_08093C76: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08093C7C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093C64 + + thumb_func_start sub_8093C84 +sub_8093C84: @ 8093C84 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x6 + bl sub_8093B60 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8093CA4 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8093C84 + + thumb_func_start sub_8093CA4 +sub_8093CA4: @ 8093CA4 + push {r4,lr} + adds r4, r1, 0 + bl an_walk_any_2 + lsls r0, 24 + cmp r0, 0 + bne _08093CB6 + movs r0, 0 + b _08093CBC +_08093CB6: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08093CBC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093CA4 + + thumb_func_start sub_8093CC4 +@ bool8 sub_8093CC4(struct npc_state *fieldObject, struct obj *object) +sub_8093CC4: @ 8093CC4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + bl sub_8093B60 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8093CE4 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8093CC4 + + thumb_func_start sub_8093CE4 +@ bool8 sub_8093CE4(struct npc_state *fieldObject, struct obj *object) +sub_8093CE4: @ 8093CE4 + push {r4,lr} + adds r4, r1, 0 + bl an_walk_any_2 + lsls r0, 24 + cmp r0, 0 + bne _08093CF6 + movs r0, 0 + b _08093CFC +_08093CF6: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08093CFC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093CE4 + + thumb_func_start sub_8093D04 +sub_8093D04: @ 8093D04 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x2 + bl sub_8093B60 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8093D24 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8093D04 + + thumb_func_start sub_8093D24 +sub_8093D24: @ 8093D24 + push {r4,lr} + adds r4, r1, 0 + bl an_walk_any_2 + lsls r0, 24 + cmp r0, 0 + bne _08093D36 + movs r0, 0 + b _08093D3C +_08093D36: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08093D3C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093D24 + + thumb_func_start sub_8093D44 +sub_8093D44: @ 8093D44 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x3 + bl sub_8093B60 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8093D64 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8093D44 + + thumb_func_start sub_8093D64 +sub_8093D64: @ 8093D64 + push {r4,lr} + adds r4, r1, 0 + bl an_walk_any_2 + lsls r0, 24 + cmp r0, 0 + bne _08093D76 + movs r0, 0 + b _08093D7C +_08093D76: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08093D7C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093D64 + + thumb_func_start sub_8093D84 +sub_8093D84: @ 8093D84 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x4 + bl sub_8093B60 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8093DA4 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8093D84 + + thumb_func_start sub_8093DA4 +sub_8093DA4: @ 8093DA4 + push {r4,lr} + adds r4, r1, 0 + bl an_walk_any_2 + lsls r0, 24 + cmp r0, 0 + bne _08093DB6 + movs r0, 0 + b _08093DBC +_08093DB6: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08093DBC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093DA4 + + thumb_func_start sub_8093DC4 +sub_8093DC4: @ 8093DC4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x7 + movs r3, 0 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8093DE4 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8093DC4 + + thumb_func_start sub_8093DE4 +@ bool8 sub_8093DE4(struct npc_state *fieldObject, struct obj *object) +sub_8093DE4: @ 8093DE4 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08093DF6 + movs r0, 0 + b _08093DFC +_08093DF6: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08093DFC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093DE4 + + thumb_func_start sub_8093E04 +sub_8093E04: @ 8093E04 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x8 + movs r3, 0 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8093E24 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8093E04 + + thumb_func_start sub_8093E24 +sub_8093E24: @ 8093E24 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08093E36 + movs r0, 0 + b _08093E3C +_08093E36: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08093E3C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093E24 + + thumb_func_start sub_8093E44 +sub_8093E44: @ 8093E44 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x5 + movs r3, 0 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8093E64 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8093E44 + + thumb_func_start sub_8093E64 +sub_8093E64: @ 8093E64 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08093E76 + movs r0, 0 + b _08093E7C +_08093E76: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08093E7C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093E64 + + thumb_func_start sub_8093E84 +sub_8093E84: @ 8093E84 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x6 + movs r3, 0 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8093EA4 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8093E84 + + thumb_func_start sub_8093EA4 +sub_8093EA4: @ 8093EA4 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08093EB6 + movs r0, 0 + b _08093EBC +_08093EB6: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08093EBC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093EA4 + + thumb_func_start sub_8093EC4 +sub_8093EC4: @ 8093EC4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + movs r3, 0 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8093EE4 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8093EC4 + + thumb_func_start sub_8093EE4 +sub_8093EE4: @ 8093EE4 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08093EF6 + movs r0, 0 + b _08093EFC +_08093EF6: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08093EFC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093EE4 + + thumb_func_start sub_8093F04 +sub_8093F04: @ 8093F04 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x2 + movs r3, 0 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8093F24 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8093F04 + + thumb_func_start sub_8093F24 +sub_8093F24: @ 8093F24 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08093F36 + movs r0, 0 + b _08093F3C +_08093F36: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08093F3C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093F24 + + thumb_func_start sub_8093F44 +sub_8093F44: @ 8093F44 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x3 + movs r3, 0 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8093F64 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8093F44 + + thumb_func_start sub_8093F64 +sub_8093F64: @ 8093F64 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08093F76 + movs r0, 0 + b _08093F7C +_08093F76: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08093F7C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093F64 + + thumb_func_start sub_8093F84 +sub_8093F84: @ 8093F84 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x4 + movs r3, 0 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8093FA4 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8093F84 + + thumb_func_start sub_8093FA4 +sub_8093FA4: @ 8093FA4 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08093FB6 + movs r0, 0 + b _08093FBC +_08093FB6: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08093FBC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093FA4 + + thumb_func_start sub_8093FC4 +sub_8093FC4: @ 8093FC4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + adds r7, r0, 0 + mov r10, r1 + adds r4, r2, 0 + mov r8, r3 + ldr r0, [sp, 0x30] + lsls r4, 24 + lsrs r4, 24 + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r1, =gUnknown_0850DFBC + add r0, sp, 0x4 + movs r2, 0x6 + bl memcpy + add r5, sp, 0xC + movs r0, 0 + strh r0, [r5] + mov r6, sp + adds r6, 0xE + strh r0, [r6] + adds r0, r7, 0 + adds r1, r4, 0 + bl FieldObjectSetDirection + mov r1, r8 + lsls r0, r1, 1 + add r0, sp + adds r0, 0x4 + movs r1, 0 + ldrsh r3, [r0, r1] + str r3, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_8092F88 + ldrh r1, [r5] + ldrh r0, [r7, 0x10] + adds r1, r0 + lsls r1, 16 + asrs r1, 16 + ldrh r2, [r6] + ldrh r0, [r7, 0x12] + adds r2, r0 + lsls r2, 16 + asrs r2, 16 + adds r0, r7, 0 + bl npc_coords_shift + mov r0, r10 + adds r1, r4, 0 + mov r2, r8 + mov r3, r9 + bl sub_809783C + movs r0, 0x1 + mov r1, r10 + strh r0, [r1, 0x32] + movs r0, 0x2C + add r10, r0 + mov r0, r10 + ldrb r1, [r0] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + mov r1, r10 + strb r0, [r1] + ldrb r0, [r7] + movs r1, 0x4 + orrs r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r7] + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8093FC4 + + thumb_func_start maybe_shadow_1 +maybe_shadow_1: @ 8094080 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, [sp, 0x10] + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + adds r0, r4, 0 + bl sub_8093FC4 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl get_go_image_anim_num + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_apply_anim_looping + adds r0, r4, 0 + bl DoShadowFieldEffect + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end maybe_shadow_1 + + thumb_func_start sub_80940C4 +@ int sub_80940C4(int a1, int a2, int a3) +sub_80940C4: @ 80940C4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + adds r6, r0, 0 + adds r7, r1, 0 + adds r4, r2, 0 + ldr r1, =gUnknown_0850DFC2 + add r0, sp, 0x4 + movs r2, 0x6 + bl memcpy + adds r0, r7, 0 + bl _call_via_r4 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x1 + bne _08094154 + movs r1, 0x36 + ldrsh r0, [r7, r1] + lsls r0, 1 + add r0, sp + adds r0, 0x4 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + beq _08094154 + add r4, sp, 0xC + movs r0, 0 + strh r0, [r4] + mov r5, sp + adds r5, 0xE + strh r0, [r5] + ldrb r0, [r6, 0x18] + lsrs r0, 4 + movs r2, 0x36 + ldrsh r1, [r7, r2] + lsls r1, 1 + add r1, sp + adds r1, 0x4 + movs r2, 0 + ldrsh r3, [r1, r2] + str r3, [sp] + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_8092F88 + ldrh r1, [r4] + ldrh r0, [r6, 0x10] + adds r1, r0 + lsls r1, 16 + asrs r1, 16 + ldrh r2, [r5] + ldrh r0, [r6, 0x12] + adds r2, r0 + lsls r2, 16 + asrs r2, 16 + adds r0, r6, 0 + bl npc_coords_shift + ldrb r0, [r6] + movs r1, 0x4 + orrs r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r6] + b _08094178 + .pool +_08094154: + mov r1, r8 + cmp r1, 0xFF + bne _08094178 + adds r0, r6, 0 + bl npc_coords_shift_still + ldrb r0, [r6] + movs r1, 0x8 + orrs r0, r1 + movs r1, 0x20 + orrs r0, r1 + strb r0, [r6] + adds r2, r7, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] +_08094178: + mov r0, r8 + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80940C4 + + thumb_func_start sub_8094188 +sub_8094188: @ 8094188 + push {lr} + ldr r2, =sub_809785C + bl sub_80940C4 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8094188 + + thumb_func_start sub_809419C +sub_809419C: @ 809419C + push {lr} + ldr r2, =sub_80978E4 + bl sub_80940C4 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_809419C + + thumb_func_start sub_80941B0 +sub_80941B0: @ 80941B0 + push {lr} + bl sub_8094188 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _080941C2 + movs r0, 0 + b _080941C4 +_080941C2: + movs r0, 0x1 +_080941C4: + pop {r1} + bx r1 + thumb_func_end sub_80941B0 + + thumb_func_start sub_80941C8 +sub_80941C8: @ 80941C8 + push {lr} + bl sub_809419C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _080941DA + movs r0, 0 + b _080941DC +_080941DA: + movs r0, 0x1 +_080941DC: + pop {r1} + bx r1 + thumb_func_end sub_80941C8 + + thumb_func_start sub_80941E0 +sub_80941E0: @ 80941E0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_8094188 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080941FA + cmp r0, 0xFF + bne _08094226 + movs r0, 0x1 + b _08094228 +_080941FA: + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl GetOppositeDirection + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetDirection + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl get_go_image_anim_num + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl obj_npc_animation_step +_08094226: + movs r0, 0 +_08094228: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80941E0 + + thumb_func_start sub_8094230 +sub_8094230: @ 8094230 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x2 + bl maybe_shadow_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809425C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094230 + + thumb_func_start sub_809425C +sub_809425C: @ 809425C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08094270 + movs r0, 0 + b _08094280 +_08094270: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08094280: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809425C + + thumb_func_start sub_8094288 +sub_8094288: @ 8094288 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x2 + movs r3, 0x2 + bl maybe_shadow_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80942B4 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094288 + + thumb_func_start sub_80942B4 +sub_80942B4: @ 80942B4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _080942C8 + movs r0, 0 + b _080942D8 +_080942C8: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_080942D8: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80942B4 + + thumb_func_start sub_80942E0 +sub_80942E0: @ 80942E0 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x3 + movs r3, 0x2 + bl maybe_shadow_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809430C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80942E0 + + thumb_func_start sub_809430C +sub_809430C: @ 809430C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08094320 + movs r0, 0 + b _08094330 +_08094320: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08094330: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809430C + + thumb_func_start sub_8094338 +sub_8094338: @ 8094338 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x4 + movs r3, 0x2 + bl maybe_shadow_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094364 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094338 + + thumb_func_start sub_8094364 +sub_8094364: @ 8094364 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08094378 + movs r0, 0 + b _08094388 +_08094378: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08094388: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094364 + + thumb_func_start sub_8094390 +sub_8094390: @ 8094390 + movs r2, 0x1 + strh r2, [r0, 0x32] + strh r1, [r0, 0x34] + bx lr + thumb_func_end sub_8094390 + + thumb_func_start sub_8094398 +sub_8094398: @ 8094398 + push {lr} + ldrh r0, [r1, 0x34] + subs r0, 0x1 + strh r0, [r1, 0x34] + lsls r0, 16 + cmp r0, 0 + beq _080943AA + movs r0, 0 + b _080943B0 +_080943AA: + movs r0, 0x2 + strh r0, [r1, 0x32] + movs r0, 0x1 +_080943B0: + pop {r1} + bx r1 + thumb_func_end sub_8094398 + + thumb_func_start sub_80943B4 +sub_80943B4: @ 80943B4 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8094390 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8094398 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80943B4 + + thumb_func_start sub_80943D4 +sub_80943D4: @ 80943D4 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + movs r1, 0x2 + bl sub_8094390 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8094398 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80943D4 + + thumb_func_start sub_80943F4 +sub_80943F4: @ 80943F4 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + movs r1, 0x4 + bl sub_8094390 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8094398 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80943F4 + + thumb_func_start sub_8094414 +sub_8094414: @ 8094414 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + movs r1, 0x8 + bl sub_8094390 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8094398 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094414 + + thumb_func_start sub_8094434 +sub_8094434: @ 8094434 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + movs r1, 0x10 + bl sub_8094390 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8094398 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094434 + + thumb_func_start sub_8094454 +sub_8094454: @ 8094454 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + movs r3, 0x1 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094474 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094454 + + thumb_func_start sub_8094474 +sub_8094474: @ 8094474 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094486 + movs r0, 0 + b _0809448C +_08094486: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_0809448C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094474 + + thumb_func_start sub_8094494 +sub_8094494: @ 8094494 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x2 + movs r3, 0x1 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80944B4 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094494 + + thumb_func_start sub_80944B4 +sub_80944B4: @ 80944B4 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _080944C6 + movs r0, 0 + b _080944CC +_080944C6: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_080944CC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80944B4 + + thumb_func_start sub_80944D4 +sub_80944D4: @ 80944D4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x3 + movs r3, 0x1 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80944F4 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80944D4 + + thumb_func_start sub_80944F4 +sub_80944F4: @ 80944F4 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094506 + movs r0, 0 + b _0809450C +_08094506: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_0809450C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80944F4 + + thumb_func_start sub_8094514 +sub_8094514: @ 8094514 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x4 + movs r3, 0x1 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094534 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094514 + + thumb_func_start sub_8094534 +sub_8094534: @ 8094534 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094546 + movs r0, 0 + b _0809454C +_08094546: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_0809454C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094534 + + thumb_func_start sub_8094554 +sub_8094554: @ 8094554 + push {r4-r6,lr} + mov r6, r8 + push {r6} + mov r8, r0 + adds r6, r1, 0 + adds r1, r2, 0 + adds r4, r3, 0 + ldr r5, [sp, 0x14] + lsls r1, 24 + lsrs r1, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 16 + lsrs r5, 16 + bl FieldObjectSetDirection + mov r0, r8 + adds r1, r6, 0 + adds r2, r4, 0 + bl npc_apply_anim_looping + adds r2, r6, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + movs r0, 0x1 + strh r0, [r6, 0x32] + strh r5, [r6, 0x34] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8094554 + + thumb_func_start sub_809459C +@ signed int sub_809459C(int a1, obj *a2) +sub_809459C: @ 809459C + push {lr} + ldrh r0, [r1, 0x34] + subs r0, 0x1 + strh r0, [r1, 0x34] + lsls r0, 16 + cmp r0, 0 + beq _080945AE + movs r0, 0 + b _080945C0 +_080945AE: + movs r0, 0x2 + strh r0, [r1, 0x32] + adds r2, r1, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x1 +_080945C0: + pop {r1} + bx r1 + thumb_func_end sub_809459C + + thumb_func_start sub_80945C4 +@ int sub_80945C4(int a1, obj *a2) +sub_80945C4: @ 80945C4 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldrh r1, [r4, 0x34] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080945EE + adds r3, r4, 0 + adds r3, 0x2C + ldrb r2, [r3] + lsls r1, r2, 26 + lsrs r1, 26 + adds r1, 0x1 + movs r0, 0x3F + ands r1, r0 + movs r0, 0x40 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] +_080945EE: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80945C4 + + thumb_func_start sub_8094600 +sub_8094600: @ 8094600 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + bl get_go_image_anim_num + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x20 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80945C4 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094600 + + thumb_func_start sub_8094638 +sub_8094638: @ 8094638 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x2 + bl get_go_image_anim_num + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x20 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x2 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80945C4 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094638 + + thumb_func_start sub_8094670 +sub_8094670: @ 8094670 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x3 + bl get_go_image_anim_num + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x20 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x3 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80945C4 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094670 + + thumb_func_start sub_80946A8 +sub_80946A8: @ 80946A8 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x4 + bl get_go_image_anim_num + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x20 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x4 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80945C4 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80946A8 + + thumb_func_start sub_80946E0 +sub_80946E0: @ 80946E0 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + bl get_go_image_anim_num + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x10 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80946E0 + + thumb_func_start sub_8094718 +sub_8094718: @ 8094718 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x2 + bl get_go_image_anim_num + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x10 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x2 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094718 + + thumb_func_start sub_8094750 +sub_8094750: @ 8094750 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x3 + bl get_go_image_anim_num + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x10 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x3 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094750 + + thumb_func_start sub_8094788 +sub_8094788: @ 8094788 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x4 + bl get_go_image_anim_num + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x10 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x4 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094788 + + thumb_func_start sub_80947C0 +sub_80947C0: @ 80947C0 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + bl get_go_fast_image_anim_num + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x8 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80947C0 + + thumb_func_start sub_80947F8 +sub_80947F8: @ 80947F8 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x2 + bl get_go_fast_image_anim_num + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x8 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x2 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80947F8 + + thumb_func_start sub_8094830 +sub_8094830: @ 8094830 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x3 + bl get_go_fast_image_anim_num + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x8 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x3 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094830 + + thumb_func_start sub_8094868 +sub_8094868: @ 8094868 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x4 + bl get_go_fast_image_anim_num + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x8 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x4 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094868 + + thumb_func_start sub_80948A0 +sub_80948A0: @ 80948A0 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + bl get_go_faster_image_anim_num + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x4 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80948A0 + + thumb_func_start sub_80948D8 +sub_80948D8: @ 80948D8 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x2 + bl get_go_faster_image_anim_num + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x4 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x2 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80948D8 + + thumb_func_start sub_8094910 +sub_8094910: @ 8094910 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x3 + bl get_go_faster_image_anim_num + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x4 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x3 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094910 + + thumb_func_start sub_8094948 +sub_8094948: @ 8094948 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x4 + bl get_go_faster_image_anim_num + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x4 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x4 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094948 + + thumb_func_start sub_8094980 +sub_8094980: @ 8094980 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + movs r3, 0x2 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80949A0 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094980 + + thumb_func_start sub_80949A0 +sub_80949A0: @ 80949A0 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _080949B2 + movs r0, 0 + b _080949B8 +_080949B2: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_080949B8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80949A0 + + thumb_func_start sub_80949C0 +sub_80949C0: @ 80949C0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x2 + movs r3, 0x2 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80949E0 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80949C0 + + thumb_func_start sub_80949E0 +sub_80949E0: @ 80949E0 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _080949F2 + movs r0, 0 + b _080949F8 +_080949F2: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_080949F8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80949E0 + + thumb_func_start sub_8094A00 +sub_8094A00: @ 8094A00 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x3 + movs r3, 0x2 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094A20 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094A00 + + thumb_func_start sub_8094A20 +sub_8094A20: @ 8094A20 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094A32 + movs r0, 0 + b _08094A38 +_08094A32: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08094A38: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094A20 + + thumb_func_start sub_8094A40 +sub_8094A40: @ 8094A40 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x4 + movs r3, 0x2 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094A60 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094A40 + + thumb_func_start sub_8094A60 +sub_8094A60: @ 8094A60 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094A72 + movs r0, 0 + b _08094A78 +_08094A72: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08094A78: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094A60 + + thumb_func_start sub_8094A80 +sub_8094A80: @ 8094A80 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + movs r3, 0x3 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094AA0 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094A80 + + thumb_func_start sub_8094AA0 +sub_8094AA0: @ 8094AA0 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094AB2 + movs r0, 0 + b _08094AB8 +_08094AB2: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08094AB8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094AA0 + + thumb_func_start sub_8094AC0 +sub_8094AC0: @ 8094AC0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x2 + movs r3, 0x3 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094AE0 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094AC0 + + thumb_func_start sub_8094AE0 +sub_8094AE0: @ 8094AE0 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094AF2 + movs r0, 0 + b _08094AF8 +_08094AF2: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08094AF8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094AE0 + + thumb_func_start sub_8094B00 +sub_8094B00: @ 8094B00 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x3 + movs r3, 0x3 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094B20 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094B00 + + thumb_func_start sub_8094B20 +sub_8094B20: @ 8094B20 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094B32 + movs r0, 0 + b _08094B38 +_08094B32: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08094B38: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094B20 + + thumb_func_start sub_8094B40 +sub_8094B40: @ 8094B40 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x4 + movs r3, 0x3 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094B60 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094B40 + + thumb_func_start sub_8094B60 +sub_8094B60: @ 8094B60 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094B72 + movs r0, 0 + b _08094B78 +_08094B72: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08094B78: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094B60 + + thumb_func_start sub_8094B80 +sub_8094B80: @ 8094B80 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + movs r3, 0x4 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094BA0 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094B80 + + thumb_func_start sub_8094BA0 +sub_8094BA0: @ 8094BA0 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094BB2 + movs r0, 0 + b _08094BB8 +_08094BB2: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08094BB8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094BA0 + + thumb_func_start sub_8094BC0 +sub_8094BC0: @ 8094BC0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x2 + movs r3, 0x4 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094BE0 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094BC0 + + thumb_func_start sub_8094BE0 +sub_8094BE0: @ 8094BE0 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094BF2 + movs r0, 0 + b _08094BF8 +_08094BF2: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08094BF8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094BE0 + + thumb_func_start sub_8094C00 +sub_8094C00: @ 8094C00 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x3 + movs r3, 0x4 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094C20 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094C00 + + thumb_func_start sub_8094C20 +sub_8094C20: @ 8094C20 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094C32 + movs r0, 0 + b _08094C38 +_08094C32: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08094C38: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094C20 + + thumb_func_start sub_8094C40 +sub_8094C40: @ 8094C40 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x4 + movs r3, 0x4 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094C60 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094C40 + + thumb_func_start sub_8094C60 +sub_8094C60: @ 8094C60 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094C72 + movs r0, 0 + b _08094C78 +_08094C72: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08094C78: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094C60 + + thumb_func_start do_run_south_anim +@ bool8 do_run_south_anim(struct npc_state *fieldObject, struct obj *object) +do_run_south_anim: @ 8094C80 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + bl do_run_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094CA0 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end do_run_south_anim + + thumb_func_start sub_8094CA0 +@ bool8 sub_8094CA0(struct npc_state *fieldObject, struct obj *object) +sub_8094CA0: @ 8094CA0 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094CB2 + movs r0, 0 + b _08094CB8 +_08094CB2: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08094CB8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094CA0 + + thumb_func_start do_run_north_anim +do_run_north_anim: @ 8094CC0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x2 + bl do_run_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094CE0 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end do_run_north_anim + + thumb_func_start sub_8094CE0 +sub_8094CE0: @ 8094CE0 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094CF2 + movs r0, 0 + b _08094CF8 +_08094CF2: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08094CF8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094CE0 + + thumb_func_start do_run_west_anim +do_run_west_anim: @ 8094D00 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x3 + bl do_run_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094D20 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end do_run_west_anim + + thumb_func_start sub_8094D20 +sub_8094D20: @ 8094D20 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094D32 + movs r0, 0 + b _08094D38 +_08094D32: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08094D38: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094D20 + + thumb_func_start do_run_east_anim +do_run_east_anim: @ 8094D40 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x4 + bl do_run_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094D60 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end do_run_east_anim + + thumb_func_start sub_8094D60 +sub_8094D60: @ 8094D60 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094D72 + movs r0, 0 + b _08094D78 +_08094D72: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08094D78: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094D60 + + thumb_func_start npc_set_direction_and_anim__an_proceed +npc_set_direction_and_anim__an_proceed: @ 8094D80 + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r1, 0 + adds r4, r2, 0 + adds r1, r3, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + movs r2, 0 + bl obj_anim_image_set_and_seek + adds r0, r6, 0 + adds r1, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x1 + strh r0, [r5, 0x32] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end npc_set_direction_and_anim__an_proceed + + thumb_func_start sub_8094DAC +sub_8094DAC: @ 8094DAC + push {lr} + ldrb r2, [r0, 0x18] + lsrs r2, 4 + adds r3, r1, 0 + adds r3, 0x2A + ldrb r3, [r3] + bl npc_set_direction_and_anim__an_proceed + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_8094DAC + + thumb_func_start sub_8094DC4 +sub_8094DC4: @ 8094DC4 + push {r4,lr} + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80979BC + lsls r0, 24 + cmp r0, 0 + bne _08094DD8 + movs r0, 0 + b _08094DDE +_08094DD8: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08094DDE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094DC4 + + thumb_func_start sub_8094DE4 +sub_8094DE4: @ 8094DE4 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r1, 0 + lsls r4, r2, 24 + lsrs r4, 24 + movs r1, 0 + str r1, [sp] + adds r1, r5, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8093FC4 + adds r0, r4, 0 + bl sub_80929AC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl StartObjectImageAnim + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8094DE4 + + thumb_func_start sub_8094E18 +sub_8094E18: @ 8094E18 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + bl sub_8094DE4 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094E38 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094E18 + + thumb_func_start sub_8094E38 +sub_8094E38: @ 8094E38 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941C8 + lsls r0, 24 + cmp r0, 0 + bne _08094E4C + movs r0, 0 + b _08094E5A +_08094E4C: + movs r0, 0x2 + strh r0, [r5, 0x32] + ldrb r1, [r4] + subs r0, 0x23 + ands r0, r1 + strb r0, [r4] + movs r0, 0x1 +_08094E5A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094E38 + + thumb_func_start sub_8094E60 +sub_8094E60: @ 8094E60 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x2 + bl sub_8094DE4 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094E80 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094E60 + + thumb_func_start sub_8094E80 +sub_8094E80: @ 8094E80 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941C8 + lsls r0, 24 + cmp r0, 0 + bne _08094E94 + movs r0, 0 + b _08094EA2 +_08094E94: + movs r0, 0x2 + strh r0, [r5, 0x32] + ldrb r1, [r4] + subs r0, 0x23 + ands r0, r1 + strb r0, [r4] + movs r0, 0x1 +_08094EA2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094E80 + + thumb_func_start sub_8094EA8 +sub_8094EA8: @ 8094EA8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x3 + bl sub_8094DE4 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094EC8 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094EA8 + + thumb_func_start sub_8094EC8 +sub_8094EC8: @ 8094EC8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941C8 + lsls r0, 24 + cmp r0, 0 + bne _08094EDC + movs r0, 0 + b _08094EEA +_08094EDC: + movs r0, 0x2 + strh r0, [r5, 0x32] + ldrb r1, [r4] + subs r0, 0x23 + ands r0, r1 + strb r0, [r4] + movs r0, 0x1 +_08094EEA: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094EC8 + + thumb_func_start sub_8094EF0 +sub_8094EF0: @ 8094EF0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x4 + bl sub_8094DE4 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094F10 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094EF0 + + thumb_func_start sub_8094F10 +sub_8094F10: @ 8094F10 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941C8 + lsls r0, 24 + cmp r0, 0 + bne _08094F24 + movs r0, 0 + b _08094F32 +_08094F24: + movs r0, 0x2 + strh r0, [r5, 0x32] + ldrb r1, [r4] + subs r0, 0x23 + ands r0, r1 + strb r0, [r4] + movs r0, 0x1 +_08094F32: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094F10 + + thumb_func_start sub_8094F38 +sub_8094F38: @ 8094F38 + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _08094F82 + movs r1, 0x10 + ldrsh r0, [r5, r1] + movs r2, 0x12 + ldrsh r1, [r5, r2] + ldr r4, =0x02037350 + mov r2, sp + ldrb r2, [r2] + lsls r3, r2, 3 + adds r3, r2 + lsls r3, 2 + adds r3, r4 + movs r4, 0x10 + ldrsh r2, [r3, r4] + movs r4, 0x12 + ldrsh r3, [r3, r4] + bl sub_8092AF8 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r5, 0 + adds r1, r6, 0 + bl an_look_any +_08094F82: + movs r0, 0x1 + strh r0, [r6, 0x32] + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8094F38 + + thumb_func_start sub_8094F94 +sub_8094F94: @ 8094F94 + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _08094FE6 + movs r1, 0x10 + ldrsh r0, [r5, r1] + movs r2, 0x12 + ldrsh r1, [r5, r2] + ldr r4, =0x02037350 + mov r2, sp + ldrb r2, [r2] + lsls r3, r2, 3 + adds r3, r2 + lsls r3, 2 + adds r3, r4 + movs r4, 0x10 + ldrsh r2, [r3, r4] + movs r4, 0x12 + ldrsh r3, [r3, r4] + bl sub_8092AF8 + lsls r0, 24 + lsrs r0, 24 + bl GetOppositeDirection + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r5, 0 + adds r1, r6, 0 + bl an_look_any +_08094FE6: + movs r0, 0x1 + strh r0, [r6, 0x32] + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8094F94 + + thumb_func_start sub_8094FF8 +sub_8094FF8: @ 8094FF8 + ldrb r2, [r0, 0x1] + movs r3, 0x2 + orrs r2, r3 + strb r2, [r0, 0x1] + movs r0, 0x1 + strh r0, [r1, 0x32] + bx lr + thumb_func_end sub_8094FF8 + + thumb_func_start sub_8095008 +sub_8095008: @ 8095008 + ldrb r3, [r0, 0x1] + movs r2, 0x3 + negs r2, r2 + ands r2, r3 + strb r2, [r0, 0x1] + movs r0, 0x1 + strh r0, [r1, 0x32] + bx lr + thumb_func_end sub_8095008 + + thumb_func_start sub_8095018 +sub_8095018: @ 8095018 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x2 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x1 + bl maybe_shadow_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8095044 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095018 + + thumb_func_start sub_8095044 +sub_8095044: @ 8095044 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095058 + movs r0, 0 + b _08095068 +_08095058: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095068: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095044 + + thumb_func_start sub_8095070 +sub_8095070: @ 8095070 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x2 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x2 + movs r3, 0x1 + bl maybe_shadow_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809509C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095070 + + thumb_func_start sub_809509C +sub_809509C: @ 809509C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _080950B0 + movs r0, 0 + b _080950C0 +_080950B0: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_080950C0: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809509C + + thumb_func_start sub_80950C8 +sub_80950C8: @ 80950C8 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x2 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x3 + movs r3, 0x1 + bl maybe_shadow_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80950F4 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80950C8 + + thumb_func_start sub_80950F4 +sub_80950F4: @ 80950F4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095108 + movs r0, 0 + b _08095118 +_08095108: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095118: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80950F4 + + thumb_func_start sub_8095120 +sub_8095120: @ 8095120 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x2 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x4 + movs r3, 0x1 + bl maybe_shadow_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809514C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095120 + + thumb_func_start sub_809514C +sub_809514C: @ 809514C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095160 + movs r0, 0 + b _08095170 +_08095160: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095170: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809514C + + thumb_func_start sub_8095178 +sub_8095178: @ 8095178 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0 + bl maybe_shadow_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80951A4 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095178 + + thumb_func_start sub_80951A4 +sub_80951A4: @ 80951A4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _080951B8 + movs r0, 0 + b _080951C8 +_080951B8: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_080951C8: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80951A4 + + thumb_func_start sub_80951D0 +sub_80951D0: @ 80951D0 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x2 + movs r3, 0 + bl maybe_shadow_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80951FC + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80951D0 + + thumb_func_start sub_80951FC +sub_80951FC: @ 80951FC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095210 + movs r0, 0 + b _08095220 +_08095210: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095220: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80951FC + + thumb_func_start sub_8095228 +sub_8095228: @ 8095228 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x3 + movs r3, 0 + bl maybe_shadow_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8095254 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095228 + + thumb_func_start sub_8095254 +sub_8095254: @ 8095254 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095268 + movs r0, 0 + b _08095278 +_08095268: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095278: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095254 + + thumb_func_start sub_8095280 +sub_8095280: @ 8095280 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x4 + movs r3, 0 + bl maybe_shadow_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80952AC + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095280 + + thumb_func_start sub_80952AC +sub_80952AC: @ 80952AC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _080952C0 + movs r0, 0 + b _080952D0 +_080952C0: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_080952D0: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80952AC + + thumb_func_start sub_80952D8 +sub_80952D8: @ 80952D8 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x2 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0 + bl maybe_shadow_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8095304 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80952D8 + + thumb_func_start sub_8095304 +sub_8095304: @ 8095304 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941E0 + lsls r0, 24 + cmp r0, 0 + bne _08095318 + movs r0, 0 + b _08095328 +_08095318: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095328: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095304 + + thumb_func_start sub_8095330 +sub_8095330: @ 8095330 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x2 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x2 + movs r3, 0 + bl maybe_shadow_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809535C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095330 + + thumb_func_start sub_809535C +sub_809535C: @ 809535C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941E0 + lsls r0, 24 + cmp r0, 0 + bne _08095370 + movs r0, 0 + b _08095380 +_08095370: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095380: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809535C + + thumb_func_start sub_8095388 +sub_8095388: @ 8095388 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x2 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x3 + movs r3, 0 + bl maybe_shadow_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80953B4 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095388 + + thumb_func_start sub_80953B4 +sub_80953B4: @ 80953B4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941E0 + lsls r0, 24 + cmp r0, 0 + bne _080953C8 + movs r0, 0 + b _080953D8 +_080953C8: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_080953D8: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80953B4 + + thumb_func_start sub_80953E0 +sub_80953E0: @ 80953E0 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x2 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x4 + movs r3, 0 + bl maybe_shadow_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809540C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80953E0 + + thumb_func_start sub_809540C +sub_809540C: @ 809540C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941E0 + lsls r0, 24 + cmp r0, 0 + bne _08095420 + movs r0, 0 + b _08095430 +_08095420: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095430: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809540C + + thumb_func_start sub_8095438 +sub_8095438: @ 8095438 + push {lr} + ldr r3, =gUnknown_085055CD + ldrb r2, [r0, 0x6] + adds r2, r3 + ldrb r2, [r2] + bl an_look_any + movs r0, 0x1 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8095438 + + thumb_func_start sub_8095450 +sub_8095450: @ 8095450 + push {lr} + movs r2, 0x1 + movs r3, 0x14 + bl npc_set_direction_and_anim__an_proceed + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_8095450 + + thumb_func_start sub_8095460 +sub_8095460: @ 8095460 + ldrb r3, [r0, 0x3] + movs r2, 0x3 + negs r2, r2 + ands r2, r3 + strb r2, [r0, 0x3] + movs r0, 0x1 + strh r0, [r1, 0x32] + bx lr + thumb_func_end sub_8095460 + + thumb_func_start sub_8095470 +sub_8095470: @ 8095470 + ldrb r2, [r0, 0x3] + movs r3, 0x2 + orrs r2, r3 + strb r2, [r0, 0x3] + movs r0, 0x1 + strh r0, [r1, 0x32] + bx lr + thumb_func_end sub_8095470 + + thumb_func_start sub_8095480 +sub_8095480: @ 8095480 + ldrb r2, [r0, 0x1] + movs r3, 0x10 + orrs r2, r3 + strb r2, [r0, 0x1] + movs r0, 0x1 + strh r0, [r1, 0x32] + bx lr + thumb_func_end sub_8095480 + + thumb_func_start sub_8095490 +@ int sub_8095490(npc_state *npcState, int a2) +sub_8095490: @ 8095490 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x5] + bl GetFieldObjectGraphicsInfo + ldrb r1, [r0, 0xC] + lsls r1, 25 + lsrs r1, 31 + lsls r1, 4 + ldrb r2, [r4, 0x1] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x1] + movs r0, 0x1 + strh r0, [r5, 0x32] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095490 + + thumb_func_start sub_80954BC +sub_80954BC: @ 80954BC + ldrb r2, [r0, 0x1] + movs r3, 0x20 + orrs r2, r3 + strb r2, [r0, 0x1] + movs r0, 0x1 + strh r0, [r1, 0x32] + bx lr + thumb_func_end sub_80954BC + + thumb_func_start sub_80954CC +sub_80954CC: @ 80954CC + ldrb r3, [r0, 0x1] + movs r2, 0x21 + negs r2, r2 + ands r2, r3 + strb r2, [r0, 0x1] + movs r0, 0x1 + strh r0, [r1, 0x32] + bx lr + thumb_func_end sub_80954CC + + thumb_func_start do_exclamation_mark_bubble_1 +do_exclamation_mark_bubble_1: @ 80954DC + push {r4,lr} + adds r4, r1, 0 + ldr r1, =0x02038c08 + adds r2, r1, 0x4 + adds r3, r1, 0 + adds r3, 0x8 + bl FieldObjectGetLocalIdAndMap + movs r0, 0 + bl FieldEffectStart + movs r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end do_exclamation_mark_bubble_1 + + thumb_func_start do_exclamation_mark_bubble_2 +do_exclamation_mark_bubble_2: @ 8095500 + push {r4,lr} + adds r4, r1, 0 + ldr r1, =0x02038c08 + adds r2, r1, 0x4 + adds r3, r1, 0 + adds r3, 0x8 + bl FieldObjectGetLocalIdAndMap + movs r0, 0x21 + bl FieldEffectStart + movs r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end do_exclamation_mark_bubble_2 + + thumb_func_start do_heart_bubble +do_heart_bubble: @ 8095524 + push {r4,lr} + adds r4, r1, 0 + ldr r1, =0x02038c08 + adds r2, r1, 0x4 + adds r3, r1, 0 + adds r3, 0x8 + bl FieldObjectGetLocalIdAndMap + movs r0, 0x2E + bl FieldEffectStart + movs r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end do_heart_bubble + + thumb_func_start sub_8095548 +sub_8095548: @ 8095548 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x6] + cmp r0, 0x3F + bne _0809555E + adds r0, r4, 0 + bl sub_80B4578 + movs r0, 0 + b _08095586 +_0809555E: + subs r0, 0x39 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _08095580 + adds r0, r4, 0 + bl sub_8155D78 + movs r0, 0x1 + strh r0, [r5, 0x32] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809558C + lsls r0, 24 + lsrs r0, 24 + b _08095586 +_08095580: + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095586: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095548 + + thumb_func_start sub_809558C +sub_809558C: @ 809558C + push {r4,lr} + adds r4, r1, 0 + bl sub_8155DA0 + lsls r0, 24 + cmp r0, 0 + bne _0809559E + movs r0, 0 + b _080955A4 +_0809559E: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_080955A4: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809558C + + thumb_func_start sub_80955AC +sub_80955AC: @ 80955AC + push {r4,lr} + adds r4, r1, 0 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl obj_anim_image_set_and_seek + movs r0, 0x1 + strh r0, [r4, 0x32] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80955AC + + thumb_func_start sub_80955C8 +sub_80955C8: @ 80955C8 + push {r4,lr} + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80979BC + lsls r0, 24 + cmp r0, 0 + beq _080955E4 + adds r0, r4, 0 + movs r1, 0x20 + bl sub_8097978 + movs r0, 0x2 + strh r0, [r4, 0x32] +_080955E4: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80955C8 + + thumb_func_start sub_80955EC +sub_80955EC: @ 80955EC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r2, [r4, 0x1] + lsls r1, r2, 26 + lsrs r1, 31 + movs r0, 0x1 + eors r1, r0 + lsls r1, 5 + subs r0, 0x22 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x1] + adds r0, r5, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + beq _0809561E + ldrb r0, [r4, 0x1] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r4, 0x1] + movs r0, 0x3 + strh r0, [r5, 0x32] +_0809561E: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80955EC + + thumb_func_start sub_8095628 +sub_8095628: @ 8095628 + push {r4,lr} + adds r4, r1, 0 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl obj_anim_image_set_and_seek + movs r0, 0x1 + strh r0, [r4, 0x32] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8095628 + + thumb_func_start sub_8095644 +sub_8095644: @ 8095644 + push {r4,lr} + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80979BC + lsls r0, 24 + cmp r0, 0 + beq _08095660 + adds r0, r4, 0 + movs r1, 0x20 + bl sub_8097978 + movs r0, 0x2 + strh r0, [r4, 0x32] +_08095660: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8095644 + + thumb_func_start sub_8095668 +sub_8095668: @ 8095668 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r2, [r4, 0x1] + lsls r1, r2, 26 + lsrs r1, 31 + movs r0, 0x1 + eors r1, r0 + lsls r1, 5 + subs r0, 0x22 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x1] + adds r0, r5, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + beq _0809569A + ldrb r0, [r4, 0x1] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r4, 0x1] + movs r0, 0x3 + strh r0, [r5, 0x32] +_0809569A: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095668 + + thumb_func_start sub_80956A4 +sub_80956A4: @ 80956A4 + ldrb r2, [r0, 0x3] + movs r3, 0x4 + orrs r2, r3 + strb r2, [r0, 0x3] + movs r0, 0x1 + strh r0, [r1, 0x32] + bx lr + thumb_func_end sub_80956A4 + + thumb_func_start sub_80956B4 +sub_80956B4: @ 80956B4 + ldrb r3, [r0, 0x3] + movs r2, 0x5 + negs r2, r2 + ands r2, r3 + strb r2, [r0, 0x3] + movs r0, 0x1 + strh r0, [r1, 0x32] + bx lr + thumb_func_end sub_80956B4 + + thumb_func_start sub_80956C4 +sub_80956C4: @ 80956C4 + push {r4,lr} + adds r4, r1, 0 + ldrb r0, [r4, 0x1] + movs r1, 0x3 + orrs r0, r1 + strb r0, [r4, 0x1] + adds r0, r4, 0 + bl obj_alloc_rotscale_entry + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + adds r4, 0x42 + ldrb r1, [r4] + movs r0, 0x3F + ands r0, r1 + strb r0, [r4] + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80956C4 + + thumb_func_start sub_80956F4 +sub_80956F4: @ 80956F4 + push {r4,lr} + adds r4, r1, 0 + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + ldrb r0, [r4, 0x1] + movs r1, 0x4 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x1] + lsrs r1, 6 + ldrb r2, [r4, 0x3] + lsrs r2, 6 + movs r3, 0 + adds r0, r4, 0 + bl CalcVecFromObjectCenterToObjectUpperLeft + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80956F4 + + thumb_func_start sub_8095724 +sub_8095724: @ 8095724 + ldrb r1, [r0, 0x3] + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0, 0x3] + movs r0, 0x1 + bx lr + thumb_func_end sub_8095724 + + thumb_func_start sub_8095730 +sub_8095730: @ 8095730 + ldrb r2, [r0, 0x3] + movs r1, 0x9 + negs r1, r1 + ands r1, r2 + strb r1, [r0, 0x3] + movs r0, 0x1 + bx lr + thumb_func_end sub_8095730 + + thumb_func_start sub_8095740 +sub_8095740: @ 8095740 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r2, 0x1 + bl sub_8093B60 + adds r2, r4, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0 + bl StartObjectRotScalAnimIfDifferent + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8095774 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095740 + + thumb_func_start sub_8095774 +sub_8095774: @ 8095774 + push {r4,lr} + adds r4, r1, 0 + bl an_walk_any_2 + lsls r0, 24 + cmp r0, 0 + bne _08095786 + movs r0, 0 + b _08095798 +_08095786: + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08095798: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8095774 + + thumb_func_start sub_80957A0 +sub_80957A0: @ 80957A0 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r2, 0x1 + bl sub_8093B60 + adds r2, r4, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80082F0 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80957D4 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80957A0 + + thumb_func_start sub_80957D4 +sub_80957D4: @ 80957D4 + push {r4,lr} + adds r4, r1, 0 + bl an_walk_any_2 + lsls r0, 24 + cmp r0, 0 + bne _080957E6 + movs r0, 0 + b _080957F8 +_080957E6: + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_080957F8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80957D4 + + thumb_func_start sub_8095800 +sub_8095800: @ 8095800 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r2, 0x3 + movs r3, 0x1 + bl do_go_anim + adds r2, r4, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0x2 + bl sub_80082F0 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8095834 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095800 + + thumb_func_start sub_8095834 +sub_8095834: @ 8095834 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08095846 + movs r0, 0 + b _08095858 +_08095846: + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08095858: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8095834 + + thumb_func_start sub_8095860 +sub_8095860: @ 8095860 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r2, 0x4 + movs r3, 0x1 + bl do_go_anim + adds r2, r4, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0x3 + bl sub_80082F0 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8095894 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095860 + + thumb_func_start sub_8095894 +sub_8095894: @ 8095894 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _080958A6 + movs r0, 0 + b _080958B8 +_080958A6: + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_080958B8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8095894 + + thumb_func_start sub_80958C0 +sub_80958C0: @ 80958C0 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + lsls r4, r2, 24 + lsrs r4, 24 + adds r1, r4, 0 + bl FieldObjectSetDirection + adds r0, r5, 0 + bl npc_coords_shift_still + adds r0, r4, 0 + bl sub_80929FC + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r5, 0 + adds r1, r6, 0 + bl obj_npc_animation_step + adds r2, r6, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x1 + strh r0, [r6, 0x32] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80958C0 + + thumb_func_start sub_8095900 +sub_8095900: @ 8095900 + push {lr} + movs r2, 0x1 + bl sub_80958C0 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8095900 + + thumb_func_start sub_8095910 +sub_8095910: @ 8095910 + push {lr} + movs r2, 0x2 + bl sub_80958C0 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8095910 + + thumb_func_start sub_8095920 +sub_8095920: @ 8095920 + push {lr} + movs r2, 0x3 + bl sub_80958C0 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8095920 + + thumb_func_start sub_8095930 +sub_8095930: @ 8095930 + push {lr} + movs r2, 0x4 + bl sub_80958C0 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8095930 + + thumb_func_start sub_8095940 +sub_8095940: @ 8095940 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + bl sub_80929BC + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl npc_set_direction_and_anim__an_proceed + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095940 + + thumb_func_start sub_8095964 +sub_8095964: @ 8095964 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x2 + bl sub_80929BC + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x2 + bl npc_set_direction_and_anim__an_proceed + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095964 + + thumb_func_start sub_8095988 +sub_8095988: @ 8095988 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x3 + bl sub_80929BC + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x3 + bl npc_set_direction_and_anim__an_proceed + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095988 + + thumb_func_start sub_80959AC +sub_80959AC: @ 80959AC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x4 + bl sub_80929BC + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x4 + bl npc_set_direction_and_anim__an_proceed + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80959AC + + thumb_func_start sub_80959D0 +sub_80959D0: @ 80959D0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + bl sub_80929DC + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl npc_set_direction_and_anim__an_proceed + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80959D0 + + thumb_func_start sub_80959F4 +sub_80959F4: @ 80959F4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x2 + bl sub_80929DC + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x2 + bl npc_set_direction_and_anim__an_proceed + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80959F4 + + thumb_func_start sub_8095A18 +sub_8095A18: @ 8095A18 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x3 + bl sub_80929DC + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x3 + bl npc_set_direction_and_anim__an_proceed + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095A18 + + thumb_func_start sub_8095A3C +sub_8095A3C: @ 8095A3C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x4 + bl sub_80929DC + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x4 + bl npc_set_direction_and_anim__an_proceed + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095A3C + + thumb_func_start sub_8095A60 +sub_8095A60: @ 8095A60 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + bl sub_80929EC + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl npc_set_direction_and_anim__an_proceed + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095A60 + + thumb_func_start sub_8095A84 +sub_8095A84: @ 8095A84 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x2 + bl sub_80929EC + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x2 + bl npc_set_direction_and_anim__an_proceed + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095A84 + + thumb_func_start sub_8095AA8 +sub_8095AA8: @ 8095AA8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x3 + bl sub_80929EC + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x3 + bl npc_set_direction_and_anim__an_proceed + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095AA8 + + thumb_func_start sub_8095ACC +sub_8095ACC: @ 8095ACC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x4 + bl sub_80929EC + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x4 + bl npc_set_direction_and_anim__an_proceed + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095ACC + + thumb_func_start sub_8095AF0 +sub_8095AF0: @ 8095AF0 + push {r4,lr} + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_8097750 + adds r4, 0x2C + ldrb r1, [r4] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r4] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8095AF0 + + thumb_func_start sub_8095B0C +sub_8095B0C: @ 8095B0C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_8097758 + lsls r0, 24 + cmp r0, 0 + bne _08095B22 + movs r0, 0 + b _08095B3E +_08095B22: + adds r0, r4, 0 + bl npc_coords_shift_still + ldrb r0, [r4] + movs r1, 0x8 + orrs r0, r1 + strb r0, [r4] + adds r2, r5, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x1 +_08095B3E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095B0C + + thumb_func_start sub_8095B44 +sub_8095B44: @ 8095B44 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + bl sub_8095AF0 + movs r0, 0x1 + strh r0, [r4, 0x32] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8095B64 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095B44 + + thumb_func_start sub_8095B64 +sub_8095B64: @ 8095B64 + push {r4,lr} + adds r4, r1, 0 + bl sub_8095B0C + lsls r0, 24 + cmp r0, 0 + bne _08095B76 + movs r0, 0 + b _08095B7C +_08095B76: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08095B7C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8095B64 + + thumb_func_start sub_8095B84 +sub_8095B84: @ 8095B84 + push {r4-r6,lr} + sub sp, 0x4 + adds r6, r0, 0 + adds r5, r1, 0 + adds r4, r2, 0 + ldr r0, [sp, 0x14] + lsls r4, 24 + lsrs r4, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + adds r0, r6, 0 + adds r2, r4, 0 + bl sub_8093FC4 + adds r0, r4, 0 + bl sub_80929BC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl StartObjectImageAnimIfDifferent + adds r0, r6, 0 + bl DoShadowFieldEffect + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8095B84 + + thumb_func_start sub_8095BC8 +sub_8095BC8: @ 8095BC8 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_8095B84 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8095BF4 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095BC8 + + thumb_func_start sub_8095BF4 +sub_8095BF4: @ 8095BF4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095C08 + movs r0, 0 + b _08095C18 +_08095C08: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095C18: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095BF4 + + thumb_func_start sub_8095C20 +sub_8095C20: @ 8095C20 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x2 + movs r3, 0 + bl sub_8095B84 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8095C4C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095C20 + + thumb_func_start sub_8095C4C +sub_8095C4C: @ 8095C4C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095C60 + movs r0, 0 + b _08095C70 +_08095C60: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095C70: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095C4C + + thumb_func_start sub_8095C78 +sub_8095C78: @ 8095C78 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x3 + movs r3, 0 + bl sub_8095B84 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8095CA4 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095C78 + + thumb_func_start sub_8095CA4 +sub_8095CA4: @ 8095CA4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095CB8 + movs r0, 0 + b _08095CC8 +_08095CB8: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095CC8: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095CA4 + + thumb_func_start sub_8095CD0 +sub_8095CD0: @ 8095CD0 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x4 + movs r3, 0 + bl sub_8095B84 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8095CFC + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095CD0 + + thumb_func_start sub_8095CFC +sub_8095CFC: @ 8095CFC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095D10 + movs r0, 0 + b _08095D20 +_08095D10: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095D20: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095CFC + + thumb_func_start sub_8095D28 +sub_8095D28: @ 8095D28 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x1 + bl sub_8095B84 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8095D54 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095D28 + + thumb_func_start sub_8095D54 +sub_8095D54: @ 8095D54 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095D68 + movs r0, 0 + b _08095D78 +_08095D68: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095D78: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095D54 + + thumb_func_start sub_8095D80 +sub_8095D80: @ 8095D80 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x2 + movs r3, 0x1 + bl sub_8095B84 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8095DAC + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095D80 + + thumb_func_start sub_8095DAC +sub_8095DAC: @ 8095DAC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095DC0 + movs r0, 0 + b _08095DD0 +_08095DC0: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095DD0: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095DAC + + thumb_func_start sub_8095DD8 +sub_8095DD8: @ 8095DD8 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x3 + movs r3, 0x1 + bl sub_8095B84 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8095E04 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095DD8 + + thumb_func_start sub_8095E04 +sub_8095E04: @ 8095E04 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095E18 + movs r0, 0 + b _08095E28 +_08095E18: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095E28: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095E04 + + thumb_func_start sub_8095E30 +sub_8095E30: @ 8095E30 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x4 + movs r3, 0x1 + bl sub_8095B84 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8095E5C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095E30 + + thumb_func_start sub_8095E5C +sub_8095E5C: @ 8095E5C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095E70 + movs r0, 0 + b _08095E80 +_08095E70: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095E80: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095E5C + + thumb_func_start sub_8095E88 +sub_8095E88: @ 8095E88 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x2 + bl sub_8095B84 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8095EB4 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095E88 + + thumb_func_start sub_8095EB4 +sub_8095EB4: @ 8095EB4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095EC8 + movs r0, 0 + b _08095ED8 +_08095EC8: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095ED8: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095EB4 + + thumb_func_start sub_8095EE0 +sub_8095EE0: @ 8095EE0 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x2 + movs r3, 0x2 + bl sub_8095B84 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8095F0C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095EE0 + + thumb_func_start sub_8095F0C +sub_8095F0C: @ 8095F0C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095F20 + movs r0, 0 + b _08095F30 +_08095F20: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095F30: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095F0C + + thumb_func_start sub_8095F38 +sub_8095F38: @ 8095F38 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x3 + movs r3, 0x2 + bl sub_8095B84 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8095F64 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095F38 + + thumb_func_start sub_8095F64 +sub_8095F64: @ 8095F64 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095F78 + movs r0, 0 + b _08095F88 +_08095F78: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095F88: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095F64 + + thumb_func_start sub_8095F90 +sub_8095F90: @ 8095F90 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x4 + movs r3, 0x2 + bl sub_8095B84 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8095FBC + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095F90 + + thumb_func_start sub_8095FBC +sub_8095FBC: @ 8095FBC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095FD0 + movs r0, 0 + b _08095FE0 +_08095FD0: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095FE0: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095FBC + + thumb_func_start sub_8095FE8 +sub_8095FE8: @ 8095FE8 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + bl sub_80929FC + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x8 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095FE8 + + thumb_func_start sub_8096020 +sub_8096020: @ 8096020 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x2 + bl sub_80929FC + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x8 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x2 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8096020 + + thumb_func_start sub_8096058 +sub_8096058: @ 8096058 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x3 + bl sub_80929FC + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x8 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x3 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8096058 + + thumb_func_start sub_8096090 +sub_8096090: @ 8096090 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x4 + bl sub_80929FC + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x8 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x4 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8096090 + + thumb_func_start sub_80960C8 +sub_80960C8: @ 80960C8 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + bl npc_apply_direction + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl sub_80929BC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + adds r0, r4, 0 + movs r1, 0 + bl SeekObjectImageAnim + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80960C8 + + thumb_func_start sub_8096100 +sub_8096100: @ 8096100 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + movs r3, 0x1 + bl sub_80960C8 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8096120 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8096100 + + thumb_func_start sub_8096120 +sub_8096120: @ 8096120 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08096132 + movs r0, 0 + b _08096138 +_08096132: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08096138: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8096120 + + thumb_func_start sub_8096140 +sub_8096140: @ 8096140 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x2 + movs r3, 0x1 + bl sub_80960C8 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8096160 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8096140 + + thumb_func_start sub_8096160 +sub_8096160: @ 8096160 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08096172 + movs r0, 0 + b _08096178 +_08096172: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08096178: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8096160 + + thumb_func_start sub_8096180 +sub_8096180: @ 8096180 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x3 + movs r3, 0x1 + bl sub_80960C8 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80961A0 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8096180 + + thumb_func_start sub_80961A0 +sub_80961A0: @ 80961A0 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _080961B2 + movs r0, 0 + b _080961B8 +_080961B2: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_080961B8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80961A0 + + thumb_func_start sub_80961C0 +sub_80961C0: @ 80961C0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x4 + movs r3, 0x1 + bl sub_80960C8 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80961E0 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80961C0 + + thumb_func_start sub_80961E0 +sub_80961E0: @ 80961E0 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _080961F2 + movs r0, 0 + b _080961F8 +_080961F2: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_080961F8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80961E0 + + thumb_func_start sub_8096200 +sub_8096200: @ 8096200 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + bl npc_apply_direction + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl sub_80929FC + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_apply_anim_looping + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8096200 + + thumb_func_start sub_8096230 +sub_8096230: @ 8096230 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + movs r3, 0x1 + bl sub_8096200 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8096250 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8096230 + + thumb_func_start sub_8096250 +sub_8096250: @ 8096250 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08096262 + movs r0, 0 + b _08096268 +_08096262: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08096268: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8096250 + + thumb_func_start sub_8096270 +sub_8096270: @ 8096270 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x2 + movs r3, 0x1 + bl sub_8096200 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8096290 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8096270 + + thumb_func_start sub_8096290 +sub_8096290: @ 8096290 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _080962A2 + movs r0, 0 + b _080962A8 +_080962A2: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_080962A8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8096290 + + thumb_func_start sub_80962B0 +sub_80962B0: @ 80962B0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x3 + movs r3, 0x1 + bl sub_8096200 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80962D0 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80962B0 + + thumb_func_start sub_80962D0 +sub_80962D0: @ 80962D0 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _080962E2 + movs r0, 0 + b _080962E8 +_080962E2: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_080962E8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80962D0 + + thumb_func_start sub_80962F0 +sub_80962F0: @ 80962F0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x4 + movs r3, 0x1 + bl sub_8096200 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8096310 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80962F0 + + thumb_func_start sub_8096310 +sub_8096310: @ 8096310 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08096322 + movs r0, 0 + b _08096328 +_08096322: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08096328: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8096310 + + thumb_func_start sub_8096330 +sub_8096330: @ 8096330 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + bl npc_apply_direction + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl sub_80929DC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + adds r0, r4, 0 + movs r1, 0 + bl SeekObjectImageAnim + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8096330 + + thumb_func_start sub_8096368 +sub_8096368: @ 8096368 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + movs r3, 0x1 + bl sub_8096330 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8096388 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8096368 + + thumb_func_start sub_8096388 +sub_8096388: @ 8096388 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _0809639A + movs r0, 0 + b _080963A0 +_0809639A: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_080963A0: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8096388 + + thumb_func_start sub_80963A8 +sub_80963A8: @ 80963A8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x2 + movs r3, 0x1 + bl sub_8096330 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80963C8 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80963A8 + + thumb_func_start sub_80963C8 +sub_80963C8: @ 80963C8 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _080963DA + movs r0, 0 + b _080963E0 +_080963DA: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_080963E0: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80963C8 + + thumb_func_start sub_80963E8 +sub_80963E8: @ 80963E8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x3 + movs r3, 0x1 + bl sub_8096330 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8096408 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80963E8 + + thumb_func_start sub_8096408 +sub_8096408: @ 8096408 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _0809641A + movs r0, 0 + b _08096420 +_0809641A: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08096420: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8096408 + + thumb_func_start sub_8096428 +sub_8096428: @ 8096428 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x4 + movs r3, 0x1 + bl sub_8096330 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8096448 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8096428 + + thumb_func_start sub_8096448 +sub_8096448: @ 8096448 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _0809645A + movs r0, 0 + b _08096460 +_0809645A: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08096460: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8096448 + + thumb_func_start sub_8096468 +sub_8096468: @ 8096468 + push {r4,lr} + adds r4, r1, 0 + bl sub_8097FA4 + movs r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8096468 + + thumb_func_start sub_809647C +sub_809647C: @ 809647C + push {r4,lr} + adds r4, r1, 0 + ldrb r0, [r0, 0x1B] + bl sub_8098044 + movs r0, 0 + strh r0, [r4, 0x26] + movs r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809647C + + thumb_func_start sub_8096494 +sub_8096494: @ 8096494 + push {r4,lr} + adds r2, r0, 0 + adds r4, r1, 0 + movs r1, 0x26 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080964A6 + movs r0, 0 + b _080964B0 +_080964A6: + ldrb r0, [r2, 0x1B] + bl sub_8098044 + movs r0, 0x1 + strh r0, [r4, 0x32] +_080964B0: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8096494 + + thumb_func_start sub_80964B8 +sub_80964B8: @ 80964B8 + movs r0, 0x1 + bx lr + thumb_func_end sub_80964B8 + + thumb_func_start sub_80964BC +@ bool8 sub_80964BC(struct npc_state *fieldObject, struct obj *object) +sub_80964BC: @ 80964BC + adds r1, 0x2C + ldrb r0, [r1] + movs r2, 0x40 + orrs r0, r2 + strb r0, [r1] + movs r0, 0x1 + bx lr + thumb_func_end sub_80964BC + + thumb_func_start npc_obj_transfer_image_anim_pause_flag +@ void npc_obj_transfer_image_anim_pause_flag(struct npc_state *fieldObject, struct obj *object) +npc_obj_transfer_image_anim_pause_flag: @ 80964CC + push {lr} + ldrb r0, [r0, 0x1] + lsls r0, 29 + cmp r0, 0 + bge _080964E2 + adds r0, r1, 0 + adds r0, 0x2C + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] +_080964E2: + pop {r0} + bx r0 + thumb_func_end npc_obj_transfer_image_anim_pause_flag + + thumb_func_start sub_80964E8 +@ void sub_80964E8(struct npc_state *fieldObject, struct obj *object) +sub_80964E8: @ 80964E8 + push {r4,lr} + adds r4, r0, 0 + ldrb r3, [r4, 0x1] + lsls r0, r3, 28 + cmp r0, 0 + bge _08096510 + adds r2, r1, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r3 + movs r1, 0x9 + negs r1, r1 + ands r0, r1 + strb r0, [r4, 0x1] +_08096510: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80964E8 + + thumb_func_start sub_8096518 +@ void sub_8096518(struct npc_state *fieldObject, struct obj *object) +sub_8096518: @ 8096518 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_8096530 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_update_obj_anim_flag + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8096518 + + thumb_func_start sub_8096530 +sub_8096530: @ 8096530 + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldrb r1, [r5, 0x1] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r5, 0x1] + ldrb r0, [r5, 0x5] + bl GetFieldObjectGraphicsInfo + adds r6, r0, 0 + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08096594 + ldrh r1, [r4, 0x24] + ldrh r0, [r4, 0x20] + adds r1, r0 + adds r0, r4, 0 + adds r0, 0x28 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldr r2, =0x02021bbc + adds r0, r1 + ldrh r2, [r2] + adds r0, r2 + lsls r0, 16 + lsrs r3, r0, 16 + ldrh r1, [r4, 0x26] + ldrh r0, [r4, 0x22] + adds r1, r0 + adds r0, r4, 0 + adds r0, 0x29 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldr r2, =0x02021bbe + adds r0, r1 + ldrh r2, [r2] + adds r0, r2 + b _080965BC + .pool +_08096594: + ldrh r1, [r4, 0x24] + ldrh r0, [r4, 0x20] + adds r1, r0 + adds r0, r4, 0 + adds r0, 0x28 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + adds r0, r1 + lsls r0, 16 + lsrs r3, r0, 16 + ldrh r1, [r4, 0x26] + ldrh r0, [r4, 0x22] + adds r1, r0 + adds r0, r4, 0 + adds r0, 0x29 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + adds r0, r1 +_080965BC: + lsls r0, 16 + lsrs r2, r0, 16 + ldrh r0, [r6, 0x8] + adds r0, r3 + lsls r0, 16 + lsrs r1, r0, 16 + ldrh r0, [r6, 0xA] + adds r0, r2 + lsls r0, 16 + lsrs r4, r0, 16 + lsls r0, r3, 16 + asrs r0, 16 + cmp r0, 0xFF + bgt _080965E4 + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + bge _080965EC +_080965E4: + ldrb r0, [r5, 0x1] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r5, 0x1] +_080965EC: + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0xAF + bgt _08096600 + lsls r0, r4, 16 + asrs r0, 16 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + bge _08096608 +_08096600: + ldrb r0, [r5, 0x1] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r5, 0x1] +_08096608: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8096530 + + thumb_func_start npc_update_obj_anim_flag +@ void npc_update_obj_anim_flag(struct npc_state *fieldObject, struct obj *object) +npc_update_obj_anim_flag: @ 8096610 + push {lr} + adds r2, r1, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r3, 0x5 + negs r3, r3 + ands r3, r1 + strb r3, [r2] + ldrb r1, [r0, 0x1] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _08096632 + movs r1, 0x4 + adds r0, r3, 0 + orrs r0, r1 + strb r0, [r2] +_08096632: + pop {r0} + bx r0 + thumb_func_end npc_update_obj_anim_flag + + thumb_func_start GetAllGroundEffectFlags_OnSpawn +@ void GetAllGroundEffectFlags_OnSpawn(struct npc_state *fieldObject, u32 *flags) +GetAllGroundEffectFlags_OnSpawn: @ 8096638 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl FieldObjectUpdateMetatileBehaviors + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_Reflection + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_TallGrassOnSpawn + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_LongGrassOnSpawn + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_SandHeap + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_ShallowFlowingWater + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_ShortGrass + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_HotSprings + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end GetAllGroundEffectFlags_OnSpawn + + thumb_func_start GetAllGroundEffectFlags_OnBeginStep +@ void GetAllGroundEffectFlags_OnBeginStep(struct npc_state *fieldObject, u32 *flags) +GetAllGroundEffectFlags_OnBeginStep: @ 8096680 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl FieldObjectUpdateMetatileBehaviors + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_Reflection + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_TallGrassOnBeginStep + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_LongGrassOnBeginStep + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_Tracks + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_SandHeap + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_ShallowFlowingWater + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_Puddle + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_ShortGrass + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_HotSprings + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end GetAllGroundEffectFlags_OnBeginStep + + thumb_func_start GetAllGroundEffectFlags_OnFinishStep +@ void GetAllGroundEffectFlags_OnFinishStep(struct npc_state *fieldObject, u32 *flags) +GetAllGroundEffectFlags_OnFinishStep: @ 80966D8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl FieldObjectUpdateMetatileBehaviors + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_ShallowFlowingWater + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_SandHeap + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_Puddle + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_Ripple + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_ShortGrass + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_HotSprings + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_Seaweed + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_JumpLanding + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end GetAllGroundEffectFlags_OnFinishStep + + thumb_func_start FieldObjectUpdateMetatileBehaviors +@ void FieldObjectUpdateMetatileBehaviors(struct npc_state *fieldObject) +FieldObjectUpdateMetatileBehaviors: @ 8096728 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x14 + ldrsh r0, [r4, r1] + movs r2, 0x16 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileBehaviorAt + strb r0, [r4, 0x1F] + movs r1, 0x10 + ldrsh r0, [r4, r1] + movs r2, 0x12 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileBehaviorAt + strb r0, [r4, 0x1E] + pop {r4} + pop {r0} + bx r0 + thumb_func_end FieldObjectUpdateMetatileBehaviors + + thumb_func_start GetGroundEffectFlags_Reflection +@ void GetGroundEffectFlags_Reflection(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_Reflection: @ 8096750 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, =gUnknown_0850E5DC + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp] + str r1, [sp, 0x4] + adds r0, r4, 0 + bl FieldObjectCheckForReflectiveSurface + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _08096798 + ldrb r1, [r4, 0x2] + lsls r0, r1, 30 + cmp r0, 0 + blt _080967A2 + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4, 0x2] + subs r0, r2, 0x1 + lsls r0, 2 + add r0, sp + ldr r1, [r5] + ldr r0, [r0] + orrs r1, r0 + str r1, [r5] + b _080967A2 + .pool +_08096798: + ldrb r1, [r4, 0x2] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x2] +_080967A2: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end GetGroundEffectFlags_Reflection + + thumb_func_start GetGroundEffectFlags_TallGrassOnSpawn +@ void GetGroundEffectFlags_TallGrassOnSpawn(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_TallGrassOnSpawn: @ 80967AC + push {r4,lr} + adds r4, r1, 0 + ldrb r0, [r0, 0x1E] + bl MetatileBehavior_IsTallGrass + lsls r0, 24 + cmp r0, 0 + beq _080967C4 + ldr r0, [r4] + movs r1, 0x1 + orrs r0, r1 + str r0, [r4] +_080967C4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end GetGroundEffectFlags_TallGrassOnSpawn + + thumb_func_start GetGroundEffectFlags_TallGrassOnBeginStep +@ void GetGroundEffectFlags_TallGrassOnBeginStep(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_TallGrassOnBeginStep: @ 80967CC + push {r4,lr} + adds r4, r1, 0 + ldrb r0, [r0, 0x1E] + bl MetatileBehavior_IsTallGrass + lsls r0, 24 + cmp r0, 0 + beq _080967E4 + ldr r0, [r4] + movs r1, 0x2 + orrs r0, r1 + str r0, [r4] +_080967E4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end GetGroundEffectFlags_TallGrassOnBeginStep + + thumb_func_start GetGroundEffectFlags_LongGrassOnSpawn +@ void GetGroundEffectFlags_LongGrassOnSpawn(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_LongGrassOnSpawn: @ 80967EC + push {r4,lr} + adds r4, r1, 0 + ldrb r0, [r0, 0x1E] + bl MetatileBehavior_IsLongGrass + lsls r0, 24 + cmp r0, 0 + beq _08096804 + ldr r0, [r4] + movs r1, 0x4 + orrs r0, r1 + str r0, [r4] +_08096804: + pop {r4} + pop {r0} + bx r0 + thumb_func_end GetGroundEffectFlags_LongGrassOnSpawn + + thumb_func_start GetGroundEffectFlags_LongGrassOnBeginStep +@ void GetGroundEffectFlags_LongGrassOnBeginStep(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_LongGrassOnBeginStep: @ 809680C + push {r4,lr} + adds r4, r1, 0 + ldrb r0, [r0, 0x1E] + bl MetatileBehavior_IsLongGrass + lsls r0, 24 + cmp r0, 0 + beq _08096824 + ldr r0, [r4] + movs r1, 0x8 + orrs r0, r1 + str r0, [r4] +_08096824: + pop {r4} + pop {r0} + bx r0 + thumb_func_end GetGroundEffectFlags_LongGrassOnBeginStep + + thumb_func_start GetGroundEffectFlags_Tracks +@ void GetGroundEffectFlags_Tracks(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_Tracks: @ 809682C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x1F] + bl MetatileBehavior_IsDeepSand + lsls r0, 24 + cmp r0, 0 + beq _08096846 + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 1 + b _08096862 +_08096846: + ldrb r0, [r4, 0x1F] + bl MetatileBehavior_IsSandOrDeepSand + lsls r0, 24 + cmp r0, 0 + bne _0809685E + ldrb r0, [r4, 0x1F] + bl MetatileBehavior_IsUnusedFootprintMetatile + lsls r0, 24 + cmp r0, 0 + beq _08096866 +_0809685E: + ldr r0, [r5] + movs r1, 0x80 +_08096862: + orrs r0, r1 + str r0, [r5] +_08096866: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end GetGroundEffectFlags_Tracks + + thumb_func_start GetGroundEffectFlags_SandHeap +@ void GetGroundEffectFlags_SandHeap(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_SandHeap: @ 809686C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x1E] + bl MetatileBehavior_IsDeepSand + lsls r0, 24 + cmp r0, 0 + beq _080968AA + ldrb r0, [r4, 0x1F] + bl MetatileBehavior_IsDeepSand + lsls r0, 24 + cmp r0, 0 + beq _080968AA + ldrb r1, [r4, 0x2] + lsls r0, r1, 27 + cmp r0, 0 + blt _080968B4 + movs r0, 0x11 + negs r0, r0 + ands r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r4, 0x2] + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 4 + orrs r0, r1 + str r0, [r5] + b _080968B4 +_080968AA: + ldrb r1, [r4, 0x2] + movs r0, 0x11 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x2] +_080968B4: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end GetGroundEffectFlags_SandHeap + + thumb_func_start GetGroundEffectFlags_ShallowFlowingWater +@ void GetGroundEffectFlags_ShallowFlowingWater(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_ShallowFlowingWater: @ 80968BC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x1E] + bl MetatileBehavior_IsShallowFlowingWater + lsls r0, 24 + cmp r0, 0 + beq _080968DA + ldrb r0, [r4, 0x1F] + bl MetatileBehavior_IsShallowFlowingWater + lsls r0, 24 + cmp r0, 0 + bne _080968F2 +_080968DA: + ldrb r0, [r4, 0x1E] + bl MetatileBehavior_IsPacifidlogLog + lsls r0, 24 + cmp r0, 0 + beq _08096910 + ldrb r0, [r4, 0x1F] + bl MetatileBehavior_IsPacifidlogLog + lsls r0, 24 + cmp r0, 0 + beq _08096910 +_080968F2: + ldrb r1, [r4, 0x2] + lsls r0, r1, 28 + cmp r0, 0 + blt _0809691A + movs r0, 0x9 + negs r0, r0 + ands r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r4, 0x2] + ldr r0, [r5] + movs r1, 0x40 + orrs r0, r1 + str r0, [r5] + b _0809691A +_08096910: + ldrb r1, [r4, 0x2] + movs r0, 0x9 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x2] +_0809691A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end GetGroundEffectFlags_ShallowFlowingWater + + thumb_func_start GetGroundEffectFlags_Puddle +@ void GetGroundEffectFlags_Puddle(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_Puddle: @ 8096920 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x1E] + bl MetatileBehavior_IsPuddle + lsls r0, 24 + cmp r0, 0 + beq _08096948 + ldrb r0, [r4, 0x1F] + bl MetatileBehavior_IsPuddle + lsls r0, 24 + cmp r0, 0 + beq _08096948 + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 3 + orrs r0, r1 + str r0, [r5] +_08096948: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end GetGroundEffectFlags_Puddle + + thumb_func_start GetGroundEffectFlags_Ripple +@ void GetGroundEffectFlags_Ripple(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_Ripple: @ 8096950 + push {r4,lr} + adds r4, r1, 0 + ldrb r0, [r0, 0x1E] + bl MetatileBehavior_HasRipples + lsls r0, 24 + cmp r0, 0 + beq _0809696A + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 2 + orrs r0, r1 + str r0, [r4] +_0809696A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end GetGroundEffectFlags_Ripple + + thumb_func_start GetGroundEffectFlags_ShortGrass +@ void GetGroundEffectFlags_ShortGrass(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_ShortGrass: @ 8096970 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x1E] + bl MetatileBehavior_IsShortGrass + lsls r0, 24 + cmp r0, 0 + beq _080969AE + ldrb r0, [r4, 0x1F] + bl MetatileBehavior_IsShortGrass + lsls r0, 24 + cmp r0, 0 + beq _080969AE + ldrb r1, [r4, 0x2] + lsls r0, r1, 29 + cmp r0, 0 + blt _080969B8 + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4, 0x2] + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 10 + orrs r0, r1 + str r0, [r5] + b _080969B8 +_080969AE: + ldrb r1, [r4, 0x2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x2] +_080969B8: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end GetGroundEffectFlags_ShortGrass + + thumb_func_start GetGroundEffectFlags_HotSprings +@ void GetGroundEffectFlags_HotSprings(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_HotSprings: @ 80969C0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x1E] + bl MetatileBehavior_IsHotSprings + lsls r0, 24 + cmp r0, 0 + beq _080969FE + ldrb r0, [r4, 0x1F] + bl MetatileBehavior_IsHotSprings + lsls r0, 24 + cmp r0, 0 + beq _080969FE + ldrb r1, [r4, 0x2] + lsls r0, r1, 26 + cmp r0, 0 + blt _08096A08 + movs r0, 0x21 + negs r0, r0 + ands r0, r1 + movs r1, 0x20 + orrs r0, r1 + strb r0, [r4, 0x2] + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 11 + orrs r0, r1 + str r0, [r5] + b _08096A08 +_080969FE: + ldrb r1, [r4, 0x2] + movs r0, 0x21 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x2] +_08096A08: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end GetGroundEffectFlags_HotSprings + + thumb_func_start GetGroundEffectFlags_Seaweed +@ void GetGroundEffectFlags_Seaweed(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_Seaweed: @ 8096A10 + push {r4,lr} + adds r4, r1, 0 + ldrb r0, [r0, 0x1E] + bl MetatileBehavior_IsSeaweed + lsls r0, 24 + cmp r0, 0 + beq _08096A2A + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 12 + orrs r0, r1 + str r0, [r4] +_08096A2A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end GetGroundEffectFlags_Seaweed + + thumb_func_start GetGroundEffectFlags_JumpLanding +@ void GetGroundEffectFlags_JumpLanding(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_JumpLanding: @ 8096A30 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + adds r6, r1, 0 + ldr r0, [r7] + ldr r1, =0x02000020 + ands r0, r1 + cmp r0, 0x20 + bne _08096A82 + movs r5, 0 + ldr r0, =gUnknown_0850E5E4 + mov r8, r0 +_08096A4A: + lsls r4, r5, 2 + mov r0, r8 + adds r1, r4, r0 + ldrb r0, [r7, 0x1E] + ldr r1, [r1] + bl _call_via_r1 + lsls r0, 24 + cmp r0, 0 + beq _08096A78 + ldr r0, =gUnknown_0850E5FC + adds r0, r4, r0 + ldr r1, [r6] + ldr r0, [r0] + orrs r1, r0 + str r1, [r6] + b _08096A82 + .pool +_08096A78: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _08096A4A +_08096A82: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end GetGroundEffectFlags_JumpLanding + + thumb_func_start FieldObjectCheckForReflectiveSurface +@ u8 FieldObjectCheckForReflectiveSurface(struct npc_state *fieldObject) +FieldObjectCheckForReflectiveSurface: @ 8096A8C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r5, r0, 0 + ldrb r0, [r5, 0x5] + bl GetFieldObjectGraphicsInfo + movs r2, 0x8 + ldrsh r1, [r0, r2] + adds r1, 0x8 + lsls r1, 12 + lsrs r1, 16 + str r1, [sp] + movs r1, 0xA + ldrsh r0, [r0, r1] + adds r0, 0x8 + lsls r0, 12 + movs r4, 0 + lsrs r2, r0, 16 + str r2, [sp, 0x4] + asrs r0, 16 + cmp r4, r0 + blt _08096AC2 + b _08096BC8 +_08096AC2: + movs r0, 0x1 + mov r10, r0 +_08096AC6: + movs r1, 0x10 + ldrsh r0, [r5, r1] + movs r2, 0x12 + ldrsh r1, [r5, r2] + add r1, r10 + lsls r4, 16 + asrs r6, r4, 16 + adds r1, r6 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl GetReflectionTypeByMetatileBehavior + lsls r0, 24 + lsrs r0, 24 + mov r9, r4 + cmp r0, 0 + bne _08096BCA + movs r1, 0x14 + ldrsh r0, [r5, r1] + movs r2, 0x16 + ldrsh r1, [r5, r2] + add r1, r10 + adds r1, r6 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl GetReflectionTypeByMetatileBehavior + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08096BCA + movs r2, 0x1 + ldr r1, [sp] + lsls r0, r1, 16 + asrs r1, r0, 16 + mov r8, r0 + cmp r2, r1 + bge _08096BB6 + movs r0, 0x80 + lsls r0, 9 + asrs r7, r0, 16 +_08096B20: + movs r1, 0x10 + ldrsh r0, [r5, r1] + lsls r1, r2, 16 + asrs r4, r1, 16 + adds r0, r4 + movs r2, 0x12 + ldrsh r1, [r5, r2] + adds r1, r7 + adds r1, r6 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl GetReflectionTypeByMetatileBehavior + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08096BCA + movs r1, 0x10 + ldrsh r0, [r5, r1] + subs r0, r4 + movs r2, 0x12 + ldrsh r1, [r5, r2] + adds r1, r7 + adds r1, r6 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl GetReflectionTypeByMetatileBehavior + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08096BCA + movs r1, 0x14 + ldrsh r0, [r5, r1] + adds r0, r4 + movs r2, 0x16 + ldrsh r1, [r5, r2] + adds r1, r7 + adds r1, r6 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl GetReflectionTypeByMetatileBehavior + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08096BCA + movs r1, 0x14 + ldrsh r0, [r5, r1] + subs r0, r4 + movs r2, 0x16 + ldrsh r1, [r5, r2] + adds r1, r7 + adds r1, r6 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl GetReflectionTypeByMetatileBehavior + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08096BCA + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r0, r8 + blt _08096B20 +_08096BB6: + movs r1, 0x80 + lsls r1, 9 + add r1, r9 + lsrs r4, r1, 16 + ldr r2, [sp, 0x4] + lsls r0, r2, 16 + cmp r1, r0 + bge _08096BC8 + b _08096AC6 +_08096BC8: + movs r0, 0 +_08096BCA: + 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 FieldObjectCheckForReflectiveSurface + + thumb_func_start GetReflectionTypeByMetatileBehavior +@ u8 GetReflectionTypeByMetatileBehavior(u8 metatileBehavior) +GetReflectionTypeByMetatileBehavior: @ 8096BDC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl MetatileBehavior_IsIce + lsls r0, 24 + cmp r0, 0 + beq _08096BF2 + movs r0, 0x1 + b _08096C04 +_08096BF2: + adds r0, r4, 0 + bl MetatileBehavior_IsReflective + lsls r0, 24 + cmp r0, 0 + bne _08096C02 + movs r0, 0 + b _08096C04 +_08096C02: + movs r0, 0x2 +_08096C04: + pop {r4} + pop {r1} + bx r1 + thumb_func_end GetReflectionTypeByMetatileBehavior + + thumb_func_start GetLedgeJumpDirection +@ u8 GetLedgeJumpDirection(u16 x, u16 y, u8 direction) +GetLedgeJumpDirection: @ 8096C0C + push {r4,lr} + lsls r0, 16 + lsrs r3, r0, 16 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 24 + lsrs r4, r2, 24 + cmp r4, 0 + beq _08096C52 + cmp r4, 0x4 + bls _08096C28 + subs r0, r4, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 +_08096C28: + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r3, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gUnknown_0850E614 + lsls r1, r4, 2 + adds r1, r2 + ldr r1, [r1] + bl _call_via_r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08096C5C +_08096C52: + movs r0, 0 + b _08096C62 + .pool +_08096C5C: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r0, 24 +_08096C62: + pop {r4} + pop {r1} + bx r1 + thumb_func_end GetLedgeJumpDirection + + thumb_func_start FieldObjectSetSpriteOamTableForLongGrass +@ void FieldObjectSetSpriteOamTableForLongGrass(struct npc_state *fieldObject, struct obj *object) +FieldObjectSetSpriteOamTableForLongGrass: @ 8096C68 + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldrb r0, [r5] + lsls r0, 27 + cmp r0, 0 + blt _08096CBC + ldrb r0, [r5, 0x1E] + bl MetatileBehavior_IsLongGrass + lsls r0, 24 + cmp r0, 0 + beq _08096CBC + ldrb r0, [r5, 0x1F] + bl MetatileBehavior_IsLongGrass + lsls r0, 24 + cmp r0, 0 + beq _08096CBC + adds r4, 0x42 + ldrb r1, [r4] + movs r6, 0x40 + negs r6, r6 + adds r0, r6, 0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4] + ldrb r0, [r5, 0xB] + lsrs r0, 4 + bl ZCoordToPriority + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08096CBC + ldrb r0, [r4] + adds r1, r6, 0 + ands r1, r0 + movs r0, 0x5 + orrs r1, r0 + strb r1, [r4] +_08096CBC: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end FieldObjectSetSpriteOamTableForLongGrass + + thumb_func_start IsZCoordMismatchAt +@ bool8 IsZCoordMismatchAt(u8 z, u16 x, u16 y) +IsZCoordMismatchAt: @ 8096CC4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 16 + lsrs r0, r1, 16 + lsls r2, 16 + lsrs r1, r2, 16 + cmp r4, 0 + beq _08096CF2 + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + bl MapGridGetZCoordAt + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _08096CF2 + cmp r0, 0xF + beq _08096CF2 + cmp r0, r4 + bne _08096CF6 +_08096CF2: + movs r0, 0 + b _08096CF8 +_08096CF6: + movs r0, 0x1 +_08096CF8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end IsZCoordMismatchAt + + thumb_func_start FieldObjectUpdateZCoordAndPriority +@ void FieldObjectUpdateZCoordAndPriority(struct npc_state *fieldObject, struct obj *object) +FieldObjectUpdateZCoordAndPriority: @ 8096D00 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x3] + lsls r0, 29 + cmp r0, 0 + blt _08096D4E + adds r0, r4, 0 + bl FieldObjectUpdateZCoord + ldr r1, =gUnknown_0850E644 + ldrb r2, [r4, 0xB] + lsls r2, 24 + lsrs r0, r2, 28 + adds r0, r1 + ldrb r0, [r0] + adds r4, r5, 0 + adds r4, 0x42 + movs r1, 0x3F + ands r1, r0 + ldrb r3, [r4] + movs r0, 0x40 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r4] + ldr r0, =gUnknown_0850E634 + lsrs r2, 28 + adds r2, r0 + movs r0, 0x3 + ldrb r1, [r2] + ands r1, r0 + lsls r1, 2 + ldrb r2, [r5, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] +_08096D4E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectUpdateZCoordAndPriority + + thumb_func_start InitObjectPriorityByZCoord +@ void InitObjectPriorityByZCoord(struct obj *object, u8 z) +InitObjectPriorityByZCoord: @ 8096D5C + push {r4,lr} + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_0850E644 + adds r2, r1, r2 + ldrb r2, [r2] + movs r3, 0x42 + adds r3, r0 + mov r12, r3 + movs r3, 0x3F + ands r3, r2 + mov r2, r12 + ldrb r4, [r2] + movs r2, 0x40 + negs r2, r2 + ands r2, r4 + orrs r2, r3 + mov r3, r12 + strb r2, [r3] + ldr r2, =gUnknown_0850E634 + adds r1, r2 + movs r3, 0x3 + ldrb r2, [r1] + ands r2, r3 + lsls r2, 2 + ldrb r3, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r3 + orrs r1, r2 + strb r1, [r0, 0x5] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end InitObjectPriorityByZCoord + + thumb_func_start ZCoordToPriority +@ u8 ZCoordToPriority(u8 z) +ZCoordToPriority: @ 8096DA8 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850E634 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end ZCoordToPriority + + thumb_func_start FieldObjectUpdateZCoord +@ void FieldObjectUpdateZCoord(struct npc_state *fieldObject) +FieldObjectUpdateZCoord: @ 8096DB8 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x10 + ldrsh r0, [r4, r1] + movs r2, 0x12 + ldrsh r1, [r4, r2] + bl MapGridGetZCoordAt + lsls r0, 24 + lsrs r5, r0, 24 + movs r1, 0x14 + ldrsh r0, [r4, r1] + movs r2, 0x16 + ldrsh r1, [r4, r2] + bl MapGridGetZCoordAt + lsls r0, 24 + lsrs r0, 24 + cmp r5, 0xF + beq _08096E06 + cmp r0, 0xF + beq _08096E06 + movs r3, 0xF + adds r0, r5, 0 + ands r0, r3 + ldrb r1, [r4, 0xB] + movs r2, 0x10 + negs r2, r2 + ands r2, r1 + orrs r2, r0 + strb r2, [r4, 0xB] + cmp r5, 0 + beq _08096E06 + cmp r5, 0xF + beq _08096E06 + lsls r0, r5, 4 + ands r2, r3 + orrs r2, r0 + strb r2, [r4, 0xB] +_08096E06: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end FieldObjectUpdateZCoord + + thumb_func_start SetObjectSubpriorityByZCoord +@ void SetObjectSubpriorityByZCoord(u8 z, struct obj *object, u8 offset) +SetObjectSubpriorityByZCoord: @ 8096E0C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r2, 24 + lsrs r2, 24 + adds r3, r1, 0 + adds r3, 0x29 + movs r5, 0 + ldrsb r5, [r3, r5] + ldrh r4, [r1, 0x22] + ldr r3, =0x02021bbe + subs r4, r5 + ldrh r3, [r3] + adds r4, r3 + adds r4, 0x8 + movs r3, 0xFF + ands r4, r3 + lsrs r4, 4 + movs r3, 0x10 + subs r3, r4 + lsls r3, 17 + ldr r4, =gUnknown_0850E624 + adds r0, r4 + lsrs r3, 16 + ldrb r0, [r0] + adds r3, r0 + adds r2, r3 + adds r1, 0x43 + strb r2, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end SetObjectSubpriorityByZCoord + + thumb_func_start FieldObjectUpdateSubpriority +@ void FieldObjectUpdateSubpriority(struct npc_state *fieldObject, struct obj *object) +FieldObjectUpdateSubpriority: @ 8096E54 + push {lr} + adds r2, r0, 0 + ldrb r0, [r2, 0x3] + lsls r0, 29 + cmp r0, 0 + blt _08096E6A + ldrb r0, [r2, 0xB] + lsrs r0, 4 + movs r2, 0x1 + bl SetObjectSubpriorityByZCoord +_08096E6A: + pop {r0} + bx r0 + thumb_func_end FieldObjectUpdateSubpriority + + thumb_func_start AreZCoordsCompatible +@ bool8 AreZCoordsCompatible(u8 z1, u8 z2) +AreZCoordsCompatible: @ 8096E70 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r0, 0 + beq _08096E86 + cmp r1, 0 + beq _08096E86 + cmp r0, r1 + bne _08096E8A +_08096E86: + movs r0, 0x1 + b _08096E8C +_08096E8A: + movs r0, 0 +_08096E8C: + pop {r1} + bx r1 + thumb_func_end AreZCoordsCompatible + + thumb_func_start GroundEffect_SpawnOnTallGrass +@ void GroundEffect_SpawnOnTallGrass(struct npc_state *fieldObject, struct obj *object) +GroundEffect_SpawnOnTallGrass: @ 8096E90 + push {lr} + ldr r3, =0x02038c08 + movs r2, 0x10 + ldrsh r1, [r0, r2] + str r1, [r3] + movs r2, 0x12 + ldrsh r1, [r0, r2] + str r1, [r3, 0x4] + ldrb r1, [r0, 0xB] + lsrs r1, 4 + str r1, [r3, 0x8] + movs r1, 0x2 + str r1, [r3, 0xC] + ldrb r1, [r0, 0x8] + lsls r1, 8 + ldrb r2, [r0, 0x9] + orrs r1, r2 + str r1, [r3, 0x10] + ldrb r0, [r0, 0xA] + str r0, [r3, 0x14] + ldr r0, =0x03005d8c + ldr r1, [r0] + ldrb r0, [r1, 0x5] + lsls r0, 8 + ldrb r1, [r1, 0x4] + orrs r0, r1 + str r0, [r3, 0x18] + movs r0, 0x1 + str r0, [r3, 0x1C] + movs r0, 0x4 + bl FieldEffectStart + pop {r0} + bx r0 + .pool + thumb_func_end GroundEffect_SpawnOnTallGrass + + thumb_func_start GroundEffect_StepOnTallGrass +@ void GroundEffect_StepOnTallGrass(struct npc_state *fieldObject, struct obj *object) +GroundEffect_StepOnTallGrass: @ 8096EDC + push {lr} + ldr r3, =0x02038c08 + movs r2, 0x10 + ldrsh r1, [r0, r2] + str r1, [r3] + movs r2, 0x12 + ldrsh r1, [r0, r2] + str r1, [r3, 0x4] + ldrb r1, [r0, 0xB] + lsrs r1, 4 + str r1, [r3, 0x8] + movs r1, 0x2 + str r1, [r3, 0xC] + ldrb r1, [r0, 0x8] + lsls r1, 8 + ldrb r2, [r0, 0x9] + orrs r1, r2 + str r1, [r3, 0x10] + ldrb r0, [r0, 0xA] + str r0, [r3, 0x14] + ldr r0, =0x03005d8c + ldr r1, [r0] + ldrb r0, [r1, 0x5] + lsls r0, 8 + ldrb r1, [r1, 0x4] + orrs r0, r1 + str r0, [r3, 0x18] + movs r0, 0 + str r0, [r3, 0x1C] + movs r0, 0x4 + bl FieldEffectStart + pop {r0} + bx r0 + .pool + thumb_func_end GroundEffect_StepOnTallGrass + + thumb_func_start GroundEffect_SpawnOnLongGrass +@ void GroundEffect_SpawnOnLongGrass(struct npc_state *fieldObject, struct obj *object) +GroundEffect_SpawnOnLongGrass: @ 8096F28 + push {lr} + ldr r3, =0x02038c08 + movs r2, 0x10 + ldrsh r1, [r0, r2] + str r1, [r3] + movs r2, 0x12 + ldrsh r1, [r0, r2] + str r1, [r3, 0x4] + ldrb r1, [r0, 0xB] + lsrs r1, 4 + str r1, [r3, 0x8] + movs r1, 0x2 + str r1, [r3, 0xC] + ldrb r1, [r0, 0x8] + lsls r1, 8 + ldrb r2, [r0, 0x9] + orrs r1, r2 + str r1, [r3, 0x10] + ldrb r0, [r0, 0xA] + str r0, [r3, 0x14] + ldr r0, =0x03005d8c + ldr r1, [r0] + ldrb r0, [r1, 0x5] + lsls r0, 8 + ldrb r1, [r1, 0x4] + orrs r0, r1 + str r0, [r3, 0x18] + movs r0, 0x1 + str r0, [r3, 0x1C] + movs r0, 0x11 + bl FieldEffectStart + pop {r0} + bx r0 + .pool + thumb_func_end GroundEffect_SpawnOnLongGrass + + thumb_func_start GroundEffect_StepOnLongGrass +@ void GroundEffect_StepOnLongGrass(struct npc_state *fieldObject, struct obj *object) +GroundEffect_StepOnLongGrass: @ 8096F74 + push {lr} + ldr r3, =0x02038c08 + movs r2, 0x10 + ldrsh r1, [r0, r2] + str r1, [r3] + movs r2, 0x12 + ldrsh r1, [r0, r2] + str r1, [r3, 0x4] + ldrb r1, [r0, 0xB] + lsrs r1, 4 + str r1, [r3, 0x8] + movs r1, 0x2 + str r1, [r3, 0xC] + ldrb r1, [r0, 0x8] + lsls r1, 8 + ldrb r2, [r0, 0x9] + orrs r1, r2 + str r1, [r3, 0x10] + ldrb r0, [r0, 0xA] + str r0, [r3, 0x14] + ldr r0, =0x03005d8c + ldr r1, [r0] + ldrb r0, [r1, 0x5] + lsls r0, 8 + ldrb r1, [r1, 0x4] + orrs r0, r1 + str r0, [r3, 0x18] + movs r0, 0 + str r0, [r3, 0x1C] + movs r0, 0x11 + bl FieldEffectStart + pop {r0} + bx r0 + .pool + thumb_func_end GroundEffect_StepOnLongGrass + + thumb_func_start GroundEffect_WaterReflection +@ void GroundEffect_WaterReflection(struct npc_state *fieldObject, struct obj *object) +GroundEffect_WaterReflection: @ 8096FC0 + push {lr} + movs r2, 0 + bl SetUpReflection + pop {r0} + bx r0 + thumb_func_end GroundEffect_WaterReflection + + thumb_func_start GroundEffect_IceReflection +@ void GroundEffect_IceReflection(struct npc_state *fieldObject, struct obj *object) +GroundEffect_IceReflection: @ 8096FCC + push {lr} + movs r2, 0x1 + bl SetUpReflection + pop {r0} + bx r0 + thumb_func_end GroundEffect_IceReflection + + thumb_func_start GroundEffect_FlowingWater +@ void GroundEffect_FlowingWater(struct npc_state *fieldObject, struct obj *object) +GroundEffect_FlowingWater: @ 8096FD8 + push {lr} + adds r1, r0, 0 + movs r0, 0x22 + bl oe_exec_and_other_stuff + pop {r0} + bx r0 + thumb_func_end GroundEffect_FlowingWater + + thumb_func_start GroundEffect_SandTracks +@ void GroundEffect_SandTracks(struct npc_state *fieldObject, struct obj *object) +GroundEffect_SandTracks: @ 8096FE8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x5] + bl GetFieldObjectGraphicsInfo + ldr r1, =gUnknown_0850E654 + ldrb r0, [r0, 0xD] + lsls r0, 2 + adds r0, r1 + ldr r3, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + bl _call_via_r3 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end GroundEffect_SandTracks + + thumb_func_start GroundEffect_DeepSandTracks +@ void GroundEffect_DeepSandTracks(struct npc_state *fieldObject, struct obj *object) +GroundEffect_DeepSandTracks: @ 8097014 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x5] + bl GetFieldObjectGraphicsInfo + ldr r1, =gUnknown_0850E654 + ldrb r0, [r0, 0xD] + lsls r0, 2 + adds r0, r1 + ldr r3, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl _call_via_r3 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end GroundEffect_DeepSandTracks + + thumb_func_start DoTracksGroundEffect_None +@ void DoTracksGroundEffect_None(struct npc_state *fieldObject, struct obj *object) +DoTracksGroundEffect_None: @ 8097040 + bx lr + thumb_func_end DoTracksGroundEffect_None + + thumb_func_start DoTracksGroundEffect_Footprints +@ void DoTracksGroundEffect_Footprints(struct npc_state *fieldObject, struct obj *object) +DoTracksGroundEffect_Footprints: @ 8097044 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + lsls r4, r2, 24 + lsrs r4, 24 + ldr r1, =gUnknown_0850E660 + mov r0, sp + movs r2, 0x4 + bl memcpy + ldr r1, =0x02038c08 + movs r2, 0x14 + ldrsh r0, [r5, r2] + str r0, [r1] + movs r2, 0x16 + ldrsh r0, [r5, r2] + str r0, [r1, 0x4] + movs r0, 0x95 + str r0, [r1, 0x8] + movs r0, 0x2 + str r0, [r1, 0xC] + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + str r0, [r1, 0x10] + lsls r4, 1 + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + bl FieldEffectStart + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end DoTracksGroundEffect_Footprints + + thumb_func_start DoTracksGroundEffect_BikeTireTracks +@ void DoTracksGroundEffect_BikeTireTracks(struct npc_state *fieldObject, struct obj *object) +DoTracksGroundEffect_BikeTireTracks: @ 8097094 + push {r4,lr} + adds r4, r0, 0 + ldr r1, [r4, 0x10] + ldr r0, [r4, 0x14] + cmp r1, r0 + beq _080970D6 + ldr r2, =0x02038c08 + movs r1, 0x14 + ldrsh r0, [r4, r1] + str r0, [r2] + movs r1, 0x16 + ldrsh r0, [r4, r1] + str r0, [r2, 0x4] + movs r0, 0x95 + str r0, [r2, 0x8] + movs r0, 0x2 + str r0, [r2, 0xC] + ldr r3, =gUnknown_0850E664 + ldrb r1, [r4, 0x18] + lsls r1, 28 + lsrs r1, 28 + adds r0, r4, 0 + adds r0, 0x20 + ldrb r0, [r0] + lsls r0, 2 + subs r0, 0x5 + adds r1, r0 + adds r1, r3 + ldrb r0, [r1] + str r0, [r2, 0x10] + movs r0, 0x23 + bl FieldEffectStart +_080970D6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end DoTracksGroundEffect_BikeTireTracks + + thumb_func_start GroundEffect_Ripple +@ void GroundEffect_Ripple(struct npc_state *fieldObject, struct obj *object) +GroundEffect_Ripple: @ 80970E4 + push {lr} + bl DoRippleFieldEffect + pop {r0} + bx r0 + thumb_func_end GroundEffect_Ripple + + thumb_func_start GroundEffect_StepOnPuddle +@ void GroundEffect_StepOnPuddle(struct npc_state *fieldObject, struct obj *object) +GroundEffect_StepOnPuddle: @ 80970F0 + push {lr} + adds r1, r0, 0 + movs r0, 0xF + bl oe_exec_and_other_stuff + pop {r0} + bx r0 + thumb_func_end GroundEffect_StepOnPuddle + + thumb_func_start GroundEffect_SandHeap +@ void GroundEffect_SandHeap(struct npc_state *fieldObject, struct obj *object) +GroundEffect_SandHeap: @ 8097100 + push {lr} + adds r1, r0, 0 + movs r0, 0x27 + bl oe_exec_and_other_stuff + pop {r0} + bx r0 + thumb_func_end GroundEffect_SandHeap + + thumb_func_start GroundEffect_JumpOnTallGrass +@ void GroundEffect_JumpOnTallGrass(struct npc_state *fieldObject, struct obj *object) +GroundEffect_JumpOnTallGrass: @ 8097110 + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + ldr r1, =0x02038c08 + movs r2, 0x10 + ldrsh r0, [r5, r2] + str r0, [r1] + movs r4, 0x12 + ldrsh r0, [r5, r4] + str r0, [r1, 0x4] + ldrb r0, [r5, 0xB] + lsrs r0, 4 + str r0, [r1, 0x8] + movs r0, 0x2 + str r0, [r1, 0xC] + movs r0, 0xC + bl FieldEffectStart + ldrb r0, [r5, 0x8] + ldrb r1, [r5, 0x9] + ldrb r2, [r5, 0xA] + movs r7, 0x10 + ldrsh r3, [r5, r7] + movs r7, 0x12 + ldrsh r4, [r5, r7] + str r4, [sp] + bl sub_81546C8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + bne _0809715A + adds r0, r5, 0 + adds r1, r6, 0 + bl GroundEffect_SpawnOnTallGrass +_0809715A: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end GroundEffect_JumpOnTallGrass + + thumb_func_start GroundEffect_JumpOnLongGrass +@ void GroundEffect_JumpOnLongGrass(struct npc_state *fieldObject, struct obj *object) +GroundEffect_JumpOnLongGrass: @ 8097168 + push {lr} + ldr r2, =0x02038c08 + movs r3, 0x10 + ldrsh r1, [r0, r3] + str r1, [r2] + movs r3, 0x12 + ldrsh r1, [r0, r3] + str r1, [r2, 0x4] + ldrb r0, [r0, 0xB] + lsrs r0, 4 + str r0, [r2, 0x8] + movs r0, 0x2 + str r0, [r2, 0xC] + movs r0, 0x12 + bl FieldEffectStart + pop {r0} + bx r0 + .pool + thumb_func_end GroundEffect_JumpOnLongGrass + + thumb_func_start GroundEffect_JumpOnShallowWater +@ void GroundEffect_JumpOnShallowWater(struct npc_state *fieldObject, struct obj *object) +GroundEffect_JumpOnShallowWater: @ 8097190 + push {r4,lr} + ldr r3, =0x02038c08 + movs r4, 0x10 + ldrsh r2, [r0, r4] + str r2, [r3] + movs r4, 0x12 + ldrsh r2, [r0, r4] + str r2, [r3, 0x4] + ldrb r0, [r0, 0xB] + lsrs r0, 4 + str r0, [r3, 0x8] + ldrb r0, [r1, 0x5] + lsls r0, 28 + lsrs r0, 30 + str r0, [r3, 0xC] + movs r0, 0x10 + bl FieldEffectStart + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end GroundEffect_JumpOnShallowWater + + thumb_func_start GroundEffect_JumpOnWater +@ void GroundEffect_JumpOnWater(struct npc_state *fieldObject, struct obj *object) +GroundEffect_JumpOnWater: @ 80971C0 + push {r4,lr} + ldr r3, =0x02038c08 + movs r4, 0x10 + ldrsh r2, [r0, r4] + str r2, [r3] + movs r4, 0x12 + ldrsh r2, [r0, r4] + str r2, [r3, 0x4] + ldrb r0, [r0, 0xB] + lsrs r0, 4 + str r0, [r3, 0x8] + ldrb r0, [r1, 0x5] + lsls r0, 28 + lsrs r0, 30 + str r0, [r3, 0xC] + movs r0, 0xE + bl FieldEffectStart + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end GroundEffect_JumpOnWater + + thumb_func_start GroundEffect_JumpLandingDust +@ void GroundEffect_JumpLandingDust(struct npc_state *fieldObject, struct obj *object) +GroundEffect_JumpLandingDust: @ 80971F0 + push {r4,lr} + ldr r3, =0x02038c08 + movs r4, 0x10 + ldrsh r2, [r0, r4] + str r2, [r3] + movs r4, 0x12 + ldrsh r2, [r0, r4] + str r2, [r3, 0x4] + ldrb r0, [r0, 0xB] + lsrs r0, 4 + str r0, [r3, 0x8] + ldrb r0, [r1, 0x5] + lsls r0, 28 + lsrs r0, 30 + str r0, [r3, 0xC] + movs r0, 0xA + bl FieldEffectStart + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end GroundEffect_JumpLandingDust + + thumb_func_start GroundEffect_ShortGrass +@ void GroundEffect_ShortGrass(struct npc_state *fieldObject, struct obj *object) +GroundEffect_ShortGrass: @ 8097220 + push {lr} + adds r1, r0, 0 + movs r0, 0x29 + bl oe_exec_and_other_stuff + pop {r0} + bx r0 + thumb_func_end GroundEffect_ShortGrass + + thumb_func_start GroundEffect_HotSprings +@ void GroundEffect_HotSprings(struct npc_state *fieldObject, struct obj *object) +GroundEffect_HotSprings: @ 8097230 + push {lr} + adds r1, r0, 0 + movs r0, 0x2A + bl oe_exec_and_other_stuff + pop {r0} + bx r0 + thumb_func_end GroundEffect_HotSprings + + thumb_func_start GroundEffect_Seaweed +@ void GroundEffect_Seaweed(struct npc_state *fieldObject, struct obj *object) +GroundEffect_Seaweed: @ 8097240 + push {lr} + ldr r2, =0x02038c08 + movs r3, 0x10 + ldrsh r1, [r0, r3] + str r1, [r2] + movs r1, 0x12 + ldrsh r0, [r0, r1] + str r0, [r2, 0x4] + movs r0, 0x35 + bl FieldEffectStart + pop {r0} + bx r0 + .pool + thumb_func_end GroundEffect_Seaweed + + thumb_func_start DoFlaggedGroundEffects +@ void DoFlaggedGroundEffects(struct npc_state *fieldObject, struct obj *object, u32 flags) +DoFlaggedGroundEffects: @ 8097260 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + adds r7, r1, 0 + adds r5, r2, 0 + bl FieldObjectIsFarawayIslandMew + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08097284 + adds r0, r6, 0 + bl sub_81D4A58 + lsls r0, 24 + cmp r0, 0 + beq _080972AC +_08097284: + movs r4, 0 + ldr r0, =gUnknown_0850E674 + mov r8, r0 +_0809728A: + movs r0, 0x1 + ands r0, r5 + cmp r0, 0 + beq _080972A0 + lsls r0, r4, 2 + add r0, r8 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r7, 0 + bl _call_via_r2 +_080972A0: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + lsrs r5, 1 + cmp r4, 0x13 + bls _0809728A +_080972AC: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end DoFlaggedGroundEffects + + thumb_func_start filters_out_some_ground_effects +@ void filters_out_some_ground_effects(struct npc_state *fieldObject, u32 *flags) +filters_out_some_ground_effects: @ 80972BC + push {lr} + adds r2, r0, 0 + adds r3, r1, 0 + ldrb r0, [r2] + lsls r0, 27 + cmp r0, 0 + bge _080972EA + ldrb r1, [r2, 0x2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + movs r1, 0x11 + negs r1, r1 + ands r0, r1 + adds r1, 0x8 + ands r0, r1 + subs r1, 0x18 + ands r0, r1 + strb r0, [r2, 0x2] + ldr r0, [r3] + ldr r1, =0xfff9f7bd + ands r0, r1 + str r0, [r3] +_080972EA: + pop {r0} + bx r0 + .pool + thumb_func_end filters_out_some_ground_effects + + thumb_func_start FilterOutStepOnPuddleGroundEffectIfJumping +@ void FilterOutStepOnPuddleGroundEffectIfJumping(struct npc_state *fieldObject, u32 *flags) +FilterOutStepOnPuddleGroundEffectIfJumping: @ 80972F4 + push {lr} + adds r2, r1, 0 + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _08097308 + ldr r0, [r2] + ldr r1, =0xfffffbff + ands r0, r1 + str r0, [r2] +_08097308: + pop {r0} + bx r0 + .pool + thumb_func_end FilterOutStepOnPuddleGroundEffectIfJumping + + thumb_func_start DoGroundEffects_OnSpawn +@ void DoGroundEffects_OnSpawn(struct npc_state *fieldObject, struct obj *object) +DoGroundEffects_OnSpawn: @ 8097310 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4] + lsls r0, 29 + cmp r0, 0 + bge _08097354 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + bl FieldObjectUpdateZCoordAndPriority + adds r0, r4, 0 + mov r1, sp + bl GetAllGroundEffectFlags_OnSpawn + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetSpriteOamTableForLongGrass + ldr r2, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + bl DoFlaggedGroundEffects + ldrb r1, [r4] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + movs r1, 0x11 + negs r1, r1 + ands r0, r1 + strb r0, [r4] +_08097354: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end DoGroundEffects_OnSpawn + + thumb_func_start DoGroundEffects_OnBeginStep +@ void DoGroundEffects_OnBeginStep(struct npc_state *fieldObject, struct obj *object) +DoGroundEffects_OnBeginStep: @ 809735C + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4] + lsls r0, 29 + cmp r0, 0 + bge _080973A8 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + bl FieldObjectUpdateZCoordAndPriority + adds r0, r4, 0 + mov r1, sp + bl GetAllGroundEffectFlags_OnBeginStep + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetSpriteOamTableForLongGrass + adds r0, r4, 0 + mov r1, sp + bl filters_out_some_ground_effects + ldr r2, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + bl DoFlaggedGroundEffects + ldrb r1, [r4] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + movs r1, 0x11 + negs r1, r1 + ands r0, r1 + strb r0, [r4] +_080973A8: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end DoGroundEffects_OnBeginStep + + thumb_func_start DoGroundEffects_OnFinishStep +@ void DoGroundEffects_OnFinishStep(struct npc_state *fieldObject, struct obj *object) +DoGroundEffects_OnFinishStep: @ 80973B0 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4] + lsls r0, 28 + cmp r0, 0 + bge _080973FC + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + bl FieldObjectUpdateZCoordAndPriority + adds r0, r4, 0 + mov r1, sp + bl GetAllGroundEffectFlags_OnFinishStep + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetSpriteOamTableForLongGrass + adds r0, r4, 0 + mov r1, sp + bl FilterOutStepOnPuddleGroundEffectIfJumping + ldr r2, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + bl DoFlaggedGroundEffects + ldrb r1, [r4] + movs r0, 0x9 + negs r0, r0 + ands r0, r1 + movs r1, 0x21 + negs r1, r1 + ands r0, r1 + strb r0, [r4] +_080973FC: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end DoGroundEffects_OnFinishStep + + thumb_func_start sub_8097404 +@ bool8 sub_8097404(struct npc_state *fieldObject) +sub_8097404: @ 8097404 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r1, [r5] + movs r0, 0xA0 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + bne _0809748C + ldrb r0, [r5, 0x1] + movs r4, 0x1 + orrs r0, r4 + strb r0, [r5, 0x1] + ldr r3, =0x02020630 + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x2C + ldrb r1, [r0] + lsls r1, 25 + lsrs r1, 31 + lsls r1, 7 + ldrb r2, [r5, 0x2] + movs r0, 0x7F + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x2] + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x2C + ldrb r1, [r0] + lsrs r1, 7 + ands r1, r4 + ldrb r2, [r5, 0x3] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x3] + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x2C + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x2C + ldrb r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0] + movs r0, 0 + b _0809748E + .pool +_0809748C: + movs r0, 0x1 +_0809748E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8097404 + + thumb_func_start player_bitmagic +@ void player_bitmagic() +player_bitmagic: @ 8097494 + push {r4,r5,lr} + movs r4, 0 + ldr r5, =0x02037350 +_0809749A: + lsls r0, r4, 3 + adds r0, r4 + lsls r0, 2 + adds r1, r0, r5 + ldrb r0, [r1] + lsls r0, 31 + cmp r0, 0 + beq _080974B8 + ldr r0, =0x02037590 + ldrb r0, [r0, 0x5] + cmp r4, r0 + beq _080974B8 + adds r0, r1, 0 + bl sub_8097404 +_080974B8: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _0809749A + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end player_bitmagic + + thumb_func_start sub_80974D0 +sub_80974D0: @ 80974D0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r6, =0x02037350 +_080974DA: + cmp r4, r5 + beq _080974FC + lsls r0, r4, 3 + adds r0, r4 + lsls r0, 2 + adds r1, r0, r6 + ldrb r0, [r1] + lsls r0, 31 + cmp r0, 0 + beq _080974FC + ldr r0, =0x02037590 + ldrb r0, [r0, 0x5] + cmp r4, r0 + beq _080974FC + adds r0, r1, 0 + bl sub_8097404 +_080974FC: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _080974DA + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80974D0 + + thumb_func_start npc_sync_anim_pause_bits +@ void npc_sync_anim_pause_bits(struct npc_state *fieldObject) +npc_sync_anim_pause_bits: @ 8097514 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r2, [r5] + ldr r1, =0x00000101 + adds r0, r1, 0 + ands r0, r2 + cmp r0, r1 + bne _0809756C + ldrb r1, [r5, 0x1] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strb r0, [r5, 0x1] + ldr r4, =0x02020630 + ldrb r0, [r5, 0x4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r2, [r5, 0x2] + adds r1, 0x2C + lsrs r2, 7 + lsls r2, 6 + ldrb r3, [r1] + movs r0, 0x41 + negs r0, r0 + ands r0, r3 + orrs r0, r2 + strb r0, [r1] + ldrb r0, [r5, 0x4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r4 + ldrb r1, [r5, 0x3] + lsls r1, 31 + lsrs r1, 31 + adds r2, 0x2C + lsls r1, 7 + ldrb r3, [r2] + movs r0, 0x7F + ands r0, r3 + orrs r0, r1 + strb r0, [r2] +_0809756C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end npc_sync_anim_pause_bits + + thumb_func_start sub_809757C +sub_809757C: @ 809757C + push {r4,r5,lr} + movs r4, 0 + ldr r5, =0x02037350 +_08097582: + lsls r0, r4, 3 + adds r0, r4 + lsls r0, 2 + adds r1, r0, r5 + ldrb r0, [r1] + lsls r0, 31 + cmp r0, 0 + beq _08097598 + adds r0, r1, 0 + bl npc_sync_anim_pause_bits +_08097598: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _08097582 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809757C + + thumb_func_start little_step +@ void little_step(struct obj *object, u8 direction) +little_step: @ 80975AC + lsls r1, 24 + ldr r2, =gUnknown_0850DB7C + lsrs r1, 22 + adds r1, r2 + ldrh r2, [r1] + ldrh r3, [r0, 0x20] + adds r2, r3 + strh r2, [r0, 0x20] + ldrh r1, [r1, 0x2] + ldrh r2, [r0, 0x22] + adds r1, r2 + strh r1, [r0, 0x22] + bx lr + .pool + thumb_func_end little_step + + thumb_func_start double_little_steps +double_little_steps: @ 80975CC + lsls r1, 24 + ldr r2, =gUnknown_0850DB7C + lsrs r1, 22 + adds r1, r2 + ldrh r2, [r1] + lsls r2, 1 + ldrh r3, [r0, 0x20] + adds r2, r3 + strh r2, [r0, 0x20] + ldrh r1, [r1, 0x2] + lsls r1, 1 + ldrh r2, [r0, 0x22] + adds r1, r2 + strh r1, [r0, 0x22] + bx lr + .pool + thumb_func_end double_little_steps + + thumb_func_start triple_little_steps +triple_little_steps: @ 80975F0 + lsls r1, 24 + ldr r2, =gUnknown_0850DB7C + lsrs r1, 22 + adds r1, r2 + ldrh r2, [r1] + lsls r3, r2, 1 + adds r2, r3 + ldrh r3, [r0, 0x20] + adds r2, r3 + strh r2, [r0, 0x20] + ldrh r1, [r1, 0x2] + lsls r2, r1, 1 + adds r1, r2 + ldrh r2, [r0, 0x22] + adds r1, r2 + strh r1, [r0, 0x22] + bx lr + .pool + thumb_func_end triple_little_steps + + thumb_func_start quad_little_steps +quad_little_steps: @ 8097618 + lsls r1, 24 + ldr r2, =gUnknown_0850DB7C + lsrs r1, 22 + adds r1, r2 + ldrh r2, [r1] + lsls r2, 2 + ldrh r3, [r0, 0x20] + adds r2, r3 + strh r2, [r0, 0x20] + ldrh r1, [r1, 0x2] + lsls r1, 2 + ldrh r2, [r0, 0x22] + adds r1, r2 + strh r1, [r0, 0x22] + bx lr + .pool + thumb_func_end quad_little_steps + + thumb_func_start oct_little_steps +@ void oct_little_steps(struct obj *object, u8 direction) +oct_little_steps: @ 809763C + lsls r1, 24 + ldr r2, =gUnknown_0850DB7C + lsrs r1, 22 + adds r1, r2 + ldrh r2, [r1] + lsls r2, 3 + ldrh r3, [r0, 0x20] + adds r2, r3 + strh r2, [r0, 0x20] + ldrh r1, [r1, 0x2] + lsls r1, 3 + ldrh r2, [r0, 0x22] + adds r1, r2 + strh r1, [r0, 0x22] + bx lr + .pool + thumb_func_end oct_little_steps + + thumb_func_start oamt_npc_ministep_reset +@ void oamt_npc_ministep_reset(struct obj *object, u8 direction, u8 speed) +oamt_npc_ministep_reset: @ 8097660 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + movs r3, 0 + strh r1, [r0, 0x34] + strh r2, [r0, 0x36] + strh r3, [r0, 0x38] + bx lr + thumb_func_end oamt_npc_ministep_reset + + thumb_func_start obj_npc_ministep +@ bool8 obj_npc_ministep(struct obj *object) +obj_npc_ministep: @ 8097674 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =gUnknown_0850E768 + movs r0, 0x36 + ldrsh r2, [r4, r0] + lsls r0, r2, 1 + adds r0, r5 + movs r3, 0x38 + ldrsh r1, [r4, r3] + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r1, r0 + bge _080976D4 + ldr r1, =gUnknown_0850E754 + lsls r0, r2, 2 + adds r0, r1 + movs r1, 0x38 + ldrsh r2, [r4, r1] + ldr r0, [r0] + lsls r2, 2 + adds r2, r0 + ldrh r1, [r4, 0x34] + lsls r1, 24 + lsrs r1, 24 + ldr r2, [r2] + adds r0, r4, 0 + bl _call_via_r2 + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + movs r2, 0x36 + ldrsh r1, [r4, r2] + lsls r1, 1 + adds r1, r5 + lsls r0, 16 + asrs r0, 16 + movs r3, 0 + ldrsh r1, [r1, r3] + cmp r0, r1 + blt _080976D4 + movs r0, 0x1 + b _080976D6 + .pool +_080976D4: + movs r0, 0 +_080976D6: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end obj_npc_ministep + + thumb_func_start sub_80976DC +@ void sub_80976DC(struct obj *object, u8 direction) +sub_80976DC: @ 80976DC + lsls r1, 24 + lsrs r1, 24 + movs r2, 0 + strh r1, [r0, 0x34] + strh r2, [r0, 0x36] + strh r2, [r0, 0x38] + bx lr + thumb_func_end sub_80976DC + + thumb_func_start sub_80976EC +@ bool8 sub_80976EC(struct obj *object) +sub_80976EC: @ 80976EC + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x36] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0809770C + ldrh r1, [r4, 0x34] + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl little_step + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] +_0809770C: + ldrh r0, [r4, 0x36] + adds r0, 0x1 + strh r0, [r4, 0x36] + movs r1, 0x38 + ldrsh r0, [r4, r1] + cmp r0, 0xF + bgt _0809771E + movs r0, 0 + b _08097720 +_0809771E: + movs r0, 0x1 +_08097720: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80976EC + + thumb_func_start sub_8097728 +sub_8097728: @ 8097728 + ldr r1, =gUnknown_0850E7BA + lsls r0, 16 + asrs r0, 16 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + bx lr + .pool + thumb_func_end sub_8097728 + + thumb_func_start sub_809773C +sub_809773C: @ 809773C + ldr r1, =gUnknown_0850E772 + lsls r0, 16 + asrs r0, 16 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + bx lr + .pool + thumb_func_end sub_809773C + + thumb_func_start sub_8097750 +sub_8097750: @ 8097750 + movs r1, 0 + strh r1, [r0, 0x3A] + strh r1, [r0, 0x3C] + bx lr + thumb_func_end sub_8097750 + + thumb_func_start sub_8097758 +sub_8097758: @ 8097758 + push {r4-r6,lr} + adds r5, r0, 0 + movs r6, 0 + movs r1, 0x3C + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _0809778E + cmp r0, 0x1 + bgt _08097770 + cmp r0, 0 + beq _0809777A + b _080977F2 +_08097770: + cmp r0, 0x2 + beq _080977B6 + cmp r0, 0x3 + beq _080977CA + b _080977F2 +_0809777A: + movs r2, 0x3A + ldrsh r0, [r5, r2] + bl sub_809773C + ldrh r1, [r5, 0x24] + adds r0, r1 + strh r0, [r5, 0x24] + movs r2, 0x3A + ldrsh r0, [r5, r2] + b _080977E8 +_0809778E: + ldrh r0, [r5, 0x3A] + movs r4, 0x47 + subs r0, r4, r0 + lsls r0, 16 + asrs r0, 16 + bl sub_809773C + ldrh r1, [r5, 0x24] + subs r1, r0 + strh r1, [r5, 0x24] + ldrh r0, [r5, 0x3A] + subs r4, r0 + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + bl sub_8097728 + ldrh r2, [r5, 0x26] + adds r0, r2 + b _080977F0 +_080977B6: + movs r1, 0x3A + ldrsh r0, [r5, r1] + bl sub_809773C + ldrh r1, [r5, 0x24] + subs r1, r0 + strh r1, [r5, 0x24] + movs r2, 0x3A + ldrsh r0, [r5, r2] + b _080977E8 +_080977CA: + ldrh r0, [r5, 0x3A] + movs r4, 0x47 + subs r0, r4, r0 + lsls r0, 16 + asrs r0, 16 + bl sub_809773C + ldrh r2, [r5, 0x24] + adds r0, r2 + strh r0, [r5, 0x24] + ldrh r0, [r5, 0x3A] + subs r4, r0 + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 +_080977E8: + bl sub_8097728 + ldrh r1, [r5, 0x26] + adds r0, r1 +_080977F0: + strh r0, [r5, 0x26] +_080977F2: + ldrh r0, [r5, 0x3A] + adds r0, 0x1 + movs r1, 0 + strh r0, [r5, 0x3A] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x48 + bne _0809780A + strh r1, [r5, 0x3A] + ldrh r0, [r5, 0x3C] + adds r0, 0x1 + strh r0, [r5, 0x3C] +_0809780A: + movs r2, 0x3C + ldrsh r0, [r5, r2] + cmp r0, 0x4 + bne _08097818 + strh r1, [r5, 0x26] + strh r1, [r5, 0x24] + movs r6, 0x1 +_08097818: + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8097758 + + thumb_func_start sub_8097820 +sub_8097820: @ 8097820 + lsls r1, 24 + ldr r2, =gUnknown_0850E834 + lsrs r1, 22 + adds r1, r2 + lsls r0, 16 + asrs r0, 16 + ldr r1, [r1] + adds r1, r0 + movs r0, 0 + ldrsb r0, [r1, r0] + bx lr + .pool + thumb_func_end sub_8097820 + + thumb_func_start sub_809783C +sub_809783C: @ 809783C + push {r4,lr} + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + movs r4, 0 + strh r1, [r0, 0x34] + strh r2, [r0, 0x36] + strh r3, [r0, 0x38] + strh r4, [r0, 0x3A] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_809783C + + thumb_func_start sub_809785C +sub_809785C: @ 809785C + push {r4-r6,lr} + sub sp, 0xC + adds r4, r0, 0 + ldr r1, =gUnknown_0850E840 + mov r0, sp + movs r2, 0x6 + bl memcpy + add r5, sp, 0x8 + ldr r1, =gUnknown_0850E846 + adds r0, r5, 0 + movs r2, 0x3 + bl memcpy + movs r6, 0 + movs r1, 0x36 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0809788E + ldrh r1, [r4, 0x34] + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl little_step +_0809788E: + movs r2, 0x3A + ldrsh r0, [r4, r2] + movs r2, 0x36 + ldrsh r1, [r4, r2] + adds r1, r5, r1 + ldrb r1, [r1] + asrs r0, r1 + ldrh r1, [r4, 0x38] + lsls r1, 24 + lsrs r1, 24 + bl sub_8097820 + strh r0, [r4, 0x26] + ldrh r1, [r4, 0x3A] + adds r1, 0x1 + strh r1, [r4, 0x3A] + movs r2, 0x36 + ldrsh r0, [r4, r2] + lsls r0, 1 + add r0, sp + ldrh r0, [r0] + lsls r0, 16 + asrs r2, r0, 16 + lsls r1, 16 + asrs r1, 16 + asrs r0, 17 + cmp r1, r0 + bne _080978C8 + movs r6, 0x1 +_080978C8: + cmp r1, r2 + blt _080978D2 + movs r0, 0 + strh r0, [r4, 0x26] + movs r6, 0xFF +_080978D2: + adds r0, r6, 0 + add sp, 0xC + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809785C + + thumb_func_start sub_80978E4 +sub_80978E4: @ 80978E4 + push {r4-r6,lr} + sub sp, 0xC + adds r5, r0, 0 + ldr r1, =gUnknown_0850E84A + mov r0, sp + movs r2, 0x6 + bl memcpy + add r4, sp, 0x8 + ldr r1, =gUnknown_0850E850 + adds r0, r4, 0 + movs r2, 0x3 + bl memcpy + movs r6, 0 + movs r1, 0x36 + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _08097920 + ldrh r1, [r5, 0x3A] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08097920 + ldrh r1, [r5, 0x34] + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl little_step +_08097920: + movs r2, 0x3A + ldrsh r0, [r5, r2] + movs r2, 0x36 + ldrsh r1, [r5, r2] + adds r1, r4, r1 + ldrb r1, [r1] + asrs r0, r1 + ldrh r1, [r5, 0x38] + lsls r1, 24 + lsrs r1, 24 + bl sub_8097820 + strh r0, [r5, 0x26] + ldrh r1, [r5, 0x3A] + adds r1, 0x1 + strh r1, [r5, 0x3A] + movs r2, 0x36 + ldrsh r0, [r5, r2] + lsls r0, 1 + add r0, sp + ldrh r0, [r0] + lsls r0, 16 + asrs r2, r0, 16 + lsls r1, 16 + asrs r1, 16 + asrs r0, 17 + cmp r1, r0 + bne _0809795A + movs r6, 0x1 +_0809795A: + cmp r1, r2 + blt _08097964 + movs r0, 0 + strh r0, [r5, 0x26] + movs r6, 0xFF +_08097964: + adds r0, r6, 0 + add sp, 0xC + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80978E4 + + thumb_func_start sub_8097978 +@ void sub_8097978(struct obj *object, u16 a2) +sub_8097978: @ 8097978 + strh r1, [r0, 0x34] + bx lr + thumb_func_end sub_8097978 + + thumb_func_start sub_809797C +@ bool8 sub_809797C(struct obj *object) +sub_809797C: @ 809797C + push {lr} + ldrh r1, [r0, 0x34] + subs r1, 0x1 + strh r1, [r0, 0x34] + lsls r1, 16 + cmp r1, 0 + beq _0809798E + movs r0, 0 + b _08097990 +_0809798E: + movs r0, 0x1 +_08097990: + pop {r1} + bx r1 + thumb_func_end sub_809797C + + thumb_func_start obj_anim_image_set_and_seek +obj_anim_image_set_and_seek: @ 8097994 + push {r4,lr} + lsls r2, 24 + lsrs r2, 24 + adds r3, r0, 0 + adds r3, 0x2A + strb r1, [r3] + adds r4, r0, 0 + adds r4, 0x2C + ldrb r3, [r4] + movs r1, 0x41 + negs r1, r1 + ands r1, r3 + strb r1, [r4] + adds r1, r2, 0 + bl SeekObjectImageAnim + pop {r4} + pop {r0} + bx r0 + thumb_func_end obj_anim_image_set_and_seek + + thumb_func_start sub_80979BC +sub_80979BC: @ 80979BC + push {lr} + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _080979CE + movs r0, 0 + b _080979D0 +_080979CE: + movs r0, 0x1 +_080979D0: + pop {r1} + bx r1 + thumb_func_end sub_80979BC + + thumb_func_start sub_80979D4 +sub_80979D4: @ 80979D4 + push {r4-r6,lr} + mov r12, r0 + lsls r1, 24 + lsrs r1, 24 + mov r3, r12 + adds r3, 0x3E + movs r0, 0x1 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08097A3C + mov r0, r12 + ldrh r1, [r0, 0x24] + ldrh r2, [r0, 0x20] + adds r1, r2 + mov r4, r12 + adds r4, 0x28 + movs r0, 0 + ldrsb r0, [r4, r0] + ldr r2, =0x02021bbc + adds r0, r1 + ldrh r2, [r2] + adds r0, r2 + lsls r0, 16 + lsrs r6, r0, 16 + mov r0, r12 + ldrh r1, [r0, 0x26] + ldrh r2, [r0, 0x22] + adds r1, r2 + subs r3, 0x15 + movs r0, 0 + ldrsb r0, [r3, r0] + ldr r2, =0x02021bbe + adds r0, r1 + ldrh r2, [r2] + adds r0, r2 + lsls r0, 16 + lsrs r5, r0, 16 + adds r2, r3, 0 + b _08097A6A + .pool +_08097A3C: + mov r0, r12 + ldrh r1, [r0, 0x24] + ldrh r2, [r0, 0x20] + adds r1, r2 + mov r3, r12 + adds r3, 0x28 + movs r0, 0 + ldrsb r0, [r3, r0] + adds r0, r1 + lsls r0, 16 + lsrs r6, r0, 16 + mov r0, r12 + ldrh r1, [r0, 0x26] + ldrh r2, [r0, 0x22] + adds r1, r2 + mov r2, r12 + adds r2, 0x29 + movs r0, 0 + ldrsb r0, [r2, r0] + adds r0, r1 + lsls r0, 16 + lsrs r5, r0, 16 + adds r4, r3, 0 +_08097A6A: + ldrb r0, [r4] + lsls r0, 24 + asrs r0, 25 + subs r0, r6, r0 + lsls r0, 16 + lsrs r3, r0, 16 + ldrb r0, [r2] + lsls r0, 24 + asrs r0, 25 + subs r0, r5, r0 + lsls r0, 16 + lsrs r2, r0, 16 + lsls r0, r6, 16 + asrs r0, 16 + cmp r0, 0xFF + bgt _08097A96 + lsls r0, r3, 16 + asrs r0, 16 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + bge _08097AA2 +_08097A96: + mov r4, r12 + adds r4, 0x3E + ldrb r0, [r4] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4] +_08097AA2: + lsls r0, r5, 16 + asrs r0, 16 + cmp r0, 0xAF + bgt _08097AB6 + lsls r0, r2, 16 + asrs r0, 16 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + bge _08097AC2 +_08097AB6: + mov r0, r12 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_08097AC2: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80979D4 + + thumb_func_start sub_8097AC8 +sub_8097AC8: @ 8097AC8 + push {r4,lr} + adds r4, r0, 0 + bl sub_8097D68 + ldrh r0, [r4, 0x30] + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + movs r2, 0x1 + bl SetObjectSubpriorityByZCoord + ldrh r1, [r4, 0x32] + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_80979D4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8097AC8 + + thumb_func_start sub_8097AF0 +sub_8097AF0: @ 8097AF0 + push {r4,r5,lr} + movs r5, 0 + movs r4, 0x3F +_08097AF6: + ldr r0, =0x02020630 + adds r2, r5, r0 + adds r0, r2, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08097B16 + ldr r1, [r2, 0x1C] + ldr r0, =sub_8097AC8 + cmp r1, r0 + bne _08097B16 + adds r0, r2, 0 + bl RemoveObjectAndFreeTiles +_08097B16: + adds r5, 0x44 + subs r4, 0x1 + cmp r4, 0 + bge _08097AF6 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8097AF0 + + thumb_func_start sub_8097B2C +sub_8097B2C: @ 8097B2C + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r3, 0 + ldr r6, =0x02020630 + movs r4, 0 +_08097B38: + adds r2, r4, r6 + adds r0, r2, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08097B68 + ldr r1, [r2, 0x1C] + ldr r0, =sub_8097AC8 + cmp r1, r0 + bne _08097B68 + ldrh r0, [r2, 0x2E] + lsls r0, 24 + lsrs r0, 24 + cmp r0, r5 + bne _08097B68 + adds r0, r3, 0 + b _08097B72 + .pool +_08097B68: + adds r4, 0x44 + adds r3, 0x1 + cmp r3, 0x3F + ble _08097B38 + movs r0, 0x40 +_08097B72: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8097B2C + + thumb_func_start sub_8097B78 +sub_8097B78: @ 8097B78 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + bl sub_8097B2C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _08097BAA + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + adds r0, r5, 0 + bl FieldObjectDirectionToImageAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim +_08097BAA: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8097B78 + + thumb_func_start sub_8097BB4 +sub_8097BB4: @ 8097BB4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + bl sub_8097B2C + adds r1, r0, 0 + cmp r1, 0x40 + beq _08097C3E + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r4, r0, r1 + adds r0, r5, 0 + bl GetFieldObjectGraphicsInfo + ldrh r3, [r4, 0x4] + lsls r3, 22 + ldr r1, [r0, 0x10] + ldr r2, [r1, 0x4] + ldr r1, [r1] + str r1, [r4] + str r2, [r4, 0x4] + lsrs r3, 22 + ldrh r2, [r4, 0x4] + ldr r1, =0xfffffc00 + ands r1, r2 + orrs r1, r3 + strh r1, [r4, 0x4] + ldrb r2, [r0, 0xC] + lsls r2, 28 + lsrs r2, 24 + ldrb r3, [r4, 0x5] + movs r1, 0xF + ands r1, r3 + orrs r1, r2 + strb r1, [r4, 0x5] + ldr r1, [r0, 0x1C] + str r1, [r4, 0xC] + ldr r1, [r0, 0x14] + cmp r1, 0 + bne _08097C20 + str r1, [r4, 0x18] + adds r0, r4, 0 + adds r0, 0x42 + strb r1, [r0] + b _08097C36 + .pool +_08097C20: + adds r0, r4, 0 + bl SetSpriteOamTables_NoPriorityFromTable + adds r2, r4, 0 + adds r2, 0x42 + ldrb r0, [r2] + movs r1, 0x3F + ands r1, r0 + movs r0, 0x80 + orrs r1, r0 + strb r1, [r2] +_08097C36: + adds r0, r4, 0 + movs r1, 0 + bl StartObjectImageAnim +_08097C3E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8097BB4 + + thumb_func_start sub_8097C44 +sub_8097C44: @ 8097C44 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + bl sub_8097B2C + lsls r0, 24 + lsrs r2, r0, 24 + adds r3, r2, 0 + cmp r2, 0x40 + beq _08097C80 + cmp r4, 0 + beq _08097C74 + ldr r0, =0x02020630 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x32] + b _08097C80 + .pool +_08097C74: + ldr r1, =0x02020630 + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + adds r0, r1 + strh r4, [r0, 0x32] +_08097C80: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8097C44 + + thumb_func_start sub_8097C8C +sub_8097C8C: @ 8097C8C + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_8097B2C + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + bne _08097CA2 + movs r0, 0 + b _08097CBA +_08097CA2: + movs r3, 0 + ldr r0, =0x02020630 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + movs r2, 0x32 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + bne _08097CB8 + movs r3, 0x1 +_08097CB8: + adds r0, r3, 0 +_08097CBA: + pop {r1} + bx r1 + .pool + thumb_func_end sub_8097C8C + + thumb_func_start sub_8097CC4 +sub_8097CC4: @ 8097CC4 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + bl sub_8097B2C + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _08097CEA + ldr r0, =0x02020630 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + movs r0, 0 + strh r4, [r1, 0x34] + strh r0, [r1, 0x36] +_08097CEA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8097CC4 + + thumb_func_start sub_8097CF4 +sub_8097CF4: @ 8097CF4 + push {lr} + adds r2, r0, 0 + movs r1, 0x36 + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _08097D06 + cmp r0, 0x1 + beq _08097D0E + b _08097D2C +_08097D06: + strh r0, [r2, 0x26] + ldrh r0, [r2, 0x36] + adds r0, 0x1 + strh r0, [r2, 0x36] +_08097D0E: + ldrh r0, [r2, 0x26] + subs r0, 0x8 + movs r3, 0 + strh r0, [r2, 0x26] + lsls r0, 16 + asrs r0, 16 + movs r1, 0xA0 + negs r1, r1 + cmp r0, r1 + bne _08097D2C + strh r3, [r2, 0x26] + movs r0, 0x1 + strh r0, [r2, 0x32] + strh r3, [r2, 0x34] + strh r3, [r2, 0x36] +_08097D2C: + pop {r0} + bx r0 + thumb_func_end sub_8097CF4 + + thumb_func_start sub_8097D30 +sub_8097D30: @ 8097D30 + push {lr} + adds r1, r0, 0 + movs r2, 0x36 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _08097D42 + cmp r0, 0x1 + beq _08097D4C + b _08097D5E +_08097D42: + ldr r0, =0x0000ff60 + strh r0, [r1, 0x26] + ldrh r0, [r1, 0x36] + adds r0, 0x1 + strh r0, [r1, 0x36] +_08097D4C: + ldrh r0, [r1, 0x26] + adds r0, 0x8 + strh r0, [r1, 0x26] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bne _08097D5E + strh r0, [r1, 0x34] + strh r0, [r1, 0x36] +_08097D5E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8097D30 + + thumb_func_start sub_8097D68 +sub_8097D68: @ 8097D68 + push {lr} + adds r1, r0, 0 + movs r2, 0x34 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + beq _08097D84 + cmp r0, 0x1 + bgt _08097D7E + cmp r0, 0 + beq _08097D98 + b _08097D94 +_08097D7E: + cmp r0, 0x2 + beq _08097D8C + b _08097D94 +_08097D84: + adds r0, r1, 0 + bl sub_8097D30 + b _08097D98 +_08097D8C: + adds r0, r1, 0 + bl sub_8097CF4 + b _08097D98 +_08097D94: + movs r0, 0 + strh r0, [r1, 0x34] +_08097D98: + pop {r0} + bx r0 + thumb_func_end sub_8097D68 + + thumb_func_start sub_8097D9C +sub_8097D9C: @ 8097D9C + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_8097B2C + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _08097DC0 + ldr r0, =0x02020630 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + movs r2, 0x34 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08097DC8 +_08097DC0: + movs r0, 0 + b _08097DCA + .pool +_08097DC8: + movs r0, 0x1 +_08097DCA: + pop {r1} + bx r1 + thumb_func_end sub_8097D9C + + thumb_func_start oe_exec_and_other_stuff +oe_exec_and_other_stuff: @ 8097DD0 + push {r4,lr} + adds r4, r0, 0 + adds r0, r1, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =0x02038c08 + adds r2, r1, 0x4 + adds r3, r1, 0 + adds r3, 0x8 + bl FieldObjectGetLocalIdAndMap + adds r0, r4, 0 + bl FieldEffectStart + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end oe_exec_and_other_stuff + + thumb_func_start DoShadowFieldEffect +DoShadowFieldEffect: @ 8097DF8 + push {lr} + adds r1, r0, 0 + ldrb r2, [r1, 0x2] + lsls r0, r2, 25 + cmp r0, 0 + blt _08097E10 + movs r0, 0x40 + orrs r0, r2 + strb r0, [r1, 0x2] + movs r0, 0x3 + bl oe_exec_and_other_stuff +_08097E10: + pop {r0} + bx r0 + thumb_func_end DoShadowFieldEffect + + thumb_func_start DoRippleFieldEffect +@ void DoRippleFieldEffect(struct npc_state *fieldObject, struct obj *object) +DoRippleFieldEffect: @ 8097E14 + push {r4,lr} + adds r4, r1, 0 + ldrb r0, [r0, 0x5] + bl GetFieldObjectGraphicsInfo + ldr r2, =0x02038c08 + movs r3, 0x20 + ldrsh r1, [r4, r3] + str r1, [r2] + movs r3, 0x22 + ldrsh r1, [r4, r3] + ldrh r0, [r0, 0xA] + lsls r0, 16 + asrs r0, 17 + adds r1, r0 + subs r1, 0x2 + str r1, [r2, 0x4] + movs r0, 0x97 + str r0, [r2, 0x8] + movs r0, 0x3 + str r0, [r2, 0xC] + movs r0, 0x5 + bl FieldEffectStart + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end DoRippleFieldEffect + + thumb_func_start sub_8097E50 +sub_8097E50: @ 8097E50 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + mov r8, r1 + movs r0, 0 + mov r12, r0 + ldr r0, =0x020375b8 + ldr r1, [r0] + adds r6, r0, 0 + cmp r1, 0 + bne _08097E80 + movs r0, 0x14 + bl AllocZeroed + str r0, [r6] + ldrb r1, [r4, 0x8] + strb r1, [r0] + ldr r1, [r6] + movs r0, 0x1 + strb r0, [r1, 0x10] + b _08097ECC + .pool +_08097E80: + movs r2, 0x10 + movs r5, 0 + movs r1, 0 + adds r3, r6, 0 + b _08097E90 +_08097E8A: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 +_08097E90: + cmp r1, 0xF + bhi _08097EB2 + cmp r2, 0x10 + bne _08097EA4 + ldr r0, [r3] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08097EA4 + adds r2, r1, 0 +_08097EA4: + ldr r0, [r3] + adds r0, r1 + ldrb r0, [r0] + ldrb r7, [r4, 0x8] + cmp r0, r7 + bne _08097E8A + movs r5, 0x1 +_08097EB2: + cmp r5, 0 + bne _08097ECE + cmp r2, 0x10 + beq _08097ECE + ldr r0, [r6] + adds r0, r2 + ldrb r1, [r4, 0x8] + strb r1, [r0] + ldr r1, [r6] + ldrb r0, [r1, 0x10] + adds r0, 0x1 + strb r0, [r1, 0x10] + movs r0, 0x1 +_08097ECC: + mov r12, r0 +_08097ECE: + mov r1, r12 + cmp r1, 0x1 + bne _08097EE0 + ldrb r0, [r4, 0x1] + movs r1, 0x10 + orrs r0, r1 + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4, 0x1] +_08097EE0: + movs r0, 0x1 + mov r7, r8 + strh r0, [r7, 0x32] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8097E50 + + thumb_func_start sub_8097EF0 +sub_8097EF0: @ 8097EF0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + mov r8, r1 + movs r0, 0x1 + strh r0, [r1, 0x32] + ldr r5, =0x020375b8 + ldr r0, [r5] + cmp r0, 0 + beq _08097F68 + movs r7, 0 + adds r0, r6, 0 + bl sub_8097F78 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x10 + beq _08097F28 + ldr r0, [r5] + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r1, [r5] + ldrb r0, [r1, 0x10] + subs r0, 0x1 + strb r0, [r1, 0x10] + movs r7, 0x1 +_08097F28: + ldr r0, [r5] + ldrb r4, [r0, 0x10] + cmp r4, 0 + bne _08097F36 + bl Free + str r4, [r5] +_08097F36: + cmp r7, 0x1 + bne _08097F68 + ldrb r0, [r6, 0x5] + bl GetFieldObjectGraphicsInfo + ldrb r1, [r0, 0xC] + lsls r1, 25 + lsrs r1, 31 + lsls r1, 4 + ldrb r2, [r6, 0x1] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + movs r1, 0x3 + negs r1, r1 + ands r0, r1 + strb r0, [r6, 0x1] + mov r2, r8 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_08097F68: + movs r0, 0x1 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8097EF0 + + thumb_func_start sub_8097F78 +@ signed int sub_8097F78(npc_state *a1) +sub_8097F78: @ 8097F78 + push {lr} + movs r2, 0 + ldr r1, =0x020375b8 + ldr r1, [r1] + ldrb r3, [r0, 0x8] +_08097F82: + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, r3 + bne _08097F94 + adds r0, r2, 0 + b _08097FA0 + .pool +_08097F94: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xF + bls _08097F82 + movs r0, 0x10 +_08097FA0: + pop {r1} + bx r1 + thumb_func_end sub_8097F78 + + thumb_func_start sub_8097FA4 +sub_8097FA4: @ 8097FA4 + push {r4-r6,lr} + adds r6, r0, 0 + ldr r0, =sub_8097FE4 + movs r1, 0xFF + bl AddTask + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =0x03005e00 + adds r4, r0 + adds r0, r4, 0 + adds r0, 0x8 + adds r1, r6, 0 + bl sub_806F67C + strb r5, [r6, 0x1B] + ldr r0, =0x0000ffff + strh r0, [r4, 0xE] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8097FA4 + + thumb_func_start sub_8097FE4 +sub_8097FE4: @ 8097FE4 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r4, r1, r0 + adds r0, r4, 0 + adds r0, 0x8 + mov r1, sp + bl sub_806F684 + ldr r0, [sp] + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r2, r0, r1 + ldrh r1, [r4, 0xC] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _08098020 + ldrh r0, [r4, 0xE] + ldrh r1, [r2, 0x26] + adds r0, r1 + strh r0, [r2, 0x26] +_08098020: + ldrh r1, [r4, 0xC] + movs r0, 0xF + ands r0, r1 + cmp r0, 0 + bne _08098030 + ldrh r0, [r4, 0xE] + negs r0, r0 + strh r0, [r4, 0xE] +_08098030: + adds r0, r1, 0x1 + strh r0, [r4, 0xC] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8097FE4 + + thumb_func_start sub_8098044 +sub_8098044: @ 8098044 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r0, r1 + adds r0, 0x8 + mov r1, sp + bl sub_806F684 + adds r0, r4, 0 + bl remove_task + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8098044 + + thumb_func_start sub_8098074 +sub_8098074: @ 8098074 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + movs r4, 0 + ldr r7, =0x02037350 +_08098082: + cmp r4, r6 + beq _080980A8 + cmp r4, r5 + beq _080980A8 + lsls r0, r4, 3 + adds r0, r4 + lsls r0, 2 + adds r1, r0, r7 + ldrb r0, [r1] + lsls r0, 31 + cmp r0, 0 + beq _080980A8 + ldr r0, =0x02037590 + ldrb r0, [r0, 0x5] + cmp r4, r0 + beq _080980A8 + adds r0, r1, 0 + bl sub_8097404 +_080980A8: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _08098082 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8098074 + + thumb_func_start sub_80980C0 +sub_80980C0: @ 80980C0 + movs r0, 0 + strh r0, [r1, 0x26] + ldrh r0, [r1, 0x32] + adds r0, 0x1 + strh r0, [r1, 0x32] + movs r0, 0 + bx lr + thumb_func_end sub_80980C0 + + thumb_func_start sub_80980D0 +sub_80980D0: @ 80980D0 + push {lr} + adds r2, r1, 0 + ldrh r0, [r2, 0x26] + subs r0, 0x8 + strh r0, [r2, 0x26] + lsls r0, 16 + asrs r0, 16 + movs r1, 0xA0 + negs r1, r1 + cmp r0, r1 + bne _080980EC + ldrh r0, [r2, 0x32] + adds r0, 0x1 + strh r0, [r2, 0x32] +_080980EC: + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_80980D0 + + thumb_func_start sub_80980F4 +sub_80980F4: @ 80980F4 + ldr r0, =0x0000ff60 + strh r0, [r1, 0x26] + ldrh r0, [r1, 0x32] + adds r0, 0x1 + strh r0, [r1, 0x32] + movs r0, 0 + bx lr + .pool + thumb_func_end sub_80980F4 + + thumb_func_start sub_8098108 +sub_8098108: @ 8098108 + push {lr} + ldrh r0, [r1, 0x26] + adds r0, 0x8 + strh r0, [r1, 0x26] + lsls r0, 16 + cmp r0, 0 + bne _0809811C + ldrh r0, [r1, 0x32] + adds r0, 0x1 + strh r0, [r1, 0x32] +_0809811C: + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_8098108 + + thumb_func_start sub_8098124 +sub_8098124: @ 8098124 + movs r0, 0x1 + bx lr + thumb_func_end sub_8098124 + + thumb_func_start sub_8098128 +sub_8098128: @ 8098128 + ldr r1, =0x020375bc + movs r0, 0 + strb r0, [r1] + ldr r2, =0x03003014 + ldrb r1, [r2] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + movs r1, 0x3 + negs r1, r1 + ands r0, r1 + subs r1, 0x2 + ands r0, r1 + subs r1, 0x4 + ands r0, r1 + strb r0, [r2] + bx lr + .pool + thumb_func_end sub_8098128 + + thumb_func_start sub_8098154 +sub_8098154: @ 8098154 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _08098188 + cmp r0, 0x1 + bgt _0809817C + cmp r0, 0 + beq _08098182 + b _080981B0 + .pool +_0809817C: + cmp r0, 0x2 + beq _08098198 + b _080981B0 +_08098182: + bl sub_81973A4 + b _08098190 +_08098188: + movs r0, 0 + movs r1, 0x1 + bl sub_81973C4 +_08098190: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080981B0 +_08098198: + bl sub_8197224 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + beq _080981B0 + ldr r1, =0x020375bc + movs r0, 0 + strb r0, [r1] + adds r0, r5, 0 + bl remove_task +_080981B0: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8098154 + + thumb_func_start task_add_textbox +task_add_textbox: @ 80981BC + push {lr} + ldr r0, =sub_8098154 + movs r1, 0x50 + bl AddTask + pop {r0} + bx r0 + .pool + thumb_func_end task_add_textbox + + thumb_func_start task_del_textbox +task_del_textbox: @ 80981D0 + push {lr} + ldr r0, =sub_8098154 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _080981E4 + bl remove_task +_080981E4: + pop {r0} + bx r0 + .pool + thumb_func_end task_del_textbox + + thumb_func_start box_related_two__2 +box_related_two__2: @ 80981EC + push {r4,lr} + adds r1, r0, 0 + ldr r4, =0x020375bc + ldrb r0, [r4] + cmp r0, 0 + bne _0809820C + adds r0, r1, 0 + movs r1, 0x1 + bl textbox_fdecode_auto_and_task_add + movs r0, 0x2 + strb r0, [r4] + movs r0, 0x1 + b _0809820E + .pool +_0809820C: + movs r0, 0 +_0809820E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end box_related_two__2 + + thumb_func_start sub_8098214 +sub_8098214: @ 8098214 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8196094 + adds r1, r0, 0 + cmp r1, 0 + bne _0809822E + ldr r0, =0x020375bc + strb r1, [r0] + adds r0, r4, 0 + bl remove_task +_0809822E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8098214 + + thumb_func_start sub_8098238 +sub_8098238: @ 8098238 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =0x020375bc + ldrb r0, [r5] + cmp r0, 0 + bne _08098270 + ldr r0, =0x02021fc4 + adds r1, r4, 0 + bl ExpandStringRefs + ldr r0, =sub_8098214 + movs r1, 0 + bl AddTask + adds r0, r4, 0 + bl sub_8196080 + movs r0, 0x2 + strb r0, [r5] + movs r0, 0x1 + b _08098272 + .pool +_08098270: + movs r0, 0 +_08098272: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8098238 + + thumb_func_start box_related_two__3 +box_related_two__3: @ 8098278 + push {lr} + adds r1, r0, 0 + ldr r2, =0x020375bc + ldrb r0, [r2] + cmp r0, 0 + bne _08098298 + movs r0, 0x3 + strb r0, [r2] + adds r0, r1, 0 + movs r1, 0 + bl textbox_fdecode_auto_and_task_add + movs r0, 0x1 + b _0809829A + .pool +_08098298: + movs r0, 0 +_0809829A: + pop {r1} + bx r1 + thumb_func_end box_related_two__3 + + thumb_func_start sub_80982A0 +sub_80982A0: @ 80982A0 + push {lr} + ldr r2, =0x020375bc + movs r1, 0x3 + strb r1, [r2] + movs r1, 0x1 + bl textbox_fdecode_auto_and_task_add + movs r0, 0x1 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80982A0 + + thumb_func_start sub_80982B8 +sub_80982B8: @ 80982B8 + push {lr} + ldr r1, =0x020375bc + ldrb r0, [r1] + cmp r0, 0 + bne _080982D4 + movs r0, 0x2 + strb r0, [r1] + bl textbox_auto_and_task_add + movs r0, 0x1 + b _080982D6 + .pool +_080982D4: + movs r0, 0 +_080982D6: + pop {r1} + bx r1 + thumb_func_end sub_80982B8 + + thumb_func_start textbox_fdecode_auto_and_task_add +textbox_fdecode_auto_and_task_add: @ 80982DC + push {r4,lr} + adds r2, r0, 0 + adds r4, r1, 0 + ldr r0, =0x02021fc4 + adds r1, r2, 0 + bl ExpandStringRefs + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl AddTextPrinterForMessage + bl task_add_textbox + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end textbox_fdecode_auto_and_task_add + + thumb_func_start textbox_auto_and_task_add +textbox_auto_and_task_add: @ 8098304 + push {lr} + movs r0, 0x1 + bl AddTextPrinterForMessage + bl task_add_textbox + pop {r0} + bx r0 + thumb_func_end textbox_auto_and_task_add + + thumb_func_start textbox_close +textbox_close: @ 8098314 + push {lr} + bl task_del_textbox + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + ldr r1, =0x020375bc + movs r0, 0 + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end textbox_close + + thumb_func_start textbox_any_visible +textbox_any_visible: @ 8098330 + ldr r0, =0x020375bc + ldrb r0, [r0] + bx lr + .pool + thumb_func_end textbox_any_visible + + thumb_func_start sub_809833C +sub_809833C: @ 809833C + push {lr} + ldr r0, =0x020375bc + ldrb r0, [r0] + cmp r0, 0 + beq _08098350 + movs r0, 0 + b _08098352 + .pool +_08098350: + movs r0, 0x1 +_08098352: + pop {r1} + bx r1 + thumb_func_end sub_809833C + + thumb_func_start sub_8098358 +sub_8098358: @ 8098358 + push {lr} + bl task_del_textbox + movs r0, 0 + movs r1, 0x1 + bl sub_81973FC + ldr r1, =0x020375bc + movs r0, 0 + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8098358 + + thumb_func_start sub_8098374 +sub_8098374: @ 8098374 + push {lr} + bl task_del_textbox + ldr r1, =0x020375bc + movs r0, 0 + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8098374 + + thumb_func_start walkrun_is_standing_still +walkrun_is_standing_still: @ 8098388 + push {lr} + ldr r0, =0x02037590 + ldrb r0, [r0, 0x3] + cmp r0, 0x1 + beq _0809839C + movs r0, 0x1 + b _0809839E + .pool +_0809839C: + movs r0, 0 +_0809839E: + pop {r1} + bx r1 + thumb_func_end walkrun_is_standing_still + + thumb_func_start sub_80983A4 +sub_80983A4: @ 80983A4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl walkrun_is_standing_still + lsls r0, 24 + cmp r0, 0 + beq _080983BE + bl sub_808B864 + adds r0, r4, 0 + bl remove_task +_080983BE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80983A4 + + thumb_func_start sub_80983C4 +sub_80983C4: @ 80983C4 + push {lr} + ldr r0, =sub_80983A4 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _080983E0 + bl sub_808BCF4 + movs r0, 0x1 + b _080983E2 + .pool +_080983E0: + movs r0, 0 +_080983E2: + pop {r1} + bx r1 + thumb_func_end sub_80983C4 + + thumb_func_start sub_80983E8 +sub_80983E8: @ 80983E8 + push {lr} + bl player_bitmagic + ldr r0, =sub_80983A4 + movs r1, 0x50 + bl AddTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80983E8 + + thumb_func_start sub_8098400 +sub_8098400: @ 8098400 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0809842A + bl walkrun_is_standing_still + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bne _0809842A + bl sub_808B864 + strh r4, [r5, 0x8] +_0809842A: + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _08098452 + ldr r2, =0x02037350 + ldr r0, =0x03005df0 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + ldrb r0, [r1] + lsls r0, 30 + cmp r0, 0 + blt _08098452 + adds r0, r1, 0 + bl sub_8097404 + movs r0, 0x1 + strh r0, [r5, 0xA] +_08098452: + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _08098468 + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _08098468 + adds r0, r6, 0 + bl remove_task +_08098468: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8098400 + + thumb_func_start sub_809847C +sub_809847C: @ 809847C + push {lr} + ldr r0, =sub_8098400 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _08098498 + bl sub_808BCF4 + movs r0, 0x1 + b _0809849A + .pool +_08098498: + movs r0, 0 +_0809849A: + pop {r1} + bx r1 + thumb_func_end sub_809847C + + thumb_func_start sub_80984A0 +sub_80984A0: @ 80984A0 + push {r4,r5,lr} + ldr r4, =0x03005df0 + ldrb r0, [r4] + bl sub_80974D0 + ldr r0, =sub_8098400 + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, =0x02037350 + ldrb r1, [r4] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + ldrb r0, [r1] + lsls r0, 30 + cmp r0, 0 + blt _080984DE + adds r0, r1, 0 + bl sub_8097404 + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0xA] +_080984DE: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80984A0 + + thumb_func_start sub_80984F4 +sub_80984F4: @ 80984F4 + push {lr} + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + bl GetFieldObjectIdByLocalIdAndMap + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + bl FieldObjectClearAnimIfSpecialAnimFinished + bl sub_80D338C + bl sub_809757C + pop {r0} + bx r0 + .pool + thumb_func_end sub_80984F4 + + thumb_func_start sub_8098524 +sub_8098524: @ 8098524 + push {r4,lr} + ldr r4, =0x02037350 + ldr r0, =0x03005df0 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r4 + ldrb r0, [r1] + lsls r0, 31 + cmp r0, 0 + beq _08098542 + adds r0, r1, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished +_08098542: + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + bl GetFieldObjectIdByLocalIdAndMap + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl FieldObjectClearAnimIfSpecialAnimFinished + bl sub_80D338C + bl sub_809757C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8098524 + + thumb_func_start sub_8098574 +sub_8098574: @ 8098574 + push {lr} + ldr r0, =0x03005df0 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + ldr r1, =0x020375f4 + ldrb r1, [r1] + bl FieldObjectFaceOppositeDirection + pop {r0} + bx r0 + .pool + thumb_func_end sub_8098574 + + thumb_func_start sub_809859C +sub_809859C: @ 809859C + push {lr} + ldr r0, =0x03005df0 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + bl FieldObjectClearAnimIfSpecialAnimActive + pop {r0} + bx r0 + .pool + thumb_func_end sub_809859C + + thumb_func_start sub_80985BC +sub_80985BC: @ 80985BC + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r5, r0, r1 + ldrb r7, [r5, 0xC] + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _080985E8 + bl walkrun_is_standing_still + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bne _080985E8 + bl sub_808B864 + strh r4, [r5, 0x8] +_080985E8: + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0809860C + ldr r0, =0x02037350 + lsls r1, r7, 3 + adds r1, r7 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 30 + cmp r0, 0 + blt _0809860C + adds r0, r1, 0 + bl sub_8097404 + movs r0, 0x1 + strh r0, [r5, 0xA] +_0809860C: + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _08098622 + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _08098622 + adds r0, r6, 0 + bl remove_task +_08098622: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80985BC + + thumb_func_start sub_8098630 +sub_8098630: @ 8098630 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r0, 0 + bl sub_80B47E0 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x030060a8 + ldrb r0, [r0] + cmp r0, 0x2 + bne _080986E0 + movs r0, 0x1 + bl sub_80B47E0 + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8098074 + ldr r7, =sub_80985BC + adds r0, r7, 0 + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x03005e00 + mov r9, r0 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + mov r1, r9 + adds r6, r0, r1 + strh r4, [r6, 0xC] + ldr r2, =0x02037350 + mov r8, r2 + lsls r0, r4, 3 + adds r0, r4 + lsls r0, 2 + adds r1, r0, r2 + ldrb r0, [r1] + lsls r0, 30 + cmp r0, 0 + blt _0809869A + adds r0, r1, 0 + bl sub_8097404 + movs r0, 0x1 + strh r0, [r6, 0xA] +_0809869A: + adds r0, r7, 0 + movs r1, 0x51 + bl AddTask + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + mov r1, r9 + adds r4, r0, r1 + strh r5, [r4, 0xC] + lsls r0, r5, 3 + adds r0, r5 + lsls r0, 2 + mov r2, r8 + adds r1, r0, r2 + ldrb r0, [r1] + lsls r0, 30 + cmp r0, 0 + blt _0809871A + adds r0, r1, 0 + bl sub_8097404 + movs r0, 0x1 + strh r0, [r4, 0xA] + b _0809871A + .pool +_080986E0: + adds r0, r4, 0 + bl sub_80974D0 + ldr r0, =sub_80985BC + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r5, r0, r1 + strh r4, [r5, 0xC] + ldr r1, =0x02037350 + lsls r0, r4, 3 + adds r0, r4 + lsls r0, 2 + adds r1, r0, r1 + ldrb r0, [r1] + lsls r0, 30 + cmp r0, 0 + blt _0809871A + adds r0, r1, 0 + bl sub_8097404 + movs r0, 0x1 + strh r0, [r5, 0xA] +_0809871A: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8098630 + + thumb_func_start sub_8098734 +sub_8098734: @ 8098734 + push {lr} + ldr r0, =sub_80985BC + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _08098750 + bl sub_808BCF4 + movs r0, 0x1 + b _08098752 + .pool +_08098750: + movs r0, 0 +_08098752: + pop {r1} + bx r1 + thumb_func_end sub_8098734 + + thumb_func_start sub_8098758 +sub_8098758: @ 8098758 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x13 + bhi _08098770 + lsls r0, 3 + ldr r1, =gUnknown_0851021C + adds r0, r1 + b _08098772 + .pool +_08098770: + ldr r0, =gUnknown_0851021C +_08098772: + pop {r1} + bx r1 + .pool + thumb_func_end sub_8098758 + + thumb_func_start copy_textbox_border_tile_patterns_to_vram +@ void copy_textbox_border_tile_patterns_to_vram(u8 rbox_id, u16 tile_pattern_dest_offset, u8 pal_dest_offset) +copy_textbox_border_tile_patterns_to_vram: @ 809877C + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + movs r1, 0 + bl GetWindowAttribute + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_08DDD748 + movs r2, 0xE0 + lsls r2, 1 + adds r3, r4, 0 + bl LoadBgTiles + bl sub_8098C64 + adds r1, r5, 0 + movs r2, 0x20 + bl gpu_pal_apply + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end copy_textbox_border_tile_patterns_to_vram + + thumb_func_start box_border_load_tiles_and_pal +box_border_load_tiles_and_pal: @ 80987BC + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 24 + lsrs r2, 24 + bl sub_809882C + pop {r0} + bx r0 + thumb_func_end box_border_load_tiles_and_pal + + thumb_func_start sub_80987D4 +sub_80987D4: @ 80987D4 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r4, r1, 0 + adds r6, r2, 0 + mov r8, r3 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r6, 16 + lsrs r6, 16 + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + movs r1, 0 + bl GetWindowAttribute + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_0851021C + lsls r4, 3 + adds r1, r4, r5 + ldr r1, [r1] + movs r2, 0x90 + lsls r2, 1 + adds r3, r6, 0 + bl LoadBgTiles + adds r5, 0x4 + adds r4, r5 + ldr r0, [r4] + mov r1, r8 + movs r2, 0x20 + bl gpu_pal_apply + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80987D4 + + thumb_func_start sub_809882C +sub_809882C: @ 809882C + push {r4,lr} + adds r4, r1, 0 + adds r3, r2, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 16 + lsrs r4, 16 + lsls r3, 24 + lsrs r3, 24 + ldr r1, =0x03005d90 + ldr r1, [r1] + ldrb r1, [r1, 0x14] + lsrs r1, 3 + adds r2, r4, 0 + bl sub_80987D4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809882C + + thumb_func_start sub_8098858 +sub_8098858: @ 8098858 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 16 + lsrs r5, 16 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0xC] + adds r0, r4, 0 + movs r1, 0 + bl GetWindowAttribute + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r4, 0 + movs r1, 0x1 + bl GetWindowAttribute + mov r8, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + adds r0, r4, 0 + movs r1, 0x2 + bl GetWindowAttribute + adds r6, r0, 0 + lsls r6, 16 + lsrs r6, 16 + adds r0, r4, 0 + movs r1, 0x3 + bl GetWindowAttribute + mov r9, r0 + mov r2, r9 + lsls r2, 16 + lsrs r2, 16 + mov r9, r2 + adds r0, r4, 0 + movs r1, 0x4 + bl GetWindowAttribute + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x10] + mov r0, r8 + subs r0, 0x1 + lsls r2, r0, 24 + lsrs r2, 24 + str r2, [sp, 0x14] + subs r4, r6, 0x1 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + mov r10, r0 + str r0, [sp] + str r0, [sp, 0x4] + ldr r2, [sp, 0xC] + str r2, [sp, 0x8] + adds r0, r7, 0 + adds r1, r5, 0 + ldr r2, [sp, 0x14] + adds r3, r4, 0 + bl FillBgTilemapBufferRect + adds r1, r5, 0x1 + lsls r1, 16 + lsrs r1, 16 + mov r0, r8 + lsls r2, r0, 24 + lsrs r2, 24 + str r2, [sp, 0x18] + mov r2, r9 + lsls r0, r2, 24 + lsrs r0, 24 + str r0, [sp, 0x1C] + str r0, [sp] + mov r0, r10 + str r0, [sp, 0x4] + ldr r2, [sp, 0xC] + str r2, [sp, 0x8] + adds r0, r7, 0 + ldr r2, [sp, 0x18] + adds r3, r4, 0 + bl FillBgTilemapBufferRect + adds r1, r5, 0x2 + lsls r1, 16 + lsrs r1, 16 + add r8, r9 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + mov r2, r10 + str r2, [sp] + str r2, [sp, 0x4] + ldr r0, [sp, 0xC] + str r0, [sp, 0x8] + adds r0, r7, 0 + mov r2, r8 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + adds r1, r5, 0x3 + lsls r1, 16 + lsrs r1, 16 + lsls r2, r6, 24 + lsrs r2, 24 + mov r9, r2 + mov r0, r10 + str r0, [sp] + ldr r2, [sp, 0x10] + lsls r4, r2, 24 + lsrs r4, 24 + str r4, [sp, 0x4] + ldr r0, [sp, 0xC] + str r0, [sp, 0x8] + adds r0, r7, 0 + ldr r2, [sp, 0x14] + mov r3, r9 + bl FillBgTilemapBufferRect + adds r1, r5, 0x5 + lsls r1, 16 + lsrs r1, 16 + mov r2, r10 + str r2, [sp] + str r4, [sp, 0x4] + ldr r0, [sp, 0xC] + str r0, [sp, 0x8] + adds r0, r7, 0 + mov r2, r8 + mov r3, r9 + bl FillBgTilemapBufferRect + adds r1, r5, 0x6 + lsls r1, 16 + lsrs r1, 16 + ldr r2, [sp, 0x10] + adds r6, r2 + lsls r6, 24 + lsrs r6, 24 + mov r0, r10 + str r0, [sp] + str r0, [sp, 0x4] + ldr r2, [sp, 0xC] + str r2, [sp, 0x8] + adds r0, r7, 0 + ldr r2, [sp, 0x14] + adds r3, r6, 0 + bl FillBgTilemapBufferRect + adds r1, r5, 0x7 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x1C] + str r0, [sp] + mov r2, r10 + str r2, [sp, 0x4] + ldr r0, [sp, 0xC] + str r0, [sp, 0x8] + adds r0, r7, 0 + ldr r2, [sp, 0x18] + adds r3, r6, 0 + bl FillBgTilemapBufferRect + adds r5, 0x8 + lsls r5, 16 + lsrs r5, 16 + mov r2, r10 + str r2, [sp] + str r2, [sp, 0x4] + ldr r0, [sp, 0xC] + str r0, [sp, 0x8] + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + adds r3, r6, 0 + bl FillBgTilemapBufferRect + 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_8098858 + + thumb_func_start sub_80989E0 +sub_80989E0: @ 80989E0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + adds r4, r0, 0 + mov r9, r1 + lsls r4, 24 + lsrs r4, 24 + mov r0, r9 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + adds r0, r4, 0 + movs r1, 0 + bl GetWindowAttribute + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r4, 0 + movs r1, 0x1 + bl GetWindowAttribute + mov r8, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + adds r0, r4, 0 + movs r1, 0x2 + bl GetWindowAttribute + adds r6, r0, 0 + lsls r6, 16 + lsrs r6, 16 + adds r0, r4, 0 + movs r1, 0x3 + bl GetWindowAttribute + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + movs r1, 0x4 + bl GetWindowAttribute + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0xC] + mov r0, r8 + lsls r2, r0, 24 + lsrs r2, 24 + str r2, [sp, 0x10] + lsls r4, r6, 24 + lsrs r4, 24 + movs r0, 0x1 + str r0, [sp] + str r0, [sp, 0x4] + mov r0, r10 + str r0, [sp, 0x8] + adds r0, r7, 0 + mov r1, r9 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + mov r1, r9 + adds r1, 0x1 + lsls r1, 16 + lsrs r1, 16 + mov r0, r8 + adds r0, 0x1 + lsls r2, r0, 24 + lsrs r2, 24 + str r2, [sp, 0x14] + subs r0, r5, 0x2 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x18] + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + mov r0, r10 + str r0, [sp, 0x8] + adds r0, r7, 0 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + mov r1, r9 + adds r1, 0x2 + lsls r1, 16 + lsrs r1, 16 + add r8, r5 + movs r0, 0x1 + negs r0, r0 + add r8, r0 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r0, 0x1 + str r0, [sp] + str r0, [sp, 0x4] + mov r0, r10 + str r0, [sp, 0x8] + adds r0, r7, 0 + mov r2, r8 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + mov r1, r9 + adds r1, 0x3 + lsls r1, 16 + lsrs r1, 16 + adds r5, r6, 0x1 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0x1 + str r0, [sp] + ldr r4, [sp, 0xC] + subs r4, 0x2 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x4] + mov r0, r10 + str r0, [sp, 0x8] + adds r0, r7, 0 + ldr r2, [sp, 0x10] + adds r3, r5, 0 + bl FillBgTilemapBufferRect + mov r1, r9 + adds r1, 0x5 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x1 + str r0, [sp] + str r4, [sp, 0x4] + mov r0, r10 + str r0, [sp, 0x8] + adds r0, r7, 0 + mov r2, r8 + adds r3, r5, 0 + bl FillBgTilemapBufferRect + mov r1, r9 + adds r1, 0x6 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0xC] + adds r6, r0 + subs r6, 0x1 + lsls r6, 24 + lsrs r6, 24 + movs r0, 0x1 + str r0, [sp] + str r0, [sp, 0x4] + mov r0, r10 + str r0, [sp, 0x8] + adds r0, r7, 0 + ldr r2, [sp, 0x10] + adds r3, r6, 0 + bl FillBgTilemapBufferRect + mov r1, r9 + adds r1, 0x7 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x18] + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + mov r0, r10 + str r0, [sp, 0x8] + adds r0, r7, 0 + ldr r2, [sp, 0x14] + adds r3, r6, 0 + bl FillBgTilemapBufferRect + movs r0, 0x8 + add r9, r0 + mov r0, r9 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + movs r0, 0x1 + str r0, [sp] + str r0, [sp, 0x4] + mov r0, r10 + str r0, [sp, 0x8] + adds r0, r7, 0 + mov r1, r9 + mov r2, r8 + adds r3, r6, 0 + bl FillBgTilemapBufferRect + 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_80989E0 + + thumb_func_start rbox_fill_rectangle +rbox_fill_rectangle: @ 8098B7C + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0xC + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + adds r0, r6, 0 + movs r1, 0 + bl GetWindowAttribute + mov r9, r0 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + adds r0, r6, 0 + movs r1, 0x1 + bl GetWindowAttribute + mov r8, r0 + mov r1, r8 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + adds r0, r6, 0 + movs r1, 0x2 + bl GetWindowAttribute + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r6, 0 + movs r1, 0x3 + bl GetWindowAttribute + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r6, 0 + movs r1, 0x4 + bl GetWindowAttribute + movs r1, 0x1 + negs r1, r1 + add r8, r1 + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + subs r5, 0x1 + lsls r5, 24 + lsrs r5, 24 + adds r4, 0x2 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp] + lsls r0, 24 + movs r1, 0x80 + lsls r1, 18 + adds r0, r1 + lsrs r0, 24 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + mov r0, r9 + movs r1, 0 + mov r2, r8 + adds r3, r5, 0 + bl FillBgTilemapBufferRect + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end rbox_fill_rectangle + + thumb_func_start stdpal_get +stdpal_get: @ 8098C18 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bhi _08098C54 + lsls r0, 2 + ldr r1, =_08098C30 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08098C30: + .4byte _08098C44 + .4byte _08098C48 + .4byte _08098C4C + .4byte _08098C50 + .4byte _08098C54 +_08098C44: + movs r0, 0 + b _08098C56 +_08098C48: + movs r0, 0x10 + b _08098C56 +_08098C4C: + movs r0, 0x20 + b _08098C56 +_08098C50: + movs r0, 0x30 + b _08098C56 +_08098C54: + movs r0, 0x40 +_08098C56: + lsls r0, 1 + ldr r1, =gUnknown_0851017C + adds r0, r1 + pop {r1} + bx r1 + .pool + thumb_func_end stdpal_get + + thumb_func_start sub_8098C64 +sub_8098C64: @ 8098C64 + ldr r0, =gUnknown_08DDD728 + bx lr + .pool + thumb_func_end sub_8098C64 + + thumb_func_start sub_8098C6C +sub_8098C6C: @ 8098C6C + push {r4,r5,lr} + adds r3, r1, 0 + adds r4, r2, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r3, 16 + lsrs r3, 16 + lsls r4, 24 + lsrs r4, 24 + ldr r2, =gUnknown_0851021C + ldr r5, =0x03005d90 + ldr r1, [r5] + ldrb r1, [r1, 0x14] + lsrs r1, 3 + lsls r1, 3 + adds r1, r2 + ldr r1, [r1] + movs r2, 0x90 + lsls r2, 1 + bl LoadBgTiles + ldr r0, [r5] + ldrb r0, [r0, 0x14] + lsrs r0, 3 + bl sub_8098758 + ldr r0, [r0, 0x4] + adds r1, r4, 0 + movs r2, 0x20 + bl gpu_pal_apply + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8098C6C + + thumb_func_start script_env_init +@ void script_env_init(script_env *env, int a2, int a3) +script_env_init: @ 8098CB8 + push {lr} + adds r3, r0, 0 + movs r0, 0 + strb r0, [r3, 0x1] + str r0, [r3, 0x8] + strb r0, [r3] + str r0, [r3, 0x4] + str r1, [r3, 0x5C] + str r2, [r3, 0x60] + movs r2, 0 + movs r1, 0x3 + adds r0, r3, 0 + adds r0, 0x70 +_08098CD2: + str r2, [r0] + subs r0, 0x4 + subs r1, 0x1 + cmp r1, 0 + bge _08098CD2 + adds r1, r3, 0 + adds r1, 0xC + movs r2, 0 + adds r0, r3, 0 + adds r0, 0x58 +_08098CE6: + str r2, [r0] + subs r0, 0x4 + cmp r0, r1 + bge _08098CE6 + pop {r0} + bx r0 + thumb_func_end script_env_init + + thumb_func_start script_setup_bytecode_script +@ int script_setup_bytecode_script(script_env *env, void *script_ptr) +script_setup_bytecode_script: @ 8098CF4 + str r1, [r0, 0x8] + movs r1, 0x1 + strb r1, [r0, 0x1] + movs r0, 0x1 + bx lr + thumb_func_end script_setup_bytecode_script + + thumb_func_start script_setup_asm_script +script_setup_asm_script: @ 8098D00 + movs r2, 0x2 + strb r2, [r0, 0x1] + str r1, [r0, 0x4] + bx lr + thumb_func_end script_setup_asm_script + + thumb_func_start script_stop +@ void script_stop(script_env *env) +script_stop: @ 8098D08 + movs r1, 0 + strb r1, [r0, 0x1] + str r1, [r0, 0x8] + bx lr + thumb_func_end script_stop + + thumb_func_start script_main_handler +@ int script_main_handler(script_env *env) +script_main_handler: @ 8098D10 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0x1] + cmp r0, 0 + bne _08098D1E +_08098D1A: + movs r0, 0 + b _08098D90 +_08098D1E: + ldrb r0, [r4, 0x1] + cmp r0, 0x1 + beq _08098D56 + cmp r0, 0x1 + bgt _08098D2E + cmp r0, 0 + beq _08098D1A + b _08098D8E +_08098D2E: + cmp r0, 0x2 + bne _08098D8E + ldr r0, [r4, 0x4] + cmp r0, 0 + beq _08098D52 + bl _call_via_r0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08098D8E + strb r0, [r4, 0x1] + b _08098D8E +_08098D48: + strb r2, [r4, 0x1] + b _08098D1A +_08098D4C: + movs r0, 0 + strb r0, [r4, 0x1] + b _08098D90 +_08098D52: + movs r0, 0x1 + strb r0, [r4, 0x1] +_08098D56: + ldr r2, [r4, 0x8] + cmp r2, 0 + beq _08098D48 + ldr r0, =gUnknown_085102BC + ldr r0, [r0] + cmp r2, r0 + bne _08098D6C +_08098D64: + swi 0x2 + b _08098D64 + .pool +_08098D6C: + ldrb r1, [r2] + adds r0, r2, 0x1 + str r0, [r4, 0x8] + lsls r1, 2 + ldr r0, [r4, 0x5C] + adds r1, r0, r1 + ldr r0, [r4, 0x60] + cmp r1, r0 + bcs _08098D4C + ldr r1, [r1] + adds r0, r4, 0 + bl _call_via_r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08098D56 +_08098D8E: + movs r0, 0x1 +_08098D90: + pop {r4} + pop {r1} + bx r1 + thumb_func_end script_main_handler + + thumb_func_start script_stack_push +@ int script_stack_push(script_env *env, int value) +script_stack_push: @ 8098D98 + push {lr} + adds r2, r0, 0 + adds r3, r1, 0 + ldrb r1, [r2] + adds r0, r1, 0x1 + cmp r0, 0x13 + bgt _08098DBA + lsls r0, r1, 2 + adds r1, r2, 0 + adds r1, 0xC + adds r1, r0 + str r3, [r1] + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + movs r0, 0 + b _08098DBC +_08098DBA: + movs r0, 0x1 +_08098DBC: + pop {r1} + bx r1 + thumb_func_end script_stack_push + + thumb_func_start script_stack_pop +@ int script_stack_pop(script_env *env) +script_stack_pop: @ 8098DC0 + push {lr} + adds r2, r0, 0 + ldrb r0, [r2] + cmp r0, 0 + beq _08098DDC + subs r0, 0x1 + strb r0, [r2] + ldrb r1, [r2] + lsls r1, 2 + adds r0, r2, 0 + adds r0, 0xC + adds r0, r1 + ldr r0, [r0] + b _08098DDE +_08098DDC: + movs r0, 0 +_08098DDE: + pop {r1} + bx r1 + thumb_func_end script_stack_pop + + thumb_func_start script_jump +@ void script_jump(script_env *env, int address) +script_jump: @ 8098DE4 + str r1, [r0, 0x8] + bx lr + thumb_func_end script_jump + + thumb_func_start script_call +@ void script_call(script_env *env, int address) +script_call: @ 8098DE8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, [r4, 0x8] + bl script_stack_push + str r5, [r4, 0x8] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end script_call + + thumb_func_start script_return +@ void script_return(script_env *env) +script_return: @ 8098DFC + push {r4,lr} + adds r4, r0, 0 + bl script_stack_pop + str r0, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + thumb_func_end script_return + + thumb_func_start script_read_halfword +@ int script_read_halfword(script_env *env) +script_read_halfword: @ 8098E0C + adds r3, r0, 0 + ldr r2, [r3, 0x8] + ldrb r0, [r2] + adds r2, 0x1 + str r2, [r3, 0x8] + ldrb r1, [r2] + lsls r1, 8 + orrs r0, r1 + adds r2, 0x1 + str r2, [r3, 0x8] + bx lr + thumb_func_end script_read_halfword + + thumb_func_start script_read_word +@ int script_read_word(script_env *env) +script_read_word: @ 8098E24 + push {r4-r6,lr} + adds r3, r0, 0 + ldr r0, [r3, 0x8] + ldrb r6, [r0] + adds r0, 0x1 + str r0, [r3, 0x8] + ldrb r5, [r0] + adds r2, r0, 0x1 + str r2, [r3, 0x8] + ldrb r4, [r0, 0x1] + adds r1, r2, 0x1 + str r1, [r3, 0x8] + ldrb r0, [r2, 0x1] + adds r1, 0x1 + str r1, [r3, 0x8] + lsls r0, 8 + adds r0, r4 + lsls r0, 8 + adds r0, r5 + lsls r0, 8 + adds r0, r6 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end script_read_word + + thumb_func_start script_env_2_enable +script_env_2_enable: @ 8098E54 + ldr r1, =0x03000f2c + movs r0, 0x1 + strb r0, [r1] + bx lr + .pool + thumb_func_end script_env_2_enable + + thumb_func_start script_env_2_disable +@ void script_env_2_disable() +script_env_2_disable: @ 8098E60 + ldr r1, =0x03000f2c + movs r0, 0 + strb r0, [r1] + bx lr + .pool + thumb_func_end script_env_2_disable + + thumb_func_start script_env_2_is_enabled +@ int script_env_2_is_enabled() +script_env_2_is_enabled: @ 8098E6C + ldr r0, =0x03000f2c + ldrb r0, [r0] + bx lr + .pool + thumb_func_end script_env_2_is_enabled + + thumb_func_start script_env_context_is_running +@ int script_env_context_is_running() +script_env_context_is_running: @ 8098E78 + push {lr} + ldr r0, =0x03000e38 + ldrb r0, [r0] + cmp r0, 0 + beq _08098E8C + movs r0, 0 + b _08098E8E + .pool +_08098E8C: + movs r0, 0x1 +_08098E8E: + pop {r1} + bx r1 + thumb_func_end script_env_context_is_running + + thumb_func_start script_env_1_init +script_env_1_init: @ 8098E94 + push {lr} + ldr r0, =0x03000e40 + ldr r1, =gEventScriptCommandFunctionTable + ldr r2, =gUnknown_081DBA08 + bl script_env_init + ldr r1, =0x03000e38 + movs r0, 0x2 + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end script_env_1_init + + thumb_func_start script_env_2_run_current_script +script_env_2_run_current_script: @ 8098EBC + push {r4,lr} + ldr r4, =0x03000e38 + ldrb r0, [r4] + cmp r0, 0x2 + beq _08098EF0 + cmp r0, 0x1 + beq _08098EF0 + bl script_env_2_enable + ldr r0, =0x03000e40 + bl script_main_handler + lsls r0, 24 + cmp r0, 0 + beq _08098EE8 + movs r0, 0x1 + b _08098EF2 + .pool +_08098EE8: + movs r0, 0x2 + strb r0, [r4] + bl script_env_2_disable +_08098EF0: + movs r0, 0 +_08098EF2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end script_env_2_run_current_script + + thumb_func_start script_env_1_execute_new_script +script_env_1_execute_new_script: @ 8098EF8 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x03000e40 + ldr r1, =gEventScriptCommandFunctionTable + ldr r2, =gUnknown_081DBA08 + adds r0, r4, 0 + bl script_env_init + adds r0, r4, 0 + adds r1, r5, 0 + bl script_setup_bytecode_script + bl script_env_2_enable + ldr r1, =0x03000e38 + movs r0, 0 + strb r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end script_env_1_execute_new_script + + thumb_func_start script_env_2_set_ctx_paused +script_env_2_set_ctx_paused: @ 8098F30 + ldr r1, =0x03000e38 + movs r0, 0x1 + strb r0, [r1] + bx lr + .pool + thumb_func_end script_env_2_set_ctx_paused + + thumb_func_start script_env_2_enable_and_set_ctx_running +script_env_2_enable_and_set_ctx_running: @ 8098F3C + push {lr} + ldr r1, =0x03000e38 + movs r0, 0 + strb r0, [r1] + bl script_env_2_enable + pop {r0} + bx r0 + .pool + thumb_func_end script_env_2_enable_and_set_ctx_running + + thumb_func_start script_env_2_execute_new_script +@ void script_env_2_execute_new_script(void *script_ptr) +script_env_2_execute_new_script: @ 8098F50 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x03000eb8 + ldr r1, =gEventScriptCommandFunctionTable + ldr r2, =gUnknown_081DBA08 + adds r0, r4, 0 + bl script_env_init + adds r0, r4, 0 + adds r1, r5, 0 + bl script_setup_bytecode_script +_08098F68: + ldr r0, =0x03000eb8 + bl script_main_handler + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08098F68 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end script_env_2_execute_new_script + + thumb_func_start mapheader_get_tagged_pointer +mapheader_get_tagged_pointer: @ 8098F88 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, =0x02037318 + ldr r2, [r0, 0x8] + cmp r2, 0 + beq _08098F9C +_08098F96: + ldrb r0, [r2] + cmp r0, 0 + bne _08098FA4 +_08098F9C: + movs r0, 0 + b _08098FC2 + .pool +_08098FA4: + cmp r0, r1 + beq _08098FAC + adds r2, 0x5 + b _08098F96 +_08098FAC: + adds r2, 0x1 + ldrb r0, [r2] + ldrb r1, [r2, 0x1] + lsls r1, 8 + adds r0, r1 + ldrb r1, [r2, 0x2] + lsls r1, 16 + adds r0, r1 + ldrb r1, [r2, 0x3] + lsls r1, 24 + adds r0, r1 +_08098FC2: + pop {r1} + bx r1 + thumb_func_end mapheader_get_tagged_pointer + + thumb_func_start mapheader_run_script_by_tag +mapheader_run_script_by_tag: @ 8098FC8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl mapheader_get_tagged_pointer + cmp r0, 0 + beq _08098FDA + bl script_env_2_execute_new_script +_08098FDA: + pop {r0} + bx r0 + thumb_func_end mapheader_run_script_by_tag + + thumb_func_start mapheader_get_first_match_from_tagged_ptr_list +@ int mapheader_get_first_match_from_tagged_ptr_list(int tag) +mapheader_get_first_match_from_tagged_ptr_list: @ 8098FE0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + bl mapheader_get_tagged_pointer + adds r6, r0, 0 + cmp r6, 0 + beq _08098FFC +_08098FF0: + ldrb r1, [r6] + ldrb r0, [r6, 0x1] + lsls r0, 8 + orrs r1, r0 + cmp r1, 0 + bne _08099000 +_08098FFC: + movs r0, 0 + b _0809903A +_08099000: + adds r6, 0x2 + ldrb r5, [r6] + ldrb r0, [r6, 0x1] + lsls r0, 8 + orrs r5, r0 + adds r6, 0x2 + adds r0, r1, 0 + bl VarGet + adds r4, r0, 0 + adds r0, r5, 0 + bl VarGet + lsls r4, 16 + lsls r0, 16 + cmp r4, r0 + beq _08099026 + adds r6, 0x4 + b _08098FF0 +_08099026: + ldrb r0, [r6] + ldrb r1, [r6, 0x1] + lsls r1, 8 + adds r0, r1 + ldrb r1, [r6, 0x2] + lsls r1, 16 + adds r0, r1 + ldrb r1, [r6, 0x3] + lsls r1, 24 + adds r0, r1 +_0809903A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end mapheader_get_first_match_from_tagged_ptr_list + + thumb_func_start mapheader_run_script_with_tag_x1 +mapheader_run_script_with_tag_x1: @ 8099040 + push {lr} + movs r0, 0x1 + bl mapheader_run_script_by_tag + pop {r0} + bx r0 + thumb_func_end mapheader_run_script_with_tag_x1 + + thumb_func_start mapheader_run_script_with_tag_x3 +mapheader_run_script_with_tag_x3: @ 809904C + push {lr} + movs r0, 0x3 + bl mapheader_run_script_by_tag + pop {r0} + bx r0 + thumb_func_end mapheader_run_script_with_tag_x3 + + thumb_func_start mapheader_run_script_with_tag_x5 +mapheader_run_script_with_tag_x5: @ 8099058 + push {lr} + movs r0, 0x5 + bl mapheader_run_script_by_tag + pop {r0} + bx r0 + thumb_func_end mapheader_run_script_with_tag_x5 + + thumb_func_start mapheader_run_script_with_tag_x7 +mapheader_run_script_with_tag_x7: @ 8099064 + push {lr} + movs r0, 0x7 + bl mapheader_run_script_by_tag + pop {r0} + bx r0 + thumb_func_end mapheader_run_script_with_tag_x7 + + thumb_func_start mapheader_run_script_with_tag_x6 +mapheader_run_script_with_tag_x6: @ 8099070 + push {lr} + movs r0, 0x6 + bl mapheader_run_script_by_tag + pop {r0} + bx r0 + thumb_func_end mapheader_run_script_with_tag_x6 + + thumb_func_start mapheader_run_first_tag2_script_list_match +@ int mapheader_run_first_tag2_script_list_match() +mapheader_run_first_tag2_script_list_match: @ 809907C + push {lr} + movs r0, 0x2 + bl mapheader_get_first_match_from_tagged_ptr_list + cmp r0, 0 + beq _08099090 + bl script_env_1_execute_new_script + movs r0, 0x1 + b _08099092 +_08099090: + movs r0, 0 +_08099092: + pop {r1} + bx r1 + thumb_func_end mapheader_run_first_tag2_script_list_match + + thumb_func_start mapheader_run_first_tag4_script_list_match +@ void mapheader_run_first_tag4_script_list_match() +mapheader_run_first_tag4_script_list_match: @ 8099098 + push {lr} + movs r0, 0x4 + bl mapheader_get_first_match_from_tagged_ptr_list + cmp r0, 0 + beq _080990A8 + bl script_env_2_execute_new_script +_080990A8: + pop {r0} + bx r0 + thumb_func_end mapheader_run_first_tag4_script_list_match + + thumb_func_start sub_80990AC +sub_80990AC: @ 80990AC + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x0000372c + adds r0, r1 + movs r1, 0xFA + lsls r1, 2 + bl sub_806F928 + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80990AC + + thumb_func_start killram +killram: @ 80990D0 + push {lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r0, =0x00003728 + adds r1, r0 + ldr r2, =0x050000fb + mov r0, sp + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end killram + + thumb_func_start sub_80990FC +sub_80990FC: @ 80990FC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + str r0, [sp] + ldr r0, [sp, 0x24] + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + lsls r3, 24 + lsrs r7, r3, 24 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x03005d8c + mov r10, r0 + ldr r5, [r0] + ldr r1, =0x0000372c + adds r4, r5, r1 + bl killram + ldr r0, =0x000003e3 + cmp r8, r0 + bhi _08099174 + movs r0, 0x33 + strb r0, [r4] + mov r2, r9 + strb r2, [r4, 0x1] + strb r7, [r4, 0x2] + strb r6, [r4, 0x3] + ldr r1, =0x00003730 + adds r0, r5, r1 + ldr r1, [sp] + mov r2, r8 + bl memcpy + bl sub_80990AC + mov r2, r10 + ldr r1, [r2] + ldr r2, =0x00003728 + adds r1, r2 + str r0, [r1] + movs r0, 0x1 + b _08099176 + .pool +_08099174: + movs r0, 0 +_08099176: + 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_80990FC + + thumb_func_start sub_8099188 +@ u32 sub_8099188(u8 a1, u32 script) +sub_8099188: @ 8099188 + push {r4-r7,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r3, r0, 24 + ldr r6, =0x03005d8c + ldr r5, [r6] + ldr r0, =0x0000372c + adds r2, r5, r0 + ldr r7, =0x020375c0 + movs r0, 0 + str r0, [r7] + ldrb r0, [r2] + cmp r0, 0x33 + bne _080991F0 + ldrb r1, [r2, 0x1] + movs r0, 0x4 + ldrsb r0, [r5, r0] + cmp r1, r0 + bne _080991F0 + ldrb r1, [r2, 0x2] + movs r0, 0x5 + ldrsb r0, [r5, r0] + cmp r1, r0 + bne _080991F0 + ldrb r0, [r2, 0x3] + cmp r0, r3 + bne _080991F0 + bl sub_80990AC + ldr r1, [r6] + ldr r2, =0x00003728 + adds r1, r2 + ldr r1, [r1] + cmp r0, r1 + bne _080991EC + str r4, [r7] + ldr r1, =0x00003730 + adds r0, r5, r1 + b _080991F2 + .pool +_080991EC: + bl killram +_080991F0: + adds r0, r4, 0 +_080991F2: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8099188 + + thumb_func_start sub_80991F8 +sub_80991F8: @ 80991F8 + push {r4,lr} + ldr r4, =0x03005d8c + ldr r0, [r4] + ldr r2, =0x0000372c + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0x33 + bne _0809923C + ldrb r0, [r1, 0x1] + cmp r0, 0xFF + bne _0809923C + ldrb r0, [r1, 0x2] + cmp r0, 0xFF + bne _0809923C + ldrb r0, [r1, 0x3] + cmp r0, 0xFF + bne _0809923C + bl sub_80990AC + ldr r1, [r4] + ldr r2, =0x00003728 + adds r1, r2 + ldr r1, [r1] + cmp r0, r1 + bne _0809923C + movs r0, 0x1 + b _0809923E + .pool +_0809923C: + movs r0, 0 +_0809923E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80991F8 + + thumb_func_start sub_8099244 +sub_8099244: @ 8099244 + push {r4-r6,lr} + ldr r6, =0x03005d8c + ldr r5, [r6] + ldr r0, =0x0000372c + adds r4, r5, r0 + bl sub_801B27C + cmp r0, 0 + beq _08099298 + ldrb r0, [r4] + cmp r0, 0x33 + bne _08099298 + ldrb r0, [r4, 0x1] + cmp r0, 0xFF + bne _08099298 + ldrb r0, [r4, 0x2] + cmp r0, 0xFF + bne _08099298 + ldrb r0, [r4, 0x3] + cmp r0, 0xFF + bne _08099298 + bl sub_80990AC + ldr r1, [r6] + ldr r2, =0x00003728 + adds r1, r2 + ldr r1, [r1] + cmp r0, r1 + bne _08099294 + ldr r1, =0x00003730 + adds r0, r5, r1 + b _0809929A + .pool +_08099294: + bl killram +_08099298: + movs r0, 0 +_0809929A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8099244 + + thumb_func_start sub_80992A0 +sub_80992A0: @ 80992A0 + push {lr} + sub sp, 0x4 + adds r2, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r0, =0x000003e3 + cmp r1, r0 + bls _080992B2 + adds r1, r0, 0 +_080992B2: + movs r0, 0xFF + str r0, [sp] + adds r0, r2, 0 + movs r2, 0xFF + movs r3, 0xFF + bl sub_80990FC + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80992A0 + + thumb_func_start s00_nop +s00_nop: @ 80992CC + movs r0, 0 + bx lr + thumb_func_end s00_nop + + thumb_func_start s01_nop +s01_nop: @ 80992D0 + movs r0, 0 + bx lr + thumb_func_end s01_nop + + thumb_func_start s02_end +s02_end: @ 80992D4 + push {lr} + bl script_stop + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s02_end + + thumb_func_start s24_execute_ASM_2 +s24_execute_ASM_2: @ 80992E0 + push {r4,lr} + adds r4, r0, 0 + bl script_read_word + adds r1, r0, 0 + adds r0, r4, 0 + bl script_setup_asm_script + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s24_execute_ASM_2 + + thumb_func_start s25_extended_cmd +s25_extended_cmd: @ 80992F8 + push {lr} + bl script_read_halfword + lsls r0, 16 + ldr r1, =gUnknown_081DBA64 + lsrs r0, 14 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end s25_extended_cmd + + thumb_func_start s26_extended_cmd_setvar +s26_extended_cmd_setvar: @ 8099318 + push {r4-r6,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl GetVarPointer + adds r6, r0, 0 + ldr r4, =gUnknown_081DBA64 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 14 + adds r0, r4 + ldr r0, [r0] + bl _call_via_r0 + strh r0, [r6] + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end s26_extended_cmd_setvar + + thumb_func_start s23_execute_ASM +s23_execute_ASM: @ 809934C + push {lr} + bl script_read_word + bl _call_via_r0 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s23_execute_ASM + + thumb_func_start s27_set_to_waitstate +s27_set_to_waitstate: @ 809935C + push {lr} + bl script_env_2_set_ctx_paused + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end s27_set_to_waitstate + + thumb_func_start s05_goto +s05_goto: @ 8099368 + push {r4,lr} + adds r4, r0, 0 + bl script_read_word + adds r1, r0, 0 + adds r0, r4, 0 + bl script_jump + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s05_goto + + thumb_func_start s03_return +s03_return: @ 8099380 + push {lr} + bl script_return + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s03_return + + thumb_func_start s04_call +s04_call: @ 809938C + push {r4,lr} + adds r4, r0, 0 + bl script_read_word + adds r1, r0, 0 + adds r0, r4, 0 + bl script_call + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s04_call + + thumb_func_start s06_if_jump +@ int s06_if_jump(script_env *env) +s06_if_jump: @ 80993A4 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r4, [r0] + adds r0, 0x1 + str r0, [r5, 0x8] + adds r0, r5, 0 + bl script_read_word + adds r2, r0, 0 + ldr r1, =gUnknown_085102C0 + lsls r0, r4, 1 + adds r0, r4 + ldrb r3, [r5, 0x2] + adds r0, r3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080993D2 + adds r0, r5, 0 + adds r1, r2, 0 + bl script_jump +_080993D2: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end s06_if_jump + + thumb_func_start s07_if_call +s07_if_call: @ 80993E0 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r4, [r0] + adds r0, 0x1 + str r0, [r5, 0x8] + adds r0, r5, 0 + bl script_read_word + adds r2, r0, 0 + ldr r1, =gUnknown_085102C0 + lsls r0, r4, 1 + adds r0, r4 + ldrb r3, [r5, 0x2] + adds r0, r3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0809940E + adds r0, r5, 0 + adds r1, r2, 0 + bl script_call +_0809940E: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end s07_if_call + + thumb_func_start sB8_set_virtual_address +@ int sB8_set_virtual_address(script_env *env) +sB8_set_virtual_address: @ 809941C + push {r4,lr} + ldr r4, [r0, 0x8] + subs r4, 0x1 + bl script_read_word + ldr r1, =0x020375c4 + subs r0, r4 + str r0, [r1] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sB8_set_virtual_address + + thumb_func_start sB9_virtual_jump +@ int sB9_virtual_jump(script_env *env) +sB9_virtual_jump: @ 8099438 + push {r4,lr} + adds r4, r0, 0 + bl script_read_word + adds r1, r0, 0 + ldr r0, =0x020375c4 + ldr r0, [r0] + subs r1, r0 + adds r0, r4, 0 + bl script_jump + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sB9_virtual_jump + + thumb_func_start sBA_virtual_call +sBA_virtual_call: @ 809945C + push {r4,lr} + adds r4, r0, 0 + bl script_read_word + adds r1, r0, 0 + ldr r0, =0x020375c4 + ldr r0, [r0] + subs r1, r0 + adds r0, r4, 0 + bl script_call + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sBA_virtual_call + + thumb_func_start sBB_virtual_if_jump +sBB_virtual_if_jump: @ 8099480 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r4, [r0] + adds r0, 0x1 + str r0, [r5, 0x8] + adds r0, r5, 0 + bl script_read_word + ldr r1, =0x020375c4 + ldr r1, [r1] + subs r2, r0, r1 + ldr r1, =gUnknown_085102C0 + lsls r0, r4, 1 + adds r0, r4 + ldrb r3, [r5, 0x2] + adds r0, r3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080994B2 + adds r0, r5, 0 + adds r1, r2, 0 + bl script_jump +_080994B2: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sBB_virtual_if_jump + + thumb_func_start sBC_virtual_if_call +sBC_virtual_if_call: @ 80994C4 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r4, [r0] + adds r0, 0x1 + str r0, [r5, 0x8] + adds r0, r5, 0 + bl script_read_word + ldr r1, =0x020375c4 + ldr r1, [r1] + subs r2, r0, r1 + ldr r1, =gUnknown_085102C0 + lsls r0, r4, 1 + adds r0, r4 + ldrb r3, [r5, 0x2] + adds r0, r3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080994F6 + adds r0, r5, 0 + adds r1, r2, 0 + bl script_call +_080994F6: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sBC_virtual_if_call + + thumb_func_start s08_jumpstd +s08_jumpstd: @ 8099508 + push {lr} + adds r2, r0, 0 + ldr r0, [r2, 0x8] + ldrb r1, [r0] + adds r0, 0x1 + str r0, [r2, 0x8] + lsls r1, 2 + ldr r0, =gUnknown_081DC2A0 + adds r1, r0 + ldr r0, =gUnknown_081DC2CC + cmp r1, r0 + bcs _08099528 + ldr r1, [r1] + adds r0, r2, 0 + bl script_jump +_08099528: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end s08_jumpstd + + thumb_func_start s09_callstd +s09_callstd: @ 8099538 + push {lr} + adds r2, r0, 0 + ldr r0, [r2, 0x8] + ldrb r1, [r0] + adds r0, 0x1 + str r0, [r2, 0x8] + lsls r1, 2 + ldr r0, =gUnknown_081DC2A0 + adds r1, r0 + ldr r0, =gUnknown_081DC2CC + cmp r1, r0 + bcs _08099558 + ldr r1, [r1] + adds r0, r2, 0 + bl script_call +_08099558: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end s09_callstd + + thumb_func_start s0A_jumpstd_if +s0A_jumpstd_if: @ 8099568 + push {r4,lr} + adds r3, r0, 0 + ldr r0, [r3, 0x8] + ldrb r2, [r0] + adds r0, 0x1 + str r0, [r3, 0x8] + ldrb r4, [r0] + adds r0, 0x1 + str r0, [r3, 0x8] + ldr r1, =gUnknown_085102C0 + lsls r0, r2, 1 + adds r0, r2 + ldrb r2, [r3, 0x2] + adds r0, r2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080995A0 + lsls r0, r4, 2 + ldr r1, =gUnknown_081DC2A0 + adds r1, r0, r1 + ldr r0, =gUnknown_081DC2CC + cmp r1, r0 + bcs _080995A0 + ldr r1, [r1] + adds r0, r3, 0 + bl script_jump +_080995A0: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s0A_jumpstd_if + + thumb_func_start s0B_callstd_if +s0B_callstd_if: @ 80995B4 + push {r4,lr} + adds r3, r0, 0 + ldr r0, [r3, 0x8] + ldrb r2, [r0] + adds r0, 0x1 + str r0, [r3, 0x8] + ldrb r4, [r0] + adds r0, 0x1 + str r0, [r3, 0x8] + ldr r1, =gUnknown_085102C0 + lsls r0, r2, 1 + adds r0, r2 + ldrb r2, [r3, 0x2] + adds r0, r2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080995EC + lsls r0, r4, 2 + ldr r1, =gUnknown_081DC2A0 + adds r1, r0, r1 + ldr r0, =gUnknown_081DC2CC + cmp r1, r0 + bcs _080995EC + ldr r1, [r1] + adds r0, r3, 0 + bl script_call +_080995EC: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s0B_callstd_if + + thumb_func_start s0C_restore_execution_after_sCF +s0C_restore_execution_after_sCF: @ 8099600 + push {lr} + ldr r1, =0x020375c0 + ldr r1, [r1] + bl script_jump + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end s0C_restore_execution_after_sCF + + thumb_func_start s0D_endscript_killram +s0D_endscript_killram: @ 8099614 + push {r4,lr} + adds r4, r0, 0 + bl killram + adds r0, r4, 0 + bl script_stop + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s0D_endscript_killram + + thumb_func_start s0E_set_byte +s0E_set_byte: @ 809962C + push {lr} + ldr r1, [r0, 0x8] + ldrb r2, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + adds r0, r2, 0 + bl sub_81538C4 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s0E_set_byte + + thumb_func_start s0F_u32_var_to_const +@ int s0F_u32_var_to_const(script_env *env) +s0F_u32_var_to_const: @ 8099644 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, [r4, 0x8] + ldrb r5, [r0] + adds r0, 0x1 + str r0, [r4, 0x8] + adds r0, r4, 0 + bl script_read_word + lsls r5, 2 + adds r4, 0x64 + adds r4, r5 + str r0, [r4] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end s0F_u32_var_to_const + + thumb_func_start s12_u32_var_to_ptr +@ int s12_u32_var_to_ptr(script_env *env) +s12_u32_var_to_ptr: @ 8099668 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, [r4, 0x8] + ldrb r5, [r0] + adds r0, 0x1 + str r0, [r4, 0x8] + adds r0, r4, 0 + bl script_read_word + lsls r5, 2 + adds r4, 0x64 + adds r4, r5 + ldrb r0, [r0] + str r0, [r4] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end s12_u32_var_to_ptr + + thumb_func_start s11_u8_ptr_to_const +@ int s11_u8_ptr_to_const(script_env *env) +s11_u8_ptr_to_const: @ 809968C + push {r4,lr} + ldr r1, [r0, 0x8] + ldrb r4, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl script_read_word + strb r4, [r0] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s11_u8_ptr_to_const + + thumb_func_start s10_u8_var_to_const +@ int s10_u8_var_to_const(script_env *env) +s10_u8_var_to_const: @ 80996A4 + ldr r1, [r0, 0x8] + ldrb r3, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + lsls r3, 2 + adds r2, r0, 0 + adds r2, 0x64 + adds r2, r3 + ldrb r3, [r1] + str r3, [r2] + adds r1, 0x1 + str r1, [r0, 0x8] + movs r0, 0 + bx lr + thumb_func_end s10_u8_var_to_const + + thumb_func_start s13_u8_var_to_ptr +@ int s13_u8_var_to_ptr(script_env *env) +s13_u8_var_to_ptr: @ 80996C0 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, [r4, 0x8] + ldrb r5, [r0] + adds r0, 0x1 + str r0, [r4, 0x8] + adds r0, r4, 0 + bl script_read_word + lsls r5, 2 + adds r4, 0x64 + adds r4, r5 + ldr r1, [r4] + strb r1, [r0] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end s13_u8_var_to_ptr + + thumb_func_start s14_u32_var_to_var +s14_u32_var_to_var: @ 80996E4 + ldr r1, [r0, 0x8] + ldrb r3, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + ldrb r2, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + lsls r3, 2 + adds r0, 0x64 + adds r3, r0, r3 + lsls r2, 2 + adds r0, r2 + ldr r0, [r0] + str r0, [r3] + movs r0, 0 + bx lr + thumb_func_end s14_u32_var_to_var + + thumb_func_start s15_u8_ptr_to_ptr +s15_u8_ptr_to_ptr: @ 8099704 + push {r4,r5,lr} + adds r4, r0, 0 + bl script_read_word + adds r5, r0, 0 + adds r0, r4, 0 + bl script_read_word + ldrb r0, [r0] + strb r0, [r5] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end s15_u8_ptr_to_ptr + + thumb_func_start s16_u16_gvar_to_const +s16_u16_gvar_to_const: @ 8099720 + push {r4,r5,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl GetVarPointer + adds r4, r0, 0 + adds r0, r5, 0 + bl script_read_halfword + strh r0, [r4] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end s16_u16_gvar_to_const + + thumb_func_start s19_u16_gvar_gvar +s19_u16_gvar_gvar: @ 8099744 + push {r4,r5,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl GetVarPointer + adds r5, r0, 0 + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl GetVarPointer + ldrh r0, [r0] + strh r0, [r5] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end s19_u16_gvar_gvar + + thumb_func_start s1A_u16_gvar_gvar +s1A_u16_gvar_gvar: @ 8099770 + push {r4,r5,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl GetVarPointer + adds r5, r0, 0 + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + strh r0, [r5] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end s1A_u16_gvar_gvar + + thumb_func_start compare_012 +compare_012: @ 809979C + push {lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r1, 16 + cmp r0, r1 + bcs _080997AE + movs r0, 0 + b _080997B8 +_080997AE: + cmp r0, r1 + beq _080997B6 + movs r0, 0x2 + b _080997B8 +_080997B6: + movs r0, 0x1 +_080997B8: + pop {r1} + bx r1 + thumb_func_end compare_012 + + thumb_func_start s1B_cmp_u8_var_var +s1B_cmp_u8_var_var: @ 80997BC + push {r4,lr} + adds r4, r0, 0 + ldr r2, [r4, 0x8] + ldrb r0, [r2] + lsls r0, 2 + adds r3, r4, 0 + adds r3, 0x64 + adds r0, r3, r0 + ldrb r0, [r0] + adds r2, 0x1 + str r2, [r4, 0x8] + ldrb r1, [r2] + lsls r1, 2 + adds r3, r1 + ldrb r1, [r3] + adds r2, 0x1 + str r2, [r4, 0x8] + bl compare_012 + strb r0, [r4, 0x2] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s1B_cmp_u8_var_var + + thumb_func_start s1C_cmp_u8_var_const +s1C_cmp_u8_var_const: @ 80997EC + push {r4,lr} + adds r4, r0, 0 + ldr r2, [r4, 0x8] + ldrb r1, [r2] + lsls r1, 2 + adds r0, 0x64 + adds r0, r1 + ldrb r0, [r0] + adds r2, 0x1 + str r2, [r4, 0x8] + ldrb r1, [r2] + adds r2, 0x1 + str r2, [r4, 0x8] + bl compare_012 + strb r0, [r4, 0x2] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s1C_cmp_u8_var_const + + thumb_func_start s1D_cmp_u8_var_ptr +s1D_cmp_u8_var_ptr: @ 8099814 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r2, [r4, 0x8] + ldrb r1, [r2] + lsls r1, 2 + adds r0, 0x64 + adds r0, r1 + ldrb r5, [r0] + adds r2, 0x1 + str r2, [r4, 0x8] + adds r0, r4, 0 + bl script_read_word + ldrb r1, [r0] + adds r0, r5, 0 + bl compare_012 + strb r0, [r4, 0x2] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end s1D_cmp_u8_var_ptr + + thumb_func_start s1E_cmp_u8_ptr_var +s1E_cmp_u8_ptr_var: @ 8099840 + push {r4,lr} + adds r4, r0, 0 + bl script_read_word + ldrb r0, [r0] + ldr r3, [r4, 0x8] + ldrb r2, [r3] + lsls r2, 2 + adds r1, r4, 0 + adds r1, 0x64 + adds r1, r2 + ldrb r1, [r1] + adds r3, 0x1 + str r3, [r4, 0x8] + bl compare_012 + strb r0, [r4, 0x2] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s1E_cmp_u8_ptr_var + + thumb_func_start s1F_cmp_u8_ptr_const +s1F_cmp_u8_ptr_const: @ 809986C + push {r4,lr} + adds r4, r0, 0 + bl script_read_word + ldrb r0, [r0] + ldr r2, [r4, 0x8] + ldrb r1, [r2] + adds r2, 0x1 + str r2, [r4, 0x8] + bl compare_012 + strb r0, [r4, 0x2] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s1F_cmp_u8_ptr_const + + thumb_func_start s20_cmp_u8_ptr_ptr +s20_cmp_u8_ptr_ptr: @ 809988C + push {r4,r5,lr} + adds r4, r0, 0 + bl script_read_word + ldrb r5, [r0] + adds r0, r4, 0 + bl script_read_word + ldrb r1, [r0] + adds r0, r5, 0 + bl compare_012 + strb r0, [r4, 0x2] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end s20_cmp_u8_ptr_ptr + + thumb_func_start s21_cmp_u16_gvar_const +s21_cmp_u16_gvar_const: @ 80998B0 + push {r4,r5,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl GetVarPointer + ldrh r5, [r0] + adds r0, r4, 0 + bl script_read_halfword + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + bl compare_012 + strb r0, [r4, 0x2] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end s21_cmp_u16_gvar_const + + thumb_func_start s22_cmp_u16_gvar_gvar +s22_cmp_u16_gvar_gvar: @ 80998E0 + push {r4,r5,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl GetVarPointer + adds r5, r0, 0 + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl GetVarPointer + ldrh r2, [r5] + ldrh r1, [r0] + adds r0, r2, 0 + bl compare_012 + strb r0, [r4, 0x2] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end s22_cmp_u16_gvar_gvar + + thumb_func_start s17_u16_gvar_add_const +s17_u16_gvar_add_const: @ 8099914 + push {r4,r5,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl GetVarPointer + adds r4, r0, 0 + adds r0, r5, 0 + bl script_read_halfword + ldrh r1, [r4] + adds r0, r1 + strh r0, [r4] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end s17_u16_gvar_add_const + + thumb_func_start sub_809993C +sub_809993C: @ 809993C + push {r4,r5,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl GetVarPointer + adds r5, r0, 0 + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldrh r1, [r5] + subs r1, r0 + strh r1, [r5] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809993C + + thumb_func_start s8F_get_random_val +s8F_get_random_val: @ 809996C + push {r4,r5,lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r5, =0x020375f0 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __umodsi3 + strh r0, [r5] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end s8F_get_random_val + + thumb_func_start sub_80999A0 +sub_80999A0: @ 80999A0 + push {r4,r5,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r1, r0, 0 + ldr r5, =0x020375f0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl bag_add_item + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80999A0 + + thumb_func_start sub_80999E4 +sub_80999E4: @ 80999E4 + push {r4,r5,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r1, r0, 0 + ldr r5, =0x020375f0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl remove_item + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80999E4 + + thumb_func_start sub_8099A28 +sub_8099A28: @ 8099A28 + push {r4,r5,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r1, r0, 0 + ldr r5, =0x020375f0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_80D6800 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8099A28 + + thumb_func_start sub_8099A6C +sub_8099A6C: @ 8099A6C + push {r4,r5,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r1, r0, 0 + ldr r5, =0x020375f0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_80D6724 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8099A6C + + thumb_func_start s48_get_item_type +s48_get_item_type: @ 8099AB0 + push {r4,lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + ldr r4, =0x020375f0 + bl sub_80D6C68 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s48_get_item_type + + thumb_func_start sub_8099ADC +sub_8099ADC: @ 8099ADC + push {r4,r5,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r5, =0x020375f0 + adds r0, r4, 0 + bl sub_80D6D70 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8099ADC + + thumb_func_start sub_8099B20 +sub_8099B20: @ 8099B20 + push {r4,r5,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r5, =0x020375f0 + adds r0, r4, 0 + bl sub_80D6D1C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8099B20 + + thumb_func_start sub_8099B64 +sub_8099B64: @ 8099B64 + push {r4,lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldr r4, =0x020375f0 + lsls r0, 24 + lsrs r0, 24 + bl IsThereStorageSpaceForDecoration + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8099B64 + + thumb_func_start sub_8099B90 +sub_8099B90: @ 8099B90 + push {r4,lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldr r4, =0x020375f0 + lsls r0, 24 + lsrs r0, 24 + bl sub_81619DC + lsls r0, 24 + asrs r0, 24 + strh r0, [r4] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8099B90 + + thumb_func_start sub_8099BBC +sub_8099BBC: @ 8099BBC + push {r4,lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldr r4, =0x020375f0 + lsls r0, 24 + lsrs r0, 24 + bl sub_81619A8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8099BBC + + thumb_func_start sub_8099BE8 +sub_8099BE8: @ 8099BE8 + push {r4,lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldr r4, =0x020375f0 + lsls r0, 24 + lsrs r0, 24 + bl sub_8161918 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8099BE8 + + thumb_func_start s29_flag_set +@ int s29_flag_set(script_env *env) +s29_flag_set: @ 8099C14 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl FlagSet + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s29_flag_set + + thumb_func_start s2A_flag_clear +@ int s2A_flag_clear(script_env *env) +s2A_flag_clear: @ 8099C28 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl FlagReset + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s2A_flag_clear + + thumb_func_start s2B_flag_check +@ int s2B_flag_check(script_env *env) +s2B_flag_check: @ 8099C3C + push {r4,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl FlagGet + strb r0, [r4, 0x2] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s2B_flag_check + + thumb_func_start sC3_unknown +@ int sC3_unknown(script_env *env) +sC3_unknown: @ 8099C58 + push {lr} + ldr r1, [r0, 0x8] + ldrb r2, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + adds r0, r2, 0 + bl sav12_xor_increment + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sC3_unknown + + thumb_func_start s9A_unknown +@ int s9A_unknown(script_env *env) +s9A_unknown: @ 8099C70 + push {lr} + ldr r1, [r0, 0x8] + ldrb r2, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + adds r0, r2, 0 + bl sub_80B009C + bl script_env_2_set_ctx_paused + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end s9A_unknown + + thumb_func_start s99_unknown +@ int s99_unknown(script_env *env) +s99_unknown: @ 8099C8C + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + bl sub_80854EC + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s99_unknown + + thumb_func_start sub_8099CA8 +sub_8099CA8: @ 8099CA8 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08099CC0 + movs r0, 0 + b _08099CC2 + .pool +_08099CC0: + movs r0, 0x1 +_08099CC2: + pop {r1} + bx r1 + thumb_func_end sub_8099CA8 + + thumb_func_start s97_screen_special_effect +@ int s97_screen_special_effect(script_env *env) +s97_screen_special_effect: @ 8099CC8 + push {r4,lr} + adds r4, r0, 0 + ldr r1, [r4, 0x8] + ldrb r0, [r1] + adds r1, 0x1 + str r1, [r4, 0x8] + movs r1, 0 + bl fade_screen + ldr r1, =sub_8099CA8 + adds r0, r4, 0 + bl script_setup_asm_script + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s97_screen_special_effect + + thumb_func_start s98_refade_with_timer +@ int s98_refade_with_timer(script_env *env) +s98_refade_with_timer: @ 8099CF0 + push {r4,lr} + adds r4, r0, 0 + ldr r2, [r4, 0x8] + ldrb r0, [r2] + adds r2, 0x1 + str r2, [r4, 0x8] + ldrb r1, [r2] + adds r2, 0x1 + str r2, [r4, 0x8] + lsls r1, 24 + asrs r1, 24 + bl fade_screen + ldr r1, =sub_8099CA8 + adds r0, r4, 0 + bl script_setup_asm_script + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s98_refade_with_timer + + thumb_func_start sub_8099D20 +@ int sub_8099D20(script_env *env) +sub_8099D20: @ 8099D20 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r4, [r0] + adds r0, 0x1 + str r0, [r5, 0x8] + cmp r4, 0x1 + beq _08099D3E + cmp r4, 0x1 + bgt _08099D3A + cmp r4, 0 + beq _08099D60 + b _08099D3E +_08099D3A: + cmp r4, 0x2 + beq _08099D60 +_08099D3E: + ldr r0, =0x02037714 + ldr r1, =0x02037fe8 + ldr r2, =0x04000100 + bl CpuSet + adds r0, r4, 0 + movs r1, 0 + bl fade_screen + b _08099D72 + .pool +_08099D60: + ldr r0, =0x02037fe8 + ldr r1, =0x02037714 + ldr r2, =0x04000100 + bl CpuSet + adds r0, r4, 0 + movs r1, 0 + bl fade_screen +_08099D72: + ldr r1, =sub_8099CA8 + adds r0, r5, 0 + bl script_setup_asm_script + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8099D20 + + thumb_func_start s28_pause_asm +s28_pause_asm: @ 8099D94 + push {lr} + ldr r1, =0x020375c8 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + beq _08099DAC + movs r0, 0 + b _08099DAE + .pool +_08099DAC: + movs r0, 0x1 +_08099DAE: + pop {r1} + bx r1 + thumb_func_end s28_pause_asm + + thumb_func_start s28_pause +@ int s28_pause(script_env *env) +s28_pause: @ 8099DB4 + push {r4,lr} + adds r4, r0, 0 + bl script_read_halfword + ldr r1, =0x020375c8 + strh r0, [r1] + ldr r1, =s28_pause_asm + adds r0, r4, 0 + bl script_setup_asm_script + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s28_pause + + thumb_func_start s2C_unknown +@ int s2C_unknown(script_env *env) +s2C_unknown: @ 8099DD8 + push {r4,r5,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl GameFreakRTC_CalcRTCToLocalDelta_DayZero + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end s2C_unknown + + thumb_func_start s2D_unknown +@ int s2D_unknown(script_env *env) +s2D_unknown: @ 8099E10 + push {lr} + bl sub_809E7B0 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s2D_unknown + + thumb_func_start s2E_unknown +@ int s2E_unknown(script_env *env) +s2E_unknown: @ 8099E1C + push {lr} + bl GameFreakRTC_CalcLocalDateTime + ldr r2, =0x020375d8 + ldr r1, =0x03005cf8 + movs r0, 0x2 + ldrsb r0, [r1, r0] + strh r0, [r2] + ldr r2, =0x020375da + movs r0, 0x3 + ldrsb r0, [r1, r0] + strh r0, [r2] + ldr r2, =0x020375dc + movs r0, 0x4 + ldrsb r0, [r1, r0] + strh r0, [r2] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end s2E_unknown + + thumb_func_start sA4_set_weather_data +@ int sA4_set_weather_data(script_env *env) +sA4_set_weather_data: @ 8099E54 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + bl sub_80AED7C + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sA4_set_weather_data + + thumb_func_start sA3_set_standard_weather_data +@ int sA3_set_standard_weather_data(script_env *env) +sA3_set_standard_weather_data: @ 8099E70 + push {lr} + bl sub_80AEDBC + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sA3_set_standard_weather_data + + thumb_func_start sub_8099E7C +@ int sub_8099E7C(script_env *env) +sub_8099E7C: @ 8099E7C + push {lr} + bl sub_80AEE20 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_8099E7C + + thumb_func_start sA6_activate_per_step_callback_eg_ash +@ int sA6_activate_per_step_callback_eg_ash(script_env *env) +sA6_activate_per_step_callback_eg_ash: @ 8099E88 + push {lr} + ldr r1, [r0, 0x8] + ldrb r2, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + adds r0, r2, 0 + bl activate_per_step_callback + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sA6_activate_per_step_callback_eg_ash + + thumb_func_start sA7_set_new_map_footer +@ int sA7_set_new_map_footer(script_env *env) +sA7_set_new_map_footer: @ 8099EA0 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + bl sub_8085524 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sA7_set_new_map_footer + + thumb_func_start s39_warp_sfx +@ int s39_warp_sfx(script_env *env) +s39_warp_sfx: @ 8099EBC + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r1, [r0] + mov r9, r1 + adds r0, 0x1 + str r0, [r5, 0x8] + ldrb r1, [r0] + mov r8, r1 + adds r1, r0, 0x1 + str r1, [r5, 0x8] + ldrb r6, [r0, 0x1] + adds r1, 0x1 + str r1, [r5, 0x8] + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + mov r1, r9 + lsls r1, 24 + asrs r1, 24 + mov r9, r1 + mov r1, r8 + lsls r1, 24 + asrs r1, 24 + mov r8, r1 + lsls r6, 24 + asrs r6, 24 + lsls r4, 24 + asrs r4, 24 + lsls r0, 24 + asrs r0, 24 + str r0, [sp] + mov r0, r9 + adds r2, r6, 0 + adds r3, r4, 0 + bl warp1_set + bl sub_80AF734 + bl player_avatar_init_params_reset + movs r0, 0x1 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end s39_warp_sfx + + thumb_func_start s3A_warp_new_music +@ int s3A_warp_new_music(script_env *env) +s3A_warp_new_music: @ 8099F44 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r1, [r0] + mov r9, r1 + adds r0, 0x1 + str r0, [r5, 0x8] + ldrb r1, [r0] + mov r8, r1 + adds r1, r0, 0x1 + str r1, [r5, 0x8] + ldrb r6, [r0, 0x1] + adds r1, 0x1 + str r1, [r5, 0x8] + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + mov r1, r9 + lsls r1, 24 + asrs r1, 24 + mov r9, r1 + mov r1, r8 + lsls r1, 24 + asrs r1, 24 + mov r8, r1 + lsls r6, 24 + asrs r6, 24 + lsls r4, 24 + asrs r4, 24 + lsls r0, 24 + asrs r0, 24 + str r0, [sp] + mov r0, r9 + adds r2, r6, 0 + adds r3, r4, 0 + bl warp1_set + bl sp13E_warp_to_last_warp + bl player_avatar_init_params_reset + movs r0, 0x1 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end s3A_warp_new_music + + thumb_func_start s3B_warp_keep_music +@ int s3B_warp_keep_music(script_env *env) +s3B_warp_keep_music: @ 8099FCC + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r1, [r0] + mov r9, r1 + adds r0, 0x1 + str r0, [r5, 0x8] + ldrb r1, [r0] + mov r8, r1 + adds r1, r0, 0x1 + str r1, [r5, 0x8] + ldrb r6, [r0, 0x1] + adds r1, 0x1 + str r1, [r5, 0x8] + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + mov r1, r9 + lsls r1, 24 + asrs r1, 24 + mov r9, r1 + mov r1, r8 + lsls r1, 24 + asrs r1, 24 + mov r8, r1 + lsls r6, 24 + asrs r6, 24 + lsls r4, 24 + asrs r4, 24 + lsls r0, 24 + asrs r0, 24 + str r0, [sp] + mov r0, r9 + adds r2, r6, 0 + adds r3, r4, 0 + bl warp1_set + bl sub_80AF7D0 + bl player_avatar_init_params_reset + movs r0, 0x1 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end s3B_warp_keep_music + + thumb_func_start sub_809A054 +sub_809A054: @ 809A054 + push {r4-r6,lr} + sub sp, 0x8 + ldr r1, [r0, 0x8] + ldrb r6, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + ldrb r5, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + mov r4, sp + adds r4, 0x6 + add r0, sp, 0x4 + adds r1, r4, 0 + bl PlayerGetDestCoords + cmp r6, 0xFF + bne _0809A092 + cmp r5, 0xFF + bne _0809A092 + add r0, sp, 0x4 + ldrh r0, [r0] + subs r0, 0x7 + lsls r0, 16 + asrs r0, 16 + ldrh r1, [r4] + subs r1, 0x7 + lsls r1, 16 + asrs r1, 16 + bl sub_8084EBC + b _0809A0B6 +_0809A092: + lsls r0, r6, 24 + asrs r0, 24 + lsls r1, r5, 24 + asrs r1, 24 + movs r2, 0x1 + negs r2, r2 + add r3, sp, 0x4 + ldrb r3, [r3] + subs r3, 0x7 + lsls r3, 24 + asrs r3, 24 + ldrb r4, [r4] + subs r4, 0x7 + lsls r4, 24 + asrs r4, 24 + str r4, [sp] + bl warp1_set +_0809A0B6: + bl sp13F_fall_to_last_warp + bl player_avatar_init_params_reset + movs r0, 0x1 + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_809A054 + + thumb_func_start s3D_warp_v4 +s3D_warp_v4: @ 809A0C8 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r1, [r0] + mov r9, r1 + adds r0, 0x1 + str r0, [r5, 0x8] + ldrb r1, [r0] + mov r8, r1 + adds r1, r0, 0x1 + str r1, [r5, 0x8] + ldrb r6, [r0, 0x1] + adds r1, 0x1 + str r1, [r5, 0x8] + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + mov r1, r9 + lsls r1, 24 + asrs r1, 24 + mov r9, r1 + mov r1, r8 + lsls r1, 24 + asrs r1, 24 + mov r8, r1 + lsls r6, 24 + asrs r6, 24 + lsls r4, 24 + asrs r4, 24 + lsls r0, 24 + asrs r0, 24 + str r0, [sp] + mov r0, r9 + adds r2, r6, 0 + adds r3, r4, 0 + bl warp1_set + bl sub_80AF848 + bl player_avatar_init_params_reset + movs r0, 0x1 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end s3D_warp_v4 + + thumb_func_start sub_809A150 +sub_809A150: @ 809A150 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r1, [r0] + mov r9, r1 + adds r0, 0x1 + str r0, [r5, 0x8] + ldrb r1, [r0] + mov r8, r1 + adds r1, r0, 0x1 + str r1, [r5, 0x8] + ldrb r6, [r0, 0x1] + adds r1, 0x1 + str r1, [r5, 0x8] + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + mov r1, r9 + lsls r1, 24 + asrs r1, 24 + mov r9, r1 + mov r1, r8 + lsls r1, 24 + asrs r1, 24 + mov r8, r1 + lsls r6, 24 + asrs r6, 24 + lsls r4, 24 + asrs r4, 24 + lsls r0, 24 + asrs r0, 24 + str r0, [sp] + mov r0, r9 + adds r2, r6, 0 + adds r3, r4, 0 + bl warp1_set + bl sub_80AF87C + bl player_avatar_init_params_reset + movs r0, 0x1 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_809A150 + + thumb_func_start s3E_set_new_map +s3E_set_new_map: @ 809A1D8 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r1, [r0] + mov r9, r1 + adds r0, 0x1 + str r0, [r5, 0x8] + ldrb r1, [r0] + mov r8, r1 + adds r1, r0, 0x1 + str r1, [r5, 0x8] + ldrb r6, [r0, 0x1] + adds r1, 0x1 + str r1, [r5, 0x8] + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + mov r1, r9 + lsls r1, 24 + asrs r1, 24 + mov r9, r1 + mov r1, r8 + lsls r1, 24 + asrs r1, 24 + mov r8, r1 + lsls r6, 24 + asrs r6, 24 + lsls r4, 24 + asrs r4, 24 + lsls r0, 24 + asrs r0, 24 + str r0, [sp] + mov r0, r9 + adds r2, r6, 0 + adds r3, r4, 0 + bl warp1_set + movs r0, 0 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end s3E_set_new_map + + thumb_func_start s3F_set_new_map_DMA +s3F_set_new_map_DMA: @ 809A258 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x8 + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r1, [r0] + mov r9, r1 + adds r0, 0x1 + str r0, [r5, 0x8] + ldrb r1, [r0] + mov r8, r1 + adds r1, r0, 0x1 + str r1, [r5, 0x8] + ldrb r6, [r0, 0x1] + adds r1, 0x1 + str r1, [r5, 0x8] + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + mov r1, r9 + lsls r1, 24 + asrs r1, 24 + mov r9, r1 + mov r1, r8 + lsls r1, 24 + asrs r1, 24 + mov r8, r1 + lsls r6, 24 + asrs r6, 24 + lsls r4, 24 + asrs r4, 24 + str r4, [sp] + lsls r0, 24 + asrs r0, 24 + str r0, [sp, 0x4] + movs r0, 0 + mov r1, r9 + mov r2, r8 + adds r3, r6, 0 + bl saved_warp2_set_2 + movs r0, 0 + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end s3F_set_new_map_DMA + + thumb_func_start sub_809A2DC +sub_809A2DC: @ 809A2DC + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r1, [r0] + mov r9, r1 + adds r0, 0x1 + str r0, [r5, 0x8] + ldrb r1, [r0] + mov r8, r1 + adds r1, r0, 0x1 + str r1, [r5, 0x8] + ldrb r6, [r0, 0x1] + adds r1, 0x1 + str r1, [r5, 0x8] + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + mov r1, r9 + lsls r1, 24 + asrs r1, 24 + mov r9, r1 + mov r1, r8 + lsls r1, 24 + asrs r1, 24 + mov r8, r1 + lsls r6, 24 + asrs r6, 24 + lsls r4, 24 + asrs r4, 24 + lsls r0, 24 + asrs r0, 24 + str r0, [sp] + mov r0, r9 + adds r2, r6, 0 + adds r3, r4, 0 + bl sub_8084E2C + movs r0, 0 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_809A2DC + + thumb_func_start sub_809A35C +sub_809A35C: @ 809A35C + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r1, [r0] + mov r9, r1 + adds r0, 0x1 + str r0, [r5, 0x8] + ldrb r1, [r0] + mov r8, r1 + adds r1, r0, 0x1 + str r1, [r5, 0x8] + ldrb r6, [r0, 0x1] + adds r1, 0x1 + str r1, [r5, 0x8] + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + mov r1, r9 + lsls r1, 24 + asrs r1, 24 + mov r9, r1 + mov r1, r8 + lsls r1, 24 + asrs r1, 24 + mov r8, r1 + lsls r6, 24 + asrs r6, 24 + lsls r4, 24 + asrs r4, 24 + lsls r0, 24 + asrs r0, 24 + str r0, [sp] + mov r0, r9 + adds r2, r6, 0 + adds r3, r4, 0 + bl sub_8084E80 + movs r0, 0 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_809A35C + + thumb_func_start sC4_unknown +sC4_unknown: @ 809A3DC + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r1, [r0] + mov r9, r1 + adds r0, 0x1 + str r0, [r5, 0x8] + ldrb r1, [r0] + mov r8, r1 + adds r1, r0, 0x1 + str r1, [r5, 0x8] + ldrb r6, [r0, 0x1] + adds r1, 0x1 + str r1, [r5, 0x8] + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + mov r1, r9 + lsls r1, 24 + asrs r1, 24 + mov r9, r1 + mov r1, r8 + lsls r1, 24 + asrs r1, 24 + mov r8, r1 + lsls r6, 24 + asrs r6, 24 + lsls r4, 24 + asrs r4, 24 + lsls r0, 24 + asrs r0, 24 + str r0, [sp] + mov r0, r9 + adds r2, r6, 0 + adds r3, r4, 0 + bl sub_8084DD4 + movs r0, 0 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sC4_unknown + + thumb_func_start s42_get_map_camera_pos +@ int s42_get_map_camera_pos(script_env *env) +s42_get_map_camera_pos: @ 809A45C + push {r4,r5,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl GetVarPointer + adds r5, r0, 0 + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl GetVarPointer + ldr r2, =0x03005d8c + ldr r1, [r2] + ldrh r1, [r1] + strh r1, [r5] + ldr r1, [r2] + ldrh r1, [r1, 0x2] + strh r1, [r0] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end s42_get_map_camera_pos + + thumb_func_start s43_get_player_party_count +s43_get_player_party_count: @ 809A498 + push {r4,lr} + ldr r4, =0x020375f0 + bl calc_player_party_count + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s43_get_player_party_count + + thumb_func_start s2F_music_play +s2F_music_play: @ 809A4B4 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl audio_play + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s2F_music_play + + thumb_func_start s30_music_check_asm +s30_music_check_asm: @ 809A4C8 + push {lr} + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + beq _0809A4D8 + movs r0, 0 + b _0809A4DA +_0809A4D8: + movs r0, 0x1 +_0809A4DA: + pop {r1} + bx r1 + thumb_func_end s30_music_check_asm + + thumb_func_start s30_music_check +s30_music_check: @ 809A4E0 + push {lr} + ldr r1, =s30_music_check_asm + bl script_setup_asm_script + movs r0, 0x1 + pop {r1} + bx r1 + .pool + thumb_func_end s30_music_check + + thumb_func_start s31_fanfare_play +s31_fanfare_play: @ 809A4F4 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl fanfare_play + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s31_fanfare_play + + thumb_func_start s32_fanfare_wait_asm +s32_fanfare_wait_asm: @ 809A508 + push {lr} + bl task_is_not_running_overworld_fanfare + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end s32_fanfare_wait_asm + + thumb_func_start s32_fanfare_wait +s32_fanfare_wait: @ 809A518 + push {lr} + ldr r1, =s32_fanfare_wait_asm + bl script_setup_asm_script + movs r0, 0x1 + pop {r1} + bx r1 + .pool + thumb_func_end s32_fanfare_wait + + thumb_func_start s33_play_music +@ int s33_play_music(script_env *env) +s33_play_music: @ 809A52C + push {r4,r5,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r2, r0, 16 + adds r5, r2, 0 + ldr r0, [r4, 0x8] + ldrb r1, [r0] + adds r0, 0x1 + str r0, [r4, 0x8] + cmp r1, 0x1 + bne _0809A54C + adds r0, r2, 0 + bl sav1_set_battle_music_maybe +_0809A54C: + adds r0, r5, 0 + bl current_map_music_set + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end s33_play_music + + thumb_func_start s34_unknown +s34_unknown: @ 809A55C + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl sav1_set_battle_music_maybe + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s34_unknown + + thumb_func_start s35_fade_to_default +s35_fade_to_default: @ 809A570 + push {lr} + bl sub_8085898 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s35_fade_to_default + + thumb_func_start s36_fade_to_music +s36_fade_to_music: @ 809A57C + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl sub_80858C4 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s36_fade_to_music + + thumb_func_start s37_fadeout +s37_fadeout: @ 809A590 + push {r4,lr} + adds r4, r0, 0 + ldr r0, [r4, 0x8] + ldrb r1, [r0] + adds r0, 0x1 + str r0, [r4, 0x8] + cmp r1, 0 + beq _0809A5AA + lsls r0, r1, 26 + lsrs r0, 24 + bl sub_80A31E8 + b _0809A5B0 +_0809A5AA: + movs r0, 0x4 + bl sub_80A31E8 +_0809A5B0: + ldr r1, =sub_80A3200 + adds r0, r4, 0 + bl script_setup_asm_script + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s37_fadeout + + thumb_func_start s38_fadein +s38_fadein: @ 809A5C4 + push {lr} + ldr r1, [r0, 0x8] + ldrb r2, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + cmp r2, 0 + beq _0809A5DC + lsls r0, r2, 26 + lsrs r0, 24 + bl sub_80A3228 + b _0809A5E2 +_0809A5DC: + movs r0, 0x4 + bl sub_80A3228 +_0809A5E2: + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s38_fadein + + thumb_func_start s4F_execute_movement +s4F_execute_movement: @ 809A5E8 + push {r4,r5,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_word + adds r3, r0, 0 + lsls r0, r4, 24 + lsrs r0, 24 + ldr r1, =0x03005d8c + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl exec_movement + ldr r0, =0x020375ca + strh r4, [r0] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end s4F_execute_movement + + thumb_func_start s50_execute_movement_remote +s50_execute_movement_remote: @ 809A62C + push {r4,r5,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_word + adds r3, r0, 0 + ldr r0, [r5, 0x8] + ldrb r2, [r0] + adds r0, 0x1 + str r0, [r5, 0x8] + ldrb r1, [r0] + adds r0, 0x1 + str r0, [r5, 0x8] + lsls r0, r4, 24 + lsrs r0, 24 + bl exec_movement + ldr r0, =0x020375ca + strh r4, [r0] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end s50_execute_movement_remote + + thumb_func_start s51a_0806B288 +s51a_0806B288: @ 809A670 + push {lr} + ldr r0, =0x020375ca + ldrb r0, [r0] + ldr r1, =0x020375ce + ldrb r1, [r1] + ldr r2, =0x020375cc + ldrb r2, [r2] + bl sub_80D3340 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end s51a_0806B288 + + thumb_func_start s51_waitmove +s51_waitmove: @ 809A698 + push {r4,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _0809A6B4 + ldr r0, =0x020375ca + strh r1, [r0] +_0809A6B4: + ldr r1, =0x020375cc + ldr r0, =0x03005d8c + ldr r2, [r0] + movs r0, 0x4 + ldrsb r0, [r2, r0] + strh r0, [r1] + ldr r1, =0x020375ce + movs r0, 0x5 + ldrsb r0, [r2, r0] + strh r0, [r1] + ldr r1, =s51a_0806B288 + adds r0, r4, 0 + bl script_setup_asm_script + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s51_waitmove + + thumb_func_start s52_waitmove_remote +s52_waitmove_remote: @ 809A6EC + push {r4,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _0809A708 + ldr r0, =0x020375ca + strh r1, [r0] +_0809A708: + ldr r0, [r4, 0x8] + ldrb r2, [r0] + adds r0, 0x1 + str r0, [r4, 0x8] + ldrb r1, [r0] + adds r0, 0x1 + str r0, [r4, 0x8] + ldr r0, =0x020375cc + strh r2, [r0] + ldr r0, =0x020375ce + strh r1, [r0] + ldr r1, =s51a_0806B288 + adds r0, r4, 0 + bl script_setup_asm_script + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s52_waitmove_remote + + thumb_func_start s53_hide_sprite +s53_hide_sprite: @ 809A740 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005d8c + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl RemoveFieldObjectByLocalIdAndMap + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end s53_hide_sprite + + thumb_func_start s54_hide_sprite_set_coords +s54_hide_sprite_set_coords: @ 809A768 + push {r4,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldr r3, [r4, 0x8] + ldrb r2, [r3] + adds r3, 0x1 + str r3, [r4, 0x8] + ldrb r1, [r3] + adds r3, 0x1 + str r3, [r4, 0x8] + lsls r0, 24 + lsrs r0, 24 + bl RemoveFieldObjectByLocalIdAndMap + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s54_hide_sprite_set_coords + + thumb_func_start s55_show_sprite +s55_show_sprite: @ 809A798 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005d8c + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl show_sprite + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end s55_show_sprite + + thumb_func_start s56_show_sprite_set_coords +s56_show_sprite_set_coords: @ 809A7C0 + push {r4,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldr r3, [r4, 0x8] + ldrb r2, [r3] + adds r3, 0x1 + str r3, [r4, 0x8] + ldrb r1, [r3] + adds r3, 0x1 + str r3, [r4, 0x8] + lsls r0, 24 + lsrs r0, 24 + bl show_sprite + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s56_show_sprite_set_coords + + thumb_func_start s57_move_sprites +s57_move_sprites: @ 809A7F0 + push {r4-r6,lr} + sub sp, 0x4 + adds r6, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r6, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r6, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r5, 24 + lsrs r5, 24 + ldr r1, =0x03005d8c + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + lsls r4, 16 + asrs r4, 16 + lsls r0, 16 + asrs r0, 16 + str r0, [sp] + adds r0, r5, 0 + adds r3, r4, 0 + bl sub_808EBA8 + movs r0, 0 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end s57_move_sprites + + thumb_func_start s63_new_sprite_location_permanent +s63_new_sprite_location_permanent: @ 809A858 + push {r4-r6,lr} + adds r6, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r6, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r6, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r2, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, 16 + asrs r4, 16 + lsls r2, 16 + asrs r2, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl update_saveblock1_field_object_coords + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end s63_new_sprite_location_permanent + + thumb_func_start s64_set_sprite_top_left_corner +s64_set_sprite_top_left_corner: @ 809A8B0 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005d8c + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl sub_808F254 + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end s64_set_sprite_top_left_corner + + thumb_func_start s58_npc_f1_clear_x20 +s58_npc_f1_clear_x20: @ 809A8D8 + push {r4,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldr r3, [r4, 0x8] + ldrb r2, [r3] + adds r3, 0x1 + str r3, [r4, 0x8] + ldrb r1, [r3] + adds r3, 0x1 + str r3, [r4, 0x8] + lsls r0, 24 + lsrs r0, 24 + movs r3, 0 + bl npc_by_local_id_and_map_set_field_1_bit_x20 + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s58_npc_f1_clear_x20 + + thumb_func_start s59_npc_f1_set_x20 +s59_npc_f1_set_x20: @ 809A908 + push {r4,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldr r3, [r4, 0x8] + ldrb r2, [r3] + adds r3, 0x1 + str r3, [r4, 0x8] + ldrb r1, [r3] + adds r3, 0x1 + str r3, [r4, 0x8] + lsls r0, 24 + lsrs r0, 24 + movs r3, 0x1 + bl npc_by_local_id_and_map_set_field_1_bit_x20 + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s59_npc_f1_set_x20 + + thumb_func_start sA8_unknown +sA8_unknown: @ 809A938 + push {r4,r5,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldr r3, [r5, 0x8] + ldrb r2, [r3] + adds r3, 0x1 + str r3, [r5, 0x8] + ldrb r1, [r3] + adds r4, r3, 0x1 + str r4, [r5, 0x8] + ldrb r3, [r3, 0x1] + adds r4, 0x1 + str r4, [r5, 0x8] + lsls r0, 24 + lsrs r0, 24 + adds r3, 0x53 + lsls r3, 24 + lsrs r3, 24 + bl sub_808E78C + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sA8_unknown + + thumb_func_start sA9_unknown +sA9_unknown: @ 809A974 + push {r4,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldr r3, [r4, 0x8] + ldrb r2, [r3] + adds r3, 0x1 + str r3, [r4, 0x8] + ldrb r1, [r3] + adds r3, 0x1 + str r3, [r4, 0x8] + lsls r0, 24 + lsrs r0, 24 + bl sub_808E7E4 + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sA9_unknown + + thumb_func_start s5A_face_player +s5A_face_player: @ 809A9A4 + push {r4,lr} + ldr r2, =0x02037350 + ldr r0, =0x03005df0 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r4, r0, r2 + ldrb r0, [r4] + lsls r0, 31 + cmp r0, 0 + beq _0809A9CC + bl player_get_direction_lower_nybble + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectFaceOppositeDirection +_0809A9CC: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s5A_face_player + + thumb_func_start s5B_npc_set_direction +s5B_npc_set_direction: @ 809A9DC + push {r4,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldr r1, [r4, 0x8] + ldrb r3, [r1] + adds r1, 0x1 + str r1, [r4, 0x8] + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005d8c + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl FieldObjectTurnByLocalIdAndMap + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s5B_npc_set_direction + + thumb_func_start s65_set_sprite_behaviour +s65_set_sprite_behaviour: @ 809AA10 + push {r4,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldr r2, [r4, 0x8] + ldrb r1, [r2] + adds r2, 0x1 + str r2, [r4, 0x8] + lsls r0, 24 + lsrs r0, 24 + bl update_saveblock1_field_object_movement_behavior + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s65_set_sprite_behaviour + + thumb_func_start sAA_create_new_sprite +sAA_create_new_sprite: @ 809AA38 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x8 + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r1, [r0] + mov r8, r1 + adds r0, 0x1 + str r0, [r5, 0x8] + ldrb r6, [r0] + adds r0, 0x1 + str r0, [r5, 0x8] + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r3, r0, 0 + ldr r0, [r5, 0x8] + ldrb r2, [r0] + adds r0, 0x1 + str r0, [r5, 0x8] + ldrb r1, [r0] + adds r0, 0x1 + str r0, [r5, 0x8] + lsls r4, 16 + asrs r4, 16 + lsls r3, 16 + asrs r3, 16 + str r2, [sp] + str r1, [sp, 0x4] + mov r0, r8 + adds r1, r6, 0 + adds r2, r4, 0 + bl sprite_new + movs r0, 0 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sAA_create_new_sprite + + thumb_func_start sAB_unknown +sAB_unknown: @ 809AAA8 + push {lr} + ldr r2, [r0, 0x8] + ldrb r3, [r2] + adds r2, 0x1 + str r2, [r0, 0x8] + ldrb r1, [r2] + adds r2, 0x1 + str r2, [r0, 0x8] + adds r0, r3, 0 + bl sub_8097B78 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sAB_unknown + + thumb_func_start sub_809AAC4 +sub_809AAC4: @ 809AAC4 + push {r4,lr} + adds r4, r0, 0 + bl is_c1_link_related_active + cmp r0, 0 + bne _0809AAE4 + bl sub_80983E8 + ldr r1, =sub_80983C4 + adds r0, r4, 0 + bl script_setup_asm_script + movs r0, 0x1 + b _0809AAE6 + .pool +_0809AAE4: + movs r0, 0 +_0809AAE6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809AAC4 + + thumb_func_start sub_809AAEC +sub_809AAEC: @ 809AAEC + push {r4,lr} + adds r4, r0, 0 + bl is_c1_link_related_active + cmp r0, 0 + beq _0809AAFC + movs r0, 0 + b _0809AB3A +_0809AAFC: + ldr r2, =0x02037350 + ldr r0, =0x03005df0 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + beq _0809AB2C + bl sub_80984A0 + ldr r1, =sub_809847C + adds r0, r4, 0 + bl script_setup_asm_script + b _0809AB38 + .pool +_0809AB2C: + bl sub_80983E8 + ldr r1, =sub_80983C4 + adds r0, r4, 0 + bl script_setup_asm_script +_0809AB38: + movs r0, 0x1 +_0809AB3A: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809AAEC + + thumb_func_start s6B_release +s6B_release: @ 809AB44 + push {lr} + bl textbox_close + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + bl GetFieldObjectIdByLocalIdAndMap + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + bl FieldObjectClearAnimIfSpecialAnimFinished + bl sub_80D338C + bl sub_809757C + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end s6B_release + + thumb_func_start s6C_release_2 +s6C_release_2: @ 809AB7C + push {r4,lr} + bl textbox_close + ldr r4, =0x02037350 + ldr r0, =0x03005df0 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r4 + ldrb r0, [r1] + lsls r0, 31 + cmp r0, 0 + beq _0809AB9E + adds r0, r1, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished +_0809AB9E: + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + bl GetFieldObjectIdByLocalIdAndMap + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl FieldObjectClearAnimIfSpecialAnimFinished + bl sub_80D338C + bl sub_809757C + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s6C_release_2 + + thumb_func_start s67_execute_box +s67_execute_box: @ 809ABD4 + push {r4,lr} + adds r4, r0, 0 + bl script_read_word + cmp r0, 0 + bne _0809ABE2 + ldr r0, [r4, 0x64] +_0809ABE2: + bl box_related_two__2 + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s67_execute_box + + thumb_func_start sub_809ABF0 +sub_809ABF0: @ 809ABF0 + push {r4,lr} + adds r4, r0, 0 + bl script_read_word + cmp r0, 0 + bne _0809ABFE + ldr r0, [r4, 0x64] +_0809ABFE: + bl sub_8098238 + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809ABF0 + + thumb_func_start s9B_unknown +s9B_unknown: @ 809AC0C + push {r4,lr} + adds r4, r0, 0 + bl script_read_word + adds r3, r0, 0 + cmp r3, 0 + bne _0809AC1C + ldr r3, [r4, 0x64] +_0809AC1C: + ldr r2, =0x03003014 + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r2] + adds r0, r3, 0 + bl box_related_two__3 + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s9B_unknown + + thumb_func_start sub_809AC3C +sub_809AC3C: @ 809AC3C + push {r4,r5,lr} + sub sp, 0xC + adds r5, r0, 0 + bl script_read_word + adds r4, r0, 0 + cmp r4, 0 + bne _0809AC4E + ldr r4, [r5, 0x64] +_0809AC4E: + bl sub_81973A4 + movs r0, 0 + movs r1, 0x1 + bl sub_81973C4 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0 + bl Print + movs r0, 0 + add sp, 0xC + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809AC3C + + thumb_func_start sub_809AC78 +sub_809AC78: @ 809AC78 + push {lr} + ldr r1, =sub_809833C + bl script_setup_asm_script + movs r0, 0x1 + pop {r1} + bx r1 + .pool + thumb_func_end sub_809AC78 + + thumb_func_start s68_close_box +s68_close_box: @ 809AC8C + push {lr} + bl textbox_close + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s68_close_box + + thumb_func_start sub_809AC98 +sub_809AC98: @ 809AC98 + push {lr} + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0809ACB8 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0809ACB8 + movs r0, 0 + b _0809ACBA + .pool +_0809ACB8: + movs r0, 0x1 +_0809ACBA: + pop {r1} + bx r1 + thumb_func_end sub_809AC98 + + thumb_func_start sub_809ACC0 +sub_809ACC0: @ 809ACC0 + push {lr} + ldr r1, =sub_809AC98 + bl script_setup_asm_script + movs r0, 0x1 + pop {r1} + bx r1 + .pool + thumb_func_end sub_809ACC0 + + thumb_func_start s6E_yes_no +s6E_yes_no: @ 809ACD4 + push {lr} + ldr r2, [r0, 0x8] + ldrb r3, [r2] + adds r2, 0x1 + str r2, [r0, 0x8] + ldrb r1, [r2] + adds r2, 0x1 + str r2, [r0, 0x8] + adds r0, r3, 0 + bl yes_no_box + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809ACF6 + movs r0, 0 + b _0809ACFC +_0809ACF6: + bl script_env_2_set_ctx_paused + movs r0, 0x1 +_0809ACFC: + pop {r1} + bx r1 + thumb_func_end s6E_yes_no + + thumb_func_start s6F_multichoice +s6F_multichoice: @ 809AD00 + push {r4,r5,lr} + ldr r2, [r0, 0x8] + ldrb r5, [r2] + adds r2, 0x1 + str r2, [r0, 0x8] + ldrb r1, [r2] + adds r3, r2, 0x1 + str r3, [r0, 0x8] + ldrb r2, [r2, 0x1] + adds r4, r3, 0x1 + str r4, [r0, 0x8] + ldrb r3, [r3, 0x1] + adds r4, 0x1 + str r4, [r0, 0x8] + adds r0, r5, 0 + bl Multichoice + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809AD2E + movs r0, 0 + b _0809AD34 +_0809AD2E: + bl script_env_2_set_ctx_paused + movs r0, 0x1 +_0809AD34: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end s6F_multichoice + + thumb_func_start sub_809AD3C +sub_809AD3C: @ 809AD3C + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + ldr r2, [r0, 0x8] + ldrb r1, [r2] + mov r8, r1 + adds r2, 0x1 + str r2, [r0, 0x8] + ldrb r1, [r2] + adds r3, r2, 0x1 + str r3, [r0, 0x8] + ldrb r2, [r2, 0x1] + adds r5, r3, 0x1 + str r5, [r0, 0x8] + ldrb r6, [r3, 0x1] + adds r4, r5, 0x1 + str r4, [r0, 0x8] + ldrb r3, [r5, 0x1] + adds r4, 0x1 + str r4, [r0, 0x8] + str r6, [sp] + mov r0, r8 + bl sub_80E1E58 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809AD7A + movs r0, 0 + b _0809AD80 +_0809AD7A: + bl script_env_2_set_ctx_paused + movs r0, 0x1 +_0809AD80: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_809AD3C + + thumb_func_start sub_809AD8C +sub_809AD8C: @ 809AD8C + movs r0, 0 + bx lr + thumb_func_end sub_809AD8C + + thumb_func_start sub_809AD90 +sub_809AD90: @ 809AD90 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + ldr r2, [r0, 0x8] + ldrb r1, [r2] + mov r8, r1 + adds r2, 0x1 + str r2, [r0, 0x8] + ldrb r1, [r2] + adds r3, r2, 0x1 + str r3, [r0, 0x8] + ldrb r2, [r2, 0x1] + adds r5, r3, 0x1 + str r5, [r0, 0x8] + ldrb r6, [r3, 0x1] + adds r4, r5, 0x1 + str r4, [r0, 0x8] + ldrb r3, [r5, 0x1] + adds r4, 0x1 + str r4, [r0, 0x8] + str r6, [sp] + mov r0, r8 + bl sub_80E21D0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809ADCE + movs r0, 0 + b _0809ADD4 +_0809ADCE: + bl script_env_2_set_ctx_paused + movs r0, 0x1 +_0809ADD4: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_809AD90 + + thumb_func_start s73_nop_skip_word +s73_nop_skip_word: @ 809ADE0 + ldr r1, [r0, 0x8] + adds r1, 0x4 + str r1, [r0, 0x8] + movs r0, 0 + bx lr + thumb_func_end s73_nop_skip_word + + thumb_func_start sub_809ADEC +sub_809ADEC: @ 809ADEC + ldr r1, [r0, 0x8] + adds r1, 0x4 + str r1, [r0, 0x8] + movs r0, 0 + bx lr + thumb_func_end sub_809ADEC + + thumb_func_start sub_809ADF8 +sub_809ADF8: @ 809ADF8 + push {r4,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + ldr r3, [r4, 0x8] + ldrb r1, [r3] + adds r3, 0x1 + str r3, [r4, 0x8] + ldrb r2, [r3] + adds r3, 0x1 + str r3, [r4, 0x8] + bl sub_80E2900 + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809ADF8 + + thumb_func_start s76_close_picture_box +s76_close_picture_box: @ 809AE28 + push {r4,lr} + adds r4, r0, 0 + bl picbox_close + adds r1, r0, 0 + cmp r1, 0 + beq _0809AE40 + adds r0, r4, 0 + bl script_setup_asm_script + movs r0, 0x1 + b _0809AE42 +_0809AE40: + movs r0, 0 +_0809AE42: + pop {r4} + pop {r1} + bx r1 + thumb_func_end s76_close_picture_box + + thumb_func_start sub_809AE48 +sub_809AE48: @ 809AE48 + push {lr} + ldr r1, [r0, 0x8] + ldrb r2, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + cmp r2, 0 + beq _0809AE5C + adds r0, r2, 0 + bl sub_812FDA8 +_0809AE5C: + bl sub_80F8ADC + bl script_env_2_set_ctx_paused + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_809AE48 + + thumb_func_start sub_809AE6C +sub_809AE6C: @ 809AE6C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x20 + bl script_read_word + adds r1, r0, 0 + ldr r4, =0x02021fc4 + adds r1, 0x6 + adds r0, r4, 0 + bl ExpandStringRefs + movs r2, 0x1 + negs r2, r2 + movs r0, 0x6 + adds r1, r4, 0 + bl GetStringWidth + lsrs r0, 3 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x1C + bls _0809AE9C + movs r7, 0x1C +_0809AE9C: + movs r5, 0x4 + ldrb r0, [r4] + adds r2, r7, 0x2 + add r1, sp, 0x18 + mov r8, r1 + cmp r0, 0xFF + beq _0809AEC0 + adds r1, r4, 0 +_0809AEAC: + ldrb r0, [r1] + adds r1, 0x1 + cmp r0, 0xFE + bne _0809AEBA + adds r0, r5, 0x3 + lsls r0, 24 + lsrs r5, r0, 24 +_0809AEBA: + ldrb r0, [r1] + cmp r0, 0xFF + bne _0809AEAC +_0809AEC0: + cmp r5, 0x12 + bls _0809AEC6 + movs r5, 0x12 +_0809AEC6: + lsls r0, r2, 24 + lsrs r0, 24 + movs r2, 0x1E + subs r2, r0 + lsrs r0, r2, 31 + adds r2, r0 + asrs r2, 1 + lsls r2, 24 + adds r0, r5, 0x2 + lsls r0, 24 + lsrs r0, 24 + movs r4, 0x14 + subs r4, r0 + lsrs r0, r4, 31 + adds r4, r0 + asrs r4, 1 + lsls r4, 24 + lsrs r6, r2, 24 + movs r0, 0x80 + lsls r0, 17 + adds r2, r0 + lsrs r2, 24 + lsrs r3, r4, 24 + movs r1, 0x80 + lsls r1, 18 + adds r4, r1 + lsrs r4, 24 + subs r6, r2, r6 + subs r6, 0x1 + lsls r6, 3 + adds r6, 0x3 + lsls r6, 24 + lsrs r6, 24 + subs r4, r3 + subs r4, 0x1 + lsls r4, 27 + lsrs r4, 24 + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + str r7, [sp] + str r5, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + movs r0, 0x1 + str r0, [sp, 0xC] + add r0, sp, 0x10 + movs r1, 0 + bl sub_8198A50 + ldr r0, [sp, 0x10] + ldr r1, [sp, 0x14] + str r0, [sp, 0x18] + str r1, [sp, 0x1C] + ldr r5, =0x03000f30 + mov r0, r8 + bl AddWindow + strb r0, [r5] + ldrb r0, [r5] + movs r1, 0x85 + lsls r1, 2 + movs r2, 0xE0 + bl sub_809882C + ldrb r0, [r5] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r5] + bl PutWindowTilemap + ldrb r0, [r5] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldrb r0, [r5] + ldr r2, =0x02021fc4 + str r4, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x6 + adds r3, r6, 0 + bl Print + ldrb r0, [r5] + movs r1, 0x3 + bl CopyWindowToVram + movs r0, 0 + add sp, 0x20 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809AE6C + + thumb_func_start sub_809AF94 +sub_809AF94: @ 809AF94 + push {lr} + bl sub_809BDB4 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_809AF94 + + thumb_func_start sBD_virtual_message +sBD_virtual_message: @ 809AFA0 + push {lr} + bl script_read_word + ldr r1, =0x020375c4 + ldr r1, [r1] + subs r0, r1 + bl box_related_two__2 + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sBD_virtual_message + + thumb_func_start s7D_load_pokename +s7D_load_pokename: @ 809AFBC + push {r4,lr} + ldr r1, [r0, 0x8] + ldrb r4, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + ldr r1, =gUnknown_085102D4 + lsls r4, 2 + adds r4, r1 + ldr r2, [r4] + movs r1, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r2, 0 + bl CopyString + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s7D_load_pokename + + thumb_func_start s7E_load_first_pokenames +s7E_load_first_pokenames: @ 809AFFC + push {r4,lr} + ldr r1, [r0, 0x8] + ldrb r2, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + ldr r0, =gUnknown_085102D4 + lsls r2, 2 + adds r2, r0 + ldr r4, [r2] + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + movs r1, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r4, 0 + bl CopyString + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s7E_load_first_pokenames + + thumb_func_start s7F_load_pokename_team +s7F_load_pokename_team: @ 809B048 + push {r4,lr} + ldr r1, [r0, 0x8] + ldrb r4, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =gUnknown_085102D4 + lsls r4, 2 + adds r4, r1 + ldr r4, [r4] + movs r1, 0x2 + adds r2, r4, 0 + bl pokemon_getattr + adds r0, r4, 0 + bl GetStringEnd_Limit7 + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s7F_load_pokename_team + + thumb_func_start s80_load_item_name +s80_load_item_name: @ 809B090 + push {r4,lr} + ldr r1, [r0, 0x8] + ldrb r4, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + ldr r1, =gUnknown_085102D4 + lsls r4, 2 + adds r4, r1 + ldr r1, [r4] + bl itemid_get_name + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s80_load_item_name + + thumb_func_start sub_809B0C4 +sub_809B0C4: @ 809B0C4 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r6, [r0] + adds r0, 0x1 + str r0, [r5, 0x8] + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + ldr r0, =gUnknown_085102D4 + lsls r6, 2 + adds r6, r0 + ldr r1, [r6] + adds r0, r4, 0 + bl sub_80D6660 + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809B0C4 + + thumb_func_start sub_809B114 +sub_809B114: @ 809B114 + push {r4,lr} + ldr r1, [r0, 0x8] + ldrb r4, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r1, r0, 0 + lsls r1, 16 + ldr r0, =gUnknown_085102D4 + lsls r4, 2 + adds r4, r0 + ldr r0, [r4] + lsrs r1, 11 + ldr r2, =gUnknown_085A5C09 + adds r1, r2 + bl CopyString + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809B114 + + thumb_func_start s82_load_item_name +s82_load_item_name: @ 809B150 + push {r4,lr} + ldr r1, [r0, 0x8] + ldrb r4, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + ldr r1, =gUnknown_085102D4 + lsls r4, 2 + adds r4, r1 + ldr r2, [r4] + movs r1, 0xD + muls r1, r0 + ldr r0, =gMoveNames + adds r1, r0 + adds r0, r2, 0 + bl CopyString + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s82_load_item_name + + thumb_func_start s83_load_textvar_var +s83_load_textvar_var: @ 809B190 + push {r4,r5,lr} + ldr r1, [r0, 0x8] + ldrb r5, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r4, 0 + bl sub_80EF370 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =gUnknown_085102D4 + lsls r5, 2 + adds r5, r0 + ldr r0, [r5] + adds r1, r4, 0 + movs r2, 0 + bl ConvertIntToDecimalString + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end s83_load_textvar_var + + thumb_func_start s84_load_textvar_std_expression +s84_load_textvar_std_expression: @ 809B1D4 + push {r4,lr} + ldr r1, [r0, 0x8] + ldrb r4, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + ldr r1, =gUnknown_085102D4 + lsls r4, 2 + adds r4, r1 + ldr r2, [r4] + ldr r1, =gUnknown_0858BAF0 + lsrs r0, 14 + adds r0, r1 + ldr r1, [r0] + adds r0, r2, 0 + bl CopyString + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s84_load_textvar_std_expression + + thumb_func_start sub_809B214 +sub_809B214: @ 809B214 + push {r4,lr} + ldr r1, [r0, 0x8] + ldrb r4, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r1, r0, 0 + ldr r0, =gUnknown_085102D4 + lsls r4, 2 + adds r4, r0 + ldr r0, [r4] + lsls r1, 24 + lsrs r1, 24 + bl sub_818E868 + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809B214 + + thumb_func_start s85_load_textvar_pointer +s85_load_textvar_pointer: @ 809B248 + push {r4,lr} + ldr r1, [r0, 0x8] + ldrb r4, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl script_read_word + adds r1, r0, 0 + ldr r0, =gUnknown_085102D4 + lsls r4, 2 + adds r4, r0 + ldr r0, [r4] + bl CopyString + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s85_load_textvar_pointer + + thumb_func_start sBE_virtual_load_text +sBE_virtual_load_text: @ 809B270 + push {lr} + bl script_read_word + adds r1, r0, 0 + ldr r0, =0x020375c4 + ldr r0, [r0] + subs r1, r0 + ldr r0, =0x02021fc4 + bl ExpandStringRefs + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sBE_virtual_load_text + + thumb_func_start sBF_virtual_load_textbuffer +sBF_virtual_load_textbuffer: @ 809B294 + push {r4,lr} + ldr r1, [r0, 0x8] + ldrb r4, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl script_read_word + adds r1, r0, 0 + ldr r0, =0x020375c4 + ldr r0, [r0] + subs r1, r0 + ldr r0, =gUnknown_085102D4 + lsls r4, 2 + adds r4, r0 + ldr r0, [r4] + bl CopyString + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sBF_virtual_load_textbuffer + + thumb_func_start sC6_load_textvar_box_label +sC6_load_textvar_box_label: @ 809B2C8 + push {r4,lr} + ldr r1, [r0, 0x8] + ldrb r4, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldr r1, =gUnknown_085102D4 + lsls r4, 2 + adds r4, r1 + ldr r4, [r4] + lsls r0, 24 + lsrs r0, 24 + bl sav3_get_box_name + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sC6_load_textvar_box_label + + thumb_func_start s79_give_pokemon +s79_give_pokemon: @ 809B304 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x8 + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r6, r0, 0 + lsls r6, 16 + lsrs r6, 16 + ldr r0, [r4, 0x8] + ldrb r1, [r0] + mov r9, r1 + adds r0, 0x1 + str r0, [r4, 0x8] + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + bl script_read_word + mov r8, r0 + adds r0, r4, 0 + bl script_read_word + ldr r1, [r4, 0x8] + ldrb r2, [r1] + adds r1, 0x1 + str r1, [r4, 0x8] + ldr r4, =0x020375f0 + str r0, [sp] + str r2, [sp, 0x4] + adds r0, r6, 0 + mov r1, r9 + adds r2, r5, 0 + mov r3, r8 + bl sub_80F9244 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + movs r0, 0 + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end s79_give_pokemon + + thumb_func_start s7A_create_egg +s7A_create_egg: @ 809B384 + push {r4,lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + ldr r4, =0x020375f0 + bl sub_80F92C8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s7A_create_egg + + thumb_func_start s7B_change_pokedata_AP +s7B_change_pokedata_AP: @ 809B3B0 + push {r4,r5,lr} + ldr r1, [r0, 0x8] + ldrb r5, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + ldrb r4, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl script_read_halfword + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + adds r2, r4, 0 + bl sub_80F9400 + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end s7B_change_pokedata_AP + + thumb_func_start sub_809B3DC +sub_809B3DC: @ 809B3DC + push {r4-r7,lr} + bl script_read_halfword + lsls r0, 16 + lsrs r7, r0, 16 + ldr r1, =0x020375f0 + movs r0, 0x6 + strh r0, [r1] + movs r6, 0 + b _0809B42A + .pool +_0809B3F4: + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _0809B424 + adds r0, r4, 0 + adds r1, r7, 0 + bl pokemon_has_move + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809B424 + ldr r0, =0x020375f0 + strh r6, [r0] + ldr r0, =0x020375e0 + strh r5, [r0] + b _0809B44A + .pool +_0809B424: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0809B42A: + cmp r6, 0x5 + bhi _0809B44A + movs r0, 0x64 + adds r1, r6, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + bne _0809B3F4 +_0809B44A: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809B3DC + + thumb_func_start s90_add_money +@ int s90_add_money(script_env *env) +s90_add_money: @ 809B458 + push {r4,lr} + adds r4, r0, 0 + bl script_read_word + adds r2, r0, 0 + ldr r0, [r4, 0x8] + ldrb r1, [r0] + adds r0, 0x1 + str r0, [r4, 0x8] + cmp r1, 0 + bne _0809B47E + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + adds r1, r2, 0 + bl add_money +_0809B47E: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s90_add_money + + thumb_func_start s91_subtract_money +@ int s91_subtract_money(script_env *env) +s91_subtract_money: @ 809B48C + push {r4,lr} + adds r4, r0, 0 + bl script_read_word + adds r2, r0, 0 + ldr r0, [r4, 0x8] + ldrb r1, [r0] + adds r0, 0x1 + str r0, [r4, 0x8] + cmp r1, 0 + bne _0809B4B2 + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + adds r1, r2, 0 + bl subtract_money +_0809B4B2: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s91_subtract_money + + thumb_func_start s92_check_money +@ int s92_check_money(script_env *env) +s92_check_money: @ 809B4C0 + push {r4,lr} + adds r4, r0, 0 + bl script_read_word + adds r2, r0, 0 + ldr r0, [r4, 0x8] + ldrb r1, [r0] + adds r0, 0x1 + str r0, [r4, 0x8] + cmp r1, 0 + bne _0809B4EE + ldr r4, =0x020375f0 + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + adds r1, r2, 0 + bl IsEnoughMoney + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] +_0809B4EE: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s92_check_money + + thumb_func_start s93_display_money +@ int s93_display_money(script_env *env) +s93_display_money: @ 809B500 + push {r4,r5,lr} + ldr r1, [r0, 0x8] + ldrb r5, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + ldrb r4, [r1] + adds r2, r1, 0x1 + str r2, [r0, 0x8] + ldrb r1, [r1, 0x1] + adds r2, 0x1 + str r2, [r0, 0x8] + cmp r1, 0 + bne _0809B530 + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + bl DecryptMoney + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_80E52EC +_0809B530: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end s93_display_money + + thumb_func_start s94_hide_money +s94_hide_money: @ 809B53C + push {lr} + bl sub_80E5384 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s94_hide_money + + thumb_func_start s95_update_money +@ int s95_update_money(script_env *env) +s95_update_money: @ 809B548 + push {lr} + ldr r1, [r0, 0x8] + adds r1, 0x1 + adds r2, r1, 0x1 + str r2, [r0, 0x8] + ldrb r1, [r1, 0x1] + adds r2, 0x1 + str r2, [r0, 0x8] + cmp r1, 0 + bne _0809B56E + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + bl DecryptMoney + bl sub_80E52D4 +_0809B56E: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end s95_update_money + + thumb_func_start sub_809B578 +sub_809B578: @ 809B578 + push {r4,r5,lr} + ldr r1, [r0, 0x8] + ldrb r5, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + ldrb r4, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl GetCoins + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + adds r2, r4, 0 + bl ShowCoinsWindow + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809B578 + + thumb_func_start sC1_hide_coins +sC1_hide_coins: @ 809B5A0 + push {lr} + ldr r1, [r0, 0x8] + adds r1, 0x2 + str r1, [r0, 0x8] + bl HideCoinsWindow + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sC1_hide_coins + + thumb_func_start sC2_update_coins +sC2_update_coins: @ 809B5B4 + push {lr} + ldr r1, [r0, 0x8] + adds r1, 0x2 + str r1, [r0, 0x8] + bl GetCoins + lsls r0, 16 + lsrs r0, 16 + bl PrintCoinsString + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sC2_update_coins + + thumb_func_start s5C_trainer_battle_configure_and_start +s5C_trainer_battle_configure_and_start: @ 809B5D0 + push {r4,lr} + adds r4, r0, 0 + ldr r0, [r4, 0x8] + bl TrainerBattleConfigure + str r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s5C_trainer_battle_configure_and_start + + thumb_func_start sub_809B5E4 +sub_809B5E4: @ 809B5E4 + push {lr} + bl sub_80B17E0 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_809B5E4 + + thumb_func_start sub_809B5F0 +sub_809B5F0: @ 809B5F0 + push {r4,lr} + adds r4, r0, 0 + bl sub_80B1AF8 + str r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809B5F0 + + thumb_func_start sub_809B604 +@ bool8 sub_809B604(struct script_env *env) +sub_809B604: @ 809B604 + push {r4,lr} + adds r4, r0, 0 + bl sub_80B1B10 + str r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809B604 + + thumb_func_start s60_check_trainer_flag +s60_check_trainer_flag: @ 809B618 + push {r4,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + bl trainer_flag_check + strb r0, [r4, 0x2] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s60_check_trainer_flag + + thumb_func_start s61_set_trainer_flag +s61_set_trainer_flag: @ 809B63C + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + bl trainer_flag_set + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s61_set_trainer_flag + + thumb_func_start s62_unset_trainer_flag +s62_unset_trainer_flag: @ 809B658 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + bl trainer_flag_clear + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s62_unset_trainer_flag + + thumb_func_start sB6_load_battle +sB6_load_battle: @ 809B674 + push {r4-r6,lr} + adds r4, r0, 0 + bl script_read_halfword + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + ldr r0, [r4, 0x8] + ldrb r6, [r0] + adds r0, 0x1 + str r0, [r4, 0x8] + adds r0, r4, 0 + bl script_read_halfword + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_80F93A0 + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sB6_load_battle + + thumb_func_start sub_809B6A8 +sub_809B6A8: @ 809B6A8 + push {lr} + bl sub_80B08A8 + bl script_env_2_set_ctx_paused + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_809B6A8 + + thumb_func_start s86_pokemart +s86_pokemart: @ 809B6B8 + push {lr} + bl script_read_word + bl CreatePokemartMenu + bl script_env_2_set_ctx_paused + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end s86_pokemart + + thumb_func_start s87_pokemartdecor +s87_pokemartdecor: @ 809B6CC + push {lr} + bl script_read_word + bl CreateDecorationShop1Menu + bl script_env_2_set_ctx_paused + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end s87_pokemartdecor + + thumb_func_start s88_pokemartbp +s88_pokemartbp: @ 809B6E0 + push {lr} + bl script_read_word + bl CreateDecorationShop2Menu + bl script_env_2_set_ctx_paused + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end s88_pokemartbp + + thumb_func_start s89_open_casino_game1 +s89_open_casino_game1: @ 809B6F4 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 24 + lsrs r0, 24 + ldr r1, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl sub_812A540 + bl script_env_2_set_ctx_paused + movs r0, 0x1 + pop {r1} + bx r1 + .pool + thumb_func_end s89_open_casino_game1 + + thumb_func_start berry_script_cmd +@ bool8 berry_script_cmd(struct script_env *env) +berry_script_cmd: @ 809B71C + push {r4,r5,lr} + ldr r1, [r0, 0x8] + ldrb r5, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + ldrb r3, [r1] + adds r2, r1, 0x1 + str r2, [r0, 0x8] + ldrb r4, [r1, 0x1] + adds r2, 0x1 + str r2, [r0, 0x8] + cmp r3, 0 + bne _0809B744 + adds r0, r5, 0 + movs r1, 0 + adds r2, r4, 0 + movs r3, 0 + bl PlantBerryTree + b _0809B750 +_0809B744: + adds r0, r5, 0 + adds r1, r3, 0 + adds r2, r4, 0 + movs r3, 0 + bl PlantBerryTree +_0809B750: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end berry_script_cmd + + thumb_func_start sub_809B758 +sub_809B758: @ 809B758 + push {r4,lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldr r4, =0x020375f0 + lsls r0, 24 + lsrs r0, 24 + bl GetPriceReduction + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809B758 + + thumb_func_start sub_809B784 +sub_809B784: @ 809B784 + push {lr} + bl sub_81B9404 + bl script_env_2_set_ctx_paused + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_809B784 + + thumb_func_start sub_809B794 +sub_809B794: @ 809B794 + push {lr} + bl sub_80F840C + bl script_env_2_set_ctx_paused + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_809B794 + + thumb_func_start sub_809B7A4 +sub_809B7A4: @ 809B7A4 + push {lr} + bl sub_80F8484 + bl script_env_2_set_ctx_paused + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_809B7A4 + + thumb_func_start sub_809B7B4 +sub_809B7B4: @ 809B7B4 + push {lr} + ldr r0, =0x02039f2c + ldrb r0, [r0] + bl sub_80F84C4 + bl script_env_2_set_ctx_paused + movs r0, 0x1 + pop {r1} + bx r1 + .pool + thumb_func_end sub_809B7B4 + + thumb_func_start s9C_execute_HM +s9C_execute_HM: @ 809B7CC + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x020375d0 + strh r0, [r1] + lsls r0, 24 + lsrs r0, 24 + bl FieldEffectStart + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end s9C_execute_HM + + thumb_func_start s9D_set_HM_animation_data +s9D_set_HM_animation_data: @ 809B7F4 + push {r4,lr} + ldr r1, [r0, 0x8] + ldrb r4, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldr r1, =0x02038c08 + lsls r4, 2 + adds r4, r1 + lsls r0, 16 + asrs r0, 16 + str r0, [r4] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s9D_set_HM_animation_data + + thumb_func_start sub_809B824 +sub_809B824: @ 809B824 + push {lr} + ldr r0, =0x020375d0 + ldrb r0, [r0] + bl FieldEffectActiveListContains + lsls r0, 24 + cmp r0, 0 + beq _0809B83C + movs r0, 0 + b _0809B83E + .pool +_0809B83C: + movs r0, 0x1 +_0809B83E: + pop {r1} + bx r1 + thumb_func_end sub_809B824 + + thumb_func_start s9E_checkarray_HM_animation +s9E_checkarray_HM_animation: @ 809B844 + push {r4,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldr r1, =0x020375d0 + strh r0, [r1] + ldr r1, =sub_809B824 + adds r0, r4, 0 + bl script_setup_asm_script + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s9E_checkarray_HM_animation + + thumb_func_start s9F_changeposition_fly +s9F_changeposition_fly: @ 809B870 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 24 + lsrs r0, 24 + bl sub_8084D1C + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s9F_changeposition_fly + + thumb_func_start sA0_check_gender +sA0_check_gender: @ 809B88C + ldr r1, =0x020375f0 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + strh r0, [r1] + movs r0, 0 + bx lr + .pool + thumb_func_end sA0_check_gender + + thumb_func_start sA1_play_cry +sA1_play_cry: @ 809B8A4 + push {r4,r5,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_80A3404 + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sA1_play_cry + + thumb_func_start sub_809B8DC +sub_809B8DC: @ 809B8DC + push {lr} + ldr r1, =sub_80A3678 + bl script_setup_asm_script + movs r0, 0x1 + pop {r1} + bx r1 + .pool + thumb_func_end sub_809B8DC + + thumb_func_start sA2_setmaptile +sA2_setmaptile: @ 809B8F0 + push {r4-r7,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r6, r0, 16 + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r7, r0, 16 + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + adds r1, r6, 0x7 + lsls r1, 16 + lsrs r6, r1, 16 + adds r1, r5, 0x7 + lsls r1, 16 + lsrs r5, r1, 16 + cmp r0, 0 + bne _0809B954 + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r7, 0 + bl MapGridSetMetatileIdAt + b _0809B966 +_0809B954: + movs r1, 0xC0 + lsls r1, 4 + adds r0, r1, 0 + adds r2, r7, 0 + orrs r2, r0 + adds r0, r6, 0 + adds r1, r5, 0 + bl MapGridSetMetatileIdAt +_0809B966: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sA2_setmaptile + + thumb_func_start sAC_open_door +sAC_open_door: @ 809B970 + push {r4,r5,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + adds r5, 0x7 + lsls r5, 16 + lsrs r5, 16 + movs r0, 0xE0 + lsls r0, 11 + adds r4, r0 + lsrs r4, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl cur_mapdata_get_door_sound_at + lsls r0, 16 + lsrs r0, 16 + bl audio_play + adds r0, r5, 0 + adds r1, r4, 0 + bl task_overworld_door_add_if_role_69_for_opening_door_at + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sAC_open_door + + thumb_func_start sub_809B9C8 +sub_809B9C8: @ 809B9C8 + push {r4,r5,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r1, r0, 0 + lsls r1, 16 + adds r4, 0x7 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0xE0 + lsls r0, 11 + adds r1, r0 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_808A8AC + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809B9C8 + + thumb_func_start sub_809BA0C +sub_809BA0C: @ 809BA0C + push {lr} + bl sub_808A91C + lsls r0, 24 + cmp r0, 0 + beq _0809BA1C + movs r0, 0 + b _0809BA1E +_0809BA1C: + movs r0, 0x1 +_0809BA1E: + pop {r1} + bx r1 + thumb_func_end sub_809BA0C + + thumb_func_start sub_809BA24 +sub_809BA24: @ 809BA24 + push {lr} + ldr r1, =sub_809BA0C + bl script_setup_asm_script + movs r0, 0x1 + pop {r1} + bx r1 + .pool + thumb_func_end sub_809BA24 + + thumb_func_start sub_809BA38 +sub_809BA38: @ 809BA38 + push {r4,r5,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r1, r0, 0 + lsls r1, 16 + adds r4, 0x7 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0xE0 + lsls r0, 11 + adds r1, r0 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_808A854 + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809BA38 + + thumb_func_start sub_809BA7C +sub_809BA7C: @ 809BA7C + push {r4,r5,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r1, r0, 0 + lsls r1, 16 + adds r4, 0x7 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0xE0 + lsls r0, 11 + adds r1, r0 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_808A880 + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809BA7C + + thumb_func_start sub_809BAC0 +sub_809BAC0: @ 809BAC0 + push {r4,lr} + adds r4, r0, 0 + ldr r0, [r4, 0x8] + adds r0, 0x1 + str r0, [r4, 0x8] + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809BAC0 + + thumb_func_start sub_809BAFC +sub_809BAFC: @ 809BAFC + movs r0, 0 + bx lr + thumb_func_end sub_809BAFC + + thumb_func_start sB3_get_coin_amount +sB3_get_coin_amount: @ 809BB00 + push {r4,lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl GetVarPointer + adds r4, r0, 0 + bl GetCoins + strh r0, [r4] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sB3_get_coin_amount + + thumb_func_start sub_809BB20 +sub_809BB20: @ 809BB20 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + bl AddCoins + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809BB48 + ldr r1, =0x020375f0 + movs r0, 0 + b _0809BB4C + .pool +_0809BB48: + ldr r1, =0x020375f0 + movs r0, 0x1 +_0809BB4C: + strh r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_809BB20 + + thumb_func_start sub_809BB58 +sub_809BB58: @ 809BB58 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + bl SubtractCoins + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809BB80 + ldr r1, =0x020375f0 + movs r0, 0 + b _0809BB84 + .pool +_0809BB80: + ldr r1, =0x020375f0 + movs r0, 0x1 +_0809BB84: + strh r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_809BB58 + + thumb_func_start sub_809BB90 +sub_809BB90: @ 809BB90 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 24 + lsrs r0, 24 + bl sub_81A89A0 + ldr r1, =0x020375ca + strh r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_809BB90 + + thumb_func_start sub_809BBB4 +sub_809BBB4: @ 809BBB4 + push {lr} + bl sub_81A8AF8 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_809BBB4 + + thumb_func_start ScrCmd_MossdeepGymSwitch +ScrCmd_MossdeepGymSwitch: @ 809BBC0 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 24 + lsrs r0, 24 + bl sub_81A8934 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end ScrCmd_MossdeepGymSwitch + + thumb_func_start sub_809BBDC +sub_809BBDC: @ 809BBDC + push {lr} + bl sub_81A895C + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_809BBDC + + thumb_func_start sub_809BBE8 +sub_809BBE8: @ 809BBE8 + push {lr} + bl sub_80B47BC + ldr r1, =0x03005df0 + strb r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_809BBE8 + + thumb_func_start sub_809BBFC +sub_809BBFC: @ 809BBFC + push {r4,lr} + adds r4, r0, 0 + bl is_c1_link_related_active + cmp r0, 0 + beq _0809BC0C + movs r0, 0 + b _0809BC30 +_0809BC0C: + ldr r2, =0x02037350 + ldr r0, =0x03005df0 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + beq _0809BC2E + bl sub_8098630 + ldr r1, =sub_8098734 + adds r0, r4, 0 + bl script_setup_asm_script +_0809BC2E: + movs r0, 0x1 +_0809BC30: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809BBFC + + thumb_func_start sCD_set_obedient_bit +sCD_set_obedient_bit: @ 809BC44 + push {lr} + sub sp, 0x4 + movs r2, 0x1 + mov r1, sp + strb r2, [r1] + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x50 + mov r2, sp + bl pokemon_setattr + movs r0, 0 + add sp, 0x4 + pop {r1} + bx r1 + .pool + thumb_func_end sCD_set_obedient_bit + + thumb_func_start sCE_check_obedient_bit +sCE_check_obedient_bit: @ 809BC7C + push {r4,lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + ldr r4, =0x020375f0 + movs r1, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x50 + movs r2, 0 + bl pokemon_getattr + strh r0, [r4] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sCE_check_obedient_bit + + thumb_func_start sCF_execute_RAM_script_DMA +sCF_execute_RAM_script_DMA: @ 809BCB4 + push {r4,lr} + adds r4, r0, 0 + bl sub_8099244 + adds r2, r0, 0 + cmp r2, 0 + beq _0809BCD0 + ldr r1, =0x020375c0 + ldr r0, [r4, 0x8] + str r0, [r1] + adds r0, r4, 0 + adds r1, r2, 0 + bl script_jump +_0809BCD0: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sCF_execute_RAM_script_DMA + + thumb_func_start sD1_warp_v5 +sD1_warp_v5: @ 809BCDC + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r1, [r0] + mov r9, r1 + adds r0, 0x1 + str r0, [r5, 0x8] + ldrb r1, [r0] + mov r8, r1 + adds r1, r0, 0x1 + str r1, [r5, 0x8] + ldrb r6, [r0, 0x1] + adds r1, 0x1 + str r1, [r5, 0x8] + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + mov r1, r9 + lsls r1, 24 + asrs r1, 24 + mov r9, r1 + mov r1, r8 + lsls r1, 24 + asrs r1, 24 + mov r8, r1 + lsls r6, 24 + asrs r6, 24 + lsls r4, 24 + asrs r4, 24 + lsls r0, 24 + asrs r0, 24 + str r0, [sp] + mov r0, r9 + adds r2, r6, 0 + adds r3, r4, 0 + bl warp1_set + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + bl sub_808D074 + bl sub_80B0244 + bl player_avatar_init_params_reset + movs r0, 0x1 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sD1_warp_v5 + + thumb_func_start sub_809BD70 +sub_809BD70: @ 809BD70 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r3, r0, 16 + ldr r0, [r4, 0x8] + ldrb r2, [r0] + mov r1, sp + strb r2, [r1] + adds r0, 0x1 + str r0, [r4, 0x8] + cmp r3, 0x5 + bhi _0809BDA6 + movs r0, 0x64 + muls r0, r3 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x23 + mov r2, sp + bl pokemon_setattr +_0809BDA6: + movs r0, 0 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809BD70 + + thumb_func_start sub_809BDB4 +sub_809BDB4: @ 809BDB4 + push {r4,lr} + ldr r4, =0x03000f30 + ldrb r0, [r4] + movs r1, 0x1 + bl sub_819746C + ldrb r0, [r4] + bl RemoveWindow + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809BDB4 + + thumb_func_start sub_809BDD0 +sub_809BDD0: @ 809BDD0 + push {r4,lr} + ldr r1, [r0, 0x8] + ldrb r4, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + ldr r1, =gUnknown_085102D4 + lsls r4, 2 + adds r4, r1 + ldr r4, [r4] + bl sub_806F07C + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809BDD0 + + thumb_func_start sub_809BE0C +sub_809BE0C: @ 809BE0C + push {r4,lr} + ldr r1, [r0, 0x8] + ldrb r4, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + ldr r1, =gUnknown_085102D4 + lsls r4, 2 + adds r4, r1 + ldr r4, [r4] + bl sub_806F0B0 + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809BE0C + + thumb_func_start sub_809BE48 +sub_809BE48: @ 809BE48 + ldr r1, =0x020375ca + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_809BE48 + + thumb_func_start sub_809BE54 +sub_809BE54: @ 809BE54 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r1, [r0] + mov r9, r1 + adds r0, 0x1 + str r0, [r5, 0x8] + ldrb r1, [r0] + mov r8, r1 + adds r1, r0, 0x1 + str r1, [r5, 0x8] + ldrb r6, [r0, 0x1] + adds r1, 0x1 + str r1, [r5, 0x8] + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + mov r1, r9 + lsls r1, 24 + asrs r1, 24 + mov r9, r1 + mov r1, r8 + lsls r1, 24 + asrs r1, 24 + mov r8, r1 + lsls r6, 24 + asrs r6, 24 + lsls r4, 24 + asrs r4, 24 + lsls r0, 24 + asrs r0, 24 + str r0, [sp] + mov r0, r9 + adds r2, r6, 0 + adds r3, r4, 0 + bl warp1_set + bl sub_80AF79C + bl player_avatar_init_params_reset + movs r0, 0x1 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_809BE54 + + thumb_func_start sub_809BEDC +sub_809BEDC: @ 809BEDC + push {r4,r5,lr} + movs r1, 0x2 + negs r1, r1 + movs r3, 0x3 + negs r3, r3 + movs r4, 0x5 + negs r4, r4 + movs r5, 0x9 + negs r5, r5 + movs r2, 0 + strb r2, [r0] + ldrb r2, [r0, 0x1] + ands r1, r2 + ands r1, r3 + ands r1, r4 + ands r1, r5 + strb r1, [r0, 0x1] + movs r1, 0 + strb r1, [r0, 0x2] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_809BEDC + + thumb_func_start process_overworld_input +@ void process_overworld_input(overworld_input_data *input_data, char buttons_new, char buttons_held) +process_overworld_input: @ 809BF08 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r4, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + lsls r2, 16 + lsrs r2, 16 + mov r8, r2 + ldr r0, =0x02037590 + ldrb r6, [r0, 0x3] + ldrb r0, [r0, 0x2] + mov r9, r0 + bl cur_mapdata_block_role_at_player_pos + lsls r0, 24 + lsrs r0, 24 + bl sub_808904C + lsls r0, 24 + lsrs r7, r0, 24 + cmp r6, 0x2 + bne _0809BF3C + cmp r7, 0 + beq _0809BF40 +_0809BF3C: + cmp r6, 0 + bne _0809BFA2 +_0809BF40: + bl sub_811A138 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + beq _0809BF8C + movs r0, 0x8 + ands r0, r5 + cmp r0, 0 + beq _0809BF5C + ldrb r0, [r4] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4] +_0809BF5C: + movs r0, 0x4 + ands r0, r5 + cmp r0, 0 + beq _0809BF6C + ldrb r0, [r4] + movs r1, 0x8 + orrs r0, r1 + strb r0, [r4] +_0809BF6C: + movs r0, 0x1 + ands r0, r5 + cmp r0, 0 + beq _0809BF7C + ldrb r0, [r4] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r4] +_0809BF7C: + movs r0, 0x2 + ands r0, r5 + cmp r0, 0 + beq _0809BF8C + ldrb r0, [r4] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r4] +_0809BF8C: + movs r0, 0xF0 + mov r1, r8 + ands r0, r1 + cmp r0, 0 + beq _0809BFA2 + ldrb r0, [r4] + movs r1, 0x10 + orrs r0, r1 + movs r1, 0x20 + orrs r0, r1 + strb r0, [r4] +_0809BFA2: + cmp r7, 0 + bne _0809BFC8 + cmp r6, 0x2 + bne _0809BFB8 + mov r0, r9 + cmp r0, 0x2 + bne _0809BFB8 + ldrb r0, [r4] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r4] +_0809BFB8: + cmp r7, 0 + bne _0809BFC8 + cmp r6, 0x2 + bne _0809BFC8 + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] +_0809BFC8: + movs r0, 0x40 + mov r1, r8 + ands r0, r1 + cmp r0, 0 + beq _0809BFDC + movs r0, 0x2 + b _0809C004 + .pool +_0809BFDC: + movs r0, 0x80 + mov r1, r8 + ands r0, r1 + cmp r0, 0 + beq _0809BFEA + movs r0, 0x1 + b _0809C004 +_0809BFEA: + movs r0, 0x20 + mov r1, r8 + ands r0, r1 + cmp r0, 0 + beq _0809BFF8 + movs r0, 0x3 + b _0809C004 +_0809BFF8: + movs r0, 0x10 + mov r1, r8 + ands r0, r1 + cmp r0, 0 + beq _0809C006 + movs r0, 0x4 +_0809C004: + strb r0, [r4, 0x2] +_0809C006: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end process_overworld_input + + thumb_func_start sub_809C014 +@ int sub_809C014(overworld_input_data *input_data) +sub_809C014: @ 809C014 + push {r4-r6,lr} + sub sp, 0x8 + adds r5, r0, 0 + ldr r0, =0x020375f2 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x03005df0 + strb r1, [r0] + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r6, r0, 24 + mov r4, sp + mov r0, sp + bl player_get_pos_to_and_height + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 16 + lsrs r4, r0, 16 + bl CheckForTrainersWantingBattle + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809C14E + bl mapheader_run_first_tag2_script_list_match + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809C14E + ldrb r1, [r5] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0809C070 + bl sub_809C89C + cmp r0, 0x1 + beq _0809C14E +_0809C070: + ldrb r1, [r5] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0809C096 + movs r0, 0x5 + bl sav12_xor_increment + bl increment_var_x4026_on_birth_island_modulo_100 + mov r0, sp + adds r1, r4, 0 + adds r2, r6, 0 + bl sub_809C8DC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809C14E +_0809C096: + ldrb r1, [r5] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0809C0AE + adds r0, r4, 0 + bl is_it_battle_time_3 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809C14E +_0809C0AE: + ldrb r1, [r5] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0809C0D0 + ldrb r0, [r5, 0x2] + cmp r0, r6 + bne _0809C0D0 + mov r0, sp + adds r1, r4, 0 + adds r2, r6, 0 + bl mapheader_run_first_tag2_script_list_match_conditionally + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809C14E +_0809C0D0: + mov r4, sp + mov r0, sp + bl player_get_next_pos_and_height + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 16 + lsrs r4, r0, 16 + ldrb r1, [r5] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0809C106 + mov r0, sp + adds r1, r4, 0 + adds r2, r6, 0 + bl sub_809C1FC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809C14E +_0809C106: + ldrb r1, [r5] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0809C128 + ldrb r0, [r5, 0x2] + cmp r0, r6 + bne _0809C128 + mov r0, sp + adds r1, r4, 0 + adds r2, r6, 0 + bl map_warp_consider_2_to_inside + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809C14E +_0809C128: + ldrb r1, [r5] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0809C13A + bl sub_809C868 + cmp r0, 0x1 + beq _0809C14E +_0809C13A: + ldrb r1, [r5] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0809C15C + movs r0, 0x6 + bl audio_play + bl sub_809FA9C +_0809C14E: + movs r0, 0x1 + b _0809C172 + .pool +_0809C15C: + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0809C170 + bl UseRegisteredKeyItemOnField + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809C14E +_0809C170: + movs r0, 0 +_0809C172: + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_809C014 + + thumb_func_start player_get_pos_to_and_height +player_get_pos_to_and_height: @ 809C17C + push {r4,lr} + adds r4, r0, 0 + adds r1, r4, 0x2 + bl PlayerGetDestCoords + bl PlayerGetZCoord + strb r0, [r4, 0x4] + pop {r4} + pop {r0} + bx r0 + thumb_func_end player_get_pos_to_and_height + + thumb_func_start player_get_next_pos_and_height +player_get_next_pos_and_height: @ 809C194 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r1, r5, 0x2 + bl GetXYCoordsOneStepInFrontOfPlayer + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl MapGridGetZCoordAt + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _0809C1C6 + bl PlayerGetZCoord +_0809C1C6: + strb r0, [r5, 0x4] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end player_get_next_pos_and_height + + thumb_func_start cur_mapdata_block_role_at_player_pos +cur_mapdata_block_role_at_player_pos: @ 809C1D0 + push {r4,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 16 + lsrs r0, 16 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end cur_mapdata_block_role_at_player_pos + + thumb_func_start sub_809C1FC +sub_809C1FC: @ 809C1FC + push {r4,lr} + lsls r2, 24 + lsrs r2, 24 + lsls r1, 24 + lsrs r1, 24 + bl TryGetScriptOnPressingA + adds r4, r0, 0 + cmp r4, 0 + bne _0809C214 + movs r0, 0 + b _0809C24C +_0809C214: + ldr r0, =gUnknown_081F860D + cmp r4, r0 + beq _0809C244 + ldr r0, =gUnknown_081F9553 + cmp r4, r0 + beq _0809C244 + ldr r0, =gUnknown_0823B4BB + cmp r4, r0 + beq _0809C244 + ldr r0, =gUnknown_0823B589 + cmp r4, r0 + beq _0809C244 + ldr r0, =gUnknown_082766A2 + cmp r4, r0 + beq _0809C244 + ldr r0, =gUnknown_082766A6 + cmp r4, r0 + beq _0809C244 + ldr r0, =gUnknown_08271D92 + cmp r4, r0 + beq _0809C244 + movs r0, 0x5 + bl audio_play +_0809C244: + adds r0, r4, 0 + bl script_env_1_execute_new_script + movs r0, 0x1 +_0809C24C: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809C1FC + + thumb_func_start TryGetScriptOnPressingA +TryGetScriptOnPressingA: @ 809C270 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + mov r8, r5 + lsls r2, 24 + lsrs r4, r2, 24 + adds r7, r4, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl TryGetMapObjectScript + cmp r0, 0 + bne _0809C2BC + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl TryGetInvisibleMapObjectScript + cmp r0, 0 + bne _0809C2BC + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl TryGetMetatileBehaviorScript + cmp r0, 0 + bne _0809C2BC + adds r0, r6, 0 + mov r1, r8 + adds r2, r7, 0 + bl TryGetFieldMoveScript + cmp r0, 0 + bne _0809C2BC + movs r0, 0 +_0809C2BC: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end TryGetScriptOnPressingA + + thumb_func_start sub_809C2C8 +sub_809C2C8: @ 809C2C8 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r2, 24 + lsrs r6, r2, 24 + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl MetatileBehavior_IsCounter + lsls r0, 24 + cmp r0, 0 + bne _0809C2F0 + ldrh r0, [r4] + ldrh r1, [r4, 0x2] + b _0809C30E +_0809C2F0: + ldr r1, =gUnknown_08339D64 + lsls r2, r6, 3 + adds r0, r2, r1 + ldr r3, [r0] + ldrh r0, [r4] + adds r0, r3 + lsls r0, 16 + lsrs r0, 16 + adds r1, 0x4 + adds r2, r1 + ldr r2, [r2] + ldrh r1, [r4, 0x2] + adds r1, r2 + lsls r1, 16 + lsrs r1, 16 +_0809C30E: + ldrb r2, [r4, 0x4] + bl GetFieldObjectIdByXYZ + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x10 + beq _0809C32E + ldr r1, =0x02037350 + lsls r2, r3, 3 + adds r0, r2, r3 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x8] + adds r5, r1, 0 + cmp r0, 0xFF + bne _0809C33C +_0809C32E: + movs r0, 0 + b _0809C36E + .pool +_0809C33C: + movs r4, 0 + ldr r1, =0x02032308 +_0809C340: + ldrb r0, [r1] + cmp r0, 0x1 + bne _0809C34C + ldrb r0, [r1, 0x2] + cmp r0, r3 + beq _0809C32E +_0809C34C: + adds r1, 0x4 + adds r4, 0x1 + cmp r4, 0x3 + ble _0809C340 + ldr r0, =0x03005df0 + strb r3, [r0] + ldr r1, =0x020375f2 + adds r0, r2, r3 + lsls r0, 2 + adds r0, r5 + ldrb r0, [r0, 0x8] + strh r0, [r1] + ldr r0, =0x020375f4 + strh r6, [r0] + adds r0, r3, 0 + bl GetFieldObjectScriptPointerByFieldObjectId +_0809C36E: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809C2C8 + + thumb_func_start TryGetMapObjectScript +TryGetMapObjectScript: @ 809C384 + push {r4-r7,lr} + adds r5, r0, 0 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r7, r2, 24 + ldrh r0, [r5] + ldrh r1, [r5, 0x2] + ldrb r2, [r5, 0x4] + bl GetFieldObjectIdByXYZ + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x10 + beq _0809C3B4 + ldr r1, =0x02037350 + lsls r2, r4, 3 + adds r0, r2, r4 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x8] + adds r3, r1, 0 + cmp r0, 0xFF + bne _0809C40C +_0809C3B4: + adds r0, r6, 0 + bl MetatileBehavior_IsCounter + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C400 + ldr r1, =gUnknown_08339D64 + lsls r2, r7, 3 + adds r0, r2, r1 + ldr r3, [r0] + ldrh r0, [r5] + adds r0, r3 + lsls r0, 16 + lsrs r0, 16 + adds r1, 0x4 + adds r2, r1 + ldr r2, [r2] + ldrh r1, [r5, 0x2] + adds r1, r2 + lsls r1, 16 + lsrs r1, 16 + ldrb r2, [r5, 0x4] + bl GetFieldObjectIdByXYZ + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x10 + beq _0809C400 + ldr r1, =0x02037350 + lsls r2, r4, 3 + adds r0, r2, r4 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x8] + adds r3, r1, 0 + cmp r0, 0xFF + bne _0809C40C +_0809C400: + movs r0, 0 + b _0809C44E + .pool +_0809C40C: + ldr r0, =0x03005df0 + strb r4, [r0] + ldr r1, =0x020375f2 + adds r0, r2, r4 + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x8] + strh r0, [r1] + ldr r0, =0x020375f4 + strh r7, [r0] + bl InTrainerHill + cmp r0, 0x1 + bne _0809C43C + bl sub_81D62AC + b _0809C442 + .pool +_0809C43C: + adds r0, r4, 0 + bl GetFieldObjectScriptPointerByFieldObjectId +_0809C442: + adds r1, r0, 0 + ldr r0, =0x020375f2 + ldrb r0, [r0] + bl sub_8099188 + adds r1, r0, 0 +_0809C44E: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end TryGetMapObjectScript + + thumb_func_start TryGetInvisibleMapObjectScript +@ signed int TryGetInvisibleMapObjectScript(int a1, int a2, u8 playerFacingDirection) +TryGetInvisibleMapObjectScript: @ 809C458 + push {r4,r5,lr} + lsls r2, 24 + lsrs r5, r2, 24 + ldr r4, =0x02037318 + ldrh r1, [r0] + subs r1, 0x7 + lsls r1, 16 + lsrs r1, 16 + ldrh r2, [r0, 0x2] + subs r2, 0x7 + lsls r2, 16 + lsrs r2, 16 + ldrb r3, [r0, 0x4] + adds r0, r4, 0 + bl FindInvisibleMapObjectByPosition + cmp r0, 0 + beq _0809C4CC + ldr r2, [r0, 0x8] + cmp r2, 0 + bne _0809C490 + ldr r0, =gUnknown_082C8436 + b _0809C532 + .pool +_0809C490: + ldrb r0, [r0, 0x5] + cmp r0, 0x8 + bhi _0809C530 + lsls r0, 2 + ldr r1, =_0809C4A4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0809C4A4: + .4byte _0809C530 + .4byte _0809C4C8 + .4byte _0809C4D0 + .4byte _0809C4D6 + .4byte _0809C4DC + .4byte _0809C4E2 + .4byte _0809C4E2 + .4byte _0809C4E2 + .4byte _0809C510 +_0809C4C8: + cmp r5, 0x2 + beq _0809C530 +_0809C4CC: + movs r0, 0 + b _0809C532 +_0809C4D0: + cmp r5, 0x1 + beq _0809C530 + b _0809C4CC +_0809C4D6: + cmp r5, 0x4 + beq _0809C530 + b _0809C4CC +_0809C4DC: + cmp r5, 0x3 + beq _0809C530 + b _0809C4CC +_0809C4E2: + ldr r1, =0x020375e0 + lsrs r0, r2, 16 + movs r3, 0xFA + lsls r3, 1 + adds r0, r3 + strh r0, [r1] + ldr r0, =0x020375e2 + strh r2, [r0] + ldrh r0, [r1] + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809C4CC + ldr r0, =gUnknown_08271CB7 + b _0809C532 + .pool +_0809C510: + cmp r5, 0x2 + bne _0809C4CC + ldr r0, =0x020375e0 + strh r2, [r0] + bl sub_80E9680 + lsls r0, 24 + cmp r0, 0 + beq _0809C4CC + ldr r0, =gUnknown_082759F1 + b _0809C532 + .pool +_0809C530: + adds r0, r2, 0 +_0809C532: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end TryGetInvisibleMapObjectScript + + thumb_func_start TryGetMetatileBehaviorScript +TryGetMetatileBehaviorScript: @ 809C538 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r4, r2, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl MetatileBehavior_IsPlayerFacingTVScreen + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C55C + ldr r0, =gUnknown_0827EE0B + b _0809C7E4 + .pool +_0809C55C: + adds r0, r5, 0 + bl MetatileBehavior_IsPC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C574 + ldr r0, =gUnknown_08271D92 + b _0809C7E4 + .pool +_0809C574: + adds r0, r5, 0 + bl is_tile_x8B + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C58C + ldr r0, =gUnknown_081E615D + b _0809C7E4 + .pool +_0809C58C: + adds r0, r5, 0 + bl is_tile_xEA + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C5A4 + ldr r0, =gUnknown_082393F9 + b _0809C7E4 + .pool +_0809C5A4: + adds r0, r5, 0 + bl is_tile_x84 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C5B4 + b _0809C6E4 +_0809C5B4: + adds r0, r5, 0 + bl is_tile_x87 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C5CC + ldr r0, =gUnknown_082A4BAC + b _0809C7E4 + .pool +_0809C5CC: + adds r0, r5, 0 + bl is_tile_x8C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C5E4 + ldr r0, =gUnknown_0826A22A + b _0809C7E4 + .pool +_0809C5E4: + adds r0, r5, 0 + bl is_tile_x85 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C5FC + ldr r0, =gUnknown_0827208F + b _0809C7E4 + .pool +_0809C5FC: + adds r0, r5, 0 + bl sub_8089A1C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C614 + ldr r0, =gUnknown_08292DE5 + b _0809C7E4 + .pool +_0809C614: + adds r0, r5, 0 + bl sub_8089A30 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C62C + ldr r0, =gUnknown_082725CE + b _0809C7E4 + .pool +_0809C62C: + adds r0, r5, 0 + bl sub_8089A44 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C644 + ldr r0, =gUnknown_082725D7 + b _0809C7E4 + .pool +_0809C644: + adds r0, r5, 0 + bl sub_8089A58 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C65C + ldr r0, =gUnknown_082725E0 + b _0809C7E4 + .pool +_0809C65C: + adds r0, r5, 0 + bl sub_8089A6C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C674 + ldr r0, =gUnknown_082725E9 + b _0809C7E4 + .pool +_0809C674: + adds r0, r5, 0 + bl sub_8089A80 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C68C + ldr r0, =gUnknown_082725F2 + b _0809C7E4 + .pool +_0809C68C: + adds r0, r5, 0 + bl sub_8089A94 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C6A4 + ldr r0, =gUnknown_082725FB + b _0809C7E4 + .pool +_0809C6A4: + adds r0, r5, 0 + bl sub_8089AA8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C6BC + ldr r0, =gUnknown_08272604 + b _0809C7E4 + .pool +_0809C6BC: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8089AD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C6D4 + ldr r0, =gUnknown_08277B8A + b _0809C7E4 + .pool +_0809C6D4: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8089AEC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C6EC +_0809C6E4: + ldr r0, =gUnknown_08277365 + b _0809C7E4 + .pool +_0809C6EC: + adds r0, r5, 0 + bl MetatileBehavior_IsQuestionnaire + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C704 + ldr r0, =gUnknown_0827381B + b _0809C7E4 + .pool +_0809C704: + adds r0, r5, 0 + bl MetatileBehavior_IsTrainerHillTimer + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C71C + ldr r0, =gUnknown_082C8393 + b _0809C7E4 + .pool +_0809C71C: + movs r4, 0x4 + ldrsb r4, [r6, r4] + movs r1, 0 + ldrsh r0, [r6, r1] + movs r2, 0x2 + ldrsh r1, [r6, r2] + bl MapGridGetZCoordAt + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _0809C7D0 + adds r0, r5, 0 + bl sub_8089288 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C74C + ldr r0, =gUnknown_0823B4BB + b _0809C7E4 + .pool +_0809C74C: + adds r0, r5, 0 + bl sub_808929C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C764 + ldr r0, =gUnknown_0823B589 + b _0809C7E4 + .pool +_0809C764: + adds r0, r5, 0 + bl sub_80893DC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C77C + ldr r0, =gUnknown_0823B684 + b _0809C7E4 + .pool +_0809C77C: + adds r0, r5, 0 + bl sub_80893F0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C794 + ldr r0, =gUnknown_0823B68C + b _0809C7E4 + .pool +_0809C794: + adds r0, r5, 0 + bl sub_80892EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C7A8 + bl sub_80EB56C + b _0809C7E2 +_0809C7A8: + adds r0, r5, 0 + bl sub_8089364 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C7BC + bl sub_80EB9E0 + b _0809C7E2 +_0809C7BC: + adds r0, r5, 0 + bl sub_8089350 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C7E2 + bl sub_80EBB28 + b _0809C7E2 +_0809C7D0: + adds r0, r5, 0 + bl sub_8089300 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C7E2 + bl sub_80EB498 +_0809C7E2: + movs r0, 0 +_0809C7E4: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end TryGetMetatileBehaviorScript + + thumb_func_start TryGetFieldMoveScript +TryGetFieldMoveScript: @ 809C7EC + push {r4,lr} + lsls r1, 24 + lsrs r4, r1, 24 + ldr r0, =0x0000086b + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C824 + bl PartyHasMonWithSurf + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C824 + bl IsPlayerFacingSurfableFishableWater + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C824 + ldr r0, =gUnknown_08271EA0 + b _0809C862 + .pool +_0809C824: + adds r0, r4, 0 + bl MetatileBehavior_IsWaterfall + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C860 + ldr r0, =0x0000086e + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C858 + bl IsPlayerSurfingNorth + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C858 + ldr r0, =gUnknown_08290A49 + b _0809C862 + .pool +_0809C858: + ldr r0, =gUnknown_08290A83 + b _0809C862 + .pool +_0809C860: + movs r0, 0 +_0809C862: + pop {r4} + pop {r1} + bx r1 + thumb_func_end TryGetFieldMoveScript + + thumb_func_start sub_809C868 +sub_809C868: @ 809C868 + push {lr} + ldr r0, =0x0000086d + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0809C894 + bl sub_809D1E8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _0809C894 + ldr r0, =gUnknown_08290B0F + bl script_env_1_execute_new_script + movs r0, 0x1 + b _0809C896 + .pool +_0809C894: + movs r0, 0 +_0809C896: + pop {r1} + bx r1 + thumb_func_end sub_809C868 + + thumb_func_start sub_809C89C +sub_809C89C: @ 809C89C + push {lr} + ldr r0, =0x0000086d + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0809C8D4 + ldr r0, =0x02037318 + ldrb r0, [r0, 0x17] + cmp r0, 0x5 + bne _0809C8D4 + bl sub_809D1E8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C8D4 + ldr r0, =gUnknown_08290B5A + bl script_env_1_execute_new_script + movs r0, 0x1 + b _0809C8D6 + .pool +_0809C8D4: + movs r0, 0 +_0809C8D6: + pop {r1} + bx r1 + thumb_func_end sub_809C89C + + thumb_func_start sub_809C8DC +sub_809C8DC: @ 809C8DC + push {r4-r6,lr} + adds r5, r0, 0 + lsls r1, 16 + lsrs r4, r1, 16 + adds r6, r4, 0 + bl mapheader_trigger_activate_at__run_now + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809C92E + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_809CC9C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809C92E + adds r0, r4, 0 + bl sub_809C96C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809C92E + adds r0, r6, 0 + bl per_step_scripts + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809C92E + bl sub_80B5870 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809C92E + movs r0, 0 + b _0809C930 +_0809C92E: + movs r0, 0x1 +_0809C930: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_809C8DC + + thumb_func_start mapheader_trigger_activate_at__run_now +mapheader_trigger_activate_at__run_now: @ 809C938 + push {r4,lr} + ldr r4, =0x02037318 + ldrh r1, [r0] + subs r1, 0x7 + lsls r1, 16 + lsrs r1, 16 + ldrh r2, [r0, 0x2] + subs r2, 0x7 + lsls r2, 16 + lsrs r2, 16 + ldrb r3, [r0, 0x4] + adds r0, r4, 0 + bl mapheader_trigger_activate_at + cmp r0, 0 + beq _0809C964 + bl script_env_1_execute_new_script + movs r0, 0x1 + b _0809C966 + .pool +_0809C964: + movs r0, 0 +_0809C966: + pop {r4} + pop {r1} + bx r1 + thumb_func_end mapheader_trigger_activate_at__run_now + + thumb_func_start sub_809C96C +sub_809C96C: @ 809C96C + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_8089918 + lsls r0, 24 + cmp r0, 0 + beq _0809C988 + ldr r0, =gUnknown_082A8337 + b _0809C996 + .pool +_0809C988: + adds r0, r4, 0 + bl sub_8089ABC + lsls r0, 24 + cmp r0, 0 + beq _0809C9A4 + ldr r0, =gUnknown_08252BE8 +_0809C996: + bl script_env_1_execute_new_script + movs r0, 0x1 + b _0809C9EA + .pool +_0809C9A4: + adds r0, r4, 0 + bl sub_80893C8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C9B8 + bl sub_80FA9D0 + b _0809C9E8 +_0809C9B8: + adds r0, r4, 0 + bl sub_80893B4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C9E8 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileIdAt + lsls r0, 16 + asrs r0, 16 + bl sub_80FA970 +_0809C9E8: + movs r0, 0 +_0809C9EA: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809C96C + + thumb_func_start per_step_scripts +per_step_scripts: @ 809C9F4 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + bl InUnionRoom + cmp r0, 0x1 + bne _0809CA04 + b _0809CB24 +_0809CA04: + bl sub_80B215C + bl happiness_algorithm_step + bl sub_81D4998 + ldr r0, =0x02037590 + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0809CAF8 + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_808904C + lsls r0, 24 + cmp r0, 0 + bne _0809CAF8 + bl overworld_poison_step + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809CA48 + ldr r0, =gUnknown_082736BC + bl script_env_1_execute_new_script + b _0809CB28 + .pool +_0809CA48: + bl sub_8070BD0 + lsls r0, 24 + cmp r0, 0 + beq _0809CA64 + movs r0, 0xD + bl sav12_xor_increment + ldr r0, =gUnknown_08291FC0 + bl script_env_1_execute_new_script + b _0809CB28 + .pool +_0809CA64: + bl sub_813B3B0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809CA7C + ldr r0, =gUnknown_08273D1F + bl script_env_1_execute_new_script + b _0809CB28 + .pool +_0809CA7C: + bl sub_8179A04 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809CA94 + ldr r0, =gUnknown_08238EAF + bl script_env_1_execute_new_script + b _0809CB28 + .pool +_0809CA94: + bl is_tile_that_overrides_player_control + cmp r0, 0x1 + bne _0809CAA8 + ldr r0, =gUnknown_081DF7BA + bl script_env_1_execute_new_script + b _0809CB28 + .pool +_0809CAA8: + bl sub_8138120 + cmp r0, 0x1 + bne _0809CABC + ldr r0, =gUnknown_081F49EC + bl script_env_1_execute_new_script + b _0809CB28 + .pool +_0809CABC: + bl sub_8138168 + cmp r0, 0x1 + bne _0809CAD0 + ldr r0, =gUnknown_081FA4D6 + bl script_env_1_execute_new_script + b _0809CB28 + .pool +_0809CAD0: + bl sub_81381B0 + cmp r0, 0x1 + bne _0809CAE4 + ldr r0, =gUnknown_0821307B + bl script_env_1_execute_new_script + b _0809CB28 + .pool +_0809CAE4: + bl sub_81381F8 + cmp r0, 0x1 + bne _0809CAF8 + ldr r0, =gUnknown_08224175 + bl script_env_1_execute_new_script + b _0809CB28 + .pool +_0809CAF8: + bl safari_step + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809CB28 + movs r0, 0x1 + bl sub_8137FC0 + cmp r0, 0x1 + bne _0809CB1C + ldr r0, =gUnknown_0823C050 + bl script_env_1_execute_new_script + b _0809CB28 + .pool +_0809CB1C: + bl sub_8196034 + cmp r0, 0 + bne _0809CB28 +_0809CB24: + movs r0, 0 + b _0809CB2A +_0809CB28: + movs r0, 0x1 +_0809CB2A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end per_step_scripts + + thumb_func_start sub_809CB30 +sub_809CB30: @ 809CB30 + push {lr} + ldr r0, =0x0000402a + movs r1, 0 + bl VarSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_809CB30 + + thumb_func_start happiness_algorithm_step +happiness_algorithm_step: @ 809CB44 + push {r4,r5,lr} + ldr r0, =0x0000402a + bl GetVarPointer + ldrh r1, [r0] + adds r1, 0x1 + strh r1, [r0] + ldrh r1, [r0] + movs r2, 0x7F + ands r1, r2 + strh r1, [r0] + cmp r1, 0 + bne _0809CB72 + ldr r5, =0x020244ec + movs r4, 0x5 +_0809CB62: + adds r0, r5, 0 + movs r1, 0x5 + bl happiness_algorithm + adds r5, 0x64 + subs r4, 0x1 + cmp r4, 0 + bge _0809CB62 +_0809CB72: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end happiness_algorithm_step + + thumb_func_start overworld_poison_timer_set +overworld_poison_timer_set: @ 809CB80 + push {lr} + ldr r0, =0x0000402b + movs r1, 0 + bl VarSet + pop {r0} + bx r0 + .pool + thumb_func_end overworld_poison_timer_set + + thumb_func_start overworld_poison_step +overworld_poison_step: @ 809CB94 + push {lr} + ldr r0, =0x02037318 + ldrb r0, [r0, 0x17] + cmp r0, 0x9 + beq _0809CBD4 + ldr r0, =0x0000402b + bl GetVarPointer + ldrh r1, [r0] + adds r1, 0x1 + strh r1, [r0] + ldrh r1, [r0] + movs r2, 0x3 + ands r1, r2 + strh r1, [r0] + cmp r1, 0 + bne _0809CBD4 + bl overworld_poison + cmp r0, 0x1 + beq _0809CBD4 + cmp r0, 0x1 + ble _0809CBD4 + cmp r0, 0x2 + bne _0809CBD4 + movs r0, 0x1 + b _0809CBD6 + .pool +_0809CBD4: + movs r0, 0 +_0809CBD6: + pop {r1} + bx r1 + thumb_func_end overworld_poison_step + + thumb_func_start prev_quest_postbuffer_cursor_backup_reset +prev_quest_postbuffer_cursor_backup_reset: @ 809CBDC + ldr r1, =0x020375d4 + movs r0, 0 + strb r0, [r1] + bx lr + .pool + thumb_func_end prev_quest_postbuffer_cursor_backup_reset + + thumb_func_start is_it_battle_time_3 +is_it_battle_time_3: @ 809CBE8 + push {r4-r7,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r7, r4, 0 + ldr r6, =0x020375d4 + ldrb r0, [r6] + cmp r0, 0x3 + bhi _0809CC0C + adds r0, 0x1 + strb r0, [r6] + ldr r0, =0x020375d6 + strh r4, [r0] + movs r0, 0 + b _0809CC30 + .pool +_0809CC0C: + ldr r5, =0x020375d6 + ldrh r1, [r5] + adds r0, r4, 0 + bl is_it_battle_time_2 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809CC28 + strh r4, [r5] + movs r0, 0 + b _0809CC30 + .pool +_0809CC28: + movs r0, 0 + strb r0, [r6] + strh r7, [r5] + movs r0, 0x1 +_0809CC30: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end is_it_battle_time_3 + + thumb_func_start mapheader_run_first_tag2_script_list_match_conditionally +mapheader_run_first_tag2_script_list_match_conditionally: @ 809CC38 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =0x02037318 + mov r8, r0 + adds r1, r7, 0 + bl map_warp_check_packed + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl is_non_stair_warp_tile + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809CC90 + lsls r0, r6, 24 + asrs r4, r0, 24 + movs r0, 0x1 + negs r0, r0 + cmp r4, r0 + beq _0809CC90 + bl walkrun_find_lowest_active_bit_in_bitfield + mov r0, r8 + adds r1, r4, 0 + adds r2, r7, 0 + bl sub_809CEB0 + bl sub_80AF734 + movs r0, 0x1 + b _0809CC92 + .pool +_0809CC90: + movs r0, 0 +_0809CC92: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end mapheader_run_first_tag2_script_list_match_conditionally + + thumb_func_start sub_809CC9C +sub_809CC9C: @ 809CC9C + push {r4-r7,lr} + adds r6, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + ldr r7, =0x02037318 + adds r0, r7, 0 + adds r1, r6, 0 + bl map_warp_check_packed + lsls r0, 24 + asrs r4, r0, 24 + movs r0, 0x1 + negs r0, r0 + cmp r4, r0 + beq _0809CD8A + adds r0, r5, 0 + bl is_warp_tile + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809CD8A + bl walkrun_find_lowest_active_bit_in_bitfield + adds r0, r7, 0 + adds r1, r4, 0 + adds r2, r6, 0 + bl sub_809CEB0 + lsls r0, r5, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl MetatileBehavior_IsEscalator + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809CCF8 + adds r0, r4, 0 + bl sub_80AF80C + movs r0, 0x1 + b _0809CD8C + .pool +_0809CCF8: + adds r0, r4, 0 + bl sub_8089870 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809CD0E + bl sub_80AF828 + movs r0, 0x1 + b _0809CD8C +_0809CD0E: + adds r0, r4, 0 + bl is_role_x68 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809CD24 + bl sub_80AF838 + movs r0, 0x1 + b _0809CD8C +_0809CD24: + adds r0, r4, 0 + bl MetatileBehavior_IsAquaHideoutWarp + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809CD3A + bl sub_80AF848 + movs r0, 0x1 + b _0809CD8C +_0809CD3A: + adds r0, r4, 0 + bl sub_80898AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809CD50 + bl sub_80B0268 + movs r0, 0x1 + b _0809CD8C +_0809CD50: + adds r0, r4, 0 + bl sub_8089904 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809CD6C + ldr r0, =gUnknown_082A8350 + bl script_env_1_execute_new_script + movs r0, 0x1 + b _0809CD8C + .pool +_0809CD6C: + adds r0, r4, 0 + bl sub_80898C0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809CD82 + bl sub_80AF87C + movs r0, 0x1 + b _0809CD8C +_0809CD82: + bl sub_80AF734 + movs r0, 0x1 + b _0809CD8C +_0809CD8A: + movs r0, 0 +_0809CD8C: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_809CC9C + + thumb_func_start is_warp_tile +is_warp_tile: @ 809CD94 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl is_tile_x69_2_warp_door + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809CE2A + adds r0, r4, 0 + bl MetatileBehavior_IsLadder + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809CE2A + adds r0, r4, 0 + bl MetatileBehavior_IsEscalator + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809CE2A + adds r0, r4, 0 + bl sub_8088F58 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809CE2A + adds r0, r4, 0 + bl sub_8089870 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809CE2A + adds r0, r4, 0 + bl is_role_x68 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809CE2A + adds r0, r4, 0 + bl MetatileBehavior_IsAquaHideoutWarp + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809CE2A + adds r0, r4, 0 + bl sub_8089904 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809CE2A + adds r0, r4, 0 + bl sub_80898C0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809CE2A + adds r0, r4, 0 + bl sub_80898AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809CE2A + movs r0, 0 + b _0809CE2C +_0809CE2A: + movs r0, 0x1 +_0809CE2C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end is_warp_tile + + thumb_func_start is_non_stair_warp_tile +is_non_stair_warp_tile: @ 809CE34 + push {lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 24 + lsrs r1, 24 + adds r2, r1, 0 + cmp r1, 0x2 + beq _0809CE58 + cmp r1, 0x2 + bgt _0809CE4E + cmp r1, 0x1 + beq _0809CE62 + b _0809CE84 +_0809CE4E: + cmp r2, 0x3 + beq _0809CE6C + cmp r2, 0x4 + beq _0809CE76 + b _0809CE84 +_0809CE58: + lsls r0, 24 + lsrs r0, 24 + bl MetatileBehavior_IsNorthArrowWarp + b _0809CE7E +_0809CE62: + lsls r0, 24 + lsrs r0, 24 + bl MetatileBehavior_IsSouthArrowWarp + b _0809CE7E +_0809CE6C: + lsls r0, 24 + lsrs r0, 24 + bl MetatileBehavior_IsWestArrowWarp + b _0809CE7E +_0809CE76: + lsls r0, 24 + lsrs r0, 24 + bl MetatileBehavior_IsEastArrowWarp +_0809CE7E: + lsls r0, 24 + lsrs r0, 24 + b _0809CE86 +_0809CE84: + movs r0, 0 +_0809CE86: + pop {r1} + bx r1 + thumb_func_end is_non_stair_warp_tile + + thumb_func_start map_warp_check_packed +map_warp_check_packed: @ 809CE8C + push {lr} + adds r3, r1, 0 + ldrh r1, [r3] + subs r1, 0x7 + lsls r1, 16 + lsrs r1, 16 + ldrh r2, [r3, 0x2] + subs r2, 0x7 + lsls r2, 16 + lsrs r2, 16 + ldrb r3, [r3, 0x4] + bl map_warp_check + lsls r0, 24 + asrs r0, 24 + pop {r1} + bx r1 + thumb_func_end map_warp_check_packed + + thumb_func_start sub_809CEB0 +sub_809CEB0: @ 809CEB0 + push {r4-r7,lr} + adds r7, r2, 0 + lsls r1, 24 + lsrs r4, r1, 24 + bl GetCurrentTrainerHillMapId + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + cmp r5, 0 + beq _0809CF00 + bl sub_81D6490 + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + bne _0809CEF0 + lsls r0, r4, 24 + adds r4, r0, 0 + cmp r4, 0 + bne _0809CEE8 + ldr r0, =0x02037318 + ldr r0, [r0, 0x4] + ldr r5, [r0, 0x8] + b _0809CF0E + .pool +_0809CEE8: + bl sub_81D6120 + adds r5, r0, 0 + b _0809CF0E +_0809CEF0: + cmp r6, 0x5 + bne _0809CF00 + lsls r4, 24 + lsrs r0, r4, 24 + bl sub_81D6134 + adds r5, r0, 0 + b _0809CF0E +_0809CF00: + ldr r0, =0x02037318 + ldr r0, [r0, 0x4] + lsls r2, r4, 24 + asrs r1, r2, 21 + ldr r0, [r0, 0x8] + adds r5, r0, r1 + adds r4, r2, 0 +_0809CF0E: + ldrb r0, [r5, 0x6] + cmp r0, 0x7F + bne _0809CF20 + ldrb r0, [r5, 0x5] + bl copy_saved_warp2_bank_and_enter_x_to_warp1 + b _0809CF6E + .pool +_0809CF20: + movs r0, 0x7 + ldrsb r0, [r5, r0] + movs r1, 0x6 + ldrsb r1, [r5, r1] + movs r2, 0x5 + ldrsb r2, [r5, r2] + bl warp1_set_2 + movs r1, 0 + ldrsh r0, [r7, r1] + movs r2, 0x2 + ldrsh r1, [r7, r2] + bl sub_8084D5C + ldrb r0, [r5, 0x7] + ldrb r1, [r5, 0x6] + bl get_mapheader_by_bank_and_number + ldr r1, [r0, 0x4] + ldrb r0, [r5, 0x5] + ldr r1, [r1, 0x8] + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0, 0x6] + cmp r0, 0x7F + bne _0809CF6E + asrs r3, r4, 24 + lsls r0, r3, 3 + adds r0, r1 + ldrb r0, [r0, 0x5] + ldr r1, =0x03005d8c + ldr r2, [r1] + movs r1, 0x4 + ldrsb r1, [r2, r1] + ldrb r2, [r2, 0x5] + lsls r2, 24 + asrs r2, 24 + bl saved_warp2_set +_0809CF6E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809CEB0 + + thumb_func_start map_warp_consider_2_to_inside +map_warp_consider_2_to_inside: @ 809CF78 + push {r4-r7,lr} + adds r5, r0, 0 + lsls r1, 16 + lsrs r0, r1, 16 + adds r7, r0, 0 + lsls r2, 24 + lsrs r2, 24 + cmp r2, 0x2 + bne _0809CFFC + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_8089210 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809CFB0 + ldr r0, =0x02037318 + ldr r1, [r0, 0x4] + adds r0, r5, 0 + bl sub_80E9668 + movs r0, 0x1 + b _0809CFFE + .pool +_0809CFB0: + adds r0, r4, 0 + bl is_tile_x69_2_warp_door + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809CFFC + ldr r6, =0x02037318 + adds r0, r6, 0 + adds r1, r5, 0 + bl map_warp_check_packed + lsls r0, 24 + asrs r4, r0, 24 + movs r0, 0x1 + negs r0, r0 + cmp r4, r0 + beq _0809CFFC + adds r0, r7, 0 + bl is_warp_tile + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809CFFC + bl walkrun_find_lowest_active_bit_in_bitfield + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_809CEB0 + bl sub_80AF7D0 + movs r0, 0x1 + b _0809CFFE + .pool +_0809CFFC: + movs r0, 0 +_0809CFFE: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end map_warp_consider_2_to_inside + + thumb_func_start map_warp_check +map_warp_check: @ 809D004 + push {r4-r6,lr} + lsls r1, 16 + lsrs r6, r1, 16 + lsls r2, 16 + lsrs r5, r2, 16 + lsls r3, 24 + lsrs r4, r3, 24 + ldr r0, [r0, 0x4] + ldr r1, [r0, 0x8] + ldrb r3, [r0, 0x1] + movs r2, 0 + cmp r2, r3 + bge _0809D042 +_0809D01E: + ldrh r0, [r1] + cmp r0, r6 + bne _0809D03A + ldrh r0, [r1, 0x2] + cmp r0, r5 + bne _0809D03A + ldrb r0, [r1, 0x4] + cmp r0, r4 + beq _0809D034 + cmp r0, 0 + bne _0809D03A +_0809D034: + lsls r0, r2, 24 + asrs r0, 24 + b _0809D046 +_0809D03A: + adds r2, 0x1 + adds r1, 0x8 + cmp r2, r3 + blt _0809D01E +_0809D042: + movs r0, 0x1 + negs r0, r0 +_0809D046: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end map_warp_check + + thumb_func_start trigger_activate +trigger_activate: @ 809D04C + push {r4,lr} + adds r4, r0, 0 + cmp r4, 0 + beq _0809D082 + ldr r1, [r4, 0xC] + cmp r1, 0 + bne _0809D062 + ldrb r0, [r4, 0x6] + bl trigger_activate_weather + b _0809D082 +_0809D062: + ldrh r0, [r4, 0x6] + cmp r0, 0 + beq _0809D07C + ldrh r0, [r4, 0x6] + bl VarGet + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r4, 0x8] + cmp r0, r1 + bne _0809D082 + ldr r0, [r4, 0xC] + b _0809D084 +_0809D07C: + adds r0, r1, 0 + bl script_env_2_execute_new_script +_0809D082: + movs r0, 0 +_0809D084: + pop {r4} + pop {r1} + bx r1 + thumb_func_end trigger_activate + + thumb_func_start mapheader_trigger_activate_at +mapheader_trigger_activate_at: @ 809D08C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r1, 16 + lsrs r1, 16 + mov r10, r1 + lsls r2, 16 + lsrs r2, 16 + mov r9, r2 + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + ldr r0, [r0, 0x4] + ldr r1, [r0, 0xC] + ldrb r7, [r0, 0x2] + movs r6, 0 + cmp r6, r7 + bge _0809D0E2 + adds r5, r1, 0 + adds r4, r5, 0 +_0809D0B8: + ldrh r0, [r4] + cmp r0, r10 + bne _0809D0D8 + ldrh r0, [r4, 0x2] + cmp r0, r9 + bne _0809D0D8 + ldrb r0, [r4, 0x4] + cmp r0, r8 + beq _0809D0CE + cmp r0, 0 + bne _0809D0D8 +_0809D0CE: + adds r0, r5, 0 + bl trigger_activate + cmp r0, 0 + bne _0809D0E4 +_0809D0D8: + adds r4, 0x10 + adds r5, 0x10 + adds r6, 0x1 + cmp r6, r7 + blt _0809D0B8 +_0809D0E2: + movs r0, 0 +_0809D0E4: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end mapheader_trigger_activate_at + + thumb_func_start sub_809D0F4 +sub_809D0F4: @ 809D0F4 + push {r4,lr} + ldr r4, =0x02037318 + ldrh r1, [r0] + subs r1, 0x7 + lsls r1, 16 + lsrs r1, 16 + ldrh r2, [r0, 0x2] + subs r2, 0x7 + lsls r2, 16 + lsrs r2, 16 + ldrb r3, [r0, 0x4] + adds r0, r4, 0 + bl mapheader_trigger_activate_at + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809D0F4 + + thumb_func_start FindInvisibleMapObjectByPosition +@ int FindInvisibleMapObjectByPosition(struct mapheader *mapHeader, u16 x, u16 y, u8 elevation) +FindInvisibleMapObjectByPosition: @ 809D11C + push {r4-r7,lr} + lsls r1, 16 + lsrs r7, r1, 16 + lsls r2, 16 + lsrs r6, r2, 16 + lsls r3, 24 + lsrs r5, r3, 24 + ldr r0, [r0, 0x4] + ldr r4, [r0, 0x10] + ldrb r3, [r0, 0x3] + movs r2, 0 + cmp r2, r3 + bcs _0809D162 +_0809D136: + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r1, r0, r4 + ldrh r0, [r1] + cmp r0, r7 + bne _0809D158 + ldrh r0, [r1, 0x2] + cmp r0, r6 + bne _0809D158 + ldrb r0, [r1, 0x4] + cmp r0, r5 + beq _0809D154 + cmp r0, 0 + bne _0809D158 +_0809D154: + adds r0, r1, 0 + b _0809D164 +_0809D158: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r3 + bcc _0809D136 +_0809D162: + movs r0, 0 +_0809D164: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end FindInvisibleMapObjectByPosition + + thumb_func_start dive_warp +dive_warp: @ 809D16C + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + ldr r0, =0x02037318 + ldrb r0, [r0, 0x17] + cmp r0, 0x5 + bne _0809D1A4 + lsls r0, r5, 24 + lsrs r0, 24 + bl sub_80895D0 + lsls r0, 24 + cmp r0, 0 + bne _0809D1A4 + ldrh r0, [r4] + subs r0, 0x7 + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r4, 0x2] + subs r1, 0x7 + lsls r1, 16 + lsrs r1, 16 + bl sub_8085058 + b _0809D1C8 + .pool +_0809D1A4: + lsls r0, r5, 24 + lsrs r0, 24 + bl sub_80895B0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809D1E0 + ldrh r0, [r4] + subs r0, 0x7 + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r4, 0x2] + subs r1, 0x7 + lsls r1, 16 + lsrs r1, 16 + bl sub_8085078 +_0809D1C8: + lsls r0, 24 + cmp r0, 0 + beq _0809D1E0 + bl walkrun_find_lowest_active_bit_in_bitfield + bl sp13E_warp_to_last_warp + movs r0, 0xE9 + bl audio_play + movs r0, 0x1 + b _0809D1E2 +_0809D1E0: + movs r0, 0 +_0809D1E2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end dive_warp + + thumb_func_start sub_809D1E8 +sub_809D1E8: @ 809D1E8 + push {r4,r5,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02037318 + ldrb r0, [r0, 0x17] + cmp r0, 0x5 + bne _0809D244 + adds r0, r5, 0 + bl sub_80895D0 + lsls r0, 24 + cmp r0, 0 + bne _0809D244 + mov r0, sp + ldrh r0, [r0] + subs r0, 0x7 + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r4] + subs r1, 0x7 + lsls r1, 16 + lsrs r1, 16 + bl sub_8085058 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809D274 + movs r0, 0x1 + b _0809D276 + .pool +_0809D244: + adds r0, r5, 0 + bl sub_80895B0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809D274 + mov r0, sp + ldrh r0, [r0] + subs r0, 0x7 + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r4] + subs r1, 0x7 + lsls r1, 16 + lsrs r1, 16 + bl sub_8085078 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809D274 + movs r0, 0x2 + b _0809D276 +_0809D274: + movs r0, 0 +_0809D276: + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809D1E8 + + thumb_func_start GetFieldObjectScriptPointerForComparison +@ u8 *GetFieldObjectScriptPointerForComparison() +GetFieldObjectScriptPointerForComparison: @ 809D280 + push {r4,r5,lr} + sub sp, 0x8 + bl player_get_direction_upper_nybble + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + mov r5, sp + mov r0, sp + bl player_get_next_pos_and_height + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0x2 + ldrsh r1, [r5, r2] + bl MapGridGetMetatileBehaviorAt + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, sp + adds r2, r4, 0 + bl TryGetMapObjectScript + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end GetFieldObjectScriptPointerForComparison + + thumb_func_start sub_809D2BC +sub_809D2BC: @ 809D2BC + push {r4,lr} + sub sp, 0x8 + bl player_get_direction_upper_nybble + mov r4, sp + mov r0, sp + bl player_get_pos_to_and_height + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileBehaviorAt + ldr r4, =0x02037318 + adds r0, r4, 0 + mov r1, sp + bl map_warp_check_packed + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + adds r0, r4, 0 + mov r2, sp + bl sub_809CEB0 + movs r0, 0 + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809D2BC + + thumb_func_start sub_809D300 +sub_809D300: @ 809D300 + push {r4,lr} + ldr r4, =0x03005d8c + ldr r0, [r4] + ldr r1, =0x00001270 + adds r0, r1 + movs r2, 0x96 + lsls r2, 1 + movs r1, 0 + bl memset + ldr r0, [r4] + ldr r1, =0x0000139c + adds r0, r1 + movs r2, 0x80 + lsls r2, 2 + movs r1, 0 + bl memset + ldr r0, =0x020375fc + movs r1, 0 + movs r2, 0x10 + bl memset + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D300 + + thumb_func_start sub_809D344 +sub_809D344: @ 809D344 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00001270 + adds r2, r0, r1 + movs r1, 0 + str r1, [r2] + ldr r1, =0x0000139c + adds r0, r1 + movs r1, 0 + movs r2, 0x20 + bl memset + ldr r0, =0x000008ad + bl FlagReset + ldr r0, =0x000008ae + bl FlagReset + ldr r0, =0x00000889 + bl FlagReset + ldr r0, =0x000008c1 + bl FlagReset + movs r0, 0x88 + lsls r0, 4 + bl FlagReset + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D344 + + thumb_func_start sub_809D3A0 +sub_809D3A0: @ 809D3A0 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00001394 + adds r0, r1 + movs r1, 0 + movs r2, 0x8 + bl memset + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D3A0 + + thumb_func_start sub_809D3C0 +sub_809D3C0: @ 809D3C0 + push {lr} + ldr r0, =0x00004046 + bl GetVarPointer + ldr r1, =0x03005d90 + ldr r2, [r1] + movs r1, 0 + strb r1, [r2, 0x1A] + strh r1, [r0] + ldr r0, =0x00000896 + bl FlagReset + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D3C0 + + thumb_func_start sub_809D3E8 +sub_809D3E8: @ 809D3E8 + push {r4,r5,lr} + ldr r0, =0x00004046 + bl GetVarPointer + ldr r4, =0x03005d90 + ldr r2, [r4] + movs r5, 0 + movs r1, 0xDA + strb r1, [r2, 0x1A] + ldr r2, =0x00000302 + adds r1, r2, 0 + strh r1, [r0] + ldr r0, =0x00000896 + bl FlagSet + ldr r1, [r4] + movs r0, 0x1 + strb r0, [r1, 0x19] + ldr r0, [r4] + strb r5, [r0, 0x18] + bl sub_80BB358 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D3E8 + + thumb_func_start sub_809D42C +sub_809D42C: @ 809D42C + push {lr} + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x1A] + cmp r0, 0xDA + bne _0809D468 + ldr r0, =0x00004046 + bl VarGet + lsls r0, 16 + ldr r1, =0x03020000 + cmp r0, r1 + bne _0809D468 + ldr r0, =0x00000896 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0809D468 + movs r0, 0x1 + b _0809D46A + .pool +_0809D468: + movs r0, 0 +_0809D46A: + pop {r1} + bx r1 + thumb_func_end sub_809D42C + + thumb_func_start sub_809D470 +sub_809D470: @ 809D470 + push {lr} + ldr r0, =0x000008ac + bl FlagReset + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D470 + + thumb_func_start sub_809D480 +sub_809D480: @ 809D480 + push {lr} + ldr r0, =0x000008ac + bl FlagSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D480 + + thumb_func_start sub_809D490 +sub_809D490: @ 809D490 + push {lr} + ldr r0, =0x000008ac + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_809D490 + + thumb_func_start sub_809D4A4 +sub_809D4A4: @ 809D4A4 + push {lr} + ldr r0, =0x000008db + bl FlagReset + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D4A4 + + thumb_func_start sub_809D4B4 +sub_809D4B4: @ 809D4B4 + push {lr} + ldr r0, =0x000008db + bl FlagSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D4B4 + + thumb_func_start sub_809D4C4 +sub_809D4C4: @ 809D4C4 + push {lr} + ldr r0, =0x000008db + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_809D4C4 + + thumb_func_start sub_809D4D8 +sub_809D4D8: @ 809D4D8 + push {lr} + movs r0, 0xF2 + lsls r0, 1 + bl FlagReset + ldr r0, =0x000001e5 + bl FlagReset + movs r0, 0xF3 + lsls r0, 1 + bl FlagReset + ldr r0, =0x000001e7 + bl FlagReset + movs r0, 0xF4 + lsls r0, 1 + bl FlagReset + ldr r0, =0x000001e9 + bl FlagReset + movs r0, 0xF5 + lsls r0, 1 + bl FlagReset + ldr r0, =0x000001eb + bl FlagReset + movs r0, 0xF6 + lsls r0, 1 + bl FlagReset + ldr r0, =0x000001ed + bl FlagReset + movs r0, 0xF7 + lsls r0, 1 + bl FlagReset + ldr r0, =0x000001ef + bl FlagReset + movs r0, 0xF8 + lsls r0, 1 + bl FlagReset + ldr r0, =0x000001f1 + bl FlagReset + movs r0, 0xF9 + lsls r0, 1 + bl FlagReset + ldr r0, =0x000001f3 + bl FlagReset + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D4D8 + + thumb_func_start sub_809D570 +sub_809D570: @ 809D570 + push {lr} + ldr r0, =0x000040dd + movs r1, 0 + bl VarSet + ldr r0, =0x000040de + movs r1, 0 + bl VarSet + ldr r0, =0x000040df + movs r1, 0 + bl VarSet + ldr r0, =0x000040e0 + movs r1, 0 + bl VarSet + ldr r0, =0x000040e1 + movs r1, 0 + bl VarSet + ldr r0, =0x000040e2 + movs r1, 0 + bl VarSet + ldr r0, =0x000040e3 + movs r1, 0 + bl VarSet + ldr r0, =0x000040e4 + movs r1, 0 + bl VarSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D570 + + thumb_func_start sub_809D5D8 +sub_809D5D8: @ 809D5D8 + push {lr} + ldr r0, =0x0000402c + movs r1, 0 + bl VarSet + ldr r0, =0x000008c2 + bl FlagReset + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D5D8 + + thumb_func_start sub_809D5F4 +sub_809D5F4: @ 809D5F4 + push {lr} + ldr r0, =0x0000402c + movs r1, 0x92 + lsls r1, 4 + bl VarSet + ldr r0, =0x000008c2 + bl FlagSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D5F4 + + thumb_func_start sub_809D614 +sub_809D614: @ 809D614 + push {lr} + ldr r0, =0x000008c2 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0809D640 + ldr r0, =0x0000402c + bl VarGet + lsls r0, 16 + movs r1, 0x92 + lsls r1, 20 + cmp r0, r1 + bne _0809D640 + movs r0, 0x1 + b _0809D642 + .pool +_0809D640: + movs r0, 0 +_0809D642: + pop {r1} + bx r1 + thumb_func_end sub_809D614 + + thumb_func_start GetVarPointer +@ u16 *GetVarPointer(u16 varId) +GetVarPointer: @ 809D648 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + adds r2, r1, 0 + ldr r0, =0x00003fff + cmp r1, r0 + bhi _0809D660 + movs r0, 0 + b _0809D688 + .pool +_0809D660: + lsls r0, r1, 16 + cmp r0, 0 + bge _0809D67C + ldr r0, =gUnknown_081DBA0C + ldr r2, =0xffff8000 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + b _0809D688 + .pool +_0809D67C: + ldr r0, =0x03005d8c + lsls r1, r2, 1 + ldr r2, =0xffff939c + adds r1, r2 + ldr r0, [r0] + adds r0, r1 +_0809D688: + pop {r1} + bx r1 + .pool + thumb_func_end GetVarPointer + + thumb_func_start VarGet +@ u16 VarGet(u16 varId) +VarGet: @ 809D694 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl GetVarPointer + cmp r0, 0 + beq _0809D6A8 + ldrh r0, [r0] + b _0809D6AA +_0809D6A8: + adds r0, r4, 0 +_0809D6AA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end VarGet + + thumb_func_start VarSet +@ bool8 VarSet(u16 varId, u16 value) +VarSet: @ 809D6B0 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r4, r1, 16 + bl GetVarPointer + cmp r0, 0 + beq _0809D6C8 + strh r4, [r0] + movs r0, 0x1 + b _0809D6CA +_0809D6C8: + movs r0, 0 +_0809D6CA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end VarSet + + thumb_func_start VarGetFieldObjectGraphicsId +@ u8 VarGetFieldObjectGraphicsId(u8 index) +VarGetFieldObjectGraphicsId: @ 809D6D0 + push {lr} + lsls r0, 24 + lsrs r0, 8 + ldr r1, =0x40100000 + adds r0, r1 + lsrs r0, 16 + bl VarGet + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end VarGetFieldObjectGraphicsId + + thumb_func_start GetFlagPointer +@ u8 *GetFlagPointer(u16 flagId) +GetFlagPointer: @ 809D6EC + push {lr} + lsls r1, r0, 16 + lsrs r2, r1, 16 + adds r3, r2, 0 + cmp r2, 0 + bne _0809D6FC + movs r0, 0 + b _0809D72E +_0809D6FC: + ldr r0, =0x00003fff + cmp r2, r0 + bhi _0809D71C + ldr r0, =0x03005d8c + lsrs r1, 19 + ldr r2, =0x00001270 + adds r1, r2 + ldr r0, [r0] + b _0809D72C + .pool +_0809D71C: + ldr r1, =0xffffc000 + adds r0, r3, r1 + cmp r0, 0 + bge _0809D728 + ldr r2, =0xffffc007 + adds r0, r3, r2 +_0809D728: + asrs r0, 3 + ldr r1, =0x020375fc +_0809D72C: + adds r0, r1 +_0809D72E: + pop {r1} + bx r1 + .pool + thumb_func_end GetFlagPointer + + thumb_func_start FlagSet +@ bool8 FlagSet(u16 flagId) +FlagSet: @ 809D740 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl GetFlagPointer + adds r2, r0, 0 + cmp r2, 0 + beq _0809D760 + movs r0, 0x7 + ands r0, r4 + movs r1, 0x1 + lsls r1, r0 + ldrb r0, [r2] + orrs r1, r0 + strb r1, [r2] +_0809D760: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end FlagSet + + thumb_func_start FlagReset +@ bool8 FlagReset(u16 flagId) +FlagReset: @ 809D768 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl GetFlagPointer + adds r2, r0, 0 + cmp r2, 0 + beq _0809D788 + movs r0, 0x7 + ands r0, r4 + movs r1, 0x1 + lsls r1, r0 + ldrb r0, [r2] + bics r0, r1 + strb r0, [r2] +_0809D788: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end FlagReset + + thumb_func_start FlagGet +@ bool8 FlagGet(u16 flagId) +FlagGet: @ 809D790 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl GetFlagPointer + cmp r0, 0 + beq _0809D7B4 + ldrb r0, [r0] + movs r1, 0x7 + ands r1, r4 + asrs r0, r1 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0809D7B4 + movs r0, 0x1 + b _0809D7B6 +_0809D7B4: + movs r0, 0 +_0809D7B6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end FlagGet + + thumb_func_start sub_809D7BC +sub_809D7BC: @ 809D7BC + push {lr} + movs r0, 0x1 + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D7BC + + thumb_func_start sub_809D7C8 +sub_809D7C8: @ 809D7C8 + push {lr} + movs r0, 0x2 + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D7C8 + + thumb_func_start sub_809D7D4 +sub_809D7D4: @ 809D7D4 + push {lr} + movs r0, 0x3 + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D7D4 + + thumb_func_start sub_809D7E0 +sub_809D7E0: @ 809D7E0 + push {lr} + movs r0, 0x4 + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D7E0 + + thumb_func_start sub_809D7EC +sub_809D7EC: @ 809D7EC + push {lr} + movs r0, 0x5 + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D7EC + + thumb_func_start sub_809D7F8 +sub_809D7F8: @ 809D7F8 + push {lr} + movs r0, 0x6 + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D7F8 + + thumb_func_start sub_809D804 +sub_809D804: @ 809D804 + push {lr} + movs r0, 0x9 + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D804 + + thumb_func_start sub_809D810 +sub_809D810: @ 809D810 + push {lr} + movs r0, 0x7 + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D810 + + thumb_func_start sub_809D81C +sub_809D81C: @ 809D81C + push {lr} + movs r0, 0x8 + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D81C + + thumb_func_start sub_809D828 +sub_809D828: @ 809D828 + push {lr} + movs r0, 0xB + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D828 + + thumb_func_start sub_809D834 +sub_809D834: @ 809D834 + push {lr} + movs r0, 0xC + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D834 + + thumb_func_start sub_809D840 +sub_809D840: @ 809D840 + push {lr} + movs r0, 0x14 + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D840 + + thumb_func_start sub_809D84C +sub_809D84C: @ 809D84C + push {lr} + movs r0, 0x15 + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D84C + + thumb_func_start trigger_activate_weather +trigger_activate_weather: @ 809D858 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r2, 0 + ldr r3, =gUnknown_085102E0 +_0809D862: + lsls r1, r2, 3 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r4 + bne _0809D87C + adds r0, r3, 0x4 + adds r0, r1, r0 + ldr r0, [r0] + bl _call_via_r0 + b _0809D886 + .pool +_0809D87C: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xC + bls _0809D862 +_0809D886: + pop {r4} + pop {r0} + bx r0 + thumb_func_end trigger_activate_weather + + thumb_func_start task_per_step_callback_manager +task_per_step_callback_manager: @ 809D88C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0x8 + ldrsh r1, [r1, r2] + ldr r2, =gUnknown_08510348 + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end task_per_step_callback_manager + + thumb_func_start sub_809D8B8 +sub_809D8B8: @ 809D8B8 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0809D8CA + cmp r0, 0x1 + beq _0809D8E8 + b _0809D8FC +_0809D8CA: + ldr r0, =0x030022c0 + ldr r0, [r0, 0x20] + movs r1, 0x80 + lsls r1, 5 + ands r0, r1 + cmp r0, 0 + beq _0809D8FC + bl sub_809E7B0 + ldrh r0, [r4] + adds r0, 0x1 + b _0809D8FA + .pool +_0809D8E8: + ldr r0, =0x030022c0 + ldr r0, [r0, 0x20] + movs r1, 0x80 + lsls r1, 5 + ands r0, r1 + cmp r0, 0 + bne _0809D8FC + ldrh r0, [r4] + subs r0, 0x1 +_0809D8FA: + strh r0, [r4] +_0809D8FC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D8B8 + + thumb_func_start sub_809D908 +sub_809D908: @ 809D908 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r4, r1, r0 + bl script_env_2_is_enabled + lsls r0, 24 + cmp r0, 0 + bne _0809D930 + adds r0, r4, 0 + bl sub_809D8B8 + adds r0, r4, 0x2 + adds r1, r4, 0x4 + bl wild_encounter_related +_0809D930: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D908 + + thumb_func_start overworld_ensure_per_step_coros_running +overworld_ensure_per_step_coros_running: @ 809D93C + push {r4,r5,lr} + ldr r5, =task_per_step_callback_manager + adds r0, r5, 0 + bl is_function_an_active_task + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0809D966 + adds r0, r5, 0 + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] +_0809D966: + ldr r4, =sub_809E638 + adds r0, r4, 0 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _0809D97C + adds r0, r4, 0 + movs r1, 0x50 + bl AddTask +_0809D97C: + ldr r4, =sub_809D908 + adds r0, r4, 0 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _0809D992 + adds r0, r4, 0 + movs r1, 0x50 + bl AddTask +_0809D992: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end overworld_ensure_per_step_coros_running + + thumb_func_start activate_per_step_callback +activate_per_step_callback: @ 809D9A8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =task_per_step_callback_manager + bl get_task_id_by_function + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xFF + beq _0809D9EA + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r1, r0, r1 + movs r2, 0 + adds r0, r1, 0 + adds r0, 0x1E +_0809D9CC: + strh r2, [r0] + subs r0, 0x2 + cmp r0, r1 + bge _0809D9CC + cmp r4, 0x7 + bls _0809D9E8 + movs r0, 0 + strh r0, [r1] + b _0809D9EA + .pool +_0809D9E8: + strh r4, [r1] +_0809D9EA: + pop {r4} + pop {r0} + bx r0 + thumb_func_end activate_per_step_callback + + thumb_func_start wild_encounter_reset_coro_args +wild_encounter_reset_coro_args: @ 809D9F0 + push {lr} + ldr r0, =task_per_step_callback_manager + bl get_task_id_by_function + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, =sub_809D908 + bl get_task_id_by_function + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xFF + beq _0809DA1A + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x2] + strh r1, [r0, 0x4] +_0809DA1A: + pop {r0} + bx r0 + .pool + thumb_func_end wild_encounter_reset_coro_args + + thumb_func_start nullsub_34 +nullsub_34: @ 809DA2C + bx lr + thumb_func_end nullsub_34 + + thumb_func_start sub_809DA30 +sub_809DA30: @ 809DA30 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + adds r0, r4, 0 + bl sub_8089764 + lsls r0, 24 + cmp r0, 0 + beq _0809DA48 + adds r0, r5, 0 + b _0809DA80 +_0809DA48: + adds r0, r4, 0 + bl sub_8089778 + lsls r0, 24 + cmp r0, 0 + beq _0809DA5A + adds r0, r5, 0 + adds r0, 0x8 + b _0809DA80 +_0809DA5A: + adds r0, r4, 0 + bl sub_808978C + lsls r0, 24 + cmp r0, 0 + beq _0809DA6C + adds r0, r5, 0 + adds r0, 0x10 + b _0809DA80 +_0809DA6C: + adds r0, r4, 0 + bl sub_80897A0 + lsls r0, 24 + cmp r0, 0 + bne _0809DA7C + movs r0, 0 + b _0809DA80 +_0809DA7C: + adds r0, r5, 0 + adds r0, 0x18 +_0809DA80: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809DA30 + + thumb_func_start sub_809DA88 +sub_809DA88: @ 809DA88 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + mov r8, r3 + lsls r1, 16 + asrs r6, r1, 16 + lsls r2, 16 + asrs r7, r2, 16 + adds r0, r6, 0 + adds r1, r7, 0 + bl MapGridGetMetatileBehaviorAt + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + bl sub_809DA30 + adds r4, r0, 0 + adds r5, r4, 0 + cmp r4, 0 + beq _0809DB06 + movs r0, 0 + ldrsb r0, [r4, r0] + adds r0, r6, r0 + movs r1, 0x1 + ldrsb r1, [r4, r1] + adds r1, r7, r1 + ldrh r2, [r4, 0x2] + bl MapGridSetMetatileIdAt + mov r0, r8 + cmp r0, 0 + beq _0809DADE + movs r0, 0 + ldrsb r0, [r4, r0] + adds r0, r6, r0 + movs r1, 0x1 + ldrsb r1, [r4, r1] + adds r1, r7, r1 + bl CurrentMapDrawMetatileAt +_0809DADE: + movs r0, 0x4 + ldrsb r0, [r5, r0] + adds r0, r6, r0 + movs r1, 0x5 + ldrsb r1, [r5, r1] + adds r1, r7, r1 + ldrh r2, [r5, 0x6] + bl MapGridSetMetatileIdAt + mov r0, r8 + cmp r0, 0 + beq _0809DB06 + movs r0, 0x4 + ldrsb r0, [r5, r0] + adds r0, r6, r0 + movs r1, 0x5 + ldrsb r1, [r5, r1] + adds r1, r7, r1 + bl CurrentMapDrawMetatileAt +_0809DB06: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_809DA88 + + thumb_func_start sub_809DB10 +sub_809DB10: @ 809DB10 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r3, r2, 0 + ldr r0, =gUnknown_08510368 + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_809DA88 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809DB10 + + thumb_func_start sub_809DB34 +sub_809DB34: @ 809DB34 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r3, r2, 0 + ldr r0, =gUnknown_08510388 + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_809DA88 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809DB34 + + thumb_func_start sub_809DB58 +sub_809DB58: @ 809DB58 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r3, r2, 0 + ldr r0, =gUnknown_085103A8 + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_809DA88 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809DB58 + + thumb_func_start sub_809DB7C +sub_809DB7C: @ 809DB7C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + mov r10, r8 + lsls r1, 16 + lsrs r7, r1, 16 + mov r9, r7 + lsls r2, 16 + asrs r6, r2, 16 + lsls r3, 16 + asrs r5, r3, 16 + adds r0, r6, 0 + adds r1, r5, 0 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_8089764 + lsls r0, 24 + cmp r0, 0 + beq _0809DBC0 + lsls r0, r7, 16 + asrs r0, 16 + cmp r0, r5 + ble _0809DC06 +_0809DBBC: + movs r0, 0 + b _0809DC08 +_0809DBC0: + adds r0, r4, 0 + bl sub_8089778 + lsls r0, 24 + cmp r0, 0 + beq _0809DBD8 + mov r1, r9 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, r5 + bge _0809DC06 + b _0809DBBC +_0809DBD8: + adds r0, r4, 0 + bl sub_808978C + lsls r0, 24 + cmp r0, 0 + beq _0809DBF0 + mov r1, r8 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, r6 + ble _0809DC06 + b _0809DBBC +_0809DBF0: + adds r0, r4, 0 + bl sub_80897A0 + lsls r0, 24 + cmp r0, 0 + beq _0809DC06 + mov r1, r10 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, r6 + blt _0809DBBC +_0809DC06: + movs r0, 0x1 +_0809DC08: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_809DB7C + + thumb_func_start sub_809DC18 +sub_809DC18: @ 809DC18 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r2, 16 + lsrs r2, 16 + mov r8, r2 + mov r10, r8 + lsls r3, 16 + lsrs r7, r3, 16 + mov r9, r7 + lsls r0, 16 + asrs r6, r0, 16 + lsls r1, 16 + asrs r5, r1, 16 + adds r0, r6, 0 + adds r1, r5, 0 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_8089764 + lsls r0, 24 + cmp r0, 0 + beq _0809DC5C + lsls r0, r7, 16 + asrs r0, 16 + cmp r5, r0 + bge _0809DCA2 +_0809DC58: + movs r0, 0 + b _0809DCA4 +_0809DC5C: + adds r0, r4, 0 + bl sub_8089778 + lsls r0, 24 + cmp r0, 0 + beq _0809DC74 + mov r1, r9 + lsls r0, r1, 16 + asrs r0, 16 + cmp r5, r0 + ble _0809DCA2 + b _0809DC58 +_0809DC74: + adds r0, r4, 0 + bl sub_808978C + lsls r0, 24 + cmp r0, 0 + beq _0809DC8C + mov r1, r8 + lsls r0, r1, 16 + asrs r0, 16 + cmp r6, r0 + bge _0809DCA2 + b _0809DC58 +_0809DC8C: + adds r0, r4, 0 + bl sub_80897A0 + lsls r0, 24 + cmp r0, 0 + beq _0809DCA2 + mov r1, r10 + lsls r0, r1, 16 + asrs r0, 16 + cmp r6, r0 + bgt _0809DC58 +_0809DCA2: + movs r0, 0x1 +_0809DCA4: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_809DC18 + + thumb_func_start sub_809DCB4 +sub_809DCB4: @ 809DCB4 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r4, r1, r0 + mov r5, sp + adds r5, 0x2 + mov r0, sp + adds r1, r5, 0 + bl PlayerGetDestCoords + movs r1, 0x2 + ldrsh r0, [r4, r1] + adds r6, r5, 0 + cmp r0, 0x1 + beq _0809DD0E + cmp r0, 0x1 + bgt _0809DCEC + cmp r0, 0 + beq _0809DCF2 + b _0809DE1E + .pool +_0809DCEC: + cmp r0, 0x2 + beq _0809DDDC + b _0809DE1E +_0809DCF2: + mov r0, sp + ldrh r0, [r0] + strh r0, [r4, 0x4] + ldrh r0, [r5] + strh r0, [r4, 0x6] + mov r0, sp + movs r2, 0 + ldrsh r0, [r0, r2] + movs r3, 0 + ldrsh r1, [r5, r3] + movs r2, 0x1 + bl sub_809DB34 + b _0809DE1A +_0809DD0E: + mov r0, sp + movs r7, 0 + ldrsh r1, [r0, r7] + movs r2, 0x4 + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _0809DD28 + movs r3, 0 + ldrsh r1, [r5, r3] + movs r7, 0x6 + ldrsh r0, [r4, r7] + cmp r1, r0 + beq _0809DE1E +_0809DD28: + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r5, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + movs r5, 0x6 + ldrsh r3, [r4, r5] + bl sub_809DB7C + cmp r0, 0 + beq _0809DD70 + movs r7, 0x4 + ldrsh r0, [r4, r7] + movs r2, 0x6 + ldrsh r1, [r4, r2] + movs r2, 0x1 + bl sub_809DB10 + movs r3, 0x4 + ldrsh r0, [r4, r3] + movs r5, 0x6 + ldrsh r1, [r4, r5] + movs r2, 0 + bl sub_809DB58 + ldrh r0, [r4, 0x4] + strh r0, [r4, 0x8] + ldrh r0, [r4, 0x6] + strh r0, [r4, 0xA] + movs r0, 0x2 + strh r0, [r4, 0x2] + movs r0, 0x8 + strh r0, [r4, 0xC] + b _0809DD7A +_0809DD70: + movs r7, 0x1 + negs r7, r7 + adds r0, r7, 0 + strh r0, [r4, 0x8] + strh r0, [r4, 0xA] +_0809DD7A: + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + adds r5, r6, 0 + movs r2, 0 + ldrsh r1, [r5, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + movs r7, 0x6 + ldrsh r3, [r4, r7] + bl sub_809DC18 + cmp r0, 0 + beq _0809DDAE + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r5, r2] + movs r2, 0x1 + bl sub_809DB10 + movs r0, 0x2 + strh r0, [r4, 0x2] + movs r0, 0x8 + strh r0, [r4, 0xC] +_0809DDAE: + mov r0, sp + ldrh r0, [r0] + strh r0, [r4, 0x4] + ldrh r0, [r6] + strh r0, [r4, 0x6] + mov r0, sp + movs r3, 0 + ldrsh r0, [r0, r3] + movs r5, 0 + ldrsh r1, [r6, r5] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl MetatileBehavior_IsPacifidlogLog + lsls r0, 24 + cmp r0, 0 + beq _0809DE1E + movs r0, 0x46 + bl audio_play + b _0809DE1E +_0809DDDC: + ldrh r0, [r4, 0xC] + subs r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + cmp r0, 0 + bne _0809DE1E + mov r0, sp + movs r7, 0 + ldrsh r0, [r0, r7] + movs r2, 0 + ldrsh r1, [r5, r2] + movs r2, 0x1 + bl sub_809DB34 + movs r3, 0x8 + ldrsh r0, [r4, r3] + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _0809DE1A + movs r5, 0xA + ldrsh r0, [r4, r5] + cmp r0, r1 + beq _0809DE1A + movs r7, 0x8 + ldrsh r0, [r4, r7] + movs r2, 0xA + ldrsh r1, [r4, r2] + movs r2, 0x1 + bl sub_809DB58 +_0809DE1A: + movs r0, 0x1 + strh r0, [r4, 0x2] +_0809DE1E: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_809DCB4 + + thumb_func_start sub_809DE28 +sub_809DE28: @ 809DE28 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 16 + lsrs r5, r1, 16 + bl PlayerGetZCoord + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0809DE82 + lsls r0, r4, 16 + asrs r4, r0, 16 + lsls r0, r5, 16 + asrs r5, r0, 16 + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridGetMetatileIdAt + adds r1, r0, 0 + ldr r0, =0x0000024e + cmp r1, r0 + beq _0809DE68 + adds r0, 0x8 + cmp r1, r0 + beq _0809DE78 + b _0809DE82 + .pool +_0809DE68: + ldr r2, =0x0000024f + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridSetMetatileIdAt + b _0809DE82 + .pool +_0809DE78: + ldr r2, =0x00000257 + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridSetMetatileIdAt +_0809DE82: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809DE28 + + thumb_func_start sub_809DE8C +sub_809DE8C: @ 809DE8C + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 16 + lsrs r5, r1, 16 + bl PlayerGetZCoord + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0809DEE6 + lsls r0, r4, 16 + asrs r4, r0, 16 + lsls r0, r5, 16 + asrs r5, r0, 16 + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridGetMetatileIdAt + adds r1, r0, 0 + ldr r0, =0x0000024f + cmp r1, r0 + beq _0809DECC + adds r0, 0x8 + cmp r1, r0 + beq _0809DEDC + b _0809DEE6 + .pool +_0809DECC: + ldr r2, =0x0000024e + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridSetMetatileIdAt + b _0809DEE6 + .pool +_0809DEDC: + ldr r2, =0x00000256 + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridSetMetatileIdAt +_0809DEE6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809DE8C + + thumb_func_start sub_809DEF0 +sub_809DEF0: @ 809DEF0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r6, r1, r0 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + movs r0, 0x2 + ldrsh r5, [r6, r0] + mov r9, r4 + cmp r5, 0x1 + beq _0809DF84 + cmp r5, 0x1 + bgt _0809DF30 + cmp r5, 0 + beq _0809DF38 + b _0809E0F6 + .pool +_0809DF30: + cmp r5, 0x2 + bne _0809DF36 + b _0809E064 +_0809DF36: + b _0809E0F6 +_0809DF38: + mov r0, sp + ldrh r0, [r0] + strh r0, [r6, 0x4] + mov r1, r9 + ldrh r0, [r1] + strh r0, [r6, 0x6] + mov r0, sp + movs r2, 0 + ldrsh r0, [r0, r2] + movs r3, 0 + ldrsh r1, [r1, r3] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl MetatileBehavior_IsFortreeBridge + lsls r0, 24 + cmp r0, 0 + bne _0809DF62 + b _0809E0F2 +_0809DF62: + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + mov r2, r9 + movs r3, 0 + ldrsh r1, [r2, r3] + bl sub_809DE28 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + mov r2, r9 + movs r3, 0 + ldrsh r1, [r2, r3] + bl CurrentMapDrawMetatileAt + b _0809E0F2 +_0809DF84: + ldrh r0, [r6, 0x6] + mov r8, r0 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + ldrh r2, [r6, 0x4] + mov r10, r2 + movs r3, 0x4 + ldrsh r7, [r6, r3] + cmp r0, r7 + bne _0809DFAC + mov r0, r9 + movs r2, 0 + ldrsh r1, [r0, r2] + mov r3, r8 + lsls r0, r3, 16 + asrs r0, 16 + cmp r1, r0 + bne _0809DFAC + b _0809E0F6 +_0809DFAC: + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + mov r2, r9 + movs r3, 0 + ldrsh r1, [r2, r3] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl MetatileBehavior_IsFortreeBridge + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + mov r0, r8 + lsls r4, r0, 16 + asrs r1, r4, 16 + adds r0, r7, 0 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl MetatileBehavior_IsFortreeBridge + lsls r0, 24 + lsrs r7, r0, 24 + bl PlayerGetZCoord + movs r1, 0 + ands r5, r0 + lsls r0, r5, 24 + adds r5, r4, 0 + cmp r0, 0 + bne _0809DFF4 + movs r1, 0x1 +_0809DFF4: + cmp r1, 0 + beq _0809E008 + ldr r1, [sp, 0x4] + cmp r1, 0x1 + beq _0809E002 + cmp r7, 0x1 + bne _0809E008 +_0809E002: + movs r0, 0x47 + bl audio_play +_0809E008: + cmp r7, 0 + beq _0809E044 + mov r2, r10 + lsls r4, r2, 16 + asrs r4, 16 + asrs r5, 16 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809DE8C + adds r0, r4, 0 + adds r1, r5, 0 + bl CurrentMapDrawMetatileAt + mov r0, sp + movs r3, 0 + ldrsh r0, [r0, r3] + mov r2, r9 + movs r3, 0 + ldrsh r1, [r2, r3] + bl sub_809DE28 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + mov r2, r9 + movs r3, 0 + ldrsh r1, [r2, r3] + bl CurrentMapDrawMetatileAt +_0809E044: + mov r0, r10 + strh r0, [r6, 0x8] + mov r1, r8 + strh r1, [r6, 0xA] + mov r0, sp + ldrh r0, [r0] + strh r0, [r6, 0x4] + mov r2, r9 + ldrh r0, [r2] + strh r0, [r6, 0x6] + cmp r7, 0 + beq _0809E0F6 + movs r0, 0x10 + strh r0, [r6, 0xC] + movs r0, 0x2 + strh r0, [r6, 0x2] +_0809E064: + ldrh r0, [r6, 0xC] + subs r0, 0x1 + strh r0, [r6, 0xC] + ldrh r3, [r6, 0x8] + mov r10, r3 + ldrh r0, [r6, 0xA] + mov r8, r0 + movs r1, 0xC + ldrsh r0, [r6, r1] + movs r1, 0x7 + bl __modsi3 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + bhi _0809E0EA + lsls r0, 2 + ldr r1, =_0809E094 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0809E094: + .4byte _0809E0B4 + .4byte _0809E0EA + .4byte _0809E0EA + .4byte _0809E0EA + .4byte _0809E0C6 + .4byte _0809E0EA + .4byte _0809E0EA + .4byte _0809E0EA +_0809E0B4: + mov r2, r10 + lsls r0, r2, 16 + asrs r0, 16 + mov r3, r8 + lsls r1, r3, 16 + asrs r1, 16 + bl CurrentMapDrawMetatileAt + b _0809E0EA +_0809E0C6: + mov r0, r10 + lsls r5, r0, 16 + asrs r5, 16 + mov r1, r8 + lsls r4, r1, 16 + asrs r4, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_809DE28 + adds r0, r5, 0 + adds r1, r4, 0 + bl CurrentMapDrawMetatileAt + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_809DE8C +_0809E0EA: + movs r2, 0xC + ldrsh r0, [r6, r2] + cmp r0, 0 + bne _0809E0F6 +_0809E0F2: + movs r0, 0x1 + strh r0, [r6, 0x2] +_0809E0F6: + 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_809DEF0 + + thumb_func_start sub_809E108 +sub_809E108: @ 809E108 + push {lr} + lsls r1, 16 + lsrs r1, 16 + lsls r0, 16 + ldr r2, =0xfffd0000 + adds r0, r2 + lsrs r0, 16 + cmp r0, 0xA + bhi _0809E144 + lsls r0, r1, 16 + asrs r1, r0, 16 + ldr r2, =0xfffa0000 + adds r0, r2 + lsrs r0, 16 + cmp r0, 0xD + bhi _0809E144 + ldr r0, =gUnknown_085103C8 + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _0809E144 + movs r0, 0x1 + b _0809E146 + .pool +_0809E144: + movs r0, 0 +_0809E146: + pop {r1} + bx r1 + thumb_func_end sub_809E108 + + thumb_func_start sub_809E14C +sub_809E14C: @ 809E14C + push {r4,r5,lr} + lsls r0, 16 + asrs r5, r0, 16 + lsls r1, 16 + asrs r4, r1, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_809E108 + cmp r0, 0 + beq _0809E17A + ldr r1, =gUnknown_085103C8 + lsls r0, r4, 1 + adds r0, r1 + ldrh r0, [r0] + bl GetVarPointer + subs r2, r5, 0x3 + movs r1, 0x1 + lsls r1, r2 + ldrh r2, [r0] + orrs r1, r2 + strh r1, [r0] +_0809E17A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809E14C + + thumb_func_start sub_809E184 +sub_809E184: @ 809E184 + push {r4,r5,lr} + lsls r0, 16 + asrs r5, r0, 16 + lsls r1, 16 + asrs r4, r1, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_809E108 + cmp r0, 0 + beq _0809E1B6 + ldr r1, =gUnknown_085103C8 + lsls r0, r4, 1 + adds r0, r1 + ldrh r0, [r0] + bl VarGet + lsls r0, 16 + subs r2, r5, 0x3 + movs r1, 0x80 + lsls r1, 9 + lsls r1, r2 + ands r1, r0 + cmp r1, 0 + bne _0809E1C0 +_0809E1B6: + movs r0, 0 + b _0809E1C2 + .pool +_0809E1C0: + movs r0, 0x1 +_0809E1C2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809E184 + + thumb_func_start sub_809E1C8 +sub_809E1C8: @ 809E1C8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r0, =0x02037318 + ldr r0, [r0] + ldr r1, [r0] + mov r9, r1 + ldr r7, [r0, 0x4] + movs r5, 0 + cmp r5, r9 + bge _0809E210 +_0809E1E0: + movs r4, 0 + adds r0, r5, 0x1 + mov r8, r0 + cmp r4, r7 + bge _0809E20A + lsls r6, r5, 16 +_0809E1EC: + lsls r1, r4, 16 + asrs r1, 16 + asrs r0, r6, 16 + bl sub_809E184 + cmp r0, 0x1 + bne _0809E204 + adds r1, r4, 0x7 + adds r0, r5, 0x7 + ldr r2, =0x0000020e + bl MapGridSetMetatileIdAt +_0809E204: + adds r4, 0x1 + cmp r4, r7 + blt _0809E1EC +_0809E20A: + mov r5, r8 + cmp r5, r9 + blt _0809E1E0 +_0809E210: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809E1C8 + + thumb_func_start sub_809E224 +sub_809E224: @ 809E224 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r5, r1, r0 + movs r1, 0x2 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _0809E270 + cmp r0, 0x1 + bgt _0809E24C + cmp r0, 0 + beq _0809E258 + b _0809E3A6 + .pool +_0809E24C: + cmp r0, 0x2 + beq _0809E306 + cmp r0, 0x3 + bne _0809E256 + b _0809E360 +_0809E256: + b _0809E3A6 +_0809E258: + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + mov r0, sp + ldrh r0, [r0] + strh r0, [r5, 0x4] + ldrh r0, [r4] + strh r0, [r5, 0x6] + b _0809E3A2 +_0809E270: + mov r7, sp + adds r7, 0x2 + mov r0, sp + adds r1, r7, 0 + bl PlayerGetDestCoords + mov r0, sp + ldrh r2, [r0] + movs r3, 0 + ldrsh r1, [r0, r3] + movs r3, 0x4 + ldrsh r0, [r5, r3] + cmp r1, r0 + bne _0809E29A + movs r0, 0 + ldrsh r1, [r7, r0] + movs r3, 0x6 + ldrsh r0, [r5, r3] + cmp r1, r0 + bne _0809E29A + b _0809E3A6 +_0809E29A: + strh r2, [r5, 0x4] + ldrh r0, [r7] + strh r0, [r5, 0x6] + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r7, r2] + bl MapGridGetMetatileBehaviorAt + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, =0x00004022 + bl GetVarPointer + adds r6, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_8089604 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809E2E0 + ldrh r0, [r6] + adds r0, 0x1 + strh r0, [r6] + movs r0, 0x4 + strh r0, [r5, 0xC] + movs r0, 0x2 + b _0809E2F8 + .pool +_0809E2E0: + adds r0, r4, 0 + bl sub_8089618 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809E3A6 + movs r0, 0 + strh r0, [r6] + movs r0, 0x4 + strh r0, [r5, 0xC] + movs r0, 0x3 +_0809E2F8: + strh r0, [r5, 0x2] + mov r0, sp + ldrh r0, [r0] + strh r0, [r5, 0x8] + ldrh r0, [r7] + strh r0, [r5, 0xA] + b _0809E3A6 +_0809E306: + ldrh r1, [r5, 0xC] + movs r3, 0xC + ldrsh r0, [r5, r3] + cmp r0, 0 + bne _0809E36A + mov r1, sp + ldrh r0, [r5, 0x8] + strh r0, [r1] + mov r4, sp + adds r4, 0x2 + ldrh r0, [r5, 0xA] + strh r0, [r4] + movs r0, 0x2A + bl audio_play + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + ldr r2, =0x0000020e + bl MapGridSetMetatileIdAt + mov r0, sp + movs r3, 0 + ldrsh r0, [r0, r3] + movs r2, 0 + ldrsh r1, [r4, r2] + bl CurrentMapDrawMetatileAt + mov r0, sp + ldrh r0, [r0] + subs r0, 0x7 + lsls r0, 16 + asrs r0, 16 + ldrh r1, [r4] + subs r1, 0x7 + lsls r1, 16 + asrs r1, 16 + bl sub_809E14C + b _0809E3A2 + .pool +_0809E360: + ldrh r1, [r5, 0xC] + movs r3, 0xC + ldrsh r0, [r5, r3] + cmp r0, 0 + beq _0809E370 +_0809E36A: + subs r0, r1, 0x1 + strh r0, [r5, 0xC] + b _0809E3A6 +_0809E370: + mov r1, sp + ldrh r0, [r5, 0x8] + strh r0, [r1] + mov r4, sp + adds r4, 0x2 + ldrh r0, [r5, 0xA] + strh r0, [r4] + movs r0, 0x29 + bl audio_play + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + ldr r2, =0x00000206 + bl MapGridSetMetatileIdAt + mov r0, sp + movs r3, 0 + ldrsh r0, [r0, r3] + movs r2, 0 + ldrsh r1, [r4, r2] + bl CurrentMapDrawMetatileAt +_0809E3A2: + movs r0, 0x1 + strh r0, [r5, 0x2] +_0809E3A6: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809E224 + + thumb_func_start sub_809E3B4 +sub_809E3B4: @ 809E3B4 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r5, r1, r0 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + mov r0, sp + ldrh r2, [r0] + movs r3, 0 + ldrsh r1, [r0, r3] + movs r3, 0x2 + ldrsh r0, [r5, r3] + cmp r1, r0 + bne _0809E3EE + movs r0, 0 + ldrsh r1, [r4, r0] + movs r3, 0x4 + ldrsh r0, [r5, r3] + cmp r1, r0 + beq _0809E47A +_0809E3EE: + strh r2, [r5, 0x2] + ldrh r0, [r4] + strh r0, [r5, 0x4] + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl MetatileBehavior_IsAsh + lsls r0, 24 + cmp r0, 0 + beq _0809E47A + mov r0, sp + movs r3, 0 + ldrsh r0, [r0, r3] + movs r2, 0 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileIdAt + ldr r1, =0x0000020a + cmp r0, r1 + bne _0809E444 + mov r0, sp + movs r3, 0 + ldrsh r0, [r0, r3] + movs r2, 0 + ldrsh r1, [r4, r2] + ldr r2, =0x00000212 + movs r3, 0x4 + bl ash + b _0809E456 + .pool +_0809E444: + mov r0, sp + movs r3, 0 + ldrsh r0, [r0, r3] + movs r2, 0 + ldrsh r1, [r4, r2] + ldr r2, =0x00000206 + movs r3, 0x4 + bl ash +_0809E456: + movs r0, 0x87 + lsls r0, 1 + movs r1, 0x1 + bl sub_80D6724 + lsls r0, 24 + cmp r0, 0 + beq _0809E47A + ldr r0, =0x00004048 + bl GetVarPointer + adds r2, r0, 0 + ldrh r1, [r2] + ldr r0, =0x0000270e + cmp r1, r0 + bhi _0809E47A + adds r0, r1, 0x1 + strh r0, [r2] +_0809E47A: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809E3B4 + + thumb_func_start sub_809E490 +sub_809E490: @ 809E490 + push {r4,r5,lr} + lsls r0, 16 + asrs r5, r0, 16 + lsls r1, 16 + asrs r4, r1, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetMetatileIdAt + ldr r1, =0x0000022f + ldr r2, =0x00000237 + cmp r0, r1 + bne _0809E4AC + subs r2, 0x31 +_0809E4AC: + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridSetMetatileIdAt + adds r0, r5, 0 + adds r1, r4, 0 + bl CurrentMapDrawMetatileAt + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809E490 + + thumb_func_start sub_809E4CC +sub_809E4CC: @ 809E4CC + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r5, r1, r0 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 16 + lsrs r6, r0, 16 + ldrh r1, [r5, 0x8] + movs r3, 0x8 + ldrsh r0, [r5, r3] + adds r7, r4, 0 + cmp r0, 0 + beq _0809E51E + subs r0, r1, 0x1 + strh r0, [r5, 0x8] + lsls r0, 16 + cmp r0, 0 + bne _0809E51E + movs r1, 0xA + ldrsh r0, [r5, r1] + movs r2, 0xC + ldrsh r1, [r5, r2] + bl sub_809E490 +_0809E51E: + ldrh r1, [r5, 0xE] + movs r3, 0xE + ldrsh r0, [r5, r3] + cmp r0, 0 + beq _0809E53E + subs r0, r1, 0x1 + strh r0, [r5, 0xE] + lsls r0, 16 + cmp r0, 0 + bne _0809E53E + movs r1, 0x10 + ldrsh r0, [r5, r1] + movs r2, 0x12 + ldrsh r1, [r5, r2] + bl sub_809E490 +_0809E53E: + lsls r0, r6, 24 + lsrs r6, r0, 24 + adds r0, r6, 0 + bl sub_8089918 + lsls r0, 24 + cmp r0, 0 + beq _0809E556 + ldr r0, =0x00004022 + movs r1, 0 + bl VarSet +_0809E556: + mov r0, sp + ldrh r2, [r0] + movs r3, 0 + ldrsh r1, [r0, r3] + movs r3, 0x4 + ldrsh r0, [r5, r3] + cmp r1, r0 + bne _0809E572 + movs r0, 0 + ldrsh r1, [r7, r0] + movs r3, 0x6 + ldrsh r0, [r5, r3] + cmp r1, r0 + beq _0809E5D2 +_0809E572: + strh r2, [r5, 0x4] + adds r4, r7, 0 + ldrh r0, [r4] + strh r0, [r5, 0x6] + adds r0, r6, 0 + bl sub_808992C + lsls r0, 24 + cmp r0, 0 + beq _0809E5D2 + bl sub_811A138 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + beq _0809E59A + ldr r0, =0x00004022 + movs r1, 0 + bl VarSet +_0809E59A: + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0809E5BC + movs r0, 0x3 + strh r0, [r5, 0x8] + mov r0, sp + ldrh r0, [r0] + strh r0, [r5, 0xA] + ldrh r0, [r4] + strh r0, [r5, 0xC] + b _0809E5D2 + .pool +_0809E5BC: + movs r2, 0xE + ldrsh r0, [r5, r2] + cmp r0, 0 + bne _0809E5D2 + movs r0, 0x3 + strh r0, [r5, 0xE] + mov r0, sp + ldrh r0, [r0] + strh r0, [r5, 0x10] + ldrh r0, [r7] + strh r0, [r5, 0x12] +_0809E5D2: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_809E4CC + + thumb_func_start sub_809E5DC +sub_809E5DC: @ 809E5DC + push {r4,r5,lr} + adds r3, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + lsls r2, 16 + lsrs r4, r2, 16 + ldrh r0, [r3] + subs r0, 0x1 + strh r0, [r3] + lsls r0, 16 + cmp r0, 0 + bne _0809E5F8 + movs r2, 0xE8 + b _0809E60C +_0809E5F8: + ldr r1, =gUnknown_085103FC + movs r2, 0 + ldrsh r0, [r3, r2] + cmp r0, 0 + bge _0809E604 + adds r0, 0x7 +_0809E604: + asrs r0, 3 + lsls r0, 1 + adds r0, r1 + ldrh r2, [r0] +_0809E60C: + lsls r5, 16 + asrs r5, 16 + lsls r4, 16 + asrs r4, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridSetMetatileIdAt + adds r0, r5, 0 + adds r1, r4, 0 + bl CurrentMapDrawMetatileAt + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0xE8 + bl MapGridSetMetatileIdAt + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809E5DC + + thumb_func_start sub_809E638 +sub_809E638: @ 809E638 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r4, r1, r0 + mov r5, sp + adds r5, 0x2 + mov r0, sp + adds r1, r5, 0 + bl PlayerGetDestCoords + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + lsls r1, 8 + ldrb r0, [r0, 0x5] + lsls r0, 24 + asrs r0, 24 + orrs r0, r1 + lsls r0, 16 + lsrs r7, r0, 16 + movs r0, 0x2 + ldrsh r1, [r4, r0] + mov r8, r5 + cmp r1, 0 + beq _0809E688 + cmp r1, 0x1 + beq _0809E6B4 + b _0809E708 + .pool +_0809E688: + strh r7, [r4] + mov r0, sp + ldrh r0, [r0] + strh r0, [r4, 0x4] + ldrh r0, [r5] + strh r0, [r4, 0x6] + movs r0, 0x1 + strh r0, [r4, 0x2] + strh r1, [r4, 0x8] + strh r1, [r4, 0xE] + strh r1, [r4, 0x14] + strh r1, [r4, 0x1A] + b _0809E708 +_0809E6A2: + movs r0, 0x20 + strh r0, [r1] + mov r0, sp + ldrh r0, [r0] + strh r0, [r1, 0x2] + mov r2, r8 + ldrh r0, [r2] + strh r0, [r1, 0x4] + b _0809E708 +_0809E6B4: + mov r0, sp + movs r3, 0x4 + ldrsh r1, [r4, r3] + ldrh r2, [r0] + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r1, r0 + bne _0809E6D0 + movs r0, 0x6 + ldrsh r1, [r4, r0] + movs r3, 0 + ldrsh r0, [r5, r3] + cmp r1, r0 + beq _0809E708 +_0809E6D0: + strh r2, [r4, 0x4] + ldrh r0, [r5] + strh r0, [r4, 0x6] + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r5, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl MetatileBehavior_IsMuddySlope + lsls r0, 24 + cmp r0, 0 + beq _0809E708 + movs r6, 0x4 + adds r1, r4, 0 + adds r1, 0x8 +_0809E6F8: + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _0809E6A2 + adds r1, 0x6 + adds r6, 0x3 + cmp r6, 0xD + ble _0809E6F8 +_0809E708: + ldr r2, =0x02037334 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0809E728 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r7, r0 + beq _0809E728 + strh r7, [r4] + ldrh r0, [r2, 0x4] + ldrh r1, [r2, 0x8] + b _0809E72C + .pool +_0809E728: + movs r0, 0 + movs r1, 0 +_0809E72C: + lsls r0, 16 + asrs r0, 16 + mov r8, r0 + lsls r0, r1, 16 + asrs r7, r0, 16 + adds r5, r4, 0 + adds r5, 0x8 + adds r4, r5, 0 + movs r6, 0x9 +_0809E73E: + movs r2, 0 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _0809E762 + ldrh r0, [r4, 0x2] + mov r3, r8 + subs r0, r3 + strh r0, [r4, 0x2] + ldrh r0, [r4, 0x4] + subs r0, r7 + strh r0, [r4, 0x4] + movs r0, 0x2 + ldrsh r1, [r4, r0] + movs r3, 0x4 + ldrsh r2, [r4, r3] + adds r0, r5, 0 + bl sub_809E5DC +_0809E762: + adds r4, 0x6 + adds r5, 0x6 + subs r6, 0x3 + cmp r6, 0 + bge _0809E73E + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_809E638 + + thumb_func_start sub_809E778 +sub_809E778: @ 809E778 + push {lr} + ldr r0, =0x00000895 + bl FlagSet + bl GameFreakRTC_CalcLocalDateTime + ldr r0, =0x03005d90 + ldr r2, [r0] + adds r2, 0xA0 + ldr r3, =0x03005cf8 + ldr r0, [r3] + ldr r1, [r3, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + ldr r0, =0x00004040 + ldrh r1, [r3] + bl VarSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_809E778 + + thumb_func_start sub_809E7B0 +sub_809E7B0: @ 809E7B0 + push {r4,lr} + ldr r0, =0x00000895 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0809E7DA + bl sub_813B9C0 + lsls r0, 24 + cmp r0, 0 + bne _0809E7DA + bl GameFreakRTC_CalcLocalDateTime + ldr r4, =0x03005cf8 + adds r0, r4, 0 + bl sub_809E7E8 + adds r0, r4, 0 + bl sub_809E858 +_0809E7DA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809E7B0 + + thumb_func_start sub_809E7E8 +sub_809E7E8: @ 809E7E8 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r0, =0x00004040 + bl GetVarPointer + adds r6, r0, 0 + ldrh r0, [r6] + movs r2, 0 + ldrsh r1, [r5, r2] + cmp r0, r1 + beq _0809E84E + cmp r0, r1 + bgt _0809E84E + ldrh r4, [r5] + subs r4, r0 + lsls r4, 16 + lsrs r4, 16 + bl sub_809D3A0 + adds r0, r4, 0 + bl sub_8122580 + adds r0, r4, 0 + bl sub_80ED888 + adds r0, r4, 0 + bl sub_80AEFBC + adds r0, r4, 0 + bl sub_806DE44 + adds r0, r4, 0 + bl sub_8137904 + adds r0, r4, 0 + bl sub_8137A20 + adds r0, r4, 0 + bl sub_8139EF4 + adds r0, r4, 0 + bl sub_813A7F4 + adds r0, r4, 0 + bl sub_813945C + adds r0, r4, 0 + bl sub_8177584 + ldrh r0, [r5] + strh r0, [r6] +_0809E84E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809E7E8 + + thumb_func_start sub_809E858 +sub_809E858: @ 809E858 + push {r4-r6,lr} + sub sp, 0x8 + adds r5, r0, 0 + mov r4, sp + ldr r6, =0x03005d90 + ldr r1, [r6] + adds r1, 0xA0 + mov r0, sp + adds r2, r5, 0 + bl GameFreakRTC_GetDelta + mov r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + lsls r0, r1, 1 + adds r0, r1 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 5 + movs r2, 0x2 + ldrsb r2, [r4, r2] + lsls r0, r2, 4 + subs r0, r2 + lsls r0, 2 + adds r1, r0 + movs r0, 0x3 + ldrsb r0, [r4, r0] + adds r0, r1, r0 + cmp r0, 0 + beq _0809E8A8 + cmp r0, 0 + blt _0809E8A8 + bl BerryTreeTimeUpdate + ldr r2, [r6] + adds r2, 0xA0 + ldr r0, [r5] + ldr r1, [r5, 0x4] + str r0, [r2] + str r1, [r2, 0x4] +_0809E8A8: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809E858 + + thumb_func_start sub_809E8B4 +sub_809E8B4: @ 809E8B4 + push {lr} + bl sub_809E778 + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_809E8B4 + + thumb_func_start Special_StartWallClock +Special_StartWallClock: @ 809E8C8 + push {lr} + ldr r0, =Cb2_StartWallClock + bl SetMainCallback2 + ldr r1, =0x030022c0 + ldr r0, =sub_809E8B4 + str r0, [r1, 0x8] + pop {r0} + bx r0 + .pool + thumb_func_end Special_StartWallClock + + thumb_func_start sub_809E8E8 +sub_809E8E8: @ 809E8E8 + push {lr} + adds r3, r0, 0 + ldr r2, =0x03005e00 + movs r0, 0x2E + ldrsh r1, [r3, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0xC + ldrsh r1, [r0, r2] + movs r2, 0x30 + ldrsh r0, [r3, r2] + cmp r1, r0 + beq _0809E9FE + strh r1, [r3, 0x30] + subs r0, r1, 0x1 + cmp r0, 0x5 + bhi _0809E9FE + lsls r0, 2 + ldr r1, =_0809E920 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0809E920: + .4byte _0809E938 + .4byte _0809E95C + .4byte _0809E980 + .4byte _0809E9A4 + .4byte _0809E9CE + .4byte _0809E9F8 +_0809E938: + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r1, r3, 0 + adds r1, 0x2A + movs r0, 0x1 + strb r0, [r1] + subs r2, 0x12 + ldrb r1, [r2] + subs r0, 0x41 + ands r0, r1 + strb r0, [r2] + movs r0, 0x35 + b _0809E9C6 +_0809E95C: + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r1, r3, 0 + adds r1, 0x2A + movs r0, 0x1 + strb r0, [r1] + subs r2, 0x12 + ldrb r1, [r2] + subs r0, 0x41 + ands r0, r1 + strb r0, [r2] + movs r0, 0x56 + b _0809E9C6 +_0809E980: + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r1, r3, 0 + adds r1, 0x2A + movs r0, 0x1 + strb r0, [r1] + subs r2, 0x12 + ldrb r1, [r2] + subs r0, 0x41 + ands r0, r1 + strb r0, [r2] + movs r0, 0x65 + b _0809E9C6 +_0809E9A4: + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r1, r3, 0 + adds r1, 0x2A + movs r0, 0x1 + strb r0, [r1] + subs r2, 0x12 + ldrb r1, [r2] + subs r0, 0x41 + ands r0, r1 + strb r0, [r2] + movs r0, 0x74 +_0809E9C6: + strh r0, [r3, 0x20] + movs r0, 0x44 + strh r0, [r3, 0x22] + b _0809E9FE +_0809E9CE: + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r1, r3, 0 + adds r1, 0x2A + movs r0, 0x2 + strb r0, [r1] + subs r2, 0x12 + ldrb r1, [r2] + subs r0, 0x42 + ands r0, r1 + strb r0, [r2] + movs r0, 0x99 + strh r0, [r3, 0x20] + movs r0, 0x50 + strh r0, [r3, 0x22] + b _0809E9FE +_0809E9F8: + adds r0, r3, 0 + bl RemoveObjectAndFreeTiles +_0809E9FE: + pop {r0} + bx r0 + thumb_func_end sub_809E8E8 + + thumb_func_start sub_809EA04 +sub_809EA04: @ 809EA04 + push {lr} + adds r3, r0, 0 + ldr r2, =0x03005e00 + movs r0, 0x2E + ldrsh r1, [r3, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0xC + ldrsh r1, [r0, r2] + movs r2, 0x30 + ldrsh r0, [r3, r2] + cmp r1, r0 + beq _0809EAFE + strh r1, [r3, 0x30] + subs r0, r1, 0x1 + cmp r0, 0x5 + bhi _0809EAFE + lsls r0, 2 + ldr r1, =_0809EA3C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0809EA3C: + .4byte _0809EA54 + .4byte _0809EA78 + .4byte _0809EA9C + .4byte _0809EAC0 + .4byte _0809EAEA + .4byte _0809EAF8 +_0809EA54: + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r1, r3, 0 + adds r1, 0x2A + movs r0, 0 + strb r0, [r1] + subs r2, 0x12 + ldrb r1, [r2] + subs r0, 0x40 + ands r0, r1 + strb r0, [r2] + movs r0, 0x35 + b _0809EAE2 +_0809EA78: + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r1, r3, 0 + adds r1, 0x2A + movs r0, 0 + strb r0, [r1] + subs r2, 0x12 + ldrb r1, [r2] + subs r0, 0x40 + ands r0, r1 + strb r0, [r2] + movs r0, 0x56 + b _0809EAE2 +_0809EA9C: + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r1, r3, 0 + adds r1, 0x2A + movs r0, 0 + strb r0, [r1] + subs r2, 0x12 + ldrb r1, [r2] + subs r0, 0x40 + ands r0, r1 + strb r0, [r2] + movs r0, 0x65 + b _0809EAE2 +_0809EAC0: + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r1, r3, 0 + adds r1, 0x2A + movs r0, 0 + strb r0, [r1] + subs r2, 0x12 + ldrb r1, [r2] + subs r0, 0x40 + ands r0, r1 + strb r0, [r2] + movs r0, 0x74 +_0809EAE2: + strh r0, [r3, 0x20] + movs r0, 0x5C + strh r0, [r3, 0x22] + b _0809EAFE +_0809EAEA: + adds r0, r3, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + b _0809EAFE +_0809EAF8: + adds r0, r3, 0 + bl RemoveObjectAndFreeTiles +_0809EAFE: + pop {r0} + bx r0 + thumb_func_end sub_809EA04 + + thumb_func_start sub_809EB04 +sub_809EB04: @ 809EB04 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_085104C4 + bl LoadTaggedObjectPalette + ldr r0, =gUnknown_085104F0 + mov r8, r0 + movs r1, 0x35 + movs r2, 0x44 + movs r3, 0 + bl AddObjectToBack + lsls r0, 24 + lsrs r1, r0, 24 + ldr r6, =0x02020630 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, r6, 0 + adds r4, 0x1C + adds r2, r0, r4 + ldr r1, =sub_809E8E8 + str r1, [r2] + adds r0, r6 + strh r5, [r0, 0x2E] + ldr r1, =0x0000ffff + strh r1, [r0, 0x30] + mov r0, r8 + movs r1, 0x35 + movs r2, 0x44 + movs r3, 0 + bl AddObjectToBack + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, r0, r4 + ldr r1, =sub_809EA04 + str r1, [r4] + adds r0, r6 + strh r5, [r0, 0x2E] + movs r1, 0x1 + negs r1, r1 + strh r1, [r0, 0x30] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809EB04 + + thumb_func_start sub_809EB8C +sub_809EB8C: @ 809EB8C + push {lr} + ldr r0, =gUnknown_085104C4 + ldrh r0, [r0, 0x4] + bl FreeObjectPaletteByTag + pop {r0} + bx r0 + .pool + thumb_func_end sub_809EB8C + + thumb_func_start sub_809EBA0 +sub_809EBA0: @ 809EBA0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0 + bl sub_8198070 + adds r0, r4, 0 + bl RemoveWindow + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_809EBA0 + + thumb_func_start sub_809EBC4 +sub_809EBC4: @ 809EBC4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + mov r10, r0 + adds r0, r1, 0 + mov r9, r2 + adds r1, r3, 0 + ldr r5, [sp, 0x30] + ldr r6, [sp, 0x34] + ldr r2, [sp, 0x38] + mov r8, r2 + mov r2, r10 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + lsls r3, r0, 24 + lsrs r3, 24 + str r3, [sp, 0xC] + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r1, 16 + lsrs r1, 16 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + mov r2, r8 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + ldr r7, =0x02021fc4 + ldr r4, =0x02021cc4 + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalString + adds r0, r7, 0 + adds r1, r4, 0 + bl CopyString + adds r7, r0, 0 + ldr r1, =gUnknown_085EE68A + bl CopyString + adds r7, r0, 0 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + adds r0, r7, 0 + adds r1, r4, 0 + bl CopyString + adds r7, r0, 0 + ldr r5, =gUnknown_085EE68E + adds r1, r5, 0 + bl CopyString + adds r7, r0, 0 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalString + adds r0, r7, 0 + adds r1, r4, 0 + bl CopyString + adds r7, r0, 0 + adds r1, r5, 0 + bl CopyString + adds r7, r0, 0 + adds r0, r4, 0 + mov r1, r8 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalString + adds r0, r7, 0 + adds r1, r4, 0 + bl CopyString + ldr r2, =0x02021fc4 + mov r0, r9 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + mov r0, r10 + movs r1, 0x1 + ldr r3, [sp, 0xC] + bl Print + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809EBC4 + + thumb_func_start sub_809ECB4 +sub_809ECB4: @ 809ECB4 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0xC + adds r4, r0, 0 + mov r9, r1 + adds r5, r2, 0 + adds r6, r3, 0 + ldr r0, [sp, 0x24] + mov r8, r0 + lsls r4, 24 + lsrs r4, 24 + mov r0, r9 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r2, 0x85 + lsls r2, 2 + adds r0, r4, 0 + movs r1, 0 + movs r3, 0xE + bl SetWindowBorderStyle + str r5, [sp] + str r6, [sp, 0x4] + mov r0, r8 + str r0, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x1 + mov r3, r9 + bl sub_809EBC4 + ldr r2, =gUnknown_085EE690 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + movs r3, 0x7E + bl Print + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809ECB4 + + thumb_func_start sub_809ED38 +sub_809ED38: @ 809ED38 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r3, 16 + lsrs r3, 16 + adds r1, r3, 0 + movs r0, 0x80 + ands r0, r3 + cmp r0, 0 + beq _0809ED52 + ldrh r0, [r4] + subs r0, 0x1 + b _0809ED6C +_0809ED52: + movs r0, 0x40 + ands r0, r3 + cmp r0, 0 + beq _0809ED60 + ldrh r0, [r4] + adds r0, 0x1 + b _0809ED8A +_0809ED60: + movs r0, 0x20 + ands r0, r3 + cmp r0, 0 + beq _0809ED7A + ldrh r0, [r4] + subs r0, 0xA +_0809ED6C: + strh r0, [r4] + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, r5 + bge _0809ED96 + strh r2, [r4] + b _0809ED96 +_0809ED7A: + movs r0, 0x10 + ands r1, r0 + cmp r1, 0 + bne _0809ED86 + movs r0, 0 + b _0809ED98 +_0809ED86: + ldrh r0, [r4] + adds r0, 0xA +_0809ED8A: + strh r0, [r4] + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, r2 + ble _0809ED96 + strh r5, [r4] +_0809ED96: + movs r0, 0x1 +_0809ED98: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809ED38 + + thumb_func_start sub_809EDA0 +sub_809EDA0: @ 809EDA0 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0x1 + strh r0, [r1, 0x8] + bx lr + .pool + thumb_func_end sub_809EDA0 + + thumb_func_start sub_809EDB8 +sub_809EDB8: @ 809EDB8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r5, =0x03005e08 + adds r0, r4, r5 + ldrb r0, [r0, 0x10] + bl sub_809EBA0 + bl sub_809EB8C + subs r5, 0x8 + adds r4, r5 + ldr r0, =sub_809EDA0 + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809EDB8 + + thumb_func_start sub_809EDE8 +sub_809EDE8: @ 809EDE8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r7, r0, 3 + ldr r0, =0x03005e08 + mov r8, r0 + adds r5, r7, r0 + ldrb r4, [r5, 0x4] + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + ldr r1, =gUnknown_0851041C + adds r2, r0, r1 + ldr r1, =0x030022c0 + ldrh r3, [r1, 0x2E] + movs r0, 0x2 + ands r0, r3 + mov r12, r1 + cmp r0, 0 + beq _0809EE3C + mov r0, r8 + subs r0, 0x8 + adds r0, r7, r0 + ldr r1, =sub_809EDB8 + str r1, [r0] + movs r0, 0 + strh r0, [r5, 0x2] + movs r0, 0x6 + b _0809EE5C + .pool +_0809EE3C: + movs r0, 0x10 + ands r0, r3 + cmp r0, 0 + beq _0809EE4A + ldrb r0, [r2, 0x7] + cmp r0, 0 + bne _0809EE5C +_0809EE4A: + mov r3, r12 + ldrh r1, [r3, 0x2E] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0809EE66 + ldrb r0, [r2, 0x6] + cmp r0, 0 + beq _0809EE66 +_0809EE5C: + strh r0, [r5, 0x4] + movs r0, 0x5 + bl audio_play + b _0809EEF4 +_0809EE66: + cmp r4, 0x5 + bne _0809EEB4 + mov r0, r12 + ldrh r1, [r0, 0x2E] + movs r4, 0x1 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _0809EEF4 + ldr r1, =0x03005cf8 + ldrh r0, [r5, 0x6] + strh r0, [r1] + ldrh r0, [r5, 0x8] + strb r0, [r1, 0x2] + ldrh r0, [r5, 0xA] + strb r0, [r1, 0x3] + ldrh r0, [r5, 0xC] + strb r0, [r1, 0x4] + movs r0, 0x5 + bl audio_play + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_809EDB8 + str r1, [r0] + strh r4, [r5, 0x2] + movs r0, 0x6 + strh r0, [r5, 0x4] + b _0809EEF4 + .pool +_0809EEB4: + ldrb r0, [r2] + lsls r0, 1 + adds r0, r5, r0 + ldrh r1, [r2, 0x2] + ldrh r2, [r2, 0x4] + mov r3, r12 + ldrh r4, [r3, 0x30] + movs r3, 0xC0 + ands r3, r4 + bl sub_809ED38 + cmp r0, 0 + beq _0809EEF4 + movs r0, 0x5 + bl audio_play + ldrb r0, [r5, 0x10] + ldrh r3, [r5, 0x6] + ldrb r1, [r5, 0x8] + str r1, [sp] + ldrb r1, [r5, 0xA] + str r1, [sp, 0x4] + ldrb r1, [r5, 0xC] + str r1, [sp, 0x8] + movs r1, 0 + movs r2, 0x1 + bl sub_809EBC4 + ldrb r0, [r5, 0x10] + movs r1, 0x2 + bl CopyWindowToVram +_0809EEF4: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_809EDE8 + + thumb_func_start sub_809EF00 +sub_809EF00: @ 809EF00 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + mov r8, r0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r6, r0, 2 + add r6, r8 + lsls r6, 3 + ldr r0, =0x03005e08 + mov r9, r0 + adds r5, r6, r0 + movs r0, 0 + strh r0, [r5] + ldr r1, =0x03005cf8 + ldrh r0, [r1] + strh r0, [r5, 0x6] + movs r0, 0x2 + ldrsb r0, [r1, r0] + strh r0, [r5, 0x8] + movs r0, 0x3 + ldrsb r0, [r1, r0] + strh r0, [r5, 0xA] + movs r0, 0x4 + ldrsb r0, [r1, r0] + strh r0, [r5, 0xC] + ldr r0, =gUnknown_08510420 + bl AddWindow + strh r0, [r5, 0x10] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r5, 0x6] + ldrb r2, [r5, 0x8] + ldrb r3, [r5, 0xA] + ldrb r4, [r5, 0xC] + str r4, [sp] + bl sub_809ECB4 + mov r0, r8 + bl sub_809EB04 + movs r0, 0x2 + strh r0, [r5, 0x4] + movs r0, 0x8 + negs r0, r0 + add r9, r0 + add r6, r9 + ldr r0, =sub_809EDE8 + str r0, [r6] + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809EF00 + + thumb_func_start sub_809EF88 +sub_809EF88: @ 809EF88 + push {r4-r7,lr} + sub sp, 0x4 + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0 + bl SetVBlankCallback + movs r2, 0xA0 + lsls r2, 19 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, =0x040000d4 + mov r0, sp + str r0, [r1] + str r2, [r1, 0x4] + ldr r0, =0x81000200 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r2, 0xC0 + lsls r2, 19 + movs r3, 0xC0 + lsls r3, 9 + mov r4, sp + movs r6, 0 + movs r5, 0x80 + lsls r5, 5 + ldr r7, =0x81000800 + movs r0, 0x81 + lsls r0, 24 + mov r12, r0 +_0809EFCA: + strh r6, [r4] + mov r0, sp + str r0, [r1] + str r2, [r1, 0x4] + str r7, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r2, r5 + subs r3, r5 + cmp r3, r5 + bhi _0809EFCA + strh r6, [r4] + mov r0, sp + str r0, [r1] + str r2, [r1, 0x4] + lsrs r0, r3, 1 + mov r2, r12 + orrs r0, r2 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r0, 0 + movs r1, 0x80 + bl ResetSpriteRange + bl LoadOamFromSprites + bl remove_some_task + bl dp12_8087EA4 + bl ResetAllObjectData + bl clear_tasks + bl sub_80A1A74 + bl sub_809F048 + ldr r0, =sub_809F0AC + bl SetVBlankCallback + ldr r0, =sub_809F090 + bl SetMainCallback2 + ldr r0, =sub_809F200 + movs r1, 0x50 + bl AddTask + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809EF88 + + thumb_func_start sub_809F048 +sub_809F048: @ 809F048 + push {lr} + bl clear_scheduled_bg_copies_to_vram + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_08510404 + movs r0, 0 + movs r2, 0x1 + bl InitBgsFromTemplates + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + ldr r0, =gUnknown_08510408 + bl InitWindows + bl DeactivateAllTextPrinters + bl sub_81973A4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_809F048 + + thumb_func_start sub_809F090 +sub_809F090: @ 809F090 + push {lr} + bl RunActiveTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl do_scheduled_bg_tilemap_copies_to_vram + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_809F090 + + thumb_func_start sub_809F0AC +sub_809F0AC: @ 809F0AC + push {lr} + bl ProcessObjectCopyRequests + bl LoadOamFromSprites + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_809F0AC + + thumb_func_start sub_809F0C0 +sub_809F0C0: @ 809F0C0 + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + movs r2, 0x80 + lsls r2, 2 + movs r0, 0x1 + movs r1, 0 + movs r3, 0xF + bl sub_8197B1C + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0 + bl Print + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_809F0C0 + + thumb_func_start sub_809F0F8 +sub_809F0F8: @ 809F0F8 + push {r4-r7,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r6, r0, r1 + movs r0, 0 + ldrsh r5, [r6, r0] + cmp r5, 0 + beq _0809F11C + cmp r5, 0x1 + beq _0809F1B2 + b _0809F1F8 + .pool +_0809F11C: + movs r2, 0x85 + lsls r2, 2 + movs r0, 0 + movs r1, 0 + movs r3, 0xE + bl SetWindowBorderStyle + ldr r2, =gUnknown_085ECA0D + movs r0, 0x1 + str r0, [sp] + movs r4, 0xFF + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r3, 0 + bl Print + ldr r1, =0x03005cf8 + ldrh r3, [r1] + ldrb r0, [r1, 0x2] + str r0, [sp] + ldrb r0, [r1, 0x3] + str r0, [sp, 0x4] + ldrb r0, [r1, 0x4] + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0x11 + bl sub_809EBC4 + ldr r2, =gUnknown_085ECA22 + movs r0, 0x21 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r3, 0 + bl Print + ldr r0, =0x03005d90 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xA0 + ldrh r3, [r0] + adds r0, 0x2 + ldrb r0, [r0] + str r0, [sp] + adds r0, r1, 0 + adds r0, 0xA3 + ldrb r0, [r0] + str r0, [sp, 0x4] + adds r0, r1, 0 + adds r0, 0xA4 + ldrb r0, [r0] + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0x31 + bl sub_809EBC4 + ldr r0, =gUnknown_085EC9EC + bl sub_809F0C0 + movs r0, 0 + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldrh r0, [r6] + adds r0, 0x1 + strh r0, [r6] +_0809F1B2: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0809F1E4 + adds r0, r7, 0 + bl remove_task + bl Reset + b _0809F1F8 + .pool +_0809F1E4: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0809F1F8 + movs r0, 0x5 + bl audio_play + adds r0, r7, 0 + bl remove_task +_0809F1F8: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_809F0F8 + + thumb_func_start sub_809F200 +sub_809F200: @ 809F200 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r5, r0, r1 + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0x6 + bls _0809F21C + b _0809F404 +_0809F21C: + lsls r0, 2 + ldr r1, =_0809F230 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0809F230: + .4byte _0809F24C + .4byte _0809F268 + .4byte _0809F2B4 + .4byte _0809F310 + .4byte _0809F398 + .4byte _0809F3C8 + .4byte _0809F3EA +_0809F24C: + movs r0, 0x1 + negs r0, r0 + ldr r1, =0x0000ffff + str r1, [sp] + movs r1, 0x1 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + movs r0, 0x1 + strh r0, [r5] + b _0809F404 + .pool +_0809F268: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0809F276 + b _0809F404 +_0809F276: + ldr r0, =0x03006210 + ldrh r0, [r0] + cmp r0, 0 + beq _0809F282 + cmp r0, 0x2 + bne _0809F29C +_0809F282: + ldr r0, =gUnknown_085ECAA7 + bl sub_809F0C0 + movs r0, 0x5 + strh r0, [r5] + b _0809F404 + .pool +_0809F29C: + bl GameFreakRTC_CalcLocalDateTime + ldr r0, =sub_809F0F8 + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x2] + b _0809F334 + .pool +_0809F2B4: + ldr r2, =0x03005e00 + movs r0, 0x2 + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x4] + cmp r0, 0x1 + bne _0809F2CA + b _0809F404 +_0809F2CA: + movs r0, 0 + movs r1, 0 + bl sub_8198070 + ldr r0, =gUnknown_085ECA38 + bl sub_809F0C0 + ldr r2, =0x03005cf8 + ldr r0, =0x03005d90 + ldr r0, [r0] + adds r0, 0xA0 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r2] + str r1, [r2, 0x4] + ldr r0, =sub_809EF00 + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x2] + movs r0, 0x3 + strh r0, [r5] + b _0809F404 + .pool +_0809F310: + ldr r2, =0x03005e00 + movs r0, 0x2 + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r1, r0, r2 + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _0809F404 + movs r2, 0xA + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _0809F340 + ldrb r0, [r5, 0x2] + bl remove_task +_0809F334: + movs r0, 0x2 + strh r0, [r5] + b _0809F404 + .pool +_0809F340: + ldrb r0, [r5, 0x2] + bl remove_task + bl GameFreakRTC_Reset + ldr r4, =0x03005cf8 + movs r1, 0 + ldrsh r0, [r4, r1] + movs r1, 0x2 + ldrsb r1, [r4, r1] + movs r2, 0x3 + ldrsb r2, [r4, r2] + movs r3, 0x4 + ldrsb r3, [r4, r3] + bl GameFreakRTC_CalcRTCToLocalDelta + ldr r0, =0x03005d90 + ldr r2, [r0] + adds r2, 0xA0 + ldr r0, [r4] + ldr r1, [r4, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + ldr r0, =0x00004040 + ldrh r1, [r4] + bl VarSet + bl sub_809D5D8 + ldr r0, =gUnknown_085ECA4F + bl sub_809F0C0 + movs r0, 0x4 + strh r0, [r5] + b _0809F404 + .pool +_0809F398: + movs r0, 0 + bl save_game_when_memory_present + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809F3B8 + ldr r0, =gUnknown_085ECA8A + bl sub_809F0C0 + movs r0, 0x49 + bl audio_play + b _0809F3C4 + .pool +_0809F3B8: + ldr r0, =gUnknown_085ECA9A + bl sub_809F0C0 + movs r0, 0x16 + bl audio_play +_0809F3C4: + movs r0, 0x5 + strh r0, [r5] +_0809F3C8: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0809F404 + movs r0, 0x1 + negs r0, r0 + ldr r1, =0x0000ffff + str r1, [sp] + movs r1, 0x1 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + movs r0, 0x6 + strh r0, [r5] +_0809F3EA: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0809F404 + adds r0, r4, 0 + bl remove_task + bl FreeAllWindowBuffers + bl Reset +_0809F404: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809F200 + + thumb_func_start sub_809F41C +sub_809F41C: @ 809F41C + push {lr} + ldr r0, =0x00000861 + bl FlagSet + movs r0, 0x86 + lsls r0, 4 + bl FlagSet + ldr r0, =0x00000862 + bl FlagSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_809F41C + + thumb_func_start BuildStartMenuActions +BuildStartMenuActions: @ 809F440 + push {lr} + ldr r0, =0x0203760f + movs r1, 0 + strb r1, [r0] + bl is_c1_link_related_active + cmp r0, 0x1 + bne _0809F45C + bl BuildStartMenuActions_LinkMode + b _0809F4AC + .pool +_0809F45C: + bl InUnionRoom + cmp r0, 0x1 + bne _0809F46A + bl BuildStartMenuActions_UnionRoom + b _0809F4AC +_0809F46A: + bl GetSafariZoneFlag + cmp r0, 0x1 + bne _0809F478 + bl BuildStartMenuActions_SafariZone + b _0809F4AC +_0809F478: + bl InBattlePike + lsls r0, 24 + cmp r0, 0 + beq _0809F488 + bl BuildStartMenuActions_BattlePike + b _0809F4AC +_0809F488: + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _0809F498 + bl BuildStartMenuActions_BattlePyramid + b _0809F4AC +_0809F498: + bl in_multi_battle_room_with_var_condition + lsls r0, 24 + cmp r0, 0 + beq _0809F4A8 + bl BuildStartMenuActions_MultiBattleRoom + b _0809F4AC +_0809F4A8: + bl BuildStartMenuActions_Normal +_0809F4AC: + pop {r0} + bx r0 + thumb_func_end BuildStartMenuActions + + thumb_func_start AddStartMenuAction +@ void AddStartMenuAction(u8 entry) +AddStartMenuAction: @ 809F4B0 + push {lr} + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =0x02037610 + ldr r1, =0x0203760f + bl append_byte + pop {r0} + bx r0 + .pool + thumb_func_end AddStartMenuAction + + thumb_func_start BuildStartMenuActions_Normal +BuildStartMenuActions_Normal: @ 809F4CC + push {lr} + ldr r0, =0x00000861 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809F4E2 + movs r0, 0 + bl AddStartMenuAction +_0809F4E2: + movs r0, 0x86 + lsls r0, 4 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809F4F8 + movs r0, 0x1 + bl AddStartMenuAction +_0809F4F8: + movs r0, 0x2 + bl AddStartMenuAction + ldr r0, =0x00000862 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809F512 + movs r0, 0x3 + bl AddStartMenuAction +_0809F512: + movs r0, 0x4 + bl AddStartMenuAction + movs r0, 0x5 + bl AddStartMenuAction + movs r0, 0x6 + bl AddStartMenuAction + movs r0, 0x7 + bl AddStartMenuAction + pop {r0} + bx r0 + .pool + thumb_func_end BuildStartMenuActions_Normal + + thumb_func_start BuildStartMenuActions_SafariZone +BuildStartMenuActions_SafariZone: @ 809F538 + push {lr} + movs r0, 0x8 + bl AddStartMenuAction + movs r0, 0 + bl AddStartMenuAction + movs r0, 0x1 + bl AddStartMenuAction + movs r0, 0x2 + bl AddStartMenuAction + movs r0, 0x4 + bl AddStartMenuAction + movs r0, 0x6 + bl AddStartMenuAction + movs r0, 0x7 + bl AddStartMenuAction + pop {r0} + bx r0 + thumb_func_end BuildStartMenuActions_SafariZone + + thumb_func_start BuildStartMenuActions_LinkMode +BuildStartMenuActions_LinkMode: @ 809F568 + push {lr} + movs r0, 0x1 + bl AddStartMenuAction + movs r0, 0x2 + bl AddStartMenuAction + ldr r0, =0x00000862 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809F58A + movs r0, 0x3 + bl AddStartMenuAction +_0809F58A: + movs r0, 0x9 + bl AddStartMenuAction + movs r0, 0x6 + bl AddStartMenuAction + movs r0, 0x7 + bl AddStartMenuAction + pop {r0} + bx r0 + .pool + thumb_func_end BuildStartMenuActions_LinkMode + + thumb_func_start BuildStartMenuActions_UnionRoom +BuildStartMenuActions_UnionRoom: @ 809F5A4 + push {lr} + movs r0, 0x1 + bl AddStartMenuAction + movs r0, 0x2 + bl AddStartMenuAction + ldr r0, =0x00000862 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809F5C6 + movs r0, 0x3 + bl AddStartMenuAction +_0809F5C6: + movs r0, 0x4 + bl AddStartMenuAction + movs r0, 0x6 + bl AddStartMenuAction + movs r0, 0x7 + bl AddStartMenuAction + pop {r0} + bx r0 + .pool + thumb_func_end BuildStartMenuActions_UnionRoom + + thumb_func_start BuildStartMenuActions_BattlePike +BuildStartMenuActions_BattlePike: @ 809F5E0 + push {lr} + movs r0, 0 + bl AddStartMenuAction + movs r0, 0x1 + bl AddStartMenuAction + movs r0, 0x4 + bl AddStartMenuAction + movs r0, 0x6 + bl AddStartMenuAction + movs r0, 0x7 + bl AddStartMenuAction + pop {r0} + bx r0 + thumb_func_end BuildStartMenuActions_BattlePike + + thumb_func_start BuildStartMenuActions_BattlePyramid +BuildStartMenuActions_BattlePyramid: @ 809F604 + push {lr} + movs r0, 0x1 + bl AddStartMenuAction + movs r0, 0xC + bl AddStartMenuAction + movs r0, 0x4 + bl AddStartMenuAction + movs r0, 0xA + bl AddStartMenuAction + movs r0, 0xB + bl AddStartMenuAction + movs r0, 0x6 + bl AddStartMenuAction + movs r0, 0x7 + bl AddStartMenuAction + pop {r0} + bx r0 + thumb_func_end BuildStartMenuActions_BattlePyramid + + thumb_func_start BuildStartMenuActions_MultiBattleRoom +BuildStartMenuActions_MultiBattleRoom: @ 809F634 + push {lr} + movs r0, 0x1 + bl AddStartMenuAction + movs r0, 0x4 + bl AddStartMenuAction + movs r0, 0x6 + bl AddStartMenuAction + movs r0, 0x7 + bl AddStartMenuAction + pop {r0} + bx r0 + thumb_func_end BuildStartMenuActions_MultiBattleRoom + + thumb_func_start sub_809F654 +sub_809F654: @ 809F654 + push {r4,r5,lr} + sub sp, 0xC + ldr r4, =0x0203760c + ldr r0, =gUnknown_08510508 + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + bl PutWindowTilemap + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldr r0, =0x02021cc4 + ldr r1, =0x0203a04c + ldrb r1, [r1] + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r5, =0x02021fc4 + ldr r1, =gUnknown_085EE6FF + adds r0, r5, 0 + bl ExpandStringRefs + ldrb r0, [r4] + movs r1, 0x1 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + movs r3, 0 + bl Print + ldrb r0, [r4] + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809F654 + + thumb_func_start sub_809F6C8 +sub_809F6C8: @ 809F6C8 + push {r4,r5,lr} + sub sp, 0xC + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0x7 + bne _0809F6F0 + ldr r4, =0x0203760d + ldr r0, =gUnknown_08510538 + b _0809F6F4 + .pool +_0809F6F0: + ldr r4, =0x0203760d + ldr r0, =gUnknown_08510530 +_0809F6F4: + bl AddWindow + strb r0, [r4] + ldr r4, =0x0203760d + ldrb r0, [r4] + bl PutWindowTilemap + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldr r0, =0x02021cc4 + ldr r2, =gUnknown_08510510 + ldr r1, =0x03005d90 + ldr r1, [r1] + ldr r3, =0x00000cb2 + adds r1, r3 + ldrh r1, [r1] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl CopyString + ldr r5, =0x02021fc4 + ldr r1, =gUnknown_085EE716 + adds r0, r5, 0 + bl ExpandStringRefs + ldrb r0, [r4] + movs r1, 0x1 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + movs r3, 0 + bl Print + ldrb r0, [r4] + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809F6C8 + + thumb_func_start RemoveExtraStartMenuWindows +RemoveExtraStartMenuWindows: @ 809F774 + push {r4,lr} + bl GetSafariZoneFlag + cmp r0, 0 + beq _0809F796 + ldr r4, =0x0203760c + ldrb r0, [r4] + movs r1, 0 + bl sub_8198070 + ldrb r0, [r4] + movs r1, 0x2 + bl CopyWindowToVram + ldrb r0, [r4] + bl RemoveWindow +_0809F796: + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _0809F7B0 + ldr r4, =0x0203760d + ldrb r0, [r4] + movs r1, 0 + bl sub_8198070 + ldrb r0, [r4] + bl RemoveWindow +_0809F7B0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end RemoveExtraStartMenuWindows + + thumb_func_start PrintStartMenuActions +PrintStartMenuActions: @ 809F7C0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + mov r8, r0 + adds r6, r1, 0 + ldrb r2, [r0] + ldr r0, =gUnknown_08510540 + mov r9, r0 + ldr r1, =0x02021fc4 + mov r10, r1 +_0809F7DA: + ldr r0, =0x02037610 + lsls r2, 24 + asrs r4, r2, 24 + adds r5, r4, r0 + ldrb r0, [r5] + lsls r3, r0, 3 + mov r0, r9 + adds r0, 0x4 + adds r0, r3, r0 + ldr r1, [r0] + ldr r0, =StartMenu_PlayerName + adds r7, r2, 0 + cmp r1, r0 + bne _0809F828 + bl get_start_menu_window_id_maybe + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r5] + lsls r1, 3 + add r1, r9 + ldr r1, [r1] + lsls r3, r4, 4 + adds r3, 0x9 + lsls r3, 16 + lsrs r3, 16 + movs r2, 0x8 + bl sub_819A024 + b _0809F858 + .pool +_0809F828: + mov r1, r9 + adds r0, r3, r1 + ldr r1, [r0] + mov r0, r10 + bl ExpandStringRefs + bl get_start_menu_window_id_maybe + lsls r0, 24 + lsrs r0, 24 + lsls r1, r4, 4 + adds r1, 0x9 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + mov r2, r10 + movs r3, 0x8 + bl Print +_0809F858: + movs r0, 0x80 + lsls r0, 17 + adds r1, r7, r0 + lsrs r2, r1, 24 + asrs r1, 24 + ldr r0, =0x0203760f + ldrb r0, [r0] + cmp r1, r0 + bge _0809F87C + subs r6, 0x1 + cmp r6, 0 + bne _0809F7DA + mov r1, r8 + strb r2, [r1] + movs r0, 0 + b _0809F882 + .pool +_0809F87C: + mov r0, r8 + strb r2, [r0] + movs r0, 0x1 +_0809F882: + 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 PrintStartMenuActions + + thumb_func_start sub_809F894 +sub_809F894: @ 809F894 + push {r4,lr} + sub sp, 0xC + ldr r0, =0x02037619 + movs r1, 0 + ldrsb r1, [r0, r1] + adds r2, r0, 0 + cmp r1, 0x5 + bhi _0809F98C + lsls r0, r1, 2 + ldr r1, =_0809F8B8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0809F8B8: + .4byte _0809F8D0 + .4byte _0809F8D8 + .4byte _0809F8E4 + .4byte _0809F90C + .4byte _0809F930 + .4byte _0809F94C +_0809F8D0: + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + b _0809F98C +_0809F8D8: + bl BuildStartMenuActions + ldr r1, =0x02037619 + b _0809F940 + .pool +_0809F8E4: + bl sub_81973A4 + ldr r0, =0x0203760f + ldrb r0, [r0] + bl sub_81979C4 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_81973FC + ldr r1, =0x02037619 + movs r0, 0 + strb r0, [r1, 0x1] + b _0809F940 + .pool +_0809F90C: + bl GetSafariZoneFlag + cmp r0, 0 + beq _0809F918 + bl sub_809F654 +_0809F918: + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _0809F926 + bl sub_809F6C8 +_0809F926: + ldr r1, =0x02037619 + b _0809F940 + .pool +_0809F930: + ldr r4, =0x0203761a + adds r0, r4, 0 + movs r1, 0x2 + bl PrintStartMenuActions + cmp r0, 0 + beq _0809F98C + subs r1, r4, 0x1 +_0809F940: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0809F98C + .pool +_0809F94C: + bl get_start_menu_window_id_maybe + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x10 + str r1, [sp] + ldr r1, =0x0203760f + ldrb r1, [r1] + str r1, [sp, 0x4] + ldr r4, =0x0203760e + ldrb r1, [r4] + str r1, [sp, 0x8] + movs r1, 0x1 + movs r2, 0 + movs r3, 0x9 + bl sub_81983AC + strb r0, [r4] + bl get_start_menu_window_id_maybe + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl CopyWindowToVram + movs r0, 0x1 + b _0809F98E + .pool +_0809F98C: + movs r0, 0 +_0809F98E: + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809F894 + + thumb_func_start sub_809F998 +sub_809F998: @ 809F998 + push {lr} + ldr r1, =0x02037619 + movs r0, 0 + strb r0, [r1] + strb r0, [r1, 0x1] +_0809F9A2: + bl sub_809F894 + cmp r0, 0 + beq _0809F9A2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_809F998 + + thumb_func_start task50_startmenu +task50_startmenu: @ 809F9B4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_809F894 + cmp r0, 0x1 + bne _0809F9C8 + adds r0, r4, 0 + bl set_task_function_to_args_14_15 +_0809F9C8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end task50_startmenu + + thumb_func_start sub_809F9D0 +sub_809F9D0: @ 809F9D0 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r1, =0x02037619 + movs r0, 0 + strb r0, [r1] + strb r0, [r1, 0x1] + ldr r4, =task50_startmenu + adds r0, r4, 0 + movs r1, 0x50 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + adds r2, r5, 0 + bl set_task_function_and_args_14_15 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809F9D0 + + thumb_func_start sub_809FA00 +sub_809FA00: @ 809FA00 + push {lr} + bl sub_809F894 + cmp r0, 0 + beq _0809FA12 + bl sub_80AF688 + movs r0, 0x1 + b _0809FA14 +_0809FA12: + movs r0, 0 +_0809FA14: + pop {r1} + bx r1 + thumb_func_end sub_809FA00 + + thumb_func_start sub_809FA18 +sub_809FA18: @ 809FA18 + ldr r1, =0x02037619 + movs r0, 0 + strb r0, [r1] + strb r0, [r1, 0x1] + ldr r1, =0x03005db0 + ldr r0, =sub_809FA00 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_809FA18 + + thumb_func_start sub_809FA34 +sub_809FA34: @ 809FA34 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0809FA58 + cmp r0, 0x1 + beq _0809FA7C + b _0809FA92 + .pool +_0809FA58: + bl InUnionRoom + cmp r0, 0x1 + bne _0809FA64 + bl var_800D_set_xB +_0809FA64: + ldr r1, =0x03005df4 + ldr r0, =HandleStartMenuInput + str r0, [r1] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0809FA92 + .pool +_0809FA7C: + ldr r0, =0x03005df4 + ldr r0, [r0] + bl _call_via_r0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809FA92 + adds r0, r5, 0 + bl remove_task +_0809FA92: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809FA34 + + thumb_func_start sub_809FA9C +sub_809FA9C: @ 809FA9C + push {lr} + bl is_c1_link_related_active + cmp r0, 0 + bne _0809FAB2 + bl player_bitmagic + bl sub_808B864 + bl sub_808BCF4 +_0809FAB2: + ldr r0, =sub_809FA34 + bl sub_809F9D0 + bl script_env_2_enable + pop {r0} + bx r0 + .pool + thumb_func_end sub_809FA9C + + thumb_func_start HandleStartMenuInput +HandleStartMenuInput: @ 809FAC4 + push {r4,lr} + ldr r4, =0x030022c0 + ldrh r1, [r4, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0809FAE4 + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + negs r0, r0 + bl MoveMenuCursor + ldr r1, =0x0203760e + strb r0, [r1] +_0809FAE4: + ldrh r1, [r4, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0809FAFE + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + bl MoveMenuCursor + ldr r1, =0x0203760e + strb r0, [r1] +_0809FAFE: + ldrh r1, [r4, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0809FB98 + movs r0, 0x5 + bl audio_play + ldr r1, =gUnknown_08510540 + ldr r2, =0x02037610 + ldr r0, =0x0203760e + ldrb r0, [r0] + adds r0, r2 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + adds r0, r1 + ldr r1, [r0] + ldr r0, =StartMenu_Pokedex + cmp r1, r0 + bne _0809FB34 + movs r0, 0 + bl pokedex_count + lsls r0, 16 + cmp r0, 0 + beq _0809FBA0 +_0809FB34: + ldr r3, =0x03005df4 + ldr r1, =gUnknown_08510540 + ldr r2, =0x02037610 + ldr r0, =0x0203760e + ldrb r0, [r0] + adds r0, r2 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + adds r0, r1 + ldr r1, [r0] + str r1, [r3] + ldr r0, =StartMenu_Save + cmp r1, r0 + beq _0809FBA0 + ldr r0, =StartMenu_Exit + cmp r1, r0 + beq _0809FBA0 + ldr r0, =StartMenu_SafariZoneRetire + cmp r1, r0 + beq _0809FBA0 + ldr r0, =StartMenu_BattlePyramidRetire + cmp r1, r0 + beq _0809FBA0 + movs r0, 0x1 + movs r1, 0 + bl fade_screen + b _0809FBA0 + .pool +_0809FB98: + movs r0, 0xA + ands r0, r1 + cmp r0, 0 + bne _0809FBA4 +_0809FBA0: + movs r0, 0 + b _0809FBAE +_0809FBA4: + bl RemoveExtraStartMenuWindows + bl sub_80A0934 + movs r0, 0x1 +_0809FBAE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end HandleStartMenuInput + + thumb_func_start StartMenu_Pokedex +StartMenu_Pokedex: @ 809FBB4 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0809FBCC + movs r0, 0 + b _0809FBE6 + .pool +_0809FBCC: + movs r0, 0x29 + bl sav12_xor_increment + bl play_some_sound + bl RemoveExtraStartMenuWindows + bl overworld_free_bg_tilemaps + ldr r0, =sub_80BB534 + bl SetMainCallback2 + movs r0, 0x1 +_0809FBE6: + pop {r1} + bx r1 + .pool + thumb_func_end StartMenu_Pokedex + + thumb_func_start StartMenu_Pokemon +StartMenu_Pokemon: @ 809FBF0 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0809FC08 + movs r0, 0 + b _0809FC1C + .pool +_0809FC08: + bl play_some_sound + bl RemoveExtraStartMenuWindows + bl overworld_free_bg_tilemaps + ldr r0, =CB2_PartyMenuFromStartMenu + bl SetMainCallback2 + movs r0, 0x1 +_0809FC1C: + pop {r1} + bx r1 + .pool + thumb_func_end StartMenu_Pokemon + + thumb_func_start StartMenu_Bag +StartMenu_Bag: @ 809FC24 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0809FC3C + movs r0, 0 + b _0809FC50 + .pool +_0809FC3C: + bl play_some_sound + bl RemoveExtraStartMenuWindows + bl overworld_free_bg_tilemaps + ldr r0, =CB2_BagMenuFromStartMenu + bl SetMainCallback2 + movs r0, 0x1 +_0809FC50: + pop {r1} + bx r1 + .pool + thumb_func_end StartMenu_Bag + + thumb_func_start StartMenu_PokeNav +StartMenu_PokeNav: @ 809FC58 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0809FC70 + movs r0, 0 + b _0809FC84 + .pool +_0809FC70: + bl play_some_sound + bl RemoveExtraStartMenuWindows + bl overworld_free_bg_tilemaps + ldr r0, =CB2_PokeNav + bl SetMainCallback2 + movs r0, 0x1 +_0809FC84: + pop {r1} + bx r1 + .pool + thumb_func_end StartMenu_PokeNav + + thumb_func_start StartMenu_PlayerName +StartMenu_PlayerName: @ 809FC8C + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0809FCF4 + bl play_some_sound + bl RemoveExtraStartMenuWindows + bl overworld_free_bg_tilemaps + bl is_c1_link_related_active + cmp r0, 0 + bne _0809FCB6 + bl InUnionRoom + cmp r0, 0 + beq _0809FCC8 +_0809FCB6: + ldr r0, =sub_8086194 + bl sub_80C4DDC + b _0809FCEA + .pool +_0809FCC8: + ldr r0, =0x000008d2 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0809FCE4 + ldr r0, =sub_8086194 + bl sub_80C51C4 + b _0809FCEA + .pool +_0809FCE4: + ldr r0, =sub_8086194 + bl sub_80C4DDC +_0809FCEA: + movs r0, 0x1 + b _0809FCF6 + .pool +_0809FCF4: + movs r0, 0 +_0809FCF6: + pop {r1} + bx r1 + thumb_func_end StartMenu_PlayerName + + thumb_func_start StartMenu_Save +StartMenu_Save: @ 809FCFC + push {lr} + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _0809FD0C + bl RemoveExtraStartMenuWindows +_0809FD0C: + ldr r1, =0x03005df4 + ldr r0, =sub_809FE28 + str r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end StartMenu_Save + + thumb_func_start StartMenu_Option +StartMenu_Option: @ 809FD20 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0809FD38 + movs r0, 0 + b _0809FD52 + .pool +_0809FD38: + bl play_some_sound + bl RemoveExtraStartMenuWindows + bl overworld_free_bg_tilemaps + ldr r0, =CB2_OptionsMenu + bl SetMainCallback2 + ldr r1, =0x030022c0 + ldr r0, =sub_8086194 + str r0, [r1, 0x8] + movs r0, 0x1 +_0809FD52: + pop {r1} + bx r1 + .pool + thumb_func_end StartMenu_Option + + thumb_func_start StartMenu_Exit +StartMenu_Exit: @ 809FD64 + push {lr} + bl RemoveExtraStartMenuWindows + bl sub_80A0934 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end StartMenu_Exit + + thumb_func_start StartMenu_SafariZoneRetire +StartMenu_SafariZoneRetire: @ 809FD74 + push {lr} + bl RemoveExtraStartMenuWindows + bl sub_80A0934 + bl sub_80FC180 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end StartMenu_SafariZoneRetire + + thumb_func_start StartMenu_LinkModePlayerName +StartMenu_LinkModePlayerName: @ 809FD88 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0809FDA0 + movs r0, 0 + b _0809FDB4 + .pool +_0809FDA0: + bl play_some_sound + bl overworld_free_bg_tilemaps + ldr r0, =0x03005db4 + ldrb r0, [r0] + ldr r1, =sub_8086194 + bl sub_80C4E74 + movs r0, 0x1 +_0809FDB4: + pop {r1} + bx r1 + .pool + thumb_func_end StartMenu_LinkModePlayerName + + thumb_func_start StartMenu_BattlePyramidRetire +StartMenu_BattlePyramidRetire: @ 809FDC0 + ldr r1, =0x03005df4 + ldr r0, =sub_809FE9C + str r0, [r1] + movs r0, 0 + bx lr + .pool + thumb_func_end StartMenu_BattlePyramidRetire + + thumb_func_start sub_809FDD4 +sub_809FDD4: @ 809FDD4 + push {lr} + movs r0, 0 + movs r1, 0 + bl sub_8197DF8 + bl sub_80984F4 + ldr r0, =sub_809FA34 + bl sub_809F9D0 + bl script_env_2_enable + pop {r0} + bx r0 + .pool + thumb_func_end sub_809FDD4 + + thumb_func_start StartMenu_BattlePyramidBag +StartMenu_BattlePyramidBag: @ 809FDF4 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0809FE0C + movs r0, 0 + b _0809FE20 + .pool +_0809FE0C: + bl play_some_sound + bl RemoveExtraStartMenuWindows + bl overworld_free_bg_tilemaps + ldr r0, =sub_81C4EFC + bl SetMainCallback2 + movs r0, 0x1 +_0809FE20: + pop {r1} + bx r1 + .pool + thumb_func_end StartMenu_BattlePyramidBag + + thumb_func_start sub_809FE28 +sub_809FE28: @ 809FE28 + push {lr} + bl sub_809FF28 + ldr r1, =0x03005df4 + ldr r0, =sub_809FE44 + str r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_809FE28 + + thumb_func_start sub_809FE44 +sub_809FE44: @ 809FE44 + push {lr} + bl sub_809FF4C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809FE7C + cmp r0, 0x1 + ble _0809FE94 + cmp r0, 0x2 + beq _0809FE60 + cmp r0, 0x3 + beq _0809FE7C + b _0809FE94 +_0809FE60: + movs r0, 0 + movs r1, 0 + bl sub_8197DF8 + bl sub_809F998 + ldr r1, =0x03005df4 + ldr r0, =HandleStartMenuInput + str r0, [r1] + b _0809FE94 + .pool +_0809FE7C: + movs r0, 0 + movs r1, 0x1 + bl sub_8197DF8 + bl sub_80984F4 + bl script_env_2_disable + bl sub_81A9EC8 + movs r0, 0x1 + b _0809FE96 +_0809FE94: + movs r0, 0 +_0809FE96: + pop {r1} + bx r1 + thumb_func_end sub_809FE44 + + thumb_func_start sub_809FE9C +sub_809FE9C: @ 809FE9C + push {lr} + bl sub_80A0340 + ldr r1, =0x03005df4 + ldr r0, =sub_809FED4 + str r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_809FE9C + + thumb_func_start sub_809FEB8 +sub_809FEB8: @ 809FEB8 + push {lr} + bl sub_809F998 + ldr r1, =0x03005df4 + ldr r0, =HandleStartMenuInput + str r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_809FEB8 + + thumb_func_start sub_809FED4 +sub_809FED4: @ 809FED4 + push {lr} + bl sub_809FF4C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809FEEC + cmp r0, 0x1 + ble _0809FF20 + cmp r0, 0x2 + beq _0809FF00 + b _0809FF20 +_0809FEEC: + bl RemoveExtraStartMenuWindows + ldr r1, =0x03005df4 + ldr r0, =sub_809FEB8 + str r0, [r1] + b _0809FF20 + .pool +_0809FF00: + movs r0, 0 + movs r1, 0x1 + bl sub_8197DF8 + bl sub_80984F4 + bl script_env_2_disable + ldr r0, =gUnknown_08252C88 + bl script_env_1_execute_new_script + movs r0, 0x1 + b _0809FF22 + .pool +_0809FF20: + movs r0, 0 +_0809FF22: + pop {r1} + bx r1 + thumb_func_end sub_809FED4 + + thumb_func_start sub_809FF28 +sub_809FF28: @ 809FF28 + push {lr} + bl save_serialize_map + ldr r1, =0x0203761c + ldr r0, =sub_80A00A0 + str r0, [r1] + ldr r1, =0x02037621 + movs r0, 0 + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_809FF28 + + thumb_func_start sub_809FF4C +sub_809FF4C: @ 809FF4C + push {lr} + bl sub_8197224 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + beq _0809FF78 + ldr r1, =0x02037621 + movs r0, 0 + strb r0, [r1] + ldr r0, =0x0203761c + ldr r0, [r0] + bl _call_via_r0 + lsls r0, 24 + lsrs r0, 24 + b _0809FF7A + .pool +_0809FF78: + movs r0, 0 +_0809FF7A: + pop {r1} + bx r1 + thumb_func_end sub_809FF4C + + thumb_func_start sub_809FF80 +sub_809FF80: @ 809FF80 + push {lr} + bl sub_809FF28 + ldr r0, =task50_save_game + movs r1, 0x50 + bl AddTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_809FF80 + + thumb_func_start sub_809FF98 +sub_809FF98: @ 809FF98 + push {r4,lr} + adds r2, r0, 0 + adds r4, r1, 0 + ldr r0, =0x02021fc4 + adds r1, r2, 0 + bl ExpandStringRefs + movs r0, 0 + movs r1, 0x1 + bl sub_819786C + movs r0, 0x1 + bl AddTextPrinterForMessage_2 + ldr r1, =0x02037621 + movs r0, 0x1 + strb r0, [r1] + ldr r0, =0x0203761c + str r4, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809FF98 + + thumb_func_start task50_save_game +task50_save_game: @ 809FFD0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_809FF4C + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1 + beq _0809FFFC + cmp r1, 0x1 + bgt _0809FFEC + cmp r1, 0 + beq _080A000A + b _080A0000 +_0809FFEC: + cmp r1, 0x3 + bgt _080A0000 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + b _080A0000 + .pool +_0809FFFC: + ldr r0, =0x020375f0 + strh r1, [r0] +_080A0000: + adds r0, r4, 0 + bl remove_task + bl script_env_2_enable_and_set_ctx_running +_080A000A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task50_save_game + + thumb_func_start sub_80A0014 +sub_80A0014: @ 80A0014 + push {lr} + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + pop {r0} + bx r0 + thumb_func_end sub_80A0014 + + thumb_func_start sub_80A0024 +sub_80A0024: @ 80A0024 + push {lr} + bl sub_80A0888 + pop {r0} + bx r0 + thumb_func_end sub_80A0024 + + thumb_func_start sub_80A0030 +sub_80A0030: @ 80A0030 + ldr r1, =0x02037620 + movs r0, 0x3C + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_80A0030 + + thumb_func_start sub_80A003C +sub_80A003C: @ 80A003C + push {lr} + ldr r1, =0x02037620 + ldrb r0, [r1] + subs r2, r0, 0x1 + strb r2, [r1] + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2C] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080A0064 + lsls r0, r2, 24 + cmp r0, 0 + beq _080A006A + movs r0, 0 + b _080A006C + .pool +_080A0064: + movs r0, 0x5 + bl audio_play +_080A006A: + movs r0, 0x1 +_080A006C: + pop {r1} + bx r1 + thumb_func_end sub_80A003C + + thumb_func_start sub_80A0070 +sub_80A0070: @ 80A0070 + push {lr} + ldr r1, =0x02037620 + ldrb r0, [r1] + cmp r0, 0 + bne _080A0094 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2C] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080A0098 + movs r0, 0x1 + b _080A009A + .pool +_080A0094: + subs r0, 0x1 + strb r0, [r1] +_080A0098: + movs r0, 0 +_080A009A: + pop {r1} + bx r1 + thumb_func_end sub_80A0070 + + thumb_func_start sub_80A00A0 +sub_80A00A0: @ 80A00A0 + push {lr} + bl get_start_menu_window_id_maybe + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_819746C + bl remove_start_menu_window_maybe + bl sub_80A06B4 + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _080A00D4 + ldr r0, =gUnknown_08252CA7 + ldr r1, =sub_80A00EC + bl sub_809FF98 + b _080A00DC + .pool +_080A00D4: + ldr r0, =gUnknown_082C87B4 + ldr r1, =sub_80A00EC + bl sub_809FF98 +_080A00DC: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A00A0 + + thumb_func_start sub_80A00EC +sub_80A00EC: @ 80A00EC + push {lr} + bl sub_8197930 + ldr r1, =0x0203761c + ldr r0, =sub_80A0108 + str r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A00EC + + thumb_func_start sub_80A0108 +sub_80A0108: @ 80A0108 + push {lr} + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _080A012A + cmp r1, 0 + bgt _080A0124 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080A0168 + b _080A0174 +_080A0124: + cmp r1, 0x1 + beq _080A0168 + b _080A0174 +_080A012A: + ldr r0, =0x03006210 + ldrh r0, [r0] + cmp r0, 0 + beq _080A0136 + cmp r0, 0x2 + bne _080A013E +_080A0136: + ldr r0, =0x020322d4 + ldrb r0, [r0] + cmp r0, 0 + bne _080A0158 +_080A013E: + ldr r1, =0x0203761c + ldr r0, =sub_80A017C + str r0, [r1] + b _080A0174 + .pool +_080A0158: + ldr r1, =0x0203761c + ldr r0, =sub_80A0234 + str r0, [r1] + b _080A0174 + .pool +_080A0168: + bl sub_80A0024 + bl sub_80A0014 + movs r0, 0x2 + b _080A0176 +_080A0174: + movs r0, 0 +_080A0176: + pop {r1} + bx r1 + thumb_func_end sub_80A0108 + + thumb_func_start sub_80A017C +sub_80A017C: @ 80A017C + push {lr} + ldr r0, =0x020322d4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080A019C + ldr r0, =gUnknown_082C8845 + ldr r1, =sub_80A01B4 + bl sub_809FF98 + b _080A01A4 + .pool +_080A019C: + ldr r0, =gUnknown_082C87D5 + ldr r1, =sub_80A01D0 + bl sub_809FF98 +_080A01A4: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A017C + + thumb_func_start sub_80A01B4 +sub_80A01B4: @ 80A01B4 + push {lr} + movs r0, 0x1 + bl sub_8197948 + ldr r1, =0x0203761c + ldr r0, =sub_80A01EC + str r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A01B4 + + thumb_func_start sub_80A01D0 +sub_80A01D0: @ 80A01D0 + push {lr} + bl sub_8197930 + ldr r1, =0x0203761c + ldr r0, =sub_80A01EC + str r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A01D0 + + thumb_func_start sub_80A01EC +sub_80A01EC: @ 80A01EC + push {lr} + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _080A020E + cmp r1, 0 + bgt _080A0208 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080A0220 + b _080A022C +_080A0208: + cmp r1, 0x1 + beq _080A0220 + b _080A022C +_080A020E: + ldr r1, =0x0203761c + ldr r0, =sub_80A0234 + str r0, [r1] + b _080A022C + .pool +_080A0220: + bl sub_80A0024 + bl sub_80A0014 + movs r0, 0x2 + b _080A022E +_080A022C: + movs r0, 0 +_080A022E: + pop {r1} + bx r1 + thumb_func_end sub_80A01EC + + thumb_func_start sub_80A0234 +sub_80A0234: @ 80A0234 + push {lr} + ldr r0, =gUnknown_082C8810 + ldr r1, =sub_80A024C + bl sub_809FF98 + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A0234 + + thumb_func_start sub_80A024C +sub_80A024C: @ 80A024C + push {r4,lr} + movs r0, 0 + bl sav12_xor_increment + bl sub_81A9E90 + ldr r4, =0x020322d4 + ldrb r0, [r4] + cmp r0, 0x1 + bne _080A0274 + movs r0, 0x4 + bl save_game_when_memory_present + lsls r0, 24 + lsrs r1, r0, 24 + movs r0, 0 + strb r0, [r4] + b _080A027E + .pool +_080A0274: + movs r0, 0 + bl save_game_when_memory_present + lsls r0, 24 + lsrs r1, r0, 24 +_080A027E: + cmp r1, 0x1 + bne _080A0294 + ldr r0, =gUnknown_082C8832 + ldr r1, =sub_80A02B0 + bl sub_809FF98 + b _080A029C + .pool +_080A0294: + ldr r0, =gUnknown_082C892A + ldr r1, =sub_80A02FC + bl sub_809FF98 +_080A029C: + bl sub_80A0030 + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A024C + + thumb_func_start sub_80A02B0 +sub_80A02B0: @ 80A02B0 + push {lr} + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _080A02CA + movs r0, 0x37 + bl audio_play + ldr r1, =0x0203761c + ldr r0, =sub_80A02D8 + str r0, [r1] +_080A02CA: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A02B0 + + thumb_func_start sub_80A02D8 +sub_80A02D8: @ 80A02D8 + push {lr} + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + bne _080A02F6 + bl sub_80A003C + lsls r0, 24 + cmp r0, 0 + beq _080A02F6 + bl sub_80A0024 + movs r0, 0x1 + b _080A02F8 +_080A02F6: + movs r0, 0 +_080A02F8: + pop {r1} + bx r1 + thumb_func_end sub_80A02D8 + + thumb_func_start sub_80A02FC +sub_80A02FC: @ 80A02FC + push {lr} + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _080A0316 + movs r0, 0x16 + bl audio_play + ldr r1, =0x0203761c + ldr r0, =sub_80A0324 + str r0, [r1] +_080A0316: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A02FC + + thumb_func_start sub_80A0324 +sub_80A0324: @ 80A0324 + push {lr} + bl sub_80A0070 + lsls r0, 24 + cmp r0, 0 + beq _080A0338 + bl sub_80A0024 + movs r0, 0x3 + b _080A033A +_080A0338: + movs r0, 0 +_080A033A: + pop {r1} + bx r1 + thumb_func_end sub_80A0324 + + thumb_func_start sub_80A0340 +sub_80A0340: @ 80A0340 + ldr r1, =0x0203761c + ldr r0, =sub_80A035C + str r0, [r1] + ldr r1, =0x02037621 + movs r0, 0 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_80A0340 + + thumb_func_start sub_80A035C +sub_80A035C: @ 80A035C + push {lr} + bl get_start_menu_window_id_maybe + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_819746C + bl remove_start_menu_window_maybe + ldr r0, =gUnknown_08252CFB + ldr r1, =sub_80A0388 + bl sub_809FF98 + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A035C + + thumb_func_start sub_80A0388 +sub_80A0388: @ 80A0388 + push {lr} + movs r0, 0x1 + bl sub_8197948 + ldr r1, =0x0203761c + ldr r0, =sub_80A03A4 + str r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A0388 + + thumb_func_start sub_80A03A4 +sub_80A03A4: @ 80A03A4 + push {lr} + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _080A03C6 + cmp r1, 0 + bgt _080A03C0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080A03CA + b _080A03D2 +_080A03C0: + cmp r1, 0x1 + beq _080A03CA + b _080A03D2 +_080A03C6: + movs r0, 0x2 + b _080A03D4 +_080A03CA: + bl sub_80A0014 + movs r0, 0x1 + b _080A03D4 +_080A03D2: + movs r0, 0 +_080A03D4: + pop {r1} + bx r1 + thumb_func_end sub_80A03A4 + + thumb_func_start sub_80A03D8 +sub_80A03D8: @ 80A03D8 + push {lr} + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_80A03D8 + + thumb_func_start sub_80A03E4 +sub_80A03E4: @ 80A03E4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + mov r8, r0 + ldrb r0, [r0] + cmp r0, 0x4 + bls _080A03F6 + b _080A04FC +_080A03F6: + lsls r0, 2 + ldr r1, =_080A0404 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080A0404: + .4byte _080A0418 + .4byte _080A0490 + .4byte _080A04A2 + .4byte _080A04D4 + .4byte _080A04F8 +_080A0418: + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0 + bl SetVBlankCallback + bl remove_some_task + movs r2, 0xA0 + lsls r2, 19 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, =0x040000d4 + mov r0, sp + str r0, [r1] + str r2, [r1, 0x4] + ldr r0, =0x81000200 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r2, 0xC0 + lsls r2, 19 + movs r3, 0xC0 + lsls r3, 9 + mov r4, sp + movs r6, 0 + movs r5, 0x80 + lsls r5, 5 + ldr r7, =0x81000800 + movs r0, 0x81 + lsls r0, 24 + mov r12, r0 +_080A045A: + strh r6, [r4] + mov r0, sp + str r0, [r1] + str r2, [r1, 0x4] + str r7, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r2, r5 + subs r3, r5 + cmp r3, r5 + bhi _080A045A + strh r6, [r4] + mov r0, sp + str r0, [r1] + str r2, [r1, 0x4] + lsrs r0, r3, 1 + mov r2, r12 + orrs r0, r2 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + b _080A04FC + .pool +_080A0490: + bl ResetAllObjectData + bl clear_tasks + bl sub_80A1A74 + bl dp12_8087EA4 + b _080A04FC +_080A04A2: + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_085105A8 + movs r0, 0 + movs r2, 0x1 + bl InitBgsFromTemplates + ldr r0, =gUnknown_085105AC + bl InitWindows + movs r0, 0 + movs r1, 0x8 + movs r2, 0xE0 + bl box_border_load_tiles_and_pal + movs r0, 0xF0 + bl sub_81978B0 + b _080A04FC + .pool +_080A04D4: + movs r0, 0 + bl ShowBg + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldr r0, =sub_80A03D8 + bl SetVBlankCallback + movs r0, 0x1 + bl EnableInterrupts + b _080A04FC + .pool +_080A04F8: + movs r0, 0x1 + b _080A0506 +_080A04FC: + mov r1, r8 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r0, 0 +_080A0506: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80A03E4 + + thumb_func_start sub_80A0514 +sub_80A0514: @ 80A0514 + push {lr} + ldr r0, =0x030026f8 + bl sub_80A03E4 + cmp r0, 0 + beq _080A052E + ldr r0, =sub_80A0550 + movs r1, 0x50 + bl AddTask + ldr r0, =sub_80A0540 + bl SetMainCallback2 +_080A052E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A0514 + + thumb_func_start sub_80A0540 +sub_80A0540: @ 80A0540 + push {lr} + bl RunActiveTasks + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_80A0540 + + thumb_func_start sub_80A0550 +sub_80A0550: @ 80A0550 + push {r4-r6,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r5, r0, r1 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080A0570 + b _080A06A8 +_080A0570: + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0x6 + bls _080A057A + b _080A06A8 +_080A057A: + lsls r0, 2 + ldr r1, =_080A0590 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080A0590: + .4byte _080A05AC + .4byte _080A0630 + .4byte _080A063C + .4byte _080A065C + .4byte _080A0670 + .4byte _080A0688 + .4byte _080A0698 +_080A05AC: + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r2, =gUnknown_082C8959 + movs r4, 0 + str r4, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r6, 0x1 + str r6, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0 + movs r1, 0x1 + movs r3, 0xFF + bl AddTextPrinterParametrized + movs r0, 0 + movs r1, 0x8 + movs r2, 0xE + bl sub_8098858 + movs r0, 0 + bl PutWindowTilemap + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _080A0620 + bl InUnionRoom + cmp r0, 0 + beq _080A0620 + bl sub_800A07C + cmp r0, 0 + beq _080A061C + strh r6, [r5] + b _080A06A8 + .pool +_080A061C: + movs r0, 0x5 + b _080A06A6 +_080A0620: + ldr r0, =0x03002700 + movs r1, 0x1 + strb r1, [r0] + movs r0, 0x1 + b _080A06A6 + .pool +_080A0630: + bl sub_8076D5C + bl sub_8153430 + movs r0, 0x2 + b _080A06A6 +_080A063C: + bl sub_8153474 + lsls r0, 24 + cmp r0, 0 + beq _080A06A8 + bl sav2_gender2_inplace_and_xFE + movs r0, 0x3 + strh r0, [r5] + ldr r1, =0x03002700 + movs r0, 0 + strb r0, [r1] + b _080A06A8 + .pool +_080A065C: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + movs r0, 0x4 + b _080A06A6 +_080A0670: + bl FreeAllWindowBuffers + ldr r0, =0x030022c0 + ldr r0, [r0, 0x8] + bl SetMainCallback2 + adds r0, r4, 0 + bl remove_task + b _080A06A8 + .pool +_080A0688: + ldr r0, =sub_8153688 + movs r1, 0x5 + bl AddTask + movs r0, 0x6 + b _080A06A6 + .pool +_080A0698: + ldr r0, =sub_8153688 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _080A06A8 + movs r0, 0x3 +_080A06A6: + strh r0, [r5] +_080A06A8: + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A0550 + + thumb_func_start sub_80A06B4 +sub_80A06B4: @ 80A06B4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + ldr r0, =gUnknown_085105BC + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0xC] + str r1, [sp, 0x10] + ldr r0, =0x00000861 + mov r10, r0 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _080A06EC + add r0, sp, 0xC + ldrb r1, [r0, 0x4] + subs r1, 0x2 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =0xffffff00 + ldr r0, [sp, 0x10] + ands r0, r2 + orrs r0, r1 + str r0, [sp, 0x10] +_080A06EC: + ldr r6, =0x02037622 + add r0, sp, 0xC + bl AddWindow + strb r0, [r6] + ldrb r0, [r6] + movs r1, 0 + bl sub_81973FC + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + movs r1, 0x4 + mov r9, r1 + cmp r0, 0 + bne _080A0710 + movs r0, 0x8 + mov r9, r0 +_080A0710: + movs r4, 0x1 + ldr r5, =0x02021fc4 + movs r0, 0x3 + adds r1, r5, 0 + movs r2, 0x6 + bl sub_819A344 + ldrb r0, [r6] + str r4, [sp] + movs r1, 0xFF + mov r8, r1 + str r1, [sp, 0x4] + movs r7, 0 + str r7, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + movs r3, 0 + bl Print + movs r4, 0x11 + ldrb r0, [r6] + ldr r2, =gUnknown_085EED26 + str r4, [sp] + mov r1, r8 + str r1, [sp, 0x4] + str r7, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0 + adds r1, r5, 0 + mov r2, r9 + bl sub_819A344 + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x70 + bl GetStringRightAlignXOffset + adds r2, r0, 0 + ldrb r0, [r6] + lsls r2, 16 + lsrs r2, 16 + adds r1, r5, 0 + movs r3, 0x11 + bl sub_819A024 + movs r4, 0x21 + ldrb r0, [r6] + ldr r2, =gUnknown_085EED2D + str r4, [sp] + mov r1, r8 + str r1, [sp, 0x4] + str r7, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0x4 + adds r1, r5, 0 + mov r2, r9 + bl sub_819A344 + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x70 + bl GetStringRightAlignXOffset + adds r2, r0, 0 + ldrb r0, [r6] + lsls r3, r2, 24 + lsrs r3, 24 + str r4, [sp] + mov r1, r8 + str r1, [sp, 0x4] + str r7, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + bl Print + mov r0, r10 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080A0802 + movs r4, 0x31 + ldrb r0, [r6] + ldr r2, =gUnknown_085EED34 + str r4, [sp] + mov r1, r8 + str r1, [sp, 0x4] + str r7, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0x1 + adds r1, r5, 0 + mov r2, r9 + bl sub_819A344 + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x70 + bl GetStringRightAlignXOffset + adds r2, r0, 0 + ldrb r0, [r6] + lsls r3, r2, 24 + lsrs r3, 24 + str r4, [sp] + mov r1, r8 + str r1, [sp, 0x4] + str r7, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + bl Print +_080A0802: + adds r4, 0x10 + ldrb r0, [r6] + ldr r2, =gUnknown_085EED3C + lsls r4, 24 + lsrs r4, 24 + str r4, [sp] + mov r1, r8 + str r1, [sp, 0x4] + str r7, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0x2 + adds r1, r5, 0 + mov r2, r9 + bl sub_819A344 + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x70 + bl GetStringRightAlignXOffset + adds r2, r0, 0 + ldrb r0, [r6] + lsls r3, r2, 24 + lsrs r3, 24 + str r4, [sp] + mov r1, r8 + str r1, [sp, 0x4] + str r7, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + bl Print + ldrb r0, [r6] + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A06B4 + + thumb_func_start sub_80A0888 +sub_80A0888: @ 80A0888 + push {r4,lr} + ldr r4, =0x02037622 + ldrb r0, [r4] + movs r1, 0 + bl sub_819746C + ldrb r0, [r4] + bl RemoveWindow + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A0888 + + thumb_func_start sub_80A08A4 +sub_80A08A4: @ 80A08A4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =sub_8153688 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _080A08C0 + adds r0, r4, 0 + bl remove_task + bl script_env_2_enable_and_set_ctx_running +_080A08C0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A08A4 + + thumb_func_start sub_80A08CC +sub_80A08CC: @ 80A08CC + push {r4,r5,lr} + ldr r0, =sub_8153688 + movs r1, 0x5 + bl AddTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r5 + movs r1, 0x1 + strh r1, [r0, 0xC] + ldr r0, =sub_80A08A4 + movs r1, 0x6 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r5 + strh r4, [r1, 0xA] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A08CC + + thumb_func_start sub_80A0914 +sub_80A0914: @ 80A0914 + push {lr} + bl get_start_menu_window_id_maybe + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_819746C + bl remove_start_menu_window_maybe + bl sub_80984F4 + bl script_env_2_disable + pop {r0} + bx r0 + thumb_func_end sub_80A0914 + + thumb_func_start sub_80A0934 +sub_80A0934: @ 80A0934 + push {lr} + movs r0, 0x5 + bl audio_play + bl sub_80A0914 + pop {r0} + bx r0 + thumb_func_end sub_80A0934 + + thumb_func_start append_byte +append_byte: @ 80A0944 + ldrb r3, [r1] + adds r0, r3 + strb r2, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + bx lr + thumb_func_end append_byte + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_80A18F4.s b/asm/rom_80A18F4.s new file mode 100644 index 0000000000..90fbff7859 --- /dev/null +++ b/asm/rom_80A18F4.s @@ -0,0 +1,14849 @@ + .include "asm/macros.s" + .include "constants/constants.s" + + .syntax unified + + .text + + thumb_func_start decompress_palette +@ void decompress_palette(void *src, u16 offset, u16 size) +decompress_palette: @ 80A18F4 + push {r4-r6,lr} + adds r4, r1, 0 + adds r5, r2, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + ldr r6, =0x02037fe8 + adds r1, r6, 0 + bl LZDecompressWram + lsls r4, 1 + ldr r1, =0x02037714 + adds r1, r4, r1 + lsrs r5, 17 + adds r0, r6, 0 + adds r2, r5, 0 + bl CpuSet + ldr r0, =0x02037b14 + adds r4, r0 + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl CpuSet + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end decompress_palette + + thumb_func_start gpu_pal_apply +@ void gpu_pal_apply(void *src, int dest_offset, int mode) +gpu_pal_apply: @ 80A1938 + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + lsls r4, 16 + lsls r5, 16 + lsrs r4, 15 + ldr r1, =0x02037714 + adds r1, r4, r1 + lsrs r5, 17 + adds r2, r5, 0 + bl CpuSet + ldr r0, =0x02037b14 + adds r4, r0 + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl CpuSet + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end gpu_pal_apply + + thumb_func_start rboxid_80040B8 +rboxid_80040B8: @ 80A1970 + push {r4-r6,lr} + sub sp, 0x4 + adds r6, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + lsls r6, 16 + lsrs r6, 16 + lsls r4, 16 + lsls r5, 16 + mov r0, sp + strh r6, [r0] + lsrs r4, 15 + ldr r1, =0x02037714 + adds r1, r4, r1 + lsrs r5, 17 + movs r0, 0x80 + lsls r0, 17 + orrs r5, r0 + mov r0, sp + adds r2, r5, 0 + bl CpuSet + mov r0, sp + adds r0, 0x2 + strh r6, [r0] + ldr r1, =0x02037b14 + adds r4, r1 + adds r1, r4, 0 + adds r2, r5, 0 + bl CpuSet + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end rboxid_80040B8 + + thumb_func_start copy_pal_bg_faded_to_pal_ram +@ void copy_pal_bg_faded_to_pal_ram() +copy_pal_bg_faded_to_pal_ram: @ 80A19C0 + push {r4,r5,lr} + ldr r4, =0x02037fd4 + ldrb r1, [r4, 0x8] + movs r5, 0x80 + adds r0, r5, 0 + ands r0, r1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + bne _080A1A02 + ldr r1, =0x02037b14 + movs r2, 0xA0 + lsls r2, 19 + ldr r0, =0x040000d4 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, =0x80000200 + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] + ldr r0, =0x02037fe4 + str r3, [r0] + ldrb r1, [r4, 0x9] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + bne _080A1A02 + ldrb r1, [r4, 0x7] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _080A1A02 + bl sub_80A2968 +_080A1A02: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end copy_pal_bg_faded_to_pal_ram + + thumb_func_start fade_and_return_progress_probably +@ int fade_and_return_progress_probably() +fade_and_return_progress_probably: @ 80A1A1C + push {lr} + ldr r0, =0x02037fe4 + ldr r0, [r0] + cmp r0, 0 + beq _080A1A30 + movs r0, 0xFF + b _080A1A68 + .pool +_080A1A30: + ldr r0, =0x02037fd4 + ldrb r0, [r0, 0x9] + movs r1, 0x3 + ands r1, r0 + cmp r1, 0 + bne _080A1A48 + bl pal_fade__0 + b _080A1A56 + .pool +_080A1A48: + cmp r1, 0x1 + bne _080A1A52 + bl pal_fade__1 + b _080A1A56 +_080A1A52: + bl pal_fade__2 +_080A1A56: + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, =0x02037fe4 + ldr r0, =0x02037fd4 + ldr r0, [r0] + movs r1, 0 + orrs r0, r1 + str r0, [r2] + adds r0, r3, 0 +_080A1A68: + pop {r1} + bx r1 + .pool + thumb_func_end fade_and_return_progress_probably + + thumb_func_start sub_80A1A74 +sub_80A1A74: @ 80A1A74 + push {r4,lr} + movs r4, 0 +_080A1A78: + adds r0, r4, 0 + bl palslot_dead_struct_update + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _080A1A78 + bl pal_fade_control_reset_maybe + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A1A74 + + thumb_func_start sub_80A1A94 +sub_80A1A94: @ 80A1A94 + push {r4-r7,lr} + movs r0, 0xA0 + lsls r0, 19 + mov r12, r0 + movs r4, 0 + ldr r7, =0x02037714 + ldr r6, =0x02037b14 + ldr r5, =0x000001ff +_080A1AA4: + lsls r1, r4, 1 + adds r3, r1, r7 + mov r0, r12 + adds r2, r1, r0 + ldrh r0, [r2] + strh r0, [r3] + adds r1, r6 + ldrh r0, [r2] + strh r0, [r1] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, r5 + bls _080A1AA4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A1A94 + + thumb_func_start pal_fade_maybe +pal_fade_maybe: @ 80A1AD4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + ldr r0, [sp, 0x18] + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r12, r2 + lsls r3, 24 + lsrs r7, r3, 24 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r5, =0x02037fd4 + ldrb r1, [r5, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080A1B08 + movs r0, 0 + b _080A1C00 + .pool +_080A1B08: + ldrb r0, [r5, 0xA] + movs r3, 0x79 + negs r3, r3 + adds r2, r3, 0 + ands r2, r0 + movs r0, 0x10 + orrs r2, r0 + strb r2, [r5, 0xA] + lsls r0, r6, 24 + asrs r1, r0, 24 + cmp r1, 0 + bge _080A1B36 + lsls r0, r2, 25 + lsrs r0, 28 + negs r1, r1 + adds r0, r1 + movs r1, 0xF + ands r0, r1 + lsls r0, 3 + ands r2, r3 + orrs r2, r0 + strb r2, [r5, 0xA] + movs r6, 0 +_080A1B36: + str r4, [r5] + movs r4, 0x3F + adds r1, r6, 0 + ands r1, r4 + ldrb r2, [r5, 0x4] + movs r3, 0x40 + negs r3, r3 + adds r0, r3, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x4] + ands r6, r4 + ldrb r0, [r5, 0x8] + ands r3, r0 + orrs r3, r6 + strb r3, [r5, 0x8] + movs r0, 0x1F + mov r1, r12 + ands r1, r0 + lsls r1, 6 + ldrh r2, [r5, 0x4] + ldr r0, =0xfffff83f + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x4] + lsls r2, r7, 3 + ldrb r1, [r5, 0x5] + movs r0, 0x7 + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0x5] + ldr r1, =0x00007fff + mov r0, r8 + ands r1, r0 + ldrh r2, [r5, 0x6] + ldr r0, =0xffff8000 + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x6] + ldrb r0, [r5, 0x7] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r5, 0x7] + ldrb r1, [r5, 0x9] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + strb r0, [r5, 0x9] + cmp r12, r7 + bcs _080A1BB0 + movs r0, 0x41 + negs r0, r0 + ands r3, r0 + b _080A1BB4 + .pool +_080A1BB0: + movs r0, 0x40 + orrs r3, r0 +_080A1BB4: + strb r3, [r5, 0x8] + bl fade_and_return_progress_probably + ldr r4, =0x02037fd4 + ldrb r1, [r4, 0x8] + lsrs r5, r1, 7 + movs r0, 0x7F + ands r0, r1 + strb r0, [r4, 0x8] + ldr r0, =0x02037b14 + movs r1, 0xA0 + lsls r1, 19 + ldr r2, =0x04000100 + bl CpuSet + ldr r1, =0x02037fe4 + movs r0, 0 + str r0, [r1] + ldrb r1, [r4, 0x9] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + bne _080A1BF0 + ldrb r1, [r4, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080A1BF0 + bl sub_80A2968 +_080A1BF0: + ldr r2, =0x02037fd4 + lsls r3, r5, 7 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + orrs r0, r3 + strb r0, [r2, 0x8] + movs r0, 0x1 +_080A1C00: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end pal_fade_maybe + + thumb_func_start sub_80A1C1C +sub_80A1C1C: @ 80A1C1C + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x8 + mov r8, r0 + adds r4, r1, 0 + adds r6, r2, 0 + ldr r5, [sp, 0x1C] + lsls r4, 24 + lsrs r4, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r5, 16 + lsrs r5, 16 + str r3, [sp, 0x4] + bl sub_80A1A94 + lsls r4, 24 + asrs r4, 24 + str r5, [sp] + mov r0, r8 + adds r1, r4, 0 + adds r2, r6, 0 + ldr r3, [sp, 0x4] + bl pal_fade_maybe + lsls r0, 24 + lsrs r0, 24 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80A1C1C + + thumb_func_start sub_80A1C64 +sub_80A1C64: @ 80A1C64 + push {r4-r7,lr} + adds r6, r1, 0 + lsls r0, 24 + lsrs r7, r0, 24 + movs r5, 0 +_080A1C6E: + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + ldr r1, =0x02037f14 + adds r4, r0, r1 + ldrb r0, [r4, 0x4] + lsls r0, 31 + cmp r0, 0 + beq _080A1CCC + ldr r2, [r4] + ldrb r0, [r2, 0x8] + lsls r0, 31 + lsrs r0, 31 + cmp r0, r7 + bne _080A1CCC + ldrh r1, [r4, 0x6] + lsls r1, 20 + lsrs r1, 25 + ldrb r0, [r2, 0xB] + lsls r0, 27 + lsrs r0, 27 + cmp r1, r0 + bne _080A1CAA + adds r0, r4, 0 + bl sub_80A1F00 + ldrb r0, [r4, 0x4] + lsls r0, 31 + cmp r0, 0 + beq _080A1CCC +_080A1CAA: + ldrb r0, [r4, 0x8] + cmp r0, 0 + bne _080A1CC0 + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_80A1CDC + b _080A1CC4 + .pool +_080A1CC0: + subs r0, 0x1 + strb r0, [r4, 0x8] +_080A1CC4: + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_80A1E40 +_080A1CCC: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0xF + bls _080A1C6E + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80A1C64 + + thumb_func_start sub_80A1CDC +sub_80A1CDC: @ 80A1CDC + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + mov r8, r1 + movs r6, 0 + ldrh r1, [r4, 0x6] + lsls r1, 20 + lsrs r1, 25 + ldr r3, [r4] + ldrb r0, [r3, 0x9] + lsls r2, r0, 25 + lsrs r0, r2, 27 + adds r5, r1, 0 + muls r5, r0 + ldrb r1, [r3, 0x8] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080A1D78 + lsrs r0, r2, 27 + cmp r6, r0 + bcs _080A1DC4 + ldr r0, =0x02037714 + mov r12, r0 + ldr r7, =0x02037b14 +_080A1D10: + ldr r0, [r4, 0x4] + lsls r0, 11 + lsrs r0, 22 + lsls r0, 1 + add r0, r12 + ldr r1, [r3, 0x4] + lsls r2, r5, 1 + adds r1, r2, r1 + ldrh r1, [r1] + strh r1, [r0] + ldr r0, [r4, 0x4] + lsls r0, 11 + lsrs r0, 22 + lsls r0, 1 + adds r0, r7 + ldr r1, [r4] + ldr r1, [r1, 0x4] + adds r2, r1 + ldrh r1, [r2] + strh r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r2, [r4, 0x4] + lsls r1, r2, 11 + lsrs r1, 22 + adds r1, 0x1 + ldr r0, =0x000003ff + ands r1, r0 + lsls r1, 11 + ldr r0, =0xffe007ff + ands r0, r2 + orrs r0, r1 + str r0, [r4, 0x4] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r3, [r4] + ldrb r0, [r3, 0x9] + lsls r0, 25 + lsrs r0, 27 + cmp r6, r0 + bcc _080A1D10 + b _080A1DC4 + .pool +_080A1D78: + lsrs r0, r2, 27 + cmp r6, r0 + bcs _080A1DC4 + ldr r3, =0x02037b14 +_080A1D80: + ldr r1, [r4, 0x4] + lsls r1, 11 + lsrs r1, 22 + lsls r1, 1 + adds r1, r3 + ldr r0, [r4] + ldr r2, [r0, 0x4] + lsls r0, r5, 1 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r2, [r4, 0x4] + lsls r1, r2, 11 + lsrs r1, 22 + adds r1, 0x1 + ldr r0, =0x000003ff + ands r1, r0 + lsls r1, 11 + ldr r0, =0xffe007ff + ands r0, r2 + orrs r0, r1 + str r0, [r4, 0x4] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, [r4] + ldrb r0, [r0, 0x9] + lsls r0, 25 + lsrs r0, 27 + cmp r6, r0 + bcc _080A1D80 +_080A1DC4: + ldrh r0, [r4, 0x4] + lsls r0, 21 + lsrs r0, 23 + lsls r0, 11 + ldr r1, [r4, 0x4] + ldr r2, =0xffe007ff + ands r1, r2 + orrs r1, r0 + str r1, [r4, 0x4] + ldr r3, [r4] + ldrb r0, [r3, 0xA] + strb r0, [r4, 0x8] + ldrh r2, [r4, 0x6] + lsls r0, r2, 20 + lsrs r0, 25 + adds r0, 0x1 + movs r1, 0x7F + ands r0, r1 + lsls r0, 5 + ldr r5, =0xfffff01f + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strh r1, [r4, 0x6] + lsls r1, 20 + lsrs r1, 25 + ldrb r0, [r3, 0xB] + lsls r0, 27 + lsrs r0, 27 + cmp r1, r0 + blt _080A1E14 + ldrb r0, [r4, 0x9] + cmp r0, 0 + beq _080A1E0C + subs r0, 0x1 + strb r0, [r4, 0x9] +_080A1E0C: + ldrh r1, [r4, 0x6] + adds r0, r5, 0 + ands r0, r1 + strh r0, [r4, 0x6] +_080A1E14: + ldrh r0, [r4, 0x4] + lsls r0, 21 + lsrs r0, 27 + movs r1, 0x1 + lsls r1, r0 + mov r2, r8 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A1CDC + + thumb_func_start sub_80A1E40 +sub_80A1E40: @ 80A1E40 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r3, =0x02037fd4 + ldrb r1, [r3, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080A1EF4 + ldrh r0, [r4, 0x4] + lsls r0, 21 + lsrs r6, r0, 23 + asrs r1, r6, 4 + movs r5, 0x1 + adds r0, r5, 0 + lsls r0, r1 + ldr r1, [r3] + ands r0, r1 + cmp r0, 0 + beq _080A1EF4 + ldr r2, [r4] + ldrb r1, [r2, 0x8] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _080A1E9C + ldrb r1, [r3, 0x4] + lsls r1, 26 + ldrb r0, [r3, 0x8] + lsls r0, 26 + cmp r1, r0 + beq _080A1EF4 + adds r0, r6, 0 + ldrb r1, [r2, 0x9] + lsls r1, 25 + lsrs r1, 27 + ldrh r2, [r3, 0x4] + lsls r2, 21 + lsrs r2, 27 + ldrh r3, [r3, 0x6] + lsls r3, 17 + lsrs r3, 17 + bl pal_fade_1 + b _080A1EF4 + .pool +_080A1E9C: + ldrb r1, [r3, 0x4] + movs r0, 0x3F + ands r0, r1 + cmp r0, 0 + bne _080A1EF4 + ldrb r0, [r4, 0x8] + ldrb r1, [r2, 0xA] + cmp r0, r1 + beq _080A1EF4 + ldrh r0, [r4, 0x6] + lsls r0, 20 + lsrs r0, 25 + ldrb r1, [r2, 0x9] + lsls r1, 25 + lsrs r2, r1, 27 + adds r5, r0, 0 + muls r5, r2 + movs r3, 0 + adds r1, r2, 0 + cmp r3, r1 + bcs _080A1EF4 + ldr r6, =0x02037b14 +_080A1EC8: + ldrh r1, [r4, 0x4] + lsls r1, 21 + lsrs r1, 23 + adds r1, r3 + lsls r1, 1 + adds r1, r6 + ldr r2, [r4] + adds r0, r5, r3 + ldr r2, [r2, 0x4] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, [r4] + ldrb r0, [r0, 0x9] + lsls r0, 25 + lsrs r0, 27 + cmp r3, r0 + bcc _080A1EC8 +_080A1EF4: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A1E40 + + thumb_func_start sub_80A1F00 +sub_80A1F00: @ 80A1F00 + push {lr} + adds r3, r0, 0 + ldrb r0, [r3, 0x9] + cmp r0, 0 + bne _080A1F50 + ldr r2, [r3] + ldrb r0, [r2, 0xB] + lsrs r0, 5 + cmp r0, 0 + bne _080A1F40 + ldrh r1, [r3, 0x6] + ldr r0, =0xfffff01f + ands r0, r1 + strh r0, [r3, 0x6] + ldrb r0, [r2, 0xA] + strb r0, [r3, 0x8] + ldrb r0, [r2, 0xC] + strb r0, [r3, 0x9] + ldrh r0, [r3, 0x4] + lsls r0, 21 + lsrs r0, 23 + lsls r0, 11 + ldr r1, [r3, 0x4] + ldr r2, =0xffe007ff + ands r1, r2 + orrs r1, r0 + str r1, [r3, 0x4] + b _080A1F54 + .pool +_080A1F40: + cmp r0, 0 + blt _080A1F54 + cmp r0, 0x2 + bgt _080A1F54 + ldrh r0, [r2] + bl sub_80A1F58 + b _080A1F54 +_080A1F50: + subs r0, 0x1 + strb r0, [r3, 0x9] +_080A1F54: + pop {r0} + bx r0 + thumb_func_end sub_80A1F00 + + thumb_func_start sub_80A1F58 +sub_80A1F58: @ 80A1F58 + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl sub_80A20A4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x10 + beq _080A1F6E + bl palslot_dead_struct_update +_080A1F6E: + pop {r0} + bx r0 + thumb_func_end sub_80A1F58 + + thumb_func_start palslot_dead_struct_update +palslot_dead_struct_update: @ 80A1F74 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02037f14 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldr r0, =gUnknown_0852488C + str r0, [r1] + ldrb r2, [r1, 0x4] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x4] + ldrh r2, [r1, 0x4] + ldr r0, =0xfffff803 + ands r0, r2 + strh r0, [r1, 0x4] + ldr r0, [r1, 0x4] + ldr r2, =0xffe007ff + ands r0, r2 + str r0, [r1, 0x4] + ldrh r2, [r1, 0x6] + ldr r0, =0xfffff01f + ands r0, r2 + strh r0, [r1, 0x6] + ldrb r2, [r1, 0x4] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x4] + movs r0, 0 + strb r0, [r1, 0x8] + strb r0, [r1, 0x9] + bx lr + .pool + thumb_func_end palslot_dead_struct_update + + thumb_func_start pal_fade_control_reset_maybe +pal_fade_control_reset_maybe: @ 80A1FD0 + ldr r2, =0x02037fd4 + movs r0, 0 + str r0, [r2] + subs r0, 0x40 + ldrb r1, [r2, 0x4] + ands r0, r1 + strb r0, [r2, 0x4] + ldrh r1, [r2, 0x4] + ldr r0, =0xfffff83f + ands r0, r1 + strh r0, [r2, 0x4] + ldrb r1, [r2, 0x5] + movs r0, 0x7 + ands r0, r1 + strb r0, [r2, 0x5] + ldrh r1, [r2, 0x6] + ldr r0, =0xffff8000 + ands r0, r1 + strh r0, [r2, 0x6] + ldrb r1, [r2, 0x7] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x7] + movs r0, 0 + strb r0, [r2, 0x8] + ldrb r1, [r2, 0x9] + movs r3, 0x5 + negs r3, r3 + adds r0, r3, 0 + ands r0, r1 + movs r1, 0x9 + negs r1, r1 + ands r0, r1 + strb r0, [r2, 0x9] + ldrb r1, [r2, 0xA] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0xA] + ldr r0, [r2, 0x8] + ldr r1, =0xfffe0fff + ands r0, r1 + str r0, [r2, 0x8] + ldrb r0, [r2, 0xA] + ands r3, r0 + movs r0, 0x79 + negs r0, r0 + ands r3, r0 + movs r0, 0x10 + orrs r3, r0 + strb r3, [r2, 0xA] + bx lr + .pool + thumb_func_end pal_fade_control_reset_maybe + + thumb_func_start sub_80A2048 +sub_80A2048: @ 80A2048 + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl sub_80A20A4 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x10 + beq _080A206C + ldr r1, =0x02037f14 + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x4] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r0, 0x4] +_080A206C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A2048 + + thumb_func_start sub_80A2074 +sub_80A2074: @ 80A2074 + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl sub_80A20A4 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x10 + beq _080A209A + ldr r0, =0x02037f14 + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x4] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x4] +_080A209A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A2074 + + thumb_func_start sub_80A20A4 +sub_80A20A4: @ 80A20A4 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + movs r1, 0 + ldr r3, =0x02037f14 +_080A20AE: + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + ldrh r0, [r0] + cmp r0, r2 + bne _080A20C8 + adds r0, r1, 0 + b _080A20D4 + .pool +_080A20C8: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xF + bls _080A20AE + movs r0, 0x10 +_080A20D4: + pop {r1} + bx r1 + thumb_func_end sub_80A20A4 + + thumb_func_start pal_fade__0 +pal_fade__0: @ 80A20D8 + push {r4-r7,lr} + ldr r4, =0x02037fd4 + ldrb r1, [r4, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080A20F0 + movs r0, 0 + b _080A220C + .pool +_080A20F0: + bl sub_80A29BC + lsls r0, 24 + cmp r0, 0 + beq _080A20FE + ldrb r0, [r4, 0x7] + b _080A220A +_080A20FE: + ldrb r1, [r4, 0xA] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080A2132 + ldrb r2, [r4, 0x4] + lsls r1, r2, 26 + ldrb r0, [r4, 0x8] + lsls r0, 26 + cmp r1, r0 + bcs _080A212A + lsrs r0, r1, 26 + adds r0, 0x1 + movs r1, 0x3F + ands r0, r1 + movs r1, 0x40 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0x4] + movs r0, 0x2 + b _080A220C +_080A212A: + movs r0, 0x40 + negs r0, r0 + ands r0, r2 + strb r0, [r4, 0x4] +_080A2132: + movs r5, 0 + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0xA] + movs r0, 0x4 + ands r0, r1 + adds r7, r2, 0 + cmp r0, 0 + bne _080A214C + ldrh r4, [r7] + b _080A2152 + .pool +_080A214C: + ldrh r4, [r7, 0x2] + movs r5, 0x80 + lsls r5, 1 +_080A2152: + cmp r4, 0 + beq _080A2184 + ldr r7, =0x02037fd4 + adds r6, r7, 0 +_080A215A: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _080A2176 + ldrh r2, [r6, 0x4] + lsls r2, 21 + lsrs r2, 27 + ldrh r3, [r6, 0x6] + lsls r3, 17 + lsrs r3, 17 + adds r0, r5, 0 + movs r1, 0x10 + bl pal_fade_1 +_080A2176: + lsrs r4, 1 + adds r0, r5, 0 + adds r0, 0x10 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r4, 0 + bne _080A215A +_080A2184: + ldrb r2, [r7, 0xA] + lsls r0, r2, 29 + lsrs r0, 31 + movs r1, 0x1 + eors r1, r0 + lsls r1, 2 + movs r4, 0x5 + negs r4, r4 + ands r4, r2 + orrs r4, r1 + strb r4, [r7, 0xA] + movs r0, 0x4 + ands r0, r4 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + bne _080A2208 + ldrh r6, [r7, 0x4] + lsls r2, r6, 21 + ldrb r0, [r7, 0x5] + lsls r5, r0, 24 + lsrs r1, r2, 27 + lsrs r0, r5, 27 + cmp r1, r0 + bne _080A21C4 + str r3, [r7] + movs r0, 0x2 + orrs r4, r0 + strb r4, [r7, 0xA] + b _080A2208 + .pool +_080A21C4: + ldrb r1, [r7, 0x8] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _080A21E0 + lsrs r3, r2, 27 + lsls r0, r4, 25 + lsrs r0, 28 + adds r3, r0, r3 + lsrs r0, r5, 27 + cmp r3, r0 + ble _080A21F6 + adds r3, r0, 0 + b _080A21F6 +_080A21E0: + lsrs r3, r2, 27 + lsls r0, r4, 25 + lsrs r0, 28 + subs r0, r3, r0 + lsls r0, 24 + lsrs r3, r0, 24 + asrs r0, 24 + lsrs r1, r5, 27 + cmp r0, r1 + bge _080A21F6 + adds r3, r1, 0 +_080A21F6: + lsls r0, r3, 24 + asrs r0, 24 + movs r1, 0x1F + ands r0, r1 + lsls r0, 6 + ldr r1, =0xfffff83f + ands r1, r6 + orrs r1, r0 + strh r1, [r7, 0x4] +_080A2208: + ldrb r0, [r7, 0x7] +_080A220A: + lsrs r0, 7 +_080A220C: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end pal_fade__0 + + thumb_func_start sub_80A2218 +sub_80A2218: @ 80A2218 + push {r4-r7,lr} + adds r1, r0, 0 + movs r3, 0 + cmp r1, 0 + beq _080A2256 + ldr r7, =0x02037b14 +_080A2224: + movs r0, 0x1 + ands r0, r1 + lsrs r4, r1, 1 + adds r5, r3, 0 + adds r5, 0x10 + cmp r0, 0 + beq _080A224C + movs r2, 0 + adds r6, r7, 0 +_080A2236: + adds r0, r3, r2 + lsls r0, 1 + adds r0, r6 + ldrh r1, [r0] + mvns r1, r1 + strh r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xF + bls _080A2236 +_080A224C: + adds r1, r4, 0 + lsls r0, r5, 16 + lsrs r3, r0, 16 + cmp r1, 0 + bne _080A2224 +_080A2256: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A2218 + + thumb_func_start sub_80A2260 +sub_80A2260: @ 80A2260 + 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 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x4] + movs r0, 0 + mov r9, r0 + cmp r4, 0 + beq _080A231C + lsls r1, 24 + str r1, [sp, 0x8] +_080A228A: + movs r0, 0x1 + ands r0, r4 + lsrs r4, 1 + str r4, [sp, 0xC] + movs r1, 0x10 + add r1, r9 + mov r10, r1 + cmp r0, 0 + beq _080A230E + movs r4, 0 + ldr r2, =0x02037b14 + mov r8, r2 + ldr r1, [sp] + lsls r0, r1, 24 + ldr r2, [sp, 0x4] + lsls r1, r2, 24 + ldr r2, [sp, 0x8] + asrs r2, 24 + mov r12, r2 + movs r5, 0x1F + asrs r7, r0, 24 + asrs r6, r1, 24 +_080A22B6: + mov r0, r9 + adds r2, r0, r4 + lsls r2, 1 + add r2, r8 + ldr r1, [r2] + lsls r1, 27 + lsrs r1, 27 + add r1, r12 + ands r1, r5 + ldrb r3, [r2] + movs r0, 0x20 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldr r1, [r2] + lsls r1, 22 + lsrs r1, 27 + adds r1, r7 + movs r0, 0x1F + ands r1, r0 + lsls r1, 5 + ldrh r3, [r2] + ldr r0, =0xfffffc1f + ands r0, r3 + orrs r0, r1 + strh r0, [r2] + ldr r1, [r2] + lsls r1, 17 + lsrs r1, 27 + adds r1, r6 + ands r1, r5 + lsls r1, 2 + ldrb r3, [r2, 0x1] + movs r0, 0x7D + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _080A22B6 +_080A230E: + ldr r4, [sp, 0xC] + mov r1, r10 + lsls r0, r1, 16 + lsrs r0, 16 + mov r9, r0 + cmp r4, 0 + bne _080A228A +_080A231C: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A2260 + + thumb_func_start sub_80A2334 +sub_80A2334: @ 80A2334 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r1, r0, 0 + movs r3, 0 + cmp r1, 0 + beq _080A237E + ldr r0, =0x02037b14 + mov r8, r0 + ldr r0, =0x02037714 + mov r12, r0 +_080A234A: + movs r0, 0x1 + ands r0, r1 + lsrs r4, r1, 1 + adds r5, r3, 0 + adds r5, 0x10 + cmp r0, 0 + beq _080A2374 + movs r2, 0 + mov r7, r8 + mov r6, r12 +_080A235E: + adds r0, r3, r2 + lsls r0, 1 + adds r1, r0, r7 + adds r0, r6 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xF + bls _080A235E +_080A2374: + adds r1, r4, 0 + lsls r0, r5, 16 + lsrs r3, r0, 16 + cmp r1, 0 + bne _080A234A +_080A237E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A2334 + + thumb_func_start sub_80A2390 +sub_80A2390: @ 80A2390 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, =0x02037fd4 + ldrb r2, [r3, 0xA] + movs r1, 0x79 + negs r1, r1 + ands r1, r2 + movs r2, 0x10 + orrs r1, r2 + strb r1, [r3, 0xA] + bl sub_80A23B4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A2390 + + thumb_func_start sub_80A23B4 +sub_80A23B4: @ 80A23B4 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + ldr r2, =0x02037fd4 + ldrh r0, [r2, 0x4] + movs r3, 0xF8 + lsls r3, 3 + adds r1, r3, 0 + orrs r0, r1 + strh r0, [r2, 0x4] + movs r1, 0x3F + ands r1, r4 + ldrb r3, [r2, 0x8] + movs r0, 0x40 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x8] + ldrb r0, [r2, 0x7] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x7] + ldrb r1, [r2, 0x9] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x9] + cmp r4, 0x2 + bne _080A2406 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, =0x02037b14 + ldr r2, =0x01000200 + mov r0, sp + bl CpuSet +_080A2406: + cmp r4, 0 + bne _080A241C + mov r0, sp + adds r0, 0x2 + ldr r2, =0x00007fff + adds r1, r2, 0 + strh r1, [r0] + ldr r1, =0x02037b14 + ldr r2, =0x01000200 + bl CpuSet +_080A241C: + bl fade_and_return_progress_probably + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A23B4 + + thumb_func_start pal_fade__1 +pal_fade__1: @ 80A2438 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + ldr r4, =0x02037fd4 + ldrb r1, [r4, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080A2458 + movs r0, 0 + b _080A2792 + .pool +_080A2458: + bl sub_80A29BC + lsls r0, 24 + cmp r0, 0 + beq _080A2466 + ldrb r0, [r4, 0x7] + b _080A2790 +_080A2466: + ldrb r1, [r4, 0xA] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080A247C + movs r2, 0x80 + lsls r2, 1 + movs r0, 0x80 + lsls r0, 2 + mov r10, r0 + b _080A2484 +_080A247C: + movs r2, 0 + movs r1, 0x80 + lsls r1, 1 + mov r10, r1 +_080A2484: + ldr r1, =0x02037fd4 + ldrb r0, [r1, 0x8] + lsls r0, 26 + lsrs r0, 26 + cmp r0, 0x1 + beq _080A2544 + cmp r0, 0x1 + bgt _080A24A0 + cmp r0, 0 + beq _080A24AE + b _080A2694 + .pool +_080A24A0: + cmp r0, 0x2 + bne _080A24A6 + b _080A25A8 +_080A24A6: + cmp r0, 0x3 + bne _080A24AC + b _080A2630 +_080A24AC: + b _080A2694 +_080A24AE: + adds r7, r2, 0 + cmp r7, r10 + bcc _080A24B6 + b _080A2694 +_080A24B6: + lsls r2, r7, 1 + ldr r0, =0x02037714 + adds r0, r2, r0 + ldr r1, [r0] + lsls r3, r1, 27 + lsls r0, r1, 22 + lsrs r0, 27 + mov r12, r0 + lsls r1, 17 + lsrs r1, 27 + mov r8, r1 + ldr r0, =0x02037b14 + adds r2, r0 + mov r9, r2 + ldr r1, [r2] + lsls r2, r1, 27 + lsrs r2, 3 + movs r4, 0xFE + lsls r4, 24 + adds r2, r4 + lsls r0, r1, 22 + lsrs r0, 27 + subs r0, 0x2 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 17 + lsrs r1, 27 + subs r1, 0x2 + lsls r1, 24 + lsrs r4, r1, 24 + lsrs r6, r2, 24 + asrs r2, 24 + lsrs r3, 3 + asrs r0, r3, 24 + cmp r2, r0 + bge _080A2500 + lsrs r6, r3, 24 +_080A2500: + lsls r0, r5, 24 + asrs r0, 24 + mov r2, r12 + lsls r1, r2, 24 + cmp r0, r12 + bge _080A250E + lsrs r5, r1, 24 +_080A250E: + lsls r0, r4, 24 + asrs r0, 24 + mov r3, r8 + lsls r1, r3, 24 + cmp r0, r8 + bge _080A251C + lsrs r4, r1, 24 +_080A251C: + lsls r1, r6, 24 + asrs r1, 24 + lsls r0, r5, 24 + asrs r0, 19 + orrs r1, r0 + lsls r0, r4, 24 + asrs r0, 14 + orrs r1, r0 + mov r4, r9 + strh r1, [r4] + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, r10 + bcc _080A24B6 + b _080A2694 + .pool +_080A2544: + adds r7, r2, 0 + cmp r7, r10 + bcc _080A254C + b _080A2694 +_080A254C: + lsls r1, r7, 1 + ldr r0, =0x02037b14 + adds r2, r1, r0 + ldr r1, [r2] + lsls r0, r1, 27 + lsrs r0, 3 + movs r3, 0x80 + lsls r3, 18 + adds r0, r3 + lsrs r6, r0, 24 + lsls r0, r1, 22 + lsrs r0, 27 + adds r5, r0, 0x2 + lsls r1, 17 + lsrs r1, 27 + adds r4, r1, 0x2 + cmp r6, 0x1F + ble _080A2572 + movs r6, 0x1F +_080A2572: + lsls r0, r5, 24 + asrs r0, 24 + cmp r0, 0x1F + ble _080A257C + movs r5, 0x1F +_080A257C: + lsls r0, r4, 24 + asrs r0, 24 + cmp r0, 0x1F + ble _080A2586 + movs r4, 0x1F +_080A2586: + lsls r1, r6, 24 + asrs r1, 24 + lsls r0, r5, 24 + asrs r0, 19 + orrs r1, r0 + lsls r0, r4, 24 + asrs r0, 14 + orrs r1, r0 + strh r1, [r2] + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, r10 + bcc _080A254C + b _080A2694 + .pool +_080A25A8: + adds r7, r2, 0 + cmp r7, r10 + bcs _080A2694 +_080A25AE: + lsls r2, r7, 1 + ldr r0, =0x02037714 + adds r0, r2, r0 + ldr r1, [r0] + lsls r3, r1, 27 + lsls r0, r1, 22 + lsrs r0, 27 + mov r12, r0 + lsls r1, 17 + lsrs r1, 27 + mov r8, r1 + ldr r0, =0x02037b14 + adds r2, r0 + ldr r1, [r2] + lsls r0, r1, 27 + lsrs r0, 3 + movs r4, 0x80 + lsls r4, 18 + adds r0, r4 + lsrs r6, r0, 24 + lsls r0, r1, 22 + lsrs r0, 27 + adds r5, r0, 0x2 + lsls r1, 17 + lsrs r1, 27 + adds r4, r1, 0x2 + lsrs r3, 3 + asrs r0, r3, 24 + cmp r6, r0 + ble _080A25EC + lsrs r6, r3, 24 +_080A25EC: + lsls r0, r5, 24 + asrs r0, 24 + mov r3, r12 + lsls r1, r3, 24 + cmp r0, r12 + ble _080A25FA + lsrs r5, r1, 24 +_080A25FA: + lsls r0, r4, 24 + asrs r0, 24 + mov r3, r8 + lsls r1, r3, 24 + cmp r0, r8 + ble _080A2608 + lsrs r4, r1, 24 +_080A2608: + lsls r1, r6, 24 + asrs r1, 24 + lsls r0, r5, 24 + asrs r0, 19 + orrs r1, r0 + lsls r0, r4, 24 + asrs r0, 14 + orrs r1, r0 + strh r1, [r2] + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, r10 + bcc _080A25AE + b _080A2694 + .pool +_080A2630: + adds r7, r2, 0 + cmp r7, r10 + bcs _080A2694 + ldr r4, =0x02037b14 + mov r8, r4 +_080A263A: + lsls r0, r7, 1 + mov r1, r8 + adds r3, r0, r1 + ldr r1, [r3] + lsls r2, r1, 27 + lsrs r2, 3 + movs r4, 0xFE + lsls r4, 24 + adds r2, r4 + lsls r0, r1, 22 + lsrs r0, 27 + subs r0, 0x2 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 17 + lsrs r1, 27 + subs r1, 0x2 + lsls r1, 24 + lsrs r4, r1, 24 + lsrs r6, r2, 24 + cmp r2, 0 + bge _080A2668 + movs r6, 0 +_080A2668: + lsls r0, r5, 24 + cmp r0, 0 + bge _080A2670 + movs r5, 0 +_080A2670: + lsls r0, r4, 24 + cmp r0, 0 + bge _080A2678 + movs r4, 0 +_080A2678: + lsls r1, r6, 24 + asrs r1, 24 + lsls r0, r5, 24 + asrs r0, 19 + orrs r1, r0 + lsls r0, r4, 24 + asrs r0, 14 + orrs r1, r0 + strh r1, [r3] + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, r10 + bcc _080A263A +_080A2694: + ldr r0, =0x02037fd4 + ldrb r2, [r0, 0xA] + lsls r0, r2, 29 + lsrs r0, 31 + movs r1, 0x1 + eors r1, r0 + lsls r1, 2 + movs r3, 0x5 + negs r3, r3 + ands r3, r2 + orrs r3, r1 + ldr r1, =0x02037fd4 + strb r3, [r1, 0xA] + movs r0, 0x4 + ands r0, r3 + cmp r0, 0 + beq _080A26C4 + ldrb r0, [r1, 0x7] + b _080A2790 + .pool +_080A26C4: + ldr r2, =0x02037fd4 + ldrh r4, [r2, 0x4] + lsls r5, r4, 21 + lsrs r0, r5, 27 + lsls r2, r3, 25 + lsrs r1, r2, 28 + subs r0, r1 + cmp r0, 0 + bge _080A26E8 + ldr r0, =0xfffff83f + ands r0, r4 + ldr r3, =0x02037fd4 + strh r0, [r3, 0x4] + b _080A26FE + .pool +_080A26E8: + lsrs r1, r5, 27 + lsrs r0, r2, 28 + subs r1, r0 + movs r0, 0x1F + ands r1, r0 + lsls r1, 6 + ldr r0, =0xfffff83f + ands r0, r4 + orrs r0, r1 + ldr r4, =0x02037fd4 + strh r0, [r4, 0x4] +_080A26FE: + ldr r1, =0x02037fd4 + ldrh r0, [r1, 0x4] + movs r1, 0xF8 + lsls r1, 3 + ands r1, r0 + cmp r1, 0 + bne _080A278C + ldr r2, =0x02037fd4 + ldrb r0, [r2, 0x8] + lsls r0, 26 + lsrs r0, 26 + cmp r0, 0x1 + beq _080A2750 + cmp r0, 0x1 + bgt _080A272C + cmp r0, 0 + beq _080A2736 + b _080A2778 + .pool +_080A272C: + cmp r0, 0x2 + beq _080A2736 + cmp r0, 0x3 + beq _080A276C + b _080A2778 +_080A2736: + ldr r0, =0x02037714 + ldr r1, =0x02037b14 + ldr r2, =0x04000100 + bl CpuSet + b _080A2778 + .pool +_080A2750: + movs r0, 0x1 + negs r0, r0 + str r0, [sp] + ldr r1, =0x02037b14 + ldr r2, =0x05000100 + mov r0, sp + bl CpuSet + b _080A2778 + .pool +_080A276C: + str r1, [sp, 0x4] + add r0, sp, 0x4 + ldr r1, =0x02037b14 + ldr r2, =0x05000100 + bl CpuSet +_080A2778: + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0x9] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x9] + ldrb r0, [r2, 0xA] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2, 0xA] +_080A278C: + ldr r3, =0x02037fd4 + ldrb r0, [r3, 0x7] +_080A2790: + lsrs r0, 7 +_080A2792: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end pal_fade__1 + + thumb_func_start sub_80A27B0 +sub_80A27B0: @ 80A27B0 + push {r4-r7,lr} + ldr r5, [sp, 0x14] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r7, =0x02037fd4 + str r0, [r7] + movs r0, 0x3F + ands r1, r0 + ldrb r4, [r7, 0x4] + movs r6, 0x40 + negs r6, r6 + adds r0, r6, 0 + ands r0, r4 + orrs r0, r1 + strb r0, [r7, 0x4] + ldrb r0, [r7, 0x8] + ands r6, r0 + orrs r6, r1 + strb r6, [r7, 0x8] + movs r0, 0x1F + adds r1, r2, 0 + ands r1, r0 + lsls r1, 6 + ldrh r4, [r7, 0x4] + ldr r0, =0xfffff83f + ands r0, r4 + orrs r0, r1 + strh r0, [r7, 0x4] + lsls r4, r3, 3 + ldrb r1, [r7, 0x5] + movs r0, 0x7 + ands r0, r1 + orrs r0, r4 + strb r0, [r7, 0x5] + ldrb r0, [r7, 0x7] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r7, 0x7] + ldrb r1, [r7, 0x9] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + movs r1, 0x1 + ands r5, r1 + lsls r5, 2 + subs r1, 0x6 + ands r0, r1 + orrs r0, r5 + subs r1, 0x4 + ands r0, r1 + strb r0, [r7, 0x9] + cmp r2, r3 + bcs _080A2840 + movs r0, 0x41 + negs r0, r0 + ands r6, r0 + b _080A2844 + .pool +_080A2840: + movs r0, 0x40 + orrs r6, r0 +_080A2844: + strb r6, [r7, 0x8] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80A27B0 + + thumb_func_start pal_fade__2 +pal_fade__2: @ 80A284C + push {r4-r7,lr} + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0x7] + movs r0, 0x80 + ands r0, r1 + adds r4, r2, 0 + cmp r0, 0 + bne _080A2864 + movs r0, 0 + b _080A295C + .pool +_080A2864: + ldrb r2, [r4, 0x4] + lsls r1, r2, 26 + ldrb r3, [r4, 0x8] + lsls r0, r3, 26 + cmp r1, r0 + bcs _080A2886 + lsrs r0, r1, 26 + adds r0, 0x1 + movs r1, 0x3F + ands r0, r1 + movs r1, 0x40 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0x4] + movs r0, 0x2 + b _080A295C +_080A2886: + movs r0, 0x40 + negs r0, r0 + ands r0, r2 + strb r0, [r4, 0x4] + movs r0, 0x40 + ands r0, r3 + cmp r0, 0 + bne _080A28E4 + ldrh r1, [r4, 0x4] + lsls r0, r1, 21 + lsrs r0, 27 + adds r0, 0x1 + movs r7, 0x1F + ands r0, r7 + lsls r0, 6 + ldr r6, =0xfffff83f + adds r3, r6, 0 + ands r3, r1 + orrs r3, r0 + strh r3, [r4, 0x4] + lsls r5, r3, 21 + ldrb r0, [r4, 0x5] + lsrs r1, r5, 27 + lsrs r0, 3 + cmp r1, r0 + bls _080A2930 + ldrb r2, [r4, 0x9] + lsls r1, r2, 28 + lsrs r1, 31 + adds r1, 0x1 + movs r0, 0x1 + ands r1, r0 + lsls r1, 3 + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x9] + lsrs r0, r5, 27 + subs r0, 0x1 + ands r0, r7 + lsls r0, 6 + ands r3, r6 + b _080A292C + .pool +_080A28E4: + ldrh r2, [r4, 0x4] + lsls r1, r2, 21 + lsrs r0, r1, 27 + subs r0, 0x1 + movs r6, 0x1F + ands r0, r6 + lsls r0, 6 + ldr r5, =0xfffff83f + adds r3, r5, 0 + ands r3, r2 + orrs r3, r0 + strh r3, [r4, 0x4] + lsrs r1, 27 + subs r1, 0x1 + ldrb r0, [r4, 0x5] + lsrs r0, 3 + cmp r1, r0 + bge _080A2930 + ldrb r2, [r4, 0x9] + lsls r1, r2, 28 + lsrs r1, 31 + adds r1, 0x1 + movs r0, 0x1 + ands r1, r0 + lsls r1, 3 + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x9] + lsls r0, r3, 21 + lsrs r0, 27 + adds r0, 0x1 + ands r0, r6 + lsls r0, 6 + ands r3, r5 +_080A292C: + orrs r3, r0 + strh r3, [r4, 0x4] +_080A2930: + ldrb r1, [r4, 0x9] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080A2958 + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080A294E + movs r0, 0 + str r0, [r4] + ldrh r1, [r4, 0x4] + ldr r0, =0xfffff83f + ands r0, r1 + strh r0, [r4, 0x4] +_080A294E: + ldrb r1, [r4, 0x9] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x9] +_080A2958: + ldrb r0, [r4, 0x7] + lsrs r0, 7 +_080A295C: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end pal_fade__2 + + thumb_func_start sub_80A2968 +sub_80A2968: @ 80A2968 + push {r4,lr} + ldr r4, =0x02037fd4 + ldrh r1, [r4] + movs r0, 0x50 + bl SetGpuReg + ldrh r1, [r4, 0x4] + lsls r1, 21 + lsrs r1, 27 + movs r0, 0x54 + bl SetGpuReg + ldrb r1, [r4, 0x9] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080A29AC + movs r0, 0x9 + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + negs r1, r1 + ands r0, r1 + strb r0, [r4, 0x9] + movs r0, 0 + str r0, [r4] + ldrh r1, [r4, 0x4] + ldr r0, =0xfffff83f + ands r0, r1 + strh r0, [r4, 0x4] + ldrb r1, [r4, 0x7] + movs r0, 0x7F + ands r0, r1 + strb r0, [r4, 0x7] +_080A29AC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A2968 + + thumb_func_start sub_80A29BC +sub_80A29BC: @ 80A29BC + push {r4,lr} + ldr r3, =0x02037fd4 + ldrb r4, [r3, 0xA] + movs r0, 0x2 + ands r0, r4 + cmp r0, 0 + beq _080A2A18 + ldr r2, [r3, 0x8] + movs r0, 0xF8 + lsls r0, 9 + ands r0, r2 + movs r1, 0x80 + lsls r1, 7 + cmp r0, r1 + bne _080A29FC + ldrb r1, [r3, 0x7] + movs r0, 0x7F + ands r0, r1 + strb r0, [r3, 0x7] + movs r0, 0x3 + negs r0, r0 + ands r0, r4 + strb r0, [r3, 0xA] + ldr r0, [r3, 0x8] + ldr r1, =0xfffe0fff + ands r0, r1 + str r0, [r3, 0x8] + b _080A2A10 + .pool +_080A29FC: + lsls r0, r2, 15 + lsrs r0, 27 + adds r0, 0x1 + movs r1, 0x1F + ands r0, r1 + lsls r0, 12 + ldr r1, =0xfffe0fff + ands r1, r2 + orrs r1, r0 + str r1, [r3, 0x8] +_080A2A10: + movs r0, 0x1 + b _080A2A1A + .pool +_080A2A18: + movs r0, 0 +_080A2A1A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80A29BC + + thumb_func_start sub_80A2A20 +sub_80A2A20: @ 80A2A20 + push {r4-r7,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 16 + lsrs r6, r2, 16 + movs r5, 0 + cmp r4, 0 + beq _080A2A54 +_080A2A32: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _080A2A46 + adds r0, r5, 0 + movs r1, 0x10 + adds r2, r7, 0 + adds r3, r6, 0 + bl pal_fade_1 +_080A2A46: + lsrs r4, 1 + adds r0, r5, 0 + adds r0, 0x10 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r4, 0 + bne _080A2A32 +_080A2A54: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80A2A20 + + thumb_func_start sub_80A2A5C +sub_80A2A5C: @ 80A2A5C + push {r4,r5,lr} + lsls r1, 24 + lsrs r1, 24 + lsls r2, 16 + lsrs r2, 16 + ldr r4, =0x02037714 + ldr r5, =0x02037b14 + ldr r3, =0x040000d4 + str r4, [r3] + str r5, [r3, 0x4] + ldr r4, =0x84000100 + str r4, [r3, 0x8] + ldr r3, [r3, 0x8] + bl sub_80A2A20 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A2A5C + + thumb_func_start TintPalette_GrayScale +TintPalette_GrayScale: @ 80A2A90 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r1, 16 + cmp r1, 0 + beq _080A2AD8 + movs r6, 0x1F + adds r5, r1, 0 +_080A2AA0: + ldrh r1, [r4] + movs r2, 0x1F + ands r2, r1 + lsls r1, 16 + lsrs r3, r1, 21 + ands r3, r6 + lsrs r1, 26 + ands r1, r6 + movs r0, 0x4C + muls r2, r0 + movs r0, 0x97 + muls r0, r3 + adds r2, r0 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r1 + adds r2, r0 + asrs r2, 8 + lsls r0, r2, 10 + lsls r1, r2, 5 + orrs r0, r1 + orrs r0, r2 + strh r0, [r4] + adds r4, 0x2 + subs r5, 0x1 + cmp r5, 0 + bne _080A2AA0 +_080A2AD8: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end TintPalette_GrayScale + + thumb_func_start sub_80A2AE0 +sub_80A2AE0: @ 80A2AE0 + push {r4-r7,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r1, 16 + cmp r1, 0 + beq _080A2B34 + movs r6, 0x1F + ldr r7, =gUnknown_0852489C + adds r5, r1, 0 +_080A2AF2: + ldrh r1, [r4] + movs r2, 0x1F + ands r2, r1 + lsls r1, 16 + lsrs r3, r1, 21 + ands r3, r6 + lsrs r1, 26 + ands r1, r6 + movs r0, 0x4C + muls r2, r0 + movs r0, 0x97 + muls r0, r3 + adds r2, r0 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r1 + adds r2, r0 + asrs r2, 8 + cmp r2, 0x1F + bls _080A2B1E + movs r2, 0x1F +_080A2B1E: + adds r0, r2, r7 + ldrb r2, [r0] + lsls r0, r2, 10 + lsls r1, r2, 5 + orrs r0, r1 + orrs r0, r2 + strh r0, [r4] + adds r4, 0x2 + subs r5, 0x1 + cmp r5, 0 + bne _080A2AF2 +_080A2B34: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A2AE0 + + thumb_func_start TintPalette_SepiaTone +TintPalette_SepiaTone: @ 80A2B40 + push {r4-r7,lr} + adds r5, r0, 0 + lsls r1, 16 + lsrs r1, 16 + cmp r1, 0 + beq _080A2BA2 + movs r7, 0x1F + adds r6, r1, 0 +_080A2B50: + ldrh r0, [r5] + movs r1, 0x1F + ands r1, r0 + lsls r0, 16 + lsrs r2, r0, 21 + ands r2, r7 + lsrs r3, r0, 26 + ands r3, r7 + movs r0, 0x4C + muls r1, r0 + movs r0, 0x97 + muls r0, r2 + adds r1, r0 + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r3 + adds r1, r0 + asrs r1, 8 + ldr r0, =0x00000133 + muls r0, r1 + lsls r0, 16 + lsrs r2, r0, 24 + lsls r0, r1, 24 + lsrs r4, r0, 24 + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 20 + lsrs r3, r0, 24 + cmp r2, 0x1F + ble _080A2B90 + movs r2, 0x1F +_080A2B90: + lsls r0, r3, 10 + lsls r1, r4, 5 + orrs r0, r1 + orrs r0, r2 + strh r0, [r5] + adds r5, 0x2 + subs r6, 0x1 + cmp r6, 0 + bne _080A2B50 +_080A2BA2: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end TintPalette_SepiaTone + + thumb_func_start sub_80A2BAC +sub_80A2BAC: @ 80A2BAC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r5, r0, 0 + ldr r0, [sp, 0x1C] + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + mov r9, r2 + lsls r3, 16 + lsrs r3, 16 + mov r8, r3 + lsls r0, 16 + lsrs r0, 16 + mov r12, r0 + cmp r1, 0 + beq _080A2C38 + movs r7, 0x1F + adds r6, r1, 0 +_080A2BD6: + ldrh r0, [r5] + movs r1, 0x1F + ands r1, r0 + lsls r0, 16 + lsrs r2, r0, 21 + ands r2, r7 + lsrs r3, r0, 26 + ands r3, r7 + movs r0, 0x4C + muls r1, r0 + movs r0, 0x97 + muls r0, r2 + adds r1, r0 + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r3 + adds r1, r0 + asrs r1, 8 + mov r0, r9 + muls r0, r1 + lsls r0, 16 + lsrs r4, r0, 24 + mov r0, r8 + muls r0, r1 + lsls r0, 16 + lsrs r2, r0, 24 + mov r0, r12 + muls r0, r1 + lsls r0, 16 + lsrs r3, r0, 24 + cmp r4, 0x1F + ble _080A2C1A + movs r4, 0x1F +_080A2C1A: + cmp r2, 0x1F + ble _080A2C20 + movs r2, 0x1F +_080A2C20: + cmp r3, 0x1F + ble _080A2C26 + movs r3, 0x1F +_080A2C26: + lsls r0, r3, 10 + lsls r1, r2, 5 + orrs r0, r1 + orrs r0, r4 + strh r0, [r5] + adds r5, 0x2 + subs r6, 0x1 + cmp r6, 0 + bne _080A2BD6 +_080A2C38: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80A2BAC + + thumb_func_start sub_80A2C44 +sub_80A2C44: @ 80A2C44 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r10, r0 + adds r4, r1, 0 + ldr r0, [sp, 0x20] + ldr r1, [sp, 0x24] + ldr r5, [sp, 0x28] + lsls r4, 24 + lsrs r4, 24 + lsls r2, 24 + lsrs r7, r2, 24 + lsls r3, 24 + lsrs r6, r3, 24 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + lsls r1, 24 + lsrs r1, 24 + lsls r5, 24 + lsrs r5, 24 + mov r8, r5 + ldr r0, =sub_80A2D54 + bl AddTask + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r1, r0, r1 + strh r7, [r1, 0x8] + strh r6, [r1, 0xA] + lsls r4, 24 + asrs r4, 24 + cmp r4, 0 + blt _080A2CA4 + strh r4, [r1, 0xE] + movs r0, 0x1 + b _080A2CAC + .pool +_080A2CA4: + movs r0, 0 + strh r0, [r1, 0xE] + negs r0, r4 + adds r0, 0x1 +_080A2CAC: + strh r0, [r1, 0xC] + lsls r4, r5, 2 + cmp r6, r7 + bcs _080A2CC4 + ldr r0, =0x03005e00 + adds r1, r4, r5 + lsls r1, 3 + adds r1, r0 + movs r2, 0xC + ldrsh r0, [r1, r2] + negs r0, r0 + strh r0, [r1, 0xC] +_080A2CC4: + adds r0, r5, 0 + movs r1, 0x5 + mov r2, r10 + bl set_word_task_arg + ldr r0, =0x03005e00 + adds r1, r4, r5 + lsls r1, 3 + adds r1, r0 + mov r0, r9 + strh r0, [r1, 0x16] + mov r2, r8 + strh r2, [r1, 0x18] + ldr r1, [r1] + adds r0, r5, 0 + bl _call_via_r1 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A2C44 + + thumb_func_start sub_80A2CF8 +sub_80A2CF8: @ 80A2CF8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r3, r0, 24 + movs r2, 0 + ldr r4, =sub_80A2D54 + ldr r1, =0x03005e00 +_080A2D04: + ldrb r0, [r1, 0x4] + cmp r0, 0x1 + bne _080A2D24 + ldr r0, [r1] + cmp r0, r4 + bne _080A2D24 + movs r5, 0x18 + ldrsh r0, [r1, r5] + cmp r0, r3 + bne _080A2D24 + movs r0, 0x1 + b _080A2D2E + .pool +_080A2D24: + adds r1, 0x28 + adds r2, 0x1 + cmp r2, 0xF + ble _080A2D04 + movs r0, 0 +_080A2D2E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80A2CF8 + + thumb_func_start sub_80A2D34 +sub_80A2D34: @ 80A2D34 + push {lr} + b _080A2D3C +_080A2D38: + bl remove_task +_080A2D3C: + ldr r0, =sub_80A2D54 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _080A2D38 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A2D34 + + thumb_func_start sub_80A2D54 +sub_80A2D54: @ 80A2D54 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + adds r0, r5, 0 + movs r1, 0x5 + bl get_word_task_arg + adds r3, r0, 0 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x6 + ldrsh r1, [r4, r2] + cmp r0, r1 + ble _080A2DCC + movs r0, 0 + strh r0, [r4, 0x8] + ldrb r1, [r4] + ldrh r2, [r4, 0xE] + adds r0, r3, 0 + bl sub_80A2A20 + ldrh r1, [r4] + movs r6, 0 + ldrsh r0, [r4, r6] + ldrh r3, [r4, 0x2] + movs r6, 0x2 + ldrsh r2, [r4, r6] + cmp r0, r2 + bne _080A2DAC + adds r0, r5, 0 + bl remove_task + b _080A2DCC + .pool +_080A2DAC: + ldrh r0, [r4, 0x4] + adds r1, r0 + strh r1, [r4] + lsls r0, 16 + cmp r0, 0 + blt _080A2DC2 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, r2 + blt _080A2DCC + b _080A2DCA +_080A2DC2: + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, r2 + bgt _080A2DCC +_080A2DCA: + strh r3, [r4] +_080A2DCC: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80A2D54 + + thumb_func_start sound_sources_off +sound_sources_off: @ 80A2DD4 + push {lr} + ldr r1, =0x03005df8 + movs r0, 0 + strb r0, [r1] + bl map_music_set_to_zero + pop {r0} + bx r0 + .pool + thumb_func_end sound_sources_off + + thumb_func_start sound_something +sound_something: @ 80A2DE8 + push {r4,r5,lr} + ldr r0, =0x03000f4c + ldrb r1, [r0] + adds r2, r0, 0 + cmp r1, 0x7 + bhi _080A2ECA + lsls r0, r1, 2 + ldr r1, =_080A2E08 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080A2E08: + .4byte _080A2ECA + .4byte _080A2E28 + .4byte _080A2ECA + .4byte _080A2ECA + .4byte _080A2ECA + .4byte _080A2E3C + .4byte _080A2E5C + .4byte _080A2E98 +_080A2E28: + movs r0, 0x2 + strb r0, [r2] + ldr r0, =0x03000f48 + ldrh r0, [r0] + bl song_play_for_text + b _080A2ECA + .pool +_080A2E3C: + bl sub_80A3258 + lsls r0, 24 + cmp r0, 0 + beq _080A2ECA + ldr r0, =0x03000f4a + movs r1, 0 + strh r1, [r0] + ldr r0, =0x03000f4c + strb r1, [r0] + b _080A2ECA + .pool +_080A2E5C: + bl sub_80A3258 + lsls r0, 24 + cmp r0, 0 + beq _080A2ECA + bl task_is_not_running_overworld_fanfare + lsls r0, 24 + cmp r0, 0 + beq _080A2ECA + ldr r2, =0x03000f48 + ldr r1, =0x03000f4a + ldrh r0, [r1] + strh r0, [r2] + movs r0, 0 + strh r0, [r1] + ldr r1, =0x03000f4c + movs r0, 0x2 + strb r0, [r1] + ldrh r0, [r2] + bl song_play_for_text + b _080A2ECA + .pool +_080A2E98: + bl sub_80A3258 + lsls r0, 24 + cmp r0, 0 + beq _080A2ECA + bl task_is_not_running_overworld_fanfare + lsls r0, 24 + cmp r0, 0 + beq _080A2ECA + ldr r4, =0x03000f4a + ldrh r0, [r4] + ldr r5, =0x03000f4d + ldrb r1, [r5] + bl sub_80A3194 + ldr r1, =0x03000f48 + ldrh r0, [r4] + strh r0, [r1] + movs r2, 0 + strh r2, [r4] + ldr r1, =0x03000f4c + movs r0, 0x2 + strb r0, [r1] + strb r2, [r5] +_080A2ECA: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sound_something + + thumb_func_start map_music_set_to_zero +map_music_set_to_zero: @ 80A2EE0 + ldr r0, =0x03000f48 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x03000f4a + strh r1, [r0] + ldr r0, =0x03000f4c + strb r1, [r0] + ldr r0, =0x03000f4d + strb r1, [r0] + bx lr + .pool + thumb_func_end map_music_set_to_zero + + thumb_func_start current_map_music_get +current_map_music_get: @ 80A2F04 + ldr r0, =0x03000f48 + ldrh r0, [r0] + bx lr + .pool + thumb_func_end current_map_music_get + + thumb_func_start current_map_music_set +current_map_music_set: @ 80A2F10 + ldr r1, =0x03000f48 + strh r0, [r1] + ldr r1, =0x03000f4a + movs r0, 0 + strh r0, [r1] + ldr r1, =0x03000f4c + movs r0, 0x1 + strb r0, [r1] + bx lr + .pool + thumb_func_end current_map_music_set + + thumb_func_start sub_80A2F30 +sub_80A2F30: @ 80A2F30 + ldr r0, =0x03000f48 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x03000f4a + strh r1, [r0] + ldr r1, =0x03000f4c + movs r0, 0x1 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_80A2F30 + + thumb_func_start sub_80A2F50 +sub_80A2F50: @ 80A2F50 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80A303C + lsls r0, 24 + cmp r0, 0 + beq _080A2F66 + adds r0, r4, 0 + bl play_sound_effect +_080A2F66: + ldr r0, =0x03000f48 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x03000f4a + strh r1, [r0] + ldr r1, =0x03000f4c + movs r0, 0x5 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A2F50 + + thumb_func_start sub_80A2F88 +sub_80A2F88: @ 80A2F88 + push {r4,lr} + adds r4, r0, 0 + adds r0, r1, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r0, 24 + lsrs r0, 24 + bl sub_80A2F50 + ldr r1, =0x03000f48 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x03000f4a + strh r4, [r0] + ldr r1, =0x03000f4c + movs r0, 0x6 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A2F88 + + thumb_func_start sub_80A2FBC +sub_80A2FBC: @ 80A2FBC + push {r4,r5,lr} + adds r4, r0, 0 + adds r0, r1, 0 + adds r5, r2, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r0, 24 + lsrs r0, 24 + lsls r5, 24 + lsrs r5, 24 + bl sub_80A2F50 + ldr r1, =0x03000f48 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x03000f4a + strh r4, [r0] + ldr r1, =0x03000f4c + movs r0, 0x7 + strb r0, [r1] + ldr r0, =0x03000f4d + strb r5, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A2FBC + + thumb_func_start sub_80A3000 +sub_80A3000: @ 80A3000 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_80A3194 + ldr r0, =0x03000f48 + strh r4, [r0] + ldr r0, =0x03000f4a + movs r2, 0 + strh r2, [r0] + ldr r1, =0x03000f4c + movs r0, 0x2 + strb r0, [r1] + ldr r0, =0x03000f4d + strb r2, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A3000 + + thumb_func_start sub_80A303C +sub_80A303C: @ 80A303C + push {lr} + ldr r0, =0x03000f4c + ldrb r0, [r0] + cmp r0, 0x6 + beq _080A3058 + cmp r0, 0x5 + beq _080A3058 + cmp r0, 0x7 + beq _080A3058 + movs r0, 0x1 + b _080A305A + .pool +_080A3058: + movs r0, 0 +_080A305A: + pop {r1} + bx r1 + thumb_func_end sub_80A303C + + thumb_func_start pause_music_for_sound_maybe +@ void pause_music_for_sound_maybe(u8 a1) +pause_music_for_sound_maybe: @ 80A3060 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x03007420 + bl MPlayStop_rev01 + ldr r0, =gUnknown_085248BC + lsls r4, 2 + adds r4, r0 + ldrh r0, [r4] + ldr r2, =0x03000f4e + ldrh r1, [r4, 0x2] + strh r1, [r2] + bl m4aSongNumStart + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pause_music_for_sound_maybe + + thumb_func_start ducking_tick +ducking_tick: @ 80A3094 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + ldr r2, =0x03000f4e + ldrh r0, [r2] + cmp r0, 0 + beq _080A30B0 + subs r0, 0x1 + strh r0, [r2] + movs r0, 0 + b _080A30C8 + .pool +_080A30B0: + cmp r1, 0 + bne _080A30C0 + ldr r0, =0x03007420 + bl m4aMPlayContinue + b _080A30C6 + .pool +_080A30C0: + movs r0, 0 + bl m4aSongNumStart +_080A30C6: + movs r0, 0x1 +_080A30C8: + pop {r1} + bx r1 + thumb_func_end ducking_tick + + thumb_func_start sub_80A30CC +sub_80A30CC: @ 80A30CC + push {lr} + lsls r0, 24 + ldr r1, =gUnknown_085248BC + lsrs r0, 22 + adds r0, r1 + ldrh r0, [r0] + bl m4aSongNumStop + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A30CC + + thumb_func_start fanfare_play +@ void fanfare_play(u16 a1) +fanfare_play: @ 80A30E4 + push {lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r1, 0 + ldr r2, =gUnknown_085248BC +_080A30EE: + ldrh r0, [r2] + cmp r0, r3 + bne _080A3108 + lsls r0, r1, 24 + lsrs r0, 24 + bl pause_music_for_sound_maybe + bl task_add_50_overworld_fanfare_if_not_running + b _080A311A + .pool +_080A3108: + adds r2, 0x4 + adds r1, 0x1 + cmp r1, 0x11 + bls _080A30EE + movs r0, 0 + bl pause_music_for_sound_maybe + bl task_add_50_overworld_fanfare_if_not_running +_080A311A: + pop {r0} + bx r0 + thumb_func_end fanfare_play + + thumb_func_start task_is_not_running_overworld_fanfare +task_is_not_running_overworld_fanfare: @ 80A3120 + push {lr} + ldr r0, =task50_overworld_fanfare + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080A3138 + movs r0, 0x1 + b _080A313A + .pool +_080A3138: + movs r0, 0 +_080A313A: + pop {r1} + bx r1 + thumb_func_end task_is_not_running_overworld_fanfare + + thumb_func_start task50_overworld_fanfare +task50_overworld_fanfare: @ 80A3140 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03000f4e + ldrh r0, [r1] + cmp r0, 0 + beq _080A3158 + subs r0, 0x1 + strh r0, [r1] + b _080A3164 + .pool +_080A3158: + ldr r0, =0x03007420 + bl m4aMPlayContinue + adds r0, r4, 0 + bl remove_task +_080A3164: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task50_overworld_fanfare + + thumb_func_start task_add_50_overworld_fanfare_if_not_running +@ void task_add_50_overworld_fanfare_if_not_running() +task_add_50_overworld_fanfare_if_not_running: @ 80A3170 + push {r4,lr} + ldr r4, =task50_overworld_fanfare + adds r0, r4, 0 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080A318A + adds r0, r4, 0 + movs r1, 0x50 + bl AddTask +_080A318A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task_add_50_overworld_fanfare_if_not_running + + thumb_func_start sub_80A3194 +sub_80A3194: @ 80A3194 + push {r4-r7,lr} + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 24 + lsrs r7, r1, 24 + ldr r0, =0x03005df8 + ldrb r0, [r0] + cmp r0, 0 + beq _080A31A8 + movs r5, 0 +_080A31A8: + ldr r6, =0x0000ffff + cmp r5, r6 + bne _080A31B0 + movs r5, 0 +_080A31B0: + adds r0, r5, 0 + bl m4aSongNumStart + ldr r4, =0x03007420 + adds r0, r4, 0 + bl m4aMPlayImmInit + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0 + bl MPlayVolumeControl + adds r0, r5, 0 + bl m4aSongNumStop + adds r0, r4, 0 + adds r1, r7, 0 + bl sub_82E0328 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A3194 + + thumb_func_start sub_80A31E8 +sub_80A31E8: @ 80A31E8 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =0x03007420 + bl sub_82E0308 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A31E8 + + thumb_func_start sub_80A3200 +sub_80A3200: @ 80A3200 + push {lr} + ldr r0, =0x03007420 + ldr r1, [r0, 0x4] + cmp r1, 0 + blt _080A3220 + ldr r0, =0x0000ffff + ands r1, r0 + cmp r1, 0 + beq _080A3220 + movs r0, 0 + b _080A3222 + .pool +_080A3220: + movs r0, 0x1 +_080A3222: + pop {r1} + bx r1 + thumb_func_end sub_80A3200 + + thumb_func_start sub_80A3228 +sub_80A3228: @ 80A3228 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =0x03007420 + bl sub_82E0328 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A3228 + + thumb_func_start play_sound_effect +@ void play_sound_effect(u8 a1) +play_sound_effect: @ 80A3240 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =0x03007420 + bl m4aMPlayFadeOut + pop {r0} + bx r0 + .pool + thumb_func_end play_sound_effect + + thumb_func_start sub_80A3258 +sub_80A3258: @ 80A3258 + push {lr} + ldr r0, =0x03007420 + ldrh r0, [r0, 0x4] + cmp r0, 0 + beq _080A326C + movs r0, 0 + b _080A326E + .pool +_080A326C: + movs r0, 0x1 +_080A326E: + pop {r1} + bx r1 + thumb_func_end sub_80A3258 + + thumb_func_start cry_related +cry_related: @ 80A3274 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r4, r1, 0 + lsls r5, 16 + lsrs r5, 16 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x55 + bl MPlayVolumeControl + lsls r4, 24 + asrs r4, 24 + movs r0, 0 + str r0, [sp] + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x78 + movs r3, 0xA + bl sub_80A344C + ldr r1, =0x020383ec + movs r0, 0x2 + strb r0, [r1] + bl sub_80A3754 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end cry_related + + thumb_func_start sub_80A32C0 +sub_80A32C0: @ 80A32C0 + push {r4,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r0, 16 + lsls r3, 24 + lsrs r3, 24 + lsls r1, 24 + asrs r1, 24 + lsls r2, 24 + asrs r2, 24 + movs r4, 0 + str r4, [sp] + bl sub_80A344C + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A32C0 + + thumb_func_start sub_80A32E4 +sub_80A32E4: @ 80A32E4 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r4, r2, 24 + cmp r4, 0x1 + bne _080A330A + lsls r1, r5, 24 + asrs r1, 24 + str r4, [sp] + adds r0, r6, 0 + movs r2, 0x78 + movs r3, 0xA + bl sub_80A344C + b _080A332E +_080A330A: + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x55 + bl MPlayVolumeControl + lsls r1, r5, 24 + asrs r1, 24 + str r4, [sp] + adds r0, r6, 0 + movs r2, 0x78 + movs r3, 0xA + bl sub_80A344C + ldr r1, =0x020383ec + movs r0, 0x2 + strb r0, [r1] + bl sub_80A3754 +_080A332E: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A32E4 + + thumb_func_start sub_80A3344 +sub_80A3344: @ 80A3344 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r0, 16 + adds r6, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r5, r1, 0 + lsls r2, 24 + lsrs r2, 24 + adds r4, r2, 0 + cmp r2, 0x1 + bne _080A336E + lsls r1, 24 + asrs r1, 24 + str r2, [sp] + movs r2, 0x78 + movs r3, 0xA + bl sub_80A344C + b _080A3394 +_080A336E: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _080A3384 + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x55 + bl MPlayVolumeControl +_080A3384: + lsls r1, r5, 24 + asrs r1, 24 + str r4, [sp] + adds r0, r6, 0 + movs r2, 0x78 + movs r3, 0xA + bl sub_80A344C +_080A3394: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A3344 + + thumb_func_start play_cry_maybe +play_cry_maybe: @ 80A33A8 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r4, r2, 24 + cmp r4, 0x1 + bne _080A33CE + lsls r1, r5, 24 + asrs r1, 24 + str r4, [sp] + adds r0, r6, 0 + movs r2, 0x78 + movs r3, 0xA + bl sub_80A344C + b _080A33EE +_080A33CE: + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x55 + bl MPlayVolumeControl + lsls r1, r5, 24 + asrs r1, 24 + str r4, [sp] + adds r0, r6, 0 + movs r2, 0x78 + movs r3, 0xA + bl sub_80A344C + ldr r1, =0x020383ec + movs r0, 0x2 + strb r0, [r1] +_080A33EE: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end play_cry_maybe + + thumb_func_start sub_80A3404 +sub_80A3404: @ 80A3404 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r4, r1, 0 + lsls r5, 16 + lsrs r5, 16 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x55 + bl MPlayVolumeControl + str r4, [sp] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0x78 + movs r3, 0xA + bl sub_80A344C + ldr r1, =0x020383ec + movs r0, 0x2 + strb r0, [r1] + bl sub_80A3754 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A3404 + + thumb_func_start sub_80A344C +sub_80A344C: @ 80A344C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r4, [sp, 0x24] + lsls r0, 16 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp] + lsls r4, 24 + lsrs r1, r4, 24 + ldr r3, =0xffff0000 + adds r0, r3 + lsrs r7, r0, 16 + movs r6, 0x8C + movs r0, 0 + mov r9, r0 + movs r5, 0 + movs r4, 0xF0 + lsls r4, 6 + mov r8, r5 + cmp r1, 0xC + bhi _080A3562 + lsls r0, r1, 2 + ldr r1, =_080A349C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080A349C: + .4byte _080A3562 + .4byte _080A34D0 + .4byte _080A34D6 + .4byte _080A34E4 + .4byte _080A34F8 + .4byte _080A3510 + .4byte _080A351C + .4byte _080A352C + .4byte _080A3536 + .4byte _080A3540 + .4byte _080A3550 + .4byte _080A3560 + .4byte _080A355C +_080A34D0: + movs r6, 0x14 + movs r5, 0xE1 + b _080A3562 +_080A34D6: + movs r5, 0xE1 + ldr r4, =0x00003cf0 + movs r1, 0x14 + b _080A3504 + .pool +_080A34E4: + movs r6, 0x32 + movs r5, 0xC8 + ldr r4, =0x00003db8 + movs r3, 0x14 + mov r8, r3 + movs r2, 0x5A + b _080A3562 + .pool +_080A34F8: + movs r6, 0x19 + movs r0, 0x1 + mov r9, r0 + movs r5, 0x64 + ldr r4, =0x00003cf0 + movs r1, 0xC0 +_080A3504: + mov r8, r1 + movs r2, 0x5A + b _080A3562 + .pool +_080A3510: + movs r5, 0xC8 + ldr r4, =0x00003868 + b _080A3562 + .pool +_080A351C: + movs r5, 0xDC + ldr r4, =0x00003cc3 + movs r3, 0xC0 + mov r8, r3 + movs r2, 0x46 + b _080A3562 + .pool +_080A352C: + movs r6, 0xA + movs r5, 0x64 + movs r4, 0xE8 + lsls r4, 6 + b _080A3562 +_080A3536: + movs r6, 0x3C + movs r5, 0xE1 + movs r4, 0xF4 + lsls r4, 6 + b _080A3562 +_080A3540: + movs r6, 0xF + movs r0, 0x1 + mov r9, r0 + movs r5, 0x7D + ldr r4, =0x00003b60 + b _080A3562 + .pool +_080A3550: + movs r6, 0x64 + movs r5, 0xE1 + ldr r4, =0x00003b60 + b _080A3562 + .pool +_080A355C: + movs r6, 0x14 + movs r5, 0xE1 +_080A3560: + ldr r4, =0x00003a98 +_080A3562: + adds r0, r2, 0 + bl sub_82E1744 + mov r1, r10 + lsls r0, r1, 24 + asrs r0, 24 + bl sub_82E1758 + adds r0, r4, 0 + bl sub_82E1770 + adds r0, r6, 0 + bl sub_82E17A8 + movs r0, 0 + bl sub_82E17C0 + adds r0, r5, 0 + bl sub_82E17B4 + mov r3, r8 + lsls r0, r3, 24 + asrs r0, 24 + bl sub_82E17E4 + ldr r0, [sp] + bl sub_82E1850 + adds r0, r7, 0 + bl speciesid_conv + adds r7, r0, 0 + movs r1, 0x7F + ands r1, r7 + lsrs r0, r7, 7 + lsls r0, 24 + lsrs r0, 24 + adds r2, r0, 0 + cmp r0, 0x1 + beq _080A35F0 + cmp r0, 0x1 + bgt _080A35C0 + cmp r0, 0 + beq _080A35CA + b _080A365E + .pool +_080A35C0: + cmp r2, 0x2 + beq _080A3614 + cmp r2, 0x3 + beq _080A3638 + b _080A365E +_080A35CA: + mov r0, r9 + cmp r0, 0 + beq _080A35E0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_0869EF24 + b _080A3654 + .pool +_080A35E0: + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_0869DCF4 + b _080A3654 + .pool +_080A35F0: + mov r3, r9 + cmp r3, 0 + beq _080A3604 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_0869F524 + b _080A3654 + .pool +_080A3604: + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_0869E2F4 + b _080A3654 + .pool +_080A3614: + mov r0, r9 + cmp r0, 0 + beq _080A3628 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_0869FB24 + b _080A3654 + .pool +_080A3628: + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_0869E8F4 + b _080A3654 + .pool +_080A3638: + mov r3, r9 + cmp r3, 0 + beq _080A364C + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_086A0124 + b _080A3654 + .pool +_080A364C: + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_0869EEF4 +_080A3654: + adds r0, r1 + bl sub_82E1674 + ldr r1, =0x020383e8 + str r0, [r1] +_080A365E: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A344C + + thumb_func_start sub_80A3678 +sub_80A3678: @ 80A3678 + push {lr} + ldr r0, =sub_80A370C + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080A3694 + bl sub_8000964 + movs r0, 0x1 + b _080A3696 + .pool +_080A3694: + movs r0, 0 +_080A3696: + pop {r1} + bx r1 + thumb_func_end sub_80A3678 + + thumb_func_start sub_80A369C +sub_80A369C: @ 80A369C + push {lr} + ldr r0, =0x020383e8 + ldr r0, [r0] + bl MPlayStop_rev01 + bl sub_8000964 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A369C + + thumb_func_start sub_80A36B4 +sub_80A36B4: @ 80A36B4 + push {lr} + ldr r0, =0x020383e8 + ldr r0, [r0] + bl MPlayStop_rev01 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A36B4 + + thumb_func_start sub_80A36C8 +sub_80A36C8: @ 80A36C8 + push {lr} + ldr r0, =0x020383e8 + ldr r0, [r0] + bl sub_82E17CC + cmp r0, 0 + bne _080A36E4 + bl sub_8000964 + movs r0, 0 + b _080A36E6 + .pool +_080A36E4: + movs r0, 0x1 +_080A36E6: + pop {r1} + bx r1 + thumb_func_end sub_80A36C8 + + thumb_func_start sub_80A36EC +sub_80A36EC: @ 80A36EC + push {lr} + ldr r0, =0x020383e8 + ldr r0, [r0] + bl sub_82E17CC + cmp r0, 0 + bne _080A3704 + movs r0, 0 + b _080A3706 + .pool +_080A3704: + movs r0, 0x1 +_080A3706: + pop {r1} + bx r1 + thumb_func_end sub_80A36EC + + thumb_func_start sub_80A370C +sub_80A370C: @ 80A370C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x020383ec + ldrb r0, [r1] + cmp r0, 0 + beq _080A3724 + subs r0, 0x1 + strb r0, [r1] + b _080A3742 + .pool +_080A3724: + ldr r0, =0x020383e8 + ldr r0, [r0] + bl sub_82E17CC + cmp r0, 0 + bne _080A3742 + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl + adds r0, r4, 0 + bl remove_task +_080A3742: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A370C + + thumb_func_start sub_80A3754 +sub_80A3754: @ 80A3754 + push {r4,lr} + ldr r4, =sub_80A370C + adds r0, r4, 0 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080A376E + adds r0, r4, 0 + movs r1, 0x50 + bl AddTask +_080A376E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A3754 + + thumb_func_start song_play_for_text +song_play_for_text: @ 80A3778 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =0x03005df8 + ldrb r0, [r0] + cmp r0, 0 + beq _080A3788 + movs r1, 0 +_080A3788: + ldr r0, =0x0000ffff + cmp r1, r0 + bne _080A3790 + movs r1, 0 +_080A3790: + adds r0, r1, 0 + bl m4aSongNumStart + pop {r0} + bx r0 + .pool + thumb_func_end song_play_for_text + + thumb_func_start audio_play +audio_play: @ 80A37A4 + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl m4aSongNumStart + pop {r0} + bx r0 + thumb_func_end audio_play + + thumb_func_start audio_play_and_stuff +audio_play_and_stuff: @ 80A37B4 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r4, r1, 0 + lsls r0, 16 + lsrs r0, 16 + lsls r4, 24 + lsrs r4, 24 + bl m4aSongNumStart + ldr r6, =0x030075f0 + adds r0, r6, 0 + bl m4aMPlayImmInit + ldr r0, =0x03007630 + mov r8, r0 + bl m4aMPlayImmInit + ldr r5, =0x0000ffff + lsls r4, 24 + asrs r4, 24 + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl MPlayPanpotControl + mov r0, r8 + adds r1, r5, 0 + adds r2, r4, 0 + bl MPlayPanpotControl + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end audio_play_and_stuff + + thumb_func_start sub_80A3808 +sub_80A3808: @ 80A3808 + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 16 + lsrs r0, 16 + lsls r4, 24 + lsrs r4, 24 + bl m4aSongNumStart + ldr r5, =0x030075f0 + adds r0, r5, 0 + bl m4aMPlayImmInit + ldr r1, =0x0000ffff + lsls r4, 24 + asrs r4, 24 + adds r0, r5, 0 + adds r2, r4, 0 + bl MPlayPanpotControl + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A3808 + + thumb_func_start sub_80A383C +sub_80A383C: @ 80A383C + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 16 + lsrs r0, 16 + lsls r4, 24 + lsrs r4, 24 + bl m4aSongNumStart + ldr r5, =0x03007630 + adds r0, r5, 0 + bl m4aMPlayImmInit + ldr r1, =0x0000ffff + lsls r4, 24 + asrs r4, 24 + adds r0, r5, 0 + adds r2, r4, 0 + bl MPlayPanpotControl + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A383C + + thumb_func_start sub_80A3870 +sub_80A3870: @ 80A3870 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, =0x030075f0 + ldr r5, =0x0000ffff + lsls r4, 24 + asrs r4, 24 + adds r1, r5, 0 + adds r2, r4, 0 + bl MPlayPanpotControl + ldr r0, =0x03007630 + adds r1, r5, 0 + adds r2, r4, 0 + bl MPlayPanpotControl + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A3870 + + thumb_func_start mplay_has_finished_maybe +mplay_has_finished_maybe: @ 80A38A0 + push {lr} + ldr r0, =0x030075f0 + ldr r1, [r0, 0x4] + movs r2, 0x80 + lsls r2, 24 + adds r3, r0, 0 + cmp r1, 0 + bge _080A38BA + ldr r0, =0x03007630 + ldr r0, [r0, 0x4] + ands r0, r2 + cmp r0, 0 + bne _080A38CC +_080A38BA: + ldr r1, =0x0000ffff + ldrh r0, [r3, 0x4] + cmp r0, 0 + bne _080A38DC + ldr r0, =0x03007630 + ldr r0, [r0, 0x4] + ands r0, r1 + cmp r0, 0 + bne _080A38DC +_080A38CC: + movs r0, 0 + b _080A38DE + .pool +_080A38DC: + movs r0, 0x1 +_080A38DE: + pop {r1} + bx r1 + thumb_func_end mplay_has_finished_maybe + + thumb_func_start sub_80A38E4 +sub_80A38E4: @ 80A38E4 + push {lr} + ldr r0, =0x03007420 + ldr r1, [r0, 0x4] + cmp r1, 0 + blt _080A3904 + ldr r0, =0x0000ffff + ands r1, r0 + cmp r1, 0 + beq _080A3904 + movs r0, 0x1 + b _080A3906 + .pool +_080A3904: + movs r0, 0 +_080A3906: + pop {r1} + bx r1 + thumb_func_end sub_80A38E4 + + thumb_func_start sub_80A390C +sub_80A390C: @ 80A390C + push {lr} + ldr r0, =0x03007800 + ldr r1, [r0, 0x4] + cmp r1, 0 + blt _080A392C + ldr r0, =0x0000ffff + ands r1, r0 + cmp r1, 0 + beq _080A392C + movs r0, 0x1 + b _080A392E + .pool +_080A392C: + movs r0, 0 +_080A392E: + pop {r1} + bx r1 + thumb_func_end sub_80A390C + + thumb_func_start sub_80A3934 +sub_80A3934: @ 80A3934 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r0, =0x020383fc + movs r1, 0 + strb r1, [r0] + ldr r0, =0x020383fd + strb r1, [r0] + ldr r0, =0x020383fe + strb r1, [r0] + ldr r0, =0x020383ff + strb r1, [r0] + ldr r0, =0x02038400 + movs r1, 0 + str r1, [r0] + ldr r0, =0x02038404 + str r1, [r0] + ldr r0, =0x02038408 + movs r2, 0 + strh r1, [r0] + ldr r0, =0x0203841a + strb r2, [r0] + ldr r4, =0x02038430 + ldr r5, =0x02038432 + ldr r6, =0x02038433 + ldr r7, =0x02038434 + ldr r0, =0x02038436 + mov r12, r0 + ldr r1, =0x02038437 + mov r8, r1 + ldr r0, =0x02038440 + mov r9, r0 + ldr r1, =0x0000ffff + adds r3, r1, 0 + ldr r1, =0x0203840a + movs r2, 0x7 +_080A397E: + ldrh r0, [r1] + orrs r0, r3 + strh r0, [r1] + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _080A397E + ldr r1, =0x0203841e + movs r2, 0 + adds r0, r1, 0 + adds r0, 0xE +_080A3994: + strh r2, [r0] + subs r0, 0x2 + cmp r0, r1 + bge _080A3994 + movs r1, 0 + movs r0, 0xFF + strb r0, [r4] + movs r0, 0x1 + negs r0, r0 + strb r0, [r4, 0x1] + strb r1, [r5] + strb r1, [r6] + movs r0, 0 + strh r1, [r7] + mov r1, r12 + strb r0, [r1] + mov r1, r8 + strb r0, [r1] + mov r1, r9 + strb r0, [r1] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A3934 + + thumb_func_start move_anim_start_t1 +move_anim_start_t1: @ 80A3A10 + push {lr} + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r2, =0x02038436 + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r2] + ldr r2, =0x02038437 + ldr r0, =0x0202420c + ldrb r0, [r0] + strb r0, [r2] + ldr r0, =gUnknown_082C8D6C + movs r2, 0x1 + bl move_something + pop {r0} + bx r0 + .pool + thumb_func_end move_anim_start_t1 + + thumb_func_start move_something +move_something: @ 80A3A48 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + str r0, [sp] + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A3AE8 + bl sub_80A8278 + movs r0, 0 + bl sub_8072A88 + movs r4, 0 + mov r0, r8 + lsls r0, 2 + mov r10, r0 + ldr r6, =0x0202406e + movs r7, 0x64 + ldr r5, =0x02038438 +_080A3A84: + lsls r0, r4, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080A3AA8 + ldrh r0, [r6] + muls r0, r7 + ldr r1, =0x02024744 + b _080A3AAE + .pool +_080A3AA8: + ldrh r0, [r6] + muls r0, r7 + ldr r1, =0x020244ec +_080A3AAE: + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + strh r0, [r5] + adds r6, 0x2 + adds r5, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + ble _080A3A84 + ldr r3, =0x02038434 + ldr r5, =0x02038430 + ldr r1, =0x020383fd + mov r12, r1 + ldr r7, =0x020383f8 + ldr r6, =move_anim_execute + b _080A3B10 + .pool +_080A3AE8: + ldr r3, =0x02038434 + ldr r5, =0x02038430 + mov r0, r8 + lsls r0, 2 + mov r10, r0 + ldr r1, =0x020383fd + mov r12, r1 + ldr r7, =0x020383f8 + ldr r6, =move_anim_execute + ldr r2, =0x02039f34 + ldr r1, =0x02038438 + movs r4, 0x3 +_080A3B00: + ldr r0, [r2] + ldr r0, [r0, 0x18] + ldrh r0, [r0] + strh r0, [r1] + adds r1, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _080A3B00 +_080A3B10: + mov r0, r9 + cmp r0, 0 + bne _080A3B38 + strh r0, [r3] + b _080A3B3C + .pool +_080A3B38: + mov r1, r8 + strh r1, [r3] +_080A3B3C: + ldr r1, =0x0203841e + movs r2, 0 + adds r0, r1, 0 + adds r0, 0xE +_080A3B44: + strh r2, [r0] + subs r0, 0x2 + cmp r0, r1 + bge _080A3B44 + movs r0, 0xFF + strb r0, [r5] + movs r0, 0x1 + negs r0, r0 + strb r0, [r5, 0x1] + ldr r0, [sp] + add r0, r10 + ldr r0, [r0] + ldr r1, =0x020383f0 + str r0, [r1] + movs r0, 0x1 + mov r1, r12 + strb r0, [r1] + movs r0, 0 + ldr r1, =0x020383fc + strb r0, [r1] + str r6, [r7] + ldr r0, =0x0000ffff + adds r2, r0, 0 + ldr r1, =0x0203840a + movs r4, 0x7 +_080A3B76: + ldrh r0, [r1] + orrs r0, r2 + strh r0, [r1] + adds r1, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _080A3B76 + mov r1, r9 + cmp r1, 0 + beq _080A3BC2 + movs r4, 0 + ldr r2, =gUnknown_082C8D64 + b _080A3BAA + .pool +_080A3BA8: + adds r4, 0x1 +_080A3BAA: + lsls r0, r4, 1 + adds r0, r2 + ldrh r0, [r0] + ldr r1, =0x0000ffff + cmp r0, r1 + beq _080A3BC2 + cmp r8, r0 + bne _080A3BA8 + ldr r0, =0x03007420 + movs r2, 0x80 + bl MPlayVolumeControl +_080A3BC2: + ldr r0, =0x02022e24 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e26 + strh r1, [r0] + ldr r0, =0x02022e28 + strh r1, [r0] + ldr r0, =0x02022e2a + strh r1, [r0] + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end move_something + + thumb_func_start move_anim_8072740 +move_anim_8072740: @ 80A3BFC + push {r4,lr} + adds r4, r0, 0 + bl obj_free_rotscale_entry + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + ldr r1, =0x020383fe + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end move_anim_8072740 + + thumb_func_start move_anim_task_del +move_anim_task_del: @ 80A3C1C + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl remove_task + ldr r1, =0x020383fe + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end move_anim_task_del + + thumb_func_start move_anim_related_task_del +move_anim_related_task_del: @ 80A3C38 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl remove_task + ldr r1, =0x020383ff + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end move_anim_related_task_del + + thumb_func_start sub_80A3C54 +sub_80A3C54: @ 80A3C54 + push {r4,lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + ldr r4, =0x0000ffff + ldr r1, =0x0203840a +_080A3C60: + ldrh r0, [r1] + cmp r0, r4 + bne _080A3C74 + strh r3, [r1] + b _080A3C7C + .pool +_080A3C74: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, 0x7 + ble _080A3C60 +_080A3C7C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A3C54 + + thumb_func_start sub_80A3C84 +sub_80A3C84: @ 80A3C84 + push {r4,lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + ldr r0, =0x0000ffff + adds r4, r0, 0 + ldr r1, =0x0203840a +_080A3C92: + ldrh r0, [r1] + cmp r0, r3 + bne _080A3CA8 + orrs r0, r4 + strh r0, [r1] + b _080A3CB0 + .pool +_080A3CA8: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, 0x7 + ble _080A3C92 +_080A3CB0: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A3C84 + + thumb_func_start move_anim_waiter +move_anim_waiter: @ 80A3CB8 + push {lr} + ldr r2, =0x020383fc + ldrb r1, [r2] + movs r0, 0 + ldrsb r0, [r2, r0] + cmp r0, 0 + bgt _080A3CDC + ldr r0, =0x020383f8 + ldr r1, =move_anim_execute + str r1, [r0] + movs r0, 0 + b _080A3CDE + .pool +_080A3CDC: + subs r0, r1, 0x1 +_080A3CDE: + strb r0, [r2] + pop {r0} + bx r0 + thumb_func_end move_anim_waiter + + thumb_func_start move_anim_execute +move_anim_execute: @ 80A3CE4 + push {r4,lr} + ldr r4, =gUnknown_08525E98 +_080A3CE8: + ldr r0, =0x020383f0 + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, =0x020383fc + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + bne _080A3D0C + ldr r0, =0x020383fd + ldrb r0, [r0] + cmp r0, 0 + bne _080A3CE8 +_080A3D0C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end move_anim_execute + + thumb_func_start ma00_load_graphics +ma00_load_graphics: @ 80A3D24 + push {r4-r6,lr} + ldr r6, =0x020383f0 + ldr r0, [r6] + adds r1, r0, 0x1 + str r1, [r6] + ldrb r4, [r0, 0x1] + ldrb r0, [r1, 0x1] + lsls r0, 8 + orrs r4, r0 + lsls r5, r4, 3 + ldr r0, =gUnknown_085112C4 + adds r0, r5, r0 + bl LoadCompressedObjectPicUsingHeap + ldr r0, =gUnknown_08511BCC + adds r5, r0 + adds r0, r5, 0 + bl LoadCompressedObjectPaletteUsingHeap + ldr r0, [r6] + adds r0, 0x2 + str r0, [r6] + ldr r0, =0xffffd8f0 + adds r4, r0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r4, 0 + bl sub_80A3C54 + ldr r1, =0x020383fc + movs r0, 0x1 + strb r0, [r1] + ldr r1, =0x020383f8 + ldr r0, =move_anim_waiter + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end ma00_load_graphics + + thumb_func_start ma01_080728D0 +@ void ma01_080728D0() +ma01_080728D0: @ 80A3D8C + push {r4-r6,lr} + ldr r6, =0x020383f0 + ldr r0, [r6] + adds r1, r0, 0x1 + str r1, [r6] + ldrb r4, [r0, 0x1] + ldrb r0, [r1, 0x1] + lsls r0, 8 + orrs r4, r0 + ldr r1, =gUnknown_08524B44 + ldr r0, =0xffffd8f0 + adds r4, r0 + lsls r0, r4, 3 + adds r0, r1 + ldrh r5, [r0, 0x6] + adds r0, r5, 0 + bl FreeObjectTilesByTag + adds r0, r5, 0 + bl FreeObjectPaletteByTag + ldr r0, [r6] + adds r0, 0x2 + str r0, [r6] + lsls r4, 16 + lsrs r4, 16 + adds r0, r4, 0 + bl sub_80A3C84 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end ma01_080728D0 + + thumb_func_start ma02_instanciate_template +ma02_instanciate_template: @ 80A3DD8 + push {r4-r7,lr} + ldr r5, =0x020383f0 + ldr r1, [r5] + adds r3, r1, 0x1 + str r3, [r5] + ldrb r2, [r1, 0x1] + ldrb r0, [r3, 0x1] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r3, 0x2] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r3, 0x3] + lsls r0, 24 + adds r7, r2, r0 + adds r0, r1, 0x5 + str r0, [r5] + ldrb r4, [r1, 0x5] + adds r0, r1, 0x6 + str r0, [r5] + ldrb r0, [r1, 0x6] + adds r1, 0x7 + str r1, [r5] + cmp r0, 0 + beq _080A3E28 + adds r6, r5, 0 + ldr r5, =0x0203841e + adds r3, r0, 0 +_080A3E10: + ldr r2, [r6] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + strh r1, [r5] + adds r2, 0x2 + str r2, [r6] + adds r5, 0x2 + subs r3, 0x1 + cmp r3, 0 + bne _080A3E10 +_080A3E28: + movs r0, 0x80 + ands r0, r4 + cmp r0, 0 + beq _080A3E58 + movs r0, 0x80 + eors r4, r0 + cmp r4, 0x3F + bls _080A3E48 + adds r0, r4, 0 + subs r0, 0x40 + b _080A3E4A + .pool +_080A3E48: + negs r0, r4 +_080A3E4A: + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02038437 + b _080A3E6A + .pool +_080A3E58: + cmp r4, 0x3F + bls _080A3E62 + adds r0, r4, 0 + subs r0, 0x40 + b _080A3E64 +_080A3E62: + negs r0, r4 +_080A3E64: + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02038436 +_080A3E6A: + ldrb r0, [r0] + bl sub_80A82E4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r4, 24 + asrs r1, 24 + adds r0, r1 + lsls r0, 16 + lsrs r6, r0, 16 + lsls r0, r6, 16 + asrs r0, 16 + cmp r0, 0x2 + bgt _080A3E88 + movs r6, 0x3 +_080A3E88: + ldr r5, =0x02038437 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + lsls r3, r6, 24 + lsrs r3, 24 + adds r0, r7, 0 + adds r1, r4, 0 + bl AddObjectAndAnimateForOneFrame + ldr r1, =0x020383fe + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end ma02_instanciate_template + + thumb_func_start sub_80A3ECC +sub_80A3ECC: @ 80A3ECC + push {r4-r7,lr} + ldr r4, =0x020383f0 + ldr r1, [r4] + adds r3, r1, 0x1 + str r3, [r4] + ldrb r2, [r1, 0x1] + ldrb r0, [r3, 0x1] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r3, 0x2] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r3, 0x3] + lsls r0, 24 + adds r6, r2, r0 + adds r0, r1, 0x5 + str r0, [r4] + ldrb r7, [r1, 0x5] + adds r0, r1, 0x6 + str r0, [r4] + ldrb r0, [r1, 0x6] + adds r1, 0x7 + str r1, [r4] + cmp r0, 0 + beq _080A3F1C + adds r5, r4, 0 + ldr r4, =0x0203841e + adds r3, r0, 0 +_080A3F04: + ldr r2, [r5] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + strh r1, [r4] + adds r2, 0x2 + str r2, [r5] + adds r4, 0x2 + subs r3, 0x1 + cmp r3, 0 + bne _080A3F04 +_080A3F1C: + adds r0, r6, 0 + adds r1, r7, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r6 + ldr r1, =0x020383fe + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A3ECC + + thumb_func_start ma04_wait_countdown +ma04_wait_countdown: @ 80A3F48 + push {r4,lr} + ldr r1, =0x020383f0 + ldr r0, [r1] + adds r2, r0, 0x1 + str r2, [r1] + ldr r3, =0x020383fc + ldrb r0, [r0, 0x1] + strb r0, [r3] + lsls r0, 24 + cmp r0, 0 + bne _080A3F66 + movs r4, 0x1 + negs r4, r4 + adds r0, r4, 0 + strb r0, [r3] +_080A3F66: + adds r0, r2, 0x1 + str r0, [r1] + ldr r1, =0x020383f8 + ldr r0, =move_anim_waiter + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ma04_wait_countdown + + thumb_func_start sub_80A3F88 +sub_80A3F88: @ 80A3F88 + push {lr} + ldr r0, =0x020383fe + ldrb r2, [r0] + cmp r2, 0 + bne _080A3FAC + ldr r0, =0x020383f0 + ldr r1, [r0] + adds r1, 0x1 + str r1, [r0] + ldr r0, =0x020383fc + strb r2, [r0] + b _080A3FB2 + .pool +_080A3FAC: + ldr r1, =0x020383fc + movs r0, 0x1 + strb r0, [r1] +_080A3FB2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A3F88 + + thumb_func_start nullsub_6 +nullsub_6: @ 80A3FBC + bx lr + thumb_func_end nullsub_6 + + thumb_func_start nullsub_7 +nullsub_7: @ 80A3FC0 + bx lr + thumb_func_end nullsub_7 + + thumb_func_start sub_80A3FC4 +sub_80A3FC4: @ 80A3FC4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r0, 0 + mov r8, r0 + ldr r0, =0x020383fe + ldrb r0, [r0] + cmp r0, 0 + bne _080A3FEC + ldr r0, =0x020383ff + ldrb r0, [r0] + cmp r0, 0 + bne _080A3FEC + ldr r1, =0x02038430 + ldrb r0, [r1] + cmp r0, 0xFF + bne _080A3FEC + ldrb r0, [r1, 0x1] + cmp r0, 0xFF + beq _080A4004 +_080A3FEC: + ldr r1, =0x0203842e + movs r0, 0 + strh r0, [r1] + b _080A401E + .pool +_080A4004: + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + beq _080A403C + ldr r1, =0x0203842e + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x5A + bhi _080A4030 +_080A401E: + ldr r1, =0x020383fc + movs r0, 0x1 + strb r0, [r1] + b _080A40A2 + .pool +_080A4030: + ldr r0, =0x030075f0 + bl MPlayStop_rev01 + ldr r0, =0x03007630 + bl MPlayStop_rev01 +_080A403C: + ldr r1, =0x0203842e + movs r0, 0 + strh r0, [r1] + movs r5, 0 + ldr r7, =0x0000ffff + ldr r6, =gUnknown_08524B44 + ldr r4, =0x0203840a +_080A404A: + ldrh r0, [r4] + cmp r0, r7 + beq _080A406E + lsls r0, 3 + adds r0, r6 + ldrh r0, [r0, 0x6] + bl FreeObjectTilesByTag + ldrh r0, [r4] + lsls r0, 3 + adds r0, r6 + ldrh r0, [r0, 0x6] + bl FreeObjectPaletteByTag + ldrh r1, [r4] + adds r0, r7, 0 + orrs r0, r1 + strh r0, [r4] +_080A406E: + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x7 + ble _080A404A + mov r1, r8 + cmp r1, 0 + bne _080A40A2 + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A409C + bl sub_80A8278 + movs r0, 0x1 + bl sub_8072A88 +_080A409C: + ldr r0, =0x020383fd + mov r1, r8 + strb r1, [r0] +_080A40A2: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A3FC4 + + thumb_func_start ma09_play_sound +ma09_play_sound: @ 80A40CC + push {r4,lr} + ldr r4, =0x020383f0 + ldr r0, [r4] + adds r1, r0, 0x1 + str r1, [r4] + ldrb r0, [r0, 0x1] + ldrb r1, [r1, 0x1] + lsls r1, 8 + orrs r0, r1 + bl audio_play + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ma09_play_sound + + thumb_func_start sub_80A40F4 +sub_80A40F4: @ 80A40F4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, =0x03005e08 + mov r8, r1 + adds r6, r0, r1 + ldr r1, =0x020241e4 + movs r2, 0 + ldrsh r0, [r6, r2] + adds r0, r1 + ldrb r5, [r0] + ldr r1, =0x02020630 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r4, r0, r1 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + movs r3, 0x4 + ldrsh r0, [r6, r3] + cmp r0, 0 + bne _080A4148 + adds r0, r7, 0 + bl move_anim_task_del + b _080A41BE + .pool +_080A4148: + ldr r0, =task_pA_ma0A_obj_to_bg_pal + movs r1, 0xA + bl AddTask + lsls r0, 24 + lsrs r2, r0, 24 + mov r1, r8 + subs r1, 0x8 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0, r1 + strh r5, [r1, 0x8] + ldrh r0, [r4, 0x24] + ldrh r3, [r4, 0x20] + adds r0, r3 + strh r0, [r1, 0xA] + ldrh r0, [r4, 0x26] + ldrh r4, [r4, 0x22] + adds r0, r4 + strh r0, [r1, 0xC] + movs r3, 0x2 + ldrsh r0, [r6, r3] + cmp r0, 0 + bne _080A4190 + ldr r0, =0x02022e18 + ldrh r0, [r0] + strh r0, [r1, 0xE] + ldr r0, =0x02022e1a + b _080A4198 + .pool +_080A4190: + ldr r0, =0x02022e1c + ldrh r0, [r0] + strh r0, [r1, 0xE] + ldr r0, =0x02022e1e +_080A4198: + ldrh r0, [r0] + strh r0, [r1, 0x10] + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r6, 0x2] + strh r1, [r0, 0x12] + ldrh r1, [r6] + strh r1, [r0, 0x14] + ldr r1, =0x02038430 + movs r3, 0x6 + ldrsh r0, [r6, r3] + adds r0, r1 + strb r2, [r0] + adds r0, r7, 0 + bl move_anim_task_del +_080A41BE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A40F4 + + thumb_func_start sub_80A41D8 +sub_80A41D8: @ 80A41D8 + push {r4,r5,lr} + ldr r1, =0x020383f0 + ldr r2, [r1] + adds r0, r2, 0x1 + str r0, [r1] + ldrb r0, [r2, 0x1] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080A41F8 + ldr r0, =0x02038437 + b _080A41FA + .pool +_080A41F8: + ldr r0, =0x02038436 +_080A41FA: + ldrb r4, [r0] + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A4266 + adds r0, r4, 0 + bl battle_get_per_side_status + lsls r0, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bls _080A4226 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A4230 +_080A4226: + movs r5, 0 + b _080A4232 + .pool +_080A4230: + movs r5, 0x1 +_080A4232: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + bl sub_80A438C + ldr r0, =sub_80A40F4 + movs r1, 0xA + bl AddTask + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =0x020383fe + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + movs r2, 0 + strh r4, [r0, 0x8] + strh r5, [r0, 0xA] + movs r1, 0x1 + strh r1, [r0, 0xC] + strh r2, [r0, 0xE] +_080A4266: + movs r0, 0x2 + eors r4, r0 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A42D8 + adds r0, r4, 0 + bl battle_get_per_side_status + lsls r0, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bls _080A4294 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A42A4 +_080A4294: + movs r5, 0 + b _080A42A6 + .pool +_080A42A4: + movs r5, 0x1 +_080A42A6: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + bl sub_80A438C + ldr r0, =sub_80A40F4 + movs r1, 0xA + bl AddTask + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =0x020383fe + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + strh r4, [r0, 0x8] + strh r5, [r0, 0xA] + movs r1, 0x1 + strh r1, [r0, 0xC] + strh r1, [r0, 0xE] +_080A42D8: + ldr r1, =0x020383f0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r1, =0x020383fc + movs r0, 0x1 + strb r0, [r1] + ldr r1, =0x020383f8 + ldr r0, =move_anim_waiter + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A41D8 + + thumb_func_start b_side_obj__get_some_boolean +b_side_obj__get_some_boolean: @ 80A4310 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A4330 + ldr r0, =0x02038436 + ldrb r0, [r0] + cmp r4, r0 + beq _080A4374 + b _080A4384 + .pool +_080A4330: + adds r0, r4, 0 + bl sub_80A6A90 + lsls r0, 24 + cmp r0, 0 + beq _080A4384 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A4374 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r5, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080A4374 + ldr r2, =0x02020630 + ldr r0, =0x020241e4 + adds r0, r5, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _080A4384 +_080A4374: + movs r0, 0x1 + b _080A4386 + .pool +_080A4384: + movs r0, 0 +_080A4386: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end b_side_obj__get_some_boolean + + thumb_func_start sub_80A438C +sub_80A438C: @ 80A438C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x28 + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + lsls r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + cmp r1, 0 + beq _080A43AA + b _080A455E +_080A43AA: + bl sub_80A4DF0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080A43DC + ldr r1, =0x06008000 + movs r2, 0x80 + lsls r2, 6 + movs r0, 0 + movs r3, 0x1 + bl RequestDma3Fill + ldr r1, =0x0600f000 + movs r2, 0x80 + lsls r2, 5 + movs r0, 0xFF + movs r3, 0 + bl RequestDma3Fill + b _080A43F8 + .pool +_080A43DC: + ldr r1, =0x06004000 + movs r2, 0x80 + lsls r2, 6 + movs r0, 0 + movs r3, 0x1 + bl RequestDma3Fill + ldr r1, =0x0600e000 + movs r2, 0x80 + lsls r2, 5 + movs r0, 0xFF + movs r3, 0 + bl RequestDma3Fill +_080A43F8: + add r0, sp, 0x10 + bl sub_80A6B30 + add r0, sp, 0x20 + movs r1, 0 + strh r1, [r0] + ldr r1, [sp, 0x10] + ldr r2, =0x01000800 + bl CpuSet + mov r0, sp + adds r0, 0x22 + movs r1, 0xFF + strh r1, [r0] + ldr r1, [sp, 0x14] + ldr r2, =0x01000400 + bl CpuSet + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x2 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0 + movs r2, 0x1 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + bl lcd_bg_operations + ldr r0, =0x020241e4 + adds r0, r6, r0 + ldrb r4, [r0] + ldr r5, =0x02022e18 + ldr r0, =0x02020630 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x24] + ldrh r1, [r1, 0x20] + adds r0, r1 + negs r0, r0 + adds r0, 0x20 + strh r0, [r5] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A447A + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldrh r0, [r0] + bl sub_80DB2A8 + lsls r0, 24 + cmp r0, 0 + beq _080A447A + ldrh r0, [r5] + subs r0, 0x1 + strh r0, [r5] +_080A447A: + ldr r5, =0x02022e1a + ldr r2, =0x02020630 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1, 0x26] + ldrh r1, [r1, 0x22] + adds r0, r1 + negs r0, r0 + adds r0, 0x20 + strh r0, [r5] + mov r0, r9 + cmp r0, 0 + beq _080A44B0 + ldr r0, =0x020241e4 + adds r0, r6, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080A44B0: + ldr r0, =0x02022e18 + ldrh r1, [r0] + movs r0, 0x14 + bl SetGpuReg + ldrh r1, [r5] + movs r0, 0x16 + bl SetGpuReg + lsls r4, r6, 5 + ldr r0, =0x02037914 + adds r4, r0 + add r0, sp, 0x10 + ldrb r1, [r0, 0x8] + lsls r1, 4 + adds r0, r4, 0 + movs r2, 0x20 + bl gpu_pal_apply + add r0, sp, 0x10 + ldrb r1, [r0, 0x8] + lsls r1, 5 + movs r0, 0xA0 + lsls r0, 19 + adds r1, r0 + ldr r2, =0x04000008 + adds r0, r4, 0 + bl CpuSet + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A4524 + movs r3, 0 + b _080A452E + .pool +_080A4524: + adds r0, r6, 0 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r3, r0, 24 +_080A452E: + add r0, sp, 0x10 + ldrb r0, [r0, 0x8] + str r0, [sp] + ldr r0, [sp, 0x10] + str r0, [sp, 0x4] + ldr r0, [sp, 0x14] + str r0, [sp, 0x8] + add r0, sp, 0x10 + ldrh r0, [r0, 0xA] + str r0, [sp, 0xC] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl sub_8118FBC + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A4558 + b _080A4666 +_080A4558: + bl sub_80A46A0 + b _080A4666 +_080A455E: + ldr r1, =0x06006000 + movs r2, 0x80 + lsls r2, 6 + movs r0, 0 + movs r3, 0x1 + bl RequestDma3Fill + ldr r1, =0x0600f000 + movs r7, 0x80 + lsls r7, 5 + movs r0, 0 + adds r2, r7, 0 + movs r3, 0x1 + bl RequestDma3Fill + add r0, sp, 0x10 + movs r1, 0x2 + bl sub_80A6B90 + add r0, sp, 0x24 + movs r4, 0 + strh r4, [r0] + ldr r1, [sp, 0x10] + adds r1, r7 + ldr r2, =0x01000800 + bl CpuSet + mov r0, sp + adds r0, 0x26 + strh r4, [r0] + ldr r1, [sp, 0x14] + movs r2, 0x80 + lsls r2, 4 + mov r8, r2 + add r1, r8 + ldr r2, =0x01000400 + bl CpuSet + movs r0, 0x2 + movs r1, 0x4 + movs r2, 0x2 + bl lcd_bg_operations + movs r0, 0x2 + movs r1, 0 + movs r2, 0x1 + bl lcd_bg_operations + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0 + bl lcd_bg_operations + ldr r0, =0x020241e4 + adds r2, r5, r0 + ldrb r4, [r2] + ldr r5, =0x02022e1c + ldr r3, =0x02020630 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r1, 0x24] + ldrh r4, [r1, 0x20] + adds r0, r4 + negs r0, r0 + adds r0, 0x20 + strh r0, [r5] + ldr r4, =0x02022e1e + ldrh r0, [r1, 0x26] + ldrh r1, [r1, 0x22] + adds r0, r1 + negs r0, r0 + adds r0, 0x20 + strh r0, [r4] + mov r0, r9 + cmp r0, 0 + beq _080A460E + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080A460E: + ldrh r1, [r5] + movs r0, 0x18 + bl SetGpuReg + ldrh r1, [r4] + movs r0, 0x1A + bl SetGpuReg + lsls r4, r6, 5 + ldr r0, =0x02037914 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x90 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, =0x05000120 + ldr r2, =0x04000008 + adds r0, r4, 0 + bl CpuSet + adds r0, r6, 0 + bl battle_get_per_side_status + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + add r0, sp, 0x10 + ldrb r0, [r0, 0x8] + str r0, [sp] + ldr r0, [sp, 0x10] + adds r0, r7 + str r0, [sp, 0x4] + ldr r0, [sp, 0x14] + add r0, r8 + str r0, [sp, 0x8] + add r0, sp, 0x10 + ldrh r0, [r0, 0xA] + str r0, [sp, 0xC] + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl sub_8118FBC +_080A4666: + add sp, 0x28 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A438C + + thumb_func_start sub_80A46A0 +sub_80A46A0: @ 80A46A0 + push {r4-r7,lr} + sub sp, 0x10 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldrh r0, [r0] + bl sub_80DB2A8 + lsls r0, 24 + cmp r0, 0 + beq _080A4712 + mov r0, sp + bl sub_80A6B30 + ldr r6, [sp, 0x4] + movs r5, 0 + movs r0, 0x7 + mov r12, r0 + movs r7, 0 +_080A46C6: + movs r4, 0 + adds r3, r7, r6 + mov r1, r12 + lsls r0, r1, 1 + adds r2, r0, r6 +_080A46D0: + ldrh r1, [r3] + ldrh r0, [r2] + strh r0, [r3] + strh r1, [r2] + adds r3, 0x2 + subs r2, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + ble _080A46D0 + movs r0, 0x20 + add r12, r0 + adds r7, 0x40 + adds r5, 0x1 + cmp r5, 0x7 + ble _080A46C6 + movs r5, 0 + movs r1, 0x80 + lsls r1, 3 + adds r3, r1, 0 +_080A46F6: + adds r2, r5, 0x1 + lsls r0, r5, 6 + adds r1, r0, r6 + movs r4, 0x7 +_080A46FE: + ldrh r0, [r1] + eors r0, r3 + strh r0, [r1] + adds r1, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _080A46FE + adds r5, r2, 0 + cmp r5, 0x7 + ble _080A46F6 +_080A4712: + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A46A0 + + thumb_func_start sub_80A4720 +sub_80A4720: @ 80A4720 + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r1 + adds r6, r2, 0 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r3, 24 + movs r0, 0x40 + mov r12, r0 + cmp r3, 0 + bne _080A473C + movs r1, 0x20 + mov r12, r1 +_080A473C: + lsls r0, r5, 28 + lsrs r5, r0, 16 + movs r0, 0 + cmp r0, r12 + bge _080A476C + ldr r7, =0x00000fff +_080A4748: + adds r4, r0, 0x1 + lsls r0, 6 + mov r1, r8 + adds r3, r0, r1 + movs r2, 0x1F +_080A4752: + ldrh r1, [r3] + adds r0, r7, 0 + ands r0, r1 + orrs r0, r5 + adds r0, r6 + strh r0, [r3] + adds r3, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _080A4752 + adds r0, r4, 0 + cmp r0, r12 + blt _080A4748 +_080A476C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A4720 + + thumb_func_start sub_80A477C +sub_80A477C: @ 80A477C + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + mov r0, sp + bl sub_80A6B30 + cmp r4, 0 + beq _080A479C + bl sub_80A4DF0 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _080A47B8 +_080A479C: + movs r0, 0x1 + bl sub_80A6C68 + ldr r0, =0x02022e18 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e1a + strh r1, [r0] + b _080A47C6 + .pool +_080A47B8: + movs r0, 0x2 + bl sub_80A6C68 + ldr r0, =0x02022e1c + strh r4, [r0] + ldr r0, =0x02022e1e + strh r4, [r0] +_080A47C6: + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A477C + + thumb_func_start task_pA_ma0A_obj_to_bg_pal +@ void task_pA_ma0A_obj_to_bg_pal(int task_id) +task_pA_ma0A_obj_to_bg_pal: @ 80A47D8 + push {r4-r6,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r5, r1, r2 + ldrb r4, [r5, 0x8] + ldrb r6, [r5, 0x14] + mov r0, sp + bl sub_80A6B30 + ldr r0, =0x02020630 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r0 + ldrh r2, [r1, 0x24] + ldrh r0, [r1, 0x20] + adds r2, r0 + ldrh r0, [r5, 0xA] + subs r0, r2 + lsls r0, 16 + lsrs r3, r0, 16 + ldrh r2, [r1, 0x26] + ldrh r1, [r1, 0x22] + adds r2, r1 + ldrh r0, [r5, 0xC] + subs r0, r2 + lsls r0, 16 + lsrs r2, r0, 16 + movs r1, 0x12 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _080A4870 + ldr r1, =0x02022e18 + lsls r0, r3, 16 + asrs r0, 16 + ldrh r3, [r5, 0xE] + adds r0, r3 + strh r0, [r1] + ldr r1, =0x02022e1a + lsls r0, r2, 16 + asrs r0, 16 + ldrh r5, [r5, 0x10] + adds r0, r5 + strh r0, [r1] + lsls r0, r6, 5 + ldr r2, =0x02037d14 + adds r0, r2 + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 5 + ldr r3, =0xfffffe00 + adds r2, r3 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet + b _080A4896 + .pool +_080A4870: + ldr r1, =0x02022e1c + lsls r0, r3, 16 + asrs r0, 16 + ldrh r3, [r5, 0xE] + adds r0, r3 + strh r0, [r1] + ldr r1, =0x02022e1e + lsls r0, r2, 16 + asrs r0, 16 + ldrh r5, [r5, 0x10] + adds r0, r5 + strh r0, [r1] + lsls r0, r6, 5 + ldr r1, =0x02037d14 + adds r0, r1 + subs r1, 0xE0 + ldr r2, =0x04000008 + bl CpuSet +_080A4896: + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end task_pA_ma0A_obj_to_bg_pal + + thumb_func_start ma0B_0807324C +ma0B_0807324C: @ 80A48B0 + push {r4,r5,lr} + ldr r0, =0x020383f0 + ldr r2, [r0] + adds r1, r2, 0x1 + str r1, [r0] + ldrb r4, [r2, 0x1] + cmp r4, 0 + bne _080A48C8 + movs r4, 0x2 + b _080A48D2 + .pool +_080A48C8: + cmp r4, 0x1 + bne _080A48CE + movs r4, 0x3 +_080A48CE: + cmp r4, 0 + beq _080A48D6 +_080A48D2: + cmp r4, 0x2 + bne _080A48E0 +_080A48D6: + ldr r0, =0x02038436 + b _080A48E2 + .pool +_080A48E0: + ldr r0, =0x02038437 +_080A48E2: + ldrb r5, [r0] + ldr r3, =0x02038430 + ldrb r0, [r3] + cmp r0, 0xFF + beq _080A4908 + ldr r2, =0x02020630 + ldr r0, =0x020241e4 + adds r0, r5, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] +_080A4908: + cmp r4, 0x1 + bls _080A4948 + ldrb r0, [r3, 0x1] + cmp r0, 0xFF + beq _080A4948 + ldr r3, =0x02020630 + ldr r2, =0x020241e4 + movs r1, 0x2 + adds r0, r5, 0 + eors r0, r1 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + b _080A494A + .pool +_080A4948: + movs r4, 0 +_080A494A: + ldr r0, =sub_80A4980 + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + strh r5, [r1, 0xC] + ldr r1, =0x020383f0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ma0B_0807324C + + thumb_func_start sub_80A4980 +sub_80A4980: @ 80A4980 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r1, r0, r1 + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + beq _080A4A0A + ldrb r0, [r1, 0xC] + bl battle_get_per_side_status + lsls r0, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bls _080A49BC + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A49C4 +_080A49BC: + movs r4, 0 + b _080A49C6 + .pool +_080A49C4: + movs r4, 0x1 +_080A49C6: + ldr r6, =0x02038430 + ldrb r0, [r6] + cmp r0, 0xFF + beq _080A49DE + adds r0, r4, 0 + bl sub_80A477C + ldrb r0, [r6] + bl remove_task + movs r0, 0xFF + strb r0, [r6] +_080A49DE: + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + ble _080A4A04 + movs r0, 0x1 + eors r4, r0 + adds r0, r4, 0 + bl sub_80A477C + ldrb r0, [r6, 0x1] + bl remove_task + movs r0, 0xFF + strb r0, [r6, 0x1] +_080A4A04: + adds r0, r5, 0 + bl remove_task +_080A4A0A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A4980 + + thumb_func_start sub_80A4A18 +sub_80A4A18: @ 80A4A18 + push {r4,r5,lr} + ldr r0, =0x020383f0 + ldr r2, [r0] + adds r1, r2, 0x1 + str r1, [r0] + ldrb r5, [r2, 0x1] + cmp r5, 0 + bne _080A4A30 + movs r5, 0x2 + b _080A4A3A + .pool +_080A4A30: + cmp r5, 0x1 + bne _080A4A36 + movs r5, 0x3 +_080A4A36: + cmp r5, 0 + beq _080A4A3E +_080A4A3A: + cmp r5, 0x2 + bne _080A4A48 +_080A4A3E: + ldr r0, =0x02038436 + b _080A4A4A + .pool +_080A4A48: + ldr r0, =0x02038437 +_080A4A4A: + ldrb r4, [r0] + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A4A8A + adds r0, r4, 0 + bl battle_get_per_side_status + lsls r0, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bls _080A4A76 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A4A80 +_080A4A76: + movs r1, 0 + b _080A4A82 + .pool +_080A4A80: + movs r1, 0x1 +_080A4A82: + adds r0, r4, 0 + movs r2, 0 + bl sub_80A438C +_080A4A8A: + movs r0, 0x2 + eors r4, r0 + cmp r5, 0x1 + bls _080A4ACA + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A4ACA + adds r0, r4, 0 + bl battle_get_per_side_status + lsls r0, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bls _080A4ABC + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A4AC0 +_080A4ABC: + movs r1, 0 + b _080A4AC2 +_080A4AC0: + movs r1, 0x1 +_080A4AC2: + adds r0, r4, 0 + movs r2, 0 + bl sub_80A438C +_080A4ACA: + ldr r1, =0x020383f0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A4A18 + + thumb_func_start ma23_8073484 +ma23_8073484: @ 80A4ADC + push {r4-r6,lr} + ldr r0, =0x020383f0 + ldr r2, [r0] + adds r1, r2, 0x1 + str r1, [r0] + ldrb r5, [r2, 0x1] + cmp r5, 0 + bne _080A4AF4 + movs r5, 0x2 + b _080A4AFE + .pool +_080A4AF4: + cmp r5, 0x1 + bne _080A4AFA + movs r5, 0x3 +_080A4AFA: + cmp r5, 0 + beq _080A4B02 +_080A4AFE: + cmp r5, 0x2 + bne _080A4B0C +_080A4B02: + ldr r0, =0x02038436 + b _080A4B0E + .pool +_080A4B0C: + ldr r0, =0x02038437 +_080A4B0E: + ldrb r6, [r0] + adds r0, r6, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A4B38 + ldr r2, =0x02020630 + ldr r0, =0x020241e4 + adds r0, r6, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] +_080A4B38: + cmp r5, 0x1 + bls _080A4B78 + movs r0, 0x2 + adds r4, r6, 0 + eors r4, r0 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A4B78 + ldr r2, =0x02020630 + ldr r0, =0x020241e4 + adds r0, r4, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + b _080A4B7A + .pool +_080A4B78: + movs r5, 0 +_080A4B7A: + ldr r0, =sub_80A4BB0 + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r5, [r1, 0x8] + strh r6, [r1, 0xC] + ldr r1, =0x020383f0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end ma23_8073484 + + thumb_func_start sub_80A4BB0 +sub_80A4BB0: @ 80A4BB0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r1, r0, r1 + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + beq _080A4C3E + ldrb r4, [r1, 0xC] + adds r0, r4, 0 + bl battle_get_per_side_status + lsls r0, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bls _080A4BEE + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A4BF8 +_080A4BEE: + movs r5, 0 + b _080A4BFA + .pool +_080A4BF8: + movs r5, 0x1 +_080A4BFA: + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A4C0C + adds r0, r5, 0 + bl sub_80A477C +_080A4C0C: + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + ble _080A4C38 + movs r0, 0x2 + eors r4, r0 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A4C38 + movs r0, 0x1 + eors r5, r0 + adds r0, r5, 0 + bl sub_80A477C +_080A4C38: + adds r0, r6, 0 + bl remove_task +_080A4C3E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A4BB0 + + thumb_func_start ma0C_set_BLDCNT_to_x3F40_and_BLDALPHA_to_argument +ma0C_set_BLDCNT_to_x3F40_and_BLDALPHA_to_argument: @ 80A4C48 + push {r4,r5,lr} + ldr r2, =0x020383f0 + ldr r0, [r2] + adds r1, r0, 0x1 + str r1, [r2] + ldrb r5, [r0, 0x1] + adds r0, r1, 0x1 + str r0, [r2] + ldrb r4, [r1, 0x1] + lsls r4, 8 + adds r0, 0x1 + str r0, [r2] + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + orrs r5, r4 + movs r0, 0x52 + adds r1, r5, 0 + bl SetGpuReg + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ma0C_set_BLDCNT_to_x3F40_and_BLDALPHA_to_argument + + thumb_func_start ma1E_set_BLDCNT +ma1E_set_BLDCNT: @ 80A4C80 + push {lr} + ldr r3, =0x020383f0 + ldr r0, [r3] + adds r2, r0, 0x1 + str r2, [r3] + ldrb r1, [r0, 0x1] + adds r0, r2, 0x1 + str r0, [r3] + ldrb r2, [r2, 0x1] + lsls r2, 8 + adds r0, 0x1 + str r0, [r3] + orrs r1, r2 + movs r0, 0x50 + bl SetGpuReg + pop {r0} + bx r0 + .pool + thumb_func_end ma1E_set_BLDCNT + + thumb_func_start ma0D_reset_BLDCNT_and_BLDALPHA +ma0D_reset_BLDCNT_and_BLDALPHA: @ 80A4CA8 + push {lr} + ldr r1, =0x020383f0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + pop {r0} + bx r0 + .pool + thumb_func_end ma0D_reset_BLDCNT_and_BLDALPHA + + thumb_func_start ma0E_call +ma0E_call: @ 80A4CCC + push {r4,lr} + ldr r4, =0x020383f0 + ldr r1, [r4] + adds r3, r1, 0x1 + str r3, [r4] + ldr r2, =0x020383f4 + adds r0, r1, 0x5 + str r0, [r2] + ldrb r1, [r1, 0x1] + ldrb r0, [r3, 0x1] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r3, 0x2] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r3, 0x3] + lsls r0, 24 + adds r1, r0 + str r1, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ma0E_call + + thumb_func_start sub_80A4D00 +sub_80A4D00: @ 80A4D00 + ldr r0, =0x020383f0 + ldr r1, =0x020383f4 + ldr r1, [r1] + str r1, [r0] + bx lr + .pool + thumb_func_end sub_80A4D00 + + thumb_func_start ma10_080736AC +ma10_080736AC: @ 80A4D14 + push {r4,r5,lr} + ldr r5, =0x020383f0 + ldr r1, [r5] + adds r0, r1, 0x1 + str r0, [r5] + ldrb r2, [r1, 0x1] + adds r3, r0, 0x1 + str r3, [r5] + ldrb r4, [r0, 0x1] + ldrb r0, [r3, 0x1] + lsls r0, 8 + orrs r4, r0 + adds r1, 0x4 + str r1, [r5] + ldr r0, =0x0203841e + lsls r2, 1 + adds r2, r0 + strh r4, [r2] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ma10_080736AC + + thumb_func_start ma11_if_else +ma11_if_else: @ 80A4D48 + push {lr} + ldr r3, =0x020383f0 + ldr r2, [r3] + adds r0, r2, 0x1 + str r0, [r3] + ldr r0, =0x02038432 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080A4D62 + adds r0, r2, 0x5 + str r0, [r3] +_080A4D62: + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + adds r1, r0 + str r1, [r3] + pop {r0} + bx r0 + .pool + thumb_func_end ma11_if_else + + thumb_func_start ma12_cond_if +ma12_cond_if: @ 80A4D88 + push {r4,r5,lr} + ldr r5, =0x020383f0 + ldr r4, [r5] + adds r2, r4, 0x1 + str r2, [r5] + ldrb r1, [r4, 0x1] + adds r3, r2, 0x1 + str r3, [r5] + ldr r0, =0x02038432 + ldrb r0, [r0] + cmp r1, r0 + bne _080A4DC0 + ldrb r1, [r2, 0x1] + ldrb r0, [r3, 0x1] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r3, 0x2] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r3, 0x3] + lsls r0, 24 + adds r1, r0 + str r1, [r5] + b _080A4DC4 + .pool +_080A4DC0: + adds r0, r4, 0x6 + str r0, [r5] +_080A4DC4: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end ma12_cond_if + + thumb_func_start ma13_goto +ma13_goto: @ 80A4DCC + ldr r3, =0x020383f0 + ldr r0, [r3] + adds r2, r0, 0x1 + str r2, [r3] + ldrb r1, [r0, 0x1] + ldrb r0, [r2, 0x1] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + adds r1, r0 + str r1, [r3] + bx lr + .pool + thumb_func_end ma13_goto + + thumb_func_start sub_80A4DF0 +sub_80A4DF0: @ 80A4DF0 + push {lr} + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080A4E10 + movs r0, 0 + b _080A4E12 + .pool +_080A4E10: + movs r0, 0x1 +_080A4E12: + pop {r1} + bx r1 + thumb_func_end sub_80A4DF0 + + thumb_func_start ma14_load_background +ma14_load_background: @ 80A4E18 + push {r4,lr} + ldr r1, =0x020383f0 + ldr r2, [r1] + adds r0, r2, 0x1 + str r0, [r1] + ldrb r4, [r2, 0x1] + adds r0, 0x1 + str r0, [r1] + ldr r0, =task_p5_load_battle_screen_elements + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + ldr r1, =0x02038433 + movs r0, 0x1 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ma14_load_background + + thumb_func_start sub_80A4E5C +sub_80A4E5C: @ 80A4E5C + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r2, =0x020383f0 + ldr r1, [r2] + adds r0, r1, 0x1 + str r0, [r2] + ldrb r3, [r1, 0x1] + mov r8, r3 + ldrb r7, [r0, 0x1] + ldrb r6, [r0, 0x2] + adds r1, 0x4 + str r1, [r2] + ldr r0, =task_p5_load_battle_screen_elements + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A4EA8 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + strh r6, [r0, 0x8] + b _080A4EDA + .pool +_080A4EA8: + ldr r0, =0x02038437 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080A4ECC + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + strh r7, [r0, 0x8] + b _080A4EDA + .pool +_080A4ECC: + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + mov r1, r8 + strh r1, [r0, 0x8] +_080A4EDA: + ldr r1, =0x02038433 + movs r0, 0x1 + strb r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A4E5C + + thumb_func_start task_p5_load_battle_screen_elements +task_p5_load_battle_screen_elements: @ 80A4EF4 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r6, [r4, 0x1C] + movs r0, 0x1C + ldrsh r3, [r4, r0] + adds r7, r1, 0 + cmp r3, 0 + bne _080A4F2C + str r3, [sp] + movs r0, 0xE8 + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A27B0 + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + strh r0, [r4, 0x1C] + b _080A4FBC + .pool +_080A4F2C: + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080A4FBC + cmp r3, 0x1 + bne _080A4F50 + adds r0, r6, 0x1 + strh r0, [r4, 0x1C] + ldr r1, =0x02038433 + movs r0, 0x2 + strb r0, [r1] + b _080A4F94 + .pool +_080A4F50: + cmp r3, 0x2 + bne _080A4F94 + ldrh r0, [r4, 0x8] + lsls r2, r0, 16 + asrs r1, r2, 16 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080A4F68 + bl dp01t_11_3_message_for_player_only + b _080A4F6E +_080A4F68: + lsrs r0, r2, 16 + bl sub_80A4FC8 +_080A4F6E: + movs r0, 0x1 + str r0, [sp] + movs r0, 0xE8 + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A27B0 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x1C] + adds r1, 0x1 + strh r1, [r0, 0x1C] + b _080A4FBC + .pool +_080A4F94: + ldrb r1, [r2, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080A4FBC + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r7 + movs r1, 0x1C + ldrsh r0, [r0, r1] + cmp r0, 0x3 + bne _080A4FBC + adds r0, r5, 0 + bl remove_task + ldr r0, =0x02038433 + strb r4, [r0] +_080A4FBC: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end task_p5_load_battle_screen_elements + + thumb_func_start sub_80A4FC8 +sub_80A4FC8: @ 80A4FC8 + push {r4-r7,lr} + lsls r0, 16 + lsrs r7, r0, 16 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A5050 + ldr r6, =gUnknown_08525D54 + lsls r4, r7, 1 + adds r4, r7 + lsls r4, 2 + adds r0, r6, 0 + adds r0, 0x8 + adds r0, r4, r0 + ldr r0, [r0] + ldr r5, =0x0201c000 + adds r1, r5, 0 + bl LZDecompressWram + bl sub_80A6D94 + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 1 + adds r1, r5, 0 + movs r3, 0 + bl sub_80A4720 + ldr r1, =0x0600d000 + ldr r0, =0x040000d4 + str r5, [r0] + str r1, [r0, 0x4] + ldr r1, =0x84000200 + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] + adds r0, r4, r6 + ldr r0, [r0] + ldr r1, =0x06002000 + bl LZDecompressVram + adds r6, 0x4 + adds r4, r6 + ldr r4, [r4] + bl sub_80A6D94 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 20 + adds r0, r4, 0 + movs r2, 0x20 + bl decompress_palette + b _080A507E + .pool +_080A5050: + ldr r5, =gUnknown_08525D54 + lsls r4, r7, 1 + adds r4, r7 + lsls r4, 2 + adds r0, r5, 0 + adds r0, 0x8 + adds r0, r4, r0 + ldr r0, [r0] + ldr r1, =0x0600d000 + bl LZDecompressVram + adds r0, r4, r5 + ldr r0, [r0] + ldr r1, =0x06008000 + bl LZDecompressVram + adds r5, 0x4 + adds r4, r5 + ldr r0, [r4] + movs r1, 0x20 + movs r2, 0x20 + bl decompress_palette +_080A507E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A4FC8 + + thumb_func_start dp01t_11_3_message_for_player_only +dp01t_11_3_message_for_player_only: @ 80A5090 + push {lr} + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A50A2 + bl sub_80D7724 + b _080A50A6 +_080A50A2: + bl load_battle_oval_graphics +_080A50A6: + pop {r0} + bx r0 + thumb_func_end dp01t_11_3_message_for_player_only + + thumb_func_start ma15_load_battle_screen_elements +ma15_load_battle_screen_elements: @ 80A50AC + push {lr} + ldr r1, =0x020383f0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r0, =task_p5_load_battle_screen_elements + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, =0x0000ffff + strh r0, [r1, 0x8] + ldr r1, =0x02038433 + movs r0, 0x1 + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end ma15_load_battle_screen_elements + + thumb_func_start ma16_wait_for_battle_screen_elements_s2 +ma16_wait_for_battle_screen_elements_s2: @ 80A50F0 + push {lr} + ldr r0, =0x02038433 + ldrb r0, [r0] + cmp r0, 0x2 + bne _080A5114 + ldr r1, =0x020383f0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r1, =0x020383fc + movs r0, 0 + b _080A5118 + .pool +_080A5114: + ldr r1, =0x020383fc + movs r0, 0x1 +_080A5118: + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end ma16_wait_for_battle_screen_elements_s2 + + thumb_func_start sub_80A5124 +sub_80A5124: @ 80A5124 + push {lr} + ldr r0, =0x02038433 + ldrb r2, [r0] + cmp r2, 0 + bne _080A5148 + ldr r0, =0x020383f0 + ldr r1, [r0] + adds r1, 0x1 + str r1, [r0] + ldr r0, =0x020383fc + strb r2, [r0] + b _080A514E + .pool +_080A5148: + ldr r1, =0x020383fc + movs r0, 0x1 + strb r0, [r1] +_080A514E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A5124 + + thumb_func_start ma18_load_background_probably +ma18_load_background_probably: @ 80A5158 + push {r4,lr} + ldr r4, =0x020383f0 + ldr r1, [r4] + adds r0, r1, 0x1 + str r0, [r4] + ldrb r0, [r1, 0x1] + bl sub_80A4FC8 + ldr r0, [r4] + adds r0, 0x1 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ma18_load_background_probably + + thumb_func_start sub_80A5178 +sub_80A5178: @ 80A5178 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A51C0 + ldr r0, =0x020244d0 + ldr r1, [r0] + ldr r0, =0x02038436 + ldrb r2, [r0] + ldr r1, [r1, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080A51C0 + adds r0, r2, 0 + bl battle_side_get_owner + lsls r0, 24 + movs r4, 0xC0 + cmp r0, 0 + beq _080A5252 + movs r4, 0x3F + b _080A5252 + .pool +_080A51C0: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A51E8 + ldr r0, =0x02038436 + ldr r1, =0x02038437 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bne _080A524C + cmp r0, 0x2 + bne _080A524C + cmp r4, 0x3F + beq _080A525E + b _080A524C + .pool +_080A51E8: + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080A5226 + ldr r0, =0x02038437 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080A5252 + lsls r0, r4, 24 + asrs r1, r0, 24 + cmp r1, 0x3F + bne _080A5218 + movs r4, 0xC0 + b _080A5252 + .pool +_080A5218: + movs r0, 0x40 + negs r0, r0 + cmp r1, r0 + beq _080A5252 + negs r0, r1 + lsls r0, 24 + b _080A5250 +_080A5226: + ldr r0, =0x02038437 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080A524C + lsls r0, r4, 24 + asrs r0, 24 + movs r1, 0x40 + negs r1, r1 + cmp r0, r1 + bne _080A5252 + movs r4, 0x3F + b _080A5252 + .pool +_080A524C: + lsls r0, r4, 24 + negs r0, r0 +_080A5250: + lsrs r4, r0, 24 +_080A5252: + lsls r0, r4, 24 + asrs r0, 24 + cmp r0, 0x3F + ble _080A525E + movs r4, 0x3F + b _080A526C +_080A525E: + lsls r0, r4, 24 + asrs r0, 24 + movs r1, 0x40 + negs r1, r1 + cmp r0, r1 + bge _080A526C + movs r4, 0xC0 +_080A526C: + lsls r0, r4, 24 + asrs r0, 24 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80A5178 + + thumb_func_start sub_80A5278 +sub_80A5278: @ 80A5278 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A52C0 + ldr r0, =0x020244d0 + ldr r1, [r0] + ldr r0, =0x02038436 + ldrb r2, [r0] + ldr r1, [r1, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080A52C0 + adds r0, r2, 0 + bl battle_side_get_owner + lsls r0, 24 + movs r4, 0xC0 + cmp r0, 0 + beq _080A52DE + movs r4, 0x3F + b _080A52DE + .pool +_080A52C0: + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080A52D8 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A52DE +_080A52D8: + lsls r0, r4, 24 + negs r0, r0 + lsrs r4, r0, 24 +_080A52DE: + lsls r0, r4, 24 + asrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A5278 + + thumb_func_start sub_80A52EC +sub_80A52EC: @ 80A52EC + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + asrs r2, r0, 16 + cmp r2, 0x3F + ble _080A52FC + movs r1, 0x3F + b _080A5306 +_080A52FC: + movs r0, 0x40 + negs r0, r0 + cmp r2, r0 + bge _080A5306 + ldr r1, =0x0000ffc0 +_080A5306: + lsls r0, r1, 16 + asrs r0, 16 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A52EC + + thumb_func_start sub_80A5314 +sub_80A5314: @ 80A5314 + push {lr} + lsls r2, 16 + lsrs r2, 16 + adds r3, r2, 0 + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + cmp r0, r1 + bge _080A5332 + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0 + bge _080A5342 + b _080A5340 +_080A5332: + cmp r0, r1 + ble _080A5348 + lsls r0, r3, 16 + asrs r0, 16 + cmp r0, 0 + bge _080A5340 + negs r0, r0 +_080A5340: + negs r0, r0 +_080A5342: + lsls r0, 16 + lsrs r0, 16 + b _080A534A +_080A5348: + movs r0, 0 +_080A534A: + lsls r0, 16 + asrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_80A5314 + + thumb_func_start ma19_08073BC8 +ma19_08073BC8: @ 80A5354 + push {r4,r5,lr} + ldr r5, =0x020383f0 + ldr r0, [r5] + adds r1, r0, 0x1 + str r1, [r5] + ldrb r4, [r0, 0x1] + ldrb r0, [r1, 0x1] + lsls r0, 8 + orrs r4, r0 + movs r0, 0x2 + ldrsb r0, [r1, r0] + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + adds r0, r4, 0 + bl audio_play_and_stuff + ldr r0, [r5] + adds r0, 0x3 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ma19_08073BC8 + + thumb_func_start ma1A_8073C00 +ma1A_8073C00: @ 80A538C + push {r4,lr} + ldr r4, =0x020383f0 + ldr r1, [r4] + adds r0, r1, 0x1 + str r0, [r4] + movs r0, 0x1 + ldrsb r0, [r1, r0] + bl sub_80A5178 + lsls r0, 24 + asrs r0, 24 + bl sub_80A3870 + ldr r0, [r4] + adds r0, 0x1 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ma1A_8073C00 + + thumb_func_start ma1B_8073C2C +ma1B_8073C2C: @ 80A53B8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =0x020383f0 + mov r10, r0 + ldr r0, [r0] + adds r1, r0, 0x1 + mov r2, r10 + str r1, [r2] + ldrb r0, [r0, 0x1] + mov r9, r0 + ldrb r0, [r1, 0x1] + lsls r0, 8 + mov r2, r9 + orrs r2, r0 + mov r9, r2 + ldrb r4, [r1, 0x3] + ldrb r6, [r1, 0x4] + ldrb r7, [r1, 0x5] + movs r0, 0x2 + ldrsb r0, [r1, r0] + bl sub_80A5178 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, 24 + asrs r4, 24 + adds r0, r4, 0 + bl sub_80A5178 + mov r8, r0 + lsls r5, 24 + asrs r5, 24 + mov r0, r8 + lsls r0, 24 + asrs r0, 24 + mov r8, r0 + lsls r6, 24 + asrs r6, 24 + adds r0, r5, 0 + mov r1, r8 + adds r2, r6, 0 + bl sub_80A5314 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =c3_08073CEC + movs r1, 0x1 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r5, [r1, 0x8] + mov r2, r8 + strh r2, [r1, 0xA] + lsls r4, 24 + asrs r4, 24 + strh r4, [r1, 0xC] + strh r7, [r1, 0xE] + strh r5, [r1, 0x10] + mov r0, r9 + adds r1, r5, 0 + bl audio_play_and_stuff + ldr r1, =0x020383ff + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + mov r1, r10 + ldr r0, [r1] + adds r0, 0x6 + str r0, [r1] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end ma1B_8073C2C + + thumb_func_start c3_08073CEC +c3_08073CEC: @ 80A5478 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r7, 0 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r2, r0, r1 + ldrh r0, [r2, 0x18] + adds r1, r0, 0x1 + strh r1, [r2, 0x18] + lsls r0, 16 + asrs r0, 16 + movs r3, 0xE + ldrsh r1, [r2, r3] + cmp r0, r1 + blt _080A54FC + strh r7, [r2, 0x18] + ldrh r6, [r2, 0x8] + ldrh r3, [r2, 0xA] + movs r4, 0x10 + ldrsh r0, [r2, r4] + movs r4, 0xC + ldrsh r1, [r2, r4] + adds r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + strh r4, [r2, 0x10] + cmp r1, 0 + bne _080A54C0 + lsls r2, r3, 16 + b _080A54E4 + .pool +_080A54C0: + lsls r1, r6, 16 + lsls r0, r3, 16 + asrs r3, r0, 16 + adds r2, r0, 0 + cmp r1, r2 + bge _080A54D6 + lsls r0, r4, 16 + asrs r0, 16 + cmp r0, r3 + blt _080A54E0 + b _080A54E4 +_080A54D6: + lsls r0, r4, 16 + asrs r0, 16 + cmp r0, r3 + bgt _080A54E0 + movs r7, 0x1 +_080A54E0: + cmp r7, 0 + beq _080A54F4 +_080A54E4: + lsrs r4, r2, 16 + adds r0, r5, 0 + bl remove_task + ldr r1, =0x020383ff + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] +_080A54F4: + lsls r0, r4, 24 + asrs r0, 24 + bl sub_80A3870 +_080A54FC: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end c3_08073CEC + + thumb_func_start sub_80A5508 +sub_80A5508: @ 80A5508 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + ldr r0, =0x020383f0 + mov r9, r0 + ldr r0, [r0] + adds r1, r0, 0x1 + mov r2, r9 + str r1, [r2] + ldrb r0, [r0, 0x1] + mov r8, r0 + ldrb r0, [r1, 0x1] + lsls r0, 8 + mov r2, r8 + orrs r2, r0 + mov r8, r2 + ldrb r4, [r1, 0x2] + ldrb r5, [r1, 0x3] + ldrb r6, [r1, 0x4] + ldrb r1, [r1, 0x5] + mov r10, r1 + ldr r0, =c3_08073CEC + movs r1, 0x1 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + lsls r4, 24 + asrs r4, 24 + strh r4, [r1, 0x8] + lsls r5, 24 + asrs r5, 24 + strh r5, [r1, 0xA] + lsls r6, 24 + asrs r6, 24 + strh r6, [r1, 0xC] + mov r0, r10 + strh r0, [r1, 0xE] + strh r4, [r1, 0x10] + mov r0, r8 + adds r1, r4, 0 + bl audio_play_and_stuff + ldr r1, =0x020383ff + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + mov r1, r9 + ldr r0, [r1] + adds r0, 0x6 + str r0, [r1] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A5508 + + thumb_func_start sub_80A559C +sub_80A559C: @ 80A559C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =0x020383f0 + mov r10, r0 + ldr r0, [r0] + adds r1, r0, 0x1 + mov r2, r10 + str r1, [r2] + ldrb r0, [r0, 0x1] + mov r9, r0 + ldrb r0, [r1, 0x1] + lsls r0, 8 + mov r2, r9 + orrs r2, r0 + mov r9, r2 + ldrb r4, [r1, 0x3] + ldrb r0, [r1, 0x4] + mov r8, r0 + ldrb r7, [r1, 0x5] + movs r0, 0x2 + ldrsb r0, [r1, r0] + bl sub_80A5278 + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r4, 24 + asrs r4, 24 + adds r0, r4, 0 + bl sub_80A5278 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + mov r1, r8 + lsls r1, 24 + asrs r1, 24 + mov r8, r1 + mov r0, r8 + bl sub_80A5278 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =c3_08073CEC + movs r1, 0x1 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + lsls r6, 24 + asrs r6, 24 + strh r6, [r1, 0x8] + lsls r5, 24 + asrs r5, 24 + strh r5, [r1, 0xA] + lsls r4, 24 + asrs r4, 24 + strh r4, [r1, 0xC] + strh r7, [r1, 0xE] + strh r6, [r1, 0x10] + mov r0, r9 + adds r1, r6, 0 + bl audio_play_and_stuff + ldr r1, =0x020383ff + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + mov r2, r10 + ldr r0, [r2] + adds r0, 0x6 + str r0, [r2] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A559C + + thumb_func_start ma1C_8073ED0 +ma1C_8073ED0: @ 80A565C + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + ldr r6, =0x020383f0 + ldr r0, [r6] + adds r1, r0, 0x1 + str r1, [r6] + ldrb r5, [r0, 0x1] + ldrb r0, [r1, 0x1] + lsls r0, 8 + orrs r5, r0 + ldrb r0, [r1, 0x3] + mov r8, r0 + ldrb r2, [r1, 0x4] + mov r9, r2 + movs r0, 0x2 + ldrsb r0, [r1, r0] + bl sub_80A5178 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =sub_80A56E4 + movs r1, 0x1 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r5, [r1, 0x8] + lsls r4, 24 + asrs r4, 24 + strh r4, [r1, 0xA] + mov r2, r8 + strh r2, [r1, 0xC] + mov r2, r9 + strh r2, [r1, 0xE] + mov r2, r8 + strh r2, [r1, 0x18] + ldr r1, [r1] + bl _call_via_r1 + ldr r1, =0x020383ff + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r6] + adds r0, 0x5 + str r0, [r6] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end ma1C_8073ED0 + + thumb_func_start sub_80A56E4 +sub_80A56E4: @ 80A56E4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r2, r0, r1 + ldrh r0, [r2, 0x18] + adds r1, r0, 0x1 + strh r1, [r2, 0x18] + lsls r0, 16 + asrs r0, 16 + movs r3, 0xC + ldrsh r1, [r2, r3] + cmp r0, r1 + blt _080A5732 + movs r0, 0 + strh r0, [r2, 0x18] + ldrh r0, [r2, 0x8] + ldrb r1, [r2, 0xA] + ldrh r4, [r2, 0xE] + subs r4, 0x1 + strh r4, [r2, 0xE] + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + asrs r1, 24 + bl audio_play_and_stuff + cmp r4, 0 + bne _080A5732 + adds r0, r5, 0 + bl remove_task + ldr r1, =0x020383ff + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] +_080A5732: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A56E4 + + thumb_func_start ma1D_08073FB4 +ma1D_08073FB4: @ 80A5740 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r6, =0x020383f0 + ldr r0, [r6] + adds r1, r0, 0x1 + str r1, [r6] + ldrb r5, [r0, 0x1] + ldrb r0, [r1, 0x1] + lsls r0, 8 + orrs r5, r0 + ldrb r0, [r1, 0x3] + mov r8, r0 + movs r0, 0x2 + ldrsb r0, [r1, r0] + bl sub_80A5178 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =sub_80A57B4 + movs r1, 0x1 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r5, [r1, 0x8] + lsls r4, 24 + asrs r4, 24 + strh r4, [r1, 0xA] + mov r0, r8 + strh r0, [r1, 0xC] + ldr r1, =0x020383ff + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r6] + adds r0, 0x4 + str r0, [r6] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end ma1D_08073FB4 + + thumb_func_start sub_80A57B4 +sub_80A57B4: @ 80A57B4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r1 + ldrh r0, [r2, 0xC] + subs r1, r0, 0x1 + strh r1, [r2, 0xC] + lsls r0, 16 + cmp r0, 0 + bgt _080A57E8 + ldrh r0, [r2, 0x8] + movs r1, 0xA + ldrsb r1, [r2, r1] + bl audio_play_and_stuff + adds r0, r4, 0 + bl remove_task + ldr r1, =0x020383ff + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] +_080A57E8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A57B4 + + thumb_func_start sub_80A57F8 +sub_80A57F8: @ 80A57F8 + push {r4-r6,lr} + ldr r4, =0x020383f0 + ldr r1, [r4] + adds r3, r1, 0x1 + str r3, [r4] + ldrb r2, [r1, 0x1] + ldrb r0, [r3, 0x1] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r3, 0x2] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r3, 0x3] + lsls r0, 24 + adds r6, r2, r0 + adds r0, r1, 0x5 + str r0, [r4] + ldrb r0, [r1, 0x5] + adds r1, 0x6 + str r1, [r4] + cmp r0, 0 + beq _080A5842 + adds r5, r4, 0 + ldr r4, =0x0203841e + adds r3, r0, 0 +_080A582A: + ldr r2, [r5] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + strh r1, [r4] + adds r2, 0x2 + str r2, [r5] + adds r4, 0x2 + subs r3, 0x1 + cmp r3, 0 + bne _080A582A +_080A5842: + adds r0, r6, 0 + movs r1, 0x1 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r6 + ldr r1, =0x020383ff + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A57F8 + + thumb_func_start ma20_wait_for_something +ma20_wait_for_something: @ 80A586C + push {r4,r5,lr} + ldr r0, =0x020383ff + ldrb r5, [r0] + cmp r5, 0 + bne _080A58B4 + bl mplay_has_finished_maybe + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _080A58CC + ldr r4, =0x0203842e + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x5A + bls _080A58BA + ldr r0, =0x030075f0 + bl MPlayStop_rev01 + ldr r0, =0x03007630 + bl MPlayStop_rev01 + strh r5, [r4] + b _080A58DE + .pool +_080A58B4: + ldr r1, =0x0203842e + movs r0, 0 + strh r0, [r1] +_080A58BA: + ldr r1, =0x020383fc + movs r0, 0x1 + strb r0, [r1] + b _080A58DE + .pool +_080A58CC: + ldr r0, =0x0203842e + movs r2, 0 + strh r1, [r0] + ldr r1, =0x020383f0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r0, =0x020383fc + strb r2, [r0] +_080A58DE: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ma20_wait_for_something + + thumb_func_start ma21_08074164 +ma21_08074164: @ 80A58F0 + push {r4-r6,lr} + ldr r5, =0x020383f0 + ldr r4, [r5] + adds r3, r4, 0x1 + str r3, [r5] + ldrb r2, [r4, 0x1] + ldrb r1, [r3, 0x1] + ldrb r0, [r3, 0x2] + lsls r0, 8 + orrs r1, r0 + ldr r0, =0x0203841e + lsls r2, 1 + adds r2, r0 + lsls r1, 16 + asrs r1, 16 + movs r6, 0 + ldrsh r0, [r2, r6] + cmp r1, r0 + bne _080A5938 + ldrb r1, [r3, 0x3] + ldrb r0, [r3, 0x4] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r3, 0x6] + lsls r0, 24 + adds r1, r0 + str r1, [r5] + b _080A593E + .pool +_080A5938: + adds r0, r4, 0 + adds r0, 0x8 + str r0, [r5] +_080A593E: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end ma21_08074164 + + thumb_func_start sub_80A5944 +sub_80A5944: @ 80A5944 + push {r4,lr} + ldr r4, =0x020383f0 + ldr r0, [r4] + adds r0, 0x1 + str r0, [r4] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A5978 + ldr r2, [r4] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + adds r1, r0 + str r1, [r4] + b _080A597E + .pool +_080A5978: + ldr r0, [r4] + adds r0, 0x4 + str r0, [r4] +_080A597E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A5944 + + thumb_func_start sub_80A5984 +sub_80A5984: @ 80A5984 + push {r4,lr} + ldr r0, =0x020383f0 + ldr r1, [r0] + ldrb r2, [r1, 0x1] + adds r1, 0x2 + str r1, [r0] + cmp r2, 0 + beq _080A59A0 + ldr r0, =0x02038437 + b _080A59A2 + .pool +_080A59A0: + ldr r0, =0x02038436 +_080A59A2: + ldrb r0, [r0] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A59D2 + cmp r4, 0 + beq _080A59BE + cmp r4, 0x3 + bne _080A59D2 +_080A59BE: + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + movs r0, 0x2 + movs r1, 0x4 + movs r2, 0x2 + bl lcd_bg_operations +_080A59D2: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A5984 + + thumb_func_start sub_80A59DC +sub_80A59DC: @ 80A59DC + push {lr} + ldr r0, =0x020383f0 + ldr r1, [r0] + adds r1, 0x1 + str r1, [r0] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A5A04 + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + movs r0, 0x2 + movs r1, 0x4 + movs r2, 0x2 + bl lcd_bg_operations +_080A5A04: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A59DC + + thumb_func_start sub_80A5A0C +sub_80A5A0C: @ 80A5A0C + push {r4-r7,lr} + ldr r1, =0x020383f0 + ldr r0, [r1] + ldrb r6, [r0, 0x1] + adds r0, 0x2 + str r0, [r1] + ldr r7, =0x02038436 + ldrb r0, [r7] + bl battle_side_get_owner + adds r4, r0, 0 + ldr r5, =0x02038437 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _080A5A78 + cmp r6, 0 + beq _080A5A48 + ldrb r0, [r5] + b _080A5A4A + .pool +_080A5A48: + ldrb r0, [r7] +_080A5A4A: + bl battle_get_per_side_status + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A5A78 + cmp r4, 0 + beq _080A5A64 + cmp r4, 0x3 + bne _080A5A78 +_080A5A64: + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + movs r0, 0x2 + movs r1, 0x4 + movs r2, 0x2 + bl lcd_bg_operations +_080A5A78: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80A5A0C + + thumb_func_start ma2B_make_side_invisible +ma2B_make_side_invisible: @ 80A5A80 + push {r4,lr} + ldr r4, =0x020383f0 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _080A5AA8 + ldr r1, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080A5AA8: + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ma2B_make_side_invisible + + thumb_func_start ma2C_make_side_visible +ma2C_make_side_visible: @ 80A5ABC + push {r4,lr} + ldr r4, =0x020383f0 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _080A5AE6 + ldr r1, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] +_080A5AE6: + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ma2C_make_side_visible + + thumb_func_start sub_80A5AFC +sub_80A5AFC: @ 80A5AFC + push {r4-r7,lr} + ldr r1, =0x020383f0 + ldr r0, [r1] + ldrb r7, [r0, 0x1] + adds r0, 0x2 + str r0, [r1] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A5BA6 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _080A5BA6 + ldr r6, =0x02038436 + ldrb r0, [r6] + bl battle_side_get_owner + adds r4, r0, 0 + ldr r5, =0x02038437 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _080A5BA6 + cmp r7, 0 + bne _080A5B54 + ldrb r0, [r6] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0 + b _080A5B60 + .pool +_080A5B54: + ldrb r0, [r5] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x1 +_080A5B60: + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _080A5BA6 + ldr r1, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r2, r0, r1 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] + cmp r4, 0x2 + bne _080A5B90 + ldrb r0, [r2, 0x5] + movs r1, 0xC + orrs r0, r1 + strb r0, [r2, 0x5] +_080A5B90: + cmp r4, 0x1 + bne _080A5BA0 + movs r0, 0 + bl sub_80A477C + b _080A5BA6 + .pool +_080A5BA0: + movs r0, 0x1 + bl sub_80A477C +_080A5BA6: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80A5AFC + + thumb_func_start sub_80A5BAC +sub_80A5BAC: @ 80A5BAC + push {r4-r7,lr} + ldr r1, =0x020383f0 + ldr r0, [r1] + ldrb r7, [r0, 0x1] + adds r0, 0x2 + str r0, [r1] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A5C38 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _080A5C38 + ldr r6, =0x02038436 + ldrb r0, [r6] + bl battle_side_get_owner + adds r4, r0, 0 + ldr r5, =0x02038437 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _080A5C38 + cmp r7, 0 + bne _080A5C04 + ldrb r0, [r6] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0 + b _080A5C10 + .pool +_080A5C04: + ldrb r0, [r5] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x1 +_080A5C10: + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _080A5C38 + cmp r4, 0x2 + bne _080A5C38 + ldr r1, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0, 0x5] +_080A5C38: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A5BAC + + thumb_func_start ma2F_stop_music +ma2F_stop_music: @ 80A5C44 + push {lr} + ldr r0, =0x030075f0 + bl MPlayStop_rev01 + ldr r0, =0x03007630 + bl MPlayStop_rev01 + ldr r1, =0x020383f0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end ma2F_stop_music + + thumb_func_start sub_80A5C6C +sub_80A5C6C: @ 80A5C6C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A5C8A + cmp r4, 0x3 + bne _080A5C8A + cmp r5, 0x3 + bne _080A5C8A + movs r4, 0x1 +_080A5C8A: + cmp r4, 0x4 + bhi _080A5D00 + lsls r0, r4, 2 + ldr r1, =_080A5C9C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080A5C9C: + .4byte _080A5CB0 + .4byte _080A5CD8 + .4byte _080A5CB0 + .4byte _080A5D00 + .4byte _080A5D00 +_080A5CB0: + ldr r4, =gUnknown_08525F58 + adds r0, r5, 0 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 22 + ldr r1, =0x02022fec + ldr r1, [r1] + movs r2, 0x1 + ands r1, r2 + lsls r1, 4 + adds r0, r1 + adds r0, r4 + ldrb r0, [r0] + b _080A5DB0 + .pool +_080A5CD8: + ldr r4, =gUnknown_08525F58 + adds r0, r5, 0 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 22 + ldr r1, =0x02022fec + ldr r1, [r1] + movs r2, 0x1 + ands r1, r2 + lsls r1, 4 + adds r0, r1 + adds r0, r4 + ldrb r0, [r0, 0x1] + b _080A5DB0 + .pool +_080A5D00: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A5D28 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0, 0x18] + ldrb r1, [r2, 0x4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080A5D24 + ldrh r1, [r2, 0x2] + b _080A5D9A + .pool +_080A5D24: + ldrh r1, [r2] + b _080A5D9A +_080A5D28: + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080A5D60 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r5, 2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2] + cmp r0, 0 + bne _080A5D98 + ldr r1, =0x0202406e + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + b _080A5D7E + .pool +_080A5D60: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r5, 2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2] + cmp r0, 0 + bne _080A5D98 + ldr r1, =0x0202406e + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec +_080A5D7E: + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r1, r0, 16 + b _080A5D9A + .pool +_080A5D98: + ldrh r1, [r1, 0x2] +_080A5D9A: + cmp r4, 0x3 + bne _080A5DA4 + adds r0, r5, 0 + movs r2, 0x1 + b _080A5DA8 +_080A5DA4: + adds r0, r5, 0 + movs r2, 0 +_080A5DA8: + bl sub_80A600C + lsls r0, 24 + lsrs r0, 24 +_080A5DB0: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80A5C6C + + thumb_func_start sub_80A5DB8 +sub_80A5DB8: @ 80A5DB8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 16 + lsrs r5, r1, 16 + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080A5DDA + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A5DDA + b _080A5EC8 +_080A5DDA: + cmp r5, 0xC9 + bne _080A5E90 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A5E04 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0, 0x18] + ldrb r1, [r2, 0x4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080A5E00 + ldr r2, [r2, 0x10] + b _080A5E42 + .pool +_080A5E00: + ldr r2, [r2, 0x8] + b _080A5E42 +_080A5E04: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0] + lsls r1, r4, 2 + adds r0, r1, r0 + ldrh r0, [r0, 0x2] + cmp r0, 0 + bne _080A5E3C + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0 + bl pokemon_getattr + adds r2, r0, 0 + b _080A5E42 + .pool +_080A5E3C: + ldr r0, =0x020244bc + adds r0, r1, r0 + ldr r2, [r0] +_080A5E42: + movs r0, 0xC0 + lsls r0, 18 + ands r0, r2 + lsrs r0, 18 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r2 + lsrs r1, 12 + orrs r0, r1 + movs r1, 0xC0 + lsls r1, 2 + ands r1, r2 + lsrs r1, 6 + orrs r0, r1 + movs r1, 0x3 + ands r1, r2 + orrs r0, r1 + movs r1, 0x1C + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _080A5E7C + adds r0, r5, 0 + b _080A5E86 + .pool +_080A5E7C: + movs r1, 0xCE + lsls r1, 1 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 +_080A5E86: + ldr r1, =gUnknown_083021D8 + lsls r0, 2 + b _080A5F90 + .pool +_080A5E90: + ldr r0, =0x00000181 + cmp r5, r0 + bne _080A5EB0 + ldr r0, =gUnknown_08525F8C + ldr r1, =0x020244e4 + adds r1, r4, r1 + ldrb r1, [r1] + adds r1, r0 + ldrb r0, [r1] + b _080A5F94 + .pool +_080A5EB0: + movs r0, 0xCE + lsls r0, 1 + cmp r5, r0 + bls _080A5EC0 + ldr r0, =gUnknown_083021D8 + b _080A5F92 + .pool +_080A5EC0: + ldr r1, =gUnknown_083021D8 + b _080A5F8E + .pool +_080A5EC8: + cmp r5, 0xC9 + bne _080A5F58 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0] + lsls r1, r4, 2 + adds r0, r1, r0 + ldrh r0, [r0, 0x2] + cmp r0, 0 + bne _080A5F04 + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0 + bl pokemon_getattr + adds r2, r0, 0 + b _080A5F0A + .pool +_080A5F04: + ldr r0, =0x020244bc + adds r0, r1, r0 + ldr r2, [r0] +_080A5F0A: + movs r0, 0xC0 + lsls r0, 18 + ands r0, r2 + lsrs r0, 18 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r2 + lsrs r1, 12 + orrs r0, r1 + movs r1, 0xC0 + lsls r1, 2 + ands r1, r2 + lsrs r1, 6 + orrs r0, r1 + movs r1, 0x3 + ands r1, r2 + orrs r0, r1 + movs r1, 0x1C + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _080A5F44 + adds r0, r5, 0 + b _080A5F4E + .pool +_080A5F44: + movs r1, 0xCE + lsls r1, 1 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 +_080A5F4E: + ldr r1, =gUnknown_08300D38 + lsls r0, 2 + b _080A5F90 + .pool +_080A5F58: + ldr r0, =0x00000181 + cmp r5, r0 + bne _080A5F7C + ldr r0, =gUnknown_08525F78 + ldr r1, =0x020244e4 + adds r1, r4, r1 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + b _080A5F94 + .pool +_080A5F7C: + movs r0, 0xCE + lsls r0, 1 + cmp r5, r0 + bls _080A5F8C + ldr r0, =gUnknown_08300D38 + b _080A5F92 + .pool +_080A5F8C: + ldr r1, =gUnknown_08300D38 +_080A5F8E: + lsls r0, r5, 2 +_080A5F90: + adds r0, r1 +_080A5F92: + ldrb r0, [r0, 0x1] +_080A5F94: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A5DB8 + + thumb_func_start sub_80A5FA0 +sub_80A5FA0: @ 80A5FA0 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 16 + lsrs r4, r1, 16 + adds r7, r4, 0 + movs r5, 0 + adds r0, r6, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080A5FFE + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A5FFE + ldr r0, =0x00000181 + cmp r4, r0 + bne _080A5FE8 + ldr r0, =gUnknown_08525F88 + ldr r1, =0x020244e4 + adds r1, r6, r1 + ldrb r1, [r1] + adds r1, r0 + ldrb r5, [r1] + b _080A5FFE + .pool +_080A5FE8: + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + bls _080A5FF8 + ldr r0, =gUnknown_08305DCC + b _080A5FFC + .pool +_080A5FF8: + ldr r0, =gUnknown_08305DCC + adds r0, r7, r0 +_080A5FFC: + ldrb r5, [r0] +_080A5FFE: + adds r0, r5, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A5FA0 + + thumb_func_start sub_80A600C +sub_80A600C: @ 80A600C + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 16 + lsrs r5, r1, 16 + lsls r2, 24 + lsrs r7, r2, 24 + adds r0, r6, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080A6030 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A603E +_080A6030: + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80A5DB8 + lsls r0, 24 + lsrs r4, r0, 24 + b _080A605C +_080A603E: + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80A5DB8 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80A5FA0 + lsls r0, 24 + lsrs r0, 24 + subs r0, r4, r0 + lsls r0, 16 + lsrs r4, r0, 16 +_080A605C: + adds r0, r6, 0 + bl battle_get_per_side_status + ldr r3, =gUnknown_08525F58 + lsls r0, 24 + lsrs r0, 22 + ldr r1, =0x02022fec + ldr r1, [r1] + movs r2, 0x1 + ands r1, r2 + lsls r1, 4 + adds r0, r1 + adds r0, r3 + ldrb r0, [r0, 0x1] + adds r0, r4 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r7, 0 + beq _080A609C + adds r0, r6, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080A6096 + adds r0, r4, 0 + adds r0, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 +_080A6096: + cmp r4, 0x68 + bls _080A609C + movs r4, 0x68 +_080A609C: + adds r0, r4, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A600C + + thumb_func_start sub_80A60AC +sub_80A60AC: @ 80A60AC + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + movs r0, 0xFD + lsls r0, 24 + adds r1, r0 + lsrs r1, 24 + cmp r1, 0x1 + bhi _080A6126 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A60E8 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0, 0x18] + ldrb r1, [r2, 0x4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080A60E4 + ldrh r1, [r2, 0x2] + b _080A610E + .pool +_080A60E4: + ldrh r1, [r2] + b _080A610E +_080A60E8: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r4, 2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2] + cmp r0, 0 + bne _080A610C + ldr r1, =0x02038438 + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + b _080A610E + .pool +_080A610C: + ldrh r1, [r1, 0x2] +_080A610E: + cmp r5, 0x3 + bne _080A611C + adds r0, r4, 0 + movs r2, 0x1 + bl sub_80A600C + b _080A612E +_080A611C: + adds r0, r4, 0 + movs r2, 0 + bl sub_80A600C + b _080A612E +_080A6126: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80A5C6C +_080A612E: + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80A60AC + + thumb_func_start sub_80A6138 +sub_80A6138: @ 80A6138 + push {lr} + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x4 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_80A6138 + + thumb_func_start sub_80A614C +sub_80A614C: @ 80A614C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080A6170 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 8 + movs r1, 0x80 + lsls r1, 13 + b _080A6180 +_080A6170: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 8 + movs r1, 0x88 + lsls r1, 13 +_080A6180: + adds r0, r1 + lsrs r0, 16 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80A614C + + thumb_func_start sub_80A6190 +sub_80A6190: @ 80A6190 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r6, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A6238 + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080A61E4 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r5, 2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2] + cmp r0, 0 + bne _080A621C + ldr r1, =0x0202406e + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + b _080A6202 + .pool +_080A61E4: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r5, 2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2] + cmp r0, 0 + bne _080A621C + ldr r1, =0x0202406e + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec +_080A6202: + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + b _080A621E + .pool +_080A621C: + ldrh r4, [r1, 0x2] +_080A621E: + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080A6238 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80A5FA0 + subs r0, r6, r0 + lsls r0, 24 + lsrs r6, r0, 24 +_080A6238: + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80A6190 + + thumb_func_start obj_id_for_side_relative_to_move +obj_id_for_side_relative_to_move: @ 80A6240 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0 + bne _080A6268 + ldr r4, =0x02038436 + ldrb r0, [r4] + bl sub_80A6A90 + lsls r0, 24 + cmp r0, 0 + beq _080A62B6 + ldr r1, =0x020241e4 + ldrb r0, [r4] + b _080A62C6 + .pool +_080A6268: + cmp r0, 0x1 + bne _080A6288 + ldr r4, =0x02038437 + ldrb r0, [r4] + bl sub_80A6A90 + lsls r0, 24 + cmp r0, 0 + beq _080A62B6 + ldr r1, =0x020241e4 + ldrb r0, [r4] + b _080A62C6 + .pool +_080A6288: + cmp r1, 0x2 + bne _080A62A4 + ldr r5, =0x02038436 + ldrb r0, [r5] + movs r4, 0x2 + eors r0, r4 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A62B6 + b _080A62C0 + .pool +_080A62A4: + ldr r5, =0x02038437 + ldrb r0, [r5] + movs r4, 0x2 + eors r0, r4 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + bne _080A62C0 +_080A62B6: + movs r0, 0xFF + b _080A62CA + .pool +_080A62C0: + ldr r1, =0x020241e4 + ldrb r0, [r5] + eors r0, r4 +_080A62C6: + adds r0, r1 + ldrb r0, [r0] +_080A62CA: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end obj_id_for_side_relative_to_move + + thumb_func_start oamt_set_x3A_32 +oamt_set_x3A_32: @ 80A62D4 + strh r1, [r0, 0x3A] + lsrs r1, 16 + strh r1, [r0, 0x3C] + bx lr + thumb_func_end oamt_set_x3A_32 + + thumb_func_start sub_80A62DC +sub_80A62DC: @ 80A62DC + ldrh r2, [r0, 0x3A] + movs r3, 0x3C + ldrsh r1, [r0, r3] + lsls r1, 16 + orrs r2, r1 + str r2, [r0, 0x1C] + bx lr + thumb_func_end sub_80A62DC + + thumb_func_start sub_80A62EC +sub_80A62EC: @ 80A62EC + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080A6340 + movs r2, 0x2E + ldrsh r0, [r4, r2] + movs r2, 0x30 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x24] + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r2, 0x30 + ldrsh r1, [r4, r2] + bl cosine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + ldrh r2, [r4, 0x2E] + adds r1, r0, r2 + strh r1, [r4, 0x2E] + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _080A632C + ldr r2, =0xffffff00 + b _080A6334 + .pool +_080A632C: + cmp r0, 0 + bge _080A6338 + movs r2, 0x80 + lsls r2, 1 +_080A6334: + adds r0, r1, r2 + strh r0, [r4, 0x2E] +_080A6338: + ldrh r0, [r4, 0x34] + subs r0, 0x1 + strh r0, [r4, 0x34] + b _080A6346 +_080A6340: + adds r0, r4, 0 + bl sub_80A62DC +_080A6346: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A62EC + + thumb_func_start sub_80A634C +sub_80A634C: @ 80A634C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080A63BC + movs r2, 0x2E + ldrsh r0, [r4, r2] + ldrh r1, [r4, 0x38] + lsls r1, 16 + asrs r1, 24 + ldrh r2, [r4, 0x30] + adds r1, r2 + lsls r1, 16 + asrs r1, 16 + bl sine + strh r0, [r4, 0x24] + movs r1, 0x2E + ldrsh r0, [r4, r1] + ldrh r1, [r4, 0x38] + lsls r1, 16 + asrs r1, 24 + ldrh r2, [r4, 0x30] + adds r1, r2 + lsls r1, 16 + asrs r1, 16 + bl cosine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + ldrh r2, [r4, 0x2E] + adds r1, r0, r2 + strh r1, [r4, 0x2E] + ldrh r0, [r4, 0x36] + ldrh r2, [r4, 0x38] + adds r0, r2 + strh r0, [r4, 0x38] + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _080A63A8 + ldr r2, =0xffffff00 + b _080A63B0 + .pool +_080A63A8: + cmp r0, 0 + bge _080A63B4 + movs r2, 0x80 + lsls r2, 1 +_080A63B0: + adds r0, r1, r2 + strh r0, [r4, 0x2E] +_080A63B4: + ldrh r0, [r4, 0x34] + subs r0, 0x1 + strh r0, [r4, 0x34] + b _080A63C2 +_080A63BC: + adds r0, r4, 0 + bl sub_80A62DC +_080A63C2: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A634C + + thumb_func_start sub_80A63C8 +sub_80A63C8: @ 80A63C8 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080A6444 + movs r2, 0x2E + ldrsh r0, [r4, r2] + movs r2, 0x30 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x24] + movs r1, 0x36 + ldrsh r0, [r4, r1] + movs r2, 0x30 + ldrsh r1, [r4, r2] + bl cosine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + ldrh r2, [r4, 0x2E] + adds r1, r0, r2 + strh r1, [r4, 0x2E] + ldrh r0, [r4, 0x38] + ldrh r2, [r4, 0x36] + adds r0, r2 + strh r0, [r4, 0x36] + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _080A6410 + ldr r2, =0xffffff00 + b _080A6418 + .pool +_080A6410: + cmp r0, 0 + bge _080A641C + movs r2, 0x80 + lsls r2, 1 +_080A6418: + adds r0, r1, r2 + strh r0, [r4, 0x2E] +_080A641C: + ldrh r1, [r4, 0x36] + movs r2, 0x36 + ldrsh r0, [r4, r2] + cmp r0, 0xFF + ble _080A6430 + ldr r2, =0xffffff00 + b _080A6438 + .pool +_080A6430: + cmp r0, 0 + bge _080A643C + movs r2, 0x80 + lsls r2, 1 +_080A6438: + adds r0, r1, r2 + strh r0, [r4, 0x36] +_080A643C: + ldrh r0, [r4, 0x34] + subs r0, 0x1 + strh r0, [r4, 0x34] + b _080A644A +_080A6444: + adds r0, r4, 0 + bl sub_80A62DC +_080A644A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A63C8 + + thumb_func_start sub_80A6450 +sub_80A6450: @ 80A6450 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080A64A4 + movs r2, 0x2E + ldrsh r0, [r4, r2] + movs r2, 0x30 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x24] + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r2, 0x36 + ldrsh r1, [r4, r2] + bl cosine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + ldrh r2, [r4, 0x2E] + adds r1, r0, r2 + strh r1, [r4, 0x2E] + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _080A6490 + ldr r2, =0xffffff00 + b _080A6498 + .pool +_080A6490: + cmp r0, 0 + bge _080A649C + movs r2, 0x80 + lsls r2, 1 +_080A6498: + adds r0, r1, r2 + strh r0, [r4, 0x2E] +_080A649C: + ldrh r0, [r4, 0x34] + subs r0, 0x1 + strh r0, [r4, 0x34] + b _080A64AA +_080A64A4: + adds r0, r4, 0 + bl sub_80A62DC +_080A64AA: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A6450 + + thumb_func_start sub_80A64B0 +sub_80A64B0: @ 80A64B0 + push {lr} + adds r1, r0, 0 + ldrh r2, [r1, 0x2E] + movs r3, 0x2E + ldrsh r0, [r1, r3] + cmp r0, 0 + ble _080A64C4 + subs r0, r2, 0x1 + strh r0, [r1, 0x2E] + b _080A64CA +_080A64C4: + adds r0, r1, 0 + bl sub_80A62DC +_080A64CA: + pop {r0} + bx r0 + thumb_func_end sub_80A64B0 + + thumb_func_start sub_80A64D0 +sub_80A64D0: @ 80A64D0 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A64EC + ldr r1, =sub_80A653C + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A64D0 + + thumb_func_start sub_80A64EC +sub_80A64EC: @ 80A64EC + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x30 + ldrsh r1, [r4, r0] + movs r2, 0x32 + ldrsh r0, [r4, r2] + cmp r1, r0 + ble _080A6502 + ldrh r0, [r4, 0x2E] + negs r0, r0 + strh r0, [r4, 0x2E] +_080A6502: + movs r1, 0x32 + ldrsh r0, [r4, r1] + movs r2, 0x30 + ldrsh r1, [r4, r2] + subs r0, r1 + ldrh r5, [r4, 0x2E] + movs r2, 0x2E + ldrsh r1, [r4, r2] + bl __divsi3 + cmp r0, 0 + bge _080A651C + negs r0, r0 +_080A651C: + strh r0, [r4, 0x2E] + movs r1, 0x36 + ldrsh r0, [r4, r1] + movs r2, 0x34 + ldrsh r1, [r4, r2] + subs r0, r1 + movs r2, 0x2E + ldrsh r1, [r4, r2] + bl __divsi3 + strh r0, [r4, 0x32] + strh r5, [r4, 0x30] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80A64EC + + thumb_func_start sub_80A653C +sub_80A653C: @ 80A653C + push {lr} + adds r1, r0, 0 + ldrh r2, [r1, 0x2E] + movs r3, 0x2E + ldrsh r0, [r1, r3] + cmp r0, 0 + ble _080A6560 + subs r0, r2, 0x1 + strh r0, [r1, 0x2E] + ldrh r0, [r1, 0x30] + ldrh r2, [r1, 0x24] + adds r0, r2 + strh r0, [r1, 0x24] + ldrh r0, [r1, 0x32] + ldrh r3, [r1, 0x26] + adds r0, r3 + strh r0, [r1, 0x26] + b _080A6566 +_080A6560: + adds r0, r1, 0 + bl sub_80A62DC +_080A6566: + pop {r0} + bx r0 + thumb_func_end sub_80A653C + + thumb_func_start sub_80A656C +sub_80A656C: @ 80A656C + push {lr} + adds r2, r0, 0 + ldrh r1, [r2, 0x2E] + movs r3, 0x2E + ldrsh r0, [r2, r3] + cmp r0, 0 + ble _080A659C + subs r0, r1, 0x1 + strh r0, [r2, 0x2E] + ldrh r0, [r2, 0x30] + ldrh r1, [r2, 0x34] + adds r0, r1 + strh r0, [r2, 0x34] + ldrh r1, [r2, 0x32] + ldrh r3, [r2, 0x36] + adds r1, r3 + strh r1, [r2, 0x36] + lsls r0, 16 + asrs r0, 24 + strh r0, [r2, 0x24] + lsls r1, 16 + asrs r1, 24 + strh r1, [r2, 0x26] + b _080A65A2 +_080A659C: + adds r0, r2, 0 + bl sub_80A62DC +_080A65A2: + pop {r0} + bx r0 + thumb_func_end sub_80A656C + + thumb_func_start sub_80A65A8 +sub_80A65A8: @ 80A65A8 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x2E] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _080A65D8 + subs r0, r1, 0x1 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x30] + ldrh r1, [r4, 0x34] + adds r0, r1 + strh r0, [r4, 0x34] + ldrh r1, [r4, 0x32] + ldrh r2, [r4, 0x36] + adds r1, r2 + strh r1, [r4, 0x36] + lsls r0, 16 + asrs r0, 24 + strh r0, [r4, 0x24] + lsls r1, 16 + asrs r1, 24 + strh r1, [r4, 0x26] + b _080A65DE +_080A65D8: + adds r0, r4, 0 + bl sub_80A62DC +_080A65DE: + adds r0, r4, 0 + bl sub_80D30DC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A65A8 + + thumb_func_start sub_80A65EC +sub_80A65EC: @ 80A65EC + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x26] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x34] + ldr r5, =0x02038437 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x32] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x36] + ldr r0, =sub_80A64D0 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A65EC + + thumb_func_start sub_80A6630 +sub_80A6630: @ 80A6630 + push {r4,lr} + adds r3, r0, 0 + ldrh r1, [r3, 0x2E] + movs r2, 0x2E + ldrsh r0, [r3, r2] + cmp r0, 0 + ble _080A6674 + subs r0, r1, 0x1 + strh r0, [r3, 0x2E] + ldr r2, =0x02020630 + movs r4, 0x34 + ldrsh r1, [r3, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r3, 0x30] + ldrh r4, [r0, 0x24] + adds r1, r4 + strh r1, [r0, 0x24] + movs r0, 0x34 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r3, 0x32] + ldrh r2, [r0, 0x26] + adds r1, r2 + strh r1, [r0, 0x26] + b _080A667A + .pool +_080A6674: + adds r0, r3, 0 + bl sub_80A62DC +_080A667A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A6630 + + thumb_func_start sub_80A6680 +sub_80A6680: @ 80A6680 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x2E] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _080A66D0 + subs r0, r1, 0x1 + strh r0, [r4, 0x2E] + ldrh r1, [r4, 0x30] + ldrh r0, [r4, 0x34] + adds r1, r0 + strh r1, [r4, 0x34] + ldrh r0, [r4, 0x32] + ldrh r2, [r4, 0x36] + adds r0, r2 + strh r0, [r4, 0x36] + ldr r3, =0x02020630 + movs r0, 0x38 + ldrsh r2, [r4, r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r3 + lsls r1, 16 + asrs r1, 24 + strh r1, [r0, 0x24] + movs r1, 0x38 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r4, 0x36] + lsls r0, 16 + asrs r0, 24 + strh r0, [r1, 0x26] + b _080A66D6 + .pool +_080A66D0: + adds r0, r4, 0 + bl sub_80A62DC +_080A66D6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A6680 + + thumb_func_start sub_80A66DC +sub_80A66DC: @ 80A66DC + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x2E] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _080A673E + subs r0, r1, 0x1 + strh r0, [r4, 0x2E] + ldrh r1, [r4, 0x32] + lsls r0, r1, 16 + asrs r0, 24 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x30] + adds r1, r0 + strh r1, [r4, 0x32] + ldrh r1, [r4, 0x36] + lsls r0, r1, 16 + asrs r0, 24 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x34] + adds r1, r0 + strh r1, [r4, 0x36] + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl __modsi3 + cmp r0, 0 + bne _080A6744 + movs r1, 0x38 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080A6744 + adds r3, r4, 0 + adds r3, 0x3E + ldrb r2, [r3] + lsls r0, r2, 29 + lsrs r0, 31 + movs r1, 0x1 + eors r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + b _080A6744 +_080A673E: + adds r0, r4, 0 + bl sub_80A62DC +_080A6744: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A66DC + + thumb_func_start move_anim_8074EE0 +move_anim_8074EE0: @ 80A674C + push {r4,lr} + adds r4, r0, 0 + bl obj_free_rotscale_entry + adds r0, r4, 0 + bl move_anim_8072740 + pop {r4} + pop {r0} + bx r0 + thumb_func_end move_anim_8074EE0 + + thumb_func_start sub_80A6760 +sub_80A6760: @ 80A6760 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x26] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x34] + ldr r5, =0x02038436 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x32] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x36] + ldr r0, =sub_80A64D0 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A6760 + + thumb_func_start sub_80A67A4 +sub_80A67A4: @ 80A67A4 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x38] + bl sub_80A1F58 + adds r0, r4, 0 + bl move_anim_8074EE0 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A67A4 + + thumb_func_start sub_80A67BC +sub_80A67BC: @ 80A67BC + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080A67D2 + adds r0, r2, 0 + bl sub_80A62DC +_080A67D2: + pop {r0} + bx r0 + thumb_func_end sub_80A67BC + + thumb_func_start sub_80A67D8 +sub_80A67D8: @ 80A67D8 + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080A67EE + adds r0, r2, 0 + bl sub_80A62DC +_080A67EE: + pop {r0} + bx r0 + thumb_func_end sub_80A67D8 + + thumb_func_start sub_80A67F4 +sub_80A67F4: @ 80A67F4 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + adds r0, r4, 0 + bl move_anim_8072740 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A67F4 + + thumb_func_start sub_80A6814 +sub_80A6814: @ 80A6814 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A6814 + + thumb_func_start sub_80A6838 +sub_80A6838: @ 80A6838 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A6838 + + thumb_func_start sub_80A6864 +sub_80A6864: @ 80A6864 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + mov r8, r5 + ldr r7, =0x02038436 + ldrb r0, [r7] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x02038437 + ldrb r0, [r0] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + bhi _080A68B0 + cmp r6, r0 + bcs _080A68A4 + lsls r0, r5, 16 + b _080A68C0 + .pool +_080A68A4: + ldrb r0, [r7] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080A68BC +_080A68B0: + ldrh r1, [r4, 0x20] + lsls r0, r5, 16 + asrs r0, 16 + subs r1, r0 + strh r1, [r4, 0x20] + b _080A68C8 +_080A68BC: + mov r1, r8 + lsls r0, r1, 16 +_080A68C0: + asrs r0, 16 + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] +_080A68C8: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80A6864 + + thumb_func_start sub_80A68D4 +sub_80A68D4: @ 80A68D4 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x20] + movs r5, 0 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x22] + strh r0, [r4, 0x34] + adds r0, r4, 0 + bl obj_translate_based_on_private_1_2_3_4 + movs r0, 0x2E + ldrsh r1, [r4, r0] + movs r0, 0x80 + lsls r0, 8 + bl __divsi3 + strh r0, [r4, 0x3A] + strh r5, [r4, 0x3C] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80A68D4 + + thumb_func_start sub_80A6900 +sub_80A6900: @ 80A6900 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + bne _080A692C + ldrh r0, [r4, 0x3A] + ldrh r1, [r4, 0x3C] + adds r0, r1 + strh r0, [r4, 0x3C] + lsls r0, 16 + lsrs r0, 24 + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl sine + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + movs r0, 0 + b _080A692E +_080A692C: + movs r0, 0x1 +_080A692E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80A6900 + + thumb_func_start sub_80A6934 +sub_80A6934: @ 80A6934 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + bne _080A6960 + ldrh r0, [r4, 0x3A] + ldrh r1, [r4, 0x3C] + adds r0, r1 + strh r0, [r4, 0x3C] + lsls r0, 16 + lsrs r0, 24 + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl sine + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + movs r0, 0 + b _080A6962 +_080A6960: + movs r0, 0x1 +_080A6962: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80A6934 + + thumb_func_start oamt_add_pos2_onto_pos1 +oamt_add_pos2_onto_pos1: @ 80A6968 + ldrh r1, [r0, 0x24] + ldrh r2, [r0, 0x20] + adds r1, r2 + movs r2, 0 + strh r1, [r0, 0x20] + ldrh r1, [r0, 0x26] + ldrh r3, [r0, 0x22] + adds r1, r3 + strh r1, [r0, 0x22] + strh r2, [r0, 0x24] + strh r2, [r0, 0x26] + bx lr + thumb_func_end oamt_add_pos2_onto_pos1 + + thumb_func_start sub_80A6980 +sub_80A6980: @ 80A6980 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r1, 24 + cmp r1, 0 + bne _080A69A8 + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0 + bl sub_80A60AC + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A60AC + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] +_080A69A8: + ldr r4, =0x0203841e + movs r0, 0 + ldrsh r1, [r4, r0] + adds r0, r5, 0 + bl sub_80A6864 + ldrh r0, [r4, 0x2] + ldrh r1, [r5, 0x22] + adds r0, r1 + strh r0, [r5, 0x22] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A6980 + + thumb_func_start sub_80A69CC +sub_80A69CC: @ 80A69CC + push {r4,r5,lr} + adds r5, r0, 0 + lsls r1, 24 + cmp r1, 0 + bne _080A69F0 + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0 + bl sub_80A60AC + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x1 + b _080A6A04 + .pool +_080A69F0: + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A60AC + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 +_080A6A04: + bl sub_80A60AC + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + ldr r4, =0x0203841e + movs r0, 0 + ldrsh r1, [r4, r0] + adds r0, r5, 0 + bl sub_80A6864 + ldrh r0, [r4, 0x2] + ldrh r1, [r5, 0x22] + adds r0, r1 + strh r0, [r5, 0x22] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A69CC + + thumb_func_start battle_side_get_owner +battle_side_get_owner: @ 80A6A30 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02024076 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + bx lr + .pool + thumb_func_end battle_side_get_owner + + thumb_func_start battle_get_per_side_status +battle_get_per_side_status: @ 80A6A44 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02024076 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end battle_get_per_side_status + + thumb_func_start battle_get_side_with_given_state +battle_get_side_with_given_state: @ 80A6A54 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + movs r1, 0 + ldr r0, =0x0202406c + ldrb r2, [r0] + cmp r1, r2 + bcs _080A6A7E + ldr r4, =0x02024076 + ldrb r0, [r4] + cmp r0, r3 + beq _080A6A7E +_080A6A6C: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, r2 + bcs _080A6A7E + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, r3 + bne _080A6A6C +_080A6A7E: + adds r0, r1, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end battle_get_side_with_given_state + + thumb_func_start sub_80A6A90 +sub_80A6A90: @ 80A6A90 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A6ABC + ldr r0, =0x02038436 + ldrb r0, [r0] + cmp r0, r4 + beq _080A6B0A + ldr r0, =0x02038437 + ldrb r0, [r0] + cmp r0, r4 + beq _080A6B0A + b _080A6B18 + .pool +_080A6ABC: + ldr r0, =0x02024076 + adds r0, r4, r0 + ldrb r0, [r0] + cmp r0, 0xFF + beq _080A6B18 + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080A6AF0 + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + b _080A6AFE + .pool +_080A6AF0: + ldr r1, =0x0202406e + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec +_080A6AFE: + adds r0, r1 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _080A6B18 +_080A6B0A: + movs r0, 0x1 + b _080A6B1A + .pool +_080A6B18: + movs r0, 0 +_080A6B1A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80A6A90 + + thumb_func_start battle_type_is_double +battle_type_is_double: @ 80A6B20 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + bx lr + .pool + thumb_func_end battle_type_is_double + + thumb_func_start sub_80A6B30 +sub_80A6B30: @ 80A6B30 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A4DF0 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _080A6B64 + ldr r0, =0x0202305c + ldr r0, [r0] + str r0, [r4] + ldr r0, =0x02023060 + ldr r0, [r0] + str r0, [r4, 0x4] + movs r1, 0 + movs r0, 0xE + strb r0, [r4, 0x8] + movs r0, 0x1 + strb r0, [r4, 0x9] + strh r1, [r4, 0xA] + b _080A6B7E + .pool +_080A6B64: + ldr r0, =0x0202305c + ldr r0, [r0] + str r0, [r4] + ldr r0, =0x02023060 + ldr r0, [r0] + str r0, [r4, 0x4] + movs r0, 0x8 + strb r0, [r4, 0x8] + movs r0, 0x1 + strb r0, [r4, 0x9] + movs r0, 0x80 + lsls r0, 2 + strh r0, [r4, 0xA] +_080A6B7E: + strh r1, [r4, 0xC] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A6B30 + + thumb_func_start sub_80A6B90 +sub_80A6B90: @ 80A6B90 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80A4DF0 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _080A6BC4 + ldr r0, =0x0202305c + ldr r0, [r0] + str r0, [r4] + ldr r0, =0x02023060 + ldr r0, [r0] + str r0, [r4, 0x4] + movs r1, 0 + movs r0, 0xE + strb r0, [r4, 0x8] + movs r0, 0x1 + strb r0, [r4, 0x9] + strh r1, [r4, 0xA] + b _080A6BEA + .pool +_080A6BC4: + cmp r5, 0x1 + bne _080A6BD0 + adds r0, r4, 0 + bl sub_80A6B30 + b _080A6BEC +_080A6BD0: + ldr r0, =0x0202305c + ldr r0, [r0] + str r0, [r4] + ldr r0, =0x02023060 + ldr r0, [r0] + str r0, [r4, 0x4] + movs r0, 0x9 + strb r0, [r4, 0x8] + movs r0, 0x2 + strb r0, [r4, 0x9] + movs r0, 0xC0 + lsls r0, 2 + strh r0, [r4, 0xA] +_080A6BEA: + strh r1, [r4, 0xC] +_080A6BEC: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A6B90 + + thumb_func_start sub_80A6BFC +sub_80A6BFC: @ 80A6BFC + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, =0x0202305c + ldr r0, [r0] + str r0, [r4] + ldr r0, =0x02023060 + ldr r0, [r0] + str r0, [r4, 0x4] + bl sub_80A4DF0 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + beq _080A6C30 + movs r0, 0 + movs r1, 0xE + strb r1, [r4, 0x8] + movs r1, 0x1 + strb r1, [r4, 0x9] + strh r0, [r4, 0xA] + strh r0, [r4, 0xC] + b _080A6C60 + .pool +_080A6C30: + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1 + bne _080A6C50 + movs r0, 0x8 + strb r0, [r4, 0x8] + strb r1, [r4, 0x9] + movs r0, 0x80 + lsls r0, 2 + b _080A6C5C + .pool +_080A6C50: + movs r0, 0x9 + strb r0, [r4, 0x8] + movs r0, 0x2 + strb r0, [r4, 0x9] + movs r0, 0xC0 + lsls r0, 2 +_080A6C5C: + strh r0, [r4, 0xA] + strh r5, [r4, 0xC] +_080A6C60: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80A6BFC + + thumb_func_start sub_80A6C68 +sub_80A6C68: @ 80A6C68 + push {lr} + sub sp, 0x20 + adds r1, r0, 0 + add r0, sp, 0xC + bl sub_80A6B90 + movs r0, 0 + str r0, [sp, 0x1C] + add r0, sp, 0x1C + ldr r1, [sp, 0xC] + ldr r2, =0x05000800 + bl CpuSet + add r0, sp, 0xC + ldrb r0, [r0, 0x9] + ldr r1, [sp, 0xC] + movs r2, 0x80 + lsls r2, 6 + add r3, sp, 0xC + ldrh r3, [r3, 0xA] + bl LoadBgTiles + add r0, sp, 0xC + ldrb r0, [r0, 0x9] + movs r1, 0x20 + str r1, [sp] + movs r1, 0x40 + str r1, [sp, 0x4] + movs r1, 0x11 + str r1, [sp, 0x8] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect + add r0, sp, 0xC + ldrb r0, [r0, 0x9] + bl CopyBgTilemapBufferToVram + add sp, 0x20 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A6C68 + + thumb_func_start sub_80A6CC0 +sub_80A6CC0: @ 80A6CC0 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + adds r5, r0, 0 + mov r8, r1 + adds r6, r2, 0 + movs r0, 0 + str r0, [sp] + ldr r4, =0x0202305c + ldr r1, [r4] + ldr r2, =0x05000800 + mov r0, sp + bl CpuSet + ldr r1, [r4] + mov r0, r8 + bl LZDecompressWram + lsls r5, 24 + lsrs r5, 24 + ldr r1, [r4] + movs r2, 0x80 + lsls r2, 6 + lsls r6, 16 + lsrs r6, 16 + adds r0, r5, 0 + adds r3, r6, 0 + bl LoadBgTiles + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A6CC0 + + thumb_func_start sub_80A6D10 +sub_80A6D10: @ 80A6D10 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x20 + str r0, [sp] + movs r0, 0x40 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80A6D10 + + thumb_func_start sub_80A6D48 +sub_80A6D48: @ 80A6D48 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6D10 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl CopyBgTilemapBufferToVram + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A6D48 + + thumb_func_start sub_80A6D60 +sub_80A6D60: @ 80A6D60 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r2, 0 + ldrb r0, [r4, 0x9] + bl sub_80A6D10 + bl sub_80A4DF0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080A6D86 + ldrb r0, [r4, 0x8] + ldr r1, [r4, 0x4] + lsls r3, r5, 24 + lsrs r3, 24 + movs r2, 0 + bl sub_80A4720 +_080A6D86: + ldrb r0, [r4, 0x9] + bl CopyBgTilemapBufferToVram + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80A6D60 + + thumb_func_start sub_80A6D94 +sub_80A6D94: @ 80A6D94 + push {lr} + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A6DA4 + movs r0, 0x2 + b _080A6DA6 +_080A6DA4: + movs r0, 0x1 +_080A6DA6: + pop {r1} + bx r1 + thumb_func_end sub_80A6D94 + + thumb_func_start sub_80A6DAC +sub_80A6DAC: @ 80A6DAC + push {lr} + lsls r0, 24 + cmp r0, 0 + beq _080A6DBE + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A6DD4 +_080A6DBE: + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl lcd_bg_operations + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0x1 + bl lcd_bg_operations + b _080A6DE8 +_080A6DD4: + movs r0, 0x3 + movs r1, 0 + movs r2, 0x1 + bl lcd_bg_operations + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0 + bl lcd_bg_operations +_080A6DE8: + pop {r0} + bx r0 + thumb_func_end sub_80A6DAC + + thumb_func_start sub_80A6DEC +sub_80A6DEC: @ 80A6DEC + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x20] + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x22] + strh r0, [r4, 0x34] + adds r0, r4, 0 + bl sub_80A6E14 + ldr r1, =sub_80A65A8 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A6DEC + + thumb_func_start sub_80A6E14 +sub_80A6E14: @ 80A6E14 + push {r4-r6,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0x32] + ldrh r1, [r5, 0x30] + subs r0, r1 + ldrh r4, [r5, 0x36] + ldrh r1, [r5, 0x34] + subs r4, r1 + lsls r4, 24 + lsrs r4, 16 + lsls r0, 24 + asrs r0, 16 + movs r2, 0x2E + ldrsh r1, [r5, r2] + bl __divsi3 + movs r6, 0 + strh r0, [r5, 0x30] + lsls r4, 16 + asrs r4, 16 + movs r0, 0x2E + ldrsh r1, [r5, r0] + adds r0, r4, 0 + bl __divsi3 + strh r0, [r5, 0x32] + strh r6, [r5, 0x36] + strh r6, [r5, 0x34] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80A6E14 + + thumb_func_start obj_translate_based_on_private_1_2_3_4 +obj_translate_based_on_private_1_2_3_4: @ 80A6E54 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r7, r0, 0 + movs r0, 0x32 + ldrsh r1, [r7, r0] + movs r2, 0x30 + ldrsh r0, [r7, r2] + subs r1, r0 + movs r3, 0x36 + ldrsh r2, [r7, r3] + movs r3, 0x34 + ldrsh r0, [r7, r3] + subs r2, r0 + lsrs r0, r1, 31 + mov r8, r0 + lsrs r3, r2, 31 + mov r9, r3 + cmp r1, 0 + bge _080A6E80 + negs r1, r1 +_080A6E80: + lsls r0, r1, 24 + lsrs r6, r0, 16 + adds r0, r2, 0 + cmp r0, 0 + bge _080A6E8C + negs r0, r0 +_080A6E8C: + lsls r0, 24 + lsrs r5, r0, 16 + movs r0, 0x2E + ldrsh r4, [r7, r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl __divsi3 + lsls r0, 16 + lsrs r6, r0, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl __divsi3 + lsls r0, 16 + lsrs r5, r0, 16 + mov r2, r8 + cmp r2, 0 + beq _080A6EB8 + movs r0, 0x1 + orrs r6, r0 + b _080A6EBC +_080A6EB8: + ldr r0, =0x0000fffe + ands r6, r0 +_080A6EBC: + mov r3, r9 + cmp r3, 0 + beq _080A6ECC + movs r0, 0x1 + orrs r5, r0 + b _080A6ED0 + .pool +_080A6ECC: + ldr r0, =0x0000fffe + ands r5, r0 +_080A6ED0: + movs r0, 0 + strh r6, [r7, 0x30] + strh r5, [r7, 0x32] + strh r0, [r7, 0x36] + strh r0, [r7, 0x34] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end obj_translate_based_on_private_1_2_3_4 + + thumb_func_start sub_80A6EEC +sub_80A6EEC: @ 80A6EEC + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x20] + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x22] + strh r0, [r4, 0x34] + adds r0, r4, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldr r1, =sub_80A6F98 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A6EEC + + thumb_func_start sub_80A6F14 +sub_80A6F14: @ 80A6F14 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x20] + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x22] + strh r0, [r4, 0x34] + adds r0, r4, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldr r1, =sub_80A6FB4 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A6F14 + + thumb_func_start sub_80A6F3C +sub_80A6F3C: @ 80A6F3C + push {r4-r6,lr} + adds r2, r0, 0 + movs r1, 0x2E + ldrsh r0, [r2, r1] + cmp r0, 0 + bne _080A6F4C + movs r0, 0x1 + b _080A6F90 +_080A6F4C: + ldrh r1, [r2, 0x30] + ldrh r4, [r2, 0x32] + ldrh r6, [r2, 0x34] + ldrh r5, [r2, 0x36] + adds r0, r6, r1 + lsls r3, r0, 16 + lsrs r6, r3, 16 + adds r0, r5, r4 + lsls r0, 16 + lsrs r5, r0, 16 + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + beq _080A6F6E + lsrs r0, r3, 24 + negs r0, r0 + b _080A6F70 +_080A6F6E: + lsrs r0, r3, 24 +_080A6F70: + strh r0, [r2, 0x24] + movs r0, 0x1 + ands r4, r0 + cmp r4, 0 + beq _080A6F80 + lsrs r0, r5, 8 + negs r0, r0 + b _080A6F82 +_080A6F80: + lsrs r0, r5, 8 +_080A6F82: + strh r0, [r2, 0x26] + strh r6, [r2, 0x34] + strh r5, [r2, 0x36] + ldrh r0, [r2, 0x2E] + subs r0, 0x1 + strh r0, [r2, 0x2E] + movs r0, 0 +_080A6F90: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80A6F3C + + thumb_func_start sub_80A6F98 +sub_80A6F98: @ 80A6F98 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + beq _080A6FAC + adds r0, r4, 0 + bl sub_80A62DC +_080A6FAC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A6F98 + + thumb_func_start sub_80A6FB4 +sub_80A6FB4: @ 80A6FB4 + push {r4,lr} + adds r4, r0, 0 + bl sub_8039E9C + adds r0, r4, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + beq _080A6FCE + adds r0, r4, 0 + bl sub_80A62DC +_080A6FCE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A6FB4 + + thumb_func_start sub_80A6FD4 +sub_80A6FD4: @ 80A6FD4 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r1, [r4, r0] + movs r2, 0x30 + ldrsh r0, [r4, r2] + subs r0, r1, r0 + cmp r0, 0 + bge _080A6FE8 + negs r0, r0 +_080A6FE8: + lsls r0, 8 + movs r2, 0x2E + ldrsh r1, [r4, r2] + bl __divsi3 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl obj_translate_based_on_private_1_2_3_4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A6FD4 + + thumb_func_start sub_80A7000 +sub_80A7000: @ 80A7000 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x20] + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x22] + strh r0, [r4, 0x34] + adds r0, r4, 0 + bl sub_80A6FD4 + ldr r1, =sub_80A6F98 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A7000 + + thumb_func_start sub_80A7028 +sub_80A7028: @ 80A7028 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r7, r0, 0 + movs r0, 0x32 + ldrsh r1, [r7, r0] + movs r2, 0x30 + ldrsh r0, [r7, r2] + subs r1, r0 + movs r3, 0x36 + ldrsh r2, [r7, r3] + movs r3, 0x34 + ldrsh r0, [r7, r3] + subs r2, r0 + lsrs r0, r1, 31 + mov r8, r0 + lsrs r3, r2, 31 + mov r9, r3 + cmp r1, 0 + bge _080A7054 + negs r1, r1 +_080A7054: + lsls r0, r1, 20 + lsrs r6, r0, 16 + adds r0, r2, 0 + cmp r0, 0 + bge _080A7060 + negs r0, r0 +_080A7060: + lsls r0, 20 + lsrs r5, r0, 16 + movs r0, 0x2E + ldrsh r4, [r7, r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl __divsi3 + lsls r0, 16 + lsrs r6, r0, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl __divsi3 + lsls r0, 16 + lsrs r5, r0, 16 + mov r2, r8 + cmp r2, 0 + beq _080A708C + movs r0, 0x1 + orrs r6, r0 + b _080A7090 +_080A708C: + ldr r0, =0x0000fffe + ands r6, r0 +_080A7090: + mov r3, r9 + cmp r3, 0 + beq _080A70A0 + movs r0, 0x1 + orrs r5, r0 + b _080A70A4 + .pool +_080A70A0: + ldr r0, =0x0000fffe + ands r5, r0 +_080A70A4: + movs r0, 0 + strh r6, [r7, 0x30] + strh r5, [r7, 0x32] + strh r0, [r7, 0x36] + strh r0, [r7, 0x34] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A7028 + + thumb_func_start sub_80A70C0 +sub_80A70C0: @ 80A70C0 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x20] + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x22] + strh r0, [r4, 0x34] + adds r0, r4, 0 + bl sub_80A7028 + ldr r1, =sub_80A7144 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A70C0 + + thumb_func_start sub_80A70E8 +sub_80A70E8: @ 80A70E8 + push {r4-r6,lr} + adds r2, r0, 0 + movs r1, 0x2E + ldrsh r0, [r2, r1] + cmp r0, 0 + bne _080A70F8 + movs r0, 0x1 + b _080A713C +_080A70F8: + ldrh r1, [r2, 0x30] + ldrh r4, [r2, 0x32] + ldrh r6, [r2, 0x34] + ldrh r5, [r2, 0x36] + adds r0, r6, r1 + lsls r3, r0, 16 + lsrs r6, r3, 16 + adds r0, r5, r4 + lsls r0, 16 + lsrs r5, r0, 16 + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + beq _080A711A + lsrs r0, r3, 20 + negs r0, r0 + b _080A711C +_080A711A: + lsrs r0, r3, 20 +_080A711C: + strh r0, [r2, 0x24] + movs r0, 0x1 + ands r4, r0 + cmp r4, 0 + beq _080A712C + lsrs r0, r5, 4 + negs r0, r0 + b _080A712E +_080A712C: + lsrs r0, r5, 4 +_080A712E: + strh r0, [r2, 0x26] + strh r6, [r2, 0x34] + strh r5, [r2, 0x36] + ldrh r0, [r2, 0x2E] + subs r0, 0x1 + strh r0, [r2, 0x2E] + movs r0, 0 +_080A713C: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80A70E8 + + thumb_func_start sub_80A7144 +sub_80A7144: @ 80A7144 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A70E8 + lsls r0, 24 + cmp r0, 0 + beq _080A7158 + adds r0, r4, 0 + bl sub_80A62DC +_080A7158: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A7144 + + thumb_func_start sub_80A7160 +sub_80A7160: @ 80A7160 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r1, [r4, r0] + movs r2, 0x30 + ldrsh r0, [r4, r2] + subs r0, r1, r0 + cmp r0, 0 + bge _080A7174 + negs r0, r0 +_080A7174: + lsls r0, 4 + movs r2, 0x2E + ldrsh r1, [r4, r2] + bl __divsi3 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_80A7028 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A7160 + + thumb_func_start sub_80A718C +sub_80A718C: @ 80A718C + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x20] + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x22] + strh r0, [r4, 0x34] + adds r0, r4, 0 + bl sub_80A7160 + ldr r1, =sub_80A7144 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A718C + + thumb_func_start obj_id_set_rotscale +obj_id_set_rotscale: @ 80A71B4 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 16 + lsls r3, 16 + lsrs r3, 16 + ldr r5, =0xffff0000 + lsls r2, 16 + lsrs r1, 16 + orrs r1, r2 + str r1, [sp] + ldr r0, [sp, 0x4] + ands r0, r5 + orrs r0, r3 + str r0, [sp, 0x4] + bl sub_80A7238 + lsls r0, 24 + cmp r0, 0 + beq _080A71F0 + mov r0, sp + ldrh r0, [r0] + negs r0, r0 + lsls r0, 16 + lsrs r0, 16 + ldr r1, [sp] + ands r1, r5 + orrs r1, r0 + str r1, [sp] +_080A71F0: + ldr r1, =0x02020630 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + ldrb r4, [r0, 0x3] + lsls r4, 26 + lsrs r4, 27 + add r5, sp, 0x8 + mov r0, sp + adds r1, r5, 0 + movs r2, 0x1 + movs r3, 0x2 + bl ObjAffineSet + ldr r0, =0x02021bc0 + lsls r4, 3 + adds r4, r0 + ldrh r0, [r5] + strh r0, [r4] + ldrh r0, [r5, 0x2] + strh r0, [r4, 0x2] + ldrh r0, [r5, 0x4] + strh r0, [r4, 0x4] + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x6] + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end obj_id_set_rotscale + + thumb_func_start sub_80A7238 +sub_80A7238: @ 80A7238 + push {r4,lr} + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A7268 + ldr r4, =0x02020630 + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + movs r2, 0x32 + ldrsh r0, [r1, r2] + cmp r0, 0xC9 + beq _080A7268 + movs r0, 0x1 + b _080A726A + .pool +_080A7268: + movs r0, 0 +_080A726A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80A7238 + + thumb_func_start sub_80A7270 +sub_80A7270: @ 80A7270 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + ldr r1, =0x02020630 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r4, r0, r1 + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r7, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A72A6 + adds r0, r7, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A72B4 +_080A72A6: + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_080A72B4: + ldr r1, =0x02020630 + lsls r4, r6, 4 + adds r0, r4, r6 + lsls r0, 2 + adds r5, r0, r1 + movs r0, 0x3 + mov r1, r8 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r5, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x1] + adds r2, r5, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A7312 + ldrb r0, [r5, 0x1] + lsls r0, 30 + cmp r0, 0 + bne _080A7312 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x6] + movs r0, 0x1F + ands r1, r0 + lsls r1, 1 + ldrb r2, [r5, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x3] +_080A7312: + ldr r1, =0x02020630 + adds r0, r4, r6 + lsls r0, 2 + adds r0, r1 + ldrb r3, [r0, 0x1] + movs r1, 0x3 + orrs r3, r1 + strb r3, [r0, 0x1] + lsrs r1, r3, 6 + ldrb r2, [r0, 0x3] + lsrs r2, 6 + lsls r3, 30 + lsrs r3, 30 + bl CalcVecFromObjectCenterToObjectUpperLeft + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A7270 + + thumb_func_start sub_80A7344 +sub_80A7344: @ 80A7344 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl obj_id_set_rotscale + ldr r1, =0x02020630 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x1] + movs r1, 0x4 + negs r1, r1 + ands r1, r2 + movs r2, 0x1 + orrs r1, r2 + movs r2, 0xD + negs r2, r2 + ands r1, r2 + strb r1, [r0, 0x1] + adds r3, r0, 0 + adds r3, 0x2C + ldrb r2, [r3] + movs r1, 0x7F + ands r1, r2 + strb r1, [r3] + ldrb r3, [r0, 0x1] + lsrs r1, r3, 6 + ldrb r2, [r0, 0x3] + lsrs r2, 6 + lsls r3, 30 + lsrs r3, 30 + bl CalcVecFromObjectCenterToObjectUpperLeft + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A7344 + + thumb_func_start sub_80A73A0 +sub_80A73A0: @ 80A73A0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r2, r1, r2 + ldrb r0, [r2, 0x3] + lsls r0, 26 + lsrs r0, 27 + ldr r1, =0x02021bc0 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x4] + movs r3, 0x4 + ldrsh r0, [r0, r3] + cmp r0, 0 + bge _080A73CC + negs r0, r0 + lsls r0, 16 + lsrs r1, r0, 16 +_080A73CC: + lsls r0, r1, 16 + asrs r0, 19 + strh r0, [r2, 0x26] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A73A0 + + thumb_func_start sub_80A73E0 +sub_80A73E0: @ 80A73E0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + adds r4, r0, 0 + ldr r0, [sp, 0x28] + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 16 + lsrs r5, r2, 16 + lsls r3, 16 + lsrs r7, r3, 16 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldrb r0, [r4, 0x1] + lsls r0, 30 + lsrs r0, 30 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080A7486 + adds r0, r4, 0 + adds r0, 0x2C + ldrb r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0] + cmp r6, 0 + beq _080A742E + ldrb r3, [r4, 0x1] + lsrs r1, r3, 6 + ldrb r2, [r4, 0x3] + lsrs r2, 6 + lsls r3, 30 + lsrs r3, 30 + adds r0, r4, 0 + bl CalcVecFromObjectCenterToObjectUpperLeft +_080A742E: + ldr r6, =0xffff0000 + lsls r0, r7, 16 + orrs r5, r0 + str r5, [sp] + ldr r0, [sp, 0x4] + ands r0, r6 + mov r1, r8 + orrs r0, r1 + str r0, [sp, 0x4] + bl sub_80A7238 + lsls r0, 24 + cmp r0, 0 + beq _080A745C + mov r0, sp + ldrh r0, [r0] + negs r0, r0 + lsls r0, 16 + lsrs r0, 16 + ldr r1, [sp] + ands r1, r6 + orrs r1, r0 + str r1, [sp] +_080A745C: + ldrb r4, [r4, 0x3] + lsls r4, 26 + lsrs r4, 27 + add r5, sp, 0x8 + mov r0, sp + adds r1, r5, 0 + movs r2, 0x1 + movs r3, 0x2 + bl ObjAffineSet + ldr r0, =0x02021bc0 + lsls r4, 3 + adds r4, r0 + ldrh r0, [r5] + strh r0, [r4] + ldrh r0, [r5, 0x2] + strh r0, [r4, 0x2] + ldrh r0, [r5, 0x4] + strh r0, [r4, 0x4] + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x6] +_080A7486: + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A73E0 + + thumb_func_start sub_80A749C +sub_80A749C: @ 80A749C + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + movs r3, 0x80 + lsls r3, 1 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r1, 0x1 + adds r2, r3, 0 + bl sub_80A73E0 + adds r2, r4, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + ldrb r3, [r4, 0x1] + lsrs r1, r3, 6 + ldrb r2, [r4, 0x3] + lsrs r2, 6 + lsls r3, 30 + lsrs r3, 30 + adds r0, r4, 0 + bl CalcVecFromObjectCenterToObjectUpperLeft + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A749C + + thumb_func_start sub_80A74DC +sub_80A74DC: @ 80A74DC + push {lr} + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + bl ArcTan2 + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_80A74DC + + thumb_func_start sub_80A74F4 +sub_80A74F4: @ 80A74F4 + push {lr} + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + bl sub_80A74DC + lsls r0, 16 + negs r0, r0 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_80A74F4 + + thumb_func_start sub_80A750C +sub_80A750C: @ 80A750C + push {r4-r7,lr} + lsls r1, 24 + lsls r0, 20 + lsrs r0, 16 + cmp r1, 0 + bne _080A7588 + ldr r2, =0x02037714 + ldr r1, =0x02037b14 + lsls r0, 1 + adds r4, r0, r1 + adds r5, r0, r2 + movs r6, 0xF +_080A7524: + ldr r0, [r5] + lsls r2, r0, 27 + lsrs r2, 27 + lsls r1, r0, 22 + lsrs r1, 27 + adds r2, r1 + lsls r0, 17 + lsrs r0, 27 + adds r0, r2 + movs r1, 0x3 + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1F + ands r0, r1 + ldrb r1, [r4] + movs r3, 0x20 + negs r3, r3 + adds r2, r3, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r4] + lsls r3, r0, 5 + ldrh r1, [r4] + ldr r7, =0xfffffc1f + adds r2, r7, 0 + ands r1, r2 + orrs r1, r3 + strh r1, [r4] + lsls r0, 2 + ldrb r1, [r4, 0x1] + movs r3, 0x7D + negs r3, r3 + adds r2, r3, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0x1] + adds r4, 0x2 + adds r5, 0x2 + subs r6, 0x1 + cmp r6, 0 + bge _080A7524 + b _080A7598 + .pool +_080A7588: + lsls r1, r0, 1 + ldr r0, =0x02037714 + adds r0, r1, r0 + ldr r2, =0x02037b14 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet +_080A7598: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A750C + + thumb_func_start sub_80A75AC +sub_80A75AC: @ 80A75AC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + ldr r4, [sp, 0x28] + ldr r5, [sp, 0x2C] + ldr r6, [sp, 0x30] + lsls r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + lsls r4, 24 + lsrs r4, 24 + mov r10, r4 + lsls r5, 24 + lsrs r5, 24 + str r5, [sp] + lsls r6, 24 + lsrs r6, 24 + str r6, [sp, 0x4] + movs r4, 0 + cmp r0, 0 + beq _080A7602 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A75F6 + movs r4, 0xE + b _080A7602 +_080A75F6: + bl sub_80A6D94 + lsls r0, 24 + lsrs r0, 24 + movs r4, 0x1 + lsls r4, r0 +_080A7602: + cmp r7, 0 + beq _080A7614 + ldr r0, =0x02038436 + ldrb r0, [r0] + adds r1, r0, 0 + adds r1, 0x10 + movs r0, 0x1 + lsls r0, r1 + orrs r4, r0 +_080A7614: + mov r0, r8 + cmp r0, 0 + beq _080A7628 + ldr r0, =0x02038437 + ldrb r0, [r0] + adds r1, r0, 0 + adds r1, 0x10 + movs r0, 0x1 + lsls r0, r1 + orrs r4, r0 +_080A7628: + mov r0, r9 + cmp r0, 0 + beq _080A764E + ldr r6, =0x02038436 + ldrb r0, [r6] + movs r5, 0x2 + eors r0, r5 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A764E + ldrb r0, [r6] + eors r0, r5 + adds r1, r0, 0 + adds r1, 0x10 + movs r0, 0x1 + lsls r0, r1 + orrs r4, r0 +_080A764E: + mov r0, r10 + cmp r0, 0 + beq _080A7674 + ldr r6, =0x02038437 + ldrb r0, [r6] + movs r5, 0x2 + eors r0, r5 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A7674 + ldrb r0, [r6] + eors r0, r5 + adds r1, r0, 0 + adds r1, 0x10 + movs r0, 0x1 + lsls r0, r1 + orrs r4, r0 +_080A7674: + ldr r0, [sp] + cmp r0, 0 + beq _080A769A + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A7694 + movs r0, 0x80 + lsls r0, 1 + b _080A7698 + .pool +_080A7694: + movs r0, 0x80 + lsls r0, 7 +_080A7698: + orrs r4, r0 +_080A769A: + ldr r0, [sp, 0x4] + cmp r0, 0 + beq _080A76B0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A76B0 + movs r0, 0x80 + lsls r0, 2 + orrs r4, r0 +_080A76B0: + adds r0, r4, 0 + 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_80A75AC + + thumb_func_start sub_80A76C4 +sub_80A76C4: @ 80A76C4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r7, r2, 24 + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + movs r4, 0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A76F2 + cmp r5, 0 + beq _080A77A0 + movs r4, 0x80 + lsls r4, 11 + b _080A77A0 +_080A76F2: + cmp r5, 0 + beq _080A771A + movs r0, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A771A + movs r0, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x10 + movs r4, 0x1 + lsls r4, r0 +_080A771A: + cmp r6, 0 + beq _080A7746 + movs r0, 0x2 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A7746 + movs r0, 0x2 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + adds r1, 0x10 + movs r0, 0x1 + lsls r0, r1 + orrs r4, r0 +_080A7746: + cmp r7, 0 + beq _080A7772 + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A7772 + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + adds r1, 0x10 + movs r0, 0x1 + lsls r0, r1 + orrs r4, r0 +_080A7772: + mov r0, r8 + cmp r0, 0 + beq _080A77A0 + movs r0, 0x3 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A77A0 + movs r0, 0x3 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + adds r1, 0x10 + movs r0, 0x1 + lsls r0, r1 + orrs r4, r0 +_080A77A0: + adds r0, r4, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80A76C4 + + thumb_func_start sub_80A77AC +sub_80A77AC: @ 80A77AC + lsls r0, 24 + lsrs r0, 24 + bx lr + thumb_func_end sub_80A77AC + + thumb_func_start sub_80A77B4 +sub_80A77B4: @ 80A77B4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_80A77B4 + + thumb_func_start sub_80A77C8 +sub_80A77C8: @ 80A77C8 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080A7806 + ldr r2, =0x0203841e + movs r3, 0x6 + ldrsh r0, [r2, r3] + movs r1, 0 + cmp r0, 0 + bne _080A77E2 + movs r1, 0x1 +_080A77E2: + movs r3, 0x4 + ldrsh r0, [r2, r3] + cmp r0, 0 + bne _080A77F8 + adds r0, r4, 0 + bl sub_80A69CC + b _080A77FE + .pool +_080A77F8: + adds r0, r4, 0 + bl sub_80A6980 +_080A77FE: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _080A781A +_080A7806: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x30 + ands r0, r1 + cmp r0, 0 + beq _080A781A + adds r0, r4, 0 + bl move_anim_8074EE0 +_080A781A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A77C8 + + thumb_func_start sub_80A7820 +sub_80A7820: @ 80A7820 + push {r4-r7,lr} + adds r5, r0, 0 + ldr r6, =0x0203841e + movs r1, 0xA + ldrsh r0, [r6, r1] + movs r1, 0xFF + lsls r1, 8 + ands r0, r1 + movs r1, 0 + cmp r0, 0 + bne _080A7838 + movs r1, 0x1 +_080A7838: + ldrb r0, [r6, 0xA] + movs r7, 0x1 + cmp r0, 0 + bne _080A7842 + movs r7, 0x3 +_080A7842: + adds r0, r5, 0 + bl sub_80A69CC + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080A785C + ldrh r0, [r6, 0x4] + negs r0, r0 + strh r0, [r6, 0x4] +_080A785C: + ldrh r0, [r6, 0x8] + strh r0, [r5, 0x2E] + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6, 0x4] + adds r0, r1 + strh r0, [r5, 0x32] + ldrb r0, [r4] + adds r1, r7, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r6, [r6, 0x6] + adds r0, r6 + strh r0, [r5, 0x36] + ldr r0, =sub_80A6EEC + str r0, [r5, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r5, 0 + bl oamt_set_x3A_32 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A7820 + + thumb_func_start sub_80A78AC +sub_80A78AC: @ 80A78AC + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080A78CC + ldr r1, =0x0203841e + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] +_080A78CC: + ldr r4, =0x0203841e + ldrh r0, [r4, 0x8] + strh r0, [r6, 0x2E] + ldr r5, =0x02038437 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x4] + adds r0, r1 + strh r0, [r6, 0x32] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x6] + adds r0, r1 + strh r0, [r6, 0x36] + ldrh r0, [r4, 0xA] + strh r0, [r6, 0x38] + adds r0, r6, 0 + bl sub_80A68D4 + ldr r0, =sub_80A791C + str r0, [r6, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A78AC + + thumb_func_start sub_80A791C +sub_80A791C: @ 80A791C + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _080A7930 + adds r0, r4, 0 + bl move_anim_8072740 +_080A7930: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A791C + + thumb_func_start sub_80A7938 +sub_80A7938: @ 80A7938 + push {r4-r7,lr} + adds r5, r0, 0 + ldr r0, =0x0203841e + movs r2, 0xC + ldrsh r1, [r0, r2] + cmp r1, 0 + bne _080A7950 + movs r4, 0x1 + movs r7, 0x3 + b _080A7954 + .pool +_080A7950: + movs r4, 0 + movs r7, 0x1 +_080A7954: + movs r1, 0xA + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _080A796C + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80A69CC + ldr r0, =0x02038436 + b _080A7976 + .pool +_080A796C: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80A6980 + ldr r0, =0x02038437 +_080A7976: + ldrb r6, [r0] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080A798E + ldr r1, =0x0203841e + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] +_080A798E: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80A6980 + ldr r4, =0x0203841e + ldrh r0, [r4, 0x8] + strh r0, [r5, 0x2E] + adds r0, r6, 0 + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r2, [r4, 0x4] + adds r0, r2 + strh r0, [r5, 0x32] + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r4, [r4, 0x6] + adds r0, r4 + strh r0, [r5, 0x36] + ldr r0, =sub_80A6EEC + str r0, [r5, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r5, 0 + bl oamt_set_x3A_32 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A7938 + + thumb_func_start duplicate_obj_of_side_rel2move_in_transparent_mode +duplicate_obj_of_side_rel2move_in_transparent_mode: @ 80A79E8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xFF + beq _080A7A52 + movs r6, 0 + ldr r2, =0x02020630 + lsls r0, r1, 4 + adds r0, r1 + lsls r1, r0, 2 +_080A7A04: + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r4, r0, r2 + adds r5, r4, 0 + adds r5, 0x3E + ldrb r0, [r5] + lsls r0, 31 + cmp r0, 0 + bne _080A7A48 + adds r0, r4, 0 + adds r1, r2 + movs r2, 0x44 + bl memcpy + ldrb r1, [r4, 0x1] + movs r2, 0xD + negs r2, r2 + adds r0, r2, 0 + ands r1, r0 + movs r0, 0x4 + orrs r1, r0 + strb r1, [r4, 0x1] + ldrb r0, [r5] + adds r2, 0x8 + adds r1, r2, 0 + ands r0, r1 + strb r0, [r5] + lsls r0, r6, 16 + asrs r0, 16 + b _080A7A56 + .pool +_080A7A48: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x3F + bls _080A7A04 +_080A7A52: + movs r0, 0x1 + negs r0, r0 +_080A7A56: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end duplicate_obj_of_side_rel2move_in_transparent_mode + + thumb_func_start obj_delete_but_dont_free_vram +obj_delete_but_dont_free_vram: @ 80A7A5C + push {lr} + adds r3, r0, 0 + adds r3, 0x3F + ldrb r1, [r3] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r3] + bl RemoveObjectAndFreeTiles + pop {r0} + bx r0 + thumb_func_end obj_delete_but_dont_free_vram + + thumb_func_start sub_80A7A74 +sub_80A7A74: @ 80A7A74 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r6, 0 + movs r3, 0 + ldr r2, =0x0203841e + movs r0, 0x4 + ldrsh r1, [r2, r0] + movs r4, 0 + ldrsh r0, [r2, r4] + cmp r1, r0 + ble _080A7A8E + movs r3, 0x1 +_080A7A8E: + cmp r1, r0 + bge _080A7A94 + ldr r3, =0x0000ffff +_080A7A94: + movs r0, 0x6 + ldrsh r1, [r2, r0] + movs r4, 0x2 + ldrsh r0, [r2, r4] + cmp r1, r0 + ble _080A7AA2 + movs r6, 0x1 +_080A7AA2: + cmp r1, r0 + bge _080A7AA8 + ldr r6, =0x0000ffff +_080A7AA8: + ldr r0, =0x03005e00 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + movs r1, 0 + strh r1, [r4, 0x8] + ldrh r0, [r2, 0x8] + strh r0, [r4, 0xA] + strh r1, [r4, 0xC] + ldrh r0, [r2] + strh r0, [r4, 0xE] + ldrh r0, [r2, 0x2] + strh r0, [r4, 0x10] + strh r3, [r4, 0x12] + strh r6, [r4, 0x14] + ldrh r0, [r2, 0x4] + strh r0, [r4, 0x16] + ldrh r0, [r2, 0x6] + strh r0, [r4, 0x18] + ldrh r1, [r2, 0x2] + lsls r1, 8 + ldrh r0, [r2] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + ldr r0, =sub_80A7AFC + str r0, [r4] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A7A74 + + thumb_func_start sub_80A7AFC +sub_80A7AFC: @ 80A7AFC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + lsls r0, 16 + asrs r0, 16 + movs r2, 0xA + ldrsh r1, [r4, r2] + cmp r0, r1 + ble _080A7B90 + movs r0, 0 + strh r0, [r4, 0x8] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080A7B4C + ldrh r2, [r4, 0xE] + movs r3, 0xE + ldrsh r1, [r4, r3] + movs r3, 0x16 + ldrsh r0, [r4, r3] + cmp r1, r0 + beq _080A7B60 + ldrh r0, [r4, 0x12] + adds r0, r2, r0 + strh r0, [r4, 0xE] + b _080A7B60 + .pool +_080A7B4C: + ldrh r2, [r4, 0x10] + movs r0, 0x10 + ldrsh r1, [r4, r0] + movs r3, 0x18 + ldrsh r0, [r4, r3] + cmp r1, r0 + beq _080A7B60 + ldrh r0, [r4, 0x14] + adds r0, r2, r0 + strh r0, [r4, 0x10] +_080A7B60: + ldrh r1, [r4, 0x10] + lsls r1, 8 + ldrh r0, [r4, 0xE] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0xE + ldrsh r1, [r4, r0] + movs r2, 0x16 + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _080A7B90 + movs r3, 0x10 + ldrsh r1, [r4, r3] + movs r2, 0x18 + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _080A7B90 + adds r0, r5, 0 + bl move_anim_task_del +_080A7B90: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80A7AFC + + thumb_func_start sub_80A7B98 +sub_80A7B98: @ 80A7B98 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x0203841e + ldrb r0, [r0] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0xFF + bne _080A7BBC + adds r0, r4, 0 + bl move_anim_task_del + b _080A7BE2 + .pool +_080A7BBC: + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r2, =0x02020630 + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + adds r1, r2 + ldrb r1, [r1, 0x5] + lsrs r1, 4 + lsls r1, 4 + ldr r3, =0x00000101 + adds r2, r3, 0 + adds r1, r2 + strh r1, [r0, 0x8] + bl sub_80A7BF4 +_080A7BE2: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A7B98 + + thumb_func_start sub_80A7BF4 +sub_80A7BF4: @ 80A7BF4 + ldr r3, =0x0203841e + ldrh r1, [r3, 0x2] + movs r2, 0 + strh r1, [r0, 0xA] + strh r2, [r0, 0xC] + ldrh r1, [r3, 0x4] + strh r1, [r0, 0xE] + strh r2, [r0, 0x10] + ldrh r1, [r3, 0x6] + strh r1, [r0, 0x12] + strh r2, [r0, 0x14] + ldrh r1, [r3, 0x8] + strh r1, [r0, 0x16] + ldr r1, =sub_80A7C1C + str r1, [r0] + bx lr + .pool + thumb_func_end sub_80A7BF4 + + thumb_func_start sub_80A7C1C +sub_80A7C1C: @ 80A7C1C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + ldrh r0, [r4, 0x10] + adds r0, 0x1 + strh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x12 + ldrsh r1, [r4, r2] + cmp r0, r1 + blt _080A7CAC + movs r0, 0 + strh r0, [r4, 0x10] + movs r1, 0x14 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080A7C78 + ldrh r2, [r4, 0xC] + adds r2, 0x1 + strh r2, [r4, 0xC] + ldrh r0, [r4, 0x8] + lsls r2, 24 + lsrs r2, 24 + ldrh r3, [r4, 0xA] + movs r1, 0xF + bl pal_fade_1 + movs r2, 0xC + ldrsh r1, [r4, r2] + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _080A7CAC + movs r0, 0x1 + strh r0, [r4, 0x14] + b _080A7CAC + .pool +_080A7C78: + ldrh r2, [r4, 0xC] + subs r2, 0x1 + strh r2, [r4, 0xC] + ldrh r0, [r4, 0x8] + lsls r2, 24 + lsrs r2, 24 + ldrh r3, [r4, 0xA] + movs r1, 0xF + bl pal_fade_1 + movs r0, 0xC + ldrsh r1, [r4, r0] + cmp r1, 0 + bne _080A7CAC + ldrh r0, [r4, 0x16] + subs r0, 0x1 + strh r0, [r4, 0x16] + lsls r0, 16 + cmp r0, 0 + beq _080A7CA6 + strh r1, [r4, 0x10] + strh r1, [r4, 0x14] + b _080A7CAC +_080A7CA6: + adds r0, r5, 0 + bl move_anim_task_del +_080A7CAC: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80A7C1C + + thumb_func_start sub_80A7CB4 +sub_80A7CB4: @ 80A7CB4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x0203841e + ldrh r0, [r0] + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + bne _080A7CD8 + adds r0, r4, 0 + bl move_anim_task_del + b _080A7CEE + .pool +_080A7CD8: + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + lsls r1, r2, 4 + ldr r2, =0x00000101 + adds r1, r2 + strh r1, [r0, 0x8] + bl sub_80A7BF4 +_080A7CEE: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A7CB4 + + thumb_func_start sub_80A7CFC +sub_80A7CFC: @ 80A7CFC + push {r4,lr} + adds r3, r0, 0 + adds r4, r1, 0 + lsls r4, 24 + lsrs r4, 24 + movs r1, 0 + strh r1, [r3, 0x16] + strh r1, [r3, 0x18] + strh r1, [r3, 0x1A] + strh r4, [r3, 0x26] + movs r0, 0x80 + lsls r0, 1 + strh r0, [r3, 0x1C] + strh r0, [r3, 0x1E] + strh r1, [r3, 0x20] + adds r0, r3, 0 + adds r0, 0x22 + adds r3, 0x24 + adds r1, r3, 0 + bl sub_80A8048 + adds r0, r4, 0 + movs r1, 0 + bl sub_80A7270 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A7CFC + + thumb_func_start sub_80A7D34 +sub_80A7D34: @ 80A7D34 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r5, =0x02038444 + movs r1, 0x22 + ldrsh r0, [r4, r1] + movs r2, 0x24 + ldrsh r1, [r4, r2] + bl sub_80A8050 + movs r3, 0x16 + ldrsh r1, [r4, r3] + lsls r1, 3 + adds r1, r0, r1 + str r1, [r5] + movs r6, 0 + ldrsh r2, [r1, r6] + ldr r0, =0x00007ffe + cmp r2, r0 + beq _080A7DDC + cmp r2, r0 + bgt _080A7E3C + subs r0, 0x1 + cmp r2, r0 + beq _080A7DE2 + ldrb r0, [r1, 0x5] + cmp r0, 0 + bne _080A7D82 + ldrh r0, [r1] + strh r0, [r4, 0x1C] + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x1E] + ldrb r0, [r1, 0x4] + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x16] + adds r0, 0x1 + strh r0, [r4, 0x16] + adds r0, r1, 0 + adds r0, 0x8 + str r0, [r5] +_080A7D82: + ldr r1, [r5] + ldrh r0, [r1] + ldrh r2, [r4, 0x1C] + adds r0, r2 + strh r0, [r4, 0x1C] + ldrh r0, [r1, 0x2] + ldrh r3, [r4, 0x1E] + adds r0, r3 + strh r0, [r4, 0x1E] + ldrh r0, [r4, 0x20] + ldrb r1, [r1, 0x4] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + movs r6, 0x1C + ldrsh r1, [r4, r6] + movs r3, 0x1E + ldrsh r2, [r4, r3] + ldrh r3, [r4, 0x20] + bl obj_id_set_rotscale + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A7E6C + ldrh r0, [r4, 0x18] + adds r0, 0x1 + strh r0, [r4, 0x18] + lsls r0, 16 + asrs r0, 16 + ldr r1, [r5] + ldrb r1, [r1, 0x5] + cmp r0, r1 + blt _080A7E62 + movs r0, 0 + strh r0, [r4, 0x18] + b _080A7E34 + .pool +_080A7DDC: + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x16] + b _080A7E62 +_080A7DE2: + ldrh r2, [r1, 0x2] + movs r6, 0x2 + ldrsh r0, [r1, r6] + cmp r0, 0 + beq _080A7E34 + ldrh r1, [r4, 0x1A] + movs r3, 0x1A + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _080A7E02 + subs r0, r1, 0x1 + strh r0, [r4, 0x1A] + lsls r0, 16 + cmp r0, 0 + bne _080A7E04 + b _080A7E34 +_080A7E02: + strh r2, [r4, 0x1A] +_080A7E04: + movs r6, 0x16 + ldrsh r0, [r4, r6] + cmp r0, 0 + beq _080A7E62 + ldr r3, =0x02038444 + ldr r5, =0x00007ffd +_080A7E10: + ldrh r2, [r4, 0x16] + subs r1, r2, 0x1 + strh r1, [r4, 0x16] + ldr r0, [r3] + subs r0, 0x8 + str r0, [r3] + movs r6, 0 + ldrsh r0, [r0, r6] + cmp r0, r5 + beq _080A7E60 + lsls r0, r1, 16 + cmp r0, 0 + bne _080A7E10 + b _080A7E62 + .pool +_080A7E34: + ldrh r0, [r4, 0x16] + adds r0, 0x1 + strh r0, [r4, 0x16] + b _080A7E62 +_080A7E3C: + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strh r1, [r0, 0x26] + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A7344 + movs r0, 0 + b _080A7E64 + .pool +_080A7E60: + strh r2, [r4, 0x16] +_080A7E62: + movs r0, 0x1 +_080A7E64: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80A7D34 + + thumb_func_start sub_80A7E6C +sub_80A7E6C: @ 80A7E6C + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_80A7F18 + lsls r0, 16 + lsrs r0, 15 + movs r1, 0x40 + subs r5, r1, r0 + ldr r1, =0x02020630 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r4, r0, r1 + ldrb r1, [r4, 0x3] + lsls r1, 26 + lsrs r1, 27 + lsls r0, r5, 8 + ldr r2, =0x02021bc0 + lsls r1, 3 + adds r1, r2 + movs r2, 0x6 + ldrsh r1, [r1, r2] + bl __divsi3 + cmp r0, 0x80 + ble _080A7EA8 + movs r0, 0x80 +_080A7EA8: + subs r0, r5, r0 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + strh r0, [r4, 0x26] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A7E6C + + thumb_func_start sub_80A7EC0 +sub_80A7EC0: @ 80A7EC0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r0, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, 24 + lsrs r0, 24 + bl sub_80A7F18 + lsls r0, 16 + lsrs r0, 15 + movs r1, 0x40 + subs r5, r1, r0 + ldr r1, =0x02020630 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r4, r0, r1 + ldrb r1, [r4, 0x3] + lsls r1, 26 + lsrs r1, 27 + lsls r0, r5, 8 + ldr r2, =0x02021bc0 + lsls r1, 3 + adds r1, r2 + movs r2, 0x6 + ldrsh r1, [r1, r2] + bl __divsi3 + cmp r0, 0x80 + ble _080A7F00 + movs r0, 0x80 +_080A7F00: + subs r0, r5, r0 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + strh r0, [r4, 0x26] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A7EC0 + + thumb_func_start sub_80A7F18 +sub_80A7F18: @ 80A7F18 + push {r4-r7,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x2E] + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r1, =0x020241e4 + ldr r7, =0x00000181 + ldr r0, =0x020244e4 + adds r6, r5, r0 +_080A7F38: + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, r2 + beq _080A7F42 + b _080A8034 +_080A7F42: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A7F78 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldrh r2, [r0] + ldr r1, =gUnknown_083021D8 + lsls r0, r2, 2 + adds r0, r1 + ldrb r0, [r0, 0x1] + b _080A8042 + .pool +_080A7F78: + lsls r0, r4, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080A7FD8 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r5, 2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2] + cmp r0, 0 + bne _080A7FC0 + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r2, r0, 16 + b _080A7FC2 + .pool +_080A7FC0: + ldrh r2, [r1, 0x2] +_080A7FC2: + cmp r2, r7 + bne _080A7FD0 + ldr r0, =gUnknown_08525F8C + b _080A8018 + .pool +_080A7FD0: + ldr r0, =gUnknown_083021D8 + b _080A8026 + .pool +_080A7FD8: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r5, 2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2] + cmp r0, 0 + bne _080A8010 + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r2, r0, 16 + b _080A8012 + .pool +_080A8010: + ldrh r2, [r1, 0x2] +_080A8012: + cmp r2, r7 + bne _080A8024 + ldr r0, =gUnknown_08525F88 +_080A8018: + ldrb r1, [r6] + adds r1, r0 + ldrb r0, [r1] + b _080A8042 + .pool +_080A8024: + ldr r0, =gUnknown_08300D38 +_080A8026: + lsls r1, r2, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + b _080A8042 + .pool +_080A8034: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x3 + bhi _080A8040 + b _080A7F38 +_080A8040: + movs r0, 0x40 +_080A8042: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80A7F18 + + thumb_func_start sub_80A8048 +sub_80A8048: @ 80A8048 + strh r2, [r0] + asrs r2, 16 + strh r2, [r1] + bx lr + thumb_func_end sub_80A8048 + + thumb_func_start sub_80A8050 +sub_80A8050: @ 80A8050 + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + orrs r0, r1 + bx lr + thumb_func_end sub_80A8050 + + thumb_func_start sub_80A805C +sub_80A805C: @ 80A805C + push {r4-r6,lr} + mov r6, r8 + push {r6} + mov r8, r0 + adds r5, r3, 0 + ldr r0, [sp, 0x14] + ldr r4, [sp, 0x18] + ldr r6, [sp, 0x1C] + lsls r1, 24 + lsrs r1, 24 + lsls r2, 16 + lsrs r2, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r0, 16 + lsrs r0, 16 + lsls r4, 16 + lsrs r4, 16 + lsls r6, 16 + lsrs r6, 16 + mov r3, r8 + strh r6, [r3, 0x18] + strh r1, [r3, 0x26] + strh r2, [r3, 0x1A] + strh r5, [r3, 0x1C] + strh r0, [r3, 0x22] + strh r4, [r3, 0x24] + lsls r0, 16 + asrs r0, 16 + lsls r2, 16 + asrs r2, 16 + subs r0, r2 + adds r1, r6, 0 + bl __divsi3 + mov r1, r8 + strh r0, [r1, 0x1E] + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + subs r4, r5 + adds r0, r4, 0 + adds r1, r6, 0 + bl __divsi3 + mov r3, r8 + strh r0, [r3, 0x20] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80A805C + + thumb_func_start sub_80A80C8 +sub_80A80C8: @ 80A80C8 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x18] + movs r2, 0x18 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _080A80DA + movs r0, 0 + b _080A8136 +_080A80DA: + subs r0, r1, 0x1 + strh r0, [r4, 0x18] + lsls r0, 16 + cmp r0, 0 + beq _080A80F4 + ldrh r0, [r4, 0x1E] + ldrh r3, [r4, 0x1A] + adds r0, r3 + strh r0, [r4, 0x1A] + ldrh r0, [r4, 0x20] + ldrh r1, [r4, 0x1C] + adds r0, r1 + b _080A80FA +_080A80F4: + ldrh r0, [r4, 0x22] + strh r0, [r4, 0x1A] + ldrh r0, [r4, 0x24] +_080A80FA: + strh r0, [r4, 0x1C] + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x1A + ldrsh r1, [r4, r2] + movs r3, 0x1C + ldrsh r2, [r4, r3] + movs r3, 0 + bl obj_id_set_rotscale + movs r0, 0x18 + ldrsh r3, [r4, r0] + cmp r3, 0 + beq _080A8124 + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A7E6C + b _080A8134 +_080A8124: + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r3, [r0, 0x26] +_080A8134: + ldrb r0, [r4, 0x18] +_080A8136: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A80C8 + + thumb_func_start sub_80A8140 +sub_80A8140: @ 80A8140 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x0203841a + ldrb r0, [r0] + movs r1, 0 + cmp r0, 0x1E + bls _080A815E + movs r1, 0x1 + cmp r0, 0x64 + bls _080A815E + movs r1, 0x3 + cmp r0, 0xC8 + bhi _080A815E + movs r1, 0x2 +_080A815E: + ldr r0, =0x0203841e + strh r1, [r0, 0xE] + adds r0, r2, 0 + bl move_anim_task_del + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A8140 + + thumb_func_start sub_80A8174 +sub_80A8174: @ 80A8174 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r4, r0, 24 + adds r7, r4, 0 + ldr r6, =0x02038437 + ldrb r0, [r6] + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A81B4 + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x3 + adds r2, r4, 0 + ands r2, r0 + lsls r2, 2 + ldrb r3, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0x5] +_080A81B4: + ldr r0, =0x02038436 + mov r8, r0 + ldrb r0, [r0] + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A81EC + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + mov r3, r8 + ldrb r0, [r3] + adds r0, r1 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x3 + adds r2, r4, 0 + ands r2, r0 + lsls r2, 2 + ldrb r3, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0x5] +_080A81EC: + ldrb r0, [r6] + movs r5, 0x2 + eors r0, r5 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A8224 + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldrb r0, [r6] + eors r0, r5 + adds r0, r1 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x3 + adds r2, r4, 0 + ands r2, r0 + lsls r2, 2 + ldrb r3, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0x5] +_080A8224: + mov r1, r8 + ldrb r0, [r1] + eors r0, r5 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A825C + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + mov r3, r8 + ldrb r0, [r3] + eors r0, r5 + adds r0, r1 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x3 + ands r7, r0 + lsls r3, r7, 2 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x5] +_080A825C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A8174 + + thumb_func_start sub_80A8278 +sub_80A8278: @ 80A8278 + push {r4-r6,lr} + movs r5, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r5, r0 + bge _080A82D2 + ldr r6, =0x02020630 +_080A8286: + lsls r0, r5, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A82C8 + adds r0, r4, 0 + bl sub_80A82E4 + ldr r3, =0x020241e4 + adds r3, r5, r3 + ldrb r2, [r3] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r6 + adds r1, 0x43 + strb r0, [r1] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r2, [r0, 0x5] + movs r3, 0xD + negs r3, r3 + adds r1, r3, 0 + ands r2, r1 + movs r1, 0x8 + orrs r2, r1 + strb r2, [r0, 0x5] +_080A82C8: + adds r5, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r5, r0 + blt _080A8286 +_080A82D2: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A8278 + + thumb_func_start sub_80A82E4 +sub_80A82E4: @ 80A82E4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A8300 + cmp r4, 0x2 + bne _080A82FC + movs r0, 0x1E + b _080A8320 +_080A82FC: + movs r0, 0x28 + b _080A8320 +_080A8300: + adds r0, r4, 0 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1E + cmp r0, 0 + beq _080A831E + movs r1, 0x14 + cmp r0, 0x2 + beq _080A831E + movs r1, 0x32 + cmp r0, 0x1 + bne _080A831E + movs r1, 0x28 +_080A831E: + adds r0, r1, 0 +_080A8320: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80A82E4 + + thumb_func_start sub_80A8328 +sub_80A8328: @ 80A8328 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A8344 + movs r0, 0x2 + b _080A835C +_080A8344: + cmp r4, 0 + beq _080A834C + cmp r4, 0x3 + bne _080A8350 +_080A834C: + movs r0, 0x2 + b _080A8352 +_080A8350: + movs r0, 0x1 +_080A8352: + movs r1, 0x4 + bl sub_8118140 + lsls r0, 24 + lsrs r0, 24 +_080A835C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80A8328 + + thumb_func_start battle_get_per_side_status_permutated +battle_get_per_side_status_permutated: @ 80A8364 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A838A + adds r0, r4, 0 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _080A8386 + cmp r0, 0x3 + bne _080A838A +_080A8386: + movs r0, 0x2 + b _080A838C +_080A838A: + movs r0, 0x1 +_080A838C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end battle_get_per_side_status_permutated + + thumb_func_start sub_80A8394 +sub_80A8394: @ 80A8394 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + ldr r4, [sp, 0x30] + ldr r5, [sp, 0x34] + ldr r6, [sp, 0x38] + mov r8, r6 + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + lsls r2, 24 + lsrs r7, r2, 24 + lsls r3, 16 + lsrs r3, 16 + mov r10, r3 + lsls r4, 16 + lsrs r4, 16 + str r4, [sp, 0x4] + lsls r5, 24 + lsrs r5, 24 + str r5, [sp, 0x8] + lsls r0, r7, 3 + ldr r1, =gUnknown_08525FC0 + adds r0, r1 + bl LoadObjectPic + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0xC] + ldr r1, =gUnknown_08525F90 + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x2] + bl AllocObjectPalette + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =0x020244d4 + ldr r0, [r4] + cmp r0, 0 + beq _080A8412 + movs r1, 0xBE + lsls r1, 1 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + bne _080A8412 + movs r0, 0x80 + lsls r0, 6 + bl AllocZeroed + ldr r1, [r4] + movs r2, 0xBE + lsls r2, 1 + adds r1, r2 + str r0, [r1] +_080A8412: + mov r3, r9 + cmp r3, 0 + bne _080A84B0 + adds r0, r6, 0 + ldr r1, [sp, 0x3C] + mov r2, r8 + bl species_and_otid_get_pal + lsls r1, r5, 20 + movs r2, 0x80 + lsls r2, 17 + adds r1, r2 + lsrs r1, 16 + movs r2, 0x20 + bl decompress_palette + ldr r3, [sp, 0x44] + cmp r3, 0x1 + beq _080A845E + ldr r0, [sp, 0x40] + lsls r1, r0, 24 + lsrs r1, 24 + movs r0, 0x5 + bl sub_80688F8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080A845E + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0] + ldr r2, [sp, 0x40] + lsls r0, r2, 2 + adds r0, r1 + ldrh r0, [r0, 0x2] + cmp r0, 0 + beq _080A8488 +_080A845E: + lsls r0, r6, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r1, [r1] + movs r3, 0xBE + lsls r3, 1 + adds r1, r3 + ldr r1, [r1] + movs r2, 0x1 + b _080A850A + .pool +_080A8488: + lsls r0, r6, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r1, [r1] + movs r2, 0xBE + lsls r2, 1 + adds r1, r2 + ldr r1, [r1] + movs r2, 0x1 + str r2, [sp] + adds r2, r6, 0 + mov r3, r8 + bl DecompressMonPic_2 + b _080A8540 + .pool +_080A84B0: + adds r0, r6, 0 + ldr r1, [sp, 0x3C] + mov r2, r8 + bl species_and_otid_get_pal + lsls r1, r5, 20 + movs r3, 0x80 + lsls r3, 17 + adds r1, r3 + lsrs r1, 16 + movs r2, 0x20 + bl decompress_palette + ldr r0, [sp, 0x44] + cmp r0, 0x1 + beq _080A84F6 + ldr r2, [sp, 0x40] + lsls r1, r2, 24 + lsrs r1, 24 + movs r0, 0x5 + bl sub_80688F8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080A84F6 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0] + ldr r3, [sp, 0x40] + lsls r0, r3, 2 + adds r0, r1 + ldrh r2, [r0, 0x2] + cmp r2, 0 + beq _080A8524 +_080A84F6: + lsls r0, r6, 3 + ldr r1, =gMonBackPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r1, [r1] + movs r2, 0xBE + lsls r2, 1 + adds r1, r2 + ldr r1, [r1] + movs r2, 0 +_080A850A: + str r2, [sp] + adds r2, r6, 0 + mov r3, r8 + bl DecompressMonPicWithoutDuplicatingDeoxysTiles + b _080A8540 + .pool +_080A8524: + lsls r0, r6, 3 + ldr r1, =gMonBackPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r1, [r1] + movs r3, 0xBE + lsls r3, 1 + adds r1, r3 + ldr r1, [r1] + str r2, [sp] + adds r2, r6, 0 + mov r3, r8 + bl DecompressMonPic_2 +_080A8540: + ldr r5, =0x020244d4 + ldr r0, [r5] + movs r4, 0xBE + lsls r4, 1 + adds r0, r4 + ldr r0, [r0] + ldr r2, [sp, 0xC] + lsls r1, r2, 5 + ldr r3, =0x06010000 + adds r1, r3 + movs r2, 0x80 + lsls r2, 4 + movs r3, 0x1 + bl RequestDma3Copy + ldr r0, [r5] + adds r0, r4 + ldr r0, [r0] + bl Free + ldr r0, [r5] + adds r0, r4 + movs r1, 0 + str r1, [r0] + mov r0, r9 + cmp r0, 0 + bne _080A85A0 + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 3 + ldr r1, =gUnknown_08525F90 + adds r0, r1 + mov r2, r10 + lsls r1, r2, 16 + asrs r1, 16 + ldr r3, =gUnknown_08300D38 + b _080A85B2 + .pool +_080A85A0: + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 3 + ldr r1, =gUnknown_08525F90 + adds r0, r1 + mov r2, r10 + lsls r1, r2, 16 + asrs r1, 16 + ldr r3, =gUnknown_083021D8 +_080A85B2: + lsls r2, r6, 2 + adds r2, r3 + ldrb r2, [r2, 0x1] + ldr r3, [sp, 0x4] + adds r2, r3 + lsls r2, 16 + asrs r2, 16 + ldr r3, [sp, 0x8] + bl AddObjectToFront + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A85EE + ldr r3, =0x02020630 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r1, r3, 0 + adds r1, 0x10 + adds r1, r0, r1 + ldr r2, =gUnknown_082FF6C0 + str r2, [r1] + adds r0, r3 + movs r1, 0 + bl StartObjectRotScalAnim +_080A85EE: + adds r0, r4, 0 + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A8394 + + thumb_func_start sub_80A8610 +sub_80A8610: @ 80A8610 + push {lr} + bl RemoveObjectAndFreeResources + pop {r0} + bx r0 + thumb_func_end sub_80A8610 + + thumb_func_start sub_80A861C +sub_80A861C: @ 80A861C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A86C4 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0, 0x18] + ldrb r1, [r2, 0x4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080A8654 + ldrh r7, [r2, 0x2] + ldr r2, [r2, 0x10] + b _080A8658 + .pool +_080A8654: + ldrh r7, [r2] + ldr r2, [r2, 0x8] +_080A8658: + cmp r7, 0xC9 + bne _080A86A4 + movs r0, 0xC0 + lsls r0, 18 + ands r0, r2 + lsrs r0, 18 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r2 + lsrs r1, 12 + orrs r0, r1 + movs r1, 0xC0 + lsls r1, 2 + ands r1, r2 + lsrs r1, 6 + orrs r0, r1 + movs r1, 0x3 + ands r1, r2 + orrs r0, r1 + movs r1, 0x1C + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _080A8690 + movs r0, 0xC9 + b _080A869A +_080A8690: + movs r1, 0xCE + lsls r1, 1 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 +_080A869A: + lsls r1, r0, 2 + ldr r0, =gUnknown_083021D8 + b _080A8864 + .pool +_080A86A4: + ldr r0, =0x00000181 + cmp r7, r0 + bne _080A86AC + b _080A8834 +_080A86AC: + movs r0, 0xCE + lsls r0, 1 + cmp r7, r0 + bhi _080A877C + lsls r1, r7, 2 + ldr r0, =gUnknown_083021D8 + b _080A8864 + .pool +_080A86C4: + mov r0, r8 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080A8790 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0] + mov r1, r8 + lsls r2, r1, 2 + adds r1, r2, r0 + ldrh r0, [r1, 0x2] + cmp r0, 0 + bne _080A871C + ldr r0, =0x0202406e + mov r1, r8 + lsls r4, r1, 1 + adds r4, r0 + ldrh r0, [r4] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x020244ec + adds r0, r5 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r7, r0, 16 + ldrh r0, [r4] + muls r0, r6 + adds r0, r5 + movs r1, 0 + bl pokemon_getattr + adds r2, r0, 0 + b _080A8724 + .pool +_080A871C: + ldrh r7, [r1, 0x2] + ldr r0, =0x020244bc + adds r0, r2, r0 + ldr r2, [r0] +_080A8724: + cmp r7, 0xC9 + bne _080A8774 + movs r0, 0xC0 + lsls r0, 18 + ands r0, r2 + lsrs r0, 18 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r2 + lsrs r1, 12 + orrs r0, r1 + movs r1, 0xC0 + lsls r1, 2 + ands r1, r2 + lsrs r1, 6 + orrs r0, r1 + movs r1, 0x3 + ands r1, r2 + orrs r0, r1 + movs r1, 0x1C + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _080A8760 + movs r0, 0xC9 + b _080A876A + .pool +_080A8760: + movs r1, 0xCE + lsls r1, 1 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 +_080A876A: + lsls r1, r0, 2 + ldr r0, =gUnknown_083021D8 + b _080A8864 + .pool +_080A8774: + movs r0, 0xCE + lsls r0, 1 + cmp r7, r0 + bls _080A8784 +_080A877C: + ldr r4, =gUnknown_083021D8 + b _080A8866 + .pool +_080A8784: + lsls r1, r7, 2 + ldr r0, =gUnknown_083021D8 + b _080A8864 + .pool +_080A8790: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0] + mov r1, r8 + lsls r2, r1, 2 + adds r1, r2, r0 + ldrh r0, [r1, 0x2] + cmp r0, 0 + bne _080A87DC + ldr r0, =0x0202406e + mov r1, r8 + lsls r4, r1, 1 + adds r4, r0 + ldrh r0, [r4] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x02024744 + adds r0, r5 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r7, r0, 16 + ldrh r0, [r4] + muls r0, r6 + adds r0, r5 + movs r1, 0 + bl pokemon_getattr + adds r2, r0, 0 + b _080A87E4 + .pool +_080A87DC: + ldrh r7, [r1, 0x2] + ldr r0, =0x020244bc + adds r0, r2, r0 + ldr r2, [r0] +_080A87E4: + cmp r7, 0xC9 + bne _080A882E + movs r0, 0xC0 + lsls r0, 18 + ands r0, r2 + lsrs r0, 18 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r2 + lsrs r1, 12 + orrs r0, r1 + movs r1, 0xC0 + lsls r1, 2 + ands r1, r2 + lsrs r1, 6 + orrs r0, r1 + movs r1, 0x3 + ands r1, r2 + orrs r0, r1 + movs r1, 0x1C + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _080A8820 + movs r0, 0xC9 + b _080A882A + .pool +_080A8820: + movs r1, 0xCE + lsls r1, 1 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 +_080A882A: + lsls r1, r0, 2 + b _080A8862 +_080A882E: + ldr r0, =0x00000181 + cmp r7, r0 + bne _080A8850 +_080A8834: + ldr r0, =0x020244e4 + add r0, r8 + ldrb r0, [r0] + lsls r0, 2 + ldr r1, =gUnknown_08525F78 + adds r4, r0, r1 + b _080A8866 + .pool +_080A8850: + movs r0, 0xCE + lsls r0, 1 + cmp r7, r0 + bls _080A8860 + ldr r4, =gUnknown_08300D38 + b _080A8866 + .pool +_080A8860: + lsls r1, r7, 2 +_080A8862: + ldr r0, =gUnknown_08300D38 +_080A8864: + adds r4, r1, r0 +_080A8866: + mov r0, r9 + cmp r0, 0x6 + bhi _080A8916 + lsls r0, 2 + ldr r1, =_080A8880 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080A8880: + .4byte _080A889C + .4byte _080A88A6 + .4byte _080A88D2 + .4byte _080A88EA + .4byte _080A88AE + .4byte _080A88C0 + .4byte _080A8902 +_080A889C: + ldrb r1, [r4] + movs r0, 0xF + ands r0, r1 + lsls r0, 3 + b _080A8918 +_080A88A6: + ldrb r0, [r4] + lsrs r0, 4 + lsls r0, 3 + b _080A8918 +_080A88AE: + mov r0, r8 + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r4] + lsrs r1, 4 + b _080A88E4 +_080A88C0: + mov r0, r8 + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r4] + lsrs r1, 4 + b _080A88FC +_080A88D2: + mov r0, r8 + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrb r2, [r4] + movs r1, 0xF + ands r1, r2 +_080A88E4: + lsls r1, 2 + subs r0, r1 + b _080A8918 +_080A88EA: + mov r0, r8 + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrb r2, [r4] + movs r1, 0xF + ands r1, r2 +_080A88FC: + lsls r1, 2 + adds r0, r1 + b _080A8918 +_080A8902: + mov r0, r8 + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x1F + ldrb r1, [r4, 0x1] + subs r0, r1 + b _080A8918 +_080A8916: + movs r0, 0 +_080A8918: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80A861C + + thumb_func_start sub_80A8924 +sub_80A8924: @ 80A8924 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r9, r2 + mov r10, r3 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + cmp r1, 0 + bne _080A8942 + movs r5, 0 + movs r6, 0x1 + b _080A8946 +_080A8942: + movs r5, 0x2 + movs r6, 0x3 +_080A8946: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r7, r0, 24 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _080A8998 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A8998 + movs r0, 0x2 + eors r4, r0 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r3, r0, 24 + mov r0, r8 + lsls r1, r0, 16 + lsls r2, r7, 16 + b _080A89A4 +_080A8998: + mov r0, r8 + lsls r1, r0, 16 + lsrs r5, r1, 16 + lsls r0, r7, 16 + lsrs r3, r0, 16 + adds r2, r0, 0 +_080A89A4: + asrs r0, r1, 16 + adds r0, r5 + asrs r0, 1 + mov r1, r9 + strh r0, [r1] + asrs r0, r2, 16 + adds r0, r3 + asrs r0, 1 + mov r1, r10 + strh r0, [r1] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80A8924 + + thumb_func_start sub_80A89C8 +sub_80A89C8: @ 80A89C8 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x4 + lsls r6, r1, 24 + lsrs r6, 24 + ldr r0, =DummyObjectCallback + mov r10, r0 + bl object_new_hidden_with_callback + mov r8, r0 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, =0x02020630 + mov r9, r0 + mov r0, r8 + lsls r3, r0, 4 + add r3, r8 + lsls r3, 2 + mov r0, r9 + adds r5, r3, r0 + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + add r4, r9 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x44 + str r3, [sp] + bl memcpy + adds r2, r5, 0 + adds r2, 0x3F + ldrb r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + ldrb r2, [r5, 0x5] + movs r1, 0xD + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r5, 0x5] + ldrb r0, [r5, 0x1] + ands r1, r0 + movs r0, 0x8 + orrs r1, r0 + strb r1, [r5, 0x1] + ldrh r1, [r4, 0x4] + lsls r1, 22 + lsrs r1, 22 + ldrh r2, [r5, 0x4] + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x4] + movs r0, 0x1C + add r9, r0 + ldr r3, [sp] + add r3, r9 + mov r0, r10 + str r0, [r3] + mov r0, r8 + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A89C8 + + thumb_func_start sub_80A8A6C +sub_80A8A6C: @ 80A8A6C + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6838 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080A8AAC + ldr r2, =0x0203841e + ldrh r0, [r4, 0x20] + ldrh r1, [r2] + subs r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r2, 0x6] + negs r0, r0 + strh r0, [r2, 0x6] + adds r3, r4, 0 + adds r3, 0x3F + ldrb r0, [r3] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r3] + adds r1, r2, 0 + b _080A8AB6 + .pool +_080A8AAC: + ldr r1, =0x0203841e + ldrh r0, [r1] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] +_080A8AB6: + ldrh r0, [r1, 0x2] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x2E] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x30] + ldrh r0, [r1, 0x8] + strh r0, [r4, 0x34] + ldrh r0, [r1, 0xA] + strh r0, [r4, 0x38] + ldr r1, =move_anim_8074EE0 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A66DC + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A8A6C + + thumb_func_start sub_80A8AEC +sub_80A8AEC: @ 80A8AEC + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080A8B1C + ldr r2, =0x0203841e + ldrh r0, [r4, 0x20] + ldrh r1, [r2] + subs r0, r1 + strh r0, [r4, 0x20] + movs r1, 0x6 + ldrsh r0, [r2, r1] + negs r0, r0 + strh r0, [r2, 0x6] + adds r1, r2, 0 + b _080A8B26 + .pool +_080A8B1C: + ldr r1, =0x0203841e + ldrh r0, [r1] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] +_080A8B26: + ldrh r0, [r1, 0x2] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x2E] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x30] + ldrh r0, [r1, 0x8] + strh r0, [r4, 0x34] + ldrh r0, [r1, 0xA] + strh r0, [r4, 0x38] + ldrb r1, [r1, 0xC] + adds r0, r4, 0 + bl StartObjectImageAnim + ldr r1, =move_anim_8074EE0 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A66DC + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A8AEC + + thumb_func_start sub_80A8B64 +sub_80A8B64: @ 80A8B64 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6838 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080A8B90 + ldr r0, =0x0203841e + ldrh r1, [r4, 0x20] + ldrh r2, [r0] + subs r1, r2 + strh r1, [r4, 0x20] + b _080A8B9C + .pool +_080A8B90: + ldr r1, =0x0203841e + ldrh r0, [r1] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + adds r0, r1, 0 +_080A8B9C: + ldrh r0, [r0, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldr r0, =sub_80A67D8 + str r0, [r4, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A8B64 + + thumb_func_start sub_80A8BC4 +sub_80A8BC4: @ 80A8BC4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r5, r1, r0 + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + movs r6, 0 + strh r0, [r5, 0x8] + ldr r7, =0x02038436 + ldrb r0, [r7] + bl battle_side_get_owner + lsls r0, 24 + movs r1, 0x8 + cmp r0, 0 + beq _080A8BF8 + movs r0, 0x8 + negs r0, r0 + adds r1, r0, 0 +_080A8BF8: + strh r1, [r5, 0xA] + strh r6, [r5, 0xC] + strh r6, [r5, 0xE] + ldr r4, =0x02020630 + movs r0, 0x8 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x24] + ldrh r2, [r5, 0x8] + subs r1, r2 + strh r1, [r0, 0x24] + ldr r0, =0x00002771 + bl AllocObjectPalette + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x10] + strh r6, [r5, 0x12] + movs r1, 0x10 + ldrsh r0, [r5, r1] + adds r0, 0x10 + lsls r0, 20 + lsrs r6, r0, 16 + movs r0, 0x8 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x5] + lsrs r0, 4 + adds r0, 0x10 + lsls r4, r0, 4 + ldrb r0, [r7] + bl sub_80A82E4 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x14] + cmp r0, 0x14 + beq _080A8C54 + cmp r0, 0x28 + bne _080A8C68 +_080A8C54: + movs r0, 0x2 + b _080A8C6A + .pool +_080A8C68: + movs r0, 0x3 +_080A8C6A: + strh r0, [r5, 0x14] + lsls r0, r4, 1 + ldr r1, =0x02037714 + adds r0, r1 + lsls r1, r6, 1 + ldr r2, =0x02037b14 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet + ldr r0, =0x0203841e + ldrb r2, [r0, 0x2] + ldrh r3, [r0] + adds r0, r6, 0 + movs r1, 0x10 + bl pal_fade_1 + ldr r0, =sub_80A8CAC + str r0, [r5] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A8BC4 + + thumb_func_start sub_80A8CAC +sub_80A8CAC: @ 80A8CAC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080A8D10 + cmp r0, 0x1 + bgt _080A8CD4 + cmp r0, 0 + beq _080A8CDA + b _080A8D6C + .pool +_080A8CD4: + cmp r0, 0x2 + beq _080A8D58 + b _080A8D6C +_080A8CDA: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80A8D78 + ldr r2, =0x02020630 + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r4, 0xA] + ldrh r2, [r0, 0x24] + adds r1, r2 + strh r1, [r0, 0x24] + ldrh r1, [r4, 0xE] + adds r0, r1, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + bne _080A8D6C + strh r1, [r4, 0xE] + b _080A8D4A + .pool +_080A8D10: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80A8D78 + ldr r3, =0x02020630 + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x24] + ldrh r2, [r4, 0xA] + subs r1, r2 + strh r1, [r0, 0x24] + ldrh r0, [r4, 0xE] + subs r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + asrs r2, r0, 16 + cmp r2, 0 + bne _080A8D6C + movs r1, 0x8 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + strh r2, [r1, 0x24] +_080A8D4A: + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + b _080A8D6C + .pool +_080A8D58: + movs r2, 0x12 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _080A8D6C + ldr r0, =0x00002771 + bl FreeObjectPaletteByTag + adds r0, r5, 0 + bl move_anim_task_del +_080A8D6C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A8CAC + + thumb_func_start sub_80A8D78 +sub_80A8D78: @ 80A8D78 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + movs r0, 0 + bl duplicate_obj_of_side_rel2move_in_transparent_mode + lsls r0, 16 + lsrs r7, r0, 16 + asrs r0, 16 + cmp r0, 0 + blt _080A8DE8 + ldr r5, =0x02020630 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + adds r3, r4, r5 + movs r0, 0x3 + ldrb r1, [r6, 0x14] + ands r1, r0 + lsls r1, 2 + ldrb r2, [r3, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x5] + ldrb r1, [r6, 0x10] + lsls r1, 4 + movs r2, 0xF + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x5] + movs r0, 0x8 + strh r0, [r3, 0x2E] + mov r0, r8 + strh r0, [r3, 0x30] + strh r7, [r3, 0x32] + movs r0, 0x8 + ldrsh r1, [r6, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrh r0, [r0, 0x24] + strh r0, [r3, 0x24] + adds r5, 0x1C + adds r4, r5 + ldr r0, =sub_80A8DFC + str r0, [r4] + ldrh r0, [r6, 0x12] + adds r0, 0x1 + strh r0, [r6, 0x12] +_080A8DE8: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A8D78 + + thumb_func_start sub_80A8DFC +sub_80A8DFC: @ 80A8DFC + push {lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x2E] + subs r0, 0x1 + strh r0, [r3, 0x2E] + lsls r0, 16 + cmp r0, 0 + bne _080A8E26 + ldr r2, =0x03005e00 + movs r0, 0x30 + ldrsh r1, [r3, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r0, 0x12] + subs r1, 0x1 + strh r1, [r0, 0x12] + adds r0, r3, 0 + bl obj_delete_but_dont_free_vram +_080A8E26: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A8DFC + + thumb_func_start sub_80A8E30 +sub_80A8E30: @ 80A8E30 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080A8E68 + movs r0, 0x5 + b _080A8E6A + .pool +_080A8E68: + ldr r0, =0x0000fff6 +_080A8E6A: + strh r0, [r5, 0x2E] + ldr r0, =0x0000ffd8 + strh r0, [r5, 0x30] + ldr r0, =sub_80A8E88 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A8E30 + + thumb_func_start sub_80A8E88 +sub_80A8E88: @ 80A8E88 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + ldrh r1, [r4, 0x32] + adds r0, r1 + strh r0, [r4, 0x32] + ldrh r5, [r4, 0x30] + ldrh r2, [r4, 0x34] + adds r0, r5, r2 + strh r0, [r4, 0x34] + movs r1, 0x32 + ldrsh r0, [r4, r1] + movs r1, 0xA + bl __divsi3 + strh r0, [r4, 0x24] + movs r2, 0x34 + ldrsh r0, [r4, r2] + movs r1, 0xA + bl __divsi3 + strh r0, [r4, 0x26] + lsls r0, r5, 16 + asrs r0, 16 + movs r1, 0x14 + negs r1, r1 + cmp r0, r1 + bge _080A8EC4 + adds r0, r5, 0x1 + strh r0, [r4, 0x30] +_080A8EC4: + movs r1, 0x22 + ldrsh r0, [r4, r1] + movs r2, 0x26 + ldrsh r1, [r4, r2] + adds r0, r1 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + bge _080A8EDC + adds r0, r4, 0 + bl move_anim_8072740 +_080A8EDC: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80A8E88 + + thumb_func_start sub_80A8EE4 +sub_80A8EE4: @ 80A8EE4 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =0x0203841e + ldrh r0, [r5, 0x4] + strh r0, [r4, 0x2E] + ldrh r0, [r5, 0x8] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x32] + ldrh r0, [r5, 0xA] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x36] + ldr r0, =0x02038437 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080A8F24 + ldrh r0, [r5, 0x8] + adds r0, 0x1E + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r5, 0xA] + subs r0, 0x14 + b _080A8F32 + .pool +_080A8F24: + ldrh r0, [r5, 0x8] + subs r0, 0x1E + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r5, 0xA] + subs r0, 0x50 +_080A8F32: + strh r0, [r4, 0x22] + ldr r0, =sub_80A6EEC + str r0, [r4, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A8EE4 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/emerald.s b/asm/rom_80A92F4.s similarity index 58% rename from asm/emerald.s rename to asm/rom_80A92F4.s index 24499cc9ad..9ba4b889db 100644 --- a/asm/emerald.s +++ b/asm/rom_80A92F4.s @@ -3,300879 +3,8 @@ .syntax unified - .global Start - .text - .arm - -Start: - .include "asm/crt0.s" - .include "asm/main.s" - .include "genasm/malloc.s" - .include "asm/dma3_manager.s" - .include "genasm/gpu_regs.s" - .include "asm/gpu_bg.s" - .include "asm/pixel_buffer.s" - .include "asm/window.s" - .include "asm/text_renderer.s" - .include "asm/gpu_obj.s" - .include "asm/string_util.s" - - thumb_func_start sub_80093CC -sub_80093CC: @ 80093CC - push {lr} - bl sub_800B488 - bl sub_800E700 - bl sub_800BEC0 - ldr r1, =0x00008001 - cmp r0, r1 - beq _080093F4 - bl sub_800B4A4 - bl sub_80097E8 - bl RestoreSerialTimer3IntrHandlers - movs r0, 0 - b _080093FE - .pool -_080093F4: - bl rfu_REQ_stopMode - bl rfu_waitREQComplete - movs r0, 0x1 -_080093FE: - pop {r1} - bx r1 - thumb_func_end sub_80093CC - - thumb_func_start sub_8009404 -sub_8009404: @ 8009404 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl remove_task - pop {r0} - bx r0 - thumb_func_end sub_8009404 - - thumb_func_start sub_8009414 -sub_8009414: @ 8009414 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - ldr r4, [sp, 0x18] - lsls r5, 24 - lsrs r5, 24 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - lsls r2, 24 - lsrs r6, r2, 24 - lsls r3, 24 - lsrs r7, r3, 24 - lsls r4, 16 - lsrs r4, 16 - ldr r0, =gUnknown_082ECF20 - lsls r1, r5, 4 - movs r2, 0x20 - bl gpu_pal_apply - ldr r3, =0x040000d4 - ldr r0, =gUnknown_082ECF40 - str r0, [r3] - lsls r2, r7, 14 - lsls r0, r4, 5 - movs r1, 0xC0 - lsls r1, 19 - adds r0, r1 - adds r2, r0 - str r2, [r3, 0x4] - ldr r0, =0x80000110 - str r0, [r3, 0x8] - ldr r0, [r3, 0x8] - ldr r0, =0x03003130 - str r6, [r0] - str r5, [r0, 0x4] - str r4, [r0, 0x8] - mov r0, r8 - cmp r0, 0x2 - beq _0800949E - cmp r0, 0x2 - bgt _08009484 - cmp r0, 0x1 - beq _0800948C - b _080094C0 - .pool -_08009484: - mov r0, r8 - cmp r0, 0x3 - beq _080094B0 - b _080094C0 -_0800948C: - lsls r1, r6, 8 - movs r0, 0x1 - orrs r1, r0 - lsls r0, r7, 2 - orrs r1, r0 - movs r0, 0xA - bl SetGpuReg - b _080094C0 -_0800949E: - lsls r1, r6, 8 - movs r0, 0x1 - orrs r1, r0 - lsls r0, r7, 2 - orrs r1, r0 - movs r0, 0xC - bl SetGpuReg - b _080094C0 -_080094B0: - lsls r1, r6, 8 - movs r0, 0x1 - orrs r1, r0 - lsls r0, r7, 2 - orrs r1, r0 - movs r0, 0xE - bl SetGpuReg -_080094C0: - mov r0, r8 - lsls r4, r0, 2 - adds r0, r4, 0 - adds r0, 0x10 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl SetGpuReg - adds r4, 0x12 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0 - bl SetGpuReg - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8009414 - - thumb_func_start sub_80094EC -sub_80094EC: @ 80094EC - push {r4-r6,lr} - mov r6, r8 - push {r6} - mov r8, r0 - adds r6, r1, 0 - adds r4, r2, 0 - adds r5, r3, 0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r6, 24 - lsrs r6, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_082ECF20 - mov r2, r8 - lsls r1, r2, 4 - movs r2, 0x20 - bl gpu_pal_apply - ldr r2, =0x040000d4 - ldr r0, =gUnknown_082ECF40 - str r0, [r2] - lsls r0, r5, 14 - movs r1, 0xC0 - lsls r1, 19 - adds r0, r1 - str r0, [r2, 0x4] - ldr r0, =0x80000110 - str r0, [r2, 0x8] - ldr r0, [r2, 0x8] - ldr r0, =0x03003130 - str r4, [r0] - mov r1, r8 - str r1, [r0, 0x4] - movs r1, 0 - str r1, [r0, 0x8] - ldr r0, =gUnknown_082ED1D0 - adds r6, r0 - ldrb r0, [r6] - lsls r4, 8 - lsls r5, 2 - orrs r4, r5 - adds r1, r4, 0 - bl SetGpuReg - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80094EC - - thumb_func_start sub_8009570 -sub_8009570: @ 8009570 - push {r4,lr} - sub sp, 0x4 - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - bl clear_tasks - ldr r0, =sub_80096BC - bl SetVBlankCallback - bl sub_800A2E0 - ldr r1, =0x020229c6 - ldr r2, =0x00001111 - adds r0, r2, 0 - strh r0, [r1] - bl sub_8009734 - ldr r0, =0x030022c0 - ldrh r0, [r0, 0x24] - bl SeedRng - movs r4, 0 -_080095A0: - bl GenerateRandomNumber - ldr r1, =0x03005d90 - ldr r1, [r1] - adds r1, 0xA - adds r1, r4 - strb r0, [r1] - adds r4, 0x1 - cmp r4, 0x3 - ble _080095A0 - movs r4, 0 - str r4, [sp] - movs r0, 0 - movs r1, 0x2 - movs r2, 0x4 - movs r3, 0 - bl sub_8009414 - movs r1, 0xAA - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - ldr r0, =sub_8009404 - movs r1, 0 - bl AddTask - bl RunActiveTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - ldr r0, =0x03000d60 - str r4, [r0] - bl sub_8009638 - ldr r0, =task00_link_test - movs r1, 0 - bl AddTask - ldr r0, =c2_08009A8C - bl SetMainCallback2 - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8009570 - - thumb_func_start sub_8009628 -sub_8009628: @ 8009628 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x020229cc - strh r0, [r1, 0x18] - bx lr - .pool - thumb_func_end sub_8009628 - - thumb_func_start sub_8009638 -sub_8009638: @ 8009638 - push {r4,r5,lr} - ldr r5, =0x020229cc - ldr r4, =0x03005d90 - ldr r1, [r4] - ldrb r2, [r1, 0xA] - ldrb r0, [r1, 0xB] - lsls r0, 8 - orrs r2, r0 - ldrb r0, [r1, 0xC] - lsls r0, 16 - orrs r2, r0 - ldrb r0, [r1, 0xD] - lsls r0, 24 - orrs r2, r0 - str r2, [r5, 0x4] - adds r0, r5, 0 - adds r0, 0x8 - bl CopyString - ldr r0, [r4] - ldrb r0, [r0, 0x8] - strb r0, [r5, 0x13] - ldr r0, =0x020229c6 - ldrh r0, [r0] - str r0, [r5, 0x14] - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - strh r0, [r5, 0x1A] - ldr r0, =gUnknown_82E9530 - ldrb r0, [r0] - movs r2, 0x80 - lsls r2, 7 - adds r1, r2, 0 - adds r0, r1 - strh r0, [r5] - movs r0, 0x80 - lsls r0, 8 - strh r0, [r5, 0x2] - bl sub_809D42C - strb r0, [r5, 0x10] - ldr r0, =0x0000087f - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0800969E - ldrb r0, [r5, 0x10] - movs r1, 0x10 - orrs r0, r1 - strb r0, [r5, 0x10] -_0800969E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8009638 - - thumb_func_start sub_80096BC -sub_80096BC: @ 80096BC - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_80096BC - - thumb_func_start sub_80096D0 -sub_80096D0: @ 80096D0 - push {lr} - ldr r3, =0x020229c4 - ldr r1, =0x03003110 - ldr r2, =0x0000efff - adds r0, r1, 0 - adds r0, 0xE -_080096DC: - strh r2, [r0] - subs r0, 0x2 - cmp r0, r1 - bge _080096DC - movs r0, 0x1 - strb r0, [r3] - bl sub_800B594 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80096D0 - - thumb_func_start task02_080097CC -task02_080097CC: @ 80096FC - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x03005e00 - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - bne _08009726 - ldr r1, =0x03003144 - movs r0, 0x1 - strb r0, [r1] - adds r0, r2, 0 - bl remove_task -_08009726: - pop {r0} - bx r0 - .pool - thumb_func_end task02_080097CC - - thumb_func_start sub_8009734 -sub_8009734: @ 8009734 - push {r4-r6,lr} - ldr r0, =0x030030fc - ldrb r4, [r0] - cmp r4, 0 - bne _080097A8 - bl sub_800B628 - bl sub_80096D0 - ldr r1, =0x03003140 - ldr r0, =sub_800A824 - str r0, [r1] - ldr r0, =0x03002748 - strb r4, [r0] - ldr r0, =0x0300306c - strb r4, [r0] - ldr r0, =0x030030f8 - strb r4, [r0] - bl sub_800A5B4 - bl sub_800A2E0 - ldr r0, =0x03000d54 - str r4, [r0] - ldr r0, =0x030030e8 - strb r4, [r0] - ldr r0, =0x030030e4 - strb r4, [r0] - ldr r0, =0x030030f4 - strh r4, [r0] - ldr r0, =task02_080097CC - movs r1, 0x2 - bl AddTask - b _080097AC - .pool -_080097A8: - bl sub_800E700 -_080097AC: - ldr r1, =0x03003124 - movs r0, 0 - strb r0, [r1] - movs r1, 0 - ldr r6, =0x03003078 - movs r2, 0 - movs r5, 0x1 - ldr r4, =0x030030f0 - ldr r3, =0x030030ec -_080097BE: - adds r0, r1, r6 - strb r5, [r0] - adds r0, r1, r4 - strb r2, [r0] - adds r0, r1, r3 - strb r2, [r0] - adds r1, 0x1 - cmp r1, 0x3 - ble _080097BE - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8009734 - - thumb_func_start sub_80097E8 -sub_80097E8: @ 80097E8 - push {r4,lr} - ldr r0, =0x03003124 - movs r4, 0 - strb r4, [r0] - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _080097FC - bl sub_800EDD4 -_080097FC: - ldr r0, =0x020229c4 - strb r4, [r0] - bl sub_800B53C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80097E8 - - thumb_func_start sub_8009818 -sub_8009818: @ 8009818 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r5, =0x03000d64 - ldr r4, =0x03000d10 - ldrb r0, [r5] - ldrh r1, [r4] - cmp r0, r1 - beq _0800983C - ldrh r0, [r4] - movs r1, 0x2 - movs r2, 0x3 - movs r3, 0x2 - bl sub_800A6E8 - ldrh r0, [r4] - strb r0, [r5] -_0800983C: - movs r5, 0 - ldr r7, =0x03000d20 -_08009840: - ldr r0, =0x03000d68 - adds r6, r5, r0 - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r4, r0, r7 - ldrb r0, [r6] - ldrh r1, [r4] - cmp r0, r1 - beq _08009868 - ldrh r0, [r4] - adds r2, r5, 0x4 - lsls r2, 24 - lsrs r2, 24 - movs r1, 0x2 - movs r3, 0x2 - bl sub_800A6E8 - ldrh r0, [r4] - strb r0, [r6] -_08009868: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _08009840 - bl sub_800A550 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0xF - bne _080098CE - movs r5, 0 - ldr r0, =0x03000d20 - mov r9, r0 - ldr r1, =0x00000342 - mov r8, r1 -_08009888: - adds r0, r7, 0 - asrs r0, r5 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080098C4 - lsls r0, r5, 8 - ldr r1, =0x020223c4 - adds r0, r1 - lsls r4, r5, 1 - adds r1, r4, r5 - lsls r1, 2 - add r1, r9 - ldrh r1, [r1, 0x2] - bl sub_800A648 - ldr r1, =0x03003148 - adds r4, r1 - movs r6, 0 - strh r0, [r4] - adds r0, r5, 0 - bl sub_800A5EC - ldrh r0, [r4] - cmp r0, r8 - beq _080098C4 - ldr r0, =0x020223bc - strb r6, [r0] - ldr r0, =0x020223bd - strb r6, [r0] -_080098C4: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _08009888 -_080098CE: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8009818 - - thumb_func_start sub_8009900 -sub_8009900: @ 8009900 - push {r4,r5,lr} - sub sp, 0x4 - ldr r4, =0x030022c0 - ldrh r1, [r4, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08009916 - ldr r1, =0x03003144 - movs r0, 0x1 - strb r0, [r1] -_08009916: - ldrh r1, [r4, 0x2C] - movs r5, 0x2 - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _0800992A - ldr r0, =0x02004000 - ldr r1, =0x00002004 - bl sub_800A2F4 -_0800992A: - ldrh r1, [r4, 0x2E] - movs r0, 0x80 - lsls r0, 2 - ands r0, r1 - cmp r0, 0 - beq _08009946 - movs r0, 0x1 - negs r0, r0 - str r5, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe -_08009946: - ldrh r1, [r4, 0x2E] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _08009956 - movs r0, 0x1 - bl sub_800B330 -_08009956: - ldrh r1, [r4, 0x2E] - movs r0, 0x80 - lsls r0, 1 - ands r0, r1 - cmp r0, 0 - beq _08009968 - movs r0, 0x1 - bl save_game_when_memory_present -_08009968: - ldrh r1, [r4, 0x2E] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08009976 - bl sub_800AC34 -_08009976: - ldr r0, =0x020223bc - ldrb r0, [r0] - cmp r0, 0 - beq _08009996 - ldr r2, [r4, 0x24] - ldr r0, =0x03002748 - ldrb r1, [r0] - ldr r0, =0x03003140 - ldr r0, [r0] - cmp r0, 0 - bne _08009990 - movs r0, 0x10 - orrs r1, r0 -_08009990: - adds r0, r2, 0 - bl sub_800A994 -_08009996: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8009900 - - thumb_func_start c2_08009A8C -c2_08009A8C: @ 80099BC - push {lr} - bl sub_8009900 - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - bl sub_8009818 - bl RunActiveTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end c2_08009A8C - - thumb_func_start sub_80099E0 -sub_80099E0: @ 80099E0 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r0, =0x020229c4 - ldrb r0, [r0] - cmp r0, 0 - bne _080099F4 - movs r0, 0 - b _08009A3C - .pool -_080099F4: - movs r1, 0 - ldr r5, =0x03003084 - ldr r3, =0x03003110 - movs r2, 0 -_080099FC: - lsls r0, r1, 1 - adds r0, r3 - strh r2, [r0] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x7 - bls _080099FC - ldrh r0, [r4] - strh r0, [r5] - ldr r0, =0x030030e0 - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08009A38 - ldr r0, =0x04000128 - ldr r0, [r0] - lsls r0, 26 - lsrs r0, 30 - bl sub_8009AA0 - ldr r0, =0x03003140 - ldr r0, [r0] - cmp r0, 0 - beq _08009A34 - bl _call_via_r0 -_08009A34: - bl sub_800AEB4 -_08009A38: - ldr r0, =0x030030e0 - ldrh r0, [r0] -_08009A3C: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80099E0 - - thumb_func_start sub_8009A58 -sub_8009A58: @ 8009A58 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - movs r5, 0 - ldr r1, =0x03003078 - adds r0, r1 - strb r5, [r0] - movs r4, 0 - adds r6, r1, 0 - b _08009A78 - .pool -_08009A70: - adds r0, r4, r6 - ldrb r0, [r0] - adds r5, r0 - adds r4, 0x1 -_08009A78: - bl sub_800ABAC - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - blt _08009A70 - cmp r5, 0 - bne _08009A94 - ldr r1, =0x03003124 - ldrb r0, [r1] - cmp r0, 0 - bne _08009A94 - movs r0, 0x1 - strb r0, [r1] -_08009A94: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8009A58 - - thumb_func_start sub_8009AA0 -sub_8009AA0: @ 8009AA0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r6, 0 -_08009AAE: - ldr r0, =0x03003020 - lsls r1, r6, 1 - adds r3, r1, r0 - movs r0, 0 - strh r0, [r3] - lsls r4, r6, 4 - ldr r5, =0x03003090 - adds r2, r4, r5 - ldrh r0, [r2] - mov r12, r1 - adds r7, r6, 0x1 - str r7, [sp] - cmp r0, 0 - bne _08009ACC - b _08009D6E -_08009ACC: - ldrh r1, [r2] - ldr r0, =0x00005fff - cmp r1, r0 - bne _08009AD6 - b _08009D20 -_08009AD6: - cmp r1, r0 - bgt _08009B24 - ldr r0, =0x00004444 - cmp r1, r0 - bne _08009AE2 - b _08009D64 -_08009AE2: - cmp r1, r0 - bgt _08009B10 - ldr r0, =0x00002222 - cmp r1, r0 - beq _08009B68 - ldr r0, =0x00002ffe - cmp r1, r0 - bne _08009AF4 - b _08009D28 -_08009AF4: - b _08009D6E - .pool -_08009B10: - ldr r0, =0x00005555 - cmp r1, r0 - beq _08009BB8 - adds r0, 0x11 - cmp r1, r0 - beq _08009BB8 - b _08009D6E - .pool -_08009B24: - ldr r0, =0x0000bbbb - cmp r1, r0 - beq _08009BC4 - cmp r1, r0 - bgt _08009B4C - ldr r0, =0x00008888 - cmp r1, r0 - beq _08009BF0 - ldr r0, =0x0000aaaa - cmp r1, r0 - bne _08009B3C - b _08009D38 -_08009B3C: - b _08009D6E - .pool -_08009B4C: - ldr r0, =0x0000cafe - cmp r1, r0 - bne _08009B54 - b _08009D64 -_08009B54: - ldr r0, =0x0000cccc - cmp r1, r0 - bne _08009B5C - b _08009D3E -_08009B5C: - b _08009D6E - .pool -_08009B68: - bl sub_8009638 - ldr r0, =0x03003030 - adds r2, r0, 0 - adds r2, 0x10 - ldr r1, =0x020229cc - ldm r1!, {r3-r5} - stm r2!, {r3-r5} - ldm r1!, {r3,r6,r7} - stm r2!, {r3,r6,r7} - ldr r1, [r1] - str r1, [r2] - ldr r4, =gUnknown_082ED1D4 - adds r2, r0, 0 - adds r1, r4, 0 - ldm r1!, {r5-r7} - stm r2!, {r5-r7} - ldrh r3, [r1] - strh r3, [r2] - ldrb r1, [r1, 0x2] - strb r1, [r2, 0x2] - adds r1, r0, 0 - adds r1, 0x2C - ldm r4!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - ldrh r2, [r4] - strh r2, [r1] - ldrb r2, [r4, 0x2] - strb r2, [r1, 0x2] - movs r1, 0x3C - bl sub_800A2F4 - b _08009D6E - .pool -_08009BB8: - ldr r1, =0x030030e8 - movs r0, 0x1 - strb r0, [r1] - b _08009D6E - .pool -_08009BC4: - mov r7, r12 - adds r1, r7, r6 - lsls r1, 2 - ldr r0, =0x03000d20 - adds r1, r0 - movs r2, 0 - strh r2, [r1] - ldr r0, =0x03003090 - adds r0, 0x2 - adds r0, r4, r0 - ldrh r0, [r0] - strh r0, [r1, 0x2] - ldr r0, =0x03003090 - adds r0, 0x4 - adds r0, r4, r0 - ldrh r0, [r0] - strb r0, [r1, 0x9] - b _08009D6E - .pool -_08009BF0: - mov r3, r12 - adds r0, r3, r6 - lsls r0, 2 - ldr r5, =0x03000d20 - adds r3, r0, r5 - ldrh r1, [r3, 0x2] - movs r0, 0x80 - lsls r0, 1 - adds r7, r5, 0 - mov r10, r7 - cmp r1, r0 - bls _08009C40 - ldr r0, =0x0201c000 - mov r8, r0 - movs r2, 0 - adds r5, r3, 0 - ldr r7, =0x03003090 - adds r3, r4, 0 -_08009C14: - ldrh r1, [r5] - lsrs r1, 1 - adds r1, r2 - lsls r1, 1 - add r1, r8 - adds r2, 0x1 - lsls r0, r2, 1 - adds r0, r3 - adds r0, r7 - ldrh r0, [r0] - strh r0, [r1] - lsls r2, 16 - lsrs r2, 16 - cmp r2, 0x6 - bls _08009C14 - b _08009C70 - .pool -_08009C40: - movs r2, 0 - ldr r1, =0x020223c4 - mov r9, r1 - adds r7, r3, 0 - ldr r3, =0x03003090 - mov r8, r3 - lsls r5, r6, 8 - adds r3, r4, 0 -_08009C50: - ldrh r1, [r7] - lsrs r1, 1 - adds r1, r2 - lsls r1, 1 - adds r1, r5 - add r1, r9 - adds r2, 0x1 - lsls r0, r2, 1 - adds r0, r3 - add r0, r8 - ldrh r0, [r0] - strh r0, [r1] - lsls r2, 16 - lsrs r2, 16 - cmp r2, 0x6 - bls _08009C50 -_08009C70: - mov r4, r12 - adds r1, r4, r6 - lsls r1, 2 - add r1, r10 - ldrh r0, [r1] - adds r0, 0xE - movs r3, 0 - strh r0, [r1] - lsls r0, 16 - lsrs r0, 16 - ldrh r1, [r1, 0x2] - cmp r0, r1 - bcc _08009D6E - ldr r0, =0x03003078 - adds r0, r6, r0 - ldrb r0, [r0] - cmp r0, 0x1 - bne _08009D16 - lsls r1, r6, 8 - ldr r0, =0x020223c4 - adds r1, r0 - mov r8, r1 - lsls r0, r6, 3 - subs r0, r6 - lsls r0, 2 - ldr r1, =0x020229e8 - adds r2, r0, r1 - adds r1, r2, 0 - mov r0, r8 - adds r0, 0x10 - ldm r0!, {r4,r5,r7} - stm r1!, {r4,r5,r7} - ldm r0!, {r4,r5,r7} - stm r1!, {r4,r5,r7} - ldr r0, [r0] - str r0, [r1] - ldrb r0, [r2] - subs r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _08009CCA - strb r3, [r2, 0x12] - strb r3, [r2, 0x11] - strb r3, [r2, 0x10] -_08009CCA: - adds r0, r2, 0 - bl sub_800B524 - ldr r5, =gUnknown_082ED1D4 - mov r0, r8 - adds r1, r5, 0 - bl strcmp - cmp r0, 0 - bne _08009CEC - mov r0, r8 - adds r0, 0x2C - adds r1, r5, 0 - bl strcmp - cmp r0, 0 - beq _08009D0C -_08009CEC: - ldr r0, =c2_800ACD4 - bl SetMainCallback2 - b _08009D6E - .pool -_08009D0C: - lsls r0, r6, 24 - lsrs r0, 24 - bl sub_8009A58 - b _08009D6E -_08009D16: - lsls r0, r6, 24 - lsrs r0, 24 - bl sub_800A588 - b _08009D6E -_08009D20: - ldr r0, =0x030030f0 - b _08009D2A - .pool -_08009D28: - ldr r0, =0x030030ec -_08009D2A: - adds r0, r6, r0 - movs r1, 0x1 - strb r1, [r0] - b _08009D6E - .pool -_08009D38: - bl sub_800A418 - b _08009D6E -_08009D3E: - ldr r3, =gUnknown_082ED1A8 - ldr r0, =0x03003090 - adds r0, 0x2 - adds r0, r4, r0 - ldrh r2, [r0] - lsls r2, 3 - adds r0, r2, r3 - ldr r1, [r0] - adds r3, 0x4 - adds r2, r3 - ldrh r2, [r2] - movs r0, 0 - bl link_0800A448 - b _08009D6E - .pool -_08009D64: - ldr r0, =0x03003090 - adds r0, 0x2 - adds r0, r4, r0 - ldrh r0, [r0] - strh r0, [r3] -_08009D6E: - ldr r5, [sp] - lsls r0, r5, 16 - lsrs r6, r0, 16 - cmp r6, 0x3 - bhi _08009D7A - b _08009AAE -_08009D7A: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8009AA0 - - thumb_func_start sub_8009D90 -sub_8009D90: @ 8009D90 - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, =0x00006666 - cmp r2, r0 - beq _08009E60 - cmp r2, r0 - bgt _08009DF0 - ldr r0, =0x00004444 - cmp r2, r0 - beq _08009E4C - cmp r2, r0 - bgt _08009DCC - ldr r0, =0x00002222 - cmp r2, r0 - beq _08009E38 - ldr r0, =0x00002ffe -_08009DB2: - cmp r2, r0 - bne _08009DB8 - b _08009EE4 -_08009DB8: - b _08009F06 - .pool -_08009DCC: - ldr r0, =0x00005566 - cmp r2, r0 - bne _08009DD4 - b _08009EE4 -_08009DD4: - cmp r2, r0 - bgt _08009DE0 - subs r0, 0x11 - b _08009DB2 - .pool -_08009DE0: - ldr r0, =0x00005fff - cmp r2, r0 - bne _08009DE8 - b _08009ED0 -_08009DE8: - b _08009F06 - .pool -_08009DF0: - ldr r0, =0x0000aaab - cmp r2, r0 - beq _08009EA8 - cmp r2, r0 - bgt _08009E10 - ldr r0, =0x00007777 - cmp r2, r0 - beq _08009E6C - ldr r0, =0x0000aaaa - b _08009DB2 - .pool -_08009E10: - ldr r0, =0x0000cafe - cmp r2, r0 - beq _08009EF0 - cmp r2, r0 - bgt _08009E2C - ldr r0, =0x0000bbbb - cmp r2, r0 - beq _08009E8C - b _08009F06 - .pool -_08009E2C: - ldr r0, =0x0000cccc - cmp r2, r0 - beq _08009EBC - b _08009F06 - .pool -_08009E38: - ldr r0, =0x03003110 - strh r2, [r0] - ldr r1, =0x020229c6 - ldrh r1, [r1] - b _08009F04 - .pool -_08009E4C: - ldr r0, =0x03003110 - strh r2, [r0] - ldr r1, =0x030022c0 - ldrh r1, [r1, 0x2C] - b _08009F04 - .pool -_08009E60: - ldr r0, =0x03003110 - movs r1, 0 - b _08009F02 - .pool -_08009E6C: - ldr r0, =0x03003110 - strh r2, [r0] - movs r1, 0 - adds r3, r0, 0 - movs r2, 0xEE -_08009E76: - adds r1, 0x1 - lsls r0, r1, 1 - adds r0, r3 - strh r2, [r0] - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x4 - bls _08009E76 - b _08009F06 - .pool -_08009E8C: - ldr r1, =0x03003110 - strh r2, [r1] - ldr r2, =0x03000d10 - ldrh r0, [r2, 0x2] - strh r0, [r1, 0x2] - ldrb r0, [r2, 0x9] - adds r0, 0x80 - strh r0, [r1, 0x4] - b _08009F06 - .pool -_08009EA8: - ldr r0, =0x03003110 - strh r2, [r0] - ldr r1, =0x0203ce7c - ldrh r1, [r1] - b _08009F04 - .pool -_08009EBC: - ldr r0, =0x03003110 - strh r2, [r0] - ldr r1, =0x03003150 - ldrb r1, [r1] - b _08009F04 - .pool -_08009ED0: - ldr r0, =0x03003110 - strh r2, [r0] - ldr r1, =0x030030f4 - ldrh r1, [r1] - b _08009F04 - .pool -_08009EE4: - ldr r0, =0x03003110 - strh r2, [r0] - b _08009F06 - .pool -_08009EF0: - ldr r0, =0x03005da8 - ldrh r1, [r0] - cmp r1, 0 - beq _08009F06 - ldr r0, =0x030022b4 - ldrb r0, [r0] - cmp r0, 0 - bne _08009F06 - ldr r0, =0x03003110 -_08009F02: - strh r2, [r0] -_08009F04: - strh r1, [r0, 0x2] -_08009F06: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8009D90 - - thumb_func_start sub_8009F18 -sub_8009F18: @ 8009F18 - push {lr} - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08009F26 - bl sub_800F804 -_08009F26: - ldr r1, =0x03003140 - ldr r0, =sub_8009F70 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8009F18 - - thumb_func_start sub_8009F3C -sub_8009F3C: @ 8009F3C - push {lr} - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08009F50 - bl sub_800F7E4 - b _08009F6A - .pool -_08009F50: - ldr r0, =0x03003140 - ldr r1, [r0] - ldr r0, =sub_8009F70 - cmp r1, r0 - beq _08009F68 - movs r0, 0 - b _08009F6A - .pool -_08009F68: - movs r0, 0x1 -_08009F6A: - pop {r1} - bx r1 - thumb_func_end sub_8009F3C - - thumb_func_start sub_8009F70 -sub_8009F70: @ 8009F70 - push {lr} - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0x1 - bne _08009F80 - ldr r0, =0x0000cafe - bl sub_8009D90 -_08009F80: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8009F70 - - thumb_func_start sub_8009F8C -sub_8009F8C: @ 8009F8C - push {lr} - ldr r0, =0x030030fc - ldrb r1, [r0] - cmp r1, 0 - beq _08009FA0 - bl Rfu_set_zero - b _08009FA4 - .pool -_08009FA0: - ldr r0, =0x03003140 - str r1, [r0] -_08009FA4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8009F8C - - thumb_func_start sub_8009FAC -sub_8009FAC: @ 8009FAC - push {lr} - ldr r0, =0x030030fc - ldrb r1, [r0] - cmp r1, 0 - beq _08009FC0 - bl Rfu_set_zero - b _08009FC4 - .pool -_08009FC0: - ldr r0, =0x03003140 - str r1, [r0] -_08009FC4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8009FAC - - thumb_func_start sub_8009FCC -sub_8009FCC: @ 8009FCC - push {lr} - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _08009FEC - ldr r0, =0x030030e0 - ldr r0, [r0] - movs r1, 0x1C - ands r0, r1 - lsrs r0, 2 - b _08009FF4 - .pool -_08009FEC: - bl sub_80104F4 - lsls r0, 24 - lsrs r0, 24 -_08009FF4: - pop {r1} - bx r1 - thumb_func_end sub_8009FCC - - thumb_func_start sub_8009FF8 -sub_8009FF8: @ 8009FF8 - push {r4-r7,lr} - adds r6, r0, 0 - adds r5, r1, 0 - bl sub_8009FCC - lsls r0, 24 - lsrs r4, r0, 24 - movs r2, 0 - cmp r2, r4 - bge _0800A030 - movs r7, 0xFF - ldr r3, =0x020229e8 -_0800A010: - ldrh r0, [r3] - adds r1, r7, 0 - ands r1, r0 - cmp r1, r6 - beq _0800A01E - cmp r1, r5 - bne _0800A028 -_0800A01E: - movs r0, 0x1 - b _0800A034 - .pool -_0800A028: - adds r3, 0x1C - adds r2, 0x1 - cmp r2, r4 - blt _0800A010 -_0800A030: - movs r0, 0x1 - negs r0, r0 -_0800A034: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8009FF8 - - thumb_func_start sub_800A03C -sub_800A03C: @ 800A03C - movs r0, 0x2 - bx lr - thumb_func_end sub_800A03C - - thumb_func_start sub_800A040 -sub_800A040: @ 800A040 - push {lr} - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bne _0800A05A - movs r0, 0x2 - movs r1, 0x1 - bl sub_8009FF8 - cmp r0, 0 - bge _0800A05E -_0800A05A: - movs r0, 0 - b _0800A060 -_0800A05E: - movs r0, 0x1 -_0800A060: - pop {r1} - bx r1 - thumb_func_end sub_800A040 - - thumb_func_start sub_800A064 -sub_800A064: @ 800A064 - push {lr} - movs r0, 0x2 - movs r1, 0x1 - bl sub_8009FF8 - cmp r0, 0 - bge _0800A076 - movs r0, 0 - b _0800A078 -_0800A076: - movs r0, 0x1 -_0800A078: - pop {r1} - bx r1 - thumb_func_end sub_800A064 - - thumb_func_start sub_800A07C -sub_800A07C: @ 800A07C - push {lr} - movs r0, 0x4 - movs r1, 0x5 - bl sub_8009FF8 - adds r2, r0, 0 - cmp r2, 0 - blt _0800A0A4 - ldr r0, =0x020229e8 - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x1A] - cmp r0, 0x1 - bne _0800A0A4 - movs r0, 0x1 - b _0800A0A6 - .pool -_0800A0A4: - movs r0, 0 -_0800A0A6: - pop {r1} - bx r1 - thumb_func_end sub_800A07C - - thumb_func_start sub_800A0AC -sub_800A0AC: @ 800A0AC - push {lr} - ldr r0, =0x03000d5c - movs r1, 0 - str r1, [r0] - ldr r0, =0x020229c8 - strh r1, [r0] - bl sub_8009734 - pop {r0} - bx r0 - .pool - thumb_func_end sub_800A0AC - - thumb_func_start sub_800A0C8 -sub_800A0C8: @ 800A0C8 - push {r4-r7,lr} - adds r5, r0, 0 - adds r6, r1, 0 - movs r7, 0 - ldr r0, =0x03003124 - ldrb r4, [r0] - cmp r4, 0x1 - beq _0800A0DA - b _0800A214 -_0800A0DA: - bl sub_800ABAC - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - bgt _0800A0EA - cmp r0, r6 - ble _0800A0FC -_0800A0EA: - ldr r1, =0x03000d5c - movs r0, 0x6 - str r0, [r1] - b _0800A22E - .pool -_0800A0FC: - bl sub_8009FCC - lsls r0, 24 - cmp r0, 0 - bne _0800A10E - ldr r0, =0x0300306c - strb r4, [r0] - bl sub_80097E8 -_0800A10E: - movs r6, 0 - ldr r4, =0x020229e8 - movs r5, 0 - b _0800A134 - .pool -_0800A120: - adds r0, r4, 0 - adds r0, 0x14 - adds r0, r5, r0 - ldr r1, [r0] - ldr r0, [r4, 0x14] - cmp r1, r0 - bne _0800A130 - adds r7, 0x1 -_0800A130: - adds r5, 0x1C - adds r6, 0x1 -_0800A134: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - blt _0800A120 - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r7, r0 - bne _0800A1AC - ldr r0, =0x020229e8 - ldr r1, [r0, 0x14] - ldr r0, =0x00001133 - cmp r1, r0 - bne _0800A19C - bl sub_807A728 - cmp r0, 0x1 - beq _0800A184 - cmp r0, 0x1 - bgt _0800A178 - cmp r0, 0 - beq _0800A19C - ldr r3, =0x03000d5c - b _0800A22C - .pool -_0800A178: - cmp r0, 0x2 - beq _0800A190 - ldr r3, =0x03000d5c - b _0800A22C - .pool -_0800A184: - ldr r1, =0x03000d5c - movs r0, 0x4 - b _0800A1A0 - .pool -_0800A190: - ldr r1, =0x03000d5c - movs r0, 0x5 - b _0800A1A0 - .pool -_0800A19C: - ldr r1, =0x03000d5c - movs r0, 0x1 -_0800A1A0: - str r0, [r1] - adds r3, r1, 0 - b _0800A22C - .pool -_0800A1AC: - ldr r6, =0x03000d5c - movs r0, 0x3 - str r0, [r6] - ldr r4, =0x020229e8 - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r4, 0x14 - adds r1, r4 - ldr r5, [r1] - bl link_get_multiplayer_id - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r4 - ldr r1, [r1] - ldr r2, =0x00002266 - cmp r5, r2 - bne _0800A1EA - ldr r0, =0x00002277 - cmp r1, r0 - beq _0800A1F6 -_0800A1EA: - ldr r0, =0x00002277 - adds r3, r6, 0 - cmp r5, r0 - bne _0800A22C - cmp r1, r2 - bne _0800A22C -_0800A1F6: - ldr r1, =0x020375e2 - movs r0, 0x3 - strh r0, [r1] - ldr r3, =0x03000d5c - b _0800A22C - .pool -_0800A214: - ldr r0, =0x020229c8 - ldrh r1, [r0] - adds r1, 0x1 - strh r1, [r0] - lsls r1, 16 - movs r0, 0x96 - lsls r0, 18 - ldr r3, =0x03000d5c - cmp r1, r0 - bls _0800A22C - movs r0, 0x2 - str r0, [r3] -_0800A22C: - ldrb r0, [r3] -_0800A22E: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_800A0C8 - - thumb_func_start sub_800A23C -sub_800A23C: @ 800A23C - push {r4-r6,lr} - movs r6, 0 - movs r4, 0 - ldr r5, =0x020229e8 - b _0800A26C - .pool -_0800A24C: - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - adds r1, r5, 0 - adds r1, 0x14 - adds r0, r1 - ldr r1, [r0] - ldr r0, [r5, 0x14] - cmp r1, r0 - bne _0800A266 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_0800A266: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_0800A26C: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bcc _0800A24C - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - bne _0800A290 - movs r2, 0x1 - ldr r0, =0x03000d5c - str r2, [r0] - b _0800A298 - .pool -_0800A290: - movs r2, 0 - ldr r1, =0x03000d5c - movs r0, 0x3 - str r0, [r1] -_0800A298: - adds r0, r2, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_800A23C - - thumb_func_start sub_800A2A4 -sub_800A2A4: @ 800A2A4 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x020229e8 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r2, 0x4 - adds r1, r2 - ldr r0, [r1] - bx lr - .pool - thumb_func_end sub_800A2A4 - - thumb_func_start sub_800A2BC -sub_800A2BC: @ 800A2BC - push {r4,r5,lr} - ldr r5, =0x020229e8 - movs r4, 0x4 -_0800A2C2: - adds r0, r5, 0 - movs r1, 0 - movs r2, 0x1C - bl memset - adds r5, 0x1C - subs r4, 0x1 - cmp r4, 0 - bge _0800A2C2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800A2BC - - thumb_func_start sub_800A2E0 -sub_800A2E0: @ 800A2E0 - ldr r1, =0x03000d10 - movs r0, 0 - strb r0, [r1, 0x8] - strh r0, [r1] - strh r0, [r1, 0x2] - str r0, [r1, 0x4] - bx lr - .pool - thumb_func_end sub_800A2E0 - - thumb_func_start sub_800A2F4 -sub_800A2F4: @ 800A2F4 - push {r4-r7,lr} - adds r7, r0, 0 - adds r6, r1, 0 - ldr r4, =0x03000d10 - ldrb r5, [r4, 0x8] - cmp r5, 0 - beq _0800A30C - movs r0, 0 - b _0800A34A - .pool -_0800A30C: - bl link_get_multiplayer_id - strb r0, [r4, 0x9] - movs r0, 0x1 - strb r0, [r4, 0x8] - strh r6, [r4, 0x2] - strh r5, [r4] - adds r0, 0xFF - cmp r6, r0 - bls _0800A324 - str r7, [r4, 0x4] - b _0800A336 -_0800A324: - ldr r5, =0x020228c4 - cmp r7, r5 - beq _0800A334 - adds r0, r5, 0 - adds r1, r7, 0 - adds r2, r6, 0 - bl memcpy -_0800A334: - str r5, [r4, 0x4] -_0800A336: - ldr r0, =0x0000bbbb - bl sub_8009D90 - ldr r1, =0x03003140 - ldr r0, =sub_800A364 - str r0, [r1] - ldr r1, =0x03000d50 - movs r0, 0 - str r0, [r1] - movs r0, 0x1 -_0800A34A: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_800A2F4 - - thumb_func_start sub_800A364 -sub_800A364: @ 800A364 - push {lr} - ldr r1, =0x03000d50 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - cmp r0, 0x2 - bls _0800A378 - ldr r1, =0x03003140 - ldr r0, =sub_800A388 - str r0, [r1] -_0800A378: - pop {r0} - bx r0 - .pool - thumb_func_end sub_800A364 - - thumb_func_start sub_800A388 -sub_800A388: @ 800A388 - push {r4-r6,lr} - ldr r0, =0x03000d10 - ldr r5, [r0, 0x4] - ldr r2, =0x03003110 - ldr r1, =0x00008888 - strh r1, [r2] - movs r3, 0 - adds r4, r0, 0 - adds r6, r4, 0 - adds r2, 0x2 -_0800A39C: - lsls r0, r3, 1 - ldrh r1, [r6] - adds r0, r1 - adds r0, r5 - ldrb r1, [r0, 0x1] - lsls r1, 8 - ldrb r0, [r0] - orrs r0, r1 - strh r0, [r2] - adds r2, 0x2 - adds r3, 0x1 - cmp r3, 0x6 - ble _0800A39C - ldrh r0, [r4] - adds r0, 0xE - strh r0, [r4] - ldrh r1, [r4, 0x2] - lsls r0, 16 - lsrs r0, 16 - cmp r1, r0 - bhi _0800A3D0 - movs r0, 0 - strb r0, [r4, 0x8] - ldr r1, =0x03003140 - ldr r0, =sub_800A3EC - str r0, [r1] -_0800A3D0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800A388 - - thumb_func_start sub_800A3EC -sub_800A3EC: @ 800A3EC - ldr r1, =0x03003140 - movs r0, 0 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_800A3EC - - thumb_func_start sub_800A3F8 -sub_800A3F8: @ 800A3F8 - push {lr} - bl link_get_multiplayer_id - ldr r0, =0x00004444 - bl sub_8009D90 - ldr r1, =0x020223c0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_800A3F8 - - thumb_func_start sub_800A418 -sub_800A418: @ 800A418 - push {lr} - ldr r1, =0x020223c0 - movs r0, 0 - str r0, [r1] - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _0800A438 - bl sub_800F850 - b _0800A43E - .pool -_0800A438: - ldr r1, =0x03003140 - ldr r0, =sub_800A3F8 - str r0, [r1] -_0800A43E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_800A418 - - thumb_func_start sub_800A44C -sub_800A44C: @ 800A44C - ldr r0, =0x020223c0 - ldr r0, [r0] - bx lr - .pool - thumb_func_end sub_800A44C - - thumb_func_start sub_800A458 -sub_800A458: @ 800A458 - push {lr} - ldr r0, =0x0000aaaa - bl sub_8009D90 - pop {r0} - bx r0 - .pool - thumb_func_end sub_800A458 - - thumb_func_start link_get_multiplayer_id -link_get_multiplayer_id: @ 800A468 - push {lr} - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0x1 - beq _0800A484 - ldr r0, =0x04000128 - ldr r0, [r0] - lsls r0, 26 - lsrs r0, 30 - b _0800A48C - .pool -_0800A484: - bl rfu_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 -_0800A48C: - pop {r1} - bx r1 - thumb_func_end link_get_multiplayer_id - - thumb_func_start bitmask_all_link_players_but_self -bitmask_all_link_players_but_self: @ 800A490 - push {lr} - bl link_get_multiplayer_id - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x1 - lsls r0, r1 - movs r1, 0xF - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end bitmask_all_link_players_but_self - - thumb_func_start link_0800A448 -link_0800A448: @ 800A4AC - push {lr} - adds r3, r1, 0 - lsls r2, 16 - lsrs r1, r2, 16 - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0x1 - beq _0800A4C8 - adds r0, r3, 0 - bl sub_800A2F4 - b _0800A4CE - .pool -_0800A4C8: - adds r0, r3, 0 - bl sub_800FE84 -_0800A4CE: - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end link_0800A448 - - thumb_func_start sub_800A4D8 -sub_800A4D8: @ 800A4D8 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - adds r2, r1, 0 - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0x1 - bne _0800A4F8 - adds r0, r1, 0 - bl sub_8010100 - lsls r0, 24 - lsrs r0, 24 - b _0800A514 - .pool -_0800A4F8: - ldr r0, =0x03003140 - ldr r0, [r0] - cmp r0, 0 - beq _0800A508 - movs r0, 0 - b _0800A514 - .pool -_0800A508: - ldr r0, =0x03003150 - strb r2, [r0] - ldr r0, =0x0000cccc - bl sub_8009D90 - movs r0, 0x1 -_0800A514: - pop {r1} - bx r1 - .pool - thumb_func_end sub_800A4D8 - - thumb_func_start sub_800A520 -sub_800A520: @ 800A520 - push {lr} - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0x1 - bne _0800A538 - bl sub_8010500 - lsls r0, 24 - lsrs r0, 24 - b _0800A546 - .pool -_0800A538: - movs r1, 0 - ldr r0, =0x03003140 - ldr r0, [r0] - cmp r0, 0 - bne _0800A544 - movs r1, 0x1 -_0800A544: - adds r0, r1, 0 -_0800A546: - pop {r1} - bx r1 - .pool - thumb_func_end sub_800A520 - - thumb_func_start sub_800A550 -sub_800A550: @ 800A550 - push {lr} - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0x1 - beq _0800A57C - ldr r2, =0x0300307c - ldrb r0, [r2, 0x3] - lsls r0, 3 - ldrb r1, [r2, 0x2] - lsls r1, 2 - orrs r0, r1 - ldrb r1, [r2, 0x1] - lsls r1, 1 - orrs r0, r1 - ldrb r1, [r2] - orrs r0, r1 - b _0800A580 - .pool -_0800A57C: - bl sub_800FCD8 -_0800A580: - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_800A550 - - thumb_func_start sub_800A588 -sub_800A588: @ 800A588 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0x1 - bne _0800A5A4 - adds r0, r1, 0 - bl sub_800F6FC - b _0800A5AC - .pool -_0800A5A4: - ldr r0, =0x0300307c - adds r0, r1, r0 - movs r1, 0x1 - strb r1, [r0] -_0800A5AC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_800A588 - - thumb_func_start sub_800A5B4 -sub_800A5B4: @ 800A5B4 - push {r4,lr} - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0x1 - bne _0800A5D4 - movs r4, 0 -_0800A5C0: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_800F728 - adds r4, 0x1 - cmp r4, 0x4 - ble _0800A5C0 - b _0800A5E2 - .pool -_0800A5D4: - ldr r1, =0x0300307c - movs r2, 0 - adds r0, r1, 0x3 -_0800A5DA: - strb r2, [r0] - subs r0, 0x1 - cmp r0, r1 - bge _0800A5DA -_0800A5E2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800A5B4 - - thumb_func_start sub_800A5EC -sub_800A5EC: @ 800A5EC - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0x1 - bne _0800A608 - adds r0, r1, 0 - bl sub_800F728 - b _0800A616 - .pool -_0800A608: - ldr r0, =0x0300307c - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0 - beq _0800A616 - movs r0, 0 - strb r0, [r1] -_0800A616: - pop {r0} - bx r0 - .pool - thumb_func_end sub_800A5EC - - thumb_func_start sub_800A620 -sub_800A620: @ 800A620 - push {lr} - ldr r0, =0x030030e0 - ldr r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0800A63C - movs r0, 0x1C - ands r1, r0 - cmp r1, 0x4 - bls _0800A63C - ldr r1, =0x03003144 - movs r0, 0x1 - strb r0, [r1] -_0800A63C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_800A620 - - thumb_func_start sub_800A648 -sub_800A648: @ 800A648 - push {r4,lr} - adds r4, r0, 0 - lsls r1, 16 - movs r3, 0 - movs r2, 0 - lsrs r1, 17 - cmp r3, r1 - bcs _0800A66E -_0800A658: - lsls r0, r2, 1 - adds r0, r4 - ldrh r0, [r0] - adds r0, r3, r0 - lsls r0, 16 - lsrs r3, r0, 16 - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, r1 - bcc _0800A658 -_0800A66E: - adds r0, r3, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_800A648 - - thumb_func_start sub_800A678 -sub_800A678: @ 800A678 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - ldr r4, =0x03003130 - ldr r3, [r4] - lsls r3, 11 - movs r5, 0xC0 - lsls r5, 19 - adds r3, r5 - lsrs r2, 19 - adds r2, r1 - lsls r2, 1 - adds r2, r3 - ldr r3, [r4, 0x4] - lsls r3, 12 - ldr r1, [r4, 0x8] - adds r1, 0x1 - adds r0, r1 - orrs r3, r0 - strh r3, [r2] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800A678 - - thumb_func_start sub_800A6B0 -sub_800A6B0: @ 800A6B0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - ldr r4, =0x03003130 - ldr r3, [r4] - lsls r3, 11 - movs r5, 0xC0 - lsls r5, 19 - adds r3, r5 - lsrs r2, 19 - adds r2, r1 - lsls r2, 1 - adds r2, r3 - ldr r3, [r4, 0x4] - lsls r3, 12 - ldr r1, [r4, 0x8] - adds r1, r0 - orrs r3, r1 - strh r3, [r2] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800A6B0 - - thumb_func_start sub_800A6E8 -sub_800A6E8: @ 800A6E8 - push {r4-r7,lr} - sub sp, 0x10 - adds r5, r0, 0 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r7, r2, 24 - lsls r3, 24 - lsrs r3, 24 - movs r4, 0 - cmp r4, r3 - bge _0800A714 - movs r2, 0xF -_0800A702: - mov r0, sp - adds r1, r0, r4 - adds r0, r5, 0 - ands r0, r2 - strb r0, [r1] - lsrs r5, 4 - adds r4, 0x1 - cmp r4, r3 - blt _0800A702 -_0800A714: - subs r4, r3, 0x1 - cmp r4, 0 - blt _0800A734 -_0800A71A: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - adds r1, r6, 0 - adds r2, r7, 0 - bl sub_800A678 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - subs r4, 0x1 - cmp r4, 0 - bge _0800A71A -_0800A734: - add sp, 0x10 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_800A6E8 - - thumb_func_start sub_800A73C -sub_800A73C: @ 800A73C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - adds r6, r0, 0 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - lsls r3, 24 - lsrs r3, 24 - mov r8, r3 - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x10] - cmp r6, 0 - bge _0800A768 - str r7, [sp, 0x10] - negs r6, r6 -_0800A768: - movs r5, 0 - movs r1, 0x1 - negs r1, r1 - add r1, r8 - mov r10, r1 - cmp r5, r8 - bge _0800A794 -_0800A776: - mov r0, sp - adds r4, r0, r5 - adds r0, r6, 0 - movs r1, 0xA - bl __modsi3 - strb r0, [r4] - adds r0, r6, 0 - movs r1, 0xA - bl __divsi3 - adds r6, r0, 0 - adds r5, 0x1 - cmp r5, r8 - blt _0800A776 -_0800A794: - mov r5, r10 - cmp r5, 0 - blt _0800A7B4 -_0800A79A: - mov r1, sp - adds r0, r1, r5 - ldrb r0, [r0] - adds r1, r7, 0 - mov r2, r9 - bl sub_800A678 - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - subs r5, 0x1 - cmp r5, 0 - bge _0800A79A -_0800A7B4: - movs r0, 0x1 - negs r0, r0 - ldr r1, [sp, 0x10] - cmp r1, r0 - beq _0800A7CA - lsls r1, 24 - lsrs r1, 24 - movs r0, 0xA - mov r2, r9 - bl sub_800A678 -_0800A7CA: - 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_800A73C - - thumb_func_start sub_800A7DC -sub_800A7DC: @ 800A7DC - push {r4-r7,lr} - adds r3, r0, 0 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r2, 24 - movs r6, 0 - ldrb r0, [r3] - cmp r0, 0 - beq _0800A81C - adds r4, r3, 0 - lsls r5, r2, 24 -_0800A7F4: - ldrb r0, [r4] - cmp r0, 0xA - bne _0800A804 - movs r0, 0x80 - lsls r0, 17 - adds r5, r0 - movs r6, 0 - b _0800A814 -_0800A804: - ldrb r0, [r4] - adds r1, r7, r6 - lsls r1, 24 - lsrs r1, 24 - lsrs r2, r5, 24 - bl sub_800A6B0 - adds r6, 0x1 -_0800A814: - adds r4, 0x1 - ldrb r0, [r4] - cmp r0, 0 - bne _0800A7F4 -_0800A81C: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_800A7DC - - thumb_func_start sub_800A824 -sub_800A824: @ 800A824 - push {lr} - ldr r0, =0x030030e0 - ldr r0, [r0] - movs r1, 0x20 - ands r0, r1 - cmp r0, 0 -_0800A830: - beq _0800A838 - ldr r0, =0x00002222 - bl sub_8009D90 -_0800A838: - ldr r1, =0x03003140 - movs r0, 0 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_800A824 - - thumb_func_start task00_link_test -task00_link_test: @ 800A850 - push {r4-r6,lr} - sub sp, 0x20 - ldr r1, =gUnknown_082ED1E4 - mov r0, sp - bl strcat - mov r0, sp - movs r1, 0x5 - movs r2, 0x2 - bl sub_800A7DC - ldr r0, =0x03003144 - ldrb r0, [r0] - movs r1, 0x2 - movs r2, 0x1 - movs r3, 0x2 - bl sub_800A6E8 - ldr r4, =0x030030e0 - ldr r0, [r4] - movs r1, 0xF - movs r2, 0x1 - movs r3, 0x8 - bl sub_800A6E8 - ldr r0, =0x03003170 - ldrb r0, [r0, 0x1] - movs r1, 0x2 - movs r2, 0xA - movs r3, 0x2 - bl sub_800A6E8 - ldr r0, [r4] - movs r1, 0x1C - ands r0, r1 - lsrs r0, 2 - movs r1, 0xF - movs r2, 0xA - movs r3, 0x2 - bl sub_800A6E8 - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - movs r1, 0xF - movs r2, 0xC - movs r3, 0x2 - bl sub_800A6E8 - ldr r0, =0x03003160 - ldrb r0, [r0] - movs r1, 0x19 - movs r2, 0x1 - movs r3, 0x2 - bl sub_800A6E8 - ldr r0, =0x03004130 - ldrb r0, [r0] - movs r1, 0x19 - movs r2, 0x2 - movs r3, 0x2 - bl sub_800A6E8 - bl sub_800A550 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0xF - movs r2, 0x5 - movs r3, 0x2 - bl sub_800A6E8 - ldr r0, =0x0300302c - ldr r0, [r0] - movs r1, 0x2 - movs r2, 0xC - movs r3, 0x8 - bl sub_800A6E8 - ldr r0, =0x03003070 - ldr r0, [r0] - movs r1, 0x2 - movs r2, 0xD - movs r3, 0x8 - bl sub_800A6E8 - bl sub_800B2E8 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x19 - movs r2, 0x5 - movs r3, 0x1 - bl sub_800A6E8 - bl sub_800B2F8 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x19 - movs r2, 0x6 - movs r3, 0x1 - bl sub_800A6E8 - bl sub_800B320 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x19 - movs r2, 0x7 - movs r3, 0x1 - bl sub_800A6E8 - bl sub_800B33C - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x19 - movs r2, 0x8 - movs r3, 0x1 - bl sub_800A6E8 - movs r6, 0 - movs r5, 0x80 - lsls r5, 19 - ldr r4, =0x03003148 -_0800A94E: - ldrh r0, [r4] - lsrs r2, r5, 24 - movs r1, 0xA - movs r3, 0x4 - bl sub_800A6E8 - movs r0, 0x80 - lsls r0, 17 - adds r5, r0 - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - ble _0800A94E - add sp, 0x20 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end task00_link_test - - thumb_func_start sub_800A994 -sub_800A994: @ 800A994 - ldr r2, =0x0300302c - str r0, [r2] - ldr r0, =0x03003070 - str r1, [r0] - bx lr - .pool - thumb_func_end sub_800A994 - - thumb_func_start sub_800A9A8 -sub_800A9A8: @ 800A9A8 - push {r4,lr} - movs r1, 0 - movs r2, 0 - ldr r0, =0x03003100 - ldrb r0, [r0] - cmp r1, r0 - bge _0800A9CA - movs r4, 0x1 - adds r3, r0, 0 -_0800A9BA: - adds r0, r4, 0 - lsls r0, r2 - orrs r1, r0 - lsls r0, r1, 24 - lsrs r1, r0, 24 - adds r2, 0x1 - cmp r2, r3 - blt _0800A9BA -_0800A9CA: - adds r0, r1, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_800A9A8 - - thumb_func_start sub_800A9D8 -sub_800A9D8: @ 800A9D8 - push {r4-r6,lr} - movs r4, 0 - movs r5, 0 - movs r6, 0x1 - b _0800A9EE -_0800A9E2: - adds r0, r6, 0 - lsls r0, r5 - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 - adds r5, 0x1 -_0800A9EE: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - blt _0800A9E2 - adds r0, r4, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_800A9D8 - - thumb_func_start sub_800AA04 -sub_800AA04: @ 800AA04 - push {r4-r7,lr} - ldr r1, =0x03003100 - strb r0, [r1] - bl link_get_multiplayer_id - ldr r1, =0x03003120 - strb r0, [r1] - ldr r4, =0x020229e8 - ldr r3, =0x02022a74 - movs r2, 0x4 -_0800AA18: - adds r0, r3, 0 - adds r1, r4, 0 - ldm r1!, {r5-r7} - stm r0!, {r5-r7} - ldm r1!, {r5-r7} - stm r0!, {r5-r7} - ldr r1, [r1] - str r1, [r0] - adds r4, 0x1C - adds r3, 0x1C - subs r2, 0x1 - cmp r2, 0 - bge _0800AA18 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800AA04 - - thumb_func_start sub_800AA48 -sub_800AA48: @ 800AA48 - ldr r0, =0x03003100 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_800AA48 - - thumb_func_start sub_800AA54 -sub_800AA54: @ 800AA54 - ldr r0, =0x03003120 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_800AA54 - - thumb_func_start sub_800AA60 -sub_800AA60: @ 800AA60 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r3, 0 - ldr r0, =0x03003100 - ldrb r1, [r0] - mov r9, r0 - cmp r3, r1 - bge _0800AAB4 - ldr r0, =0x020229e8 - mov r12, r0 - ldr r0, =0x02022a74 - ldr r2, =0x00002288 - mov r8, r2 - ldr r7, =0x020229c6 - mov r6, r12 - adds r6, 0x14 - adds r5, r0, 0x4 - movs r4, 0 - adds r2, r1, 0 -_0800AA8A: - mov r0, r12 - adds r0, 0x4 - adds r0, r4, r0 - ldr r1, [r0] - ldr r0, [r5] - cmp r1, r0 - bne _0800AAA8 - ldrh r0, [r7] - cmp r0, r8 - bne _0800AAA6 - adds r1, r0, 0 - ldr r0, [r6] - cmp r1, r0 - bne _0800AAA8 -_0800AAA6: - adds r3, 0x1 -_0800AAA8: - adds r6, 0x1C - adds r5, 0x1C - adds r4, 0x1C - subs r2, 0x1 - cmp r2, 0 - bne _0800AA8A -_0800AAB4: - mov r0, r9 - ldrb r0, [r0] - cmp r3, r0 - bne _0800AAE4 - bl sub_800ABAC - lsls r0, 24 - lsrs r0, 24 - mov r1, r9 - ldrb r1, [r1] - cmp r0, r1 - bne _0800AAE4 - movs r0, 0x1 - b _0800AAE6 - .pool -_0800AAE4: - movs r0, 0 -_0800AAE6: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_800AA60 - - thumb_func_start sub_800AAF4 -sub_800AAF4: @ 800AAF4 - push {r4,r5,lr} - ldr r5, =0x02022a74 - movs r4, 0x3 -_0800AAFA: - adds r0, r5, 0 - movs r1, 0 - movs r2, 0x1C - bl CpuSet - adds r5, 0x1C - subs r4, 0x1 - cmp r4, 0 - bge _0800AAFA - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800AAF4 - - thumb_func_start sub_800AB18 -sub_800AB18: @ 800AB18 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r4, 0 - ldr r0, =0x03003100 - ldrb r0, [r0] - cmp r4, r0 - bcs _0800AB78 - ldr r6, =0x02022a74 - ldr r5, =0x020229e8 - movs r0, 0x8 - adds r0, r6 - mov r8, r0 - adds r7, r5, 0 - adds r7, 0x8 -_0800AB36: - lsls r0, r4, 3 - subs r0, r4 - lsls r2, r0, 2 - adds r1, r6, 0x4 - adds r1, r2, r1 - adds r0, r5, 0x4 - adds r0, r2, r0 - ldr r1, [r1] - ldr r0, [r0] - cmp r1, r0 - bne _0800AB5A - mov r1, r8 - adds r0, r2, r1 - adds r1, r2, r7 - bl CompareString - cmp r0, 0 - beq _0800AB6A -_0800AB5A: - ldr r1, =0x0300306c - movs r0, 0x1 - strb r0, [r1] - bl sub_80097E8 - ldr r0, =c2_800ACD4 - bl SetMainCallback2 -_0800AB6A: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x03003100 - ldrb r0, [r0] - cmp r4, r0 - bcc _0800AB36 -_0800AB78: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800AB18 - - thumb_func_start sub_800AB98 -sub_800AB98: @ 800AB98 - ldr r0, =0x03003100 - movs r1, 0 - strb r1, [r0] - ldr r0, =0x03003120 - strb r1, [r0] - bx lr - .pool - thumb_func_end sub_800AB98 - - thumb_func_start sub_800ABAC -sub_800ABAC: @ 800ABAC - ldr r0, =0x030030e0 - ldr r0, [r0] - movs r1, 0x1C - ands r0, r1 - lsrs r0, 2 - bx lr - .pool - thumb_func_end sub_800ABAC - - thumb_func_start sub_800ABBC -sub_800ABBC: @ 800ABBC - push {lr} - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _0800ABDC - ldr r0, =0x030030e0 - ldr r0, [r0] - lsrs r0, 5 - movs r1, 0x1 - ands r0, r1 - b _0800ABE4 - .pool -_0800ABDC: - bl sub_8011AB0 - lsls r0, 24 - lsrs r0, 24 -_0800ABE4: - pop {r1} - bx r1 - thumb_func_end sub_800ABBC - - thumb_func_start sub_800ABE8 -sub_800ABE8: @ 800ABE8 - ldr r0, =0x03000d58 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_800ABE8 - - thumb_func_start sub_800ABF4 -sub_800ABF4: @ 800ABF4 - push {lr} - lsls r0, 16 - lsrs r3, r0, 16 - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0x1 - bne _0800AC0C - bl task_add_05_task_del_08FA224_when_no_RfuFunc - b _0800AC20 - .pool -_0800AC0C: - ldr r2, =0x03003140 - ldr r1, [r2] - cmp r1, 0 - bne _0800AC20 - ldr r0, =sub_800AC80 - str r0, [r2] - ldr r0, =0x030030e4 - strb r1, [r0] - ldr r0, =0x030030f4 - strh r3, [r0] -_0800AC20: - pop {r0} - bx r0 - .pool - thumb_func_end sub_800ABF4 - - thumb_func_start sub_800AC34 -sub_800AC34: @ 800AC34 - push {lr} - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0x1 - bne _0800AC48 - bl task_add_05_task_del_08FA224_when_no_RfuFunc - b _0800AC70 - .pool -_0800AC48: - ldr r2, =0x03003140 - ldr r1, [r2] - cmp r1, 0 - beq _0800AC64 - ldr r1, =0x02022b08 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _0800AC70 - .pool -_0800AC64: - ldr r0, =sub_800AC80 - str r0, [r2] - ldr r0, =0x030030e4 - strb r1, [r0] - ldr r0, =0x030030f4 - strh r1, [r0] -_0800AC70: - pop {r0} - bx r0 - .pool - thumb_func_end sub_800AC34 - - thumb_func_start sub_800AC80 -sub_800AC80: @ 800AC80 - push {lr} - ldr r0, =0x03004130 - ldrb r0, [r0] - cmp r0, 0 - bne _0800AC96 - ldr r0, =0x00005fff - bl sub_8009D90 - ldr r1, =0x03003140 - ldr r0, =sub_800ACAC - str r0, [r1] -_0800AC96: - pop {r0} - bx r0 - .pool - thumb_func_end sub_800AC80 - - thumb_func_start sub_800ACAC -sub_800ACAC: @ 800ACAC - push {r4,lr} - bl sub_8009FCC - lsls r0, 24 - lsrs r2, r0, 24 - movs r3, 0 - movs r1, 0 - cmp r3, r2 - bge _0800ACD0 - ldr r4, =0x030030f0 -_0800ACC0: - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, 0 - beq _0800ACCA - adds r3, 0x1 -_0800ACCA: - adds r1, 0x1 - cmp r1, r2 - blt _0800ACC0 -_0800ACD0: - cmp r3, r2 - bne _0800ACF4 - ldr r2, =0x02022fec - ldr r0, [r2] - movs r1, 0x21 - negs r1, r1 - ands r0, r1 - str r0, [r2] - ldr r0, =0x03002748 - movs r4, 0x1 - strb r4, [r0] - bl sub_80097E8 - ldr r1, =0x03003140 - movs r0, 0 - str r0, [r1] - ldr r0, =0x030030e4 - strb r4, [r0] -_0800ACF4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800ACAC - - thumb_func_start sub_800AD10 -sub_800AD10: @ 800AD10 - push {lr} - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0x1 - bne _0800AD24 - bl task_add_05_task_del_08FA224_when_no_RfuFunc - b _0800AD4C - .pool -_0800AD24: - ldr r2, =0x03003140 - ldr r1, [r2] - cmp r1, 0 - beq _0800AD40 - ldr r1, =0x02022b08 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _0800AD4C - .pool -_0800AD40: - ldr r0, =sub_800AD5C - str r0, [r2] - ldr r0, =0x030030e4 - strb r1, [r0] - ldr r0, =0x030030f4 - strh r1, [r0] -_0800AD4C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_800AD10 - - thumb_func_start sub_800AD5C -sub_800AD5C: @ 800AD5C - push {lr} - ldr r0, =0x03004130 - ldrb r0, [r0] - cmp r0, 0 - bne _0800AD72 - ldr r0, =0x00005fff - bl sub_8009D90 - ldr r1, =0x03003140 - ldr r0, =sub_800AD88 - str r0, [r1] -_0800AD72: - pop {r0} - bx r0 - .pool - thumb_func_end sub_800AD5C - - thumb_func_start sub_800AD88 -sub_800AD88: @ 800AD88 - push {r4,r5,lr} - bl sub_8009FCC - lsls r0, 24 - lsrs r3, r0, 24 - movs r1, 0 - movs r2, 0 - cmp r1, r3 - bge _0800ADB6 - ldr r5, =0x030030f0 - ldr r4, =0x020229e8 -_0800AD9E: - ldrh r0, [r4, 0x1A] - cmp r0, 0x1 - beq _0800ADAC - adds r0, r2, r5 - ldrb r0, [r0] - cmp r0, 0 - beq _0800ADAE -_0800ADAC: - adds r1, 0x1 -_0800ADAE: - adds r4, 0x1C - adds r2, 0x1 - cmp r2, r3 - blt _0800AD9E -_0800ADB6: - cmp r1, r3 - bne _0800ADDA - ldr r2, =0x02022fec - ldr r0, [r2] - movs r1, 0x21 - negs r1, r1 - ands r0, r1 - str r0, [r2] - ldr r0, =0x03002748 - movs r4, 0x1 - strb r4, [r0] - bl sub_80097E8 - ldr r1, =0x03003140 - movs r0, 0 - str r0, [r1] - ldr r0, =0x030030e4 - strb r4, [r0] -_0800ADDA: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800AD88 - - thumb_func_start sub_800ADF8 -sub_800ADF8: @ 800ADF8 - push {lr} - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0x1 - bne _0800AE0C - bl sub_8010434 - b _0800AE1E - .pool -_0800AE0C: - ldr r1, =0x03003140 - ldr r0, [r1] - cmp r0, 0 - bne _0800AE18 - ldr r0, =sub_800AE30 - str r0, [r1] -_0800AE18: - ldr r1, =0x030030e4 - movs r0, 0 - strb r0, [r1] -_0800AE1E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_800ADF8 - - thumb_func_start sub_800AE30 -sub_800AE30: @ 800AE30 - push {lr} - ldr r0, =0x03004130 - ldrb r0, [r0] - cmp r0, 0 - bne _0800AE46 - ldr r0, =0x00002ffe - bl sub_8009D90 - ldr r1, =0x03003140 - ldr r0, =sub_800AE5C - str r0, [r1] -_0800AE46: - pop {r0} - bx r0 - .pool - thumb_func_end sub_800AE30 - - thumb_func_start sub_800AE5C -sub_800AE5C: @ 800AE5C - push {r4,lr} - bl sub_8009FCC - lsls r0, 24 - lsrs r2, r0, 24 - movs r1, 0 - cmp r1, r2 - bcs _0800AE86 - ldr r3, =0x030030ec - ldrb r0, [r3] - cmp r0, 0 - beq _0800AE86 -_0800AE74: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, r2 - bcs _0800AE86 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, 0 - bne _0800AE74 -_0800AE86: - cmp r1, r2 - bne _0800AEA4 - movs r1, 0 - ldr r4, =0x03003140 - ldr r3, =0x030030ec - movs r2, 0 -_0800AE92: - adds r0, r1, r3 - strb r2, [r0] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x3 - bls _0800AE92 - movs r0, 0 - str r0, [r4] -_0800AEA4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800AE5C - - thumb_func_start sub_800AEB4 -sub_800AEB4: @ 800AEB4 - push {lr} - ldr r0, =0x020229c4 - ldrb r0, [r0] - cmp r0, 0 - beq _0800AEF4 - ldr r0, =0x030030e0 - ldr r2, [r0] - movs r0, 0xFE - lsls r0, 11 - ands r0, r2 - cmp r0, 0 - beq _0800AEF4 - ldr r0, =0x030030f8 - ldrb r0, [r0] - cmp r0, 0 - bne _0800AEEA - ldr r1, =0x02022b00 - str r2, [r1] - ldr r0, =0x03004130 - ldrb r0, [r0] - strb r0, [r1, 0x4] - ldr r0, =0x03003160 - ldrb r0, [r0] - strb r0, [r1, 0x5] - ldr r0, =c2_800ACD4 - bl SetMainCallback2 -_0800AEEA: - ldr r1, =0x0300306c - movs r0, 0x1 - strb r0, [r1] - bl sub_80097E8 -_0800AEF4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_800AEB4 - - thumb_func_start sub_800AF18 -sub_800AF18: @ 800AF18 - push {r4,lr} - ldr r4, =0x02022b00 - str r0, [r4] - strb r1, [r4, 0x5] - strb r2, [r4, 0x4] - strb r3, [r4, 0x6] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800AF18 - - thumb_func_start c2_800ACD4 -c2_800ACD4: @ 800AF30 - push {r4,lr} - movs r0, 0 - movs r1, 0 - bl SetGpuReg - ldr r0, =0x030075f0 - bl MPlayStop_rev01 - ldr r0, =0x03007630 - bl MPlayStop_rev01 - ldr r0, =0x03007800 - bl MPlayStop_rev01 - ldr r0, =0x02000000 - movs r1, 0xE0 - lsls r1, 9 - bl InitHeap - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - bl pal_fade_control_reset_maybe - movs r0, 0 - movs r1, 0 - movs r2, 0x2 - bl rboxid_80040B8 - bl clear_tasks - bl remove_some_task - ldr r1, =0x030030fc - ldrb r0, [r1] - cmp r0, 0 - beq _0800AF8C - ldr r0, =0x02022b00 - ldrb r0, [r0, 0x6] - cmp r0, 0 - bne _0800AF88 - movs r0, 0x3 - strb r0, [r1] -_0800AF88: - bl sub_800E604 -_0800AF8C: - ldr r0, =sub_80096BC - bl SetVBlankCallback - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_082ED1FC - movs r0, 0 - movs r2, 0x2 - bl InitBgsFromTemplates - ldr r4, =0x02022b0c - movs r0, 0x80 - lsls r0, 4 - bl Alloc - adds r1, r0, 0 - str r1, [r4] - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r0, =gUnknown_082ED204 - bl InitWindows - lsls r0, 16 - cmp r0, 0 - beq _0800B03C - bl DeactivateAllTextPrinters - bl reset_temp_tile_data_buffers - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x10 - movs r1, 0 - bl SetGpuReg - movs r0, 0x12 - movs r1, 0 - bl SetGpuReg - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - movs r0, 0x16 - movs r1, 0 - bl SetGpuReg - movs r1, 0xE0 - lsls r1, 8 - movs r0, 0 - bl ClearGpuRegBits - ldr r0, =gUnknown_0860F074 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r1, =0x03002700 - movs r0, 0 - strb r0, [r1] - ldr r0, =sub_8009404 - movs r1, 0 - bl AddTask - bl sub_80A2F30 - ldr r1, =0x030022c0 - movs r0, 0 - str r0, [r1] - bl RunActiveTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - ldr r0, =sub_800B1A0 - bl SetMainCallback2 -_0800B03C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end c2_800ACD4 - - thumb_func_start sub_800B080 -sub_800B080: @ 800B080 - push {r4,r5,lr} - sub sp, 0xC - ldr r1, =gUnknown_082ED168 - movs r0, 0 - movs r2, 0x20 - movs r3, 0 - bl LoadBgTiles - ldr r1, =gUnknown_082EC88C - movs r5, 0 - str r5, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r1, =gUnknown_082ECD34 - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - ldr r0, =gUnknown_082EC86C - movs r1, 0 - movs r2, 0x20 - bl gpu_pal_apply - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x2 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r4, =gUnknown_082ED224 - str r4, [sp] - str r5, [sp, 0x4] - ldr r0, =gUnknown_085EE4F7 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0x3 - movs r2, 0x2 - movs r3, 0x6 - bl box_print - str r4, [sp] - str r5, [sp, 0x4] - ldr r0, =gUnknown_085EE50C - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x3 - movs r2, 0x2 - movs r3, 0x1 - bl box_print - movs r0, 0 - bl PutWindowTilemap - movs r0, 0x2 - bl PutWindowTilemap - movs r0, 0 - movs r1, 0 - bl CopyWindowToVram - movs r0, 0x2 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800B080 - - thumb_func_start sub_800B138 -sub_800B138: @ 800B138 - push {lr} - sub sp, 0xC - ldr r1, =gUnknown_082ED168 - movs r0, 0 - movs r2, 0x20 - movs r3, 0 - bl LoadBgTiles - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x2 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_082ED224 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - ldr r0, =gUnknown_085EE4A4 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0x2 - movs r3, 0 - bl box_print - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0x2 - bl PutWindowTilemap - movs r0, 0x1 - movs r1, 0 - bl CopyWindowToVram - movs r0, 0x2 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_800B138 - - thumb_func_start sub_800B1A0 -sub_800B1A0: @ 800B1A0 - push {r4,lr} - sub sp, 0xC - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1E - beq _0800B20C - cmp r0, 0x1E - bgt _0800B1C4 - cmp r0, 0 - beq _0800B1D8 - cmp r0, 0x2 - beq _0800B1F2 - b _0800B260 - .pool -_0800B1C4: - cmp r0, 0x5A - beq _0800B20C - cmp r0, 0x5A - bgt _0800B1D2 - cmp r0, 0x3C - beq _0800B20C - b _0800B260 -_0800B1D2: - cmp r0, 0x82 - beq _0800B214 - b _0800B260 -_0800B1D8: - ldr r0, =0x02022b00 - ldrb r0, [r0, 0x6] - cmp r0, 0 - beq _0800B1EC - bl sub_800B080 - b _0800B260 - .pool -_0800B1EC: - bl sub_800B138 - b _0800B260 -_0800B1F2: - movs r0, 0 - bl ShowBg - ldr r0, =0x02022b00 - ldrb r0, [r0, 0x6] - cmp r0, 0 - beq _0800B260 - movs r0, 0x1 - bl ShowBg - b _0800B260 - .pool -_0800B20C: - movs r0, 0x16 - bl audio_play - b _0800B260 -_0800B214: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0x2 - bne _0800B244 - ldr r0, =gUnknown_082ED224 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - ldr r0, =gUnknown_085EE572 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0x3 - movs r2, 0x2 - movs r3, 0x14 - bl box_print - b _0800B260 - .pool -_0800B244: - cmp r0, 0x1 - bne _0800B260 - ldr r0, =gUnknown_082ED224 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - ldr r0, =gUnknown_085EE553 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0x3 - movs r2, 0x2 - movs r3, 0x14 - bl box_print -_0800B260: - ldr r0, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r0, r2 - ldrb r1, [r1] - cmp r1, 0xA0 - bne _0800B2D0 - ldr r4, =0x030030fc - ldrb r2, [r4] - cmp r2, 0x1 - bne _0800B2A8 - ldrh r0, [r0, 0x2E] - ands r2, r0 - cmp r2, 0 - beq _0800B2C2 - movs r0, 0x15 - bl audio_play - movs r0, 0 - strb r0, [r4] - ldr r1, =0x02022b00 - movs r0, 0 - strb r0, [r1, 0x6] - bl sub_81700F8 - b _0800B2C2 - .pool -_0800B2A8: - cmp r2, 0x2 - bne _0800B2C2 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0800B2C2 - bl rfu_REQ_stopMode - bl rfu_waitREQComplete - bl Reset -_0800B2C2: - ldr r0, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r0, r2 - ldrb r1, [r1] - cmp r1, 0xA0 - beq _0800B2DC -_0800B2D0: - movs r2, 0x87 - lsls r2, 3 - adds r1, r0, r2 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_0800B2DC: - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800B1A0 - - thumb_func_start sub_800B2E8 -sub_800B2E8: @ 800B2E8 - ldr r0, =0x04000128 - ldrh r0, [r0] - lsrs r0, 2 - movs r1, 0x1 - ands r0, r1 - bx lr - .pool - thumb_func_end sub_800B2E8 - - thumb_func_start sub_800B2F8 -sub_800B2F8: @ 800B2F8 - push {lr} - movs r3, 0 - ldr r2, =0x04000128 - ldrh r1, [r2] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0800B314 - ldrh r1, [r2] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - bne _0800B314 - movs r3, 0x1 -_0800B314: - adds r0, r3, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_800B2F8 - - thumb_func_start sub_800B320 -sub_800B320: @ 800B320 - ldr r0, =0x030030e0 - ldr r0, [r0] - lsrs r0, 6 - movs r1, 0x1 - ands r0, r1 - bx lr - .pool - thumb_func_end sub_800B320 - - thumb_func_start sub_800B330 -sub_800B330: @ 800B330 - ldr r1, =0x030030f8 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_800B330 - - thumb_func_start sub_800B33C -sub_800B33C: @ 800B33C - ldr r0, =0x0300306c - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_800B33C - - thumb_func_start sub_800B348 -sub_800B348: @ 800B348 - push {r4-r6,lr} - bl sub_8009638 - ldr r1, =0x03003030 - adds r2, r1, 0 - adds r2, 0x10 - ldr r0, =0x020229cc - ldm r0!, {r3-r5} - stm r2!, {r3-r5} - ldm r0!, {r3,r4,r6} - stm r2!, {r3,r4,r6} - ldr r0, [r0] - str r0, [r2] - ldr r3, =gUnknown_082ED1D4 - adds r2, r1, 0 - adds r0, r3, 0 - ldm r0!, {r4-r6} - stm r2!, {r4-r6} - ldrh r4, [r0] - strh r4, [r2] - ldrb r0, [r0, 0x2] - strb r0, [r2, 0x2] - adds r0, r1, 0 - adds r0, 0x2C - ldm r3!, {r2,r5,r6} - stm r0!, {r2,r5,r6} - ldrh r2, [r3] - strh r2, [r0] - ldrb r2, [r3, 0x2] - strb r2, [r0, 0x2] - ldr r0, =0x020228c4 - movs r2, 0x3C - bl memcpy - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800B348 - - thumb_func_start sub_800B3A4 -sub_800B3A4: @ 800B3A4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r2, r0, 8 - ldr r1, =0x020223c4 - adds r4, r2, r1 - lsls r2, r0, 3 - subs r2, r0 - lsls r2, 2 - ldr r0, =0x020229e8 - adds r2, r0 - adds r1, r2, 0 - adds r0, r4, 0 - adds r0, 0x10 - ldm r0!, {r3,r5,r6} - stm r1!, {r3,r5,r6} - ldm r0!, {r3,r5,r6} - stm r1!, {r3,r5,r6} - ldr r0, [r0] - str r0, [r1] - adds r0, r2, 0 - bl sub_800B524 - ldr r5, =gUnknown_082ED1D4 - adds r0, r4, 0 - adds r1, r5, 0 - bl strcmp - cmp r0, 0 - bne _0800B3EE - adds r0, r4, 0 - adds r0, 0x2C - adds r1, r5, 0 - bl strcmp - cmp r0, 0 - beq _0800B3F4 -_0800B3EE: - ldr r0, =c2_800ACD4 - bl SetMainCallback2 -_0800B3F4: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800B3A4 - - thumb_func_start HandleLinkConnection -HandleLinkConnection: @ 800B40C - push {r4,r5,lr} - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _0800B45C - ldr r0, =0x03003144 - ldr r1, =0x03003110 - ldr r2, =0x03003090 - bl sub_800B638 - ldr r4, =0x030030e0 - str r0, [r4] - ldr r0, =0x030022ec - bl sub_80099E0 - ldr r0, [r4] - movs r1, 0x80 - lsls r1, 1 - ands r0, r1 - cmp r0, 0 - beq _0800B480 - bl sub_808766C - cmp r0, 0x1 - bne _0800B480 -_0800B43E: - movs r0, 0x1 - b _0800B482 - .pool -_0800B45C: - bl sub_8010EC0 - adds r4, r0, 0 - bl sub_8010F1C - adds r5, r0, 0 - bl sub_808766C - cmp r0, 0x1 - bne _0800B480 - cmp r4, 0x1 - beq _0800B43E - bl sub_800F0B8 - cmp r0, 0 - bne _0800B43E - cmp r5, 0 - bne _0800B43E -_0800B480: - movs r0, 0 -_0800B482: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end HandleLinkConnection - - thumb_func_start sub_800B488 -sub_800B488: @ 800B488 - push {lr} - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _0800B498 - ldr r1, =0x030030fc - movs r0, 0x1 - strb r0, [r1] -_0800B498: - pop {r0} - bx r0 - .pool - thumb_func_end sub_800B488 - - thumb_func_start sub_800B4A4 -sub_800B4A4: @ 800B4A4 - push {lr} - ldr r0, =0x03003124 - ldrb r1, [r0] - cmp r1, 0 - bne _0800B4B2 - ldr r0, =0x030030fc - strb r1, [r0] -_0800B4B2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_800B4A4 - - thumb_func_start sub_800B4C0 -sub_800B4C0: @ 800B4C0 - push {lr} - ldr r0, =0x03003124 - ldrb r1, [r0] - cmp r1, 0 - bne _0800B4CE - ldr r0, =0x030030fc - strb r1, [r0] -_0800B4CE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_800B4C0 - - thumb_func_start sub_800B4DC -sub_800B4DC: @ 800B4DC - push {lr} - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _0800B4FC - ldr r0, =0x03003170 - ldr r1, =0x00000fbd - adds r0, r1 - ldrb r0, [r0] - b _0800B500 - .pool -_0800B4FC: - bl sub_80124D4 -_0800B500: - pop {r1} - bx r1 - thumb_func_end sub_800B4DC - - thumb_func_start sub_800B504 -sub_800B504: @ 800B504 - push {lr} - bl sub_800B4DC - cmp r0, 0x2 - bhi _0800B512 - movs r0, 0 - b _0800B514 -_0800B512: - movs r0, 0x1 -_0800B514: - pop {r1} - bx r1 - thumb_func_end sub_800B504 - - thumb_func_start sub_800B518 -sub_800B518: @ 800B518 - ldr r0, =0x030030fc - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_800B518 - - thumb_func_start sub_800B524 -sub_800B524: @ 800B524 - push {lr} - ldrb r1, [r0, 0x10] - strb r1, [r0, 0x12] - adds r2, r0, 0 - adds r2, 0x8 - ldrb r1, [r0, 0x1A] - adds r0, r2, 0 - bl StopMusicWhileStringIsPrinted - pop {r0} - bx r0 - thumb_func_end sub_800B524 - - thumb_func_start sub_800B53C -sub_800B53C: @ 800B53C - push {lr} - sub sp, 0x4 - movs r0, 0xC0 - bl DisableInterrupts - ldr r1, =0x04000128 - movs r2, 0x80 - lsls r2, 6 - adds r0, r2, 0 - strh r0, [r1] - ldr r0, =0x0400010e - movs r2, 0 - strh r2, [r0] - adds r1, 0xDA - movs r0, 0xC0 - strh r0, [r1] - ldr r0, =0x0400012a - strh r2, [r0] - ldr r2, =0x04000120 - movs r0, 0 - movs r1, 0 - str r0, [r2] - str r1, [r2, 0x4] - str r0, [sp] - ldr r1, =0x03003170 - ldr r2, =0x050003f0 - mov r0, sp - bl CpuSet - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_800B53C - - thumb_func_start sub_800B594 -sub_800B594: @ 800B594 - push {r4,r5,lr} - sub sp, 0x4 - movs r0, 0xC0 - bl DisableInterrupts - ldr r0, =0x04000134 - movs r4, 0 - strh r4, [r0] - ldr r2, =0x04000128 - movs r1, 0x80 - lsls r1, 6 - adds r0, r1, 0 - strh r0, [r2] - ldrh r0, [r2] - ldr r3, =0x00004003 - adds r1, r3, 0 - orrs r0, r1 - strh r0, [r2] - movs r0, 0x80 - bl EnableInterrupts - ldr r0, =0x0400012a - strh r4, [r0] - movs r5, 0 - str r5, [sp] - ldr r1, =0x03003170 - ldr r2, =0x050003f0 - mov r0, sp - bl CpuSet - ldr r0, =0x03000d6c - strb r4, [r0] - ldr r0, =0x03000d6e - strh r5, [r0] - ldr r0, =0x03000d70 - strh r5, [r0] - ldr r0, =0x03000d72 - strb r4, [r0] - ldr r0, =0x03000d73 - strb r4, [r0] - ldr r0, =0x03003160 - strb r4, [r0] - ldr r0, =0x03004130 - strb r4, [r0] - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800B594 - - thumb_func_start sub_800B628 -sub_800B628: @ 800B628 - push {lr} - bl sub_800B594 - bl sub_800B53C - pop {r0} - bx r0 - thumb_func_end sub_800B628 - - thumb_func_start sub_800B638 -sub_800B638: @ 800B638 - push {r4-r7,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - ldr r0, =0x03003170 - ldrb r0, [r0, 0x1] - cmp r0, 0x4 - bhi _0800B6EA - lsls r0, 2 - ldr r1, =_0800B65C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0800B65C: - .4byte _0800B670 - .4byte _0800B680 - .4byte _0800B698 - .4byte _0800B6D4 - .4byte _0800B6DE -_0800B670: - bl sub_800B53C - ldr r1, =0x03003170 - movs r0, 0x1 - strb r0, [r1, 0x1] - b _0800B6EA - .pool -_0800B680: - ldrb r0, [r4] - cmp r0, 0x1 - bne _0800B6EA - bl sub_800B594 - ldr r1, =0x03003170 - movs r0, 0x2 - strb r0, [r1, 0x1] - b _0800B6EA - .pool -_0800B698: - ldrb r1, [r4] - cmp r1, 0x1 - beq _0800B6A8 - cmp r1, 0x2 - beq _0800B6C0 - bl sub_800B764 - b _0800B6EA -_0800B6A8: - ldr r2, =0x03003170 - ldrb r0, [r2] - cmp r0, 0x8 - bne _0800B6EA - ldrb r0, [r2, 0x3] - cmp r0, 0x1 - bls _0800B6EA - strb r1, [r2, 0xE] - b _0800B6EA - .pool -_0800B6C0: - ldr r0, =0x03003170 - movs r1, 0 - strb r1, [r0, 0x1] - ldr r0, =0x0400012a - strh r1, [r0] - b _0800B6EA - .pool -_0800B6D4: - bl sub_800B790 - ldr r1, =0x03003170 - movs r0, 0x4 - strb r0, [r1, 0x1] -_0800B6DE: - adds r0, r5, 0 - bl sub_800B7C0 - adds r0, r6, 0 - bl sub_800B8A8 -_0800B6EA: - movs r0, 0 - strb r0, [r4] - ldr r1, =0x03003170 - ldrb r2, [r1, 0x2] - ldrb r0, [r1, 0x3] - lsls r0, 2 - orrs r2, r0 - ldrb r0, [r1] - cmp r0, 0x8 - bne _0800B702 - movs r0, 0x20 - orrs r2, r0 -_0800B702: - ldrb r0, [r1, 0xC] - lsls r3, r0, 8 - ldrb r0, [r1, 0xF] - lsls r4, r0, 9 - ldrb r0, [r1, 0x10] - lsls r5, r0, 12 - ldrb r0, [r1, 0x11] - lsls r6, r0, 13 - ldrb r0, [r1, 0x12] - lsls r7, r0, 14 - ldrb r0, [r1, 0x1] - cmp r0, 0x4 - bne _0800B728 - movs r0, 0x40 - orrs r0, r3 - orrs r0, r2 - b _0800B72C - .pool -_0800B728: - adds r0, r2, 0 - orrs r0, r3 -_0800B72C: - orrs r0, r4 - orrs r0, r5 - orrs r0, r6 - orrs r0, r7 - adds r2, r0, 0 - ldrb r3, [r1, 0x13] - cmp r3, 0x1 - bne _0800B742 - movs r0, 0x80 - lsls r0, 9 - orrs r2, r0 -_0800B742: - ldrb r0, [r1, 0x2] - cmp r0, 0x3 - bls _0800B74E - movs r0, 0x80 - lsls r0, 10 - orrs r2, r0 -_0800B74E: - adds r1, r2, 0 - cmp r3, 0x2 - bne _0800B75A - movs r0, 0x80 - lsls r0, 11 - orrs r1, r0 -_0800B75A: - adds r0, r1, 0 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_800B638 - - thumb_func_start sub_800B764 -sub_800B764: @ 800B764 - push {lr} - ldr r0, =0x04000128 - ldr r1, [r0] - movs r0, 0xC - ands r1, r0 - ldr r2, =0x03003170 - cmp r1, 0x8 - bne _0800B788 - ldrb r0, [r2, 0x2] - cmp r0, 0 - bne _0800B788 - strb r1, [r2] - b _0800B78C - .pool -_0800B788: - movs r0, 0 - strb r0, [r2] -_0800B78C: - pop {r0} - bx r0 - thumb_func_end sub_800B764 - - thumb_func_start sub_800B790 -sub_800B790: @ 800B790 - push {lr} - ldr r0, =0x03003170 - ldrb r0, [r0] - cmp r0, 0 - beq _0800B7AE - ldr r1, =0x0400010c - ldr r2, =0x0000ff3b - adds r0, r2, 0 - strh r0, [r1] - adds r1, 0x2 - movs r0, 0x41 - strh r0, [r1] - movs r0, 0x40 - bl EnableInterrupts -_0800B7AE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_800B790 - - thumb_func_start sub_800B7C0 -sub_800B7C0: @ 800B7C0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r3, r0, 0 - ldr r2, =0x03004134 - ldr r1, =0x04000208 - ldrh r0, [r1] - strh r0, [r2] - movs r0, 0 - strh r0, [r1] - ldr r1, =0x03003170 - ldr r4, =0x00000339 - adds r0, r1, r4 - ldrb r4, [r0] - adds r6, r1, 0 - cmp r4, 0x31 - bhi _0800B850 - movs r1, 0xCE - lsls r1, 2 - adds r0, r6, r1 - ldrb r0, [r0] - adds r0, r4, r0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x31 - bls _0800B7FE - subs r0, 0x32 - lsls r0, 24 - lsrs r0, 24 -_0800B7FE: - movs r2, 0 - ldr r4, =0x03000d6e - mov r9, r4 - ldr r1, =0x03003160 - mov r10, r1 - lsls r5, r0, 1 - movs r0, 0x18 - adds r0, r6 - mov r8, r0 - mov r12, r2 - movs r7, 0x64 -_0800B814: - ldrh r0, [r4] - ldrh r1, [r3] - orrs r0, r1 - strh r0, [r4] - adds r0, r2, 0 - muls r0, r7 - adds r0, r5, r0 - add r0, r8 - strh r1, [r0] - mov r1, r12 - strh r1, [r3] - adds r3, 0x2 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x7 - bls _0800B814 - b _0800B85C - .pool -_0800B850: - movs r0, 0x1 - strb r0, [r6, 0x12] - ldr r2, =0x03000d6e - mov r9, r2 - ldr r4, =0x03003160 - mov r10, r4 -_0800B85C: - mov r1, r9 - ldrh r0, [r1] - cmp r0, 0 - beq _0800B874 - ldr r2, =0x00000339 - adds r0, r6, r2 - ldrb r1, [r0] - adds r1, 0x1 - movs r2, 0 - strb r1, [r0] - mov r4, r9 - strh r2, [r4] -_0800B874: - ldr r1, =0x04000208 - ldr r2, =0x03004134 - ldrh r0, [r2] - strh r0, [r1] - ldr r4, =0x00000339 - adds r0, r6, r4 - ldrb r0, [r0] - mov r1, r10 - strb r0, [r1] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800B7C0 - - thumb_func_start sub_800B8A8 -sub_800B8A8: @ 800B8A8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r9, r0 - ldr r2, =0x03004134 - ldr r1, =0x04000208 - ldrh r0, [r1] - strh r0, [r2] - movs r0, 0 - strh r0, [r1] - ldr r1, =0x03003170 - ldr r3, =0x00000fbd - adds r0, r1, r3 - ldrb r0, [r0] - mov r12, r1 - cmp r0, 0 - bne _0800B914 - movs r3, 0 - ldrb r0, [r1, 0x3] - cmp r3, r0 - bcs _0800B8FA - movs r5, 0 - adds r6, r0, 0 -_0800B8DA: - movs r2, 0 - lsls r1, r3, 4 - adds r4, r3, 0x1 - add r1, r9 -_0800B8E2: - lsls r0, r2, 1 - adds r0, r1 - strh r5, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x7 - bls _0800B8E2 - lsls r0, r4, 24 - lsrs r3, r0, 24 - cmp r3, r6 - bcc _0800B8DA -_0800B8FA: - movs r0, 0x1 - mov r7, r12 - strb r0, [r7, 0xC] - b _0800B990 - .pool -_0800B914: - movs r3, 0 - mov r0, r12 - ldrb r1, [r0, 0x3] - cmp r3, r1 - bcs _0800B96A - ldr r0, =0x00000fbc - add r0, r12 - ldrb r0, [r0] - lsls r6, r0, 1 - movs r2, 0xCF - lsls r2, 2 - add r2, r12 - mov r8, r2 - mov r10, r1 -_0800B930: - movs r2, 0 - lsls r1, r3, 4 - adds r4, r3, 0x1 - lsls r0, r3, 1 - mov r7, r9 - adds r5, r1, r7 - adds r0, r3 - lsls r0, 3 - adds r0, r3 - lsls r3, r0, 5 -_0800B944: - lsls r1, r2, 1 - adds r1, r5 - movs r7, 0x64 - adds r0, r2, 0 - muls r0, r7 - adds r0, r6, r0 - adds r0, r3 - add r0, r8 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x7 - bls _0800B944 - lsls r0, r4, 24 - lsrs r3, r0, 24 - cmp r3, r10 - bcc _0800B930 -_0800B96A: - mov r2, r12 - ldr r0, =0x00000fbd - adds r1, r2, r0 - ldrb r0, [r1] - subs r0, 0x1 - movs r3, 0 - strb r0, [r1] - ldr r1, =0x00000fbc - adds r2, r1 - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x31 - bls _0800B98C - strb r3, [r2] -_0800B98C: - mov r2, r12 - strb r3, [r2, 0xC] -_0800B990: - ldr r1, =0x04000208 - ldr r3, =0x03004134 - ldrh r0, [r3] - strh r0, [r1] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800B8A8 - - thumb_func_start sub_800B9B8 -sub_800B9B8: @ 800B9B8 - push {r4,lr} - ldr r3, =0x03003170 - ldrb r4, [r3] - cmp r4, 0 - beq _0800B9F4 - ldrb r0, [r3, 0x1] - cmp r0, 0x2 - beq _0800B9EE - cmp r0, 0x4 - bne _0800BA1E - movs r0, 0xD - ldrsb r0, [r3, r0] - cmp r0, 0x8 - bgt _0800B9E4 - ldrb r0, [r3, 0x10] - cmp r0, 0x1 - beq _0800B9EE - movs r0, 0x1 - strb r0, [r3, 0x13] - b _0800BA1E - .pool -_0800B9E4: - ldrb r0, [r3, 0x13] - cmp r0, 0x1 - beq _0800BA1E - movs r0, 0 - strb r0, [r3, 0xD] -_0800B9EE: - bl sub_800BAC0 - b _0800BA1E -_0800B9F4: - ldrb r2, [r3, 0x1] - cmp r2, 0x4 - beq _0800B9FE - cmp r2, 0x2 - bne _0800BA1E -_0800B9FE: - ldr r1, =0x03000d6c - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xA - bls _0800BA1E - cmp r2, 0x4 - bne _0800BA16 - movs r0, 0x2 - strb r0, [r3, 0x13] -_0800BA16: - cmp r2, 0x2 - bne _0800BA1E - strb r4, [r3, 0x3] - strb r4, [r3, 0xF] -_0800BA1E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800B9B8 - - thumb_func_start Timer3Intr -Timer3Intr: @ 800BA28 - push {lr} - bl sub_800BD98 - bl sub_800BAC0 - pop {r0} - bx r0 - thumb_func_end Timer3Intr - - thumb_func_start sub_800BA38 -sub_800BA38: @ 800BA38 - push {r4,lr} - ldr r4, =0x03003170 - ldr r0, =0x04000128 - ldr r1, [r0] - lsls r0, r1, 26 - lsrs r0, 30 - strb r0, [r4, 0x2] - ldrb r0, [r4, 0x1] - cmp r0, 0x2 - beq _0800BA6C - cmp r0, 0x4 - bne _0800BA8A - lsls r0, r1, 25 - lsrs r0, 31 - strb r0, [r4, 0x10] - bl sub_800BBCC - bl sub_800BCE4 - bl sub_800BDCC - b _0800BA8A - .pool -_0800BA6C: - bl sub_800BAD0 - lsls r0, 24 - cmp r0, 0 - beq _0800BA8A - ldrb r0, [r4] - cmp r0, 0 - beq _0800BA86 - movs r0, 0x3 - strb r0, [r4, 0x1] - movs r0, 0x8 - strb r0, [r4, 0xD] - b _0800BA8A -_0800BA86: - movs r0, 0x4 - strb r0, [r4, 0x1] -_0800BA8A: - ldr r3, =0x03003170 - ldrb r0, [r3, 0xD] - adds r0, 0x1 - movs r2, 0 - strb r0, [r3, 0xD] - ldr r1, =0x03000d6c - strb r2, [r1] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x8 - bne _0800BAAA - ldr r0, =0x03004130 - ldr r2, =0x00000fbd - adds r1, r3, r2 - ldrb r1, [r1] - strb r1, [r0] -_0800BAAA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800BA38 - - thumb_func_start sub_800BAC0 -sub_800BAC0: @ 800BAC0 - ldr r0, =0x04000128 - ldrh r1, [r0] - movs r2, 0x80 - orrs r1, r2 - strh r1, [r0] - bx lr - .pool - thumb_func_end sub_800BAC0 - - thumb_func_start sub_800BAD0 -sub_800BAD0: @ 800BAD0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r5, 0 - ldr r6, =0x0000ffff - ldr r0, =0x03003170 - ldrb r1, [r0, 0xE] - adds r7, r0, 0 - cmp r1, 0x1 - bne _0800BAFC - ldr r1, =0x0400012a - ldr r2, =0x00008fff - b _0800BB00 - .pool -_0800BAFC: - ldr r1, =0x0400012a - ldr r2, =0x0000b9a0 -_0800BB00: - adds r0, r2, 0 - strh r0, [r1] - ldr r2, =0x03003174 - ldr r3, =0x04000120 - ldr r0, [r3] - ldr r1, [r3, 0x4] - str r0, [r2] - str r1, [r2, 0x4] - movs r0, 0 - movs r1, 0 - str r0, [r3] - str r1, [r3, 0x4] - strb r0, [r2, 0xA] - movs r4, 0 - ldr r0, =0x03000d73 - mov r9, r0 - mov r8, r2 - ldr r2, =0x00008fff - ldr r1, =0x0000ffff - mov r12, r1 -_0800BB28: - lsls r0, r4, 1 - add r0, r8 - ldrh r3, [r0] - movs r0, 0x4 - negs r0, r0 - ands r0, r3 - ldr r1, =0x0000b9a0 - cmp r0, r1 - beq _0800BB40 - adds r0, r3, 0 - cmp r0, r2 - bne _0800BB70 -_0800BB40: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r3, 0 - cmp r6, r0 - bls _0800BB78 - cmp r0, 0 - beq _0800BB78 - adds r6, r3, 0 - b _0800BB78 - .pool -_0800BB70: - cmp r0, r12 - beq _0800BB82 - movs r5, 0 - b _0800BB82 -_0800BB78: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _0800BB28 -_0800BB82: - strb r5, [r7, 0x3] - adds r0, r5, 0 - cmp r0, 0x1 - bls _0800BBB2 - mov r2, r9 - ldrb r2, [r2] - cmp r0, r2 - bne _0800BBA4 - ldrh r1, [r7, 0x4] - ldr r0, =0x00008fff - cmp r1, r0 - bne _0800BBA4 - movs r0, 0x1 - b _0800BBBE - .pool -_0800BBA4: - ldrb r0, [r7, 0x3] - cmp r0, 0x1 - bls _0800BBB2 - movs r0, 0x3 - ands r6, r0 - adds r0, r6, 0x1 - b _0800BBB4 -_0800BBB2: - movs r0, 0 -_0800BBB4: - strb r0, [r7, 0xF] - ldrb r0, [r7, 0x3] - mov r1, r9 - strb r0, [r1] - movs r0, 0 -_0800BBBE: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_800BAD0 - - thumb_func_start sub_800BBCC -sub_800BBCC: @ 800BBCC - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - ldr r0, =0x04000120 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp] - str r1, [sp, 0x4] - ldr r0, =0x03003170 - ldrb r1, [r0, 0x16] - adds r6, r0, 0 - cmp r1, 0 - bne _0800BC30 - movs r4, 0 - ldr r7, =0x03000d72 - ldrb r0, [r6, 0x3] - cmp r4, r0 - bcs _0800BC1A - adds r5, r6, 0 - ldrh r1, [r6, 0x14] - adds r3, r7, 0 - adds r2, r6, 0 -_0800BBFA: - lsls r0, r4, 1 - add r0, sp - ldrh r0, [r0] - cmp r1, r0 - beq _0800BC0E - ldrb r0, [r3] - cmp r0, 0 - beq _0800BC0E - movs r0, 0x1 - strb r0, [r5, 0x11] -_0800BC0E: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - ldrb r0, [r2, 0x3] - cmp r4, r0 - bcc _0800BBFA -_0800BC1A: - movs r0, 0 - strh r0, [r6, 0x14] - movs r0, 0x1 - strb r0, [r7] - b _0800BCD0 - .pool -_0800BC30: - ldr r2, =0x00000fbc - adds r1, r6, r2 - adds r2, 0x1 - adds r0, r6, r2 - ldrb r2, [r0] - ldrb r1, [r1] - adds r0, r2, r1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x31 - bls _0800BC4C - subs r0, 0x32 - lsls r0, 24 - lsrs r0, 24 -_0800BC4C: - cmp r2, 0x31 - bhi _0800BCA8 - movs r4, 0 - ldrb r1, [r6, 0x3] - cmp r4, r1 - bcs _0800BCAC - adds r5, r6, 0 - ldr r7, =0x03000d70 - lsls r0, 1 - mov r12, r0 - movs r2, 0xCF - lsls r2, 2 - adds r2, r6 - mov r8, r2 -_0800BC68: - lsls r1, r4, 1 - mov r2, sp - adds r0, r2, r1 - ldrh r3, [r0] - ldrh r2, [r5, 0x14] - adds r0, r3, r2 - strh r0, [r5, 0x14] - ldrh r0, [r7] - orrs r0, r3 - strh r0, [r7] - ldrb r2, [r5, 0x17] - movs r0, 0x64 - muls r0, r2 - add r0, r12 - adds r1, r4 - lsls r1, 3 - adds r1, r4 - lsls r1, 5 - adds r0, r1 - add r0, r8 - strh r3, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - ldrb r0, [r5, 0x3] - cmp r4, r0 - bcc _0800BC68 - b _0800BCAC - .pool -_0800BCA8: - movs r0, 0x2 - strb r0, [r6, 0x12] -_0800BCAC: - ldrb r0, [r6, 0x17] - adds r0, 0x1 - strb r0, [r6, 0x17] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x8 - bne _0800BCD0 - ldr r2, =0x03000d70 - ldrh r0, [r2] - cmp r0, 0 - beq _0800BCD0 - ldr r1, =0x00000fbd - adds r0, r6, r1 - ldrb r1, [r0] - adds r1, 0x1 - strb r1, [r0] - movs r0, 0 - strh r0, [r2] -_0800BCD0: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800BBCC - - thumb_func_start sub_800BCE4 -sub_800BCE4: @ 800BCE4 - push {r4,lr} - ldr r0, =0x03003170 - ldrb r1, [r0, 0x16] - adds r4, r0, 0 - cmp r1, 0x8 - bne _0800BD36 - ldr r1, =0x0400012a - ldrh r0, [r4, 0x14] - strh r0, [r1] - ldr r1, =0x03000d6d - ldrb r2, [r1] - cmp r2, 0 - bne _0800BD30 - ldr r0, =0x00000339 - adds r1, r4, r0 - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - movs r0, 0xCE - lsls r0, 2 - adds r1, r4, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x31 - bls _0800BD8C - strb r2, [r1] - b _0800BD8C - .pool -_0800BD30: - movs r0, 0 - strb r0, [r1] - b _0800BD8C -_0800BD36: - ldr r1, =0x03000d6d - ldrb r0, [r1] - cmp r0, 0 - bne _0800BD52 - ldr r2, =0x00000339 - adds r0, r4, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _0800BD4C - movs r0, 0x1 - strb r0, [r1] -_0800BD4C: - ldrb r0, [r1] - cmp r0, 0 - beq _0800BD68 -_0800BD52: - ldr r1, =0x0400012a - movs r0, 0 - strh r0, [r1] - b _0800BD86 - .pool -_0800BD68: - ldr r3, =0x0400012a - movs r1, 0xCE - lsls r1, 2 - adds r0, r4, r1 - ldrb r0, [r0] - lsls r0, 1 - ldrb r2, [r4, 0x16] - movs r1, 0x64 - muls r1, r2 - adds r0, r1 - adds r1, r4, 0 - adds r1, 0x18 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r3] -_0800BD86: - ldrb r0, [r4, 0x16] - adds r0, 0x1 - strb r0, [r4, 0x16] -_0800BD8C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800BCE4 - - thumb_func_start sub_800BD98 -sub_800BD98: @ 800BD98 - push {lr} - ldr r0, =0x03003170 - ldrb r0, [r0] - cmp r0, 0 - beq _0800BDB4 - ldr r2, =0x0400010e - ldrh r1, [r2] - ldr r0, =0x0000ff7f - ands r0, r1 - strh r0, [r2] - ldr r1, =0x0400010c - ldr r2, =0x0000ff3b - adds r0, r2, 0 - strh r0, [r1] -_0800BDB4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_800BD98 - - thumb_func_start sub_800BDCC -sub_800BDCC: @ 800BDCC - push {lr} - ldr r1, =0x03003170 - ldrb r0, [r1, 0x17] - cmp r0, 0x8 - bne _0800BDE4 - movs r0, 0 - strb r0, [r1, 0x16] - strb r0, [r1, 0x17] - b _0800BDF4 - .pool -_0800BDE4: - ldrb r0, [r1] - cmp r0, 0 - beq _0800BDF4 - ldr r0, =0x0400010e - ldrh r1, [r0] - movs r2, 0x80 - orrs r1, r2 - strh r1, [r0] -_0800BDF4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_800BDCC - - thumb_func_start sub_800BDFC -sub_800BDFC: @ 800BDFC - push {r4-r6,lr} - ldr r1, =0x03003170 - ldr r2, =0x00000339 - adds r0, r1, r2 - movs r2, 0 - strb r2, [r0] - movs r3, 0xCE - lsls r3, 2 - adds r0, r1, r3 - strb r2, [r0] - movs r0, 0 - movs r6, 0x64 - adds r5, r1, 0 - adds r5, 0x18 - ldr r4, =0x0000efff -_0800BE1A: - movs r2, 0 - adds r1, r0, 0x1 - adds r3, r0, 0 - muls r3, r6 -_0800BE22: - lsls r0, r2, 1 - adds r0, r3 - adds r0, r5 - strh r4, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x31 - bls _0800BE22 - lsls r0, r1, 24 - lsrs r0, 24 - cmp r0, 0x7 - bls _0800BE1A - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800BDFC - - thumb_func_start sub_800BE50 -sub_800BE50: @ 800BE50 - push {r4-r7,lr} - ldr r1, =0x03003170 - ldr r2, =0x00000fbd - adds r0, r1, r2 - movs r2, 0 - strb r2, [r0] - ldr r3, =0x00000fbc - adds r0, r1, r3 - strb r2, [r0] - movs r0, 0x64 - mov r12, r0 - movs r3, 0xCF - lsls r3, 2 - adds r7, r1, r3 - ldr r6, =0x0000efff -_0800BE6E: - movs r3, 0 - lsls r0, r2, 1 - adds r5, r2, 0x1 - adds r0, r2 - lsls r0, 3 - adds r0, r2 - lsls r4, r0, 5 -_0800BE7C: - movs r2, 0 - adds r1, r3, 0x1 - mov r0, r12 - muls r0, r3 - adds r3, r0, 0 -_0800BE86: - lsls r0, r2, 1 - adds r0, r3 - adds r0, r4 - adds r0, r7 - strh r6, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x31 - bls _0800BE86 - lsls r0, r1, 24 - lsrs r3, r0, 24 - cmp r3, 0x7 - bls _0800BE7C - lsls r0, r5, 24 - lsrs r2, r0, 24 - cmp r2, 0x3 - bls _0800BE6E - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800BE50 - - thumb_func_start sub_800BEC0 -sub_800BEC0: @ 800BEC0 - push {r4,lr} - bl rfu_REQBN_softReset_and_checkID - adds r4, r0, 0 - ldr r0, =0x00008001 - cmp r4, r0 - bne _0800BED4 - ldr r1, =0x03004140 - movs r0, 0x1 - strb r0, [r1, 0x8] -_0800BED4: - ldr r0, =0x03004140 - ldrb r2, [r0, 0x4] - adds r1, r0, 0 - cmp r2, 0x17 - beq _0800BEE8 - cmp r2, 0x1 - beq _0800BEE8 - movs r0, 0 - strb r0, [r1, 0x5] - strb r0, [r1, 0x4] -_0800BEE8: - movs r0, 0 - strb r0, [r1, 0x7] - strb r0, [r1, 0xD] - strb r0, [r1, 0x1] - strb r0, [r1] - movs r0, 0xFF - strb r0, [r1, 0x6] - bl sub_800D610 - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_800BEC0 - - thumb_func_start rfu_REQ_sendData_wrapper -rfu_REQ_sendData_wrapper: @ 800BF0C - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x03007890 - ldr r0, [r0] - ldrb r0, [r0] - cmp r0, 0 - bne _0800BF34 - ldr r0, =0x03004140 - ldrb r0, [r0, 0x2] - movs r2, 0 - cmp r0, 0x1 - bne _0800BF3C - movs r2, 0x1 - b _0800BF3C - .pool -_0800BF34: - ldr r0, =0x03004140 - ldrb r1, [r0, 0x3] - movs r1, 0 - strb r1, [r0, 0x3] -_0800BF3C: - adds r0, r2, 0 - bl rfu_REQ_sendData - pop {r0} - bx r0 - .pool - thumb_func_end rfu_REQ_sendData_wrapper - - thumb_func_start sub_800BF4C -sub_800BF4C: @ 800BF4C - push {r4-r6,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r6, r1, 0 - cmp r5, 0 - beq _0800BF94 - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r4, =0x03004140 - ldr r2, =0x01000024 - mov r0, sp - adds r1, r4, 0 - bl CpuSet - movs r0, 0xFF - strb r0, [r4, 0x6] - str r5, [r4, 0x40] - str r6, [r4, 0x44] - ldr r0, =sub_800CEB0 - bl rfu_setMSCCallback - ldr r0, =sub_800C7B4 - bl rfu_setREQCallback - movs r0, 0 - b _0800BF96 - .pool -_0800BF94: - movs r0, 0x4 -_0800BF96: - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_800BF4C - - thumb_func_start sub_800BFA0 -sub_800BFA0: @ 800BFA0 - push {r4,lr} - sub sp, 0x4 - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r4, =0x03004140 - ldr r2, =0x01000020 - mov r0, sp - adds r1, r4, 0 - bl CpuSet - movs r0, 0xFF - strb r0, [r4, 0x6] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800BFA0 - - thumb_func_start sub_800BFCC -sub_800BFCC: @ 800BFCC - push {r4,lr} - adds r4, r0, 0 - bl sub_800C000 - ldr r1, =0x03004140 - movs r2, 0x1 - strb r2, [r1, 0x4] - movs r0, 0x2 - strb r0, [r1, 0x5] - str r4, [r1, 0x3C] - ldrb r0, [r4, 0x11] - strb r0, [r1, 0x9] - ldrh r0, [r4, 0x12] - strh r0, [r1, 0x32] - ldrh r0, [r4, 0x14] - strh r0, [r1, 0x18] - ldrb r0, [r4, 0x10] - cmp r0, 0 - beq _0800BFF4 - strb r2, [r1, 0xB] -_0800BFF4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800BFCC - - thumb_func_start sub_800C000 -sub_800C000: @ 800C000 - push {r4,r5,lr} - ldr r2, =0x03004140 - movs r0, 0 - strb r0, [r2, 0x5] - strb r0, [r2, 0x4] - movs r1, 0xFF - strb r1, [r2, 0x6] - strb r0, [r2, 0x7] - strb r0, [r2, 0x10] - strb r0, [r2, 0xC] - adds r1, r2, 0 - adds r1, 0x24 - strb r0, [r1] - adds r1, 0xC - strb r0, [r1] - movs r3, 0 - adds r5, r2, 0 - adds r5, 0x28 - movs r4, 0 - adds r2, 0x34 -_0800C028: - lsls r1, r3, 1 - adds r0, r1, r5 - strh r4, [r0] - adds r1, r2 - strh r4, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x3 - bls _0800C028 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800C000 - - thumb_func_start sub_800C048 -sub_800C048: @ 800C048 - ldr r1, =0x03004140 - movs r0, 0x15 - strb r0, [r1, 0x4] - bx lr - .pool - thumb_func_end sub_800C048 - - thumb_func_start sub_800C054 -sub_800C054: @ 800C054 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r3, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 16 - lsrs r7, r1, 16 - lsls r2, 16 - lsrs r2, 16 - mov r8, r2 - ldr r1, =0x03004140 - ldrb r0, [r1, 0x4] - cmp r0, 0 - beq _0800C090 - cmp r0, 0x8 - bne _0800C07A - cmp r5, 0x1 - beq _0800C090 -_0800C07A: - movs r0, 0x1 - strh r0, [r1, 0x14] - movs r0, 0xF3 - movs r1, 0x1 - bl sub_800D30C - movs r0, 0x1 - b _0800C122 - .pool -_0800C090: - bl rfu_getMasterSlave - lsls r0, 24 - cmp r0, 0 - bne _0800C0B0 - ldr r1, =0x03004140 - movs r0, 0x2 - strh r0, [r1, 0x14] - movs r0, 0xF3 - movs r1, 0x1 - bl sub_800D30C - movs r0, 0x2 - b _0800C122 - .pool -_0800C0B0: - movs r2, 0 - ldrh r0, [r6] - ldr r4, =0x0000ffff - adds r1, r6, 0x2 - ldr r3, =0x03004140 - cmp r0, r4 - beq _0800C0D0 -_0800C0BE: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xF - bhi _0800C0D0 - ldrh r0, [r1] - adds r1, 0x2 - cmp r0, r4 - bne _0800C0BE -_0800C0D0: - cmp r2, 0x10 - bne _0800C0EC - movs r0, 0x4 - strh r0, [r3, 0x14] - movs r0, 0xF3 - movs r1, 0x1 - bl sub_800D30C - movs r0, 0x4 - b _0800C122 - .pool -_0800C0EC: - cmp r5, 0x1 - bls _0800C0FA - movs r0, 0x1 - strb r0, [r3, 0x7] - movs r5, 0x1 - movs r7, 0 - b _0800C0FE -_0800C0FA: - movs r0, 0 - strb r0, [r3, 0x7] -_0800C0FE: - cmp r5, 0 - beq _0800C108 - movs r0, 0x5 - strb r0, [r3, 0x4] - b _0800C116 -_0800C108: - movs r0, 0x9 - strb r0, [r3, 0x4] - ldrb r0, [r3, 0xB] - cmp r0, 0 - beq _0800C116 - movs r0, 0x2 - strb r0, [r3, 0xB] -_0800C116: - strb r5, [r3, 0x6] - strh r7, [r3, 0x1A] - mov r0, r8 - strh r0, [r3, 0x26] - str r6, [r3, 0x20] - movs r0, 0 -_0800C122: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_800C054 - - thumb_func_start sub_800C12C -sub_800C12C: @ 800C12C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - ldr r1, =0x03004140 - ldrb r0, [r1, 0x4] - cmp r0, 0 - beq _0800C164 - subs r0, 0x9 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bls _0800C164 - movs r0, 0x1 - strh r0, [r1, 0x14] - movs r0, 0xF3 - movs r1, 0x1 - bl sub_800D30C - movs r0, 0x1 - b _0800C204 - .pool -_0800C164: - bl rfu_getMasterSlave - lsls r0, 24 - cmp r0, 0 - bne _0800C184 - ldr r1, =0x03004140 - movs r0, 0x2 - strh r0, [r1, 0x14] - movs r0, 0xF3 - movs r1, 0x1 - bl sub_800D30C - movs r0, 0x2 - b _0800C204 - .pool -_0800C184: - movs r2, 0 - ldr r0, =0x03007890 - ldr r1, [r0] - ldrb r3, [r1, 0x8] - ldr r5, =0x03004140 - adds r7, r0, 0 - cmp r2, r3 - bcs _0800C1B2 - ldrh r0, [r1, 0x14] - cmp r0, r6 - beq _0800C1B2 - adds r4, r1, 0 - adds r1, r3, 0 -_0800C19E: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, r1 - bcs _0800C1B2 - lsls r0, r2, 5 - adds r0, r4, r0 - ldrh r0, [r0, 0x14] - cmp r0, r6 - bne _0800C19E -_0800C1B2: - ldr r0, [r7] - ldrb r0, [r0, 0x8] - cmp r0, 0 - beq _0800C1BE - cmp r2, r0 - bne _0800C1D8 -_0800C1BE: - movs r0, 0x3 - strh r0, [r5, 0x14] - movs r0, 0xF3 - movs r1, 0x1 - bl sub_800D30C - movs r0, 0x3 - b _0800C204 - .pool -_0800C1D8: - ldrb r0, [r5, 0x4] - cmp r0, 0 - beq _0800C1E2 - cmp r0, 0x9 - bne _0800C1EA -_0800C1E2: - movs r0, 0xC - strb r0, [r5, 0x4] - movs r0, 0xD - b _0800C1F0 -_0800C1EA: - movs r0, 0xB - strb r0, [r5, 0x4] - movs r0, 0xC -_0800C1F0: - strb r0, [r5, 0x5] - strh r6, [r5, 0x1E] - mov r0, r8 - strh r0, [r5, 0x1A] - ldrb r0, [r5, 0x7] - cmp r0, 0 - beq _0800C202 - movs r0, 0x7 - strb r0, [r5, 0x7] -_0800C202: - movs r0, 0 -_0800C204: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_800C12C - - thumb_func_start sub_800C210 -sub_800C210: @ 800C210 - push {r4-r7,lr} - lsls r0, 24 - lsrs r1, r0, 24 - ldr r6, =0x03004140 - adds r3, r6, 0 - adds r3, 0x30 - ldrb r2, [r3] - adds r0, r1, 0 - ands r0, r2 - cmp r0, 0 - beq _0800C26C - adds r0, r2, 0 - bics r0, r1 - strb r0, [r3] - movs r4, 0 - ldr r7, =0x03007890 - movs r5, 0x1 - adds r3, 0x4 - movs r2, 0 -_0800C236: - adds r0, r1, 0 - asrs r0, r4 - ands r0, r5 - cmp r0, 0 - beq _0800C246 - lsls r0, r4, 1 - adds r0, r3 - strh r2, [r0] -_0800C246: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _0800C236 - ldr r0, [r7] - ldrb r4, [r0, 0x3] - ands r4, r1 - cmp r4, 0 - beq _0800C260 - adds r0, r4, 0 - bl sub_800D334 -_0800C260: - ldr r0, =0x03004140 - strh r4, [r0, 0x14] - movs r0, 0x33 - adds r1, r4, 0 - bl sub_800D30C -_0800C26C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800C210 - - thumb_func_start sub_800C27C -sub_800C27C: @ 800C27C - push {r4,r5,lr} - lsls r0, 24 - movs r2, 0 - ldr r1, =0x03004140 - strb r2, [r1, 0x7] - adds r5, r1, 0 - cmp r0, 0 - beq _0800C29C - bl sub_800C000 - movs r0, 0x17 - strb r0, [r5, 0x4] - b _0800C366 - .pool -_0800C29C: - ldrb r0, [r5, 0x4] - subs r0, 0x5 - cmp r0, 0xD - bhi _0800C352 - lsls r0, 2 - ldr r1, =_0800C2B4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0800C2B4: - .4byte _0800C2EC - .4byte _0800C2F8 - .4byte _0800C2F8 - .4byte _0800C358 - .4byte _0800C302 - .4byte _0800C30C - .4byte _0800C30C - .4byte _0800C316 - .4byte _0800C320 - .4byte _0800C320 - .4byte _0800C358 - .4byte _0800C326 - .4byte _0800C34C - .4byte _0800C34C -_0800C2EC: - movs r1, 0 - movs r0, 0x8 - strb r0, [r5, 0x4] - strb r1, [r5, 0x5] - movs r2, 0x13 - b _0800C358 -_0800C2F8: - movs r0, 0x7 - strb r0, [r5, 0x4] - movs r0, 0x8 - strb r0, [r5, 0x5] - b _0800C358 -_0800C302: - movs r0, 0 - strb r0, [r5, 0x5] - strb r0, [r5, 0x4] - movs r2, 0x21 - b _0800C358 -_0800C30C: - movs r1, 0 - movs r0, 0xB - strb r0, [r5, 0x4] - strb r1, [r5, 0x5] - b _0800C358 -_0800C316: - movs r0, 0 - strb r0, [r5, 0x5] - strb r0, [r5, 0x4] - movs r2, 0x23 - b _0800C358 -_0800C320: - movs r0, 0xE - strb r0, [r5, 0x4] - b _0800C358 -_0800C326: - ldrb r0, [r5, 0x11] - strb r0, [r5, 0x4] - ldrb r0, [r5, 0x12] - strb r0, [r5, 0x5] - ldr r4, =0x03007890 - ldr r0, [r4] - ldrb r0, [r0, 0x3] - bl sub_800D334 - ldr r0, [r4] - ldrb r0, [r0, 0x3] - strh r0, [r5, 0x14] - movs r0, 0x33 - movs r1, 0x1 - bl sub_800D30C - b _0800C366 - .pool -_0800C34C: - movs r0, 0x12 - strb r0, [r5, 0x4] - b _0800C358 -_0800C352: - strb r2, [r5, 0x5] - strb r2, [r5, 0x4] - movs r2, 0x43 -_0800C358: - ldrb r0, [r5, 0x4] - cmp r0, 0 - bne _0800C366 - adds r0, r2, 0 - movs r1, 0 - bl sub_800D30C -_0800C366: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_800C27C - - thumb_func_start sub_800C36C -sub_800C36C: @ 800C36C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0 - mov r8, r1 - mov r5, sp - adds r5, 0x1 - mov r4, sp - adds r4, 0x2 - mov r1, sp - adds r2, r5, 0 - adds r3, r4, 0 - bl rfu_REQBN_watchLink - mov r0, sp - ldrb r0, [r0] - adds r7, r4, 0 - cmp r0, 0 - beq _0800C43E - ldr r1, =0x03004140 - mov r0, sp - ldrb r0, [r0] - strh r0, [r1, 0x14] - ldrb r0, [r5] - strh r0, [r1, 0x16] - ldrb r0, [r1, 0x9] - adds r6, r1, 0 - cmp r0, 0 - beq _0800C426 - movs r0, 0x1 - strb r0, [r6, 0xA] - ldrb r0, [r6, 0x6] - cmp r0, 0 - bne _0800C3C2 - ldrb r0, [r5] - cmp r0, 0 - bne _0800C3C2 - movs r0, 0x4 - strb r0, [r6, 0xA] -_0800C3C2: - ldrb r0, [r6, 0xA] - cmp r0, 0x1 - bne _0800C40C - movs r2, 0 - mov r4, sp - movs r5, 0x1 - mov r12, r6 - mov r3, r12 - adds r3, 0x30 - movs r6, 0x34 - add r6, r12 - mov r9, r6 -_0800C3DA: - ldrb r0, [r4] - asrs r0, r2 - ands r0, r5 - cmp r0, 0 - beq _0800C3F8 - adds r0, r5, 0 - lsls r0, r2 - ldrb r1, [r3] - orrs r0, r1 - strb r0, [r3] - lsls r0, r2, 1 - add r0, r9 - mov r6, r12 - ldrh r1, [r6, 0x32] - strh r1, [r0] -_0800C3F8: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x3 - bls _0800C3DA - movs r0, 0x31 - b _0800C41E - .pool -_0800C40C: - movs r0, 0 - strb r0, [r6, 0xA] - mov r0, sp - ldrb r0, [r0] - bl sub_800D334 - movs r0, 0x1 - mov r8, r0 - movs r0, 0x33 -_0800C41E: - movs r1, 0x1 - bl sub_800D30C - b _0800C43A -_0800C426: - mov r0, sp - ldrb r0, [r0] - bl sub_800D334 - movs r1, 0x1 - mov r8, r1 - movs r0, 0x30 - movs r1, 0x2 - bl sub_800D30C -_0800C43A: - bl sub_800D610 -_0800C43E: - ldr r0, =0x03007890 - ldr r0, [r0] - ldrb r0, [r0] - cmp r0, 0x1 - bne _0800C518 - ldrb r0, [r7] - cmp r0, 0 - beq _0800C49C - movs r2, 0 - ldr r6, =0x03004140 - movs r3, 0x1 - adds r4, r6, 0 - adds r4, 0x34 - adds r6, 0x30 - adds r5, r7, 0 -_0800C45C: - ldrb r0, [r6] - asrs r0, r2 - ands r0, r3 - cmp r0, 0 - beq _0800C478 - ldrb r0, [r5] - asrs r0, r2 - ands r0, r3 - cmp r0, 0 - beq _0800C478 - lsls r0, r2, 1 - adds r0, r4 - movs r1, 0 - strh r1, [r0] -_0800C478: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x3 - bls _0800C45C - ldr r3, =0x03004140 - adds r2, r3, 0 - adds r2, 0x30 - ldrb r1, [r7] - ldrb r0, [r2] - bics r0, r1 - strb r0, [r2] - ldrb r0, [r7] - strh r0, [r3, 0x14] - movs r0, 0x32 - movs r1, 0x1 - bl sub_800D30C -_0800C49C: - ldr r0, =0x03004140 - adds r3, r0, 0 - adds r3, 0x30 - ldrb r1, [r3] - adds r6, r0, 0 - cmp r1, 0 - beq _0800C514 - movs r4, 0 - movs r2, 0 - movs r5, 0x1 -_0800C4B0: - ldrb r0, [r3] - asrs r0, r2 - ands r0, r5 - cmp r0, 0 - beq _0800C4E2 - lsls r1, r2, 1 - adds r0, r6, 0 - adds r0, 0x34 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _0800C4E2 - subs r0, 0x1 - strh r0, [r1] - lsls r0, 16 - cmp r0, 0 - bne _0800C4E2 - adds r0, r5, 0 - lsls r0, r2 - ldrb r1, [r3] - bics r1, r0 - strb r1, [r3] - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_0800C4E2: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x3 - bls _0800C4B0 - cmp r4, 0 - beq _0800C506 - adds r0, r4, 0 - bl sub_800D334 - movs r6, 0x1 - mov r8, r6 - ldr r0, =0x03004140 - strh r4, [r0, 0x14] - movs r0, 0x33 - movs r1, 0x1 - bl sub_800D30C -_0800C506: - ldr r0, =0x03004140 - adds r1, r0, 0 - adds r1, 0x30 - ldrb r1, [r1] - adds r6, r0, 0 - cmp r1, 0 - bne _0800C518 -_0800C514: - movs r0, 0 - strb r0, [r6, 0xA] -_0800C518: - mov r0, r8 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_800C36C - - thumb_func_start rfu_syncVBlank_ -rfu_syncVBlank_: @ 800C530 - push {lr} - bl rfu_syncVBlank - lsls r0, 16 - cmp r0, 0 - beq _0800C548 - movs r0, 0xF1 - movs r1, 0 - bl sub_800D30C - bl sub_800D610 -_0800C548: - pop {r0} - bx r0 - thumb_func_end rfu_syncVBlank_ - - thumb_func_start sub_800C54C -sub_800C54C: @ 800C54C - push {r4,lr} - adds r3, r0, 0 - ldr r1, =0x03004140 - ldr r2, [r1, 0x40] - cmp r2, 0 - bne _0800C568 - ldrb r0, [r1, 0x4] - cmp r0, 0 - beq _0800C568 - strb r2, [r1, 0x4] - b _0800C736 - .pool -_0800C568: - ldr r0, =0x03004140 - ldrb r0, [r0, 0x7] - cmp r0, 0 - beq _0800C576 - adds r0, r3, 0 - bl sub_800C744 -_0800C576: - ldr r4, =0x03004140 - ldrb r0, [r4, 0x4] - cmp r0, 0 - bne _0800C580 - b _0800C700 -_0800C580: - bl rfu_waitREQComplete - movs r0, 0x1 - strb r0, [r4, 0xE] - ldrb r0, [r4, 0x4] - subs r0, 0x1 - cmp r0, 0x16 - bls _0800C592 - b _0800C6F6 -_0800C592: - lsls r0, 2 - ldr r1, =_0800C5A4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0800C5A4: - .4byte _0800C624 - .4byte _0800C65C - .4byte _0800C662 - .4byte _0800C678 - .4byte _0800C690 - .4byte _0800C696 - .4byte _0800C69C - .4byte _0800C6F6 - .4byte _0800C6A2 - .4byte _0800C6A8 - .4byte _0800C6AE - .4byte _0800C6B4 - .4byte _0800C6C4 - .4byte _0800C6CA - .4byte _0800C6F6 - .4byte _0800C6D0 - .4byte _0800C6E0 - .4byte _0800C6E6 - .4byte _0800C6EC - .4byte _0800C6F6 - .4byte _0800C6F2 - .4byte _0800C6F6 - .4byte _0800C600 -_0800C600: - bl sub_800BEC0 - ldr r1, =0x00008001 - movs r2, 0xFF - cmp r0, r1 - bne _0800C60E - movs r2, 0x44 -_0800C60E: - ldr r1, =0x03004140 - movs r0, 0 - strb r0, [r1, 0x5] - strb r0, [r1, 0x4] - adds r0, r2, 0 - b _0800C64E - .pool -_0800C624: - bl sub_800BEC0 - ldr r1, =0x00008001 - cmp r0, r1 - bne _0800C644 - ldr r0, =0x03004140 - ldrb r1, [r0, 0x5] - strb r1, [r0, 0x4] - movs r1, 0x3 - strb r1, [r0, 0x5] - b _0800C6F6 - .pool -_0800C644: - ldr r1, =0x03004140 - movs r0, 0 - strb r0, [r1, 0x5] - strb r0, [r1, 0x4] - movs r0, 0xFF -_0800C64E: - movs r1, 0 - bl sub_800D30C - b _0800C6F6 - .pool -_0800C65C: - bl rfu_REQ_reset - b _0800C6F6 -_0800C662: - ldr r0, =0x03004140 - ldr r2, [r0, 0x3C] - ldrh r0, [r2, 0x2] - ldrb r1, [r2] - ldrb r2, [r2, 0x1] - bl rfu_REQ_configSystem - b _0800C6F6 - .pool -_0800C678: - ldr r0, =0x03004140 - ldr r3, [r0, 0x3C] - ldrb r0, [r3, 0x4] - ldrh r1, [r3, 0x6] - ldr r2, [r3, 0x8] - ldr r3, [r3, 0xC] - bl rfu_REQ_configGameData - b _0800C6F6 - .pool -_0800C690: - bl rfu_REQ_startSearchChild - b _0800C6F6 -_0800C696: - bl rfu_REQ_pollSearchChild - b _0800C6F6 -_0800C69C: - bl rfu_REQ_endSearchChild - b _0800C6F6 -_0800C6A2: - bl rfu_REQ_startSearchParent - b _0800C6F6 -_0800C6A8: - bl rfu_REQ_pollSearchParent - b _0800C6F6 -_0800C6AE: - bl rfu_REQ_endSearchParent - b _0800C6F6 -_0800C6B4: - ldr r0, =0x03004140 - ldrh r0, [r0, 0x1E] - bl rfu_REQ_startConnectParent - b _0800C6F6 - .pool -_0800C6C4: - bl rfu_REQ_pollConnectParent - b _0800C6F6 -_0800C6CA: - bl rfu_REQ_endConnectParent - b _0800C6F6 -_0800C6D0: - ldr r0, =0x03007890 - ldr r0, [r0] - ldrb r0, [r0, 0x3] - bl rfu_REQ_CHILD_startConnectRecovery - b _0800C6F6 - .pool -_0800C6E0: - bl rfu_REQ_CHILD_pollConnectRecovery - b _0800C6F6 -_0800C6E6: - bl rfu_REQ_CHILD_endConnectRecovery - b _0800C6F6 -_0800C6EC: - bl rfu_REQ_changeMasterSlave - b _0800C6F6 -_0800C6F2: - bl rfu_REQ_stopMode -_0800C6F6: - bl rfu_waitREQComplete - ldr r1, =0x03004140 - movs r0, 0 - strb r0, [r1, 0xE] -_0800C700: - ldr r0, =0x03004140 - ldrb r0, [r0, 0x4] - subs r0, 0x12 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _0800C710 - b _0800C576 -_0800C710: - ldr r0, =0x03007890 - ldr r0, [r0] - ldrb r0, [r0] - cmp r0, 0x1 - bne _0800C726 - movs r0, 0 - bl sub_800C36C - lsls r0, 24 - cmp r0, 0 - bne _0800C736 -_0800C726: - bl sub_800CF34 - bl sub_800D158 - bl sub_800D268 - bl sub_800D434 -_0800C736: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800C54C - - thumb_func_start sub_800C744 -sub_800C744: @ 800C744 - push {r4,lr} - adds r3, r0, 0 - ldr r0, =0x03004140 - ldrb r1, [r0, 0x7] - adds r4, r0, 0 - cmp r1, 0x5 - bne _0800C76E - movs r2, 0x1 - strb r2, [r4, 0x6] - strb r1, [r4, 0x4] - ldrh r0, [r4, 0x1C] - strh r0, [r4, 0x1A] - lsls r0, 16 - cmp r0, 0 - beq _0800C76C - movs r0, 0x6 - strb r0, [r4, 0x7] - b _0800C76E - .pool -_0800C76C: - strb r2, [r4, 0x7] -_0800C76E: - ldrb r0, [r4, 0x7] - cmp r0, 0x1 - bne _0800C798 - strb r0, [r4, 0x6] - movs r0, 0x5 - strb r0, [r4, 0x4] - adds r0, r3, 0 - movs r1, 0x8C - bl __umodsi3 - strh r0, [r4, 0x1A] - movs r1, 0x8C - subs r1, r0 - strh r1, [r4, 0x1C] - lsls r0, 16 - cmp r0, 0 - beq _0800C794 - movs r0, 0x2 - b _0800C796 -_0800C794: - movs r0, 0x3 -_0800C796: - strb r0, [r4, 0x7] -_0800C798: - ldrb r0, [r4, 0x7] - cmp r0, 0x3 - bne _0800C7AE - movs r0, 0 - strb r0, [r4, 0x6] - movs r0, 0x28 - strh r0, [r4, 0x1A] - movs r0, 0x4 - strb r0, [r4, 0x7] - movs r0, 0x9 - strb r0, [r4, 0x4] -_0800C7AE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_800C744 - - thumb_func_start sub_800C7B4 -sub_800C7B4: @ 800C7B4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r1, 16 - lsrs r6, r1, 16 - ldr r0, =0x03004140 - ldrb r1, [r0, 0xE] - adds r7, r0, 0 - cmp r1, 0 - bne _0800C7D2 - b _0800CC98 -_0800C7D2: - movs r0, 0 - strb r0, [r7, 0xE] - mov r0, r8 - subs r0, 0x10 - cmp r0, 0x2D - bls _0800C7E0 - b _0800CC8A -_0800C7E0: - lsls r0, 2 - ldr r1, =_0800C7F4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0800C7F4: - .4byte _0800C8AC - .4byte _0800CC8A - .4byte _0800CC8A - .4byte _0800CC8A - .4byte _0800CC8A - .4byte _0800CC8A - .4byte _0800C8D8 - .4byte _0800C8C4 - .4byte _0800CC8A - .4byte _0800C8EC - .4byte _0800C8FC - .4byte _0800C920 - .4byte _0800C940 - .4byte _0800C960 - .4byte _0800C9D0 - .4byte _0800CA02 - .4byte _0800CA18 - .4byte _0800CA60 - .4byte _0800CC8A - .4byte _0800CC8A - .4byte _0800CC8A - .4byte _0800CC8A - .4byte _0800CC8A - .4byte _0800CBD8 - .4byte _0800CC8A - .4byte _0800CC8A - .4byte _0800CC8A - .4byte _0800CC8A - .4byte _0800CC8A - .4byte _0800CC8A - .4byte _0800CC8A - .4byte _0800CC8A - .4byte _0800CC8A - .4byte _0800CC8A - .4byte _0800CAD0 - .4byte _0800CB1C - .4byte _0800CB64 - .4byte _0800CC8A - .4byte _0800CC8A - .4byte _0800CC8A - .4byte _0800CC8A - .4byte _0800CC8A - .4byte _0800CC8A - .4byte _0800CC8A - .4byte _0800CC8A - .4byte _0800CC78 -_0800C8AC: - cmp r6, 0 - beq _0800C8B2 - b _0800CC8A -_0800C8B2: - ldr r0, =0x03004140 - ldrb r1, [r0, 0x5] - strb r1, [r0, 0x4] - movs r1, 0x4 - strb r1, [r0, 0x5] - b _0800CC8A - .pool -_0800C8C4: - cmp r6, 0 - beq _0800C8CA - b _0800CC8A -_0800C8CA: - ldr r0, =0x03004140 - ldrb r1, [r0, 0x5] - strb r1, [r0, 0x4] - strb r6, [r0, 0x5] - b _0800CC8A - .pool -_0800C8D8: - cmp r6, 0 - beq _0800C8DE - b _0800CC8A -_0800C8DE: - ldr r0, =0x03004140 - strb r6, [r0, 0x5] - strb r6, [r0, 0x4] - movs r0, 0 - b _0800CBF6 - .pool -_0800C8EC: - cmp r6, 0 - beq _0800C8F2 - b _0800CC8A -_0800C8F2: - ldr r1, =0x03004140 - movs r0, 0x6 - b _0800CA0C - .pool -_0800C8FC: - ldr r1, =0x03004140 - ldrh r0, [r1, 0x1A] - cmp r0, 0 - bne _0800C906 - b _0800CC8A -_0800C906: - subs r0, 0x1 - strh r0, [r1, 0x1A] - lsls r0, 16 - cmp r0, 0 - beq _0800C912 - b _0800CC8A -_0800C912: - movs r0, 0x7 - strb r0, [r1, 0x4] - movs r0, 0x8 - strb r0, [r1, 0x5] - b _0800CC8A - .pool -_0800C920: - cmp r6, 0 - beq _0800C926 - b _0800CC8A -_0800C926: - ldr r0, =0x03004140 - ldrb r1, [r0, 0x5] - strb r1, [r0, 0x4] - strb r6, [r0, 0x5] - ldrb r0, [r0, 0x7] - cmp r0, 0 - beq _0800C936 - b _0800CC8A -_0800C936: - movs r0, 0x13 - b _0800CBF6 - .pool -_0800C940: - cmp r6, 0 - beq _0800C946 - b _0800CC8A -_0800C946: - ldrb r0, [r7, 0xB] - cmp r0, 0x1 - bne _0800C956 - ldrh r0, [r7, 0x1A] - cmp r0, 0x1 - bls _0800C956 - subs r0, 0x1 - strh r0, [r7, 0x1A] -_0800C956: - ldr r1, =0x03004140 - movs r0, 0xA - b _0800CA0C - .pool -_0800C960: - cmp r6, 0 - bne _0800C9A6 - bl sub_800D294 - lsls r0, 24 - lsrs r0, 24 - mov r1, sp - strb r0, [r1] - ldr r4, =0x03004140 - strh r0, [r4, 0x14] - cmp r0, 0 - beq _0800C980 - movs r0, 0x20 - movs r1, 0x1 - bl sub_800D30C -_0800C980: - ldrb r0, [r4, 0xB] - cmp r0, 0 - beq _0800C9A6 - ldrh r0, [r4, 0x1A] - cmp r0, 0x1 - beq _0800C9A6 - ldr r0, =0x03007890 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0x4 - bne _0800C9A6 - bl rfu_REQ_endSearchParent - bl rfu_waitREQComplete - movs r0, 0x9 - strb r0, [r4, 0x4] - movs r0, 0x1 - strb r0, [r4, 0xB] -_0800C9A6: - ldr r1, =0x03004140 - ldrh r0, [r1, 0x1A] - cmp r0, 0 - bne _0800C9B0 - b _0800CC8A -_0800C9B0: - subs r0, 0x1 - strh r0, [r1, 0x1A] - lsls r0, 16 - cmp r0, 0 - beq _0800C9BC - b _0800CC8A -_0800C9BC: - movs r0, 0xB - strb r0, [r1, 0x4] - movs r0, 0 - strb r0, [r1, 0x5] - b _0800CC8A - .pool -_0800C9D0: - cmp r6, 0 - beq _0800C9D6 - b _0800CC8A -_0800C9D6: - ldr r2, =0x03004140 - ldrb r0, [r2, 0x5] - strb r0, [r2, 0x4] - ldrb r1, [r2, 0x7] - cmp r1, 0 - bne _0800C9F4 - lsls r0, 24 - cmp r0, 0 - beq _0800C9EA - b _0800CC8A -_0800C9EA: - movs r0, 0x21 - b _0800CBF6 - .pool -_0800C9F4: - cmp r1, 0x7 - bne _0800C9FA - b _0800CC8A -_0800C9FA: - movs r0, 0x5 - strb r0, [r2, 0x4] - strb r0, [r2, 0x7] - b _0800CC8A -_0800CA02: - cmp r6, 0 - beq _0800CA08 - b _0800CC8A -_0800CA08: - ldr r1, =0x03004140 - movs r0, 0xD -_0800CA0C: - strb r0, [r1, 0x5] - strb r0, [r1, 0x4] - b _0800CC8A - .pool -_0800CA18: - cmp r6, 0 - bne _0800CA3C - ldr r4, =0x03004150 - mov r0, sp - adds r1, r4, 0 - bl rfu_getConnectParentStatus - lsls r0, 16 - cmp r0, 0 - bne _0800CA3C - mov r0, sp - ldrb r0, [r0] - cmp r0, 0 - bne _0800CA3C - adds r1, r4, 0 - subs r1, 0x10 - movs r0, 0xE - strb r0, [r1, 0x4] -_0800CA3C: - ldr r1, =0x03004140 - ldrh r0, [r1, 0x1A] - cmp r0, 0 - bne _0800CA46 - b _0800CC8A -_0800CA46: - subs r0, 0x1 - strh r0, [r1, 0x1A] - lsls r0, 16 - cmp r0, 0 - beq _0800CA52 - b _0800CC8A -_0800CA52: - movs r0, 0xE - strb r0, [r1, 0x4] - b _0800CC8A - .pool -_0800CA60: - cmp r6, 0 - beq _0800CA66 - b _0800CC8A -_0800CA66: - ldr r4, =0x03004150 - mov r0, sp - adds r1, r4, 0 - bl rfu_getConnectParentStatus - lsls r0, 16 - cmp r0, 0 - beq _0800CA78 - b _0800CC8A -_0800CA78: - mov r0, sp - ldrb r0, [r0] - cmp r0, 0 - bne _0800CA9C - adds r1, r4, 0 - subs r1, 0x10 - movs r0, 0x13 - strb r0, [r1, 0x4] - movs r0, 0xF - strb r0, [r1, 0x5] - movs r0, 0x22 - strh r0, [r1, 0x1E] - ldrb r0, [r1, 0x10] - strh r0, [r1, 0x14] - b _0800CABC - .pool -_0800CA9C: - adds r1, r4, 0 - subs r1, 0x10 - strb r6, [r1, 0x5] - strb r6, [r1, 0x4] - movs r0, 0x23 - strh r0, [r1, 0x1E] - mov r0, sp - ldrb r0, [r0] - strh r0, [r1, 0x14] - ldrb r0, [r1, 0x7] - cmp r0, 0 - beq _0800CABC - movs r0, 0x3 - strb r0, [r1, 0x7] - movs r0, 0x9 - strb r0, [r1, 0x4] -_0800CABC: - ldr r4, =0x03004140 - ldrb r0, [r4, 0x1E] - movs r1, 0x1 - bl sub_800D30C - movs r0, 0 - strh r0, [r4, 0x1E] - b _0800CC8A - .pool -_0800CAD0: - cmp r6, 0 - beq _0800CAD6 - b _0800CC8A -_0800CAD6: - ldr r2, =0x03007890 - ldr r3, [r2] - ldrb r0, [r3, 0x3] - movs r1, 0 - strh r0, [r7, 0x14] - movs r0, 0x11 - strb r0, [r7, 0x5] - strb r0, [r7, 0x4] - strb r1, [r7, 0x10] - ldrb r0, [r3, 0x3] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0800CAF4 - b _0800CC8A -_0800CAF4: - adds r1, r7, 0 - movs r3, 0x1 -_0800CAF8: - ldrb r0, [r1, 0x10] - adds r0, 0x1 - strb r0, [r1, 0x10] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bls _0800CB08 - b _0800CC8A -_0800CB08: - ldr r0, [r2] - ldrb r0, [r0, 0x3] - ldrb r4, [r7, 0x10] - asrs r0, r4 - ands r0, r3 - cmp r0, 0 - beq _0800CAF8 - b _0800CC8A - .pool -_0800CB1C: - cmp r6, 0 - bne _0800CB3A - mov r0, sp - bl rfu_CHILD_getConnectRecoveryStatus - lsls r0, 16 - cmp r0, 0 - bne _0800CB3A - mov r0, sp - ldrb r0, [r0] - cmp r0, 0x1 - bhi _0800CB3A - ldr r1, =0x03004140 - movs r0, 0x12 - strb r0, [r1, 0x4] -_0800CB3A: - ldr r2, =0x03004140 - ldrb r0, [r2, 0x10] - lsls r0, 1 - adds r1, r2, 0 - adds r1, 0x34 - adds r1, r0, r1 - ldrh r0, [r1] - cmp r0, 0 - bne _0800CB4E - b _0800CC8A -_0800CB4E: - subs r0, 0x1 - strh r0, [r1] - lsls r0, 16 - cmp r0, 0 - beq _0800CB5A - b _0800CC8A -_0800CB5A: - movs r0, 0x12 - strb r0, [r2, 0x4] - b _0800CC8A - .pool -_0800CB64: - cmp r6, 0 - beq _0800CB6A - b _0800CC8A -_0800CB6A: - mov r0, sp - bl rfu_CHILD_getConnectRecoveryStatus - lsls r0, 16 - cmp r0, 0 - beq _0800CB78 - b _0800CC8A -_0800CB78: - mov r0, sp - ldrb r0, [r0] - cmp r0, 0 - bne _0800CB94 - ldr r1, =0x03004140 - movs r0, 0x13 - strb r0, [r1, 0x4] - movs r0, 0x16 - strb r0, [r1, 0x5] - movs r0, 0x32 - strh r0, [r1, 0x1E] - b _0800CBA8 - .pool -_0800CB94: - ldr r4, =0x03004140 - strb r6, [r4, 0x5] - strb r6, [r4, 0x4] - ldr r0, =0x03007890 - ldr r0, [r0] - ldrb r0, [r0, 0x3] - bl sub_800D334 - movs r0, 0x33 - strh r0, [r4, 0x1E] -_0800CBA8: - ldr r5, =0x03004140 - ldrb r0, [r5, 0x10] - lsls r0, 1 - adds r1, r5, 0 - adds r1, 0x34 - adds r0, r1 - movs r1, 0 - movs r4, 0 - strh r4, [r0] - adds r0, r5, 0 - adds r0, 0x30 - strb r1, [r0] - strb r1, [r5, 0xA] - ldrb r0, [r5, 0x1E] - movs r1, 0x1 - bl sub_800D30C - strh r4, [r5, 0x1E] - b _0800CC8A - .pool -_0800CBD8: - cmp r6, 0 - bne _0800CC8A - ldr r5, =0x03004140 - ldrb r1, [r5, 0x5] - adds r0, r1, 0 - cmp r0, 0x16 - bne _0800CC04 - ldrb r0, [r5, 0x11] - strb r0, [r5, 0x4] - ldrb r0, [r5, 0x12] - strb r0, [r5, 0x5] - ldrb r0, [r5, 0x2] - movs r0, 0x1 - strb r0, [r5, 0x2] - movs r0, 0x41 -_0800CBF6: - movs r1, 0 - bl sub_800D30C - b _0800CC8A - .pool -_0800CC04: - cmp r0, 0xF - bne _0800CC8A - strb r1, [r5, 0x4] - ldrb r0, [r5, 0x2] - movs r4, 0x1 - strb r4, [r5, 0x2] - movs r0, 0x41 - movs r1, 0 - bl sub_800D30C - adds r1, r5, 0 - adds r1, 0x24 - ldrb r0, [r5, 0x10] - lsls r4, r0 - ldrb r0, [r1] - orrs r4, r0 - strb r4, [r1] - ldrb r0, [r5, 0x10] - lsls r0, 1 - adds r1, 0x4 - adds r0, r1 - ldrh r1, [r5, 0x26] - movs r7, 0 - strh r1, [r0] - ldrb r1, [r5, 0x10] - movs r0, 0x4 - bl rfu_clearSlot - mov r4, sp - ldrb r0, [r5, 0x10] - movs r1, 0xE - bl rfu_NI_CHILD_setSendGameName - strb r0, [r4] - lsls r0, 24 - cmp r0, 0 - beq _0800CC8A - strb r7, [r5, 0x5] - strb r7, [r5, 0x4] - bl sub_800D610 - ldr r0, =0x03007890 - ldr r0, [r0] - ldrb r1, [r0, 0x2] - ldrb r0, [r0, 0x3] - orrs r0, r1 - bl sub_800D334 - mov r0, sp - ldrb r0, [r0] - strh r0, [r5, 0x14] - movs r0, 0x25 - movs r1, 0x1 - bl sub_800D30C - b _0800CC8A - .pool -_0800CC78: - cmp r6, 0 - bne _0800CC8A - ldr r0, =0x03004140 - strb r6, [r0, 0x5] - strb r6, [r0, 0x4] - movs r0, 0x42 - movs r1, 0 - bl sub_800D30C -_0800CC8A: - ldr r1, =0x03004140 - movs r0, 0x1 - strb r0, [r1, 0xE] - b _0800CCE6 - .pool -_0800CC98: - cmp r6, 0x3 - bne _0800CCE6 - ldrb r0, [r7, 0xF] - cmp r0, 0 - beq _0800CCE6 - mov r3, r8 - cmp r3, 0x24 - beq _0800CCB0 - cmp r3, 0x26 - beq _0800CCB0 - cmp r3, 0x27 - bne _0800CCE6 -_0800CCB0: - bl rfu_REQ_RFUStatus - bl rfu_waitREQComplete - mov r0, sp - bl rfu_getRFUStatus - mov r0, sp - ldrb r0, [r0] - cmp r0, 0 - bne _0800CCE6 - ldr r4, =0x03007890 - ldr r0, [r4] - ldrb r0, [r0] - cmp r0, 0 - bne _0800CCE6 - bl rfu_getSTWIRecvBuffer - ldr r1, [r4] - ldrb r1, [r1, 0x2] - strb r1, [r0, 0x4] - movs r1, 0x1 - strb r1, [r0, 0x5] - movs r0, 0x29 - bl sub_800C36C - movs r6, 0 -_0800CCE6: - mov r4, r8 - cmp r4, 0x26 - bne _0800CCEE - b _0800CE02 -_0800CCEE: - cmp r4, 0x26 - bgt _0800CD00 - cmp r4, 0x10 - bne _0800CCF8 - b _0800CE20 -_0800CCF8: - b _0800CE3E - .pool -_0800CD00: - mov r0, r8 - cmp r0, 0x30 - beq _0800CD0E - cmp r0, 0x3D - bne _0800CD0C - b _0800CE20 -_0800CD0C: - b _0800CE3E -_0800CD0E: - cmp r6, 0 - beq _0800CD14 - b _0800CE42 -_0800CD14: - bl rfu_getSTWIRecvBuffer - ldr r4, =0x03004140 - ldrb r0, [r0, 0x8] - strh r0, [r4, 0x14] - bl sub_800D358 - adds r2, r4, 0 - adds r2, 0x30 - ldrb r1, [r2] - cmp r1, 0 - beq _0800CD6A - ldrb r0, [r4, 0x14] - adds r3, r1, 0 - bics r3, r0 - adds r0, r3, 0 - strb r0, [r2] - movs r3, 0 - adds r7, r4, 0 - adds r1, r7, 0 - movs r5, 0x1 - adds r4, r1, 0 - adds r4, 0x34 - movs r2, 0 -_0800CD44: - ldrh r0, [r1, 0x14] - asrs r0, r3 - ands r0, r5 - cmp r0, 0 - beq _0800CD54 - lsls r0, r3, 1 - adds r0, r4 - strh r2, [r0] -_0800CD54: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x3 - bls _0800CD44 - ldr r1, =0x03004140 - ldrb r0, [r1, 0x6] - cmp r0, 0 - bne _0800CD6A - strb r0, [r1, 0x5] - strb r0, [r1, 0x4] -_0800CD6A: - mov r3, sp - ldr r1, =0x03004140 - ldrb r2, [r1] - ldrb r0, [r1, 0x14] - ands r0, r2 - strb r0, [r3] - movs r3, 0 - adds r7, r1, 0 - ldr r2, =0x03007890 - mov r1, sp - movs r5, 0x1 - adds r4, r7, 0 -_0800CD82: - ldrb r0, [r1] - asrs r0, r3 - ands r0, r5 - cmp r0, 0 - beq _0800CD96 - ldrb r0, [r4, 0x1] - cmp r0, 0 - beq _0800CD96 - subs r0, 0x1 - strb r0, [r7, 0x1] -_0800CD96: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x3 - bls _0800CD82 - ldrb r1, [r7, 0x14] - ldrb r0, [r7] - bics r0, r1 - strb r0, [r7] - ldrb r1, [r7, 0x7] - cmp r1, 0 - beq _0800CDE0 - ldr r0, [r2] - ldrb r0, [r0] - cmp r0, 0xFF - bne _0800CDF2 - cmp r1, 0x8 - bne _0800CDCC - ldrh r0, [r7, 0x1C] - strh r0, [r7, 0x1A] - movs r0, 0x6 - strb r0, [r7, 0x7] - b _0800CDDE - .pool -_0800CDCC: - ldrb r0, [r7, 0x4] - subs r0, 0x6 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _0800CDE0 - movs r0, 0x1 - strb r0, [r7, 0x7] - movs r0, 0x5 -_0800CDDE: - strb r0, [r7, 0x4] -_0800CDE0: - ldr r0, [r2] - ldrb r0, [r0] - cmp r0, 0xFF - bne _0800CDF2 - ldrb r0, [r7, 0x4] - cmp r0, 0 - bne _0800CDF2 - movs r0, 0xFF - strb r0, [r7, 0x6] -_0800CDF2: - ldrb r0, [r7, 0xE] - cmp r0, 0 - bne _0800CE3E - movs r0, 0x40 - movs r1, 0x1 - bl sub_800D30C - b _0800CE3E -_0800CE02: - bl sub_800D20C - ldr r0, =0x03007890 - ldr r0, [r0] - ldrb r0, [r0] - cmp r0, 0xFF - beq _0800CE3E - movs r0, 0x50 - movs r1, 0 - bl sub_800D30C - b _0800CE3E - .pool -_0800CE20: - cmp r6, 0 - bne _0800CE42 - ldr r0, =0x03004140 - strb r6, [r0, 0xD] - strb r6, [r0, 0x1] - strb r6, [r0] - movs r1, 0xFF - strb r1, [r0, 0x6] - bl sub_800D610 - mov r4, r8 - cmp r4, 0x3D - bne _0800CE3E - bl sub_800BFA0 -_0800CE3E: - cmp r6, 0 - beq _0800CE92 -_0800CE42: - ldr r7, =0x03004140 - mov r0, r8 - cmp r0, 0x1C - bne _0800CE74 - cmp r6, 0 - beq _0800CE74 - ldrb r0, [r7, 0x7] - cmp r0, 0x4 - bne _0800CE74 - ldr r2, =0x03007890 - ldr r1, [r2] - movs r0, 0x1 - strb r0, [r1] - ldr r1, [r2] - movs r0, 0xF - strb r0, [r1, 0x2] - bl sub_800D334 - bl rfu_waitREQComplete - b _0800CEA4 - .pool -_0800CE74: - movs r1, 0 - mov r3, r8 - strh r3, [r7, 0x14] - strh r6, [r7, 0x16] - ldrb r0, [r7, 0xE] - cmp r0, 0 - beq _0800CE86 - strb r1, [r7, 0x5] - strb r1, [r7, 0x4] -_0800CE86: - movs r0, 0xF0 - movs r1, 0x2 - bl sub_800D30C - bl sub_800D610 -_0800CE92: - mov r4, r8 - cmp r4, 0xFF - bne _0800CEA4 - movs r0, 0xF2 - movs r1, 0 - bl sub_800D30C - bl sub_800D610 -_0800CEA4: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_800C7B4 - - thumb_func_start sub_800CEB0 -sub_800CEB0: @ 800CEB0 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r4, =0x03004140 - ldrb r7, [r4, 0xE] - movs r0, 0 - strb r0, [r4, 0xE] - movs r0, 0x1 - strb r0, [r4, 0xF] - ldr r0, =0x03007890 - ldr r0, [r0] - ldrb r5, [r0] - cmp r5, 0 - bne _0800CEEC - adds r0, r6, 0 - bl sub_800C36C - ldrb r0, [r4, 0x2] - cmp r0, 0x1 - beq _0800CF04 - bl sub_800D610 - strb r5, [r4, 0xF] - strb r7, [r4, 0xE] - b _0800CF28 - .pool -_0800CEEC: - mov r0, sp - bl rfu_UNI_PARENT_getDRAC_ACK - lsls r0, 16 - cmp r0, 0 - bne _0800CF04 - mov r1, sp - ldrb r0, [r4, 0x3] - ldrb r1, [r1] - orrs r0, r1 - ldrb r1, [r4, 0x3] - strb r0, [r4, 0x3] -_0800CF04: - ldr r4, =0x03004140 - ldr r1, [r4, 0x44] - cmp r1, 0 - beq _0800CF20 - adds r0, r6, 0 - bl _call_via_r1 - bl rfu_waitREQComplete - ldrb r0, [r4, 0x2] - cmp r0, 0x2 - bne _0800CF20 - bl sub_800D610 -_0800CF20: - ldr r1, =0x03004140 - movs r0, 0 - strb r0, [r1, 0xF] - strb r7, [r1, 0xE] -_0800CF28: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800CEB0 - - thumb_func_start sub_800CF34 -sub_800CF34: @ 800CF34 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - ldr r1, =0x03004140 - ldrb r0, [r1, 0x4] - subs r0, 0x5 - lsls r0, 24 - lsrs r0, 24 - adds r3, r1, 0 - cmp r0, 0x3 - bls _0800CF52 - b _0800D146 -_0800CF52: - ldr r0, =0x03007890 - ldr r2, [r0] - ldrb r1, [r2, 0x2] - ldrb r0, [r3, 0xC] - adds r4, r1, 0 - eors r4, r0 - ands r4, r1 - ldrb r0, [r2, 0x7] - bics r4, r0 - mov r8, r4 - strb r1, [r3, 0xC] - cmp r4, 0 - beq _0800CF7A - strh r4, [r3, 0x14] - movs r0, 0x10 - movs r1, 0x1 - str r3, [sp, 0x4] - bl sub_800D30C - ldr r3, [sp, 0x4] -_0800CF7A: - movs r0, 0 - str r0, [sp] - movs r6, 0 - adds r7, r3, 0 - movs r1, 0x24 - adds r1, r3 - mov r9, r1 -_0800CF88: - movs r0, 0x80 - lsls r0, 17 - lsls r0, r6 - lsrs r4, r0, 24 - movs r5, 0 - mov r0, r8 - ands r0, r4 - cmp r0, 0 - beq _0800CFDA - lsls r1, r6, 1 - adds r0, r7, 0 - adds r0, 0x28 - adds r1, r0 - ldrh r0, [r7, 0x26] - strh r0, [r1] - mov r2, r9 - ldrb r1, [r2] - adds r0, r4, 0 - orrs r0, r1 - strb r0, [r2] - adds r6, 0x1 - mov r10, r6 - b _0800D090 - .pool -_0800CFC0: - ldrb r1, [r7] - adds r0, r4, 0 - orrs r0, r1 - strb r0, [r7] - ldrb r0, [r7, 0x1] - adds r0, 0x1 - strb r0, [r7, 0x1] - ldr r0, [sp] - orrs r0, r4 - str r0, [sp] - movs r0, 0x1 - orrs r5, r0 - b _0800D024 -_0800CFDA: - mov r1, r9 - ldrb r0, [r1] - ands r0, r4 - adds r2, r6, 0x1 - mov r10, r2 - cmp r0, 0 - beq _0800D090 - ldr r0, =0x03007880 - lsls r1, r6, 2 - adds r1, r0 - ldr r1, [r1] - ldrh r0, [r1, 0x34] - cmp r0, 0x46 - bne _0800D040 - adds r0, r1, 0 - adds r0, 0x61 - ldrb r0, [r0] - cmp r0, 0x1 - bne _0800D058 - movs r5, 0x2 - ldr r3, [r3, 0x20] - ldrh r2, [r3] - ldr r0, =0x0000ffff - cmp r2, r0 - beq _0800D024 - ldr r0, =0x03007890 - ldr r0, [r0] - lsls r1, r6, 5 - adds r0, r1 - ldrh r0, [r0, 0x18] - ldr r1, =0x0000ffff -_0800D018: - cmp r0, r2 - beq _0800CFC0 - adds r3, 0x2 - ldrh r2, [r3] - cmp r2, r1 - bne _0800D018 -_0800D024: - movs r0, 0x1 - ands r0, r5 - cmp r0, 0 - bne _0800D058 - movs r0, 0x4 - orrs r5, r0 - b _0800D058 - .pool -_0800D040: - lsls r1, r6, 1 - adds r0, r3, 0 - adds r0, 0x28 - adds r1, r0 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - ldr r1, =0x0000ffff - ands r0, r1 - cmp r0, 0 - bne _0800D058 - movs r5, 0x6 -_0800D058: - movs r0, 0x2 - ands r0, r5 - cmp r0, 0 - beq _0800D07E - mov r2, r9 - ldrb r0, [r2] - bics r0, r4 - movs r2, 0 - mov r1, r9 - strb r0, [r1] - lsls r0, r6, 1 - adds r1, r7, 0 - adds r1, 0x28 - adds r0, r1 - strh r2, [r0] - movs r0, 0x8 - adds r1, r6, 0 - bl rfu_clearSlot -_0800D07E: - movs r0, 0x4 - ands r5, r0 - ldr r3, =0x03004140 - cmp r5, 0 - beq _0800D090 - ldrb r1, [r7, 0xD] - adds r0, r4, 0 - orrs r0, r1 - strb r0, [r7, 0xD] -_0800D090: - mov r2, r10 - lsls r0, r2, 24 - lsrs r6, r0, 24 - cmp r6, 0x3 - bhi _0800D09C - b _0800CF88 -_0800D09C: - ldr r4, [sp] - cmp r4, 0 - beq _0800D0AE - ldr r0, =0x03004140 - strh r4, [r0, 0x14] - movs r0, 0x11 - movs r1, 0x1 - bl sub_800D30C -_0800D0AE: - ldr r1, =0x03004140 - ldrb r0, [r1, 0xD] - cmp r0, 0 - beq _0800D0EA - movs r5, 0x1 - ldr r0, =0x03007890 - ldr r0, [r0] - ldrb r0, [r0, 0x6] - cmp r0, 0 - beq _0800D0CE - ldrb r0, [r1, 0x3] - ldrb r1, [r1] - ands r0, r1 - cmp r0, r1 - beq _0800D0CE - movs r5, 0 -_0800D0CE: - cmp r5, 0 - beq _0800D0EA - ldr r4, =0x03004140 - ldrb r0, [r4, 0xD] - bl sub_800D334 - ldrb r0, [r4, 0xD] - movs r1, 0 - strh r0, [r4, 0x14] - strb r1, [r4, 0xD] - movs r0, 0x12 - movs r1, 0x1 - bl sub_800D30C -_0800D0EA: - ldr r0, =0x03004140 - adds r1, r0, 0 - adds r1, 0x24 - ldrb r1, [r1] - adds r3, r0, 0 - cmp r1, 0 - bne _0800D146 - ldrb r0, [r3, 0x4] - cmp r0, 0x8 - bne _0800D146 - ldrb r0, [r3, 0x7] - cmp r0, 0 - bne _0800D120 - strb r0, [r3, 0x5] - strb r0, [r3, 0x4] - movs r0, 0x14 - movs r1, 0 - bl sub_800D30C - b _0800D146 - .pool -_0800D120: - cmp r0, 0x2 - bne _0800D12C - movs r0, 0x3 - strb r0, [r3, 0x7] - movs r0, 0x9 - b _0800D132 -_0800D12C: - movs r0, 0x1 - strb r0, [r3, 0x7] - movs r0, 0x5 -_0800D132: - strb r0, [r3, 0x4] - ldrb r0, [r3] - cmp r0, 0 - beq _0800D146 - movs r0, 0 - strh r0, [r3, 0x1A] - movs r0, 0x8 - strb r0, [r3, 0x7] - movs r0, 0x5 - strb r0, [r3, 0x4] -_0800D146: - 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_800CF34 - - thumb_func_start sub_800D158 -sub_800D158: @ 800D158 - push {r4-r6,lr} - ldr r1, =0x04000208 - ldrh r0, [r1] - adds r6, r0, 0 - movs r0, 0 - strh r0, [r1] - ldr r4, =0x03004140 - ldrb r0, [r4, 0x4] - cmp r0, 0xF - bne _0800D1BC - ldrb r1, [r4, 0x10] - lsls r1, 1 - adds r5, r4, 0 - adds r5, 0x28 - adds r1, r5 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - lsls r0, 16 - cmp r0, 0 - beq _0800D192 - ldr r1, =0x03007880 - ldrb r0, [r4, 0x10] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - ldrh r0, [r0] - cmp r0, 0x27 - bne _0800D1BC -_0800D192: - bl sub_800D630 - movs r0, 0x18 - strb r0, [r4, 0x4] - ldrb r1, [r4, 0x10] - movs r0, 0x4 - bl rfu_clearSlot - adds r2, r4, 0 - adds r2, 0x24 - movs r1, 0x1 - ldrb r0, [r4, 0x10] - lsls r1, r0 - ldrb r0, [r2] - bics r0, r1 - strb r0, [r2] - ldrb r0, [r4, 0x10] - lsls r0, 1 - adds r0, r5 - movs r1, 0 - strh r1, [r0] -_0800D1BC: - ldr r0, =0x04000208 - strh r6, [r0] - ldr r5, =0x03004140 - ldrb r0, [r5, 0x4] - cmp r0, 0x18 - bne _0800D1F6 - ldrb r0, [r5, 0x2] - cmp r0, 0x1 - bne _0800D1D2 - bl sub_800D630 -_0800D1D2: - ldrb r0, [r5, 0x2] - adds r4, r0, 0 - cmp r4, 0 - bne _0800D1F6 - strb r4, [r5, 0x5] - strb r4, [r5, 0x4] - ldr r0, =0x03007890 - ldr r0, [r0] - ldrb r1, [r0, 0x2] - ldrb r0, [r0, 0x3] - orrs r0, r1 - bl sub_800D334 - strh r4, [r5, 0x14] - movs r0, 0x25 - movs r1, 0x1 - bl sub_800D30C -_0800D1F6: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800D158 - - thumb_func_start sub_800D20C -sub_800D20C: @ 800D20C - push {r4,r5,lr} - ldr r5, =0x03004140 - ldrb r0, [r5, 0x4] - cmp r0, 0xF - bne _0800D258 - ldr r1, =0x03007880 - ldrb r2, [r5, 0x10] - lsls r0, r2, 2 - adds r0, r1 - ldr r0, [r0] - ldrh r0, [r0] - cmp r0, 0x26 - bne _0800D258 - movs r4, 0 - strb r4, [r5, 0x5] - strb r4, [r5, 0x4] - movs r0, 0x4 - adds r1, r2, 0 - bl rfu_clearSlot - adds r2, r5, 0 - adds r2, 0x24 - movs r1, 0x1 - ldrb r0, [r5, 0x10] - lsls r1, r0 - ldrb r0, [r2] - bics r0, r1 - strb r0, [r2] - ldrb r0, [r5, 0x10] - lsls r0, 1 - adds r1, r5, 0 - adds r1, 0x28 - adds r0, r1 - strh r4, [r0] - movs r0, 0x24 - movs r1, 0 - bl sub_800D30C -_0800D258: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800D20C - - thumb_func_start sub_800D268 -sub_800D268: @ 800D268 - push {lr} - ldr r1, =0x03004140 - ldrb r0, [r1, 0x6] - cmp r0, 0 - bne _0800D28C - ldrb r0, [r1, 0xA] - cmp r0, 0x1 - bne _0800D28C - ldrb r0, [r1, 0x4] - strb r0, [r1, 0x11] - ldrb r0, [r1, 0x5] - strb r0, [r1, 0x12] - movs r0, 0x10 - strb r0, [r1, 0x4] - movs r0, 0x11 - strb r0, [r1, 0x5] - movs r0, 0x2 - strb r0, [r1, 0xA] -_0800D28C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_800D268 - - thumb_func_start sub_800D294 -sub_800D294: @ 800D294 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r6, 0 - movs r5, 0 - ldr r1, =0x03007890 - ldr r0, [r1] - ldrb r0, [r0, 0x8] - cmp r6, r0 - bcs _0800D2F0 - mov r8, r0 - ldr r0, =0x03004140 - mov r10, r0 - mov r9, r1 -_0800D2B4: - mov r1, r10 - ldr r3, [r1, 0x20] - ldrh r2, [r3] - adds r0, r5, 0x1 - mov r12, r0 - ldr r1, =0x0000ffff - cmp r2, r1 - beq _0800D2E6 - mov r1, r9 - ldr r0, [r1] - lsls r1, r5, 5 - adds r0, r1 - ldrh r4, [r0, 0x18] - ldr r7, =0x0000ffff - movs r1, 0x1 - lsls r1, r5 -_0800D2D4: - cmp r4, r2 - bne _0800D2DE - orrs r6, r1 - lsls r0, r6, 24 - lsrs r6, r0, 24 -_0800D2DE: - adds r3, 0x2 - ldrh r2, [r3] - cmp r2, r7 - bne _0800D2D4 -_0800D2E6: - mov r1, r12 - lsls r0, r1, 24 - lsrs r5, r0, 24 - cmp r5, r8 - bcc _0800D2B4 -_0800D2F0: - adds r0, r6, 0 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_800D294 - - thumb_func_start sub_800D30C -sub_800D30C: @ 800D30C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r4, =0x03004140 - ldr r2, [r4, 0x40] - cmp r2, 0 - beq _0800D322 - bl _call_via_r2 -_0800D322: - movs r0, 0 - strh r0, [r4, 0x16] - strh r0, [r4, 0x14] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800D30C - - thumb_func_start sub_800D334 -sub_800D334: @ 800D334 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x03004140 - ldrb r5, [r4, 0xE] - movs r1, 0x1 - strb r1, [r4, 0xE] - bl rfu_REQ_disconnect - bl rfu_waitREQComplete - strb r5, [r4, 0xE] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800D334 - - thumb_func_start sub_800D358 -sub_800D358: @ 800D358 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x03007890 - ldr r0, [r0] - ldrb r0, [r0, 0x4] - cmp r0, 0 - beq _0800D3A0 - movs r4, 0 -_0800D36A: - ldr r1, =0x03007880 - lsls r0, r4, 2 - adds r0, r1 - ldr r2, [r0] - ldrh r0, [r2] - movs r3, 0x80 - lsls r3, 8 - adds r1, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _0800D396 - ldrb r1, [r2, 0x1A] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _0800D396 - adds r2, r1, 0 - bics r2, r5 - movs r0, 0x20 - adds r1, r4, 0 - bl rfu_changeSendTarget -_0800D396: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _0800D36A -_0800D3A0: - ldr r0, =0x03007890 - ldr r0, [r0] - ldrb r0, [r0, 0x5] - cmp r0, 0 - beq _0800D3DE - movs r4, 0 -_0800D3AC: - ldr r1, =0x03007880 - lsls r0, r4, 2 - adds r0, r1 - ldr r2, [r0] - ldrh r0, [r2, 0x34] - movs r3, 0x80 - lsls r3, 8 - adds r1, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _0800D3D4 - adds r0, r2, 0 - adds r0, 0x4E - ldrb r0, [r0] - ands r0, r5 - cmp r0, 0 - beq _0800D3D4 - adds r0, r4, 0 - bl rfu_NI_stopReceivingData -_0800D3D4: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _0800D3AC -_0800D3DE: - ldr r0, =0x03007890 - ldr r3, [r0] - ldrb r2, [r3, 0x6] - cmp r2, 0 - beq _0800D41C - mvns r1, r5 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r3, 0x6] - movs r4, 0 - ldr r7, =0x03007870 - ldr r6, =0x00008024 -_0800D3F6: - lsls r0, r4, 2 - adds r0, r7 - ldr r2, [r0] - ldrh r0, [r2] - cmp r0, r6 - bne _0800D412 - ldrb r3, [r2, 0x3] - adds r0, r5, 0 - ands r0, r3 - cmp r0, 0 - beq _0800D412 - adds r0, r1, 0 - ands r0, r3 - strb r0, [r2, 0x3] -_0800D412: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _0800D3F6 -_0800D41C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800D358 - - thumb_func_start sub_800D434 -sub_800D434: @ 800D434 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - ldr r0, =0x03004140 - ldrh r0, [r0, 0x18] - cmp r0, 0 - beq _0800D510 - ldr r0, =0x03007890 - ldr r0, [r0] - ldrb r0, [r0, 0x4] - cmp r0, 0 - beq _0800D4D4 - movs r6, 0 -_0800D454: - ldr r3, =0x03007880 - lsls r2, r6, 2 - adds r0, r2, r3 - ldr r0, [r0] - ldrh r1, [r0] - movs r4, 0x80 - lsls r4, 8 - adds r0, r4, 0 - ands r1, r0 - adds r7, r2, 0 - adds r0, r6, 0x1 - mov r9, r0 - cmp r1, 0 - beq _0800D4CA - movs r5, 0 - movs r4, 0 - movs r1, 0x1 - mov r8, r1 - mov r10, r3 -_0800D47A: - adds r0, r7, r3 - ldr r0, [r0] - ldrb r0, [r0, 0x1A] - asrs r0, r4 - mov r1, r8 - ands r0, r1 - cmp r0, 0 - beq _0800D4A4 - lsls r0, r4, 2 - adds r0, r3 - ldr r0, [r0] - ldr r1, =0x03004140 - ldrh r0, [r0, 0x2] - ldrh r1, [r1, 0x18] - cmp r0, r1 - bls _0800D4A4 - mov r0, r8 - lsls r0, r4 - orrs r5, r0 - lsls r0, r5, 24 - lsrs r5, r0, 24 -_0800D4A4: - cmp r5, 0 - beq _0800D4C0 - mov r1, r10 - adds r0, r7, r1 - ldr r0, [r0] - ldrb r0, [r0, 0x1A] - adds r2, r5, 0 - eors r2, r0 - movs r0, 0x20 - adds r1, r6, 0 - str r3, [sp] - bl rfu_changeSendTarget - ldr r3, [sp] -_0800D4C0: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _0800D47A -_0800D4CA: - mov r3, r9 - lsls r0, r3, 24 - lsrs r6, r0, 24 - cmp r6, 0x3 - bls _0800D454 -_0800D4D4: - ldr r0, =0x03007890 - ldr r0, [r0] - ldrb r0, [r0, 0x5] - cmp r0, 0 - beq _0800D510 - movs r6, 0 -_0800D4E0: - ldr r1, =0x03007880 - lsls r0, r6, 2 - adds r0, r1 - ldr r2, [r0] - ldrh r0, [r2, 0x34] - movs r4, 0x80 - lsls r4, 8 - adds r1, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _0800D506 - ldr r1, =0x03004140 - ldrh r0, [r2, 0x36] - ldrh r1, [r1, 0x18] - cmp r0, r1 - bls _0800D506 - adds r0, r6, 0 - bl rfu_NI_stopReceivingData -_0800D506: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x3 - bls _0800D4E0 -_0800D510: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800D434 - - thumb_func_start sub_800D52C -sub_800D52C: @ 800D52C - push {lr} - ldr r1, =0x03004140 - str r0, [r1, 0x44] - ldr r0, =sub_800CEB0 - bl rfu_setMSCCallback - pop {r0} - bx r0 - .pool - thumb_func_end sub_800D52C - - thumb_func_start sub_800D544 -sub_800D544: @ 800D544 - ldr r1, =0x03004140 - str r0, [r1, 0x40] - bx lr - .pool - thumb_func_end sub_800D544 - - thumb_func_start sub_800D550 -sub_800D550: @ 800D550 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 16 - lsrs r5, r1, 16 - ldr r0, =0x03004140 - ldrb r1, [r0, 0x9] - adds r3, r0, 0 - cmp r1, 0 - beq _0800D578 - cmp r4, 0 - bne _0800D578 - adds r0, 0x30 - ldrb r0, [r0] - cmp r0, 0 - beq _0800D578 - movs r0, 0x5 - b _0800D588 - .pool -_0800D578: - ldr r2, =0x04000208 - ldrh r1, [r2] - movs r0, 0 - strh r0, [r2] - strb r4, [r3, 0x9] - strh r5, [r3, 0x32] - strh r1, [r2] - movs r0, 0 -_0800D588: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_800D550 - - thumb_func_start sub_800D594 -sub_800D594: @ 800D594 - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, =0x03007890 - ldr r0, [r0] - ldrb r1, [r0, 0x4] - ldrb r0, [r0, 0x5] - orrs r0, r1 - cmp r0, 0 - bne _0800D5B8 - ldr r0, =0x03004140 - strh r2, [r0, 0x18] - movs r0, 0 - b _0800D5C8 - .pool -_0800D5B8: - ldr r1, =0x03004140 - movs r0, 0x6 - strh r0, [r1, 0x14] - movs r0, 0xF3 - movs r1, 0x1 - bl sub_800D30C - movs r0, 0x6 -_0800D5C8: - pop {r1} - bx r1 - .pool - thumb_func_end sub_800D594 - - thumb_func_start sub_800D5D0 -sub_800D5D0: @ 800D5D0 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - adds r3, r2, 0 - ldr r1, =0x03004140 - ldrb r0, [r1, 0x4] - subs r0, 0x9 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bhi _0800D5FC - movs r0, 0x7 - strh r0, [r1, 0x14] - movs r0, 0xF3 - movs r1, 0x1 - bl sub_800D30C - movs r0, 0x7 - b _0800D60A - .pool -_0800D5FC: - cmp r2, 0 - beq _0800D606 - movs r0, 0x1 - strb r0, [r1, 0xB] - b _0800D608 -_0800D606: - strb r3, [r1, 0xB] -_0800D608: - movs r0, 0 -_0800D60A: - pop {r1} - bx r1 - thumb_func_end sub_800D5D0 - - thumb_func_start sub_800D610 -sub_800D610: @ 800D610 - push {lr} - ldr r1, =0x03004140 - ldrb r0, [r1, 0x2] - cmp r0, 0 - beq _0800D628 - ldrb r0, [r1, 0x2] - movs r0, 0 - strb r0, [r1, 0x2] - movs r0, 0x45 - movs r1, 0 - bl sub_800D30C -_0800D628: - pop {r0} - bx r0 - .pool - thumb_func_end sub_800D610 - - thumb_func_start sub_800D630 -sub_800D630: @ 800D630 - push {lr} - ldr r1, =0x03004140 - ldrb r0, [r1, 0x2] - cmp r0, 0 - bne _0800D648 - movs r0, 0x45 - movs r1, 0 - bl sub_800D30C - b _0800D654 - .pool -_0800D648: - ldrb r0, [r1, 0x2] - cmp r0, 0x1 - bne _0800D654 - ldrb r0, [r1, 0x2] - movs r0, 0x2 - strb r0, [r1, 0x2] -_0800D654: - pop {r0} - bx r0 - thumb_func_end sub_800D630 - - thumb_func_start sub_800D658 -sub_800D658: @ 800D658 - push {lr} - ldr r0, =0x03004140 - ldrb r1, [r0, 0x7] - adds r2, r0, 0 - cmp r1, 0 - beq _0800D6C2 - ldrb r0, [r2, 0x4] - subs r0, 0x5 - cmp r0, 0x6 - bhi _0800D6C2 - lsls r0, 2 - ldr r1, =_0800D680 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0800D680: - .4byte _0800D69C - .4byte _0800D6A4 - .4byte _0800D6AE - .4byte _0800D6AE - .4byte _0800D6B4 - .4byte _0800D6B4 - .4byte _0800D6BA -_0800D69C: - movs r0, 0x3 - strb r0, [r2, 0x7] - movs r0, 0x9 - b _0800D6C0 -_0800D6A4: - movs r0, 0x2 - strb r0, [r2, 0x7] - movs r0, 0x1 - strh r0, [r2, 0x1A] - b _0800D6C2 -_0800D6AE: - movs r0, 0x2 - strb r0, [r2, 0x7] - b _0800D6C2 -_0800D6B4: - movs r0, 0x28 - strh r0, [r2, 0x1A] - b _0800D6C2 -_0800D6BA: - movs r0, 0x28 - strh r0, [r2, 0x1A] - movs r0, 0xA -_0800D6C0: - strb r0, [r2, 0x4] -_0800D6C2: - pop {r0} - bx r0 - thumb_func_end sub_800D658 - - thumb_func_start sub_800D6C8 -sub_800D6C8: @ 800D6C8 - push {r4,r5,lr} - adds r3, r0, 0 - movs r0, 0 - movs r4, 0 - movs r5, 0x46 -_0800D6D2: - adds r2, r0, 0x1 - movs r1, 0x45 - muls r0, r5 - adds r0, r3 - adds r0, 0x45 -_0800D6DC: - strb r4, [r0] - subs r0, 0x1 - subs r1, 0x1 - cmp r1, 0 - bge _0800D6DC - adds r0, r2, 0 - cmp r0, 0x1F - ble _0800D6D2 - movs r1, 0 - ldr r2, =0x000008c1 - adds r0, r3, r2 - ldrb r2, [r0] - strb r1, [r0] - movs r2, 0x8C - lsls r2, 4 - adds r0, r3, r2 - ldrb r2, [r0] - strb r1, [r0] - ldr r2, =0x000008c2 - adds r0, r3, r2 - ldrb r2, [r0] - strb r1, [r0] - ldr r2, =0x000008c3 - adds r0, r3, r2 - ldrb r2, [r0] - strb r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800D6C8 - - thumb_func_start sub_800D724 -sub_800D724: @ 800D724 - push {r4,lr} - adds r3, r0, 0 - movs r1, 0 - movs r4, 0 -_0800D72C: - lsls r0, r1, 3 - adds r2, r1, 0x1 - subs r0, r1 - movs r1, 0xD - lsls r0, 1 - adds r0, r3 - adds r0, 0xD -_0800D73A: - strb r4, [r0] - subs r0, 0x1 - subs r1, 0x1 - cmp r1, 0 - bge _0800D73A - adds r1, r2, 0 - cmp r1, 0x27 - ble _0800D72C - movs r1, 0 - ldr r2, =0x00000231 - adds r0, r3, r2 - ldrb r2, [r0] - strb r1, [r0] - movs r2, 0x8C - lsls r2, 2 - adds r0, r3, r2 - ldrb r2, [r0] - strb r1, [r0] - ldr r2, =0x00000232 - adds r0, r3, r2 - ldrb r2, [r0] - strb r1, [r0] - ldr r2, =0x00000233 - adds r0, r3, r2 - ldrb r2, [r0] - strb r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800D724 - - thumb_func_start sub_800D780 -sub_800D780: @ 800D780 - push {r4,lr} - adds r3, r0, 0 - movs r1, 0 - movs r4, 0 -_0800D788: - lsls r0, r1, 8 - adds r2, r1, 0x1 - movs r1, 0xFF - adds r0, r3 - adds r0, 0xFF -_0800D792: - strb r4, [r0] - subs r0, 0x1 - subs r1, 0x1 - cmp r1, 0 - bge _0800D792 - adds r1, r2, 0 - cmp r1, 0x1 - ble _0800D788 - movs r1, 0 - ldr r2, =0x00000201 - adds r0, r3, r2 - ldrb r2, [r0] - strb r1, [r0] - movs r2, 0x80 - lsls r2, 2 - adds r0, r3, r2 - ldrb r2, [r0] - strb r1, [r0] - ldr r2, =0x00000202 - adds r0, r3, r2 - ldrb r2, [r0] - strb r1, [r0] - ldr r2, =0x00000203 - adds r0, r3, r2 - ldrb r2, [r0] - strb r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800D780 - - thumb_func_start sub_800D7D8 -sub_800D7D8: @ 800D7D8 - push {r4-r7,lr} - adds r3, r0, 0 - adds r4, r1, 0 - ldr r1, =0x000008c2 - adds r0, r3, r1 - ldrb r0, [r0] - cmp r0, 0x1F - bhi _0800D874 - ldr r0, =0x04000208 - ldrh r1, [r0] - adds r7, r1, 0 - movs r1, 0 - strh r1, [r0] - movs r5, 0 - movs r2, 0 -_0800D7F6: - adds r1, r4, r2 - ldrb r0, [r1] - cmp r0, 0 - bne _0800D80A - ldrb r0, [r1, 0x1] - cmp r0, 0 - bne _0800D80A - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_0800D80A: - adds r2, 0xE - cmp r2, 0x45 - ble _0800D7F6 - cmp r5, 0x5 - beq _0800D866 - movs r2, 0 - movs r0, 0x8C - lsls r0, 4 - adds r5, r3, r0 - movs r6, 0x46 -_0800D81E: - ldrb r0, [r5] - adds r1, r0, 0 - muls r1, r6 - adds r1, r2, r1 - adds r1, r3, r1 - adds r0, r4, r2 - ldrb r0, [r0] - strb r0, [r1] - adds r2, 0x1 - cmp r2, 0x45 - ble _0800D81E - movs r0, 0x8C - lsls r0, 4 - adds r1, r3, r0 - ldrb r0, [r1] - adds r0, 0x1 - ldrb r2, [r1] - strb r0, [r1] - ldrb r2, [r1] - movs r0, 0x1F - ands r0, r2 - ldrb r2, [r1] - strb r0, [r1] - ldr r0, =0x000008c2 - adds r1, r3, r0 - ldrb r0, [r1] - adds r0, 0x1 - ldrb r2, [r1] - strb r0, [r1] - movs r1, 0 - adds r0, r4, 0 - adds r0, 0x45 -_0800D85E: - strb r1, [r0] - subs r0, 0x1 - cmp r0, r4 - bge _0800D85E -_0800D866: - ldr r0, =0x04000208 - strh r7, [r0] - b _0800D87E - .pool -_0800D874: - ldr r1, =0x000008c3 - adds r0, r3, r1 - ldrb r1, [r0] - movs r1, 0x1 - strb r1, [r0] -_0800D87E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800D7D8 - - thumb_func_start sub_800D888 -sub_800D888: @ 800D888 - push {r4-r7,lr} - adds r6, r0, 0 - adds r5, r1, 0 - ldr r1, =0x00000232 - adds r0, r6, r1 - ldrb r0, [r0] - cmp r0, 0x27 - bhi _0800D920 - ldr r1, =0x04000208 - ldrh r0, [r1] - adds r7, r0, 0 - movs r0, 0 - strh r0, [r1] - movs r2, 0 - ldrb r0, [r5] - cmp r0, 0 - bne _0800D8B8 -_0800D8AA: - adds r2, 0x1 - cmp r2, 0xD - bgt _0800D8B8 - adds r0, r5, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _0800D8AA -_0800D8B8: - cmp r2, 0xE - beq _0800D910 - movs r2, 0 - movs r0, 0x8C - lsls r0, 2 - adds r3, r6, r0 -_0800D8C4: - ldrb r1, [r3] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 1 - adds r0, r2, r0 - adds r0, r6, r0 - adds r1, r5, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0xD - ble _0800D8C4 - movs r1, 0x8C - lsls r1, 2 - adds r4, r6, r1 - ldrb r0, [r4] - adds r0, 0x1 - ldrb r1, [r4] - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0x28 - bl __umodsi3 - ldrb r1, [r4] - strb r0, [r4] - ldr r0, =0x00000232 - adds r1, r6, r0 - ldrb r0, [r1] - adds r0, 0x1 - ldrb r2, [r1] - strb r0, [r1] - movs r1, 0 - adds r0, r5, 0 - adds r0, 0xD -_0800D908: - strb r1, [r0] - subs r0, 0x1 - cmp r0, r5 - bge _0800D908 -_0800D910: - ldr r0, =0x04000208 - strh r7, [r0] - b _0800D92A - .pool -_0800D920: - ldr r1, =0x00000233 - adds r0, r6, r1 - ldrb r1, [r0] - movs r1, 0x1 - strb r1, [r0] -_0800D92A: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800D888 - - thumb_func_start sub_800D934 -sub_800D934: @ 800D934 - push {r4-r7,lr} - adds r3, r0, 0 - adds r4, r1, 0 - ldr r1, =0x04000208 - ldrh r0, [r1] - mov r12, r0 - movs r0, 0 - strh r0, [r1] - movs r1, 0x8C - lsls r1, 4 - adds r0, r3, r1 - ldr r7, =0x000008c1 - adds r5, r3, r7 - ldrb r1, [r0] - ldrb r0, [r5] - cmp r1, r0 - beq _0800D960 - ldr r1, =0x000008c3 - adds r0, r3, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _0800D984 -_0800D960: - movs r1, 0 - adds r0, r4, 0 - adds r0, 0x45 -_0800D966: - strb r1, [r0] - subs r0, 0x1 - cmp r0, r4 - bge _0800D966 - ldr r0, =0x04000208 - mov r7, r12 - strh r7, [r0] - movs r0, 0 - b _0800D9CA - .pool -_0800D984: - movs r2, 0 - movs r6, 0x46 -_0800D988: - adds r1, r4, r2 - ldrb r0, [r5] - adds r7, r0, 0 - muls r7, r6 - adds r0, r7, 0 - adds r0, r2, r0 - adds r0, r3, r0 - ldrb r0, [r0] - strb r0, [r1] - adds r2, 0x1 - cmp r2, 0x45 - ble _0800D988 - ldr r0, =0x000008c1 - adds r1, r3, r0 - ldrb r0, [r1] - adds r0, 0x1 - ldrb r2, [r1] - strb r0, [r1] - ldrb r2, [r1] - movs r0, 0x1F - ands r0, r2 - ldrb r2, [r1] - strb r0, [r1] - ldr r7, =0x000008c2 - adds r1, r3, r7 - ldrb r0, [r1] - subs r0, 0x1 - ldrb r2, [r1] - strb r0, [r1] - ldr r0, =0x04000208 - mov r1, r12 - strh r1, [r0] - movs r0, 0x1 -_0800D9CA: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_800D934 - - thumb_func_start sub_800D9DC -sub_800D9DC: @ 800D9DC - push {r4-r7,lr} - adds r5, r0, 0 - adds r6, r1, 0 - movs r1, 0x8C - lsls r1, 2 - adds r0, r5, r1 - adds r1, 0x1 - adds r4, r5, r1 - ldrb r1, [r0] - ldrb r0, [r4] - cmp r1, r0 - beq _0800DA00 - ldr r1, =0x00000233 - adds r0, r5, r1 - ldrb r0, [r0] - adds r2, r0, 0 - cmp r2, 0 - beq _0800DA08 -_0800DA00: - movs r0, 0 - b _0800DA54 - .pool -_0800DA08: - ldr r1, =0x04000208 - ldrh r0, [r1] - adds r7, r0, 0 - strh r2, [r1] - movs r3, 0 -_0800DA12: - adds r2, r6, r3 - ldrb r1, [r4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 1 - adds r0, r3, r0 - adds r0, r5, r0 - ldrb r0, [r0] - strb r0, [r2] - adds r3, 0x1 - cmp r3, 0xD - ble _0800DA12 - ldr r0, =0x00000231 - adds r4, r5, r0 - ldrb r0, [r4] - adds r0, 0x1 - ldrb r1, [r4] - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0x28 - bl __umodsi3 - ldrb r1, [r4] - strb r0, [r4] - ldr r0, =0x00000232 - adds r1, r5, r0 - ldrb r0, [r1] - subs r0, 0x1 - ldrb r2, [r1] - strb r0, [r1] - ldr r0, =0x04000208 - strh r7, [r0] - movs r0, 0x1 -_0800DA54: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_800D9DC - - thumb_func_start sub_800DA68 -sub_800DA68: @ 800DA68 - push {r4,lr} - adds r2, r0, 0 - adds r4, r1, 0 - ldrb r0, [r4, 0x1] - cmp r0, 0 - bne _0800DA7E - adds r0, r2, 0 - movs r1, 0 - bl sub_800DAC8 - b _0800DAC0 -_0800DA7E: - movs r3, 0 -_0800DA80: - ldrb r1, [r2, 0x1C] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 1 - adds r0, r3, r0 - adds r0, r2, r0 - adds r1, r4, r3 - ldrb r1, [r1] - strb r1, [r0] - adds r3, 0x1 - cmp r3, 0xD - ble _0800DA80 - ldrb r0, [r2, 0x1C] - adds r0, 0x1 - ldrb r1, [r2, 0x1C] - strb r0, [r2, 0x1C] - ldrb r1, [r2, 0x1C] - movs r0, 0x1 - ands r0, r1 - ldrb r1, [r2, 0x1C] - strb r0, [r2, 0x1C] - ldrb r0, [r2, 0x1E] - cmp r0, 0x1 - bhi _0800DABA - ldrb r0, [r2, 0x1E] - adds r0, 0x1 - ldrb r1, [r2, 0x1E] - strb r0, [r2, 0x1E] - b _0800DAC0 -_0800DABA: - ldrb r0, [r2, 0x1C] - ldrb r1, [r2, 0x1D] - strb r0, [r2, 0x1D] -_0800DAC0: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_800DA68 - - thumb_func_start sub_800DAC8 -sub_800DAC8: @ 800DAC8 - push {r4,r5,lr} - adds r3, r0, 0 - adds r5, r1, 0 - ldrb r0, [r3, 0x1E] - cmp r0, 0 - bne _0800DAD8 - movs r0, 0 - b _0800DB12 -_0800DAD8: - cmp r5, 0 - beq _0800DAF6 - movs r4, 0 -_0800DADE: - adds r2, r5, r4 - ldrb r1, [r3, 0x1D] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 1 - adds r0, r4, r0 - adds r0, r3, r0 - ldrb r0, [r0] - strb r0, [r2] - adds r4, 0x1 - cmp r4, 0xD - ble _0800DADE -_0800DAF6: - ldrb r0, [r3, 0x1D] - adds r0, 0x1 - ldrb r1, [r3, 0x1D] - strb r0, [r3, 0x1D] - ldrb r1, [r3, 0x1D] - movs r0, 0x1 - ands r0, r1 - ldrb r1, [r3, 0x1D] - strb r0, [r3, 0x1D] - ldrb r0, [r3, 0x1E] - subs r0, 0x1 - ldrb r1, [r3, 0x1E] - strb r0, [r3, 0x1E] - movs r0, 0x1 -_0800DB12: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_800DAC8 - - thumb_func_start sub_800DB18 -sub_800DB18: @ 800DB18 - push {r4,r5,lr} - adds r3, r0, 0 - adds r5, r1, 0 - ldr r1, =0x00000202 - adds r0, r3, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bhi _0800DB70 - movs r2, 0 - movs r0, 0x80 - lsls r0, 2 - adds r4, r3, r0 -_0800DB30: - ldrb r0, [r4] - lsls r0, 8 - adds r0, r2, r0 - adds r0, r3, r0 - adds r1, r5, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0xFF - ble _0800DB30 - movs r0, 0x80 - lsls r0, 2 - adds r1, r3, r0 - ldrb r0, [r1] - adds r0, 0x1 - ldrb r2, [r1] - strb r0, [r1] - ldrb r2, [r1] - movs r0, 0x1 - ands r0, r2 - ldrb r2, [r1] - strb r0, [r1] - ldr r0, =0x00000202 - adds r1, r3, r0 - ldrb r0, [r1] - adds r0, 0x1 - ldrb r2, [r1] - strb r0, [r1] - b _0800DB7A - .pool -_0800DB70: - ldr r1, =0x00000203 - adds r0, r3, r1 - ldrb r1, [r0] - movs r1, 0x1 - strb r1, [r0] -_0800DB7A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800DB18 - - thumb_func_start sub_800DB84 -sub_800DB84: @ 800DB84 - push {r4,r5,lr} - adds r3, r0, 0 - adds r5, r1, 0 - movs r1, 0x80 - lsls r1, 2 - adds r0, r3, r1 - adds r1, 0x1 - adds r4, r3, r1 - ldrb r1, [r0] - ldrb r0, [r4] - cmp r1, r0 - beq _0800DBA6 - ldr r1, =0x00000203 - adds r0, r3, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _0800DBB0 -_0800DBA6: - movs r0, 0 - b _0800DBEA - .pool -_0800DBB0: - movs r2, 0 -_0800DBB2: - adds r0, r5, r2 - ldrb r1, [r4] - lsls r1, 8 - adds r1, r2, r1 - adds r1, r3, r1 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0xFF - ble _0800DBB2 - ldr r0, =0x00000201 - adds r1, r3, r0 - ldrb r0, [r1] - adds r0, 0x1 - ldrb r2, [r1] - strb r0, [r1] - ldrb r2, [r1] - movs r0, 0x1 - ands r0, r2 - ldrb r2, [r1] - strb r0, [r1] - ldr r0, =0x00000202 - adds r1, r3, r0 - ldrb r0, [r1] - subs r0, 0x1 - ldrb r2, [r1] - strb r0, [r1] - movs r0, 0x1 -_0800DBEA: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_800DB84 - - thumb_func_start sub_800DBF8 -sub_800DBF8: @ 800DBF8 - push {r4-r7,lr} - adds r6, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r1, 0 - movs r5, 0 - cmp r1, 0x1 - beq _0800DC36 - cmp r1, 0x1 - bgt _0800DC12 - cmp r1, 0 - beq _0800DC1C - b _0800DCAA -_0800DC12: - cmp r0, 0x2 - beq _0800DC56 - cmp r0, 0x3 - beq _0800DC76 - b _0800DCAA -_0800DC1C: - movs r4, 0 -_0800DC1E: - adds r0, r6, r4 - adds r1, r4, 0x1 - strb r1, [r0] - lsls r0, r5, 16 - asrs r0, 16 - adds r0, r1 - lsls r0, 16 - lsrs r5, r0, 16 - adds r4, r1, 0 - cmp r4, 0xC7 - ble _0800DC1E - b _0800DC70 -_0800DC36: - movs r4, 0 - adds r2, r6, 0 - adds r2, 0xC8 -_0800DC3C: - adds r0, r6, r4 - adds r1, r4, 0x1 - strb r1, [r0] - lsls r0, r5, 16 - asrs r0, 16 - adds r0, r1 - lsls r0, 16 - lsrs r5, r0, 16 - adds r4, r1, 0 - cmp r4, 0x63 - ble _0800DC3C - strh r5, [r2] - b _0800DCAA -_0800DC56: - movs r4, 0 -_0800DC58: - bl GenerateRandomNumber - lsls r0, 24 - lsrs r0, 24 - adds r1, r6, r4 - strb r0, [r1] - adds r0, r5, r0 - lsls r0, 16 - lsrs r5, r0, 16 - adds r4, 0x1 - cmp r4, 0xC7 - ble _0800DC58 -_0800DC70: - adds r0, r6, r4 - strh r5, [r0] - b _0800DCAA -_0800DC76: - movs r4, 0 - ldr r3, =0x03000d74 - ldrb r1, [r3] - ldrb r0, [r3] - adds r7, r0, 0x1 - adds r2, r1, 0x1 - movs r0, 0xFF - mov r12, r0 -_0800DC86: - adds r0, r6, r4 - adds r1, r4, 0x1 - strb r2, [r0] - adds r0, r4, r7 - mov r4, r12 - ands r0, r4 - adds r0, r5, r0 - lsls r0, 16 - lsrs r5, r0, 16 - adds r2, 0x1 - adds r4, r1, 0 - cmp r1, 0xC7 - ble _0800DC86 - adds r0, r6, r1 - strh r5, [r0] - ldrb r0, [r3] - adds r0, 0x1 - strb r0, [r3] -_0800DCAA: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800DBF8 - - thumb_func_start sub_800DCB4 -sub_800DCB4: @ 800DCB4 - push {r4,r5,lr} - adds r4, r0, 0 - movs r3, 0 - ldrb r0, [r1] - cmp r0, 0xFF - beq _0800DCD8 - ldr r5, =gUnknown_082ED470 - adds r2, r1, 0 -_0800DCC4: - adds r1, r4, r3 - ldrb r0, [r2] - adds r0, r5 - ldrb r0, [r0] - strb r0, [r1] - adds r2, 0x1 - adds r3, 0x1 - ldrb r0, [r2] - cmp r0, 0xFF - bne _0800DCC4 -_0800DCD8: - adds r1, r4, r3 - movs r0, 0 - strb r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800DCB4 - - thumb_func_start sub_800DCE8 -sub_800DCE8: @ 800DCE8 - push {r4,r5,lr} - adds r4, r0, 0 - movs r3, 0 - ldrb r0, [r1] - cmp r0, 0 - beq _0800DD0C - ldr r5, =gUnknown_082ED370 - adds r2, r1, 0 -_0800DCF8: - adds r1, r4, r3 - ldrb r0, [r2] - adds r0, r5 - ldrb r0, [r0] - strb r0, [r1] - adds r2, 0x1 - adds r3, 0x1 - ldrb r0, [r2] - cmp r0, 0 - bne _0800DCF8 -_0800DD0C: - adds r1, r4, r3 - movs r0, 0xFF - strb r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800DCE8 - - thumb_func_start sub_800DD1C -sub_800DD1C: @ 800DD1C - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r6, 0 - ldr r0, =0x03007890 - ldr r4, [r0] - ldrb r2, [r4, 0x2] - ldrb r1, [r4] - adds r7, r0, 0 - cmp r1, 0x1 - bne _0800DD72 - movs r3, 0 - ands r1, r2 - cmp r1, 0 - beq _0800DD4E - cmp r5, 0x1 - bne _0800DD48 - ldrb r0, [r4, 0xA] - b _0800DD8C - .pool -_0800DD48: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_0800DD4E: - lsrs r2, 1 - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x3 - bhi _0800DD8A - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - beq _0800DD4E - adds r0, r6, 0x1 - cmp r5, r0 - bne _0800DD48 -_0800DD68: - ldr r0, [r7] - adds r0, 0xA - adds r0, r3 - ldrb r0, [r0] - b _0800DD8C -_0800DD72: - movs r3, 0 - movs r1, 0x1 -_0800DD76: - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _0800DD68 - lsrs r2, 1 - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x3 - bls _0800DD76 -_0800DD8A: - movs r0, 0 -_0800DD8C: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_800DD1C - - thumb_func_start sub_800DD94 -sub_800DD94: @ 800DD94 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r7, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - movs r4, 0 - ldr r0, =0x03005d90 - mov r8, r0 - adds r6, r7, 0x2 - ldr r0, [r0] - adds r5, r0, 0 - adds r5, 0xA -_0800DDB2: - adds r0, r6, r4 - adds r1, r5, r4 - ldrb r1, [r1] - strb r1, [r0] - adds r4, 0x1 - cmp r4, 0x1 - ble _0800DDB2 - movs r4, 0 - lsls r2, 7 - mov r12, r2 - adds r1, r7, 0x4 -_0800DDC8: - adds r0, r1, r4 - strb r3, [r0] - asrs r3, 8 - adds r4, 0x1 - cmp r4, 0x3 - ble _0800DDC8 - mov r1, r8 - ldr r0, [r1] - ldrb r0, [r0, 0x8] - movs r6, 0x1 - movs r1, 0x1 - ands r1, r0 - ldrb r2, [r7, 0xB] - movs r5, 0x2 - negs r5, r5 - adds r0, r5, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r7, 0xB] - movs r4, 0x7F - mov r1, r9 - ands r1, r4 - ldrb r2, [r7, 0xA] - movs r0, 0x80 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - ands r0, r4 - mov r1, r12 - orrs r0, r1 - strb r0, [r7, 0xA] - ldrb r0, [r7] - movs r1, 0x10 - negs r1, r1 - ands r1, r0 - movs r0, 0x2 - orrs r1, r0 - ldrb r2, [r7, 0x1] - movs r0, 0x3D - negs r0, r0 - ands r0, r2 - movs r2, 0xC - orrs r0, r2 - strb r0, [r7, 0x1] - movs r0, 0x11 - negs r0, r0 - ands r1, r0 - subs r0, 0x10 - ands r1, r0 - subs r0, 0x20 - ands r1, r0 - strb r1, [r7] - ldr r0, =0x0000087f - bl FlagGet - lsls r0, 7 - ldrb r1, [r7] - ands r4, r1 - orrs r4, r0 - strb r4, [r7] - bl sub_809D42C - ands r0, r6 - ldrb r1, [r7, 0x1] - ands r5, r1 - orrs r5, r0 - strb r5, [r7, 0x1] - ldr r0, =0x00000864 - bl FlagGet - ands r6, r0 - lsls r6, 1 - ldrb r1, [r7, 0x1] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - orrs r0, r6 - strb r0, [r7, 0x1] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800DD94 - - thumb_func_start sub_800DE7C -sub_800DE7C: @ 800DE7C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r7, r0, 0 - mov r8, r1 - lsls r2, 24 - lsrs r5, r2, 24 - ldr r0, =0x03004140 - ldrb r0, [r0, 0x6] - cmp r0, 0x1 - bne _0800DED8 - movs r0, 0x1 - mov r9, r0 - ldr r6, =0x03007890 - ldr r0, [r6] - lsls r4, r5, 5 - adds r0, r4 - ldrh r0, [r0, 0x18] - bl sub_8010454 - cmp r0, 0 - beq _0800DEB8 - ldr r1, [r6] - ldrb r0, [r1, 0x7] - asrs r0, r5 - mov r2, r9 - ands r0, r2 - cmp r0, 0 - bne _0800DEF0 -_0800DEB8: - adds r0, r7, 0 - movs r1, 0 - movs r2, 0xD - bl memset - mov r0, r8 - movs r1, 0 - movs r2, 0x8 - bl memset - b _0800DF24 - .pool -_0800DED8: - movs r0, 0 - mov r9, r0 - ldr r6, =0x03007890 - ldr r0, [r6] - lsls r4, r5, 5 - adds r0, r4 - ldrh r0, [r0, 0x18] - bl sub_8010454 - cmp r0, 0 - beq _0800DF10 - ldr r1, [r6] -_0800DEF0: - adds r1, r4, r1 - adds r1, 0x1A - adds r0, r7, 0 - movs r2, 0xD - bl memcpy - ldr r1, [r6] - adds r1, r4, r1 - adds r1, 0x29 - mov r0, r8 - movs r2, 0x8 - bl memcpy - b _0800DF24 - .pool -_0800DF10: - adds r0, r7, 0 - movs r1, 0 - movs r2, 0xD - bl memset - mov r0, r8 - movs r1, 0 - movs r2, 0x8 - bl memset -_0800DF24: - mov r0, r9 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_800DE7C - - thumb_func_start sub_800DF34 -sub_800DF34: @ 800DF34 - push {r4-r7,lr} - adds r3, r0, 0 - adds r5, r1, 0 - lsls r2, 24 - movs r7, 0 - ldr r6, =0x03007890 - ldr r0, [r6] - lsrs r4, r2, 19 - adds r2, r0, r4 - ldrh r1, [r2, 0x18] - ldr r0, =0x00007f7d - cmp r1, r0 - bne _0800DF74 - adds r1, r2, 0 - adds r1, 0x1A - adds r0, r3, 0 - movs r2, 0xD - bl memcpy - ldr r1, [r6] - adds r1, r4, r1 - adds r1, 0x29 - adds r0, r5, 0 - movs r2, 0x8 - bl memcpy - movs r7, 0x1 - b _0800DF88 - .pool -_0800DF74: - adds r0, r3, 0 - movs r1, 0 - movs r2, 0xD - bl memset - adds r0, r5, 0 - movs r1, 0 - movs r2, 0x8 - bl memset -_0800DF88: - adds r0, r7, 0 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_800DF34 - - thumb_func_start sub_800DF90 -sub_800DF90: @ 800DF90 - push {r4,lr} - adds r4, r1, 0 - ldr r1, =0x02022b14 - movs r2, 0xD - bl memcpy - ldr r1, =0x02022b22 - adds r0, r4, 0 - movs r2, 0x8 - bl memcpy - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800DF90 - - thumb_func_start sub_800DFB4 -sub_800DFB4: @ 800DFB4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r1, 24 - lsrs r2, r1, 24 - cmp r3, 0 - bne _0800DFCA - cmp r2, 0 - bne _0800DFCA - movs r3, 0xE7 - movs r2, 0x8 -_0800DFCA: - ldr r0, =0x03007890 - ldr r0, [r0] - ldrb r0, [r0] - cmp r0, 0x1 - bne _0800E024 - ldr r0, =gUnknown_082ED5F0 - adds r1, r3, 0 - movs r3, 0 - bl AddObjectToFront - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =0x02020630 - lsls r4, r5, 4 - adds r4, r5 - lsls r4, 2 - adds r4, r0 - ldr r0, =0x00001234 - strh r0, [r4, 0x3C] - ldr r0, =gUnknown_082ED5E0 - ldrh r0, [r0, 0x6] - bl GetObjectTileRangeStartByTag - strh r0, [r4, 0x3A] - adds r4, 0x3E - ldrb r0, [r4] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r4] - ldr r0, =0x02022b10 - strb r5, [r0] - b _0800E06A - .pool -_0800E024: - ldr r0, =gUnknown_082ED5F0 - adds r1, r3, 0 - movs r3, 0 - bl AddObjectToFront - ldr r4, =0x02022b10 - strb r0, [r4] - ldr r5, =0x02020630 - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =0x00001234 - strh r1, [r0, 0x3C] - ldr r0, =gUnknown_082ED5E0 - ldrh r0, [r0, 0x6] - bl GetObjectTileRangeStartByTag - ldrb r2, [r4] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r5 - strh r0, [r1, 0x3A] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_0800E06A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800DFB4 - - thumb_func_start sub_800E084 -sub_800E084: @ 800E084 - push {r4,lr} - ldr r4, =0x02020630 - ldr r3, =0x02022b10 - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, r0, r4 - movs r0, 0x3C - ldrsh r1, [r2, r0] - ldr r0, =0x00001234 - cmp r1, r0 - bne _0800E0CA - movs r0, 0 - strh r0, [r2, 0x3C] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r3, =0x030022c0 - movs r0, 0x84 - lsls r0, 3 - adds r3, r0 - ldr r0, =gDefaultOamAttributes - ldr r1, [r0] - ldr r2, [r0, 0x4] - str r1, [r3] - str r2, [r3, 0x4] - ldr r1, =0x070003e8 - movs r2, 0x4 - bl CpuSet -_0800E0CA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800E084 - - thumb_func_start sub_800E0E8 -sub_800E0E8: @ 800E0E8 - push {r4,lr} - ldr r4, =gUnknown_082ED5E0 - ldrh r0, [r4, 0x6] - bl GetObjectTileRangeStartByTag - lsls r0, 16 - ldr r1, =0xffff0000 - cmp r0, r1 - bne _0800E100 - adds r0, r4, 0 - bl LoadCompressedObjectPic -_0800E100: - ldr r0, =gUnknown_082ED5E8 - bl LoadTaggedObjectPalette - ldr r1, =0x02022b10 - movs r0, 0xFF - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800E0E8 - - thumb_func_start sub_800E124 -sub_800E124: @ 800E124 - push {r4,lr} - ldr r1, =0x03007890 - ldr r0, [r1] - ldrb r2, [r0, 0x2] - movs r3, 0 - movs r4, 0x1 -_0800E130: - adds r0, r2, 0 - ands r0, r4 - cmp r0, 0 - beq _0800E148 - ldr r0, [r1] - adds r0, 0xA - adds r0, r3 - ldrb r0, [r0] - b _0800E156 - .pool -_0800E148: - lsrs r2, 1 - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x3 - bls _0800E130 - movs r0, 0 -_0800E156: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_800E124 - - thumb_func_start sub_800E15C -sub_800E15C: @ 800E15C - push {lr} - adds r2, r0, 0 - movs r3, 0x32 - ldrsh r0, [r2, r3] - cmp r0, r1 - beq _0800E170 - movs r0, 0 - strh r1, [r2, 0x32] - strh r0, [r2, 0x34] - strh r0, [r2, 0x36] -_0800E170: - pop {r0} - bx r0 - thumb_func_end sub_800E15C - - thumb_func_start sub_800E174 -sub_800E174: @ 800E174 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r1, =0x02022b10 - ldrb r0, [r1] - cmp r0, 0xFF - bne _0800E184 - b _0800E346 -_0800E184: - ldr r2, =0x02020630 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, r0, r2 - movs r0, 0x3C - ldrsh r1, [r2, r0] - ldr r0, =0x00001234 - cmp r1, r0 - beq _0800E19C - b _0800E346 -_0800E19C: - adds r6, r2, 0 - movs r5, 0xFF - movs r4, 0 - ldr r0, =0x03007890 - ldr r0, [r0] - ldrb r0, [r0] - cmp r0, 0x1 - bne _0800E1F6 - adds r7, r6, 0 - adds r7, 0x28 - movs r1, 0x29 - adds r1, r6 - mov r8, r1 - b _0800E1E6 - .pool -_0800E1C8: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_800DD1C - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - bcc _0800E1E6 - adds r0, r4, 0 - bl sub_800DD1C - lsls r0, 24 - lsrs r5, r0, 24 -_0800E1E6: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x1 - cmp r4, r0 - blt _0800E1C8 - b _0800E208 -_0800E1F6: - bl sub_800E124 - lsls r0, 24 - lsrs r5, r0, 24 - adds r7, r6, 0 - adds r7, 0x28 - movs r2, 0x29 - adds r2, r6 - mov r8, r2 -_0800E208: - bl sub_8012224 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0800E218 - movs r0, 0x4 - b _0800E246 -_0800E218: - cmp r5, 0x18 - bhi _0800E220 - movs r0, 0x3 - b _0800E246 -_0800E220: - adds r0, r5, 0 - subs r0, 0x19 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x65 - bhi _0800E230 - movs r0, 0x2 - b _0800E246 -_0800E230: - adds r0, r5, 0 - subs r0, 0x7F - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x65 - bhi _0800E240 - movs r0, 0x1 - b _0800E246 -_0800E240: - cmp r5, 0xE4 - bls _0800E248 - movs r0, 0 -_0800E246: - strh r0, [r6, 0x2E] -_0800E248: - movs r3, 0x2E - ldrsh r1, [r6, r3] - movs r2, 0x30 - ldrsh r0, [r6, r2] - cmp r1, r0 - beq _0800E25E - adds r0, r6, 0 - bl sub_800E15C - ldrh r0, [r6, 0x2E] - strh r0, [r6, 0x30] -_0800E25E: - movs r0, 0x32 - ldrsh r1, [r6, r0] - ldr r2, [r6, 0x8] - lsls r1, 2 - adds r1, r2 - movs r3, 0x36 - ldrsh r0, [r6, r3] - ldr r1, [r1] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - lsls r0, 10 - lsrs r0, 26 - movs r3, 0x34 - ldrsh r1, [r6, r3] - cmp r0, r1 - bge _0800E2AC - ldrh r0, [r6, 0x36] - adds r0, 0x1 - movs r3, 0 - strh r0, [r6, 0x36] - strh r3, [r6, 0x34] - movs r1, 0x32 - ldrsh r0, [r6, r1] - lsls r0, 2 - adds r0, r2 - movs r2, 0x36 - ldrsh r1, [r6, r2] - ldr r0, [r0] - lsls r1, 2 - adds r1, r0 - movs r0, 0 - ldrsh r1, [r1, r0] - movs r0, 0x2 - negs r0, r0 - cmp r1, r0 - bne _0800E2B2 - strh r3, [r6, 0x36] - b _0800E2B2 -_0800E2AC: - ldrh r0, [r6, 0x34] - adds r0, 0x1 - strh r0, [r6, 0x34] -_0800E2B2: - ldr r4, =0x030022c0 - movs r1, 0x84 - lsls r1, 3 - adds r0, r4, r1 - ldr r1, =gUnknown_082ED570 - ldr r2, [r1, 0x4] - ldr r1, [r1] - str r1, [r0] - str r2, [r0, 0x4] - movs r3, 0x20 - ldrsh r2, [r6, r3] - movs r1, 0 - ldrsb r1, [r7, r1] - adds r2, r1 - ldr r1, =0x00000422 - adds r5, r4, r1 - ldr r3, =0x000001ff - adds r1, r3, 0 - ands r2, r1 - ldrh r3, [r5] - ldr r1, =0xfffffe00 - ands r1, r3 - orrs r1, r2 - strh r1, [r5] - ldrh r1, [r6, 0x22] - mov r2, r8 - ldrb r2, [r2] - adds r1, r2 - strb r1, [r0] - ldrb r2, [r6, 0x5] - ldr r3, =0x00000425 - adds r5, r4, r3 - lsrs r2, 4 - lsls r2, 4 - ldrb r3, [r5] - movs r1, 0xF - ands r1, r3 - orrs r1, r2 - strb r1, [r5] - movs r1, 0x32 - ldrsh r2, [r6, r1] - ldr r1, [r6, 0x8] - lsls r2, 2 - adds r2, r1 - movs r3, 0x36 - ldrsh r1, [r6, r3] - ldr r2, [r2] - lsls r1, 2 - adds r1, r2 - ldrh r2, [r1] - ldrh r6, [r6, 0x3A] - adds r2, r6 - ldr r1, =0x00000424 - adds r4, r1 - ldr r3, =0x000003ff - adds r1, r3, 0 - ands r2, r1 - ldrh r3, [r4] - ldr r1, =0xfffffc00 - ands r1, r3 - orrs r1, r2 - strh r1, [r4] - ldr r1, =0x070003e8 - movs r2, 0x4 - bl CpuSet - bl sub_8011A74 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0800E346 - bl sub_800E084 -_0800E346: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800E174 - - thumb_func_start sub_800E378 -sub_800E378: @ 800E378 - push {lr} - stm r0!, {r1} - adds r1, r2, 0 - bl CopyString - pop {r0} - bx r0 - thumb_func_end sub_800E378 - - thumb_func_start sub_800E388 -sub_800E388: @ 800E388 - push {lr} - adds r2, r0, 0 - movs r1, 0 -_0800E38E: - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _0800E39A - movs r0, 0x1 - b _0800E3A2 -_0800E39A: - adds r1, 0x1 - cmp r1, 0x7 - ble _0800E38E - movs r0, 0 -_0800E3A2: - pop {r1} - bx r1 - thumb_func_end sub_800E388 - - thumb_func_start sub_800E3A8 -sub_800E3A8: @ 800E3A8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _0800E3BE - b _0800E520 -_0800E3BE: - movs r0, 0xF0 - bl AllocZeroed - str r0, [sp, 0x14] - movs r4, 0 - b _0800E434 - .pool -_0800E3D0: - lsls r2, r4, 2 - mov r0, sp - adds r1, r0, r2 - movs r0, 0x1 - negs r0, r0 - str r0, [r1] - movs r5, 0 - mov r8, r2 - lsls r0, r4, 3 - adds r1, r4, 0x1 - mov r9, r1 - subs r0, r4 - lsls r0, 2 - str r0, [sp, 0x1C] - ldr r7, =0x020229f0 - mov r10, r7 - ldr r6, =0x00003b98 - movs r4, 0 - mov r0, r10 - subs r0, 0x4 - ldr r1, [sp, 0x1C] - adds r3, r1, r0 -_0800E3FC: - ldrh r1, [r3] - ldr r0, =0x03005d8c - ldr r2, [r0] - ldr r7, =0x00003b98 - adds r0, r2, r7 - adds r0, r4 - ldr r0, [r0] - cmp r1, r0 - bne _0800E428 - adds r1, r2, r6 - adds r1, 0x4 - ldr r0, [sp, 0x1C] - add r0, r10 - str r3, [sp, 0x18] - bl CompareString - ldr r3, [sp, 0x18] - cmp r0, 0 - bne _0800E428 - mov r0, sp - add r0, r8 - str r5, [r0] -_0800E428: - adds r6, 0xC - adds r4, 0xC - adds r5, 0x1 - cmp r5, 0x13 - ble _0800E3FC - mov r4, r9 -_0800E434: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - blt _0800E3D0 - movs r0, 0 - mov r8, r0 - movs r4, 0 - mov r7, sp - movs r5, 0 - ldr r6, [sp, 0x14] - b _0800E4AC - .pool -_0800E45C: - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - beq _0800E4A6 - ldr r2, =0x020229e8 - adds r0, r5, r2 - ldrh r0, [r0, 0x1A] - cmp r0, 0x1 - beq _0800E4A6 - adds r0, r2, 0x4 - adds r0, r5, r0 - ldrh r1, [r0] - adds r2, 0x8 - adds r2, r5, r2 - adds r0, r6, 0 - bl sub_800E378 - ldr r2, [r7] - cmp r2, 0 - blt _0800E4A0 - ldr r0, =0x03005d8c - ldr r1, [r0] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldr r1, =0x00003b9c - adds r0, r1 - movs r1, 0 - movs r2, 0x8 - bl memset -_0800E4A0: - adds r6, 0xC - movs r0, 0x1 - add r8, r0 -_0800E4A6: - adds r7, 0x4 - adds r5, 0x1C - adds r4, 0x1 -_0800E4AC: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - blt _0800E45C - movs r4, 0 - ldr r1, =0x03005d8c - mov r9, r1 - ldr r6, =0x00003b98 - movs r7, 0 - mov r1, r8 - lsls r0, r1, 1 - add r0, r8 - lsls r0, 2 - ldr r1, [sp, 0x14] - adds r5, r0, r1 -_0800E4CE: - mov r1, r9 - ldr r0, [r1] - adds r0, r6 - adds r0, 0x4 - bl sub_800E388 - cmp r0, 0 - beq _0800E500 - mov r0, r9 - ldr r2, [r0] - ldr r1, =0x00003b98 - adds r0, r2, r1 - adds r0, r7 - ldr r1, [r0] - adds r2, r6 - adds r2, 0x4 - adds r0, r5, 0 - bl sub_800E378 - adds r5, 0xC - movs r0, 0x1 - add r8, r0 - mov r1, r8 - cmp r1, 0x13 - bgt _0800E50A -_0800E500: - adds r6, 0xC - adds r7, 0xC - adds r4, 0x1 - cmp r4, 0x13 - ble _0800E4CE -_0800E50A: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r7, =0x00003b98 - adds r0, r7 - ldr r1, [sp, 0x14] - movs r2, 0xF0 - bl memcpy - ldr r0, [sp, 0x14] - bl Free -_0800E520: - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800E3A8 - - thumb_func_start sub_800E540 -sub_800E540: @ 800E540 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - mov r9, r1 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - movs r7, 0 - ldr r6, =0x03005d8c - ldr r4, =0x00003b98 - movs r5, 0 -_0800E558: - ldr r0, [r6] - adds r0, r4 - adds r0, 0x4 - mov r1, r9 - bl CompareString - cmp r0, 0 - bne _0800E584 - ldr r0, [r6] - ldr r1, =0x00003b98 - adds r0, r1 - adds r0, r5 - ldr r0, [r0] - cmp r0, r8 - bne _0800E584 - movs r0, 0x1 - b _0800E59E - .pool -_0800E584: - ldr r0, [r6] - adds r0, r4 - adds r0, 0x4 - bl sub_800E388 - cmp r0, 0 - beq _0800E59C - adds r4, 0xC - adds r5, 0xC - adds r7, 0x1 - cmp r7, 0x13 - ble _0800E558 -_0800E59C: - movs r0, 0 -_0800E59E: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_800E540 - - thumb_func_start sub_800E5AC -sub_800E5AC: @ 800E5AC - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - ldr r0, =0x00003b98 - mov r8, r0 - movs r7, 0 - mov r6, r8 - movs r5, 0 - movs r4, 0x13 -_0800E5C0: - ldr r0, =0x03005d8c - ldr r1, [r0] - mov r2, r8 - adds r0, r1, r2 - adds r0, r5 - str r7, [r0] - mov r0, sp - strh r7, [r0] - adds r1, r6 - adds r1, 0x4 - ldr r2, =0x01000004 - bl CpuSet - adds r6, 0xC - adds r5, 0xC - subs r4, 0x1 - cmp r4, 0 - bge _0800E5C0 - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800E5AC - - thumb_func_start nullsub_5 -nullsub_5: @ 800E5FC - bx lr - thumb_func_end nullsub_5 - - thumb_func_start nullsub_13 -nullsub_13: @ 800E600 - bx lr - thumb_func_end nullsub_13 - - thumb_func_start sub_800E604 -sub_800E604: @ 800E604 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - ldr r6, =0x03005000 - adds r5, r6, 0 - adds r5, 0xEE - ldrb r4, [r5] - mov r0, sp - movs r7, 0 - strh r7, [r0] - ldr r2, =0x0100067a - adds r1, r6, 0 - bl CpuSet - ldrb r0, [r5] - strb r4, [r5] - movs r0, 0xFF - strb r0, [r6, 0xC] - ldrb r0, [r5] - cmp r0, 0x4 - beq _0800E636 - ldrb r0, [r5] - strb r7, [r5] -_0800E636: - mov r7, sp - adds r7, 0x2 - add r0, sp, 0x4 - mov r8, r0 - movs r0, 0x6 - add r0, sp - mov r9, r0 - adds r5, r6, 0 - adds r5, 0x80 - movs r4, 0x4 -_0800E64A: - adds r0, r5, 0 - bl sub_800FCC4 - adds r5, 0x14 - subs r4, 0x1 - cmp r4, 0 - bge _0800E64A - movs r5, 0 - ldr r4, =0x0300506c - adds r0, r4, 0 - bl sub_800FCC4 - adds r0, r4, 0 - adds r0, 0xB8 - bl sub_800D6C8 - ldr r0, =0x0000097c - adds r4, r0 - adds r0, r4, 0 - bl sub_800D724 - strh r5, [r7] - ldr r1, =0x03003110 - ldr r2, =0x01000008 - adds r0, r7, 0 - bl CpuSet - mov r0, r8 - strh r5, [r0] - ldr r1, =0x03003090 - ldr r2, =0x01000028 - bl CpuSet - mov r0, r9 - strh r5, [r0] - ldr r1, =0x020229e8 - ldr r2, =0x01000046 - bl CpuSet - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800E604 - - thumb_func_start sub_800E6D0 -sub_800E6D0: @ 800E6D0 - push {r4-r6,lr} - ldr r4, =0x03002710 - ldr r5, [r4, 0x4] - ldr r6, [r4, 0x8] - bl sub_800E700 - bl rfu_REQ_stopMode - bl rfu_waitREQComplete - ldr r1, =0x04000208 - movs r0, 0 - strh r0, [r1] - str r5, [r4, 0x4] - str r6, [r4, 0x8] - movs r0, 0x1 - strh r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800E6D0 - - thumb_func_start sub_800E700 -sub_800E700: @ 800E700 - push {r4,lr} - ldr r0, =0x03004190 - ldr r1, =0x00000e64 - ldr r4, =0x03002714 - adds r2, r4, 0 - movs r3, 0x1 - bl rfu_initializeAPI - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - bne _0800E732 - ldr r0, =0x020229c6 - strh r1, [r0] - bl sub_800AAF4 - movs r0, 0 - bl sub_80111B0 - bl sub_800E604 - adds r1, r4, 0x4 - movs r0, 0x3 - bl rfu_setTimerInterrupt -_0800E732: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800E700 - - thumb_func_start sub_800E748 -sub_800E748: @ 800E748 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_8010750 - ldr r0, =0x03005000 - ldrh r0, [r0, 0x4] - cmp r0, 0x12 - bls _0800E75C - b _0800E862 -_0800E75C: - lsls r0, 2 - ldr r1, =_0800E770 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0800E770: - .4byte _0800E7BC - .4byte _0800E862 - .4byte _0800E7E4 - .4byte _0800E862 - .4byte _0800E814 - .4byte _0800E862 - .4byte _0800E862 - .4byte _0800E862 - .4byte _0800E862 - .4byte _0800E862 - .4byte _0800E862 - .4byte _0800E862 - .4byte _0800E862 - .4byte _0800E862 - .4byte _0800E862 - .4byte _0800E862 - .4byte _0800E862 - .4byte _0800E862 - .4byte _0800E828 -_0800E7BC: - ldr r0, =0x02022b2c - bl sub_800BFCC - ldr r0, =0x03005000 - movs r2, 0x1 - strh r2, [r0, 0x4] - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - strh r2, [r0, 0xA] - b _0800E862 - .pool -_0800E7E4: - ldr r4, =0x03005000 - ldrb r0, [r4, 0xC] - ldr r3, =gUnknown_082ED6E0 - movs r1, 0 - movs r2, 0xF0 - bl sub_800C054 - movs r0, 0x3 - strh r0, [r4, 0x4] - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0x6 - strh r1, [r0, 0xA] - b _0800E862 - .pool -_0800E814: - movs r0, 0 - bl sub_800C27C - ldr r1, =0x03005000 - movs r0, 0x5 - strh r0, [r1, 0x4] - b _0800E862 - .pool -_0800E828: - ldr r4, =0x03005000 - ldr r0, =0x00000cdb - adds r1, r4, r0 - ldrb r0, [r1] - movs r0, 0 - strb r0, [r1] - ldr r0, =sub_800EDBC - bl sub_800D52C - bl sub_800EAB4 - bl sub_800EAFC - movs r0, 0x14 - strh r0, [r4, 0x4] - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0x8 - strh r1, [r0, 0xA] - ldr r0, =sub_801084C - movs r1, 0x5 - bl AddTask - adds r0, r5, 0 - bl remove_task -_0800E862: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800E748 - - thumb_func_start sub_800E87C -sub_800E87C: @ 800E87C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_082ED6A5 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_800E87C - - thumb_func_start sub_800E88C -sub_800E88C: @ 800E88C - push {r4-r7,lr} - adds r2, r0, 0 - adds r5, r1, 0 - movs r4, 0x1 - adds r1, r2, 0 - movs r6, 0 - movs r0, 0x1 - negs r0, r0 - cmp r5, r0 - bne _0800E8CC - movs r3, 0 - movs r5, 0x1 - ldr r1, =0x03005cde -_0800E8A6: - adds r0, r2, 0 - ands r0, r5 - cmp r0, 0 - beq _0800E8B8 - adds r0, r3, r1 - strb r4, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_0800E8B8: - asrs r2, 1 - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x3 - bls _0800E8A6 - b _0800E942 - .pool -_0800E8CC: - movs r3, 0 - mvns r0, r1 - mov r12, r0 - movs r7, 0x1 - ldr r4, =0x03005cde -_0800E8D6: - adds r2, r1, 0 - ands r2, r7 - cmp r2, 0 - bne _0800E8E2 - adds r0, r3, r4 - strb r2, [r0] -_0800E8E2: - asrs r1, 1 - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x3 - bls _0800E8D6 - movs r4, 0x4 - ldr r0, =0x03005cde - ldrb r7, [r0] -_0800E8F4: - movs r3, 0 - subs r1, r4, 0x1 - cmp r7, r4 - beq _0800E910 - ldr r2, =0x03005cde -_0800E8FE: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x3 - bhi _0800E910 - adds r0, r3, r2 - ldrb r0, [r0] - cmp r0, r4 - bne _0800E8FE -_0800E910: - cmp r3, 0x4 - bne _0800E916 - adds r6, r4, 0 -_0800E916: - lsls r0, r1, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _0800E8F4 - mov r0, r12 - ands r5, r0 - movs r3, 0 - movs r2, 0x1 - ldr r1, =0x03005cde -_0800E928: - adds r0, r5, 0 - ands r0, r2 - cmp r0, 0 - beq _0800E936 - adds r0, r3, r1 - strb r6, [r0] - adds r6, 0x1 -_0800E936: - asrs r5, 1 - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x3 - bls _0800E928 -_0800E942: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800E88C - - thumb_func_start sub_800E94C -sub_800E94C: @ 800E94C - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x03005000 - ldrh r3, [r0, 0x4] - adds r7, r0, 0 - cmp r3, 0xC - bls _0800E95E - b _0800EA9A -_0800E95E: - lsls r0, r3, 2 - ldr r1, =_0800E970 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0800E970: - .4byte _0800E9A4 - .4byte _0800EA9A - .4byte _0800EA9A - .4byte _0800EA9A - .4byte _0800EA9A - .4byte _0800EA9A - .4byte _0800E9BC - .4byte _0800EA9A - .4byte _0800EA9A - .4byte _0800E9E4 - .4byte _0800EA9A - .4byte _0800E9F8 - .4byte _0800EA3C -_0800E9A4: - ldr r0, =gUnknown_082ED608 - bl sub_800BFCC - ldr r0, =0x03005000 - movs r2, 0x1 - strh r2, [r0, 0x4] - b _0800E9CC - .pool -_0800E9BC: - ldrb r0, [r7, 0xC] - ldr r3, =gUnknown_082ED6E0 - movs r1, 0 - movs r2, 0xF0 - bl sub_800C054 - movs r2, 0x7 - strh r2, [r7, 0x4] -_0800E9CC: - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - strh r2, [r0, 0xA] - b _0800EA9A - .pool -_0800E9E4: - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - movs r0, 0xA - strh r0, [r1, 0xA] - b _0800EA9A - .pool -_0800E9F8: - bl sub_80107A0 - cmp r0, 0x6 - beq _0800EA1C - cmp r0, 0x6 - bgt _0800EA0A - cmp r0, 0x5 - beq _0800EA10 - b _0800EA9A -_0800EA0A: - cmp r0, 0x9 - beq _0800EA1C - b _0800EA9A -_0800EA10: - ldr r1, =0x03005000 - movs r0, 0xC - strh r0, [r1, 0x4] - b _0800EA9A - .pool -_0800EA1C: - bl sub_800D630 - ldr r0, =0x03005000 - ldr r1, =0x00000ce4 - adds r0, r1 - movs r1, 0x2 - strb r1, [r0] - adds r0, r6, 0 - bl remove_task - b _0800EA9A - .pool -_0800EA3C: - ldr r0, =0x00000c3e - adds r4, r7, r0 - ldrb r0, [r4] - movs r5, 0x80 - lsls r5, 17 - lsls r5, r0 - lsrs r5, 24 - ldrb r1, [r4] - movs r0, 0xC - bl rfu_clearSlot - ldrb r1, [r4] - ldr r0, =0x00000c3f - adds r2, r7, r0 - movs r0, 0x10 - movs r3, 0x46 - bl rfu_setRecvBuffer - adds r1, r7, 0 - adds r1, 0x4C - adds r0, r5, 0 - movs r2, 0xE - bl rfu_UNI_setSendData - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - movs r1, 0x8 - strh r1, [r0, 0xA] - adds r0, r6, 0 - bl remove_task - ldr r4, =0x02022b44 - ldrb r0, [r4, 0xF] - cmp r0, 0 - bne _0800EA92 - bl sub_801227C - ldrb r0, [r4, 0xF] - adds r0, 0x1 - strb r0, [r4, 0xF] -_0800EA92: - ldr r0, =sub_801084C - movs r1, 0x5 - bl AddTask -_0800EA9A: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800E94C - - thumb_func_start sub_800EAB4 -sub_800EAB4: @ 800EAB4 - push {r4,r5,lr} - ldr r0, =0x03004140 - ldrb r5, [r0] - movs r4, 0 -_0800EABC: - movs r0, 0x1 - ands r0, r5 - cmp r0, 0 - beq _0800EAE0 - lsls r2, r4, 3 - subs r2, r4 - lsls r2, 1 - ldr r0, =0x03005014 - adds r2, r0 - movs r0, 0x10 - adds r1, r4, 0 - movs r3, 0xE - bl rfu_setRecvBuffer - movs r0, 0x3 - adds r1, r4, 0 - bl rfu_clearSlot -_0800EAE0: - lsrs r5, 1 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _0800EABC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800EAB4 - - thumb_func_start sub_800EAFC -sub_800EAFC: @ 800EAFC - push {r4-r6,lr} - ldr r0, =0x03004140 - ldrb r5, [r0] - ldr r4, =0x03005c87 - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x46 - bl rfu_UNI_setSendData - adds r0, r5, 0 - bl sub_800E87C - ldr r1, =0xfffff379 - adds r6, r4, r1 - adds r1, r4, 0 - adds r1, 0x53 - strb r0, [r1] - adds r4, 0x5B - strb r5, [r4] - movs r1, 0x1 - negs r1, r1 - adds r0, r5, 0 - bl sub_800E88C - movs r0, 0x1 - strb r0, [r6, 0xC] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800EAFC - - thumb_func_start sub_800EB44 -sub_800EB44: @ 800EB44 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_800F7DC - ldrb r1, [r0, 0xA] - movs r0, 0x7F - ands r0, r1 - cmp r0, 0x54 - bne _0800EB78 - bl sub_8011A74 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bne _0800EB78 - ldr r0, =0x03004140 - ldrb r0, [r0] - bl rfu_REQ_disconnect - bl rfu_waitREQComplete - movs r0, 0 - movs r1, 0 - bl sub_8011A64 -_0800EB78: - ldr r0, =0x03005000 - ldrh r2, [r0, 0x4] - adds r6, r0, 0 - cmp r2, 0x12 - bls _0800EB84 - b _0800ECF4 -_0800EB84: - lsls r0, r2, 2 - ldr r1, =_0800EB9C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0800EB9C: - .4byte _0800EBE8 - .4byte _0800ECF4 - .4byte _0800ECF4 - .4byte _0800ECF4 - .4byte _0800ECF4 - .4byte _0800ECF4 - .4byte _0800ECF4 - .4byte _0800ECF4 - .4byte _0800ECF4 - .4byte _0800ECF4 - .4byte _0800ECF4 - .4byte _0800ECF4 - .4byte _0800ECF4 - .4byte _0800EC38 - .4byte _0800EC98 - .4byte _0800ECF4 - .4byte _0800ECAC - .4byte _0800EC10 - .4byte _0800ECF4 -_0800EBE8: - ldr r0, =0x02022b2c - bl sub_800BFCC - ldr r0, =0x03005000 - movs r2, 0x1 - strh r2, [r0, 0x4] - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - strh r2, [r0, 0xA] - b _0800ECF4 - .pool -_0800EC10: - ldr r3, =gUnknown_082ED6E0 - movs r0, 0x2 - movs r1, 0 - movs r2, 0xF0 - bl sub_800C054 - ldr r0, =sub_800ED34 - bl sub_800D52C - ldr r1, =0x03005000 - movs r0, 0x12 - strh r0, [r1, 0x4] - b _0800ECF4 - .pool -_0800EC38: - ldr r1, =0x00000c3e - adds r0, r6, r1 - ldrb r1, [r0] - movs r0, 0x80 - lsls r0, 17 - lsls r0, r1 - lsrs r0, 24 - adds r1, r6, 0 - adds r1, 0x4C - movs r2, 0xE - bl rfu_UNI_setSendData - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _0800ECF4 - strb r0, [r6, 0xC] - adds r0, r5, 0 - bl remove_task - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - movs r2, 0x16 - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _0800EC88 - ldr r0, =sub_8010D0C - movs r1, 0x1 - bl AddTask - b _0800ECF4 - .pool -_0800EC88: - ldr r0, =sub_801084C - movs r1, 0x5 - bl AddTask - b _0800ECF4 - .pool -_0800EC98: - movs r0, 0 - bl sub_800C27C - ldr r1, =0x03005000 - movs r0, 0xF - strh r0, [r1, 0x4] - b _0800ECF4 - .pool -_0800ECAC: - ldr r0, =0x00000cdb - adds r1, r6, r0 - ldrb r0, [r1] - movs r0, 0 - strb r0, [r1] - ldr r0, =sub_800EDBC - bl sub_800D52C - movs r0, 0x1 - bl sub_8011068 - bl sub_800EAB4 - bl sub_800EAFC - movs r0, 0x14 - strh r0, [r6, 0x4] - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0x8 - strh r1, [r0, 0xA] - movs r4, 0x1 - strb r4, [r6, 0xC] - ldr r0, =sub_801084C - movs r1, 0x5 - bl AddTask - ldr r1, =0x00000ce8 - adds r0, r6, r1 - strb r4, [r0] - adds r0, r5, 0 - bl remove_task -_0800ECF4: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800EB44 - - thumb_func_start sub_800ED10 -sub_800ED10: @ 800ED10 - push {lr} - ldr r3, =gUnknown_082ED6E0 - movs r0, 0x1 - movs r1, 0 - movs r2, 0xF0 - bl sub_800C054 - pop {r0} - bx r0 - .pool - thumb_func_end sub_800ED10 - - thumb_func_start sub_800ED28 -sub_800ED28: @ 800ED28 - push {lr} - movs r0, 0 - bl sub_800C27C - pop {r0} - bx r0 - thumb_func_end sub_800ED28 - - thumb_func_start sub_800ED34 -sub_800ED34: @ 800ED34 - push {r4,lr} - ldr r0, =0x03005000 - movs r2, 0 - movs r1, 0xD - adds r0, 0x59 -_0800ED3E: - strb r2, [r0] - subs r0, 0x1 - subs r1, 0x1 - cmp r1, 0 - bge _0800ED3E - bl rfu_REQ_recvData - bl rfu_waitREQComplete - ldr r1, =0x03007870 - ldr r3, =0x03005000 - ldr r0, =0x00000c3e - adds r4, r3, r0 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - ldrb r0, [r0, 0x12] - cmp r0, 0 - beq _0800ED9A - movs r2, 0xCD - lsls r2, 4 - adds r1, r3, r2 - ldrb r0, [r1] - adds r0, 0x1 - ldrb r2, [r1] - strb r0, [r1] - movs r1, 0x92 - lsls r1, 1 - adds r0, r3, r1 - ldr r2, =0x00000c3f - adds r1, r3, r2 - bl sub_800D7D8 - ldr r1, =0x02022b44 - ldrh r0, [r1, 0x6] - adds r0, 0x1 - strh r0, [r1, 0x6] - bl sub_800F048 - ldrb r0, [r4] - bl rfu_UNI_readySendData - ldrb r0, [r4] - bl rfu_UNI_clearRecvNewDataFlag -_0800ED9A: - movs r0, 0x1 - bl rfu_REQ_sendData_wrapper - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800ED34 - - thumb_func_start sub_800EDBC -sub_800EDBC: @ 800EDBC - ldr r0, =0x03005000 - ldr r1, =0x00000cdb - adds r0, r1 - ldrb r1, [r0] - movs r1, 0x1 - strb r1, [r0] - bx lr - .pool - thumb_func_end sub_800EDBC - - thumb_func_start sub_800EDD4 -sub_800EDD4: @ 800EDD4 - push {r4-r6,lr} - bl sub_800C048 - ldr r4, =0x03005000 - ldrb r0, [r4, 0xC] - cmp r0, 0x1 - bne _0800EDF0 - ldr r0, =sub_800E748 - b _0800EDF6 - .pool -_0800EDF0: - cmp r0, 0 - bne _0800EE18 - ldr r0, =sub_800E94C -_0800EDF6: - bl is_function_an_active_task - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0800EE38 - adds r0, r4, 0 - adds r0, 0x67 - ldrb r0, [r0] - bl remove_task - bl sub_800E604 - b _0800EE38 - .pool -_0800EE18: - cmp r0, 0x2 - bne _0800EE38 - ldr r0, =sub_800EB44 - bl is_function_an_active_task - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0800EE38 - adds r0, r4, 0 - adds r0, 0x67 - ldrb r0, [r0] - bl remove_task - bl sub_800E604 -_0800EE38: - movs r5, 0 - ldr r6, =gUnknown_082ED7E0 -_0800EE3C: - lsls r0, r5, 2 - adds r0, r6 - ldr r4, [r0] - adds r0, r4, 0 - bl is_function_an_active_task - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0800EE5E - adds r0, r4, 0 - bl get_task_id_by_function - lsls r0, 24 - lsrs r0, 24 - bl remove_task -_0800EE5E: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _0800EE3C - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800EDD4 - - thumb_func_start sub_800EE78 -sub_800EE78: @ 800EE78 - push {lr} - ldr r0, =sub_800E748 - movs r1, 0x1 - bl AddTask - ldr r1, =0x03005000 - adds r1, 0x67 - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_800EE78 - - thumb_func_start sub_800EE94 -sub_800EE94: @ 800EE94 - push {lr} - ldr r1, =0x03005000 - ldrh r0, [r1, 0x4] - cmp r0, 0x7 - bne _0800EEB4 - ldr r2, =0x00000ccd - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _0800EEB4 - movs r0, 0x1 - b _0800EEB6 - .pool -_0800EEB4: - movs r0, 0 -_0800EEB6: - pop {r1} - bx r1 - thumb_func_end sub_800EE94 - - thumb_func_start sub_800EEBC -sub_800EEBC: @ 800EEBC - push {r4,lr} - ldr r4, =0x03005000 - ldrh r0, [r4, 0x4] - cmp r0, 0x7 - bne _0800EEF8 - ldr r0, =0x03007890 - ldr r1, [r0] - ldr r2, =0x00000c3d - adds r0, r4, r2 - ldrb r0, [r0] - lsls r0, 5 - adds r1, r0 - ldrh r0, [r1, 0x14] - movs r1, 0xF0 - bl sub_800C12C - lsls r0, 24 - cmp r0, 0 - bne _0800EEF8 - movs r0, 0x9 - strh r0, [r4, 0x4] - movs r0, 0x1 - b _0800EEFA - .pool -_0800EEF8: - movs r0, 0 -_0800EEFA: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_800EEBC - - thumb_func_start sub_800EF00 -sub_800EF00: @ 800EF00 - push {lr} - ldr r0, =sub_800E94C - movs r1, 0x1 - bl AddTask - ldr r1, =0x03005000 - adds r1, 0x67 - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_800EF00 - - thumb_func_start sub_800EF1C -sub_800EF1C: @ 800EF1C - push {lr} - ldr r0, =0x03004140 - ldrb r0, [r0] - cmp r0, 0 - bne _0800EF30 - movs r0, 0 - b _0800EF32 - .pool -_0800EF30: - movs r0, 0x1 -_0800EF32: - pop {r1} - bx r1 - thumb_func_end sub_800EF1C - - thumb_func_start sub_800EF38 -sub_800EF38: @ 800EF38 - ldr r1, =0x03005000 - movs r0, 0x4 - strh r0, [r1, 0x4] - ldr r0, =0x03004140 - ldrb r0, [r0] - ldr r2, =0x00000ce7 - adds r1, r2 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_800EF38 - - thumb_func_start sub_800EF58 -sub_800EF58: @ 800EF58 - push {lr} - adds r1, r0, 0 - ldr r2, =0x03005000 - ldrh r0, [r2, 0x4] - cmp r0, 0x11 - beq _0800EF68 - cmp r1, 0 - beq _0800EF74 -_0800EF68: - movs r0, 0x12 - strh r0, [r2, 0x4] - movs r0, 0x1 - b _0800EF76 - .pool -_0800EF74: - movs r0, 0 -_0800EF76: - pop {r1} - bx r1 - thumb_func_end sub_800EF58 - - thumb_func_start sub_800EF7C -sub_800EF7C: @ 800EF7C - ldr r1, =0x03005000 - movs r0, 0xE - strh r0, [r1, 0x4] - bx lr - .pool - thumb_func_end sub_800EF7C - - thumb_func_start sub_800EF88 -sub_800EF88: @ 800EF88 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - movs r2, 0 - b _0800EF9A -_0800EF92: - lsrs r1, 1 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 -_0800EF9A: - cmp r2, 0x3 - bhi _0800EFAC - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0800EF92 - adds r0, r2, 0 - bl rfu_UNI_readySendData -_0800EFAC: - pop {r0} - bx r0 - thumb_func_end sub_800EF88 - - thumb_func_start sub_800EFB0 -sub_800EFB0: @ 800EFB0 - push {r4-r7,lr} - sub sp, 0x4 - movs r2, 0 - ldr r7, =0x03003090 - ldr r0, =0x03005000 - adds r6, r7, 0 - ldr r1, =0x00000c87 - adds r5, r0, r1 -_0800EFC0: - movs r3, 0 - lsls r0, r2, 3 - lsls r1, r2, 4 - adds r4, r2, 0x1 - subs r0, r2 - lsls r0, 1 - adds r2, r0, r5 - adds r1, r6 -_0800EFD0: - ldrh r0, [r1] - lsrs r0, 8 - strb r0, [r2, 0x1] - ldrh r0, [r1] - strb r0, [r2] - adds r2, 0x2 - adds r1, 0x2 - adds r3, 0x1 - cmp r3, 0x6 - ble _0800EFD0 - adds r2, r4, 0 - cmp r2, 0x4 - ble _0800EFC0 - movs r0, 0 - mov r1, sp - strh r0, [r1] - ldr r2, =0x01000028 - mov r0, sp - adds r1, r7, 0 - bl CpuSet - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800EFB0 - - thumb_func_start sub_800F014 -sub_800F014: @ 800F014 - push {lr} - ldr r3, =0x03003110 - ldr r2, =0x03003090 - movs r1, 0x6 -_0800F01C: - ldrh r0, [r3] - strh r0, [r2] - adds r3, 0x2 - adds r2, 0x2 - subs r1, 0x1 - cmp r1, 0 - bge _0800F01C - ldr r1, =0x03003110 - movs r2, 0 - adds r0, r1, 0 - adds r0, 0xC -_0800F032: - strh r2, [r0] - subs r0, 0x2 - cmp r0, r1 - bge _0800F032 - pop {r0} - bx r0 - .pool - thumb_func_end sub_800F014 - - thumb_func_start sub_800F048 -sub_800F048: @ 800F048 - push {r4,r5,lr} - ldr r4, =0x03005000 - ldr r0, =0x00000c3c - adds r5, r4, r0 - ldrb r0, [r5] - cmp r0, 0 - beq _0800F07A - ldr r1, =0x00000c1c - adds r0, r4, r1 - adds r1, r4, 0 - adds r1, 0x4C - bl sub_800DAC8 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =0x00000c3a - adds r0, r4, r1 - ldrb r0, [r0] - adds r1, r0, 0 - cmp r1, 0 - bne _0800F076 - ldrb r0, [r5] - strb r1, [r5] -_0800F076: - cmp r2, 0 - bne _0800F09E -_0800F07A: - ldr r5, =0x03005000 - ldr r1, =0x00000c3c - adds r0, r5, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _0800F09E - ldr r1, =0x000009e8 - adds r0, r5, r1 - adds r4, r5, 0 - adds r4, 0x4C - adds r1, r4, 0 - bl sub_800D9DC - ldr r1, =0x00000c1c - adds r0, r5, r1 - adds r1, r4, 0 - bl sub_800DA68 -_0800F09E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800F048 - - thumb_func_start sub_800F0B8 -sub_800F0B8: @ 800F0B8 - push {r4,lr} - ldr r0, =0x03007890 - ldr r0, [r0] - ldrb r0, [r0, 0x6] - cmp r0, 0 - bne _0800F0CC -_0800F0C4: - movs r0, 0 - b _0800F0EC - .pool -_0800F0CC: - movs r3, 0 - ldr r4, =0x03003090 -_0800F0D0: - movs r2, 0 - lsls r0, r3, 4 - adds r1, r0, r4 -_0800F0D6: - ldrh r0, [r1] - cmp r0, 0 - bne _0800F0C4 - adds r1, 0x2 - adds r2, 0x1 - cmp r2, 0x6 - ble _0800F0D6 - adds r3, 0x1 - cmp r3, 0x4 - ble _0800F0D0 - movs r0, 0x1 -_0800F0EC: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_800F0B8 - - thumb_func_start sub_800F0F8 -sub_800F0F8: @ 800F0F8 - push {r4-r6,lr} - ldr r6, =0x03005000 - ldrh r0, [r6, 0x4] - cmp r0, 0x13 - bhi _0800F118 - bl rfu_REQ_recvData - bl rfu_waitREQComplete - movs r0, 0 - bl rfu_REQ_sendData_wrapper - b _0800F1D2 - .pool -_0800F118: - ldr r0, =0x00000cdb - adds r1, r6, r0 - ldrb r0, [r1] - movs r0, 0 - strb r0, [r1] - ldr r0, =0x00000ce2 - adds r1, r6, r0 - ldr r0, =0x03007890 - ldr r0, [r0] - ldrb r1, [r1] - ldrb r0, [r0, 0x2] - ands r0, r1 - cmp r0, r1 - bne _0800F1D2 - cmp r0, 0 - beq _0800F1D2 - ldr r1, =0x00000cdc - adds r0, r6, r1 - ldrb r0, [r0] - adds r5, r0, 0 - cmp r5, 0 - bne _0800F1C8 - ldr r0, =0x00000ce3 - adds r4, r6, r0 - ldrb r0, [r4] - cmp r0, 0 - beq _0800F1A8 - bl sub_8011D6C - strb r5, [r4] - ldr r1, =0x00000ce4 - adds r0, r6, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _0800F18C - movs r4, 0x80 - lsls r4, 8 - movs r0, 0x2 - adds r1, r4, 0 - bl sub_8011A64 - adds r0, r4, 0 - bl sub_8011170 - b _0800F1D2 - .pool -_0800F18C: - ldr r0, =0x03004140 - ldrb r4, [r0] - cmp r4, 0 - bne _0800F1A8 - bl sub_800EDD4 - ldr r0, =0x03003124 - strb r4, [r0] - b _0800F1D2 - .pool -_0800F1A8: - bl sub_800EFB0 - ldr r0, =0x03005000 - ldr r1, =0x00000cda - adds r0, r1 - ldrb r0, [r0] - bl rfu_UNI_readySendData - movs r0, 0x1 - bl rfu_REQ_sendData_wrapper - b _0800F1CC - .pool -_0800F1C8: - bl rfu_REQ_PARENT_resumeRetransmitAndChange -_0800F1CC: - ldr r1, =0x03005000 - movs r0, 0x1 - strb r0, [r1, 0xE] -_0800F1D2: - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_800F0F8 - - thumb_func_start sub_800F1E0 -sub_800F1E0: @ 800F1E0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - ldr r0, =0x03005000 - ldrh r1, [r0, 0x4] - adds r6, r0, 0 - cmp r1, 0x13 - bhi _0800F1F8 - b _0800F45A -_0800F1F8: - ldrb r0, [r6, 0xE] - cmp r0, 0x1 - beq _0800F200 - b _0800F45A -_0800F200: - bl rfu_waitREQComplete - ldr r0, =0x00000cdb - adds r2, r6, r0 - ldrb r0, [r2] - cmp r0, 0 - bne _0800F220 - adds r1, r6, 0 - adds r1, 0xEE -_0800F212: - ldrb r0, [r1] - cmp r0, 0 - beq _0800F21A - b _0800F480 -_0800F21A: - ldrb r0, [r2] - cmp r0, 0 - beq _0800F212 -_0800F220: - bl rfu_REQ_recvData - bl rfu_waitREQComplete - ldr r2, =0x03004140 - ldr r4, =0x03005000 - ldr r1, =0x00000ce2 - adds r0, r4, r1 - ldrb r1, [r2, 0x3] - ldrb r0, [r0] - ands r1, r0 - cmp r1, r0 - beq _0800F23C - b _0800F444 -_0800F23C: - ldr r6, =0x00000cdc - adds r1, r4, r6 - ldrb r0, [r1] - movs r0, 0 - strb r0, [r1] - ldr r1, =0x02022b44 - ldrh r0, [r1, 0x6] - adds r0, 0x1 - strh r0, [r1, 0x6] - ldrb r7, [r2] - movs r5, 0 -_0800F252: - movs r0, 0x1 - ands r0, r7 - lsrs r1, r7, 1 - str r1, [sp, 0x4] - adds r2, r5, 0x1 - str r2, [sp] - cmp r0, 0 - bne _0800F264 - b _0800F364 -_0800F264: - ldr r1, =0x03005000 - lsls r2, r5, 3 - subs r0, r2, r5 - lsls r4, r0, 1 - adds r0, r1, 0 - adds r0, 0x15 - adds r0, r4, r0 - ldrb r0, [r0] - adds r6, r1, 0 - adds r3, r2, 0 - lsls r1, r5, 24 - mov r10, r1 - cmp r0, 0 - beq _0800F35C - ldr r2, =0x00000cee - adds r0, r6, r2 - adds r1, r5, r0 - ldrb r0, [r1] - cmp r0, 0xFF - beq _0800F2E0 - adds r0, r6, 0 - adds r0, 0x14 - adds r0, r4, r0 - ldrb r2, [r0] - lsrs r2, 5 - ldrb r0, [r1] - adds r0, 0x1 - movs r1, 0x7 - ands r0, r1 - cmp r2, r0 - beq _0800F2E0 - ldr r0, =0x00000cea - adds r1, r6, r0 - adds r1, r5, r1 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bls _0800F35C - movs r0, 0x81 - lsls r0, 8 - bl sub_8011170 - b _0800F35C - .pool -_0800F2E0: - ldr r2, =0x03005000 - ldr r6, =0x00000cee - adds r1, r2, r6 - adds r1, r5, r1 - subs r3, r5 - lsls r3, 1 - adds r4, r2, 0 - adds r4, 0x14 - adds r2, r3, r4 - ldrb r0, [r2] - lsrs r0, 5 - strb r0, [r1] - ldr r1, =0x03005000 - subs r6, 0x4 - adds r0, r1, r6 - adds r0, r5, r0 - movs r1, 0 - strb r1, [r0] - ldrb r1, [r2] - movs r0, 0x1F - ands r0, r1 - strb r0, [r2] - ldr r2, =0x03005cde - adds r0, r5, r2 - ldrb r0, [r0] - movs r6, 0 - lsls r1, r5, 24 - mov r10, r1 - lsrs r2, r7, 1 - str r2, [sp, 0x4] - adds r5, 0x1 - str r5, [sp] - ldr r1, =0x03003090 - mov r9, r1 - adds r5, r3, 0 - adds r7, r4, 0 - lsls r0, 4 - mov r8, r0 - adds r2, r5, 0x1 - mov r12, r2 -_0800F330: - lsls r1, r6, 1 - mov r0, r8 - adds r4, r1, r0 - add r4, r9 - mov r2, r12 - adds r3, r1, r2 - adds r3, r7 - ldrb r2, [r3] - lsls r2, 8 - adds r1, r5 - adds r1, r7 - ldrb r0, [r1] - orrs r0, r2 - strh r0, [r4] - movs r0, 0 - strb r0, [r3] - strb r0, [r1] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x6 - bls _0800F330 -_0800F35C: - mov r1, r10 - lsrs r0, r1, 24 - bl rfu_UNI_clearRecvNewDataFlag -_0800F364: - ldr r2, [sp, 0x4] - lsls r0, r2, 16 - lsrs r7, r0, 16 - ldr r6, [sp] - lsls r0, r6, 16 - lsrs r5, r0, 16 - cmp r5, 0x3 - bhi _0800F376 - b _0800F252 -_0800F376: - bl sub_800F014 - movs r0, 0 - bl sub_800F86C - bl sub_8010528 - ldr r4, =0x03005000 - ldr r1, =0x00000ce5 - adds r0, r4, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _0800F452 - ldr r2, =0x00000cd9 - adds r0, r4, r2 - ldrb r2, [r0] - cmp r2, 0 - bne _0800F452 - ldr r0, =0x02022b44 - ldrb r1, [r0, 0xE] - strb r2, [r0, 0xE] - ldr r6, =0x00000cda - adds r0, r4, r6 - ldrb r1, [r0] - movs r0, 0x3 - bl rfu_clearSlot - movs r5, 0 - adds r7, r4, 0 - adds r7, 0x14 -_0800F3B2: - ldr r0, =0x00000ce5 - adds r6, r4, r0 - ldrb r0, [r6] - asrs r0, r5 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0800F3D6 - lsls r1, r5, 24 - lsrs r1, 24 - lsls r2, r5, 3 - subs r2, r5 - lsls r2, 1 - adds r2, r7 - movs r0, 0x10 - movs r3, 0xE - bl rfu_setRecvBuffer -_0800F3D6: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x3 - bls _0800F3B2 - subs r4, r6, 0x3 - ldrb r0, [r4] - ldrb r2, [r6] - adds r1, r0, 0 - orrs r1, r2 - bl sub_800E88C - ldrb r1, [r6] - movs r2, 0 - strb r1, [r6, 0x4] - ldrb r0, [r4] - orrs r0, r1 - strb r0, [r4] - strb r2, [r6] - ldrb r0, [r4] - adds r1, r6, 0 - subs r1, 0x5E - movs r2, 0x46 - bl rfu_UNI_setSendData - ldrb r0, [r4] - bl sub_800E87C - adds r1, r6, 0 - subs r1, 0xB - strb r0, [r1] - ldr r0, =sub_8010AAC - movs r1, 0 - bl AddTask - b _0800F452 - .pool -_0800F444: - ldr r2, =0x00000cdc - adds r1, r4, r2 - ldrb r0, [r1] - movs r2, 0 - movs r0, 0x1 - strb r0, [r1] - strb r2, [r4, 0xE] -_0800F452: - ldr r1, =0x03005000 - movs r0, 0 - strb r0, [r1, 0xE] - adds r6, r1, 0 -_0800F45A: - ldr r1, =0x00000cdc - adds r0, r6, r1 - ldrb r0, [r0] - adds r1, r0, 0 - ldr r0, =0x03007890 - ldr r0, [r0] - ldrb r0, [r0, 0x6] - cmp r0, 0 - beq _0800F484 - movs r0, 0x1 - ands r0, r1 - b _0800F486 - .pool -_0800F480: - movs r0, 0 - b _0800F486 -_0800F484: - movs r0, 0 -_0800F486: - 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_800F1E0 - - thumb_func_start sub_800F498 -sub_800F498: @ 800F498 - push {r4,r5,lr} - adds r4, r0, 0 - adds r2, r1, 0 - ldrh r1, [r4] - cmp r1, 0 - beq _0800F4DC - ldr r0, =0x03005000 - movs r5, 0x81 - lsls r5, 1 - adds r3, r0, r5 - ldrb r0, [r3] - lsls r0, 5 - orrs r0, r1 - strh r0, [r4] - ldrb r0, [r3] - adds r0, 0x1 - movs r1, 0x7 - ands r0, r1 - strb r0, [r3] - adds r3, r4, 0 - movs r4, 0x6 -_0800F4C2: - ldrh r1, [r3] - lsrs r0, r1, 8 - strb r0, [r2, 0x1] - strb r1, [r2] - adds r2, 0x2 - adds r3, 0x2 - subs r4, 0x1 - cmp r4, 0 - bge _0800F4C2 - b _0800F4EA - .pool -_0800F4DC: - movs r1, 0 - adds r0, r2, 0 - adds r0, 0xD -_0800F4E2: - strb r1, [r0] - subs r0, 0x1 - cmp r0, r2 - bge _0800F4E2 -_0800F4EA: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_800F498 - - thumb_func_start sub_800F4F0 -sub_800F4F0: @ 800F4F0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x58 - ldr r0, =0x03005124 - mov r1, sp - bl sub_800D934 - movs r1, 0 - ldr r0, =0x03003090 - mov r12, r0 -_0800F506: - movs r4, 0 - lsls r0, r1, 3 - adds r2, r1, 0x1 - mov r8, r2 - lsls r6, r1, 4 - subs r0, r1 - lsls r5, r0, 1 -_0800F514: - lsls r1, r4, 1 - adds r3, r1, r6 - add r3, r12 - adds r1, r5, r1 - adds r0, r1, 0x1 - add r0, sp - ldrb r2, [r0] - lsls r2, 8 - mov r7, sp - adds r0, r7, r1 - ldrb r0, [r0] - orrs r0, r2 - strh r0, [r3] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x6 - bls _0800F514 - mov r1, r8 - lsls r0, r1, 24 - lsrs r1, r0, 24 - cmp r1, 0x4 - bls _0800F506 - movs r0, 0 - bl sub_800F86C - ldr r0, =0x03004140 - ldrb r0, [r0, 0x2] - cmp r0, 0 - bne _0800F5C0 - ldr r0, =0x03005000 - ldr r2, =0x00000ce4 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _0800F5C0 - ldr r0, =0x03007890 - ldr r0, [r0] - ldrb r1, [r0, 0x2] - ldrb r0, [r0, 0x3] - orrs r0, r1 - bl rfu_REQ_disconnect - bl rfu_waitREQComplete - bl sub_8011A74 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0800F58C - cmp r0, 0x6 - beq _0800F58C - cmp r0, 0x9 - beq _0800F58C - movs r1, 0x90 - lsls r1, 8 - movs r0, 0x2 - bl sub_8011A64 -_0800F58C: - bl rfu_clearAllSlot - ldr r1, =0x03003124 - movs r0, 0 - strb r0, [r1] - ldr r0, =0x03005000 - movs r5, 0 - str r5, [r0] - ldr r7, =0x00000ce4 - adds r6, r0, r7 - ldrb r0, [r6] - cmp r0, 0x1 - bne _0800F5B8 - movs r4, 0x90 - lsls r4, 8 - movs r0, 0x2 - adds r1, r4, 0 - bl sub_8011A64 - adds r0, r4, 0 - bl sub_8011170 -_0800F5B8: - ldr r0, =0x03004140 - strb r5, [r0, 0x5] - strb r5, [r0, 0x4] - strb r5, [r6] -_0800F5C0: - ldr r6, =0x03005000 - movs r0, 0xCD - lsls r0, 4 - adds r2, r6, r0 - ldrb r0, [r2] - cmp r0, 0 - beq _0800F604 - ldrb r0, [r2] - subs r0, 0x1 - ldrb r1, [r2] - strb r0, [r2] - bl sub_8010528 - ldr r5, =0x03003110 - add r4, sp, 0x48 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_800F498 - ldr r1, =0x000009e8 - adds r0, r6, r1 - adds r1, r4, 0 - bl sub_800D888 - movs r1, 0 - movs r2, 0 -_0800F5F4: - lsls r0, r1, 1 - adds r0, r5 - strh r2, [r0] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x6 - bls _0800F5F4 -_0800F604: - bl sub_800F0B8 - add sp, 0x58 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_800F4F0 - - thumb_func_start sub_800F638 -sub_800F638: @ 800F638 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =0x03005000 - ldr r2, [r0, 0x70] - mov r10, r2 - movs r5, 0 - adds r2, r0, 0 - adds r2, 0x6E - ldrh r3, [r2] - cmp r5, r3 - bge _0800F6D4 - mov r9, r0 - ldr r0, =0x03000d90 - mov r8, r0 -_0800F65A: - movs r0, 0x1 - ands r0, r1 - lsrs r7, r1, 1 - adds r6, r5, 0x1 - cmp r0, 0 - bne _0800F6C8 - ldr r1, =0xffff8900 - adds r0, r1, 0 - adds r1, r5, 0 - orrs r1, r0 - mov r2, r8 - strh r1, [r2] - movs r4, 0 - lsls r0, r5, 1 - ldr r3, =0x03000d80 - mov r12, r3 - adds r0, r5 - lsls r0, 2 - mov r1, r10 - adds r2, r0, r1 - mov r3, r8 - adds r3, 0x2 -_0800F686: - ldrb r1, [r2, 0x1] - lsls r1, 8 - ldrb r0, [r2] - orrs r0, r1 - strh r0, [r3] - adds r2, 0x2 - adds r3, 0x2 - adds r4, 0x1 - cmp r4, 0x6 - ble _0800F686 - movs r4, 0 - ldr r2, =0x03000d90 - ldr r1, =0x03000d80 -_0800F6A0: - ldrh r0, [r2] - lsrs r0, 8 - strb r0, [r1, 0x1] - ldrh r0, [r2] - strb r0, [r1] - adds r2, 0x2 - adds r1, 0x2 - adds r4, 0x1 - cmp r4, 0x6 - ble _0800F6A0 - ldr r0, =0x030059e8 - mov r1, r12 - bl sub_800D888 - movs r1, 0x1 - lsls r1, r5 - mov r2, r9 - ldr r0, [r2, 0x78] - orrs r0, r1 - str r0, [r2, 0x78] -_0800F6C8: - adds r1, r7, 0 - adds r5, r6, 0 - ldr r3, =0x0300506e - ldrh r3, [r3] - cmp r5, r3 - blt _0800F65A -_0800F6D4: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800F638 - - thumb_func_start sub_800F6FC -sub_800F6FC: @ 800F6FC - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - ldr r0, =0x03005000 - ldrb r2, [r0, 0xC] - cmp r2, 0x1 - bne _0800F71C - cmp r1, 0 - beq _0800F71C - adds r0, 0x61 - adds r0, r1, r0 - strb r2, [r0] - b _0800F724 - .pool -_0800F71C: - adds r0, 0x5C - adds r0, r1, r0 - movs r1, 0x1 - strb r1, [r0] -_0800F724: - pop {r0} - bx r0 - thumb_func_end sub_800F6FC - - thumb_func_start sub_800F728 -sub_800F728: @ 800F728 - lsls r0, 24 - lsrs r0, 24 - ldr r3, =0x03005000 - adds r1, r3, 0 - adds r1, 0x5C - adds r1, r0, r1 - movs r2, 0 - strb r2, [r1] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - adds r1, 0x92 - strb r2, [r1] - bx lr - .pool - thumb_func_end sub_800F728 - - thumb_func_start sub_800F74C -sub_800F74C: @ 800F74C - push {r4,r5,lr} - adds r3, r0, 0 - ldr r0, =0x03005000 - ldrb r1, [r0, 0xC] - adds r5, r0, 0 - cmp r1, 0x1 - bne _0800F764 - movs r0, 0 - b _0800F786 - .pool -_0800F764: - movs r2, 0 - ldr r0, =0x00000cde - adds r4, r5, r0 -_0800F76A: - adds r1, r2, r4 - adds r0, r3, r2 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x3 - bls _0800F76A - ldr r1, =0x00000c3e - adds r0, r5, r1 - ldrb r0, [r0] - adds r0, r3 - ldrb r0, [r0] -_0800F786: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_800F74C - - thumb_func_start rfu_func_080F97B8 -rfu_func_080F97B8: @ 800F794 - push {lr} - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _0800F7C6 - ldr r3, =0x03005da8 - ldrh r2, [r3] - cmp r2, 0 - beq _0800F7C6 - ldr r0, =0x030022b4 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0800F7C6 - ldr r1, =0x03000d78 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldrb r0, [r1] - lsls r0, 8 - orrs r0, r2 - strh r0, [r3] - movs r0, 0xBE - lsls r0, 8 - bl sub_800FD14 -_0800F7C6: - pop {r0} - bx r0 - .pool - thumb_func_end rfu_func_080F97B8 - - thumb_func_start sub_800F7DC -sub_800F7DC: @ 800F7DC - ldr r0, =0x02022b14 - bx lr - .pool - thumb_func_end sub_800F7DC - - thumb_func_start sub_800F7E4 -sub_800F7E4: @ 800F7E4 - push {lr} - movs r2, 0 - ldr r0, =0x03005000 - ldr r1, [r0] - ldr r0, =rfu_func_080F97B8 - cmp r1, r0 - bne _0800F7F4 - movs r2, 0x1 -_0800F7F4: - adds r0, r2, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_800F7E4 - - thumb_func_start sub_800F804 -sub_800F804: @ 800F804 - ldr r1, =0x03005000 - ldr r0, =rfu_func_080F97B8 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_800F804 - - thumb_func_start Rfu_set_zero -Rfu_set_zero: @ 800F814 - ldr r1, =0x03005000 - movs r0, 0 - str r0, [r1] - bx lr - .pool - thumb_func_end Rfu_set_zero - - thumb_func_start sub_800F820 -sub_800F820: @ 800F820 - push {lr} - movs r0, 0x88 - lsls r0, 7 - bl sub_800FD14 - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - bne _0800F83C - bl sub_8082D18 - ldr r1, =0x03003110 - strh r0, [r1, 0xC] -_0800F83C: - ldr r1, =0x020223c0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_800F820 - - thumb_func_start sub_800F850 -sub_800F850: @ 800F850 - push {lr} - ldr r1, =0x03005000 - ldr r0, [r1] - cmp r0, 0 - bne _0800F85E - ldr r0, =sub_800F820 - str r0, [r1] -_0800F85E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_800F850 - - thumb_func_start sub_800F86C -sub_800F86C: @ 800F86C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r0, 0 - mov r8, r0 -_0800F87A: - mov r1, r8 - lsls r0, r1, 4 - ldr r2, =0x03003090 - adds r1, r0, r2 - ldrh r7, [r1] - movs r3, 0xFF - lsls r3, 8 - adds r1, r3, 0 - ands r1, r7 - movs r2, 0x88 - lsls r2, 8 - adds r5, r0, 0 - cmp r1, r2 - beq _0800F960 - cmp r1, r2 - bgt _0800F8D6 - movs r0, 0xCC - lsls r0, 7 - cmp r1, r0 - bne _0800F8A4 - b _0800FAE0 -_0800F8A4: - cmp r1, r0 - bgt _0800F8C4 - movs r0, 0x88 - lsls r0, 7 - cmp r1, r0 - bne _0800F8B2 - b _0800FBF4 -_0800F8B2: - movs r0, 0xBE - lsls r0, 7 - cmp r1, r0 - bne _0800F8BC - b _0800FAD0 -_0800F8BC: - b _0800FC04 - .pool -_0800F8C4: - movs r0, 0xEE - lsls r0, 7 - cmp r1, r0 - beq _0800F920 - movs r0, 0xF0 - lsls r0, 7 - cmp r1, r0 - beq _0800F90E - b _0800FC04 -_0800F8D6: - movs r0, 0xBE - lsls r0, 8 - cmp r1, r0 - bne _0800F8E0 - b _0800FBF4 -_0800F8E0: - cmp r1, r0 - bgt _0800F8F8 - movs r0, 0x89 - lsls r0, 8 - cmp r1, r0 - beq _0800F9C8 - movs r0, 0xA1 - lsls r0, 8 - cmp r1, r0 - bne _0800F8F6 - b _0800FAAC -_0800F8F6: - b _0800FC04 -_0800F8F8: - movs r0, 0xED - lsls r0, 8 - cmp r1, r0 - bne _0800F902 - b _0800FB10 -_0800F902: - movs r0, 0xEE - lsls r0, 8 - cmp r1, r0 - bne _0800F90C - b _0800FBB0 -_0800F90C: - b _0800FC04 -_0800F90E: - ldr r4, =0x03005000 - ldrb r0, [r4, 0xC] - cmp r0, 0 - bne _0800F920 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _0800F920 - b _0800FC50 -_0800F920: - ldr r0, =0x03007890 - ldr r0, [r0] - ldrb r0, [r0] - mov r6, r8 - adds r6, 0x1 - cmp r0, 0 - beq _0800F930 - b _0800FC08 -_0800F930: - ldr r1, =0x03003092 - adds r0, r5, r1 - ldrh r0, [r0] - ldr r2, =0x03005000 - strb r0, [r2, 0xD] - ldr r3, =0x03003094 - adds r0, r5, r3 - bl sub_800F74C - ldr r4, =0x03005cce - strb r0, [r4] - b _0800FC08 - .pool -_0800F960: - ldr r0, =0x03005000 - mov r9, r0 - mov r1, r8 - lsls r0, r1, 2 - add r0, r8 - lsls r7, r0, 2 - mov r2, r9 - adds r3, r7, r2 - movs r4, 0x92 - adds r4, r3 - mov r12, r4 - ldrb r4, [r4] - mov r6, r8 - adds r6, 0x1 - cmp r4, 0 - beq _0800F982 - b _0800FC08 -_0800F982: - adds r0, r3, 0 - adds r0, 0x80 - movs r2, 0 - strh r4, [r0] - ldr r1, =0x03003092 - adds r0, r5, r1 - ldrh r0, [r0] - adds r1, r3, 0 - adds r1, 0x82 - strh r0, [r1] - ldr r1, =0x03003094 - adds r0, r5, r1 - ldrh r1, [r0] - adds r0, r3, 0 - adds r0, 0x91 - strb r1, [r0] - mov r0, r9 - adds r0, 0x88 - adds r0, r7, r0 - str r4, [r0] - movs r0, 0x1 - mov r3, r12 - strb r0, [r3] - mov r0, r9 - adds r0, 0x5C - add r0, r8 - strb r2, [r0] - b _0800FC08 - .pool -_0800F9C8: - ldr r4, =0x03005000 - mov r9, r4 - mov r0, r8 - lsls r1, r0, 2 - adds r0, r1, r0 - lsls r4, r0, 2 - mov r3, r9 - adds r2, r4, r3 - adds r0, r2, 0 - adds r0, 0x92 - ldrb r3, [r0] - mov r10, r1 - mov r6, r8 - adds r6, 0x1 - cmp r3, 0x1 - beq _0800F9EA - b _0800FC08 -_0800F9EA: - movs r0, 0xFF - ands r0, r7 - adds r2, 0x80 - strh r0, [r2] - mov r1, r9 - adds r1, 0x88 - adds r1, r4, r1 - lsls r3, r0 - ldr r0, [r1] - orrs r0, r3 - str r0, [r1] - movs r4, 0 - ldr r0, =0x020223c4 - mov r9, r0 - mov r12, r2 - mov r1, r8 - lsls r7, r1, 8 - adds r3, r5, 0 -_0800FA0E: - mov r2, r12 - ldrh r0, [r2] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 1 - adds r1, r4 - lsls r1, 1 - adds r1, r7 - add r1, r9 - adds r2, r4, 0x1 - lsls r0, r2, 1 - adds r0, r3 - ldr r4, =0x03003090 - adds r0, r4 - ldrh r0, [r0] - strh r0, [r1] - lsls r2, 16 - lsrs r4, r2, 16 - cmp r4, 0x5 - bls _0800FA0E - ldr r4, =0x03005000 - mov r0, r10 - add r0, r8 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x88 - adds r1, r0, r1 - adds r2, r0, r4 - adds r0, r2, 0 - adds r0, 0x82 - ldrh r0, [r0] - lsls r0, 2 - ldr r3, =gUnknown_082ED628 - adds r0, r3 - ldr r1, [r1] - ldr r0, [r0] - cmp r1, r0 - beq _0800FA5C - b _0800FC08 -_0800FA5C: - adds r1, r2, 0 - adds r1, 0x92 - movs r0, 0x2 - strb r0, [r1] - mov r1, r8 - lsls r0, r1, 24 - lsrs r0, 24 - bl sub_800F6FC - bl sub_800F7DC - ldrb r1, [r0, 0xA] - movs r0, 0x7F - ands r0, r1 - cmp r0, 0x45 - beq _0800FA7E - b _0800FC08 -_0800FA7E: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _0800FA88 - b _0800FC08 -_0800FA88: - ldrb r0, [r4, 0xC] - cmp r0, 0 - beq _0800FA90 - b _0800FC08 -_0800FA90: - ldr r0, =0x020223c4 - bl sub_8010A70 - b _0800FC08 - .pool -_0800FAAC: - ldr r2, =gUnknown_082ED6B8 - ldr r3, =0x03003092 - adds r0, r5, r3 - ldrh r1, [r0] - lsls r1, 3 - adds r0, r1, r2 - ldr r0, [r0] - adds r2, 0x4 - adds r1, r2 - ldrh r1, [r1] - bl sub_800FE84 - b _0800FC04 - .pool -_0800FAD0: - ldr r1, =0x030050e4 - add r1, r8 - movs r0, 0x1 - strb r0, [r1] - b _0800FC04 - .pool -_0800FAE0: - ldr r2, =0x03005000 - movs r4, 0x80 - lsls r4, 1 - adds r0, r2, r4 - ldr r3, =0x03003092 - adds r1, r5, r3 - ldrh r0, [r0] - mov r6, r8 - adds r6, 0x1 - ldrh r1, [r1] - cmp r0, r1 - beq _0800FAFA - b _0800FC08 -_0800FAFA: - adds r0, r2, 0 - adds r0, 0xE9 - add r0, r8 - movs r1, 0x1 - strb r1, [r0] - b _0800FC08 - .pool -_0800FB10: - ldr r7, =0x03005000 - ldrb r2, [r7, 0xC] - cmp r2, 0 - bne _0800FB78 - ldr r3, =0x03003124 - ldrb r0, [r3] - mov r6, r8 - adds r6, 0x1 - cmp r0, 0 - beq _0800FC08 - ldr r0, =0x03003092 - adds r4, r5, r0 - ldrh r1, [r4] - ldr r0, =0x03007890 - ldr r0, [r0] - ldrb r0, [r0, 0x2] - ands r1, r0 - cmp r1, 0 - beq _0800FB48 - strb r2, [r3] - bl sub_800D630 - ldr r1, =0x03003094 - adds r0, r5, r1 - ldrh r1, [r0] - ldr r2, =0x00000ce4 - adds r0, r7, r2 - strb r1, [r0] -_0800FB48: - ldr r0, =0x03003090 - adds r0, 0x6 - adds r0, r5, r0 - ldrh r0, [r0] - strb r0, [r7, 0xD] - ldrh r0, [r4] - bl sub_80109E8 - b _0800FC08 - .pool -_0800FB78: - movs r0, 0xEE - lsls r0, 8 - bl sub_800FD14 - ldr r1, =0x03003110 - ldr r3, =0x03003092 - adds r0, r5, r3 - ldrh r0, [r0] - strh r0, [r1, 0x2] - ldr r4, =0x03003094 - adds r0, r5, r4 - ldrh r0, [r0] - strh r0, [r1, 0x4] - ldr r0, =0x03003090 - adds r0, 0x6 - adds r0, r5, r0 - ldrh r0, [r0] - strh r0, [r1, 0x6] - b _0800FC04 - .pool -_0800FBB0: - ldr r4, =0x03005000 - ldrb r0, [r4, 0xC] - mov r6, r8 - adds r6, 0x1 - cmp r0, 0x1 - bne _0800FC44 - ldr r0, =0x00000ce3 - adds r2, r4, r0 - ldr r1, =0x03003092 - adds r3, r5, r1 - ldrb r1, [r3] - ldrb r0, [r2] - orrs r0, r1 - strb r0, [r2] - ldr r2, =0x03003094 - adds r0, r5, r2 - ldrh r1, [r0] - ldr r2, =0x00000ce4 - adds r0, r4, r2 - strb r1, [r0] - ldrh r0, [r3] - bl sub_80109E8 - b _0800FC08 - .pool -_0800FBF4: - ldr r0, =0x03003020 - mov r3, r8 - lsls r1, r3, 1 - adds r1, r0 - ldr r4, =0x03003092 - adds r0, r5, r4 - ldrh r0, [r0] - strh r0, [r1] -_0800FC04: - mov r6, r8 - adds r6, 0x1 -_0800FC08: - ldr r3, =0x03005000 - ldrb r4, [r3, 0xC] - cmp r4, 0x1 - bne _0800FC44 - adds r0, r3, 0 - adds r0, 0x61 - mov r1, r8 - adds r2, r1, r0 - ldrb r0, [r2] - adds r1, r0, 0 - cmp r1, 0 - beq _0800FC44 - cmp r1, 0x4 - bne _0800FC40 - adds r0, r3, 0 - adds r0, 0x5C - add r0, r8 - movs r1, 0 - strb r4, [r0] - strb r1, [r2] - b _0800FC44 - .pool -_0800FC40: - adds r0, 0x1 - strb r0, [r2] -_0800FC44: - lsls r0, r6, 16 - lsrs r0, 16 - mov r8, r0 - cmp r0, 0x4 - bhi _0800FC50 - b _0800F87A -_0800FC50: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_800F86C - - thumb_func_start sub_800FC60 -sub_800FC60: @ 800FC60 - push {lr} - movs r2, 0 - ldr r0, =0x03005000 - adds r1, r0, 0 - adds r1, 0x92 -_0800FC6A: - ldrb r0, [r1] - cmp r0, 0 - beq _0800FC78 - movs r0, 0 - b _0800FC82 - .pool -_0800FC78: - adds r1, 0x14 - adds r2, 0x1 - cmp r2, 0x4 - ble _0800FC6A - movs r0, 0x1 -_0800FC82: - pop {r1} - bx r1 - thumb_func_end sub_800FC60 - - thumb_func_start sub_800FC88 -sub_800FC88: @ 800FC88 - push {r4,lr} - movs r1, 0 - ldr r2, =0x03005000 - ldrb r0, [r2, 0xD] - cmp r1, r0 - bge _0800FCBC - adds r4, r0, 0 - adds r3, r2, 0 - adds r3, 0x92 - adds r2, 0x5C -_0800FC9C: - ldrb r0, [r3] - cmp r0, 0x2 - bne _0800FCAA - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0800FCB4 -_0800FCAA: - movs r0, 0 - b _0800FCBE - .pool -_0800FCB4: - adds r3, 0x14 - adds r1, 0x1 - cmp r1, r4 - blt _0800FC9C -_0800FCBC: - movs r0, 0x1 -_0800FCBE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_800FC88 - - thumb_func_start sub_800FCC4 -sub_800FCC4: @ 800FCC4 - movs r2, 0 - movs r1, 0 - strh r1, [r0] - strh r1, [r0, 0x2] - str r1, [r0, 0x4] - str r1, [r0, 0x8] - strb r2, [r0, 0x10] - strb r2, [r0, 0x11] - strb r2, [r0, 0x12] - bx lr - thumb_func_end sub_800FCC4 - - thumb_func_start sub_800FCD8 -sub_800FCD8: @ 800FCD8 - push {r4,lr} - movs r2, 0 - movs r1, 0 - ldr r0, =0x03005000 - adds r3, r0, 0 - adds r3, 0x92 - adds r4, r0, 0 - adds r4, 0x5C -_0800FCE8: - ldrb r0, [r3] - cmp r0, 0x2 - bne _0800FCFE - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, 0x1 - bne _0800FCFE - lsls r0, r1 - orrs r2, r0 - lsls r0, r2, 24 - lsrs r2, r0, 24 -_0800FCFE: - adds r3, 0x14 - adds r1, 0x1 - cmp r1, 0x4 - ble _0800FCE8 - adds r0, r2, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_800FCD8 - - thumb_func_start sub_800FD14 -sub_800FD14: @ 800FD14 - push {r4,r5,lr} - lsls r0, 16 - lsrs r1, r0, 16 - ldr r5, =0x03003110 - strh r1, [r5] - movs r0, 0xF0 - lsls r0, 7 - adds r4, r5, 0 - cmp r1, r0 - beq _0800FDB0 - cmp r1, r0 - bgt _0800FD62 - movs r0, 0xBE - lsls r0, 7 - cmp r1, r0 - beq _0800FE00 - cmp r1, r0 - bgt _0800FD50 - movs r0, 0xBC - lsls r0, 6 - cmp r1, r0 - beq _0800FE20 - movs r0, 0x88 - lsls r0, 7 - cmp r1, r0 - beq _0800FE14 - b _0800FE46 - .pool -_0800FD50: - movs r0, 0xCC - lsls r0, 7 - cmp r1, r0 - beq _0800FE00 - movs r0, 0xEE - lsls r0, 7 - cmp r1, r0 - beq _0800FDB0 - b _0800FE46 -_0800FD62: - movs r0, 0xBE - lsls r0, 8 - cmp r1, r0 - beq _0800FE40 - cmp r1, r0 - bgt _0800FE46 - movs r0, 0x88 - lsls r0, 8 - cmp r1, r0 - beq _0800FD80 - movs r0, 0xA1 - lsls r0, 8 - cmp r1, r0 - beq _0800FD98 - b _0800FE46 -_0800FD80: - ldr r0, =0x03005000 - adds r1, r0, 0 - adds r1, 0x6E - ldrh r1, [r1] - strh r1, [r5, 0x2] - adds r0, 0x7D - ldrb r0, [r0] - adds r0, 0x80 - strh r0, [r5, 0x4] - b _0800FE46 - .pool -_0800FD98: - bl sub_800FC60 - lsls r0, 24 - cmp r0, 0 - beq _0800FE46 - ldr r0, =0x03005000 - adds r0, 0x5A - ldrb r0, [r0] - b _0800FE44 - .pool -_0800FDB0: - ldr r3, =0x03005000 - ldr r1, =0x00000ce2 - adds r0, r3, r1 - ldr r2, =0x00000ce3 - adds r1, r3, r2 - ldrb r2, [r0] - ldrb r0, [r1] - eors r0, r2 - ldr r1, =gUnknown_082ED695 - adds r0, r1 - ldrb r0, [r0] - adds r0, 0x1 - strb r0, [r3, 0xD] - ldrb r0, [r3, 0xD] - strh r0, [r4, 0x2] - adds r2, r4, 0x4 - movs r4, 0 - ldr r0, =0x00000cde - adds r3, r0 -_0800FDD6: - adds r1, r2, r4 - adds r0, r4, r3 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _0800FDD6 - b _0800FE46 - .pool -_0800FE00: - ldr r0, =0x03005000 - movs r1, 0x80 - lsls r1, 1 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r4, 0x2] - b _0800FE46 - .pool -_0800FE14: - strh r1, [r5] - ldr r0, =0x030022c0 - ldrh r0, [r0, 0x2C] - b _0800FE44 - .pool -_0800FE20: - movs r4, 0 - ldr r3, =0x030050f2 -_0800FE24: - adds r2, r4, 0x1 - lsls r1, r2, 1 - adds r1, r5 - lsls r0, r4, 1 - adds r0, r3 - ldrh r0, [r0] - strh r0, [r1] - lsls r2, 24 - lsrs r4, r2, 24 - cmp r4, 0x5 - bls _0800FE24 - b _0800FE46 - .pool -_0800FE40: - ldr r0, =0x03005da8 - ldrh r0, [r0] -_0800FE44: - strh r0, [r5, 0x2] -_0800FE46: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800FD14 - - thumb_func_start sub_800FE50 -sub_800FE50: @ 800FE50 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x03003110 - ldrh r0, [r0] - cmp r0, 0 - bne _0800FE76 - bl sub_8011A80 - cmp r0, 0 - bne _0800FE76 - ldr r0, =0x030050f2 - adds r1, r4, 0 - movs r2, 0xC - bl memcpy - movs r0, 0xBC - lsls r0, 6 - bl sub_800FD14 -_0800FE76: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800FE50 - - thumb_func_start sub_800FE84 -@ bool8 sub_800FE84(u32 a1, u32 size) -sub_800FE84: @ 800FE84 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r7, r0, 0 - adds r6, r1, 0 - ldr r5, =0x03005000 - ldr r0, [r5] - cmp r0, 0 - bne _0800FEB8 - ldr r0, =0x03003110 - ldrh r0, [r0] - cmp r0, 0 - bne _0800FEB8 - movs r0, 0x7C - adds r0, r5 - mov r9, r0 - ldrb r1, [r0] - mov r8, r1 - cmp r1, 0 - beq _0800FEC8 - ldr r1, =0x02022b44 - adds r1, 0x83 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_0800FEB8: - movs r0, 0 - b _0800FF32 - .pool -_0800FEC8: - adds r0, r6, 0 - movs r1, 0xC - bl __umodsi3 - negs r4, r0 - orrs r4, r0 - lsrs r4, 31 - bl link_get_multiplayer_id - adds r1, r5, 0 - adds r1, 0x7D - strb r0, [r1] - movs r0, 0x1 - mov r1, r9 - strb r0, [r1] - adds r0, r6, 0 - movs r1, 0xC - bl __udivsi3 - adds r0, r4 - adds r1, r5, 0 - adds r1, 0x6E - strh r0, [r1] - adds r0, r5, 0 - adds r0, 0x6C - mov r1, r8 - strh r1, [r0] - movs r0, 0x80 - lsls r0, 1 - cmp r6, r0 - bls _0800FF0A - str r7, [r5, 0x70] - b _0800FF1C -_0800FF0A: - ldr r4, =0x020228c4 - cmp r7, r4 - beq _0800FF1A - adds r0, r4, 0 - adds r1, r7, 0 - adds r2, r6, 0 - bl memcpy -_0800FF1A: - str r4, [r5, 0x70] -_0800FF1C: - movs r0, 0x88 - lsls r0, 8 - bl sub_800FD14 - ldr r0, =0x03005000 - ldr r1, =rfufunc_80F9F44 - str r1, [r0] - adds r0, 0x5B - movs r1, 0 - strb r1, [r0] - movs r0, 0x1 -_0800FF32: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_800FE84 - - thumb_func_start rfufunc_80F9F44 -rfufunc_80F9F44: @ 800FF4C - push {r4,r5,lr} - ldr r0, =0x03003110 - ldrh r0, [r0] - cmp r0, 0 - bne _0800FFA0 - movs r5, 0x88 - lsls r5, 8 - adds r0, r5, 0 - bl sub_800FD14 - ldr r4, =0x03005000 - ldrb r0, [r4, 0xC] - cmp r0, 0x1 - bne _0800FF84 - adds r1, r4, 0 - adds r1, 0x5B - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bls _0800FFA0 - b _0800FF9C - .pool -_0800FF84: - bl link_get_multiplayer_id - ldr r1, =0x03003090 - lsls r0, 24 - lsrs r0, 20 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0xFF - lsls r0, 8 - ands r0, r1 - cmp r0, r5 - bne _0800FFA0 -_0800FF9C: - ldr r0, =sub_800FFB0 - str r0, [r4] -_0800FFA0: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end rfufunc_80F9F44 - - thumb_func_start sub_800FFB0 -sub_800FFB0: @ 800FFB0 - push {r4-r6,lr} - ldr r0, =0x03005000 - mov r12, r0 - ldr r5, [r0, 0x70] - ldr r3, =0x03003110 - mov r2, r12 - adds r2, 0x6C - ldrh r1, [r2] - movs r4, 0x89 - lsls r4, 8 - adds r0, r4, 0 - orrs r0, r1 - strh r0, [r3] - movs r4, 0 - adds r6, r2, 0 - adds r3, 0x2 -_0800FFD0: - lsls r2, r4, 1 - ldrh r1, [r6] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, r5 - ldrb r1, [r0, 0x1] - lsls r1, 8 - ldrb r0, [r0] - orrs r0, r1 - strh r0, [r3] - adds r3, 0x2 - adds r4, 0x1 - cmp r4, 0x6 - ble _0800FFD0 - mov r0, r12 - adds r0, 0x6C - ldrh r1, [r0] - adds r1, 0x1 - strh r1, [r0] - adds r0, 0x2 - ldrh r0, [r0] - lsls r1, 16 - lsrs r1, 16 - cmp r0, r1 - bhi _08010014 - mov r0, r12 - adds r0, 0x7C - movs r1, 0 - strb r1, [r0] - ldr r0, =rfufunc_80FA020 - mov r1, r12 - str r0, [r1] -_08010014: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800FFB0 - - thumb_func_start rfufunc_80FA020 -rfufunc_80FA020: @ 8010028 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r5, =0x03005000 - ldr r0, [r5, 0x70] - mov r8, r0 - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r6, r0, 24 - ldrb r0, [r5, 0xC] - cmp r0, 0 - bne _080100F0 - ldr r3, =0x03003110 - adds r2, r5, 0 - adds r2, 0x6E - ldrh r0, [r2] - subs r0, 0x1 - ldr r4, =0xffff8900 - adds r1, r4, 0 - orrs r0, r1 - strh r0, [r3] - movs r4, 0 - mov r9, r5 - ldr r0, =0x03003090 - mov r12, r0 - lsls r5, r6, 4 - adds r7, r2, 0 - adds r3, 0x2 -_08010064: - lsls r2, r4, 1 - ldrh r1, [r7] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - add r0, r8 - adds r1, r0, 0 - subs r1, 0xB - ldrb r1, [r1] - lsls r1, 8 - subs r0, 0xC - ldrb r0, [r0] - orrs r0, r1 - strh r0, [r3] - adds r3, 0x2 - adds r4, 0x1 - cmp r4, 0x6 - ble _08010064 - mov r1, r12 - adds r0, r5, r1 - ldrb r1, [r0] - mov r3, r9 - adds r0, r3, 0 - adds r0, 0x6E - ldrh r0, [r0] - subs r0, 0x1 - cmp r1, r0 - bne _080100F4 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 2 - adds r1, r3, 0 - adds r1, 0x88 - adds r1, r0, r1 - ldr r2, =gUnknown_082ED628 - adds r0, r3 - adds r0, 0x82 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r2 - ldr r1, [r1] - ldr r0, [r0] - cmp r1, r0 - beq _080100E8 - adds r0, r6, 0 - bl sub_800F638 - ldr r1, =0x02022b44 - adds r1, 0x64 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _080100F4 - .pool -_080100E8: - movs r0, 0 - mov r4, r9 - str r0, [r4] - b _080100F4 -_080100F0: - movs r0, 0 - str r0, [r5] -_080100F4: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end rfufunc_80FA020 - - thumb_func_start sub_8010100 -sub_8010100: @ 8010100 - push {lr} - ldr r1, =0x03005000 - adds r1, 0x5A - strb r0, [r1] - movs r0, 0xA1 - lsls r0, 8 - bl sub_800FD14 - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8010100 - - thumb_func_start sub_801011C -sub_801011C: @ 801011C - push {lr} - bl rfu_clearAllSlot - bl sub_800C048 - ldr r1, =0x03003124 - movs r0, 0 - strb r0, [r1] - ldr r2, =0x03005000 - adds r3, r2, 0 - adds r3, 0xEF - movs r1, 0 - movs r0, 0x1 - strb r0, [r3] - str r1, [r2] - pop {r0} - bx r0 - .pool - thumb_func_end sub_801011C - - thumb_func_start sub_8010148 -sub_8010148: @ 8010148 - push {lr} - ldr r0, =0x03007890 - ldr r0, [r0] - ldrb r1, [r0, 0x2] - ldrb r0, [r0, 0x3] - orrs r0, r1 - bl rfu_REQ_disconnect - bl rfu_waitREQComplete - bl sub_801011C - pop {r0} - bx r0 - .pool - thumb_func_end sub_8010148 - - thumb_func_start sub_8010168 -sub_8010168: @ 8010168 - push {r4,lr} - ldr r4, =0x03005000 - ldrb r0, [r4, 0xC] - cmp r0, 0 - bne _08010188 - bl sub_800D630 - ldr r0, =0x00000ce4 - adds r1, r4, r0 - movs r0, 0x2 - strb r0, [r1] - b _0801018C - .pool -_08010188: - ldr r0, =sub_8010148 - str r0, [r4] -_0801018C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8010168 - - thumb_func_start sub_8010198 -sub_8010198: @ 8010198 - push {lr} - bl sub_800D630 - ldr r2, =0x03005000 - ldr r0, =0x00000ce4 - adds r1, r2, r0 - movs r0, 0x1 - strb r0, [r1] - ldr r0, =0x03007890 - ldr r1, [r0] - ldrb r0, [r1, 0x2] - ldrb r1, [r1, 0x3] - orrs r0, r1 - ldr r1, =0x00000ce3 - adds r2, r1 - strb r0, [r2] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8010198 - - thumb_func_start sub_80101CC -sub_80101CC: @ 80101CC - push {r4,r5,lr} - ldr r0, =0x03005000 - ldrb r5, [r0, 0xD] - movs r2, 0 - movs r1, 0 - adds r3, r0, 0 - adds r4, r3, 0 - adds r4, 0xE4 -_080101DC: - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, 0 - beq _080101E6 - adds r2, 0x1 -_080101E6: - adds r1, 0x1 - cmp r1, 0x4 - ble _080101DC - cmp r2, r5 - bne _08010220 - ldr r2, =0x02022fec - ldr r0, [r2] - movs r1, 0x21 - negs r1, r1 - ands r0, r1 - str r0, [r2] - ldrb r0, [r3, 0xC] - cmp r0, 0 - bne _0801021C - adds r0, r3, 0 - adds r0, 0xEE - ldrb r1, [r0] - movs r1, 0x3 - strb r1, [r0] - bl sub_8010168 - b _08010220 - .pool -_0801021C: - ldr r0, =sub_8010168 - str r0, [r3] -_08010220: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80101CC - - thumb_func_start sub_801022C -sub_801022C: @ 801022C - push {r4,lr} - ldr r0, =0x03003110 - ldrh r0, [r0] - cmp r0, 0 - bne _0801024E - ldr r4, =0x03005000 - ldr r1, =0x00000ce8 - adds r0, r4, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _0801024E - movs r0, 0xBE - lsls r0, 7 - bl sub_800FD14 - ldr r0, =sub_80101CC - str r0, [r4] -_0801024E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801022C - - thumb_func_start sub_8010264 -sub_8010264: @ 8010264 - push {lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =0x03005000 - ldr r0, [r2] - cmp r0, 0 - bne _08010284 - ldr r1, =0x00000cd9 - adds r0, r2, r1 - movs r1, 0x1 - strb r1, [r0] - ldr r0, =sub_801022C - str r0, [r2] - adds r0, r3, 0 - bl remove_task -_08010284: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8010264 - - thumb_func_start task_add_05_task_del_08FA224_when_no_RfuFunc -task_add_05_task_del_08FA224_when_no_RfuFunc: @ 8010294 - push {r4,lr} - ldr r4, =sub_8010264 - adds r0, r4, 0 - bl is_function_an_active_task - lsls r0, 24 - cmp r0, 0 - bne _080102AC - adds r0, r4, 0 - movs r1, 0x5 - bl AddTask -_080102AC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task_add_05_task_del_08FA224_when_no_RfuFunc - - thumb_func_start sub_80102B8 -sub_80102B8: @ 80102B8 - push {r4,r5,lr} - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - beq _080102E6 - ldr r1, =0x03005000 - ldr r2, =0x000009e6 - adds r0, r1, r2 - ldrb r0, [r0] - adds r4, r0, 0 - cmp r4, 0 - bne _080102E6 - adds r5, r1, 0 - adds r5, 0xFE - ldrh r0, [r5] - cmp r0, 0x3C - bls _080102E6 - movs r0, 0xCC - lsls r0, 7 - bl sub_800FD14 - strh r4, [r5] -_080102E6: - bl sub_8009FCC - lsls r0, 24 - lsrs r2, r0, 24 - movs r1, 0 - cmp r1, r2 - bcs _08010312 - ldr r0, =0x03005000 - adds r3, r0, 0 - adds r3, 0xE9 - ldrb r0, [r3] - cmp r0, 0 - beq _08010312 -_08010300: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, r2 - bcs _08010312 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, 0 - bne _08010300 -_08010312: - ldr r4, =0x03005000 - cmp r1, r2 - bne _0801033E - movs r1, 0 - adds r3, r4, 0 - adds r3, 0xE9 - movs r2, 0 -_08010320: - adds r0, r1, r3 - strb r2, [r0] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x4 - bls _08010320 - movs r1, 0x80 - lsls r1, 1 - adds r0, r4, r1 - ldrh r1, [r0] - adds r1, 0x1 - movs r2, 0 - strh r1, [r0] - str r2, [r4] -_0801033E: - adds r1, r4, 0 - adds r1, 0xFE - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80102B8 - - thumb_func_start sub_8010358 -sub_8010358: @ 8010358 - push {r4,lr} - ldr r4, =0x03005000 - ldr r1, =0x000009e6 - adds r0, r4, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _0801037A - ldr r0, =0x03003110 - ldrh r0, [r0] - cmp r0, 0 - bne _0801037A - movs r0, 0xCC - lsls r0, 7 - bl sub_800FD14 - ldr r0, =sub_80102B8 - str r0, [r4] -_0801037A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8010358 - - thumb_func_start sub_8010390 -sub_8010390: @ 8010390 - push {r4,lr} - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - beq _080103CC - ldr r4, =0x03005000 - ldr r1, =0x000009e6 - adds r0, r4, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _0801041E - ldr r0, =0x03003110 - ldrh r0, [r0] - cmp r0, 0 - bne _0801041E - movs r0, 0xCC - lsls r0, 7 - bl sub_800FD14 - ldr r0, =sub_80102B8 - b _0801041C - .pool -_080103CC: - bl sub_8009FCC - lsls r0, 24 - lsrs r2, r0, 24 - movs r1, 0x1 - cmp r1, r2 - bcs _080103FA - ldr r3, =0x03005000 - adds r0, r3, 0 - adds r0, 0xEA - ldrb r0, [r0] - cmp r0, 0 - beq _080103FA - adds r3, 0xE9 -_080103E8: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, r2 - bcs _080103FA - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, 0 - bne _080103E8 -_080103FA: - cmp r1, r2 - bne _0801041E - ldr r4, =0x03005000 - ldr r1, =0x000009e6 - adds r0, r4, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _0801041E - ldr r0, =0x03003110 - ldrh r0, [r0] - cmp r0, 0 - bne _0801041E - movs r0, 0xCC - lsls r0, 7 - bl sub_800FD14 - ldr r0, =sub_8010358 -_0801041C: - str r0, [r4] -_0801041E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8010390 - - thumb_func_start sub_8010434 -sub_8010434: @ 8010434 - push {lr} - ldr r1, =0x03005000 - ldr r2, [r1] - cmp r2, 0 - bne _08010448 - ldr r0, =sub_8010390 - str r0, [r1] - adds r0, r1, 0 - adds r0, 0xFE - strh r2, [r0] -_08010448: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8010434 - - thumb_func_start sub_8010454 -sub_8010454: @ 8010454 - push {r4,lr} - adds r3, r0, 0 - ldr r1, =gUnknown_082ED6E0 - ldrh r0, [r1] - cmp r0, r3 - beq _08010482 - ldr r4, =0x0000ffff - adds r2, r1, 0 -_08010464: - ldrh r0, [r2] - cmp r0, r4 - bne _08010478 - movs r0, 0 - b _08010484 - .pool -_08010478: - adds r1, 0x2 - adds r2, 0x2 - ldrh r0, [r1] - cmp r0, r3 - bne _08010464 -_08010482: - movs r0, 0x1 -_08010484: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8010454 - - thumb_func_start sub_801048C -sub_801048C: @ 801048C - push {lr} - cmp r0, 0 - beq _080104A0 - movs r1, 0x96 - lsls r1, 2 - movs r0, 0x1 - bl sub_800D550 - movs r0, 0 - b _080104AC -_080104A0: - movs r0, 0 - movs r1, 0 - bl sub_800D550 - lsls r0, 24 - lsrs r0, 24 -_080104AC: - pop {r1} - bx r1 - thumb_func_end sub_801048C - - thumb_func_start sub_80104B0 -sub_80104B0: @ 80104B0 - push {lr} - ldr r0, =0x03005000 - ldr r1, =0x00000cd9 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - movs r0, 0 - bl sub_800C27C - pop {r0} - bx r0 - .pool - thumb_func_end sub_80104B0 - - thumb_func_start rfu_get_multiplayer_id -rfu_get_multiplayer_id: @ 80104D0 - push {lr} - ldr r1, =0x03005000 - ldrb r0, [r1, 0xC] - cmp r0, 0x1 - beq _080104EC - ldr r2, =0x00000cce - adds r0, r1, r2 - ldrb r0, [r0] - b _080104EE - .pool -_080104EC: - movs r0, 0 -_080104EE: - pop {r1} - bx r1 - thumb_func_end rfu_get_multiplayer_id - - thumb_func_start sub_80104F4 -sub_80104F4: @ 80104F4 - ldr r0, =0x03005000 - ldrb r0, [r0, 0xD] - bx lr - .pool - thumb_func_end sub_80104F4 - - thumb_func_start sub_8010500 -sub_8010500: @ 8010500 - push {lr} - ldr r2, =0x03005000 - adds r0, r2, 0 - adds r0, 0xF1 - ldrb r0, [r0] - cmp r0, 0x2 - bne _08010518 - movs r0, 0 - b _08010524 - .pool -_08010518: - movs r1, 0 - ldr r0, [r2] - cmp r0, 0 - bne _08010522 - movs r1, 0x1 -_08010522: - adds r0, r1, 0 -_08010524: - pop {r1} - bx r1 - thumb_func_end sub_8010500 - - thumb_func_start sub_8010528 -sub_8010528: @ 8010528 - push {lr} - ldr r0, =0x03005000 - ldr r0, [r0] - cmp r0, 0 - beq _08010536 - bl _call_via_r0 -_08010536: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8010528 - - thumb_func_start sub_8010540 -sub_8010540: @ 8010540 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r7, 0 - movs r5, 0 - ldr r6, =0x03005000 - ldr r0, =0x00000c3e - adds r0, r6 - mov r8, r0 -_08010552: - ldr r1, =0x00000cd1 - adds r0, r6, r1 - adds r4, r5, r0 - ldrb r0, [r4] - subs r0, 0x5 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _080105DA - ldr r1, =0x03007880 - lsls r0, r5, 2 - adds r0, r1 - ldr r0, [r0] - ldrh r0, [r0, 0x34] - cmp r0, 0x46 - beq _08010576 - cmp r0, 0x48 - bne _080105C0 -_08010576: - ldr r2, =0x00000cd5 - adds r0, r6, r2 - adds r1, r5, r0 - ldrb r0, [r1] - cmp r0, 0x8 - bne _080105DA - movs r0, 0x9 - strb r0, [r4] - movs r0, 0xA - strb r0, [r1] - lsls r1, r5, 24 - lsrs r1, 24 - movs r0, 0x8 - bl rfu_clearSlot - movs r0, 0x80 - lsls r0, 17 - lsls r0, r5 - lsrs r0, 24 - movs r1, 0x8 - adds r2, r4, 0 - movs r3, 0x1 - bl rfu_NI_setSendData - movs r7, 0x1 - b _080105DA - .pool -_080105C0: - mov r2, r8 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - ldrh r0, [r0, 0x34] - cmp r0, 0x47 - bne _080105DA - lsls r1, r5, 24 - lsrs r1, 24 - movs r0, 0x8 - bl rfu_clearSlot -_080105DA: - adds r5, 0x1 - cmp r5, 0x3 - ble _08010552 - adds r0, r7, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8010540 - - thumb_func_start sub_80105EC -sub_80105EC: @ 80105EC - push {r4-r6,lr} - movs r3, 0 - movs r1, 0 - ldr r5, =0x03005cd5 - movs r6, 0x1 - movs r4, 0 -_080105F8: - adds r2, r1, r5 - ldrb r0, [r2] - cmp r0, 0xB - bne _0801060C - adds r0, r6, 0 - lsls r0, r1 - orrs r3, r0 - lsls r0, r3, 24 - lsrs r3, r0, 24 - strb r4, [r2] -_0801060C: - adds r1, 0x1 - cmp r1, 0x3 - ble _080105F8 - cmp r3, 0 - beq _08010620 - adds r0, r3, 0 - bl rfu_REQ_disconnect - bl rfu_waitREQComplete -_08010620: - movs r1, 0 - ldr r2, =0x03005cd5 -_08010624: - adds r0, r1, r2 - ldrb r0, [r0] - subs r0, 0xA - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _0801063C - movs r0, 0x1 - b _08010644 - .pool -_0801063C: - adds r1, 0x1 - cmp r1, 0x3 - ble _08010624 - movs r0, 0 -_08010644: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80105EC - - thumb_func_start sub_801064C -sub_801064C: @ 801064C - push {lr} - adds r2, r0, 0 - adds r0, r1, 0 - lsls r2, 16 - lsrs r2, 16 - adds r1, r2, 0 - bl sub_8011CE4 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xFF - beq _08010680 - ldr r0, =0x03005000 - ldr r2, =0x00000cd1 - adds r0, r2 - adds r0, r1, r0 - ldrb r0, [r0] - cmp r0, 0x9 - beq _08010680 - movs r0, 0 - b _08010682 - .pool -_08010680: - movs r0, 0x1 -_08010682: - pop {r1} - bx r1 - thumb_func_end sub_801064C - - thumb_func_start sub_8010688 -sub_8010688: @ 8010688 - push {r4-r6,lr} - adds r6, r0, 0 - adds r0, r2, 0 - lsls r6, 24 - lsrs r6, 24 - lsls r1, 16 - lsrs r1, 16 - bl sub_8011CE4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =0x03005000 - ldr r0, =0x00000cd1 - adds r5, r0 - adds r5, r4, r5 - strb r6, [r5] - movs r0, 0x4 - adds r1, r4, 0 - bl rfu_clearSlot - movs r0, 0x80 - lsls r0, 17 - lsls r0, r4 - lsrs r0, 24 - movs r1, 0x8 - adds r2, r5, 0 - movs r3, 0x1 - bl rfu_NI_setSendData - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8010688 - - thumb_func_start sub_80106D4 -sub_80106D4: @ 80106D4 - push {r4,r5,lr} - ldr r4, =0x03005000 - ldr r0, =0x00000c85 - adds r5, r4, r0 - movs r0, 0x8 - strb r0, [r5] - ldr r0, =0x00000c3e - adds r4, r0 - ldrb r1, [r4] - movs r0, 0x4 - bl rfu_clearSlot - ldrb r1, [r4] - movs r0, 0x80 - lsls r0, 17 - lsls r0, r1 - lsrs r0, 24 - movs r1, 0x8 - adds r2, r5, 0 - movs r3, 0x1 - bl rfu_NI_setSendData - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80106D4 - - thumb_func_start sub_8010714 -sub_8010714: @ 8010714 - push {lr} - adds r2, r0, 0 - adds r0, r1, 0 - lsls r2, 16 - lsrs r2, 16 - adds r1, r2, 0 - bl sub_8011CE4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _08010730 - movs r0, 0x2 - b _0801074A -_08010730: - ldr r1, =0x03007880 - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - ldrh r0, [r0] - cmp r0, 0 - beq _08010748 - movs r0, 0 - b _0801074A - .pool -_08010748: - movs r0, 0x1 -_0801074A: - pop {r1} - bx r1 - thumb_func_end sub_8010714 - - thumb_func_start sub_8010750 -sub_8010750: @ 8010750 - push {r4,r5,lr} - bl sub_8010540 - movs r4, 0 - ldr r0, =0x03005000 - ldr r1, =0x00000cd5 - adds r5, r0, r1 -_0801075E: - ldr r1, =0x03007880 - lsls r0, r4, 2 - adds r0, r1 - ldr r0, [r0] - ldrh r0, [r0] - subs r0, 0x26 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _08010788 - adds r1, r4, r5 - ldrb r0, [r1] - cmp r0, 0xA - bne _0801077E - movs r0, 0xB - strb r0, [r1] -_0801077E: - lsls r1, r4, 24 - lsrs r1, 24 - movs r0, 0x4 - bl rfu_clearSlot -_08010788: - adds r4, 0x1 - cmp r4, 0x3 - ble _0801075E - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8010750 - - thumb_func_start sub_80107A0 -sub_80107A0: @ 80107A0 - push {r4,r5,lr} - movs r4, 0 - ldr r1, =0x03005000 - ldr r2, =0x00000c85 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x8 - bne _080107DA - ldr r2, =0x03007880 - ldr r0, =0x00000c3e - adds r1, r0 - ldrb r0, [r1] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ldrh r0, [r0] - cmp r0, 0x26 - beq _080107D2 - ldrb r0, [r1] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ldrh r0, [r0] - cmp r0, 0x27 - bne _080107DA -_080107D2: - ldrb r1, [r1] - movs r0, 0x4 - bl rfu_clearSlot -_080107DA: - ldr r2, =0x03007880 - ldr r5, =0x03005000 - ldr r0, =0x00000c3e - adds r1, r5, r0 - ldrb r0, [r1] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ldrh r0, [r0, 0x34] - cmp r0, 0x46 - beq _080107FE - ldrb r0, [r1] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ldrh r0, [r0, 0x34] - cmp r0, 0x48 - bne _0801082C -_080107FE: - ldrb r1, [r1] - movs r0, 0x8 - bl rfu_clearSlot - ldr r2, =0x00000c86 - adds r4, r5, r2 - ldrb r0, [r4] - movs r1, 0 - bl sub_8011A64 - ldrb r4, [r4] - b _08010844 - .pool -_0801082C: - ldrb r0, [r1] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ldrh r0, [r0, 0x34] - cmp r0, 0x47 - bne _08010844 - ldrb r1, [r1] - movs r0, 0x8 - bl rfu_clearSlot - movs r4, 0x6 -_08010844: - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80107A0 - - thumb_func_start sub_801084C -sub_801084C: @ 801084C - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r5, =0x03005000 - adds r0, r5, 0 - adds r0, 0xF1 - ldrb r0, [r0] - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _08010872 - ldr r0, =0x00000ce8 - adds r1, r5, r0 - movs r0, 0 - strb r0, [r1] - adds r0, r6, 0 - bl remove_task -_08010872: - ldr r2, =0x03005e00 - lsls r1, r6, 2 - adds r0, r1, r6 - lsls r0, 3 - adds r4, r0, r2 - movs r2, 0x8 - ldrsh r0, [r4, r2] - adds r7, r1, 0 - cmp r0, 0x3 - beq _0801091C - cmp r0, 0x3 - bgt _080108A4 - cmp r0, 0x1 - beq _080108CC - cmp r0, 0x1 - bgt _08010918 - cmp r0, 0 - beq _080108B6 - b _080109D2 - .pool -_080108A4: - cmp r0, 0x5 - beq _08010950 - cmp r0, 0x5 - blt _0801093E - cmp r0, 0x6 - beq _08010984 - cmp r0, 0x65 - beq _08010904 - b _080109D2 -_080108B6: - bl sub_800FC60 - lsls r0, 24 - cmp r0, 0 - bne _080108C2 - b _080109D2 -_080108C2: - bl sub_800A5B4 - bl sub_800B348 - b _08010948 -_080108CC: - ldrb r0, [r5, 0xC] - cmp r0, 0x1 - bne _0801090C - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _080108E8 - movs r0, 0xF0 - lsls r0, 7 - bl sub_800FD14 - b _080108F0 - .pool -_080108E8: - movs r0, 0xEE - lsls r0, 7 - bl sub_800FD14 -_080108F0: - ldr r0, =0x03005e00 - adds r1, r7, r6 - lsls r1, 3 - adds r1, r0 - movs r0, 0x65 - strh r0, [r1, 0x8] - b _080109D2 - .pool -_08010904: - ldr r0, =0x03003110 - ldrh r0, [r0] - cmp r0, 0 - bne _080109D2 -_0801090C: - movs r0, 0x2 - strh r0, [r4, 0x8] - b _080109D2 - .pool -_08010918: - ldrb r0, [r5, 0xD] - b _08010944 -_0801091C: - ldrb r0, [r5, 0xC] - cmp r0, 0x1 - bne _08010948 - bl sub_800FC60 - lsls r0, 24 - cmp r0, 0 - beq _080109D2 - adds r1, r5, 0 - adds r1, 0x5A - movs r0, 0 - strb r0, [r1] - movs r0, 0xA1 - lsls r0, 8 - bl sub_800FD14 - b _08010948 -_0801093E: - bl sub_800FC88 - lsls r0, 24 -_08010944: - cmp r0, 0 - beq _080109D2 -_08010948: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080109D2 -_08010950: - movs r4, 0 - ldrb r0, [r5, 0xD] - cmp r4, r0 - bge _0801096E -_08010958: - adds r0, r4, 0 - bl sub_800B3A4 - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_800F728 - adds r4, 0x1 - ldrb r2, [r5, 0xD] - cmp r4, r2 - blt _08010958 -_0801096E: - ldr r0, =0x03005e00 - adds r1, r7, r6 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _080109D2 - .pool -_08010984: - adds r0, r6, 0 - bl remove_task - ldr r1, =0x03003124 - movs r0, 0x1 - strb r0, [r1] - ldr r0, =0x00000ce8 - adds r1, r5, r0 - movs r0, 0 - strb r0, [r1] - movs r1, 0x96 - lsls r1, 2 - movs r0, 0x1 - bl sub_800D550 - ldr r2, =0x00000ce6 - adds r1, r5, r2 - ldrb r0, [r1] - cmp r0, 0 - beq _080109D2 - movs r4, 0 - adds r2, r1, 0 - movs r3, 0x1 - ldr r0, =0x00000ce5 - adds r5, r0 -_080109B6: - ldrb r0, [r2] - asrs r0, r4 - ands r0, r3 - cmp r0, 0 - beq _080109CC - adds r0, r3, 0 - lsls r0, r4 - strb r0, [r5] - ldrb r1, [r2] - eors r0, r1 - strb r0, [r2] -_080109CC: - adds r4, 0x1 - cmp r4, 0x3 - ble _080109B6 -_080109D2: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801084C - - thumb_func_start sub_80109E8 -sub_80109E8: @ 80109E8 - push {r4,r5,lr} - lsls r0, 16 - lsrs r2, r0, 16 - movs r1, 0 - movs r5, 0x1 - ldr r4, =0x03005cde - movs r3, 0 -_080109F6: - adds r0, r2, 0 - asrs r0, r1 - ands r0, r5 - cmp r0, 0 - beq _08010A04 - adds r0, r1, r4 - strb r3, [r0] -_08010A04: - adds r1, 0x1 - cmp r1, 0x3 - ble _080109F6 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80109E8 - - thumb_func_start sub_8010A14 -sub_8010A14: @ 8010A14 - push {r4-r7,lr} - adds r2, r0, 0 - ldr r1, =0x03005000 - ldrb r0, [r2, 0xF] - strb r0, [r1, 0xD] - movs r4, 0 - ldr r0, =0x00000cde - adds r5, r1, r0 - adds r3, r2, 0 - adds r3, 0x10 -_08010A28: - adds r0, r4, r5 - adds r1, r3, r4 - ldrb r1, [r1] - strb r1, [r0] - adds r4, 0x1 - cmp r4, 0x3 - ble _08010A28 - adds r6, r2, 0 - ldr r5, =0x020229e8 - movs r4, 0x4 -_08010A3C: - adds r0, r5, 0 - adds r1, r6, 0 - adds r1, 0x14 - ldm r1!, {r2,r3,r7} - stm r0!, {r2,r3,r7} - ldm r1!, {r2,r3,r7} - stm r0!, {r2,r3,r7} - ldr r1, [r1] - str r1, [r0] - adds r0, r5, 0 - bl sub_800B524 - adds r6, 0x1C - adds r5, 0x1C - subs r4, 0x1 - cmp r4, 0 - bge _08010A3C - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8010A14 - - thumb_func_start sub_8010A70 -sub_8010A70: @ 8010A70 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - ldr r0, =gUnknown_082ED7EC - adds r1, r4, 0 - bl strcmp - adds r5, r0, 0 - cmp r5, 0 - bne _08010A9C - adds r0, r4, 0 - bl sub_8010A14 - mov r0, sp - strh r5, [r0] - ldr r2, =0x0100007e - adds r1, r4, 0 - bl CpuSet - movs r0, 0 - bl sub_800A5EC -_08010A9C: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8010A70 - - thumb_func_start sub_8010AAC -sub_8010AAC: @ 8010AAC - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r3, =0x03005000 - ldr r2, =gUnknown_082ED68C - ldr r1, =0x00000ce9 - adds r0, r3, r1 - ldrb r1, [r0] - adds r1, r2 - ldr r2, =0x00000cde - adds r0, r3, r2 - ldrb r1, [r1] - adds r0, r1 - ldrb r4, [r0] - adds r0, r3, 0 - adds r0, 0xF1 - ldrb r0, [r0] - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _08010AE8 - ldr r5, =0x00000ce8 - adds r1, r3, r5 - movs r0, 0 - strb r0, [r1] - adds r0, r6, 0 - bl remove_task -_08010AE8: - ldr r0, =0x03005e00 - lsls r2, r6, 2 - adds r1, r2, r6 - lsls r1, 3 - adds r1, r0 - movs r3, 0x8 - ldrsh r1, [r1, r3] - adds r3, r0, 0 - adds r7, r2, 0 - cmp r1, 0x5 - bls _08010B00 - b _08010CF0 -_08010B00: - lsls r0, r1, 2 - ldr r1, =_08010B28 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08010B28: - .4byte _08010B40 - .4byte _08010B60 - .4byte _08010B78 - .4byte _08010BC0 - .4byte _08010C0A - .4byte _08010C94 -_08010B40: - ldr r0, =0x03003110 - ldrh r0, [r0] - cmp r0, 0 - beq _08010B4A - b _08010CF0 -_08010B4A: - adds r0, r4, 0 - bl sub_800A5EC - movs r0, 0xF0 - lsls r0, 7 - bl sub_800FD14 - b _08010C4A - .pool -_08010B60: - ldr r0, =0x03003110 - ldrh r0, [r0] - cmp r0, 0 - beq _08010B6A - b _08010CF0 -_08010B6A: - adds r1, r7, r6 - lsls r1, 3 - adds r1, r3 - b _08010C52 - .pool -_08010B78: - bl sub_800A550 - lsls r0, 24 - lsrs r0, 24 - asrs r0, r4 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08010B8C - b _08010CF0 -_08010B8C: - adds r0, r4, 0 - bl sub_800A5EC - lsls r2, r4, 8 - ldr r0, =0x020223c4 - adds r2, r0 - ldr r1, =0x020229e8 - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - adds r0, r1 - adds r1, r0, 0 - adds r2, 0x10 - ldm r2!, {r3-r5} - stm r1!, {r3-r5} - ldm r2!, {r3-r5} - stm r1!, {r3-r5} - ldr r2, [r2] - str r2, [r1] - bl sub_800B524 - b _08010C4A - .pool -_08010BC0: - ldr r5, =0x020228c4 - adds r1, r5, 0 - ldr r0, =gUnknown_082ED7EC - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldrh r2, [r0] - strh r2, [r1] - ldrb r0, [r0, 0x2] - strb r0, [r1, 0x2] - ldr r1, =0x03005000 - ldrb r0, [r1, 0xD] - strb r0, [r5, 0xF] - movs r2, 0 - adds r4, r5, 0 - adds r4, 0x10 - ldr r0, =0x00000cde - adds r3, r1, r0 -_08010BE2: - adds r0, r4, r2 - adds r1, r2, r3 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x3 - ble _08010BE2 - ldr r1, =0x020229e8 - adds r0, r5, 0 - adds r0, 0x14 - movs r2, 0x8C - bl memcpy - ldr r0, =0x03005e00 - adds r1, r7, r6 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_08010C0A: - ldr r5, =0x020228c4 - ldr r1, =0x03005000 - ldrb r0, [r1, 0xD] - strb r0, [r5, 0xF] - movs r2, 0 - ldr r3, =0x020229e8 - mov r12, r3 - adds r4, r5, 0 - adds r4, 0x10 - ldr r0, =0x00000cde - adds r3, r1, r0 -_08010C20: - adds r0, r4, r2 - adds r1, r2, r3 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x3 - ble _08010C20 - adds r0, r5, 0 - adds r0, 0x14 - mov r1, r12 - movs r2, 0x8C - bl memcpy - ldr r1, =0x020228c4 - movs r0, 0 - movs r2, 0xA0 - bl link_0800A448 - lsls r0, 24 - cmp r0, 0 - beq _08010CF0 -_08010C4A: - ldr r0, =0x03005e00 - adds r1, r7, r6 - lsls r1, 3 - adds r1, r0 -_08010C52: - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _08010CF0 - .pool -_08010C74: - adds r0, r3, 0 - lsls r0, r2 - ldr r2, =0x00000ce5 - adds r1, r5, r2 - strb r0, [r1] - ldrb r1, [r4] - eors r0, r1 - strb r0, [r4] - ldr r4, =0x00000ce8 - adds r0, r5, r4 - strb r3, [r0] - b _08010CEA - .pool -_08010C94: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08010CF0 - bl sub_800A550 - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _08010CF0 - mov r0, sp - movs r4, 0 - strh r4, [r0] - ldr r1, =0x020223c4 - ldr r2, =0x0100007e - bl CpuSet - movs r0, 0 - bl sub_800A5EC - ldr r1, =0x03005000 - ldr r5, =0x00000ce8 - adds r0, r1, r5 - strb r4, [r0] - ldr r0, =0x00000ce6 - adds r3, r1, r0 - ldrb r0, [r3] - cmp r0, 0 - beq _08010CEA - movs r2, 0 - adds r5, r1, 0 - adds r4, r3, 0 - ldrb r1, [r4] - movs r3, 0x1 -_08010CDA: - adds r0, r1, 0 - asrs r0, r2 - ands r0, r3 - cmp r0, 0 - bne _08010C74 - adds r2, 0x1 - cmp r2, 0x3 - ble _08010CDA -_08010CEA: - adds r0, r6, 0 - bl remove_task -_08010CF0: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8010AAC - - thumb_func_start sub_8010D0C -sub_8010D0C: @ 8010D0C - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r6, =0x03005000 - adds r0, r6, 0 - adds r0, 0xF1 - ldrb r0, [r0] - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _08010D2A - adds r0, r5, 0 - bl remove_task -_08010D2A: - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _08010D70 - cmp r0, 0x1 - bgt _08010D50 - cmp r0, 0 - beq _08010D56 - b _08010DA6 - .pool -_08010D50: - cmp r0, 0x2 - beq _08010D82 - b _08010DA6 -_08010D56: - ldrb r0, [r6, 0xD] - cmp r0, 0 - beq _08010DA6 - bl sub_800B348 - ldr r1, =0x020228c4 - movs r0, 0 - movs r2, 0x3C - bl link_0800A448 - b _08010D7A - .pool -_08010D70: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08010DA6 -_08010D7A: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _08010DA6 -_08010D82: - bl sub_800A550 - movs r4, 0x1 - adds r1, r4, 0 - ands r1, r0 - cmp r1, 0 - beq _08010DA6 - ldr r0, =0x020223c4 - bl sub_8010A14 - movs r0, 0 - bl sub_800A5EC - ldr r0, =0x03003124 - strb r4, [r0] - adds r0, r5, 0 - bl remove_task -_08010DA6: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8010D0C - - thumb_func_start sub_8010DB4 -sub_8010DB4: @ 8010DB4 - push {r4-r7,lr} - ldr r0, =0x03005000 - adds r1, r0, 0 - adds r1, 0xEE - ldrb r1, [r1] - adds r3, r0, 0 - cmp r1, 0x1 - bne _08010E5C - ldr r2, =0x03004140 - ldrb r0, [r2, 0x2] - cmp r0, 0 - bne _08010E5C - ldr r0, =0x030022c0 - ldr r1, [r0, 0x4] - ldr r0, =sub_8018438 - cmp r1, r0 - beq _08010DDE - ldr r0, [r2, 0x3C] - ldrb r0, [r0, 0x4] - cmp r0, 0 - beq _08010DE4 -_08010DDE: - ldr r1, =0x030030fc - movs r0, 0x2 - strb r0, [r1] -_08010DE4: - ldr r4, =c2_800ACD4 - adds r0, r4, 0 - bl SetMainCallback2 - ldr r0, =0x030022c0 - str r4, [r0, 0x8] - ldr r5, =0x03005000 - ldrh r0, [r5, 0xA] - lsls r4, r0, 16 - ldrh r0, [r5, 0x10] - lsls r0, 8 - orrs r4, r0 - ldrh r0, [r5, 0x12] - orrs r4, r0 - ldr r1, =0x000009e6 - adds r0, r5, r1 - ldrb r0, [r0] - adds r7, r0, 0 - ldr r1, =0x00000c1a - adds r0, r5, r1 - ldrb r0, [r0] - adds r6, r0, 0 - bl sub_8011A74 - movs r3, 0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08010E20 - movs r3, 0x1 -_08010E20: - adds r0, r4, 0 - adds r1, r7, 0 - adds r2, r6, 0 - bl sub_800AF18 - adds r0, r5, 0 - adds r0, 0xEE - ldrb r1, [r0] - movs r1, 0x2 - strb r1, [r0] - bl sub_80097E8 - b _08010E8E - .pool -_08010E5C: - ldr r1, =0x00000c1b - adds r0, r3, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _08010E70 - ldr r1, =0x000009e7 - adds r0, r3, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _08010E8E -_08010E70: - ldr r0, =0x03004140 - ldrb r0, [r0, 0x2] - cmp r0, 0 - beq _08010E7C - bl sub_800D630 -_08010E7C: - movs r4, 0xE0 - lsls r4, 7 - movs r0, 0x1 - adds r1, r4, 0 - bl sub_8011A64 - adds r0, r4, 0 - bl sub_8011170 -_08010E8E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8010DB4 - - thumb_func_start rfu_REQ_recvData_then_sendData -rfu_REQ_recvData_then_sendData: @ 8010EA0 - push {lr} - ldr r0, =0x03004140 - ldrb r0, [r0, 0x6] - cmp r0, 0x1 - bne _08010EB8 - bl rfu_REQ_recvData - bl rfu_waitREQComplete - movs r0, 0 - bl rfu_REQ_sendData_wrapper -_08010EB8: - pop {r0} - bx r0 - .pool - thumb_func_end rfu_REQ_recvData_then_sendData - - thumb_func_start sub_8010EC0 -sub_8010EC0: @ 8010EC0 - push {r4,r5,lr} - movs r5, 0 - ldr r4, =0x03005000 - ldr r1, =0x00000ccd - adds r0, r4, r1 - strb r5, [r0] - bl GenerateRandomNumber2 - lsls r0, 16 - lsrs r0, 16 - bl sub_800C54C - adds r0, r4, 0 - adds r0, 0xEF - ldrb r0, [r0] - cmp r0, 0 - bne _08010F14 - ldrb r0, [r4, 0xC] - cmp r0, 0x1 - beq _08010F02 - cmp r0, 0x1 - bgt _08010EFC - cmp r0, 0 - beq _08010F08 - b _08010F14 - .pool -_08010EFC: - cmp r0, 0x2 - beq _08010F10 - b _08010F14 -_08010F02: - bl sub_800F0F8 - b _08010F14 -_08010F08: - bl sub_800F4F0 - adds r5, r0, 0 - b _08010F14 -_08010F10: - bl rfu_REQ_recvData_then_sendData -_08010F14: - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8010EC0 - - thumb_func_start sub_8010F1C -sub_8010F1C: @ 8010F1C - push {r4,lr} - movs r4, 0 - ldr r1, =0x03005000 - adds r0, r1, 0 - adds r0, 0xEF - ldrb r0, [r0] - cmp r0, 0 - bne _08010F3C - ldrb r0, [r1, 0xC] - cmp r0, 0x1 - bne _08010F38 - bl sub_800F1E0 - adds r4, r0, 0 -_08010F38: - bl sub_8010DB4 -_08010F3C: - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8010F1C - - thumb_func_start sub_8010F48 -sub_8010F48: @ 8010F48 - push {lr} - ldr r0, =0x02022b22 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - pop {r0} - bx r0 - .pool - thumb_func_end sub_8010F48 - - thumb_func_start sub_8010F60 -sub_8010F60: @ 8010F60 - push {r4,lr} - ldr r4, =0x02022b14 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0xD - bl memset - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl sub_800DD94 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8010F60 - - thumb_func_start sub_8010F84 -sub_8010F84: @ 8010F84 - push {r4,lr} - adds r4, r0, 0 - adds r3, r1, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x02022b14 - adds r1, r4, 0 - bl sub_800DD94 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8010F84 - - thumb_func_start sub_8010FA0 -sub_8010FA0: @ 8010FA0 - push {r4,r5,lr} - ldr r5, =0x02022b14 - movs r4, 0x1 - ands r0, r4 - lsls r0, 4 - ldrb r3, [r5] - movs r2, 0x11 - negs r2, r2 - ands r2, r3 - orrs r2, r0 - ands r1, r4 - lsls r1, 5 - movs r0, 0x21 - negs r0, r0 - ands r2, r0 - orrs r2, r1 - strb r2, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8010FA0 - - thumb_func_start sub_8010FCC -sub_8010FCC: @ 8010FCC - push {r4,r5,lr} - ldr r5, =0x02022b14 - lsls r0, 2 - ldrb r4, [r5, 0x9] - movs r3, 0x3 - ands r3, r4 - orrs r3, r0 - strb r3, [r5, 0x9] - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r1, r0 - ldrh r3, [r5, 0x8] - ldr r0, =0xfffffc00 - ands r0, r3 - orrs r0, r1 - strh r0, [r5, 0x8] - lsls r2, 1 - ldrb r1, [r5, 0xB] - movs r0, 0x1 - ands r0, r1 - orrs r0, r2 - strb r0, [r5, 0xB] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8010FCC - - thumb_func_start sub_801100C -sub_801100C: @ 801100C - push {r4,lr} - movs r4, 0x80 - ldr r3, =0x020229e8 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r0, r1, r3 - ldrb r2, [r0, 0x13] - lsls r2, 3 - orrs r2, r4 - adds r3, 0x4 - adds r1, r3 - ldr r0, [r1] - movs r1, 0x7 - ands r0, r1 - orrs r0, r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_801100C - - thumb_func_start sub_801103C -sub_801103C: @ 801103C - push {r4,r5,lr} - ldr r5, =0x02022b14 - movs r4, 0x1 - b _08011054 - .pool -_08011048: - adds r0, r4, 0 - bl sub_801100C - adds r1, r5, r4 - strb r0, [r1, 0x3] - adds r4, 0x1 -_08011054: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - blt _08011048 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_801103C - - thumb_func_start sub_8011068 -sub_8011068: @ 8011068 - push {lr} - lsls r0, 24 - ldr r2, =0x02022b14 - lsrs r0, 17 - ldrb r3, [r2, 0xA] - movs r1, 0x7F - ands r1, r3 - orrs r1, r0 - strb r1, [r2, 0xA] - ldr r3, =0x02022b22 - movs r0, 0 - movs r1, 0x2 - bl rfu_REQ_configGameData - pop {r0} - bx r0 - .pool - thumb_func_end sub_8011068 - - thumb_func_start sub_8011090 -sub_8011090: @ 8011090 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _0801109E - bl sub_8010F84 -_0801109E: - ldr r2, =0x02022b14 - ldr r3, =0x02022b22 - movs r0, 0 - movs r1, 0x2 - bl rfu_REQ_configGameData - pop {r0} - bx r0 - .pool - thumb_func_end sub_8011090 - - thumb_func_start sub_80110B8 -sub_80110B8: @ 80110B8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r9, r0 - bl sub_800F7DC - ldrb r1, [r0, 0xA] - movs r0, 0x7F - ands r0, r1 - cmp r0, 0x45 - bne _0801114C - movs r5, 0 - movs r7, 0 - ldr r3, =0x03005000 - ldr r1, =0x00000ce2 - adds r0, r3, r1 - ldr r2, =0x00000ce3 - adds r1, r3, r2 - ldrb r2, [r0] - ldrb r0, [r1] - adds r1, r0, 0 - eors r1, r2 - mov r8, r1 - movs r4, 0 - movs r6, 0x1 - ldr r2, =0x020229e8 - mov r12, r2 - ldr r0, =0x00000cde - adds r0, r3 - mov r10, r0 - mov r3, r12 - adds r3, 0x4 -_080110FC: - mov r0, r8 - asrs r0, r4 - ands r0, r6 - cmp r0, 0 - beq _0801113C - mov r1, r10 - adds r0, r4, r1 - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - mov r2, r12 - adds r1, r0, r2 - ldrb r1, [r1, 0x13] - adds r2, r6, 0 - ands r2, r1 - lsls r2, 3 - adds r0, r3 - ldr r1, [r0] - movs r0, 0x7 - ands r1, r0 - movs r0, 0x80 - orrs r1, r0 - orrs r2, r1 - lsls r0, r5, 3 - lsls r2, r0 - orrs r7, r2 - adds r5, 0x1 - mov r0, r9 - subs r0, 0x1 - cmp r5, r0 - beq _08011142 -_0801113C: - adds r4, 0x1 - cmp r4, 0x3 - ble _080110FC -_08011142: - movs r0, 0x45 - adds r1, r7, 0 - movs r2, 0 - bl sub_8011090 -_0801114C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80110B8 - - thumb_func_start sub_8011170 -sub_8011170: @ 8011170 - push {r4,lr} - adds r4, r0, 0 - ldr r2, =0x03005000 - adds r3, r2, 0 - adds r3, 0xEE - ldrb r0, [r3] - cmp r0, 0 - bne _08011192 - ldr r1, =0x03004140 - ldrh r0, [r1, 0x14] - strh r0, [r2, 0x10] - ldrh r0, [r1, 0x16] - strh r0, [r2, 0x12] - strh r4, [r2, 0xA] - ldrb r0, [r3] - movs r0, 0x1 - strb r0, [r3] -_08011192: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8011170 - - thumb_func_start sub_80111A0 -sub_80111A0: @ 80111A0 - ldr r0, =0x03005000 - adds r0, 0xEE - ldrb r1, [r0] - movs r1, 0 - strb r1, [r0] - bx lr - .pool - thumb_func_end sub_80111A0 - - thumb_func_start sub_80111B0 -sub_80111B0: @ 80111B0 - push {lr} - adds r2, r0, 0 - cmp r2, 0 - bne _080111C8 - ldr r0, =0x03005000 - adds r0, 0xEE - ldrb r1, [r0] - strb r2, [r0] - b _080111D2 - .pool -_080111C8: - ldr r0, =0x03005000 - adds r0, 0xEE - ldrb r1, [r0] - movs r1, 0x4 - strb r1, [r0] -_080111D2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80111B0 - - thumb_func_start sub_80111DC -sub_80111DC: @ 80111DC - push {lr} - ldr r0, =0x03004140 - ldrb r0, [r0] - movs r1, 0x1 - bl sub_8011E94 - ldr r1, =0x03005000 - movs r0, 0 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80111DC - - thumb_func_start sub_80111FC -sub_80111FC: @ 80111FC - ldr r1, =0x03005000 - ldr r0, =sub_80111DC - str r0, [r1] - bx lr - .pool - thumb_func_end sub_80111FC - - thumb_func_start sub_801120C -sub_801120C: @ 801120C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r4, r0, 24 - movs r6, 0 - cmp r4, 0x32 - bne _08011222 - b _08011360 -_08011222: - cmp r4, 0x32 - bgt _08011252 - cmp r4, 0x13 - bgt _08011240 - cmp r4, 0x12 - blt _08011230 - b _080113EE -_08011230: - cmp r4, 0x10 - bne _08011236 - b _080113EE -_08011236: - cmp r4, 0x10 - bgt _0801128C - cmp r4, 0 - beq _0801127E - b _080113EE -_08011240: - cmp r4, 0x30 - bne _08011246 - b _0801136C -_08011246: - cmp r4, 0x30 - ble _0801124C - b _08011354 -_0801124C: - cmp r4, 0x14 - beq _08011328 - b _080113EE -_08011252: - cmp r4, 0x44 - bgt _08011264 - cmp r4, 0x42 - blt _0801125C - b _080113EE -_0801125C: - cmp r4, 0x33 - bne _08011262 - b _0801136C -_08011262: - b _080113EE -_08011264: - cmp r4, 0xF3 - bne _0801126A - b _080113BA -_0801126A: - cmp r4, 0xF3 - bgt _08011276 - cmp r4, 0xF0 - bge _08011274 - b _080113EE -_08011274: - b _080113D4 -_08011276: - cmp r4, 0xFF - bne _0801127C - b _080113D4 -_0801127C: - b _080113EE -_0801127E: - ldr r1, =0x03005000 - movs r0, 0x2 - strh r0, [r1, 0x4] - b _080113EE - .pool -_0801128C: - ldr r0, =0x03004140 - ldrh r0, [r0, 0x14] - bl sub_80115EC - movs r5, 0 - movs r0, 0x1 - mov r8, r0 - ldr r1, =0x03005000 - mov r9, r1 - ldr r3, =0x00000cd5 - add r3, r9 - mov r10, r3 - movs r7, 0x7F -_080112A6: - ldr r0, =0x03004140 - ldrh r0, [r0, 0x14] - asrs r0, r5 - mov r1, r8 - ands r0, r1 - cmp r0, 0 - beq _0801130E - ldr r0, =0x03007890 - lsls r1, r5, 5 - adds r1, 0x14 - ldr r0, [r0] - adds r0, r1 - ldrb r0, [r0, 0x10] - adds r4, r7, 0 - ands r4, r0 - bl sub_800F7DC - ldrb r1, [r0, 0xA] - adds r0, r7, 0 - ands r0, r1 - cmp r4, r0 - bne _08011304 - ldr r0, =0x00000cd1 - add r0, r9 - adds r0, r5, r0 - movs r1, 0 - strb r1, [r0] - mov r3, r10 - adds r2, r5, r3 - strb r1, [r2] - movs r0, 0x20 - adds r1, r5, 0 - movs r3, 0x1 - bl rfu_setRecvBuffer - b _0801130E - .pool -_08011304: - mov r0, r8 - lsls r0, r5 - orrs r6, r0 - lsls r0, r6, 24 - lsrs r6, r0, 24 -_0801130E: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _080112A6 - cmp r6, 0 - beq _080113EE - adds r0, r6, 0 - bl rfu_REQ_disconnect - bl rfu_waitREQComplete - b _080113EE -_08011328: - ldr r4, =0x03005000 - ldr r1, =0x00000ce7 - adds r0, r4, r1 - ldr r1, =0x03004140 - ldrb r2, [r0] - ldrb r0, [r1] - cmp r2, r0 - beq _08011342 - eors r0, r2 - bl rfu_REQ_disconnect - bl rfu_waitREQComplete -_08011342: - movs r0, 0x11 - strh r0, [r4, 0x4] - b _080113EE - .pool -_08011354: - ldr r0, =0x03005000 - adds r0, 0xF0 - b _080113EA - .pool -_08011360: - ldr r0, =0x03005000 - adds r0, 0xF0 - movs r1, 0x3 - b _080113EC - .pool -_0801136C: - ldr r1, =0x03005000 - adds r2, r1, 0 - adds r2, 0xF0 - movs r0, 0x4 - strb r0, [r2] - ldr r3, =0x00000ce2 - adds r1, r3 - ldr r0, =0x03004140 - ldrb r2, [r0, 0x14] - ldrb r0, [r1] - adds r3, r0, 0 - bics r3, r2 - adds r2, r3, 0 - strb r2, [r1] - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080113B0 - cmp r2, 0 - bne _080113AC - adds r0, r4, 0 - bl sub_8011170 - b _080113B0 - .pool -_080113AC: - bl sub_80111FC -_080113B0: - movs r0, 0x2 - adds r1, r4, 0 - bl sub_8011A64 - b _080113EE -_080113BA: - movs r0, 0x1 - movs r1, 0xF3 - bl sub_8011A64 - movs r0, 0xF3 - bl sub_8011170 - ldr r0, =0x03005000 - adds r0, 0xEF - b _080113EA - .pool -_080113D4: - adds r0, r4, 0 - bl sub_8011170 - movs r0, 0x1 - adds r1, r4, 0 - bl sub_8011A64 - ldr r0, =0x03005000 - ldr r1, =0x00000cdb - adds r0, r1 - ldrb r1, [r0] -_080113EA: - movs r1, 0x1 -_080113EC: - strb r1, [r0] -_080113EE: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801120C - - thumb_func_start sub_8011404 -sub_8011404: @ 8011404 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x31 - bne _08011410 - b _08011570 -_08011410: - cmp r4, 0x31 - bgt _0801143E - cmp r4, 0x22 - beq _08011494 - cmp r4, 0x22 - bgt _0801142C - cmp r4, 0x20 - beq _0801147C - cmp r4, 0x20 - ble _08011426 - b _080115DE -_08011426: - cmp r4, 0 - beq _0801146E - b _080115DE -_0801142C: - cmp r4, 0x24 - beq _080114BA - cmp r4, 0x24 - blt _080114B0 - cmp r4, 0x25 - beq _08011504 - cmp r4, 0x30 - beq _0801150E - b _080115DE -_0801143E: - cmp r4, 0x44 - bgt _08011454 - cmp r4, 0x42 - blt _08011448 - b _080115DE -_08011448: - cmp r4, 0x33 - beq _08011522 - cmp r4, 0x33 - bge _08011452 - b _0801158C -_08011452: - b _080115DE -_08011454: - cmp r4, 0xF3 - bne _0801145A - b _080115AC -_0801145A: - cmp r4, 0xF3 - bgt _08011466 - cmp r4, 0xF0 - bge _08011464 - b _080115DE -_08011464: - b _080115C4 -_08011466: - cmp r4, 0xFF - bne _0801146C - b _080115C4 -_0801146C: - b _080115DE -_0801146E: - ldr r1, =0x03005000 - movs r0, 0x6 - strh r0, [r1, 0x4] - b _080115DE - .pool -_0801147C: - ldr r0, =0x03005000 - ldr r1, =0x03004140 - ldrh r1, [r1, 0x14] - ldr r2, =0x00000ccd - adds r0, r2 - b _080115DC - .pool -_08011494: - ldr r0, =0x03005000 - ldr r1, =0x03004140 - ldrh r1, [r1, 0x14] - ldr r2, =0x00000c3e - adds r0, r2 - ldrb r2, [r0] - b _080115DC - .pool -_080114B0: - movs r0, 0x2 - adds r1, r4, 0 - bl sub_8011A64 - b _080115DE -_080114BA: - ldr r4, =0x03005000 - movs r1, 0 - movs r0, 0xB - strh r0, [r4, 0x4] - ldr r2, =0x00000c85 - adds r0, r4, r2 - strb r1, [r0] - ldr r0, =0x00000c86 - adds r2, r4, r0 - strb r1, [r2] - ldr r1, =0x00000c3e - adds r5, r4, r1 - ldrb r1, [r5] - movs r0, 0x20 - movs r3, 0x1 - bl rfu_setRecvBuffer - ldrb r1, [r5] - ldr r2, =0x00000c3f - adds r4, r2 - movs r0, 0x10 - adds r2, r4, 0 - movs r3, 0x46 - bl rfu_setRecvBuffer - b _080115DE - .pool -_08011504: - movs r0, 0x2 - movs r1, 0x25 - bl sub_8011A64 - b _080115DE -_0801150E: - ldr r0, =0x03005000 - adds r2, r0, 0 - adds r2, 0xF0 - movs r1, 0x2 - strb r1, [r2] - ldr r1, =0x00000c86 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x6 - beq _080115DE -_08011522: - ldr r2, =0x03005000 - adds r1, r2, 0 - adds r1, 0xF0 - ldrb r0, [r1] - cmp r0, 0x2 - beq _08011532 - movs r0, 0x4 - strb r0, [r1] -_08011532: - ldr r1, =0x00000c86 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x9 - beq _08011544 - movs r0, 0x2 - adds r1, r4, 0 - bl sub_8011A64 -_08011544: - ldr r0, =gUnknown_082ED7FC - movs r1, 0x5 - movs r2, 0x5 - bl nullsub_5 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080115DE - adds r0, r4, 0 - bl sub_8011170 - b _080115DE - .pool -_08011570: - ldr r0, =0x03005000 - adds r0, 0xF0 - movs r1, 0x1 - strb r1, [r0] - ldr r0, =gUnknown_082ED814 - movs r1, 0x5 - movs r2, 0x5 - bl nullsub_5 - b _080115DE - .pool -_0801158C: - ldr r1, =0x03005000 - adds r2, r1, 0 - adds r2, 0xF0 - movs r0, 0x3 - strb r0, [r2] - ldr r2, =0x00000c3c - adds r1, r2 - ldrb r0, [r1] - movs r0, 0x1 - strb r0, [r1] - b _080115DE - .pool -_080115AC: - movs r0, 0x1 - movs r1, 0xF3 - bl sub_8011A64 - movs r0, 0xF3 - bl sub_8011170 - ldr r0, =0x03005000 - adds r0, 0xEF - b _080115DA - .pool -_080115C4: - movs r0, 0x1 - adds r1, r4, 0 - bl sub_8011A64 - adds r0, r4, 0 - bl sub_8011170 - ldr r0, =0x03005000 - ldr r1, =0x00000cdb - adds r0, r1 - ldrb r1, [r0] -_080115DA: - movs r1, 0x1 -_080115DC: - strb r1, [r0] -_080115DE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8011404 - - thumb_func_start sub_80115EC -sub_80115EC: @ 80115EC - push {r4-r6,lr} - adds r3, r0, 0 - movs r2, 0 - movs r6, 0x1 - ldr r0, =0x03005000 - ldr r4, =0x00000cea - adds r1, r0, r4 - movs r5, 0 - movs r4, 0xFF -_080115FE: - adds r0, r3, 0 - asrs r0, r2 - ands r0, r6 - cmp r0, 0 - beq _08011610 - strb r5, [r1] - ldrb r0, [r1, 0x4] - orrs r0, r4 - strb r0, [r1, 0x4] -_08011610: - adds r1, 0x1 - adds r2, 0x1 - cmp r2, 0x3 - ble _080115FE - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80115EC - - thumb_func_start sub_8011628 -sub_8011628: @ 8011628 - push {r4-r7,lr} - adds r5, r0, 0 - movs r3, 0 - movs r2, 0 - movs r4, 0x1 - ldr r6, =0x03007890 - movs r7, 0x7F -_08011636: - adds r0, r5, 0 - asrs r0, r2 - ands r0, r4 - cmp r0, 0 - beq _0801165C - lsls r1, r2, 5 - adds r1, 0x14 - ldr r0, [r6] - adds r0, r1 - ldrb r1, [r0, 0x10] - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0x45 - bne _0801165C - adds r0, r4, 0 - lsls r0, r2 - orrs r3, r0 - lsls r0, r3, 24 - lsrs r3, r0, 24 -_0801165C: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x3 - bls _08011636 - adds r0, r3, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8011628 - - thumb_func_start sub_8011674 -sub_8011674: @ 8011674 - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x25 - bne _08011680 - b _080118EC -_08011680: - cmp r4, 0x25 - bgt _080116C2 - cmp r4, 0x14 - bne _0801168A - b _08011804 -_0801168A: - cmp r4, 0x14 - bgt _080116A2 - cmp r4, 0x11 - beq _08011722 - cmp r4, 0x11 - ble _08011698 - b _08011A42 -_08011698: - cmp r4, 0 - beq _0801170C - cmp r4, 0x10 - beq _08011718 - b _08011A42 -_080116A2: - cmp r4, 0x22 - bne _080116A8 - b _08011868 -_080116A8: - cmp r4, 0x22 - bgt _080116B4 - cmp r4, 0x20 - bne _080116B2 - b _08011850 -_080116B2: - b _08011A42 -_080116B4: - cmp r4, 0x23 - bne _080116BA - b _08011884 -_080116BA: - cmp r4, 0x24 - bne _080116C0 - b _080118BA -_080116C0: - b _08011A42 -_080116C2: - cmp r4, 0x44 - bgt _080116F2 - cmp r4, 0x42 - blt _080116CC - b _08011A42 -_080116CC: - cmp r4, 0x32 - bne _080116D2 - b _08011914 -_080116D2: - cmp r4, 0x32 - bgt _080116E4 - cmp r4, 0x30 - bne _080116DC - b _08011940 -_080116DC: - cmp r4, 0x31 - bne _080116E2 - b _080118F6 -_080116E2: - b _08011A42 -_080116E4: - cmp r4, 0x33 - bne _080116EA - b _08011948 -_080116EA: - cmp r4, 0x40 - bne _080116F0 - b _080119FC -_080116F0: - b _08011A42 -_080116F2: - cmp r4, 0xF3 - bne _080116F8 - b _08011A0C -_080116F8: - cmp r4, 0xF3 - bgt _08011704 - cmp r4, 0xF0 - bge _08011702 - b _08011A42 -_08011702: - b _08011A28 -_08011704: - cmp r4, 0xFF - bne _0801170A - b _08011A28 -_0801170A: - b _08011A42 -_0801170C: - ldr r1, =0x03005000 - movs r0, 0x11 - strh r0, [r1, 0x4] - b _08011A42 - .pool -_08011718: - movs r0, 0x4 - movs r1, 0 - bl sub_8011A64 - b _08011A42 -_08011722: - bl sub_800F7DC - ldrb r1, [r0, 0xA] - movs r0, 0x7F - ands r0, r1 - cmp r0, 0x45 - bne _080117DC - ldr r5, =0x03005000 - ldr r1, =0x00000cd9 - adds r0, r5, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080117DC - ldr r0, =0x03004140 - ldrh r0, [r0, 0x14] - bl sub_8011628 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _080117A6 - adds r0, r4, 0 - bl sub_800E87C - movs r2, 0x1 - mov r12, r2 - mov r1, r12 - lsls r1, r0 - lsls r1, 24 - lsrs r1, 24 - ldr r7, =0x00000ce6 - adds r6, r5, r7 - ldrb r2, [r6] - cmp r2, 0 - bne _08011798 - ldr r0, =0x00000ce8 - adds r3, r5, r0 - ldrb r0, [r3] - cmp r0, 0 - bne _08011798 - subs r7, 0x1 - adds r0, r5, r7 - strb r1, [r0] - eors r1, r4 - orrs r1, r2 - strb r1, [r6] - mov r0, r12 - strb r0, [r3] - b _080117A6 - .pool -_08011798: - ldr r0, =0x03005000 - ldr r1, =0x00000ce6 - adds r0, r1 - ldrb r2, [r0] - adds r1, r4, 0 - orrs r1, r2 - strb r1, [r0] -_080117A6: - ldr r0, =0x03004140 - ldrh r1, [r0, 0x14] - cmp r4, r1 - beq _080117F6 - ldr r2, =0x03005000 - ldr r7, =0x00000ce3 - adds r3, r2, r7 - adds r0, r4, 0 - eors r0, r1 - ldrb r1, [r3] - orrs r0, r1 - strb r0, [r3] - ldr r0, =0x00000ce4 - adds r2, r0 - movs r0, 0x2 - strb r0, [r2] - b _080117F6 - .pool -_080117DC: - bl sub_800F7DC - ldrb r1, [r0, 0xA] - movs r0, 0x7F - ands r0, r1 - cmp r0, 0x54 - bne _080117F6 - ldr r0, =0x03004140 - ldrb r0, [r0] - bl rfu_REQ_disconnect - bl rfu_waitREQComplete -_080117F6: - ldr r0, =0x03004140 - ldrh r0, [r0, 0x14] - bl sub_80115EC - b _08011A42 - .pool -_08011804: - bl sub_800F7DC - ldrb r1, [r0, 0xA] - movs r0, 0x7F - ands r0, r1 - cmp r0, 0x45 - beq _08011836 - ldr r4, =0x03004140 - ldrb r0, [r4, 0x1] - cmp r0, 0x1 - bls _08011836 - ldrb r0, [r4, 0x14] - bl sub_800E87C - movs r1, 0x80 - lsls r1, 17 - lsls r1, r0 - lsrs r1, 24 - ldrb r0, [r4] - eors r1, r0 - adds r0, r1, 0 - bl rfu_REQ_disconnect - bl rfu_waitREQComplete -_08011836: - ldr r1, =0x03005000 - ldrh r0, [r1, 0x4] - cmp r0, 0xF - beq _08011840 - b _08011A42 -_08011840: - movs r0, 0x10 - strh r0, [r1, 0x4] - b _08011A42 - .pool -_08011850: - ldr r0, =0x03005000 - ldr r1, =0x03004140 - ldrh r1, [r1, 0x14] - ldr r2, =0x00000ccd - adds r0, r2 - b _08011A40 - .pool -_08011868: - ldr r0, =0x03005000 - ldr r1, =0x03004140 - ldrh r1, [r1, 0x14] - ldr r7, =0x00000c3e - adds r0, r7 - ldrb r2, [r0] - b _08011A40 - .pool -_08011884: - ldr r1, =0x03005000 - movs r0, 0x12 - strh r0, [r1, 0x4] - ldr r0, =0x00000ccf - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x1 - bhi _080118B0 - adds r0, 0x1 - strb r0, [r1] - ldr r0, =sub_801209C - movs r1, 0x2 - bl AddTask - b _08011A42 - .pool -_080118B0: - movs r0, 0x2 - movs r1, 0x23 - bl sub_8011A64 - b _08011A42 -_080118BA: - ldr r4, =0x03005000 - movs r0, 0xD - strh r0, [r4, 0x4] - movs r0, 0x3 - movs r1, 0 - bl sub_8011A64 - ldr r1, =0x00000c3e - adds r0, r4, r1 - ldrb r1, [r0] - ldr r2, =0x00000c3f - adds r4, r2 - movs r0, 0x10 - adds r2, r4, 0 - movs r3, 0x46 - bl rfu_setRecvBuffer - b _08011A42 - .pool -_080118EC: - movs r0, 0x2 - movs r1, 0x25 - bl sub_8011A64 - b _08011A42 -_080118F6: - ldr r0, =0x03004140 - ldrb r1, [r0] - ldrh r0, [r0, 0x14] - ands r1, r0 - cmp r1, 0 - bne _08011904 - b _08011A42 -_08011904: - ldr r0, =0x03005000 - adds r0, 0xF0 - movs r1, 0x1 - b _08011A40 - .pool -_08011914: - ldr r2, =0x03005000 - adds r1, r2, 0 - adds r1, 0xF0 - movs r0, 0x3 - strb r0, [r1] - ldr r0, =0x03007890 - ldr r0, [r0] - ldrb r0, [r0] - cmp r0, 0 - beq _0801192A - b _08011A42 -_0801192A: - ldr r7, =0x00000c3c - adds r0, r2, r7 - ldrb r1, [r0] - movs r1, 0x1 - b _08011A40 - .pool -_08011940: - ldr r0, =0x03005000 - adds r0, 0xF0 - movs r1, 0x2 - strb r1, [r0] -_08011948: - ldr r2, =0x03005000 - adds r1, r2, 0 - adds r1, 0xF0 - ldrb r0, [r1] - cmp r0, 0x2 - beq _08011958 - movs r0, 0x4 - strb r0, [r1] -_08011958: - ldrb r0, [r2, 0xC] - cmp r0, 0x1 - bne _08011996 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080119B4 - ldr r0, =0x00000ce2 - adds r2, r0 - ldr r0, =0x03004140 - ldrb r1, [r0, 0x14] - ldrb r0, [r2] - bics r0, r1 - strb r0, [r2] - cmp r0, 0 - bne _08011990 - adds r0, r4, 0 - bl sub_8011170 - b _080119B4 - .pool -_08011990: - bl sub_80111FC - b _080119B4 -_08011996: - ldr r1, =0x00000ce4 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x2 - beq _080119B4 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080119B4 - adds r0, r4, 0 - bl sub_8011170 - movs r0, 0 - bl sub_800C27C -_080119B4: - ldr r0, =0x03007890 - ldr r0, [r0] - ldrb r0, [r0] - cmp r0, 0xFF - bne _080119DA - ldr r0, =0x03004140 - ldrb r0, [r0, 0x7] - cmp r0, 0 - bne _080119DA - ldr r0, =sub_800EB44 - bl is_function_an_active_task - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080119DA - ldr r1, =0x03005000 - movs r0, 0x11 - strh r0, [r1, 0x4] -_080119DA: - movs r0, 0x2 - adds r1, r4, 0 - bl sub_8011A64 - b _08011A42 - .pool -_080119FC: - ldr r0, =0x03005000 - ldr r2, =0x00000ce3 - adds r0, r2 - b _08011A3E - .pool -_08011A0C: - movs r0, 0x1 - movs r1, 0xF3 - bl sub_8011A64 - movs r0, 0xF3 - bl sub_8011170 - ldr r0, =0x03005000 - adds r0, 0xEF - movs r1, 0x1 - b _08011A40 - .pool -_08011A28: - adds r0, r4, 0 - bl sub_8011170 - movs r0, 0x1 - adds r1, r4, 0 - bl sub_8011A64 - ldr r0, =0x03005000 - ldr r7, =0x00000cdb - adds r0, r7 - ldrb r1, [r0] -_08011A3E: - movs r1, 0 -_08011A40: - strb r1, [r0] -_08011A42: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8011674 - - thumb_func_start sub_8011A50 -sub_8011A50: @ 8011A50 - ldr r0, =0x03005000 - ldr r1, =0x00000ce4 - adds r0, r1 - movs r1, 0x2 - strb r1, [r0] - bx lr - .pool - thumb_func_end sub_8011A50 - - thumb_func_start sub_8011A64 -sub_8011A64: @ 8011A64 - ldr r2, =0x03005000 - adds r3, r2, 0 - adds r3, 0xF1 - strb r0, [r3] - strh r1, [r2, 0xA] - bx lr - .pool - thumb_func_end sub_8011A64 - - thumb_func_start sub_8011A74 -sub_8011A74: @ 8011A74 - ldr r0, =0x03005000 - adds r0, 0xF1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8011A74 - - thumb_func_start sub_8011A80 -sub_8011A80: @ 8011A80 - push {lr} - bl sub_8011A74 - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x1 - cmp r0, 0x1 - bls _08011A94 - movs r0, 0 - b _08011A96 -_08011A94: - movs r0, 0x1 -_08011A96: - pop {r1} - bx r1 - thumb_func_end sub_8011A80 - - thumb_func_start sub_8011A9C -sub_8011A9C: @ 8011A9C - ldr r0, =0x03005000 - ldr r1, =0x00000ce8 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8011A9C - - thumb_func_start sub_8011AB0 -sub_8011AB0: @ 8011AB0 - ldr r0, =0x03005000 - ldrb r0, [r0, 0xC] - bx lr - .pool - thumb_func_end sub_8011AB0 - - thumb_func_start rfu_syncVBlank__ -rfu_syncVBlank__: @ 8011ABC - push {lr} - bl rfu_syncVBlank_ - pop {r0} - bx r0 - thumb_func_end rfu_syncVBlank__ - - thumb_func_start sub_8011AC8 -sub_8011AC8: @ 8011AC8 - push {lr} - sub sp, 0x4 - movs r0, 0 - str r0, [sp] - ldr r1, =0x03003090 - ldr r2, =0x05000014 - mov r0, sp - bl CpuSet - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8011AC8 - - thumb_func_start sub_8011AE8 -sub_8011AE8: @ 8011AE8 - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_8011AE8 - - thumb_func_start sub_8011AFC -sub_8011AFC: @ 8011AFC - push {r4,lr} - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - bl clear_tasks - bl sub_80A1A74 - ldr r0, =sub_8011AE8 - bl SetVBlankCallback - bl sub_80093CC - lsls r0, 24 - cmp r0, 0 - beq _08011B70 - ldr r1, =0x020229c6 - ldr r2, =0x00001111 - adds r0, r2, 0 - strh r0, [r1] - bl sub_800B488 - bl sub_8009734 - ldr r0, =0x030022c0 - ldrh r0, [r0, 0x24] - bl SeedRng - movs r4, 0 -_08011B38: - bl GenerateRandomNumber - ldr r1, =0x03005d90 - ldr r1, [r1] - adds r1, 0xA - adds r1, r4 - strb r0, [r1] - adds r4, 0x1 - cmp r4, 0x3 - ble _08011B38 - movs r1, 0xAA - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - bl RunActiveTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - bl sub_8011BA4 - ldr r0, =sub_8011BF8 - bl SetMainCallback2 -_08011B70: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8011AFC - - thumb_func_start sub_8011B90 -sub_8011B90: @ 8011B90 - push {lr} - ldr r0, =sub_800EB44 - bl is_function_an_active_task - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8011B90 - - thumb_func_start sub_8011BA4 -sub_8011BA4: @ 8011BA4 - push {r4,lr} - ldr r4, =nullsub_89 - adds r0, r4, 0 - bl is_function_an_active_task - lsls r0, 24 - cmp r0, 0 - bne _08011BC2 - adds r0, r4, 0 - movs r1, 0 - bl AddTask - ldr r1, =0x03005000 - adds r1, 0x66 - strb r0, [r1] -_08011BC2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8011BA4 - - thumb_func_start sub_8011BD0 -sub_8011BD0: @ 8011BD0 - push {lr} - ldr r0, =nullsub_89 - bl is_function_an_active_task - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08011BEA - ldr r0, =0x03005000 - adds r0, 0x66 - ldrb r0, [r0] - bl remove_task -_08011BEA: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8011BD0 - - thumb_func_start sub_8011BF8 -sub_8011BF8: @ 8011BF8 - push {lr} - bl RunActiveTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_8011BF8 - - thumb_func_start sub_8011C10 -sub_8011C10: @ 8011C10 - push {r4-r6,lr} - adds r4, r0, 0 - ldr r1, =0x03005000 - movs r0, 0x1 - strb r0, [r1, 0xC] - bl sub_8010F48 - ldr r0, =sub_801120C - movs r1, 0 - bl sub_800BF4C - ldr r2, =0x02022b2c - adds r1, r2, 0 - ldr r0, =gUnknown_082ED608 - ldm r0!, {r3,r5,r6} - stm r1!, {r3,r5,r6} - ldm r0!, {r3,r5,r6} - stm r1!, {r3,r5,r6} - ldr r0, =gUnknown_082ED620 - subs r4, 0x1 - adds r4, r0 - ldrb r0, [r4] - strh r0, [r2, 0x2] - bl sub_800EE78 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8011C10 - - thumb_func_start sub_8011C5C -sub_8011C5C: @ 8011C5C - push {lr} - ldr r1, =0x03005000 - movs r0, 0 - strb r0, [r1, 0xC] - bl sub_8010F48 - ldr r0, =sub_8011404 - ldr r1, =sub_800ED34 - bl sub_800BF4C - bl sub_800EF00 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8011C5C - - thumb_func_start sub_8011C84 -sub_8011C84: @ 8011C84 - push {r4-r7,lr} - ldr r4, =0x03005000 - movs r5, 0 - movs r0, 0x2 - strb r0, [r4, 0xC] - bl sub_8010F48 - ldr r0, =sub_8011674 - movs r1, 0 - bl sub_800BF4C - ldr r2, =0x02022b2c - adds r1, r2, 0 - ldr r0, =gUnknown_082ED608 - ldm r0!, {r3,r6,r7} - stm r1!, {r3,r6,r7} - ldm r0!, {r3,r6,r7} - stm r1!, {r3,r6,r7} - strb r5, [r2, 0x11] - movs r0, 0x96 - lsls r0, 2 - strh r0, [r2, 0x12] - ldr r0, =sub_800EB44 - movs r1, 0x1 - bl AddTask - adds r4, 0x67 - strb r0, [r4] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8011C84 - - thumb_func_start sub_8011CD8 -sub_8011CD8: @ 8011CD8 - ldrb r1, [r0, 0x1] - lsls r1, 8 - ldrb r0, [r0] - orrs r0, r1 - bx lr - thumb_func_end sub_8011CD8 - - thumb_func_start sub_8011CE4 -sub_8011CE4: @ 8011CE4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - str r0, [sp] - lsls r1, 16 - lsrs r1, 16 - mov r10, r1 - movs r0, 0xFF - mov r9, r0 - movs r7, 0 - ldr r1, =0x03007890 - mov r8, r1 -_08011D02: - lsls r4, r7, 5 - adds r5, r4, 0 - adds r5, 0x14 - mov r1, r8 - ldr r0, [r1] - adds r0, r5 - adds r0, 0x8 - bl sub_8011CD8 - lsls r0, 16 - lsrs r6, r0, 16 - mov r1, r8 - ldr r0, [r1] - adds r0, r4 - ldrh r0, [r0, 0x18] - bl sub_8010454 - cmp r0, 0 - beq _08011D4C - mov r0, r8 - ldr r1, [r0] - adds r1, r5 - adds r1, 0x15 - ldr r0, [sp] - bl CompareString - cmp r0, 0 - bne _08011D4C - cmp r10, r6 - bne _08011D4C - mov r9, r7 - mov r1, r8 - ldr r0, [r1] - adds r0, r4 - ldrb r0, [r0, 0x16] - cmp r0, 0xFF - bne _08011D56 -_08011D4C: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x3 - bls _08011D02 -_08011D56: - 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 - .pool - thumb_func_end sub_8011CE4 - - thumb_func_start sub_8011D6C -sub_8011D6C: @ 8011D6C - push {r4-r6,lr} - adds r6, r0, 0 - lsls r0, r6, 24 - lsrs r0, 24 - bl rfu_REQ_disconnect - bl rfu_waitREQComplete - ldr r4, =0x03005000 - ldr r0, =0x00000ce2 - adds r5, r4, r0 - ldrb r0, [r5] - bics r0, r6 - strb r0, [r5] - ldr r1, =0x00000cda - adds r6, r4, r1 - ldrb r1, [r6] - movs r0, 0x1 - bl rfu_clearSlot - ldrb r0, [r5] - ldr r1, =0x00000c87 - adds r4, r1 - adds r1, r4, 0 - movs r2, 0x46 - bl rfu_UNI_setSendData - ldrb r0, [r5] - bl sub_800E87C - strb r0, [r6] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8011D6C - - thumb_func_start sub_8011DC0 -sub_8011DC0: @ 8011DC0 - push {lr} - lsls r1, 16 - lsrs r1, 16 - bl sub_8011CE4 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xFF - beq _08011DDA - movs r0, 0x1 - lsls r0, r1 - bl sub_8011D6C -_08011DDA: - pop {r0} - bx r0 - thumb_func_end sub_8011DC0 - - thumb_func_start sub_8011DE0 -sub_8011DE0: @ 8011DE0 - push {r4-r6,lr} - adds r4, r0, 0 - cmp r4, 0 - beq _08011E20 - movs r3, 0 - movs r2, 0 - ldr r5, =0x03005cde - adds r6, r5, 0x4 -_08011DF0: - adds r0, r2, r5 - ldrb r0, [r0] - cmp r0, r4 - bne _08011E0E - ldrb r0, [r6] - asrs r0, r2 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08011E0E - adds r0, r1, 0 - lsls r0, r2 - orrs r3, r0 - lsls r0, r3, 24 - lsrs r3, r0, 24 -_08011E0E: - adds r2, 0x1 - cmp r2, 0x3 - ble _08011DF0 - cmp r3, 0 - beq _08011E20 - adds r0, r3, 0 - movs r1, 0x2 - bl sub_8011E94 -_08011E20: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8011DE0 - - thumb_func_start sub_8011E2C -sub_8011E2C: @ 8011E2C - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r6, =0x03003110 - ldrh r0, [r6] - cmp r0, 0 - bne _08011E7A - ldr r5, =0x03005000 - ldr r1, =0x00000ce8 - adds r0, r5, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _08011E7A - movs r0, 0xED - lsls r0, 8 - bl sub_800FD14 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x8] - strh r1, [r6, 0x2] - ldrh r1, [r0, 0xA] - strh r1, [r6, 0x4] - ldr r1, =gUnknown_082ED695 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r0, r1 - ldrb r1, [r5, 0xD] - ldrb r0, [r0] - subs r1, r0 - strb r1, [r5, 0xD] - ldrb r0, [r5, 0xD] - strh r0, [r6, 0x6] - adds r0, r4, 0 - bl remove_task -_08011E7A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8011E2C - - thumb_func_start sub_8011E94 -sub_8011E94: @ 8011E94 - push {r4-r6,lr} - adds r4, r0, 0 - adds r6, r1, 0 - ldr r5, =sub_8011E2C - adds r0, r5, 0 - bl get_task_id_by_function - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - bne _08011ECC - adds r0, r5, 0 - movs r1, 0x5 - bl AddTask - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - strh r4, [r0, 0x8] - b _08011EDC - .pool -_08011ECC: - ldr r0, =0x03005e00 - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - orrs r4, r0 - strh r4, [r1, 0x8] -_08011EDC: - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - strh r6, [r0, 0xA] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8011E94 - - thumb_func_start sub_8011EF4 -sub_8011EF4: @ 8011EF4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - bl sub_800EE94 - lsls r0, 24 - cmp r0, 0 - beq _08011FA4 - adds r0, r4, 0 - adds r0, 0x10 - bl sub_8011CD8 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_8011CE4 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - beq _08011F8C - ldr r0, =0x03007890 - ldr r0, [r0] - lsls r1, r2, 5 - adds r0, r1 - ldrb r0, [r0, 0x16] - cmp r0, 0xFF - beq _08011F5C - ldr r0, =0x03005000 - ldr r1, =0x00000c3d - adds r0, r1 - strb r2, [r0] - bl sub_800EEBC - cmp r0, 0 - beq _08011FAA - b _08011F84 - .pool -_08011F5C: - bl sub_800F7DC - ldrb r1, [r0, 0xA] - movs r5, 0x7F - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0x15 - beq _08011FA4 - bl sub_800F7DC - ldrb r1, [r0, 0xA] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0x16 - beq _08011FA4 - movs r1, 0xE0 - lsls r1, 7 - movs r0, 0x2 - bl sub_8011A64 -_08011F84: - adds r0, r6, 0 - bl remove_task - b _08011FAA -_08011F8C: - ldrh r0, [r4, 0x1E] - adds r0, 0x1 - strh r0, [r4, 0x1E] - ldr r0, =0x03005000 - ldr r1, =0x00000c3d - adds r0, r1 - strb r2, [r0] - b _08011FAA - .pool -_08011FA4: - ldrh r0, [r4, 0x1E] - adds r0, 0x1 - strh r0, [r4, 0x1E] -_08011FAA: - movs r1, 0x1E - ldrsh r0, [r4, r1] - cmp r0, 0xF0 - ble _08011FC2 - movs r1, 0xE0 - lsls r1, 7 - movs r0, 0x2 - bl sub_8011A64 - adds r0, r6, 0 - bl remove_task -_08011FC2: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8011EF4 - - thumb_func_start sub_8011FC8 -sub_8011FC8: @ 8011FC8 - push {r4-r6,lr} - adds r6, r0, 0 - lsls r5, r1, 16 - lsrs r5, 16 - ldr r0, =0x03005000 - adds r0, 0xF1 - movs r1, 0 - strb r1, [r0] - ldr r0, =sub_8011EF4 - movs r1, 0x3 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =0x03005e08 - adds r4, r0 - adds r0, r4, 0 - adds r1, r6, 0 - bl CopyString - strh r5, [r4, 0x10] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8011FC8 - - thumb_func_start sub_801200C -sub_801200C: @ 801200C - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 16 - lsrs r5, r0, 16 - bl sub_800F7DC - ldrb r1, [r0, 0xA] - movs r2, 0x7F - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0x45 - bne _08012032 - ldrb r1, [r4, 0xA] - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0x45 - beq _08012092 -_0801202E: - movs r0, 0x1 - b _08012094 -_08012032: - ldrb r1, [r4, 0xA] - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0x40 - bne _0801202E - cmp r5, 0x44 - bne _08012092 - ldr r5, =0x0300510a - ldrh r0, [r5, 0x8] - ldr r3, =0x000003ff - adds r2, r3, 0 - ands r2, r0 - movs r0, 0xCE - lsls r0, 1 - cmp r2, r0 - bne _08012068 - ldrh r1, [r4, 0x8] - adds r0, r3, 0 - ands r0, r1 - cmp r0, r2 - beq _08012092 - b _0801202E - .pool -_08012068: - ldrh r1, [r4, 0x8] - adds r0, r3, 0 - ands r0, r1 - cmp r0, r2 - bne _0801202E - ldrb r2, [r4, 0xB] - movs r0, 0xFE - ldrb r3, [r5, 0xB] - adds r1, r0, 0 - ands r1, r2 - ands r0, r3 - cmp r1, r0 - bne _0801202E - ldrb r2, [r4, 0x9] - movs r0, 0xFC - ldrb r3, [r5, 0x9] - adds r1, r0, 0 - ands r1, r2 - ands r0, r3 - cmp r1, r0 - bne _0801202E -_08012092: - movs r0, 0 -_08012094: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_801200C - - thumb_func_start sub_801209C -sub_801209C: @ 801209C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r5, r0, 24 - mov r8, r5 - ldr r6, =0x03005000 - adds r0, r6, 0 - adds r0, 0xF1 - ldrb r0, [r0] - cmp r0, 0x4 - bne _080120BA - adds r0, r5, 0 - bl remove_task -_080120BA: - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - lsls r0, 16 - movs r1, 0x96 - lsls r1, 17 - cmp r0, r1 - ble _080120E4 - movs r1, 0xE0 - lsls r1, 7 - movs r0, 0x2 - bl sub_8011A64 - adds r0, r5, 0 - bl remove_task -_080120E4: - ldr r1, =0x00000ccd - adds r0, r6, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _0801217C - ldr r0, =0x03004140 - ldrb r0, [r0, 0x6] - cmp r0, 0 - bne _0801217C - movs r2, 0x86 - lsls r2, 1 - adds r0, r6, r2 - bl sub_8011CD8 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - ldr r2, =0x00000119 - adds r0, r6, r2 - bl sub_8011CE4 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - beq _0801217C - movs r1, 0xA - ldrsh r0, [r4, r1] - ldr r7, =0x03007890 - lsls r4, r2, 5 - adds r2, r4, 0 - adds r2, 0x14 - ldr r1, [r7] - adds r1, r2 - adds r1, 0x6 - bl sub_801200C - cmp r0, 0 - bne _0801216C - ldr r0, [r7] - adds r1, r0, r4 - ldrb r0, [r1, 0x16] - cmp r0, 0xFF - beq _0801217C - ldrh r0, [r1, 0x14] - movs r1, 0x5A - bl sub_800C12C - lsls r0, 24 - cmp r0, 0 - bne _0801217C - movs r0, 0xA - strh r0, [r6, 0x4] - adds r0, r5, 0 - bl remove_task - b _0801217C - .pool -_0801216C: - movs r1, 0xE0 - lsls r1, 7 - movs r0, 0x2 - bl sub_8011A64 - mov r0, r8 - bl remove_task -_0801217C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_801209C - - thumb_func_start sub_8012188 -sub_8012188: @ 8012188 - push {r4-r7,lr} - adds r3, r0, 0 - adds r5, r1, 0 - lsls r4, r2, 24 - lsrs r4, 24 - ldr r6, =0x03005000 - ldr r1, =0x00000ccf - adds r0, r6, r1 - movs r7, 0 - strb r7, [r0] - adds r0, r6, 0 - adds r0, 0xF1 - strb r7, [r0] - ldr r1, =0x00000119 - adds r0, r6, r1 - adds r1, r3, 0 - bl CopyString - movs r1, 0x85 - lsls r1, 1 - adds r0, r6, r1 - adds r1, r5, 0 - movs r2, 0xD - bl memcpy - bl sub_800D658 - ldr r0, =sub_801209C - movs r1, 0x2 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r5, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r5 - strh r4, [r1, 0xA] - ldr r0, =sub_800EB44 - bl get_task_id_by_function - lsls r0, 24 - lsrs r1, r0, 24 - adds r2, r1, 0 - cmp r4, 0x45 - bne _08012210 - cmp r1, 0xFF - beq _0801221E - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - movs r1, 0x1 - strh r1, [r0, 0x16] - b _0801221E - .pool -_08012210: - cmp r2, 0xFF - beq _0801221E - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r5 - strh r7, [r0, 0x16] -_0801221E: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8012188 - - thumb_func_start sub_8012224 -sub_8012224: @ 8012224 - push {lr} - ldr r0, =0x03005000 - adds r0, 0xF0 - ldrb r0, [r0] - cmp r0, 0x1 - beq _08012238 - movs r0, 0 - b _0801223A - .pool -_08012238: - movs r0, 0x1 -_0801223A: - pop {r1} - bx r1 - thumb_func_end sub_8012224 - - thumb_func_start sub_8012240 -sub_8012240: @ 8012240 - push {r4,lr} - movs r1, 0 - ldr r0, =0x03004140 - ldrb r2, [r0] - ldr r4, =0x03005cd1 - movs r3, 0x1 -_0801224C: - adds r0, r2, 0 - asrs r0, r1 - ands r0, r3 - cmp r0, 0 - beq _0801226C - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, 0 - bne _0801226C - movs r0, 0 - b _08012274 - .pool -_0801226C: - adds r1, 0x1 - cmp r1, 0x3 - ble _0801224C - movs r0, 0x1 -_08012274: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8012240 - - thumb_func_start sub_801227C -sub_801227C: @ 801227C - push {r4,lr} - movs r4, 0 -_08012280: - lsls r2, r4, 24 - lsrs r2, 24 - ldr r0, =gUnknown_082ED82C - movs r1, 0 - bl nullsub_5 - adds r4, 0x1 - cmp r4, 0x13 - ble _08012280 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801227C - - thumb_func_start sub_801229C -sub_801229C: @ 801229C - push {r4-r7,lr} - mov r7, r8 - push {r7} - bl sub_800A550 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1C - movs r2, 0x13 - movs r3, 0x2 - bl nullsub_13 - ldr r4, =0x03007890 - ldr r0, [r4] - ldrb r0, [r0, 0x2] - movs r1, 0x14 - movs r2, 0x1 - movs r3, 0x1 - bl nullsub_13 - ldr r0, [r4] - ldrb r0, [r0, 0x3] - movs r1, 0x17 - movs r2, 0x1 - movs r3, 0x1 - bl nullsub_13 - ldr r0, =0x03005000 - ldrb r0, [r0, 0xC] - cmp r0, 0x1 - bne _08012378 - movs r6, 0 - adds r7, r4, 0 - movs r5, 0x14 -_080122E0: - ldr r2, [r7] - ldrb r0, [r2, 0x7] - asrs r0, r6 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0801231E - lsls r0, r6, 5 - adds r0, r2, r0 - ldrh r0, [r0, 0x18] - adds r4, r6, 0x3 - lsls r4, 24 - lsrs r4, 24 - adds r2, r4, 0 - movs r3, 0x4 - bl nullsub_13 - ldr r0, [r7] - adds r0, r5 - adds r0, 0x6 - movs r1, 0x6 - adds r2, r4, 0 - bl nullsub_5 - ldr r0, [r7] - adds r0, r5 - adds r0, 0x15 - movs r1, 0x16 - adds r2, r4, 0 - bl nullsub_5 -_0801231E: - adds r5, 0x20 - adds r6, 0x1 - cmp r6, 0x3 - ble _080122E0 - movs r6, 0 - ldr r0, =0x03005000 - mov r8, r0 -_0801232C: - movs r5, 0 - adds r7, r6, 0x1 - lsls r0, r6, 3 - adds r2, r6, 0 - adds r2, 0xB - subs r0, r6 - lsls r0, 1 - mov r1, r8 - adds r1, 0x14 - adds r4, r0, r1 - lsls r6, r2, 24 -_08012342: - ldrb r0, [r4] - lsls r1, r5, 25 - lsrs r1, 24 - lsrs r2, r6, 24 - movs r3, 0x2 - bl nullsub_13 - adds r4, 0x1 - adds r5, 0x1 - cmp r5, 0xD - ble _08012342 - adds r6, r7, 0 - cmp r6, 0x3 - ble _0801232C - ldr r0, =gUnknown_082ED868 - movs r1, 0x1 - movs r2, 0xF - bl nullsub_5 - b _080124AA - .pool -_08012378: - ldr r1, [r4] - ldrb r0, [r1, 0x2] - cmp r0, 0 - beq _08012414 - ldrb r0, [r1, 0x7] - cmp r0, 0 - beq _08012414 - movs r6, 0 - movs r5, 0xC0 - lsls r5, 18 -_0801238C: - lsrs r4, r5, 24 - movs r0, 0 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x4 - bl nullsub_13 - ldr r0, =gUnknown_082ED84B - movs r1, 0x6 - adds r2, r4, 0 - bl nullsub_5 - ldr r0, =gUnknown_082ED85B - movs r1, 0x16 - adds r2, r4, 0 - bl nullsub_5 - movs r1, 0x80 - lsls r1, 17 - adds r5, r1 - adds r6, 0x1 - cmp r6, 0x3 - ble _0801238C - ldr r5, =0x03007890 - ldr r1, [r5] - ldr r4, =0x03005000 - ldr r0, =0x00000c3e - adds r4, r0 - ldrb r0, [r4] - lsls r0, 5 - adds r1, r0 - ldrh r0, [r1, 0x18] - movs r1, 0x1 - movs r2, 0x3 - movs r3, 0x4 - bl nullsub_13 - ldrb r1, [r4] - lsls r1, 5 - adds r1, 0x14 - ldr r0, [r5] - adds r0, r1 - adds r0, 0x6 - movs r1, 0x6 - movs r2, 0x3 - bl nullsub_5 - ldrb r1, [r4] - lsls r1, 5 - adds r1, 0x14 - ldr r0, [r5] - adds r0, r1 - adds r0, 0x15 - movs r1, 0x16 - movs r2, 0x3 - bl nullsub_5 - b _080124AA - .pool -_08012414: - movs r6, 0 - ldr r1, =0x03007890 - ldr r0, [r1] - ldrb r0, [r0, 0x8] - cmp r6, r0 - bge _08012470 - adds r7, r1, 0 - movs r1, 0x14 - mov r8, r1 -_08012426: - ldr r0, [r7] - lsls r5, r6, 5 - adds r1, r0, r5 - ldrb r0, [r1, 0x16] - cmp r0, 0xFF - beq _08012462 - ldrh r0, [r1, 0x18] - adds r4, r6, 0x3 - lsls r4, 24 - lsrs r4, 24 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x4 - bl nullsub_13 - ldr r0, [r7] - adds r0, r5 - ldrh r0, [r0, 0x14] - movs r1, 0x6 - adds r2, r4, 0 - movs r3, 0x4 - bl nullsub_13 - ldr r0, [r7] - add r0, r8 - adds r0, 0x15 - movs r1, 0x16 - adds r2, r4, 0 - bl nullsub_5 -_08012462: - movs r0, 0x20 - add r8, r0 - adds r6, 0x1 - ldr r0, [r7] - ldrb r0, [r0, 0x8] - cmp r6, r0 - blt _08012426 -_08012470: - cmp r6, 0x3 - bgt _080124AA - lsls r0, r6, 24 - movs r1, 0xC0 - lsls r1, 18 - adds r5, r0, r1 -_0801247C: - lsrs r4, r5, 24 - movs r0, 0 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x4 - bl nullsub_13 - ldr r0, =gUnknown_082ED84B - movs r1, 0x6 - adds r2, r4, 0 - bl nullsub_5 - ldr r0, =gUnknown_082ED85B - movs r1, 0x16 - adds r2, r4, 0 - bl nullsub_5 - movs r0, 0x80 - lsls r0, 17 - adds r5, r0 - adds r6, 0x1 - cmp r6, 0x3 - ble _0801247C -_080124AA: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801229C - - thumb_func_start sub_80124C0 -sub_80124C0: @ 80124C0 - ldr r0, =0x03005000 - ldr r1, =0x00000c1a - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_80124C0 - - thumb_func_start sub_80124D4 -sub_80124D4: @ 80124D4 - ldr r0, =0x03005000 - ldr r1, =0x000009e6 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_80124D4 - - thumb_func_start nullsub_89 -nullsub_89: @ 80124E8 - bx lr - thumb_func_end nullsub_89 - - thumb_func_start sub_80124EC -sub_80124EC: @ 80124EC - push {r4-r6,lr} - sub sp, 0x8 - adds r4, r1, 0 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r2, 24 - lsrs r5, r2, 24 - adds r0, r6, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - lsls r4, 8 - movs r0, 0x90 - lsls r0, 6 - cmp r4, r0 - beq _08012588 - cmp r4, r0 - bgt _08012526 - movs r0, 0x80 - lsls r0, 2 - cmp r4, r0 - beq _08012538 - movs r0, 0x80 - lsls r0, 3 - cmp r4, r0 - beq _08012544 - b _080125A6 -_08012526: - movs r0, 0x94 - lsls r0, 6 - cmp r4, r0 - beq _08012554 - movs r0, 0xD4 - lsls r0, 6 - cmp r4, r0 - beq _08012564 - b _080125A6 -_08012538: - ldr r1, =gUnknown_082EDB60 - subs r0, r5, 0x1 - lsls r0, 2 - b _0801256C - .pool -_08012544: - ldr r1, =gUnknown_082EDB60 - subs r0, r5, 0x1 - lsls r0, 2 - adds r1, 0x14 - b _0801256C - .pool -_08012554: - ldr r1, =gUnknown_082EDB60 - subs r0, r5, 0x1 - lsls r0, 2 - adds r1, 0x28 - b _0801256C - .pool -_08012564: - ldr r1, =gUnknown_082EDB60 - subs r0, r5, 0x1 - lsls r0, 2 - adds r1, 0x3C -_0801256C: - adds r0, r1 - ldr r2, [r0] - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - adds r0, r6, 0 - movs r1, 0x1 - movs r3, 0 - bl sub_80173E0 - b _080125A6 - .pool -_08012588: - ldr r1, =gUnknown_082EDB60 - subs r0, r5, 0x1 - lsls r0, 2 - adds r1, 0x50 - adds r0, r1 - ldr r2, [r0] - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - adds r0, r6, 0 - movs r1, 0x1 - movs r3, 0 - bl sub_80173E0 -_080125A6: - adds r0, r6, 0 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80124EC - - thumb_func_start sub_80125BC -sub_80125BC: @ 80125BC - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x28 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r6, =0x03005d90 - ldr r2, [r6] - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - mov r8, r0 - str r0, [sp, 0x4] - adds r0, r4, 0 - movs r1, 0x1 - movs r3, 0 - bl sub_80173E0 - ldr r1, =gUnknown_082ED8CC - add r0, sp, 0x8 - bl CopyString - adds r5, r0, 0 - ldr r0, [r6] - adds r0, 0xA - bl sub_8015658 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r5, 0 - movs r2, 0x2 - movs r3, 0x5 - bl ConvertIntToDecimalString - movs r0, 0x11 - str r0, [sp] - mov r0, r8 - str r0, [sp, 0x4] - adds r0, r4, 0 - movs r1, 0x1 - add r2, sp, 0x8 - movs r3, 0 - bl sub_80173E0 - add sp, 0x28 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80125BC - - thumb_func_start sub_801262C -sub_801262C: @ 801262C - push {lr} - lsls r1, 24 - lsrs r1, 24 - subs r0, r1, 0x1 - cmp r0, 0x1B - bhi _080126C0 - lsls r0, 2 - ldr r1, =_08012648 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08012648: - .4byte _080126B8 - .4byte _080126B8 - .4byte _080126B8 - .4byte _080126B8 - .4byte _080126C0 - .4byte _080126C0 - .4byte _080126C0 - .4byte _080126C0 - .4byte _080126B8 - .4byte _080126B8 - .4byte _080126B8 - .4byte _080126C0 - .4byte _080126C0 - .4byte _080126B8 - .4byte _080126B8 - .4byte _080126B8 - .4byte _080126C0 - .4byte _080126C0 - .4byte _080126C0 - .4byte _080126C0 - .4byte _080126B8 - .4byte _080126B8 - .4byte _080126B8 - .4byte _080126B8 - .4byte _080126B8 - .4byte _080126B8 - .4byte _080126B8 - .4byte _080126B8 -_080126B8: - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_082ED960 - bl ExpandStringRefs -_080126C0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_801262C - - thumb_func_start sub_80126CC -sub_80126CC: @ 80126CC - push {lr} - subs r0, 0x9 - cmp r0, 0x12 - bhi _08012734 - lsls r0, 2 - ldr r1, =_080126E4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080126E4: - .4byte _08012730 - .4byte _08012730 - .4byte _08012730 - .4byte _08012734 - .4byte _08012734 - .4byte _08012734 - .4byte _08012730 - .4byte _08012730 - .4byte _08012734 - .4byte _08012734 - .4byte _08012734 - .4byte _08012734 - .4byte _08012734 - .4byte _08012734 - .4byte _08012730 - .4byte _08012730 - .4byte _08012730 - .4byte _08012730 - .4byte _08012730 -_08012730: - movs r0, 0x1 - b _08012736 -_08012734: - movs r0, 0 -_08012736: - pop {r1} - bx r1 - thumb_func_end sub_80126CC - - thumb_func_start BerryBlenderLinkBecomeLeader -BerryBlenderLinkBecomeLeader: @ 801273C - push {lr} - ldr r0, =sub_8012780 - movs r1, 0 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02022c30 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r1, r0 - str r1, [r2] - ldr r0, =0x03000da0 - str r1, [r0] - movs r0, 0 - strb r0, [r1, 0xC] - strb r0, [r1, 0xD] - ldr r1, =0x020375f0 - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end BerryBlenderLinkBecomeLeader - - thumb_func_start sub_8012780 -sub_8012780: @ 8012780 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02022c30 - ldr r6, [r0] - ldrb r0, [r6, 0xC] - cmp r0, 0x1E - bls _0801279A - bl _08012F50 -_0801279A: - lsls r0, 2 - ldr r1, =_080127AC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080127AC: - .4byte _08012828 - .4byte _08012F50 - .4byte _08012F50 - .4byte _080128A0 - .4byte _080129C8 - .4byte _08012A50 - .4byte _08012A6C - .4byte _08012B8C - .4byte _08012F50 - .4byte _08012AFC - .4byte _08012B14 - .4byte _08012BA8 - .4byte _08012C5C - .4byte _08012D5A - .4byte _08012D78 - .4byte _08012D8A - .4byte _08012DA8 - .4byte _08012E62 - .4byte _08012E78 - .4byte _08012DF2 - .4byte _08012E10 - .4byte _08012ED0 - .4byte _08012EFC - .4byte _08012ED0 - .4byte _08012EE6 - .4byte _08012F50 - .4byte _08012F14 - .4byte _08012F50 - .4byte _08012F50 - .4byte _08012B54 - .4byte _08012EB6 -_08012828: - ldr r0, =0x020375e0 - ldrh r2, [r0] - adds r3, r0, 0 - cmp r2, 0x14 - bne _08012848 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x1 - bne _08012848 - adds r0, r2, 0x1 - strh r0, [r3] -_08012848: - ldr r2, =0x02022c2c - ldr r1, =gUnknown_082F00C4 - ldrh r0, [r3] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - strb r0, [r2] - ldr r4, =0x02022c2d - ldrh r0, [r3] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - lsrs r0, 8 - strb r0, [r4] - ldrb r0, [r2] - movs r1, 0 - movs r2, 0 - bl sub_8010F84 - bl sub_800B488 - bl sub_8009734 - ldrb r1, [r4] - movs r0, 0xF - ands r0, r1 - bl sub_8011C10 - movs r0, 0x3 - strb r0, [r6, 0xC] - b _08012F50 - .pool -_080128A0: - movs r0, 0x70 - bl AllocZeroed - str r0, [r6, 0x4] - movs r0, 0xA0 - bl AllocZeroed - str r0, [r6] - movs r0, 0xA0 - bl AllocZeroed - str r0, [r6, 0x8] - ldr r0, [r6, 0x4] - movs r1, 0x4 - bl sub_80175EC - ldr r0, [r6] - movs r1, 0x5 - bl sub_8017580 - ldr r0, [r6] - adds r1, r0, 0 - adds r1, 0x10 - bl sub_800DF90 - ldr r1, [r6] - movs r3, 0 - movs r0, 0 - strh r0, [r1, 0x18] - ldr r2, [r6] - ldrb r1, [r2, 0x1A] - subs r0, 0x4 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x1A] - ldr r2, [r6] - ldrb r1, [r2, 0x1A] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x1A] - ldr r0, [r6] - strb r3, [r0, 0x1B] - ldr r0, [r6, 0x4] - movs r1, 0xFF - bl sub_8016FC0 - strb r0, [r6, 0x17] - ldr r0, =gUnknown_082F00BC - bl AddWindow - strb r0, [r6, 0x10] - ldr r0, =0x02022c2d - ldrb r0, [r0] - movs r1, 0xF - ands r1, r0 - cmp r1, 0x2 - blt _08012938 - cmp r1, 0x4 - ble _08012928 - cmp r1, 0x5 - beq _08012930 - b _08012938 - .pool -_08012928: - ldr r0, =gUnknown_082F011C - b _08012932 - .pool -_08012930: - ldr r0, =gUnknown_082F0124 -_08012932: - bl AddWindow - strb r0, [r6, 0xF] -_08012938: - ldr r0, =gUnknown_082F012C - bl AddWindow - strb r0, [r6, 0x11] - ldrb r0, [r6, 0x10] - movs r1, 0x22 - bl FillWindowPixelBuffer - ldrb r0, [r6, 0x10] - ldr r2, =gUnknown_082EDBC4 - movs r3, 0x1 - mov r8, r3 - str r3, [sp] - movs r4, 0x4 - str r4, [sp, 0x4] - movs r1, 0 - movs r3, 0x8 - bl sub_80173E0 - ldrb r0, [r6, 0x10] - bl PutWindowTilemap - ldrb r0, [r6, 0x10] - movs r1, 0x2 - bl CopyWindowToVram - ldrb r0, [r6, 0xF] - movs r1, 0 - bl sub_81973FC - ldr r0, =0x03006310 - adds r2, r0, 0 - ldr r1, =gUnknown_082F015C - ldm r1!, {r3,r5,r7} - stm r2!, {r3,r5,r7} - ldm r1!, {r3,r5,r7} - stm r2!, {r3,r5,r7} - ldrb r1, [r6, 0xF] - strb r1, [r0, 0x10] - movs r1, 0 - movs r2, 0 - bl ListMenuInit - strb r0, [r6, 0x12] - ldrb r0, [r6, 0x11] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r6, 0x11] - bl PutWindowTilemap - ldrb r0, [r6, 0x11] - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0 - bl CopyBgTilemapBufferToVram - mov r5, r8 - strb r5, [r6, 0x13] - strb r4, [r6, 0xC] - b _08012F50 - .pool -_080129C8: - ldr r0, =0x02021cc4 - ldr r2, =gUnknown_082F0048 - ldr r4, =0x02022c2c - ldrb r1, [r4] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl CopyString - ldr r0, =0x02022c2d - ldrb r2, [r0] - lsrs r0, r2, 4 - cmp r0, 0 - beq _08012A2C - ldrb r1, [r6, 0x13] - subs r0, 0x1 - cmp r1, r0 - ble _08012A18 - movs r0, 0xF - ands r0, r2 - cmp r0, 0 - beq _08012A18 - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_082ED990 - bl ExpandStringRefs - b _08012A34 - .pool -_08012A18: - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_082ED960 - bl ExpandStringRefs - b _08012A34 - .pool -_08012A2C: - ldr r0, =0x02021fc4 - ldrb r1, [r4] - bl sub_801262C -_08012A34: - ldrb r0, [r6, 0x11] - ldr r1, =0x02022c2d - ldrb r1, [r1] - ldrb r2, [r6, 0x13] - bl sub_80124EC - movs r0, 0x5 - strb r0, [r6, 0xC] - b _08012F50 - .pool -_08012A50: - adds r0, r6, 0 - adds r0, 0xD - ldr r1, =0x02021fc4 - bl sub_8017064 - lsls r0, 24 - cmp r0, 0 - bne _08012A62 - b _08012F50 -_08012A62: - movs r0, 0x6 - strb r0, [r6, 0xC] - b _08012F50 - .pool -_08012A6C: - adds r0, r6, 0 - movs r1, 0x7 - movs r2, 0xA - bl sub_801320C - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08012AA8 - ldrb r0, [r6, 0x13] - cmp r0, 0x1 - bne _08012A90 - movs r0, 0x17 - b _08012AA6 - .pool -_08012A90: - ldr r0, =0x02022c2d - ldrb r1, [r0] - movs r0, 0xF0 - ands r0, r1 - cmp r0, 0 - beq _08012AA4 - movs r0, 0x1E - b _08012AA6 - .pool -_08012AA4: - movs r0, 0x13 -_08012AA6: - strb r0, [r6, 0xC] -_08012AA8: - ldr r0, =0x02022c2d - ldrb r2, [r0] - lsrs r0, r2, 4 - cmp r0, 0 - beq _08012ADE - ldrb r1, [r6, 0x13] - subs r0, 0x1 - cmp r1, r0 - ble _08012ADE - movs r4, 0xF - adds r0, r4, 0 - ands r0, r2 - cmp r0, 0 - beq _08012ADE - bl sub_8012240 - cmp r0, 0 - beq _08012ADE - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _08012ADE - strb r4, [r6, 0xC] - bl sub_800EF38 -_08012ADE: - ldrb r0, [r6, 0xC] - cmp r0, 0x6 - beq _08012AE6 - b _08012F50 -_08012AE6: - bl sub_80105EC - cmp r0, 0 - bne _08012AF0 - b _08012F50 -_08012AF0: - b _08012C56 - .pool -_08012AFC: - bl sub_80105EC - cmp r0, 0 - beq _08012B06 - b _08012F50 -_08012B06: - movs r0, 0x6 - strb r0, [r6, 0xC] - ldr r0, [r6] - bl sub_8013398 - strb r0, [r6, 0x13] - b _08012F50 -_08012B14: - movs r3, 0 - ldr r0, =0x02022c2c - ldrb r1, [r0] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x2 - bne _08012B24 - movs r3, 0x1 -_08012B24: - adds r0, r6, 0 - adds r0, 0xD - ldr r2, =gUnknown_082EDDC4 - lsls r1, r3, 2 - adds r1, r2 - ldr r1, [r1] - bl sub_8017064 - lsls r0, 24 - cmp r0, 0 - bne _08012B3C - b _08012F50 -_08012B3C: - ldr r0, [r6] - bl sub_8013398 - strb r0, [r6, 0x13] - ldrb r0, [r6, 0x12] - bl sub_81AE70C - b _08012E5C - .pool -_08012B54: - ldr r0, =0x02022c2d - ldrb r0, [r0] - movs r1, 0xF - ands r1, r0 - movs r0, 0x2 - eors r1, r0 - negs r0, r1 - orrs r0, r1 - lsrs r3, r0, 31 - adds r0, r6, 0 - adds r0, 0xD - ldr r2, =gUnknown_082EDDC4 - lsls r1, r3, 2 - adds r1, r2 - ldr r1, [r1] - bl sub_8017064 - lsls r0, 24 - cmp r0, 0 - bne _08012B7E - b _08012F50 -_08012B7E: - movs r0, 0x15 - strb r0, [r6, 0xC] - b _08012F50 - .pool -_08012B8C: - adds r0, r6, 0 - adds r0, 0xD - ldr r1, =0x02021fc4 - bl sub_8017064 - lsls r0, 24 - cmp r0, 0 - bne _08012B9E - b _08012F50 -_08012B9E: - movs r0, 0xB - strb r0, [r6, 0xC] - b _08012F50 - .pool -_08012BA8: - adds r4, r6, 0 - adds r4, 0xD - ldrb r1, [r6, 0x13] - lsls r1, 5 - ldr r0, [r6] - adds r0, r1 - adds r0, 0x2 - bl sub_8015658 - lsls r0, 16 - lsrs r0, 16 - ldrb r2, [r6, 0x13] - lsls r2, 5 - ldr r1, [r6] - adds r1, r2 - adds r1, 0x10 - bl sub_801064C - adds r1, r0, 0 - adds r0, r4, 0 - bl sub_80170B8 - lsls r0, 24 - asrs r1, r0, 24 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08012C28 - cmp r1, r0 - bgt _08012BEC - subs r0, 0x2 - cmp r1, r0 - beq _08012C56 - b _08012F50 -_08012BEC: - cmp r1, 0 - beq _08012BF6 - cmp r1, 0x1 - beq _08012C28 - b _08012F50 -_08012BF6: - bl sub_800E0E8 - movs r0, 0 - movs r1, 0 - bl sub_800DFB4 - movs r0, 0x5 - strb r0, [r6, 0x19] - ldrb r1, [r6, 0x13] - lsls r1, 5 - ldr r0, [r6] - adds r0, r1 - adds r0, 0x2 - bl sub_8015658 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - ldrb r0, [r6, 0x13] - lsls r0, 5 - ldr r2, [r6] - adds r2, r0 - adds r2, 0x10 - movs r0, 0x5 - b _08012C4C -_08012C28: - movs r0, 0x6 - strb r0, [r6, 0x19] - ldrb r1, [r6, 0x13] - lsls r1, 5 - ldr r0, [r6] - adds r0, r1 - adds r0, 0x2 - bl sub_8015658 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - ldrb r0, [r6, 0x13] - lsls r0, 5 - ldr r2, [r6] - adds r2, r0 - adds r2, 0x10 - movs r0, 0x6 -_08012C4C: - bl sub_8010688 - movs r0, 0xC - strb r0, [r6, 0xC] - b _08012F50 -_08012C56: - movs r0, 0x9 - strb r0, [r6, 0xC] - b _08012F50 -_08012C5C: - ldrb r1, [r6, 0x13] - lsls r1, 5 - ldr r0, [r6] - adds r0, r1 - adds r0, 0x2 - bl sub_8015658 - lsls r0, 16 - lsrs r0, 16 - ldrb r2, [r6, 0x13] - lsls r2, 5 - ldr r1, [r6] - adds r1, r2 - adds r1, 0x10 - bl sub_8010714 - cmp r0, 0x1 - bne _08012D4A - ldrb r0, [r6, 0x19] - cmp r0, 0x5 - bne _08012D04 - ldr r1, [r6] - ldrb r0, [r6, 0x13] - lsls r0, 5 - adds r1, r0 - movs r0, 0 - strb r0, [r1, 0x1B] - ldrb r0, [r6, 0x12] - bl sub_81AE70C - ldrb r0, [r6, 0x13] - adds r0, 0x1 - strb r0, [r6, 0x13] - ldr r1, =0x02022c2d - ldrb r1, [r1] - movs r3, 0xF - lsls r0, 24 - lsrs r2, r0, 24 - adds r0, r3, 0 - ands r0, r1 - cmp r2, r0 - bne _08012D40 - movs r0, 0xF0 - ands r0, r1 - cmp r0, 0 - bne _08012CBC - cmp r2, 0x4 - bne _08012CC4 -_08012CBC: - strb r3, [r6, 0xC] - b _08012CE0 - .pool -_08012CC4: - ldr r0, =0x02021cc4 - ldrb r2, [r6, 0x13] - lsls r2, 5 - subs r2, 0x20 - ldr r1, [r6] - adds r1, r2 - bl sub_8018404 - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_082EDC9C - bl ExpandStringRefs - movs r0, 0xD - strb r0, [r6, 0xC] -_08012CE0: - bl sub_800EF38 - ldrb r0, [r6, 0x11] - ldr r1, =0x02022c2d - ldrb r1, [r1] - ldrb r2, [r6, 0x13] - bl sub_80124EC - b _08012D44 - .pool -_08012D04: - ldrb r1, [r6, 0x13] - lsls r1, 5 - ldr r0, [r6] - adds r0, r1 - adds r4, r0, 0 - adds r4, 0x10 - adds r0, 0x2 - bl sub_8015658 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_8011DC0 - ldr r1, [r6] - ldrb r0, [r6, 0x13] - lsls r0, 5 - adds r1, r0 - ldrb r2, [r1, 0x1A] - movs r0, 0x4 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1A] - ldr r0, [r6] - bl sub_8013398 - ldrb r0, [r6, 0x12] - bl sub_81AE70C -_08012D40: - movs r0, 0x4 - strb r0, [r6, 0xC] -_08012D44: - movs r0, 0 - strb r0, [r6, 0x19] - b _08012F50 -_08012D4A: - cmp r0, 0x2 - beq _08012D50 - b _08012F50 -_08012D50: - movs r0, 0 - movs r1, 0 - bl sub_8011A64 - b _08012E5C -_08012D5A: - adds r0, r6, 0 - adds r0, 0xD - ldr r1, =0x02021fc4 - bl sub_8017064 - lsls r0, 24 - cmp r0, 0 - bne _08012D6C - b _08012F50 -_08012D6C: - movs r0, 0xE - strb r0, [r6, 0xC] - b _08012F50 - .pool -_08012D78: - ldrb r0, [r6, 0xE] - adds r0, 0x1 - strb r0, [r6, 0xE] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x78 - bhi _08012D88 - b _08012F50 -_08012D88: - b _08012DCE -_08012D8A: - adds r0, r6, 0 - adds r0, 0xD - ldr r1, =gUnknown_082EDC5C - bl sub_8017064 - lsls r0, 24 - cmp r0, 0 - bne _08012D9C - b _08012F50 -_08012D9C: - movs r0, 0x10 - strb r0, [r6, 0xC] - b _08012F50 - .pool -_08012DA8: - adds r0, r6, 0 - adds r0, 0xD - movs r1, 0 - bl sub_80170B8 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _08012DCE - cmp r1, 0 - bgt _08012DC8 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08012DD4 - b _08012F50 -_08012DC8: - cmp r1, 0x1 - beq _08012DD4 - b _08012F50 -_08012DCE: - movs r0, 0x11 - strb r0, [r6, 0xC] - b _08012F50 -_08012DD4: - ldr r0, =0x02022c2d - ldrb r1, [r0] - movs r0, 0xF0 - ands r0, r1 - cmp r0, 0 - beq _08012DEC - movs r0, 0x1E - strb r0, [r6, 0xC] - b _08012F50 - .pool -_08012DEC: - movs r0, 0x13 - strb r0, [r6, 0xC] - b _08012F50 -_08012DF2: - adds r0, r6, 0 - adds r0, 0xD - ldr r1, =gUnknown_082EDC78 - bl sub_8017064 - lsls r0, 24 - cmp r0, 0 - bne _08012E04 - b _08012F50 -_08012E04: - movs r0, 0x14 - strb r0, [r6, 0xC] - b _08012F50 - .pool -_08012E10: - adds r0, r6, 0 - adds r0, 0xD - movs r1, 0 - bl sub_80170B8 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _08012EC6 - cmp r1, 0 - bgt _08012E30 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08012E36 - b _08012F50 -_08012E30: - cmp r1, 0x1 - beq _08012E36 - b _08012F50 -_08012E36: - ldr r0, =0x02022c2d - ldrb r2, [r0] - movs r0, 0xF0 - ands r0, r2 - cmp r0, 0 - beq _08012E4C - movs r0, 0xF - strb r0, [r6, 0xC] - b _08012F50 - .pool -_08012E4C: - movs r3, 0xF - ldrb r1, [r6, 0x13] - adds r0, r3, 0 - ands r0, r2 - cmp r1, r0 - bne _08012E5C - strb r3, [r6, 0xC] - b _08012F50 -_08012E5C: - movs r0, 0x4 - strb r0, [r6, 0xC] - b _08012F50 -_08012E62: - adds r0, r6, 0 - movs r1, 0x7 - movs r2, 0x1D - bl sub_801320C - lsls r0, 24 - cmp r0, 0 - bne _08012F50 - movs r0, 0x12 - strb r0, [r6, 0xC] - b _08012F50 -_08012E78: - bl sub_800EF1C - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _08012EAE - movs r0, 0 - bl sub_800EF58 - cmp r0, 0 - beq _08012E94 - movs r0, 0x1A - strb r0, [r6, 0xC] - b _08012F50 -_08012E94: - ldrh r0, [r6, 0x1A] - adds r0, 0x1 - strh r0, [r6, 0x1A] - lsls r0, 16 - movs r1, 0x96 - lsls r1, 17 - cmp r0, r1 - bls _08012F50 - movs r0, 0x1D - strb r0, [r6, 0xC] - movs r0, 0 - strb r0, [r6, 0xD] - b _08012F50 -_08012EAE: - movs r0, 0x1D - strb r0, [r6, 0xC] - strb r1, [r6, 0xD] - b _08012F50 -_08012EB6: - adds r0, r6, 0 - adds r0, 0xD - ldr r1, =gUnknown_082EDD58 - bl sub_8017064 - lsls r0, 24 - cmp r0, 0 - beq _08012F50 -_08012EC6: - movs r0, 0x17 - strb r0, [r6, 0xC] - b _08012F50 - .pool -_08012ED0: - bl sub_800E084 - bl sub_800EDD4 - adds r0, r6, 0 - bl sub_8012F64 - ldrb r0, [r6, 0xC] - adds r0, 0x1 - strb r0, [r6, 0xC] - b _08012F50 -_08012EE6: - bl script_env_2_enable_and_set_ctx_running - adds r0, r4, 0 - bl remove_task - ldr r1, =0x020375f0 - movs r0, 0x5 - strh r0, [r1] - b _08012F50 - .pool -_08012EFC: - bl script_env_2_enable_and_set_ctx_running - adds r0, r4, 0 - bl remove_task - ldr r1, =0x020375f0 - movs r0, 0x8 - strh r0, [r1] - b _08012F50 - .pool -_08012F14: - bl sub_8011A80 - cmp r0, 0 - beq _08012F22 - movs r0, 0x1D - strb r0, [r6, 0xC] - b _08012F50 -_08012F22: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _08012F50 - ldr r0, =0x02022c2c - ldrb r0, [r0] - bl sub_80126CC - cmp r0, 0 - beq _08012F3A - bl sub_801103C -_08012F3A: - movs r0, 0x1 - bl sub_8011068 - bl sub_80149C4 - adds r0, r6, 0 - bl sub_8012F64 - adds r0, r4, 0 - bl remove_task -_08012F50: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8012780 - - thumb_func_start sub_8012F64 -sub_8012F64: @ 8012F64 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4, 0x11] - bl ClearWindowTilemap - ldrb r0, [r4, 0x11] - movs r1, 0 - bl sub_819746C - ldrb r0, [r4, 0x12] - movs r1, 0 - movs r2, 0 - bl sub_81AE6C8 - ldrb r0, [r4, 0x10] - bl ClearWindowTilemap - ldrb r0, [r4, 0xF] - movs r1, 0 - bl sub_819746C - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldrb r0, [r4, 0x11] - bl RemoveWindow - ldrb r0, [r4, 0xF] - bl RemoveWindow - ldrb r0, [r4, 0x10] - bl RemoveWindow - ldrb r0, [r4, 0x17] - bl remove_task - ldr r0, [r4, 0x8] - bl Free - ldr r0, [r4] - bl Free - ldr r0, [r4, 0x4] - bl Free - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8012F64 - - thumb_func_start sub_8012FC4 -sub_8012FC4: @ 8012FC4 - push {lr} - adds r2, r0, 0 - lsls r1, 24 - lsrs r1, 24 - subs r0, r1, 0x1 - cmp r0, 0x1B - bhi _08013070 - lsls r0, 2 - ldr r1, =_08012FE0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08012FE0: - .4byte _08013050 - .4byte _08013050 - .4byte _08013068 - .4byte _08013050 - .4byte _08013070 - .4byte _08013070 - .4byte _08013070 - .4byte _08013070 - .4byte _08013068 - .4byte _08013068 - .4byte _08013068 - .4byte _08013070 - .4byte _08013070 - .4byte _08013050 - .4byte _08013068 - .4byte _08013068 - .4byte _08013070 - .4byte _08013070 - .4byte _08013070 - .4byte _08013070 - .4byte _08013058 - .4byte _08013058 - .4byte _08013068 - .4byte _08013068 - .4byte _08013068 - .4byte _08013068 - .4byte _08013068 - .4byte _08013050 -_08013050: - ldr r1, =gUnknown_082EDBE8 - b _0801305A - .pool -_08013058: - ldr r1, =gUnknown_082EDC0C -_0801305A: - adds r0, r2, 0 - bl ExpandStringRefs - b _08013070 - .pool -_08013068: - ldr r1, =gUnknown_082EDC34 - adds r0, r2, 0 - bl ExpandStringRefs -_08013070: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8012FC4 - - thumb_func_start sub_8013078 -sub_8013078: @ 8013078 - push {lr} - lsls r1, 24 - lsrs r1, 24 - adds r2, r1, 0 - cmp r1, 0x44 - beq _08013098 - cmp r1, 0x44 - bgt _0801308E - cmp r1, 0x41 - beq _08013098 - b _080130AA -_0801308E: - cmp r2, 0x45 - beq _080130A4 - cmp r2, 0x48 - beq _080130A4 - b _080130AA -_08013098: - ldr r1, =gUnknown_082EE560 - bl ExpandStringRefs - b _080130AA - .pool -_080130A4: - ldr r1, =gUnknown_082EE57C - bl ExpandStringRefs -_080130AA: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8013078 - - thumb_func_start sub_80130B4 -sub_80130B4: @ 80130B4 - push {lr} - adds r2, r0, 0 - lsls r1, 24 - lsrs r1, 24 - subs r0, r1, 0x1 - cmp r0, 0x1B - bhi _08013158 - lsls r0, 2 - ldr r1, =_080130D0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080130D0: - .4byte _08013140 - .4byte _08013140 - .4byte _08013150 - .4byte _08013140 - .4byte _08013158 - .4byte _08013158 - .4byte _08013158 - .4byte _08013158 - .4byte _08013150 - .4byte _08013150 - .4byte _08013150 - .4byte _08013158 - .4byte _08013158 - .4byte _08013140 - .4byte _08013150 - .4byte _08013150 - .4byte _08013158 - .4byte _08013158 - .4byte _08013158 - .4byte _08013158 - .4byte _08013140 - .4byte _08013140 - .4byte _08013150 - .4byte _08013150 - .4byte _08013150 - .4byte _08013150 - .4byte _08013150 - .4byte _08013140 -_08013140: - ldr r1, =gUnknown_082EFC3C - adds r0, r2, 0 - bl ExpandStringRefs - b _08013158 - .pool -_08013150: - ldr r1, =gUnknown_082EFC54 - adds r0, r2, 0 - bl ExpandStringRefs -_08013158: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80130B4 - - thumb_func_start sub_8013160 -sub_8013160: @ 8013160 - push {lr} - adds r2, r0, 0 - lsls r1, 24 - lsrs r1, 24 - subs r0, r1, 0x1 - cmp r0, 0x1B - bhi _08013204 - lsls r0, 2 - ldr r1, =_0801317C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0801317C: - .4byte _080131EC - .4byte _080131EC - .4byte _080131FC - .4byte _080131EC - .4byte _08013204 - .4byte _08013204 - .4byte _08013204 - .4byte _08013204 - .4byte _080131FC - .4byte _080131FC - .4byte _080131FC - .4byte _08013204 - .4byte _08013204 - .4byte _080131EC - .4byte _080131FC - .4byte _080131FC - .4byte _08013204 - .4byte _08013204 - .4byte _08013204 - .4byte _08013204 - .4byte _080131EC - .4byte _080131EC - .4byte _080131FC - .4byte _080131FC - .4byte _080131FC - .4byte _080131FC - .4byte _080131FC - .4byte _080131EC -_080131EC: - ldr r1, =gUnknown_082EDDF4 - adds r0, r2, 0 - bl ExpandStringRefs - b _08013204 - .pool -_080131FC: - ldr r1, =gUnknown_082EDE0C - adds r0, r2, 0 - bl ExpandStringRefs -_08013204: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8013160 - - thumb_func_start sub_801320C -sub_801320C: @ 801320C - push {r4-r6,lr} - adds r4, r0, 0 - adds r6, r1, 0 - adds r5, r2, 0 - ldr r0, [r4] - bl sub_80132D4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08013228 - cmp r0, 0x2 - beq _0801325C - b _08013270 -_08013228: - movs r0, 0x2 - bl audio_play - ldrb r0, [r4, 0x12] - bl sub_81AE70C - ldr r0, =0x02021dc4 - ldrb r2, [r4, 0x13] - lsls r2, 5 - ldr r1, [r4] - adds r1, r2 - bl sub_8018404 - ldr r0, =0x02021fc4 - ldr r1, =0x02022c2c - ldrb r1, [r1] - bl sub_8012FC4 - strb r6, [r4, 0xC] - b _08013270 - .pool -_0801325C: - movs r0, 0 - movs r1, 0 - bl sub_8011A64 - ldrb r0, [r4, 0x12] - bl sub_81AE70C - strb r5, [r4, 0xC] - movs r0, 0x1 - b _08013272 -_08013270: - movs r0, 0 -_08013272: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_801320C - - thumb_func_start sub_8013278 -sub_8013278: @ 8013278 - push {r4-r6,lr} - sub sp, 0x8 - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r2, 24 - lsrs r6, r2, 24 - ldr r0, =0x02022c30 - ldr r3, [r0] - movs r2, 0 - ldr r1, [r3] - lsls r0, r4, 5 - adds r1, r0 - ldrb r0, [r1, 0x1A] - lsls r0, 30 - lsrs r0, 30 - cmp r0, 0x1 - beq _080132A8 - cmp r0, 0x2 - beq _080132B2 - b _080132B4 - .pool -_080132A8: - ldrb r0, [r1, 0x1B] - cmp r0, 0 - beq _080132B4 - movs r2, 0x2 - b _080132B4 -_080132B2: - movs r2, 0x1 -_080132B4: - lsls r0, r4, 5 - ldr r3, [r3] - adds r3, r0 - str r2, [sp] - lsls r0, r4, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - adds r0, r5, 0 - movs r1, 0 - adds r2, r6, 0 - bl sub_80178A0 - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8013278 - - thumb_func_start sub_80132D4 -sub_80132D4: @ 80132D4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - ldr r0, =0x02022c30 - ldr r5, [r0] - movs r0, 0 - mov r8, r0 - movs r3, 0x1 -_080132E8: - ldr r0, [r5] - lsls r6, r3, 5 - adds r2, r0, r6 - ldrb r0, [r2, 0x1A] - lsls r0, 30 - lsrs r0, 30 - mov r9, r0 - cmp r0, 0x1 - bne _08013348 - ldr r1, [r5, 0x4] - adds r0, r2, 0 - str r3, [sp] - bl sub_80176E4 - adds r4, r0, 0 - ldr r3, [sp] - cmp r4, 0xFF - beq _08013330 - ldr r1, [r5] - ldr r0, [r5, 0x4] - lsls r2, r4, 3 - subs r2, r4 - lsls r2, 2 - adds r1, r6 - adds r0, r2 - ldm r0!, {r2,r4,r7} - stm r1!, {r2,r4,r7} - ldm r0!, {r2,r4,r7} - stm r1!, {r2,r4,r7} - ldr r0, [r5] - adds r0, r6 - mov r1, r9 - strh r1, [r0, 0x18] - b _08013348 - .pool -_08013330: - ldr r2, [r5] - adds r2, r6 - ldrb r1, [r2, 0x1A] - movs r4, 0x4 - negs r4, r4 - adds r0, r4, 0 - ands r1, r0 - movs r0, 0x2 - orrs r1, r0 - strb r1, [r2, 0x1A] - movs r7, 0x2 - mov r8, r7 -_08013348: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x4 - bls _080132E8 - movs r6, 0 - movs r4, 0x3 -_08013356: - ldr r0, [r5] - ldr r1, [r5, 0x4] - adds r1, r6 - movs r2, 0x5 - bl sub_8017734 - adds r6, 0x1C - subs r4, 0x1 - ldr r0, [r5] - cmp r4, 0 - bge _08013356 - mov r1, r8 - cmp r1, 0x2 - beq _08013388 - adds r1, r0, 0 - movs r4, 0x4 -_08013376: - ldrb r0, [r1, 0x1B] - cmp r0, 0 - beq _08013380 - movs r2, 0x1 - mov r8, r2 -_08013380: - adds r1, 0x20 - subs r4, 0x1 - cmp r4, 0 - bge _08013376 -_08013388: - 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_80132D4 - - thumb_func_start sub_8013398 -sub_8013398: @ 8013398 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =0x02022c30 - ldr r4, [r0] - movs r3, 0 -_080133A8: - ldr r0, [r4, 0x8] - lsls r2, r3, 5 - ldr r1, [r4] - adds r0, r2 - adds r1, r2 - ldm r1!, {r2,r5,r6} - stm r0!, {r2,r5,r6} - ldm r1!, {r2,r5,r7} - stm r0!, {r2,r5,r7} - ldm r1!, {r6,r7} - stm r0!, {r6,r7} - adds r3, 0x1 - ldr r0, [r4, 0x8] - ldr r1, [r4] - cmp r3, 0x4 - ble _080133A8 - movs r5, 0 - mov r8, r1 - mov r9, r0 - movs r3, 0x4 -_080133D0: - mov r1, r9 - ldrb r0, [r1, 0x1A] - lsls r0, 30 - lsrs r0, 30 - cmp r0, 0x1 - bne _080133F2 - lsls r0, r5, 5 - add r0, r8 - ldm r1!, {r2,r6,r7} - stm r0!, {r2,r6,r7} - ldm r1!, {r2,r6,r7} - stm r0!, {r2,r6,r7} - ldm r1!, {r2,r6} - stm r0!, {r2,r6} - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_080133F2: - movs r7, 0x20 - add r9, r7 - subs r3, 0x1 - cmp r3, 0 - bge _080133D0 - mov r10, r5 - cmp r5, 0x4 - bhi _08013454 - ldr r0, =gUnknown_082F045C - mov r9, r0 - movs r1, 0 - mov r12, r1 - movs r2, 0x4 - negs r2, r2 - mov r8, r2 -_08013410: - ldr r1, [r4] - lsls r3, r5, 5 - adds r1, r3 - mov r0, r9 - ldm r0!, {r2,r6,r7} - stm r1!, {r2,r6,r7} - ldm r0!, {r2,r6,r7} - stm r1!, {r2,r6,r7} - ldr r0, [r4] - adds r0, r3 - movs r1, 0 - strh r1, [r0, 0x18] - ldr r1, [r4] - adds r1, r3 - ldrb r2, [r1, 0x1A] - mov r0, r8 - ands r0, r2 - strb r0, [r1, 0x1A] - ldr r1, [r4] - adds r1, r3 - ldrb r2, [r1, 0x1A] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1A] - ldr r0, [r4] - adds r0, r3 - mov r6, r12 - strb r6, [r0, 0x1B] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x4 - bls _08013410 -_08013454: - movs r3, 0 - ldr r1, [r4] - ldrb r0, [r1, 0x1A] - lsls r0, 30 - lsrs r0, 30 - cmp r0, 0x1 - bne _08013474 - ldrb r0, [r1, 0x1B] - cmp r0, 0x40 - bne _08013474 - mov r10, r3 - b _08013494 - .pool -_08013474: - adds r3, 0x1 - cmp r3, 0x4 - bgt _08013494 - lsls r0, r3, 5 - adds r2, r1, r0 - ldrb r0, [r2, 0x1A] - lsls r0, 30 - lsrs r0, 30 - cmp r0, 0x1 - bne _08013474 - ldrb r0, [r2, 0x1B] - cmp r0, 0x40 - bne _08013474 - lsls r0, r3, 24 - lsrs r0, 24 - mov r10, r0 -_08013494: - mov r0, r10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8013398 - - thumb_func_start BerryBlenderLinkJoinGroup -BerryBlenderLinkJoinGroup: @ 80134A4 - push {lr} - ldr r0, =sub_80134E8 - movs r1, 0 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02022c30 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r1, r0 - str r1, [r2] - ldr r0, =0x03000da4 - str r1, [r0] - movs r0, 0 - strb r0, [r1, 0x8] - strb r0, [r1, 0x9] - ldr r1, =0x020375f0 - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end BerryBlenderLinkJoinGroup - - thumb_func_start sub_80134E8 -sub_80134E8: @ 80134E8 - push {r4-r7,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02022c30 - ldr r6, [r0] - ldrb r0, [r6, 0x8] - cmp r0, 0x17 - bls _080134FC - b _08013B82 -_080134FC: - lsls r0, 2 - ldr r1, =_08013510 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08013510: - .4byte _08013570 - .4byte _080135E0 - .4byte _0801360C - .4byte _080136D8 - .4byte _08013B82 - .4byte _08013788 - .4byte _080137C4 - .4byte _08013A10 - .4byte _08013A2C - .4byte _08013A7A - .4byte _08013A8C - .4byte _08013B14 - .4byte _08013A8C - .4byte _08013AE4 - .4byte _08013A8C - .4byte _08013B24 - .4byte _08013B82 - .4byte _08013B82 - .4byte _08013A8C - .4byte _08013B44 - .4byte _08013A8C - .4byte _08013B78 - .4byte _08013B82 - .4byte _08013B68 -_08013570: - ldr r0, =0x020375e0 - ldrh r2, [r0] - adds r3, r0, 0 - cmp r2, 0x14 - bne _08013590 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x1 - bne _08013590 - adds r0, r2, 0x1 - strh r0, [r3] -_08013590: - ldr r2, =0x02022c2c - ldr r1, =gUnknown_082F0530 - ldrh r0, [r3] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - ldrb r0, [r2] - movs r1, 0 - movs r2, 0 - bl sub_8010F84 - bl sub_800B488 - bl sub_8009734 - bl sub_8011C5C - movs r0, 0x70 - bl AllocZeroed - str r0, [r6, 0x4] - movs r0, 0x80 - lsls r0, 2 - bl AllocZeroed - str r0, [r6] - movs r0, 0x1 - strb r0, [r6, 0x8] - b _08013B82 - .pool -_080135E0: - adds r0, r6, 0 - adds r0, 0x9 - ldr r2, =gUnknown_082EFB70 - ldr r1, =0x020375e0 - ldrh r1, [r1] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl sub_8017064 - lsls r0, 24 - cmp r0, 0 - bne _080135FC - b _08013B82 -_080135FC: - movs r0, 0x2 - strb r0, [r6, 0x8] - b _08013B82 - .pool -_0801360C: - ldr r0, [r6, 0x4] - movs r1, 0x4 - bl sub_80175EC - ldr r0, [r6] - movs r1, 0x10 - bl sub_8017580 - ldr r0, [r6, 0x4] - ldr r1, =0x020375e0 - ldrh r1, [r1] - bl sub_8016FC0 - movs r4, 0 - strb r0, [r6, 0x11] - ldr r0, =gUnknown_082F00BC - bl AddWindow - strb r0, [r6, 0xC] - ldr r0, =gUnknown_082F0174 - bl AddWindow - strb r0, [r6, 0xB] - ldr r0, =gUnknown_082F017C - bl AddWindow - strb r0, [r6, 0xD] - ldrb r0, [r6, 0xC] - movs r1, 0x22 - bl FillWindowPixelBuffer - ldrb r0, [r6, 0xC] - ldr r2, =gUnknown_082EF7DC - movs r1, 0x1 - str r1, [sp] - movs r1, 0x4 - str r1, [sp, 0x4] - movs r1, 0 - movs r3, 0x8 - bl sub_80173E0 - ldrb r0, [r6, 0xC] - bl PutWindowTilemap - ldrb r0, [r6, 0xC] - movs r1, 0x2 - bl CopyWindowToVram - ldrb r0, [r6, 0xB] - movs r1, 0 - bl sub_81973FC - ldr r0, =0x03006310 - adds r2, r0, 0 - ldr r1, =gUnknown_082F0204 - ldm r1!, {r3,r5,r7} - stm r2!, {r3,r5,r7} - ldm r1!, {r3,r5,r7} - stm r2!, {r3,r5,r7} - ldrb r1, [r6, 0xB] - strb r1, [r0, 0x10] - movs r1, 0 - movs r2, 0 - bl ListMenuInit - strb r0, [r6, 0xE] - ldrb r0, [r6, 0xD] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r6, 0xD] - bl PutWindowTilemap - ldrb r0, [r6, 0xD] - bl sub_80125BC - ldrb r0, [r6, 0xD] - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0 - bl CopyBgTilemapBufferToVram - strb r4, [r6, 0xF] - movs r0, 0x3 - strb r0, [r6, 0x8] - b _08013B82 - .pool -_080136D8: - bl sub_8013E44 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _080136F2 - cmp r4, 0x1 - beq _080136EA - b _08013A72 -_080136EA: - movs r0, 0x2 - bl audio_play - b _08013A72 -_080136F2: - ldrb r0, [r6, 0xE] - bl ListMenuHandleInput - adds r4, r0, 0 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08013770 - movs r0, 0x1 - negs r0, r0 - cmp r4, r0 - beq _08013770 - ldr r0, [r6] - lsls r1, r4, 5 - adds r0, r1 - ldrb r1, [r0, 0xA] - ldrb r0, [r0, 0x1A] - lsls r0, 30 - lsrs r0, 30 - cmp r0, 0x1 - bne _08013768 - lsrs r0, r1, 7 - cmp r0, 0 - bne _08013768 - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_8013B8C - adds r1, r0, 0 - cmp r1, 0 - bne _08013744 - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_8013BD8 - movs r0, 0x5 - b _08013756 - .pool -_08013744: - ldr r0, =0x02021fc4 - ldr r2, =gUnknown_082EDD50 - subs r1, 0x1 - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl CopyString - movs r0, 0x12 -_08013756: - strb r0, [r6, 0x8] - movs r0, 0x6E - bl audio_play - b _08013B82 - .pool -_08013768: - movs r0, 0x7 - bl audio_play - b _08013B82 -_08013770: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _0801377E - b _08013B82 -_0801377E: - movs r0, 0xA - strb r0, [r6, 0x8] - b _08013B82 - .pool -_08013788: - ldr r4, =0x02021fc4 - ldr r0, =0x02022c2c - ldrb r1, [r0] - adds r0, r4, 0 - bl sub_80130B4 - adds r0, r6, 0 - adds r0, 0x9 - adds r1, r4, 0 - bl sub_8017064 - lsls r0, 24 - cmp r0, 0 - bne _080137A6 - b _08013B82 -_080137A6: - ldr r0, =0x02021cc4 - ldrb r2, [r6, 0xF] - lsls r2, 5 - ldr r1, [r6] - adds r1, r2 - bl sub_8018404 - b _08013A86 - .pool -_080137C4: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _0801387A - ldr r4, =0x02022c2c - ldr r1, [r6] - ldrb r0, [r6, 0xF] - lsls r0, 5 - adds r1, r0 - ldrb r0, [r1, 0xA] - lsls r0, 25 - lsrs r0, 25 - strb r0, [r4] - movs r0, 0 - movs r1, 0 - bl sub_8011A64 - ldrb r0, [r4] - subs r0, 0x1 - cmp r0, 0x1B - bhi _0801387A - lsls r0, 2 - ldr r1, =_08013804 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08013804: - .4byte _08013874 - .4byte _08013874 - .4byte _08013874 - .4byte _08013874 - .4byte _08013874 - .4byte _0801387A - .4byte _0801387A - .4byte _0801387A - .4byte _08013874 - .4byte _08013874 - .4byte _08013874 - .4byte _0801387A - .4byte _08013874 - .4byte _08013874 - .4byte _08013874 - .4byte _08013874 - .4byte _0801387A - .4byte _0801387A - .4byte _0801387A - .4byte _0801387A - .4byte _08013874 - .4byte _08013874 - .4byte _08013874 - .4byte _08013874 - .4byte _08013874 - .4byte _08013874 - .4byte _08013874 - .4byte _08013874 -_08013874: - movs r0, 0x14 - strb r0, [r6, 0x8] - b _08013B82 -_0801387A: - bl sub_8011A74 - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x1 - cmp r0, 0x8 - bls _0801388A - b _080139EC -_0801388A: - lsls r0, 2 - ldr r1, =_08013898 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08013898: - .4byte _080138BC - .4byte _080138C2 - .4byte _080139EC - .4byte _080139EC - .4byte _080138C8 - .4byte _080138C2 - .4byte _08013934 - .4byte _080139EC - .4byte _080138C2 -_080138BC: - movs r0, 0xC - strb r0, [r6, 0x8] - b _080139EC -_080138C2: - movs r0, 0xE - strb r0, [r6, 0x8] - b _080139EC -_080138C8: - ldr r5, =0x02021fc4 - ldr r4, =0x02022c2c - ldrb r1, [r4] - adds r0, r5, 0 - bl sub_8013160 - adds r0, r6, 0 - adds r0, 0x9 - adds r1, r5, 0 - bl sub_8017064 - lsls r0, 24 - cmp r0, 0 - bne _080138E6 - b _080139EC -_080138E6: - ldrb r0, [r4] - cmp r0, 0x1C - beq _080138F0 - cmp r0, 0xE - bne _08013904 -_080138F0: - movs r0, 0xC - movs r1, 0 - bl sub_8011A64 - b _080139EC - .pool -_08013904: - movs r0, 0x7 - movs r1, 0 - bl sub_8011A64 - ldr r0, =0x02021cc4 - ldr r2, =gUnknown_082F0048 - ldrb r1, [r4] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl CopyString - ldr r1, =gUnknown_082EDE48 - adds r0, r5, 0 - bl ExpandStringRefs - b _080139EC - .pool -_08013934: - ldrb r0, [r6, 0x15] - adds r2, r0, 0 - cmp r2, 0xF0 - bls _0801395C - adds r0, r6, 0 - adds r0, 0x9 - ldr r1, =0x02021fc4 - bl sub_8017064 - lsls r0, 24 - cmp r0, 0 - beq _080139EC - movs r0, 0xC - movs r1, 0 - bl sub_8011A64 - movs r0, 0 - b _080139EA - .pool -_0801395C: - ldr r0, =0x02022c2c - ldrb r0, [r0] - subs r0, 0x1 - cmp r0, 0x1B - bhi _080139E8 - lsls r0, 2 - ldr r1, =_08013978 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08013978: - .4byte _080139EC - .4byte _080139EC - .4byte _080139E8 - .4byte _080139EC - .4byte _080139E8 - .4byte _080139E8 - .4byte _080139E8 - .4byte _080139E8 - .4byte _080139E8 - .4byte _080139E8 - .4byte _080139E8 - .4byte _080139E8 - .4byte _080139E8 - .4byte _080139EC - .4byte _080139E8 - .4byte _080139E8 - .4byte _080139E8 - .4byte _080139E8 - .4byte _080139E8 - .4byte _080139E8 - .4byte _080139E8 - .4byte _080139E8 - .4byte _080139E8 - .4byte _080139E8 - .4byte _080139E8 - .4byte _080139E8 - .4byte _080139E8 - .4byte _080139EC -_080139E8: - adds r0, r2, 0x1 -_080139EA: - strb r0, [r6, 0x15] -_080139EC: - bl sub_8011A74 - lsls r0, 24 - cmp r0, 0 - beq _080139F8 - b _08013B82 -_080139F8: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08013A06 - b _08013B82 -_08013A06: - movs r0, 0x7 - strb r0, [r6, 0x8] - b _08013B82 - .pool -_08013A10: - adds r0, r6, 0 - adds r0, 0x9 - ldr r1, =gUnknown_082EDE64 - bl sub_8017064 - lsls r0, 24 - cmp r0, 0 - bne _08013A22 - b _08013B82 -_08013A22: - movs r0, 0x8 - strb r0, [r6, 0x8] - b _08013B82 - .pool -_08013A2C: - adds r4, r6, 0 - adds r4, 0x9 - bl sub_8011A74 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_80170B8 - lsls r0, 24 - asrs r1, r0, 24 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08013A6A - cmp r1, r0 - bgt _08013A58 - subs r0, 0x2 - cmp r1, r0 - beq _08013A6E - b _08013B82 -_08013A58: - cmp r1, 0 - beq _08013A62 - cmp r1, 0x1 - beq _08013A6A - b _08013B82 -_08013A62: - bl sub_80106D4 - movs r0, 0x9 - b _08013A70 -_08013A6A: - movs r0, 0x5 - b _08013A70 -_08013A6E: - movs r0, 0x6 -_08013A70: - strb r0, [r6, 0x8] -_08013A72: - ldrb r0, [r6, 0xE] - bl sub_81AE70C - b _08013B82 -_08013A7A: - bl sub_8011A74 - lsls r0, 24 - cmp r0, 0 - bne _08013A86 - b _08013B82 -_08013A86: - movs r0, 0x6 - strb r0, [r6, 0x8] - b _08013B82 -_08013A8C: - ldrb r0, [r6, 0xD] - bl ClearWindowTilemap - ldrb r0, [r6, 0xD] - movs r1, 0 - bl sub_819746C - ldrb r0, [r6, 0xE] - movs r1, 0 - movs r2, 0 - bl sub_81AE6C8 - ldrb r0, [r6, 0xC] - bl ClearWindowTilemap - ldrb r0, [r6, 0xB] - movs r1, 0 - bl sub_819746C - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldrb r0, [r6, 0xD] - bl RemoveWindow - ldrb r0, [r6, 0xB] - bl RemoveWindow - ldrb r0, [r6, 0xC] - bl RemoveWindow - ldrb r0, [r6, 0x11] - bl remove_task - ldr r0, [r6] - bl Free - ldr r0, [r6, 0x4] - bl Free - ldrb r0, [r6, 0x8] - adds r0, 0x1 - strb r0, [r6, 0x8] - b _08013B82 -_08013AE4: - bl sub_800E084 - adds r5, r6, 0 - adds r5, 0x9 - ldr r4, =gUnknown_082EDE9C - bl sub_8011A74 - lsls r0, 24 - lsrs r0, 22 - adds r0, r4 - ldr r1, [r0] - adds r0, r5, 0 - bl sub_8017064 - lsls r0, 24 - cmp r0, 0 - beq _08013B82 - ldr r0, =0x020375f0 - movs r1, 0x6 - b _08013B58 - .pool -_08013B14: - bl sub_800E084 - ldr r0, =0x020375f0 - movs r1, 0x5 - b _08013B58 - .pool -_08013B24: - bl sub_800E084 - adds r5, r6, 0 - adds r5, 0x9 - ldr r4, =gUnknown_082EDE9C - bl sub_8011A74 - lsls r0, 24 - lsrs r0, 22 - adds r0, r4 - ldr r1, [r0] - adds r0, r5, 0 - b _08013B4A - .pool -_08013B44: - adds r0, r6, 0 - adds r0, 0x9 - ldr r1, =0x02021fc4 -_08013B4A: - bl sub_8017064 - lsls r0, 24 - cmp r0, 0 - beq _08013B82 - ldr r0, =0x020375f0 - movs r1, 0x8 -_08013B58: - strh r1, [r0] - movs r0, 0x17 - strb r0, [r6, 0x8] - b _08013B82 - .pool -_08013B68: - adds r0, r4, 0 - bl remove_task - bl sub_80173D4 - bl sub_800EDD4 - b _08013B82 -_08013B78: - bl sub_80149C4 - adds r0, r4, 0 - bl remove_task -_08013B82: - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80134E8 - - thumb_func_start sub_8013B8C -sub_8013B8C: @ 8013B8C - push {lr} - lsls r1, 5 - ldr r0, [r0] - adds r3, r0, r1 - ldr r0, =0x02022c2c - ldrb r0, [r0] - cmp r0, 0x4 - bne _08013BCE - ldrb r1, [r3, 0x1] - movs r0, 0x3C - ands r0, r1 - cmp r0, 0xC - beq _08013BCE - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r1, [r0, 0x9] - movs r2, 0x80 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _08013BC4 - movs r0, 0x1 - b _08013BD4 - .pool -_08013BC4: - ldrb r1, [r3] - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _08013BD2 -_08013BCE: - movs r0, 0 - b _08013BD4 -_08013BD2: - movs r0, 0x2 -_08013BD4: - pop {r1} - bx r1 - thumb_func_end sub_8013B8C - - thumb_func_start sub_8013BD8 -sub_8013BD8: @ 8013BD8 - push {r4,lr} - adds r4, r0, 0 - strb r1, [r4, 0xF] - bl sub_800E0E8 - movs r0, 0 - movs r1, 0 - bl sub_800DFB4 - ldrb r0, [r4, 0xE] - bl sub_81AE70C - ldr r0, =0x02021cc4 - ldrb r2, [r4, 0xF] - lsls r2, 5 - ldr r1, [r4] - adds r1, r2 - bl sub_8018404 - ldr r1, =gUnknown_082F0530 - ldr r0, =0x020375e0 - ldrh r0, [r0] - adds r0, r1 - ldrb r0, [r0] - movs r1, 0 - movs r2, 0x1 - bl sub_8011090 - ldrb r1, [r4, 0xF] - lsls r1, 5 - ldr r0, [r4] - adds r0, r1 - adds r4, r0, 0 - adds r4, 0x10 - adds r0, 0x2 - bl sub_8015658 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_8011FC8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8013BD8 - - thumb_func_start sub_8013C40 -sub_8013C40: @ 8013C40 - push {lr} - ldr r0, =sub_8013C7C - movs r1, 0 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r3, =0x02022c30 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r2, =0x03005e08 - adds r1, r2 - str r1, [r3] - movs r2, 0 - strb r2, [r1, 0x8] - strb r2, [r1, 0x9] - ldr r2, =0x03000da4 - str r1, [r2] - pop {r1} - bx r1 - .pool - thumb_func_end sub_8013C40 - - thumb_func_start sub_8013C7C -sub_8013C7C: @ 8013C7C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02022c30 - ldr r4, [r0] - ldrb r0, [r4, 0x8] - cmp r0, 0xB - bhi _08013D80 - lsls r0, 2 - ldr r1, =_08013CA0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08013CA0: - .4byte _08013CD0 - .4byte _08013D80 - .4byte _08013D04 - .4byte _08013D28 - .4byte _08013D80 - .4byte _08013D80 - .4byte _08013D80 - .4byte _08013D80 - .4byte _08013D80 - .4byte _08013D80 - .4byte _08013D58 - .4byte _08013D76 -_08013CD0: - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl sub_8010F84 - bl sub_800B488 - bl sub_8009734 - bl sub_8011C5C - movs r0, 0x1 - bl sub_80111B0 - movs r0, 0x70 - bl AllocZeroed - str r0, [r4, 0x4] - movs r0, 0x80 - lsls r0, 2 - bl AllocZeroed - str r0, [r4] - movs r0, 0x2 - strb r0, [r4, 0x8] - b _08013D80 -_08013D04: - ldr r0, [r4, 0x4] - movs r1, 0x4 - bl sub_80175EC - ldr r0, [r4] - movs r1, 0x10 - bl sub_8017580 - ldr r0, [r4, 0x4] - movs r1, 0xFF - bl sub_8016FC0 - movs r1, 0 - strb r0, [r4, 0x11] - strb r1, [r4, 0xF] - movs r0, 0x3 - strb r0, [r4, 0x8] - b _08013D80 -_08013D28: - bl sub_8013E44 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08013D3A - movs r0, 0x2 - bl audio_play -_08013D3A: - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - movs r2, 0x26 - ldrsh r0, [r1, r2] - cmp r0, 0xFF - bne _08013D80 - movs r0, 0xA - strb r0, [r4, 0x8] - b _08013D80 - .pool -_08013D58: - ldrb r0, [r4, 0x11] - bl remove_task - ldr r0, [r4] - bl Free - ldr r0, [r4, 0x4] - bl Free - bl sub_800EDD4 - ldrb r0, [r4, 0x8] - adds r0, 0x1 - strb r0, [r4, 0x8] - b _08013D80 -_08013D76: - bl sub_800EDD4 - adds r0, r5, 0 - bl remove_task -_08013D80: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8013C7C - - thumb_func_start sub_8013D88 -sub_8013D88: @ 8013D88 - push {lr} - adds r2, r0, 0 - cmp r1, 0xFF - bne _08013D94 -_08013D90: - movs r0, 0x1 - b _08013DB8 -_08013D94: - cmp r1, 0x16 - bhi _08013DB6 - ldr r0, =gUnknown_082F04D8 - lsls r1, 2 - adds r1, r0 - ldr r1, [r1] - b _08013DB0 - .pool -_08013DA8: - ldrb r0, [r1] - cmp r0, r2 - beq _08013D90 - adds r1, 0x1 -_08013DB0: - ldrb r0, [r1] - cmp r0, 0xFF - bne _08013DA8 -_08013DB6: - movs r0, 0 -_08013DB8: - pop {r1} - bx r1 - thumb_func_end sub_8013D88 - - thumb_func_start sub_8013DBC -sub_8013DBC: @ 8013DBC - push {lr} - ldr r0, [r0] - lsls r1, 5 - adds r1, r0, r1 - ldrb r2, [r1, 0x1A] - lsls r0, r2, 30 - lsrs r0, 30 - cmp r0, 0x1 - bne _08013DEE - ldrb r0, [r1, 0xA] - lsrs r0, 7 - cmp r0, 0 - beq _08013DDA - movs r0, 0x3 - b _08013DF0 -_08013DDA: - lsls r0, r2, 29 - cmp r0, 0 - bge _08013DE4 - movs r0, 0x1 - b _08013DF0 -_08013DE4: - ldrb r0, [r1, 0x1B] - cmp r0, 0 - beq _08013DEE - movs r0, 0x2 - b _08013DF0 -_08013DEE: - movs r0, 0 -_08013DF0: - pop {r1} - bx r1 - thumb_func_end sub_8013DBC - - thumb_func_start sub_8013DF4 -sub_8013DF4: @ 8013DF4 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x8 - adds r5, r0, 0 - adds r4, r1, 0 - adds r6, r2, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - ldr r0, =0x02022c30 - ldr r0, [r0] - mov r8, r0 - bl sub_8013DBC - lsls r0, 24 - lsrs r0, 24 - lsls r1, r4, 5 - mov r2, r8 - ldr r3, [r2] - adds r3, r1 - str r0, [sp] - lsls r4, 24 - lsrs r4, 24 - str r4, [sp, 0x4] - adds r0, r5, 0 - movs r1, 0x8 - adds r2, r6, 0 - bl sub_80177B8 - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8013DF4 - - thumb_func_start sub_8013E44 -sub_8013E44: @ 8013E44 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - ldr r0, =0x02022c30 - ldr r6, [r0] - movs r7, 0 - movs r3, 0 -_08013E54: - ldr r0, [r6] - lsls r5, r3, 5 - adds r2, r0, r5 - ldrb r0, [r2, 0x1A] - lsls r0, 30 - mov r8, r5 - cmp r0, 0 - beq _08013F20 - ldr r1, [r6, 0x4] - adds r0, r2, 0 - str r3, [sp] - bl sub_80176E4 - adds r4, r0, 0 - ldr r3, [sp] - cmp r4, 0xFF - beq _08013EEE - ldr r0, [r6] - adds r2, r0, r5 - ldrb r1, [r2, 0x1A] - lsls r0, r1, 30 - lsrs r0, 30 - cmp r0, 0x1 - bne _08013ECC - lsls r0, r4, 3 - subs r0, r4 - lsls r4, r0, 2 - ldr r1, [r6, 0x4] - adds r1, r4 - adds r0, r2, 0 - bl sub_8017678 - ldr r3, [sp] - cmp r0, 0 - beq _08013EB0 - ldr r1, [r6] - ldr r0, [r6, 0x4] - adds r1, r5 - adds r0, r4 - ldm r0!, {r2,r4,r7} - stm r1!, {r2,r4,r7} - ldm r0!, {r2,r4,r7} - stm r1!, {r2,r4,r7} - b _08013EDA - .pool -_08013EB0: - ldr r0, [r6] - adds r1, r0, r5 - ldrb r0, [r1, 0x1B] - cmp r0, 0 - beq _08013EE4 - subs r0, 0x1 - strb r0, [r1, 0x1B] - ldr r0, [r6] - adds r0, r5 - ldrb r0, [r0, 0x1B] - cmp r0, 0 - bne _08013EE4 - movs r7, 0x2 - b _08013EE4 -_08013ECC: - movs r4, 0x4 - negs r4, r4 - adds r0, r4, 0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x1A] -_08013EDA: - ldr r0, [r6] - adds r0, r5 - movs r1, 0x40 - strb r1, [r0, 0x1B] - movs r7, 0x1 -_08013EE4: - ldr r0, [r6] - add r0, r8 - movs r1, 0 - strh r1, [r0, 0x18] - b _08013F20 -_08013EEE: - ldr r0, [r6] - adds r1, r0, r5 - ldrb r0, [r1, 0x1A] - lsls r0, 30 - lsrs r0, 30 - cmp r0, 0x2 - beq _08013F20 - ldrh r0, [r1, 0x18] - adds r0, 0x1 - strh r0, [r1, 0x18] - ldr r0, [r6] - adds r2, r0, r5 - ldrh r1, [r2, 0x18] - ldr r0, =0x0000012b - cmp r1, r0 - bls _08013F20 - ldrb r0, [r2, 0x1A] - movs r7, 0x4 - negs r7, r7 - adds r1, r7, 0 - ands r0, r1 - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2, 0x1A] - movs r7, 0x2 -_08013F20: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0xF - bls _08013E54 - movs r5, 0 - movs r4, 0x3 -_08013F2E: - ldr r0, [r6] - ldr r1, [r6, 0x4] - adds r1, r5 - movs r2, 0x10 - bl sub_8017734 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _08013F44 - movs r7, 0x1 -_08013F44: - adds r5, 0x1C - subs r4, 0x1 - cmp r4, 0 - bge _08013F2E - adds r0, r7, 0 - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8013E44 - - thumb_func_start sub_8013F60 -sub_8013F60: @ 8013F60 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_80773AC - adds r0, r4, 0 - bl remove_task - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8013F60 - - thumb_func_start sub_8013F78 -sub_8013F78: @ 8013F78 - push {lr} - ldr r0, =sub_8013F60 - movs r1, 0 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8013F78 - - thumb_func_start sub_8013F90 -sub_8013F90: @ 8013F90 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x02022c40 - mov r8, r0 - bl link_get_multiplayer_id - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, r8 - bl sub_8018120 - adds r7, r0, 0 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r5, r0, r1 - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _08013FFC - cmp r0, 0x1 - bgt _08013FD4 - cmp r0, 0 - beq _08013FDE - b _080140BC - .pool -_08013FD4: - cmp r0, 0x2 - beq _08014038 - cmp r0, 0x3 - beq _08014070 - b _080140BC -_08013FDE: - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0x64 - adds r1, r7, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r1, r0 - movs r0, 0 - movs r2, 0x64 - bl link_0800A448 - b _080140BC - .pool -_08013FFC: - bl sub_800A550 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _080140BC - bl link_get_multiplayer_id - adds r1, r0, 0 - ldr r0, =0x02024744 - movs r2, 0x1 - eors r1, r2 - lsls r1, 24 - lsrs r1, 16 - ldr r2, =0x020223c4 - adds r1, r2 - movs r2, 0x64 - bl memcpy - movs r0, 0x32 - bl sav12_xor_increment - bl sub_800A5B4 - b _0801405A - .pool -_08014038: - ldr r4, =0x020228c4 - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r0, =0x00002be0 - adds r1, r0 - adds r0, r4, 0 - movs r2, 0xDC - bl memcpy - movs r0, 0 - adds r1, r4, 0 - movs r2, 0xDC - bl link_0800A448 - lsls r0, 24 - cmp r0, 0 - beq _080140BC -_0801405A: - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - b _080140BC - .pool -_08014070: - bl sub_800A550 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _080140BC - ldr r4, =0x020321c0 - bl link_get_multiplayer_id - adds r1, r0, 0 - movs r0, 0x1 - eors r1, r0 - lsls r1, 24 - lsrs r1, 16 - ldr r0, =0x020223c4 - adds r1, r0 - adds r0, r4, 0 - movs r2, 0xD8 - bl memcpy - bl sub_800A5B4 - ldr r1, =0x02032298 - strb r7, [r1] - movs r0, 0x6 - strb r0, [r1, 0x1] - ldr r1, =0x030022c0 - ldr r0, =c2_exit_to_overworld_2_switch - str r0, [r1, 0x8] - ldr r0, =sub_807AE50 - bl SetMainCallback2 - mov r0, r8 - bl sub_801807C - adds r0, r6, 0 - bl remove_task -_080140BC: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8013F90 - - thumb_func_start sub_80140E0 -sub_80140E0: @ 80140E0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _08014104 - cmp r0, 0x1 - beq _0801411C - b _0801419E - .pool -_08014104: - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - bne _08014114 - movs r0, 0x2 - bl sub_800A4D8 -_08014114: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0801419E -_0801411C: - bl sub_800A550 - adds r4, r0, 0 - bl sub_800A9D8 - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - bne _0801419E - movs r4, 0 - ldr r5, =0x020229e8 - b _08014152 - .pool -_08014138: - lsls r1, r4, 8 - ldr r0, =0x020223c4 - adds r3, r1, r0 - movs r0, 0x64 - muls r0, r4 - ldr r1, =0x02039b58 - adds r0, r1 - ldrb r2, [r5] - adds r1, r3, 0 - bl sub_80C3120 - adds r5, 0x1C - adds r4, 0x1 -_08014152: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - blt _08014138 - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08014190 - bl link_get_multiplayer_id - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 16 - ldr r1, =0x020223c4 - adds r3, r0, r1 - adds r0, r3, 0 - adds r0, 0x60 - ldrh r0, [r0] - bl sub_801B94C - b _08014194 - .pool -_08014190: - bl sub_801B940 -_08014194: - bl sub_800A5B4 - adds r0, r6, 0 - bl remove_task -_0801419E: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80140E0 - - thumb_func_start sub_80141A4 -sub_80141A4: @ 80141A4 - push {r4,lr} - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r4, r0, r1 - ldrb r0, [r4] - cmp r0, 0 - beq _080141C0 - cmp r0, 0x1 - beq _080141D4 - b _080141F2 - .pool -_080141C0: - ldr r0, =sub_80140E0 - movs r1, 0x5 - bl AddTask - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _080141F2 - .pool -_080141D4: - ldr r0, =sub_80140E0 - bl is_function_an_active_task - lsls r0, 24 - cmp r0, 0 - bne _080141F2 - bl link_get_multiplayer_id - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =c2_exit_to_overworld_2_switch - bl sub_80C4E74 -_080141F2: - bl RunActiveTasks - bl RunTextPrinters - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80141A4 - - thumb_func_start sub_8014210 -sub_8014210: @ 8014210 - push {r4-r6,lr} - adds r6, r0, 0 - lsls r6, 16 - lsrs r6, 16 - bl sp000_heal_pokemon - bl copy_player_party_to_sav1 - bl copy_bags_and_unk_data_from_save_blocks - ldr r5, =0x020229e8 - ldr r0, =0x00002211 - str r0, [r5, 0x14] - bl link_get_multiplayer_id - adds r4, r0, 0 - bl link_get_multiplayer_id - lsls r4, 24 - lsrs r4, 24 - lsls r1, r4, 3 - subs r1, r4 - lsls r1, 2 - adds r1, r5 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1, 0x18] - bl link_get_multiplayer_id - adds r4, r0, 0 - bl link_get_multiplayer_id - movs r2, 0x1 - eors r4, r2 - lsls r4, 24 - lsrs r4, 24 - lsls r1, r4, 3 - subs r1, r4 - lsls r1, 2 - adds r1, r5 - eors r0, r2 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1, 0x18] - ldr r1, =0x030022c0 - ldr r0, =sub_80B360C - str r0, [r1, 0x8] - ldr r0, =0x02022fec - str r6, [r0] - bl sub_806E64C - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8014210 - - thumb_func_start sub_8014290 -sub_8014290: @ 8014290 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x8 - adds r3, r0, 0 - adds r4, r1, 0 - adds r5, r2, 0 - lsls r3, 16 - lsrs r3, 16 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - ldr r0, =0x00004087 - adds r1, r3, 0 - bl VarSet - ldr r6, =0x03005d8c - ldr r1, [r6] - movs r0, 0x4 - ldrsb r0, [r1, r0] - ldrb r1, [r1, 0x5] - lsls r1, 24 - asrs r1, 24 - movs r2, 0x1 - negs r2, r2 - mov r8, r2 - lsls r4, 24 - asrs r4, 24 - lsls r5, 24 - asrs r5, 24 - str r5, [sp] - adds r3, r4, 0 - bl warp1_set - ldr r0, [r6] - movs r1, 0x4 - ldrsb r1, [r0, r1] - movs r2, 0x5 - ldrsb r2, [r0, r2] - str r4, [sp] - str r5, [sp, 0x4] - movs r0, 0 - mov r3, r8 - bl saved_warp2_set_2 - bl warp_in - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8014290 - - thumb_func_start sub_8014304 -sub_8014304: @ 8014304 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - mov r8, r2 - adds r6, r3, 0 - ldr r1, [sp, 0x18] - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r1, 16 - lsrs r1, 16 - ldr r0, =0x020375e0 - strh r1, [r0] - ldr r0, =0x00004087 - bl VarSet - bl sub_8009FCC - ldr r1, =0x03005db8 - strb r0, [r1] - bl link_get_multiplayer_id - ldr r1, =0x03005db4 - strb r0, [r1] - bl sub_809D2BC - lsls r4, 24 - asrs r4, 24 - lsls r5, 24 - asrs r5, 24 - movs r2, 0x1 - negs r2, r2 - mov r0, r8 - lsls r0, 24 - asrs r0, 24 - mov r8, r0 - lsls r6, 24 - asrs r6, 24 - str r6, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - mov r3, r8 - bl warp1_set - bl warp_in - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8014304 - - thumb_func_start sub_8014384 -sub_8014384: @ 8014384 - push {r4,lr} - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r4, r0, r1 - ldrb r0, [r4] - cmp r0, 0 - beq _080143A0 - cmp r0, 0x1 - beq _080143B4 - b _080143C6 - .pool -_080143A0: - ldr r0, =sub_80140E0 - movs r1, 0x5 - bl AddTask - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _080143C6 - .pool -_080143B4: - ldr r0, =sub_80140E0 - bl is_function_an_active_task - lsls r0, 24 - cmp r0, 0 - bne _080143C6 - ldr r0, =sub_8086074 - bl SetMainCallback2 -_080143C6: - bl RunActiveTasks - bl RunTextPrinters - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8014384 - - thumb_func_start sub_80143E4 -sub_80143E4: @ 80143E4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80C30A4 - cmp r5, 0 - beq _080143FE - bl sub_801B39C - adds r1, r4, 0 - adds r1, 0x60 - strh r0, [r1] - b _08014404 -_080143FE: - adds r0, r4, 0 - adds r0, 0x60 - strh r5, [r0] -_08014404: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80143E4 - - thumb_func_start sub_801440C -sub_801440C: @ 801440C - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_801B940 - ldr r0, =0x02022c2c - ldrb r0, [r0] - subs r0, 0x1 - cmp r0, 0xE - bhi _08014474 - lsls r0, 2 - ldr r1, =_08014434 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08014434: - .4byte _08014470 - .4byte _08014470 - .4byte _08014470 - .4byte _08014470 - .4byte _08014474 - .4byte _08014474 - .4byte _08014474 - .4byte _08014474 - .4byte _08014470 - .4byte _08014470 - .4byte _08014470 - .4byte _08014474 - .4byte _08014470 - .4byte _08014474 - .4byte _08014470 -_08014470: - bl sub_800E3A8 -_08014474: - ldr r0, =0x02022c2c - ldrb r0, [r0] - subs r0, 0x1 - cmp r0, 0x50 - bls _08014480 - b _08014764 -_08014480: - lsls r0, 2 - ldr r1, =_08014494 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08014494: - .4byte _080145F4 - .4byte _08014620 - .4byte _0801464C - .4byte _08014678 - .4byte _080146D8 - .4byte _08014764 - .4byte _08014764 - .4byte _080146FC - .4byte _08014714 - .4byte _08014734 - .4byte _0801474C - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014698 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _080145D8 - .4byte _08014764 - .4byte _08014764 - .4byte _080146C4 - .4byte _080146D8 - .4byte _08014764 - .4byte _08014764 - .4byte _080146FC - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _08014764 - .4byte _080145D8 -_080145D8: - bl overworld_free_bg_tilemaps - ldr r1, =0x030022c0 - ldr r0, =sub_801AC54 - str r0, [r1, 0x8] - movs r0, 0x3 - bl sub_81B8518 - b _08014764 - .pool -_080145F4: - bl overworld_free_bg_tilemaps - ldr r0, =0x020228c4 - movs r1, 0x1 - bl sub_80143E4 - bl sp000_heal_pokemon - bl copy_player_party_to_sav1 - bl copy_bags_and_unk_data_from_save_blocks - movs r0, 0x1 - str r0, [sp] - movs r0, 0x19 - movs r1, 0x18 - movs r2, 0x6 - movs r3, 0x8 - b _080146B0 - .pool -_08014620: - bl overworld_free_bg_tilemaps - bl sp000_heal_pokemon - bl copy_player_party_to_sav1 - bl copy_bags_and_unk_data_from_save_blocks - ldr r0, =0x020228c4 - movs r1, 0x1 - bl sub_80143E4 - movs r0, 0x2 - str r0, [sp] - movs r0, 0x19 - movs r1, 0x18 - movs r2, 0x6 - movs r3, 0x8 - b _080146B0 - .pool -_0801464C: - bl overworld_free_bg_tilemaps - bl sp000_heal_pokemon - bl copy_player_party_to_sav1 - bl copy_bags_and_unk_data_from_save_blocks - ldr r0, =0x020228c4 - movs r1, 0x1 - bl sub_80143E4 - movs r0, 0x5 - str r0, [sp] - movs r0, 0x19 - movs r1, 0x1B - movs r2, 0x5 - movs r3, 0x8 - b _080146B0 - .pool -_08014678: - ldr r0, =0x020228c4 - movs r1, 0x1 - bl sub_80143E4 - bl overworld_free_bg_tilemaps - movs r0, 0x3 - str r0, [sp] - movs r0, 0x19 - movs r1, 0x19 - movs r2, 0x5 - movs r3, 0x8 - b _080146B0 - .pool -_08014698: - ldr r0, =0x020228c4 - movs r1, 0x1 - bl sub_80143E4 - bl overworld_free_bg_tilemaps - movs r0, 0x4 - str r0, [sp] - movs r0, 0x19 - movs r1, 0x1A - movs r2, 0x8 - movs r3, 0x9 -_080146B0: - bl sub_8014304 - ldr r0, =sub_8014384 - bl SetMainCallback2 - b _08014764 - .pool -_080146C4: - bl overworld_free_bg_tilemaps - ldr r0, =sub_8013F90 - movs r1, 0 - bl AddTask - b _08014764 - .pool -_080146D8: - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - bne _080146E8 - bl sub_800ED10 - b _080146F6 -_080146E8: - bl sub_800ED28 - movs r0, 0x45 - movs r1, 0 - movs r2, 0x1 - bl sub_8010F84 -_080146F6: - bl sub_801DD98 - b _08014764 -_080146FC: - ldr r0, =0x020228c4 - movs r1, 0 - bl sub_80143E4 - ldr r0, =sub_80141A4 - bl SetMainCallback2 - b _08014764 - .pool -_08014714: - movs r0, 0x8 - movs r1, 0x5 - movs r2, 0x1 - bl sub_8014290 - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r0, 24 - ldr r1, =c2_load_new_map - bl sub_802A9A8 - b _08014764 - .pool -_08014734: - movs r0, 0x7 - movs r1, 0x9 - movs r2, 0x1 - bl sub_8014290 - ldr r0, =c2_load_new_map - bl sub_8020C70 - b _08014764 - .pool -_0801474C: - movs r0, 0x8 - movs r1, 0x5 - movs r2, 0x1 - bl sub_8014290 - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r0, 24 - ldr r1, =c2_load_new_map - bl sub_802493C -_08014764: - adds r0, r4, 0 - bl remove_task - ldr r1, =0x020375f0 - movs r0, 0x1 - strh r0, [r1] - ldr r0, =0x02022c2c - ldrb r0, [r0] - cmp r0, 0x44 - beq _0801477C - bl script_env_2_disable -_0801477C: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801440C - - thumb_func_start sub_8014790 -sub_8014790: @ 8014790 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r7, r0, r1 - ldr r0, =0x020228c4 - mov r9, r0 - movs r1, 0 - ldrsh r0, [r7, r1] - mov r2, r9 - cmp r0, 0x8 - bls _080147B6 - b _080149B2 -_080147B6: - lsls r0, 2 - ldr r1, =_080147CC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080147CC: - .4byte _080147F0 - .4byte _080148CC - .4byte _080148E4 - .4byte _0801491E - .4byte _08014934 - .4byte _0801494A - .4byte _08014986 - .4byte _08014992 - .4byte _0801499C -_080147F0: - ldr r1, =0x020375f0 - movs r0, 0x1 - strh r0, [r1] - ldr r0, =0x02022c2c - ldrb r0, [r0] - subs r0, 0xE - cmp r0, 0xE - bhi _080148C2 - lsls r0, 2 - ldr r1, =_08014818 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08014818: - .4byte _08014854 - .4byte _080148C2 - .4byte _080148B8 - .4byte _080148C2 - .4byte _080148C2 - .4byte _080148C2 - .4byte _080148C2 - .4byte _080148C2 - .4byte _080148C2 - .4byte _080148B8 - .4byte _080148B8 - .4byte _080148B8 - .4byte _080148B8 - .4byte _080148B8 - .4byte _08014854 -_08014854: - ldr r1, =0x020229e8 - ldr r0, =0x00002211 - str r0, [r1, 0x14] - movs r2, 0 - mov r8, r2 - mov r0, r8 - strh r0, [r1, 0x18] - movs r0, 0x2 - strh r0, [r1, 0x34] - ldr r6, =0x0203cef8 - ldrb r0, [r6] - movs r5, 0x64 - muls r0, r5 - ldr r4, =0x02024488 - adds r0, r4 - movs r1, 0xB - bl pokemon_getattr - mov r1, r9 - strh r0, [r1] - ldrb r0, [r6, 0x1] - muls r0, r5 - adds r0, r4 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - mov r2, r9 - strh r0, [r2, 0x2] - ldr r0, =0x030022c0 - mov r1, r8 - str r1, [r0, 0x8] - movs r0, 0x4 - strh r0, [r7] - bl sub_800E3A8 - bl sub_800A5B4 - b _080149B2 - .pool -_080148B8: - bl sub_800E3A8 - adds r0, r4, 0 - bl remove_task -_080148C2: - bl script_env_2_enable_and_set_ctx_running - movs r0, 0x1 - strh r0, [r7] - b _080149B2 -_080148CC: - bl script_env_context_is_running - lsls r0, 24 - cmp r0, 0 - bne _080149B2 - movs r0, 0x1 - movs r1, 0 - bl fade_screen - movs r0, 0x2 - strh r0, [r7] - b _080149B2 -_080148E4: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080149B2 - ldr r0, =0x02022c2c - ldrb r0, [r0] - cmp r0, 0x1D - bne _08014914 - adds r0, r4, 0 - bl remove_task - ldr r0, =sub_80773AC - bl SetMainCallback2 - b _080149B2 - .pool -_08014914: - bl sub_800ADF8 - movs r0, 0x3 - strh r0, [r7] - b _080149B2 -_0801491E: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080149B2 - adds r0, r4, 0 - bl remove_task - bl sub_80149D8 - b _080149B2 -_08014934: - movs r0, 0 - adds r1, r2, 0 - movs r2, 0xE - bl link_0800A448 - lsls r0, 24 - cmp r0, 0 - beq _080149B2 - movs r0, 0x5 - strh r0, [r7] - b _080149B2 -_0801494A: - bl sub_800A550 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _080149B2 - bl sub_800A5B4 - ldr r0, =0x020223c4 - movs r2, 0x80 - lsls r2, 1 - adds r1, r0, r2 - bl sub_80B2AF4 - cmp r0, 0 - beq _08014980 - ldr r0, =0x020375f0 - movs r1, 0xB - strh r1, [r0] - movs r0, 0x7 - strh r0, [r7] - b _080149B2 - .pool -_08014980: - movs r0, 0x6 - strh r0, [r7] - b _080149B2 -_08014986: - bl script_env_2_enable_and_set_ctx_running - adds r0, r4, 0 - bl remove_task - b _080149B2 -_08014992: - bl sub_800AC34 - movs r0, 0x8 - strh r0, [r7] - b _080149B2 -_0801499C: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _080149B2 - bl sub_800E084 - bl script_env_2_enable_and_set_ctx_running - adds r0, r4, 0 - bl remove_task -_080149B2: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8014790 - - thumb_func_start sub_80149C4 -sub_80149C4: @ 80149C4 - push {lr} - ldr r0, =sub_8014790 - movs r1, 0 - bl AddTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80149C4 - - thumb_func_start sub_80149D8 -sub_80149D8: @ 80149D8 - push {lr} - ldr r0, =sub_801440C - movs r1, 0 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0 - strh r0, [r1, 0x8] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80149D8 - - thumb_func_start sub_8014A00 -sub_8014A00: @ 8014A00 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =sub_8014A40 - movs r1, 0 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02022c30 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r1, r0 - str r1, [r2] - movs r2, 0 - strb r2, [r1, 0xC] - strb r2, [r1, 0xD] - strb r4, [r1, 0x18] - ldr r0, =0x020375f0 - strh r2, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8014A00 - - thumb_func_start sub_8014A40 -sub_8014A40: @ 8014A40 - push {r4-r6,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02022c30 - ldr r5, [r0] - ldrb r0, [r5, 0xC] - cmp r0, 0x11 - bls _08014A54 - b _08014EF2 -_08014A54: - lsls r0, 2 - ldr r1, =_08014A68 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08014A68: - .4byte _08014AB0 - .4byte _08014AEC - .4byte _08014BBC - .4byte _08014BEC - .4byte _08014BFC - .4byte _08014C4C - .4byte _08014C24 - .4byte _08014C52 - .4byte _08014CF2 - .4byte _08014DBC - .4byte _08014DCC - .4byte _08014DE2 - .4byte _08014DFA - .4byte _08014E16 - .4byte _08014E4E - .4byte _08014E74 - .4byte _08014EA8 - .4byte _08014EE2 -_08014AB0: - ldr r1, =0x02022c2c - ldrb r0, [r5, 0x18] - strb r0, [r1] - ldr r1, =0x02022c2d - movs r0, 0x2 - strb r0, [r1] - ldrb r0, [r5, 0x18] - movs r1, 0 - movs r2, 0 - bl sub_8010F84 - movs r0, 0 - movs r1, 0 - bl sub_8010FA0 - bl sub_800B488 - bl sub_8009734 - movs r0, 0x2 - bl sub_8011C10 - movs r0, 0x1 - strb r0, [r5, 0xC] - b _08014EF2 - .pool -_08014AEC: - movs r0, 0x70 - bl AllocZeroed - str r0, [r5, 0x4] - movs r0, 0xA0 - bl AllocZeroed - str r0, [r5] - movs r0, 0xA0 - bl AllocZeroed - str r0, [r5, 0x8] - ldr r0, [r5, 0x4] - movs r1, 0x4 - bl sub_80175EC - ldr r0, [r5] - movs r1, 0x5 - bl sub_8017580 - ldr r0, [r5] - adds r1, r0, 0 - adds r1, 0x10 - bl sub_800DF90 - ldr r1, [r5] - movs r3, 0 - movs r0, 0 - strh r0, [r1, 0x18] - ldr r2, [r5] - ldrb r1, [r2, 0x1A] - subs r0, 0x4 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x1A] - ldr r2, [r5] - ldrb r1, [r2, 0x1A] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x1A] - ldr r0, [r5] - strb r3, [r0, 0x1B] - ldr r0, [r5, 0x4] - movs r1, 0xFF - bl sub_8016FC0 - strb r0, [r5, 0x17] - ldr r0, =gUnknown_082F011C - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp] - str r1, [sp, 0x4] - bl sub_8019930 - lsls r0, 16 - ldr r2, =0x0000ffff - ldr r1, [sp, 0x4] - ands r1, r2 - orrs r1, r0 - ldr r0, =0xffff00ff - ands r1, r0 - movs r0, 0xC0 - lsls r0, 4 - orrs r1, r0 - str r1, [sp, 0x4] - mov r0, sp - bl AddWindow - strb r0, [r5, 0xF] - ldrb r0, [r5, 0xF] - bl sub_8018784 - ldr r0, =0x03006310 - adds r2, r0, 0 - ldr r1, =gUnknown_082F015C - ldm r1!, {r3,r4,r6} - stm r2!, {r3,r4,r6} - ldm r1!, {r3,r4,r6} - stm r2!, {r3,r4,r6} - ldrb r1, [r5, 0xF] - strb r1, [r0, 0x10] - movs r1, 0 - movs r2, 0 - bl ListMenuInit - strb r0, [r5, 0x12] - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x1 - strb r0, [r5, 0x13] - b _08014C42 - .pool -_08014BBC: - ldr r0, =0x02021cc4 - ldr r2, =gUnknown_082F0048 - ldr r4, =0x02022c2c - ldrb r1, [r4] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl CopyString - ldr r0, =0x02021fc4 - ldrb r1, [r4] - bl sub_801262C - movs r0, 0x3 - strb r0, [r5, 0xC] - b _08014EF2 - .pool -_08014BEC: - ldr r0, =0x02021fc4 - bl sub_8018884 - movs r0, 0x4 - strb r0, [r5, 0xC] - b _08014EF2 - .pool -_08014BFC: - adds r0, r5, 0 - movs r1, 0x5 - movs r2, 0x6 - bl sub_801320C - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08014C14 - b _08014EF2 -_08014C14: - movs r0, 0xD - strb r0, [r5, 0xC] - bl sub_800E084 - b _08014EF2 - .pool -_08014C24: - adds r0, r5, 0 - adds r0, 0xD - ldr r1, =gUnknown_082EDF40 - bl mevent_0814257C - cmp r0, 0 - bne _08014C34 - b _08014EF2 -_08014C34: - ldr r0, [r5] - bl sub_8013398 - strb r0, [r5, 0x13] - ldrb r0, [r5, 0x12] - bl sub_81AE70C -_08014C42: - movs r0, 0x2 - strb r0, [r5, 0xC] - b _08014EF2 - .pool -_08014C4C: - movs r0, 0x7 - strb r0, [r5, 0xC] - b _08014EF2 -_08014C52: - adds r0, r5, 0 - adds r0, 0xD - adds r1, r5, 0 - adds r1, 0x14 - ldr r3, =0x02021fc4 - movs r2, 0 - bl sub_8018B08 - lsls r0, 24 - asrs r4, r0, 24 - cmp r4, 0 - beq _08014C82 - cmp r4, 0 - bgt _08014C7C - movs r0, 0x1 - negs r0, r0 - cmp r4, r0 - beq _08014CC4 - b _08014EF2 - .pool -_08014C7C: - cmp r4, 0x1 - beq _08014CC4 - b _08014EF2 -_08014C82: - bl sub_800E0E8 - movs r0, 0 - movs r1, 0 - bl sub_800DFB4 - ldr r1, [r5] - ldrb r0, [r5, 0x13] - lsls r0, 5 - adds r1, r0 - strb r4, [r1, 0x1B] - ldrb r0, [r5, 0x12] - bl sub_81AE70C - movs r0, 0x5 - strb r0, [r5, 0x19] - ldrb r1, [r5, 0x13] - lsls r1, 5 - ldr r0, [r5] - adds r0, r1 - adds r0, 0x2 - bl sub_8015658 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - ldrb r0, [r5, 0x13] - lsls r0, 5 - ldr r2, [r5] - adds r2, r0 - adds r2, 0x10 - movs r0, 0x5 - b _08014CE8 -_08014CC4: - movs r0, 0x6 - strb r0, [r5, 0x19] - ldrb r1, [r5, 0x13] - lsls r1, 5 - ldr r0, [r5] - adds r0, r1 - adds r0, 0x2 - bl sub_8015658 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - ldrb r0, [r5, 0x13] - lsls r0, 5 - ldr r2, [r5] - adds r2, r0 - adds r2, 0x10 - movs r0, 0x6 -_08014CE8: - bl sub_8010688 - movs r0, 0x8 - strb r0, [r5, 0xC] - b _08014EF2 -_08014CF2: - ldrb r1, [r5, 0x13] - lsls r1, 5 - ldr r0, [r5] - adds r0, r1 - adds r0, 0x2 - bl sub_8015658 - lsls r0, 16 - lsrs r0, 16 - ldrb r2, [r5, 0x13] - lsls r2, 5 - ldr r1, [r5] - adds r1, r2 - adds r1, 0x10 - bl sub_8010714 - adds r4, r0, 0 - cmp r4, 0x1 - bne _08014DAA - ldrb r0, [r5, 0x19] - cmp r0, 0x5 - bne _08014D64 - ldr r1, [r5] - ldrb r0, [r5, 0x13] - lsls r0, 5 - adds r1, r0 - movs r0, 0 - strb r0, [r1, 0x1B] - ldrb r0, [r5, 0x12] - bl sub_81AE70C - ldrb r0, [r5, 0x13] - adds r0, 0x1 - strb r0, [r5, 0x13] - ldr r0, =0x02021cc4 - ldrb r2, [r5, 0x13] - lsls r2, 5 - subs r2, 0x20 - ldr r1, [r5] - adds r1, r2 - bl sub_8018404 - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_082EDC9C - bl ExpandStringRefs - movs r0, 0x9 - strb r0, [r5, 0xC] - bl sub_800EF38 - b _08014DA4 - .pool -_08014D64: - ldrb r1, [r5, 0x13] - lsls r1, 5 - ldr r0, [r5] - adds r0, r1 - adds r4, r0, 0 - adds r4, 0x10 - adds r0, 0x2 - bl sub_8015658 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_8011DC0 - ldr r1, [r5] - ldrb r0, [r5, 0x13] - lsls r0, 5 - adds r1, r0 - ldrb r2, [r1, 0x1A] - movs r0, 0x4 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1A] - ldr r0, [r5] - bl sub_8013398 - ldrb r0, [r5, 0x12] - bl sub_81AE70C - movs r0, 0x2 - strb r0, [r5, 0xC] -_08014DA4: - movs r0, 0 - strb r0, [r5, 0x19] - b _08014EF2 -_08014DAA: - cmp r4, 0x2 - beq _08014DB0 - b _08014EF2 -_08014DB0: - movs r0, 0 - movs r1, 0 - bl sub_8011A64 - strb r4, [r5, 0xC] - b _08014EF2 -_08014DBC: - ldr r0, =0x02021fc4 - bl sub_8018884 - movs r0, 0xA - strb r0, [r5, 0xC] - b _08014EF2 - .pool -_08014DCC: - ldrb r0, [r5, 0xE] - adds r0, 0x1 - strb r0, [r5, 0xE] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x78 - bhi _08014DDC - b _08014EF2 -_08014DDC: - movs r0, 0xB - strb r0, [r5, 0xC] - b _08014EF2 -_08014DE2: - adds r0, r5, 0 - movs r1, 0x5 - movs r2, 0x6 - bl sub_801320C - lsls r0, 24 - cmp r0, 0 - beq _08014DF4 - b _08014EF2 -_08014DF4: - movs r0, 0xC - strb r0, [r5, 0xC] - b _08014EF2 -_08014DFA: - bl sub_800EF1C - lsls r0, 24 - cmp r0, 0 - beq _08014E10 - movs r0, 0 - bl sub_800EF58 - movs r0, 0xF - strb r0, [r5, 0xC] - b _08014EF2 -_08014E10: - movs r0, 0x6 - strb r0, [r5, 0xC] - b _08014EF2 -_08014E16: - bl sub_800E084 - bl sub_800EDD4 - ldrb r0, [r5, 0x12] - movs r1, 0 - movs r2, 0 - bl sub_81AE6C8 - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldrb r0, [r5, 0xF] - bl RemoveWindow - ldrb r0, [r5, 0x17] - bl remove_task - ldr r0, [r5, 0x8] - bl Free - ldr r0, [r5] - bl Free - ldr r0, [r5, 0x4] - bl Free - b _08014EDA -_08014E4E: - adds r0, r5, 0 - adds r0, 0xD - ldr r1, =gUnknown_082ED8D0 - bl mevent_0814257C - cmp r0, 0 - beq _08014EF2 - adds r0, r4, 0 - bl remove_task - ldr r1, =0x020375f0 - movs r0, 0x5 - strh r0, [r1] - b _08014EF2 - .pool -_08014E74: - bl sub_8011A74 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08014E8C - bl sub_8011A74 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08014E92 -_08014E8C: - movs r0, 0xD - strb r0, [r5, 0xC] - b _08014EF2 -_08014E92: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _08014EF2 - movs r0, 0x1 - bl sub_8011068 - b _08014EDA - .pool -_08014EA8: - ldrb r0, [r5, 0x12] - movs r1, 0 - movs r2, 0 - bl sub_81AE6C8 - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldrb r0, [r5, 0xF] - bl RemoveWindow - ldrb r0, [r5, 0x17] - bl remove_task - ldr r0, [r5, 0x8] - bl Free - ldr r0, [r5] - bl Free - ldr r0, [r5, 0x4] - bl Free - bl sub_800ADF8 -_08014EDA: - ldrb r0, [r5, 0xC] - adds r0, 0x1 - strb r0, [r5, 0xC] - b _08014EF2 -_08014EE2: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08014EF2 - adds r0, r4, 0 - bl remove_task -_08014EF2: - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8014A40 - - thumb_func_start sub_8014EFC -sub_8014EFC: @ 8014EFC - push {r4,lr} - adds r4, r0, 0 - ldr r0, =sub_8014F48 - movs r1, 0 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02022c30 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r1, r0 - str r1, [r2] - ldr r0, =0x03000da4 - str r1, [r0] - movs r2, 0 - strb r2, [r1, 0x8] - strb r2, [r1, 0x9] - subs r4, 0x15 - strb r4, [r1, 0x12] - ldr r0, =0x020375f0 - strh r2, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8014EFC - - thumb_func_start sub_8014F48 -sub_8014F48: @ 8014F48 - push {r4-r7,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x02022c30 - ldr r7, [r0] - ldrb r0, [r7, 0x8] - cmp r0, 0xC - bls _08014F5C - b _080152A0 -_08014F5C: - lsls r0, 2 - ldr r1, =_08014F70 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08014F70: - .4byte _08014FA4 - .4byte _08014FD8 - .4byte _08014FE8 - .4byte _080150B8 - .4byte _08015180 - .4byte _080151A4 - .4byte _08015204 - .4byte _08015260 - .4byte _08015204 - .4byte _0801523A - .4byte _08015204 - .4byte _08015284 - .4byte _08015290 -_08014FA4: - ldrb r0, [r7, 0x12] - adds r0, 0x15 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - movs r2, 0 - bl sub_8010F84 - bl sub_800B488 - bl sub_8009734 - bl sub_8011C5C - movs r0, 0x70 - bl AllocZeroed - str r0, [r7, 0x4] - movs r0, 0x80 - lsls r0, 2 - bl AllocZeroed - str r0, [r7] - movs r0, 0x1 - strb r0, [r7, 0x8] - b _080152A0 -_08014FD8: - ldr r0, =gUnknown_082EF7F8 - bl sub_8018884 - movs r0, 0x2 - strb r0, [r7, 0x8] - b _080152A0 - .pool -_08014FE8: - ldr r0, [r7, 0x4] - movs r1, 0x4 - bl sub_80175EC - ldr r0, [r7] - movs r1, 0x10 - bl sub_8017580 - ldr r0, [r7, 0x4] - ldrb r1, [r7, 0x12] - adds r1, 0x7 - bl sub_8016FC0 - movs r6, 0 - strb r0, [r7, 0x11] - ldr r0, =gUnknown_082F0174 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp] - str r1, [sp, 0x4] - bl sub_8019930 - lsls r0, 16 - ldr r2, =0x0000ffff - ldr r1, [sp, 0x4] - ands r1, r2 - orrs r1, r0 - ldr r5, =0xffff00ff - ands r1, r5 - movs r4, 0xC0 - lsls r4, 4 - orrs r1, r4 - str r1, [sp, 0x4] - mov r0, sp - bl AddWindow - strb r0, [r7, 0xB] - ldr r0, =gUnknown_082F017C - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp, 0x8] - str r1, [sp, 0xC] - add r0, sp, 0x8 - ldr r1, [r0, 0x4] - ands r1, r5 - orrs r1, r4 - str r1, [r0, 0x4] - bl AddWindow - strb r0, [r7, 0xD] - ldrb r0, [r7, 0xB] - bl sub_8018784 - ldr r0, =0x03006310 - adds r2, r0, 0 - ldr r1, =gUnknown_082F0204 - ldm r1!, {r3-r5} - stm r2!, {r3-r5} - ldm r1!, {r3-r5} - stm r2!, {r3-r5} - ldrb r1, [r7, 0xB] - strb r1, [r0, 0x10] - movs r1, 0 - movs r2, 0 - bl ListMenuInit - strb r0, [r7, 0xE] - ldrb r0, [r7, 0xD] - bl sub_8018784 - ldrb r0, [r7, 0xD] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldrb r0, [r7, 0xD] - bl PutWindowTilemap - ldrb r0, [r7, 0xD] - bl sub_80125BC - ldrb r0, [r7, 0xD] - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0 - bl CopyBgTilemapBufferToVram - strb r6, [r7, 0xF] - movs r0, 0x3 - strb r0, [r7, 0x8] - b _080152A0 - .pool -_080150B8: - bl sub_8013E44 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - beq _080150D6 - cmp r2, 0x1 - bne _080150CE - movs r0, 0x2 - bl audio_play -_080150CE: - ldrb r0, [r7, 0xE] - bl sub_81AE70C - b _080152A0 -_080150D6: - ldrb r0, [r7, 0xE] - bl ListMenuHandleInput - adds r2, r0, 0 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08015168 - movs r0, 0x1 - negs r0, r0 - cmp r2, r0 - beq _08015168 - ldr r0, [r7] - lsls r1, r2, 5 - adds r0, r1 - ldrb r1, [r0, 0xA] - ldrb r0, [r0, 0x1A] - lsls r0, 30 - lsrs r0, 30 - cmp r0, 0x1 - bne _08015160 - lsrs r0, r1, 7 - cmp r0, 0 - bne _08015160 - strb r2, [r7, 0xF] - bl sub_800E0E8 - movs r0, 0 - movs r1, 0 - bl sub_800DFB4 - ldrb r0, [r7, 0xE] - bl sub_81AE70C - ldr r0, =0x02021cc4 - ldrb r2, [r7, 0xF] - lsls r2, 5 - ldr r1, [r7] - adds r1, r2 - bl sub_8018404 - ldrb r1, [r7, 0xF] - lsls r1, 5 - ldr r0, [r7] - adds r0, r1 - adds r4, r0, 0 - adds r4, 0x10 - adds r0, 0x2 - bl sub_8015658 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_8011FC8 - movs r0, 0x6E - bl audio_play - movs r0, 0x4 - strb r0, [r7, 0x8] - b _080152A0 - .pool -_08015160: - movs r0, 0x7 - bl audio_play - b _080152A0 -_08015168: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08015176 - b _080152A0 -_08015176: - movs r0, 0x6 - strb r0, [r7, 0x8] - b _080152A0 - .pool -_08015180: - ldr r0, =gUnknown_082EFC3C - bl sub_8018884 - ldr r0, =0x02021cc4 - ldrb r2, [r7, 0xF] - lsls r2, 5 - ldr r1, [r7] - adds r1, r2 - bl sub_8018404 - movs r0, 0x5 - strb r0, [r7, 0x8] - b _080152A0 - .pool -_080151A4: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _080151C2 - ldr r2, =0x02022c2c - ldr r1, [r7] - ldrb r0, [r7, 0xF] - lsls r0, 5 - adds r1, r0 - ldrb r0, [r1, 0xA] - lsls r0, 25 - lsrs r0, 25 - strb r0, [r2] - movs r0, 0xA - strb r0, [r7, 0x8] -_080151C2: - bl sub_8011A74 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - beq _080151EE - cmp r0, 0x5 - bgt _080151E4 - cmp r0, 0x2 - bgt _080152A0 - cmp r0, 0x1 - blt _080152A0 - b _080151E8 - .pool -_080151E4: - cmp r0, 0x6 - bne _080152A0 -_080151E8: - movs r0, 0x8 - strb r0, [r7, 0x8] - b _080152A0 -_080151EE: - ldr r0, =gUnknown_082EDDF4 - bl sub_8018884 - movs r0, 0 - movs r1, 0 - bl sub_8011A64 - b _080152A0 - .pool -_08015204: - ldrb r0, [r7, 0xE] - movs r1, 0 - movs r2, 0 - bl sub_81AE6C8 - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldrb r0, [r7, 0xD] - bl RemoveWindow - ldrb r0, [r7, 0xB] - bl RemoveWindow - ldrb r0, [r7, 0x11] - bl remove_task - ldr r0, [r7] - bl Free - ldr r0, [r7, 0x4] - bl Free - ldrb r0, [r7, 0x8] - adds r0, 0x1 - strb r0, [r7, 0x8] - b _080152A0 -_0801523A: - adds r5, r7, 0 - adds r5, 0x9 - ldr r4, =gUnknown_082EDF80 - bl sub_8011A74 - lsls r0, 24 - lsrs r0, 22 - adds r0, r4 - ldr r1, [r0] - adds r0, r5, 0 - bl mevent_0814257C - cmp r0, 0 - beq _080152A0 - bl sub_800E084 - b _0801526A - .pool -_08015260: - bl sub_800E084 - ldr r0, =gUnknown_082ED8D0 - bl sub_8018884 -_0801526A: - adds r0, r6, 0 - bl remove_task - bl sub_800EDD4 - ldr r1, =0x020375f0 - movs r0, 0x5 - strh r0, [r1] - b _080152A0 - .pool -_08015284: - ldrb r0, [r7, 0x8] - adds r0, 0x1 - strb r0, [r7, 0x8] - bl sub_800ADF8 - b _080152A0 -_08015290: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080152A0 - adds r0, r6, 0 - bl remove_task -_080152A0: - add sp, 0x10 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8014F48 - - thumb_func_start sub_80152A8 -sub_80152A8: @ 80152A8 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =task00_081182DC - movs r1, 0 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02022c30 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r1, r0 - str r1, [r2] - ldr r0, =0x03000da4 - str r1, [r0] - movs r2, 0 - strb r2, [r1, 0x8] - strb r2, [r1, 0x9] - subs r4, 0x15 - strb r4, [r1, 0x12] - ldr r0, =0x020375f0 - strh r2, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80152A8 - - thumb_func_start task00_081182DC -task00_081182DC: @ 80152F4 - push {r4-r6,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02022c30 - ldr r5, [r0] - ldrb r0, [r5, 0x8] - cmp r0, 0xE - bls _08015308 - b _08015604 -_08015308: - lsls r0, 2 - ldr r1, =_0801531C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0801531C: - .4byte _08015358 - .4byte _08015386 - .4byte _08015398 - .4byte _08015420 - .4byte _080154E0 - .4byte _08015504 - .4byte _08015564 - .4byte _080155A8 - .4byte _08015564 - .4byte _0801559A - .4byte _08015564 - .4byte _080155B4 - .4byte _08015564 - .4byte _080155E8 - .4byte _080155F4 -_08015358: - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl sub_8010F84 - bl sub_800B488 - bl sub_8009734 - bl sub_8011C5C - movs r0, 0x70 - bl AllocZeroed - str r0, [r5, 0x4] - movs r0, 0x80 - lsls r0, 2 - bl AllocZeroed - str r0, [r5] - movs r0, 0x1 - strb r0, [r5, 0x8] - b _08015604 -_08015386: - ldr r0, =gUnknown_082EFBC8 - bl sub_8018884 - movs r0, 0x2 - strb r0, [r5, 0x8] - b _08015604 - .pool -_08015398: - ldr r0, [r5, 0x4] - movs r1, 0x4 - bl sub_80175EC - ldr r0, [r5] - movs r1, 0x10 - bl sub_8017580 - ldr r0, [r5, 0x4] - ldrb r1, [r5, 0x12] - adds r1, 0x7 - bl sub_8016FF0 - strb r0, [r5, 0x11] - ldrb r0, [r5, 0x13] - cmp r0, 0 - beq _08015404 - ldr r0, =gUnknown_082F0174 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp] - str r1, [sp, 0x4] - bl sub_8019930 - lsls r0, 16 - ldr r2, =0x0000ffff - ldr r1, [sp, 0x4] - ands r1, r2 - orrs r1, r0 - str r1, [sp, 0x4] - mov r0, sp - bl AddWindow - strb r0, [r5, 0xB] - ldrb r0, [r5, 0xB] - bl sub_8018784 - ldr r0, =0x03006310 - adds r2, r0, 0 - ldr r1, =gUnknown_082F0204 - ldm r1!, {r3,r4,r6} - stm r2!, {r3,r4,r6} - ldm r1!, {r3,r4,r6} - stm r2!, {r3,r4,r6} - ldrb r1, [r5, 0xB] - strb r1, [r0, 0x10] - movs r1, 0 - movs r2, 0 - bl ListMenuInit - strb r0, [r5, 0xE] - movs r0, 0 - bl CopyBgTilemapBufferToVram -_08015404: - movs r0, 0 - strb r0, [r5, 0xF] - movs r0, 0x3 - strb r0, [r5, 0x8] - b _08015604 - .pool -_08015420: - bl sub_8013E44 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _08015446 - cmp r0, 0x1 - bne _08015436 - movs r0, 0x2 - bl audio_play -_08015436: - ldrb r0, [r5, 0x13] - cmp r0, 0 - bne _0801543E - b _08015604 -_0801543E: - ldrb r0, [r5, 0xE] - bl sub_81AE70C - b _08015604 -_08015446: - ldrb r0, [r5, 0x13] - cmp r0, 0 - beq _08015452 - ldrb r0, [r5, 0xE] - bl ListMenuHandleInput -_08015452: - ldrb r0, [r5, 0x14] - cmp r0, 0x78 - bls _080154C0 - ldr r2, [r5] - ldrb r1, [r2, 0x1A] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x1 - bne _080154D4 - ldrb r1, [r2, 0xA] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _080154D4 - ldrb r1, [r5, 0x12] - adds r1, 0x7 - adds r0, r2, 0 - bl sub_8016F1C - cmp r0, 0 - beq _080154B4 - strb r4, [r5, 0xF] - strb r4, [r5, 0x14] - bl sub_800E0E8 - movs r0, 0 - movs r1, 0 - bl sub_800DFB4 - ldr r0, [r5] - adds r4, r0, 0 - adds r4, 0x10 - adds r0, 0x2 - bl sub_8015658 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_8011FC8 - movs r0, 0x6E - bl audio_play - movs r0, 0x4 - strb r0, [r5, 0x8] - b _080154D4 -_080154B4: - movs r0, 0x16 - bl audio_play - movs r0, 0xA - strb r0, [r5, 0x8] - b _080154D4 -_080154C0: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080154D4 - movs r1, 0 - movs r0, 0x6 - strb r0, [r5, 0x8] - strb r1, [r5, 0x14] -_080154D4: - ldrb r0, [r5, 0x14] - adds r0, 0x1 - strb r0, [r5, 0x14] - b _08015604 - .pool -_080154E0: - ldr r0, =gUnknown_082EFC90 - bl sub_8018884 - ldr r0, =0x02021cc4 - ldrb r2, [r5, 0xF] - lsls r2, 5 - ldr r1, [r5] - adds r1, r2 - bl sub_8018404 - movs r0, 0x5 - strb r0, [r5, 0x8] - b _08015604 - .pool -_08015504: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _08015522 - ldr r2, =0x02022c2c - ldr r1, [r5] - ldrb r0, [r5, 0xF] - lsls r0, 5 - adds r1, r0 - ldrb r0, [r1, 0xA] - lsls r0, 25 - lsrs r0, 25 - strb r0, [r2] - movs r0, 0xC - strb r0, [r5, 0x8] -_08015522: - bl sub_8011A74 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - beq _0801554E - cmp r0, 0x5 - bgt _08015544 - cmp r0, 0x2 - bgt _08015604 - cmp r0, 0x1 - blt _08015604 - b _08015548 - .pool -_08015544: - cmp r0, 0x6 - bne _08015604 -_08015548: - movs r0, 0x8 - strb r0, [r5, 0x8] - b _08015604 -_0801554E: - ldr r0, =gUnknown_082EDEC4 - bl sub_8018884 - movs r0, 0 - movs r1, 0 - bl sub_8011A64 - b _08015604 - .pool -_08015564: - ldrb r0, [r5, 0x13] - cmp r0, 0 - beq _08015580 - ldrb r0, [r5, 0xE] - movs r1, 0 - movs r2, 0 - bl sub_81AE6C8 - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldrb r0, [r5, 0xB] - bl RemoveWindow -_08015580: - ldrb r0, [r5, 0x11] - bl remove_task - ldr r0, [r5] - bl Free - ldr r0, [r5, 0x4] - bl Free - ldrb r0, [r5, 0x8] - adds r0, 0x1 - strb r0, [r5, 0x8] - b _08015604 -_0801559A: - adds r0, r5, 0 - adds r0, 0x9 - ldr r1, =gUnknown_082EDF04 - b _080155C2 - .pool -_080155A8: - adds r0, r5, 0 - adds r0, 0x9 - ldr r1, =gUnknown_082ED8F8 - b _080155C2 - .pool -_080155B4: - adds r0, r5, 0 - adds r0, 0x9 - ldr r2, =gUnknown_082EFD58 - ldrb r1, [r5, 0x12] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] -_080155C2: - bl mevent_0814257C - cmp r0, 0 - beq _08015604 - bl sub_800E084 - adds r0, r4, 0 - bl remove_task - bl sub_800EDD4 - ldr r1, =0x020375f0 - movs r0, 0x5 - strh r0, [r1] - b _08015604 - .pool -_080155E8: - ldrb r0, [r5, 0x8] - adds r0, 0x1 - strb r0, [r5, 0x8] - bl sub_800ADF8 - b _08015604 -_080155F4: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08015604 - adds r0, r4, 0 - bl remove_task -_08015604: - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end task00_081182DC - - thumb_func_start UnionRoomSpecial -UnionRoomSpecial: @ 801560C - push {r4,lr} - bl sub_8010F60 - ldr r0, =sub_80156E0 - movs r1, 0xA - bl AddTask - ldr r4, =0x02022c30 - movs r0, 0x9B - lsls r0, 2 - bl AllocZeroed - str r0, [r4] - ldr r1, =0x03000da8 - str r0, [r1] - movs r1, 0 - strb r1, [r0, 0x14] - strb r1, [r0, 0x16] - strh r1, [r0, 0x10] - strh r1, [r0, 0x12] - ldr r0, =0x020375f0 - strh r1, [r0] - movs r0, 0xD0 - movs r1, 0x1 - bl sub_819A2BC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end UnionRoomSpecial - - thumb_func_start sub_8015658 -sub_8015658: @ 8015658 - ldrb r1, [r0, 0x1] - lsls r1, 8 - ldrb r0, [r0] - orrs r0, r1 - bx lr - thumb_func_end sub_8015658 - - thumb_func_start sub_8015664 -sub_8015664: @ 8015664 - push {lr} - adds r3, r1, 0 - ldr r1, =0x02022c30 - ldr r2, [r1] - movs r1, 0x8 - strb r1, [r2, 0x14] - strb r0, [r2, 0x15] - ldr r0, =0x02021fc4 - cmp r3, r0 - beq _0801567E - adds r1, r3, 0 - bl ExpandStringRefs -_0801567E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8015664 - - thumb_func_start sub_801568C -sub_801568C: @ 801568C - push {lr} - adds r2, r0, 0 - ldr r0, =0x02022c30 - ldr r1, [r0] - movs r0, 0x1A - strb r0, [r1, 0x14] - ldr r0, =0x02021fc4 - cmp r2, r0 - beq _080156A4 - adds r1, r2, 0 - bl ExpandStringRefs -_080156A4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_801568C - - thumb_func_start sub_80156B0 -sub_80156B0: @ 80156B0 - push {lr} - ldr r3, =0x0201ff00 - ldr r1, [r0] - movs r2, 0x80 - lsls r2, 1 - adds r0, r3, 0 - bl memcpy - pop {r0} - bx r0 - .pool - thumb_func_end sub_80156B0 - - thumb_func_start sub_80156C8 -sub_80156C8: @ 80156C8 - push {lr} - ldr r0, [r0] - ldr r1, =0x0201ff00 - movs r2, 0x80 - lsls r2, 1 - bl memcpy - pop {r0} - bx r0 - .pool - thumb_func_end sub_80156C8 - - thumb_func_start sub_80156E0 -sub_80156E0: @ 80156E0 - push {r4-r7,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r4, r0, 24 - movs r5, 0 - ldr r0, =0x02022c30 - ldr r6, [r0] - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r7, r0, r1 - ldrb r0, [r6, 0x14] - cmp r0, 0x38 - bls _08015702 - bl _08016878 -_08015702: - lsls r0, 2 - ldr r1, =_08015718 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08015718: - .4byte _080157FC - .4byte _08015854 - .4byte _08015878 - .4byte _080158C8 - .4byte _080159A6 - .4byte _08015E5C - .4byte _08015C54 - .4byte _08015E5C - .4byte _08016864 - .4byte _080161C8 - .4byte _080162D4 - .4byte _080160AC - .4byte _080160C6 - .4byte _08016324 - .4byte _08016348 - .4byte _08016350 - .4byte _08016360 - .4byte _0801638E - .4byte _080163A2 - .4byte _08015F32 - .4byte _08015FB8 - .4byte _08015FD6 - .4byte _0801604A - .4byte _08015ADA - .4byte _08015B00 - .4byte _08015B78 - .4byte _08016838 - .4byte _08015D4C - .4byte _08015D34 - .4byte _08015DD0 - .4byte _08015C2A - .4byte _08015DA6 - .4byte _08015D9C - .4byte _08016158 - .4byte _08016178 - .4byte _080161B8 - .4byte _080162DC - .4byte _08016318 - .4byte _08015BF4 - .4byte _08016104 - .4byte _08015E94 - .4byte _08015EC4 - .4byte _080163CC - .4byte _0801645C - .4byte _080165A8 - .4byte _08016610 - .4byte _0801662C - .4byte _08016478 - .4byte _08016634 - .4byte _08016738 - .4byte _0801676C - .4byte _080167F4 - .4byte _0801652C - .4byte _080164E0 - .4byte _080164F4 - .4byte _0801658C - .4byte _080165DC -_080157FC: - movs r0, 0x70 - bl AllocZeroed - str r0, [r6, 0x4] - movs r0, 0x70 - bl AllocZeroed - str r0, [r6, 0xC] - movs r0, 0x80 - lsls r0, 1 - bl AllocZeroed - str r0, [r6] - movs r0, 0x20 - bl AllocZeroed - str r0, [r6, 0x8] - ldr r0, [r6] - movs r1, 0x8 - bl sub_8017580 - ldr r1, =0x02022c2c - movs r0, 0x40 - strb r0, [r1] - ldr r0, [r6, 0xC] - ldr r1, [r6, 0x4] - movs r2, 0x9 - bl sub_8016DF0 - adds r1, r6, 0 - adds r1, 0x20 - strb r0, [r1] - adds r0, r6, 0 - adds r0, 0xA0 - bl sub_8019BA8 - bl sub_8019F2C - movs r0, 0x1 - bl _08016876 - .pool -_08015854: - adds r0, r6, 0 - adds r0, 0x21 - movs r2, 0 - ldrsh r1, [r7, r2] - bl sub_8019E70 - ldrh r0, [r7] - adds r0, 0x1 - strh r0, [r7] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - beq _08015872 - bl _08016878 -_08015872: - movs r0, 0x2 - bl _08016876 -_08015878: - movs r0, 0x40 - movs r1, 0 - movs r2, 0 - bl sub_8010F84 - ldr r2, =0x02022c40 - ldrh r0, [r2, 0x2] - ldrh r1, [r2, 0xA] - ldrh r2, [r2, 0xC] - bl sub_8010FCC - bl sub_800B488 - bl sub_8009734 - bl sub_8011C84 - ldr r0, [r6, 0x8] - movs r1, 0x1 - bl sub_8017580 - ldr r0, [r6, 0x4] - movs r1, 0x4 - bl sub_80175EC - ldr r0, [r6, 0xC] - movs r1, 0x4 - bl sub_80175EC - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - movs r0, 0x3 - bl _08016876 - .pool -_080158C8: - bl sub_81B1360 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x8 - beq _080158E0 - bl sub_81B1360 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x9 - bne _080159A0 -_080158E0: - ldr r4, =0x02022c40 - ldrh r0, [r4] - cmp r0, 0 - beq _080159A0 - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r5, r0, 24 - ldrh r0, [r4] - cmp r0, 0x1 - beq _08015900 - cmp r0, 0x2 - beq _08015950 - b _0801598E - .pool -_08015900: - movs r0, 0x54 - movs r1, 0 - movs r2, 0x1 - bl sub_8011090 - cmp r5, 0x5 - bls _0801592C - adds r0, r4, 0 - bl sub_801807C - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl sub_8010FCC - ldr r0, =gUnknown_082EF4FC - bl sub_801568C - b _0801598E - .pool -_0801592C: - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - bl sub_80180A0 - cmp r0, 0 - bne _0801594C - ldr r1, =gUnknown_082EF47C - movs r0, 0x34 - bl sub_8015664 - b _0801598E - .pool -_0801594C: - movs r0, 0x37 - b _0801598C -_08015950: - adds r0, r6, 0 - bl sub_80156C8 - ldrb r0, [r4, 0x8] - strh r0, [r7, 0x2] - cmp r5, 0x5 - bls _0801596C - ldr r0, =gUnknown_082EF544 - bl sub_801568C - b _0801598E - .pool -_0801596C: - movs r0, 0x54 - movs r1, 0 - movs r2, 0x1 - bl sub_8011090 - ldr r1, =0x02022c2c - movs r0, 0x44 - strb r0, [r1] - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - bl sub_80180E8 - movs r0, 0x33 -_0801598C: - strb r0, [r6, 0x14] -_0801598E: - ldr r1, =0x02022c40 - movs r0, 0 - strh r0, [r1] - bl _08016878 - .pool -_080159A0: - movs r0, 0x4 - bl _08016876 -_080159A6: - ldr r4, =0x020375f0 - ldrh r0, [r4] - cmp r0, 0 - beq _08015A0A - cmp r0, 0x9 - bne _080159E0 - movs r0, 0x54 - movs r1, 0 - movs r2, 0x1 - bl sub_8011090 - movs r0, 0x2 - bl audio_play - ldr r0, =0x02021cc4 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - movs r1, 0 - movs r0, 0x2A - b _08015A02 - .pool -_080159E0: - cmp r0, 0xB - bne _080159F4 - movs r0, 0x54 - movs r1, 0 - movs r2, 0x1 - bl sub_8011090 - movs r1, 0 - movs r0, 0x17 - b _08015A02 -_080159F4: - movs r0, 0 - strh r0, [r7] - ldrh r0, [r4] - subs r0, 0x1 - strh r0, [r7, 0x2] - movs r1, 0 - movs r0, 0x18 -_08015A02: - strb r0, [r6, 0x14] - strh r1, [r4] - bl _08016878 -_08015A0A: - bl script_env_2_is_enabled - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08015A1A - bl _08016878 -_08015A1A: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08015A80 - ldr r0, [r6] - adds r2, r7, 0x2 - adds r3, r6, 0 - adds r3, 0x21 - adds r1, r7, 0 - bl sub_801A2A8 - cmp r0, 0 - beq _08015A4C - movs r0, 0x5 - bl audio_play - bl sub_80181CC - movs r0, 0x18 - bl _08016876 - .pool -_08015A4C: - bl sub_8017940 - cmp r0, 0 - beq _08015A80 - movs r0, 0x54 - movs r1, 0 - movs r2, 0x1 - bl sub_8011090 - movs r0, 0x2 - bl audio_play - bl sub_80181CC - ldr r0, =0x02021cc4 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - movs r0, 0x2D - bl _08016876 - .pool -_08015A80: - bl sub_8016B00 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _08015AA2 - cmp r0, 0x2 - bgt _08015A96 - cmp r0, 0x1 - beq _08015A9C - b _08015AD0 -_08015A96: - cmp r0, 0x4 - beq _08015AAA - b _08015AD0 -_08015A9C: - movs r0, 0x2 - bl audio_play -_08015AA2: - adds r0, r6, 0 - bl sub_801A274 - b _08015AD0 -_08015AAA: - movs r0, 0xB - strb r0, [r6, 0x14] - bl sub_80181CC - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl sub_8010FCC - adds r0, r6, 0 - bl sub_80181DC - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x53 - movs r2, 0 - bl sub_8011090 -_08015AD0: - adds r0, r6, 0 - bl sub_801A284 - bl _08016878 -_08015ADA: - ldr r0, =sub_809FA34 - bl is_function_an_active_task - lsls r0, 24 - cmp r0, 0 - beq _08015AEA - bl _08016878 -_08015AEA: - movs r0, 0x40 - movs r1, 0 - movs r2, 0 - bl sub_8011090 - movs r0, 0x4 - bl _08016876 - .pool -_08015B00: - bl sub_801704C - movs r3, 0x2 - ldrsh r0, [r7, r3] - ldr r1, [r6] - bl sub_8017CF8 - adds r4, r0, 0 - movs r0, 0x54 - movs r1, 0 - movs r2, 0x1 - bl sub_8011090 - ldr r0, [r6] - ldrb r1, [r7] - ldrb r2, [r7, 0x2] - adds r3, r4, 0 - bl sub_80179D4 - cmp r0, 0x1 - beq _08015B44 - cmp r0, 0x1 - bgt _08015B36 - cmp r0, 0 - beq _08015B3E - bl _08016878 -_08015B36: - cmp r0, 0x2 - beq _08015B68 - bl _08016878 -_08015B3E: - movs r0, 0x1A - bl _08016876 -_08015B44: - movs r1, 0x2 - ldrsh r0, [r7, r1] - lsls r0, 5 - ldr r1, [r6] - adds r1, r0 - adds r0, r1, 0 - adds r0, 0x10 - ldr r2, =0x02022c2c - ldrb r2, [r2] - bl sub_8012188 - strh r5, [r6, 0x12] - movs r0, 0x19 - bl _08016876 - .pool -_08015B68: - ldr r1, =0x02021fc4 - movs r0, 0x13 - bl sub_8015664 - bl _08016878 - .pool -_08015B78: - bl sub_801704C - bl sub_8011A74 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - blt _08015BBE - cmp r4, 0x2 - ble _08015B9A - cmp r4, 0x4 - bne _08015BBE - movs r0, 0x1 - bl sub_801818C - strb r4, [r6, 0x14] - b _08015BBE -_08015B9A: - bl sub_8011B90 - cmp r0, 0x1 - bne _08015BB0 - ldr r0, =gUnknown_082EE6C8 - bl sub_801568C - b _08015BB8 - .pool -_08015BB0: - ldr r1, =gUnknown_082EE6C8 - movs r0, 0x1E - bl sub_8015664 -_08015BB8: - ldr r1, =0x02022c2c - movs r0, 0x40 - strb r0, [r1] -_08015BBE: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _08015BCA - bl _08016878 -_08015BCA: - ldr r0, =0x020228c4 - movs r1, 0x1 - bl sub_80143E4 - ldr r0, =sub_80140E0 - movs r1, 0x5 - bl AddTask - movs r0, 0x26 - bl _08016876 - .pool -_08015BF4: - ldr r0, =sub_80140E0 - bl is_function_an_active_task - lsls r0, 24 - cmp r0, 0 - beq _08015C04 - bl _08016878 -_08015C04: - ldr r0, =0x02022c2c - ldrb r0, [r0] - cmp r0, 0x44 - bne _08015C24 - ldr r1, =gUnknown_082EE004 - movs r0, 0x1F - bl sub_8015664 - bl _08016878 - .pool -_08015C24: - movs r0, 0x5 - bl _08016876 -_08015C2A: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _08015C36 - bl _08016878 -_08015C36: - movs r0, 0 - bl sub_801818C - movs r2, 0 - ldrsh r0, [r7, r2] - movs r3, 0x2 - ldrsh r1, [r7, r3] - ldr r2, [r6] - bl sub_801A3D0 - movs r0, 0x2 - bl _08016876 - .pool -_08015C54: - adds r0, r6, 0 - adds r0, 0x16 - adds r1, r6, 0 - adds r1, 0x1B - adds r2, r6, 0 - adds r2, 0x1C - ldr r3, =gUnknown_082F021C - ldr r4, =gUnknown_082F0244 - str r4, [sp] - bl sub_8017178 - adds r5, r0, 0 - movs r0, 0x1 - negs r0, r0 - cmp r5, r0 - bne _08015C78 - bl _08016878 -_08015C78: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _08015C94 - movs r0, 0x1C - bl _08016876 - .pool -_08015C94: - adds r1, r6, 0 - adds r1, 0x98 - movs r0, 0 - strh r0, [r1] - movs r2, 0x2 - ldrsh r0, [r7, r2] - ldr r1, [r6] - bl sub_8017CF8 - movs r0, 0x2 - negs r0, r0 - cmp r5, r0 - beq _08015CB2 - cmp r5, 0x40 - bne _08015CE4 -_08015CB2: - adds r0, r6, 0 - adds r0, 0x4C - movs r1, 0x40 - strh r1, [r0] - bl sub_800FE50 - ldr r0, =0x02021fc4 - ldr r2, =gUnknown_082EEB80 - ldr r1, =0x020229e8 - ldrb r1, [r1, 0x13] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl CopyString - movs r0, 0x20 - bl _08016876 - .pool -_08015CE4: - ldr r0, =0x02022c2c - strb r5, [r0] - ldr r1, =0x02022c2d - lsrs r0, r5, 8 - strb r0, [r1] - lsls r0, r5, 24 - lsrs r0, 24 - cmp r0, 0x41 - bne _08015D18 - bl sub_8018024 - cmp r0, 0 - bne _08015D18 - ldr r1, =gUnknown_082EEBD0 - movs r0, 0x5 - bl sub_8015664 - bl _08016878 - .pool -_08015D18: - ldr r0, =0x02022c2c - ldrb r0, [r0] - movs r1, 0x40 - orrs r1, r0 - adds r0, r6, 0 - adds r0, 0x4C - strh r1, [r0] - bl sub_800FE50 - movs r0, 0x1B - bl _08016876 - .pool -_08015D34: - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_082EEB88 - bl CopyString - movs r0, 0x24 - bl _08016876 - .pool -_08015D4C: - adds r0, r6, 0 - bl sub_8017FD8 - movs r3, 0x2 - ldrsh r0, [r7, r3] - ldr r1, [r6] - bl sub_8017CF8 - adds r4, r0, 0 - adds r0, r6, 0 - adds r0, 0x4C - ldrh r1, [r0] - movs r0, 0x3F - ands r0, r1 - bl sub_8017984 - adds r5, r0, 0 - adds r0, r6, 0 - adds r0, 0x16 - ldr r3, =gUnknown_082EE82C - lsls r1, r5, 2 - lsls r2, r4, 4 - adds r1, r2 - adds r1, r3 - ldr r1, [r1] - bl sub_8017064 - lsls r0, 24 - cmp r0, 0 - bne _08015D8C - bl _08016878 -_08015D8C: - movs r0, 0 - strh r0, [r7, 0x6] - movs r0, 0x1D - bl _08016876 - .pool -_08015D9C: - bl sub_800AC34 - movs r0, 0x24 - bl _08016876 -_08015DA6: - adds r0, r6, 0 - adds r0, 0x4C - movs r1, 0x44 - strh r1, [r0] - ldr r2, =0x02022c40 - ldrh r1, [r2, 0xE] - adds r3, r6, 0 - adds r3, 0x4E - strh r1, [r3] - ldrh r2, [r2, 0x10] - adds r1, r6, 0 - adds r1, 0x50 - strh r2, [r1] - bl sub_800FE50 - movs r0, 0x1D - bl _08016876 - .pool -_08015DD0: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _08015DF4 - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_082EEB88 - bl CopyString - movs r0, 0x1C - bl _08016876 - .pool -_08015DF4: - adds r0, r6, 0 - bl sub_8017FD8 - adds r0, r6, 0 - adds r0, 0x98 - ldrh r0, [r0] - cmp r0, 0x51 - bne _08015E2A - ldr r0, =0x02022c2c - ldrb r0, [r0] - cmp r0, 0x8 - bne _08015E24 - ldr r0, =0x02021fc4 - adds r1, r6, 0 - movs r2, 0 - bl sub_8018220 - movs r0, 0x28 - bl _08016876 - .pool -_08015E24: - movs r0, 0xD - bl _08016876 -_08015E2A: - cmp r0, 0x52 - beq _08015E32 - bl _08016878 -_08015E32: - movs r5, 0 - movs r0, 0x20 - strb r0, [r6, 0x14] - ldr r0, =0x02021fc4 - ldr r4, =0x02022c2c - ldrb r2, [r4] - movs r1, 0x40 - orrs r1, r2 - ldr r2, =0x020229e8 - ldrb r2, [r2, 0x13] - bl sub_8017D9C - strb r5, [r4] - bl _08016878 - .pool -_08015E5C: - movs r0, 0x2 - ldrsh r1, [r7, r0] - lsls r1, 5 - ldr r0, [r6] - adds r0, r1 - bl sub_80179AC - adds r5, r0, 0 - movs r1, 0x2 - ldrsh r0, [r7, r1] - ldr r1, [r6] - bl sub_8017CF8 - adds r4, r0, 0 - ldr r2, =gUnknown_082EE24C - lsls r0, r4, 2 - lsls r1, r5, 3 - adds r0, r1 - adds r0, r2 - ldr r1, [r0] - movs r0, 0x6 - bl sub_8015664 - bl _08016878 - .pool -_08015E94: - adds r0, r6, 0 - adds r0, 0x16 - ldr r1, =0x02021fc4 - bl sub_8017064 - lsls r0, 24 - cmp r0, 0 - bne _08015EA8 - bl _08016878 -_08015EA8: - movs r4, 0 - movs r0, 0x29 - strb r0, [r6, 0x14] - bl sub_800ADF8 - adds r0, r6, 0 - adds r0, 0x98 - strh r4, [r0] - adds r0, 0x2 - strh r4, [r0] - bl _08016878 - .pool -_08015EC4: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _08015ED2 - bl _08016878 -_08015ED2: - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - bne _08015F2C - ldr r5, =0x02021cc4 - bl link_get_multiplayer_id - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r4, =0x020229f0 - adds r1, r4 - adds r0, r5, 0 - bl CopyString - ldrh r0, [r4, 0x18] - adds r4, 0x1C - adds r1, r4, 0 - bl sub_800E540 - adds r5, r0, 0 - ldr r0, =0x02021fc4 - ldr r2, =gUnknown_082EE378 - lsls r1, r5, 2 - adds r1, r2 - ldr r1, [r1] - bl ExpandStringRefs - movs r0, 0x21 - bl _08016876 - .pool -_08015F2C: - movs r0, 0x7 - bl _08016876 -_08015F32: - adds r0, r6, 0 - adds r0, 0x16 - movs r1, 0 - bl sub_80170B8 - lsls r0, 24 - asrs r5, r0, 24 - cmp r5, 0 - beq _08015F5C - cmp r5, 0 - bgt _08015F54 - movs r0, 0x1 - negs r0, r0 - cmp r5, r0 - beq _08015F98 - bl _08016878 -_08015F54: - cmp r5, 0x1 - beq _08015F98 - bl _08016878 -_08015F5C: - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r4, =0x02022c2c - movs r0, 0x45 - strb r0, [r4] - movs r0, 0x45 - movs r1, 0 - movs r2, 0x1 - bl sub_8011090 - movs r2, 0x2 - ldrsh r0, [r7, r2] - lsls r0, 5 - ldr r1, [r6] - adds r1, r0 - adds r0, r1, 0 - adds r0, 0x10 - ldrb r2, [r4] - bl sub_8012188 - ldrh r0, [r7, 0x2] - strh r0, [r6, 0x12] - movs r0, 0x14 - strb r0, [r6, 0x14] - strh r5, [r7, 0x6] - bl _08016878 - .pool -_08015F98: - movs r3, 0x2 - ldrsh r0, [r7, r3] - ldr r1, [r6] - bl sub_8017CF8 - adds r4, r0, 0 - ldr r1, =gUnknown_082EEC9C - lsls r0, r4, 2 - adds r0, r1 - ldr r0, [r0] - bl sub_801568C - bl _08016878 - .pool -_08015FB8: - ldrh r0, [r7, 0x4] - adds r0, 0x1 - strh r0, [r7, 0x4] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3C - bgt _08015FCA - bl _08016878 -_08015FCA: - movs r1, 0 - movs r0, 0x15 - strb r0, [r6, 0x14] - strh r1, [r7, 0x4] - bl _08016878 -_08015FD6: - bl sub_8011A74 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - beq _0801603C - cmp r4, 0x3 - ble _08015FF4 - cmp r4, 0x4 - bne _08016040 - movs r0, 0x1 - bl sub_801818C - strb r4, [r6, 0x14] - b _08016040 -_08015FF4: - cmp r4, 0x1 - blt _08016040 - movs r1, 0x2 - ldrsh r0, [r7, r1] - ldr r1, [r6] - bl sub_8017CF8 - adds r4, r0, 0 - movs r0, 0x54 - movs r1, 0 - movs r2, 0x1 - bl sub_8011090 - bl sub_8011B90 - cmp r0, 0x1 - bne _08016028 - ldr r0, =gUnknown_082EED3C - lsls r1, r4, 2 - adds r1, r0 - ldr r0, [r1] - bl sub_801568C - b _08016040 - .pool -_08016028: - ldr r0, =gUnknown_082EED3C - lsls r1, r4, 2 - adds r1, r0 - ldr r1, [r1] - movs r0, 0x1E - bl sub_8015664 - b _08016040 - .pool -_0801603C: - movs r0, 0x16 - strb r0, [r6, 0x14] -_08016040: - ldrh r0, [r7, 0x6] - adds r0, 0x1 - strh r0, [r7, 0x6] - bl _08016878 -_0801604A: - bl sub_8011A80 - cmp r0, 0 - beq _08016092 - movs r2, 0x2 - ldrsh r0, [r7, r2] - ldr r1, [r6] - bl sub_8017CF8 - adds r4, r0, 0 - movs r0, 0x54 - movs r1, 0 - movs r2, 0x1 - bl sub_8011090 - bl sub_8011B90 - cmp r0, 0x1 - bne _08016084 - ldr r0, =gUnknown_082EED3C - lsls r1, r4, 2 - adds r1, r0 - ldr r0, [r1] - bl sub_801568C - b _08016092 - .pool -_08016084: - ldr r0, =gUnknown_082EED3C - lsls r1, r4, 2 - adds r1, r0 - ldr r1, [r1] - movs r0, 0x1E - bl sub_8015664 -_08016092: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _0801609E - bl _08016878 -_0801609E: - movs r0, 0x10 - bl _08016876 - .pool -_080160AC: - movs r0, 0x49 - bl audio_play - bl sub_800EF7C - movs r0, 0 - movs r1, 0xC - strb r1, [r6, 0x14] - adds r1, r6, 0 - adds r1, 0x9A - strh r0, [r1] - bl _08016878 -_080160C6: - bl sub_8011A80 - cmp r0, 0 - beq _080160DA - movs r0, 0 - bl sub_801818C - movs r0, 0x2 - bl _08016876 -_080160DA: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _080160E4 - b _08016878 -_080160E4: - ldr r0, =0x020228c4 - movs r1, 0x1 - bl sub_80143E4 - ldr r0, =sub_80140E0 - movs r1, 0x5 - bl AddTask - movs r0, 0x27 - b _08016876 - .pool -_08016104: - adds r0, r6, 0 - bl sub_801689C - ldr r0, =sub_80140E0 - bl is_function_an_active_task - lsls r0, 24 - cmp r0, 0 - beq _08016118 - b _08016878 -_08016118: - movs r0, 0x21 - strb r0, [r6, 0x14] - ldr r0, =0x02021cc4 - ldr r4, =0x02022a0c - adds r1, r4, 0 - bl CopyString - adds r0, r4, 0 - subs r0, 0x24 - ldrh r0, [r0, 0x20] - adds r1, r4, 0 - bl sub_800E540 - adds r5, r0, 0 - ldr r0, =0x02021fc4 - ldr r2, =gUnknown_082EE324 - lsls r1, r5, 2 - adds r1, r2 - ldr r1, [r1] - bl ExpandStringRefs - b _08016878 - .pool -_08016158: - adds r0, r6, 0 - bl sub_801689C - adds r0, r6, 0 - adds r0, 0x16 - ldr r1, =0x02021fc4 - bl sub_8017064 - lsls r0, 24 - cmp r0, 0 - bne _08016170 - b _08016878 -_08016170: - movs r0, 0x22 - b _08016876 - .pool -_08016178: - adds r0, r6, 0 - bl sub_801689C - adds r0, r6, 0 - bl sub_80168DC - cmp r0, 0 - bne _0801618A - b _08016878 -_0801618A: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08016198 - b _08016878 -_08016198: - movs r0, 0x1 - bl sub_8011DE0 - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_082EE598 - bl CopyString - movs r0, 0x24 - b _08016876 - .pool -_080161B8: - ldr r1, =0x02021fc4 - movs r0, 0x9 - bl sub_8015664 - b _08016878 - .pool -_080161C8: - adds r0, r6, 0 - adds r0, 0x16 - movs r1, 0 - bl sub_80170B8 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _080161EE - cmp r1, 0 - bgt _080161E8 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _080162AE - b _08016878 -_080161E8: - cmp r1, 0x1 - beq _080162AE - b _08016878 -_080161EE: - adds r0, r6, 0 - adds r0, 0x4C - movs r1, 0x51 - strh r1, [r0] - ldr r1, =0x02022c2c - ldrb r1, [r1] - adds r5, r0, 0 - cmp r1, 0x45 - bne _08016220 - movs r4, 0x40 - orrs r4, r1 - movs r0, 0x1 - bl sub_801100C - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - movs r2, 0 - bl sub_8011090 - b _0801623E - .pool -_08016220: - movs r0, 0x40 - adds r4, r1, 0 - orrs r4, r0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - bl sub_801100C - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - movs r2, 0x1 - bl sub_8011090 -_0801623E: - ldr r1, [r6, 0x8] - movs r0, 0 - strb r0, [r1, 0x1B] - strh r0, [r7, 0x6] - ldr r0, =0x02022c2c - ldrb r0, [r0] - cmp r0, 0x41 - bne _08016286 - bl sub_8018024 - cmp r0, 0 - bne _0801627C - movs r0, 0x52 - strh r0, [r5] - adds r0, r5, 0 - bl sub_800FE50 - movs r0, 0xA - strb r0, [r6, 0x14] - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_082EEC14 - bl CopyString - b _08016878 - .pool -_0801627C: - adds r0, r5, 0 - bl sub_800FE50 - movs r0, 0xD - b _08016876 -_08016286: - cmp r0, 0x48 - bne _080162A4 - adds r0, r5, 0 - bl sub_800FE50 - ldr r0, =0x02021fc4 - adds r1, r6, 0 - movs r2, 0x1 - bl sub_8018220 - movs r0, 0x28 - b _08016876 - .pool -_080162A4: - adds r0, r5, 0 - bl sub_800FE50 - movs r0, 0xD - b _08016876 -_080162AE: - adds r0, r6, 0 - adds r0, 0x4C - movs r1, 0x52 - strh r1, [r0] - bl sub_800FE50 - movs r0, 0xA - strb r0, [r6, 0x14] - ldr r0, =0x02021fc4 - ldr r1, =0x02022c2c - ldrb r1, [r1] - bl sub_8013078 - b _08016878 - .pool -_080162D4: - bl sub_800AC34 - movs r0, 0x24 - b _08016876 -_080162DC: - ldr r0, =0x03003124 - ldrb r4, [r0] - cmp r4, 0 - beq _080162E6 - b _08016878 -_080162E6: - ldr r1, =0x02022c2c - movs r0, 0x40 - strb r0, [r1] - ldr r1, =0x02021fc4 - movs r0, 0x25 - bl sub_8015664 - adds r0, r6, 0 - adds r0, 0x4C - movs r1, 0 - movs r2, 0xC - bl memset - adds r0, r6, 0 - adds r0, 0x9A - strh r4, [r0] - subs r0, 0x2 - strh r4, [r0] - b _08016878 - .pool -_08016318: - movs r0, 0x2 - strb r0, [r6, 0x14] - movs r0, 0 - bl sub_801818C - b _08016878 -_08016324: - ldr r4, =0x02021fc4 - ldr r0, =0x02022c2c - ldrb r0, [r0] - movs r1, 0x40 - orrs r1, r0 - adds r0, r4, 0 - bl sub_8017E00 - movs r0, 0xE - adds r1, r4, 0 - bl sub_8015664 - b _08016878 - .pool -_08016348: - bl sub_800ADF8 - movs r0, 0xF - b _08016876 -_08016350: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _0801635C - b _08016878 -_0801635C: - movs r0, 0x10 - b _08016876 -_08016360: - ldr r0, [r6, 0x8] - bl Free - ldr r0, [r6] - bl Free - ldr r0, [r6, 0xC] - bl Free - ldr r0, [r6, 0x4] - bl Free - adds r0, r6, 0 - adds r0, 0x20 - ldrb r0, [r0] - bl remove_task - adds r0, r6, 0 - adds r0, 0x21 - bl sub_8019F04 - movs r0, 0x11 - b _08016876 -_0801638E: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - movs r0, 0x12 - b _08016876 -_080163A2: - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - beq _080163AE - b _08016878 -_080163AE: - bl sub_8019E3C - adds r0, r4, 0 - bl remove_task - ldr r0, =0x02022c30 - ldr r0, [r0] - bl Free - bl sub_80149D8 - b _08016878 - .pool -_080163CC: - bl sub_800F7DC - ldrh r1, [r0, 0x8] - ldr r4, =0x000003ff - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - bne _080163E4 - movs r0, 0x2B - b _08016876 - .pool -_080163E4: - bl sub_800F7DC - ldrh r1, [r0, 0x8] - adds r0, r4, 0 - ands r0, r1 - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - bne _08016408 - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_082EF590 - bl CopyString - b _0801643E - .pool -_08016408: - ldr r4, =0x02021cc4 - bl sub_800F7DC - ldrh r0, [r0, 0x8] - lsls r0, 22 - lsrs r0, 22 - movs r1, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r4, 0 - bl CopyString - ldr r4, =0x02021dc4 - bl sub_800F7DC - ldrb r1, [r0, 0xB] - lsrs r1, 1 - adds r0, r4, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_082EF564 - bl ExpandStringRefs -_0801643E: - ldr r1, =0x02021fc4 - movs r0, 0x2C - bl sub_8015664 - b _08016878 - .pool -_0801645C: - adds r0, r6, 0 - adds r0, 0x16 - ldr r1, =gUnknown_082EF20C - bl sub_8017064 - lsls r0, 24 - cmp r0, 0 - bne _0801646E - b _08016878 -_0801646E: - movs r0, 0x2F - b _08016876 - .pool -_08016478: - adds r0, r6, 0 - adds r0, 0x16 - adds r1, r6, 0 - adds r1, 0x1D - adds r2, r6, 0 - adds r2, 0x1E - ldr r3, =gUnknown_082F025C - ldr r4, =gUnknown_082F027C - str r4, [sp] - bl sub_8017178 - adds r5, r0, 0 - movs r0, 0x1 - negs r0, r0 - cmp r5, r0 - bne _0801649A - b _08016878 -_0801649A: - subs r0, 0x1 - cmp r5, r0 - beq _080164A4 - cmp r5, 0x3 - bne _080164B8 -_080164A4: - movs r0, 0x4 - strb r0, [r6, 0x14] - movs r0, 0x1 - bl sub_801818C - b _08016878 - .pool -_080164B8: - cmp r5, 0x1 - beq _080164C2 - cmp r5, 0x2 - beq _080164D0 - b _08016878 -_080164C2: - ldr r1, =gUnknown_082EF4C4 - movs r0, 0x35 - bl sub_8015664 - b _08016878 - .pool -_080164D0: - ldr r1, =gUnknown_082EF298 - movs r0, 0x2F - bl sub_8015664 - b _08016878 - .pool -_080164E0: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - movs r0, 0x36 - b _08016876 -_080164F4: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08016502 - b _08016878 -_08016502: - ldr r1, =0x02022c40 - movs r0, 0x1 - strh r0, [r1] - ldr r1, =0x03005dac - ldr r0, =sub_80AF128 - str r0, [r1] - ldr r1, =c2_exit_to_overworld_2_switch - movs r0, 0x8 - bl sub_81B8904 - b _08016878 - .pool -_0801652C: - adds r0, r6, 0 - adds r0, 0x16 - adds r1, r6, 0 - adds r1, 0x1D - adds r2, r6, 0 - adds r2, 0x1E - ldr r3, =gUnknown_082F0294 - ldr r4, =gUnknown_082F032C - str r4, [sp] - bl sub_8017178 - adds r5, r0, 0 - movs r0, 0x1 - negs r0, r0 - cmp r5, r0 - bne _0801654E - b _08016878 -_0801654E: - subs r0, 0x1 - cmp r5, r0 - beq _08016558 - cmp r5, 0x12 - bne _08016580 -_08016558: - ldr r0, =0x02022c40 - bl sub_801807C - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl sub_8010FCC - ldr r0, =gUnknown_082EF4FC - bl sub_801568C - b _08016878 - .pool -_08016580: - ldr r0, =0x02022c40 - strh r5, [r0, 0x2] - movs r0, 0x37 - b _08016876 - .pool -_0801658C: - ldr r2, =0x02022c40 - ldrh r0, [r2, 0x2] - ldrh r1, [r2, 0xA] - ldrh r2, [r2, 0xC] - bl sub_8010FCC - ldr r0, =gUnknown_082EF520 - bl sub_801568C - b _08016878 - .pool -_080165A8: - adds r0, r6, 0 - adds r0, 0x16 - movs r1, 0 - bl sub_80170B8 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _080165CE - cmp r1, 0 - bgt _080165C8 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _080165D2 - b _08016878 -_080165C8: - cmp r1, 0x1 - beq _080165D2 - b _08016878 -_080165CE: - movs r0, 0x38 - b _08016876 -_080165D2: - movs r0, 0x1 - bl sub_801818C - movs r0, 0x4 - b _08016876 -_080165DC: - adds r0, r6, 0 - adds r0, 0x16 - ldr r1, =gUnknown_082EF5B8 - bl sub_8017064 - lsls r0, 24 - cmp r0, 0 - bne _080165EE - b _08016878 -_080165EE: - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl sub_8010FCC - ldr r0, =0x02022c40 - bl sub_801807C - movs r0, 0x1 - bl sub_801818C - movs r0, 0x4 - b _08016876 - .pool -_08016610: - adds r0, r6, 0 - adds r0, 0x16 - ldr r1, =gUnknown_082EF1EC - bl sub_8017064 - lsls r0, 24 - cmp r0, 0 - bne _08016622 - b _08016878 -_08016622: - movs r0, 0x2E - b _08016876 - .pool -_0801662C: - bl sub_80173B0 - movs r0, 0x30 - b _08016876 -_08016634: - adds r0, r6, 0 - adds r0, 0x16 - adds r1, r6, 0 - adds r1, 0x1D - adds r2, r6, 0 - adds r2, 0x4A - adds r3, r6, 0 - adds r3, 0x1E - ldr r4, =gUnknown_082F034C - str r4, [sp] - ldr r4, =gUnknown_082F03A4 - str r4, [sp, 0x4] - ldr r4, [r6] - str r4, [sp, 0x8] - bl sub_80172A0 - adds r5, r0, 0 - movs r0, 0x1 - negs r0, r0 - cmp r5, r0 - bne _08016660 - b _08016878 -_08016660: - subs r0, 0x1 - cmp r5, r0 - beq _0801666A - cmp r5, 0x8 - bne _0801667C -_0801666A: - movs r0, 0x1 - bl sub_801818C - movs r0, 0x4 - b _08016876 - .pool -_0801667C: - bl sub_80173B0 - ldr r1, [r6] - lsls r4, r5, 5 - adds r1, r4 - ldrb r0, [r1, 0x9] - lsrs r0, 2 - ldrh r1, [r1, 0x8] - lsls r1, 22 - lsrs r1, 22 - bl sub_8017D04 - cmp r0, 0x1 - beq _080166C8 - cmp r0, 0x1 - bgt _080166A2 - cmp r0, 0 - beq _080166A8 - b _08016878 -_080166A2: - cmp r0, 0x2 - beq _080166FC - b _08016878 -_080166A8: - ldr r0, =0x02021cc4 - ldr r1, [r6] - adds r1, r4 - bl sub_8018404 - ldr r1, =gUnknown_082EF65C - movs r0, 0x31 - bl sub_8015664 - strh r5, [r7, 0x2] - b _08016878 - .pool -_080166C8: - ldr r0, =0x02021cc4 - ldr r1, [r6] - adds r1, r4 - bl sub_8018404 - ldr r0, =0x02021dc4 - ldr r1, [r6] - adds r1, r4 - ldrb r2, [r1, 0x9] - lsrs r2, 2 - lsls r1, r2, 3 - subs r1, r2 - ldr r2, =gTypeNames - adds r1, r2 - bl CopyString - ldr r1, =gUnknown_082EF6E4 - b _0801671E - .pool -_080166FC: - ldr r0, =0x02021cc4 - ldr r1, [r6] - adds r1, r4 - bl sub_8018404 - ldr r0, =0x02021dc4 - ldr r1, [r6] - adds r1, r4 - ldrb r2, [r1, 0x9] - lsrs r2, 2 - lsls r1, r2, 3 - subs r1, r2 - ldr r2, =gTypeNames - adds r1, r2 - bl CopyString - ldr r1, =gUnknown_082EF718 -_0801671E: - movs r0, 0x2E - bl sub_8015664 - b _08016878 - .pool -_08016738: - adds r0, r6, 0 - adds r0, 0x16 - movs r1, 0 - bl sub_80170B8 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _0801675E - cmp r1, 0 - bgt _08016758 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08016762 - b _08016878 -_08016758: - cmp r1, 0x1 - beq _08016762 - b _08016878 -_0801675E: - movs r0, 0x32 - b _08016876 -_08016762: - movs r0, 0x1 - bl sub_801818C - movs r0, 0x4 - b _08016876 -_0801676C: - adds r0, r6, 0 - adds r0, 0x16 - ldr r1, =gUnknown_082EF4C4 - bl sub_8017064 - lsls r0, 24 - cmp r0, 0 - bne _0801677E - b _08016878 -_0801677E: - ldr r4, =0x02022c40 - movs r0, 0x2 - strh r0, [r4] - ldr r2, =0x02022c38 - movs r3, 0x2 - ldrsh r0, [r7, r3] - ldr r1, [r6] - lsls r0, 5 - adds r0, r1 - ldr r0, [r0] - str r0, [r2] - ldr r2, =0x02022c3e - ldr r1, [r6] - movs r3, 0x2 - ldrsh r0, [r7, r3] - lsls r0, 5 - adds r1, r0 - ldrb r0, [r1, 0x9] - lsrs r0, 2 - strb r0, [r2] - ldr r2, =0x02022c3c - ldr r1, [r6] - movs r3, 0x2 - ldrsh r0, [r7, r3] - lsls r0, 5 - adds r1, r0 - ldrh r0, [r1, 0x8] - lsls r0, 22 - lsrs r0, 22 - strh r0, [r2] - ldr r1, =0x03005dac - ldr r0, =sub_80AF128 - str r0, [r1] - ldr r1, =c2_exit_to_overworld_2_switch - movs r0, 0x9 - bl sub_81B8904 - adds r0, r6, 0 - bl sub_80156B0 - ldrh r0, [r7, 0x2] - strb r0, [r4, 0x8] - b _08016878 - .pool -_080167F4: - ldr r1, =0x02022c2c - movs r0, 0x44 - strb r0, [r1] - movs r1, 0x2 - ldrsh r0, [r7, r1] - lsls r0, 5 - ldr r1, [r6] - adds r1, r0 - adds r0, r1, 0 - adds r0, 0x10 - movs r2, 0x44 - bl sub_8012188 - ldr r0, =0x02021cc4 - movs r3, 0x2 - ldrsh r2, [r7, r3] - lsls r2, 5 - ldr r1, [r6] - adds r1, r2 - bl sub_8018404 - ldr r0, =gUnknown_082EE17C - ldr r0, [r0, 0x8] - bl sub_8017020 - movs r0, 0x19 - b _08016876 - .pool -_08016838: - adds r0, r6, 0 - adds r0, 0x16 - ldr r1, =0x02021fc4 - bl sub_8017064 - lsls r0, 24 - cmp r0, 0 - beq _08016878 - movs r0, 0x1 - bl sub_801818C - movs r1, 0 - ldrsh r0, [r7, r1] - movs r2, 0x2 - ldrsh r1, [r7, r2] - ldr r2, [r6] - bl sub_801A3D0 - movs r0, 0x4 - b _08016876 - .pool -_08016864: - adds r0, r6, 0 - adds r0, 0x16 - ldr r1, =0x02021fc4 - bl sub_8017064 - lsls r0, 24 - cmp r0, 0 - beq _08016878 - ldrb r0, [r6, 0x15] -_08016876: - strb r0, [r6, 0x14] -_08016878: - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80156E0 - - thumb_func_start var_800D_set_xB -var_800D_set_xB: @ 8016884 - push {lr} - bl InUnionRoom - cmp r0, 0x1 - bne _08016894 - ldr r1, =0x020375f0 - movs r0, 0xB - strh r0, [r1] -_08016894: - pop {r0} - bx r0 - .pool - thumb_func_end var_800D_set_xB - - thumb_func_start sub_801689C -sub_801689C: @ 801689C - push {r4,r5,lr} - adds r2, r0, 0 - ldr r3, =0x03003090 - ldrh r5, [r3, 0x12] - adds r4, r5, 0 - cmp r4, 0 - beq _080168D0 - ldrh r0, [r3, 0x10] - movs r1, 0xFF - lsls r1, 8 - ands r1, r0 - movs r0, 0xBC - lsls r0, 6 - cmp r1, r0 - bne _080168D0 - adds r0, r2, 0 - adds r0, 0x9A - strh r5, [r0] - cmp r4, 0x44 - bne _080168D0 - ldrh r1, [r3, 0x14] - adds r0, 0x2 - strh r1, [r0] - ldrh r1, [r3, 0x16] - adds r0, 0x2 - strh r1, [r0] -_080168D0: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801689C - - thumb_func_start sub_80168DC -sub_80168DC: @ 80168DC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r4, 0 - adds r5, 0x9A - ldrh r0, [r5] - cmp r0, 0 - beq _0801692C - ldr r0, =0x02021fc4 - ldr r1, =0x020229e8 - adds r1, 0x2F - ldrb r1, [r1] - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_8017EA0 - cmp r0, 0 - beq _0801692C - cmp r0, 0x1 - bne _0801691C - movs r0, 0x23 - strb r0, [r4, 0x14] - ldr r1, =0x02022c2c - ldrh r0, [r5] - strb r0, [r1] - movs r0, 0 - b _0801692E - .pool -_0801691C: - cmp r0, 0x2 - bne _0801692C - movs r0, 0x24 - strb r0, [r4, 0x14] - bl sub_800AC34 - movs r0, 0 - b _0801692E -_0801692C: - movs r0, 0x1 -_0801692E: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80168DC - - thumb_func_start sub_8016934 -sub_8016934: @ 8016934 - push {r4,r5,lr} - ldr r5, =0x02022c20 - movs r0, 0xFF - strb r0, [r5] - ldr r0, =task00_081199FC - movs r1, 0 - bl AddTask - ldr r4, =0x02022c30 - movs r0, 0x9B - lsls r0, 2 - bl AllocZeroed - str r0, [r4] - ldr r1, =0x03000da8 - str r0, [r1] - movs r1, 0 - strb r1, [r0, 0x14] - strb r1, [r0, 0x16] - strh r1, [r0, 0x10] - strh r1, [r0, 0x12] - movs r0, 0x1 - negs r0, r0 - strb r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8016934 - - thumb_func_start task00_081199FC -task00_081199FC: @ 801697C - push {r4-r6,lr} - sub sp, 0x20 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02022c30 - ldr r5, [r0] - ldrb r0, [r5, 0x14] - cmp r0, 0x4 - bls _08016990 - b _08016AC8 -_08016990: - lsls r0, 2 - ldr r1, =_080169A4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080169A4: - .4byte _080169B8 - .4byte _080169BE - .4byte _080169E0 - .4byte _08016A30 - .4byte _08016A94 -_080169B8: - movs r0, 0x1 - strb r0, [r5, 0x14] - b _08016AC8 -_080169BE: - movs r0, 0xC - movs r1, 0 - movs r2, 0 - bl sub_8010F84 - bl sub_800B488 - bl sub_8009734 - bl sub_8011C84 - movs r0, 0x1 - bl sub_80111B0 - movs r0, 0x2 - strb r0, [r5, 0x14] - b _08016AC8 -_080169E0: - movs r0, 0x70 - bl AllocZeroed - str r0, [r5, 0x4] - movs r1, 0x4 - bl sub_80175EC - movs r0, 0x70 - bl AllocZeroed - str r0, [r5, 0xC] - movs r1, 0x4 - bl sub_80175EC - movs r0, 0x80 - lsls r0, 1 - bl AllocZeroed - str r0, [r5] - movs r1, 0x8 - bl sub_8017580 - movs r0, 0x20 - bl AllocZeroed - str r0, [r5, 0x8] - movs r1, 0x1 - bl sub_8017580 - ldr r0, [r5, 0xC] - ldr r1, [r5, 0x4] - movs r2, 0xA - bl sub_8016DF0 - adds r1, r5, 0 - adds r1, 0x20 - strb r0, [r1] - movs r0, 0x3 - strb r0, [r5, 0x14] - b _08016AC8 -_08016A30: - bl sub_8016B00 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - blt _08016AC8 - cmp r0, 0x2 - bgt _08016AC8 - ldr r0, =0x02022c20 - ldrb r0, [r0] - cmp r0, 0xFF - bne _08016AC8 - movs r6, 0 -_08016A4A: - ldr r0, [r5] - lsls r4, r6, 5 - adds r1, r0, r4 - ldrb r0, [r1, 0x1A] - lsls r0, 30 - lsrs r0, 30 - cmp r0, 0x1 - bne _08016A78 - mov r0, sp - bl sub_8018404 - ldr r0, [r5] - adds r0, r4 - adds r0, 0x2 - bl sub_8015658 - lsls r0, 16 - lsrs r0, 16 - mov r1, sp - bl sub_800E540 - cmp r0, 0 - bne _08016A84 -_08016A78: - adds r6, 0x1 - cmp r6, 0x7 - ble _08016A4A - b _08016AC8 - .pool -_08016A84: - ldr r0, =0x02022c20 - mov r1, sp - bl CopyString - b _08016AC8 - .pool -_08016A94: - ldr r0, [r5, 0x8] - bl Free - ldr r0, [r5] - bl Free - ldr r0, [r5, 0xC] - bl Free - ldr r0, [r5, 0x4] - bl Free - adds r0, r5, 0 - adds r0, 0x20 - ldrb r0, [r0] - bl remove_task - ldr r0, =0x02022c30 - ldr r0, [r0] - bl Free - bl sub_800EDD4 - adds r0, r4, 0 - bl remove_task -_08016AC8: - add sp, 0x20 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end task00_081199FC - - thumb_func_start sp182_move_string -sp182_move_string: @ 8016AD4 - push {r4,lr} - ldr r4, =0x02022c20 - ldrb r0, [r4] - cmp r0, 0xFF - bne _08016AE8 - movs r0, 0 - b _08016AF6 - .pool -_08016AE8: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - bl CopyString - movs r0, 0xFF - strb r0, [r4] - movs r0, 0x1 -_08016AF6: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sp182_move_string - - thumb_func_start sub_8016B00 -sub_8016B00: @ 8016B00 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r0, =0x02022c30 - ldr r4, [r0] - movs r7, 0 - movs r6, 0 - movs r5, 0 -_08016B12: - ldr r0, [r4, 0xC] - adds r0, r5 - ldr r1, =gUnknown_082F045C - bl sub_8017630 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x1 - bne _08016B5C - ldr r1, [r4, 0xC] - ldr r0, [r4, 0x8] - adds r1, r5 - ldm r1!, {r2,r5,r6} - stm r0!, {r2,r5,r6} - ldm r1!, {r2,r5,r6} - stm r0!, {r2,r5,r6} - ldr r1, [r4, 0x8] - movs r0, 0 - strh r0, [r1, 0x18] - ldr r2, [r4, 0x8] - ldrb r1, [r2, 0x1A] - movs r5, 0x4 - negs r5, r5 - adds r0, r5, 0 - ands r1, r0 - movs r0, 0x1 - orrs r1, r0 - strb r1, [r2, 0x1A] - ldr r0, [r4, 0x8] - strb r3, [r0, 0x1B] - movs r0, 0x4 - b _08016C90 - .pool -_08016B5C: - adds r5, 0x1C - adds r6, 0x1 - cmp r6, 0x3 - ble _08016B12 - movs r6, 0 - mov r9, r6 -_08016B68: - ldr r0, [r4] - mov r1, r9 - lsls r5, r1, 5 - adds r2, r0, r5 - ldrb r0, [r2, 0x1A] - lsls r0, 30 - mov r8, r5 - cmp r0, 0 - beq _08016C5C - ldr r1, [r4, 0x4] - adds r0, r2, 0 - bl sub_80176E4 - adds r6, r0, 0 - cmp r6, 0xFF - beq _08016C02 - ldr r0, [r4] - adds r2, r0, r5 - ldrb r1, [r2, 0x1A] - lsls r0, r1, 30 - lsrs r0, 30 - cmp r0, 0x1 - bne _08016BE0 - lsls r0, r6, 3 - subs r0, r6 - lsls r6, r0, 2 - ldr r1, [r4, 0x4] - adds r1, r6 - adds r0, r2, 0 - bl sub_8017678 - cmp r0, 0 - beq _08016BC6 - ldr r1, [r4] - ldr r0, [r4, 0x4] - adds r1, r5 - adds r0, r6 - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - ldr r0, [r4] - adds r0, r5 - movs r1, 0x40 - strb r1, [r0, 0x1B] - movs r7, 0x1 - b _08016BF8 -_08016BC6: - ldr r0, [r4] - adds r1, r0, r5 - ldrb r0, [r1, 0x1B] - cmp r0, 0 - beq _08016BF8 - subs r0, 0x1 - strb r0, [r1, 0x1B] - ldr r0, [r4] - adds r0, r5 - ldrb r0, [r0, 0x1B] - cmp r0, 0 - bne _08016BF8 - b _08016BF6 -_08016BE0: - movs r3, 0x4 - negs r3, r3 - adds r0, r3, 0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x1A] - ldr r0, [r4] - adds r0, r5 - movs r1, 0 - strb r1, [r0, 0x1B] -_08016BF6: - movs r7, 0x2 -_08016BF8: - ldr r0, [r4] - add r0, r8 - movs r1, 0 - strh r1, [r0, 0x18] - b _08016C5C -_08016C02: - ldr r0, [r4] - adds r1, r0, r5 - ldrb r0, [r1, 0x1A] - lsls r2, r0, 30 - lsrs r0, r2, 30 - cmp r0, 0x2 - beq _08016C3C - ldrh r0, [r1, 0x18] - adds r0, 0x1 - strh r0, [r1, 0x18] - ldr r0, [r4] - adds r2, r0, r5 - ldrh r1, [r2, 0x18] - ldr r0, =0x00000257 - cmp r1, r0 - bls _08016C5C - ldrb r0, [r2, 0x1A] - movs r5, 0x4 - negs r5, r5 - adds r1, r5, 0 - ands r0, r1 - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2, 0x1A] - movs r7, 0x2 - b _08016C5C - .pool -_08016C3C: - lsrs r0, r2, 30 - cmp r0, 0x2 - bne _08016C5C - ldrh r0, [r1, 0x18] - adds r0, 0x1 - strh r0, [r1, 0x18] - ldr r0, [r4] - adds r2, r0, r5 - ldrh r1, [r2, 0x18] - ldr r0, =0x00000383 - cmp r1, r0 - bls _08016C5C - adds r0, r2, 0 - movs r1, 0x1 - bl sub_8017580 -_08016C5C: - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - cmp r0, 0x7 - bhi _08016C6C - b _08016B68 -_08016C6C: - movs r5, 0 - movs r6, 0x3 -_08016C70: - ldr r0, [r4] - ldr r1, [r4, 0x4] - adds r1, r5 - movs r2, 0x8 - bl sub_8017734 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _08016C86 - movs r7, 0x1 -_08016C86: - adds r5, 0x1C - subs r6, 0x1 - cmp r6, 0 - bge _08016C70 - adds r0, r7, 0 -_08016C90: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8016B00 - - thumb_func_start sub_8016CA0 -sub_8016CA0: @ 8016CA0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - lsls r0, 2 - add r0, r10 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r6, r0, r1 - movs r7, 0 - mov r0, sp - adds r0, 0x10 - str r0, [sp, 0x18] -_08016CC4: - lsls r2, r7, 24 - lsrs r2, 24 - mov r0, sp - ldr r1, [sp, 0x18] - bl sub_800DE7C - lsls r0, 24 - lsrs r4, r0, 24 - mov r0, sp - ldrb r0, [r0, 0xA] - lsls r0, 25 - lsrs r0, 25 - mov r2, r10 - lsls r1, r2, 2 - add r1, r10 - lsls r1, 3 - ldr r3, =0x03005e00 - adds r1, r3 - movs r5, 0x10 - ldrsh r1, [r1, r5] - bl sub_8013D88 - cmp r0, 0 - bne _08016D00 - mov r1, sp - ldr r0, =gUnknown_082F045C - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} -_08016D00: - mov r0, sp - ldrb r1, [r0] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x1 - bne _08016D18 - mov r1, sp - ldr r0, =gUnknown_082F045C - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} -_08016D18: - cmp r4, 0 - bne _08016D9C - lsls r0, r7, 3 - mov r8, r0 - adds r1, r7, 0x1 - mov r9, r1 - cmp r7, 0 - ble _08016D58 - movs r2, 0 - str r2, [sp, 0x1C] - adds r4, r7, 0 -_08016D2E: - ldr r0, [r6, 0x4] - ldr r3, [sp, 0x1C] - adds r0, r3 - mov r1, sp - bl sub_8017630 - lsls r0, 24 - cmp r0, 0 - bne _08016D4C - mov r1, sp - ldr r0, =gUnknown_082F045C - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} -_08016D4C: - ldr r5, [sp, 0x1C] - adds r5, 0x1C - str r5, [sp, 0x1C] - subs r4, 0x1 - cmp r4, 0 - bne _08016D2E -_08016D58: - ldr r1, [r6, 0x4] - mov r0, r8 - subs r4, r0, r7 - lsls r4, 2 - adds r1, r4 - mov r0, sp - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - ldr r0, [r6, 0x4] - adds r0, r4 - ldr r1, =gUnknown_082F045C - bl sub_8017630 - ldr r3, [r6, 0x4] - adds r3, r4 - movs r2, 0x1 - ands r2, r0 - ldrb r0, [r3, 0x18] - movs r4, 0x2 - negs r4, r4 - adds r1, r4, 0 - ands r0, r1 - orrs r0, r2 - strb r0, [r3, 0x18] - b _08016DD4 - .pool -_08016D9C: - ldr r1, [r6] - lsls r4, r7, 3 - subs r4, r7 - lsls r4, 2 - adds r1, r4 - mov r0, sp - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - ldr r0, [r6] - adds r0, r4 - ldr r1, =gUnknown_082F045C - bl sub_8017630 - ldr r3, [r6] - adds r3, r4 - movs r2, 0x1 - ands r2, r0 - ldrb r0, [r3, 0x18] - movs r4, 0x2 - negs r4, r4 - adds r1, r4, 0 - ands r0, r1 - orrs r0, r2 - strb r0, [r3, 0x18] - adds r7, 0x1 - mov r9, r7 -_08016DD4: - mov r7, r9 - cmp r7, 0x3 - bgt _08016DDC - b _08016CC4 -_08016DDC: - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8016CA0 - - thumb_func_start sub_8016DF0 -sub_8016DF0: @ 8016DF0 - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - ldr r0, =sub_8016CA0 - movs r1, 0 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r2, =0x03005e08 - adds r3, r1, r2 - str r4, [r3] - str r5, [r3, 0x4] - adds r2, r1 - strh r6, [r2, 0x8] - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8016DF0 - - thumb_func_start sub_8016E24 -sub_8016E24: @ 8016E24 - 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 - mov r10, r0 - lsls r0, 2 - add r0, r10 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r6, r0, r1 - movs r3, 0 -_08016E42: - lsls r4, r3, 3 - subs r0, r4, r3 - lsls r5, r0, 2 - ldr r0, [r6] - adds r0, r5 - adds r1, r0, 0 - adds r1, 0x10 - lsls r2, r3, 24 - lsrs r2, 24 - str r3, [sp] - bl sub_800DE7C - ldr r0, [r6] - adds r0, r5 - ldrb r0, [r0, 0xA] - lsls r0, 25 - lsrs r0, 25 - mov r2, r10 - lsls r1, r2, 2 - add r1, r10 - lsls r1, 3 - ldr r7, =0x03005e00 - adds r1, r7 - movs r2, 0xC - ldrsh r1, [r1, r2] - bl sub_8013D88 - mov r8, r4 - ldr r3, [sp] - cmp r0, 0 - bne _08016E8E - ldr r1, [r6] - adds r1, r5 - ldr r0, =gUnknown_082F045C - ldm r0!, {r2,r4,r7} - stm r1!, {r2,r4,r7} - ldm r0!, {r2,r4,r7} - stm r1!, {r2,r4,r7} -_08016E8E: - adds r4, r3, 0x1 - mov r9, r4 - cmp r3, 0 - ble _08016ED2 - str r5, [sp, 0x4] - movs r5, 0 - str r5, [sp, 0x8] - adds r4, r3, 0 -_08016E9E: - ldr r1, [r6] - ldr r7, [sp, 0x8] - adds r0, r1, r7 - ldr r2, [sp, 0x4] - adds r1, r2 - str r3, [sp] - bl sub_8017630 - lsls r0, 24 - ldr r3, [sp] - cmp r0, 0 - bne _08016EC6 - ldr r1, [r6] - ldr r5, [sp, 0x4] - adds r1, r5 - ldr r0, =gUnknown_082F045C - ldm r0!, {r2,r5,r7} - stm r1!, {r2,r5,r7} - ldm r0!, {r2,r5,r7} - stm r1!, {r2,r5,r7} -_08016EC6: - ldr r7, [sp, 0x8] - adds r7, 0x1C - str r7, [sp, 0x8] - subs r4, 0x1 - cmp r4, 0 - bne _08016E9E -_08016ED2: - mov r0, r8 - subs r4, r0, r3 - lsls r4, 2 - ldr r0, [r6] - adds r0, r4 - ldr r1, =gUnknown_082F045C - bl sub_8017630 - ldr r3, [r6] - adds r3, r4 - movs r2, 0x1 - ands r2, r0 - ldrb r0, [r3, 0x18] - movs r4, 0x2 - negs r4, r4 - adds r1, r4, 0 - ands r0, r1 - orrs r0, r2 - strb r0, [r3, 0x18] - mov r3, r9 - cmp r3, 0x3 - ble _08016E42 - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8016E24 - - thumb_func_start sub_8016F1C -sub_8016F1C: @ 8016F1C - push {lr} - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x7 - bne _08016F2C - ldrb r1, [r0] - movs r0, 0x20 - b _08016F34 -_08016F2C: - cmp r1, 0x8 - bne _08016F3E - ldrb r1, [r0] - movs r0, 0x10 -_08016F34: - ands r0, r1 - cmp r0, 0 - beq _08016F3E - movs r0, 0x1 - b _08016F40 -_08016F3E: - movs r0, 0 -_08016F40: - pop {r1} - bx r1 - thumb_func_end sub_8016F1C - - thumb_func_start sub_8016F44 -sub_8016F44: @ 8016F44 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r4, r1, r0 - movs r6, 0 - subs r0, 0x8 - movs r5, 0 - adds r1, r0 - mov r8, r1 -_08016F62: - ldr r0, [r4] - adds r0, r5 - adds r1, r0, 0 - adds r1, 0x10 - lsls r2, r6, 24 - lsrs r2, 24 - bl sub_800DF34 - lsls r0, 24 - cmp r0, 0 - beq _08016F86 - ldr r0, [r4] - adds r0, r5 - mov r2, r8 - movs r3, 0xC - ldrsh r1, [r2, r3] - bl sub_8016F1C -_08016F86: - ldr r0, [r4] - adds r0, r5 - ldr r1, =gUnknown_082F045C - bl sub_8017630 - ldr r3, [r4] - adds r3, r5 - movs r2, 0x1 - ands r2, r0 - ldrb r0, [r3, 0x18] - movs r7, 0x2 - negs r7, r7 - adds r1, r7, 0 - ands r0, r1 - orrs r0, r2 - strb r0, [r3, 0x18] - adds r5, 0x1C - adds r6, 0x1 - cmp r6, 0x3 - ble _08016F62 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8016F44 - - thumb_func_start sub_8016FC0 -sub_8016FC0: @ 8016FC0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldr r0, =sub_8016E24 - movs r1, 0 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - lsls r2, r0, 2 - adds r2, r0 - lsls r2, 3 - ldr r1, =0x03005e08 - adds r3, r2, r1 - str r4, [r3] - adds r1, r2 - strh r5, [r1, 0x4] - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8016FC0 - - thumb_func_start sub_8016FF0 -sub_8016FF0: @ 8016FF0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldr r0, =sub_8016F44 - movs r1, 0 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - lsls r2, r0, 2 - adds r2, r0 - lsls r2, 3 - ldr r1, =0x03005e08 - adds r3, r2, r1 - str r4, [r3] - adds r1, r2 - strh r5, [r1, 0x4] - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8016FF0 - - thumb_func_start sub_8017020 -sub_8017020: @ 8017020 - push {r4,lr} - adds r4, r0, 0 - bl sub_81973A4 - movs r0, 0 - movs r1, 0x1 - bl sub_81973C4 - ldr r0, =0x02021fc4 - adds r1, r4, 0 - bl ExpandStringRefs - movs r0, 0 - movs r1, 0x1 - bl AddTextPrinterWithCustomSpeedForMessage - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8017020 - - thumb_func_start sub_801704C -sub_801704C: @ 801704C - push {lr} - bl sub_8197224 - lsls r0, 16 - cmp r0, 0 - beq _0801705C - movs r0, 0 - b _0801705E -_0801705C: - movs r0, 0x1 -_0801705E: - pop {r1} - bx r1 - thumb_func_end sub_801704C - - thumb_func_start sub_8017064 -sub_8017064: @ 8017064 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4] - cmp r0, 0 - beq _08017076 - cmp r0, 0x1 - beq _0801709C - b _080170AE -_08017076: - bl sub_81973A4 - movs r0, 0 - movs r1, 0x1 - bl sub_81973C4 - ldr r0, =0x02021fc4 - adds r1, r5, 0 - bl ExpandStringRefs - movs r0, 0x1 - bl AddTextPrinterForMessage_2 - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _080170AE - .pool -_0801709C: - bl sub_8197224 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _080170AE - strb r0, [r4] - movs r0, 0x1 - b _080170B0 -_080170AE: - movs r0, 0 -_080170B0: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8017064 - - thumb_func_start sub_80170B8 -sub_80170B8: @ 80170B8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4] - cmp r0, 0 - beq _080170CA - cmp r0, 0x1 - beq _080170E0 - b _0801710C -_080170CA: - cmp r5, 0 - beq _080170D4 - movs r0, 0x3 - negs r0, r0 - b _08017110 -_080170D4: - bl sub_8197930 - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _0801710C -_080170E0: - cmp r5, 0 - beq _080170F2 - bl sub_8198C78 - movs r0, 0 - strb r0, [r4] - movs r0, 0x3 - negs r0, r0 - b _08017110 -_080170F2: - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - movs r2, 0x80 - lsls r2, 17 - adds r0, r2 - lsrs r0, 24 - cmp r0, 0x2 - bhi _0801710C - strb r5, [r4] - adds r0, r1, 0 - b _08017110 -_0801710C: - movs r0, 0x2 - negs r0, r0 -_08017110: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80170B8 - - thumb_func_start sub_8017118 -sub_8017118: @ 8017118 - push {r4,lr} - sub sp, 0x8 - bl AddWindow - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0 - bl sub_81973FC - adds r0, r4, 0 - movs r1, 0xFF - bl FillWindowPixelBuffer - ldr r2, =gUnknown_082EFD94 - movs r0, 0x1 - str r0, [sp] - movs r0, 0x6 - str r0, [sp, 0x4] - adds r0, r4, 0 - movs r1, 0x1 - movs r3, 0x8 - bl sub_80173E0 - adds r0, r4, 0 - movs r1, 0x2 - bl CopyWindowToVram - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8017118 - - thumb_func_start sub_8017168 -sub_8017168: @ 8017168 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl RemoveWindow - pop {r0} - bx r0 - thumb_func_end sub_8017168 - - thumb_func_start sub_8017178 -sub_8017178: @ 8017178 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - adds r7, r0, 0 - adds r5, r1, 0 - mov r9, r2 - ldrb r4, [r7] - cmp r4, 0 - beq _08017194 - cmp r4, 0x1 - beq _08017228 - b _0801728E -_08017194: - ldr r0, [r3] - ldr r1, [r3, 0x4] - str r0, [sp] - str r1, [sp, 0x4] - ldr r0, [sp, 0x24] - bl sub_81DB41C - adds r1, r0, 0 - ldr r2, [sp] - lsrs r0, r2, 24 - cmp r0, r1 - ble _080171B6 - lsls r1, 24 - ldr r0, =0x00ffffff - ands r0, r2 - orrs r0, r1 - str r0, [sp] -_080171B6: - ldr r2, [sp] - lsrs r0, r2, 8 - lsls r0, 24 - lsrs r0, 24 - lsrs r1, r2, 24 - adds r0, r1 - cmp r0, 0x1D - ble _080171DC - movs r0, 0x1D - subs r0, r1 - cmp r0, 0 - bge _080171D0 - movs r0, 0 -_080171D0: - lsls r1, r0, 24 - lsrs r1, 16 - ldr r0, =0xffff00ff - ands r0, r2 - orrs r0, r1 - str r0, [sp] -_080171DC: - mov r0, sp - bl AddWindow - strb r0, [r5] - ldrb r0, [r5] - movs r1, 0 - bl sub_81973FC - ldr r0, =0x03006310 - adds r2, r0, 0 - ldr r1, [sp, 0x24] - ldm r1!, {r3,r4,r6} - stm r2!, {r3,r4,r6} - ldm r1!, {r3,r4,r6} - stm r2!, {r3,r4,r6} - ldrb r1, [r5] - strb r1, [r0, 0x10] - movs r1, 0 - movs r2, 0 - bl ListMenuInit - mov r1, r9 - strb r0, [r1] - ldrb r0, [r5] - movs r1, 0x1 - bl CopyWindowToVram - ldrb r0, [r7] - adds r0, 0x1 - strb r0, [r7] - b _0801728E - .pool -_08017228: - mov r3, r9 - ldrb r0, [r3] - bl ListMenuHandleInput - mov r8, r0 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - ands r4, r1 - cmp r4, 0 - beq _08017264 - mov r4, r9 - ldrb r0, [r4] - movs r1, 0 - movs r2, 0 - bl sub_81AE6C8 - ldrb r0, [r5] - movs r1, 0x1 - bl sub_819746C - ldrb r0, [r5] - bl RemoveWindow - movs r0, 0 - strb r0, [r7] - mov r0, r8 - b _08017292 - .pool -_08017264: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0801728E - mov r6, r9 - ldrb r0, [r6] - movs r1, 0 - movs r2, 0 - bl sub_81AE6C8 - ldrb r0, [r5] - movs r1, 0x1 - bl sub_819746C - ldrb r0, [r5] - bl RemoveWindow - strb r4, [r7] - movs r0, 0x2 - negs r0, r0 - b _08017292 -_0801728E: - movs r0, 0x1 - negs r0, r0 -_08017292: - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8017178 - - thumb_func_start sub_80172A0 -sub_80172A0: @ 80172A0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r5, r0, 0 - adds r6, r1, 0 - mov r10, r2 - mov r9, r3 - ldrb r4, [r5] - cmp r4, 0x1 - beq _0801730C - cmp r4, 0x1 - bgt _080172C2 - cmp r4, 0 - beq _080172C8 - b _0801739C -_080172C2: - cmp r4, 0x2 - beq _0801731C - b _0801739C -_080172C8: - ldr r0, =gUnknown_082F0344 - bl sub_8017118 - mov r1, r9 - strb r0, [r1] - ldr r0, [sp, 0x20] - bl AddWindow - strb r0, [r6] - ldrb r0, [r6] - movs r1, 0 - bl sub_81973FC - ldr r0, =0x03006310 - adds r2, r0, 0 - ldr r1, [sp, 0x24] - ldm r1!, {r3,r4,r7} - stm r2!, {r3,r4,r7} - ldm r1!, {r3,r4,r7} - stm r2!, {r3,r4,r7} - ldrb r1, [r6] - strb r1, [r0, 0x10] - movs r1, 0 - movs r2, 0x1 - bl ListMenuInit - mov r1, r10 - strb r0, [r1] - b _08017314 - .pool -_0801730C: - ldrb r0, [r6] - movs r1, 0x1 - bl CopyWindowToVram -_08017314: - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - b _0801739C -_0801731C: - mov r3, r10 - ldrb r0, [r3] - bl ListMenuHandleInput - adds r1, r0, 0 - ldr r0, =0x030022c0 - ldrh r2, [r0, 0x2E] - movs r0, 0x3 - ands r0, r2 - cmp r0, 0 - beq _0801739C - cmp r1, 0x8 - beq _0801733E - ands r4, r2 - mov r8, r4 - cmp r4, 0 - beq _08017368 -_0801733E: - mov r4, r10 - ldrb r0, [r4] - movs r1, 0 - movs r2, 0 - bl sub_81AE6C8 - ldrb r0, [r6] - bl RemoveWindow - mov r7, r9 - ldrb r0, [r7] - bl sub_8017168 - movs r0, 0 - strb r0, [r5] - movs r0, 0x2 - negs r0, r0 - b _080173A0 - .pool -_08017368: - ldr r0, [sp, 0x28] - bl sub_8017CB0 - adds r4, r0, 0 - cmp r4, 0 - blt _08017396 - mov r1, r10 - ldrb r0, [r1] - movs r1, 0 - movs r2, 0 - bl sub_81AE6C8 - ldrb r0, [r6] - bl RemoveWindow - mov r3, r9 - ldrb r0, [r3] - bl sub_8017168 - mov r7, r8 - strb r7, [r5] - adds r0, r4, 0 - b _080173A0 -_08017396: - movs r0, 0x7 - bl audio_play -_0801739C: - movs r0, 0x1 - negs r0, r0 -_080173A0: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80172A0 - - thumb_func_start sub_80173B0 -sub_80173B0: @ 80173B0 - push {lr} - sub sp, 0xC - movs r0, 0x20 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0xC - pop {r0} - bx r0 - thumb_func_end sub_80173B0 - - thumb_func_start sub_80173D4 -sub_80173D4: @ 80173D4 - push {lr} - bl script_env_2_enable_and_set_ctx_running - pop {r0} - bx r0 - thumb_func_end sub_80173D4 - - thumb_func_start sub_80173E0 -sub_80173E0: @ 80173E0 - push {r4,r5,lr} - sub sp, 0x10 - ldr r5, [sp, 0x1C] - ldr r4, [sp, 0x20] - lsls r3, 24 - lsrs r3, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r4, 24 - lsrs r4, 24 - str r2, [sp] - mov r2, sp - strb r0, [r2, 0x4] - mov r0, sp - strb r1, [r0, 0x5] - strb r3, [r0, 0x6] - strb r5, [r0, 0x7] - strb r3, [r0, 0x8] - strb r5, [r0, 0x9] - ldrb r1, [r2, 0xC] - movs r0, 0x10 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0xC] - ldr r2, =0x03003014 - ldrb r1, [r2] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - cmp r4, 0x6 - bls _08017422 - b _0801756E -_08017422: - lsls r0, r4, 2 - ldr r1, =_08017434 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08017434: - .4byte _08017450 - .4byte _0801747C - .4byte _080174A8 - .4byte _080174D4 - .4byte _08017500 - .4byte _0801752C - .4byte _08017544 -_08017450: - mov r0, sp - movs r1, 0 - strb r1, [r0, 0xA] - strb r1, [r0, 0xB] - mov r2, sp - ldrb r1, [r2, 0xC] - movs r3, 0xF - adds r0, r3, 0 - ands r0, r1 - movs r1, 0x20 - orrs r0, r1 - strb r0, [r2, 0xC] - ldrb r1, [r2, 0xD] - movs r0, 0x10 - negs r0, r0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0xD] - ands r0, r3 - movs r1, 0x30 - b _0801756A -_0801747C: - mov r0, sp - movs r1, 0 - strb r1, [r0, 0xA] - strb r1, [r0, 0xB] - mov r2, sp - ldrb r1, [r2, 0xC] - movs r3, 0xF - adds r0, r3, 0 - ands r0, r1 - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2, 0xC] - ldrb r1, [r2, 0xD] - movs r0, 0x10 - negs r0, r0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0xD] - ands r0, r3 - movs r1, 0x50 - b _0801756A -_080174A8: - mov r0, sp - movs r1, 0 - strb r1, [r0, 0xA] - strb r1, [r0, 0xB] - mov r2, sp - ldrb r1, [r2, 0xC] - movs r3, 0xF - adds r0, r3, 0 - ands r0, r1 - movs r1, 0x60 - orrs r0, r1 - strb r0, [r2, 0xC] - ldrb r1, [r2, 0xD] - movs r0, 0x10 - negs r0, r0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0xD] - ands r0, r3 - movs r1, 0x70 - b _0801756A -_080174D4: - mov r0, sp - movs r1, 0 - strb r1, [r0, 0xA] - strb r1, [r0, 0xB] - mov r2, sp - ldrb r1, [r2, 0xC] - movs r3, 0xF - adds r0, r3, 0 - ands r0, r1 - movs r1, 0x10 - orrs r0, r1 - strb r0, [r2, 0xC] - ldrb r1, [r2, 0xD] - movs r0, 0x10 - negs r0, r0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0xD] - ands r0, r3 - movs r1, 0x30 - b _0801756A -_08017500: - mov r0, sp - movs r1, 0 - strb r1, [r0, 0xA] - strb r1, [r0, 0xB] - mov r2, sp - ldrb r1, [r2, 0xC] - movs r3, 0xF - adds r0, r3, 0 - ands r0, r1 - movs r1, 0x10 - orrs r0, r1 - strb r0, [r2, 0xC] - ldrb r1, [r2, 0xD] - movs r0, 0x10 - negs r0, r0 - ands r0, r1 - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2, 0xD] - ands r0, r3 - movs r1, 0x30 - b _0801756A -_0801752C: - mov r0, sp - movs r1, 0 - strb r1, [r0, 0xA] - strb r1, [r0, 0xB] - mov r2, sp - ldrb r1, [r2, 0xC] - movs r4, 0xF - movs r3, 0xF - adds r0, r3, 0 - ands r0, r1 - movs r1, 0x70 - b _0801755A -_08017544: - mov r0, sp - movs r1, 0 - strb r1, [r0, 0xA] - strb r1, [r0, 0xB] - mov r2, sp - ldrb r1, [r2, 0xC] - movs r4, 0xF - movs r3, 0xF - adds r0, r3, 0 - ands r0, r1 - movs r1, 0xE0 -_0801755A: - orrs r0, r1 - strb r0, [r2, 0xC] - mov r1, sp - ldrb r0, [r1, 0xD] - orrs r0, r4 - strb r0, [r1, 0xD] - ands r0, r3 - movs r1, 0x90 -_0801756A: - orrs r0, r1 - strb r0, [r2, 0xD] -_0801756E: - mov r0, sp - movs r1, 0xFF - movs r2, 0 - bl AddTextPrinter - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80173E0 - - thumb_func_start sub_8017580 -sub_8017580: @ 8017580 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0 - beq _080175D8 - ldr r2, =gUnknown_082F045C - mov r8, r2 - movs r5, 0 - mov r9, r5 - movs r6, 0x4 - negs r6, r6 - mov r12, r6 - adds r2, r0, 0 - adds r2, 0x18 - adds r4, r0, 0 - movs r7, 0xFF - mov r10, r7 - adds r3, r1, 0 -_080175AC: - adds r1, r4, 0 - mov r0, r8 - ldm r0!, {r5-r7} - stm r1!, {r5-r7} - ldm r0!, {r5-r7} - stm r1!, {r5-r7} - mov r0, r10 - strh r0, [r2] - ldrb r1, [r2, 0x2] - mov r0, r12 - ands r0, r1 - movs r1, 0x5 - negs r1, r1 - ands r0, r1 - strb r0, [r2, 0x2] - mov r5, r9 - strb r5, [r2, 0x3] - adds r2, 0x20 - adds r4, 0x20 - subs r3, 0x1 - cmp r3, 0 - bne _080175AC -_080175D8: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8017580 - - thumb_func_start sub_80175EC -sub_80175EC: @ 80175EC - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r1, =gUnknown_082F045C - mov r12, r1 - movs r5, 0x2 - negs r5, r5 - mov r8, r5 - adds r2, r0, 0 - adds r2, 0x18 - adds r3, r0, 0 - movs r4, 0x3 -_08017604: - adds r1, r3, 0 - mov r0, r12 - ldm r0!, {r5-r7} - stm r1!, {r5-r7} - ldm r0!, {r5-r7} - stm r1!, {r5-r7} - ldrb r1, [r2] - mov r0, r8 - ands r0, r1 - strb r0, [r2] - adds r2, 0x1C - adds r3, 0x1C - subs r4, 0x1 - cmp r4, 0 - bge _08017604 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80175EC - - thumb_func_start sub_8017630 -sub_8017630: @ 8017630 - push {r4-r6,lr} - adds r5, r0, 0 - adds r6, r1, 0 - movs r2, 0 - adds r4, r5, 0x2 - adds r3, r6, 0x2 -_0801763C: - adds r0, r4, r2 - adds r1, r3, r2 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bne _08017664 - adds r2, 0x1 - cmp r2, 0x1 - ble _0801763C - movs r2, 0 - adds r4, r5, 0 - adds r4, 0x10 - adds r3, r6, 0 - adds r3, 0x10 -_08017658: - adds r0, r4, r2 - adds r1, r3, r2 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - beq _08017668 -_08017664: - movs r0, 0x1 - b _08017670 -_08017668: - adds r2, 0x1 - cmp r2, 0x7 - ble _08017658 - movs r0, 0 -_08017670: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8017630 - - thumb_func_start sub_8017678 -sub_8017678: @ 8017678 - push {r4-r6,lr} - adds r5, r0, 0 - adds r6, r1, 0 - ldrb r3, [r5, 0xA] - movs r0, 0x7F - ldrb r2, [r6, 0xA] - adds r1, r0, 0 - ands r1, r3 - ands r0, r2 - cmp r1, r0 - bne _080176DC - movs r0, 0x80 - adds r1, r0, 0 - ands r1, r3 - ands r0, r2 - cmp r1, r0 - bne _080176DC - movs r2, 0 - adds r4, r5, 0x4 - adds r3, r6, 0x4 -_080176A0: - adds r0, r4, r2 - adds r1, r3, r2 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bne _080176DC - adds r2, 0x1 - cmp r2, 0x3 - ble _080176A0 - ldrh r2, [r5, 0x8] - ldr r0, =0x000003ff - ldrh r3, [r6, 0x8] - adds r1, r0, 0 - ands r1, r2 - ands r0, r3 - cmp r1, r0 - bne _080176DC - ldrb r2, [r5, 0x9] - movs r0, 0xFC - ldrb r3, [r6, 0x9] - adds r1, r0, 0 - ands r1, r2 - ands r0, r3 - cmp r1, r0 - bne _080176DC - movs r0, 0 - b _080176DE - .pool -_080176DC: - movs r0, 0x1 -_080176DE: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8017678 - - thumb_func_start sub_80176E4 -sub_80176E4: @ 80176E4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r8, r0 - movs r7, 0xFF - movs r6, 0 - adds r4, r1, 0 - adds r4, 0x18 - adds r5, r1, 0 -_080176F6: - ldrb r1, [r4] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0801771E - mov r0, r8 - adds r1, r5, 0 - bl sub_8017630 - lsls r0, 24 - cmp r0, 0 - bne _0801771E - lsls r0, r6, 24 - lsrs r7, r0, 24 - ldrb r0, [r4] - movs r2, 0x2 - negs r2, r2 - adds r1, r2, 0 - ands r0, r1 - strb r0, [r4] -_0801771E: - adds r4, 0x1C - adds r5, 0x1C - adds r6, 0x1 - cmp r6, 0x3 - ble _080176F6 - adds r0, r7, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80176E4 - - thumb_func_start sub_8017734 -sub_8017734: @ 8017734 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r3, r0, 0 - mov r8, r1 - lsls r2, 24 - lsrs r6, r2, 24 - ldrb r1, [r1, 0x18] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080177A8 - movs r5, 0 - cmp r5, r6 - bge _080177A8 - movs r0, 0x4 - negs r0, r0 - mov r9, r0 - movs r1, 0x2 - negs r1, r1 - mov r12, r1 - adds r2, r3, 0 - adds r2, 0x18 - adds r1, r3, 0 -_08017766: - ldrb r0, [r2, 0x2] - movs r3, 0x3 - ands r3, r0 - cmp r3, 0 - bne _0801779E - mov r0, r8 - ldm r0!, {r4,r6,r7} - stm r1!, {r4,r6,r7} - ldm r0!, {r4,r6,r7} - stm r1!, {r4,r6,r7} - strh r3, [r2] - ldrb r1, [r2, 0x2] - mov r0, r9 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x2] - movs r0, 0x40 - strb r0, [r2, 0x3] - mov r0, r8 - ldrb r1, [r0, 0x18] - mov r0, r12 - ands r0, r1 - mov r1, r8 - strb r0, [r1, 0x18] - lsls r0, r5, 24 - lsrs r0, 24 - b _080177AA -_0801779E: - adds r2, 0x20 - adds r1, 0x20 - adds r5, 0x1 - cmp r5, r6 - blt _08017766 -_080177A8: - movs r0, 0xFF -_080177AA: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8017734 - - thumb_func_start sub_80177B8 -sub_80177B8: @ 80177B8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - adds r4, r1, 0 - adds r6, r3, 0 - ldr r3, [sp, 0x2C] - ldr r1, [sp, 0x30] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r4, 24 - lsrs r4, 24 - lsls r2, 24 - lsrs r7, r2, 24 - lsls r3, 24 - lsrs r3, 24 - mov r9, r3 - lsls r1, 24 - lsrs r1, 24 - ldr r5, =0x02021fc4 - adds r1, 0x1 - adds r0, r5, 0 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r1, =gUnknown_082ED8C8 - adds r0, r5, 0 - bl AppendString - str r7, [sp] - movs r0, 0 - str r0, [sp, 0x4] - mov r0, r8 - movs r1, 0x1 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_80173E0 - adds r4, 0x12 - lsls r4, 24 - lsrs r4, 24 - ldrb r0, [r6, 0xA] - lsls r0, 25 - lsrs r2, r0, 25 - ldrb r1, [r6, 0x1A] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x1 - bne _08017884 - movs r0, 0x40 - ands r2, r0 - cmp r2, 0 - bne _08017884 - adds r0, r5, 0 - adds r1, r6, 0 - bl sub_8018404 - str r7, [sp] - mov r0, r9 - str r0, [sp, 0x4] - mov r0, r8 - movs r1, 0x1 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_80173E0 - ldrb r1, [r6, 0x2] - ldrb r0, [r6, 0x3] - lsls r0, 8 - orrs r1, r0 - add r0, sp, 0x8 - movs r2, 0x2 - movs r3, 0x5 - bl ConvertIntToDecimalString - ldr r1, =gUnknown_082ED8CC - adds r0, r5, 0 - bl CopyString - adds r0, r5, 0 - add r1, sp, 0x8 - bl AppendString - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x88 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - str r7, [sp] - mov r0, r9 - str r0, [sp, 0x4] - mov r0, r8 - movs r1, 0x1 - adds r2, r5, 0 - bl sub_80173E0 -_08017884: - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80177B8 - - thumb_func_start sub_80178A0 -sub_80178A0: @ 80178A0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - adds r5, r3, 0 - ldr r3, [sp, 0x2C] - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r3, 24 - lsrs r7, r3, 24 - ldrb r1, [r5, 0x1A] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x1 - bne _0801792A - ldr r4, =0x02021fc4 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8018404 - mov r0, r8 - str r0, [sp] - str r7, [sp, 0x4] - mov r0, r9 - movs r1, 0x1 - adds r2, r4, 0 - adds r3, r6, 0 - bl sub_80173E0 - ldrb r1, [r5, 0x2] - ldrb r0, [r5, 0x3] - lsls r0, 8 - orrs r1, r0 - add r0, sp, 0x8 - movs r2, 0x2 - movs r3, 0x5 - bl ConvertIntToDecimalString - ldr r1, =gUnknown_082ED8CC - adds r0, r4, 0 - bl CopyString - adds r0, r4, 0 - add r1, sp, 0x8 - bl AppendString - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x68 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - mov r0, r8 - str r0, [sp] - str r7, [sp, 0x4] - mov r0, r9 - movs r1, 0x1 - adds r2, r4, 0 - bl sub_80173E0 -_0801792A: - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80178A0 - - thumb_func_start sub_8017940 -sub_8017940: @ 8017940 - push {r4,lr} - sub sp, 0x4 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl GetXYCoordsOneStepInFrontOfPlayer - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0x9 - bne _08017978 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0x8 - bne _08017978 - ldr r0, =0x02037590 - ldrb r0, [r0, 0x3] - cmp r0, 0x2 - beq _0801796E - cmp r0, 0 - bne _08017978 -_0801796E: - movs r0, 0x1 - b _0801797A - .pool -_08017978: - movs r0, 0 -_0801797A: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8017940 - - thumb_func_start sub_8017984 -sub_8017984: @ 8017984 - push {lr} - cmp r0, 0x4 - beq _0801799C - cmp r0, 0x4 - ble _080179A4 - cmp r0, 0x5 - beq _08017998 - cmp r0, 0x8 - beq _080179A0 - b _080179A4 -_08017998: - movs r0, 0x1 - b _080179A6 -_0801799C: - movs r0, 0x2 - b _080179A6 -_080179A0: - movs r0, 0x3 - b _080179A6 -_080179A4: - movs r0, 0 -_080179A6: - pop {r1} - bx r1 - thumb_func_end sub_8017984 - - thumb_func_start sub_80179AC -sub_80179AC: @ 80179AC - push {r4,lr} - sub sp, 0x20 - adds r4, r0, 0 - mov r0, sp - adds r1, r4, 0 - bl sub_8018404 - adds r4, 0x2 - adds r0, r4, 0 - bl sub_8015658 - lsls r0, 16 - lsrs r0, 16 - mov r1, sp - bl sub_800E540 - add sp, 0x20 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80179AC - - thumb_func_start sub_80179D4 -sub_80179D4: @ 80179D4 - push {r4-r6,lr} - adds r6, r3, 0 - lsls r1, 24 - lsrs r4, r1, 24 - lsls r2, 24 - lsrs r2, 19 - adds r5, r0, r2 - ldrb r1, [r5, 0xA] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08017A4C - cmp r4, 0 - bne _08017A4C - ldr r4, =0x02021cc4 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8018404 - adds r0, r5, 0x2 - bl sub_8015658 - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0 - bl sub_800E540 - adds r2, r0, 0 - ldrb r1, [r5, 0xA] - movs r0, 0x7F - ands r0, r1 - cmp r0, 0x45 - bne _08017A38 - ldr r0, =0x02021fc4 - ldr r3, =gUnknown_082EE6B8 - lsls r1, r6, 2 - lsls r2, 3 - adds r1, r2 - adds r1, r3 - ldr r1, [r1] - bl ExpandStringRefs - movs r0, 0x2 - b _08017B2A - .pool -_08017A38: - ldr r0, =gUnknown_082EE17C - lsls r1, r2, 2 - adds r1, r0 - ldr r0, [r1] - bl sub_8017020 - movs r0, 0x1 - b _08017B2A - .pool -_08017A4C: - ldr r0, =0x02021cc4 - adds r1, r5, 0 - bl sub_8018404 - cmp r4, 0 - beq _08017A62 - adds r0, r5, r4 - ldrb r0, [r0, 0x3] - lsrs r6, r0, 3 - movs r0, 0x1 - ands r6, r0 -_08017A62: - ldrb r0, [r5, 0xA] - lsls r0, 25 - lsrs r0, 25 - movs r1, 0x3F - ands r1, r0 - cmp r1, 0x4 - beq _08017AB0 - cmp r1, 0x4 - bgt _08017A80 - cmp r1, 0x1 - beq _08017A8A - b _08017B20 - .pool -_08017A80: - cmp r1, 0x5 - beq _08017AD0 - cmp r1, 0x8 - beq _08017AF4 - b _08017B20 -_08017A8A: - ldr r5, =0x02021fc4 - ldr r4, =gUnknown_082EEEAC - bl GenerateRandomNumber - lsls r0, 16 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r0 - lsrs r1, 14 - lsls r0, r6, 4 - adds r1, r0 - adds r1, r4 - ldr r1, [r1] - b _08017B0E - .pool -_08017AB0: - ldr r5, =0x02021fc4 - ldr r4, =gUnknown_082EF1CC - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - ands r0, r1 - lsls r0, 2 - lsls r1, r6, 4 - b _08017B08 - .pool -_08017AD0: - ldr r5, =0x02021fc4 - ldr r4, =gUnknown_082EF010 - bl GenerateRandomNumber - lsls r0, 16 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r0 - lsrs r1, 14 - lsls r0, r6, 4 - adds r1, r0 - adds r1, r4 - ldr r1, [r1] - b _08017B0E - .pool -_08017AF4: - ldr r5, =0x02021fc4 - ldr r4, =gUnknown_082EF100 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - ands r0, r1 - lsls r0, 2 - lsls r1, r6, 3 -_08017B08: - adds r0, r1 - adds r0, r4 - ldr r1, [r0] -_08017B0E: - adds r0, r5, 0 - bl ExpandStringRefs - b _08017B28 - .pool -_08017B20: - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_082EE6C8 - bl ExpandStringRefs -_08017B28: - movs r0, 0 -_08017B2A: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80179D4 - - thumb_func_start nullsub_14 -nullsub_14: @ 8017B38 - bx lr - thumb_func_end nullsub_14 - - thumb_func_start sub_8017B3C -sub_8017B3C: @ 8017B3C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0xC - ldr r4, [sp, 0x28] - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r4, 24 - lsrs r4, 24 - ldrh r0, [r2, 0x8] - lsls r0, 22 - lsrs r0, 22 - mov r8, r0 - ldrb r0, [r2, 0x9] - lsrs r7, r0, 2 - ldrb r0, [r2, 0xB] - lsrs r0, 1 - mov r9, r0 - str r5, [sp] - str r4, [sp, 0x4] - adds r0, r6, 0 - movs r1, 0x1 - adds r2, r3, 0 - movs r3, 0x8 - bl sub_80173E0 - movs r0, 0xCE - lsls r0, 1 - cmp r8, r0 - bne _08017B94 - ldr r2, =gUnknown_082EF7D0 - str r5, [sp] - str r4, [sp, 0x4] - adds r0, r6, 0 - movs r1, 0x1 - movs r3, 0x44 - bl sub_80173E0 - b _08017BD4 - .pool -_08017B94: - adds r1, r7, 0x1 - adds r0, r6, 0 - movs r2, 0x44 - adds r3, r5, 0 - bl blit_move_info_icon - movs r0, 0xB - mov r2, r8 - muls r2, r0 - ldr r0, =gSpeciesNames - adds r2, r0 - str r5, [sp] - str r4, [sp, 0x4] - adds r0, r6, 0 - movs r1, 0x1 - movs r3, 0x76 - bl sub_80173E0 - add r0, sp, 0x8 - mov r1, r9 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - str r5, [sp] - str r4, [sp, 0x4] - adds r0, r6, 0 - movs r1, 0x1 - add r2, sp, 0x8 - movs r3, 0xC6 - bl sub_80173E0 -_08017BD4: - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8017B3C - - thumb_func_start sub_8017BE8 -sub_8017BE8: @ 8017BE8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r2, 24 - lsrs r7, r2, 24 - ldr r0, =0x02022c30 - ldr r0, [r0] - mov r8, r0 - movs r0, 0x3 - negs r0, r0 - cmp r4, r0 - bne _08017C6C - ldr r0, =gUnknown_082F03A4 - ldrb r0, [r0, 0x14] - lsls r0, 28 - lsrs r0, 28 - cmp r7, r0 - bne _08017C6C - bl sub_800F7DC - adds r2, r0, 0 - ldrh r1, [r2, 0x8] - ldr r0, =0x000003ff - ands r0, r1 - cmp r0, 0 - beq _08017CA0 - ldr r0, =0x03005d90 - ldr r3, [r0] - movs r0, 0x5 - str r0, [sp] - mov r0, r9 - adds r1, r7, 0 - bl sub_8017B3C - b _08017CA0 - .pool -_08017C4C: - mov r0, r12 - adds r1, r0, r4 - add r0, sp, 0x4 - bl sub_8018404 - mov r0, r8 - ldr r2, [r0] - adds r2, r4 - movs r0, 0x6 - str r0, [sp] - mov r0, r9 - adds r1, r7, 0 - add r3, sp, 0x4 - bl sub_8017B3C - b _08017CA0 -_08017C6C: - movs r5, 0 - movs r1, 0 - mov r2, r8 - ldr r2, [r2] - mov r12, r2 - adds r2, 0x8 - movs r3, 0 - adds r6, r4, 0x1 -_08017C7C: - ldrb r0, [r2, 0x12] - lsls r0, 30 - lsrs r0, 30 - adds r4, r3, 0 - cmp r0, 0x1 - bne _08017C92 - ldrh r0, [r2] - lsls r0, 22 - cmp r0, 0 - beq _08017C92 - adds r5, 0x1 -_08017C92: - cmp r5, r6 - beq _08017C4C - adds r2, 0x20 - adds r3, 0x20 - adds r1, 0x1 - cmp r1, 0x7 - ble _08017C7C -_08017CA0: - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8017BE8 - - thumb_func_start sub_8017CB0 -sub_8017CB0: @ 8017CB0 - push {r4-r7,lr} - movs r4, 0 - movs r3, 0 - movs r7, 0x3 - ldr r6, =0x000003ff - adds r2, r0, 0 - adds r2, 0x8 - adds r5, r1, 0x1 -_08017CC0: - ldrb r1, [r2, 0x12] - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0x1 - bne _08017CD6 - ldrh r1, [r2] - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _08017CD6 - adds r4, 0x1 -_08017CD6: - cmp r4, r5 - bne _08017CE4 - adds r0, r3, 0 - b _08017CF0 - .pool -_08017CE4: - adds r2, 0x20 - adds r3, 0x1 - cmp r3, 0x7 - ble _08017CC0 - movs r0, 0x1 - negs r0, r0 -_08017CF0: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8017CB0 - - thumb_func_start sub_8017CF8 -sub_8017CF8: @ 8017CF8 - lsls r0, 5 - adds r0, r1 - ldrb r0, [r0, 0xB] - lsls r0, 31 - lsrs r0, 31 - bx lr - thumb_func_end sub_8017CF8 - - thumb_func_start sub_8017D04 -sub_8017D04: @ 8017D04 - push {r4-r6,lr} - adds r5, r0, 0 - movs r0, 0xCE - lsls r0, 1 - cmp r1, r0 - bne _08017D44 - movs r4, 0 - b _08017D2E -_08017D14: - movs r0, 0x64 - muls r0, r4 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x41 - bl pokemon_getattr - adds r1, r0, 0 - movs r0, 0xCE - lsls r0, 1 - cmp r1, r0 - beq _08017D74 - adds r4, 0x1 -_08017D2E: - ldr r0, =0x020244e9 - ldrb r0, [r0] - cmp r4, r0 - blt _08017D14 - movs r0, 0x2 - b _08017D90 - .pool -_08017D44: - movs r4, 0 - ldr r0, =0x020244e9 - ldrb r0, [r0] - cmp r4, r0 - bge _08017D8E - ldr r6, =gBaseStats -_08017D50: - movs r0, 0x64 - muls r0, r4 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x41 - bl pokemon_getattr - adds r1, r0, 0 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r1, r0, r6 - ldrb r0, [r1, 0x6] - cmp r0, r5 - beq _08017D74 - ldrb r0, [r1, 0x7] - cmp r0, r5 - bne _08017D84 -_08017D74: - movs r0, 0 - b _08017D90 - .pool -_08017D84: - adds r4, 0x1 - ldr r0, =0x020244e9 - ldrb r0, [r0] - cmp r4, r0 - blt _08017D50 -_08017D8E: - movs r0, 0x1 -_08017D90: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8017D04 - - thumb_func_start sub_8017D9C -sub_8017D9C: @ 8017D9C - push {lr} - adds r3, r0, 0 - cmp r1, 0x44 - beq _08017DD8 - cmp r1, 0x44 - bgt _08017DAE - cmp r1, 0x41 - beq _08017DB8 - b _08017DF6 -_08017DAE: - cmp r1, 0x45 - beq _08017DC8 - cmp r1, 0x48 - beq _08017DE8 - b _08017DF6 -_08017DB8: - ldr r0, =gUnknown_082EEA68 - lsls r1, r2, 2 - adds r1, r0 - ldr r1, [r1] - b _08017DDA - .pool -_08017DC8: - ldr r0, =gUnknown_082EED3C - lsls r1, r2, 2 - adds r1, r0 - ldr r1, [r1] - b _08017DDA - .pool -_08017DD8: - ldr r1, =gUnknown_082EF7B0 -_08017DDA: - adds r0, r3, 0 - bl ExpandStringRefs - b _08017DF6 - .pool -_08017DE8: - ldr r0, =gUnknown_082EEB08 - lsls r1, r2, 2 - adds r1, r0 - ldr r1, [r1] - adds r0, r3, 0 - bl ExpandStringRefs -_08017DF6: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8017D9C - - thumb_func_start sub_8017E00 -sub_8017E00: @ 8017E00 - push {r4-r6,lr} - adds r5, r0, 0 - lsls r1, 24 - lsrs r4, r1, 24 - adds r6, r4, 0 - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =0x020229e8 - movs r0, 0x1 - adds r1, r3, 0 - eors r1, r0 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x13] - cmp r4, 0x44 - beq _08017E54 - cmp r4, 0x44 - bgt _08017E38 - cmp r4, 0x41 - beq _08017E3E - b _08017E94 - .pool -_08017E38: - cmp r6, 0x45 - beq _08017E78 - b _08017E94 -_08017E3E: - ldr r2, =gUnknown_082EE984 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 3 - adds r1, r0 - b _08017E66 - .pool -_08017E54: - ldr r2, =gUnknown_082EE984 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 3 - adds r1, r0 - adds r2, 0x8 -_08017E66: - adds r1, r2 - ldr r1, [r1] - adds r0, r5, 0 - bl CopyString - b _08017E94 - .pool -_08017E78: - ldr r2, =gUnknown_082EE984 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 3 - adds r1, r0 - adds r2, 0x4 - adds r1, r2 - ldr r1, [r1] - adds r0, r5, 0 - bl CopyString -_08017E94: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8017E00 - - thumb_func_start sub_8017EA0 -sub_8017EA0: @ 8017EA0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r7, r0, 0 - adds r5, r2, 0 - adds r6, r3, 0 - movs r2, 0 - mov r8, r2 - ldrh r0, [r5] - subs r0, 0x40 - cmp r0, 0x8 - bls _08017EBA - b _08017FC6 -_08017EBA: - lsls r0, 2 - ldr r1, =_08017EC8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08017EC8: - .4byte _08017FBC - .4byte _08017EEC - .4byte _08017FC6 - .4byte _08017FC6 - .4byte _08017EFC - .4byte _08017EF4 - .4byte _08017FC6 - .4byte _08017FC6 - .4byte _08017FAC -_08017EEC: - ldr r1, =gUnknown_082EE3DC - b _08017FAE - .pool -_08017EF4: - ldr r1, =gUnknown_082EE430 - b _08017FAE - .pool -_08017EFC: - adds r0, r6, 0 - adds r0, 0x58 - ldr r4, =0x02022c40 - ldrh r1, [r4, 0xC] - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - adds r0, r6, 0 - adds r0, 0x68 - ldrh r2, [r4, 0xA] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - movs r4, 0 - b _08017F2E - .pool -_08017F2C: - adds r4, 0x1 -_08017F2E: - cmp r4, 0x3 - bgt _08017F64 - ldr r0, =0x03007890 - ldr r0, [r0] - lsls r1, r4, 5 - adds r0, r1 - ldrh r0, [r0, 0x18] - cmp r0, 0x2 - bne _08017F2C - ldrh r1, [r5, 0x4] - adds r0, r6, 0 - adds r0, 0x78 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldrh r1, [r5, 0x2] - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r6, 0 - adds r0, 0x88 - bl CopyString - ldrh r5, [r5, 0x2] - mov r8, r5 -_08017F64: - movs r0, 0xCE - lsls r0, 1 - cmp r8, r0 - bne _08017F84 - ldr r1, =gUnknown_082EE4F0 - adds r0, r7, 0 - bl CopyString - b _08017FB4 - .pool -_08017F84: - movs r4, 0 - adds r5, r6, 0 - adds r5, 0x58 -_08017F8A: - lsls r0, r4, 24 - lsrs r0, 24 - adds r1, r5, 0 - bl sub_81AFC0C - adds r5, 0x10 - adds r4, 0x1 - cmp r4, 0x3 - ble _08017F8A - ldr r1, =gUnknown_082EE47C - adds r0, r7, 0 - bl sub_81AFC28 - b _08017FB4 - .pool -_08017FAC: - ldr r1, =gUnknown_082EE380 -_08017FAE: - adds r0, r7, 0 - bl ExpandStringRefs -_08017FB4: - movs r2, 0x1 - b _08017FC6 - .pool -_08017FBC: - ldr r1, =gUnknown_082EE544 - adds r0, r7, 0 - bl ExpandStringRefs - movs r2, 0x2 -_08017FC6: - adds r0, r2, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8017EA0 - - thumb_func_start sub_8017FD8 -sub_8017FD8: @ 8017FD8 - push {lr} - adds r2, r0, 0 - ldr r0, =0x03003090 - ldrh r1, [r0, 0x2] - cmp r1, 0 - beq _08017FFC - cmp r1, 0x51 - beq _08017FEC - cmp r1, 0x52 - bne _08017FFC -_08017FEC: - adds r0, r2, 0 - adds r0, 0x98 - strh r1, [r0] - movs r0, 0x1 - b _08017FFE - .pool -_08017FFC: - movs r0, 0 -_08017FFE: - pop {r1} - bx r1 - thumb_func_end sub_8017FD8 - - thumb_func_start InUnionRoom -InUnionRoom: @ 8018004 - push {lr} - movs r2, 0 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r1, [r0, 0x4] - ldr r0, =0x00003c19 - cmp r1, r0 - bne _08018016 - movs r2, 0x1 -_08018016: - adds r0, r2, 0 - pop {r1} - bx r1 - .pool - thumb_func_end InUnionRoom - - thumb_func_start sub_8018024 -sub_8018024: @ 8018024 - push {r4-r6,lr} - movs r6, 0 - movs r5, 0 - ldr r0, =0x020244e9 - ldrb r0, [r0] - cmp r6, r0 - bge _08018064 -_08018032: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x38 - bl pokemon_getattr - cmp r0, 0x1E - bhi _0801805A - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _0801805A - adds r6, 0x1 -_0801805A: - adds r5, 0x1 - ldr r0, =0x020244e9 - ldrb r0, [r0] - cmp r5, r0 - blt _08018032 -_08018064: - cmp r6, 0x1 - bgt _08018074 - movs r0, 0 - b _08018076 - .pool -_08018074: - movs r0, 0x1 -_08018076: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8018024 - - thumb_func_start sub_801807C -sub_801807C: @ 801807C - movs r1, 0 - strh r1, [r0] - strh r1, [r0, 0x2] - str r1, [r0, 0x4] - strh r1, [r0, 0xA] - strh r1, [r0, 0xC] - strh r1, [r0, 0xE] - strh r1, [r0, 0x10] - str r1, [r0, 0x14] - bx lr - thumb_func_end sub_801807C - - thumb_func_start sub_8018090 -sub_8018090: @ 8018090 - push {lr} - ldr r0, =0x02022c40 - bl sub_801807C - pop {r0} - bx r0 - .pool - thumb_func_end sub_8018090 - - thumb_func_start sub_80180A0 -sub_80180A0: @ 80180A0 - push {r4,r5,lr} - adds r5, r1, 0 - movs r1, 0x64 - adds r4, r0, 0 - muls r4, r1 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - strh r0, [r5, 0xA] - adds r0, r4, 0 - movs r1, 0x38 - bl pokemon_getattr - strh r0, [r5, 0xC] - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - str r0, [r5, 0x4] - ldrh r1, [r5, 0xA] - movs r0, 0xCE - lsls r0, 1 - cmp r1, r0 - beq _080180E0 - movs r0, 0 - b _080180E2 - .pool -_080180E0: - movs r0, 0x1 -_080180E2: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80180A0 - - thumb_func_start sub_80180E8 -sub_80180E8: @ 80180E8 - push {r4,r5,lr} - adds r5, r1, 0 - movs r1, 0x64 - adds r4, r0, 0 - muls r4, r1 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - strh r0, [r5, 0xE] - adds r0, r4, 0 - movs r1, 0x38 - bl pokemon_getattr - strh r0, [r5, 0x10] - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - str r0, [r5, 0x14] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80180E8 - - thumb_func_start sub_8018120 -sub_8018120: @ 8018120 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r1, 24 - movs r2, 0 - mov r8, r2 - cmp r1, 0 - bne _0801813E - ldrh r7, [r0, 0xA] - ldr r6, [r0, 0x4] - b _08018142 -_08018136: - lsls r0, r5, 16 - lsrs r0, 16 - mov r8, r0 - b _08018176 -_0801813E: - ldrh r7, [r0, 0xE] - ldr r6, [r0, 0x14] -_08018142: - movs r5, 0 - b _0801816E -_08018146: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - cmp r0, r6 - bne _0801816C - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - cmp r0, r7 - beq _08018136 -_0801816C: - adds r5, 0x1 -_0801816E: - ldr r0, =0x020244e9 - ldrb r0, [r0] - cmp r5, r0 - blt _08018146 -_08018176: - mov r0, r8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8018120 - - thumb_func_start sub_801818C -sub_801818C: @ 801818C - push {r4,lr} - adds r4, r0, 0 - bl sub_80173B0 - bl script_env_2_disable - bl sub_8098524 - ldr r1, =0x02022c2c - movs r0, 0 - strb r0, [r1] - cmp r4, 0 - beq _080181BC - ldr r2, =0x02022c40 - ldrh r0, [r2, 0x2] - ldrh r1, [r2, 0xA] - ldrh r2, [r2, 0xC] - bl sub_8010FCC - movs r0, 0x40 - movs r1, 0 - movs r2, 0 - bl sub_8011090 -_080181BC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801818C - - thumb_func_start sub_80181CC -sub_80181CC: @ 80181CC - push {lr} - bl script_env_2_enable - bl sub_80983E8 - pop {r0} - bx r0 - thumb_func_end sub_80181CC - - thumb_func_start sub_80181DC -sub_80181DC: @ 80181DC - push {r4,lr} - movs r3, 0x80 - movs r2, 0 - ldr r4, [r0, 0xC] -_080181E4: - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r1, r4, r0 - ldrb r0, [r1, 0x18] - lsls r0, 31 - cmp r0, 0 - beq _0801820C - ldrb r0, [r1, 0xB] - lsls r0, 31 - lsrs r0, 31 - lsls r0, 3 - orrs r3, r0 - ldrb r1, [r1, 0x2] - movs r0, 0x7 - ands r0, r1 - orrs r3, r0 - lsls r0, r3, 24 - lsrs r3, r0, 24 - b _08018216 -_0801820C: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x3 - bls _080181E4 -_08018216: - adds r0, r3, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80181DC - - thumb_func_start sub_8018220 -sub_8018220: @ 8018220 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r9, r1 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp] - bl link_get_multiplayer_id - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r1, r0 - ldr r0, =0x02039b58 - adds r1, r0 - mov r8, r1 - bl sub_81AFBF0 - mov r6, r9 - adds r6, 0xC0 - bl sub_8068BB0 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xD - muls r1, r0 - ldr r0, =gTrainerClassNames - adds r1, r0 - adds r0, r6, 0 - bl CopyString - movs r0, 0 - adds r1, r6, 0 - bl sub_81AFC0C - mov r1, r8 - adds r1, 0x30 - movs r0, 0x1 - bl sub_81AFC0C - movs r4, 0xBA - lsls r4, 1 - add r4, r9 - ldr r1, =gUnknown_082EFF50 - mov r2, r8 - ldrb r0, [r2, 0x1] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r4, 0 - bl CopyString - movs r0, 0x2 - adds r1, r4, 0 - bl sub_81AFC0C - mov r5, r9 - adds r5, 0xDE - mov r0, r8 - ldrh r1, [r0, 0xC] - adds r0, r5, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - movs r0, 0x3 - adds r1, r5, 0 - bl sub_81AFC0C - movs r2, 0xED - add r2, r9 - mov r10, r2 - mov r0, r8 - ldrh r1, [r0, 0x10] - mov r0, r10 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - mov r4, r9 - adds r4, 0xFC - mov r2, r8 - ldrh r1, [r2, 0x12] - adds r0, r4, 0 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalString - movs r0, 0x4 - mov r1, r10 - bl sub_81AFC0C - movs r0, 0x5 - adds r1, r4, 0 - bl sub_81AFC0C - movs r4, 0xD2 - lsls r4, 1 - add r4, r9 - ldr r1, =gUnknown_082EFF64 - adds r0, r4, 0 - bl sub_81AFC28 - ldr r0, =0x02021fc4 - adds r1, r4, 0 - bl CopyString - mov r0, r8 - ldrh r1, [r0, 0x14] - ldr r4, =0x0000270f - cmp r1, r4 - ble _0801830C - adds r1, r4, 0 -_0801830C: - adds r0, r6, 0 - movs r2, 0 - movs r3, 0x4 - bl ConvertIntToDecimalString - movs r0, 0 - adds r1, r6, 0 - bl sub_81AFC0C - mov r2, r8 - ldrh r1, [r2, 0x16] - cmp r1, r4 - ble _08018328 - adds r1, r4, 0 -_08018328: - mov r4, r9 - adds r4, 0xCF - adds r0, r4, 0 - movs r2, 0 - movs r3, 0x4 - bl ConvertIntToDecimalString - movs r0, 0x2 - adds r1, r4, 0 - bl sub_81AFC0C - mov r0, r8 - ldrh r1, [r0, 0x20] - adds r0, r5, 0 - movs r2, 0 - movs r3, 0x5 - bl ConvertIntToDecimalString - movs r0, 0x3 - adds r1, r5, 0 - bl sub_81AFC0C - movs r7, 0 - movs r6, 0x80 - lsls r6, 19 - mov r5, r8 - adds r5, 0x28 - mov r4, r10 -_08018360: - ldrh r1, [r5] - adds r0, r4, 0 - bl CopyEasyChatWord - lsrs r0, r6, 24 - adds r1, r4, 0 - bl sub_81AFC0C - movs r2, 0x80 - lsls r2, 17 - adds r6, r2 - adds r5, 0x2 - adds r4, 0xF - adds r7, 0x1 - cmp r7, 0x3 - ble _08018360 - movs r4, 0xD2 - lsls r4, 1 - add r4, r9 - ldr r1, =gUnknown_082EFFA4 - adds r0, r4, 0 - bl sub_81AFC28 - ldr r5, =0x02021fc4 - adds r0, r5, 0 - adds r1, r4, 0 - bl AppendString - ldr r0, [sp] - cmp r0, 0x1 - bne _080183D0 - ldr r1, =gUnknown_082F0020 - adds r0, r4, 0 - bl sub_81AFC28 - adds r0, r5, 0 - adds r1, r4, 0 - bl AppendString - b _080183F0 - .pool -_080183D0: - ldr r2, [sp] - cmp r2, 0 - bne _080183F0 - ldr r0, =gUnknown_082F0018 - mov r2, r8 - ldrb r1, [r2] - lsls r1, 2 - adds r1, r0 - ldr r1, [r1] - adds r0, r4, 0 - bl sub_81AFC28 - adds r0, r5, 0 - adds r1, r4, 0 - bl AppendString -_080183F0: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8018220 - - thumb_func_start sub_8018404 -sub_8018404: @ 8018404 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - adds r1, 0x10 - bl CopyString_Limit7 - ldrb r1, [r4] - lsls r1, 28 - lsrs r1, 28 - adds r0, r5, 0 - bl StopMusicWhileStringIsPrinted - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8018404 - - thumb_func_start sub_8018424 -sub_8018424: @ 8018424 - push {lr} - bl ProcessObjectCopyRequests - bl LoadOamFromSprites - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_8018424 - - thumb_func_start sub_8018438 -sub_8018438: @ 8018438 - push {lr} - bl RunActiveTasks - bl RunTextPrinters - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - pop {r0} - bx r0 - thumb_func_end sub_8018438 - - thumb_func_start sub_8018450 -sub_8018450: @ 8018450 - push {r4-r7,lr} - sub sp, 0xC - adds r7, r0, 0 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r6, r0, r1 - ldrb r0, [r6] - cmp r0, 0x1 - bne _08018466 - b _08018574 -_08018466: - cmp r0, 0x1 - bgt _08018474 - cmp r0, 0 - beq _08018482 - b _08018644 - .pool -_08018474: - cmp r0, 0x2 - bne _0801847A - b _080185F8 -_0801847A: - cmp r0, 0x3 - bne _08018480 - b _08018618 -_08018480: - b _08018644 -_08018482: - movs r0, 0 - bl SetVBlankCallback - bl sub_80A1A74 - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - bl clear_tasks - bl remove_some_task - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_082F0598 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r4, 0x80 - lsls r4, 4 - adds r0, r4, 0 - bl Alloc - adds r1, r0, 0 - movs r0, 0x3 - bl SetBgTilemapBuffer - adds r0, r4, 0 - bl Alloc - adds r1, r0, 0 - movs r0, 0x2 - bl SetBgTilemapBuffer - adds r0, r4, 0 - bl Alloc - adds r1, r0, 0 - movs r0, 0x1 - bl SetBgTilemapBuffer - adds r0, r4, 0 - bl Alloc - adds r1, r0, 0 - movs r0, 0 - bl SetBgTilemapBuffer - movs r0, 0x3 - bl bgid_upload_textbox_1 - ldr r0, =gUnknown_082F05A8 - bl InitWindows - bl DeactivateAllTextPrinters - movs r1, 0xC0 - lsls r1, 7 - movs r0, 0 - bl ClearGpuRegBits - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - b _08018610 - .pool -_08018574: - ldr r0, =gUnknown_082F0548 - movs r1, 0 - movs r2, 0x20 - bl gpu_pal_apply - movs r0, 0x2 - bl stdpal_get - movs r1, 0xD0 - movs r2, 0x20 - bl gpu_pal_apply - movs r0, 0xC0 - bl sub_81978B0 - movs r0, 0 - movs r1, 0xA - movs r2, 0xE0 - bl sub_809882C - movs r0, 0 - movs r1, 0x1 - movs r2, 0xF0 - bl box_border_load_tiles_and_pal - movs r4, 0x20 - str r4, [sp] - str r4, [sp, 0x4] - movs r5, 0x11 - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect - movs r0, 0x3 - bl sub_8018798 - lsls r0, r7, 24 - lsrs r0, 24 - movs r1, 0 - bl sub_80186EC - b _08018610 - .pool -_080185F8: - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0 - bl CopyBgTilemapBufferToVram -_08018610: - ldrb r0, [r6] - adds r0, 0x1 - strb r0, [r6] - b _08018644 -_08018618: - movs r0, 0 - bl ShowBg - movs r0, 0x3 - bl ShowBg - ldr r0, =0x0000021d - bl song_play_for_text - ldr r0, =sub_8018424 - bl SetVBlankCallback - movs r0, 0xC5 - bl EnableInterrupts - movs r0, 0x1 - b _08018646 - .pool -_08018644: - movs r0, 0 -_08018646: - add sp, 0xC - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8018450 - - thumb_func_start c2_mystery_gift -c2_mystery_gift: @ 8018650 - push {lr} - movs r0, 0 - bl sub_8018450 - cmp r0, 0 - beq _0801866C - ldr r0, =sub_8018438 - bl SetMainCallback2 - ldr r1, =0x02022c60 - movs r0, 0 - strb r0, [r1] - bl task_add_00_mystery_gift -_0801866C: - bl RunActiveTasks - pop {r0} - bx r0 - .pool - thumb_func_end c2_mystery_gift - - thumb_func_start sub_801867C -sub_801867C: @ 801867C - push {lr} - movs r0, 0x1 - bl sub_8018450 - cmp r0, 0 - beq _08018698 - ldr r0, =sub_8018438 - bl SetMainCallback2 - ldr r1, =0x02022c60 - movs r0, 0x1 - strb r0, [r1] - bl sub_81D5014 -_08018698: - pop {r0} - bx r0 - .pool - thumb_func_end sub_801867C - - thumb_func_start sub_80186A4 -sub_80186A4: @ 80186A4 - push {lr} - ldr r1, =0x02022c60 - movs r0, 0 - strb r0, [r1] - bl FreeAllWindowBuffers - movs r0, 0 - bl GetBgTilemapBuffer - bl Free - movs r0, 0x1 - bl GetBgTilemapBuffer - bl Free - movs r0, 0x2 - bl GetBgTilemapBuffer - bl Free - movs r0, 0x3 - bl GetBgTilemapBuffer - bl Free - ldr r0, =c2_title_screen_1 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80186A4 - - thumb_func_start sub_80186EC -sub_80186EC: @ 80186EC - push {r4-r7,lr} - sub sp, 0x14 - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - cmp r4, 0 - bne _0801871C - ldr r0, =gUnknown_085EF654 - ldr r7, =gUnknown_085EF678 - cmp r5, 0 - bne _08018720 - ldr r7, =gUnknown_085EF664 - b _08018720 - .pool -_0801871C: - ldr r0, =gUnknown_085EDFBF - ldr r7, =gUnknown_085EDFC9 -_08018720: - movs r4, 0 - str r4, [sp] - str r4, [sp, 0x4] - ldr r6, =gUnknown_082F0720 - str r6, [sp, 0x8] - movs r5, 0x1 - negs r5, r5 - str r5, [sp, 0xC] - str r0, [sp, 0x10] - movs r0, 0 - movs r1, 0x1 - movs r2, 0x4 - movs r3, 0x1 - bl AddTextPrinterParametrized2 - movs r0, 0 - adds r1, r7, 0 - movs r2, 0xDE - bl GetStringRightAlignXOffset - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - str r4, [sp] - str r4, [sp, 0x4] - str r6, [sp, 0x8] - str r5, [sp, 0xC] - str r7, [sp, 0x10] - movs r0, 0 - movs r1, 0 - movs r3, 0x1 - bl AddTextPrinterParametrized2 - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0 - bl PutWindowTilemap - add sp, 0x14 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80186EC - - thumb_func_start sub_8018784 -sub_8018784: @ 8018784 - push {lr} - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - movs r2, 0xF - bl sub_8098858 - pop {r0} - bx r0 - thumb_func_end sub_8018784 - - thumb_func_start sub_8018798 -sub_8018798: @ 8018798 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - adds r4, r0, 0 - movs r0, 0 - mov r9, r0 - lsls r4, 24 - lsrs r0, r4, 24 - movs r1, 0x20 - str r1, [sp] - movs r1, 0x2 - str r1, [sp, 0x4] - movs r1, 0x11 - str r1, [sp, 0x8] - movs r1, 0x3 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect - mov r8, r4 - movs r4, 0x1 -_080187C8: - movs r7, 0 - mov r0, r9 - adds r0, 0x2 - movs r1, 0x1 - add r1, r9 - mov r10, r1 - lsls r5, r0, 24 - movs r6, 0 -_080187D8: - mov r1, r9 - ands r1, r4 - adds r0, r7, 0 - ands r0, r4 - cmp r1, r0 - beq _080187FC - lsrs r2, r6, 24 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - mov r1, r8 - lsrs r0, r1, 24 - movs r1, 0x1 - lsrs r3, r5, 24 - bl FillBgTilemapBufferRect - b _08018812 -_080187FC: - lsrs r2, r6, 24 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - mov r1, r8 - lsrs r0, r1, 24 - movs r1, 0x2 - lsrs r3, r5, 24 - bl FillBgTilemapBufferRect -_08018812: - movs r0, 0x80 - lsls r0, 17 - adds r6, r0 - adds r7, 0x1 - cmp r7, 0x1F - ble _080187D8 - mov r9, r10 - mov r1, r9 - cmp r1, 0x11 - ble _080187C8 - 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_8018798 - - thumb_func_start sub_8018838 -sub_8018838: @ 8018838 - push {lr} - sub sp, 0xC - cmp r0, 0 - beq _08018846 - cmp r0, 0x1 - beq _0801885E - b _08018876 -_08018846: - movs r0, 0x20 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect - b _08018876 -_0801885E: - movs r0, 0x20 - str r0, [sp] - movs r0, 0x1E - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0x2 - bl FillBgTilemapBufferRect -_08018876: - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0xC - pop {r0} - bx r0 - thumb_func_end sub_8018838 - - thumb_func_start sub_8018884 -sub_8018884: @ 8018884 - push {r4,lr} - sub sp, 0x14 - adds r1, r0, 0 - ldr r4, =0x02021fc4 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0x1 - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r1, 0 - str r1, [sp] - str r1, [sp, 0x4] - ldr r0, =gUnknown_082F0728 - str r0, [sp, 0x8] - str r1, [sp, 0xC] - str r4, [sp, 0x10] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - movs r3, 0x1 - bl AddTextPrinterParametrized2 - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0xF - bl sub_8098858 - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0x1 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0x14 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8018884 - - thumb_func_start sub_80188DC -sub_80188DC: @ 80188DC - push {lr} - movs r0, 0x1 - bl rbox_fill_rectangle - movs r0, 0x1 - bl ClearWindowTilemap - movs r0, 0x1 - movs r1, 0x1 - bl CopyWindowToVram - pop {r0} - bx r0 - thumb_func_end sub_80188DC - - thumb_func_start mevent_0814257C -mevent_0814257C: @ 80188F8 - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - adds r0, r1, 0 - ldrb r2, [r4] - cmp r2, 0x1 - beq _08018920 - cmp r2, 0x1 - bgt _08018910 - cmp r2, 0 - beq _0801891A - b _08018980 -_08018910: - cmp r2, 0x2 - beq _08018954 - cmp r2, 0xFF - beq _0801897C - b _08018980 -_0801891A: - bl sub_8018884 - b _08018944 -_08018920: - movs r0, 0 - str r0, [sp] - ldr r0, =0x02022c58 - str r0, [sp, 0x4] - adds r0, 0x1 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0xD0 - movs r2, 0x14 - movs r3, 0x1 - bl DrawDownArrow - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _08018980 -_08018944: - ldrb r0, [r4] - adds r0, 0x1 - b _0801897E - .pool -_08018954: - movs r0, 0x1 - str r0, [sp] - ldr r0, =0x02022c58 - str r0, [sp, 0x4] - adds r0, 0x1 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0xD0 - movs r2, 0x14 - movs r3, 0x1 - bl DrawDownArrow - movs r0, 0 - strb r0, [r4] - bl sub_80188DC - movs r0, 0x1 - b _08018982 - .pool -_0801897C: - movs r0, 0x2 -_0801897E: - strb r0, [r4] -_08018980: - movs r0, 0 -_08018982: - add sp, 0xC - pop {r4} - pop {r1} - bx r1 - thumb_func_end mevent_0814257C - - thumb_func_start sub_801898C -sub_801898C: @ 801898C - push {lr} - sub sp, 0xC - movs r0, 0 - str r0, [sp] - ldr r0, =0x02022c58 - str r0, [sp, 0x4] - adds r0, 0x1 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0xD0 - movs r2, 0x14 - movs r3, 0x1 - bl DrawDownArrow - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_801898C - - thumb_func_start sub_80189B4 -sub_80189B4: @ 80189B4 - push {lr} - sub sp, 0xC - movs r0, 0x1 - str r0, [sp] - ldr r0, =0x02022c58 - str r0, [sp, 0x4] - adds r0, 0x1 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0xD0 - movs r2, 0x14 - movs r3, 0x1 - bl DrawDownArrow - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_80189B4 - - thumb_func_start sub_80189DC -sub_80189DC: @ 80189DC - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0 - beq _080189EC - cmp r0, 0x1 - beq _08018A08 - b _08018A14 -_080189EC: - bl sub_801898C - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _08018A14 - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _08018A14 - .pool -_08018A08: - bl sub_80189B4 - movs r0, 0 - strb r0, [r4] - movs r0, 0x1 - b _08018A16 -_08018A14: - movs r0, 0 -_08018A16: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80189DC - - thumb_func_start sub_8018A1C -sub_8018A1C: @ 8018A1C - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0 - bne _08018A2C - adds r0, r1, 0 - bl sub_8018884 -_08018A2C: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x78 - bhi _08018A3E - movs r0, 0 - b _08018A48 -_08018A3E: - movs r0, 0 - strb r0, [r4] - bl sub_80188DC - movs r0, 0x1 -_08018A48: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8018A1C - - thumb_func_start sub_8018A50 -sub_8018A50: @ 8018A50 - push {r4,r5,lr} - sub sp, 0x24 - lsls r2, 24 - add r1, sp, 0x4 - ldr r0, =gUnknown_082F0638 - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - ldr r0, =gUnknown_082F05E0 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp, 0x1C] - str r1, [sp, 0x20] - cmp r2, 0 - bne _08018A80 - ldr r0, =gUnknown_082F0608 - b _08018A82 - .pool -_08018A80: - ldr r0, =gUnknown_082F0620 -_08018A82: - str r0, [sp, 0x4] - add r0, sp, 0x4 - bl sub_81DB41C - adds r3, r0, 0 - movs r0, 0x1 - ands r0, r3 - cmp r0, 0 - beq _08018A96 - adds r3, 0x1 -_08018A96: - lsls r1, r3, 24 - ldr r0, =0x00ffffff - ldr r2, [sp, 0x1C] - ands r2, r0 - orrs r2, r1 - str r2, [sp, 0x1C] - cmp r3, 0x1D - bgt _08018ACC - movs r0, 0x1E - subs r0, r3 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - lsls r0, 24 - lsrs r0, 16 - ldr r1, =0xffff00ff - ands r1, r2 - orrs r1, r0 - str r1, [sp, 0x1C] - b _08018AD2 - .pool -_08018ACC: - ldr r0, =0xffff00ff - ands r2, r0 - str r2, [sp, 0x1C] -_08018AD2: - add r0, sp, 0x1C - movs r1, 0xE0 - str r1, [sp] - add r1, sp, 0x4 - movs r2, 0x1 - movs r3, 0xA - bl DoMysteryGiftListMenu - adds r4, r0, 0 - movs r0, 0x1 - negs r0, r0 - cmp r4, r0 - beq _08018AFA - movs r0, 0x2 - bl ClearWindowTilemap - movs r0, 0x2 - movs r1, 0x1 - bl CopyWindowToVram -_08018AFA: - adds r0, r4, 0 - add sp, 0x24 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8018A50 - - thumb_func_start sub_8018B08 -sub_8018B08: @ 8018B08 - push {r4-r6,lr} - sub sp, 0x1C - adds r5, r0, 0 - adds r4, r1, 0 - adds r1, r3, 0 - lsls r2, 24 - lsrs r6, r2, 24 - ldrb r0, [r5] - cmp r0, 0x1 - beq _08018B98 - cmp r0, 0x1 - bgt _08018B26 - cmp r0, 0 - beq _08018B30 - b _08018C3E -_08018B26: - cmp r0, 0x2 - beq _08018BE4 - cmp r0, 0xFF - beq _08018C1A - b _08018C3E -_08018B30: - ldr r0, =0x02021fc4 - bl ExpandStringRefs - cmp r6, 0 - bne _08018B48 - ldr r0, =gUnknown_082F05C8 - b _08018B4A - .pool -_08018B48: - ldr r0, =gUnknown_082F05D0 -_08018B4A: - bl AddWindow - strh r0, [r4] - ldrb r0, [r4] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldrb r0, [r4] - movs r2, 0 - str r2, [sp] - str r2, [sp, 0x4] - ldr r1, =gUnknown_082F0728 - str r1, [sp, 0x8] - str r2, [sp, 0xC] - ldr r1, =0x02021fc4 - str r1, [sp, 0x10] - movs r1, 0x1 - movs r3, 0x1 - bl AddTextPrinterParametrized2 - ldrb r0, [r4] - movs r1, 0x1 - movs r2, 0xF - bl sub_8098858 - ldrb r0, [r4] - movs r1, 0x2 - bl CopyWindowToVram - ldrb r0, [r4] - bl PutWindowTilemap - b _08018BD6 - .pool -_08018B98: - ldr r0, =gUnknown_082F05E8 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp, 0x14] - str r1, [sp, 0x18] - cmp r6, 0 - bne _08018BBC - ldr r0, =0xff00ffff - ldr r1, [sp, 0x14] - ands r1, r0 - movs r0, 0x90 - lsls r0, 12 - b _08018BC6 - .pool -_08018BBC: - ldr r0, =0xff00ffff - ldr r1, [sp, 0x14] - ands r1, r0 - movs r0, 0xF0 - lsls r0, 12 -_08018BC6: - orrs r1, r0 - str r1, [sp, 0x14] - add r0, sp, 0x14 - movs r1, 0xA - movs r2, 0xE - movs r3, 0 - bl CreateYesNoMenu -_08018BD6: - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - b _08018C3E - .pool -_08018BE4: - bl sub_8198C58 - lsls r0, 24 - asrs r6, r0, 24 - movs r1, 0x80 - lsls r1, 17 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x2 - bhi _08018C3E - movs r0, 0 - strb r0, [r5] - ldrb r0, [r4] - bl rbox_fill_rectangle - ldrb r0, [r4] - bl ClearWindowTilemap - ldrb r0, [r4] - movs r1, 0x1 - bl CopyWindowToVram - ldrb r0, [r4] - bl RemoveWindow - adds r0, r6, 0 - b _08018C42 -_08018C1A: - movs r0, 0 - strb r0, [r5] - ldrb r0, [r4] - bl rbox_fill_rectangle - ldrb r0, [r4] - bl ClearWindowTilemap - ldrb r0, [r4] - movs r1, 0x1 - bl CopyWindowToVram - ldrb r0, [r4] - bl RemoveWindow - movs r0, 0x1 - negs r0, r0 - b _08018C42 -_08018C3E: - movs r0, 0x2 - negs r0, r0 -_08018C42: - add sp, 0x1C - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8018B08 - - thumb_func_start sub_8018C4C -sub_8018C4C: @ 8018C4C - push {r4-r6,lr} - sub sp, 0x14 - adds r6, r0, 0 - adds r5, r1, 0 - ldrb r0, [r6] - cmp r0, 0x1 - beq _08018CE8 - cmp r0, 0x1 - bgt _08018C64 - cmp r0, 0 - beq _08018C6C - b _08018D8C -_08018C64: - cmp r0, 0xFF - bne _08018C6A - b _08018D68 -_08018C6A: - b _08018D8C -_08018C6C: - cmp r2, 0 - bne _08018C84 - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085EF2FC - bl ExpandStringRefs - b _08018C8C - .pool -_08018C84: - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085EF330 - bl ExpandStringRefs -_08018C8C: - ldr r0, =gUnknown_082F05D8 - bl AddWindow - strh r0, [r5] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldrb r0, [r5] - movs r2, 0 - str r2, [sp] - str r2, [sp, 0x4] - ldr r1, =gUnknown_082F0728 - str r1, [sp, 0x8] - str r2, [sp, 0xC] - ldr r1, =0x02021fc4 - str r1, [sp, 0x10] - movs r1, 0x1 - movs r3, 0x1 - bl AddTextPrinterParametrized2 - ldrb r0, [r5] - movs r1, 0x1 - movs r2, 0xF - bl sub_8098858 - ldrb r0, [r5] - movs r1, 0x2 - bl CopyWindowToVram - ldrb r0, [r5] - bl PutWindowTilemap - ldrb r0, [r6] - adds r0, 0x1 - strb r0, [r6] - b _08018D8C - .pool -_08018CE8: - cmp r3, 0 - beq _08018D10 - cmp r2, 0 - bne _08018D00 - ldr r0, =gUnknown_082F05F8 - ldr r1, =gUnknown_082F06C8 - b _08018D28 - .pool -_08018D00: - ldr r0, =gUnknown_082F0600 - ldr r1, =gUnknown_082F06F8 - b _08018D28 - .pool -_08018D10: - cmp r2, 0 - bne _08018D24 - ldr r0, =gUnknown_082F05F0 - ldr r1, =gUnknown_082F06B0 - b _08018D28 - .pool -_08018D24: - ldr r0, =gUnknown_082F05F8 - ldr r1, =gUnknown_082F06E0 -_08018D28: - movs r2, 0xE0 - str r2, [sp] - movs r2, 0x1 - movs r3, 0xA - bl DoMysteryGiftListMenu - adds r4, r0, 0 - movs r0, 0x1 - negs r0, r0 - cmp r4, r0 - beq _08018D8C - movs r0, 0 - strb r0, [r6] - ldrb r0, [r5] - bl rbox_fill_rectangle - ldrb r0, [r5] - bl ClearWindowTilemap - ldrb r0, [r5] - movs r1, 0x1 - bl CopyWindowToVram - ldrb r0, [r5] - bl RemoveWindow - adds r0, r4, 0 - b _08018D90 - .pool -_08018D68: - movs r0, 0 - strb r0, [r6] - ldrb r0, [r5] - bl rbox_fill_rectangle - ldrb r0, [r5] - bl ClearWindowTilemap - ldrb r0, [r5] - movs r1, 0x1 - bl CopyWindowToVram - ldrb r0, [r5] - bl RemoveWindow - movs r0, 0x2 - negs r0, r0 - b _08018D90 -_08018D8C: - movs r0, 0x1 - negs r0, r0 -_08018D90: - add sp, 0x14 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8018C4C - - thumb_func_start sub_8018D98 -sub_8018D98: @ 8018D98 - push {lr} - cmp r0, 0 - beq _08018DA4 - bl sub_801B0CC - b _08018DA8 -_08018DA4: - bl sub_801B27C -_08018DA8: - pop {r1} - bx r1 - thumb_func_end sub_8018D98 - - thumb_func_start sub_8018DAC -sub_8018DAC: @ 8018DAC - push {r4,r5,lr} - adds r5, r0, 0 - ldrb r0, [r5] - cmp r0, 0 - beq _08018DBC - cmp r0, 0x1 - beq _08018DE4 - b _08018E00 -_08018DBC: - cmp r1, 0 - bne _08018DD4 - bl sav1_get_mevent_buffer_1 - adds r4, r0, 0 - bl sav1_get_mevent_buffer_2 - adds r1, r0, 0 - adds r0, r4, 0 - bl sub_801BAAC - b _08018DDC -_08018DD4: - bl sub_801B00C - bl sub_801C6C8 -_08018DDC: - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - b _08018E00 -_08018DE4: - cmp r1, 0 - bne _08018DF2 - bl sub_801BB74 -_08018DEC: - cmp r0, 0 - bne _08018DF8 - b _08018E00 -_08018DF2: - bl sub_801C758 - b _08018DEC -_08018DF8: - movs r0, 0 - strb r0, [r5] - movs r0, 0x1 - b _08018E02 -_08018E00: - movs r0, 0 -_08018E02: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8018DAC - - thumb_func_start sub_8018E08 -sub_8018E08: @ 8018E08 - push {lr} - cmp r0, 0 - bne _08018E14 - bl sub_801B1E8 - b _08018E18 -_08018E14: - bl sub_801B06C -_08018E18: - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_8018E08 - - thumb_func_start sub_8018E20 -sub_8018E20: @ 8018E20 - push {lr} - cmp r0, 0 - bne _08018E36 - adds r0, r1, 0 - bl sub_801BDA4 - cmp r0, 0 - beq _08018E40 - bl sub_801BB48 - b _08018E48 -_08018E36: - adds r0, r1, 0 - bl sub_801CA50 - cmp r0, 0 - bne _08018E44 -_08018E40: - movs r0, 0 - b _08018E4A -_08018E44: - bl sub_801C72C -_08018E48: - movs r0, 0x1 -_08018E4A: - pop {r1} - bx r1 - thumb_func_end sub_8018E20 - - thumb_func_start sub_8018E50 -sub_8018E50: @ 8018E50 - push {lr} - cmp r2, 0 - beq _08018E60 - ldr r3, =gUnknown_085EF55C - b _08018E62 - .pool -_08018E60: - ldr r3, =gUnknown_085EF520 -_08018E62: - movs r2, 0x1 - bl sub_8018B08 - lsls r0, 24 - asrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8018E50 - - thumb_func_start mevent_message_was_thrown_away -mevent_message_was_thrown_away: @ 8018E74 - push {lr} - cmp r1, 0 - beq _08018E84 - ldr r1, =gUnknown_085EF630 - b _08018E86 - .pool -_08018E84: - ldr r1, =gUnknown_085EF60C -_08018E86: - bl mevent_0814257C - pop {r1} - bx r1 - .pool - thumb_func_end mevent_message_was_thrown_away - - thumb_func_start mevent_save_game -mevent_save_game: @ 8018E94 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0x4 - bhi _08018F04 - lsls r0, 2 - ldr r1, =_08018EAC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08018EAC: - .4byte _08018EC0 - .4byte _08018ECC - .4byte _08018ED4 - .4byte _08018EE0 - .4byte _08018EF8 -_08018EC0: - ldr r0, =gUnknown_085EF5BC - bl sub_8018884 - b _08018EEC - .pool -_08018ECC: - movs r0, 0 - bl save_game_when_memory_present - b _08018EEC -_08018ED4: - ldr r0, =gUnknown_085EF5E0 - bl sub_8018884 - b _08018EEC - .pool -_08018EE0: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _08018F04 -_08018EEC: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _08018F04 - .pool -_08018EF8: - movs r0, 0 - strb r0, [r4] - bl sub_80188DC - movs r0, 0x1 - b _08018F06 -_08018F04: - movs r0, 0 -_08018F06: - pop {r4} - pop {r1} - bx r1 - thumb_func_end mevent_save_game - - thumb_func_start mevent_message -mevent_message: @ 8018F0C - push {r4-r6,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r5, r2, 24 - movs r2, 0 - str r2, [r4] - cmp r3, 0xE - bls _08018F22 - b _08019034 -_08018F22: - lsls r0, r3, 2 - ldr r1, =_08018F30 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08018F30: - .4byte _08018F6C - .4byte _08018F78 - .4byte _08018F84 - .4byte _08018F9C - .4byte _08018FB4 - .4byte _08018FC0 - .4byte _08018FCC - .4byte _08018FD8 - .4byte _08018FE4 - .4byte _08018FF0 - .4byte _08018FFC - .4byte _08019014 - .4byte _08019020 - .4byte _0801902C - .4byte _08019030 -_08018F6C: - movs r0, 0 - str r0, [r4] - ldr r2, =gUnknown_085EF2E4 - b _08019034 - .pool -_08018F78: - movs r0, 0 - str r0, [r4] - ldr r2, =gUnknown_085EF244 - b _08019034 - .pool -_08018F84: - movs r0, 0x1 - str r0, [r4] - ldr r2, =gUnknown_085EF0C8 - cmp r5, 0 - bne _08019034 - ldr r2, =gUnknown_085EF124 - b _08019034 - .pool -_08018F9C: - movs r0, 0x1 - str r0, [r4] - ldr r2, =gUnknown_085EF0F4 - cmp r5, 0 - bne _08019034 - ldr r2, =gUnknown_085EF14C - b _08019034 - .pool -_08018FB4: - movs r0, 0x1 - str r0, [r4] - ldr r2, =gUnknown_085EF178 - b _08019034 - .pool -_08018FC0: - movs r0, 0 - str r0, [r4] - ldr r2, =gUnknown_085EF1B4 - b _08019034 - .pool -_08018FCC: - movs r0, 0 - str r0, [r4] - ldr r2, =gUnknown_085EF200 - b _08019034 - .pool -_08018FD8: - movs r0, 0 - str r0, [r4] - ldr r2, =gUnknown_085EF1D8 - b _08019034 - .pool -_08018FE4: - movs r0, 0 - str r0, [r4] - ldr r2, =gUnknown_085EF21C - b _08019034 - .pool -_08018FF0: - movs r0, 0 - str r0, [r4] - ldr r2, =gUnknown_085EF02C - b _08019034 - .pool -_08018FFC: - movs r0, 0 - str r0, [r4] - ldr r2, =gUnknown_085EF2B4 - cmp r6, 0 - bne _08019034 - ldr r2, =gUnknown_085EF280 - b _08019034 - .pool -_08019014: - movs r0, 0 - str r0, [r4] - ldr r2, =gUnknown_085EF014 - b _08019034 - .pool -_08019020: - movs r0, 0x1 - str r0, [r4] - ldr r2, =gUnknown_085EF198 - b _08019034 - .pool -_0801902C: - movs r0, 0x1 - b _08019032 -_08019030: - movs r0, 0 -_08019032: - str r0, [r4] -_08019034: - adds r0, r2, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end mevent_message - - thumb_func_start mevent_08142CE8 -mevent_08142CE8: @ 801903C - push {r4-r6,lr} - adds r6, r0, 0 - adds r0, r1, 0 - adds r5, r2, 0 - ldrb r4, [r6] - cmp r4, 0x1 - beq _0801906E - cmp r4, 0x1 - bgt _08019054 - cmp r4, 0 - beq _0801905A - b _0801909A -_08019054: - cmp r4, 0x2 - beq _08019084 - b _0801909A -_0801905A: - cmp r0, 0 - beq _08019062 - bl sub_8018884 -_08019062: - movs r0, 0xB9 - lsls r0, 1 - bl fanfare_play - strh r4, [r5] - b _0801907C -_0801906E: - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xF0 - bls _0801909A -_0801907C: - ldrb r0, [r6] - adds r0, 0x1 - strb r0, [r6] - b _0801909A -_08019084: - bl task_is_not_running_overworld_fanfare - lsls r0, 24 - cmp r0, 0 - beq _0801909A - movs r0, 0 - strb r0, [r6] - bl sub_80188DC - movs r0, 0x1 - b _0801909C -_0801909A: - movs r0, 0 -_0801909C: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end mevent_08142CE8 - - thumb_func_start mevent_message_stamp_card_etc_send_status -mevent_message_stamp_card_etc_send_status: @ 80190A4 - push {r4,lr} - adds r3, r0, 0 - ldr r1, =gUnknown_085EF014 - movs r0, 0 - str r0, [r3] - adds r4, r1, 0 - cmp r2, 0xE - bhi _08019166 - lsls r0, r2, 2 - ldr r1, =_080190C8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080190C8: - .4byte _08019104 - .4byte _0801910C - .4byte _08019114 - .4byte _0801911C - .4byte _08019128 - .4byte _08019130 - .4byte _08019138 - .4byte _08019140 - .4byte _08019148 - .4byte _08019150 - .4byte _08019164 - .4byte _08019158 - .4byte _0801915C - .4byte _0801915C - .4byte _08019164 -_08019104: - ldr r1, =gUnknown_085EF2E4 - b _08019166 - .pool -_0801910C: - ldr r1, =gUnknown_085EF244 - b _08019166 - .pool -_08019114: - ldr r1, =gUnknown_085EF39C - b _0801911E - .pool -_0801911C: - ldr r1, =gUnknown_085EF3C4 -_0801911E: - movs r0, 0x1 - str r0, [r3] - b _08019166 - .pool -_08019128: - ldr r1, =gUnknown_085EF3F0 - b _08019166 - .pool -_08019130: - ldr r1, =gUnknown_085EF42C - b _08019166 - .pool -_08019138: - ldr r1, =gUnknown_085EF494 - b _08019166 - .pool -_08019140: - ldr r1, =gUnknown_085EF460 - b _08019166 - .pool -_08019148: - ldr r1, =gUnknown_085EF21C - b _08019166 - .pool -_08019150: - ldr r1, =gUnknown_085EF4C4 - b _08019166 - .pool -_08019158: - adds r1, r4, 0 - b _08019166 -_0801915C: - ldr r1, =gUnknown_085EF410 - b _08019166 - .pool -_08019164: - ldr r1, =gUnknown_085EF4F0 -_08019166: - adds r0, r1, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end mevent_message_stamp_card_etc_send_status - - thumb_func_start sub_8019174 -sub_8019174: @ 8019174 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - adds r1, r2, 0 - adds r2, r3, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, sp - bl mevent_message_stamp_card_etc_send_status - adds r1, r0, 0 - ldr r0, [sp] - cmp r0, 0 - bne _0801919A - adds r0, r4, 0 - bl mevent_0814257C - b _080191A2 -_0801919A: - adds r0, r4, 0 - adds r2, r5, 0 - bl mevent_08142CE8 -_080191A2: - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8019174 - - thumb_func_start task_add_00_mystery_gift -task_add_00_mystery_gift: @ 80191AC - push {r4,lr} - ldr r0, =task00_mystery_gift - movs r1, 0 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =0x03005e08 - adds r4, r0 - movs r0, 0 - strb r0, [r4, 0x8] - strb r0, [r4, 0x9] - strb r0, [r4, 0xA] - strb r0, [r4, 0xB] - strb r0, [r4, 0xC] - strb r0, [r4, 0xD] - movs r1, 0 - strh r0, [r4] - strh r0, [r4, 0x2] - strh r0, [r4, 0x4] - strh r0, [r4, 0x6] - strb r1, [r4, 0xE] - movs r0, 0x40 - bl AllocZeroed - str r0, [r4, 0x10] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task_add_00_mystery_gift - - thumb_func_start task00_mystery_gift -task00_mystery_gift: @ 80191F4 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r5, r0, r1 - ldrb r0, [r5, 0x8] - cmp r0, 0x25 - bls _0801920E - b _08019922 -_0801920E: - lsls r0, 2 - ldr r1, =_08019220 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08019220: - .4byte _080192B8 - .4byte _080192BE - .4byte _08019300 - .4byte _08019338 - .4byte _0801935C - .4byte _080193AC - .4byte _0801940C - .4byte _08019444 - .4byte _08019454 - .4byte _080194CC - .4byte _080194F0 - .4byte _08019508 - .4byte _08019538 - .4byte _08019574 - .4byte _0801958C - .4byte _080195BC - .4byte _080198EC - .4byte _0801961A - .4byte _0801962A - .4byte _08019922 - .4byte _0801963C - .4byte _08019688 - .4byte _080196FE - .4byte _0801972E - .4byte _08019764 - .4byte _0801977E - .4byte _08019792 - .4byte _0801979E - .4byte _080197B2 - .4byte _080197C6 - .4byte _080197F8 - .4byte _0801982C - .4byte _08019870 - .4byte _08019884 - .4byte _080198A0 - .4byte _080198B8 - .4byte _080198EC - .4byte _0801990C -_080192B8: - movs r0, 0x1 - strb r0, [r5, 0x8] - b _08019922 -_080192BE: - adds r0, r5, 0 - adds r0, 0x9 - adds r1, r5, 0 - movs r2, 0 - bl sub_8018A50 - adds r1, r0, 0 - cmp r1, 0x1 - beq _080192E8 - cmp r1, 0x1 - bcc _080192DE - movs r0, 0x2 - negs r0, r0 - cmp r1, r0 - beq _080192FA - b _08019922 -_080192DE: - movs r0, 0 - strb r0, [r5, 0xC] - bl sub_801B27C - b _080192EE -_080192E8: - strb r1, [r5, 0xC] - bl sub_801B0CC -_080192EE: - cmp r0, 0x1 - bne _080192F4 - b _08019820 -_080192F4: - movs r0, 0x2 - strb r0, [r5, 0x8] - b _08019922 -_080192FA: - movs r0, 0x25 - strb r0, [r5, 0x8] - b _08019922 -_08019300: - ldrb r0, [r5, 0xC] - cmp r0, 0 - bne _08019314 - adds r0, r5, 0 - adds r0, 0x9 - ldr r1, =gUnknown_085EEEF0 - b _0801931A - .pool -_08019314: - adds r0, r5, 0 - adds r0, 0x9 - ldr r1, =gUnknown_085EEF2C -_0801931A: - bl mevent_0814257C - cmp r0, 0 - bne _08019324 - b _08019922 -_08019324: - movs r0, 0x3 - strb r0, [r5, 0x8] - movs r0, 0 - movs r1, 0x1 - bl sub_80186EC - b _08019922 - .pool -_08019338: - ldrb r0, [r5, 0xC] - cmp r0, 0 - bne _0801934C - ldr r0, =gUnknown_085EEF68 - bl sub_8018884 - b _08019352 - .pool -_0801934C: - ldr r0, =gUnknown_085EEF94 - bl sub_8018884 -_08019352: - movs r0, 0x4 - strb r0, [r5, 0x8] - b _08019922 - .pool -_0801935C: - adds r0, r5, 0 - adds r0, 0x9 - adds r1, r5, 0 - movs r2, 0x1 - bl sub_8018A50 - adds r4, r0, 0 - cmp r4, 0x1 - beq _0801938A - cmp r4, 0x1 - bcc _0801937C - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - beq _08019396 - b _08019922 -_0801937C: - bl sub_80188DC - movs r1, 0 - movs r0, 0x5 - strb r0, [r5, 0x8] - strb r1, [r5, 0xD] - b _08019922 -_0801938A: - bl sub_80188DC - movs r0, 0x5 - strb r0, [r5, 0x8] - strb r4, [r5, 0xD] - b _08019922 -_08019396: - bl sub_80188DC - ldrb r0, [r5, 0xC] - bl sub_8018D98 - cmp r0, 0 - beq _080193A6 - b _08019820 -_080193A6: - strb r0, [r5, 0x8] - movs r0, 0 - b _080198FE -_080193AC: - ldr r0, =0x02021cc4 - movs r1, 0xFF - strb r1, [r0] - ldr r0, =0x02021dc4 - strb r1, [r0] - ldr r0, =0x02021ec4 - strb r1, [r0] - ldrb r0, [r5, 0xC] - cmp r0, 0 - beq _080193D4 - cmp r0, 0x1 - beq _080193EE - b _08019406 - .pool -_080193D4: - ldrb r0, [r5, 0xD] - cmp r0, 0x1 - bne _080193E2 - movs r0, 0x15 - bl sub_8014EFC - b _08019406 -_080193E2: - cmp r0, 0 - bne _08019406 - movs r0, 0x15 - bl sub_80152A8 - b _08019406 -_080193EE: - ldrb r0, [r5, 0xD] - cmp r0, 0x1 - bne _080193FC - movs r0, 0x16 - bl sub_8014EFC - b _08019406 -_080193FC: - cmp r0, 0 - bne _08019406 - movs r0, 0x16 - bl sub_80152A8 -_08019406: - movs r0, 0x6 - strb r0, [r5, 0x8] - b _08019922 -_0801940C: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _0801942C - movs r0, 0x1 - bl sub_8018838 - movs r0, 0x7 - strb r0, [r5, 0x8] - ldrb r0, [r5, 0xC] - bl sub_801D484 - b _08019922 - .pool -_0801942C: - ldr r0, =0x020375f0 - ldrh r0, [r0] - cmp r0, 0x5 - beq _08019436 - b _08019922 -_08019436: - movs r0, 0x1 - bl sub_8018838 - b _080197C0 - .pool -_08019444: - ldr r0, =gUnknown_085EEFE8 - bl sub_8018884 - movs r0, 0x8 - strb r0, [r5, 0x8] - b _08019922 - .pool -_08019454: - adds r0, r5, 0 - bl sub_801D4A8 - subs r0, 0x2 - cmp r0, 0x4 - bls _08019462 - b _08019922 -_08019462: - lsls r0, 2 - ldr r1, =_08019470 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08019470: - .4byte _080194AE - .4byte _080194A8 - .4byte _080194B4 - .4byte _08019492 - .4byte _08019484 -_08019484: - bl task_add_05_task_del_08FA224_when_no_RfuFunc - ldrh r0, [r5] - strb r0, [r5, 0xE] - movs r0, 0xD - strb r0, [r5, 0x8] - b _08019922 -_08019492: - ldr r4, [r5, 0x10] - bl sub_801D4F4 - adds r1, r0, 0 - adds r0, r4, 0 - movs r2, 0x40 - bl memcpy - bl sub_801D4E4 - b _08019922 -_080194A8: - movs r0, 0xA - strb r0, [r5, 0x8] - b _08019922 -_080194AE: - movs r0, 0x9 - strb r0, [r5, 0x8] - b _08019922 -_080194B4: - movs r0, 0xB - strb r0, [r5, 0x8] - ldr r0, =0x02021cc4 - ldr r1, =0x020229f0 - bl CopyString - b _08019922 - .pool -_080194CC: - adds r4, r5, 0 - adds r4, 0x9 - bl sub_801D4F4 - adds r3, r0, 0 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0 - bl sub_8018B08 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0x1 - beq _08019564 - cmp r1, 0x1 - bcs _08019552 - movs r0, 0 - b _08019566 -_080194F0: - adds r4, r5, 0 - adds r4, 0x9 - bl sub_801D4F4 - adds r1, r0, 0 - adds r0, r4, 0 - bl mevent_0814257C - cmp r0, 0 - bne _08019506 - b _08019922 -_08019506: - b _0801956A -_08019508: - adds r0, r5, 0 - adds r0, 0x9 - ldr r3, =gUnknown_085EF050 - adds r1, r5, 0 - movs r2, 0 - bl sub_8018B08 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0x1 - beq _08019564 - cmp r1, 0x1 - bcs _08019552 - bl sub_801B3F8 - cmp r0, 0x1 - bne _08019534 - movs r0, 0xC - strb r0, [r5, 0x8] - b _08019922 - .pool -_08019534: - movs r0, 0 - b _08019566 -_08019538: - adds r0, r5, 0 - adds r0, 0x9 - ldr r3, =gUnknown_085EF084 - adds r1, r5, 0 - movs r2, 0 - bl sub_8018B08 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0x1 - beq _08019564 - cmp r1, 0x1 - bcc _08019560 -_08019552: - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08019564 - b _08019922 - .pool -_08019560: - movs r0, 0 - b _08019566 -_08019564: - movs r0, 0x1 -_08019566: - bl sub_801D500 -_0801956A: - bl sub_801D4E4 - movs r0, 0x7 - strb r0, [r5, 0x8] - b _08019922 -_08019574: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _0801957E - b _08019922 -_0801957E: - bl sub_800E084 - movs r0, 0xE - strb r0, [r5, 0x8] - b _08019922 - .pool -_0801958C: - adds r0, r5, 0 - adds r0, 0x9 - ldr r1, =gUnknown_085EEFF8 - bl sub_8018A1C - cmp r0, 0 - bne _0801959C - b _08019922 -_0801959C: - ldrb r0, [r5, 0xD] - cmp r0, 0x1 - bne _080195AA - ldr r0, =0x02021cc4 - ldr r1, =0x020229f0 - bl CopyString -_080195AA: - movs r0, 0xF - strb r0, [r5, 0x8] - b _08019922 - .pool -_080195BC: - ldrb r1, [r5, 0xC] - ldrb r2, [r5, 0xD] - ldrb r3, [r5, 0xE] - mov r0, sp - bl mevent_message - adds r1, r0, 0 - cmp r1, 0 - bne _080195D0 - ldr r1, [r5, 0x10] -_080195D0: - ldr r0, [sp] - cmp r0, 0 - beq _080195E2 - adds r0, r5, 0 - adds r0, 0x9 - adds r2, r5, 0 - bl mevent_08142CE8 - b _080195EA -_080195E2: - adds r0, r5, 0 - adds r0, 0x9 - bl mevent_0814257C -_080195EA: - adds r1, r0, 0 - cmp r1, 0 - bne _080195F2 - b _08019922 -_080195F2: - ldrb r0, [r5, 0xE] - cmp r0, 0x3 - bne _0801960C - ldrb r0, [r5, 0xD] - cmp r0, 0x1 - bne _08019606 - movs r0, 0x1 - bl sub_801DB68 - b _0801960C -_08019606: - movs r0, 0x2 - bl sub_801DB68 -_0801960C: - ldr r0, [sp] - cmp r0, 0 - beq _08019614 - b _080198DC -_08019614: - strb r0, [r5, 0x8] - movs r0, 0 - b _080198FE -_0801961A: - adds r0, r5, 0 - adds r0, 0x9 - bl mevent_save_game - cmp r0, 0 - bne _08019628 - b _08019922 -_08019628: - b _08019820 -_0801962A: - adds r0, r5, 0 - adds r0, 0x9 - ldrb r1, [r5, 0xC] - bl sub_8018DAC - cmp r0, 0 - bne _0801963A - b _08019922 -_0801963A: - b _080196F8 -_0801963C: - ldrb r0, [r5, 0xC] - cmp r0, 0 - bne _08019664 - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08019652 - movs r0, 0x15 - strb r0, [r5, 0x8] -_08019652: - ldrh r1, [r2, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _0801965E - b _08019922 -_0801965E: - b _08019682 - .pool -_08019664: - ldr r0, =0x030022c0 - ldrh r0, [r0, 0x2E] - bl sub_801CCD0 - cmp r0, 0 - beq _0801967C - cmp r0, 0x1 - beq _08019682 - b _08019922 - .pool -_0801967C: - bl sub_801CC38 - b _0801975E -_08019682: - movs r0, 0x1B - strb r0, [r5, 0x8] - b _08019922 -_08019688: - ldrb r0, [r5, 0xC] - cmp r0, 0 - bne _080196A2 - bl sub_801B308 - cmp r0, 0 - beq _080196B6 - adds r0, r5, 0 - adds r0, 0x9 - ldrb r2, [r5, 0xC] - adds r1, r5, 0 - movs r3, 0 - b _080196C0 -_080196A2: - bl sub_801B128 - cmp r0, 0 - beq _080196B6 - adds r0, r5, 0 - adds r0, 0x9 - ldrb r2, [r5, 0xC] - adds r1, r5, 0 - movs r3, 0 - b _080196C0 -_080196B6: - adds r0, r5, 0 - adds r0, 0x9 - ldrb r2, [r5, 0xC] - adds r1, r5, 0 - movs r3, 0x1 -_080196C0: - bl sub_8018C4C - adds r1, r0, 0 - cmp r1, 0x1 - beq _080196E2 - cmp r1, 0x1 - bcc _080196DC - cmp r1, 0x2 - beq _080196E8 - movs r0, 0x2 - negs r0, r0 - cmp r1, r0 - beq _080196EE - b _08019922 -_080196DC: - movs r0, 0x1C - strb r0, [r5, 0x8] - b _08019922 -_080196E2: - movs r0, 0x1D - strb r0, [r5, 0x8] - b _08019922 -_080196E8: - movs r0, 0x16 - strb r0, [r5, 0x8] - b _08019922 -_080196EE: - ldrb r0, [r5, 0xC] - cmp r0, 0x1 - bne _080196F8 - bl sub_801CC80 -_080196F8: - movs r0, 0x14 - strb r0, [r5, 0x8] - b _08019922 -_080196FE: - adds r0, r5, 0 - adds r0, 0x9 - ldrb r2, [r5, 0xC] - adds r1, r5, 0 - bl sub_8018E50 - adds r1, r0, 0 - cmp r1, 0 - beq _0801971A - cmp r1, 0 - ble _08019748 - cmp r1, 0x1 - beq _0801975E - b _08019922 -_0801971A: - ldrb r0, [r5, 0xC] - cmp r0, 0 - bne _08019758 - bl sub_801B3F8 - cmp r0, 0x1 - bne _08019758 - movs r0, 0x17 - strb r0, [r5, 0x8] - b _08019922 -_0801972E: - adds r0, r5, 0 - adds r0, 0x9 - ldr r3, =gUnknown_085EF584 - adds r1, r5, 0 - movs r2, 0x1 - bl sub_8018B08 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0x1 - beq _0801975E - cmp r1, 0x1 - bcc _08019758 -_08019748: - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _0801975E - b _08019922 - .pool -_08019758: - movs r0, 0x18 - strb r0, [r5, 0x8] - b _08019922 -_0801975E: - movs r0, 0x15 - strb r0, [r5, 0x8] - b _08019922 -_08019764: - ldrb r0, [r5, 0xC] - movs r1, 0x1 - bl sub_8018E20 - cmp r0, 0 - bne _08019772 - b _08019922 -_08019772: - ldrb r0, [r5, 0xC] - bl sub_8018E08 - movs r0, 0x19 - strb r0, [r5, 0x8] - b _08019922 -_0801977E: - adds r0, r5, 0 - adds r0, 0x9 - bl mevent_save_game - cmp r0, 0 - bne _0801978C - b _08019922 -_0801978C: - movs r0, 0x1A - strb r0, [r5, 0x8] - b _08019922 -_08019792: - adds r0, r5, 0 - adds r0, 0x9 - ldrb r1, [r5, 0xC] - bl mevent_message_was_thrown_away - b _080198F6 -_0801979E: - ldrb r0, [r5, 0xC] - movs r1, 0 - bl sub_8018E20 - cmp r0, 0 - bne _080197AC - b _08019922 -_080197AC: - movs r0, 0 - strb r0, [r5, 0x8] - b _08019922 -_080197B2: - ldrb r0, [r5, 0xC] - movs r1, 0x1 - bl sub_8018E20 - cmp r0, 0 - bne _080197C0 - b _08019922 -_080197C0: - movs r0, 0x3 - strb r0, [r5, 0x8] - b _08019922 -_080197C6: - ldrb r0, [r5, 0xC] - movs r1, 0x1 - bl sub_8018E20 - cmp r0, 0 - bne _080197D4 - b _08019922 -_080197D4: - ldrb r0, [r5, 0xC] - cmp r0, 0 - beq _080197E0 - cmp r0, 0x1 - beq _080197E8 - b _080197EE -_080197E0: - movs r0, 0x15 - bl sub_8014A00 - b _080197EE -_080197E8: - movs r0, 0x16 - bl sub_8014A00 -_080197EE: - movs r0, 0x1 - strb r0, [r5, 0xD] - movs r0, 0x1E - strb r0, [r5, 0x8] - b _08019922 -_080197F8: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _08019810 - movs r0, 0x1 - bl sub_8018838 - movs r0, 0x1F - strb r0, [r5, 0x8] - b _08019922 - .pool -_08019810: - ldr r0, =0x020375f0 - ldrh r0, [r0] - cmp r0, 0x5 - beq _0801981A - b _08019922 -_0801981A: - movs r0, 0x1 - bl sub_8018838 -_08019820: - movs r0, 0x12 - strb r0, [r5, 0x8] - b _08019922 - .pool -_0801982C: - ldr r0, =0x02021cc4 - movs r1, 0xFF - strb r1, [r0] - ldr r0, =0x02021dc4 - strb r1, [r0] - ldr r0, =0x02021ec4 - strb r1, [r0] - ldrb r0, [r5, 0xC] - cmp r0, 0 - bne _0801985C - ldr r0, =gUnknown_085EF360 - bl sub_8018884 - bl mevent_srv_new_wcard - b _08019866 - .pool -_0801985C: - ldr r0, =gUnknown_085EF37C - bl sub_8018884 - bl mevent_srv_init_wnews -_08019866: - movs r0, 0x20 - strb r0, [r5, 0x8] - b _08019922 - .pool -_08019870: - adds r0, r5, 0 - bl sub_801D0C4 - cmp r0, 0x3 - bne _08019922 - ldrh r0, [r5] - strb r0, [r5, 0xE] - movs r0, 0x21 - strb r0, [r5, 0x8] - b _08019922 -_08019884: - bl task_add_05_task_del_08FA224_when_no_RfuFunc - ldr r0, =0x02021cc4 - ldr r1, =0x02022a0c - bl CopyString - movs r0, 0x22 - strb r0, [r5, 0x8] - b _08019922 - .pool -_080198A0: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _08019922 - bl sub_800E084 - movs r0, 0x23 - strb r0, [r5, 0x8] - b _08019922 - .pool -_080198B8: - adds r0, r5, 0 - adds r0, 0x9 - ldrb r2, [r5, 0xD] - ldrb r3, [r5, 0xE] - adds r1, r5, 0 - bl sub_8019174 - cmp r0, 0 - beq _08019922 - ldr r0, [r5, 0xC] - ldr r1, =0x00ffff00 - ands r0, r1 - ldr r1, =0x00030100 - cmp r0, r1 - bne _080198FA - movs r0, 0x3 - bl sub_801DB68 -_080198DC: - movs r0, 0x11 - strb r0, [r5, 0x8] - b _08019922 - .pool -_080198EC: - adds r0, r5, 0 - adds r0, 0x9 - ldr r1, =gUnknown_085EF014 - bl mevent_0814257C -_080198F6: - cmp r0, 0 - beq _08019922 -_080198FA: - movs r0, 0 - strb r0, [r5, 0x8] -_080198FE: - movs r1, 0 - bl sub_80186EC - b _08019922 - .pool -_0801990C: - bl sub_80097E8 - ldr r0, [r5, 0x10] - bl Free - adds r0, r4, 0 - bl remove_task - ldr r0, =sub_80186A4 - bl SetMainCallback2 -_08019922: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end task00_mystery_gift - - thumb_func_start sub_8019930 -sub_8019930: @ 8019930 - ldr r0, =0x000001a9 - bx lr - .pool - thumb_func_end sub_8019930 - - thumb_func_start bgid_upload_textbox_1 -bgid_upload_textbox_1: @ 8019938 - push {lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_082F0568 - movs r2, 0x80 - lsls r2, 1 - movs r3, 0 - str r3, [sp] - bl copy_decompressed_tile_data_to_vram_autofree - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end bgid_upload_textbox_1 - - thumb_func_start is_walking_or_running -is_walking_or_running: @ 8019958 - push {lr} - ldr r0, =0x02037590 - ldrb r0, [r0, 0x3] - cmp r0, 0x2 - beq _08019966 - cmp r0, 0 - bne _08019970 -_08019966: - movs r0, 0x1 - b _08019972 - .pool -_08019970: - movs r0, 0 -_08019972: - pop {r1} - bx r1 - thumb_func_end is_walking_or_running - - thumb_func_start sub_8019978 -sub_8019978: @ 8019978 - ldr r3, =gUnknown_082F072C - movs r2, 0x7 - ands r2, r1 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 1 - adds r2, r1 - adds r2, r3 - ldrb r0, [r2] - bx lr - .pool - thumb_func_end sub_8019978 - - thumb_func_start sub_8019990 -sub_8019990: @ 8019990 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r4, =gUnknown_082F0740 - mov r8, r4 - lsls r0, 2 - adds r4, r0, r4 - movs r6, 0 - ldrsh r5, [r4, r6] - ldr r6, =gUnknown_082F0760 - lsls r1, 1 - adds r4, r1, r6 - ldrb r4, [r4] - lsls r4, 24 - asrs r4, 24 - adds r5, r4 - adds r5, 0x7 - str r5, [r2] - movs r2, 0x2 - add r8, r2 - add r0, r8 - movs r4, 0 - ldrsh r0, [r0, r4] - adds r6, 0x1 - adds r1, r6 - ldrb r1, [r1] - lsls r1, 24 - asrs r1, 24 - adds r0, r1 - adds r0, 0x7 - str r0, [r3] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8019990 - - thumb_func_start sub_80199E0 -sub_80199E0: @ 80199E0 - push {r4-r7,lr} - mov r12, r3 - ldr r7, =gUnknown_082F0740 - lsls r5, r0, 2 - adds r0, r5, r7 - movs r4, 0 - ldrsh r3, [r0, r4] - ldr r6, =gUnknown_082F0760 - lsls r4, r1, 1 - adds r0, r4, r6 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - adds r3, r0 - adds r3, 0x7 - cmp r3, r2 - bne _08019A28 - adds r0, r7, 0x2 - adds r0, r5, r0 - movs r2, 0 - ldrsh r1, [r0, r2] - adds r0, r6, 0x1 - adds r0, r4, r0 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - adds r1, r0 - adds r1, 0x7 - cmp r1, r12 - bne _08019A28 - movs r0, 0x1 - b _08019A2A - .pool -_08019A28: - movs r0, 0 -_08019A2A: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80199E0 - - thumb_func_start sub_8019A30 -sub_8019A30: @ 8019A30 - push {lr} - ldr r1, =0x000002bf - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8019A30 - - thumb_func_start flag_set_x63 -flag_set_x63: @ 8019A4C - push {lr} - ldr r1, =0x000002bf - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - bl FlagSet - pop {r0} - bx r0 - .pool - thumb_func_end flag_set_x63 - - thumb_func_start flag_clear_x63 -flag_clear_x63: @ 8019A64 - push {lr} - ldr r1, =0x000002bf - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - bl FlagReset - pop {r0} - bx r0 - .pool - thumb_func_end flag_clear_x63 - - thumb_func_start sub_8019A7C -sub_8019A7C: @ 8019A7C - push {lr} - ldr r2, =0x00004010 - adds r0, r2 - lsls r0, 16 - lsrs r0, 16 - lsls r1, 16 - lsrs r1, 16 - bl VarSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_8019A7C - - thumb_func_start sub_8019A98 -sub_8019A98: @ 8019A98 - push {lr} - ldr r1, =gUnknown_082F0774 - adds r0, r1 - ldrb r0, [r0] - ldr r1, =0x03005d8c - ldr r2, [r1] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl show_sprite - pop {r0} - bx r0 - .pool - thumb_func_end sub_8019A98 - - thumb_func_start sub_8019AB8 -sub_8019AB8: @ 8019AB8 - push {lr} - ldr r1, =gUnknown_082F0774 - adds r0, r1 - ldrb r0, [r0] - ldr r1, =0x03005d8c - ldr r2, [r1] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl RemoveFieldObjectByLocalIdAndMap - pop {r0} - bx r0 - .pool - thumb_func_end sub_8019AB8 - - thumb_func_start sub_8019AD8 -sub_8019AD8: @ 8019AD8 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r1, 0 - ldr r1, =gUnknown_082F0774 - adds r0, r1 - ldrb r0, [r0] - ldr r1, =0x03005d8c - ldr r2, [r1] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _08019B30 - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - adds r0, r4, 0 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - cmp r0, 0 - bne _08019B30 - ldrb r1, [r5] - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim - lsls r0, 24 - cmp r0, 0 - bne _08019B30 - movs r0, 0x1 - b _08019B32 - .pool -_08019B30: - movs r0, 0 -_08019B32: - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8019AD8 - - thumb_func_start sub_8019B3C -sub_8019B3C: @ 8019B3C - push {r4,lr} - sub sp, 0x4 - ldr r1, =gUnknown_082F0774 - adds r0, r1 - ldrb r0, [r0] - ldr r1, =0x03005d8c - ldr r2, [r1] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _08019B9C - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - bne _08019B84 - movs r0, 0 - b _08019B9E - .pool -_08019B84: - bl script_env_2_is_enabled - lsls r0, 24 - cmp r0, 0 - bne _08019B96 - adds r0, r4, 0 - bl npc_sync_anim_pause_bits - b _08019B9C -_08019B96: - adds r0, r4, 0 - bl sub_8097404 -_08019B9C: - movs r0, 0x1 -_08019B9E: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8019B3C - - thumb_func_start sub_8019BA8 -sub_8019BA8: @ 8019BA8 - push {lr} - ldr r2, =0x02022c68 - movs r1, 0 - str r1, [r2] - ldr r1, =0x02022c64 - str r0, [r1] - movs r1, 0 - movs r2, 0x7 -_08019BB8: - strb r1, [r0] - strb r1, [r0, 0x1] - strb r1, [r0, 0x2] - strb r1, [r0, 0x3] - adds r0, 0x4 - subs r2, 0x1 - cmp r2, 0 - bge _08019BB8 - bl sub_8019DF4 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8019BA8 - - thumb_func_start sub_8019BDC -sub_8019BDC: @ 8019BDC - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - movs r0, 0 - ldrsb r0, [r5, r0] - cmp r0, 0 - beq _08019BF0 - cmp r0, 0x1 - beq _08019C10 - b _08019C2E -_08019BF0: - ldr r1, =gUnknown_082F078C - adds r0, r4, 0 - bl sub_8019AD8 - cmp r0, 0x1 - bne _08019C2E - adds r0, r4, 0 - bl flag_set_x63 - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - b _08019C2E - .pool -_08019C10: - adds r0, r4, 0 - bl sub_8019B3C - cmp r0, 0 - beq _08019C2E - adds r0, r4, 0 - bl sub_8019AB8 - adds r0, r4, 0 - bl flag_set_x63 - movs r0, 0 - strb r0, [r5] - movs r0, 0x1 - b _08019C30 -_08019C2E: - movs r0, 0 -_08019C30: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8019BDC - - thumb_func_start sub_8019C38 -sub_8019C38: @ 8019C38 - push {r4-r7,lr} - sub sp, 0x4 - adds r6, r0, 0 - adds r5, r1, 0 - adds r7, r2, 0 - movs r0, 0 - ldrsb r0, [r6, r0] - cmp r0, 0x2 - beq _08019CD4 - cmp r0, 0x2 - bgt _08019C54 - cmp r0, 0 - beq _08019C5A - b _08019CE6 -_08019C54: - cmp r0, 0x3 - beq _08019CBC - b _08019CE6 -_08019C5A: - bl is_walking_or_running - cmp r0, 0 - beq _08019CE6 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - mov r0, sp - movs r1, 0 - ldrsh r2, [r0, r1] - movs r0, 0 - ldrsh r3, [r4, r0] - adds r0, r5, 0 - movs r1, 0 - bl sub_80199E0 - cmp r0, 0x1 - beq _08019CE6 - mov r0, sp - adds r1, r4, 0 - bl plaer_get_pos_including_state_based_drift - mov r0, sp - movs r1, 0 - ldrsh r2, [r0, r1] - movs r0, 0 - ldrsh r3, [r4, r0] - adds r0, r5, 0 - movs r1, 0 - bl sub_80199E0 - cmp r0, 0x1 - beq _08019CE6 - ldrb r1, [r7, 0x1] - adds r0, r5, 0 - bl sub_8019A7C - adds r0, r5, 0 - bl sub_8019A98 - adds r0, r5, 0 - bl flag_clear_x63 - ldrb r0, [r6] - adds r0, 0x1 - strb r0, [r6] -_08019CBC: - ldr r1, =gUnknown_082F078E - adds r0, r5, 0 - bl sub_8019AD8 - cmp r0, 0x1 - bne _08019CE6 - ldrb r0, [r6] - adds r0, 0x1 - strb r0, [r6] - b _08019CE6 - .pool -_08019CD4: - adds r0, r5, 0 - bl sub_8019B3C - cmp r0, 0 - beq _08019CE6 - movs r0, 0 - strb r0, [r6] - movs r0, 0x1 - b _08019CE8 -_08019CE6: - movs r0, 0 -_08019CE8: - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8019C38 - - thumb_func_start sub_8019CF0 -sub_8019CF0: @ 8019CF0 - push {r4,lr} - ldr r3, =0x02022c64 - lsls r0, 2 - ldr r4, [r3] - adds r4, r0 - movs r0, 0x1 - strb r0, [r4, 0x3] - adds r0, r1, 0 - adds r1, r2, 0 - bl sub_8019978 - strb r0, [r4, 0x1] - ldrb r0, [r4] - cmp r0, 0 - beq _08019D18 - movs r0, 0 - b _08019D1A - .pool -_08019D18: - movs r0, 0x1 -_08019D1A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8019CF0 - - thumb_func_start AGBAssert -AGBAssert: @ 8019D20 - push {lr} - ldr r1, =0x02022c64 - lsls r0, 2 - ldr r1, [r1] - adds r1, r0 - movs r0, 0x2 - strb r0, [r1, 0x3] - ldrb r0, [r1] - cmp r0, 0x1 - beq _08019D3C - movs r0, 0 - b _08019D3E - .pool -_08019D3C: - movs r0, 0x1 -_08019D3E: - pop {r1} - bx r1 - thumb_func_end AGBAssert - - thumb_func_start sub_8019D44 -sub_8019D44: @ 8019D44 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - ldrb r1, [r4] - cmp r1, 0x1 - beq _08019DA6 - cmp r1, 0x1 - bgt _08019D5A - cmp r1, 0 - beq _08019D64 - b _08019DC6 -_08019D5A: - cmp r1, 0x2 - beq _08019D70 - cmp r1, 0x3 - beq _08019DB4 - b _08019DC6 -_08019D64: - ldrb r0, [r4, 0x3] - cmp r0, 0x1 - bne _08019DC6 - movs r0, 0x2 - strb r0, [r4] - strb r1, [r4, 0x2] -_08019D70: - adds r0, r5, 0 - movs r1, 0 - bl sub_8019F8C - adds r1, r0, 0 - cmp r1, 0 - bne _08019D96 - ldrb r0, [r4, 0x3] - cmp r0, 0x2 - bne _08019D96 - strb r1, [r4] - strb r1, [r4, 0x2] - adds r0, r5, 0 - bl sub_8019AB8 - adds r0, r5, 0 - bl flag_set_x63 - b _08019DC6 -_08019D96: - adds r0, r4, 0x2 - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_8019C38 - cmp r0, 0x1 - bne _08019DC6 - b _08019DC4 -_08019DA6: - ldrb r0, [r4, 0x3] - cmp r0, 0x2 - bne _08019DC6 - movs r1, 0 - movs r0, 0x3 - strb r0, [r4] - strb r1, [r4, 0x2] -_08019DB4: - adds r0, r4, 0x2 - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_8019BDC - cmp r0, 0x1 - bne _08019DC6 - movs r0, 0 -_08019DC4: - strb r0, [r4] -_08019DC6: - movs r0, 0 - strb r0, [r4, 0x3] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8019D44 - - thumb_func_start sub_8019DD0 -sub_8019DD0: @ 8019DD0 - push {r4,r5,lr} - movs r4, 0 - ldr r5, =0x02022c64 -_08019DD6: - lsls r0, r4, 2 - ldr r1, [r5] - adds r1, r0 - adds r0, r4, 0 - bl sub_8019D44 - adds r4, 0x1 - cmp r4, 0x7 - ble _08019DD6 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8019DD0 - - thumb_func_start sub_8019DF4 -sub_8019DF4: @ 8019DF4 - push {r4,lr} - ldr r4, =sub_8019DD0 - adds r0, r4, 0 - bl is_function_an_active_task - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08019E18 - adds r0, r4, 0 - movs r1, 0x5 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - b _08019E1A - .pool -_08019E18: - movs r0, 0x10 -_08019E1A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8019DF4 - - thumb_func_start sub_8019E20 -sub_8019E20: @ 8019E20 - push {lr} - ldr r0, =sub_8019DD0 - bl get_task_id_by_function - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xF - bhi _08019E34 - bl remove_task -_08019E34: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8019E20 - - thumb_func_start sub_8019E3C -sub_8019E3C: @ 8019E3C - push {r4,lr} - movs r4, 0 -_08019E40: - adds r0, r4, 0 - bl sub_8019A30 - cmp r0, 0 - bne _08019E56 - adds r0, r4, 0 - bl sub_8019AB8 - adds r0, r4, 0 - bl flag_set_x63 -_08019E56: - adds r4, 0x1 - cmp r4, 0x7 - ble _08019E40 - ldr r1, =0x02022c64 - movs r0, 0 - str r0, [r1] - bl sub_8019E20 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8019E3C - - thumb_func_start sub_8019E70 -sub_8019E70: @ 8019E70 - 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 r7, 0 - mov r0, r9 - lsls r0, 2 - mov r8, r0 - ldr r0, =gUnknown_082F0740 - mov r2, r8 - adds r1, r2, r0 - ldrh r1, [r1] - mov r2, sp - strh r1, [r2, 0xC] - adds r0, 0x2 - add r0, r8 - ldrh r0, [r0] - mov r10, r0 - ldr r6, =gUnknown_082F0760 -_08019E9E: - mov r5, r8 - add r5, r9 - adds r5, r7 - adds r4, r5, 0 - subs r4, 0x38 - lsls r4, 24 - lsrs r4, 24 - movs r2, 0 - ldrsb r2, [r6, r2] - mov r0, sp - ldrh r0, [r0, 0xC] - adds r2, r0, r2 - lsls r2, 16 - asrs r2, 16 - movs r3, 0x1 - ldrsb r3, [r6, r3] - add r3, r10 - lsls r3, 16 - asrs r3, 16 - movs r0, 0x3 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r0, 0x41 - adds r1, r4, 0 - bl sprite_new - ldr r1, [sp, 0x8] - adds r5, r1, r5 - strb r0, [r5] - adds r0, r4, 0 - movs r1, 0x1 - bl sub_8097C44 - adds r6, 0x2 - adds r7, 0x1 - cmp r7, 0x4 - ble _08019E9E - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8019E70 - - thumb_func_start sub_8019F04 -sub_8019F04: @ 8019F04 - push {r4-r6,lr} - adds r5, r0, 0 - movs r4, 0 - ldr r6, =0x02020630 -_08019F0C: - adds r0, r5, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - bl RemoveObjectAndFreeTiles - adds r4, 0x1 - cmp r4, 0x27 - ble _08019F0C - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8019F04 - - thumb_func_start sub_8019F2C -sub_8019F2C: @ 8019F2C - push {r4-r7,lr} - sub sp, 0x8 - movs r5, 0 - add r7, sp, 0x4 -_08019F34: - movs r4, 0 - adds r6, r5, 0x1 -_08019F38: - adds r0, r5, 0 - adds r1, r4, 0 - mov r2, sp - adds r3, r7, 0 - bl sub_8019990 - ldr r0, [sp] - ldr r1, [sp, 0x4] - movs r2, 0 - bl sub_8088B94 - adds r4, 0x1 - cmp r4, 0x4 - ble _08019F38 - adds r5, r6, 0 - cmp r5, 0x7 - ble _08019F34 - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8019F2C - - thumb_func_start sub_8019F64 -sub_8019F64: @ 8019F64 - push {lr} - adds r1, r0, 0 - cmp r1, 0 - beq _08019F78 - ldr r0, =gUnknown_082F076F - adds r0, r1, r0 - ldrb r0, [r0] - b _08019F88 - .pool -_08019F78: - ldrb r1, [r2, 0xA] - movs r0, 0x7F - ands r0, r1 - cmp r0, 0x45 - beq _08019F86 - movs r0, 0x4 - b _08019F88 -_08019F86: - movs r0, 0x1 -_08019F88: - pop {r1} - bx r1 - thumb_func_end sub_8019F64 - - thumb_func_start sub_8019F8C -sub_8019F8C: @ 8019F8C - push {lr} - adds r2, r0, 0 - lsls r0, r2, 2 - adds r0, r2 - adds r0, r1 - subs r0, 0x38 - lsls r0, 24 - lsrs r0, 24 - bl sub_8097C8C - pop {r1} - bx r1 - thumb_func_end sub_8019F8C - - thumb_func_start sub_8019FA4 -sub_8019FA4: @ 8019FA4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - adds r5, r0, 0 - adds r6, r1, 0 - mov r9, r3 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r0, r5, 2 - adds r0, r5 - adds r7, r0, r6 - adds r0, r5, 0 - bl sub_8019F8C - cmp r0, 0x1 - bne _08019FE2 - adds r4, r7, 0 - subs r4, 0x38 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0 - bl sub_8097C44 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_8097CC4 -_08019FE2: - adds r0, r7, 0 - subs r0, 0x38 - lsls r0, 24 - lsrs r0, 24 - mov r1, r8 - bl sub_8097BB4 - adds r0, r6, 0 - adds r1, r5, 0 - mov r2, r9 - bl sub_8019F64 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r6, 0 - adds r1, r5, 0 - bl sub_801A3B0 - add r3, sp, 0x4 - adds r0, r5, 0 - adds r1, r6, 0 - mov r2, sp - bl sub_8019990 - ldr r0, [sp] - ldr r1, [sp, 0x4] - movs r2, 0x1 - bl sub_8088B94 - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8019FA4 - - thumb_func_start sub_801A02C -sub_801A02C: @ 801A02C - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - adds r5, r1, 0 - lsls r0, r4, 2 - adds r0, r4 - adds r0, r5 - subs r0, 0x38 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl sub_8097CC4 - add r3, sp, 0x4 - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl sub_8019990 - ldr r0, [sp] - ldr r1, [sp, 0x4] - movs r2, 0 - bl sub_8088B94 - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_801A02C - - thumb_func_start sub_801A064 -sub_801A064: @ 801A064 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - adds r7, r0, 0 - mov r8, r1 - mov r6, sp - adds r6, 0x2 - mov r0, sp - adds r1, r6, 0 - bl PlayerGetDestCoords - add r4, sp, 0x4 - mov r5, sp - adds r5, 0x6 - adds r0, r4, 0 - adds r1, r5, 0 - bl plaer_get_pos_including_state_based_drift - lsls r0, r7, 2 - adds r0, r7 - subs r0, 0x38 - lsls r0, 24 - lsrs r0, 24 - bl sub_8097C8C - mov r10, r6 - mov r9, r4 - adds r6, r5, 0 - cmp r0, 0x1 - bne _0801A0F0 - mov r0, sp - movs r1, 0 - ldrsh r2, [r0, r1] - mov r0, r10 - movs r1, 0 - ldrsh r3, [r0, r1] - adds r0, r7, 0 - movs r1, 0 - bl sub_80199E0 - cmp r0, 0x1 - beq _0801A15C - movs r0, 0 - ldrsh r2, [r4, r0] - movs r1, 0 - ldrsh r3, [r6, r1] - adds r0, r7, 0 - movs r1, 0 - bl sub_80199E0 - cmp r0, 0x1 - beq _0801A15C - mov r2, r8 - ldrb r0, [r2, 0xB] - lsls r0, 31 - lsrs r0, 31 - ldrb r1, [r2, 0x2] - bl sub_8019978 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r7, 0 - movs r1, 0 - mov r3, r8 - bl sub_8019FA4 -_0801A0F0: - movs r5, 0x1 - mov r4, r8 - adds r4, 0x4 -_0801A0F6: - ldrb r0, [r4] - cmp r0, 0 - bne _0801A106 - adds r0, r7, 0 - adds r1, r5, 0 - bl sub_801A02C - b _0801A154 -_0801A106: - mov r0, sp - movs r1, 0 - ldrsh r2, [r0, r1] - mov r0, r10 - movs r1, 0 - ldrsh r3, [r0, r1] - adds r0, r7, 0 - adds r1, r5, 0 - bl sub_80199E0 - cmp r0, 0 - bne _0801A154 - mov r0, r9 - movs r1, 0 - ldrsh r2, [r0, r1] - movs r0, 0 - ldrsh r3, [r6, r0] - adds r0, r7, 0 - adds r1, r5, 0 - bl sub_80199E0 - cmp r0, 0 - bne _0801A154 - ldrb r2, [r4] - lsrs r0, r2, 3 - movs r1, 0x1 - ands r0, r1 - movs r1, 0x7 - ands r1, r2 - bl sub_8019978 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r7, 0 - adds r1, r5, 0 - mov r3, r8 - bl sub_8019FA4 -_0801A154: - adds r4, 0x1 - adds r5, 0x1 - cmp r5, 0x4 - ble _0801A0F6 -_0801A15C: - 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_801A064 - - thumb_func_start sub_801A16C -sub_801A16C: @ 801A16C - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - ldrb r0, [r4, 0xA] - lsls r0, 25 - lsrs r0, 25 - subs r0, 0x40 - cmp r0, 0x14 - bhi _0801A20E - lsls r0, 2 - ldr r1, =_0801A18C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0801A18C: - .4byte _0801A1E0 - .4byte _0801A200 - .4byte _0801A20E - .4byte _0801A20E - .4byte _0801A200 - .4byte _0801A200 - .4byte _0801A20E - .4byte _0801A20E - .4byte _0801A200 - .4byte _0801A20E - .4byte _0801A20E - .4byte _0801A20E - .4byte _0801A20E - .4byte _0801A20E - .4byte _0801A20E - .4byte _0801A20E - .4byte _0801A20E - .4byte _0801A200 - .4byte _0801A200 - .4byte _0801A200 - .4byte _0801A1E0 -_0801A1E0: - ldrb r1, [r4, 0xB] - lsls r1, 31 - lsrs r1, 31 - ldrb r2, [r4, 0x2] - adds r0, r5, 0 - bl sub_8019CF0 - movs r4, 0 -_0801A1F0: - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_801A02C - adds r4, 0x1 - cmp r4, 0x4 - bls _0801A1F0 - b _0801A20E -_0801A200: - adds r0, r5, 0 - bl AGBAssert - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_801A064 -_0801A20E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_801A16C - - thumb_func_start sub_801A214 -sub_801A214: @ 801A214 - push {r4,r5,lr} - adds r5, r0, 0 - bl AGBAssert - movs r4, 0 -_0801A21E: - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_801A02C - adds r4, 0x1 - cmp r4, 0x4 - ble _0801A21E - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_801A214 - - thumb_func_start sub_801A234 -sub_801A234: @ 801A234 - push {r4,r5,lr} - ldr r2, =0x02022c68 - movs r1, 0 - str r1, [r2] - movs r5, 0 - ldr r4, [r0] -_0801A240: - ldrb r0, [r4, 0x1A] - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x1 - bne _0801A258 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_801A16C - b _0801A264 - .pool -_0801A258: - cmp r1, 0x2 - bne _0801A264 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_801A214 -_0801A264: - adds r4, 0x20 - adds r5, 0x1 - cmp r5, 0x7 - ble _0801A240 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_801A234 - - thumb_func_start sub_801A274 -sub_801A274: @ 801A274 - ldr r1, =0x02022c68 - movs r0, 0x96 - lsls r0, 1 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_801A274 - - thumb_func_start sub_801A284 -sub_801A284: @ 801A284 - push {lr} - adds r2, r0, 0 - ldr r0, =0x02022c68 - ldr r1, [r0] - adds r1, 0x1 - str r1, [r0] - movs r0, 0x96 - lsls r0, 1 - cmp r1, r0 - bls _0801A29E - adds r0, r2, 0 - bl sub_801A234 -_0801A29E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_801A284 - - thumb_func_start sub_801A2A8 -sub_801A2A8: @ 801A2A8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - adds r5, r0, 0 - str r1, [sp, 0x4] - str r2, [sp, 0x8] - bl is_walking_or_running - cmp r0, 0 - bne _0801A2F0 - b _0801A396 -_0801A2C4: - ldr r4, =gUnknown_082F076A - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - ldrb r2, [r0] - adds r0, r6, 0 - ldr r1, [sp, 0xC] - bl sub_801A3B0 - ldr r0, [sp, 0x4] - strh r6, [r0] - mov r1, sp - ldrh r2, [r1, 0xC] - ldr r1, [sp, 0x8] - strh r2, [r1] - movs r0, 0x1 - b _0801A398 - .pool -_0801A2F0: - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl GetXYCoordsOneStepInFrontOfPlayer - movs r0, 0 - str r0, [sp, 0xC] - ldr r0, =gUnknown_082F0740 - adds r7, r5, 0 - movs r1, 0 - mov r10, r1 - adds r2, r0, 0x2 - str r2, [sp, 0x10] - str r0, [sp, 0x14] -_0801A30E: - movs r6, 0 - ldr r4, [sp, 0x14] - movs r0, 0 - ldrsh r4, [r4, r0] - mov r9, r4 - ldr r1, [sp, 0x10] - mov r8, r1 - ldr r5, =gUnknown_082F0760 -_0801A31E: - mov r2, r10 - adds r3, r2, r6 - mov r0, sp - movs r4, 0 - ldrsh r1, [r0, r4] - movs r0, 0 - ldrsb r0, [r5, r0] - add r0, r9 - adds r0, 0x7 - cmp r1, r0 - bne _0801A372 - mov r1, sp - movs r2, 0x2 - ldrsh r0, [r1, r2] - mov r4, r8 - movs r2, 0 - ldrsh r1, [r4, r2] - movs r2, 0x1 - ldrsb r2, [r5, r2] - adds r1, r2 - adds r1, 0x7 - cmp r0, r1 - bne _0801A372 - adds r0, r3, 0 - subs r0, 0x38 - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_8097C8C - cmp r0, 0 - bne _0801A372 - adds r0, r4, 0 - bl sub_8097D9C - cmp r0, 0 - bne _0801A372 - ldrb r1, [r7, 0x1A] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x1 - beq _0801A2C4 -_0801A372: - adds r5, 0x2 - adds r6, 0x1 - cmp r6, 0x4 - ble _0801A31E - adds r7, 0x20 - movs r4, 0x5 - add r10, r4 - ldr r0, [sp, 0x10] - adds r0, 0x4 - str r0, [sp, 0x10] - ldr r1, [sp, 0x14] - adds r1, 0x4 - str r1, [sp, 0x14] - ldr r2, [sp, 0xC] - adds r2, 0x1 - str r2, [sp, 0xC] - cmp r2, 0x7 - ble _0801A30E -_0801A396: - movs r0, 0 -_0801A398: - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_801A2A8 - - thumb_func_start sub_801A3B0 -sub_801A3B0: @ 801A3B0 - push {r4,lr} - adds r4, r0, 0 - adds r3, r1, 0 - lsls r1, r2, 24 - lsrs r1, 24 - lsls r0, r3, 2 - adds r0, r3 - subs r0, 0x38 - adds r0, r4 - lsls r0, 24 - lsrs r0, 24 - bl sub_8097B78 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_801A3B0 - - thumb_func_start sub_801A3D0 -sub_801A3D0: @ 801A3D0 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - lsls r3, r4, 5 - adds r3, r2 - adds r2, r3, 0 - bl sub_8019F64 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_801A3B0 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_801A3D0 - - thumb_func_start sub_801A3F4 -sub_801A3F4: @ 801A3F4 - push {lr} - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0801A414 - bl RunActiveTasks - bl RunTextPrinters - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably -_0801A414: - pop {r0} - bx r0 - thumb_func_end sub_801A3F4 - - thumb_func_start sub_801A418 -sub_801A418: @ 801A418 - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_801A418 - - thumb_func_start sub_801A42C -sub_801A42C: @ 801A42C - push {lr} - ldr r0, =sub_801A43C - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_801A42C - - thumb_func_start sub_801A43C -sub_801A43C: @ 801A43C - push {r4,r5,lr} - sub sp, 0xC - movs r0, 0 - movs r1, 0 - bl SetGpuReg - ldr r5, =0x03000dac - movs r0, 0x6C - bl AllocZeroed - str r0, [r5] - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_082F0D34 - movs r0, 0 - movs r2, 0x2 - bl InitBgsFromTemplates - movs r4, 0x80 - lsls r4, 4 - adds r0, r4, 0 - bl Alloc - adds r1, r0, 0 - movs r0, 0x1 - bl SetBgTilemapBuffer - adds r0, r4, 0 - bl Alloc - adds r1, r0, 0 - movs r0, 0 - bl SetBgTilemapBuffer - ldr r1, =gUnknown_082F0990 - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r1, =gUnknown_082F0BA0 - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - ldr r0, =gUnknown_082F0D3C - bl InitWindows - bl DeactivateAllTextPrinters - bl sub_80A1A74 - bl ResetAllObjectData - bl clear_tasks - bl remove_some_task - bl SoundVSyncOn_rev01 - ldr r0, =sub_801A418 - bl SetVBlankCallback - ldr r0, =sub_801A6C0 - movs r1, 0 - bl AddTask - ldr r1, [r5] - adds r1, 0x60 - strb r0, [r1] - bl sub_8013C40 - ldr r1, [r5] - adds r1, 0x61 - strb r0, [r1] - ldr r1, [r5] - movs r0, 0x1 - str r0, [r1, 0x1C] - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - ldr r0, =gUnknown_082F0790 - movs r1, 0 - movs r2, 0x20 - bl gpu_pal_apply - movs r0, 0xF0 - bl sub_81978B0 - bl sub_81AFBF0 - movs r0, 0x20 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0xF - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - ldr r0, =sub_801A3F4 - bl SetMainCallback2 - bl RunActiveTasks - bl RunTextPrinters - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801A43C - - thumb_func_start sub_801A584 -sub_801A584: @ 801A584 - push {r4,lr} - bl FreeAllWindowBuffers - movs r4, 0 -_0801A58C: - lsls r0, r4, 24 - lsrs r0, 24 - bl GetBgTilemapBuffer - bl Free - adds r4, 0x1 - cmp r4, 0x1 - ble _0801A58C - ldr r0, =0x03000dac - ldr r0, [r0] - bl Free - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801A584 - - thumb_func_start sub_801A5BC -sub_801A5BC: @ 801A5BC - push {lr} - adds r2, r0, 0 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - ble _0801A5E4 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xE - bne _0801A5E0 - movs r0, 0 - strh r0, [r1] -_0801A5E0: - movs r0, 0 - strh r0, [r2] -_0801A5E4: - movs r2, 0 - ldrsh r0, [r1, r2] - adds r0, 0x2 - lsls r0, 5 - ldr r1, =gUnknown_082F0790 - adds r0, r1 - movs r1, 0 - movs r2, 0x10 - bl gpu_pal_apply - pop {r0} - bx r0 - .pool - thumb_func_end sub_801A5BC - - thumb_func_start sub_801A600 -sub_801A600: @ 801A600 - push {r4,r5,lr} - sub sp, 0x8 - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x2 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r5, =gUnknown_082F0D5C - ldr r4, [r5] - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0xC0 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x6 - str r0, [sp] - movs r0, 0x3 - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl sub_801A8B0 - movs r1, 0 -_0801A644: - adds r4, r1, 0x1 - lsls r0, r4, 2 - adds r0, r5 - ldr r2, [r0] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 25 - movs r1, 0x80 - lsls r1, 20 - adds r0, r1 - lsrs r0, 24 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r1, 0x1 - movs r3, 0 - bl sub_801A8B0 - adds r1, r4, 0 - cmp r4, 0x2 - ble _0801A644 - ldr r1, =gUnknown_082F0D5C - adds r0, r4, 0x1 - lsls r0, 2 - adds r0, r1 - ldr r2, [r0] - lsls r0, r4, 4 - subs r0, r4 - lsls r0, 25 - movs r1, 0x80 - lsls r1, 20 - adds r0, r1 - lsrs r0, 24 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0 - bl sub_801A8B0 - movs r0, 0 - bl PutWindowTilemap - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0x1 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801A600 - - thumb_func_start sub_801A6C0 -sub_801A6C0: @ 801A6C0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r2, r1, 0 - cmp r0, 0x5 - bls _0801A6E2 - b _0801A89C -_0801A6E2: - lsls r0, 2 - ldr r1, =_0801A6F4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0801A6F4: - .4byte _0801A70C - .4byte _0801A728 - .4byte _0801A74C - .4byte _0801A768 - .4byte _0801A85C - .4byte _0801A884 -_0801A70C: - bl sub_801A600 - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0801A89C - .pool -_0801A728: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - movs r0, 0x1 - bl ShowBg - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0 - bl ShowBg - b _0801A86C -_0801A74C: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0801A75A - b _0801A89C -_0801A75A: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r2 - b _0801A876 - .pool -_0801A768: - ldr r0, =0x03000dac - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0x10 - adds r2, r0, 0 - adds r2, 0x20 - adds r3, r0, 0 - adds r3, 0x61 - ldrb r3, [r3] - bl sub_801AA30 - lsls r1, r5, 2 - mov r8, r1 - cmp r0, 0 - beq _0801A7F8 - movs r0, 0x2 - movs r1, 0 - bl FillWindowPixelBuffer - movs r4, 0 - ldr r6, =0x02021fc4 - movs r7, 0x80 - lsls r7, 20 -_0801A796: - ldr r0, =0x03000dac - ldr r0, [r0] - lsls r1, r4, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r6, 0 - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalString - cmp r4, 0x3 - beq _0801A7CC - lsrs r0, r7, 24 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r0, 0x2 - movs r1, 0x1 - adds r2, r6, 0 - movs r3, 0xC - bl sub_801A8B0 - b _0801A7DE - .pool -_0801A7CC: - movs r0, 0x62 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r1, 0x1 - adds r2, r6, 0 - movs r3, 0xC - bl sub_801A8B0 -_0801A7DE: - movs r2, 0xF0 - lsls r2, 21 - adds r7, r2 - adds r4, 0x1 - cmp r4, 0x3 - ble _0801A796 - movs r0, 0x2 - bl PutWindowTilemap - movs r0, 0x2 - movs r1, 0x3 - bl CopyWindowToVram -_0801A7F8: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0801A80C - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0801A836 -_0801A80C: - movs r0, 0x5 - bl audio_play - ldr r2, =0x03005e00 - ldr r0, =0x03000dac - ldr r0, [r0] - adds r0, 0x61 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0xFF - strh r1, [r0, 0x26] - mov r0, r8 - adds r1, r0, r5 - lsls r1, 3 - adds r1, r2 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_0801A836: - mov r2, r8 - adds r1, r2, r5 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r1, r0 - adds r0, r1, 0 - adds r0, 0xE - adds r1, 0x10 - bl sub_801A5BC - b _0801A89C - .pool -_0801A85C: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe -_0801A86C: - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 -_0801A876: - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] - b _0801A89C - .pool -_0801A884: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0801A89C - ldr r0, =sub_801A584 - bl SetMainCallback2 - adds r0, r5, 0 - bl remove_task -_0801A89C: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801A6C0 - - thumb_func_start sub_801A8B0 -sub_801A8B0: @ 801A8B0 - push {r4-r7,lr} - sub sp, 0x18 - mov r12, r2 - ldr r2, [sp, 0x2C] - ldr r4, [sp, 0x30] - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r3, 24 - lsrs r5, r3, 24 - lsls r2, 24 - lsrs r3, r2, 24 - lsls r4, 24 - lsrs r0, r4, 24 - cmp r0, 0x4 - bhi _0801A93A - lsls r0, 2 - ldr r1, =_0801A8E0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0801A8E0: - .4byte _0801A8F4 - .4byte _0801A902 - .4byte _0801A910 - .4byte _0801A91E - .4byte _0801A92C -_0801A8F4: - add r1, sp, 0x14 - movs r0, 0 - strb r0, [r1] - movs r0, 0x2 - strb r0, [r1, 0x1] - movs r0, 0x3 - b _0801A938 -_0801A902: - add r1, sp, 0x14 - movs r0, 0 - strb r0, [r1] - movs r0, 0x1 - strb r0, [r1, 0x1] - movs r0, 0x3 - b _0801A938 -_0801A910: - add r1, sp, 0x14 - movs r0, 0 - strb r0, [r1] - movs r0, 0x4 - strb r0, [r1, 0x1] - movs r0, 0x5 - b _0801A938 -_0801A91E: - add r1, sp, 0x14 - movs r0, 0 - strb r0, [r1] - movs r0, 0x7 - strb r0, [r1, 0x1] - movs r0, 0x6 - b _0801A938 -_0801A92C: - add r1, sp, 0x14 - movs r0, 0 - strb r0, [r1] - movs r0, 0x1 - strb r0, [r1, 0x1] - movs r0, 0x2 -_0801A938: - strb r0, [r1, 0x2] -_0801A93A: - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - add r0, sp, 0x14 - str r0, [sp, 0x8] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0xC] - mov r0, r12 - str r0, [sp, 0x10] - adds r0, r7, 0 - adds r1, r6, 0 - adds r2, r5, 0 - bl AddTextPrinterParametrized2 - add sp, 0x18 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_801A8B0 - - thumb_func_start sub_801A960 -sub_801A960: @ 801A960 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r12, r0 - adds r7, r1, 0 - ldrb r0, [r0, 0xA] - lsls r0, 25 - lsrs r0, 25 - mov r8, r0 - movs r4, 0 - ldr r0, =gUnknown_082F0D70 - mov r9, r0 - movs r1, 0x1 - add r1, r9 - mov r10, r1 - mov r3, r12 - adds r3, 0x4 - str r3, [sp] -_0801A98A: - lsls r0, r4, 1 - adds r2, r0, r4 - mov r3, r9 - adds r1, r2, r3 - adds r5, r0, 0 - adds r6, r4, 0x1 - ldrb r1, [r1] - cmp r8, r1 - bne _0801A9EE - mov r0, r12 - ldrb r1, [r0, 0x1A] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x1 - bne _0801A9EE - mov r0, r9 - adds r0, 0x2 - adds r3, r2, r0 - ldrb r0, [r3] - cmp r0, 0 - bne _0801A9DC - movs r2, 0 - movs r1, 0 - ldr r3, [sp] -_0801A9BA: - adds r0, r3, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _0801A9C4 - adds r2, 0x1 -_0801A9C4: - adds r1, 0x1 - cmp r1, 0x3 - ble _0801A9BA - adds r2, 0x1 - adds r0, r5, r4 - add r0, r10 - ldrb r1, [r0] - lsls r1, 2 - adds r1, r7 - b _0801A9E8 - .pool -_0801A9DC: - mov r1, r10 - adds r0, r2, r1 - ldrb r1, [r0] - lsls r1, 2 - adds r1, r7 - ldrb r2, [r3] -_0801A9E8: - ldr r0, [r1] - adds r0, r2 - str r0, [r1] -_0801A9EE: - adds r4, r6, 0 - cmp r4, 0x1E - bls _0801A98A - 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 - thumb_func_end sub_801A960 - - thumb_func_start sub_801AA08 -sub_801AA08: @ 801AA08 - push {r4,lr} - movs r4, 0 - adds r3, r1, 0 - adds r2, r0, 0 -_0801AA10: - ldr r1, [r2] - ldr r0, [r3] - cmp r1, r0 - beq _0801AA1C - movs r0, 0x1 - b _0801AA28 -_0801AA1C: - adds r3, 0x4 - adds r2, 0x4 - adds r4, 0x1 - cmp r4, 0x3 - ble _0801AA10 - movs r0, 0 -_0801AA28: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_801AA08 - - thumb_func_start sub_801AA30 -sub_801AA30: @ 801AA30 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - adds r6, r0, 0 - mov r9, r1 - adds r5, r2, 0 - lsls r4, r3, 24 - lsrs r4, 24 - movs r0, 0 - mov r8, r0 - mov r0, sp - movs r1, 0 - movs r2, 0x10 - bl memset - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r7, r0, r1 - movs r4, 0 -_0801AA5E: - lsls r1, r4, 5 - ldr r0, [r7] - adds r0, r1 - mov r1, sp - bl sub_801A960 - adds r1, r0, 0 - ldr r0, [r5] - cmp r1, r0 - beq _0801AA78 - str r1, [r5] - movs r2, 0x1 - mov r8, r2 -_0801AA78: - adds r5, 0x4 - adds r4, 0x1 - cmp r4, 0xF - ble _0801AA5E - mov r0, sp - mov r1, r9 - bl sub_801AA08 - cmp r0, 0 - bne _0801AA9C - mov r3, r8 - cmp r3, 0x1 - beq _0801AAC4 - movs r0, 0 - b _0801AAC6 - .pool -_0801AA9C: - adds r1, r6, 0 - mov r0, sp - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldr r0, [r0] - str r0, [r1] - mov r1, r9 - mov r0, sp - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldr r0, [r0] - str r0, [r1] - ldr r0, [r6] - ldr r1, [r6, 0x4] - adds r0, r1 - ldr r1, [r6, 0x8] - adds r0, r1 - ldr r1, [r6, 0xC] - adds r0, r1 - str r0, [r6, 0xC] -_0801AAC4: - movs r0, 0x1 -_0801AAC6: - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_801AA30 - - thumb_func_start sub_801AAD4 -sub_801AAD4: @ 801AAD4 - push {r4-r7,lr} - movs r0, 0xA - bl sub_8014210 - movs r4, 0 - movs r7, 0x64 - ldr r6, =0x020244ec - ldr r5, =0x02024744 -_0801AAE4: - ldr r0, =0x0203cef8 - adds r0, r4, r0 - ldrb r0, [r0] - subs r0, 0x1 - adds r1, r0, 0 - muls r1, r7 - adds r1, r6 - adds r0, r5, 0 - movs r2, 0x64 - bl memcpy - adds r5, 0x64 - adds r4, 0x1 - cmp r4, 0x1 - ble _0801AAE4 - ldr r4, =0x020244ec - movs r0, 0xFA - lsls r0, 1 - adds r5, r4, r0 -_0801AB0A: - adds r0, r4, 0 - bl zero_pokemon_struct - adds r4, 0x64 - cmp r4, r5 - ble _0801AB0A - ldr r4, =0x020244ec - movs r5, 0 - adds r6, r4, 0 - adds r6, 0x64 -_0801AB1E: - ldr r1, =0x02024744 - adds r1, r5, r1 - adds r0, r4, 0 - movs r2, 0x64 - bl memcpy - adds r4, 0x64 - adds r5, 0x64 - cmp r4, r6 - ble _0801AB1E - movs r0, 0x32 - bl sav12_xor_increment - bl calc_player_party_count - ldr r0, =0x02038bca - movs r2, 0xC0 - lsls r2, 4 - adds r1, r2, 0 - strh r1, [r0] - ldr r0, =sub_8036760 - bl SetMainCallback2 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801AAD4 - - thumb_func_start sub_801AB68 -sub_801AB68: @ 801AB68 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - adds r5, r0, 0 - adds r7, r1, 0 - adds r6, r2, 0 - ldr r4, [sp, 0x38] - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0 - mov r9, r0 - movs r1, 0x1 - mov r10, r1 - ldr r0, =gUnknown_082F0DE4 - mov r8, r0 - ldrb r0, [r0] - lsls r1, r0, 4 - orrs r1, r0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - str r3, [sp, 0x14] - bl FillWindowPixelBuffer - mov r1, r9 - str r1, [sp] - mov r0, r10 - str r0, [sp, 0x4] - mov r1, r8 - str r1, [sp, 0x8] - lsls r4, 24 - asrs r4, 24 - str r4, [sp, 0xC] - str r7, [sp, 0x10] - adds r0, r5, 0 - movs r1, 0x1 - adds r2, r6, 0 - ldr r3, [sp, 0x14] - bl AddTextPrinterParametrized2 - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801AB68 - - thumb_func_start sub_801ABDC -sub_801ABDC: @ 801ABDC - push {r4-r6,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r6, r1, 0 - adds r5, r2, 0 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0801ABF4 - cmp r0, 0x1 - beq _0801AC22 - b _0801AC36 -_0801ABF4: - movs r0, 0 - movs r1, 0x1 - movs r2, 0xD - bl sub_8098858 - str r5, [sp] - movs r0, 0 - adds r1, r6, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_801AB68 - movs r0, 0 - bl PutWindowTilemap - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - b _0801AC36 -_0801AC22: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _0801AC36 - strh r0, [r4] - movs r0, 0x1 - b _0801AC38 -_0801AC36: - movs r0, 0 -_0801AC38: - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_801ABDC - - thumb_func_start sub_801AC40 -sub_801AC40: @ 801AC40 - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_801AC40 - - thumb_func_start sub_801AC54 -sub_801AC54: @ 801AC54 - push {r4,lr} - sub sp, 0xC - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0x33 - bls _0801AC6A - b _0801AFAE -_0801AC6A: - lsls r0, 2 - ldr r1, =_0801AC7C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0801AC7C: - .4byte _0801AD4C - .4byte _0801ADFC - .4byte _0801AE24 - .4byte _0801AE48 - .4byte _0801AE98 - .4byte _0801AFAE - .4byte _0801AF7C - .4byte _0801AF58 - .4byte _0801AF7C - .4byte _0801AF98 - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AFAE - .4byte _0801AF24 - .4byte _0801AF40 -_0801AD4C: - movs r0, 0 - movs r1, 0 - bl SetGpuReg - ldr r4, =0x02022c6c - movs r0, 0x4 - bl AllocZeroed - str r0, [r4] - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - bl clear_tasks - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_082F0DD0 - movs r0, 0 - movs r2, 0x1 - bl InitBgsFromTemplates - bl reset_temp_tile_data_buffers - ldr r0, =gUnknown_082F0DD4 - bl InitWindows - lsls r0, 16 - cmp r0, 0 - bne _0801AD8C - b _0801AFC2 -_0801AD8C: - bl DeactivateAllTextPrinters - movs r0, 0 - bl ClearWindowTilemap - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r0, 0x1E - str r0, [sp] - movs r0, 0x14 - str r0, [sp, 0x4] - movs r0, 0xF - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect - movs r0, 0 - movs r1, 0x1 - movs r2, 0xD0 - bl sub_809882C - movs r0, 0 - movs r1, 0x1 - movs r2, 0xD0 - bl box_border_load_tiles_and_pal - bl sub_819789C - ldr r0, =sub_801AC40 - bl SetVBlankCallback - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0801AF8A - .pool -_0801ADFC: - ldr r0, =0x02022c6c - ldr r0, [r0] - ldr r1, =gUnknown_085EFBD2 - movs r2, 0 - bl sub_801ABDC - cmp r0, 0 - bne _0801AE0E - b _0801AFAE -_0801AE0E: - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _0801AF8A - .pool -_0801AE24: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - movs r0, 0 - bl ShowBg - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0801AF8A - .pool -_0801AE48: - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - beq _0801AE54 - b _0801AFAE -_0801AE54: - ldr r4, =0x020228c4 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x20 - bl memset - ldr r0, =0x0203cef8 - ldrb r1, [r0] - ldrb r0, [r0, 0x1] - cmn r1, r0 - bne _0801AE78 - movs r0, 0x52 - b _0801AE7A - .pool -_0801AE78: - movs r0, 0x51 -_0801AE7A: - strb r0, [r4] - ldr r1, =0x020228c4 - movs r0, 0 - movs r2, 0x20 - bl link_0800A448 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _0801AF8A - .pool -_0801AE98: - bl sub_800A550 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - beq _0801AEA6 - b _0801AFAE -_0801AEA6: - ldr r1, =0x020223c4 - ldrh r0, [r1] - cmp r0, 0x51 - bne _0801AEE0 - movs r2, 0x80 - lsls r2, 1 - adds r0, r1, r2 - ldrh r0, [r0] - cmp r0, 0x51 - bne _0801AEE0 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r1, 0x32 - b _0801AF16 - .pool -_0801AEE0: - bl sub_800AC34 - ldr r4, =0x020223c4 - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 16 - adds r0, r4 - ldrh r0, [r0] - cmp r0, 0x52 - bne _0801AF0C - ldr r0, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r2 - movs r1, 0x6 - b _0801AF16 - .pool -_0801AF0C: - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r1, 0x8 -_0801AF16: - strb r1, [r0] - bl sub_800A5B4 - b _0801AFAE - .pool -_0801AF24: - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - bne _0801AFAE - bl sub_800ADF8 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _0801AF8A - .pool -_0801AF40: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _0801AFAE - ldr r0, =sub_801AAD4 - bl SetMainCallback2 - b _0801AFAE - .pool -_0801AF58: - ldr r0, =0x02022c6c - ldr r0, [r0] - ldr r1, =gUnknown_085EFC27 - movs r2, 0x1 - bl sub_801ABDC - cmp r0, 0 - beq _0801AFAE - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - b _0801AFAE - .pool -_0801AF7C: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _0801AFAE - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 -_0801AF8A: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0801AFAE - .pool -_0801AF98: - ldr r0, =0x02022c6c - ldr r0, [r0] - ldr r1, =gUnknown_085EFC0C - movs r2, 0x1 - bl sub_801ABDC - cmp r0, 0 - beq _0801AFAE - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 -_0801AFAE: - bl RunActiveTasks - bl RunTextPrinters - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably -_0801AFC2: - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801AC54 - - thumb_func_start sub_801AFD8 -sub_801AFD8: @ 801AFD8 - push {lr} - sub sp, 0x4 - movs r0, 0 - str r0, [sp] - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r0, =0x0000322c - adds r1, r0 - ldr r2, =0x050000db - mov r0, sp - bl CpuSet - bl sub_801B180 - bl sub_811F8BC - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_801AFD8 - - thumb_func_start sub_801B00C -sub_801B00C: @ 801B00C - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003230 - adds r0, r1 - bx lr - .pool - thumb_func_end sub_801B00C - - thumb_func_start sav1_get_mevent_buffer_1 -sav1_get_mevent_buffer_1: @ 801B020 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x000033f0 - adds r0, r1 - bx lr - .pool - thumb_func_end sav1_get_mevent_buffer_1 - - thumb_func_start sav1_get_mevent_buffer_2 -sav1_get_mevent_buffer_2: @ 801B034 - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r1, 0xD5 - lsls r1, 6 - adds r0, r1 - bx lr - .pool - thumb_func_end sav1_get_mevent_buffer_2 - - thumb_func_start sub_801B044 -sub_801B044: @ 801B044 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x0000356c - adds r0, r1 - bx lr - .pool - thumb_func_end sub_801B044 - - thumb_func_start sub_801B058 -sub_801B058: @ 801B058 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003564 - adds r0, r1 - bx lr - .pool - thumb_func_end sub_801B058 - - thumb_func_start sub_801B06C -sub_801B06C: @ 801B06C - push {lr} - bl sub_801B14C - pop {r0} - bx r0 - thumb_func_end sub_801B06C - - thumb_func_start sub_801B078 -sub_801B078: @ 801B078 - push {r4-r7,lr} - adds r7, r0, 0 - bl sub_801B114 - cmp r0, 0 - beq _0801B0C4 - bl sub_801B14C - ldr r4, =0x03005d8c - ldr r0, [r4] - ldr r5, =0x00003230 - adds r0, r5 - movs r6, 0xDE - lsls r6, 1 - adds r1, r7, 0 - adds r2, r6, 0 - bl memcpy - ldr r0, [r4] - adds r0, r5 - adds r1, r6, 0 - bl sub_806F928 - ldr r1, [r4] - ldr r2, =0x0000322c - adds r1, r2 - lsls r0, 16 - lsrs r0, 16 - str r0, [r1] - movs r0, 0x1 - b _0801B0C6 - .pool -_0801B0C4: - movs r0, 0 -_0801B0C6: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_801B078 - - thumb_func_start sub_801B0CC -sub_801B0CC: @ 801B0CC - push {r4,lr} - ldr r4, =0x03005d8c - ldr r0, [r4] - ldr r1, =0x00003230 - adds r0, r1 - movs r1, 0xDE - lsls r1, 1 - bl sub_806F928 - lsls r0, 16 - lsrs r0, 16 - ldr r4, [r4] - ldr r2, =0x0000322c - adds r1, r4, r2 - ldr r1, [r1] - cmp r0, r1 - bne _0801B10C - ldr r1, =0x00003230 - adds r0, r4, r1 - bl sub_801B114 - cmp r0, 0 - beq _0801B10C - movs r0, 0x1 - b _0801B10E - .pool -_0801B10C: - movs r0, 0 -_0801B10E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_801B0CC - - thumb_func_start sub_801B114 -sub_801B114: @ 801B114 - push {lr} - ldrh r0, [r0] - cmp r0, 0 - beq _0801B120 - movs r0, 0x1 - b _0801B122 -_0801B120: - movs r0, 0 -_0801B122: - pop {r1} - bx r1 - thumb_func_end sub_801B114 - - thumb_func_start sub_801B128 -sub_801B128: @ 801B128 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003230 - adds r0, r1 - ldrb r0, [r0, 0x2] - cmp r0, 0 - beq _0801B144 - movs r0, 0x1 - b _0801B146 - .pool -_0801B144: - movs r0, 0 -_0801B146: - pop {r1} - bx r1 - thumb_func_end sub_801B128 - - thumb_func_start sub_801B14C -sub_801B14C: @ 801B14C - push {r4,lr} - sub sp, 0x4 - movs r4, 0 - str r4, [sp] - bl sub_801B00C - adds r1, r0, 0 - ldr r2, =0x0500006f - mov r0, sp - bl CpuSet - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x0000322c - adds r0, r1 - str r4, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801B14C - - thumb_func_start sub_801B180 -sub_801B180: @ 801B180 - push {lr} - sub sp, 0x4 - movs r0, 0 - str r0, [sp] - bl sub_801B044 - adds r1, r0, 0 - ldr r2, =0x05000001 - mov r0, sp - bl CpuSet - bl sub_801DBC0 - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_801B180 - - thumb_func_start sub_801B1A4 -sub_801B1A4: @ 801B1A4 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003230 - adds r4, r0, r1 - bl sub_801B0CC - cmp r0, 0 - bne _0801B1C4 -_0801B1B8: - movs r0, 0 - b _0801B1DC - .pool -_0801B1C4: - movs r2, 0 - ldr r3, =0x000001bb -_0801B1C8: - adds r0, r4, r2 - adds r1, r5, r2 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bne _0801B1B8 - adds r2, 0x1 - cmp r2, r3 - bls _0801B1C8 - movs r0, 0x1 -_0801B1DC: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_801B1A4 - - thumb_func_start sub_801B1E8 -sub_801B1E8: @ 801B1E8 - push {lr} - bl sub_801B330 - bl sub_801B368 - bl sub_801B9F8 - bl killram - bl sub_809D4D8 - bl sub_809D570 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000bec - adds r0, r1 - bl sub_816534C - pop {r0} - bx r0 - .pool - thumb_func_end sub_801B1E8 - - thumb_func_start sub_801B21C -sub_801B21C: @ 801B21C - push {r4-r7,lr} - adds r7, r0, 0 - bl sub_801B2CC - cmp r0, 0 - beq _0801B274 - bl sub_801B1E8 - ldr r4, =0x03005d8c - ldr r0, [r4] - ldr r5, =0x000033f0 - adds r0, r5 - movs r6, 0xA6 - lsls r6, 1 - adds r1, r7, 0 - adds r2, r6, 0 - bl memcpy - ldr r0, [r4] - adds r0, r5 - adds r1, r6, 0 - bl sub_806F928 - ldr r1, [r4] - ldr r3, =0x000033ec - adds r2, r1, r3 - lsls r0, 16 - lsrs r0, 16 - str r0, [r2] - movs r0, 0xD5 - lsls r0, 6 - adds r2, r1, r0 - adds r1, r5 - ldrh r0, [r1, 0x2] - strh r0, [r2, 0x6] - movs r0, 0x1 - b _0801B276 - .pool -_0801B274: - movs r0, 0 -_0801B276: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_801B21C - - thumb_func_start sub_801B27C -sub_801B27C: @ 801B27C - push {r4,r5,lr} - ldr r5, =0x03005d8c - ldr r0, [r5] - ldr r1, =0x000033ec - adds r4, r0, r1 - adds r1, 0x4 - adds r0, r1 - movs r1, 0xA6 - lsls r1, 1 - bl sub_806F928 - lsls r0, 16 - lsrs r0, 16 - ldr r1, [r4] - cmp r1, r0 - bne _0801B2C4 - ldr r0, [r5] - ldr r1, =0x000033f0 - adds r0, r1 - bl sub_801B2CC - cmp r0, 0 - beq _0801B2C4 - bl sub_80991F8 - cmp r0, 0 - beq _0801B2C4 - movs r0, 0x1 - b _0801B2C6 - .pool -_0801B2C4: - movs r0, 0 -_0801B2C6: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_801B27C - - thumb_func_start sub_801B2CC -sub_801B2CC: @ 801B2CC - push {lr} - adds r2, r0, 0 - ldrh r0, [r2] - cmp r0, 0 - beq _0801B302 - ldrb r1, [r2, 0x8] - lsls r0, r1, 30 - lsrs r0, 30 - cmp r0, 0x2 - bhi _0801B302 - movs r0, 0xC0 - ands r0, r1 - cmp r0, 0 - beq _0801B2F0 - cmp r0, 0x40 - beq _0801B2F0 - cmp r0, 0x80 - bne _0801B302 -_0801B2F0: - lsls r0, r1, 26 - lsrs r0, 28 - cmp r0, 0x7 - bhi _0801B302 - ldrb r0, [r2, 0x9] - cmp r0, 0x7 - bhi _0801B302 - movs r0, 0x1 - b _0801B304 -_0801B302: - movs r0, 0 -_0801B304: - pop {r1} - bx r1 - thumb_func_end sub_801B2CC - - thumb_func_start sub_801B308 -sub_801B308: @ 801B308 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x000033f0 - adds r0, r1 - ldrb r1, [r0, 0x8] - movs r0, 0xC0 - ands r0, r1 - cmp r0, 0 - beq _0801B328 - movs r0, 0x1 - b _0801B32A - .pool -_0801B328: - movs r0, 0 -_0801B32A: - pop {r1} - bx r1 - thumb_func_end sub_801B308 - - thumb_func_start sub_801B330 -sub_801B330: @ 801B330 - push {r4,r5,lr} - sub sp, 0x4 - movs r5, 0 - str r5, [sp] - ldr r4, =0x03005d8c - ldr r1, [r4] - ldr r0, =0x000033f0 - adds r1, r0 - ldr r2, =0x05000053 - mov r0, sp - bl CpuSet - ldr r0, [r4] - ldr r1, =0x000033ec - adds r0, r1 - str r5, [r0] - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801B330 - - thumb_func_start sub_801B368 -sub_801B368: @ 801B368 - push {r4,lr} - sub sp, 0x4 - movs r4, 0 - str r4, [sp] - bl sav1_get_mevent_buffer_2 - adds r1, r0, 0 - ldr r2, =0x05000009 - mov r0, sp - bl CpuSet - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x0000353c - adds r0, r1 - str r4, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801B368 - - thumb_func_start sub_801B39C -sub_801B39C: @ 801B39C - push {lr} - bl sub_801B27C - cmp r0, 0 - bne _0801B3AA - movs r0, 0 - b _0801B3B4 -_0801B3AA: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x000033f0 - adds r0, r1 - ldrh r0, [r0] -_0801B3B4: - pop {r1} - bx r1 - .pool - thumb_func_end sub_801B39C - - thumb_func_start sub_801B3C0 -sub_801B3C0: @ 801B3C0 - push {lr} - adds r2, r0, 0 - ldrb r1, [r2, 0x8] - movs r0, 0xC0 - ands r0, r1 - cmp r0, 0x40 - bne _0801B3D4 - movs r0, 0x3F - ands r0, r1 - strb r0, [r2, 0x8] -_0801B3D4: - pop {r0} - bx r0 - thumb_func_end sub_801B3C0 - - thumb_func_start sub_801B3D8 -sub_801B3D8: @ 801B3D8 - push {lr} - lsls r0, 16 - ldr r1, =0xfc180000 - adds r0, r1 - lsrs r0, 16 - cmp r0, 0x13 - bls _0801B3F0 - movs r0, 0 - b _0801B3F2 - .pool -_0801B3F0: - movs r0, 0x1 -_0801B3F2: - pop {r1} - bx r1 - thumb_func_end sub_801B3D8 - - thumb_func_start sub_801B3F8 -sub_801B3F8: @ 801B3F8 - push {r4,lr} - bl sub_801B39C - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - bl sub_801B3D8 - cmp r0, 0 - beq _0801B430 - ldr r1, =gUnknown_082F0DE8 - ldr r2, =0xfffffc18 - adds r0, r4, r2 - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0801B430 - movs r0, 0x1 - b _0801B432 - .pool -_0801B430: - movs r0, 0 -_0801B432: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_801B3F8 - - thumb_func_start sub_801B438 -sub_801B438: @ 801B438 - push {lr} - movs r3, 0 - cmp r3, r1 - bge _0801B45A - adds r2, r0, 0 - adds r2, 0x8 -_0801B444: - ldrh r0, [r2, 0xE] - cmp r0, 0 - beq _0801B452 - ldrh r0, [r2] - cmp r0, 0 - beq _0801B452 - adds r3, 0x1 -_0801B452: - adds r2, 0x2 - subs r1, 0x1 - cmp r1, 0 - bne _0801B444 -_0801B45A: - adds r0, r3, 0 - pop {r1} - bx r1 - thumb_func_end sub_801B438 - - thumb_func_start sub_801B460 -sub_801B460: @ 801B460 - push {r4-r7,lr} - adds r5, r0, 0 - adds r4, r1, 0 - movs r1, 0 - cmp r1, r2 - bge _0801B49A - ldrh r6, [r4, 0x2] - movs r0, 0x16 - adds r0, r5 - mov r12, r0 -_0801B474: - lsls r3, r1, 1 - mov r7, r12 - ldrh r0, [r7] - cmp r0, r6 - beq _0801B48C - adds r0, r5, 0 - adds r0, 0x8 - adds r0, r3 - ldrh r0, [r0] - ldrh r3, [r4] - cmp r0, r3 - bne _0801B490 -_0801B48C: - movs r0, 0x1 - b _0801B49C -_0801B490: - movs r7, 0x2 - add r12, r7 - adds r1, 0x1 - cmp r1, r2 - blt _0801B474 -_0801B49A: - movs r0, 0 -_0801B49C: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_801B460 - - thumb_func_start sub_801B4A4 -sub_801B4A4: @ 801B4A4 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x2] - cmp r0, 0 - beq _0801B4C4 - ldrh r1, [r1] - cmp r1, 0 - beq _0801B4C4 - ldr r0, =0x0000019b - cmp r1, r0 - bhi _0801B4C4 - movs r0, 0x1 - b _0801B4C6 - .pool -_0801B4C4: - movs r0, 0 -_0801B4C6: - pop {r1} - bx r1 - thumb_func_end sub_801B4A4 - - thumb_func_start sub_801B4CC -sub_801B4CC: @ 801B4CC - push {lr} - bl sub_801B27C - cmp r0, 0 - beq _0801B500 - ldr r0, =0x03005d8c - ldr r3, [r0] - ldr r0, =0x000033f0 - adds r2, r3, r0 - ldrb r1, [r2, 0x8] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x1 - bne _0801B500 - movs r1, 0xD5 - lsls r1, 6 - adds r0, r3, r1 - ldrb r1, [r2, 0x9] - bl sub_801B438 - b _0801B502 - .pool -_0801B500: - movs r0, 0 -_0801B502: - pop {r1} - bx r1 - thumb_func_end sub_801B4CC - - thumb_func_start sub_801B508 -sub_801B508: @ 801B508 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r6, =0x03005d8c - ldr r0, [r6] - ldr r1, =0x000033f0 - adds r0, r1 - ldrb r4, [r0, 0x9] - adds r0, r5, 0 - bl sub_801B4A4 - cmp r0, 0 - beq _0801B572 - ldr r0, [r6] - movs r1, 0xD5 - lsls r1, 6 - adds r0, r1 - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_801B460 - cmp r0, 0 - beq _0801B54C - b _0801B572 - .pool -_0801B540: - ldrh r0, [r5, 0x2] - strh r0, [r1] - ldrh r0, [r5] - strh r0, [r2] - movs r0, 0x1 - b _0801B574 -_0801B54C: - movs r3, 0 - cmp r3, r4 - bge _0801B572 - ldr r0, [r6] - ldr r6, =0x00003548 - adds r2, r0, r6 - adds r6, 0xE - adds r1, r0, r6 -_0801B55C: - ldrh r0, [r2, 0xE] - cmp r0, 0 - bne _0801B568 - ldrh r0, [r2] - cmp r0, 0 - beq _0801B540 -_0801B568: - adds r2, 0x2 - adds r1, 0x2 - adds r3, 0x1 - cmp r3, r4 - blt _0801B55C -_0801B572: - movs r0, 0 -_0801B574: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_801B508 - - thumb_func_start sub_801B580 -sub_801B580: @ 801B580 - 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 - movs r0, 0 - str r0, [sp] - ldr r2, =0x05000019 - mov r0, sp - adds r1, r5, 0 - bl CpuSet - ldr r0, =0x00000101 - str r0, [r5] - movs r0, 0x1 - strh r0, [r5, 0x4] - str r0, [r5, 0x8] - cmp r4, 0 - beq _0801B5C0 - movs r0, 0x5 - strh r0, [r5, 0xC] - ldr r0, =0x00000201 - b _0801B5C8 - .pool -_0801B5C0: - movs r0, 0x4 - strh r0, [r5, 0xC] - movs r0, 0x80 - lsls r0, 2 -_0801B5C8: - str r0, [r5, 0x10] - bl sub_801B27C - cmp r0, 0 - beq _0801B5FC - bl sav1_get_mevent_buffer_1 - ldrh r0, [r0] - strh r0, [r5, 0x14] - bl sav1_get_mevent_buffer_2 - adds r1, r5, 0 - adds r1, 0x20 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - bl sav1_get_mevent_buffer_1 - ldrb r1, [r0, 0x9] - adds r0, r5, 0 - adds r0, 0x44 - strb r1, [r0] - b _0801B5FE -_0801B5FC: - strh r0, [r5, 0x14] -_0801B5FE: - adds r4, r5, 0 - adds r4, 0x4C - ldr r0, =0x03005d90 - mov r8, r0 - adds r6, r5, 0 - adds r6, 0x45 - adds r7, r5, 0 - adds r7, 0x50 - movs r1, 0x5C - adds r1, r5 - mov r9, r1 - movs r2, 0x60 - adds r2, r5 - mov r10, r2 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r3, =0x00003564 - adds r2, r0, r3 - adds r1, r5, 0 - adds r1, 0x16 - movs r3, 0x3 -_0801B628: - ldrh r0, [r2] - strh r0, [r1] - adds r2, 0x2 - adds r1, 0x2 - subs r3, 0x1 - cmp r3, 0 - bge _0801B628 - mov r0, r8 - ldr r1, [r0] - adds r1, 0xA - adds r0, r4, 0 - bl sub_80842F4 - mov r2, r8 - ldr r1, [r2] - adds r0, r6, 0 - bl CopyString - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r3, =0x00002bb0 - adds r2, r0, r3 - adds r1, r7, 0 - movs r3, 0x5 -_0801B658: - ldrh r0, [r2] - strh r0, [r1] - adds r2, 0x2 - adds r1, 0x2 - subs r3, 0x1 - cmp r3, 0 - bge _0801B658 - ldr r1, =RomHeaderGameCode - mov r0, r9 - movs r2, 0x4 - bl memcpy - ldr r0, =RomHeaderSoftwareVersion - ldrb r0, [r0] - mov r4, r10 - strb r0, [r4] - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801B580 - - thumb_func_start sub_801B6A0 -sub_801B6A0: @ 801B6A0 - push {r4,lr} - adds r2, r0, 0 - adds r4, r1, 0 - ldr r1, [r2] - ldr r0, =0x00000101 - cmp r1, r0 - bne _0801B6DC - ldrh r1, [r2, 0x4] - movs r3, 0x1 - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _0801B6DC - ldr r0, [r2, 0x8] - ands r0, r3 - cmp r0, 0 - beq _0801B6DC - cmp r4, 0 - bne _0801B6E4 - ldrh r1, [r2, 0xC] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0801B6DC - ldr r0, [r2, 0x10] - movs r1, 0xE0 - lsls r1, 2 - ands r0, r1 - cmp r0, 0 - bne _0801B6E4 -_0801B6DC: - movs r0, 0 - b _0801B6E6 - .pool -_0801B6E4: - movs r0, 0x1 -_0801B6E6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_801B6A0 - - thumb_func_start sub_801B6EC -sub_801B6EC: @ 801B6EC - push {lr} - ldrh r1, [r1, 0x14] - cmp r1, 0 - bne _0801B6F8 - movs r0, 0 - b _0801B704 -_0801B6F8: - ldrh r0, [r0] - cmp r0, r1 - beq _0801B702 - movs r0, 0x2 - b _0801B704 -_0801B702: - movs r0, 0x1 -_0801B704: - pop {r1} - bx r1 - thumb_func_end sub_801B6EC - - thumb_func_start sub_801B708 -sub_801B708: @ 801B708 - push {r4-r6,lr} - adds r6, r0, 0 - adds r4, r1, 0 - adds r5, r4, 0 - adds r5, 0x20 - adds r4, 0x44 - ldrb r1, [r4] - adds r0, r5, 0 - bl sub_801B438 - ldrb r2, [r4] - subs r4, r2, r0 - cmp r4, 0 - bne _0801B728 - movs r0, 0x1 - b _0801B742 -_0801B728: - adds r0, r5, 0 - adds r1, r6, 0 - bl sub_801B460 - cmp r0, 0 - beq _0801B738 - movs r0, 0x3 - b _0801B742 -_0801B738: - cmp r4, 0x1 - beq _0801B740 - movs r0, 0x2 - b _0801B742 -_0801B740: - movs r0, 0x4 -_0801B742: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_801B708 - - thumb_func_start sub_801B748 -sub_801B748: @ 801B748 - push {r4,lr} - movs r3, 0 - adds r2, r0, 0 - adds r2, 0x16 -_0801B750: - ldrh r0, [r2] - ldrh r4, [r1] - cmp r0, r4 - beq _0801B75C - movs r0, 0 - b _0801B768 -_0801B75C: - adds r1, 0x2 - adds r2, 0x2 - adds r3, 0x1 - cmp r3, 0x3 - ble _0801B750 - movs r0, 0x1 -_0801B768: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_801B748 - - thumb_func_start sub_801B770 -sub_801B770: @ 801B770 - push {lr} - adds r2, r0, 0 - adds r2, 0x20 - adds r0, 0x44 - ldrb r1, [r0] - adds r0, r2, 0 - bl sub_801B438 - pop {r1} - bx r1 - thumb_func_end sub_801B770 - - thumb_func_start sub_801B784 -sub_801B784: @ 801B784 - push {lr} - adds r2, r0, 0 - cmp r1, 0x4 - bhi _0801B7D0 - lsls r0, r1, 2 - ldr r1, =_0801B79C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0801B79C: - .4byte _0801B7B0 - .4byte _0801B7B4 - .4byte _0801B7B8 - .4byte _0801B7BC - .4byte _0801B7C8 -_0801B7B0: - ldrh r0, [r2, 0x20] - b _0801B7D2 -_0801B7B4: - ldrh r0, [r2, 0x22] - b _0801B7D2 -_0801B7B8: - ldrh r0, [r2, 0x24] - b _0801B7D2 -_0801B7BC: - adds r0, r2, 0 - bl sub_801B770 - lsls r0, 16 - lsrs r0, 16 - b _0801B7D2 -_0801B7C8: - adds r0, r2, 0 - adds r0, 0x44 - ldrb r0, [r0] - b _0801B7D2 -_0801B7D0: - movs r0, 0 -_0801B7D2: - pop {r1} - bx r1 - thumb_func_end sub_801B784 - - thumb_func_start sub_801B7D8 -sub_801B7D8: @ 801B7D8 - push {r4,lr} - adds r4, r0, 0 - ldr r2, =0x03005d8c - ldr r0, [r2] - ldr r1, =0x000033f0 - adds r0, r1 - ldrb r1, [r0, 0x8] - movs r0, 0x3 - ands r0, r1 - adds r3, r2, 0 - cmp r0, 0x2 - bne _0801B850 - movs r2, 0 - cmp r4, 0x4 - bhi _0801B83A - lsls r0, r4, 2 - ldr r1, =_0801B80C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0801B80C: - .4byte _0801B820 - .4byte _0801B828 - .4byte _0801B834 - .4byte _0801B83A - .4byte _0801B83A -_0801B820: - ldr r0, [r3] - movs r1, 0xD5 - lsls r1, 6 - b _0801B838 -_0801B828: - ldr r0, [r3] - ldr r1, =0x00003542 - b _0801B838 - .pool -_0801B834: - ldr r0, [r3] - ldr r1, =0x00003544 -_0801B838: - adds r2, r0, r1 -_0801B83A: - cmp r2, 0 - beq _0801B850 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x000003e7 - cmp r0, r1 - bls _0801B850 - strh r1, [r2] -_0801B850: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801B7D8 - - thumb_func_start mevent_081445C0 -mevent_081445C0: @ 801B860 - push {lr} - cmp r0, 0x4 - bhi _0801B938 - lsls r0, 2 - ldr r1, =_0801B874 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0801B874: - .4byte _0801B888 - .4byte _0801B8AC - .4byte _0801B8D0 - .4byte _0801B8F4 - .4byte _0801B918 -_0801B888: - ldr r0, =0x03005d8c - ldr r2, [r0] - ldr r1, =0x000033f0 - adds r0, r2, r1 - ldrb r1, [r0, 0x8] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x2 - bne _0801B938 - movs r1, 0xD5 - lsls r1, 6 - adds r0, r2, r1 - ldrh r0, [r0] - b _0801B93A - .pool -_0801B8AC: - ldr r0, =0x03005d8c - ldr r2, [r0] - ldr r1, =0x000033f0 - adds r0, r2, r1 - ldrb r1, [r0, 0x8] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x2 - bne _0801B938 - movs r1, 0xD5 - lsls r1, 6 - adds r0, r2, r1 - ldrh r0, [r0, 0x2] - b _0801B93A - .pool -_0801B8D0: - ldr r0, =0x03005d8c - ldr r2, [r0] - ldr r1, =0x000033f0 - adds r0, r2, r1 - ldrb r1, [r0, 0x8] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x2 - bne _0801B938 - movs r1, 0xD5 - lsls r1, 6 - adds r0, r2, r1 - ldrh r0, [r0, 0x4] - b _0801B93A - .pool -_0801B8F4: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x000033f0 - adds r0, r1 - ldrb r1, [r0, 0x8] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x1 - bne _0801B938 - bl sub_801B4CC - lsls r0, 16 - lsrs r0, 16 - b _0801B93A - .pool -_0801B918: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x000033f0 - adds r2, r0, r1 - ldrb r1, [r2, 0x8] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x1 - bne _0801B938 - ldrb r0, [r2, 0x9] - b _0801B93A - .pool -_0801B938: - movs r0, 0 -_0801B93A: - pop {r1} - bx r1 - thumb_func_end mevent_081445C0 - - thumb_func_start sub_801B940 -sub_801B940: @ 801B940 - ldr r1, =0x02022c70 - movs r0, 0 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_801B940 - - thumb_func_start sub_801B94C -sub_801B94C: @ 801B94C - push {r4,r5,lr} - lsls r0, 16 - lsrs r0, 16 - adds r4, r0, 0 - ldr r5, =0x02022c70 - movs r0, 0 - str r0, [r5] - cmp r4, 0 - beq _0801B98A - bl sub_801B27C - cmp r0, 0 - beq _0801B988 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x000033f0 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r4 - bne _0801B988 - movs r0, 0x1 - str r0, [r5] - b _0801B98A - .pool -_0801B988: - movs r0, 0 -_0801B98A: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_801B94C - - thumb_func_start sub_801B990 -sub_801B990: @ 801B990 - push {lr} - adds r2, r0, 0 - ldr r0, =0x02022c70 - ldr r0, [r0] - cmp r0, 0 - beq _0801B9EC - cmp r2, 0x1 - beq _0801B9DC - cmp r2, 0x1 - bcc _0801B9C0 - cmp r2, 0x2 - bne _0801B9EC - ldr r0, =0x03005d8c - ldr r2, [r0] - ldr r0, =0x00003584 - adds r2, r0 - movs r0, 0x2 - b _0801B9CA - .pool -_0801B9C0: - ldr r0, =0x03005d8c - ldr r2, [r0] - ldr r0, =0x00003570 - adds r2, r0 - movs r0, 0 -_0801B9CA: - movs r3, 0x5 - bl sub_801BA8C - b _0801B9EC - .pool -_0801B9DC: - ldr r0, =0x03005d8c - ldr r2, [r0] - ldr r0, =0x00003570 - adds r2, r0 - movs r0, 0x1 - movs r3, 0x5 - bl sub_801BA8C -_0801B9EC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_801B990 - - thumb_func_start sub_801B9F8 -sub_801B9F8: @ 801B9F8 - push {lr} - sub sp, 0x4 - movs r0, 0 - str r0, [sp] - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r0, =0x00003570 - adds r1, r0 - ldr r2, =0x0500000a - mov r0, sp - bl CpuSet - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_801B9F8 - - thumb_func_start sub_801BA24 -sub_801BA24: @ 801BA24 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - movs r1, 0 - cmp r1, r2 - bge _0801BA46 - ldr r0, [r4] - cmp r0, r5 - beq _0801BA46 - adds r3, r4, 0 -_0801BA38: - adds r3, 0x4 - adds r1, 0x1 - cmp r1, r2 - bge _0801BA46 - ldr r0, [r3] - cmp r0, r5 - bne _0801BA38 -_0801BA46: - cmp r1, r2 - bne _0801BA68 - subs r3, r1, 0x1 - cmp r3, 0 - ble _0801BA62 - lsls r0, r3, 2 - subs r0, 0x4 - adds r2, r0, r4 -_0801BA56: - ldr r0, [r2] - str r0, [r2, 0x4] - subs r2, 0x4 - subs r3, 0x1 - cmp r3, 0 - bgt _0801BA56 -_0801BA62: - str r5, [r4] - movs r0, 0x1 - b _0801BA84 -_0801BA68: - adds r3, r1, 0 - cmp r3, 0 - ble _0801BA80 - lsls r0, r3, 2 - subs r0, 0x4 - adds r2, r0, r4 -_0801BA74: - ldr r0, [r2] - str r0, [r2, 0x4] - subs r2, 0x4 - subs r3, 0x1 - cmp r3, 0 - bgt _0801BA74 -_0801BA80: - str r5, [r4] - movs r0, 0 -_0801BA84: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_801BA24 - - thumb_func_start sub_801BA8C -sub_801BA8C: @ 801BA8C - push {r4,lr} - adds r4, r0, 0 - adds r0, r1, 0 - adds r1, r2, 0 - adds r2, r3, 0 - bl sub_801BA24 - cmp r0, 0 - beq _0801BAA4 - adds r0, r4, 0 - bl sub_801B7D8 -_0801BAA4: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_801BA8C - - thumb_func_start sub_801BAAC -sub_801BAAC: @ 801BAAC - push {r4-r7,lr} - adds r5, r0, 0 - adds r6, r1, 0 - cmp r5, 0 - beq _0801BAC8 - cmp r6, 0 - beq _0801BAC8 - ldr r7, =0x02022c74 - ldr r0, =0x0000145c - bl AllocZeroed - str r0, [r7] - cmp r0, 0 - bne _0801BAD4 -_0801BAC8: - movs r0, 0 - b _0801BB3E - .pool -_0801BAD4: - movs r4, 0xA6 - lsls r4, 1 - adds r1, r5, 0 - adds r2, r4, 0 - bl memcpy - ldr r1, [r7] - adds r1, r4 - 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 r2, [r7] - ldrb r1, [r2, 0x8] - lsls r0, r1, 26 - lsrs r0, 28 - cmp r0, 0x7 - bls _0801BB06 - movs r0, 0x3D - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x8] -_0801BB06: - ldr r2, [r7] - ldrb r1, [r2, 0x8] - lsls r0, r1, 30 - lsrs r0, 30 - cmp r0, 0x2 - bls _0801BB1A - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x8] -_0801BB1A: - ldr r1, [r7] - ldrb r0, [r1, 0x9] - cmp r0, 0x7 - bls _0801BB26 - movs r0, 0 - strb r0, [r1, 0x9] -_0801BB26: - ldr r0, [r7] - movs r1, 0xB8 - lsls r1, 1 - adds r2, r0, r1 - ldrb r0, [r0, 0x8] - lsls r0, 26 - lsrs r0, 28 - lsls r0, 4 - ldr r1, =gUnknown_082F1D60 - adds r0, r1 - str r0, [r2] - movs r0, 0x1 -_0801BB3E: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_801BAAC - - thumb_func_start sub_801BB48 -sub_801BB48: @ 801BB48 - push {r4,lr} - ldr r4, =0x02022c74 - ldr r0, [r4] - cmp r0, 0 - beq _0801BB64 - ldr r2, =0x0000145c - movs r1, 0 - bl memset - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] -_0801BB64: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801BB48 - - thumb_func_start sub_801BB74 -sub_801BB74: @ 801BB74 - push {r4-r6,lr} - sub sp, 0x24 - ldr r5, =0x02022c74 - ldr r0, [r5] - cmp r0, 0 - bne _0801BB8C - movs r0, 0x1 - negs r0, r0 - b _0801BD98 - .pool -_0801BB8C: - movs r4, 0xBA - lsls r4, 1 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0x7 - bls _0801BB9A - b _0801BD70 -_0801BB9A: - lsls r0, 2 - ldr r1, =_0801BBA8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0801BBA8: - .4byte _0801BBC8 - .4byte _0801BBDA - .4byte _0801BBE8 - .4byte _0801BC8C - .4byte _0801BD14 - .4byte _0801BD1A - .4byte _0801BD34 - .4byte _0801BD3A -_0801BBC8: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - b _0801BD86 -_0801BBDA: - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - bne _0801BBE6 - b _0801BD86 -_0801BBE6: - b _0801BD96 -_0801BBE8: - movs r5, 0x1E - str r5, [sp] - movs r4, 0x14 - str r4, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r5, [sp] - str r4, [sp, 0x4] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r5, [sp] - str r4, [sp, 0x4] - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - ldr r5, =0x02022c74 - ldr r0, [r5] - movs r1, 0xB8 - lsls r1, 1 - adds r0, r1 - ldr r0, [r0] - ldr r1, [r0, 0x4] - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - movs r2, 0 - movs r3, 0x8 - bl decompress_and_copy_tile_data_to_vram - ldr r4, =gUnknown_082F0E1C - adds r0, r4, 0 - bl AddWindow - ldr r1, [r5] - movs r2, 0xBB - lsls r2, 1 - adds r1, r2 - strh r0, [r1] - adds r0, r4, 0 - adds r0, 0x8 - bl AddWindow - ldr r1, [r5] - movs r2, 0xBC - lsls r2, 1 - adds r1, r2 - strh r0, [r1] - adds r4, 0x10 - adds r0, r4, 0 - bl AddWindow - ldr r1, [r5] - movs r2, 0xBD - lsls r2, 1 - adds r1, r2 - strh r0, [r1] - b _0801BD86 - .pool -_0801BC8C: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - beq _0801BC9A - b _0801BD96 -_0801BC9A: - movs r0, 0x1 - bl stdpal_get - movs r1, 0x20 - movs r2, 0x20 - bl gpu_pal_apply - ldr r2, =0x02037fd4 - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x8] - ldr r5, =0x02022c74 - ldr r0, [r5] - movs r4, 0xB8 - lsls r4, 1 - adds r0, r4 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x10 - movs r2, 0x20 - bl gpu_pal_apply - ldr r1, [r5] - adds r4, r1, r4 - ldr r0, [r4] - ldr r0, [r0, 0x8] - ldr r4, =0x0000045c - adds r1, r4 - bl LZ77UnCompWram - ldr r1, [r5] - adds r1, r4 - movs r2, 0x1E - str r2, [sp] - movs r0, 0x14 - str r0, [sp, 0x4] - str r6, [sp, 0x8] - str r6, [sp, 0xC] - str r2, [sp, 0x10] - str r0, [sp, 0x14] - movs r0, 0x1 - str r0, [sp, 0x18] - movs r0, 0x8 - str r0, [sp, 0x1C] - str r6, [sp, 0x20] - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl CopyRectToBgTilemapBufferRect - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - b _0801BD86 - .pool -_0801BD14: - bl sub_801BEF8 - b _0801BD86 -_0801BD1A: - movs r0, 0 - bl sub_801C178 - movs r0, 0x1 - bl sub_801C178 - movs r0, 0x2 - bl sub_801C178 - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - b _0801BD86 -_0801BD34: - bl sub_80D2F04 - b _0801BD86 -_0801BD3A: - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x8] - bl sub_801C4C0 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - bl fade_and_return_progress_probably - b _0801BD86 - .pool -_0801BD70: - bl fade_and_return_progress_probably - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _0801BD96 - ldr r0, [r5] - adds r0, r4 - strb r1, [r0] - movs r0, 0x1 - b _0801BD98 -_0801BD86: - ldr r0, =0x02022c74 - ldr r1, [r0] - movs r0, 0xBA - lsls r0, 1 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_0801BD96: - movs r0, 0 -_0801BD98: - add sp, 0x24 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_801BB74 - - thumb_func_start sub_801BDA4 -sub_801BDA4: @ 801BDA4 - push {r4,r5,lr} - sub sp, 0x8 - adds r2, r0, 0 - ldr r5, =0x02022c74 - ldr r0, [r5] - cmp r0, 0 - bne _0801BDBC - movs r0, 0x1 - negs r0, r0 - b _0801BEEC - .pool -_0801BDBC: - movs r4, 0xBA - lsls r4, 1 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0x5 - bls _0801BDCA - b _0801BEC4 -_0801BDCA: - lsls r0, 2 - ldr r1, =_0801BDD8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0801BDD8: - .4byte _0801BDF0 - .4byte _0801BE02 - .4byte _0801BE0E - .4byte _0801BE56 - .4byte _0801BE94 - .4byte _0801BE9E -_0801BDF0: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - b _0801BEDA -_0801BE02: - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - beq _0801BEDA - b _0801BEEA -_0801BE0E: - movs r5, 0x1E - str r5, [sp] - movs r4, 0x14 - str r4, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r5, [sp] - str r4, [sp, 0x4] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r5, [sp] - str r4, [sp, 0x4] - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - b _0801BEDA -_0801BE56: - movs r0, 0x1 - bl HideBg - movs r0, 0x2 - bl HideBg - ldr r4, =0x02022c74 - ldr r0, [r4] - movs r1, 0xBD - lsls r1, 1 - adds r0, r1 - ldrb r0, [r0] - bl RemoveWindow - ldr r0, [r4] - movs r1, 0xBC - lsls r1, 1 - adds r0, r1 - ldrb r0, [r0] - bl RemoveWindow - ldr r0, [r4] - movs r1, 0xBB - lsls r1, 1 - adds r0, r1 - ldrb r0, [r0] - bl RemoveWindow - b _0801BEDA - .pool -_0801BE94: - bl sub_801C61C - bl sub_80D2F9C - b _0801BEDA -_0801BE9E: - ldr r0, =0x02022c60 - ldrb r0, [r0] - adds r1, r2, 0 - bl sub_80186EC - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - b _0801BEDA - .pool -_0801BEC4: - bl fade_and_return_progress_probably - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _0801BEEA - ldr r0, [r5] - adds r0, r4 - strb r1, [r0] - movs r0, 0x1 - b _0801BEEC -_0801BEDA: - ldr r0, =0x02022c74 - ldr r1, [r0] - movs r0, 0xBA - lsls r0, 1 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_0801BEEA: - movs r0, 0 -_0801BEEC: - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_801BDA4 - - thumb_func_start sub_801BEF8 -sub_801BEF8: @ 801BEF8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - movs r5, 0 - mov r0, sp - movs r1, 0 - movs r2, 0x6 - bl memset - ldr r4, =0x02022c74 - ldr r1, [r4] - ldr r2, =0x0000018b - adds r0, r1, r2 - adds r1, 0xA - movs r2, 0x28 - bl memcpy - ldr r0, [r4] - ldr r3, =0x000001b3 - adds r1, r0, r3 - movs r0, 0xFF - strb r0, [r1] - ldr r1, [r4] - movs r2, 0xDA - lsls r2, 1 - adds r0, r1, r2 - adds r1, 0x32 - movs r2, 0x28 - bl memcpy - ldr r0, [r4] - movs r3, 0xEE - lsls r3, 1 - adds r0, r3 - movs r1, 0x1 - negs r1, r1 - strb r1, [r0] - ldr r1, [r4] - ldr r0, [r1, 0x4] - ldr r2, =0x000f423f - cmp r0, r2 - bls _0801BF54 - str r2, [r1, 0x4] -_0801BF54: - ldr r1, [r4] - ldr r2, =0x000001dd - adds r0, r1, r2 - ldr r1, [r1, 0x4] - movs r2, 0 - movs r3, 0x6 - bl ConvertIntToDecimalString - adds r6, r4, 0 -_0801BF66: - ldr r2, [r6] - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r4, r1, r5 - adds r0, r4, r2 - movs r3, 0xF2 - lsls r3, 1 - adds r0, r3 - adds r1, r2 - adds r1, 0x5A - movs r2, 0x28 - bl memcpy - ldr r1, [r6] - movs r0, 0x83 - lsls r0, 2 - adds r1, r0 - adds r1, r4 - movs r2, 0x1 - negs r2, r2 - adds r7, r2, 0 - movs r0, 0xFF - strb r0, [r1] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x3 - bls _0801BF66 - ldr r6, =0x02022c74 - ldr r1, [r6] - movs r3, 0xA2 - lsls r3, 2 - adds r0, r1, r3 - adds r1, 0xFA - movs r2, 0x28 - bl memcpy - ldr r0, [r6] - movs r4, 0xAC - lsls r4, 2 - adds r0, r4 - movs r1, 0x1 - negs r1, r1 - adds r4, r1, 0 - movs r1, 0xFF - strb r1, [r0] - ldr r1, [r6] - ldrb r0, [r1, 0x8] - lsls r0, 30 - lsrs r0, 30 - cmp r0, 0x1 - beq _0801C018 - cmp r0, 0x1 - bgt _0801BFF0 - cmp r0, 0 - beq _0801BFF6 - b _0801C168 - .pool -_0801BFF0: - cmp r0, 0x2 - beq _0801C028 - b _0801C168 -_0801BFF6: - ldr r2, =0x000002b1 - adds r0, r1, r2 - movs r3, 0x91 - lsls r3, 1 - adds r1, r3 - movs r2, 0x28 - bl memcpy - ldr r1, [r6] - ldr r0, =0x000002d9 - adds r1, r0 - b _0801C01C - .pool -_0801C018: - ldr r2, =0x000002b1 - adds r1, r2 -_0801C01C: - ldrb r0, [r1] - orrs r0, r4 - strb r0, [r1] - b _0801C168 - .pool -_0801C028: - ldr r3, =0x000002b1 - adds r0, r1, r3 - ldrb r1, [r0] - orrs r1, r7 - strb r1, [r0] - mov r3, sp - ldr r1, [r6] - movs r4, 0xA6 - lsls r4, 1 - adds r0, r1, r4 - ldrh r0, [r0] - ldr r2, =0x000003e7 - cmp r0, r2 - bls _0801C046 - adds r0, r2, 0 -_0801C046: - strh r0, [r3] - mov r3, sp - movs r4, 0xA7 - lsls r4, 1 - adds r0, r1, r4 - ldrh r0, [r0] - cmp r0, r2 - bls _0801C058 - adds r0, r2, 0 -_0801C058: - strh r0, [r3, 0x2] - mov r3, sp - movs r4, 0xA8 - lsls r4, 1 - adds r0, r1, r4 - ldrh r0, [r0] - cmp r0, r2 - bls _0801C06A - adds r0, r2, 0 -_0801C06A: - strh r0, [r3, 0x4] - movs r5, 0 -_0801C06E: - lsls r4, r5, 1 - adds r4, r5 - lsls r4, 4 - movs r0, 0xB7 - lsls r0, 2 - adds r4, r0 - ldr r0, [r6] - adds r0, r4 - adds r0, 0x2A - movs r1, 0xFF - movs r2, 0x4 - bl memset - ldr r0, [r6] - adds r0, r4 - adds r0, 0x1 - movs r1, 0xFF - movs r2, 0x29 - bl memset - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x7 - bls _0801C06E - movs r5, 0 - movs r6, 0 - ldr r1, =0x02022c74 - mov r8, r1 - movs r2, 0x91 - lsls r2, 1 - mov r10, r2 - ldr r7, =0x00000175 - movs r3, 0xB7 - lsls r3, 2 - mov r9, r3 -_0801C0B6: - mov r4, r8 - ldr r2, [r4] - mov r0, r10 - adds r1, r2, r0 - adds r0, r1, r5 - ldrb r3, [r0] - cmp r3, 0xF7 - beq _0801C0F8 - ldr r1, =0x00000175 - adds r0, r2, r1 - ldrb r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 4 - adds r0, r6, r0 - ldr r4, =0x000002dd - adds r1, r2, r4 - adds r1, r0 - strb r3, [r1] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - b _0801C15E - .pool -_0801C0F8: - adds r0, r5, 0x1 - adds r0, r1, r0 - ldrb r3, [r0] - cmp r3, 0x2 - bls _0801C108 - adds r0, r5, 0x2 - lsls r0, 16 - b _0801C15C -_0801C108: - adds r0, r2, r7 - ldrb r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 4 - add r0, r9 - adds r0, r2, r0 - adds r0, 0x2A - lsls r1, r3, 1 - add r1, sp - ldrh r1, [r1] - movs r2, 0x2 - movs r3, 0x3 - bl ConvertIntToDecimalString - mov r0, r8 - ldr r1, [r0] - adds r0, r1, r7 - ldrb r2, [r0] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 4 - adds r0, r1, r0 - adds r4, r5, 0x2 - add r1, r10 - adds r1, r4 - ldrb r1, [r1] - add r0, r9 - strb r1, [r0] - mov r2, r8 - ldr r1, [r2] - adds r1, r7 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r2] - adds r0, r7 - ldrb r0, [r0] - cmp r0, 0x7 - bhi _0801C168 - movs r6, 0 - lsls r0, r4, 16 -_0801C15C: - lsrs r5, r0, 16 -_0801C15E: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x27 - bls _0801C0B6 -_0801C168: - 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_801BEF8 - - thumb_func_start sub_801C178 -sub_801C178: @ 801C178 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - lsls r0, 24 - lsrs r4, r0, 24 - mov r8, r4 - movs r0, 0 - str r0, [sp, 0xC] - ldr r7, =0x02022c74 - ldr r0, [r7] - lsls r1, r4, 1 - movs r2, 0xBB - lsls r2, 1 - adds r0, r2 - adds r0, r1 - ldrh r0, [r0] - lsls r6, r0, 24 - lsrs r5, r6, 24 - adds r0, r5, 0 - bl PutWindowTilemap - adds r0, r5, 0 - movs r1, 0 - bl FillWindowPixelBuffer - cmp r4, 0x1 - beq _0801C2A0 - cmp r4, 0x1 - bgt _0801C1C4 - cmp r4, 0 - beq _0801C1D0 - mov r9, r6 - b _0801C498 - .pool -_0801C1C4: - mov r0, r8 - cmp r0, 0x2 - bne _0801C1CC - b _0801C304 -_0801C1CC: - mov r9, r6 - b _0801C498 -_0801C1D0: - ldr r2, [r7] - movs r1, 0xB8 - lsls r1, 1 - mov r10, r1 - adds r0, r2, r1 - ldr r0, [r0] - ldrb r0, [r0] - lsls r0, 28 - lsrs r0, 28 - lsls r1, r0, 1 - adds r1, r0 - ldr r0, =gUnknown_082F0E10 - mov r8, r0 - add r1, r8 - str r1, [sp] - ldr r1, [sp, 0xC] - str r1, [sp, 0x4] - ldr r0, =0x0000018b - adds r2, r0 - str r2, [sp, 0x8] - adds r0, r5, 0 - movs r1, 0x3 - movs r2, 0 - movs r3, 0x1 - bl box_print - ldr r4, [r7] - movs r1, 0xDA - lsls r1, 1 - mov r9, r1 - add r4, r9 - movs r0, 0x3 - movs r1, 0x2 - bl GetFontAttribute - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x3 - adds r1, r4, 0 - bl GetStringWidth - movs r1, 0xA0 - subs r1, r0 - cmp r1, 0 - bge _0801C22E - movs r1, 0 -_0801C22E: - lsls r2, r1, 24 - lsrs r2, 24 - ldr r3, [r7] - mov r1, r10 - adds r0, r3, r1 - ldr r0, [r0] - ldrb r1, [r0] - lsls r1, 28 - lsrs r1, 28 - lsls r0, r1, 1 - adds r0, r1 - add r0, r8 - str r0, [sp] - ldr r0, [sp, 0xC] - str r0, [sp, 0x4] - add r3, r9 - str r3, [sp, 0x8] - adds r0, r5, 0 - movs r1, 0x3 - movs r3, 0x11 - bl box_print - ldr r2, [r7] - ldr r0, [r2, 0x4] - mov r9, r6 - cmp r0, 0 - bne _0801C266 - b _0801C498 -_0801C266: - mov r1, r10 - adds r0, r2, r1 - ldr r0, [r0] - ldrb r1, [r0] - lsls r1, 28 - lsrs r1, 28 - lsls r0, r1, 1 - adds r0, r1 - add r0, r8 - str r0, [sp] - ldr r0, [sp, 0xC] - str r0, [sp, 0x4] - ldr r1, =0x000001dd - adds r0, r2, r1 - str r0, [sp, 0x8] - adds r0, r5, 0 - movs r1, 0x1 - movs r2, 0xA6 - movs r3, 0x11 - bl box_print - b _0801C498 - .pool -_0801C2A0: - mov r9, r6 -_0801C2A2: - ldr r2, [sp, 0xC] - lsls r4, r2, 24 - asrs r4, 24 - lsls r3, r4, 4 - adds r3, 0x2 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =0x02022c74 - ldr r2, [r0] - movs r1, 0xB8 - lsls r1, 1 - adds r0, r2, r1 - ldr r0, [r0] - ldrb r0, [r0] - lsrs r0, 4 - lsls r1, r0, 1 - adds r1, r0 - ldr r0, =gUnknown_082F0E10 - adds r1, r0 - str r1, [sp] - movs r0, 0 - str r0, [sp, 0x4] - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r4 - movs r1, 0xF2 - lsls r1, 1 - adds r0, r1 - adds r2, r0 - str r2, [sp, 0x8] - mov r2, r9 - lsrs r0, r2, 24 - movs r1, 0x3 - movs r2, 0 - bl box_print - adds r4, 0x1 - lsls r4, 24 - lsrs r0, r4, 24 - str r0, [sp, 0xC] - asrs r4, 24 - cmp r4, 0x3 - ble _0801C2A2 - b _0801C498 - .pool -_0801C304: - ldr r4, =gUnknown_082F0E18 - ldr r2, [r7] - ldrb r0, [r2, 0x8] - lsls r0, 30 - lsrs r0, 30 - adds r0, r4 - ldrb r3, [r0] - movs r1, 0xB8 - lsls r1, 1 - adds r0, r2, r1 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - lsls r0, 28 - lsrs r0, 28 - lsls r1, r0, 1 - adds r1, r0 - ldr r0, =gUnknown_082F0E10 - mov r10, r0 - add r1, r10 - str r1, [sp] - ldr r1, [sp, 0xC] - str r1, [sp, 0x4] - movs r1, 0xA2 - lsls r1, 2 - adds r0, r2, r1 - str r0, [sp, 0x8] - adds r0, r5, 0 - movs r1, 0x3 - movs r2, 0 - bl box_print - ldr r2, [r7] - ldrb r1, [r2, 0x8] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x2 - beq _0801C398 - lsls r0, r1, 30 - lsrs r0, 30 - adds r0, r4 - ldrb r3, [r0] - adds r3, 0x10 - lsls r3, 24 - lsrs r3, 24 - movs r1, 0xB8 - lsls r1, 1 - adds r0, r2, r1 - ldr r0, [r0] - ldrb r1, [r0, 0x1] - lsls r1, 28 - lsrs r1, 28 - lsls r0, r1, 1 - adds r0, r1 - add r0, r10 - str r0, [sp] - ldr r0, [sp, 0xC] - str r0, [sp, 0x4] - ldr r1, =0x000002b1 - adds r0, r2, r1 - str r0, [sp, 0x8] - adds r0, r5, 0 - movs r1, 0x3 - movs r2, 0 - bl box_print - mov r9, r6 - b _0801C498 - .pool -_0801C398: - movs r2, 0 - mov r8, r2 - lsls r0, r1, 30 - lsrs r0, 30 - adds r0, r4 - ldrb r0, [r0] - adds r4, r0, 0 - adds r4, 0x10 - movs r0, 0x3 - movs r1, 0x2 - bl GetFontAttribute - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, [r7] - ldr r1, =0x00000175 - adds r0, r1 - mov r9, r6 - ldr r1, [sp, 0xC] - ldrb r0, [r0] - cmp r1, r0 - bge _0801C498 - str r5, [sp, 0x10] - lsls r0, r4, 24 - lsrs r0, 24 - str r0, [sp, 0x14] - mov r10, r2 -_0801C3CE: - mov r0, r8 - lsls r2, r0, 24 - lsrs r2, 24 - ldr r3, [r7] - movs r1, 0xB8 - lsls r1, 1 - adds r0, r3, r1 - ldr r0, [r0] - ldrb r1, [r0, 0x1] - lsls r1, 28 - lsrs r1, 28 - lsls r0, r1, 1 - adds r0, r1 - ldr r1, =gUnknown_082F0E10 - adds r0, r1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - ldr r1, [sp, 0xC] - lsls r0, r1, 24 - asrs r6, r0, 24 - lsls r0, r6, 1 - adds r0, r6 - lsls r5, r0, 4 - movs r0, 0xB7 - lsls r0, 2 - adds r4, r5, r0 - adds r3, r4 - adds r3, 0x1 - str r3, [sp, 0x8] - ldr r0, [sp, 0x10] - movs r1, 0x3 - ldr r3, [sp, 0x14] - bl box_print - ldr r1, [r7] - adds r0, r1, r5 - ldr r2, =0x00000306 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0xFF - beq _0801C482 - adds r1, r4 - adds r1, 0x1 - movs r0, 0x3 - mov r2, r10 - bl GetStringWidth - add r8, r0 - mov r0, r8 - lsls r2, r0, 24 - lsrs r2, 24 - ldr r3, [r7] - movs r1, 0xB8 - lsls r1, 1 - adds r0, r3, r1 - ldr r0, [r0] - ldrb r1, [r0, 0x1] - lsls r1, 28 - lsrs r1, 28 - lsls r0, r1, 1 - adds r0, r1 - ldr r1, =gUnknown_082F0E10 - adds r0, r1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - adds r3, r4 - adds r3, 0x2A - str r3, [sp, 0x8] - ldr r0, [sp, 0x10] - movs r1, 0x3 - ldr r3, [sp, 0x14] - bl box_print - ldr r1, [r7] - adds r1, r4 - adds r1, 0x2A - movs r0, 0x3 - mov r2, r10 - bl GetStringWidth - ldr r1, [r7] - adds r1, r5 - movs r2, 0xB7 - lsls r2, 2 - adds r1, r2 - ldrb r1, [r1] - adds r0, r1 - add r8, r0 -_0801C482: - adds r1, r6, 0x1 - lsls r1, 24 - lsrs r0, r1, 24 - str r0, [sp, 0xC] - asrs r1, 24 - ldr r0, [r7] - ldr r2, =0x00000175 - adds r0, r2 - ldrb r0, [r0] - cmp r1, r0 - blt _0801C3CE -_0801C498: - mov r1, r9 - lsrs r0, r1, 24 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801C178 - - thumb_func_start sub_801C4C0 -sub_801C4C0: @ 801C4C0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - movs r7, 0 - ldr r4, =0x02022c74 - ldr r0, [r4] - movs r1, 0xBE - lsls r1, 1 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldr r0, [r4] - movs r2, 0xA9 - lsls r2, 1 - adds r1, r0, r2 - ldrh r0, [r1] - cmp r0, 0 - beq _0801C52C - bl sub_80D2E84 - lsls r0, 16 - lsrs r0, 16 - ldr r1, =DummyObjectCallback - str r7, [sp] - str r7, [sp, 0x4] - movs r2, 0xDC - movs r3, 0x14 - bl sub_80D2D78 - ldr r1, [r4] - movs r2, 0xBE - lsls r2, 1 - adds r1, r2 - strb r0, [r1] - ldr r2, =0x02020630 - ldr r0, [r4] - movs r1, 0xBE - lsls r1, 1 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r2, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0, 0x5] -_0801C52C: - ldr r1, [r4] - ldrb r0, [r1, 0x9] - cmp r0, 0 - beq _0801C5EE - ldrb r1, [r1, 0x8] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x1 - bne _0801C5EE - ldr r0, =gUnknown_082F1D00 - bl LoadCompressedObjectPicUsingHeap - ldr r0, [r4] - movs r2, 0xB8 - lsls r2, 1 - adds r0, r2 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - lsrs r0, 4 - lsls r0, 3 - ldr r1, =gUnknown_082F1D08 - adds r0, r1 - bl LoadTaggedObjectPalette - ldr r0, [r4] - ldrb r0, [r0, 0x9] - cmp r7, r0 - bcs _0801C5EE - adds r6, r4, 0 - ldr r0, =0x0000017d - mov r10, r0 - movs r1, 0 - mov r9, r1 - movs r2, 0xFF - mov r8, r2 -_0801C572: - ldr r1, [r6] - lsls r4, r7, 1 - add r1, r10 - adds r1, r4 - ldrb r0, [r1] - mov r2, r8 - orrs r0, r2 - strb r0, [r1] - ldr r1, [r6] - movs r0, 0xBF - lsls r0, 1 - adds r1, r0 - adds r1, r4 - ldrb r0, [r1] - orrs r0, r2 - strb r0, [r1] - lsls r1, r7, 5 - movs r0, 0xD8 - subs r5, r0, r1 - ldr r0, =gUnknown_082F1D48 - adds r1, r5, 0 - movs r2, 0x90 - movs r3, 0x8 - bl AddObjectToFront - ldr r1, [r6] - add r1, r10 - adds r1, r4 - strb r0, [r1] - ldr r0, [r6] - movs r1, 0xAA - lsls r1, 1 - adds r0, r1 - adds r1, r0, r4 - ldrh r0, [r1] - cmp r0, 0 - beq _0801C5E0 - bl sub_80D2E84 - lsls r0, 16 - lsrs r0, 16 - mov r2, r9 - str r2, [sp] - str r2, [sp, 0x4] - ldr r1, =DummyObjectCallback - adds r2, r5, 0 - movs r3, 0x88 - bl sub_80D2D78 - ldr r1, [r6] - movs r2, 0xBF - lsls r2, 1 - adds r1, r2 - adds r1, r4 - strb r0, [r1] -_0801C5E0: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, [r6] - ldrb r0, [r0, 0x9] - cmp r7, r0 - bcc _0801C572 -_0801C5EE: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801C4C0 - - thumb_func_start sub_801C61C -sub_801C61C: @ 801C61C - push {r4-r7,lr} - movs r5, 0 - ldr r4, =0x02022c74 - ldr r0, [r4] - movs r2, 0xBE - lsls r2, 1 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0xFF - beq _0801C640 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl sub_80D2EF8 -_0801C640: - ldr r0, [r4] - ldrb r2, [r0, 0x9] - cmp r2, 0 - beq _0801C6B4 - ldrb r1, [r0, 0x8] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x1 - bne _0801C6B4 - cmp r5, r2 - bcs _0801C6A4 - adds r6, r4, 0 - ldr r7, =0x02020630 -_0801C65A: - ldr r0, [r6] - lsls r4, r5, 1 - ldr r1, =0x0000017d - adds r0, r1 - adds r1, r0, r4 - ldrb r0, [r1] - cmp r0, 0xFF - beq _0801C678 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - bl RemoveObjectAndFreeTiles -_0801C678: - ldr r0, [r6] - movs r2, 0xBF - lsls r2, 1 - adds r0, r2 - adds r1, r0, r4 - ldrb r0, [r1] - cmp r0, 0xFF - beq _0801C696 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - bl sub_80D2EF8 -_0801C696: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, [r6] - ldrb r0, [r0, 0x9] - cmp r5, r0 - bcc _0801C65A -_0801C6A4: - movs r4, 0x80 - lsls r4, 8 - adds r0, r4, 0 - bl FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag -_0801C6B4: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801C61C - - thumb_func_start sub_801C6C8 -sub_801C6C8: @ 801C6C8 - push {r4-r6,lr} - adds r4, r0, 0 - cmp r4, 0 - beq _0801C6DE - ldr r5, =0x02022c78 - ldr r0, =0x000013a4 - bl AllocZeroed - str r0, [r5] - cmp r0, 0 - bne _0801C6EC -_0801C6DE: - movs r0, 0 - b _0801C71C - .pool -_0801C6EC: - movs r6, 0xDE - lsls r6, 1 - adds r1, r4, 0 - adds r2, r6, 0 - bl memcpy - ldr r1, [r5] - ldrb r0, [r1, 0x3] - cmp r0, 0x7 - bls _0801C704 - movs r0, 0 - strb r0, [r1, 0x3] -_0801C704: - ldr r2, [r5] - adds r3, r2, r6 - ldrb r0, [r2, 0x3] - lsls r0, 4 - ldr r1, =gUnknown_082F24C8 - adds r0, r1 - str r0, [r3] - ldr r0, =0x000001c1 - adds r1, r2, r0 - movs r0, 0xFF - strb r0, [r1] - movs r0, 0x1 -_0801C71C: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_801C6C8 - - thumb_func_start sub_801C72C -sub_801C72C: @ 801C72C - push {r4,lr} - ldr r4, =0x02022c78 - ldr r0, [r4] - cmp r0, 0 - beq _0801C748 - ldr r2, =0x000013a4 - movs r1, 0 - bl memset - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] -_0801C748: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801C72C - - thumb_func_start sub_801C758 -sub_801C758: @ 801C758 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - ldr r5, =0x02022c78 - ldr r0, [r5] - cmp r0, 0 - bne _0801C778 - movs r0, 0x1 - negs r0, r0 - b _0801CA3A - .pool -_0801C778: - movs r4, 0xE0 - lsls r4, 1 - adds r0, r4 - ldrb r0, [r0] - lsrs r0, 1 - cmp r0, 0x6 - bls _0801C788 - b _0801CA04 -_0801C788: - lsls r0, 2 - ldr r1, =_0801C798 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0801C798: - .4byte _0801C7B4 - .4byte _0801C7C6 - .4byte _0801C82C - .4byte _0801C8D4 - .4byte _0801C990 - .4byte _0801C996 - .4byte _0801C9A8 -_0801C7B4: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - b _0801CA1E -_0801C7C6: - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - beq _0801C7D2 - b _0801CA38 -_0801C7D2: - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x40 - movs r1, 0xF0 - bl SetGpuReg - ldr r1, =0x00001a98 - movs r0, 0x44 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0x1F - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x1B - bl SetGpuReg - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl SetGpuRegBits - b _0801CA1E - .pool -_0801C82C: - movs r5, 0x1E - str r5, [sp] - movs r4, 0x14 - str r4, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r5, [sp] - str r4, [sp, 0x4] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r5, [sp] - str r4, [sp, 0x4] - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r5, [sp] - str r4, [sp, 0x4] - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - ldr r5, =0x02022c78 - ldr r0, [r5] - movs r1, 0xDE - lsls r1, 1 - adds r0, r1 - ldr r0, [r0] - ldr r1, [r0, 0x4] - movs r0, 0 - str r0, [sp] - movs r0, 0x3 - movs r2, 0 - movs r3, 0x8 - bl decompress_and_copy_tile_data_to_vram - ldr r4, =gUnknown_082F1DE8 - adds r0, r4, 0 - bl AddWindow - ldr r1, [r5] - movs r2, 0xE4 - lsls r2, 1 - adds r1, r2 - strh r0, [r1] - adds r4, 0x8 - adds r0, r4, 0 - bl AddWindow - ldr r1, [r5] - movs r3, 0xE5 - lsls r3, 1 - adds r1, r3 - strh r0, [r1] - b _0801CA1E - .pool -_0801C8D4: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0 - beq _0801C8E2 - b _0801CA38 -_0801C8E2: - movs r0, 0x1 - bl stdpal_get - movs r1, 0x20 - movs r2, 0x20 - bl gpu_pal_apply - ldr r2, =0x02037fd4 - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x8] - ldr r0, =0x02022c78 - mov r8, r0 - ldr r0, [r0] - movs r4, 0xDE - lsls r4, 1 - adds r0, r4 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x10 - movs r2, 0x20 - bl gpu_pal_apply - mov r2, r8 - ldr r1, [r2] - adds r4, r1, r4 - ldr r0, [r4] - ldr r0, [r0, 0x8] - movs r6, 0xE9 - lsls r6, 2 - adds r1, r6 - bl LZ77UnCompWram - mov r3, r8 - ldr r1, [r3] - adds r1, r6 - movs r4, 0x1E - str r4, [sp] - movs r5, 0x3 - str r5, [sp, 0x4] - str r7, [sp, 0x8] - str r7, [sp, 0xC] - str r4, [sp, 0x10] - str r5, [sp, 0x14] - movs r0, 0x1 - mov r10, r0 - str r0, [sp, 0x18] - movs r2, 0x8 - mov r9, r2 - str r2, [sp, 0x1C] - str r7, [sp, 0x20] - movs r2, 0 - movs r3, 0 - bl CopyRectToBgTilemapBufferRect - mov r3, r8 - ldr r1, [r3] - adds r1, r6 - str r4, [sp] - movs r0, 0x17 - str r0, [sp, 0x4] - str r7, [sp, 0x8] - str r5, [sp, 0xC] - str r4, [sp, 0x10] - str r0, [sp, 0x14] - mov r0, r10 - str r0, [sp, 0x18] - mov r2, r9 - str r2, [sp, 0x1C] - str r7, [sp, 0x20] - movs r0, 0x3 - movs r2, 0 - movs r3, 0x3 - bl CopyRectToBgTilemapBufferRect - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - b _0801CA1E - .pool -_0801C990: - bl sub_801CDCC - b _0801CA1E -_0801C996: - bl sub_801CE7C - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - b _0801CA1E -_0801C9A8: - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x8] - ldr r4, =0x02022c78 - ldr r1, [r4] - movs r3, 0xE5 - lsls r3, 2 - adds r0, r1, r3 - movs r2, 0xE3 - lsls r2, 1 - adds r1, r2 - bl AddScrollIndicatorArrowPair - ldr r1, [r4] - ldr r3, =0x000001c1 - adds r2, r1, r3 - movs r1, 0 - strb r0, [r2] - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - bl fade_and_return_progress_probably - b _0801CA1E - .pool -_0801CA04: - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - bne _0801CA38 - ldr r0, [r5] - adds r0, r4 - ldrb r2, [r0] - movs r1, 0x1 - ands r1, r2 - strb r1, [r0] - movs r0, 0x1 - b _0801CA3A -_0801CA1E: - ldr r0, =0x02022c78 - ldr r2, [r0] - movs r0, 0xE0 - lsls r0, 1 - adds r2, r0 - ldrb r3, [r2] - lsrs r1, r3, 1 - adds r1, 0x1 - lsls r1, 1 - movs r0, 0x1 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] -_0801CA38: - movs r0, 0 -_0801CA3A: - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_801C758 - - thumb_func_start sub_801CA50 -sub_801CA50: @ 801CA50 - push {r4,r5,lr} - sub sp, 0x8 - adds r2, r0, 0 - ldr r5, =0x02022c78 - ldr r0, [r5] - cmp r0, 0 - bne _0801CA68 - movs r0, 0x1 - negs r0, r0 - b _0801CC2A - .pool -_0801CA68: - movs r4, 0xE0 - lsls r4, 1 - adds r0, r4 - ldrb r0, [r0] - lsrs r0, 1 - cmp r0, 0x5 - bls _0801CA78 - b _0801CBF4 -_0801CA78: - lsls r0, 2 - ldr r1, =_0801CA88 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0801CA88: - .4byte _0801CAA0 - .4byte _0801CAB2 - .4byte _0801CAF4 - .4byte _0801CB54 - .4byte _0801CB84 - .4byte _0801CBC0 -_0801CAA0: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - b _0801CC0E -_0801CAB2: - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - beq _0801CABE - b _0801CC28 -_0801CABE: - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x40 - movs r1, 0 - bl SetGpuReg - movs r0, 0x44 - movs r1, 0 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4A - movs r1, 0 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl ClearGpuRegBits - b _0801CC0E -_0801CAF4: - movs r4, 0x1E - str r4, [sp] - movs r5, 0x14 - str r5, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r4, [sp] - str r5, [sp, 0x4] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r4, [sp] - movs r5, 0x18 - str r5, [sp, 0x4] - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r4, [sp] - str r5, [sp, 0x4] - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - b _0801CC0E -_0801CB54: - movs r0, 0x1 - bl HideBg - movs r0, 0x2 - bl HideBg - ldr r4, =0x02022c78 - ldr r0, [r4] - movs r1, 0xE5 - lsls r1, 1 - adds r0, r1 - ldrb r0, [r0] - bl RemoveWindow - ldr r0, [r4] - movs r2, 0xE4 - lsls r2, 1 - adds r0, r2 - ldrb r0, [r0] - bl RemoveWindow - b _0801CC0E - .pool -_0801CB84: - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - ldr r4, =0x02022c78 - ldr r0, [r4] - ldr r2, =0x000001c1 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0xFF - beq _0801CC0E - bl RemoveScrollIndicatorArrowPair - ldr r0, [r4] - ldr r2, =0x000001c1 - adds r1, r0, r2 - movs r0, 0xFF - strb r0, [r1] - b _0801CC0E - .pool -_0801CBC0: - ldr r0, =0x02022c60 - ldrb r0, [r0] - adds r1, r2, 0 - bl sub_80186EC - movs r0, 0x3 - bl sub_8018798 - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - b _0801CC0E - .pool -_0801CBF4: - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - bne _0801CC28 - ldr r0, [r5] - adds r0, r4 - ldrb r2, [r0] - movs r1, 0x1 - ands r1, r2 - strb r1, [r0] - movs r0, 0x1 - b _0801CC2A -_0801CC0E: - ldr r0, =0x02022c78 - ldr r2, [r0] - movs r0, 0xE0 - lsls r0, 1 - adds r2, r0 - ldrb r3, [r2] - lsrs r1, r3, 1 - adds r1, 0x1 - lsls r1, 1 - movs r0, 0x1 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] -_0801CC28: - movs r0, 0 -_0801CC2A: - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_801CA50 - - thumb_func_start sub_801CC38 -sub_801CC38: @ 801CC38 - push {r4,r5,lr} - ldr r4, =0x02022c78 - ldr r2, [r4] - movs r5, 0xE0 - lsls r5, 1 - adds r0, r2, r5 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0801CC72 - ldr r0, =0x000001c1 - adds r1, r2, r0 - ldrb r0, [r1] - cmp r0, 0xFF - beq _0801CC72 - bl RemoveScrollIndicatorArrowPair - ldr r0, [r4] - ldr r2, =0x000001c1 - adds r1, r0, r2 - movs r0, 0xFF - strb r0, [r1] - ldr r1, [r4] - adds r1, r5 - ldrb r0, [r1] - movs r2, 0x1 - orrs r0, r2 - strb r0, [r1] -_0801CC72: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801CC38 - - thumb_func_start sub_801CC80 -sub_801CC80: @ 801CC80 - push {r4,lr} - ldr r4, =0x02022c78 - ldr r2, [r4] - movs r1, 0xE0 - lsls r1, 1 - adds r0, r2, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0801CCC0 - movs r3, 0xE5 - lsls r3, 2 - adds r0, r2, r3 - movs r3, 0xE3 - lsls r3, 1 - adds r1, r2, r3 - bl AddScrollIndicatorArrowPair - ldr r1, [r4] - ldr r2, =0x000001c1 - adds r1, r2 - strb r0, [r1] - ldr r1, [r4] - movs r3, 0xE0 - lsls r3, 1 - adds r1, r3 - ldrb r2, [r1] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - strb r0, [r1] -_0801CCC0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801CC80 - - thumb_func_start sub_801CCD0 -sub_801CCD0: @ 801CCD0 - push {r4-r6,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r3, r4, 0 - ldr r2, =0x02022c78 - ldr r0, [r2] - mov r12, r0 - movs r0, 0xE1 - lsls r0, 1 - add r0, r12 - ldrb r1, [r0] - movs r5, 0x1 - adds r0, r5, 0 - ands r0, r1 - adds r6, r2, 0 - cmp r0, 0 - beq _0801CD00 - bl sub_801CFA4 -_0801CCF6: - movs r0, 0xFF - b _0801CDC6 - .pool -_0801CD00: - cmp r4, 0x2 - beq _0801CD1C - cmp r4, 0x2 - bgt _0801CD0E - cmp r4, 0x1 - beq _0801CD18 - b _0801CCF6 -_0801CD0E: - cmp r3, 0x40 - beq _0801CD20 - cmp r3, 0x80 - beq _0801CD50 - b _0801CCF6 -_0801CD18: - movs r0, 0 - b _0801CDC6 -_0801CD1C: - movs r0, 0x1 - b _0801CDC6 -_0801CD20: - movs r0, 0xE3 - lsls r0, 1 - add r0, r12 - ldrh r0, [r0] - cmp r0, 0 - beq _0801CCF6 - movs r0, 0xE0 - lsls r0, 1 - add r0, r12 - ldrb r1, [r0] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - bne _0801CCF6 - ldr r2, =0x000001c3 - add r2, r12 - ldrb r1, [r2] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - b _0801CD7E - .pool -_0801CD50: - movs r0, 0xE3 - lsls r0, 1 - add r0, r12 - movs r1, 0xE2 - lsls r1, 1 - add r1, r12 - ldrh r0, [r0] - ldrh r1, [r1] - cmp r0, r1 - beq _0801CCF6 - movs r0, 0xE0 - lsls r0, 1 - add r0, r12 - ldrb r1, [r0] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - bne _0801CCF6 - ldr r2, =0x000001c3 - add r2, r12 - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 -_0801CD7E: - strb r0, [r2] - ldr r2, [r6] - movs r4, 0xE1 - lsls r4, 1 - adds r2, r4 - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - ldr r3, [r6] - adds r3, r4 - ldrb r1, [r3] - movs r2, 0x1 - adds r0, r2, 0 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r3] - ldr r1, [r6] - adds r4, 0x1 - adds r1, r4 - ldrb r3, [r1] - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - ldr r0, [r6] - adds r0, r4 - ldrb r0, [r0] - ands r2, r0 - cmp r2, 0 - beq _0801CDC4 - movs r0, 0x3 - b _0801CDC6 - .pool -_0801CDC4: - movs r0, 0x2 -_0801CDC6: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_801CCD0 - - thumb_func_start sub_801CDCC -sub_801CDCC: @ 801CDCC - push {r4-r6,lr} - movs r5, 0 - ldr r4, =0x02022c78 - ldr r1, [r4] - movs r2, 0xE7 - lsls r2, 1 - adds r0, r1, r2 - adds r1, 0x4 - movs r2, 0x28 - bl memcpy - ldr r0, [r4] - movs r3, 0xFB - lsls r3, 1 - adds r1, r0, r3 - movs r0, 0xFF - strb r0, [r1] - adds r6, r4, 0 -_0801CDF0: - ldr r2, [r6] - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r4, r1, r5 - adds r0, r4, r2 - ldr r3, =0x000001f7 - adds r0, r3 - adds r1, r2 - adds r1, 0x2C - movs r2, 0x28 - bl memcpy - ldr r0, [r6] - ldr r1, =0x0000021f - adds r0, r1 - adds r0, r4 - movs r1, 0xFF - strb r1, [r0] - cmp r5, 0x7 - bls _0801CE34 - ldr r1, [r6] - ldr r2, =0x000001f7 - adds r0, r1, r2 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0xFF - beq _0801CE34 - movs r3, 0xE2 - lsls r3, 1 - adds r1, r3 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_0801CE34: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x9 - bls _0801CDF0 - ldr r2, =0x02022c78 - ldr r1, [r2] - movs r4, 0xE5 - lsls r4, 2 - adds r1, r4 - ldr r0, =gUnknown_082F1DF8 - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - ldr r0, [r0] - str r0, [r1] - ldr r2, [r2] - movs r5, 0xE2 - lsls r5, 1 - adds r0, r2, r5 - ldrh r1, [r0] - movs r3, 0xE7 - lsls r3, 2 - adds r0, r2, r3 - strh r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801CDCC - - thumb_func_start sub_801CE7C -sub_801CE7C: @ 801CE7C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - movs r5, 0 - ldr r6, =0x02022c78 - ldr r0, [r6] - movs r7, 0xE4 - lsls r7, 1 - adds r0, r7 - ldrb r0, [r0] - bl PutWindowTilemap - ldr r0, [r6] - movs r4, 0xE5 - lsls r4, 1 - adds r0, r4 - ldrb r0, [r0] - bl PutWindowTilemap - ldr r0, [r6] - adds r0, r7 - ldrb r0, [r0] - movs r1, 0 - bl FillWindowPixelBuffer - ldr r0, [r6] - adds r0, r4 - ldrb r0, [r0] - movs r1, 0 - bl FillWindowPixelBuffer - ldr r4, [r6] - movs r0, 0xE7 - lsls r0, 1 - mov r8, r0 - add r4, r8 - movs r0, 0x3 - movs r1, 0x2 - bl GetFontAttribute - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x3 - adds r1, r4, 0 - bl GetStringWidth - movs r1, 0xE0 - subs r1, r0 - lsrs r0, r1, 31 - adds r1, r0 - asrs r1, 1 - cmp r1, 0 - bge _0801CEEC - movs r1, 0 -_0801CEEC: - ldr r4, [r6] - adds r0, r4, r7 - ldrb r0, [r0] - lsls r2, r1, 24 - lsrs r2, 24 - movs r3, 0xDE - lsls r3, 1 - adds r1, r4, r3 - ldr r1, [r1] - ldrb r1, [r1] - lsls r1, 28 - lsrs r1, 28 - lsls r3, r1, 1 - adds r3, r1 - ldr r1, =gUnknown_082F1DE0 - adds r3, r1 - str r3, [sp] - str r5, [sp, 0x4] - add r4, r8 - str r4, [sp, 0x8] - movs r1, 0x3 - movs r3, 0x6 - bl box_print -_0801CF1C: - ldr r6, =0x02022c78 - ldr r4, [r6] - movs r1, 0xE5 - lsls r1, 1 - adds r0, r4, r1 - ldrb r0, [r0] - lsls r3, r5, 4 - adds r3, 0x2 - lsls r3, 24 - lsrs r3, 24 - movs r2, 0xDE - lsls r2, 1 - adds r1, r4, r2 - ldr r1, [r1] - ldrb r1, [r1] - lsrs r1, 4 - lsls r2, r1, 1 - adds r2, r1 - ldr r1, =gUnknown_082F1DE0 - adds r2, r1 - str r2, [sp] - movs r1, 0 - str r1, [sp, 0x4] - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r5 - ldr r2, =0x000001f7 - adds r1, r2 - adds r4, r1 - str r4, [sp, 0x8] - movs r1, 0x3 - movs r2, 0 - bl box_print - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x9 - bls _0801CF1C - ldr r0, [r6] - movs r3, 0xE4 - lsls r3, 1 - adds r0, r3 - ldrb r0, [r0] - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, [r6] - movs r1, 0xE5 - lsls r1, 1 - adds r0, r1 - ldrb r0, [r0] - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801CE7C - - thumb_func_start sub_801CFA4 -sub_801CFA4: @ 801CFA4 - push {r4-r6,lr} - ldr r0, =0x02022c78 - ldr r1, [r0] - movs r2, 0xE1 - lsls r2, 1 - adds r0, r1, r2 - ldrb r0, [r0] - lsrs r4, r0, 1 - lsls r4, 8 - ldr r6, =0x000001c3 - adds r0, r1, r6 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0801CFE4 - movs r0, 0x2 - adds r1, r4, 0 - movs r2, 0x1 - bl ChangeBgY - movs r0, 0x3 - adds r1, r4, 0 - movs r2, 0x1 - bl ChangeBgY - b _0801CFF8 - .pool -_0801CFE4: - movs r0, 0x2 - adds r1, r4, 0 - movs r2, 0x2 - bl ChangeBgY - movs r0, 0x3 - adds r1, r4, 0 - movs r2, 0x2 - bl ChangeBgY -_0801CFF8: - ldr r3, =0x02022c78 - ldr r0, [r3] - ldr r2, =0x000001c3 - adds r5, r0, r2 - ldrb r4, [r5] - lsrs r1, r4, 1 - movs r6, 0xE1 - lsls r6, 1 - adds r0, r6 - ldrb r0, [r0] - lsrs r0, 1 - adds r1, r0 - lsls r1, 1 - movs r6, 0x1 - adds r0, r6, 0 - ands r0, r4 - orrs r0, r1 - strb r0, [r5] - ldr r1, [r3] - adds r2, r1, r2 - ldrb r2, [r2] - lsrs r0, r2, 1 - cmp r0, 0xF - bls _0801D070 - adds r0, r6, 0 - ands r0, r2 - cmp r0, 0 - beq _0801D044 - movs r0, 0xE3 - lsls r0, 1 - adds r1, r0 - ldrh r0, [r1] - adds r0, 0x1 - b _0801D04E - .pool -_0801D044: - movs r2, 0xE3 - lsls r2, 1 - adds r1, r2 - ldrh r0, [r1] - subs r0, 0x1 -_0801D04E: - strh r0, [r1] - ldr r0, [r3] - movs r6, 0xE1 - lsls r6, 1 - adds r2, r0, r6 - ldrb r1, [r2] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldr r0, [r3] - ldr r1, =0x000001c3 - adds r2, r0, r1 - ldrb r1, [r2] - movs r0, 0x1 - ands r0, r1 - strb r0, [r2] -_0801D070: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801CFA4 - - thumb_func_start mevent_srv_init_wnews -mevent_srv_init_wnews: @ 801D07C - push {r4,lr} - ldr r4, =0x02022c7c - movs r0, 0x60 - bl AllocZeroed - str r0, [r4] - ldr r1, =gUnknown_082F298C - movs r2, 0 - movs r3, 0x1 - bl mevent_srv_init_common - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end mevent_srv_init_wnews - - thumb_func_start mevent_srv_new_wcard -mevent_srv_new_wcard: @ 801D0A0 - push {r4,lr} - ldr r4, =0x02022c7c - movs r0, 0x60 - bl AllocZeroed - str r0, [r4] - ldr r1, =gUnknown_082F29EC - movs r2, 0 - movs r3, 0x1 - bl mevent_srv_init_common - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end mevent_srv_new_wcard - - thumb_func_start sub_801D0C4 -sub_801D0C4: @ 801D0C4 - push {r4-r6,lr} - adds r6, r0, 0 - ldr r4, =0x02022c7c - ldr r0, [r4] - cmp r0, 0 - bne _0801D0D8 - movs r0, 0x3 - b _0801D0F8 - .pool -_0801D0D8: - bl mevent_dispatch_08145600 - adds r5, r0, 0 - cmp r5, 0x3 - bne _0801D0F6 - ldr r0, [r4] - ldr r1, [r0, 0x4] - strh r1, [r6] - bl mevent_srv_free_resources - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] -_0801D0F6: - adds r0, r5, 0 -_0801D0F8: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_801D0C4 - - thumb_func_start mevent_srv_init_common -mevent_srv_init_common: @ 801D100 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - adds r4, r0, 0 - adds r6, r1, 0 - mov r8, r2 - mov r9, r3 - movs r5, 0 - str r5, [r4] - str r5, [r4, 0x8] - movs r0, 0xA6 - lsls r0, 1 - bl AllocZeroed - str r0, [r4, 0x18] - movs r0, 0xDE - lsls r0, 1 - bl AllocZeroed - str r0, [r4, 0x1C] - movs r0, 0x80 - lsls r0, 3 - bl AllocZeroed - str r0, [r4, 0x14] - movs r0, 0x64 - bl AllocZeroed - str r0, [r4, 0x20] - str r6, [r4, 0x10] - str r5, [r4, 0xC] - adds r4, 0x38 - adds r0, r4, 0 - mov r1, r8 - mov r2, r9 - bl sub_801D8D8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end mevent_srv_init_common - - thumb_func_start mevent_srv_free_resources -mevent_srv_free_resources: @ 801D158 - push {r4,lr} - adds r4, r0, 0 - ldr r0, [r4, 0x18] - bl Free - ldr r0, [r4, 0x1C] - bl Free - ldr r0, [r4, 0x14] - bl Free - ldr r0, [r4, 0x20] - bl Free - pop {r4} - pop {r0} - bx r0 - thumb_func_end mevent_srv_free_resources - - thumb_func_start mevent_srv_814501C -mevent_srv_814501C: @ 801D17C - push {lr} - adds r0, 0x38 - bl sub_801D904 - pop {r0} - bx r0 - thumb_func_end mevent_srv_814501C - - thumb_func_start sub_801D188 -sub_801D188: @ 801D188 - push {lr} - cmp r0, 0 - bne _0801D190 - adds r0, r1, 0 -_0801D190: - pop {r1} - bx r1 - thumb_func_end sub_801D188 - - thumb_func_start sub_801D194 -sub_801D194: @ 801D194 - push {lr} - cmp r1, r0 - bcs _0801D19E - movs r0, 0 - b _0801D1A8 -_0801D19E: - cmp r1, r0 - beq _0801D1A6 - movs r0, 0x2 - b _0801D1A8 -_0801D1A6: - movs r0, 0x1 -_0801D1A8: - pop {r1} - bx r1 - thumb_func_end sub_801D194 - - thumb_func_start sub_801D1AC -sub_801D1AC: @ 801D1AC - movs r1, 0x4 - str r1, [r0, 0x8] - movs r0, 0 - bx lr - thumb_func_end sub_801D1AC - - thumb_func_start sub_801D1B4 -sub_801D1B4: @ 801D1B4 - movs r0, 0x3 - bx lr - thumb_func_end sub_801D1B4 - - thumb_func_start sub_801D1B8 -sub_801D1B8: @ 801D1B8 - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x38 - bl sub_801D8C0 - cmp r0, 0 - beq _0801D1CA - movs r0, 0x4 - str r0, [r4, 0x8] -_0801D1CA: - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_801D1B8 - - thumb_func_start sub_801D1D4 -sub_801D1D4: @ 801D1D4 - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x38 - bl sub_801D8CC - cmp r0, 0 - beq _0801D1E6 - movs r0, 0x4 - str r0, [r4, 0x8] -_0801D1E6: - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_801D1D4 - - thumb_func_start sub_801D1F0 -sub_801D1F0: @ 801D1F0 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, [r5, 0xC] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - ldr r2, [r5, 0x10] - adds r3, r2, r1 - adds r0, 0x1 - str r0, [r5, 0xC] - ldr r0, [r3] - cmp r0, 0x1E - bls _0801D20C - b _0801D464 -_0801D20C: - lsls r0, 2 - ldr r1, =_0801D21C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0801D21C: - .4byte _0801D298 - .4byte _0801D2A2 - .4byte _0801D2A8 - .4byte _0801D2E2 - .4byte _0801D2D8 - .4byte _0801D2BA - .4byte _0801D2C6 - .4byte _0801D2EC - .4byte _0801D300 - .4byte _0801D308 - .4byte _0801D31E - .4byte _0801D32E - .4byte _0801D33A - .4byte _0801D360 - .4byte _0801D348 - .4byte _0801D390 - .4byte _0801D378 - .4byte _0801D3DC - .4byte _0801D3A8 - .4byte _0801D3C0 - .4byte _0801D3CE - .4byte _0801D406 - .4byte _0801D3EA - .4byte _0801D3F8 - .4byte _0801D40E - .4byte _0801D418 - .4byte _0801D422 - .4byte _0801D43C - .4byte _0801D450 - .4byte _0801D458 - .4byte _0801D2CC -_0801D298: - movs r0, 0x1 - str r0, [r5, 0x8] - ldr r0, [r3, 0x4] - str r0, [r5, 0x4] - b _0801D464 -_0801D2A2: - movs r0, 0x3 - str r0, [r5, 0x8] - b _0801D464 -_0801D2A8: - adds r0, r5, 0 - adds r0, 0x38 - ldr r1, [r3, 0x4] - ldr r2, [r5, 0x14] - bl sub_801D928 - movs r0, 0x2 - str r0, [r5, 0x8] - b _0801D464 -_0801D2BA: - ldr r0, [r5, 0x20] - ldr r1, [r5, 0x14] - movs r2, 0x64 - bl memcpy - b _0801D464 -_0801D2C6: - ldr r0, [r5, 0x20] - movs r1, 0 - b _0801D2D0 -_0801D2CC: - ldr r0, [r5, 0x20] - movs r1, 0x1 -_0801D2D0: - bl sub_801B6A0 - str r0, [r5, 0x4] - b _0801D464 -_0801D2D8: - ldr r1, [r5, 0x4] - ldr r0, [r3, 0x4] - cmp r1, r0 - beq _0801D2E2 - b _0801D464 -_0801D2E2: - movs r0, 0 - str r0, [r5, 0xC] - ldr r0, [r3, 0x8] - str r0, [r5, 0x10] - b _0801D464 -_0801D2EC: - ldr r0, [r3, 0x8] - ldr r1, [r5, 0x18] - bl sub_801D188 - adds r2, r0, 0 - ldr r1, [r5, 0x20] - bl sub_801B6EC - str r0, [r5, 0x4] - b _0801D464 -_0801D300: - ldr r0, [r5, 0x14] - ldr r0, [r0] - str r0, [r5, 0x4] - b _0801D464 -_0801D308: - ldr r0, [r3, 0x8] - adds r1, r5, 0 - adds r1, 0x34 - bl sub_801D188 - adds r2, r0, 0 - ldr r1, [r5, 0x20] - bl sub_801B708 - str r0, [r5, 0x4] - b _0801D464 -_0801D31E: - ldr r0, [r5, 0x20] - ldr r1, [r3, 0x4] - bl sub_801B784 - lsls r0, 16 - lsrs r0, 16 - str r0, [r5, 0x4] - b _0801D464 -_0801D32E: - ldr r0, [r5, 0x20] - ldr r1, [r3, 0x8] - bl sub_801B748 - str r0, [r5, 0x4] - b _0801D464 -_0801D33A: - ldr r0, [r3, 0x8] - ldr r1, [r5, 0x14] - ldr r1, [r1] - bl sub_801D194 - str r0, [r5, 0x4] - b _0801D464 -_0801D348: - ldr r0, [r3, 0x8] - ldr r1, [r5, 0x1C] - bl sub_801D188 - adds r2, r0, 0 - movs r3, 0xDE - lsls r3, 1 - adds r0, r5, 0 - movs r1, 0x17 - bl mevent_srv_814501C - b _0801D464 -_0801D360: - ldr r0, [r3, 0x8] - ldr r1, [r5, 0x18] - bl sub_801D188 - adds r2, r0, 0 - movs r3, 0xA6 - lsls r3, 1 - adds r0, r5, 0 - movs r1, 0x16 - bl mevent_srv_814501C - b _0801D464 -_0801D378: - ldr r0, [r3, 0x8] - adds r1, r5, 0 - adds r1, 0x34 - bl sub_801D188 - adds r2, r0, 0 - adds r0, r5, 0 - movs r1, 0x18 - movs r3, 0x4 - bl mevent_srv_814501C - b _0801D464 -_0801D390: - ldr r2, [r3, 0x8] - cmp r2, 0 - bne _0801D39C - ldr r2, [r5, 0x24] - ldr r3, [r5, 0x28] - b _0801D39E -_0801D39C: - ldr r3, [r3, 0x4] -_0801D39E: - adds r0, r5, 0 - movs r1, 0x19 - bl mevent_srv_814501C - b _0801D464 -_0801D3A8: - ldr r2, [r3, 0x8] - cmp r2, 0 - bne _0801D3B4 - ldr r2, [r5, 0x2C] - ldr r3, [r5, 0x30] - b _0801D3B6 -_0801D3B4: - ldr r3, [r3, 0x4] -_0801D3B6: - adds r0, r5, 0 - movs r1, 0x10 - bl mevent_srv_814501C - b _0801D464 -_0801D3C0: - ldr r2, [r3, 0x8] - adds r0, r5, 0 - movs r1, 0x1A - movs r3, 0xBC - bl mevent_srv_814501C - b _0801D464 -_0801D3CE: - ldr r2, [r3, 0x8] - ldr r3, [r3, 0x4] - adds r0, r5, 0 - movs r1, 0x15 - bl mevent_srv_814501C - b _0801D464 -_0801D3DC: - ldr r2, [r3, 0x8] - ldr r3, [r3, 0x4] - adds r0, r5, 0 - movs r1, 0x1C - bl mevent_srv_814501C - b _0801D464 -_0801D3EA: - ldr r0, [r5, 0x18] - ldr r1, [r3, 0x8] - movs r2, 0xA6 - lsls r2, 1 - bl memcpy - b _0801D464 -_0801D3F8: - ldr r0, [r5, 0x1C] - ldr r1, [r3, 0x8] - movs r2, 0xDE - lsls r2, 1 - bl memcpy - b _0801D464 -_0801D406: - ldr r0, [r3, 0x8] - ldr r0, [r0] - str r0, [r5, 0x34] - b _0801D464 -_0801D40E: - ldr r0, [r3, 0x8] - str r0, [r5, 0x24] - ldr r0, [r3, 0x4] - str r0, [r5, 0x28] - b _0801D464 -_0801D418: - ldr r0, [r3, 0x8] - str r0, [r5, 0x2C] - ldr r0, [r3, 0x4] - str r0, [r5, 0x30] - b _0801D464 -_0801D422: - ldr r4, [r5, 0x18] - bl sav1_get_mevent_buffer_1 - adds r1, r0, 0 - movs r2, 0xA6 - lsls r2, 1 - adds r0, r4, 0 - bl memcpy - ldr r0, [r5, 0x18] - bl sub_801B3C0 - b _0801D464 -_0801D43C: - ldr r4, [r5, 0x1C] - bl sub_801B00C - adds r1, r0, 0 - movs r2, 0xDE - lsls r2, 1 - adds r0, r4, 0 - bl memcpy - b _0801D464 -_0801D450: - bl sub_8099244 - str r0, [r5, 0x24] - b _0801D464 -_0801D458: - ldr r2, [r3, 0x8] - ldr r3, [r3, 0x4] - adds r0, r5, 0 - movs r1, 0x1B - bl mevent_srv_814501C -_0801D464: - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_801D1F0 - - thumb_func_start mevent_dispatch_08145600 -mevent_dispatch_08145600: @ 801D46C - push {lr} - ldr r2, =gUnknown_082F2548 - ldr r1, [r0, 0x8] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl _call_via_r1 - pop {r1} - bx r1 - .pool - thumb_func_end mevent_dispatch_08145600 - - thumb_func_start sub_801D484 -sub_801D484: @ 801D484 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x02022c80 - movs r0, 0x50 - bl AllocZeroed - str r0, [r4] - movs r1, 0x1 - movs r2, 0 - bl mevent_srv_ish_init - ldr r0, [r4] - str r5, [r0, 0x4C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801D484 - - thumb_func_start sub_801D4A8 -sub_801D4A8: @ 801D4A8 - push {r4-r6,lr} - adds r6, r0, 0 - ldr r4, =0x02022c80 - ldr r0, [r4] - cmp r0, 0 - bne _0801D4BC - movs r0, 0x6 - b _0801D4DC - .pool -_0801D4BC: - bl mevent_srv_ish_exec - adds r5, r0, 0 - cmp r5, 0x6 - bne _0801D4DA - ldr r0, [r4] - ldr r1, [r0, 0x4] - strh r1, [r6] - bl sub_801D55C - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] -_0801D4DA: - adds r0, r5, 0 -_0801D4DC: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_801D4A8 - - thumb_func_start sub_801D4E4 -sub_801D4E4: @ 801D4E4 - ldr r0, =0x02022c80 - ldr r1, [r0] - ldr r0, [r1, 0xC] - adds r0, 0x1 - str r0, [r1, 0xC] - bx lr - .pool - thumb_func_end sub_801D4E4 - - thumb_func_start sub_801D4F4 -sub_801D4F4: @ 801D4F4 - ldr r0, =0x02022c80 - ldr r0, [r0] - ldr r0, [r0, 0x20] - bx lr - .pool - thumb_func_end sub_801D4F4 - - thumb_func_start sub_801D500 -sub_801D500: @ 801D500 - ldr r1, =0x02022c80 - ldr r1, [r1] - str r0, [r1, 0x4] - bx lr - .pool - thumb_func_end sub_801D500 - - thumb_func_start mevent_srv_ish_init -mevent_srv_ish_init: @ 801D50C - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r4, r0, 0 - adds r6, r1, 0 - mov r8, r2 - movs r0, 0 - str r0, [r4] - str r0, [r4, 0x8] - str r0, [r4, 0xC] - movs r5, 0x80 - lsls r5, 3 - adds r0, r5, 0 - bl AllocZeroed - str r0, [r4, 0x14] - adds r0, r5, 0 - bl AllocZeroed - str r0, [r4, 0x18] - adds r0, r5, 0 - bl AllocZeroed - str r0, [r4, 0x1C] - movs r0, 0x40 - bl AllocZeroed - str r0, [r4, 0x20] - adds r4, 0x24 - adds r0, r4, 0 - adds r1, r6, 0 - mov r2, r8 - bl sub_801D8D8 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end mevent_srv_ish_init - - thumb_func_start sub_801D55C -sub_801D55C: @ 801D55C - push {r4,lr} - adds r4, r0, 0 - ldr r0, [r4, 0x14] - bl Free - ldr r0, [r4, 0x18] - bl Free - ldr r0, [r4, 0x1C] - bl Free - ldr r0, [r4, 0x20] - bl Free - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_801D55C - - thumb_func_start sub_801D580 -sub_801D580: @ 801D580 - push {r4,lr} - adds r4, r0, 0 - ldr r0, [r4, 0x1C] - ldr r1, [r4, 0x18] - movs r2, 0x80 - lsls r2, 3 - bl memcpy - movs r0, 0 - str r0, [r4, 0x10] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_801D580 - - thumb_func_start sub_801D59C -sub_801D59C: @ 801D59C - push {r4-r6,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r6, r1, 0 - adds r5, r2, 0 - movs r0, 0 - str r0, [sp] - ldr r1, [r4, 0x14] - ldr r2, =0x05000100 - mov r0, sp - bl CpuSet - ldr r2, [r4, 0x14] - str r5, [r2] - adds r4, 0x24 - adds r0, r4, 0 - adds r1, r6, 0 - movs r3, 0x4 - bl sub_801D904 - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801D59C - - thumb_func_start sub_801D5D0 -sub_801D5D0: @ 801D5D0 - push {r4,lr} - adds r4, r0, 0 - ldr r0, [r4, 0x1C] - ldr r1, =gUnknown_082F2598 - movs r2, 0x80 - lsls r2, 3 - bl memcpy - movs r1, 0 - str r1, [r4, 0x10] - movs r0, 0x4 - str r0, [r4, 0x8] - str r1, [r4, 0xC] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_801D5D0 - - thumb_func_start sub_801D5F8 -sub_801D5F8: @ 801D5F8 - movs r0, 0x6 - bx lr - thumb_func_end sub_801D5F8 - - thumb_func_start sub_801D5FC -sub_801D5FC: @ 801D5FC - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x24 - bl sub_801D8C0 - cmp r0, 0 - beq _0801D612 - movs r0, 0x4 - str r0, [r4, 0x8] - movs r0, 0 - str r0, [r4, 0xC] -_0801D612: - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_801D5FC - - thumb_func_start sub_801D61C -sub_801D61C: @ 801D61C - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x24 - bl sub_801D8CC - cmp r0, 0 - beq _0801D632 - movs r0, 0x4 - str r0, [r4, 0x8] - movs r0, 0 - str r0, [r4, 0xC] -_0801D632: - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_801D61C - - thumb_func_start sub_801D63C -sub_801D63C: @ 801D63C - push {r4,lr} - adds r4, r0, 0 - ldr r0, [r4, 0x10] - lsls r2, r0, 3 - ldr r1, [r4, 0x1C] - adds r2, r1, r2 - adds r0, 0x1 - str r0, [r4, 0x10] - ldr r0, [r2] - cmp r0, 0x15 - bls _0801D654 - b _0801D804 -_0801D654: - lsls r0, 2 - ldr r1, =_0801D664 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0801D664: - .4byte _0801D804 - .4byte _0801D6BC - .4byte _0801D6C4 - .4byte _0801D6D4 - .4byte _0801D70E - .4byte _0801D716 - .4byte _0801D6FE - .4byte _0801D708 - .4byte _0801D764 - .4byte _0801D790 - .4byte _0801D788 - .4byte _0801D72C - .4byte _0801D742 - .4byte _0801D758 - .4byte _0801D77C - .4byte _0801D7B8 - .4byte _0801D7BC - .4byte _0801D7C4 - .4byte _0801D7D0 - .4byte _0801D6EA - .4byte _0801D6D8 - .4byte _0801D7F0 -_0801D6BC: - ldr r0, [r2, 0x4] - str r0, [r4, 0x4] - movs r0, 0x1 - b _0801D7FE -_0801D6C4: - adds r0, r4, 0 - adds r0, 0x24 - ldr r1, [r2, 0x4] - ldr r2, [r4, 0x18] - bl sub_801D928 - movs r0, 0x2 - b _0801D7FE -_0801D6D4: - movs r0, 0x3 - b _0801D7FE -_0801D6D8: - adds r0, r4, 0 - adds r0, 0x24 - ldr r2, [r4, 0x14] - movs r1, 0x14 - movs r3, 0 - bl sub_801D904 - movs r0, 0x3 - b _0801D7FE -_0801D6EA: - ldrb r0, [r2, 0x4] - bl sub_80847F8 - adds r2, r0, 0 - adds r0, r4, 0 - movs r1, 0x12 - bl sub_801D59C - movs r0, 0x3 - b _0801D7FE -_0801D6FE: - ldr r0, [r4, 0x4] - cmp r0, 0 - beq _0801D706 - b _0801D804 -_0801D706: - b _0801D70E -_0801D708: - ldr r0, [r4, 0x4] - cmp r0, 0x1 - bne _0801D804 -_0801D70E: - adds r0, r4, 0 - bl sub_801D580 - b _0801D804 -_0801D716: - ldr r0, [r4, 0x20] - ldr r1, [r4, 0x18] - movs r2, 0x40 - bl memcpy - movs r0, 0x5 - str r0, [r4, 0x8] - movs r0, 0 - str r0, [r4, 0xC] - movs r0, 0x2 - b _0801D806 -_0801D72C: - ldr r0, [r4, 0x20] - ldr r1, [r4, 0x18] - movs r2, 0x40 - bl memcpy - movs r0, 0x5 - str r0, [r4, 0x8] - movs r0, 0 - str r0, [r4, 0xC] - movs r0, 0x3 - b _0801D806 -_0801D742: - ldr r0, [r4, 0x20] - ldr r1, [r4, 0x18] - movs r2, 0x40 - bl memcpy - movs r0, 0x5 - str r0, [r4, 0x8] - movs r0, 0 - str r0, [r4, 0xC] - movs r0, 0x5 - b _0801D806 -_0801D758: - movs r0, 0x5 - str r0, [r4, 0x8] - movs r0, 0 - str r0, [r4, 0xC] - movs r0, 0x4 - b _0801D806 -_0801D764: - ldr r0, [r4, 0x14] - ldr r1, [r4, 0x4C] - bl sub_801B580 - adds r0, r4, 0 - adds r0, 0x24 - ldr r2, [r4, 0x14] - movs r1, 0x11 - movs r3, 0x64 - bl sub_801D904 - b _0801D804 -_0801D77C: - ldr r2, [r4, 0x4] - adds r0, r4, 0 - movs r1, 0x13 - bl sub_801D59C - b _0801D804 -_0801D788: - ldr r0, [r4, 0x18] - bl sub_801B21C - b _0801D804 -_0801D790: - ldr r0, [r4, 0x18] - bl sub_801B1A4 - cmp r0, 0 - bne _0801D7AC - ldr r0, [r4, 0x18] - bl sub_801B078 - adds r0, r4, 0 - movs r1, 0x13 - movs r2, 0 - bl sub_801D59C - b _0801D804 -_0801D7AC: - adds r0, r4, 0 - movs r1, 0x13 - movs r2, 0x1 - bl sub_801D59C - b _0801D804 -_0801D7B8: - movs r0, 0x6 - b _0801D7FE -_0801D7BC: - ldr r0, [r4, 0x18] - bl sub_801B508 - b _0801D804 -_0801D7C4: - ldr r0, [r4, 0x18] - movs r1, 0xFA - lsls r1, 2 - bl sub_80992A0 - b _0801D804 -_0801D7D0: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000bec - adds r0, r1 - ldr r1, [r4, 0x18] - movs r2, 0xBC - bl memcpy - bl sub_81652B4 - b _0801D804 - .pool -_0801D7F0: - ldr r0, =0x0201c000 - ldr r1, [r4, 0x18] - movs r2, 0x80 - lsls r2, 3 - bl memcpy - movs r0, 0x7 -_0801D7FE: - str r0, [r4, 0x8] - movs r0, 0 - str r0, [r4, 0xC] -_0801D804: - movs r0, 0x1 -_0801D806: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_801D63C - - thumb_func_start sub_801D810 -sub_801D810: @ 801D810 - push {lr} - adds r1, r0, 0 - ldr r0, [r1, 0xC] - cmp r0, 0 - beq _0801D822 - movs r0, 0x4 - str r0, [r1, 0x8] - movs r0, 0 - str r0, [r1, 0xC] -_0801D822: - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_801D810 - - thumb_func_start sub_801D828 -sub_801D828: @ 801D828 - push {r4,lr} - adds r4, r0, 0 - ldr r0, [r4, 0xC] - cmp r0, 0 - beq _0801D838 - cmp r0, 0x1 - beq _0801D846 - b _0801D858 -_0801D838: - ldr r0, [r4, 0x18] - bl sub_8153870 - ldr r0, [r4, 0xC] - adds r0, 0x1 - str r0, [r4, 0xC] - b _0801D858 -_0801D846: - adds r0, r4, 0x4 - bl sub_8153884 - adds r1, r0, 0 - cmp r1, 0 - bne _0801D858 - movs r0, 0x4 - str r0, [r4, 0x8] - str r1, [r4, 0xC] -_0801D858: - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_801D828 - - thumb_func_start sub_801D860 -sub_801D860: @ 801D860 - push {r4,lr} - adds r4, r0, 0 - ldr r3, =0x0201c000 - adds r0, r4, 0x4 - ldr r1, =0x03005d90 - ldr r1, [r1] - ldr r2, =0x03005d8c - ldr r2, [r2] - bl _call_via_r3 - cmp r0, 0x1 - bne _0801D880 - movs r0, 0x4 - str r0, [r4, 0x8] - movs r0, 0 - str r0, [r4, 0xC] -_0801D880: - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_801D860 - - thumb_func_start mevent_srv_ish_exec -mevent_srv_ish_exec: @ 801D894 - push {r4,r5,lr} - sub sp, 0x20 - mov r2, sp - ldr r1, =gUnknown_082F255C - ldm r1!, {r3-r5} - stm r2!, {r3-r5} - ldm r1!, {r3-r5} - stm r2!, {r3-r5} - ldm r1!, {r3,r4} - stm r2!, {r3,r4} - ldr r1, [r0, 0x8] - lsls r1, 2 - add r1, sp - ldr r1, [r1] - bl _call_via_r1 - add sp, 0x20 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end mevent_srv_ish_exec - - thumb_func_start sub_801D8C0 -sub_801D8C0: @ 801D8C0 - push {lr} - ldr r1, [r0, 0x20] - bl _call_via_r1 - pop {r1} - bx r1 - thumb_func_end sub_801D8C0 - - thumb_func_start sub_801D8CC -sub_801D8CC: @ 801D8CC - push {lr} - ldr r1, [r0, 0x24] - bl _call_via_r1 - pop {r1} - bx r1 - thumb_func_end sub_801D8CC - - thumb_func_start sub_801D8D8 -sub_801D8D8: @ 801D8D8 - movs r3, 0 - strb r1, [r0, 0x4] - strb r2, [r0, 0x5] - str r3, [r0] - strh r3, [r0, 0x12] - strh r3, [r0, 0x14] - strh r3, [r0, 0x10] - strh r3, [r0, 0xA] - strh r3, [r0, 0xC] - strh r3, [r0, 0x8] - str r3, [r0, 0x1C] - str r3, [r0, 0x18] - ldr r1, =sub_801DA5C - str r1, [r0, 0x24] - ldr r1, =sub_801D988 - str r1, [r0, 0x20] - bx lr - .pool - thumb_func_end sub_801D8D8 - - thumb_func_start sub_801D904 -sub_801D904: @ 801D904 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0 - str r0, [r4] - strh r1, [r4, 0xE] - strh r0, [r4, 0x10] - strh r0, [r4, 0x12] - cmp r3, 0 - beq _0801D91A - strh r3, [r4, 0x14] - b _0801D920 -_0801D91A: - movs r0, 0x80 - lsls r0, 3 - strh r0, [r4, 0x14] -_0801D920: - str r2, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_801D904 - - thumb_func_start sub_801D928 -sub_801D928: @ 801D928 - movs r3, 0 - str r3, [r0] - strh r1, [r0, 0x6] - strh r3, [r0, 0x8] - strh r3, [r0, 0xA] - strh r3, [r0, 0xC] - str r2, [r0, 0x18] - bx lr - thumb_func_end sub_801D928 - - thumb_func_start sub_801D938 -sub_801D938: @ 801D938 - push {lr} - adds r3, r0, 0 - adds r0, r1, 0 - lsls r3, 8 - ldr r1, =0x020223c4 - adds r3, r1 - adds r1, r3, 0 - bl memcpy - pop {r0} - bx r0 - .pool - thumb_func_end sub_801D938 - - thumb_func_start sub_801D954 -sub_801D954: @ 801D954 - push {r4,lr} - adds r4, r0, 0 - bl sub_800A550 - lsls r0, 24 - lsrs r0, 24 - asrs r0, r4 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0801D96E - movs r0, 0 - b _0801D970 -_0801D96E: - movs r0, 0x1 -_0801D970: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_801D954 - - thumb_func_start sub_801D978 -sub_801D978: @ 801D978 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl sub_800A5EC - pop {r0} - bx r0 - thumb_func_end sub_801D978 - - thumb_func_start sub_801D988 -sub_801D988: @ 801D988 - push {r4-r6,lr} - sub sp, 0x8 - adds r5, r0, 0 - ldr r6, [r5] - cmp r6, 0x1 - beq _0801D9EC - cmp r6, 0x1 - bgt _0801D99E - cmp r6, 0 - beq _0801D9A4 - b _0801DA52 -_0801D99E: - cmp r6, 0x2 - beq _0801DA38 - b _0801DA52 -_0801D9A4: - ldrb r0, [r5, 0x5] - bl sub_801D954 - cmp r0, 0 - beq _0801DA52 - ldrb r0, [r5, 0x5] - mov r4, sp - mov r1, sp - movs r2, 0x8 - bl sub_801D938 - ldrh r1, [r4, 0x4] - strh r1, [r5, 0xC] - ldrh r0, [r4, 0x2] - strh r0, [r5, 0xA] - lsls r1, 16 - movs r0, 0x80 - lsls r0, 19 - cmp r1, r0 - bls _0801D9D2 -_0801D9CC: - bl sub_8010198 - b _0801DA52 -_0801D9D2: - mov r1, sp - ldrh r0, [r5, 0x6] - ldrh r1, [r1] - cmp r0, r1 - bne _0801D9CC - strh r6, [r5, 0x8] - ldrb r0, [r5, 0x5] - bl sub_801D978 - ldr r0, [r5] - adds r0, 0x1 - str r0, [r5] - b _0801DA52 -_0801D9EC: - ldrb r0, [r5, 0x5] - bl sub_801D954 - cmp r0, 0 - beq _0801DA52 - ldrh r0, [r5, 0x8] - lsls r1, r0, 6 - subs r1, r0 - lsls r3, r1, 2 - ldrh r0, [r5, 0xC] - subs r2, r0, r3 - cmp r2, 0xFC - bhi _0801DA1E - ldrb r0, [r5, 0x5] - ldr r1, [r5, 0x18] - adds r1, r3 - bl sub_801D938 - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - ldr r0, [r5] - adds r0, 0x1 - str r0, [r5] - b _0801DA30 -_0801DA1E: - ldrb r0, [r5, 0x5] - ldr r1, [r5, 0x18] - adds r1, r3 - movs r2, 0xFC - bl sub_801D938 - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] -_0801DA30: - ldrb r0, [r5, 0x5] - bl sub_801D978 - b _0801DA52 -_0801DA38: - ldr r0, [r5, 0x18] - ldrh r1, [r5, 0xC] - bl sub_806F928 - lsls r0, 16 - lsrs r0, 16 - ldrh r1, [r5, 0xA] - cmp r0, r1 - bne _0801D9CC - movs r0, 0 - str r0, [r5] - movs r0, 0x1 - b _0801DA54 -_0801DA52: - movs r0, 0 -_0801DA54: - add sp, 0x8 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_801D988 - - thumb_func_start sub_801DA5C -sub_801DA5C: @ 801DA5C - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldr r5, [r4] - cmp r5, 0x1 - beq _0801DAC8 - cmp r5, 0x1 - bgt _0801DA72 - cmp r5, 0 - beq _0801DA7C - b _0801DB5E -_0801DA72: - cmp r5, 0x2 - beq _0801DB1C - cmp r5, 0x3 - beq _0801DB46 - b _0801DB5E -_0801DA7C: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _0801DB5E - ldrh r1, [r4, 0xE] - ldr r2, =0xffff0000 - ldr r0, [sp] - ands r0, r2 - orrs r0, r1 - str r0, [sp] - ldrh r1, [r4, 0x14] - ldr r0, [sp, 0x4] - ands r0, r2 - orrs r0, r1 - str r0, [sp, 0x4] - ldr r0, [r4, 0x1C] - bl sub_806F928 - lsls r0, 16 - ldr r2, =0x0000ffff - ldr r1, [sp] - ands r1, r2 - orrs r1, r0 - str r1, [sp] - lsrs r1, 16 - strh r1, [r4, 0x12] - strh r5, [r4, 0x10] - movs r0, 0 - mov r1, sp - movs r2, 0x8 - bl link_0800A448 - b _0801DB3E - .pool -_0801DAC8: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _0801DB5E - ldrb r0, [r4, 0x4] - bl sub_801D954 - cmp r0, 0 - beq _0801DB5E - ldrb r0, [r4, 0x4] - bl sub_801D978 - ldrh r1, [r4, 0x10] - lsls r0, r1, 6 - subs r0, r1 - lsls r3, r0, 2 - ldrh r0, [r4, 0x14] - subs r0, r3 - cmp r0, 0xFC - bhi _0801DB08 - ldr r1, [r4, 0x1C] - adds r1, r3 - lsls r2, r0, 16 - lsrs r2, 16 - movs r0, 0 - bl link_0800A448 - ldrh r0, [r4, 0x10] - adds r0, 0x1 - strh r0, [r4, 0x10] - b _0801DB3E -_0801DB08: - ldr r1, [r4, 0x1C] - adds r1, r3 - movs r0, 0 - movs r2, 0xFC - bl link_0800A448 - ldrh r0, [r4, 0x10] - adds r0, 0x1 - strh r0, [r4, 0x10] - b _0801DB5E -_0801DB1C: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _0801DB5E - ldr r0, [r4, 0x1C] - ldrh r1, [r4, 0x14] - bl sub_806F928 - lsls r0, 16 - lsrs r0, 16 - ldrh r1, [r4, 0x12] - cmp r0, r1 - beq _0801DB3E - bl sub_8010198 - b _0801DB5E -_0801DB3E: - ldr r0, [r4] - adds r0, 0x1 - str r0, [r4] - b _0801DB5E -_0801DB46: - ldrb r0, [r4, 0x4] - bl sub_801D954 - cmp r0, 0 - beq _0801DB5E - ldrb r0, [r4, 0x4] - bl sub_801D978 - movs r0, 0 - str r0, [r4] - movs r0, 0x1 - b _0801DB60 -_0801DB5E: - movs r0, 0 -_0801DB60: - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_801DA5C - - thumb_func_start sub_801DB68 -sub_801DB68: @ 801DB68 - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_801B044 - adds r5, r0, 0 - movs r0, 0x3 - adds r1, r4, 0 - ands r1, r0 - ldrb r2, [r5] - movs r0, 0x4 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5] - cmp r4, 0x2 - bhi _0801DB8E - cmp r4, 0x1 - bcs _0801DB94 - b _0801DBB8 -_0801DB8E: - cmp r4, 0x3 - beq _0801DBA6 - b _0801DBB8 -_0801DB94: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xF - bl __umodsi3 - adds r0, 0x10 - b _0801DBB6 -_0801DBA6: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xF - bl __umodsi3 - adds r0, 0x1 -_0801DBB6: - strb r0, [r5, 0x1] -_0801DBB8: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_801DB68 - - thumb_func_start sub_801DBC0 -sub_801DBC0: @ 801DBC0 - push {lr} - bl sub_801B044 - movs r1, 0 - strb r1, [r0] - strb r1, [r0, 0x1] - ldr r0, =0x0000402e - bl VarSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_801DBC0 - - thumb_func_start sub_801DBDC -sub_801DBDC: @ 801DBDC - push {r4,lr} - ldr r0, =0x0000402e - bl GetVarPointer - adds r4, r0, 0 - bl sub_801B044 - adds r2, r0, 0 - ldr r0, [r2] - lsls r0, 24 - lsrs r0, 29 - cmp r0, 0x4 - bls _0801DC10 - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - lsls r0, 16 - ldr r1, =0x01f30000 - cmp r0, r1 - bls _0801DC10 - ldrb r0, [r2] - movs r1, 0x1F - ands r1, r0 - strb r1, [r2] - movs r0, 0 - strh r0, [r4] -_0801DC10: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801DBDC - - thumb_func_start sub_801DC20 -sub_801DC20: @ 801DC20 - push {r4-r6,lr} - ldr r6, =0x020375f0 - bl sub_801B044 - adds r4, r0, 0 - bl sub_809D490 - cmp r0, 0 - beq _0801DC3A - bl sub_801B0CC - cmp r0, 0 - bne _0801DC44 -_0801DC3A: - movs r0, 0 - b _0801DCA6 - .pool -_0801DC44: - adds r0, r4, 0 - bl sub_801DD44 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x6 - bhi _0801DCA4 - lsls r0, r5, 2 - ldr r1, =_0801DC60 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0801DC60: - .4byte _0801DCA4 - .4byte _0801DC7C - .4byte _0801DC7C - .4byte _0801DCA4 - .4byte _0801DC86 - .4byte _0801DC96 - .4byte _0801DCA4 -_0801DC7C: - adds r0, r4, 0 - bl sub_801DCAC - strh r0, [r6] - b _0801DCA4 -_0801DC86: - adds r0, r4, 0 - bl sub_801DCAC - strh r0, [r6] - adds r0, r4, 0 - bl sub_801DCD8 - b _0801DCA4 -_0801DC96: - adds r0, r4, 0 - bl sub_801DCAC - strh r0, [r6] - adds r0, r4, 0 - bl sub_801DCCC -_0801DCA4: - adds r0, r5, 0 -_0801DCA6: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_801DC20 - - thumb_func_start sub_801DCAC -sub_801DCAC: @ 801DCAC - push {r4,lr} - ldrb r2, [r0] - movs r1, 0x4 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - ldrb r4, [r0, 0x1] - adds r4, 0x84 - movs r1, 0 - strb r1, [r0, 0x1] - bl sub_801DD10 - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_801DCAC - - thumb_func_start sub_801DCCC -sub_801DCCC: @ 801DCCC - ldrb r2, [r0] - movs r1, 0x1D - negs r1, r1 - ands r1, r2 - strb r1, [r0] - bx lr - thumb_func_end sub_801DCCC - - thumb_func_start sub_801DCD8 -sub_801DCD8: @ 801DCD8 - push {r4,lr} - adds r3, r0, 0 - ldr r0, [r3] - lsls r0, 27 - lsrs r0, 29 - adds r0, 0x1 - movs r1, 0x7 - ands r0, r1 - lsls r0, 2 - ldrb r1, [r3] - movs r4, 0x1D - negs r4, r4 - adds r2, r4, 0 - ands r2, r1 - orrs r2, r0 - strb r2, [r3] - ldr r0, [r3] - lsls r0, 27 - lsrs r0, 29 - cmp r0, 0x4 - bls _0801DD0A - ands r2, r4 - movs r0, 0x10 - orrs r2, r0 - strb r2, [r3] -_0801DD0A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_801DCD8 - - thumb_func_start sub_801DD10 -sub_801DD10: @ 801DD10 - push {r4,lr} - adds r3, r0, 0 - ldr r0, [r3] - lsls r0, 24 - lsrs r0, 29 - adds r0, 0x1 - lsls r0, 5 - ldrb r1, [r3] - movs r4, 0x1F - adds r2, r4, 0 - ands r2, r1 - orrs r2, r0 - strb r2, [r3] - ldr r0, [r3] - lsls r0, 24 - lsrs r0, 29 - cmp r0, 0x5 - bls _0801DD3C - ands r2, r4 - movs r0, 0xA0 - orrs r2, r0 - strb r2, [r3] -_0801DD3C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_801DD10 - - thumb_func_start sub_801DD44 -sub_801DD44: @ 801DD44 - push {lr} - adds r2, r0, 0 - ldrb r1, [r2] - movs r0, 0xE0 - ands r0, r1 - cmp r0, 0xA0 - bne _0801DD56 - movs r0, 0x6 - b _0801DD92 -_0801DD56: - ldr r1, [r2] - lsls r0, r1, 30 - lsrs r0, 30 - cmp r0, 0x1 - beq _0801DD78 - cmp r0, 0x1 - bgt _0801DD6A - cmp r0, 0 - beq _0801DD74 - b _0801DD90 -_0801DD6A: - cmp r0, 0x2 - beq _0801DD7C - cmp r0, 0x3 - beq _0801DD80 - b _0801DD90 -_0801DD74: - movs r0, 0x3 - b _0801DD92 -_0801DD78: - movs r0, 0x1 - b _0801DD92 -_0801DD7C: - movs r0, 0x2 - b _0801DD92 -_0801DD80: - lsls r0, r1, 27 - lsrs r0, 29 - cmp r0, 0x2 - bhi _0801DD8C - movs r0, 0x4 - b _0801DD92 -_0801DD8C: - movs r0, 0x5 - b _0801DD92 -_0801DD90: - movs r0, 0 -_0801DD92: - pop {r1} - bx r1 - thumb_func_end sub_801DD44 - - thumb_func_start sub_801DD98 -sub_801DD98: @ 801DD98 - push {r4,lr} - ldr r4, =0x02022c84 - movs r0, 0xDE - lsls r0, 1 - bl Alloc - str r0, [r4] - bl sub_801DDD0 - ldr r1, =0x030022b0 - movs r0, 0x14 - strh r0, [r1] - movs r0, 0 - bl SetVBlankCallback - ldr r0, =c2_081284E0 - bl SetMainCallback2 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801DD98 - - thumb_func_start sub_801DDD0 -sub_801DDD0: @ 801DDD0 - push {r4-r7,lr} - adds r4, r0, 0 - movs r5, 0 - movs r0, 0 - strh r0, [r4, 0x4] - strh r0, [r4, 0x6] - strb r5, [r4, 0x10] - strb r5, [r4, 0x11] - strb r5, [r4, 0x12] - strb r5, [r4, 0x14] - strb r5, [r4, 0x15] - strb r5, [r4, 0x16] - movs r0, 0xFF - strb r0, [r4, 0x1A] - bl sub_8009FCC - strb r0, [r4, 0xD] - bl link_get_multiplayer_id - strb r0, [r4, 0x13] - strb r5, [r4, 0x17] - strb r5, [r4, 0x18] - movs r1, 0xC8 - lsls r1, 1 - adds r0, r4, r1 - bl sub_801EF1C - ldr r7, =0x03005d8c - ldr r6, =0x00003c88 - adds r4, 0xB9 - movs r5, 0x9 -_0801DE0E: - ldr r1, [r7] - adds r1, r6 - adds r0, r4, 0 - bl CopyString - adds r6, 0x15 - adds r4, 0x15 - subs r5, 0x1 - cmp r5, 0 - bge _0801DE0E - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801DDD0 - - thumb_func_start sub_801DE30 -sub_801DE30: @ 801DE30 - push {r4,lr} - ldr r4, =0x02022c84 - ldr r0, [r4] - ldrb r0, [r0, 0xE] - bl remove_task - ldr r0, [r4] - ldrb r0, [r0, 0xF] - bl remove_task - ldr r0, [r4] - bl Free - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801DE30 - - thumb_func_start c2_081284E0 -c2_081284E0: @ 801DE54 - push {r4-r6,lr} - sub sp, 0x4 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r6, r0, r1 - ldrb r0, [r6] - cmp r0, 0x1 - beq _0801DE8C - cmp r0, 0x1 - bgt _0801DE74 - cmp r0, 0 - beq _0801DE7A - b _0801DF04 - .pool -_0801DE74: - cmp r0, 0x2 - beq _0801DEC8 - b _0801DF04 -_0801DE7A: - bl clear_tasks - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - bl sub_801F4D0 - b _0801DEBC -_0801DE8C: - bl sub_801F5B8 - bl sub_801F534 - adds r5, r0, 0 - cmp r5, 0 - bne _0801DF04 - movs r4, 0x1 - negs r4, r4 - adds r0, r4, 0 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - str r5, [sp] - adds r0, r4, 0 - adds r1, r4, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r0, =sub_801DF20 - bl SetVBlankCallback -_0801DEBC: - ldrb r0, [r6] - adds r0, 0x1 - strb r0, [r6] - b _0801DF04 - .pool -_0801DEC8: - bl fade_and_return_progress_probably - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0801DF04 - ldr r0, =sub_801DF38 - bl SetMainCallback2 - ldr r0, =sub_801DF54 - movs r1, 0x8 - bl AddTask - ldr r4, =0x02022c84 - ldr r1, [r4] - strb r0, [r1, 0xE] - ldr r0, =sub_801F2B4 - movs r1, 0x7 - bl AddTask - ldr r1, [r4] - strb r0, [r1, 0xF] - bl sub_800E0E8 - movs r0, 0xE8 - movs r1, 0x96 - bl sub_800DFB4 -_0801DF04: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end c2_081284E0 - - thumb_func_start sub_801DF20 -sub_801DF20: @ 801DF20 - push {lr} - bl copy_pal_bg_faded_to_pal_ram - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl sub_80BA0A8 - pop {r0} - bx r0 - thumb_func_end sub_801DF20 - - thumb_func_start sub_801DF38 -sub_801DF38: @ 801DF38 - push {lr} - bl RunActiveTasks - bl sub_801F5B8 - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_801DF38 - - thumb_func_start sub_801DF54 -sub_801DF54: @ 801DF54 - push {r4,lr} - ldr r4, =0x02022c84 - ldr r0, [r4] - ldrb r0, [r0, 0x17] - cmp r0, 0x2 - beq _0801DF7A - cmp r0, 0x2 - bgt _0801DF70 - cmp r0, 0x1 - beq _0801DF76 - b _0801DF8A - .pool -_0801DF70: - cmp r0, 0x3 - beq _0801DF7E - b _0801DF8A -_0801DF76: - movs r0, 0x6 - b _0801DF80 -_0801DF7A: - movs r0, 0x7 - b _0801DF80 -_0801DF7E: - movs r0, 0x8 -_0801DF80: - bl sub_801EBD4 - ldr r1, [r4] - movs r0, 0 - strb r0, [r1, 0x17] -_0801DF8A: - ldr r1, =gUnknown_082F2A7C - ldr r0, =0x02022c84 - ldr r0, [r0] - ldrh r0, [r0, 0x4] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801DF54 - - thumb_func_start sub_801DFAC -sub_801DFAC: @ 801DFAC - push {r4,lr} - ldr r4, =0x02022c84 - ldr r0, [r4] - ldrh r1, [r0, 0x6] - cmp r1, 0x1 - beq _0801DFE0 - cmp r1, 0x1 - bgt _0801DFC8 - cmp r1, 0 - beq _0801DFCE - b _0801E028 - .pool -_0801DFC8: - cmp r1, 0x2 - beq _0801E018 - b _0801E028 -_0801DFCE: - movs r1, 0xC8 - lsls r1, 1 - adds r0, r1 - bl sub_801EF24 - ldr r1, [r4] - ldrh r0, [r1, 0x6] - adds r0, 0x1 - strh r0, [r1, 0x6] -_0801DFE0: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _0801E028 - bl sub_8011A9C - cmp r0, 0 - bne _0801E028 - ldr r4, =0x02022c84 - ldr r1, [r4] - movs r0, 0xC8 - lsls r0, 1 - adds r1, r0 - movs r0, 0 - movs r2, 0x28 - bl link_0800A448 - lsls r0, 24 - cmp r0, 0 - beq _0801E028 - ldr r1, [r4] - ldrh r0, [r1, 0x6] - adds r0, 0x1 - strh r0, [r1, 0x6] - b _0801E028 - .pool -_0801E018: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _0801E028 - movs r0, 0x1 - bl sub_801EBD4 -_0801E028: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_801DFAC - - thumb_func_start sub_801E030 -sub_801E030: @ 801E030 - push {r4,r5,lr} - ldr r5, =0x02022c84 - ldr r3, [r5] - ldrh r0, [r3, 0x6] - cmp r0, 0 - beq _0801E048 - cmp r0, 0x1 - beq _0801E0F6 - b _0801E118 - .pool -_0801E048: - ldr r1, =0x030022c0 - ldrh r2, [r1, 0x2E] - movs r0, 0x8 - ands r0, r2 - cmp r0, 0 - beq _0801E068 - ldrb r0, [r3, 0x15] - cmp r0, 0 - beq _0801E118 - movs r0, 0x4 - bl sub_801EBD4 - b _0801E118 - .pool -_0801E068: - movs r0, 0x4 - ands r0, r2 - cmp r0, 0 - beq _0801E078 - movs r0, 0x2 - bl sub_801EBD4 - b _0801E118 -_0801E078: - ldrh r1, [r1, 0x30] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0801E0A4 - ldrb r0, [r3, 0x15] - cmp r0, 0 - beq _0801E09C - bl sub_801ED68 - movs r0, 0x8 - movs r1, 0 - bl sub_801F5EC - ldr r1, [r5] - movs r0, 0x1 - strh r0, [r1, 0x6] - b _0801E118 -_0801E09C: - movs r0, 0x3 - bl sub_801EBD4 - b _0801E118 -_0801E0A4: - movs r4, 0x1 - adds r0, r4, 0 - ands r0, r2 - cmp r0, 0 - beq _0801E0C0 - bl sub_801EC94 - movs r0, 0x8 - movs r1, 0 - bl sub_801F5EC - movs r0, 0x2 - movs r1, 0x1 - b _0801E0EC -_0801E0C0: - movs r0, 0x80 - lsls r0, 1 - ands r0, r2 - cmp r0, 0 - beq _0801E0E0 - ldrb r0, [r3, 0x10] - cmp r0, 0x3 - beq _0801E0D8 - bl sub_801ED94 - movs r0, 0x8 - b _0801E0EA -_0801E0D8: - movs r0, 0x5 - bl sub_801EBD4 - b _0801E118 -_0801E0E0: - bl sub_801EBE4 - cmp r0, 0 - beq _0801E118 - movs r0, 0x1 -_0801E0EA: - movs r1, 0 -_0801E0EC: - bl sub_801F5EC - ldr r0, [r5] - strh r4, [r0, 0x6] - b _0801E118 -_0801E0F6: - movs r0, 0 - bl sub_801F644 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - bl sub_801F644 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r4, 0 - bne _0801E118 - cmp r1, 0 - bne _0801E118 - ldr r0, [r5] - strh r1, [r0, 0x6] -_0801E118: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_801E030 - - thumb_func_start sub_801E120 -sub_801E120: @ 801E120 - push {r4-r6,lr} - ldr r0, =0x02022c84 - ldr r0, [r0] - ldrh r0, [r0, 0x6] - cmp r0, 0x4 - bls _0801E12E - b _0801E23A -_0801E12E: - lsls r0, 2 - ldr r1, =_0801E140 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0801E140: - .4byte _0801E154 - .4byte _0801E15E - .4byte _0801E17C - .4byte _0801E208 - .4byte _0801E21C -_0801E154: - movs r0, 0x3 - movs r1, 0 - bl sub_801F5EC - b _0801E16A -_0801E15E: - movs r0, 0 - bl sub_801F644 - lsls r0, 24 - cmp r0, 0 - bne _0801E23A -_0801E16A: - ldr r0, =0x02022c84 - ldr r1, [r0] - ldrh r0, [r1, 0x6] - adds r0, 0x1 - strh r0, [r1, 0x6] - b _0801E23A - .pool -_0801E17C: - bl ProcessMenuInput - lsls r0, 24 - asrs r0, 8 - lsrs r6, r0, 16 - asrs r4, r0, 16 - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - beq _0801E1B4 - adds r0, 0x1 - cmp r4, r0 - beq _0801E1D4 - movs r0, 0x4 - movs r1, 0 - bl sub_801F5EC - ldr r5, =0x02022c84 - ldr r2, [r5] - ldrb r0, [r2, 0x10] - cmp r0, r4 - beq _0801E1DC - cmp r4, 0x3 - ble _0801E1EC - b _0801E1DC - .pool -_0801E1B4: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0801E23A - movs r0, 0x5 - bl audio_play - movs r0, 0x1 - bl MoveMenuCursor - b _0801E23A - .pool -_0801E1D4: - movs r0, 0x4 - movs r1, 0 - bl sub_801F5EC -_0801E1DC: - ldr r0, =0x02022c84 - ldr r1, [r0] - movs r0, 0x3 - strh r0, [r1, 0x6] - b _0801E23A - .pool -_0801E1EC: - movs r1, 0 - strb r1, [r2, 0x11] - ldr r0, [r5] - strb r1, [r0, 0x12] - movs r0, 0x5 - movs r1, 0x1 - bl sub_801F5EC - ldr r0, [r5] - strb r6, [r0, 0x10] - ldr r1, [r5] - movs r0, 0x4 - strh r0, [r1, 0x6] - b _0801E23A -_0801E208: - movs r0, 0 - bl sub_801F644 - lsls r0, 24 - cmp r0, 0 - bne _0801E23A - movs r0, 0x1 - bl sub_801EBD4 - b _0801E23A -_0801E21C: - movs r0, 0 - bl sub_801F644 - lsls r0, 24 - cmp r0, 0 - bne _0801E23A - movs r0, 0x1 - bl sub_801F644 - lsls r0, 24 - cmp r0, 0 - bne _0801E23A - movs r0, 0x1 - bl sub_801EBD4 -_0801E23A: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_801E120 - - thumb_func_start sub_801E240 -sub_801E240: @ 801E240 - push {r4,r5,lr} - ldr r1, =0x02022c84 - ldr r0, [r1] - ldrh r0, [r0, 0x6] - adds r2, r1, 0 - cmp r0, 0xA - bls _0801E250 - b _0801E458 -_0801E250: - lsls r0, 2 - ldr r1, =_0801E264 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0801E264: - .4byte _0801E290 - .4byte _0801E2A8 - .4byte _0801E2C4 - .4byte _0801E322 - .4byte _0801E3D4 - .4byte _0801E424 - .4byte _0801E458 - .4byte _0801E458 - .4byte _0801E378 - .4byte _0801E338 - .4byte _0801E35C -_0801E290: - movs r0, 0x6 - movs r1, 0 - bl sub_801F5EC - ldr r0, =0x02022c84 - ldr r1, [r0] - movs r0, 0x1 - strh r0, [r1, 0x6] - b _0801E458 - .pool -_0801E2A8: - movs r0, 0 - bl sub_801F644 - lsls r0, 24 - cmp r0, 0 - beq _0801E2B6 - b _0801E458 -_0801E2B6: - ldr r0, =0x02022c84 - ldr r1, [r0] - movs r0, 0x2 - strh r0, [r1, 0x6] - b _0801E458 - .pool -_0801E2C4: - bl sub_801FF08 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _0801E2E6 - cmp r1, 0 - bgt _0801E2DE - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _0801E396 - b _0801E458 -_0801E2DE: - cmp r1, 0x1 - beq _0801E2E4 - b _0801E458 -_0801E2E4: - b _0801E396 -_0801E2E6: - ldr r4, =0x02022c84 - ldr r1, [r4] - ldrb r0, [r1, 0x13] - cmp r0, 0 - bne _0801E310 - movs r2, 0xC8 - lsls r2, 1 - adds r0, r1, r2 - bl sub_801EFD0 - movs r0, 0x7 - movs r1, 0 - bl sub_801F5EC - ldr r1, [r4] - movs r0, 0x9 - strh r0, [r1, 0x6] - b _0801E458 - .pool -_0801E310: - movs r2, 0xC8 - lsls r2, 1 - adds r0, r1, r2 - bl sub_801EF7C - ldr r1, [r4] - movs r0, 0x4 - strh r0, [r1, 0x6] - b _0801E458 -_0801E322: - movs r0, 0 - bl sub_801F644 - lsls r0, 24 - cmp r0, 0 - beq _0801E330 - b _0801E458 -_0801E330: - movs r0, 0x1 - bl sub_801EBD4 - b _0801E458 -_0801E338: - movs r0, 0 - bl sub_801F644 - lsls r0, 24 - cmp r0, 0 - beq _0801E346 - b _0801E458 -_0801E346: - movs r0, 0x14 - movs r1, 0 - bl sub_801F5EC - ldr r0, =0x02022c84 - ldr r1, [r0] - movs r0, 0xA - strh r0, [r1, 0x6] - b _0801E458 - .pool -_0801E35C: - movs r0, 0 - bl sub_801F644 - lsls r0, 24 - cmp r0, 0 - beq _0801E36A - b _0801E458 -_0801E36A: - ldr r0, =0x02022c84 - ldr r1, [r0] - movs r0, 0x8 - strh r0, [r1, 0x6] - b _0801E458 - .pool -_0801E378: - bl sub_801FF08 - lsls r0, 24 - asrs r5, r0, 24 - cmp r5, 0 - beq _0801E3AC - cmp r5, 0 - bgt _0801E392 - movs r0, 0x1 - negs r0, r0 - cmp r5, r0 - beq _0801E396 - b _0801E458 -_0801E392: - cmp r5, 0x1 - bne _0801E458 -_0801E396: - movs r0, 0x7 - movs r1, 0 - bl sub_801F5EC - ldr r0, =0x02022c84 - ldr r1, [r0] - movs r0, 0x3 - strh r0, [r1, 0x6] - b _0801E458 - .pool -_0801E3AC: - bl sub_80104B0 - ldr r4, =0x02022c84 - ldr r0, [r4] - movs r1, 0xC8 - lsls r1, 1 - adds r0, r1 - bl sub_801EFD0 - ldr r0, [r4] - movs r1, 0x4 - strh r1, [r0, 0x6] - movs r2, 0xDC - lsls r2, 1 - adds r0, r2 - strh r5, [r0] - b _0801E458 - .pool -_0801E3D4: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _0801E414 - bl sub_8011A9C - cmp r0, 0 - bne _0801E414 - ldr r4, =0x02022c84 - ldr r1, [r4] - movs r0, 0xC8 - lsls r0, 1 - adds r1, r0 - movs r0, 0 - movs r2, 0x28 - bl link_0800A448 - lsls r0, 24 - cmp r0, 0 - beq _0801E414 - ldr r1, [r4] - ldrb r0, [r1, 0x13] - cmp r0, 0 - bne _0801E410 - movs r0, 0x6 - b _0801E412 - .pool -_0801E410: - movs r0, 0x5 -_0801E412: - strh r0, [r1, 0x6] -_0801E414: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _0801E458 - b _0801E42C - .pool -_0801E424: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _0801E438 -_0801E42C: - movs r0, 0x9 - bl sub_801EBD4 - b _0801E458 - .pool -_0801E438: - ldr r3, [r2] - movs r1, 0xDC - lsls r1, 1 - adds r2, r3, r1 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - lsls r0, 16 - movs r1, 0x96 - lsls r1, 17 - cmp r0, r1 - bls _0801E458 - movs r0, 0 - strh r0, [r2] - movs r0, 0x4 - strh r0, [r3, 0x6] -_0801E458: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_801E240 - - thumb_func_start sub_801E460 -sub_801E460: @ 801E460 - push {r4,lr} - ldr r1, =0x02022c84 - ldr r0, [r1] - ldrh r0, [r0, 0x6] - adds r2, r1, 0 - cmp r0, 0x7 - bls _0801E470 - b _0801E5BC -_0801E470: - lsls r0, 2 - ldr r1, =_0801E484 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0801E484: - .4byte _0801E4A4 - .4byte _0801E4C8 - .4byte _0801E4E8 - .4byte _0801E50C - .4byte _0801E540 - .4byte _0801E560 - .4byte _0801E584 - .4byte _0801E5A8 -_0801E4A4: - ldr r0, =sub_801F2B4 - bl is_function_an_active_task - lsls r0, 24 - cmp r0, 0 - beq _0801E4B2 - b _0801E5BC -_0801E4B2: - movs r0, 0x7 - movs r1, 0 - bl sub_801F5EC - ldr r0, =0x02022c84 - ldr r1, [r0] - b _0801E59A - .pool -_0801E4C8: - movs r0, 0 - bl sub_801F644 - lsls r0, 24 - cmp r0, 0 - bne _0801E5BC - movs r0, 0x12 - movs r1, 0 - bl sub_801F5EC - ldr r0, =0x02022c84 - ldr r1, [r0] - b _0801E59A - .pool -_0801E4E8: - movs r0, 0 - bl sub_801F644 - lsls r0, 24 - cmp r0, 0 - bne _0801E5BC - ldr r4, =0x02022c84 - ldr r0, [r4] - movs r1, 0xC8 - lsls r1, 1 - adds r0, r1 - bl sub_801EFA8 - ldr r1, [r4] - b _0801E59A - .pool -_0801E50C: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _0801E5BC - bl sub_8011A9C - cmp r0, 0 - bne _0801E5BC - ldr r4, =0x02022c84 - ldr r1, [r4] - movs r0, 0xC8 - lsls r0, 1 - adds r1, r0 - movs r0, 0 - movs r2, 0x28 - bl link_0800A448 - lsls r0, 24 - cmp r0, 0 - beq _0801E5BC - ldr r1, [r4] - b _0801E59A - .pool -_0801E540: - bl sub_800A550 - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _0801E5BC - bl sub_8011A9C - cmp r0, 0 - bne _0801E5BC - ldr r0, =0x02022c84 - ldr r1, [r0] - b _0801E59A - .pool -_0801E560: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _0801E5BC - bl sub_8011A9C - adds r4, r0, 0 - cmp r4, 0 - bne _0801E5BC - bl sub_800AC34 - ldr r0, =0x02022c84 - ldr r1, [r0] - strh r4, [r1, 0xA] - b _0801E59A - .pool -_0801E584: - ldr r1, [r2] - ldrh r0, [r1, 0xA] - cmp r0, 0x95 - bhi _0801E590 - adds r0, 0x1 - strh r0, [r1, 0xA] -_0801E590: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _0801E5BC - ldr r1, [r2] -_0801E59A: - ldrh r0, [r1, 0x6] - adds r0, 0x1 - strh r0, [r1, 0x6] - b _0801E5BC - .pool -_0801E5A8: - ldr r1, [r2] - ldrh r0, [r1, 0xA] - cmp r0, 0x95 - bls _0801E5B8 - movs r0, 0x9 - bl sub_801EBD4 - b _0801E5BC -_0801E5B8: - adds r0, 0x1 - strh r0, [r1, 0xA] -_0801E5BC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_801E460 - - thumb_func_start sub_801E5C4 -sub_801E5C4: @ 801E5C4 - push {r4,r5,lr} - ldr r5, =0x02022c84 - ldr r1, [r5] - ldrh r0, [r1, 0x6] - cmp r0, 0x1 - beq _0801E604 - cmp r0, 0x1 - bgt _0801E5E0 - cmp r0, 0 - beq _0801E5EA - b _0801E662 - .pool -_0801E5E0: - cmp r0, 0x2 - beq _0801E62E - cmp r0, 0x3 - beq _0801E650 - b _0801E662 -_0801E5EA: - ldr r0, =sub_801F2B4 - bl is_function_an_active_task - lsls r0, 24 - cmp r0, 0 - bne _0801E662 - movs r0, 0x7 - movs r1, 0 - bl sub_801F5EC - b _0801E640 - .pool -_0801E604: - movs r0, 0 - bl sub_801F644 - lsls r0, 24 - cmp r0, 0 - bne _0801E662 - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _0801E662 - bl sub_8011A9C - adds r4, r0, 0 - cmp r4, 0 - bne _0801E662 - bl sub_800AC34 - ldr r1, [r5] - strh r4, [r1, 0xA] - b _0801E642 -_0801E62E: - ldrh r0, [r1, 0xA] - cmp r0, 0x95 - bhi _0801E638 - adds r0, 0x1 - strh r0, [r1, 0xA] -_0801E638: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _0801E662 -_0801E640: - ldr r1, [r5] -_0801E642: - ldrh r0, [r1, 0x6] - adds r0, 0x1 - strh r0, [r1, 0x6] - b _0801E662 - .pool -_0801E650: - ldrh r0, [r1, 0xA] - cmp r0, 0x95 - bls _0801E65E - movs r0, 0x9 - bl sub_801EBD4 - b _0801E662 -_0801E65E: - adds r0, 0x1 - strh r0, [r1, 0xA] -_0801E662: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_801E5C4 - - thumb_func_start sub_801E668 -sub_801E668: @ 801E668 - push {r4,lr} - ldr r1, =0x02022c84 - ldr r0, [r1] - ldrh r0, [r0, 0x6] - adds r2, r1, 0 - cmp r0, 0x4 - bhi _0801E75C - lsls r0, 2 - ldr r1, =_0801E688 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0801E688: - .4byte _0801E69C - .4byte _0801E6C8 - .4byte _0801E6F0 - .4byte _0801E724 - .4byte _0801E748 -_0801E69C: - ldr r0, =sub_801F2B4 - bl is_function_an_active_task - lsls r0, 24 - cmp r0, 0 - bne _0801E75C - ldr r4, =0x02022c84 - ldr r0, [r4] - ldrb r0, [r0, 0x13] - cmp r0, 0 - beq _0801E6BA - movs r0, 0x7 - movs r1, 0 - bl sub_801F5EC -_0801E6BA: - ldr r1, [r4] - b _0801E73A - .pool -_0801E6C8: - movs r0, 0 - bl sub_801F644 - lsls r0, 24 - cmp r0, 0 - bne _0801E75C - ldr r4, =0x02022c84 - ldr r0, [r4] - ldrb r0, [r0, 0x13] - cmp r0, 0 - beq _0801E6E6 - movs r0, 0x13 - movs r1, 0 - bl sub_801F5EC -_0801E6E6: - ldr r1, [r4] - b _0801E73A - .pool -_0801E6F0: - movs r0, 0 - bl sub_801F644 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0801E75C - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _0801E75C - bl sub_8011A9C - adds r4, r0, 0 - cmp r4, 0 - bne _0801E75C - bl sub_800AC34 - ldr r0, =0x02022c84 - ldr r1, [r0] - strh r4, [r1, 0xA] - b _0801E73A - .pool -_0801E724: - ldr r1, [r2] - ldrh r0, [r1, 0xA] - cmp r0, 0x95 - bhi _0801E730 - adds r0, 0x1 - strh r0, [r1, 0xA] -_0801E730: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _0801E75C - ldr r1, [r2] -_0801E73A: - ldrh r0, [r1, 0x6] - adds r0, 0x1 - strh r0, [r1, 0x6] - b _0801E75C - .pool -_0801E748: - ldr r1, [r2] - ldrh r0, [r1, 0xA] - cmp r0, 0x95 - bls _0801E758 - movs r0, 0x9 - bl sub_801EBD4 - b _0801E75C -_0801E758: - adds r0, 0x1 - strh r0, [r1, 0xA] -_0801E75C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_801E668 - - thumb_func_start sub_801E764 -sub_801E764: @ 801E764 - push {r4,lr} - ldr r1, =0x02022c84 - ldr r0, [r1] - ldrh r0, [r0, 0x6] - adds r4, r1, 0 - cmp r0, 0x4 - bhi _0801E830 - lsls r0, 2 - ldr r1, =_0801E784 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0801E784: - .4byte _0801E798 - .4byte _0801E7C0 - .4byte _0801E7F4 - .4byte _0801E802 - .4byte _0801E820 -_0801E798: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _0801E7AC - movs r0, 0x1 - bl sub_801EBD4 - b _0801E830 - .pool -_0801E7AC: - ldr r0, [r4] - movs r1, 0xC8 - lsls r1, 1 - adds r0, r1 - bl sub_801EF4C - ldr r1, [r4] - ldrh r0, [r1, 0x6] - adds r0, 0x1 - strh r0, [r1, 0x6] -_0801E7C0: - bl sub_800A520 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0801E830 - bl sub_8011A9C - cmp r0, 0 - bne _0801E830 - ldr r4, =0x02022c84 - ldr r1, [r4] - movs r0, 0xC8 - lsls r0, 1 - adds r1, r0 - movs r0, 0 - movs r2, 0x28 - bl link_0800A448 - lsls r0, 24 - cmp r0, 0 - beq _0801E830 - ldr r1, [r4] - b _0801E812 - .pool -_0801E7F4: - bl sub_801EE10 - movs r0, 0x8 - movs r1, 0 - bl sub_801F5EC - b _0801E80E -_0801E802: - movs r0, 0 - bl sub_801F644 - lsls r0, 24 - cmp r0, 0 - bne _0801E830 -_0801E80E: - ldr r0, =0x02022c84 - ldr r1, [r0] -_0801E812: - ldrh r0, [r1, 0x6] - adds r0, 0x1 - strh r0, [r1, 0x6] - b _0801E830 - .pool -_0801E820: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _0801E830 - movs r0, 0x1 - bl sub_801EBD4 -_0801E830: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_801E764 - - thumb_func_start sub_801E838 -sub_801E838: @ 801E838 - push {r4,lr} - ldr r0, =0x02022c84 - ldr r0, [r0] - ldrh r0, [r0, 0x6] - cmp r0, 0x6 - bls _0801E846 - b _0801E968 -_0801E846: - lsls r0, 2 - ldr r1, =_0801E858 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0801E858: - .4byte _0801E874 - .4byte _0801E8A4 - .4byte _0801E8F8 - .4byte _0801E910 - .4byte _0801E920 - .4byte _0801E934 - .4byte _0801E94C -_0801E874: - bl sub_801EDC4 - cmp r0, 0 - beq _0801E890 - movs r0, 0x9 - movs r1, 0 - bl sub_801F5EC - ldr r0, =0x02022c84 - ldr r1, [r0] - movs r0, 0x2 - b _0801E966 - .pool -_0801E890: - movs r0, 0xD - movs r1, 0 - bl sub_801F5EC - ldr r0, =0x02022c84 - ldr r1, [r0] - movs r0, 0x5 - b _0801E966 - .pool -_0801E8A4: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0801E8CC - bl sub_801EDE0 - movs r0, 0xB - movs r1, 0 - bl sub_801F5EC - ldr r0, =0x02022c84 - ldr r1, [r0] - movs r0, 0x3 - b _0801E966 - .pool -_0801E8CC: - movs r4, 0x2 - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _0801E8DA - movs r0, 0xA - b _0801E95A -_0801E8DA: - bl sub_801EBE4 - cmp r0, 0 - beq _0801E968 - movs r0, 0x1 - movs r1, 0 - bl sub_801F5EC - ldr r0, =0x02022c84 - ldr r0, [r0] - strh r4, [r0, 0x6] - b _0801E968 - .pool -_0801E8F8: - movs r0, 0 - bl sub_801F644 - lsls r0, 24 - cmp r0, 0 - bne _0801E968 - ldr r0, =0x02022c84 - ldr r1, [r0] - movs r0, 0x1 - b _0801E966 - .pool -_0801E910: - movs r0, 0 - bl sub_801F644 - lsls r0, 24 - cmp r0, 0 - bne _0801E968 - movs r0, 0xA - b _0801E95A -_0801E920: - movs r0, 0 - bl sub_801F644 - lsls r0, 24 - cmp r0, 0 - bne _0801E968 - movs r0, 0x1 - bl sub_801EBD4 - b _0801E968 -_0801E934: - movs r0, 0 - bl sub_801F644 - lsls r0, 24 - cmp r0, 0 - bne _0801E968 - ldr r0, =0x02022c84 - ldr r1, [r0] - movs r0, 0x6 - b _0801E966 - .pool -_0801E94C: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _0801E968 - movs r0, 0x7 -_0801E95A: - movs r1, 0 - bl sub_801F5EC - ldr r0, =0x02022c84 - ldr r1, [r0] - movs r0, 0x4 -_0801E966: - strh r0, [r1, 0x6] -_0801E968: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801E838 - - thumb_func_start sub_801E978 -sub_801E978: @ 801E978 - push {r4,lr} - sub sp, 0x4 - ldr r1, =0x02022c84 - ldr r0, [r1] - ldrh r0, [r0, 0x6] - adds r4, r1, 0 - cmp r0, 0xD - bls _0801E98A - b _0801EBC2 -_0801E98A: - lsls r0, 2 - ldr r1, =_0801E99C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0801E99C: - .4byte _0801E9D4 - .4byte _0801E9EE - .4byte _0801EA14 - .4byte _0801EA58 - .4byte _0801EA7C - .4byte _0801EA98 - .4byte _0801EADC - .4byte _0801EB04 - .4byte _0801EB28 - .4byte _0801EB40 - .4byte _0801EB64 - .4byte _0801EB72 - .4byte _0801EB88 - .4byte _0801EBA8 -_0801E9D4: - ldr r1, [r4] - ldrb r0, [r1, 0x18] - cmp r0, 0 - bne _0801E9DE - b _0801EB82 -_0801E9DE: - movs r0, 0x7 - movs r1, 0 - bl sub_801F5EC - ldr r1, [r4] - movs r0, 0x1 - strh r0, [r1, 0x6] - b _0801EBC2 -_0801E9EE: - movs r0, 0 - bl sub_801F644 - lsls r0, 24 - cmp r0, 0 - beq _0801E9FC - b _0801EBC2 -_0801E9FC: - movs r0, 0xE - movs r1, 0 - bl sub_801F5EC - ldr r0, =0x02022c84 - ldr r1, [r0] - movs r0, 0x2 - strh r0, [r1, 0x6] - b _0801EBC2 - .pool -_0801EA14: - bl sub_801FF08 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _0801EA40 - cmp r1, 0 - bgt _0801EA2E - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _0801EA34 - b _0801EBC2 -_0801EA2E: - cmp r1, 0x1 - beq _0801EA34 - b _0801EBC2 -_0801EA34: - ldr r0, =0x02022c84 - ldr r1, [r0] - b _0801EB82 - .pool -_0801EA40: - movs r0, 0x7 - movs r1, 0 - bl sub_801F5EC - ldr r0, =0x02022c84 - ldr r1, [r0] - movs r0, 0x3 - strh r0, [r1, 0x6] - b _0801EBC2 - .pool -_0801EA58: - movs r0, 0 - bl sub_801F644 - lsls r0, 24 - cmp r0, 0 - beq _0801EA66 - b _0801EBC2 -_0801EA66: - movs r0, 0xF - movs r1, 0 - bl sub_801F5EC - ldr r0, =0x02022c84 - ldr r1, [r0] - movs r0, 0x4 - strh r0, [r1, 0x6] - b _0801EBC2 - .pool -_0801EA7C: - movs r0, 0 - bl sub_801F644 - lsls r0, 24 - cmp r0, 0 - beq _0801EA8A - b _0801EBC2 -_0801EA8A: - ldr r0, =0x02022c84 - ldr r1, [r0] - movs r0, 0x5 - strh r0, [r1, 0x6] - b _0801EBC2 - .pool -_0801EA98: - bl sub_801FF08 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _0801EAC4 - cmp r1, 0 - bgt _0801EAB2 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _0801EAB8 - b _0801EBC2 -_0801EAB2: - cmp r1, 0x1 - beq _0801EAB8 - b _0801EBC2 -_0801EAB8: - ldr r0, =0x02022c84 - ldr r1, [r0] - b _0801EB82 - .pool -_0801EAC4: - movs r0, 0x7 - movs r1, 0 - bl sub_801F5EC - ldr r0, =0x02022c84 - ldr r1, [r0] - movs r0, 0x6 - strh r0, [r1, 0x6] - b _0801EBC2 - .pool -_0801EADC: - movs r0, 0 - bl sub_801F644 - lsls r0, 24 - cmp r0, 0 - bne _0801EBC2 - movs r0, 0x10 - movs r1, 0 - bl sub_801F5EC - bl sub_801EE2C - ldr r0, =0x02022c84 - ldr r1, [r0] - movs r0, 0x7 - strh r0, [r1, 0x6] - b _0801EBC2 - .pool -_0801EB04: - movs r0, 0 - bl sub_801F644 - lsls r0, 24 - cmp r0, 0 - bne _0801EBC2 - bl sub_8076D5C - movs r0, 0 - bl save_game_when_memory_present - ldr r0, =0x02022c84 - ldr r1, [r0] - movs r0, 0x8 - strh r0, [r1, 0x6] - b _0801EBC2 - .pool -_0801EB28: - movs r0, 0x11 - movs r1, 0 - bl sub_801F5EC - ldr r0, =0x02022c84 - ldr r1, [r0] - movs r0, 0x9 - strh r0, [r1, 0x6] - b _0801EBC2 - .pool -_0801EB40: - movs r0, 0 - bl sub_801F644 - lsls r0, 24 - cmp r0, 0 - bne _0801EBC2 - movs r0, 0x37 - bl audio_play - bl sav2_gender2_inplace_and_xFE - ldr r0, =0x02022c84 - ldr r1, [r0] - movs r0, 0xA - strh r0, [r1, 0x6] - b _0801EBC2 - .pool -_0801EB64: - ldr r1, [r4] - movs r0, 0 - strb r0, [r1, 0x19] - ldr r1, [r4] - movs r0, 0xB - strh r0, [r1, 0x6] - b _0801EBC2 -_0801EB72: - ldr r0, [r4] - ldrb r1, [r0, 0x19] - adds r1, 0x1 - strb r1, [r0, 0x19] - ldr r1, [r4] - ldrb r0, [r1, 0x19] - cmp r0, 0x78 - bls _0801EBC2 -_0801EB82: - movs r0, 0xC - strh r0, [r1, 0x6] - b _0801EBC2 -_0801EB88: - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - str r0, [sp] - adds r0, r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x02022c84 - ldr r1, [r0] - movs r0, 0xD - strh r0, [r1, 0x6] - b _0801EBC2 - .pool -_0801EBA8: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0801EBC2 - bl sub_801F544 - bl sub_801DE30 - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 -_0801EBC2: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801E978 - - thumb_func_start sub_801EBD4 -sub_801EBD4: @ 801EBD4 - ldr r1, =0x02022c84 - ldr r1, [r1] - movs r2, 0 - strh r0, [r1, 0x4] - strh r2, [r1, 0x6] - bx lr - .pool - thumb_func_end sub_801EBD4 - - thumb_func_start sub_801EBE4 -sub_801EBE4: @ 801EBE4 - push {lr} - ldr r0, =0x030022c0 - ldrh r2, [r0, 0x30] - movs r0, 0x40 - ands r0, r2 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0 - bne _0801EC6E - movs r0, 0x80 - ands r0, r2 - cmp r0, 0 - beq _0801EC24 - ldr r0, =0x02022c84 - ldr r2, [r0] - ldr r1, =gUnknown_082F2AA4 - ldrb r0, [r2, 0x10] - adds r0, r1 - ldrb r1, [r2, 0x12] - ldrb r0, [r0] - cmp r1, r0 - bcs _0801EC20 - adds r0, r1, 0x1 - b _0801EC88 - .pool -_0801EC20: - strb r3, [r2, 0x12] - b _0801EC8A -_0801EC24: - ldr r0, =0x02022c84 - ldr r1, [r0] - ldrb r0, [r1, 0x10] - cmp r0, 0x3 - beq _0801EC6A - movs r0, 0x20 - ands r0, r2 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0 - beq _0801EC52 - ldrb r0, [r1, 0x11] - cmp r0, 0 - beq _0801EC4C - subs r0, 0x1 - strb r0, [r1, 0x11] - b _0801EC8A - .pool -_0801EC4C: - movs r0, 0x4 - strb r0, [r1, 0x11] - b _0801EC8A -_0801EC52: - movs r0, 0x10 - ands r0, r2 - cmp r0, 0 - beq _0801EC6A - ldrb r0, [r1, 0x11] - cmp r0, 0x3 - bhi _0801EC66 - adds r0, 0x1 - strb r0, [r1, 0x11] - b _0801EC8A -_0801EC66: - strb r3, [r1, 0x11] - b _0801EC8A -_0801EC6A: - movs r0, 0 - b _0801EC8C -_0801EC6E: - ldr r0, =0x02022c84 - ldr r2, [r0] - ldrb r0, [r2, 0x12] - cmp r0, 0 - beq _0801EC80 - subs r0, 0x1 - b _0801EC88 - .pool -_0801EC80: - ldr r0, =gUnknown_082F2AA4 - ldrb r1, [r2, 0x10] - adds r1, r0 - ldrb r0, [r1] -_0801EC88: - strb r0, [r2, 0x12] -_0801EC8A: - movs r0, 0x1 -_0801EC8C: - pop {r1} - bx r1 - .pool - thumb_func_end sub_801EBE4 - - thumb_func_start sub_801EC94 -sub_801EC94: @ 801EC94 - push {r4-r6,lr} - sub sp, 0x18 - ldr r0, =0x02022c84 - ldr r5, [r0] - ldrb r0, [r5, 0x10] - cmp r0, 0x3 - beq _0801ECDC - ldr r3, =gUnknown_082F2BA8 - ldrb r1, [r5, 0x12] - lsls r1, 2 - adds r2, r0, 0 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - adds r1, r3 - ldr r4, [r1] - ldrb r0, [r5, 0x11] - cmp r0, 0 - beq _0801ECCE - adds r1, r0, 0 -_0801ECBE: - ldrb r0, [r4] - cmp r0, 0xF9 - bne _0801ECC6 - adds r4, 0x1 -_0801ECC6: - adds r4, 0x1 - subs r1, 0x1 - cmp r1, 0 - bne _0801ECBE -_0801ECCE: - movs r5, 0x1 - b _0801ED02 - .pool -_0801ECDC: - ldrb r0, [r5, 0x12] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r0 - adds r1, 0xB9 - adds r1, r5, r1 - mov r0, sp - bl CopyString - movs r1, 0 - strb r1, [r0] - movs r1, 0xFF - strb r1, [r0, 0x1] - mov r4, sp - mov r0, sp - bl GetStringLength_Multibyte - adds r5, r0, 0 -_0801ED02: - ldr r6, =0x02022c84 - ldr r1, [r6] - ldrb r0, [r1, 0x15] - strb r0, [r1, 0x14] - cmp r4, 0 - beq _0801ED5A - bl sub_801EE84 - adds r2, r0, 0 - subs r5, 0x1 - movs r0, 0x1 - negs r0, r0 - cmp r5, r0 - beq _0801ED56 - ldr r0, [r6] - ldrb r0, [r0, 0x15] - cmp r0, 0xE - bhi _0801ED56 - adds r3, r6, 0 -_0801ED28: - ldrb r0, [r4] - cmp r0, 0xF9 - bne _0801ED34 - strb r0, [r2] - adds r4, 0x1 - adds r2, 0x1 -_0801ED34: - ldrb r0, [r4] - strb r0, [r2] - adds r4, 0x1 - adds r2, 0x1 - ldr r1, [r3] - ldrb r0, [r1, 0x15] - adds r0, 0x1 - strb r0, [r1, 0x15] - subs r5, 0x1 - movs r0, 0x1 - negs r0, r0 - cmp r5, r0 - beq _0801ED56 - ldr r0, [r3] - ldrb r0, [r0, 0x15] - cmp r0, 0xE - bls _0801ED28 -_0801ED56: - movs r0, 0xFF - strb r0, [r2] -_0801ED5A: - add sp, 0x18 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801EC94 - - thumb_func_start sub_801ED68 -sub_801ED68: @ 801ED68 - push {r4,lr} - ldr r4, =0x02022c84 - ldr r1, [r4] - ldrb r0, [r1, 0x15] - strb r0, [r1, 0x14] - ldr r0, [r4] - ldrb r0, [r0, 0x15] - cmp r0, 0 - beq _0801ED8A - bl sub_801EEA8 - movs r1, 0xFF - strb r1, [r0] - ldr r1, [r4] - ldrb r0, [r1, 0x15] - subs r0, 0x1 - strb r0, [r1, 0x15] -_0801ED8A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801ED68 - - thumb_func_start sub_801ED94 -sub_801ED94: @ 801ED94 - push {lr} - ldr r0, =0x02022c84 - ldr r1, [r0] - ldrb r0, [r1, 0x15] - subs r0, 0x1 - strb r0, [r1, 0x14] - bl sub_801EEA8 - adds r2, r0, 0 - ldrb r0, [r2] - cmp r0, 0xF9 - beq _0801EDB8 - ldr r1, =gUnknown_082F2AA8 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _0801EDB8 - strb r0, [r2] -_0801EDB8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_801ED94 - - thumb_func_start sub_801EDC4 -sub_801EDC4: @ 801EDC4 - push {lr} - ldr r0, =0x02022c84 - ldr r0, [r0] - ldrb r0, [r0, 0x15] - cmp r0, 0 - bne _0801EDD8 - movs r0, 0 - b _0801EDDA - .pool -_0801EDD8: - movs r0, 0x1 -_0801EDDA: - pop {r1} - bx r1 - thumb_func_end sub_801EDC4 - - thumb_func_start sub_801EDE0 -sub_801EDE0: @ 801EDE0 - push {r4,lr} - bl sub_801F114 - adds r1, r0, 0 - ldr r4, =0x02022c84 - ldr r0, [r4] - ldrb r3, [r0, 0x12] - lsls r2, r3, 2 - adds r2, r3 - lsls r2, 2 - adds r2, r3 - adds r2, 0xB9 - adds r0, r2 - bl CopyString - ldr r1, [r4] - movs r0, 0x1 - strb r0, [r1, 0x18] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801EDE0 - - thumb_func_start sub_801EE10 -sub_801EE10: @ 801EE10 - ldr r1, =0x02022c84 - ldr r2, [r1] - movs r0, 0xFF - strb r0, [r2, 0x1A] - ldr r2, [r1] - movs r3, 0 - movs r0, 0xF - strb r0, [r2, 0x14] - ldr r0, [r1] - strb r3, [r0, 0x15] - bx lr - .pool - thumb_func_end sub_801EE10 - - thumb_func_start sub_801EE2C -sub_801EE2C: @ 801EE2C - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =0x03005d8c - mov r8, r0 - ldr r7, =0x02022c84 - movs r6, 0xB9 - ldr r5, =0x00003c88 - movs r4, 0x9 -_0801EE3E: - mov r1, r8 - ldr r0, [r1] - adds r0, r5 - ldr r1, [r7] - adds r1, r6 - bl CopyString - adds r6, 0x15 - adds r5, 0x15 - subs r4, 0x1 - cmp r4, 0 - bge _0801EE3E - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801EE2C - - thumb_func_start sub_801EE6C -sub_801EE6C: @ 801EE6C - ldr r2, =0x02022c84 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r0 - adds r1, 0xB9 - ldr r0, [r2] - adds r0, r1 - bx lr - .pool - thumb_func_end sub_801EE6C - - thumb_func_start sub_801EE84 -sub_801EE84: @ 801EE84 - push {lr} - ldr r0, =0x02022c84 - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0x1A - ldrb r0, [r0, 0x1A] - cmp r0, 0xFF - beq _0801EE9C -_0801EE94: - adds r1, 0x1 - ldrb r0, [r1] - cmp r0, 0xFF - bne _0801EE94 -_0801EE9C: - adds r0, r1, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_801EE84 - - thumb_func_start sub_801EEA8 -sub_801EEA8: @ 801EEA8 - push {lr} - ldr r0, =0x02022c84 - ldr r0, [r0] - adds r2, r0, 0 - adds r2, 0x1A - adds r1, r2, 0 - ldrb r0, [r0, 0x1A] - cmp r0, 0xFF - beq _0801EECC -_0801EEBA: - adds r2, r1, 0 - ldrb r0, [r2] - cmp r0, 0xF9 - bne _0801EEC4 - adds r1, r2, 0x1 -_0801EEC4: - adds r1, 0x1 - ldrb r0, [r1] - cmp r0, 0xFF - bne _0801EEBA -_0801EECC: - adds r0, r2, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_801EEA8 - - thumb_func_start sub_801EED8 -sub_801EED8: @ 801EED8 - push {r4,lr} - ldr r4, =0x02022c84 - ldr r0, [r4] - adds r0, 0x1A - bl GetStringLength_Multibyte - adds r2, r0, 0 - ldr r0, [r4] - adds r1, r0, 0 - adds r1, 0x1A - movs r4, 0 - cmp r2, 0xA - bls _0801EF0C - subs r2, 0xA - movs r3, 0 - cmp r4, r2 - bcs _0801EF0C -_0801EEFA: - ldrb r0, [r1] - cmp r0, 0xF9 - bne _0801EF02 - adds r1, 0x1 -_0801EF02: - adds r1, 0x1 - adds r4, 0x1 - adds r3, 0x1 - cmp r3, r2 - bcc _0801EEFA -_0801EF0C: - lsls r0, r4, 16 - lsrs r0, 16 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_801EED8 - - thumb_func_start sub_801EF1C -sub_801EF1C: @ 801EF1C - movs r1, 0 - strb r1, [r0] - bx lr - thumb_func_end sub_801EF1C - - thumb_func_start sub_801EF24 -sub_801EF24: @ 801EF24 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x2 - strb r0, [r4] - adds r0, r4, 0x1 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - ldr r0, =0x02022c84 - ldr r0, [r0] - ldrb r0, [r0, 0x13] - strb r0, [r4, 0x9] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801EF24 - - thumb_func_start sub_801EF4C -sub_801EF4C: @ 801EF4C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x1 - strb r0, [r4] - adds r0, r4, 0x1 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - adds r4, 0x9 - ldr r0, =0x02022c84 - ldr r1, [r0] - adds r1, 0x1A - adds r0, r4, 0 - bl CopyString - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801EF4C - - thumb_func_start sub_801EF7C -sub_801EF7C: @ 801EF7C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x3 - strb r0, [r4] - adds r0, r4, 0x1 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - ldr r0, =0x02022c84 - ldr r0, [r0] - ldrb r0, [r0, 0x13] - strb r0, [r4, 0x9] - bl sub_8011A50 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801EF7C - - thumb_func_start sub_801EFA8 -sub_801EFA8: @ 801EFA8 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x4 - strb r0, [r4] - adds r0, r4, 0x1 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - ldr r0, =0x02022c84 - ldr r0, [r0] - ldrb r0, [r0, 0x13] - strb r0, [r4, 0x9] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801EFA8 - - thumb_func_start sub_801EFD0 -sub_801EFD0: @ 801EFD0 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x5 - strb r0, [r4] - adds r0, r4, 0x1 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - ldr r0, =0x02022c84 - ldr r0, [r0] - ldrb r0, [r0, 0x13] - strb r0, [r4, 0x9] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801EFD0 - - thumb_func_start sub_801EFF8 -sub_801EFF8: @ 801EFF8 - push {r4-r6,lr} - adds r6, r0, 0 - adds r5, r1, 0 - ldrb r0, [r5] - adds r1, r0, 0 - adds r4, r5, 0x1 - adds r5, r4, 0 - adds r5, 0x8 - cmp r0, 0x2 - beq _0801F020 - cmp r0, 0x2 - bgt _0801F016 - cmp r0, 0x1 - beq _0801F044 - b _0801F0A8 -_0801F016: - cmp r1, 0x3 - beq _0801F07A - cmp r1, 0x5 - beq _0801F06E - b _0801F0A8 -_0801F020: - ldr r0, =0x02022c84 - ldr r0, [r0] - ldrb r0, [r0, 0x13] - ldrb r1, [r4, 0x8] - cmp r0, r1 - beq _0801F0A8 - bl sub_81AFBF0 - movs r0, 0 - adds r1, r4, 0 - bl sub_81AFC0C - ldr r1, =gUnknown_085ED2A9 - b _0801F094 - .pool -_0801F044: - adds r0, r6, 0 - adds r1, r4, 0 - bl CopyString - movs r1, 0xFC - strb r1, [r0] - adds r0, 0x1 - movs r1, 0x13 - strb r1, [r0] - adds r0, 0x1 - movs r1, 0x2A - strb r1, [r0] - adds r0, 0x1 - movs r1, 0xF0 - strb r1, [r0] - adds r0, 0x1 - adds r1, r5, 0 - bl CopyString - movs r0, 0x1 - b _0801F0AA -_0801F06E: - ldr r0, =0x02022c84 - ldr r0, [r0] - adds r0, 0x79 - adds r1, r4, 0 - bl CopyString -_0801F07A: - ldr r0, =0x02022c84 - ldr r0, [r0] - ldrb r0, [r0, 0x13] - ldrb r5, [r5] - cmp r0, r5 - beq _0801F0A8 - bl sub_81AFBF0 - movs r0, 0 - adds r1, r4, 0 - bl sub_81AFC0C - ldr r1, =gUnknown_085ED2BD -_0801F094: - adds r0, r6, 0 - bl sub_81AFC28 - movs r0, 0x1 - b _0801F0AA - .pool -_0801F0A8: - movs r0, 0 -_0801F0AA: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_801EFF8 - - thumb_func_start sub_801F0B0 -sub_801F0B0: @ 801F0B0 - ldr r0, =0x02022c84 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - bx lr - .pool - thumb_func_end sub_801F0B0 - - thumb_func_start sub_801F0BC -sub_801F0BC: @ 801F0BC - ldr r2, =0x02022c84 - ldr r3, [r2] - ldrb r2, [r3, 0x11] - strb r2, [r0] - ldrb r0, [r3, 0x12] - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_801F0BC - - thumb_func_start sub_801F0D0 -sub_801F0D0: @ 801F0D0 - ldr r0, =0x02022c84 - ldr r0, [r0] - adds r0, 0x1A - bx lr - .pool - thumb_func_end sub_801F0D0 - - thumb_func_start sub_801F0DC -sub_801F0DC: @ 801F0DC - push {lr} - bl sub_801F0D0 - bl GetStringLength_Multibyte - pop {r1} - bx r1 - thumb_func_end sub_801F0DC - - thumb_func_start sub_801F0EC -sub_801F0EC: @ 801F0EC - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x02022c84 - ldr r0, [r0] - ldrb r3, [r0, 0x15] - ldrb r2, [r0, 0x14] - subs r0, r3, r2 - cmp r0, 0 - bge _0801F108 - negs r0, r0 - str r3, [r4] - b _0801F10A - .pool -_0801F108: - str r2, [r4] -_0801F10A: - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_801F0EC - - thumb_func_start sub_801F114 -sub_801F114: @ 801F114 - push {lr} - bl sub_801EED8 - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, =0x02022c84 - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0x1A - cmp r2, 0 - beq _0801F13A -_0801F12A: - ldrb r0, [r1] - cmp r0, 0xF9 - bne _0801F132 - adds r1, 0x1 -_0801F132: - adds r1, 0x1 - subs r2, 0x1 - cmp r2, 0 - bne _0801F12A -_0801F13A: - adds r0, r1, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_801F114 - - thumb_func_start sub_801F144 -sub_801F144: @ 801F144 - push {r4,lr} - bl sub_801EED8 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x02022c84 - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0x1A - movs r2, 0 - movs r3, 0 - cmp r2, r4 - bcs _0801F174 -_0801F15E: - ldrb r0, [r1] - cmp r0, 0xF9 - bne _0801F166 - adds r1, 0x1 -_0801F166: - adds r1, 0x1 - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - adds r3, 0x1 - cmp r3, r4 - bcc _0801F15E -_0801F174: - adds r0, r2, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_801F144 - - thumb_func_start sub_801F180 -sub_801F180: @ 801F180 - ldr r0, =0x02022c84 - ldr r0, [r0] - adds r0, 0x39 - bx lr - .pool - thumb_func_end sub_801F180 - - thumb_func_start sub_801F18C -sub_801F18C: @ 801F18C - ldr r0, =0x02022c84 - ldr r0, [r0] - ldrb r0, [r0, 0x16] - bx lr - .pool - thumb_func_end sub_801F18C - - thumb_func_start sub_801F198 -sub_801F198: @ 801F198 - ldr r0, =0x02022c84 - ldr r0, [r0] - ldrb r0, [r0, 0x15] - bx lr - .pool - thumb_func_end sub_801F198 - - thumb_func_start sub_801F1A4 -sub_801F1A4: @ 801F1A4 - push {lr} - bl sub_801EEA8 - ldrb r1, [r0] - cmp r1, 0xFF - bhi _0801F1BE - ldr r0, =gUnknown_082F2AA8 - adds r0, r1, r0 - ldrb r0, [r0] - cmp r0, r1 - beq _0801F1BE - cmp r0, 0 - bne _0801F1C8 -_0801F1BE: - movs r0, 0x3 - b _0801F1CA - .pool -_0801F1C8: - movs r0, 0 -_0801F1CA: - pop {r1} - bx r1 - thumb_func_end sub_801F1A4 - - thumb_func_start sub_801F1D0 -sub_801F1D0: @ 801F1D0 - ldr r0, =0x02022c84 - ldr r0, [r0] - adds r0, 0x79 - bx lr - .pool - thumb_func_end sub_801F1D0 - - thumb_func_start copy_strings_to_sav1 -copy_strings_to_sav1: @ 801F1DC - push {r4,lr} - ldr r4, =0x03005d8c - ldr r0, [r4] - ldr r1, =0x00003c88 - adds r0, r1 - ldr r1, =gUnknown_085ED40F - bl CopyString - ldr r0, [r4] - ldr r1, =0x00003c9d - adds r0, r1 - ldr r1, =gUnknown_085ED415 - bl CopyString - ldr r0, [r4] - ldr r1, =0x00003cb2 - adds r0, r1 - ldr r1, =gUnknown_085ED41D - bl CopyString - ldr r0, [r4] - ldr r1, =0x00003cc7 - adds r0, r1 - ldr r1, =gUnknown_085ED423 - bl CopyString - ldr r0, [r4] - ldr r1, =0x00003cdc - adds r0, r1 - ldr r1, =gUnknown_085ED42A - bl CopyString - ldr r0, [r4] - ldr r1, =0x00003cf1 - adds r0, r1 - ldr r1, =gUnknown_085ED430 - bl CopyString - ldr r0, [r4] - ldr r1, =0x00003d06 - adds r0, r1 - ldr r1, =gUnknown_085ED434 - bl CopyString - ldr r0, [r4] - ldr r1, =0x00003d1b - adds r0, r1 - ldr r1, =gUnknown_085ED43A - bl CopyString - ldr r0, [r4] - ldr r1, =0x00003d30 - adds r0, r1 - ldr r1, =gUnknown_085ED440 - bl CopyString - ldr r0, [r4] - ldr r1, =0x00003d45 - adds r0, r1 - ldr r1, =gUnknown_085ED44A - bl CopyString - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end copy_strings_to_sav1 - - thumb_func_start sub_801F2B4 -sub_801F2B4: @ 801F2B4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0x7 - bls _0801F2CE - b _0801F4C4 -_0801F2CE: - lsls r0, 2 - ldr r1, =_0801F2E0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0801F2E0: - .4byte _0801F300 - .4byte _0801F30E - .4byte _0801F4A8 - .4byte _0801F35C - .4byte _0801F448 - .4byte _0801F480 - .4byte _0801F494 - .4byte _0801F438 -_0801F300: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _0801F30A - b _0801F49C -_0801F30A: - movs r0, 0x1 - strh r0, [r4] -_0801F30E: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - adds r2, r0, 0 - strh r0, [r4, 0x8] - ldr r3, =0x02022c84 - ldr r0, [r3] - ldrb r1, [r0, 0xD] - movs r5, 0x8 - ldrsh r0, [r4, r5] - cmp r1, r0 - beq _0801F33C - movs r0, 0x2 - strh r0, [r4] - ldr r0, [r3] - strb r2, [r0, 0xD] - b _0801F4C4 - .pool -_0801F33C: - bl sub_800A550 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x6] - cmp r0, 0 - bne _0801F354 - bl sub_8011A9C - cmp r0, 0 - beq _0801F354 - b _0801F4C4 -_0801F354: - movs r0, 0 - strh r0, [r4, 0x2] - movs r0, 0x3 - strh r0, [r4] -_0801F35C: - movs r1, 0x2 - ldrsh r0, [r4, r1] - cmp r0, 0x4 - bgt _0801F396 - movs r2, 0x6 - ldrsh r0, [r4, r2] - movs r3, 0x2 - ldrsh r1, [r4, r3] - asrs r0, r1 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0801F396 - movs r2, 0x1 -_0801F378: - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bgt _0801F396 - movs r5, 0x6 - ldrsh r0, [r4, r5] - movs r3, 0x2 - ldrsh r1, [r4, r3] - asrs r0, r1 - ands r0, r2 - cmp r0, 0 - beq _0801F378 -_0801F396: - ldrh r1, [r4, 0x2] - movs r5, 0x2 - ldrsh r0, [r4, r5] - cmp r0, 0x5 - bne _0801F3A2 - b _0801F4C0 -_0801F3A2: - strh r1, [r4, 0x4] - lsls r0, r1, 24 - lsrs r0, 24 - bl sub_800A5EC - movs r1, 0x2 - ldrsh r0, [r4, r1] - lsls r0, 8 - ldr r1, =0x020223c4 - adds r0, r1 - ldrb r0, [r0] - subs r0, 0x1 - cmp r0, 0x4 - bhi _0801F3E4 - lsls r0, 2 - ldr r1, =_0801F3D0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0801F3D0: - .4byte _0801F3E4 - .4byte _0801F3E8 - .4byte _0801F3EC - .4byte _0801F3F0 - .4byte _0801F3F4 -_0801F3E4: - movs r0, 0x3 - b _0801F3F6 -_0801F3E8: - movs r0, 0x3 - b _0801F3F6 -_0801F3EC: - movs r0, 0x4 - b _0801F3F6 -_0801F3F0: - movs r0, 0x5 - b _0801F3F6 -_0801F3F4: - movs r0, 0x6 -_0801F3F6: - strh r0, [r4, 0xA] - ldr r5, =0x02022c84 - ldr r0, [r5] - adds r0, 0x39 - movs r2, 0x2 - ldrsh r1, [r4, r2] - lsls r1, 8 - ldr r2, =0x020223c4 - adds r1, r2 - bl sub_801EFF8 - cmp r0, 0 - beq _0801F42C - ldr r0, [r5] - ldrh r1, [r4, 0x2] - strb r1, [r0, 0x16] - movs r0, 0xC - movs r1, 0x2 - bl sub_801F5EC - movs r0, 0x7 - b _0801F42E - .pool -_0801F42C: - ldrh r0, [r4, 0xA] -_0801F42E: - strh r0, [r4] - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] - b _0801F4C4 -_0801F438: - movs r0, 0x2 - bl sub_801F644 - lsls r0, 24 - cmp r0, 0 - bne _0801F4C4 - ldrh r0, [r4, 0xA] - b _0801F4C2 -_0801F448: - ldr r6, =0x02022c84 - ldr r0, [r6] - ldrb r0, [r0, 0x13] - cmp r0, 0 - bne _0801F47C - movs r3, 0x4 - ldrsh r0, [r4, r3] - cmp r0, 0 - beq _0801F47C - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _0801F474 - bl sub_80104B0 - ldr r1, [r6] - movs r0, 0x1 - b _0801F49A - .pool -_0801F474: - movs r5, 0x4 - ldrsh r0, [r4, r5] - bl sub_8011DE0 -_0801F47C: - movs r0, 0x3 - b _0801F4C2 -_0801F480: - ldr r0, =0x02022c84 - ldr r1, [r0] - ldrb r0, [r1, 0x13] - cmp r0, 0 - beq _0801F49C - movs r0, 0x2 - b _0801F49A - .pool -_0801F494: - ldr r0, =0x02022c84 - ldr r1, [r0] - movs r0, 0x3 -_0801F49A: - strb r0, [r1, 0x17] -_0801F49C: - adds r0, r5, 0 - bl remove_task - b _0801F4C4 - .pool -_0801F4A8: - bl sub_8011A9C - cmp r0, 0 - bne _0801F4C4 - ldr r0, =0x02022c84 - ldr r1, [r0] - ldrb r0, [r1, 0x13] - cmp r0, 0 - bne _0801F4C0 - ldrb r0, [r1, 0xD] - bl sub_80110B8 -_0801F4C0: - movs r0, 0x1 -_0801F4C2: - strh r0, [r4] -_0801F4C4: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801F2B4 - - thumb_func_start sub_801F4D0 -sub_801F4D0: @ 801F4D0 - push {r4,lr} - ldr r4, =0x02022c88 - ldr r0, =0x00002168 - bl Alloc - str r0, [r4] - cmp r0, 0 - beq _0801F52C - bl sub_8020890 - cmp r0, 0 - beq _0801F52C - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_082F2C60 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - ldr r0, =gUnknown_082F2C70 - bl InitWindows - bl reset_temp_tile_data_buffers - bl sub_8020770 - ldr r0, [r4] - bl sub_801F574 - bl sub_801F580 - movs r0, 0 - movs r1, 0 - bl sub_801F5EC - movs r0, 0x1 - b _0801F52E - .pool -_0801F52C: - movs r0, 0 -_0801F52E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_801F4D0 - - thumb_func_start sub_801F534 -sub_801F534: @ 801F534 - push {lr} - movs r0, 0 - bl sub_801F644 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_801F534 - - thumb_func_start sub_801F544 -sub_801F544: @ 801F544 - push {r4,lr} - bl sub_80208D0 - ldr r4, =0x02022c88 - ldr r0, [r4] - cmp r0, 0 - beq _0801F55A - bl Free - movs r0, 0 - str r0, [r4] -_0801F55A: - bl FreeAllWindowBuffers - ldr r1, =0x02039b28 - movs r0, 0x3 - strb r0, [r1, 0x15] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801F544 - - thumb_func_start sub_801F574 -sub_801F574: @ 801F574 - movs r2, 0 - movs r1, 0xFF - strh r1, [r0, 0x18] - strh r1, [r0, 0x1E] - strh r2, [r0, 0x1A] - bx lr - thumb_func_end sub_801F574 - - thumb_func_start sub_801F580 -sub_801F580: @ 801F580 - push {r4,r5,lr} - ldr r1, =0x02022c88 - ldr r0, [r1] - cmp r0, 0 - beq _0801F5A8 - movs r2, 0 - adds r4, r1, 0 - ldr r5, =sub_801FDD8 - movs r3, 0 -_0801F592: - ldr r0, [r4] - lsls r1, r2, 3 - adds r0, r1 - str r5, [r0] - strb r3, [r0, 0x4] - ldr r0, [r4] - adds r0, r1 - strb r3, [r0, 0x5] - adds r2, 0x1 - cmp r2, 0x2 - ble _0801F592 -_0801F5A8: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801F580 - - thumb_func_start sub_801F5B8 -sub_801F5B8: @ 801F5B8 - push {r4-r6,lr} - ldr r1, =0x02022c88 - ldr r0, [r1] - cmp r0, 0 - beq _0801F5E0 - movs r5, 0 - adds r6, r1, 0 -_0801F5C6: - ldr r1, [r6] - lsls r4, r5, 3 - adds r1, r4 - adds r0, r1, 0x5 - ldr r1, [r1] - bl _call_via_r1 - ldr r1, [r6] - adds r1, r4 - strb r0, [r1, 0x4] - adds r5, 0x1 - cmp r5, 0x2 - ble _0801F5C6 -_0801F5E0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801F5B8 - - thumb_func_start sub_801F5EC -sub_801F5EC: @ 801F5EC - push {r4-r7,lr} - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 24 - ldr r3, =0x02022c88 - ldr r0, [r3] - lsrs r1, 21 - adds r0, r1 - ldr r2, =sub_801FDD8 - str r2, [r0] - movs r4, 0 - adds r5, r3, 0 - adds r3, r1, 0 - mov r12, r4 - ldr r1, =gUnknown_082F2C98 - movs r7, 0x1 - adds r2, r1, 0x4 -_0801F60E: - ldrh r0, [r1] - cmp r0, r6 - bne _0801F634 - ldr r1, [r5] - adds r1, r3 - ldr r0, [r2] - str r0, [r1] - strb r7, [r1, 0x4] - ldr r0, [r5] - adds r0, r3 - mov r1, r12 - strb r1, [r0, 0x5] - b _0801F63E - .pool -_0801F634: - adds r1, 0x8 - adds r2, 0x8 - adds r4, 0x1 - cmp r4, 0x14 - bls _0801F60E -_0801F63E: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_801F5EC - - thumb_func_start sub_801F644 -sub_801F644: @ 801F644 - lsls r0, 24 - ldr r1, =0x02022c88 - ldr r1, [r1] - lsrs r0, 21 - adds r1, r0 - ldrb r0, [r1, 0x4] - bx lr - .pool - thumb_func_end sub_801F644 - - thumb_func_start sub_801F658 -sub_801F658: @ 801F658 - push {r4,lr} - adds r4, r0, 0 - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0801F6EE - ldrb r0, [r4] - cmp r0, 0x6 - bhi _0801F6E4 - lsls r0, 2 - ldr r1, =_0801F67C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0801F67C: - .4byte _0801F698 - .4byte _0801F6A2 - .4byte _0801F6A8 - .4byte _0801F6AE - .4byte _0801F6B4 - .4byte _0801F6BA - .4byte _0801F6CC -_0801F698: - bl sub_8020480 - bl sub_8020538 - b _0801F6E8 -_0801F6A2: - bl sub_8020584 - b _0801F6E8 -_0801F6A8: - bl sub_80205B4 - b _0801F6E8 -_0801F6AE: - bl task_tutorial_story_unknown - b _0801F6E8 -_0801F6B4: - bl sub_8020680 - b _0801F6E8 -_0801F6BA: - bl sub_80206A4 - bl sub_80206D0 - bl sub_8020740 - bl sub_80206E8 - b _0801F6E8 -_0801F6CC: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0801F6E8 - bl sub_80208E8 - bl sub_8020A68 - bl sub_8020B20 - b _0801F6E8 -_0801F6E4: - movs r0, 0 - b _0801F6F0 -_0801F6E8: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] -_0801F6EE: - movs r0, 0x1 -_0801F6F0: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_801F658 - - thumb_func_start sub_801F6F8 -sub_801F6F8: @ 801F6F8 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0 - beq _0801F708 - cmp r0, 0x1 - beq _0801F716 - b _0801F720 -_0801F708: - bl sub_80203B0 - movs r0, 0x3 - movs r1, 0x3 - bl CopyWindowToVram - b _0801F720 -_0801F716: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r0, 24 - b _0801F728 -_0801F720: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - movs r0, 0x1 -_0801F728: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_801F6F8 - - thumb_func_start sub_801F730 -sub_801F730: @ 801F730 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0 - beq _0801F740 - cmp r0, 0x1 - beq _0801F74E - b _0801F758 -_0801F740: - bl sub_802040C - movs r0, 0x3 - movs r1, 0x3 - bl CopyWindowToVram - b _0801F758 -_0801F74E: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r0, 24 - b _0801F760 -_0801F758: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - movs r0, 0x1 -_0801F760: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_801F730 - - thumb_func_start sub_801F768 -sub_801F768: @ 801F768 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0x1 - beq _0801F79E - cmp r0, 0x1 - bgt _0801F77C - cmp r0, 0 - beq _0801F782 - b _0801F7C4 -_0801F77C: - cmp r0, 0x2 - beq _0801F7AA - b _0801F7C4 -_0801F782: - movs r0, 0x1 - bl sub_802091C - bl sub_8020320 - cmp r0, 0 - bne _0801F7CA - bl sub_80201A4 - movs r0, 0x2 - movs r1, 0x2 - bl CopyWindowToVram - b _0801F7C4 -_0801F79E: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _0801F7C4 - b _0801F7CA -_0801F7AA: - bl sub_8020368 - cmp r0, 0 - bne _0801F7CA - bl sub_802093C - movs r0, 0 - bl sub_802091C - bl sub_8020B80 - movs r0, 0 - b _0801F7CC -_0801F7C4: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] -_0801F7CA: - movs r0, 0x1 -_0801F7CC: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_801F768 - - thumb_func_start sub_801F7D4 -sub_801F7D4: @ 801F7D4 - push {lr} - bl sub_802093C - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_801F7D4 - - thumb_func_start sub_801F7E0 -sub_801F7E0: @ 801F7E0 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0 - beq _0801F7F0 - cmp r0, 0x1 - beq _0801F814 - b _0801F81E -_0801F7F0: - movs r0, 0 - movs r1, 0 - bl sub_801FF18 - movs r0, 0x17 - movs r1, 0xB - movs r2, 0x1 - bl sub_801FDDC - ldr r0, =0x02022c88 - ldr r0, [r0] - ldrb r0, [r0, 0x1E] - movs r1, 0x3 - bl CopyWindowToVram - b _0801F81E - .pool -_0801F814: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r0, 24 - b _0801F826 -_0801F81E: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - movs r0, 0x1 -_0801F826: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_801F7E0 - - thumb_func_start sub_801F82C -sub_801F82C: @ 801F82C - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0 - beq _0801F83C - cmp r0, 0x1 - beq _0801F84C - b _0801F862 -_0801F83C: - bl sub_8020094 - bl sub_801FEBC - movs r0, 0 - bl CopyBgTilemapBufferToVram - b _0801F862 -_0801F84C: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0801F868 - bl sub_80200C8 - bl sub_801FEE4 - movs r0, 0 - b _0801F86A -_0801F862: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] -_0801F868: - movs r0, 0x1 -_0801F86A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_801F82C - - thumb_func_start sub_801F870 -sub_801F870: @ 801F870 - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0 - beq _0801F882 - cmp r0, 0x1 - beq _0801F8BA - b _0801F8CC -_0801F882: - add r1, sp, 0x8 - add r0, sp, 0x4 - bl sub_801F0EC - ldr r0, [sp, 0x4] - lsls r0, 16 - lsrs r0, 16 - ldr r1, [sp, 0x8] - lsls r1, 16 - lsrs r1, 16 - movs r2, 0 - bl sub_80200EC - bl sub_801F0D0 - adds r1, r0, 0 - movs r0, 0x2 - str r0, [sp] - movs r0, 0 - movs r2, 0x3 - movs r3, 0x1 - bl sub_8020118 - movs r0, 0x1 - movs r1, 0x2 - bl CopyWindowToVram - b _0801F8CC -_0801F8BA: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0801F8D2 - bl sub_8020B80 - movs r0, 0 - b _0801F8D4 -_0801F8CC: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] -_0801F8D2: - movs r0, 0x1 -_0801F8D4: - add sp, 0xC - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_801F870 - - thumb_func_start sub_801F8DC -sub_801F8DC: @ 801F8DC - push {r4-r6,lr} - sub sp, 0x4 - adds r6, r0, 0 - ldrb r0, [r6] - cmp r0, 0x1 - beq _0801F938 - cmp r0, 0x1 - bgt _0801F8F2 - cmp r0, 0 - beq _0801F8FC - b _0801F972 -_0801F8F2: - cmp r0, 0x2 - beq _0801F95C - cmp r0, 0x3 - beq _0801F96E - b _0801F972 -_0801F8FC: - bl sub_801F144 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl sub_801F114 - adds r5, r0, 0 - bl GetStringLength_Multibyte - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - movs r2, 0x66 - bl sub_80200EC - movs r0, 0x5 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0 - movs r3, 0x4 - bl sub_8020118 - movs r0, 0x1 - movs r1, 0x2 - bl CopyWindowToVram - b _0801F972 -_0801F938: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0801F978 - movs r0, 0x1 - movs r1, 0x10 - bl sub_801FF18 - ldr r0, =0x02022c88 - ldr r0, [r0] - ldrb r0, [r0, 0x1E] - movs r1, 0x3 - bl CopyWindowToVram - b _0801F972 - .pool -_0801F95C: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0801F978 - movs r0, 0x1 - bl sub_80209AC - b _0801F972 -_0801F96E: - movs r0, 0 - b _0801F97A -_0801F972: - ldrb r0, [r6] - adds r0, 0x1 - strb r0, [r6] -_0801F978: - movs r0, 0x1 -_0801F97A: - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_801F8DC - - thumb_func_start sub_801F984 -sub_801F984: @ 801F984 - push {r4-r6,lr} - sub sp, 0x4 - adds r6, r0, 0 - ldrb r0, [r6] - cmp r0, 0x1 - beq _0801F9E0 - cmp r0, 0x1 - bgt _0801F99A - cmp r0, 0 - beq _0801F9A4 - b _0801FA1A -_0801F99A: - cmp r0, 0x2 - beq _0801FA00 - cmp r0, 0x3 - beq _0801FA16 - b _0801FA1A -_0801F9A4: - bl sub_801F144 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl sub_801F114 - adds r5, r0, 0 - bl GetStringLength_Multibyte - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - movs r2, 0 - bl sub_80200EC - movs r0, 0x2 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x3 - movs r3, 0x1 - bl sub_8020118 - movs r0, 0x1 - movs r1, 0x2 - bl CopyWindowToVram - b _0801FA1A -_0801F9E0: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0801FA20 - bl sub_8020094 - ldr r0, =0x02022c88 - ldr r0, [r0] - ldrb r0, [r0, 0x1E] - movs r1, 0x3 - bl CopyWindowToVram - b _0801FA1A - .pool -_0801FA00: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0801FA20 - movs r0, 0 - bl sub_80209AC - bl sub_80200C8 - b _0801FA1A -_0801FA16: - movs r0, 0 - b _0801FA22 -_0801FA1A: - ldrb r0, [r6] - adds r0, 0x1 - strb r0, [r6] -_0801FA20: - movs r0, 0x1 -_0801FA22: - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_801F984 - - thumb_func_start sub_801FA2C -sub_801FA2C: @ 801FA2C - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0 - beq _0801FA3C - cmp r0, 0x1 - beq _0801FA50 - b _0801FA5E -_0801FA3C: - bl sub_80201A4 - movs r0, 0x2 - movs r1, 0x2 - bl CopyWindowToVram - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _0801FA5E -_0801FA50: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0801FA5E - movs r0, 0 - b _0801FA60 -_0801FA5E: - movs r0, 0x1 -_0801FA60: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_801FA2C - - thumb_func_start sub_801FA68 -sub_801FA68: @ 801FA68 - push {r4-r6,lr} - adds r6, r0, 0 - ldrb r0, [r6] - cmp r0, 0x4 - bhi _0801FB3A - lsls r0, 2 - ldr r1, =_0801FA80 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0801FA80: - .4byte _0801FA94 - .4byte _0801FAC0 - .4byte _0801FAF0 - .4byte _0801FB14 - .4byte _0801FADE -_0801FA94: - ldr r0, =0x02022c88 - ldr r0, [r0] - ldrh r5, [r0, 0x1A] - bl sub_801F180 - adds r4, r0, 0 - bl sub_801F18C - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8020420 - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram - b _0801FB34 - .pool -_0801FAC0: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - bne _0801FB3A - ldr r0, =0x02022c88 - ldr r1, [r0] - ldrh r0, [r1, 0x1A] - cmp r0, 0x8 - bhi _0801FAE8 - adds r0, 0x1 - strh r0, [r1, 0x1A] - movs r0, 0x4 - strb r0, [r6] -_0801FADE: - movs r0, 0 - b _0801FB3C - .pool -_0801FAE8: - strh r2, [r1, 0x1C] - ldrb r0, [r6] - adds r0, 0x1 - strb r0, [r6] -_0801FAF0: - movs r0, 0 - movs r1, 0 - movs r2, 0x5 - movs r3, 0x11 - bl ScrollWindow - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram - ldr r0, =0x02022c88 - ldr r1, [r0] - ldrh r0, [r1, 0x1C] - adds r0, 0x1 - strh r0, [r1, 0x1C] - ldrb r0, [r6] - adds r0, 0x1 - strb r0, [r6] -_0801FB14: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0801FB3A - ldr r0, =0x02022c88 - ldr r0, [r0] - ldrh r0, [r0, 0x1C] - cmp r0, 0x2 - bhi _0801FB34 - ldrb r0, [r6] - subs r0, 0x1 - b _0801FB38 - .pool -_0801FB34: - ldrb r0, [r6] - adds r0, 0x1 -_0801FB38: - strb r0, [r6] -_0801FB3A: - movs r0, 0x1 -_0801FB3C: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_801FA68 - - thumb_func_start sub_801FB44 -sub_801FB44: @ 801FB44 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0 - beq _0801FB54 - cmp r0, 0x1 - beq _0801FB60 - b _0801FB66 -_0801FB54: - bl sub_80209E0 - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _0801FB66 -_0801FB60: - bl sub_8020A1C - b _0801FB68 -_0801FB66: - movs r0, 0x1 -_0801FB68: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_801FB44 - - thumb_func_start sub_801FB70 -sub_801FB70: @ 801FB70 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0 - beq _0801FB80 - cmp r0, 0x1 - beq _0801FBA0 - b _0801FBAA -_0801FB80: - movs r0, 0x3 - movs r1, 0x10 - bl sub_801FF18 - ldr r0, =0x02022c88 - ldr r0, [r0] - ldrb r0, [r0, 0x1E] - movs r1, 0x3 - bl CopyWindowToVram - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _0801FBAA - .pool -_0801FBA0: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r0, 24 - b _0801FBAC -_0801FBAA: - movs r0, 0x1 -_0801FBAC: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_801FB70 - - thumb_func_start sub_801FBB4 -sub_801FBB4: @ 801FBB4 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0 - beq _0801FBC4 - cmp r0, 0x1 - beq _0801FBE4 - b _0801FBEE -_0801FBC4: - movs r0, 0x4 - movs r1, 0 - bl sub_801FF18 - ldr r0, =0x02022c88 - ldr r0, [r0] - ldrb r0, [r0, 0x1E] - movs r1, 0x3 - bl CopyWindowToVram - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _0801FBEE - .pool -_0801FBE4: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r0, 24 - b _0801FBF0 -_0801FBEE: - movs r0, 0x1 -_0801FBF0: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_801FBB4 - - thumb_func_start sub_801FBF8 -sub_801FBF8: @ 801FBF8 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0 - beq _0801FC08 - cmp r0, 0x1 - beq _0801FC38 - b _0801FC42 -_0801FC08: - bl sub_81AFBF0 - bl sub_801F1D0 - adds r1, r0, 0 - movs r0, 0 - bl sub_81AFC0C - movs r0, 0x5 - movs r1, 0 - bl sub_801FF18 - ldr r0, =0x02022c88 - ldr r0, [r0] - ldrb r0, [r0, 0x1E] - movs r1, 0x3 - bl CopyWindowToVram - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _0801FC42 - .pool -_0801FC38: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r0, 24 - b _0801FC44 -_0801FC42: - movs r0, 0x1 -_0801FC44: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_801FBF8 - - thumb_func_start sub_801FC4C -sub_801FC4C: @ 801FC4C - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0 - beq _0801FC5C - cmp r0, 0x1 - beq _0801FC88 - b _0801FC92 -_0801FC5C: - movs r0, 0x6 - movs r1, 0 - bl sub_801FF18 - movs r0, 0x17 - movs r1, 0xA - movs r2, 0x1 - bl sub_801FDDC - ldr r0, =0x02022c88 - ldr r0, [r0] - ldrb r0, [r0, 0x1E] - movs r1, 0x3 - bl CopyWindowToVram - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _0801FC92 - .pool -_0801FC88: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r0, 24 - b _0801FC94 -_0801FC92: - movs r0, 0x1 -_0801FC94: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_801FC4C - - thumb_func_start sub_801FC9C -sub_801FC9C: @ 801FC9C - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0 - beq _0801FCAC - cmp r0, 0x1 - beq _0801FCD8 - b _0801FCE2 -_0801FCAC: - movs r0, 0x7 - movs r1, 0 - bl sub_801FF18 - movs r0, 0x17 - movs r1, 0xA - movs r2, 0x1 - bl sub_801FDDC - ldr r0, =0x02022c88 - ldr r0, [r0] - ldrb r0, [r0, 0x1E] - movs r1, 0x3 - bl CopyWindowToVram - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _0801FCE2 - .pool -_0801FCD8: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r0, 24 - b _0801FCE4 -_0801FCE2: - movs r0, 0x1 -_0801FCE4: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_801FC9C - - thumb_func_start sub_801FCEC -sub_801FCEC: @ 801FCEC - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0 - beq _0801FCFC - cmp r0, 0x1 - beq _0801FD1C - b _0801FD26 -_0801FCFC: - movs r0, 0x8 - movs r1, 0 - bl sub_801FF18 - ldr r0, =0x02022c88 - ldr r0, [r0] - ldrb r0, [r0, 0x1E] - movs r1, 0x3 - bl CopyWindowToVram - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _0801FD26 - .pool -_0801FD1C: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r0, 24 - b _0801FD28 -_0801FD26: - movs r0, 0x1 -_0801FD28: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_801FCEC - - thumb_func_start sub_801FD30 -sub_801FD30: @ 801FD30 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0 - beq _0801FD40 - cmp r0, 0x1 - beq _0801FD74 - b _0801FD7E -_0801FD40: - bl sub_81AFBF0 - ldr r0, =0x03005d90 - ldr r1, [r0] - movs r0, 0 - bl sub_81AFC0C - movs r0, 0x9 - movs r1, 0 - bl sub_801FF18 - ldr r0, =0x02022c88 - ldr r0, [r0] - ldrb r0, [r0, 0x1E] - movs r1, 0x3 - bl CopyWindowToVram - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _0801FD7E - .pool -_0801FD74: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r0, 24 - b _0801FD80 -_0801FD7E: - movs r0, 0x1 -_0801FD80: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_801FD30 - - thumb_func_start sub_801FD88 -sub_801FD88: @ 801FD88 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0 - beq _0801FD98 - cmp r0, 0x1 - beq _0801FDC4 - b _0801FDCE -_0801FD98: - movs r0, 0xA - movs r1, 0 - bl sub_801FF18 - movs r0, 0x17 - movs r1, 0xA - movs r2, 0x1 - bl sub_801FDDC - ldr r0, =0x02022c88 - ldr r0, [r0] - ldrb r0, [r0, 0x1E] - movs r1, 0x3 - bl CopyWindowToVram - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _0801FDCE - .pool -_0801FDC4: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r0, 24 - b _0801FDD0 -_0801FDCE: - movs r0, 0x1 -_0801FDD0: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_801FD88 - - thumb_func_start sub_801FDD8 -sub_801FDD8: @ 801FDD8 - movs r0, 0 - bx lr - thumb_func_end sub_801FDD8 - - thumb_func_start sub_801FDDC -sub_801FDDC: @ 801FDDC - push {r4-r7,lr} - sub sp, 0x14 - lsls r0, 24 - lsls r1, 24 - lsls r2, 24 - lsrs r7, r2, 24 - ldr r4, =0xffffff00 - ldr r2, [sp, 0xC] - ands r2, r4 - lsrs r0, 16 - ldr r3, =0xffff00ff - ands r2, r3 - orrs r2, r0 - lsrs r1, 8 - ldr r0, =0xff00ffff - ands r2, r0 - orrs r2, r1 - ldr r0, =0x00ffffff - ands r2, r0 - movs r0, 0xC0 - lsls r0, 19 - orrs r2, r0 - str r2, [sp, 0xC] - ldr r0, [sp, 0x10] - ands r0, r4 - movs r1, 0x4 - orrs r0, r1 - ands r0, r3 - movs r1, 0xE0 - lsls r1, 4 - orrs r0, r1 - ldr r1, =0x0000ffff - ands r0, r1 - movs r1, 0xA4 - lsls r1, 15 - orrs r0, r1 - str r0, [sp, 0x10] - add r0, sp, 0xC - bl AddWindow - adds r1, r0, 0 - ldr r5, =0x02022c88 - ldr r0, [r5] - movs r6, 0 - strh r1, [r0, 0x18] - lsls r0, r1, 16 - lsrs r0, 16 - cmp r0, 0xFF - beq _0801FE94 - lsls r0, r1, 24 - lsrs r0, 24 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, [r5] - ldrb r0, [r0, 0x18] - bl PutWindowTilemap - ldr r0, [r5] - ldrb r0, [r0, 0x18] - ldr r2, =gUnknown_085EAE62 - movs r1, 0x1 - str r1, [sp] - movs r4, 0xFF - str r4, [sp, 0x4] - str r6, [sp, 0x8] - movs r3, 0x8 - bl Print - ldr r0, [r5] - ldrb r0, [r0, 0x18] - ldr r2, =gUnknown_085EAE66 - movs r1, 0x11 - str r1, [sp] - str r4, [sp, 0x4] - str r6, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl Print - ldr r0, [r5] - ldrb r0, [r0, 0x18] - movs r1, 0x1 - movs r2, 0xD - bl sub_8098858 - ldr r0, [r5] - ldrb r0, [r0, 0x18] - movs r1, 0x2 - adds r2, r7, 0 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed -_0801FE94: - add sp, 0x14 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801FDDC - - thumb_func_start sub_801FEBC -sub_801FEBC: @ 801FEBC - push {r4,lr} - ldr r4, =0x02022c88 - ldr r0, [r4] - ldrh r0, [r0, 0x18] - cmp r0, 0xFF - beq _0801FEDA - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl sub_8198070 - ldr r0, [r4] - ldrb r0, [r0, 0x18] - bl ClearWindowTilemap -_0801FEDA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801FEBC - - thumb_func_start sub_801FEE4 -sub_801FEE4: @ 801FEE4 - push {r4,lr} - ldr r4, =0x02022c88 - ldr r0, [r4] - ldrh r0, [r0, 0x18] - cmp r0, 0xFF - beq _0801FEFE - lsls r0, 24 - lsrs r0, 24 - bl RemoveWindow - ldr r1, [r4] - movs r0, 0xFF - strh r0, [r1, 0x18] -_0801FEFE: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801FEE4 - - thumb_func_start sub_801FF08 -sub_801FF08: @ 801FF08 - push {lr} - bl ProcessMenuInput - lsls r0, 24 - asrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_801FF08 - - thumb_func_start sub_801FF18 -sub_801FF18: @ 801FF18 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x1C - adds r7, r0, 0 - lsls r1, 16 - lsrs r1, 16 - mov r9, r1 - ldr r1, =0xffffff00 - ldr r3, [sp, 0x14] - ands r3, r1 - ldr r2, =0xffff00ff - ands r3, r2 - movs r0, 0x80 - lsls r0, 4 - orrs r3, r0 - ldr r0, =0xff00ffff - ands r3, r0 - movs r0, 0x80 - lsls r0, 13 - orrs r3, r0 - ldr r5, =0x00ffffff - ands r3, r5 - movs r0, 0xA8 - lsls r0, 21 - orrs r3, r0 - str r3, [sp, 0x14] - ldr r0, [sp, 0x18] - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - ands r0, r2 - movs r1, 0xE0 - lsls r1, 4 - orrs r0, r1 - ldr r1, =0x0000ffff - ands r0, r1 - movs r1, 0xD4 - lsls r1, 15 - orrs r0, r1 - str r0, [sp, 0x18] - ldr r1, =gUnknown_082F2D40 - lsls r0, r7, 1 - adds r0, r7 - lsls r0, 2 - adds r4, r0, r1 - ldrb r0, [r4, 0xA] - cmp r0, 0 - beq _0801FF98 - lsls r0, r3, 16 - movs r1, 0xF9 - lsls r1, 24 - adds r0, r1 - lsrs r0, 16 - ands r2, r3 - orrs r2, r0 - lsrs r1, r2, 24 - adds r1, 0x7 - lsls r1, 24 - adds r0, r5, 0 - ands r0, r2 - orrs r0, r1 - str r0, [sp, 0x14] -_0801FF98: - add r0, sp, 0x14 - bl AddWindow - ldr r5, =0x02022c88 - ldr r1, [r5] - strh r0, [r1, 0x1E] - ldrh r0, [r1, 0x1E] - mov r8, r0 - cmp r0, 0xFF - beq _08020082 - ldrb r0, [r4, 0x9] - cmp r0, 0 - beq _0801FFE0 - adds r0, r1, 0 - adds r0, 0x22 - ldr r1, [r4] - bl sub_81AFC28 - ldr r0, [r5] - adds r6, r0, 0 - adds r6, 0x22 - b _0801FFE2 - .pool -_0801FFE0: - ldr r6, [r4] -_0801FFE2: - mov r0, r9 - lsls r1, r0, 8 - movs r0, 0 - movs r2, 0 - bl ChangeBgY - mov r1, r8 - lsls r0, r1, 24 - lsrs r5, r0, 24 - adds r0, r5, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - adds r0, r5, 0 - bl PutWindowTilemap - ldr r1, =gUnknown_082F2D40 - lsls r0, r7, 1 - adds r0, r7 - lsls r0, 2 - adds r4, r0, r1 - ldrb r0, [r4, 0x4] - cmp r0, 0x1 - bne _08020050 - adds r0, r5, 0 - movs r1, 0xA - movs r2, 0x2 - bl sub_80989E0 - ldrb r3, [r4, 0x5] - adds r3, 0x8 - lsls r3, 24 - lsrs r3, 24 - ldrb r0, [r4, 0x6] - adds r0, 0x8 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - ldrb r0, [r4, 0x7] - str r0, [sp, 0xC] - ldrb r0, [r4, 0x8] - str r0, [sp, 0x10] - adds r0, r5, 0 - movs r1, 0x1 - adds r2, r6, 0 - bl sub_8199F74 - b _0802007A - .pool -_08020050: - adds r0, r5, 0 - movs r1, 0xA - movs r2, 0x2 - bl sub_8098858 - ldrb r3, [r4, 0x5] - ldrb r0, [r4, 0x6] - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - ldrb r0, [r4, 0x7] - str r0, [sp, 0xC] - ldrb r0, [r4, 0x8] - str r0, [sp, 0x10] - adds r0, r5, 0 - movs r1, 0x1 - adds r2, r6, 0 - bl sub_8199F74 -_0802007A: - ldr r0, =0x02022c88 - ldr r0, [r0] - mov r1, r8 - strh r1, [r0, 0x1E] -_08020082: - add sp, 0x1C - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_801FF18 - - thumb_func_start sub_8020094 -sub_8020094: @ 8020094 - push {r4,lr} - ldr r4, =0x02022c88 - ldr r0, [r4] - ldrh r0, [r0, 0x1E] - cmp r0, 0xFF - beq _080200B2 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl sub_8198070 - ldr r0, [r4] - ldrb r0, [r0, 0x1E] - bl ClearWindowTilemap -_080200B2: - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8020094 - - thumb_func_start sub_80200C8 -sub_80200C8: @ 80200C8 - push {r4,lr} - ldr r4, =0x02022c88 - ldr r0, [r4] - ldrh r0, [r0, 0x1E] - cmp r0, 0xFF - beq _080200E2 - lsls r0, 24 - lsrs r0, 24 - bl RemoveWindow - ldr r1, [r4] - movs r0, 0xFF - strh r0, [r1, 0x1E] -_080200E2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80200C8 - - thumb_func_start sub_80200EC -sub_80200EC: @ 80200EC - push {lr} - sub sp, 0x8 - adds r3, r0, 0 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 19 - lsrs r3, 16 - lsls r1, 19 - lsrs r1, 16 - str r1, [sp] - movs r0, 0xE - str r0, [sp, 0x4] - movs r0, 0x1 - adds r1, r2, 0 - adds r2, r3, 0 - movs r3, 0x1 - bl FillWindowPixelRect - add sp, 0x8 - pop {r0} - bx r0 - thumb_func_end sub_80200EC - - thumb_func_start sub_8020118 -sub_8020118: @ 8020118 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x34 - mov r10, r1 - ldr r1, [sp, 0x54] - lsls r0, 16 - lsrs r5, r0, 16 - mov r9, r5 - lsls r2, 24 - lsrs r4, r2, 24 - mov r8, r4 - lsls r3, 24 - lsrs r7, r3, 24 - lsls r1, 24 - lsrs r6, r1, 24 - cmp r4, 0 - beq _08020154 - bl sub_801F198 - adds r1, r0, 0 - subs r1, r5 - lsls r1, 16 - lsrs r1, 16 - adds r0, r5, 0 - adds r2, r4, 0 - bl sub_80200EC -_08020154: - add r0, sp, 0xC - mov r1, r8 - strb r1, [r0] - strb r7, [r0, 0x1] - strb r6, [r0, 0x2] - add r4, sp, 0x10 - movs r0, 0xFC - strb r0, [r4] - movs r0, 0x14 - strb r0, [r4, 0x1] - movs r0, 0x8 - strb r0, [r4, 0x2] - mov r0, sp - adds r0, 0x13 - mov r1, r10 - bl CopyString - mov r0, r9 - lsls r2, r0, 27 - lsrs r2, 24 - add r1, sp, 0xC - str r1, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x2 - movs r3, 0x1 - bl box_print - 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_8020118 - - thumb_func_start sub_80201A4 -sub_80201A4: @ 80201A4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4C - movs r0, 0x2 - movs r1, 0xFF - bl FillWindowPixelBuffer - bl sub_801F0B0 - lsls r0, 24 - lsrs r2, r0, 24 - add r1, sp, 0xC - movs r0, 0 - strb r0, [r1] - movs r0, 0xE - strb r0, [r1, 0x1] - movs r0, 0xD - strb r0, [r1, 0x2] - cmp r2, 0x3 - beq _08020240 - add r1, sp, 0x10 - movs r0, 0xFC - strb r0, [r1] - movs r0, 0x14 - strb r0, [r1, 0x1] - movs r0, 0x8 - strb r0, [r1, 0x2] - str r0, [sp, 0x40] - str r1, [sp, 0x44] - cmp r2, 0x2 - bne _080201EC - movs r1, 0x6 - str r1, [sp, 0x40] -_080201EC: - movs r7, 0 - movs r6, 0 - lsls r0, r2, 2 - ldr r1, =gUnknown_082F2BA8 - adds r0, r2 - lsls r0, 3 - adds r4, r0, r1 - ldr r0, [sp, 0x40] - lsls r5, r0, 24 -_080201FE: - ldr r1, [r4] - cmp r1, 0 - bne _08020206 - b _0802030C -_08020206: - mov r0, sp - adds r0, 0x13 - bl CopyString - lsls r3, r6, 24 - lsrs r3, 24 - add r1, sp, 0xC - str r1, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - ldr r0, [sp, 0x44] - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0 - lsrs r2, r5, 24 - bl box_print - adds r4, 0x4 - adds r7, 0x1 - adds r0, r6, 0 - adds r0, 0xC - lsls r0, 16 - lsrs r6, r0, 16 - cmp r7, 0x9 - ble _080201FE - b _0802030C - .pool -_08020240: - movs r1, 0x4 - str r1, [sp, 0x40] - movs r7, 0 - movs r6, 0 -_08020248: - adds r0, r7, 0 - bl sub_801EE6C - adds r5, r0, 0 - movs r0, 0 - adds r1, r5, 0 - movs r2, 0 - bl GetStringWidth - cmp r0, 0x28 - bgt _08020286 - lsls r3, r6, 24 - lsrs r3, 24 - add r4, sp, 0xC - str r4, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x2 - movs r1, 0 - movs r4, 0x80 - lsls r4, 19 - lsrs r2, r4, 24 - bl box_print - adds r0, r7, 0x1 - str r0, [sp, 0x48] - adds r6, 0xC - mov r10, r6 - b _08020300 -_08020286: - adds r0, r5, 0 - bl GetStringLength_Multibyte - adds r4, r0, 0 - mov r1, sp - adds r1, 0x10 - str r1, [sp, 0x44] - ldr r0, [sp, 0x40] - lsls r0, 24 - mov r8, r0 - lsls r1, r6, 24 - mov r9, r1 - adds r0, r7, 0x1 - str r0, [sp, 0x48] - adds r6, 0xC - mov r10, r6 - ldr r7, [sp, 0x40] - adds r7, 0x23 - ldr r6, [sp, 0x44] -_080202AC: - subs r4, 0x1 - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl CopyString_LimitN_Multibyte - movs r0, 0 - adds r1, r6, 0 - movs r2, 0 - bl GetStringWidth - cmp r0, 0x23 - bgt _080202AC - mov r1, r8 - lsrs r2, r1, 24 - mov r0, r9 - lsrs r4, r0, 24 - add r1, sp, 0xC - str r1, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - ldr r1, [sp, 0x44] - str r1, [sp, 0x8] - movs r0, 0x2 - movs r1, 0 - adds r3, r4, 0 - bl box_print - adds r2, r7, 0 - add r0, sp, 0xC - str r0, [sp] - movs r1, 0x1 - negs r1, r1 - str r1, [sp, 0x4] - ldr r0, =gUnknown_082F2DC4 - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0 - adds r3, r4, 0 - bl box_print -_08020300: - ldr r7, [sp, 0x48] - mov r4, r10 - lsls r0, r4, 16 - lsrs r6, r0, 16 - cmp r7, 0x9 - ble _08020248 -_0802030C: - add sp, 0x4C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80201A4 - - thumb_func_start sub_8020320 -sub_8020320: @ 8020320 - push {r4,lr} - ldr r1, =0x02022c88 - ldr r2, [r1] - ldrh r3, [r2, 0x20] - movs r4, 0x20 - ldrsh r0, [r2, r4] - cmp r0, 0x37 - bgt _08020354 - adds r0, r3, 0 - adds r0, 0xC - strh r0, [r2, 0x20] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x37 - ble _08020348 - movs r0, 0x38 - strh r0, [r2, 0x20] - b _08020354 - .pool -_08020348: - movs r1, 0x20 - ldrsh r0, [r2, r1] - bl sub_80207C0 - movs r0, 0x1 - b _08020360 -_08020354: - ldr r0, [r1] - movs r4, 0x20 - ldrsh r0, [r0, r4] - bl sub_8020818 - movs r0, 0 -_08020360: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8020320 - - thumb_func_start sub_8020368 -sub_8020368: @ 8020368 - push {r4,lr} - ldr r1, =0x02022c88 - ldr r2, [r1] - ldrh r3, [r2, 0x20] - movs r4, 0x20 - ldrsh r0, [r2, r4] - cmp r0, 0 - ble _0802039C - adds r0, r3, 0 - subs r0, 0xC - strh r0, [r2, 0x20] - lsls r0, 16 - cmp r0, 0 - bgt _08020390 - movs r0, 0 - strh r0, [r2, 0x20] - b _0802039C - .pool -_08020390: - movs r1, 0x20 - ldrsh r0, [r2, r1] - bl sub_80207C0 - movs r0, 0x1 - b _080203A8 -_0802039C: - ldr r0, [r1] - movs r4, 0x20 - ldrsh r0, [r0, r4] - bl sub_8020818 - movs r0, 0 -_080203A8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8020368 - - thumb_func_start sub_80203B0 -sub_80203B0: @ 80203B0 - push {r4,r5,lr} - sub sp, 0xC - movs r0, 0x3 - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0xD - bl sub_8098858 - movs r5, 0xE - str r5, [sp] - movs r4, 0x5 - str r4, [sp, 0x4] - ldr r0, =gUnknown_082F2DC8 - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x2 - movs r2, 0x8 - movs r3, 0x1 - bl PrintTextArray - bl sub_801F0B0 - lsls r0, 24 - lsrs r0, 24 - str r5, [sp] - str r4, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x2 - movs r2, 0 - movs r3, 0x1 - bl sub_81983AC - movs r0, 0x3 - bl PutWindowTilemap - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80203B0 - - thumb_func_start sub_802040C -sub_802040C: @ 802040C - push {lr} - movs r0, 0x3 - movs r1, 0 - bl sub_8198070 - movs r0, 0x3 - bl ClearWindowTilemap - pop {r0} - bx r0 - thumb_func_end sub_802040C - - thumb_func_start sub_8020420 -sub_8020420: @ 8020420 - push {r4,r5,lr} - sub sp, 0x10 - adds r5, r1, 0 - lsls r0, 16 - lsrs r0, 16 - lsls r2, 24 - add r3, sp, 0xC - movs r1, 0x1 - strb r1, [r3] - lsrs r2, 23 - adds r1, r2, 0x2 - strb r1, [r3, 0x1] - adds r1, r3, 0 - adds r2, 0x3 - strb r2, [r1, 0x2] - lsls r4, r0, 4 - subs r4, r0 - lsls r3, r4, 16 - lsrs r3, 16 - movs r0, 0xA8 - str r0, [sp] - movs r0, 0xF - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0x11 - movs r2, 0 - bl FillWindowPixelRect - adds r4, 0x1 - lsls r4, 24 - lsrs r4, 24 - add r0, sp, 0xC - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x2 - movs r2, 0 - adds r3, r4, 0 - bl box_print - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8020420 - - thumb_func_start sub_8020480 -sub_8020480: @ 8020480 - push {lr} - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuRegBits - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r1, 0xE0 - lsls r1, 8 - movs r0, 0 - bl ClearGpuRegBits - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl SetGpuRegBits - ldr r1, =0x000040f0 - movs r0, 0x40 - bl SetGpuReg - movs r0, 0x44 - movs r1, 0x90 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0x3D - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x3F - bl SetGpuReg - pop {r0} - bx r0 - .pool - thumb_func_end sub_8020480 - - thumb_func_start sub_8020538 -sub_8020538: @ 8020538 - push {r4,lr} - ldr r4, =0x02022c88 - ldr r1, [r4] - movs r0, 0x94 - lsls r0, 1 - adds r1, r0 - movs r0, 0 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00000928 - adds r1, r0 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00001128 - adds r1, r0 - movs r0, 0x3 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00001928 - adds r1, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8020538 - - thumb_func_start sub_8020584 -sub_8020584: @ 8020584 - push {lr} - sub sp, 0x8 - movs r1, 0xC0 - lsls r1, 19 - movs r0, 0 - movs r2, 0x20 - movs r3, 0x1 - bl RequestDma3Fill - movs r0, 0x20 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0x8 - pop {r0} - bx r0 - thumb_func_end sub_8020584 - - thumb_func_start sub_80205B4 -sub_80205B4: @ 80205B4 - push {lr} - sub sp, 0x4 - ldr r0, =gUnknown_08DD4BD0 - movs r1, 0x70 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =gUnknown_08DD4BB0 - movs r1, 0xC0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r1, =gUnknown_08DD4BF0 - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r1, =gUnknown_08DD4C4C - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80205B4 - - thumb_func_start task_tutorial_story_unknown -task_tutorial_story_unknown: @ 8020604 - push {r4,r5,lr} - sub sp, 0x4 - ldr r0, =gUnknown_08DD4860 - movs r1, 0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r1, =gUnknown_08DD4880 - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - adds r5, r0, 0 - cmp r5, 0 - beq _0802064E - movs r1, 0x88 - lsls r1, 2 - adds r0, r5, r1 - ldr r4, =0x02022c88 - ldr r1, [r4] - ldr r2, =0x00002128 - adds r1, r2 - movs r2, 0x8 - bl CpuFastSet - movs r1, 0x84 - lsls r1, 3 - adds r0, r5, r1 - ldr r1, [r4] - ldr r2, =0x00002148 - adds r1, r2 - movs r2, 0x8 - bl CpuFastSet -_0802064E: - ldr r1, =gUnknown_08DD4AB8 - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end task_tutorial_story_unknown - - thumb_func_start sub_8020680 -sub_8020680: @ 8020680 - push {lr} - ldr r0, =gUnknown_082F2C20 - movs r1, 0x80 - movs r2, 0x20 - bl gpu_pal_apply - ldr r1, =0x06004020 - movs r0, 0 - movs r2, 0x20 - movs r3, 0x1 - bl RequestDma3Fill - pop {r0} - bx r0 - .pool - thumb_func_end sub_8020680 - - thumb_func_start sub_80206A4 -sub_80206A4: @ 80206A4 - push {lr} - ldr r0, =gUnknown_082F2C40 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - movs r0, 0 - bl PutWindowTilemap - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - pop {r0} - bx r0 - .pool - thumb_func_end sub_80206A4 - - thumb_func_start sub_80206D0 -sub_80206D0: @ 80206D0 - push {lr} - movs r0, 0x2 - bl PutWindowTilemap - bl sub_80201A4 - movs r0, 0x2 - movs r1, 0x3 - bl CopyWindowToVram - pop {r0} - bx r0 - thumb_func_end sub_80206D0 - - thumb_func_start sub_80206E8 -sub_80206E8: @ 80206E8 - push {r4,lr} - sub sp, 0xC - add r1, sp, 0x8 - movs r0, 0 - strb r0, [r1] - movs r0, 0xFF - strb r0, [r1, 0x1] - movs r4, 0 -_080206F8: - ldr r0, =0x02022c88 - ldr r1, [r0] - ldr r0, =0x00002128 - adds r1, r0 - lsls r2, r4, 19 - lsrs r2, 16 - movs r0, 0x8 - str r0, [sp] - movs r0, 0x10 - str r0, [sp, 0x4] - movs r0, 0x1 - movs r3, 0 - bl BlitBitmapToWindow - adds r4, 0x1 - cmp r4, 0xE - ble _080206F8 - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0x1 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80206E8 - - thumb_func_start sub_8020740 -sub_8020740: @ 8020740 - push {lr} - movs r0, 0x3 - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0xD0 - bl sub_809882C - movs r0, 0x3 - movs r1, 0xA - movs r2, 0x20 - bl box_border_load_tiles_and_pal - ldr r0, =gUnknown_0860F074 - movs r1, 0xE0 - movs r2, 0x20 - bl gpu_pal_apply - pop {r0} - bx r0 - .pool - thumb_func_end sub_8020740 - - thumb_func_start sub_8020770 -sub_8020770: @ 8020770 - push {lr} - sub sp, 0x10 - ldr r0, =0xa2600001 - str r0, [sp, 0x4] - ldr r0, =0x04000014 - str r0, [sp] - mov r2, sp - movs r1, 0 - movs r0, 0x1 - strb r0, [r2, 0x8] - mov r0, sp - strb r1, [r0, 0x9] - ldr r0, =0x02022c88 - ldr r0, [r0] - strh r1, [r0, 0x20] - str r1, [sp, 0xC] - add r0, sp, 0xC - ldr r1, =0x02038c28 - ldr r2, =0x010003c0 - bl CpuFastSet - ldr r0, [sp] - ldr r1, [sp, 0x4] - ldr r2, [sp, 0x8] - bl sub_80BA038 - add sp, 0x10 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8020770 - - thumb_func_start sub_80207C0 -sub_80207C0: @ 80207C0 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 16 - lsrs r0, 16 - mov r1, sp - strh r0, [r1] - ldr r5, =0x02039b28 - ldrb r0, [r5, 0x14] - lsls r1, r0, 4 - subs r1, r0 - lsls r1, 7 - ldr r4, =0x02038c28 - adds r1, r4 - ldr r2, =0x01000090 - mov r0, sp - bl CpuSet - mov r0, sp - adds r0, 0x2 - movs r1, 0 - strh r1, [r0] - ldrb r2, [r5, 0x14] - lsls r1, r2, 4 - subs r1, r2 - lsls r1, 7 - movs r2, 0x90 - lsls r2, 1 - adds r4, r2 - adds r1, r4 - ldr r2, =0x01000010 - bl CpuSet - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80207C0 - - thumb_func_start sub_8020818 -sub_8020818: @ 8020818 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x8 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r0, sp - strh r4, [r0] - ldr r5, =0x02038c28 - ldr r0, =0x01000090 - mov r9, r0 - mov r0, sp - adds r1, r5, 0 - mov r2, r9 - bl CpuSet - mov r0, sp - adds r0, 0x2 - movs r6, 0 - strh r6, [r0] - movs r2, 0x90 - lsls r2, 1 - adds r1, r5, r2 - ldr r2, =0x01000010 - mov r8, r2 - bl CpuSet - add r0, sp, 0x4 - strh r4, [r0] - movs r2, 0xF0 - lsls r2, 3 - adds r1, r5, r2 - mov r2, r9 - bl CpuSet - mov r0, sp - adds r0, 0x6 - strh r6, [r0] - movs r1, 0x8A - lsls r1, 4 - adds r5, r1 - adds r1, r5, 0 - mov r2, r8 - bl CpuSet - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8020818 - - thumb_func_start sub_8020890 -sub_8020890: @ 8020890 - push {r4,r5,lr} - movs r5, 0 - ldr r4, =gUnknown_082F3134 -_08020896: - adds r0, r4, 0 - bl LoadCompressedObjectPic - adds r4, 0x8 - adds r5, 0x1 - cmp r5, 0x4 - bls _08020896 - ldr r0, =gUnknown_082F315C - bl LoadTaggedObjectPalette - ldr r4, =0x02022c8c - movs r0, 0x18 - bl Alloc - str r0, [r4] - cmp r0, 0 - beq _080208C8 - movs r0, 0x1 - b _080208CA - .pool -_080208C8: - movs r0, 0 -_080208CA: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8020890 - - thumb_func_start sub_80208D0 -sub_80208D0: @ 80208D0 - push {lr} - ldr r0, =0x02022c8c - ldr r0, [r0] - cmp r0, 0 - beq _080208DE - bl Free -_080208DE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80208D0 - - thumb_func_start sub_80208E8 -sub_80208E8: @ 80208E8 - push {lr} - ldr r0, =gUnknown_082F319C - movs r1, 0xA - movs r2, 0x18 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022c8c - ldr r2, [r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - str r1, [r2] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80208E8 - - thumb_func_start sub_802091C -sub_802091C: @ 802091C - ldr r1, =0x02022c8c - ldr r1, [r1] - ldr r2, [r1] - adds r2, 0x3E - movs r1, 0x1 - ands r0, r1 - lsls r0, 2 - ldrb r3, [r2] - movs r1, 0x5 - negs r1, r1 - ands r1, r3 - orrs r1, r0 - strb r1, [r2] - bx lr - .pool - thumb_func_end sub_802091C - - thumb_func_start sub_802093C -sub_802093C: @ 802093C - push {r4,r5,lr} - sub sp, 0x4 - bl sub_801F0B0 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - mov r5, sp - adds r5, 0x1 - mov r0, sp - adds r1, r5, 0 - bl sub_801F0BC - cmp r4, 0x3 - beq _0802097C - ldr r4, =0x02022c8c - ldr r0, [r4] - ldr r0, [r0] - movs r1, 0 - bl StartObjectImageAnim - ldr r1, [r4] - ldr r2, [r1] - mov r0, sp - ldrb r0, [r0] - lsls r0, 3 - adds r0, 0xA - strh r0, [r2, 0x20] - ldr r2, [r1] - b _08020992 - .pool -_0802097C: - ldr r4, =0x02022c8c - ldr r0, [r4] - ldr r0, [r0] - movs r1, 0x2 - bl StartObjectImageAnim - ldr r2, [r4] - ldr r1, [r2] - movs r0, 0x18 - strh r0, [r1, 0x20] - ldr r2, [r2] -_08020992: - ldrb r1, [r5] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, 0x18 - strh r0, [r2, 0x22] - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802093C - - thumb_func_start sub_80209AC -sub_80209AC: @ 80209AC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 2 - ldr r0, =gUnknown_082F2DF2 - adds r4, r0 - movs r0, 0 - bl IndexOfObjectPaletteTag - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 4 - ldr r0, =0x01010000 - adds r1, r0 - lsrs r1, 16 - adds r0, r4, 0 - movs r2, 0x4 - bl gpu_pal_apply - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80209AC - - thumb_func_start sub_80209E0 -sub_80209E0: @ 80209E0 - push {lr} - bl sub_801F0B0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - beq _08020A00 - ldr r0, =0x02022c8c - ldr r0, [r0] - ldr r0, [r0] - movs r1, 0x1 - bl StartObjectImageAnim - b _08020A0C - .pool -_08020A00: - ldr r0, =0x02022c8c - ldr r0, [r0] - ldr r0, [r0] - movs r1, 0x3 - bl StartObjectImageAnim -_08020A0C: - ldr r0, =0x02022c8c - ldr r1, [r0] - movs r0, 0 - strh r0, [r1, 0x14] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80209E0 - - thumb_func_start sub_8020A1C -sub_8020A1C: @ 8020A1C - push {r4,lr} - ldr r4, =0x02022c8c - ldr r1, [r4] - ldrh r0, [r1, 0x14] - cmp r0, 0x3 - bls _08020A30 -_08020A28: - movs r0, 0 - b _08020A62 - .pool -_08020A30: - adds r0, 0x1 - strh r0, [r1, 0x14] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x3 - bls _08020A60 - bl sub_801F0B0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - beq _08020A54 - ldr r0, [r4] - ldr r0, [r0] - movs r1, 0 - bl StartObjectImageAnim - b _08020A28 -_08020A54: - ldr r0, [r4] - ldr r0, [r0] - movs r1, 0x2 - bl StartObjectImageAnim - b _08020A28 -_08020A60: - movs r0, 0x1 -_08020A62: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8020A1C - - thumb_func_start sub_8020A68 -sub_8020A68: @ 8020A68 - push {r4,r5,lr} - ldr r0, =gUnknown_082F31BC - movs r1, 0x4C - movs r2, 0x98 - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r5, =0x02022c8c - ldr r2, [r5] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r4, =0x02020630 - adds r1, r4 - str r1, [r2, 0x8] - ldr r0, =gUnknown_082F31D4 - movs r1, 0x40 - movs r2, 0x98 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r2, [r5] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - str r1, [r2, 0x4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8020A68 - - thumb_func_start sub_8020ABC -sub_8020ABC: @ 8020ABC - push {r4,lr} - adds r4, r0, 0 - bl sub_801F198 - adds r3, r0, 0 - cmp r3, 0xF - bne _08020AD8 - adds r0, r4, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - b _08020AEC -_08020AD8: - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x5 - negs r1, r1 - ands r1, r0 - strb r1, [r2] - lsls r0, r3, 3 - adds r0, 0x4C - strh r0, [r4, 0x20] -_08020AEC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8020ABC - - thumb_func_start sub_8020AF4 -sub_8020AF4: @ 8020AF4 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x2E] - adds r0, 0x1 - movs r2, 0 - strh r0, [r1, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _08020B1A - strh r2, [r1, 0x2E] - ldrh r0, [r1, 0x24] - adds r0, 0x1 - strh r0, [r1, 0x24] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _08020B1A - strh r2, [r1, 0x24] -_08020B1A: - pop {r0} - bx r0 - thumb_func_end sub_8020AF4 - - thumb_func_start sub_8020B20 -sub_8020B20: @ 8020B20 - push {r4,r5,lr} - ldr r0, =gUnknown_082F322C - movs r1, 0x8 - movs r2, 0x98 - movs r3, 0x3 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r5, =0x02022c8c - ldr r2, [r5] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r4, =0x02020630 - adds r1, r4 - str r1, [r2, 0xC] - ldr r0, =gUnknown_082F3244 - movs r1, 0x20 - movs r2, 0x98 - movs r3, 0x4 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r2, [r5] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - str r1, [r2, 0x10] - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8020B20 - - thumb_func_start sub_8020B80 -sub_8020B80: @ 8020B80 - push {r4,lr} - bl sub_801F0B0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _08020BB8 - bl sub_801F0DC - cmp r0, 0 - beq _08020BC2 - ldr r3, =0x02022c8c - ldr r0, [r3] - ldr r1, [r0, 0x10] - adds r1, 0x3E - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r0, [r3] - ldr r0, [r0, 0x10] - movs r1, 0x3 - bl StartObjectImageAnim - b _08020BF6 - .pool -_08020BB8: - bl sub_801F1A4 - adds r4, r0, 0 - cmp r4, 0x3 - bne _08020BD8 -_08020BC2: - ldr r0, =0x02022c8c - ldr r0, [r0] - ldr r1, [r0, 0x10] - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - b _08020BF6 - .pool -_08020BD8: - ldr r3, =0x02022c8c - ldr r0, [r3] - ldr r1, [r0, 0x10] - adds r1, 0x3E - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r0, [r3] - ldr r0, [r0, 0x10] - lsls r1, r4, 24 - lsrs r1, 24 - bl StartObjectImageAnim -_08020BF6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8020B80 - - thumb_func_start sub_8020C00 -sub_8020C00: @ 8020C00 - ldr r0, =0x02022c90 - ldr r0, [r0] - bx lr - .pool - thumb_func_end sub_8020C00 - - thumb_func_start sub_8020C0C -sub_8020C0C: @ 8020C0C - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =0x02022c90 - ldr r0, [r5] - cmp r0, 0 - bne _08020C20 - movs r0, 0x2 - b _08020C5C - .pool -_08020C20: - cmp r4, 0 - bne _08020C26 - ldr r4, [r0] -_08020C26: - ldrb r0, [r0, 0xA] - bl remove_task - ldr r0, [r5] - bl Free - movs r0, 0 - str r0, [r5] - adds r0, r4, 0 - bl SetMainCallback2 - ldr r0, =c2_exit_to_overworld_2_switch - cmp r4, r0 - bne _08020C5A - ldr r2, =0x03003014 - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - movs r0, 0xC8 - lsls r0, 1 - bl current_map_music_set - ldr r0, =c1_overworld - bl set_callback1 -_08020C5A: - movs r0, 0 -_08020C5C: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8020C0C - - thumb_func_start sub_8020C70 -sub_8020C70: @ 8020C70 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - adds r4, r0, 0 - movs r0, 0 - mov r8, r0 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _08020C8E - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _08020CAC -_08020C8E: - adds r0, r4, 0 - bl SetMainCallback2 - ldr r0, =0x03005000 - mov r1, r8 - strh r1, [r0, 0x10] - strh r1, [r0, 0x12] - b _08020CF8 - .pool -_08020CAC: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r7, r0, 24 - mov r0, r8 - cmp r0, 0x1 - bls _08020CC8 - cmp r7, r8 - bcc _08020CDC -_08020CC8: - adds r0, r4, 0 - bl SetMainCallback2 - ldr r0, =0x03005000 - movs r1, 0 - strh r1, [r0, 0x10] - strh r1, [r0, 0x12] - b _08020CF8 - .pool -_08020CDC: - ldr r6, =0x02022c90 - ldr r0, =0x000041c0 - bl AllocZeroed - adds r5, r0, 0 - str r5, [r6] - cmp r5, 0 - bne _08020D10 - adds r0, r4, 0 - bl SetMainCallback2 - ldr r0, =0x03005000 - strh r5, [r0, 0x10] - strh r5, [r0, 0x12] -_08020CF8: - adds r0, 0xEE - ldrb r1, [r0] - movs r1, 0x1 - strb r1, [r0] - b _08020D74 - .pool -_08020D10: - str r4, [r5] - movs r4, 0 - strb r7, [r5, 0x8] - ldr r0, [r6] - mov r1, r8 - strb r1, [r0, 0x9] - ldr r0, [r6] - bl sub_8020FC4 - ldr r1, [r6] - movs r2, 0x1 - movs r0, 0x1 - strh r0, [r1, 0x12] - strb r2, [r1, 0xE] - ldr r1, [r6] - movs r0, 0x6 - strb r0, [r1, 0xF] - ldr r0, [r6] - adds r0, 0x36 - movs r2, 0x1 - negs r2, r2 - movs r1, 0x10 - str r1, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl sub_8024604 - ldr r2, [r6] - adds r2, 0x36 - movs r0, 0x4 - movs r1, 0x1 - bl sub_8022BEC - ldr r0, =sub_8020F88 - bl SetMainCallback2 - ldr r0, =sub_8020FA0 - movs r1, 0x8 - bl AddTask - ldr r1, [r6] - strb r0, [r1, 0xA] - ldr r2, =0x03003014 - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_08020D74: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8020C70 - - thumb_func_start sub_8020D8C -sub_8020D8C: @ 8020D8C - push {r4,lr} - sub sp, 0xC - ldr r1, =0x0203ce7c - ldrh r0, [r1] - subs r0, 0x85 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2B - bls _08020DA8 - movs r0, 0x85 - strh r0, [r1] - b _08020DB0 - .pool -_08020DA8: - ldrh r0, [r1] - movs r1, 0x1 - bl remove_item -_08020DB0: - ldr r4, =0x02022c90 - ldr r2, [r4] - ldrb r0, [r2, 0x8] - lsls r0, 5 - adds r0, r2, r0 - ldr r1, =0x0203ce7c - ldrh r1, [r1] - subs r1, 0x85 - adds r0, 0xA4 - movs r3, 0 - strh r1, [r0] - movs r0, 0x1 - strb r0, [r2, 0xE] - ldr r1, [r4] - movs r0, 0x9 - strb r0, [r1, 0xF] - ldr r0, [r4] - adds r0, 0x36 - movs r2, 0x1 - negs r2, r2 - movs r1, 0x10 - str r1, [sp] - str r3, [sp, 0x4] - str r3, [sp, 0x8] - movs r1, 0 - bl sub_8024604 - ldr r2, [r4] - adds r2, 0x36 - movs r0, 0x4 - movs r1, 0x1 - bl sub_8022BEC - ldr r0, =sub_8020FA0 - movs r1, 0x8 - bl AddTask - ldr r1, [r4] - strb r0, [r1, 0xA] - ldr r0, =sub_8020F88 - bl SetMainCallback2 - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8020D8C - - thumb_func_start sub_8020E1C -sub_8020E1C: @ 8020E1C - push {lr} - ldr r0, =0x02022c90 - ldr r0, [r0] - ldrb r0, [r0, 0xA] - bl remove_task - ldr r0, =sub_8020D8C - bl sub_81AABF0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8020E1C - - thumb_func_start sub_8020E3C -sub_8020E3C: @ 8020E3C - push {lr} - ldr r0, =sub_8020F74 - bl SetVBlankCallback - pop {r0} - bx r0 - .pool - thumb_func_end sub_8020E3C - - thumb_func_start sub_8020E4C -sub_8020E4C: @ 8020E4C - push {lr} - movs r0, 0 - bl SetVBlankCallback - pop {r0} - bx r0 - thumb_func_end sub_8020E4C - - thumb_func_start sub_8020E58 -sub_8020E58: @ 8020E58 - push {r4-r6,lr} - ldr r4, =0x02022c90 - ldr r0, [r4] - adds r0, 0x6C - ldrh r2, [r0] - lsls r2, 8 - movs r1, 0xF0 - lsls r1, 6 - adds r0, r2, 0 - bl sub_81515FC - adds r2, r0, 0 - ldr r0, [r4] - adds r0, 0x72 - ldrh r3, [r0] - lsls r3, 8 - adds r0, r3, 0 - adds r1, r2, 0 - bl sub_81515FC - adds r3, r0, 0 - ldr r0, =0x0000ffff - ands r3, r0 - ldr r2, [r4] - strh r3, [r2, 0x16] - ldrb r0, [r2, 0x9] - cmp r0, 0x3 - beq _08020EDC - cmp r0, 0x3 - bgt _08020EA4 - cmp r0, 0x2 - beq _08020EAE - b _08020F48 - .pool -_08020EA4: - cmp r0, 0x4 - beq _08020EEC - cmp r0, 0x5 - beq _08020F20 - b _08020F48 -_08020EAE: - ldr r5, =0x03005d90 - ldr r1, [r5] - movs r0, 0xF6 - lsls r0, 1 - adds r1, r0 - lsls r0, r3, 16 - lsrs r0, 16 - ldrh r1, [r1] - cmp r0, r1 - bls _08020F48 - adds r2, 0x25 - ldrb r0, [r2] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2] - ldr r0, [r5] - ldr r1, [r4] - ldrh r1, [r1, 0x16] - movs r2, 0xF6 - lsls r2, 1 - b _08020F14 - .pool -_08020EDC: - ldr r5, =0x03005d90 - ldr r0, [r5] - movs r6, 0xF7 - lsls r6, 1 - b _08020F28 - .pool -_08020EEC: - ldr r5, =0x03005d90 - ldr r1, [r5] - movs r0, 0xF8 - lsls r0, 1 - adds r1, r0 - lsls r0, r3, 16 - lsrs r0, 16 - ldrh r1, [r1] - cmp r0, r1 - bls _08020F48 - adds r2, 0x25 - ldrb r0, [r2] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2] - ldr r0, [r5] - ldr r1, [r4] - ldrh r1, [r1, 0x16] - movs r2, 0xF8 - lsls r2, 1 -_08020F14: - adds r0, r2 - strh r1, [r0] - b _08020F48 - .pool -_08020F20: - ldr r5, =0x03005d90 - ldr r0, [r5] - movs r6, 0xF9 - lsls r6, 1 -_08020F28: - adds r1, r0, r6 - lsls r0, r3, 16 - lsrs r0, 16 - ldrh r1, [r1] - cmp r0, r1 - bls _08020F48 - adds r2, 0x25 - ldrb r0, [r2] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2] - ldr r1, [r5] - ldr r0, [r4] - ldrh r0, [r0, 0x16] - adds r1, r6 - strh r0, [r1] -_08020F48: - ldr r4, =0x02022c90 - ldr r1, [r4] - ldr r0, [r1, 0x68] - str r0, [r1, 0x1C] - bl sub_8024700 - lsls r0, 24 - cmp r0, 0 - bne _08020F66 - ldr r0, [r4] - adds r0, 0x25 - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] -_08020F66: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8020E58 - - thumb_func_start sub_8020F74 -sub_8020F74: @ 8020F74 - push {lr} - bl copy_pal_bg_faded_to_pal_ram - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - pop {r0} - bx r0 - thumb_func_end sub_8020F74 - - thumb_func_start sub_8020F88 -sub_8020F88: @ 8020F88 - push {lr} - bl RunActiveTasks - bl RunTextPrinters - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - pop {r0} - bx r0 - thumb_func_end sub_8020F88 - - thumb_func_start sub_8020FA0 -sub_8020FA0: @ 8020FA0 - push {r4,lr} - ldr r4, =0x02022c90 - ldr r0, [r4] - ldr r2, [r0, 0x4] - cmp r2, 0 - beq _08020FB4 - adds r1, r0, 0 - adds r1, 0x36 - bl _call_via_r2 -_08020FB4: - ldr r0, [r4] - bl sub_8021450 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8020FA0 - - thumb_func_start sub_8020FC4 -sub_8020FC4: @ 8020FC4 - push {r4-r6,lr} - adds r6, r0, 0 - movs r5, 0 - b _08020FE6 -_08020FCC: - lsls r0, r5, 5 - adds r0, 0x98 - adds r0, r6, r0 - lsls r1, r5, 3 - subs r1, r5 - lsls r1, 2 - ldr r2, =0x020229f0 - adds r1, r2 - bl CopyString - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_08020FE6: - ldrb r0, [r6, 0x9] - cmp r5, r0 - bcc _08020FCC - cmp r5, 0x4 - bhi _08021012 -_08020FF0: - lsls r4, r5, 5 - adds r0, r4, 0 - adds r0, 0x98 - adds r0, r6, r0 - movs r1, 0x1 - movs r2, 0x7 - bl memset - adds r4, r6, r4 - adds r4, 0x9F - movs r0, 0xFF - strb r0, [r4] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x4 - bls _08020FF0 -_08021012: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x14] - lsls r0, 29 - lsrs r0, 29 - cmp r0, 0x1 - beq _0802103E - cmp r0, 0x1 - bgt _08021034 - cmp r0, 0 - beq _0802103A - b _08021046 - .pool -_08021034: - cmp r0, 0x2 - beq _08021042 - b _08021046 -_0802103A: - movs r0, 0x8 - b _08021044 -_0802103E: - movs r0, 0x4 - b _08021044 -_08021042: - movs r0, 0x1 -_08021044: - strb r0, [r6, 0xB] -_08021046: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8020FC4 - - thumb_func_start sub_802104C -sub_802104C: @ 802104C - push {r4,r5,lr} - sub sp, 0xC - bl sub_8020C00 - adds r5, r0, 0 - cmp r5, 0 - bne _08021060 - movs r0, 0x1 - negs r0, r0 - b _08021304 -_08021060: - ldrb r0, [r5, 0xC] - cmp r0, 0x9 - bls _08021068 - b _080212FC -_08021068: - lsls r0, 2 - ldr r1, =_08021078 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08021078: - .4byte _080210A0 - .4byte _080210BE - .4byte _080210E4 - .4byte _080210F2 - .4byte _08021178 - .4byte _080211BE - .4byte _080211EC - .4byte _0802121C - .4byte _08021278 - .4byte _080212B4 -_080210A0: - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - bl SetHBlankCallback - movs r0, 0 - movs r1, 0 - bl SetGpuReg - bl remove_some_task - bl reset_temp_tile_data_buffers - b _080212FC -_080210BE: - add r0, sp, 0x8 - movs r4, 0 - strh r4, [r0] - movs r1, 0xE0 - lsls r1, 19 - ldr r2, =0x01000200 - bl CpuSet - ldr r0, =0x0300301c - strb r4, [r0] - movs r0, 0x3 - bl sub_8034C54 - b _080212FC - .pool -_080210E4: - bl sub_80A1A74 - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - b _080212FC -_080210F2: - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_082F32C8 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - movs r0, 0xE0 - lsls r0, 1 - adds r1, r5, r0 - movs r0, 0x1 - bl SetBgTilemapBuffer - movs r0, 0x87 - lsls r0, 6 - adds r1, r5, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - movs r0, 0xC7 - lsls r0, 6 - adds r1, r5, r0 - movs r0, 0x3 - bl SetBgTilemapBuffer - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - b _080212FC - .pool -_08021178: - movs r4, 0x20 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r4, [sp] - movs r0, 0x40 - str r0, [sp, 0x4] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - b _080212FC -_080211BE: - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - ldr r1, =gUnknown_08DE34B8 - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - b _080212FC - .pool -_080211EC: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - beq _080211F8 - b _08021302 -_080211F8: - bl sub_81971D0 - bl sub_8197200 - adds r0, r5, 0 - bl sub_8022588 - adds r0, r5, 0 - bl sub_8022600 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x8] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0, 0x8] - b _080212FC - .pool -_0802121C: - ldr r0, =gUnknown_08DE3398 - movs r2, 0xC0 - lsls r2, 1 - movs r1, 0 - bl gpu_pal_apply - ldr r1, =gUnknown_082F3C8C - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - ldr r1, =gUnknown_082F3DBC - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - ldr r1, =gUnknown_082F3F54 - movs r0, 0x3 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - adds r0, r5, 0 - bl sub_80226D0 - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - b _080212FC - .pool -_08021278: - bl sub_800E0E8 - movs r0, 0 - movs r1, 0 - bl sub_800DFB4 - adds r0, r5, 0 - bl sub_8022730 - ldr r0, =0x02021bbe - ldrh r1, [r0] - negs r1, r1 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x16 - bl SetGpuReg - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - b _080212FC - .pool -_080212B4: - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x8] - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuRegBits - bl sub_8020E3C - movs r0, 0 - strb r0, [r5, 0xC] - movs r0, 0x1 - b _08021304 - .pool -_080212FC: - ldrb r0, [r5, 0xC] - adds r0, 0x1 - strb r0, [r5, 0xC] -_08021302: - movs r0, 0 -_08021304: - add sp, 0xC - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_802104C - - thumb_func_start sub_802130C -sub_802130C: @ 802130C - push {r4,r5,lr} - sub sp, 0x8 - bl sub_8020C00 - adds r5, r0, 0 - cmp r5, 0 - bne _08021320 - movs r0, 0x1 - negs r0, r0 - b _08021446 -_08021320: - ldrb r0, [r5, 0xC] - cmp r0, 0x7 - bls _08021328 - b _0802143E -_08021328: - lsls r0, 2 - ldr r1, =_08021338 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08021338: - .4byte _08021358 - .4byte _0802135E - .4byte _08021368 - .4byte _0802137E - .4byte _0802138A - .4byte _080213E6 - .4byte _08021426 - .4byte _08021436 -_08021358: - bl sub_8010434 - b _0802143E -_0802135E: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08021444 -_08021368: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - bl fade_and_return_progress_probably - b _0802143E -_0802137E: - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - beq _0802143E - b _08021444 -_0802138A: - movs r4, 0x20 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - b _0802143E -_080213E6: - bl FreeAllWindowBuffers - movs r0, 0 - bl HideBg - movs r0, 0 - bl UnsetBgTilemapBuffer - movs r0, 0x1 - bl HideBg - movs r0, 0x1 - bl UnsetBgTilemapBuffer - movs r0, 0x2 - bl HideBg - movs r0, 0x2 - bl UnsetBgTilemapBuffer - movs r0, 0x3 - bl HideBg - movs r0, 0x3 - bl UnsetBgTilemapBuffer - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl ClearGpuRegBits - b _0802143E -_08021426: - bl sub_800E084 - adds r0, r5, 0 - bl sub_8022960 - bl sub_8034CC8 - b _0802143E -_08021436: - movs r0, 0 - strb r0, [r5, 0xC] - movs r0, 0x1 - b _08021446 -_0802143E: - ldrb r0, [r5, 0xC] - adds r0, 0x1 - strb r0, [r5, 0xC] -_08021444: - movs r0, 0 -_08021446: - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_802130C - - thumb_func_start sub_8021450 -sub_8021450: @ 8021450 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x02021bbe - ldrh r1, [r4, 0x2C] - ldrh r2, [r4, 0x2A] - adds r1, r2 - strh r1, [r0] - negs r1, r1 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x16 - bl SetGpuReg - ldrh r0, [r4, 0x12] - cmp r0, 0x7 - bne _0802147C - movs r1, 0x9C - lsls r1, 1 - adds r0, r4, r1 - ldrh r1, [r4, 0x28] - bl sub_8022524 -_0802147C: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8021450 - - thumb_func_start sub_8021488 -sub_8021488: @ 8021488 - movs r1, 0 - ldr r2, =0x0000ff98 - strh r2, [r0, 0x2A] - strh r1, [r0, 0x2C] - ldr r0, =0x02021bbc - strh r1, [r0] - ldr r0, =0x02021bbe - strh r2, [r0] - bx lr - .pool - thumb_func_end sub_8021488 - - thumb_func_start sub_80214A8 -sub_80214A8: @ 80214A8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - mov r10, r0 - str r1, [sp] - movs r0, 0 - mov r9, r0 - mov r1, r10 - ldrb r1, [r1, 0x9] - cmp r9, r1 - bcc _080214C6 - b _080215E4 -_080214C6: - ldr r1, =gUnknown_082F41E8 - mov r2, r9 - lsls r0, r2, 1 - adds r0, r1 - ldrh r2, [r0] - mov r1, r9 - lsls r0, r1, 5 - add r0, r10 - adds r0, 0xA4 - ldrh r3, [r0] - adds r3, 0x85 - lsls r3, 16 - lsrs r3, 16 - ldr r0, =gUnknown_082F436C - adds r1, r2, 0 - bl AddItemIconObjectWithCustomObjectTemplate - lsls r0, 24 - lsrs r0, 24 - mov r2, r9 - lsls r3, r2, 2 - ldr r1, [sp] - adds r1, 0x38 - adds r6, r1, r3 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - str r1, [r6] - ldrb r0, [r1, 0x5] - movs r2, 0xC - orrs r0, r2 - strb r0, [r1, 0x5] - ldr r2, [r6] - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - ldr r1, [r6] - ldr r0, [sp] - adds r0, 0xC - adds r0, r3 - mov r8, r0 - ldr r0, [r0] - ldrh r0, [r0, 0x8] - adds r0, 0x78 - strh r0, [r1, 0x20] - ldr r1, [r6] - ldr r0, =0x0000fff0 - strh r0, [r1, 0x22] - ldr r3, [r6] - adds r5, r3, 0 - adds r5, 0x2E - movs r0, 0x80 - lsls r0, 2 - strh r0, [r5, 0x2] - movs r0, 0x20 - strh r0, [r5, 0x4] - movs r0, 0x70 - strh r0, [r5, 0xE] - mov r2, r8 - ldr r1, [r2] - ldrh r0, [r1, 0xA] - ldrh r1, [r1, 0x8] - subs r0, r1 - lsls r0, 16 - asrs r1, r0, 16 - adds r0, r1, 0 - cmp r1, 0 - bge _08021558 - adds r0, r1, 0x3 -_08021558: - asrs r0, 2 - strh r0, [r5, 0xC] - lsls r0, r1, 23 - lsrs r7, r0, 16 - movs r2, 0x80 - lsls r2, 2 - adds r2, 0x20 - lsrs r2, 1 - movs r0, 0x7 - movs r1, 0xFE - lsls r1, 6 - str r3, [sp, 0x4] - bl sub_81515D4 - adds r4, r0, 0 - ldr r0, [r6] - ldrh r0, [r0, 0x20] - lsls r0, 7 - ldr r3, [sp, 0x4] - strh r0, [r3, 0x2E] - lsls r1, r7, 16 - asrs r1, 16 - lsls r4, 16 - asrs r4, 16 - movs r0, 0x7 - adds r2, r4, 0 - bl sub_81515D4 - strh r0, [r5, 0x6] - movs r0, 0x7 - adds r1, r4, 0 - movs r2, 0x55 - bl sub_8151550 - adds r2, r0, 0 - movs r0, 0 - strh r0, [r5, 0x8] - lsls r2, 16 - asrs r2, 16 - movs r0, 0x7 - movs r1, 0xFE - lsls r1, 6 - bl sub_81515D4 - strh r0, [r5, 0xA] - ldrh r0, [r5, 0xE] - ldr r2, =0xffff8000 - adds r1, r2, 0 - orrs r0, r1 - strh r0, [r5, 0xE] - mov r1, r8 - ldr r0, [r1] - movs r2, 0x8 - ldrsh r0, [r0, r2] - cmp r0, 0 - bge _080215D0 - ldr r0, [r6] - movs r1, 0x1 - bl StartObjectRotScalAnim -_080215D0: - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - mov r0, r10 - ldrb r0, [r0, 0x9] - cmp r9, r0 - bcs _080215E4 - b _080214C6 -_080215E4: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80214A8 - - thumb_func_start sub_8021608 -sub_8021608: @ 8021608 - push {r4-r6,lr} - adds r5, r0, 0 - adds r4, r5, 0 - adds r4, 0x2E - ldrh r0, [r4, 0x4] - ldrh r1, [r4, 0x2] - adds r0, r1 - strh r0, [r4, 0x2] - lsls r0, 16 - asrs r0, 24 - ldrh r2, [r5, 0x26] - adds r0, r2 - strh r0, [r5, 0x26] - movs r1, 0xE - ldrsh r0, [r4, r1] - movs r6, 0x80 - lsls r6, 8 - ands r0, r6 - cmp r0, 0 - beq _0802166E - ldrh r0, [r4, 0x6] - ldrh r2, [r5, 0x2E] - adds r0, r2 - strh r0, [r5, 0x2E] - ldrh r0, [r4, 0xA] - ldrh r1, [r4, 0x8] - adds r0, r1 - strh r0, [r4, 0x8] - lsls r0, 16 - asrs r0, 23 - movs r2, 0xC - ldrsh r1, [r4, r2] - bl sine - strh r0, [r5, 0x24] - movs r1, 0xE - ldrsh r0, [r4, r1] - ands r0, r6 - cmp r0, 0 - beq _0802166E - ldrh r0, [r4, 0x8] - lsls r0, 16 - asrs r0, 23 - cmp r0, 0x7E - ble _0802166E - movs r0, 0 - strh r0, [r5, 0x24] - ldrh r1, [r4, 0xE] - ldr r0, =0x00007fff - ands r0, r1 - strh r0, [r4, 0xE] -_0802166E: - ldrh r0, [r4] - lsls r0, 16 - asrs r0, 23 - strh r0, [r5, 0x20] - movs r2, 0x22 - ldrsh r1, [r5, r2] - movs r2, 0x26 - ldrsh r0, [r5, r2] - adds r1, r0 - ldrh r2, [r4, 0xE] - ldr r0, =0x00007fff - ands r0, r2 - cmp r1, r0 - blt _0802169A - ldr r0, =DummyObjectCallback - str r0, [r5, 0x1C] - adds r0, r5, 0 - bl obj_free_rotscale_entry - adds r0, r5, 0 - bl RemoveObjectAndFreeTiles -_0802169A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8021608 - - thumb_func_start sub_80216A8 -sub_80216A8: @ 80216A8 - push {r4-r7,lr} - adds r6, r0, 0 - movs r5, 0 - ldrb r0, [r6, 0x9] - cmp r5, r0 - bcs _080216D4 - ldr r7, =gUnknown_082F41E8 -_080216B6: - lsls r0, r5, 1 - adds r0, r7 - ldrh r4, [r0] - adds r0, r4, 0 - bl FreeObjectPaletteByTag - adds r0, r4, 0 - bl FreeObjectTilesByTag - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldrb r0, [r6, 0x9] - cmp r5, r0 - bcc _080216B6 -_080216D4: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80216A8 - - thumb_func_start sub_80216E0 -sub_80216E0: @ 80216E0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - adds r6, r0, 0 - str r1, [sp] - movs r0, 0 - str r0, [sp, 0x4] - movs r1, 0x4E - adds r1, r6 - mov r10, r1 - mov r9, r0 - ldrb r2, [r6, 0x9] - cmp r0, r2 - bcs _080217AE - ldr r7, =gUnknown_082F41CC -_08021704: - mov r3, r10 - ldrh r0, [r3, 0xA] - mov r4, r9 - lsls r1, r4, 1 - add r1, r9 - asrs r0, r1 - lsls r0, 16 - movs r1, 0xE0 - lsls r1, 11 - ands r1, r0 - lsrs r1, 16 - mov r8, r1 - cmp r1, 0 - beq _0802179E - ldr r0, [sp, 0x4] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08021748 - lsls r4, 2 - ldr r5, [sp] - adds r5, 0x24 - adds r0, r5, r4 - ldr r0, [r0] - movs r1, 0x1 - bl StartObjectImageAnim - b _0802175A - .pool -_08021748: - mov r0, r9 - lsls r4, r0, 2 - ldr r5, [sp] - adds r5, 0x24 - adds r0, r5, r4 - ldr r0, [r0] - movs r1, 0 - bl StartObjectImageAnim -_0802175A: - adds r3, r5, r4 - ldr r2, [r3] - adds r2, 0x3E - ldrb r0, [r2] - movs r4, 0x5 - negs r4, r4 - adds r1, r4, 0 - ands r0, r1 - strb r0, [r2] - ldr r2, [r3] - adds r2, 0x2C - ldrb r0, [r2] - subs r4, 0x3C - adds r1, r4, 0 - ands r0, r1 - strb r0, [r2] - ldr r2, [r3] - movs r0, 0x3 - mov r1, r8 - ands r1, r0 - mov r8, r1 - subs r1, 0x1 - lsls r1, 1 - adds r0, r1, r7 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - strh r0, [r2, 0x24] - ldr r2, [r3] - ldr r3, =gUnknown_082F41CD - adds r1, r3 - movs r0, 0 - ldrsb r0, [r1, r0] - strh r0, [r2, 0x26] -_0802179E: - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldrb r4, [r6, 0x9] - cmp r9, r4 - bcc _08021704 -_080217AE: - ldr r0, [sp, 0x4] - cmp r0, 0 - bne _080217C0 - adds r2, r6, 0 - adds r2, 0x25 - ldrb r1, [r2] - b _0802189C - .pool -_080217C0: - ldrh r0, [r6, 0x28] - movs r1, 0x3 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - mov r1, r8 - str r1, [sp, 0x8] - movs r2, 0 - mov r9, r2 - mov r3, r10 - ldrh r1, [r3, 0xC] - lsls r0, r1, 1 - adds r0, 0x3 - adds r6, 0x25 - str r6, [sp, 0xC] - adds r3, r1, 0 - cmp r9, r0 - bge _08021890 -_080217E8: - mov r4, r9 - lsls r1, r4, 2 - ldr r0, [sp] - adds r0, 0x4C - adds r7, r0, r1 - ldr r2, [r7] - adds r0, r2, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0802187E - ldr r0, =sub_8022B28 - str r0, [r2, 0x1C] - lsls r1, r4, 1 - ldr r3, =gUnknown_082F41D2 - adds r0, r1, r3 - movs r4, 0 - ldrsb r4, [r0, r4] - adds r0, r4, 0 - adds r0, 0x78 - strh r0, [r2, 0x20] - ldr r2, [r7] - ldr r0, =gUnknown_082F41D3 - adds r1, r0 - movs r6, 0 - ldrsb r6, [r1, r6] - mov r1, r8 - lsls r0, r1, 2 - subs r0, 0x88 - subs r0, r6, r0 - strh r0, [r2, 0x22] - ldr r5, [r7] - ldr r2, [sp, 0x8] - lsls r1, r2, 2 - adds r0, r4, 0 - bl __divsi3 - adds r4, r0 - strh r4, [r5, 0x24] - ldr r0, [r7] - strh r6, [r0, 0x26] - mov r3, r10 - ldrb r1, [r3, 0x4] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08021860 - ldr r0, [r7] - movs r1, 0x1 - bl StartObjectImageAnim - b _08021868 - .pool -_08021860: - ldr r0, [r7] - movs r1, 0 - bl StartObjectImageAnim -_08021868: - mov r0, r8 - adds r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - mov r4, r10 - ldrh r3, [r4, 0xC] - cmp r0, 0x3 - bls _0802187E - movs r0, 0 - mov r8, r0 -_0802187E: - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r0, r3, 1 - adds r0, 0x3 - cmp r9, r0 - blt _080217E8 -_08021890: - ldr r2, [sp, 0xC] - ldrb r1, [r2] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080218A6 -_0802189C: - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - b _080218C4 -_080218A6: - ldr r3, [sp, 0x4] - cmp r3, 0x1 - bne _080218B4 - movs r0, 0x4E - bl audio_play - b _080218BA -_080218B4: - movs r0, 0x4D - bl audio_play -_080218BA: - ldr r4, [sp, 0xC] - ldrb r0, [r4] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r4] -_080218C4: - 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_80216E0 - - thumb_func_start sub_80218D4 -sub_80218D4: @ 80218D4 - push {r4-r7,lr} - adds r5, r0, 0 - adds r6, r1, 0 - movs r2, 0 - ldrb r0, [r5, 0x9] - cmp r2, r0 - bcs _08021906 - adds r4, r6, 0 - adds r4, 0x24 - movs r7, 0x4 - adds r3, r0, 0 -_080218EA: - lsls r0, r2, 2 - adds r0, r4, r0 - ldr r0, [r0] - adds r0, 0x3E - ldrb r1, [r0] - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0 - beq _08021920 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, r3 - bcc _080218EA -_08021906: - movs r2, 0 - adds r3, r6, 0 - adds r3, 0x4C - movs r4, 0x4 -_0802190E: - lsls r0, r2, 2 - adds r0, r3, r0 - ldr r0, [r0] - adds r0, 0x3E - ldrb r1, [r0] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - bne _08021924 -_08021920: - movs r0, 0 - b _0802193C -_08021924: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xA - bls _0802190E - movs r1, 0x2C - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _0802193A - movs r0, 0 - strh r0, [r5, 0x2C] -_0802193A: - movs r0, 0x1 -_0802193C: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80218D4 - - thumb_func_start sub_8021944 -sub_8021944: @ 8021944 - push {r4-r7,lr} - adds r6, r0, 0 - lsls r4, r1, 16 - lsrs r4, 16 - movs r7, 0 - movs r5, 0xE1 - lsls r5, 4 - adds r0, r4, 0 - adds r1, r5, 0 - bl __udivsi3 - strh r0, [r6, 0x4] - adds r0, r4, 0 - adds r1, r5, 0 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3C - bl __udivsi3 - strh r0, [r6, 0x6] - adds r0, r4, 0 - movs r1, 0x3C - bl __umodsi3 - lsls r0, 24 - asrs r0, 16 - movs r1, 0x4 - bl sub_8151534 - adds r2, r7, 0 - lsls r0, 16 - asrs r3, r0, 16 - movs r0, 0x7 - mov r12, r0 - ldr r5, =gUnknown_082F334C - movs r4, 0x1 -_08021990: - mov r0, r12 - subs r1, r0, r2 - adds r0, r3, 0 - asrs r0, r1 - ands r0, r4 - cmp r0, 0 - beq _080219A6 - lsls r0, r2, 2 - adds r0, r5 - ldr r0, [r0] - adds r7, r0 -_080219A6: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x7 - bls _08021990 - ldr r1, =0x000f4240 - adds r0, r7, 0 - bl __udivsi3 - strh r0, [r6, 0x8] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8021944 - - thumb_func_start sub_80219C8 -sub_80219C8: @ 80219C8 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0xC - adds r6, r0, 0 - adds r4, r1, 0 - adds r5, r2, 0 - mov r8, r3 - lsls r6, 24 - lsrs r6, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - movs r2, 0x1 - negs r2, r2 - movs r0, 0x2 - mov r1, r8 - bl GetStringWidth - lsls r4, 2 - lsrs r0, 1 - subs r4, r0 - lsls r4, 24 - lsrs r4, 24 - lsls r0, r5, 1 - adds r0, r5 - ldr r1, =gUnknown_082F32D8 - adds r0, r1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - mov r0, r8 - str r0, [sp, 0x8] - adds r0, r6, 0 - movs r1, 0x2 - adds r2, r4, 0 - movs r3, 0 - bl box_print - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80219C8 - - thumb_func_start sub_8021A28 -sub_8021A28: @ 8021A28 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x2C - str r0, [sp, 0xC] - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x10] - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x14] - lsls r3, 24 - movs r0, 0 - str r0, [sp, 0x18] - movs r1, 0 - str r1, [sp, 0x1C] - ldr r2, [sp, 0xC] - adds r2, 0x68 - str r2, [sp, 0x20] - movs r4, 0xF0 - lsls r4, 24 - adds r3, r4 - lsrs r3, 24 - ldr r0, [sp, 0x10] - cmp r0, 0x2 - bne _08021A68 - adds r0, r3, 0 - subs r0, 0x2A - lsls r0, 24 - lsrs r3, r0, 24 -_08021A68: - ldr r2, [sp, 0xC] - ldrb r1, [r2, 0x9] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 1 - subs r6, r3, r0 - cmp r6, 0 - ble _08021A84 - lsrs r0, r6, 31 - adds r0, r6, r0 - asrs r0, 1 - adds r6, r0, 0 - adds r6, 0x10 - b _08021A86 -_08021A84: - movs r6, 0x10 -_08021A86: - movs r5, 0 - ldr r3, [sp, 0xC] - ldrb r3, [r3, 0x9] - cmp r5, r3 - bcc _08021A92 - b _08021D14 -_08021A92: - ldr r4, [sp, 0x10] - lsls r4, 2 - str r4, [sp, 0x24] -_08021A98: - bl sub_81AFBF0 - ldr r0, [sp, 0x10] - cmp r0, 0x1 - beq _08021B48 - cmp r0, 0x1 - bgt _08021AC0 - cmp r0, 0 - beq _08021ADE - ldr r4, [sp, 0x14] - subs r4, 0x4 - lsls r1, r6, 24 - mov r10, r1 - ldr r2, [sp, 0x1C] - adds r2, 0xA2 - mov r9, r2 - ldr r3, [sp, 0x18] - lsls r3, 5 - mov r8, r3 - b _08021C5A -_08021AC0: - ldr r4, [sp, 0x10] - cmp r4, 0x2 - bne _08021AC8 - b _08021C1C -_08021AC8: - ldr r4, [sp, 0x14] - subs r4, 0x4 - lsls r0, r6, 24 - mov r10, r0 - ldr r1, [sp, 0x1C] - adds r1, 0xA2 - mov r9, r1 - ldr r2, [sp, 0x18] - lsls r2, 5 - mov r8, r2 - b _08021C5A -_08021ADE: - ldr r0, [sp, 0x20] - adds r0, 0x20 - adds r0, r5 - ldrb r0, [r0] - str r0, [sp, 0x18] - lsls r3, r5, 1 - ldr r2, [sp, 0x20] - adds r2, 0xC - cmp r5, 0 - beq _08021B04 - adds r0, r2, r3 - subs r1, r5, 0x1 - lsls r1, 1 - adds r1, r2, r1 - ldrh r0, [r0] - ldrh r1, [r1] - cmp r0, r1 - beq _08021B04 - str r5, [sp, 0x1C] -_08021B04: - ldr r4, [sp, 0x24] - ldr r1, [sp, 0x10] - adds r0, r4, r1 - lsls r0, 1 - adds r0, r3, r0 - adds r0, r2, r0 - ldrh r1, [r0] - ldr r0, =0x02021fc4 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r0, =gUnknown_082F43B4 - adds r0, r4, r0 - ldr r1, [r0] - ldr r0, =0x02021fc4 - bl AppendString - ldr r4, [sp, 0x14] - subs r4, 0x4 - lsls r2, r6, 24 - mov r10, r2 - ldr r3, [sp, 0x1C] - adds r3, 0xA2 - mov r9, r3 - ldr r0, [sp, 0x18] - lsls r0, 5 - mov r8, r0 - b _08021C5A - .pool -_08021B48: - ldr r1, [sp, 0x20] - adds r0, r1, r5 - adds r0, 0x28 - ldrb r0, [r0] - str r0, [sp, 0x18] - lsls r3, r5, 1 - adds r2, r1, 0 - adds r2, 0xC - cmp r5, 0 - beq _08021B72 - adds r0, r3, 0 - adds r0, 0xA - adds r0, r2, r0 - adds r1, r3, 0 - adds r1, 0x8 - adds r1, r2, r1 - ldrh r0, [r0] - ldrh r1, [r1] - cmp r0, r1 - beq _08021B72 - str r5, [sp, 0x1C] -_08021B72: - ldr r0, [sp, 0x24] - ldr r1, [sp, 0x10] - adds r4, r0, r1 - lsls r4, 1 - adds r4, r3, r4 - adds r4, r2, r4 - ldrh r1, [r4] - lsrs r1, 4 - ldr r0, =0x02021cc4 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - movs r7, 0 - ldrb r0, [r4] - movs r3, 0xF - ands r3, r0 - movs r2, 0 - ldr r4, [sp, 0x10] - lsls r4, 2 - str r4, [sp, 0x28] - ldr r4, [sp, 0x14] - subs r4, 0x4 - lsls r0, r6, 24 - mov r10, r0 - ldr r1, [sp, 0x1C] - adds r1, 0xA2 - mov r9, r1 - ldr r0, [sp, 0x18] - lsls r0, 5 - mov r8, r0 - adds r6, 0xE - adds r5, 0x1 - ldr r1, =gUnknown_082F334C - mov r12, r1 -_08021BB8: - movs r0, 0x3 - subs r1, r0, r2 - adds r0, r3, 0 - asrs r0, r1 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08021BD0 - lsls r0, r2, 2 - add r0, r12 - ldr r0, [r0] - adds r7, r0 -_08021BD0: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x3 - bls _08021BB8 - adds r0, r7, 0 - ldr r1, =0x000f4240 - bl __udivsi3 - lsls r0, 24 - lsrs r3, r0, 24 - ldr r0, =0x02021dc4 - adds r1, r3, 0 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r0, =gUnknown_082F43B4 - ldr r2, [sp, 0x28] - adds r0, r2, r0 - ldr r1, [r0] - ldr r0, =0x02021fc4 - bl ExpandStringRefs - b _08021C5E - .pool -_08021C1C: - str r5, [sp, 0x18] - str r5, [sp, 0x1C] - lsls r7, r5, 5 - ldr r3, [sp, 0xC] - adds r0, r3, r7 - adds r0, 0xA4 - ldrb r2, [r0] - cmp r2, 0x2B - bls _08021C30 - movs r2, 0 -_08021C30: - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - ldr r0, =gBerries - adds r1, r0 - ldr r0, =0x02021cc4 - bl CopyString - ldr r0, =gUnknown_082F43B4 - ldr r1, [r0, 0x8] - ldr r0, =0x02021fc4 - bl ExpandStringRefs - ldr r4, [sp, 0x14] - subs r4, 0x4 - lsls r0, r6, 24 - mov r10, r0 - movs r1, 0xA2 - adds r1, r5 - mov r9, r1 - mov r8, r7 -_08021C5A: - adds r6, 0xE - adds r5, 0x1 -_08021C5E: - movs r0, 0x2 - ldr r1, =0x02021fc4 - adds r2, r4, 0 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - ldr r3, [sp, 0xC] - movs r4, 0xDD - lsls r4, 1 - adds r0, r3, r4 - ldrb r0, [r0] - lsls r2, 24 - lsrs r2, 24 - mov r1, r10 - lsrs r3, r1, 24 - ldr r1, =gUnknown_082F32D8 - str r1, [sp] - movs r4, 0 - str r4, [sp, 0x4] - ldr r1, =0x02021fc4 - str r1, [sp, 0x8] - movs r1, 0x2 - bl box_print - ldr r3, [sp, 0x18] - ldr r2, [sp, 0xC] - ldrb r2, [r2, 0x8] - cmp r3, r2 - bne _08021CC0 - ldr r0, =0x02021ec4 - ldr r1, =gUnknown_085ED7D4 - bl CopyString - b _08021CC8 - .pool -_08021CC0: - ldr r0, =0x02021ec4 - ldr r1, =gUnknown_085ED7E0 - bl CopyString -_08021CC8: - ldr r4, =0x02021ec4 - mov r3, r9 - strb r3, [r4] - mov r1, r8 - adds r1, 0x98 - ldr r0, [sp, 0xC] - adds r1, r0, r1 - movs r0, 0 - bl sub_81AFC0C - ldr r0, =0x02021fc4 - adds r1, r4, 0 - bl sub_81AFC28 - ldr r1, [sp, 0xC] - movs r2, 0xDD - lsls r2, 1 - adds r0, r1, r2 - ldrb r0, [r0] - mov r4, r10 - lsrs r3, r4, 24 - ldr r1, =gUnknown_082F32D8 - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - ldr r2, =0x02021fc4 - str r2, [sp, 0x8] - movs r1, 0x2 - movs r2, 0x4 - bl box_print - lsls r0, r5, 24 - lsrs r5, r0, 24 - ldr r3, [sp, 0xC] - ldrb r3, [r3, 0x9] - cmp r5, r3 - bcs _08021D14 - b _08021A98 -_08021D14: - add sp, 0x2C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8021A28 - - thumb_func_start sub_8021D34 -sub_8021D34: @ 8021D34 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - mov r8, r0 - movs r0, 0 - mov r10, r0 - movs r6, 0 - movs r1, 0 - str r1, [sp, 0xC] - mov r2, r8 - adds r2, 0x68 - str r2, [sp, 0x10] - movs r4, 0xDD - lsls r4, 1 - add r4, r8 - mov r9, r4 - ldrb r0, [r4] - movs r1, 0x4 - bl GetWindowAttribute - lsls r0, 27 - movs r1, 0xD6 - lsls r1, 24 - adds r0, r1 - lsrs r7, r0, 24 - movs r0, 0x9C - lsls r0, 1 - add r0, r8 - ldr r2, [sp, 0x10] - ldrh r1, [r2, 0x4] - bl sub_8021944 - ldrb r0, [r4] - ldr r4, =gUnknown_082F32D8 - str r4, [sp] - str r6, [sp, 0x4] - ldr r1, =gUnknown_085ED808 - str r1, [sp, 0x8] - movs r1, 0x2 - movs r2, 0 - adds r3, r7, 0 - bl box_print - ldr r4, =gUnknown_085ED840 - movs r0, 0x2 - adds r1, r4, 0 - movs r2, 0x1 - negs r2, r2 - bl GetStringWidth - movs r1, 0xB0 - subs r0, r1, r0 - lsls r0, 24 - lsrs r6, r0, 24 - mov r2, r9 - ldrb r0, [r2] - ldr r1, =gUnknown_082F32D8 - str r1, [sp] - mov r2, r10 - str r2, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x2 - adds r2, r6, 0 - adds r3, r7, 0 - bl box_print - movs r0, 0x9F - lsls r0, 1 - add r0, r8 - movs r4, 0 - ldrsh r1, [r0, r4] - ldr r0, =0x02021cc4 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r0, =0x02021dc4 - movs r1, 0xA0 - lsls r1, 1 - add r1, r8 - movs r2, 0 - ldrsh r1, [r1, r2] - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r5, =0x02021fc4 - ldr r1, =gUnknown_085ED838 - adds r0, r5, 0 - bl ExpandStringRefs - movs r0, 0x2 - adds r1, r5, 0 - movs r2, 0x1 - negs r2, r2 - bl GetStringWidth - subs r0, r6, r0 - lsls r0, 24 - lsrs r6, r0, 24 - mov r4, r9 - ldrb r0, [r4] - ldr r1, =gUnknown_082F32D8 - str r1, [sp] - mov r2, r10 - str r2, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x2 - adds r2, r6, 0 - adds r3, r7, 0 - bl box_print - ldr r4, =gUnknown_085ED830 - movs r0, 0x2 - adds r1, r4, 0 - movs r2, 0x1 - negs r2, r2 - bl GetStringWidth - subs r0, r6, r0 - lsls r0, 24 - lsrs r6, r0, 24 - mov r1, r9 - ldrb r0, [r1] - ldr r2, =gUnknown_082F32D8 - str r2, [sp] - mov r1, r10 - str r1, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x2 - adds r2, r6, 0 - adds r3, r7, 0 - bl box_print - movs r0, 0x9E - lsls r0, 1 - add r0, r8 - movs r2, 0 - ldrsh r1, [r0, r2] - ldr r0, =0x02021cc4 - movs r2, 0x2 - movs r3, 0x1 - bl ConvertIntToDecimalString - ldr r1, =gUnknown_085ED82C - adds r0, r5, 0 - bl ExpandStringRefs - movs r0, 0x2 - adds r1, r5, 0 - movs r2, 0x1 - negs r2, r2 - bl GetStringWidth - subs r0, r6, r0 - lsls r0, 24 - lsrs r6, r0, 24 - mov r4, r9 - ldrb r0, [r4] - ldr r1, =gUnknown_082F32D8 - str r1, [sp] - mov r2, r10 - str r2, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x2 - adds r2, r6, 0 - adds r3, r7, 0 - bl box_print - adds r0, r7, 0 - adds r0, 0xE - lsls r0, 24 - lsrs r7, r0, 24 - ldrb r0, [r4] - ldr r4, =gUnknown_082F32D8 - str r4, [sp] - mov r1, r10 - str r1, [sp, 0x4] - ldr r1, =gUnknown_085ED810 - str r1, [sp, 0x8] - movs r1, 0x2 - movs r2, 0 - adds r3, r7, 0 - bl box_print - ldr r4, =gUnknown_085ED850 - movs r0, 0x2 - adds r1, r4, 0 - movs r2, 0x1 - negs r2, r2 - bl GetStringWidth - movs r2, 0xB0 - subs r0, r2, r0 - lsls r0, 24 - str r0, [sp, 0x18] - lsrs r6, r0, 24 - mov r1, r9 - ldrb r0, [r1] - ldr r2, =gUnknown_082F32D8 - str r2, [sp] - mov r1, r10 - str r1, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x2 - adds r2, r6, 0 - adds r3, r7, 0 - bl box_print - mov r4, r8 - ldrb r2, [r4, 0x16] - ldrh r0, [r4, 0x16] - mov r12, r0 - movs r1, 0x7 - mov r9, r1 - movs r5, 0x1 - ldr r3, =gUnknown_082F334C -_08021EEC: - mov r4, r9 - mov r0, r10 - subs r1, r4, r0 - adds r0, r2, 0 - asrs r0, r1 - ands r0, r5 - cmp r0, 0 - beq _08021F0A - mov r1, r10 - lsls r0, r1, 2 - adds r0, r3 - ldr r0, [r0] - ldr r4, [sp, 0xC] - adds r4, r0 - str r4, [sp, 0xC] -_08021F0A: - mov r0, r10 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - cmp r0, 0x7 - bls _08021EEC - ldr r0, =0x02021cc4 - mov r2, r12 - lsrs r1, r2, 8 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r4, =0x02021dc4 - ldr r1, =0x000f4240 - ldr r0, [sp, 0xC] - bl __udivsi3 - adds r1, r0, 0 - adds r0, r4, 0 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085ED848 - adds r0, r4, 0 - bl ExpandStringRefs - movs r2, 0x1 - negs r2, r2 - movs r0, 0x2 - adds r1, r4, 0 - bl GetStringWidth - subs r0, r6, r0 - lsls r0, 24 - lsrs r6, r0, 24 - mov r0, r8 - adds r0, 0x25 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - beq _08021FC4 - movs r0, 0xDD - lsls r0, 1 - add r0, r8 - ldrb r0, [r0] - ldr r1, =gUnknown_082F32E7 - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x2 - adds r2, r6, 0 - adds r3, r7, 0 - bl box_print - b _08021FDE - .pool -_08021FC4: - movs r0, 0xDD - lsls r0, 1 - add r0, r8 - ldrb r0, [r0] - ldr r1, =gUnknown_082F32D8 - str r1, [sp] - str r2, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x2 - adds r2, r6, 0 - adds r3, r7, 0 - bl box_print -_08021FDE: - adds r0, r7, 0 - adds r0, 0xE - lsls r0, 24 - lsrs r7, r0, 24 - movs r4, 0xDD - lsls r4, 1 - add r8, r4 - mov r1, r8 - ldrb r0, [r1] - ldr r2, =gUnknown_082F32D8 - mov r9, r2 - str r2, [sp] - movs r5, 0 - str r5, [sp, 0x4] - ldr r1, =gUnknown_085ED820 - str r1, [sp, 0x8] - movs r1, 0x2 - movs r2, 0 - adds r3, r7, 0 - bl box_print - ldr r0, =0x02021cc4 - ldr r4, [sp, 0x10] - ldrh r1, [r4, 0x8] - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085ED85C - adds r0, r4, 0 - bl ExpandStringRefs - movs r2, 0x1 - negs r2, r2 - movs r0, 0x2 - adds r1, r4, 0 - bl GetStringWidth - movs r1, 0xB0 - subs r1, r0 - lsls r1, 24 - lsrs r6, r1, 24 - mov r1, r8 - ldrb r0, [r1] - mov r2, r9 - str r2, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x2 - adds r2, r6, 0 - adds r3, r7, 0 - bl box_print - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8021D34 - - thumb_func_start sub_8022070 -sub_8022070: @ 8022070 - push {r4-r6,lr} - sub sp, 0x8 - adds r4, r0, 0 - adds r6, r1, 0 - adds r0, r6, 0 - adds r0, 0x80 - ldrb r0, [r0] - cmp r0, 0x5 - bls _08022084 - b _08022218 -_08022084: - lsls r0, 2 - ldr r1, =_08022094 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08022094: - .4byte _080220AC - .4byte _080220F8 - .4byte _0802210C - .4byte _08022130 - .4byte _080221F8 - .4byte _08022200 -_080220AC: - ldrb r0, [r4, 0x9] - subs r0, 0x2 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r6, 0 - bl sub_8022554 - ldrh r0, [r4, 0x12] - lsls r0, 3 - ldr r2, =gUnknown_082F32CC - mov r1, sp - adds r0, r2 - ldm r0!, {r2,r3} - stm r1!, {r2,r3} - ldrh r0, [r4, 0x12] - cmp r0, 0xD - bne _080220DC - ldr r0, =gUnknown_082F3344 - adds r0, 0x4 - b _080220DE - .pool -_080220DC: - ldr r0, =gUnknown_082F3344 -_080220DE: - adds r0, r5, r0 - ldrb r1, [r0] - mov r0, sp - strb r1, [r0, 0x4] - mov r0, sp - bl AddWindow - adds r1, r6, 0 - adds r1, 0x82 - strb r0, [r1] - b _08022218 - .pool -_080220F8: - adds r4, r6, 0 - adds r4, 0x82 - ldrb r0, [r4] - bl PutWindowTilemap - ldrb r0, [r4] - movs r1, 0 - bl FillWindowPixelBuffer - b _08022218 -_0802210C: - adds r5, r6, 0 - adds r5, 0x82 - ldrb r0, [r5] - ldr r4, =0x0000021d - adds r1, r4, 0 - movs r2, 0xD0 - bl box_border_load_tiles_and_pal - ldrb r0, [r5] - movs r1, 0 - adds r2, r4, 0 - movs r3, 0xD - bl SetWindowBorderStyle - b _08022218 - .pool -_08022130: - ldrb r0, [r4, 0x9] - subs r0, 0x2 - lsls r0, 24 - lsrs r5, r0, 24 - ldrh r0, [r4, 0x12] - cmp r0, 0xC - beq _08022184 - cmp r0, 0xC - bgt _08022148 - cmp r0, 0xB - beq _0802214E - b _08022218 -_08022148: - cmp r0, 0xD - beq _080221C8 - b _08022218 -_0802214E: - adds r0, r6, 0 - adds r0, 0x82 - ldrb r0, [r0] - ldr r3, =gUnknown_085ED860 - movs r1, 0x14 - movs r2, 0x3 - bl sub_80219C8 - ldr r0, =gUnknown_082F3344 - adds r0, r5, r0 - ldrb r3, [r0] - lsls r3, 27 - lsrs r3, 24 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0xA0 - bl sub_8021A28 - adds r1, r6, 0 - adds r1, 0x80 - movs r0, 0x5 - b _08022220 - .pool -_08022184: - adds r0, r6, 0 - adds r0, 0x82 - ldrb r0, [r0] - ldr r2, =gUnknown_082F43B4 - adds r1, r4, 0 - adds r1, 0x8F - ldrb r1, [r1] - adds r1, 0x3 - lsls r1, 2 - adds r1, r2 - ldr r3, [r1] - movs r1, 0x14 - movs r2, 0x4 - bl sub_80219C8 - ldr r0, =gUnknown_082F3344 - adds r0, r5, r0 - ldrb r3, [r0] - lsls r3, 27 - lsrs r3, 24 - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0xA0 - bl sub_8021A28 - adds r1, r6, 0 - adds r1, 0x80 - movs r0, 0x5 - b _08022220 - .pool -_080221C8: - adds r0, r6, 0 - adds r0, 0x82 - ldrb r0, [r0] - ldr r3, =gUnknown_085ED878 - movs r1, 0x16 - movs r2, 0x3 - bl sub_80219C8 - ldr r0, =gUnknown_082F3344 - adds r0, 0x4 - adds r0, r5, r0 - ldrb r3, [r0] - lsls r3, 27 - lsrs r3, 24 - adds r0, r4, 0 - movs r1, 0x2 - movs r2, 0xB0 - bl sub_8021A28 - b _08022218 - .pool -_080221F8: - adds r0, r4, 0 - bl sub_8021D34 - b _08022218 -_08022200: - adds r0, r6, 0 - adds r0, 0x82 - ldrb r0, [r0] - movs r1, 0x3 - bl CopyWindowToVram - adds r1, r6, 0 - adds r1, 0x80 - movs r0, 0 - strb r0, [r1] - movs r0, 0x1 - b _08022224 -_08022218: - adds r1, r6, 0 - adds r1, 0x80 - ldrb r0, [r1] - adds r0, 0x1 -_08022220: - strb r0, [r1] - movs r0, 0 -_08022224: - add sp, 0x8 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8022070 - - thumb_func_start sub_802222C -sub_802222C: @ 802222C - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0xDD - lsls r0, 1 - adds r5, r4, r0 - ldrb r0, [r5] - movs r1, 0x1 - bl sub_8198070 - ldrb r0, [r5] - bl RemoveWindow - adds r0, r4, 0 - bl sub_8022600 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_802222C - - thumb_func_start sub_8022250 -sub_8022250: @ 8022250 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0 - mov r9, r0 - movs r1, 0 - str r1, [sp, 0xC] - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r6, r0, r1 - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0x1 - beq _080222D0 - cmp r0, 0x1 - bgt _08022288 - cmp r0, 0 - beq _08022296 - b _080224BA - .pool -_08022288: - cmp r0, 0x2 - bne _0802228E - b _08022480 -_0802228E: - cmp r0, 0x3 - bne _08022294 - b _08022494 -_08022294: - b _080224BA -_08022296: - ldr r0, =gUnknown_082F32EC - bl AddWindow - strh r0, [r6, 0x2] - lsls r0, 24 - lsrs r0, 24 - bl PutWindowTilemap - ldrb r0, [r6, 0x2] - movs r1, 0 - bl FillWindowPixelBuffer - ldrb r0, [r6, 0x2] - ldr r4, =0x0000021d - adds r1, r4, 0 - movs r2, 0xD0 - bl box_border_load_tiles_and_pal - ldrb r0, [r6, 0x2] - movs r1, 0 - adds r2, r4, 0 - movs r3, 0xD - bl SetWindowBorderStyle - b _080224BA - .pool -_080222D0: - ldr r0, =gUnknown_085ED8D0 - mov r10, r0 - movs r1, 0x1 - negs r1, r1 - mov r8, r1 - movs r0, 0x1 - mov r1, r10 - mov r2, r8 - bl GetStringWidth - lsrs r0, 1 - movs r4, 0x60 - subs r0, r4, r0 - lsls r0, 24 - lsrs r7, r0, 24 - ldrb r0, [r6, 0x2] - ldr r5, =gUnknown_082F32E1 - str r5, [sp] - mov r1, r9 - str r1, [sp, 0x4] - mov r1, r10 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r7, 0 - movs r3, 0x1 - bl box_print - ldr r0, =gUnknown_085ED8DC - mov r10, r0 - movs r0, 0x1 - mov r1, r10 - mov r2, r8 - bl GetStringWidth - lsrs r0, 1 - subs r4, r0 - lsls r4, 24 - lsrs r7, r4, 24 - ldrb r0, [r6, 0x2] - str r5, [sp] - mov r1, r9 - str r1, [sp, 0x4] - mov r1, r10 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r7, 0 - movs r3, 0x11 - bl box_print - movs r0, 0x29 - mov r10, r0 -_08022336: - mov r1, r9 - adds r1, 0x2 - ldr r0, =0x02021cc4 - movs r2, 0 - movs r3, 0x1 - bl ConvertIntToDecimalString - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085ED8F4 - bl ExpandStringRefs - ldrb r0, [r6, 0x2] - ldr r1, =gUnknown_082F32D8 - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - ldr r1, =0x02021fc4 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r2, 0 - mov r3, r10 - bl box_print - movs r0, 0x1 - ldr r1, =gUnknown_085ED850 - movs r2, 0x1 - negs r2, r2 - bl GetStringWidth - movs r1, 0xC0 - subs r1, r0 - lsls r1, 24 - lsrs r7, r1, 24 - ldrb r0, [r6, 0x2] - ldr r1, =gUnknown_082F32D8 - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - ldr r1, =gUnknown_085ED850 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r7, 0 - mov r3, r10 - bl box_print - movs r2, 0 - mov r0, r9 - lsls r4, r0, 1 - mov r1, r10 - adds r1, 0x10 - str r1, [sp, 0x10] - movs r0, 0x1 - add r9, r0 - adds r0, r4, r6 - ldrb r3, [r0, 0x4] - movs r1, 0x7 - mov r12, r1 - movs r0, 0x1 - mov r8, r0 - ldr r5, =gUnknown_082F334C -_080223AE: - mov r0, r12 - subs r1, r0, r2 - adds r0, r3, 0 - asrs r0, r1 - mov r1, r8 - ands r0, r1 - cmp r0, 0 - beq _080223CA - lsls r0, r2, 2 - adds r0, r5 - ldr r0, [r0] - ldr r1, [sp, 0xC] - adds r1, r0 - str r1, [sp, 0xC] -_080223CA: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x7 - bls _080223AE - adds r0, r4, r6 - ldrh r1, [r0, 0x4] - lsrs r1, 8 - ldr r0, =0x02021cc4 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r0, [sp, 0xC] - ldr r1, =0x000f4240 - bl __udivsi3 - adds r1, r0, 0 - ldr r0, =0x02021dc4 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085ED848 - bl ExpandStringRefs - movs r0, 0x1 - ldr r1, =0x02021fc4 - movs r2, 0x1 - negs r2, r2 - bl GetStringWidth - subs r0, r7, r0 - lsls r0, 24 - lsrs r7, r0, 24 - ldrb r0, [r6, 0x2] - ldr r1, =gUnknown_082F32D8 - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - ldr r1, =0x02021fc4 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r7, 0 - mov r3, r10 - bl box_print - ldr r1, [sp, 0x10] - lsls r0, r1, 24 - lsrs r0, 24 - mov r10, r0 - movs r0, 0 - str r0, [sp, 0xC] - mov r1, r9 - lsls r0, r1, 24 - lsrs r0, 24 - mov r9, r0 - cmp r0, 0x3 - bhi _08022444 - b _08022336 -_08022444: - ldrb r0, [r6, 0x2] - movs r1, 0x3 - bl CopyWindowToVram - b _080224BA - .pool -_08022480: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _080224BA - b _080224C0 - .pool -_08022494: - ldrb r0, [r6, 0x2] - movs r1, 0x1 - bl sub_8198070 - ldrb r0, [r6, 0x2] - bl ClearWindowTilemap - ldrb r0, [r6, 0x2] - bl RemoveWindow - adds r0, r4, 0 - bl remove_task - bl script_env_2_enable_and_set_ctx_running - bl script_env_2_disable - mov r0, r9 - b _080224BE -_080224BA: - ldrh r0, [r6] - adds r0, 0x1 -_080224BE: - strh r0, [r6] -_080224C0: - 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_8022250 - - thumb_func_start sub_80224D0 -sub_80224D0: @ 80224D0 - push {lr} - bl script_env_2_enable - ldr r0, =sub_8022250 - movs r1, 0 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r0, =0x03005d90 - ldr r2, [r0] - movs r3, 0xF6 - lsls r3, 1 - adds r0, r2, r3 - ldrh r0, [r0] - strh r0, [r1, 0xC] - adds r3, 0x2 - adds r0, r2, r3 - ldrh r0, [r0] - strh r0, [r1, 0xE] - adds r3, 0x2 - adds r0, r2, r3 - ldrh r0, [r0] - strh r0, [r1, 0x10] - adds r3, 0x2 - adds r0, r2, r3 - ldrh r0, [r0] - strh r0, [r1, 0x12] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80224D0 - - thumb_func_start sub_8022524 -sub_8022524: @ 8022524 - push {r4,lr} - adds r4, r0, 0 - lsls r1, 16 - lsrs r1, 16 - bl sub_8021944 - movs r0, 0x4 - ldrsh r1, [r4, r0] - movs r0, 0 - bl sub_8035044 - movs r0, 0x6 - ldrsh r1, [r4, r0] - movs r0, 0x1 - bl sub_8035044 - movs r0, 0x8 - ldrsh r1, [r4, r0] - movs r0, 0x2 - bl sub_8035044 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8022524 - - thumb_func_start sub_8022554 -sub_8022554: @ 8022554 - push {lr} - ldr r2, [r0, 0x78] - adds r2, 0x3E - ldrb r1, [r2] - movs r3, 0x4 - orrs r1, r3 - strb r1, [r2] - ldr r1, [r0, 0x7C] - adds r1, 0x3E - ldrb r0, [r1] - orrs r0, r3 - strb r0, [r1] - movs r0, 0x2 - movs r1, 0x1 - bl sub_803547C - movs r0, 0x1 - movs r1, 0x1 - bl sub_803547C - movs r0, 0 - movs r1, 0x1 - bl sub_803547C - pop {r0} - bx r0 - thumb_func_end sub_8022554 - - thumb_func_start sub_8022588 -sub_8022588: @ 8022588 - push {r4-r7,lr} - adds r5, r0, 0 - movs r6, 0 - ldrb r0, [r5, 0x9] - cmp r6, r0 - bcs _080225E8 - ldr r7, =gUnknown_082F417C -_08022596: - lsls r0, r6, 2 - movs r1, 0xA2 - lsls r1, 1 - adds r2, r5, r1 - adds r2, r0 - ldrb r1, [r5, 0x9] - subs r1, 0x2 - lsls r0, r1, 2 - adds r0, r1 - adds r0, r6, r0 - adds r0, r7 - ldrb r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_082F4190 - adds r0, r1 - str r0, [r2] - ldrb r0, [r0] - lsls r0, 3 - ldr r1, =gUnknown_082F32F4 - adds r0, r1 - bl AddWindow - ldr r1, =0x000001bb - adds r4, r5, r1 - adds r4, r6 - strb r0, [r4] - ldrb r0, [r4] - bl PutWindowTilemap - ldrb r0, [r4] - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - ldrb r0, [r5, 0x9] - cmp r6, r0 - bcc _08022596 -_080225E8: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8022588 - - thumb_func_start sub_8022600 -sub_8022600: @ 8022600 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x14 - adds r6, r0, 0 - movs r7, 0 - ldrb r0, [r6, 0x9] - cmp r7, r0 - bcs _080226B6 - movs r1, 0 - mov r8, r1 -_08022616: - ldr r1, =0x000001bb - adds r0, r6, r1 - adds r5, r0, r7 - ldrb r0, [r5] - bl PutWindowTilemap - ldrb r0, [r6, 0x8] - cmp r7, r0 - bne _08022668 - lsls r4, r7, 5 - adds r4, 0x98 - adds r4, r6, r4 - movs r0, 0x2 - adds r1, r4, 0 - movs r2, 0 - bl GetStringWidth - lsrs r0, 1 - movs r2, 0x24 - subs r2, r0 - lsls r2, 24 - lsrs r2, 24 - ldrb r0, [r5] - mov r1, r8 - str r1, [sp] - str r1, [sp, 0x4] - ldr r1, =gUnknown_082F32DB - str r1, [sp, 0x8] - mov r1, r8 - str r1, [sp, 0xC] - str r4, [sp, 0x10] - movs r1, 0x2 - movs r3, 0x1 - bl AddTextPrinterParametrized2 - b _0802269C - .pool -_08022668: - lsls r4, r7, 5 - adds r4, 0x98 - adds r4, r6, r4 - movs r0, 0x2 - adds r1, r4, 0 - movs r2, 0 - bl GetStringWidth - lsrs r0, 1 - movs r2, 0x24 - subs r2, r0 - lsls r2, 24 - lsrs r2, 24 - ldrb r0, [r5] - mov r1, r8 - str r1, [sp] - str r1, [sp, 0x4] - ldr r1, =gUnknown_082F32DE - str r1, [sp, 0x8] - mov r1, r8 - str r1, [sp, 0xC] - str r4, [sp, 0x10] - movs r1, 0x2 - movs r3, 0x1 - bl AddTextPrinterParametrized2 -_0802269C: - ldr r1, =0x000001bb - adds r0, r6, r1 - adds r0, r7 - ldrb r0, [r0] - movs r1, 0x3 - bl CopyWindowToVram - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - ldrb r0, [r6, 0x9] - cmp r7, r0 - bcc _08022616 -_080226B6: - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8022600 - - thumb_func_start sub_80226D0 -sub_80226D0: @ 80226D0 - push {r4-r6,lr} - sub sp, 0x8 - adds r6, r0, 0 - movs r5, 0 - ldr r0, =gUnknown_08DE3FD4 - ldr r4, =0x0201c000 - adds r1, r4, 0 - bl LZ77UnCompWram - b _0802271A - .pool -_080226EC: - lsls r1, r5, 2 - movs r2, 0xA2 - lsls r2, 1 - adds r0, r6, r2 - adds r0, r1 - ldr r3, [r0] - ldrb r0, [r3] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r4, r1 - ldrb r2, [r3, 0x1] - ldrb r3, [r3, 0x2] - movs r0, 0xA - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x3 - bl CopyToBgTilemapBufferRect - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_0802271A: - ldrb r0, [r6, 0x9] - cmp r5, r0 - bcc _080226EC - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80226D0 - - thumb_func_start sub_8022730 -sub_8022730: @ 8022730 - push {r4-r7,lr} - adds r6, r0, 0 - movs r5, 0 - ldr r0, =0x0000ff98 - strh r0, [r6, 0x2A] - strh r5, [r6, 0x2C] - ldr r1, =0x02021bbc - strh r5, [r1] - ldr r1, =0x02021bbe - strh r0, [r1] - ldr r4, =gUnknown_082F41F4 -_08022746: - lsls r0, r5, 3 - adds r0, r4 - bl LoadCompressedObjectPic - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _08022746 - ldr r0, =gUnknown_082F421C - bl LoadTaggedObjectPalettes - ldr r0, =gUnknown_082F430C - movs r1, 0x78 - movs r2, 0x58 - movs r3, 0x5 - bl AddObjectToFront - lsls r0, 24 - lsrs r2, r0, 24 - movs r0, 0xAC - lsls r0, 1 - adds r3, r6, r0 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - str r0, [r3] - ldrb r1, [r0, 0x5] - movs r2, 0xC - orrs r1, r2 - strb r1, [r0, 0x5] - ldr r1, [r3] - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x2 - orrs r0, r2 - strb r0, [r1] - ldr r1, [r3] - adds r1, 0x2C - ldrb r0, [r1] - movs r2, 0x40 - orrs r0, r2 - strb r0, [r1] - movs r5, 0 - ldrb r1, [r6, 0x9] - cmp r5, r1 - bcs _08022822 - movs r7, 0x4 -_080227AA: - lsls r4, r5, 2 - movs r3, 0xA2 - lsls r3, 1 - adds r0, r6, r3 - adds r0, r4 - ldr r0, [r0] - ldrh r1, [r0, 0x4] - adds r1, 0x78 - lsls r1, 16 - asrs r1, 16 - ldrh r2, [r0, 0x6] - adds r2, 0x20 - lsls r2, 16 - asrs r2, 16 - ldr r0, =gUnknown_082F4324 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r2, r0, 24 - movs r0, 0xAE - lsls r0, 1 - adds r3, r6, r0 - adds r3, r4 - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - str r1, [r3] - ldrb r0, [r1, 0x5] - movs r4, 0xD - negs r4, r4 - adds r2, r4, 0 - ands r0, r2 - orrs r0, r7 - strb r0, [r1, 0x5] - ldr r1, [r3] - adds r1, 0x3E - ldrb r0, [r1] - orrs r0, r7 - strb r0, [r1] - ldr r2, [r3] - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2] - ldr r2, [r3] - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldrb r0, [r6, 0x9] - cmp r5, r0 - bcc _080227AA -_08022822: - movs r5, 0 - ldr r4, =gUnknown_082F41D2 - adds r7, r4, 0x1 -_08022828: - lsls r2, r5, 1 - adds r0, r2, r4 - movs r1, 0 - ldrsb r1, [r0, r1] - adds r1, 0x78 - adds r2, r7 - ldrb r2, [r2] - lsls r2, 24 - asrs r2, 24 - adds r2, 0x88 - ldr r0, =gUnknown_082F433C - movs r3, 0x6 - bl AddObjectToFront - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r5, 2 - movs r1, 0xC2 - lsls r1, 1 - adds r3, r6, r1 - adds r3, r0 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - str r0, [r3] - ldrb r1, [r0, 0x5] - movs r2, 0xC - orrs r1, r2 - strb r1, [r0, 0x5] - ldr r2, [r3] - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r2, [r3] - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - ldr r0, [r3] - strh r5, [r0, 0x2E] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0xA - bls _08022828 - movs r5, 0 -_0802288E: - lsls r1, r5, 1 - adds r1, r5 - lsls r1, 19 - movs r3, 0xB0 - lsls r3, 16 - adds r1, r3 - asrs r1, 16 - ldr r0, =gUnknown_082F4354 - movs r2, 0x8 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r5, 2 - movs r4, 0xD8 - lsls r4, 1 - adds r3, r6, r4 - adds r3, r0 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - str r0, [r3] - ldrb r1, [r0, 0x5] - movs r4, 0xD - negs r4, r4 - adds r2, r4, 0 - ands r1, r2 - strb r1, [r0, 0x5] - ldr r2, [r3] - adds r2, 0x3E - ldrb r0, [r2] - adds r4, 0x8 - adds r1, r4, 0 - ands r0, r1 - strb r0, [r2] - ldr r2, [r3] - adds r2, 0x2C - ldrb r0, [r2] - movs r3, 0x41 - negs r3, r3 - adds r1, r3, 0 - ands r0, r1 - strb r0, [r2] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bls _0802288E - ldr r4, =gUnknown_082F4384 - movs r0, 0 - movs r1, 0 - adds r2, r4, 0 - bl sub_8034D14 - adds r2, r4, 0 - adds r2, 0x10 - movs r0, 0x1 - movs r1, 0 - bl sub_8034D14 - adds r4, 0x20 - movs r0, 0x2 - movs r1, 0 - adds r2, r4, 0 - bl sub_8034D14 - ldrh r0, [r6, 0x12] - cmp r0, 0x1 - bne _08022928 - movs r4, 0x9C - lsls r4, 1 - adds r0, r6, r4 - bl sub_8022554 -_08022928: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8022730 - - thumb_func_start sub_8022960 -sub_8022960: @ 8022960 - push {r4-r6,lr} - adds r5, r0, 0 - movs r4, 0 - movs r0, 0x4 - bl FreeObjectTilesByTag - movs r0, 0x3 - bl FreeObjectTilesByTag - movs r0, 0x2 - bl FreeObjectTilesByTag - movs r0, 0x1 - bl FreeObjectTilesByTag - movs r0, 0x4 - bl FreeObjectPaletteByTag - movs r0, 0x2 - bl FreeObjectPaletteByTag - movs r0, 0x1 - bl FreeObjectPaletteByTag - movs r0, 0xD8 - lsls r0, 1 - adds r6, r5, r0 -_08022996: - lsls r0, r4, 2 - adds r0, r6, r0 - ldr r0, [r0] - bl RemoveObjectAndFreeTiles - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _08022996 - movs r0, 0x2 - bl sub_80353DC - movs r0, 0x1 - bl sub_80353DC - movs r0, 0 - bl sub_80353DC - movs r4, 0 - movs r1, 0xC2 - lsls r1, 1 - adds r6, r5, r1 -_080229C4: - lsls r0, r4, 2 - adds r0, r6, r0 - ldr r0, [r0] - bl RemoveObjectAndFreeTiles - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xA - bls _080229C4 - movs r4, 0 - ldrb r2, [r5, 0x9] - cmp r4, r2 - bcs _080229FC -_080229E0: - lsls r1, r4, 2 - movs r2, 0xAE - lsls r2, 1 - adds r0, r5, r2 - adds r0, r1 - ldr r0, [r0] - bl RemoveObjectAndFreeTiles - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - ldrb r0, [r5, 0x9] - cmp r4, r0 - bcc _080229E0 -_080229FC: - movs r1, 0xAC - lsls r1, 1 - adds r0, r5, r1 - ldr r2, [r0] - adds r0, r2, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08022A18 - adds r0, r2, 0 - bl RemoveObjectAndFreeTiles -_08022A18: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8022960 - - thumb_func_start sub_8022A20 -sub_8022A20: @ 8022A20 - push {lr} - adds r3, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08022A46 - adds r2, r3, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - subs r2, 0x12 - ldrb r0, [r2] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] -_08022A46: - pop {r0} - bx r0 - thumb_func_end sub_8022A20 - - thumb_func_start sub_8022A4C -sub_8022A4C: @ 8022A4C - push {r4,r5,lr} - adds r3, r0, 0 - movs r1, 0 - ldr r5, =DummyObjectCallback - adds r2, r3, 0 - adds r2, 0x2E - movs r4, 0 -_08022A5A: - lsls r0, r1, 1 - adds r0, r2, r0 - strh r4, [r0] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x7 - bls _08022A5A - movs r0, 0 - strh r0, [r3, 0x24] - strh r0, [r3, 0x26] - adds r2, r3, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - subs r2, 0x12 - ldrb r0, [r2] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - str r5, [r3, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8022A4C - - thumb_func_start sub_8022A94 -sub_8022A94: @ 8022A94 - push {r4-r6,lr} - adds r5, r0, 0 - adds r4, r5, 0 - adds r4, 0x2E - ldrh r0, [r4, 0x4] - ldrh r1, [r4, 0x2] - adds r0, r1 - strh r0, [r4, 0x2] - lsls r0, 16 - asrs r0, 24 - ldrh r2, [r5, 0x26] - adds r0, r2 - strh r0, [r5, 0x26] - movs r1, 0xE - ldrsh r0, [r4, r1] - movs r6, 0x80 - lsls r6, 8 - ands r0, r6 - cmp r0, 0 - beq _08022AFA - ldrh r0, [r4, 0x6] - ldrh r2, [r5, 0x2E] - adds r0, r2 - strh r0, [r5, 0x2E] - ldrh r0, [r4, 0xA] - ldrh r1, [r4, 0x8] - adds r0, r1 - strh r0, [r4, 0x8] - lsls r0, 16 - asrs r0, 23 - movs r2, 0xC - ldrsh r1, [r4, r2] - bl sine - strh r0, [r5, 0x24] - movs r1, 0xE - ldrsh r0, [r4, r1] - ands r0, r6 - cmp r0, 0 - beq _08022AFA - ldrh r0, [r4, 0x8] - lsls r0, 16 - asrs r0, 23 - cmp r0, 0x7E - ble _08022AFA - movs r0, 0 - strh r0, [r5, 0x24] - ldrh r1, [r4, 0xE] - ldr r0, =0x00007fff - ands r0, r1 - strh r0, [r4, 0xE] -_08022AFA: - ldrh r0, [r4] - lsls r0, 16 - asrs r0, 23 - strh r0, [r5, 0x20] - movs r2, 0x22 - ldrsh r1, [r5, r2] - movs r2, 0x26 - ldrsh r0, [r5, r2] - adds r1, r0 - ldrh r2, [r4, 0xE] - ldr r0, =0x00007fff - ands r0, r2 - cmp r1, r0 - ble _08022B1A - ldr r0, =sub_8022A4C - str r0, [r5, 0x1C] -_08022B1A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8022A94 - - thumb_func_start sub_8022B28 -sub_8022B28: @ 8022B28 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - adds r7, r6, 0 - adds r7, 0x2E - movs r0, 0 - mov r8, r0 - movs r2, 0xA0 - lsls r2, 2 - strh r2, [r7, 0x2] - movs r0, 0x20 - strh r0, [r7, 0x4] - movs r1, 0xA8 - strh r1, [r7, 0xE] - movs r0, 0x24 - ldrsh r4, [r6, r0] - lsls r4, 23 - lsrs r4, 16 - ldrh r0, [r6, 0x22] - subs r1, r0 - lsls r1, 23 - asrs r1, 16 - adds r2, 0x20 - asrs r2, 1 - movs r0, 0x7 - bl sub_81515D4 - adds r5, r0, 0 - ldrh r0, [r6, 0x20] - lsls r0, 7 - strh r0, [r6, 0x2E] - lsls r4, 16 - asrs r4, 16 - lsls r5, 16 - asrs r5, 16 - movs r0, 0x7 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_81515D4 - strh r0, [r7, 0x6] - movs r0, 0x7 - adds r1, r5, 0 - movs r2, 0x55 - bl sub_8151550 - adds r2, r0, 0 - mov r1, r8 - strh r1, [r7, 0x8] - movs r1, 0xFE - lsls r1, 6 - lsls r2, 16 - asrs r2, 16 - movs r0, 0x7 - bl sub_81515D4 - strh r0, [r7, 0xA] - movs r2, 0x24 - ldrsh r0, [r6, r2] - cmp r0, 0 - bge _08022BA6 - adds r0, 0x3 -_08022BA6: - asrs r0, 2 - strh r0, [r7, 0xC] - ldrh r0, [r7, 0xE] - ldr r2, =0xffff8000 - adds r1, r2, 0 - orrs r0, r1 - strh r0, [r7, 0xE] - mov r0, r8 - strh r0, [r6, 0x26] - strh r0, [r6, 0x24] - ldr r0, =sub_8022A94 - str r0, [r6, 0x1C] - adds r2, r6, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r2, 0x12 - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8022B28 - - thumb_func_start sub_8022BEC -sub_8022BEC: @ 8022BEC - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r7, r2, 0 - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 24 - lsrs r4, r1, 24 - mov r8, r4 - bl sub_8020C00 - adds r6, r0, 0 - cmp r5, 0x19 - bls _08022C0A - movs r5, 0 -_08022C0A: - cmp r4, 0 - beq _08022C14 - cmp r4, 0x1 - beq _08022C40 - b _08022C4A -_08022C14: - cmp r5, 0 - beq _08022C28 - ldr r0, =gUnknown_082F43CC - lsls r1, r5, 2 - adds r1, r0 - ldr r2, [r1] - adds r0, r6, 0 - adds r1, r7, 0 - bl _call_via_r2 -_08022C28: - ldrb r0, [r6, 0xE] - cmp r0, 0x19 - bls _08022C32 - mov r0, r8 - strb r0, [r6, 0xE] -_08022C32: - ldr r0, =gUnknown_082F43CC - ldrb r1, [r6, 0xE] - lsls r1, 2 - b _08022C44 - .pool -_08022C40: - ldr r0, =gUnknown_082F43CC - lsls r1, r5, 2 -_08022C44: - adds r1, r0 - ldr r0, [r1] - str r0, [r6, 0x4] -_08022C4A: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8022BEC - - thumb_func_start sub_8022C58 -sub_8022C58: @ 8022C58 - push {r4-r6,lr} - sub sp, 0x4 - adds r6, r0, 0 - ldrb r2, [r1] - ldrb r3, [r1, 0x1] - lsls r3, 8 - orrs r2, r3 - ldrb r3, [r1, 0x2] - lsls r3, 16 - orrs r2, r3 - ldrb r3, [r1, 0x3] - lsls r3, 24 - adds r0, r2, 0 - orrs r0, r3 - ldrb r2, [r1, 0x9] - strb r2, [r1] - ldrb r4, [r1, 0x8] - lsls r4, 8 - ldrb r2, [r1, 0x7] - orrs r4, r2 - ldr r5, =0x02037fd4 - ldrb r3, [r5, 0x8] - movs r2, 0x7F - ands r2, r3 - strb r2, [r5, 0x8] - movs r5, 0x4 - ldrsb r5, [r1, r5] - ldrb r2, [r1, 0x5] - ldrb r3, [r1, 0x6] - str r4, [sp] - adds r1, r5, 0 - bl pal_fade_maybe - bl fade_and_return_progress_probably - movs r0, 0x2 - strb r0, [r6, 0xE] - movs r0, 0 - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8022C58 - - thumb_func_start sub_8022CB0 -sub_8022CB0: @ 8022CB0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0xC] - cmp r0, 0x1 - beq _08022CE4 - cmp r0, 0x1 - bgt _08022CC6 - cmp r0, 0 - beq _08022CD0 - b _08022D06 -_08022CC6: - cmp r0, 0x2 - beq _08022CEA - cmp r0, 0x3 - beq _08022CF6 - b _08022D06 -_08022CD0: - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - bne _08022D0C - ldrb r0, [r5] - cmp r0, 0 - bne _08022D06 - movs r0, 0x3 - b _08022D0A -_08022CE4: - bl sub_8010434 - b _08022D06 -_08022CEA: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _08022D06 - b _08022D0C -_08022CF6: - ldrb r0, [r4, 0xF] - movs r1, 0x1 - movs r2, 0 - bl sub_8022BEC - movs r0, 0 - strb r0, [r4, 0xC] - b _08022D0E -_08022D06: - ldrb r0, [r4, 0xC] - adds r0, 0x1 -_08022D0A: - strb r0, [r4, 0xC] -_08022D0C: - movs r0, 0 -_08022D0E: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8022CB0 - - thumb_func_start sub_8022D14 -sub_8022D14: @ 8022D14 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - adds r7, r0, 0 - adds r5, r1, 0 - ldrb r4, [r5, 0x3] - lsls r4, 8 - ldrb r0, [r5, 0x2] - orrs r4, r0 - ldrb r6, [r7, 0xC] - cmp r6, 0x1 - beq _08022DC0 - cmp r6, 0x1 - bgt _08022D38 - cmp r6, 0 - beq _08022D42 - b _08022E08 -_08022D38: - cmp r6, 0x2 - beq _08022DD8 - cmp r6, 0x3 - beq _08022DE8 - b _08022E08 -_08022D42: - movs r0, 0 - movs r1, 0 - bl sub_81973C4 - ldrb r1, [r5, 0x1] - movs r0, 0x2 - mov r8, r0 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _08022D90 - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_082F32A4 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r4, 0 - bl ExpandStringRefs - ldrb r3, [r7, 0xB] - str r6, [sp] - mov r0, r8 - str r0, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl AddTextPrinterParametrized - b _08022DB2 - .pool -_08022D90: - ldr r1, =gUnknown_082F32A4 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r2, [r0] - ldrb r3, [r7, 0xB] - str r4, [sp] - mov r0, r8 - str r0, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - bl AddTextPrinterParametrized -_08022DB2: - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - b _08022E08 - .pool -_08022DC0: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _08022E0E - cmp r4, 0 - bne _08022E08 - ldrb r0, [r7, 0xC] - adds r0, 0x1 - strb r0, [r7, 0xC] - b _08022E08 -_08022DD8: - ldr r0, =0x030022c0 - ldrh r0, [r0, 0x2E] - ands r4, r0 - cmp r4, 0 - bne _08022E08 - b _08022E0E - .pool -_08022DE8: - ldrb r1, [r5, 0x1] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08022DFA - movs r0, 0 - movs r1, 0x1 - bl sub_8197434 -_08022DFA: - ldrb r0, [r7, 0xE] - movs r1, 0x1 - movs r2, 0 - bl sub_8022BEC - ldrb r0, [r5, 0x4] - b _08022E0C -_08022E08: - ldrb r0, [r7, 0xC] - adds r0, 0x1 -_08022E0C: - strb r0, [r7, 0xC] -_08022E0E: - movs r0, 0 - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8022D14 - - thumb_func_start sub_8022E1C -sub_8022E1C: @ 8022E1C - push {r4,lr} - adds r4, r0, 0 - bl sub_802104C - cmp r0, 0 - beq _08022E34 - ldrb r0, [r4, 0xE] - adds r2, r4, 0 - adds r2, 0x36 - movs r1, 0 - bl sub_8022BEC -_08022E34: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8022E1C - - thumb_func_start sub_8022E3C -sub_8022E3C: @ 8022E3C - push {r4,lr} - adds r4, r0, 0 - bl sub_802130C - cmp r0, 0 - beq _08022E54 - ldrb r0, [r4, 0xE] - adds r2, r4, 0 - adds r2, 0x36 - movs r1, 0 - bl sub_8022BEC -_08022E54: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8022E3C - - thumb_func_start sub_8022E5C -sub_8022E5C: @ 8022E5C - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4, 0xC] - cmp r0, 0 - beq _08022E6C - cmp r0, 0x1 - beq _08022E72 - b _08022E9C -_08022E6C: - bl sub_8010434 - b _08022E9C -_08022E72: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08022EA2 - ldr r0, =0x000001e5 - bl current_map_music_set - movs r0, 0x7 - movs r1, 0x1 - movs r2, 0 - bl sub_8022BEC - movs r1, 0 - movs r0, 0x3 - strh r0, [r4, 0x12] - strb r1, [r4, 0xC] - b _08022EA2 - .pool -_08022E9C: - ldrb r0, [r4, 0xC] - adds r0, 0x1 - strb r0, [r4, 0xC] -_08022EA2: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8022E5C - - thumb_func_start sub_8022EAC -sub_8022EAC: @ 8022EAC - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0xC] - cmp r0, 0 - beq _08022EC2 - cmp r0, 0x1 - beq _08022EE8 - adds r0, 0x1 - b _08022EF8 -_08022EC2: - adds r0, r4, 0 - bl sub_8024578 - movs r0, 0x1 - str r0, [sp] - adds r0, r5, 0 - movs r1, 0 - movs r2, 0x1 - movs r3, 0 - bl sub_8024644 - movs r0, 0x7 - strb r0, [r4, 0xE] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0 - bl sub_8022BEC - b _08022EFA -_08022EE8: - movs r0, 0x8 - strb r0, [r4, 0xE] - movs r0, 0x5 - movs r1, 0x1 - movs r2, 0 - bl sub_8022BEC - movs r0, 0x2 -_08022EF8: - strb r0, [r4, 0xC] -_08022EFA: - movs r0, 0 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8022EAC - - thumb_func_start sub_8022F04 -sub_8022F04: @ 8022F04 - push {lr} - movs r1, 0 - str r1, [r0, 0x4] - ldr r0, =sub_8020E1C - bl SetMainCallback2 - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8022F04 - - thumb_func_start sub_8022F1C -sub_8022F1C: @ 8022F1C - push {r4-r7,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r2, r1, 0 - ldrb r0, [r5, 0xC] - cmp r0, 0x5 - bls _08022F2C - b _08023060 -_08022F2C: - lsls r0, 2 - ldr r1, =_08022F3C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08022F3C: - .4byte _08022F54 - .4byte _08022F74 - .4byte _08022F7A - .4byte _08022FAA - .4byte _08022FBA - .4byte _08023044 -_08022F54: - movs r0, 0x1 - str r0, [sp] - adds r0, r2, 0 - movs r1, 0x1 - movs r2, 0 - movs r3, 0 - bl sub_8024644 - movs r0, 0x9 - strb r0, [r5, 0xE] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0 - bl sub_8022BEC - b _08023066 -_08022F74: - bl sub_8010434 - b _08023060 -_08022F7A: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08023066 - adds r4, r5, 0 - adds r4, 0x42 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0xC - bl memset - ldrb r0, [r5, 0x8] - lsls r0, 5 - adds r0, r5, r0 - adds r0, 0xA4 - ldrh r0, [r0] - strh r0, [r4] - movs r0, 0 - adds r1, r4, 0 - movs r2, 0x2 - bl link_0800A448 - b _08023060 -_08022FAA: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08023066 - movs r0, 0 - strh r0, [r5, 0x10] - b _08023060 -_08022FBA: - bl sub_800A550 - ldr r2, =gUnknown_082F4448 - ldrb r4, [r5, 0x9] - subs r1, r4, 0x2 - adds r1, r2 - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bne _08023066 - movs r3, 0 - cmp r3, r4 - bcs _0802301E - ldr r7, =0x020223c4 - movs r6, 0 - ldr r4, =gUnknown_0858AB24 -_08022FDC: - lsls r0, r3, 5 - adds r0, r5, r0 - lsls r1, r3, 8 - adds r1, r7 - ldrh r1, [r1] - adds r2, r0, 0 - adds r2, 0xA4 - strh r1, [r2] - lsls r1, 16 - lsrs r1, 16 - cmp r1, 0xB0 - bls _08022FF6 - strh r6, [r2] -_08022FF6: - ldrh r1, [r2] - lsls r1, 2 - adds r1, r4 - ldrh r0, [r5, 0x18] - ldrb r1, [r1] - adds r0, r1 - strh r0, [r5, 0x18] - ldrh r0, [r2] - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x2] - ldr r0, [r5, 0x1C] - adds r0, r1 - str r0, [r5, 0x1C] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - ldrb r0, [r5, 0x9] - cmp r3, r0 - bcc _08022FDC -_0802301E: - movs r0, 0 - strh r0, [r5, 0x10] - bl sub_800A5B4 - movs r1, 0x18 - ldrsh r0, [r5, r1] - lsls r0, 8 - movs r1, 0x80 - lsls r1, 6 - bl sub_81515FC - str r0, [r5, 0x20] - b _08023060 - .pool -_08023044: - movs r0, 0 - movs r1, 0x1 - bl sub_8197434 - movs r0, 0xA - movs r1, 0x1 - movs r2, 0 - bl sub_8022BEC - movs r1, 0 - movs r0, 0x4 - strh r0, [r5, 0x12] - strb r1, [r5, 0xC] - b _08023066 -_08023060: - ldrb r0, [r5, 0xC] - adds r0, 0x1 - strb r0, [r5, 0xC] -_08023066: - movs r0, 0 - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8022F1C - - thumb_func_start sub_8023070 -sub_8023070: @ 8023070 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4, 0xC] - cmp r0, 0x6 - bls _0802307C - b _080231A8 -_0802307C: - lsls r0, 2 - ldr r1, =_0802308C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0802308C: - .4byte _080230A8 - .4byte _080230BA - .4byte _080230E8 - .4byte _08023120 - .4byte _08023150 - .4byte _08023172 - .4byte _08023184 -_080230A8: - movs r0, 0x9C - lsls r0, 1 - adds r1, r4, r0 - adds r0, r4, 0 - bl sub_80214A8 - bl sub_8010434 - b _080231A8 -_080230BA: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080231AE - movs r2, 0x9C - lsls r2, 1 - adds r1, r4, r2 - movs r0, 0 - strb r0, [r1] - ldr r3, =0x00000139 - adds r1, r4, r3 - strb r0, [r1] - adds r2, 0x2 - adds r1, r4, r2 - strb r0, [r1] - adds r3, 0x2 - adds r1, r4, r3 - strb r0, [r1] - b _080231A8 - .pool -_080230E8: - movs r0, 0x9C - lsls r0, 1 - adds r3, r4, r0 - ldrb r0, [r3] - lsls r0, 2 - movs r2, 0xB8 - lsls r2, 1 - adds r1, r4, r2 - adds r0, r1, r0 - ldr r2, [r0] - ldr r0, =sub_8021608 - str r0, [r2, 0x1C] - ldrb r0, [r3] - lsls r0, 2 - adds r1, r0 - ldr r1, [r1] - adds r1, 0x2C - ldrb r2, [r1] - movs r0, 0x7F - ands r0, r2 - strb r0, [r1] - movs r0, 0x3D - bl audio_play - b _080231A8 - .pool -_08023120: - movs r3, 0x9C - lsls r3, 1 - adds r2, r4, r3 - ldrb r0, [r2] - lsls r0, 2 - adds r3, 0x38 - adds r1, r4, r3 - adds r3, r1, r0 - ldr r0, [r3] - ldr r1, [r0, 0x1C] - ldr r0, =sub_8021608 - cmp r1, r0 - beq _080231AE - movs r0, 0 - str r0, [r3] - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - bl sub_8010434 - b _080231A8 - .pool -_08023150: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080231AE - movs r0, 0x9C - lsls r0, 1 - adds r1, r4, r0 - ldrb r0, [r1] - ldrb r2, [r4, 0x9] - cmp r0, r2 - bcs _0802316C - movs r0, 0x2 - b _080231AC -_0802316C: - movs r0, 0 - strb r0, [r1] - b _080231A8 -_08023172: - movs r3, 0x9C - lsls r3, 1 - adds r1, r4, r3 - adds r0, r4, 0 - bl sub_80216A8 - bl sub_8010434 - b _080231A8 -_08023184: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080231AE - movs r0, 0x2B - bl audio_play - movs r0, 0xB - movs r1, 0x1 - movs r2, 0 - bl sub_8022BEC - movs r1, 0 - movs r0, 0x5 - strh r0, [r4, 0x12] - strb r1, [r4, 0xC] - b _080231AE -_080231A8: - ldrb r0, [r4, 0xC] - adds r0, 0x1 -_080231AC: - strb r0, [r4, 0xC] -_080231AE: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8023070 - - thumb_func_start sub_80231B8 -sub_80231B8: @ 80231B8 - push {r4-r7,lr} - adds r4, r0, 0 - ldrb r1, [r4, 0xC] - cmp r1, 0x1 - beq _0802321C - cmp r1, 0x1 - bgt _080231CC - cmp r1, 0 - beq _080231D6 - b _080232DC -_080231CC: - cmp r1, 0x2 - beq _0802329C - cmp r1, 0x3 - beq _080232BE - b _080232DC -_080231D6: - ldrh r0, [r4, 0x2A] - adds r0, 0x4 - strh r0, [r4, 0x2A] - lsls r0, 16 - cmp r0, 0 - bge _080231E4 - b _080232E2 -_080231E4: - strh r1, [r4, 0x2A] - ldr r0, =0x00000139 - adds r3, r4, r0 - movs r0, 0x4 - strb r0, [r3] - movs r2, 0x9C - lsls r2, 1 - adds r1, r4, r2 - movs r0, 0 - strb r0, [r1] - ldr r2, =gUnknown_082F326C - ldrb r1, [r3] - lsls r0, r1, 3 - subs r0, r1 - adds r0, r2 - ldrb r0, [r0] - movs r2, 0x9D - lsls r2, 1 - adds r1, r4, r2 - strb r0, [r1] - movs r0, 0xD6 - bl audio_play - b _080232DC - .pool -_0802321C: - ldr r7, =gUnknown_082F326C - movs r0, 0x9C - lsls r0, 1 - adds r6, r4, r0 - ldr r1, =0x00000139 - adds r5, r4, r1 - ldrb r1, [r5] - lsls r0, r1, 3 - subs r0, r1 - ldrb r2, [r6] - adds r0, r2 - adds r0, r7 - movs r1, 0 - ldrsb r1, [r0, r1] - strh r1, [r4, 0x2C] - negs r1, r1 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x12 - bl SetGpuReg - ldrh r1, [r4, 0x2C] - negs r1, r1 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x1A - bl SetGpuReg - ldrh r1, [r4, 0x2C] - negs r1, r1 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x1E - bl SetGpuReg - ldrb r0, [r6] - adds r0, 0x1 - strb r0, [r6] - movs r1, 0x9D - lsls r1, 1 - adds r2, r4, r1 - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r2] - cmp r0, r1 - bcc _080232E2 - ldrb r0, [r5] - cmp r0, 0 - beq _080232DC - subs r0, 0x1 - strb r0, [r5] - ldrb r1, [r5] - lsls r0, r1, 3 - subs r0, r1 - adds r0, r7 - ldrb r0, [r0] - strb r0, [r2] - movs r0, 0 - strb r0, [r6] - b _080232E2 - .pool -_0802329C: - movs r0, 0 - strh r0, [r4, 0x2C] - movs r0, 0x12 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1A - movs r1, 0 - bl SetGpuReg - movs r0, 0x1E - movs r1, 0 - bl SetGpuReg - bl sub_8010434 - b _080232DC -_080232BE: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080232E2 - movs r0, 0xC - movs r1, 0x1 - movs r2, 0 - bl sub_8022BEC - movs r1, 0 - movs r0, 0x6 - strh r0, [r4, 0x12] - strb r1, [r4, 0xC] - b _080232E2 -_080232DC: - ldrb r0, [r4, 0xC] - adds r0, 0x1 - strb r0, [r4, 0xC] -_080232E2: - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80231B8 - - thumb_func_start sub_80232EC -sub_80232EC: @ 80232EC - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - ldrb r0, [r4, 0xC] - cmp r0, 0x1 - beq _0802330C - cmp r0, 0x1 - bgt _08023302 - cmp r0, 0 - beq _08023332 - b _0802338C -_08023302: - cmp r0, 0x2 - beq _0802332A - cmp r0, 0x3 - beq _08023338 - b _0802338C -_0802330C: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08023392 - movs r1, 0x80 - lsls r1, 5 - movs r0, 0 - str r0, [sp] - adds r0, r1, 0 - movs r2, 0x78 - movs r3, 0x50 - bl sub_802EB24 - b _0802338C -_0802332A: - bl sub_802EB84 - cmp r0, 0 - bne _08023392 -_08023332: - bl sub_8010434 - b _0802338C -_08023338: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08023392 - movs r0, 0x9C - lsls r0, 1 - adds r1, r4, r0 - movs r0, 0 - strb r0, [r1] - ldr r2, =0x00000139 - adds r1, r4, r2 - strb r0, [r1] - adds r2, 0x1 - adds r1, r4, r2 - strb r0, [r1] - adds r2, 0x1 - adds r1, r4, r2 - strb r0, [r1] - strh r0, [r4, 0x10] - ldrb r0, [r4, 0x8] - cmp r0, 0 - bne _08023378 - movs r0, 0xD - movs r1, 0x1 - movs r2, 0 - bl sub_8022BEC - b _08023382 - .pool -_08023378: - movs r0, 0xE - movs r1, 0x1 - movs r2, 0 - bl sub_8022BEC -_08023382: - movs r1, 0 - movs r0, 0x7 - strh r0, [r4, 0x12] - strb r1, [r4, 0xC] - b _08023392 -_0802338C: - ldrb r0, [r4, 0xC] - adds r0, 0x1 - strb r0, [r4, 0xC] -_08023392: - movs r0, 0 - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80232EC - - thumb_func_start sub_802339C -sub_802339C: @ 802339C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r4, r0, 0 - movs r0, 0 - mov r8, r0 - movs r2, 0 - adds r7, r2, 0 - ldrb r1, [r4, 0x9] - cmp r7, r1 - bcs _080234AA - movs r2, 0x5E - adds r2, r4 - mov r9, r2 - ldr r3, =gUnknown_082F325C - mov r10, r3 -_080233C0: - lsls r0, r7, 4 - ldr r1, =0x03003090 - adds r2, r0, r1 - ldrh r1, [r2] - movs r0, 0xFF - lsls r0, 8 - ands r0, r1 - movs r3, 0xBC - lsls r3, 6 - cmp r0, r3 - bne _0802349E - ldrh r0, [r2, 0x2] - cmp r0, 0x2 - bne _0802349E - ldrb r1, [r2, 0x4] - movs r0, 0x4 - ands r0, r1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _08023496 - mov r0, r9 - ldrb r2, [r0] - lsrs r1, r2, 3 - mov r3, r10 - adds r0, r7, r3 - ldrb r0, [r0] - orrs r1, r0 - lsls r1, 3 - movs r0, 0x7 - ands r0, r2 - orrs r0, r1 - mov r1, r9 - strb r0, [r1] - lsls r2, r7, 5 - adds r3, r4, r2 - mov r12, r3 - mov r1, r12 - adds r1, 0xB5 - movs r0, 0x1 - strb r0, [r1] - subs r1, 0x7 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - subs r1, 0x8 - ldrh r0, [r4, 0x28] - ldrh r1, [r1] - subs r0, r1 - lsls r0, 16 - lsrs r3, r0, 16 - mov r5, r12 - adds r5, 0xAA - ldrh r1, [r5] - subs r0, r1, 0x1 - adds r6, r2, 0 - cmp r3, r0 - blt _08023468 - adds r0, r1, 0x1 - cmp r3, r0 - bgt _08023468 - mov r1, r12 - adds r1, 0xA8 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - strh r3, [r5] - mov r0, r12 - adds r0, 0xAC - ldrh r1, [r1] - ldrh r2, [r0] - cmp r1, r2 - bls _08023476 - strh r1, [r0] - b _08023476 - .pool -_08023468: - adds r0, r4, r6 - adds r2, r0, 0 - adds r2, 0xA8 - movs r1, 0 - strh r1, [r2] - adds r0, 0xAA - strh r3, [r0] -_08023476: - adds r1, r4, r6 - ldrh r0, [r4, 0x28] - adds r3, r1, 0 - adds r3, 0xA6 - movs r2, 0 - strh r0, [r3] - adds r1, 0xB4 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bls _0802349E - strb r2, [r1] - b _0802349E -_08023496: - lsls r0, r7, 5 - adds r0, r4, r0 - adds r0, 0xB5 - strb r1, [r0] -_0802349E: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - ldrb r3, [r4, 0x9] - cmp r7, r3 - bcc _080233C0 -_080234AA: - mov r0, r8 - cmp r0, 0x1 - bls _080234E0 - movs r7, 0 - ldrb r1, [r4, 0x9] - cmp r7, r1 - bcs _080234E0 - movs r3, 0x2 -_080234BA: - lsls r0, r7, 5 - adds r1, r4, r0 - adds r2, r1, 0 - adds r2, 0xB5 - ldrb r0, [r2] - cmp r0, 0 - beq _080234D4 - orrs r0, r3 - strb r0, [r2] - adds r1, 0xB0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_080234D4: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - ldrb r2, [r4, 0x9] - cmp r7, r2 - bcc _080234BA -_080234E0: - mov r3, r8 - cmp r3, 0 - beq _08023548 - ldrh r0, [r4, 0x2E] - add r0, r8 - strh r0, [r4, 0x2E] - ldr r1, =gUnknown_082F3264 - mov r0, r8 - subs r0, 0x1 - adds r0, r1 - ldrb r0, [r0] - add r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldrh r0, [r4, 0x34] - add r0, r8 - strh r0, [r4, 0x34] - ldrh r0, [r4, 0x1A] - add r0, r8 - strh r0, [r4, 0x1A] - movs r1, 0x18 - ldrsh r0, [r4, r1] - movs r3, 0x1A - ldrsh r2, [r4, r3] - subs r0, r2 - cmp r0, 0 - ble _08023534 - lsls r2, 8 - ldr r1, [r4, 0x20] - adds r0, r2, 0 - bl sub_81515FC - adds r2, r0, 0 - asrs r2, 8 - adds r0, r4, 0 - adds r0, 0x24 - strb r2, [r0] - b _08023548 - .pool -_08023534: - adds r1, r4, 0 - adds r1, 0x24 - movs r0, 0x20 - strb r0, [r1] - adds r2, r4, 0 - adds r2, 0x5E - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] -_08023548: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_802339C - - thumb_func_start sub_8023558 -sub_8023558: @ 8023558 - push {r4-r6,lr} - adds r3, r0, 0 - movs r6, 0 - movs r1, 0 - adds r4, r1, 0 - ldrb r0, [r3, 0x9] - cmp r4, r0 - bcs _080235B0 - adds r5, r3, 0 - adds r5, 0x64 -_0802356C: - lsls r0, r4, 5 - adds r1, r3, r0 - adds r0, r1, 0 - adds r0, 0xB5 - ldrb r2, [r0] - cmp r2, 0 - beq _080235A4 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r1, 0 - adds r0, 0xB4 - ldrb r0, [r0] - adds r1, r0, 0x1 - movs r0, 0x2 - ands r0, r2 - cmp r0, 0 - beq _08023594 - movs r0, 0x4 - orrs r1, r0 -_08023594: - lsls r0, r4, 1 - adds r0, r4 - lsls r1, r0 - lsls r0, r1, 16 - lsrs r1, r0, 16 - ldrh r0, [r5] - orrs r1, r0 - strh r1, [r5] -_080235A4: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - ldrb r1, [r3, 0x9] - cmp r4, r1 - bcc _0802356C -_080235B0: - adds r0, r3, 0 - adds r0, 0x24 - ldrb r1, [r0] - adds r0, 0x3C - strh r1, [r0] - cmp r6, 0 - bne _080235D4 - ldr r2, =0x0000013b - adds r0, r3, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080236A0 - movs r4, 0x9C - lsls r4, 1 - adds r1, r3, r4 - b _08023612 - .pool -_080235D4: - ldr r5, =0x0000013b - adds r2, r3, r5 - ldrb r0, [r2] - cmp r0, 0 - beq _0802361A - ldr r0, =0x00000139 - adds r1, r3, r0 - ldrb r2, [r1] - cmp r6, r2 - beq _0802360C - subs r0, r6, 0x1 - strb r0, [r1] - ldr r1, =gUnknown_082F3290 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0] - movs r4, 0x9D - lsls r4, 1 - adds r1, r3, r4 - strb r0, [r1] - b _08023640 - .pool -_0802360C: - movs r5, 0x9C - lsls r5, 1 - adds r1, r3, r5 -_08023612: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08023640 -_0802361A: - movs r0, 0x9C - lsls r0, 1 - adds r1, r3, r0 - movs r0, 0 - strb r0, [r1] - subs r0, r6, 0x1 - ldr r4, =0x00000139 - adds r1, r3, r4 - strb r0, [r1] - ldr r1, =gUnknown_082F3290 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0] - movs r5, 0x9D - lsls r5, 1 - adds r1, r3, r5 - strb r0, [r1] - movs r0, 0x1 - strb r0, [r2] -_08023640: - ldr r0, =0x0000013b - adds r4, r3, r0 - ldrb r0, [r4] - cmp r0, 0 - beq _080236A0 - movs r2, 0x9C - lsls r2, 1 - adds r1, r3, r2 - movs r5, 0x9D - lsls r5, 1 - adds r2, r3, r5 - ldrb r0, [r1] - ldrb r5, [r2] - cmp r0, r5 - bcc _0802367C - movs r0, 0 - strb r0, [r1] - ldr r5, =0x00000139 - adds r1, r3, r5 - strb r0, [r1] - strb r0, [r2] - strb r0, [r4] - movs r1, 0 - b _08023690 - .pool -_0802367C: - ldr r2, =gUnknown_082F3290 - ldrb r1, [r1] - ldr r4, =0x00000139 - adds r0, r3, r4 - ldrb r0, [r0] - lsls r0, 2 - adds r0, 0x1 - adds r1, r0 - adds r1, r2 - ldrb r1, [r1] -_08023690: - adds r0, r3, 0 - adds r0, 0x5F - strb r1, [r0] - b _080236A8 - .pool -_080236A0: - adds r1, r3, 0 - adds r1, 0x5F - movs r0, 0 - strb r0, [r1] -_080236A8: - ldrh r1, [r3, 0x26] - adds r0, r3, 0 - adds r0, 0x62 - strh r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8023558 - - thumb_func_start sub_80236B8 -sub_80236B8: @ 80236B8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - ldr r3, =0x030022c0 - ldrh r1, [r3, 0x2E] - movs r4, 0x1 - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _080236DA - adds r2, r5, 0 - adds r2, 0x5E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_080236DA: - ldrh r1, [r3, 0x2C] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _080236FA - ldrb r0, [r5, 0x8] - lsls r0, 5 - adds r0, r5, r0 - adds r1, r0, 0 - adds r1, 0xB2 - ldrh r0, [r1] - ldrh r2, [r5, 0x28] - cmp r0, r2 - bcs _080236FA - adds r0, 0x1 - strh r0, [r1] -_080236FA: - ldrb r0, [r5, 0x8] - adds r7, r5, 0 - adds r7, 0x5E - cmp r0, 0 - beq _08023710 - ldrb r1, [r7] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - bne _08023710 - b _0802384C -_08023710: - adds r4, r5, 0 - adds r4, 0x5C - movs r0, 0x2 - strh r0, [r4] - ldrh r0, [r5, 0x28] - movs r1, 0x1E - bl __umodsi3 - lsls r0, 16 - mov r8, r4 - adds r6, r5, 0 - adds r6, 0x25 - cmp r0, 0 - bne _08023768 - movs r0, 0x2E - ldrsh r2, [r5, r0] - ldr r1, =gUnknown_082F4444 - ldrb r0, [r5, 0x9] - subs r0, 0x2 - adds r0, r1 - ldrb r0, [r0] - cmp r2, r0 - ble _08023754 - ldrh r0, [r5, 0x30] - adds r0, 0x1 - strh r0, [r5, 0x30] - ldrb r0, [r6] - movs r1, 0x10 - orrs r0, r1 - b _0802375C - .pool -_08023754: - ldrb r1, [r6] - movs r0, 0x11 - negs r0, r0 - ands r0, r1 -_0802375C: - strb r0, [r6] - movs r0, 0 - strh r0, [r5, 0x2E] - ldrh r0, [r5, 0x32] - adds r0, 0x1 - strh r0, [r5, 0x32] -_08023768: - ldrh r0, [r5, 0x28] - movs r1, 0xF - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - bne _080237DE - movs r0, 0x34 - ldrsh r2, [r5, r0] - ldr r3, =gUnknown_082F4434 - ldrb r0, [r5, 0x9] - subs r0, 0x2 - lsls r1, r0, 2 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r2, r0 - bge _08023798 - ldrb r1, [r6] - movs r0, 0x1F - ands r0, r1 - strb r0, [r6] - b _080237D8 - .pool -_08023798: - adds r0, r3, 0x1 - adds r0, r1, r0 - ldrb r0, [r0] - cmp r2, r0 - bge _080237AC - ldrb r0, [r6] - movs r1, 0x1F - ands r1, r0 - movs r0, 0x20 - b _080237D4 -_080237AC: - adds r0, r3, 0x2 - adds r0, r1, r0 - ldrb r0, [r0] - cmp r2, r0 - bge _080237BC - movs r0, 0x2 - strh r0, [r5, 0x34] - b _080237D8 -_080237BC: - adds r0, r3, 0x3 - adds r0, r1, r0 - ldrb r0, [r0] - cmp r2, r0 - bge _080237CC - movs r0, 0x3 - strh r0, [r5, 0x34] - b _080237D8 -_080237CC: - ldrb r0, [r6] - movs r1, 0x1F - ands r1, r0 - movs r0, 0x80 -_080237D4: - orrs r1, r0 - strb r1, [r6] -_080237D8: - movs r0, 0 - strh r0, [r5, 0x34] - b _0802380A -_080237DE: - ldrh r0, [r5, 0x10] - adds r0, 0x1 - strh r0, [r5, 0x10] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x3C - bls _0802380A - cmp r0, 0x46 - bls _080237FA - bl sub_8011AC8 - movs r0, 0 - strh r0, [r5, 0x10] - b _0802380A -_080237FA: - ldrb r0, [r7] - movs r4, 0xF8 - ands r4, r0 - cmp r4, 0 - bne _0802380A - bl sub_8011AC8 - strh r4, [r5, 0x10] -_0802380A: - ldrh r1, [r5, 0x28] - ldr r0, =0x00008c9f - cmp r1, r0 - bls _0802381A - ldrb r0, [r7] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r7] -_0802381A: - ldrb r1, [r6] - lsls r1, 27 - lsrs r1, 31 - lsls r1, 1 - ldrb r2, [r7] - movs r0, 0x3 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r7] - ldrb r0, [r6] - lsrs r0, 5 - adds r2, r5, 0 - adds r2, 0x66 - strh r0, [r2] - adds r4, r5, 0 - adds r4, 0x42 - adds r0, r4, 0 - mov r1, r8 - movs r2, 0xC - bl memcpy - adds r0, r4, 0 - bl sub_800FE50 -_0802384C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80236B8 - - thumb_func_start sub_802385C -sub_802385C: @ 802385C - push {r4,r5,lr} - adds r5, r0, 0 - movs r4, 0 - ldr r3, =0x03003090 - ldrb r0, [r5, 0x9] - cmp r4, r0 - bcs _08023880 - movs r1, 0 -_0802386C: - lsls r0, r4, 5 - adds r0, r5, r0 - adds r0, 0xB5 - strb r1, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - ldrb r0, [r5, 0x9] - cmp r4, r0 - bcc _0802386C -_08023880: - adds r2, r3, 0 - ldrh r0, [r2] - movs r1, 0xFF - lsls r1, 8 - ands r1, r0 - movs r0, 0xBC - lsls r0, 6 - cmp r1, r0 - bne _08023898 - ldrh r0, [r2, 0x2] - cmp r0, 0x2 - beq _080238AC -_08023898: - adds r2, r5, 0 - adds r2, 0x25 - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - b _080238EA - .pool -_080238AC: - adds r4, r5, 0 - adds r4, 0x4E - adds r0, r4, 0 - adds r1, r3, 0 - movs r2, 0xE - bl memcpy - ldrh r0, [r4, 0x6] - strh r0, [r5, 0x2A] - movs r0, 0x5 - ldrsb r0, [r4, r0] - strh r0, [r5, 0x2C] - ldrh r0, [r4, 0x8] - strh r0, [r5, 0x28] - movs r0, 0x9C - lsls r0, 1 - adds r1, r5, r0 - adds r0, r5, 0 - bl sub_80216E0 - ldrb r1, [r4, 0x4] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080238EA - adds r0, r5, 0 - adds r0, 0x25 - ldrb r1, [r0] - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0] -_080238EA: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_802385C - - thumb_func_start sub_80238F0 -sub_80238F0: @ 80238F0 - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x5C - movs r1, 0 - movs r2, 0xC - bl memset - adds r0, r4, 0 - adds r0, 0x4E - movs r1, 0 - movs r2, 0xE - bl memset - adds r0, r4, 0 - bl sub_802385C - ldrh r1, [r4, 0x2C] - negs r1, r1 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x12 - bl SetGpuReg - ldrh r1, [r4, 0x2C] - negs r1, r1 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x1A - bl SetGpuReg - ldrh r1, [r4, 0x2C] - negs r1, r1 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x1E - bl SetGpuReg - adds r0, r4, 0 - adds r0, 0x25 - ldrb r1, [r0] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _08023978 - ldrh r1, [r4, 0x28] - ldr r0, =0x00008c9f - cmp r1, r0 - bls _08023964 - adds r0, 0x1 - strh r0, [r4, 0x28] - movs r0, 0x10 - movs r1, 0x1 - movs r2, 0 - bl sub_8022BEC - b _0802396E - .pool -_08023964: - movs r0, 0xF - movs r1, 0x1 - movs r2, 0 - bl sub_8022BEC -_0802396E: - movs r1, 0 - movs r0, 0 - strh r0, [r4, 0x10] - strb r1, [r4, 0xC] - b _08023992 -_08023978: - ldrh r0, [r4, 0x26] - adds r0, 0x1 - strh r0, [r4, 0x26] - adds r0, r4, 0 - bl sub_802339C - adds r0, r4, 0 - bl sub_8023558 - adds r0, r4, 0 - bl sub_80236B8 - movs r0, 0 -_08023992: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80238F0 - - thumb_func_start sub_8023998 -sub_8023998: @ 8023998 - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x5C - movs r1, 0 - movs r2, 0xC - bl memset - adds r0, r4, 0 - adds r0, 0x4E - movs r1, 0 - movs r2, 0xE - bl memset - adds r0, r4, 0 - bl sub_802385C - ldrh r1, [r4, 0x2C] - negs r1, r1 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x12 - bl SetGpuReg - ldrh r1, [r4, 0x2C] - negs r1, r1 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x1A - bl SetGpuReg - ldrh r1, [r4, 0x2C] - negs r1, r1 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x1E - bl SetGpuReg - adds r0, r4, 0 - adds r0, 0x25 - ldrb r1, [r0] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _08023A20 - ldrh r1, [r4, 0x28] - ldr r0, =0x00008c9f - cmp r1, r0 - bls _08023A0C - adds r0, 0x1 - strh r0, [r4, 0x28] - movs r0, 0x10 - movs r1, 0x1 - movs r2, 0 - bl sub_8022BEC - b _08023A16 - .pool -_08023A0C: - movs r0, 0xF - movs r1, 0x1 - movs r2, 0 - bl sub_8022BEC -_08023A16: - movs r1, 0 - movs r0, 0 - strh r0, [r4, 0x10] - strb r1, [r4, 0xC] - b _08023A28 -_08023A20: - adds r0, r4, 0 - bl sub_80236B8 - movs r0, 0 -_08023A28: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8023998 - - thumb_func_start sub_8023A30 -sub_8023A30: @ 8023A30 - push {r4-r7,lr} - adds r4, r0, 0 - ldrb r0, [r4, 0xC] - cmp r0, 0x5 - bls _08023A3C - b _08023BB2 -_08023A3C: - lsls r0, 2 - ldr r1, =_08023A4C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08023A4C: - .4byte _08023A64 - .4byte _08023A8C - .4byte _08023ADC - .4byte _08023B5C - .4byte _08023B7A - .4byte _08023B94 -_08023A64: - movs r0, 0x8 - strh r0, [r4, 0x12] - movs r0, 0xD6 - bl audio_play - movs r0, 0x1 - negs r0, r0 - ldr r2, =0x000003ff - movs r1, 0x8 - bl sub_80A2A20 - movs r0, 0x9C - lsls r0, 1 - adds r1, r4, r0 - movs r0, 0x2 - strb r0, [r1] - b _08023BB2 - .pool -_08023A8C: - movs r1, 0x9C - lsls r1, 1 - adds r5, r4, r1 - ldrb r0, [r5] - subs r0, 0x1 - strb r0, [r5] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _08023AA2 - b _08023BB8 -_08023AA2: - movs r0, 0x1 - negs r0, r0 - ldr r2, =0x000003ff - movs r1, 0 - bl sub_80A2A20 - ldr r2, =0x00000139 - adds r1, r4, r2 - movs r0, 0x4 - strb r0, [r1] - movs r0, 0 - strb r0, [r5] - ldr r2, =gUnknown_082F326C - ldrb r1, [r1] - lsls r0, r1, 3 - subs r0, r1 - adds r0, r2 - ldrb r0, [r0] - movs r2, 0x9D - lsls r2, 1 - adds r1, r4, r2 - strb r0, [r1] - b _08023BB2 - .pool -_08023ADC: - ldr r7, =gUnknown_082F326C - movs r0, 0x9C - lsls r0, 1 - adds r6, r4, r0 - ldr r1, =0x00000139 - adds r5, r4, r1 - ldrb r1, [r5] - lsls r0, r1, 3 - subs r0, r1 - ldrb r2, [r6] - adds r0, r2 - adds r0, r7 - movs r1, 0 - ldrsb r1, [r0, r1] - strh r1, [r4, 0x2C] - negs r1, r1 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x12 - bl SetGpuReg - ldrh r1, [r4, 0x2C] - negs r1, r1 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x1A - bl SetGpuReg - ldrh r1, [r4, 0x2C] - negs r1, r1 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x1E - bl SetGpuReg - ldrb r0, [r6] - adds r0, 0x1 - strb r0, [r6] - movs r1, 0x9D - lsls r1, 1 - adds r2, r4, r1 - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r2] - cmp r0, r1 - bcc _08023BB8 - ldrb r0, [r5] - cmp r0, 0 - beq _08023BB2 - subs r0, 0x1 - strb r0, [r5] - ldrb r1, [r5] - lsls r0, r1, 3 - subs r0, r1 - adds r0, r7 - ldrb r0, [r0] - strb r0, [r2] - movs r0, 0 - strb r0, [r6] - b _08023BB8 - .pool -_08023B5C: - movs r0, 0 - strh r0, [r4, 0x2C] - movs r0, 0x12 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1A - movs r1, 0 - bl SetGpuReg - movs r0, 0x1E - movs r1, 0 - bl SetGpuReg - b _08023BB2 -_08023B7A: - movs r2, 0x9C - lsls r2, 1 - adds r1, r4, r2 - adds r0, r4, 0 - bl sub_80218D4 - cmp r0, 0 - beq _08023BB8 - bl sub_8010434 - movs r0, 0 - strh r0, [r4, 0x10] - b _08023BB2 -_08023B94: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08023BB8 - movs r0, 0x11 - movs r1, 0x1 - movs r2, 0 - bl sub_8022BEC - movs r1, 0 - movs r0, 0 - strh r0, [r4, 0x10] - strb r1, [r4, 0xC] - b _08023BBA -_08023BB2: - ldrb r0, [r4, 0xC] - adds r0, 0x1 - strb r0, [r4, 0xC] -_08023BB8: - movs r0, 0 -_08023BBA: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8023A30 - - thumb_func_start sub_8023BC0 -sub_8023BC0: @ 8023BC0 - push {r4-r6,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r6, r1, 0 - ldrb r0, [r5, 0xC] - cmp r0, 0x1 - beq _08023C04 - cmp r0, 0x1 - bgt _08023BD8 - cmp r0, 0 - beq _08023BE2 - b _08023C9C -_08023BD8: - cmp r0, 0x2 - beq _08023C2A - cmp r0, 0x3 - beq _08023C5C - b _08023C9C -_08023BE2: - movs r0, 0x9 - strh r0, [r5, 0x12] - movs r0, 0x20 - bl audio_play - movs r0, 0x1 - negs r0, r0 - movs r1, 0x8 - movs r2, 0x1F - bl sub_80A2A20 - movs r0, 0x9C - lsls r0, 1 - adds r1, r5, r0 - movs r0, 0x4 - strb r0, [r1] - b _08023C9C -_08023C04: - movs r0, 0x9C - lsls r0, 1 - adds r4, r5, r0 - ldrb r0, [r4] - subs r0, 0x1 - strb r0, [r4] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _08023CA2 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - movs r2, 0x1F - bl sub_80A2A20 - movs r0, 0 - strb r0, [r4] - b _08023C9C -_08023C2A: - movs r0, 0x9C - lsls r0, 1 - adds r1, r5, r0 - adds r0, r5, 0 - bl sub_80218D4 - cmp r0, 0 - beq _08023CA2 - bl sub_8010434 - movs r0, 0 - strh r0, [r5, 0x10] - movs r0, 0x12 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1A - movs r1, 0 - bl SetGpuReg - movs r0, 0x1E - movs r1, 0 - bl SetGpuReg - b _08023C9C -_08023C5C: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08023CA2 - ldr r0, =0x02021cc4 - ldr r1, [r5, 0x1C] - movs r2, 0 - movs r3, 0x6 - bl ConvertIntToDecimalString - movs r4, 0 - str r4, [sp] - adds r0, r6, 0 - movs r1, 0x7 - movs r2, 0x1 - movs r3, 0 - bl sub_8024644 - movs r0, 0x13 - strb r0, [r5, 0xE] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0 - bl sub_8022BEC - movs r0, 0 - strh r4, [r5, 0x10] - b _08023CA0 - .pool -_08023C9C: - ldrb r0, [r5, 0xC] - adds r0, 0x1 -_08023CA0: - strb r0, [r5, 0xC] -_08023CA2: - movs r0, 0 - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8023BC0 - - thumb_func_start sub_8023CAC -sub_8023CAC: @ 8023CAC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - adds r7, r0, 0 - ldrb r0, [r7, 0xC] - cmp r0, 0x7 - bls _08023CC2 - b _0802402E -_08023CC2: - lsls r0, 2 - ldr r1, =_08023CD0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08023CD0: - .4byte _08023CF0 - .4byte _08023D2A - .4byte _08023D38 - .4byte _08023DA0 - .4byte _08023F20 - .4byte _08023FD0 - .4byte _08023FDC - .4byte _08024010 -_08023CF0: - adds r4, r7, 0 - adds r4, 0x42 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x4 - bl memset - ldrb r0, [r7, 0x8] - lsls r0, 5 - adds r0, r7, r0 - adds r2, r0, 0 - adds r2, 0xB2 - ldrh r1, [r7, 0x28] - ldrh r0, [r2] - cmp r0, r1 - bls _08023D12 - strh r1, [r2] -_08023D12: - ldrb r0, [r7, 0x8] - lsls r0, 5 - adds r0, r7, r0 - adds r0, 0xB2 - ldrh r0, [r0] - strh r0, [r4] - movs r0, 0 - adds r1, r4, 0 - movs r2, 0x2 - bl link_0800A448 - b _0802402E -_08023D2A: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _08023D36 - b _08024034 -_08023D36: - b _08024004 -_08023D38: - bl sub_800A550 - ldr r2, =gUnknown_082F4448 - ldrb r3, [r7, 0x9] - subs r1, r3, 0x2 - adds r1, r2 - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - beq _08023D50 - b _08024034 -_08023D50: - movs r0, 0 - mov r8, r0 - adds r4, r7, 0 - adds r4, 0x42 - cmp r8, r3 - bcs _08023D7E - ldr r2, =0x020223c4 -_08023D5E: - mov r3, r8 - lsls r1, r3, 5 - adds r1, r7, r1 - lsls r0, r3, 8 - adds r0, r2 - ldrh r0, [r0] - adds r1, 0xB2 - strh r0, [r1] - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldrb r6, [r7, 0x9] - cmp r8, r6 - bcc _08023D5E -_08023D7E: - movs r0, 0 - strh r0, [r7, 0x10] - strh r0, [r4] - bl sub_800A5B4 - ldrb r0, [r7, 0x8] - cmp r0, 0 - bne _08023D9C - movs r0, 0x3 - b _08024032 - .pool -_08023D9C: - movs r0, 0x6 - b _08024032 -_08023DA0: - adds r0, r7, 0 - adds r0, 0x68 - movs r1, 0 - movs r2, 0x30 - bl memset - ldrh r1, [r7, 0x28] - adds r0, r7, 0 - adds r0, 0x6C - strh r1, [r0] - movs r0, 0x18 - ldrsh r4, [r7, r0] - ldrh r0, [r7, 0x28] - movs r1, 0x3C - bl __udivsi3 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl __divsi3 - adds r1, r7, 0 - adds r1, 0x6E - strh r0, [r1] - movs r1, 0x30 - ldrsh r0, [r7, r1] - lsls r0, 8 - movs r4, 0xC8 - lsls r4, 6 - adds r1, r4, 0 - bl sub_8151574 - adds r2, r0, 0 - movs r3, 0x32 - ldrsh r1, [r7, r3] - lsls r1, 8 - bl sub_81515FC - adds r2, r0, r4 - asrs r2, 8 - movs r1, 0x7F - adds r0, r2, 0 - ands r0, r1 - adds r1, r7, 0 - adds r1, 0x70 - strh r0, [r1] - lsls r2, 8 - movs r1, 0xC8 - lsls r1, 7 - adds r0, r2, 0 - bl sub_81515FC - adds r2, r0, 0 - ldrb r1, [r7, 0x9] - ldr r0, [r7, 0x1C] - muls r0, r1 - lsls r4, r0, 8 - adds r0, r4, 0 - adds r1, r2, 0 - bl sub_8151574 - adds r4, r0, 0 - asrs r0, r4, 8 - str r0, [r7, 0x68] - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - adds r1, r7, 0 - adds r1, 0x8F - strb r0, [r1] - movs r6, 0 - mov r8, r6 - mov r9, r1 - ldrb r0, [r7, 0x9] - cmp r8, r0 - bcc _08023E44 - b _0802402E -_08023E44: - adds r0, r7, 0 - adds r0, 0x88 - add r0, r8 - mov r1, r8 - strb r1, [r0] - adds r0, r7, 0 - adds r0, 0x90 - add r0, r8 - strb r1, [r0] - mov r3, r8 - lsls r2, r3, 1 - adds r1, r7, 0 - adds r1, 0x74 - adds r1, r2 - lsls r0, r3, 5 - adds r3, r7, r0 - adds r5, r3, 0 - adds r5, 0xAE - ldrh r0, [r5] - strh r0, [r1] - adds r1, r7, 0 - adds r1, 0x72 - ldrh r6, [r1] - adds r0, r6 - strh r0, [r1] - mov r1, r9 - ldrb r0, [r1] - adds r6, r2, 0 - cmp r0, 0x1 - beq _08023EAE - cmp r0, 0x1 - bgt _08023E8A - cmp r0, 0 - beq _08023E90 - b _08023F04 -_08023E8A: - cmp r0, 0x2 - beq _08023ECC - b _08023F04 -_08023E90: - ldrh r0, [r5] - cmp r0, 0 - beq _08023ED2 - adds r0, r3, 0 - adds r0, 0xAC - ldrh r2, [r0] - lsls r2, 8 - adds r0, r2, 0 - movs r1, 0xC8 - lsls r1, 7 - bl sub_8151574 - adds r2, r0, 0 - ldrh r4, [r5] - b _08023EFA -_08023EAE: - ldrh r0, [r5] - cmp r0, 0 - beq _08023ED2 - adds r0, r3, 0 - adds r0, 0xB0 - ldrh r2, [r0] - lsls r2, 8 - adds r0, r2, 0 - movs r1, 0xC8 - lsls r1, 7 - bl sub_8151574 - adds r2, r0, 0 - ldrh r4, [r5] - b _08023EFA -_08023ECC: - ldrh r0, [r5] - cmp r0, 0 - bne _08023ED6 -_08023ED2: - movs r4, 0 - b _08023F04 -_08023ED6: - adds r1, r3, 0 - adds r1, 0xB2 - ldrh r0, [r1] - ldrh r2, [r7, 0x28] - cmp r0, r2 - bcc _08023EE8 - movs r4, 0xC8 - lsls r4, 7 - b _08023F04 -_08023EE8: - ldrh r2, [r1] - lsls r2, 8 - adds r0, r2, 0 - movs r1, 0xC8 - lsls r1, 7 - bl sub_8151574 - adds r2, r0, 0 - ldrh r4, [r7, 0x28] -_08023EFA: - lsls r4, 8 - adds r1, r4, 0 - bl sub_81515FC - adds r4, r0, 0 -_08023F04: - asrs r4, 4 - adds r0, r7, 0 - adds r0, 0x7E - adds r0, r6 - strh r4, [r0] - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldrb r3, [r7, 0x9] - cmp r8, r3 - bcc _08023E44 - b _0802402E -_08023F20: - movs r6, 0 - mov r8, r6 - ldrb r0, [r7, 0x9] - subs r0, 0x1 - adds r1, r7, 0 - adds r1, 0x68 - str r1, [sp, 0xC] - cmp r8, r0 - bge _08023FC4 -_08023F32: - ldrb r0, [r7, 0x9] - subs r0, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - mov r2, r8 - adds r2, 0x1 - str r2, [sp, 0x8] - cmp r4, r8 - bls _08023FB4 - adds r3, r7, 0 - adds r3, 0x74 - str r3, [sp] - adds r6, r7, 0 - adds r6, 0x88 - str r6, [sp, 0x4] - movs r0, 0x90 - adds r0, r7 - mov r10, r0 - movs r1, 0x7E - adds r1, r7 - mov r9, r1 -_08023F5C: - subs r2, r4, 0x1 - mov r12, r2 - lsls r6, r2, 1 - ldr r0, [sp] - adds r3, r0, r6 - lsls r5, r4, 1 - adds r1, r0, r5 - ldrh r2, [r3] - ldrh r0, [r1] - cmp r2, r0 - bcs _08023F86 - ldrh r0, [r1] - strh r2, [r1] - strh r0, [r3] - ldr r1, [sp, 0x4] - adds r2, r1, r4 - ldrb r3, [r2] - add r1, r12 - ldrb r0, [r1] - strb r0, [r2] - strb r3, [r1] -_08023F86: - mov r2, r9 - adds r3, r2, r6 - adds r1, r2, r5 - ldrh r2, [r3] - ldrh r6, [r1] - cmp r2, r6 - bcs _08023FAA - ldrh r0, [r1] - strh r2, [r1] - strh r0, [r3] - mov r0, r10 - adds r2, r0, r4 - ldrb r3, [r2] - mov r1, r10 - add r1, r12 - ldrb r0, [r1] - strb r0, [r2] - strb r3, [r1] -_08023FAA: - mov r1, r12 - lsls r0, r1, 24 - lsrs r4, r0, 24 - cmp r4, r8 - bhi _08023F5C -_08023FB4: - ldr r2, [sp, 0x8] - lsls r0, r2, 24 - lsrs r0, 24 - mov r8, r0 - ldrb r0, [r7, 0x9] - subs r0, 0x1 - cmp r8, r0 - blt _08023F32 -_08023FC4: - movs r0, 0 - ldr r1, [sp, 0xC] - movs r2, 0x30 - bl link_0800A448 - b _0802402E -_08023FD0: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08024034 - b _08024004 -_08023FDC: - bl sub_800A550 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08024034 - adds r4, r7, 0 - adds r4, 0x68 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x30 - bl memset - ldr r1, =0x020223c4 - adds r0, r4, 0 - movs r2, 0x30 - bl memcpy - bl sub_800A5B4 -_08024004: - movs r0, 0 - strh r0, [r7, 0x10] - b _0802402E - .pool -_08024010: - bl sub_8020E58 - movs r0, 0x12 - movs r1, 0x1 - movs r2, 0 - bl sub_8022BEC - movs r0, 0 - movs r1, 0xB - strh r1, [r7, 0x12] - strb r0, [r7, 0xC] - adds r1, r7, 0 - adds r1, 0x24 - strb r0, [r1] - b _08024034 -_0802402E: - ldrb r0, [r7, 0xC] - adds r0, 0x1 -_08024032: - strb r0, [r7, 0xC] -_08024034: - movs r0, 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_8023CAC - - thumb_func_start sub_8024048 -sub_8024048: @ 8024048 - push {r4-r6,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r6, r1, 0 - ldrb r0, [r5, 0xC] - cmp r0, 0x4 - bhi _08024124 - lsls r0, 2 - ldr r1, =_08024064 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08024064: - .4byte _08024078 - .4byte _0802408A - .4byte _0802409C - .4byte _080240CC - .4byte _080240DC -_08024078: - movs r0, 0x9C - lsls r0, 1 - adds r1, r5, r0 - adds r0, r5, 0 - bl sub_8022070 - cmp r0, 0 - bne _08024124 - b _0802412A -_0802408A: - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x9C - lsls r0, 1 - adds r1, r5, r0 - movs r0, 0x1E - strb r0, [r1] - b _08024124 -_0802409C: - movs r0, 0x9C - lsls r0, 1 - adds r1, r5, r0 - ldrb r0, [r1] - cmp r0, 0 - beq _080240AE - subs r0, 0x1 - strb r0, [r1] - b _0802412A -_080240AE: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0802412A - movs r0, 0x5 - bl audio_play - adds r0, r5, 0 - bl sub_802222C - b _08024124 - .pool -_080240CC: - ldrh r0, [r5, 0x12] - cmp r0, 0xC - bhi _08024124 - adds r0, 0x1 - movs r1, 0 - strh r0, [r5, 0x12] - strb r1, [r5, 0xC] - b _0802412A -_080240DC: - ldr r0, =0x02021cc4 - ldr r1, [r5, 0x1C] - movs r2, 0 - movs r3, 0x6 - bl ConvertIntToDecimalString - ldr r4, =0x02021dc4 - bl sub_80247BC - adds r1, r0, 0 - adds r0, r4, 0 - movs r2, 0 - movs r3, 0x6 - bl ConvertIntToDecimalString - movs r4, 0 - str r4, [sp] - adds r0, r6, 0 - movs r1, 0x2 - movs r2, 0x3 - movs r3, 0 - bl sub_8024644 - movs r0, 0x13 - strb r0, [r5, 0xE] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0 - bl sub_8022BEC - strb r4, [r5, 0xC] - b _0802412A - .pool -_08024124: - ldrb r0, [r5, 0xC] - adds r0, 0x1 - strb r0, [r5, 0xC] -_0802412A: - movs r0, 0 - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8024048 - - thumb_func_start sub_8024134 -sub_8024134: @ 8024134 - push {r4,r5,lr} - sub sp, 0x10 - adds r5, r0, 0 - adds r4, r1, 0 - ldrb r0, [r5, 0xC] - cmp r0, 0x4 - bhi _08024218 - lsls r0, 2 - ldr r1, =_08024150 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08024150: - .4byte _08024164 - .4byte _080241A0 - .4byte _080241A6 - .4byte _080241F0 - .4byte _08024204 -_08024164: - ldrh r1, [r5, 0x28] - ldr r0, =0x00008c9f - cmp r1, r0 - bls _08024176 - movs r1, 0x9C - lsls r1, 1 - adds r0, r5, r1 - bl sub_8022554 -_08024176: - movs r0, 0x1 - str r0, [sp] - adds r0, r4, 0 - movs r1, 0x8 - movs r2, 0 - movs r3, 0 - bl sub_8024644 - movs r4, 0 - movs r0, 0x13 - strb r0, [r5, 0xE] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0 - bl sub_8022BEC - strb r4, [r5, 0xC] - b _0802421E - .pool -_080241A0: - bl sub_8010434 - b _08024218 -_080241A6: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _0802421E - movs r0, 0 - movs r1, 0 - bl sub_81973C4 - ldr r2, =gUnknown_082C8959 - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParametrized - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =sub_8153688 - movs r1, 0 - bl AddTask - b _08024218 - .pool -_080241F0: - ldr r0, =sub_8153688 - bl is_function_an_active_task - lsls r0, 24 - cmp r0, 0 - beq _08024218 - b _0802421E - .pool -_08024204: - movs r0, 0x14 - movs r1, 0x1 - movs r2, 0 - bl sub_8022BEC - movs r1, 0 - movs r0, 0xF - strh r0, [r5, 0x12] - strb r1, [r5, 0xC] - b _0802421E -_08024218: - ldrb r0, [r5, 0xC] - adds r0, 0x1 - strb r0, [r5, 0xC] -_0802421E: - movs r0, 0 - add sp, 0x10 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8024134 - - thumb_func_start sub_8024228 -sub_8024228: @ 8024228 - push {r4-r6,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r6, r1, 0 - ldrb r0, [r5, 0xC] - cmp r0, 0x1 - beq _0802426A - cmp r0, 0x1 - bgt _08024240 - cmp r0, 0 - beq _08024246 - b _080242D0 -_08024240: - cmp r0, 0x2 - beq _08024270 - b _080242D0 -_08024246: - movs r0, 0x1 - str r0, [sp] - adds r0, r6, 0 - movs r1, 0x4 - movs r2, 0 - movs r3, 0 - bl sub_8024644 - movs r0, 0x14 - strb r0, [r5, 0xE] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0 - bl sub_8022BEC - movs r0, 0 - strb r0, [r5, 0xC] - b _080242D8 -_0802426A: - bl sub_8197930 - b _080242D0 -_08024270: - bl sub_8198C58 - lsls r0, 24 - asrs r4, r0, 24 - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - beq _080242D6 - adds r0, r5, 0 - adds r0, 0x42 - movs r1, 0 - movs r2, 0xC - bl memset - cmp r4, 0 - bne _080242A2 - bl sub_80D67C4 - lsls r0, 24 - cmp r0, 0 - beq _0802429E - strh r4, [r5, 0x14] - b _080242A6 -_0802429E: - movs r0, 0x3 - b _080242A4 -_080242A2: - movs r0, 0x1 -_080242A4: - strh r0, [r5, 0x14] -_080242A6: - movs r0, 0 - movs r1, 0x1 - bl sub_8197434 - movs r4, 0 - str r4, [sp] - adds r0, r6, 0 - movs r1, 0x8 - movs r2, 0 - movs r3, 0 - bl sub_8024644 - movs r0, 0x15 - strb r0, [r5, 0xE] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0 - bl sub_8022BEC - strb r4, [r5, 0xC] - b _080242D6 -_080242D0: - ldrb r0, [r5, 0xC] - adds r0, 0x1 - strb r0, [r5, 0xC] -_080242D6: - movs r0, 0 -_080242D8: - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8024228 - - thumb_func_start sub_80242E0 -sub_80242E0: @ 80242E0 - push {r4-r7,lr} - adds r4, r0, 0 - movs r5, 0 - ldrb r0, [r4, 0xC] - cmp r0, 0x1 - beq _08024306 - cmp r0, 0x1 - bgt _080242F6 - cmp r0, 0 - beq _08024300 - b _080243AC -_080242F6: - cmp r0, 0x2 - beq _08024328 - cmp r0, 0x3 - beq _08024336 - b _080243AC -_08024300: - bl sub_8010434 - b _080243AC -_08024306: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080243B2 - ldrh r0, [r4, 0x14] - adds r1, r4, 0 - adds r1, 0x42 - strh r0, [r1] - adds r0, r4, 0 - adds r0, 0x4E - strh r5, [r0] - movs r0, 0 - movs r2, 0x2 - bl link_0800A448 - b _080243AC -_08024328: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080243B2 - strh r5, [r4, 0x10] - b _080243AC -_08024336: - bl sub_800A550 - ldr r2, =gUnknown_082F4448 - ldrb r3, [r4, 0x9] - subs r1, r3, 0x2 - adds r1, r2 - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bne _080243B2 - adds r7, r4, 0 - adds r7, 0x42 - adds r6, r4, 0 - adds r6, 0x4E - cmp r5, r3 - bcs _08024374 - adds r1, r6, 0 - ldr r2, =0x020223c4 -_0802435C: - lsls r0, r5, 8 - adds r0, r2 - ldrh r0, [r0] - ldrh r3, [r1] - adds r0, r3 - strh r0, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldrb r0, [r4, 0x9] - cmp r5, r0 - bcc _0802435C -_08024374: - ldrh r0, [r6] - cmp r0, 0 - beq _08024390 - movs r0, 0x17 - movs r1, 0x1 - movs r2, 0 - bl sub_8022BEC - b _0802439A - .pool -_08024390: - movs r0, 0x16 - movs r1, 0x1 - movs r2, 0 - bl sub_8022BEC -_0802439A: - bl sub_800A5B4 - movs r1, 0 - movs r0, 0 - strh r0, [r7] - strh r0, [r6] - strh r0, [r4, 0x10] - strb r1, [r4, 0xC] - b _080243B4 -_080243AC: - ldrb r0, [r4, 0xC] - adds r0, 0x1 - strb r0, [r4, 0xC] -_080243B2: - movs r0, 0 -_080243B4: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80242E0 - - thumb_func_start sub_80243BC -sub_80243BC: @ 80243BC - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - ldrb r4, [r5, 0xC] - cmp r4, 0x1 - beq _080243EA - cmp r4, 0x1 - bgt _080243D2 - cmp r4, 0 - beq _080243DC - b _08024434 -_080243D2: - cmp r4, 0x2 - beq _080243F6 - cmp r4, 0x3 - beq _0802441A - b _08024434 -_080243DC: - movs r0, 0x1 - negs r0, r0 - str r4, [sp] - movs r1, 0x1 - movs r2, 0 - movs r3, 0x10 - b _08024410 -_080243EA: - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - beq _08024434 - b _0802443A -_080243F6: - movs r0, 0 - movs r1, 0x1 - bl sub_8197434 - adds r0, r5, 0 - bl sub_8021488 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 -_08024410: - bl pal_fade_maybe - bl fade_and_return_progress_probably - b _08024434 -_0802441A: - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - bne _0802443A - movs r0, 0x7 - movs r1, 0x1 - movs r2, 0 - bl sub_8022BEC - movs r0, 0 - strh r4, [r5, 0x12] - b _08024438 -_08024434: - ldrb r0, [r5, 0xC] - adds r0, 0x1 -_08024438: - strb r0, [r5, 0xC] -_0802443A: - movs r0, 0 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80243BC - - thumb_func_start sub_8024444 -sub_8024444: @ 8024444 - push {r4,r5,lr} - sub sp, 0x10 - adds r5, r0, 0 - ldrb r4, [r5, 0xC] - cmp r4, 0x1 - beq _080244BC - cmp r4, 0x1 - bgt _0802445A - cmp r4, 0 - beq _08024460 - b _080244F6 -_0802445A: - cmp r4, 0x2 - beq _080244D4 - b _080244F6 -_08024460: - movs r0, 0 - movs r1, 0 - bl sub_81973C4 - ldrh r1, [r5, 0x14] - cmp r1, 0x3 - bne _08024490 - ldr r0, =gUnknown_082F32A4 - ldr r2, [r0, 0x14] - ldrb r3, [r5, 0xB] - str r4, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - str r1, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - bl AddTextPrinterParametrized - b _080244AC - .pool -_08024490: - ldr r0, =gUnknown_082F32A4 - ldr r2, [r0, 0x18] - ldrb r3, [r5, 0xB] - str r4, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - bl AddTextPrinterParametrized -_080244AC: - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - b _080244F6 - .pool -_080244BC: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _080244FC - movs r0, 0x9C - lsls r0, 1 - adds r1, r5, r0 - movs r0, 0x78 - strb r0, [r1] - b _080244F6 -_080244D4: - movs r0, 0x9C - lsls r0, 1 - adds r1, r5, r0 - ldrb r0, [r1] - adds r4, r0, 0 - cmp r4, 0 - beq _080244E8 - subs r0, 0x1 - strb r0, [r1] - b _080244FC -_080244E8: - movs r0, 0x18 - movs r1, 0x1 - movs r2, 0 - bl sub_8022BEC - strb r4, [r5, 0xC] - b _080244FC -_080244F6: - ldrb r0, [r5, 0xC] - adds r0, 0x1 - strb r0, [r5, 0xC] -_080244FC: - movs r0, 0 - add sp, 0x10 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8024444 - - thumb_func_start sub_8024508 -sub_8024508: @ 8024508 - push {r4,r5,lr} - adds r5, r0, 0 - ldrb r4, [r5, 0xC] - cmp r4, 0x1 - beq _08024528 - cmp r4, 0x1 - bgt _0802451C - cmp r4, 0 - beq _08024522 - b _08024558 -_0802451C: - cmp r4, 0x2 - beq _08024538 - b _08024558 -_08024522: - bl sub_8010434 - b _08024558 -_08024528: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _0802455E - bl sub_800AC34 - b _08024558 -_08024538: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _0802455E - movs r0, 0x19 - strb r0, [r5, 0xE] - movs r0, 0x5 - movs r1, 0x1 - movs r2, 0 - bl sub_8022BEC - strb r4, [r5, 0xC] - b _0802455E - .pool -_08024558: - ldrb r0, [r5, 0xC] - adds r0, 0x1 - strb r0, [r5, 0xC] -_0802455E: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8024508 - - thumb_func_start sub_8024568 -sub_8024568: @ 8024568 - push {lr} - movs r0, 0 - bl sub_8020C0C - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_8024568 - - thumb_func_start sub_8024578 -sub_8024578: @ 8024578 - push {r4-r6,lr} - adds r4, r0, 0 - movs r5, 0 - movs r0, 0x33 - bl sav12_xor_increment - strb r5, [r4, 0xD] - movs r1, 0 - strh r5, [r4, 0x10] - movs r0, 0x2 - strh r0, [r4, 0x12] - strh r5, [r4, 0x14] - str r5, [r4, 0x1C] - strh r5, [r4, 0x18] - strh r5, [r4, 0x1A] - str r5, [r4, 0x20] - adds r0, r4, 0 - adds r0, 0x24 - strb r1, [r0] - adds r1, r4, 0 - adds r1, 0x25 - movs r0, 0 - strb r0, [r1] - strh r5, [r4, 0x26] - strh r5, [r4, 0x28] - strh r5, [r4, 0x2E] - ldr r0, =0x0000ffff - strh r0, [r4, 0x32] - strh r5, [r4, 0x30] - strh r5, [r4, 0x34] - movs r6, 0 - movs r3, 0 -_080245B8: - lsls r0, r5, 5 - adds r2, r4, r0 - adds r1, r2, 0 - adds r1, 0xA4 - ldr r0, =0x0000ffff - strh r0, [r1] - adds r0, r2, 0 - adds r0, 0xA6 - strh r3, [r0] - adds r0, 0x2 - strh r3, [r0] - adds r1, 0x6 - movs r0, 0x1 - strh r0, [r1] - adds r0, r2, 0 - adds r0, 0xAC - strh r3, [r0] - adds r0, 0x2 - strh r3, [r0] - adds r0, 0x2 - strh r3, [r0] - adds r0, 0x2 - strh r3, [r0] - adds r0, 0x2 - strb r6, [r0] - adds r0, 0x1 - strb r6, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x4 - bls _080245B8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8024578 - - thumb_func_start sub_8024604 -sub_8024604: @ 8024604 - push {r4-r6,lr} - sub sp, 0x8 - str r2, [sp, 0x4] - ldr r5, [sp, 0x18] - ldr r6, [sp, 0x1C] - ldr r4, [sp, 0x20] - mov r2, sp - strh r4, [r2] - add r4, sp, 0x4 - ldrb r2, [r4] - strb r2, [r0] - ldrb r2, [r4, 0x1] - strb r2, [r0, 0x1] - ldrb r2, [r4, 0x2] - strb r2, [r0, 0x2] - ldrb r2, [r4, 0x3] - strb r2, [r0, 0x3] - strb r3, [r0, 0x4] - strb r5, [r0, 0x5] - strb r6, [r0, 0x6] - mov r2, sp - ldrb r2, [r2] - strb r2, [r0, 0x7] - mov r2, sp - ldrb r2, [r2, 0x1] - strb r2, [r0, 0x8] - strb r1, [r0, 0x9] - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8024604 - - thumb_func_start sub_8024644 -sub_8024644: @ 8024644 - push {r4,r5,lr} - sub sp, 0x4 - ldr r5, [sp, 0x10] - mov r4, sp - strh r3, [r4] - strb r1, [r0] - strb r2, [r0, 0x1] - mov r1, sp - ldrb r1, [r1] - strb r1, [r0, 0x2] - mov r1, sp - ldrb r1, [r1, 0x1] - strb r1, [r0, 0x3] - strb r5, [r0, 0x4] - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8024644 - - thumb_func_start sub_8024668 -sub_8024668: @ 8024668 - ldr r1, =0x03005d90 - ldr r1, [r1] - adds r1, 0xAC - ldr r0, [r0] - ldr r1, [r1] - eors r0, r1 - bx lr - .pool - thumb_func_end sub_8024668 - - thumb_func_start sub_802467C -sub_802467C: @ 802467C - ldr r2, =0x03005d90 - ldr r2, [r2] - adds r2, 0xAC - ldr r2, [r2] - eors r2, r1 - str r2, [r0] - bx lr - .pool - thumb_func_end sub_802467C - - thumb_func_start sub_8024690 -sub_8024690: @ 8024690 - push {lr} - adds r1, r0, 0 - ldr r0, =0x03005d90 - ldr r0, [r0] - movs r2, 0xFA - lsls r2, 1 - adds r0, r2 - bl apply_u32_xor_crypto - pop {r0} - bx r0 - .pool - thumb_func_end sub_8024690 - - thumb_func_start sub_80246AC -sub_80246AC: @ 80246AC - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x03005d90 - ldr r0, [r0] - movs r1, 0xFA - lsls r1, 1 - adds r0, r1 - bl sub_8024668 - cmp r0, r4 - bcc _080246CC - movs r0, 0x1 - b _080246CE - .pool -_080246CC: - movs r0, 0 -_080246CE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80246AC - - thumb_func_start sub_80246D4 -sub_80246D4: @ 80246D4 - push {lr} - ldr r0, =0x03005d90 - ldr r0, [r0] - movs r1, 0xFA - lsls r1, 1 - adds r0, r1 - bl sub_8024668 - ldr r1, =0x020375e0 - ldrh r1, [r1] - cmp r0, r1 - bcc _080246F8 - movs r0, 0x1 - b _080246FA - .pool -_080246F8: - movs r0, 0 -_080246FA: - pop {r1} - bx r1 - thumb_func_end sub_80246D4 - - thumb_func_start sub_8024700 -sub_8024700: @ 8024700 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r0, =0x03005d90 - ldr r0, [r0] - movs r1, 0xFA - lsls r1, 1 - adds r5, r0, r1 - adds r0, r5, 0 - bl sub_8024668 - adds r1, r0, r4 - ldr r2, =0x0001869f - cmp r1, r2 - bhi _08024730 - adds r0, r5, 0 - bl sub_802467C - movs r0, 0x1 - b _0802473A - .pool -_08024730: - adds r0, r5, 0 - adds r1, r2, 0 - bl sub_802467C - movs r0, 0 -_0802473A: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8024700 - - thumb_func_start sub_8024740 -sub_8024740: @ 8024740 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =0x03005d90 - ldr r0, [r0] - movs r1, 0xFA - lsls r1, 1 - adds r4, r0, r1 - adds r0, r5, 0 - bl sub_80246AC - lsls r0, 24 - cmp r0, 0 - beq _08024774 - adds r0, r4, 0 - bl sub_8024668 - adds r1, r0, 0 - subs r1, r5 - adds r0, r4, 0 - bl sub_802467C - movs r0, 0x1 - b _08024776 - .pool -_08024774: - movs r0, 0 -_08024776: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8024740 - - thumb_func_start sub_802477C -sub_802477C: @ 802477C - push {r4,r5,lr} - ldr r0, =0x03005d90 - ldr r0, [r0] - movs r1, 0xFA - lsls r1, 1 - adds r4, r0, r1 - ldr r5, =0x020375e0 - ldrh r0, [r5] - bl sub_80246AC - lsls r0, 24 - cmp r0, 0 - beq _080247B4 - adds r0, r4, 0 - bl sub_8024668 - adds r1, r0, 0 - ldrh r0, [r5] - subs r1, r0 - adds r0, r4, 0 - bl sub_802467C - movs r0, 0x1 - b _080247B6 - .pool -_080247B4: - movs r0, 0 -_080247B6: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_802477C - - thumb_func_start sub_80247BC -sub_80247BC: @ 80247BC - push {lr} - ldr r0, =0x03005d90 - ldr r0, [r0] - movs r1, 0xFA - lsls r1, 1 - adds r0, r1 - bl sub_8024668 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80247BC - - thumb_func_start sub_80247D4 -sub_80247D4: @ 80247D4 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0xC - adds r6, r0, 0 - mov r8, r2 - adds r4, r3, 0 - ldr r5, [sp, 0x24] - lsls r6, 24 - lsrs r6, 24 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =0x02021cc4 - mov r9, r0 - movs r2, 0x1 - movs r3, 0x5 - bl ConvertIntToDecimalString - str r4, [sp] - str r5, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r6, 0 - movs r1, 0x1 - mov r2, r9 - mov r3, r8 - bl Print - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80247D4 - - thumb_func_start sub_802482C -sub_802482C: @ 802482C - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0xC - adds r6, r0, 0 - adds r4, r1, 0 - adds r5, r2, 0 - mov r8, r3 - lsls r6, 24 - lsrs r6, 24 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 24 - lsrs r5, 24 - adds r0, r6, 0 - movs r1, 0 - adds r2, r4, 0 - adds r3, r5, 0 - bl SetWindowBorderStyle - ldr r2, =gUnknown_085EDCDE - movs r0, 0x1 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r4, 0 - str r4, [sp, 0x8] - adds r0, r6, 0 - movs r1, 0x1 - movs r3, 0 - bl Print - str r4, [sp] - adds r0, r6, 0 - mov r1, r8 - movs r2, 0x1A - movs r3, 0x11 - bl sub_80247D4 - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802482C - - thumb_func_start sub_802488C -sub_802488C: @ 802488C - push {lr} - sub sp, 0x4 - bl sub_80247BC - adds r1, r0, 0 - ldr r0, =0x02022c94 - ldrb r0, [r0] - movs r2, 0 - str r2, [sp] - movs r2, 0x1A - movs r3, 0x11 - bl sub_80247D4 - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_802488C - - thumb_func_start sub_80248B0 -sub_80248B0: @ 80248B0 - push {r4,r5,lr} - sub sp, 0x18 - movs r0, 0x7 - str r0, [sp] - movs r0, 0x4 - str r0, [sp, 0x4] - movs r0, 0xF - str r0, [sp, 0x8] - movs r0, 0x1C - str r0, [sp, 0xC] - add r0, sp, 0x10 - movs r1, 0 - movs r2, 0x1 - movs r3, 0x1 - bl rbox_template_set - ldr r4, =0x02022c94 - add r0, sp, 0x10 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - bl FillWindowPixelBuffer - ldrb r0, [r4] - bl PutWindowTilemap - ldrb r0, [r4] - ldr r5, =0x0000021d - adds r1, r5, 0 - movs r2, 0xD0 - bl box_border_load_tiles_and_pal - ldrb r4, [r4] - bl sub_80247BC - adds r3, r0, 0 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0xD - bl sub_802482C - add sp, 0x18 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80248B0 - - thumb_func_start sub_8024918 -sub_8024918: @ 8024918 - push {r4,lr} - ldr r4, =0x02022c94 - ldrb r0, [r4] - bl ClearWindowTilemap - ldrb r0, [r4] - movs r1, 0x1 - bl sub_8198070 - ldrb r0, [r4] - bl RemoveWindow - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8024918 - - thumb_func_start sub_802493C -sub_802493C: @ 802493C - push {r4-r6,lr} - adds r5, r1, 0 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r1, =0x03000db0 - movs r0, 0 - str r0, [r1] - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _08024A10 - ldr r4, =0x02022c98 - ldr r0, =0x00003330 - bl AllocZeroed - str r0, [r4] - cmp r0, 0 - beq _08024A10 - bl sub_8024A1C - ldr r0, [r4] - bl sub_8024A30 - ldr r0, [r4] - str r5, [r0] - bl link_get_multiplayer_id - ldr r1, [r4] - adds r1, 0x28 - strb r0, [r1] - ldr r1, [r4] - ldr r2, =0x000032cc - adds r0, r1, r2 - adds r2, r1, 0 - adds r2, 0x28 - ldrb r3, [r2] - lsls r2, r3, 4 - subs r2, r3 - lsls r2, 2 - adds r1, r2 - ldr r2, =0x000031a0 - adds r1, r2 - movs r2, 0x3C - bl memcpy - ldr r0, [r4] - adds r1, r0, 0 - adds r1, 0x28 - ldrb r1, [r1] - lsls r1, 2 - ldr r2, =0x0000318c - adds r1, r2 - adds r0, r1 - movs r1, 0x64 - muls r1, r6 - ldr r2, =0x020244ec - adds r1, r2 - bl sub_80261F8 - ldr r0, =sub_8024BC8 - movs r1, 0x1 - bl AddTask - ldr r0, =sub_80261CC - bl SetMainCallback2 - bl sub_80273F0 - ldr r2, [r4] - adds r0, r2, 0 - adds r0, 0x24 - ldrb r0, [r0] - adds r1, r2, 0 - adds r1, 0x44 - adds r2, 0x48 - bl sub_8026B5C - bl sub_80A2F30 - ldr r0, =0x0000021e - bl current_map_music_set - b _08024A16 - .pool -_08024A10: - adds r0, r5, 0 - bl SetMainCallback2 -_08024A16: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_802493C - - thumb_func_start sub_8024A1C -sub_8024A1C: @ 8024A1C - push {lr} - bl clear_tasks - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - pop {r0} - bx r0 - thumb_func_end sub_8024A1C - - thumb_func_start sub_8024A30 -sub_8024A30: @ 8024A30 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x28 - adds r2, r0, 0 - movs r0, 0 - strb r0, [r2, 0xC] - strb r0, [r2, 0x10] - strb r0, [r2, 0x14] - strb r0, [r2, 0x18] - strb r0, [r2, 0x1C] - movs r3, 0x8E - lsls r3, 1 - adds r1, r2, r3 - str r0, [r1] - movs r7, 0x90 - lsls r7, 1 - adds r1, r2, r7 - str r0, [r1] - adds r1, r2, 0 - adds r1, 0x30 - strb r0, [r1] - adds r1, 0x10 - strb r0, [r1] - subs r1, 0x4 - strb r0, [r1] - adds r3, 0x10 - adds r1, r2, r3 - str r0, [r1] - movs r5, 0 - adds r1, r2, 0 - adds r1, 0x98 - movs r3, 0 -_08024A76: - adds r0, r1, r5 - strb r3, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _08024A76 - movs r5, 0 - adds r7, r2, 0 - adds r7, 0xA8 - str r7, [sp] - adds r0, r2, 0 - adds r0, 0xB0 - str r0, [sp, 0xC] - movs r1, 0x4A - adds r1, r2 - mov r10, r1 - movs r3, 0x4C - adds r3, r2 - mov r9, r3 - movs r7, 0x4E - adds r7, r2 - mov r12, r7 - subs r0, 0x60 - str r0, [sp, 0x24] - adds r6, r2, 0 - adds r6, 0x54 - adds r1, r2, 0 - adds r1, 0xD0 - str r1, [sp, 0x1C] - adds r3, r2, 0 - adds r3, 0xDC - str r3, [sp, 0x20] - adds r7, r2, 0 - adds r7, 0xC4 - str r7, [sp, 0x14] - adds r0, 0xA4 - str r0, [sp, 0x4] - adds r1, 0x25 - str r1, [sp, 0x8] - subs r3, 0xBC - str r3, [sp, 0x10] - movs r7, 0x24 - adds r7, r2 - mov r8, r7 - subs r0, 0xC0 - str r0, [sp, 0x18] - movs r3, 0 - movs r1, 0x86 - lsls r1, 1 - adds r4, r2, r1 - movs r7, 0x98 - lsls r7, 1 - adds r2, r7 -_08024AE2: - ldr r1, [sp] - adds r0, r1, r5 - strb r3, [r0] - ldr r7, [sp, 0xC] - adds r0, r7, r5 - strb r3, [r0] - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - mov r7, r10 - adds r1, r7, r0 - strh r3, [r1] - mov r7, r9 - adds r1, r7, r0 - strh r3, [r1] - mov r7, r12 - adds r1, r7, r0 - strh r3, [r1] - ldr r7, [sp, 0x24] - adds r1, r7, r0 - strh r3, [r1] - adds r0, r6, r0 - strh r3, [r0] - adds r0, r4, r5 - strb r3, [r0] - lsls r0, r5, 2 - adds r0, r2, r0 - str r3, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x4 - bls _08024AE2 - movs r5, 0 - movs r3, 0 - movs r4, 0xFF - ldr r6, [sp, 0x1C] -_08024B2C: - adds r0, r6, r5 - strb r3, [r0] - ldr r1, [sp, 0x20] - adds r0, r1, r5 - strb r3, [r0] - ldr r7, [sp, 0x14] - adds r0, r7, r5 - strb r3, [r0] - lsls r1, r5, 1 - ldr r0, [sp, 0x4] - adds r2, r0, r1 - ldrb r0, [r2] - orrs r0, r4 - strb r0, [r2] - ldr r7, [sp, 0x8] - adds r1, r7, r1 - ldrb r0, [r1] - orrs r0, r4 - strb r0, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0xA - bls _08024B2C - bl link_get_multiplayer_id - movs r1, 0 - lsls r0, 24 - cmp r0, 0 - bne _08024B6A - movs r1, 0x1 -_08024B6A: - ldr r0, [sp, 0x10] - strb r1, [r0] - bl sub_8009FCC - mov r1, r8 - strb r0, [r1] - bl link_get_multiplayer_id - ldr r3, [sp, 0x18] - strb r0, [r3] - movs r5, 0x1 - mov r7, r8 - ldrb r7, [r7] - cmp r5, r7 - bcs _08024BB6 - ldr r7, [sp, 0x18] - mov r6, r8 -_08024B8C: - adds r4, r7, r5 - subs r0, r5, 0x1 - adds r0, r7, r0 - ldrb r0, [r0] - adds r0, 0x1 - strb r0, [r4] - ldrb r2, [r4] - ldrb r1, [r6] - subs r0, r1, 0x1 - cmp r2, r0 - ble _08024BAA - adds r0, r2, 0 - bl __umodsi3 - strb r0, [r4] -_08024BAA: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldrb r0, [r6] - cmp r5, r0 - bcc _08024B8C -_08024BB6: - 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_8024A30 - - thumb_func_start sub_8024BC8 -sub_8024BC8: @ 8024BC8 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r1, r0, 24 - ldr r0, =0x02022c98 - ldr r0, [r0] - ldrb r0, [r0, 0xC] - cmp r0, 0x7 - bls _08024BDC - b _08024D34 -_08024BDC: - lsls r0, 2 - ldr r1, =_08024BF0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08024BF0: - .4byte _08024C10 - .4byte _08024C24 - .4byte _08024C4C - .4byte _08024C5A - .4byte _08024C80 - .4byte _08024CD4 - .4byte _08024CE6 - .4byte _08024D10 -_08024C10: - movs r0, 0 - bl SetVBlankCallback - ldr r0, =sub_8025910 - movs r1, 0x4 - bl sub_802620C - b _08024D20 - .pool -_08024C24: - ldr r0, =sub_8025910 - bl is_function_an_active_task - lsls r0, 24 - cmp r0, 0 - beq _08024C32 - b _08024D40 -_08024C32: - ldr r4, =0x02022c98 - ldr r0, [r4] - movs r1, 0xB0 - lsls r1, 1 - adds r0, r1 - bl sub_8029274 - ldr r1, [r4] - b _08024D24 - .pool -_08024C4C: - bl sub_802A770 - cmp r0, 0 - bne _08024D40 - bl sub_8010434 - b _08024D20 -_08024C5A: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08024D40 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _08024D20 - bl sub_800E0E8 - movs r0, 0 - movs r1, 0 - bl sub_800DFB4 - b _08024D20 - .pool -_08024C80: - ldr r0, =0x02022c98 - ldr r0, [r0] - adds r0, 0x24 - ldrb r5, [r0] - bl sub_80283A8 - movs r4, 0 - cmp r4, r5 - bcs _08024CBA -_08024C92: - ldr r0, =0x02022c98 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x34 - adds r0, r4 - ldrb r2, [r0] - lsls r0, r2, 2 - ldr r3, =0x0000318c - adds r0, r3 - adds r0, r1, r0 - adds r1, 0x24 - ldrb r3, [r1] - adds r1, r4, 0 - bl sub_8028408 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _08024C92 -_08024CBA: - ldr r4, =0x02022c98 - ldr r0, [r4] - adds r0, 0x24 - ldrb r1, [r0] - movs r0, 0 - bl sub_802868C - ldr r1, [r4] - b _08024D24 - .pool -_08024CD4: - bl sub_8028A34 - bl sub_8028A88 - bl sub_8028D44 - bl sub_8028734 - b _08024D20 -_08024CE6: - movs r4, 0x1 - negs r4, r4 - adds r0, r4, 0 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r0, =sub_80261E4 - bl SetVBlankCallback - b _08024D20 - .pool -_08024D10: - bl fade_and_return_progress_probably - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08024D40 -_08024D20: - ldr r0, =0x02022c98 - ldr r1, [r0] -_08024D24: - ldrb r0, [r1, 0xC] - adds r0, 0x1 - strb r0, [r1, 0xC] - b _08024D40 - .pool -_08024D34: - adds r0, r1, 0 - bl remove_task - ldr r0, =sub_802589C - bl sub_802621C -_08024D40: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8024BC8 - - thumb_func_start sub_8024D4C -sub_8024D4C: @ 8024D4C - push {lr} - bl sub_8025D04 - ldr r1, =gUnknown_082F7AC4 - ldr r0, =0x02022c98 - ldr r0, [r0] - ldrb r0, [r0, 0x18] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - ldr r0, =0x03000db0 - ldr r0, [r0] - cmp r0, 0 - bne _08024D70 - bl sub_8026AF4 -_08024D70: - bl sub_8025D50 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8024D4C - - thumb_func_start sub_8024D84 -sub_8024D84: @ 8024D84 - push {lr} - bl sub_8025E0C - ldr r1, =gUnknown_082F7AF4 - ldr r0, =0x02022c98 - ldr r0, [r0] - ldrb r0, [r0, 0x18] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - ldr r0, =0x03000db0 - ldr r0, [r0] - cmp r0, 0 - bne _08024DA8 - bl sub_8026B28 -_08024DA8: - bl sub_8025ED8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8024D84 - - thumb_func_start sub_8024DBC -sub_8024DBC: @ 8024DBC - push {r4,lr} - ldr r4, =0x02022c98 - ldr r0, [r4] - ldrb r0, [r0, 0x10] - cmp r0, 0 - beq _08024DD4 - cmp r0, 0x1 - beq _08024DEA - b _08024DF8 - .pool -_08024DD4: - movs r0, 0x1 - bl sub_8028504 - movs r0, 0x1 - bl sub_80292E0 - ldr r1, [r4] - ldrb r0, [r1, 0x10] - adds r0, 0x1 - strb r0, [r1, 0x10] - b _08024DF8 -_08024DEA: - bl sub_802A770 - cmp r0, 0 - bne _08024DF8 - movs r0, 0x1 - bl sub_8026240 -_08024DF8: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8024DBC - - thumb_func_start sub_8024E00 -sub_8024E00: @ 8024E00 - push {r4,lr} - ldr r4, =0x02022c98 - ldr r1, [r4] - ldrb r0, [r1, 0x10] - cmp r0, 0 - bne _08024E20 - bl sub_80262C0 - ldr r1, [r4] - ldrb r0, [r1, 0x10] - adds r0, 0x1 - strb r0, [r1, 0x10] - b _08024E30 - .pool -_08024E20: - movs r0, 0x8C - lsls r0, 1 - adds r1, r0 - movs r0, 0x1 - str r0, [r1] - movs r0, 0x2 - bl sub_8026240 -_08024E30: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8024E00 - - thumb_func_start sub_8024E38 -sub_8024E38: @ 8024E38 - push {r4,lr} - sub sp, 0x4 - ldr r1, =0x02022c98 - ldr r0, [r1] - ldrb r0, [r0, 0x10] - adds r4, r1, 0 - cmp r0, 0x5 - bhi _08024F08 - lsls r0, 2 - ldr r1, =_08024E5C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08024E5C: - .4byte _08024E74 - .4byte _08024E90 - .4byte _08024EA0 - .4byte _08024EC4 - .4byte _08024ED8 - .4byte _08024EF8 -_08024E74: - movs r0, 0 - str r0, [sp] - movs r0, 0x7 - movs r1, 0x8 - movs r2, 0x78 - movs r3, 0x50 - bl sub_802EB24 - ldr r0, =0x02022c98 - ldr r1, [r0] - b _08024EF0 - .pool -_08024E90: - bl sub_8010434 - ldr r0, =0x02022c98 - ldr r1, [r0] - b _08024EF0 - .pool -_08024EA0: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08024F08 - ldr r2, =0x02022c98 - ldr r1, [r2] - ldrb r0, [r1, 0x10] - adds r0, 0x1 - movs r3, 0 - strb r0, [r1, 0x10] - ldr r0, [r2] - adds r0, 0x30 - strb r3, [r0] - b _08024F08 - .pool -_08024EC4: - bl sub_802EB84 - cmp r0, 0 - bne _08024F08 - ldr r0, =0x02022c98 - ldr r1, [r0] - b _08024EF0 - .pool -_08024ED8: - ldr r1, [r4] - adds r1, 0x30 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - bls _08024F08 - bl sub_8010434 - ldr r1, [r4] -_08024EF0: - ldrb r0, [r1, 0x10] - adds r0, 0x1 - strb r0, [r1, 0x10] - b _08024F08 -_08024EF8: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08024F08 - movs r0, 0x3 - bl sub_8026240 -_08024F08: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8024E38 - - thumb_func_start sub_8024F10 -sub_8024F10: @ 8024F10 - push {lr} - ldr r0, =0x02022c98 - ldr r1, [r0] - ldrb r0, [r1, 0x10] - cmp r0, 0 - bne _08024F2E - movs r2, 0x8E - lsls r2, 1 - adds r0, r1, r2 - ldr r0, [r0] - cmp r0, 0 - beq _08024F2E - movs r0, 0x4 - bl sub_8026240 -_08024F2E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8024F10 - - thumb_func_start sub_8024F38 -sub_8024F38: @ 8024F38 - push {r4,lr} - ldr r4, =0x02022c98 - ldr r2, [r4] - ldrb r0, [r2, 0x10] - cmp r0, 0 - bne _08024FF6 - adds r0, r2, 0 - adds r0, 0x40 - ldrb r0, [r0] - cmp r0, 0x9 - bhi _08024FE8 - adds r0, r2, 0 - adds r0, 0xA8 - ldrb r0, [r0] - cmp r0, 0 - bne _08024FEE - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08024F88 - ldr r1, =0x000031cc - adds r0, r2, r1 - ldrb r1, [r0] - cmp r1, 0 - bne _08024FEE - ldr r3, =0x000031d0 - adds r0, r2, r3 - strb r1, [r0] - movs r0, 0x2 - b _08024FC2 - .pool -_08024F88: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08024FA8 - ldr r3, =0x000031cc - adds r0, r2, r3 - ldrb r1, [r0] - cmp r1, 0 - bne _08024FEE - adds r3, 0x4 - adds r0, r2, r3 - strb r1, [r0] - movs r0, 0x1 - b _08024FC2 - .pool -_08024FA8: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08024FD4 - ldr r3, =0x000031cc - adds r0, r2, r3 - ldrb r1, [r0] - cmp r1, 0 - bne _08024FEE - adds r3, 0x4 - adds r0, r2, r3 - strb r1, [r0] - movs r0, 0x3 -_08024FC2: - bl sub_8027518 - ldr r1, [r4] - ldr r2, =0x000031cc - adds r1, r2 - strb r0, [r1] - b _08024FEE - .pool -_08024FD4: - movs r0, 0 - bl sub_8027518 - ldr r1, [r4] - ldr r3, =0x000031cc - adds r1, r3 - strb r0, [r1] - b _08024FEE - .pool -_08024FE8: - movs r0, 0xB - bl sub_8026240 -_08024FEE: - bl sub_802671C - bl sub_8025F48 -_08024FF6: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8024F38 - - thumb_func_start sub_8024FFC -sub_8024FFC: @ 8024FFC - push {lr} - ldr r0, =0x02022c98 - ldr r2, [r0] - adds r0, r2, 0 - adds r0, 0x40 - ldrb r0, [r0] - cmp r0, 0x9 - bhi _080250C4 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0802504C - adds r0, r2, 0 - adds r0, 0x28 - ldrb r1, [r0] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 2 - adds r0, r2, r0 - ldr r1, =0x000031cc - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080250CA - ldr r3, =0x000032f8 - adds r1, r2, r3 - movs r0, 0x2 - strb r0, [r1] - b _080250CA - .pool -_0802504C: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08025080 - adds r0, r2, 0 - adds r0, 0x28 - ldrb r1, [r0] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 2 - adds r0, r2, r0 - ldr r1, =0x000031cc - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080250CA - ldr r3, =0x000032f8 - adds r1, r2, r3 - movs r0, 0x1 - strb r0, [r1] - b _080250CA - .pool -_08025080: - movs r0, 0x20 - ands r0, r1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _080250B8 - adds r0, r2, 0 - adds r0, 0x28 - ldrb r1, [r0] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 2 - adds r0, r2, r0 - ldr r1, =0x000031cc - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080250CA - ldr r3, =0x000032f8 - adds r1, r2, r3 - movs r0, 0x3 - strb r0, [r1] - b _080250CA - .pool -_080250B8: - ldr r3, =0x000032f8 - adds r0, r2, r3 - strb r1, [r0] - b _080250CA - .pool -_080250C4: - movs r0, 0xB - bl sub_8026240 -_080250CA: - bl sub_8026044 - pop {r0} - bx r0 - thumb_func_end sub_8024FFC - - thumb_func_start sub_80250D4 -sub_80250D4: @ 80250D4 - push {r4,r5,lr} - bl sub_802671C - bl sub_8025F48 - bl sub_8026C50 - cmp r0, 0x1 - bne _080250F2 - bl sub_80272A4 - movs r0, 0x5 - bl sub_8026240 - b _08025150 -_080250F2: - ldr r0, =0x02022c98 - ldr r2, [r0] - movs r1, 0x96 - lsls r1, 1 - adds r4, r2, r1 - movs r1, 0x1 - str r1, [r4] - movs r3, 0x1 - adds r1, r2, 0 - adds r1, 0x24 - adds r5, r0, 0 - ldrb r1, [r1] - cmp r3, r1 - bcs _08025150 - movs r1, 0x9A - lsls r1, 1 - adds r0, r2, r1 - ldr r0, [r0] - cmp r0, 0x1 - beq _08025124 - movs r0, 0 - str r0, [r4] - b _08025150 - .pool -_08025124: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, [r5] - adds r0, r2, 0 - adds r0, 0x24 - ldrb r0, [r0] - cmp r3, r0 - bcs _08025150 - lsls r0, r3, 2 - movs r4, 0x98 - lsls r4, 1 - adds r1, r2, r4 - adds r1, r0 - ldr r0, [r1] - cmp r0, 0x1 - beq _08025124 - movs r0, 0x96 - lsls r0, 1 - adds r1, r2, r0 - movs r0, 0 - str r0, [r1] -_08025150: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80250D4 - - thumb_func_start sub_8025158 -sub_8025158: @ 8025158 - push {lr} - bl sub_8026044 - bl sub_8026C90 - cmp r0, 0x1 - bne _0802516C - movs r0, 0x5 - bl sub_8026240 -_0802516C: - pop {r0} - bx r0 - thumb_func_end sub_8025158 - - thumb_func_start sub_8025170 -sub_8025170: @ 8025170 - push {r4,lr} - bl sub_800A550 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_800A9D8 - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - beq _0802518C - movs r0, 0 - b _08025192 -_0802518C: - bl sub_800A5B4 - movs r0, 0x1 -_08025192: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8025170 - - thumb_func_start sub_8025198 -sub_8025198: @ 8025198 - push {r4,r5,lr} - ldr r5, =0x02022c98 - ldr r1, [r5] - ldrb r4, [r1, 0x10] - cmp r4, 0x1 - beq _080251D0 - cmp r4, 0x1 - bgt _080251B4 - cmp r4, 0 - beq _080251BA - b _0802520C - .pool -_080251B4: - cmp r4, 0x2 - beq _080251DC - b _0802520C -_080251BA: - adds r1, 0x4A - movs r0, 0 - movs r2, 0x3C - bl link_0800A448 - lsls r0, 24 - cmp r0, 0 - beq _08025226 - ldr r0, [r5] - strb r4, [r0, 0x8] - b _08025202 -_080251D0: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08025226 - b _08025202 -_080251DC: - bl sub_8025170 - cmp r0, 0 - beq _080251EE - ldr r0, [r5] - adds r1, r0, 0 - adds r1, 0x24 - ldrb r1, [r1] - strb r1, [r0, 0x8] -_080251EE: - ldr r2, [r5] - adds r1, r2, 0 - adds r1, 0x24 - ldrb r0, [r2, 0x8] - ldrb r1, [r1] - cmp r0, r1 - bcc _08025226 - ldrb r0, [r2, 0x14] - adds r0, 0x1 - strb r0, [r2, 0x14] -_08025202: - ldr r1, [r5] - ldrb r0, [r1, 0x10] - adds r0, 0x1 - strb r0, [r1, 0x10] - b _08025226 -_0802520C: - movs r0, 0x1 - bl ducking_tick - lsls r0, 24 - cmp r0, 0 - beq _08025226 - movs r0, 0x6 - bl sub_8026240 - ldr r0, =0x0000020b - movs r1, 0x4 - bl sub_80A2F88 -_08025226: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8025198 - - thumb_func_start sub_8025230 -sub_8025230: @ 8025230 - push {r4,r5,lr} - ldr r5, =0x02022c98 - ldr r2, [r5] - ldrb r4, [r2, 0x10] - cmp r4, 0x1 - beq _08025274 - cmp r4, 0x1 - bgt _0802524C - cmp r4, 0 - beq _08025252 - b _080252DC - .pool -_0802524C: - cmp r4, 0x2 - beq _08025282 - b _080252DC -_08025252: - ldrb r0, [r2, 0x14] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, 0x4A - adds r1, r2, r1 - movs r0, 0 - movs r2, 0x3C - bl link_0800A448 - lsls r0, 24 - cmp r0, 0 - beq _08025316 - ldr r0, [r5] - strb r4, [r0, 0x8] - ldr r1, [r5] - b _080252CC -_08025274: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08025316 - ldr r1, [r5] - b _080252CC -_08025282: - bl sub_8025170 - cmp r0, 0 - beq _080252B4 - movs r4, 0 - b _080252AA -_0802528E: - ldr r0, [r5] - adds r0, 0x4A - ldr r1, =0x020223c4 - movs r2, 0x3C - bl memcpy - ldr r1, [r5] - adds r0, r1, 0 - adds r0, 0x24 - ldrb r0, [r0] - strb r0, [r1, 0x8] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_080252AA: - ldr r0, [r5] - adds r0, 0x24 - ldrb r0, [r0] - cmp r4, r0 - bcc _0802528E -_080252B4: - ldr r3, =0x02022c98 - ldr r2, [r3] - adds r1, r2, 0 - adds r1, 0x24 - ldrb r0, [r2, 0x8] - ldrb r1, [r1] - cmp r0, r1 - bcc _08025316 - ldrb r0, [r2, 0x14] - adds r0, 0x1 - strb r0, [r2, 0x14] - ldr r1, [r3] -_080252CC: - ldrb r0, [r1, 0x10] - adds r0, 0x1 - strb r0, [r1, 0x10] - b _08025316 - .pool -_080252DC: - movs r0, 0x1 - bl ducking_tick - lsls r0, 24 - cmp r0, 0 - beq _08025316 - ldr r0, =0x02022c98 - ldr r2, [r0] - adds r0, r2, 0 - adds r0, 0x28 - ldrb r0, [r0] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r0, r2, 0 - adds r0, 0x54 - adds r0, r1 - ldrh r1, [r0] - movs r3, 0x8A - lsls r3, 1 - adds r0, r2, r3 - strh r1, [r0] - movs r0, 0x6 - bl sub_8026240 - ldr r0, =0x0000020b - movs r1, 0x4 - bl sub_80A2F88 -_08025316: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8025230 - - thumb_func_start sub_8025324 -sub_8025324: @ 8025324 - push {r4,r5,lr} - sub sp, 0x4 - movs r1, 0x1 - mov r0, sp - strb r1, [r0] - ldr r0, =0x02022c98 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0x4 - bls _0802533A - b _08025458 -_0802533A: - lsls r0, 2 - ldr r1, =_0802534C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0802534C: - .4byte _08025360 - .4byte _08025384 - .4byte _0802539C - .4byte _080253BC - .4byte _080253DC -_08025360: - bl sub_802749C - movs r0, 0x1 - bl sub_80289E8 - bl sub_8028DFC - movs r0, 0x1 - bl sub_8028EC8 - movs r0, 0x2 - bl sub_80292E0 - ldr r0, =0x02022c98 - ldr r1, [r0] - b _08025448 - .pool -_08025384: - bl sub_802A770 - cmp r0, 0 - bne _08025466 - movs r0, 0x5 - bl sub_80292E0 - ldr r0, =0x02022c98 - ldr r1, [r0] - b _08025448 - .pool -_0802539C: - bl sub_802A794 - mov r1, sp - strb r0, [r1] - movs r0, 0 - movs r2, 0x1 - bl link_0800A448 - lsls r0, 24 - cmp r0, 0 - beq _08025466 - ldr r0, =0x02022c98 - ldr r1, [r0] - b _08025448 - .pool -_080253BC: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08025466 - ldr r3, =0x02022c98 - ldr r1, [r3] - ldrb r0, [r1, 0x10] - adds r0, 0x1 - movs r2, 0 - strb r0, [r1, 0x10] - ldr r0, [r3] - strb r2, [r0, 0x8] - b _08025466 - .pool -_080253DC: - bl sub_8025170 - cmp r0, 0 - beq _08025422 - movs r2, 0 - ldr r1, =0x02022c98 - ldr r0, [r1] - adds r0, 0x24 - ldrb r0, [r0] - cmp r2, r0 - bcs _08025422 - adds r3, r1, 0 - movs r5, 0x86 - lsls r5, 1 - ldr r4, =0x020223c4 -_080253FA: - ldr r1, [r3] - adds r1, r2, r1 - adds r1, r5 - lsls r0, r2, 8 - adds r0, r4 - ldrb r0, [r0] - strb r0, [r1] - ldr r1, [r3] - adds r0, r1, 0 - adds r0, 0x24 - ldrb r0, [r0] - strb r0, [r1, 0x8] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, [r3] - adds r0, 0x24 - ldrb r0, [r0] - cmp r2, r0 - bcc _080253FA -_08025422: - ldr r4, =0x02022c98 - ldr r2, [r4] - adds r1, r2, 0 - adds r1, 0x24 - ldrb r0, [r2, 0x8] - ldrb r1, [r1] - cmp r0, r1 - bcc _08025466 - ldrb r0, [r2, 0x14] - adds r0, 0x1 - strb r0, [r2, 0x14] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x77 - bls _08025466 - movs r0, 0x6 - bl sub_80292E0 - ldr r1, [r4] -_08025448: - ldrb r0, [r1, 0x10] - adds r0, 0x1 - strb r0, [r1, 0x10] - b _08025466 - .pool -_08025458: - bl sub_802A770 - cmp r0, 0 - bne _08025466 - movs r0, 0x7 - bl sub_8026240 -_08025466: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8025324 - - thumb_func_start sub_8025470 -sub_8025470: @ 8025470 - push {r4,r5,lr} - sub sp, 0x4 - ldr r4, =0x02022c98 - ldr r0, [r4] - ldrb r0, [r0, 0x10] - cmp r0, 0x7 - bls _08025480 - b _08025606 -_08025480: - lsls r0, 2 - ldr r1, =_08025494 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08025494: - .4byte _080254B4 - .4byte _080254D4 - .4byte _080254F0 - .4byte _08025504 - .4byte _08025520 - .4byte _0802553C - .4byte _08025564 - .4byte _08025578 -_080254B4: - bl sub_8027748 - ldr r1, =0x00000bb7 - cmp r0, r1 - bls _080254C4 - movs r0, 0x4 - bl sub_80292E0 -_080254C4: - ldr r0, =0x02022c98 - ldr r1, [r0] - b _080255E8 - .pool -_080254D4: - bl sub_802A770 - cmp r0, 0 - beq _080254DE - b _0802563C -_080254DE: - movs r0, 0x3 - bl sub_80292E0 - ldr r0, =0x02022c98 - ldr r1, [r0] - b _080255E8 - .pool -_080254F0: - bl sub_8028FCC - bl sub_80272E8 - ldr r0, =0x02022c98 - ldr r1, [r0] - b _080255E8 - .pool -_08025504: - bl sub_802A794 - lsls r0, 24 - lsrs r0, 24 - mov r1, sp - strb r0, [r1] - cmp r0, 0 - bne _08025516 - b _0802563C -_08025516: - ldr r0, =0x02022c98 - ldr r1, [r0] - b _080255E8 - .pool -_08025520: - bl sub_802A770 - cmp r0, 0 - beq _0802552A - b _0802563C -_0802552A: - movs r0, 0x5 - bl sub_80292E0 - ldr r0, =0x02022c98 - ldr r1, [r0] - b _080255E8 - .pool -_0802553C: - bl sub_802A794 - mov r1, sp - strb r0, [r1] - movs r0, 0 - movs r2, 0x1 - bl link_0800A448 - lsls r0, 24 - cmp r0, 0 - beq _0802563C - ldr r2, =0x02022c98 - ldr r1, [r2] - movs r0, 0 - strb r0, [r1, 0x8] - ldr r1, [r2] - b _080255E8 - .pool -_08025564: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _0802563C - ldr r0, =0x02022c98 - ldr r1, [r0] - b _080255E8 - .pool -_08025578: - bl sub_8025170 - cmp r0, 0 - beq _080255BE - movs r2, 0 - ldr r1, =0x02022c98 - ldr r0, [r1] - adds r0, 0x24 - ldrb r0, [r0] - cmp r2, r0 - bcs _080255BE - adds r3, r1, 0 - movs r5, 0x86 - lsls r5, 1 - ldr r4, =0x020223c4 -_08025596: - ldr r1, [r3] - adds r1, r2, r1 - adds r1, r5 - lsls r0, r2, 8 - adds r0, r4 - ldrb r0, [r0] - strb r0, [r1] - ldr r1, [r3] - adds r0, r1, 0 - adds r0, 0x24 - ldrb r0, [r0] - strb r0, [r1, 0x8] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, [r3] - adds r0, 0x24 - ldrb r0, [r0] - cmp r2, r0 - bcc _08025596 -_080255BE: - ldr r4, =0x02022c98 - ldr r2, [r4] - adds r1, r2, 0 - adds r1, 0x24 - ldrb r0, [r2, 0x8] - ldrb r1, [r1] - cmp r0, r1 - bcc _080255F8 - ldrb r0, [r2, 0x14] - adds r0, 0x1 - strb r0, [r2, 0x14] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x77 - bls _0802563C - bl sub_8027608 - movs r0, 0x6 - bl sub_80292E0 - ldr r1, [r4] -_080255E8: - ldrb r0, [r1, 0x10] - adds r0, 0x1 - strb r0, [r1, 0x10] - b _0802563C - .pool -_080255F8: - bl sub_8027554 - b _0802563C -_080255FE: - movs r0, 0x8 - bl sub_8026240 - b _0802563C -_08025606: - bl sub_802A770 - cmp r0, 0 - bne _0802563C - movs r2, 0 - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x24 - ldrb r0, [r0] - cmp r2, r0 - bcs _08025636 - movs r4, 0x86 - lsls r4, 1 - adds r3, r1, r4 - adds r1, r0, 0 -_08025624: - adds r0, r3, r2 - ldrb r0, [r0] - cmp r0, 0x2 - beq _080255FE - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, r1 - bcc _08025624 -_08025636: - movs r0, 0xA - bl sub_8026240 -_0802563C: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8025470 - - thumb_func_start sub_8025644 -sub_8025644: @ 8025644 - push {r4,lr} - ldr r4, =0x02022c98 - ldr r0, [r4] - ldrb r0, [r0, 0x10] - cmp r0, 0x1 - beq _08025672 - cmp r0, 0x1 - bgt _08025660 - cmp r0, 0 - beq _08025666 - b _08025692 - .pool -_08025660: - cmp r0, 0x2 - beq _0802567C - b _08025692 -_08025666: - bl sub_800AC34 - movs r0, 0x7 - bl sub_80292E0 - b _08025688 -_08025672: - bl sub_802A770 - cmp r0, 0 - bne _080256A0 - b _08025688 -_0802567C: - bl sub_802A794 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - bne _080256A0 -_08025688: - ldr r1, [r4] - ldrb r0, [r1, 0x10] - adds r0, 0x1 - strb r0, [r1, 0x10] - b _080256A0 -_08025692: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _080256A0 - movs r0, 0x9 - bl sub_8026240 -_080256A0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8025644 - - thumb_func_start sub_80256AC -sub_80256AC: @ 80256AC - push {r4,lr} - sub sp, 0x4 - ldr r4, =0x02022c98 - ldr r0, [r4] - ldrb r1, [r0, 0x10] - cmp r1, 0x1 - beq _080256E0 - cmp r1, 0x1 - bgt _080256C8 - cmp r1, 0 - beq _080256CE - b _08025728 - .pool -_080256C8: - cmp r1, 0x2 - beq _080256F8 - b _08025728 -_080256CE: - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - b _0802571A -_080256E0: - bl fade_and_return_progress_probably - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0802574C - b _0802571A - .pool -_080256F8: - bl sub_8028B80 - bl sub_80287E4 - ldr r0, [r4] - adds r0, 0x24 - ldrb r0, [r0] - bl sub_8028614 - bl sub_8028E84 - ldr r1, =0x03000db0 - movs r0, 0x1 - str r0, [r1] - movs r0, 0x8 - bl sub_80292E0 -_0802571A: - ldr r1, [r4] - ldrb r0, [r1, 0x10] - adds r0, 0x1 - strb r0, [r1, 0x10] - b _0802574C - .pool -_08025728: - bl sub_802A770 - cmp r0, 0 - bne _0802574C - ldr r4, =0x02022c98 - ldr r0, [r4] - ldr r0, [r0] - bl SetMainCallback2 - ldr r0, [r4] - ldrb r0, [r0, 0x4] - bl remove_task - ldr r0, [r4] - bl Free - bl FreeAllWindowBuffers -_0802574C: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80256AC - - thumb_func_start sub_8025758 -sub_8025758: @ 8025758 - push {r4,lr} - sub sp, 0x4 - ldr r4, =0x02022c98 - ldr r1, [r4] - ldrb r0, [r1, 0x10] - cmp r0, 0x6 - bls _08025768 - b _0802585C -_08025768: - lsls r0, 2 - ldr r1, =_0802577C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0802577C: - .4byte _08025798 - .4byte _08025838 - .4byte _080257B0 - .4byte _08025802 - .4byte _08025808 - .4byte _08025818 - .4byte _08025838 -_08025798: - movs r0, 0x9 - bl sub_80292E0 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - b _08025848 -_080257B0: - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - b _08025848 -_08025802: - bl sub_80A2F30 - b _08025848 -_08025808: - ldr r0, =0x0000021e - bl current_map_music_set - bl sub_8028E4C - b _08025848 - .pool -_08025818: - movs r4, 0x1 - negs r4, r4 - adds r0, r4, 0 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - b _08025848 -_08025838: - bl fade_and_return_progress_probably - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0802588C -_08025848: - ldr r0, =0x02022c98 - ldr r1, [r0] - ldrb r0, [r1, 0x10] - adds r0, 0x1 - strb r0, [r1, 0x10] - b _0802588C - .pool -_0802585C: - ldrb r0, [r1, 0x4] - bl remove_task - ldr r0, =sub_802589C - bl sub_802621C - bl sub_802903C - ldr r0, [r4] - bl sub_8024A30 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _08025882 - ldr r0, [r4] - adds r0, 0x24 - movs r1, 0x1 - strb r1, [r0] -_08025882: - bl sub_80273F0 - movs r0, 0 - bl sub_8028EC8 -_0802588C: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8025758 - - thumb_func_start sub_802589C -sub_802589C: @ 802589C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x02022c98 - ldr r0, [r1] - ldrb r0, [r0, 0x10] - adds r4, r1, 0 - cmp r0, 0x1 - beq _080258C8 - cmp r0, 0x1 - bgt _080258BC - cmp r0, 0 - beq _080258C2 - b _080258E0 - .pool -_080258BC: - cmp r0, 0x2 - beq _080258CE - b _080258E0 -_080258C2: - bl sub_8026264 - b _080258D2 -_080258C8: - bl sub_80286E4 - b _080258D6 -_080258CE: - bl sub_8028828 -_080258D2: - cmp r0, 0x1 - bne _08025904 -_080258D6: - ldr r1, [r4] - ldrb r0, [r1, 0x10] - adds r0, 0x1 - strb r0, [r1, 0x10] - b _08025904 -_080258E0: - ldr r0, [r4] - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0 - beq _080258F8 - ldr r0, =sub_8024D4C - bl sub_802621C - b _080258FE - .pool -_080258F8: - ldr r0, =sub_8024D84 - bl sub_802621C -_080258FE: - adds r0, r5, 0 - bl remove_task -_08025904: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802589C - - thumb_func_start sub_8025910 -sub_8025910: @ 8025910 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r5, r0, r1 - movs r0, 0 - ldrsh r4, [r5, r0] - cmp r4, 0x1 - beq _0802596C - cmp r4, 0x1 - bgt _08025938 - cmp r4, 0 - beq _0802593E - b _080259E8 - .pool -_08025938: - cmp r4, 0x2 - beq _0802597E - b _080259E8 -_0802593E: - ldr r6, =0x02022c98 - ldr r1, [r6] - adds r0, r1, 0 - adds r0, 0x28 - ldrb r0, [r0] - lsls r0, 2 - ldr r2, =0x0000318c - adds r0, r2 - adds r1, r0 - movs r0, 0 - movs r2, 0x1 - bl link_0800A448 - lsls r0, 24 - cmp r0, 0 - beq _080259E8 - ldr r0, [r6] - strb r4, [r0, 0x8] - b _08025976 - .pool -_0802596C: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080259E8 -_08025976: - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - b _080259E8 -_0802597E: - bl sub_8025170 - cmp r0, 0 - beq _080259C4 - movs r2, 0 - ldr r1, =0x02022c98 - ldr r0, [r1] - adds r0, 0x24 - ldrb r0, [r0] - cmp r2, r0 - bcs _080259C4 - adds r3, r1, 0 - ldr r5, =0x020223c4 - ldr r4, =0x0000318c -_0802599A: - ldr r0, [r3] - lsls r1, r2, 2 - adds r1, r0 - adds r1, r4 - lsls r0, r2, 8 - adds r0, r5 - ldrb r0, [r0] - strb r0, [r1] - ldr r1, [r3] - adds r0, r1, 0 - adds r0, 0x24 - ldrb r0, [r0] - strb r0, [r1, 0x8] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, [r3] - adds r0, 0x24 - ldrb r0, [r0] - cmp r2, r0 - bcc _0802599A -_080259C4: - ldr r4, =0x02022c98 - ldr r0, [r4] - adds r1, r0, 0 - adds r1, 0x24 - ldrb r0, [r0, 0x8] - ldrb r1, [r1] - cmp r0, r1 - bcc _080259E8 - adds r0, r6, 0 - bl remove_task - movs r0, 0x6 - bl sub_80292E0 - ldr r1, [r4] - ldrb r0, [r1, 0x10] - adds r0, 0x1 - strb r0, [r1, 0x10] -_080259E8: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8025910 - - thumb_func_start sub_80259FC -sub_80259FC: @ 80259FC - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x18 - ldr r6, =0x02022c98 - ldr r0, [r6] - adds r1, r0, 0 - adds r1, 0x24 - ldrb r7, [r1] - ldr r2, =0x000031a0 - adds r1, r0, r2 - ldr r3, =0x000031cc - adds r2, r0, r3 - ldr r4, =0x00003208 - adds r3, r0, r4 - ldr r5, =0x00003244 - adds r4, r0, r5 - str r4, [sp] - adds r5, 0x3C - adds r4, r0, r5 - str r4, [sp, 0x4] - adds r5, 0x3C - adds r4, r0, r5 - str r4, [sp, 0x8] - adds r4, r0, 0 - adds r4, 0x40 - str r4, [sp, 0xC] - movs r5, 0x90 - lsls r5, 1 - adds r4, r0, r5 - str r4, [sp, 0x10] - movs r4, 0x96 - lsls r4, 1 - adds r0, r4 - str r0, [sp, 0x14] - movs r0, 0 - bl sub_8028164 - ldr r1, [r6] - ldr r5, =0x000031b0 - adds r2, r1, r5 - str r0, [r2] - movs r0, 0x94 - lsls r0, 1 - adds r1, r0 - movs r0, 0x1 - strb r0, [r1] - movs r5, 0x1 - cmp r5, r7 - bcs _08025AA4 -_08025A60: - ldr r1, [r6] - adds r0, r1, 0 - adds r0, 0xA8 - adds r0, r5 - ldrb r0, [r0] - cmp r0, 0 - bne _08025A9A - lsls r0, r5, 4 - subs r0, r5 - lsls r4, r0, 2 - adds r1, r4, r1 - ldr r2, =0x000031cc - adds r1, r2 - adds r0, r5, 0 - bl sub_8028318 - adds r1, r0, 0 - cmp r1, 0 - bne _08025A9A - ldr r0, [r6] - adds r0, r4 - ldr r3, =0x000031cc - adds r0, r3 - strb r1, [r0] - ldr r0, [r6] - movs r4, 0x94 - lsls r4, 1 - adds r0, r4 - strb r1, [r0] -_08025A9A: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r7 - bcc _08025A60 -_08025AA4: - ldr r5, =0x02022c98 - ldr r1, [r5] - movs r6, 0x92 - lsls r6, 1 - adds r1, r6 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3B - bls _08025B02 - ldr r1, [r5] - movs r2, 0x94 - lsls r2, 1 - adds r0, r1, r2 - ldrb r4, [r0] - cmp r4, 0 - beq _08025AF0 - bl sub_8011AC8 - ldr r0, [r5] - adds r0, r6 - movs r1, 0 - strb r1, [r0] - b _08025B02 - .pool -_08025AF0: - adds r0, r1, r6 - ldrb r0, [r0] - cmp r0, 0x46 - bls _08025B02 - bl sub_8011AC8 - ldr r0, [r5] - adds r0, r6 - strb r4, [r0] -_08025B02: - movs r5, 0 - cmp r5, r7 - bcs _08025BF6 - ldr r3, =0x000031cc - mov r12, r3 - ldr r4, =0x02022c98 - mov r8, r4 -_08025B10: - mov r6, r8 - ldr r2, [r6] - lsls r0, r5, 4 - subs r1, r0, r5 - lsls r1, 2 - adds r1, r2, r1 - add r1, r12 - ldrb r1, [r1] - adds r6, r0, 0 - cmp r1, 0 - beq _08025B36 - adds r0, r2, 0 - adds r0, 0xA8 - adds r1, r0, r5 - ldrb r0, [r1] - cmp r0, 0 - bne _08025B36 - movs r0, 0x1 - strb r0, [r1] -_08025B36: - adds r3, r4, 0 - ldr r1, [r3] - adds r0, r1, 0 - adds r0, 0xA8 - adds r0, r5 - ldrb r0, [r0] - cmp r0, 0x3 - bgt _08025B54 - cmp r0, 0x1 - bge _08025B5A - b _08025BEC - .pool -_08025B54: - cmp r0, 0x4 - beq _08025BA8 - b _08025BEC -_08025B5A: - adds r1, 0xB0 - adds r1, r5 - ldrb r0, [r1] - adds r0, 0x1 - movs r2, 0 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - bls _08025BEC - ldr r0, [r3] - adds r0, 0xB0 - adds r0, r5 - strb r2, [r0] - ldr r0, [r3] - adds r0, 0xA8 - adds r0, r5 - strb r2, [r0] - ldr r0, [r3] - subs r1, r6, r5 - lsls r1, 2 - adds r0, r1 - add r0, r12 - strb r2, [r0] - ldr r0, [r3] - adds r0, r1 - ldr r6, =0x000031d0 - adds r0, r6 - strb r2, [r0] - ldr r0, [r3] - adds r0, r1 - ldr r1, =0x000031d4 - adds r0, r1 - b _08025BEA - .pool -_08025BA8: - adds r1, 0xB0 - adds r1, r5 - ldrb r0, [r1] - adds r0, 0x1 - movs r2, 0 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x27 - bls _08025BEC - ldr r0, [r4] - adds r0, 0xB0 - adds r0, r5 - strb r2, [r0] - ldr r0, [r4] - adds r0, 0xA8 - adds r0, r5 - strb r2, [r0] - ldr r0, [r4] - subs r1, r6, r5 - lsls r1, 2 - adds r0, r1 - add r0, r12 - strb r2, [r0] - ldr r0, [r4] - adds r0, r1 - ldr r3, =0x000031d0 - adds r0, r3 - strb r2, [r0] - ldr r0, [r4] - adds r0, r1 - ldr r6, =0x000031d4 - adds r0, r6 -_08025BEA: - strb r2, [r0] -_08025BEC: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r7 - bcc _08025B10 -_08025BF6: - add sp, 0x18 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80259FC - - thumb_func_start sub_8025C0C -sub_8025C0C: @ 8025C0C - push {r4-r7,lr} - sub sp, 0x18 - ldr r5, =0x02022c98 - ldr r0, [r5] - adds r1, r0, 0 - adds r1, 0x24 - ldrb r6, [r1] - ldr r2, =0x000031a0 - adds r1, r0, r2 - ldr r3, =0x000031cc - adds r2, r0, r3 - ldr r4, =0x00003208 - adds r3, r0, r4 - ldr r7, =0x00003244 - adds r4, r0, r7 - str r4, [sp] - adds r7, 0x3C - adds r4, r0, r7 - str r4, [sp, 0x4] - adds r7, 0x3C - adds r4, r0, r7 - str r4, [sp, 0x8] - adds r4, r0, 0 - adds r4, 0x40 - str r4, [sp, 0xC] - movs r7, 0x90 - lsls r7, 1 - adds r4, r0, r7 - str r4, [sp, 0x10] - movs r4, 0x96 - lsls r4, 1 - adds r0, r4 - str r0, [sp, 0x14] - movs r0, 0 - bl sub_8028164 - ldr r1, [r5] - ldr r7, =0x000031b0 - adds r2, r1, r7 - str r0, [r2] - movs r0, 0x94 - lsls r0, 1 - adds r1, r0 - movs r0, 0x1 - strb r0, [r1] - movs r4, 0x1 - cmp r4, r6 - bcs _08025C9C -_08025C6C: - adds r0, r4, 0 - bl sub_8028374 - cmp r0, 0 - beq _08025C92 - ldr r0, =0x02022c98 - ldr r2, [r0] - lsls r1, r4, 2 - movs r3, 0x98 - lsls r3, 1 - adds r0, r2, r3 - adds r0, r1 - movs r1, 0x1 - str r1, [r0] - movs r7, 0x94 - lsls r7, 1 - adds r1, r2, r7 - movs r0, 0 - strb r0, [r1] -_08025C92: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r6 - bcc _08025C6C -_08025C9C: - ldr r5, =0x02022c98 - ldr r1, [r5] - movs r6, 0x92 - lsls r6, 1 - adds r1, r6 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3B - bls _08025CFA - ldr r1, [r5] - movs r2, 0x94 - lsls r2, 1 - adds r0, r1, r2 - ldrb r4, [r0] - cmp r4, 0 - beq _08025CE8 - bl sub_8011AC8 - ldr r0, [r5] - adds r0, r6 - movs r1, 0 - strb r1, [r0] - b _08025CFA - .pool -_08025CE8: - adds r0, r1, r6 - ldrb r0, [r0] - cmp r0, 0x46 - bls _08025CFA - bl sub_8011AC8 - ldr r0, [r5] - adds r0, r6 - strb r4, [r0] -_08025CFA: - add sp, 0x18 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8025C0C - - thumb_func_start sub_8025D04 -sub_8025D04: @ 8025D04 - push {r4,r5,lr} - ldr r5, =0x02022c98 - ldr r0, [r5] - ldrb r0, [r0, 0x18] - cmp r0, 0x4 - beq _08025D40 - cmp r0, 0x4 - bgt _08025D20 - cmp r0, 0x3 - beq _08025D26 - b _08025D4A - .pool -_08025D20: - cmp r0, 0xB - beq _08025D46 - b _08025D4A -_08025D26: - bl sub_8026BB8 - adds r4, r0, 0 - cmp r4, 0x1 - bne _08025D4A - bl sub_8026C28 - ldr r0, [r5] - movs r1, 0x8E - lsls r1, 1 - adds r0, r1 - str r4, [r0] - b _08025D4A -_08025D40: - bl sub_80259FC - b _08025D4A -_08025D46: - bl sub_8025C0C -_08025D4A: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8025D04 - - thumb_func_start sub_8025D50 -sub_8025D50: @ 8025D50 - push {r4-r6,lr} - sub sp, 0x14 - ldr r0, =0x02022c98 - ldr r5, [r0] - ldrb r0, [r5, 0x18] - cmp r0, 0x4 - beq _08025D68 - cmp r0, 0xB - beq _08025DB8 - b _08025DF4 - .pool -_08025D68: - ldr r1, =0x000032cc - adds r0, r5, r1 - ldr r2, =0x000031cc - adds r1, r5, r2 - ldr r3, =0x00003208 - adds r2, r5, r3 - ldr r4, =0x00003244 - adds r3, r5, r4 - movs r6, 0xCA - lsls r6, 6 - adds r4, r5, r6 - str r4, [sp] - adds r6, 0x3C - adds r4, r5, r6 - str r4, [sp, 0x4] - adds r4, r5, 0 - adds r4, 0x40 - ldrb r4, [r4] - str r4, [sp, 0x8] - movs r6, 0x90 - lsls r6, 1 - adds r4, r5, r6 - ldr r4, [r4] - str r4, [sp, 0xC] - adds r6, 0xC - adds r4, r5, r6 - ldr r4, [r4] - str r4, [sp, 0x10] - bl sub_8027E30 - b _08025DF4 - .pool -_08025DB8: - ldr r1, =0x000032cc - adds r0, r5, r1 - ldr r2, =0x000031cc - adds r1, r5, r2 - ldr r3, =0x00003208 - adds r2, r5, r3 - ldr r4, =0x00003244 - adds r3, r5, r4 - movs r6, 0xCA - lsls r6, 6 - adds r4, r5, r6 - str r4, [sp] - adds r6, 0x3C - adds r4, r5, r6 - str r4, [sp, 0x4] - adds r4, r5, 0 - adds r4, 0x40 - ldrb r4, [r4] - str r4, [sp, 0x8] - movs r6, 0x90 - lsls r6, 1 - adds r4, r5, r6 - ldr r4, [r4] - str r4, [sp, 0xC] - adds r6, 0xC - adds r4, r5, r6 - ldr r4, [r4] - str r4, [sp, 0x10] - bl sub_8027E30 -_08025DF4: - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8025D50 - - thumb_func_start sub_8025E0C -sub_8025E0C: @ 8025E0C - push {r4-r6,lr} - sub sp, 0x18 - ldr r0, =0x02022c98 - ldr r5, [r0] - ldrb r0, [r5, 0x18] - cmp r0, 0x4 - beq _08025E24 - cmp r0, 0xB - beq _08025E7C - b _08025EC0 - .pool -_08025E24: - adds r0, r5, 0 - adds r0, 0x28 - ldrb r0, [r0] - lsls r1, r0, 4 - subs r1, r0 - lsls r1, 2 - ldr r2, =0x000031a0 - adds r1, r2 - adds r1, r5, r1 - ldr r3, =0x000031cc - adds r2, r5, r3 - ldr r4, =0x00003208 - adds r3, r5, r4 - ldr r6, =0x00003244 - adds r4, r5, r6 - str r4, [sp] - adds r6, 0x3C - adds r4, r5, r6 - str r4, [sp, 0x4] - adds r6, 0x3C - adds r4, r5, r6 - str r4, [sp, 0x8] - adds r4, r5, 0 - adds r4, 0x40 - str r4, [sp, 0xC] - movs r6, 0x90 - lsls r6, 1 - adds r4, r5, r6 - str r4, [sp, 0x10] - adds r6, 0xC - adds r4, r5, r6 - str r4, [sp, 0x14] - bl sub_8028164 - b _08025EC0 - .pool -_08025E7C: - adds r0, r5, 0 - adds r0, 0x28 - ldrb r0, [r0] - lsls r1, r0, 4 - subs r1, r0 - lsls r1, 2 - ldr r2, =0x000031a0 - adds r1, r2 - adds r1, r5, r1 - ldr r3, =0x000031cc - adds r2, r5, r3 - ldr r4, =0x00003208 - adds r3, r5, r4 - ldr r6, =0x00003244 - adds r4, r5, r6 - str r4, [sp] - adds r6, 0x3C - adds r4, r5, r6 - str r4, [sp, 0x4] - adds r6, 0x3C - adds r4, r5, r6 - str r4, [sp, 0x8] - adds r4, r5, 0 - adds r4, 0x40 - str r4, [sp, 0xC] - movs r6, 0x90 - lsls r6, 1 - adds r4, r5, r6 - str r4, [sp, 0x10] - adds r6, 0xC - adds r4, r5, r6 - str r4, [sp, 0x14] - bl sub_8028164 -_08025EC0: - add sp, 0x18 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8025E0C - - thumb_func_start sub_8025ED8 -sub_8025ED8: @ 8025ED8 - push {r4,lr} - ldr r4, =0x02022c98 - ldr r1, [r4] - ldrb r0, [r1, 0x18] - cmp r0, 0x4 - beq _08025F0E - cmp r0, 0x4 - bgt _08025EF4 - cmp r0, 0x3 - beq _08025EFA - b _08025F40 - .pool -_08025EF4: - cmp r0, 0xB - beq _08025F24 - b _08025F40 -_08025EFA: - movs r0, 0x1 - bl sub_8027DD0 - ldr r0, [r4] - movs r1, 0x8E - lsls r1, 1 - adds r0, r1 - movs r1, 0x1 - str r1, [r0] - b _08025F40 -_08025F0E: - ldr r2, =0x000032f8 - adds r1, r2 - ldrb r0, [r1] - cmp r0, 0 - beq _08025F40 - bl sub_80282EC - b _08025F40 - .pool -_08025F24: - movs r2, 0x90 - lsls r2, 1 - adds r0, r1, r2 - ldr r0, [r0] - cmp r0, 0 - bne _08025F40 - adds r2, 0xC - adds r0, r1, r2 - ldr r0, [r0] - cmp r0, 0 - bne _08025F40 - movs r0, 0x1 - bl sub_8028350 -_08025F40: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8025ED8 - - thumb_func_start sub_8025F48 -sub_8025F48: @ 8025F48 - push {r4-r6,lr} - ldr r6, =0x02022c98 - ldr r2, [r6] - adds r0, r2, 0 - adds r0, 0x28 - ldrb r1, [r0] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 2 - adds r1, r2, r0 - ldr r3, =0x000031cc - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, 0 - bne _08025F88 - bl mplay_has_finished_maybe - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _08025FEA - ldr r0, [r6] - movs r2, 0xA2 - lsls r2, 1 - adds r0, r2 - strb r1, [r0] - b _08025FEA - .pool -_08025F88: - ldr r3, =0x000031d0 - adds r0, r1, r3 - ldrb r4, [r0] - cmp r4, 0x1 - bne _08025FB8 - movs r1, 0xA2 - lsls r1, 1 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _08025FEA - movs r0, 0x1F - bl m4aSongNumStop - movs r0, 0x1F - bl audio_play - ldr r0, [r6] - movs r2, 0xA2 - lsls r2, 1 - adds r0, r2 - b _08025FE8 - .pool -_08025FB8: - ldr r3, =0x000031d4 - adds r0, r1, r3 - ldrb r4, [r0] - cmp r4, 0x1 - bne _08025FEA - movs r5, 0xA2 - lsls r5, 1 - adds r0, r2, r5 - ldrb r0, [r0] - cmp r0, 0 - bne _08025FEA - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - bne _08025FEA - movs r0, 0x16 - bl audio_play - movs r0, 0x1 - bl sub_80284CC - ldr r0, [r6] - adds r0, r5 -_08025FE8: - strb r4, [r0] -_08025FEA: - ldr r0, =0x02022c98 - ldr r2, [r0] - movs r5, 0xAA - lsls r5, 1 - adds r1, r2, r5 - ldrb r1, [r1] - adds r4, r0, 0 - cmp r1, 0 - bne _0802601C - adds r0, r2, 0 - adds r0, 0x40 - ldrb r0, [r0] - cmp r0, 0x9 - bls _0802601C - bl sub_80A2F30 - ldr r0, [r4] - adds r0, r5 - movs r1, 0x1 - b _0802603A - .pool -_0802601C: - ldr r0, [r4] - movs r1, 0xAA - lsls r1, 1 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _0802603C - movs r0, 0xB - bl pause_music_for_sound_maybe - ldr r0, [r4] - movs r2, 0xAA - lsls r2, 1 - adds r0, r2 - movs r1, 0x2 -_0802603A: - strb r1, [r0] -_0802603C: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8025F48 - - thumb_func_start sub_8026044 -sub_8026044: @ 8026044 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r6, =0x02022c98 - ldr r2, [r6] - adds r0, r2, 0 - adds r0, 0x44 - ldrb r0, [r0] - mov r8, r0 - adds r0, r2, 0 - adds r0, 0x48 - ldrb r7, [r0] - subs r0, 0x20 - ldrb r1, [r0] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 2 - adds r1, r2, r0 - ldr r3, =0x000031cc - adds r0, r1, r3 - ldrb r3, [r0] - cmp r3, 0 - bne _0802609C - ldr r4, =0x000031d0 - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, 0x1 - beq _080260FE - adds r4, 0x4 - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, 0x1 - beq _080260FE - movs r1, 0xA2 - lsls r1, 1 - adds r0, r2, r1 - strb r3, [r0] - b _080260FE - .pool -_0802609C: - ldr r3, =0x000031d0 - adds r0, r1, r3 - ldrb r4, [r0] - cmp r4, 0x1 - bne _080260CC - movs r1, 0xA2 - lsls r1, 1 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080260FE - movs r0, 0x1F - bl m4aSongNumStop - movs r0, 0x1F - bl audio_play - ldr r0, [r6] - movs r3, 0xA2 - lsls r3, 1 - adds r0, r3 - b _080260FC - .pool -_080260CC: - ldr r4, =0x000031d4 - adds r0, r1, r4 - ldrb r4, [r0] - cmp r4, 0x1 - bne _080260FE - movs r5, 0xA2 - lsls r5, 1 - adds r0, r2, r5 - ldrb r0, [r0] - cmp r0, 0 - bne _080260FE - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - bne _080260FE - movs r0, 0x16 - bl audio_play - movs r0, 0x1 - bl sub_80284CC - ldr r0, [r6] - adds r0, r5 -_080260FC: - strb r4, [r0] -_080260FE: - mov r4, r8 - cmp r4, r7 - bcs _08026172 - ldr r5, =0x02022c98 -_08026106: - ldr r2, [r5] - adds r0, r2, 0 - adds r0, 0x28 - ldrb r1, [r0] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 2 - ldr r1, =0x000031a0 - adds r0, r1 - adds r0, r2, r0 - adds r1, r0, 0 - adds r1, 0x14 - adds r0, 0x1F - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0x9 - bls _0802615C - movs r3, 0xA4 - lsls r3, 1 - adds r0, r2, r3 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - bne _08026168 - adds r0, r1, r4 - ldrb r0, [r0] - adds r0, 0x4A - bl audio_play - ldr r0, [r5] - movs r1, 0xA4 - lsls r1, 1 - adds r0, r1 - adds r0, r4 - movs r1, 0x1 - b _08026166 - .pool -_0802615C: - movs r3, 0xA4 - lsls r3, 1 - adds r0, r2, r3 - adds r0, r4 - movs r1, 0 -_08026166: - strb r1, [r0] -_08026168: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r7 - bcc _08026106 -_08026172: - ldr r0, =0x02022c98 - ldr r2, [r0] - movs r5, 0xAA - lsls r5, 1 - adds r1, r2, r5 - ldrb r1, [r1] - adds r4, r0, 0 - cmp r1, 0 - bne _080261A0 - adds r0, r2, 0 - adds r0, 0x40 - ldrb r0, [r0] - cmp r0, 0x9 - bls _080261A0 - bl sub_80A2F30 - ldr r0, [r4] - adds r0, r5 - movs r1, 0x1 - b _080261BE - .pool -_080261A0: - ldr r0, [r4] - movs r1, 0xAA - lsls r1, 1 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080261C0 - movs r0, 0xB - bl pause_music_for_sound_maybe - ldr r0, [r4] - movs r3, 0xAA - lsls r3, 1 - adds r0, r3 - movs r1, 0x2 -_080261BE: - strb r1, [r0] -_080261C0: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8026044 - - thumb_func_start sub_80261CC -sub_80261CC: @ 80261CC - push {lr} - bl RunActiveTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_80261CC - - thumb_func_start sub_80261E4 -sub_80261E4: @ 80261E4 - push {lr} - bl copy_pal_bg_faded_to_pal_ram - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - pop {r0} - bx r0 - thumb_func_end sub_80261E4 - - thumb_func_start sub_80261F8 -sub_80261F8: @ 80261F8 - push {r4,lr} - adds r4, r0, 0 - adds r0, r1, 0 - bl sub_806EBA4 - strb r0, [r4] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80261F8 - - thumb_func_start sub_802620C -sub_802620C: @ 802620C - push {lr} - lsls r1, 24 - lsrs r1, 24 - bl AddTask - pop {r0} - bx r0 - thumb_func_end sub_802620C - - thumb_func_start sub_802621C -sub_802621C: @ 802621C - push {lr} - movs r1, 0x1 - bl AddTask - ldr r1, =0x02022c98 - ldr r3, [r1] - movs r2, 0 - strb r0, [r3, 0x4] - ldr r0, [r1] - strb r2, [r0, 0x10] - ldr r0, [r1] - strb r2, [r0, 0xC] - ldr r0, [r1] - strb r2, [r0, 0x14] - pop {r0} - bx r0 - .pool - thumb_func_end sub_802621C - - thumb_func_start sub_8026240 -sub_8026240: @ 8026240 - push {r4,lr} - ldr r2, =0x02022c98 - ldr r1, [r2] - ldrb r3, [r1, 0x18] - movs r4, 0 - strb r3, [r1, 0x1C] - ldr r1, [r2] - strb r0, [r1, 0x18] - ldr r0, [r2] - strb r4, [r0, 0x10] - ldr r0, [r2] - strb r4, [r0, 0x14] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8026240 - - thumb_func_start sub_8026264 -sub_8026264: @ 8026264 - push {r4,lr} - ldr r3, =0x02022c98 - ldr r1, [r3] - ldrb r0, [r1, 0x14] - lsrs r2, r0, 2 - adds r0, 0x1 - strb r0, [r1, 0x14] - cmp r2, 0 - beq _080262B8 - ldr r3, [r3] - ldrb r0, [r3, 0x14] - movs r1, 0x3 - ands r0, r1 - cmp r0, 0 - bne _080262B8 - ldr r1, =gUnknown_082F7A94 - adds r0, r3, 0 - adds r0, 0x24 - ldrb r0, [r0] - subs r0, 0x1 - adds r0, r1 - ldrb r0, [r0] - cmp r2, r0 - bcc _080262A0 - movs r0, 0x1 - b _080262BA - .pool -_080262A0: - lsls r4, r2, 3 - adds r1, r4, 0 - movs r0, 0x14 - bl SetGpuReg - negs r4, r4 - lsls r4, 16 - lsrs r4, 16 - movs r0, 0x18 - adds r1, r4, 0 - bl SetGpuReg -_080262B8: - movs r0, 0 -_080262BA: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8026264 - - thumb_func_start sub_80262C0 -sub_80262C0: @ 80262C0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r2, =0x02022c98 - ldr r0, [r2] - adds r1, r0, 0 - adds r1, 0x44 - adds r0, 0x48 - ldrb r5, [r0] - ldrb r1, [r1] - cmp r1, r5 - bcs _0802630C - mov r8, r2 - ldr r0, =0x000032e0 - mov r12, r0 - movs r7, 0 - movs r6, 0x1 -_080262E2: - mov r2, r8 - ldr r0, [r2] - mov r2, r12 - adds r4, r0, r2 - ldr r2, =0x000032eb - adds r0, r2 - adds r2, r0, r1 - movs r3, 0 - adds r0, r1, 0 - ands r0, r6 - cmp r0, 0 - bne _080262FC - movs r3, 0x1 -_080262FC: - strb r3, [r2] - adds r0, r4, r1 - strb r7, [r0] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, r5 - bcc _080262E2 -_0802630C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80262C0 - - thumb_func_start sub_8026324 -sub_8026324: @ 8026324 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - ldr r0, =0x02022c98 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x44 - ldrb r0, [r0] - str r0, [sp] - adds r0, r1, 0 - adds r0, 0x48 - ldrb r0, [r0] - str r0, [sp, 0x4] - adds r0, r1, 0 - adds r0, 0x24 - ldrb r0, [r0] - str r0, [sp, 0x8] - adds r0, r1, 0 - adds r0, 0x40 - ldrb r0, [r0] - cmp r0, 0x9 - bls _08026358 - b _08026614 -_08026358: - movs r6, 0 - ldr r0, [sp, 0x8] - cmp r6, r0 - bcs _08026440 -_08026360: - ldr r3, =0x02022c98 - lsls r0, r6, 4 - subs r1, r0, r6 - lsls r1, 2 - ldr r2, [r3] - adds r1, r2 - ldr r4, =0x000031cc - adds r4, r1 - mov r8, r4 - ldrb r1, [r4] - mov r9, r0 - adds r0, r6, 0x1 - str r0, [sp, 0xC] - cmp r1, 0 - beq _08026434 - adds r0, r2, 0 - adds r0, 0xA8 - adds r0, r6 - ldrb r0, [r0] - cmp r0, 0x1 - bne _08026434 - ldr r1, [sp] - mov r10, r1 - ldr r2, [sp, 0x4] - cmp r10, r2 - bcs _08026434 - adds r7, r3, 0 -_08026396: - ldr r0, =gUnknown_082F449C - add r0, r10 - ldrb r5, [r0] - ldr r1, [r7] - lsls r4, r5, 1 - adds r0, r1, 0 - adds r0, 0xF4 - adds r0, r4 - ldrb r0, [r0] - cmp r0, r6 - beq _08026434 - adds r0, r1, 0 - adds r0, 0xF5 - adds r0, r4 - ldrb r0, [r0] - cmp r0, r6 - beq _08026434 - mov r0, r8 - ldrb r1, [r0] - adds r0, r6, 0 - adds r2, r5, 0 - bl sub_8026634 - cmp r0, 0x1 - bne _08026410 - movs r2, 0 - ldr r3, =0x02022c98 - mov r8, r4 -_080263CE: - ldr r0, [r3] - mov r4, r8 - adds r1, r2, r4 - adds r0, 0xF4 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0xFF - bne _08026404 - strb r6, [r1] - ldr r0, [r3] - adds r0, 0xA8 - adds r0, r6 - movs r1, 0x2 - strb r1, [r0] - ldr r0, [r3] - adds r0, 0xC4 - adds r0, r5 - movs r1, 0x1 - strb r1, [r0] - b _08026434 - .pool -_08026404: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x1 - bls _080263CE - b _08026434 -_08026410: - ldr r0, [r7] - mov r2, r9 - subs r1, r2, r6 - lsls r1, 2 - adds r0, r1 - ldr r4, =0x000031d4 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0x1 - beq _08026434 - mov r0, r10 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r0, [sp, 0x4] - cmp r10, r0 - bcc _08026396 -_08026434: - ldr r1, [sp, 0xC] - lsls r0, r1, 24 - lsrs r6, r0, 24 - ldr r2, [sp, 0x8] - cmp r6, r2 - bcc _08026360 -_08026440: - ldr r4, [sp] - mov r10, r4 - ldr r0, [sp, 0x4] - cmp r10, r0 - bcc _0802644C - b _08026614 -_0802644C: - ldr r1, =0x02022c98 - mov r9, r1 -_08026450: - movs r6, 0xFF - ldr r0, =gUnknown_082F449C - add r0, r10 - ldrb r5, [r0] - mov r2, r9 - ldr r0, [r2] - adds r0, 0xC4 - adds r0, r5 - ldrb r0, [r0] - cmp r0, 0x1 - beq _08026468 - b _08026602 -_08026468: - adds r0, r5, 0 - bl sub_8026D8C - mov r1, r9 - ldr r4, [r1] - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - adds r1, 0x90 - adds r1, r0 - ldrb r0, [r1] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x1 - bls _0802648E - movs r3, 0x2 -_0802648E: - ldr r2, =gUnknown_082F7A88 - ldr r0, =0x000031b4 - adds r1, r4, r0 - adds r1, r5 - lsls r0, r3, 1 - adds r0, r3 - ldrb r1, [r1] - adds r0, r1 - adds r0, r2 - ldrb r1, [r0] - adds r0, r4, 0 - adds r0, 0xD0 - adds r0, r5 - ldrb r0, [r0] - subs r2, r1, r0 - cmp r2, 0x5 - bgt _080264BC - adds r1, r4, 0 - adds r1, 0x9C - adds r1, r5 - ldrb r0, [r1] - adds r0, r2 - strb r0, [r1] -_080264BC: - mov r2, r9 - ldr r1, [r2] - adds r1, 0x9C - adds r1, r5 - ldrb r0, [r1] - adds r0, 0x1 - movs r2, 0 - strb r0, [r1] - movs r4, 0xFF - ands r0, r4 - cmp r0, 0x5 - bhi _080264D6 - b _08026602 -_080264D6: - mov r1, r9 - ldr r0, [r1] - adds r0, 0x9C - adds r0, r5 - strb r2, [r0] - ldr r3, [r1] - lsls r1, r5, 1 - adds r0, r3, 0 - adds r0, 0xF4 - adds r2, r0, r1 - ldrb r0, [r2] - mov r8, r1 - cmp r0, 0xFF - bne _08026518 - adds r0, r3, 0 - adds r0, 0xF5 - add r0, r8 - ldrb r0, [r0] - cmp r0, 0xFF - bne _08026500 - b _08026602 -_08026500: - b _08026528 - .pool -_08026518: - adds r0, r3, 0 - adds r0, 0xF5 - add r0, r8 - ldrb r0, [r0] - cmp r0, 0xFF - bne _08026528 - ldrb r4, [r2] - b _0802654E -_08026528: - mov r2, r9 - ldr r1, [r2] - adds r0, r1, 0 - adds r0, 0xF4 - add r0, r8 - ldrb r7, [r0] - adds r1, 0xF5 - add r1, r8 - ldrb r6, [r1] - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - bne _0802654A - adds r4, r7, 0 - b _0802654E -_0802654A: - adds r4, r6, 0 - adds r6, r7, 0 -_0802654E: - mov r1, r9 - ldr r0, [r1] - ldr r2, =0x000032eb - adds r0, r2 - adds r0, r5 - movs r1, 0x7 - strb r1, [r0] - mov r1, r9 - ldr r0, [r1] - adds r0, 0xC4 - adds r0, r5 - movs r1, 0x2 - strb r1, [r0] - mov r2, r9 - ldr r0, [r2] - adds r0, 0xA8 - adds r0, r4 - movs r1, 0x3 - strb r1, [r0] - ldr r0, [r2] - adds r0, 0xB8 - adds r0, r5 - strb r4, [r0] - ldr r1, [r2] - lsls r0, r4, 4 - subs r0, r4 - lsls r0, 2 - adds r1, r0 - ldr r2, =0x000031d0 - adds r1, r2 - movs r0, 0x1 - strb r0, [r1] - mov r2, r9 - ldr r1, [r2] - lsls r0, r6, 4 - subs r0, r6 - lsls r0, 2 - adds r1, r0 - ldr r0, =0x000031d4 - adds r1, r0 - movs r2, 0x1 - strb r2, [r1] - mov r0, r9 - ldr r1, [r0] - lsls r0, r4, 1 - adds r1, 0x86 - adds r1, r0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - movs r0, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_8026F1C - movs r0, 0x1 - bl sub_8027234 - adds r0, r4, 0 - bl sub_8026D1C - mov r1, r9 - ldr r0, [r1] - adds r1, r0, 0 - adds r1, 0xE8 - adds r1, r5 - ldr r2, =0x000032e0 - adds r0, r2 - adds r0, r5 - ldrb r0, [r0] - strb r0, [r1] - mov r4, r9 - ldr r0, [r4] - adds r0, r2 - adds r0, r5 - movs r1, 0x3 - strb r1, [r0] - ldr r1, [r4] - adds r1, 0xF4 - add r1, r8 - ldrb r0, [r1] - movs r2, 0xFF - orrs r0, r2 - strb r0, [r1] - ldr r1, [r4] - adds r1, 0xF5 - add r1, r8 - ldrb r0, [r1] - orrs r0, r2 - strb r0, [r1] -_08026602: - mov r0, r10 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r4, [sp, 0x4] - cmp r10, r4 - bcs _08026614 - b _08026450 -_08026614: - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8026324 - - thumb_func_start sub_8026634 -sub_8026634: @ 8026634 - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r3, r1, 24 - lsls r2, 24 - lsrs r6, r2, 24 - movs r7, 0 - ldr r2, =0x02022c98 - ldr r1, [r2] - adds r0, r1, 0 - adds r0, 0x24 - ldrb r0, [r0] - subs r0, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x000032e0 - adds r1, r0 - mov r12, r2 - cmp r3, 0x2 - beq _08026670 - cmp r3, 0x2 - bgt _08026676 - cmp r3, 0x1 - beq _08026674 - b _08026676 - .pool -_08026670: - movs r7, 0x1 - b _08026676 -_08026674: - movs r7, 0x2 -_08026676: - adds r0, r1, 0 - adds r0, 0xB - adds r0, r6 - ldrb r0, [r0] - subs r0, 0x6 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _080266D4 - ldr r0, =gUnknown_082F45AF - lsls r1, r4, 1 - adds r1, r4 - adds r1, r7, r1 - lsls r2, r5, 4 - subs r2, r5 - adds r1, r2 - adds r1, r0 - ldrb r1, [r1] - cmp r6, r1 - bne _0802670A - mov r0, r12 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0xC4 - adds r0, r6 - ldrb r0, [r0] - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _080266D0 - lsls r0, r4, 4 - subs r0, r4 - lsls r0, 2 - adds r0, r1, r0 - ldr r1, =0x000031d4 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - b _0802670A - .pool -_080266D0: - movs r0, 0x1 - b _0802670C -_080266D4: - ldr r0, =gUnknown_082F45AF - lsls r1, r4, 1 - adds r1, r4 - adds r1, r7, r1 - lsls r2, r5, 4 - subs r2, r5 - adds r1, r2 - adds r1, r0 - ldrb r1, [r1] - cmp r6, r1 - bne _0802670A - mov r1, r12 - ldr r0, [r1] - adds r0, 0xA8 - adds r0, r4 - movs r1, 0x4 - strb r1, [r0] - mov r0, r12 - ldr r1, [r0] - lsls r0, r4, 4 - subs r0, r4 - lsls r0, 2 - adds r1, r0 - ldr r0, =0x000031d4 - adds r1, r0 - movs r0, 0x1 - strb r0, [r1] -_0802670A: - movs r0, 0 -_0802670C: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8026634 - - thumb_func_start sub_802671C -sub_802671C: @ 802671C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r2, =0x02022c98 - ldr r4, [r2] - adds r0, r4, 0 - adds r0, 0x44 - ldrb r1, [r0] - adds r0, 0x4 - ldrb r0, [r0] - mov r9, r0 - movs r3, 0 - mov r10, r3 - movs r5, 0x90 - lsls r5, 1 - adds r0, r4, r5 - str r3, [r0] - adds r5, r1, 0 - mov r0, r9 - subs r0, 0x1 - cmp r5, r0 - blt _0802674E - b _08026974 -_0802674E: - mov r8, r2 -_08026750: - mov r0, r8 - ldr r4, [r0] - adds r0, r4, 0 - adds r0, 0xC4 - adds r0, r5 - ldrb r0, [r0] - cmp r0, 0x1 - bls _08026762 - b _0802686C -_08026762: - movs r1, 0x90 - lsls r1, 1 - adds r0, r4, r1 - movs r2, 0x1 - str r2, [r0] - ldr r1, =0x000032eb - adds r0, r4, r1 - adds r6, r0, r5 - ldrb r0, [r6] - cmp r0, 0x9 - bls _080267FC - movs r7, 0 - movs r0, 0xA - strb r0, [r6] - mov r1, r8 - ldr r0, [r1] - adds r0, 0xC4 - adds r0, r5 - movs r1, 0x3 - strb r1, [r0] - mov r1, r8 - ldr r0, [r1] - movs r6, 0xA4 - lsls r6, 1 - adds r0, r6 - adds r1, r0, r5 - ldrb r0, [r1] - cmp r0, 0 - bne _080267AC - strb r2, [r1] - ldr r2, =0x000032e0 - adds r0, r4, r2 - adds r0, r5 - ldrb r0, [r0] - adds r0, 0x4A - bl audio_play -_080267AC: - mov r0, r8 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x40 - ldrb r0, [r0] - cmp r0, 0x9 - bls _080267C2 - mov r2, r10 - cmp r2, 0x1 - beq _080267C2 - b _08026964 -_080267C2: - movs r0, 0x1 - mov r10, r0 - adds r0, r1, r6 - adds r0, r5 - strb r7, [r0] - mov r1, r8 - ldr r0, [r1] - adds r1, r0, 0 - adds r1, 0x40 - ldrb r0, [r1] - cmp r0, 0x9 - bhi _080267DE - adds r0, 0x1 - strb r0, [r1] -_080267DE: - movs r0, 0x3 - adds r1, r5, 0 - movs r2, 0 - bl sub_8026F1C - movs r0, 0 - bl sub_8027234 - b _08026964 - .pool -_080267FC: - adds r0, r5, 0 - bl sub_8026D8C - mov r2, r8 - ldr r7, [r2] - lsls r0, 24 - lsrs r0, 24 - adds r1, r7, 0 - adds r1, 0x90 - adds r1, r0 - ldrb r0, [r1] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x1 - bls _08026822 - movs r3, 0x2 -_08026822: - ldr r2, =gUnknown_082F7A88 - ldr r0, =0x000032e0 - adds r1, r4, r0 - adds r1, r5 - lsls r0, r3, 1 - adds r0, r3 - ldrb r1, [r1] - adds r0, r1 - adds r0, r2 - ldrb r2, [r0] - adds r1, r7, 0 - adds r1, 0xD0 - adds r1, r5 - ldrb r0, [r1] - adds r0, 0x1 - movs r3, 0 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, r2 - bcc _0802685C - ldrb r0, [r6] - adds r0, 0x1 - strb r0, [r6] - mov r1, r8 - ldr r0, [r1] - adds r0, 0xD0 - adds r0, r5 - strb r3, [r0] -_0802685C: - bl sub_8026324 - b _08026964 - .pool -_0802686C: - cmp r0, 0x2 - bne _080268F4 - movs r2, 0x90 - lsls r2, 1 - adds r0, r4, r2 - movs r6, 0x1 - str r6, [r0] - adds r1, r4, 0 - adds r1, 0xDC - adds r1, r5 - ldrb r0, [r1] - adds r0, 0x1 - movs r3, 0 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x13 - bls _08026964 - mov r0, r8 - ldr r2, [r0] - adds r0, r2, 0 - adds r0, 0xB8 - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 2 - adds r2, r0 - ldr r1, =0x000031d0 - adds r2, r1 - strb r3, [r2] - mov r2, r8 - ldr r0, [r2] - adds r0, 0xDC - adds r0, r5 - strb r3, [r0] - ldr r0, [r2] - adds r0, 0xD0 - adds r0, r5 - strb r3, [r0] - ldr r0, [r2] - adds r0, 0xC4 - adds r0, r5 - strb r3, [r0] - ldr r1, =0x000032eb - adds r0, r4, r1 - adds r0, r5 - strb r6, [r0] - adds r0, r5, 0 - bl sub_8026D8C - lsls r0, 24 - lsrs r0, 24 - adds r1, r5, 0 - bl sub_8026DB0 - ldr r2, =0x000032e0 - adds r1, r4, r2 - adds r1, r5 - strb r0, [r1] - b _08026964 - .pool -_080268F4: - cmp r0, 0x3 - bne _08026964 - adds r1, r4, 0 - adds r1, 0xDC - adds r1, r5 - ldrb r0, [r1] - adds r0, 0x1 - movs r2, 0 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x13 - bls _08026964 - mov r0, r8 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x40 - ldrb r0, [r0] - cmp r0, 0x9 - bhi _08026964 - adds r0, r1, 0 - adds r0, 0xDC - adds r0, r5 - strb r2, [r0] - mov r1, r8 - ldr r0, [r1] - adds r0, 0xD0 - adds r0, r5 - strb r2, [r0] - ldr r0, [r1] - adds r0, 0xC4 - adds r0, r5 - strb r2, [r0] - ldr r2, =0x000032eb - adds r0, r4, r2 - adds r0, r5 - movs r1, 0x1 - strb r1, [r0] - mov r0, r8 - ldr r1, [r0] - adds r1, 0xE8 - adds r1, r5 - subs r2, 0xB - adds r4, r2 - adds r4, r5 - ldrb r0, [r4] - strb r0, [r1] - adds r0, r5, 0 - bl sub_8026D8C - lsls r0, 24 - lsrs r0, 24 - adds r1, r5, 0 - bl sub_8026DB0 - strb r0, [r4] -_08026964: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - mov r0, r9 - subs r0, 0x1 - cmp r5, r0 - bge _08026974 - b _08026750 -_08026974: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802671C - - thumb_func_start sub_8026988 -sub_8026988: @ 8026988 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r0, =0x02022c98 - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0x44 - adds r0, 0x48 - ldrb r0, [r0] - mov r8, r0 - ldrb r6, [r1] - cmp r6, r8 - bcs _08026A7A - ldr r0, =gUnknown_082F449C - mov r9, r0 -_080269A8: - ldr r0, =0x02022c98 - ldr r3, [r0] - adds r0, r3, 0 - adds r0, 0x28 - ldrb r1, [r0] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 2 - ldr r2, =0x000031a0 - adds r0, r2 - adds r7, r3, r0 - movs r0, 0xB - adds r2, r1, 0 - muls r2, r0 - adds r2, r6, r2 - adds r3, 0x24 - ldrb r1, [r3] - subs r1, 0x1 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 3 - subs r0, r1 - adds r2, r0 - add r2, r9 - ldrb r4, [r2] - adds r0, r7, 0 - adds r0, 0x1F - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - beq _080269FC - adds r0, r6, 0 - movs r1, 0 - bl sub_8028BF8 - b _08026A04 - .pool -_080269FC: - adds r0, r6, 0 - movs r1, 0x1 - bl sub_8028BF8 -_08026A04: - adds r0, r7, 0 - adds r0, 0x1F - adds r5, r0, r4 - ldrb r0, [r5] - cmp r0, 0x9 - bls _08026A30 - adds r0, r7, 0 - adds r0, 0x14 - adds r0, r4 - ldrb r1, [r0] - adds r1, 0x3 - lsls r1, 24 - lsrs r1, 24 - adds r0, r6, 0 - bl sub_8028CA4 - ldrb r1, [r5] - lsls r1, 25 - movs r0, 0xFF - lsls r0, 24 - adds r1, r0 - b _08026A52 -_08026A30: - adds r0, r7, 0 - adds r0, 0x14 - adds r3, r0, r4 - ldrb r0, [r3] - cmp r0, 0x3 - bne _08026A5C - movs r0, 0x7 - strb r0, [r5] - adds r0, r6, 0 - movs r1, 0x6 - bl sub_8028CA4 - ldrb r1, [r5] - lsls r1, 25 - movs r2, 0xFF - lsls r2, 24 - adds r1, r2 -_08026A52: - lsrs r1, 24 - adds r0, r6, 0 - bl sub_8028C7C - b _08026A70 -_08026A5C: - ldrb r1, [r3] - adds r0, r6, 0 - bl sub_8028CA4 - ldrb r1, [r5] - lsls r1, 25 - lsrs r1, 24 - adds r0, r6, 0 - bl sub_8028C7C -_08026A70: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, r8 - bcc _080269A8 -_08026A7A: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8026988 - - thumb_func_start sub_8026A88 -sub_8026A88: @ 8026A88 - push {r4-r6,lr} - ldr r1, =0x02022c98 - ldr r0, [r1] - adds r0, 0x24 - ldrb r5, [r0] - movs r4, 0 - cmp r4, r5 - bcs _08026ABA - adds r6, r1, 0 -_08026A9A: - lsls r0, r4, 4 - subs r0, r4 - lsls r0, 2 - ldr r1, [r6] - adds r0, r1 - ldr r1, =0x000031cc - adds r0, r1 - ldrb r1, [r0] - adds r0, r4, 0 - bl sub_80286B4 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _08026A9A -_08026ABA: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8026A88 - - thumb_func_start sub_8026AC8 -sub_8026AC8: @ 8026AC8 - push {r4,r5,lr} - ldr r0, =0x02022c98 - ldr r0, [r0] - adds r0, 0x24 - ldrb r5, [r0] - movs r4, 0 - cmp r4, r5 - bcs _08026AEA -_08026AD8: - adds r0, r4, 0 - movs r1, 0x4 - bl sub_80286B4 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _08026AD8 -_08026AEA: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8026AC8 - - thumb_func_start sub_8026AF4 -sub_8026AF4: @ 8026AF4 - push {lr} - bl sub_8026988 - ldr r0, =0x02022c98 - ldr r0, [r0] - adds r0, 0x40 - ldrb r0, [r0] - cmp r0, 0x9 - bls _08026B10 - bl sub_8026AC8 - b _08026B14 - .pool -_08026B10: - bl sub_8026A88 -_08026B14: - ldr r0, =0x02022c98 - ldr r0, [r0] - adds r0, 0x40 - ldrb r0, [r0] - bl sub_80288D4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8026AF4 - - thumb_func_start sub_8026B28 -sub_8026B28: @ 8026B28 - push {lr} - bl sub_8026988 - ldr r0, =0x02022c98 - ldr r0, [r0] - adds r0, 0x40 - ldrb r0, [r0] - cmp r0, 0x9 - bls _08026B44 - bl sub_8026AC8 - b _08026B48 - .pool -_08026B44: - bl sub_8026A88 -_08026B48: - ldr r0, =0x02022c98 - ldr r0, [r0] - adds r0, 0x40 - ldrb r0, [r0] - bl sub_80288D4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8026B28 - - thumb_func_start sub_8026B5C -sub_8026B5C: @ 8026B5C - push {lr} - adds r3, r1, 0 - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x1 - cmp r0, 0x4 - bhi _08026BB4 - lsls r0, 2 - ldr r1, =_08026B78 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08026B78: - .4byte _08026B8C - .4byte _08026B94 - .4byte _08026B9C - .4byte _08026BA4 - .4byte _08026BAC -_08026B8C: - movs r0, 0x4 - strb r0, [r3] - movs r0, 0x7 - b _08026BB2 -_08026B94: - movs r0, 0x3 - strb r0, [r3] - movs r0, 0x8 - b _08026BB2 -_08026B9C: - movs r0, 0x2 - strb r0, [r3] - movs r0, 0x9 - b _08026BB2 -_08026BA4: - movs r0, 0x1 - strb r0, [r3] - movs r0, 0xA - b _08026BB2 -_08026BAC: - movs r0, 0 - strb r0, [r3] - movs r0, 0xB -_08026BB2: - strb r0, [r2] -_08026BB4: - pop {r0} - bx r0 - thumb_func_end sub_8026B5C - - thumb_func_start sub_8026BB8 -sub_8026BB8: @ 8026BB8 - push {r4-r6,lr} - ldr r1, =0x02022c98 - ldr r0, [r1] - adds r0, 0x24 - ldrb r5, [r0] - movs r4, 0x1 - cmp r4, r5 - bcs _08026C1E - adds r6, r1, 0 -_08026BCA: - ldr r0, [r6] - movs r1, 0xAC - lsls r1, 1 - adds r0, r1 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - bne _08026BEC - adds r0, r4, 0 - bl sub_8027DFC - ldr r1, [r6] - movs r2, 0xAC - lsls r2, 1 - adds r1, r2 - adds r1, r4 - strb r0, [r1] -_08026BEC: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _08026BCA - cmp r4, r5 - bcs _08026C1E - ldr r0, =0x02022c98 - ldr r0, [r0] - movs r2, 0xAC - lsls r2, 1 - adds r1, r0, r2 -_08026C04: - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, 0 - bne _08026C14 - movs r0, 0 - b _08026C20 - .pool -_08026C14: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _08026C04 -_08026C1E: - movs r0, 0x1 -_08026C20: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8026BB8 - - thumb_func_start sub_8026C28 -sub_8026C28: @ 8026C28 - push {r4,lr} - movs r1, 0 - ldr r4, =0x02022c98 - movs r3, 0xAC - lsls r3, 1 - movs r2, 0 -_08026C34: - ldr r0, [r4] - adds r0, r3 - adds r0, r1 - strb r2, [r0] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x4 - bls _08026C34 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8026C28 - - thumb_func_start sub_8026C50 -sub_8026C50: @ 8026C50 - push {r4,lr} - ldr r3, =0x02022c98 - ldr r1, [r3] - adds r2, r1, 0 - adds r2, 0x40 - ldrb r0, [r2] - cmp r0, 0x9 - bls _08026C88 - movs r4, 0x90 - lsls r4, 1 - adds r0, r1, r4 - ldr r0, [r0] - cmp r0, 0 - bne _08026C88 - movs r0, 0xA - strb r0, [r2] - ldr r0, [r3] - movs r1, 0x96 - lsls r1, 1 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - beq _08026C88 - movs r0, 0x1 - b _08026C8A - .pool -_08026C88: - movs r0, 0 -_08026C8A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8026C50 - - thumb_func_start sub_8026C90 -sub_8026C90: @ 8026C90 - push {r4-r6,lr} - ldr r4, =0x02022c98 - ldr r1, [r4] - adds r2, r1, 0 - adds r2, 0x40 - ldrb r0, [r2] - cmp r0, 0x9 - bls _08026D14 - adds r0, r1, 0 - adds r0, 0x44 - ldrb r3, [r0] - adds r0, 0x4 - ldrb r5, [r0] - movs r0, 0xA - strb r0, [r2] - ldr r4, [r4] - mov r12, r4 - movs r0, 0x96 - lsls r0, 1 - add r0, r12 - ldr r0, [r0] - cmp r0, 0 - beq _08026D14 - adds r4, r3, 0 - cmp r4, r5 - bcs _08026D04 - mov r0, r12 - adds r0, 0x28 - ldrb r3, [r0] - lsls r1, r3, 4 - subs r1, r3 - lsls r1, 2 - ldr r6, =gUnknown_082F449C - subs r0, 0x4 - ldrb r2, [r0] - subs r2, 0x1 - add r1, r12 - movs r0, 0xB - muls r3, r0 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 3 - subs r2, r0, r2 - ldr r0, =0x000031bf - adds r1, r0 -_08026CEA: - adds r0, r4, r3 - adds r0, r2 - adds r0, r6 - ldrb r0, [r0] - adds r0, r1, r0 - ldrb r0, [r0] - cmp r0, 0xA - bne _08026D14 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _08026CEA -_08026D04: - movs r0, 0x1 - b _08026D16 - .pool -_08026D14: - movs r0, 0 -_08026D16: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8026C90 - - thumb_func_start sub_8026D1C -sub_8026D1C: @ 8026D1C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_082F7A9C - mov r8, r0 - ldr r0, =0x02022c98 - ldr r6, [r0] - adds r0, r6, 0 - adds r0, 0x90 - adds r0, r5 - mov r9, r0 - ldrb r7, [r0] - adds r0, r7, 0 - movs r1, 0x7 - bl __umodsi3 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - add r4, r8 - adds r0, r7, 0 - movs r1, 0x7 - bl __udivsi3 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldrb r4, [r4] - adds r0, r4 - lsls r0, 24 - lsls r5, 1 - adds r6, 0x86 - adds r6, r5 - ldrh r1, [r6] - lsrs r0, 24 - cmp r1, r0 - bcc _08026D76 - adds r0, r7, 0x1 - mov r1, r9 - strb r0, [r1] -_08026D76: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8026D1C - - thumb_func_start sub_8026D8C -sub_8026D8C: @ 8026D8C - lsls r0, 24 - lsrs r0, 24 - ldr r3, =gUnknown_082F4648 - ldr r1, =0x02022c98 - ldr r1, [r1] - adds r1, 0x24 - ldrb r1, [r1] - subs r1, 0x1 - movs r2, 0xB - muls r1, r2 - adds r0, r1 - adds r0, r3 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8026D8C - - thumb_func_start sub_8026DB0 -sub_8026DB0: @ 8026DB0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - ldr r4, =0x02022c98 - ldr r1, [r4] - adds r1, 0x24 - ldrb r2, [r1] - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldr r3, =gUnknown_082F45FA - lsls r1, r0, 1 - adds r1, r0 - lsls r0, r2, 4 - subs r0, r2 - adds r1, r0 - adds r0, r1, r3 - ldrb r0, [r0] - mov r12, r0 - adds r0, r3, 0x1 - adds r0, r1, r0 - ldrb r7, [r0] - adds r3, 0x2 - adds r1, r3 - ldrb r1, [r1] - mov r8, r1 - movs r3, 0 - ldr r1, =gUnknown_082F467F - lsls r0, r2, 2 - adds r2, r0, r2 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _08026E18 - adds r6, r1, 0 -_08026DFE: - adds r0, r3, r2 - adds r0, r6 - ldrb r0, [r0] - cmp r5, r0 - beq _08026E3C - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - adds r0, r3, r2 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _08026DFE -_08026E18: - ldr r0, [r4] - adds r0, 0x90 - mov r1, r12 - adds r2, r0, r1 - adds r1, r0, r7 - ldrb r0, [r2] - ldrb r3, [r1] - cmp r0, r3 - bls _08026E46 - adds r1, r0, 0 - b _08026E48 - .pool -_08026E3C: - ldr r0, [r4] - adds r0, 0x90 - adds r0, r7 - ldrb r0, [r0] - b _08026E5A -_08026E46: - ldrb r1, [r1] -_08026E48: - ldr r0, [r4] - adds r0, 0x90 - mov r2, r8 - adds r4, r0, r2 - ldrb r0, [r4] - cmp r0, r1 - bls _08026E58 - adds r1, r0, 0 -_08026E58: - adds r0, r1, 0 -_08026E5A: - adds r1, r5, 0 - bl sub_8026E70 - lsls r0, 24 - lsrs r0, 24 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8026DB0 - - thumb_func_start sub_8026E70 -sub_8026E70: @ 8026E70 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =0x02022c98 - ldr r2, [r2] - adds r2, 0xE8 - adds r2, r1 - ldrb r4, [r2] - movs r1, 0x7 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x6 - bhi _08026EDE - lsls r0, 2 - ldr r1, =_08026EA4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08026EA4: - .4byte _08026EDE - .4byte _08026ED6 - .4byte _08026EE2 - .4byte _08026EC0 - .4byte _08026EC6 - .4byte _08026ECC - .4byte _08026ED2 -_08026EC0: - cmp r4, 0 - beq _08026ED6 - b _08026EDE -_08026EC6: - cmp r4, 0 - beq _08026EE2 - b _08026EDE -_08026ECC: - cmp r4, 0x2 - beq _08026ED6 - b _08026EE2 -_08026ED2: - cmp r4, 0 - bne _08026EDA -_08026ED6: - movs r0, 0x1 - b _08026EE4 -_08026EDA: - cmp r4, 0x1 - beq _08026EE2 -_08026EDE: - movs r0, 0 - b _08026EE4 -_08026EE2: - movs r0, 0x2 -_08026EE4: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8026E70 - - thumb_func_start sub_8026EEC -sub_8026EEC: @ 8026EEC - push {r4-r6,lr} - movs r6, 0 - movs r5, 0 - adds r4, r0, 0 - b _08026EFE -_08026EF6: - ldrh r0, [r4, 0x6] - adds r6, r0 - adds r4, 0xC - adds r5, 0x1 -_08026EFE: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - blt _08026EF6 - cmp r6, 0xA - bgt _08026F12 - movs r0, 0 - b _08026F14 -_08026F12: - movs r0, 0x1 -_08026F14: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8026EEC - - thumb_func_start sub_8026F1C -sub_8026F1C: @ 8026F1C - push {r4-r6,lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - lsls r2, 24 - lsrs r2, 24 - ldr r6, =0x02022c98 - ldr r1, [r6] - adds r0, r1, 0 - adds r0, 0x24 - ldrb r5, [r0] - cmp r3, 0 - bge _08026F3A - b _0802722C -_08026F3A: - cmp r3, 0x2 - ble _08026F48 - cmp r3, 0x3 - beq _08026F78 - b _0802722C - .pool -_08026F48: - ldr r3, =0x000031b4 - adds r0, r1, r3 - adds r0, r4 - ldrb r4, [r0] - lsls r4, 1 - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r4, r0 - adds r0, r1, 0 - adds r0, 0x4A - adds r0, r4 - ldrh r0, [r0] - ldr r1, =0x00004e20 - bl sub_8027A28 - ldr r1, [r6] - adds r1, 0x4A - adds r1, r4 - b _0802722A - .pool -_08026F78: - adds r0, r1, 0 - adds r0, 0x4A - bl sub_8026EEC - cmp r0, 0 - beq _08026F86 - b _0802722C -_08026F86: - cmp r5, 0x3 - bne _08026F8C - b _08027154 -_08026F8C: - cmp r5, 0x3 - bgt _08026F98 - cmp r5, 0x2 - bne _08026F96 - b _080271E8 -_08026F96: - b _0802722C -_08026F98: - cmp r5, 0x4 - bne _08026F9E - b _08027090 -_08026F9E: - cmp r5, 0x5 - beq _08026FA4 - b _0802722C -_08026FA4: - cmp r4, 0x9 - bls _08026FAA - b _0802722C -_08026FAA: - lsls r0, r4, 2 - ldr r1, =_08026FB8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08026FB8: - .4byte _08026FE0 - .4byte _08026FF8 - .4byte _08027004 - .4byte _0802701C - .4byte _08027028 - .4byte _08027040 - .4byte _0802704C - .4byte _08027060 - .4byte _0802706C - .4byte _08027084 -_08026FE0: - ldr r0, =0x02022c98 - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0x68 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - adds r1, 0x74 - b _08027226 - .pool -_08026FF8: - ldr r0, =0x02022c98 - ldr r1, [r0] - adds r1, 0x74 - b _08027226 - .pool -_08027004: - ldr r0, =0x02022c98 - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0x74 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - adds r1, 0x80 - b _08027226 - .pool -_0802701C: - ldr r0, =0x02022c98 - ldr r1, [r0] - adds r1, 0x80 - b _08027226 - .pool -_08027028: - ldr r0, =0x02022c98 - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0x80 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - adds r1, 0x50 - b _08027226 - .pool -_08027040: - ldr r0, =0x02022c98 - ldr r1, [r0] - adds r1, 0x50 - b _08027226 - .pool -_0802704C: - ldr r0, =0x02022c98 - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0x50 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - b _08027224 - .pool -_08027060: - ldr r0, =0x02022c98 - ldr r1, [r0] - b _08027224 - .pool -_0802706C: - ldr r0, =0x02022c98 - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0x5C - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - adds r1, 0x68 - b _08027226 - .pool -_08027084: - ldr r0, =0x02022c98 - ldr r1, [r0] - adds r1, 0x68 - b _08027226 - .pool -_08027090: - subs r0, r4, 0x1 - cmp r0, 0x7 - bls _08027098 - b _0802722C -_08027098: - lsls r0, 2 - ldr r1, =_080270A8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080270A8: - .4byte _080270C8 - .4byte _080270E0 - .4byte _080270EC - .4byte _08027104 - .4byte _08027110 - .4byte _08027124 - .4byte _08027130 - .4byte _08027148 -_080270C8: - ldr r0, =0x02022c98 - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0x68 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - adds r1, 0x74 - b _08027226 - .pool -_080270E0: - ldr r0, =0x02022c98 - ldr r1, [r0] - adds r1, 0x74 - b _08027226 - .pool -_080270EC: - ldr r0, =0x02022c98 - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0x74 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - adds r1, 0x50 - b _08027226 - .pool -_08027104: - ldr r0, =0x02022c98 - ldr r1, [r0] - adds r1, 0x50 - b _08027226 - .pool -_08027110: - ldr r0, =0x02022c98 - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0x50 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - b _08027224 - .pool -_08027124: - ldr r0, =0x02022c98 - ldr r1, [r0] - b _08027224 - .pool -_08027130: - ldr r0, =0x02022c98 - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0x5C - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - adds r1, 0x68 - b _08027226 - .pool -_08027148: - ldr r0, =0x02022c98 - ldr r1, [r0] - adds r1, 0x68 - b _08027226 - .pool -_08027154: - subs r0, r4, 0x2 - cmp r0, 0x5 - bhi _0802722C - lsls r0, 2 - ldr r1, =_08027168 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08027168: - .4byte _08027180 - .4byte _08027198 - .4byte _080271A4 - .4byte _080271BC - .4byte _080271C8 - .4byte _080271DC -_08027180: - ldr r0, =0x02022c98 - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0x5C - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - adds r1, 0x68 - b _08027226 - .pool -_08027198: - ldr r0, =0x02022c98 - ldr r1, [r0] - adds r1, 0x68 - b _08027226 - .pool -_080271A4: - ldr r0, =0x02022c98 - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0x68 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - adds r1, 0x50 - b _08027226 - .pool -_080271BC: - ldr r0, =0x02022c98 - ldr r1, [r0] - adds r1, 0x50 - b _08027226 - .pool -_080271C8: - ldr r0, =0x02022c98 - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0x50 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - b _08027224 - .pool -_080271DC: - ldr r0, =0x02022c98 - ldr r1, [r0] - b _08027224 - .pool -_080271E8: - cmp r4, 0x4 - beq _0802720E - cmp r4, 0x4 - bgt _080271F6 - cmp r4, 0x3 - beq _08027200 - b _0802722C -_080271F6: - cmp r4, 0x5 - beq _08027214 - cmp r4, 0x6 - beq _08027222 - b _0802722C -_08027200: - ldr r1, [r6] - adds r2, r1, 0 - adds r2, 0x50 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - b _08027224 -_0802720E: - ldr r1, [r6] - adds r1, 0x50 - b _08027226 -_08027214: - ldr r1, [r6] - adds r2, r1, 0 - adds r2, 0x50 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - b _08027224 -_08027222: - ldr r1, [r6] -_08027224: - adds r1, 0x5C -_08027226: - ldrh r0, [r1] - adds r0, 0x1 -_0802722A: - strh r0, [r1] -_0802722C: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8026F1C - - thumb_func_start sub_8027234 -sub_8027234: @ 8027234 - push {r4,r5,lr} - adds r1, r0, 0 - ldr r4, =0x02022c98 - ldr r3, [r4] - adds r0, r3, 0 - adds r0, 0x24 - ldrb r0, [r0] - cmp r0, 0x5 - bne _0802729E - cmp r1, 0x1 - bne _08027280 - movs r5, 0x89 - lsls r5, 1 - adds r1, r3, r5 - ldrh r0, [r1] - adds r2, r0, 0x1 - strh r2, [r1] - movs r0, 0x8A - lsls r0, 1 - adds r1, r3, r0 - lsls r0, r2, 16 - lsrs r0, 16 - ldrh r3, [r1] - cmp r0, r3 - bls _08027268 - strh r2, [r1] -_08027268: - ldr r0, [r4] - adds r2, r0, r5 - ldrh r0, [r2] - ldr r1, =0x0000270f - cmp r0, r1 - bls _0802729E - strh r1, [r2] - b _0802729E - .pool -_08027280: - movs r2, 0x89 - lsls r2, 1 - adds r0, r3, r2 - movs r5, 0x8A - lsls r5, 1 - adds r1, r3, r5 - ldrh r0, [r0] - ldrh r3, [r1] - cmp r0, r3 - bls _08027296 - strh r0, [r1] -_08027296: - ldr r0, [r4] - adds r0, r2 - movs r1, 0 - strh r1, [r0] -_0802729E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8027234 - - thumb_func_start sub_80272A4 -sub_80272A4: @ 80272A4 - push {r4,r5,lr} - movs r3, 0 - ldr r2, =0x02022c98 - ldr r0, [r2] - adds r0, 0x24 - ldrb r0, [r0] - cmp r3, r0 - bcs _080272DC - adds r5, r2, 0 - movs r4, 0x8A - lsls r4, 1 -_080272BA: - ldr r2, [r5] - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 2 - adds r1, r2, 0 - adds r1, 0x54 - adds r1, r0 - adds r0, r2, r4 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - adds r2, 0x24 - ldrb r2, [r2] - cmp r3, r2 - bcc _080272BA -_080272DC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80272A4 - - thumb_func_start sub_80272E8 -sub_80272E8: @ 80272E8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r5, 0 - ldr r7, =0x02022c98 - movs r4, 0 - ldr r0, =0x000031bf - mov r10, r0 -_080272FC: - movs r2, 0 - lsls r6, r5, 4 - lsls r1, r5, 1 - mov r8, r1 - lsls r0, r5, 3 - mov r12, r0 - adds r1, r5, 0x1 - mov r9, r1 - subs r0, r6, r5 - lsls r3, r0, 2 -_08027310: - ldr r0, [r7] - adds r1, r2, r3 - add r0, r10 - adds r0, r1 - strb r4, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xA - bls _08027310 - ldr r0, [r7] - subs r1, r6, r5 - lsls r1, 2 - adds r0, r1 - ldr r2, =0x000031cc - adds r0, r2 - strb r4, [r0] - ldr r0, [r7] - adds r0, r1 - ldr r1, =0x000031d0 - adds r0, r1 - strb r4, [r0] - ldr r0, [r7] - adds r0, 0x90 - adds r0, r5 - strb r4, [r0] - ldr r1, [r7] - adds r0, r1, 0 - adds r0, 0x86 - add r0, r8 - strh r4, [r0] - add r1, r12 - ldr r2, =0x00003308 - adds r1, r2 - strb r4, [r1] - ldr r2, [r7] - ldr r1, =0x0000330c - adds r0, r2, r1 - add r0, r12 - str r4, [r0] - mov r0, r8 - adds r1, r0, r5 - lsls r1, 2 - adds r0, r2, 0 - adds r0, 0x4A - adds r0, r1 - strh r4, [r0] - adds r0, r2, 0 - adds r0, 0x4C - adds r0, r1 - strh r4, [r0] - adds r0, r2, 0 - adds r0, 0x4E - adds r0, r1 - strh r4, [r0] - adds r0, r2, 0 - adds r0, 0x50 - adds r0, r1 - strh r4, [r0] - adds r0, r2, 0 - adds r0, 0x52 - adds r0, r1 - strh r4, [r0] - adds r0, r2, 0 - adds r0, 0x54 - adds r0, r1 - strh r4, [r0] - mov r1, r9 - lsls r0, r1, 24 - lsrs r5, r0, 24 - cmp r5, 0x4 - bls _080272FC - ldr r2, =0x02022c98 - ldr r0, [r2] - movs r1, 0xAA - lsls r1, 1 - adds r0, r1 - movs r2, 0 - strb r2, [r0] - ldr r1, =0x02022c98 - ldr r0, [r1] - movs r1, 0x89 - lsls r1, 1 - adds r3, r0, r1 - movs r1, 0 - strh r2, [r3] - adds r0, 0x40 - strb r1, [r0] - bl sub_8026A88 - bl sub_8026988 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80272E8 - - thumb_func_start sub_80273F0 -sub_80273F0: @ 80273F0 - push {r4,r5,lr} - movs r4, 0 - ldr r0, =0x02022c98 - ldr r0, [r0] - adds r0, 0x24 - ldrb r0, [r0] - cmp r0, 0x4 - beq _0802740C - cmp r0, 0x5 - beq _08027410 - b _08027412 - .pool -_0802740C: - movs r4, 0x1 - b _08027412 -_08027410: - movs r4, 0x2 -_08027412: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - movs r3, 0 - lsls r1, r4, 2 - ldr r5, =0x02022c98 - ldr r2, =gUnknown_082F7AA4 - adds r1, r4 - lsls r1, 1 - adds r0, r1 - adds r0, r2 - ldrb r2, [r0] -_08027436: - ldr r1, [r5] - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 2 - adds r1, 0x52 - adds r1, r0 - strh r2, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x4 - bls _08027436 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80273F0 - - thumb_func_start sub_802745C -sub_802745C: @ 802745C - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022c98 - ldr r2, [r1] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r0, r2, 0 - adds r0, 0x4A - adds r0, r1 - ldrh r3, [r0] - adds r0, r2, 0 - adds r0, 0x4C - adds r0, r1 - ldrh r0, [r0] - adds r2, 0x4E - adds r2, r1 - adds r3, r0 - ldrh r2, [r2] - adds r0, r3, r2 - ldr r1, =0x0000270f - cmp r0, r1 - bls _0802748E - adds r0, r1, 0 -_0802748E: - pop {r1} - bx r1 - .pool - thumb_func_end sub_802745C - - thumb_func_start sub_802749C -sub_802749C: @ 802749C - push {r4-r6,lr} - ldr r5, =0x02022c98 - ldr r0, [r5] - adds r0, 0x28 - ldrb r0, [r0] - bl sub_802745C - ldr r1, =0x0000270f - bl sub_8027A38 - adds r4, r0, 0 - ldr r0, [r5] - adds r0, 0x28 - ldrb r0, [r0] - bl sub_80276C0 - ldr r1, =0x000f4236 - bl sub_8027A38 - adds r2, r0, 0 - ldr r3, =0x03005d90 - ldr r0, [r3] - movs r6, 0x83 - lsls r6, 2 - adds r1, r0, r6 - ldr r0, [r1] - cmp r0, r2 - bcs _080274D6 - str r2, [r1] -_080274D6: - ldr r0, [r3] - movs r2, 0x84 - lsls r2, 2 - adds r1, r0, r2 - ldrh r0, [r1] - cmp r0, r4 - bcs _080274E6 - strh r4, [r1] -_080274E6: - ldr r0, [r3] - ldr r6, =0x00000212 - adds r2, r0, r6 - ldr r0, [r5] - movs r1, 0x8A - lsls r1, 1 - adds r0, r1 - ldrh r1, [r0] - ldrh r0, [r2] - cmp r0, r1 - bcs _080274FE - strh r1, [r2] -_080274FE: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802749C - - thumb_func_start sub_8027518 -sub_8027518: @ 8027518 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =0x02022c98 - ldr r0, [r1] - adds r0, 0x9B - ldrb r6, [r0] - movs r3, 0x3 - adds r5, r1, 0 - adds r4, r5, 0 -_0802752C: - ldr r0, [r4] - adds r0, 0x98 - adds r2, r0, r3 - subs r1, r3, 0x1 - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - lsls r1, 24 - lsrs r3, r1, 24 - cmp r3, 0 - bne _0802752C - ldr r0, [r5] - adds r0, 0x98 - strb r7, [r0] - adds r0, r6, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8027518 - - thumb_func_start sub_8027554 -sub_8027554: @ 8027554 - push {r4,lr} - ldr r4, =0x02022c98 - ldr r3, [r4] - adds r0, r3, 0 - adds r0, 0x28 - ldrb r1, [r0] - adds r0, 0x88 - adds r2, r0, r1 - ldrb r0, [r2] - cmp r0, 0 - bne _080275FC - ldr r0, =0x030022c0 - ldrh r2, [r0, 0x2E] - movs r0, 0x40 - ands r0, r2 - cmp r0, 0 - beq _08027594 - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 2 - adds r0, r3, r0 - ldr r1, =0x000031cc - adds r0, r1 - movs r1, 0x2 - b _080275CA - .pool -_08027594: - movs r0, 0x20 - ands r0, r2 - cmp r0, 0 - beq _080275B0 - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 2 - adds r0, r3, r0 - ldr r1, =0x000031cc - adds r0, r1 - movs r1, 0x3 - b _080275CA - .pool -_080275B0: - movs r0, 0x10 - ands r0, r2 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0 - beq _080275E8 - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 2 - adds r0, r3, r0 - ldr r1, =0x000031cc - adds r0, r1 - movs r1, 0x1 -_080275CA: - strb r1, [r0] - ldr r0, [r4] - adds r1, r0, 0 - adds r1, 0x28 - adds r0, 0xB0 - ldrb r1, [r1] - adds r0, r1 - movs r1, 0x6 - strb r1, [r0] - movs r0, 0xD4 - bl audio_play - b _08027600 - .pool -_080275E8: - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 2 - adds r0, r3, r0 - ldr r1, =0x000031cc - adds r0, r1 - strb r2, [r0] - b _08027600 - .pool -_080275FC: - subs r0, 0x1 - strb r0, [r2] -_08027600: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8027554 - - thumb_func_start sub_8027608 -sub_8027608: @ 8027608 - ldr r0, =0x02022c98 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x28 - ldrb r2, [r0] - lsls r0, r2, 4 - subs r0, r2 - lsls r0, 2 - adds r1, r0 - ldr r0, =0x000031cc - adds r1, r0 - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_8027608 - - thumb_func_start sub_802762C -sub_802762C: @ 802762C - ldr r0, =0x02022c98 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x28 - ldrb r2, [r0] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r1, 0x52 - adds r1, r0 - ldrh r0, [r1] - adds r0, 0x85 - lsls r0, 16 - lsrs r0, 16 - bx lr - .pool - thumb_func_end sub_802762C - - thumb_func_start sub_8027650 -sub_8027650: @ 8027650 - ldr r0, =0x02022c98 - ldr r0, [r0] - adds r0, 0x24 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8027650 - - thumb_func_start sub_8027660 -sub_8027660: @ 8027660 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _0802768C - ldr r0, =0x02022c98 - lsls r1, r2, 4 - subs r1, r2 - lsls r1, 2 - ldr r2, =0x000031a0 - adds r1, r2 - ldr r0, [r0] - b _08027694 - .pool -_0802768C: - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - ldr r1, =0x020229f0 -_08027694: - adds r0, r1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8027660 - - thumb_func_start sub_80276A0 -sub_80276A0: @ 80276A0 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - ldr r2, =0x02022c98 - ldr r3, [r2] - lsrs r1, 23 - lsls r2, r0, 1 - adds r2, r0 - lsls r2, 2 - adds r1, r2 - adds r3, 0x4A - adds r3, r1 - ldrh r0, [r3] - bx lr - .pool - thumb_func_end sub_80276A0 - - thumb_func_start sub_80276C0 -sub_80276C0: @ 80276C0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - movs r5, 0 - movs r3, 0 - ldr r0, =0x02022c98 - mov r9, r0 - ldr r2, =gUnknown_082F7B24 - mov r10, r2 - ldr r2, [r0] - lsls r1, r4, 1 - adds r0, r1, r4 - lsls r0, 2 - str r0, [sp] - adds r6, r2, 0 - adds r6, 0x4A - mov r12, r1 - mov r8, r10 -_080276EE: - lsls r1, r3, 1 - ldr r7, [sp] - adds r0, r1, r7 - adds r0, r6, r0 - ldrh r2, [r0] - add r1, r8 - movs r7, 0 - ldrsh r0, [r1, r7] - muls r0, r2 - adds r5, r0 - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x2 - bls _080276EE - mov r0, r9 - ldr r1, [r0] - mov r2, r12 - adds r0, r2, r4 - lsls r0, 2 - adds r1, 0x50 - adds r1, r0 - ldrh r1, [r1] - mov r3, r10 - movs r7, 0x6 - ldrsh r0, [r3, r7] - muls r0, r1 - cmp r5, r0 - bls _08027734 - subs r0, r5, r0 - b _08027736 - .pool -_08027734: - movs r0, 0 -_08027736: - 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_80276C0 - - thumb_func_start sub_8027748 -sub_8027748: @ 8027748 - push {r4-r6,lr} - ldr r0, =0x02022c98 - ldr r0, [r0] - adds r0, 0x24 - ldrb r6, [r0] - movs r0, 0 - bl sub_80276C0 - adds r5, r0, 0 - movs r4, 0x1 - cmp r4, r6 - bcs _08027776 -_08027760: - adds r0, r4, 0 - bl sub_80276C0 - cmp r0, r5 - bls _0802776C - adds r5, r0, 0 -_0802776C: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r6 - bcc _08027760 -_08027776: - ldr r1, =0x000f4236 - adds r0, r5, 0 - bl sub_8027A38 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8027748 - - thumb_func_start sub_802778C -sub_802778C: @ 802778C - push {r4,r5,lr} - lsls r0, 24 - ldr r1, =0x02022c98 - ldr r2, [r1] - adds r1, r2, 0 - adds r1, 0x24 - ldrb r5, [r1] - lsrs r4, r0, 23 - adds r2, 0x4A - adds r0, r2, r4 - ldrh r3, [r0] - movs r1, 0 - cmp r1, r5 - bcs _080277C4 -_080277A8: - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r4, r0 - adds r0, r2, r0 - ldrh r0, [r0] - cmp r0, r3 - bls _080277BA - adds r3, r0, 0 -_080277BA: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, r5 - bcc _080277A8 -_080277C4: - adds r0, r3, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_802778C - - thumb_func_start sub_80277D0 -sub_80277D0: @ 80277D0 - push {r4-r7,lr} - sub sp, 0x14 - lsls r0, 24 - lsrs r7, r0, 24 - movs r6, 0x1 - ldr r0, =0x02022c98 - ldr r0, [r0] - adds r0, 0x24 - ldrb r5, [r0] - movs r4, 0 - cmp r4, r5 - bcs _080277FE -_080277E8: - adds r0, r4, 0 - bl sub_80276C0 - lsls r1, r4, 2 - add r1, sp - str r0, [r1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _080277E8 -_080277FE: - lsls r7, 2 - mov r12, r7 - cmp r6, 0 - beq _08027838 - subs r7, r5, 0x1 -_08027808: - movs r6, 0 - movs r4, 0 - cmp r6, r7 - bge _08027834 - adds r5, r7, 0 -_08027812: - lsls r0, r4, 2 - mov r2, sp - adds r1, r2, r0 - adds r4, 0x1 - lsls r0, r4, 2 - adds r3, r2, r0 - ldr r0, [r1] - ldr r2, [r3] - cmp r0, r2 - bcs _0802782C - str r2, [r1] - str r0, [r3] - movs r6, 0x1 -_0802782C: - lsls r0, r4, 24 - lsrs r4, r0, 24 - cmp r4, r5 - blt _08027812 -_08027834: - cmp r6, 0 - bne _08027808 -_08027838: - mov r0, sp - add r0, r12 - ldr r0, [r0] - add sp, 0x14 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80277D0 - - thumb_func_start sub_802784C -sub_802784C: @ 802784C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r0, 0 - mov r10, r0 - mov r8, r0 - mov r9, r0 - ldr r6, =0x02022c98 - ldr r0, [r6] - adds r0, 0x24 - ldrb r5, [r0] - bl sub_8027748 - bl sub_8027748 - cmp r0, 0 - bne _080278A0 - movs r4, 0 - cmp r9, r5 - bcs _080278A0 - adds r2, r6, 0 - ldr r1, =0x00003308 - mov r12, r1 - movs r7, 0 - movs r6, 0x4 - ldr r3, =0x0000330c -_08027884: - ldr r0, [r2] - lsls r1, r4, 3 - adds r0, r1 - add r0, r12 - strb r6, [r0] - ldr r0, [r2] - adds r0, r3 - adds r0, r1 - str r7, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _08027884 -_080278A0: - movs r4, 0 - cmp r4, r5 - bcs _080278CA -_080278A6: - adds r0, r4, 0 - bl sub_80276C0 - ldr r1, =0x000f4236 - bl sub_8027A38 - ldr r1, =0x02022c98 - ldr r1, [r1] - lsls r2, r4, 3 - ldr r3, =0x0000330c - adds r1, r3 - adds r1, r2 - str r0, [r1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _080278A6 -_080278CA: - mov r0, r10 - bl sub_80277D0 - adds r6, r0, 0 - mov r3, r8 - movs r4, 0 - cmp r4, r5 - bcs _08027916 - ldr r7, =0x02022c98 - mov r10, r7 -_080278DE: - mov r0, r10 - ldr r2, [r0] - lsls r1, r4, 3 - ldr r7, =0x0000330c - adds r0, r2, r7 - adds r0, r1 - ldr r0, [r0] - cmp r6, r0 - bne _0802790C - adds r0, r2, r1 - ldr r1, =0x00003308 - adds r0, r1 - strb r3, [r0] - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_0802790C: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _080278DE -_08027916: - mov r10, r8 - cmp r9, r5 - bcc _080278CA - movs r0, 0 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_802784C - - thumb_func_start sub_802793C -sub_802793C: @ 802793C - lsls r1, 24 - ldr r2, =0x02022c98 - ldr r2, [r2] - lsrs r1, 21 - ldr r3, =0x00003308 - adds r2, r3 - adds r2, r1 - ldr r1, [r2] - ldr r2, [r2, 0x4] - str r1, [r0] - str r2, [r0, 0x4] - bx lr - .pool - thumb_func_end sub_802793C - - thumb_func_start sub_802795C -sub_802795C: @ 802795C - push {r4-r7,lr} - sub sp, 0x14 - lsls r0, 24 - lsrs r6, r0, 24 - movs r7, 0 - ldr r0, =0x02022c98 - ldr r0, [r0] - adds r0, 0x24 - ldrb r5, [r0] - mov r0, sp - movs r1, 0 - movs r2, 0x14 - bl memset - movs r4, 0 - cmp r7, r5 - bcs _08027994 -_0802797E: - adds r0, r4, 0 - bl sub_80276C0 - lsls r1, r4, 2 - add r1, sp - str r0, [r1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _0802797E -_08027994: - lsls r0, r6, 2 - add r0, sp - ldr r1, [r0] - movs r4, 0 -_0802799C: - cmp r4, r6 - beq _080279B0 - lsls r0, r4, 2 - add r0, sp - ldr r0, [r0] - cmp r1, r0 - bcs _080279B0 - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 -_080279B0: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x4 - bls _0802799C - adds r0, r7, 0 - add sp, 0x14 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_802795C - - thumb_func_start sub_80279C8 -sub_80279C8: @ 80279C8 - push {r4-r6,lr} - ldr r0, =0x02022c98 - ldr r0, [r0] - adds r0, 0x28 - ldrb r4, [r0] - bl sub_802762C - lsls r0, 16 - lsrs r5, r0, 16 - adds r6, r5, 0 - adds r0, r4, 0 - bl sub_80276C0 - adds r4, r0, 0 - bl sub_8027748 - cmp r4, r0 - beq _080279F4 - movs r0, 0x3 - b _08027A22 - .pool -_080279F4: - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80D6800 - lsls r0, 24 - cmp r0, 0 - bne _08027A06 - movs r0, 0x2 - b _08027A22 -_08027A06: - adds r0, r6, 0 - movs r1, 0x1 - bl bag_add_item - adds r0, r6, 0 - movs r1, 0x1 - bl sub_80D6800 - lsls r0, 24 - cmp r0, 0 - beq _08027A20 - movs r0, 0 - b _08027A22 -_08027A20: - movs r0, 0x1 -_08027A22: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80279C8 - - thumb_func_start sub_8027A28 -sub_8027A28: @ 8027A28 - push {lr} - adds r2, r0, 0 - adds r0, r1, 0 - cmp r2, r0 - bcs _08027A34 - adds r0, r2, 0x1 -_08027A34: - pop {r1} - bx r1 - thumb_func_end sub_8027A28 - - thumb_func_start sub_8027A38 -sub_8027A38: @ 8027A38 - push {lr} - adds r2, r0, 0 - adds r0, r1, 0 - cmp r2, r0 - bcs _08027A44 - adds r0, r2, 0 -_08027A44: - pop {r1} - bx r1 - thumb_func_end sub_8027A38 - - thumb_func_start sub_8027A48 -sub_8027A48: @ 8027A48 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022c98 - ldr r1, [r1] - adds r1, 0x34 - adds r1, r0 - ldrb r0, [r1] - bx lr - .pool - thumb_func_end sub_8027A48 - - thumb_func_start sub_8027A5C -sub_8027A5C: @ 8027A5C - push {r4-r6,lr} - movs r5, 0 - ldr r6, =0x020375f0 -_08027A62: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x5 - bl pokemon_getattr - cmp r0, 0 - beq _08027A94 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0x55 - bne _08027A94 - movs r0, 0x1 - strh r0, [r6] - b _08027AA0 - .pool -_08027A94: - adds r5, 0x1 - cmp r5, 0x5 - ble _08027A62 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] -_08027AA0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8027A5C - - thumb_func_start sub_8027AAC -sub_8027AAC: @ 8027AAC - push {r4,lr} - ldr r4, =sub_8027ACC - adds r0, r4, 0 - movs r1, 0 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8027AAC - - thumb_func_start sub_8027ACC -sub_8027ACC: @ 8027ACC - push {r4-r7,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r7, r0, r1 - movs r1, 0 - ldrsh r0, [r7, r1] - cmp r0, 0x1 - beq _08027B94 - cmp r0, 0x1 - bgt _08027AF4 - cmp r0, 0 - beq _08027AFE - b _08027BE2 - .pool -_08027AF4: - cmp r0, 0x2 - beq _08027BA0 - cmp r0, 0x3 - beq _08027BC8 - b _08027BE2 -_08027AFE: - ldr r0, =gUnknown_082F7B2C - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp] - str r1, [sp, 0x4] - ldr r1, =gUnknown_085EDCE5 - movs r0, 0x1 - movs r2, 0 - bl GetStringWidth - adds r4, r0, 0 - movs r6, 0 - ldr r5, =gUnknown_082F7B34 -_08027B18: - ldr r1, [r5] - movs r0, 0x1 - movs r2, 0 - bl GetStringWidth - adds r0, 0x32 - cmp r0, r4 - ble _08027B2A - adds r4, r0, 0 -_08027B2A: - adds r5, 0x4 - adds r6, 0x1 - cmp r6, 0x2 - bls _08027B18 - adds r0, r4, 0x7 - cmp r0, 0 - bge _08027B3A - adds r0, 0x7 -_08027B3A: - asrs r4, r0, 3 - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _08027B46 - adds r4, 0x1 -_08027B46: - movs r1, 0x1E - subs r1, r4 - lsrs r0, r1, 31 - adds r1, r0 - asrs r1, 1 - lsls r1, 24 - lsrs r1, 16 - ldr r2, =0xffff00ff - ldr r0, [sp] - ands r0, r2 - orrs r0, r1 - lsls r2, r4, 24 - ldr r1, =0x00ffffff - ands r0, r1 - orrs r0, r2 - str r0, [sp] - mov r0, sp - bl AddWindow - strh r0, [r7, 0x2] - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - bl sub_8027BEC - ldrb r0, [r7, 0x2] - movs r1, 0x3 - b _08027BB6 - .pool -_08027B94: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _08027BE2 - b _08027BBA -_08027BA0: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _08027BE2 - ldrb r0, [r7, 0x2] - bl rbox_fill_rectangle - ldrb r0, [r7, 0x2] - movs r1, 0x1 -_08027BB6: - bl CopyWindowToVram -_08027BBA: - ldrh r0, [r7] - adds r0, 0x1 - strh r0, [r7] - b _08027BE2 - .pool -_08027BC8: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _08027BE2 - ldrb r0, [r7, 0x2] - bl RemoveWindow - adds r0, r4, 0 - bl remove_task - bl script_env_2_enable_and_set_ctx_running -_08027BE2: - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8027ACC - - thumb_func_start sub_8027BEC -sub_8027BEC: @ 8027BEC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - str r1, [sp, 0x18] - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x03005d90 - ldr r1, [r0] - movs r2, 0x84 - lsls r2, 2 - adds r0, r1, r2 - ldrh r0, [r0] - str r0, [sp, 0xC] - subs r2, 0x4 - adds r0, r1, r2 - ldr r0, [r0] - str r0, [sp, 0x10] - ldr r0, =0x00000212 - adds r1, r0 - ldrh r0, [r1] - str r0, [sp, 0x14] - ldr r4, =0x0000021d - adds r0, r7, 0 - adds r1, r4, 0 - movs r2, 0xD0 - bl box_border_load_tiles_and_pal - adds r0, r7, 0 - adds r1, r4, 0 - movs r2, 0xD - bl sub_8098858 - adds r0, r7, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r4, =gUnknown_085EDCE5 - ldr r0, [sp, 0x18] - lsls r2, r0, 3 - movs r0, 0x1 - adds r1, r4, 0 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x1 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r7, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl Print - movs r6, 0 - ldr r2, =0x02021cc4 - mov r8, r2 - movs r0, 0xFF - mov r10, r0 - mov r9, r6 - mov r2, sp - adds r2, 0xC - str r2, [sp, 0x1C] -_08027C76: - lsls r4, r6, 2 - ldr r0, [sp, 0x1C] - ldm r0!, {r1} - str r0, [sp, 0x1C] - ldr r0, =gUnknown_082F7B40 - adds r0, r6, r0 - ldrb r3, [r0] - mov r0, r8 - movs r2, 0 - bl ConvertIntToDecimalString - movs r0, 0x1 - mov r1, r8 - movs r2, 0x1 - negs r2, r2 - bl GetStringWidth - adds r5, r0, 0 - ldr r0, =gUnknown_082F7B34 - adds r4, r0 - ldr r2, [r4] - ldr r0, =gUnknown_082F7B44 - lsls r4, r6, 1 - adds r0, r4, r0 - ldrb r0, [r0] - str r0, [sp] - mov r0, r10 - str r0, [sp, 0x4] - mov r0, r9 - str r0, [sp, 0x8] - adds r0, r7, 0 - movs r1, 0x1 - movs r3, 0 - bl Print - ldr r2, [sp, 0x18] - lsls r3, r2, 3 - subs r3, r5 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =gUnknown_082F7B4A - adds r4, r0 - ldrb r0, [r4] - str r0, [sp] - mov r0, r10 - str r0, [sp, 0x4] - mov r2, r9 - str r2, [sp, 0x8] - adds r0, r7, 0 - movs r1, 0x1 - mov r2, r8 - bl Print - adds r6, 0x1 - cmp r6, 0x2 - ble _08027C76 - adds r0, r7, 0 - bl PutWindowTilemap - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8027BEC - - thumb_func_start sub_8027D20 -sub_8027D20: @ 8027D20 - push {lr} - bl sub_8009FCC - ldr r1, =0x02022c98 - ldr r1, [r1] - adds r1, 0x24 - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8027D20 - - thumb_func_start sub_8027D38 -sub_8027D38: @ 8027D38 - push {r4-r7,lr} - ldr r0, =0x02022c98 - ldr r0, [r0] - adds r0, 0x24 - ldrb r4, [r0] - cmp r4, 0x4 - bhi _08027D66 - ldr r5, =gUnknown_082F7B90 -_08027D48: - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - ldr r1, =0x020229f0 - adds r0, r1 - lsls r1, r4, 2 - adds r1, r5 - ldr r1, [r1] - bl CopyString - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x4 - bls _08027D48 -_08027D66: - ldr r0, =0x02022c98 - ldr r1, [r0] - adds r1, 0x24 - movs r2, 0x5 - strb r2, [r1] - movs r1, 0 - mov r12, r0 -_08027D74: - movs r4, 0 - mov r2, r12 - ldr r0, [r2] - adds r0, 0x24 - adds r5, r1, 0x1 - ldrb r0, [r0] - cmp r4, r0 - bcs _08027DB2 - ldr r7, =0x02022c98 - lsls r3, r1, 1 - ldr r6, =gUnknown_082F7B50 -_08027D8A: - ldr r2, [r7] - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r0, r3, r0 - adds r1, r2, 0 - adds r1, 0x4A - adds r1, r0 - lsls r0, r4, 3 - adds r0, r3, r0 - adds r0, r6 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - adds r2, 0x24 - ldrb r2, [r2] - cmp r4, r2 - bcc _08027D8A -_08027DB2: - lsls r0, r5, 24 - lsrs r1, r0, 24 - cmp r1, 0x3 - bls _08027D74 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8027D38 - - thumb_func_start sub_8027DD0 -sub_8027DD0: @ 8027DD0 - push {lr} - sub sp, 0x8 - ldr r3, =0xffffff00 - ldr r1, [sp] - ands r1, r3 - movs r2, 0x1 - orrs r1, r2 - str r1, [sp] - lsls r0, 24 - lsrs r0, 24 - ldr r1, [sp, 0x4] - ands r1, r3 - orrs r1, r0 - str r1, [sp, 0x4] - mov r0, sp - bl sub_800FE50 - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8027DD0 - - thumb_func_start sub_8027DFC -sub_8027DFC: @ 8027DFC - push {lr} - adds r2, r0, 0 - ldr r3, =0x03003090 - ldrh r0, [r3] - movs r1, 0xFF - lsls r1, 8 - ands r1, r0 - movs r0, 0xBC - lsls r0, 6 - cmp r1, r0 - bne _08027E1E - lsls r0, r2, 4 - adds r1, r3, 0x2 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0x1 - beq _08027E28 -_08027E1E: - movs r0, 0 - b _08027E2A - .pool -_08027E28: - ldrb r0, [r1, 0x4] -_08027E2A: - pop {r1} - bx r1 - thumb_func_end sub_8027DFC - - thumb_func_start sub_8027E30 -sub_8027E30: @ 8027E30 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - ldr r4, [sp, 0x48] - lsls r4, 24 - str r4, [sp, 0x1C] - movs r4, 0x14 - adds r4, r0 - mov r9, r4 - mov r5, sp - movs r4, 0x2 - strb r4, [r5] - mov r10, sp - mov r5, r9 - ldrb r4, [r5, 0xB] - movs r7, 0xF - adds r5, r7, 0 - ands r5, r4 - mov r6, r10 - ldrb r6, [r6, 0x1] - mov r8, r6 - movs r4, 0x10 - negs r4, r4 - mov r6, r8 - ands r4, r6 - orrs r4, r5 - mov r5, r10 - strb r4, [r5, 0x1] - mov r8, sp - mov r6, r9 - ldrb r5, [r6, 0xC] - lsls r5, 4 - ands r4, r7 - orrs r4, r5 - mov r5, r8 - strb r4, [r5, 0x1] - ldrb r5, [r6, 0xD] - movs r6, 0xF - ands r5, r6 - mov r4, r10 - ldrb r4, [r4, 0x2] - mov r8, r4 - movs r4, 0x10 - negs r4, r4 - mov r6, r8 - ands r4, r6 - orrs r4, r5 - mov r5, r10 - strb r4, [r5, 0x2] - mov r8, sp - mov r6, r9 - ldrb r5, [r6, 0xE] - lsls r5, 4 - ands r4, r7 - orrs r4, r5 - mov r5, r8 - strb r4, [r5, 0x2] - ldrb r5, [r6, 0xF] - movs r6, 0xF - ands r5, r6 - mov r4, r10 - ldrb r4, [r4, 0x3] - mov r8, r4 - movs r4, 0x10 - negs r4, r4 - mov r6, r8 - ands r4, r6 - orrs r4, r5 - mov r5, r10 - strb r4, [r5, 0x3] - mov r8, sp - mov r6, r9 - ldrb r5, [r6, 0x10] - lsls r5, 4 - ands r4, r7 - orrs r4, r5 - mov r5, r8 - strb r4, [r5, 0x3] - ldrb r5, [r6, 0x11] - movs r6, 0xF - ands r5, r6 - mov r4, r10 - ldrb r4, [r4, 0x4] - mov r8, r4 - movs r4, 0x10 - negs r4, r4 - mov r6, r8 - ands r4, r6 - orrs r4, r5 - mov r5, r10 - strb r4, [r5, 0x4] - mov r8, sp - mov r6, r9 - ldrb r5, [r6, 0x12] - lsls r5, 4 - ands r4, r7 - orrs r4, r5 - mov r5, r8 - strb r4, [r5, 0x4] - ldrb r4, [r6, 0x13] - movs r6, 0xF - ands r4, r6 - mov r6, r8 - ldrb r5, [r6, 0x5] - movs r6, 0x10 - negs r6, r6 - ands r6, r5 - orrs r6, r4 - str r6, [sp, 0xC] - mov r4, r8 - strb r6, [r4, 0x5] - mov r5, sp - mov r6, r9 - ldrb r4, [r6, 0x14] - lsls r4, 4 - ldr r6, [sp, 0xC] - ands r6, r7 - orrs r6, r4 - strb r6, [r5, 0x5] - mov r7, sp - movs r4, 0x3 - mov r8, r4 - ldrb r0, [r0, 0x14] - mov r5, r8 - ands r0, r5 - ldrb r5, [r7, 0x6] - movs r6, 0x4 - negs r6, r6 - mov r10, r6 - mov r4, r10 - ands r4, r5 - orrs r4, r0 - strb r4, [r7, 0x6] - mov r5, r9 - ldrb r0, [r5, 0x1] - mov r6, r8 - ands r0, r6 - lsls r0, 2 - movs r5, 0xD - negs r5, r5 - ands r5, r4 - orrs r5, r0 - strb r5, [r7, 0x6] - mov r0, r9 - ldrb r4, [r0, 0x2] - ands r4, r6 - lsls r4, 4 - movs r0, 0x31 - negs r0, r0 - ands r0, r5 - orrs r0, r4 - strb r0, [r7, 0x6] - mov r5, sp - mov r6, r9 - ldrb r4, [r6, 0x3] - lsls r4, 6 - movs r6, 0x3F - ands r0, r6 - orrs r0, r4 - strb r0, [r5, 0x6] - mov r4, r9 - ldrb r0, [r4, 0x4] - mov r5, r8 - ands r0, r5 - ldrb r5, [r7, 0x7] - mov r4, r10 - ands r4, r5 - orrs r4, r0 - strb r4, [r7, 0x7] - mov r6, r9 - ldrb r0, [r6, 0x5] - mov r5, r8 - ands r0, r5 - lsls r0, 2 - movs r5, 0xD - negs r5, r5 - ands r5, r4 - orrs r5, r0 - strb r5, [r7, 0x7] - ldrb r4, [r6, 0x6] - mov r6, r8 - ands r4, r6 - lsls r4, 4 - movs r0, 0x31 - negs r0, r0 - ands r0, r5 - orrs r0, r4 - strb r0, [r7, 0x7] - mov r5, sp - mov r6, r9 - ldrb r4, [r6, 0x7] - lsls r4, 6 - movs r6, 0x3F - ands r0, r6 - orrs r0, r4 - strb r0, [r5, 0x7] - mov r8, sp - mov r0, r9 - ldrb r4, [r0, 0x8] - movs r7, 0x3 - adds r0, r7, 0 - ands r0, r4 - mov r4, r8 - ldrb r5, [r4, 0x8] - mov r4, r10 - ands r4, r5 - orrs r4, r0 - mov r5, r8 - strb r4, [r5, 0x8] - mov r6, r9 - ldrb r5, [r6, 0x9] - adds r0, r7, 0 - ands r0, r5 - lsls r0, 2 - movs r5, 0xD - negs r5, r5 - ands r5, r4 - orrs r5, r0 - mov r0, r8 - strb r5, [r0, 0x8] - ldrb r0, [r1] - adds r4, r7, 0 - ands r4, r0 - lsls r4, 4 - movs r0, 0x31 - negs r0, r0 - ands r0, r5 - orrs r0, r4 - mov r4, r8 - strb r0, [r4, 0x8] - mov r5, sp - ldrb r4, [r2] - lsls r4, 6 - movs r6, 0x3F - ands r0, r6 - orrs r0, r4 - strb r0, [r5, 0x8] - ldrb r4, [r3] - adds r0, r7, 0 - ands r0, r4 - ldrb r4, [r5, 0x9] - mov r6, r10 - ands r6, r4 - orrs r6, r0 - mov r10, r6 - strb r6, [r5, 0x9] - ldr r0, [sp, 0x40] - ldrb r4, [r0] - adds r0, r7, 0 - ands r0, r4 - lsls r0, 2 - movs r4, 0xD - negs r4, r4 - ands r6, r4 - orrs r6, r0 - str r6, [sp, 0x10] - strb r6, [r5, 0x9] - mov r4, sp - ldr r5, [sp, 0x44] - ldrb r0, [r5] - adds r6, r7, 0 - ands r6, r0 - lsls r0, r6, 4 - subs r7, 0x34 - ldr r5, [sp, 0x10] - ands r7, r5 - orrs r7, r0 - strb r7, [r4, 0x9] - mov r5, sp - ldrb r0, [r1, 0x4] - movs r6, 0x1 - mov r12, r6 - mov r4, r12 - ands r4, r0 - lsls r4, 6 - movs r0, 0x41 - negs r0, r0 - mov r10, r0 - ands r0, r7 - orrs r0, r4 - strb r0, [r5, 0x9] - ldrb r4, [r2, 0x4] - lsls r4, 7 - movs r5, 0x7F - ands r0, r5 - orrs r0, r4 - mov r4, r8 - strb r0, [r4, 0x9] - ldrb r4, [r3, 0x4] - mov r0, r12 - ands r0, r4 - mov r5, r8 - ldrb r4, [r5, 0xA] - movs r7, 0x2 - negs r7, r7 - adds r5, r7, 0 - ands r5, r4 - orrs r5, r0 - mov r6, r8 - strb r5, [r6, 0xA] - mov r9, sp - ldr r4, [sp, 0x40] - ldrb r0, [r4, 0x4] - mov r4, r12 - ands r4, r0 - lsls r4, 1 - movs r6, 0x3 - negs r6, r6 - mov r8, r6 - mov r0, r8 - ands r0, r5 - orrs r0, r4 - mov r4, r9 - strb r0, [r4, 0xA] - ldr r6, [sp, 0x44] - ldrb r5, [r6, 0x4] - mov r4, r12 - ands r4, r5 - lsls r4, 2 - movs r5, 0x5 - negs r5, r5 - ands r0, r5 - orrs r0, r4 - mov r4, r9 - strb r0, [r4, 0xA] - mov r4, sp - ldrb r1, [r1, 0x8] - mov r0, r12 - ands r0, r1 - lsls r0, 2 - ldrb r1, [r4, 0xB] - ands r5, r1 - orrs r5, r0 - strb r5, [r4, 0xB] - ldrb r1, [r2, 0x8] - mov r0, r12 - ands r0, r1 - lsls r0, 3 - movs r1, 0x9 - negs r1, r1 - ands r1, r5 - orrs r1, r0 - strb r1, [r4, 0xB] - ldrb r2, [r3, 0x8] - mov r0, r12 - ands r0, r2 - lsls r0, 4 - movs r2, 0x11 - negs r2, r2 - ands r2, r1 - orrs r2, r0 - strb r2, [r4, 0xB] - mov r3, sp - ldr r5, [sp, 0x40] - ldrb r0, [r5, 0x8] - mov r1, r12 - ands r1, r0 - lsls r1, 5 - movs r0, 0x21 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0xB] - mov r2, sp - ldrb r1, [r6, 0x8] - mov r6, r12 - ands r6, r1 - lsls r1, r6, 6 - mov r3, r10 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0xB] - ldr r4, [sp, 0x1C] - lsrs r3, r4, 21 - ldrb r1, [r2, 0xA] - movs r0, 0x7 - ands r0, r1 - orrs r0, r3 - strb r0, [r2, 0xA] - mov r1, sp - ldr r5, [sp, 0x4C] - movs r6, 0x1 - ands r5, r6 - lsls r2, r5, 1 - ldrb r0, [r1, 0xB] - mov r3, r8 - ands r3, r0 - orrs r3, r2 - mov r8, r3 - strb r3, [r1, 0xB] - mov r0, sp - ldr r4, [sp, 0x50] - ands r4, r6 - mov r5, r8 - ands r5, r7 - orrs r5, r4 - strb r5, [r0, 0xB] - bl sub_800FE50 - 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_8027E30 - - thumb_func_start sub_8028164 -sub_8028164: @ 8028164 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r7, r1, 0 - adds r5, r2, 0 - adds r6, r3, 0 - ldr r0, [sp, 0x1C] - mov r12, r0 - ldr r1, [sp, 0x20] - mov r8, r1 - ldr r0, [sp, 0x24] - mov r9, r0 - adds r2, r7, 0 - adds r2, 0x14 - ldr r4, =0x03003090 - ldrh r0, [r4] - movs r1, 0xFF - lsls r1, 8 - ands r1, r0 - movs r0, 0xBC - lsls r0, 6 - cmp r1, r0 - bne _0802819C - adds r3, r4, 0x2 - ldrb r0, [r4, 0x2] - cmp r0, 0x2 - beq _080281A4 -_0802819C: - movs r0, 0 - b _080282DE - .pool -_080281A4: - ldrb r0, [r3, 0x1] - lsls r0, 28 - lsrs r0, 28 - strb r0, [r2, 0xB] - ldrb r0, [r3, 0x1] - lsrs r0, 4 - strb r0, [r2, 0xC] - ldrb r0, [r3, 0x2] - lsls r0, 28 - lsrs r0, 28 - strb r0, [r2, 0xD] - ldrb r0, [r3, 0x2] - lsrs r0, 4 - strb r0, [r2, 0xE] - ldrb r0, [r3, 0x3] - lsls r0, 28 - lsrs r0, 28 - strb r0, [r2, 0xF] - ldrb r0, [r3, 0x3] - lsrs r0, 4 - strb r0, [r2, 0x10] - ldrb r0, [r3, 0x4] - lsls r0, 28 - lsrs r0, 28 - strb r0, [r2, 0x11] - ldrb r0, [r3, 0x4] - lsrs r0, 4 - strb r0, [r2, 0x12] - ldrb r0, [r3, 0x5] - lsls r0, 28 - lsrs r0, 28 - strb r0, [r2, 0x13] - ldrb r0, [r3, 0x5] - lsrs r0, 4 - strb r0, [r2, 0x14] - ldrb r0, [r3, 0x1] - lsls r0, 28 - lsrs r0, 28 - strb r0, [r2, 0x15] - ldrb r0, [r3, 0x6] - lsls r0, 30 - lsrs r0, 30 - strb r0, [r7, 0x14] - ldrb r0, [r3, 0x6] - lsls r0, 28 - lsrs r0, 30 - strb r0, [r2, 0x1] - ldrb r0, [r3, 0x6] - lsls r0, 26 - lsrs r0, 30 - strb r0, [r2, 0x2] - ldrb r0, [r3, 0x6] - lsrs r0, 6 - strb r0, [r2, 0x3] - ldrb r0, [r3, 0x7] - lsls r0, 30 - lsrs r0, 30 - strb r0, [r2, 0x4] - ldrb r0, [r3, 0x7] - lsls r0, 28 - lsrs r0, 30 - strb r0, [r2, 0x5] - ldrb r0, [r3, 0x7] - lsls r0, 26 - lsrs r0, 30 - strb r0, [r2, 0x6] - ldrb r0, [r3, 0x7] - lsrs r0, 6 - strb r0, [r2, 0x7] - ldrb r0, [r3, 0x8] - lsls r0, 30 - lsrs r0, 30 - strb r0, [r2, 0x8] - ldrb r0, [r3, 0x8] - lsls r0, 28 - lsrs r0, 30 - strb r0, [r2, 0x9] - ldrb r0, [r3, 0x6] - lsls r0, 30 - lsrs r0, 30 - strb r0, [r2, 0xA] - ldrb r0, [r3, 0x8] - lsls r0, 26 - lsrs r0, 30 - strb r0, [r5] - ldrb r0, [r3, 0x9] - lsls r0, 25 - lsrs r0, 31 - strb r0, [r5, 0x4] - ldrb r0, [r3, 0xB] - lsls r0, 29 - lsrs r0, 31 - strb r0, [r5, 0x8] - ldrb r0, [r3, 0x8] - lsrs r0, 6 - strb r0, [r6] - ldrb r0, [r3, 0x9] - lsrs r0, 7 - strb r0, [r6, 0x4] - ldrb r0, [r3, 0xB] - lsls r0, 28 - lsrs r0, 31 - strb r0, [r6, 0x8] - ldrb r0, [r3, 0x9] - lsls r0, 30 - lsrs r0, 30 - mov r1, r12 - strb r0, [r1] - ldrb r0, [r3, 0xA] - lsls r0, 31 - lsrs r0, 31 - strb r0, [r1, 0x4] - ldrb r0, [r3, 0xB] - lsls r0, 27 - lsrs r0, 31 - strb r0, [r1, 0x8] - ldrb r0, [r3, 0x9] - lsls r0, 28 - lsrs r0, 30 - mov r1, r8 - strb r0, [r1] - ldrb r0, [r3, 0xA] - lsls r0, 30 - lsrs r0, 31 - strb r0, [r1, 0x4] - ldrb r0, [r3, 0xB] - lsls r0, 26 - lsrs r0, 31 - strb r0, [r1, 0x8] - ldrb r0, [r3, 0x9] - lsls r0, 26 - lsrs r0, 30 - mov r1, r9 - strb r0, [r1] - ldrb r0, [r3, 0xA] - lsls r0, 29 - lsrs r0, 31 - strb r0, [r1, 0x4] - ldrb r0, [r3, 0xB] - lsls r0, 25 - lsrs r0, 31 - strb r0, [r1, 0x8] - ldrb r0, [r3, 0xA] - lsrs r0, 3 - ldr r1, [sp, 0x28] - strb r0, [r1] - ldrb r0, [r3, 0xB] - lsls r0, 30 - lsrs r0, 31 - ldr r1, [sp, 0x2C] - str r0, [r1] - ldrb r0, [r3, 0xB] - lsls r0, 31 - lsrs r0, 31 - ldr r1, [sp, 0x30] - str r0, [r1] - movs r0, 0x1 -_080282DE: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8028164 - - thumb_func_start sub_80282EC -sub_80282EC: @ 80282EC - push {lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - ldr r3, =0xffffff00 - ldr r1, [sp] - ands r1, r3 - movs r2, 0x3 - orrs r1, r2 - str r1, [sp] - ldr r1, [sp, 0x4] - ands r1, r3 - orrs r1, r0 - str r1, [sp, 0x4] - mov r0, sp - bl sub_800FE50 - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80282EC - - thumb_func_start sub_8028318 -sub_8028318: @ 8028318 - push {r4,lr} - adds r2, r0, 0 - adds r4, r1, 0 - ldr r3, =0x03003090 - ldrh r0, [r3] - movs r1, 0xFF - lsls r1, 8 - ands r1, r0 - movs r0, 0xBC - lsls r0, 6 - cmp r1, r0 - bne _0802833C - lsls r0, r2, 4 - adds r1, r3, 0x2 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0x3 - beq _08028344 -_0802833C: - movs r0, 0 - b _0802834A - .pool -_08028344: - ldrb r0, [r1, 0x4] - strb r0, [r4] - movs r0, 0x1 -_0802834A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8028318 - - thumb_func_start sub_8028350 -sub_8028350: @ 8028350 - push {lr} - sub sp, 0x8 - ldr r2, =0xffffff00 - ldr r1, [sp] - ands r1, r2 - movs r2, 0x4 - orrs r1, r2 - str r1, [sp] - str r0, [sp, 0x4] - mov r0, sp - bl sub_800FE50 - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8028350 - - thumb_func_start sub_8028374 -sub_8028374: @ 8028374 - push {lr} - adds r2, r0, 0 - ldr r3, =0x03003090 - ldrh r0, [r3] - movs r1, 0xFF - lsls r1, 8 - ands r1, r0 - movs r0, 0xBC - lsls r0, 6 - cmp r1, r0 - bne _08028396 - lsls r0, r2, 4 - adds r1, r3, 0x2 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0x4 - beq _080283A0 -_08028396: - movs r0, 0 - b _080283A2 - .pool -_080283A0: - ldr r0, [r1, 0x4] -_080283A2: - pop {r1} - bx r1 - thumb_func_end sub_8028374 - - thumb_func_start sub_80283A8 -sub_80283A8: @ 80283A8 - push {r4,r5,lr} - sub sp, 0x18 - movs r5, 0xC0 - lsls r5, 6 - adds r0, r5, 0 - bl AllocZeroed - adds r4, r0, 0 - ldr r0, =gUnknown_082FB2D8 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp, 0x8] - str r1, [sp, 0xC] - ldr r0, =gUnknown_082FB2E0 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp, 0x10] - str r1, [sp, 0x14] - ldr r0, =gUnknown_082F98BC - adds r1, r4, 0 - bl LZ77UnCompWram - cmp r4, 0 - beq _080283E8 - str r4, [sp] - str r5, [sp, 0x4] - mov r0, sp - bl LoadObjectPic - adds r0, r4, 0 - bl Free -_080283E8: - add r0, sp, 0x8 - bl LoadTaggedObjectPalette - add r0, sp, 0x10 - bl LoadTaggedObjectPalette - add sp, 0x18 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80283A8 - - thumb_func_start sub_8028408 -sub_8028408: @ 8028408 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x30 - adds r6, r1, 0 - mov r8, r2 - adds r5, r3, 0 - lsls r6, 24 - lsrs r6, 24 - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - lsls r5, 24 - lsrs r5, 24 - add r1, sp, 0x18 - movs r3, 0 - strh r3, [r1] - ldrb r2, [r0] - mov r0, sp - adds r0, 0x1A - strh r2, [r0] - ldr r0, =gUnknown_082FB1E0 - str r0, [sp, 0x1C] - ldr r0, =gUnknown_082FB228 - str r0, [sp, 0x20] - str r3, [sp, 0x24] - ldr r0, =gDummyObjectRotScalAnimTable - str r0, [sp, 0x28] - ldr r0, =sub_80284A8 - str r0, [sp, 0x2C] - mov r0, sp - movs r2, 0x18 - bl memcpy - movs r0, 0x4 - bl AllocZeroed - ldr r1, =0x02022c9c - mov r2, r8 - lsls r4, r2, 2 - adds r4, r1 - str r0, [r4] - adds r0, r6, 0 - adds r1, r5, 0 - bl sub_8028F14 - adds r1, r0, 0 - lsls r1, 16 - asrs r1, 16 - mov r0, sp - movs r2, 0x88 - movs r3, 0x3 - bl AddObjectToFront - ldr r1, [r4] - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1] - movs r0, 0x1 - mov r1, r8 - bl sub_8028654 - add sp, 0x30 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8028408 - - thumb_func_start sub_80284A8 -sub_80284A8: @ 80284A8 - push {lr} - movs r2, 0x2E - ldrsh r1, [r0, r2] - cmp r1, 0x1 - beq _080284BC - cmp r1, 0x1 - ble _080284C6 - cmp r1, 0x2 - beq _080284C2 - b _080284C6 -_080284BC: - bl sub_802853C - b _080284C6 -_080284C2: - bl sub_80285AC -_080284C6: - pop {r0} - bx r0 - thumb_func_end sub_80284A8 - - thumb_func_start sub_80284CC -sub_80284CC: @ 80284CC - push {lr} - bl link_get_multiplayer_id - ldr r1, =0x02022c9c - lsls r0, 24 - lsrs r0, 22 - adds r0, r1 - ldr r0, [r0] - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r2, 0 - movs r1, 0x1 - strh r1, [r0, 0x2E] - strh r2, [r0, 0x30] - strh r2, [r0, 0x32] - strh r2, [r0, 0x34] - strh r2, [r0, 0x36] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80284CC - - thumb_func_start sub_8028504 -sub_8028504: @ 8028504 - push {lr} - bl link_get_multiplayer_id - ldr r1, =0x02022c9c - lsls r0, 24 - lsrs r0, 22 - adds r0, r1 - ldr r0, [r0] - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r2, 0 - movs r1, 0x2 - strh r1, [r0, 0x2E] - strh r2, [r0, 0x30] - strh r2, [r0, 0x32] - strh r2, [r0, 0x34] - strh r2, [r0, 0x36] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8028504 - - thumb_func_start sub_802853C -sub_802853C: @ 802853C - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r2, r0, 16 - lsrs r0, 31 - adds r0, r2, r0 - asrs r1, r0, 1 - adds r0, r1, 0 - cmp r1, 0 - bge _08028558 - adds r0, r1, 0x3 -_08028558: - asrs r0, 2 - lsls r0, 2 - subs r0, r1, r0 - lsls r0, 24 - lsrs r0, 24 - cmp r2, 0x2 - ble _080285A2 - cmp r0, 0x2 - bgt _0802856E - cmp r0, 0x1 - bge _08028572 -_0802856E: - movs r0, 0x1 - b _08028574 -_08028572: - movs r0, 0xFF -_08028574: - lsls r0, 24 - asrs r0, 24 - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x27 - ble _080285A2 - movs r0, 0 - strh r0, [r4, 0x2E] - bl sub_8027650 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0 - bl sub_8028F14 - strh r0, [r4, 0x20] -_080285A2: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802853C - - thumb_func_start sub_80285AC -sub_80285AC: @ 80285AC - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r0, [r5, 0x30] - adds r0, 0x1 - strh r0, [r5, 0x30] - lsls r0, 16 - asrs r0, 16 - movs r1, 0xD - bl __divsi3 - lsls r0, 16 - asrs r1, r0, 16 - adds r0, r1, 0 - cmp r1, 0 - bge _080285CC - adds r0, r1, 0x3 -_080285CC: - asrs r0, 2 - lsls r0, 2 - subs r0, r1, r0 - lsls r0, 24 - lsrs r4, r0, 24 - movs r1, 0x30 - ldrsh r0, [r5, r1] - movs r1, 0xD - bl __modsi3 - lsls r0, 16 - cmp r0, 0 - bne _080285F0 - cmp r4, 0 - beq _080285F0 - movs r0, 0xD4 - bl audio_play -_080285F0: - movs r1, 0x30 - ldrsh r0, [r5, r1] - cmp r0, 0x67 - ble _080285FE - movs r0, 0 - strh r0, [r5, 0x2E] - movs r4, 0 -_080285FE: - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - bl sub_80286B4 - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80285AC - - thumb_func_start sub_8028614 -sub_8028614: @ 8028614 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - cmp r4, r5 - bcs _08028646 - ldr r6, =0x02022c9c -_08028622: - lsls r0, r4, 2 - adds r0, r6 - ldr r0, [r0] - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - cmp r0, 0 - beq _0802863C - bl RemoveObjectAndFreeResources -_0802863C: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _08028622 -_08028646: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8028614 - - thumb_func_start sub_8028654 -sub_8028654: @ 8028654 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - ldr r3, =0x02020630 - ldr r2, =0x02022c9c - lsrs r1, 22 - adds r1, r2 - ldr r1, [r1] - ldrh r1, [r1] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - adds r2, r3 - adds r2, 0x3E - movs r1, 0x1 - ands r0, r1 - lsls r0, 2 - ldrb r3, [r2] - movs r1, 0x5 - negs r1, r1 - ands r1, r3 - orrs r1, r0 - strb r1, [r2] - bx lr - .pool - thumb_func_end sub_8028654 - - thumb_func_start sub_802868C -sub_802868C: @ 802868C - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - movs r4, 0 - cmp r4, r5 - bcs _080286AE -_0802869C: - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_8028654 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _0802869C -_080286AE: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_802868C - - thumb_func_start sub_80286B4 -sub_80286B4: @ 80286B4 - push {lr} - lsls r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =0x02022c9c - lsrs r0, 22 - adds r0, r2 - ldr r0, [r0] - ldrh r2, [r0] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02020630 - adds r0, r2 - bl StartObjectImageAnim - pop {r0} - bx r0 - .pool - thumb_func_end sub_80286B4 - - thumb_func_start nullsub_15 -nullsub_15: @ 80286E0 - bx lr - thumb_func_end nullsub_15 - - thumb_func_start sub_80286E4 -sub_80286E4: @ 80286E4 - push {r4-r7,lr} - movs r4, 0 - ldr r0, =0x02020630 - mov r12, r0 - movs r6, 0 - ldr r5, =0x02022cf4 -_080286F0: - ldr r3, [r5] - lsls r1, r4, 1 - adds r0, r3, 0 - adds r0, 0x2A - adds r0, r1 - ldrh r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r12 - lsls r0, r4, 4 - adds r0, 0x30 - strh r0, [r1, 0x20] - lsls r2, r4, 3 - movs r7, 0x8 - negs r7, r7 - adds r0, r7, 0 - subs r0, r2 - strh r0, [r1, 0x22] - adds r3, 0xC - adds r3, r4 - strb r6, [r3] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x9 - bls _080286F0 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80286E4 - - thumb_func_start sub_8028734 -sub_8028734: @ 8028734 - push {r4-r6,lr} - sub sp, 0x28 - movs r4, 0xC0 - lsls r4, 1 - adds r0, r4, 0 - bl AllocZeroed - adds r6, r0, 0 - ldr r0, =gUnknown_082FB2E8 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp, 0x20] - str r1, [sp, 0x24] - ldr r0, =gUnknown_082F96E0 - adds r1, r6, 0 - bl LZ77UnCompWram - cmp r6, 0 - beq _080287C4 - str r6, [sp, 0x18] - add r5, sp, 0x18 - movs r0, 0x80 - lsls r0, 9 - orrs r0, r4 - str r0, [r5, 0x4] - mov r1, sp - ldr r0, =gUnknown_082FB2F0 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldr r4, =0x02022cf4 - movs r0, 0x40 - bl AllocZeroed - str r0, [r4] - adds r0, r5, 0 - bl LoadObjectPic - add r0, sp, 0x20 - bl LoadTaggedObjectPalette - movs r4, 0 -_0802878A: - lsls r1, r4, 20 - movs r0, 0xC0 - lsls r0, 14 - adds r1, r0 - asrs r1, 16 - lsls r0, r4, 3 - movs r3, 0x8 - negs r3, r3 - adds r2, r3, 0 - subs r2, r0 - lsls r2, 16 - asrs r2, 16 - mov r0, sp - movs r3, 0 - bl AddObjectToFront - ldr r1, =0x02022cf4 - ldr r1, [r1] - lsls r2, r4, 1 - adds r1, 0x2A - adds r1, r2 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x9 - bls _0802878A -_080287C4: - adds r0, r6, 0 - bl Free - add sp, 0x28 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8028734 - - thumb_func_start sub_80287E4 -sub_80287E4: @ 80287E4 - push {r4,r5,lr} - movs r4, 0 -_080287E8: - ldr r5, =0x02022cf4 - ldr r0, [r5] - lsls r1, r4, 1 - adds r0, 0x2A - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - cmp r0, 0 - beq _08028806 - bl RemoveObjectAndFreeResources -_08028806: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x9 - bls _080287E8 - ldr r0, [r5] - bl Free - movs r0, 0 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80287E4 - - thumb_func_start sub_8028828 -sub_8028828: @ 8028828 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - movs r3, 0 - movs r6, 0 - ldr r0, =0x02022cf4 - mov r9, r0 -_0802883A: - mov r7, r9 - ldr r2, [r7] - lsls r5, r6, 1 - adds r0, r2, 0 - adds r0, 0x2A - adds r0, r5 - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r4, r0, r1 - adds r0, r2, 0 - adds r0, 0x16 - adds r0, r5 - movs r1, 0x2 - strh r1, [r0] - adds r0, r2, 0 - adds r0, 0xC - adds r2, r0, r6 - ldrb r1, [r2] - cmp r1, 0 - beq _08028870 - movs r7, 0x22 - ldrsh r0, [r4, r7] - cmp r0, 0x8 - beq _080288A6 -_08028870: - movs r3, 0x1 - movs r7, 0x22 - ldrsh r0, [r4, r7] - cmp r0, 0x8 - bne _08028896 - cmp r1, 0 - bne _080288A6 - strb r3, [r2] - mov r1, r9 - ldr r0, [r1] - adds r0, 0x16 - adds r0, r5 - ldr r1, =0x0000fff0 - strh r1, [r0] - movs r0, 0x24 - str r3, [sp] - bl audio_play - ldr r3, [sp] -_08028896: - mov r7, r9 - ldr r0, [r7] - adds r0, 0x16 - adds r0, r5 - ldrh r0, [r0] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] -_080288A6: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x9 - bls _0802883A - cmp r3, 0 - bne _080288C4 - movs r0, 0x1 - b _080288C6 - .pool -_080288C4: - movs r0, 0 -_080288C6: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8028828 - - thumb_func_start sub_80288D4 -sub_80288D4: @ 80288D4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0xA - bls _08028910 - movs r4, 0 -_080288E0: - ldr r0, =0x02022cf4 - ldr r0, [r0] - lsls r1, r4, 1 - adds r0, 0x2A - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r1, 0x1 - bl StartObjectImageAnim - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x9 - bls _080288E0 - b _080289DA - .pool -_08028910: - movs r4, 0 - movs r0, 0xA - subs r0, r5 - cmp r4, r0 - bge _080289D6 - ldr r6, =0x02020630 -_0802891C: - cmp r5, 0x6 - bls _08028984 - ldr r0, =0x02022cf4 - ldr r2, [r0] - ldr r1, =0x0000fffa - adds r0, r1, 0 - ldrh r1, [r2, 0x3E] - adds r0, r1 - adds r0, r5 - movs r1, 0 - strh r0, [r2, 0x3E] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1E - bls _0802894C - strh r1, [r2, 0x3E] - b _0802899E - .pool -_0802894C: - cmp r0, 0xA - bls _0802896A - lsls r1, r4, 1 - adds r0, r2, 0 - adds r0, 0x2A - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x2 - bl StartObjectImageAnim - b _0802899E -_0802896A: - lsls r1, r4, 1 - adds r0, r2, 0 - adds r0, 0x2A - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0 - bl StartObjectImageAnim - b _0802899E -_08028984: - ldr r0, =0x02022cf4 - ldr r0, [r0] - lsls r1, r4, 1 - adds r0, 0x2A - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0 - bl StartObjectImageAnim -_0802899E: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0xA - subs r0, r5 - cmp r4, r0 - blt _0802891C - b _080289D6 - .pool -_080289B4: - ldr r0, =0x02022cf4 - ldr r0, [r0] - lsls r1, r4, 1 - adds r0, 0x2A - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r1, 0x1 - bl StartObjectImageAnim - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_080289D6: - cmp r4, 0x9 - bls _080289B4 -_080289DA: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80288D4 - - thumb_func_start sub_80289E8 -sub_80289E8: @ 80289E8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - movs r3, 0 - ldr r7, =0x02020630 - movs r1, 0x1 - ands r0, r1 - lsls r4, r0, 2 - movs r6, 0x5 - negs r6, r6 - ldr r5, =0x02022cf4 -_080289FE: - ldr r0, [r5] - lsls r1, r3, 1 - adds r0, 0x2A - adds r0, r1 - ldrh r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r7 - adds r1, 0x3E - ldrb r2, [r1] - adds r0, r6, 0 - ands r0, r2 - orrs r0, r4 - strb r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x9 - bls _080289FE - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80289E8 - - thumb_func_start sub_8028A34 -sub_8028A34: @ 8028A34 - push {r4,r5,lr} - sub sp, 0x10 - movs r5, 0x90 - lsls r5, 3 - adds r0, r5, 0 - bl AllocZeroed - adds r4, r0, 0 - ldr r0, =gUnknown_082FB314 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp, 0x8] - str r1, [sp, 0xC] - ldr r0, =gUnknown_082F7EB0 - adds r1, r4, 0 - bl LZ77UnCompWram - cmp r4, 0 - beq _08028A6A - str r4, [sp] - movs r0, 0x80 - lsls r0, 10 - orrs r0, r5 - str r0, [sp, 0x4] - mov r0, sp - bl LoadObjectPic -_08028A6A: - add r0, sp, 0x8 - bl LoadTaggedObjectPalette - adds r0, r4, 0 - bl Free - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8028A34 - - thumb_func_start sub_8028A88 -sub_8028A88: @ 8028A88 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x30 - mov r1, sp - ldr r0, =gUnknown_082FB324 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - add r2, sp, 0x18 - adds r1, r2, 0 - ldr r0, =gUnknown_082FB33C - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - movs r5, 0 - mov r9, r2 -_08028AB0: - movs r0, 0x4 - bl AllocZeroed - ldr r1, =0x02022cb8 - lsls r4, r5, 2 - adds r4, r1 - str r0, [r4] - lsls r0, r5, 3 - lsls r1, r5, 4 - adds r1, r0 - mov r0, sp - movs r2, 0x8 - movs r3, 0x1 - bl AddObjectToFront - ldr r1, [r4] - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1] - adds r0, r5, 0 - movs r1, 0x1 - bl sub_8028BF8 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0xA - bls _08028AB0 - movs r5, 0 - ldr r7, =0x02022ce4 - ldr r4, =gUnknown_082FB31C - mov r8, r4 -_08028AF0: - movs r0, 0x4 - bl AllocZeroed - lsls r1, r5, 2 - adds r4, r1, r7 - str r0, [r4] - adds r6, r1, 0 - cmp r5, 0x3 - bne _08028B2C - mov r0, r8 - movs r2, 0x6 - ldrsh r1, [r0, r2] - mov r0, r9 - movs r2, 0x31 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r7, 0xC] - b _08028B40 - .pool -_08028B2C: - lsls r0, r5, 1 - add r0, r8 - movs r3, 0 - ldrsh r1, [r0, r3] - mov r0, r9 - movs r2, 0x34 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r4] -_08028B40: - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1] - adds r0, r6, r7 - ldr r0, [r0] - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - adds r1, r5, 0 - bl StartObjectImageAnim - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _08028AF0 - movs r0, 0x1 - bl sub_8028C30 - add sp, 0x30 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8028A88 - - thumb_func_start sub_8028B80 -sub_8028B80: @ 8028B80 - push {r4-r6,lr} - movs r5, 0 - ldr r6, =0x02022cb8 -_08028B86: - lsls r0, r5, 2 - adds r4, r0, r6 - ldr r0, [r4] - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - cmp r0, 0 - beq _08028BA0 - bl RemoveObjectAndFreeTiles -_08028BA0: - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0xA - bls _08028B86 - movs r5, 0 - ldr r6, =0x02022ce4 -_08028BB8: - lsls r0, r5, 2 - adds r4, r0, r6 - ldr r0, [r4] - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - cmp r0, 0 - beq _08028BD2 - bl RemoveObjectAndFreeTiles -_08028BD2: - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _08028BB8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8028B80 - - thumb_func_start sub_8028BF8 -sub_8028BF8: @ 8028BF8 - lsls r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =0x02020630 - ldr r2, =0x02022cb8 - lsrs r0, 22 - adds r0, r2 - ldr r0, [r0] - ldrh r0, [r0] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r3 - adds r2, 0x3E - movs r0, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r3, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - bx lr - .pool - thumb_func_end sub_8028BF8 - - thumb_func_start sub_8028C30 -sub_8028C30: @ 8028C30 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - movs r3, 0 - ldr r7, =0x02020630 - ldr r6, =0x02022ce4 - movs r1, 0x1 - ands r0, r1 - lsls r4, r0, 2 - movs r5, 0x5 - negs r5, r5 -_08028C46: - lsls r0, r3, 2 - adds r0, r6 - ldr r0, [r0] - ldrh r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r7 - adds r1, 0x3E - ldrb r2, [r1] - adds r0, r5, 0 - ands r0, r2 - orrs r0, r4 - strb r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x3 - bls _08028C46 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8028C30 - - thumb_func_start sub_8028C7C -sub_8028C7C: @ 8028C7C - lsls r0, 24 - lsls r1, 24 - ldr r3, =0x02020630 - ldr r2, =0x02022cb8 - lsrs r0, 22 - adds r0, r2 - ldr r0, [r0] - ldrh r2, [r0] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r3 - lsrs r1, 21 - strh r1, [r0, 0x22] - bx lr - .pool - thumb_func_end sub_8028C7C - - thumb_func_start sub_8028CA4 -sub_8028CA4: @ 8028CA4 - push {lr} - lsls r0, 16 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =0x02022cb8 - lsrs r0, 14 - adds r0, r2 - ldr r0, [r0] - ldrh r2, [r0] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02020630 - adds r0, r2 - bl StartObjectImageAnim - pop {r0} - bx r0 - .pool - thumb_func_end sub_8028CA4 - - thumb_func_start sub_8028CD0 -sub_8028CD0: @ 8028CD0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02020630 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r1 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, 0x32 - strh r1, [r2, 0x20] - movs r0, 0x32 - strh r0, [r2, 0x22] - bx lr - .pool - thumb_func_end sub_8028CD0 - - thumb_func_start sub_8028CF4 -sub_8028CF4: @ 8028CF4 - push {r4-r7,lr} - adds r4, r0, 0 - adds r0, 0x42 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0x1 - beq _08028D36 - movs r3, 0 - ldr r7, =gUnknown_082FB354 - ldr r6, =0x02022cb0 - movs r5, 0 -_08028D0A: - lsls r0, r3, 2 - adds r2, r0, r6 - ldr r1, [r2] - ldrh r0, [r1, 0x2] - adds r0, 0x1 - strh r0, [r1, 0x2] - adds r1, r3, r7 - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r1] - cmp r0, r1 - bls _08028D2C - ldrh r0, [r4, 0x20] - subs r0, 0x1 - strh r0, [r4, 0x20] - ldr r0, [r2] - strh r5, [r0, 0x2] -_08028D2C: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x1 - bls _08028D0A -_08028D36: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8028CF4 - - thumb_func_start sub_8028D44 -sub_8028D44: @ 8028D44 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x28 - movs r4, 0x80 - lsls r4, 3 - adds r0, r4, 0 - bl AllocZeroed - adds r6, r0, 0 - ldr r0, =gUnknown_082FB360 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp, 0x20] - str r1, [sp, 0x24] - ldr r0, =gUnknown_082F9774 - adds r1, r6, 0 - bl LZ77UnCompWram - cmp r6, 0 - beq _08028DD2 - str r6, [sp, 0x18] - add r0, sp, 0x18 - movs r1, 0xA0 - lsls r1, 11 - orrs r1, r4 - str r1, [r0, 0x4] - mov r2, sp - ldr r1, =gUnknown_082FB368 - ldm r1!, {r3-r5} - stm r2!, {r3-r5} - ldm r1!, {r3-r5} - stm r2!, {r3-r5} - bl LoadObjectPic - add r0, sp, 0x20 - bl LoadTaggedObjectPalette - movs r5, 0 - ldr r7, =gUnknown_082FB356 - adds r0, r7, 0x2 - mov r9, r0 - ldr r1, =0x02022cb0 - mov r8, r1 -_08028D9E: - movs r0, 0x4 - bl AllocZeroed - lsls r2, r5, 2 - mov r3, r8 - adds r4, r2, r3 - str r0, [r4] - adds r0, r2, r7 - movs r3, 0 - ldrsh r1, [r0, r3] - add r2, r9 - movs r0, 0 - ldrsh r2, [r2, r0] - mov r0, sp - movs r3, 0x4 - bl AddObjectToFront - ldr r1, [r4] - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bls _08028D9E -_08028DD2: - adds r0, r6, 0 - bl Free - add sp, 0x28 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8028D44 - - thumb_func_start sub_8028DFC -sub_8028DFC: @ 8028DFC - push {r4-r7,lr} - movs r3, 0 - ldr r0, =0x02022cb0 - mov r12, r0 - ldr r4, =gUnknown_082FB356 - adds r7, r4, 0x2 - ldr r6, =0x02020630 - movs r5, 0x1 -_08028E0C: - lsls r2, r3, 2 - mov r1, r12 - adds r0, r2, r1 - ldr r0, [r0] - ldrh r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - adds r0, r1, 0 - adds r0, 0x42 - strh r5, [r0] - adds r0, r2, r4 - ldrh r0, [r0] - strh r0, [r1, 0x20] - adds r2, r7 - ldrh r0, [r2] - strh r0, [r1, 0x22] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x1 - bls _08028E0C - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8028DFC - - thumb_func_start sub_8028E4C -sub_8028E4C: @ 8028E4C - push {r4,r5,lr} - movs r2, 0 - ldr r5, =0x02022cb0 - ldr r4, =0x02020630 - movs r3, 0 -_08028E56: - lsls r0, r2, 2 - adds r0, r5 - ldr r0, [r0] - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x42 - strh r3, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x1 - bls _08028E56 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8028E4C - - thumb_func_start sub_8028E84 -sub_8028E84: @ 8028E84 - push {r4-r6,lr} - movs r5, 0 - ldr r6, =0x02022cb0 -_08028E8A: - lsls r0, r5, 2 - adds r4, r0, r6 - ldr r0, [r4] - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - cmp r0, 0 - beq _08028EA4 - bl RemoveObjectAndFreeTiles -_08028EA4: - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bls _08028E8A - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8028E84 - - thumb_func_start sub_8028EC8 -sub_8028EC8: @ 8028EC8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - movs r3, 0 - ldr r7, =0x02020630 - ldr r6, =0x02022cb0 - movs r1, 0x1 - ands r0, r1 - lsls r4, r0, 2 - movs r5, 0x5 - negs r5, r5 -_08028EDE: - lsls r0, r3, 2 - adds r0, r6 - ldr r0, [r0] - ldrh r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r7 - adds r1, 0x3E - ldrb r2, [r1] - adds r0, r5, 0 - ands r0, r2 - orrs r0, r4 - strb r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x1 - bls _08028EDE - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8028EC8 - - thumb_func_start sub_8028F14 -sub_8028F14: @ 8028F14 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 24 - lsrs r1, 24 - movs r3, 0 - subs r0, r1, 0x1 - cmp r0, 0x4 - bhi _08028FC6 - lsls r0, 2 - ldr r1, =_08028F34 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08028F34: - .4byte _08028FB4 - .4byte _08028F48 - .4byte _08028F52 - .4byte _08028F66 - .4byte _08028F8E -_08028F48: - cmp r2, 0 - beq _08028F7E - cmp r2, 0x1 - bne _08028FC6 - b _08028F82 -_08028F52: - cmp r2, 0x1 - beq _08028FB8 - cmp r2, 0x1 - bgt _08028F60 - cmp r2, 0 - beq _08028FB4 - b _08028FC6 -_08028F60: - cmp r2, 0x2 - bne _08028FC6 - b _08028FC4 -_08028F66: - cmp r2, 0x1 - beq _08028F82 - cmp r2, 0x1 - bgt _08028F74 - cmp r2, 0 - beq _08028F7E - b _08028FC6 -_08028F74: - cmp r2, 0x2 - beq _08028F86 - cmp r2, 0x3 - beq _08028F8A - b _08028FC6 -_08028F7E: - movs r3, 0xC - b _08028FC6 -_08028F82: - movs r3, 0x12 - b _08028FC6 -_08028F86: - movs r3, 0x18 - b _08028FC6 -_08028F8A: - movs r3, 0x6 - b _08028FC6 -_08028F8E: - cmp r2, 0x4 - bhi _08028FC6 - lsls r0, r2, 2 - ldr r1, =_08028FA0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08028FA0: - .4byte _08028FB4 - .4byte _08028FB8 - .4byte _08028FBC - .4byte _08028FC0 - .4byte _08028FC4 -_08028FB4: - movs r3, 0xF - b _08028FC6 -_08028FB8: - movs r3, 0x15 - b _08028FC6 -_08028FBC: - movs r3, 0x1B - b _08028FC6 -_08028FC0: - movs r3, 0x3 - b _08028FC6 -_08028FC4: - movs r3, 0x9 -_08028FC6: - lsls r0, r3, 3 - pop {r1} - bx r1 - thumb_func_end sub_8028F14 - - thumb_func_start sub_8028FCC -sub_8028FCC: @ 8028FCC - push {r4,lr} - movs r4, 0 -_08028FD0: - adds r0, r4, 0 - movs r1, 0x1 - bl sub_8028BF8 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_8028C7C - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xA - bls _08028FD0 - movs r0, 0 - bl sub_80289E8 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8028FCC - - thumb_func_start sub_8028FF8 -sub_8028FF8: @ 8028FF8 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl sub_8098758 - ldr r1, [r0] - movs r2, 0x90 - lsls r2, 1 - movs r0, 0 - movs r3, 0x1 - bl LoadBgTiles - adds r0, r4, 0 - bl sub_8098758 - ldr r0, [r0, 0x4] - movs r1, 0xA0 - movs r2, 0x20 - bl gpu_pal_apply - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8028FF8 - - thumb_func_start sub_802902C -sub_802902C: @ 802902C - push {lr} - movs r0, 0 - movs r1, 0xA - movs r2, 0xB0 - bl box_border_load_tiles_and_pal - pop {r0} - bx r0 - thumb_func_end sub_802902C - - thumb_func_start sub_802903C -sub_802903C: @ 802903C - ldr r3, =0x02022cf8 - ldr r0, [r3] - movs r2, 0xC0 - lsls r2, 6 - adds r1, r0, r2 - movs r2, 0 - str r2, [r1] - ldr r1, =0x00003014 - adds r0, r1 - strb r2, [r0] - ldr r0, [r3] - adds r1, 0x4 - adds r0, r1 - strb r2, [r0] - ldr r0, [r3] - adds r1, 0x8 - adds r0, r1 - strb r2, [r0] - ldr r0, [r3] - adds r1, 0x4 - adds r0, r1 - strb r2, [r0] - bx lr - .pool - thumb_func_end sub_802903C - - thumb_func_start sub_8029074 -sub_8029074: @ 8029074 - push {r4-r6,lr} - sub sp, 0xC - adds r4, r0, 0 - movs r6, 0xA - ldrb r2, [r4, 0x1] - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldrb r3, [r4, 0x2] - subs r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - movs r5, 0x1 - str r5, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - bl FillBgTilemapBufferRect - ldrb r2, [r4, 0x1] - ldrb r3, [r4, 0x2] - subs r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - ldrb r0, [r4, 0x3] - str r0, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - movs r1, 0x2 - bl FillBgTilemapBufferRect - ldrb r2, [r4, 0x3] - ldrb r0, [r4, 0x1] - adds r2, r0 - lsls r2, 24 - lsrs r2, 24 - ldrb r3, [r4, 0x2] - subs r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - str r5, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - movs r1, 0x3 - bl FillBgTilemapBufferRect - ldrb r2, [r4, 0x1] - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldrb r3, [r4, 0x2] - str r5, [sp] - ldrb r0, [r4, 0x4] - str r0, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - movs r1, 0x4 - bl FillBgTilemapBufferRect - ldrb r2, [r4, 0x3] - ldrb r0, [r4, 0x1] - adds r2, r0 - lsls r2, 24 - lsrs r2, 24 - ldrb r3, [r4, 0x2] - str r5, [sp] - ldrb r0, [r4, 0x4] - str r0, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - movs r1, 0x6 - bl FillBgTilemapBufferRect - ldrb r2, [r4, 0x1] - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldrb r3, [r4, 0x4] - ldrb r0, [r4, 0x2] - adds r3, r0 - lsls r3, 24 - lsrs r3, 24 - str r5, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - movs r1, 0x7 - bl FillBgTilemapBufferRect - ldrb r2, [r4, 0x1] - ldrb r3, [r4, 0x4] - ldrb r0, [r4, 0x2] - adds r3, r0 - lsls r3, 24 - lsrs r3, 24 - ldrb r0, [r4, 0x3] - str r0, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - movs r1, 0x8 - bl FillBgTilemapBufferRect - ldrb r2, [r4, 0x3] - ldrb r0, [r4, 0x1] - adds r2, r0 - lsls r2, 24 - lsrs r2, 24 - ldrb r3, [r4, 0x4] - ldrb r4, [r4, 0x2] - adds r3, r4 - lsls r3, 24 - lsrs r3, 24 - str r5, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - movs r1, 0x9 - bl FillBgTilemapBufferRect - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8029074 - - thumb_func_start sub_8029174 -sub_8029174: @ 8029174 - push {r4-r6,lr} - sub sp, 0xC - adds r4, r0, 0 - movs r6, 0xB - ldrb r2, [r4, 0x1] - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldrb r3, [r4, 0x2] - subs r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - movs r5, 0x1 - str r5, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - movs r1, 0xA - bl FillBgTilemapBufferRect - ldrb r2, [r4, 0x1] - ldrb r3, [r4, 0x2] - subs r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - ldrb r0, [r4, 0x3] - str r0, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - movs r1, 0xB - bl FillBgTilemapBufferRect - ldrb r2, [r4, 0x3] - ldrb r0, [r4, 0x1] - adds r2, r0 - lsls r2, 24 - lsrs r2, 24 - ldrb r3, [r4, 0x2] - subs r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - str r5, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - movs r1, 0xC - bl FillBgTilemapBufferRect - ldrb r2, [r4, 0x1] - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldrb r3, [r4, 0x2] - str r5, [sp] - ldrb r0, [r4, 0x4] - str r0, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - movs r1, 0xD - bl FillBgTilemapBufferRect - ldrb r2, [r4, 0x3] - ldrb r0, [r4, 0x1] - adds r2, r0 - lsls r2, 24 - lsrs r2, 24 - ldrb r3, [r4, 0x2] - str r5, [sp] - ldrb r0, [r4, 0x4] - str r0, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - movs r1, 0xF - bl FillBgTilemapBufferRect - ldrb r2, [r4, 0x1] - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldrb r3, [r4, 0x4] - ldrb r0, [r4, 0x2] - adds r3, r0 - lsls r3, 24 - lsrs r3, 24 - str r5, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - movs r1, 0x10 - bl FillBgTilemapBufferRect - ldrb r2, [r4, 0x1] - ldrb r3, [r4, 0x4] - ldrb r0, [r4, 0x2] - adds r3, r0 - lsls r3, 24 - lsrs r3, 24 - ldrb r0, [r4, 0x3] - str r0, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - movs r1, 0x11 - bl FillBgTilemapBufferRect - ldrb r2, [r4, 0x3] - ldrb r0, [r4, 0x1] - adds r2, r0 - lsls r2, 24 - lsrs r2, 24 - ldrb r3, [r4, 0x4] - ldrb r4, [r4, 0x2] - adds r3, r4 - lsls r3, 24 - lsrs r3, 24 - str r5, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - movs r1, 0x12 - bl FillBgTilemapBufferRect - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8029174 - - thumb_func_start sub_8029274 -sub_8029274: @ 8029274 - push {r4,lr} - ldr r4, =0x02022cf8 - str r0, [r4] - movs r2, 0xC0 - lsls r2, 6 - adds r1, r0, r2 - movs r2, 0 - str r2, [r1] - ldr r3, =0x00003014 - adds r1, r0, r3 - strb r2, [r1] - ldr r1, =0x00003018 - adds r0, r1 - strb r2, [r0] - ldr r0, [r4] - adds r3, 0xC - adds r0, r3 - strb r2, [r0] - ldr r0, [r4] - adds r1, 0xC - adds r0, r1 - strb r2, [r0] - ldr r0, =sub_8029314 - movs r1, 0x3 - bl AddTask - ldr r1, [r4] - ldr r2, =0x00003004 - adds r1, r2 - strb r0, [r1] - ldr r0, =sub_8029338 - bl sub_802A72C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8029274 - - thumb_func_start sub_80292D4 -sub_80292D4: @ 80292D4 - push {lr} - bl FreeAllWindowBuffers - pop {r0} - bx r0 - thumb_func_end sub_80292D4 - - thumb_func_start sub_80292E0 -sub_80292E0: @ 80292E0 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - movs r4, 0 - ldr r5, =gUnknown_082FB40C - adds r7, r5, 0x4 -_080292EC: - lsls r1, r4, 3 - adds r0, r1, r5 - ldrb r0, [r0] - cmp r0, r6 - bne _080292FE - adds r0, r1, r7 - ldr r0, [r0] - bl sub_802A72C -_080292FE: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x9 - bls _080292EC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80292E0 - - thumb_func_start sub_8029314 -sub_8029314: @ 8029314 - push {lr} - ldr r0, =0x02022cf8 - ldr r0, [r0] - movs r1, 0xC0 - lsls r1, 6 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - bne _0802932E - bl sub_802A75C - bl _call_via_r0 -_0802932E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8029314 - - thumb_func_start sub_8029338 -sub_8029338: @ 8029338 - push {lr} - ldr r0, =0x02022cf8 - ldr r1, [r0] - ldr r2, =0x00003014 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x4 - bhi _08029430 - lsls r0, 2 - ldr r1, =_08029360 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08029360: - .4byte _08029374 - .4byte _0802937A - .4byte _08029394 - .4byte _080293D8 - .4byte _08029404 -_08029374: - bl sub_802A7A8 - b _08029414 -_0802937A: - bl sub_802A8E8 - cmp r0, 0x1 - bne _0802943A - ldr r0, =0x02022cf8 - ldr r1, [r0] - ldr r2, =0x00003014 - adds r1, r2 - b _0802941C - .pool -_08029394: - ldr r1, =gUnknown_082FAAD8 - movs r0, 0x3 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - ldr r1, =gUnknown_082FAF94 - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - ldr r1, =gUnknown_082FAD44 - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - b _08029414 - .pool -_080293D8: - movs r0, 0 - bl ShowBg - movs r0, 0x3 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - ldr r0, =0x02022cf8 - ldr r1, [r0] - ldr r2, =0x00003014 - adds r1, r2 - b _0802941C - .pool -_08029404: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x14] - lsrs r0, 3 - bl sub_8028FF8 - bl sub_802902C -_08029414: - ldr r0, =0x02022cf8 - ldr r1, [r0] - ldr r0, =0x00003014 - adds r1, r0 -_0802941C: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0802943A - .pool -_08029430: - movs r2, 0xC0 - lsls r2, 6 - adds r1, r2 - movs r0, 0x1 - str r0, [r1] -_0802943A: - pop {r0} - bx r0 - thumb_func_end sub_8029338 - - thumb_func_start sub_8029440 -sub_8029440: @ 8029440 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - ldr r4, =0x02022cf8 - ldr r0, [r4] - ldr r2, =0x00003014 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0 - beq _08029488 - cmp r0, 0x1 - bne _08029460 - b _080295EC -_08029460: - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB4 - bhi _0802946E - b _0802968E -_0802946E: - bl sub_8027650 - lsls r0, 24 - lsrs r7, r0, 24 - movs r6, 0 - cmp r6, r7 - bcc _0802947E - b _08029666 -_0802947E: - b _08029640 - .pool -_08029488: - bl sub_8027650 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =gUnknown_082FB3C8 - subs r0, r7, 0x1 - lsls r0, 2 - adds r0, r1 - ldr r5, [r0] - ldr r2, =0xffffff00 - ldr r0, [sp, 0xC] - ands r0, r2 - ldr r1, =0x00ffffff - ands r0, r1 - movs r1, 0xE0 - lsls r1, 19 - orrs r0, r1 - str r0, [sp, 0xC] - ldr r0, [sp, 0x10] - ands r0, r2 - movs r1, 0x2 - orrs r0, r1 - ldr r1, =0xffff00ff - ands r0, r1 - movs r1, 0xD0 - lsls r1, 4 - orrs r0, r1 - ldr r1, =0x0000ffff - ands r0, r1 - movs r1, 0x98 - lsls r1, 13 - orrs r0, r1 - str r0, [sp, 0x10] - movs r6, 0 - cmp r6, r7 - bcs _080295B8 - mov r3, sp - adds r3, 0xC - str r3, [sp, 0x18] - mov r10, r4 - ldr r0, =0x00003008 - mov r9, r0 -_080294DC: - movs r1, 0 - mov r8, r1 - adds r0, r6, 0 - bl sub_8027A48 - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - bl sub_8027660 - adds r1, r0, 0 - movs r0, 0x1 - movs r2, 0x1 - negs r2, r2 - bl GetStringWidth - movs r1, 0x38 - subs r1, r0 - lsrs r1, 1 - str r1, [sp, 0x14] - ldrb r0, [r5] - lsls r0, 8 - ldr r2, =0xffff00ff - ldr r1, [sp, 0xC] - ands r1, r2 - orrs r1, r0 - str r1, [sp, 0xC] - ldrb r2, [r5, 0x1] - lsls r2, 16 - ldr r0, =0xff00ffff - ands r0, r1 - orrs r0, r2 - str r0, [sp, 0xC] - add r0, sp, 0xC - bl AddWindow - mov r2, r10 - ldr r1, [r2] - add r1, r9 - adds r1, r6 - strb r0, [r1] - ldr r0, [r2] - add r0, r9 - adds r0, r6 - ldrb r0, [r0] - bl ClearWindowTilemap - mov r3, r10 - ldr r0, [r3] - add r0, r9 - adds r0, r6 - ldrb r0, [r0] - movs r1, 0x11 - bl FillWindowPixelBuffer - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bne _0802955A - movs r0, 0x2 - mov r8, r0 -_0802955A: - adds r0, r4, 0 - bl sub_8027660 - adds r4, r0, 0 - mov r1, r10 - ldr r0, [r1] - add r0, r9 - adds r0, r6 - ldrb r0, [r0] - ldr r3, [sp, 0x14] - lsls r2, r3, 24 - lsrs r2, 24 - mov r3, r8 - lsls r1, r3, 1 - add r1, r8 - ldr r3, =gUnknown_082FB380 - adds r1, r3 - str r1, [sp] - movs r1, 0x1 - negs r1, r1 - str r1, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x1 - bl box_print - mov r2, r10 - ldr r0, [r2] - add r0, r9 - adds r0, r6 - ldrb r0, [r0] - movs r1, 0x2 - bl CopyWindowToVram - ldr r3, [sp, 0x18] - ldrh r0, [r3, 0x6] - adds r0, 0xE - strh r0, [r3, 0x6] - add r0, sp, 0xC - bl sub_8029174 - adds r5, 0x4 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, r7 - bcc _080294DC -_080295B8: - ldr r0, =0x02022cf8 - ldr r1, [r0] - ldr r0, =0x00003014 - adds r1, r0 - b _0802962A - .pool -_080295EC: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802968E - bl sub_8027650 - lsls r0, 24 - lsrs r7, r0, 24 - movs r6, 0 - cmp r6, r7 - bcs _0802961C -_08029604: - ldr r0, [r4] - ldr r1, =0x00003008 - adds r0, r1 - adds r0, r6 - ldrb r0, [r0] - bl PutWindowTilemap - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, r7 - bcc _08029604 -_0802961C: - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r0, =0x02022cf8 - ldr r1, [r0] - ldr r2, =0x00003014 - adds r1, r2 -_0802962A: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0802968E - .pool -_08029640: - ldr r5, =0x02022cf8 - ldr r0, [r5] - ldr r4, =0x00003008 - adds r0, r4 - adds r0, r6 - ldrb r0, [r0] - bl ClearWindowTilemap - ldr r0, [r5] - adds r0, r4 - adds r0, r6 - ldrb r0, [r0] - bl RemoveWindow - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, r7 - bcc _08029640 -_08029666: - movs r0, 0x1E - str r0, [sp] - movs r0, 0x14 - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r0, =0x02022cf8 - ldr r0, [r0] - movs r3, 0xC0 - lsls r3, 6 - adds r0, r3 - movs r1, 0x1 - str r1, [r0] -_0802968E: - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8029440 - - thumb_func_start sub_80296A8 -sub_80296A8: @ 80296A8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x6C - lsls r0, 24 - movs r1, 0 - mov r8, r1 - movs r6, 0 - lsrs r7, r0, 24 - add r4, sp, 0x2C - ldr r1, =gUnknown_082FB45C - adds r0, r4, 0 - movs r2, 0x5 - bl memcpy - movs r5, 0 - cmp r5, r7 - bcs _080296F8 - add r4, sp, 0x34 -_080296D2: - mov r0, sp - adds r0, r5 - adds r0, 0x2C - strb r5, [r0] - add r0, sp, 0x5C - adds r1, r5, 0 - bl sub_802793C - lsls r2, r5, 3 - adds r2, r4, r2 - ldr r0, [sp, 0x5C] - ldr r1, [sp, 0x60] - str r0, [r2] - str r1, [r2, 0x4] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r7 - bcc _080296D2 -_080296F8: - bl sub_8027748 - cmp r0, 0 - beq _0802972E -_08029700: - movs r5, 0 - cmp r5, r7 - bcs _08029728 - add r2, sp, 0x34 - add r1, sp, 0x2C -_0802970A: - lsls r0, r5, 3 - adds r0, r2, r0 - ldrb r0, [r0] - cmp r0, r8 - bne _0802971E - adds r0, r1, r6 - strb r5, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_0802971E: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r7 - bcc _0802970A -_08029728: - mov r8, r6 - cmp r6, r7 - bcc _08029700 -_0802972E: - movs r5, 0 - ldr r4, =gUnknown_085EDE5D - cmp r5, r7 - bcs _08029754 - add r1, sp, 0x34 - add r6, sp, 0x38 - subs r3, r7, 0x1 -_0802973C: - lsls r2, r5, 3 - adds r0, r6, r2 - ldr r0, [r0] - cmp r0, 0 - bne _0802974A - adds r0, r1, r2 - strb r3, [r0] -_0802974A: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r7 - bcc _0802973C -_08029754: - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0 - bl GetStringWidth - movs r1, 0xD8 - subs r1, r0 - str r1, [sp, 0x64] - movs r5, 0 - cmp r5, r7 - bcs _08029860 - mov r2, sp - adds r2, 0x34 - str r2, [sp, 0x68] - ldr r3, =0x00003009 - mov r10, r3 -_08029774: - movs r0, 0 - mov r8, r0 - mov r0, sp - adds r0, r5 - adds r0, 0x2C - ldrb r0, [r0] - adds r4, r0, 0 - lsls r1, r4, 3 - add r0, sp, 0x38 - adds r0, r1 - ldr r0, [r0] - mov r9, r0 - ldr r2, =0x02022cf8 - ldr r0, [r2] - add r0, r10 - ldrb r0, [r0] - ldr r2, =gUnknown_082FB3DC - ldr r3, [sp, 0x68] - adds r1, r3, r1 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r2 - ldr r2, [r1] - ldr r3, =gUnknown_082FB402 - lsls r1, r5, 1 - adds r1, r3 - ldrb r6, [r1] - str r6, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - mov r3, r8 - str r3, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl Print - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bne _080297CC - movs r0, 0x2 - mov r8, r0 -_080297CC: - adds r0, r4, 0 - bl sub_8027660 - adds r3, r0, 0 - ldr r1, =0x02022cf8 - ldr r0, [r1] - add r0, r10 - ldrb r0, [r0] - mov r2, r8 - lsls r1, r2, 1 - add r1, r8 - ldr r2, =gUnknown_082FB380 - adds r1, r2 - str r1, [sp] - movs r1, 0x1 - negs r1, r1 - str r1, [sp, 0x4] - str r3, [sp, 0x8] - movs r1, 0x1 - movs r2, 0x1C - adds r3, r6, 0 - bl box_print - add r0, sp, 0xC - mov r1, r9 - movs r2, 0 - movs r3, 0x7 - bl ConvertIntToDecimalString - movs r0, 0x1 - add r1, sp, 0xC - movs r2, 0x1 - negs r2, r2 - bl GetStringWidth - adds r3, r0, 0 - ldr r2, =0x02022cf8 - ldr r0, [r2] - add r0, r10 - ldrb r0, [r0] - ldr r1, [sp, 0x64] - subs r3, r1, r3 - lsls r3, 24 - lsrs r3, 24 - str r6, [sp] - movs r2, 0xFF - str r2, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - add r2, sp, 0xC - bl Print - ldr r2, =0x02022cf8 - ldr r0, [r2] - add r0, r10 - ldrb r0, [r0] - ldr r1, [sp, 0x64] - lsls r3, r1, 24 - str r6, [sp] - movs r2, 0xFF - str r2, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - ldr r2, =gUnknown_085EDE5D - lsrs r3, 24 - bl Print - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r7 - bcc _08029774 -_08029860: - add sp, 0x6C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80296A8 - - thumb_func_start sub_802988C -sub_802988C: @ 802988C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - bl sub_8027650 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0xC] - ldr r6, =0x02022cf8 - ldr r1, [r6] - ldr r2, =0x00003014 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0xB - bls _080298B2 - b _08029FA8 -_080298B2: - lsls r0, 2 - ldr r1, =_080298C8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080298C8: - .4byte _080298F8 - .4byte _08029914 - .4byte _0802996C - .4byte _08029B6C - .4byte _08029BB8 - .4byte _08029BFC - .4byte _08029C60 - .4byte _08029C9C - .4byte _08029CE0 - .4byte _08029DA0 - .4byte _08029F08 - .4byte _08029F5C -_080298F8: - bl sub_802784C - ldr r0, =0x02022cf8 - ldr r1, [r0] - ldr r0, =0x0000301c - adds r2, r1, r0 - movs r0, 0 - strh r0, [r2] - b _08029F8A - .pool -_08029914: - ldr r6, =gUnknown_082F7BBC - adds r0, r6, 0 - bl AddWindow - ldr r4, =0x02022cf8 - ldr r1, [r4] - ldr r2, =0x00003008 - mov r8, r2 - add r1, r8 - strb r0, [r1] - movs r0, 0x8 - adds r0, r6 - mov r9, r0 - bl AddWindow - ldr r1, [r4] - ldr r5, =0x00003009 - adds r1, r5 - strb r0, [r1] - ldr r0, [r4] - add r0, r8 - ldrb r0, [r0] - bl ClearWindowTilemap - ldr r0, [r4] - adds r0, r5 - ldrb r0, [r0] - bl ClearWindowTilemap - adds r0, r6, 0 - bl sub_8029174 - mov r0, r9 - bl sub_8029174 - b _08029F88 - .pool -_0802996C: - ldr r4, =0x02022cf8 - ldr r0, [r4] - ldr r5, =0x00003008 - adds r0, r5 - ldrb r0, [r0] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, [r4] - ldr r1, =0x00003009 - mov r9, r1 - add r0, r9 - ldrb r0, [r0] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r2, =gUnknown_085EDD49 - mov r8, r2 - movs r2, 0x1 - negs r2, r2 - movs r0, 0x1 - mov r1, r8 - bl GetStringWidth - adds r1, r0, 0 - movs r0, 0xE0 - subs r0, r1 - lsrs r3, r0, 1 - ldr r0, [r4] - adds r0, r5 - ldrb r0, [r0] - lsls r3, 24 - lsrs r3, 24 - movs r1, 0x1 - str r1, [sp] - movs r6, 0xFF - str r6, [sp, 0x4] - movs r5, 0 - str r5, [sp, 0x8] - mov r2, r8 - bl Print - ldr r0, [r4] - add r0, r9 - ldrb r0, [r0] - ldr r2, =gUnknown_085EDD6B - movs r1, 0x11 - str r1, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x44 - bl Print - mov r9, r5 - ldr r0, [sp, 0xC] - cmp r9, r0 - bcc _080299E2 - b _08029B2A -_080299E2: - movs r4, 0 - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - cmp r9, r0 - bne _080299F2 - movs r4, 0x2 -_080299F2: - mov r0, r9 - bl sub_8027660 - adds r6, r0, 0 - ldr r0, =0x02022cf8 - ldr r0, [r0] - ldr r1, =0x00003009 - adds r0, r1 - ldrb r0, [r0] - mov r2, r9 - lsls r5, r2, 1 - ldr r2, =gUnknown_082FB3F8 - adds r1, r5, r2 - ldrb r3, [r1] - lsls r1, r4, 1 - adds r1, r4 - ldr r2, =gUnknown_082FB380 - adds r1, r2 - str r1, [sp] - movs r4, 0x1 - negs r4, r4 - str r4, [sp, 0x4] - str r6, [sp, 0x8] - movs r1, 0x1 - movs r2, 0 - bl box_print - movs r7, 0 - mov r8, r5 - mov r0, r9 - adds r0, 0x1 - str r0, [sp, 0x10] - ldr r1, =0x02021fc4 - mov r10, r1 -_08029A36: - mov r0, r9 - adds r1, r7, 0 - bl sub_80276A0 - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x0000270f - bl sub_8027A38 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r7, 0 - bl sub_802778C - ldr r1, =0x0000270f - bl sub_8027A38 - lsls r0, 16 - lsrs r6, r0, 16 - mov r0, r10 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x4 - bl ConvertIntToDecimalString - movs r0, 0x1 - mov r1, r10 - movs r2, 0x1 - negs r2, r2 - bl GetStringWidth - adds r5, r0, 0 - cmp r6, r4 - bne _08029AE0 - cmp r6, 0 - beq _08029AE0 - ldr r0, =0x02022cf8 - ldr r0, [r0] - ldr r2, =0x00003009 - adds r0, r2 - ldrb r0, [r0] - lsls r1, r7, 1 - ldr r2, =gUnknown_082FB3F0 - adds r1, r2 - ldrb r2, [r1] - subs r2, r5 - lsls r2, 24 - lsrs r2, 24 - ldr r1, =gUnknown_082FB3F8 - add r1, r8 - ldrb r3, [r1] - ldr r1, =gUnknown_082FB383 - str r1, [sp] - movs r1, 0x1 - negs r1, r1 - str r1, [sp, 0x4] - mov r1, r10 - str r1, [sp, 0x8] - movs r1, 0x1 - bl box_print - b _08029B10 - .pool -_08029AE0: - ldr r0, =0x02022cf8 - ldr r0, [r0] - ldr r2, =0x00003009 - adds r0, r2 - ldrb r0, [r0] - lsls r1, r7, 1 - ldr r2, =gUnknown_082FB3F0 - adds r1, r2 - ldrb r3, [r1] - subs r3, r5 - lsls r3, 24 - lsrs r3, 24 - ldr r1, =gUnknown_082FB3F8 - add r1, r8 - ldrb r1, [r1] - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - ldr r2, =0x02021fc4 - bl Print -_08029B10: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x3 - bls _08029A36 - ldr r1, [sp, 0x10] - lsls r0, r1, 24 - lsrs r0, 24 - mov r9, r0 - ldr r2, [sp, 0xC] - cmp r9, r2 - bcs _08029B2A - b _080299E2 -_08029B2A: - ldr r4, =0x02022cf8 - ldr r0, [r4] - ldr r1, =0x00003008 - adds r0, r1 - ldrb r0, [r0] - movs r1, 0x2 - bl CopyWindowToVram - ldr r0, [r4] - ldr r2, =0x00003009 - adds r0, r2 - ldrb r0, [r0] - movs r1, 0x2 - bl CopyWindowToVram - ldr r1, [r4] - ldr r0, =0x00003014 - adds r1, r0 - b _08029F8E - .pool -_08029B6C: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _08029B90 - ldr r4, =0x02022cf8 - ldr r0, [r4] - ldr r1, =0x00003008 - adds r0, r1 - ldrb r0, [r0] - bl PutWindowTilemap - ldr r0, [r4] - ldr r2, =0x00003009 - adds r0, r2 - ldrb r0, [r0] - bl PutWindowTilemap -_08029B90: - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0 - bl sub_8028C30 - ldr r0, =0x02022cf8 - ldr r1, [r0] - ldr r0, =0x00003014 - adds r1, r0 - b _08029F8E - .pool -_08029BB8: - ldr r4, =0x02022cf8 - ldr r0, [r4] - ldr r1, =0x0000301c - adds r2, r0, r1 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1D - bhi _08029BD0 - b _08029FF8 -_08029BD0: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08029BDE - b _08029FF8 -_08029BDE: - movs r0, 0 - strh r0, [r2] - movs r0, 0x5 - bl audio_play - movs r0, 0x1 - bl sub_8028C30 - b _08029F88 - .pool -_08029BFC: - ldr r4, =0x02022cf8 - ldr r0, [r4] - ldr r5, =0x00003008 - adds r0, r5 - ldrb r0, [r0] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, [r4] - ldr r1, =0x00003009 - adds r0, r1 - ldrb r0, [r0] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r6, =gUnknown_085EDD86 - movs r2, 0x1 - negs r2, r2 - movs r0, 0x1 - adds r1, r6, 0 - bl GetStringWidth - adds r1, r0, 0 - movs r0, 0xE0 - subs r0, r1 - lsrs r3, r0, 1 - ldr r0, [r4] - adds r0, r5 - ldrb r0, [r0] - lsls r3, 24 - lsrs r3, 24 - movs r1, 0x1 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r6, 0 - bl Print - b _08029F88 - .pool -_08029C60: - ldr r0, [sp, 0xC] - bl sub_80296A8 - ldr r4, =0x02022cf8 - ldr r0, [r4] - ldr r1, =0x00003008 - adds r0, r1 - ldrb r0, [r0] - movs r1, 0x2 - bl CopyWindowToVram - ldr r0, [r4] - ldr r2, =0x00003009 - adds r0, r2 - ldrb r0, [r0] - movs r1, 0x2 - bl CopyWindowToVram - ldr r1, [r4] - ldr r0, =0x00003014 - adds r1, r0 - b _08029F8E - .pool -_08029C9C: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _08029CC0 - ldr r4, =0x02022cf8 - ldr r0, [r4] - ldr r1, =0x00003008 - adds r0, r1 - ldrb r0, [r0] - bl PutWindowTilemap - ldr r0, [r4] - ldr r2, =0x00003009 - adds r0, r2 - ldrb r0, [r0] - bl PutWindowTilemap -_08029CC0: - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r0, =0x02022cf8 - ldr r1, [r0] - ldr r0, =0x00003014 - adds r1, r0 - b _08029F8E - .pool -_08029CE0: - ldr r4, =0x02022cf8 - ldr r0, [r4] - ldr r1, =0x0000301c - adds r2, r0, r1 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1D - bhi _08029CF8 - b _08029FF8 -_08029CF8: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08029D06 - b _08029FF8 -_08029D06: - movs r0, 0 - strh r0, [r2] - movs r0, 0x5 - bl audio_play - bl sub_8027748 - ldr r1, =0x00000bb7 - cmp r0, r1 - bhi _08029D3C - ldr r0, [r4] - ldr r2, =0x00003014 - adds r0, r2 - movs r1, 0x7F - strb r1, [r0] - b _08029D4C - .pool -_08029D3C: - bl sub_80A2F30 - ldr r1, [r4] - ldr r0, =0x00003014 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_08029D4C: - movs r0, 0x1E - str r0, [sp] - movs r0, 0xF - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0x5 - bl FillBgTilemapBufferRect_Palette0 - ldr r5, =0x02022cf8 - ldr r0, [r5] - ldr r4, =0x00003009 - adds r0, r4 - ldrb r0, [r0] - bl RemoveWindow - ldr r6, =gUnknown_082F7BCC - adds r0, r6, 0 - bl AddWindow - ldr r1, [r5] - adds r1, r4 - strb r0, [r1] - ldr r0, [r5] - adds r0, r4 - ldrb r0, [r0] - bl ClearWindowTilemap - adds r0, r6, 0 - bl sub_8029174 - b _08029FF8 - .pool -_08029DA0: - ldr r0, =0x0000016f - bl current_map_music_set - ldr r4, =0x02022cf8 - ldr r0, [r4] - ldr r6, =0x00003008 - adds r0, r6 - ldrb r0, [r0] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, [r4] - ldr r1, =0x00003009 - mov r10, r1 - add r0, r10 - ldrb r0, [r0] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r5, =gUnknown_085EDD9B - movs r2, 0x1 - negs r2, r2 - movs r0, 0x1 - adds r1, r5, 0 - bl GetStringWidth - adds r1, r0, 0 - movs r0, 0xE0 - subs r0, r1 - lsrs r3, r0, 1 - ldr r0, [r4] - adds r0, r6 - ldrb r0, [r0] - lsls r3, 24 - lsrs r3, 24 - movs r2, 0x1 - mov r9, r2 - str r2, [sp] - movs r1, 0xFF - mov r8, r1 - str r1, [sp, 0x4] - movs r6, 0 - str r6, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - bl Print - bl sub_81AFBF0 - bl sub_802762C - lsls r0, 16 - lsrs r0, 16 - ldr r5, =0x02021cc4 - adds r1, r5, 0 - bl itemid_get_name - movs r0, 0 - adds r1, r5, 0 - bl sub_81AFC0C - ldr r7, =0x02021fc4 - ldr r1, =gUnknown_085EDDBD - adds r0, r7, 0 - bl sub_81AFC28 - ldr r0, [r4] - add r0, r10 - ldrb r0, [r0] - mov r2, r9 - str r2, [sp] - mov r1, r8 - str r1, [sp, 0x4] - str r6, [sp, 0x8] - movs r1, 0x1 - adds r2, r7, 0 - movs r3, 0 - bl Print - bl sub_80279C8 - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - cmp r4, 0 - beq _08029EC8 - cmp r4, 0x3 - beq _08029EC8 - bl sub_81AFBF0 - bl sub_802762C - lsls r0, 16 - lsrs r0, 16 - adds r1, r5, 0 - bl itemid_get_name - movs r0, 0 - adds r1, r5, 0 - bl sub_81AFC0C - cmp r4, 0x2 - bne _08029E9C - ldr r1, =gUnknown_085EDDE2 - adds r0, r7, 0 - bl sub_81AFC28 - b _08029EA8 - .pool -_08029E9C: - cmp r6, 0x1 - bne _08029EA8 - ldr r1, =gUnknown_085EDDFB - adds r0, r7, 0 - bl sub_81AFC28 -_08029EA8: - ldr r0, =0x02022cf8 - ldr r0, [r0] - ldr r2, =0x00003009 - adds r0, r2 - ldrb r0, [r0] - ldr r2, =0x02021fc4 - movs r1, 0x29 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print -_08029EC8: - ldr r4, =0x02022cf8 - ldr r0, [r4] - ldr r1, =0x00003008 - adds r0, r1 - ldrb r0, [r0] - movs r1, 0x2 - bl CopyWindowToVram - ldr r0, [r4] - ldr r2, =0x00003009 - adds r0, r2 - ldrb r0, [r0] - movs r1, 0x2 - bl CopyWindowToVram - ldr r1, [r4] - ldr r0, =0x00003014 - adds r1, r0 - b _08029F8E - .pool -_08029F08: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _08029F2C - ldr r4, =0x02022cf8 - ldr r0, [r4] - ldr r1, =0x00003008 - adds r0, r1 - ldrb r0, [r0] - bl PutWindowTilemap - ldr r0, [r4] - ldr r2, =0x00003009 - adds r0, r2 - ldrb r0, [r0] - bl PutWindowTilemap -_08029F2C: - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r0, =0x0000020b - movs r1, 0x14 - movs r2, 0xA - bl sub_80A2FBC - ldr r0, =0x02022cf8 - ldr r1, [r0] - ldr r0, =0x00003014 - adds r1, r0 - b _08029F8E - .pool -_08029F5C: - ldr r4, =0x02022cf8 - ldr r0, [r4] - ldr r1, =0x0000301c - adds r2, r0, r1 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1D - bls _08029FF8 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08029FF8 - movs r0, 0 - strh r0, [r2] - movs r0, 0x5 - bl audio_play -_08029F88: - ldr r1, [r4] -_08029F8A: - ldr r2, =0x00003014 - adds r1, r2 -_08029F8E: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08029FF8 - .pool -_08029FA8: - ldr r5, =0x00003008 - adds r0, r1, r5 - ldrb r0, [r0] - bl ClearWindowTilemap - ldr r0, [r6] - ldr r4, =0x00003009 - adds r0, r4 - ldrb r0, [r0] - bl ClearWindowTilemap - ldr r0, [r6] - adds r0, r5 - ldrb r0, [r0] - bl RemoveWindow - ldr r0, [r6] - adds r0, r4 - ldrb r0, [r0] - bl RemoveWindow - movs r0, 0x1E - str r0, [sp] - movs r0, 0x14 - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r0, [r6] - movs r1, 0xC0 - lsls r1, 6 - adds r0, r1 - movs r1, 0x1 - str r1, [r0] -_08029FF8: - add sp, 0x14 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802988C - - thumb_func_start sub_802A010 -sub_802A010: @ 802A010 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - ldr r1, =0x02022cf8 - ldr r2, [r1] - ldr r3, =0x00003014 - adds r0, r2, r3 - ldrb r6, [r0] - adds r7, r1, 0 - cmp r6, 0x1 - beq _0802A0CC - cmp r6, 0x1 - bgt _0802A040 - cmp r6, 0 - beq _0802A04E - b _0802A2FC - .pool -_0802A040: - cmp r6, 0x2 - bne _0802A046 - b _0802A194 -_0802A046: - cmp r6, 0x3 - bne _0802A04C - b _0802A1D0 -_0802A04C: - b _0802A2FC -_0802A04E: - ldr r0, =gUnknown_082F7BD4 - mov r9, r0 - bl AddWindow - ldr r1, [r7] - ldr r4, =0x00003008 - adds r1, r4 - strb r0, [r1] - movs r1, 0x8 - add r1, r9 - mov r8, r1 - mov r0, r8 - bl AddWindow - ldr r1, [r7] - ldr r2, =0x00003009 - adds r1, r2 - strb r0, [r1] - ldr r0, [r7] - adds r0, r4 - ldrb r0, [r0] - bl ClearWindowTilemap - ldr r0, [r7] - ldr r3, =0x00003009 - adds r0, r3 - ldrb r0, [r0] - bl ClearWindowTilemap - mov r0, r9 - bl sub_8029174 - mov r0, r8 - bl sub_8029074 - ldr r1, [r7] - ldr r0, =0x00003014 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r7] - ldr r1, =0x00003020 - adds r0, r1 - strb r6, [r0] - ldr r0, [r7] - ldr r2, =0x00003024 - adds r0, r2 - strb r6, [r0] - b _0802A35E - .pool -_0802A0CC: - ldr r3, =0x00003008 - mov r8, r3 - adds r0, r2, r3 - ldrb r0, [r0] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, [r7] - ldr r1, =0x00003009 - mov r10, r1 - add r0, r10 - ldrb r0, [r0] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, [r7] - add r0, r8 - ldrb r0, [r0] - ldr r2, =gUnknown_085EDE18 - movs r1, 0x5 - str r1, [sp] - movs r3, 0xFF - mov r9, r3 - str r3, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - ldr r0, [r7] - add r0, r10 - ldrb r0, [r0] - ldr r2, =gUnknown_085EAE62 - str r6, [sp] - mov r3, r9 - str r3, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl Print - ldr r0, [r7] - add r0, r10 - ldrb r0, [r0] - ldr r2, =gUnknown_085EAE66 - movs r1, 0x11 - str r1, [sp] - mov r3, r9 - str r3, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl Print - ldr r0, [r7] - add r0, r10 - ldrb r0, [r0] - ldr r2, =gUnknown_085E8D60 - str r6, [sp] - mov r3, r9 - str r3, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - ldr r0, [r7] - add r0, r8 - ldrb r0, [r0] - movs r1, 0x2 - bl CopyWindowToVram - ldr r0, [r7] - add r0, r10 - ldrb r0, [r0] - movs r1, 0x2 - bl CopyWindowToVram - ldr r1, [r7] - ldr r2, =0x00003014 - adds r1, r2 - b _0802A2EA - .pool -_0802A194: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802A1B6 - ldr r0, [r7] - ldr r3, =0x00003008 - adds r0, r3 - ldrb r0, [r0] - bl PutWindowTilemap - ldr r0, [r7] - ldr r1, =0x00003009 - adds r0, r1 - ldrb r0, [r0] - bl PutWindowTilemap -_0802A1B6: - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r1, [r7] - ldr r2, =0x00003014 - adds r1, r2 - b _0802A2EA - .pool -_0802A1D0: - ldr r3, =0x00003020 - adds r0, r2, r3 - ldrb r5, [r0] - cmp r5, 0 - bne _0802A1DC - movs r5, 0x1 -_0802A1DC: - ldr r0, =0x00003009 - mov r8, r0 - adds r0, r2, r0 - ldrb r0, [r0] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, [r7] - add r0, r8 - ldrb r0, [r0] - ldr r2, =gUnknown_085EAE62 - movs r1, 0x1 - str r1, [sp] - movs r3, 0xFF - mov r10, r3 - str r3, [sp, 0x4] - movs r1, 0 - mov r9, r1 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl Print - ldr r0, [r7] - add r0, r8 - ldrb r0, [r0] - ldr r2, =gUnknown_085EAE66 - movs r1, 0x11 - str r1, [sp] - mov r3, r10 - str r3, [sp, 0x4] - mov r1, r9 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl Print - ldr r0, [r7] - add r0, r8 - ldrb r0, [r0] - ldr r2, =gUnknown_085E8D60 - subs r1, r5, 0x1 - lsls r1, 4 - adds r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - mov r3, r10 - str r3, [sp, 0x4] - mov r1, r9 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - ldr r0, [r7] - add r0, r8 - ldrb r0, [r0] - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r5, 0x1 - movs r2, 0x1 - ands r2, r1 - cmp r2, 0 - beq _0802A294 - movs r0, 0x5 - bl audio_play - ldr r0, [r7] - ldr r3, =0x00003020 - adds r1, r0, r3 - ldrb r0, [r1] - cmp r0, 0 - bne _0802A2E4 - strb r5, [r1] - b _0802A2E4 - .pool -_0802A294: - movs r0, 0xC0 - ands r0, r1 - cmp r0, 0 - beq _0802A2CC - movs r0, 0x5 - bl audio_play - ldr r0, [r7] - ldr r2, =0x00003020 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0x1 - beq _0802A2C2 - cmp r0, 0x1 - bgt _0802A2BC - cmp r0, 0 - beq _0802A2C2 - b _0802A35E - .pool -_0802A2BC: - cmp r0, 0x2 - beq _0802A2C8 - b _0802A35E -_0802A2C2: - movs r0, 0x2 - strb r0, [r1] - b _0802A35E -_0802A2C8: - strb r5, [r1] - b _0802A35E -_0802A2CC: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0802A35E - movs r0, 0x5 - bl audio_play - ldr r0, [r7] - ldr r3, =0x00003020 - adds r0, r3 - movs r1, 0x2 - strb r1, [r0] -_0802A2E4: - ldr r1, [r7] - ldr r0, =0x00003014 - adds r1, r0 -_0802A2EA: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0802A35E - .pool -_0802A2FC: - ldr r0, [r7] - ldr r2, =0x00003020 - adds r1, r0, r2 - ldrb r1, [r1] - ldr r3, =0x00003024 - adds r0, r3 - strb r1, [r0] - ldr r0, [r7] - ldr r6, =0x00003008 - adds r0, r6 - ldrb r0, [r0] - bl ClearWindowTilemap - ldr r0, [r7] - ldr r1, =0x00003009 - adds r0, r1 - ldrb r0, [r0] - bl ClearWindowTilemap - ldr r0, [r7] - adds r0, r6 - ldrb r0, [r0] - bl RemoveWindow - ldr r0, [r7] - ldr r2, =0x00003009 - adds r0, r2 - ldrb r0, [r0] - bl RemoveWindow - movs r0, 0x1E - str r0, [sp] - movs r0, 0x14 - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r0, [r7] - movs r3, 0xC0 - lsls r3, 6 - adds r0, r3 - movs r1, 0x1 - str r1, [r0] -_0802A35E: - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802A010 - - thumb_func_start sub_802A380 -sub_802A380: @ 802A380 - push {r4-r6,lr} - sub sp, 0x10 - ldr r5, =0x02022cf8 - ldr r0, [r5] - ldr r6, =0x00003014 - adds r0, r6 - ldrb r4, [r0] - cmp r4, 0x1 - beq _0802A3D8 - cmp r4, 0x1 - bgt _0802A3A4 - cmp r4, 0 - beq _0802A3AE - b _0802A420 - .pool -_0802A3A4: - cmp r4, 0x2 - beq _0802A3EC - cmp r4, 0x3 - beq _0802A404 - b _0802A420 -_0802A3AE: - movs r0, 0 - movs r1, 0 - bl sub_81973C4 - ldr r2, =gUnknown_082C8959 - str r4, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParametrized - b _0802A410 - .pool -_0802A3D8: - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r1, [r5] - ldr r0, =0x00003014 - adds r1, r0 - b _0802A414 - .pool -_0802A3EC: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802A448 - ldr r0, =sub_8153688 - movs r1, 0 - bl AddTask - b _0802A410 - .pool -_0802A404: - ldr r0, =sub_8153688 - bl is_function_an_active_task - lsls r0, 24 - cmp r0, 0 - bne _0802A448 -_0802A410: - ldr r1, [r5] - adds r1, r6 -_0802A414: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0802A448 - .pool -_0802A420: - movs r0, 0x1E - str r0, [sp] - movs r0, 0x14 - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r0, =0x02022cf8 - ldr r0, [r0] - movs r1, 0xC0 - lsls r1, 6 - adds r0, r1 - movs r1, 0x1 - str r1, [r0] -_0802A448: - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802A380 - - thumb_func_start sub_802A454 -sub_802A454: @ 802A454 - push {r4-r6,lr} - sub sp, 0xC - ldr r1, =0x02022cf8 - ldr r2, [r1] - ldr r6, =0x00003014 - adds r0, r2, r6 - ldrb r0, [r0] - adds r5, r1, 0 - cmp r0, 0x1 - beq _0802A4AC - cmp r0, 0x1 - bgt _0802A47C - cmp r0, 0 - beq _0802A482 - b _0802A520 - .pool -_0802A47C: - cmp r0, 0x2 - beq _0802A4F4 - b _0802A520 -_0802A482: - ldr r4, =gUnknown_082F7BEC - adds r0, r4, 0 - bl AddWindow - ldr r1, [r5] - ldr r2, =0x00003008 - adds r1, r2 - strb r0, [r1] - ldr r0, [r5] - adds r0, r2 - ldrb r0, [r0] - bl ClearWindowTilemap - adds r0, r4, 0 - bl sub_8029174 - b _0802A510 - .pool -_0802A4AC: - ldr r4, =0x00003008 - adds r0, r2, r4 - ldrb r0, [r0] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, [r5] - adds r0, r4 - ldrb r0, [r0] - ldr r2, =gUnknown_085EDE65 - movs r1, 0x5 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - ldr r0, [r5] - adds r0, r4 - ldrb r0, [r0] - movs r1, 0x2 - bl CopyWindowToVram - ldr r1, [r5] - ldr r0, =0x00003014 - adds r1, r0 - b _0802A514 - .pool -_0802A4F4: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802A50A - ldr r0, [r5] - ldr r1, =0x00003008 - adds r0, r1 - ldrb r0, [r0] - bl PutWindowTilemap -_0802A50A: - movs r0, 0 - bl CopyBgTilemapBufferToVram -_0802A510: - ldr r1, [r5] - adds r1, r6 -_0802A514: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0802A52C - .pool -_0802A520: - ldr r0, [r5] - movs r1, 0xC0 - lsls r1, 6 - adds r0, r1 - movs r1, 0x1 - str r1, [r0] -_0802A52C: - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_802A454 - - thumb_func_start sub_802A534 -sub_802A534: @ 802A534 - push {r4,r5,lr} - sub sp, 0x8 - ldr r5, =0x02022cf8 - ldr r0, [r5] - ldr r4, =0x00003008 - adds r0, r4 - ldrb r0, [r0] - bl ClearWindowTilemap - ldr r0, [r5] - adds r0, r4 - ldrb r0, [r0] - bl RemoveWindow - movs r0, 0x1E - str r0, [sp] - movs r0, 0x14 - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r0, [r5] - movs r1, 0xC0 - lsls r1, 6 - adds r0, r1 - movs r1, 0x1 - str r1, [r0] - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802A534 - - thumb_func_start sub_802A588 -sub_802A588: @ 802A588 - push {r4-r7,lr} - sub sp, 0xC - ldr r0, =0x02022cf8 - ldr r1, [r0] - ldr r7, =0x00003014 - adds r2, r1, r7 - ldrb r5, [r2] - adds r6, r0, 0 - cmp r5, 0x1 - beq _0802A610 - cmp r5, 0x1 - bgt _0802A5B0 - cmp r5, 0 - beq _0802A5BA - b _0802A6A4 - .pool -_0802A5B0: - cmp r5, 0x2 - beq _0802A658 - cmp r5, 0x3 - beq _0802A684 - b _0802A6A4 -_0802A5BA: - ldr r4, =gUnknown_082F7BE4 - adds r0, r4, 0 - bl AddWindow - ldr r1, [r6] - ldr r2, =0x00003008 - adds r1, r2 - strb r0, [r1] - ldr r0, [r6] - adds r0, r2 - ldrb r0, [r0] - bl ClearWindowTilemap - adds r0, r4, 0 - bl sub_8029174 - ldr r1, [r6] - adds r1, r7 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r6] - ldr r2, =0x0000301c - adds r1, r0, r2 - movs r2, 0 - strh r5, [r1] - ldr r1, =0x00003020 - adds r0, r1 - strb r2, [r0] - ldr r0, [r6] - adds r1, 0x4 - adds r0, r1 - strb r2, [r0] - b _0802A6EA - .pool -_0802A610: - ldr r4, =0x00003008 - adds r0, r1, r4 - ldrb r0, [r0] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, [r6] - adds r0, r4 - ldrb r0, [r0] - ldr r2, =gUnknown_085EDE2C - movs r1, 0x5 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - ldr r0, [r6] - adds r0, r4 - ldrb r0, [r0] - movs r1, 0x2 - bl CopyWindowToVram - ldr r1, [r6] - ldr r2, =0x00003014 - adds r1, r2 - b _0802A678 - .pool -_0802A658: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802A66E - ldr r0, [r6] - ldr r1, =0x00003008 - adds r0, r1 - ldrb r0, [r0] - bl PutWindowTilemap -_0802A66E: - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r1, [r6] - adds r1, r7 -_0802A678: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0802A6EA - .pool -_0802A684: - ldr r0, =0x0000301c - adds r1, r0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x77 - bls _0802A6EA - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - b _0802A6EA - .pool -_0802A6A4: - ldr r0, [r6] - ldr r1, =0x00003024 - adds r0, r1 - movs r1, 0x5 - strb r1, [r0] - ldr r0, [r6] - ldr r4, =0x00003008 - adds r0, r4 - ldrb r0, [r0] - bl ClearWindowTilemap - ldr r0, [r6] - adds r0, r4 - ldrb r0, [r0] - bl RemoveWindow - movs r0, 0x1E - str r0, [sp] - movs r0, 0x14 - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r0, [r6] - movs r2, 0xC0 - lsls r2, 6 - adds r0, r2 - movs r1, 0x1 - str r1, [r0] -_0802A6EA: - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802A588 - - thumb_func_start unused_0 -unused_0: @ 802A6FC - push {r4,lr} - ldr r4, =0x02022cf8 - ldr r0, [r4] - ldr r1, =0x00003004 - adds r0, r1 - ldrb r0, [r0] - bl remove_task - ldr r0, [r4] - movs r1, 0xC0 - lsls r1, 6 - adds r0, r1 - movs r1, 0x1 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end unused_0 - - thumb_func_start nullsub_16 -nullsub_16: @ 802A728 - bx lr - thumb_func_end nullsub_16 - - thumb_func_start sub_802A72C -sub_802A72C: @ 802A72C - push {r4,lr} - ldr r2, =0x02022cf8 - ldr r1, [r2] - ldr r3, =0x00003014 - adds r1, r3 - movs r3, 0 - strb r3, [r1] - ldr r1, [r2] - movs r4, 0xC0 - lsls r4, 6 - adds r2, r1, r4 - str r3, [r2] - ldr r2, =0x00003028 - adds r1, r2 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802A72C - - thumb_func_start sub_802A75C -sub_802A75C: @ 802A75C - ldr r0, =0x02022cf8 - ldr r0, [r0] - ldr r1, =0x00003028 - adds r0, r1 - ldr r0, [r0] - bx lr - .pool - thumb_func_end sub_802A75C - - thumb_func_start sub_802A770 -sub_802A770: @ 802A770 - push {lr} - ldr r0, =0x02022cf8 - ldr r0, [r0] - movs r1, 0xC0 - lsls r1, 6 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0x1 - beq _0802A78C - movs r0, 0x1 - b _0802A78E - .pool -_0802A78C: - movs r0, 0 -_0802A78E: - pop {r1} - bx r1 - thumb_func_end sub_802A770 - - thumb_func_start sub_802A794 -sub_802A794: @ 802A794 - ldr r0, =0x02022cf8 - ldr r0, [r0] - ldr r1, =0x00003024 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_802A794 - - thumb_func_start sub_802A7A8 -sub_802A7A8: @ 802A7A8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - movs r3, 0xC0 - lsls r3, 19 - movs r4, 0xC0 - lsls r4, 9 - add r0, sp, 0x4 - mov r8, r0 - mov r2, sp - movs r6, 0 - ldr r1, =0x040000d4 - movs r5, 0x80 - lsls r5, 5 - ldr r7, =0x81000800 - movs r0, 0x81 - lsls r0, 24 - mov r12, r0 -_0802A7CE: - strh r6, [r2] - mov r0, sp - str r0, [r1] - str r3, [r1, 0x4] - str r7, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r3, r5 - subs r4, r5 - cmp r4, r5 - bhi _0802A7CE - strh r6, [r2] - mov r2, sp - str r2, [r1] - str r3, [r1, 0x4] - lsrs r0, r4, 1 - mov r2, r12 - orrs r0, r2 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - movs r0, 0xE0 - lsls r0, 19 - movs r3, 0x80 - lsls r3, 3 - movs r4, 0 - str r4, [sp, 0x4] - ldr r2, =0x040000d4 - mov r1, r8 - str r1, [r2] - str r0, [r2, 0x4] - lsrs r0, r3, 2 - movs r1, 0x85 - lsls r1, 24 - orrs r0, r1 - str r0, [r2, 0x8] - ldr r0, [r2, 0x8] - movs r1, 0xA0 - lsls r1, 19 - mov r0, sp - strh r4, [r0] - str r0, [r2] - str r1, [r2, 0x4] - lsrs r3, 1 - movs r0, 0x81 - lsls r0, 24 - orrs r3, r0 - str r3, [r2, 0x8] - ldr r0, [r2, 0x8] - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_082F7BA4 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - bl sub_81971D0 - bl sub_8197200 - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - ldr r4, =0x02022cf8 - ldr r1, [r4] - movs r0, 0x3 - bl SetBgTilemapBuffer - ldr r1, [r4] - movs r2, 0x80 - lsls r2, 5 - adds r1, r2 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - movs r0, 0x80 - lsls r0, 6 - adds r1, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802A7A8 - - thumb_func_start sub_802A8E8 -sub_802A8E8: @ 802A8E8 - push {lr} - sub sp, 0x4 - ldr r0, =0x02022cf8 - ldr r0, [r0] - ldr r2, =0x00003018 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0x5 - bhi _0802A982 - lsls r0, 2 - ldr r1, =_0802A910 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0802A910: - .4byte _0802A928 - .4byte _0802A938 - .4byte _0802A93E - .4byte _0802A94C - .4byte _0802A964 - .4byte _0802A972 -_0802A928: - ldr r0, =gUnknown_082F7DF0 - movs r1, 0 - movs r2, 0x40 - bl gpu_pal_apply - b _0802A98A - .pool -_0802A938: - bl reset_temp_tile_data_buffers - b _0802A98A -_0802A93E: - ldr r1, =gUnknown_082F8084 - movs r0, 0 - str r0, [sp] - movs r0, 0x3 - b _0802A954 - .pool -_0802A94C: - ldr r1, =gUnknown_082F8914 - movs r0, 0 - str r0, [sp] - movs r0, 0x1 -_0802A954: - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - b _0802A98A - .pool -_0802A964: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0802A98A - b _0802A998 -_0802A972: - movs r0, 0x3 - bl stdpal_get - movs r1, 0xD0 - movs r2, 0x20 - bl gpu_pal_apply - b _0802A98A -_0802A982: - movs r0, 0 - strb r0, [r1] - movs r0, 0x1 - b _0802A99A -_0802A98A: - ldr r0, =0x02022cf8 - ldr r1, [r0] - ldr r0, =0x00003018 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_0802A998: - movs r0, 0 -_0802A99A: - add sp, 0x4 - pop {r1} - bx r1 - .pool - thumb_func_end sub_802A8E8 - - thumb_func_start sub_802A9A8 -sub_802A9A8: @ 802A9A8 - push {r4-r7,lr} - adds r6, r1, 0 - lsls r0, 16 - lsrs r7, r0, 16 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _0802AA3C - ldr r5, =0x02022cfc - ldr r0, =0x000083b0 - bl Alloc - str r0, [r5] - cmp r0, 0 - beq _0802AA3C - bl clear_tasks - ldr r0, =sub_802ACA0 - movs r1, 0x1 - bl AddTask - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, [r5] - movs r1, 0 - strh r1, [r0, 0x8] - str r6, [r0] - strb r4, [r0, 0x4] - bl link_get_multiplayer_id - ldr r1, [r5] - strb r0, [r1, 0x6] - ldr r0, [r5] - ldrb r2, [r0, 0x6] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - ldr r2, =0x000082a8 - adds r1, r2 - adds r0, r1 - movs r1, 0x64 - muls r1, r7 - ldr r2, =0x020244ec - adds r1, r2 - bl sub_802AC2C - ldr r0, [r5] - bl sub_802AA60 - ldr r2, [r5] - adds r0, r4, 0 - movs r1, 0x2 - bl set_word_task_arg - ldr r0, =sub_802AC6C - bl SetMainCallback2 - b _0802AA42 - .pool -_0802AA3C: - adds r0, r6, 0 - bl SetMainCallback2 -_0802AA42: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_802A9A8 - - thumb_func_start sub_802AA48 -sub_802AA48: @ 802AA48 - push {lr} - bl sub_802D0AC - ldr r0, =0x02022cfc - ldr r0, [r0] - bl Free - pop {r0} - bx r0 - .pool - thumb_func_end sub_802AA48 - - thumb_func_start sub_802AA60 -sub_802AA60: @ 802AA60 - push {r4,lr} - adds r4, r0, 0 - bl sub_8009FCC - movs r2, 0 - strb r0, [r4, 0x5] - adds r1, r4, 0 - adds r1, 0x70 - movs r0, 0x5 - strb r0, [r1] - adds r0, r4, 0 - adds r0, 0x72 - strh r2, [r0] - bl sub_802AB20 - adds r0, r4, 0 - bl sub_802AA94 - ldrb r0, [r4, 0x5] - cmp r0, 0x5 - bne _0802AA8E - bl sub_802E3A8 -_0802AA8E: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_802AA60 - - thumb_func_start sub_802AA94 -sub_802AA94: @ 802AA94 - push {r4-r6,lr} - adds r4, r0, 0 - movs r0, 0x6 - str r0, [r4, 0x14] - str r0, [r4, 0x18] - adds r0, r4, 0 - adds r0, 0x4A - movs r6, 0 - movs r5, 0 - strh r5, [r0] - str r5, [r4, 0x1C] - str r5, [r4, 0x5C] - bl link_get_multiplayer_id - movs r1, 0 - lsls r0, 24 - cmp r0, 0 - bne _0802AABA - movs r1, 0x1 -_0802AABA: - adds r0, r4, 0 - adds r0, 0x47 - strb r1, [r0] - strh r5, [r4, 0x8] - strh r5, [r4, 0xA] - strh r5, [r4, 0xC] - strh r5, [r4, 0xE] - str r5, [r4, 0x58] - strh r5, [r4, 0x3A] - subs r0, 0x3 - strb r6, [r0] - str r5, [r4, 0x54] - adds r0, 0x2 - strb r6, [r0] - adds r0, 0x3 - strb r6, [r0] - subs r0, 0x1 - movs r1, 0x1 - strb r1, [r0] - str r5, [r4, 0x78] - adds r0, 0x29 - strb r6, [r0] - adds r0, 0x3 - strh r5, [r0] - str r1, [r4, 0x60] - subs r0, 0x27 - strb r6, [r0] - str r5, [r4, 0x68] - str r5, [r4, 0x64] - str r5, [r4, 0x2C] - str r5, [r4, 0x30] - bl sub_802AB98 - bl sub_802C0E8 - movs r2, 0 - adds r5, r4, 0 - adds r5, 0x7C - movs r3, 0 - adds r1, r4, 0 - adds r1, 0x9A -_0802AB0C: - adds r0, r5, r2 - strb r3, [r0] - strh r3, [r1] - adds r1, 0x2 - adds r2, 0x1 - cmp r2, 0x4 - ble _0802AB0C - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_802AA94 - - thumb_func_start sub_802AB20 -sub_802AB20: @ 802AB20 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r7, =0x02022cfc - movs r6, 0 - movs r5, 0 - ldr r0, =gUnknown_082FB464 - mov r8, r0 - movs r4, 0x4 -_0802AB32: - ldr r0, [r7] - adds r0, r5 - ldr r1, =0x000082a8 - adds r0, r1 - ldrh r0, [r0] - bl sub_802AC00 - lsls r0, 16 - ldr r1, [r7] - adds r1, r6 - asrs r0, 14 - add r0, r8 - ldrh r0, [r0, 0x2] - ldr r2, =0x000082f0 - adds r1, r2 - strh r0, [r1] - adds r6, 0x28 - adds r5, 0xC - subs r4, 0x1 - cmp r4, 0 - bge _0802AB32 - ldr r0, =0x02022cfc - ldr r1, [r0] - ldr r0, =0x000083ac - adds r3, r1, r0 - ldrb r2, [r1, 0x6] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r2, =0x000082e4 - adds r0, r2 - adds r1, r0 - str r1, [r3] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802AB20 - - thumb_func_start sub_802AB98 -sub_802AB98: @ 802AB98 - push {r4-r7,lr} - movs r5, 0 - ldr r6, =0x02022cfc - movs r4, 0 - movs r3, 0 -_0802ABA2: - ldr r2, [r6] - adds r1, r2, r3 - ldr r7, =0x000082f2 - adds r0, r1, r7 - strh r4, [r0] - adds r7, 0x2 - adds r0, r1, r7 - strh r4, [r0] - ldr r0, =0x000082f6 - adds r1, r0 - strh r4, [r1] - ldr r1, =0x000082e4 - adds r0, r2, r1 - adds r0, r3 - str r4, [r0] - subs r7, 0xC - adds r0, r2, r7 - adds r0, r3 - ldr r1, =0x7fffffff - str r1, [r0] - ldr r1, =0x000082f8 - adds r0, r2, r1 - adds r0, r3 - str r4, [r0] - adds r2, 0x8B - adds r2, r5 - movs r0, 0x9 - strb r0, [r2] - adds r3, 0x28 - adds r5, 0x1 - cmp r5, 0x4 - ble _0802ABA2 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802AB98 - - thumb_func_start sub_802AC00 -sub_802AC00: @ 802AC00 - push {lr} - lsls r0, 16 - lsrs r3, r0, 16 - movs r1, 0 - ldr r2, =gUnknown_082FB464 -_0802AC0A: - ldrh r0, [r2] - cmp r0, r3 - bne _0802AC1C - lsls r0, r1, 16 - asrs r0, 16 - b _0802AC28 - .pool -_0802AC1C: - adds r2, 0x4 - adds r1, 0x1 - cmp r1, 0x63 - bls _0802AC0A - movs r0, 0x1 - negs r0, r0 -_0802AC28: - pop {r1} - bx r1 - thumb_func_end sub_802AC00 - - thumb_func_start sub_802AC2C -sub_802AC2C: @ 802AC2C - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - strh r0, [r5] - adds r0, r4, 0 - movs r1, 0x1 - bl pokemon_getattr - str r0, [r5, 0x4] - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - str r0, [r5, 0x8] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_802AC2C - - thumb_func_start sub_802AC58 -sub_802AC58: @ 802AC58 - push {lr} - bl copy_pal_bg_faded_to_pal_ram - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - pop {r0} - bx r0 - thumb_func_end sub_802AC58 - - thumb_func_start sub_802AC6C -sub_802AC6C: @ 802AC6C - push {lr} - bl RunActiveTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_802AC6C - - thumb_func_start sub_802AC84 -sub_802AC84: @ 802AC84 - push {lr} - movs r1, 0x1 - bl AddTask - ldr r2, =0x02022cfc - ldr r1, [r2] - movs r3, 0 - strb r0, [r1, 0x4] - ldr r0, [r2] - strh r3, [r0, 0x8] - pop {r0} - bx r0 - .pool - thumb_func_end sub_802AC84 - - thumb_func_start sub_802ACA0 -sub_802ACA0: @ 802ACA0 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x02022cfc - ldr r0, [r1] - ldrh r0, [r0, 0x8] - adds r2, r1, 0 - cmp r0, 0x5 - bls _0802ACB6 - b _0802AE08 -_0802ACB6: - lsls r0, 2 - ldr r1, =_0802ACC8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0802ACC8: - .4byte _0802ACE0 - .4byte _0802AD0C - .4byte _0802AD3C - .4byte _0802AD68 - .4byte _0802ADA4 - .4byte _0802ADD0 -_0802ACE0: - movs r0, 0 - bl SetVBlankCallback - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - ldr r0, =sub_802BD84 - movs r1, 0x5 - bl sub_802BE60 - movs r0, 0x4 - bl sub_80A2F50 - ldr r0, =0x02022cfc - ldr r1, [r0] - b _0802ADC0 - .pool -_0802AD0C: - ldr r0, =sub_802BD84 - bl is_function_an_active_task - lsls r0, 24 - cmp r0, 0 - bne _0802AE08 - ldr r4, =0x02022cfc - ldr r0, [r4] - adds r0, 0xA4 - bl sub_802D074 - bl sub_800E0E8 - movs r0, 0 - movs r1, 0 - bl sub_800DFB4 - ldr r1, [r4] - b _0802ADC0 - .pool -_0802AD3C: - bl sub_802D0F0 - cmp r0, 0 - bne _0802AE08 - bl sub_80A303C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0802AE08 - ldr r0, =0x0000021a - movs r1, 0x8 - bl sub_80A2F88 - ldr r0, =0x02022cfc - ldr r1, [r0] - b _0802ADC0 - .pool -_0802AD68: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _0802AE08 - movs r4, 0x1 - negs r4, r4 - adds r0, r4, 0 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - adds r1, r4, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r0, =sub_802AC58 - bl SetVBlankCallback - ldr r0, =0x02022cfc - ldr r1, [r0] - b _0802ADC0 - .pool -_0802ADA4: - bl fade_and_return_progress_probably - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - bne _0802AE08 - ldr r1, =0x02022cfc - ldr r0, [r1] - strb r2, [r0, 0x7] - ldr r1, [r1] -_0802ADC0: - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0802AE08 - .pool -_0802ADD0: - ldr r0, [r2] - ldrb r1, [r0, 0x7] - adds r1, 0x1 - strb r1, [r0, 0x7] - ldr r1, [r2] - ldrb r0, [r1, 0x7] - cmp r0, 0x13 - bls _0802AE08 - adds r0, r1, 0 - adds r0, 0x47 - ldrb r0, [r0] - cmp r0, 0 - beq _0802ADF8 - ldr r0, =sub_802AF80 - bl sub_802AC84 - b _0802ADFE - .pool -_0802ADF8: - ldr r0, =sub_802B194 - bl sub_802AC84 -_0802ADFE: - bl sub_802BE80 - adds r0, r4, 0 - bl remove_task -_0802AE08: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802ACA0 - - thumb_func_start sub_802AE14 -sub_802AE14: @ 802AE14 - push {lr} - adds r1, r0, 0 - cmp r1, 0 - bne _0802AE34 - ldr r0, =0x02022cfc - ldr r1, [r0] - ldr r0, =0x00001111 - str r0, [r1, 0x30] - movs r0, 0x1 - str r0, [r1, 0x2C] - b _0802AE46 - .pool -_0802AE34: - ldr r0, =0x02022cfc - ldr r2, [r0] - subs r1, 0x1 - movs r0, 0x1 - lsls r0, r1 - subs r0, 0x1 - str r0, [r2, 0x30] - movs r0, 0 - str r0, [r2, 0x2C] -_0802AE46: - pop {r0} - bx r0 - .pool - thumb_func_end sub_802AE14 - - thumb_func_start sub_802AE50 -sub_802AE50: @ 802AE50 - push {r4-r6,lr} - ldr r4, =0x02022cfc - ldr r1, [r4] - adds r1, 0x70 - movs r2, 0 - strb r0, [r1] - ldr r0, [r4] - movs r3, 0 - strh r2, [r0, 0x8] - strh r2, [r0, 0xA] - adds r0, 0x48 - movs r1, 0x1 - strb r1, [r0] - ldr r0, [r4] - adds r0, 0x49 - strb r3, [r0] - movs r3, 0x1 - ldr r0, [r4] - ldrb r0, [r0, 0x5] - cmp r3, r0 - bge _0802AE94 - adds r6, r4, 0 - ldr r5, =0x000082fc - movs r4, 0 - movs r2, 0x28 -_0802AE82: - ldr r1, [r6] - adds r0, r1, r5 - adds r0, r2 - str r4, [r0] - adds r2, 0x28 - adds r3, 0x1 - ldrb r1, [r1, 0x5] - cmp r3, r1 - blt _0802AE82 -_0802AE94: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802AE50 - - thumb_func_start sub_802AEA4 -sub_802AEA4: @ 802AEA4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - movs r4, 0x1 - movs r0, 0 - str r0, [sp, 0x4] - ldr r7, =0x02022cfc - ldr r0, [r7] - ldrb r0, [r0, 0x5] - cmp r4, r0 - bge _0802AF48 - adds r1, r7, 0 - mov r10, r1 - movs r2, 0x2 - add r2, sp - mov r8, r2 - ldr r3, =0x0000830c - mov r9, r3 - movs r6, 0x28 -_0802AED0: - mov r1, r10 - ldr r0, [r1] - adds r1, r0, r6 - ldr r2, =0x000082f4 - adds r1, r2 - ldrh r5, [r1] - add r0, r9 - adds r1, r4, 0 - mov r2, sp - mov r3, r8 - bl sub_802E264 - cmp r0, 0 - beq _0802AF10 - ldr r2, [r7] - lsls r1, r4, 1 - adds r0, r2, 0 - adds r0, 0x90 - adds r0, r1 - mov r3, r8 - ldrh r1, [r3] - strh r1, [r0] - adds r2, 0x8B - adds r2, r4 - mov r0, sp - ldrb r0, [r0] - strb r0, [r2] - ldr r0, [r7] - adds r0, r6 - ldr r1, =0x000082f6 - adds r0, r1 - strh r5, [r0] -_0802AF10: - mov r2, r10 - ldr r1, [r2] - ldr r3, =0x000082fc - adds r0, r1, r3 - adds r0, r6 - ldr r0, [r0] - cmp r0, 0 - beq _0802AF36 - adds r0, r1, 0 - adds r0, 0x8B - adds r0, r4 - adds r1, 0x70 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bne _0802AF36 - ldr r0, [sp, 0x4] - adds r0, 0x1 - str r0, [sp, 0x4] -_0802AF36: - movs r1, 0x28 - add r9, r1 - adds r6, 0x28 - adds r4, 0x1 - ldr r7, =0x02022cfc - ldr r0, [r7] - ldrb r0, [r0, 0x5] - cmp r4, r0 - blt _0802AED0 -_0802AF48: - ldr r2, =0x02022cfc - ldr r1, [r2] - ldrb r0, [r1, 0x5] - subs r0, 0x1 - ldr r3, [sp, 0x4] - cmp r3, r0 - bne _0802AF5C - adds r1, 0x49 - movs r0, 0x1 - strb r0, [r1] -_0802AF5C: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802AEA4 - - thumb_func_start sub_802AF80 -sub_802AF80: @ 802AF80 - push {r4,r5,lr} - bl sub_802AEA4 - bl sub_802C43C - ldr r0, =0x02022cfc - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x48 - ldrb r0, [r0] - cmp r0, 0 - bne _0802AFB2 - adds r0, r1, 0 - adds r0, 0x49 - ldrb r0, [r0] - cmp r0, 0 - beq _0802AFB2 - adds r0, r1, 0 - adds r0, 0x4C - ldrb r0, [r0] - bl sub_802AE50 - movs r0, 0x3 - bl sub_802AE14 -_0802AFB2: - ldr r4, =0x02022cfc - ldr r2, [r4] - adds r0, r2, 0 - adds r0, 0x48 - ldrb r5, [r0] - cmp r5, 0x1 - bne _0802AFEE - ldr r1, =gUnknown_082FB5F4 - adds r0, 0x28 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - adds r1, r0, 0 - cmp r1, 0 - bne _0802AFEE - ldr r0, [r4] - adds r0, 0x48 - strb r1, [r0] - ldr r1, [r4] - ldrb r2, [r1, 0x6] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r2, =0x000082fc - adds r1, r2 - adds r1, r0 - str r5, [r1] -_0802AFEE: - bl sub_802C1DC - bl sub_802B008 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802AF80 - - thumb_func_start sub_802B008 -sub_802B008: @ 802B008 - push {r4,lr} - ldr r4, =0x02022cfc - ldr r1, [r4] - ldr r0, [r1, 0x2C] - cmp r0, 0 - bne _0802B01E - ldr r2, =0x000082e4 - adds r0, r1, r2 - adds r1, 0x70 - bl sub_802E138 -_0802B01E: - ldr r1, [r4] - ldr r2, [r1, 0x30] - ldr r0, =0x00001111 - cmp r2, r0 - beq _0802B030 - ldr r0, [r1, 0x2C] - adds r0, 0x1 - ands r0, r2 - str r0, [r1, 0x2C] -_0802B030: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802B008 - - thumb_func_start sub_802B044 -sub_802B044: @ 802B044 - ldr r2, =0x02022cfc - ldr r1, [r2] - adds r1, 0x70 - movs r3, 0 - strb r0, [r1] - ldr r0, [r2] - strh r3, [r0, 0x8] - strh r3, [r0, 0xA] - adds r0, 0x48 - movs r1, 0x1 - strb r1, [r0] - ldr r1, [r2] - ldrb r2, [r1, 0x6] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r2, =0x000082fc - adds r1, r2 - adds r1, r0 - str r3, [r1] - bx lr - .pool - thumb_func_end sub_802B044 - - thumb_func_start sub_802B078 -sub_802B078: @ 802B078 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - ldr r4, =0x02022cfc - ldr r0, [r4] - ldr r2, =0x000082f4 - adds r1, r0, r2 - ldrh r1, [r1] - mov r8, r1 - ldr r3, =0x000082e4 - adds r0, r3 - mov r1, sp - bl sub_802E1BC - cmp r0, 0 - beq _0802B128 - ldr r2, [r4] - ldrb r0, [r2, 0x6] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r3, =0x000082fc - adds r0, r2, r3 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0x1 - bne _0802B0C6 - mov r0, sp - adds r1, r2, 0 - adds r1, 0x70 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - beq _0802B0C6 - mov r0, sp - ldrb r0, [r0] - bl sub_802B044 -_0802B0C6: - ldr r3, =0x02022cfc - ldr r2, [r3] - ldr r0, [r2, 0x78] - ldr r1, [sp, 0x8] - cmp r0, r1 - beq _0802B108 - str r1, [r2, 0x78] - movs r4, 0x1 - str r4, [r2, 0x5C] - mov r0, sp - ldrb r1, [r0, 0x1] - adds r0, r2, 0 - adds r0, 0x71 - strb r1, [r0] - ldr r0, [r3] - adds r1, r0, 0 - adds r1, 0x71 - ldrb r1, [r1] - cmp r1, 0 - beq _0802B104 - adds r0, 0x4D - strb r4, [r0] - b _0802B108 - .pool -_0802B104: - adds r0, 0x4D - strb r1, [r0] -_0802B108: - ldr r0, =0x02022cfc - ldr r1, [r0] - mov r0, sp - ldrh r0, [r0, 0x2] - adds r2, r1, 0 - adds r2, 0x72 - strh r0, [r2] - mov r0, sp - ldrh r2, [r0, 0x4] - adds r0, r1, 0 - adds r0, 0x74 - strh r2, [r0] - ldr r0, =0x000082f6 - adds r1, r0 - mov r2, r8 - strh r2, [r1] -_0802B128: - movs r4, 0x1 - ldr r2, =0x02022cfc - ldr r0, [r2] - ldrb r0, [r0, 0x5] - cmp r4, r0 - bge _0802B176 - adds r7, r2, 0 - ldr r6, =0x0000830c - movs r5, 0x28 -_0802B13A: - ldr r1, [r7] - ldrb r3, [r1, 0x6] - cmp r4, r3 - beq _0802B168 - adds r0, r1, r5 - ldr r3, =0x000082f4 - adds r0, r3 - ldrh r0, [r0] - mov r8, r0 - adds r0, r1, r6 - adds r1, r4, 0 - str r2, [sp, 0xC] - bl sub_802E2D0 - ldr r2, [sp, 0xC] - cmp r0, 0 - beq _0802B168 - ldr r0, [r7] - adds r0, r5 - ldr r1, =0x000082f6 - adds r0, r1 - mov r3, r8 - strh r3, [r0] -_0802B168: - adds r6, 0x28 - adds r5, 0x28 - adds r4, 0x1 - ldr r0, [r2] - ldrb r0, [r0, 0x5] - cmp r4, r0 - blt _0802B13A -_0802B176: - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802B078 - - thumb_func_start sub_802B194 -sub_802B194: @ 802B194 - push {r4,lr} - bl sub_802B078 - ldr r4, =0x02022cfc - ldr r2, [r4] - adds r0, r2, 0 - adds r0, 0x48 - ldrb r0, [r0] - cmp r0, 0 - beq _0802B1E0 - ldr r1, =gUnknown_082FB618 - adds r0, r2, 0 - adds r0, 0x70 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - adds r1, r0, 0 - cmp r1, 0 - bne _0802B1E0 - ldr r0, [r4] - adds r0, 0x48 - strb r1, [r0] - ldr r1, [r4] - ldrb r2, [r1, 0x6] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r2, =0x000082fc - adds r1, r2 - adds r1, r0 - movs r0, 0x1 - str r0, [r1] - movs r0, 0x3 - bl sub_802AE14 -_0802B1E0: - bl sub_802C1DC - bl sub_802B1FC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802B194 - - thumb_func_start sub_802B1FC -sub_802B1FC: @ 802B1FC - push {r4,lr} - ldr r4, =0x02022cfc - ldr r2, [r4] - ldr r0, [r2, 0x2C] - cmp r0, 0 - bne _0802B224 - ldrb r1, [r2, 0x6] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - ldr r1, =0x000082e4 - adds r0, r1 - adds r0, r2, r0 - adds r1, r2, 0 - adds r1, 0x70 - ldrb r1, [r1] - adds r2, 0x42 - ldrh r2, [r2] - bl sub_802E234 -_0802B224: - ldr r1, [r4] - ldr r2, [r1, 0x30] - ldr r0, =0x00001111 - cmp r2, r0 - beq _0802B236 - ldr r0, [r1, 0x2C] - adds r0, 0x1 - ands r0, r2 - str r0, [r1, 0x2C] -_0802B236: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802B1FC - - thumb_func_start sub_802B248 -sub_802B248: @ 802B248 - push {r4,lr} - ldr r4, =0x02022cfc - ldr r0, [r4] - ldrh r0, [r0, 0x8] - cmp r0, 0 - beq _0802B260 - cmp r0, 0x1 - beq _0802B26E - b _0802B294 - .pool -_0802B260: - movs r0, 0x3 - bl sub_802AE14 - ldr r1, [r4] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_0802B26E: - bl sub_802B7E0 - cmp r0, 0 - bne _0802B294 - ldr r0, =0x02022cfc - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x4A - ldrh r0, [r0] - adds r2, r1, 0 - adds r2, 0x72 - strh r0, [r2] - adds r1, 0x4C - movs r0, 0x1 - strb r0, [r1] - movs r0, 0 - b _0802B296 - .pool -_0802B294: - movs r0, 0x1 -_0802B296: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802B248 - - thumb_func_start sub_802B29C -sub_802B29C: @ 802B29C - push {r4,lr} - ldr r4, =0x02022cfc - ldr r0, [r4] - ldrh r0, [r0, 0x8] - cmp r0, 0 - beq _0802B2B4 - cmp r0, 0x1 - beq _0802B2CA - movs r0, 0x1 - b _0802B2CE - .pool -_0802B2B4: - movs r0, 0 - bl sub_802AE14 - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x72 - ldrh r0, [r0] - str r0, [r1, 0x24] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_0802B2CA: - bl sub_802B7E0 -_0802B2CE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802B29C - - thumb_func_start sub_802B2D4 -sub_802B2D4: @ 802B2D4 - push {r4,lr} - ldr r4, =0x02022cfc - ldr r1, [r4] - ldrh r0, [r1, 0x8] - cmp r0, 0 - beq _0802B2EC - cmp r0, 0x1 - beq _0802B300 - b _0802B314 - .pool -_0802B2EC: - bl sub_802C0E8 - movs r0, 0x5 - bl sub_802AE14 - ldr r1, [r4] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0802B314 -_0802B300: - adds r0, r1, 0 - adds r0, 0x49 - ldrb r0, [r0] - cmp r0, 0 - beq _0802B314 - adds r1, 0x4C - movs r0, 0x2 - strb r0, [r1] - movs r0, 0 - b _0802B316 -_0802B314: - movs r0, 0x1 -_0802B316: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802B2D4 - - thumb_func_start sub_802B31C -sub_802B31C: @ 802B31C - push {r4,lr} - ldr r4, =0x02022cfc - ldr r0, [r4] - ldrh r0, [r0, 0x8] - cmp r0, 0 - beq _0802B334 - cmp r0, 0x1 - beq _0802B352 - b _0802B35E - .pool -_0802B334: - bl sub_802C0E8 - movs r0, 0 - bl sub_802AE14 - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x72 - ldrh r0, [r0] - adds r2, r1, 0 - adds r2, 0x4A - strh r0, [r2] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_0802B352: - bl sub_802C70C - cmp r0, 0 - beq _0802B35E - movs r0, 0 - b _0802B360 -_0802B35E: - movs r0, 0x1 -_0802B360: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802B31C - - thumb_func_start sub_802B368 -sub_802B368: @ 802B368 - push {lr} - bl sub_802B8CC - cmp r0, 0 - bne _0802B390 - ldr r0, =0x02022cfc - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x4A - ldrh r0, [r0] - adds r2, r1, 0 - adds r2, 0x72 - strh r0, [r2] - adds r1, 0x4C - movs r0, 0x1 - strb r0, [r1] - b _0802B3AA - .pool -_0802B390: - bl sub_802C538 - cmp r0, 0 - beq _0802B39C - movs r0, 0x1 - b _0802B3AC -_0802B39C: - bl sub_802C0B8 - ldr r0, =0x02022cfc - ldr r0, [r0] - adds r0, 0x4C - movs r1, 0x3 - strb r1, [r0] -_0802B3AA: - movs r0, 0 -_0802B3AC: - pop {r1} - bx r1 - .pool - thumb_func_end sub_802B368 - - thumb_func_start sub_802B3B4 -sub_802B3B4: @ 802B3B4 - push {lr} - bl sub_802B8CC - cmp r0, 0 - beq _0802B3CE - bl sub_802C538 - cmp r0, 0 - beq _0802B3CA - movs r0, 0x1 - b _0802B3D0 -_0802B3CA: - bl sub_802C0B8 -_0802B3CE: - movs r0, 0 -_0802B3D0: - pop {r1} - bx r1 - thumb_func_end sub_802B3B4 - - thumb_func_start sub_802B3D4 -sub_802B3D4: @ 802B3D4 - push {r4,lr} - ldr r4, =0x02022cfc - ldr r0, [r4] - ldrh r0, [r0, 0x8] - cmp r0, 0x1 - beq _0802B40C - cmp r0, 0x1 - bgt _0802B3F0 - cmp r0, 0 - beq _0802B3F6 - b _0802B468 - .pool -_0802B3F0: - cmp r0, 0x2 - beq _0802B460 - b _0802B468 -_0802B3F6: - bl sub_802C538 - bl sub_802C5DC - cmp r0, 0 - beq _0802B468 - ldr r1, [r4] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0802B468 -_0802B40C: - bl sub_802B964 - cmp r0, 0 - bne _0802B468 - bl sub_802C7BC - cmp r0, 0 - beq _0802B42E - bl sub_802C7E0 - ldr r1, [r4] - adds r2, r1, 0 - adds r2, 0x72 - strh r0, [r2] - adds r1, 0x4C - movs r0, 0x7 - b _0802B454 -_0802B42E: - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x74 - ldrh r0, [r0] - cmp r0, 0xC7 - bls _0802B448 - ldrh r0, [r1, 0xE] - adds r2, r1, 0 - adds r2, 0x72 - strh r0, [r2] - adds r1, 0x4C - movs r0, 0x8 - b _0802B454 -_0802B448: - ldrh r0, [r1, 0xE] - adds r2, r1, 0 - adds r2, 0x72 - strh r0, [r2] - adds r1, 0x4C - movs r0, 0x4 -_0802B454: - strb r0, [r1] - ldr r0, =0x02022cfc - ldr r1, [r0] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_0802B460: - movs r0, 0 - b _0802B46A - .pool -_0802B468: - movs r0, 0x1 -_0802B46A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802B3D4 - - thumb_func_start sub_802B470 -sub_802B470: @ 802B470 - push {r4,lr} - ldr r4, =0x02022cfc - ldr r0, [r4] - ldrh r0, [r0, 0x8] - cmp r0, 0x1 - beq _0802B4B0 - cmp r0, 0x1 - bgt _0802B48C - cmp r0, 0 - beq _0802B492 - b _0802B4C4 - .pool -_0802B48C: - cmp r0, 0x2 - beq _0802B4C0 - b _0802B4C4 -_0802B492: - bl sub_802C538 - cmp r0, 0 - bne _0802B49E - bl sub_802C0B8 -_0802B49E: - bl sub_802C5DC - cmp r0, 0 - beq _0802B4C4 - ldr r1, [r4] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0802B4C4 -_0802B4B0: - bl sub_802B964 - cmp r0, 0 - bne _0802B4C4 - ldr r1, [r4] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_0802B4C0: - movs r0, 0 - b _0802B4C6 -_0802B4C4: - movs r0, 0x1 -_0802B4C6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802B470 - - thumb_func_start sub_802B4CC -sub_802B4CC: @ 802B4CC - push {r4,lr} - ldr r4, =0x02022cfc - ldr r0, [r4] - ldrh r1, [r0, 0x8] - cmp r1, 0x1 - beq _0802B500 - cmp r1, 0x1 - bgt _0802B4E8 - cmp r1, 0 - beq _0802B4F2 - b _0802B560 - .pool -_0802B4E8: - cmp r1, 0x2 - beq _0802B52C - cmp r1, 0x3 - beq _0802B556 - b _0802B560 -_0802B4F2: - movs r0, 0x4 - bl sub_802AE14 - ldr r1, [r4] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_0802B500: - bl sub_802BB84 - cmp r0, 0 - bne _0802B560 - ldr r4, =0x02022cfc - ldr r2, [r4] - ldr r0, [r2, 0x78] - adds r1, r2, 0 - adds r1, 0x74 - ldrh r1, [r1] - adds r2, 0x72 - ldrh r2, [r2] - bl sub_802E354 - ldr r1, [r4] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0802B560 - .pool -_0802B52C: - adds r0, 0x49 - ldrb r0, [r0] - cmp r0, 0 - beq _0802B560 - bl sub_802C650 - cmp r0, 0 - beq _0802B544 - ldr r0, [r4] - adds r0, 0x4C - movs r1, 0x5 - b _0802B54A -_0802B544: - ldr r0, [r4] - adds r0, 0x4C - movs r1, 0x6 -_0802B54A: - strb r1, [r0] - ldr r0, =0x02022cfc - ldr r1, [r0] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_0802B556: - movs r0, 0 - b _0802B562 - .pool -_0802B560: - movs r0, 0x1 -_0802B562: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802B4CC - - thumb_func_start sub_802B568 -sub_802B568: @ 802B568 - push {r4,lr} - ldr r4, =0x02022cfc - ldr r0, [r4] - ldrh r0, [r0, 0x8] - cmp r0, 0 - beq _0802B580 - cmp r0, 0x1 - beq _0802B58E - b _0802B5C0 - .pool -_0802B580: - movs r0, 0 - bl sub_802AE14 - ldr r1, [r4] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_0802B58E: - bl sub_802BB84 - cmp r0, 0 - bne _0802B5C0 - ldr r4, =0x02022cfc - ldr r2, [r4] - ldr r0, [r2, 0x78] - adds r1, r2, 0 - adds r1, 0x74 - ldrh r1, [r1] - adds r2, 0x72 - ldrh r2, [r2] - bl sub_802E354 - ldr r0, [r4] - adds r1, r0, 0 - adds r1, 0x45 - ldrb r1, [r1] - adds r0, 0x42 - strh r1, [r0] - movs r0, 0 - b _0802B5C2 - .pool -_0802B5C0: - movs r0, 0x1 -_0802B5C2: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802B568 - - thumb_func_start sub_802B5C8 -sub_802B5C8: @ 802B5C8 - push {r4,lr} - ldr r4, =0x02022cfc - ldr r1, [r4] - ldrh r0, [r1, 0x8] - cmp r0, 0 - beq _0802B5E0 - cmp r0, 0x1 - beq _0802B5F2 - b _0802B61E - .pool -_0802B5E0: - bl sub_802BD30 - cmp r0, 0 - bne _0802B61E - ldr r1, [r4] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0802B61E -_0802B5F2: - adds r0, r1, 0 - adds r0, 0x49 - ldrb r0, [r0] - cmp r0, 0 - beq _0802B61E - adds r0, r1, 0 - bl sub_802AA94 - bl GenerateRandomNumber - ldr r1, [r4] - lsls r0, 16 - lsrs r0, 16 - str r0, [r1, 0x24] - adds r3, r1, 0 - adds r3, 0x72 - movs r2, 0 - strh r0, [r3] - adds r1, 0x4C - strb r2, [r1] - movs r0, 0 - b _0802B620 -_0802B61E: - movs r0, 0x1 -_0802B620: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802B5C8 - - thumb_func_start sub_802B628 -sub_802B628: @ 802B628 - push {r4,lr} - ldr r4, =0x02022cfc - ldr r0, [r4] - ldrh r0, [r0, 0x8] - cmp r0, 0 - beq _0802B640 - cmp r0, 0x1 - beq _0802B656 - b _0802B65A - .pool -_0802B640: - bl sub_802BD30 - cmp r0, 0 - bne _0802B65A - ldr r0, [r4] - bl sub_802AA94 - ldr r1, [r4] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_0802B656: - movs r0, 0 - b _0802B65C -_0802B65A: - movs r0, 0x1 -_0802B65C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802B628 - - thumb_func_start sub_802B664 -sub_802B664: @ 802B664 - push {r4,lr} - ldr r4, =0x02022cfc - ldr r1, [r4] - ldrh r0, [r1, 0x8] - cmp r0, 0x1 - beq _0802B68C - cmp r0, 0x1 - bgt _0802B680 - cmp r0, 0 - beq _0802B686 - b _0802B6B0 - .pool -_0802B680: - cmp r0, 0x2 - beq _0802B69C - b _0802B6B0 -_0802B686: - movs r0, 0x1 - strh r0, [r1, 0x8] - b _0802B6B0 -_0802B68C: - movs r0, 0 - bl sub_802AE14 - ldr r1, [r4] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0802B6B0 -_0802B69C: - bl sub_802BC60 - cmp r0, 0 - bne _0802B6B0 - ldr r0, [r4] - ldr r0, [r0] - bl SetMainCallback2 - bl sub_802AA48 -_0802B6B0: - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802B664 - - thumb_func_start sub_802B6B8 -sub_802B6B8: @ 802B6B8 - push {r4,lr} - ldr r4, =0x02022cfc - ldr r0, [r4] - ldrh r0, [r0, 0x8] - cmp r0, 0 - beq _0802B6D0 - cmp r0, 0x1 - beq _0802B6E0 - b _0802B6FC - .pool -_0802B6D0: - movs r0, 0x4 - bl sub_802AE14 - ldr r1, [r4] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0802B6FC -_0802B6E0: - bl sub_802BA58 - cmp r0, 0 - bne _0802B6FC - ldr r0, [r4] - ldrh r1, [r0, 0xE] - adds r2, r0, 0 - adds r2, 0x72 - strh r1, [r2] - adds r0, 0x4C - movs r1, 0x8 - strb r1, [r0] - movs r0, 0 - b _0802B6FE -_0802B6FC: - movs r0, 0x1 -_0802B6FE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802B6B8 - - thumb_func_start sub_802B704 -sub_802B704: @ 802B704 - push {lr} - movs r0, 0 - bl sub_802AE14 - bl sub_802BA58 - cmp r0, 0 - beq _0802B718 - movs r0, 0x1 - b _0802B71A -_0802B718: - movs r0, 0 -_0802B71A: - pop {r1} - bx r1 - thumb_func_end sub_802B704 - - thumb_func_start sub_802B720 -sub_802B720: @ 802B720 - push {r4,lr} - ldr r1, =0x02022cfc - ldr r0, [r1] - ldrh r0, [r0, 0x8] - adds r4, r1, 0 - cmp r0, 0x4 - bhi _0802B7D8 - lsls r0, 2 - ldr r1, =_0802B740 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0802B740: - .4byte _0802B754 - .4byte _0802B770 - .4byte _0802B780 - .4byte _0802B798 - .4byte _0802B7BC -_0802B754: - ldr r2, [r4] - ldr r0, [r2, 0x78] - adds r1, r2, 0 - adds r1, 0x74 - ldrh r1, [r1] - adds r2, 0x72 - ldrh r2, [r2] - bl sub_802E354 - movs r0, 0x5 - bl sub_802D0C8 - ldr r1, [r4] - b _0802B7AC -_0802B770: - bl sub_802D0F0 - cmp r0, 0 - bne _0802B7D8 - movs r0, 0 - bl sub_802AE14 - b _0802B7A8 -_0802B780: - bl sub_802C70C - cmp r0, 0 - beq _0802B7D8 - ldr r0, =sub_8153688 - movs r1, 0x6 - bl AddTask - b _0802B7A8 - .pool -_0802B798: - ldr r0, =sub_8153688 - bl is_function_an_active_task - lsls r0, 24 - cmp r0, 0 - bne _0802B7D8 - bl sub_802DA14 -_0802B7A8: - ldr r0, =0x02022cfc - ldr r1, [r0] -_0802B7AC: - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0802B7D8 - .pool -_0802B7BC: - bl sub_802DA44 - cmp r0, 0 - bne _0802B7D8 - ldr r0, =0x02022cfc - ldr r0, [r0] - adds r0, 0x4C - movs r1, 0x4 - strb r1, [r0] - movs r0, 0 - b _0802B7DA - .pool -_0802B7D8: - movs r0, 0x1 -_0802B7DA: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802B720 - - thumb_func_start sub_802B7E0 -sub_802B7E0: @ 802B7E0 - push {r4,r5,lr} - ldr r1, =0x02022cfc - ldr r0, [r1] - ldrh r0, [r0, 0xA] - adds r4, r1, 0 - cmp r0, 0x7 - bhi _0802B8C4 - lsls r0, 2 - ldr r1, =_0802B800 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0802B800: - .4byte _0802B820 - .4byte _0802B82C - .4byte _0802B84C - .4byte _0802B866 - .4byte _0802B878 - .4byte _0802B880 - .4byte _0802B8A0 - .4byte _0802B8BA -_0802B820: - movs r0, 0x2 - bl sub_802D0C8 - bl sub_802DDE0 - b _0802B890 -_0802B82C: - bl sub_802D0F0 - adds r5, r0, 0 - cmp r5, 0 - bne _0802B8C4 - ldr r4, =0x02022cfc - ldr r0, [r4] - ldrb r0, [r0, 0x6] - bl sub_802DDF4 - ldr r1, [r4] - strh r5, [r1, 0x3C] - b _0802B894 - .pool -_0802B84C: - ldr r1, [r4] - ldrh r0, [r1, 0x3C] - adds r0, 0x1 - strh r0, [r1, 0x3C] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x78 - bls _0802B8C4 - movs r0, 0x3 - bl sub_802D0C8 - ldr r1, [r4] - b _0802B894 -_0802B866: - bl sub_802D0F0 - cmp r0, 0x1 - beq _0802B8C4 - bl sub_802DE08 - cmp r0, 0x1 - beq _0802B8C4 - b _0802B890 -_0802B878: - movs r0, 0x9 - bl sub_802D0C8 - b _0802B890 -_0802B880: - bl sub_802D0F0 - cmp r0, 0 - bne _0802B8C4 - bl sub_802C260 - bl sub_802D764 -_0802B890: - ldr r0, =0x02022cfc - ldr r1, [r0] -_0802B894: - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] - b _0802B8C4 - .pool -_0802B8A0: - bl sub_802D788 - cmp r0, 0 - bne _0802B8C4 - bl sub_802C270 - bl sub_802BEA0 - ldr r0, =0x02022cfc - ldr r1, [r0] - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] -_0802B8BA: - movs r0, 0 - b _0802B8C6 - .pool -_0802B8C4: - movs r0, 0x1 -_0802B8C6: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_802B7E0 - - thumb_func_start sub_802B8CC -sub_802B8CC: @ 802B8CC - push {r4,r5,lr} - bl sub_802BEE4 - ldr r5, =0x02022cfc - ldr r1, [r5] - ldrh r4, [r1, 0x36] - cmp r4, 0 - beq _0802B8E8 - movs r0, 0 - strh r0, [r1, 0x36] - b _0802B95C - .pool -_0802B8E8: - ldrh r0, [r1, 0xA] - cmp r0, 0x1 - beq _0802B914 - cmp r0, 0x1 - bgt _0802B8F8 - cmp r0, 0 - beq _0802B902 - b _0802B95A -_0802B8F8: - cmp r0, 0x2 - beq _0802B938 - cmp r0, 0x3 - beq _0802B94C - b _0802B95A -_0802B902: - movs r0, 0 - bl sub_802C130 - cmp r0, 0 - beq _0802B95A - ldr r1, [r5] - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] -_0802B914: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0802B95A - bl sub_802C164 - movs r0, 0x3 - bl sub_802AE14 - ldr r0, =0x02022cfc - ldr r1, [r0] - b _0802B944 - .pool -_0802B938: - movs r0, 0x1 - bl sub_802C130 - cmp r0, 0x1 - bne _0802B95A - ldr r1, [r5] -_0802B944: - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] - b _0802B95A -_0802B94C: - movs r0, 0 - bl sub_802C130 - cmp r0, 0x1 - bne _0802B95A - ldr r0, [r5] - strh r4, [r0, 0xA] -_0802B95A: - movs r0, 0x1 -_0802B95C: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_802B8CC - - thumb_func_start sub_802B964 -sub_802B964: @ 802B964 - push {r4-r6,lr} - ldr r1, =0x02022cfc - ldr r0, [r1] - ldrh r0, [r0, 0xA] - adds r5, r1, 0 - cmp r0, 0x4 - bhi _0802BA50 - lsls r0, 2 - ldr r1, =_0802B984 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0802B984: - .4byte _0802B998 - .4byte _0802B9BC - .4byte _0802BA00 - .4byte _0802BA24 - .4byte _0802BA46 -_0802B998: - movs r4, 0 - ldr r0, [r5] - ldrb r0, [r0, 0x5] - cmp r4, r0 - bge _0802B9B8 - adds r6, r5, 0 -_0802B9A4: - adds r0, r4, 0 - bl sub_802DDB8 - cmp r0, 0x1 - beq _0802BA50 - adds r4, 0x1 - ldr r0, [r6] - ldrb r0, [r0, 0x5] - cmp r4, r0 - blt _0802B9A4 -_0802B9B8: - ldr r1, [r5] - b _0802BA1C -_0802B9BC: - movs r4, 0 - ldr r0, [r5] - ldrb r0, [r0, 0x5] - cmp r4, r0 - bge _0802B9EC - adds r6, r5, 0 - movs r5, 0 -_0802B9CA: - ldr r0, [r6] - adds r0, r5 - ldr r1, =0x000082f4 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0x2 - bne _0802B9E0 - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_802DDA0 -_0802B9E0: - adds r5, 0x28 - adds r4, 0x1 - ldr r0, [r6] - ldrb r0, [r0, 0x5] - cmp r4, r0 - blt _0802B9CA -_0802B9EC: - movs r0, 0x1 - bl sub_802D0C8 - ldr r0, =0x02022cfc - ldr r1, [r0] - b _0802BA18 - .pool -_0802BA00: - ldr r1, [r5] - ldrh r0, [r1, 0x3C] - adds r0, 0x1 - strh r0, [r1, 0x3C] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x64 - bls _0802BA50 - movs r0, 0x3 - bl sub_802D0C8 - ldr r1, [r5] -_0802BA18: - movs r0, 0 - strh r0, [r1, 0x3C] -_0802BA1C: - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] - b _0802BA50 -_0802BA24: - bl sub_802D0F0 - adds r5, r0, 0 - cmp r5, 0 - bne _0802BA50 - bl sub_802DDCC - ldr r4, =0x02022cfc - ldr r0, [r4] - adds r0, 0x71 - strb r5, [r0] - bl sub_802C114 - ldr r1, [r4] - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] -_0802BA46: - movs r0, 0 - b _0802BA52 - .pool -_0802BA50: - movs r0, 0x1 -_0802BA52: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_802B964 - - thumb_func_start sub_802BA58 -sub_802BA58: @ 802BA58 - push {r4,lr} - ldr r1, =0x02022cfc - ldr r0, [r1] - ldrh r0, [r0, 0xA] - adds r4, r1, 0 - cmp r0, 0x6 - bls _0802BA68 - b _0802BB7C -_0802BA68: - lsls r0, 2 - ldr r1, =_0802BA7C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0802BA7C: - .4byte _0802BA98 - .4byte _0802BAB8 - .4byte _0802BAD0 - .4byte _0802BB00 - .4byte _0802BAB8 - .4byte _0802BAD0 - .4byte _0802BB70 -_0802BA98: - ldr r2, [r4] - adds r0, r2, 0 - adds r0, 0x72 - ldrh r0, [r0] - adds r1, r2, 0 - adds r1, 0x3E - adds r2, 0x40 - bl sub_802C808 - ldr r1, [r4] - ldrh r0, [r1, 0x3E] - adds r1, 0x40 - ldrh r1, [r1] - bl sub_802D7E8 - b _0802BAF0 -_0802BAB8: - bl sub_802D974 - adds r2, r0, 0 - cmp r2, 0 - bne _0802BB7C - ldr r0, =0x02022cfc - ldr r1, [r0] - strh r2, [r1, 0x3C] - b _0802BAF2 - .pool -_0802BAD0: - ldr r1, [r4] - ldrh r0, [r1, 0x3C] - adds r2, r0, 0x1 - strh r2, [r1, 0x3C] - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _0802BAEC - lsls r0, r2, 16 - lsrs r0, 16 - cmp r0, 0xB4 - bls _0802BB7C -_0802BAEC: - bl sub_802DA14 -_0802BAF0: - ldr r1, [r4] -_0802BAF2: - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] - b _0802BB7C - .pool -_0802BB00: - bl sub_802DA44 - cmp r0, 0 - bne _0802BB7C - ldr r4, =0x02022cfc - ldr r1, [r4] - ldrh r0, [r1, 0x3E] - adds r1, 0x40 - ldrh r1, [r1] - bl sub_802C880 - ldr r1, [r4] - adds r2, r1, 0 - adds r2, 0x40 - strh r0, [r2] - lsls r0, 16 - cmp r0, 0 - beq _0802BB58 - ldrh r0, [r1, 0x3E] - ldrh r1, [r2] - bl bag_add_item - lsls r0, 24 - cmp r0, 0 - beq _0802BB58 - ldr r0, [r4] - ldrh r0, [r0, 0x3E] - movs r1, 0x1 - bl sub_80D6800 - lsls r0, 24 - cmp r0, 0 - bne _0802BB50 - ldr r0, [r4] - ldrh r0, [r0, 0x3E] - bl sub_802D884 - b _0802BB62 - .pool -_0802BB50: - ldr r1, [r4] - movs r0, 0x6 - strh r0, [r1, 0xA] - b _0802BB7C -_0802BB58: - ldr r4, =0x02022cfc - ldr r0, [r4] - ldrh r0, [r0, 0x3E] - bl sub_802D8FC -_0802BB62: - ldr r1, [r4] - movs r0, 0x4 - strh r0, [r1, 0xA] - b _0802BB7C - .pool -_0802BB70: - bl sub_802DA44 - cmp r0, 0 - bne _0802BB7C - movs r0, 0 - b _0802BB7E -_0802BB7C: - movs r0, 0x1 -_0802BB7E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802BA58 - - thumb_func_start sub_802BB84 -sub_802BB84: @ 802BB84 - push {r4,lr} - ldr r0, =0x02022cfc - ldr r0, [r0] - ldrh r0, [r0, 0xA] - cmp r0, 0x6 - bhi _0802BC58 - lsls r0, 2 - ldr r1, =_0802BBA4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0802BBA4: - .4byte _0802BBC0 - .4byte _0802BBC4 - .4byte _0802BBCE - .4byte _0802BC1C - .4byte _0802BC26 - .4byte _0802BC3C - .4byte _0802BC4E -_0802BBC0: - movs r0, 0x4 - b _0802BC28 -_0802BBC4: - bl sub_802D0F0 - cmp r0, 0 - bne _0802BC58 - b _0802BC2C -_0802BBCE: - bl sub_802DA8C - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _0802BC04 - cmp r1, 0 - bgt _0802BBE8 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _0802BBEC - b _0802BC58 -_0802BBE8: - cmp r1, 0x1 - bne _0802BC58 -_0802BBEC: - ldr r4, =0x02022cfc - ldr r0, [r4] - adds r0, 0x45 - movs r1, 0x1 - strb r1, [r0] - movs r0, 0x6 - bl sub_802D0C8 - ldr r1, [r4] - b _0802BC30 - .pool -_0802BC04: - ldr r4, =0x02022cfc - ldr r0, [r4] - adds r0, 0x45 - movs r1, 0x2 - strb r1, [r0] - movs r0, 0x6 - bl sub_802D0C8 - ldr r1, [r4] - b _0802BC30 - .pool -_0802BC1C: - bl sub_802D0F0 - cmp r0, 0 - bne _0802BC58 - b _0802BC2C -_0802BC26: - movs r0, 0x8 -_0802BC28: - bl sub_802D0C8 -_0802BC2C: - ldr r0, =0x02022cfc - ldr r1, [r0] -_0802BC30: - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] - b _0802BC58 - .pool -_0802BC3C: - bl sub_802D0F0 - cmp r0, 0 - bne _0802BC58 - ldr r0, =0x02022cfc - ldr r1, [r0] - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] -_0802BC4E: - movs r0, 0 - b _0802BC5A - .pool -_0802BC58: - movs r0, 0x1 -_0802BC5A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802BB84 - - thumb_func_start sub_802BC60 -sub_802BC60: @ 802BC60 - push {r4,lr} - sub sp, 0x4 - ldr r1, =0x02022cfc - ldr r0, [r1] - ldrh r0, [r0, 0xA] - adds r4, r1, 0 - cmp r0, 0x5 - bhi _0802BD24 - lsls r0, 2 - ldr r1, =_0802BC84 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0802BC84: - .4byte _0802BC9C - .4byte _0802BCA2 - .4byte _0802BCB2 - .4byte _0802BCC8 - .4byte _0802BCEE - .4byte _0802BD14 -_0802BC9C: - bl sub_802DA14 - b _0802BCFE -_0802BCA2: - bl sub_802DA44 - cmp r0, 0 - bne _0802BD24 - movs r0, 0x7 - bl sub_802D0C8 - b _0802BCFE -_0802BCB2: - bl sub_802D0F0 - adds r2, r0, 0 - cmp r2, 0 - bne _0802BD24 - ldr r0, =0x02022cfc - ldr r1, [r0] - strh r2, [r1, 0x3C] - b _0802BD02 - .pool -_0802BCC8: - ldr r1, [r4] - ldrh r0, [r1, 0x3C] - adds r0, 0x1 - strh r0, [r1, 0x3C] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x78 - bls _0802BD24 - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - str r0, [sp] - adds r0, r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, [r4] - b _0802BD02 -_0802BCEE: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0802BD24 - bl sub_800AC34 -_0802BCFE: - ldr r0, =0x02022cfc - ldr r1, [r0] -_0802BD02: - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] - b _0802BD24 - .pool -_0802BD14: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _0802BD24 - movs r0, 0 - b _0802BD26 - .pool -_0802BD24: - movs r0, 0x1 -_0802BD26: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802BC60 - - thumb_func_start sub_802BD30 -sub_802BD30: @ 802BD30 - push {r4,lr} - ldr r4, =0x02022cfc - ldr r0, [r4] - ldrh r0, [r0, 0xA] - cmp r0, 0x1 - beq _0802BD66 - cmp r0, 0x1 - bgt _0802BD4C - cmp r0, 0 - beq _0802BD52 - b _0802BD7A - .pool -_0802BD4C: - cmp r0, 0x2 - beq _0802BD76 - b _0802BD7A -_0802BD52: - bl sub_802DA14 - movs r0, 0 - bl sub_802DD64 - ldr r1, [r4] - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] - b _0802BD7A -_0802BD66: - bl sub_802DA44 - cmp r0, 0 - bne _0802BD7A - ldr r1, [r4] - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] -_0802BD76: - movs r0, 0 - b _0802BD7C -_0802BD7A: - movs r0, 0x1 -_0802BD7C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802BD30 - - thumb_func_start sub_802BD84 -sub_802BD84: @ 802BD84 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - lsls r0, 2 - add r0, r10 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r6, r0, r1 - mov r0, r10 - movs r1, 0xE - bl get_word_task_arg - mov r8, r0 - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0 - beq _0802BDC8 - cmp r0, 0x1 - beq _0802BDDC - b _0802BE48 - .pool -_0802BDBC: - bl sub_802AB20 - mov r0, r10 - bl remove_task - b _0802BE48 -_0802BDC8: - movs r1, 0 - adds r0, r6, 0 - adds r0, 0x8 -_0802BDCE: - strh r1, [r0, 0x4] - subs r0, 0x2 - cmp r0, r6 - bge _0802BDCE - ldrh r0, [r6] - adds r0, 0x1 - strh r0, [r6] -_0802BDDC: - mov r3, r8 - ldrb r1, [r3, 0x6] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x000082a8 - adds r0, r4 - add r0, r8 - bl sub_802E0AC - movs r2, 0 - adds r5, r6, 0x4 - mov r9, r2 - movs r7, 0x83 - lsls r7, 8 - add r7, r8 - add r4, r8 -_0802BDFE: - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0802BE38 - adds r0, r2, 0 - adds r1, r4, 0 - str r2, [sp] - bl sub_802E0D0 - ldr r2, [sp] - cmp r0, 0 - beq _0802BE38 - ldr r1, =0x020229f0 - add r1, r9 - adds r0, r7, 0 - bl CopyString - movs r0, 0x1 - strh r0, [r5] - ldrh r0, [r6, 0x2] - adds r0, 0x1 - strh r0, [r6, 0x2] - movs r3, 0x2 - ldrsh r0, [r6, r3] - ldr r2, [sp] - mov r1, r8 - ldrb r1, [r1, 0x5] - cmp r0, r1 - beq _0802BDBC -_0802BE38: - adds r5, 0x2 - movs r3, 0x1C - add r9, r3 - adds r7, 0x28 - adds r4, 0xC - adds r2, 0x1 - cmp r2, 0x4 - ble _0802BDFE -_0802BE48: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802BD84 - - thumb_func_start sub_802BE60 -sub_802BE60: @ 802BE60 - push {lr} - lsls r1, 24 - lsrs r1, 24 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022cfc - ldr r2, [r1] - movs r1, 0xE - bl set_word_task_arg - pop {r0} - bx r0 - .pool - thumb_func_end sub_802BE60 - - thumb_func_start sub_802BE80 -sub_802BE80: @ 802BE80 - ldr r0, =0x02022cfc - ldr r2, [r0] - adds r0, r2, 0 - adds r0, 0x4A - movs r1, 0 - strh r1, [r0] - movs r0, 0x6 - str r0, [r2, 0x14] - strh r1, [r2, 0x34] - str r1, [r2, 0x1C] - strh r1, [r2, 0x36] - str r1, [r2, 0x10] - bx lr - .pool - thumb_func_end sub_802BE80 - - thumb_func_start sub_802BEA0 -sub_802BEA0: @ 802BEA0 - push {r4,lr} - ldr r3, =0x02022cfc - ldr r0, [r3] - adds r1, r0, 0 - adds r1, 0x4A - movs r4, 0 - movs r2, 0 - strh r2, [r1] - ldr r1, =0x000006ff - strh r1, [r0, 0x34] - movs r1, 0x7 - str r1, [r0, 0x14] - strh r2, [r0, 0x36] - str r2, [r0, 0x10] - adds r0, 0x51 - strb r4, [r0] - ldr r0, [r3] - adds r0, 0x50 - strb r4, [r0] - ldr r0, [r3] - str r2, [r0, 0x20] - adds r1, r0, 0 - adds r1, 0x4E - strh r2, [r1] - str r2, [r0, 0x6C] - bl sub_802BF7C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802BEA0 - - thumb_func_start sub_802BEE4 -sub_802BEE4: @ 802BEE4 - push {r4,lr} - ldr r4, =0x02022cfc - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x46 - ldrb r0, [r0] - cmp r0, 0 - beq _0802BF34 - adds r1, 0x4A - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - bl sub_802BF48 - ldr r3, [r4] - ldrh r1, [r3, 0x34] - adds r2, r1, r0 - strh r2, [r3, 0x34] - lsls r1, r2, 16 - ldr r0, =0x09fe0000 - cmp r1, r0 - bls _0802BF16 - ldr r1, =0xfffff601 - adds r0, r2, r1 - strh r0, [r3, 0x34] -_0802BF16: - ldr r1, [r4] - ldr r2, [r1, 0x14] - str r2, [r1, 0x18] - ldrh r0, [r1, 0x34] - lsrs r0, 8 - str r0, [r1, 0x14] - cmp r0, 0x6 - bls _0802BF34 - cmp r2, 0x6 - bhi _0802BF34 - ldrh r0, [r1, 0x36] - adds r0, 0x1 - strh r0, [r1, 0x36] - bl sub_802BF7C -_0802BF34: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802BEE4 - - thumb_func_start sub_802BF48 -sub_802BF48: @ 802BF48 - push {lr} - ldr r0, =0x02022cfc - ldr r2, [r0] - ldr r0, [r2, 0x10] - cmp r0, 0 - beq _0802BF5C - movs r0, 0 - b _0802BF72 - .pool -_0802BF5C: - ldr r3, [r2, 0x1C] - ldrh r1, [r2, 0x34] - ldr r0, =0x000005ff - cmp r1, r0 - bhi _0802BF70 - ldr r0, [r2, 0x20] - adds r0, 0x50 - str r0, [r2, 0x20] - lsrs r0, 8 - adds r3, r0 -_0802BF70: - adds r0, r3, 0 -_0802BF72: - pop {r1} - bx r1 - .pool - thumb_func_end sub_802BF48 - - thumb_func_start sub_802BF7C -sub_802BF7C: @ 802BF7C - push {r4,lr} - ldr r4, =0x02022cfc - ldr r3, [r4] - movs r0, 0 - str r0, [r3, 0x20] - adds r1, r3, 0 - adds r1, 0x4E - ldrh r0, [r1] - cmp r0, 0 - beq _0802BFC0 - subs r0, 0x1 - strh r0, [r1] - ldr r0, [r3, 0x6C] - cmp r0, 0 - beq _0802C08A - bl sub_802C098 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0 - beq _0802BFB0 - ldr r1, [r4] - b _0802C086 - .pool -_0802BFB0: - ldr r1, [r4] - ldr r0, [r1, 0x28] - cmp r0, 0x36 - bls _0802BFBC - movs r0, 0x1E - b _0802C088 -_0802BFBC: - movs r0, 0x52 - b _0802C088 -_0802BFC0: - adds r2, r3, 0 - adds r2, 0x50 - ldrb r1, [r2] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - bne _0802C014 - ldr r0, =gUnknown_082FB63C - ldrb r1, [r2] - lsls r1, 1 - adds r1, r0 - adds r0, r3, 0 - adds r0, 0x51 - ldrb r2, [r0] - lsls r0, r2, 3 - subs r0, r2 - ldrh r1, [r1] - adds r0, r1 - str r0, [r3, 0x28] - bl sub_802C098 - ldr r2, [r4] - ldr r3, =gUnknown_082FB64C - movs r1, 0x3 - ands r1, r0 - lsls r1, 1 - adds r1, r3 - ldrh r0, [r1] - adds r0, 0x2 - adds r1, r2, 0 - adds r1, 0x4E - strh r0, [r1] - adds r2, 0x50 - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - b _0802C082 - .pool -_0802C014: - lsls r0, r1, 24 - lsrs r0, 24 - cmp r0, 0x8 - bne _0802C030 - adds r1, r3, 0 - adds r1, 0x51 - ldrb r0, [r1] - cmp r0, 0x2 - bhi _0802C02C - adds r0, 0x1 - strb r0, [r1] - b _0802C030 -_0802C02C: - movs r0, 0x1 - str r0, [r3, 0x6C] -_0802C030: - ldr r2, =gUnknown_082FB63C - ldr r4, =0x02022cfc - ldr r0, [r4] - mov r12, r0 - mov r3, r12 - adds r3, 0x50 - ldrb r0, [r3] - movs r1, 0xF - subs r1, r0 - lsls r1, 1 - adds r1, r2 - mov r0, r12 - adds r0, 0x51 - ldrb r2, [r0] - lsls r0, r2, 3 - subs r0, r2 - ldrh r1, [r1] - adds r0, r1 - mov r1, r12 - str r0, [r1, 0x28] - ldrb r0, [r3] - adds r0, 0x1 - strb r0, [r3] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xF - bls _0802C082 - bl sub_802C098 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0 - bne _0802C07A - ldr r1, [r4] - ldr r0, [r1, 0x28] - subs r0, 0x5 - str r0, [r1, 0x28] -_0802C07A: - ldr r0, [r4] - adds r0, 0x50 - movs r1, 0 - strb r1, [r0] -_0802C082: - ldr r0, =0x02022cfc - ldr r1, [r0] -_0802C086: - ldr r0, [r1, 0x28] -_0802C088: - str r0, [r1, 0x1C] -_0802C08A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802BF7C - - thumb_func_start sub_802C098 -sub_802C098: @ 802C098 - ldr r0, =0x02022cfc - ldr r2, [r0] - ldr r1, [r2, 0x24] - ldr r0, =0x41c64e6d - muls r0, r1 - ldr r1, =0x00006073 - adds r0, r1 - str r0, [r2, 0x24] - lsrs r0, 16 - bx lr - .pool - thumb_func_end sub_802C098 - - thumb_func_start sub_802C0B8 -sub_802C0B8: @ 802C0B8 - push {lr} - ldr r0, =0x02022cfc - ldr r1, [r0] - movs r0, 0x1 - str r0, [r1, 0x10] - movs r0, 0x6 - str r0, [r1, 0x14] - ldr r0, =0x000005ff - strh r0, [r1, 0x34] - bl sub_802C270 - pop {r0} - bx r0 - .pool - thumb_func_end sub_802C0B8 - - thumb_func_start sub_802C0DC -sub_802C0DC: @ 802C0DC - ldr r0, =0x02022cfc - ldr r0, [r0] - ldr r0, [r0, 0x10] - bx lr - .pool - thumb_func_end sub_802C0DC - - thumb_func_start sub_802C0E8 -sub_802C0E8: @ 802C0E8 - push {r4,r5,lr} - ldr r5, =0x02022cfc - ldr r4, =0x000082f8 - movs r3, 0 - movs r2, 0 - movs r1, 0x4 -_0802C0F4: - ldr r0, [r5] - adds r0, r4 - adds r0, r2 - str r3, [r0] - adds r2, 0x28 - subs r1, 0x1 - cmp r1, 0 - bge _0802C0F4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802C0E8 - - thumb_func_start sub_802C114 -sub_802C114: @ 802C114 - ldr r0, =0x02022cfc - ldr r0, [r0] - ldr r1, =0x000083ac - adds r0, r1 - ldr r1, [r0] - movs r2, 0 - strh r2, [r1, 0x10] - ldr r0, [r0] - strh r2, [r0, 0x12] - bx lr - .pool - thumb_func_end sub_802C114 - - thumb_func_start sub_802C130 -sub_802C130: @ 802C130 - push {lr} - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x02022cfc - ldr r2, [r1] - ldrb r3, [r2, 0x6] - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 3 - adds r2, r1 - ldr r1, =0x000082f4 - adds r2, r1 - ldrh r1, [r2] - cmp r1, r0 - beq _0802C15C - movs r0, 0 - b _0802C15E - .pool -_0802C15C: - movs r0, 0x1 -_0802C15E: - pop {r1} - bx r1 - thumb_func_end sub_802C130 - - thumb_func_start sub_802C164 -sub_802C164: @ 802C164 - ldr r0, =0x02022cfc - ldr r0, [r0] - ldr r1, =0x000083ac - adds r2, r0, r1 - ldr r1, [r2] - adds r0, 0x4A - ldrh r0, [r0] - strh r0, [r1, 0xE] - ldr r1, [r2] - ldrh r0, [r1, 0x10] - strh r0, [r1, 0x12] - ldr r1, [r2] - movs r0, 0x1 - strh r0, [r1, 0x10] - bx lr - .pool - thumb_func_end sub_802C164 - - thumb_func_start sub_802C18C -sub_802C18C: @ 802C18C - push {r4,lr} - ldr r0, =0x02022cfc - ldr r2, [r0] - ldr r0, =0x000083ac - adds r3, r2, r0 - ldr r1, [r3] - ldrh r0, [r1, 0x10] - strh r0, [r1, 0x12] - ldr r0, [r3] - movs r4, 0x2 - strh r4, [r0, 0x10] - ldr r1, [r3] - adds r2, 0x4A - ldrh r0, [r2] - strh r0, [r1, 0xE] - ldr r0, [r3] - str r4, [r0, 0x14] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802C18C - - thumb_func_start sub_802C1BC -sub_802C1BC: @ 802C1BC - ldr r0, =0x02022cfc - ldr r0, [r0] - ldr r1, =0x000083ac - adds r0, r1 - ldr r1, [r0] - ldrh r2, [r1, 0x10] - movs r3, 0 - strh r2, [r1, 0x12] - ldr r0, [r0] - strh r3, [r0, 0x10] - bx lr - .pool - thumb_func_end sub_802C1BC - - thumb_func_start sub_802C1DC -sub_802C1DC: @ 802C1DC - push {r4,r5,lr} - ldr r4, =0x02022cfc - ldr r1, [r4] - ldr r0, [r1, 0x5C] - cmp r0, 0 - beq _0802C21C - ldr r0, [r1, 0x78] - bl sub_802DD64 - ldr r1, [r4] - movs r5, 0 - str r5, [r1, 0x5C] - adds r0, r1, 0 - adds r0, 0x4D - ldrb r0, [r0] - cmp r0, 0 - beq _0802C21C - adds r0, r1, 0 - adds r0, 0x71 - ldrb r0, [r0] - bl sub_802DCCC - ldr r1, =gUnknown_082FB654 - subs r0, 0x2 - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - bl audio_play - ldr r0, [r4] - adds r0, 0x4D - strb r5, [r0] -_0802C21C: - ldr r0, =0x02022cfc - ldr r0, [r0] - adds r0, 0x74 - ldrh r0, [r0] - bl sub_802DD74 - bl sub_802C280 - bl sub_802C240 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802C1DC - - thumb_func_start sub_802C240 -sub_802C240: @ 802C240 - push {lr} - ldr r0, =0x02022cfc - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x46 - ldrb r0, [r0] - cmp r0, 0 - beq _0802C256 - ldr r0, [r1, 0x14] - bl sub_802DC9C -_0802C256: - pop {r0} - bx r0 - .pool - thumb_func_end sub_802C240 - - thumb_func_start sub_802C260 -sub_802C260: @ 802C260 - ldr r0, =0x02022cfc - ldr r0, [r0] - adds r0, 0x46 - movs r1, 0 - strb r1, [r0] - bx lr - .pool - thumb_func_end sub_802C260 - - thumb_func_start sub_802C270 -sub_802C270: @ 802C270 - ldr r0, =0x02022cfc - ldr r0, [r0] - adds r0, 0x46 - movs r1, 0x1 - strb r1, [r0] - bx lr - .pool - thumb_func_end sub_802C270 - - thumb_func_start sub_802C280 -sub_802C280: @ 802C280 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r6, 0 - ldr r2, =0x02022cfc - ldr r0, [r2] - ldrb r0, [r0, 0x5] - mov r9, r0 - movs r5, 0 - cmp r6, r9 - bge _0802C360 - mov r10, r2 - mov r8, r5 - movs r7, 0 -_0802C2A2: - mov r0, r10 - ldr r3, [r0] - adds r1, r3, r7 - ldr r2, =0x000082f4 - adds r0, r1, r2 - ldrh r2, [r0] - cmp r2, 0x1 - beq _0802C2D4 - cmp r2, 0x1 - bgt _0802C2C4 - cmp r2, 0 - beq _0802C2CA - b _0802C354 - .pool -_0802C2C4: - cmp r2, 0x2 - beq _0802C338 - b _0802C354 -_0802C2CA: - adds r0, r5, 0 - movs r1, 0 - bl sub_802DC80 - b _0802C354 -_0802C2D4: - ldr r0, =0x000082f6 - adds r4, r1, r0 - ldrh r0, [r4] - cmp r0, 0x1 - bne _0802C2F6 - ldr r0, =0x000082f2 - adds r0, r1 - adds r1, r3, 0 - adds r1, 0x9A - add r1, r8 - str r1, [sp] - ldrh r1, [r0] - mov r12, r1 - ldr r0, [sp] - ldrh r0, [r0] - cmp r12, r0 - beq _0802C31E -_0802C2F6: - ldrb r3, [r3, 0x6] - cmp r5, r3 - bne _0802C2FE - strh r2, [r4] -_0802C2FE: - orrs r6, r2 - mov r1, r10 - ldr r2, [r1] - ldr r1, =0x000082e8 - adds r0, r2, r1 - adds r0, r7 - ldr r1, =0x7fffffff - str r1, [r0] - adds r1, r2, 0 - adds r1, 0x9A - add r1, r8 - adds r2, r7 - ldr r0, =0x000082f2 - adds r2, r0 - ldrh r0, [r2] - strh r0, [r1] -_0802C31E: - adds r0, r5, 0 - bl sub_802C398 - b _0802C354 - .pool -_0802C338: - ldr r0, =0x000082f6 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0x2 - beq _0802C354 - ldrb r3, [r3, 0x6] - cmp r5, r3 - bne _0802C34A - strh r2, [r1] -_0802C34A: - orrs r6, r2 - lsls r0, r5, 24 - lsrs r0, 24 - bl sub_802DD88 -_0802C354: - movs r1, 0x2 - add r8, r1 - adds r7, 0x28 - adds r5, 0x1 - cmp r5, r9 - blt _0802C2A2 -_0802C360: - movs r0, 0x2 - ands r0, r6 - cmp r0, 0 - beq _0802C378 - movs r0, 0x83 - lsls r0, 1 - bl audio_play - b _0802C386 - .pool -_0802C378: - movs r0, 0x1 - ands r6, r0 - cmp r6, 0 - beq _0802C386 - movs r0, 0xA - bl audio_play -_0802C386: - 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_802C280 - - thumb_func_start sub_802C398 -sub_802C398: @ 802C398 - push {r4-r6,lr} - adds r6, r0, 0 - ldr r0, =0x02022cfc - ldr r2, [r0] - ldr r0, [r2, 0x68] - cmp r0, 0 - bne _0802C432 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x000082e4 - adds r0, r1 - adds r5, r2, r0 - ldr r1, [r5, 0x4] - ldr r0, =0x7fffffff - cmp r1, r0 - beq _0802C3D0 - adds r0, r1, 0x1 - str r0, [r5, 0x4] - adds r3, r0, 0 - b _0802C3E8 - .pool -_0802C3D0: - adds r0, r2, 0 - adds r0, 0x4A - ldrh r1, [r0] - ldrh r0, [r5, 0xE] - subs r3, r1, r0 - ldr r0, =0x0000fde7 - cmp r3, r0 - ble _0802C3E6 - ldr r0, =0xffff0218 - adds r3, r0 - adds r3, r1 -_0802C3E6: - str r3, [r5, 0x4] -_0802C3E8: - cmp r3, 0x3 - ble _0802C432 - subs r3, 0x4 - cmp r3, 0x2F - bgt _0802C414 - ldr r2, =gUnknown_082FB65C - ldrh r1, [r5, 0xC] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 4 - adds r0, r3, r0 - adds r0, r2 - movs r4, 0 - ldrsb r4, [r0, r4] - b _0802C416 - .pool -_0802C414: - movs r4, 0 -_0802C416: - adds r1, r4, 0 - adds r0, r6, 0 - bl sub_802DC80 - cmp r4, 0 - bne _0802C430 - ldr r0, =0x02022cfc - ldr r0, [r0] - ldrb r0, [r0, 0x6] - cmp r6, r0 - bne _0802C430 - bl sub_802C1BC -_0802C430: - str r4, [r5] -_0802C432: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802C398 - - thumb_func_start sub_802C43C -sub_802C43C: @ 802C43C - push {r4,r5,lr} - ldr r5, =0x02022cfc - ldr r1, [r5] - ldr r0, [r1, 0x14] - cmp r0, 0x8 - bne _0802C4CE - ldr r0, [r1, 0x18] - cmp r0, 0x7 - bne _0802C4CE - ldr r4, [r1, 0x58] - cmp r4, 0 - bne _0802C46C - bl sub_802C780 - ldr r0, [r5] - str r4, [r0, 0x54] - movs r1, 0x1 - str r1, [r0, 0x58] - adds r0, 0x71 - strb r4, [r0] - b _0802C4CE - .pool -_0802C46C: - ldr r0, [r1, 0x54] - cmp r0, 0x5 - bne _0802C480 - ldrh r0, [r1, 0xC] - adds r0, 0x1 - strh r0, [r1, 0xC] - ldrh r0, [r1, 0xC] - bl sub_802C7A0 - b _0802C484 -_0802C480: - movs r0, 0 - strh r0, [r1, 0xC] -_0802C484: - ldr r4, =0x02022cfc - ldr r1, [r4] - ldr r0, [r1, 0x54] - cmp r0, 0x1 - ble _0802C49E - movs r0, 0x1 - str r0, [r1, 0x64] - adds r0, r1, 0 - adds r0, 0x86 - adds r1, 0x81 - movs r2, 0x5 - bl memcpy -_0802C49E: - bl sub_802C780 - ldr r0, [r4] - movs r2, 0 - str r2, [r0, 0x54] - movs r1, 0x1 - str r1, [r0, 0x58] - adds r0, 0x71 - strb r2, [r0] - ldr r0, [r4] - adds r2, r0, 0 - adds r2, 0x74 - ldrh r1, [r2] - ldr r0, =0x0000270e - cmp r1, r0 - bhi _0802C4C2 - adds r0, r1, 0x1 - strh r0, [r2] -_0802C4C2: - movs r0, 0xA - bl sub_802C688 - movs r0, 0x3 - bl sub_802AE14 -_0802C4CE: - ldr r4, =0x02022cfc - ldr r0, [r4] - ldr r0, [r0, 0x64] - cmp r0, 0 - beq _0802C504 - bl sub_802C618 - cmp r0, 0x1 - beq _0802C4E8 - ldr r0, [r4] - ldr r0, [r0, 0x14] - cmp r0, 0 - bne _0802C504 -_0802C4E8: - ldr r0, [r4] - adds r0, 0x86 - bl sub_802C73C - bl sub_802C790 - bl sub_802C688 - movs r0, 0x3 - bl sub_802AE14 - ldr r1, [r4] - movs r0, 0 - str r0, [r1, 0x64] -_0802C504: - ldr r4, =0x02022cfc - ldr r0, [r4] - ldr r0, [r0, 0x58] - cmp r0, 0 - beq _0802C52A - bl sub_802C6B0 - adds r2, r0, 0 - ldr r1, [r4] - ldr r0, [r1, 0x54] - cmp r2, r0 - ble _0802C52A - str r2, [r1, 0x54] - adds r0, r1, 0 - adds r0, 0x81 - adds r1, 0x7C - movs r2, 0x5 - bl memcpy -_0802C52A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802C43C - - thumb_func_start sub_802C538 -sub_802C538: @ 802C538 - push {r4,r5,lr} - ldr r5, =0x02022cfc - ldr r1, [r5] - ldr r0, [r1, 0x14] - cmp r0, 0x6 - bne _0802C582 - ldr r4, =0x000083ac - adds r0, r1, r4 - ldr r1, [r0] - ldr r0, [r1] - cmp r0, 0 - bne _0802C582 - ldrh r0, [r1, 0x12] - cmp r0, 0x1 - bne _0802C578 - bl sub_802C0DC - adds r1, r0, 0 - cmp r1, 0x1 - bne _0802C578 - ldr r0, [r5] - adds r0, r4 - ldr r0, [r0] - str r1, [r0, 0x14] - b _0802C582 - .pool -_0802C574: - movs r0, 0 - b _0802C5CA -_0802C578: - bl sub_802C18C - movs r0, 0x3 - bl sub_802AE14 -_0802C582: - ldr r0, =0x02022cfc - ldr r1, [r0] - ldr r0, [r1, 0x14] - cmp r0, 0x7 - bne _0802C5A8 - ldr r0, [r1, 0x18] - cmp r0, 0x6 - bne _0802C5A8 - ldr r2, =0x000083ac - adds r0, r1, r2 - ldr r1, [r0] - ldrh r0, [r1, 0x10] - cmp r0, 0x2 - beq _0802C5A8 - movs r0, 0x1 - str r0, [r1, 0x14] - movs r0, 0x3 - bl sub_802AE14 -_0802C5A8: - movs r2, 0 - ldr r0, =0x02022cfc - ldr r0, [r0] - ldrb r1, [r0, 0x5] - cmp r2, r1 - bge _0802C5C8 - adds r3, r1, 0 - ldr r4, =0x000082f4 - adds r1, r0, r4 -_0802C5BA: - ldrh r0, [r1] - cmp r0, 0x2 - beq _0802C574 - adds r1, 0x28 - adds r2, 0x1 - cmp r2, r3 - blt _0802C5BA -_0802C5C8: - movs r0, 0x1 -_0802C5CA: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_802C538 - - thumb_func_start sub_802C5DC -sub_802C5DC: @ 802C5DC - push {r4,lr} - ldr r0, =0x02022cfc - ldr r0, [r0] - ldrb r3, [r0, 0x5] - movs r4, 0 - cmp r4, r3 - bge _0802C600 - ldr r1, =0x000082f8 - adds r2, r0, r1 - adds r1, r3, 0 -_0802C5F0: - ldr r0, [r2] - cmp r0, 0 - beq _0802C5F8 - adds r4, 0x1 -_0802C5F8: - adds r2, 0x28 - subs r1, 0x1 - cmp r1, 0 - bne _0802C5F0 -_0802C600: - movs r0, 0 - cmp r4, r3 - bne _0802C608 - movs r0, 0x1 -_0802C608: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_802C5DC - - thumb_func_start sub_802C618 -sub_802C618: @ 802C618 - push {r4,lr} - movs r2, 0 - ldr r0, =0x02022cfc - ldr r0, [r0] - ldrb r1, [r0, 0x5] - cmp r2, r1 - bge _0802C648 - adds r3, r1, 0 - ldr r4, =0x000082f8 - adds r1, r0, r4 -_0802C62C: - ldr r0, [r1] - cmp r0, 0x1 - beq _0802C640 - movs r0, 0 - b _0802C64A - .pool -_0802C640: - adds r1, 0x28 - adds r2, 0x1 - cmp r2, r3 - blt _0802C62C -_0802C648: - movs r0, 0x1 -_0802C64A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802C618 - - thumb_func_start sub_802C650 -sub_802C650: @ 802C650 - push {lr} - ldr r0, =0x02022cfc - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x45 - ldrb r0, [r0] - cmp r0, 0x1 - bne _0802C668 -_0802C660: - movs r0, 0 - b _0802C684 - .pool -_0802C668: - movs r2, 0x1 - ldrb r0, [r1, 0x5] - cmp r2, r0 - bge _0802C682 - adds r3, r0, 0 - adds r1, 0x92 -_0802C674: - ldrh r0, [r1] - cmp r0, 0x1 - beq _0802C660 - adds r1, 0x2 - adds r2, 0x1 - cmp r2, r3 - blt _0802C674 -_0802C682: - movs r0, 0x1 -_0802C684: - pop {r1} - bx r1 - thumb_func_end sub_802C650 - - thumb_func_start sub_802C688 -sub_802C688: @ 802C688 - push {lr} - ldr r1, =0x02022cfc - ldr r2, [r1] - ldr r1, [r2, 0x78] - adds r1, r0 - str r1, [r2, 0x78] - movs r0, 0x1 - str r0, [r2, 0x5C] - ldr r0, =0x00018695 - cmp r1, r0 - bls _0802C6A2 - adds r0, 0x1 - str r0, [r2, 0x78] -_0802C6A2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_802C688 - - thumb_func_start sub_802C6B0 -sub_802C6B0: @ 802C6B0 - push {r4-r7,lr} - movs r5, 0 - ldr r1, =0x02022cfc - ldr r0, [r1] - ldrb r4, [r0, 0x5] - movs r2, 0 - cmp r5, r4 - bge _0802C702 - mov r12, r1 - movs r3, 0 - ldr r7, =0x000082e4 - movs r6, 0x1E - negs r6, r6 -_0802C6CA: - mov r0, r12 - ldr r1, [r0] - adds r0, r1, r7 - adds r0, r3 - ldr r0, [r0] - cmp r0, r6 - bne _0802C6F0 - adds r0, r1, 0 - adds r0, 0x7C - adds r0, r2 - movs r1, 0x1 - strb r1, [r0] - adds r5, 0x1 - b _0802C6FA - .pool -_0802C6F0: - adds r0, r1, 0 - adds r0, 0x7C - adds r0, r2 - movs r1, 0 - strb r1, [r0] -_0802C6FA: - adds r3, 0x28 - adds r2, 0x1 - cmp r2, r4 - blt _0802C6CA -_0802C702: - adds r0, r5, 0 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_802C6B0 - - thumb_func_start sub_802C70C -sub_802C70C: @ 802C70C - push {lr} - movs r2, 0 - ldr r1, =0x03005000 - ldr r3, =0x000009e6 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, 0 - bne _0802C728 - ldr r3, =0x00000c1a - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, 0 - bne _0802C728 - movs r2, 0x1 -_0802C728: - adds r0, r2, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_802C70C - - thumb_func_start sub_802C73C -sub_802C73C: @ 802C73C - push {r4-r6,lr} - adds r4, r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - ldr r6, =0x02022cfc - movs r5, 0x1 -_0802C74A: - adds r0, r4, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _0802C75A - adds r0, r5, 0 - lsls r0, r1 - orrs r2, r0 - adds r3, 0x1 -_0802C75A: - adds r1, 0x1 - cmp r1, 0x4 - ble _0802C74A - ldr r0, [r6] - adds r0, 0x71 - strb r2, [r0] - cmp r2, 0 - beq _0802C772 - ldr r0, [r6] - adds r0, 0x4D - movs r1, 0x1 - strb r1, [r0] -_0802C772: - adds r0, r3, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_802C73C - - thumb_func_start sub_802C780 -sub_802C780: @ 802C780 - ldr r0, =0x02022cfc - ldr r0, [r0] - adds r0, 0x44 - movs r1, 0 - strb r1, [r0] - bx lr - .pool - thumb_func_end sub_802C780 - - thumb_func_start sub_802C790 -sub_802C790: @ 802C790 - ldr r1, =gUnknown_082FB6EC - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bx lr - .pool - thumb_func_end sub_802C790 - - thumb_func_start sub_802C7A0 -sub_802C7A0: @ 802C7A0 - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =0x02022cfc - ldr r0, [r0] - ldrh r2, [r0, 0xE] - cmp r1, r2 - bls _0802C7B2 - strh r1, [r0, 0xE] -_0802C7B2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_802C7A0 - - thumb_func_start sub_802C7BC -sub_802C7BC: @ 802C7BC - push {lr} - ldr r0, =0x02022cfc - ldr r0, [r0] - ldr r1, =gUnknown_082FB714 - ldr r2, [r0, 0x78] - ldr r0, [r1] - cmp r2, r0 - bcs _0802C7D8 - movs r0, 0 - b _0802C7DA - .pool -_0802C7D8: - movs r0, 0x1 -_0802C7DA: - pop {r1} - bx r1 - thumb_func_end sub_802C7BC - - thumb_func_start sub_802C7E0 -sub_802C7E0: @ 802C7E0 - push {r4,lr} - bl sub_802C818 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl sub_802C838 - lsls r0, 16 - lsrs r0, 4 - ldr r1, =0x00000fff - ands r4, r1 - orrs r0, r4 - lsls r0, 16 - lsrs r0, 16 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_802C7E0 - - thumb_func_start sub_802C808 -sub_802C808: @ 802C808 - lsls r0, 16 - lsrs r3, r0, 28 - strh r3, [r2] - lsls r0, 4 - lsrs r0, 20 - strh r0, [r1] - bx lr - thumb_func_end sub_802C808 - - thumb_func_start sub_802C818 -sub_802C818: @ 802C818 - push {lr} - bl GenerateRandomNumber - lsls r0, 16 - movs r1, 0xE0 - lsls r1, 11 - ands r1, r0 - ldr r0, =gUnknown_082FB704 - lsrs r1, 15 - adds r1, r0 - ldrh r0, [r1] - pop {r1} - bx r1 - .pool - thumb_func_end sub_802C818 - - thumb_func_start sub_802C838 -sub_802C838: @ 802C838 - push {r4-r6,lr} - movs r5, 0 - movs r4, 0 - ldr r3, =0x02022cfc - ldr r0, [r3] - ldr r2, =gUnknown_082FB714 - ldr r1, [r0, 0x78] - ldr r0, [r2] - cmp r1, r0 - bcc _0802C874 - ldr r5, [r2, 0x4] - adds r6, r3, 0 - adds r3, r2, 0x4 -_0802C852: - adds r3, 0x8 - adds r2, 0x8 - adds r4, 0x1 - cmp r4, 0x4 - bhi _0802C874 - ldr r0, [r6] - ldr r1, [r0, 0x78] - ldr r0, [r2] - cmp r1, r0 - bcc _0802C874 - ldr r5, [r3] - b _0802C852 - .pool -_0802C874: - lsls r0, r5, 16 - lsrs r0, 16 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_802C838 - - thumb_func_start sub_802C880 -sub_802C880: @ 802C880 - push {r4,r5,lr} - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 16 - lsrs r4, r1, 16 - b _0802C892 -_0802C88C: - subs r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 -_0802C892: - cmp r4, 0 - beq _0802C8A4 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_80D6800 - lsls r0, 24 - cmp r0, 0 - beq _0802C88C -_0802C8A4: - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_802C880 - - thumb_func_start sub_802C8AC -sub_802C8AC: @ 802C8AC - push {lr} - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_802C8AC - - thumb_func_start sub_802C8BC -sub_802C8BC: @ 802C8BC - ldr r0, =0x02022cfc - ldr r0, [r0] - ldrb r0, [r0, 0x6] - bx lr - .pool - thumb_func_end sub_802C8BC - - thumb_func_start sub_802C8C8 -sub_802C8C8: @ 802C8C8 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02022cfc - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x000082a8 - adds r1, r0 - ldr r0, [r2] - adds r0, r1 - bx lr - .pool - thumb_func_end sub_802C8C8 - - thumb_func_start sub_802C8E8 -sub_802C8E8: @ 802C8E8 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =0x02022cfc - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - ldr r1, [r2] - adds r0, r1 - movs r1, 0x83 - lsls r1, 8 - adds r0, r1 - bx lr - .pool - thumb_func_end sub_802C8E8 - - thumb_func_start sub_802C908 -sub_802C908: @ 802C908 - push {lr} - lsls r0, 16 - lsrs r0, 16 - bl sub_802AC00 - lsls r0, 16 - asrs r0, 16 - mvns r0, r0 - lsrs r0, 31 - pop {r1} - bx r1 - thumb_func_end sub_802C908 - - thumb_func_start sub_802C920 -sub_802C920: @ 802C920 - push {r4,r5,lr} - movs r5, 0 -_0802C924: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x5 - bl pokemon_getattr - cmp r0, 0 - beq _0802C95C - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - bl sub_802C908 - cmp r0, 0 - beq _0802C95C - ldr r1, =0x020375f0 - movs r0, 0x1 - b _0802C966 - .pool -_0802C95C: - adds r5, 0x1 - cmp r5, 0x5 - ble _0802C924 - ldr r1, =0x020375f0 - movs r0, 0 -_0802C966: - strh r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802C920 - - thumb_func_start sub_802C974 -sub_802C974: @ 802C974 - push {r4-r6,lr} - adds r6, r0, 0 - movs r4, 0 - ldr r5, =gUnknown_082FBE08 -_0802C97C: - adds r0, r5, 0 - bl LoadCompressedObjectPic - adds r5, 0x8 - adds r4, 0x1 - cmp r4, 0x4 - bls _0802C97C - movs r4, 0 - ldr r5, =gUnknown_082FBE30 -_0802C98E: - adds r0, r5, 0 - bl LoadTaggedObjectPalette - adds r5, 0x8 - adds r4, 0x1 - cmp r4, 0x1 - bls _0802C98E - movs r0, 0x5 - bl IndexOfObjectPaletteTag - strb r0, [r6, 0xE] - movs r0, 0x6 - bl IndexOfObjectPaletteTag - strb r0, [r6, 0xF] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802C974 - - thumb_func_start sub_802C9BC -sub_802C9BC: @ 802C9BC - push {lr} - movs r2, 0 - movs r1, 0x7 - adds r0, 0x3C -_0802C9C4: - strh r2, [r0] - subs r0, 0x2 - subs r1, 0x1 - cmp r1, 0 - bge _0802C9C4 - pop {r0} - bx r0 - thumb_func_end sub_802C9BC - - thumb_func_start sub_802C9D4 -sub_802C9D4: @ 802C9D4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x34 - mov r9, r0 - adds r7, r1, 0 - ldr r0, [sp, 0x54] - lsls r2, 16 - lsrs r2, 16 - str r2, [sp, 0x28] - lsls r3, 16 - lsrs r3, 16 - str r3, [sp, 0x2C] - lsls r0, 24 - lsrs r6, r0, 24 - mov r1, sp - ldr r0, =gUnknown_082FBE40 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - movs r0, 0x80 - lsls r0, 6 - bl Alloc - mov r8, r0 - movs r0, 0x80 - lsls r0, 4 - bl Alloc - mov r10, r0 - bl sub_802C8BC - lsls r0, 16 - lsrs r0, 16 - cmp r6, r0 - bne _0802CA2C - movs r0, 0x3 - b _0802CA32 - .pool -_0802CA2C: - adds r0, r6, 0x4 - lsls r0, 24 - lsrs r0, 24 -_0802CA32: - str r0, [sp, 0x30] - mov r1, r8 - cmp r1, 0 - beq _0802CAF4 - mov r2, r10 - cmp r2, 0 - beq _0802CAF4 - ldrh r2, [r7] - lsls r0, r2, 3 - ldr r1, =gMonStillFrontPicTable - adds r0, r1 - ldr r3, [r7, 0x8] - mov r1, r8 - bl DecompressMonPic_DetectFrontOrBack - mov r3, r8 - str r3, [sp, 0x18] - adds r4, r6, 0 - add r0, sp, 0x18 - ldr r5, =0xffff0000 - lsls r1, r4, 16 - movs r2, 0x80 - lsls r2, 4 - orrs r1, r2 - str r1, [r0, 0x4] - bl LoadObjectPic - ldrh r0, [r7] - ldr r1, [r7, 0x4] - ldr r2, [r7, 0x8] - bl species_and_otid_get_pal - str r0, [sp, 0x20] - add r0, sp, 0x20 - ldr r1, [r0, 0x4] - ands r1, r5 - orrs r1, r4 - str r1, [r0, 0x4] - bl LoadCompressedObjectPalette - mov r0, r8 - bl Free - mov r0, r10 - bl Free - mov r1, sp - mov r0, sp - ldrh r0, [r0] - adds r0, r6 - strh r0, [r1] - mov r0, sp - ldrh r0, [r0, 0x2] - adds r0, r6 - strh r0, [r1, 0x2] - ldr r4, [sp, 0x28] - lsls r1, r4, 16 - asrs r1, 16 - ldr r0, [sp, 0x2C] - lsls r2, r0, 16 - asrs r2, 16 - mov r0, sp - ldr r3, [sp, 0x30] - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x40 - beq _0802CAF4 - lsls r0, r6, 2 - ldr r2, =0x000081a8 - add r2, r9 - adds r2, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - str r0, [r2] - ldr r0, =0x000081fc - add r0, r9 - adds r0, r6 - add r1, sp, 0x30 - ldrb r1, [r1] - strb r1, [r0] - b _0802CB00 - .pool -_0802CAF4: - lsls r0, r6, 2 - ldr r1, =0x000081a8 - add r1, r9 - adds r1, r0 - movs r0, 0 - str r0, [r1] -_0802CB00: - add sp, 0x34 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802C9D4 - - thumb_func_start sub_802CB14 -sub_802CB14: @ 802CB14 - push {r4-r6,lr} - adds r4, r0, 0 - lsls r6, r1, 2 - ldr r0, =0x000081bc - adds r5, r4, r0 - adds r5, r6 - ldr r0, [r5] - bl sub_802C9BC - ldr r2, [r5] - ldr r0, =0x000081a8 - adds r4, r0 - adds r4, r6 - ldr r1, [r4] - ldr r0, =0x02020630 - subs r1, r0 - lsls r0, r1, 4 - subs r0, r1 - lsls r1, r0, 8 - adds r0, r1 - lsls r1, r0, 16 - adds r0, r1 - negs r0, r0 - asrs r0, 2 - strh r0, [r2, 0x3C] - ldr r1, [r5] - adds r1, 0x3E - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r5] - movs r0, 0x60 - strh r0, [r1, 0x22] - ldr r0, [r5] - ldr r1, =sub_802CB7C - str r1, [r0, 0x1C] - movs r1, 0x1 - bl StartObjectImageAnim - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802CB14 - - thumb_func_start sub_802CB7C -sub_802CB7C: @ 802CB7C - push {lr} - adds r2, r0, 0 - movs r1, 0x2E - ldrsh r0, [r2, r1] - cmp r0, 0x1 - beq _0802CBA8 - cmp r0, 0x1 - bgt _0802CB92 - cmp r0, 0 - beq _0802CB98 - b _0802CBE6 -_0802CB92: - cmp r0, 0x2 - beq _0802CBC8 - b _0802CBE6 -_0802CB98: - adds r0, r2, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0802CBE6 - b _0802CBD6 -_0802CBA8: - ldrh r1, [r2, 0x22] - subs r1, 0x1 - strh r1, [r2, 0x22] - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x48 - bgt _0802CBE6 - movs r0, 0x48 - strh r0, [r2, 0x22] - ldrh r0, [r2, 0x2E] - adds r0, 0x1 - strh r0, [r2, 0x2E] - b _0802CBE6 -_0802CBC8: - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2F - ble _0802CBE6 -_0802CBD6: - adds r3, r2, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r3] - ldr r0, =DummyObjectCallback - str r0, [r2, 0x1C] -_0802CBE6: - pop {r0} - bx r0 - .pool - thumb_func_end sub_802CB7C - - thumb_func_start sub_802CBF0 -sub_802CBF0: @ 802CBF0 - push {lr} - lsls r1, 2 - ldr r2, =0x000081a8 - adds r0, r2 - adds r0, r1 - ldr r2, [r0] - ldr r1, =sub_802CC40 - str r1, [r2, 0x1C] - movs r1, 0 - strh r1, [r2, 0x26] - ldr r0, [r0] - bl sub_802C9BC - pop {r0} - bx r0 - .pool - thumb_func_end sub_802CBF0 - - thumb_func_start sub_802CC18 -sub_802CC18: @ 802CC18 - push {lr} - movs r2, 0 - lsls r1, 2 - ldr r3, =0x000081a8 - adds r0, r3 - adds r0, r1 - ldr r0, [r0] - ldr r1, [r0, 0x1C] - ldr r0, =sub_802CC40 - cmp r1, r0 - bne _0802CC30 - movs r2, 0x1 -_0802CC30: - adds r0, r2, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_802CC18 - - thumb_func_start sub_802CC40 -sub_802CC40: @ 802CC40 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0802CC6C - ldrh r0, [r2, 0x32] - adds r0, 0x1 - strh r0, [r2, 0x32] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0802CC64 - movs r0, 0x2 - b _0802CC66 -_0802CC64: - ldr r0, =0x0000fffe -_0802CC66: - strh r0, [r2, 0x26] - movs r0, 0 - strh r0, [r2, 0x30] -_0802CC6C: - movs r1, 0x32 - ldrsh r0, [r2, r1] - cmp r0, 0xC - ble _0802CC7C - movs r0, 0 - strh r0, [r2, 0x26] - ldr r0, =DummyObjectCallback - str r0, [r2, 0x1C] -_0802CC7C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_802CC40 - - thumb_func_start sub_802CC88 -sub_802CC88: @ 802CC88 - push {r4,lr} - adds r4, r0, 0 - lsls r1, 2 - ldr r0, =0x000081a8 - adds r4, r0 - adds r4, r1 - ldr r0, [r4] - bl sub_802C9BC - ldr r1, [r4] - ldr r0, =sub_802CD08 - str r0, [r1, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802CC88 - - thumb_func_start sub_802CCB0 -sub_802CCB0: @ 802CCB0 - push {r4-r7,lr} - adds r4, r0, 0 - bl sub_802C8AC - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - beq _0802CCF4 - movs r1, 0x5 - negs r1, r1 - mov r12, r1 - ldr r1, =0x000081a8 - adds r3, r4, r1 - ldr r7, =sub_802CD08 - ldr r6, =DummyObjectCallback - movs r5, 0xA - adds r4, r0, 0 -_0802CCD2: - ldr r2, [r3] - ldr r0, [r2, 0x1C] - cmp r0, r7 - bne _0802CCEC - adds r2, 0x3E - ldrb r1, [r2] - mov r0, r12 - ands r0, r1 - strb r0, [r2] - ldr r0, [r3] - str r6, [r0, 0x1C] - adds r0, 0x43 - strb r5, [r0] -_0802CCEC: - adds r3, 0x4 - subs r4, 0x1 - cmp r4, 0 - bne _0802CCD2 -_0802CCF4: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802CCB0 - - thumb_func_start sub_802CD08 -sub_802CD08: @ 802CD08 - push {lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _0802CD36 - movs r0, 0 - strh r0, [r3, 0x2E] - adds r3, 0x3E - ldrb r2, [r3] - lsls r0, r2, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] -_0802CD36: - pop {r0} - bx r0 - thumb_func_end sub_802CD08 - - thumb_func_start sub_802CD3C -sub_802CD3C: @ 802CD3C - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_802C8AC - lsls r0, 16 - lsrs r3, r0, 16 - movs r2, 0 - cmp r2, r3 - bge _0802CD66 - ldr r0, =0x000081fc - adds r5, r4, r0 - subs r0, 0x54 - adds r4, r0 -_0802CD56: - ldm r4!, {r0} - adds r1, r5, r2 - ldrb r1, [r1] - adds r0, 0x43 - strb r1, [r0] - adds r2, 0x1 - cmp r2, r3 - blt _0802CD56 -_0802CD66: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802CD3C - - thumb_func_start sub_802CD70 -sub_802CD70: @ 802CD70 - push {r4,lr} - adds r4, r0, 0 - lsls r1, 2 - ldr r0, =0x000081a8 - adds r4, r0 - adds r4, r1 - ldr r0, [r4] - bl sub_802C9BC - ldr r1, [r4] - ldr r0, =sub_802CDD4 - str r0, [r1, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802CD70 - - thumb_func_start sub_802CD98 -sub_802CD98: @ 802CD98 - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_802C8AC - lsls r0, 16 - lsrs r3, r0, 16 - movs r2, 0 - cmp r2, r3 - bge _0802CDCC - ldr r5, =sub_802CDD4 - ldr r0, =0x000081a8 - adds r1, r4, r0 -_0802CDB0: - ldr r0, [r1] - ldr r0, [r0, 0x1C] - cmp r0, r5 - bne _0802CDC4 - movs r0, 0x1 - b _0802CDCE - .pool -_0802CDC4: - adds r1, 0x4 - adds r2, 0x1 - cmp r2, r3 - blt _0802CDB0 -_0802CDCC: - movs r0, 0 -_0802CDCE: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_802CD98 - - thumb_func_start sub_802CDD4 -sub_802CDD4: @ 802CDD4 - push {r4,r5,lr} - adds r5, r0, 0 - movs r0, 0x2E - ldrsh r4, [r5, r0] - cmp r4, 0 - beq _0802CDE6 - cmp r4, 0x1 - beq _0802CDF4 - b _0802CE3C -_0802CDE6: - movs r0, 0x22 - bl audio_play - strh r4, [r5, 0x30] - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] -_0802CDF4: - ldrh r0, [r5, 0x30] - adds r0, 0x4 - strh r0, [r5, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7F - ble _0802CE06 - movs r0, 0 - strh r0, [r5, 0x30] -_0802CE06: - ldr r1, =gUnknown_08329F40 - movs r2, 0x30 - ldrsh r0, [r5, r2] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 19 - negs r0, r0 - strh r0, [r5, 0x26] - movs r0, 0x30 - ldrsh r1, [r5, r0] - cmp r1, 0 - bne _0802CE3C - ldrh r0, [r5, 0x32] - adds r0, 0x1 - strh r0, [r5, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bgt _0802CE38 - strh r1, [r5, 0x2E] - b _0802CE3C - .pool -_0802CE38: - ldr r0, =DummyObjectCallback - str r0, [r5, 0x1C] -_0802CE3C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802CDD4 - - thumb_func_start sub_802CE48 -sub_802CE48: @ 802CE48 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r3, 24 - lsrs r4, r3, 24 - ldr r0, =gUnknown_082FC00C - lsls r1, 16 - asrs r1, 16 - lsls r2, 16 - asrs r2, 16 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x40 - beq _0802CE88 - ldr r0, =0x02020630 - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - adds r3, r1, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r3] - lsls r2, r4, 2 - ldr r3, =0x000081bc - adds r0, r5, r3 - adds r0, r2 - str r1, [r0] -_0802CE88: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802CE48 - - thumb_func_start sub_802CE9C -sub_802CE9C: @ 802CE9C - push {r4-r7,lr} - adds r7, r0, 0 - movs r5, 0 - movs r4, 0 - ldr r6, =gUnknown_082FBE58 -_0802CEA6: - ldr r1, =gUnknown_082FBEB8 - lsls r0, r4, 2 - adds r0, r1 - ldr r0, [r0] - ldr r2, =gUnknown_082FBEA8 - lsls r1, r5, 1 - adds r1, r2 - movs r2, 0 - ldrsh r1, [r1, r2] - movs r3, 0 - ldrsh r2, [r6, r3] - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - lsls r0, r5, 2 - ldr r3, =0x000081d0 - adds r2, r7, r3 - adds r2, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - str r0, [r2] - adds r5, 0x1 - adds r6, 0x14 - adds r4, 0x1 - cmp r4, 0x3 - ble _0802CEA6 - movs r4, 0x3 - movs r6, 0x3C -_0802CEE8: - ldr r1, =gUnknown_082FBEB8 - lsls r0, r4, 2 - adds r0, r1 - ldr r0, [r0] - ldr r2, =gUnknown_082FBEA8 - lsls r1, r5, 1 - adds r1, r2 - movs r2, 0 - ldrsh r1, [r1, r2] - ldr r2, =gUnknown_082FBE58 - adds r2, r6, r2 - movs r3, 0 - ldrsh r2, [r2, r3] - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - lsls r0, r5, 2 - ldr r3, =0x000081d0 - adds r2, r7, r3 - adds r2, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - str r0, [r2] - adds r0, 0x3F - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] - adds r5, 0x1 - subs r6, 0x14 - subs r4, 0x1 - cmp r4, 0 - bge _0802CEE8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802CE9C - - thumb_func_start sub_802CF50 -sub_802CF50: @ 802CF50 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - str r0, [sp, 0x8] - cmp r1, 0x5 - ble _0802CF70 - movs r0, 0xA - subs r1, r0, r1 - movs r0, 0x3 - str r0, [sp] - ldr r2, [sp, 0x8] - ldrb r0, [r2, 0xF] - b _0802CF78 -_0802CF70: - movs r3, 0x2 - str r3, [sp] - ldr r7, [sp, 0x8] - ldrb r0, [r7, 0xE] -_0802CF78: - movs r6, 0 - lsls r2, r1, 1 - str r2, [sp, 0x4] - lsls r0, 4 - mov r9, r0 - lsls r1, 24 - mov r8, r1 - ldr r0, =gUnknown_082FBE58 - adds r4, r2, r0 - ldr r3, [sp] - lsls r3, 2 - mov r10, r3 - movs r5, 0x3 -_0802CF92: - lsls r0, r6, 2 - ldr r7, [sp, 0x8] - ldr r1, =0x000081d0 - adds r2, r7, r1 - adds r2, r0 - ldr r1, [r2] - ldrh r0, [r4] - strh r0, [r1, 0x22] - ldr r3, [r2] - ldrb r0, [r3, 0x5] - movs r7, 0xD - negs r7, r7 - adds r1, r7, 0 - ands r0, r1 - mov r1, r10 - orrs r0, r1 - strb r0, [r3, 0x5] - ldr r3, [r2] - ldrb r1, [r3, 0x5] - movs r0, 0xF - ands r0, r1 - mov r7, r9 - orrs r0, r7 - strb r0, [r3, 0x5] - ldr r0, [r2] - mov r2, r8 - lsrs r1, r2, 24 - bl StartObjectImageAnim - adds r6, 0x1 - adds r4, 0x14 - subs r5, 0x1 - cmp r5, 0 - bge _0802CF92 - movs r5, 0x3 - ldr r0, =gUnknown_082FBE58 - ldr r3, [sp, 0x4] - adds r0, r3, r0 - adds r4, r0, 0 - adds r4, 0x3C - ldr r7, [sp] - lsls r7, 2 - mov r10, r7 -_0802CFE8: - lsls r0, r6, 2 - ldr r1, [sp, 0x8] - ldr r3, =0x000081d0 - adds r2, r1, r3 - adds r2, r0 - ldr r1, [r2] - ldrh r0, [r4] - strh r0, [r1, 0x22] - ldr r3, [r2] - ldrb r0, [r3, 0x5] - movs r7, 0xD - negs r7, r7 - adds r1, r7, 0 - ands r0, r1 - mov r1, r10 - orrs r0, r1 - strb r0, [r3, 0x5] - ldr r3, [r2] - ldrb r1, [r3, 0x5] - movs r0, 0xF - ands r0, r1 - mov r7, r9 - orrs r0, r7 - strb r0, [r3, 0x5] - ldr r0, [r2] - mov r2, r8 - lsrs r1, r2, 24 - bl StartObjectImageAnim - adds r6, 0x1 - subs r4, 0x14 - subs r5, 0x1 - cmp r5, 0 - bge _0802CFE8 - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802CF50 - - thumb_func_start sub_802D044 -sub_802D044: @ 802D044 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - movs r0, 0 - str r0, [sp] - movs r0, 0x9 - movs r1, 0x7 - movs r2, 0x78 - movs r3, 0x50 - bl sub_802EB24 - adds r0, r4, 0 - bl sub_802CD3C - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_802D044 - - thumb_func_start sub_802D068 -sub_802D068: @ 802D068 - push {lr} - bl sub_802EB84 - pop {r1} - bx r1 - thumb_func_end sub_802D068 - - thumb_func_start sub_802D074 -sub_802D074: @ 802D074 - push {r4,lr} - ldr r4, =0x02022d00 - str r0, [r4] - bl sub_802D0BC - ldr r0, =sub_802D12C - movs r1, 0x3 - bl AddTask - ldr r1, [r4] - strb r0, [r1, 0x6] - ldr r2, [r4] - ldrb r0, [r2, 0x6] - movs r1, 0x2 - bl set_word_task_arg - ldr r0, =sub_802D150 - bl sub_802D108 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802D074 - - thumb_func_start sub_802D0AC -sub_802D0AC: @ 802D0AC - push {lr} - bl FreeAllWindowBuffers - bl sub_8034CC8 - pop {r0} - bx r0 - thumb_func_end sub_802D0AC - - thumb_func_start sub_802D0BC -sub_802D0BC: @ 802D0BC - movs r1, 0 - strh r1, [r0, 0x4] - str r1, [r0] - movs r1, 0xFF - strh r1, [r0, 0x12] - bx lr - thumb_func_end sub_802D0BC - - thumb_func_start sub_802D0C8 -sub_802D0C8: @ 802D0C8 - push {r4-r6,lr} - adds r6, r0, 0 - movs r5, 0 - ldr r4, =gUnknown_082FE18C -_0802D0D0: - ldr r0, [r4] - cmp r0, r6 - bne _0802D0DC - ldr r0, [r4, 0x4] - bl sub_802D108 -_0802D0DC: - adds r4, 0x8 - adds r5, 0x1 - cmp r5, 0x9 - bls _0802D0D0 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802D0C8 - - thumb_func_start sub_802D0F0 -sub_802D0F0: @ 802D0F0 - ldr r0, =0x02022d00 - ldr r0, [r0] - ldr r1, [r0] - movs r0, 0x1 - eors r1, r0 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - bx lr - .pool - thumb_func_end sub_802D0F0 - - thumb_func_start sub_802D108 -sub_802D108: @ 802D108 - push {r4,lr} - adds r2, r0, 0 - ldr r4, =0x02022d00 - ldr r0, [r4] - ldrb r0, [r0, 0x6] - movs r1, 0 - bl set_word_task_arg - ldr r1, [r4] - movs r0, 0 - strh r0, [r1, 0x4] - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802D108 - - thumb_func_start sub_802D12C -sub_802D12C: @ 802D12C - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - ldr r0, =0x02022d00 - ldr r0, [r0] - ldr r0, [r0] - cmp r0, 0 - bne _0802D148 - adds r0, r1, 0 - movs r1, 0 - bl get_word_task_arg - bl _call_via_r0 -_0802D148: - pop {r0} - bx r0 - .pool - thumb_func_end sub_802D12C - - thumb_func_start sub_802D150 -sub_802D150: @ 802D150 - push {r4-r6,lr} - sub sp, 0x8 - ldr r6, =0x02022d00 - ldr r1, [r6] - ldrh r5, [r1, 0x4] - cmp r5, 0x1 - bne _0802D160 - b _0802D298 -_0802D160: - cmp r5, 0x1 - bgt _0802D170 - cmp r5, 0 - beq _0802D178 - b _0802D2DA - .pool -_0802D170: - cmp r5, 0x2 - bne _0802D176 - b _0802D2D6 -_0802D176: - b _0802D2DA -_0802D178: - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_082FE164 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - ldr r0, =gUnknown_082FE174 - bl InitWindows - bl reset_temp_tile_data_buffers - ldr r0, [r6] - bl sub_802C974 - bl sub_802DD08 - ldr r0, =gUnknown_082FC044 - movs r1, 0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r1, =gUnknown_082FC064 - str r5, [sp] - movs r0, 0x3 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r1, =gUnknown_082FC290 - movs r4, 0x1 - str r4, [sp] - movs r0, 0x3 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r0, =gUnknown_082FC440 - movs r1, 0x30 - movs r2, 0x20 - bl gpu_pal_apply - ldr r1, =gUnknown_082FC460 - str r5, [sp] - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r1, =gUnknown_082FCDB0 - str r4, [sp] - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r0, =gUnknown_082FD168 - movs r1, 0x10 - movs r2, 0x20 - bl gpu_pal_apply - ldr r1, =gUnknown_082FD188 - str r5, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r1, =gUnknown_082FDC38 - str r4, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r0, =gUnknown_082FC024 - movs r1, 0x20 - movs r2, 0x20 - bl gpu_pal_apply - ldr r1, [r6] - movs r0, 0xD3 - lsls r0, 1 - adds r1, r0 - movs r0, 0 - bl SetBgTilemapBuffer - movs r0, 0x20 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - bl sub_802DB8C - movs r0, 0 - bl sub_802DD64 - movs r0, 0 - movs r1, 0x1 - movs r2, 0xE0 - bl sub_8098C6C - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - bl sub_8199D98 - b _0802D2CC - .pool -_0802D298: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - bne _0802D2DA - bl sub_802DBF8 - ldr r0, [r6] - bl sub_802CE9C - ldr r0, [r6] - movs r1, 0x6 - bl sub_802CF50 - movs r0, 0x3 - bl ShowBg - movs r0, 0 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x1 - bl HideBg -_0802D2CC: - ldr r1, [r6] - ldrh r0, [r1, 0x4] - adds r0, 0x1 - strh r0, [r1, 0x4] - b _0802D2DA -_0802D2D6: - movs r0, 0x1 - str r0, [r1] -_0802D2DA: - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_802D150 - - thumb_func_start sub_802D2E4 -sub_802D2E4: @ 802D2E4 - push {r4,lr} - ldr r4, =0x02022d00 - ldr r0, [r4] - ldrh r0, [r0, 0x4] - cmp r0, 0x1 - beq _0802D310 - cmp r0, 0x1 - bgt _0802D300 - cmp r0, 0 - beq _0802D30A - b _0802D34A - .pool -_0802D300: - cmp r0, 0x2 - beq _0802D322 - cmp r0, 0x3 - beq _0802D33A - b _0802D34A -_0802D30A: - bl sub_802DE1C - b _0802D330 -_0802D310: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802D34A - movs r0, 0 - bl sub_802DF70 - b _0802D330 -_0802D322: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802D34A - bl sub_802DFD4 -_0802D330: - ldr r1, [r4] - ldrh r0, [r1, 0x4] - adds r0, 0x1 - strh r0, [r1, 0x4] - b _0802D34A -_0802D33A: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802D34A - ldr r1, [r4] - movs r0, 0x1 - str r0, [r1] -_0802D34A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_802D2E4 - - thumb_func_start sub_802D350 -sub_802D350: @ 802D350 - push {r4,lr} - ldr r4, =0x02022d00 - ldr r0, [r4] - ldrh r0, [r0, 0x4] - cmp r0, 0x1 - beq _0802D37C - cmp r0, 0x1 - bgt _0802D36C - cmp r0, 0 - beq _0802D376 - b _0802D3B6 - .pool -_0802D36C: - cmp r0, 0x2 - beq _0802D38E - cmp r0, 0x3 - beq _0802D3A6 - b _0802D3B6 -_0802D376: - bl sub_802DE1C - b _0802D39C -_0802D37C: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802D3B6 - movs r0, 0x1 - bl sub_802DF70 - b _0802D39C -_0802D38E: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802D3B6 - bl sub_802DFD4 -_0802D39C: - ldr r1, [r4] - ldrh r0, [r1, 0x4] - adds r0, 0x1 - strh r0, [r1, 0x4] - b _0802D3B6 -_0802D3A6: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802D3B6 - ldr r1, [r4] - movs r0, 0x1 - str r0, [r1] -_0802D3B6: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_802D350 - - thumb_func_start sub_802D3BC -sub_802D3BC: @ 802D3BC - push {r4,r5,lr} - bl sub_802C8AC - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =0x02022d00 - ldr r0, [r0] - ldrh r0, [r0, 0x4] - cmp r0, 0 - beq _0802D3DC - cmp r0, 0x1 - beq _0802D410 - b _0802D43E - .pool -_0802D3DC: - movs r4, 0 - cmp r4, r5 - bge _0802D3F8 -_0802D3E2: - ldr r0, =0x02022d00 - ldr r0, [r0] - lsls r1, r4, 1 - adds r0, 0x1C - adds r0, r1 - ldrb r0, [r0] - bl ClearWindowTilemap - adds r4, 0x1 - cmp r4, r5 - blt _0802D3E2 -_0802D3F8: - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r0, =0x02022d00 - ldr r1, [r0] - ldrh r0, [r1, 0x4] - adds r0, 0x1 - strh r0, [r1, 0x4] - b _0802D43E - .pool -_0802D410: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802D43E - movs r4, 0 - cmp r4, r5 - bge _0802D436 -_0802D420: - ldr r0, =0x02022d00 - ldr r0, [r0] - lsls r1, r4, 1 - adds r0, 0x1C - adds r0, r1 - ldrb r0, [r0] - bl RemoveWindow - adds r4, 0x1 - cmp r4, r5 - blt _0802D420 -_0802D436: - ldr r0, =0x02022d00 - ldr r1, [r0] - movs r0, 0x1 - str r0, [r1] -_0802D43E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802D3BC - - thumb_func_start sub_802D448 -sub_802D448: @ 802D448 - push {r4,r5,lr} - sub sp, 0xC - ldr r5, =0x02022d00 - ldr r0, [r5] - ldrh r4, [r0, 0x4] - cmp r4, 0x1 - beq _0802D4A4 - cmp r4, 0x1 - bgt _0802D464 - cmp r4, 0 - beq _0802D46A - b _0802D4EC - .pool -_0802D464: - cmp r4, 0x2 - beq _0802D4DC - b _0802D4EC -_0802D46A: - movs r0, 0x1 - movs r1, 0x8 - movs r2, 0x14 - movs r3, 0x2 - bl sub_802DA9C - ldr r1, [r5] - strh r0, [r1, 0x12] - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_085EDF2A - movs r1, 0x1 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - ldr r0, [r5] - ldrb r0, [r0, 0x12] - movs r1, 0x2 - bl CopyWindowToVram - b _0802D4D2 - .pool -_0802D4A4: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802D4EC - ldr r0, [r5] - ldrb r0, [r0, 0x12] - bl PutWindowTilemap - ldr r0, [r5] - ldrb r0, [r0, 0x12] - movs r1, 0x1 - movs r2, 0xE - bl sub_8098858 - movs r0, 0x17 - movs r1, 0x7 - movs r2, 0 - bl sub_802DB18 - movs r0, 0 - bl CopyBgTilemapBufferToVram -_0802D4D2: - ldr r1, [r5] - ldrh r0, [r1, 0x4] - adds r0, 0x1 - strh r0, [r1, 0x4] - b _0802D4EC -_0802D4DC: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802D4EC - ldr r1, [r5] - movs r0, 0x1 - str r0, [r1] -_0802D4EC: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_802D448 - - thumb_func_start sub_802D4F4 -sub_802D4F4: @ 802D4F4 - push {r4,r5,lr} - sub sp, 0xC - ldr r5, =0x02022d00 - ldr r0, [r5] - ldrh r4, [r0, 0x4] - cmp r4, 0x1 - beq _0802D550 - cmp r4, 0x1 - bgt _0802D510 - cmp r4, 0 - beq _0802D516 - b _0802D58E - .pool -_0802D510: - cmp r4, 0x2 - beq _0802D57E - b _0802D58E -_0802D516: - movs r0, 0x2 - movs r1, 0x7 - movs r2, 0x1A - movs r3, 0x4 - bl sub_802DA9C - ldr r1, [r5] - strh r0, [r1, 0x12] - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_082C8959 - movs r1, 0x1 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - ldr r0, [r5] - ldrb r0, [r0, 0x12] - movs r1, 0x2 - bl CopyWindowToVram - b _0802D574 - .pool -_0802D550: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802D58E - ldr r0, [r5] - ldrb r0, [r0, 0x12] - bl PutWindowTilemap - ldr r0, [r5] - ldrb r0, [r0, 0x12] - movs r1, 0x1 - movs r2, 0xE - bl sub_8098858 - movs r0, 0 - bl CopyBgTilemapBufferToVram -_0802D574: - ldr r1, [r5] - ldrh r0, [r1, 0x4] - adds r0, 0x1 - strh r0, [r1, 0x4] - b _0802D58E -_0802D57E: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802D58E - ldr r1, [r5] - movs r0, 0x1 - str r0, [r1] -_0802D58E: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_802D4F4 - - thumb_func_start sub_802D598 -sub_802D598: @ 802D598 - push {r4,r5,lr} - ldr r5, =0x02022d00 - ldr r0, [r5] - ldrh r4, [r0, 0x4] - cmp r4, 0 - beq _0802D5B0 - cmp r4, 0x1 - beq _0802D5C8 - b _0802D5DE - .pool -_0802D5B0: - bl sub_802DA14 - bl sub_8198C78 - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r1, [r5] - ldrh r0, [r1, 0x4] - adds r0, 0x1 - strh r0, [r1, 0x4] - b _0802D5DE -_0802D5C8: - bl sub_802DA44 - cmp r0, 0 - bne _0802D5DE - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802D5DE - ldr r0, [r5] - str r4, [r0] -_0802D5DE: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_802D598 - - thumb_func_start sub_802D5E4 -sub_802D5E4: @ 802D5E4 - push {r4,r5,lr} - sub sp, 0xC - ldr r5, =0x02022d00 - ldr r0, [r5] - ldrh r4, [r0, 0x4] - cmp r4, 0x1 - beq _0802D640 - cmp r4, 0x1 - bgt _0802D600 - cmp r4, 0 - beq _0802D606 - b _0802D67E - .pool -_0802D600: - cmp r4, 0x2 - beq _0802D66E - b _0802D67E -_0802D606: - movs r0, 0x2 - movs r1, 0x8 - movs r2, 0x16 - movs r3, 0x4 - bl sub_802DA9C - ldr r1, [r5] - strh r0, [r1, 0x12] - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_085EDF3E - movs r1, 0x1 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - ldr r0, [r5] - ldrb r0, [r0, 0x12] - movs r1, 0x2 - bl CopyWindowToVram - b _0802D664 - .pool -_0802D640: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802D67E - ldr r0, [r5] - ldrb r0, [r0, 0x12] - bl PutWindowTilemap - ldr r0, [r5] - ldrb r0, [r0, 0x12] - movs r1, 0x1 - movs r2, 0xE - bl sub_8098858 - movs r0, 0 - bl CopyBgTilemapBufferToVram -_0802D664: - ldr r1, [r5] - ldrh r0, [r1, 0x4] - adds r0, 0x1 - strh r0, [r1, 0x4] - b _0802D67E -_0802D66E: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802D67E - ldr r1, [r5] - movs r0, 0x1 - str r0, [r1] -_0802D67E: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_802D5E4 - - thumb_func_start sub_802D688 -sub_802D688: @ 802D688 - push {r4,r5,lr} - sub sp, 0xC - ldr r5, =0x02022d00 - ldr r0, [r5] - ldrh r4, [r0, 0x4] - cmp r4, 0x1 - beq _0802D6E4 - cmp r4, 0x1 - bgt _0802D6A4 - cmp r4, 0 - beq _0802D6AA - b _0802D722 - .pool -_0802D6A4: - cmp r4, 0x2 - beq _0802D712 - b _0802D722 -_0802D6AA: - movs r0, 0x7 - movs r1, 0xA - movs r2, 0x10 - movs r3, 0x2 - bl sub_802DA9C - ldr r1, [r5] - strh r0, [r1, 0x12] - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_085EDF6F - movs r1, 0x1 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - ldr r0, [r5] - ldrb r0, [r0, 0x12] - movs r1, 0x2 - bl CopyWindowToVram - b _0802D708 - .pool -_0802D6E4: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802D722 - ldr r0, [r5] - ldrb r0, [r0, 0x12] - bl PutWindowTilemap - ldr r0, [r5] - ldrb r0, [r0, 0x12] - movs r1, 0x1 - movs r2, 0xE - bl sub_8098858 - movs r0, 0 - bl CopyBgTilemapBufferToVram -_0802D708: - ldr r1, [r5] - ldrh r0, [r1, 0x4] - adds r0, 0x1 - strh r0, [r1, 0x4] - b _0802D722 -_0802D712: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802D722 - ldr r1, [r5] - movs r0, 0x1 - str r0, [r1] -_0802D722: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_802D688 - - thumb_func_start sub_802D72C -sub_802D72C: @ 802D72C - push {r4,r5,lr} - ldr r5, =0x02022d00 - ldr r0, [r5] - ldrh r4, [r0, 0x4] - cmp r4, 0 - beq _0802D744 - cmp r4, 0x1 - beq _0802D752 - b _0802D75E - .pool -_0802D744: - bl sub_802D044 - ldr r1, [r5] - ldrh r0, [r1, 0x4] - adds r0, 0x1 - strh r0, [r1, 0x4] - b _0802D75E -_0802D752: - bl sub_802D068 - cmp r0, 0 - bne _0802D75E - ldr r0, [r5] - str r4, [r0] -_0802D75E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_802D72C - - thumb_func_start sub_802D764 -sub_802D764: @ 802D764 - push {lr} - ldr r1, =0x02022d00 - ldr r0, [r1] - movs r2, 0 - strb r2, [r0, 0xA] - ldr r0, [r1] - strb r2, [r0, 0xB] - ldr r2, [r1] - movs r0, 0x6 - strb r0, [r2, 0xC] - ldr r0, [r1] - ldrb r0, [r0, 0xC] - bl sub_802DC9C - pop {r0} - bx r0 - .pool - thumb_func_end sub_802D764 - - thumb_func_start sub_802D788 -sub_802D788: @ 802D788 - push {r4,lr} - ldr r0, =0x02022d00 - ldr r2, [r0] - ldrb r3, [r2, 0xA] - adds r4, r0, 0 - cmp r3, 0 - beq _0802D7A0 - cmp r3, 0x1 - beq _0802D7DA - b _0802D7DE - .pool -_0802D7A0: - ldrb r0, [r2, 0xB] - adds r0, 0x1 - strb r0, [r2, 0xB] - ldr r1, [r4] - ldrb r0, [r1, 0xB] - cmp r0, 0xA - bls _0802D7CA - strb r3, [r1, 0xB] - ldr r0, [r4] - ldrb r1, [r0, 0xC] - adds r1, 0x1 - strb r1, [r0, 0xC] - ldr r1, [r4] - ldrb r0, [r1, 0xC] - cmp r0, 0x9 - bls _0802D7CA - strb r3, [r1, 0xC] - ldr r1, [r4] - ldrb r0, [r1, 0xA] - adds r0, 0x1 - strb r0, [r1, 0xA] -_0802D7CA: - ldr r0, [r4] - ldrb r0, [r0, 0xC] - bl sub_802DC9C - ldr r0, [r4] - ldrb r0, [r0, 0xC] - cmp r0, 0x7 - bne _0802D7DE -_0802D7DA: - movs r0, 0 - b _0802D7E0 -_0802D7DE: - movs r0, 0x1 -_0802D7E0: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802D788 - - thumb_func_start sub_802D7E8 -sub_802D7E8: @ 802D7E8 - push {r4,r5,lr} - sub sp, 0xC - adds r4, r1, 0 - lsls r0, 16 - lsrs r0, 16 - lsls r4, 16 - lsrs r4, 16 - ldr r5, =0x02022d00 - ldr r1, [r5] - adds r1, 0x26 - adds r2, r4, 0 - bl sub_80D6660 - ldr r0, [r5] - adds r0, 0x66 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x1 - bl ConvertIntToDecimalString - bl sub_81AFBF0 - ldr r1, [r5] - adds r1, 0x26 - movs r0, 0 - bl sub_81AFC0C - ldr r1, [r5] - adds r1, 0x66 - movs r0, 0x1 - bl sub_81AFC0C - ldr r0, [r5] - adds r0, 0xA6 - ldr r1, =gUnknown_085EDED3 - bl sub_81AFC28 - movs r0, 0x4 - movs r1, 0x8 - movs r2, 0x16 - movs r3, 0x4 - bl sub_802DA9C - ldr r2, [r5] - movs r4, 0 - movs r3, 0 - strh r0, [r2, 0x12] - lsls r0, 24 - lsrs r0, 24 - adds r2, 0xA6 - movs r1, 0x1 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - str r3, [sp, 0x8] - movs r1, 0x1 - bl Print - ldr r0, [r5] - ldrb r0, [r0, 0x12] - movs r1, 0x2 - bl CopyWindowToVram - ldr r1, [r5] - ldr r0, =0x0000016f - strh r0, [r1, 0x14] - strb r4, [r1, 0xD] - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802D7E8 - - thumb_func_start sub_802D884 -sub_802D884: @ 802D884 - push {r4-r6,lr} - sub sp, 0xC - lsls r0, 16 - lsrs r0, 16 - ldr r4, =0x02022d00 - ldr r1, [r4] - adds r1, 0x26 - bl itemid_get_name - bl sub_81AFBF0 - ldr r1, [r4] - adds r1, 0x26 - movs r0, 0 - bl sub_81AFC0C - ldr r0, [r4] - adds r0, 0xA6 - ldr r1, =gUnknown_085EDEF4 - bl sub_81AFC28 - movs r0, 0x4 - movs r1, 0x8 - movs r2, 0x16 - movs r3, 0x4 - bl sub_802DA9C - ldr r2, [r4] - movs r6, 0 - movs r5, 0 - strh r0, [r2, 0x12] - lsls r0, 24 - lsrs r0, 24 - adds r2, 0xA6 - movs r1, 0x1 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - ldr r0, [r4] - ldrb r0, [r0, 0x12] - movs r1, 0x2 - bl CopyWindowToVram - ldr r0, [r4] - strh r5, [r0, 0x14] - strb r6, [r0, 0xD] - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802D884 - - thumb_func_start sub_802D8FC -sub_802D8FC: @ 802D8FC - push {r4-r6,lr} - sub sp, 0xC - lsls r0, 16 - lsrs r0, 16 - ldr r4, =0x02022d00 - ldr r1, [r4] - adds r1, 0x26 - bl itemid_get_name - bl sub_81AFBF0 - ldr r1, [r4] - adds r1, 0x26 - movs r0, 0 - bl sub_81AFC0C - ldr r0, [r4] - adds r0, 0xA6 - ldr r1, =gUnknown_085EDF11 - bl sub_81AFC28 - movs r0, 0x4 - movs r1, 0x9 - movs r2, 0x16 - movs r3, 0x2 - bl sub_802DA9C - ldr r2, [r4] - movs r6, 0 - movs r5, 0 - strh r0, [r2, 0x12] - lsls r0, 24 - lsrs r0, 24 - adds r2, 0xA6 - movs r1, 0x1 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - ldr r0, [r4] - ldrb r0, [r0, 0x12] - movs r1, 0x2 - bl CopyWindowToVram - ldr r0, [r4] - strh r5, [r0, 0x14] - strb r6, [r0, 0xD] - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802D8FC - - thumb_func_start sub_802D974 -sub_802D974: @ 802D974 - push {r4,lr} - ldr r4, =0x02022d00 - ldr r0, [r4] - ldrb r0, [r0, 0xD] - cmp r0, 0x1 - beq _0802D9C8 - cmp r0, 0x1 - bgt _0802D990 - cmp r0, 0 - beq _0802D99A - b _0802DA0C - .pool -_0802D990: - cmp r0, 0x2 - beq _0802D9EE - cmp r0, 0x3 - beq _0802DA02 - b _0802DA0C -_0802D99A: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802DA0C - ldr r0, [r4] - ldrb r0, [r0, 0x12] - bl PutWindowTilemap - ldr r0, [r4] - ldrb r0, [r0, 0x12] - movs r1, 0x1 - movs r2, 0xE - bl sub_8098858 - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r1, [r4] - ldrb r0, [r1, 0xD] - adds r0, 0x1 - strb r0, [r1, 0xD] - b _0802DA0C -_0802D9C8: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802DA0C - ldr r1, [r4] - ldrh r0, [r1, 0x14] - cmp r0, 0 - bne _0802D9E0 - ldrb r0, [r1, 0xD] - adds r0, 0x2 - b _0802DA00 -_0802D9E0: - ldrh r0, [r1, 0x14] - bl fanfare_play - ldr r1, [r4] - ldrb r0, [r1, 0xD] - adds r0, 0x1 - strb r0, [r1, 0xD] -_0802D9EE: - bl task_is_not_running_overworld_fanfare - lsls r0, 24 - cmp r0, 0 - beq _0802DA0C - ldr r0, =0x02022d00 - ldr r1, [r0] - ldrb r0, [r1, 0xD] - adds r0, 0x1 -_0802DA00: - strb r0, [r1, 0xD] -_0802DA02: - movs r0, 0 - b _0802DA0E - .pool -_0802DA0C: - movs r0, 0x1 -_0802DA0E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802D974 - - thumb_func_start sub_802DA14 -sub_802DA14: @ 802DA14 - push {r4,lr} - ldr r4, =0x02022d00 - ldr r0, [r4] - ldrh r0, [r0, 0x12] - cmp r0, 0xFF - beq _0802DA38 - lsls r0, 24 - lsrs r0, 24 - bl rbox_fill_rectangle - ldr r0, [r4] - ldrb r0, [r0, 0x12] - movs r1, 0x1 - bl CopyWindowToVram - ldr r1, [r4] - movs r0, 0 - strb r0, [r1, 0xD] -_0802DA38: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802DA14 - - thumb_func_start sub_802DA44 -sub_802DA44: @ 802DA44 - push {r4,lr} - ldr r4, =0x02022d00 - ldr r1, [r4] - ldrh r0, [r1, 0x12] - cmp r0, 0xFF - bne _0802DA58 -_0802DA50: - movs r0, 0 - b _0802DA84 - .pool -_0802DA58: - ldrb r0, [r1, 0xD] - cmp r0, 0 - bne _0802DA7E - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802DA82 - ldr r0, [r4] - ldrb r0, [r0, 0x12] - bl RemoveWindow - ldr r1, [r4] - movs r0, 0xFF - strh r0, [r1, 0x12] - ldrb r0, [r1, 0xD] - adds r0, 0x1 - strb r0, [r1, 0xD] - b _0802DA50 -_0802DA7E: - cmp r0, 0x1 - beq _0802DA50 -_0802DA82: - movs r0, 0x1 -_0802DA84: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802DA44 - - thumb_func_start sub_802DA8C -sub_802DA8C: @ 802DA8C - push {lr} - bl sub_8198C58 - lsls r0, 24 - asrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_802DA8C - - thumb_func_start sub_802DA9C -sub_802DA9C: @ 802DA9C - push {r4-r6,lr} - sub sp, 0x8 - ldr r6, =0xffffff00 - ldr r4, [sp] - ands r4, r6 - lsls r0, 24 - lsrs r0, 16 - ldr r5, =0xffff00ff - ands r4, r5 - orrs r4, r0 - lsls r1, 24 - lsrs r1, 8 - ldr r0, =0xff00ffff - ands r4, r0 - orrs r4, r1 - lsls r2, 24 - ldr r0, =0x00ffffff - ands r4, r0 - orrs r4, r2 - str r4, [sp] - lsls r3, 24 - lsrs r3, 24 - ldr r0, [sp, 0x4] - ands r0, r6 - orrs r0, r3 - ands r0, r5 - movs r1, 0xF0 - lsls r1, 4 - orrs r0, r1 - ldr r1, =0x0000ffff - ands r0, r1 - movs r1, 0x86 - lsls r1, 15 - orrs r0, r1 - str r0, [sp, 0x4] - mov r0, sp - bl AddWindow - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r0, r4, 24 - lsrs r0, 24 - movs r1, 0x11 - bl FillWindowPixelBuffer - adds r0, r4, 0 - add sp, 0x8 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_802DA9C - - thumb_func_start sub_802DB18 -sub_802DB18: @ 802DB18 - push {r4,r5,lr} - sub sp, 0x8 - adds r3, r2, 0 - lsls r3, 24 - lsrs r3, 24 - ldr r5, =0xffffff00 - ldr r2, [sp] - ands r2, r5 - lsls r0, 24 - lsrs r0, 16 - ldr r4, =0xffff00ff - ands r2, r4 - orrs r2, r0 - lsls r1, 24 - lsrs r1, 8 - ldr r0, =0xff00ffff - ands r2, r0 - orrs r2, r1 - ldr r0, =0x00ffffff - ands r2, r0 - movs r0, 0xC0 - lsls r0, 19 - orrs r2, r0 - str r2, [sp] - ldr r0, [sp, 0x4] - ands r0, r5 - movs r1, 0x4 - orrs r0, r1 - ands r0, r4 - movs r1, 0x80 - lsls r1, 2 - orrs r0, r1 - ldr r1, =0x0000ffff - ands r0, r1 - movs r1, 0xAC - lsls r1, 14 - orrs r0, r1 - str r0, [sp, 0x4] - mov r0, sp - movs r1, 0x1 - movs r2, 0xD - bl CreateYesNoMenu - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802DB18 - - thumb_func_start sub_802DB8C -sub_802DB8C: @ 802DB8C - push {r4,lr} - sub sp, 0x10 - ldr r1, =gUnknown_082FE1DC - add r0, sp, 0xC - movs r2, 0x3 - bl memcpy - movs r0, 0 - bl PutWindowTilemap - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - add r0, sp, 0xC - str r0, [sp] - movs r4, 0 - str r4, [sp, 0x4] - ldr r0, =gUnknown_085EDE7C - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0x1 - bl box_print - add r0, sp, 0xC - str r0, [sp] - str r4, [sp, 0x4] - ldr r0, =gUnknown_085EDE84 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0x1 - bl box_print - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802DB8C - - thumb_func_start sub_802DBF8 -sub_802DBF8: @ 802DBF8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - bl sub_802C8AC - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - ldr r1, =gUnknown_082FE260 - subs r0, 0x2 - lsls r0, 2 - adds r0, r1 - ldr r5, [r0] - movs r6, 0 - cmp r6, r10 - bge _0802DC62 - ldr r0, =gUnknown_08300D38 - mov r9, r0 - ldr r1, =0x02022d00 - mov r8, r1 -_0802DC26: - lsls r4, r6, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl sub_802C8C8 - adds r1, r0, 0 - ldrh r0, [r1] - lsls r0, 2 - add r0, r9 - ldrb r3, [r0, 0x1] - mov r2, r8 - ldr r0, [r2] - movs r7, 0 - ldrsh r2, [r5, r7] - adds r3, 0x70 - str r4, [sp] - bl sub_802C9D4 - mov r1, r8 - ldr r0, [r1] - movs r2, 0 - ldrsh r1, [r5, r2] - movs r2, 0x70 - adds r3, r4, 0 - bl sub_802CE48 - adds r5, 0x2 - adds r6, 0x1 - cmp r6, r10 - blt _0802DC26 -_0802DC62: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802DBF8 - - thumb_func_start sub_802DC80 -sub_802DC80: @ 802DC80 - ldr r2, =0x02022d00 - ldr r2, [r2] - lsls r0, 2 - ldr r3, =0x000081a8 - adds r2, r3 - adds r2, r0 - ldr r0, [r2] - strh r1, [r0, 0x26] - bx lr - .pool - thumb_func_end sub_802DC80 - - thumb_func_start sub_802DC9C -sub_802DC9C: @ 802DC9C - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x02022d00 - ldr r0, [r0] - adds r1, r4, 0 - bl sub_802CF50 - ldr r0, =gUnknown_082FE1DF - adds r4, r0 - ldrb r0, [r4] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 13 - movs r0, 0x2 - movs r2, 0 - bl ChangeBgY - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802DC9C - - thumb_func_start sub_802DCCC -sub_802DCCC: @ 802DCCC - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r5, 0 - movs r6, 0 -_0802DCD6: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _0802DCEA - ldr r0, =0x02022d00 - ldr r0, [r0] - adds r1, r5, 0 - bl sub_802CB14 - adds r6, 0x1 -_0802DCEA: - lsrs r4, 1 - adds r5, 0x1 - cmp r5, 0x4 - ble _0802DCD6 - subs r0, r6, 0x2 - lsls r0, 24 - lsrs r0, 24 - bl sub_802E00C - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_802DCCC - - thumb_func_start sub_802DD08 -sub_802DD08: @ 802DD08 - push {r4,lr} - sub sp, 0x10 - mov r1, sp - movs r0, 0x40 - strb r0, [r1] - movs r0, 0x5 - strb r0, [r1, 0x1] - movs r0, 0x8 - strb r0, [r1, 0x2] - movs r0, 0x6C - strh r0, [r1, 0x4] - movs r4, 0x6 - strh r4, [r1, 0x6] - ldr r0, =gUnknown_082FE1EC - str r0, [sp, 0x8] - ldr r0, =gUnknown_082FE1F4 - str r0, [sp, 0xC] - movs r0, 0x2 - bl sub_8034C54 - movs r0, 0 - movs r1, 0 - mov r2, sp - bl sub_8034D14 - mov r1, sp - movs r0, 0x4 - strb r0, [r1, 0x1] - movs r0, 0x1E - strh r0, [r1, 0x4] - mov r0, sp - strh r4, [r0, 0x6] - movs r0, 0x1 - movs r1, 0 - mov r2, sp - bl sub_8034D14 - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802DD08 - - thumb_func_start sub_802DD64 -sub_802DD64: @ 802DD64 - push {lr} - adds r1, r0, 0 - movs r0, 0 - bl sub_8035044 - pop {r0} - bx r0 - thumb_func_end sub_802DD64 - - thumb_func_start sub_802DD74 -sub_802DD74: @ 802DD74 - push {lr} - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x1 - bl sub_8035044 - pop {r0} - bx r0 - thumb_func_end sub_802DD74 - - thumb_func_start sub_802DD88 -sub_802DD88: @ 802DD88 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =0x02022d00 - ldr r0, [r0] - bl sub_802CBF0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_802DD88 - - thumb_func_start sub_802DDA0 -sub_802DDA0: @ 802DDA0 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =0x02022d00 - ldr r0, [r0] - bl sub_802CC88 - pop {r0} - bx r0 - .pool - thumb_func_end sub_802DDA0 - - thumb_func_start sub_802DDB8 -sub_802DDB8: @ 802DDB8 - push {lr} - adds r1, r0, 0 - ldr r0, =0x02022d00 - ldr r0, [r0] - bl sub_802CC18 - pop {r1} - bx r1 - .pool - thumb_func_end sub_802DDB8 - - thumb_func_start sub_802DDCC -sub_802DDCC: @ 802DDCC - push {lr} - ldr r0, =0x02022d00 - ldr r0, [r0] - bl sub_802CCB0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_802DDCC - - thumb_func_start sub_802DDE0 -sub_802DDE0: @ 802DDE0 - push {lr} - ldr r0, =0x02022d00 - ldr r0, [r0] - bl sub_802CD3C - pop {r0} - bx r0 - .pool - thumb_func_end sub_802DDE0 - - thumb_func_start sub_802DDF4 -sub_802DDF4: @ 802DDF4 - push {lr} - adds r1, r0, 0 - ldr r0, =0x02022d00 - ldr r0, [r0] - bl sub_802CD70 - pop {r0} - bx r0 - .pool - thumb_func_end sub_802DDF4 - - thumb_func_start sub_802DE08 -sub_802DE08: @ 802DE08 - push {lr} - ldr r0, =0x02022d00 - ldr r0, [r0] - bl sub_802CD98 - pop {r1} - bx r1 - .pool - thumb_func_end sub_802DE08 - - thumb_func_start sub_802DE1C -sub_802DE1C: @ 802DE1C - push {r4-r7,lr} - sub sp, 0x8 - bl sub_802C8AC - lsls r0, 16 - lsrs r7, r0, 16 - ldr r1, =gUnknown_082FE234 - subs r0, r7, 0x2 - lsls r0, 2 - adds r0, r1 - ldr r4, [r0] - ldr r2, =0xffffff00 - ldr r0, [sp] - ands r0, r2 - ldr r1, =0x00ffffff - ands r0, r1 - movs r1, 0x80 - lsls r1, 20 - orrs r0, r1 - str r0, [sp] - ldr r0, [sp, 0x4] - ands r0, r2 - movs r1, 0x2 - orrs r0, r1 - ldr r1, =0xffff00ff - ands r0, r1 - movs r1, 0x80 - lsls r1, 2 - orrs r0, r1 - ldr r1, =0x0000ffff - ands r0, r1 - movs r1, 0xAC - lsls r1, 14 - orrs r0, r1 - str r0, [sp, 0x4] - movs r5, 0 - cmp r5, r7 - bge _0802DEAC - mov r6, sp -_0802DE6A: - ldrb r0, [r4] - lsls r0, 8 - ldr r2, =0xffff00ff - ldr r1, [sp] - ands r1, r2 - orrs r1, r0 - str r1, [sp] - ldrb r2, [r4, 0x2] - lsls r2, 16 - ldr r0, =0xff00ffff - ands r0, r1 - orrs r0, r2 - str r0, [sp] - mov r0, sp - bl AddWindow - ldr r1, =0x02022d00 - ldr r1, [r1] - lsls r2, r5, 1 - adds r1, 0x1C - adds r1, r2 - strh r0, [r1] - lsls r0, 24 - lsrs r0, 24 - bl ClearWindowTilemap - ldrh r0, [r6, 0x6] - adds r0, 0x10 - strh r0, [r6, 0x6] - adds r4, 0x4 - adds r5, 0x1 - cmp r5, r7 - blt _0802DE6A -_0802DEAC: - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802DE1C - - thumb_func_start sub_802DED8 -sub_802DED8: @ 802DED8 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x10 - adds r5, r0, 0 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - add r0, sp, 0xC - strb r1, [r0] - strb r2, [r0, 0x1] - strb r3, [r0, 0x2] - ldr r6, =0x02022d00 - ldr r0, [r6] - lsls r1, r5, 1 - mov r8, r1 - adds r0, 0x1C - add r0, r8 - ldrb r0, [r0] - movs r1, 0 - bl FillWindowPixelBuffer - lsls r5, 24 - lsrs r5, 24 - adds r0, r5, 0 - bl sub_802C8E8 - adds r1, r0, 0 - movs r2, 0x1 - negs r2, r2 - mov r9, r2 - movs r0, 0x1 - bl GetStringWidth - movs r4, 0x40 - subs r4, r0 - lsrs r4, 1 - adds r0, r5, 0 - bl sub_802C8E8 - adds r1, r0, 0 - ldr r0, [r6] - adds r0, 0x1C - add r0, r8 - ldrb r0, [r0] - lsls r4, 24 - lsrs r4, 24 - add r2, sp, 0xC - str r2, [sp] - mov r2, r9 - str r2, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x1 - bl box_print - ldr r0, [r6] - adds r0, 0x1C - add r0, r8 - ldrb r0, [r0] - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802DED8 - - thumb_func_start sub_802DF70 -sub_802DF70: @ 802DF70 - push {r4-r6,lr} - adds r4, r0, 0 - bl sub_802C8AC - lsls r0, 16 - lsrs r5, r0, 16 - cmp r4, 0 - bne _0802DF9A - movs r4, 0 - cmp r4, r5 - bge _0802DFCC -_0802DF86: - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x2 - movs r3, 0x3 - bl sub_802DED8 - adds r4, 0x1 - cmp r4, r5 - blt _0802DF86 - b _0802DFCC -_0802DF9A: - bl sub_802C8BC - lsls r0, 16 - lsrs r6, r0, 16 - movs r4, 0 - cmp r4, r5 - bge _0802DFCC -_0802DFA8: - cmp r6, r4 - beq _0802DFBA - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x2 - movs r3, 0x3 - bl sub_802DED8 - b _0802DFC6 -_0802DFBA: - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x4 - movs r3, 0x5 - bl sub_802DED8 -_0802DFC6: - adds r4, 0x1 - cmp r4, r5 - blt _0802DFA8 -_0802DFCC: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_802DF70 - - thumb_func_start sub_802DFD4 -sub_802DFD4: @ 802DFD4 - push {r4,r5,lr} - bl sub_802C8AC - lsls r0, 16 - lsrs r5, r0, 16 - movs r4, 0 - cmp r4, r5 - bge _0802DFFA -_0802DFE4: - ldr r0, =0x02022d00 - ldr r0, [r0] - lsls r1, r4, 1 - adds r0, 0x1C - adds r0, r1 - ldrb r0, [r0] - bl PutWindowTilemap - adds r4, 0x1 - cmp r4, r5 - blt _0802DFE4 -_0802DFFA: - movs r0, 0 - bl CopyBgTilemapBufferToVram - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802DFD4 - - thumb_func_start sub_802E00C -sub_802E00C: @ 802E00C - push {r4,lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r4, r1, 24 - ldr r0, =0x02022d00 - ldr r2, [r0] - movs r0, 0 - str r0, [r2, 0x18] - lsrs r1, 25 - lsls r1, 16 - movs r0, 0x1 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - ands r4, r0 - lsls r4, 8 - subs r4, 0x28 - lsls r4, 8 - adds r1, r4, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 - bl ShowBg - ldr r0, =sub_802E090 - movs r1, 0x4 - bl AddTask - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802E00C - - thumb_func_start sub_802E058 -sub_802E058: @ 802E058 - push {r4,lr} - ldr r4, =0x02022d00 - ldr r0, [r4] - ldr r0, [r0, 0x18] - cmp r0, 0x1F - bls _0802E06C - movs r0, 0 - b _0802E08A - .pool -_0802E06C: - movs r0, 0x1 - movs r1, 0x80 - movs r2, 0x1 - bl ChangeBgY - ldr r1, [r4] - ldr r0, [r1, 0x18] - adds r0, 0x1 - str r0, [r1, 0x18] - cmp r0, 0x1F - bls _0802E088 - movs r0, 0x1 - bl HideBg -_0802E088: - movs r0, 0x1 -_0802E08A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802E058 - - thumb_func_start sub_802E090 -sub_802E090: @ 802E090 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_802E058 - cmp r0, 0 - bne _0802E0A4 - adds r0, r4, 0 - bl remove_task -_0802E0A4: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_802E090 - - thumb_func_start sub_802E0AC -sub_802E0AC: @ 802E0AC - push {lr} - sub sp, 0xC - mov r2, sp - movs r1, 0x1 - strb r1, [r2] - ldrh r1, [r0] - strh r1, [r2, 0x2] - ldr r1, [r0, 0x4] - str r1, [sp, 0x8] - ldr r0, [r0, 0x8] - str r0, [sp, 0x4] - mov r0, sp - bl sub_800FE50 - add sp, 0xC - pop {r0} - bx r0 - thumb_func_end sub_802E0AC - - thumb_func_start sub_802E0D0 -sub_802E0D0: @ 802E0D0 - push {r4,lr} - sub sp, 0xC - adds r4, r1, 0 - ldr r3, =0x03003090 - lsls r2, r0, 4 - adds r0, r2, r3 - ldrh r1, [r0] - movs r0, 0xFF - lsls r0, 8 - ands r0, r1 - movs r1, 0xBC - lsls r1, 6 - cmp r0, r1 - bne _0802E100 - adds r1, r3, 0x2 - adds r1, r2, r1 - mov r0, sp - movs r2, 0xC - bl memcpy - mov r0, sp - ldrb r0, [r0] - cmp r0, 0x1 - beq _0802E108 -_0802E100: - movs r0, 0 - b _0802E118 - .pool -_0802E108: - mov r0, sp - ldrh r0, [r0, 0x2] - strh r0, [r4] - ldr r0, [sp, 0x8] - str r0, [r4, 0x4] - ldr r0, [sp, 0x4] - str r0, [r4, 0x8] - movs r0, 0x1 -_0802E118: - add sp, 0xC - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802E0D0 - - thumb_func_start sub_802E120 -sub_802E120: @ 802E120 - push {lr} - sub sp, 0xC - mov r2, sp - movs r1, 0x2 - strb r1, [r2] - str r0, [sp, 0x4] - mov r0, sp - bl sub_800FE50 - add sp, 0xC - pop {r0} - bx r0 - thumb_func_end sub_802E120 - - thumb_func_start sub_802E138 -sub_802E138: @ 802E138 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0xC - mov r3, sp - movs r2, 0x3 - strb r2, [r3] - ldr r3, [r1, 0x8] - lsls r3, 15 - ldr r2, [sp, 0x8] - ldr r4, =0x00007fff - mov r8, r4 - ands r2, r4 - orrs r2, r3 - str r2, [sp, 0x8] - mov r6, sp - ldrb r2, [r1, 0x1] - movs r5, 0x1F - adds r3, r5, 0 - ands r3, r2 - ldrb r4, [r6, 0x3] - movs r2, 0x20 - negs r2, r2 - ands r2, r4 - orrs r2, r3 - strb r2, [r6, 0x3] - mov r3, sp - ldrb r2, [r1] - strb r2, [r3, 0x1] - ldrh r2, [r1, 0x2] - strh r2, [r3, 0x6] - mov r4, sp - ldrh r2, [r1, 0x4] - mov r1, r8 - ands r2, r1 - ldrh r3, [r4, 0x8] - ldr r1, =0xffff8000 - ands r1, r3 - orrs r1, r2 - strh r1, [r4, 0x8] - mov r2, sp - ldrh r1, [r0, 0x10] - strb r1, [r2, 0x2] - mov r3, sp - ldr r1, [r0, 0x14] - lsls r1, 5 - ldrb r2, [r3, 0x3] - ands r5, r2 - orrs r5, r1 - strb r5, [r3, 0x3] - mov r1, sp - ldrh r0, [r0, 0xE] - strh r0, [r1, 0x4] - mov r0, sp - bl sub_800FE50 - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802E138 - - thumb_func_start sub_802E1BC -sub_802E1BC: @ 802E1BC - push {r4,r5,lr} - sub sp, 0xC - adds r5, r0, 0 - adds r4, r1, 0 - ldr r2, =0x03003090 - ldrh r0, [r2] - movs r1, 0xFF - lsls r1, 8 - ands r1, r0 - movs r0, 0xBC - lsls r0, 6 - cmp r1, r0 - bne _0802E228 - adds r1, r2, 0x2 - mov r0, sp - movs r2, 0xC - bl memcpy - mov r0, sp - ldrb r0, [r0] - cmp r0, 0x3 - bne _0802E228 - ldr r0, [sp, 0x8] - lsrs r0, 15 - str r0, [r4, 0x8] - mov r0, sp - ldrb r1, [r0, 0x3] - lsls r0, r1, 27 - lsrs r0, 27 - strb r0, [r4, 0x1] - mov r0, sp - ldrb r0, [r0, 0x1] - strb r0, [r4] - mov r0, sp - ldrh r0, [r0, 0x6] - strh r0, [r4, 0x2] - mov r0, sp - ldrh r0, [r0, 0x8] - lsls r0, 17 - lsrs r0, 17 - strh r0, [r4, 0x4] - mov r0, sp - ldrb r0, [r0, 0x2] - strh r0, [r5, 0x10] - lsls r1, 24 - lsrs r1, 29 - str r1, [r5, 0x14] - mov r0, sp - ldrh r0, [r0, 0x4] - strh r0, [r5, 0xE] - movs r0, 0x1 - b _0802E22A - .pool -_0802E228: - movs r0, 0 -_0802E22A: - add sp, 0xC - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_802E1BC - - thumb_func_start sub_802E234 -sub_802E234: @ 802E234 - push {r4,lr} - sub sp, 0xC - mov r4, sp - movs r3, 0x4 - strb r3, [r4] - ldrh r3, [r0, 0x10] - strb r3, [r4, 0x1] - ldr r3, [r0, 0x14] - strb r3, [r4, 0x2] - ldr r3, [r0, 0x18] - strb r3, [r4, 0x3] - mov r3, sp - ldrh r0, [r0, 0xE] - strh r0, [r3, 0x4] - mov r0, sp - strb r1, [r0, 0x6] - strh r2, [r0, 0x8] - bl sub_800FE50 - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_802E234 - - thumb_func_start sub_802E264 -sub_802E264: @ 802E264 - push {r4-r6,lr} - sub sp, 0xC - adds r4, r0, 0 - adds r5, r2, 0 - adds r6, r3, 0 - ldr r3, =0x03003090 - lsls r2, r1, 4 - adds r0, r2, r3 - ldrh r1, [r0] - movs r0, 0xFF - lsls r0, 8 - ands r0, r1 - movs r1, 0xBC - lsls r1, 6 - cmp r0, r1 - bne _0802E2C4 - adds r1, r3, 0x2 - adds r1, r2, r1 - mov r0, sp - movs r2, 0xC - bl memcpy - mov r0, sp - ldrb r0, [r0] - cmp r0, 0x4 - bne _0802E2C4 - mov r0, sp - ldrb r0, [r0, 0x1] - strh r0, [r4, 0x10] - mov r0, sp - ldrb r0, [r0, 0x2] - str r0, [r4, 0x14] - mov r0, sp - ldrb r0, [r0, 0x3] - str r0, [r4, 0x18] - mov r0, sp - ldrh r0, [r0, 0x4] - strh r0, [r4, 0xE] - mov r0, sp - ldrb r0, [r0, 0x6] - strb r0, [r5] - mov r0, sp - ldrh r0, [r0, 0x8] - strh r0, [r6] - movs r0, 0x1 - b _0802E2C6 - .pool -_0802E2C4: - movs r0, 0 -_0802E2C6: - add sp, 0xC - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_802E264 - - thumb_func_start sub_802E2D0 -sub_802E2D0: @ 802E2D0 - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - ldr r3, =0x03003090 - lsls r2, r1, 4 - adds r0, r2, r3 - ldrh r1, [r0] - movs r0, 0xFF - lsls r0, 8 - ands r0, r1 - movs r1, 0xBC - lsls r1, 6 - cmp r0, r1 - bne _0802E320 - adds r1, r3, 0x2 - adds r1, r2, r1 - mov r0, sp - movs r2, 0xC - bl memcpy - mov r0, sp - ldrb r0, [r0] - cmp r0, 0x4 - bne _0802E320 - mov r0, sp - ldrb r0, [r0, 0x1] - strh r0, [r4, 0x10] - mov r0, sp - ldrb r0, [r0, 0x2] - str r0, [r4, 0x14] - mov r0, sp - ldrb r0, [r0, 0x3] - str r0, [r4, 0x18] - mov r0, sp - ldrh r0, [r0, 0x4] - strh r0, [r4, 0xE] - movs r0, 0x1 - b _0802E322 - .pool -_0802E320: - movs r0, 0 -_0802E322: - add sp, 0xC - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802E2D0 - - thumb_func_start sub_802E32C -sub_802E32C: @ 802E32C - ldr r0, =0x03005d90 - ldr r0, [r0] - movs r1, 0xFE - lsls r1, 1 - adds r0, r1 - bx lr - .pool - thumb_func_end sub_802E32C - - thumb_func_start sub_802E33C -sub_802E33C: @ 802E33C - push {lr} - bl sub_802E32C - movs r1, 0 - strh r1, [r0] - str r1, [r0, 0xC] - strh r1, [r0, 0x4] - strh r1, [r0, 0x6] - str r1, [r0, 0x8] - strh r1, [r0, 0x2] - pop {r0} - bx r0 - thumb_func_end sub_802E33C - - thumb_func_start sub_802E354 -sub_802E354: @ 802E354 - push {r4-r6,lr} - adds r4, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - lsls r2, 16 - lsrs r6, r2, 16 - bl sub_802E32C - adds r1, r0, 0 - movs r2, 0 - ldr r0, [r1, 0xC] - cmp r0, r4 - bcs _0802E378 - ldr r0, =0x00018696 - cmp r4, r0 - bhi _0802E378 - str r4, [r1, 0xC] - movs r2, 0x1 -_0802E378: - ldrh r0, [r1] - cmp r0, r5 - bcs _0802E388 - ldr r0, =0x0000270f - cmp r5, r0 - bhi _0802E388 - strh r5, [r1] - movs r2, 0x1 -_0802E388: - ldrh r0, [r1, 0x4] - cmp r0, r6 - bcs _0802E398 - ldr r0, =0x0000270f - cmp r6, r0 - bhi _0802E398 - strh r6, [r1, 0x4] - movs r2, 0x1 -_0802E398: - adds r0, r2, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_802E354 - - thumb_func_start sub_802E3A8 -sub_802E3A8: @ 802E3A8 - push {lr} - bl sub_802E32C - adds r2, r0, 0 - ldrh r1, [r2, 0x6] - ldr r0, =0x0000270e - cmp r1, r0 - bhi _0802E3BC - adds r0, r1, 0x1 - strh r0, [r2, 0x6] -_0802E3BC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_802E3A8 - - thumb_func_start sub_802E3C4 -sub_802E3C4: @ 802E3C4 - push {r4,lr} - ldr r4, =sub_802E3E4 - adds r0, r4, 0 - movs r1, 0 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802E3C4 - - thumb_func_start sub_802E3E4 -sub_802E3E4: @ 802E3E4 - push {r4-r7,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r7, r0, r1 - movs r1, 0 - ldrsh r0, [r7, r1] - cmp r0, 0x1 - beq _0802E4A8 - cmp r0, 0x1 - bgt _0802E40C - cmp r0, 0 - beq _0802E416 - b _0802E4F6 - .pool -_0802E40C: - cmp r0, 0x2 - beq _0802E4B4 - cmp r0, 0x3 - beq _0802E4DC - b _0802E4F6 -_0802E416: - ldr r0, =gUnknown_082FE270 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp] - str r1, [sp, 0x4] - ldr r1, =gUnknown_085EDE8D - movs r0, 0x1 - movs r2, 0 - bl GetStringWidth - adds r4, r0, 0 - movs r6, 0 - ldr r5, =gUnknown_082FE278 -_0802E430: - ldr r1, [r5] - movs r0, 0x1 - movs r2, 0 - bl GetStringWidth - adds r0, 0x26 - cmp r0, r4 - ble _0802E442 - adds r4, r0, 0 -_0802E442: - adds r5, 0x4 - adds r6, 0x1 - cmp r6, 0x2 - bls _0802E430 - adds r0, r4, 0x7 - cmp r0, 0 - bge _0802E452 - adds r0, 0x7 -_0802E452: - asrs r4, r0, 3 - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _0802E45E - adds r4, 0x1 -_0802E45E: - movs r1, 0x1E - subs r1, r4 - lsrs r0, r1, 31 - adds r1, r0 - asrs r1, 1 - lsls r1, 24 - lsrs r1, 16 - ldr r2, =0xffff00ff - ldr r0, [sp] - ands r0, r2 - orrs r0, r1 - lsls r2, r4, 24 - ldr r1, =0x00ffffff - ands r0, r1 - orrs r0, r2 - str r0, [sp] - mov r0, sp - bl AddWindow - strh r0, [r7, 0x2] - ldrh r0, [r7, 0x2] - adds r1, r4, 0 - bl sub_802E500 - ldrb r0, [r7, 0x2] - movs r1, 0x3 - b _0802E4CA - .pool -_0802E4A8: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802E4F6 - b _0802E4CE -_0802E4B4: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _0802E4F6 - ldrb r0, [r7, 0x2] - bl rbox_fill_rectangle - ldrb r0, [r7, 0x2] - movs r1, 0x1 -_0802E4CA: - bl CopyWindowToVram -_0802E4CE: - ldrh r0, [r7] - adds r0, 0x1 - strh r0, [r7] - b _0802E4F6 - .pool -_0802E4DC: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802E4F6 - ldrb r0, [r7, 0x2] - bl RemoveWindow - adds r0, r4, 0 - bl remove_task - bl script_env_2_enable_and_set_ctx_running -_0802E4F6: - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_802E3E4 - - thumb_func_start sub_802E500 -sub_802E500: @ 802E500 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - str r1, [sp, 0x1C] - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x18] - bl sub_802E32C - ldrh r1, [r0] - str r1, [sp, 0xC] - ldr r1, [r0, 0xC] - str r1, [sp, 0x10] - ldrh r0, [r0, 0x4] - str r0, [sp, 0x14] - ldr r0, [sp, 0x18] - lsls r4, r0, 24 - lsrs r4, 24 - ldr r5, =0x0000021d - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0xD0 - bl box_border_load_tiles_and_pal - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0xD - bl sub_8098858 - adds r0, r4, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r5, =gUnknown_085EDE8D - ldr r1, [sp, 0x1C] - lsls r2, r1, 3 - movs r0, 0x1 - adds r1, r5, 0 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x1 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r4, 0 - movs r1, 0x1 - adds r2, r5, 0 - bl Print - movs r6, 0 - adds r7, r4, 0 - movs r0, 0xFF - mov r10, r0 - mov r9, r6 - mov r1, sp - adds r1, 0xC - str r1, [sp, 0x20] - movs r0, 0xC8 - lsls r0, 21 - mov r8, r0 - ldr r5, =0x02021cc4 -_0802E58A: - ldr r1, =gUnknown_082FE278 - lsls r0, r6, 2 - adds r0, r1 - ldr r2, [r0] - mov r1, r8 - lsrs r4, r1, 24 - str r4, [sp] - mov r0, r10 - str r0, [sp, 0x4] - mov r1, r9 - str r1, [sp, 0x8] - adds r0, r7, 0 - movs r1, 0x1 - movs r3, 0 - bl Print - ldr r0, [sp, 0x20] - ldm r0!, {r1} - str r0, [sp, 0x20] - adds r0, r5, 0 - movs r2, 0 - movs r3, 0x5 - bl ConvertIntToDecimalString - adds r0, r5, 0 - bl sub_802E620 - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0 - bl GetStringWidth - ldr r1, [sp, 0x1C] - lsls r3, r1, 3 - subs r3, r0 - lsls r3, 24 - lsrs r3, 24 - str r4, [sp] - mov r0, r10 - str r0, [sp, 0x4] - mov r1, r9 - str r1, [sp, 0x8] - adds r0, r7, 0 - movs r1, 0x1 - adds r2, r5, 0 - bl Print - movs r0, 0x80 - lsls r0, 21 - add r8, r0 - adds r6, 0x1 - ldr r1, [sp, 0x18] - lsls r0, r1, 24 - cmp r6, 0x2 - bls _0802E58A - lsrs r0, 24 - bl PutWindowTilemap - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802E500 - - thumb_func_start sub_802E620 -sub_802E620: @ 802E620 - push {lr} - adds r1, r0, 0 - b _0802E628 -_0802E626: - adds r1, 0x1 -_0802E628: - ldrb r0, [r1] - cmp r0, 0xFF - beq _0802E636 - cmp r0, 0 - bne _0802E626 - movs r0, 0xFF - strb r0, [r1] -_0802E636: - pop {r0} - bx r0 - thumb_func_end sub_802E620 - - thumb_func_start sub_802E63C -sub_802E63C: @ 802E63C - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =sub_802E6D0 - bl AddTask - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r0, r1 - movs r1, 0x1 - strh r1, [r0, 0x8] - strh r5, [r0, 0xA] - ldr r0, =gUnknown_082FE748 - lsls r5, 4 - adds r5, r0 - ldr r1, [r5] - adds r0, r4, 0 - bl _call_via_r1 - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_802E63C - - thumb_func_start sub_802E688 -sub_802E688: @ 802E688 - push {lr} - ldr r0, =sub_802E6D0 - bl get_task_id_by_function - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - beq _0802E6B4 - ldr r0, =0x03005e00 - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - movs r0, 0x2 - strh r0, [r1, 0x8] - movs r0, 0x1 - b _0802E6B6 - .pool -_0802E6B4: - movs r0, 0 -_0802E6B6: - pop {r1} - bx r1 - thumb_func_end sub_802E688 - - thumb_func_start sub_802E6BC -sub_802E6BC: @ 802E6BC - push {lr} - ldr r0, =sub_802E6D0 - bl is_function_an_active_task - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_802E6BC - - thumb_func_start sub_802E6D0 -sub_802E6D0: @ 802E6D0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0x3 - beq _0802E71C - cmp r0, 0x3 - bgt _0802E6F8 - cmp r0, 0x2 - beq _0802E6FE - b _0802E752 - .pool -_0802E6F8: - cmp r0, 0x4 - beq _0802E738 - b _0802E752 -_0802E6FE: - ldr r1, =gUnknown_082FE748 - movs r2, 0x2 - ldrsh r0, [r4, r2] - lsls r0, 4 - adds r1, 0x8 - adds r0, r1 - ldr r1, [r0] - adds r0, r5, 0 - bl _call_via_r1 - movs r0, 0x3 - strh r0, [r4] - b _0802E752 - .pool -_0802E71C: - ldr r0, =gUnknown_082FE748 - movs r2, 0x2 - ldrsh r1, [r4, r2] - lsls r1, 4 - adds r0, 0xC - adds r1, r0 - ldr r1, [r1] - adds r0, r5, 0 - bl _call_via_r1 - b _0802E752 - .pool -_0802E738: - ldr r0, =gUnknown_082FE748 - movs r2, 0x2 - ldrsh r1, [r4, r2] - lsls r1, 4 - adds r0, 0x4 - adds r1, r0 - ldr r1, [r1] - adds r0, r5, 0 - bl _call_via_r1 - adds r0, r5, 0 - bl remove_task -_0802E752: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802E6D0 - - thumb_func_start sub_802E75C -sub_802E75C: @ 802E75C - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r1, 0x6 - ldrsh r0, [r4, r1] - lsls r0, 3 - ldr r1, =gUnknown_082FE6C8 - adds r0, r1 - bl LoadCompressedObjectPic - movs r2, 0x8 - ldrsh r0, [r4, r2] - lsls r0, 3 - ldr r1, =gUnknown_082FE6D8 - adds r0, r1 - bl LoadTaggedObjectPalette - movs r5, 0 - movs r3, 0x10 - ldrsh r0, [r4, r3] - cmp r5, r0 - bge _0802E7C4 -_0802E790: - movs r0, 0x4 - ldrsh r1, [r4, r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - ldr r1, =gUnknown_082FE730 - adds r0, r1 - movs r2, 0x12 - ldrsh r1, [r4, r2] - movs r3, 0x14 - ldrsh r2, [r4, r3] - ldrb r3, [r4, 0xE] - bl AddObjectToFront - lsls r1, r5, 1 - adds r1, r4 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1, 0x1A] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - movs r1, 0x10 - ldrsh r0, [r4, r1] - cmp r5, r0 - blt _0802E790 -_0802E7C4: - movs r5, 0 - movs r2, 0x10 - ldrsh r0, [r4, r2] - cmp r5, r0 - bge _0802E820 - movs r7, 0x3 - movs r3, 0xD - negs r3, r3 - mov r12, r3 - ldr r6, =0x02020630 -_0802E7D8: - lsls r0, r5, 1 - adds r0, r4 - movs r1, 0x1A - ldrsh r0, [r0, r1] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r6 - ldrb r1, [r4, 0xC] - ands r1, r7 - lsls r1, 2 - ldrb r3, [r2, 0x5] - mov r0, r12 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x5] - adds r3, r2, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r3] - ldrh r0, [r4, 0xA] - strh r0, [r2, 0x30] - mov r3, r8 - strh r3, [r2, 0x34] - strh r5, [r2, 0x36] - ldrh r0, [r4, 0x1A] - strh r0, [r2, 0x38] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - movs r1, 0x10 - ldrsh r0, [r4, r1] - cmp r5, r0 - blt _0802E7D8 -_0802E820: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802E75C - - thumb_func_start sub_802E83C -sub_802E83C: @ 802E83C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r1, =0x03005e08 - adds r4, r1 - movs r5, 0 - strh r5, [r4, 0x4] - strh r5, [r4, 0x6] - strh r5, [r4, 0x8] - movs r1, 0x3C - strh r1, [r4, 0xA] - strh r5, [r4, 0xC] - strh r5, [r4, 0xE] - movs r1, 0x3 - strh r1, [r4, 0x10] - movs r1, 0x78 - strh r1, [r4, 0x12] - movs r1, 0x58 - strh r1, [r4, 0x14] - adds r1, r4, 0 - bl sub_802E75C - movs r0, 0x1C - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =0x02020630 - adds r0, r5 - movs r1, 0x4 - bl StartObjectImageAnim - movs r0, 0x1C - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =0x0000ffe0 - strh r1, [r0, 0x24] - movs r0, 0x1E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x5 - bl StartObjectImageAnim - movs r0, 0x1E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x20 - strh r1, [r0, 0x24] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802E83C - - thumb_func_start sub_802E8C8 -sub_802E8C8: @ 802E8C8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - movs r5, 0 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r4, r1, r0 - b _0802E8FC - .pool -_0802E8E0: - lsls r0, r5, 1 - adds r0, r4 - movs r2, 0x1A - ldrsh r1, [r0, r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_0802E8FC: - movs r1, 0x10 - ldrsh r0, [r4, r1] - cmp r5, r0 - blt _0802E8E0 - ldr r1, =gUnknown_082FE6C8 - movs r2, 0x6 - ldrsh r0, [r4, r2] - lsls r0, 3 - adds r0, r1 - ldrh r0, [r0, 0x6] - bl FreeObjectTilesByTag - ldr r1, =gUnknown_082FE6D8 - movs r2, 0x8 - ldrsh r0, [r4, r2] - lsls r0, 3 - adds r0, r1 - ldrh r0, [r0, 0x4] - bl FreeObjectPaletteByTag - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802E8C8 - - thumb_func_start sub_802E938 -sub_802E938: @ 802E938 - push {r4-r6,lr} - adds r6, r0, 0 - movs r0, 0x34 - ldrsh r1, [r6, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r5, r0, r1 - movs r1, 0x16 - ldrsh r0, [r5, r1] - movs r2, 0xA - ldrsh r1, [r5, r2] - bl __modsi3 - cmp r0, 0 - bne _0802EA4A - ldrh r2, [r5, 0x16] - movs r3, 0x16 - ldrsh r1, [r5, r3] - movs r3, 0x14 - ldrsh r0, [r5, r3] - cmp r1, r0 - beq _0802EA4A - strh r2, [r5, 0x14] - movs r1, 0x32 - ldrsh r0, [r6, r1] - cmp r0, 0x4 - bhi _0802EA44 - lsls r0, 2 - ldr r1, =_0802E984 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0802E984: - .4byte _0802E998 - .4byte _0802E9A6 - .4byte _0802E9A6 - .4byte _0802E9BA - .4byte _0802EA04 -_0802E998: - adds r2, r6, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_0802E9A6: - movs r0, 0x38 - bl audio_play - ldrh r1, [r6, 0x32] - lsls r1, 24 - lsrs r1, 24 - adds r0, r6, 0 - bl StartObjectImageAnim - b _0802EA44 -_0802E9BA: - movs r0, 0x15 - bl audio_play - ldrh r1, [r6, 0x32] - lsls r1, 24 - lsrs r1, 24 - adds r0, r6, 0 - bl StartObjectImageAnim - ldr r4, =0x02020630 - movs r2, 0x1C - ldrsh r0, [r5, r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - movs r3, 0x1E - ldrsh r1, [r5, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - b _0802EA44 - .pool -_0802EA04: - adds r1, r6, 0 - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - ldr r3, =0x02020630 - movs r0, 0x1C - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - movs r0, 0x1E - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - movs r0, 0x4 - strh r0, [r5] - b _0802EA4A - .pool -_0802EA44: - ldrh r0, [r6, 0x32] - adds r0, 0x1 - strh r0, [r6, 0x32] -_0802EA4A: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_802E938 - - thumb_func_start sub_802EA50 -sub_802EA50: @ 802EA50 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r5, =0x03005e08 - adds r6, r4, r5 - movs r0, 0x38 - bl audio_play - ldr r2, =0x02020630 - movs r0, 0x1A - ldrsh r1, [r6, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r2, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_802E938 - str r1, [r0] - movs r0, 0x1A - ldrsh r1, [r6, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - subs r5, 0x8 - adds r4, r5 - movs r0, 0x3 - strh r0, [r4, 0x8] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802EA50 - - thumb_func_start sub_802EAB0 -sub_802EAB0: @ 802EAB0 - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r4, r1, r0 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _0802EB14 - ldr r1, =0x03003090 - ldrh r0, [r1, 0x2] - ldr r5, =0x00007fff - cmp r0, r5 - bne _0802EAD8 - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x16] -_0802EAD8: - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - bne _0802EB1A - ldrh r0, [r4, 0x18] - adds r0, 0x1 - strh r0, [r4, 0x18] - mov r0, sp - movs r1, 0 - movs r2, 0xC - bl memset - mov r0, sp - strh r5, [r0] - mov r1, sp - ldrh r0, [r4, 0x18] - strh r0, [r1, 0x2] - mov r0, sp - bl sub_800FE50 - b _0802EB1A - .pool -_0802EB14: - ldrh r0, [r4, 0x16] - adds r0, 0x1 - strh r0, [r4, 0x16] -_0802EB1A: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_802EAB0 - - thumb_func_start sub_802EB24 -sub_802EB24: @ 802EB24 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - ldr r0, [sp, 0x18] - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - lsls r6, 16 - lsrs r6, 16 - lsls r3, 16 - lsrs r3, 16 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r0, =sub_802EB98 - movs r1, 0x50 - str r3, [sp] - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0xC] - strh r5, [r1, 0xE] - strh r6, [r1, 0x10] - ldr r3, [sp] - strh r3, [r1, 0x12] - mov r0, r8 - strh r0, [r1, 0x14] - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802EB24 - - thumb_func_start sub_802EB84 -sub_802EB84: @ 802EB84 - push {lr} - ldr r0, =sub_802EB98 - bl is_function_an_active_task - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_802EB84 - - thumb_func_start sub_802EB98 -sub_802EB98: @ 802EB98 - push {r4-r6,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r5, r0, r1 - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _0802EC08 - cmp r0, 0x1 - bgt _0802EBC0 - cmp r0, 0 - beq _0802EBC6 - b _0802EC8A - .pool -_0802EBC0: - cmp r0, 0x2 - beq _0802EC4C - b _0802EC8A -_0802EBC6: - ldrh r0, [r5, 0x4] - ldrh r1, [r5, 0x6] - bl sub_802EF50 - ldrh r0, [r5, 0x4] - ldrh r1, [r5, 0x6] - movs r3, 0x8 - ldrsh r2, [r5, r3] - movs r4, 0xA - ldrsh r3, [r5, r4] - ldrb r4, [r5, 0xC] - str r4, [sp] - bl sub_802EFA8 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0xE] - ldrh r0, [r5, 0x4] - ldrh r1, [r5, 0x6] - movs r3, 0x8 - ldrsh r2, [r5, r3] - movs r4, 0xA - ldrsh r3, [r5, r4] - ldrb r4, [r5, 0xC] - str r4, [sp] - adds r4, r5, 0 - adds r4, 0x10 - str r4, [sp, 0x4] - adds r4, 0x2 - str r4, [sp, 0x8] - bl sub_802EFFC - b _0802EC3E -_0802EC08: - ldrb r0, [r5, 0xE] - bl sub_802EC98 - cmp r0, 0 - bne _0802EC8A - ldrb r0, [r5, 0xE] - ldrb r1, [r5, 0x10] - ldrb r2, [r5, 0x12] - bl sub_802EDCC - movs r0, 0xE - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl obj_free_rotscale_entry - movs r3, 0xE - ldrsh r1, [r5, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles -_0802EC3E: - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - b _0802EC8A - .pool -_0802EC4C: - ldrb r0, [r5, 0x10] - bl sub_802EE30 - cmp r0, 0 - bne _0802EC8A - movs r4, 0x10 - ldrsh r1, [r5, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl RemoveObjectAndFreeTiles - movs r0, 0x12 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldrh r0, [r5, 0x4] - bl FreeObjectTilesByTag - ldrh r0, [r5, 0x6] - bl FreeObjectPaletteByTag - adds r0, r6, 0 - bl remove_task -_0802EC8A: - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802EB98 - - thumb_func_start sub_802EC98 -sub_802EC98: @ 802EC98 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r4, r1, r0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x7 - bls _0802ECB2 - b _0802EDC4 -_0802ECB2: - lsls r0, 2 - ldr r1, =_0802ECC4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0802ECC4: - .4byte _0802ECE4 - .4byte _0802ECF6 - .4byte _0802ED1C - .4byte _0802ED2C - .4byte _0802ED4E - .4byte _0802ED86 - .4byte _0802EDAC - .4byte _0802ED82 -_0802ECE4: - movs r1, 0x80 - lsls r1, 4 - adds r0, r4, 0 - movs r2, 0x1A - bl sub_8007E18 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] -_0802ECF6: - movs r2, 0x32 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _0802ED04 - movs r0, 0x39 - bl audio_play -_0802ED04: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x13 - ble _0802EDC4 - movs r0, 0 - strh r0, [r4, 0x32] - adds r0, r4, 0 - movs r1, 0x1 - b _0802EDA2 -_0802ED1C: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0802EDC4 - b _0802EDA6 -_0802ED2C: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _0802EDC4 - movs r0, 0 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - adds r0, r4, 0 - movs r1, 0x2 - bl StartObjectRotScalAnim - b _0802EDC4 -_0802ED4E: - ldrh r0, [r4, 0x22] - subs r0, 0x4 - strh r0, [r4, 0x22] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _0802EDC4 - ldrh r1, [r4, 0x36] - movs r2, 0x36 - ldrsh r0, [r4, r2] - cmp r0, 0x1 - bgt _0802ED7E - adds r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - movs r0, 0 - strh r0, [r4, 0x32] - b _0802EDA6 -_0802ED7E: - movs r0, 0x7 - strh r0, [r4, 0x2E] -_0802ED82: - movs r0, 0 - b _0802EDC6 -_0802ED86: - ldrh r0, [r4, 0x22] - adds r0, 0x4 - strh r0, [r4, 0x22] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _0802EDC4 - movs r0, 0 - strh r0, [r4, 0x32] - adds r0, r4, 0 - movs r1, 0x3 -_0802EDA2: - bl StartObjectRotScalAnim -_0802EDA6: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - b _0802EDC2 -_0802EDAC: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0802EDC4 - ldrh r0, [r4, 0x36] - adds r0, 0x1 - strh r0, [r4, 0x36] - movs r0, 0x1 -_0802EDC2: - strh r0, [r4, 0x2E] -_0802EDC4: - movs r0, 0x1 -_0802EDC6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802EC98 - - thumb_func_start sub_802EDCC -sub_802EDCC: @ 802EDCC - push {r4-r6,lr} - mov r6, r8 - push {r6} - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =0x02020630 - mov r8, r0 - lsls r4, r1, 4 - adds r4, r1 - lsls r4, 2 - adds r5, r4, r0 - ldr r0, =0x0000ffd8 - strh r0, [r5, 0x26] - lsls r3, r2, 4 - adds r3, r2 - lsls r3, 2 - mov r1, r8 - adds r2, r3, r1 - strh r0, [r2, 0x26] - adds r5, 0x3E - ldrb r6, [r5] - movs r1, 0x5 - negs r1, r1 - adds r0, r1, 0 - ands r0, r6 - strb r0, [r5] - adds r2, 0x3E - ldrb r0, [r2] - ands r1, r0 - strb r1, [r2] - movs r0, 0x1C - add r8, r0 - add r4, r8 - ldr r0, =sub_802EE5C - str r0, [r4] - add r3, r8 - str r0, [r3] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802EDCC - - thumb_func_start sub_802EE30 -sub_802EE30: @ 802EE30 - push {lr} - lsls r0, 24 - lsrs r0, 24 - movs r3, 0 - ldr r2, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r2, 0x1C - adds r1, r2 - ldr r1, [r1] - ldr r0, =sub_802EE5C - cmp r1, r0 - bne _0802EE4E - movs r3, 0x1 -_0802EE4E: - adds r0, r3, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_802EE30 - - thumb_func_start sub_802EE5C -sub_802EE5C: @ 802EE5C - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r5, 0 - adds r4, 0x2E - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0x4 - bhi _0802EF46 - lsls r0, 2 - ldr r1, =_0802EE7C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0802EE7C: - .4byte _0802EE90 - .4byte _0802EEA0 - .4byte _0802EEC8 - .4byte _0802EEFC - .4byte _0802EF34 -_0802EE90: - movs r0, 0x40 - strh r0, [r4, 0x8] - ldrh r0, [r5, 0x26] - lsls r0, 4 - strh r0, [r4, 0xA] - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_0802EEA0: - ldrh r1, [r4, 0x8] - ldrh r2, [r4, 0xA] - adds r0, r1, r2 - strh r0, [r4, 0xA] - adds r1, 0x1 - strh r1, [r4, 0x8] - lsls r0, 16 - asrs r0, 20 - strh r0, [r5, 0x26] - cmp r0, 0 - blt _0802EF46 - movs r0, 0x39 - bl audio_play - movs r0, 0 - strh r0, [r5, 0x26] - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - b _0802EF46 -_0802EEC8: - ldrh r0, [r4, 0x2] - adds r0, 0xC - strh r0, [r4, 0x2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7F - ble _0802EEE6 - movs r0, 0x39 - bl audio_play - movs r0, 0 - strh r0, [r4, 0x2] - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_0802EEE6: - ldr r0, =gUnknown_08329F40 - movs r2, 0x2 - ldrsh r1, [r4, r2] - lsls r1, 1 - adds r1, r0 - movs r2, 0 - ldrsh r0, [r1, r2] - asrs r0, 4 - b _0802EF2A - .pool -_0802EEFC: - ldrh r0, [r4, 0x2] - adds r0, 0x10 - strh r0, [r4, 0x2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7F - ble _0802EF1A - movs r0, 0x39 - bl audio_play - movs r0, 0 - strh r0, [r4, 0x2] - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_0802EF1A: - ldr r1, =gUnknown_08329F40 - movs r2, 0x2 - ldrsh r0, [r4, r2] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 21 -_0802EF2A: - negs r0, r0 - strh r0, [r5, 0x26] - b _0802EF46 - .pool -_0802EF34: - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x28 - ble _0802EF46 - ldr r0, =DummyObjectCallback - str r0, [r5, 0x1C] -_0802EF46: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802EE5C - - thumb_func_start sub_802EF50 -sub_802EF50: @ 802EF50 - push {r4,lr} - sub sp, 0x10 - lsls r1, 16 - lsrs r1, 16 - ldr r2, =gUnknown_082FEBCC - ldr r3, [r2, 0x4] - ldr r2, [r2] - str r2, [sp] - str r3, [sp, 0x4] - ldr r2, =gUnknown_082FEBD4 - ldr r3, [r2, 0x4] - ldr r2, [r2] - str r2, [sp, 0x8] - str r3, [sp, 0xC] - lsls r0, 16 - ldr r3, =0x0000ffff - ldr r2, [sp, 0x4] - ands r2, r3 - orrs r2, r0 - str r2, [sp, 0x4] - ldr r2, =0xffff0000 - add r4, sp, 0x8 - ldr r0, [r4, 0x4] - ands r0, r2 - orrs r0, r1 - str r0, [r4, 0x4] - mov r0, sp - bl LoadCompressedObjectPic - adds r0, r4, 0 - bl LoadTaggedObjectPalette - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802EF50 - - thumb_func_start sub_802EFA8 -sub_802EFA8: @ 802EFA8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x18 - mov r12, r3 - ldr r3, [sp, 0x30] - lsls r1, 16 - lsrs r1, 16 - lsls r3, 24 - lsrs r3, 24 - mov r8, r3 - mov r5, sp - ldr r4, =gUnknown_082FEC90 - ldm r4!, {r3,r6,r7} - stm r5!, {r3,r6,r7} - ldm r4!, {r3,r6,r7} - stm r5!, {r3,r6,r7} - mov r4, sp - strh r0, [r4] - mov r0, sp - strh r1, [r0, 0x2] - lsls r2, 16 - asrs r2, 16 - mov r0, r12 - lsls r6, r0, 16 - asrs r6, 16 - mov r0, sp - adds r1, r2, 0 - adds r2, r6, 0 - mov r3, r8 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - add sp, 0x18 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_802EFA8 - - thumb_func_start sub_802EFFC -sub_802EFFC: @ 802EFFC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - mov r12, r3 - ldr r6, [sp, 0x38] - ldr r3, [sp, 0x3C] - mov r9, r3 - ldr r4, [sp, 0x40] - mov r8, r4 - lsls r1, 16 - lsrs r1, 16 - lsls r6, 24 - lsrs r6, 24 - mov r10, r6 - mov r4, sp - ldr r3, =gUnknown_082FECA8 - ldm r3!, {r5-r7} - stm r4!, {r5-r7} - ldm r3!, {r5-r7} - stm r4!, {r5-r7} - mov r3, sp - strh r0, [r3] - mov r0, sp - strh r1, [r0, 0x2] - lsls r2, 16 - asrs r4, r2, 16 - ldr r0, =0xffe00000 - adds r2, r0 - asrs r2, 16 - mov r1, r12 - lsls r5, r1, 16 - asrs r5, 16 - mov r0, sp - adds r1, r2, 0 - adds r2, r5, 0 - mov r3, r10 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - mov r3, r9 - strh r0, [r3] - adds r4, 0x20 - lsls r4, 16 - asrs r4, 16 - mov r0, sp - adds r1, r4, 0 - adds r2, r5, 0 - mov r3, r10 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - mov r4, r8 - strh r0, [r4] - ldr r2, =0x02020630 - mov r5, r9 - movs r6, 0 - ldrsh r1, [r5, r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r1, [r0] - movs r3, 0x4 - orrs r1, r3 - strb r1, [r0] - movs r7, 0 - ldrsh r1, [r4, r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r3 - strb r1, [r0] - movs r0, 0 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x1 - bl StartObjectImageAnim - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802EFFC - - .include "asm/rtc.s" - .include "asm/main_menu.s" - - thumb_func_start battle_wireless_setup_if_required_maybe -battle_wireless_setup_if_required_maybe: @ 8032654 - push {lr} - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08032686 - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _0803266E - bl sub_800B488 -_0803266E: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _0803267A - bl sub_8009734 -_0803267A: - ldr r0, =task00_08081A90 - movs r1, 0 - bl AddTask - bl sub_8033244 -_08032686: - pop {r0} - bx r0 - .pool - thumb_func_end battle_wireless_setup_if_required_maybe - - thumb_func_start sub_803269C -sub_803269C: @ 803269C - push {r4-r7,lr} - sub sp, 0x14 - ldr r0, =0x03005d04 - ldr r1, =nullsub_20 - str r1, [r0] - movs r0, 0 - str r0, [sp, 0x10] - movs r1, 0 - ldr r7, =0x03005d60 - ldr r6, =0x020244ac - movs r2, 0 - ldr r5, =0x020244b0 - ldr r4, =nullsub_21 - ldr r3, =0x02024076 -_080326B8: - lsls r0, r1, 2 - adds r0, r7 - str r4, [r0] - adds r1, r3 - movs r0, 0xFF - strb r0, [r1] - ldr r0, [sp, 0x10] - adds r0, r6 - strb r2, [r0] - ldr r0, [sp, 0x10] - adds r0, r5 - strb r2, [r0] - ldr r0, [sp, 0x10] - adds r0, 0x1 - str r0, [sp, 0x10] - adds r1, r0, 0 - cmp r1, 0x3 - ble _080326B8 - bl battle_wireless_setup_if_required_maybe - ldr r0, =0x02024068 - movs r5, 0 - str r5, [r0] - bl sub_80A3934 - bl sub_806E414 - movs r0, 0xF - bl sub_81308C8 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08032728 - bl zero_enemy_party_data - ldr r4, =0x02024744 - movs r1, 0x90 - lsls r1, 1 - str r5, [sp] - str r5, [sp, 0x4] - str r5, [sp, 0x8] - str r5, [sp, 0xC] - adds r0, r4, 0 - movs r2, 0x2 - movs r3, 0x20 - bl create_pokemon_set_level - str r5, [sp, 0x10] - adds r0, r4, 0 - movs r1, 0xC - add r2, sp, 0x10 - bl pokemon_setattr -_08032728: - ldr r0, =0x02022ff4 - str r5, [r0] - ldr r0, =0x0202428c - strb r5, [r0] - add sp, 0x14 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803269C - - thumb_func_start sub_8032768 -sub_8032768: @ 8032768 - push {r4,r5,lr} - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - bne _08032784 - movs r0, 0x1 - bl sub_8184DA4 - b _0803278A - .pool -_08032784: - movs r0, 0x2 - bl sub_8184DA4 -_0803278A: - ldr r4, =0x02022fec - ldr r0, [r4] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - bne _0803279C - bl sub_8185EB8 -_0803279C: - ldr r0, [r4] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080327B0 - bl b_setup_bx_link - b _080327B4 - .pool -_080327B0: - bl b_setup_bx -_080327B4: - bl sub_8033050 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _080327E2 - movs r4, 0 - ldr r0, =0x0202406c - ldrb r1, [r0] - cmp r4, r1 - bge _080327E2 - adds r5, r0, 0 -_080327D0: - lsls r0, r4, 24 - lsrs r0, 24 - movs r1, 0 - bl sub_81B8D64 - adds r4, 0x1 - ldrb r0, [r5] - cmp r4, r0 - blt _080327D0 -_080327E2: - movs r4, 0 - ldr r3, =0x0202449c - movs r2, 0xD2 - lsls r2, 1 - movs r1, 0 -_080327EC: - ldr r0, [r3] - adds r0, r4, r0 - adds r0, r2 - strb r1, [r0] - adds r4, 0x1 - cmp r4, 0x5F - bls _080327EC - movs r4, 0 - ldr r3, =0x0202449c - movs r2, 0x81 - lsls r2, 2 - movs r1, 0 -_08032804: - ldr r0, [r3] - adds r0, r4, r0 - adds r0, r2 - strb r1, [r0] - adds r4, 0x1 - cmp r4, 0x67 - bls _08032804 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8032768 - - thumb_func_start b_setup_bx -b_setup_bx: @ 8032824 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =0x02022fec - ldr r3, [r0] - movs r5, 0x80 - lsls r5, 15 - ands r5, r3 - cmp r5, 0 - beq _080328E4 - ldr r1, =0x03005d04 - ldr r0, =sub_8039ECC - str r0, [r1] - movs r4, 0x80 - lsls r4, 17 - ands r4, r3 - cmp r4, 0 - beq _08032874 - ldr r2, =0x03005d60 - ldr r0, =sub_818994C - str r0, [r2] - ldr r1, =0x02024076 - movs r0, 0 - strb r0, [r1] - b _0803287E - .pool -_08032874: - ldr r2, =0x03005d60 - ldr r0, =sub_805745C - str r0, [r2] - ldr r1, =0x02024076 - strb r4, [r1] -_0803287E: - ldr r3, =sub_805F164 - str r3, [r2, 0x4] - movs r0, 0x1 - strb r0, [r1, 0x1] - ldr r0, =sub_81BADF4 - str r0, [r2, 0x8] - movs r0, 0x2 - strb r0, [r1, 0x2] - str r3, [r2, 0xC] - movs r0, 0x3 - strb r0, [r1, 0x3] - ldr r1, =0x0202406c - movs r0, 0x4 - strb r0, [r1] - movs r0, 0 - movs r1, 0 - bl sub_81B8D64 - movs r0, 0x1 - movs r1, 0 - bl sub_81B8D64 - movs r0, 0x2 - movs r1, 0x1 - bl sub_81B8D64 - movs r0, 0x3 - movs r1, 0x1 - bl sub_81B8D64 - ldr r0, =0x0202406e - movs r1, 0 - strh r1, [r0] - strh r1, [r0, 0x2] - movs r1, 0x3 - b _08032A76 - .pool -_080328E4: - movs r7, 0x1 - adds r0, r3, 0 - ands r0, r7 - cmp r0, 0 - beq _080328F0 - b _080329E0 -_080328F0: - ldr r0, =0x03005d04 - ldr r2, =sub_8039ECC - str r2, [r0] - movs r1, 0x80 - ands r1, r3 - mov r12, r2 - cmp r1, 0 - beq _08032918 - ldr r1, =0x03005d60 - ldr r0, =sub_815936C - b _08032934 - .pool -_08032918: - movs r0, 0x80 - lsls r0, 2 - ands r3, r0 - cmp r3, 0 - beq _08032930 - ldr r1, =0x03005d60 - ldr r0, =bx_goto_buffer_A_ch0_tbl3 - b _08032934 - .pool -_08032930: - ldr r1, =0x03005d60 - ldr r0, =sub_805745C -_08032934: - str r0, [r1] - mov r10, r1 - ldr r4, =0x02024076 - movs r0, 0 - mov r9, r0 - mov r1, r9 - strb r1, [r4] - mov r5, r10 - ldr r2, =sub_805F164 - mov r8, r2 - str r2, [r5, 0x4] - movs r6, 0x1 - strb r6, [r4, 0x1] - ldr r2, =0x0202406c - movs r7, 0x2 - strb r7, [r2] - ldr r0, =0x02022fec - ldr r3, [r0] - movs r0, 0x80 - lsls r0, 17 - ands r0, r3 - cmp r0, 0 - bne _08032964 - b _08032CB2 -_08032964: - movs r1, 0x80 - lsls r1, 18 - ands r1, r3 - cmp r1, 0 - beq _080329CC - movs r1, 0x80 - lsls r1, 24 - ands r1, r3 - cmp r1, 0 - beq _080329B4 - mov r1, r12 - ldr r0, =0x03005d04 - str r1, [r0] - ldr r0, =sub_818994C - str r0, [r5] - mov r1, r9 - strb r1, [r4] - ldr r0, =sub_81864EC - str r0, [r5, 0x4] - strb r6, [r4, 0x1] - strb r7, [r2] - b _08032CB2 - .pool -_080329B4: - ldr r0, =sub_818994C - str r0, [r5, 0x4] - strb r1, [r4, 0x1] - ldr r0, =sub_81864EC - str r0, [r5] - strb r6, [r4] - strb r7, [r2] - b _08032CB2 - .pool -_080329CC: - ldr r0, =sub_818994C - mov r2, r10 - str r0, [r2] - strb r1, [r4] - mov r0, r8 - str r0, [r2, 0x4] - strb r6, [r4, 0x1] - b _08032CB2 - .pool -_080329E0: - ldr r1, =sub_8039ECC - ldr r2, =0x03005d04 - str r1, [r2] - ldr r2, =0x03005d60 - ldr r0, =sub_805745C - str r0, [r2] - ldr r4, =0x02024076 - strb r5, [r4] - ldr r6, =sub_805F164 - str r6, [r2, 0x4] - strb r7, [r4, 0x1] - str r0, [r2, 0x8] - movs r0, 0x2 - mov r12, r0 - mov r1, r12 - strb r1, [r4, 0x2] - str r6, [r2, 0xC] - movs r0, 0x3 - mov r8, r0 - mov r1, r8 - strb r1, [r4, 0x3] - ldr r0, =0x0202406c - mov r10, r0 - movs r1, 0x4 - mov r9, r1 - strb r1, [r0] - movs r0, 0x80 - lsls r0, 17 - ands r0, r3 - cmp r0, 0 - bne _08032A20 - b _08032CB2 -_08032A20: - movs r1, 0xA0 - lsls r1, 1 - adds r0, r3, 0 - ands r0, r1 - cmp r0, r1 - bne _08032AA0 - ldr r0, =sub_8039ECC - ldr r1, =0x03005d04 - str r0, [r1] - ldr r0, =sub_818994C - str r0, [r2] - strb r5, [r4] - str r6, [r2, 0x4] - strb r7, [r4, 0x1] - str r0, [r2, 0x8] - mov r0, r12 - strb r0, [r4, 0x2] - str r6, [r2, 0xC] - mov r1, r8 - strb r1, [r4, 0x3] - mov r0, r9 - mov r2, r10 - strb r0, [r2] - movs r0, 0 - movs r1, 0 - bl sub_81B8D64 - movs r0, 0x1 - movs r1, 0 - bl sub_81B8D64 - movs r0, 0x2 - movs r1, 0x1 - bl sub_81B8D64 - movs r0, 0x3 - movs r1, 0x1 - bl sub_81B8D64 - ldr r0, =0x0202406e - strh r5, [r0] - strh r5, [r0, 0x2] - mov r1, r8 -_08032A76: - strh r1, [r0, 0x4] - strh r1, [r0, 0x6] - b _08032CB2 - .pool -_08032AA0: - movs r5, 0x40 - ands r5, r3 - cmp r5, 0 - bne _08032AAA - b _08032C3C -_08032AAA: - ldr r0, =0x0203c7b4 - ldrb r5, [r0] - movs r0, 0 - mov r10, r0 - ldr r1, =0x020229e8 - mov r12, r1 - adds r7, r4, 0 - mov r8, r0 - ldr r6, =0x0202406e - movs r4, 0 - movs r2, 0x3 - mov r9, r2 -_08032AC2: - mov r1, r12 - adds r0, r4, r1 - ldrh r0, [r0, 0x18] - cmp r0, 0x2 - bgt _08032AE4 - cmp r0, 0x1 - bge _08032AFC - cmp r0, 0 - beq _08032AE8 - b _08032B06 - .pool -_08032AE4: - cmp r0, 0x3 - bne _08032B06 -_08032AE8: - ldr r0, =0x020229e8 - adds r0, r4, r0 - ldrb r0, [r0, 0x18] - movs r1, 0 - bl sub_81B8D64 - b _08032B06 - .pool -_08032AFC: - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl sub_81B8D64 -_08032B06: - cmp r10, r5 - bne _08032B56 - ldr r0, =0x020229e8 - adds r3, r4, r0 - ldrh r1, [r3, 0x18] - lsls r1, 2 - ldr r2, =0x03005d60 - adds r1, r2 - ldr r2, =sub_818994C - str r2, [r1] - ldrh r1, [r3, 0x18] - mov r12, r0 - cmp r1, 0x2 - bgt _08032B38 - cmp r1, 0x1 - bge _08032B4C - cmp r1, 0 - beq _08032B3C - b _08032C2C - .pool -_08032B38: - cmp r1, 0x3 - bne _08032C2C -_08032B3C: - mov r1, r12 - adds r0, r4, r1 - ldrh r1, [r0, 0x18] - adds r1, r7 - mov r2, r8 - strb r2, [r1] - ldrh r0, [r0, 0x18] - b _08032C12 -_08032B4C: - adds r1, r7 - movs r0, 0x2 - strb r0, [r1] - ldrh r0, [r3, 0x18] - b _08032C24 -_08032B56: - ldr r2, =0x020229e8 - adds r0, r4, r2 - ldrh r1, [r0, 0x18] - movs r3, 0x1 - adds r0, r3, 0 - ands r0, r1 - mov r12, r2 - cmp r0, 0 - bne _08032B80 - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - add r0, r12 - ldrh r1, [r0, 0x18] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _08032B92 - b _08032BD8 - .pool -_08032B80: - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - add r0, r12 - ldrh r1, [r0, 0x18] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _08032BD8 -_08032B92: - mov r0, r12 - adds r2, r4, r0 - ldrh r0, [r2, 0x18] - lsls r0, 2 - ldr r1, =0x03005d60 - adds r0, r1 - ldr r1, =sub_818994C - str r1, [r0] - ldrh r1, [r2, 0x18] - cmp r1, 0x2 - bgt _08032BBC - cmp r1, 0x1 - bge _08032BD0 - cmp r1, 0 - beq _08032BC0 - b _08032C2C - .pool -_08032BBC: - cmp r1, 0x3 - bne _08032C2C -_08032BC0: - mov r2, r12 - adds r0, r4, r2 - ldrh r1, [r0, 0x18] - adds r1, r7 - mov r2, r8 - strb r2, [r1] - ldrh r0, [r0, 0x18] - b _08032C12 -_08032BD0: - adds r1, r7 - movs r0, 0x2 - strb r0, [r1] - b _08032C22 -_08032BD8: - mov r0, r12 - adds r2, r4, r0 - ldrh r0, [r2, 0x18] - lsls r0, 2 - ldr r1, =0x03005d60 - adds r0, r1 - ldr r1, =sub_81864EC - str r1, [r0] - ldrh r0, [r2, 0x18] - cmp r0, 0x2 - bgt _08032C00 - cmp r0, 0x1 - bge _08032C1C - cmp r0, 0 - beq _08032C04 - b _08032C2C - .pool -_08032C00: - cmp r0, 0x3 - bne _08032C2C -_08032C04: - mov r0, r12 - adds r2, r4, r0 - ldrh r0, [r2, 0x18] - adds r0, r7 - movs r1, 0x1 - strb r1, [r0] - ldrh r0, [r2, 0x18] -_08032C12: - lsls r0, 1 - adds r0, r6 - mov r1, r8 - strh r1, [r0] - b _08032C2C -_08032C1C: - adds r0, r7 - mov r1, r9 - strb r1, [r0] -_08032C22: - ldrh r0, [r2, 0x18] -_08032C24: - lsls r0, 1 - adds r0, r6 - mov r2, r9 - strh r2, [r0] -_08032C2C: - adds r4, 0x1C - movs r0, 0x1 - add r10, r0 - mov r1, r10 - cmp r1, 0x3 - bgt _08032C3A - b _08032AC2 -_08032C3A: - b _08032CB2 -_08032C3C: - movs r1, 0x4 - ands r1, r3 - cmp r1, 0 - beq _08032C7C - ldr r0, =sub_818994C - str r0, [r2] - strb r5, [r4] - str r0, [r2, 0x8] - mov r0, r12 - strb r0, [r4, 0x2] - movs r0, 0x80 - lsls r0, 18 - ands r3, r0 - cmp r3, 0 - beq _08032C70 - ldr r0, =sub_81864EC - str r0, [r2, 0x4] - strb r7, [r4, 0x1] - str r0, [r2, 0xC] - mov r1, r8 - strb r1, [r4, 0x3] - b _08032CB2 - .pool -_08032C70: - str r6, [r2, 0x4] - strb r7, [r4, 0x1] - str r6, [r2, 0xC] - mov r2, r8 - strb r2, [r4, 0x3] - b _08032CB2 -_08032C7C: - ldr r0, =sub_818994C - str r0, [r2, 0x4] - strb r1, [r4, 0x1] - str r0, [r2, 0xC] - mov r0, r12 - strb r0, [r4, 0x3] - movs r0, 0x80 - lsls r0, 18 - ands r3, r0 - cmp r3, 0 - beq _08032CA8 - ldr r0, =sub_81864EC - str r0, [r2] - strb r7, [r4] - str r0, [r2, 0x8] - mov r1, r8 - strb r1, [r4, 0x2] - b _08032CB2 - .pool -_08032CA8: - str r6, [r2] - strb r7, [r4] - str r6, [r2, 0x8] - mov r2, r8 - strb r2, [r4, 0x2] -_08032CB2: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end b_setup_bx - - thumb_func_start b_setup_bx_link -b_setup_bx_link: @ 8032CC0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r4, =0x02022fec - ldr r1, [r4] - movs r5, 0x1 - adds r3, r1, 0 - ands r3, r5 - cmp r3, 0 - bne _08032D48 - movs r4, 0x4 - ands r4, r1 - cmp r4, 0 - beq _08032D1C - ldr r1, =0x03005d04 - ldr r0, =sub_8039ECC - str r0, [r1] - ldr r2, =0x03005d60 - ldr r0, =sub_805745C - str r0, [r2] - ldr r1, =0x02024076 - strb r3, [r1] - ldr r0, =sub_8064394 - str r0, [r2, 0x4] - strb r5, [r1, 0x1] - ldr r1, =0x0202406c - movs r0, 0x2 - b _0803303A - .pool -_08032D1C: - ldr r2, =0x03005d60 - ldr r0, =sub_805745C - str r0, [r2, 0x4] - ldr r1, =0x02024076 - strb r4, [r1, 0x1] - ldr r0, =sub_8064394 - str r0, [r2] - strb r5, [r1] - ldr r1, =0x0202406c - movs r0, 0x2 - b _0803303A - .pool -_08032D48: - movs r0, 0x41 - ands r0, r1 - cmp r0, 0x1 - bne _08032DD0 - movs r6, 0x4 - adds r3, r6, 0 - ands r3, r1 - cmp r3, 0 - beq _08032D98 - ldr r1, =0x03005d04 - ldr r0, =sub_8039ECC - str r0, [r1] - ldr r2, =0x03005d60 - ldr r4, =sub_805745C - str r4, [r2] - ldr r1, =0x02024076 - movs r0, 0 - strb r0, [r1] - ldr r3, =sub_8064394 - str r3, [r2, 0x4] - strb r5, [r1, 0x1] - str r4, [r2, 0x8] - movs r0, 0x2 - strb r0, [r1, 0x2] - str r3, [r2, 0xC] - movs r0, 0x3 - strb r0, [r1, 0x3] - b _08032DB4 - .pool -_08032D98: - ldr r2, =0x03005d60 - ldr r0, =sub_805745C - str r0, [r2, 0x4] - ldr r1, =0x02024076 - strb r3, [r1, 0x1] - ldr r3, =sub_8064394 - str r3, [r2] - strb r5, [r1] - str r0, [r2, 0xC] - movs r0, 0x2 - strb r0, [r1, 0x3] - str r3, [r2, 0x8] - movs r0, 0x3 - strb r0, [r1, 0x2] -_08032DB4: - ldr r0, =0x0202406c - strb r6, [r0] - b _0803303C - .pool -_08032DD0: - movs r0, 0x80 - lsls r0, 1 - ands r0, r1 - cmp r0, 0 - beq _08032E8C - movs r4, 0x4 - adds r3, r4, 0 - ands r3, r1 - cmp r3, 0 - beq _08032E1C - ldr r1, =0x03005d04 - ldr r0, =sub_8039ECC - str r0, [r1] - ldr r2, =0x03005d60 - ldr r0, =sub_805745C - str r0, [r2] - ldr r1, =0x02024076 - movs r0, 0 - strb r0, [r1] - ldr r3, =sub_805F164 - str r3, [r2, 0x4] - strb r5, [r1, 0x1] - ldr r0, =sub_814AEB0 - b _08032E2E - .pool -_08032E1C: - ldr r2, =0x03005d60 - ldr r0, =sub_814AEB0 - str r0, [r2] - ldr r1, =0x02024076 - strb r3, [r1] - ldr r3, =sub_8064394 - str r3, [r2, 0x4] - strb r5, [r1, 0x1] - ldr r0, =sub_805745C -_08032E2E: - str r0, [r2, 0x8] - movs r0, 0x2 - strb r0, [r1, 0x2] - str r3, [r2, 0xC] - movs r0, 0x3 - strb r0, [r1, 0x3] - ldr r0, =0x0202406c - strb r4, [r0] - movs r0, 0 - movs r1, 0 - bl sub_81B8D64 - movs r0, 0x1 - movs r1, 0 - bl sub_81B8D64 - movs r0, 0x2 - movs r1, 0x1 - bl sub_81B8D64 - movs r0, 0x3 - movs r1, 0x1 - bl sub_81B8D64 - ldr r0, =0x0202406e - movs r1, 0 - strh r1, [r0] - strh r1, [r0, 0x2] - movs r1, 0x3 - strh r1, [r0, 0x4] - strh r1, [r0, 0x6] - b _0803303C - .pool -_08032E8C: - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, [r4] - movs r1, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08032EA4 - ldr r1, =0x03005d04 - ldr r0, =sub_8039ECC - str r0, [r1] -_08032EA4: - movs r0, 0 - mov r10, r0 - ldr r1, =0x020229e8 - mov r12, r1 - ldr r7, =0x02024076 - mov r8, r0 - ldr r6, =0x0202406e - movs r4, 0 - movs r2, 0x3 - mov r9, r2 -_08032EB8: - mov r1, r12 - adds r0, r4, r1 - ldrh r0, [r0, 0x18] - cmp r0, 0x2 - bgt _08032EE0 - cmp r0, 0x1 - bge _08032EF8 - cmp r0, 0 - beq _08032EE4 - b _08032F02 - .pool -_08032EE0: - cmp r0, 0x3 - bne _08032F02 -_08032EE4: - ldr r0, =0x020229e8 - adds r0, r4, r0 - ldrb r0, [r0, 0x18] - movs r1, 0 - bl sub_81B8D64 - b _08032F02 - .pool -_08032EF8: - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl sub_81B8D64 -_08032F02: - cmp r10, r5 - bne _08032F52 - ldr r0, =0x020229e8 - adds r3, r4, r0 - ldrh r1, [r3, 0x18] - lsls r1, 2 - ldr r2, =0x03005d60 - adds r1, r2 - ldr r2, =sub_805745C - str r2, [r1] - ldrh r1, [r3, 0x18] - mov r12, r0 - cmp r1, 0x2 - bgt _08032F34 - cmp r1, 0x1 - bge _08032F48 - cmp r1, 0 - beq _08032F38 - b _08033028 - .pool -_08032F34: - cmp r1, 0x3 - bne _08033028 -_08032F38: - mov r1, r12 - adds r0, r4, r1 - ldrh r1, [r0, 0x18] - adds r1, r7 - mov r2, r8 - strb r2, [r1] - ldrh r0, [r0, 0x18] - b _0803300E -_08032F48: - adds r1, r7 - movs r0, 0x2 - strb r0, [r1] - ldrh r0, [r3, 0x18] - b _08033020 -_08032F52: - ldr r2, =0x020229e8 - adds r0, r4, r2 - ldrh r1, [r0, 0x18] - movs r3, 0x1 - adds r0, r3, 0 - ands r0, r1 - mov r12, r2 - cmp r0, 0 - bne _08032F7C - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - add r0, r12 - ldrh r1, [r0, 0x18] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _08032F8E - b _08032FD4 - .pool -_08032F7C: - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - add r0, r12 - ldrh r1, [r0, 0x18] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _08032FD4 -_08032F8E: - mov r0, r12 - adds r2, r4, r0 - ldrh r0, [r2, 0x18] - lsls r0, 2 - ldr r1, =0x03005d60 - adds r0, r1 - ldr r1, =sub_814AEB0 - str r1, [r0] - ldrh r1, [r2, 0x18] - cmp r1, 0x2 - bgt _08032FB8 - cmp r1, 0x1 - bge _08032FCC - cmp r1, 0 - beq _08032FBC - b _08033028 - .pool -_08032FB8: - cmp r1, 0x3 - bne _08033028 -_08032FBC: - mov r2, r12 - adds r0, r4, r2 - ldrh r1, [r0, 0x18] - adds r1, r7 - mov r2, r8 - strb r2, [r1] - ldrh r0, [r0, 0x18] - b _0803300E -_08032FCC: - adds r1, r7 - movs r0, 0x2 - strb r0, [r1] - b _0803301E -_08032FD4: - mov r0, r12 - adds r2, r4, r0 - ldrh r0, [r2, 0x18] - lsls r0, 2 - ldr r1, =0x03005d60 - adds r0, r1 - ldr r1, =sub_8064394 - str r1, [r0] - ldrh r0, [r2, 0x18] - cmp r0, 0x2 - bgt _08032FFC - cmp r0, 0x1 - bge _08033018 - cmp r0, 0 - beq _08033000 - b _08033028 - .pool -_08032FFC: - cmp r0, 0x3 - bne _08033028 -_08033000: - mov r0, r12 - adds r2, r4, r0 - ldrh r0, [r2, 0x18] - adds r0, r7 - movs r1, 0x1 - strb r1, [r0] - ldrh r0, [r2, 0x18] -_0803300E: - lsls r0, 1 - adds r0, r6 - mov r1, r8 - strh r1, [r0] - b _08033028 -_08033018: - adds r0, r7 - mov r1, r9 - strb r1, [r0] -_0803301E: - ldrh r0, [r2, 0x18] -_08033020: - lsls r0, 1 - adds r0, r6 - mov r2, r9 - strh r2, [r0] -_08033028: - adds r4, 0x1C - movs r0, 0x1 - add r10, r0 - mov r1, r10 - cmp r1, 0x3 - bgt _08033036 - b _08032EB8 -_08033036: - ldr r1, =0x0202406c - movs r0, 0x4 -_0803303A: - strb r0, [r1] -_0803303C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end b_setup_bx_link - - thumb_func_start sub_8033050 -sub_8033050: @ 8033050 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08033068 - b _0803319C -_08033068: - movs r0, 0 - mov r8, r0 - b _0803317A - .pool -_08033074: - movs r5, 0 - movs r0, 0x1 - add r0, r8 - mov r10, r0 - ldr r0, =0x02024076 - add r0, r8 - mov r9, r0 - mov r0, r8 - lsls r6, r0, 1 - movs r7, 0 -_08033088: - mov r0, r8 - cmp r0, 0x1 - bgt _080330F0 - mov r0, r9 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080330A8 - ldr r0, =0x020244ec - b _080330AA - .pool -_080330A8: - ldr r0, =0x02024744 -_080330AA: - adds r4, r7, r0 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _08033170 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - beq _08033170 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _08033170 - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _08033170 - ldr r0, =0x0202406e - adds r0, r6, r0 - strh r5, [r0] - b _08033178 - .pool -_080330F0: - mov r0, r9 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08033118 - ldr r0, =0x020244ec - adds r4, r7, r0 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _08033170 - adds r0, r4, 0 - movs r1, 0xB - b _0803312C - .pool -_08033118: - ldr r0, =0x02024744 - adds r4, r7, r0 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _08033170 - adds r0, r4, 0 - movs r1, 0x41 -_0803312C: - bl pokemon_getattr - cmp r0, 0 - beq _08033170 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _08033170 - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _08033170 - ldr r1, =0x0202406e - mov r0, r8 - subs r0, 0x2 - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r5 - beq _08033170 - adds r0, r6, r1 - strh r5, [r0] - b _08033178 - .pool -_08033170: - adds r7, 0x64 - adds r5, 0x1 - cmp r5, 0x5 - ble _08033088 -_08033178: - mov r8, r10 -_0803317A: - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r8, r0 - bge _08033184 - b _08033074 -_08033184: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _0803319C - ldr r0, =0x0202406e - movs r1, 0 - strh r1, [r0, 0x2] - movs r1, 0x3 - strh r1, [r0, 0x6] -_0803319C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8033050 - - thumb_func_start dp01_prepare_buffer -dp01_prepare_buffer: @ 80331B8 - push {r4-r6,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r3, r0, 24 - adds r5, r3, 0 - lsls r2, 16 - lsrs r2, 16 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080331E4 - adds r0, r3, 0 - adds r1, r2, 0 - adds r2, r4, 0 - bl dp01_prepare_buffer_wireless_probably - b _08033236 - .pool -_080331E4: - cmp r5, 0 - beq _080331EE - cmp r5, 0x1 - beq _08033218 - b _08033236 -_080331EE: - movs r3, 0 - cmp r3, r2 - bge _08033236 - ldr r6, =0x02023064 - ldr r5, =0x02024064 -_080331F8: - ldrb r0, [r5] - lsls r0, 9 - adds r0, r3, r0 - adds r0, r6 - ldrb r1, [r4] - strb r1, [r0] - adds r4, 0x1 - adds r3, 0x1 - cmp r3, r2 - blt _080331F8 - b _08033236 - .pool -_08033218: - movs r3, 0 - cmp r3, r2 - bge _08033236 - ldr r6, =0x02023864 - ldr r5, =0x02024064 -_08033222: - ldrb r0, [r5] - lsls r0, 9 - adds r0, r3, r0 - adds r0, r6 - ldrb r1, [r4] - strb r1, [r0] - adds r4, 0x1 - adds r3, 0x1 - cmp r3, r2 - blt _08033222 -_08033236: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_prepare_buffer - - thumb_func_start sub_8033244 -sub_8033244: @ 8033244 - push {r4-r6,lr} - ldr r0, =task00_wireless_something - movs r1, 0 - bl AddTask - ldr r2, =0x02022d08 - strb r0, [r2] - ldr r5, =0x03005e00 - ldrb r1, [r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - movs r6, 0 - movs r4, 0 - strh r4, [r0, 0x1E] - ldrb r1, [r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - strh r4, [r0, 0x20] - ldrb r1, [r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - strh r4, [r0, 0x22] - ldrb r1, [r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - strh r4, [r0, 0x24] - ldrb r1, [r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - strh r4, [r0, 0x26] - ldr r0, =sub_803375C - movs r1, 0 - bl AddTask - ldr r2, =0x02022d09 - strb r0, [r2] - ldrb r1, [r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - strh r4, [r0, 0x20] - ldrb r1, [r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - strh r4, [r0, 0x22] - ldrb r1, [r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - strh r4, [r0, 0x24] - ldrb r1, [r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - strh r4, [r0, 0x26] - ldr r0, =0x02022d0a - strb r6, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8033244 - - thumb_func_start dp01_prepare_buffer_wireless_probably -dp01_prepare_buffer_wireless_probably: @ 80332F4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r9, r2 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 16 - lsrs r1, 16 - mov r12, r1 - movs r1, 0x3 - mov r0, r12 - bics r0, r1 - adds r0, 0x4 - mov r8, r0 - ldr r2, =0x03005e00 - ldr r3, =0x02022d08 - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r4, r0, r2 - movs r1, 0x24 - ldrsh r0, [r4, r1] - add r0, r8 - adds r0, 0x9 - movs r1, 0x80 - lsls r1, 5 - adds r5, r2, 0 - cmp r0, r1 - ble _08033346 - ldrh r0, [r4, 0x24] - movs r2, 0 - strh r0, [r4, 0x20] - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - strh r2, [r0, 0x24] -_08033346: - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - movs r2, 0x24 - ldrsh r1, [r0, r2] - ldr r4, =0x020244a0 - ldr r0, [r4] - adds r0, r1 - strb r6, [r0] - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - movs r7, 0x24 - ldrsh r1, [r0, r7] - ldr r0, [r4] - adds r1, r0 - ldr r0, =0x02024064 - ldrb r0, [r0] - strb r0, [r1, 0x1] - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - movs r2, 0x24 - ldrsh r1, [r0, r2] - ldr r0, [r4] - adds r1, r0 - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r1, 0x2] - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - movs r7, 0x24 - ldrsh r1, [r0, r7] - ldr r0, [r4] - adds r1, r0 - ldr r0, =0x0202420c - ldrb r0, [r0] - strb r0, [r1, 0x3] - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - movs r1, 0x24 - ldrsh r0, [r0, r1] - ldr r1, [r4] - adds r0, r1 - mov r2, r8 - strb r2, [r0, 0x4] - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - movs r7, 0x24 - ldrsh r1, [r0, r7] - ldr r0, [r4] - adds r1, r0 - movs r0, 0xFF - lsls r0, 8 - mov r2, r8 - ands r0, r2 - asrs r0, 8 - strb r0, [r1, 0x5] - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - movs r7, 0x24 - ldrsh r1, [r0, r7] - ldr r0, [r4] - adds r1, r0 - ldr r0, =0x02024210 - ldrb r0, [r0] - strb r0, [r1, 0x6] - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - movs r2, 0x24 - ldrsh r1, [r0, r2] - ldr r0, [r4] - adds r1, r0 - ldr r0, =0x0202420e - ldrb r0, [r0] - strb r0, [r1, 0x7] - movs r2, 0 - cmp r2, r12 - bge _08033434 - mov r10, r5 - adds r6, r3, 0 -_08033412: - ldrb r1, [r6] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - add r0, r10 - movs r7, 0x24 - ldrsh r1, [r0, r7] - ldr r0, [r4] - adds r1, r2, r1 - adds r1, r0 - mov r7, r9 - adds r0, r7, r2 - ldrb r0, [r0] - strb r0, [r1, 0x8] - adds r2, 0x1 - cmp r2, r12 - blt _08033412 -_08033434: - ldrb r0, [r3] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r5 - ldrh r0, [r1, 0x24] - add r0, r8 - adds r0, 0x8 - strh r0, [r1, 0x24] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_prepare_buffer_wireless_probably - - thumb_func_start task00_wireless_something -task00_wireless_something: @ 8033474 - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r2, 0x1E - ldrsh r0, [r0, r2] - adds r7, r1, 0 - cmp r0, 0x5 - bls _08033490 - b _08033640 -_08033490: - lsls r0, 2 - ldr r1, =_080334A4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080334A4: - .4byte _080334BC - .4byte _080334CA - .4byte _080334E6 - .4byte _08033570 - .4byte _080335E6 - .4byte _08033624 -_080334BC: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r7 - movs r1, 0x64 - strh r1, [r0, 0x1C] - b _080334F6 -_080334CA: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r7 - ldrh r0, [r1, 0x1C] - subs r0, 0x1 - strh r0, [r1, 0x1C] - lsls r0, 16 - cmp r0, 0 - beq _080334E0 - b _08033640 -_080334E0: - ldrh r0, [r1, 0x1E] - adds r0, 0x1 - b _0803363E -_080334E6: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08033504 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r7 -_080334F6: - ldrh r1, [r0, 0x1E] - adds r1, 0x1 - strh r1, [r0, 0x1E] - b _08033640 - .pool -_08033504: - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 1 - ands r0, r1 - cmp r0, 0 - beq _0803351C - movs r5, 0x2 - b _0803352A - .pool -_0803351C: - movs r0, 0x40 - ands r1, r0 - movs r0, 0x2 - cmp r1, 0 - beq _08033528 - movs r0, 0x4 -_08033528: - adds r5, r0, 0 -_0803352A: - bl sub_800ABAC - lsls r0, 24 - lsrs r0, 24 - cmp r0, r5 - bcs _08033538 - b _08033640 -_08033538: - bl sub_800ABBC - lsls r0, 24 - cmp r0, 0 - beq _0803355C - bl sub_800A620 - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x1E] - adds r0, 0x1 - b _0803363E - .pool -_0803355C: - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x1E] - adds r0, 0x1 - b _0803363E - .pool -_08033570: - lsls r1, r4, 2 - adds r0, r1, r4 - lsls r0, 3 - adds r2, r0, r7 - movs r3, 0x26 - ldrsh r5, [r2, r3] - movs r0, 0x24 - ldrsh r6, [r2, r0] - mov r12, r6 - cmp r5, r12 - beq _08033640 - ldrh r0, [r2, 0x22] - movs r6, 0x22 - ldrsh r3, [r2, r6] - cmp r3, 0 - bne _080335E0 - cmp r5, r12 - ble _080335A0 - movs r6, 0x20 - ldrsh r0, [r2, r6] - cmp r5, r0 - bne _080335A0 - strh r3, [r2, 0x20] - strh r3, [r2, 0x26] -_080335A0: - adds r4, r1, r4 - lsls r4, 3 - adds r4, r7 - movs r0, 0x26 - ldrsh r1, [r4, r0] - ldr r5, =0x020244a0 - ldr r0, [r5] - adds r1, r0 - ldrb r0, [r1, 0x4] - ldrb r1, [r1, 0x5] - lsls r1, 8 - orrs r0, r1 - adds r0, 0x8 - lsls r0, 16 - lsrs r6, r0, 16 - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x26 - ldrsh r2, [r4, r1] - ldr r1, [r5] - adds r1, r2 - adds r2, r6, 0 - bl link_0800A448 - ldrh r0, [r4, 0x1E] - adds r0, 0x1 - strh r0, [r4, 0x1E] - b _08033640 - .pool -_080335E0: - subs r0, 0x1 - strh r0, [r2, 0x22] - b _08033640 -_080335E6: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08033640 - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - movs r3, 0x26 - ldrsh r2, [r1, r3] - ldr r0, =0x020244a0 - ldr r0, [r0] - adds r2, r0 - ldrb r0, [r2, 0x4] - ldrb r2, [r2, 0x5] - lsls r2, 8 - movs r3, 0x1 - strh r3, [r1, 0x22] - orrs r0, r2 - ldrh r6, [r1, 0x26] - adds r0, r6 - adds r0, 0x8 - strh r0, [r1, 0x26] - b _0803363C - .pool -_08033624: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r7 - ldrh r0, [r1, 0x22] - subs r0, 0x1 - strh r0, [r1, 0x22] - lsls r0, 16 - cmp r0, 0 - bne _08033640 - movs r0, 0x1 - strh r0, [r1, 0x22] -_0803363C: - movs r0, 0x3 -_0803363E: - strh r0, [r1, 0x1E] -_08033640: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end task00_wireless_something - - thumb_func_start sub_8033648 -sub_8033648: @ 8033648 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _08033738 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08033738 - bl sub_8011BD0 - movs r4, 0 - ldr r0, =0x020223c4 - mov r10, r0 - b _0803372C - .pool -_08033680: - bl sub_800A550 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_0832A328 - lsls r1, r4, 2 - adds r1, r2 - ldr r1, [r1] - ands r0, r1 - adds r1, r4, 0x1 - mov r9, r1 - cmp r0, 0 - beq _08033726 - adds r0, r4, 0 - bl sub_800A5EC - lsls r0, r4, 8 - mov r4, r10 - adds r3, r0, r4 - ldr r1, =0x020223c8 - adds r0, r1 - ldrh r6, [r0] - ldr r7, =0x03005e00 - ldr r4, =0x02022d09 - mov r12, r4 - ldrb r1, [r4] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r2, r0, r7 - movs r0, 0x24 - ldrsh r1, [r2, r0] - adds r0, r6, 0 - adds r0, 0x9 - adds r1, r0 - movs r0, 0x80 - lsls r0, 5 - cmp r1, r0 - ble _080336E0 - ldrh r0, [r2, 0x24] - strh r0, [r2, 0x20] - ldrb r1, [r4] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - movs r1, 0 - strh r1, [r0, 0x24] -_080336E0: - ldr r2, =0x020244a4 - mov r4, r12 - ldrb r1, [r4] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - movs r4, 0x24 - ldrsh r1, [r0, r4] - ldr r0, [r2] - adds r5, r0, r1 - adds r4, r3, 0 - movs r2, 0 - adds r3, r6, 0 - adds r3, 0x8 - mov r8, r7 - mov r7, r12 - cmp r2, r3 - bge _08033714 -_08033706: - adds r0, r5, r2 - adds r1, r4, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, r3 - blt _08033706 -_08033714: - ldrb r0, [r7] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - add r1, r8 - ldrh r0, [r1, 0x24] - adds r0, r6, r0 - adds r0, 0x8 - strh r0, [r1, 0x24] -_08033726: - mov r1, r9 - lsls r0, r1, 24 - lsrs r4, r0, 24 -_0803372C: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bcc _08033680 -_08033738: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8033648 - - thumb_func_start sub_803375C -sub_803375C: @ 803375C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r3, r0, r1 - movs r0, 0x26 - ldrsh r2, [r3, r0] - movs r4, 0x24 - ldrsh r0, [r3, r4] - cmp r2, r0 - bne _08033780 - b _0803389C -_08033780: - cmp r2, r0 - ble _08033792 - movs r4, 0x20 - ldrsh r0, [r3, r4] - cmp r2, r0 - bne _08033792 - movs r0, 0 - strh r0, [r3, 0x20] - strh r0, [r3, 0x26] -_08033792: - lsls r2, r7, 2 - adds r0, r2, r7 - lsls r0, 3 - adds r5, r0, r1 - movs r0, 0x26 - ldrsh r1, [r5, r0] - ldr r3, =0x020244a4 - mov r8, r3 - ldr r0, [r3] - adds r3, r1, r0 - ldrb r4, [r3, 0x1] - ldrb r6, [r3, 0x4] - ldrb r0, [r3, 0x5] - lsls r0, 8 - orrs r6, r0 - ldrb r0, [r3] - mov r9, r2 - cmp r0, 0x1 - beq _0803385C - cmp r0, 0x1 - bgt _080337CC - cmp r0, 0 - beq _080337D2 - b _0803388A - .pool -_080337CC: - cmp r0, 0x2 - beq _08033874 - b _0803388A -_080337D2: - ldr r2, =0x02024068 - ldr r1, =gUnknown_0832A328 - lsls r0, r4, 2 - adds r0, r1 - ldr r1, [r2] - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0803389C - lsls r0, r4, 9 - ldr r1, =0x02023064 - adds r0, r1 - adds r1, r3, 0 - adds r1, 0x8 - adds r2, r6, 0 - bl memcpy - adds r0, r4, 0 - bl sub_803F850 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x4 - ands r0, r1 - cmp r0, 0 - bne _0803388A - ldr r2, =0x0202420b - movs r4, 0x26 - ldrsh r0, [r5, r4] - mov r3, r8 - ldr r1, [r3] - adds r0, r1 - ldrb r0, [r0, 0x2] - strb r0, [r2] - ldr r2, =0x0202420c - movs r4, 0x26 - ldrsh r0, [r5, r4] - adds r0, r1 - ldrb r0, [r0, 0x3] - strb r0, [r2] - ldr r2, =0x02024210 - movs r3, 0x26 - ldrsh r0, [r5, r3] - adds r0, r1 - ldrb r0, [r0, 0x6] - strb r0, [r2] - ldr r2, =0x0202420e - movs r4, 0x26 - ldrsh r0, [r5, r4] - adds r0, r1 - ldrb r0, [r0, 0x7] - strb r0, [r2] - b _0803388A - .pool -_0803385C: - lsls r0, r4, 9 - ldr r1, =0x02023864 - adds r0, r1 - adds r1, r3, 0 - adds r1, 0x8 - adds r2, r6, 0 - bl memcpy - b _0803388A - .pool -_08033874: - ldrb r2, [r3, 0x8] - ldr r3, =0x02024068 - ldr r1, =gUnknown_0832A328 - lsls r0, r4, 2 - adds r0, r1 - lsls r2, 2 - ldr r1, [r0] - lsls r1, r2 - ldr r0, [r3] - bics r0, r1 - str r0, [r3] -_0803388A: - ldr r0, =0x03005e00 - mov r2, r9 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x26] - adds r0, r6, r0 - adds r0, 0x8 - strh r0, [r1, 0x26] -_0803389C: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803375C - - thumb_func_start dp01_build_cmdbuf_x00_a_b_0 -dp01_build_cmdbuf_x00_a_b_0: @ 80338B4 - push {r4,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r3, 0 - strb r3, [r1] - strb r4, [r1, 0x1] - strb r2, [r1, 0x2] - strb r3, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x00_a_b_0 - - thumb_func_start dp01_build_cmdbuf_x01_a_b_0 -dp01_build_cmdbuf_x01_a_b_0: @ 80338D8 - push {r4,r5,lr} - adds r5, r1, 0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r4, 0 - movs r3, 0x1 - strb r3, [r1] - strb r5, [r1, 0x1] - strb r2, [r1, 0x2] - strb r4, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x01_a_b_0 - - thumb_func_start dp01_build_cmdbuf_x02_a_b_varargs -dp01_build_cmdbuf_x02_a_b_varargs: @ 8033900 - push {r4-r6,lr} - ldr r4, [sp, 0x10] - lsls r0, 24 - lsrs r6, r0, 24 - lsls r3, 24 - lsrs r5, r3, 24 - ldr r0, =0x02022d10 - movs r3, 0x2 - strb r3, [r0] - strb r1, [r0, 0x1] - strb r2, [r0, 0x2] - adds r1, r0, 0 - cmp r5, 0 - beq _0803392E - adds r3, r1, 0x3 - adds r2, r5, 0 -_08033920: - ldrb r0, [r4] - strb r0, [r3] - adds r4, 0x1 - adds r3, 0x1 - subs r2, 0x1 - cmp r2, 0 - bne _08033920 -_0803392E: - adds r2, r5, 0x3 - adds r0, r6, 0 - bl dp01_prepare_buffer - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x02_a_b_varargs - - thumb_func_start sub_8033940 -sub_8033940: @ 8033940 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r2, 24 - lsrs r4, r2, 24 - ldr r0, =0x02022d10 - movs r2, 0x3 - strb r2, [r0] - strb r1, [r0, 0x1] - strb r4, [r0, 0x2] - adds r5, r0, 0 - cmp r4, 0 - beq _0803396C - adds r1, r5, 0x3 - adds r2, r4, 0 -_0803395E: - ldrb r0, [r3] - strb r0, [r1] - adds r3, 0x1 - adds r1, 0x1 - subs r2, 0x1 - cmp r2, 0 - bne _0803395E -_0803396C: - adds r2, r4, 0x3 - adds r0, r6, 0 - adds r1, r5, 0 - bl dp01_prepare_buffer - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8033940 - - thumb_func_start dp01_build_cmdbuf_x04_4_4_4 -dp01_build_cmdbuf_x04_4_4_4: @ 8033980 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x4 - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x04_4_4_4 - - thumb_func_start dp01_build_cmdbuf_x05_a_b_c -dp01_build_cmdbuf_x05_a_b_c: @ 80339A0 - push {r4,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r3, 0x5 - strb r3, [r1] - strb r4, [r1, 0x1] - strb r2, [r1, 0x2] - strb r3, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x05_a_b_c - - thumb_func_start dp01_build_cmdbuf_x06_a -dp01_build_cmdbuf_x06_a: @ 80339C4 - push {lr} - adds r3, r1, 0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x6 - strb r2, [r1] - strb r3, [r1, 0x1] - movs r2, 0x2 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x06_a - - thumb_func_start dp01_build_cmdbuf_x07_7_7_7 -dp01_build_cmdbuf_x07_7_7_7: @ 80339E4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x7 - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x07_7_7_7 - - thumb_func_start dp01_build_cmdbuf_x08_8_8_8 -dp01_build_cmdbuf_x08_8_8_8: @ 8033A04 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x8 - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x08_8_8_8 - - thumb_func_start dp01_build_cmdbuf_x09_9_9_9 -dp01_build_cmdbuf_x09_9_9_9: @ 8033A24 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x9 - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x09_9_9_9 - - thumb_func_start dp01_build_cmdbuf_x0A_A_A_A -dp01_build_cmdbuf_x0A_A_A_A: @ 8033A44 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0xA - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x0A_A_A_A - - thumb_func_start dp01_build_cmdbuf_x0B_B_B_B -dp01_build_cmdbuf_x0B_B_B_B: @ 8033A64 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0xB - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x0B_B_B_B - - thumb_func_start dp01_build_cmdbuf_x0C_C_C_C -dp01_build_cmdbuf_x0C_C_C_C: @ 8033A84 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0xC - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x0C_C_C_C - - thumb_func_start dp01_build_cmdbuf_x0D_a -dp01_build_cmdbuf_x0D_a: @ 8033AA4 - push {lr} - adds r3, r1, 0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0xD - strb r2, [r1] - strb r3, [r1, 0x1] - movs r2, 0x2 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x0D_a - - thumb_func_start sub_8033AC4 -sub_8033AC4: @ 8033AC4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - ldr r1, =0x02022d10 - movs r0, 0xE - strb r0, [r1] - strb r4, [r1, 0x1] - lsls r0, r4, 1 - adds r0, r4 - adds r5, r1, 0 - cmp r0, 0 - beq _08033AF2 - adds r1, r5, 0x2 - adds r3, r0, 0 -_08033AE4: - ldrb r0, [r2] - strb r0, [r1] - adds r2, 0x1 - adds r1, 0x1 - subs r3, 0x1 - cmp r3, 0 - bne _08033AE4 -_08033AF2: - lsls r2, r4, 1 - adds r2, r4 - adds r2, 0x2 - adds r0, r6, 0 - adds r1, r5, 0 - bl dp01_prepare_buffer - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8033AC4 - - thumb_func_start dp01_build_cmdbuf_x0F_aa_b_cc_dddd_e_mlc_weather_00_x1Cbytes -dp01_build_cmdbuf_x0F_aa_b_cc_dddd_e_mlc_weather_00_x1Cbytes: @ 8033B0C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - ldr r4, [sp, 0x20] - ldr r5, [sp, 0x24] - ldr r6, [sp, 0x2C] - mov r8, r6 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r1, 16 - lsrs r1, 16 - lsls r3, 16 - lsrs r3, 16 - ldr r7, =0x02022d10 - movs r0, 0 - mov r12, r0 - movs r0, 0xF - strb r0, [r7] - strb r1, [r7, 0x1] - lsrs r1, 8 - strb r1, [r7, 0x2] - strb r2, [r7, 0x3] - strb r3, [r7, 0x4] - movs r6, 0xFF - lsls r6, 8 - lsrs r3, 8 - strb r3, [r7, 0x5] - strb r4, [r7, 0x6] - adds r0, r4, 0 - ands r0, r6 - asrs r0, 8 - strb r0, [r7, 0x7] - movs r0, 0xFF - lsls r0, 16 - ands r0, r4 - asrs r0, 16 - strb r0, [r7, 0x8] - lsrs r4, 24 - strb r4, [r7, 0x9] - strb r5, [r7, 0xA] - mov r0, r8 - strb r0, [r7, 0xB] - mov r0, r12 - str r0, [sp] - movs r0, 0xE - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08033BAC - str r0, [sp] - movs r0, 0xE - movs r1, 0 - movs r2, 0x4D - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - bne _08033BAC - ldr r0, =0x020243cc - ldrh r0, [r0] - strb r0, [r7, 0xC] - ands r6, r0 - lsrs r0, r6, 8 - strb r0, [r7, 0xD] - adds r4, r7, 0 - b _08033BB6 - .pool -_08033BAC: - ldr r0, =0x02022d10 - movs r1, 0 - strb r1, [r0, 0xC] - strb r1, [r0, 0xD] - adds r4, r0, 0 -_08033BB6: - movs r0, 0 - strb r0, [r4, 0xE] - strb r0, [r4, 0xF] - adds r0, r4, 0 - adds r0, 0x10 - ldr r1, [sp, 0x28] - movs r2, 0x1C - bl memcpy - mov r0, r9 - adds r1, r4, 0 - movs r2, 0x2C - bl dp01_prepare_buffer - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x0F_aa_b_cc_dddd_e_mlc_weather_00_x1Cbytes - - thumb_func_start dp01_build_cmdbuf_x10_TODO -dp01_build_cmdbuf_x10_TODO: @ 8033BE4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - lsls r1, 16 - lsrs r1, 16 - ldr r2, =0x02022d10 - movs r0, 0x10 - strb r0, [r2] - ldr r0, =0x0202433a - ldrb r0, [r0] - strb r0, [r2, 0x1] - strb r1, [r2, 0x2] - lsrs r1, 8 - strb r1, [r2, 0x3] - adds r0, r2, 0x4 - mov r12, r0 - ldr r4, =0x020241ea - ldrh r0, [r4] - strh r0, [r2, 0x4] - ldr r0, =0x020241ec - ldrh r0, [r0] - mov r1, r12 - strh r0, [r1, 0x2] - ldr r0, =0x02024208 - ldrh r0, [r0] - strh r0, [r1, 0x4] - ldr r0, =0x0202420a - ldrb r0, [r0] - strb r0, [r1, 0x6] - ldr r0, =0x02024474 - ldrb r0, [r0, 0x17] - strb r0, [r1, 0x7] - ldr r0, =0x0202449c - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0x52 - ldrb r1, [r1] - mov r3, r12 - strb r1, [r3, 0x8] - adds r0, 0xB1 - ldrb r0, [r0] - strb r0, [r3, 0x9] - ldr r0, =0x0202420f - ldrb r0, [r0] - strb r0, [r3, 0xA] - ldr r3, =gBattleMoves - ldrh r1, [r4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x2] - mov r7, r12 - strb r0, [r7, 0xB] - movs r3, 0 - mov r9, r2 - ldr r0, =0x02022f78 - mov r8, r0 - adds r2, 0x10 - ldr r0, =0x02024084 - adds r4, r0, 0 - adds r4, 0x20 -_08033C6A: - adds r1, r2, r3 - ldrb r0, [r4] - strb r0, [r1] - adds r4, 0x58 - adds r3, 0x1 - cmp r3, 0x3 - ble _08033C6A - movs r3, 0 - mov r5, r12 - adds r5, 0x10 - mov r4, r12 - adds r4, 0x20 - ldr r6, =0x02022f68 - mov r2, r12 - adds r2, 0x30 -_08033C88: - adds r1, r5, r3 - ldr r7, =0x02022f58 - adds r0, r3, r7 - ldrb r0, [r0] - strb r0, [r1] - adds r1, r4, r3 - adds r0, r3, r6 - ldrb r0, [r0] - strb r0, [r1] - adds r1, r2, r3 - mov r7, r8 - adds r0, r3, r7 - ldrb r0, [r0] - strb r0, [r1] - adds r3, 0x1 - cmp r3, 0xF - ble _08033C88 - mov r0, r10 - mov r1, r9 - movs r2, 0x44 - bl dp01_prepare_buffer - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x10_TODO - - thumb_func_start dp01_build_cmdbuf_x11_TODO -dp01_build_cmdbuf_x11_TODO: @ 8033CFC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - lsls r1, 16 - lsrs r1, 16 - ldr r2, =0x02022d10 - movs r0, 0x11 - strb r0, [r2] - strb r0, [r2, 0x1] - strb r1, [r2, 0x2] - lsrs r1, 8 - strb r1, [r2, 0x3] - adds r0, r2, 0x4 - mov r12, r0 - ldr r0, =0x020241ea - ldrh r0, [r0] - strh r0, [r2, 0x4] - ldr r0, =0x020241ec - ldrh r0, [r0] - mov r1, r12 - strh r0, [r1, 0x2] - ldr r0, =0x02024208 - ldrh r0, [r0] - strh r0, [r1, 0x4] - ldr r0, =0x0202420a - ldrb r0, [r0] - strb r0, [r1, 0x6] - ldr r0, =0x02024474 - ldrb r0, [r0, 0x17] - strb r0, [r1, 0x7] - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x52 - ldrb r0, [r0] - strb r0, [r1, 0x8] - movs r3, 0 - mov r9, r2 - ldr r7, =0x02022f78 - mov r8, r7 - mov r4, r9 - adds r4, 0x10 - ldr r0, =0x02024084 - adds r2, r0, 0 - adds r2, 0x20 -_08033D5E: - adds r1, r4, r3 - ldrb r0, [r2] - strb r0, [r1] - adds r2, 0x58 - adds r3, 0x1 - cmp r3, 0x3 - ble _08033D5E - movs r3, 0 - mov r5, r12 - adds r5, 0x10 - mov r4, r12 - adds r4, 0x20 - ldr r6, =0x02022f68 - mov r2, r12 - adds r2, 0x30 -_08033D7C: - adds r1, r5, r3 - ldr r7, =0x02022f58 - adds r0, r3, r7 - ldrb r0, [r0] - strb r0, [r1] - adds r1, r4, r3 - adds r0, r3, r6 - ldrb r0, [r0] - strb r0, [r1] - adds r1, r2, r3 - mov r7, r8 - adds r0, r3, r7 - ldrb r0, [r0] - strb r0, [r1] - adds r3, 0x1 - cmp r3, 0xF - ble _08033D7C - mov r0, r10 - mov r1, r9 - movs r2, 0x44 - bl dp01_prepare_buffer - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x11_TODO - - thumb_func_start dp01_build_cmdbuf_x12_a_bb -dp01_build_cmdbuf_x12_a_bb: @ 8033DE4 - push {r4,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r2, 16 - lsrs r2, 16 - ldr r1, =0x02022d10 - movs r3, 0x12 - strb r3, [r1] - strb r4, [r1, 0x1] - strb r2, [r1, 0x2] - lsrs r2, 8 - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x12_a_bb - - thumb_func_start sub_8033E10 -sub_8033E10: @ 8033E10 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x13 - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end sub_8033E10 - - thumb_func_start sub_8033E30 -sub_8033E30: @ 8033E30 - push {r4-r6,lr} - adds r5, r3, 0 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r3, =0x02022d10 - movs r4, 0 - movs r0, 0x14 - strb r0, [r3] - strb r1, [r3, 0x1] - strb r2, [r3, 0x2] - strb r4, [r3, 0x3] - movs r2, 0 - adds r1, r3, 0 - adds r4, r1, 0x4 -_08033E4C: - adds r0, r5, r2 - ldrb r0, [r0] - strb r0, [r4] - adds r4, 0x1 - adds r2, 0x1 - cmp r2, 0x13 - bls _08033E4C - adds r0, r6, 0 - movs r2, 0x18 - bl dp01_prepare_buffer - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8033E30 - - thumb_func_start sub_8033E6C -sub_8033E6C: @ 8033E6C - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x02022d10 - movs r0, 0x15 - strb r0, [r1] - movs r2, 0 - adds r3, r1, 0x1 -_08033E7E: - adds r0, r4, r2 - ldrb r0, [r0] - strb r0, [r3] - adds r3, 0x1 - adds r2, 0x1 - cmp r2, 0x2 - ble _08033E7E - adds r0, r5, 0 - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8033E6C - - thumb_func_start dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f -dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f: @ 8033EA0 - push {r4-r6,lr} - ldr r6, [sp, 0x10] - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =0x02022d10 - movs r0, 0x16 - strb r0, [r4] - strb r1, [r4, 0x1] - strb r2, [r4, 0x2] - strb r3, [r4, 0x3] - movs r2, 0 - adds r1, r4, 0 - adds r3, r1, 0x4 -_08033EBA: - adds r0, r6, r2 - ldrb r0, [r0] - strb r0, [r3] - adds r3, 0x1 - adds r2, 0x1 - cmp r2, 0x2 - ble _08033EBA - adds r0, r5, 0 - movs r2, 0x8 - bl dp01_prepare_buffer - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f - - thumb_func_start dp01_build_cmdbuf_x17_17_17_17 -dp01_build_cmdbuf_x17_17_17_17: @ 8033EDC - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x17 - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x17_17_17_17 - - thumb_func_start dp01_build_cmdbuf_x18_0_aa_health_bar_update -dp01_build_cmdbuf_x18_0_aa_health_bar_update: @ 8033EFC - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r1, 16 - ldr r3, =0x02022d10 - movs r4, 0 - movs r2, 0x18 - strb r2, [r3] - strb r4, [r3, 0x1] - strb r1, [r3, 0x2] - lsls r1, 16 - asrs r1, 16 - movs r2, 0xFF - lsls r2, 8 - ands r1, r2 - asrs r1, 8 - strb r1, [r3, 0x3] - adds r1, r3, 0 - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x18_0_aa_health_bar_update - - thumb_func_start dp01_build_cmdbuf_x19_a_bb -dp01_build_cmdbuf_x19_a_bb: @ 8033F34 - push {r4,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r2, 16 - lsrs r2, 16 - ldr r1, =0x02022d10 - movs r3, 0x19 - strb r3, [r1] - strb r4, [r1, 0x1] - strb r2, [r1, 0x2] - lsls r2, 16 - asrs r2, 16 - movs r3, 0xFF - lsls r3, 8 - ands r2, r3 - asrs r2, 8 - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x19_a_bb - - thumb_func_start dp01_build_cmdbuf_x1A_aaaa_bbbb -dp01_build_cmdbuf_x1A_aaaa_bbbb: @ 8033F68 - push {r4-r6,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r3, 0x1A - strb r3, [r1] - strb r4, [r1, 0x1] - movs r6, 0xFF - lsls r6, 8 - adds r3, r4, 0 - ands r3, r6 - lsrs r3, 8 - strb r3, [r1, 0x2] - movs r5, 0xFF - lsls r5, 16 - adds r3, r4, 0 - ands r3, r5 - lsrs r3, 16 - strb r3, [r1, 0x3] - lsrs r4, 24 - strb r4, [r1, 0x4] - strb r2, [r1, 0x5] - adds r3, r2, 0 - ands r3, r6 - lsrs r3, 8 - strb r3, [r1, 0x6] - adds r3, r2, 0 - ands r3, r5 - lsrs r3, 16 - strb r3, [r1, 0x7] - lsrs r2, 24 - strb r2, [r1, 0x8] - movs r2, 0x9 - bl dp01_prepare_buffer - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x1A_aaaa_bbbb - - thumb_func_start dp01_build_cmdbuf_x1B_aaaa_b -dp01_build_cmdbuf_x1B_aaaa_b: @ 8033FBC - push {r4,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r3, 0x1B - strb r3, [r1] - strb r4, [r1, 0x1] - strb r2, [r1, 0x2] - movs r3, 0xFF - lsls r3, 8 - ands r3, r2 - lsrs r3, 8 - strb r3, [r1, 0x3] - movs r3, 0xFF - lsls r3, 16 - ands r3, r2 - lsrs r3, 16 - strb r3, [r1, 0x4] - lsrs r2, 24 - strb r2, [r1, 0x5] - movs r2, 0x6 - bl dp01_prepare_buffer - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x1B_aaaa_b - - thumb_func_start dp01_build_cmdbuf_x1C_a -dp01_build_cmdbuf_x1C_a: @ 8033FF8 - push {lr} - adds r3, r1, 0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x1C - strb r2, [r1] - strb r3, [r1, 0x1] - movs r2, 0x2 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x1C_a - - thumb_func_start dp01_build_cmdbuf_x1D_1D_numargs_varargs -dp01_build_cmdbuf_x1D_1D_numargs_varargs: @ 8034018 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 16 - lsrs r4, r1, 16 - ldr r1, =0x02022d10 - movs r0, 0x1D - strb r0, [r1] - strb r0, [r1, 0x1] - strb r4, [r1, 0x2] - lsrs r0, r4, 8 - strb r0, [r1, 0x3] - adds r5, r1, 0 - cmp r4, 0 - beq _08034048 - adds r1, r5, 0x4 - adds r3, r4, 0 -_0803403A: - ldrb r0, [r2] - strb r0, [r1] - adds r2, 0x1 - adds r1, 0x1 - subs r3, 0x1 - cmp r3, 0 - bne _0803403A -_08034048: - adds r2, r4, 0x4 - lsls r2, 16 - lsrs r2, 16 - adds r0, r6, 0 - adds r1, r5, 0 - bl dp01_prepare_buffer - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x1D_1D_numargs_varargs - - thumb_func_start sub_8034060 -sub_8034060: @ 8034060 - push {r4-r6,lr} - adds r4, r3, 0 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r2, 16 - lsrs r5, r2, 16 - ldr r2, =0x02022d10 - movs r0, 0x1E - strb r0, [r2] - strb r1, [r2, 0x1] - movs r3, 0xFF - lsls r3, 8 - adds r0, r1, 0 - ands r0, r3 - lsrs r0, 8 - strb r0, [r2, 0x2] - movs r0, 0xFF - lsls r0, 16 - ands r0, r1 - lsrs r0, 16 - strb r0, [r2, 0x3] - lsrs r1, 24 - strb r1, [r2, 0x4] - strb r5, [r2, 0x5] - adds r0, r5, 0 - ands r0, r3 - lsrs r0, 8 - strb r0, [r2, 0x6] - adds r1, r2, 0 - cmp r5, 0 - beq _080340B0 - adds r3, r1, 0x7 - adds r2, r5, 0 -_080340A2: - ldrb r0, [r4] - strb r0, [r3] - adds r4, 0x1 - adds r3, 0x1 - subs r2, 0x1 - cmp r2, 0 - bne _080340A2 -_080340B0: - adds r2, r5, 0x7 - lsls r2, 16 - lsrs r2, 16 - adds r0, r6, 0 - bl dp01_prepare_buffer - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8034060 - - thumb_func_start sub_80340C8 -sub_80340C8: @ 80340C8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 16 - lsrs r4, r1, 16 - ldr r1, =0x02022d10 - movs r0, 0x1F - strb r0, [r1] - strb r4, [r1, 0x1] - lsrs r0, r4, 8 - strb r0, [r1, 0x2] - adds r5, r1, 0 - cmp r4, 0 - beq _080340F6 - adds r1, r5, 0x3 - adds r3, r4, 0 -_080340E8: - ldrb r0, [r2] - strb r0, [r1] - adds r2, 0x1 - adds r1, 0x1 - subs r3, 0x1 - cmp r3, 0 - bne _080340E8 -_080340F6: - adds r2, r4, 0x3 - lsls r2, 16 - lsrs r2, 16 - adds r0, r6, 0 - adds r1, r5, 0 - bl dp01_prepare_buffer - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80340C8 - - thumb_func_start sub_8034110 -sub_8034110: @ 8034110 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 16 - lsrs r4, r1, 16 - ldr r1, =0x02022d10 - movs r0, 0x20 - strb r0, [r1] - strb r4, [r1, 0x1] - lsrs r0, r4, 8 - strb r0, [r1, 0x2] - adds r5, r1, 0 - cmp r4, 0 - beq _0803413E - adds r1, r5, 0x3 - adds r3, r4, 0 -_08034130: - ldrb r0, [r2] - strb r0, [r1] - adds r2, 0x1 - adds r1, 0x1 - subs r3, 0x1 - cmp r3, 0 - bne _08034130 -_0803413E: - adds r2, r4, 0x3 - lsls r2, 16 - lsrs r2, 16 - adds r0, r6, 0 - adds r1, r5, 0 - bl dp01_prepare_buffer - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8034110 - - thumb_func_start dp01_build_cmdbuf_x21_a_bb -dp01_build_cmdbuf_x21_a_bb: @ 8034158 - push {r4,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r2, 16 - lsrs r2, 16 - ldr r1, =0x02022d10 - movs r3, 0x21 - strb r3, [r1] - strb r4, [r1, 0x1] - strb r2, [r1, 0x2] - lsrs r2, 8 - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x21_a_bb - - thumb_func_start dp01_build_cmdbuf_x22_a_three_bytes -dp01_build_cmdbuf_x22_a_three_bytes: @ 8034184 - push {r4,r5,lr} - adds r4, r2, 0 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r2, =0x02022d10 - movs r0, 0x22 - strb r0, [r2] - strb r1, [r2, 0x1] - movs r3, 0 - adds r1, r2, 0x2 -_08034198: - adds r0, r4, r3 - ldrb r0, [r0] - strb r0, [r1] - adds r1, 0x1 - adds r3, 0x1 - cmp r3, 0x2 - ble _08034198 - adds r0, r5, 0 - adds r1, r2, 0 - movs r2, 0x5 - bl dp01_prepare_buffer - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x22_a_three_bytes - - thumb_func_start dp01_build_cmdbuf_x23_aa_0 -dp01_build_cmdbuf_x23_aa_0: @ 80341BC - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r1, 16 - ldr r3, =0x02022d10 - movs r4, 0 - movs r2, 0x23 - strb r2, [r3] - strb r1, [r3, 0x1] - lsrs r1, 8 - strb r1, [r3, 0x2] - strb r4, [r3, 0x3] - adds r1, r3, 0 - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x23_aa_0 - - thumb_func_start dp01_build_cmdbuf_x24_aa_0 -dp01_build_cmdbuf_x24_aa_0: @ 80341E8 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r1, 16 - ldr r3, =0x02022d10 - movs r4, 0 - movs r2, 0x24 - strb r2, [r3] - strb r1, [r3, 0x1] - lsrs r1, 8 - strb r1, [r3, 0x2] - strb r4, [r3, 0x3] - adds r1, r3, 0 - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x24_aa_0 - - thumb_func_start dp01_build_cmdbuf_x25_25_25_25 -dp01_build_cmdbuf_x25_25_25_25: @ 8034214 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x25 - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x25_25_25_25 - - thumb_func_start dp01_build_cmdbuf_x26_a -dp01_build_cmdbuf_x26_a: @ 8034234 - push {lr} - adds r3, r1, 0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x26 - strb r2, [r1] - strb r3, [r1, 0x1] - movs r2, 0x2 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x26_a - - thumb_func_start dp01_build_cmdbuf_x27_27_27_27 -dp01_build_cmdbuf_x27_27_27_27: @ 8034254 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x27 - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x27_27_27_27 - - thumb_func_start dp01_build_cmdbuf_x28_28_28_28 -dp01_build_cmdbuf_x28_28_28_28: @ 8034274 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x28 - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x28_28_28_28 - - thumb_func_start dp01_build_cmdbuf_x29_29_29_29 -dp01_build_cmdbuf_x29_29_29_29: @ 8034294 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x29 - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x29_29_29_29 - - thumb_func_start dp01_build_cmdbuf_x2A_2A_2A_2A -dp01_build_cmdbuf_x2A_2A_2A_2A: @ 80342B4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x2A - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x2A_2A_2A_2A - - thumb_func_start dp01_build_cmdbuf_x2B_aa_0 -dp01_build_cmdbuf_x2B_aa_0: @ 80342D4 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r1, 16 - ldr r3, =0x02022d10 - movs r4, 0 - movs r2, 0x2B - strb r2, [r3] - strb r1, [r3, 0x1] - lsrs r1, 8 - strb r1, [r3, 0x2] - strb r4, [r3, 0x3] - adds r1, r3, 0 - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x2B_aa_0 - - thumb_func_start sub_8034300 -sub_8034300: @ 8034300 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r1, 16 - ldr r4, =0x02022d10 - movs r3, 0x2C - strb r3, [r4] - strb r1, [r4, 0x1] - lsrs r1, 8 - strb r1, [r4, 0x2] - strb r2, [r4, 0x3] - adds r1, r4, 0 - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8034300 - - thumb_func_start dp01_build_cmdbuf_x2D_2D_2D_2D -dp01_build_cmdbuf_x2D_2D_2D_2D: @ 803432C - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x2D - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x2D_2D_2D_2D - - thumb_func_start dp01_build_cmdbuf_x2E_a -dp01_build_cmdbuf_x2E_a: @ 803434C - push {lr} - adds r3, r1, 0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x2E - strb r2, [r1] - strb r3, [r1, 0x1] - movs r2, 0x2 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x2E_a - - thumb_func_start dp01_build_cmdbuf_x2F_2F_2F_2F -dp01_build_cmdbuf_x2F_2F_2F_2F: @ 803436C - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x2F - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x2F_2F_2F_2F - - thumb_func_start dp01_build_cmdbuf_x30_TODO -dp01_build_cmdbuf_x30_TODO: @ 803438C - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r2, 24 - lsrs r2, 24 - ldr r1, =0x02022d10 - movs r3, 0x30 - strb r3, [r1] - movs r0, 0x7F - ands r0, r2 - strb r0, [r1, 0x1] - movs r0, 0x80 - ands r0, r2 - lsls r0, 24 - lsrs r0, 31 - strb r0, [r1, 0x2] - strb r3, [r1, 0x3] - movs r2, 0 - adds r3, r1, 0x4 -_080343B4: - adds r0, r4, r2 - ldrb r0, [r0] - strb r0, [r3] - adds r3, 0x1 - adds r2, 0x1 - cmp r2, 0x2F - ble _080343B4 - adds r0, r5, 0 - movs r2, 0x34 - bl dp01_prepare_buffer - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x30_TODO - - thumb_func_start dp01_build_cmdbuf_x31_31_31_31 -dp01_build_cmdbuf_x31_31_31_31: @ 80343D4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x31 - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x31_31_31_31 - - thumb_func_start dp01_build_cmdbuf_x32_32_32_32 -dp01_build_cmdbuf_x32_32_32_32: @ 80343F4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x32 - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x32_32_32_32 - - thumb_func_start dp01_build_cmdbuf_x33_a_33_33 -dp01_build_cmdbuf_x33_a_33_33: @ 8034414 - push {lr} - adds r3, r1, 0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x33 - strb r2, [r1] - strb r3, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x33_a_33_33 - - thumb_func_start dp01_build_cmdbuf_x34_a_bb_aka_battle_anim -dp01_build_cmdbuf_x34_a_bb_aka_battle_anim: @ 8034438 - push {r4,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r2, 16 - lsrs r2, 16 - ldr r1, =0x02022d10 - movs r3, 0x34 - strb r3, [r1] - strb r4, [r1, 0x1] - strb r2, [r1, 0x2] - lsrs r2, 8 - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x34_a_bb_aka_battle_anim - - thumb_func_start sub_8034464 -sub_8034464: @ 8034464 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r2, 24 - lsrs r2, 24 - ldr r4, =0x02022d10 - movs r0, 0x35 - strb r0, [r4] - strb r1, [r4, 0x1] - cmp r2, 0 - beq _0803448C - adds r0, r4, 0x4 - bl sub_81850DC - strb r0, [r4, 0x2] - strb r0, [r4, 0x3] - b _08034490 - .pool -_0803448C: - strb r2, [r4, 0x2] - strb r2, [r4, 0x3] -_08034490: - ldr r1, =0x02022d10 - ldrb r2, [r1, 0x2] - adds r2, 0x4 - adds r0, r5, 0 - bl dp01_prepare_buffer - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8034464 - - thumb_func_start dp01_build_cmdbuf_x38_a -dp01_build_cmdbuf_x38_a: @ 80344A8 - push {lr} - adds r3, r1, 0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x36 - strb r2, [r1] - strb r3, [r1, 0x1] - movs r2, 0x2 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x38_a - - thumb_func_start dp01_build_cmdbuf_x37_a -dp01_build_cmdbuf_x37_a: @ 80344C8 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r4, =0x02022d10 - movs r0, 0x37 - strb r0, [r4] - strb r1, [r4, 0x1] - ldr r0, =0x03005d90 - ldr r1, [r0] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 28 - lsrs r0, 31 - strb r0, [r4, 0x2] - ldrb r0, [r1] - lsls r0, 28 - lsrs r0, 31 - strb r0, [r4, 0x3] - adds r0, r4, 0x6 - bl sub_81850DC - strb r0, [r4, 0x4] - strb r0, [r4, 0x5] - ldrb r2, [r4, 0x4] - adds r2, 0x6 - adds r0, r5, 0 - adds r1, r4, 0 - bl dp01_prepare_buffer - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x37_a - - thumb_func_start LZDecompressWram -@ void LZDecompressWram(void *src, void *dest) -LZDecompressWram: @ 8034518 - push {lr} - bl LZ77UnCompWram - pop {r0} - bx r0 - thumb_func_end LZDecompressWram - - thumb_func_start LZDecompressVram -@ void LZDecompressVram(void *src, void *dest) -LZDecompressVram: @ 8034524 - push {lr} - bl LZ77UnCompVram - pop {r0} - bx r0 - thumb_func_end LZDecompressVram - - thumb_func_start LoadCompressedObjectPic -@ u16 LoadCompressedObjectPic(struct obj_tiles *pic) -LoadCompressedObjectPic: @ 8034530 - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldr r0, [r4] - ldr r5, =0x0201c000 - adds r1, r5, 0 - bl LZ77UnCompWram - str r5, [sp] - ldrh r1, [r4, 0x6] - lsls r1, 16 - ldrh r0, [r4, 0x4] - orrs r0, r1 - str r0, [sp, 0x4] - mov r0, sp - bl LoadObjectPic - lsls r0, 16 - lsrs r0, 16 - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end LoadCompressedObjectPic - - thumb_func_start LoadCompressedObjectPicOverrideBuffer -@ void LoadCompressedObjectPicOverrideBuffer(struct obj_tiles *pic, void *tempBuffer) -LoadCompressedObjectPicOverrideBuffer: @ 8034564 - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r0, [r4] - bl LZ77UnCompWram - str r5, [sp] - ldrh r1, [r4, 0x6] - lsls r1, 16 - ldrh r0, [r4, 0x4] - orrs r0, r1 - str r0, [sp, 0x4] - mov r0, sp - bl LoadObjectPic - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end LoadCompressedObjectPicOverrideBuffer - - thumb_func_start LoadCompressedObjectPalette -@ void LoadCompressedObjectPalette(struct TaggedObjectPalette *palette) -LoadCompressedObjectPalette: @ 803458C - push {r4,r5,lr} - sub sp, 0x8 - adds r5, r0, 0 - ldr r0, [r5] - ldr r4, =0x0201c000 - adds r1, r4, 0 - bl LZ77UnCompWram - str r4, [sp] - ldrh r2, [r5, 0x4] - ldr r1, =0xffff0000 - ldr r0, [sp, 0x4] - ands r0, r1 - orrs r0, r2 - str r0, [sp, 0x4] - mov r0, sp - bl LoadTaggedObjectPalette - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end LoadCompressedObjectPalette - - thumb_func_start LoadCompressedObjectPaletteOverrideBuffer -@ void LoadCompressedObjectPaletteOverrideBuffer(struct TaggedObjectPalette *palette, void *tempBuffer) -LoadCompressedObjectPaletteOverrideBuffer: @ 80345C0 - push {r4,r5,lr} - sub sp, 0x8 - adds r5, r0, 0 - adds r4, r1, 0 - ldr r0, [r5] - bl LZ77UnCompWram - str r4, [sp] - ldrh r2, [r5, 0x4] - ldr r1, =0xffff0000 - ldr r0, [sp, 0x4] - ands r0, r1 - orrs r0, r2 - str r0, [sp, 0x4] - mov r0, sp - bl LoadTaggedObjectPalette - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end LoadCompressedObjectPaletteOverrideBuffer - - thumb_func_start DecompressPicFromTable -@ void DecompressPicFromTable(void **picTable, void *dest, u32 index) -DecompressPicFromTable: @ 80345F0 - push {r4,r5,lr} - adds r3, r0, 0 - adds r4, r1, 0 - adds r5, r2, 0 - movs r0, 0xCE - lsls r0, 1 - cmp r5, r0 - ble _08034610 - ldr r0, =gMonFrontPicTable - ldr r0, [r0] - bl LZ77UnCompWram - b _08034618 - .pool -_08034610: - ldr r0, [r3] - adds r1, r4, 0 - bl LZ77UnCompWram -_08034618: - adds r0, r4, 0 - adds r1, r5, 0 - bl DuplicateDeoxysTiles - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end DecompressPicFromTable - - thumb_func_start DecompressMonPic_DetectFrontOrBack -@ void DecompressMonPic_DetectFrontOrBack(void **picTable, void *dest, u32 speciesId, u32 personality) -DecompressMonPic_DetectFrontOrBack: @ 8034628 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - lsls r0, r2, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - movs r1, 0 - cmp r4, r0 - bne _0803463E - movs r1, 0x1 -_0803463E: - str r1, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - bl DecompressMonPic_2 - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DecompressMonPic_DetectFrontOrBack - - thumb_func_start DecompressMonPic -@ void DecompressMonPic(void **picTable, void *dest, u32 speciesId, u32 personality, bool8 isFrontPic) -DecompressMonPic: @ 8034654 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - adds r4, r1, 0 - adds r7, r2, 0 - adds r5, r3, 0 - ldr r0, [sp, 0x18] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - cmp r7, 0xC9 - bne _080346D0 - movs r0, 0xC0 - lsls r0, 18 - ands r0, r5 - lsrs r0, 18 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r5 - lsrs r1, 12 - orrs r0, r1 - movs r1, 0xC0 - lsls r1, 2 - ands r1, r5 - lsrs r1, 6 - orrs r0, r1 - movs r1, 0x3 - ands r1, r5 - orrs r0, r1 - movs r1, 0x1C - bl __umodsi3 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - bne _080346A2 - movs r1, 0xC9 - b _080346AC -_080346A2: - movs r2, 0xCE - lsls r2, 1 - adds r0, r1, r2 - lsls r0, 16 - lsrs r1, r0, 16 -_080346AC: - mov r0, r8 - cmp r0, 0 - bne _080346C0 - ldr r0, =gMonBackPicTable - lsls r1, 3 - adds r1, r0 - ldr r0, [r1] - b _080346DC - .pool -_080346C0: - ldr r0, =gMonFrontPicTable - lsls r1, 3 - adds r1, r0 - ldr r0, [r1] - b _080346DC - .pool -_080346D0: - movs r0, 0xCE - lsls r0, 1 - cmp r7, r0 - ble _080346E8 - ldr r0, =gMonFrontPicTable - ldr r0, [r0] -_080346DC: - adds r1, r4, 0 - bl LZ77UnCompWram - b _080346F0 - .pool -_080346E8: - ldr r0, [r6] - adds r1, r4, 0 - bl LZ77UnCompWram -_080346F0: - adds r0, r4, 0 - adds r1, r7, 0 - bl DuplicateDeoxysTiles - lsls r0, r7, 16 - lsrs r0, 16 - adds r1, r5, 0 - adds r2, r4, 0 - mov r3, r8 - bl DrawSpindaSpots - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end DecompressMonPic - - thumb_func_start Unused_LZDecompressWramIndirect -@ void Unused_LZDecompressWramIndirect(void **src) -Unused_LZDecompressWramIndirect: @ 8034710 - push {lr} - ldr r0, [r0] - bl LZ77UnCompWram - pop {r0} - bx r0 - thumb_func_end Unused_LZDecompressWramIndirect - - thumb_func_start sub_803471C -sub_803471C: @ 803471C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - mov r9, r0 - str r1, [sp] - str r2, [sp, 0x4] - adds r5, r3, 0 - movs r0, 0x1 - mov r1, r9 - ands r0, r1 - cmp r0, 0 - bne _0803473C - b _080348D4 -_0803473C: - asrs r0, r1, 1 - adds r0, 0x4 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x8] - movs r0, 0 - ldr r2, [sp] - cmp r0, r2 - blt _08034750 - b _08034964 -_08034750: - movs r4, 0x8 - subs r1, r4, r1 - str r1, [sp, 0x10] -_08034756: - movs r7, 0 - adds r0, 0x1 - str r0, [sp, 0x14] - ldr r0, [sp, 0x10] - cmp r7, r0 - bge _080347D2 - ldr r1, [sp, 0x8] - lsls r1, 8 - str r1, [sp, 0x18] - movs r2, 0 - mov r10, r2 - mov r0, r9 - movs r4, 0x8 - subs r0, r4, r0 - str r0, [sp, 0xC] -_08034774: - movs r3, 0 - asrs r0, r7, 1 - adds r1, r7, 0 - movs r2, 0x1 - ands r1, r2 - str r1, [sp, 0x20] - lsls r0, 8 - mov r8, r0 - mov r12, r5 -_08034786: - lsls r1, r3, 5 - ldr r4, [sp, 0x18] - adds r0, r5, r4 - adds r0, r1 - mov r1, r8 - adds r2, r0, r1 - mov r1, r12 - add r1, r8 - movs r6, 0xF -_08034798: - ldr r4, [sp, 0x20] - cmp r4, 0 - bne _080347A8 - strb r4, [r1] - add r4, sp, 0x20 - ldrb r4, [r4] - strb r4, [r2, 0x10] - b _080347B6 -_080347A8: - mov r0, r10 - strb r0, [r1, 0x10] - movs r4, 0x80 - lsls r4, 1 - adds r4, r2, r4 - str r4, [sp, 0x1C] - strb r0, [r4] -_080347B6: - adds r2, 0x1 - adds r1, 0x1 - subs r6, 0x1 - cmp r6, 0 - bge _08034798 - movs r0, 0x20 - add r12, r0 - adds r3, 0x1 - cmp r3, 0x7 - ble _08034786 - adds r7, 0x1 - ldr r1, [sp, 0xC] - cmp r7, r1 - blt _08034774 -_080347D2: - movs r7, 0 - movs r2, 0 -_080347D6: - movs r6, 0 - adds r4, r7, 0x1 - mov r8, r4 - lsls r4, r7, 5 -_080347DE: - adds r0, r6, 0x1 - mov r10, r0 - lsls r1, r6, 8 - adds r0, r1, 0 - adds r0, 0xC0 - adds r0, r5, r0 - adds r0, r4 - adds r1, r5, r1 - adds r1, r4 - movs r3, 0x1F -_080347F2: - strb r2, [r1] - strb r2, [r0] - adds r0, 0x1 - adds r1, 0x1 - subs r3, 0x1 - cmp r3, 0 - bge _080347F2 - mov r6, r10 - cmp r6, 0x7 - ble _080347DE - mov r7, r8 - cmp r7, 0x1 - ble _080347D6 - mov r1, r9 - cmp r1, 0x5 - bne _08034818 - movs r2, 0x90 - lsls r2, 1 - adds r5, r2 -_08034818: - movs r7, 0 - cmp r7, r9 - bge _080348AE -_0803481E: - movs r3, 0 - adds r7, 0x1 - mov r8, r7 - cmp r3, r9 - bge _0803488E -_08034828: - adds r3, 0x1 - mov r10, r3 - ldr r4, [sp, 0x4] - adds r4, 0x20 - adds r7, r5, 0 - adds r7, 0x20 - movs r0, 0x12 - adds r0, r5 - mov r12, r0 - ldr r2, [sp, 0x4] - adds r3, r5, 0 - movs r6, 0x3 -_08034840: - ldrb r0, [r2] - mov r1, r12 - strb r0, [r1] - ldrb r0, [r2, 0x1] - strb r0, [r1, 0x1] - ldrb r0, [r2, 0x2] - strb r0, [r1, 0x1E] - ldrb r0, [r2, 0x3] - strb r0, [r1, 0x1F] - movs r0, 0x81 - lsls r0, 1 - adds r1, r3, r0 - ldrb r0, [r2, 0x10] - strb r0, [r1] - ldr r0, =0x00000103 - adds r1, r3, r0 - ldrb r0, [r2, 0x11] - strb r0, [r1] - movs r0, 0x90 - lsls r0, 1 - adds r1, r3, r0 - ldrb r0, [r2, 0x12] - strb r0, [r1] - ldr r0, =0x00000121 - adds r1, r3, r0 - ldrb r0, [r2, 0x13] - strb r0, [r1] - movs r1, 0x4 - add r12, r1 - adds r2, 0x4 - adds r3, 0x4 - subs r6, 0x1 - cmp r6, 0 - bge _08034840 - str r4, [sp, 0x4] - adds r5, r7, 0 - mov r3, r10 - cmp r3, r9 - blt _08034828 -_0803488E: - mov r2, r9 - cmp r2, 0x7 - bne _080348A0 - adds r5, 0x20 - b _080348A8 - .pool -_080348A0: - mov r4, r9 - cmp r4, 0x5 - bne _080348A8 - adds r5, 0x60 -_080348A8: - mov r7, r8 - cmp r7, r9 - blt _0803481E -_080348AE: - mov r0, r9 - cmp r0, 0x7 - bne _080348BC - movs r1, 0x80 - lsls r1, 1 - adds r5, r1 - b _080348C8 -_080348BC: - mov r2, r9 - cmp r2, 0x5 - bne _080348C8 - movs r4, 0xF0 - lsls r4, 1 - adds r5, r4 -_080348C8: - ldr r0, [sp, 0x14] - ldr r1, [sp] - cmp r0, r1 - bge _080348D2 - b _08034756 -_080348D2: - b _08034964 -_080348D4: - movs r6, 0 - ldr r2, [sp] - cmp r6, r2 - bge _08034964 -_080348DC: - adds r6, 0x1 - mov r10, r6 - mov r4, r9 - cmp r4, 0x6 - bne _080348F4 - movs r0, 0 - movs r3, 0xFF -_080348EA: - strb r0, [r5] - adds r5, 0x1 - subs r3, 0x1 - cmp r3, 0 - bge _080348EA -_080348F4: - movs r7, 0 - cmp r7, r9 - bge _08034948 -_080348FA: - adds r7, 0x1 - mov r8, r7 - mov r1, r9 - lsls r0, r1, 5 - cmp r1, 0x6 - bne _08034914 - movs r1, 0 - movs r3, 0x1F -_0803490A: - strb r1, [r5] - adds r5, 0x1 - subs r3, 0x1 - cmp r3, 0 - bge _0803490A -_08034914: - adds r1, r0, 0 - cmp r1, 0 - ble _0803492E - adds r3, r1, 0 -_0803491C: - ldr r2, [sp, 0x4] - ldrb r0, [r2] - strb r0, [r5] - adds r2, 0x1 - str r2, [sp, 0x4] - adds r5, 0x1 - subs r3, 0x1 - cmp r3, 0 - bne _0803491C -_0803492E: - mov r4, r9 - cmp r4, 0x6 - bne _08034942 - movs r0, 0 - movs r3, 0x1F -_08034938: - strb r0, [r5] - adds r5, 0x1 - subs r3, 0x1 - cmp r3, 0 - bge _08034938 -_08034942: - mov r7, r8 - cmp r7, r9 - blt _080348FA -_08034948: - mov r0, r9 - cmp r0, 0x6 - bne _0803495C - movs r0, 0 - movs r3, 0xFF -_08034952: - strb r0, [r5] - adds r5, 0x1 - subs r3, 0x1 - cmp r3, 0 - bge _08034952 -_0803495C: - mov r6, r10 - ldr r1, [sp] - cmp r6, r1 - blt _080348DC -_08034964: - 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_803471C - - thumb_func_start sub_8034974 -sub_8034974: @ 8034974 - adds r2, r0, 0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - ldrb r1, [r2, 0x2] - lsls r1, 8 - orrs r0, r1 - ldrb r1, [r2, 0x1] - orrs r0, r1 - bx lr - thumb_func_end sub_8034974 - - thumb_func_start LoadCompressedObjectPicUsingHeap -@ u32 LoadCompressedObjectPicUsingHeap(struct obj_tiles *pic) -LoadCompressedObjectPicUsingHeap: @ 8034988 - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldr r0, [r4] - ldr r0, [r0] - lsrs r0, 8 - bl AllocZeroed - adds r5, r0, 0 - ldr r0, [r4] - adds r1, r5, 0 - bl LZ77UnCompWram - str r5, [sp] - ldrh r1, [r4, 0x6] - lsls r1, 16 - ldrh r0, [r4, 0x4] - orrs r0, r1 - str r0, [sp, 0x4] - mov r0, sp - bl LoadObjectPic - adds r0, r5, 0 - bl Free - movs r0, 0 - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end LoadCompressedObjectPicUsingHeap - - thumb_func_start LoadCompressedObjectPaletteUsingHeap -@ u32 LoadCompressedObjectPaletteUsingHeap(struct TaggedObjectPalette *palette) -LoadCompressedObjectPaletteUsingHeap: @ 80349C4 - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldr r0, [r4] - ldr r0, [r0] - lsrs r0, 8 - bl AllocZeroed - adds r5, r0, 0 - ldr r0, [r4] - adds r1, r5, 0 - bl LZ77UnCompWram - str r5, [sp] - ldrh r2, [r4, 0x4] - ldr r1, =0xffff0000 - ldr r0, [sp, 0x4] - ands r0, r1 - orrs r0, r2 - str r0, [sp, 0x4] - mov r0, sp - bl LoadTaggedObjectPalette - adds r0, r5, 0 - bl Free - movs r0, 0 - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end LoadCompressedObjectPaletteUsingHeap - - thumb_func_start DecompressPicFromTable_2 -@ void DecompressPicFromTable_2(void **picTable, void *dest, u32 index) -DecompressPicFromTable_2: @ 8034A08 - push {r4,r5,lr} - adds r3, r0, 0 - adds r4, r1, 0 - adds r5, r2, 0 - movs r0, 0xCE - lsls r0, 1 - cmp r5, r0 - ble _08034A28 - ldr r0, =gMonFrontPicTable - ldr r0, [r0] - bl LZ77UnCompWram - b _08034A30 - .pool -_08034A28: - ldr r0, [r3] - adds r1, r4, 0 - bl LZ77UnCompWram -_08034A30: - adds r0, r4, 0 - adds r1, r5, 0 - bl DuplicateDeoxysTiles - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end DecompressPicFromTable_2 - - thumb_func_start DecompressMonPic_2 -@ void DecompressMonPic_2(void **picTable, void *dest, u32 speciesId, u32 personality, bool8 isFrontPic) -DecompressMonPic_2: @ 8034A40 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - adds r4, r1, 0 - adds r7, r2, 0 - adds r5, r3, 0 - ldr r0, [sp, 0x18] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - cmp r7, 0xC9 - bne _08034ABC - movs r0, 0xC0 - lsls r0, 18 - ands r0, r5 - lsrs r0, 18 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r5 - lsrs r1, 12 - orrs r0, r1 - movs r1, 0xC0 - lsls r1, 2 - ands r1, r5 - lsrs r1, 6 - orrs r0, r1 - movs r1, 0x3 - ands r1, r5 - orrs r0, r1 - movs r1, 0x1C - bl __umodsi3 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - bne _08034A8E - movs r1, 0xC9 - b _08034A98 -_08034A8E: - movs r2, 0xCE - lsls r2, 1 - adds r0, r1, r2 - lsls r0, 16 - lsrs r1, r0, 16 -_08034A98: - mov r0, r8 - cmp r0, 0 - bne _08034AAC - ldr r0, =gMonBackPicTable - lsls r1, 3 - adds r1, r0 - ldr r0, [r1] - b _08034AC8 - .pool -_08034AAC: - ldr r0, =gMonFrontPicTable - lsls r1, 3 - adds r1, r0 - ldr r0, [r1] - b _08034AC8 - .pool -_08034ABC: - movs r0, 0xCE - lsls r0, 1 - cmp r7, r0 - ble _08034AD4 - ldr r0, =gMonFrontPicTable - ldr r0, [r0] -_08034AC8: - adds r1, r4, 0 - bl LZ77UnCompWram - b _08034ADC - .pool -_08034AD4: - ldr r0, [r6] - adds r1, r4, 0 - bl LZ77UnCompWram -_08034ADC: - adds r0, r4, 0 - adds r1, r7, 0 - bl DuplicateDeoxysTiles - lsls r0, r7, 16 - lsrs r0, 16 - adds r1, r5, 0 - adds r2, r4, 0 - mov r3, r8 - bl DrawSpindaSpots - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end DecompressMonPic_2 - - thumb_func_start DecompressMonPic_DetectFrontOrBack_2 -@ void DecompressMonPic_DetectFrontOrBack_2(void **picTable, void *dest, u32 speciesId, u32 personality) -DecompressMonPic_DetectFrontOrBack_2: @ 8034AFC - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - lsls r0, r2, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - movs r1, 0 - cmp r4, r0 - bne _08034B12 - movs r1, 0x1 -_08034B12: - str r1, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - bl DecompressMonPic_2 - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DecompressMonPic_DetectFrontOrBack_2 - - thumb_func_start sub_8034B28 -sub_8034B28: @ 8034B28 - push {lr} - adds r3, r0, 0 - movs r0, 0xCE - lsls r0, 1 - cmp r2, r0 - ble _08034B44 - ldr r0, =gMonFrontPicTable - ldr r0, [r0] - bl LZ77UnCompWram - b _08034B4A - .pool -_08034B44: - ldr r0, [r3] - bl LZ77UnCompWram -_08034B4A: - pop {r0} - bx r0 - thumb_func_end sub_8034B28 - - thumb_func_start DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack -@ void DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack(void **picTable, void *dest, u32 speciesId, u32 personality) -DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack: @ 8034B50 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - lsls r0, r2, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - movs r1, 0 - cmp r4, r0 - bne _08034B66 - movs r1, 0x1 -_08034B66: - str r1, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - bl DecompressMonPicWithoutDuplicatingDeoxysTiles - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack - - thumb_func_start DecompressMonPicWithoutDuplicatingDeoxysTiles -@ void DecompressMonPicWithoutDuplicatingDeoxysTiles(void **picTable, void *dest, u32 speciesId, u32 personality, bool8 isFrontPic) -DecompressMonPicWithoutDuplicatingDeoxysTiles: @ 8034B7C - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - adds r5, r1, 0 - adds r7, r2, 0 - adds r4, r3, 0 - ldr r0, [sp, 0x18] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - cmp r7, 0xC9 - bne _08034BF8 - movs r0, 0xC0 - lsls r0, 18 - ands r0, r4 - lsrs r0, 18 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r4 - lsrs r1, 12 - orrs r0, r1 - movs r1, 0xC0 - lsls r1, 2 - ands r1, r4 - lsrs r1, 6 - orrs r0, r1 - movs r1, 0x3 - ands r1, r4 - orrs r0, r1 - movs r1, 0x1C - bl __umodsi3 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - bne _08034BCA - movs r1, 0xC9 - b _08034BD4 -_08034BCA: - movs r2, 0xCE - lsls r2, 1 - adds r0, r1, r2 - lsls r0, 16 - lsrs r1, r0, 16 -_08034BD4: - mov r0, r8 - cmp r0, 0 - bne _08034BE8 - ldr r0, =gMonBackPicTable - lsls r1, 3 - adds r1, r0 - ldr r0, [r1] - b _08034C04 - .pool -_08034BE8: - ldr r0, =gMonFrontPicTable - lsls r1, 3 - adds r1, r0 - ldr r0, [r1] - b _08034C04 - .pool -_08034BF8: - movs r0, 0xCE - lsls r0, 1 - cmp r7, r0 - ble _08034C10 - ldr r0, =gMonFrontPicTable - ldr r0, [r0] -_08034C04: - adds r1, r5, 0 - bl LZ77UnCompWram - b _08034C18 - .pool -_08034C10: - ldr r0, [r6] - adds r1, r5, 0 - bl LZ77UnCompWram -_08034C18: - lsls r0, r7, 16 - lsrs r0, 16 - adds r1, r4, 0 - adds r2, r5, 0 - mov r3, r8 - bl DrawSpindaSpots - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end DecompressMonPicWithoutDuplicatingDeoxysTiles - - thumb_func_start DuplicateDeoxysTiles -@ void DuplicateDeoxysTiles(void *pointer, u32 speciesId) -DuplicateDeoxysTiles: @ 8034C30 - push {lr} - adds r3, r0, 0 - movs r0, 0xCD - lsls r0, 1 - cmp r1, r0 - bne _08034C4A - movs r1, 0x80 - lsls r1, 4 - adds r0, r3, r1 - ldr r2, =0x04000200 - adds r1, r3, 0 - bl CpuSet -_08034C4A: - pop {r0} - bx r0 - .pool - thumb_func_end DuplicateDeoxysTiles - - thumb_func_start sub_8034C54 -sub_8034C54: @ 8034C54 - push {r4-r7,lr} - adds r4, r0, 0 - ldr r5, =0x02022e10 - ldr r0, [r5] - cmp r0, 0 - beq _08034C64 - bl sub_8034CC8 -_08034C64: - movs r0, 0x8 - bl Alloc - str r0, [r5] - cmp r0, 0 - bne _08034C78 - movs r0, 0 - b _08034CC0 - .pool -_08034C78: - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - bl Alloc - ldr r1, [r5] - str r0, [r1, 0x4] - cmp r0, 0 - bne _08034C94 - adds r0, r1, 0 - bl Free - movs r0, 0 - b _08034CC0 -_08034C94: - str r4, [r1] - movs r3, 0 - cmp r3, r4 - bcs _08034CBE - movs r7, 0 - movs r6, 0xFF - movs r2, 0 -_08034CA2: - ldr r0, [r5] - ldr r0, [r0, 0x4] - adds r0, r2, r0 - strb r7, [r0] - ldr r0, [r5] - ldr r1, [r0, 0x4] - adds r1, r2, r1 - ldrb r0, [r1, 0x1] - orrs r0, r6 - strb r0, [r1, 0x1] - adds r2, 0x1C - adds r3, 0x1 - cmp r3, r4 - bcc _08034CA2 -_08034CBE: - movs r0, 0x1 -_08034CC0: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8034C54 - - thumb_func_start sub_8034CC8 -sub_8034CC8: @ 8034CC8 - push {r4,r5,lr} - ldr r2, =0x02022e10 - ldr r1, [r2] - cmp r1, 0 - beq _08034D08 - ldr r0, [r1, 0x4] - cmp r0, 0 - beq _08034CFC - movs r4, 0 - ldr r0, [r1] - cmp r4, r0 - bcs _08034CF2 - adds r5, r2, 0 -_08034CE2: - adds r0, r4, 0 - bl sub_80353DC - adds r4, 0x1 - ldr r0, [r5] - ldr r0, [r0] - cmp r4, r0 - bcc _08034CE2 -_08034CF2: - ldr r0, =0x02022e10 - ldr r0, [r0] - ldr r0, [r0, 0x4] - bl Free -_08034CFC: - ldr r4, =0x02022e10 - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] -_08034D08: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8034CC8 - - thumb_func_start sub_8034D14 -sub_8034D14: @ 8034D14 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - mov r8, r0 - mov r10, r1 - adds r5, r2, 0 - ldr r6, =0x02022e10 - ldr r0, [r6] - cmp r0, 0 - beq _08034DD4 - ldr r1, [r0, 0x4] - mov r0, r8 - lsls r2, r0, 3 - subs r0, r2, r0 - lsls r4, r0, 2 - adds r1, r4, r1 - ldrb r0, [r1] - mov r9, r2 - cmp r0, 0 - bne _08034DD4 - ldrb r0, [r5, 0x1] - bl sub_8035518 - ldr r1, [r6] - ldr r1, [r1, 0x4] - adds r1, r4, r1 - strb r0, [r1, 0x1] - ldr r0, [r6] - ldr r0, [r0, 0x4] - adds r0, r4, r0 - ldrb r0, [r0, 0x1] - cmp r0, 0xFF - beq _08034DD4 - ldr r0, [r5, 0x8] - ldrh r0, [r0, 0x6] - bl GetObjectTileRangeStartByTag - ldr r2, [r6] - ldr r1, [r2, 0x4] - adds r1, r4, r1 - strh r0, [r1, 0xA] - ldr r0, [r2, 0x4] - adds r0, r4, r0 - ldrh r1, [r0, 0xA] - ldr r7, =0xffff0000 - lsrs r0, r7, 16 - cmp r1, r0 - bne _08034DE0 - ldr r2, [r5, 0x8] - ldrh r0, [r2, 0x4] - adds r1, r2, 0 - cmp r0, 0 - beq _08034D94 - adds r0, r1, 0 - bl LoadObjectPic - b _08034DB4 - .pool -_08034D94: - ldr r0, [r2] - ldr r1, [r2, 0x4] - str r0, [sp] - str r1, [sp, 0x4] - ldr r0, [r2] - bl sub_8034974 - lsls r0, 16 - lsrs r0, 16 - ldr r1, [sp, 0x4] - ands r1, r7 - orrs r1, r0 - str r1, [sp, 0x4] - mov r0, sp - bl LoadCompressedObjectPic -_08034DB4: - ldr r1, [r6] - ldr r1, [r1, 0x4] - adds r1, r4, r1 - strh r0, [r1, 0xA] - ldr r0, =0x02022e10 - ldr r0, [r0] - ldr r1, [r0, 0x4] - mov r2, r9 - mov r3, r8 - subs r0, r2, r3 - lsls r0, 2 - adds r0, r1 - ldrh r1, [r0, 0xA] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _08034DE0 -_08034DD4: - movs r0, 0 - b _08034EE8 - .pool -_08034DE0: - ldr r0, [r5, 0xC] - ldrh r0, [r0, 0x4] - bl IndexOfObjectPaletteTag - ldr r6, =0x02022e10 - ldr r1, [r6] - ldr r1, [r1, 0x4] - mov r4, r9 - mov r3, r8 - subs r2, r4, r3 - lsls r4, r2, 2 - adds r1, r4, r1 - strb r0, [r1, 0x4] - ldr r0, [r6] - ldr r0, [r0, 0x4] - adds r0, r4, r0 - ldrb r0, [r0, 0x4] - cmp r0, 0xFF - bne _08034E14 - ldr r0, [r5, 0xC] - bl LoadTaggedObjectPalette - ldr r1, [r6] - ldr r1, [r1, 0x4] - adds r1, r4, r1 - strb r0, [r1, 0x4] -_08034E14: - ldr r0, [r6] - ldr r1, [r0, 0x4] - adds r1, r4, r1 - ldrb r0, [r5] - lsls r0, 30 - lsrs r0, 30 - strb r0, [r1, 0x2] - ldr r0, [r6] - ldr r0, [r0, 0x4] - adds r0, r4, r0 - ldrb r1, [r5, 0x1] - strb r1, [r0, 0x3] - ldr r2, [r6] - ldr r0, [r2, 0x4] - adds r0, r4, r0 - ldrh r1, [r5, 0x4] - strh r1, [r0, 0xC] - ldr r0, [r2, 0x4] - adds r0, r4, r0 - ldrh r1, [r5, 0x6] - strh r1, [r0, 0xE] - ldr r1, [r2, 0x4] - adds r1, r4, r1 - ldrb r0, [r5] - lsls r0, 28 - lsrs r0, 30 - strb r0, [r1, 0x6] - ldr r0, [r6] - ldr r1, [r0, 0x4] - adds r1, r4, r1 - ldrb r0, [r5] - lsls r0, 26 - lsrs r0, 30 - strb r0, [r1, 0x5] - ldr r0, [r6] - ldr r1, [r0, 0x4] - adds r1, r4, r1 - ldrb r0, [r5] - lsrs r0, 6 - strb r0, [r1, 0x7] - ldr r0, [r6] - ldr r0, [r0, 0x4] - adds r0, r4, r0 - ldrb r1, [r5, 0x2] - strb r1, [r0, 0x8] - ldrb r1, [r5] - lsls r0, r1, 28 - lsrs r0, 30 - lsls r1, 26 - lsrs r1, 30 - bl sub_80355F8 - ldr r1, [r6] - ldr r1, [r1, 0x4] - adds r1, r4, r1 - strb r0, [r1, 0x9] - ldr r2, [r6] - ldr r0, [r2, 0x4] - adds r0, r4, r0 - ldr r1, [r5, 0x8] - ldrh r1, [r1, 0x6] - strh r1, [r0, 0x10] - ldr r0, [r2, 0x4] - adds r0, r4, r0 - ldr r1, [r5, 0xC] - ldrh r1, [r1, 0x4] - strh r1, [r0, 0x12] - ldr r0, [r2, 0x4] - adds r0, r4, r0 - movs r1, 0x1 - strb r1, [r0] - ldr r0, [r6] - ldr r0, [r0, 0x4] - adds r0, r4, r0 - str r1, [r0, 0x14] - movs r3, 0x1 - ldrb r0, [r5, 0x1] - cmp r3, r0 - bcs _08034ECA -_08034EB2: - ldr r0, [r6] - ldr r2, [r0, 0x4] - adds r2, r4, r2 - ldr r1, [r2, 0x14] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 1 - str r0, [r2, 0x14] - adds r3, 0x1 - ldrb r2, [r5, 0x1] - cmp r3, r2 - bcc _08034EB2 -_08034ECA: - ldr r0, =0x02022e10 - ldr r0, [r0] - mov r3, r9 - mov r4, r8 - subs r1, r3, r4 - lsls r1, 2 - ldr r0, [r0, 0x4] - adds r0, r1 - bl sub_8034EFC - mov r0, r8 - mov r1, r10 - bl sub_8035044 - movs r0, 0x1 -_08034EE8: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8034D14 - - thumb_func_start sub_8034EFC -sub_8034EFC: @ 8034EFC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r4, r0, 0 - ldrb r5, [r4, 0x1] - movs r0, 0xC - ldrsh r7, [r4, r0] - ldrb r0, [r4, 0x3] - adds r0, 0x1 - mov r8, r0 - mov r1, sp - movs r0, 0 - strh r0, [r1] - lsls r1, r5, 3 - ldr r2, =0x030022f8 - mov r9, r2 - add r1, r9 - mov r0, r8 - lsls r2, r0, 2 - movs r0, 0x80 - lsls r0, 17 - orrs r2, r0 - mov r0, sp - bl CpuSet - movs r6, 0 - ldrb r5, [r4, 0x1] - cmp r6, r8 - bcs _08034FCE - movs r1, 0x3F - mov r10, r1 - movs r2, 0xD - negs r2, r2 - mov r9, r2 -_08034F46: - lsls r0, r5, 3 - ldr r1, =0x030022c0 - adds r3, r0, r1 - ldrh r1, [r4, 0xE] - adds r0, r3, 0 - adds r0, 0x38 - strb r1, [r0] - ldr r2, =0x000001ff - adds r0, r2, 0 - adds r1, r7, 0 - ands r1, r0 - ldrh r2, [r3, 0x3A] - ldr r0, =0xfffffe00 - ands r0, r2 - orrs r0, r1 - strh r0, [r3, 0x3A] - ldrb r1, [r4, 0x6] - movs r0, 0x39 - adds r0, r3 - mov r12, r0 - lsls r1, 6 - ldrb r2, [r0] - mov r0, r10 - ands r0, r2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - ldrb r1, [r4, 0x5] - movs r2, 0x3B - adds r2, r3 - mov r12, r2 - lsls r1, 6 - ldrb r2, [r2] - mov r0, r10 - ands r0, r2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - ldrh r0, [r4, 0xA] - ldr r1, =0x000003ff - ands r1, r0 - ldrh r2, [r3, 0x3C] - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r3, 0x3C] - adds r3, 0x3D - movs r0, 0x3 - ldrb r1, [r4, 0x7] - ands r1, r0 - lsls r1, 2 - ldrb r2, [r3] - mov r0, r9 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - ldrb r2, [r4, 0x4] - lsls r2, 4 - movs r1, 0xF - ands r0, r1 - orrs r0, r2 - strb r0, [r3] - ldrb r0, [r4, 0x8] - adds r7, r0 - adds r6, 0x1 - adds r5, 0x1 - cmp r6, r8 - bcc _08034F46 -_08034FCE: - subs r5, 0x1 - ldr r0, =0x030022c0 - lsls r3, r5, 3 - adds r3, r0 - movs r2, 0xC - ldrsh r1, [r4, r2] - ldrb r0, [r4, 0x8] - subs r1, r0 - ldr r2, =0x000001ff - adds r0, r2, 0 - ands r1, r0 - ldrh r2, [r3, 0x3A] - ldr r0, =0xfffffe00 - ands r0, r2 - orrs r0, r1 - strh r0, [r3, 0x3A] - adds r2, r3, 0 - adds r2, 0x39 - ldrb r1, [r2] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2] - ldrb r0, [r4, 0x9] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 1 - ldrh r4, [r4, 0xA] - adds r1, r4 - ldr r2, =0x000003ff - adds r0, r2, 0 - ands r1, r0 - ldrh r2, [r3, 0x3C] - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r3, 0x3C] - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8034EFC - - thumb_func_start sub_8035044 -sub_8035044: @ 8035044 - push {r4-r6,lr} - adds r3, r0, 0 - adds r4, r1, 0 - ldr r0, =0x02022e10 - ldr r1, [r0] - adds r6, r0, 0 - cmp r1, 0 - beq _080350A8 - ldr r2, [r1, 0x4] - lsls r1, r3, 3 - subs r0, r1, r3 - lsls r0, 2 - adds r2, r0, r2 - ldrb r0, [r2] - adds r5, r1, 0 - cmp r0, 0 - beq _080350A8 - str r4, [r2, 0x18] - cmp r4, 0 - bge _08035078 - movs r2, 0x1 - negs r4, r4 - b _0803507A - .pool -_08035078: - movs r2, 0 -_0803507A: - ldr r0, [r6] - ldr r1, [r0, 0x4] - subs r0, r5, r3 - lsls r0, 2 - adds r0, r1 - ldrb r3, [r0, 0x2] - cmp r3, 0x1 - beq _0803509A - cmp r3, 0x1 - ble _08035092 - cmp r3, 0x2 - beq _080350A2 -_08035092: - adds r1, r4, 0 - bl sub_80350B0 - b _080350A8 -_0803509A: - adds r1, r4, 0 - bl sub_8035164 - b _080350A8 -_080350A2: - adds r1, r4, 0 - bl sub_80352C0 -_080350A8: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8035044 - - thumb_func_start sub_80350B0 -sub_80350B0: @ 80350B0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r8, r0 - mov r9, r1 - str r2, [sp] - ldr r5, [r0, 0x14] - ldrb r7, [r0, 0x1] - ldr r0, =0x030022c0 - mov r10, r0 - cmp r5, 0 - beq _0803511A - lsls r0, r7, 3 - adds r0, 0x3C - mov r1, r10 - adds r6, r0, r1 -_080350D6: - mov r0, r9 - adds r1, r5, 0 - bl __udivsi3 - adds r4, r0, 0 - adds r0, r4, 0 - muls r0, r5 - mov r2, r9 - subs r2, r0 - mov r9, r2 - adds r0, r5, 0 - movs r1, 0xA - bl __udivsi3 - adds r5, r0, 0 - mov r1, r8 - ldrb r0, [r1, 0x9] - adds r1, r4, 0 - muls r1, r0 - mov r2, r8 - ldrh r2, [r2, 0xA] - adds r1, r2 - ldr r2, =0x000003ff - adds r0, r2, 0 - ands r1, r0 - ldrh r0, [r6] - ldr r2, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r6] - adds r6, 0x8 - adds r7, 0x1 - cmp r5, 0 - bne _080350D6 -_0803511A: - ldr r0, [sp] - cmp r0, 0 - beq _08035140 - lsls r0, r7, 3 - add r0, r10 - adds r0, 0x39 - ldrb r2, [r0] - movs r1, 0x4 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - b _08035154 - .pool -_08035140: - lsls r2, r7, 3 - add r2, r10 - adds r2, 0x39 - ldrb r1, [r2] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2] -_08035154: - 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_80350B0 - - thumb_func_start sub_8035164 -sub_8035164: @ 8035164 - 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 - str r2, [sp] - ldr r5, [r6, 0x14] - ldr r3, =0x03000dd4 - ldrb r0, [r6, 0x1] - str r0, [r3] - ldr r2, =0x03000dd8 - movs r0, 0 - str r0, [r2] - ldr r1, =0x03000ddc - subs r0, 0x1 - str r0, [r1] - adds r7, r3, 0 - mov r10, r1 - ldr r0, =0x030022c0 - mov r9, r0 - cmp r5, 0 - beq _0803524C -_08035196: - mov r0, r8 - adds r1, r5, 0 - bl __udivsi3 - adds r4, r0, 0 - adds r0, r4, 0 - muls r0, r5 - mov r1, r8 - subs r1, r0 - mov r8, r1 - adds r0, r5, 0 - movs r1, 0xA - bl __udivsi3 - adds r5, r0, 0 - cmp r4, 0 - bne _080351C8 - mov r2, r10 - ldr r1, [r2] - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - bne _080351C8 - cmp r5, 0 - bne _08035224 -_080351C8: - ldr r2, [r7] - lsls r2, 3 - add r2, r9 - ldrb r0, [r6, 0x9] - adds r3, r4, 0 - muls r3, r0 - ldrh r4, [r6, 0xA] - adds r3, r4 - ldr r1, =0x000003ff - adds r0, r1, 0 - ands r3, r0 - ldrh r0, [r2, 0x3C] - ldr r4, =0xfffffc00 - adds r1, r4, 0 - ands r0, r1 - orrs r0, r3 - strh r0, [r2, 0x3C] - adds r2, 0x39 - ldrb r0, [r2] - movs r1, 0x4 - negs r1, r1 - ands r0, r1 - strb r0, [r2] - mov r2, r10 - ldr r1, [r2] - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - bne _0803523A - ldr r4, =0x03000dd8 - ldr r0, [r4] - str r0, [r2] - b _0803523A - .pool -_08035224: - ldr r0, [r7] - lsls r0, 3 - add r0, r9 - adds r0, 0x39 - ldrb r1, [r0] - movs r2, 0x4 - negs r2, r2 - ands r1, r2 - movs r2, 0x2 - orrs r1, r2 - strb r1, [r0] -_0803523A: - ldr r0, [r7] - adds r0, 0x1 - str r0, [r7] - ldr r4, =0x03000dd8 - ldr r0, [r4] - adds r0, 0x1 - str r0, [r4] - cmp r5, 0 - bne _08035196 -_0803524C: - ldr r0, [sp] - cmp r0, 0 - beq _08035298 - ldr r1, [r7] - lsls r1, 3 - add r1, r9 - adds r1, 0x39 - ldrb r2, [r1] - movs r0, 0x4 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r3, [r7] - lsls r3, 3 - add r3, r9 - movs r1, 0xC - ldrsh r2, [r6, r1] - mov r4, r10 - ldr r0, [r4] - subs r0, 0x1 - ldrb r1, [r6, 0x8] - muls r0, r1 - adds r2, r0 - ldr r1, =0x000001ff - adds r0, r1, 0 - ands r2, r0 - ldrh r1, [r3, 0x3A] - ldr r0, =0xfffffe00 - ands r0, r1 - orrs r0, r2 - strh r0, [r3, 0x3A] - b _080352AE - .pool -_08035298: - ldr r0, [r7] - lsls r0, 3 - add r0, r9 - adds r0, 0x39 - ldrb r2, [r0] - movs r1, 0x4 - negs r1, r1 - ands r1, r2 - movs r2, 0x2 - orrs r1, r2 - strb r1, [r0] -_080352AE: - 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_8035164 - - thumb_func_start sub_80352C0 -sub_80352C0: @ 80352C0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - mov r8, r0 - mov r10, r1 - str r2, [sp] - ldr r5, [r0, 0x14] - ldrb r3, [r0, 0x1] - movs r0, 0 - str r0, [sp, 0x4] - mov r9, r0 - cmp r5, 0 - beq _0803535A -_080352E0: - lsls r0, r3, 3 - adds r1, r0, 0 - adds r1, 0x39 - ldr r2, =0x030022c0 - adds r7, r1, r2 - adds r0, 0x3C - adds r6, r0, r2 -_080352EE: - mov r0, r10 - adds r1, r5, 0 - str r3, [sp, 0x8] - bl __udivsi3 - adds r4, r0, 0 - adds r0, r4, 0 - muls r0, r5 - mov r1, r10 - subs r1, r0 - mov r10, r1 - adds r0, r5, 0 - movs r1, 0xA - bl __udivsi3 - adds r5, r0, 0 - ldr r3, [sp, 0x8] - cmp r4, 0 - bne _0803531E - ldr r2, [sp, 0x4] - cmp r2, 0 - bne _0803531E - cmp r5, 0 - bne _080352E0 -_0803531E: - movs r0, 0x1 - str r0, [sp, 0x4] - mov r1, r8 - ldrb r0, [r1, 0x9] - adds r2, r4, 0 - muls r2, r0 - ldrh r4, [r1, 0xA] - adds r2, r4 - ldr r1, =0x000003ff - adds r0, r1, 0 - ands r2, r0 - ldrh r0, [r6] - ldr r4, =0xfffffc00 - adds r1, r4, 0 - ands r0, r1 - orrs r0, r2 - strh r0, [r6] - ldrb r0, [r7] - movs r2, 0x4 - negs r2, r2 - adds r1, r2, 0 - ands r0, r1 - strb r0, [r7] - adds r7, 0x8 - adds r6, 0x8 - adds r3, 0x1 - movs r4, 0x1 - add r9, r4 - cmp r5, 0 - bne _080352EE -_0803535A: - mov r0, r8 - ldrb r0, [r0, 0x3] - cmp r9, r0 - bge _0803538A - ldr r1, =0x030022c0 - movs r5, 0x4 - negs r5, r5 - movs r4, 0x2 - lsls r0, r3, 3 - adds r0, 0x39 - adds r2, r0, r1 -_08035370: - ldrb r1, [r2] - adds r0, r5, 0 - ands r0, r1 - orrs r0, r4 - strb r0, [r2] - adds r2, 0x8 - adds r3, 0x1 - movs r1, 0x1 - add r9, r1 - mov r0, r8 - ldrb r0, [r0, 0x3] - cmp r9, r0 - blt _08035370 -_0803538A: - ldr r1, [sp] - cmp r1, 0 - beq _080353B0 - lsls r0, r3, 3 - ldr r2, =0x030022c0 - adds r0, r2 - adds r0, 0x39 - ldrb r2, [r0] - movs r1, 0x4 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - b _080353C6 - .pool -_080353B0: - lsls r2, r3, 3 - ldr r4, =0x030022c0 - adds r2, r4 - adds r2, 0x39 - ldrb r1, [r2] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2] -_080353C6: - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80352C0 - - thumb_func_start sub_80353DC -sub_80353DC: @ 80353DC - push {r4-r7,lr} - adds r4, r0, 0 - ldr r0, =0x02022e10 - ldr r0, [r0] - cmp r0, 0 - beq _0803546E - ldr r2, [r0, 0x4] - lsls r1, r4, 3 - subs r0, r1, r4 - lsls r0, 2 - adds r2, r0, r2 - ldrb r0, [r2] - adds r5, r1, 0 - cmp r0, 0 - beq _0803546E - ldrb r3, [r2, 0x3] - adds r0, r3, 0x1 - ldrb r2, [r2, 0x1] - cmp r0, 0 - beq _08035426 - ldr r1, =0x030022c0 - movs r7, 0x4 - negs r7, r7 - movs r6, 0x2 - adds r3, r0, 0 - lsls r0, r2, 3 - adds r0, 0x39 - adds r2, r0, r1 -_08035414: - ldrb r1, [r2] - adds r0, r7, 0 - ands r0, r1 - orrs r0, r6 - strb r0, [r2] - subs r3, 0x1 - adds r2, 0x8 - cmp r3, 0 - bne _08035414 -_08035426: - adds r0, r4, 0 - bl sub_8035570 - cmp r0, 0 - bne _08035442 - ldr r0, =0x02022e10 - ldr r0, [r0] - ldr r1, [r0, 0x4] - subs r0, r5, r4 - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0, 0x10] - bl FreeObjectTilesByTag -_08035442: - adds r0, r4, 0 - bl sub_80355B4 - cmp r0, 0 - bne _0803545E - ldr r0, =0x02022e10 - ldr r0, [r0] - ldr r1, [r0, 0x4] - subs r0, r5, r4 - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0, 0x12] - bl FreeObjectPaletteByTag -_0803545E: - ldr r0, =0x02022e10 - ldr r0, [r0] - ldr r1, [r0, 0x4] - subs r0, r5, r4 - lsls r0, 2 - adds r0, r1 - movs r1, 0 - strb r1, [r0] -_0803546E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80353DC - - thumb_func_start sub_803547C -sub_803547C: @ 803547C - push {r4-r7,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldr r0, =0x02022e10 - ldr r1, [r0] - adds r7, r0, 0 - cmp r1, 0 - beq _0803550C - ldr r2, [r1, 0x4] - lsls r1, r4, 3 - subs r0, r1, r4 - lsls r0, 2 - adds r2, r0, r2 - ldrb r0, [r2] - adds r6, r1, 0 - cmp r0, 0 - beq _0803550C - ldrb r3, [r2, 0x3] - adds r1, r3, 0x1 - ldrb r0, [r2, 0x1] - cmp r5, 0 - beq _080354D8 - cmp r1, 0 - beq _0803550C - ldr r1, =0x030022c0 - movs r5, 0x4 - negs r5, r5 - movs r4, 0x2 - adds r3, 0x1 - lsls r0, 3 - adds r0, 0x39 - adds r2, r0, r1 -_080354BC: - ldrb r1, [r2] - adds r0, r5, 0 - ands r0, r1 - orrs r0, r4 - strb r0, [r2] - subs r3, 0x1 - adds r2, 0x8 - cmp r3, 0 - bne _080354BC - b _0803550C - .pool -_080354D8: - cmp r1, 0 - beq _080354FA - ldr r1, =0x030022c0 - movs r5, 0x4 - negs r5, r5 - adds r3, 0x1 - lsls r0, 3 - adds r0, 0x39 - adds r2, r0, r1 -_080354EA: - ldrb r1, [r2] - adds r0, r5, 0 - ands r0, r1 - strb r0, [r2] - subs r3, 0x1 - adds r2, 0x8 - cmp r3, 0 - bne _080354EA -_080354FA: - ldr r0, [r7] - ldr r1, [r0, 0x4] - subs r0, r6, r4 - lsls r0, 2 - adds r0, r1 - ldr r1, [r0, 0x18] - adds r0, r4, 0 - bl sub_8035044 -_0803550C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803547C - - thumb_func_start sub_8035518 -sub_8035518: @ 8035518 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r5, 0x40 - movs r3, 0 - ldr r0, =0x02022e10 - ldr r0, [r0] - ldr r2, [r0] - cmp r3, r2 - bcs _0803555A - ldr r1, [r0, 0x4] -_0803552E: - ldrb r0, [r1] - cmp r0, 0 - bne _08035548 - ldrb r0, [r1, 0x1] - cmp r0, 0xFF - beq _08035552 - ldrb r0, [r1, 0x3] - cmp r0, r4 - bhi _08035552 - ldrb r0, [r1, 0x1] - b _0803556A - .pool -_08035548: - adds r0, r5, 0x1 - ldrb r5, [r1, 0x3] - adds r0, r5 - lsls r0, 16 - lsrs r5, r0, 16 -_08035552: - adds r1, 0x1C - adds r3, 0x1 - cmp r3, r2 - bcc _0803552E -_0803555A: - adds r0, r5, r4 - adds r0, 0x1 - cmp r0, 0x80 - bgt _08035568 - lsls r0, r5, 24 - lsrs r0, 24 - b _0803556A -_08035568: - movs r0, 0xFF -_0803556A: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8035518 - - thumb_func_start sub_8035570 -sub_8035570: @ 8035570 - push {r4-r6,lr} - adds r3, r0, 0 - movs r2, 0 - ldr r0, =0x02022e10 - ldr r0, [r0] - ldr r4, [r0] - cmp r2, r4 - bcs _080355AC - ldr r1, [r0, 0x4] - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r5, r0, r1 -_0803558A: - ldrb r0, [r1] - cmp r0, 0 - beq _080355A4 - cmp r2, r3 - beq _080355A4 - ldrh r0, [r1, 0x10] - ldrh r6, [r5, 0x10] - cmp r0, r6 - bne _080355A4 - movs r0, 0x1 - b _080355AE - .pool -_080355A4: - adds r1, 0x1C - adds r2, 0x1 - cmp r2, r4 - bcc _0803558A -_080355AC: - movs r0, 0 -_080355AE: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8035570 - - thumb_func_start sub_80355B4 -sub_80355B4: @ 80355B4 - push {r4-r6,lr} - adds r3, r0, 0 - movs r2, 0 - ldr r0, =0x02022e10 - ldr r0, [r0] - ldr r4, [r0] - cmp r2, r4 - bcs _080355F0 - ldr r1, [r0, 0x4] - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r5, r0, r1 -_080355CE: - ldrb r0, [r1] - cmp r0, 0 - beq _080355E8 - cmp r2, r3 - beq _080355E8 - ldrh r0, [r1, 0x12] - ldrh r6, [r5, 0x12] - cmp r0, r6 - bne _080355E8 - movs r0, 0x1 - b _080355F2 - .pool -_080355E8: - adds r1, 0x1C - adds r2, 0x1 - cmp r2, r4 - bcc _080355CE -_080355F0: - movs r0, 0 -_080355F2: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80355B4 - - thumb_func_start sub_80355F8 -sub_80355F8: @ 80355F8 - ldr r2, =gUnknown_082FF1C8 - lsls r0, 2 - adds r1, r0 - adds r1, r2 - ldrb r0, [r1] - bx lr - .pool - thumb_func_end sub_80355F8 - - thumb_func_start sub_8035608 -sub_8035608: @ 8035608 - push {lr} - bl ResetAllObjectData - ldr r0, =gUnknown_0831AC88 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - ldr r0, =sub_8035648 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8035608 - - thumb_func_start sub_8035648 -sub_8035648: @ 8035648 - push {lr} - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - pop {r0} - bx r0 - thumb_func_end sub_8035648 - - thumb_func_start trs_config -trs_config: @ 8035658 - push {r4,lr} - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0831AA08 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 11 - ands r1, r0 - cmp r1, 0 - beq _080356A4 - ldr r0, =0x02024474 - adds r0, 0x24 - movs r1, 0x1 - strb r1, [r0] - ldr r4, =0x02023060 - ldr r1, [r4] - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - movs r0, 0x2 - bl SetBgTilemapBuffer - b _080356AA - .pool -_080356A4: - ldr r0, =0x02024474 - adds r0, 0x24 - strb r1, [r0] -_080356AA: - ldr r1, =gUnknown_0831ABA0 - ldr r0, =0x02024474 - adds r0, 0x24 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl InitWindows - bl DeactivateAllTextPrinters - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end trs_config - - thumb_func_start c2_berry_program_update_menu -c2_berry_program_update_menu: @ 80356D0 - push {lr} - movs r0, 0x2 - bl DisableInterrupts - movs r0, 0xC5 - bl EnableInterrupts - bl trs_config - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - ldr r1, =0x0000b040 - movs r0, 0 - bl SetGpuReg - pop {r0} - bx r0 - .pool - thumb_func_end c2_berry_program_update_menu - - thumb_func_start sub_803570C -sub_803570C: @ 803570C - push {lr} - movs r0, 0x2 - movs r1, 0x12 - movs r2, 0x10 - bl sub_809882C - movs r0, 0x2 - movs r1, 0x22 - movs r2, 0x10 - bl sub_809882C - ldr r0, =gUnknown_08D85600 - movs r1, 0x50 - movs r2, 0x20 - bl decompress_palette - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - beq _0803575A - movs r0, 0x70 - bl sub_81978B0 - movs r0, 0 - movs r1, 0x30 - movs r2, 0x70 - bl copy_textbox_border_tile_patterns_to_vram - ldr r0, =0x02037714 - adds r0, 0xEC - movs r1, 0 - strh r1, [r0] - ldr r1, =0x02037c00 - movs r2, 0x1 - bl CpuSet -_0803575A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_803570C - - thumb_func_start load_battle_oval_graphics -load_battle_oval_graphics: @ 8035770 - push {r4,r5,lr} - ldr r0, =0x02022fec - ldr r1, [r0] - ldr r0, =0x023f0902 - ands r0, r1 - cmp r0, 0 - beq _080357B0 - ldr r0, =gUnknown_08D7C440 - ldr r1, =0x06008000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7CA28 - ldr r1, =0x0600d000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7C9EC - b _08035A52 - .pool -_080357B0: - movs r0, 0x80 - lsls r0, 21 - ands r0, r1 - cmp r0, 0 - beq _080357E4 - ldr r0, =gUnknown_08D7BB14 - ldr r1, =0x06008000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7C154 - ldr r1, =0x0600d000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7DF30 - b _08035A52 - .pool -_080357E4: - movs r0, 0x80 - lsls r0, 22 - ands r0, r1 - cmp r0, 0 - beq _08035818 - ldr r0, =gUnknown_08D7A108 - ldr r1, =0x06008000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7A720 - ldr r1, =0x0600d000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7DEF4 - b _08035A52 - .pool -_08035818: - movs r0, 0x80 - lsls r0, 23 - ands r0, r1 - cmp r0, 0 - beq _0803584C - ldr r0, =gUnknown_08D7D590 - ldr r1, =0x06008000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7DC04 - ldr r1, =0x0600d000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7E234 - b _08035A52 - .pool -_0803584C: - movs r0, 0x8 - ands r1, r0 - cmp r1, 0 - beq _080358C4 - ldr r2, =gTrainers - ldr r0, =0x02038bca - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0x20 - bne _08035898 - ldr r0, =gUnknown_08D7C440 - ldr r1, =0x06008000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7CA28 - ldr r1, =0x0600d000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7DFC4 - b _08035A52 - .pool -_08035898: - cmp r0, 0x26 - bne _080358C4 - ldr r0, =gUnknown_08D7CCD8 - ldr r1, =0x06008000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7D2E0 - ldr r1, =0x0600d000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7E1F8 - b _08035A52 - .pool -_080358C4: - bl sav1_map_get_battletype - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x8 - bhi _08035904 - lsls r0, 2 - ldr r1, =_080358E0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080358E0: - .4byte _08035904 - .4byte _08035950 - .4byte _08035978 - .4byte _080359A0 - .4byte _080359C8 - .4byte _080359F0 - .4byte _08035A18 - .4byte _08035A40 - .4byte _08035A70 -_08035904: - ldr r4, =gUnknown_0831ABA8 - ldr r5, =0x02022ff0 - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r0, [r0] - ldr r1, =0x06008000 - bl LZDecompressVram - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0x4 - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x0600d000 - bl LZDecompressVram - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r4, 0x10 - adds r0, r4 - ldr r0, [r0] - b _08035A52 - .pool -_08035950: - ldr r0, =gUnknown_08D7C440 - ldr r1, =0x06008000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7CA28 - ldr r1, =0x0600d000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7DF88 - b _08035A52 - .pool -_08035978: - ldr r0, =gUnknown_08D7CCD8 - ldr r1, =0x06008000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7D2E0 - ldr r1, =0x0600d000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7E060 - b _08035A52 - .pool -_080359A0: - ldr r0, =gUnknown_08D7CCD8 - ldr r1, =0x06008000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7D2E0 - ldr r1, =0x0600d000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7E000 - b _08035A52 - .pool -_080359C8: - ldr r0, =gUnknown_08D7CCD8 - ldr r1, =0x06008000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7D2E0 - ldr r1, =0x0600d000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7E0CC - b _08035A52 - .pool -_080359F0: - ldr r0, =gUnknown_08D7CCD8 - ldr r1, =0x06008000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7D2E0 - ldr r1, =0x0600d000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7E11C - b _08035A52 - .pool -_08035A18: - ldr r0, =gUnknown_08D7CCD8 - ldr r1, =0x06008000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7D2E0 - ldr r1, =0x0600d000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7E164 - b _08035A52 - .pool -_08035A40: - ldr r0, =gUnknown_08D7CCD8 - ldr r1, =0x06008000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7D2E0 - ldr r1, =0x0600d000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7E1A8 -_08035A52: - movs r1, 0x20 - movs r2, 0x60 - bl decompress_palette - b _08035A8A - .pool -_08035A70: - ldr r0, =gUnknown_08D7C440 - ldr r1, =0x06008000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7CA28 - ldr r1, =0x0600d000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7C9EC - movs r1, 0x20 - movs r2, 0x60 - bl decompress_palette -_08035A8A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end load_battle_oval_graphics - - thumb_func_start sub_8035AA4 -sub_8035AA4: @ 8035AA4 - push {lr} - ldr r0, =gUnknown_08C00000 - movs r1, 0xC0 - lsls r1, 19 - bl LZDecompressVram - ldr r1, =gUnknown_08C00524 - movs r0, 0 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r0, =gUnknown_08C004E0 - movs r1, 0 - movs r2, 0x40 - bl decompress_palette - bl sub_803570C - bl load_battle_oval_graphics - pop {r0} - bx r0 - .pool - thumb_func_end sub_8035AA4 - - thumb_func_start sub_8035AE4 -sub_8035AE4: @ 8035AE4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x18 - ldr r4, [sp, 0x34] - lsls r0, 24 - lsrs r6, r0, 24 - adds r7, r6, 0 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r3, 24 - lsrs r3, 24 - mov r12, r3 - lsls r4, 24 - lsrs r4, 24 - mov r9, r4 - movs r4, 0 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08035BCC - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - movs r2, 0x12 - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _08035B56 - cmp r5, 0x1 - beq _08035B7E - cmp r5, 0x1 - bgt _08035B44 - cmp r5, 0 - beq _08035B4E - b _08035B88 - .pool -_08035B44: - cmp r5, 0x2 - beq _08035B52 - cmp r5, 0x3 - beq _08035B72 - b _08035B88 -_08035B4E: - ldrh r0, [r1, 0xE] - b _08035B74 -_08035B52: - ldrh r1, [r1, 0xE] - b _08035B80 -_08035B56: - cmp r5, 0x1 - beq _08035B72 - cmp r5, 0x1 - bgt _08035B64 - cmp r5, 0 - beq _08035B6E - b _08035B88 -_08035B64: - cmp r5, 0x2 - beq _08035B7A - cmp r5, 0x3 - beq _08035B7E - b _08035B88 -_08035B6E: - ldrh r0, [r1, 0xE] - b _08035B74 -_08035B72: - ldrh r0, [r1, 0x10] -_08035B74: - movs r4, 0x3F - ands r4, r0 - b _08035B88 -_08035B7A: - ldrh r1, [r1, 0xE] - b _08035B80 -_08035B7E: - ldrh r1, [r1, 0x10] -_08035B80: - movs r0, 0xFC - lsls r0, 4 - ands r0, r1 - lsrs r4, r0, 6 -_08035B88: - movs r2, 0 - movs r6, 0x3 - ldr r0, =0x00006001 - adds r5, r0, 0 - add r3, sp, 0xC -_08035B92: - lsls r1, r2, 1 - adds r0, r6, 0 - lsls r0, r1 - ands r0, r4 - asrs r0, r1 - adds r0, r5 - strh r0, [r3] - adds r3, 0x2 - adds r2, 0x1 - cmp r2, 0x2 - ble _08035B92 - movs r0, 0x3 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - mov r0, r8 - add r1, sp, 0xC - mov r2, r12 - mov r3, r9 - bl CopyToBgTilemapBufferRect_ChangePalette - mov r0, r8 - bl CopyBgTilemapBufferToVram - b _08035C36 - .pool -_08035BCC: - ldr r0, =0x02024474 - adds r0, 0x25 - ldrb r0, [r0] - cmp r5, r0 - bne _08035BEC - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldrh r4, [r0, 0xE] - b _08035BF8 - .pool -_08035BEC: - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldrh r4, [r0, 0x10] -_08035BF8: - movs r2, 0 - movs r6, 0x3 - ldr r0, =0x00006001 - adds r5, r0, 0 - add r3, sp, 0xC -_08035C02: - lsls r1, r2, 1 - adds r0, r6, 0 - lsls r0, r1 - ands r0, r4 - asrs r0, r1 - adds r0, r5 - strh r0, [r3] - adds r3, 0x2 - adds r2, 0x1 - cmp r2, 0x5 - ble _08035C02 - movs r0, 0x6 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - mov r0, r8 - add r1, sp, 0xC - mov r2, r12 - mov r3, r9 - bl CopyToBgTilemapBufferRect_ChangePalette - mov r0, r8 - bl CopyBgTilemapBufferToVram -_08035C36: - add sp, 0x18 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8035AE4 - - thumb_func_start sub_8035C4C -sub_8035C4C: @ 8035C4C - push {lr} - ldr r0, =0x0202433a - ldrb r2, [r0] - cmp r2, 0x3 - bne _08035C68 - ldr r0, =gUnknown_085CCBAD - movs r1, 0x15 - bl battle_show_message_maybe - b _08035D68 - .pool -_08035C68: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08035CE2 - cmp r2, 0x1 - bne _08035CAE - ldr r2, =0x020229e8 - ldr r0, =0x02024474 - adds r0, 0x25 - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x18] - cmp r0, 0x1 - beq _08035CFC - cmp r0, 0x1 - bgt _08035CA4 - cmp r0, 0 - beq _08035D36 - b _08035D68 - .pool -_08035CA4: - cmp r0, 0x2 - beq _08035D36 - cmp r0, 0x3 - bne _08035D68 - b _08035CFC -_08035CAE: - ldr r2, =0x020229e8 - ldr r0, =0x02024474 - adds r0, 0x25 - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x18] - cmp r0, 0x1 - beq _08035D36 - cmp r0, 0x1 - bgt _08035CD8 - cmp r0, 0 - beq _08035CFC - b _08035D68 - .pool -_08035CD8: - cmp r0, 0x2 - beq _08035CFC - cmp r0, 0x3 - bne _08035D68 - b _08035D36 -_08035CE2: - cmp r2, 0x1 - bne _08035D20 - ldr r2, =0x020229e8 - ldr r0, =0x02024474 - adds r0, 0x25 - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x18] - cmp r0, 0 - beq _08035D36 -_08035CFC: - ldr r0, =gUnknown_085CCB9E - movs r1, 0x17 - bl battle_show_message_maybe - ldr r0, =gUnknown_085CCBA5 - movs r1, 0x16 - bl battle_show_message_maybe - b _08035D68 - .pool -_08035D20: - ldr r2, =0x020229e8 - ldr r0, =0x02024474 - adds r0, 0x25 - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x18] - cmp r0, 0 - beq _08035D58 -_08035D36: - ldr r0, =gUnknown_085CCB9E - movs r1, 0x16 - bl battle_show_message_maybe - ldr r0, =gUnknown_085CCBA5 - movs r1, 0x17 - bl battle_show_message_maybe - b _08035D68 - .pool -_08035D58: - ldr r0, =gUnknown_085CCB9E - movs r1, 0x17 - bl battle_show_message_maybe - ldr r0, =gUnknown_085CCBA5 - movs r1, 0x16 - bl battle_show_message_maybe -_08035D68: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8035C4C - - thumb_func_start task00_0800F6FC -task00_0800F6FC: @ 8035D74 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r7, 2 - mov r8, r0 - adds r0, r7 - lsls r0, 3 - adds r5, r0, r1 - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0x1 - bne _08035D96 - b _08035EC4 -_08035D96: - cmp r0, 0x1 - bgt _08035DA4 - cmp r0, 0 - beq _08035DAC - b _08036138 - .pool -_08035DA4: - cmp r0, 0x2 - bne _08035DAA - b _08035F64 -_08035DAA: - b _08036138 -_08035DAC: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08035E44 - movs r5, 0 - movs r6, 0x3 -_08035DBC: - ldr r0, =0x020229f0 - adds r1, r5, r0 - subs r0, 0x8 - adds r4, r5, r0 - ldrh r0, [r4, 0x18] - cmp r0, 0x1 - beq _08035DF4 - cmp r0, 0x1 - bgt _08035DDC - cmp r0, 0 - beq _08035DE6 - b _08035E3A - .pool -_08035DDC: - cmp r0, 0x2 - beq _08035E08 - cmp r0, 0x3 - beq _08035E22 - b _08035E3A -_08035DE6: - adds r0, r1, 0 - movs r1, 0x11 - bl battle_show_message_maybe - ldrb r1, [r4, 0x18] - movs r0, 0x4 - b _08035E14 -_08035DF4: - adds r0, r1, 0 - movs r1, 0x12 - bl battle_show_message_maybe - ldrb r1, [r4, 0x18] - movs r0, 0x4 - str r0, [sp] - adds r0, r7, 0 - movs r2, 0x2 - b _08035E1A -_08035E08: - adds r0, r1, 0 - movs r1, 0x13 - bl battle_show_message_maybe - ldrb r1, [r4, 0x18] - movs r0, 0x8 -_08035E14: - str r0, [sp] - adds r0, r7, 0 - movs r2, 0x1 -_08035E1A: - movs r3, 0x2 - bl sub_8035AE4 - b _08035E3A -_08035E22: - adds r0, r1, 0 - movs r1, 0x14 - bl battle_show_message_maybe - ldrb r1, [r4, 0x18] - movs r0, 0x8 - str r0, [sp] - adds r0, r7, 0 - movs r2, 0x2 - movs r3, 0x2 - bl sub_8035AE4 -_08035E3A: - adds r5, 0x1C - subs r6, 0x1 - cmp r6, 0 - bge _08035DBC - b _08035EA6 -_08035E44: - ldr r0, =0x02024474 - adds r0, 0x25 - ldrb r5, [r0] - movs r0, 0x1 - adds r6, r5, 0 - eors r6, r0 - adds r1, r6, 0 - ldr r4, =0x020229e8 - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - adds r0, r4 - ldrh r0, [r0, 0x18] - cmp r0, 0 - beq _08035E66 - adds r6, r5, 0 - adds r5, r1, 0 -_08035E66: - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - adds r4, 0x8 - adds r1, r0, r4 - adds r0, r1, 0 - movs r1, 0xF - bl battle_show_message_maybe - lsls r0, r6, 3 - subs r0, r6 - lsls r0, 2 - adds r1, r0, r4 - adds r0, r1, 0 - movs r1, 0x10 - bl battle_show_message_maybe - movs r4, 0x7 - str r4, [sp] - adds r0, r7, 0 - adds r1, r5, 0 - movs r2, 0x1 - movs r3, 0x2 - bl sub_8035AE4 - str r4, [sp] - adds r0, r7, 0 - adds r1, r6, 0 - movs r2, 0x2 - movs r3, 0x2 - bl sub_8035AE4 -_08035EA6: - ldr r0, =0x03005e00 - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _08036138 - .pool -_08035EC4: - ldr r0, =0x00002710 - bl AllocObjectPalette - lsls r0, 24 - ldr r2, =0x02037714 - lsrs r0, 19 - ldr r3, =0x0000021e - adds r0, r3 - adds r2, r0, r2 - ldr r1, =0x02037b14 - adds r0, r1 - ldr r1, =0x00007fff - strh r1, [r0] - strh r1, [r2] - ldr r0, =gUnknown_0831A9D0 - movs r1, 0x6F - movs r2, 0x50 - movs r3, 0 - bl AddObjectToFront - ldr r4, =0x0202449c - ldr r1, [r4] - adds r1, 0x7D - strb r0, [r1] - ldr r0, =gUnknown_0831A9E8 - movs r1, 0x81 - movs r2, 0x50 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r4] - adds r1, 0x7E - strb r0, [r1] - ldr r3, =0x02020630 - ldr r0, [r4] - adds r0, 0x7D - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r4] - adds r0, 0x7E - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - b _08036138 - .pool -_08035F64: - movs r1, 0x12 - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _08035FCC - ldr r4, =0x02022e18 - ldrh r0, [r5, 0xA] - bl sine2 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _08035F7E - adds r0, 0x1F -_08035F7E: - asrs r1, r0, 5 - movs r2, 0x14 - negs r2, r2 - adds r0, r2, 0 - subs r0, r1 - strh r0, [r4] - ldr r4, =0x02022e1c - ldrh r0, [r5, 0xC] - bl sine2 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _08035F9C - adds r0, 0x1F -_08035F9C: - asrs r1, r0, 5 - movs r3, 0x8C - negs r3, r3 - adds r0, r3, 0 - subs r0, r1 - strh r0, [r4] - ldr r0, =0x02022e1a - ldr r2, =0x0000ffdc - adds r1, r2, 0 - strh r1, [r0] - ldr r0, =0x02022e1e - strh r1, [r0] - b _08036038 - .pool -_08035FCC: - ldr r4, =0x02022e18 - ldrh r0, [r5, 0xA] - bl sine2 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _08035FDE - adds r0, 0x1F -_08035FDE: - asrs r1, r0, 5 - movs r3, 0x14 - negs r3, r3 - adds r0, r3, 0 - subs r0, r1 - strh r0, [r4] - ldr r4, =0x02022e1a - ldrh r0, [r5, 0xA] - bl cosine2 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _08035FFC - adds r0, 0x1F -_08035FFC: - asrs r0, 5 - subs r0, 0xA4 - strh r0, [r4] - ldr r4, =0x02022e1c - ldrh r0, [r5, 0xC] - bl sine2 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _08036014 - adds r0, 0x1F -_08036014: - asrs r1, r0, 5 - movs r2, 0x8C - negs r2, r2 - adds r0, r2, 0 - subs r0, r1 - strh r0, [r4] - ldr r4, =0x02022e1e - ldrh r0, [r5, 0xC] - bl cosine2 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _08036032 - adds r0, 0x1F -_08036032: - asrs r0, 5 - subs r0, 0xA4 - strh r0, [r4] -_08036038: - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r1, r0, r1 - ldrh r0, [r1, 0xC] - movs r2, 0xC - ldrsh r3, [r1, r2] - mov r8, r3 - cmp r3, 0 - beq _08036070 - subs r0, 0x2 - strh r0, [r1, 0xC] - ldrh r0, [r1, 0xA] - adds r0, 0x2 - strh r0, [r1, 0xA] - b _08036138 - .pool -_08036070: - movs r3, 0x12 - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _0803607C - bl sub_8035C4C -_0803607C: - movs r0, 0x78 - bl audio_play - adds r0, r7, 0 - bl remove_task - ldr r4, =0x02020630 - ldr r5, =0x0202449c - ldr r0, [r5] - adds r0, 0x7D - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - ldr r0, [r5] - adds r0, 0x7E - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - ldr r5, [r5] - adds r6, r5, 0 - adds r6, 0x7E - ldrb r0, [r6] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r4 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x40 - ldr r7, =0x000003ff - adds r0, r7, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r3 - orrs r0, r1 - strh r0, [r2, 0x4] - adds r5, 0x7D - ldrb r1, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - mov r1, r8 - strh r1, [r0, 0x2E] - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x1 - strh r1, [r0, 0x2E] - ldrb r1, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x20] - strh r1, [r0, 0x30] - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x20] - strh r1, [r0, 0x30] - ldrb r1, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - mov r2, r8 - strh r2, [r0, 0x32] - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r2, [r0, 0x32] -_08036138: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end task00_0800F6FC - - thumb_func_start sub_8036154 -sub_8036154: @ 8036154 - push {r4,r5,lr} - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08036208 - ldr r0, =gUnknown_08D778F0 - ldr r1, =0x06004000 - bl LZDecompressVram - ldr r0, =gUnknown_08D77B0C - ldr r1, =0x06010000 - bl LZDecompressVram - ldr r0, =gUnknown_08D77AE4 - movs r1, 0x60 - movs r2, 0x20 - bl decompress_palette - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0x1 - bl SetBgAttribute - ldr r1, =0x00005c04 - movs r0, 0xA - bl SetGpuReg - ldr r4, =gUnknown_08D779D8 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - movs r0, 0x2 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - movs r0, 0x48 - movs r1, 0x36 - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x36 - bl SetGpuReg - ldr r0, =0x02022e1a - ldr r2, =0x0000ff5c - adds r1, r2, 0 - strh r1, [r0] - ldr r0, =0x02022e1e - strh r1, [r0] - ldr r0, =gUnknown_0831AA00 - bl LoadCompressedObjectPicUsingHeap - b _080363AC - .pool -_08036208: - ldr r0, =0x023f0902 - ands r0, r1 - cmp r0, 0 - beq _0803628C - movs r0, 0x80 - lsls r0, 15 - ands r1, r0 - cmp r1, 0 - beq _08036224 - ldr r0, =0x02038bce - ldrh r1, [r0] - ldr r0, =0x00000c03 - cmp r1, r0 - bne _08036248 -_08036224: - ldr r0, =gUnknown_08D820D4 - ldr r1, =0x06004000 - bl LZDecompressVram - ldr r0, =gUnknown_08D824E4 - b _08036382 - .pool -_08036248: - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x2 - bl SetBgAttribute - movs r0, 0x2 - movs r1, 0x1 - movs r2, 0x2 - bl SetBgAttribute - ldr r1, =gUnknown_08D857A8 - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - ldr r1, =gUnknown_08D85A1C - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - b _080363AC - .pool -_0803628C: - movs r0, 0x80 - lsls r0, 21 - ands r0, r1 - cmp r0, 0 - beq _080362B0 - ldr r0, =gUnknown_08D81610 - ldr r1, =0x06004000 - bl LZDecompressVram - ldr r0, =gUnknown_08D81E2C - b _08036382 - .pool -_080362B0: - movs r0, 0x80 - lsls r0, 22 - ands r0, r1 - cmp r0, 0 - beq _080362D4 - ldr r0, =gUnknown_08D7F9F8 - ldr r1, =0x06004000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7FEC4 - b _08036382 - .pool -_080362D4: - movs r0, 0x80 - lsls r0, 23 - ands r0, r1 - cmp r0, 0 - beq _080362F8 - ldr r0, =gUnknown_08D82608 - ldr r1, =0x06004000 - bl LZDecompressVram - ldr r0, =gUnknown_08D82C70 - b _08036382 - .pool -_080362F8: - movs r0, 0x8 - ands r1, r0 - cmp r1, 0 - beq _08036350 - ldr r2, =gTrainers - ldr r0, =0x02038bca - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0x20 - bne _08036334 - ldr r0, =gUnknown_08D820D4 - ldr r1, =0x06004000 - bl LZDecompressVram - ldr r0, =gUnknown_08D824E4 - b _08036382 - .pool -_08036334: - cmp r0, 0x26 - bne _08036350 - ldr r0, =gUnknown_08D820D4 - ldr r1, =0x06004000 - bl LZDecompressVram - ldr r0, =gUnknown_08D824E4 - b _08036382 - .pool -_08036350: - bl sav1_map_get_battletype - lsls r0, 24 - cmp r0, 0 - bne _0803639C - ldr r4, =gUnknown_0831ABA8 - ldr r5, =0x02022ff0 - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x8 - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x06004000 - bl LZDecompressVram - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r4, 0xC - adds r0, r4 - ldr r0, [r0] -_08036382: - ldr r1, =0x0600e000 - bl LZDecompressVram - b _080363AC - .pool -_0803639C: - ldr r0, =gUnknown_08D820D4 - ldr r1, =0x06004000 - bl LZDecompressVram - ldr r0, =gUnknown_08D824E4 - ldr r1, =0x0600e000 - bl LZDecompressVram -_080363AC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8036154 - - thumb_func_start sub_80363C4 -sub_80363C4: @ 80363C4 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - movs r4, 0 - cmp r0, 0x6 - bls _080363D2 - b _08036756 -_080363D2: - lsls r0, 2 - ldr r1, =_080363E0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080363E0: - .4byte _080363FC - .4byte _0803640C - .4byte _08036424 - .4byte _08036434 - .4byte _0803652C - .4byte _08036638 - .4byte _08036750 -_080363FC: - ldr r0, =gUnknown_08C00000 - movs r1, 0xC0 - lsls r1, 19 - bl LZDecompressVram - b _08036758 - .pool -_0803640C: - ldr r1, =gUnknown_08C00524 - movs r0, 0 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - movs r0, 0 - bl CopyBgTilemapBufferToVram - b _08036758 - .pool -_08036424: - ldr r0, =gUnknown_08C004E0 - movs r1, 0 - movs r2, 0x40 - bl decompress_palette - b _08036758 - .pool -_08036434: - ldr r0, =0x02022fec - ldr r1, [r0] - ldr r0, =0x023f0902 - ands r0, r1 - cmp r0, 0 - bne _08036518 - movs r0, 0x80 - lsls r0, 21 - ands r0, r1 - cmp r0, 0 - beq _0803645C - ldr r0, =gUnknown_08D7BB14 - b _0803651A - .pool -_0803645C: - movs r0, 0x8 - ands r1, r0 - cmp r1, 0 - beq _0803648C - ldr r2, =gTrainers - ldr r0, =0x02038bca - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0x20 - beq _08036518 - cmp r0, 0x26 - bne _0803648C - ldr r0, =gUnknown_08D7CCD8 - b _0803651A - .pool -_0803648C: - bl sav1_map_get_battletype - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x8 - bhi _080364CC - lsls r0, 2 - ldr r1, =_080364A8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080364A8: - .4byte _080364CC - .4byte _08036518 - .4byte _080364E8 - .4byte _080364F0 - .4byte _080364F8 - .4byte _08036500 - .4byte _08036508 - .4byte _08036510 - .4byte _08036518 -_080364CC: - ldr r2, =gUnknown_0831ABA8 - ldr r0, =0x02022ff0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - b _0803651A - .pool -_080364E8: - ldr r0, =gUnknown_08D7CCD8 - b _0803651A - .pool -_080364F0: - ldr r0, =gUnknown_08D7CCD8 - b _0803651A - .pool -_080364F8: - ldr r0, =gUnknown_08D7CCD8 - b _0803651A - .pool -_08036500: - ldr r0, =gUnknown_08D7CCD8 - b _0803651A - .pool -_08036508: - ldr r0, =gUnknown_08D7CCD8 - b _0803651A - .pool -_08036510: - ldr r0, =gUnknown_08D7CCD8 - b _0803651A - .pool -_08036518: - ldr r0, =gUnknown_08D7C440 -_0803651A: - ldr r1, =0x06008000 - bl LZDecompressVram - b _08036758 - .pool -_0803652C: - ldr r0, =0x02022fec - ldr r1, [r0] - ldr r0, =0x023f0902 - ands r0, r1 - cmp r0, 0 - beq _0803653A - b _08036624 -_0803653A: - movs r0, 0x80 - lsls r0, 5 - ands r0, r1 - cmp r0, 0 - beq _08036568 - ldr r0, =gUnknown_82E9530 - ldrb r0, [r0] - cmp r0, 0x2 - bne _08036560 - ldr r0, =gUnknown_08D7C154 - b _08036626 - .pool -_08036560: - ldr r0, =gUnknown_08D7A720 - b _08036626 - .pool -_08036568: - movs r0, 0x8 - ands r1, r0 - cmp r1, 0 - beq _08036598 - ldr r2, =gTrainers - ldr r0, =0x02038bca - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0x20 - beq _08036624 - cmp r0, 0x26 - bne _08036598 - ldr r0, =gUnknown_08D7D2E0 - b _08036626 - .pool -_08036598: - bl sav1_map_get_battletype - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x8 - bhi _080365D8 - lsls r0, 2 - ldr r1, =_080365B4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080365B4: - .4byte _080365D8 - .4byte _08036624 - .4byte _080365F4 - .4byte _080365FC - .4byte _08036604 - .4byte _0803660C - .4byte _08036614 - .4byte _0803661C - .4byte _08036624 -_080365D8: - ldr r2, =gUnknown_0831ABA8 - ldr r0, =0x02022ff0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, 0x4 - adds r0, r2 - ldr r0, [r0] - b _08036626 - .pool -_080365F4: - ldr r0, =gUnknown_08D7D2E0 - b _08036626 - .pool -_080365FC: - ldr r0, =gUnknown_08D7D2E0 - b _08036626 - .pool -_08036604: - ldr r0, =gUnknown_08D7D2E0 - b _08036626 - .pool -_0803660C: - ldr r0, =gUnknown_08D7D2E0 - b _08036626 - .pool -_08036614: - ldr r0, =gUnknown_08D7D2E0 - b _08036626 - .pool -_0803661C: - ldr r0, =gUnknown_08D7D2E0 - b _08036626 - .pool -_08036624: - ldr r0, =gUnknown_08D7CA28 -_08036626: - ldr r1, =0x0600d000 - bl LZDecompressVram - b _08036758 - .pool -_08036638: - ldr r0, =0x02022fec - ldr r1, [r0] - ldr r0, =0x023f0902 - ands r0, r1 - cmp r0, 0 - beq _08036646 - b _08036740 -_08036646: - movs r0, 0x80 - lsls r0, 5 - ands r0, r1 - cmp r0, 0 - beq _08036674 - ldr r0, =gUnknown_82E9530 - ldrb r0, [r0] - cmp r0, 0x2 - bne _0803666C - ldr r0, =gUnknown_08D7DF30 - b _08036742 - .pool -_0803666C: - ldr r0, =gUnknown_08D7DEF4 - b _08036742 - .pool -_08036674: - movs r0, 0x8 - ands r1, r0 - cmp r1, 0 - beq _080366AC - ldr r2, =gTrainers - ldr r0, =0x02038bca - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0x20 - bne _080366A0 - ldr r0, =gUnknown_08D7DFC4 - b _08036742 - .pool -_080366A0: - cmp r0, 0x26 - bne _080366AC - ldr r0, =gUnknown_08D7E1F8 - b _08036742 - .pool -_080366AC: - bl sav1_map_get_battletype - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x8 - bhi _080366EC - lsls r0, 2 - ldr r1, =_080366C8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080366C8: - .4byte _080366EC - .4byte _08036708 - .4byte _08036710 - .4byte _08036718 - .4byte _08036720 - .4byte _08036728 - .4byte _08036730 - .4byte _08036738 - .4byte _08036740 -_080366EC: - ldr r2, =gUnknown_0831ABA8 - ldr r0, =0x02022ff0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, 0x10 - adds r0, r2 - ldr r0, [r0] - b _08036742 - .pool -_08036708: - ldr r0, =gUnknown_08D7DF88 - b _08036742 - .pool -_08036710: - ldr r0, =gUnknown_08D7E060 - b _08036742 - .pool -_08036718: - ldr r0, =gUnknown_08D7E000 - b _08036742 - .pool -_08036720: - ldr r0, =gUnknown_08D7E0CC - b _08036742 - .pool -_08036728: - ldr r0, =gUnknown_08D7E11C - b _08036742 - .pool -_08036730: - ldr r0, =gUnknown_08D7E164 - b _08036742 - .pool -_08036738: - ldr r0, =gUnknown_08D7E1A8 - b _08036742 - .pool -_08036740: - ldr r0, =gUnknown_08D7C9EC -_08036742: - movs r1, 0x20 - movs r2, 0x60 - bl decompress_palette - b _08036758 - .pool -_08036750: - bl sub_803570C - b _08036758 -_08036756: - movs r4, 0x1 -_08036758: - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80363C4 - - thumb_func_start sub_8036760 -sub_8036760: @ 8036760 - push {lr} - bl saveblock_randomize_and_relocate - bl sub_8056F28 - bl dp11_init - bl init_uns_table_pokemon_copy - bl sub_8185F84 - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080367CC - movs r0, 0x80 - lsls r0, 17 - ands r0, r1 - cmp r0, 0 - beq _08036798 - bl sub_80367D4 - b _080367BA - .pool -_08036798: - movs r0, 0x80 - lsls r0, 15 - ands r1, r0 - cmp r1, 0 - bne _080367B4 - bl battle_wireless_setup_if_required_maybe - ldr r0, =sub_8037ADC - bl SetMainCallback2 - b _080367BA - .pool -_080367B4: - ldr r0, =intro_end - bl SetMainCallback2 -_080367BA: - ldr r1, =0x02024332 - movs r0, 0 - strb r0, [r1] - b _080367D0 - .pool -_080367CC: - bl sub_80367D4 -_080367D0: - pop {r0} - bx r0 - thumb_func_end sub_8036760 - - thumb_func_start sub_80367D4 -sub_80367D4: @ 80367D4 - push {r4,r5,lr} - sub sp, 0x4 - movs r0, 0 - bl SetHBlankCallback - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - str r0, [sp] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x05006000 - mov r0, sp - bl CpuSet - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - movs r0, 0x40 - movs r1, 0xF0 - bl SetGpuReg - ldr r1, =0x00005051 - movs r0, 0x44 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4A - movs r1, 0 - bl SetGpuReg - ldr r0, =0x02022e24 - movs r2, 0xF0 - strh r2, [r0] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 15 - ands r0, r1 - cmp r0, 0 - beq _08036870 - ldr r0, =0x02038bce - ldrh r1, [r0] - ldr r0, =0x00000c03 - cmp r1, r0 - beq _08036870 - ldr r1, =0x02022e26 - movs r0, 0x9F - strh r0, [r1] - ldr r0, =0x02022e28 - strh r2, [r0] - ldr r1, =0x02022e2a - movs r0, 0x20 - strh r0, [r1] - b _080368BE - .pool -_08036870: - ldr r0, =0x02022e26 - ldr r2, =0x00005051 - adds r1, r2, 0 - strh r1, [r0] - bl dp12_8087EA4 - ldr r0, =0x02038c28 - movs r3, 0xF0 - movs r5, 0xF0 - lsls r5, 3 - adds r2, r0, r5 - movs r1, 0x4F -_08036888: - strh r3, [r0] - strh r3, [r2] - adds r2, 0x2 - adds r0, 0x2 - subs r1, 0x1 - cmp r1, 0 - bge _08036888 - movs r1, 0x50 - ldr r4, =gUnknown_0831AC70 - ldr r0, =0x02038c28 - ldr r3, =0x0000ff10 - movs r5, 0x82 - lsls r5, 4 - adds r2, r0, r5 - adds r0, 0xA0 -_080368A6: - strh r3, [r0] - strh r3, [r2] - adds r2, 0x2 - adds r0, 0x2 - adds r1, 0x1 - cmp r1, 0x9F - ble _080368A6 - ldr r0, [r4] - ldr r1, [r4, 0x4] - ldr r2, [r4, 0x8] - bl sub_80BA038 -_080368BE: - bl sub_80A1A74 - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r0, =0x02022e18 - strh r1, [r0] - ldr r0, =0x02022e1a - strh r1, [r0] - ldr r0, =0x02022e1c - strh r1, [r0] - ldr r0, =0x02022e1e - strh r1, [r0] - ldr r0, =0x02022e20 - strh r1, [r0] - ldr r0, =0x02022e22 - strh r1, [r0] - bl sub_80B0BD0 - ldr r2, =0x02022ff0 - strb r0, [r2] - ldr r4, =0x02022fec - ldr r0, [r4] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _080368FE - movs r0, 0x8 - strb r0, [r2] -_080368FE: - bl c2_berry_program_update_menu - bl sub_8035AA4 - bl ResetAllObjectData - bl clear_tasks - bl sub_8036154 - bl ResetObjectPaletteAllocator - ldr r1, =0x0300301c - movs r0, 0x4 - strb r0, [r1] - ldr r0, =vblank_cb_08078BB4 - bl SetVBlankCallback - bl sub_803269C - ldr r2, [r4] - movs r1, 0xA0 - lsls r1, 1 - adds r0, r2, 0 - ands r0, r1 - cmp r0, r1 - beq _0803693E - ldr r1, =0x00400040 - adds r0, r2, 0 - ands r0, r1 - cmp r0, r1 - bne _08036994 -_0803693E: - ldr r0, =sub_8037458 - bl SetMainCallback2 - b _080369AE - .pool -_08036994: - movs r0, 0x40 - ands r2, r0 - cmp r2, 0 - beq _080369A8 - ldr r0, =sub_8037DF4 - bl SetMainCallback2 - b _080369AE - .pool -_080369A8: - ldr r0, =sub_8036FAC - bl SetMainCallback2 -_080369AE: - ldr r5, =0x02022fec - ldr r0, [r5] - ldr r1, =0x01000002 - ands r0, r1 - cmp r0, 0 - bne _080369E8 - ldr r4, =0x02024744 - ldr r0, =0x02038bca - ldrh r1, [r0] - adds r0, r4, 0 - movs r2, 0x1 - bl LoadTrainerParty - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _080369E4 - movs r1, 0x96 - lsls r1, 1 - adds r0, r4, r1 - ldr r1, =0x02038bcc - ldrh r1, [r1] - movs r2, 0 - bl LoadTrainerParty -_080369E4: - bl sub_806EA68 -_080369E8: - ldr r1, =0x030022c0 - ldr r2, =0x00000439 - adds r1, r2 - ldrb r0, [r1] - movs r2, 0x2 - orrs r0, r2 - strb r0, [r1] - ldr r0, =0x03005d90 - ldr r1, [r0] - ldr r5, =0x00000ca9 - adds r1, r5 - ldrb r2, [r1] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r4, =0x020244ec - movs r0, 0xFA - lsls r0, 1 - adds r5, r4, r0 -_08036A10: - adds r0, r4, 0 - movs r1, 0x3 - bl happiness_algorithm - adds r4, 0x64 - cmp r4, r5 - ble _08036A10 - movs r1, 0 - ldr r0, =0x02024332 - strb r1, [r0] - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80367D4 - - thumb_func_start sub_8036A5C -sub_8036A5C: @ 8036A5C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r6, 0 - mov r9, r6 - movs r0, 0xCE - lsls r0, 1 - mov r10, r0 - mov r8, r6 -_08036A72: - movs r0, 0x64 - mov r4, r9 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - lsls r0, 16 - lsrs r7, r0, 16 - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr - adds r1, r0, 0 - cmp r5, 0 - beq _08036AEE - cmp r5, r10 - beq _08036ABA - cmp r7, 0 - beq _08036ABA - cmp r1, 0 - bne _08036ABA - movs r0, 0x1 - mov r2, r8 - lsls r0, r2 - orrs r6, r0 - lsls r0, r6, 16 - lsrs r6, r0, 16 -_08036ABA: - cmp r5, 0 - beq _08036AEE - cmp r7, 0 - beq _08036AD6 - cmp r5, r10 - beq _08036ACA - cmp r1, 0 - beq _08036AD6 -_08036ACA: - movs r0, 0x2 - mov r1, r8 - lsls r0, r1 - orrs r6, r0 - lsls r0, r6, 16 - lsrs r6, r0, 16 -_08036AD6: - cmp r5, 0 - beq _08036AEE - cmp r5, r10 - beq _08036AEE - cmp r7, 0 - bne _08036AEE - movs r0, 0x3 - mov r2, r8 - lsls r0, r2 - orrs r6, r0 - lsls r0, r6, 16 - lsrs r6, r0, 16 -_08036AEE: - movs r0, 0x2 - add r8, r0 - movs r1, 0x1 - add r9, r1 - mov r2, r9 - cmp r2, 0x5 - ble _08036A72 - ldr r4, =0x0202449c - ldr r0, [r4] - movs r1, 0xC1 - lsls r1, 1 - adds r0, r1 - strb r6, [r0] - ldr r0, [r4] - ldr r5, =0x00000183 - adds r0, r5 - lsrs r1, r6, 8 - strb r1, [r0] - ldr r0, =0x000008d2 - bl FlagGet - ldr r1, [r4] - adds r1, r5 - lsls r0, 7 - ldrb r2, [r1] - orrs r0, r2 - strb r0, [r1] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8036A5C - - thumb_func_start sub_8036B44 -sub_8036B44: @ 8036B44 - push {r4-r7,lr} - ldr r0, =0x0202449c - ldr r5, [r0] - movs r0, 0xC2 - lsls r0, 1 - adds r4, r5, r0 - bl sub_80E162C - cmp r0, 0x1 - bne _08036BC0 - movs r2, 0 - ldr r7, =0x03005d8c - movs r1, 0xC6 - lsls r1, 1 - adds r5, r1 - adds r6, r7, 0 - ldr r3, =0x000031f8 -_08036B66: - adds r0, r4, r2 - ldr r1, [r6] - adds r1, r3 - adds r1, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x5 - ble _08036B66 - adds r1, r4, r2 - movs r0, 0xFF - strb r0, [r1] - movs r2, 0 - adds r3, r5, 0 - ldr r6, =0x03005d8c - ldr r5, =0x00003214 -_08036B86: - adds r0, r3, r2 - ldr r1, [r6] - adds r1, r5 - adds r1, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x11 - ble _08036B86 - ldr r0, [r7] - ldr r1, =0x00003226 - adds r0, r1 - ldrb r0, [r0] - strb r0, [r4, 0x7] - ldr r0, [r7] - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - b _08036C00 - .pool -_08036BC0: - movs r0, 0xAF - bl ItemIdToBerryType - lsls r0, 24 - lsrs r0, 24 - bl GetBerryInfo - adds r3, r0, 0 - movs r2, 0 - movs r0, 0xC6 - lsls r0, 1 - adds r5, r0 -_08036BD8: - adds r0, r4, r2 - adds r1, r3, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x5 - ble _08036BD8 - adds r1, r4, r2 - movs r0, 0xFF - strb r0, [r1] - adds r0, r5, 0 - movs r2, 0 - adds r1, r0, 0 - adds r1, 0x11 -_08036BF4: - strb r2, [r1] - subs r1, 0x1 - cmp r1, r0 - bge _08036BF4 - movs r0, 0 - strb r0, [r4, 0x7] -_08036C00: - strb r0, [r4, 0x1A] - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8036B44 - - thumb_func_start berry_801017C -berry_801017C: @ 8036C08 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08036C20 - b _08036D4C -_08036C20: - bl sub_80E162C - cmp r0, 0x1 - bne _08036CDC - movs r5, 0 - ldr r3, =0x02024404 - ldr r0, =0x03005d8c - mov r8, r0 - adds r6, r3, 0 - mov r4, r8 - ldr r2, =0x000031f8 - adds r7, r3, 0 - adds r7, 0x38 -_08036C3A: - adds r1, r5, r6 - ldr r0, [r4] - adds r0, r2 - adds r0, r5 - ldrb r0, [r0] - strb r0, [r1] - adds r1, r5, r7 - ldr r0, [r4] - adds r0, r2 - adds r0, r5 - ldrb r0, [r0] - strb r0, [r1] - adds r5, 0x1 - cmp r5, 0x5 - ble _08036C3A - adds r1, r5, r3 - movs r0, 0xFF - strb r0, [r1] - adds r0, r3, 0 - adds r0, 0x38 - adds r0, r5, r0 - movs r1, 0x1 - negs r1, r1 - strb r1, [r0] - movs r5, 0 - adds r7, r3, 0 - adds r7, 0x8 - ldr r4, =0x03005d8c - ldr r2, =0x00003214 - adds r6, r3, 0 - adds r6, 0x40 -_08036C78: - adds r1, r5, r7 - ldr r0, [r4] - adds r0, r2 - adds r0, r5 - ldrb r0, [r0] - strb r0, [r1] - adds r1, r5, r6 - ldr r0, [r4] - adds r0, r2 - adds r0, r5 - ldrb r0, [r0] - strb r0, [r1] - adds r5, 0x1 - cmp r5, 0x11 - ble _08036C78 - mov r1, r8 - ldr r0, [r1] - ldr r2, =0x00003226 - adds r0, r2 - ldrb r1, [r0] - strb r1, [r3, 0x7] - ldrb r0, [r0] - adds r1, r3, 0 - adds r1, 0x3F - strb r0, [r1] - mov r4, r8 - ldr r0, [r4] - ldr r1, =0x00003227 - adds r0, r1 - ldrb r1, [r0] - strb r1, [r3, 0x1A] - ldrb r1, [r0] - adds r0, r3, 0 - adds r0, 0x52 - strb r1, [r0] - b _08036EA0 - .pool -_08036CDC: - movs r0, 0xAF - bl ItemIdToBerryType - lsls r0, 24 - lsrs r0, 24 - bl GetBerryInfo - adds r6, r0, 0 - movs r5, 0 - ldr r4, =0x02024404 - adds r7, r4, 0 - adds r7, 0x38 - adds r3, r4, 0 -_08036CF6: - adds r1, r5, r4 - adds r2, r6, r5 - ldrb r0, [r2] - strb r0, [r1] - adds r1, r5, r7 - ldrb r0, [r2] - strb r0, [r1] - adds r5, 0x1 - cmp r5, 0x5 - ble _08036CF6 - adds r1, r5, r3 - movs r0, 0xFF - strb r0, [r1] - adds r0, r3, 0 - adds r0, 0x38 - adds r0, r5, r0 - movs r1, 0x1 - negs r1, r1 - strb r1, [r0] - movs r5, 0 - adds r4, r3, 0 - adds r4, 0x8 - movs r1, 0 - adds r2, r3, 0 - adds r2, 0x40 -_08036D28: - adds r0, r5, r4 - strb r1, [r0] - adds r0, r5, r2 - strb r1, [r0] - adds r5, 0x1 - cmp r5, 0x11 - ble _08036D28 - movs r1, 0 - strb r1, [r3, 0x7] - adds r0, r3, 0 - adds r0, 0x3F - strb r1, [r0] - strb r1, [r3, 0x1A] - adds r0, 0x13 - strb r1, [r0] - b _08036EA0 - .pool -_08036D4C: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08036DF0 - movs r0, 0x80 - lsls r0, 1 - ands r1, r0 - movs r2, 0x4 - mov r8, r2 - cmp r1, 0 - beq _08036D66 - movs r4, 0x2 - mov r8, r4 -_08036D66: - movs r5, 0 - cmp r5, r8 - blt _08036D6E - b _08036EA0 -_08036D6E: - ldr r0, =0x020229e8 - mov r12, r0 - ldr r3, =0x02024404 - adds r6, r3, 0 - movs r1, 0x8 - adds r1, r6 - mov r9, r1 -_08036D7C: - lsls r1, r5, 8 - ldr r0, =0x020223c8 - adds r7, r1, r0 - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - add r0, r12 - ldrb r3, [r0, 0x18] - movs r4, 0 - adds r5, 0x1 - mov r10, r5 - lsls r1, r3, 3 - subs r0, r1, r3 - adds r5, r1, 0 - lsls r0, 2 - adds r1, r0, r6 -_08036D9C: - adds r0, r7, r4 - ldrb r0, [r0] - strb r0, [r1] - adds r1, 0x1 - adds r4, 0x1 - cmp r4, 0x5 - ble _08036D9C - subs r0, r5, r3 - lsls r0, 2 - adds r1, r4, r0 - adds r1, r6 - movs r2, 0xFF - strb r2, [r1] - movs r4, 0 - mov r2, r9 - adds r1, r0, r2 - adds r2, r7, 0 - adds r2, 0x8 -_08036DC0: - adds r0, r2, r4 - ldrb r0, [r0] - strb r0, [r1] - adds r1, 0x1 - adds r4, 0x1 - cmp r4, 0x11 - ble _08036DC0 - subs r0, r5, r3 - lsls r0, 2 - adds r0, r6 - ldrb r1, [r7, 0x7] - strb r1, [r0, 0x7] - ldrb r1, [r7, 0x1A] - strb r1, [r0, 0x1A] - mov r5, r10 - cmp r5, r8 - blt _08036D7C - b _08036EA0 - .pool -_08036DF0: - movs r5, 0 - ldr r4, =0x02024404 - mov r9, r4 -_08036DF6: - lsls r0, r5, 8 - ldr r1, =0x020223c8 - adds r7, r0, r1 - movs r4, 0 - adds r2, r5, 0x1 - mov r10, r2 - lsls r0, r5, 3 - mov r8, r0 - adds r1, r5, 0x2 - mov r12, r1 - subs r1, r0, r5 - mov r2, r12 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - mov r2, r9 - adds r3, r0, r2 - lsls r1, 2 - adds r2, r1, r2 -_08036E1C: - adds r0, r7, r4 - ldrb r1, [r0] - strb r1, [r2] - ldrb r0, [r0] - strb r0, [r3] - adds r3, 0x1 - adds r2, 0x1 - adds r4, 0x1 - cmp r4, 0x5 - ble _08036E1C - mov r0, r8 - subs r3, r0, r5 - lsls r3, 2 - adds r1, r4, r3 - add r1, r9 - ldrb r0, [r1] - movs r2, 0xFF - orrs r0, r2 - strb r0, [r1] - mov r0, r12 - lsls r2, r0, 3 - subs r2, r0 - lsls r2, 2 - adds r1, r4, r2 - add r1, r9 - ldrb r0, [r1] - movs r4, 0xFF - orrs r0, r4 - strb r0, [r1] - movs r4, 0 - ldr r0, =0x02024404 - adds r0, 0x8 - adds r2, r0 - adds r3, r0 - adds r6, r7, 0 - adds r6, 0x8 -_08036E64: - adds r0, r6, r4 - ldrb r1, [r0] - strb r1, [r3] - ldrb r0, [r0] - strb r0, [r2] - adds r2, 0x1 - adds r3, 0x1 - adds r4, 0x1 - cmp r4, 0x11 - ble _08036E64 - mov r0, r8 - subs r2, r0, r5 - lsls r2, 2 - add r2, r9 - ldrb r0, [r7, 0x7] - strb r0, [r2, 0x7] - mov r1, r12 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r9 - ldrb r1, [r7, 0x7] - strb r1, [r0, 0x7] - ldrb r1, [r7, 0x1A] - strb r1, [r2, 0x1A] - ldrb r1, [r7, 0x1A] - strb r1, [r0, 0x1A] - mov r5, r10 - cmp r5, 0x1 - ble _08036DF6 -_08036EA0: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end berry_801017C - - thumb_func_start sub_8036EB8 -sub_8036EB8: @ 8036EB8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r3, r1, 24 - movs r6, 0 - ldr r0, =0x020223c4 - ldrh r2, [r0] - movs r1, 0x80 - lsls r1, 1 - mov r12, r0 - cmp r2, r1 - bne _08036EFC - cmp r3, 0 - bne _08036EEC - ldr r0, =0x02022fec - ldr r1, [r0] - movs r2, 0xC - b _08036EF2 - .pool -_08036EEC: - ldr r0, =0x02022fec - ldr r1, [r0] - movs r2, 0x8 -_08036EF2: - orrs r1, r2 - str r1, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_08036EFC: - cmp r6, 0 - bne _08036FA0 - movs r2, 0 - cmp r2, r4 - bge _08036F20 - ldr r1, =0x020223c4 - mov r8, r1 - movs r5, 0x80 - lsls r5, 1 -_08036F0E: - adds r1, r5 - adds r2, 0x1 - cmp r2, r4 - bge _08036F20 - mov r7, r8 - ldrh r0, [r7] - ldrh r7, [r1] - cmp r0, r7 - beq _08036F0E -_08036F20: - cmp r2, r4 - bne _08036F48 - cmp r3, 0 - bne _08036F38 - ldr r0, =0x02022fec - ldr r1, [r0] - movs r2, 0xC - b _08036F3E - .pool -_08036F38: - ldr r0, =0x02022fec - ldr r1, [r0] - movs r2, 0x8 -_08036F3E: - orrs r1, r2 - str r1, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_08036F48: - cmp r6, 0 - bne _08036FA0 - movs r2, 0 - ldr r5, =0x02022fec - cmp r2, r4 - bge _08036F8A - mov r0, r12 - ldrh r1, [r0] - movs r0, 0xC0 - lsls r0, 2 - cmp r1, r0 - beq _08036F82 -_08036F60: - lsls r0, r2, 8 - add r0, r12 - ldrh r0, [r0] - movs r1, 0xC0 - lsls r1, 2 - cmp r0, r1 - bls _08036F72 - cmp r2, r3 - bne _08036F8A -_08036F72: - adds r2, 0x1 - cmp r2, r4 - bge _08036F8A - lsls r0, r2, 8 - add r0, r12 - ldrh r0, [r0] - cmp r0, r1 - bne _08036F60 -_08036F82: - cmp r2, r3 - beq _08036F60 - cmp r2, r3 - bge _08036F60 -_08036F8A: - cmp r2, r4 - bne _08036F98 - ldr r0, [r5] - movs r1, 0xC - b _08036F9C - .pool -_08036F98: - ldr r0, [r5] - movs r1, 0x8 -_08036F9C: - orrs r0, r1 - str r0, [r5] -_08036FA0: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8036EB8 - - thumb_func_start sub_8036FAC -sub_8036FAC: @ 8036FAC - push {r4-r6,lr} - bl RunActiveTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x02024474 - adds r0, 0x25 - strb r6, [r0] - movs r0, 0x1 - adds r5, r6, 0 - eors r5, r0 - ldr r0, =0x02024332 - ldrb r0, [r0] - cmp r0, 0x12 - bls _08036FD8 - b _0803744C -_08036FD8: - lsls r0, 2 - ldr r1, =_08036FF0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08036FF0: - .4byte _0803703C - .4byte _08037080 - .4byte _08037144 - .4byte _080371D8 - .4byte _08037200 - .4byte _0803742C - .4byte _08037438 - .4byte _08037230 - .4byte _08037258 - .4byte _0803742C - .4byte _08037438 - .4byte _08037288 - .4byte _080372B0 - .4byte _0803742C - .4byte _08037438 - .4byte _08037318 - .4byte _08037378 - .4byte _080373A0 - .4byte _080373E0 -_0803703C: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _08037068 - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - bl sub_805EF14 - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1] -_08037068: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _08037072 - b _0803744C -_08037072: - bl sub_800E0E8 - b _0803744C - .pool -_08037080: - ldr r2, =0x02022fec - ldr r1, [r2] - movs r6, 0x2 - adds r0, r1, 0 - ands r0, r6 - cmp r0, 0 - beq _08037124 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _08037098 - b _0803744C -_08037098: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080370EE - ldr r4, =0x0202449c - ldr r0, [r4] - movs r5, 0xC0 - lsls r5, 1 - adds r0, r5 - movs r1, 0 - strb r1, [r0] - ldr r0, [r4] - ldr r2, =0x00000181 - adds r1, r0, r2 - movs r0, 0x3 - strb r0, [r1] - bl sub_8036A5C - bl sub_8036B44 - ldr r0, =0x02038bca - ldrh r1, [r0] - movs r0, 0xC0 - lsls r0, 4 - cmp r1, r0 - bne _080370D8 - ldr r0, =0x020229e8 - movs r1, 0 - strh r1, [r0, 0x18] - movs r1, 0x1 - strh r1, [r0, 0x34] -_080370D8: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, [r4] - adds r1, r5 - movs r2, 0x20 - bl link_0800A448 - ldr r0, =0x02024332 - strb r6, [r0] -_080370EE: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _080370F8 - b _0803744C -_080370F8: - movs r0, 0 - movs r1, 0 - bl sub_800DFB4 - b _0803744C - .pool -_08037124: - movs r0, 0x80 - lsls r0, 17 - ands r0, r1 - cmp r0, 0 - bne _08037134 - movs r0, 0x4 - orrs r1, r0 - str r1, [r2] -_08037134: - ldr r1, =0x02024332 - movs r0, 0xF - strb r0, [r1] - bl berry_801017C - b _0803744C - .pool -_08037144: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - beq _08037152 - b _0803744C -_08037152: - bl sub_800A5B4 - movs r0, 0x2 - adds r1, r6, 0 - bl sub_8036EB8 - bl berry_801017C - ldr r0, =task00_0800F6FC - movs r1, 0 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005e00 - lsls r2, r0, 2 - adds r2, r0 - lsls r2, 3 - adds r2, r1 - movs r1, 0 - movs r0, 0x87 - lsls r0, 1 - strh r0, [r2, 0xA] - movs r0, 0x5A - strh r0, [r2, 0xC] - strh r1, [r2, 0x12] - ldr r0, =0x0202449c - ldr r3, [r0] - movs r4, 0xC1 - lsls r4, 1 - adds r0, r3, r4 - ldrb r1, [r0] - adds r4, 0x1 - adds r0, r3, r4 - ldrb r0, [r0] - lsls r0, 8 - orrs r1, r0 - strh r1, [r2, 0xE] - ldr r1, =0x020223c4 - lsls r4, r5, 8 - adds r1, 0x2 - adds r4, r1 - ldrh r0, [r4] - strh r0, [r2, 0x10] - lsls r0, r6, 8 - adds r0, r1 - ldrh r0, [r0] - bl sub_8185F90 - ldrh r0, [r4] - bl sub_8185F90 - bl sub_8068AA4 - ldr r1, =0x02024332 - b _08037446 - .pool -_080371D8: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _080371E4 - b _0803744C -_080371E4: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x020244ec - movs r2, 0xC8 - bl link_0800A448 - ldr r1, =0x02024332 - b _08037446 - .pool -_08037200: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - beq _0803720E - b _0803744C -_0803720E: - bl sub_800A5B4 - ldr r0, =0x02024744 - lsls r1, r5, 8 - ldr r2, =0x020223c4 - adds r1, r2 - movs r2, 0xC8 - bl memcpy - ldr r1, =0x02024332 - b _08037446 - .pool -_08037230: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _0803723C - b _0803744C -_0803723C: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x020245b4 - movs r2, 0xC8 - bl link_0800A448 - ldr r1, =0x02024332 - b _08037446 - .pool -_08037258: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - beq _08037266 - b _0803744C -_08037266: - bl sub_800A5B4 - ldr r0, =0x0202480c - lsls r1, r5, 8 - ldr r2, =0x020223c4 - adds r1, r2 - movs r2, 0xC8 - bl memcpy - ldr r1, =0x02024332 - b _08037446 - .pool -_08037288: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _08037294 - b _0803744C -_08037294: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0202467c - movs r2, 0xC8 - bl link_0800A448 - ldr r1, =0x02024332 - b _08037446 - .pool -_080372B0: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - beq _080372BE - b _0803744C -_080372BE: - bl sub_800A5B4 - ldr r4, =0x020248d4 - lsls r1, r5, 8 - ldr r0, =0x020223c4 - adds r1, r0 - adds r0, r4, 0 - movs r2, 0xC8 - bl memcpy - ldr r1, =0xfffffe70 - adds r0, r4, r1 - bl shedinja_something - ldr r2, =0xfffffed4 - adds r0, r4, r2 - bl shedinja_something - adds r0, r4, 0 - subs r0, 0xC8 - bl shedinja_something - adds r0, r4, 0 - subs r0, 0x64 - bl shedinja_something - adds r0, r4, 0 - bl shedinja_something - adds r0, r4, 0 - adds r0, 0x64 - bl shedinja_something - ldr r1, =0x02024332 - b _08037446 - .pool -_08037318: - bl sub_8032768 - bl sub_8184E58 - ldr r2, =0x02024332 - movs r0, 0 - strb r0, [r2, 0x1] - strb r0, [r2, 0x2] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08037372 - movs r3, 0 - ldr r1, =0x020229e8 - ldrb r0, [r1] - adds r5, r2, 0 - cmp r0, 0x3 - bne _08037356 - movs r4, 0xFF - adds r2, r1, 0 -_08037344: - adds r2, 0x1C - adds r3, 0x1 - cmp r3, 0x1 - bgt _08037356 - ldrh r1, [r2] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0x3 - beq _08037344 -_08037356: - cmp r3, 0x2 - bne _0803736C - movs r0, 0x10 - strb r0, [r5] - b _0803744C - .pool -_0803736C: - movs r0, 0x12 - strb r0, [r5] - b _0803744C -_08037372: - movs r0, 0x12 - strb r0, [r2] - b _0803744C -_08037378: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _0803744C - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0203bd2c - movs r2, 0x4 - bl link_0800A448 - ldr r1, =0x02024332 - b _08037446 - .pool -_080373A0: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - bne _0803744C - bl sub_800A5B4 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x4 - ands r0, r1 - cmp r0, 0 - bne _080373CA - ldr r0, =0x0203bd2c - lsls r1, r5, 8 - ldr r2, =0x020223c4 - adds r1, r2 - movs r2, 0x4 - bl memcpy -_080373CA: - ldr r1, =0x02024332 - b _08037446 - .pool -_080373E0: - ldr r0, =0x02024333 - adds r1, r0, 0x1 - bl battle_load_something - lsls r0, 24 - cmp r0, 0 - beq _0803744C - ldr r2, =0x03005d00 - ldr r1, =0x030022c0 - ldr r0, [r1] - str r0, [r2] - ldr r0, =sub_8039EF0 - str r0, [r1] - ldr r0, =sub_8038420 - bl SetMainCallback2 - ldr r2, =0x02022fec - ldr r1, [r2] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0803744C - movs r0, 0x20 - orrs r1, r0 - str r1, [r2] - b _0803744C - .pool -_0803742C: - ldr r0, =0x02024332 - ldrb r1, [r0] - adds r1, 0x1 - strb r1, [r0] - movs r1, 0x1 - strb r1, [r0, 0x1] -_08037438: - ldr r1, =0x02024332 - ldrb r0, [r1, 0x1] - subs r0, 0x1 - strb r0, [r1, 0x1] - lsls r0, 24 - cmp r0, 0 - bne _0803744C -_08037446: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_0803744C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8036FAC - - thumb_func_start sub_8037458 -sub_8037458: @ 8037458 - push {r4-r7,lr} - sub sp, 0x4 - bl RunActiveTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x02024474 - adds r0, 0x25 - strb r6, [r0] - movs r0, 0x1 - adds r7, r6, 0 - eors r7, r0 - ldr r0, =0x02024332 - ldrb r0, [r0] - cmp r0, 0x10 - bls _08037486 - b _080379D6 -_08037486: - lsls r0, 2 - ldr r1, =_0803749C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0803749C: - .4byte _080374E0 - .4byte _08037518 - .4byte _0803761C - .4byte _08037670 - .4byte _08037694 - .4byte _08037710 - .4byte _08037734 - .4byte _080377B0 - .4byte _080377CC - .4byte _080377FC - .4byte _08037818 - .4byte _08037848 - .4byte _08037864 - .4byte _08037908 - .4byte _0803793A - .4byte _0803795C - .4byte _080379A0 -_080374E0: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0803750C - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - bl sub_805EF14 - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1] -_0803750C: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08037518 - bl sub_800E0E8 -_08037518: - ldr r2, =0x02022fec - ldr r1, [r2] - movs r3, 0x2 - adds r0, r1, 0 - ands r0, r3 - cmp r0, 0 - beq _080375FC - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _08037530 - b _080379D6 -_08037530: - ldr r6, =0x020229e8 - movs r0, 0 - strh r0, [r6, 0x18] - strh r3, [r6, 0x34] - adds r1, r6, 0 - adds r1, 0x50 - movs r0, 0x1 - strh r0, [r1] - adds r1, 0x1C - movs r0, 0x3 - strh r0, [r1] - adds r0, r6, 0 - adds r0, 0x40 - ldr r4, =0x02038bca - ldrh r1, [r4] - bl sub_8162E20 - adds r0, r6, 0 - adds r0, 0x5C - ldr r5, =0x02038bcc - ldrh r1, [r5] - bl sub_8162E20 - ldrh r1, [r4] - mov r0, sp - bl sub_8165B88 - mov r0, sp - ldrb r0, [r0] - adds r1, r6, 0 - adds r1, 0x52 - strh r0, [r1] - ldrh r1, [r5] - mov r0, sp - bl sub_8165B88 - mov r0, sp - ldrb r1, [r0] - adds r0, r6, 0 - adds r0, 0x6E - strh r1, [r0] - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080375C4 - ldr r4, =0x0202449c - ldr r0, [r4] - movs r5, 0xC0 - lsls r5, 1 - adds r0, r5 - movs r1, 0 - strb r1, [r0] - ldr r0, [r4] - ldr r2, =0x00000181 - adds r1, r0, r2 - movs r0, 0x3 - strb r0, [r1] - bl sub_8036A5C - bl sub_8036B44 - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, [r4] - adds r1, r5 - movs r2, 0x20 - bl link_0800A448 - ldr r1, =0x02024332 - movs r0, 0x2 - strb r0, [r1] -_080375C4: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _080375CE - b _080379D6 -_080375CE: - movs r0, 0 - movs r1, 0 - bl sub_800DFB4 - b _080379D6 - .pool -_080375FC: - movs r0, 0x80 - lsls r0, 17 - ands r0, r1 - cmp r0, 0 - bne _0803760C - movs r0, 0x4 - orrs r1, r0 - str r1, [r2] -_0803760C: - ldr r1, =0x02024332 - movs r0, 0xD - strb r0, [r1] - bl berry_801017C - b _080379D6 - .pool -_0803761C: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - beq _0803762A - b _080379D6 -_0803762A: - bl sub_800A5B4 - movs r0, 0x2 - adds r1, r6, 0 - bl sub_8036EB8 - bl berry_801017C - ldr r0, =task00_0800F6FC - movs r1, 0 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r2, 0 - movs r0, 0x87 - lsls r0, 1 - strh r0, [r1, 0xA] - movs r0, 0x5A - strh r0, [r1, 0xC] - strh r2, [r1, 0x12] - adds r0, 0xEB - strh r0, [r1, 0xE] - strh r0, [r1, 0x10] - b _08037986 - .pool -_08037670: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _0803767C - b _080379D6 -_0803767C: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x020244ec -_08037686: - movs r2, 0xC8 - bl link_0800A448 - b _08037986 - .pool -_08037694: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - beq _080376A2 - b _080379D6 -_080376A2: - bl sub_800A5B4 - ldr r0, =0x020229e8 - lsls r1, r6, 3 - subs r1, r6 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x18] - cmp r0, 0 - beq _080376E8 - ldr r4, =0x020244ec - lsls r1, r7, 8 - ldr r5, =0x020223c4 - adds r1, r5 - adds r0, r4, 0 - movs r2, 0xC8 - bl memcpy - movs r0, 0x96 - lsls r0, 1 - adds r4, r0 - lsls r1, r6, 8 - adds r1, r5 - adds r0, r4, 0 - movs r2, 0xC8 - bl memcpy - b _08037986 - .pool -_080376E8: - ldr r4, =0x020244ec - lsls r1, r6, 8 - ldr r5, =0x020223c4 - adds r1, r5 - adds r0, r4, 0 - movs r2, 0xC8 - bl memcpy - movs r1, 0x96 - lsls r1, 1 - adds r4, r1 - lsls r1, r7, 8 - adds r1, r5 - adds r0, r4, 0 - movs r2, 0xC8 - b _08037982 - .pool -_08037710: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _0803771C - b _080379D6 -_0803771C: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x020245b4 - movs r2, 0x64 - bl link_0800A448 - b _08037986 - .pool -_08037734: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - beq _08037742 - b _080379D6 -_08037742: - bl sub_800A5B4 - ldr r0, =0x020229e8 - lsls r1, r6, 3 - subs r1, r6 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x18] - cmp r0, 0 - beq _08037788 - ldr r4, =0x020245b4 - lsls r1, r7, 8 - ldr r5, =0x020223c4 - adds r1, r5 - adds r0, r4, 0 - movs r2, 0x64 - bl memcpy - movs r2, 0x96 - lsls r2, 1 - adds r4, r2 - lsls r1, r6, 8 - adds r1, r5 - adds r0, r4, 0 - movs r2, 0x64 - bl memcpy - b _08037986 - .pool -_08037788: - ldr r4, =0x020245b4 - lsls r1, r6, 8 - ldr r5, =0x020223c4 - adds r1, r5 - adds r0, r4, 0 - movs r2, 0x64 - bl memcpy - movs r0, 0x96 - lsls r0, 1 - adds r4, r0 - lsls r1, r7, 8 - adds r1, r5 - adds r0, r4, 0 - movs r2, 0x64 - b _08037982 - .pool -_080377B0: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _080377BC - b _080379D6 -_080377BC: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02024744 - b _08037686 - .pool -_080377CC: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - beq _080377DA - b _080379D6 -_080377DA: - bl sub_800A5B4 - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - bne _080377EA - b _08037986 -_080377EA: - ldr r0, =0x02024744 - ldr r1, =0x020223c4 - movs r2, 0xC8 - b _08037982 - .pool -_080377FC: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _08037808 - b _080379D6 -_08037808: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0202480c - b _08037686 - .pool -_08037818: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - beq _08037826 - b _080379D6 -_08037826: - bl sub_800A5B4 - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - bne _08037836 - b _08037986 -_08037836: - ldr r0, =0x0202480c - ldr r1, =0x020223c4 - movs r2, 0xC8 - b _08037982 - .pool -_08037848: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _08037854 - b _080379D6 -_08037854: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x020248d4 - b _08037686 - .pool -_08037864: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - beq _08037872 - b _080379D6 -_08037872: - bl sub_800A5B4 - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - beq _0803788A - ldr r0, =0x020248d4 - ldr r1, =0x020223c4 - movs r2, 0xC8 - bl memcpy -_0803788A: - ldr r4, =0x020244ec - adds r0, r4, 0 - bl shedinja_something - adds r0, r4, 0 - adds r0, 0x64 - bl shedinja_something - adds r0, r4, 0 - adds r0, 0xC8 - bl shedinja_something - movs r1, 0x96 - lsls r1, 1 - adds r0, r4, r1 - bl shedinja_something - movs r2, 0xC8 - lsls r2, 1 - adds r0, r4, r2 - bl shedinja_something - movs r1, 0xFA - lsls r1, 1 - adds r0, r4, r1 - bl shedinja_something - ldr r4, =0x02024744 - adds r0, r4, 0 - bl shedinja_something - adds r0, r4, 0 - adds r0, 0x64 - bl shedinja_something - adds r0, r4, 0 - adds r0, 0xC8 - bl shedinja_something - movs r2, 0x96 - lsls r2, 1 - adds r0, r4, r2 - bl shedinja_something - movs r1, 0xC8 - lsls r1, 1 - adds r0, r4, r1 - bl shedinja_something - movs r2, 0xFA - lsls r2, 1 - adds r0, r4, r2 - bl shedinja_something - b _08037986 - .pool -_08037908: - bl sub_8032768 - bl sub_8184E58 - ldr r2, =0x02024332 - movs r0, 0 - strb r0, [r2, 0x1] - strb r0, [r2, 0x2] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08037934 - movs r0, 0xE - strb r0, [r2] - b _080379D6 - .pool -_08037934: - movs r0, 0x10 - strb r0, [r2] - b _080379D6 -_0803793A: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080379D6 - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0203bd2c - movs r2, 0x4 - bl link_0800A448 - b _08037986 - .pool -_0803795C: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - bne _080379D6 - bl sub_800A5B4 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x4 - ands r0, r1 - cmp r0, 0 - bne _08037986 - ldr r0, =0x0203bd2c - lsls r1, r7, 8 - ldr r2, =0x020223c4 - adds r1, r2 - movs r2, 0x4 -_08037982: - bl memcpy -_08037986: - ldr r1, =0x02024332 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080379D6 - .pool -_080379A0: - ldr r0, =0x02024333 - adds r1, r0, 0x1 - bl battle_load_something - lsls r0, 24 - cmp r0, 0 - beq _080379D6 - bl sub_8166188 - ldr r2, =0x03005d00 - ldr r1, =0x030022c0 - ldr r0, [r1] - str r0, [r2] - ldr r0, =sub_8039EF0 - str r0, [r1] - ldr r0, =sub_8038420 - bl SetMainCallback2 - ldr r2, =0x02022fec - ldr r1, [r2] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080379D6 - movs r0, 0x20 - orrs r1, r0 - str r1, [r2] -_080379D6: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8037458 - - thumb_func_start sub_80379F8 -sub_80379F8: @ 80379F8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - movs r0, 0 - mov r8, r0 - ldr r6, =0x02022ff8 - mov r10, r6 -_08037A12: - ldr r1, [sp] - add r1, r8 - movs r0, 0x64 - adds r4, r1, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - mov r1, r8 - lsls r5, r1, 5 - strh r0, [r6] - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_getattr - strh r0, [r6, 0x2] - movs r0, 0x4 - add r0, r10 - mov r9, r0 - adds r7, r5, r0 - adds r0, r4, 0 - movs r1, 0x2 - adds r2, r7, 0 - bl pokemon_getattr - adds r0, r4, 0 - movs r1, 0x38 - bl pokemon_getattr - strb r0, [r6, 0xF] - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - strh r0, [r6, 0x10] - adds r0, r4, 0 - movs r1, 0x3A - bl pokemon_getattr - strh r0, [r6, 0x12] - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr - mov r1, r10 - adds r1, 0x14 - adds r5, r1 - str r0, [r5] - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - str r0, [r6, 0x18] - adds r0, r4, 0 - bl pokemon_get_gender - strb r0, [r6, 0x1C] - adds r0, r7, 0 - bl StripExtendedControlCodes - adds r0, r4, 0 - movs r1, 0x3 - bl pokemon_getattr - cmp r0, 0x1 - beq _08037AA4 - adds r0, r7, 0 - movs r1, 0 - bl sub_81DB4DC -_08037AA4: - adds r6, 0x20 - movs r1, 0x1 - add r8, r1 - mov r0, r8 - cmp r0, 0x2 - ble _08037A12 - ldr r0, =0x02023058 - ldr r0, [r0] - mov r1, r9 - subs r1, 0x4 - movs r2, 0x60 - bl memcpy - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80379F8 - - thumb_func_start sub_8037ADC -sub_8037ADC: @ 8037ADC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r0, 0x4 - mov r9, r0 - movs r4, 0xF - ldr r6, =0x02022fec - ldr r0, [r6] - movs r1, 0x80 - lsls r1, 1 - ands r0, r1 - cmp r0, 0 - beq _08037B02 - movs r1, 0x2 - mov r9, r1 - movs r4, 0x3 -_08037B02: - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x02024474 - adds r0, 0x25 - movs r2, 0 - mov r8, r2 - strb r7, [r0] - ldr r0, =0x0202449c - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0xB4 - str r1, [sp] - adds r0, 0xAC - mov r10, r0 - bl RunActiveTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - ldr r5, =0x02024332 - ldrb r0, [r5] - cmp r0, 0x1 - beq _08037BA4 - cmp r0, 0x1 - bgt _08037B50 - cmp r0, 0 - beq _08037B5E - b _08037D0A - .pool -_08037B50: - cmp r0, 0x2 - bne _08037B56 - b _08037C64 -_08037B56: - cmp r0, 0x3 - bne _08037B5C - b _08037C9E -_08037B5C: - b _08037D0A -_08037B5E: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _08037B68 - b _08037D0A -_08037B68: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _08037B74 - b _08037D0A -_08037B74: - ldr r4, =0x02023058 - movs r0, 0x60 - bl Alloc - str r0, [r4] - movs r0, 0 - bl sub_80379F8 - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, [r4] - movs r2, 0x60 - bl link_0800A448 - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - b _08037D0A - .pool -_08037BA4: - bl sub_800A550 - adds r1, r4, 0 - ands r1, r0 - cmp r1, r4 - beq _08037BB2 - b _08037D0A -_08037BB2: - bl sub_800A5B4 - movs r5, 0 - cmp r8, r9 - bge _08037C2E - lsls r0, r7, 3 - subs r0, r7 - lsls r6, r0, 2 - mov r8, r5 - ldr r4, =0x020223c4 -_08037BC6: - cmp r5, r7 - beq _08037C1E - mov r2, r9 - cmp r2, 0x4 - bne _08037C14 - ldr r2, =0x020229e8 - mov r1, r8 - adds r0, r1, r2 - ldrh r1, [r0, 0x18] - movs r3, 0x1 - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - bne _08037BF8 - adds r0, r6, r2 - ldrh r1, [r0, 0x18] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _08037C04 - b _08037C1E - .pool -_08037BF8: - adds r0, r6, r2 - ldrh r1, [r0, 0x18] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _08037C1E -_08037C04: - ldr r0, =0x02022ff8 - adds r1, r4, 0 - movs r2, 0x60 - bl memcpy - b _08037C1E - .pool -_08037C14: - ldr r0, =0x02022ff8 - adds r1, r4, 0 - movs r2, 0x60 - bl memcpy -_08037C1E: - movs r2, 0x80 - lsls r2, 1 - adds r4, r2 - movs r0, 0x1C - add r8, r0 - adds r5, 0x1 - cmp r5, r9 - blt _08037BC6 -_08037C2E: - ldr r1, =0x02024332 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r1, =0x030022c0 - ldr r0, [r1, 0x8] - ldr r2, [sp] - str r0, [r2] - ldr r0, =0x02022fec - ldr r0, [r0] - mov r2, r10 - str r0, [r2] - ldr r0, =sub_8037ADC - str r0, [r1, 0x8] - bl sub_81B9150 - b _08037D0A - .pool -_08037C64: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08037D0A - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08037D0A - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08037C98 - bl sub_800ADF8 - b _08037D0A - .pool -_08037C98: - bl sub_800AC34 - b _08037D0A -_08037C9E: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08037CE4 - bl sub_8010500 - lsls r0, 24 - cmp r0, 0 - beq _08037D0A - mov r1, r10 - ldr r0, [r1] - str r0, [r6] - ldr r1, =0x030022c0 - ldr r2, [sp] - ldr r0, [r2] - str r0, [r1, 0x8] - ldr r0, =sub_80367D4 - bl SetMainCallback2 - ldr r4, =0x02023058 - ldr r0, [r4] - bl Free - mov r0, r8 - str r0, [r4] - b _08037D0A - .pool -_08037CE4: - ldr r0, =0x03003124 - ldrb r5, [r0] - cmp r5, 0 - bne _08037D0A - mov r1, r10 - ldr r0, [r1] - str r0, [r6] - ldr r1, =0x030022c0 - ldr r2, [sp] - ldr r0, [r2] - str r0, [r1, 0x8] - ldr r0, =sub_80367D4 - bl SetMainCallback2 - ldr r4, =0x02023058 - ldr r0, [r4] - bl Free - str r5, [r4] -_08037D0A: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8037ADC - - thumb_func_start intro_end -intro_end: @ 8037D2C - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =0x0202449c - ldr r0, [r0] - movs r1, 0xB4 - adds r1, r0 - mov r8, r1 - adds r7, r0, 0 - adds r7, 0xAC - bl RunActiveTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - ldr r5, =0x02024332 - ldrb r0, [r5] - cmp r0, 0 - beq _08037D64 - cmp r0, 0x1 - beq _08037DA4 - b _08037DD6 - .pool -_08037D64: - ldr r4, =0x02023058 - movs r0, 0x60 - bl Alloc - str r0, [r4] - movs r0, 0x3 - bl sub_80379F8 - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - ldr r1, =0x030022c0 - ldr r0, [r1, 0x8] - mov r2, r8 - str r0, [r2] - ldr r0, =0x02022fec - ldr r0, [r0] - str r0, [r7] - ldr r0, =intro_end - str r0, [r1, 0x8] - bl sub_81B9150 - b _08037DD6 - .pool -_08037DA4: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - bne _08037DD6 - movs r0, 0x2 - strb r0, [r5] - ldr r1, =0x02022fec - ldr r0, [r7] - str r0, [r1] - ldr r1, =0x030022c0 - mov r2, r8 - ldr r0, [r2] - str r0, [r1, 0x8] - ldr r0, =sub_80367D4 - bl SetMainCallback2 - ldr r4, =0x02023058 - ldr r0, [r4] - bl Free - str r6, [r4] -_08037DD6: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end intro_end - - thumb_func_start sub_8037DF4 -sub_8037DF4: @ 8037DF4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x02024474 - adds r0, 0x25 - strb r7, [r0] - bl RunActiveTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - ldr r0, =0x02024332 - ldrb r0, [r0] - cmp r0, 0xA - bls _08037E20 - b _080383F8 -_08037E20: - lsls r0, 2 - ldr r1, =_08037E38 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08037E38: - .4byte _08037E64 - .4byte _08037EA8 - .4byte _08037F50 - .4byte _08038026 - .4byte _0803804C - .4byte _08038140 - .4byte _08038164 - .4byte _080382CC - .4byte _0803832C - .4byte _0803836C - .4byte _080383BC -_08037E64: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _08037E90 - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - bl sub_805EF14 - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1] -_08037E90: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _08037E9A - b _080383F8 -_08037E9A: - bl sub_800E0E8 - b _080383F8 - .pool -_08037EA8: - ldr r2, =0x02022fec - ldr r1, [r2] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08037F30 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _08037EBE - b _080383F8 -_08037EBE: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08037F02 - ldr r4, =0x0202449c - ldr r0, [r4] - movs r5, 0xC0 - lsls r5, 1 - adds r0, r5 - movs r1, 0 - strb r1, [r0] - ldr r0, [r4] - ldr r2, =0x00000181 - adds r1, r0, r2 - movs r0, 0x3 - strb r0, [r1] - bl sub_8036A5C - bl sub_8036B44 - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, [r4] - adds r1, r5 - movs r2, 0x20 - bl link_0800A448 - ldr r1, =0x02024332 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_08037F02: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _08037F0C - b _080383F8 -_08037F0C: - movs r0, 0 - movs r1, 0 - bl sub_800DFB4 - b _080383F8 - .pool -_08037F30: - movs r0, 0x80 - lsls r0, 17 - ands r0, r1 - cmp r0, 0 - bne _08037F40 - movs r0, 0x4 - orrs r1, r0 - str r1, [r2] -_08037F40: - ldr r1, =0x02024332 - movs r0, 0x7 - strb r0, [r1] - bl berry_801017C - b _080383F8 - .pool -_08037F50: - bl sub_800A550 - movs r1, 0xF - ands r1, r0 - cmp r1, 0xF - beq _08037F5E - b _080383F8 -_08037F5E: - bl sub_800A5B4 - movs r0, 0x4 - adds r1, r7, 0 - bl sub_8036EB8 - bl berry_801017C - bl sub_8068AA4 - ldr r0, =task00_0800F6FC - movs r1, 0 - bl AddTask - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - movs r2, 0 - movs r1, 0x87 - lsls r1, 1 - strh r1, [r0, 0xA] - movs r1, 0x5A - strh r1, [r0, 0xC] - strh r2, [r0, 0x12] - strh r2, [r0, 0xE] - strh r2, [r0, 0x10] - ldr r1, =0x020223c4 - adds r4, r0, 0 - adds r5, r1, 0x2 - movs r7, 0x3F - movs r6, 0x3 -_08037FA4: - ldrh r0, [r5] - str r2, [sp] - bl sub_8185F90 - ldr r0, =0x020229e8 - ldr r2, [sp] - adds r0, r2, r0 - ldrh r0, [r0, 0x18] - cmp r0, 0x1 - beq _08037FE6 - cmp r0, 0x1 - bgt _08037FD4 - cmp r0, 0 - beq _08037FDE - b _0803800C - .pool -_08037FD4: - cmp r0, 0x2 - beq _08037FEE - cmp r0, 0x3 - beq _08037FFE - b _0803800C -_08037FDE: - ldrh r0, [r5] - adds r1, r7, 0 - ands r1, r0 - b _08037FF6 -_08037FE6: - ldrh r0, [r5] - adds r1, r7, 0 - ands r1, r0 - b _08038006 -_08037FEE: - ldrh r0, [r5] - adds r1, r7, 0 - ands r1, r0 - lsls r1, 6 -_08037FF6: - ldrh r0, [r4, 0xE] - orrs r1, r0 - strh r1, [r4, 0xE] - b _0803800C -_08037FFE: - ldrh r0, [r5] - adds r1, r7, 0 - ands r1, r0 - lsls r1, 6 -_08038006: - ldrh r0, [r4, 0x10] - orrs r1, r0 - strh r1, [r4, 0x10] -_0803800C: - movs r0, 0x80 - lsls r0, 1 - adds r5, r0 - adds r2, 0x1C - subs r6, 0x1 - cmp r6, 0 - bge _08037FA4 - bl zero_enemy_party_data - ldr r1, =0x02024332 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_08038026: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _08038032 - b _080383F8 -_08038032: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x020244ec - movs r2, 0xC8 - bl link_0800A448 - b _080383A6 - .pool -_0803804C: - bl sub_800A550 - movs r1, 0xF - ands r1, r0 - cmp r1, 0xF - beq _0803805A - b _080383F8 -_0803805A: - bl sub_800A5B4 - movs r6, 0 - lsls r0, r7, 3 - subs r0, r7 - lsls r0, 2 - mov r8, r0 - ldr r4, =0x020223c4 - movs r5, 0 -_0803806C: - cmp r6, r7 - bne _080380A0 - ldr r0, =0x020229e8 - adds r0, r5, r0 - ldrh r0, [r0, 0x18] - cmp r0, 0x2 - bgt _0803808C - cmp r0, 0x1 - bge _08038098 - cmp r0, 0 - beq _08038090 - b _0803812A - .pool -_0803808C: - cmp r0, 0x3 - bne _0803812A -_08038090: - ldr r0, =0x020244ec - b _08038110 - .pool -_08038098: - ldr r0, =0x02024618 - b _08038110 - .pool -_080380A0: - ldr r2, =0x020229e8 - adds r0, r5, r2 - ldrh r1, [r0, 0x18] - movs r3, 0x1 - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - bne _080380C4 - mov r1, r8 - adds r0, r1, r2 - ldrh r1, [r0, 0x18] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _080380D2 - b _080380F8 - .pool -_080380C4: - mov r1, r8 - adds r0, r1, r2 - ldrh r1, [r0, 0x18] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _080380F8 -_080380D2: - adds r0, r5, r2 - ldrh r0, [r0, 0x18] - cmp r0, 0x2 - bgt _080380E4 - cmp r0, 0x1 - bge _080380F0 - cmp r0, 0 - beq _080380E8 - b _0803812A -_080380E4: - cmp r0, 0x3 - bne _0803812A -_080380E8: - ldr r0, =0x020244ec - b _08038110 - .pool -_080380F0: - ldr r0, =0x02024618 - b _08038110 - .pool -_080380F8: - adds r0, r5, r2 - ldrh r0, [r0, 0x18] - cmp r0, 0x2 - bgt _0803810A - cmp r0, 0x1 - bge _08038120 - cmp r0, 0 - beq _0803810E - b _0803812A -_0803810A: - cmp r0, 0x3 - bne _0803812A -_0803810E: - ldr r0, =0x02024744 -_08038110: - adds r1, r4, 0 - movs r2, 0xC8 - bl memcpy - b _0803812A - .pool -_08038120: - ldr r0, =0x02024870 - adds r1, r4, 0 - movs r2, 0xC8 - bl memcpy -_0803812A: - movs r2, 0x80 - lsls r2, 1 - adds r4, r2 - adds r5, 0x1C - adds r6, 0x1 - cmp r6, 0x3 - ble _0803806C - b _080383A6 - .pool -_08038140: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _0803814C - b _080383F8 -_0803814C: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x020245b4 - movs r2, 0x64 - bl link_0800A448 - b _080383A6 - .pool -_08038164: - bl sub_800A550 - movs r1, 0xF - ands r1, r0 - cmp r1, 0xF - beq _08038172 - b _080383F8 -_08038172: - bl sub_800A5B4 - movs r6, 0 - lsls r0, r7, 3 - subs r0, r7 - lsls r0, 2 - mov r8, r0 - ldr r4, =0x020223c4 - movs r5, 0 -_08038184: - cmp r6, r7 - bne _080381B8 - ldr r0, =0x020229e8 - adds r0, r5, r0 - ldrh r0, [r0, 0x18] - cmp r0, 0x2 - bgt _080381A4 - cmp r0, 0x1 - bge _080381B0 - cmp r0, 0 - beq _080381A8 - b _08038242 - .pool -_080381A4: - cmp r0, 0x3 - bne _08038242 -_080381A8: - ldr r0, =0x020245b4 - b _08038228 - .pool -_080381B0: - ldr r0, =0x020246e0 - b _08038228 - .pool -_080381B8: - ldr r2, =0x020229e8 - adds r0, r5, r2 - ldrh r1, [r0, 0x18] - movs r3, 0x1 - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - bne _080381DC - mov r1, r8 - adds r0, r1, r2 - ldrh r1, [r0, 0x18] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _080381EA - b _08038210 - .pool -_080381DC: - mov r1, r8 - adds r0, r1, r2 - ldrh r1, [r0, 0x18] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _08038210 -_080381EA: - adds r0, r5, r2 - ldrh r0, [r0, 0x18] - cmp r0, 0x2 - bgt _080381FC - cmp r0, 0x1 - bge _08038208 - cmp r0, 0 - beq _08038200 - b _08038242 -_080381FC: - cmp r0, 0x3 - bne _08038242 -_08038200: - ldr r0, =0x020245b4 - b _08038228 - .pool -_08038208: - ldr r0, =0x020246e0 - b _08038228 - .pool -_08038210: - adds r0, r5, r2 - ldrh r0, [r0, 0x18] - cmp r0, 0x2 - bgt _08038222 - cmp r0, 0x1 - bge _08038238 - cmp r0, 0 - beq _08038226 - b _08038242 -_08038222: - cmp r0, 0x3 - bne _08038242 -_08038226: - ldr r0, =0x0202480c -_08038228: - adds r1, r4, 0 - movs r2, 0x64 - bl memcpy - b _08038242 - .pool -_08038238: - ldr r0, =0x02024938 - adds r1, r4, 0 - movs r2, 0x64 - bl memcpy -_08038242: - movs r2, 0x80 - lsls r2, 1 - adds r4, r2 - adds r5, 0x1C - adds r6, 0x1 - cmp r6, 0x3 - ble _08038184 - ldr r4, =0x020244ec - adds r0, r4, 0 - bl shedinja_something - adds r0, r4, 0 - adds r0, 0x64 - bl shedinja_something - adds r0, r4, 0 - adds r0, 0xC8 - bl shedinja_something - movs r1, 0x96 - lsls r1, 1 - adds r0, r4, r1 - bl shedinja_something - movs r2, 0xC8 - lsls r2, 1 - adds r0, r4, r2 - bl shedinja_something - movs r1, 0xFA - lsls r1, 1 - adds r0, r4, r1 - bl shedinja_something - ldr r4, =0x02024744 - adds r0, r4, 0 - bl shedinja_something - adds r0, r4, 0 - adds r0, 0x64 - bl shedinja_something - adds r0, r4, 0 - adds r0, 0xC8 - bl shedinja_something - movs r2, 0x96 - lsls r2, 1 - adds r0, r4, r2 - bl shedinja_something - movs r1, 0xC8 - lsls r1, 1 - adds r0, r4, r1 - bl shedinja_something - movs r2, 0xFA - lsls r2, 1 - adds r0, r4, r2 - bl shedinja_something - b _080383A6 - .pool -_080382CC: - bl sub_8032768 - bl sub_8184E58 - ldr r3, =0x02024332 - movs r0, 0 - strb r0, [r3, 0x1] - strb r0, [r3, 0x2] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08038326 - movs r6, 0 - ldr r0, =0x020229e8 - ldrb r1, [r0] - adds r4, r3, 0 - adds r2, r0, 0 - cmp r1, 0x3 - bne _0803830A - movs r3, 0xFF -_080382F8: - adds r2, 0x1C - adds r6, 0x1 - cmp r6, 0x3 - bgt _0803830A - ldrh r1, [r2] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0x3 - beq _080382F8 -_0803830A: - cmp r6, 0x4 - bne _08038320 - movs r0, 0x8 - strb r0, [r4] - b _080383F8 - .pool -_08038320: - movs r0, 0xA - strb r0, [r4] - b _080383F8 -_08038326: - movs r0, 0xA - strb r0, [r3] - b _080383F8 -_0803832C: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080383F8 - ldr r0, =0x0202449c - ldr r4, [r0] - movs r0, 0xC0 - lsls r0, 1 - adds r4, r0 - ldr r0, =0x02022fec - ldr r0, [r0] - str r0, [r4] - ldr r0, =0x0203bd2c - ldr r0, [r0] - str r0, [r4, 0x4] - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - movs r2, 0x8 - bl link_0800A448 - b _080383A6 - .pool -_0803836C: - bl sub_800A550 - movs r1, 0xF - ands r1, r0 - cmp r1, 0xF - bne _080383F8 - bl sub_800A5B4 - movs r2, 0 - b _08038386 -_08038380: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 -_08038386: - cmp r2, 0x3 - bhi _080383A6 - ldr r4, =0x020223c4 - lsls r3, r2, 8 - adds r0, r3, r4 - ldrh r0, [r0] - movs r1, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08038380 - adds r1, r4, 0x4 - adds r1, r3, r1 - ldr r0, =0x0203bd2c - movs r2, 0x4 - bl memcpy -_080383A6: - ldr r1, =0x02024332 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080383F8 - .pool -_080383BC: - ldr r0, =0x02024333 - adds r1, r0, 0x1 - bl battle_load_something - lsls r0, 24 - cmp r0, 0 - beq _080383F8 - ldr r2, =0x03005d00 - ldr r1, =0x030022c0 - ldr r0, [r1] - str r0, [r2] - ldr r0, =sub_8039EF0 - str r0, [r1] - ldr r0, =sub_8038420 - bl SetMainCallback2 - ldr r3, =0x02022fec - ldr r2, [r3] - movs r0, 0x2 - ands r0, r2 - cmp r0, 0 - beq _080383F8 - ldr r0, =0x02038bca - movs r4, 0x80 - lsls r4, 4 - adds r1, r4, 0 - strh r1, [r0] - movs r0, 0x20 - orrs r2, r0 - str r2, [r3] -_080383F8: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8037DF4 - - thumb_func_start sub_8038420 -sub_8038420: @ 8038420 - push {lr} - sub sp, 0x4 - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl RunTextPrinters - bl fade_and_return_progress_probably - bl RunActiveTasks - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2C] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08038482 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _08038482 - bl rfu_lacks_rfufunc - lsls r0, 24 - cmp r0, 0 - beq _08038482 - ldr r2, =0x020375f0 - ldr r1, =0x0202433a - movs r0, 0x5 - strb r0, [r1] - movs r0, 0x5 - strh r0, [r2] - bl pal_fade_control_reset_maybe - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =sub_80384E4 - bl SetMainCallback2 -_08038482: - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8038420 - - thumb_func_start sub_803849C -sub_803849C: @ 803849C - push {lr} - ldr r1, =0x030022c0 - ldr r0, =0x03005d00 - ldr r0, [r0] - str r0, [r1] - ldr r2, =0x02039b28 - movs r0, 0x3 - strb r0, [r2, 0x15] - ldr r0, =0x00000439 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x3 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - bl zero_enemy_party_data - movs r0, 0x5A - bl m4aSongNumStop - bl sub_805F094 - bl dp11_free - bl sub_8057028 - pop {r0} - bx r0 - .pool - thumb_func_end sub_803849C - - thumb_func_start sub_80384E4 -sub_80384E4: @ 80384E4 - push {lr} - bl fade_and_return_progress_probably - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08038512 - ldr r0, =0x030075f0 - bl MPlayStop_rev01 - ldr r0, =0x03007630 - bl MPlayStop_rev01 - bl sub_803849C - bl FreeAllWindowBuffers - ldr r0, =0x030022c0 - ldr r0, [r0, 0x8] - bl SetMainCallback2 -_08038512: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80384E4 - - thumb_func_start sub_8038528 -sub_8038528: @ 8038528 - movs r1, 0 - strh r1, [r0, 0x2E] - ldr r1, =sub_8038538 - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_8038528 - - thumb_func_start sub_8038538 -sub_8038538: @ 8038538 - push {r4,r5,lr} - adds r3, r0, 0 - ldr r5, =0x0201c000 - movs r0, 0x2E - ldrsh r1, [r3, r0] - cmp r1, 0x1 - beq _0803856C - cmp r1, 0x1 - bgt _08038554 - cmp r1, 0 - beq _0803855A - b _080385DC - .pool -_08038554: - cmp r1, 0x2 - beq _080385C8 - b _080385DC -_0803855A: - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - strh r1, [r3, 0x30] - ldr r0, =0x00000281 - strh r0, [r3, 0x32] - strh r1, [r3, 0x34] - movs r0, 0x1 - strh r0, [r3, 0x36] -_0803856C: - ldrh r0, [r3, 0x36] - subs r0, 0x1 - strh r0, [r3, 0x36] - lsls r0, 16 - cmp r0, 0 - bne _080385DC - movs r0, 0x2 - strh r0, [r3, 0x36] - movs r4, 0x30 - ldrsh r2, [r3, r4] - movs r0, 0x34 - ldrsh r1, [r3, r0] - lsls r1, 5 - adds r2, r1 - movs r4, 0x32 - ldrsh r0, [r3, r4] - subs r0, r1 - movs r4, 0x3D - lsls r0, 1 - adds r0, r5 - lsls r2, 1 - adds r2, r5 - movs r1, 0x1C -_0803859A: - strh r4, [r2] - strh r4, [r0] - adds r0, 0x4 - adds r2, 0x4 - subs r1, 0x2 - cmp r1, 0 - bge _0803859A - ldrh r0, [r3, 0x34] - adds r0, 0x1 - strh r0, [r3, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x15 - bne _080385DC - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - movs r0, 0x20 - strh r0, [r3, 0x30] - b _080385DC - .pool -_080385C8: - ldrh r0, [r3, 0x30] - subs r0, 0x1 - strh r0, [r3, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - bne _080385DC - ldr r0, =sub_8036760 - bl SetMainCallback2 -_080385DC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8038538 - - thumb_func_start LoadTrainerParty -LoadTrainerParty: @ 80385E8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x28 - str r0, [sp, 0x10] - lsls r1, 16 - lsrs r1, 16 - str r1, [sp, 0x14] - lsls r2, 24 - lsrs r2, 24 - movs r0, 0 - mov r9, r0 - movs r0, 0x80 - lsls r0, 3 - cmp r1, r0 - bne _08038610 - movs r0, 0 - b _080389E2 -_08038610: - ldr r4, =0x02022fec - ldr r0, [r4] - ldr r1, =0x043f0908 - ands r0, r1 - ldr r1, [sp, 0x14] - lsls r1, 2 - str r1, [sp, 0x20] - cmp r0, 0x8 - beq _08038624 - b _080389D2 -_08038624: - cmp r2, 0x1 - bne _0803862C - bl zero_enemy_party_data -_0803862C: - ldr r0, [r4] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _08038668 - ldr r0, =gTrainers - ldr r2, [sp, 0x20] - ldr r3, [sp, 0x14] - adds r1, r2, r3 - lsls r1, 3 - adds r1, r0 - adds r2, r1, 0 - adds r2, 0x20 - ldrb r1, [r2] - movs r4, 0x3 - str r4, [sp, 0x1C] - adds r4, r0, 0 - cmp r1, 0x3 - bhi _0803867C - adds r2, r1, 0 - str r2, [sp, 0x1C] - b _0803867C - .pool -_08038668: - ldr r1, =gTrainers - ldr r2, [sp, 0x20] - ldr r3, [sp, 0x14] - adds r0, r2, r3 - lsls r0, 3 - adds r0, r1 - adds r0, 0x20 - ldrb r0, [r0] - str r0, [sp, 0x1C] - adds r4, r1, 0 -_0803867C: - movs r0, 0 - str r0, [sp, 0x18] - b _080389B4 - .pool -_08038688: - ldr r2, [sp, 0x20] - ldr r3, [sp, 0x14] - adds r0, r2, r3 - lsls r0, 3 - adds r1, r0, r4 - ldrb r0, [r1, 0x18] - cmp r0, 0x1 - bne _0803869E - movs r0, 0x80 - mov r10, r0 - b _080386B0 -_0803869E: - ldrb r1, [r1, 0x2] - movs r0, 0x80 - ands r0, r1 - movs r1, 0x88 - mov r10, r1 - cmp r0, 0 - beq _080386B0 - movs r2, 0x78 - mov r10, r2 -_080386B0: - movs r6, 0 - ldr r2, [sp, 0x20] - ldr r3, [sp, 0x14] - adds r0, r2, r3 - lsls r0, 3 - adds r1, r4, 0x4 - adds r0, r1 - ldrb r0, [r0] - ldr r3, [sp, 0x18] - adds r3, 0x1 - str r3, [sp, 0x24] - cmp r0, 0xFF - beq _080386E6 - adds r3, r1, 0 -_080386CC: - ldr r0, [sp, 0x14] - adds r1, r2, r0 - lsls r1, 3 - adds r0, r6, r1 - adds r0, r3 - ldrb r0, [r0] - add r9, r0 - adds r6, 0x1 - adds r1, r6, r1 - adds r1, r3 - ldrb r0, [r1] - cmp r0, 0xFF - bne _080386CC -_080386E6: - ldr r1, [sp, 0x20] - ldr r2, [sp, 0x14] - adds r0, r1, r2 - lsls r1, r0, 3 - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, 0x1 - beq _08038794 - cmp r0, 0x1 - bgt _08038700 - cmp r0, 0 - beq _0803870E - b _080389AC -_08038700: - cmp r0, 0x2 - bne _08038706 - b _08038854 -_08038706: - cmp r0, 0x3 - bne _0803870C - b _080388E8 -_0803870C: - b _080389AC -_0803870E: - adds r0, r4, 0 - adds r0, 0x24 - adds r0, r1, r0 - ldr r4, [r0] - movs r6, 0 - ldr r3, [sp, 0x18] - lsls r2, r3, 3 - adds r0, r2, r4 - ldrh r1, [r0, 0x4] - movs r0, 0xB - muls r0, r1 - ldr r1, =gSpeciesNames - adds r0, r1 - ldrb r0, [r0] - adds r5, r2, 0 - cmp r0, 0xFF - beq _08038750 - adds r3, r1, 0 - movs r7, 0xB -_08038734: - adds r0, r2, r4 - ldrh r0, [r0, 0x4] - adds r1, r0, 0 - muls r1, r7 - adds r0, r6, r1 - adds r0, r3 - ldrb r0, [r0] - add r9, r0 - adds r6, 0x1 - adds r1, r6, r1 - adds r1, r3 - ldrb r0, [r1] - cmp r0, 0xFF - bne _08038734 -_08038750: - mov r2, r9 - lsls r0, r2, 8 - add r10, r0 - adds r4, r5, r4 - ldrh r1, [r4] - lsls r0, r1, 5 - subs r0, r1 - movs r1, 0xFF - bl __divsi3 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r3, [sp, 0x18] - movs r1, 0x64 - adds r0, r3, 0 - muls r0, r1 - ldr r2, [sp, 0x10] - adds r0, r2, r0 - ldrh r1, [r4, 0x4] - ldrb r2, [r4, 0x2] - movs r3, 0x1 - str r3, [sp] - mov r3, r10 - str r3, [sp, 0x4] - movs r3, 0x2 - str r3, [sp, 0x8] - movs r3, 0 - str r3, [sp, 0xC] - adds r3, r6, 0 - bl create_pokemon_set_level - b _080389AC - .pool -_08038794: - adds r0, r4, 0 - adds r0, 0x24 - adds r0, r1, r0 - ldr r7, [r0] - movs r6, 0 - ldr r4, [sp, 0x18] - lsls r2, r4, 4 - adds r0, r2, r7 - ldrh r1, [r0, 0x4] - movs r0, 0xB - muls r0, r1 - ldr r1, =gSpeciesNames - adds r0, r1 - ldrb r0, [r0] - mov r8, r2 - cmp r0, 0xFF - beq _080387D6 - adds r3, r1, 0 - movs r4, 0xB -_080387BA: - adds r0, r2, r7 - ldrh r0, [r0, 0x4] - adds r1, r0, 0 - muls r1, r4 - adds r0, r6, r1 - adds r0, r3 - ldrb r0, [r0] - add r9, r0 - adds r6, 0x1 - adds r1, r6, r1 - adds r1, r3 - ldrb r0, [r1] - cmp r0, 0xFF - bne _080387BA -_080387D6: - mov r2, r9 - lsls r0, r2, 8 - add r10, r0 - mov r3, r8 - adds r4, r3, r7 - ldrh r1, [r4] - lsls r0, r1, 5 - subs r0, r1 - movs r1, 0xFF - bl __divsi3 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, [sp, 0x18] - movs r1, 0x64 - adds r5, r0, 0 - muls r5, r1 - ldr r2, [sp, 0x10] - adds r5, r2, r5 - ldrh r1, [r4, 0x4] - ldrb r2, [r4, 0x2] - movs r0, 0x1 - str r0, [sp] - mov r3, r10 - str r3, [sp, 0x4] - movs r0, 0x2 - str r0, [sp, 0x8] - movs r0, 0 - str r0, [sp, 0xC] - adds r0, r5, 0 - adds r3, r6, 0 - bl create_pokemon_set_level - movs r6, 0 - mov r0, r8 - adds r0, 0x6 - adds r4, r7, r0 -_08038820: - adds r1, r6, 0 - adds r1, 0xD - adds r0, r5, 0 - adds r2, r4, 0 - bl pokemon_setattr - adds r1, r6, 0 - adds r1, 0x11 - ldrh r0, [r4] - lsls r2, r0, 1 - adds r2, r0 - lsls r2, 2 - ldr r0, =gBattleMoves + 0x4 @ PP offset - adds r2, r0 - adds r0, r5, 0 - bl pokemon_setattr - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - ble _08038820 - b _080389AC - .pool -_08038854: - adds r0, r4, 0 - adds r0, 0x24 - adds r0, r1, r0 - ldr r4, [r0] - movs r6, 0 - ldr r0, [sp, 0x18] - lsls r2, r0, 3 - adds r0, r2, r4 - ldrh r1, [r0, 0x4] - movs r0, 0xB - muls r0, r1 - ldr r1, =gSpeciesNames - adds r0, r1 - ldrb r0, [r0] - adds r5, r2, 0 - cmp r0, 0xFF - beq _08038896 - adds r3, r1, 0 - movs r7, 0xB -_0803887A: - adds r0, r2, r4 - ldrh r0, [r0, 0x4] - adds r1, r0, 0 - muls r1, r7 - adds r0, r6, r1 - adds r0, r3 - ldrb r0, [r0] - add r9, r0 - adds r6, 0x1 - adds r1, r6, r1 - adds r1, r3 - ldrb r0, [r1] - cmp r0, 0xFF - bne _0803887A -_08038896: - mov r2, r9 - lsls r0, r2, 8 - add r10, r0 - adds r5, r4 - ldrh r1, [r5] - lsls r0, r1, 5 - subs r0, r1 - movs r1, 0xFF - bl __divsi3 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r3, [sp, 0x18] - movs r0, 0x64 - adds r4, r3, 0 - muls r4, r0 - ldr r1, [sp, 0x10] - adds r4, r1, r4 - ldrh r1, [r5, 0x4] - ldrb r2, [r5, 0x2] - movs r0, 0x1 - str r0, [sp] - mov r3, r10 - str r3, [sp, 0x4] - movs r0, 0x2 - str r0, [sp, 0x8] - movs r0, 0 - str r0, [sp, 0xC] - adds r0, r4, 0 - adds r3, r6, 0 - bl create_pokemon_set_level - adds r5, 0x6 - adds r0, r4, 0 - movs r1, 0xC - adds r2, r5, 0 - bl pokemon_setattr - b _080389AC - .pool -_080388E8: - adds r0, r4, 0 - adds r0, 0x24 - adds r0, r1, r0 - ldr r7, [r0] - movs r6, 0 - ldr r4, [sp, 0x18] - lsls r2, r4, 4 - adds r0, r2, r7 - ldrh r1, [r0, 0x4] - movs r0, 0xB - muls r0, r1 - ldr r1, =gSpeciesNames - adds r0, r1 - ldrb r0, [r0] - mov r8, r2 - cmp r0, 0xFF - beq _0803892A - adds r3, r1, 0 - movs r4, 0xB -_0803890E: - adds r0, r2, r7 - ldrh r0, [r0, 0x4] - adds r1, r0, 0 - muls r1, r4 - adds r0, r6, r1 - adds r0, r3 - ldrb r0, [r0] - add r9, r0 - adds r6, 0x1 - adds r1, r6, r1 - adds r1, r3 - ldrb r0, [r1] - cmp r0, 0xFF - bne _0803890E -_0803892A: - mov r2, r9 - lsls r0, r2, 8 - add r10, r0 - mov r3, r8 - adds r5, r3, r7 - ldrh r1, [r5] - lsls r0, r1, 5 - subs r0, r1 - movs r1, 0xFF - bl __divsi3 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, [sp, 0x18] - movs r1, 0x64 - adds r4, r0, 0 - muls r4, r1 - ldr r2, [sp, 0x10] - adds r4, r2, r4 - ldrh r1, [r5, 0x4] - ldrb r2, [r5, 0x2] - movs r0, 0x1 - str r0, [sp] - mov r3, r10 - str r3, [sp, 0x4] - movs r0, 0x2 - str r0, [sp, 0x8] - movs r0, 0 - str r0, [sp, 0xC] - adds r0, r4, 0 - adds r3, r6, 0 - bl create_pokemon_set_level - adds r5, 0x6 - adds r0, r4, 0 - movs r1, 0xC - adds r2, r5, 0 - bl pokemon_setattr - movs r6, 0 - adds r5, r4, 0 - mov r0, r8 - adds r0, 0x8 - adds r4, r7, r0 -_08038982: - adds r1, r6, 0 - adds r1, 0xD - adds r0, r5, 0 - adds r2, r4, 0 - bl pokemon_setattr - adds r1, r6, 0 - adds r1, 0x11 - ldrh r0, [r4] - lsls r2, r0, 1 - adds r2, r0 - lsls r2, 2 - ldr r0, =gBattleMoves + 0x4 @ PP offset - adds r2, r0 - adds r0, r5, 0 - bl pokemon_setattr - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - ble _08038982 -_080389AC: - ldr r4, [sp, 0x24] - str r4, [sp, 0x18] - ldr r4, =gTrainers - ldr r0, [sp, 0x18] -_080389B4: - ldr r1, [sp, 0x1C] - cmp r0, r1 - bge _080389BC - b _08038688 -_080389BC: - ldr r2, =0x02022fec - ldr r1, =gTrainers - ldr r3, [sp, 0x20] - ldr r4, [sp, 0x14] - adds r0, r3, r4 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0x18] - ldr r0, [r2] - orrs r0, r1 - str r0, [r2] -_080389D2: - ldr r0, =gTrainers - ldr r2, [sp, 0x20] - ldr r3, [sp, 0x14] - adds r1, r2, r3 - lsls r1, 3 - adds r1, r0 - adds r1, 0x20 - ldrb r0, [r1] -_080389E2: - add sp, 0x28 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end LoadTrainerParty - - thumb_func_start sub_8038A04 -sub_8038A04: @ 8038A04 - push {lr} - ldr r0, =0x04000006 - ldrh r0, [r0] - subs r0, 0x6F - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x30 - bhi _08038A1E - movs r1, 0x98 - lsls r1, 8 - movs r0, 0x8 - bl SetGpuReg -_08038A1E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8038A04 - - thumb_func_start vblank_cb_08078BB4 -vblank_cb_08078BB4: @ 8038A28 - push {lr} - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x013f0102 - ands r0, r1 - cmp r0, 0 - bne _08038A3A - bl GenerateRandomNumber -_08038A3A: - ldr r0, =0x02022e14 - ldrh r1, [r0] - movs r0, 0x10 - bl SetGpuReg - ldr r0, =0x02022e16 - ldrh r1, [r0] - movs r0, 0x12 - bl SetGpuReg - ldr r0, =0x02022e18 - ldrh r1, [r0] - movs r0, 0x14 - bl SetGpuReg - ldr r0, =0x02022e1a - ldrh r1, [r0] - movs r0, 0x16 - bl SetGpuReg - ldr r0, =0x02022e1c - ldrh r1, [r0] - movs r0, 0x18 - bl SetGpuReg - ldr r0, =0x02022e1e - ldrh r1, [r0] - movs r0, 0x1A - bl SetGpuReg - ldr r0, =0x02022e20 - ldrh r1, [r0] - movs r0, 0x1C - bl SetGpuReg - ldr r0, =0x02022e22 - ldrh r1, [r0] - movs r0, 0x1E - bl SetGpuReg - ldr r0, =0x02022e24 - ldrh r1, [r0] - movs r0, 0x40 - bl SetGpuReg - ldr r0, =0x02022e26 - ldrh r1, [r0] - movs r0, 0x44 - bl SetGpuReg - ldr r0, =0x02022e28 - ldrh r1, [r0] - movs r0, 0x42 - bl SetGpuReg - ldr r0, =0x02022e2a - ldrh r1, [r0] - movs r0, 0x46 - bl SetGpuReg - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - bl sub_80BA0A8 - pop {r0} - bx r0 - .pool - thumb_func_end vblank_cb_08078BB4 - - thumb_func_start nullsub_17 -nullsub_17: @ 8038B00 - bx lr - thumb_func_end nullsub_17 - - thumb_func_start sub_8038B04 -sub_8038B04: @ 8038B04 - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _08038B24 - movs r1, 0x32 - ldrsh r0, [r5, r1] - movs r1, 0xFF - lsls r1, 8 - ands r0, r1 - lsrs r0, 8 - ldrh r1, [r5, 0x30] - adds r0, r1 - strh r0, [r5, 0x20] - b _08038B36 -_08038B24: - movs r1, 0x32 - ldrsh r0, [r5, r1] - movs r1, 0xFF - lsls r1, 8 - ands r0, r1 - asrs r0, 8 - ldrh r1, [r5, 0x30] - subs r1, r0 - strh r1, [r5, 0x20] -_08038B36: - movs r1, 0xC0 - lsls r1, 1 - adds r0, r1, 0 - ldrh r1, [r5, 0x32] - adds r0, r1 - strh r0, [r5, 0x32] - adds r0, r5, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08038B6A - ldr r4, =0x00002710 - adds r0, r4, 0 - bl FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - adds r0, r5, 0 - bl obj_free_rotscale_entry - adds r0, r5, 0 - bl RemoveObjectAndFreeTiles -_08038B6A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8038B04 - - thumb_func_start sub_8038B74 -sub_8038B74: @ 8038B74 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim - ldr r0, =sub_8038B04 - str r0, [r4, 0x1C] - movs r0, 0x68 - bl audio_play - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8038B74 - - thumb_func_start sub_8038B94 -sub_8038B94: @ 8038B94 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - ldr r0, =0x02024474 - adds r0, 0x25 - ldrb r2, [r0] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08038C04 - ldr r1, =0x020229e8 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0, 0x18] - cmp r0, 0x1 - beq _08038BF0 - cmp r0, 0x1 - bgt _08038BE8 - cmp r0, 0 - beq _08038C04 - b _08038C0C - .pool -_08038BE8: - cmp r0, 0x2 - beq _08038C04 - cmp r0, 0x3 - bne _08038C0C -_08038BF0: - ldr r0, =0x02024744 - str r0, [sp, 0x4] - ldr r1, =0x020244ec - str r1, [sp, 0x8] - b _08038C0C - .pool -_08038C04: - ldr r2, =0x020244ec - str r2, [sp, 0x4] - ldr r3, =0x02024744 - str r3, [sp, 0x8] -_08038C0C: - movs r7, 0 - movs r0, 0 - mov r8, r0 - ldr r1, [sp] - lsls r1, 2 - str r1, [sp, 0xC] - movs r2, 0xCE - lsls r2, 1 - mov r10, r2 - mov r9, r0 -_08038C20: - movs r0, 0x64 - mov r4, r8 - muls r4, r0 - ldr r3, [sp, 0x4] - adds r4, r3, r4 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - lsls r0, 16 - lsrs r6, r0, 16 - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr - adds r1, r0, 0 - cmp r5, 0 - beq _08038C90 - cmp r5, r10 - beq _08038C64 - cmp r6, 0 - beq _08038C64 - cmp r1, 0 - bne _08038C64 - movs r0, 0x1 - mov r2, r9 - lsls r0, r2 - orrs r7, r0 -_08038C64: - cmp r5, 0 - beq _08038C90 - cmp r6, 0 - beq _08038C7C - cmp r5, r10 - beq _08038C74 - cmp r1, 0 - beq _08038C7C -_08038C74: - movs r0, 0x2 - mov r3, r9 - lsls r0, r3 - orrs r7, r0 -_08038C7C: - cmp r5, 0 - beq _08038C90 - cmp r5, r10 - beq _08038C90 - cmp r6, 0 - bne _08038C90 - movs r0, 0x3 - mov r1, r9 - lsls r0, r1 - orrs r7, r0 -_08038C90: - movs r2, 0x2 - add r9, r2 - movs r3, 0x1 - add r8, r3 - mov r0, r8 - cmp r0, 0x5 - ble _08038C20 - ldr r1, =0x03005e00 - ldr r2, [sp, 0xC] - ldr r3, [sp] - adds r0, r2, r3 - lsls r0, 3 - adds r0, r1 - strh r7, [r0, 0xE] - movs r7, 0 - movs r0, 0 - mov r8, r0 - movs r1, 0xCE - lsls r1, 1 - mov r10, r1 - mov r9, r0 -_08038CBA: - movs r0, 0x64 - mov r4, r8 - muls r4, r0 - ldr r2, [sp, 0x8] - adds r4, r2, r4 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - lsls r0, 16 - lsrs r6, r0, 16 - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr - adds r1, r0, 0 - cmp r5, 0 - beq _08038D2A - cmp r5, r10 - beq _08038CFE - cmp r6, 0 - beq _08038CFE - cmp r1, 0 - bne _08038CFE - movs r0, 0x1 - mov r3, r9 - lsls r0, r3 - orrs r7, r0 -_08038CFE: - cmp r5, 0 - beq _08038D2A - cmp r6, 0 - beq _08038D16 - cmp r5, r10 - beq _08038D0E - cmp r1, 0 - beq _08038D16 -_08038D0E: - movs r0, 0x2 - mov r1, r9 - lsls r0, r1 - orrs r7, r0 -_08038D16: - cmp r5, 0 - beq _08038D2A - cmp r5, r10 - beq _08038D2A - cmp r6, 0 - bne _08038D2A - movs r0, 0x3 - mov r2, r9 - lsls r0, r2 - orrs r7, r0 -_08038D2A: - movs r3, 0x2 - add r9, r3 - movs r0, 0x1 - add r8, r0 - mov r1, r8 - cmp r1, 0x5 - ble _08038CBA - ldr r1, =0x03005e00 - ldr r2, [sp, 0xC] - ldr r3, [sp] - adds r0, r2, r3 - lsls r0, 3 - adds r0, r1 - strh r7, [r0, 0x10] - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8038B94 - - thumb_func_start sub_8038D64 -sub_8038D64: @ 8038D64 - push {r4,lr} - sub sp, 0x4 - movs r0, 0 - bl SetHBlankCallback - movs r0, 0 - bl SetVBlankCallback - ldr r0, =0x02022fec - ldr r1, [r0] - movs r2, 0x21 - negs r2, r2 - ands r1, r2 - str r1, [r0] - ldr r0, =0x003f0100 - ands r0, r1 - cmp r0, 0 - beq _08038DAC - ldr r0, =0x030022c0 - ldr r0, [r0, 0x8] - bl SetMainCallback2 - bl sub_8057028 - bl dp11_free - bl sub_805F094 - b _08038EB6 - .pool -_08038DAC: - str r0, [sp] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x05006000 - mov r0, sp - bl CpuSet - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - movs r0, 0x40 - movs r1, 0xF0 - bl SetGpuReg - ldr r4, =0x00005051 - movs r0, 0x44 - adds r1, r4, 0 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4A - movs r1, 0 - bl SetGpuReg - ldr r1, =0x02022e24 - movs r0, 0xF0 - strh r0, [r1] - ldr r0, =0x02022e26 - strh r4, [r0] - bl dp12_8087EA4 - ldr r0, =0x02038c28 - movs r3, 0xF0 - movs r1, 0xF0 - lsls r1, 3 - adds r2, r0, r1 - movs r1, 0x4F -_08038DFE: - strh r3, [r0] - strh r3, [r2] - adds r2, 0x2 - adds r0, 0x2 - subs r1, 0x1 - cmp r1, 0 - bge _08038DFE - movs r1, 0x50 - ldr r0, =0x02038c28 - ldr r3, =0x0000ff10 - movs r4, 0x82 - lsls r4, 4 - adds r2, r0, r4 - adds r0, 0xA0 -_08038E1A: - strh r3, [r0] - strh r3, [r2] - adds r2, 0x2 - adds r0, 0x2 - adds r1, 0x1 - cmp r1, 0x9F - ble _08038E1A - bl sub_80A1A74 - ldr r0, =0x02022e14 - movs r4, 0 - strh r4, [r0] - ldr r0, =0x02022e16 - strh r4, [r0] - ldr r0, =0x02022e18 - strh r4, [r0] - ldr r0, =0x02022e1a - strh r4, [r0] - ldr r0, =0x02022e1c - strh r4, [r0] - ldr r0, =0x02022e1e - strh r4, [r0] - ldr r0, =0x02022e20 - strh r4, [r0] - ldr r0, =0x02022e22 - strh r4, [r0] - bl c2_berry_program_update_menu - ldr r0, =gUnknown_08C004E0 - movs r1, 0 - movs r2, 0x40 - bl decompress_palette - bl sub_803570C - bl ResetAllObjectData - bl clear_tasks - bl sub_8036154 - movs r0, 0x4A - movs r1, 0x37 - bl SetGpuReg - bl ResetObjectPaletteAllocator - ldr r1, =0x0300301c - movs r0, 0x4 - strb r0, [r1] - ldr r0, =vblank_cb_08078BB4 - bl SetVBlankCallback - ldr r0, =task00_0800F6FC - movs r1, 0 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r2, 0x87 - lsls r2, 1 - strh r2, [r1, 0xA] - movs r2, 0x5A - strh r2, [r1, 0xC] - movs r2, 0x1 - strh r2, [r1, 0x12] - bl sub_8038B94 - ldr r0, =sub_8038F14 - bl SetMainCallback2 - ldr r0, =0x02024332 - strb r4, [r0] -_08038EB6: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8038D64 - - thumb_func_start sub_8038F14 -sub_8038F14: @ 8038F14 - push {lr} - bl sub_8038F34 - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl RunTextPrinters - bl fade_and_return_progress_probably - bl RunActiveTasks - pop {r0} - bx r0 - thumb_func_end sub_8038F14 - - thumb_func_start sub_8038F34 -sub_8038F34: @ 8038F34 - push {r4-r6,lr} - sub sp, 0x8 - ldr r0, =0x02024332 - ldrb r1, [r0] - adds r4, r0, 0 - cmp r1, 0x9 - bls _08038F44 - b _080391C6 -_08038F44: - lsls r0, r1, 2 - ldr r1, =_08038F58 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08038F58: - .4byte _08038F80 - .4byte _08038FA0 - .4byte _08038FC2 - .4byte _080390C8 - .4byte _08039100 - .4byte _08039118 - .4byte _0803912C - .4byte _0803914C - .4byte _08039166 - .4byte _08039184 -_08038F80: - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - ldr r1, =0x02024332 - movs r0, 0xFF - strb r0, [r1, 0x1] - b _08039174 - .pool -_08038FA0: - ldrb r0, [r4, 0x1] - subs r0, 0x1 - strb r0, [r4, 0x1] - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _08038FB0 - b _080391C6 -_08038FB0: - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - b _0803910C -_08038FC2: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08038FD0 - b _080391C6 -_08038FD0: - bl sub_8185FAC - ldr r2, =0x030022c0 - ldr r1, =0x00000439 - adds r2, r1 - movs r1, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r3, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - movs r3, 0x2 - cmp r0, 0 - beq _08038FFC - movs r3, 0x4 -_08038FFC: - movs r4, 0 - ldr r6, =0x03005d90 - cmp r4, r3 - bge _08039022 - ldr r1, =0x020229e8 - ldrb r0, [r1] - cmp r0, 0x3 - bne _08039022 - movs r5, 0xFF - adds r2, r1, 0 -_08039010: - adds r2, 0x1C - adds r4, 0x1 - cmp r4, r3 - bge _08039022 - ldrh r1, [r2] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0x3 - beq _08039010 -_08039022: - ldr r0, [r6] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - bne _080390AC - cmp r4, r3 - bne _080390AC - ldr r0, =0x000008d2 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _08039074 - bl FreeAllWindowBuffers - ldr r0, =sub_80392A8 - bl SetMainCallback2 - b _080391C6 - .pool -_08039074: - ldr r2, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r2, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - bne _08039090 - ldr r0, [r2, 0x8] - b _080390B0 - .pool -_08039090: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _08039172 - ldr r0, =sub_80B3AF8 - movs r1, 0x5 - bl AddTask - b _08039172 - .pool -_080390AC: - ldr r0, =0x030022c0 - ldr r0, [r0, 0x8] -_080390B0: - bl SetMainCallback2 - bl sub_8057028 - bl dp11_free - bl sub_805F094 - b _080391C6 - .pool -_080390C8: - movs r0, 0 - str r0, [sp, 0x4] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x05006000 - add r0, sp, 0x4 - bl CpuSet - movs r4, 0 -_080390DA: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_80363C4 - adds r4, 0x1 - cmp r4, 0x1 - ble _080390DA - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - b _08039172 - .pool -_08039100: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080391C6 -_0803910C: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _080391C6 - .pool -_08039118: - ldr r0, =sub_80B3AF8 - bl is_function_an_active_task - lsls r0, 24 - cmp r0, 0 - bne _080391C6 - b _08039172 - .pool -_0803912C: - bl sub_800A520 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080391C6 - bl sub_800ADF8 - ldr r0, =gUnknown_0824978D - movs r1, 0 - bl battle_show_message_maybe - b _08039172 - .pool -_0803914C: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _080391C6 - bl sub_800A520 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080391C6 - b _08039172 -_08039166: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _08039172 - bl sub_800AC34 -_08039172: - ldr r1, =0x02024332 -_08039174: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080391C6 - .pool -_08039184: - ldr r2, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r2, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - adds r3, r2, 0 - cmp r0, 0 - beq _080391A6 - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _080391A6 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0x1 - beq _080391C6 -_080391A6: - ldr r0, =0x00000439 - adds r2, r3, r0 - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldr r0, [r3, 0x8] - bl SetMainCallback2 - bl sub_8057028 - bl dp11_free - bl sub_805F094 -_080391C6: - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8038F34 - - thumb_func_start sub_80391E0 -sub_80391E0: @ 80391E0 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0 - cmp r1, 0x6 - bhi _080392A0 - lsls r0, r1, 2 - ldr r1, =_08039200 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08039200: - .4byte _0803921C - .4byte _08039230 - .4byte _08039244 - .4byte _08039258 - .4byte _0803926C - .4byte _08039280 - .4byte _08039294 -_0803921C: - ldr r0, =gUnknown_0831AA08 - lsls r1, r2, 2 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 30 - lsrs r0, 30 - b _080392A0 - .pool -_08039230: - ldr r0, =gUnknown_0831AA08 - lsls r1, r2, 2 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 28 - lsrs r0, 30 - b _080392A0 - .pool -_08039244: - ldr r0, =gUnknown_0831AA08 - lsls r1, r2, 2 - adds r1, r0 - ldrh r0, [r1] - lsls r0, 23 - lsrs r0, 27 - b _080392A0 - .pool -_08039258: - ldr r0, =gUnknown_0831AA08 - lsls r1, r2, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - lsls r0, 29 - lsrs r0, 30 - b _080392A0 - .pool -_0803926C: - ldr r0, =gUnknown_0831AA08 - lsls r1, r2, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - lsls r0, 28 - lsrs r0, 31 - b _080392A0 - .pool -_08039280: - ldr r0, =gUnknown_0831AA08 - lsls r1, r2, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - lsls r0, 26 - lsrs r0, 30 - b _080392A0 - .pool -_08039294: - ldr r0, =gUnknown_0831AA08 - lsls r1, r2, 2 - adds r1, r0 - ldr r0, [r1] - lsls r0, 8 - lsrs r0, 22 -_080392A0: - pop {r1} - bx r1 - .pool - thumb_func_end sub_80391E0 - - thumb_func_start sub_80392A8 -sub_80392A8: @ 80392A8 - push {r4,lr} - sub sp, 0x8 - movs r0, 0 - bl SetHBlankCallback - movs r0, 0 - bl SetVBlankCallback - movs r4, 0 - str r4, [sp, 0x4] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x05006000 - add r0, sp, 0x4 - bl CpuSet - bl sub_80A1A74 - ldr r0, =0x02022e14 - strh r4, [r0] - ldr r0, =0x02022e16 - strh r4, [r0] - ldr r0, =0x02022e18 - strh r4, [r0] - ldr r0, =0x02022e1a - strh r4, [r0] - ldr r0, =0x02022e1c - strh r4, [r0] - ldr r0, =0x02022e1e - strh r4, [r0] - ldr r0, =0x02022e20 - strh r4, [r0] - ldr r0, =0x02022e22 - strh r4, [r0] - bl c2_berry_program_update_menu - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - bl sub_803570C -_080392FE: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_80363C4 - adds r4, 0x1 - cmp r4, 0x1 - ble _080392FE - bl ResetAllObjectData - bl clear_tasks - bl ResetObjectPaletteAllocator - ldr r1, =0x0300301c - movs r0, 0x4 - strb r0, [r1] - ldr r0, =vblank_cb_08078BB4 - bl SetVBlankCallback - ldr r0, =sub_803937C - bl SetMainCallback2 - movs r0, 0x1 - negs r0, r0 - movs r4, 0 - str r4, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r0, =0x02024332 - strb r4, [r0] - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80392A8 - - thumb_func_start sub_803937C -sub_803937C: @ 803937C - push {lr} - bl sub_803939C - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl RunTextPrinters - bl fade_and_return_progress_probably - bl RunActiveTasks - pop {r0} - bx r0 - thumb_func_end sub_803937C - - thumb_func_start sub_803939C -sub_803939C: @ 803939C - push {r4,r5,lr} - sub sp, 0x4 - ldr r0, =0x02024332 - ldrb r1, [r0] - adds r4, r0, 0 - cmp r1, 0xC - bls _080393AC - b _0803975E -_080393AC: - lsls r0, r1, 2 - ldr r1, =_080393C0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080393C0: - .4byte _080393F4 - .4byte _08039414 - .4byte _08039450 - .4byte _08039470 - .4byte _0803949C - .4byte _080394D8 - .4byte _0803957C - .4byte _08039704 - .4byte _080395CC - .4byte _08039610 - .4byte _08039678 - .4byte _080396A8 - .4byte _08039704 -_080393F4: - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - ldr r1, =0x02024332 - ldrb r0, [r1] - adds r0, 0x1 - b _0803975C - .pool -_08039414: - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08039434 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _08039434 - ldr r0, =sub_80B3AF8 - movs r1, 0x5 - bl AddTask -_08039434: - ldr r1, =0x02024332 - ldrb r0, [r1] - adds r0, 0x1 - b _0803975C - .pool -_08039450: - ldr r0, =sub_80B3AF8 - bl is_function_an_active_task - lsls r0, 24 - cmp r0, 0 - beq _0803945E - b _0803975E -_0803945E: - ldr r1, =0x02024332 - ldrb r0, [r1] - adds r0, 0x1 - b _0803975C - .pool -_08039470: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0803947E - b _0803975E -_0803947E: - ldr r0, =gUnknown_085CD28F - movs r1, 0 - bl battle_show_message_maybe - ldr r1, =0x02024332 - ldrb r0, [r1] - adds r0, 0x1 - b _0803975C - .pool -_0803949C: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - beq _080394AC - b _0803975E -_080394AC: - str r0, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - ldr r0, =gUnknown_085CCABB - movs r1, 0xC - bl battle_show_message_maybe - ldr r4, =0x02024332 - movs r0, 0x1 - strb r0, [r4, 0x1] - bl sub_8056B74 - b _080396EA - .pool -_080394D8: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08039500 - ldrb r0, [r4, 0x1] - cmp r0, 0 - bne _080394EC - b _0803975E -_080394EC: - movs r0, 0x5 - bl audio_play - ldrb r0, [r4, 0x1] - bl sub_8056BAC - movs r0, 0 - b _0803951E - .pool -_08039500: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08039526 - ldrb r0, [r4, 0x1] - cmp r0, 0 - beq _08039510 - b _0803975E -_08039510: - movs r0, 0x5 - bl audio_play - ldrb r0, [r4, 0x1] - bl sub_8056BAC - movs r0, 0x1 -_0803951E: - strb r0, [r4, 0x1] - bl sub_8056B74 - b _0803975E -_08039526: - movs r5, 0x1 - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _08039560 - movs r0, 0x5 - bl audio_play - ldr r4, =0x02024332 - ldrb r0, [r4, 0x1] - cmp r0, 0 - beq _08039540 - b _080396EA -_08039540: - str r5, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - bl sub_8185338 - strb r0, [r4, 0x1] - movs r0, 0xA - strb r0, [r4] - b _0803975E - .pool -_08039560: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _0803956A - b _0803975E -_0803956A: - movs r0, 0x5 - bl audio_play - ldr r1, =0x02024332 - ldrb r0, [r1] - adds r0, 0x1 - b _0803975C - .pool -_0803957C: - bl sub_800A520 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0803958A - b _0803975E -_0803958A: - str r0, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080395B4 - bl sub_800ADF8 - ldr r0, =gUnknown_0824978D - movs r1, 0 - bl battle_show_message_maybe -_080395B4: - ldr r1, =0x02024332 - ldrb r0, [r1] - adds r0, 0x1 - b _0803975C - .pool -_080395CC: - ldrb r0, [r4, 0x1] - subs r0, 0x1 - strb r0, [r4, 0x1] - lsls r0, 24 - cmp r0, 0 - beq _080395DA - b _0803975E -_080395DA: - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080395F6 - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _080395F6 - bl sub_800AC34 -_080395F6: - ldr r1, =0x02024332 - ldrb r0, [r1] - adds r0, 0x1 - b _0803975C - .pool -_08039610: - ldr r2, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r2, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - adds r3, r2, 0 - cmp r0, 0 - beq _08039634 - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _08039634 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0x1 - bne _08039634 - b _0803975E -_08039634: - ldr r0, =0x00000439 - adds r2, r3, r0 - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08039650 - b _0803975E -_08039650: - ldr r0, [r3, 0x8] - bl SetMainCallback2 - bl sub_8057028 - bl dp11_free - bl sub_805F094 - b _0803975E - .pool -_08039678: - ldrb r0, [r4, 0x1] - cmp r0, 0x1 - bne _080396A0 - movs r0, 0x37 - bl audio_play - ldr r0, =gUnknown_085CD2CB -_08039686: - bl get_battle_strings_ - ldr r0, =0x02022e2c - movs r1, 0 - bl battle_show_message_maybe - movs r0, 0x80 - strb r0, [r4, 0x1] - b _080396EA - .pool -_080396A0: - ldr r0, =gUnknown_08242481 - b _08039686 - .pool -_080396A8: - bl sub_800A520 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0803975E - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _0803975E - ldr r4, =0x02024332 - ldrb r0, [r4, 0x1] - subs r0, 0x1 - strb r0, [r4, 0x1] - lsls r0, 24 - cmp r0, 0 - bne _0803975E - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080396EA - bl sub_800ADF8 - ldr r0, =gUnknown_0824978D - movs r1, 0 - bl battle_show_message_maybe -_080396EA: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _0803975E - .pool -_08039704: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - bne _0803975E - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _08039744 - bl sub_800A520 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0803975E - movs r0, 0x1 - negs r0, r0 - str r4, [sp] - b _0803974A - .pool -_08039744: - movs r0, 0x1 - negs r0, r0 - str r1, [sp] -_0803974A: - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, =0x02024332 - movs r0, 0x20 - strb r0, [r1, 0x1] - movs r0, 0x8 -_0803975C: - strb r0, [r1] -_0803975E: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803939C - - thumb_func_start shedinja_something -shedinja_something: @ 803976C - push {r4,r5,lr} - sub sp, 0x10 - adds r4, r0, 0 - add r5, sp, 0xC - movs r0, 0x1 - strb r0, [r5] - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - ldr r1, =0x0000012f - cmp r0, r1 - bne _080397B4 - adds r0, r4, 0 - movs r1, 0x3 - bl pokemon_getattr - ldrb r1, [r5] - cmp r0, r1 - beq _080397B4 - adds r0, r4, 0 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - ldr r1, =gUnknown_0831ACA0 - mov r0, sp - bl CompareStringWithoutExtendedControlCodes - cmp r0, 0 - bne _080397B4 - adds r0, r4, 0 - movs r1, 0x3 - adds r2, r5, 0 - bl pokemon_setattr -_080397B4: - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end shedinja_something - - thumb_func_start sub_80397C4 -sub_80397C4: @ 80397C4 - ldr r2, =gUnknown_0831ABA0 - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - lsls r1, 3 - adds r1, r0 - ldrb r0, [r1, 0x3] - lsls r0, 3 - bx lr - .pool - thumb_func_end sub_80397C4 - - thumb_func_start oac_poke_opponent -oac_poke_opponent: @ 80397DC - push {lr} - sub sp, 0x4 - ldr r1, =sub_803980C - str r1, [r0, 0x1C] - movs r1, 0 - bl StartObjectImageAnimIfDifferent - movs r0, 0x80 - lsls r0, 10 - ldr r1, =0x00002108 - str r1, [sp] - movs r1, 0 - movs r2, 0xA - movs r3, 0xA - bl pal_fade_maybe - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end oac_poke_opponent - - thumb_func_start sub_803980C -sub_803980C: @ 803980C - push {lr} - adds r2, r0, 0 - ldr r0, =0x020243fc - ldrh r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0803982C - ldrh r0, [r2, 0x24] - adds r0, 0x2 - strh r0, [r2, 0x24] - lsls r0, 16 - cmp r0, 0 - bne _0803982C - ldr r0, =sub_8039838 - str r0, [r2, 0x1C] -_0803982C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_803980C - - thumb_func_start sub_8039838 -sub_8039838: @ 8039838 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08039880 - ldrh r0, [r4, 0x2E] - lsls r0, 24 - lsrs r0, 24 - bl sub_8076918 - ldr r1, =0x03005d70 - movs r2, 0x2E - ldrsh r0, [r4, r2] - adds r0, r1 - ldrb r0, [r0] - bl sub_80729D0 - ldr r0, =sub_8039894 - str r0, [r4, 0x1C] - adds r0, r4, 0 - movs r1, 0 - bl StartObjectImageAnimIfDifferent - movs r0, 0x80 - lsls r0, 10 - ldr r1, =0x00002108 - str r1, [sp] - movs r1, 0 - movs r2, 0xA - movs r3, 0 - bl pal_fade_maybe -_08039880: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039838 - - thumb_func_start sub_8039894 -sub_8039894: @ 8039894 - push {lr} - adds r2, r0, 0 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080398B0 - ldrh r1, [r2, 0x32] - adds r0, r2, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_806ECEC -_080398B0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039894 - - thumb_func_start nullsub_18 -nullsub_18: @ 80398B8 - bx lr - thumb_func_end nullsub_18 - - thumb_func_start sub_80398BC -sub_80398BC: @ 80398BC - movs r1, 0x6 - strh r1, [r0, 0x34] - movs r1, 0x1 - strh r1, [r0, 0x36] - ldr r1, =sub_80398D0 - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_80398BC - - thumb_func_start sub_80398D0 -sub_80398D0: @ 80398D0 - push {r4,lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x36] - subs r0, 0x1 - strh r0, [r3, 0x36] - lsls r0, 16 - cmp r0, 0 - bne _08039924 - movs r0, 0x8 - strh r0, [r3, 0x36] - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - ldrb r2, [r0] - lsls r0, r2, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r4, 0x5 - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - ldrh r0, [r3, 0x34] - subs r0, 0x1 - strh r0, [r3, 0x34] - lsls r0, 16 - asrs r2, r0, 16 - cmp r2, 0 - bne _08039924 - ldrb r1, [r1] - adds r0, r4, 0 - ands r0, r1 - mov r1, r12 - strb r0, [r1] - ldr r0, =nullsub_18 - str r0, [r3, 0x1C] - ldr r0, =0x02022f88 - str r2, [r0] -_08039924: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80398D0 - - thumb_func_start sub_8039934 -sub_8039934: @ 8039934 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - mov r9, r0 - ldrh r0, [r0, 0x2E] - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0] - lsls r0, r6, 2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2] - cmp r0, 0 - beq _0803995C - adds r4, r0, 0 - b _08039960 - .pool -_0803995C: - mov r0, r9 - ldrh r4, [r0, 0x32] -_08039960: - ldr r1, =0x0202406e - lsls r0, r6, 1 - adds r5, r0, r1 - ldrh r0, [r5] - movs r1, 0x64 - mov r8, r1 - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - ldr r7, =0x02024744 - adds r0, r7 - movs r1, 0 - bl pokemon_getattr - cmp r4, 0xC9 - bne _080399E4 - ldrh r0, [r5] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r7 - movs r1, 0 - bl pokemon_getattr - adds r2, r0, 0 - movs r0, 0xC0 - lsls r0, 18 - ands r0, r2 - lsrs r0, 18 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r2 - lsrs r1, 12 - orrs r0, r1 - movs r1, 0xC0 - lsls r1, 2 - ands r1, r2 - lsrs r1, 6 - orrs r0, r1 - movs r1, 0x3 - ands r1, r2 - orrs r0, r1 - movs r1, 0x1C - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _080399D0 - movs r0, 0xC9 - b _080399DA - .pool -_080399D0: - movs r1, 0xCE - lsls r1, 1 - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 -_080399DA: - ldr r1, =gUnknown_08300D38 - lsls r0, 2 - b _08039A1C - .pool -_080399E4: - ldr r0, =0x00000181 - cmp r4, r0 - bne _08039A08 - ldr r0, =gUnknown_08525F78 - ldr r1, =0x020244e4 - adds r1, r6, r1 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - b _08039A20 - .pool -_08039A08: - movs r0, 0xCE - lsls r0, 1 - cmp r4, r0 - bls _08039A18 - ldr r0, =gUnknown_08300D38 - b _08039A1E - .pool -_08039A18: - ldr r1, =gUnknown_08300D38 - lsls r0, r4, 2 -_08039A1C: - adds r0, r1 -_08039A1E: - ldrb r0, [r0, 0x1] -_08039A20: - lsrs r1, r0, 3 - movs r0, 0x8 - subs r0, r1 - mov r1, r9 - strh r0, [r1, 0x34] - movs r0, 0x1 - strh r0, [r1, 0x36] - ldr r0, =sub_8039A48 - str r0, [r1, 0x1C] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039934 - - thumb_func_start sub_8039A48 -sub_8039A48: @ 8039A48 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x36] - subs r0, 0x1 - strh r0, [r4, 0x36] - lsls r0, 16 - cmp r0, 0 - bne _08039AC8 - movs r0, 0x2 - strh r0, [r4, 0x36] - ldrh r0, [r4, 0x26] - adds r0, 0x8 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x34] - subs r0, 0x1 - strh r0, [r4, 0x34] - lsls r0, 16 - cmp r0, 0 - bge _08039A7C - adds r0, r4, 0 - bl obj_free_rotscale_entry - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - b _08039AC8 -_08039A7C: - ldrh r0, [r4, 0x2E] - lsls r0, 24 - lsrs r0, 24 - bl battle_get_per_side_status - ldr r1, =0x020244d4 - ldr r1, [r1] - lsls r0, 24 - lsrs r0, 22 - adds r1, 0x4 - adds r1, r0 - ldr r2, =0x020244e4 - movs r3, 0x2E - ldrsh r0, [r4, r3] - adds r0, r2 - ldrb r0, [r0] - lsls r0, 11 - ldr r1, [r1] - adds r1, r0 - movs r2, 0x34 - ldrsh r0, [r4, r2] - lsls r0, 8 - adds r1, r0 - movs r2, 0 - movs r0, 0xFF -_08039AAE: - strb r2, [r1] - adds r1, 0x1 - subs r0, 0x1 - cmp r0, 0 - bge _08039AAE - ldr r0, =0x020244e4 - movs r3, 0x2E - ldrsh r1, [r4, r3] - adds r1, r0 - ldrb r1, [r1] - adds r0, r4, 0 - bl StartObjectImageAnim -_08039AC8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039A48 - - thumb_func_start sub_8039AD8 -sub_8039AD8: @ 8039AD8 - movs r1, 0x8 - strh r1, [r0, 0x34] - adds r1, r0, 0 - adds r1, 0x3E - ldrb r1, [r1] - lsls r1, 29 - lsrs r1, 31 - strh r1, [r0, 0x36] - ldr r1, =sub_8039AF4 - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_8039AD8 - - thumb_func_start sub_8039AF4 -sub_8039AF4: @ 8039AF4 - push {lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x34] - subs r0, 0x1 - strh r0, [r3, 0x34] - lsls r0, 16 - cmp r0, 0 - bne _08039B26 - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - ldrb r2, [r0] - lsls r0, r2, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - movs r0, 0x8 - strh r0, [r3, 0x34] -_08039B26: - pop {r0} - bx r0 - thumb_func_end sub_8039AF4 - - thumb_func_start sub_8039B2C -sub_8039B2C: @ 8039B2C - movs r1, 0x3E - adds r1, r0 - mov r12, r1 - movs r1, 0x1 - ldrh r2, [r0, 0x36] - ands r2, r1 - lsls r2, 2 - mov r1, r12 - ldrb r3, [r1] - movs r1, 0x5 - negs r1, r1 - ands r1, r3 - orrs r1, r2 - mov r2, r12 - strb r1, [r2] - movs r1, 0 - strh r1, [r0, 0x36] - ldr r1, =nullsub_18 - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_8039B2C - - thumb_func_start sub_8039B58 -sub_8039B58: @ 8039B58 - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08039BA0 - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08039B80 - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x02000002 - ands r0, r1 - cmp r0, 0 - beq _08039B94 -_08039B80: - ldrh r0, [r4, 0x32] - bl sub_806F0D4 - lsls r0, 24 - cmp r0, 0 - beq _08039B94 - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectImageAnim -_08039B94: - ldrh r1, [r4, 0x32] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x1 - bl sub_806ECEC -_08039BA0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039B58 - - thumb_func_start sub_8039BB4 -sub_8039BB4: @ 8039BB4 - ldr r1, =oac_poke_ally_ - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_8039BB4 - - thumb_func_start oac_poke_ally_ -oac_poke_ally_: @ 8039BC0 - push {lr} - adds r2, r0, 0 - ldr r0, =0x020243fc - ldrh r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08039BE4 - ldrh r0, [r2, 0x24] - subs r0, 0x2 - strh r0, [r2, 0x24] - lsls r0, 16 - asrs r1, r0, 16 - cmp r1, 0 - bne _08039BE4 - ldr r0, =nullsub_19 - str r0, [r2, 0x1C] - strh r1, [r2, 0x30] -_08039BE4: - pop {r0} - bx r0 - .pool - thumb_func_end oac_poke_ally_ - - thumb_func_start sub_8039BF0 -sub_8039BF0: @ 8039BF0 - ldr r1, =nullsub_19 - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_8039BF0 - - thumb_func_start nullsub_19 -nullsub_19: @ 8039BFC - bx lr - thumb_func_end nullsub_19 - - thumb_func_start sub_8039C00 -sub_8039C00: @ 8039C00 - push {lr} - adds r2, r0, 0 - ldr r0, =0x020243fc - ldrh r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08039C20 - ldrh r0, [r2, 0x30] - ldrh r1, [r2, 0x24] - adds r0, r1 - strh r0, [r2, 0x24] - ldrh r0, [r2, 0x32] - ldrh r1, [r2, 0x26] - adds r0, r1 - strh r0, [r2, 0x26] -_08039C20: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039C00 - - thumb_func_start dp11b_obj_instanciate -dp11b_obj_instanciate: @ 8039C28 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - lsls r3, 24 - lsrs r3, 24 - mov r10, r3 - cmp r1, 0 - beq _08039C64 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0, 0x4] - lsls r2, r4, 1 - adds r0, r2, r4 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - b _08039C76 - .pool -_08039C64: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0, 0x4] - lsls r2, r4, 1 - adds r0, r2, r4 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 -_08039C76: - ands r0, r1 - adds r6, r2, 0 - cmp r0, 0 - bne _08039D2C - ldr r0, =objc_dp11b_pingpong - bl object_new_hidden_with_callback - lsls r0, 24 - lsrs r5, r0, 24 - mov r0, r8 - cmp r0, 0x1 - bne _08039CD0 - ldr r0, =0x03005d70 - adds r0, r4, r0 - ldrb r7, [r0] - ldr r2, =0x020244d0 - ldr r0, [r2] - ldr r0, [r0, 0x4] - adds r1, r6, r4 - lsls r1, 2 - adds r0, r1, r0 - strb r5, [r0, 0x2] - ldr r0, [r2] - ldr r0, [r0, 0x4] - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x2 - orrs r0, r2 - strb r0, [r1] - ldr r2, =0x02020630 - lsls r3, r5, 4 - adds r0, r3, r5 - lsls r0, 2 - adds r0, r2 - movs r1, 0x80 - b _08039CFE - .pool -_08039CD0: - ldr r0, =0x020241e4 - adds r0, r4, r0 - ldrb r7, [r0] - ldr r2, =0x020244d0 - ldr r0, [r2] - ldr r0, [r0, 0x4] - adds r1, r6, r4 - lsls r1, 2 - adds r0, r1, r0 - strb r5, [r0, 0x3] - ldr r0, [r2] - ldr r0, [r0, 0x4] - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - ldr r2, =0x02020630 - lsls r3, r5, 4 - adds r0, r3, r5 - lsls r0, 2 - adds r0, r2 - movs r1, 0xC0 -_08039CFE: - strh r1, [r0, 0x2E] - adds r4, r2, 0 - adds r1, r3, r5 - lsls r1, 2 - adds r1, r4 - mov r2, r9 - lsls r0, r2, 24 - asrs r0, 24 - movs r2, 0 - strh r0, [r1, 0x30] - mov r3, r10 - lsls r0, r3, 24 - asrs r0, 24 - strh r0, [r1, 0x32] - strh r7, [r1, 0x34] - mov r0, r8 - strh r0, [r1, 0x36] - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - adds r0, r4 - strh r2, [r0, 0x24] - strh r2, [r0, 0x26] -_08039D2C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end dp11b_obj_instanciate - - thumb_func_start dp11b_obj_free -dp11b_obj_free: @ 8039D48 - push {r4-r6,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x1 - bne _08039D9C - ldr r6, =0x020244d0 - ldr r0, [r6] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r5, r0, 2 - adds r3, r5, r1 - ldrb r1, [r3] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08039DEA - ldr r2, =0x02020630 - ldrb r1, [r3, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x34] - lsls r1, 24 - lsrs r4, r1, 24 - bl RemoveObjectAndFreeTiles - ldr r0, [r6] - ldr r1, [r0, 0x4] - adds r1, r5, r1 - ldrb r2, [r1] - movs r0, 0x3 - negs r0, r0 - b _08039DD6 - .pool -_08039D9C: - ldr r6, =0x020244d0 - ldr r0, [r6] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r5, r0, 2 - adds r3, r5, r1 - ldrb r1, [r3] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08039DEA - ldr r2, =0x02020630 - ldrb r1, [r3, 0x3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x34] - lsls r1, 24 - lsrs r4, r1, 24 - bl RemoveObjectAndFreeTiles - ldr r0, [r6] - ldr r1, [r0, 0x4] - adds r1, r5, r1 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 -_08039DD6: - ands r0, r2 - strb r0, [r1] - ldr r0, =0x02020630 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r1, r0 - movs r0, 0 - strh r0, [r1, 0x24] - strh r0, [r1, 0x26] -_08039DEA: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end dp11b_obj_free - - thumb_func_start objc_dp11b_pingpong -objc_dp11b_pingpong: @ 8039DF8 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x34] - lsls r0, 24 - lsrs r5, r0, 24 - movs r1, 0x36 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _08039E10 - movs r2, 0x2E - ldrsh r0, [r4, r2] - b _08039E14 -_08039E10: - movs r1, 0x2E - ldrsh r0, [r4, r1] -_08039E14: - movs r2, 0x32 - ldrsh r1, [r4, r2] - bl sine - ldr r2, =0x02020630 - lsls r1, r5, 4 - adds r1, r5 - lsls r1, 2 - adds r1, r2 - ldrh r2, [r4, 0x32] - adds r0, r2 - strh r0, [r1, 0x26] - ldrh r0, [r4, 0x30] - ldrh r1, [r4, 0x2E] - adds r0, r1 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x2E] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end objc_dp11b_pingpong - - thumb_func_start sub_8039E44 -sub_8039E44: @ 8039E44 - push {lr} - adds r2, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08039E5C - ldrh r1, [r2, 0x32] - adds r0, r2, 0 - bl sub_806EEB4 -_08039E5C: - pop {r0} - bx r0 - thumb_func_end sub_8039E44 - - thumb_func_start sub_8039E60 -sub_8039E60: @ 8039E60 - push {r4,lr} - adds r4, r0, 0 - bl sub_8039E9C - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08039E7A - ldr r0, =nullsub_19 - str r0, [r4, 0x1C] -_08039E7A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039E60 - - thumb_func_start sub_8039E84 -sub_8039E84: @ 8039E84 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl StartObjectImageAnim - ldr r0, =sub_8039E60 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039E84 - - thumb_func_start sub_8039E9C -sub_8039E9C: @ 8039E9C - push {lr} - adds r2, r0, 0 - adds r0, 0x2C - ldrb r1, [r0] - movs r0, 0x3F - ands r0, r1 - cmp r0, 0 - bne _08039EBE - ldr r1, =gUnknown_0831ACE0 - adds r0, r2, 0 - adds r0, 0x2B - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - adds r0, r2, 0 - adds r0, 0x28 - strb r1, [r0] -_08039EBE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039E9C - - thumb_func_start nullsub_20 -nullsub_20: @ 8039EC8 - bx lr - thumb_func_end nullsub_20 - - thumb_func_start sub_8039ECC -sub_8039ECC: @ 8039ECC - push {lr} - bl sub_8039F40 - ldr r1, =0x02024332 - movs r0, 0 - strb r0, [r1, 0x1] - ldr r1, =0x03005d04 - ldr r0, =bc_8012FAC - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039ECC - - thumb_func_start sub_8039EF0 -sub_8039EF0: @ 8039EF0 - push {r4,r5,lr} - ldr r0, =0x03005d04 - ldr r0, [r0] - bl _call_via_r0 - ldr r1, =0x02024064 - movs r0, 0 - strb r0, [r1] - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r0, 0 - beq _08039F2A - ldr r5, =0x03005d60 - adds r4, r1, 0 -_08039F0C: - ldrb r0, [r4] - lsls r0, 2 - adds r0, r5 - ldr r0, [r0] - bl _call_via_r0 - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bcc _08039F0C -_08039F2A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039EF0 - - thumb_func_start sub_8039F40 -sub_8039F40: @ 8039F40 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r0, 0 - bl sub_803D580 - bl sub_803D6A0 - movs r2, 0 - movs r3, 0 - ldr r0, =0x02024260 - mov r10, r0 - ldr r1, =0x02024258 - mov r9, r1 - ldr r0, =0x02024250 - mov r8, r0 - ldr r1, =0x02024248 - mov r12, r1 - ldr r5, =0x020242bc - movs r4, 0 - ldr r7, =0x02024240 - ldr r6, =0x02024268 -_08039F70: - ldr r0, =0x020242ac - adds r0, r4, r0 - str r3, [r0] - movs r1, 0 -_08039F78: - adds r0, r5, r1 - strb r3, [r0] - adds r1, 0x1 - cmp r1, 0x1B - bls _08039F78 - movs r0, 0x2 - strb r0, [r5, 0x16] - ldr r1, =0x02024284 - adds r0, r2, r1 - strb r3, [r0] - mov r0, r12 - strh r3, [r0] - mov r1, r8 - strh r3, [r1] - mov r0, r9 - strh r3, [r0] - mov r1, r10 - strh r3, [r1] - ldr r0, =0x02024270 - adds r1, r2, r0 - movs r0, 0xFF - strb r0, [r1] - strh r3, [r6] - strh r3, [r7] - ldr r1, =0x020244a8 - ldr r0, [r1] - ldr r0, [r0, 0x4] - adds r0, r4 - str r3, [r0] - ldr r1, =0x02024230 - adds r0, r4, r1 - str r3, [r0] - movs r0, 0x2 - add r10, r0 - add r9, r0 - add r8, r0 - add r12, r0 - adds r5, 0x1C - adds r4, 0x4 - adds r7, 0x2 - adds r6, 0x2 - adds r2, 0x1 - cmp r2, 0x3 - ble _08039F70 - movs r5, 0 - ldr r3, =0x02024294 - ldr r4, =0x0202428e - movs r2, 0x1 -_08039FD8: - strh r5, [r4] - movs r1, 0 -_08039FDC: - adds r0, r3, r1 - strb r5, [r0] - adds r1, 0x1 - cmp r1, 0xB - bls _08039FDC - adds r3, 0xC - adds r4, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _08039FD8 - movs r1, 0 - ldr r2, =0x0202420b - strb r1, [r2] - ldr r0, =0x0202420c - strb r1, [r0] - ldr r2, =0x020243cc - strh r1, [r2] - ldr r1, =0x020243d0 - movs r2, 0 - movs r3, 0 -_0803A004: - adds r0, r1, r2 - strb r3, [r0] - adds r2, 0x1 - cmp r2, 0x2B - bls _0803A004 - ldr r2, =0x02024280 - movs r0, 0 - str r0, [r2] - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 17 - ands r0, r1 - cmp r0, 0 - bne _0803A090 - movs r0, 0x2 - ands r1, r0 - cmp r1, 0 - bne _0803A0AE - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r1, [r0, 0x15] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0803A0AE - movs r0, 0x80 - b _0803A0AC - .pool -_0803A090: - ldr r0, =0x02000002 - ands r1, r0 - cmp r1, 0 - bne _0803A0AE - bl sub_8185FB8 - lsls r0, 24 - cmp r0, 0 - beq _0803A0AE - ldr r1, =0x02024280 - ldr r0, [r1] - movs r1, 0x80 - orrs r0, r1 - ldr r2, =0x02024280 -_0803A0AC: - str r0, [r2] -_0803A0AE: - ldr r3, =0x02024474 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x15] - lsls r0, 30 - lsrs r0, 31 - movs r1, 0 - strb r0, [r3, 0x1D] - ldr r0, =0x02024212 - strb r1, [r0] - ldr r0, =0x0202433a - strb r1, [r0] - ldr r0, =0x02024068 - str r1, [r0] - ldr r0, =0x0202432e - movs r2, 0 - strh r1, [r0] - ldr r1, =0x020244a8 - ldr r0, [r1] - ldr r0, [r0, 0x8] - adds r0, 0x20 - strb r2, [r0] - ldr r0, [r1] - ldr r0, [r0, 0xC] - adds r0, 0x20 - strb r2, [r0] - ldr r5, =0x0202432c - ldr r6, =0x020241f0 - ldr r7, =0x020243fc - ldr r0, =0x03005d54 - mov r8, r0 - ldr r1, =0x02024210 - mov r9, r1 - ldr r2, =0x02024744 - mov r10, r2 - ldr r1, =0x02024332 - movs r2, 0 - adds r0, r1, 0x7 -_0803A0FA: - strb r2, [r0] - subs r0, 0x1 - cmp r0, r1 - bge _0803A0FA - movs r4, 0 - strh r4, [r5] - movs r0, 0 - str r0, [r6] - strh r0, [r7] - strb r4, [r3, 0x18] - strb r4, [r3, 0x19] - mov r0, r8 - strb r4, [r0] - mov r1, r9 - strb r4, [r1] - ldr r5, =0x0202449c - ldr r0, [r5] - adds r0, 0x6C - strb r4, [r0] - ldr r0, [r5] - adds r0, 0x79 - strb r4, [r0] - ldr r0, [r5] - adds r0, 0x7A - strb r4, [r0] - mov r0, r10 - movs r1, 0xB - bl pokemon_getattr - ldr r6, [r5] - adds r6, 0x7C - ldr r2, =gBaseStats - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r1, [r1, 0x8] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x000004fb - bl __divsi3 - strb r0, [r6] - ldr r0, [r5] - adds r0, 0x7B - movs r1, 0x3 - strb r1, [r0] - ldr r0, [r5] - strb r4, [r0, 0x12] - ldr r0, [r5] - adds r0, 0x4A - movs r1, 0x1 - strb r1, [r0] - movs r2, 0 - movs r1, 0 - adds r6, r5, 0 -_0803A16A: - ldr r0, [r5] - adds r0, r2, r0 - adds r0, 0x98 - strb r1, [r0] - ldr r0, [r5] - adds r0, r2, r0 - adds r0, 0xB8 - strb r1, [r0] - ldr r0, [r5] - adds r0, r2, r0 - adds r0, 0xC8 - strb r1, [r0] - ldr r0, [r5] - adds r0, r2, r0 - adds r0, 0xD0 - strb r1, [r0] - ldr r0, [r5] - adds r0, r2, r0 - adds r0, 0xE0 - strb r1, [r0] - ldr r0, [r5] - adds r0, r2, r0 - adds r0, 0xE8 - strb r1, [r0] - ldr r0, [r5] - adds r0, r2, r0 - adds r0, 0xF0 - strb r1, [r0] - ldr r0, [r5] - adds r0, r2, r0 - adds r0, 0xF8 - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x7 - ble _0803A16A - movs r2, 0 - ldr r4, =0x0202449c - movs r3, 0xA5 - lsls r3, 2 - movs r1, 0x6 -_0803A1BA: - ldr r0, [r4] - adds r0, r2, r0 - adds r0, r3 - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x3 - ble _0803A1BA - ldr r0, [r6] - adds r0, 0xDF - movs r1, 0 - strb r1, [r0] - ldr r0, [r6] - adds r0, 0x92 - strb r1, [r0] - bl GenerateRandomNumber - ldr r1, =0x02024330 - strh r0, [r1] - ldr r1, =0x03005d10 - movs r2, 0 - movs r3, 0 -_0803A1E4: - adds r0, r1, r2 - strb r3, [r0] - adds r2, 0x1 - cmp r2, 0x43 - bls _0803A1E4 - ldr r0, =0x02024744 - bl sub_806EBA4 - ldr r3, =0x03005d10 - movs r1, 0x1 - ands r1, r0 - lsls r1, 6 - ldrb r2, [r3, 0x5] - movs r0, 0x41 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x5] - ldr r2, =0x0202449c - ldr r0, [r2] - movs r1, 0xA8 - lsls r1, 2 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - ldr r2, =0x000002a1 - adds r0, r2 - strb r1, [r0] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039F40 - - thumb_func_start sub_803A284 -sub_803A284: @ 803A284 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - ldr r4, =0x020242bc - ldr r5, =0x02024064 - ldrb r1, [r5] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - mov r1, sp - adds r0, r4 - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - ldr r0, [r0] - str r0, [r1] - ldr r2, =gBattleMoves - ldr r3, =0x020241ea - ldrh r1, [r3] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - mov r12, r4 - mov r9, r5 - ldr r6, =0x020242ac - mov r10, r6 - cmp r0, 0x7F - beq _0803A35C - movs r5, 0 - mov r6, r9 - movs r4, 0x58 - ldr r2, =0x02024084 - adds r2, 0x18 - movs r1, 0x6 -_0803A2D4: - ldrb r0, [r6] - muls r0, r4 - adds r0, r5, r0 - adds r0, r2 - strb r1, [r0] - adds r5, 0x1 - cmp r5, 0x7 - ble _0803A2D4 - movs r5, 0 - ldr r7, =0x0202406c - ldrb r7, [r7] - cmp r5, r7 - bge _0803A348 - ldr r0, =0x020240d4 - mov r8, r0 - ldr r4, =0x020242bc - ldr r3, =0x020242ac -_0803A2F6: - movs r0, 0x58 - muls r0, r5 - mov r1, r8 - adds r2, r0, r1 - ldr r1, [r2] - movs r0, 0x80 - lsls r0, 19 - ands r0, r1 - cmp r0, 0 - beq _0803A31A - ldrb r0, [r4, 0x14] - ldr r6, =0x02024064 - ldrb r6, [r6] - cmp r0, r6 - bne _0803A31A - ldr r0, =0xfbffffff - ands r1, r0 - str r1, [r2] -_0803A31A: - ldr r1, [r3] - movs r0, 0x18 - ands r0, r1 - cmp r0, 0 - beq _0803A33A - ldrb r0, [r4, 0x15] - ldr r7, =0x02024064 - ldrb r7, [r7] - cmp r0, r7 - bne _0803A33A - movs r0, 0x19 - negs r0, r0 - ands r1, r0 - str r1, [r3] - movs r0, 0 - strb r0, [r4, 0x15] -_0803A33A: - adds r4, 0x1C - adds r3, 0x4 - adds r5, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r5, r0 - blt _0803A2F6 -_0803A348: - ldr r1, =0x020241ea - ldrh r0, [r1] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - ldr r2, =gBattleMoves - adds r1, r2 - ldrb r0, [r1] - cmp r0, 0x7F - bne _0803A414 -_0803A35C: - mov r3, r9 - ldrb r1, [r3] - movs r0, 0x58 - adds r2, r1, 0 - muls r2, r0 - ldr r0, =0x02024084 - adds r0, 0x50 - adds r2, r0 - ldr r0, [r2] - ldr r1, =0x15100007 - ands r0, r1 - str r0, [r2] - ldrb r1, [r3] - lsls r1, 2 - add r1, r10 - ldr r0, [r1] - ldr r2, =0x0003043f - ands r0, r2 - str r0, [r1] - movs r5, 0 - ldr r6, =0x0202406c - ldrb r6, [r6] - cmp r5, r6 - bge _0803A430 - mov r7, r9 - movs r6, 0 -_0803A390: - ldrb r0, [r7] - bl battle_side_get_owner - adds r4, r0, 0 - lsls r0, r5, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - beq _0803A3D0 - ldr r1, =0x020242ac - lsls r0, r5, 2 - adds r2, r0, r1 - ldr r1, [r2] - movs r0, 0x18 - ands r0, r1 - cmp r0, 0 - beq _0803A3D0 - ldr r0, =0x020242bc - adds r0, r6, r0 - ldrb r0, [r0, 0x15] - ldrb r3, [r7] - cmp r0, r3 - bne _0803A3D0 - movs r0, 0x19 - negs r0, r0 - ands r1, r0 - movs r0, 0x10 - orrs r1, r0 - str r1, [r2] -_0803A3D0: - adds r6, 0x1C - adds r5, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r5, r0 - blt _0803A390 - ldr r6, =0x020242bc - mov r12, r6 - ldr r7, =0x02024064 - mov r9, r7 - b _0803A430 - .pool -_0803A414: - mov r0, r9 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - ldr r1, =0x02024084 - adds r1, 0x50 - adds r0, r1 - movs r1, 0 - str r1, [r0] - mov r2, r9 - ldrb r0, [r2] - lsls r0, 2 - add r0, r10 - str r1, [r0] -_0803A430: - movs r5, 0 - ldr r3, =0x0202449c - mov r8, r3 - ldr r6, =0x020244ac - mov r10, r6 - ldr r7, =0x0202406c - ldrb r7, [r7] - cmp r5, r7 - bge _0803A490 - ldr r3, =0x020240d4 - ldr r7, =gUnknown_0832A328 - ldr r6, =0x02024064 -_0803A448: - movs r0, 0x58 - muls r0, r5 - adds r4, r0, r3 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r7 - ldr r0, [r0] - lsls r2, r0, 16 - ldr r1, [r4] - adds r0, r1, 0 - ands r0, r2 - cmp r0, 0 - beq _0803A466 - bics r1, r2 - str r1, [r4] -_0803A466: - ldr r1, [r4] - movs r0, 0xE0 - lsls r0, 8 - ands r0, r1 - cmp r0, 0 - beq _0803A486 - mov r2, r8 - ldr r0, [r2] - adds r0, r5, r0 - ldrb r0, [r0, 0x14] - ldrb r2, [r6] - cmp r0, r2 - bne _0803A486 - ldr r0, =0xffff1fff - ands r1, r0 - str r1, [r4] -_0803A486: - adds r5, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r5, r0 - blt _0803A448 -_0803A490: - mov r1, r9 - ldrb r0, [r1] - add r0, r10 - movs r1, 0 - strb r1, [r0] - mov r2, r9 - ldrb r0, [r2] - ldr r3, =0x020244b0 - adds r0, r3 - strb r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - mov r6, r12 - adds r1, r0, r6 - movs r5, 0 - movs r2, 0 -_0803A4B4: - adds r0, r1, r5 - strb r2, [r0] - adds r5, 0x1 - cmp r5, 0x1B - bls _0803A4B4 - ldr r7, =0x020241ea - ldrh r0, [r7] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - ldr r0, =gBattleMoves - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x7F - bne _0803A540 - mov r2, r9 - ldrb r1, [r2] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - mov r1, sp - ldrb r1, [r1, 0xA] - strb r1, [r0, 0xA] - ldrb r1, [r2] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - mov r1, sp - ldrb r1, [r1, 0x15] - strb r1, [r0, 0x15] - ldrb r0, [r2] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - add r1, r12 - mov r0, sp - ldrb r2, [r0, 0xF] - lsls r2, 28 - movs r4, 0xF - lsrs r2, 28 - ldrb r3, [r1, 0xF] - movs r0, 0x10 - negs r0, r0 - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0xF] - mov r3, r9 - ldrb r1, [r3] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - mov r1, sp - ldrb r1, [r1, 0xF] - lsrs r1, 4 - lsls r1, 4 - ldrb r2, [r0, 0xF] - ands r4, r2 - orrs r4, r1 - strb r4, [r0, 0xF] - ldrb r1, [r3] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - mov r1, sp - ldrb r1, [r1, 0x14] - strb r1, [r0, 0x14] -_0803A540: - movs r0, 0 - ldr r6, =0x0202427c - strb r0, [r6] - mov r7, r9 - ldrb r1, [r7] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - movs r4, 0 - movs r1, 0x2 - strb r1, [r0, 0x16] - ldrb r0, [r7] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - add r1, r12 - mov r0, sp - ldrb r0, [r0, 0x18] - movs r2, 0x2 - ands r2, r0 - ldrb r3, [r1, 0x18] - movs r0, 0x3 - negs r0, r0 - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0x18] - ldrb r0, [r7] - lsls r0, 1 - ldr r1, =0x02024248 - adds r0, r1 - movs r2, 0 - strh r4, [r0] - ldrb r0, [r7] - lsls r0, 1 - ldr r3, =0x02024250 - adds r0, r3 - strh r4, [r0] - ldrb r0, [r7] - lsls r0, 1 - ldr r6, =0x02024258 - adds r0, r6 - strh r4, [r0] - ldrb r0, [r7] - lsls r0, 1 - ldr r7, =0x02024260 - adds r0, r7 - strh r4, [r0] - mov r1, r9 - ldrb r0, [r1] - lsls r0, 1 - ldr r3, =0x02024240 - adds r0, r3 - strh r4, [r0] - ldrb r0, [r1] - ldr r6, =0x02024270 - adds r0, r6 - movs r1, 0xFF - strb r1, [r0] - mov r7, r9 - ldrb r0, [r7] - mov r3, r8 - ldr r1, [r3] - lsls r0, 1 - adds r0, r1 - adds r0, 0x98 - strb r2, [r0] - ldrb r0, [r7] - ldr r1, [r3] - lsls r0, 1 - adds r0, r1 - adds r0, 0x99 - strb r2, [r0] - ldrb r0, [r7] - ldr r1, [r3] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE0 - strb r2, [r0] - ldrb r0, [r7] - ldr r1, [r3] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE1 - strb r2, [r0] - ldrb r0, [r7] - ldr r1, [r3] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE2 - strb r2, [r0] - ldrb r0, [r7] - ldr r1, [r3] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE3 - strb r2, [r0] - ldrb r0, [r7] - ldr r1, [r3] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE4 - strb r2, [r0] - ldrb r0, [r7] - ldr r1, [r3] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE5 - strb r2, [r0] - ldrb r0, [r7] - ldr r1, [r3] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE6 - strb r2, [r0] - ldrb r0, [r7] - ldr r1, [r3] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE7 - strb r2, [r0] - ldr r1, [r3] - adds r1, 0x92 - ldrb r0, [r7] - lsls r0, 2 - ldr r6, =gUnknown_0832A328 - adds r0, r6 - ldr r2, [r0] - ldrb r0, [r1] - bics r0, r2 - strb r0, [r1] - movs r5, 0 - ldr r7, =0x0202406c - ldrb r7, [r7] - cmp r5, r7 - bge _0803A6B4 - mov r3, r9 - mov r7, r8 - movs r6, 0 -_0803A656: - ldrb r0, [r3] - cmp r5, r0 - beq _0803A68C - lsls r0, r5, 24 - lsrs r0, 24 - str r3, [sp, 0x1C] - bl battle_side_get_owner - adds r4, r0, 0 - ldr r3, [sp, 0x1C] - ldrb r0, [r3] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - ldr r3, [sp, 0x1C] - cmp r4, r0 - beq _0803A68C - ldr r0, [r7] - lsls r1, r5, 1 - adds r0, r1, r0 - adds r0, 0x98 - strb r6, [r0] - ldr r0, [r7] - adds r1, r0 - adds r1, 0x99 - strb r6, [r1] -_0803A68C: - ldrb r0, [r3] - ldr r1, [r7] - lsls r0, 1 - lsls r2, r5, 3 - adds r0, r2 - adds r0, r1 - adds r0, 0xE0 - strb r6, [r0] - ldrb r0, [r3] - ldr r1, [r7] - lsls r0, 1 - adds r0, r2 - adds r0, r1 - adds r0, 0xE1 - strb r6, [r0] - adds r5, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r5, r0 - blt _0803A656 -_0803A6B4: - mov r1, r9 - ldrb r0, [r1] - mov r2, r8 - ldr r1, [r2] - lsls r0, 1 - adds r0, r1 - adds r0, 0xC8 - movs r2, 0 - strb r2, [r0] - mov r3, r9 - ldrb r0, [r3] - mov r6, r8 - ldr r1, [r6] - lsls r0, 1 - adds r0, r1 - adds r0, 0xC9 - strb r2, [r0] - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r1, [r0, 0x4] - ldrb r0, [r3] - lsls r0, 2 - adds r1, r0 - movs r2, 0 - str r2, [r1] - ldr r0, =0x020241ea - strh r2, [r0] - ldr r0, [r6] - adds r0, 0xDA - movs r1, 0xFF - strb r1, [r0] - ldrb r0, [r3] - bl sub_81310F0 - mov r7, r9 - ldrb r0, [r7] - bl sub_8131130 - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803A284 - - thumb_func_start sub_803A75C -sub_803A75C: @ 803A75C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r5, 0 - ldr r6, =0x02024084 - ldr r0, =0x020242ac - mov r8, r0 - ldr r1, =0x0202449c - mov r12, r1 - ldr r2, =0x020244ac - mov r9, r2 - ldr r3, =0x020244b0 - mov r10, r3 - ldr r7, =0x0202433c - ldr r4, =0x02024064 - movs r3, 0x58 - adds r2, r6, 0 - adds r2, 0x18 - movs r1, 0x6 -_0803A788: - ldrb r0, [r4] - muls r0, r3 - adds r0, r5, r0 - adds r0, r2 - strb r1, [r0] - adds r5, 0x1 - cmp r5, 0x7 - ble _0803A788 - ldr r0, =0x02024064 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r2, r6, 0 - adds r2, 0x50 - adds r0, r2 - movs r1, 0 - str r1, [r0] - ldr r3, =0x02024064 - ldrb r0, [r3] - lsls r0, 2 - add r0, r8 - str r1, [r0] - movs r5, 0 - ldr r6, =0x0202406c - ldrb r6, [r6] - cmp r5, r6 - bge _0803A830 - adds r3, r2, 0 - movs r4, 0 - ldr r0, =gUnknown_0832A328 - mov r8, r0 -_0803A7C6: - ldr r1, [r3] - movs r0, 0x80 - lsls r0, 19 - ands r0, r1 - cmp r0, 0 - beq _0803A7E6 - ldr r2, =0x020242bc - adds r0, r4, r2 - ldrb r0, [r0, 0x14] - ldr r6, =0x02024064 - ldrb r6, [r6] - cmp r0, r6 - bne _0803A7E6 - ldr r0, =0xfbffffff - ands r1, r0 - str r1, [r3] -_0803A7E6: - ldr r1, =0x02024064 - ldrb r0, [r1] - lsls r0, 2 - add r0, r8 - ldr r0, [r0] - lsls r2, r0, 16 - ldr r1, [r3] - adds r0, r1, 0 - ands r0, r2 - cmp r0, 0 - beq _0803A800 - bics r1, r2 - str r1, [r3] -_0803A800: - ldr r1, [r3] - movs r0, 0xE0 - lsls r0, 8 - ands r0, r1 - cmp r0, 0 - beq _0803A822 - mov r2, r12 - ldr r0, [r2] - adds r0, r5, r0 - ldrb r0, [r0, 0x14] - ldr r6, =0x02024064 - ldrb r6, [r6] - cmp r0, r6 - bne _0803A822 - ldr r0, =0xffff1fff - ands r1, r0 - str r1, [r3] -_0803A822: - adds r3, 0x58 - adds r4, 0x1C - adds r5, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r5, r0 - blt _0803A7C6 -_0803A830: - ldr r1, =0x02024064 - ldrb r0, [r1] - add r0, r9 - movs r1, 0 - strb r1, [r0] - ldr r2, =0x02024064 - ldrb r0, [r2] - add r0, r10 - strb r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - ldr r3, =0x020242bc - adds r1, r0, r3 - movs r5, 0 - movs r2, 0 -_0803A852: - adds r0, r1, r5 - strb r2, [r0] - adds r5, 0x1 - cmp r5, 0x1B - bls _0803A852 - ldr r6, =0x02024064 - ldrb r1, [r6] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1] - movs r0, 0x2 - negs r0, r0 - mov r9, r0 - ands r0, r2 - strb r0, [r1] - ldrb r1, [r6] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1] - movs r3, 0x3 - negs r3, r3 - mov r8, r3 - mov r0, r8 - ands r0, r2 - strb r0, [r1] - ldrb r1, [r6] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1] - movs r6, 0x5 - negs r6, r6 - adds r0, r6, 0 - ands r0, r2 - strb r0, [r1] - ldr r0, =0x02024064 - ldrb r1, [r0] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1] - subs r3, 0x6 - mov r10, r3 - mov r0, r10 - ands r0, r2 - strb r0, [r1] - ldr r0, =0x02024064 - ldrb r1, [r0] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1] - movs r0, 0x11 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r2, =0x02024064 - ldrb r1, [r2] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1] - movs r5, 0x21 - negs r5, r5 - adds r0, r5, 0 - ands r0, r2 - strb r0, [r1] - ldr r3, =0x02024064 - ldrb r1, [r3] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1] - movs r4, 0x41 - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - strb r0, [r1] - ldrb r1, [r3] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1] - movs r3, 0x7F - adds r0, r3, 0 - ands r0, r2 - strb r0, [r1] - ldr r0, =0x02024064 - ldrb r1, [r0] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1, 0x1] - mov r0, r9 - ands r0, r2 - strb r0, [r1, 0x1] - ldr r2, =0x02024064 - ldrb r1, [r2] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1, 0x1] - mov r0, r8 - ands r0, r2 - strb r0, [r1, 0x1] - ldr r0, =0x02024064 - ldrb r1, [r0] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1, 0x1] - adds r0, r6, 0 - ands r0, r2 - strb r0, [r1, 0x1] - ldr r2, =0x02024064 - ldrb r1, [r2] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1, 0x1] - movs r0, 0x19 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1] - ldr r1, =0x02024064 - ldrb r0, [r1] - lsls r0, 4 - adds r0, r7 - ldrb r1, [r0, 0x1] - ands r5, r1 - strb r5, [r0, 0x1] - ldr r2, =0x02024064 - ldrb r0, [r2] - lsls r0, 4 - adds r0, r7 - ldrb r1, [r0, 0x1] - ands r4, r1 - strb r4, [r0, 0x1] - ldrb r0, [r2] - lsls r0, 4 - adds r0, r7 - ldrb r1, [r0, 0x1] - ands r3, r1 - strb r3, [r0, 0x1] - ldrb r0, [r2] - lsls r0, 4 - adds r0, r7 - ldrb r1, [r0, 0x2] - mov r3, r9 - ands r3, r1 - strb r3, [r0, 0x2] - ldrb r0, [r2] - lsls r0, 4 - adds r0, r7 - ldrb r1, [r0, 0x2] - mov r2, r8 - ands r2, r1 - strb r2, [r0, 0x2] - ldr r3, =0x02024064 - ldrb r0, [r3] - lsls r0, 4 - adds r0, r7 - ldrb r1, [r0, 0x2] - ands r6, r1 - strb r6, [r0, 0x2] - ldrb r0, [r3] - lsls r0, 4 - adds r0, r7 - ldrb r1, [r0, 0x2] - mov r6, r10 - ands r6, r1 - strb r6, [r0, 0x2] - ldrb r1, [r3] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - ldr r1, =0x020242bc - adds r0, r1 - movs r2, 0 - movs r1, 0x2 - strb r1, [r0, 0x16] - ldrb r0, [r3] - lsls r0, 1 - ldr r3, =0x02024248 - adds r0, r3 - movs r3, 0 - strh r2, [r0] - ldr r6, =0x02024064 - ldrb r0, [r6] - lsls r0, 1 - ldr r1, =0x02024250 - adds r0, r1 - strh r2, [r0] - ldrb r0, [r6] - lsls r0, 1 - ldr r6, =0x02024258 - adds r0, r6 - strh r2, [r0] - ldr r1, =0x02024064 - ldrb r0, [r1] - lsls r0, 1 - ldr r6, =0x02024260 - adds r0, r6 - strh r2, [r0] - ldrb r0, [r1] - lsls r0, 1 - ldr r1, =0x02024240 - adds r0, r1 - strh r2, [r0] - ldr r2, =0x02024064 - ldrb r0, [r2] - ldr r6, =0x02024270 - adds r0, r6 - movs r1, 0xFF - strb r1, [r0] - ldrb r0, [r2] - mov r2, r12 - ldr r1, [r2] - lsls r0, 1 - adds r0, r1 - adds r0, 0xC8 - strb r3, [r0] - ldr r6, =0x02024064 - ldrb r0, [r6] - ldr r1, [r2] - lsls r0, 1 - adds r0, r1 - adds r0, 0xC9 - strb r3, [r0] - ldrb r0, [r6] - ldr r1, [r2] - lsls r0, 1 - adds r0, r1 - adds r0, 0x98 - strb r3, [r0] - ldrb r0, [r6] - ldr r1, [r2] - lsls r0, 1 - adds r0, r1 - adds r0, 0x99 - strb r3, [r0] - ldrb r0, [r6] - ldr r1, [r2] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE0 - strb r3, [r0] - ldrb r0, [r6] - ldr r1, [r2] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE1 - strb r3, [r0] - ldrb r0, [r6] - ldr r1, [r2] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE2 - strb r3, [r0] - ldrb r0, [r6] - ldr r1, [r2] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE3 - strb r3, [r0] - ldrb r0, [r6] - ldr r1, [r2] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE4 - strb r3, [r0] - ldrb r0, [r6] - ldr r1, [r2] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE5 - strb r3, [r0] - ldrb r0, [r6] - ldr r1, [r2] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE6 - strb r3, [r0] - ldrb r0, [r6] - ldr r1, [r2] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE7 - strb r3, [r0] - ldr r1, [r2] - adds r1, 0x92 - ldrb r0, [r6] - lsls r0, 2 - ldr r2, =gUnknown_0832A328 - adds r0, r2 - ldr r2, [r0] - ldrb r0, [r1] - bics r0, r2 - strb r0, [r1] - movs r5, 0 - ldr r3, =0x0202406c - ldrb r3, [r3] - cmp r5, r3 - bge _0803AB02 - adds r3, r6, 0 - mov r7, r12 - movs r6, 0 -_0803AAA4: - ldrb r0, [r3] - cmp r5, r0 - beq _0803AADA - lsls r0, r5, 24 - lsrs r0, 24 - str r3, [sp] - bl battle_side_get_owner - adds r4, r0, 0 - ldr r3, [sp] - ldrb r0, [r3] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - ldr r3, [sp] - cmp r4, r0 - beq _0803AADA - ldr r0, [r7] - lsls r1, r5, 1 - adds r0, r1, r0 - adds r0, 0x98 - strb r6, [r0] - ldr r0, [r7] - adds r1, r0 - adds r1, 0x99 - strb r6, [r1] -_0803AADA: - ldrb r0, [r3] - ldr r1, [r7] - lsls r0, 1 - lsls r2, r5, 3 - adds r0, r2 - adds r0, r1 - adds r0, 0xE0 - strb r6, [r0] - ldrb r0, [r3] - ldr r1, [r7] - lsls r0, 1 - adds r0, r2 - adds r0, r1 - adds r0, 0xE1 - strb r6, [r0] - adds r5, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r5, r0 - blt _0803AAA4 -_0803AB02: - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r1, [r0, 0x4] - ldr r2, =0x02024064 - ldrb r0, [r2] - lsls r0, 2 - adds r1, r0 - movs r0, 0 - str r0, [r1] - ldr r4, =0x02024084 - ldrb r0, [r2] - movs r3, 0x58 - adds r2, r0, 0 - muls r2, r3 - b _0803AB6C - .pool -_0803AB6C: - adds r2, r4 - ldr r5, =gBaseStats - ldrh r1, [r2] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r0, [r0, 0x6] - adds r2, 0x21 - strb r0, [r2] - ldr r6, =0x02024064 - ldrb r0, [r6] - adds r1, r0, 0 - muls r1, r3 - adds r1, r4 - ldrh r2, [r1] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r5 - ldrb r0, [r0, 0x7] - adds r1, 0x22 - strb r0, [r1] - ldrb r0, [r6] - bl sub_81310F0 - ldrb r0, [r6] - bl sub_8131130 - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803A75C - - thumb_func_start bc_8012FAC -bc_8012FAC: @ 803ABC0 - push {r4,r5,lr} - ldr r5, =0x02024332 - ldrb r0, [r5] - cmp r0, 0 - beq _0803ABD4 - cmp r0, 0x1 - beq _0803ABF8 - b _0803AC2E - .pool -_0803ABD4: - ldr r4, =0x02024064 - ldrb r0, [r5, 0x1] - strb r0, [r4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl dp01_build_cmdbuf_x00_a_b_0 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - b _0803AC2E - .pool -_0803ABF8: - ldr r0, =0x02024068 - ldr r2, [r0] - cmp r2, 0 - bne _0803AC2E - ldrb r0, [r5, 0x1] - adds r0, 0x1 - strb r0, [r5, 0x1] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bne _0803AC2C - ldr r1, =0x03005d04 - ldr r0, =bc_load_battlefield - str r0, [r1] - b _0803AC2E - .pool -_0803AC2C: - strb r2, [r5] -_0803AC2E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end bc_8012FAC - - thumb_func_start bc_load_battlefield -bc_load_battlefield: @ 803AC34 - push {r4,r5,lr} - ldr r0, =0x02024068 - ldr r5, [r0] - cmp r5, 0 - bne _0803AC64 - movs r0, 0 - bl battle_get_side_with_given_state - ldr r4, =0x02024064 - strb r0, [r4] - ldr r0, =0x02022ff0 - ldrb r1, [r0] - movs r0, 0 - bl dp01_build_cmdbuf_x2E_a - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x03005d04 - ldr r0, =sub_803AC84 - str r0, [r1] - ldr r0, =0x02024332 - strb r5, [r0] - strb r5, [r0, 0x1] -_0803AC64: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end bc_load_battlefield - - thumb_func_start sub_803AC84 -sub_803AC84: @ 803AC84 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =0x02024068 - ldr r1, [r0] - cmp r1, 0 - beq _0803AC98 - b _0803AF4E -_0803AC98: - ldr r2, =0x02024064 - strb r1, [r2] - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r1, r0 - bcc _0803ACA6 - b _0803AF48 -_0803ACA6: - movs r7, 0x58 - ldr r0, =0x02024084 - mov r8, r0 - mov r9, r2 - movs r1, 0x48 - add r1, r8 - mov r10, r1 -_0803ACB4: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0803ACFC - ldr r4, =0x02024064 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0803ACFC - ldrb r0, [r4] - muls r0, r7 - mov r2, r8 - adds r3, r0, r2 - movs r2, 0 - movs r1, 0 -_0803ACDA: - adds r0, r3, r2 - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x57 - bls _0803ACDA - b _0803ADCA - .pool -_0803ACFC: - mov r1, r9 - ldrb r0, [r1] - muls r0, r7 - mov r2, r8 - adds r3, r0, r2 - movs r2, 0 - ldr r6, =gBaseStats - ldr r5, =0x02023864 - ldr r4, =0x02024064 -_0803AD0E: - adds r0, r3, r2 - ldrb r1, [r4] - lsls r1, 9 - adds r1, 0x4 - adds r1, r2, r1 - adds r1, r5 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x57 - bls _0803AD0E - mov r1, r9 - ldrb r0, [r1] - adds r2, r0, 0 - muls r2, r7 - add r2, r8 - ldrh r1, [r2] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x6] - adds r2, 0x21 - strb r0, [r2] - mov r2, r9 - ldrb r0, [r2] - adds r2, r0, 0 - muls r2, r7 - add r2, r8 - ldrh r1, [r2] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x7] - adds r2, 0x22 - strb r0, [r2] - mov r1, r9 - ldrb r0, [r1] - adds r1, r0, 0 - muls r1, r7 - add r1, r8 - ldrh r0, [r1] - ldrb r1, [r1, 0x17] - lsrs r1, 7 - bl sub_806B694 - mov r2, r9 - ldrb r1, [r2] - muls r1, r7 - add r1, r8 - adds r1, 0x20 - strb r0, [r1] - ldrb r0, [r2] - bl battle_side_get_owner - ldr r1, =0x0202449c - lsls r0, 24 - lsrs r0, 23 - adds r0, 0xA8 - ldr r1, [r1] - adds r1, r0 - mov r2, r9 - ldrb r0, [r2] - muls r0, r7 - add r0, r8 - ldrh r0, [r0, 0x28] - strh r0, [r1] - movs r2, 0 - ldr r4, =0x02024064 - movs r5, 0x58 - ldr r1, =0x0202409c - adds r6, r4, 0 - movs r0, 0x18 - negs r0, r0 - adds r0, r1 - mov r12, r0 - movs r3, 0x6 -_0803ADAA: - ldrb r0, [r4] - muls r0, r5 - adds r0, r2, r0 - adds r0, r1 - strb r3, [r0] - adds r2, 0x1 - cmp r2, 0x7 - ble _0803ADAA - ldrb r0, [r6] - adds r1, r0, 0 - muls r1, r7 - mov r0, r12 - adds r0, 0x50 - adds r1, r0 - movs r0, 0 - str r0, [r1] -_0803ADCA: - ldr r4, =0x02024064 - ldrb r0, [r4] - bl battle_get_per_side_status - lsls r0, 24 - cmp r0, 0 - bne _0803ADE4 - movs r0, 0 - bl dp01_build_cmdbuf_x07_7_7_7 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0803ADE4: - ldr r5, =0x02022fec - ldr r0, [r5] - movs r1, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0803AE60 - ldrb r0, [r4] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0803AE0A - movs r0, 0 - bl dp01_build_cmdbuf_x07_7_7_7 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0803AE0A: - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0803AEC0 - ldr r0, [r5] - ldr r1, =0x063f0902 - ands r0, r1 - cmp r0, 0 - bne _0803AEC0 - ldrb r0, [r4] - muls r0, r7 - add r0, r8 - ldrh r0, [r0] - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r4] - muls r1, r7 - add r1, r10 - ldr r2, [r1] - movs r1, 0x2 - bl SetPokedexFlag - b _0803AEC0 - .pool -_0803AE60: - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0803AEC0 - ldr r0, [r5] - ldr r1, =0x063f0902 - ands r0, r1 - cmp r0, 0 - bne _0803AE96 - ldrb r0, [r4] - muls r0, r7 - add r0, r8 - ldrh r0, [r0] - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r4] - muls r1, r7 - add r1, r10 - ldr r2, [r1] - movs r1, 0x2 - bl SetPokedexFlag -_0803AE96: - movs r0, 0 - bl dp01_build_cmdbuf_x04_4_4_4 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x0202406e - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - ldr r1, =0x03005d10 - strh r0, [r1, 0x20] -_0803AEC0: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0803AEF6 - ldr r4, =0x02024064 - ldrb r0, [r4] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _0803AEEA - ldrb r0, [r4] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _0803AEF6 -_0803AEEA: - movs r0, 0 - bl dp01_build_cmdbuf_x07_7_7_7 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0803AEF6: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _0803AF20 - ldr r4, =0x02024064 - ldrb r0, [r4] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _0803AF20 - movs r0, 0 - bl dp01_build_cmdbuf_x07_7_7_7 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0803AF20: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - beq _0803AF32 - bl sub_81A56B4 -_0803AF32: - mov r1, r9 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bcs _0803AF48 - b _0803ACB4 -_0803AF48: - ldr r1, =0x03005d04 - ldr r0, =bc_801333C - str r0, [r1] -_0803AF4E: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803AC84 - - thumb_func_start bc_801333C -bc_801333C: @ 803AF80 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x30 - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - beq _0803AF92 - b _0803B10C -_0803AF92: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x8 - ands r0, r1 - cmp r0, 0 - bne _0803AFA0 - b _0803B0AC -_0803AFA0: - movs r7, 0 - add r0, sp, 0x4 - mov r8, r0 - mov r6, r8 - mov r5, sp -_0803AFAA: - movs r0, 0x64 - adds r1, r7, 0 - muls r1, r0 - ldr r0, =0x02024744 - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - beq _0803AFD0 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - bne _0803AFE8 -_0803AFD0: - ldr r0, =0x0000ffff - strh r0, [r5] - movs r0, 0 - b _0803AFFA - .pool -_0803AFE8: - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - strh r0, [r5] - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr -_0803AFFA: - str r0, [r6] - adds r6, 0x8 - adds r5, 0x8 - adds r7, 0x1 - cmp r7, 0x5 - ble _0803AFAA - movs r0, 0x1 - bl battle_get_side_with_given_state - ldr r4, =0x02024064 - strb r0, [r4] - movs r0, 0 - mov r1, sp - movs r2, 0x80 - bl dp01_build_cmdbuf_x30_TODO - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - movs r7, 0 - mov r6, r8 - mov r5, sp -_0803B026: - movs r0, 0x64 - adds r1, r7, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - beq _0803B04C - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - bne _0803B060 -_0803B04C: - ldr r0, =0x0000ffff - strh r0, [r5] - movs r0, 0 - b _0803B072 - .pool -_0803B060: - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - strh r0, [r5] - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr -_0803B072: - str r0, [r6] - adds r6, 0x8 - adds r5, 0x8 - adds r7, 0x1 - cmp r7, 0x5 - ble _0803B026 - movs r0, 0 - bl battle_get_side_with_given_state - ldr r4, =0x02024064 - strb r0, [r4] - movs r0, 0 - mov r1, sp - movs r2, 0x80 - bl dp01_build_cmdbuf_x30_TODO - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x03005d04 - ldr r0, =bc_battle_begin_message - b _0803B10A - .pool -_0803B0AC: - movs r7, 0 - add r6, sp, 0x4 - mov r5, sp -_0803B0B2: - movs r0, 0x64 - adds r1, r7, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - beq _0803B0D8 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - bne _0803B0E8 -_0803B0D8: - ldr r0, =0x0000ffff - strh r0, [r5] - movs r0, 0 - b _0803B0FA - .pool -_0803B0E8: - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - strh r0, [r5] - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr -_0803B0FA: - str r0, [r6] - adds r6, 0x8 - adds r5, 0x8 - adds r7, 0x1 - cmp r7, 0x5 - ble _0803B0B2 - ldr r1, =0x03005d04 - ldr r0, =bc_8013568 -_0803B10A: - str r0, [r1] -_0803B10C: - add sp, 0x30 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end bc_801333C - - thumb_func_start bc_battle_begin_message -bc_battle_begin_message: @ 803B120 - push {lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0803B142 - movs r0, 0x1 - bl battle_get_side_with_given_state - ldr r1, =0x02024064 - strb r0, [r1] - ldrb r1, [r1] - movs r0, 0 - bl b_std_message - ldr r1, =0x03005d04 - ldr r0, =sub_803B180 - str r0, [r1] -_0803B142: - pop {r0} - bx r0 - .pool - thumb_func_end bc_battle_begin_message - - thumb_func_start bc_8013568 -bc_8013568: @ 803B158 - push {lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0803B170 - ldr r1, =0x03005d04 - ldr r0, =sub_803B3CC - str r0, [r1] - movs r0, 0 - movs r1, 0 - bl b_std_message -_0803B170: - pop {r0} - bx r0 - .pool - thumb_func_end bc_8013568 - - thumb_func_start sub_803B180 -sub_803B180: @ 803B180 - push {lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0803B1D0 - ldr r0, =0x02022fec - ldr r2, [r0] - movs r0, 0x80 - lsls r0, 17 - ands r0, r2 - cmp r0, 0 - beq _0803B1B8 - movs r0, 0x80 - lsls r0, 18 - ands r0, r2 - cmp r0, 0 - beq _0803B1B8 - movs r1, 0x80 - lsls r1, 24 - ands r1, r2 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - b _0803B1BA - .pool -_0803B1B8: - movs r0, 0x1 -_0803B1BA: - bl battle_get_side_with_given_state - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x1 - bl b_std_message - ldr r1, =0x03005d04 - ldr r0, =sub_803B25C - str r0, [r1] -_0803B1D0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_803B180 - - thumb_func_start sub_803B1DC -sub_803B1DC: @ 803B1DC - push {r4,r5,lr} - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 17 - ands r0, r1 - cmp r0, 0 - beq _0803B1FC - movs r0, 0x80 - lsls r0, 18 - ands r0, r1 - cmp r0, 0 - beq _0803B1FC - movs r5, 0x2 - cmp r1, 0 - bge _0803B1FE -_0803B1FC: - movs r5, 0x3 -_0803B1FE: - ldr r1, =0x02024064 - movs r0, 0 - strb r0, [r1] - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r0, 0 - beq _0803B23A - adds r4, r1, 0 -_0803B20E: - ldrb r0, [r4] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, r5 - bne _0803B228 - movs r0, 0 - bl dp01_build_cmdbuf_x2F_2F_2F_2F - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0803B228: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bcc _0803B20E -_0803B23A: - ldr r1, =0x03005d04 - ldr r0, =bc_801362C - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803B1DC - - thumb_func_start sub_803B25C -sub_803B25C: @ 803B25C - push {r4-r6,lr} - ldr r0, =0x02022fec - ldr r2, [r0] - movs r0, 0x80 - lsls r0, 17 - ands r0, r2 - cmp r0, 0 - beq _0803B298 - movs r0, 0x80 - lsls r0, 18 - ands r0, r2 - cmp r0, 0 - beq _0803B298 - movs r1, 0x80 - lsls r1, 24 - ands r1, r2 - negs r0, r1 - orrs r0, r1 - lsrs r5, r0, 31 - b _0803B29A - .pool -_0803B288: - ldr r1, =0x03005d04 - ldr r0, =sub_803B1DC - b _0803B2F0 - .pool -_0803B298: - movs r5, 0x1 -_0803B29A: - ldr r0, =0x02024068 - ldr r2, [r0] - cmp r2, 0 - bne _0803B2F2 - ldr r0, =0x02024064 - strb r2, [r0] - ldr r1, =0x0202406c - adds r4, r0, 0 - ldrb r1, [r1] - cmp r2, r1 - bcs _0803B2EC - adds r6, r4, 0 -_0803B2B2: - ldrb r0, [r4] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, r5 - bne _0803B2D8 - movs r0, 0 - bl dp01_build_cmdbuf_x2F_2F_2F_2F - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x00008040 - ands r0, r1 - cmp r0, 0 - bne _0803B288 -_0803B2D8: - ldrb r0, [r6] - adds r0, 0x1 - strb r0, [r6] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x02024064 - ldrb r1, [r1] - cmp r0, r1 - bcc _0803B2B2 -_0803B2EC: - ldr r1, =0x03005d04 - ldr r0, =bc_801362C -_0803B2F0: - str r0, [r1] -_0803B2F2: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803B25C - - thumb_func_start bc_801362C -bc_801362C: @ 803B314 - push {r4-r7,lr} - ldr r0, =0x02024068 - ldr r1, [r0] - cmp r1, 0 - bne _0803B384 - ldr r2, =0x02024064 - strb r1, [r2] - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r1, r0 - bcs _0803B37E - adds r4, r2, 0 - ldr r6, =0x02024084 - movs r5, 0x58 - adds r7, r6, 0 - adds r7, 0x48 -_0803B334: - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0803B36C - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x063f0902 - ands r0, r1 - cmp r0, 0 - bne _0803B36C - ldrb r0, [r4] - muls r0, r5 - adds r0, r6 - ldrh r0, [r0] - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r4] - muls r1, r5 - adds r1, r7 - ldr r2, [r1] - movs r1, 0x2 - bl SetPokedexFlag -_0803B36C: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bcc _0803B334 -_0803B37E: - ldr r1, =0x03005d04 - ldr r0, =sub_803B3CC - str r0, [r1] -_0803B384: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end bc_801362C - - thumb_func_start sub_803B3AC -sub_803B3AC: @ 803B3AC - push {lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0803B3BC - ldr r1, =0x03005d04 - ldr r0, =sub_803B3CC - str r0, [r1] -_0803B3BC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_803B3AC - - thumb_func_start sub_803B3CC -sub_803B3CC: @ 803B3CC - push {lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0803B418 - ldr r1, =0x02022fec - ldr r2, [r1] - movs r0, 0x80 - lsls r0, 17 - ands r0, r2 - cmp r0, 0 - beq _0803B3F4 - movs r0, 0x80 - lsls r0, 18 - ands r0, r2 - cmp r0, 0 - beq _0803B3F4 - movs r3, 0x1 - cmp r2, 0 - bge _0803B3F6 -_0803B3F4: - movs r3, 0 -_0803B3F6: - ldr r0, [r1] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0803B412 - adds r0, r3, 0 - bl battle_get_side_with_given_state - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x1 - bl b_std_message -_0803B412: - ldr r1, =0x03005d04 - ldr r0, =sub_803B4C8 - str r0, [r1] -_0803B418: - pop {r0} - bx r0 - .pool - thumb_func_end sub_803B3CC - - thumb_func_start sub_803B42C -sub_803B42C: @ 803B42C - push {r4,r5,lr} - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 17 - ands r0, r1 - cmp r0, 0 - beq _0803B44C - movs r0, 0x80 - lsls r0, 18 - ands r0, r1 - cmp r0, 0 - beq _0803B44C - movs r5, 0x3 - cmp r1, 0 - bge _0803B44E -_0803B44C: - movs r5, 0x2 -_0803B44E: - ldr r1, =0x02024064 - movs r0, 0 - strb r0, [r1] - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r0, 0 - beq _0803B48A - adds r4, r1, 0 -_0803B45E: - ldrb r0, [r4] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, r5 - bne _0803B478 - movs r0, 0 - bl dp01_build_cmdbuf_x2F_2F_2F_2F - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0803B478: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bcc _0803B45E -_0803B48A: - ldr r2, =0x0202449c - ldr r0, [r2] - adds r0, 0x4C - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - adds r0, 0xD9 - strb r1, [r0] - ldr r0, [r2] - movs r2, 0xD1 - lsls r2, 1 - adds r0, r2 - strb r1, [r0] - ldr r1, =0x03005d04 - ldr r0, =sub_803B628 - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803B42C - - thumb_func_start sub_803B4C8 -sub_803B4C8: @ 803B4C8 - push {r4-r6,lr} - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 17 - ands r0, r1 - cmp r0, 0 - beq _0803B500 - movs r0, 0x80 - lsls r0, 18 - ands r0, r1 - cmp r0, 0 - beq _0803B500 - movs r6, 0x1 - cmp r1, 0 - bge _0803B502 - b _0803B500 - .pool -_0803B4F0: - ldr r1, =0x03005d04 - ldr r0, =sub_803B42C - b _0803B572 - .pool -_0803B500: - movs r6, 0 -_0803B502: - ldr r0, =0x02024068 - ldr r2, [r0] - cmp r2, 0 - bne _0803B574 - ldr r0, =0x02024064 - strb r2, [r0] - ldr r1, =0x0202406c - adds r4, r0, 0 - ldrb r1, [r1] - cmp r2, r1 - bcs _0803B554 - adds r5, r4, 0 -_0803B51A: - ldrb r0, [r4] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, r6 - bne _0803B540 - movs r0, 0 - bl dp01_build_cmdbuf_x2F_2F_2F_2F - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0803B4F0 -_0803B540: - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x02024064 - ldrb r1, [r1] - cmp r0, r1 - bcc _0803B51A -_0803B554: - ldr r2, =0x0202449c - ldr r0, [r2] - adds r0, 0x4C - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - adds r0, 0xD9 - strb r1, [r0] - ldr r0, [r2] - movs r2, 0xD1 - lsls r2, 1 - adds r0, r2 - strb r1, [r0] - ldr r1, =0x03005d04 - ldr r0, =sub_803B628 -_0803B572: - str r0, [r1] -_0803B574: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803B4C8 - - thumb_func_start sub_803B598 -sub_803B598: @ 803B598 - push {r4,r5,lr} - ldr r0, =0x02024068 - ldr r1, [r0] - cmp r1, 0 - bne _0803B606 - ldr r2, =0x02024064 - strb r1, [r2] - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r1, r0 - bcs _0803B5E6 - adds r4, r2, 0 - ldr r5, =0x0202406e -_0803B5B2: - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0803B5D4 - ldrb r0, [r4] - lsls r0, 1 - adds r0, r5 - ldrb r1, [r0] - movs r0, 0 - movs r2, 0 - bl dp01_build_cmdbuf_x05_a_b_c - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0803B5D4: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bcc _0803B5B2 -_0803B5E6: - ldr r2, =0x0202449c - ldr r0, [r2] - adds r0, 0x4C - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - adds r0, 0xD9 - strb r1, [r0] - ldr r0, [r2] - movs r2, 0xD1 - lsls r2, 1 - adds r0, r2 - strb r1, [r0] - ldr r1, =0x03005d04 - ldr r0, =sub_803B628 - str r0, [r1] -_0803B606: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803B598 - - thumb_func_start sub_803B628 -sub_803B628: @ 803B628 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r0, 0 - mov r9, r0 - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - beq _0803B642 - b _0803B8B2 -_0803B642: - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x4C - ldrb r0, [r0] - cmp r0, 0 - bne _0803B6C2 - movs r5, 0 - ldr r1, =0x0202406c - mov r10, r1 - ldrb r3, [r1] - cmp r5, r3 - bge _0803B668 - ldr r2, =0x0202407e -_0803B65C: - adds r0, r5, r2 - strb r5, [r0] - adds r5, 0x1 - ldrb r0, [r1] - cmp r5, r0 - blt _0803B65C -_0803B668: - movs r5, 0 - b _0803B6B8 - .pool -_0803B67C: - adds r4, r5, 0x1 - mov r8, r4 - ldrb r1, [r1] - cmp r8, r1 - bge _0803B6B6 - ldr r6, =0x0202407e - ldr r1, =0x0202406c - mov r10, r1 - lsls r7, r5, 24 -_0803B68E: - adds r0, r5, r6 - ldrb r0, [r0] - adds r1, r4, r6 - ldrb r1, [r1] - movs r2, 0x1 - bl b_first_side - lsls r0, 24 - cmp r0, 0 - beq _0803B6AC - lsls r1, r4, 24 - lsrs r1, 24 - lsrs r0, r7, 24 - bl sub_803CEDC -_0803B6AC: - adds r4, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _0803B68E -_0803B6B6: - mov r5, r8 -_0803B6B8: - mov r1, r10 - ldrb r0, [r1] - subs r0, 0x1 - cmp r5, r0 - blt _0803B67C -_0803B6C2: - ldr r5, =0x0202449c - ldr r0, [r5] - movs r4, 0xD1 - lsls r4, 1 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - bne _0803B6FC - str r0, [sp] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0xFF - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _0803B6FC - ldr r0, [r5] - adds r0, r4 - movs r1, 0x1 - strb r1, [r0] - b _0803B8B2 - .pool -_0803B6FC: - ldr r2, =0x0202449c - ldr r0, [r2] - adds r0, 0x4C - ldr r1, =0x0202406c - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bcs _0803B756 - ldr r5, =0x0202407e - adds r4, r2, 0 -_0803B710: - ldr r0, [r4] - adds r0, 0x4C - ldrb r0, [r0] - adds r0, r5 - ldrb r1, [r0] - movs r0, 0 - str r0, [sp] - movs r2, 0 - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _0803B736 - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_0803B736: - ldr r1, [r4] - adds r1, 0x4C - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - mov r3, r9 - cmp r3, 0 - beq _0803B748 - b _0803B8B2 -_0803B748: - ldr r0, [r4] - adds r0, 0x4C - ldr r1, =0x0202406c - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bcc _0803B710 -_0803B756: - movs r0, 0 - str r0, [sp] - movs r0, 0x9 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _0803B770 - b _0803B8B2 -_0803B770: - str r0, [sp] - movs r0, 0xB - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _0803B786 - b _0803B8B2 -_0803B786: - ldr r2, =0x0202449c - ldr r0, [r2] - adds r0, 0xD9 - ldr r1, =0x0202406c - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bcs _0803B7DA - ldr r5, =0x0202407e - adds r4, r2, 0 -_0803B79A: - ldr r0, [r4] - adds r0, 0xD9 - ldrb r0, [r0] - adds r0, r5 - ldrb r1, [r0] - movs r0, 0 - movs r2, 0 - bl berry_effects_maybe - lsls r0, 24 - cmp r0, 0 - beq _0803B7BC - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_0803B7BC: - ldr r1, [r4] - adds r1, 0xD9 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - mov r0, r9 - cmp r0, 0 - bne _0803B8B2 - ldr r0, [r4] - adds r0, 0xD9 - ldr r1, =0x0202406c - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bcc _0803B79A -_0803B7DA: - movs r5, 0 - ldr r1, =0x0202449c - mov r8, r1 - movs r7, 0x6 - ldr r6, =0x0202421c - ldr r2, =0x02024274 - movs r4, 0xFF - movs r3, 0 -_0803B7EA: - mov r1, r8 - ldr r0, [r1] - adds r0, r5, r0 - adds r0, 0x5C - strb r7, [r0] - adds r1, r5, r6 - ldrb r0, [r1] - orrs r0, r4 - strb r0, [r1] - strh r3, [r2] - adds r2, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _0803B7EA - movs r0, 0 - bl sub_803D580 - bl sub_803D6A0 - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x91 - ldr r1, =0x02024210 - ldrb r1, [r1] - strb r1, [r0] - ldr r0, =gUnknown_085CC23E - movs r1, 0 - bl battle_show_message_maybe - ldr r1, =0x03005d04 - ldr r0, =sub_803BE74 - str r0, [r1] - bl sub_803F988 - ldr r1, =0x02024332 - movs r2, 0 - adds r0, r1, 0x7 -_0803B834: - strb r2, [r0] - subs r0, 0x1 - cmp r0, r1 - bge _0803B834 - movs r5, 0 - ldr r3, =0x0202406c - ldr r2, =0x0202449c - ldr r6, =0x02024474 - ldr r7, =0x0202427c - ldrb r0, [r3] - cmp r5, r0 - bge _0803B866 - ldr r0, =0x02024084 - movs r4, 0x9 - negs r4, r4 - adds r1, r0, 0 - adds r1, 0x50 -_0803B856: - ldr r0, [r1] - ands r0, r4 - str r0, [r1] - adds r1, 0x58 - adds r5, 0x1 - ldrb r0, [r3] - cmp r5, r0 - blt _0803B856 -_0803B866: - ldr r0, [r2] - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - strb r1, [r0, 0x1] - ldr r0, [r2] - movs r3, 0xD0 - lsls r3, 1 - adds r0, r3 - strb r1, [r0] - ldr r0, [r2] - adds r3, 0x1 - adds r0, r3 - strb r1, [r0] - movs r1, 0 - strb r1, [r6, 0x14] - ldr r0, [r2] - adds r0, 0x4D - strb r1, [r0] - ldr r0, [r2] - strb r1, [r0, 0x3] - strb r1, [r7] - bl GenerateRandomNumber - ldr r1, =0x02024330 - strh r0, [r1] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - beq _0803B8B2 - bl sub_80A369C - ldr r0, =gUnknown_082DB8BE - bl b_call_bc_move_exec -_0803B8B2: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803B628 - - thumb_func_start bc_8013B1C -bc_8013B1C: @ 803B904 - push {r4-r6,lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0803B994 - ldr r1, =0x03005d04 - ldr r0, =sub_803B9BC - str r0, [r1] - ldr r3, =0x0202406c - ldr r1, =0x02024332 - movs r2, 0 - adds r0, r1, 0x7 -_0803B91C: - strb r2, [r0] - subs r0, 0x1 - cmp r0, r1 - bge _0803B91C - movs r4, 0 - ldrb r3, [r3] - cmp r4, r3 - bge _0803B96E - ldr r5, =0x02024084 - adds r6, r5, 0 - adds r6, 0x4C -_0803B932: - movs r0, 0x58 - adds r2, r4, 0 - muls r2, r0 - adds r1, r5, 0 - adds r1, 0x50 - adds r1, r2, r1 - ldr r3, [r1] - subs r0, 0x61 - ands r3, r0 - str r3, [r1] - adds r2, r6 - ldr r0, [r2] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - beq _0803B964 - movs r0, 0x80 - lsls r0, 5 - ands r3, r0 - cmp r3, 0 - beq _0803B964 - lsls r0, r4, 24 - lsrs r0, 24 - bl b_cancel_multi_turn_move_maybe -_0803B964: - adds r4, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _0803B932 -_0803B96E: - ldr r2, =0x0202449c - ldr r0, [r2] - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - strb r1, [r0, 0x1] - ldr r0, [r2] - movs r3, 0xD0 - lsls r3, 1 - adds r0, r3 - strb r1, [r0] - ldr r0, [r2] - adds r3, 0x1 - adds r0, r3 - strb r1, [r0] - ldr r0, [r2] - strb r1, [r0, 0x3] - ldr r0, =0x0202427c - strb r1, [r0] -_0803B994: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end bc_8013B1C - - thumb_func_start sub_803B9BC -sub_803B9BC: @ 803B9BC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r0, 0x1 - bl sub_803D580 - ldr r0, =0x0202433a - ldrb r0, [r0] - cmp r0, 0 - bne _0803B9EA - bl sub_80401D0 - lsls r0, 24 - cmp r0, 0 - beq _0803B9DE - b _0803BB78 -_0803B9DE: - bl sub_8040924 - lsls r0, 24 - cmp r0, 0 - beq _0803B9EA - b _0803BB78 -_0803B9EA: - bl sub_8041728 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _0803B9F8 - b _0803BB78 -_0803B9F8: - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x4D - strb r1, [r0] - bl sub_8041364 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _0803BA0E - b _0803BB78 -_0803BA0E: - movs r0, 0 - bl sub_803D580 - ldr r2, =0x02024280 - ldr r0, [r2] - ldr r1, =0xfffffdff - ands r0, r1 - ldr r1, =0xfff7ffff - ands r0, r1 - ldr r1, =0xffbfffff - ands r0, r1 - ldr r1, =0xffefffff - ands r0, r1 - str r0, [r2] - ldr r0, =0x02024474 - strb r4, [r0, 0x18] - strb r4, [r0, 0x19] - strb r4, [r0, 0x14] - ldr r0, =0x020241f0 - str r4, [r0] - ldr r0, =0x0202427c - strb r4, [r0] - ldr r1, =0x02024332 - movs r2, 0 - adds r0, r1, 0x4 -_0803BA40: - strb r2, [r0] - subs r0, 0x1 - cmp r0, r1 - bge _0803BA40 - ldr r0, =0x0202433a - ldrb r0, [r0] - cmp r0, 0 - beq _0803BA98 - ldr r1, =0x02024083 - movs r0, 0xC - strb r0, [r1] - ldr r1, =0x03005d04 - ldr r0, =bc_bs_exec - str r0, [r1] - b _0803BB78 - .pool -_0803BA98: - ldr r1, =0x03005d10 - ldrb r0, [r1, 0x13] - ldr r2, =0x0202449c - mov r8, r2 - cmp r0, 0xFE - bhi _0803BAB2 - adds r0, 0x1 - strb r0, [r1, 0x13] - ldr r1, [r2] - adds r1, 0xDA - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_0803BAB2: - movs r2, 0 - ldr r4, =0x0202406c - ldr r0, =0x02024210 - mov r12, r0 - ldr r1, =gUnknown_085CC23E - mov r9, r1 - ldrb r0, [r4] - cmp r2, r0 - bge _0803BAE0 - ldr r7, =0x0202421c - movs r6, 0xFF - movs r5, 0 - ldr r3, =0x02024274 -_0803BACC: - adds r1, r2, r7 - ldrb r0, [r1] - orrs r0, r6 - strb r0, [r1] - strh r5, [r3] - adds r3, 0x2 - adds r2, 0x1 - ldrb r1, [r4] - cmp r2, r1 - blt _0803BACC -_0803BAE0: - movs r2, 0 - ldr r3, =0x0202449c - movs r1, 0x6 -_0803BAE6: - ldr r0, [r3] - adds r0, r2, r0 - adds r0, 0x5C - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x3 - ble _0803BAE6 - mov r2, r8 - ldr r0, [r2] - adds r0, 0x91 - mov r2, r12 - ldrb r1, [r2] - strb r1, [r0] - mov r0, r9 - movs r1, 0 - bl battle_show_message_maybe - ldr r1, =0x03005d04 - ldr r0, =sub_803BE74 - str r0, [r1] - bl GenerateRandomNumber - ldr r1, =0x02024330 - strh r0, [r1] - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 10 - ands r0, r1 - cmp r0, 0 - beq _0803BB5C - ldr r0, =gUnknown_082DB881 - bl b_call_bc_move_exec - b _0803BB78 - .pool -_0803BB5C: - movs r0, 0x80 - lsls r0, 11 - ands r1, r0 - cmp r1, 0 - beq _0803BB78 - mov r1, r8 - ldr r0, [r1] - adds r0, 0xDA - ldrb r0, [r0] - cmp r0, 0 - bne _0803BB78 - ldr r0, =gUnknown_082DB8BE - bl b_call_bc_move_exec -_0803BB78: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803B9BC - - thumb_func_start sub_803BB88 -sub_803BB88: @ 803BB88 - push {r4-r7,lr} - sub sp, 0x4 - ldr r1, =0x02024084 - ldr r0, =0x02024064 - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2E] - cmp r0, 0xAF - bne _0803BBB8 - ldr r1, =0x02024404 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r2, [r0, 0x7] - b _0803BBC2 - .pool -_0803BBB8: - ldrh r0, [r1, 0x2E] - bl itemid_get_x12 - lsls r0, 24 - lsrs r2, r0, 24 -_0803BBC2: - ldr r1, =0x0202420f - ldr r3, =0x02024064 - ldrb r0, [r3] - strb r0, [r1] - cmp r2, 0x25 - bne _0803BBD0 - b _0803BD4C -_0803BBD0: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0803BBDE - b _0803BD4C -_0803BBDE: - ldr r1, =0x02024084 - ldrb r2, [r3] - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x32 - bne _0803BBF2 - b _0803BD4C -_0803BBF2: - adds r0, r2, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r5, r0 - bge _0803BC86 - movs r7, 0 -_0803BC08: - lsrs r4, r7, 24 - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - beq _0803BC2C - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r5 - adds r0, r1 - adds r2, r0, 0 - adds r2, 0x20 - ldrb r0, [r2] - cmp r0, 0x17 - bne _0803BC2C - b _0803BD54 -_0803BC2C: - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - beq _0803BC76 - ldr r3, =0x02024084 - ldr r0, =0x02024064 - ldrb r0, [r0] - movs r2, 0x58 - muls r0, r2 - adds r1, r0, r3 - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x1A - beq _0803BC76 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0x2 - beq _0803BC76 - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0x2 - beq _0803BC76 - adds r0, r5, 0 - muls r0, r2 - adds r0, r3 - adds r2, r0, 0 - adds r2, 0x20 - ldrb r0, [r2] - cmp r0, 0x47 - bne _0803BC76 - b _0803BD70 -_0803BC76: - movs r0, 0x80 - lsls r0, 17 - adds r7, r0 - adds r5, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r5, r0 - blt _0803BC08 -_0803BC86: - ldr r4, =0x02024064 - ldrb r1, [r4] - movs r0, 0 - str r0, [sp] - movs r0, 0xF - movs r2, 0x2A - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - beq _0803BCF8 - ldr r6, =0x02024084 - ldrb r0, [r4] - movs r3, 0x58 - muls r0, r3 - adds r1, r0, r6 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0x8 - beq _0803BCBE - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0x8 - bne _0803BCF8 -_0803BCBE: - ldr r0, =0x02024474 - subs r1, r5, 0x1 - strb r1, [r0, 0x17] - ldr r2, =0x0202420a - adds r0, r1, 0 - muls r0, r3 - adds r0, r6 - adds r0, 0x20 - ldrb r0, [r0] - strb r0, [r2] - ldr r1, =0x02024332 - movs r0, 0x2 - b _0803BD90 - .pool -_0803BCF8: - ldr r1, =0x02024084 - ldr r0, =0x02024064 - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x0400e000 - ands r0, r1 - cmp r0, 0 - bne _0803BD22 - ldr r1, =0x020242ac - lsls r0, r2, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 3 - ands r0, r1 - cmp r0, 0 - beq _0803BD40 -_0803BD22: - ldr r1, =0x02024332 - movs r0, 0 - strb r0, [r1, 0x5] - movs r0, 0x1 - b _0803BD92 - .pool -_0803BD40: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x10 - ands r0, r1 - cmp r0, 0 - bne _0803BD8C -_0803BD4C: - movs r0, 0 - b _0803BD92 - .pool -_0803BD54: - ldr r0, =0x02024474 - strb r5, [r0, 0x17] - ldr r1, =0x0202420a - ldrb r0, [r2] - strb r0, [r1] - ldr r1, =0x02024332 - movs r0, 0x2 - b _0803BD90 - .pool -_0803BD70: - ldr r0, =0x02024474 - strb r5, [r0, 0x17] - ldr r1, =0x0202420a - ldrb r0, [r2] - strb r0, [r1] - ldr r1, =0x02024332 - movs r0, 0x2 - b _0803BD90 - .pool -_0803BD8C: - ldr r1, =0x02024332 - movs r0, 0x1 -_0803BD90: - strb r0, [r1, 0x5] -_0803BD92: - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_803BB88 - - thumb_func_start sub_803BDA0 -sub_803BDA0: @ 803BDA0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r5, r0, 24 - movs r3, 0 - ldr r0, =0x0202406e - mov r8, r0 - ldr r1, =0x0203cf00 - mov r12, r1 - ldr r7, =0x0202449c - lsls r0, r5, 1 - adds r4, r0, r5 - adds r6, r0, 0 -_0803BDBC: - mov r0, r12 - adds r2, r3, r0 - ldr r1, [r7] - adds r0, r4, r3 - adds r0, r1 - adds r0, 0x60 - ldrb r0, [r0] - strb r0, [r2] - adds r3, 0x1 - cmp r3, 0x2 - ble _0803BDBC - mov r1, r8 - adds r0, r6, r1 - ldrb r0, [r0] - bl pokemon_order_func - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r7, =0x0202449c - ldr r0, [r7] - adds r0, r5, r0 - adds r0, 0x5C - ldrb r0, [r0] - bl pokemon_order_func - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_81B8FB0 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0803BE4C - movs r3, 0 - adds r4, r7, 0 - adds r6, r5 - movs r0, 0x2 - adds r1, r5, 0 - eors r1, r0 - ldr r7, =0x0203cf00 - lsls r0, r1, 1 - adds r5, r0, r1 -_0803BE1A: - ldr r0, [r4] - adds r1, r6, r3 - adds r1, r0 - adds r1, 0x60 - adds r2, r3, r7 - ldrb r0, [r2] - strb r0, [r1] - ldr r1, [r4] - adds r0, r5, r3 - adds r0, r1 - adds r0, 0x60 - ldrb r1, [r2] - strb r1, [r0] - adds r3, 0x1 - cmp r3, 0x2 - ble _0803BE1A - b _0803BE66 - .pool -_0803BE4C: - movs r3, 0 - adds r2, r6, r5 - ldr r4, =0x0203cf00 -_0803BE52: - ldr r0, [r7] - adds r1, r2, r3 - adds r1, r0 - adds r1, 0x60 - adds r0, r3, r4 - ldrb r0, [r0] - strb r0, [r1] - adds r3, 0x1 - cmp r3, 0x2 - ble _0803BE52 -_0803BE66: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803BDA0 - - thumb_func_start sub_803BE74 -sub_803BE74: @ 803BE74 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - ldr r0, =0x02024332 - movs r1, 0 - strb r1, [r0, 0x4] - ldr r0, =0x02024064 - strb r1, [r0] - ldr r0, =0x0202406c - bl _0803CD12 - .pool -_0803BE9C: - ldr r4, =0x02024064 - ldrb r0, [r4] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x02024332 - ldrb r0, [r4] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x8 - bls _0803BEB8 - bl _0803CD04 -_0803BEB8: - lsls r0, 2 - ldr r1, =_0803BED0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0803BED0: - .4byte _0803BEF4 - .4byte _0803BF0C - .4byte _0803C02C - .4byte _0803C7D8 - .4byte _0803CAD0 - .4byte _0803CB84 - .4byte _0803CBC8 - .4byte _0803CBF4 - .4byte _0803CC38 -_0803BEF4: - bl sub_8185FD0 - ldr r1, =0x02024332 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - bl _0803CC20 - .pool -_0803BF0C: - ldr r0, =0x02024064 - ldrb r1, [r0] - ldr r4, =0x0202449c - ldr r0, [r4] - adds r1, r0 - adds r1, 0x5C - movs r0, 0x6 - strb r0, [r1] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0803BF68 - movs r1, 0x2 - movs r0, 0x2 - ands r0, r5 - cmp r0, 0 - beq _0803BF68 - eors r5, r1 - adds r0, r5, 0 - bl battle_get_side_with_given_state - ldr r1, [r4] - adds r1, 0x91 - ldrb r1, [r1] - ldr r2, =gUnknown_0832A328 - lsls r0, 24 - lsrs r0, 22 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0803BF68 - ldr r4, =0x02024332 - adds r0, r5, 0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0x5 - beq _0803BF68 - bl _0803CD04 -_0803BF68: - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x91 - ldrb r3, [r0] - ldr r1, =gUnknown_0832A328 - ldr r4, =0x02024064 - ldrb r2, [r4] - lsls r0, r2, 2 - adds r0, r1 - ldr r0, [r0] - ands r3, r0 - cmp r3, 0 - beq _0803BFD0 - ldr r0, =0x0202421c - adds r0, r2, r0 - movs r1, 0xD - strb r1, [r0] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0803BFBC - ldr r0, =0x02024332 - ldrb r1, [r4] - adds r1, r0 - movs r0, 0x5 - strb r0, [r1] - bl _0803CD04 - .pool -_0803BFBC: - ldr r0, =0x02024332 - ldrb r1, [r4] - adds r1, r0 - movs r0, 0x4 - strb r0, [r1] - bl _0803CD04 - .pool -_0803BFD0: - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 5 - ands r0, r1 - cmp r0, 0 - bne _0803BFF0 - movs r0, 0x80 - lsls r0, 15 - ands r1, r0 - cmp r1, 0 - beq _0803C00C -_0803BFF0: - ldr r0, =0x0202421c - adds r0, r2, r0 - strb r3, [r0] - ldr r1, =0x02024332 - ldrb r0, [r4] - bl _0803CC72 - .pool -_0803C00C: - ldr r0, =0x0202421c - ldrb r1, [r0] - ldr r0, =0x02023864 - ldrb r2, [r0, 0x1] - ldrb r0, [r0, 0x2] - lsls r0, 8 - orrs r2, r0 - movs r0, 0 - bl dp01_build_cmdbuf_x12_a_bb - bl _0803CB68 - .pool -_0803C02C: - ldr r3, =0x02024068 - ldr r1, =gUnknown_0832A328 - ldr r6, =0x02024064 - ldrb r5, [r6] - lsls r0, r5, 2 - adds r0, r1 - ldr r2, [r0] - lsls r1, r2, 4 - movs r0, 0xF0 - lsls r0, 24 - orrs r1, r0 - orrs r1, r2 - lsls r0, r2, 8 - orrs r1, r0 - lsls r2, 12 - orrs r1, r2 - ldr r0, [r3] - ands r0, r1 - cmp r0, 0 - beq _0803C058 - bl _0803CD04 -_0803C058: - ldr r4, =0x02023864 - lsls r0, r5, 9 - adds r4, 0x1 - adds r0, r4 - ldrb r1, [r0] - adds r0, r5, 0 - bl sub_8184FBC - ldr r1, =0x0202421c - ldrb r0, [r6] - adds r1, r0, r1 - lsls r0, 9 - adds r0, r4 - ldrb r0, [r0] - strb r0, [r1] - ldrb r0, [r6] - lsls r0, 9 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0xC - bls _0803C084 - b _0803C6C4 -_0803C084: - lsls r0, 2 - ldr r1, =_0803C0A8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0803C0A8: - .4byte _0803C0DC - .4byte _0803C230 - .4byte _0803C268 - .4byte _0803C6C4 - .4byte _0803C6C4 - .4byte _0803C440 - .4byte _0803C48C - .4byte _0803C6C4 - .4byte _0803C6C4 - .4byte _0803C6C4 - .4byte _0803C6C4 - .4byte _0803C6C4 - .4byte _0803C4B4 -_0803C0DC: - bl sub_80400C8 - lsls r0, 24 - cmp r0, 0 - beq _0803C134 - ldr r0, =0x02024332 - ldr r3, =0x02024064 - ldrb r1, [r3] - adds r1, r0 - movs r4, 0 - movs r0, 0x6 - strb r0, [r1] - ldrb r1, [r3] - ldr r2, =0x0202449c - ldr r0, [r2] - adds r1, r0 - adds r1, 0x54 - strb r4, [r1] - ldrb r1, [r3] - ldr r0, [r2] - adds r1, r0 - adds r1, 0x84 - movs r0, 0x4 - strb r0, [r1] - ldrb r1, [r3] - ldr r2, [r2] - adds r2, r1, r2 - ldr r0, =0x02023864 - lsls r1, 9 - adds r0, 0x3 - adds r1, r0 - ldrb r0, [r1] - strb r0, [r2, 0xC] - bl _0803CD70 - .pool -_0803C134: - ldr r3, =0x020242bc - ldr r5, =0x02024064 - ldrb r4, [r5] - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - adds r0, r3 - ldrh r2, [r0, 0x6] - cmp r2, 0 - beq _0803C188 - ldr r1, =0x02024274 - lsls r0, r4, 1 - adds r0, r1 - strh r2, [r0] - ldrb r2, [r5] - ldr r0, =0x0202449c - ldr r1, [r0] - adds r1, r2, r1 - adds r1, 0x80 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0xC] - strb r0, [r1] - ldr r1, =0x02024332 - ldrb r0, [r5] - adds r0, r1 - movs r1, 0x4 - strb r1, [r0] - bl _0803CD70 - .pool -_0803C188: - add r2, sp, 0x4 - ldr r3, =0x02024084 - movs r1, 0x58 - adds r0, r4, 0 - muls r0, r1 - adds r0, r3 - ldrh r0, [r0] - strh r0, [r2, 0x10] - ldrb r0, [r5] - muls r0, r1 - adds r0, r3 - adds r0, 0x21 - ldrb r0, [r0] - strb r0, [r2, 0x12] - ldrb r0, [r5] - muls r0, r1 - adds r0, r3 - adds r0, 0x22 - ldrb r0, [r0] - strb r0, [r2, 0x13] - movs r4, 0 - mov r1, sp - adds r1, 0xC - str r1, [sp, 0x18] - add r2, sp, 0x10 - mov r10, r2 - mov r8, r3 - adds r7, r5, 0 - movs r6, 0x58 - movs r0, 0xC - add r0, r8 - mov r9, r0 - add r5, sp, 0x4 -_0803C1CA: - lsls r2, r4, 1 - ldrb r0, [r7] - muls r0, r6 - adds r0, r2, r0 - add r0, r9 - ldrh r0, [r0] - strh r0, [r5] - ldr r1, [sp, 0x18] - adds r3, r1, r4 - ldrb r0, [r7] - muls r0, r6 - adds r0, r4, r0 - mov r1, r8 - adds r1, 0x24 - adds r0, r1 - ldrb r0, [r0] - strb r0, [r3] - ldrb r0, [r7] - adds r1, r0, 0 - muls r1, r6 - adds r2, r1 - add r2, r9 - ldrh r0, [r2] - add r1, r8 - adds r1, 0x3B - ldrb r1, [r1] - lsls r2, r4, 24 - lsrs r2, 24 - bl CalcPPWithPPUps - mov r2, r10 - adds r1, r2, r4 - strb r0, [r1] - adds r5, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - ble _0803C1CA - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x1 - ands r1, r0 - movs r0, 0 - movs r2, 0 - add r3, sp, 0x4 - bl sub_8033E30 - b _0803C42E - .pool -_0803C230: - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x021f0902 - ands r0, r1 - cmp r0, 0 - bne _0803C23E - b _0803C48C -_0803C23E: - ldr r4, =0x02024064 - ldrb r0, [r4] - movs r1, 0x1 - bl sub_8185008 - ldr r1, =0x02024220 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =gUnknown_082DB879 - b _0803C784 - .pool -_0803C268: - ldr r5, =0x02024064 - ldrb r0, [r5] - ldr r3, =0x0202449c - ldr r1, [r3] - adds r1, r0, r1 - adds r1, 0x58 - ldr r2, =0x0202406e - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - strb r0, [r1] - ldr r7, =0x02024084 - ldrb r2, [r5] - movs r6, 0x58 - adds r0, r2, 0 - muls r0, r6 - adds r1, r7, 0 - adds r1, 0x50 - adds r0, r1 - ldr r1, [r0] - ldr r0, =0x0400e000 - ands r1, r0 - cmp r1, 0 - bne _0803C2B8 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - bne _0803C2B8 - ldr r0, =0x020242ac - lsls r1, r2, 2 - adds r1, r0 - ldr r1, [r1] - movs r0, 0x80 - lsls r0, 3 - ands r1, r0 - cmp r1, 0 - beq _0803C2EC -_0803C2B8: - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r1, r0, 1 - adds r1, r0 - adds r1, 0x60 - ldr r0, [r3] - adds r0, r1 - str r0, [sp] - movs r0, 0 - movs r1, 0x2 - movs r2, 0x6 - b _0803C400 - .pool -_0803C2EC: - str r1, [sp] - movs r0, 0xC - adds r1, r2, 0 - movs r2, 0x17 - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _0803C374 - ldrb r1, [r5] - str r4, [sp] - movs r0, 0xC - movs r2, 0x47 - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _0803C33C - ldrb r0, [r5] - muls r0, r6 - adds r1, r0, r7 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0x2 - beq _0803C33C - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0x2 - beq _0803C33C - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x1A - bne _0803C374 -_0803C33C: - ldr r5, =0x02024064 - ldrb r1, [r5] - movs r0, 0 - str r0, [sp] - movs r0, 0xF - movs r2, 0x2A - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _0803C3B0 - ldr r2, =0x02024084 - ldrb r1, [r5] - movs r0, 0x58 - muls r0, r1 - adds r1, r0, r2 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0x8 - beq _0803C374 - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0x8 - bne _0803C3B0 -_0803C374: - subs r1, r4, 0x1 - lsls r1, 4 - movs r0, 0x4 - orrs r1, r0 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =0x0202420a - ldrb r3, [r0] - ldr r4, =0x0202449c - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r2, r0, 1 - adds r2, r0 - adds r2, 0x60 - ldr r0, [r4] - adds r0, r2 - str r0, [sp] - movs r0, 0 - movs r2, 0x6 - bl dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f - b _0803C42E - .pool -_0803C3B0: - ldr r0, =0x02024064 - ldrb r1, [r0] - adds r4, r0, 0 - cmp r1, 0x2 - bne _0803C3D8 - ldr r0, =0x0202421c - ldrb r0, [r0] - cmp r0, 0x2 - bne _0803C3D8 - ldr r0, =0x0202449c - ldr r3, [r0] - adds r0, r3, 0 - adds r0, 0x5C - b _0803C3EE - .pool -_0803C3D8: - ldrb r0, [r4] - cmp r0, 0x3 - bne _0803C410 - ldr r0, =0x0202421c - ldrb r0, [r0, 0x1] - cmp r0, 0x2 - bne _0803C410 - ldr r0, =0x0202449c - ldr r3, [r0] - adds r0, r3, 0 - adds r0, 0x5D -_0803C3EE: - ldrb r2, [r0] - ldrb r1, [r4] - lsls r0, r1, 1 - adds r0, r1 - adds r0, 0x60 - adds r3, r0 - str r3, [sp] - movs r0, 0 - movs r1, 0 -_0803C400: - movs r3, 0 - bl dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f - b _0803C42E - .pool -_0803C410: - ldr r2, =0x0202449c - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r1, r0, 1 - adds r1, r0 - adds r1, 0x60 - ldr r0, [r2] - adds r0, r1 - str r0, [sp] - movs r0, 0 - movs r1, 0 - movs r2, 0x6 - movs r3, 0 - bl dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f -_0803C42E: - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution - b _0803C6C4 - .pool -_0803C440: - bl sub_806B8B0 - lsls r0, 24 - cmp r0, 0 - bne _0803C44C - b _0803C6C4 -_0803C44C: - ldr r1, =0x02024220 - ldr r3, =0x02024064 - ldrb r0, [r3] - lsls r0, 2 - adds r0, r1 - ldr r1, =gUnknown_082DAB11 - str r1, [r0] - ldr r0, =0x02024332 - ldrb r1, [r3] - adds r1, r0 - movs r4, 0 - movs r0, 0x6 - strb r0, [r1] - ldrb r1, [r3] - ldr r2, =0x0202449c - ldr r0, [r2] - adds r1, r0 - adds r1, 0x54 - strb r4, [r1] - ldrb r1, [r3] - b _0803C7A0 - .pool -_0803C48C: - ldr r2, =0x0202449c - ldr r4, =0x02024064 - ldrb r1, [r4] - lsls r0, r1, 1 - adds r0, r1 - adds r0, 0x60 - ldr r1, [r2] - adds r1, r0 - movs r0, 0 - bl sub_8033E6C - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - b _0803C6C4 - .pool -_0803C4B4: - ldr r4, =0x02024332 - ldr r5, =0x02024064 - ldrb r0, [r5] - adds r0, r4 - movs r1, 0x7 - strb r1, [r0] - ldrb r0, [r5] - bl battle_get_per_side_status - movs r6, 0x2 - eors r0, r6 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - movs r1, 0x1 - strb r1, [r0] - ldrb r0, [r5] - bl sub_8185008 - ldrb r0, [r5] - bl battle_get_per_side_status - eors r0, r6 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - ldr r1, =0x02024084 - lsls r0, 24 - lsrs r0, 24 - movs r7, 0x58 - muls r0, r7 - adds r4, r1, 0 - adds r4, 0x50 - adds r0, r4 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 5 - ands r0, r1 - cmp r0, 0 - bne _0803C532 - ldrb r0, [r5] - bl battle_get_per_side_status - eors r0, r6 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - muls r0, r7 - adds r0, r4 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 15 - ands r0, r1 - cmp r0, 0 - beq _0803C550 -_0803C532: - movs r0, 0 - bl dp01_build_cmdbuf_x32_32_32_32 - ldrb r0, [r5] - bl dp01_battle_side_mark_buffer_for_execution - bl _0803CD70 - .pool -_0803C550: - ldr r4, =0x0202421c - ldrb r0, [r5] - bl battle_get_per_side_status - eors r0, r6 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0x2 - bne _0803C590 - ldrb r0, [r5] - bl battle_get_per_side_status - eors r0, r6 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl sub_8185008 - b _0803C6AE - .pool -_0803C590: - ldrb r0, [r5] - bl battle_get_per_side_status - eors r0, r6 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0x3 - bne _0803C5B6 - ldrb r0, [r5] - bl battle_get_per_side_status - eors r0, r6 - b _0803C668 -_0803C5B6: - ldrb r0, [r5] - bl battle_get_per_side_status - eors r0, r6 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - bne _0803C628 - ldr r4, =0x0202433c - ldrb r0, [r5] - bl battle_get_per_side_status - eors r0, r6 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 20 - adds r0, r4 - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _0803C616 - ldr r4, =0x020242bc - ldrb r0, [r5] - bl battle_get_per_side_status - eors r0, r6 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r4 - ldrh r0, [r1, 0x6] - cmp r0, 0 - beq _0803C628 -_0803C616: - ldrb r0, [r5] - bl battle_get_per_side_status - eors r0, r6 - b _0803C668 - .pool -_0803C628: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 10 - ands r0, r1 - cmp r0, 0 - beq _0803C690 - ldr r4, =0x0202421c - ldr r6, =0x02024064 - ldrb r0, [r6] - bl battle_get_per_side_status - movs r5, 0x2 - eors r0, r5 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - bne _0803C690 - ldr r1, =0x03005d80 - ldr r0, =0x0203bd30 - ldr r0, [r0] - str r0, [r1] - ldrb r0, [r6] - bl battle_get_per_side_status - eors r0, r5 -_0803C668: - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl sub_8185008 - b _0803C6AE - .pool -_0803C690: - ldr r0, =0x02024064 - ldrb r0, [r0] - bl battle_get_per_side_status - movs r1, 0x2 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x3 - bl sub_8185008 -_0803C6AE: - movs r0, 0 - bl dp01_build_cmdbuf_x32_32_32_32 - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution - b _0803CD70 - .pool -_0803C6C4: - ldr r1, =0x02022fec - ldr r2, [r1] - movs r5, 0x8 - adds r0, r2, 0 - ands r0, r5 - adds r3, r1, 0 - cmp r0, 0 - beq _0803C720 - ldr r0, =0x043f0100 - ands r2, r0 - cmp r2, 0 - beq _0803C720 - ldr r0, =0x02023864 - ldr r4, =0x02024064 - ldrb r2, [r4] - lsls r1, r2, 9 - adds r0, 0x1 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x3 - bne _0803C720 - ldr r1, =0x02024220 - lsls r0, r2, 2 - adds r0, r1 - ldr r1, =gUnknown_082DB9BA - str r1, [r0] - ldr r1, =0x02024332 - ldrb r0, [r4] - adds r0, r1 - movs r3, 0 - strb r5, [r0] - b _0803C792 - .pool -_0803C720: - ldr r0, [r3] - ldr r1, =0x0200000a - ands r0, r1 - cmp r0, 0x8 - bne _0803C760 - ldr r0, =0x02023864 - ldr r4, =0x02024064 - ldrb r1, [r4] - lsls r1, 9 - adds r0, 0x1 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x3 - bne _0803C760 - ldr r0, =gUnknown_082DAAFE - bl b_call_bc_move_exec - ldr r1, =0x02024332 - ldrb r0, [r4] - adds r0, r1 - b _0803CC20 - .pool -_0803C760: - bl sub_803BB88 - lsls r0, 24 - cmp r0, 0 - beq _0803C7C4 - ldr r0, =0x02023864 - ldr r4, =0x02024064 - ldrb r2, [r4] - lsls r1, r2, 9 - adds r0, 0x1 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x3 - bne _0803C7C4 - ldr r1, =0x02024220 - lsls r0, r2, 2 - adds r0, r1 - ldr r1, =gUnknown_082DAB0B -_0803C784: - str r1, [r0] - ldr r0, =0x02024332 - ldrb r1, [r4] - adds r1, r0 - movs r3, 0 - movs r0, 0x6 - strb r0, [r1] -_0803C792: - ldrb r1, [r4] - ldr r2, =0x0202449c - ldr r0, [r2] - adds r1, r0 - adds r1, 0x54 - strb r3, [r1] - ldrb r1, [r4] -_0803C7A0: - ldr r0, [r2] - adds r1, r0 - adds r1, 0x84 - movs r0, 0x1 - strb r0, [r1] - b _0803CD70 - .pool -_0803C7C4: - ldr r2, =0x02024332 - ldr r0, =0x02024064 - ldrb r1, [r0] - adds r1, r2 - b _0803CB74 - .pool -_0803C7D8: - ldr r4, =0x02024068 - ldr r1, =gUnknown_0832A328 - ldr r3, =0x02024064 - ldrb r5, [r3] - lsls r0, r5, 2 - adds r0, r1 - ldr r2, [r0] - lsls r0, r2, 4 - movs r1, 0xF0 - lsls r1, 24 - orrs r0, r1 - orrs r0, r2 - lsls r1, r2, 8 - orrs r0, r1 - lsls r2, 12 - orrs r0, r2 - ldr r1, [r4] - ands r1, r0 - adds r4, r3, 0 - cmp r1, 0 - beq _0803C804 - b _0803CD04 -_0803C804: - ldr r1, =0x0202421c - adds r0, r5, r1 - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0x9 - bls _0803C812 - b _0803CD04 -_0803C812: - lsls r0, 2 - ldr r1, =_0803C830 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0803C830: - .4byte _0803C858 - .4byte _0803C99C - .4byte _0803C9D4 - .4byte _0803CA0A - .4byte _0803CA2C - .4byte _0803CA40 - .4byte _0803CA54 - .4byte _0803CA84 - .4byte _0803CA98 - .4byte _0803CABC -_0803C858: - ldr r1, =0x02023864 - ldrb r3, [r4] - lsls r0, r3, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r1, [r0] - cmp r1, 0x3 - blt _0803C88A - cmp r1, 0x9 - ble _0803C878 - cmp r1, 0xF - beq _0803C87E - b _0803C88A - .pool -_0803C878: - adds r0, r3, r2 - strb r1, [r0] - b _0803CD70 -_0803C87E: - adds r1, r3, r2 - movs r0, 0x2 - strb r0, [r1] - bl sub_803CDF8 - b _0803CD70 -_0803C88A: - movs r0, 0x2 - bl sub_818603C - ldr r4, =0x02023864 - ldr r6, =0x02024064 - ldrb r3, [r6] - lsls r1, r3, 9 - adds r5, r4, 0x2 - adds r0, r1, r5 - ldrb r2, [r0] - adds r7, r4, 0x3 - adds r1, r7 - ldrb r0, [r1] - lsls r0, 8 - orrs r2, r0 - ldr r0, =0x0000ffff - cmp r2, r0 - bne _0803C8D0 - ldr r0, =0x02024332 - adds r0, r3, r0 - movs r1, 0x1 - strb r1, [r0] - ldrb r0, [r6] - bl sub_8185008 - b _0803CD04 - .pool -_0803C8D0: - bl sub_803FB4C - lsls r0, 24 - cmp r0, 0 - beq _0803C91C - ldrb r0, [r6] - movs r1, 0x1 - bl sub_8185008 - ldr r0, =0x02024332 - ldrb r1, [r6] - adds r1, r0 - movs r3, 0 - movs r0, 0x6 - strb r0, [r1] - ldrb r1, [r6] - ldr r2, =0x0202449c - ldr r0, [r2] - adds r1, r0 - adds r1, 0x54 - strb r3, [r1] - ldrb r0, [r6] - lsls r0, 9 - adds r1, r4, 0x1 - adds r0, r1 - strb r3, [r0] - ldrb r1, [r6] - ldr r0, [r2] - adds r1, r0 - adds r1, 0x84 - movs r0, 0x2 - strb r0, [r1] - b _0803CD70 - .pool -_0803C91C: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 10 - ands r0, r1 - cmp r0, 0 - bne _0803C942 - ldrb r0, [r6] - lsls r1, r0, 9 - adds r1, r5 - ldrb r1, [r1] - bl sub_8184FBC - ldrb r0, [r6] - lsls r1, r0, 9 - adds r1, r7 - ldrb r1, [r1] - bl sub_8184FBC -_0803C942: - ldrb r0, [r6] - ldr r4, =0x0202449c - ldr r1, [r4] - adds r1, r0, r1 - adds r1, 0x80 - lsls r0, 9 - adds r0, r5 - ldrb r0, [r0] - strb r0, [r1] - ldr r0, =0x02024274 - ldrb r2, [r6] - lsls r5, r2, 1 - adds r5, r0 - ldr r3, =0x02024084 - ldr r4, [r4] - adds r0, r2, r4 - adds r0, 0x80 - ldrb r0, [r0] - lsls r0, 1 - movs r1, 0x58 - muls r1, r2 - adds r0, r1 - adds r3, 0xC - adds r0, r3 - ldrh r0, [r0] - strh r0, [r5] - ldrb r0, [r6] - adds r4, r0, r4 - lsls r0, 9 - adds r0, r7 - ldrb r0, [r0] - strb r0, [r4, 0xC] - ldr r0, =0x02024332 - ldrb r1, [r6] - b _0803CB72 - .pool -_0803C99C: - ldr r2, =0x02023864 - ldr r5, =0x02024064 - ldrb r4, [r5] - lsls r1, r4, 9 - adds r0, r2, 0x1 - adds r0, r1, r0 - ldrb r3, [r0] - adds r2, 0x2 - adds r1, r2 - ldrb r0, [r1] - lsls r0, 8 - orrs r3, r0 - cmp r3, 0 - bne _0803C9BA - b _0803CC1C -_0803C9BA: - ldr r0, =0x02024208 - strh r3, [r0] - ldr r0, =0x02024332 - ldrb r1, [r5] - b _0803CB72 - .pool -_0803C9D4: - ldr r0, =0x02023864 - ldr r4, =0x02024064 - ldrb r2, [r4] - lsls r1, r2, 9 - adds r0, 0x1 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x6 - bne _0803CA04 - ldr r0, =0x02024332 - adds r0, r2, r0 - movs r1, 0x1 - strb r1, [r0] - ldrb r0, [r4] - bl sub_8185008 - b _0803CD04 - .pool -_0803CA04: - bl sub_803CDF8 - b _0803CB6E -_0803CA0A: - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 8 - orrs r0, r1 - str r0, [r2] - ldr r2, =0x02024332 - ldr r0, =0x02024064 - ldrb r1, [r0] - adds r1, r2 - b _0803CB74 - .pool -_0803CA2C: - ldr r2, =0x02024332 - ldr r0, =0x02024064 - ldrb r1, [r0] - adds r1, r2 - b _0803CB74 - .pool -_0803CA40: - ldr r2, =0x02024332 - ldr r0, =0x02024064 - ldrb r1, [r0] - adds r1, r2 - b _0803CB74 - .pool -_0803CA54: - ldr r3, =0x02023864 - ldr r0, =0x02024064 - ldrb r4, [r0] - lsls r1, r4, 9 - adds r0, r3, 0x1 - adds r0, r1, r0 - ldrb r2, [r0] - adds r3, 0x2 - adds r1, r3 - ldrb r0, [r1] - lsls r0, 8 - orrs r2, r0 - cmp r2, 0 - bne _0803CA72 - b _0803CC1C -_0803CA72: - ldr r1, =0x02024332 - adds r1, r4, r1 - b _0803CB74 - .pool -_0803CA84: - ldr r2, =0x02024332 - ldr r0, =0x02024064 - ldrb r1, [r0] - adds r1, r2 - b _0803CB74 - .pool -_0803CA98: - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 8 - orrs r0, r1 - str r0, [r2] - ldr r2, =0x02024332 - ldr r0, =0x02024064 - ldrb r1, [r0] - adds r1, r2 - b _0803CB74 - .pool -_0803CABC: - ldr r2, =0x02024332 - ldr r0, =0x02024064 - ldrb r1, [r0] - adds r1, r2 - b _0803CB74 - .pool -_0803CAD0: - ldr r3, =0x02024068 - ldr r6, =gUnknown_0832A328 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r6 - ldr r2, [r0] - lsls r1, r2, 4 - movs r0, 0xF0 - lsls r0, 24 - orrs r1, r0 - orrs r1, r2 - lsls r0, r2, 8 - orrs r1, r0 - lsls r2, 12 - orrs r1, r2 - ldr r0, [r3] - ands r0, r1 - cmp r0, 0 - beq _0803CAFA - b _0803CD04 -_0803CAFA: - bl sub_803CDB8 - lsls r0, 24 - lsrs r0, 24 - negs r1, r0 - orrs r1, r0 - lsrs r4, r1, 31 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x41 - ands r0, r1 - cmp r0, 0x1 - bne _0803CB3C - movs r1, 0x2 - movs r0, 0x2 - ands r0, r5 - cmp r0, 0 - bne _0803CB3C - adds r0, r5, 0 - eors r0, r1 - bl battle_get_side_with_given_state - ldr r1, =0x0202449c - ldr r1, [r1] - adds r1, 0x91 - ldrb r1, [r1] - lsls r0, 24 - lsrs r0, 22 - adds r0, r6 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _0803CB5C -_0803CB3C: - movs r0, 0 - movs r1, 0 - adds r2, r4, 0 - bl sub_8034464 - b _0803CB66 - .pool -_0803CB5C: - movs r0, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl sub_8034464 -_0803CB66: - ldr r4, =0x02024064 -_0803CB68: - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0803CB6E: - ldr r0, =0x02024332 - ldrb r1, [r4] -_0803CB72: - adds r1, r0 -_0803CB74: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0803CD04 - .pool -_0803CB84: - ldr r3, =0x02024068 - ldr r1, =gUnknown_0832A328 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r2, [r0] - lsls r1, r2, 4 - movs r0, 0xF0 - lsls r0, 24 - orrs r1, r0 - orrs r1, r2 - lsls r0, r2, 8 - orrs r1, r0 - lsls r2, 12 - orrs r1, r2 - ldr r0, [r3] - ands r0, r1 - cmp r0, 0 - beq _0803CBAE - b _0803CD04 -_0803CBAE: - ldr r1, =0x02024332 - ldrb r0, [r1, 0x4] - adds r0, 0x1 - strb r0, [r1, 0x4] - b _0803CD04 - .pool -_0803CBC8: - ldr r5, =0x02024064 - ldrb r2, [r5] - ldr r0, =0x0202449c - ldr r0, [r0] - adds r1, r2, r0 - adds r0, r1, 0 - adds r0, 0x54 - ldrb r0, [r0] - cmp r0, 0 - beq _0803CCB4 - ldr r0, =0x02024332 - adds r0, r2, r0 - adds r1, 0x84 - ldrb r1, [r1] - strb r1, [r0] - b _0803CD04 - .pool -_0803CBF4: - ldr r3, =0x02024068 - ldr r1, =gUnknown_0832A328 - ldr r0, =0x02024064 - ldrb r4, [r0] - lsls r0, r4, 2 - adds r0, r1 - ldr r2, [r0] - lsls r1, r2, 4 - movs r0, 0xF0 - lsls r0, 24 - orrs r1, r0 - orrs r1, r2 - lsls r0, r2, 8 - orrs r1, r0 - lsls r2, 12 - orrs r1, r2 - ldr r0, [r3] - ands r0, r1 - cmp r0, 0 - bne _0803CD04 -_0803CC1C: - ldr r0, =0x02024332 - adds r0, r4, r0 -_0803CC20: - movs r1, 0x1 - strb r1, [r0] - b _0803CD04 - .pool -_0803CC38: - ldr r5, =0x02024064 - ldrb r2, [r5] - ldr r4, =0x0202449c - ldr r0, [r4] - adds r0, r2, r0 - adds r0, 0x54 - ldrb r0, [r0] - cmp r0, 0 - beq _0803CCB4 - ldr r0, =0x02023864 - lsls r1, r2, 9 - adds r0, 0x1 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0xD - bne _0803CC94 - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 8 - orrs r0, r1 - str r0, [r2] - ldr r1, =0x0202421c - ldrb r0, [r5] - adds r0, r1 - movs r1, 0x3 - strb r1, [r0] - ldr r1, =0x02024332 - ldrb r0, [r5] -_0803CC72: - adds r0, r1 - movs r1, 0x4 - strb r1, [r0] - b _0803CD04 - .pool -_0803CC94: - adds r0, r2, 0 - movs r1, 0x1 - bl sub_8185008 - ldr r2, =0x02024332 - ldrb r0, [r5] - adds r2, r0, r2 - ldr r1, [r4] - adds r0, r1 - adds r0, 0x84 - ldrb r0, [r0] - strb r0, [r2] - b _0803CD04 - .pool -_0803CCB4: - ldr r0, =0x0202420b - strb r2, [r0] - ldr r7, =0x02024214 - ldr r6, =0x02024220 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r6 - ldr r4, [r0] - str r4, [r7] - ldr r3, =0x02024068 - ldr r1, =gUnknown_0832A328 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r2, [r0] - lsls r1, r2, 4 - movs r0, 0xF0 - lsls r0, 24 - orrs r1, r0 - orrs r1, r2 - lsls r0, r2, 8 - orrs r1, r0 - lsls r2, 12 - orrs r1, r2 - ldr r0, [r3] - ands r0, r1 - cmp r0, 0 - bne _0803CCFA - ldr r0, =gUnknown_0831BD10 - ldrb r1, [r4] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - bl _call_via_r0 -_0803CCFA: - ldrb r0, [r5] - lsls r0, 2 - adds r0, r6 - ldr r1, [r7] - str r1, [r0] -_0803CD04: - ldr r0, =0x02024064 - ldrb r1, [r0] - adds r1, 0x1 - strb r1, [r0] - ldr r0, =0x0202406c - lsls r1, 24 - lsrs r1, 24 -_0803CD12: - adds r5, r0, 0 - ldrb r0, [r5] - cmp r1, r0 - bcs _0803CD1E - bl _0803BE9C -_0803CD1E: - ldr r0, =0x02024332 - ldrb r0, [r0, 0x4] - ldrb r1, [r5] - cmp r0, r1 - bne _0803CD70 - movs r0, 0x1 - bl sub_818603C - ldr r1, =0x03005d04 - ldr r0, =sub_803D2E8 - str r0, [r1] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 15 - ands r0, r1 - cmp r0, 0 - beq _0803CD70 - movs r4, 0 - ldrb r5, [r5] - cmp r4, r5 - bge _0803CD70 -_0803CD4A: - ldr r0, =0x0202421c - adds r0, r4, r0 - ldrb r0, [r0] - cmp r0, 0x2 - bne _0803CD66 - lsls r0, r4, 24 - lsrs r0, 24 - ldr r1, =0x0202449c - ldr r1, [r1] - adds r1, r4, r1 - adds r1, 0x5C - ldrb r1, [r1] - bl sub_80571DC -_0803CD66: - adds r4, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _0803CD4A -_0803CD70: - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803BE74 - - thumb_func_start sub_803CDB8 -sub_803CDB8: @ 803CDB8 - push {r4,r5,lr} - movs r3, 0 - movs r1, 0 - ldr r0, =0x0202406c - ldrb r2, [r0] - adds r5, r0, 0 - cmp r3, r2 - bge _0803CDDA - ldr r4, =0x02024332 -_0803CDCA: - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, 0x5 - bne _0803CDD4 - adds r3, 0x1 -_0803CDD4: - adds r1, 0x1 - cmp r1, r2 - blt _0803CDCA -_0803CDDA: - adds r0, r3, 0x1 - ldrb r5, [r5] - cmp r0, r5 - beq _0803CDF0 - movs r0, 0 - b _0803CDF2 - .pool -_0803CDF0: - movs r0, 0x1 -_0803CDF2: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_803CDB8 - - thumb_func_start sub_803CDF8 -sub_803CDF8: @ 803CDF8 - push {r4-r7,lr} - ldr r7, =0x02024064 - ldrb r0, [r7] - ldr r6, =0x0202449c - ldr r1, [r6] - adds r1, r0, r1 - adds r1, 0x5C - ldr r4, =0x02023864 - lsls r0, 9 - adds r2, r4, 0x1 - adds r0, r2 - ldrb r0, [r0] - strb r0, [r1] - ldrb r0, [r7] - lsls r1, r0, 9 - adds r1, r2 - ldrb r1, [r1] - bl sub_8184FBC - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x42 - ands r0, r1 - cmp r0, 0x42 - bne _0803CEC6 - ldrb r0, [r7] - ldr r2, [r6] - lsls r1, r0, 1 - adds r1, r0 - adds r1, r2 - adds r1, 0x60 - ldrb r2, [r1] - movs r0, 0xF - ands r0, r2 - strb r0, [r1] - ldrb r0, [r7] - ldr r2, [r6] - lsls r1, r0, 1 - adds r1, r0 - adds r1, r2 - adds r1, 0x60 - lsls r0, 9 - adds r5, r4, 0x2 - adds r0, r5 - ldrb r2, [r0] - movs r3, 0xF0 - adds r0, r3, 0 - ands r0, r2 - ldrb r2, [r1] - orrs r0, r2 - strb r0, [r1] - ldrb r1, [r7] - ldr r2, [r6] - lsls r0, r1, 1 - adds r0, r1 - adds r0, r2 - adds r0, 0x61 - lsls r1, 9 - adds r4, 0x3 - mov r12, r4 - add r1, r12 - ldrb r1, [r1] - strb r1, [r0] - ldrb r0, [r7] - movs r4, 0x2 - eors r0, r4 - ldr r2, [r6] - lsls r1, r0, 1 - adds r1, r0 - adds r1, r2 - adds r1, 0x60 - ldrb r2, [r1] - adds r0, r3, 0 - ands r0, r2 - strb r0, [r1] - ldrb r0, [r7] - eors r0, r4 - ldr r2, [r6] - lsls r1, r0, 1 - adds r1, r0 - adds r1, r2 - adds r1, 0x60 - ldrb r0, [r7] - lsls r0, 9 - adds r0, r5 - ldrb r0, [r0] - ands r3, r0 - lsrs r3, 4 - ldrb r0, [r1] - orrs r3, r0 - strb r3, [r1] - ldrb r0, [r7] - eors r4, r0 - ldr r0, [r6] - lsls r1, r4, 1 - adds r1, r4 - adds r1, r0 - adds r1, 0x62 - ldrb r0, [r7] - lsls r0, 9 - add r0, r12 - ldrb r0, [r0] - strb r0, [r1] -_0803CEC6: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803CDF8 - - thumb_func_start sub_803CEDC -sub_803CEDC: @ 803CEDC - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =0x0202407a - adds r4, r0, r2 - ldrb r5, [r4] - adds r2, r1, r2 - ldrb r3, [r2] - strb r3, [r4] - strb r5, [r2] - ldr r2, =0x0202407e - adds r0, r2 - ldrb r5, [r0] - adds r1, r2 - ldrb r2, [r1] - strb r2, [r0] - strb r5, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803CEDC - - thumb_func_start b_first_side -b_first_side: @ 803CF10 - 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 - mov r9, r0 - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - bne _0803CFD8 - ldr r1, [sp, 0x8] - str r1, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0x4D - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - bne _0803CFD8 - ldr r1, =0x02024084 - movs r0, 0x58 - mov r2, r9 - muls r2, r0 - adds r0, r2, 0 - adds r0, r1 - adds r0, 0x20 - ldrb r3, [r0] - cmp r3, 0x21 - bne _0803CF7C - ldr r0, =0x020243cc - ldrh r1, [r0] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - bne _0803CF8C -_0803CF7C: - cmp r3, 0x22 - bne _0803CF98 - ldr r0, =0x020243cc - ldrh r1, [r0] - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - beq _0803CF98 -_0803CF8C: - movs r3, 0x2 - b _0803CF9A - .pool -_0803CF98: - movs r3, 0x1 -_0803CF9A: - movs r0, 0x58 - mov r1, r10 - muls r1, r0 - adds r0, r1, 0 - ldr r2, =0x02024084 - adds r0, r2 - adds r0, 0x20 - ldrb r2, [r0] - cmp r2, 0x21 - bne _0803CFBA - ldr r0, =0x020243cc - ldrh r1, [r0] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - bne _0803CFCA -_0803CFBA: - cmp r2, 0x22 - bne _0803CFDA - ldr r0, =0x020243cc - ldrh r1, [r0] - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - beq _0803CFDA -_0803CFCA: - movs r7, 0x2 - b _0803CFDC - .pool -_0803CFD8: - movs r3, 0x1 -_0803CFDA: - movs r7, 0x1 -_0803CFDC: - ldr r1, =0x02024084 - movs r0, 0x58 - mov r2, r9 - muls r2, r0 - adds r0, r2, 0 - adds r4, r0, r1 - ldrh r0, [r4, 0x6] - muls r3, r0 - ldr r2, =gUnknown_08329D2E - movs r1, 0x1B - ldrsb r1, [r4, r1] - lsls r1, 1 - adds r0, r1, r2 - ldrb r0, [r0] - muls r0, r3 - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - bl __divsi3 - mov r8, r0 - ldrh r0, [r4, 0x2E] - cmp r0, 0xAF - bne _0803D02C - ldr r1, =0x02024404 - mov r3, r9 - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r6, [r0, 0x7] - ldrb r5, [r0, 0x1A] - b _0803D040 - .pool -_0803D02C: - ldrh r0, [r4, 0x2E] - bl itemid_get_x12 - lsls r0, 24 - lsrs r6, r0, 24 - ldrh r0, [r4, 0x2E] - bl itemid_get_quality - lsls r0, 24 - lsrs r5, r0, 24 -_0803D040: - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x023f0102 - ands r0, r1 - cmp r0, 0 - bne _0803D074 - ldr r0, =0x00000869 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0803D074 - mov r0, r9 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0803D074 - movs r0, 0x6E - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - movs r1, 0x64 - bl __udivsi3 - mov r8, r0 -_0803D074: - cmp r6, 0x18 - bne _0803D07E - mov r2, r8 - lsrs r2, 1 - mov r8, r2 -_0803D07E: - ldr r1, =0x02024084 - movs r0, 0x58 - mov r3, r9 - muls r3, r0 - adds r0, r3, 0 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0803D09C - mov r0, r8 - lsrs r0, 2 - mov r8, r0 -_0803D09C: - cmp r6, 0x1A - bne _0803D0B8 - ldr r0, =0x02024330 - ldrh r4, [r0] - lsls r0, r5, 16 - subs r0, r5 - movs r1, 0x64 - bl __divsi3 - cmp r4, r0 - bge _0803D0B8 - movs r1, 0x1 - negs r1, r1 - mov r8, r1 -_0803D0B8: - ldr r1, =0x02024084 - movs r0, 0x58 - mov r2, r10 - muls r2, r0 - adds r0, r2, 0 - adds r4, r0, r1 - ldrh r0, [r4, 0x6] - adds r3, r0, 0 - muls r3, r7 - ldr r2, =gUnknown_08329D2E - movs r1, 0x1B - ldrsb r1, [r4, r1] - lsls r1, 1 - adds r0, r1, r2 - ldrb r0, [r0] - muls r0, r3 - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - bl __divsi3 - adds r7, r0, 0 - ldrh r0, [r4, 0x2E] - cmp r0, 0xAF - bne _0803D118 - ldr r1, =0x02024404 - mov r3, r10 - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r6, [r0, 0x7] - ldrb r5, [r0, 0x1A] - b _0803D12C - .pool -_0803D118: - ldrh r0, [r4, 0x2E] - bl itemid_get_x12 - lsls r0, 24 - lsrs r6, r0, 24 - ldrh r0, [r4, 0x2E] - bl itemid_get_quality - lsls r0, 24 - lsrs r5, r0, 24 -_0803D12C: - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x023f0102 - ands r0, r1 - cmp r0, 0 - bne _0803D15C - ldr r0, =0x00000869 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0803D15C - mov r0, r10 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0803D15C - movs r0, 0x6E - muls r0, r7 - movs r1, 0x64 - bl __udivsi3 - adds r7, r0, 0 -_0803D15C: - cmp r6, 0x18 - bne _0803D162 - lsrs r7, 1 -_0803D162: - ldr r2, =0x02024084 - movs r0, 0x58 - mov r1, r10 - muls r1, r0 - adds r0, r1, 0 - adds r1, r2, 0 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0803D17E - lsrs r7, 2 -_0803D17E: - cmp r6, 0x1A - bne _0803D198 - ldr r0, =0x02024330 - ldrh r4, [r0] - lsls r0, r5, 16 - subs r0, r5 - movs r1, 0x64 - bl __divsi3 - cmp r4, r0 - bge _0803D198 - movs r7, 0x1 - negs r7, r7 -_0803D198: - ldr r2, [sp, 0x4] - cmp r2, 0 - beq _0803D1B8 - movs r3, 0 - b _0803D254 - .pool -_0803D1B8: - ldr r0, =0x0202421c - mov r3, r9 - adds r1, r3, r0 - ldrb r1, [r1] - adds r2, r0, 0 - cmp r1, 0 - bne _0803D208 - ldr r0, =0x0202433c - lsls r1, r3, 4 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 29 - cmp r0, 0 - bge _0803D1E0 - movs r3, 0xA5 - b _0803D20A - .pool -_0803D1E0: - ldr r0, =0x0202449c - ldr r0, [r0] - add r0, r9 - adds r0, 0x80 - ldrb r0, [r0] - lsls r0, 1 - movs r1, 0x58 - mov r3, r9 - muls r3, r1 - adds r1, r3, 0 - adds r0, r1 - ldr r1, =0x02024084 - adds r1, 0xC - adds r0, r1 - ldrh r3, [r0] - b _0803D20A - .pool -_0803D208: - movs r3, 0 -_0803D20A: - mov r1, r10 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _0803D254 - ldr r0, =0x0202433c - lsls r1, 4 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 29 - cmp r0, 0 - bge _0803D22C - movs r2, 0xA5 - b _0803D256 - .pool -_0803D22C: - ldr r0, =0x0202449c - ldr r0, [r0] - add r0, r10 - adds r0, 0x80 - ldrb r0, [r0] - lsls r0, 1 - movs r1, 0x58 - mov r2, r10 - muls r2, r1 - adds r1, r2, 0 - adds r0, r1 - ldr r1, =0x02024084 - adds r1, 0xC - adds r0, r1 - ldrh r2, [r0] - b _0803D256 - .pool -_0803D254: - movs r2, 0 -_0803D256: - ldr r4, =gBattleMoves - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 2 - adds r0, r4 - movs r1, 0x7 - ldrsb r1, [r0, r1] - lsls r3, r2, 1 - cmp r1, 0 - bne _0803D27A - adds r0, r3, r2 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x7] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - beq _0803D2B8 -_0803D27A: - adds r0, r3, r2 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x7] - lsls r0, 24 - asrs r0, 24 - cmp r1, r0 - bne _0803D2AE - cmp r8, r7 - bne _0803D2A4 - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _0803D2A4 - movs r3, 0x2 - b _0803D2D4 - .pool -_0803D2A4: - cmp r8, r7 - bcs _0803D2D6 - movs r0, 0x1 - str r0, [sp, 0x8] - b _0803D2D6 -_0803D2AE: - cmp r1, r0 - bge _0803D2D6 - movs r1, 0x1 - str r1, [sp, 0x8] - b _0803D2D6 -_0803D2B8: - cmp r8, r7 - bne _0803D2CE - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _0803D2CE - movs r2, 0x2 - str r2, [sp, 0x8] - b _0803D2D6 -_0803D2CE: - cmp r8, r7 - bcs _0803D2D6 - movs r3, 0x1 -_0803D2D4: - str r3, [sp, 0x8] -_0803D2D6: - 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 - thumb_func_end b_first_side - - thumb_func_start sub_803D2E8 -sub_803D2E8: @ 803D2E8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r3, 0 - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0803D354 - ldr r0, =0x02024064 - strb r3, [r0] - ldr r4, =0x0202406c - mov r8, r0 - ldrb r0, [r4] - cmp r3, r0 - bcc _0803D310 - b _0803D54A -_0803D310: - ldr r7, =0x0202407a - ldr r6, =0x0202421c - mov r2, r8 - ldr r5, =0x0202407e -_0803D318: - adds r1, r3, r7 - ldrb r0, [r2] - adds r0, r6 - ldrb r0, [r0] - strb r0, [r1] - adds r1, r3, r5 - ldrb r0, [r2] - strb r0, [r1] - adds r3, 0x1 - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r4] - cmp r0, r1 - bcc _0803D318 - b _0803D54A - .pool -_0803D354: - movs r2, 0x2 - ands r1, r2 - cmp r1, 0 - beq _0803D3A4 - ldr r0, =0x02024064 - strb r3, [r0] - ldr r1, =0x0202406c - mov r8, r0 - adds r2, r1, 0 - ldrb r2, [r2] - cmp r3, r2 - bcs _0803D3C0 - ldr r0, =0x0202421c - ldrb r1, [r0] - adds r4, r0, 0 - cmp r1, 0x3 - beq _0803D3BE -_0803D376: - mov r7, r8 - ldrb r0, [r7] - adds r0, 0x1 - strb r0, [r7] - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0202406c - ldrb r1, [r1] - cmp r0, r1 - bcs _0803D3C0 - ldrb r0, [r7] - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0x3 - bne _0803D376 - b _0803D3BE - .pool -_0803D3A4: - ldr r1, =0x0202421c - ldrb r0, [r1] - ldr r4, =0x02024064 - mov r8, r4 - cmp r0, 0x3 - bne _0803D3B4 - strb r3, [r4] - movs r3, 0x5 -_0803D3B4: - ldrb r0, [r1, 0x2] - cmp r0, 0x3 - bne _0803D3C0 - mov r7, r8 - strb r2, [r7] -_0803D3BE: - movs r3, 0x5 -_0803D3C0: - cmp r3, 0x5 - bne _0803D448 - ldr r6, =0x0202407a - ldr r1, =0x0202421c - mov r2, r8 - ldrb r0, [r2] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r6] - ldr r2, =0x0202407e - mov r3, r8 - ldrb r0, [r3] - strb r0, [r2] - movs r3, 0x1 - movs r5, 0 - adds r4, r1, 0 - ldr r7, =0x03005d04 - mov r10, r7 - ldr r0, =bc_80154A0 - mov r12, r0 - ldr r1, =0x0202449c - mov r9, r1 - ldr r7, =0x0202406c - ldrb r7, [r7] - cmp r5, r7 - bge _0803D41A - adds r7, r6, 0 - adds r6, r4, 0 - adds r4, r2, 0 - ldr r2, =0x0202406c -_0803D3FC: - mov r0, r8 - ldrb r0, [r0] - cmp r5, r0 - beq _0803D412 - adds r1, r3, r7 - adds r0, r5, r6 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r3, r4 - strb r5, [r0] - adds r3, 0x1 -_0803D412: - adds r5, 0x1 - ldrb r1, [r2] - cmp r5, r1 - blt _0803D3FC -_0803D41A: - mov r2, r12 - mov r3, r10 - str r2, [r3] - mov r4, r9 - ldr r0, [r4] - b _0803D554 - .pool -_0803D448: - movs r0, 0 - mov r7, r8 - strb r0, [r7] - ldr r1, =0x0202406c - ldrb r0, [r1] - cmp r0, 0 - beq _0803D48E - ldr r6, =0x0202421c - mov r2, r8 - ldr r5, =0x0202407a - ldr r4, =0x0202407e -_0803D45E: - ldrb r0, [r2] - adds r0, r6 - ldrb r1, [r0] - subs r0, r1, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _0803D47C - adds r0, r3, r5 - strb r1, [r0] - adds r1, r3, r4 - mov r7, r8 - ldrb r0, [r7] - strb r0, [r1] - adds r3, 0x1 -_0803D47C: - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0202406c - ldrb r1, [r1] - cmp r0, r1 - bcc _0803D45E -_0803D48E: - movs r0, 0 - mov r2, r8 - strb r0, [r2] - ldr r4, =0x0202406c - ldrb r0, [r4] - cmp r0, 0 - beq _0803D4D2 - ldr r6, =0x0202421c - ldr r5, =0x0202407a - ldr r4, =0x0202407e -_0803D4A2: - ldrb r0, [r2] - adds r0, r6 - ldrb r1, [r0] - subs r0, r1, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _0803D4C0 - adds r0, r3, r5 - strb r1, [r0] - adds r1, r3, r4 - mov r7, r8 - ldrb r0, [r7] - strb r0, [r1] - adds r3, 0x1 -_0803D4C0: - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0202406c - ldrb r1, [r1] - cmp r0, r1 - bcc _0803D4A2 -_0803D4D2: - movs r5, 0 - b _0803D540 - .pool -_0803D4E8: - adds r4, r5, 0x1 - adds r7, r4, 0 - ldrb r1, [r1] - cmp r7, r1 - bge _0803D53E - ldr r6, =0x0202407a - lsls r2, r5, 24 - mov r8, r2 -_0803D4F8: - ldr r0, =0x0202407e - adds r1, r5, r0 - ldrb r3, [r1] - adds r0, r4, r0 - ldrb r1, [r0] - adds r0, r5, r6 - ldrb r2, [r0] - cmp r2, 0x1 - beq _0803D534 - adds r0, r4, r6 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0803D534 - cmp r2, 0x2 - beq _0803D534 - cmp r0, 0x2 - beq _0803D534 - adds r0, r3, 0 - movs r2, 0 - bl b_first_side - lsls r0, 24 - cmp r0, 0 - beq _0803D534 - lsls r1, r4, 24 - lsrs r1, 24 - mov r3, r8 - lsrs r0, r3, 24 - bl sub_803CEDC -_0803D534: - adds r4, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _0803D4F8 -_0803D53E: - adds r5, r7, 0 -_0803D540: - ldr r1, =0x0202406c - ldrb r0, [r1] - subs r0, 0x1 - cmp r5, r0 - blt _0803D4E8 -_0803D54A: - ldr r1, =0x03005d04 - ldr r0, =bc_80154A0 - str r0, [r1] - ldr r0, =0x0202449c - ldr r0, [r0] -_0803D554: - adds r0, 0x48 - movs r1, 0 - strb r1, [r0] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803D2E8 - - thumb_func_start sub_803D580 -sub_803D580: @ 803D580 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldr r1, =0x02024064 - movs r0, 0 - strb r0, [r1] - ldr r0, =0x0202406c - ldrb r2, [r0] - adds r5, r1, 0 - cmp r2, 0 - beq _0803D678 - ldr r7, =0x0202433c - adds r6, r5, 0 - ldr r0, =0x020240d4 - mov r12, r0 - ldr r1, =0x020242bc - mov r8, r1 - mov r10, r8 -_0803D5AE: - mov r2, r9 - cmp r2, 0 - beq _0803D5EC - ldrb r1, [r6] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldrb r1, [r6] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1] - movs r0, 0x3 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - b _0803D648 - .pool -_0803D5EC: - ldrb r0, [r6] - lsls r0, 4 - adds r2, r0, r7 - movs r1, 0 - mov r4, r10 - movs r3, 0 -_0803D5F8: - adds r0, r2, r1 - strb r3, [r0] - adds r1, 0x1 - cmp r1, 0xF - bls _0803D5F8 - ldrb r1, [r5] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r1, r0, r4 - ldrb r0, [r1, 0x16] - cmp r0, 0 - beq _0803D616 - subs r0, 0x1 - strb r0, [r1, 0x16] -_0803D616: - ldrb r1, [r5] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r1, r0, r4 - ldrb r0, [r1, 0x19] - cmp r0, 0 - beq _0803D648 - subs r0, 0x1 - strb r0, [r1, 0x19] - ldrb r2, [r5] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x19] - cmp r0, 0 - bne _0803D648 - movs r0, 0x58 - muls r2, r0 - add r2, r12 - ldr r0, [r2] - ldr r1, =0xffbfffff - ands r0, r1 - str r0, [r2] -_0803D648: - ldrb r2, [r5] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - add r0, r8 - ldrb r0, [r0, 0xA] - cmp r0, 0 - bne _0803D666 - movs r0, 0x58 - muls r2, r0 - add r2, r12 - ldr r0, [r2] - ldr r1, =0xfeffffff - ands r0, r1 - str r0, [r2] -_0803D666: - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0202406c - ldrb r1, [r1] - cmp r0, r1 - bcc _0803D5AE -_0803D678: - movs r0, 0 - ldr r2, =0x02024294 - strb r0, [r2, 0x8] - strb r0, [r2, 0x14] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803D580 - - thumb_func_start sub_803D6A0 -sub_803D6A0: @ 803D6A0 - push {r4-r6,lr} - ldr r2, =0x02024064 - movs r0, 0 - strb r0, [r2] - ldr r0, =0x0202406c - ldrb r1, [r0] - adds r6, r0, 0 - cmp r1, 0 - beq _0803D6DE - adds r3, r2, 0 - movs r4, 0 - ldr r5, =0x0202437c -_0803D6B8: - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, r0, r5 - movs r1, 0 -_0803D6C4: - adds r0, r2, r1 - strb r4, [r0] - adds r1, 0x1 - cmp r1, 0x13 - bls _0803D6C4 - ldrb r0, [r3] - adds r0, 0x1 - strb r0, [r3] - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r6] - cmp r0, r1 - bcc _0803D6B8 -_0803D6DE: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803D6A0 - - thumb_func_start bc_80154A0 -bc_80154A0: @ 803D6F0 - push {r4-r7,lr} - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - bne _0803D7AE - ldr r2, =0x0202449c - ldr r0, [r2] - adds r0, 0x48 - ldr r1, =0x0202406c - ldrb r0, [r0] - mov r12, r2 - adds r6, r1, 0 - ldrb r1, [r6] - cmp r0, r1 - bcs _0803D7AE - ldr r5, =0x02024064 - ldr r4, =0x0202420b - movs r7, 0x84 - lsls r7, 1 -_0803D71C: - ldr r1, [r2] - adds r1, 0x48 - ldrb r0, [r1] - strb r0, [r4] - strb r0, [r5] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r1, =0x02024274 - ldrb r3, [r5] - lsls r0, r3, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r7 - bne _0803D7A0 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r3 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - bne _0803D7A0 - ldr r2, =0x020242bc - ldrb r1, [r4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x18] - lsls r0, 31 - cmp r0, 0 - bne _0803D7A0 - ldr r0, =0x0202433c - lsls r1, r3, 4 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 29 - cmp r0, 0 - blt _0803D7A0 - ldr r0, =gUnknown_082DB1FF - bl b_call_bc_move_exec - b _0803D7E8 - .pool -_0803D7A0: - mov r2, r12 - ldr r0, [r2] - adds r0, 0x48 - ldrb r0, [r0] - ldrb r1, [r6] - cmp r0, r1 - bcc _0803D71C -_0803D7AE: - bl b_clear_atk_up_if_hit_flag_unless_enraged - ldr r1, =0x02024082 - movs r0, 0 - strb r0, [r1] - ldr r1, =0x02024083 - ldr r0, =0x0202407a - movs r3, 0 - ldrb r0, [r0] - strb r0, [r1] - ldr r0, =0x02024400 - movs r2, 0 - strh r3, [r0] - ldr r0, =0x0202449c - ldr r0, [r0] - strb r2, [r0, 0x13] - ldr r1, =0x03005d04 - ldr r0, =bc_bs_exec - str r0, [r1] - ldr r0, =0x02024332 - strb r2, [r0, 0x3] - strb r2, [r0, 0x4] - ldr r0, =0x02024474 - strb r2, [r0, 0x16] - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r0, [r0, 0x8] - adds r0, 0x20 - strb r2, [r0] -_0803D7E8: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end bc_80154A0 - - thumb_func_start bc_bs_exec -bc_bs_exec: @ 803D818 - push {r4-r6,lr} - ldr r6, =0x0202433a - ldrb r0, [r6] - ldr r2, =0x02024083 - cmp r0, 0 - beq _0803D828 - movs r0, 0xC - strb r0, [r2] -_0803D828: - ldr r5, =0x0202449c - ldr r0, [r5] - adds r0, 0x4B - ldr r4, =0x02024082 - ldrb r1, [r4] - strb r1, [r0] - ldr r1, =gUnknown_0831BC0C - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - ldr r0, =0x0202406c - ldrb r1, [r4] - ldrb r0, [r0] - cmp r1, r0 - bcc _0803D894 - ldr r2, =0x02024280 - ldr r0, [r2] - ldr r1, =0xffefffff - ands r0, r1 - str r0, [r2] - ldr r3, =0x03005d04 - ldr r2, =gUnknown_0831BC44 - ldrb r1, [r6] - movs r0, 0x7F - ands r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - str r0, [r3] - b _0803D8AC - .pool -_0803D894: - ldr r0, [r5] - adds r0, 0x4B - ldrb r0, [r0] - cmp r0, r1 - beq _0803D8AC - ldr r2, =0x02024280 - ldr r0, [r2] - ldr r1, =0xfffffdff - ands r0, r1 - ldr r1, =0xfff7ffff - ands r0, r1 - str r0, [r2] -_0803D8AC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end bc_bs_exec - - thumb_func_start sub_803D8C0 -sub_803D8C0: @ 803D8C0 - push {r4,lr} - ldr r1, =0x02024083 - movs r0, 0 - strb r0, [r1] - ldr r1, =0x02022fec - ldr r2, [r1] - ldr r0, =0x02000002 - ands r0, r2 - cmp r0, 0 - beq _0803D920 - ldr r1, =0x020375f0 - ldr r4, =0x0202433a - ldrb r0, [r4] - strh r0, [r1] - ldr r1, =0x02022f58 - ldrb r0, [r4] - strb r0, [r1] - movs r0, 0 - bl battle_get_side_with_given_state - ldr r1, =0x0202420b - strb r0, [r1] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAA35 - str r0, [r1] - ldrb r1, [r4] - movs r0, 0x7F - ands r0, r1 - strb r0, [r4] - b _0803DAA4 - .pool -_0803D920: - movs r0, 0x8 - ands r0, r2 - cmp r0, 0 - beq _0803D95C - ldr r0, =0x043f0900 - ands r2, r0 - cmp r2, 0 - beq _0803D95C - bl sub_805EA60 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAA87 - str r0, [r1] - ldr r0, =0x02038bca - ldrh r1, [r0] - ldr r0, =0x000003fe - cmp r1, r0 - bne _0803D946 - b _0803DA8A -_0803D946: - b _0803DA94 - .pool -_0803D95C: - ldr r0, [r1] - movs r1, 0xA - ands r0, r1 - cmp r0, 0x8 - beq _0803D968 - b _0803DA9E -_0803D968: - bl sub_805EA60 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DA92D - str r0, [r1] - ldr r2, =gTrainers - ldr r0, =0x02038bca - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x1] - subs r0, 0x3 - cmp r0, 0x32 - bls _0803D98A - b _0803DA94 -_0803D98A: - lsls r0, 2 - ldr r1, =_0803D9A8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0803D9A8: - .4byte _0803DA80 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA80 - .4byte _0803DA94 - .4byte _0803DA80 - .4byte _0803DA94 - .4byte _0803DA80 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA74 - .4byte _0803DA8A - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA74 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA80 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA80 -_0803DA74: - ldr r0, =0x00000163 - bl song_play_for_text - b _0803DAA4 - .pool -_0803DA80: - movs r0, 0xD4 - lsls r0, 1 - bl song_play_for_text - b _0803DAA4 -_0803DA8A: - movs r0, 0xB1 - lsls r0, 1 - bl song_play_for_text - b _0803DAA4 -_0803DA94: - movs r0, 0xCE - lsls r0, 1 - bl song_play_for_text - b _0803DAA4 -_0803DA9E: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DA96A - str r0, [r1] -_0803DAA4: - ldr r1, =0x03005d04 - ldr r0, =sub_803DCD8 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803D8C0 - - thumb_func_start sub_803DAC0 -sub_803DAC0: @ 803DAC0 - push {r4,lr} - ldr r1, =0x02024083 - movs r0, 0 - strb r0, [r1] - ldr r0, =0x02022fec - ldr r1, [r0] - ldr r0, =0x02000002 - ands r0, r1 - cmp r0, 0 - beq _0803DB7C - ldr r0, =0x003f0100 - ands r1, r0 - cmp r1, 0 - beq _0803DB44 - ldr r3, =0x0202433a - ldrb r2, [r3] - movs r0, 0x80 - ands r0, r2 - cmp r0, 0 - beq _0803DB2C - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB9C8 - str r0, [r1] - movs r0, 0x7F - ands r0, r2 - strb r0, [r3] - ldr r0, =0x03005d90 - ldr r1, [r0] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x8 - orrs r0, r2 - strb r0, [r1] - b _0803DB82 - .pool -_0803DB2C: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAA0B - str r0, [r1] - movs r0, 0x7F - ands r0, r2 - strb r0, [r3] - b _0803DB82 - .pool -_0803DB44: - ldr r1, =0x02022f58 - ldr r4, =0x0202433a - ldrb r0, [r4] - strb r0, [r1] - movs r0, 0 - bl battle_get_side_with_given_state - ldr r1, =0x0202420b - strb r0, [r1] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAA35 - str r0, [r1] - ldrb r1, [r4] - movs r0, 0x7F - ands r0, r1 - strb r0, [r4] - b _0803DB82 - .pool -_0803DB7C: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DA96D - str r0, [r1] -_0803DB82: - ldr r1, =0x03005d04 - ldr r0, =sub_803DCD8 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803DAC0 - - thumb_func_start sub_803DBA0 -sub_803DBA0: @ 803DBA0 - push {lr} - ldr r1, =0x02024083 - movs r0, 0 - strb r0, [r1] - ldr r1, =0x02022fec - ldr r2, [r1] - ldr r0, =0x003f0100 - ands r0, r2 - cmp r0, 0 - beq _0803DBFC - movs r0, 0x8 - ands r2, r0 - cmp r2, 0 - beq _0803DBFC - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB9C1 - str r0, [r1] - ldr r1, =0x0202433a - movs r0, 0x9 - strb r0, [r1] - ldr r0, =0x03005d90 - ldr r1, [r0] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x8 - orrs r0, r2 - strb r0, [r1] - b _0803DC6A - .pool -_0803DBFC: - ldr r0, [r1] - movs r1, 0x80 - lsls r1, 19 - ands r0, r1 - cmp r0, 0 - beq _0803DC24 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB9C1 - str r0, [r1] - ldr r1, =0x0202433a - movs r0, 0x9 - strb r0, [r1] - b _0803DC6A - .pool -_0803DC24: - ldr r1, =0x0202433c - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x1] - lsls r0, 27 - lsrs r0, 30 - cmp r0, 0x1 - beq _0803DC54 - cmp r0, 0x2 - beq _0803DC64 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAAF0 - b _0803DC68 - .pool -_0803DC54: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAADB - b _0803DC68 - .pool -_0803DC64: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAAE9 -_0803DC68: - str r0, [r1] -_0803DC6A: - ldr r1, =0x03005d04 - ldr r0, =sub_803DCD8 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_803DBA0 - - thumb_func_start bc_80158BC -bc_80158BC: @ 803DC84 - ldr r1, =0x02024083 - movs r0, 0 - strb r0, [r1] - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x7 - strb r0, [r1, 0x1] - ldr r2, =0x0202420b - ldrb r0, [r2] - strb r0, [r1, 0x2] - ldr r3, =0x0202406e - ldrb r0, [r2] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAAF7 - str r0, [r1] - ldr r1, =0x03005d04 - ldr r0, =sub_803DCD8 - str r0, [r1] - bx lr - .pool - thumb_func_end bc_80158BC - - thumb_func_start sub_803DCD8 -sub_803DCD8: @ 803DCD8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =0x02024083 - ldrb r0, [r0] - subs r0, 0xB - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _0803DCEE - b _0803DE10 -_0803DCEE: - ldr r0, =0x02022fec - ldr r1, [r0] - ldr r0, =0x023f0b92 - ands r1, r0 - cmp r1, 0 - bne _0803DDB6 - ldr r2, =0x02024064 - strb r1, [r2] - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r1, r0 - bcs _0803DDB2 - adds r5, r2, 0 - ldr r0, =0x0202406e - mov r8, r0 - movs r7, 0x64 - ldr r6, =0x020244ec -_0803DD10: - ldrb r0, [r5] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0803DDA0 - ldr r4, =0x03005d10 - ldrh r0, [r4, 0x6] - cmp r0, 0 - bne _0803DD74 - ldrb r0, [r5] - lsls r0, 1 - add r0, r8 - ldrh r0, [r0] - muls r0, r7 - adds r0, r6 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - strh r0, [r4, 0x6] - ldrb r0, [r5] - lsls r0, 1 - add r0, r8 - ldrh r0, [r0] - muls r0, r7 - adds r0, r6 - movs r1, 0x2 - adds r2, r4, 0 - adds r2, 0x8 - bl pokemon_getattr - b _0803DDA0 - .pool -_0803DD74: - ldrb r0, [r5] - lsls r0, 1 - add r0, r8 - ldrh r0, [r0] - muls r0, r7 - adds r0, r6 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - strh r0, [r4, 0x26] - ldrb r0, [r5] - lsls r0, 1 - add r0, r8 - ldrh r0, [r0] - muls r0, r7 - adds r0, r6 - movs r1, 0x2 - adds r2, r4, 0 - adds r2, 0x14 - bl pokemon_getattr -_0803DDA0: - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bcc _0803DD10 -_0803DDB2: - bl sub_80EC728 -_0803DDB6: - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x023f0b9a - ands r0, r1 - cmp r0, 0 - bne _0803DDD2 - ldr r0, =0x03005d10 - ldrb r1, [r0, 0x5] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0803DDD2 - bl sub_80EE184 -_0803DDD2: - bl sub_8186444 - movs r0, 0x3 - bl sub_80A2390 - movs r0, 0x5 - bl sub_80A2F50 - ldr r1, =0x03005d04 - ldr r0, =sub_803DE40 - str r0, [r1] - ldr r1, =0x030061e8 - ldr r0, =sub_8038420 - str r0, [r1] - b _0803DE2A - .pool -_0803DE10: - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0803DE2A - ldr r1, =gUnknown_0831BD10 - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 -_0803DE2A: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803DCD8 - - thumb_func_start sub_803DE40 -sub_803DE40: @ 803DE40 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0803DE86 - bl ResetAllObjectData - ldr r0, =0x03005d54 - ldrb r0, [r0] - cmp r0, 0 - beq _0803DE62 - ldr r0, =0x0202433a - ldrb r0, [r0] - cmp r0, 0x1 - beq _0803DE80 -_0803DE62: - ldr r1, =0x03005d04 - ldr r0, =c4_overworld - str r0, [r1] - b _0803DEA2 - .pool -_0803DE80: - ldr r1, =0x03005d04 - ldr r0, =bc_evolution_cutscene - str r0, [r1] -_0803DE86: - bl FreeAllWindowBuffers - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - bne _0803DEA2 - bl sub_805F094 - bl sub_8057028 - bl dp11_free -_0803DEA2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_803DE40 - - thumb_func_start bc_evolution_cutscene -bc_evolution_cutscene: @ 803DEB4 - push {r4-r6,lr} - ldr r0, =0x03005d54 - ldrb r1, [r0] - adds r3, r0, 0 - cmp r1, 0 - beq _0803DF2E -_0803DEC0: - movs r6, 0 -_0803DEC2: - ldrb r2, [r3] - ldr r0, =gUnknown_0832A328 - lsls r1, r6, 2 - adds r1, r0 - ldr r1, [r1] - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _0803DF20 - bics r2, r1 - strb r2, [r3] - movs r0, 0x64 - adds r1, r6, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0 - bl GetEvolutionTargetSpecies - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - beq _0803DF20 - bl FreeAllWindowBuffers - ldr r0, =0x03005d04 - ldr r1, =sub_803DF48 - str r1, [r0] - lsls r3, r6, 24 - lsrs r3, 24 - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x1 - bl evolution_cutscene - b _0803DF34 - .pool -_0803DF20: - adds r6, 0x1 - ldr r3, =0x03005d54 - cmp r6, 0x5 - ble _0803DEC2 - ldrb r0, [r3] - cmp r0, 0 - bne _0803DEC0 -_0803DF2E: - ldr r1, =0x03005d04 - ldr r0, =c4_overworld - str r0, [r1] -_0803DF34: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end bc_evolution_cutscene - - thumb_func_start sub_803DF48 -sub_803DF48: @ 803DF48 - push {lr} - ldr r0, =0x030022c0 - ldr r1, [r0, 0x4] - ldr r0, =sub_8038420 - cmp r1, r0 - bne _0803DF5A - ldr r1, =0x03005d04 - ldr r0, =bc_evolution_cutscene - str r0, [r1] -_0803DF5A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_803DF48 - - thumb_func_start c4_overworld -c4_overworld: @ 803DF70 - push {r4-r6,lr} - ldr r6, =0x02022fec - ldr r0, [r6] - movs r5, 0x2 - ands r0, r5 - cmp r0, 0 - bne _0803DF8C - ldr r4, =0x020244ec - adds r0, r4, 0 - bl sub_806DCB4 - adds r0, r4, 0 - bl sub_806DEC4 -_0803DF8C: - ldr r4, [r6] - adds r0, r4, 0 - ands r0, r5 - cmp r0, 0 - beq _0803DF9E - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _0803DFEC -_0803DF9E: - ldr r1, =0x020375f0 - ldr r5, =0x0202433a - ldrb r0, [r5] - strh r0, [r1] - ldr r3, =0x030022c0 - ldr r0, =0x00000439 - adds r2, r3, r0 - ldrb r1, [r2] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldr r0, =0x03005d00 - ldr r0, [r0] - str r0, [r3] - movs r0, 0x80 - lsls r0, 3 - ands r4, r0 - cmp r4, 0 - beq _0803DFDE - ldr r0, =0x02024744 - bl sub_8161F18 - ldrb r1, [r5] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0803DFDA - cmp r1, 0x7 - bne _0803DFDE -_0803DFDA: - bl sub_8161F4C -_0803DFDE: - movs r0, 0x5A - bl m4aSongNumStop - ldr r0, =0x030022c0 - ldr r0, [r0, 0x8] - bl SetMainCallback2 -_0803DFEC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end c4_overworld - - thumb_func_start bc_move_exec_returning -bc_move_exec_returning: @ 803E018 - push {lr} - ldr r0, =0x02024083 - ldrb r0, [r0] - subs r0, 0xB - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _0803E060 - ldr r3, =0x020244a8 - ldr r0, [r3] - ldr r0, [r0, 0xC] - adds r1, r0, 0 - adds r1, 0x20 - ldrb r0, [r1] - cmp r0, 0 - beq _0803E03C - subs r0, 0x1 - strb r0, [r1] -_0803E03C: - ldr r2, =0x03005d04 - ldr r0, [r3] - ldr r1, [r0, 0xC] - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - lsls r0, 2 - adds r1, r0 - ldr r0, [r1] - str r0, [r2] - b _0803E07A - .pool -_0803E060: - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0803E07A - ldr r1, =gUnknown_0831BD10 - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 -_0803E07A: - pop {r0} - bx r0 - .pool - thumb_func_end bc_move_exec_returning - - thumb_func_start sub_803E08C -sub_803E08C: @ 803E08C - push {lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0803E0A8 - ldr r1, =gUnknown_0831BD10 - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 -_0803E0A8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_803E08C - - thumb_func_start sub_803E0B8 -sub_803E0B8: @ 803E0B8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r0, 0x4 - str r0, [sp] - ldr r6, =0x0202420b - ldr r1, =0x0202407e - ldr r0, =0x02024082 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r6] - ldr r1, =0x0202449c - ldr r3, [r1] - adds r0, r3, 0 - adds r0, 0x91 - ldrb r2, [r0] - ldr r1, =gUnknown_0832A328 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - ands r2, r0 - cmp r2, 0 - beq _0803E110 - ldr r1, =0x02024083 - movs r0, 0xC - b _0803E83C - .pool -_0803E110: - ldr r1, =0x02024211 - movs r0, 0x1 - strb r0, [r1] - ldr r1, =0x02024474 - movs r0, 0x1 - strb r0, [r1, 0xE] - ldr r5, =0x000001a3 - adds r0, r3, r5 - strb r2, [r0] - ldr r0, =0x0202427c - strb r2, [r0] - ldr r0, =0x02024212 - strb r2, [r0] - ldr r0, =0x02024332 - strb r2, [r0, 0x6] - ldr r2, =0x020241e8 - ldr r0, =0x020241e9 - mov r9, r0 - ldrb r0, [r6] - ldr r3, =0x0202449c - ldr r1, [r3] - adds r0, r1 - adds r0, 0x80 - ldrb r0, [r0] - mov r5, r9 - strb r0, [r5] - strb r0, [r2] - ldr r1, =0x0202433c - ldrb r4, [r6] - lsls r0, r4, 4 - adds r3, r0, r1 - ldrb r1, [r3] - lsls r0, r1, 29 - mov r8, r2 - cmp r0, 0 - bge _0803E1BC - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r3] - ldr r2, =0x020241ea - ldr r1, =0x020241ec - movs r0, 0xA5 - strh r0, [r1] - strh r0, [r2] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 4 - orrs r0, r1 - str r0, [r2] - movs r0, 0xA5 - movs r1, 0 - bl sub_80458E0 - ldrb r1, [r6] - ldr r3, =0x0202449c - ldr r2, [r3] - b _0803E316 - .pool -_0803E1BC: - ldr r5, =0x02024084 - mov r10, r5 - movs r0, 0x58 - adds r5, r4, 0 - muls r5, r0 - mov r0, r10 - adds r0, 0x50 - adds r0, r5, r0 - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 5 - ands r0, r1 - cmp r0, 0 - bne _0803E1E2 - movs r7, 0x80 - lsls r7, 15 - ands r7, r1 - cmp r7, 0 - beq _0803E204 -_0803E1E2: - ldr r3, =0x020241ea - ldr r2, =0x020241ec - ldr r1, =0x02024268 - lsls r0, r4, 1 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r2] - strh r0, [r3] - b _0803E33C - .pool -_0803E204: - ldr r1, =0x020242bc - mov r12, r1 - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - add r0, r12 - ldrh r3, [r0, 0x6] - adds r1, r3, 0 - cmp r1, 0 - beq _0803E2DC - ldrb r2, [r0, 0xC] - lsls r0, r2, 1 - adds r0, r5 - mov r4, r10 - adds r4, 0xC - adds r0, r4 - ldrh r0, [r0] - cmp r1, r0 - bne _0803E268 - ldr r2, =0x020241ea - ldr r0, =0x020241ec - strh r3, [r0] - strh r3, [r2] - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - ldrb r0, [r0, 0xC] - mov r3, r9 - strb r0, [r3] - mov r5, r8 - strb r0, [r5] - ldrh r0, [r2] - movs r1, 0 - bl sub_80458E0 - ldrb r1, [r6] - ldr r3, =0x0202449c - ldr r2, [r3] - b _0803E316 - .pool -_0803E268: - cmp r1, 0 - beq _0803E2DC - cmp r1, r0 - beq _0803E2DC - mov r5, r9 - strb r2, [r5] - mov r0, r8 - strb r2, [r0] - ldr r3, =0x020241ea - ldr r2, =0x020241ec - ldrb r0, [r0] - lsls r0, 1 - ldrb r1, [r6] - movs r5, 0x58 - muls r1, r5 - adds r0, r1 - adds r0, r4 - ldrh r0, [r0] - strh r0, [r2] - strh r0, [r3] - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - movs r2, 0 - strh r7, [r0, 0x6] - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - strb r2, [r0, 0xC] - ldrb r0, [r6] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - add r1, r12 - ldrb r2, [r1, 0xE] - movs r0, 0x10 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0xE] - ldrh r0, [r3] - movs r1, 0 - bl sub_80458E0 - ldrb r1, [r6] - ldr r3, =0x0202449c - ldr r2, [r3] - b _0803E316 - .pool -_0803E2DC: - ldr r3, =0x02024084 - mov r5, r8 - ldrb r0, [r5] - lsls r0, 1 - ldr r4, =0x0202420b - ldrb r2, [r4] - movs r1, 0x58 - muls r1, r2 - adds r0, r1 - adds r3, 0xC - adds r0, r3 - ldr r1, =0x02024274 - lsls r2, 1 - adds r2, r1 - ldrh r3, [r0] - ldrh r2, [r2] - cmp r3, r2 - beq _0803E334 - ldr r1, =0x020241ea - ldr r0, =0x020241ec - strh r3, [r0] - strh r3, [r1] - ldrh r0, [r1] - movs r1, 0 - bl sub_80458E0 - ldrb r1, [r4] - ldr r2, =0x0202449c - ldr r2, [r2] -_0803E316: - adds r1, r2 - strb r0, [r1, 0xC] - b _0803E33C - .pool -_0803E334: - ldr r1, =0x020241ea - ldr r0, =0x020241ec - strh r3, [r0] - strh r3, [r1] -_0803E33C: - ldr r2, =0x02024084 - ldr r1, =0x0202420b - ldrb r3, [r1] - movs r0, 0x58 - muls r0, r3 - adds r0, r2 - ldrh r0, [r0, 0x28] - mov r8, r1 - cmp r0, 0 - beq _0803E384 - adds r0, r3, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0803E37C - ldr r0, =0x03005d10 - ldr r1, =0x020241ea - ldrh r1, [r1] - strh r1, [r0, 0x22] - b _0803E384 - .pool -_0803E37C: - ldr r0, =0x03005d10 - ldr r1, =0x020241ea - ldrh r1, [r1] - strh r1, [r0, 0x24] -_0803E384: - mov r1, r8 - ldrb r0, [r1] - bl battle_side_get_owner - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =0x02024294 - lsls r0, r6, 1 - adds r0, r6 - lsls r0, 2 - adds r5, r0, r1 - ldrb r0, [r5, 0x8] - cmp r0, 0 - beq _0803E400 - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x6] - cmp r0, 0 - bne _0803E400 - mov r3, r8 - ldrb r0, [r3] - bl battle_side_get_owner - adds r4, r0, 0 - ldrb r0, [r5, 0x9] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - beq _0803E400 - ldr r1, =0x02024084 - ldrb r2, [r5, 0x9] - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _0803E400 - ldr r0, =0x0202420c - strb r2, [r0] - b _0803E76A - .pool -_0803E400: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - ldr r5, =0x0202420b - mov r8, r5 - cmp r0, 0 - bne _0803E412 - b _0803E6E0 -_0803E412: - ldr r1, =0x02024294 - lsls r0, r6, 1 - adds r0, r6 - lsls r0, 2 - adds r0, r1 - ldrb r5, [r0, 0x8] - cmp r5, 0 - beq _0803E424 - b _0803E630 -_0803E424: - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r4, r0, r2 - ldrb r0, [r4, 0x1] - cmp r0, 0 - bne _0803E440 - ldrb r0, [r4, 0x6] - cmp r0, 0x10 - bne _0803E440 - b _0803E630 -_0803E440: - ldr r3, =0x02024084 - ldr r2, =0x0202420b - ldrb r6, [r2] - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, r6, r0 - ldrb r1, [r0, 0xC] - movs r0, 0x58 - muls r0, r1 - adds r0, r3 - adds r0, 0x20 - ldrb r0, [r0] - mov r8, r2 - cmp r0, 0x1F - bne _0803E460 - b _0803E630 -_0803E460: - ldrb r0, [r4, 0x2] - cmp r0, 0xD - beq _0803E468 - b _0803E630 -_0803E468: - adds r0, r6, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =0x02024064 - strb r5, [r1] - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r5, r0 - bcs _0803E4E0 - adds r4, r1, 0 -_0803E480: - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - beq _0803E4CE - ldr r0, =0x0202420b - ldrb r1, [r0] - ldr r0, =0x0202449c - ldr r0, [r0] - adds r1, r0 - ldrb r0, [r1, 0xC] - ldrb r1, [r4] - cmp r0, r1 - beq _0803E4CE - ldr r1, =0x02024084 - ldrb r2, [r4] - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x1F - bne _0803E4CE - adds r0, r2, 0 - bl sub_8048728 - lsls r0, 24 - lsrs r0, 24 - ldr r3, [sp] - cmp r0, r3 - bcs _0803E4CE - ldrb r0, [r4] - bl sub_8048728 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] -_0803E4CE: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bcc _0803E480 -_0803E4E0: - ldr r5, [sp] - cmp r5, 0x4 - beq _0803E4E8 - b _0803E5E2 -_0803E4E8: - ldr r2, =gBattleMoves - ldr r0, =0x020241ec - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x6] - ands r5, r0 - cmp r5, 0 - beq _0803E568 - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0803E548 - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _0803E544 - movs r0, 0x1 - b _0803E55A - .pool -_0803E544: - movs r0, 0x3 - b _0803E55A -_0803E548: - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _0803E558 - movs r0, 0 - b _0803E55A -_0803E558: - movs r0, 0x2 -_0803E55A: - bl battle_get_side_with_given_state - ldr r1, =0x0202420c - strb r0, [r1] - b _0803E578 - .pool -_0803E568: - ldr r2, =0x0202420c - ldr r0, =0x0202420b - ldrb r0, [r0] - ldr r1, =0x0202449c - ldr r1, [r1] - adds r0, r1 - ldrb r0, [r0, 0xC] - strb r0, [r2] -_0803E578: - ldr r7, =0x02024210 - ldrb r0, [r7] - ldr r1, =gUnknown_0832A328 - mov r8, r1 - ldr r5, =0x0202420c - ldrb r1, [r5] - lsls r1, 2 - add r1, r8 - ldr r1, [r1] - ands r0, r1 - cmp r0, 0 - bne _0803E592 - b _0803E76A -_0803E592: - ldr r6, =0x0202420b - ldrb r0, [r6] - bl battle_side_get_owner - adds r4, r0, 0 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - beq _0803E5C4 - ldrb r0, [r5] - b _0803E758 - .pool -_0803E5C4: - ldrb r0, [r6] - bl battle_get_per_side_status - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - strb r0, [r5] - ldrb r1, [r7] - ldrb r2, [r5] - lsls r0, r2, 2 - add r0, r8 - b _0803E74E -_0803E5E2: - ldr r4, =0x02024064 - ldr r0, =0x0202407e - ldr r3, [sp] - adds r0, r3, r0 - ldrb r0, [r0] - strb r0, [r4] - ldrb r0, [r4] - ldr r2, =0x02024084 - movs r1, 0x58 - muls r1, r0 - adds r1, r2 - adds r1, 0x20 - ldrb r1, [r1] - bl b_history__record_ability_usage_of_player - ldr r2, =0x0202437c - ldrb r1, [r4] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x2 - orrs r1, r2 - strb r1, [r0] - ldr r1, =0x0202420c - ldrb r0, [r4] - strb r0, [r1] - b _0803E76A - .pool -_0803E630: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r4, 0x1 - ands r0, r4 - cmp r0, 0 - beq _0803E6E0 - ldr r2, =gBattleMoves - ldr r0, =0x020241ec - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x6] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0803E6E0 - mov r5, r8 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0803E684 - bl GenerateRandomNumber - adds r1, r4, 0 - ands r1, r0 - cmp r1, 0 - beq _0803E680 - movs r0, 0x1 - b _0803E696 - .pool -_0803E680: - movs r0, 0x3 - b _0803E696 -_0803E684: - bl GenerateRandomNumber - adds r1, r4, 0 - ands r1, r0 - cmp r1, 0 - beq _0803E694 - movs r0, 0 - b _0803E696 -_0803E694: - movs r0, 0x2 -_0803E696: - bl battle_get_side_with_given_state - ldr r1, =0x0202420c - strb r0, [r1] - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - ldr r5, =0x0202420c - ldrb r0, [r5] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _0803E76A - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_side_get_owner - adds r4, r0, 0 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - beq _0803E76A - ldrb r0, [r5] - b _0803E758 - .pool -_0803E6E0: - ldr r5, =0x0202420c - mov r2, r8 - ldrb r0, [r2] - ldr r1, =0x0202449c - ldr r1, [r1] - adds r0, r1 - ldrb r0, [r0, 0xC] - strb r0, [r5] - ldr r6, =0x02024210 - ldrb r1, [r6] - ldr r7, =gUnknown_0832A328 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r7 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _0803E76A - ldrb r0, [r2] - bl battle_side_get_owner - adds r4, r0, 0 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - beq _0803E730 - ldrb r0, [r5] - b _0803E758 - .pool -_0803E730: - mov r1, r8 - ldrb r0, [r1] - bl battle_get_per_side_status - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - strb r0, [r5] - ldrb r1, [r6] - ldrb r2, [r5] - lsls r0, r2, 2 - adds r0, r7 -_0803E74E: - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _0803E76A - adds r0, r2, 0 -_0803E758: - bl battle_get_per_side_status - movs r1, 0x2 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - strb r0, [r5] -_0803E76A: - ldr r0, =0x02022fec - ldr r1, [r0] - movs r2, 0x80 - lsls r2, 10 - ands r1, r2 - adds r5, r0, 0 - cmp r1, 0 - beq _0803E808 - ldr r0, =0x0202433c - ldr r4, =0x0202420b - ldrb r2, [r4] - lsls r1, r2, 4 - adds r1, r0 - ldrb r0, [r1, 0x2] - lsls r0, 27 - cmp r0, 0 - bge _0803E808 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _0803E7B4 - ldr r1, =0x02024083 - movs r0, 0xC - b _0803E83C - .pool -_0803E7B4: - ldr r3, =0x02024230 - lsls r0, r2, 2 - adds r0, r3 - ldr r0, [r0] - cmp r0, 0 - beq _0803E7EC - ldr r1, =0x02024332 - movs r2, 0 - movs r0, 0x4 - strb r0, [r1, 0x5] - ldr r1, =0x02024214 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - str r0, [r1] - ldrb r0, [r4] - lsls r0, 2 - adds r0, r3 - str r2, [r0] - b _0803E824 - .pool -_0803E7EC: - ldr r1, =0x02024332 - movs r0, 0x4 - strb r0, [r1, 0x5] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB6AD - str r0, [r1] - b _0803E824 - .pool -_0803E808: - ldr r4, =0x02024214 - ldr r3, =gUnknown_082D86A8 - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - str r0, [r4] -_0803E824: - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - beq _0803E838 - ldr r0, =0x0202420b - ldrb r0, [r0] - bl sub_81A56E8 -_0803E838: - ldr r1, =0x02024083 - movs r0, 0xA -_0803E83C: - strb r0, [r1] - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803E0B8 - - thumb_func_start bs2_8016374 -bs2_8016374: @ 803E868 - push {r4,lr} - ldr r3, =0x0202420b - ldr r1, =0x0202407e - ldr r0, =0x02024082 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r3] - ldr r0, =0x02022e14 - movs r2, 0 - strh r2, [r0] - ldr r0, =0x02022e16 - strh r2, [r0] - ldr r1, =0x020244ac - ldrb r0, [r3] - adds r0, r1 - strb r2, [r0] - ldr r1, =0x020244b0 - ldrb r0, [r3] - adds r0, r1 - strb r2, [r0] - ldr r2, =0x02022f58 - movs r0, 0xFD - strb r0, [r2] - movs r0, 0x7 - strb r0, [r2, 0x1] - ldrb r4, [r3] - strb r4, [r2, 0x2] - ldrb r0, [r3] - ldr r1, =0x0202449c - ldr r1, [r1] - adds r0, r1 - adds r0, 0x58 - ldrb r0, [r0] - strb r0, [r2, 0x3] - movs r0, 0xFF - strb r0, [r2, 0x4] - ldr r0, =0x02024474 - strb r4, [r0, 0x17] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAB15 - str r0, [r1] - ldr r1, =0x02024083 - movs r0, 0xA - strb r0, [r1] - ldr r1, =0x03005d10 - ldrb r0, [r1, 0x2] - cmp r0, 0xFE - bhi _0803E8CE - adds r0, 0x1 - strb r0, [r1, 0x2] -_0803E8CE: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end bs2_8016374 - - thumb_func_start sub_803E90C -sub_803E90C: @ 803E90C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r4, =0x0202420b - ldr r2, =0x0202420c - ldr r1, =0x0202407e - ldr r0, =0x02024082 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - strb r0, [r4] - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldrb r0, [r4] - bl sub_8045868 - ldr r5, =0x02024208 - ldr r2, =0x02023864 - ldrb r1, [r4] - lsls r1, 9 - adds r0, r2, 0x1 - adds r0, r1, r0 - ldrb r3, [r0] - adds r2, 0x2 - adds r1, r2 - ldrb r0, [r1] - lsls r0, 8 - orrs r3, r0 - strh r3, [r5] - cmp r3, 0xC - bhi _0803E998 - ldr r2, =0x02024214 - ldr r1, =gUnknown_082DBD08 - ldrh r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - str r0, [r2] - ldr r0, =0x02024083 - mov r10, r0 - b _0803EBF6 - .pool -_0803E998: - adds r0, r3, 0 - subs r0, 0x50 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _0803E9C0 - ldr r0, =0x02024214 - ldr r1, =gUnknown_082DBD54 - ldr r1, [r1] - str r1, [r0] - ldr r1, =0x02024083 - mov r10, r1 - b _0803EBF6 - .pool -_0803E9C0: - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0803E9E8 - ldr r0, =0x02024214 - ldr r1, =gUnknown_082DBD3C - ldr r1, [r1] - str r1, [r0] - ldr r2, =0x02024083 - mov r10, r2 - b _0803EBF6 - .pool -_0803E9E8: - ldr r3, =0x02024474 - ldrb r0, [r4] - strb r0, [r3, 0x17] - lsls r0, 24 - lsrs r0, 25 - ldr r2, =0x0202449c - ldr r1, [r2] - adds r0, r1 - adds r0, 0xC4 - ldrb r0, [r0] - subs r0, 0x1 - mov r8, r4 - ldr r1, =0x02024214 - mov r9, r1 - ldr r6, =gUnknown_082DBD3C - mov r12, r3 - adds r7, r2, 0 - ldr r2, =0x02024083 - mov r10, r2 - cmp r0, 0x4 - bls _0803EA14 - b _0803EBDE -_0803EA14: - lsls r0, 2 - ldr r1, =_0803EA38 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0803EA38: - .4byte _0803EBDE - .4byte _0803EBDE - .4byte _0803EA4C - .4byte _0803EAE0 - .4byte _0803EBB0 -_0803EA4C: - ldr r5, =0x02024332 - movs r0, 0 - strb r0, [r5, 0x5] - ldr r2, =0x0202420b - ldrb r0, [r2] - lsrs r0, 1 - ldr r1, [r7] - adds r0, r1 - adds r0, 0xC6 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - mov r8, r2 - cmp r0, 0 - beq _0803EA98 - movs r0, 0x3E - ands r0, r1 - ldr r1, =0x02024214 - mov r9, r1 - ldr r6, =gUnknown_082DBD3C - ldr r2, =0x02024083 - mov r10, r2 - cmp r0, 0 - bne _0803EA7E - b _0803EBDE -_0803EA7E: - movs r0, 0x5 - strb r0, [r5, 0x5] - b _0803EBDE - .pool -_0803EA98: - ldr r0, =0x02024214 - mov r9, r0 - ldr r6, =gUnknown_082DBD3C - ldr r1, =0x02024083 - mov r10, r1 - mov r4, r8 - adds r3, r7, 0 - adds r2, r5, 0 -_0803EAA8: - ldrb r1, [r4] - lsrs r1, 1 - ldr r0, [r3] - adds r1, r0 - adds r1, 0xC6 - ldrb r0, [r1] - lsrs r0, 1 - strb r0, [r1] - ldrb r0, [r2, 0x5] - adds r0, 0x1 - strb r0, [r2, 0x5] - ldrb r0, [r4] - lsrs r0, 1 - ldr r1, [r3] - adds r0, r1 - adds r0, 0xC6 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0803EAA8 - b _0803EBDE - .pool -_0803EAE0: - ldr r3, =0x02024332 - movs r0, 0x4 - strb r0, [r3, 0x5] - ldr r2, =0x0202420b - ldrb r0, [r2] - lsrs r0, 1 - ldr r1, [r7] - adds r0, r1 - adds r6, r0, 0 - adds r6, 0xC6 - ldrb r1, [r6] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - mov r8, r2 - cmp r5, 0 - beq _0803EB28 - movs r0, 0x5 - strb r0, [r3, 0x5] - ldr r2, =0x02024214 - mov r9, r2 - ldr r6, =gUnknown_082DBD3C - ldr r0, =0x02024083 - mov r10, r0 - b _0803EBDE - .pool -_0803EB28: - ldr r3, =0x02022f58 - movs r4, 0xFD - strb r4, [r3] - movs r0, 0x5 - strb r0, [r3, 0x1] - movs r2, 0x1 - strb r2, [r3, 0x2] - movs r0, 0xFF - strb r0, [r3, 0x3] - ldr r1, =0x02022f68 - strb r4, [r1] - strb r5, [r1, 0x1] - movs r0, 0xD2 - strb r0, [r1, 0x2] - strb r5, [r1, 0x3] - subs r0, 0xD3 - strb r0, [r1, 0x4] - ldrb r0, [r6] - ands r2, r0 - ldr r1, =0x02024214 - mov r9, r1 - ldr r6, =gUnknown_082DBD3C - ldr r0, =0x02024083 - mov r10, r0 - cmp r2, 0 - bne _0803EB8C - mov r5, r8 - adds r4, r7, 0 - adds r2, r3, 0 -_0803EB62: - ldrb r1, [r5] - lsrs r1, 1 - ldr r0, [r4] - adds r1, r0 - adds r1, 0xC6 - ldrb r0, [r1] - lsrs r0, 1 - strb r0, [r1] - ldrb r0, [r2, 0x2] - adds r0, 0x1 - strb r0, [r2, 0x2] - ldrb r0, [r5] - lsrs r0, 1 - ldr r1, [r4] - adds r0, r1 - adds r0, 0xC6 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0803EB62 -_0803EB8C: - ldrb r0, [r3, 0x2] - adds r0, 0xE - movs r1, 0 - mov r2, r12 - strb r0, [r2, 0x10] - strb r1, [r2, 0x11] - b _0803EBDE - .pool -_0803EBB0: - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x1 - ands r1, r0 - cmp r1, 0 - beq _0803EBCC - ldr r1, =0x02024332 - movs r0, 0x2 - strb r0, [r1, 0x5] - b _0803EBD0 - .pool -_0803EBCC: - ldr r0, =0x02024332 - strb r1, [r0, 0x5] -_0803EBD0: - ldr r0, =0x0202420b - mov r8, r0 - ldr r1, =0x02024214 - mov r9, r1 - ldr r6, =gUnknown_082DBD3C - ldr r2, =0x02024083 - mov r10, r2 -_0803EBDE: - mov r1, r8 - ldrb r0, [r1] - lsrs r0, 1 - ldr r1, [r7] - adds r0, r1 - adds r0, 0xC4 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - mov r2, r9 - str r0, [r2] -_0803EBF6: - movs r0, 0xA - mov r1, r10 - strb r0, [r1] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803E90C - - thumb_func_start sub_803EC20 -sub_803EC20: @ 803EC20 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r5, r0, 24 - movs r7, 0 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r5 - adds r1, r0, r1 - ldrh r0, [r1, 0x2E] - cmp r0, 0xAF - bne _0803EC54 - ldr r1, =0x02024404 - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x7] - b _0803EC5E - .pool -_0803EC54: - ldrh r0, [r1, 0x2E] - bl itemid_get_x12 - lsls r0, 24 - lsrs r1, r0, 24 -_0803EC5E: - ldr r0, =0x0202420f - strb r5, [r0] - cmp r1, 0x25 - bne _0803EC9C - ldr r2, =0x02024208 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r5 - adds r0, r1 - ldrh r0, [r0, 0x2E] - strh r0, [r2] - ldr r0, =0x0202433c - lsls r2, r5, 4 - adds r2, r0 - ldrb r1, [r2, 0x1] - movs r0, 0x19 - negs r0, r0 - ands r0, r1 - movs r1, 0x8 - orrs r0, r1 - strb r0, [r2, 0x1] - b _0803ED70 - .pool -_0803EC9C: - ldr r0, =0x02024084 - mov r10, r0 - movs r2, 0x58 - mov r9, r2 - mov r0, r9 - muls r0, r5 - add r0, r10 - mov r8, r0 - adds r0, 0x20 - ldrb r6, [r0] - cmp r6, 0x32 - bne _0803ED5C - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _0803ED38 - ldr r4, =0x0202449c - ldr r1, [r4] - adds r1, 0x6C - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - bl sub_81A9E28 - lsls r0, 24 - lsrs r1, r0, 24 - mov r2, r8 - ldrh r0, [r2, 0x6] - muls r0, r1 - movs r2, 0x1 - adds r1, r5, 0 - eors r1, r2 - mov r2, r9 - muls r2, r1 - adds r1, r2, 0 - add r1, r10 - ldrh r1, [r1, 0x6] - bl __divsi3 - ldr r1, [r4] - adds r1, 0x6C - ldrb r2, [r1] - lsls r1, r2, 4 - subs r1, r2 - lsls r1, 1 - adds r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - bl GenerateRandomNumber - movs r1, 0xFF - ands r1, r0 - cmp r4, r1 - bhi _0803ED0C - b _0803EE12 -_0803ED0C: - ldr r0, =0x0202420a - strb r6, [r0] - ldr r0, =0x0202433c - lsls r2, r5, 4 - adds r2, r0 - ldrb r1, [r2, 0x1] - movs r0, 0x19 - negs r0, r0 - ands r0, r1 - movs r1, 0x10 - orrs r0, r1 - strb r0, [r2, 0x1] - b _0803ED70 - .pool -_0803ED38: - ldr r0, =0x0202420a - strb r6, [r0] - ldr r0, =0x0202433c - lsls r2, r5, 4 - adds r2, r0 - ldrb r1, [r2, 0x1] - movs r0, 0x19 - negs r0, r0 - ands r0, r1 - movs r1, 0x10 - orrs r0, r1 - strb r0, [r2, 0x1] - b _0803ED70 - .pool -_0803ED5C: - ldr r1, =0x02022fec - ldr r2, [r1] - ldr r0, =0x043f0100 - ands r0, r2 - cmp r0, 0 - beq _0803ED80 - movs r0, 0x8 - ands r2, r0 - cmp r2, 0 - beq _0803ED80 -_0803ED70: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - b _0803EE12 - .pool -_0803ED80: - ldr r0, [r1] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0803EE06 - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _0803EDBC - bl sub_81A9E28 - lsls r0, 24 - lsrs r1, r0, 24 - ldr r4, =0x02024084 - movs r3, 0x58 - adds r0, r5, 0 - muls r0, r3 - adds r0, r4 - ldrh r0, [r0, 0x6] - muls r0, r1 - movs r2, 0x1 - adds r1, r5, 0 - eors r1, r2 - muls r1, r3 - adds r1, r4 - b _0803EDDA - .pool -_0803EDBC: - ldr r3, =0x02024084 - movs r2, 0x58 - adds r0, r5, 0 - muls r0, r2 - adds r4, r0, r3 - movs r1, 0x1 - adds r0, r5, 0 - eors r0, r1 - muls r0, r2 - adds r1, r0, r3 - ldrh r0, [r4, 0x6] - ldrh r2, [r1, 0x6] - cmp r0, r2 - bcs _0803EE00 - lsls r0, 7 -_0803EDDA: - ldrh r1, [r1, 0x6] - bl __divsi3 - ldr r1, =0x0202449c - ldr r1, [r1] - adds r1, 0x6C - ldrb r2, [r1] - lsls r1, r2, 4 - subs r1, r2 - lsls r1, 1 - adds r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - bl GenerateRandomNumber - movs r1, 0xFF - ands r1, r0 - cmp r4, r1 - bls _0803EE06 -_0803EE00: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 -_0803EE06: - ldr r0, =0x0202449c - ldr r1, [r0] - adds r1, 0x6C - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_0803EE12: - cmp r7, 0 - beq _0803EE24 - ldr r1, =0x02024082 - ldr r0, =0x0202406c - ldrb r0, [r0] - strb r0, [r1] - ldr r1, =0x0202433a - movs r0, 0x4 - strb r0, [r1] -_0803EE24: - adds r0, r7, 0 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_803EC20 - - thumb_func_start sub_803EE48 -sub_803EE48: @ 803EE48 - push {r4-r6,lr} - ldr r4, =0x0202420b - ldr r1, =0x0202407e - ldr r5, =0x02024082 - ldrb r0, [r5] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r4] - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x02000002 - ands r0, r1 - cmp r0, 0 - beq _0803EF0C - ldr r0, =0x0202406c - ldrb r1, [r0] - strb r1, [r5] - ldr r2, =0x02024064 - movs r0, 0 - strb r0, [r2] - lsls r1, 24 - cmp r1, 0 - beq _0803EEE0 - adds r4, r2, 0 - ldr r6, =0x0202421c - ldr r5, =0x0202433a -_0803EE7C: - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0803EEBC - ldrb r0, [r4] - adds r0, r6 - ldrb r0, [r0] - cmp r0, 0x3 - bne _0803EECE - ldrb r0, [r5] - movs r1, 0x2 - b _0803EECA - .pool -_0803EEBC: - ldrb r0, [r4] - adds r0, r6 - ldrb r0, [r0] - cmp r0, 0x3 - bne _0803EECE - ldrb r0, [r5] - movs r1, 0x1 -_0803EECA: - orrs r0, r1 - strb r0, [r5] -_0803EECE: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bcc _0803EE7C -_0803EEE0: - ldr r2, =0x0202433a - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - ldr r0, =0x03005d90 - ldr r1, [r0] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x8 - orrs r0, r2 - b _0803EF96 - .pool -_0803EF0C: - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0803EF4C - ldrb r0, [r4] - bl sub_803EC20 - lsls r0, 24 - cmp r0, 0 - bne _0803EF98 - ldrb r0, [r4] - bl sub_8045868 - ldr r1, =0x02024332 - movs r0, 0x3 - strb r0, [r1, 0x5] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAB02 - str r0, [r1] - ldr r1, =0x02024083 - movs r0, 0xA - b _0803EF96 - .pool -_0803EF4C: - ldr r1, =0x02024084 - ldrb r2, [r4] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x0400e000 - ands r0, r1 - cmp r0, 0 - beq _0803EF8C - ldr r1, =0x02024332 - movs r0, 0x4 - strb r0, [r1, 0x5] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAB02 - str r0, [r1] - ldr r1, =0x02024083 - movs r0, 0xA - b _0803EF96 - .pool -_0803EF8C: - ldr r0, =0x0202406c - ldrb r0, [r0] - strb r0, [r5] - ldr r1, =0x0202433a - movs r0, 0x6 -_0803EF96: - strb r0, [r1] -_0803EF98: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803EE48 - - thumb_func_start sub_803EFA8 -sub_803EFA8: @ 803EFA8 - ldr r2, =0x0202420b - ldr r1, =0x0202407e - ldr r0, =0x02024082 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DBD58 - ldr r0, [r0] - str r0, [r1] - ldr r1, =0x02024083 - movs r0, 0xA - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_803EFA8 - - thumb_func_start bs5_8016AC0 -bs5_8016AC0: @ 803EFF0 - ldr r2, =0x0202420b - ldr r1, =0x0202407e - ldr r0, =0x02024082 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r1, =0x0203a04c - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - ldr r1, =0x02024208 - movs r0, 0x5 - strh r0, [r1] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DBD08 - ldr r0, [r0, 0x14] - str r0, [r1] - ldr r1, =0x02024083 - movs r0, 0xA - strb r0, [r1] - bx lr - .pool - thumb_func_end bs5_8016AC0 - - thumb_func_start sub_803F050 -sub_803F050: @ 803F050 - push {r4-r6,lr} - ldr r3, =0x0202420b - ldr r1, =0x0202407e - ldr r0, =0x02024082 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r3] - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r6, =0x02024332 - ldr r2, =0x02023864 - ldrb r0, [r3] - lsls r0, 9 - adds r1, r2, 0x1 - adds r0, r1 - ldrb r0, [r0] - subs r0, 0x1 - strb r0, [r6, 0x5] - ldr r1, =0x02024208 - ldrb r0, [r3] - lsls r0, 9 - adds r2, 0x2 - adds r0, r2 - ldrb r0, [r0] - strh r0, [r1] - ldr r1, =0x03005d10 - ldrb r0, [r1, 0x1F] - cmp r0, 0xFE - bhi _0803F096 - adds r0, 0x1 - strb r0, [r1, 0x1F] -_0803F096: - ldr r2, =0x0202449c - ldr r0, [r2] - adds r1, r0, 0 - adds r1, 0x7A - ldrb r0, [r1] - cmp r0, 0x2 - bhi _0803F0A8 - adds r0, 0x1 - strb r0, [r1] -_0803F0A8: - ldr r0, [r2] - adds r3, r0, 0 - adds r3, 0x7B - ldrb r5, [r3] - adds r4, r5, 0 - cmp r4, 0x1 - bls _0803F100 - ldr r2, =gUnknown_0831BCE0 - adds r0, 0x7A - ldrb r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - ldrb r6, [r6, 0x5] - adds r0, r6 - adds r0, r2 - ldrb r0, [r0] - cmp r4, r0 - bcs _0803F0FC - movs r0, 0x1 - b _0803F0FE - .pool -_0803F0FC: - subs r0, r5, r0 -_0803F0FE: - strb r0, [r3] -_0803F100: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DBD58 - ldr r0, [r0, 0x8] - str r0, [r1] - ldr r1, =0x02024083 - movs r0, 0xA - strb r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803F050 - - thumb_func_start sub_803F120 -sub_803F120: @ 803F120 - push {r4,lr} - ldr r2, =0x0202420b - ldr r1, =0x0202407e - ldr r0, =0x02024082 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - ldr r0, =0x02022e14 - movs r4, 0 - strh r4, [r0] - ldr r0, =0x02022e16 - strh r4, [r0] - ldr r3, =0x0202449c - ldr r0, [r3] - adds r2, r0, 0 - adds r2, 0x7C - ldr r1, =gUnknown_0831BCEF - adds r0, 0x79 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - ldrb r1, [r2] - adds r0, r1 - strb r0, [r2] - ldr r0, [r3] - adds r1, r0, 0 - adds r1, 0x7C - ldrb r0, [r1] - cmp r0, 0x14 - bls _0803F162 - movs r0, 0x14 - strb r0, [r1] -_0803F162: - ldr r0, [r3] - adds r2, r0, 0 - adds r2, 0x7B - ldr r1, =gUnknown_0831BCF3 - adds r0, 0x79 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - ldrb r1, [r2] - adds r0, r1 - strb r0, [r2] - ldr r0, [r3] - adds r1, r0, 0 - adds r1, 0x7B - ldrb r0, [r1] - cmp r0, 0x14 - bls _0803F188 - movs r0, 0x14 - strb r0, [r1] -_0803F188: - ldr r0, [r3] - adds r1, r0, 0 - adds r1, 0x79 - ldrb r0, [r1] - cmp r0, 0x2 - bhi _0803F1C4 - adds r0, 0x1 - strb r0, [r1] - ldr r0, =0x02024332 - strb r4, [r0, 0x5] - b _0803F1CA - .pool -_0803F1C4: - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] -_0803F1CA: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DBD58 - ldr r0, [r0, 0x4] - str r0, [r1] - ldr r1, =0x02024083 - movs r0, 0xA - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803F120 - - thumb_func_start bs8_exit_by_flight -bs8_exit_by_flight: @ 803F1F0 - push {r4,lr} - ldr r2, =0x0202420b - ldr r1, =0x0202407e - ldr r4, =0x02024082 - ldrb r0, [r4] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - movs r0, 0x11 - bl audio_play - ldr r0, =0x0202406c - ldrb r0, [r0] - strb r0, [r4] - ldr r1, =0x0202433a - movs r0, 0x4 - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end bs8_exit_by_flight - - thumb_func_start bs9_8016C9C -bs9_8016C9C: @ 803F22C - ldr r3, =0x0202420b - ldr r1, =0x0202407e - ldr r0, =0x02024082 - ldrb r0, [r0] - adds r0, r1 - ldrb r2, [r0] - strb r2, [r3] - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x7 - strb r0, [r1, 0x1] - strb r2, [r1, 0x2] - ldr r2, =0x0202406e - ldrb r0, [r3] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DBD58 - ldr r0, [r0, 0xC] - str r0, [r1] - ldr r1, =0x02024083 - movs r0, 0xA - strb r0, [r1] - ldr r1, =0x0202407a - movs r0, 0xC - strb r0, [r1, 0x1] - bx lr - .pool - thumb_func_end bs9_8016C9C - - thumb_func_start bsB_exit_by_move -bsB_exit_by_move: @ 803F2A4 - push {lr} - bl sub_8041728 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _0803F2C0 - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x4D - strb r1, [r0] - ldr r1, =0x02024083 - movs r0, 0xC - strb r0, [r1] -_0803F2C0: - pop {r0} - bx r0 - .pool - thumb_func_end bsB_exit_by_move - - thumb_func_start bsD_proceed -bsD_proceed: @ 803F2CC - ldr r1, =0x02024082 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r3, =0x02024083 - ldr r2, =0x0202407a - ldrb r0, [r1] - adds r0, r2 - ldrb r0, [r0] - strb r0, [r3] - ldr r2, =0x02024280 - ldr r0, [r2] - ldr r1, =0xf1e892af - ands r0, r1 - str r0, [r2] - bx lr - .pool - thumb_func_end bsD_proceed - - thumb_func_start bsC_8016D70 -bsC_8016D70: @ 803F300 - push {r4-r6,lr} - ldr r1, =0x0202407e - ldr r2, =0x02024082 - ldrb r0, [r2] - adds r0, r1 - ldrb r0, [r0] - ldr r6, =0x0202449c - ldr r1, [r6] - adds r0, r1 - adds r0, 0x5C - movs r1, 0x6 - strb r1, [r0] - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - ldr r3, =0x02024083 - ldr r1, =0x0202407a - ldrb r0, [r2] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r3] - bl sub_803D6A0 - ldr r2, =0x02024280 - ldr r0, [r2] - ldr r1, =0xf1e892af - ands r0, r1 - str r0, [r2] - ldr r0, =0x020241ea - movs r1, 0 - strh r1, [r0] - ldr r0, =0x020241f0 - movs r4, 0 - str r4, [r0] - ldr r0, =0x0202427c - strb r1, [r0] - ldr r5, =0x02024474 - strb r1, [r5, 0x18] - strb r1, [r5, 0x19] - ldr r2, =0x02024250 - ldr r3, =0x0202420b - ldrb r0, [r3] - lsls r0, 1 - adds r0, r2 - strh r4, [r0] - ldr r2, =0x02024258 - ldrb r0, [r3] - lsls r0, 1 - adds r0, r2 - strh r4, [r0] - ldr r0, [r6] - strb r1, [r0, 0x13] - ldr r0, =0x02024400 - strh r4, [r0] - strb r1, [r5, 0x14] - ldr r0, =0x02024332 - strb r1, [r0, 0x3] - strb r1, [r0, 0x4] - strb r1, [r5, 0x16] - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r0, [r0, 0x8] - adds r0, 0x20 - strb r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end bsC_8016D70 - - thumb_func_start get_battle_side_of_something -get_battle_side_of_something: @ 803F3CC - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - movs r0, 0 - cmp r1, 0xE - bhi _0803F47A - lsls r0, r1, 2 - ldr r1, =_0803F3E8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0803F3E8: - .4byte _0803F424 - .4byte _0803F430 - .4byte _0803F43C - .4byte _0803F458 - .4byte _0803F464 - .4byte _0803F458 - .4byte _0803F464 - .4byte _0803F448 - .4byte _0803F464 - .4byte _0803F464 - .4byte _0803F44C - .4byte _0803F464 - .4byte _0803F468 - .4byte _0803F46C - .4byte _0803F470 -_0803F424: - ldr r0, =0x0202420c - ldrb r0, [r0] - b _0803F47A - .pool -_0803F430: - ldr r0, =0x0202420b - ldrb r0, [r0] - b _0803F47A - .pool -_0803F43C: - ldr r0, =0x0202420e - ldrb r0, [r0] - b _0803F47A - .pool -_0803F448: - movs r0, 0 - b _0803F47A -_0803F44C: - ldr r0, =0x02024474 - ldrb r0, [r0, 0x17] - b _0803F47A - .pool -_0803F458: - ldr r0, =0x0202420d - ldrb r0, [r0] - b _0803F47A - .pool -_0803F464: - movs r0, 0 - b _0803F472 -_0803F468: - movs r0, 0x1 - b _0803F472 -_0803F46C: - movs r0, 0x2 - b _0803F472 -_0803F470: - movs r0, 0x3 -_0803F472: - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 -_0803F47A: - pop {r1} - bx r1 - thumb_func_end get_battle_side_of_something - - thumb_func_start sub_803F480 -sub_803F480: @ 803F480 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r2, 16 - lsrs r2, 16 - ldr r1, =0x02024084 - movs r4, 0x58 - muls r0, r4 - adds r0, r1 - adds r0, 0x20 - ldrb r0, [r0] - mov r12, r1 - cmp r0, 0x2E - bne _0803F532 - movs r3, 0 - adds r0, r5, 0 - muls r0, r4 - adds r1, 0xC - adds r1, r0, r1 - b _0803F4BC - .pool -_0803F4B4: - adds r1, 0x2 - adds r3, 0x1 - cmp r3, 0x3 - bgt _0803F4C2 -_0803F4BC: - ldrh r0, [r1] - cmp r0, r2 - bne _0803F4B4 -_0803F4C2: - cmp r3, 0x4 - beq _0803F532 - movs r7, 0x58 - adds r2, r5, 0 - muls r2, r7 - adds r0, r3, r2 - mov r6, r12 - adds r6, 0x24 - adds r1, r0, r6 - ldrb r0, [r1] - cmp r0, 0 - beq _0803F4DE - subs r0, 0x1 - strb r0, [r1] -_0803F4DE: - mov r0, r12 - adds r0, 0x50 - adds r0, r2, r0 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 14 - ands r0, r1 - cmp r0, 0 - bne _0803F532 - ldr r1, =0x020242bc - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x18] - lsrs r1, 4 - ldr r2, =gUnknown_0832A328 - lsls r0, r3, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0803F532 - ldr r4, =0x02024064 - strb r5, [r4] - adds r1, r3, 0 - adds r1, 0x9 - lsls r1, 24 - lsrs r1, 24 - ldrb r0, [r4] - muls r0, r7 - adds r0, r6 - adds r0, r3 - str r0, [sp] - movs r0, 0 - movs r2, 0 - movs r3, 0x1 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0803F532: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803F480 - - thumb_func_start sub_803F548 -sub_803F548: @ 803F548 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0x4 - mov r8, r0 - adds r0, r5, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r4, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - bge _0803F5F0 - ldr r1, =0x02024084 - movs r0, 0x58 - adds r7, r5, 0 - muls r7, r0 - adds r1, 0xC - mov r10, r1 -_0803F57E: - lsls r0, r4, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - adds r6, r4, 0x1 - cmp r9, r0 - beq _0803F5E6 - ldr r0, =0x02024084 - movs r3, 0x58 - adds r1, r4, 0 - muls r1, r3 - adds r1, r0 - adds r1, 0x20 - ldrb r1, [r1] - adds r4, r0, 0 - cmp r1, 0x2E - bne _0803F5E6 - movs r2, 0 - adds r0, r5, 0 - muls r0, r3 - adds r1, r4, 0 - adds r1, 0xC - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x8F - lsls r1, 1 - cmp r0, r1 - beq _0803F5CE - adds r3, r1, 0 - mov r0, r10 - adds r1, r7, r0 -_0803F5C0: - adds r1, 0x2 - adds r2, 0x1 - cmp r2, 0x3 - bgt _0803F5CE - ldrh r0, [r1] - cmp r0, r3 - bne _0803F5C0 -_0803F5CE: - cmp r2, 0x4 - beq _0803F5E6 - mov r8, r2 - adds r1, r2, r7 - adds r0, r4, 0 - adds r0, 0x24 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0 - beq _0803F5E6 - subs r0, 0x1 - strb r0, [r1] -_0803F5E6: - adds r4, r6, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _0803F57E -_0803F5F0: - mov r1, r8 - cmp r1, 0x4 - beq _0803F658 - ldr r6, =0x02024084 - movs r3, 0x58 - adds r0, r5, 0 - muls r0, r3 - adds r1, r6, 0 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 14 - ands r0, r1 - cmp r0, 0 - bne _0803F658 - ldr r1, =0x020242bc - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x18] - lsrs r1, 4 - ldr r2, =gUnknown_0832A328 - mov r4, r8 - lsls r0, r4, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0803F658 - ldr r4, =0x02024064 - strb r5, [r4] - mov r1, r8 - adds r1, 0x9 - lsls r1, 24 - lsrs r1, 24 - ldrb r0, [r4] - muls r0, r3 - adds r2, r6, 0 - adds r2, 0x24 - adds r0, r2 - add r0, r8 - str r0, [sp] - movs r0, 0 - movs r2, 0 - movs r3, 0x1 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0803F658: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803F548 - - thumb_func_start sub_803F67C -sub_803F67C: @ 803F67C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r3, r0, 24 - movs r6, 0x4 - movs r1, 0 - ldr r0, =0x0202406c - mov r8, r0 - ldrb r0, [r0] - cmp r1, r0 - bge _0803F6FE - ldr r7, =0x02024084 - movs r2, 0x58 - mov r12, r2 - mov r5, r12 - muls r5, r3 - adds r0, r7, 0 - adds r0, 0xC - adds r2, r5, r0 - mov r10, r2 - mov r9, r5 -_0803F6AE: - mov r0, r12 - muls r0, r1 - adds r0, r7 - adds r0, 0x20 - ldrb r0, [r0] - adds r4, r1, 0x1 - cmp r0, 0x2E - bne _0803F6F4 - cmp r1, r3 - beq _0803F6F4 - movs r2, 0 - mov r1, r10 - ldrh r0, [r1] - cmp r0, 0xC3 - beq _0803F6DE - ldr r1, =0x02024090 - add r1, r9 -_0803F6D0: - adds r1, 0x2 - adds r2, 0x1 - cmp r2, 0x3 - bgt _0803F6DE - ldrh r0, [r1] - cmp r0, 0xC3 - bne _0803F6D0 -_0803F6DE: - cmp r2, 0x4 - beq _0803F6F4 - adds r6, r2, 0 - adds r0, r6, r5 - ldr r2, =0x020240a8 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0 - beq _0803F6F4 - subs r0, 0x1 - strb r0, [r1] -_0803F6F4: - adds r1, r4, 0 - mov r0, r8 - ldrb r0, [r0] - cmp r1, r0 - blt _0803F6AE -_0803F6FE: - cmp r6, 0x4 - beq _0803F762 - ldr r7, =0x02024084 - movs r5, 0x58 - adds r0, r3, 0 - muls r0, r5 - adds r1, r7, 0 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 14 - ands r0, r1 - cmp r0, 0 - bne _0803F762 - ldr r1, =0x020242bc - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x18] - lsrs r1, 4 - ldr r2, =gUnknown_0832A328 - lsls r0, r6, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0803F762 - ldr r4, =0x02024064 - strb r3, [r4] - adds r1, r6, 0 - adds r1, 0x9 - lsls r1, 24 - lsrs r1, 24 - ldrb r0, [r4] - muls r0, r5 - adds r2, r7, 0 - adds r2, 0x24 - adds r0, r2 - adds r0, r6 - str r0, [sp] - movs r0, 0 - movs r2, 0 - movs r3, 0x1 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0803F762: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803F67C - - thumb_func_start sub_803F790 -sub_803F790: @ 803F790 - push {r4,r5,lr} - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0803F7D0 - movs r2, 0 - ldr r4, =0x0202406c - ldrb r0, [r4] - cmp r2, r0 - bge _0803F7EE - ldr r3, =0x02024068 - ldr r5, =gUnknown_0832A328 -_0803F7AC: - ldm r5!, {r1} - lsls r1, 28 - ldr r0, [r3] - orrs r0, r1 - str r0, [r3] - adds r2, 0x1 - ldrb r0, [r4] - cmp r2, r0 - blt _0803F7AC - b _0803F7EE - .pool -_0803F7D0: - movs r2, 0 - ldr r4, =0x0202406c - ldrb r0, [r4] - cmp r2, r0 - bge _0803F7EE - ldr r3, =0x02024068 - ldr r5, =gUnknown_0832A328 -_0803F7DE: - ldr r0, [r3] - ldm r5!, {r1} - orrs r0, r1 - str r0, [r3] - adds r2, 0x1 - ldrb r0, [r4] - cmp r2, r0 - blt _0803F7DE -_0803F7EE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803F790 - - thumb_func_start dp01_battle_side_mark_buffer_for_execution -dp01_battle_side_mark_buffer_for_execution: @ 803F800 - push {lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0803F834 - ldr r2, =0x02024068 - ldr r1, =gUnknown_0832A328 - lsls r0, r3, 2 - adds r0, r1 - ldr r1, [r0] - lsls r1, 28 - ldr r0, [r2] - orrs r0, r1 - str r0, [r2] - b _0803F844 - .pool -_0803F834: - ldr r2, =0x02024068 - ldr r1, =gUnknown_0832A328 - lsls r0, r3, 2 - adds r0, r1 - ldr r1, [r2] - ldr r0, [r0] - orrs r1, r0 - str r1, [r2] -_0803F844: - pop {r0} - bx r0 - .pool - thumb_func_end dp01_battle_side_mark_buffer_for_execution - - thumb_func_start sub_803F850 -sub_803F850: @ 803F850 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - movs r4, 0 - ldr r5, =0x02024068 - ldr r1, =gUnknown_0832A328 - lsls r0, r7, 2 - adds r6, r0, r1 - b _0803F87A - .pool -_0803F86C: - lsls r0, r4, 2 - ldr r1, [r6] - lsls r1, r0 - ldr r0, [r5] - orrs r0, r1 - str r0, [r5] - adds r4, 0x1 -_0803F87A: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - blt _0803F86C - ldr r2, =0x02024068 - movs r1, 0x80 - lsls r1, 21 - lsls r1, r7 - ldr r0, [r2] - bics r0, r1 - str r0, [r2] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803F850 - - thumb_func_start b_cancel_multi_turn_move_maybe -b_cancel_multi_turn_move_maybe: @ 803F8A0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02024084 - movs r2, 0x58 - adds r3, r0, 0 - muls r3, r2 - adds r1, 0x50 - adds r3, r1 - ldr r1, [r3] - ldr r2, =0xffffefff - ands r1, r2 - ldr r2, =0xfffff3ff - ands r1, r2 - movs r2, 0x71 - negs r2, r2 - ands r1, r2 - ldr r2, =0xfffffcff - ands r1, r2 - str r1, [r3] - ldr r1, =0x020242ac - lsls r2, r0, 2 - adds r2, r1 - ldr r1, [r2] - ldr r3, =0xfffbff3f - ands r1, r3 - str r1, [r2] - ldr r2, =0x020242bc - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r2, [r1, 0x11] - movs r0, 0x10 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x11] - movs r0, 0 - strb r0, [r1, 0x10] - bx lr - .pool - thumb_func_end b_cancel_multi_turn_move_maybe - - thumb_func_start sub_803F90C -sub_803F90C: @ 803F90C - push {lr} - lsls r0, 24 - ldr r1, =0x0202433c - lsrs r0, 20 - adds r1, r0, r1 - ldrb r0, [r1] - lsrs r0, 7 - cmp r0, 0 - bne _0803F952 - ldrb r2, [r1, 0x1] - lsls r0, r2, 30 - cmp r0, 0 - blt _0803F952 - lsls r0, r2, 26 - cmp r0, 0 - blt _0803F952 - lsls r0, r2, 25 - cmp r0, 0 - blt _0803F952 - lsrs r0, r2, 7 - cmp r0, 0 - bne _0803F952 - ldrb r1, [r1, 0x2] - lsls r0, r1, 31 - cmp r0, 0 - bne _0803F952 - lsls r0, r1, 30 - cmp r0, 0 - blt _0803F952 - lsls r0, r1, 29 - cmp r0, 0 - blt _0803F952 - lsls r0, r2, 31 - cmp r0, 0 - beq _0803F95C -_0803F952: - movs r0, 0x1 - b _0803F95E - .pool -_0803F95C: - movs r0, 0 -_0803F95E: - pop {r1} - bx r1 - thumb_func_end sub_803F90C - - thumb_func_start b_std_message -b_std_message: @ 803F964 - push {r4,lr} - adds r2, r0, 0 - lsls r2, 16 - lsrs r2, 16 - ldr r4, =0x02024064 - strb r1, [r4] - movs r0, 0 - adds r1, r2, 0 - bl dp01_build_cmdbuf_x10_TODO - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end b_std_message - - thumb_func_start sub_803F988 -sub_803F988: @ 803F988 - push {r4-r6,lr} - movs r3, 0 - ldr r0, =0x020243fe - strb r3, [r0] - strb r3, [r0, 0x1] - movs r1, 0 - ldr r0, =0x0202406c - ldrb r2, [r0] - adds r6, r0, 0 - cmp r1, r2 - bge _0803F9B6 - ldr r5, =gUnknown_0832A328 - adds r4, r2, 0 - ldr r2, =0x0202406e -_0803F9A4: - ldrh r0, [r2] - lsls r0, 2 - adds r0, r5 - ldr r0, [r0] - orrs r3, r0 - adds r2, 0x4 - adds r1, 0x2 - cmp r1, r4 - blt _0803F9A4 -_0803F9B6: - movs r1, 0x1 - adds r2, r6, 0 - ldrb r0, [r2] - cmp r1, r0 - bge _0803F9D6 - ldr r5, =0x020243fe - movs r4, 0x2 -_0803F9C4: - adds r0, r1, 0 - ands r0, r4 - asrs r0, 1 - adds r0, r5 - strb r3, [r0] - adds r1, 0x2 - ldrb r0, [r2] - cmp r1, r0 - blt _0803F9C4 -_0803F9D6: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803F988 - - thumb_func_start sub_803F9EC -sub_803F9EC: @ 803F9EC - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - adds r0, r5, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0803FA50 - movs r0, 0x2 - ands r0, r5 - lsls r0, 24 - lsrs r0, 25 - mov r12, r0 - ldr r1, =0x020243fe - adds r0, r1 - strb r4, [r0] - adds r5, r4, 0 - ldr r0, =0x0202406c - ldrb r2, [r0] - mov r8, r1 - cmp r4, r2 - bge _0803FA4A - ldr r0, =0x02024210 - ldrb r7, [r0] - ldr r1, =gUnknown_0832A328 - adds r6, r2, 0 - ldr r3, =0x0202406e - adds r2, r1, 0 -_0803FA2E: - ldr r0, [r2] - ands r0, r7 - cmp r0, 0 - bne _0803FA40 - ldrh r0, [r3] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - orrs r4, r0 -_0803FA40: - adds r3, 0x4 - adds r2, 0x8 - adds r5, 0x2 - cmp r5, r6 - blt _0803FA2E -_0803FA4A: - mov r0, r12 - add r0, r8 - strb r4, [r0] -_0803FA50: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803F9EC - - thumb_func_start sub_803FA70 -sub_803FA70: @ 803FA70 - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0803FA8C - adds r0, r4, 0 - bl sub_803F9EC - b _0803FAC2 -_0803FA8C: - movs r3, 0x1 - ldr r5, =0x0202406c - ldrb r0, [r5] - cmp r3, r0 - bge _0803FAC2 - ldr r0, =0x020243fe - mov r12, r0 - movs r7, 0x2 - ldr r6, =gUnknown_0832A328 - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r4, r0, r1 -_0803FAA4: - adds r2, r3, 0 - ands r2, r7 - asrs r2, 1 - add r2, r12 - ldrh r0, [r4] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - adds r3, 0x1 - ldrb r0, [r5] - cmp r3, r0 - blt _0803FAA4 -_0803FAC2: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803FA70 - - thumb_func_start b_movescr_stack_push -b_movescr_stack_push: @ 803FAD8 - push {r4,lr} - ldr r1, =0x020244a8 - ldr r1, [r1] - ldr r3, [r1, 0x8] - adds r4, r3, 0 - adds r4, 0x20 - ldrb r1, [r4] - adds r2, r1, 0x1 - strb r2, [r4] - lsls r1, 24 - lsrs r1, 22 - adds r3, r1 - str r0, [r3] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end b_movescr_stack_push - - thumb_func_start b_movescr_stack_push_cursor -b_movescr_stack_push_cursor: @ 803FAFC - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r2, [r0, 0x8] - adds r3, r2, 0 - adds r3, 0x20 - ldrb r0, [r3] - adds r1, r0, 0x1 - strb r1, [r3] - lsls r0, 24 - lsrs r0, 22 - adds r2, r0 - ldr r0, =0x02024214 - ldr r0, [r0] - str r0, [r2] - bx lr - .pool - thumb_func_end b_movescr_stack_push_cursor - - thumb_func_start b_movescr_stack_pop_cursor -b_movescr_stack_pop_cursor: @ 803FB24 - ldr r3, =0x02024214 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r1, [r0, 0x8] - adds r2, r1, 0 - adds r2, 0x20 - ldrb r0, [r2] - subs r0, 0x1 - strb r0, [r2] - lsls r0, 24 - lsrs r0, 22 - adds r1, r0 - ldr r0, [r1] - str r0, [r3] - bx lr - .pool - thumb_func_end b_movescr_stack_pop_cursor - - thumb_func_start sub_803FB4C -sub_803FB4C: @ 803FB4C - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r6, 0 - ldr r2, =0x02024084 - ldr r1, =0x02023864 - ldr r3, =0x02024064 - ldrb r4, [r3] - lsls r0, r4, 9 - adds r1, 0x2 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 1 - movs r1, 0x58 - muls r1, r4 - adds r0, r1 - adds r2, 0xC - adds r0, r2 - ldrh r5, [r0] - ldr r1, =0x0202449c - lsls r0, r4, 1 - adds r0, 0xC8 - ldr r1, [r1] - adds r1, r0 - mov r8, r1 - ldr r1, =0x020242bc - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0, 0x4] - adds r7, r3, 0 - adds r3, r1, 0 - cmp r0, r5 - bne _0803FC06 - cmp r5, 0 - beq _0803FC06 - ldr r0, =0x02024474 - strb r4, [r0, 0x17] - ldr r0, =0x020241ea - strh r5, [r0] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 10 - ands r0, r1 - cmp r0, 0 - beq _0803FBF8 - ldr r1, =0x02024230 - ldrb r0, [r7] - lsls r0, 2 - adds r0, r1 - ldr r1, =gUnknown_082DAE2A - str r1, [r0] - ldr r0, =0x0202433c - ldrb r1, [r7] - lsls r1, 4 - adds r1, r0 - ldrb r0, [r1, 0x2] - movs r2, 0x10 - orrs r0, r2 - strb r0, [r1, 0x2] - b _0803FC06 - .pool -_0803FBF8: - ldr r0, =0x02024220 - ldrb r1, [r7] - lsls r1, 2 - adds r1, r0 - ldr r0, =gUnknown_082DAE1F - str r0, [r1] - movs r6, 0x1 -_0803FC06: - ldr r1, =0x02024248 - ldrb r2, [r7] - lsls r0, r2, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r5, r0 - bne _0803FC90 - cmp r5, 0xA5 - beq _0803FC90 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - bge _0803FC90 - adds r0, r2, 0 - bl b_cancel_multi_turn_move_maybe - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 10 - ands r0, r1 - cmp r0, 0 - beq _0803FC7C - ldr r1, =0x02024230 - ldrb r0, [r7] - lsls r0, 2 - adds r0, r1 - ldr r1, =gUnknown_082DB098 - str r1, [r0] - ldr r0, =0x0202433c - ldrb r1, [r7] - lsls r1, 4 - adds r1, r0 - ldrb r0, [r1, 0x2] - movs r2, 0x10 - orrs r0, r2 - strb r0, [r1, 0x2] - b _0803FC8E - .pool -_0803FC7C: - ldr r1, =0x02024220 - ldrb r0, [r7] - lsls r0, 2 - adds r0, r1 - ldr r1, =gUnknown_082DB089 - str r1, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_0803FC8E: - ldr r3, =0x020242bc -_0803FC90: - ldrb r0, [r7] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r0, [r1, 0x13] - lsls r0, 28 - cmp r0, 0 - beq _0803FD1A - ldr r0, =gBattleMoves - lsls r1, r5, 1 - adds r1, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - cmp r0, 0 - bne _0803FD1A - ldr r0, =0x020241ea - strh r5, [r0] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 10 - ands r0, r1 - cmp r0, 0 - beq _0803FD08 - ldr r1, =0x02024230 - ldrb r0, [r7] - lsls r0, 2 - adds r0, r1 - ldr r1, =gUnknown_082DB0AF - str r1, [r0] - ldr r0, =0x0202433c - ldrb r1, [r7] - lsls r1, 4 - adds r1, r0 - ldrb r0, [r1, 0x2] - movs r2, 0x10 - orrs r0, r2 - strb r0, [r1, 0x2] - b _0803FD1A - .pool -_0803FD08: - ldr r1, =0x02024220 - ldrb r0, [r7] - lsls r0, 2 - adds r0, r1 - ldr r1, =gUnknown_082DB0A0 - str r1, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_0803FD1A: - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r1, r5, 0 - bl sub_8040130 - lsls r0, 24 - cmp r0, 0 - beq _0803FD8E - ldr r0, =0x020241ea - strh r5, [r0] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 10 - ands r0, r1 - cmp r0, 0 - beq _0803FD7C - ldr r1, =0x02024230 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =gUnknown_082DB185 - str r1, [r0] - ldr r0, =0x0202433c - ldrb r1, [r4] - lsls r1, 4 - adds r1, r0 - ldrb r0, [r1, 0x2] - movs r2, 0x10 - orrs r0, r2 - strb r0, [r1, 0x2] - b _0803FD8E - .pool -_0803FD7C: - ldr r1, =0x02024220 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =gUnknown_082DB181 - str r1, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_0803FD8E: - ldr r1, =0x02024084 - ldr r0, =0x02024064 - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2E] - cmp r0, 0xAF - bne _0803FDC4 - ldr r1, =0x02024404 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r4, [r0, 0x7] - b _0803FDCE - .pool -_0803FDC4: - ldrh r0, [r1, 0x2E] - bl itemid_get_x12 - lsls r0, 24 - lsrs r4, r0, 24 -_0803FDCE: - ldr r2, =0x0202420f - ldr r1, =0x02024064 - ldrb r0, [r1] - strb r0, [r2] - ldr r0, =0x02024084 - mov r12, r0 - adds r7, r1, 0 - cmp r4, 0x1D - bne _0803FE58 - mov r0, r8 - ldrh r1, [r0] - adds r2, r1, 0 - cmp r2, 0 - beq _0803FE58 - ldr r0, =0x0000ffff - cmp r2, r0 - beq _0803FE58 - cmp r2, r5 - beq _0803FE58 - ldr r0, =0x020241ea - strh r1, [r0] - ldr r2, =0x02024208 - ldrb r1, [r7] - movs r0, 0x58 - muls r0, r1 - add r0, r12 - ldrh r0, [r0, 0x2E] - strh r0, [r2] - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 10 - ands r1, r0 - ldrb r2, [r7] - cmp r1, 0 - beq _0803FE48 - ldr r0, =0x0202433c - lsls r1, r2, 4 - adds r1, r0 - ldrb r0, [r1, 0x2] - movs r2, 0x10 - orrs r0, r2 - strb r0, [r1, 0x2] - b _0803FE58 - .pool -_0803FE48: - ldr r1, =0x02024220 - lsls r0, r2, 2 - adds r0, r1 - ldr r1, =gUnknown_082DB812 - str r1, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_0803FE58: - ldr r0, =0x02023864 - ldrb r3, [r7] - lsls r1, r3, 9 - adds r0, 0x2 - adds r1, r0 - movs r0, 0x58 - muls r0, r3 - ldrb r1, [r1] - adds r0, r1 - mov r1, r12 - adds r1, 0x24 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _0803FEB8 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 10 - ands r0, r1 - cmp r0, 0 - beq _0803FEA8 - ldr r0, =0x0202433c - lsls r1, r3, 4 - adds r1, r0 - ldrb r0, [r1, 0x2] - movs r2, 0x10 - orrs r0, r2 - strb r0, [r1, 0x2] - b _0803FEB8 - .pool -_0803FEA8: - ldr r1, =0x02024220 - lsls r0, r3, 2 - adds r0, r1 - ldr r1, =gUnknown_082DB076 - str r1, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_0803FEB8: - adds r0, r6, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_803FB4C - - thumb_func_start sub_803FECC -sub_803FECC: @ 803FECC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - lsls r2, 24 - lsrs r3, r2, 24 - ldr r1, =0x0202449c - lsls r0, r7, 1 - adds r0, 0xC8 - ldr r1, [r1] - adds r1, r0 - str r1, [sp, 0x4] - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r7 - adds r1, r0, r1 - ldrh r0, [r1, 0x2E] - cmp r0, 0xAF - bne _0803FF1C - ldr r2, =0x02024404 - lsls r1, r7, 3 - subs r0, r1, r7 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x7] - str r0, [sp] - b _0803FF2E - .pool -_0803FF1C: - ldrh r0, [r1, 0x2E] - str r3, [sp, 0x14] - bl itemid_get_x12 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - lsls r1, r7, 3 - ldr r3, [sp, 0x14] -_0803FF2E: - ldr r0, =0x0202420f - strb r7, [r0] - movs r0, 0 - mov r9, r0 - lsls r2, r7, 1 - str r2, [sp, 0xC] - ldr r5, =0x020242bc - mov r12, r5 - ldr r0, =0x02024084 - movs r2, 0x58 - adds r6, r7, 0 - muls r6, r2 - str r6, [sp, 0x8] - ldr r2, =0x02024090 - adds r5, r6, r2 - movs r6, 0 - str r6, [sp, 0x10] - mov r10, r0 - subs r0, r1, r7 - lsls r0, 2 - mov r8, r0 - ldr r6, =gUnknown_0832A328 -_0803FF5A: - ldrh r0, [r5] - cmp r0, 0 - bne _0803FF70 - movs r0, 0x1 - ands r0, r3 - cmp r0, 0 - beq _0803FF70 - ldr r0, [r6] - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_0803FF70: - ldr r0, [sp, 0x8] - add r0, r9 - mov r1, r10 - adds r1, 0x24 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _0803FF90 - movs r0, 0x2 - ands r0, r3 - cmp r0, 0 - beq _0803FF90 - ldr r0, [r6] - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_0803FF90: - mov r1, r8 - add r1, r12 - ldrh r0, [r5] - ldrh r1, [r1, 0x4] - cmp r0, r1 - bne _0803FFAC - movs r0, 0x4 - ands r0, r3 - cmp r0, 0 - beq _0803FFAC - ldr r0, [r6] - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_0803FFAC: - movs r0, 0x58 - adds r2, r7, 0 - muls r2, r0 - ldr r1, [sp, 0x10] - adds r0, r1, r2 - ldr r1, =0x02024090 - adds r0, r1 - mov r12, r0 - ldr r1, =0x02024248 - ldr r0, [sp, 0xC] - adds r1, r0, r1 - str r1, [sp, 0x18] - mov r1, r12 - ldrh r1, [r1] - mov r12, r1 - ldr r0, [sp, 0x18] - ldrh r0, [r0] - cmp r12, r0 - bne _0803FFEE - movs r0, 0x8 - ands r0, r3 - cmp r0, 0 - beq _0803FFEE - mov r0, r10 - adds r0, 0x50 - adds r0, r2, r0 - ldr r0, [r0] - cmp r0, 0 - bge _0803FFEE - ldr r0, [r6] - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_0803FFEE: - ldr r0, =0x020242bc - add r0, r8 - ldrb r0, [r0, 0x13] - lsls r0, 28 - cmp r0, 0 - beq _0804001C - movs r0, 0x10 - ands r0, r3 - cmp r0, 0 - beq _0804001C - ldr r2, =gBattleMoves - ldrh r1, [r5] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0 - bne _0804001C - ldr r0, [r6] - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_0804001C: - ldrh r1, [r5] - adds r0, r7, 0 - str r3, [sp, 0x14] - bl sub_8040130 - lsls r0, 24 - ldr r3, [sp, 0x14] - cmp r0, 0 - beq _0804003E - movs r0, 0x20 - ands r0, r3 - cmp r0, 0 - beq _0804003E - ldr r0, [r6] - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_0804003E: - ldr r1, =0x020242bc - mov r0, r8 - adds r2, r0, r1 - ldrb r0, [r2, 0xE] - lsls r0, 28 - mov r12, r1 - cmp r0, 0 - beq _0804005E - ldrh r0, [r2, 0x6] - ldrh r1, [r5] - cmp r0, r1 - beq _0804005E - ldr r0, [r6] - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_0804005E: - ldr r2, [sp] - cmp r2, 0x1D - bne _08040080 - ldr r0, [sp, 0x4] - ldrh r1, [r0] - cmp r1, 0 - beq _08040080 - ldr r0, =0x0000ffff - cmp r1, r0 - beq _08040080 - ldrh r2, [r5] - cmp r1, r2 - beq _08040080 - ldr r0, [r6] - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_08040080: - adds r6, 0x4 - adds r5, 0x2 - ldr r0, [sp, 0x10] - adds r0, 0x2 - str r0, [sp, 0x10] - movs r1, 0x1 - add r9, r1 - mov r2, r9 - cmp r2, 0x3 - bgt _08040096 - b _0803FF5A -_08040096: - adds r0, r4, 0 - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_803FECC - - thumb_func_start sub_80400C8 -sub_80400C8: @ 80400C8 - push {r4,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - movs r1, 0 - movs r2, 0xFF - bl sub_803FECC - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0xF - bne _0804010C - ldr r0, =0x0202433c - ldrb r1, [r4] - lsls r1, 4 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - ldr r1, =0x02024220 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =gUnknown_082DB072 - str r1, [r0] - b _0804011E - .pool -_0804010C: - ldr r0, =0x0202433c - ldrb r1, [r4] - lsls r1, 4 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] -_0804011E: - movs r0, 0 - cmp r3, 0xF - bne _08040126 - movs r0, 0x1 -_08040126: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80400C8 - - thumb_func_start sub_8040130 -sub_8040130: @ 8040130 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r5, r1, 16 - movs r6, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r4, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r6, r0 - bge _080401B4 - ldr r7, =0x02024090 - mov r8, r7 -_0804015A: - lsls r0, r4, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - adds r3, r4, 0x1 - cmp r9, r0 - beq _080401AA - ldr r1, =0x020242ac - lsls r0, r4, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 6 - ands r0, r1 - cmp r0, 0 - beq _080401AA - movs r2, 0 - movs r0, 0x58 - adds r1, r4, 0 - muls r1, r0 - adds r0, r1, r7 - ldrh r0, [r0] - cmp r5, r0 - beq _080401A0 - mov r4, r8 - adds r0, r1, r4 -_08040192: - adds r0, 0x2 - adds r2, 0x1 - cmp r2, 0x3 - bgt _080401AA - ldrh r1, [r0] - cmp r5, r1 - bne _08040192 -_080401A0: - cmp r2, 0x3 - bgt _080401AA - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_080401AA: - adds r4, r3, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _0804015A -_080401B4: - adds r0, r6, 0 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8040130 - - thumb_func_start sub_80401D0 -sub_80401D0: @ 80401D0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r0, 0 - mov r9, r0 - ldr r1, =0x0202420b - mov r2, r9 - strb r2, [r1] - ldr r0, =0x0202406c - ldrb r4, [r0] - adds r6, r1, 0 - mov r10, r0 - ldr r7, =0x0202420c - ldr r3, =0x0202449c - mov r12, r3 - cmp r9, r4 - bcs _08040224 - ldr r2, =0x02024210 - ldrb r1, [r2] - ldr r5, =gUnknown_0832A328 - ldr r0, [r5] - ands r1, r0 - cmp r1, 0 - beq _08040224 - adds r3, r6, 0 -_08040206: - ldrb r0, [r3] - adds r0, 0x1 - strb r0, [r3] - lsls r0, 24 - lsrs r0, 24 - cmp r0, r4 - bcs _08040224 - ldrb r0, [r2] - ldrb r1, [r6] - lsls r1, 2 - adds r1, r5 - ldr r1, [r1] - ands r0, r1 - cmp r0, 0 - bne _08040206 -_08040224: - movs r0, 0 - strb r0, [r7] - mov r0, r10 - ldrb r4, [r0] - cmp r4, 0 - beq _0804025E - ldr r2, =0x02024210 - ldrb r1, [r2] - ldr r5, =gUnknown_0832A328 - ldr r0, [r5] - ands r1, r0 - cmp r1, 0 - beq _0804025E - adds r3, r7, 0 -_08040240: - ldrb r0, [r3] - adds r0, 0x1 - strb r0, [r3] - lsls r0, 24 - lsrs r0, 24 - cmp r0, r4 - bcs _0804025E - ldrb r0, [r2] - ldrb r1, [r7] - lsls r1, 2 - adds r1, r5 - ldr r1, [r1] - ands r0, r1 - cmp r0, 0 - bne _08040240 -_0804025E: - mov r1, r12 - ldr r0, [r1] - ldrb r0, [r0, 0x3] - cmp r0, 0xA - bls _0804026A - b _080408F6 -_0804026A: - lsls r0, 2 - ldr r1, =_08040290 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08040290: - .4byte _080402BC - .4byte _08040342 - .4byte _08040408 - .4byte _080404D4 - .4byte _080405B0 - .4byte _08040668 - .4byte _0804071C - .4byte _080407A0 - .4byte _08040810 - .4byte _08040868 - .4byte _080408EC -_080402BC: - movs r5, 0 - ldr r1, =0x0202406c - mov r10, r1 - ldrb r2, [r1] - cmp r5, r2 - bge _080402D6 - ldr r2, =0x0202407e -_080402CA: - adds r0, r5, r2 - strb r5, [r0] - adds r5, 0x1 - ldrb r3, [r1] - cmp r5, r3 - blt _080402CA -_080402D6: - movs r5, 0 - b _08040324 - .pool -_080402E4: - adds r4, r5, 0x1 - adds r6, r4, 0 - ldrb r1, [r1] - cmp r6, r1 - bge _08040322 - ldr r7, =0x0202407e - ldr r0, =0x0202406c - mov r10, r0 - lsls r1, r5, 24 - mov r8, r1 -_080402F8: - adds r0, r5, r7 - ldrb r0, [r0] - adds r1, r4, r7 - ldrb r1, [r1] - movs r2, 0 - bl b_first_side - lsls r0, 24 - cmp r0, 0 - beq _08040318 - lsls r1, r4, 24 - lsrs r1, 24 - mov r2, r8 - lsrs r0, r2, 24 - bl sub_803CEDC -_08040318: - adds r4, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _080402F8 -_08040322: - adds r5, r6, 0 -_08040324: - mov r1, r10 - ldrb r0, [r1] - subs r0, 0x1 - cmp r5, r0 - blt _080402E4 - ldr r2, =0x0202449c - ldr r1, [r2] - ldrb r0, [r1, 0x3] - adds r0, 0x1 - strb r0, [r1, 0x3] - ldr r0, [r2] - adds r0, 0xDB - movs r1, 0 - strb r1, [r0] - mov r12, r2 -_08040342: - mov r1, r12 - ldr r0, [r1] - adds r0, 0xDB - ldrb r0, [r0] - cmp r0, 0x1 - bls _08040350 - b _0804062C -_08040350: - ldr r3, =0x02024064 - mov r8, r3 - movs r7, 0 - ldr r6, =0x0202420b - ldr r5, =0x02022f58 -_0804035A: - ldr r0, [r1] - adds r0, 0xDB - ldrb r4, [r0] - ldr r2, =0x02024294 - lsls r1, r4, 1 - adds r0, r1, r4 - lsls r0, 2 - adds r2, r0, r2 - ldrb r0, [r2, 0x1] - strb r0, [r6] - mov r3, r8 - strb r0, [r3] - ldr r0, =0x0202428e - adds r3, r1, r0 - ldrh r1, [r3] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080403BC - ldrb r0, [r2] - subs r0, 0x1 - strb r0, [r2] - movs r4, 0xFF - lsls r0, 24 - cmp r0, 0 - bne _080403BC - ldrh r0, [r3] - ldr r2, =0x0000fffe - adds r1, r2, 0 - ands r0, r1 - strh r0, [r3] - ldr r0, =gUnknown_082DACFA - bl b_call_bc_move_exec - movs r0, 0xFD - strb r0, [r5] - movs r0, 0x2 - strb r0, [r5, 0x1] - movs r0, 0x73 - strb r0, [r5, 0x2] - strb r7, [r5, 0x3] - ldrb r0, [r5, 0x4] - orrs r0, r4 - strb r0, [r5, 0x4] - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_080403BC: - ldr r2, =0x0202449c - ldr r1, [r2] - adds r1, 0xDB - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - mov r12, r2 - mov r3, r9 - cmp r3, 0 - beq _080403D2 - b _080408FE -_080403D2: - mov r1, r12 - ldr r0, [r1] - adds r0, 0xDB - ldrb r0, [r0] - cmp r0, 0x1 - bls _0804035A - b _0804062C - .pool -_08040408: - mov r1, r12 - ldr r0, [r1] - adds r0, 0xDB - ldrb r0, [r0] - cmp r0, 0x1 - bls _08040416 - b _08040570 -_08040416: - movs r0, 0x2 - mov r10, r0 - movs r2, 0 - mov r8, r2 - ldr r7, =0x0202420b - ldr r5, =0x02022f58 -_08040422: - ldr r0, [r1] - adds r0, 0xDB - ldrb r4, [r0] - ldr r2, =0x02024294 - lsls r1, r4, 1 - adds r0, r1, r4 - lsls r0, 2 - adds r2, r0, r2 - ldrb r0, [r2, 0x3] - strb r0, [r7] - ldr r3, =0x02024064 - strb r0, [r3] - ldr r0, =0x0202428e - adds r3, r1, r0 - ldrh r1, [r3] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0804048A - ldrb r0, [r2, 0x2] - subs r0, 0x1 - strb r0, [r2, 0x2] - movs r6, 0xFF - lsls r0, 24 - cmp r0, 0 - bne _0804048A - ldrh r0, [r3] - ldr r2, =0x0000fffd - adds r1, r2, 0 - ands r0, r1 - strh r0, [r3] - ldr r0, =gUnknown_082DACFA - bl b_call_bc_move_exec - ldr r0, =0x02024332 - strb r4, [r0, 0x5] - movs r0, 0xFD - strb r0, [r5] - mov r3, r10 - strb r3, [r5, 0x1] - movs r0, 0x71 - strb r0, [r5, 0x2] - mov r0, r8 - strb r0, [r5, 0x3] - ldrb r0, [r5, 0x4] - orrs r0, r6 - strb r0, [r5, 0x4] - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_0804048A: - ldr r2, =0x0202449c - ldr r1, [r2] - adds r1, 0xDB - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - mov r12, r2 - mov r1, r9 - cmp r1, 0 - beq _080404A0 - b _080408FE -_080404A0: - mov r1, r12 - ldr r0, [r1] - adds r0, 0xDB - ldrb r0, [r0] - cmp r0, 0x1 - bls _08040422 - b _08040570 - .pool -_080404D4: - mov r1, r12 - ldr r0, [r1] - adds r0, 0xDB - ldrb r0, [r0] - cmp r0, 0x1 - bhi _08040570 - ldr r0, =0x02024064 - mov r10, r0 - movs r2, 0 - mov r8, r2 - ldr r7, =0x0202420b - ldr r5, =0x02022f58 -_080404EC: - ldr r0, [r1] - adds r0, 0xDB - ldrb r4, [r0] - ldr r1, =0x02024294 - lsls r3, r4, 1 - adds r0, r3, r4 - lsls r0, 2 - adds r1, r0, r1 - ldrb r0, [r1, 0x5] - strb r0, [r7] - mov r2, r10 - strb r0, [r2] - ldrb r0, [r1, 0x4] - cmp r0, 0 - beq _0804054E - subs r0, 0x1 - strb r0, [r1, 0x4] - movs r6, 0xFF - lsls r0, 24 - cmp r0, 0 - bne _0804054E - ldr r2, =0x0202428e - adds r2, r3, r2 - ldrh r0, [r2] - ldr r3, =0x0000feff - adds r1, r3, 0 - ands r0, r1 - strh r0, [r2] - ldr r0, =gUnknown_082DACFA - bl b_call_bc_move_exec - ldr r0, =0x02024332 - strb r4, [r0, 0x5] - movs r0, 0xFD - strb r0, [r5] - movs r0, 0x2 - strb r0, [r5, 0x1] - movs r0, 0x36 - strb r0, [r5, 0x2] - mov r0, r8 - strb r0, [r5, 0x3] - ldrb r0, [r5, 0x4] - orrs r0, r6 - strb r0, [r5, 0x4] - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_0804054E: - ldr r2, =0x0202449c - ldr r1, [r2] - adds r1, 0xDB - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - mov r12, r2 - mov r1, r9 - cmp r1, 0 - beq _08040564 - b _080408FE -_08040564: - mov r1, r12 - ldr r0, [r1] - adds r0, 0xDB - ldrb r0, [r0] - cmp r0, 0x1 - bls _080404EC -_08040570: - mov r2, r9 - cmp r2, 0 - beq _08040578 - b _080408FE -_08040578: - mov r3, r12 - ldr r0, [r3] - ldrb r1, [r0, 0x3] - adds r1, 0x1 - strb r1, [r0, 0x3] - ldr r0, [r3] - adds r0, 0xDB - strb r2, [r0] - b _080408F6 - .pool -_080405B0: - mov r1, r12 - ldr r0, [r1] - adds r0, 0xDB - ldrb r0, [r0] - cmp r0, 0x1 - bhi _0804062C - ldr r6, =0x02024064 - ldr r5, =0x0202420b -_080405C0: - ldr r0, [r1] - adds r0, 0xDB - ldrb r4, [r0] - ldr r2, =0x02024294 - lsls r1, r4, 1 - adds r0, r1, r4 - lsls r0, 2 - adds r2, r0, r2 - ldrb r0, [r2, 0x7] - strb r0, [r5] - strb r0, [r6] - ldr r0, =0x0202428e - adds r3, r1, r0 - ldrh r1, [r3] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0804060A - ldrb r0, [r2, 0x6] - subs r0, 0x1 - strb r0, [r2, 0x6] - lsls r0, 24 - cmp r0, 0 - bne _0804060A - ldrh r0, [r3] - ldr r2, =0x0000ffdf - adds r1, r2, 0 - ands r0, r1 - strh r0, [r3] - ldr r0, =gUnknown_082DAD0B - bl b_call_bc_move_exec - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_0804060A: - ldr r2, =0x0202449c - ldr r1, [r2] - adds r1, 0xDB - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - mov r12, r2 - mov r3, r9 - cmp r3, 0 - beq _08040620 - b _080408FE -_08040620: - mov r1, r12 - ldr r0, [r1] - adds r0, 0xDB - ldrb r0, [r0] - cmp r0, 0x1 - bls _080405C0 -_0804062C: - mov r0, r9 - cmp r0, 0 - beq _08040634 - b _080408FE -_08040634: - mov r1, r12 - ldr r0, [r1] - ldrb r1, [r0, 0x3] - adds r1, 0x1 - strb r1, [r0, 0x3] - mov r2, r12 - ldr r0, [r2] - adds r0, 0xDB - mov r3, r9 - strb r3, [r0] - b _080408F6 - .pool -_08040668: - mov r2, r12 - ldr r0, [r2] - adds r0, 0xDB - ldr r1, =0x0202406c - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bcs _080406E8 - ldr r4, =0x02024064 - ldr r5, =0x0202407e -_0804067C: - ldr r0, [r2] - adds r0, 0xDB - ldrb r0, [r0] - adds r0, r5 - ldrb r0, [r0] - strb r0, [r4] - ldr r0, =0x020243d0 - adds r0, 0x20 - ldrb r2, [r4] - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0 - beq _080406C4 - subs r0, 0x1 - strb r0, [r1] - lsls r0, 24 - cmp r0, 0 - bne _080406C4 - ldr r1, =0x02024084 - ldrb r2, [r4] - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _080406C4 - ldr r0, =0x0202420c - strb r2, [r0] - ldr r0, =gUnknown_082DB0B7 - bl b_call_bc_move_exec - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_080406C4: - ldr r2, =0x0202449c - ldr r1, [r2] - adds r1, 0xDB - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - mov r12, r2 - mov r3, r9 - cmp r3, 0 - beq _080406DA - b _080408FE -_080406DA: - ldr r0, [r2] - adds r0, 0xDB - ldr r1, =0x0202406c - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bcc _0804067C -_080406E8: - mov r0, r9 - cmp r0, 0 - beq _080406F0 - b _080408FE -_080406F0: - mov r2, r12 - ldr r1, [r2] - ldrb r0, [r1, 0x3] - adds r0, 0x1 - strb r0, [r1, 0x3] - b _080408F6 - .pool -_0804071C: - ldr r3, =0x020243cc - ldrh r2, [r3] - movs r0, 0x7 - ands r0, r2 - cmp r0, 0 - bne _0804072A - b _080408C8 -_0804072A: - movs r0, 0x4 - ands r0, r2 - cmp r0, 0 - bne _08040776 - ldr r1, =0x020243d0 - adds r1, 0x28 - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - lsls r0, 24 - cmp r0, 0 - bne _08040768 - ldr r0, =0x0000fffe - ands r0, r2 - ldr r1, =0x0000fffd - ands r0, r1 - strh r0, [r3] - ldr r1, =0x02024332 - movs r0, 0x2 - strb r0, [r1, 0x5] - b _08040794 - .pool -_08040768: - movs r0, 0x2 - ands r0, r2 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - bne _08040782 - b _08040790 -_08040776: - movs r0, 0x2 - ands r0, r2 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _08040790 -_08040782: - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] - b _08040794 - .pool -_08040790: - ldr r0, =0x02024332 - strb r1, [r0, 0x5] -_08040794: - ldr r0, =gUnknown_082DAC2C - b _080408BA - .pool -_080407A0: - ldr r3, =0x020243cc - ldrh r2, [r3] - movs r0, 0x18 - ands r0, r2 - cmp r0, 0 - bne _080407AE - b _080408C8 -_080407AE: - movs r0, 0x10 - ands r0, r2 - cmp r0, 0 - bne _080407E8 - ldr r1, =0x020243d0 - adds r1, 0x28 - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - lsls r0, 24 - cmp r0, 0 - bne _080407E8 - ldr r0, =0x0000fff7 - ands r0, r2 - strh r0, [r3] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DACC9 - b _080407EC - .pool -_080407E8: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAC47 -_080407EC: - str r0, [r1] - adds r3, r1, 0 - ldr r1, =0x02024474 - movs r2, 0 - movs r0, 0xC - strb r0, [r1, 0x10] - ldr r0, =0x02024332 - strb r2, [r0, 0x5] - b _080408B8 - .pool -_08040810: - ldr r3, =0x020243cc - ldrh r2, [r3] - movs r0, 0x60 - ands r0, r2 - cmp r0, 0 - beq _080408C8 - movs r0, 0x40 - ands r0, r2 - cmp r0, 0 - bne _08040854 - ldr r1, =0x020243d0 - adds r1, 0x28 - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - lsls r0, 24 - cmp r0, 0 - bne _08040854 - ldr r0, =0x0000ffdf - ands r0, r2 - strh r0, [r3] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DACE0 - b _08040858 - .pool -_08040854: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DACD2 -_08040858: - str r0, [r1] - adds r3, r1, 0 - b _080408B8 - .pool -_08040868: - ldr r3, =0x020243cc - ldrh r2, [r3] - movs r0, 0x80 - ands r0, r2 - cmp r0, 0 - beq _080408C8 - ldr r1, =0x020243d0 - adds r1, 0x28 - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - lsls r0, 24 - cmp r0, 0 - bne _080408A4 - ldr r0, =0x0000ff7f - ands r0, r2 - strh r0, [r3] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DACC9 - b _080408A8 - .pool -_080408A4: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAC47 -_080408A8: - str r0, [r1] - adds r3, r1, 0 - ldr r1, =0x02024474 - movs r0, 0xD - strb r0, [r1, 0x10] - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] -_080408B8: - ldr r0, [r3] -_080408BA: - bl b_call_bc_move_exec - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_080408C8: - ldr r2, =0x0202449c - ldr r1, [r2] - ldrb r0, [r1, 0x3] - adds r0, 0x1 - strb r0, [r1, 0x3] - mov r12, r2 - b _080408F6 - .pool -_080408EC: - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_080408F6: - mov r3, r9 - cmp r3, 0 - bne _080408FE - b _0804025E -_080408FE: - ldr r0, =0x03005d04 - ldr r1, [r0] - ldr r0, =sub_803B9BC - eors r1, r0 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80401D0 - - thumb_func_start sub_8040924 -sub_8040924: @ 8040924 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - movs r0, 0 - mov r9, r0 - ldr r2, =0x02024280 - ldr r0, [r2] - ldr r1, =0x01000020 - orrs r0, r1 - str r0, [r2] - ldr r5, =0x0202449c - ldr r2, [r5] - ldr r0, =0x0202406c - ldrb r1, [r2, 0x1] - adds r7, r5, 0 - mov r8, r0 - ldrb r3, [r0] - cmp r1, r3 - bcc _08040954 - bl _08041338 -_08040954: - bl _0804132E - .pool -_08040968: - ldr r3, =0x02024064 - ldr r4, =0x0202420b - ldr r1, =0x0202407e - ldr r5, [r5] - ldrb r0, [r5, 0x1] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r4] - strb r0, [r3] - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - ldrb r0, [r3] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - adds r6, r3, 0 - cmp r1, 0 - beq _080409B0 - ldrb r0, [r5, 0x1] - adds r0, 0x1 - strb r0, [r5, 0x1] - bl _0804131C - .pool -_080409B0: - ldrb r0, [r5] - cmp r0, 0x13 - bls _080409BA - bl _08041312 -_080409BA: - lsls r0, 2 - ldr r1, =_080409C8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080409C8: - .4byte _08040A18 - .4byte _08040A78 - .4byte _08040A96 - .4byte _08040AC6 - .4byte _08040B44 - .4byte _08040B8C - .4byte _08040C0C - .4byte _08040C54 - .4byte _08040CB8 - .4byte _08040D00 - .4byte _08040E60 - .4byte _08040F7C - .4byte _08041024 - .4byte _080410E8 - .4byte _0804119C - .4byte _080411BC - .4byte _08041208 - .4byte _08041238 - .4byte _08040AAE - .4byte _08041304 -_08040A18: - ldr r1, =0x020242ac - ldrb r3, [r6] - lsls r0, r3, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 3 - ands r0, r1 - cmp r0, 0 - bne _08040A30 - bl _080412DE -_08040A30: - ldr r0, =0x02024084 - movs r1, 0x58 - muls r1, r3 - adds r0, r1, r0 - ldrh r2, [r0, 0x28] - ldrh r5, [r0, 0x2C] - cmp r2, r5 - bne _08040A44 - bl _080412DE -_08040A44: - cmp r2, 0 - bne _08040A4C - bl _080412DE -_08040A4C: - ldr r1, =0x020241f0 - ldrh r0, [r0, 0x2C] - lsrs r0, 4 - str r0, [r1] - cmp r0, 0 - bne _08040A5C - movs r0, 0x1 - str r0, [r1] -_08040A5C: - ldr r0, [r1] - negs r0, r0 - str r0, [r1] - ldr r0, =gUnknown_082DB0EE - bl _080412D0 - .pool -_08040A78: - ldrb r1, [r6] - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - bne _08040A92 - bl _080412DE -_08040A92: - bl _080412D4 -_08040A96: - ldrb r1, [r6] - movs r0, 0x1 - movs r2, 0 - bl berry_effects_maybe - lsls r0, 24 - cmp r0, 0 - bne _08040AAA - bl _080412DE -_08040AAA: - bl _080412D4 -_08040AAE: - ldrb r1, [r6] - movs r0, 0x1 - movs r2, 0x1 - bl berry_effects_maybe - lsls r0, 24 - cmp r0, 0 - bne _08040AC2 - bl _080412DE -_08040AC2: - bl _080412D4 -_08040AC6: - ldr r0, =0x020242ac - ldrb r2, [r6] - lsls r1, r2, 2 - adds r1, r0 - ldr r1, [r1] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - bne _08040ADC - bl _080412DE -_08040ADC: - ldr r3, =0x02024084 - movs r5, 0x3 - ands r5, r1 - movs r1, 0x58 - adds r0, r5, 0 - muls r0, r1 - adds r0, r3 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _08040AF4 - bl _080412DE -_08040AF4: - adds r0, r2, 0 - muls r0, r1 - adds r0, r3 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _08040B04 - bl _080412DE -_08040B04: - ldr r0, =0x0202420c - strb r5, [r0] - ldr r2, =0x020241f0 - ldrb r0, [r6] - muls r0, r1 - adds r0, r3 - ldrh r0, [r0, 0x2C] - lsrs r0, 3 - str r0, [r2] - cmp r0, 0 - bne _08040B1E - movs r0, 0x1 - str r0, [r2] -_08040B1E: - ldr r1, =0x02024474 - strb r5, [r1, 0x10] - ldrb r0, [r4] - strb r0, [r1, 0x11] - ldr r0, =gUnknown_082DAD15 - b _080412D0 - .pool -_08040B44: - ldr r2, =0x02024084 - ldrb r1, [r6] - movs r0, 0x58 - adds r3, r1, 0 - muls r3, r0 - adds r0, r2, 0 - adds r0, 0x4C - adds r0, r3, r0 - ldr r0, [r0] - movs r1, 0x8 - ands r0, r1 - cmp r0, 0 - bne _08040B60 - b _080412DE -_08040B60: - adds r1, r3, r2 - ldrh r0, [r1, 0x28] - cmp r0, 0 - bne _08040B6A - b _080412DE -_08040B6A: - ldr r2, =0x020241f0 - ldrh r0, [r1, 0x2C] - lsrs r0, 3 - str r0, [r2] - cmp r0, 0 - bne _08040B7A - movs r0, 0x1 - str r0, [r2] -_08040B7A: - ldr r0, =gUnknown_082DB23D - b _080412D0 - .pool -_08040B8C: - ldr r4, =0x02024084 - ldrb r0, [r6] - movs r7, 0x58 - mov r8, r7 - mov r2, r8 - muls r2, r0 - adds r3, r4, 0 - adds r3, 0x4C - adds r0, r2, r3 - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08040BAA - b _080412DE -_08040BAA: - adds r1, r2, r4 - ldrh r0, [r1, 0x28] - cmp r0, 0 - bne _08040BB4 - b _080412DE -_08040BB4: - ldr r5, =0x020241f0 - ldrh r0, [r1, 0x2C] - lsrs r0, 4 - str r0, [r5] - cmp r0, 0 - bne _08040BC4 - movs r0, 0x1 - str r0, [r5] -_08040BC4: - ldrb r0, [r6] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r2, r0, r3 - ldr r1, [r2] - movs r4, 0xF0 - lsls r4, 4 - adds r0, r1, 0 - ands r0, r4 - cmp r0, r4 - beq _08040BE4 - movs r7, 0x80 - lsls r7, 1 - adds r0, r1, r7 - str r0, [r2] -_08040BE4: - ldrb r0, [r6] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r3 - ldr r0, [r0] - ands r0, r4 - lsrs r0, 8 - ldr r1, [r5] - muls r0, r1 - str r0, [r5] - ldr r0, =gUnknown_082DB23D - b _080412D0 - .pool -_08040C0C: - ldr r2, =0x02024084 - ldrb r1, [r6] - movs r0, 0x58 - adds r3, r1, 0 - muls r3, r0 - adds r0, r2, 0 - adds r0, 0x4C - adds r0, r3, r0 - ldr r0, [r0] - movs r1, 0x10 - ands r0, r1 - cmp r0, 0 - bne _08040C28 - b _080412DE -_08040C28: - adds r1, r3, r2 - ldrh r0, [r1, 0x28] - cmp r0, 0 - bne _08040C32 - b _080412DE -_08040C32: - ldr r2, =0x020241f0 - ldrh r0, [r1, 0x2C] - lsrs r0, 3 - str r0, [r2] - cmp r0, 0 - bne _08040C42 - movs r0, 0x1 - str r0, [r2] -_08040C42: - ldr r0, =gUnknown_082DB25F - b _080412D0 - .pool -_08040C54: - ldr r4, =0x02024084 - ldrb r1, [r6] - movs r0, 0x58 - muls r1, r0 - adds r0, r4, 0 - adds r0, 0x50 - adds r5, r1, r0 - ldr r2, [r5] - movs r0, 0x80 - lsls r0, 20 - ands r0, r2 - cmp r0, 0 - bne _08040C70 - b _080412DE -_08040C70: - adds r3, r1, r4 - ldrh r0, [r3, 0x28] - cmp r0, 0 - bne _08040C7A - b _080412DE -_08040C7A: - adds r0, r4, 0 - adds r0, 0x4C - adds r0, r1, r0 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - beq _08040CAC - ldr r1, =0x020241f0 - ldrh r0, [r3, 0x2C] - lsrs r0, 2 - str r0, [r1] - cmp r0, 0 - bne _08040C9A - movs r0, 0x1 - str r0, [r1] -_08040C9A: - ldr r0, =gUnknown_082DB33F - b _080412D0 - .pool -_08040CAC: - ldr r0, =0xf7ffffff - ands r2, r0 - str r2, [r5] - b _080412DE - .pool -_08040CB8: - ldr r2, =0x02024084 - ldrb r1, [r6] - movs r0, 0x58 - adds r3, r1, 0 - muls r3, r0 - adds r0, r2, 0 - adds r0, 0x50 - adds r0, r3, r0 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 21 - ands r0, r1 - cmp r0, 0 - bne _08040CD6 - b _080412DE -_08040CD6: - adds r1, r3, r2 - ldrh r0, [r1, 0x28] - cmp r0, 0 - bne _08040CE0 - b _080412DE -_08040CE0: - ldr r2, =0x020241f0 - ldrh r0, [r1, 0x2C] - lsrs r0, 2 - str r0, [r2] - cmp r0, 0 - bne _08040CF0 - movs r0, 0x1 - str r0, [r2] -_08040CF0: - ldr r0, =gUnknown_082DB350 - b _080412D0 - .pool -_08040D00: - ldr r3, =0x02024084 - mov r8, r3 - ldrb r0, [r6] - movs r3, 0x58 - adds r1, r0, 0 - muls r1, r3 - movs r5, 0x50 - add r5, r8 - mov r10, r5 - adds r4, r1, r5 - ldr r2, [r4] - movs r5, 0xE0 - lsls r5, 8 - adds r0, r2, 0 - ands r0, r5 - cmp r0, 0 - bne _08040D24 - b _080412DE -_08040D24: - mov r7, r8 - adds r0, r1, r7 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _08040D30 - b _080412DE -_08040D30: - ldr r1, =0xffffe000 - adds r0, r2, r1 - str r0, [r4] - ldrb r4, [r6] - adds r0, r4, 0 - muls r0, r3 - add r0, r10 - ldr r0, [r0] - ands r0, r5 - cmp r0, 0 - beq _08040DC0 - ldr r1, =0x02024474 - ldr r0, =0x0202449c - ldr r2, [r0] - lsls r0, r4, 1 - adds r0, r2 - ldrb r0, [r0, 0x4] - strb r0, [r1, 0x10] - ldrb r0, [r6] - lsls r0, 1 - adds r0, r2 - ldrb r0, [r0, 0x5] - strb r0, [r1, 0x11] - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x2 - strb r0, [r1, 0x1] - ldrb r0, [r6] - lsls r0, 1 - adds r0, r2 - ldrb r0, [r0, 0x4] - strb r0, [r1, 0x2] - ldrb r0, [r6] - lsls r0, 1 - adds r0, r2 - ldrb r0, [r0, 0x5] - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB30E - str r0, [r1] - ldr r2, =0x020241f0 - ldrb r0, [r6] - muls r0, r3 - add r0, r8 - ldrh r0, [r0, 0x2C] - lsrs r0, 4 - str r0, [r2] - cmp r0, 0 - bne _08040DEC - movs r0, 0x1 - str r0, [r2] - b _08040DEC - .pool -_08040DC0: - ldr r2, =0x02022f58 - movs r0, 0xFD - strb r0, [r2] - movs r0, 0x2 - strb r0, [r2, 0x1] - ldrb r1, [r6] - ldr r0, =0x0202449c - ldr r3, [r0] - lsls r1, 1 - adds r1, r3 - ldrb r0, [r1, 0x4] - strb r0, [r2, 0x2] - ldrb r0, [r6] - lsls r0, 1 - adds r0, r3 - ldrb r0, [r0, 0x5] - strb r0, [r2, 0x3] - movs r0, 0xFF - strb r0, [r2, 0x4] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB320 - str r0, [r1] -_08040DEC: - ldr r0, [r1] - b _080412D0 - .pool -_08040E00: - movs r0, 0x8 - negs r0, r0 - ands r3, r0 - str r3, [r2] - ldrb r0, [r6] - mov r2, r8 - muls r2, r0 - mov r0, r10 - adds r0, 0x50 - adds r2, r0 - ldr r0, [r2] - ldr r1, =0xf7ffffff - ands r0, r1 - str r0, [r2] - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] - ldr r0, =gUnknown_082DB234 - bl b_call_bc_move_exec - ldr r4, =0x02024064 - ldrb r0, [r6] - strb r0, [r4] - ldrb r0, [r4] - mov r3, r8 - muls r3, r0 - adds r0, r3, 0 - add r0, r9 - str r0, [sp] - movs r0, 0 - movs r1, 0x28 - movs r2, 0 - movs r3, 0x4 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - b _08040EC8 - .pool -_08040E60: - ldr r2, =0x02024084 - ldrb r1, [r6] - movs r0, 0x58 - muls r0, r1 - adds r1, r2, 0 - adds r1, 0x50 - adds r0, r1 - ldr r1, [r0] - movs r0, 0x70 - ands r1, r0 - adds r7, r2, 0 - cmp r1, 0 - beq _08040F6A - movs r0, 0 - strb r0, [r4] - mov r5, r8 - ldrb r0, [r5] - cmp r0, 0 - beq _08040EC8 - mov r10, r7 - adds r6, r4, 0 - movs r1, 0x58 - mov r8, r1 - movs r3, 0x4C - adds r3, r7 - mov r9, r3 - str r0, [sp, 0x4] - movs r5, 0x7 - mov r12, r5 -_08040E9A: - ldrb r4, [r6] - mov r1, r8 - muls r1, r4 - mov r0, r9 - adds r2, r1, r0 - ldr r3, [r2] - adds r0, r3, 0 - mov r5, r12 - ands r0, r5 - cmp r0, 0 - beq _08040EBA - adds r0, r1, r7 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x2B - bne _08040E00 -_08040EBA: - adds r0, r4, 0x1 - strb r0, [r6] - lsls r0, 24 - lsrs r0, 24 - ldr r1, [sp, 0x4] - cmp r0, r1 - bcc _08040E9A -_08040EC8: - ldr r2, =0x0202420b - ldr r1, =0x0202406c - ldrb r0, [r2] - ldrb r1, [r1] - cmp r0, r1 - beq _08040EE8 - movs r3, 0x2 - mov r9, r3 - b _08041318 - .pool -_08040EE8: - ldr r5, =0x02024064 - ldrb r0, [r5] - strb r0, [r2] - ldr r2, =0x02024084 - ldrb r0, [r5] - movs r7, 0x58 - adds r1, r0, 0 - muls r1, r7 - adds r6, r2, 0 - adds r6, 0x50 - adds r1, r6 - ldr r0, [r1] - subs r0, 0x10 - str r0, [r1] - ldrb r0, [r5] - bl sub_803F90C - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _08040F2C - ldrb r0, [r5] - bl b_cancel_multi_turn_move_maybe - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] - b _08040F60 - .pool -_08040F2C: - ldrb r3, [r5] - adds r0, r3, 0 - muls r0, r7 - adds r2, r0, r6 - ldr r0, [r2] - movs r1, 0x70 - ands r0, r1 - cmp r0, 0 - beq _08040F54 - ldr r0, =0x02024332 - strb r4, [r0, 0x5] - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 5 - orrs r0, r1 - str r0, [r2] - b _08040F60 - .pool -_08040F54: - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] - adds r0, r3, 0 - bl b_cancel_multi_turn_move_maybe -_08040F60: - ldr r0, =gUnknown_082DB2A6 - bl b_call_bc_move_exec - movs r5, 0x1 - mov r9, r5 -_08040F6A: - mov r7, r9 - cmp r7, 0x2 - bne _08040F72 - b _08041312 -_08040F72: - b _080412DE - .pool -_08040F7C: - ldr r1, =0x02024084 - ldrb r0, [r6] - movs r7, 0x58 - muls r0, r7 - adds r5, r1, 0 - adds r5, 0x50 - adds r2, r0, r5 - ldr r1, [r2] - movs r4, 0xC0 - lsls r4, 4 - adds r0, r1, 0 - ands r0, r4 - cmp r0, 0 - bne _08040F9A - b _080412DE -_08040F9A: - ldr r3, =0xfffffc00 - adds r0, r1, r3 - str r0, [r2] - ldrb r0, [r6] - bl sub_803F90C - lsls r0, 24 - cmp r0, 0 - beq _08040FBC - ldrb r0, [r6] - bl b_cancel_multi_turn_move_maybe - b _080412DE - .pool -_08040FBC: - ldrb r0, [r6] - muls r0, r7 - adds r2, r0, r5 - ldr r1, [r2] - adds r0, r1, 0 - ands r0, r4 - cmp r0, 0 - beq _08040FCE - b _080412DE -_08040FCE: - movs r0, 0x80 - lsls r0, 5 - ands r0, r1 - cmp r0, 0 - bne _08040FDA - b _080412DE -_08040FDA: - ldr r0, =0xffffefff - ands r1, r0 - str r1, [r2] - ldrb r0, [r6] - muls r0, r7 - adds r0, r5 - ldr r0, [r0] - movs r4, 0x7 - ands r0, r4 - cmp r0, 0 - beq _08040FF2 - b _080412DE -_08040FF2: - ldr r1, =0x02024332 - movs r0, 0x47 - strb r0, [r1, 0x3] - movs r0, 0x1 - movs r1, 0 - bl sub_8048760 - ldrb r0, [r6] - muls r0, r7 - adds r0, r5 - ldr r0, [r0] - ands r0, r4 - cmp r0, 0 - bne _08041010 - b _080412D4 -_08041010: - ldr r0, =gUnknown_082DB2AF - bl b_call_bc_move_exec - b _080412D4 - .pool -_08041024: - ldr r0, =0x020242bc - ldrb r3, [r6] - lsls r1, r3, 3 - subs r1, r3 - lsls r1, 2 - adds r5, r1, r0 - ldrb r1, [r5, 0xB] - lsls r1, 28 - adds r7, r0, 0 - cmp r1, 0 - bne _0804103C - b _080412DE -_0804103C: - movs r4, 0 - ldr r2, =0x02024084 - movs r0, 0x58 - adds r1, r3, 0 - muls r1, r0 - adds r2, 0xC - adds r1, r2 - ldrh r0, [r5, 0x4] - ldrh r1, [r1] - cmp r0, r1 - beq _0804107A - mov r12, r7 - mov r8, r2 - adds r5, r6, 0 - movs r3, 0x58 -_0804105A: - adds r4, 0x1 - cmp r4, 0x3 - bgt _0804107A - ldrb r2, [r5] - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - add r1, r12 - lsls r0, r4, 1 - muls r2, r3 - adds r0, r2 - add r0, r8 - ldrh r1, [r1, 0x4] - ldrh r0, [r0] - cmp r1, r0 - bne _0804105A -_0804107A: - cmp r4, 0x4 - bne _080410AC - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r7 - movs r1, 0 - strh r1, [r0, 0x4] - ldrb r0, [r6] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r7 - ldrb r2, [r1, 0xB] - movs r0, 0x10 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0xB] - b _080412DE - .pool -_080410AC: - ldrb r0, [r6] - lsls r2, r0, 3 - subs r2, r0 - lsls r2, 2 - adds r2, r7 - ldrb r3, [r2, 0xB] - lsls r1, r3, 28 - lsrs r1, 28 - subs r1, 0x1 - movs r0, 0xF - ands r1, r0 - movs r0, 0x10 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0xB] - adds r2, r1, 0 - cmp r2, 0 - beq _080410D4 - b _080412DE -_080410D4: - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x4] - ldr r0, =gUnknown_082DAE23 - b _080412D0 - .pool -_080410E8: - ldr r3, =0x020242bc - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r2, r0, r3 - ldrb r5, [r2, 0xE] - lsls r4, r5, 28 - cmp r4, 0 - bne _080410FE - b _080412DE -_080410FE: - ldr r7, =0x02024084 - mov r8, r7 - ldrb r0, [r2, 0xC] - lsls r0, 1 - movs r7, 0x58 - muls r1, r7 - adds r0, r1 - mov r1, r8 - adds r1, 0xC - adds r0, r1 - ldrh r0, [r0] - ldrh r1, [r2, 0x6] - cmp r0, r1 - beq _0804113C - movs r0, 0 - strh r0, [r2, 0x6] - ldrb r0, [r6] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r2, [r1, 0xE] - movs r0, 0x10 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0xE] - b _080412DE - .pool -_0804113C: - lsrs r1, r4, 28 - subs r1, 0x1 - movs r0, 0xF - ands r1, r0 - movs r4, 0x10 - negs r4, r4 - adds r0, r4, 0 - ands r0, r5 - orrs r0, r1 - strb r0, [r2, 0xE] - cmp r1, 0 - beq _08041172 - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r3 - muls r1, r7 - ldrb r0, [r0, 0xC] - adds r1, r0 - mov r0, r8 - adds r0, 0x24 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0 - beq _08041172 - b _080412DE -_08041172: - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0 - strh r1, [r0, 0x6] - ldrb r0, [r6] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r2, [r1, 0xE] - adds r0, r4, 0 - ands r0, r2 - strb r0, [r1, 0xE] - ldr r0, =gUnknown_082DAE37 - b _080412D0 - .pool -_0804119C: - ldr r0, =0x020242ac - ldrb r1, [r6] - lsls r1, 2 - adds r1, r0 - ldr r2, [r1] - movs r0, 0x18 - ands r0, r2 - cmp r0, 0 - beq _080411B4 - adds r0, r2, 0 - subs r0, 0x8 - str r0, [r1] -_080411B4: - ldr r1, [r7] - b _080412E2 - .pool -_080411BC: - ldr r2, =0x020242bc - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r3, r0, r2 - ldrb r2, [r3, 0x12] - lsls r1, r2, 28 - cmp r1, 0 - beq _080411F6 - lsrs r1, 28 - subs r1, 0x1 - movs r0, 0xF - ands r1, r0 - movs r0, 0x10 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x12] - cmp r1, 0 - bne _080411F6 - ldr r0, =0x020242ac - ldrb r2, [r6] - lsls r2, 2 - adds r2, r0 - ldr r0, [r2] - ldr r1, =0xfffffdff - ands r0, r1 - str r0, [r2] -_080411F6: - ldr r1, [r7] - b _080412E2 - .pool -_08041208: - ldr r2, =0x020242bc - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r3, r0, r2 - ldrb r2, [r3, 0x13] - lsls r1, r2, 28 - cmp r1, 0 - beq _0804122E - lsrs r1, 28 - subs r1, 0x1 - movs r0, 0xF - ands r1, r0 - movs r0, 0x10 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x13] -_0804122E: - ldr r1, [r7] - b _080412E2 - .pool -_08041238: - ldr r4, =0x020242ac - ldrb r0, [r6] - lsls r0, 2 - adds r2, r0, r4 - ldr r1, [r2] - movs r3, 0xC0 - lsls r3, 5 - adds r0, r1, 0 - ands r0, r3 - cmp r0, 0 - beq _080412DE - ldr r5, =0xfffff800 - adds r0, r1, r5 - str r0, [r2] - ldrb r2, [r6] - lsls r0, r2, 2 - adds r0, r4 - ldr r0, [r0] - ands r0, r3 - cmp r0, 0 - bne _080412DE - ldr r3, =0x02024084 - movs r5, 0x58 - adds r1, r2, 0 - muls r1, r5 - adds r4, r3, 0 - adds r4, 0x4C - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, 0 - bne _080412DE - adds r0, r1, r3 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x48 - beq _080412DE - cmp r0, 0xF - beq _080412DE - adds r0, r2, 0 - bl sub_8050650 - lsls r0, 24 - cmp r0, 0 - bne _080412DE - ldrb r0, [r6] - bl b_cancel_multi_turn_move_maybe - bl GenerateRandomNumber - ldrb r1, [r6] - adds r2, r1, 0 - muls r2, r5 - adds r2, r4 - movs r1, 0x3 - ands r1, r0 - adds r1, 0x2 - ldr r0, [r2] - orrs r0, r1 - str r0, [r2] - ldrb r0, [r6] - muls r0, r5 - adds r0, r4 - str r0, [sp] - movs r0, 0 - movs r1, 0x28 - movs r2, 0 - movs r3, 0x4 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r6] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x0202420e - ldrb r0, [r6] - strb r0, [r1] - ldr r0, =gUnknown_082DB378 -_080412D0: - bl b_call_bc_move_exec -_080412D4: - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_080412DE: - ldr r0, =0x0202449c - ldr r1, [r0] -_080412E2: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08041312 - .pool -_08041304: - ldr r1, [r7] - movs r0, 0 - strb r0, [r1] - ldr r1, [r7] - ldrb r0, [r1, 0x1] - adds r0, 0x1 - strb r0, [r1, 0x1] -_08041312: - mov r7, r9 - cmp r7, 0 - beq _0804131C -_08041318: - mov r0, r9 - b _08041344 -_0804131C: - ldr r5, =0x0202449c - ldr r2, [r5] - ldr r0, =0x0202406c - ldrb r1, [r2, 0x1] - adds r7, r5, 0 - mov r8, r0 - ldrb r0, [r0] - cmp r1, r0 - bcs _08041338 -_0804132E: - ldrb r0, [r2] - cmp r0, 0x13 - bhi _08041338 - bl _08040968 -_08041338: - ldr r0, =0x02024280 - ldr r1, [r0] - ldr r2, =0xfeffffdf - ands r1, r2 - str r1, [r0] - movs r0, 0 -_08041344: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8040924 - - thumb_func_start sub_8041364 -sub_8041364: @ 8041364 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r2, =0x02024280 - ldr r0, [r2] - ldr r1, =0x01000020 - orrs r0, r1 - str r0, [r2] - ldr r1, =0x0202449c - ldr r3, [r1] - movs r4, 0xD0 - lsls r4, 1 - adds r0, r3, r4 - ldrb r0, [r0] - mov r10, r2 - adds r6, r1, 0 - cmp r0, 0x1 - bne _0804138E - b _08041548 -_0804138E: - cmp r0, 0x1 - bgt _080413A4 - cmp r0, 0 - beq _080413AC - b _08041708 - .pool -_080413A4: - cmp r0, 0x2 - bne _080413AA - b _0804169A -_080413AA: - b _08041708 -_080413AC: - ldr r2, =0x000001a1 - adds r0, r3, r2 - ldr r1, =0x0202406c - ldrb r0, [r0] - mov r8, r1 - ldrb r7, [r1] - cmp r0, r7 - bcc _080413BE - b _08041532 -_080413BE: - ldr r4, =0x02024064 - ldr r5, =0x02022f58 - ldr r7, =0x020243d0 - movs r0, 0x18 - adds r0, r7 - mov r12, r0 -_080413CA: - ldr r0, [r6] - adds r3, r0, r2 - ldrb r0, [r3] - strb r0, [r4] - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _0804140C - ldrb r0, [r3] - adds r0, 0x1 - strb r0, [r3] - b _08041520 - .pool -_0804140C: - ldrb r0, [r3] - adds r0, 0x1 - strb r0, [r3] - ldr r1, =0x020243d0 - ldrb r0, [r4] - adds r2, r0, r1 - ldrb r0, [r2] - mov r9, r1 - cmp r0, 0 - bne _08041422 - b _08041520 -_08041422: - subs r0, 0x1 - strb r0, [r2] - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - bne _08041520 - ldr r1, =0x02024084 - ldrb r2, [r4] - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _08041520 - lsls r0, r2, 1 - add r0, r12 - ldrh r0, [r0] - cmp r0, 0xF8 - bne _0804145C - ldr r0, =0x02024332 - strb r3, [r0, 0x5] - b _08041462 - .pool -_0804145C: - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] -_08041462: - movs r0, 0xFD - strb r0, [r5] - movs r6, 0x2 - movs r0, 0x2 - strb r0, [r5, 0x1] - ldrb r0, [r4] - lsls r0, 1 - add r0, r12 - ldrh r0, [r0] - strb r0, [r5, 0x2] - ldrb r0, [r4] - lsls r0, 1 - add r0, r12 - ldrh r0, [r0] - lsrs r0, 8 - strb r0, [r5, 0x3] - movs r0, 0xFF - strb r0, [r5, 0x4] - ldr r5, =0x0202420c - ldrb r0, [r4] - strb r0, [r5] - ldr r1, =0x0202420b - adds r0, r7, 0x4 - ldrb r2, [r4] - adds r0, r2 - ldrb r0, [r0] - strb r0, [r1] - ldr r2, =0x020241f0 - ldrb r0, [r4] - lsls r0, 2 - adds r1, r7, 0 - adds r1, 0x8 - adds r0, r1 - ldr r0, [r0] - str r0, [r2] - ldr r2, =0x0202437c - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, 0x4 - adds r0, r2 - ldr r1, =0x0000ffff - str r1, [r0] - ldr r0, =gUnknown_082DAFE4 - bl b_call_bc_move_exec - ldrb r1, [r4] - adds r0, r1, r7 - ldrb r0, [r0] - cmp r0, 0 - beq _080414CC - b _08041664 -_080414CC: - eors r1, r6 - mov r3, r9 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, 0 - beq _080414DA - b _08041664 -_080414DA: - ldrb r0, [r5] - bl battle_get_per_side_status - ldr r2, =0x0202428e - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - ands r0, r1 - lsls r0, 1 - adds r0, r2 - ldrh r1, [r0] - ldr r4, =0x0000ffbf - adds r2, r4, 0 - ands r1, r2 - strh r1, [r0] - b _08041664 - .pool -_08041520: - ldr r0, [r6] - ldr r2, =0x000001a1 - adds r0, r2 - ldrb r0, [r0] - mov r1, r8 - ldrb r1, [r1] - cmp r0, r1 - bcs _08041532 - b _080413CA -_08041532: - ldr r0, [r6] - movs r2, 0xD0 - lsls r2, 1 - adds r0, r2 - movs r1, 0x1 - strb r1, [r0] - ldr r0, [r6] - ldr r3, =0x000001a1 - adds r1, r0, r3 - movs r0, 0 - strb r0, [r1] -_08041548: - adds r3, r6, 0 - ldr r0, [r6] - ldr r2, =0x000001a1 - adds r0, r2 - ldr r1, =0x0202406c - ldrb r0, [r0] - mov r8, r1 - ldrb r4, [r1] - cmp r0, r4 - bcc _0804155E - b _08041684 -_0804155E: - ldr r5, =0x02024064 - ldr r4, =0x02022f58 - ldr r7, =0x020242bc - mov r12, r7 - ldr r0, =0x0202420b - mov r9, r0 -_0804156A: - ldr r1, =0x0202407e - ldr r0, [r3] - adds r3, r0, r2 - ldrb r0, [r3] - adds r0, r1 - ldrb r0, [r0] - mov r1, r9 - strb r0, [r1] - strb r0, [r5] - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _080415BC - ldrb r0, [r3] - adds r0, 0x1 - strb r0, [r3] - b _08041670 - .pool -_080415BC: - ldrb r0, [r3] - adds r0, 0x1 - strb r0, [r3] - ldr r7, =0x020242ac - ldrb r0, [r5] - lsls r0, 2 - adds r0, r7 - ldr r0, [r0] - movs r1, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08041670 - movs r0, 0xFD - strb r0, [r4] - movs r0, 0x1 - strb r0, [r4, 0x1] - strb r0, [r4, 0x2] - strb r0, [r4, 0x3] - ldrb r1, [r5] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - ldrb r0, [r0, 0xF] - lsls r0, 28 - lsrs r0, 28 - strb r0, [r4, 0x4] - movs r0, 0xFF - strb r0, [r4, 0x5] - ldrb r2, [r5] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - mov r3, r12 - adds r4, r0, r3 - ldrb r3, [r4, 0xF] - lsls r1, r3, 28 - cmp r1, 0 - bne _08041644 - lsls r2, 2 - adds r2, r7 - ldr r0, [r2] - movs r1, 0x21 - negs r1, r1 - ands r0, r1 - str r0, [r2] - ldr r3, =0x020241f0 - ldr r2, =0x02024084 - ldrb r1, [r5] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r0, [r0, 0x28] - str r0, [r3] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAF05 - b _0804165C - .pool -_08041644: - lsrs r1, 28 - subs r1, 0x1 - movs r0, 0xF - ands r1, r0 - movs r7, 0x10 - negs r7, r7 - adds r0, r7, 0 - ands r0, r3 - orrs r0, r1 - strb r0, [r4, 0xF] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAF20 -_0804165C: - str r0, [r1] - ldr r0, [r1] - bl b_call_bc_move_exec -_08041664: - movs r0, 0x1 - b _08041714 - .pool -_08041670: - adds r3, r6, 0 - ldr r0, [r6] - ldr r2, =0x000001a1 - adds r0, r2 - ldrb r0, [r0] - mov r1, r8 - ldrb r1, [r1] - cmp r0, r1 - bcs _08041684 - b _0804156A -_08041684: - ldr r0, [r6] - movs r2, 0xD0 - lsls r2, 1 - adds r0, r2 - movs r1, 0x2 - strb r1, [r0] - ldr r0, [r6] - ldr r3, =0x000001a1 - adds r1, r0, r3 - movs r0, 0 - strb r0, [r1] -_0804169A: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - beq _08041708 - ldr r0, [r6] - adds r0, 0xDA - ldrb r0, [r0] - cmp r0, 0x2 - bne _08041708 - ldr r1, =0x02024084 - ldrh r0, [r1, 0x28] - cmp r0, 0 - beq _08041708 - adds r0, r1, 0 - adds r0, 0x80 - ldrh r0, [r0] - cmp r0, 0 - beq _08041708 - movs r4, 0 -_080416C6: - lsls r0, r4, 24 - lsrs r0, 24 - bl b_cancel_multi_turn_move_maybe - adds r4, 0x1 - cmp r4, 0x1 - ble _080416C6 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB8F3 - str r0, [r1] - bl b_call_bc_move_exec - ldr r0, =0x0202449c - ldr r1, [r0] - movs r4, 0xD0 - lsls r4, 1 - adds r1, r4 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08041664 - .pool -_08041708: - mov r7, r10 - ldr r0, [r7] - ldr r1, =0xfeffffdf - ands r0, r1 - str r0, [r7] - movs r0, 0 -_08041714: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8041364 - - thumb_func_start sub_8041728 -sub_8041728: @ 8041728 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08041770 - b _08041A0A - .pool -_08041744: - ldr r0, =gUnknown_082DA7C4 - bl b_call_bc_move_exec - ldr r0, [r5] - adds r0, 0x4D - movs r1, 0x2 - b _08041764 - .pool -_08041758: - ldr r0, =gUnknown_082DA7CD - bl b_call_bc_move_exec - ldr r0, [r5] - adds r0, 0x4D - movs r1, 0x5 -_08041764: - strb r1, [r0] -_08041766: - movs r0, 0x1 - b _08041A0C - .pool -_08041770: - ldr r0, =0x0202449c - mov r8, r0 -_08041774: - mov r1, r8 - ldr r0, [r1] - adds r0, 0x4D - ldrb r0, [r0] - cmp r0, 0x7 - bls _08041782 - b _080419FC -_08041782: - lsls r0, 2 - ldr r1, =_08041794 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08041794: - .4byte _080417B4 - .4byte _08041806 - .4byte _080418A0 - .4byte _080418E2 - .4byte _080418F6 - .4byte _08041960 - .4byte _08041994 - .4byte _080419FC -_080417B4: - mov r4, r8 - ldr r0, [r4] - adds r0, 0x4E - movs r1, 0 - strb r1, [r0] - ldr r1, [r4] - adds r1, 0x4D - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r5, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r5, r0 - bge _08041806 - ldr r6, =0x02024210 -_080417D4: - ldrb r0, [r6] - ldr r2, =gUnknown_0832A328 - lsls r1, r5, 2 - adds r1, r2 - ldr r4, [r1] - ands r0, r4 - cmp r0, 0 - beq _080417FC - lsls r0, r5, 24 - lsrs r0, 24 - movs r1, 0x6 - movs r2, 0x6 - bl sub_80423F4 - lsls r0, 24 - cmp r0, 0 - bne _080417FC - ldrb r0, [r6] - bics r0, r4 - strb r0, [r6] -_080417FC: - adds r5, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r5, r0 - blt _080417D4 -_08041806: - ldr r0, =0x0202449c - mov r8, r0 - ldr r1, =0x0202420d - mov r12, r1 - ldr r2, =0x0202420c - mov r5, r8 - ldr r7, =0x02024084 - ldr r6, =0x0202406e -_08041816: - ldr r3, [r5] - adds r1, r3, 0 - adds r1, 0x4E - ldrb r0, [r1] - strb r0, [r2] - mov r4, r12 - strb r0, [r4] - ldrb r4, [r1] - movs r0, 0x58 - muls r0, r4 - adds r0, r7 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _0804185E - adds r0, r3, 0 - adds r0, 0xDF - ldrb r1, [r0] - ldr r3, =gUnknown_0832A328 - lsls r0, r4, 1 - adds r0, r6 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0804185E - ldr r0, =0x02024210 - ldrb r1, [r0] - lsls r0, r4, 2 - adds r0, r3 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0804185E - b _08041744 -_0804185E: - ldr r0, [r5] - adds r0, 0x4E - ldrb r1, [r0] - adds r1, 0x1 - strb r1, [r0] - ldr r0, =0x0202406c - lsls r1, 24 - lsrs r1, 24 - ldrb r0, [r0] - cmp r1, r0 - bne _08041816 - mov r1, r8 - ldr r0, [r1] - adds r0, 0x4D - movs r1, 0x3 - strb r1, [r0] - b _080419FC - .pool -_080418A0: - ldr r0, =0x0202420d - ldrb r0, [r0] - bl sub_803F9EC - ldr r2, =0x0202449c - ldr r1, [r2] - adds r1, 0x4E - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bne _080418D8 - ldr r0, [r2] - adds r0, 0x4D - movs r1, 0x3 - strb r1, [r0] - b _080419FA - .pool -_080418D8: - ldr r0, [r2] - adds r0, 0x4D - movs r1, 0x1 - strb r1, [r0] - b _080419FA -_080418E2: - mov r4, r8 - ldr r0, [r4] - adds r0, 0x4E - movs r1, 0 - strb r1, [r0] - ldr r1, [r4] - adds r1, 0x4D - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080418F6: - ldr r0, =0x0202420d - mov r12, r0 - ldr r7, =0x0202420c - ldr r5, =0x0202449c - ldr r2, =0x02024084 - ldr r6, =gUnknown_0832A328 -_08041902: - ldr r0, [r5] - adds r4, r0, 0 - adds r4, 0x4E - ldrb r0, [r4] - strb r0, [r7] - mov r1, r12 - strb r0, [r1] - ldrb r3, [r4] - movs r0, 0x58 - muls r0, r3 - adds r0, r2 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _08041930 - ldr r0, =0x02024210 - ldrb r1, [r0] - lsls r0, r3, 2 - adds r0, r6 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _08041930 - b _08041758 -_08041930: - adds r0, r3, 0x1 - strb r0, [r4] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bne _08041902 - b _08041978 - .pool -_08041960: - mov r1, r8 - ldr r0, [r1] - adds r0, 0x4E - ldrb r1, [r0] - adds r1, 0x1 - strb r1, [r0] - ldr r0, =0x0202406c - lsls r1, 24 - lsrs r1, 24 - ldrb r0, [r0] - cmp r1, r0 - bne _08041988 -_08041978: - mov r4, r8 - ldr r0, [r4] - adds r0, 0x4D - movs r1, 0x6 - strb r1, [r0] - b _080419FC - .pool -_08041988: - mov r1, r8 - ldr r0, [r1] - adds r0, 0x4D - movs r1, 0x4 - strb r1, [r0] - b _080419FC -_08041994: - movs r0, 0 - str r0, [sp] - movs r0, 0x9 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _080419AE - b _08041766 -_080419AE: - str r0, [sp] - movs r0, 0xB - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _080419C4 - b _08041766 -_080419C4: - movs r0, 0x1 - movs r1, 0 - movs r2, 0x1 - bl berry_effects_maybe - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _080419D8 - b _08041766 -_080419D8: - str r0, [sp] - movs r0, 0x6 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _080419EE - b _08041766 -_080419EE: - ldr r2, =0x0202449c - ldr r1, [r2] - adds r1, 0x4D - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080419FA: - mov r8, r2 -_080419FC: - mov r4, r8 - ldr r0, [r4] - adds r0, 0x4D - ldrb r0, [r0] - cmp r0, 0x7 - beq _08041A0A - b _08041774 -_08041A0A: - movs r0, 0 -_08041A0C: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8041728 - - thumb_func_start b_clear_atk_up_if_hit_flag_unless_enraged -b_clear_atk_up_if_hit_flag_unless_enraged: @ 8041A1C - push {r4-r6,lr} - movs r3, 0 - ldr r0, =0x0202406c - adds r5, r0, 0 - ldrb r0, [r5] - cmp r3, r0 - bge _08041A54 - ldr r4, =0x02024274 - movs r6, 0x80 - lsls r6, 16 - ldr r2, =0x020240d4 -_08041A32: - ldr r1, [r2] - adds r0, r1, 0 - ands r0, r6 - cmp r0, 0 - beq _08041A48 - ldrh r0, [r4] - cmp r0, 0x63 - beq _08041A48 - ldr r0, =0xff7fffff - ands r1, r0 - str r1, [r2] -_08041A48: - adds r4, 0x2 - adds r2, 0x58 - adds r3, 0x1 - ldrb r0, [r5] - cmp r3, r0 - blt _08041A32 -_08041A54: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end b_clear_atk_up_if_hit_flag_unless_enraged - - thumb_func_start sub_8041A6C -sub_8041A6C: @ 8041A6C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - movs r0, 0 - mov r9, r0 - ldr r1, =0x02024478 - mov r10, r1 - ldr r2, =0x0202449c - mov r8, r2 - b _08041A9A - .pool -_08041A90: - mov r3, r9 - cmp r3, 0 - beq _08041A9A - bl _08042388 -_08041A9A: - mov r4, r8 - ldr r0, [r4] - ldr r7, =0x000001a3 - adds r0, r7 - ldrb r0, [r0] - cmp r0, 0xE - bls _08041AAC - bl _08042376 -_08041AAC: - lsls r0, 2 - ldr r1, =_08041AC0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08041AC0: - .4byte _08041AFC - .4byte _08041B48 - .4byte _08041C90 - .4byte _08041D50 - .4byte _08041DC4 - .4byte _08041E40 - .4byte _08041EB8 - .4byte _08041F38 - .4byte _08041FC0 - .4byte _08042028 - .4byte _08042114 - .4byte _08042194 - .4byte _08042234 - .4byte _0804231C - .4byte _08042376 -_08041AFC: - ldr r1, =0x02024084 - ldr r3, =0x0202420b - ldrb r2, [r3] - movs r0, 0x58 - muls r2, r0 - adds r1, 0x50 - adds r2, r1 - ldr r0, [r2] - ldr r1, =0xfdffffff - ands r0, r1 - str r0, [r2] - ldr r0, =0x020242ac - ldrb r2, [r3] - lsls r2, 2 - adds r2, r0 - ldr r0, [r2] - ldr r1, =0xffffbfff - ands r0, r1 - str r0, [r2] - mov r1, r8 - ldr r0, [r1] - ldr r2, =0x000001a3 - adds r1, r0, r2 - bl _08042370 - .pool -_08041B48: - ldr r7, =0x02024084 - ldr r4, =0x0202420b - ldrb r1, [r4] - movs r5, 0x58 - adds r0, r1, 0 - muls r0, r5 - adds r6, r7, 0 - adds r6, 0x4C - adds r0, r6 - ldr r0, [r0] - movs r3, 0x7 - mov r8, r3 - ands r0, r3 - cmp r0, 0 - bne _08041B68 - b _08041C6E -_08041B68: - adds r0, r1, 0 - bl sub_8050650 - lsls r0, 24 - cmp r0, 0 - beq _08041BC8 - ldrb r0, [r4] - adds r2, r0, 0 - muls r2, r5 - adds r2, r6 - ldr r0, [r2] - movs r1, 0x8 - negs r1, r1 - ands r0, r1 - str r0, [r2] - ldrb r0, [r4] - adds r2, r0, 0 - muls r2, r5 - adds r0, r7, 0 - adds r0, 0x50 - adds r2, r0 - ldr r0, [r2] - ldr r1, =0xf7ffffff - ands r0, r1 - str r0, [r2] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB220 - str r0, [r1] - movs r4, 0x2 - mov r9, r4 - b _08041C6E - .pool -_08041BC8: - ldrb r0, [r4] - adds r1, r0, 0 - muls r1, r5 - adds r0, r1, r7 - adds r0, 0x20 - ldrb r0, [r0] - movs r3, 0x1 - cmp r0, 0x30 - bne _08041BDC - movs r3, 0x2 -_08041BDC: - adds r2, r1, r6 - ldr r1, [r2] - adds r0, r1, 0 - mov r7, r8 - ands r0, r7 - cmp r0, r3 - bcs _08041BF4 - movs r0, 0x8 - negs r0, r0 - ands r1, r0 - str r1, [r2] - b _08041BF8 -_08041BF4: - subs r0, r1, r3 - str r0, [r2] -_08041BF8: - ldr r2, =0x02024084 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - muls r1, r0 - adds r0, r2, 0 - adds r0, 0x4C - adds r0, r1, r0 - ldr r4, [r0] - movs r0, 0x7 - ands r4, r0 - cmp r4, 0 - beq _08041C50 - ldr r0, =0x020241ea - ldrh r0, [r0] - cmp r0, 0xAD - beq _08041C6E - cmp r0, 0xD6 - beq _08041C6E - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB213 - str r0, [r1] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 12 - orrs r0, r1 - str r0, [r2] - movs r0, 0x2 - mov r9, r0 - b _08041C6E - .pool -_08041C50: - adds r2, 0x50 - adds r2, r1, r2 - ldr r0, [r2] - ldr r1, =0xf7ffffff - ands r0, r1 - str r0, [r2] - bl b_movescr_stack_push_cursor - ldr r0, =0x02024332 - strb r4, [r0, 0x5] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB220 - str r0, [r1] - movs r1, 0x2 - mov r9, r1 -_08041C6E: - ldr r1, =0x0202449c - ldr r0, [r1] - ldr r3, =0x000001a3 - adds r2, r0, r3 - b _0804216A - .pool -_08041C90: - ldr r1, =0x02024084 - ldr r7, =0x0202420b - ldrb r0, [r7] - movs r6, 0x58 - muls r0, r6 - adds r5, r1, 0 - adds r5, 0x4C - adds r0, r5 - ldr r0, [r0] - movs r1, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08041D30 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x5 - bl __umodsi3 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - beq _08041D08 - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0x7D - bne _08041CD6 - b _08042162 -_08041CD6: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB26A - str r0, [r1] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 2 - orrs r0, r1 - str r0, [r2] - b _08041D28 - .pool -_08041D08: - ldrb r0, [r7] - adds r2, r0, 0 - muls r2, r6 - adds r2, r5 - ldr r0, [r2] - movs r1, 0x21 - negs r1, r1 - ands r0, r1 - str r0, [r2] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB277 - str r0, [r1] - ldr r0, =0x02024332 - strb r4, [r0, 0x5] -_08041D28: - movs r7, 0x2 - mov r9, r7 - ldr r0, =0x0202449c - mov r8, r0 -_08041D30: - mov r1, r8 - ldr r0, [r1] - ldr r2, =0x000001a3 - adds r1, r0, r2 - b _08042370 - .pool -_08041D50: - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x36 - beq _08041D66 - b _08042162 -_08041D66: - ldr r0, =0x020242bc - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x18] - lsls r0, 31 - cmp r0, 0 - bne _08041D7A - b _08042162 -_08041D7A: - adds r0, r2, 0 - bl b_cancel_multi_turn_move_maybe - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 12 - orrs r0, r1 - str r0, [r2] - ldr r1, =0x02024332 - movs r0, 0 - strb r0, [r1, 0x5] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB6AD - str r0, [r1] - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - b _0804215E - .pool -_08041DC4: - ldr r1, =0x02024084 - ldr r3, =0x0202420b - ldrb r2, [r3] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r2, r0, r1 - ldr r1, [r2] - movs r0, 0x80 - lsls r0, 15 - ands r0, r1 - cmp r0, 0 - beq _08041E10 - ldr r0, =0xffbfffff - ands r1, r0 - str r1, [r2] - ldr r2, =0x020242bc - ldrb r1, [r3] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strb r1, [r0, 0x19] - ldrb r0, [r3] - bl b_cancel_multi_turn_move_maybe - ldr r1, =0x02024214 - ldr r0, =gUnknown_082D9462 - str r0, [r1] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 12 - orrs r0, r1 - str r0, [r2] - movs r7, 0x1 - mov r9, r7 -_08041E10: - ldr r1, =0x0202449c - ldr r0, [r1] - ldr r3, =0x000001a3 - adds r2, r0, r3 - b _0804216A - .pool -_08041E40: - ldr r1, =0x02024084 - ldr r3, =0x0202420b - ldrb r2, [r3] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r2, r0, r1 - ldr r1, [r2] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _08041E8C - movs r0, 0x9 - negs r0, r0 - ands r1, r0 - str r1, [r2] - ldr r0, =0x0202433c - ldrb r2, [r3] - lsls r2, 4 - adds r2, r0 - ldrb r0, [r2, 0x2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2, 0x2] - ldrb r0, [r3] - bl b_cancel_multi_turn_move_maybe - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB29B - str r0, [r1] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 12 - orrs r0, r1 - str r0, [r2] - movs r4, 0x1 - mov r9, r4 -_08041E8C: - ldr r1, =0x0202449c - ldr r0, [r1] - ldr r7, =0x000001a3 - adds r2, r0, r7 - b _0804216A - .pool -_08041EB8: - ldr r0, =0x020242bc - ldr r3, =0x0202420b - ldrb r2, [r3] - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - ldr r0, =0x020241ea - ldrh r1, [r1, 0x4] - ldrh r0, [r0] - cmp r1, r0 - bne _08041F04 - cmp r1, 0 - beq _08041F04 - ldr r0, =0x0202433c - lsls r2, 4 - adds r2, r0 - ldrb r0, [r2, 0x1] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x1] - ldr r1, =0x02024474 - ldrb r0, [r3] - strb r0, [r1, 0x17] - ldrb r0, [r3] - bl b_cancel_multi_turn_move_maybe - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAE14 - str r0, [r1] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 12 - orrs r0, r1 - str r0, [r2] - movs r0, 0x1 - mov r9, r0 -_08041F04: - ldr r1, =0x0202449c - ldr r0, [r1] - ldr r3, =0x000001a3 - adds r2, r0, r3 - b _0804216A - .pool -_08041F38: - ldr r0, =0x020242bc - ldr r4, =0x0202420b - ldrb r3, [r4] - lsls r1, r3, 3 - subs r1, r3 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x13] - lsls r0, 28 - cmp r0, 0 - beq _08041F8C - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0 - bne _08041F8C - ldr r0, =0x0202433c - lsls r2, r3, 4 - adds r2, r0 - ldrb r0, [r2, 0x2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x2] - ldrb r0, [r4] - bl b_cancel_multi_turn_move_maybe - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB0A4 - str r0, [r1] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 12 - orrs r0, r1 - str r0, [r2] - movs r4, 0x1 - mov r9, r4 -_08041F8C: - ldr r1, =0x0202449c - ldr r0, [r1] - ldr r7, =0x000001a3 - adds r2, r0, r7 - b _0804216A - .pool -_08041FC0: - ldr r4, =0x0202420b - ldrb r0, [r4] - ldr r1, =0x020241ea - ldrh r1, [r1] - bl sub_8040130 - lsls r0, 24 - cmp r0, 0 - beq _08041FFE - ldr r0, =0x0202433c - ldrb r2, [r4] - lsls r2, 4 - adds r2, r0 - ldrb r0, [r2, 0x1] - movs r1, 0x20 - orrs r0, r1 - strb r0, [r2, 0x1] - ldrb r0, [r4] - bl b_cancel_multi_turn_move_maybe - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB176 - str r0, [r1] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 12 - orrs r0, r1 - str r0, [r2] - movs r0, 0x1 - mov r9, r0 -_08041FFE: - ldr r1, =0x0202449c - ldr r0, [r1] - ldr r3, =0x000001a3 - adds r2, r0, r3 - b _0804216A - .pool -_08042028: - ldr r7, =0x02024084 - ldr r5, =0x0202420b - ldrb r0, [r5] - movs r6, 0x58 - muls r0, r6 - adds r4, r7, 0 - adds r4, 0x50 - adds r2, r0, r4 - ldr r1, [r2] - movs r3, 0x7 - adds r0, r1, 0 - ands r0, r3 - cmp r0, 0 - beq _080420FA - subs r0, r1, 0x1 - str r0, [r2] - ldrb r0, [r5] - muls r0, r6 - adds r0, r4 - ldr r0, [r0] - ands r0, r3 - cmp r0, 0 - beq _080420E8 - bl GenerateRandomNumber - movs r1, 0x1 - movs r2, 0x1 - ands r2, r0 - cmp r2, 0 - beq _0804207C - ldr r1, =0x02024332 - movs r0, 0 - strb r0, [r1, 0x5] - bl b_movescr_stack_push_cursor - b _080420C6 - .pool -_0804207C: - ldr r0, =0x02024332 - movs r4, 0x1 - strb r1, [r0, 0x5] - ldr r1, =0x0202420c - ldrb r0, [r5] - strb r0, [r1] - ldrb r0, [r5] - adds r1, r0, 0 - muls r1, r6 - adds r1, r7 - movs r0, 0x28 - str r0, [sp] - str r2, [sp, 0x4] - ldrb r0, [r5] - str r0, [sp, 0x8] - ldrb r0, [r5] - str r0, [sp, 0xC] - adds r0, r1, 0 - movs r2, 0x1 - movs r3, 0 - bl sub_806957C - ldr r1, =0x020241f0 - str r0, [r1] - ldr r0, =0x0202433c - ldrb r1, [r5] - lsls r1, 4 - adds r1, r0 - ldrb r0, [r1, 0x1] - orrs r0, r4 - strb r0, [r1, 0x1] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 12 - orrs r0, r1 - str r0, [r2] -_080420C6: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB2BD - b _080420F0 - .pool -_080420E8: - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB300 -_080420F0: - str r0, [r1] - movs r4, 0x1 - mov r9, r4 - ldr r7, =0x0202449c - mov r8, r7 -_080420FA: - mov r1, r8 - ldr r0, [r1] - ldr r2, =0x000001a3 - adds r1, r0, r2 - b _08042370 - .pool -_08042114: - ldr r1, =0x02024084 - ldr r4, =0x0202420b - ldrb r2, [r4] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08042162 - bl GenerateRandomNumber - lsls r0, 16 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r0 - cmp r1, 0 - bne _08042162 - ldr r0, =0x0202433c - ldrb r2, [r4] - lsls r2, 4 - adds r2, r0 - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB28B - str r0, [r1] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 12 - orrs r0, r1 - str r0, [r2] -_0804215E: - movs r3, 0x1 - mov r9, r3 -_08042162: - ldr r1, =0x0202449c - ldr r0, [r1] - ldr r4, =0x000001a3 - adds r2, r0, r4 -_0804216A: - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - mov r8, r1 - b _08042376 - .pool -_08042194: - ldr r1, =0x02024084 - ldr r4, =0x0202420b - ldrb r2, [r4] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r1, [r0] - movs r0, 0xF0 - lsls r0, 12 - ands r1, r0 - cmp r1, 0 - beq _0804220E - lsrs r0, r1, 16 - bl sub_806F8A8 - ldr r1, =0x02024474 - strb r0, [r1, 0x17] - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _080421D8 - bl b_movescr_stack_push_cursor - b _08042200 - .pool -_080421D8: - ldr r0, =gUnknown_082DB334 - bl b_movescr_stack_push - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 12 - orrs r0, r1 - str r0, [r2] - ldr r0, =0x0202433c - ldrb r2, [r4] - lsls r2, 4 - adds r2, r0 - ldrb r0, [r2, 0x1] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2, 0x1] - ldrb r0, [r4] - bl b_cancel_multi_turn_move_maybe -_08042200: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB327 - str r0, [r1] - movs r7, 0x1 - mov r9, r7 - ldr r0, =0x0202449c - mov r8, r0 -_0804220E: - mov r1, r8 - ldr r0, [r1] - ldr r2, =0x000001a3 - adds r1, r0, r2 - b _08042370 - .pool -_08042234: - ldr r1, =0x02024084 - ldr r6, =0x0202420b - ldrb r0, [r6] - movs r5, 0x58 - muls r0, r5 - adds r1, 0x50 - adds r3, r0, r1 - ldr r2, [r3] - movs r4, 0xC0 - lsls r4, 2 - adds r0, r2, 0 - ands r0, r4 - cmp r0, 0 - beq _08042306 - ldr r7, =0xffffff00 - adds r0, r2, r7 - str r0, [r3] - ldrb r2, [r6] - adds r0, r2, 0 - muls r0, r5 - adds r0, r1 - ldr r0, [r0] - ands r0, r4 - cmp r0, 0 - beq _08042280 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAD71 - b _08042300 - .pool -_08042280: - ldr r3, =0x020241f8 - lsls r0, r2, 2 - adds r0, r3 - ldr r0, [r0] - cmp r0, 0 - beq _080422FC - ldr r1, =0x020241ea - movs r0, 0x75 - strh r0, [r1] - ldrb r0, [r6] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - lsls r0, 1 - mov r1, r10 - str r0, [r1] - ldr r4, =0x0202420c - ldr r1, =0x02024288 - ldrb r0, [r6] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r4] - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _080422CA - movs r0, 0x75 - movs r1, 0x1 - bl sub_80458E0 - strb r0, [r4] -_080422CA: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAD7C - str r0, [r1] - ldr r2, =0x0202449c - mov r8, r2 - b _08042302 - .pool -_080422FC: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DADC4 -_08042300: - str r0, [r1] -_08042302: - movs r3, 0x1 - mov r9, r3 -_08042306: - mov r4, r8 - ldr r0, [r4] - ldr r7, =0x000001a3 - adds r1, r0, r7 - b _08042370 - .pool -_0804231C: - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x4C - adds r4, r0, r1 - ldr r3, [r4] - movs r0, 0x20 - ands r0, r3 - cmp r0, 0 - beq _08042368 - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0x7D - bne _08042360 - movs r0, 0x21 - negs r0, r0 - ands r3, r0 - str r3, [r4] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB277 - str r0, [r1] - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] -_08042360: - movs r0, 0x2 - mov r9, r0 - ldr r1, =0x0202449c - mov r8, r1 -_08042368: - mov r2, r8 - ldr r0, [r2] - ldr r3, =0x000001a3 - adds r1, r0, r3 -_08042370: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_08042376: - mov r4, r8 - ldr r0, [r4] - ldr r7, =0x000001a3 - adds r0, r7 - ldrb r0, [r0] - cmp r0, 0xE - beq _08042388 - bl _08041A90 -_08042388: - mov r0, r9 - cmp r0, 0x2 - bne _080423B4 - ldr r4, =0x02024064 - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r4] - ldrb r1, [r4] - movs r0, 0x58 - muls r0, r1 - ldr r1, =0x020240d0 - adds r0, r1 - str r0, [sp] - movs r0, 0 - movs r1, 0x28 - movs r2, 0 - movs r3, 0x4 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_080423B4: - mov r0, r9 - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8041A6C - - thumb_func_start sub_80423F4 -sub_80423F4: @ 80423F4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08042424 - movs r0, 0 - b _080426A0 - .pool -_08042424: - movs r0, 0x80 - lsls r0, 15 - ands r0, r1 - cmp r0, 0 - beq _0804249C - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - ldr r1, =0x02024744 - mov r8, r1 - cmp r0, 0 - bne _08042442 - ldr r2, =0x020244ec - mov r8, r2 -_08042442: - movs r0, 0x2 - ands r0, r4 - lsls r0, 24 - lsrs r6, r0, 25 - lsls r0, r6, 1 - adds r4, r0, r6 - adds r0, r4, 0x3 - cmp r4, r0 - bge _0804248C - adds r7, r0, 0 -_08042456: - movs r0, 0x64 - muls r0, r4 - mov r1, r8 - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _08042486 - adds r0, r5, 0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - beq _08042486 - adds r0, r5, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - bne _0804248C -_08042486: - adds r4, 0x1 - cmp r4, r7 - blt _08042456 -_0804248C: - movs r1, 0 - lsls r0, r6, 1 - adds r0, r6 - b _08042556 - .pool -_0804249C: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0804256C - movs r0, 0x80 - lsls r0, 16 - ands r1, r0 - cmp r1, 0 - beq _080424E4 - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _080424D0 - ldr r2, =0x020244ec - mov r8, r2 - adds r0, r4, 0 - bl sub_806D864 - lsls r0, 24 - lsrs r7, r0, 24 - b _08042502 - .pool -_080424D0: - ldr r0, =0x02024744 - mov r8, r0 - movs r1, 0x1 - eors r1, r4 - negs r0, r1 - orrs r0, r1 - lsrs r6, r0, 31 - b _0804250C - .pool -_080424E4: - adds r0, r4, 0 - bl sub_806D864 - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - ldr r1, =0x02024744 - mov r8, r1 - cmp r0, 0 - bne _08042502 - ldr r2, =0x020244ec - mov r8, r2 -_08042502: - adds r0, r7, 0 - bl sub_806D82C - lsls r0, 24 - lsrs r6, r0, 24 -_0804250C: - lsls r0, r6, 1 - adds r4, r0, r6 - adds r1, r4, 0x3 - mov r9, r0 - cmp r4, r1 - bge _08042550 - adds r7, r1, 0 -_0804251A: - movs r0, 0x64 - muls r0, r4 - mov r1, r8 - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _0804254A - adds r0, r5, 0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - beq _0804254A - adds r0, r5, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - bne _08042550 -_0804254A: - adds r4, 0x1 - cmp r4, r7 - blt _0804251A -_08042550: - movs r1, 0 - mov r2, r9 - adds r0, r2, r6 -_08042556: - adds r0, 0x3 - cmp r4, r0 - bne _0804255E - movs r1, 0x1 -_0804255E: - adds r0, r1, 0 - b _080426A0 - .pool -_0804256C: - movs r0, 0x80 - lsls r0, 8 - ands r1, r0 - cmp r1, 0 - beq _080425DA - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080425DA - ldr r0, =0x02024744 - mov r8, r0 - movs r6, 0x3 - cmp r4, 0x1 - bne _08042590 - movs r6, 0 -_08042590: - adds r4, r6, 0 - adds r6, r4, 0x3 - b _0804259E - .pool -_0804259C: - adds r4, 0x1 -_0804259E: - cmp r4, r6 - bge _080425D2 - movs r0, 0x64 - muls r0, r4 - mov r1, r8 - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _0804259C - adds r0, r5, 0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - beq _0804259C - adds r0, r5, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _0804259C -_080425D2: - movs r0, 0 - cmp r4, r6 - bne _080426A0 - b _0804269E -_080425DA: - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08042608 - movs r0, 0x1 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r7, r0, 24 - movs r0, 0x3 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r6, r0, 24 - ldr r2, =0x02024744 - mov r8, r2 - b _08042620 - .pool -_08042608: - movs r0, 0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r7, r0, 24 - movs r0, 0x2 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x020244ec - mov r8, r0 -_08042620: - mov r1, r10 - cmp r1, 0x6 - bne _08042630 - ldr r1, =0x0202406e - lsls r0, r7, 1 - adds r0, r1 - ldrb r0, [r0] - mov r10, r0 -_08042630: - mov r2, r9 - cmp r2, 0x6 - bne _08042640 - ldr r1, =0x0202406e - lsls r0, r6, 1 - adds r0, r1 - ldrb r0, [r0] - mov r9, r0 -_08042640: - movs r4, 0 -_08042642: - movs r0, 0x64 - muls r0, r4 - mov r1, r8 - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _08042692 - adds r0, r5, 0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - beq _08042692 - adds r0, r5, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _08042692 - cmp r4, r10 - beq _08042692 - cmp r4, r9 - beq _08042692 - ldr r0, =0x0202449c - ldr r1, [r0] - adds r0, r7, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r4, r0 - beq _08042692 - adds r0, r6, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r4, r0 - bne _08042698 -_08042692: - adds r4, 0x1 - cmp r4, 0x5 - ble _08042642 -_08042698: - movs r0, 0 - cmp r4, 0x6 - bne _080426A0 -_0804269E: - movs r0, 0x1 -_080426A0: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80423F4 - - thumb_func_start castform_switch -castform_switch: @ 80426BC - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r6 - adds r4, r0, r1 - ldrh r1, [r4] - ldr r0, =0x00000181 - cmp r1, r0 - bne _08042760 - adds r0, r4, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x3B - bne _08042760 - ldrh r0, [r4, 0x28] - cmp r0, 0 - beq _08042760 - str r5, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - bne _0804270E - str r5, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0x4D - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _08042734 -_0804270E: - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0 - beq _08042734 - adds r1, r4, 0 - adds r1, 0x22 - ldrb r0, [r1] - cmp r0, 0 - beq _08042734 - strb r5, [r2] - strb r5, [r1] - movs r0, 0x1 - b _08042818 - .pool -_08042734: - movs r0, 0 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08042760 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0x4D - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _08042764 -_08042760: - movs r0, 0 - b _08042818 -_08042764: - ldr r1, =0x020243cc - ldrh r0, [r1] - movs r2, 0xE7 - ands r2, r0 - adds r4, r1, 0 - cmp r2, 0 - bne _08042792 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r6 - adds r1, r0, r1 - adds r3, r1, 0 - adds r3, 0x21 - ldrb r0, [r3] - cmp r0, 0 - beq _08042792 - adds r1, 0x22 - ldrb r0, [r1] - cmp r0, 0 - beq _08042792 - strb r2, [r3] - strb r2, [r1] - movs r5, 0x1 -_08042792: - ldrh r1, [r4] - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - beq _080427BE - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r6 - adds r1, r0, r1 - adds r2, r1, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0xA - beq _080427BE - adds r1, 0x22 - ldrb r0, [r1] - cmp r0, 0xA - beq _080427BE - movs r0, 0xA - strb r0, [r2] - strb r0, [r1] - movs r5, 0x2 -_080427BE: - ldrh r1, [r4] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - beq _080427EA - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r6 - adds r1, r0, r1 - adds r2, r1, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0xB - beq _080427EA - adds r1, 0x22 - ldrb r0, [r1] - cmp r0, 0xB - beq _080427EA - movs r0, 0xB - strb r0, [r2] - strb r0, [r1] - movs r5, 0x3 -_080427EA: - ldrh r1, [r4] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08042816 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r6 - adds r1, r0, r1 - adds r2, r1, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0xF - beq _08042816 - adds r1, 0x22 - ldrb r0, [r1] - cmp r0, 0xF - beq _08042816 - movs r0, 0xF - strb r0, [r2] - strb r0, [r1] - movs r5, 0x4 -_08042816: - adds r0, r5, 0 -_08042818: - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end castform_switch - - thumb_func_start ability_something -ability_something: @ 8042828 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x28 - ldr r4, [sp, 0x48] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - lsls r2, 24 - lsrs r6, r2, 24 - lsls r3, 24 - lsrs r3, 24 - mov r8, r3 - lsls r4, 16 - lsrs r4, 16 - movs r0, 0 - mov r9, r0 - ldr r5, =0x0202420b - ldr r1, =0x0202406c - ldrb r0, [r5] - ldrb r1, [r1] - cmp r0, r1 - bcc _08042864 - mov r1, r10 - strb r1, [r5] -_08042864: - ldrb r0, [r5] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08042894 - ldr r1, =0x0202406e - ldrb r0, [r5] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - b _080428A4 - .pool -_08042894: - ldr r1, =0x0202406e - ldrb r0, [r5] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 -_080428A4: - adds r7, r1, r0 - ldr r5, =0x0202420c - ldr r1, =0x0202406c - ldrb r0, [r5] - ldrb r1, [r1] - cmp r0, r1 - bcc _080428B6 - mov r2, r10 - strb r2, [r5] -_080428B6: - ldrb r0, [r5] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _080428E8 - ldr r1, =0x0202406e - ldrb r0, [r5] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - b _080428F8 - .pool -_080428E8: - ldr r1, =0x0202406e - ldrb r0, [r5] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 -_080428F8: - adds r5, r1, r0 - adds r0, r7, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x8] - adds r0, r7, 0 - movs r1, 0 - bl pokemon_getattr - str r0, [sp, 0x10] - adds r0, r5, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0xC] - adds r0, r5, 0 - movs r1, 0 - bl pokemon_getattr - str r0, [sp, 0x14] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0804293A - bl _0804443A -_0804293A: - mov r3, r8 - cmp r3, 0 - beq _08042958 - ldr r0, =0x0202420a - strb r3, [r0] - adds r7, r0, 0 - b _0804296E - .pool -_08042958: - ldr r2, =0x0202420a - ldr r1, =0x02024084 - movs r0, 0x58 - mov r5, r10 - muls r5, r0 - adds r0, r5, 0 - adds r0, r1 - adds r0, 0x20 - ldrb r0, [r0] - strb r0, [r2] - adds r7, r2, 0 -_0804296E: - cmp r4, 0 - beq _08042980 - adds r5, r4, 0 - b _08042984 - .pool -_08042980: - ldr r0, =0x020241ea - ldrh r5, [r0] -_08042984: - ldr r1, =0x0202449c - ldr r0, [r1] - ldrb r0, [r0, 0x13] - mov r8, r1 - cmp r0, 0 - beq _080429A0 - movs r3, 0x3F - ands r3, r0 - b _080429AC - .pool -_080429A0: - ldr r1, =gBattleMoves - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r3, [r0, 0x2] -_080429AC: - ldr r0, [sp, 0x4] - cmp r0, 0x13 - bls _080429B6 - bl _0804441E -_080429B6: - lsls r0, 2 - ldr r1, =_080429C8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080429C8: - .4byte _08042A18 - .4byte _08042CDC - .4byte _08042EF8 - .4byte _08042F8C - .4byte _080431AC - .4byte _08043908 - .4byte _08043C6C - .4byte _08043CBC - .4byte _08043D40 - .4byte _08043DC4 - .4byte _08043FE4 - .4byte _08043E08 - .4byte _08044028 - .4byte _08044084 - .4byte _080440E0 - .4byte _080441DC - .4byte _08044220 - .4byte _0804427C - .4byte _080443EC - .4byte _08044196 -_08042A18: - ldr r2, =0x0202420b - ldr r0, =0x0202406c - ldrb r1, [r2] - adds r5, r0, 0 - ldrb r3, [r5] - cmp r1, r3 - bcc _08042A2A - mov r0, r10 - strb r0, [r2] -_08042A2A: - ldrb r0, [r7] - cmp r0, 0x2D - bne _08042A32 - b _08042BA8 -_08042A32: - cmp r0, 0x2D - bgt _08042A64 - cmp r0, 0xD - bne _08042A3C - b _08042CA4 -_08042A3C: - cmp r0, 0xD - bgt _08042A54 - cmp r0, 0x2 - bne _08042A46 - b _08042B78 -_08042A46: - bl _0804441E - .pool -_08042A54: - cmp r0, 0x16 - bne _08042A5A - b _08042C08 -_08042A5A: - cmp r0, 0x24 - bne _08042A60 - b _08042C68 -_08042A60: - bl _0804441E -_08042A64: - cmp r0, 0x46 - bne _08042A6A - b _08042BD8 -_08042A6A: - cmp r0, 0x46 - bgt _08042A78 - cmp r0, 0x3B - bne _08042A74 - b _08042C3C -_08042A74: - bl _0804441E -_08042A78: - cmp r0, 0x4D - bne _08042A7E - b _08042CA4 -_08042A7E: - cmp r0, 0xFF - beq _08042A86 - bl _0804441E -_08042A86: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - bne _08042B4C - bl weather_get_current - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x3 - cmp r0, 0xA - bhi _08042B4C - lsls r0, 2 - ldr r1, =_08042AB4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08042AB4: - .4byte _08042AE0 - .4byte _08042B4C - .4byte _08042AE0 - .4byte _08042B4C - .4byte _08042B4C - .4byte _08042B04 - .4byte _08042B4C - .4byte _08042B4C - .4byte _08042B4C - .4byte _08042B28 - .4byte _08042AE0 -_08042AE0: - ldr r2, =0x020243cc - ldrh r1, [r2] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - bne _08042B4C - movs r0, 0x5 - strh r0, [r2] - ldr r1, =0x02024474 - movs r0, 0xA - strb r0, [r1, 0x10] - mov r2, r10 - strb r2, [r1, 0x17] - b _08042B42 - .pool -_08042B04: - ldr r3, =0x020243cc - ldrh r1, [r3] - movs r2, 0x18 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _08042B4C - strh r2, [r3] - ldr r1, =0x02024474 - movs r0, 0xC - strb r0, [r1, 0x10] - mov r3, r10 - strb r3, [r1, 0x17] - b _08042B42 - .pool -_08042B28: - ldr r3, =0x020243cc - ldrh r1, [r3] - movs r2, 0x60 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _08042B4C - strh r2, [r3] - ldr r1, =0x02024474 - movs r0, 0xB - strb r0, [r1, 0x10] - mov r5, r10 - strb r5, [r1, 0x17] -_08042B42: - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_08042B4C: - mov r0, r9 - cmp r0, 0 - bne _08042B56 - bl _0804443A -_08042B56: - bl weather_get_current - ldr r1, =0x02024332 - strb r0, [r1, 0x5] - ldr r0, =gUnknown_082DACE7 - bl b_push_move_exec - bl _0804441E - .pool -_08042B78: - ldr r2, =0x020243cc - ldrh r1, [r2] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08042B88 - bl _0804441E -_08042B88: - movs r0, 0x5 - strh r0, [r2] - ldr r0, =gUnknown_082DB430 - bl b_push_move_exec - ldr r0, =0x02024474 - mov r1, r10 - strb r1, [r0, 0x17] - bl _080443D0 - .pool -_08042BA8: - ldr r2, =0x020243cc - ldrh r1, [r2] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08042BB8 - bl _0804441E -_08042BB8: - movs r0, 0x18 - strh r0, [r2] - ldr r0, =gUnknown_082DB470 - bl b_push_move_exec - ldr r0, =0x02024474 - mov r2, r10 - strb r2, [r0, 0x17] - bl _080443D0 - .pool -_08042BD8: - ldr r2, =0x020243cc - ldrh r1, [r2] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08042BE8 - bl _0804441E -_08042BE8: - movs r0, 0x60 - strh r0, [r2] - ldr r0, =gUnknown_082DB52A - bl b_push_move_exec - ldr r0, =0x02024474 - mov r3, r10 - strb r3, [r0, 0x17] - bl _080443D0 - .pool -_08042C08: - ldr r0, =0x0202437c - mov r5, r10 - lsls r2, r5, 2 - adds r1, r2, r5 - lsls r1, 2 - adds r3, r1, r0 - ldrb r0, [r3] - lsls r0, 28 - cmp r0, 0 - bge _08042C20 - bl _0804441E -_08042C20: - ldr r1, =0x020242ac - adds r1, r2, r1 - ldr r0, [r1] - movs r2, 0x80 - lsls r2, 12 - orrs r0, r2 - str r0, [r1] - ldrb r0, [r3] - movs r1, 0x8 - b _08042C92 - .pool -_08042C3C: - mov r0, r10 - bl castform_switch - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - cmp r0, 0 - bne _08042C50 - bl _0804443A -_08042C50: - ldr r0, =gUnknown_082DB4A9 - bl b_push_move_exec - ldr r0, =0x02024474 - mov r1, r10 - strb r1, [r0, 0x17] - bl _080442E2 - .pool -_08042C68: - ldr r0, =0x0202437c - mov r3, r10 - lsls r2, r3, 2 - adds r1, r2, r3 - lsls r1, 2 - adds r3, r1, r0 - ldrb r0, [r3] - lsls r0, 27 - cmp r0, 0 - bge _08042C80 - bl _0804441E -_08042C80: - ldr r1, =0x020242ac - adds r1, r2, r1 - ldr r0, [r1] - movs r2, 0x80 - lsls r2, 13 - orrs r0, r2 - str r0, [r1] - ldrb r0, [r3] - movs r1, 0x10 -_08042C92: - orrs r0, r1 - strb r0, [r3] - bl _0804441E - .pool -_08042CA4: - movs r6, 0 - ldrb r5, [r5] - cmp r6, r5 - bcc _08042CB0 - bl _0804441E -_08042CB0: - adds r0, r6, 0 - bl castform_switch - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - cmp r0, 0 - beq _08042CC4 - bl _080442D8 -_08042CC4: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r6, r0 - bcc _08042CB0 - bl _0804441E - .pool -_08042CDC: - ldr r5, =0x02024084 - mov r8, r5 - movs r0, 0x58 - mov r6, r10 - muls r6, r0 - adds r4, r6, r5 - ldrh r0, [r4, 0x28] - cmp r0, 0 - bne _08042CF2 - bl _0804441E -_08042CF2: - ldr r0, =0x0202420b - mov r1, r10 - strb r1, [r0] - ldrb r5, [r7] - cmp r5, 0x2C - beq _08042D22 - cmp r5, 0x2C - bgt _08042D14 - cmp r5, 0x3 - bne _08042D08 - b _08042E84 -_08042D08: - bl _0804441E - .pool -_08042D14: - cmp r5, 0x36 - bne _08042D1A - b _08042ED0 -_08042D1A: - cmp r5, 0x3D - beq _08042DA0 - bl _0804441E -_08042D22: - movs r0, 0 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _08042D3E - bl _0804441E -_08042D3E: - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0x4D - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _08042D56 - bl _0804441E -_08042D56: - ldr r0, =0x020243cc - ldrh r1, [r0] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - bne _08042D66 - bl _0804441E -_08042D66: - ldrh r0, [r4, 0x2C] - ldrh r2, [r4, 0x28] - cmp r0, r2 - bhi _08042D72 - bl _0804441E -_08042D72: - strb r5, [r7] - ldr r0, =gUnknown_082DB45C - bl b_push_move_exec - ldr r1, =0x020241f0 - ldrh r0, [r4, 0x2C] - lsrs r0, 4 - str r0, [r1] - cmp r0, 0 - bne _08042D8A - movs r0, 0x1 - str r0, [r1] -_08042D8A: - ldr r0, [r1] - negs r0, r0 - str r0, [r1] - bl _080443D0 - .pool -_08042DA0: - mov r0, r8 - adds r0, 0x4C - adds r5, r6, r0 - ldrb r0, [r5] - cmp r0, 0 - bne _08042DB0 - bl _0804441E -_08042DB0: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - beq _08042DCA - bl _0804441E -_08042DCA: - ldr r0, [r5] - movs r1, 0x88 - ands r0, r1 - cmp r0, 0 - beq _08042DDC - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC70 - bl CopyString -_08042DDC: - ldr r0, [r5] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - beq _08042DEE - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC78 - bl CopyString -_08042DEE: - ldr r0, [r5] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08042E00 - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC80 - bl CopyString -_08042E00: - ldr r0, [r5] - movs r1, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08042E12 - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC88 - bl CopyString -_08042E12: - ldr r0, [r5] - movs r1, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08042E24 - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC90 - bl CopyString -_08042E24: - str r4, [r5] - mov r1, r8 - adds r1, 0x50 - adds r1, r6, r1 - ldr r0, [r1] - ldr r2, =0xf7ffffff - ands r0, r2 - str r0, [r1] - ldr r0, =0x02024474 - ldr r4, =0x02024064 - mov r3, r10 - strb r3, [r4] - strb r3, [r0, 0x17] - ldr r0, =gUnknown_082DB484 - bl b_push_move_exec - str r5, [sp] - movs r0, 0 - movs r1, 0x28 - movs r2, 0 - movs r3, 0x4 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - bl _080443D0 - .pool -_08042E84: - ldrb r2, [r4, 0x1B] - movs r0, 0x1B - ldrsb r0, [r4, r0] - cmp r0, 0xB - ble _08042E92 - bl _0804441E -_08042E92: - ldr r0, =0x020242bc - mov r5, r10 - lsls r1, r5, 3 - subs r1, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x16] - cmp r0, 0x2 - bne _08042EA8 - bl _0804441E -_08042EA8: - adds r0, r2, 0x1 - movs r1, 0 - strb r0, [r4, 0x1B] - ldr r4, =0x02024474 - movs r0, 0x11 - strb r0, [r4, 0x10] - strb r1, [r4, 0x11] - ldr r0, =gUnknown_082DB444 - bl b_push_move_exec - strb r5, [r4, 0x17] - bl _080443D0 - .pool -_08042ED0: - ldr r2, =0x020242bc - ldrb r0, [r0] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r3, [r1, 0x18] - lsls r0, r3, 31 - lsrs r0, 31 - movs r2, 0x1 - eors r2, r0 - movs r0, 0x2 - negs r0, r0 - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0x18] - bl _0804441E - .pool -_08042EF8: - ldrb r0, [r7] - cmp r0, 0x2B - beq _08042F02 - bl _0804441E -_08042F02: - movs r4, 0 - ldr r0, =gUnknown_0831BCF8 - ldrh r2, [r0] - ldr r3, =0x0000ffff - adds r1, r0, 0 - cmp r2, r3 - bne _08042F14 - bl _0804441E -_08042F14: - cmp r2, r5 - beq _08042F2C - adds r2, r1, 0 -_08042F1A: - adds r2, 0x2 - adds r4, 0x1 - ldrh r0, [r2] - cmp r0, r3 - bne _08042F28 - bl _0804441E -_08042F28: - cmp r0, r5 - bne _08042F1A -_08042F2C: - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _08042F3C - bl _0804441E -_08042F3C: - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 5 - ands r0, r1 - cmp r0, 0 - beq _08042F62 - ldr r0, =0x02024280 - ldr r1, [r0] - movs r2, 0x80 - lsls r2, 4 - orrs r1, r2 - str r1, [r0] -_08042F62: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB61F - str r0, [r1] - movs r0, 0x1 - mov r9, r0 - bl _08044424 - .pool -_08042F8C: - cmp r5, 0 - bne _08042F94 - bl _0804441E -_08042F94: - ldrb r0, [r7] - cmp r0, 0xB - beq _08043004 - cmp r0, 0xB - bgt _08042FA4 - cmp r0, 0xA - beq _08042FAA - b _08043126 -_08042FA4: - cmp r0, 0x12 - beq _0804305C - b _08043126 -_08042FAA: - cmp r3, 0xD - beq _08042FB0 - b _08043126 -_08042FB0: - ldr r0, =gBattleMoves - lsls r1, r5, 1 - adds r1, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - cmp r0, 0 - bne _08042FC2 - b _08043126 -_08042FC2: - ldr r1, =0x0202433c - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x2] - lsls r0, 28 - cmp r0, 0 - bge _08042FF0 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB56F - b _08042FF4 - .pool -_08042FF0: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB56E -_08042FF4: - str r0, [r1] - movs r1, 0x1 - b _08043124 - .pool -_08043004: - cmp r3, 0xB - beq _0804300A - b _08043126 -_0804300A: - ldr r0, =gBattleMoves - lsls r1, r5, 1 - adds r1, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - cmp r0, 0 - bne _0804301C - b _08043126 -_0804301C: - ldr r1, =0x0202433c - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x2] - lsls r0, 28 - cmp r0, 0 - bge _08043048 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB56F - b _0804304C - .pool -_08043048: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB56E -_0804304C: - str r0, [r1] - movs r2, 0x1 - mov r9, r2 - b _08043126 - .pool -_0804305C: - cmp r3, 0xA - bne _08043126 - ldr r1, =0x02024084 - movs r0, 0x58 - mov r3, r10 - muls r3, r0 - adds r0, r3, 0 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x20 - ands r0, r1 - cmp r0, 0 - bne _08043126 - ldr r2, =0x020244a8 - ldr r0, [r2] - ldr r0, [r0, 0x4] - mov r5, r10 - lsls r1, r5, 2 - adds r0, r1 - ldr r3, [r0] - movs r4, 0x1 - ands r3, r4 - adds r5, r1, 0 - cmp r3, 0 - bne _080430EC - ldr r0, =0x02024332 - strb r3, [r0, 0x5] - ldr r1, =0x0202433c - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x2] - lsls r0, 28 - cmp r0, 0 - bge _080430C8 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB5A8 - b _080430CC - .pool -_080430C8: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB5A7 -_080430CC: - str r0, [r1] - ldr r0, [r2] - ldr r1, [r0, 0x4] - adds r1, r5 - ldr r0, [r1] - movs r2, 0x1 - orrs r0, r2 - str r0, [r1] - movs r0, 0x2 - mov r9, r0 - b _08043126 - .pool -_080430EC: - ldr r0, =0x02024332 - strb r4, [r0, 0x5] - ldr r1, =0x0202433c - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x2] - lsls r0, 28 - cmp r0, 0 - bge _0804311C - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB5A8 - b _08043120 - .pool -_0804311C: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB5A7 -_08043120: - str r0, [r1] - movs r1, 0x2 -_08043124: - mov r9, r1 -_08043126: - mov r2, r9 - cmp r2, 0x1 - beq _08043130 - bl _0804441E -_08043130: - ldr r1, =0x02024084 - movs r0, 0x58 - mov r3, r10 - muls r3, r0 - adds r0, r3, 0 - adds r1, r0, r1 - ldrh r0, [r1, 0x2C] - ldrh r5, [r1, 0x28] - cmp r0, r5 - bne _0804318C - ldr r1, =0x0202433c - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x2] - lsls r0, 28 - cmp r0, 0 - bge _08043178 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB592 - str r0, [r1] - bl _0804441E - .pool -_08043178: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB591 - str r0, [r1] - bl _0804441E - .pool -_0804318C: - ldr r2, =0x020241f0 - ldrh r0, [r1, 0x2C] - lsrs r0, 2 - str r0, [r2] - cmp r0, 0 - bne _0804319C - mov r0, r9 - str r0, [r2] -_0804319C: - ldr r0, [r2] - negs r0, r0 - str r0, [r2] - bl _0804441E - .pool -_080431AC: - ldrb r0, [r7] - subs r0, 0x9 - cmp r0, 0x2F - bls _080431B8 - bl _0804441E -_080431B8: - lsls r0, 2 - ldr r1, =_080431C8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080431C8: - .4byte _080435E4 - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _08043288 - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _08043350 - .4byte _0804441E - .4byte _0804441E - .4byte _08043410 - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _08043508 - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _080436C0 - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804379C -_08043288: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _08043298 - bl _0804441E -_08043298: - cmp r5, 0xA5 - bne _080432A0 - bl _0804441E -_080432A0: - ldr r0, =gBattleMoves - lsls r1, r5, 1 - adds r1, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - cmp r0, 0 - bne _080432B4 - bl _0804441E -_080432B4: - ldr r2, =0x0202437c - ldr r0, =0x0202420c - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r1, r0, 2 - adds r0, r2, 0 - adds r0, 0x8 - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _080432DC - adds r0, r2, 0 - adds r0, 0xC - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _080432DC - bl _0804441E -_080432DC: - ldr r1, =0x02024084 - movs r0, 0x58 - mov r2, r10 - muls r2, r0 - adds r0, r2, 0 - adds r1, r0, r1 - adds r4, r1, 0 - adds r4, 0x21 - ldrb r0, [r4] - cmp r0, r3 - bne _080432F6 - bl _0804441E -_080432F6: - adds r2, r1, 0 - adds r2, 0x22 - ldrb r0, [r2] - cmp r0, r3 - bne _08043304 - bl _0804441E -_08043304: - ldrh r0, [r1, 0x28] - cmp r0, 0 - bne _0804330E - bl _0804441E -_0804330E: - strb r3, [r4] - strb r3, [r2] - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x3 - strb r0, [r1, 0x1] - strb r3, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x3] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB64D - str r0, [r1] - bl _080443D0 - .pool -_08043350: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _08043360 - bl _0804441E -_08043360: - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r3, r0, r1 - ldrh r0, [r3, 0x28] - cmp r0, 0 - bne _08043376 - bl _0804441E -_08043376: - ldr r0, =0x0202433c - lsls r1, r2, 4 - adds r1, r0 - ldrb r0, [r1, 0x1] - lsls r0, 31 - cmp r0, 0 - beq _08043388 - bl _0804441E -_08043388: - ldr r2, =0x0202437c - ldr r0, =0x0202420c - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r1, r0, 2 - adds r0, r2, 0 - adds r0, 0x8 - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _080433B0 - adds r0, r2, 0 - adds r0, 0xC - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _080433B0 - bl _0804441E -_080433B0: - ldr r1, =gBattleMoves - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x8] - movs r2, 0x1 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _080433CA - bl _0804441E -_080433CA: - ldr r1, =0x020241f0 - ldrh r0, [r3, 0x2C] - lsrs r0, 4 - str r0, [r1] - cmp r0, 0 - bne _080433D8 - str r2, [r1] -_080433D8: - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB654 - str r0, [r1] - bl _080443D0 - .pool -_08043410: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _08043420 - bl _0804441E -_08043420: - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _08043436 - bl _0804441E -_08043436: - ldr r0, =0x0202433c - lsls r1, r2, 4 - adds r1, r0 - ldrb r0, [r1, 0x1] - lsls r0, 31 - cmp r0, 0 - beq _08043448 - bl _0804441E -_08043448: - ldr r2, =0x0202437c - ldr r0, =0x0202420c - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r1, r0, 2 - adds r0, r2, 0 - adds r0, 0x8 - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08043470 - adds r0, r2, 0 - adds r0, 0xC - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08043470 - bl _0804441E -_08043470: - ldr r1, =gBattleMoves - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x8] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08043488 - bl _0804441E -_08043488: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - beq _080434A0 - bl _0804441E -_080434A0: - ldr r5, =0x02024332 - movs r4, 0x3 -_080434A4: - bl GenerateRandomNumber - ands r0, r4 - strb r0, [r5, 0x3] - cmp r0, 0 - beq _080434A4 - ldr r1, =0x02024332 - ldrb r0, [r1, 0x3] - cmp r0, 0x3 - bne _080434BC - adds r0, 0x2 - strb r0, [r1, 0x3] -_080434BC: - ldrb r0, [r1, 0x3] - adds r0, 0x40 - strb r0, [r1, 0x3] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB67C - str r0, [r1] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 6 - orrs r0, r1 - str r0, [r2] - bl _080443D0 - .pool -_08043508: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _08043518 - bl _0804441E -_08043518: - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _0804352E - bl _0804441E -_0804352E: - ldr r0, =0x0202433c - lsls r1, r2, 4 - adds r1, r0 - ldrb r0, [r1, 0x1] - lsls r0, 31 - cmp r0, 0 - beq _08043540 - bl _0804441E -_08043540: - ldr r2, =0x0202437c - ldr r0, =0x0202420c - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r1, r0, 2 - adds r0, r2, 0 - adds r0, 0x8 - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08043568 - adds r0, r2, 0 - adds r0, 0xC - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08043568 - bl _0804441E -_08043568: - ldr r1, =gBattleMoves - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x8] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08043580 - bl _0804441E -_08043580: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - beq _08043598 - bl _0804441E -_08043598: - ldr r1, =0x02024332 - movs r0, 0x42 - strb r0, [r1, 0x3] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB67C - str r0, [r1] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 6 - orrs r0, r1 - str r0, [r2] - bl _080443D0 - .pool -_080435E4: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _080435F4 - bl _0804441E -_080435F4: - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _0804360A - bl _0804441E -_0804360A: - ldr r0, =0x0202433c - lsls r1, r2, 4 - adds r1, r0 - ldrb r0, [r1, 0x1] - lsls r0, 31 - cmp r0, 0 - beq _0804361C - bl _0804441E -_0804361C: - ldr r2, =0x0202437c - ldr r0, =0x0202420c - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r1, r0, 2 - adds r0, r2, 0 - adds r0, 0x8 - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08043644 - adds r0, r2, 0 - adds r0, 0xC - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08043644 - bl _0804441E -_08043644: - ldr r1, =gBattleMoves - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x8] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0804365C - bl _0804441E -_0804365C: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - beq _08043674 - bl _0804441E -_08043674: - ldr r1, =0x02024332 - movs r0, 0x45 - strb r0, [r1, 0x3] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB67C - str r0, [r1] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 6 - orrs r0, r1 - str r0, [r2] - bl _080443D0 - .pool -_080436C0: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _080436D0 - bl _0804441E -_080436D0: - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _080436E6 - bl _0804441E -_080436E6: - ldr r0, =0x0202433c - lsls r1, r2, 4 - adds r1, r0 - ldrb r0, [r1, 0x1] - lsls r0, 31 - cmp r0, 0 - beq _080436F8 - bl _0804441E -_080436F8: - ldr r1, =gBattleMoves - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x8] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08043710 - bl _0804441E -_08043710: - ldr r2, =0x0202437c - ldr r0, =0x0202420c - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r1, r0, 2 - adds r0, r2, 0 - adds r0, 0x8 - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08043738 - adds r0, r2, 0 - adds r0, 0xC - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08043738 - bl _0804441E -_08043738: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - beq _08043750 - bl _0804441E -_08043750: - ldr r1, =0x02024332 - movs r0, 0x43 - strb r0, [r1, 0x3] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB67C - str r0, [r1] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 6 - orrs r0, r1 - str r0, [r2] - bl _080443D0 - .pool -_0804379C: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _080437AC - bl _0804441E -_080437AC: - ldr r6, =0x02024084 - ldr r3, =0x0202420b - mov r8, r3 - ldrb r1, [r3] - movs r7, 0x58 - adds r0, r1, 0 - muls r0, r7 - adds r0, r6 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _080437C6 - bl _0804441E -_080437C6: - ldr r0, =0x0202433c - lsls r1, 4 - adds r1, r0 - ldrb r0, [r1, 0x1] - lsls r0, 31 - cmp r0, 0 - beq _080437D8 - bl _0804441E -_080437D8: - ldr r1, =gBattleMoves - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x8] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080437F0 - bl _0804441E -_080437F0: - ldr r3, =0x0202437c - ldr r5, =0x0202420c - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r2, r0, 2 - adds r0, r3, 0 - adds r0, 0x8 - adds r0, r2, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08043818 - adds r0, r3, 0 - adds r0, 0xC - adds r0, r2, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08043818 - bl _0804441E -_08043818: - adds r0, r1, 0 - muls r0, r7 - adds r0, r6 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _08043828 - bl _0804441E -_08043828: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - beq _08043840 - bl _0804441E -_08043840: - mov r1, r8 - ldrb r0, [r1] - muls r0, r7 - adds r0, r6 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0xC - bne _08043854 - bl _0804441E -_08043854: - ldr r0, [sp, 0x8] - ldr r1, [sp, 0x10] - bl pokemon_species_get_gender_info - adds r4, r0, 0 - ldr r0, [sp, 0xC] - ldr r1, [sp, 0x14] - bl pokemon_species_get_gender_info - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - bne _08043872 - bl _0804441E -_08043872: - mov r2, r8 - ldrb r0, [r2] - muls r0, r7 - adds r4, r6, 0 - adds r4, 0x50 - adds r0, r4 - ldr r0, [r0] - movs r1, 0xF0 - lsls r1, 12 - ands r0, r1 - cmp r0, 0 - beq _0804388E - bl _0804441E -_0804388E: - ldr r0, [sp, 0x8] - ldr r1, [sp, 0x10] - bl pokemon_species_get_gender_info - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _080438A2 - bl _0804441E -_080438A2: - ldr r0, [sp, 0xC] - ldr r1, [sp, 0x14] - bl pokemon_species_get_gender_info - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _080438B6 - bl _0804441E -_080438B6: - mov r3, r8 - ldrb r0, [r3] - adds r2, r0, 0 - muls r2, r7 - adds r2, r4 - ldr r1, =gUnknown_0832A328 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - lsls r1, 16 - ldr r0, [r2] - orrs r0, r1 - str r0, [r2] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB66F - str r0, [r1] - bl _080443D0 - .pool -_08043908: - movs r5, 0 - mov r10, r5 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r10, r0 - bcc _08043918 - bl _0804441E -_08043918: - ldr r1, =0x02024084 - movs r0, 0x58 - mov r2, r10 - muls r2, r0 - adds r0, r2, 0 - adds r0, r1 - adds r0, 0x20 - ldrb r0, [r0] - subs r0, 0x7 - adds r2, r1, 0 - cmp r0, 0x41 - bls _08043932 - b _08043B96 -_08043932: - lsls r0, 2 - ldr r1, =_08043948 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08043948: - .4byte _08043AAC - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B70 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043AD4 - .4byte _08043B96 - .4byte _08043A50 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043A7C - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B40 - .4byte _08043B10 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043AD4 -_08043A50: - movs r0, 0x58 - mov r3, r10 - muls r3, r0 - adds r0, r3, 0 - adds r1, r2, 0 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x00000f88 - ands r0, r1 - cmp r0, 0 - bne _08043A6A - b _08043B96 -_08043A6A: - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC70 - b _08043B5C - .pool -_08043A7C: - movs r0, 0x58 - mov r1, r10 - muls r1, r0 - adds r0, r1, 0 - adds r1, r2, 0 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - bne _08043A96 - b _08043B96 -_08043A96: - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC98 - bl CopyString - movs r2, 0x2 - mov r9, r2 - b _08043B9C - .pool -_08043AAC: - movs r0, 0x58 - mov r3, r10 - muls r3, r0 - adds r0, r3, 0 - adds r1, r2, 0 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08043B96 - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC80 - b _08043B5C - .pool -_08043AD4: - movs r0, 0x58 - mov r3, r10 - muls r3, r0 - adds r0, r2, 0 - adds r0, 0x4C - adds r0, r3, r0 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - beq _08043B96 - adds r2, 0x50 - adds r2, r3, r2 - ldr r0, [r2] - ldr r1, =0xf7ffffff - ands r0, r1 - str r0, [r2] - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC78 - bl CopyString - movs r0, 0x1 - mov r9, r0 - b _08043B9C - .pool -_08043B10: - movs r0, 0x58 - mov r1, r10 - muls r1, r0 - adds r0, r1, 0 - adds r1, r2, 0 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08043B96 - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC88 - bl CopyString - movs r2, 0x1 - mov r9, r2 - b _08043B9C - .pool -_08043B40: - movs r0, 0x58 - mov r3, r10 - muls r3, r0 - adds r0, r3, 0 - adds r1, r2, 0 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08043B96 - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC90 -_08043B5C: - bl CopyString - movs r5, 0x1 - mov r9, r5 - b _08043B9C - .pool -_08043B70: - movs r0, 0x58 - mov r1, r10 - muls r1, r0 - adds r0, r1, 0 - adds r1, r2, 0 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0xF0 - lsls r1, 12 - ands r0, r1 - cmp r0, 0 - beq _08043B96 - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BCA0 - bl CopyString - movs r2, 0x3 - mov r9, r2 -_08043B96: - mov r3, r9 - cmp r3, 0 - beq _08043C50 -_08043B9C: - mov r5, r9 - cmp r5, 0x2 - beq _08043BD0 - cmp r5, 0x2 - bgt _08043BB4 - cmp r5, 0x1 - beq _08043BBC - b _08043BFC - .pool -_08043BB4: - mov r0, r9 - cmp r0, 0x3 - beq _08043BE8 - b _08043BFC -_08043BBC: - ldr r1, =0x02024084 - movs r0, 0x58 - mov r2, r10 - muls r2, r0 - adds r1, 0x4C - adds r2, r1 - movs r0, 0 - b _08043BFA - .pool -_08043BD0: - ldr r1, =0x02024084 - movs r0, 0x58 - mov r2, r10 - muls r2, r0 - adds r1, 0x50 - adds r2, r1 - ldr r0, [r2] - movs r1, 0x8 - negs r1, r1 - b _08043BF8 - .pool -_08043BE8: - ldr r1, =0x02024084 - movs r0, 0x58 - mov r2, r10 - muls r2, r0 - adds r1, 0x50 - adds r2, r1 - ldr r0, [r2] - ldr r1, =0xfff0ffff -_08043BF8: - ands r0, r1 -_08043BFA: - str r0, [r2] -_08043BFC: - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB68C - str r0, [r1] - ldr r0, =0x02024474 - mov r1, r10 - strb r1, [r0, 0x17] - ldr r4, =0x02024064 - strb r1, [r4] - ldrb r1, [r4] - movs r0, 0x58 - muls r0, r1 - ldr r1, =0x020240d0 - adds r0, r1 - str r0, [sp] - movs r0, 0 - movs r1, 0x28 - movs r2, 0 - movs r3, 0x4 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - bl _0804443A - .pool -_08043C50: - mov r0, r10 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r10, r0 - bcs _08043C64 - b _08043918 -_08043C64: - bl _0804441E - .pool -_08043C6C: - movs r2, 0 - mov r10, r2 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r10, r0 - bcc _08043C7A - b _0804441E -_08043C7A: - ldr r4, =0x02024084 -_08043C7C: - movs r0, 0x58 - mov r3, r10 - muls r3, r0 - adds r0, r3, 0 - adds r0, r4 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x3B - bne _08043CA0 - mov r0, r10 - bl castform_switch - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - cmp r0, 0 - beq _08043CA0 - b _080442FC -_08043CA0: - mov r0, r10 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r10, r0 - bcc _08043C7C - b _0804441E - .pool -_08043CBC: - ldrb r0, [r7] - cmp r0, 0x1C - beq _08043CC4 - b _0804441E -_08043CC4: - ldr r4, =0x02024280 - ldr r1, [r4] - movs r0, 0x80 - lsls r0, 7 - ands r0, r1 - cmp r0, 0 - bne _08043CD4 - b _0804441E -_08043CD4: - ldr r0, =0xffffbfff - ands r1, r0 - str r1, [r4] - mov r5, r8 - ldr r1, [r5] - adds r1, 0xB2 - ldrb r2, [r1] - movs r0, 0x3F - ands r0, r2 - strb r0, [r1] - ldr r0, [r5] - adds r1, r0, 0 - adds r1, 0xB2 - ldrb r0, [r1] - cmp r0, 0x6 - bne _08043CF8 - movs r0, 0x2 - strb r0, [r1] -_08043CF8: - ldr r1, =0x02024332 - mov r2, r8 - ldr r0, [r2] - adds r0, 0xB2 - ldrb r0, [r0] - adds r0, 0x40 - strb r0, [r1, 0x3] - ldr r1, =0x02024474 - ldr r0, =0x0202420c - ldrb r0, [r0] - strb r0, [r1, 0x17] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB67F - str r0, [r1] - ldr r0, [r4] - movs r1, 0x80 - lsls r1, 6 - orrs r0, r1 - str r0, [r4] - b _080443D0 - .pool -_08043D40: - ldrb r0, [r7] - cmp r0, 0x1C - beq _08043D48 - b _0804441E -_08043D48: - ldr r4, =0x02024280 - ldr r1, [r4] - movs r0, 0x80 - lsls r0, 7 - ands r0, r1 - cmp r0, 0 - bne _08043D58 - b _0804441E -_08043D58: - ldr r0, =0xffffbfff - ands r1, r0 - str r1, [r4] - mov r3, r8 - ldr r1, [r3] - adds r1, 0xB2 - ldrb r2, [r1] - movs r0, 0x3F - ands r0, r2 - strb r0, [r1] - ldr r0, [r3] - adds r1, r0, 0 - adds r1, 0xB2 - ldrb r0, [r1] - cmp r0, 0x6 - bne _08043D7C - movs r0, 0x2 - strb r0, [r1] -_08043D7C: - ldr r1, =0x02024332 - mov r3, r8 - ldr r0, [r3] - adds r0, 0xB2 - ldrb r0, [r0] - strb r0, [r1, 0x3] - ldr r1, =0x02024474 - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r1, 0x17] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB67F - str r0, [r1] - ldr r0, [r4] - movs r1, 0x80 - lsls r1, 6 - orrs r0, r1 - str r0, [r4] - b _080443D0 - .pool -_08043DC4: - movs r4, 0 - ldr r0, =0x0202406c - ldrb r1, [r0] - cmp r4, r1 - blt _08043DD0 - b _0804441E -_08043DD0: - ldr r0, =0x02024084 - adds r5, r1, 0 - ldr r2, =0x020242ac - adds r3, r0, 0 - adds r3, 0x20 - movs r6, 0x80 - lsls r6, 12 -_08043DDE: - ldrb r1, [r3] - cmp r1, 0x16 - bne _08043DEE - ldr r0, [r2] - ands r0, r6 - cmp r0, 0 - beq _08043DEE - b _08044324 -_08043DEE: - adds r2, 0x4 - adds r3, 0x58 - adds r4, 0x1 - cmp r4, r5 - blt _08043DDE - b _0804441E - .pool -_08043E08: - movs r4, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _08043E14 - b _0804441E -_08043E14: - ldr r5, =0x02024064 - mov r8, r5 - ldr r0, =0x02024084 - adds r0, 0x20 - str r0, [sp, 0x1C] - movs r1, 0 - str r1, [sp, 0x20] -_08043E22: - ldr r2, [sp, 0x1C] - ldrb r0, [r2] - cmp r0, 0x24 - beq _08043E2C - b _08043FBE -_08043E2C: - ldr r0, =0x020242ac - ldr r3, [sp, 0x20] - adds r0, r3, r0 - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 13 - ands r1, r0 - str r3, [sp, 0x18] - cmp r1, 0 - bne _08043E42 - b _08043FBE -_08043E42: - lsls r0, r4, 24 - lsrs r0, 24 - bl battle_get_per_side_status - movs r1, 0x1 - adds r5, r0, 0 - eors r5, r1 - ands r5, r1 - adds r0, r5, 0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r5, 0x2 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r2, 0x1 - ands r0, r2 - cmp r0, 0 - bne _08043E74 - b _08043F84 -_08043E74: - movs r1, 0x58 - adds r0, r6, 0 - muls r0, r1 - ldr r3, =0x02024084 - adds r1, r0, r3 - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0 - beq _08043F40 - ldrh r0, [r1, 0x28] - cmp r0, 0 - beq _08043EFC - movs r1, 0x58 - adds r0, r7, 0 - muls r0, r1 - adds r1, r0, r3 - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0 - beq _08043EFC - ldrh r0, [r1, 0x28] - cmp r0, 0 - beq _08043EFC - str r2, [sp, 0x24] - bl GenerateRandomNumber - ldr r2, [sp, 0x24] - adds r1, r2, 0 - ands r1, r0 - lsls r1, 1 - orrs r5, r1 - adds r0, r5, 0 - bl battle_get_side_with_given_state - mov r2, r8 - strb r0, [r2] - ldrb r0, [r2] - movs r3, 0x58 - muls r0, r3 - ldr r5, =0x02024084 - adds r0, r5 - adds r0, 0x20 - ldrb r0, [r0] - ldr r1, [sp, 0x1C] - strb r0, [r1] - ldrb r0, [r2] - muls r0, r3 - adds r0, r5 - adds r0, 0x20 - ldrb r0, [r0] - ldr r2, =0x0202420a - strb r0, [r2] - b _08043FAC - .pool -_08043EFC: - ldr r3, =0x02024084 - movs r2, 0x58 - adds r0, r6, 0 - muls r0, r2 - adds r1, r0, r3 - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0 - beq _08043F40 - ldrh r0, [r1, 0x28] - cmp r0, 0 - beq _08043F40 - mov r5, r8 - strb r6, [r5] - adds r1, r4, 0 - muls r1, r2 - adds r1, r3 - ldrb r0, [r5] - muls r0, r2 - adds r0, r3 - adds r0, 0x20 - ldrb r0, [r0] - adds r1, 0x20 - strb r0, [r1] - ldrb r0, [r5] - muls r0, r2 - adds r0, r3 - adds r0, 0x20 - ldrb r0, [r0] - b _08043FA8 - .pool -_08043F40: - ldr r3, =0x02024084 - movs r2, 0x58 - adds r0, r7, 0 - muls r0, r2 - adds r1, r0, r3 - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0 - beq _08043FB6 - ldrh r0, [r1, 0x28] - cmp r0, 0 - beq _08043FB6 - mov r5, r8 - strb r7, [r5] - adds r1, r4, 0 - muls r1, r2 - adds r1, r3 - ldrb r0, [r5] - muls r0, r2 - adds r0, r3 - adds r0, 0x20 - ldrb r0, [r0] - adds r1, 0x20 - strb r0, [r1] - ldrb r0, [r5] - muls r0, r2 - adds r0, r3 - adds r0, 0x20 - ldrb r0, [r0] - b _08043FA8 - .pool -_08043F84: - mov r2, r8 - strb r6, [r2] - movs r3, 0x58 - adds r0, r6, 0 - muls r0, r3 - ldr r5, =0x02024084 - adds r0, r5 - adds r2, r0, 0 - adds r2, 0x20 - ldrb r1, [r2] - cmp r1, 0 - beq _08043FB6 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _08043FB6 - ldr r0, [sp, 0x1C] - strb r1, [r0] - ldrb r0, [r2] -_08043FA8: - ldr r1, =0x0202420a - strb r0, [r1] -_08043FAC: - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_08043FB6: - mov r2, r9 - cmp r2, 0 - beq _08043FBE - b _08044340 -_08043FBE: - ldr r3, [sp, 0x1C] - adds r3, 0x58 - str r3, [sp, 0x1C] - ldr r5, [sp, 0x20] - adds r5, 0x4 - str r5, [sp, 0x20] - adds r4, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - bge _08043FD6 - b _08043E22 -_08043FD6: - b _0804441E - .pool -_08043FE4: - movs r4, 0 - ldr r0, =0x0202406c - ldrb r1, [r0] - cmp r4, r1 - blt _08043FF0 - b _0804441E -_08043FF0: - ldr r0, =0x02024084 - adds r5, r1, 0 - ldr r2, =0x020242ac - adds r3, r0, 0 - adds r3, 0x20 - movs r6, 0x80 - lsls r6, 12 -_08043FFE: - ldrb r1, [r3] - cmp r1, 0x16 - bne _0804400E - ldr r0, [r2] - ands r0, r6 - cmp r0, 0 - beq _0804400E - b _080443B4 -_0804400E: - adds r2, 0x4 - adds r3, 0x58 - adds r4, 0x1 - cmp r4, r5 - blt _08043FFE - b _0804441E - .pool -_08044028: - mov r0, r10 - bl battle_side_get_owner - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _0804403E - b _0804441E -_0804403E: - ldr r7, =0x02024084 -_08044040: - lsls r0, r4, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - adds r3, r4, 0x1 - cmp r0, r5 - beq _0804406A - movs r0, 0x58 - muls r0, r4 - adds r0, r7 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, r6 - bne _0804406A - ldr r0, =0x0202420a - strb r6, [r0] - lsls r0, r3, 24 - lsrs r0, 24 - mov r9, r0 -_0804406A: - adds r4, r3, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _08044040 - b _0804441E - .pool -_08044084: - mov r0, r10 - bl battle_side_get_owner - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _0804409A - b _0804441E -_0804409A: - ldr r7, =0x02024084 -_0804409C: - lsls r0, r4, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - adds r3, r4, 0x1 - cmp r0, r5 - bne _080440C6 - movs r0, 0x58 - muls r0, r4 - adds r0, r7 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, r6 - bne _080440C6 - ldr r0, =0x0202420a - strb r6, [r0] - lsls r0, r3, 24 - lsrs r0, 24 - mov r9, r0 -_080440C6: - adds r4, r3, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _0804409C - b _0804441E - .pool -_080440E0: - ldrb r0, [r7] - cmp r0, 0xFD - beq _08044104 - cmp r0, 0xFE - beq _0804413C - movs r4, 0 - ldr r0, =0x0202406c - adds r5, r0, 0 - ldrb r0, [r5] - cmp r4, r0 - blt _080440F8 - b _0804441E -_080440F8: - ldr r2, =0x02024084 - b _08044174 - .pool -_08044104: - movs r4, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _08044110 - b _0804441E -_08044110: - ldr r5, =0x020242ac - movs r2, 0x80 - lsls r2, 9 - adds r1, r0, 0 -_08044118: - lsls r0, r4, 2 - adds r0, r5 - ldr r0, [r0] - ands r0, r2 - adds r3, r4, 0x1 - cmp r0, 0 - beq _0804412C - lsls r0, r3, 24 - lsrs r0, 24 - mov r9, r0 -_0804412C: - adds r4, r3, 0 - cmp r4, r1 - blt _08044118 - b _0804441E - .pool -_0804413C: - movs r4, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _08044148 - b _0804441E -_08044148: - ldr r5, =0x020242ac - movs r2, 0x80 - lsls r2, 10 - adds r1, r0, 0 -_08044150: - lsls r0, r4, 2 - adds r0, r5 - ldr r0, [r0] - ands r0, r2 - adds r3, r4, 0x1 - cmp r0, 0 - beq _08044164 - lsls r0, r3, 24 - lsrs r0, 24 - mov r9, r0 -_08044164: - adds r4, r3, 0 - cmp r4, r1 - blt _08044150 - b _0804441E - .pool -_08044174: - movs r0, 0x58 - muls r0, r4 - adds r0, r2 - adds r0, 0x20 - ldrb r0, [r0] - adds r3, r4, 0x1 - cmp r0, r6 - bne _0804418C - strb r6, [r7] - lsls r0, r3, 24 - lsrs r0, 24 - mov r9, r0 -_0804418C: - adds r4, r3, 0 - ldrb r1, [r5] - cmp r4, r1 - blt _08044174 - b _0804441E -_08044196: - movs r4, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _080441A2 - b _0804441E -_080441A2: - ldr r2, =0x02024084 - mov r8, r2 - adds r2, r0, 0 - movs r5, 0x58 -_080441AA: - adds r0, r4, 0 - muls r0, r5 - mov r3, r8 - adds r1, r0, r3 - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - adds r3, r4, 0x1 - cmp r0, r6 - bne _080441CC - ldrh r0, [r1, 0x28] - cmp r0, 0 - beq _080441CC - strb r6, [r7] - lsls r0, r3, 24 - lsrs r0, 24 - mov r9, r0 -_080441CC: - adds r4, r3, 0 - cmp r4, r2 - blt _080441AA - b _0804441E - .pool -_080441DC: - movs r4, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _080441E8 - b _0804441E -_080441E8: - ldr r7, =0x02024084 - adds r1, r0, 0 - movs r5, 0x58 - ldr r2, =0x0202420a -_080441F0: - adds r0, r4, 0 - muls r0, r5 - adds r0, r7 - adds r0, 0x20 - ldrb r0, [r0] - adds r3, r4, 0x1 - cmp r0, r6 - bne _0804420C - cmp r4, r10 - beq _0804420C - strb r6, [r2] - lsls r0, r3, 24 - lsrs r0, 24 - mov r9, r0 -_0804420C: - adds r4, r3, 0 - cmp r4, r1 - blt _080441F0 - b _0804441E - .pool -_08044220: - mov r0, r10 - bl battle_side_get_owner - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _08044236 - b _0804441E -_08044236: - ldr r7, =0x02024084 -_08044238: - lsls r0, r4, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, r5 - beq _08044264 - movs r0, 0x58 - muls r0, r4 - adds r0, r7 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, r6 - bne _08044264 - ldr r0, =0x0202420a - strb r6, [r0] - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_08044264: - adds r4, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _08044238 - b _0804441E - .pool -_0804427C: - mov r0, r10 - bl battle_side_get_owner - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _08044292 - b _0804441E -_08044292: - ldr r7, =0x02024084 -_08044294: - lsls r0, r4, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, r5 - bne _080442C0 - movs r0, 0x58 - muls r0, r4 - adds r0, r7 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, r6 - bne _080442C0 - ldr r0, =0x0202420a - strb r6, [r0] - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_080442C0: - adds r4, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _08044294 - b _0804441E - .pool -_080442D8: - ldr r0, =gUnknown_082DB4A9 - bl b_push_move_exec - ldr r0, =0x02024474 - strb r6, [r0, 0x17] -_080442E2: - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x7F - mov r1, r9 - subs r1, 0x1 - strb r1, [r0] - b _0804441E - .pool -_080442FC: - ldr r0, =gUnknown_082DB4A9 - bl b_push_move_exec - ldr r0, =0x02024474 - mov r5, r10 - strb r5, [r0, 0x17] - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x7F - mov r1, r9 - subs r1, 0x1 - strb r1, [r0] - b _0804443A - .pool -_08044324: - strb r1, [r7] - ldr r0, [r2] - ldr r1, =0xfff7ffff - ands r0, r1 - str r0, [r2] - ldr r0, =gUnknown_082DB4B8 - bl b_push_move_exec - b _080443C8 - .pool -_08044340: - ldr r0, =gUnknown_082DB452 - bl b_push_move_exec - ldr r1, =0x020242ac - ldr r0, [sp, 0x18] - adds r1, r0, r1 - ldr r0, [r1] - ldr r2, =0xffefffff - ands r0, r2 - str r0, [r1] - ldr r0, =0x02024474 - strb r4, [r0, 0x17] - ldr r1, =0x02022f58 - movs r4, 0xFD - strb r4, [r1] - movs r0, 0x4 - strb r0, [r1, 0x1] - ldr r2, =0x02024064 - ldrb r0, [r2] - strb r0, [r1, 0x2] - ldr r3, =0x0202406e - ldrb r0, [r2] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r1, =0x02022f68 - strb r4, [r1] - movs r0, 0x9 - strb r0, [r1, 0x1] - ldr r0, =0x0202420a - ldrb r0, [r0] - strb r0, [r1, 0x2] - movs r0, 0x1 - negs r0, r0 - strb r0, [r1, 0x3] - b _0804441E - .pool -_080443B4: - strb r1, [r7] - ldr r0, [r2] - ldr r1, =0xfff7ffff - ands r0, r1 - str r0, [r2] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB4C1 - str r0, [r1] -_080443C8: - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0xD8 - strb r4, [r0] -_080443D0: - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - b _0804441E - .pool -_080443EC: - movs r4, 0 - ldr r0, =0x0202406c - ldrb r1, [r0] - cmp r4, r1 - bge _0804441E - ldr r0, =0x02024084 - adds r2, r1, 0 - adds r1, r0, 0 - adds r1, 0x20 - ldr r3, =0x0202420a -_08044400: - ldrb r0, [r1] - cmp r0, r6 - bne _08044416 - cmp r4, r10 - beq _08044416 - strb r6, [r3] - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_08044416: - adds r1, 0x58 - adds r4, 0x1 - cmp r4, r2 - blt _08044400 -_0804441E: - mov r1, r9 - cmp r1, 0 - beq _0804443A -_08044424: - ldr r2, [sp, 0x4] - cmp r2, 0xB - bhi _0804443A - ldr r1, =0x0202420a - ldrb r0, [r1] - cmp r0, 0xFF - beq _0804443A - adds r1, r0, 0 - mov r0, r10 - bl b_history__record_ability_usage_of_player -_0804443A: - mov r0, r9 - add sp, 0x28 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end ability_something - - thumb_func_start b_call_bc_move_exec -b_call_bc_move_exec: @ 8044458 - ldr r1, =0x02024214 - str r0, [r1] - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r2, [r0, 0xC] - adds r3, r2, 0 - adds r3, 0x20 - ldrb r0, [r3] - adds r1, r0, 0x1 - strb r1, [r3] - lsls r0, 24 - lsrs r0, 22 - adds r2, r0 - ldr r1, =0x03005d04 - ldr r0, [r1] - str r0, [r2] - ldr r0, =bc_move_exec_returning - str r0, [r1] - ldr r1, =0x02024083 - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end b_call_bc_move_exec - - thumb_func_start b_push_move_exec -b_push_move_exec: @ 8044498 - push {r4,lr} - adds r4, r0, 0 - bl b_movescr_stack_push_cursor - ldr r0, =0x02024214 - str r4, [r0] - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r2, [r0, 0xC] - adds r3, r2, 0 - adds r3, 0x20 - ldrb r0, [r3] - adds r1, r0, 0x1 - strb r1, [r3] - lsls r0, 24 - lsrs r0, 22 - adds r2, r0 - ldr r1, =0x03005d04 - ldr r0, [r1] - str r0, [r2] - ldr r0, =sub_803E08C - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end b_push_move_exec - - thumb_func_start berry_effects_maybe -berry_effects_maybe: @ 80444DC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x2C - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x8] - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r6, r2, 24 - movs r0, 0 - mov r10, r0 - movs r1, 0 - str r1, [sp, 0xC] - add r0, sp, 0x4 - strb r1, [r0] - ldr r4, =0x02024208 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r7 - adds r0, r1 - ldrh r0, [r0, 0x2E] - strh r0, [r4] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xAF - bne _08044534 - ldr r1, =0x02024404 - lsls r0, r7, 3 - subs r0, r7 - lsls r0, 2 - adds r0, r1 - ldrb r5, [r0, 0x7] - ldrb r0, [r0, 0x1A] - b _08044548 - .pool -_08044534: - ldrh r0, [r4] - bl itemid_get_x12 - lsls r0, 24 - lsrs r5, r0, 24 - ldrh r0, [r4] - bl itemid_get_quality - lsls r0, 24 - lsrs r0, 24 -_08044548: - mov r9, r0 - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldrh r0, [r0, 0x2E] - str r0, [sp, 0x14] - cmp r0, 0xAF - bne _0804457C - ldr r1, =0x02024404 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r3, [r0, 0x7] - mov r8, r3 - ldrb r0, [r0, 0x1A] - b _08044592 - .pool -_0804457C: - ldr r0, [sp, 0x14] - bl itemid_get_x12 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r0, [sp, 0x14] - bl itemid_get_quality - lsls r0, 24 - lsrs r0, 24 -_08044592: - str r0, [sp, 0x10] - ldr r2, =0x02024084 - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r4, [r0, 0x2E] - cmp r4, 0xAF - beq _080445B2 - adds r0, r4, 0 - bl itemid_get_x12 - adds r0, r4, 0 - bl itemid_get_quality -_080445B2: - ldr r0, [sp, 0x8] - cmp r0, 0x4 - bls _080445BC - bl _0804582A -_080445BC: - lsls r0, 2 - ldr r1, =_080445D4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080445D4: - .4byte _080445E8 - .4byte _08044688 - .4byte _0804582A - .4byte _08045280 - .4byte _080456D0 -_080445E8: - cmp r5, 0x17 - beq _08044618 - cmp r5, 0x20 - beq _080445F4 - bl _0804582A -_080445F4: - adds r0, r7, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08044604 - bl _0804582A -_08044604: - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x4A - movs r1, 0x2 - strb r1, [r0] - bl _0804582A - .pool -_08044618: - ldr r1, =0x02024084 - mov r8, r1 - movs r0, 0x58 - adds r1, r7, 0 - muls r1, r0 - mov r0, r8 - adds r0, 0x18 - adds r1, r0 - movs r2, 0x6 - movs r3, 0x7 - mov r10, r3 -_0804462E: - movs r0, 0 - ldrsb r0, [r1, r0] - cmp r0, 0x5 - bgt _0804463C - strb r2, [r1] - movs r5, 0x5 - str r5, [sp, 0xC] -_0804463C: - adds r1, 0x1 - movs r0, 0x1 - negs r0, r0 - add r10, r0 - mov r3, r10 - cmp r3, 0 - bge _0804462E - ldr r5, [sp, 0xC] - cmp r5, 0 - bne _08044654 - bl _0804582A -_08044654: - ldr r0, =0x02024474 - strb r7, [r0, 0x17] - ldr r0, =0x0202420f - strb r7, [r0] - ldr r1, =0x02024064 - ldr r0, =0x0202420b - strb r7, [r0] - strb r7, [r1] - ldr r0, =gUnknown_082DB7AE - bl b_call_bc_move_exec - bl _0804582A - .pool -_08044688: - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r7 - adds r0, r1 - ldrh r0, [r0, 0x28] - mov r8, r1 - cmp r0, 0 - bne _0804469C - bl _0804582A -_0804469C: - subs r0, r5, 0x1 - cmp r0, 0x2A - bls _080446A6 - bl _080451D6 -_080446A6: - lsls r0, 2 - ldr r1, =_080446B8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080446B8: - .4byte _08044764 - .4byte _08044F44 - .4byte _08045008 - .4byte _08044F74 - .4byte _08044FA8 - .4byte _08044FD8 - .4byte _080447B0 - .4byte _08045044 - .4byte _08045074 - .4byte _0804497C - .4byte _080449FC - .4byte _08044A78 - .4byte _08044B0C - .4byte _08044BA0 - .4byte _08044C34 - .4byte _08044C9C - .4byte _08044CF0 - .4byte _08044D44 - .4byte _08044DAC - .4byte _08044E10 - .4byte _08044E5C - .4byte _080451D6 - .4byte _080448B0 - .4byte _080451D6 - .4byte _080451D6 - .4byte _080451D6 - .4byte _080451D6 - .4byte _080451A0 - .4byte _080451D6 - .4byte _080451D6 - .4byte _080451D6 - .4byte _080451D6 - .4byte _080451D6 - .4byte _080451D6 - .4byte _080451D6 - .4byte _080451D6 - .4byte _080451D6 - .4byte _080451D6 - .4byte _080451D6 - .4byte _080451D6 - .4byte _080451D6 - .4byte _080451D6 - .4byte _0804491C -_08044764: - movs r0, 0x58 - muls r0, r7 - mov r1, r8 - adds r2, r0, r1 - ldrh r0, [r2, 0x2C] - ldrh r1, [r2, 0x28] - lsrs r0, 1 - cmp r1, r0 - bls _0804477A - bl _080451D6 -_0804477A: - cmp r6, 0 - beq _08044782 - bl _080451D6 -_08044782: - ldr r4, =0x020241f0 - mov r3, r9 - str r3, [r4] - ldrh r3, [r2, 0x28] - mov r5, r9 - adds r0, r3, r5 - ldrh r1, [r2, 0x2C] - cmp r0, r1 - ble _08044798 - subs r0, r1, r3 - str r0, [r4] -_08044798: - ldr r0, [r4] - negs r0, r0 - str r0, [r4] - ldr r0, =gUnknown_082DB7C4 - bl b_call_bc_move_exec - b _08044B02 - .pool -_080447B0: - cmp r6, 0 - beq _080447B8 - bl _080451D6 -_080447B8: - adds r0, r7, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _080447DC - ldr r1, =0x0202406e - lsls r0, r7, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - b _080447EA - .pool -_080447DC: - ldr r1, =0x0202406e - lsls r0, r7, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 -_080447EA: - adds r4, r1, r0 - movs r1, 0 - mov r10, r1 - add r5, sp, 0x4 -_080447F2: - mov r1, r10 - adds r1, 0xD - adds r0, r4, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r6, r0, 16 - mov r1, r10 - adds r1, 0x11 - adds r0, r4, 0 - bl pokemon_getattr - strb r0, [r5] - adds r0, r4, 0 - movs r1, 0x15 - bl pokemon_getattr - lsls r0, 24 - lsrs r1, r0, 24 - cmp r6, 0 - beq _08044822 - ldrb r0, [r5] - cmp r0, 0 - beq _0804482C -_08044822: - movs r2, 0x1 - add r10, r2 - mov r3, r10 - cmp r3, 0x3 - ble _080447F2 -_0804482C: - mov r5, r10 - cmp r5, 0x4 - bne _08044836 - bl _080451D6 -_08044836: - lsls r2, r5, 24 - lsrs r2, 24 - adds r0, r6, 0 - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r2, r0, 24 - add r0, sp, 0x4 - ldrb r0, [r0] - mov r3, r9 - adds r1, r0, r3 - cmp r1, r2 - ble _08044860 - add r0, sp, 0x4 - strb r2, [r0] - b _08044864 - .pool -_08044860: - add r0, sp, 0x4 - strb r1, [r0] -_08044864: - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x2 - strb r0, [r1, 0x1] - strb r6, [r1, 0x2] - lsrs r0, r6, 8 - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r0, =gUnknown_082DB7E1 - bl b_call_bc_move_exec - mov r1, r10 - adds r1, 0x9 - lsls r1, 24 - lsrs r1, 24 - add r5, sp, 0x4 - str r5, [sp] - movs r0, 0 - movs r2, 0 - movs r3, 0x1 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution - movs r0, 0x3 - str r0, [sp, 0xC] - bl _080451DE - .pool -_080448B0: - ldr r0, =0x02024084 - movs r1, 0x58 - muls r1, r7 - adds r0, 0x18 - adds r1, r0 - movs r2, 0x6 - movs r3, 0x7 - mov r10, r3 -_080448C0: - movs r0, 0 - ldrsb r0, [r1, r0] - cmp r0, 0x5 - bgt _080448CE - strb r2, [r1] - movs r5, 0x5 - str r5, [sp, 0xC] -_080448CE: - adds r1, 0x1 - movs r0, 0x1 - negs r0, r0 - add r10, r0 - mov r3, r10 - cmp r3, 0 - bge _080448C0 - movs r5, 0x8 - mov r10, r5 - ldr r0, [sp, 0xC] - cmp r0, 0 - bne _080448EA - bl _0804582A -_080448EA: - ldr r0, =0x02024474 - strb r7, [r0, 0x17] - ldr r0, =0x0202420f - strb r7, [r0] - ldr r1, =0x02024064 - ldr r0, =0x0202420b - strb r7, [r0] - strb r7, [r1] - ldr r0, =gUnknown_082DB7AE - bl b_call_bc_move_exec - bl _080451D6 - .pool -_0804491C: - movs r0, 0x58 - muls r0, r7 - mov r2, r8 - adds r1, r0, r2 - ldrh r0, [r1, 0x28] - ldrh r3, [r1, 0x2C] - cmp r0, r3 - bcc _08044930 - bl _080451D6 -_08044930: - cmp r6, 0 - beq _08044938 - bl _080451D6 -_08044938: - ldr r3, =0x020241f0 - ldrh r0, [r1, 0x2C] - lsrs r0, 4 - str r0, [r3] - cmp r0, 0 - bne _08044948 - movs r0, 0x1 - str r0, [r3] -_08044948: - ldrh r2, [r1, 0x28] - ldr r0, [r3] - adds r0, r2, r0 - ldrh r1, [r1, 0x2C] - cmp r0, r1 - ble _08044958 - subs r0, r1, r2 - str r0, [r3] -_08044958: - ldr r0, [r3] - negs r0, r0 - str r0, [r3] - ldr r0, =gUnknown_082DB7F1 - bl b_call_bc_move_exec - movs r0, 0x4 - str r0, [sp, 0xC] - adds r0, r7, 0 - adds r1, r5, 0 - bl b_history__record_item_x12_of_player - bl _080451D6 - .pool -_0804497C: - movs r0, 0x58 - adds r1, r7, 0 - muls r1, r0 - str r1, [sp, 0x18] - adds r4, r1, 0 - add r4, r8 - ldrh r0, [r4, 0x2C] - ldrh r1, [r4, 0x28] - lsrs r0, 1 - cmp r1, r0 - bls _08044996 - bl _080451D6 -_08044996: - cmp r6, 0 - beq _0804499E - bl _080451D6 -_0804499E: - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x8 - strb r0, [r1, 0x1] - strb r6, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x3] - ldr r5, =0x020241f0 - ldrh r0, [r4, 0x2C] - mov r1, r9 - bl __divsi3 - str r0, [r5] - cmp r0, 0 - bne _080449C2 - movs r0, 0x1 - str r0, [r5] -_080449C2: - ldrh r2, [r4, 0x28] - ldr r0, [r5] - adds r0, r2, r0 - ldrh r1, [r4, 0x2C] - cmp r0, r1 - ble _080449D2 - subs r0, r1, r2 - str r0, [r5] -_080449D2: - ldr r0, [r5] - negs r0, r0 - str r0, [r5] - mov r0, r8 - adds r0, 0x48 - ldr r2, [sp, 0x18] - adds r0, r2, r0 - ldr r0, [r0] - movs r1, 0 - bl sub_806E880 - lsls r0, 24 - cmp r0, 0 - bge _080449F0 - b _08044B7C -_080449F0: - b _08044B90 - .pool -_080449FC: - movs r0, 0x58 - adds r5, r7, 0 - muls r5, r0 - str r5, [sp, 0x1C] - add r5, r8 - ldrh r0, [r5, 0x2C] - ldrh r1, [r5, 0x28] - lsrs r0, 1 - cmp r1, r0 - bls _08044A14 - bl _080451D6 -_08044A14: - cmp r6, 0 - beq _08044A1C - bl _080451D6 -_08044A1C: - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x8 - strb r0, [r1, 0x1] - movs r6, 0x1 - strb r6, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x3] - ldr r4, =0x020241f0 - ldrh r0, [r5, 0x2C] - mov r1, r9 - bl __divsi3 - str r0, [r4] - cmp r0, 0 - bne _08044A40 - str r6, [r4] -_08044A40: - ldrh r2, [r5, 0x28] - ldr r0, [r4] - adds r0, r2, r0 - ldrh r1, [r5, 0x2C] - cmp r0, r1 - ble _08044A50 - subs r0, r1, r2 - str r0, [r4] -_08044A50: - ldr r0, [r4] - negs r0, r0 - str r0, [r4] - mov r0, r8 - adds r0, 0x48 - ldr r1, [sp, 0x1C] - adds r0, r1, r0 - ldr r0, [r0] - movs r1, 0x1 - bl sub_806E880 - lsls r0, 24 - cmp r0, 0 - bge _08044A6E - b _08044C0E -_08044A6E: - b _08044C24 - .pool -_08044A78: - movs r0, 0x58 - adds r3, r7, 0 - muls r3, r0 - str r3, [sp, 0x20] - adds r5, r3, 0 - add r5, r8 - ldrh r0, [r5, 0x2C] - ldrh r1, [r5, 0x28] - lsrs r0, 1 - cmp r1, r0 - bls _08044A90 - b _080451D6 -_08044A90: - cmp r6, 0 - beq _08044A96 - b _080451D6 -_08044A96: - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x8 - strb r0, [r1, 0x1] - movs r0, 0x2 - strb r0, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x3] - ldr r4, =0x020241f0 - ldrh r0, [r5, 0x2C] - mov r1, r9 - bl __divsi3 - str r0, [r4] - cmp r0, 0 - bne _08044ABC - movs r0, 0x1 - str r0, [r4] -_08044ABC: - ldrh r2, [r5, 0x28] - ldr r0, [r4] - adds r0, r2, r0 - ldrh r1, [r5, 0x2C] - cmp r0, r1 - ble _08044ACC - subs r0, r1, r2 - str r0, [r4] -_08044ACC: - ldr r0, [r4] - negs r0, r0 - str r0, [r4] - mov r0, r8 - adds r0, 0x48 - ldr r5, [sp, 0x20] - adds r0, r5, r0 - ldr r0, [r0] - movs r1, 0x2 - bl sub_806E880 - lsls r0, 24 - cmp r0, 0 - bge _08044AFC - ldr r0, =gUnknown_082DB824 - bl b_call_bc_move_exec - b _08044B02 - .pool -_08044AFC: - ldr r0, =gUnknown_082DB7C4 - bl b_call_bc_move_exec -_08044B02: - movs r0, 0x4 - str r0, [sp, 0xC] - b _080451DE - .pool -_08044B0C: - movs r0, 0x58 - adds r1, r7, 0 - muls r1, r0 - str r1, [sp, 0x24] - adds r5, r1, 0 - add r5, r8 - ldrh r0, [r5, 0x2C] - ldrh r1, [r5, 0x28] - lsrs r0, 1 - cmp r1, r0 - bls _08044B24 - b _080451D6 -_08044B24: - cmp r6, 0 - beq _08044B2A - b _080451D6 -_08044B2A: - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x8 - strb r0, [r1, 0x1] - movs r0, 0x3 - strb r0, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x3] - ldr r4, =0x020241f0 - ldrh r0, [r5, 0x2C] - mov r1, r9 - bl __divsi3 - str r0, [r4] - cmp r0, 0 - bne _08044B50 - movs r0, 0x1 - str r0, [r4] -_08044B50: - ldrh r2, [r5, 0x28] - ldr r0, [r4] - adds r0, r2, r0 - ldrh r1, [r5, 0x2C] - cmp r0, r1 - ble _08044B60 - subs r0, r1, r2 - str r0, [r4] -_08044B60: - ldr r0, [r4] - negs r0, r0 - str r0, [r4] - mov r0, r8 - adds r0, 0x48 - ldr r2, [sp, 0x24] - adds r0, r2, r0 - ldr r0, [r0] - movs r1, 0x3 - bl sub_806E880 - lsls r0, 24 - cmp r0, 0 - bge _08044B90 -_08044B7C: - ldr r0, =gUnknown_082DB824 - bl b_call_bc_move_exec - b _08044B96 - .pool -_08044B90: - ldr r0, =gUnknown_082DB7C4 - bl b_call_bc_move_exec -_08044B96: - movs r3, 0x4 - str r3, [sp, 0xC] - b _080451DE - .pool -_08044BA0: - movs r0, 0x58 - adds r5, r7, 0 - muls r5, r0 - str r5, [sp, 0x28] - add r5, r8 - ldrh r0, [r5, 0x2C] - ldrh r1, [r5, 0x28] - lsrs r0, 1 - cmp r1, r0 - bls _08044BB6 - b _080451D6 -_08044BB6: - cmp r6, 0 - beq _08044BBC - b _080451D6 -_08044BBC: - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x8 - strb r0, [r1, 0x1] - movs r0, 0x4 - strb r0, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x3] - ldr r4, =0x020241f0 - ldrh r0, [r5, 0x2C] - mov r1, r9 - bl __divsi3 - str r0, [r4] - cmp r0, 0 - bne _08044BE2 - movs r0, 0x1 - str r0, [r4] -_08044BE2: - ldrh r2, [r5, 0x28] - ldr r0, [r4] - adds r0, r2, r0 - ldrh r1, [r5, 0x2C] - cmp r0, r1 - ble _08044BF2 - subs r0, r1, r2 - str r0, [r4] -_08044BF2: - ldr r0, [r4] - negs r0, r0 - str r0, [r4] - mov r0, r8 - adds r0, 0x48 - ldr r1, [sp, 0x28] - adds r0, r1, r0 - ldr r0, [r0] - movs r1, 0x4 - bl sub_806E880 - lsls r0, 24 - cmp r0, 0 - bge _08044C24 -_08044C0E: - ldr r0, =gUnknown_082DB824 - bl b_call_bc_move_exec - b _08044C2A - .pool -_08044C24: - ldr r0, =gUnknown_082DB7C4 - bl b_call_bc_move_exec -_08044C2A: - movs r2, 0x4 - str r2, [sp, 0xC] - b _080451DE - .pool -_08044C34: - movs r0, 0x58 - muls r0, r7 - mov r3, r8 - adds r5, r0, r3 - ldrh r4, [r5, 0x28] - ldrh r0, [r5, 0x2C] - mov r1, r9 - bl __divsi3 - cmp r4, r0 - ble _08044C4C - b _080451D6 -_08044C4C: - cmp r6, 0 - beq _08044C52 - b _080451D6 -_08044C52: - movs r0, 0x19 - ldrsb r0, [r5, r0] - cmp r0, 0xB - ble _08044C5C - b _080451D6 -_08044C5C: - ldr r1, =0x02022f58 - movs r2, 0xFD - strb r2, [r1] - movs r0, 0x5 - strb r0, [r1, 0x1] - movs r0, 0x1 - strb r0, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x3] - ldr r1, =0x02022f68 - strb r2, [r1] - strb r6, [r1, 0x1] - movs r0, 0xD2 - strb r0, [r1, 0x2] - strb r6, [r1, 0x3] - subs r0, 0xD3 - strb r0, [r1, 0x4] - ldr r0, =0x0202420e - strb r7, [r0] - ldr r1, =0x02024474 - movs r0, 0x11 - strb r0, [r1, 0x1A] - movs r0, 0xF - b _08044DF0 - .pool -_08044C9C: - movs r0, 0x58 - muls r0, r7 - mov r1, r8 - adds r5, r0, r1 - ldrh r4, [r5, 0x28] - ldrh r0, [r5, 0x2C] - mov r1, r9 - bl __divsi3 - cmp r4, r0 - ble _08044CB4 - b _080451D6 -_08044CB4: - cmp r6, 0 - beq _08044CBA - b _080451D6 -_08044CBA: - movs r0, 0x1A - ldrsb r0, [r5, r0] - cmp r0, 0xB - ble _08044CC4 - b _080451D6 -_08044CC4: - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x5 - strb r0, [r1, 0x1] - movs r0, 0x2 - strb r0, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x3] - ldr r0, =0x0202420e - strb r7, [r0] - ldr r1, =0x02024474 - movs r0, 0x12 - strb r0, [r1, 0x1A] - movs r0, 0x10 - b _08044D8A - .pool -_08044CF0: - movs r0, 0x58 - muls r0, r7 - mov r3, r8 - adds r5, r0, r3 - ldrh r4, [r5, 0x28] - ldrh r0, [r5, 0x2C] - mov r1, r9 - bl __divsi3 - cmp r4, r0 - ble _08044D08 - b _080451D6 -_08044D08: - cmp r6, 0 - beq _08044D0E - b _080451D6 -_08044D0E: - movs r0, 0x1B - ldrsb r0, [r5, r0] - cmp r0, 0xB - ble _08044D18 - b _080451D6 -_08044D18: - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x5 - strb r0, [r1, 0x1] - movs r0, 0x3 - strb r0, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x3] - ldr r0, =0x0202420e - strb r7, [r0] - ldr r1, =0x02024474 - movs r0, 0x13 - strb r0, [r1, 0x1A] - movs r0, 0x11 - b _08044DF0 - .pool -_08044D44: - movs r0, 0x58 - muls r0, r7 - mov r1, r8 - adds r5, r0, r1 - ldrh r4, [r5, 0x28] - ldrh r0, [r5, 0x2C] - mov r1, r9 - bl __divsi3 - cmp r4, r0 - ble _08044D5C - b _080451D6 -_08044D5C: - cmp r6, 0 - beq _08044D62 - b _080451D6 -_08044D62: - movs r0, 0x1C - ldrsb r0, [r5, r0] - cmp r0, 0xB - ble _08044D6C - b _080451D6 -_08044D6C: - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x5 - strb r0, [r1, 0x1] - movs r0, 0x4 - strb r0, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x3] - ldr r0, =0x0202420e - strb r7, [r0] - ldr r1, =0x02024474 - movs r0, 0x14 - strb r0, [r1, 0x1A] - movs r0, 0x12 -_08044D8A: - strb r0, [r1, 0x10] - strb r6, [r1, 0x11] - ldr r0, =gUnknown_082DB84E - bl b_call_bc_move_exec - movs r2, 0x5 - str r2, [sp, 0xC] - b _080451DE - .pool -_08044DAC: - movs r0, 0x58 - muls r0, r7 - mov r3, r8 - adds r5, r0, r3 - ldrh r4, [r5, 0x28] - ldrh r0, [r5, 0x2C] - mov r1, r9 - bl __divsi3 - cmp r4, r0 - ble _08044DC4 - b _080451D6 -_08044DC4: - cmp r6, 0 - beq _08044DCA - b _080451D6 -_08044DCA: - movs r0, 0x1D - ldrsb r0, [r5, r0] - cmp r0, 0xB - ble _08044DD4 - b _080451D6 -_08044DD4: - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x5 - strb r0, [r1, 0x1] - strb r0, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x3] - ldr r0, =0x0202420e - strb r7, [r0] - ldr r1, =0x02024474 - movs r0, 0x15 - strb r0, [r1, 0x1A] - movs r0, 0x13 -_08044DF0: - strb r0, [r1, 0x10] - strb r6, [r1, 0x11] - ldr r0, =gUnknown_082DB84E - bl b_call_bc_move_exec - movs r5, 0x5 - str r5, [sp, 0xC] - b _080451DE - .pool -_08044E10: - movs r0, 0x58 - adds r5, r7, 0 - muls r5, r0 - mov r1, r8 - adds r0, r5, r1 - ldrh r4, [r0, 0x28] - ldrh r0, [r0, 0x2C] - mov r1, r9 - bl __divsi3 - cmp r4, r0 - ble _08044E2A - b _080451D6 -_08044E2A: - cmp r6, 0 - beq _08044E30 - b _080451D6 -_08044E30: - mov r0, r8 - adds r0, 0x50 - adds r1, r5, r0 - ldr r2, [r1] - movs r3, 0x80 - lsls r3, 13 - adds r0, r2, 0 - ands r0, r3 - cmp r0, 0 - beq _08044E46 - b _080451D6 -_08044E46: - orrs r2, r3 - str r2, [r1] - ldr r0, =gUnknown_082DB869 - bl b_call_bc_move_exec - movs r2, 0x2 - str r2, [sp, 0xC] - b _080451DE - .pool -_08044E5C: - cmp r6, 0 - beq _08044E62 - b _080451D6 -_08044E62: - movs r0, 0x58 - adds r5, r7, 0 - muls r5, r0 - mov r3, r8 - adds r0, r5, r3 - ldrh r4, [r0, 0x28] - ldrh r0, [r0, 0x2C] - mov r1, r9 - bl __divsi3 - cmp r4, r0 - ble _08044E7C - b _080451D6 -_08044E7C: - movs r0, 0 - mov r10, r0 - adds r0, r5, 0x1 - mov r1, r8 - adds r1, 0x18 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0xB - ble _08044EAC - mov r0, r8 - adds r0, 0x19 - adds r1, r5, r0 -_08044E98: - adds r1, 0x1 - movs r2, 0x1 - add r10, r2 - mov r3, r10 - cmp r3, 0x4 - bgt _08044EAC - movs r0, 0 - ldrsb r0, [r1, r0] - cmp r0, 0xB - bgt _08044E98 -_08044EAC: - mov r5, r10 - cmp r5, 0x5 - bne _08044EB4 - b _080451D6 -_08044EB4: - movs r0, 0x58 - muls r0, r7 - adds r4, r0, 0x1 - ldr r5, =0x0202409c -_08044EBC: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x5 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - adds r0, r4 - adds r0, r5 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0xC - beq _08044EBC - ldr r1, =0x02022f58 - movs r2, 0 - movs r3, 0xFD - strb r3, [r1] - movs r0, 0x5 - strb r0, [r1, 0x1] - mov r0, r10 - adds r0, 0x1 - strb r0, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x3] - ldr r0, =0x02022f68 - strb r3, [r0] - strb r2, [r0, 0x1] - movs r1, 0xD1 - strb r1, [r0, 0x2] - strb r2, [r0, 0x3] - strb r2, [r0, 0x4] - movs r1, 0xD2 - strb r1, [r0, 0x5] - strb r2, [r0, 0x6] - subs r1, 0xD3 - strb r1, [r0, 0x7] - ldr r0, =0x0202420e - strb r7, [r0] - ldr r1, =0x02024474 - mov r0, r10 - adds r0, 0x21 - strb r0, [r1, 0x1A] - adds r0, 0x6 - strb r0, [r1, 0x10] - strb r2, [r1, 0x11] - ldr r0, =gUnknown_082DB84E - bl b_call_bc_move_exec - movs r0, 0x5 - str r0, [sp, 0xC] - b _080451DE - .pool -_08044F44: - movs r0, 0x58 - adds r1, r7, 0 - muls r1, r0 - mov r0, r8 - adds r0, 0x4C - adds r1, r0 - ldr r2, [r1] - movs r0, 0x40 - ands r0, r2 - cmp r0, 0 - bne _08044F5C - b _080451D6 -_08044F5C: - movs r0, 0x41 - negs r0, r0 - ands r2, r0 - str r2, [r1] - ldr r0, =gUnknown_082DB706 - bl b_call_bc_move_exec - movs r1, 0x1 - str r1, [sp, 0xC] - b _080451DE - .pool -_08044F74: - movs r0, 0x58 - adds r1, r7, 0 - muls r1, r0 - mov r0, r8 - adds r0, 0x4C - adds r1, r0 - ldr r2, [r1] - movs r0, 0x88 - ands r0, r2 - cmp r0, 0 - bne _08044F8C - b _080451D6 -_08044F8C: - ldr r0, =0xfffff077 - ands r2, r0 - str r2, [r1] - ldr r0, =gUnknown_082DB71E - bl b_call_bc_move_exec - movs r2, 0x1 - str r2, [sp, 0xC] - b _080451DE - .pool -_08044FA8: - movs r0, 0x58 - adds r1, r7, 0 - muls r1, r0 - mov r0, r8 - adds r0, 0x4C - adds r1, r0 - ldr r2, [r1] - movs r0, 0x10 - ands r0, r2 - cmp r0, 0 - bne _08044FC0 - b _080451D6 -_08044FC0: - movs r0, 0x11 - negs r0, r0 - ands r2, r0 - str r2, [r1] - ldr r0, =gUnknown_082DB736 - bl b_call_bc_move_exec - movs r3, 0x1 - str r3, [sp, 0xC] - b _080451DE - .pool -_08044FD8: - movs r0, 0x58 - adds r1, r7, 0 - muls r1, r0 - mov r0, r8 - adds r0, 0x4C - adds r1, r0 - ldr r2, [r1] - movs r0, 0x20 - ands r0, r2 - cmp r0, 0 - bne _08044FF0 - b _080451D6 -_08044FF0: - movs r0, 0x21 - negs r0, r0 - ands r2, r0 - str r2, [r1] - ldr r0, =gUnknown_082DB74E - bl b_call_bc_move_exec - movs r5, 0x1 - str r5, [sp, 0xC] - b _080451DE - .pool -_08045008: - movs r0, 0x58 - adds r3, r7, 0 - muls r3, r0 - mov r0, r8 - adds r0, 0x4C - adds r2, r3, r0 - ldr r1, [r2] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - bne _08045020 - b _080451D6 -_08045020: - movs r0, 0x8 - negs r0, r0 - ands r1, r0 - str r1, [r2] - mov r1, r8 - adds r1, 0x50 - adds r1, r3, r1 - ldr r0, [r1] - ldr r2, =0xf7ffffff - ands r0, r2 - str r0, [r1] - ldr r0, =gUnknown_082DB766 - b _0804518A - .pool -_08045044: - movs r0, 0x58 - adds r1, r7, 0 - muls r1, r0 - mov r0, r8 - adds r0, 0x50 - adds r1, r0 - ldr r2, [r1] - movs r0, 0x7 - ands r0, r2 - cmp r0, 0 - bne _0804505C - b _080451D6 -_0804505C: - movs r0, 0x8 - negs r0, r0 - ands r2, r0 - str r2, [r1] - ldr r0, =gUnknown_082DB77E - bl b_call_bc_move_exec - movs r1, 0x2 - str r1, [sp, 0xC] - b _080451DE - .pool -_08045074: - movs r0, 0x58 - adds r5, r7, 0 - muls r5, r0 - mov r0, r8 - adds r0, 0x4C - adds r4, r5, r0 - ldr r2, [r4] - ldrb r0, [r4] - cmp r0, 0 - bne _0804509A - mov r0, r8 - adds r0, 0x50 - adds r0, r5, r0 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - bne _0804509A - b _080451D6 -_0804509A: - movs r3, 0 - mov r10, r3 - movs r0, 0x88 - ands r2, r0 - cmp r2, 0 - beq _080450B2 - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC70 - bl CopyString - movs r0, 0x1 - mov r10, r0 -_080450B2: - ldr r0, [r4] - movs r1, 0x7 - mov r9, r1 - ands r0, r1 - mov r6, r8 - adds r6, 0x50 - cmp r0, 0 - beq _080450D8 - adds r2, r5, r6 - ldr r0, [r2] - ldr r1, =0xf7ffffff - ands r0, r1 - str r0, [r2] - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC78 - bl CopyString - movs r2, 0x1 - add r10, r2 -_080450D8: - ldr r0, [r4] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080450EE - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC80 - bl CopyString - movs r3, 0x1 - add r10, r3 -_080450EE: - ldr r0, [r4] - movs r1, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08045104 - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC88 - bl CopyString - movs r0, 0x1 - add r10, r0 -_08045104: - ldr r0, [r4] - movs r1, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0804511A - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC90 - bl CopyString - movs r1, 0x1 - add r10, r1 -_0804511A: - adds r0, r5, r6 - ldr r0, [r0] - mov r2, r9 - ands r0, r2 - cmp r0, 0 - beq _08045132 - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC98 - bl CopyString - movs r3, 0x1 - add r10, r3 -_08045132: - mov r5, r10 - cmp r5, 0x1 - bgt _08045164 - ldr r1, =0x02024332 - movs r0, 0 - b _08045168 - .pool -_08045164: - ldr r1, =0x02024332 - movs r0, 0x1 -_08045168: - strb r0, [r1, 0x5] - ldr r2, =0x02024084 - movs r0, 0x58 - adds r3, r7, 0 - muls r3, r0 - adds r0, r2, 0 - adds r0, 0x4C - adds r0, r3, r0 - movs r1, 0 - str r1, [r0] - adds r2, 0x50 - adds r3, r2 - ldr r0, [r3] - subs r1, 0x8 - ands r0, r1 - str r0, [r3] - ldr r0, =gUnknown_082DB794 -_0804518A: - bl b_call_bc_move_exec - movs r0, 0x1 - str r0, [sp, 0xC] - b _080451DE - .pool -_080451A0: - movs r0, 0x58 - adds r1, r7, 0 - muls r1, r0 - mov r0, r8 - adds r0, 0x50 - adds r1, r0 - ldr r2, [r1] - movs r0, 0xF0 - lsls r0, 12 - ands r0, r2 - cmp r0, 0 - beq _080451D6 - ldr r0, =0xfff0ffff - ands r2, r0 - str r2, [r1] - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BCA0 - bl CopyString - ldr r0, =gUnknown_082DB794 - bl b_call_bc_move_exec - ldr r1, =0x02024332 - movs r0, 0 - strb r0, [r1, 0x5] - movs r1, 0x2 - str r1, [sp, 0xC] -_080451D6: - ldr r2, [sp, 0xC] - cmp r2, 0 - bne _080451DE - b _0804582A -_080451DE: - ldr r0, =0x02024474 - strb r7, [r0, 0x17] - ldr r0, =0x0202420f - strb r7, [r0] - ldr r4, =0x02024064 - ldr r0, =0x0202420b - strb r7, [r0] - strb r7, [r4] - ldr r3, [sp, 0xC] - cmp r3, 0x1 - beq _08045220 - cmp r3, 0x3 - beq _08045226 - b _0804582A - .pool -_08045220: - movs r0, 0x58 - muls r0, r7 - b _0804568C -_08045226: - ldr r4, =0x02024084 - movs r0, 0x58 - adds r3, r7, 0 - muls r3, r0 - adds r0, r4, 0 - adds r0, 0x50 - adds r0, r3, r0 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 14 - ands r0, r1 - cmp r0, 0 - beq _08045242 - b _0804582A -_08045242: - ldr r1, =0x020242bc - lsls r0, r7, 3 - subs r0, r7 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x18] - lsrs r1, 4 - ldr r2, =gUnknown_0832A328 - mov r5, r10 - lsls r0, r5, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08045262 - b _0804582A -_08045262: - adds r1, r5, r3 - adds r0, r4, 0 - adds r0, 0x24 - adds r1, r0 - add r0, sp, 0x4 - ldrb r0, [r0] - strb r0, [r1] - b _0804582A - .pool -_08045280: - movs r7, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r7, r0 - bcc _0804528C - b _0804582A -_0804528C: - ldr r4, =0x02024208 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r7 - adds r0, r1 - ldrh r0, [r0, 0x2E] - strh r0, [r4] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xAF - bne _080452C0 - ldr r1, =0x02024404 - lsls r0, r7, 3 - subs r0, r7 - lsls r0, 2 - adds r0, r1 - ldrb r5, [r0, 0x7] - b _080452D0 - .pool -_080452C0: - ldrh r0, [r4] - bl itemid_get_x12 - lsls r0, 24 - lsrs r5, r0, 24 - ldrh r0, [r4] - bl itemid_get_quality -_080452D0: - subs r0, r5, 0x2 - cmp r0, 0x1A - bls _080452D8 - b _08045674 -_080452D8: - lsls r0, 2 - ldr r1, =_080452E8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080452E8: - .4byte _08045354 - .4byte _08045444 - .4byte _08045390 - .4byte _080453CC - .4byte _08045408 - .4byte _08045674 - .4byte _0804548C - .4byte _08045520 - .4byte _08045674 - .4byte _08045674 - .4byte _08045674 - .4byte _08045674 - .4byte _08045674 - .4byte _08045674 - .4byte _08045674 - .4byte _08045674 - .4byte _08045674 - .4byte _08045674 - .4byte _08045674 - .4byte _08045674 - .4byte _08045674 - .4byte _08045614 - .4byte _08045674 - .4byte _08045674 - .4byte _08045674 - .4byte _08045674 - .4byte _080454C8 -_08045354: - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r7 - adds r1, 0x4C - adds r2, r0, r1 - ldr r1, [r2] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0804536A - b _08045674 -_0804536A: - movs r0, 0x41 - negs r0, r0 - ands r1, r0 - str r1, [r2] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB70C - str r0, [r1] - movs r0, 0x1 - str r0, [sp, 0xC] - b _0804567A - .pool -_08045390: - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r7 - adds r1, 0x4C - adds r2, r0, r1 - ldr r1, [r2] - movs r0, 0x88 - ands r0, r1 - cmp r0, 0 - bne _080453A6 - b _08045674 -_080453A6: - ldr r0, =0xfffff077 - ands r1, r0 - str r1, [r2] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB724 - str r0, [r1] - movs r1, 0x1 - str r1, [sp, 0xC] - b _0804567A - .pool -_080453CC: - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r7 - adds r1, 0x4C - adds r2, r0, r1 - ldr r1, [r2] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _080453E2 - b _08045674 -_080453E2: - movs r0, 0x11 - negs r0, r0 - ands r1, r0 - str r1, [r2] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB73C - str r0, [r1] - movs r2, 0x1 - str r2, [sp, 0xC] - b _0804567A - .pool -_08045408: - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r7 - adds r1, 0x4C - adds r2, r0, r1 - ldr r1, [r2] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _0804541E - b _08045674 -_0804541E: - movs r0, 0x21 - negs r0, r0 - ands r1, r0 - str r1, [r2] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB754 - str r0, [r1] - movs r3, 0x1 - str r3, [sp, 0xC] - b _0804567A - .pool -_08045444: - ldr r2, =0x02024084 - movs r0, 0x58 - adds r4, r7, 0 - muls r4, r0 - adds r0, r2, 0 - adds r0, 0x4C - adds r3, r4, r0 - ldr r1, [r3] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - bne _0804545E - b _08045674 -_0804545E: - movs r0, 0x8 - negs r0, r0 - ands r1, r0 - str r1, [r3] - adds r2, 0x50 - adds r2, r4, r2 - ldr r0, [r2] - ldr r1, =0xf7ffffff - ands r0, r1 - str r0, [r2] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB76C - b _080455DC - .pool -_0804548C: - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r7 - adds r1, 0x50 - adds r2, r0, r1 - ldr r1, [r2] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - bne _080454A2 - b _08045674 -_080454A2: - movs r0, 0x8 - negs r0, r0 - ands r1, r0 - str r1, [r2] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB784 - str r0, [r1] - movs r0, 0x2 - str r0, [sp, 0xC] - b _0804567A - .pool -_080454C8: - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r7 - adds r1, 0x50 - adds r2, r0, r1 - ldr r1, [r2] - movs r0, 0xF0 - lsls r0, 12 - ands r0, r1 - cmp r0, 0 - bne _080454E0 - b _08045674 -_080454E0: - ldr r0, =0xfff0ffff - ands r1, r0 - str r1, [r2] - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BCA0 - bl CopyString - bl b_movescr_stack_push_cursor - ldr r1, =0x02024332 - movs r0, 0 - strb r0, [r1, 0x5] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB79A - str r0, [r1] - movs r1, 0x2 - str r1, [sp, 0xC] - b _0804567A - .pool -_08045520: - ldr r4, =0x02024084 - movs r0, 0x58 - adds r5, r7, 0 - muls r5, r0 - adds r0, r4, 0 - adds r0, 0x4C - adds r6, r5, r0 - ldr r2, [r6] - ldrb r0, [r6] - cmp r0, 0 - bne _08045548 - adds r0, r4, 0 - adds r0, 0x50 - adds r0, r5, r0 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - bne _08045548 - b _08045674 -_08045548: - movs r0, 0x88 - ands r2, r0 - cmp r2, 0 - beq _08045558 - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC70 - bl CopyString -_08045558: - ldr r0, [r6] - movs r2, 0x7 - mov r8, r2 - ands r0, r2 - adds r4, 0x50 - cmp r0, 0 - beq _08045578 - adds r2, r5, r4 - ldr r0, [r2] - ldr r1, =0xf7ffffff - ands r0, r1 - str r0, [r2] - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC78 - bl CopyString -_08045578: - ldr r0, [r6] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0804558A - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC80 - bl CopyString -_0804558A: - ldr r0, [r6] - movs r1, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0804559C - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC88 - bl CopyString -_0804559C: - ldr r0, [r6] - movs r1, 0x20 - ands r0, r1 - cmp r0, 0 - beq _080455AE - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC90 - bl CopyString -_080455AE: - adds r5, r4 - ldr r0, [r5] - mov r3, r8 - ands r0, r3 - cmp r0, 0 - beq _080455C2 - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC98 - bl CopyString -_080455C2: - movs r4, 0 - str r4, [r6] - ldr r0, [r5] - movs r1, 0x8 - negs r1, r1 - ands r0, r1 - str r0, [r5] - bl b_movescr_stack_push_cursor - ldr r0, =0x02024332 - strb r4, [r0, 0x5] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB79A -_080455DC: - str r0, [r1] - movs r5, 0x1 - str r5, [sp, 0xC] - b _0804567A - .pool -_08045614: - ldr r0, =0x02024084 - mov r8, r0 - movs r0, 0x58 - adds r1, r7, 0 - muls r1, r0 - mov r0, r8 - adds r0, 0x18 - adds r1, r0 - movs r2, 0x6 - movs r3, 0x7 - mov r10, r3 -_0804562A: - movs r0, 0 - ldrsb r0, [r1, r0] - cmp r0, 0x5 - bgt _08045638 - strb r2, [r1] - movs r5, 0x5 - str r5, [sp, 0xC] -_08045638: - adds r1, 0x1 - movs r0, 0x1 - negs r0, r0 - add r10, r0 - mov r3, r10 - cmp r3, 0 - bge _0804562A - ldr r5, [sp, 0xC] - cmp r5, 0 - beq _080456B8 - ldr r0, =0x02024474 - strb r7, [r0, 0x17] - ldr r0, =0x0202420f - strb r7, [r0] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB7B4 - str r0, [r1] - b _0804582A - .pool -_08045674: - ldr r0, [sp, 0xC] - cmp r0, 0 - beq _080456B8 -_0804567A: - ldr r0, =0x02024474 - strb r7, [r0, 0x17] - ldr r0, =0x0202420f - strb r7, [r0] - ldr r4, =0x02024064 - strb r7, [r4] - ldrb r1, [r4] - movs r0, 0x58 - muls r0, r1 -_0804568C: - ldr r1, =0x020240d0 - adds r0, r1 - str r0, [sp] - movs r0, 0 - movs r1, 0x28 - movs r2, 0 - movs r3, 0x4 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - b _0804582A - .pool -_080456B8: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r7, r0 - bcs _080456C8 - b _0804528C -_080456C8: - b _0804582A - .pool -_080456D0: - ldr r7, =0x020241f0 - ldr r0, [r7] - cmp r0, 0 - bne _080456DA - b _0804582A -_080456DA: - mov r1, r8 - cmp r1, 0x1E - beq _080456EC - cmp r1, 0x3E - beq _08045794 - b _0804582A - .pool -_080456EC: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _080456FA - b _0804582A -_080456FA: - ldr r2, =0x0202437c - ldr r4, =0x0202420c - ldrb r1, [r4] - lsls r0, r1, 2 - adds r0, r1 - lsls r1, r0, 2 - adds r0, r2, 0 - adds r0, 0x8 - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08045720 - adds r0, r2, 0 - adds r0, 0xC - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08045720 - b _0804582A -_08045720: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - ldr r2, [sp, 0x10] - cmp r0, r2 - bcs _0804582A - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x8] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0804582A - ldr r2, =0x02024084 - ldrb r1, [r4] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _0804582A - ldr r1, =0x02024332 - movs r0, 0x8 - strb r0, [r1, 0x3] - bl b_movescr_stack_push_cursor - movs r0, 0 - movs r1, 0 - bl sub_8048760 - bl b_movescr_stack_pop_cursor - b _0804582A - .pool -_08045794: - ldr r0, =0x0202427c - ldrb r0, [r0] - movs r5, 0x29 - ands r5, r0 - cmp r5, 0 - bne _0804582A - ldr r1, =0x0202437c - ldr r4, =0x0202420c - ldrb r2, [r4] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 2 - adds r6, r1, 0x4 - adds r0, r6 - ldr r1, [r0] - cmp r1, 0 - beq _0804582A - ldr r0, =0x0000ffff - cmp r1, r0 - beq _0804582A - ldr r0, =0x0202420b - ldrb r3, [r0] - cmp r3, r2 - beq _0804582A - ldr r2, =0x02024084 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r1, [r0, 0x28] - ldrh r0, [r0, 0x2C] - cmp r1, r0 - beq _0804582A - cmp r1, 0 - beq _0804582A - ldr r0, =0x02024208 - mov r1, sp - ldrh r1, [r1, 0x14] - strh r1, [r0] - ldr r0, =0x0202420f - strb r3, [r0] - ldr r0, =0x02024474 - strb r3, [r0, 0x17] - ldrb r1, [r4] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - ldr r1, [sp, 0x10] - bl __divsi3 - negs r0, r0 - str r0, [r7] - ldrb r1, [r4] - cmp r0, 0 - bne _0804580C - movs r0, 0x1 - negs r0, r0 - str r0, [r7] -_0804580C: - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - str r5, [r0] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB7F7 - str r0, [r1] - ldr r0, [sp, 0xC] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0xC] -_0804582A: - ldr r0, [sp, 0xC] - add sp, 0x2C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end berry_effects_maybe - - thumb_func_start sub_8045868 -sub_8045868: @ 8045868 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x020242bc - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r2 - movs r2, 0 - strb r2, [r1, 0x10] - ldr r1, =0x02024084 - movs r2, 0x58 - adds r3, r0, 0 - muls r3, r2 - adds r1, 0x50 - adds r3, r1 - ldr r1, [r3] - ldr r2, =0xfdffffff - ands r1, r2 - str r1, [r3] - ldr r1, =0x020242ac - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - ldr r2, =0xffffbfff - ands r1, r2 - str r1, [r0] - bx lr - .pool - thumb_func_end sub_8045868 - - thumb_func_start sub_80458B4 -sub_80458B4: @ 80458B4 - push {lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _080458D0 - ldr r1, =gUnknown_0831BD10 - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 -_080458D0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80458B4 - - thumb_func_start sub_80458E0 -sub_80458E0: @ 80458E0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - lsls r0, 16 - lsrs r7, r0, 16 - lsls r1, 24 - lsrs r0, r1, 24 - movs r5, 0 - cmp r0, 0 - beq _080458FE - subs r0, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - b _0804590A -_080458FE: - ldr r1, =gBattleMoves - lsls r0, r7, 1 - adds r0, r7 - lsls r0, 2 - adds r0, r1 - ldrb r6, [r0, 0x6] -_0804590A: - cmp r6, 0x40 - bls _08045910 - b _08045C20 -_08045910: - lsls r0, r6, 2 - ldr r1, =_08045924 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08045924: - .4byte _08045A28 - .4byte _08045B28 - .4byte _08045C1C - .4byte _08045C20 - .4byte _08045B40 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045B28 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C1C - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045B28 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045B28 -_08045A28: - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_side_get_owner - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x02024294 - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r2, r0, r1 - ldrb r0, [r2, 0x8] - cmp r0, 0 - beq _08045A5A - ldr r1, =0x02024084 - ldrb r4, [r2, 0x9] - movs r0, 0x58 - muls r0, r4 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _08045A5A - b _08045B70 -_08045A5A: - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r7, 1 - mov r8, r0 -_08045A6A: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x0202406c - ldrb r1, [r1] - bl __modsi3 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r6, =0x0202420b - ldrb r3, [r6] - cmp r5, r3 - beq _08045A6A - adds r0, r5, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - beq _08045A6A - ldr r0, =0x02024210 - ldrb r2, [r0] - ldr r1, =gUnknown_0832A328 - lsls r0, r5, 2 - adds r0, r1 - ldr r0, [r0] - ands r2, r0 - cmp r2, 0 - bne _08045A6A - ldr r0, =gBattleMoves - mov r3, r8 - adds r1, r3, r7 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x2] - cmp r0, 0xD - beq _08045AB8 - b _08045C20 -_08045AB8: - ldrb r1, [r6] - str r2, [sp] - movs r0, 0x10 - movs r2, 0x1F - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - bne _08045ACE - b _08045C20 -_08045ACE: - ldr r2, =0x02024084 - movs r1, 0x58 - adds r0, r5, 0 - muls r0, r1 - adds r0, r2 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x1F - bne _08045AE2 - b _08045C20 -_08045AE2: - movs r4, 0x2 - eors r5, r4 - adds r0, r5, 0 - muls r0, r1 - adds r0, r2 - adds r0, 0x20 - ldrb r1, [r0] - adds r0, r5, 0 - bl b_history__record_ability_usage_of_player - ldr r1, =0x0202437c - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - orrs r1, r4 - strb r1, [r0] - b _08045C20 - .pool -_08045B28: - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_get_per_side_status - adds r1, r0, 0 - movs r2, 0x1 - movs r0, 0x1 - ands r0, r1 - eors r0, r2 - b _08045BD2 - .pool -_08045B40: - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_side_get_owner - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x02024294 - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r2, r0, r1 - ldrb r0, [r2, 0x8] - cmp r0, 0 - beq _08045B80 - ldr r1, =0x02024084 - ldrb r4, [r2, 0x9] - movs r0, 0x58 - muls r0, r4 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _08045B80 -_08045B70: - adds r5, r4, 0 - b _08045C20 - .pool -_08045B80: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r4, 0x1 - ands r0, r4 - cmp r0, 0 - beq _08045BFC - movs r0, 0x4 - ands r6, r0 - cmp r6, 0 - beq _08045BFC - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08045BC0 - bl GenerateRandomNumber - adds r1, r4, 0 - ands r1, r0 - cmp r1, 0 - beq _08045BBC - movs r0, 0x1 - b _08045BD2 - .pool -_08045BBC: - movs r0, 0x3 - b _08045BD2 -_08045BC0: - bl GenerateRandomNumber - adds r1, r4, 0 - ands r1, r0 - cmp r1, 0 - beq _08045BD0 - movs r0, 0 - b _08045BD2 -_08045BD0: - movs r0, 0x2 -_08045BD2: - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - lsls r0, r5, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08045C20 - movs r0, 0x2 - eors r5, r0 - b _08045C20 - .pool -_08045BFC: - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_get_per_side_status - adds r1, r0, 0 - movs r2, 0x1 - movs r0, 0x1 - ands r0, r1 - eors r0, r2 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r5, r0, 24 - b _08045C20 - .pool -_08045C1C: - ldr r0, =0x0202420b - ldrb r5, [r0] -_08045C20: - ldr r0, =0x0202420b - ldrb r0, [r0] - ldr r1, =0x0202449c - ldr r1, [r1] - adds r0, r1 - strb r5, [r0, 0xC] - adds r0, r5, 0 - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80458E0 - - thumb_func_start sub_8045C44 -sub_8045C44: @ 8045C44 - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08045C8A - ldr r0, =0x0202406e - lsls r4, 1 - adds r5, r4, r0 - ldrh r0, [r5] - movs r7, 0x64 - muls r0, r7 - ldr r6, =0x020244ec - adds r0, r6 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - movs r1, 0xCD - lsls r1, 1 - cmp r0, r1 - beq _08045C98 - ldrh r0, [r5] - muls r0, r7 - adds r0, r6 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - cmp r0, 0x97 - beq _08045C98 -_08045C8A: - movs r0, 0x1 - b _08045CAE - .pool -_08045C98: - ldr r0, =0x0202406e - adds r0, r4, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x50 - movs r2, 0 - bl pokemon_getattr -_08045CAE: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8045C44 - - thumb_func_start sub_8045CBC -sub_8045CBC: @ 8045CBC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - movs r6, 0 - ldr r5, =0x02022fec - ldr r0, [r5] - ldr r1, =0x02000002 - ands r0, r1 - cmp r0, 0 - bne _08045DAC - ldr r4, =0x0202420b - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08045DAC - ldrb r0, [r4] - bl sub_8045C44 - cmp r0, 0 - beq _08045D76 - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 15 - ands r0, r1 - cmp r0, 0 - beq _08045D08 - ldrb r0, [r4] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _08045DAC -_08045D08: - ldr r0, =0x02022fec - ldr r1, [r0] - ldr r0, =0x003f0100 - ands r0, r1 - cmp r0, 0 - bne _08045DAC - movs r0, 0x80 - lsls r0, 17 - ands r1, r0 - cmp r1, 0 - bne _08045DAC - ldr r2, =0x02024084 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - muls r1, r0 - adds r0, r2, 0 - adds r0, 0x54 - adds r0, r1, r0 - ldr r0, [r0] - adds r2, 0x3C - adds r1, r2 - bl sub_806E8D4 - lsls r0, 24 - cmp r0, 0 - beq _08045DAC - ldr r0, =0x0000086e - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _08045DAC - movs r6, 0xA - ldr r0, =0x00000868 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _08045D5A - movs r6, 0x1E -_08045D5A: - ldr r0, =0x0000086a - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _08045D68 - movs r6, 0x32 -_08045D68: - ldr r0, =0x0000086c - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _08045D76 - movs r6, 0x46 -_08045D76: - ldr r5, =0x02024084 - ldr r0, =0x0202420b - mov r8, r0 - ldrb r0, [r0] - movs r7, 0x58 - muls r0, r7 - adds r0, r5 - adds r0, 0x2A - ldrb r0, [r0] - cmp r0, r6 - bls _08045DAC - bl GenerateRandomNumber - movs r1, 0xFF - ands r1, r0 - mov r2, r8 - ldrb r0, [r2] - adds r2, r0, 0 - muls r2, r7 - adds r0, r2, r5 - adds r0, 0x2A - ldrb r0, [r0] - adds r0, r6 - muls r0, r1 - asrs r4, r0, 8 - cmp r4, r6 - bge _08045DD4 -_08045DAC: - movs r0, 0 - b _08045FD0 - .pool -_08045DD4: - ldr r3, =0x020241ea - ldrh r0, [r3] - cmp r0, 0x63 - bne _08045DEA - adds r0, r5, 0 - adds r0, 0x50 - adds r0, r2, r0 - ldr r1, [r0] - ldr r2, =0xff7fffff - ands r1, r2 - str r1, [r0] -_08045DEA: - mov r1, r8 - ldrb r0, [r1] - muls r0, r7 - adds r1, r5, 0 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - beq _08045E20 - ldrh r0, [r3] - cmp r0, 0xAD - beq _08045E0A - cmp r0, 0xD6 - bne _08045E20 -_08045E0A: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB695 - b _08045F7A - .pool -_08045E20: - bl GenerateRandomNumber - movs r5, 0xFF - adds r1, r5, 0 - ands r1, r0 - ldr r7, =0x02024084 - ldr r2, =0x0202420b - mov r9, r2 - ldrb r3, [r2] - movs r0, 0x58 - mov r8, r0 - mov r0, r8 - muls r0, r3 - adds r0, r7 - adds r0, 0x2A - ldrb r2, [r0] - adds r0, r2, r6 - muls r0, r1 - asrs r4, r0, 8 - cmp r4, r6 - bge _08045EE8 - ldr r6, =gUnknown_0832A328 - ldr r5, =0x020241e8 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r6 - ldrb r1, [r0] - adds r0, r3, 0 - movs r2, 0xFF - bl sub_803FECC - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bne _08045E68 - b _08045F6A -_08045E68: - ldr r1, =0x020241e9 - mov r8, r1 - movs r7, 0x3 -_08045E6E: - bl GenerateRandomNumber - ands r0, r7 - mov r2, r8 - strb r0, [r2] - strb r0, [r5] - ldrb r0, [r5] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - ands r0, r4 - cmp r0, 0 - bne _08045E6E - ldr r4, =0x020241ee - ldr r3, =0x02024084 - ldr r0, =0x020241e8 - ldrb r0, [r0] - lsls r0, 1 - ldr r1, =0x0202420b - ldrb r2, [r1] - movs r1, 0x58 - muls r1, r2 - adds r0, r1 - adds r3, 0xC - adds r0, r3 - ldrh r0, [r0] - strh r0, [r4] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB6A5 - str r0, [r1] - ldrh r0, [r4] - movs r1, 0 - bl sub_80458E0 - ldr r1, =0x0202420c - strb r0, [r1] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 14 - b _08045FCA - .pool -_08045EE8: - subs r0, r2, r6 - lsls r0, 24 - lsrs r6, r0, 24 - bl GenerateRandomNumber - adds r4, r5, 0 - ands r4, r0 - cmp r4, r6 - bge _08045F64 - mov r1, r9 - ldrb r0, [r1] - mov r1, r8 - muls r1, r0 - adds r0, r7, 0 - adds r0, 0x4C - adds r0, r1, r0 - ldr r0, [r0] - ands r0, r5 - cmp r0, 0 - bne _08045F64 - adds r0, r1, r7 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x48 - beq _08045F64 - cmp r0, 0xF - beq _08045F64 - movs r2, 0 - ldr r0, =0x0202406c - ldrb r3, [r0] - mov r8, r0 - cmp r2, r3 - bge _08045F4A - ldr r0, [r7, 0x50] - movs r1, 0x70 - ands r0, r1 - cmp r0, 0 - bne _08045F4A - adds r1, r7, 0 - adds r1, 0x50 - movs r5, 0x70 -_08045F3A: - adds r1, 0x58 - adds r2, 0x1 - cmp r2, r3 - bge _08045F4A - ldr r0, [r1] - ands r0, r5 - cmp r0, 0 - beq _08045F3A -_08045F4A: - mov r0, r8 - ldrb r0, [r0] - cmp r2, r0 - bne _08045F64 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB6D9 - b _08045F7A - .pool -_08045F64: - subs r4, r6 - cmp r4, r6 - blt _08045F8C -_08045F6A: - bl GenerateRandomNumber - ldr r2, =0x02024332 - movs r1, 0x3 - ands r1, r0 - strb r1, [r2, 0x5] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB6AD -_08045F7A: - str r0, [r1] - movs r0, 0x1 - b _08045FD0 - .pool -_08045F8C: - ldr r4, =0x0202420b - ldrb r1, [r4] - movs r0, 0x58 - muls r1, r0 - ldr r0, =0x02024084 - adds r1, r0 - movs r0, 0x28 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - ldrb r0, [r4] - str r0, [sp, 0x8] - ldrb r0, [r4] - str r0, [sp, 0xC] - adds r0, r1, 0 - movs r2, 0x1 - movs r3, 0 - bl sub_806957C - ldr r1, =0x020241f0 - str r0, [r1] - ldr r1, =0x0202420c - ldrb r0, [r4] - strb r0, [r1] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB6F0 - str r0, [r1] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 12 -_08045FCA: - orrs r0, r1 - str r0, [r2] - movs r0, 0x2 -_08045FD0: - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8045CBC - - thumb_func_start atk00_attackcanceler -atk00_attackcanceler: @ 8045FFC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - ldr r0, =0x0202433a - ldrb r0, [r0] - cmp r0, 0 - beq _08046020 - ldr r1, =0x02024083 - movs r0, 0xC - strb r0, [r1] - b _08046398 - .pool -_08046020: - ldr r2, =0x02024084 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _08046064 - ldr r2, =0x02024280 - ldr r1, [r2] - movs r0, 0x80 - lsls r0, 2 - ands r0, r1 - cmp r0, 0 - bne _08046064 - movs r0, 0x80 - lsls r0, 12 - orrs r1, r0 - str r1, [r2] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082D8A4E - b _08046396 - .pool -_08046064: - bl sub_8041A6C - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - beq _08046072 - b _08046398 -_08046072: - ldr r0, =0x0202420c - ldrb r1, [r0] - str r2, [sp] - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _0804608A - b _08046398 -_0804608A: - ldr r4, =0x02024084 - ldr r0, =0x020241e8 - ldrb r1, [r0] - ldr r3, =0x0202420b - ldrb r2, [r3] - movs r0, 0x58 - muls r2, r0 - adds r1, r2 - adds r0, r4, 0 - adds r0, 0x24 - adds r1, r0 - ldrb r0, [r1] - ldr r5, =0x02024280 - cmp r0, 0 - bne _08046108 - ldr r0, =0x020241ea - ldrh r0, [r0] - cmp r0, 0xA5 - beq _08046108 - ldr r0, [r5] - ldr r1, =0x00800200 - ands r0, r1 - cmp r0, 0 - bne _08046108 - adds r0, r4, 0 - adds r0, 0x50 - adds r0, r2, r0 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 5 - ands r0, r1 - cmp r0, 0 - bne _08046108 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB07A - str r0, [r1] - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - b _08046398 - .pool -_08046108: - ldr r0, [r5] - ldr r1, =0xff7fffff - ands r0, r1 - str r0, [r5] - movs r6, 0x80 - lsls r6, 18 - ands r0, r6 - cmp r0, 0 - bne _08046160 - ldrb r1, [r3] - movs r0, 0x58 - muls r0, r1 - adds r1, r4, 0 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 5 - ands r0, r1 - cmp r0, 0 - bne _08046160 - bl sub_8045CBC - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - beq _08046160 - cmp r2, 0x2 - bne _08046150 - ldr r0, [r5] - orrs r0, r6 - str r0, [r5] - b _08046398 - .pool -_08046150: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] - b _08046398 - .pool -_08046160: - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 18 - orrs r0, r1 - str r0, [r2] - ldr r2, =0x0202433c - ldr r1, =0x0202420c - ldrb r3, [r1] - lsls r0, r3, 4 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 27 - mov r8, r1 - mov r9, r2 - cmp r0, 0 - bge _080461E8 - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x8] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080461E8 - ldr r0, =0x0202420b - ldrb r0, [r0] - ldr r2, =0x00000115 - adds r1, r3, 0 - bl sub_803F480 - mov r0, r8 - ldrb r1, [r0] - lsls r1, 4 - add r1, r9 - ldrb r2, [r1] - movs r0, 0x11 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB194 - b _08046396 - .pool -_080461E8: - movs r2, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r2, r0 - bge _0804622A - ldr r6, =0x0202433c - ldr r1, =gBattleMoves - mov r12, r1 - adds r5, r0, 0 - ldr r7, =0x0202407e -_080461FC: - adds r4, r2, r7 - ldrb r3, [r4] - lsls r0, r3, 4 - adds r0, r6 - ldrb r0, [r0] - lsls r0, 26 - cmp r0, 0 - bge _08046224 - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - add r0, r12 - ldrb r1, [r0, 0x8] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _08046224 - b _08046350 -_08046224: - adds r2, 0x1 - cmp r2, r5 - blt _080461FC -_0804622A: - ldr r0, =0x0202437c - mov r1, r8 - ldrb r2, [r1] - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r3, [r1] - lsls r0, r3, 30 - cmp r0, 0 - bge _08046288 - movs r0, 0x3 - negs r0, r0 - ands r0, r3 - strb r0, [r1] - ldr r4, =0x0202420a - movs r0, 0x1F - strb r0, [r4] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB53E - str r0, [r1] - mov r1, r8 - ldrb r0, [r1] - ldrb r1, [r4] - bl b_history__record_ability_usage_of_player - b _08046398 - .pool -_08046288: - lsls r0, r2, 4 - add r0, r9 - ldrb r0, [r0] - lsls r0, 31 - cmp r0, 0 - bne _08046296 - b _08046390 -_08046296: - ldr r1, =gBattleMoves - ldr r2, =0x020241ea - ldrh r3, [r2] - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x8] - movs r0, 0x2 - ands r0, r1 - adds r4, r2, 0 - cmp r0, 0 - beq _08046390 - cmp r3, 0xAE - bne _080462D4 - ldr r2, =0x02024084 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r1, r0, r2 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0x7 - beq _080462D4 - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0x7 - bne _08046390 -_080462D4: - ldrh r0, [r4] - bl sub_8052F48 - lsls r0, 24 - cmp r0, 0 - beq _080462FA - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 5 - ands r0, r1 - cmp r0, 0 - beq _08046390 -_080462FA: - ldr r0, =0x0202420b - ldrb r0, [r0] - bl b_cancel_multi_turn_move_maybe - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024250 - ldr r3, =0x0202420c - ldrb r0, [r3] - lsls r0, 1 - adds r0, r1 - movs r2, 0 - strh r2, [r0] - ldr r1, =0x02024258 - ldrb r0, [r3] - lsls r0, 1 - adds r0, r1 - strh r2, [r0] - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x6] - b _08046390 - .pool -_08046350: - ldr r0, =0x0202420b - ldrb r0, [r0] - ldr r2, =0x00000121 - adds r1, r3, 0 - bl sub_803F480 - ldrb r1, [r4] - lsls r1, 4 - adds r1, r6 - ldrb r2, [r1] - movs r0, 0x21 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, =0x02024474 - ldrb r0, [r4] - strb r0, [r1, 0x17] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB1AC - b _08046396 - .pool -_08046390: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 -_08046396: - str r0, [r1] -_08046398: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk00_attackcanceler - - thumb_func_start mcmd_jump_if_move_not_executed -mcmd_jump_if_move_not_executed: @ 80463AC - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r6, r1, 16 - ldr r1, =0x02024214 - ldr r5, [r1] - adds r4, r5, r0 - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _0804640C - ldr r1, =0x02024250 - ldr r3, =0x0202420c - ldrb r0, [r3] - lsls r0, 1 - adds r0, r1 - movs r2, 0 - strh r2, [r0] - ldr r1, =0x02024258 - ldrb r0, [r3] - lsls r0, 1 - adds r0, r1 - strh r2, [r0] - ldrb r4, [r5, 0x1] - ldrb r0, [r5, 0x2] - lsls r0, 8 - orrs r4, r0 - ldrb r0, [r5, 0x3] - lsls r0, 16 - orrs r4, r0 - ldrb r0, [r5, 0x4] - lsls r0, 24 - orrs r4, r0 - b _08046426 - .pool -_0804640C: - bl b_feature_update_destiny_bond - ldr r0, =0x0202420c - ldrb r1, [r0] - str r6, [sp] - movs r0, 0x3 - movs r2, 0 - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - bne _0804642A -_08046426: - ldr r0, =0x02024214 - str r4, [r0] -_0804642A: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end mcmd_jump_if_move_not_executed - - thumb_func_start atk40_801DBA0 -atk40_801DBA0: @ 804643C - push {lr} - ldr r1, =0x0202433c - ldr r0, =0x0202420c - ldrb r0, [r0] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 31 - cmp r0, 0 - beq _0804649C - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x8] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0804649C - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x5 - movs r1, 0 - bl mcmd_jump_if_move_not_executed - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x6] - b _080464A4 - .pool -_0804649C: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_080464A4: - pop {r0} - bx r0 - .pool - thumb_func_end atk40_801DBA0 - - thumb_func_start sub_80464AC -sub_80464AC: @ 80464AC - push {r4,lr} - lsls r0, 16 - lsrs r3, r0, 16 - movs r4, 0 - ldr r1, =0x0202433c - ldr r0, =0x0202420c - ldrb r0, [r0] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 31 - cmp r0, 0 - beq _080464F8 - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x8] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080464F8 - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x7 - adds r1, r3, 0 - bl mcmd_jump_if_move_not_executed - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x6] - movs r4, 0x1 -_080464F8: - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80464AC - - thumb_func_start sub_8046518 -sub_8046518: @ 8046518 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r2, =0x020242ac - ldr r3, =0x0202420c - ldrb r4, [r3] - lsls r0, r4, 2 - adds r0, r2 - ldr r1, [r0] - movs r0, 0x18 - ands r1, r0 - adds r6, r2, 0 - cmp r1, 0 - beq _0804654A - ldr r1, =0x020242bc - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - adds r0, r1 - ldr r1, =0x0202420b - ldrb r0, [r0, 0x15] - ldrb r1, [r1] - cmp r0, r1 - beq _08046634 -_0804654A: - ldr r0, =0x02024280 - ldr r1, [r0] - movs r2, 0x80 - lsls r2, 9 - ands r1, r2 - adds r2, r0, 0 - cmp r1, 0 - bne _08046590 - ldrb r0, [r3] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08046590 -_0804656A: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] - b _08046634 - .pool -_08046590: - ldr r0, [r2] - ldr r1, =0xfffeffff - ands r0, r1 - str r0, [r2] - movs r1, 0x80 - lsls r1, 10 - ands r0, r1 - cmp r0, 0 - bne _080465B2 - ldrb r0, [r3] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0804656A -_080465B2: - ldr r0, [r2] - ldr r1, =0xfffdffff - ands r0, r1 - str r0, [r2] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - bne _080465D2 - ldrb r0, [r3] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - ands r0, r1 - cmp r0, 0 - bne _0804656A -_080465D2: - ldr r0, [r2] - ldr r1, =0xfffbffff - ands r0, r1 - str r0, [r2] - movs r0, 0 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - lsls r4, r5, 1 - cmp r0, 0 - bne _08046622 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0x4D - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - bne _08046622 - ldr r0, =0x020243cc - ldrh r1, [r0] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - beq _08046622 - ldr r0, =gBattleMoves - adds r1, r4, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x98 - beq _08046634 -_08046622: - ldr r1, =gBattleMoves - adds r0, r4, r5 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x11 - beq _08046634 - cmp r0, 0x4E - bne _08046654 -_08046634: - movs r0, 0x7 - adds r1, r5, 0 - bl mcmd_jump_if_move_not_executed - movs r0, 0x1 - b _08046656 - .pool -_08046654: - movs r0, 0 -_08046656: - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8046518 - - thumb_func_start atk01_accuracycheck -atk01_accuracycheck: @ 8046660 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - ldr r0, =0x02024214 - ldr r5, [r0] - ldrb r6, [r5, 0x5] - ldrb r1, [r5, 0x6] - lsls r1, 8 - orrs r6, r1 - adds r1, r6, 0x2 - lsls r1, 16 - lsrs r1, 16 - adds r7, r0, 0 - cmp r1, 0x1 - bhi _0804671C - ldr r2, =0x020242ac - ldr r3, =0x0202420c - ldrb r4, [r3] - lsls r0, r4, 2 - adds r0, r2 - ldr r1, [r0] - movs r0, 0x18 - ands r1, r0 - cmp r1, 0 - beq _080466D0 - ldr r0, =0x0000ffff - cmp r6, r0 - bne _080466D0 - ldr r1, =0x020242bc - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - adds r0, r1 - ldr r1, =0x0202420b - ldrb r0, [r0, 0x15] - ldrb r1, [r1] - cmp r0, r1 - bne _080466D0 - adds r0, r5, 0x7 - str r0, [r7] - b _080469D2 - .pool -_080466D0: - ldrb r0, [r3] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ldr r1, =0x000400c0 - ands r0, r1 - cmp r0, 0 - beq _08046700 - ldr r2, [r7] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r7] - b _080469D2 - .pool -_08046700: - movs r0, 0 - bl sub_80464AC - lsls r0, 24 - cmp r0, 0 - beq _0804670E - b _080469D2 -_0804670E: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x7 - str r0, [r1] - b _080469D2 - .pool -_0804671C: - cmp r6, 0 - bne _08046724 - ldr r0, =0x020241ea - ldrh r6, [r0] -_08046724: - ldr r0, =0x0202449c - ldr r0, [r0] - ldrb r0, [r0, 0x13] - cmp r0, 0 - beq _08046744 - movs r1, 0x3F - mov r10, r1 - mov r2, r10 - ands r2, r0 - mov r10, r2 - b _08046752 - .pool -_08046744: - ldr r1, =gBattleMoves - lsls r0, r6, 1 - adds r0, r6 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x2] - mov r10, r0 -_08046752: - adds r0, r6, 0 - bl sub_80464AC - lsls r0, 24 - cmp r0, 0 - beq _08046760 - b _080469D2 -_08046760: - adds r0, r6, 0 - bl sub_8046518 - lsls r0, 24 - cmp r0, 0 - beq _0804676E - b _080469D2 -_0804676E: - ldr r3, =0x02024084 - ldr r0, =0x0202420c - ldrb r0, [r0] - movs r2, 0x58 - adds r4, r0, 0 - muls r4, r2 - adds r0, r3, 0 - adds r0, 0x50 - adds r0, r4, r0 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 22 - ands r0, r1 - cmp r0, 0 - beq _080467A8 - ldr r0, =0x0202420b - ldrb r0, [r0] - muls r0, r2 - adds r0, r3 - ldrb r5, [r0, 0x1E] - b _080467BE - .pool -_080467A8: - ldr r0, =0x0202420b - ldrb r0, [r0] - muls r0, r2 - adds r0, r3 - ldrb r0, [r0, 0x1E] - adds r0, 0x6 - adds r1, r4, r3 - ldrb r1, [r1, 0x1F] - subs r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 -_080467BE: - lsls r0, r5, 24 - cmp r0, 0 - bge _080467C6 - movs r5, 0 -_080467C6: - lsls r0, r5, 24 - asrs r0, 24 - cmp r0, 0xC - ble _080467D0 - movs r5, 0xC -_080467D0: - ldr r1, =gBattleMoves - lsls r4, r6, 1 - adds r0, r4, r6 - lsls r0, 2 - adds r7, r0, r1 - ldrb r3, [r7, 0x3] - mov r8, r3 - movs r0, 0 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - str r4, [sp, 0x4] - cmp r0, 0 - bne _08046822 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0x4D - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - bne _08046822 - ldr r0, =0x020243cc - ldrh r1, [r0] - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - beq _08046822 - ldrb r0, [r7] - cmp r0, 0x98 - bne _08046822 - movs r0, 0x32 - mov r8, r0 -_08046822: - ldr r1, =gUnknown_0831C0F4 - lsls r0, r5, 24 - asrs r0, 22 - adds r0, r1 - ldrb r1, [r0] - mov r4, r8 - muls r4, r1 - ldrb r1, [r0, 0x1] - adds r0, r4, 0 - bl __divsi3 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r7, =0x02024084 - ldr r0, =0x0202420b - ldrb r0, [r0] - movs r5, 0x58 - muls r0, r5 - adds r0, r7 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0xE - bne _08046860 - lsls r0, r4, 6 - adds r0, r4 - lsls r0, 1 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r4, r0, 16 -_08046860: - movs r0, 0 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _080468B8 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0x4D - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - bne _080468B8 - ldr r0, =0x0202420c - ldrb r0, [r0] - muls r0, r5 - adds r0, r7 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x8 - bne _080468B8 - ldr r0, =0x020243cc - ldrh r1, [r0] - movs r0, 0x18 - ands r0, r1 - cmp r0, 0 - beq _080468B8 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 4 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r4, r0, 16 -_080468B8: - ldr r2, =0x02024084 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x20 - ldrb r0, [r0] - mov r9, r2 - cmp r0, 0x37 - bne _080468E4 - mov r1, r10 - cmp r1, 0x8 - bhi _080468E4 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 4 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r4, r0, 16 -_080468E4: - ldr r2, =0x0202420c - mov r8, r2 - ldrb r2, [r2] - movs r7, 0x58 - adds r0, r2, 0 - muls r0, r7 - mov r3, r9 - adds r1, r0, r3 - ldrh r0, [r1, 0x2E] - cmp r0, 0xAF - bne _08046928 - ldr r1, =0x02024404 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r5, [r0, 0x7] - ldrb r2, [r0, 0x1A] - b _08046944 - .pool -_08046928: - ldrh r0, [r1, 0x2E] - bl itemid_get_x12 - lsls r0, 24 - lsrs r5, r0, 24 - mov r1, r8 - ldrb r0, [r1] - muls r0, r7 - add r0, r9 - ldrh r0, [r0, 0x2E] - bl itemid_get_quality - lsls r0, 24 - lsrs r2, r0, 24 -_08046944: - ldr r0, =0x0202420f - ldr r1, =0x0202420c - ldrb r1, [r1] - strb r1, [r0] - cmp r5, 0x16 - bne _08046960 - movs r0, 0x64 - subs r0, r2 - muls r0, r4 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r4, r0, 16 -_08046960: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - adds r0, 0x1 - cmp r0, r4 - ble _080469CA - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080469C0 - ldr r1, =gBattleMoves - ldr r2, [sp, 0x4] - adds r0, r2, r6 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x6] - cmp r0, 0x8 - beq _080469A2 - cmp r0, 0x20 - bne _080469C0 -_080469A2: - ldr r1, =0x02024332 - movs r0, 0x2 - b _080469C4 - .pool -_080469C0: - ldr r1, =0x02024332 - movs r0, 0 -_080469C4: - strb r0, [r1, 0x6] - bl b_wonderguard_and_levitate -_080469CA: - movs r0, 0x7 - adds r1, r6, 0 - bl mcmd_jump_if_move_not_executed -_080469D2: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk01_accuracycheck - - thumb_func_start atk02_attackstring -atk02_attackstring: @ 80469E8 - push {r4,r5,lr} - ldr r0, =0x02024068 - ldr r5, [r0] - cmp r5, 0 - bne _08046A20 - ldr r4, =0x02024280 - ldr r0, [r4] - movs r1, 0xC0 - lsls r1, 3 - ands r0, r1 - cmp r0, 0 - bne _08046A14 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x4 - bl b_std_message - ldr r0, [r4] - movs r1, 0x80 - lsls r1, 3 - orrs r0, r1 - str r0, [r4] -_08046A14: - ldr r0, =0x02024214 - ldr r1, [r0] - adds r1, 0x1 - str r1, [r0] - ldr r0, =0x02024332 - strb r5, [r0, 0x7] -_08046A20: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk02_attackstring - - thumb_func_start atk03_ppreduce -atk03_ppreduce: @ 8046A3C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r6, 0x1 - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - beq _08046A54 - b _08046BEE -_08046A54: - ldr r1, =0x0202437c - ldr r2, =0x0202420b - ldrb r3, [r2] - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r4, r0, 31 - mov r9, r2 - cmp r4, 0 - bne _08046AF6 - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x6] - cmp r0, 0x20 - beq _08046AA6 - cmp r0, 0x20 - bgt _08046AA0 - cmp r0, 0x8 - beq _08046ABC - b _08046AD6 - .pool -_08046AA0: - cmp r0, 0x40 - beq _08046ABC - b _08046AD6 -_08046AA6: - str r4, [sp] - movs r0, 0x12 - adds r1, r3, 0 - movs r2, 0x2E - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0x1 - b _08046AF6 -_08046ABC: - mov r0, r9 - ldrb r1, [r0] - movs r0, 0 - str r0, [sp] - movs r0, 0x10 - movs r2, 0x2E - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - adds r6, r0 - b _08046AF6 -_08046AD6: - ldr r1, =0x0202420c - mov r2, r9 - ldrb r0, [r2] - ldrb r7, [r1] - cmp r0, r7 - beq _08046AF6 - ldr r2, =0x02024084 - ldrb r1, [r1] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x2E - bne _08046AF6 - adds r6, 0x1 -_08046AF6: - ldr r0, =0x02024280 - ldr r4, [r0] - movs r0, 0xA0 - lsls r0, 4 - ands r4, r0 - cmp r4, 0 - bne _08046BDC - ldr r2, =0x02024084 - ldr r3, =0x020241e8 - ldr r1, =0x0202420b - ldrb r5, [r1] - movs r0, 0x58 - mov r8, r0 - mov r0, r8 - muls r0, r5 - ldrb r7, [r3] - adds r0, r7 - movs r7, 0x24 - adds r7, r2 - mov r12, r7 - add r0, r12 - ldrb r0, [r0] - mov r9, r1 - mov r10, r2 - adds r7, r3, 0 - cmp r0, 0 - beq _08046BDC - ldr r0, =0x0202433c - lsls r1, r5, 4 - adds r1, r0 - ldrb r0, [r1, 0x2] - movs r2, 0x8 - orrs r0, r2 - strb r0, [r1, 0x2] - mov r1, r9 - ldrb r0, [r1] - mov r2, r8 - muls r2, r0 - adds r0, r2, 0 - ldrb r1, [r7] - adds r0, r1 - mov r1, r12 - adds r2, r0, r1 - ldrb r0, [r2] - cmp r0, r6 - ble _08046B70 - subs r0, r6 - strb r0, [r2] - b _08046B72 - .pool -_08046B70: - strb r4, [r2] -_08046B72: - mov r2, r9 - ldrb r3, [r2] - movs r4, 0x58 - adds r0, r3, 0 - muls r0, r4 - mov r1, r10 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 14 - ands r0, r1 - cmp r0, 0 - bne _08046BDC - ldr r1, =0x020242bc - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x18] - lsrs r1, 4 - ldr r2, =gUnknown_0832A328 - ldrb r0, [r7] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _08046BDC - ldr r0, =0x02024064 - strb r3, [r0] - ldrb r1, [r7] - adds r1, 0x9 - lsls r1, 24 - lsrs r1, 24 - mov r2, r9 - ldrb r0, [r2] - muls r0, r4 - mov r2, r10 - adds r2, 0x24 - adds r0, r2 - ldrb r7, [r7] - adds r0, r7 - str r0, [sp] - movs r0, 0 - movs r2, 0 - movs r3, 0x1 - bl dp01_build_cmdbuf_x02_a_b_varargs - mov r7, r9 - ldrb r0, [r7] - bl dp01_battle_side_mark_buffer_for_execution -_08046BDC: - ldr r2, =0x02024280 - ldr r0, [r2] - ldr r1, =0xfffff7ff - ands r0, r1 - str r0, [r2] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] -_08046BEE: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk03_ppreduce - - thumb_func_start atk04_critcalc -atk04_critcalc: @ 8046C18 - push {r4-r7,lr} - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldrh r0, [r0, 0x2E] - cmp r0, 0xAF - bne _08046C48 - ldr r1, =0x02024404 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r6, [r0, 0x7] - b _08046C50 - .pool -_08046C48: - bl itemid_get_x12 - lsls r0, 24 - lsrs r6, r0, 24 -_08046C50: - ldr r1, =0x0202420f - ldr r3, =0x0202420b - ldrb r0, [r3] - strb r0, [r1] - ldr r4, =0x02024084 - ldrb r1, [r3] - movs r0, 0x58 - adds r7, r1, 0 - muls r7, r0 - adds r0, r4, 0 - adds r0, 0x50 - adds r0, r7, r0 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 13 - ands r0, r1 - negs r0, r0 - asrs r5, r0, 31 - movs r0, 0x2 - ands r5, r0 - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - mov r12, r3 - cmp r1, 0x2B - bne _08046C90 - adds r5, 0x1 -_08046C90: - adds r0, r5, 0 - cmp r1, 0x4B - bne _08046C98 - adds r0, 0x1 -_08046C98: - cmp r1, 0xC8 - bne _08046C9E - adds r0, 0x1 -_08046C9E: - adds r2, r0, 0 - cmp r1, 0xD1 - bne _08046CA6 - adds r2, 0x1 -_08046CA6: - movs r1, 0 - cmp r6, 0x3F - bne _08046CB6 - adds r0, r7, r4 - ldrh r0, [r0] - cmp r0, 0x71 - bne _08046CB6 - movs r1, 0x1 -_08046CB6: - lsls r5, r1, 1 - movs r3, 0 - cmp r6, 0x42 - bne _08046CD0 - mov r0, r12 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r4 - ldrh r0, [r0] - cmp r0, 0x53 - bne _08046CD0 - movs r3, 0x1 -_08046CD0: - lsls r1, r3, 1 - cmp r6, 0x29 - bne _08046CF0 - adds r0, r5, 0x1 - adds r0, r2, r0 - b _08046CF2 - .pool -_08046CF0: - adds r0, r2, r5 -_08046CF2: - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - adds r5, r0, 0 - cmp r5, 0x4 - bls _08046D00 - movs r5, 0x4 -_08046D00: - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r4 - adds r0, 0x20 - ldrb r4, [r0] - cmp r4, 0x4 - beq _08046D70 - cmp r4, 0x4B - beq _08046D70 - ldr r1, =0x020242ac - mov r2, r12 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - bne _08046D70 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x84 - lsls r1, 2 - ands r0, r1 - cmp r0, 0 - bne _08046D70 - bl GenerateRandomNumber - ldr r2, =gUnknown_0831C128 - lsls r1, r5, 1 - adds r1, r2 - lsls r0, 16 - lsrs r0, 16 - ldrh r1, [r1] - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - bne _08046D70 - ldr r1, =0x02024211 - movs r0, 0x2 - b _08046D74 - .pool -_08046D70: - ldr r1, =0x02024211 - movs r0, 0x1 -_08046D74: - strb r0, [r1] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk04_critcalc - - thumb_func_start atk05_cmd5 -atk05_cmd5: @ 8046D8C - push {r4-r7,lr} - sub sp, 0x10 - ldr r4, =0x0202428e - ldr r5, =0x0202420c - ldrb r0, [r5] - bl battle_get_per_side_status - movs r1, 0x1 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - ldrh r3, [r1] - ldr r6, =0x0202420b - ldrb r0, [r6] - movs r4, 0x58 - muls r0, r4 - ldr r2, =0x02024084 - adds r0, r2 - ldrb r1, [r5] - muls r1, r4 - adds r1, r2 - ldr r7, =0x020241ea - ldrh r2, [r7] - ldr r4, =0x02024400 - ldrh r4, [r4] - str r4, [sp] - ldr r4, =0x0202449c - ldr r4, [r4] - ldrb r4, [r4, 0x13] - str r4, [sp, 0x4] - ldrb r4, [r6] - str r4, [sp, 0x8] - ldrb r4, [r5] - str r4, [sp, 0xC] - bl sub_806957C - ldr r4, =0x020241f0 - ldr r1, =0x02024211 - ldrb r1, [r1] - muls r1, r0 - ldr r0, =0x02024474 - ldrb r0, [r0, 0xE] - adds r3, r1, 0 - muls r3, r0 - str r3, [r4] - ldr r1, =0x020242ac - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 2 - ands r0, r1 - cmp r0, 0 - beq _08046E10 - ldr r2, =gBattleMoves - ldrh r1, [r7] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x2] - cmp r0, 0xD - bne _08046E10 - lsls r0, r3, 1 - str r0, [r4] -_08046E10: - ldr r1, =0x0202433c - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 28 - cmp r0, 0 - bge _08046E32 - ldr r4, =0x020241f0 - ldr r1, [r4] - lsls r0, r1, 4 - subs r0, r1 - movs r1, 0xA - bl __divsi3 - str r0, [r4] -_08046E32: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - add sp, 0x10 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk05_cmd5 - - thumb_func_start sub_8046E7C -sub_8046E7C: @ 8046E7C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - adds r5, r1, 0 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r4, =0x0202428e - adds r0, r5, 0 - bl battle_get_per_side_status - movs r1, 0x1 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - ldrh r3, [r1] - movs r1, 0x58 - adds r0, r7, 0 - muls r0, r1 - ldr r2, =0x02024084 - adds r0, r2 - muls r1, r5 - adds r1, r2 - ldr r2, =0x020241ea - mov r8, r2 - ldrh r2, [r2] - ldr r6, =0x02024400 - ldrh r4, [r6] - str r4, [sp] - ldr r4, =0x0202449c - ldr r4, [r4] - ldrb r4, [r4, 0x13] - str r4, [sp, 0x4] - str r7, [sp, 0x8] - str r5, [sp, 0xC] - bl sub_806957C - ldr r4, =0x020241f0 - movs r1, 0 - strh r1, [r6] - ldr r1, =0x02024211 - ldrb r1, [r1] - muls r1, r0 - ldr r0, =0x02024474 - ldrb r0, [r0, 0xE] - adds r3, r1, 0 - muls r3, r0 - str r3, [r4] - ldr r1, =0x020242ac - lsls r0, r7, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 2 - ands r0, r1 - cmp r0, 0 - beq _08046F0A - ldr r2, =gBattleMoves - mov r0, r8 - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x2] - cmp r0, 0xD - bne _08046F0A - lsls r0, r3, 1 - str r0, [r4] -_08046F0A: - ldr r0, =0x0202433c - lsls r1, r7, 4 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 28 - cmp r0, 0 - bge _08046F28 - ldr r4, =0x020241f0 - ldr r1, [r4] - lsls r0, r1, 4 - subs r0, r1 - movs r1, 0xA - bl __divsi3 - str r0, [r4] -_08046F28: - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8046E7C - - thumb_func_start battle_attack_damage_modulate_by_effectivity -battle_attack_damage_modulate_by_effectivity: @ 8046F60 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r5, =0x020241f0 - ldr r0, [r5] - muls r0, r4 - movs r1, 0xA - bl __divsi3 - str r0, [r5] - cmp r0, 0 - bne _08046F80 - cmp r4, 0 - beq _08046F80 - movs r0, 0x1 - str r0, [r5] -_08046F80: - cmp r4, 0x5 - beq _08046FB0 - cmp r4, 0x5 - bgt _08046F94 - cmp r4, 0 - beq _08046F9A - b _08047032 - .pool -_08046F94: - cmp r4, 0x14 - beq _08046FF0 - b _08047032 -_08046F9A: - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x8 - orrs r0, r1 - movs r1, 0xFB - ands r0, r1 - movs r1, 0xFD - ands r0, r1 - b _08047030 - .pool -_08046FB0: - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0 - beq _08047032 - ldr r2, =0x0202427c - ldrb r1, [r2] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - bne _08047032 - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08046FEC - movs r0, 0xFD - ands r0, r1 - b _08047030 - .pool -_08046FEC: - movs r0, 0x4 - b _0804702E -_08046FF0: - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0 - beq _08047032 - ldr r2, =0x0202427c - ldrb r1, [r2] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - bne _08047032 - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0804702C - movs r0, 0xFB - ands r0, r1 - b _08047030 - .pool -_0804702C: - movs r0, 0x2 -_0804702E: - orrs r0, r1 -_08047030: - strb r0, [r2] -_08047032: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end battle_attack_damage_modulate_by_effectivity - - thumb_func_start sub_8047038 -sub_8047038: @ 8047038 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - movs r3, 0 - ldr r1, =0x020241ea - ldrh r0, [r1] - cmp r0, 0xA5 - bne _0804704C - b _08047260 -_0804704C: - ldr r0, =0x0202449c - ldr r0, [r0] - ldrb r0, [r0, 0x13] - cmp r0, 0 - beq _08047068 - movs r1, 0x3F - mov r8, r1 - ands r1, r0 - mov r8, r1 - b _08047078 - .pool -_08047068: - ldr r2, =gBattleMoves - ldrh r1, [r1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x2] - mov r8, r0 -_08047078: - ldr r2, =0x02024084 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r1, r0, r2 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r0, [r0] - adds r5, r2, 0 - cmp r0, r8 - beq _0804709A - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, r8 - bne _080470B0 -_0804709A: - ldr r4, =0x020241f0 - ldr r1, [r4] - lsls r0, r1, 4 - subs r0, r1 - str r0, [r4] - movs r1, 0xA - str r3, [sp, 0x4] - bl __divsi3 - str r0, [r4] - ldr r3, [sp, 0x4] -_080470B0: - ldr r2, =0x0202420c - ldrb r1, [r2] - movs r0, 0x58 - muls r0, r1 - adds r0, r5 - adds r0, 0x20 - ldrb r0, [r0] - adds r4, r2, 0 - cmp r0, 0x1A - bne _08047128 - mov r1, r8 - cmp r1, 0x4 - bne _08047128 - ldr r3, =0x0202420a - strb r0, [r3] - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x9 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024250 - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - movs r2, 0 - strh r2, [r0] - ldr r1, =0x02024258 - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - strh r2, [r0] - ldr r0, =0x02024332 - mov r1, r8 - strb r1, [r0, 0x6] - ldrb r0, [r4] - ldrb r1, [r3] - bl b_history__record_ability_usage_of_player - b _080471C4 - .pool -_08047128: - ldr r1, =gUnknown_0831ACE8 - adds r0, r3, r1 - ldrb r0, [r0] - adds r2, r1, 0 - b _080471A4 - .pool -_08047138: - adds r3, 0x3 - b _080471A0 -_0804713C: - ldr r5, =gUnknown_0831ACE8 - adds r0, r3, r5 - ldrb r0, [r0] - cmp r0, r8 - bne _08047198 - adds r1, r3, 0x1 - adds r1, r5 - ldr r2, =0x02024084 - ldr r7, =0x0202420c - ldrb r0, [r7] - movs r6, 0x58 - muls r0, r6 - adds r0, r2 - adds r0, 0x21 - ldrb r4, [r1] - ldrb r0, [r0] - cmp r4, r0 - bne _08047172 - adds r0, r3, 0x2 - adds r0, r5 - ldrb r0, [r0] - str r2, [sp] - str r3, [sp, 0x4] - bl battle_attack_damage_modulate_by_effectivity - ldr r3, [sp, 0x4] - ldr r2, [sp] -_08047172: - ldrb r0, [r7] - muls r0, r6 - adds r0, r2 - adds r1, r0, 0 - adds r1, 0x22 - ldrb r1, [r1] - cmp r4, r1 - bne _08047198 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, r4 - beq _08047198 - adds r0, r3, 0x2 - adds r0, r5 - ldrb r0, [r0] - str r3, [sp, 0x4] - bl battle_attack_damage_modulate_by_effectivity - ldr r3, [sp, 0x4] -_08047198: - adds r3, 0x3 - ldr r5, =0x02024084 - ldr r4, =0x0202420c - ldr r2, =gUnknown_0831ACE8 -_080471A0: - adds r0, r3, r2 - ldrb r0, [r0] -_080471A4: - cmp r0, 0xFF - beq _080471C4 - cmp r0, 0xFE - bne _0804713C - ldrb r1, [r4] - movs r0, 0x58 - muls r0, r1 - adds r1, r5, 0 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 22 - ands r0, r1 - cmp r0, 0 - beq _08047138 -_080471C4: - ldr r2, =0x02024084 - ldr r5, =0x0202420c - ldrb r1, [r5] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x20 - ldrb r6, [r0] - cmp r6, 0x19 - bne _08047242 - ldr r0, =0x0202420b - ldrb r0, [r0] - ldr r7, =0x020241ea - ldrh r1, [r7] - bl move_weather_interaction - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08047242 - ldr r1, =0x0202427c - mov r8, r1 - ldrb r4, [r1] - ands r0, r4 - cmp r0, 0 - beq _08047200 - movs r0, 0x6 - ands r0, r4 - cmp r0, 0x6 - bne _08047242 -_08047200: - ldr r2, =gBattleMoves - ldrh r1, [r7] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0 - beq _08047242 - ldr r3, =0x0202420a - strb r6, [r3] - movs r0, 0x1 - orrs r0, r4 - mov r1, r8 - strb r0, [r1] - ldr r1, =0x02024250 - ldrb r0, [r5] - lsls r0, 1 - adds r0, r1 - movs r2, 0 - strh r2, [r0] - ldr r1, =0x02024258 - ldrb r0, [r5] - lsls r0, 1 - adds r0, r1 - strh r2, [r0] - ldr r1, =0x02024332 - movs r0, 0x3 - strb r0, [r1, 0x6] - ldrb r0, [r5] - ldrb r1, [r3] - bl b_history__record_ability_usage_of_player -_08047242: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _08047260 - ldr r2, =0x0202433c - ldr r0, =0x0202420b - ldrb r1, [r0] - lsls r1, 4 - adds r1, r2 - ldrb r0, [r1, 0x1] - movs r2, 0x2 - orrs r0, r2 - strb r0, [r1, 0x1] -_08047260: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8047038 - - thumb_func_start b_wonderguard_and_levitate -b_wonderguard_and_levitate: @ 80472A8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r6, 0 - movs r5, 0 - ldr r0, =0x020241ea - ldrh r1, [r0] - mov r9, r0 - cmp r1, 0xA5 - bne _080472C0 - b _08047508 -_080472C0: - ldr r2, =gBattleMoves - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - ldrb r0, [r1, 0x1] - cmp r0, 0 - bne _080472D2 - b _08047508 -_080472D2: - ldr r0, =0x0202449c - ldr r0, [r0] - ldrb r0, [r0, 0x13] - cmp r0, 0 - beq _080472F4 - movs r1, 0x3F - mov r12, r1 - mov r2, r12 - ands r2, r0 - mov r12, r2 - b _080472F8 - .pool -_080472F4: - ldrb r1, [r1, 0x2] - mov r12, r1 -_080472F8: - ldr r2, =0x02024084 - ldr r3, =0x0202420c - ldrb r1, [r3] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x20 - ldrb r1, [r0] - adds r7, r2, 0 - mov r8, r3 - cmp r1, 0x1A - bne _0804733C - mov r0, r12 - cmp r0, 0x4 - bne _0804733C - ldr r0, =0x0202420a - strb r1, [r0] - ldr r0, =0x02024332 - mov r1, r12 - strb r1, [r0, 0x6] - ldrb r0, [r3] - movs r1, 0x1A - bl b_history__record_ability_usage_of_player - b _08047508 - .pool -_0804733C: - ldr r1, =gUnknown_0831ACE8 - adds r0, r5, r1 - ldrb r0, [r0] - adds r4, r1, 0 - b _0804748E - .pool -_0804734C: - adds r0, r5, r4 - ldrb r0, [r0] - cmp r0, r12 - beq _08047356 - b _08047488 -_08047356: - adds r2, r5, 0x1 - adds r3, r2, r4 - mov r0, r8 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r7 - adds r0, 0x21 - ldrb r1, [r3] - adds r3, r2, 0 - ldrb r0, [r0] - cmp r1, r0 - bne _08047396 - adds r0, r5, 0x2 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - bne _08047396 - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x8 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x0202433c - ldr r0, =0x0202420b - ldrb r2, [r0] - lsls r2, 4 - adds r2, r1 - ldrb r0, [r2, 0x1] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2, 0x1] -_08047396: - adds r2, r3, r4 - mov r0, r8 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r7 - adds r1, r0, 0 - adds r1, 0x22 - ldrb r2, [r2] - ldrb r1, [r1] - cmp r2, r1 - bne _080473DC - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, r2 - beq _080473DC - adds r0, r5, 0x2 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - bne _080473DC - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x8 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x0202433c - ldr r0, =0x0202420b - ldrb r2, [r0] - lsls r2, 4 - adds r2, r1 - ldrb r0, [r2, 0x1] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2, 0x1] -_080473DC: - adds r2, r3, r4 - mov r0, r8 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r7 - adds r0, 0x21 - ldrb r1, [r2] - ldrb r0, [r0] - cmp r1, r0 - bne _08047400 - adds r0, r5, 0x2 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0x14 - bne _08047400 - movs r0, 0x1 - orrs r6, r0 -_08047400: - adds r2, r3, r4 - mov r0, r8 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r7 - adds r1, r0, 0 - adds r1, 0x22 - ldrb r2, [r2] - ldrb r1, [r1] - cmp r2, r1 - bne _0804742E - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, r2 - beq _0804742E - adds r0, r5, 0x2 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0x14 - bne _0804742E - movs r0, 0x1 - orrs r6, r0 -_0804742E: - adds r2, r3, r4 - mov r0, r8 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r7 - adds r0, 0x21 - ldrb r1, [r2] - ldrb r0, [r0] - cmp r1, r0 - bne _08047456 - adds r0, r5, 0x2 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0x5 - bne _08047456 - movs r0, 0x2 - orrs r6, r0 - lsls r0, r6, 24 - lsrs r6, r0, 24 -_08047456: - adds r2, r3, r4 - mov r0, r8 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r7 - adds r1, r0, 0 - adds r1, 0x22 - ldrb r2, [r2] - ldrb r1, [r1] - cmp r2, r1 - bne _08047488 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, r2 - beq _08047488 - adds r0, r5, 0x2 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0x5 - bne _08047488 - movs r0, 0x2 - orrs r6, r0 - lsls r0, r6, 24 - lsrs r6, r0, 24 -_08047488: - adds r5, 0x3 - adds r0, r5, r4 - ldrb r0, [r0] -_0804748E: - cmp r0, 0xFF - beq _080474B2 - cmp r0, 0xFE - beq _08047498 - b _0804734C -_08047498: - mov r2, r8 - ldrb r1, [r2] - movs r0, 0x58 - muls r0, r1 - adds r1, r7, 0 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 22 - ands r0, r1 - cmp r0, 0 - beq _08047488 -_080474B2: - mov r0, r8 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r7 - adds r0, 0x20 - ldrb r4, [r0] - cmp r4, 0x19 - bne _08047508 - ldr r0, =0x0202420b - ldrb r0, [r0] - mov r2, r9 - ldrh r1, [r2] - bl move_weather_interaction - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08047508 - movs r0, 0x3 - ands r6, r0 - cmp r6, 0x1 - beq _08047508 - ldr r2, =gBattleMoves - mov r0, r9 - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0 - beq _08047508 - ldr r0, =0x0202420a - strb r4, [r0] - ldr r1, =0x02024332 - movs r0, 0x3 - strb r0, [r1, 0x6] - mov r1, r8 - ldrb r0, [r1] - movs r1, 0x19 - bl b_history__record_ability_usage_of_player -_08047508: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end b_wonderguard_and_levitate - - thumb_func_start b_attack_effectivity_adapt -b_attack_effectivity_adapt: @ 804752C - push {r4-r7,lr} - adds r6, r2, 0 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 16 - lsrs r5, r1, 16 - ldr r7, =0x020241f0 - ldr r0, [r7] - muls r0, r4 - movs r1, 0xA - bl __divsi3 - str r0, [r7] - cmp r0, 0 - bne _08047552 - cmp r4, 0 - beq _08047552 - movs r0, 0x1 - str r0, [r7] -_08047552: - cmp r4, 0x5 - beq _0804757A - cmp r4, 0x5 - bgt _08047564 - cmp r4, 0 - beq _0804756A - b _080475DE - .pool -_08047564: - cmp r4, 0x14 - beq _080475AC - b _080475DE -_0804756A: - ldrb r0, [r6] - movs r1, 0x8 - orrs r0, r1 - movs r1, 0xFB - ands r0, r1 - movs r1, 0xFD - ands r0, r1 - b _080475DC -_0804757A: - ldr r0, =gBattleMoves - lsls r1, r5, 1 - adds r1, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - cmp r0, 0 - beq _080475DE - ldrb r1, [r6] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - bne _080475DE - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080475A8 - movs r0, 0xFD - ands r0, r1 - b _080475DC - .pool -_080475A8: - movs r0, 0x4 - b _080475DA -_080475AC: - ldr r0, =gBattleMoves - lsls r1, r5, 1 - adds r1, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - cmp r0, 0 - beq _080475DE - ldrb r1, [r6] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - bne _080475DE - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080475D8 - movs r0, 0xFB - ands r0, r1 - b _080475DC - .pool -_080475D8: - movs r0, 0x2 -_080475DA: - orrs r0, r1 -_080475DC: - strb r0, [r6] -_080475DE: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end b_attack_effectivity_adapt - - thumb_func_start move_effectiveness_something -move_effectiveness_something: @ 80475E4 - 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 - mov r10, r0 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x4] - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - movs r0, 0 - mov r8, r0 - mov r0, sp - mov r1, r8 - strb r1, [r0] - mov r2, r10 - cmp r2, 0xA5 - bne _08047616 - movs r0, 0 - b _0804779E -_08047616: - ldr r1, =gBattleMoves - mov r3, r10 - lsls r2, r3, 1 - adds r0, r2, r3 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x2] - str r0, [sp, 0x8] - ldr r1, =0x02024084 - movs r0, 0x58 - ldr r3, [sp, 0x4] - muls r0, r3 - adds r3, r0, r1 - adds r0, r3, 0 - adds r0, 0x21 - ldrb r0, [r0] - str r2, [sp, 0xC] - adds r5, r1, 0 - ldr r1, [sp, 0x8] - cmp r0, r1 - beq _0804764A - adds r0, r3, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, r1 - bne _0804765C -_0804764A: - ldr r4, =0x020241f0 - ldr r1, [r4] - lsls r0, r1, 4 - subs r0, r1 - str r0, [r4] - movs r1, 0xA - bl __divsi3 - str r0, [r4] -_0804765C: - movs r0, 0x58 - mov r2, r9 - muls r2, r0 - adds r0, r2, 0 - adds r0, r5 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x1A - bne _08047690 - ldr r3, [sp, 0x8] - cmp r3, 0x4 - bne _08047690 - movs r1, 0x9 - mov r0, sp - ldrb r0, [r0] - orrs r0, r1 - mov r1, sp - strb r0, [r1] - b _08047740 - .pool -_08047690: - ldr r1, =gUnknown_0831ACE8 - mov r2, r8 - adds r0, r2, r1 - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0xFF - beq _08047740 - cmp r0, 0xFE - bne _080476B6 - movs r0, 0x58 - mov r3, r9 - muls r3, r0 - adds r0, r3, 0 - b _0804772E - .pool -_080476B0: - movs r0, 0x3 - add r8, r0 - b _08047718 -_080476B6: - ldr r7, =gUnknown_0831ACE8 - mov r1, r8 - adds r0, r1, r7 - ldrb r0, [r0] - ldr r2, [sp, 0x8] - cmp r0, r2 - bne _08047710 - adds r1, 0x1 - adds r1, r7 - ldr r2, =0x02024084 - movs r0, 0x58 - mov r3, r9 - muls r3, r0 - adds r0, r3, 0 - adds r5, r0, r2 - adds r6, r5, 0 - adds r6, 0x21 - ldrb r4, [r1] - ldrb r0, [r6] - cmp r4, r0 - bne _080476F0 - mov r0, r8 - adds r0, 0x2 - adds r0, r7 - ldrb r0, [r0] - mov r1, r10 - mov r2, sp - bl b_attack_effectivity_adapt -_080476F0: - adds r0, r5, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r4, r0 - bne _08047710 - ldrb r0, [r6] - cmp r0, r4 - beq _08047710 - mov r0, r8 - adds r0, 0x2 - adds r0, r7 - ldrb r0, [r0] - mov r1, r10 - mov r2, sp - bl b_attack_effectivity_adapt -_08047710: - movs r1, 0x3 - add r8, r1 - ldr r5, =0x02024084 - ldr r2, =gUnknown_0831ACE8 -_08047718: - mov r3, r8 - adds r0, r3, r2 - ldrb r0, [r0] - cmp r0, 0xFF - beq _08047740 - cmp r0, 0xFE - bne _080476B6 - movs r0, 0x58 - mov r1, r9 - muls r1, r0 - adds r0, r1, 0 -_0804772E: - adds r1, r5, 0 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 22 - ands r0, r1 - cmp r0, 0 - beq _080476B0 -_08047740: - movs r0, 0x58 - mov r2, r9 - muls r2, r0 - adds r0, r2, 0 - adds r0, r5 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x19 - bne _0804779A - mov r0, sp - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0804779A - ldr r0, [sp, 0x4] - mov r1, r10 - bl move_weather_interaction - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x2 - bne _0804779A - mov r0, sp - ldrb r3, [r0] - adds r0, r1, 0 - ands r0, r3 - cmp r0, 0 - beq _08047782 - movs r0, 0x6 - ands r0, r3 - cmp r0, 0x6 - bne _0804779A -_08047782: - ldr r0, =gBattleMoves - ldr r1, [sp, 0xC] - add r1, r10 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - cmp r0, 0 - beq _0804779A - mov r0, sp - movs r1, 0x1 - orrs r1, r3 - strb r1, [r0] -_0804779A: - mov r0, sp - ldrb r0, [r0] -_0804779E: - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end move_effectiveness_something - - thumb_func_start ai_rate_move -ai_rate_move: @ 80477BC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x4] - movs r7, 0 - mov r0, sp - strb r7, [r0] - ldr r2, =gBaseStats - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x6] - mov r9, r1 - ldrb r0, [r0, 0x7] - mov r8, r0 - cmp r6, 0xA5 - bne _080477FC - movs r0, 0 - b _080478A0 - .pool -_080477FC: - ldr r2, =gBattleMoves - lsls r1, r6, 1 - adds r0, r1, r6 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x2] - mov r10, r0 - str r1, [sp, 0x8] - ldr r3, [sp, 0x4] - cmp r3, 0x1A - bne _08047824 - cmp r0, 0x4 - bne _08047824 - movs r1, 0x9 - mov r0, sp - strb r1, [r0] - b _0804786A - .pool -_08047824: - ldr r0, =gUnknown_0831ACE8 - adds r1, r7, r0 - ldrb r0, [r1] - cmp r0, 0xFF - beq _0804786A - adds r4, r1, 0 -_08047830: - ldrb r0, [r4] - cmp r0, 0xFE - beq _0804785C - cmp r0, r10 - bne _0804785C - ldrb r5, [r4, 0x1] - cmp r5, r9 - bne _0804784A - ldrb r0, [r4, 0x2] - adds r1, r6, 0 - mov r2, sp - bl b_attack_effectivity_adapt -_0804784A: - cmp r5, r8 - bne _0804785C - cmp r9, r8 - beq _0804785C - ldrb r0, [r4, 0x2] - adds r1, r6, 0 - mov r2, sp - bl b_attack_effectivity_adapt -_0804785C: - adds r4, 0x3 - adds r7, 0x3 - ldr r1, =gUnknown_0831ACE8 - adds r0, r7, r1 - ldrb r0, [r0] - cmp r0, 0xFF - bne _08047830 -_0804786A: - ldr r3, [sp, 0x4] - cmp r3, 0x19 - bne _0804789C - mov r0, sp - ldrb r2, [r0] - movs r0, 0x2 - ands r0, r2 - cmp r0, 0 - beq _08047884 - movs r0, 0x6 - ands r0, r2 - cmp r0, 0x6 - bne _0804789C -_08047884: - ldr r0, =gBattleMoves - ldr r3, [sp, 0x8] - adds r1, r3, r6 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - cmp r0, 0 - beq _0804789C - mov r0, sp - movs r1, 0x8 - orrs r1, r2 - strb r1, [r0] -_0804789C: - mov r0, sp - ldrb r0, [r0] -_080478A0: - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end ai_rate_move - - thumb_func_start sub_80478B8 -sub_80478B8: @ 80478B8 - push {r4,lr} - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xF - ands r0, r1 - movs r1, 0x64 - subs r1, r0 - lsls r1, 16 - lsrs r1, 16 - ldr r4, =0x020241f0 - ldr r0, [r4] - cmp r0, 0 - beq _080478EA - muls r0, r1 - str r0, [r4] - movs r1, 0x64 - bl __divsi3 - str r0, [r4] - cmp r0, 0 - bne _080478EA - movs r0, 0x1 - str r0, [r4] -_080478EA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80478B8 - - thumb_func_start atk07_cmd7 -atk07_cmd7: @ 80478F4 - push {r4-r7,lr} - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xF - ands r0, r1 - movs r1, 0x64 - subs r1, r0 - lsls r1, 16 - lsrs r1, 16 - ldr r4, =0x020241f0 - ldr r0, [r4] - cmp r0, 0 - beq _08047926 - muls r0, r1 - str r0, [r4] - movs r1, 0x64 - bl __divsi3 - str r0, [r4] - cmp r0, 0 - bne _08047926 - movs r0, 0x1 - str r0, [r4] -_08047926: - ldr r7, =0x02024084 - ldr r6, =0x0202420c - ldrb r2, [r6] - movs r5, 0x58 - adds r0, r2, 0 - muls r0, r5 - adds r1, r0, r7 - ldrh r0, [r1, 0x2E] - cmp r0, 0xAF - bne _0804795C - ldr r1, =0x02024404 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r4, [r0, 0x7] - ldrb r6, [r0, 0x1A] - b _08047976 - .pool -_0804795C: - ldrh r0, [r1, 0x2E] - bl itemid_get_x12 - lsls r0, 24 - lsrs r4, r0, 24 - ldrb r0, [r6] - muls r0, r5 - adds r0, r7 - ldrh r0, [r0, 0x2E] - bl itemid_get_quality - lsls r0, 24 - lsrs r6, r0, 24 -_08047976: - ldr r1, =0x0202420f - ldr r5, =0x0202420c - ldrb r0, [r5] - strb r0, [r1] - cmp r4, 0x27 - bne _080479B4 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, r6 - bcs _080479B4 - ldrb r0, [r5] - movs r1, 0x27 - bl b_history__record_item_x12_of_player - ldr r2, =0x0202437c - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0] -_080479B4: - ldr r2, =0x02024084 - ldr r3, =0x0202420c - ldrb r4, [r3] - movs r0, 0x58 - muls r0, r4 - adds r1, r2, 0 - adds r1, 0x50 - adds r0, r1 - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 17 - ands r1, r0 - adds r5, r2, 0 - cmp r1, 0 - bne _08047A84 - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0x65 - beq _08047A06 - ldr r0, =0x0202433c - lsls r1, r4, 4 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 30 - cmp r0, 0 - blt _08047A06 - ldr r0, =0x0202437c - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1] - lsrs r0, 7 - cmp r0, 0 - beq _08047A84 -_08047A06: - ldrb r0, [r3] - movs r4, 0x58 - muls r0, r4 - adds r0, r5 - ldrh r1, [r0, 0x28] - ldr r2, =0x020241f0 - ldr r0, [r2] - cmp r1, r0 - bgt _08047A84 - subs r0, r1, 0x1 - str r0, [r2] - ldr r1, =0x0202433c - ldrb r3, [r3] - lsls r0, r3, 4 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - cmp r0, 0 - bge _08047A5C - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] - b _08047A84 - .pool -_08047A5C: - ldr r0, =0x0202437c - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1] - lsrs r0, 7 - cmp r0, 0 - beq _08047A84 - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024208 - adds r0, r3, 0 - muls r0, r4 - adds r0, r5 - ldrh r0, [r0, 0x2E] - strh r0, [r1] -_08047A84: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk07_cmd7 - - thumb_func_start atk08_cmd8 -atk08_cmd8: @ 8047AA4 - push {r4-r7,lr} - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xF - ands r0, r1 - movs r1, 0x64 - subs r1, r0 - lsls r1, 16 - lsrs r1, 16 - ldr r4, =0x020241f0 - ldr r0, [r4] - cmp r0, 0 - beq _08047AD6 - muls r0, r1 - str r0, [r4] - movs r1, 0x64 - bl __divsi3 - str r0, [r4] - cmp r0, 0 - bne _08047AD6 - movs r0, 0x1 - str r0, [r4] -_08047AD6: - ldr r7, =0x02024084 - ldr r6, =0x0202420c - ldrb r2, [r6] - movs r5, 0x58 - adds r0, r2, 0 - muls r0, r5 - adds r1, r0, r7 - ldrh r0, [r1, 0x2E] - cmp r0, 0xAF - bne _08047B0C - ldr r1, =0x02024404 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r4, [r0, 0x7] - ldrb r6, [r0, 0x1A] - b _08047B26 - .pool -_08047B0C: - ldrh r0, [r1, 0x2E] - bl itemid_get_x12 - lsls r0, 24 - lsrs r4, r0, 24 - ldrb r0, [r6] - muls r0, r5 - adds r0, r7 - ldrh r0, [r0, 0x2E] - bl itemid_get_quality - lsls r0, 24 - lsrs r6, r0, 24 -_08047B26: - ldr r1, =0x0202420f - ldr r5, =0x0202420c - ldrb r0, [r5] - strb r0, [r1] - cmp r4, 0x27 - bne _08047B64 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, r6 - bcs _08047B64 - ldrb r0, [r5] - movs r1, 0x27 - bl b_history__record_item_x12_of_player - ldr r2, =0x0202437c - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0] -_08047B64: - ldr r4, =0x02024084 - ldr r6, =0x0202420c - ldrb r2, [r6] - movs r7, 0x58 - adds r3, r2, 0 - muls r3, r7 - adds r0, r4, 0 - adds r0, 0x50 - adds r0, r3, r0 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - bne _08047C10 - ldr r5, =0x0202433c - lsls r0, r2, 4 - adds r0, r5 - ldrb r0, [r0] - lsls r0, 30 - cmp r0, 0 - blt _08047BA2 - ldr r0, =0x0202437c - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1] - lsrs r0, 7 - cmp r0, 0 - beq _08047C10 -_08047BA2: - adds r0, r3, r4 - ldrh r1, [r0, 0x28] - ldr r2, =0x020241f0 - ldr r0, [r2] - cmp r1, r0 - bgt _08047C10 - subs r0, r1, 0x1 - str r0, [r2] - ldrb r3, [r6] - lsls r0, r3, 4 - adds r0, r5 - ldrb r0, [r0] - lsls r0, 30 - cmp r0, 0 - bge _08047BE8 - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] - b _08047C10 - .pool -_08047BE8: - ldr r0, =0x0202437c - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1] - lsrs r0, 7 - cmp r0, 0 - beq _08047C10 - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024208 - adds r0, r3, 0 - muls r0, r7 - adds r0, r4 - ldrh r0, [r0, 0x2E] - strh r0, [r1] -_08047C10: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk08_cmd8 - - thumb_func_start atk09_attackanimation -atk09_attackanimation: @ 8047C30 - push {r4-r7,lr} - sub sp, 0x10 - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - beq _08047C3E - b _08047DB6 -_08047C3E: - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - ldr r5, =0x020241ea - cmp r0, 0 - beq _08047C8C - ldrh r0, [r5] - cmp r0, 0x90 - beq _08047C8C - cmp r0, 0xA4 - beq _08047C8C - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082DABB9 - str r0, [r4] - ldr r1, =0x02024474 - ldrb r0, [r1, 0x18] - adds r0, 0x1 - strb r0, [r1, 0x18] - ldrb r0, [r1, 0x19] - adds r0, 0x1 - strb r0, [r1, 0x19] - b _08047DB6 - .pool -_08047C8C: - ldr r2, =gBattleMoves - ldrh r1, [r5] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x6] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - bne _08047CB2 - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _08047CB2 - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08047CBA -_08047CB2: - ldr r0, =0x02024474 - ldrb r0, [r0, 0x19] - cmp r0, 0 - bne _08047D88 -_08047CBA: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - bne _08047DA8 - ldr r1, =0x02024064 - ldr r3, =0x0202420b - ldrb r0, [r3] - strb r0, [r1] - ldr r2, =0x02024084 - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0x58 - adds r4, r1, 0 - muls r4, r0 - adds r0, r2, 0 - adds r0, 0x50 - adds r0, r4, r0 - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 17 - ands r1, r0 - adds r7, r3, 0 - mov r12, r2 - cmp r1, 0 - beq _08047D18 - ldr r0, =0x02024212 - ldrb r6, [r0] - b _08047D42 - .pool -_08047D18: - ldr r3, =0x02024212 - ldrb r0, [r3] - cmp r0, 0x1 - bls _08047D40 - mov r1, r12 - adds r0, r4, r1 - ldrh r2, [r0, 0x28] - ldr r0, =0x020241f0 - ldr r1, [r0] - movs r6, 0x1 - adds r4, r0, 0 - cmp r2, r1 - ble _08047D44 - ldrb r6, [r3] - b _08047D44 - .pool -_08047D40: - ldrb r6, [r3] -_08047D42: - ldr r4, =0x020241f0 -_08047D44: - ldrh r1, [r5] - ldr r5, =0x02024474 - ldrb r2, [r5, 0x18] - ldr r0, =0x020244e0 - ldrh r3, [r0] - ldr r0, [r4] - str r0, [sp] - ldrb r4, [r7] - movs r0, 0x58 - muls r0, r4 - add r0, r12 - adds r0, 0x2B - ldrb r0, [r0] - str r0, [sp, 0x4] - ldrb r4, [r7] - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - ldr r4, =0x020242bc - adds r0, r4 - str r0, [sp, 0x8] - str r6, [sp, 0xC] - movs r0, 0 - bl dp01_build_cmdbuf_x0F_aa_b_cc_dddd_e_mlc_weather_00_x1Cbytes - ldrb r0, [r5, 0x18] - adds r0, 0x1 - strb r0, [r5, 0x18] - ldrb r0, [r5, 0x19] - adds r0, 0x1 - strb r0, [r5, 0x19] - ldrb r0, [r7] - bl dp01_battle_side_mark_buffer_for_execution -_08047D88: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - b _08047DB6 - .pool -_08047DA8: - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082DABB9 - str r0, [r4] -_08047DB6: - add sp, 0x10 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk09_attackanimation - - thumb_func_start sub_8047DC8 -sub_8047DC8: @ 8047DC8 - push {lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _08047DDA - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] -_08047DDA: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8047DC8 - - thumb_func_start atk0B_graphicalhpupdate -atk0B_graphicalhpupdate: @ 8047DE8 - push {r4,lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _08047EAA - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - bne _08047EA2 - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r2, =0x02024064 - strb r0, [r2] - ldr r1, =0x02024084 - ldrb r2, [r2] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _08047E68 - ldr r0, =0x020242bc - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0xA] - cmp r0, 0 - beq _08047E68 - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 1 - ands r0, r1 - cmp r0, 0 - bne _08047E68 - movs r0, 0x80 - adds r1, r2, 0 - bl b_std_message - b _08047EA2 - .pool -_08047E68: - ldr r0, =0x020241f0 - ldr r0, [r0] - ldr r1, =0x00002710 - cmp r0, r1 - bgt _08047E76 - lsls r0, 16 - lsrs r1, r0, 16 -_08047E76: - movs r0, 0 - bl dp01_build_cmdbuf_x18_0_aa_health_bar_update - ldr r4, =0x02024064 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08047EA2 - ldr r0, =0x020241f0 - ldr r0, [r0] - cmp r0, 0 - ble _08047EA2 - ldr r0, =0x03005d10 - ldrb r1, [r0, 0x5] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0, 0x5] -_08047EA2: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] -_08047EAA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk0B_graphicalhpupdate - - thumb_func_start atk0C_datahpupdate -atk0C_datahpupdate: @ 8047EC4 - push {r4-r7,lr} - sub sp, 0x4 - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - beq _08047ED2 - b _080482A2 -_08047ED2: - ldr r0, =0x0202449c - ldr r0, [r0] - ldrb r1, [r0, 0x13] - cmp r1, 0 - beq _08047EF4 - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _08047EF4 - movs r6, 0x3F - ands r6, r1 - b _08047F04 - .pool -_08047EF4: - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r6, [r0, 0x2] -_08047F04: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _08047F12 - b _08048274 -_08047F12: - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r7, =0x02024064 - strb r0, [r7] - ldr r1, =0x02024084 - ldrb r2, [r7] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _08048028 - ldr r0, =0x020242bc - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r4, r1, r0 - ldrb r1, [r4, 0xA] - mov r12, r0 - cmp r1, 0 - beq _08048028 - ldr r0, =0x02024280 - ldr r3, [r0] - movs r0, 0x80 - lsls r0, 1 - ands r3, r0 - cmp r3, 0 - bne _08048028 - adds r5, r1, 0 - ldr r6, =0x020241f0 - ldr r4, [r6] - cmp r5, r4 - blt _08047FBC - ldr r0, =0x0202437c - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 2 - adds r0, 0x4 - adds r1, r0 - ldr r0, [r1] - cmp r0, 0 - bne _08047F76 - str r4, [r1] -_08047F76: - ldrb r0, [r7] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - add r1, r12 - ldr r2, [r6] - ldrb r0, [r1, 0xA] - subs r0, r2 - strb r0, [r1, 0xA] - ldr r1, =0x020241f4 - ldr r0, [r6] - str r0, [r1] - b _08047FEC - .pool -_08047FBC: - ldr r0, =0x0202437c - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 2 - adds r0, 0x4 - adds r1, r0 - ldr r0, [r1] - cmp r0, 0 - bne _08047FD0 - str r5, [r1] -_08047FD0: - ldr r2, =0x020241f4 - ldrb r1, [r7] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - ldrb r0, [r0, 0xA] - str r0, [r2] - ldrb r1, [r7] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - strb r3, [r0, 0xA] -_08047FEC: - ldr r0, =0x02024064 - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - ldrb r0, [r0, 0xA] - cmp r0, 0 - beq _08048000 - b _0804829A -_08048000: - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x2 - str r0, [r4] - bl b_movescr_stack_push_cursor - ldr r0, =gUnknown_082DB6FB - str r0, [r4] - b _080482A2 - .pool -_08048028: - ldr r0, =0x02024280 - ldr r2, [r0] - ldr r1, =0xfffffeff - ands r2, r1 - str r2, [r0] - ldr r1, =0x020241f0 - ldr r5, [r1] - mov r12, r0 - adds r7, r1, 0 - cmp r5, 0 - bge _0804807C - ldr r4, =0x02024084 - ldr r2, =0x02024064 - ldrb r0, [r2] - movs r3, 0x58 - adds r1, r0, 0 - muls r1, r3 - adds r1, r4 - ldrh r0, [r1, 0x28] - subs r0, r5 - strh r0, [r1, 0x28] - ldrb r0, [r2] - muls r0, r3 - adds r1, r0, r4 - ldrh r3, [r1, 0x2C] - ldrh r0, [r1, 0x28] - adds r5, r2, 0 - cmp r0, r3 - bhi _08048064 - b _0804823A -_08048064: - strh r3, [r1, 0x28] - b _0804823A - .pool -_0804807C: - movs r0, 0x20 - ands r0, r2 - cmp r0, 0 - beq _08048098 - movs r0, 0x21 - negs r0, r0 - ands r2, r0 - mov r0, r12 - str r2, [r0] - ldr r5, =0x02024064 - b _080480E0 - .pool -_08048098: - ldr r0, =0x020241f8 - ldr r2, =0x02024064 - ldrb r1, [r2] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - adds r0, r5 - str r0, [r1] - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - adds r5, r2, 0 - cmp r0, 0 - bne _080480D4 - ldr r1, =0x02024288 - ldrb r0, [r5] - adds r0, r1 - ldr r1, =0x0202420b - b _080480DC - .pool -_080480D4: - ldr r1, =0x02024288 - ldrb r0, [r5] - adds r0, r1 - ldr r1, =0x0202420c -_080480DC: - ldrb r1, [r1] - strb r1, [r0] -_080480E0: - ldr r4, =0x02024084 - ldrb r0, [r5] - movs r3, 0x58 - muls r0, r3 - adds r2, r0, r4 - ldrh r0, [r2, 0x28] - ldr r1, [r7] - cmp r0, r1 - ble _08048110 - subs r0, r1 - strh r0, [r2, 0x28] - ldr r0, =0x020241f4 - str r1, [r0] - adds r7, r0, 0 - b _08048120 - .pool -_08048110: - ldr r2, =0x020241f4 - str r0, [r2] - ldrb r0, [r5] - muls r0, r3 - adds r0, r4 - movs r1, 0 - strh r1, [r0, 0x28] - adds r7, r2, 0 -_08048120: - ldr r2, =0x0202437c - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r1, r2, 0x4 - adds r3, r0, r1 - ldr r0, [r3] - adds r4, r2, 0 - cmp r0, 0 - bne _08048148 - mov r1, r12 - ldr r0, [r1] - movs r1, 0x80 - lsls r1, 13 - ands r0, r1 - cmp r0, 0 - bne _08048148 - ldr r0, [r7] - str r0, [r3] -_08048148: - cmp r6, 0x8 - bhi _080481D0 - mov r1, r12 - ldr r0, [r1] - movs r1, 0x80 - lsls r1, 13 - ands r0, r1 - cmp r0, 0 - bne _080481CC - ldr r0, =0x020241ea - ldrh r0, [r0] - cmp r0, 0xDC - beq _080481CC - ldr r3, =0x0202433c - ldrb r0, [r5] - lsls r0, 4 - adds r1, r3, 0x4 - adds r0, r1 - ldr r2, [r7] - str r2, [r0] - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x8 - adds r0, r1 - str r2, [r0] - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0 - bne _080481AC - ldrb r0, [r5] - lsls r0, 4 - adds r0, r3 - ldr r2, =0x0202420b - b _080481B4 - .pool -_080481AC: - ldrb r0, [r5] - lsls r0, 4 - adds r0, r3 - ldr r2, =0x0202420c -_080481B4: - ldrb r1, [r2] - strb r1, [r0, 0xC] - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r2] - strb r1, [r0, 0x10] - b _0804823A - .pool -_080481CC: - cmp r6, 0x8 - bls _0804823A -_080481D0: - mov r1, r12 - ldr r0, [r1] - movs r1, 0x80 - lsls r1, 13 - ands r0, r1 - cmp r0, 0 - bne _0804823A - ldr r3, =0x0202433c - ldrb r0, [r5] - lsls r0, 4 - adds r1, r3, 0 - adds r1, 0x8 - adds r0, r1 - ldr r2, [r7] - str r2, [r0] - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0xC - adds r0, r1 - str r2, [r0] - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0 - bne _08048220 - ldrb r0, [r5] - lsls r0, 4 - adds r0, r3 - ldr r2, =0x0202420b - b _08048228 - .pool -_08048220: - ldrb r0, [r5] - lsls r0, 4 - adds r0, r3 - ldr r2, =0x0202420c -_08048228: - ldrb r1, [r2] - strb r1, [r0, 0xD] - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r2] - strb r1, [r0, 0x11] -_0804823A: - mov r1, r12 - ldr r0, [r1] - ldr r1, =0xffefffff - ands r0, r1 - mov r1, r12 - str r0, [r1] - ldrb r1, [r5] - movs r0, 0x58 - muls r0, r1 - ldr r1, =0x020240ac - adds r0, r1 - str r0, [sp] - movs r0, 0 - movs r1, 0x2A - movs r2, 0 - movs r3, 0x2 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r5] - bl dp01_battle_side_mark_buffer_for_execution - b _0804829A - .pool -_08048274: - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r1, =0x02024064 - strb r0, [r1] - ldr r2, =0x0202437c - ldrb r1, [r1] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, 0x4 - adds r1, r0, r2 - ldr r0, [r1] - cmp r0, 0 - bne _0804829A - ldr r0, =0x0000ffff - str r0, [r1] -_0804829A: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] -_080482A2: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk0C_datahpupdate - - thumb_func_start atk0D_critmessage -atk0D_critmessage: @ 80482BC - push {lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _080482F2 - ldr r0, =0x02024211 - ldrb r0, [r0] - cmp r0, 0x2 - bne _080482EA - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - bne _080482EA - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0xD9 - bl b_std_message - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x7] -_080482EA: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] -_080482F2: - pop {r0} - bx r0 - .pool - thumb_func_end atk0D_critmessage - - thumb_func_start atk0E_missmessage -atk0E_missmessage: @ 8048310 - push {r4,lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _080483D0 - ldr r4, =0x02024064 - ldr r0, =0x0202420c - ldrb r0, [r0] - strb r0, [r4] - ldr r1, =0x0202427c - ldrb r2, [r1] - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - bne _080483C8 - movs r0, 0xFE - ands r0, r2 - cmp r0, 0x10 - beq _08048382 - cmp r0, 0x10 - bgt _0804835E - cmp r0, 0x4 - beq _08048372 - cmp r0, 0x4 - bgt _08048358 - cmp r0, 0x2 - beq _0804836C - b _08048382 - .pool -_08048358: - cmp r0, 0x8 - beq _080483C8 - b _08048382 -_0804835E: - cmp r0, 0x40 - beq _08048382 - cmp r0, 0x40 - bgt _08048382 - cmp r0, 0x20 - beq _080483C8 - b _08048382 -_0804836C: - movs r0, 0 - movs r1, 0xE - b _08048376 -_08048372: - movs r0, 0 - movs r1, 0xC -_08048376: - bl dp01_build_cmdbuf_x2B_aa_0 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - b _080483C8 -_08048382: - ldrb r1, [r1] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08048392 - movs r0, 0 - movs r1, 0xE - b _0804839E -_08048392: - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080483B0 - movs r0, 0 - movs r1, 0xC -_0804839E: - bl dp01_build_cmdbuf_x2B_aa_0 - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution - b _080483C8 - .pool -_080483B0: - movs r0, 0x28 - ands r0, r1 - cmp r0, 0 - bne _080483C8 - movs r0, 0 - movs r1, 0xD - bl dp01_build_cmdbuf_x2B_aa_0 - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution -_080483C8: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] -_080483D0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk0E_missmessage - - thumb_func_start atk0F_resultmessage -atk0F_resultmessage: @ 80483E0 - push {r4-r7,lr} - movs r3, 0 - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - beq _080483EE - b _08048580 -_080483EE: - ldr r1, =0x0202427c - ldrb r2, [r1] - movs r4, 0x1 - adds r0, r4, 0 - ands r0, r2 - adds r6, r1, 0 - ldr r7, =0x02024332 - cmp r0, 0 - beq _0804842C - movs r0, 0x8 - ands r0, r2 - cmp r0, 0 - beq _0804840E - ldrb r0, [r7, 0x6] - cmp r0, 0x2 - bls _0804842C -_0804840E: - ldr r1, =gUnknown_085CC834 - ldrb r0, [r7, 0x6] - lsls r0, 1 - adds r0, r1 - ldrh r3, [r0] - strb r4, [r7, 0x7] - b _0804856A - .pool -_0804842C: - movs r0, 0x1 - strb r0, [r7, 0x7] - ldrb r5, [r6] - movs r0, 0xFE - ands r0, r5 - cmp r0, 0x10 - beq _08048470 - cmp r0, 0x10 - bgt _08048452 - cmp r0, 0x4 - beq _0804846C - cmp r0, 0x4 - bgt _0804844C - cmp r0, 0x2 - beq _08048468 - b _080484B8 -_0804844C: - cmp r0, 0x8 - beq _080484C4 - b _080484B8 -_08048452: - cmp r0, 0x40 - beq _08048474 - cmp r0, 0x40 - bgt _08048462 - cmp r0, 0x20 - bne _08048460 - b _08048564 -_08048460: - b _080484B8 -_08048462: - cmp r0, 0x80 - beq _08048478 - b _080484B8 -_08048468: - movs r3, 0xDE - b _0804856E -_0804846C: - movs r3, 0xDD - b _0804856E -_08048470: - movs r3, 0xDA - b _0804856E -_08048474: - movs r3, 0x99 - b _0804856E -_08048478: - ldr r4, =0x02024208 - ldr r2, =0x02024084 - ldr r3, =0x0202420c - ldrb r1, [r3] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r0, [r0, 0x2E] - strh r0, [r4] - ldr r1, =0x0202420f - ldrb r0, [r3] - strb r0, [r1] - movs r0, 0x3F - ands r0, r5 - strb r0, [r6] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB816 - b _0804857E - .pool -_080484B8: - adds r2, r6, 0 - ldrb r5, [r2] - movs r0, 0x8 - ands r0, r5 - cmp r0, 0 - beq _080484C8 -_080484C4: - movs r3, 0x1B - b _0804856E -_080484C8: - movs r0, 0x10 - ands r0, r5 - cmp r0, 0 - beq _080484F0 - movs r0, 0xEF - ands r0, r5 - movs r1, 0xFD - ands r0, r1 - movs r1, 0xFB - ands r0, r1 - strb r0, [r2] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB1CE - b _0804857E - .pool -_080484F0: - movs r0, 0x40 - ands r0, r5 - cmp r0, 0 - beq _08048510 - movs r0, 0x3F - ands r0, r5 - strb r0, [r2] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB1C7 - b _0804857E - .pool -_08048510: - movs r0, 0x80 - ands r0, r5 - cmp r0, 0 - beq _08048558 - ldr r4, =0x02024208 - ldr r2, =0x02024084 - ldr r3, =0x0202420c - ldrb r1, [r3] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r0, [r0, 0x2E] - strh r0, [r4] - ldr r1, =0x0202420f - ldrb r0, [r3] - strb r0, [r1] - movs r0, 0x3F - ands r0, r5 - strb r0, [r6] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB816 - b _0804857E - .pool -_08048558: - movs r0, 0x20 - ands r0, r5 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _08048568 -_08048564: - movs r3, 0xE5 - b _0804856E -_08048568: - strb r0, [r7, 0x7] -_0804856A: - cmp r3, 0 - beq _08048578 -_0804856E: - adds r0, r3, 0 - ldr r1, =0x0202420b - ldrb r1, [r1] - bl b_std_message -_08048578: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 -_0804857E: - str r0, [r1] -_08048580: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk0F_resultmessage - - thumb_func_start atk10_printstring -atk10_printstring: @ 8048590 - push {r4,lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _080485BA - ldr r4, =0x02024214 - ldr r1, [r4] - ldrb r0, [r1, 0x1] - ldrb r1, [r1, 0x2] - lsls r1, 8 - orrs r0, r1 - ldr r1, =0x0202420b - ldrb r1, [r1] - bl b_std_message - ldr r0, [r4] - adds r0, 0x3 - str r0, [r4] - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x7] -_080485BA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk10_printstring - - thumb_func_start atk11_printstring2 -atk11_printstring2: @ 80485D0 - push {r4,r5,lr} - ldr r5, =0x02024064 - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r5] - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r1, [r0, 0x1] - ldrb r0, [r0, 0x2] - lsls r0, 8 - orrs r1, r0 - movs r0, 0 - bl dp01_build_cmdbuf_x11_TODO - ldrb r0, [r5] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r4] - adds r0, 0x3 - str r0, [r4] - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x7] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk11_printstring2 - - thumb_func_start atk12_waitmessage -atk12_waitmessage: @ 8048614 - push {r4-r6,lr} - ldr r0, =0x02024068 - ldr r4, [r0] - cmp r4, 0 - bne _08048662 - ldr r6, =0x02024332 - ldrb r0, [r6, 0x7] - cmp r0, 0 - bne _0804863C - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x3 - str r0, [r1] - b _08048662 - .pool -_0804863C: - ldr r5, =0x02024214 - ldr r2, [r5] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldr r3, =0x0202432c - ldrh r0, [r3] - adds r0, 0x1 - strh r0, [r3] - lsls r0, 16 - lsrs r0, 16 - cmp r0, r1 - bcc _08048662 - movs r1, 0 - strh r4, [r3] - adds r0, r2, 0x3 - str r0, [r5] - strb r1, [r6, 0x7] -_08048662: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atk12_waitmessage - - thumb_func_start atk13_printfromtable -atk13_printfromtable: @ 8048670 - push {r4,r5,lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _080486AE - ldr r4, =0x02024214 - ldr r2, [r4] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - ldr r5, =0x02024332 - ldrb r0, [r5, 0x5] - lsls r0, 1 - adds r1, r0 - ldrh r0, [r1] - ldr r1, =0x0202420b - ldrb r1, [r1] - bl b_std_message - ldr r0, [r4] - adds r0, 0x5 - str r0, [r4] - movs r0, 0x1 - strb r0, [r5, 0x7] -_080486AE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk13_printfromtable - - thumb_func_start atk14_printfromtable2 -atk14_printfromtable2: @ 80486C4 - push {r4-r6,lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0804870E - ldr r5, =0x02024214 - ldr r2, [r5] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - ldr r6, =0x02024332 - ldrb r0, [r6, 0x5] - lsls r0, 1 - adds r1, r0 - ldr r4, =0x02024064 - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r4] - ldrh r1, [r1] - movs r0, 0 - bl dp01_build_cmdbuf_x11_TODO - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r5] - adds r0, 0x5 - str r0, [r5] - movs r0, 0x1 - strb r0, [r6, 0x7] -_0804870E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atk14_printfromtable2 - - thumb_func_start sub_8048728 -sub_8048728: @ 8048728 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - movs r1, 0 - ldr r0, =0x0202406c - ldrb r3, [r0] - cmp r1, r3 - bge _0804874E - ldr r4, =0x0202407e - ldrb r0, [r4] - cmp r0, r2 - beq _0804874E -_08048740: - adds r1, 0x1 - cmp r1, r3 - bge _0804874E - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, r2 - bne _08048740 -_0804874E: - lsls r0, r1, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8048728 - - thumb_func_start sub_8048760 -sub_8048760: @ 8048760 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - movs r0, 0 - mov r10, r0 - movs r7, 0 - movs r1, 0x1 - str r1, [sp, 0x4] - ldr r1, =0x02024332 - ldrb r3, [r1, 0x3] - movs r0, 0x40 - ands r0, r3 - cmp r0, 0 - beq _080487B8 - ldr r2, =0x0202420e - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r2] - movs r0, 0xBF - ands r0, r3 - adds r3, r1, 0 - strb r0, [r3, 0x3] - movs r7, 0x40 - ldr r1, =0x02024474 - ldr r0, =0x0202420c - b _080487C4 - .pool -_080487B8: - ldr r2, =0x0202420e - ldr r0, =0x0202420c - ldrb r0, [r0] - strb r0, [r2] - ldr r1, =0x02024474 - ldr r0, =0x0202420b -_080487C4: - ldrb r0, [r0] - strb r0, [r1, 0x17] - mov r9, r2 - ldr r2, =0x02024084 - mov r4, r9 - ldrb r1, [r4] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x13 - bne _08048828 - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 6 - ands r0, r1 - cmp r0, 0 - bne _08048828 - cmp r5, 0 - bne _08048828 - ldr r1, =0x02024332 - ldrb r0, [r1, 0x3] - cmp r0, 0x9 - bhi _08048828 - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - ldr r2, =0x02024332 - strb r5, [r2, 0x3] - bl _080499B8 - .pool -_08048828: - mov r3, r9 - ldrb r0, [r3] - bl battle_get_per_side_status - ldr r2, =0x0202428e - movs r1, 0x1 - ands r1, r0 - lsls r1, 1 - adds r1, r2 - ldrh r1, [r1] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08048880 - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 6 - ands r0, r1 - cmp r0, 0 - bne _08048880 - cmp r5, 0 - bne _08048880 - ldr r0, =0x02024332 - ldrb r1, [r0, 0x3] - cmp r1, 0x7 - bhi _08048880 - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - ldr r4, =0x02024332 - strb r5, [r4, 0x3] - bl _080499B8 - .pool -_08048880: - ldr r3, =0x02024084 - ldr r2, =0x0202420e - ldrb r1, [r2] - movs r0, 0x58 - muls r0, r1 - adds r0, r3 - ldrh r4, [r0, 0x28] - mov r9, r2 - mov r8, r3 - cmp r4, 0 - bne _080488C4 - ldr r1, =0x02024332 - ldrb r0, [r1, 0x3] - cmp r0, 0xB - beq _080488C4 - cmp r0, 0x1F - beq _080488C4 - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - ldr r2, =0x02024332 - strb r4, [r2, 0x3] - bl _080499B8 - .pool -_080488C4: - mov r3, r9 - ldrb r1, [r3] - movs r0, 0x58 - muls r0, r1 - mov r1, r8 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _080488FC - cmp r7, 0x40 - beq _080488FC - ldr r0, =0x02024214 - ldr r1, [r0] - adds r1, 0x1 - str r1, [r0] - movs r0, 0 - ldr r4, =0x02024332 - strb r0, [r4, 0x3] - bl _080499B8 - .pool -_080488FC: - ldr r1, =0x02024332 - ldrb r0, [r1, 0x3] - cmp r0, 0x6 - bls _08048906 - b _08048F40 -_08048906: - ldr r1, =gUnknown_0831C134 - ldr r2, =0x02024332 - ldrb r0, [r2, 0x3] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0x10 - bne _08048918 - b _08048AFC -_08048918: - cmp r0, 0x10 - bhi _08048930 - cmp r0, 0x7 - beq _0804894A - cmp r0, 0x8 - beq _08048A00 - b _08048DF4 - .pool -_08048930: - cmp r0, 0x40 - bne _08048936 - b _08048C84 -_08048936: - cmp r0, 0x40 - bhi _08048942 - cmp r0, 0x20 - bne _08048940 - b _08048BEA -_08048940: - b _08048DF4 -_08048942: - cmp r0, 0x80 - bne _08048948 - b _08048D02 -_08048948: - b _08048DF4 -_0804894A: - mov r3, r9 - ldrb r1, [r3] - movs r0, 0x58 - muls r0, r1 - add r0, r8 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x2B - beq _080489AC - ldr r0, =0x02024064 - movs r1, 0 - strb r1, [r0] - ldr r1, =0x0202406c - ldrb r3, [r1] - adds r7, r0, 0 - mov r12, r1 - cmp r3, 0 - beq _080489B8 - mov r4, r8 - ldr r0, [r4, 0x50] - movs r1, 0x70 - ands r0, r1 - cmp r0, 0 - bne _080489B8 - adds r1, r7, 0 - mov r6, r8 - adds r6, 0x50 - movs r5, 0x58 - movs r4, 0x70 -_08048984: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, r3 - bcs _080489B8 - ldrb r0, [r7] - muls r0, r5 - adds r0, r6 - ldr r0, [r0] - ands r0, r4 - cmp r0, 0 - beq _08048984 - b _080489B8 - .pool -_080489AC: - ldr r0, =0x02024064 - ldr r2, =0x0202406c - ldrb r1, [r2] - strb r1, [r0] - adds r7, r0, 0 - mov r12, r2 -_080489B8: - mov r0, r9 - ldrb r2, [r0] - movs r0, 0x58 - adds r1, r2, 0 - muls r1, r0 - mov r0, r8 - adds r0, 0x4C - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - beq _080489D0 - b _08048DF4 -_080489D0: - ldrb r0, [r7] - mov r3, r12 - ldrb r3, [r3] - cmp r0, r3 - beq _080489DC - b _08048DF4 -_080489DC: - mov r4, r8 - adds r0, r1, r4 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x48 - bne _080489EA - b _08048DF4 -_080489EA: - cmp r0, 0xF - bne _080489F0 - b _08048DF4 -_080489F0: - adds r0, r2, 0 - bl b_cancel_multi_turn_move_maybe - b _08048DE4 - .pool -_08048A00: - mov r2, r9 - ldrb r1, [r2] - movs r0, 0x58 - muls r0, r1 - add r0, r8 - adds r0, 0x20 - ldrb r1, [r0] - cmp r1, 0x11 - bne _08048A70 - cmp r5, 0x1 - beq _08048A1A - cmp r6, 0x80 - bne _08048A70 -_08048A1A: - ldr r0, =0x0202420a - strb r1, [r0] - mov r3, r9 - ldrb r0, [r3] - movs r1, 0x11 - bl b_history__record_ability_usage_of_player - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082DB5E9 - str r0, [r4] - ldr r2, =0x02024280 - ldr r1, [r2] - movs r0, 0x80 - lsls r0, 6 - ands r0, r1 - cmp r0, 0 - bne _08048A46 - b _08048D20 -_08048A46: - movs r0, 0x1 - ldr r4, =0x02024332 - strb r0, [r4, 0x5] -_08048A4C: - ldr r0, =0xffffdfff - ands r1, r0 - str r1, [r2] - bl _080499B2 - .pool -_08048A70: - mov r2, r9 - ldrb r0, [r2] - movs r1, 0x58 - muls r0, r1 - add r0, r8 - adds r1, r0, 0 - adds r1, 0x21 - ldrb r1, [r1] - cmp r1, 0x3 - beq _08048A94 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0x3 - beq _08048A94 - cmp r1, 0x8 - beq _08048A94 - cmp r0, 0x8 - bne _08048AAE -_08048A94: - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 6 - ands r0, r1 - cmp r0, 0 - beq _08048AAE - cmp r5, 0x1 - bne _08048AA8 - b _08048D66 -_08048AA8: - cmp r6, 0x80 - bne _08048AAE - b _08048D66 -_08048AAE: - mov r3, r9 - ldrb r1, [r3] - movs r0, 0x58 - muls r1, r0 - mov r4, r8 - adds r3, r1, r4 - adds r0, r3, 0 - adds r0, 0x21 - ldrb r4, [r0] - cmp r4, 0x3 - bne _08048AC6 - b _08048DF4 -_08048AC6: - adds r0, 0x1 - ldrb r0, [r0] - cmp r0, 0x3 - bne _08048AD0 - b _08048DF4 -_08048AD0: - cmp r4, 0x8 - bne _08048AD6 - b _08048DF4 -_08048AD6: - cmp r0, 0x8 - bne _08048ADC - b _08048DF4 -_08048ADC: - mov r0, r8 - adds r0, 0x4C - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - beq _08048AEA - b _08048DF4 -_08048AEA: - adds r0, r3, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x11 - bne _08048AF6 - b _08048DF4 -_08048AF6: - b _08048DE4 - .pool -_08048AFC: - mov r2, r9 - ldrb r1, [r2] - movs r0, 0x58 - muls r0, r1 - add r0, r8 - adds r0, 0x20 - ldrb r1, [r0] - cmp r1, 0x29 - bne _08048B54 - cmp r5, 0x1 - beq _08048B16 - cmp r6, 0x80 - bne _08048B54 -_08048B16: - ldr r0, =0x0202420a - strb r1, [r0] - mov r3, r9 - ldrb r0, [r3] - movs r1, 0x29 - bl b_history__record_ability_usage_of_player - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082DB5D1 - str r0, [r4] - ldr r2, =0x02024280 - ldr r1, [r2] - movs r0, 0x80 - lsls r0, 6 - ands r0, r1 - cmp r0, 0 - beq _08048B42 - b _08048A46 -_08048B42: - b _08048D20 - .pool -_08048B54: - mov r2, r9 - ldrb r1, [r2] - movs r0, 0x58 - muls r0, r1 - mov r3, r8 - adds r1, r0, r3 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0xA - beq _08048B74 - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0xA - bne _08048BA4 -_08048B74: - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 6 - ands r0, r1 - cmp r0, 0 - beq _08048BA4 - cmp r5, 0x1 - beq _08048B8A - cmp r6, 0x80 - bne _08048BA4 -_08048B8A: - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082DB5D1 - b _08048D72 - .pool -_08048BA4: - mov r4, r9 - ldrb r0, [r4] - movs r1, 0x58 - adds r2, r0, 0 - muls r2, r1 - mov r0, r8 - adds r1, r2, r0 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0xA - bne _08048BBE - b _08048DF4 -_08048BBE: - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0xA - bne _08048BCA - b _08048DF4 -_08048BCA: - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x29 - bne _08048BD6 - b _08048DF4 -_08048BD6: - mov r0, r8 - adds r0, 0x4C - adds r0, r2, r0 - ldr r0, [r0] - cmp r0, 0 - beq _08048BE4 - b _08048DF4 -_08048BE4: - movs r1, 0x1 - mov r10, r1 - b _08048DF4 -_08048BEA: - movs r0, 0 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08048C26 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0x4D - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - bne _08048C26 - ldr r0, =0x020243cc - ldrh r1, [r0] - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - beq _08048C26 - movs r2, 0 - str r2, [sp, 0x4] -_08048C26: - ldr r4, =0x02024084 - ldr r0, =0x0202420e - ldrb r3, [r0] - movs r0, 0x58 - adds r2, r3, 0 - muls r2, r0 - adds r1, r2, r4 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0xF - bne _08048C40 - b _08048DF4 -_08048C40: - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0xF - bne _08048C4C - b _08048DF4 -_08048C4C: - adds r0, r4, 0 - adds r0, 0x4C - adds r0, r2, r0 - ldr r0, [r0] - cmp r0, 0 - beq _08048C5A - b _08048DF4 -_08048C5A: - ldr r4, [sp, 0x4] - cmp r4, 0 - bne _08048C62 - b _08048DF4 -_08048C62: - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x28 - bne _08048C6E - b _08048DF4 -_08048C6E: - adds r0, r3, 0 - bl b_cancel_multi_turn_move_maybe - b _08048DE4 - .pool -_08048C84: - mov r2, r9 - ldrb r1, [r2] - movs r0, 0x58 - muls r1, r0 - mov r3, r8 - adds r0, r1, r3 - adds r0, 0x20 - ldrb r2, [r0] - cmp r2, 0x7 - bne _08048CF4 - cmp r5, 0x1 - beq _08048CA2 - cmp r6, 0x80 - beq _08048CA2 - b _08048DF4 -_08048CA2: - ldr r0, =0x0202420a - strb r2, [r0] - mov r4, r9 - ldrb r0, [r4] - movs r1, 0x7 - bl b_history__record_ability_usage_of_player - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082DB5DD - str r0, [r4] - ldr r2, =0x02024280 - ldr r1, [r2] - movs r0, 0x80 - lsls r0, 6 - ands r0, r1 - cmp r0, 0 - beq _08048CE8 - movs r0, 0x1 - ldr r3, =0x02024332 - strb r0, [r3, 0x5] - b _08048A4C - .pool -_08048CE8: - ldr r4, =0x02024332 - strb r0, [r4, 0x5] - bl _080499B2 - .pool -_08048CF4: - mov r0, r8 - adds r0, 0x4C - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08048DF4 - b _08048DE4 -_08048D02: - mov r2, r9 - ldrb r1, [r2] - movs r0, 0x58 - muls r0, r1 - add r0, r8 - adds r0, 0x20 - ldrb r1, [r0] - cmp r1, 0x11 - bne _08048D2C - cmp r5, 0x1 - bne _08048D1A - b _08048A1A -_08048D1A: - cmp r6, 0x80 - bne _08048D2C - b _08048A1A -_08048D20: - ldr r1, =0x02024332 - strb r0, [r1, 0x5] - bl _080499B2 - .pool -_08048D2C: - mov r2, r9 - ldrb r0, [r2] - movs r1, 0x58 - muls r0, r1 - add r0, r8 - adds r1, r0, 0 - adds r1, 0x21 - ldrb r1, [r1] - cmp r1, 0x3 - beq _08048D50 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0x3 - beq _08048D50 - cmp r1, 0x8 - beq _08048D50 - cmp r0, 0x8 - bne _08048D94 -_08048D50: - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 6 - ands r0, r1 - cmp r0, 0 - beq _08048D94 - cmp r5, 0x1 - beq _08048D66 - cmp r6, 0x80 - bne _08048D94 -_08048D66: - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082DB5E9 -_08048D72: - str r0, [r4] - ldr r1, =0x02024332 - movs r2, 0 - movs r0, 0x2 - strb r0, [r1, 0x5] - strb r2, [r1, 0x3] - bl _080499B8 - .pool -_08048D94: - mov r3, r9 - ldrb r0, [r3] - movs r6, 0x58 - muls r0, r6 - mov r2, r8 - adds r2, 0x4C - adds r5, r0, r2 - ldr r4, [r5] - cmp r4, 0 - bne _08048DF4 - mov r3, r8 - adds r1, r0, r3 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r3, [r0] - cmp r3, 0x3 - beq _08048DEA - adds r0, 0x1 - ldrb r0, [r0] - cmp r0, 0x3 - beq _08048DEA - cmp r3, 0x8 - beq _08048DEA - cmp r0, 0x8 - beq _08048DEA - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x11 - beq _08048DF4 - mov r4, r9 - ldrb r0, [r4] - adds r1, r0, 0 - muls r1, r6 - adds r1, r2 - ldr r0, [r1] - movs r2, 0x9 - negs r2, r2 - ands r0, r2 - str r0, [r1] -_08048DE4: - movs r0, 0x1 - mov r10, r0 - b _08048DF4 -_08048DEA: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0] -_08048DF4: - mov r1, r10 - cmp r1, 0x1 - beq _08048DFC - b _08048F1C -_08048DFC: - ldr r0, =0x02024214 - ldr r0, [r0] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r1, =gUnknown_0831C134 - ldr r0, =0x02024332 - ldrb r0, [r0, 0x3] - lsls r0, 2 - adds r0, r1 - ldr r3, [r0] - cmp r3, 0x7 - bne _08048E50 - bl GenerateRandomNumber - ldr r2, =0x02024084 - ldr r1, =0x0202420e - ldrb r3, [r1] - movs r1, 0x58 - muls r3, r1 - adds r2, 0x4C - adds r3, r2 - movs r1, 0x3 - ands r1, r0 - adds r1, 0x2 - ldr r0, [r3] - orrs r0, r1 - str r0, [r3] - b _08048E64 - .pool -_08048E50: - ldr r2, =0x02024084 - ldr r0, =0x0202420e - ldrb r1, [r0] - movs r0, 0x58 - muls r1, r0 - adds r2, 0x4C - adds r1, r2 - ldr r0, [r1] - orrs r0, r3 - str r0, [r1] -_08048E64: - ldr r2, =0x02024214 - ldr r1, =gUnknown_0831C224 - ldr r5, =0x02024332 - ldrb r0, [r5, 0x3] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - str r0, [r2] - ldr r4, =0x02024064 - ldr r1, =0x0202420e - ldrb r0, [r1] - strb r0, [r4] - ldrb r1, [r1] - movs r0, 0x58 - muls r0, r1 - ldr r1, =0x020240d0 - adds r0, r1 - str r0, [sp] - movs r0, 0 - movs r1, 0x28 - movs r2, 0 - movs r3, 0x4 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r2, =0x02024280 - ldr r1, [r2] - movs r0, 0x80 - lsls r0, 6 - ands r0, r1 - cmp r0, 0 - beq _08048ED8 - movs r0, 0x1 - strb r0, [r5, 0x5] - ldr r0, =0xffffdfff - ands r1, r0 - str r1, [r2] - b _08048EDA - .pool -_08048ED8: - strb r0, [r5, 0x5] -_08048EDA: - ldr r0, =0x02024332 - ldrb r2, [r0, 0x3] - cmp r2, 0x2 - beq _08048EF2 - cmp r2, 0x6 - beq _08048EF2 - cmp r2, 0x5 - beq _08048EF2 - cmp r2, 0x3 - beq _08048EF2 - bl _080499B8 -_08048EF2: - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0xB2 - ldr r2, =0x02024332 - ldrb r1, [r2, 0x3] - strb r1, [r0] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 7 - orrs r0, r1 - str r0, [r2] - bl _080499B8 - .pool -_08048F1C: - mov r3, r10 - cmp r3, 0 - beq _08048F26 - bl _080499B8 -_08048F26: - ldr r0, =0x02024332 - strb r3, [r0, 0x3] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bl _080499B8 - .pool -_08048F40: - mov r4, r9 - ldrb r1, [r4] - movs r0, 0x58 - muls r1, r0 - mov r0, r8 - adds r0, 0x50 - adds r1, r0 - ldr r2, =gUnknown_0831C134 - ldr r0, =0x02024332 - ldrb r3, [r0, 0x3] - lsls r0, r3, 2 - adds r0, r2 - ldr r1, [r1] - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08048F66 - bl _08049994 -_08048F66: - subs r0, r3, 0x7 - cmp r0, 0x34 - bls _08048F70 - bl _080499B2 -_08048F70: - lsls r0, 2 - ldr r1, =_08048F88 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08048F88: - .4byte _0804905C - .4byte _080490D0 - .4byte _08049244 - .4byte _0804915C - .4byte _080491D8 - .4byte _0804927C - .4byte _080492C4 - .4byte _08049390 - .4byte _080493D4 - .4byte _080493D4 - .4byte _080493D4 - .4byte _080493D4 - .4byte _080493D4 - .4byte _080493D4 - .4byte _080493D4 - .4byte _0804941C - .4byte _0804941C - .4byte _0804941C - .4byte _0804941C - .4byte _0804941C - .4byte _0804941C - .4byte _0804941C - .4byte _080494FC - .4byte _08049544 - .4byte _08049564 - .4byte _08049720 - .4byte _0804975C - .4byte _08049778 - .4byte _08049790 - .4byte _080497A8 - .4byte _08049808 - .4byte _08049820 - .4byte _08049468 - .4byte _08049468 - .4byte _08049468 - .4byte _08049468 - .4byte _08049468 - .4byte _08049468 - .4byte _08049468 - .4byte _080494B0 - .4byte _080494B0 - .4byte _080494B0 - .4byte _080494B0 - .4byte _080494B0 - .4byte _080494B0 - .4byte _080494B0 - .4byte _08049864 - .4byte _080498C0 - .4byte _080499B2 - .4byte _080499B2 - .4byte _080499B2 - .4byte _080499B2 - .4byte _080499A4 -_0804905C: - mov r1, r9 - ldrb r0, [r1] - movs r5, 0x58 - adds r1, r0, 0 - muls r1, r5 - mov r2, r8 - adds r0, r1, r2 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x14 - bne _08049076 - bl _08049994 -_08049076: - mov r4, r8 - adds r4, 0x50 - adds r0, r1, r4 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - beq _0804908A - bl _08049994 -_0804908A: - bl GenerateRandomNumber - mov r3, r9 - ldrb r1, [r3] - adds r2, r1, 0 - muls r2, r5 - adds r2, r4 - lsls r0, 16 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r0 - lsrs r1, 16 - adds r1, 0x2 - ldr r0, [r2] - orrs r0, r1 - str r0, [r2] - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r1, =gUnknown_0831C224 - ldr r0, =0x02024332 - ldrb r0, [r0, 0x3] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _080499B0 - .pool -_080490D0: - mov r4, r9 - ldrb r2, [r4] - movs r4, 0x58 - adds r0, r2, 0 - muls r0, r4 - add r0, r8 - adds r0, 0x20 - ldrb r1, [r0] - cmp r1, 0x27 - bne _08049114 - cmp r5, 0x1 - beq _080490F0 - cmp r6, 0x80 - beq _080490F0 - bl _08049994 -_080490F0: - ldr r0, =0x0202420a - strb r1, [r0] - mov r1, r9 - ldrb r0, [r1] - movs r1, 0x27 - bl b_history__record_ability_usage_of_player - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB603 - str r0, [r1] - bl _080499B2 - .pool -_08049114: - adds r0, r2, 0 - bl sub_8048728 - ldr r1, =0x02024082 - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bhi _0804912A - bl _08049994 -_0804912A: - mov r2, r9 - ldrb r0, [r2] - adds r2, r0, 0 - muls r2, r4 - mov r0, r8 - adds r0, 0x50 - adds r2, r0 - ldr r1, =gUnknown_0831C134 - ldr r0, =0x02024332 - ldrb r0, [r0, 0x3] - lsls r0, 2 - adds r0, r1 - ldr r1, [r2] - ldr r0, [r0] - orrs r1, r0 - str r1, [r2] - bl _08049994 - .pool -_0804915C: - mov r3, r9 - ldrb r0, [r3] - movs r5, 0x58 - muls r0, r5 - mov r4, r8 - adds r4, 0x50 - adds r2, r0, r4 - ldr r1, [r2] - movs r0, 0x70 - ands r0, r1 - cmp r0, 0 - beq _08049178 - bl _08049994 -_08049178: - movs r0, 0x80 - lsls r0, 5 - orrs r1, r0 - str r1, [r2] - ldr r1, =0x02024268 - ldrb r0, [r3] - lsls r0, 1 - adds r0, r1 - ldr r1, =0x020241ea - ldrh r1, [r1] - strh r1, [r0] - bl GenerateRandomNumber - mov r2, r9 - ldrb r1, [r2] - adds r2, r1, 0 - muls r2, r5 - adds r2, r4 - movs r1, 0x3 - ands r1, r0 - adds r1, 0x2 - lsls r1, 4 - ldr r0, [r2] - orrs r0, r1 - str r0, [r2] - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r1, =gUnknown_0831C224 - ldr r0, =0x02024332 - ldrb r0, [r0, 0x3] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _080499B0 - .pool -_080491D8: - ldr r5, =0x0202420b - ldrb r0, [r5] - bl battle_get_per_side_status - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - bne _08049210 - ldr r4, =0x0202432e - ldrh r3, [r4] - ldr r2, =0x02024084 - ldrb r1, [r5] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x2A - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - adds r0, r3, r0 - strh r0, [r4] - lsls r0, 16 - lsrs r0, 16 - cmp r3, r0 - bls _08049210 - ldr r3, =0x0000ffff - adds r0, r3, 0 - strh r0, [r4] -_08049210: - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r1, =gUnknown_0831C224 - ldr r0, =0x02024332 - ldrb r0, [r0, 0x3] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - b _080499B0 - .pool -_08049244: - mov r4, r9 - ldrb r1, [r4] - movs r0, 0x58 - muls r0, r1 - mov r1, r8 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - beq _0804925A - b _08049994 -_0804925A: - bl GenerateRandomNumber - ldr r4, =0x02024332 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - adds r0, 0x3 - strb r0, [r4, 0x3] - movs r0, 0 - movs r1, 0 - bl sub_8048760 - b _080499B2 - .pool -_0804927C: - mov r0, r9 - ldrb r1, [r0] - movs r0, 0x58 - adds r2, r1, 0 - muls r2, r0 - mov r0, r8 - adds r0, 0x50 - adds r2, r0 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 5 - orrs r0, r1 - str r0, [r2] - ldr r1, =0x02024268 - mov r2, r9 - ldrb r0, [r2] - lsls r0, 1 - adds r0, r1 - ldr r1, =0x020241ea - ldrh r1, [r1] - strh r1, [r0] - ldr r0, =0x0202433c - ldrb r1, [r2] - lsls r1, 4 - adds r1, r0 - ldrb r0, [r1, 0x1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1, 0x1] - b _08049994 - .pool -_080492C4: - mov r3, r9 - ldrb r0, [r3] - movs r6, 0x58 - muls r0, r6 - mov r4, r8 - adds r4, 0x50 - adds r0, r4 - ldr r5, [r0] - movs r0, 0xE0 - lsls r0, 8 - ands r5, r0 - cmp r5, 0 - beq _080492E0 - b _08049994 -_080492E0: - bl GenerateRandomNumber - mov r2, r9 - ldrb r1, [r2] - adds r2, r1, 0 - muls r2, r6 - adds r2, r4 - movs r1, 0x3 - ands r1, r0 - adds r1, 0x3 - lsls r1, 13 - ldr r0, [r2] - orrs r0, r1 - str r0, [r2] - mov r3, r9 - ldrb r1, [r3] - ldr r2, =0x0202449c - ldr r0, [r2] - lsls r1, 1 - adds r1, r0 - ldr r6, =0x020241ea - ldrh r0, [r6] - strb r0, [r1, 0x4] - ldrb r1, [r3] - ldr r0, [r2] - lsls r1, 1 - adds r1, r0 - ldrh r0, [r6] - lsrs r0, 8 - strb r0, [r1, 0x5] - ldrb r1, [r3] - ldr r0, [r2] - adds r1, r0 - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r1, 0x14] - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r1, =gUnknown_0831C224 - ldr r2, =0x02024332 - ldrb r0, [r2, 0x3] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - str r0, [r4] - strb r5, [r2, 0x5] - ldr r3, =gUnknown_085CC982 - ldrh r0, [r3] - ldrh r4, [r6] - cmp r0, r4 - bne _0804934E - b _080499B2 -_0804934E: - adds r1, r2, 0 - adds r2, r6, 0 -_08049352: - ldrb r0, [r1, 0x5] - adds r0, 0x1 - strb r0, [r1, 0x5] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bls _08049362 - b _080499B2 -_08049362: - ldrb r0, [r1, 0x5] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - ldrh r4, [r2] - cmp r0, r4 - bne _08049352 - b _080499B2 - .pool -_08049390: - ldr r1, =0x020241f0 - ldr r0, =0x020241f4 - ldr r0, [r0] - cmp r0, 0 - bge _0804939C - adds r0, 0x3 -_0804939C: - asrs r0, 2 - str r0, [r1] - cmp r0, 0 - bne _080493A8 - movs r0, 0x1 - str r0, [r1] -_080493A8: - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r1, =gUnknown_0831C224 - ldr r0, =0x02024332 - ldrb r0, [r0, 0x3] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - b _080499B0 - .pool -_080493D4: - ldr r4, =0x02024332 - ldrb r1, [r4, 0x3] - adds r1, 0xF2 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x10 - adds r2, r7, 0 - movs r3, 0 - bl sub_8050A1C - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - beq _080493F2 - b _08049994 -_080493F2: - ldr r2, =0x02024474 - ldrb r1, [r4, 0x3] - movs r0, 0x3F - ands r0, r1 - strb r0, [r2, 0x10] - strb r3, [r2, 0x11] - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082D8CD4 - b _080499B0 - .pool -_0804941C: - movs r0, 0x70 - negs r0, r0 - ldr r4, =0x02024332 - ldrb r1, [r4, 0x3] - adds r1, 0xEB - lsls r1, 24 - lsrs r1, 24 - adds r2, r7, 0 - movs r3, 0 - bl sub_8050A1C - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - beq _0804943C - b _08049994 -_0804943C: - ldr r2, =0x02024474 - ldrb r1, [r4, 0x3] - movs r0, 0x3F - ands r0, r1 - strb r0, [r2, 0x10] - strb r3, [r2, 0x11] - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082D8D65 - b _080499B0 - .pool -_08049468: - ldr r4, =0x02024332 - ldrb r1, [r4, 0x3] - adds r1, 0xDA - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x20 - adds r2, r7, 0 - movs r3, 0 - bl sub_8050A1C - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - beq _08049486 - b _08049994 -_08049486: - ldr r2, =0x02024474 - ldrb r1, [r4, 0x3] - movs r0, 0x3F - ands r0, r1 - strb r0, [r2, 0x10] - strb r3, [r2, 0x11] - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082D8CD4 - b _080499B0 - .pool -_080494B0: - movs r0, 0x60 - negs r0, r0 - ldr r4, =0x02024332 - ldrb r1, [r4, 0x3] - adds r1, 0xD3 - lsls r1, 24 - lsrs r1, 24 - adds r2, r7, 0 - movs r3, 0 - bl sub_8050A1C - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - beq _080494D0 - b _08049994 -_080494D0: - ldr r2, =0x02024474 - ldrb r1, [r4, 0x3] - movs r0, 0x3F - ands r0, r1 - strb r0, [r2, 0x10] - strb r3, [r2, 0x11] - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082D8D65 - b _080499B0 - .pool -_080494FC: - mov r0, r9 - ldrb r1, [r0] - movs r0, 0x58 - adds r2, r1, 0 - muls r2, r0 - mov r0, r8 - adds r0, 0x50 - adds r2, r0 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 15 - orrs r0, r1 - str r0, [r2] - ldr r2, =0x020242bc - mov r3, r9 - ldrb r1, [r3] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x2 - strb r1, [r0, 0x19] - ldr r1, =0x02024268 - ldrb r0, [r3] - lsls r0, 1 - adds r0, r1 - ldr r1, =0x020241ea - ldrh r1, [r1] - strh r1, [r0] - b _08049994 - .pool -_08049544: - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - adds r2, r1, 0 - muls r2, r0 - mov r0, r8 - adds r0, 0x50 - adds r2, r0 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 16 -_0804955A: - orrs r0, r1 - str r0, [r2] - b _08049994 - .pool -_08049564: - ldr r5, =0x02022fec - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 19 - ands r0, r1 - cmp r0, 0 - beq _08049574 - b _08049994 -_08049574: - ldr r6, =0x0202420b - ldrb r0, [r6] - bl battle_side_get_owner - lsls r0, 24 - lsrs r4, r0, 24 - ldrb r0, [r6] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080495A8 - ldr r0, [r5] - ldr r1, =0x0a3f0902 - ands r0, r1 - cmp r0, 0 - bne _080495D4 - b _08049994 - .pool -_080495A8: - ldr r0, [r5] - ldr r1, =0x0a3f0902 - ands r0, r1 - cmp r0, 0 - bne _080495D4 - ldr r0, =0x020243d0 - adds r0, 0x29 - adds r0, r4, r0 - ldrb r1, [r0] - ldr r3, =gUnknown_0832A328 - ldr r2, =0x0202406e - ldrb r0, [r6] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _080495D4 - b _08049994 -_080495D4: - ldr r2, =0x02024084 - ldr r1, =0x0202420c - ldrb r0, [r1] - movs r5, 0x58 - muls r0, r5 - adds r4, r0, r2 - ldrh r0, [r4, 0x2E] - adds r7, r1, 0 - mov r8, r2 - cmp r0, 0 - beq _0804963C - adds r0, r4, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x3C - bne _0804963C - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB682 - str r0, [r1] - ldr r1, =0x0202420a - ldrb r0, [r7] - muls r0, r5 - add r0, r8 - adds r0, 0x20 - ldrb r0, [r0] - strb r0, [r1] - ldrb r0, [r7] - ldrb r1, [r1] - bl b_history__record_ability_usage_of_player - b _080499B2 - .pool -_0804963C: - ldr r4, =0x0202420b - mov r10, r4 - ldrb r2, [r4] - movs r0, 0x58 - mov r9, r0 - mov r0, r9 - muls r0, r2 - add r0, r8 - ldrh r4, [r0, 0x2E] - cmp r4, 0 - beq _08049654 - b _08049994 -_08049654: - ldrb r0, [r7] - mov r1, r9 - muls r1, r0 - adds r0, r1, 0 - add r0, r8 - ldrh r3, [r0, 0x2E] - adds r1, r3, 0 - cmp r1, 0xAF - bne _08049668 - b _08049994 -_08049668: - adds r0, r3, 0 - subs r0, 0x79 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xB - bhi _08049676 - b _08049994 -_08049676: - cmp r1, 0 - bne _0804967C - b _08049994 -_0804967C: - ldr r5, =0x0202449c - lsls r0, r2, 1 - adds r0, 0xD0 - ldr r1, [r5] - adds r1, r0 - ldr r2, =0x02024208 - strh r3, [r1] - strh r3, [r2] - ldrb r0, [r7] - mov r3, r9 - muls r3, r0 - adds r0, r3, 0 - add r0, r8 - movs r6, 0 - strh r4, [r0, 0x2E] - ldr r4, =0x02024064 - mov r1, r10 - ldrb r0, [r1] - strb r0, [r4] - str r2, [sp] - movs r0, 0 - movs r1, 0x2 - movs r2, 0 - movs r3, 0x2 - bl dp01_build_cmdbuf_x02_a_b_varargs - mov r2, r10 - ldrb r0, [r2] - bl dp01_battle_side_mark_buffer_for_execution - ldrb r0, [r7] - strb r0, [r4] - ldrb r0, [r7] - mov r3, r9 - muls r3, r0 - adds r0, r3, 0 - mov r1, r8 - adds r1, 0x2E - adds r0, r1 - str r0, [sp] - movs r0, 0 - movs r1, 0x2 - movs r2, 0 - movs r3, 0x2 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r7] - bl dp01_battle_side_mark_buffer_for_execution - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082DB422 - str r0, [r4] - ldrb r0, [r7] - ldr r1, [r5] - lsls r0, 1 - adds r0, r1 - adds r0, 0xC8 - strb r6, [r0] - ldrb r0, [r7] - ldr r1, [r5] - lsls r0, 1 - adds r0, r1 - adds r0, 0xC9 - strb r6, [r0] - b _080499B2 - .pool -_08049720: - ldr r3, =0x0202420c - ldrb r1, [r3] - movs r0, 0x58 - adds r2, r1, 0 - muls r2, r0 - mov r0, r8 - adds r0, 0x50 - adds r2, r0 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 19 - orrs r0, r1 - str r0, [r2] - ldr r2, =0x020242bc - ldrb r1, [r3] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0202420b - ldrb r1, [r1] - strb r1, [r0, 0x14] - b _08049994 - .pool -_0804975C: - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0x58 - adds r2, r1, 0 - muls r2, r0 - mov r0, r8 - adds r0, 0x50 - adds r2, r0 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 20 - b _0804955A - .pool -_08049778: - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082DAF27 - b _080499B0 - .pool -_08049790: - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082DAFC3 - b _080499B0 - .pool -_080497A8: - ldr r6, =0x0202420c - ldrb r0, [r6] - movs r2, 0x58 - muls r0, r2 - mov r1, r8 - adds r1, 0x4C - adds r5, r0, r1 - ldr r4, [r5] - movs r0, 0x40 - ands r0, r4 - cmp r0, 0 - bne _080497C2 - b _08049994 -_080497C2: - movs r0, 0x41 - negs r0, r0 - ands r4, r0 - str r4, [r5] - ldr r4, =0x02024064 - ldrb r0, [r6] - strb r0, [r4] - ldrb r0, [r4] - muls r0, r2 - adds r0, r1 - str r0, [sp] - movs r0, 0 - movs r1, 0x28 - movs r2, 0 - movs r3, 0x4 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082DB361 - b _080499B0 - .pool -_08049808: - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082DB117 - b _080499B0 - .pool -_08049820: - ldr r4, =0x020241f0 - ldr r0, =0x020241f4 - ldr r0, [r0] - movs r1, 0x3 - bl __divsi3 - str r0, [r4] - cmp r0, 0 - bne _08049836 - movs r0, 0x1 - str r0, [r4] -_08049836: - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r1, =gUnknown_0831C224 - ldr r0, =0x02024332 - ldrb r0, [r0, 0x3] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - b _080499B0 - .pool -_08049864: - mov r4, r9 - ldrb r0, [r4] - movs r5, 0x58 - muls r0, r5 - mov r4, r8 - adds r4, 0x50 - adds r2, r0, r4 - ldr r1, [r2] - movs r0, 0xC0 - lsls r0, 4 - ands r0, r1 - cmp r0, 0 - beq _08049880 - b _08049994 -_08049880: - movs r0, 0x80 - lsls r0, 5 - orrs r1, r0 - str r1, [r2] - ldr r1, =0x02024268 - mov r2, r9 - ldrb r0, [r2] - lsls r0, 1 - adds r0, r1 - ldr r1, =0x020241ea - ldrh r1, [r1] - strh r1, [r0] - bl GenerateRandomNumber - mov r3, r9 - ldrb r1, [r3] - adds r2, r1, 0 - muls r2, r5 - adds r2, r4 - movs r1, 0x1 - ands r1, r0 - adds r1, 0x2 - lsls r1, 10 - ldr r0, [r2] - orrs r0, r1 - str r0, [r2] - b _080499B2 - .pool -_080498C0: - mov r4, r9 - ldrb r3, [r4] - movs r5, 0x58 - adds r0, r3, 0 - muls r0, r5 - mov r2, r8 - adds r1, r0, r2 - adds r0, r1, 0 - adds r0, 0x20 - ldrb r2, [r0] - cmp r2, 0x3C - bne _08049900 - ldrh r0, [r1, 0x2E] - cmp r0, 0 - beq _08049994 - ldr r0, =0x0202420a - strb r2, [r0] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB63F - str r0, [r1] - ldrb r0, [r4] - movs r1, 0x3C - bl b_history__record_ability_usage_of_player - b _080499B2 - .pool -_08049900: - ldrh r0, [r1, 0x2E] - cmp r0, 0 - beq _08049994 - adds r0, r3, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x02024208 - mov r3, r9 - ldrb r0, [r3] - muls r0, r5 - add r0, r8 - ldrh r0, [r0, 0x2E] - strh r0, [r1] - ldrb r0, [r3] - muls r0, r5 - add r0, r8 - movs r5, 0 - movs r1, 0 - strh r1, [r0, 0x2E] - ldr r2, =0x020243d0 - adds r2, 0x29 - adds r2, r4, r2 - ldr r3, =gUnknown_0832A328 - ldr r1, =0x0202406e - mov r4, r9 - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082DB168 - str r0, [r4] - mov r1, r9 - ldrb r0, [r1] - ldr r2, =0x0202449c - ldr r1, [r2] - lsls r0, 1 - adds r0, r1 - adds r0, 0xC8 - strb r5, [r0] - mov r3, r9 - ldrb r0, [r3] - ldr r1, [r2] - lsls r0, 1 - adds r0, r1 - adds r0, 0xC9 - strb r5, [r0] - b _080499B2 - .pool -_08049994: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - b _080499B2 - .pool -_080499A4: - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082DB1D5 -_080499B0: - str r0, [r4] -_080499B2: - ldr r1, =0x02024332 - movs r0, 0 - strb r0, [r1, 0x3] -_080499B8: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8048760 - - thumb_func_start atk15_seteffectwithchancetarget -atk15_seteffectwithchancetarget: @ 80499D4 - push {r4,lr} - ldr r2, =0x02024084 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x20 - bne _08049A10 - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x5] - lsls r4, r0, 1 - b _08049A20 - .pool -_08049A10: - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r4, [r0, 0x5] -_08049A20: - ldr r3, =0x02024332 - ldrb r2, [r3, 0x3] - movs r0, 0x80 - ands r0, r2 - cmp r0, 0 - beq _08049A50 - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - bne _08049A50 - movs r0, 0x7F - ands r0, r2 - strb r0, [r3, 0x3] - b _08049A7E - .pool -_08049A50: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, r4 - bcs _08049A9A - ldr r0, =0x02024332 - ldrb r0, [r0, 0x3] - cmp r0, 0 - beq _08049A9A - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - bne _08049A9A - cmp r4, 0x63 - bls _08049A90 -_08049A7E: - movs r0, 0 - movs r1, 0x80 - bl sub_8048760 - b _08049AA2 - .pool -_08049A90: - movs r0, 0 - movs r1, 0 - bl sub_8048760 - b _08049AA2 -_08049A9A: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] -_08049AA2: - ldr r0, =0x02024332 - movs r1, 0 - strb r1, [r0, 0x3] - ldr r0, =0x02024474 - strb r1, [r0, 0x16] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk15_seteffectwithchancetarget - - thumb_func_start sub_8049AC0 -sub_8049AC0: @ 8049AC0 - push {lr} - movs r0, 0x1 - movs r1, 0 - bl sub_8048760 - pop {r0} - bx r0 - thumb_func_end sub_8049AC0 - - thumb_func_start sub_8049AD0 -sub_8049AD0: @ 8049AD0 - push {lr} - movs r0, 0 - movs r1, 0 - bl sub_8048760 - pop {r0} - bx r0 - thumb_func_end sub_8049AD0 - - thumb_func_start sub_8049AE0 -sub_8049AE0: @ 8049AE0 - push {lr} - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r2, =0x02024064 - strb r0, [r2] - ldr r3, =0x02024332 - ldrb r0, [r3, 0x3] - cmp r0, 0x6 - bhi _08049B14 - ldr r1, =0x02024084 - ldrb r2, [r2] - movs r0, 0x58 - muls r2, r0 - adds r1, 0x4C - b _08049B1E - .pool -_08049B14: - ldr r1, =0x02024084 - ldrb r2, [r2] - movs r0, 0x58 - muls r2, r0 - adds r1, 0x50 -_08049B1E: - adds r2, r1 - ldr r1, =gUnknown_0831C134 - ldrb r0, [r3, 0x3] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - ldr r0, [r2] - bics r0, r1 - str r0, [r2] - ldr r0, =0x02024332 - movs r2, 0 - strb r2, [r0, 0x3] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] - ldr r0, =0x02024474 - strb r2, [r0, 0x16] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8049AE0 - - thumb_func_start atk19_faintpokemon -atk19_faintpokemon: @ 8049B5C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - ldr r0, =0x02024214 - ldr r2, [r0] - ldrb r1, [r2, 0x2] - adds r6, r0, 0 - cmp r1, 0 - beq _08049BE0 - ldrb r0, [r2, 0x1] - bl get_battle_side_of_something - ldr r5, =0x02024064 - strb r0, [r5] - ldr r2, =0x02024280 - ldr r1, =gUnknown_0832A328 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - lsls r1, 28 - ldr r0, [r2] - ands r0, r1 - cmp r0, 0 - bne _08049B94 - b _08049E2C -_08049B94: - ldr r1, [r6] - ldrb r4, [r1, 0x3] - ldrb r0, [r1, 0x4] - lsls r0, 8 - orrs r4, r0 - ldrb r0, [r1, 0x5] - lsls r0, 16 - orrs r4, r0 - ldrb r0, [r1, 0x6] - lsls r0, 24 - orrs r4, r0 - bl b_movescr_stack_pop_cursor - str r4, [r6] - ldrb r0, [r5] - bl battle_side_get_owner - ldr r1, =0x0202428e - lsls r0, 24 - lsrs r0, 23 - adds r0, r1 - ldrh r2, [r0] - ldr r1, =0x0000fdff - ands r1, r2 - strh r1, [r0] - b _08049E32 - .pool -_08049BE0: - ldrb r0, [r2, 0x1] - cmp r0, 0x1 - bne _08049C08 - ldr r1, =0x02024064 - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r1] - ldr r0, =0x0202420c - ldrb r0, [r0] - mov r9, r0 - ldr r4, =gUnknown_082DA7AA - b _08049C18 - .pool -_08049C08: - ldr r1, =0x02024064 - ldr r0, =0x0202420c - ldrb r0, [r0] - strb r0, [r1] - ldr r0, =0x0202420b - ldrb r0, [r0] - mov r9, r0 - ldr r4, =gUnknown_082DA7B7 -_08049C18: - mov r8, r1 - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - mov r7, r8 - ldrb r3, [r7] - lsls r0, r3, 2 - adds r0, r2 - ldr r2, [r0] - ands r1, r2 - cmp r1, 0 - beq _08049C32 - b _08049E2C -_08049C32: - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r3 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _08049C42 - b _08049E2C -_08049C42: - ldr r5, =0x02024280 - lsls r1, r2, 28 - ldr r0, [r5] - orrs r0, r1 - str r0, [r5] - ldr r0, [r6] - adds r0, 0x7 - bl b_movescr_stack_push - str r4, [r6] - ldrb r0, [r7] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08049CA4 - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 15 - orrs r0, r1 - str r0, [r5] - ldr r1, =0x03005d10 - ldrb r0, [r1] - cmp r0, 0xFE - bhi _08049C78 - adds r0, 0x1 - strb r0, [r1] -_08049C78: - ldrb r0, [r7] - bl sub_80570F4 - b _08049CCE - .pool -_08049CA4: - ldr r4, =0x03005d10 - ldrb r0, [r4, 0x1] - cmp r0, 0xFE - bhi _08049CB0 - adds r0, 0x1 - strb r0, [r4, 0x1] -_08049CB0: - ldr r1, =0x0202406e - mov r2, r8 - ldrb r0, [r2] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - strh r0, [r4, 0x20] -_08049CCE: - ldr r2, =0x02024280 - ldr r1, [r2] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08049D0C - ldr r6, =0x02024084 - ldr r0, =0x0202420b - ldrb r0, [r0] - movs r5, 0x58 - muls r0, r5 - adds r0, r6 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _08049D0C - movs r0, 0x41 - negs r0, r0 - ands r1, r0 - str r1, [r2] - ldr r4, =0x02024214 - ldr r0, [r4] - bl b_movescr_stack_push - ldr r1, =0x020241f0 - mov r0, r9 - muls r0, r5 - adds r0, r6 - ldrh r0, [r0, 0x28] - str r0, [r1] - ldr r0, =gUnknown_082DAE3E - str r0, [r4] -_08049D0C: - ldr r1, =0x020242ac - ldr r6, =0x0202420c - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 7 - ands r0, r1 - cmp r0, 0 - bne _08049D24 - b _08049E32 -_08049D24: - ldr r0, =0x02024280 - ldr r5, [r0] - movs r0, 0x80 - lsls r0, 17 - ands r5, r0 - cmp r5, 0 - beq _08049D34 - b _08049E32 -_08049D34: - ldr r3, =0x0202420b - mov r8, r3 - ldrb r0, [r3] - bl battle_side_get_owner - adds r4, r0, 0 - ldrb r0, [r6] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - beq _08049E32 - ldr r0, =0x02024084 - mov r9, r0 - mov r2, r8 - ldrb r1, [r2] - movs r7, 0x58 - adds r2, r1, 0 - muls r2, r7 - adds r0, r2, r0 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _08049E32 - ldr r0, =0x020241ea - ldrh r0, [r0] - cmp r0, 0xA5 - beq _08049E32 - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, r1, r0 - adds r0, 0x80 - ldrb r4, [r0] - adds r0, r4, r2 - mov r6, r9 - adds r6, 0x24 - adds r0, r6 - strb r5, [r0] - ldr r5, =0x02024214 - ldr r0, [r5] - bl b_movescr_stack_push - ldr r0, =gUnknown_082DB18D - str r0, [r5] - ldr r5, =0x02024064 - mov r3, r8 - ldrb r0, [r3] - strb r0, [r5] - adds r1, r4, 0 - adds r1, 0x9 - lsls r1, 24 - lsrs r1, 24 - ldrb r0, [r5] - muls r0, r7 - adds r0, r6 - adds r0, r4 - str r0, [sp] - movs r0, 0 - movs r2, 0 - movs r3, 0x1 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r5] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x2 - strb r0, [r1, 0x1] - lsls r4, 1 - mov r2, r8 - ldrb r0, [r2] - muls r0, r7 - adds r0, r4, r0 - mov r2, r9 - adds r2, 0xC - adds r0, r2 - ldrh r0, [r0] - strb r0, [r1, 0x2] - mov r3, r8 - ldrb r0, [r3] - muls r0, r7 - adds r4, r0 - adds r4, r2 - ldrh r0, [r4] - lsrs r0, 8 - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - b _08049E32 - .pool -_08049E2C: - ldr r0, [r6] - adds r0, 0x7 - str r0, [r6] -_08049E32: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end atk19_faintpokemon - - thumb_func_start sub_8049E40 -sub_8049E40: @ 8049E40 - push {r4,r5,lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _08049E6A - ldr r5, =0x02024214 - ldr r0, [r5] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r4, =0x02024064 - strb r0, [r4] - movs r0, 0 - bl dp01_build_cmdbuf_x0A_A_A_A - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r5] - adds r0, 0x2 - str r0, [r5] -_08049E6A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8049E40 - - thumb_func_start sub_8049E7C -sub_8049E7C: @ 8049E7C - push {r4,r5,lr} - sub sp, 0x4 - ldr r0, =0x02024068 - ldr r5, [r0] - cmp r5, 0 - bne _08049EE8 - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r4, =0x02024064 - strb r0, [r4] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - beq _08049EB4 - ldr r2, =0x02024084 - ldrb r1, [r4] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _08049EDC -_08049EB4: - ldr r1, =0x02024084 - ldrb r0, [r4] - movs r2, 0x58 - muls r0, r2 - adds r1, 0x4C - adds r0, r1 - str r5, [r0] - ldrb r0, [r4] - muls r0, r2 - adds r0, r1 - str r0, [sp] - movs r0, 0 - movs r1, 0x28 - movs r2, 0 - movs r3, 0x4 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_08049EDC: - bl sub_803A75C - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] -_08049EE8: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8049E7C - - thumb_func_start atk1C_jumpifstatus -atk1C_jumpifstatus: @ 8049F04 - push {r4,r5,lr} - ldr r5, =0x02024214 - ldr r0, [r5] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - lsls r0, 24 - lsrs r0, 24 - ldr r2, [r5] - ldrb r4, [r2, 0x2] - ldrb r1, [r2, 0x3] - lsls r1, 8 - adds r4, r1 - ldrb r1, [r2, 0x4] - lsls r1, 16 - adds r4, r1 - ldrb r1, [r2, 0x5] - lsls r1, 24 - adds r4, r1 - ldrb r3, [r2, 0x6] - ldrb r1, [r2, 0x7] - lsls r1, 8 - adds r3, r1 - ldrb r1, [r2, 0x8] - lsls r1, 16 - adds r3, r1 - ldrb r1, [r2, 0x9] - lsls r1, 24 - adds r3, r1 - ldr r2, =0x02024084 - movs r1, 0x58 - muls r1, r0 - adds r0, r2, 0 - adds r0, 0x4C - adds r0, r1, r0 - ldr r0, [r0] - ands r0, r4 - cmp r0, 0 - beq _08049F68 - adds r0, r1, r2 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _08049F68 - str r3, [r5] - b _08049F70 - .pool -_08049F68: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0xA - str r0, [r1] -_08049F70: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk1C_jumpifstatus - - thumb_func_start atk1D_jumpifsecondarystatus -atk1D_jumpifsecondarystatus: @ 8049F7C - push {r4,r5,lr} - ldr r5, =0x02024214 - ldr r0, [r5] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - lsls r0, 24 - lsrs r0, 24 - ldr r2, [r5] - ldrb r4, [r2, 0x2] - ldrb r1, [r2, 0x3] - lsls r1, 8 - adds r4, r1 - ldrb r1, [r2, 0x4] - lsls r1, 16 - adds r4, r1 - ldrb r1, [r2, 0x5] - lsls r1, 24 - adds r4, r1 - ldrb r3, [r2, 0x6] - ldrb r1, [r2, 0x7] - lsls r1, 8 - adds r3, r1 - ldrb r1, [r2, 0x8] - lsls r1, 16 - adds r3, r1 - ldrb r1, [r2, 0x9] - lsls r1, 24 - adds r3, r1 - ldr r2, =0x02024084 - movs r1, 0x58 - muls r1, r0 - adds r0, r2, 0 - adds r0, 0x50 - adds r0, r1, r0 - ldr r0, [r0] - ands r0, r4 - cmp r0, 0 - beq _08049FE0 - adds r0, r1, r2 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _08049FE0 - str r3, [r5] - b _08049FE8 - .pool -_08049FE0: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0xA - str r0, [r1] -_08049FE8: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk1D_jumpifsecondarystatus - - thumb_func_start atk1E_jumpifability -atk1E_jumpifability: @ 8049FF4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - ldr r6, =0x02024214 - ldr r2, [r6] - ldrb r5, [r2, 0x2] - mov r8, r5 - ldrb r1, [r2, 0x3] - ldrb r0, [r2, 0x4] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 24 - adds r7, r1, r0 - ldrb r0, [r2, 0x1] - cmp r0, 0x8 - bne _0804A054 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0 - str r0, [sp] - movs r0, 0xD - adds r2, r5, 0 - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _0804A0C8 - ldr r1, =0x0202420a - strb r5, [r1] - str r7, [r6] - subs r4, 0x1 - lsls r0, r4, 24 - lsrs r0, 24 - ldrb r1, [r1] - b _0804A0B0 - .pool -_0804A054: - cmp r0, 0x9 - bne _0804A08C - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0 - str r0, [sp] - movs r0, 0xC - adds r2, r5, 0 - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _0804A0C8 - ldr r1, =0x0202420a - strb r5, [r1] - str r7, [r6] - subs r4, 0x1 - lsls r0, r4, 24 - lsrs r0, 24 - ldrb r1, [r1] - b _0804A0B0 - .pool -_0804A08C: - ldrb r0, [r2, 0x1] - bl get_battle_side_of_something - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r4 - adds r0, r1 - adds r0, 0x20 - ldrb r1, [r0] - cmp r1, r8 - bne _0804A0C8 - ldr r0, =0x0202420a - strb r1, [r0] - str r7, [r6] - ldrb r1, [r0] - adds r0, r4, 0 -_0804A0B0: - bl b_history__record_ability_usage_of_player - ldr r0, =0x02024474 - strb r4, [r0, 0x15] - b _0804A0CE - .pool -_0804A0C8: - ldr r0, [r6] - adds r0, 0x7 - str r0, [r6] -_0804A0CE: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end atk1E_jumpifability - - thumb_func_start sub_804A0DC -sub_804A0DC: @ 804A0DC - push {r4-r6,lr} - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r4, [r0, 0x1] - cmp r4, 0x1 - bne _0804A0FC - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_get_per_side_status - b _0804A106 - .pool -_0804A0FC: - ldr r0, =0x0202420c - ldrb r0, [r0] - bl battle_get_per_side_status - movs r4, 0x1 -_0804A106: - ands r4, r0 - ldr r6, =0x02024214 - ldr r3, [r6] - ldrb r2, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r2, r0 - ldrb r1, [r3, 0x4] - ldrb r0, [r3, 0x5] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r3, 0x6] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r3, 0x7] - lsls r0, 24 - adds r5, r1, r0 - ldr r1, =0x0202428e - lsls r0, r4, 1 - adds r0, r1 - ldrh r0, [r0] - ands r2, r0 - cmp r2, 0 - beq _0804A148 - str r5, [r6] - b _0804A14E - .pool -_0804A148: - adds r0, r3, 0 - adds r0, 0x8 - str r0, [r6] -_0804A14E: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_804A0DC - - thumb_func_start sub_804A154 -sub_804A154: @ 804A154 - push {r4,r5,lr} - movs r5, 0 - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02024084 - ldr r3, [r4] - movs r1, 0x58 - muls r0, r1 - ldrb r1, [r3, 0x3] - adds r0, r1 - adds r2, 0x18 - adds r0, r2 - ldrb r2, [r0] - ldrb r0, [r3, 0x2] - cmp r0, 0x5 - bhi _0804A212 - lsls r0, 2 - ldr r1, =_0804A194 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0804A194: - .4byte _0804A1AC - .4byte _0804A1BC - .4byte _0804A1CC - .4byte _0804A1DC - .4byte _0804A1EC - .4byte _0804A200 -_0804A1AC: - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x4] - cmp r2, r0 - bne _0804A212 - b _0804A20C - .pool -_0804A1BC: - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x4] - cmp r2, r0 - beq _0804A212 - b _0804A20C - .pool -_0804A1CC: - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x4] - cmp r2, r0 - bls _0804A212 - b _0804A20C - .pool -_0804A1DC: - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x4] - cmp r2, r0 - bcs _0804A212 - b _0804A20C - .pool -_0804A1EC: - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x4] - ands r2, r0 - cmp r2, 0 - beq _0804A212 - b _0804A20C - .pool -_0804A200: - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x4] - ands r2, r0 - cmp r2, 0 - bne _0804A212 -_0804A20C: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_0804A212: - cmp r5, 0 - beq _0804A238 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x5] - ldrb r0, [r2, 0x6] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x8] - lsls r0, 24 - adds r1, r0 - str r1, [r3] - b _0804A240 - .pool -_0804A238: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x9 - str r0, [r1] -_0804A240: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_804A154 - - thumb_func_start atk21_jumpifspecialstatusflag -atk21_jumpifspecialstatusflag: @ 804A24C - push {r4-r6,lr} - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r5, =0x02024064 - strb r0, [r5] - ldr r2, [r4] - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - adds r6, r1, r0 - ldrb r1, [r2, 0x7] - ldrb r0, [r2, 0x8] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x9] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0xA] - lsls r0, 24 - adds r3, r1, r0 - ldrb r0, [r2, 0x6] - cmp r0, 0 - beq _0804A2AC - ldr r0, =0x020242ac - ldrb r1, [r5] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - ands r0, r6 - cmp r0, 0 - bne _0804A2C4 - b _0804A2BC - .pool -_0804A2AC: - ldr r0, =0x020242ac - ldrb r1, [r5] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - ands r0, r6 - cmp r0, 0 - beq _0804A2C4 -_0804A2BC: - str r3, [r4] - b _0804A2CA - .pool -_0804A2C4: - adds r0, r2, 0 - adds r0, 0xB - str r0, [r4] -_0804A2CA: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end atk21_jumpifspecialstatusflag - - thumb_func_start sub_804A2D0 -sub_804A2D0: @ 804A2D0 - push {r4-r6,lr} - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - lsls r0, 24 - lsrs r0, 24 - ldr r3, [r4] - ldrb r5, [r3, 0x2] - ldrb r2, [r3, 0x3] - ldrb r1, [r3, 0x4] - lsls r1, 8 - adds r2, r1 - ldrb r1, [r3, 0x5] - lsls r1, 16 - adds r2, r1 - ldrb r1, [r3, 0x6] - lsls r1, 24 - adds r6, r2, r1 - ldr r2, =0x02024084 - movs r1, 0x58 - muls r0, r1 - adds r1, r0, r2 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, r5 - beq _0804A314 - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, r5 - bne _0804A320 -_0804A314: - str r6, [r4] - b _0804A324 - .pool -_0804A320: - adds r0, r3, 0x7 - str r0, [r4] -_0804A324: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_804A2D0 - - thumb_func_start sub_804A32C -sub_804A32C: @ 804A32C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r6, 0 - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x50 - mov r9, r0 - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r1, =0x0202420d - strb r0, [r1] - ldr r2, =0x020243fe - movs r1, 0x2 - ands r1, r0 - lsls r1, 24 - lsrs r1, 25 - adds r1, r2 - ldrb r1, [r1] - mov r8, r1 - ldr r0, =0x02024474 - ldrb r0, [r0, 0x1C] - cmp r0, 0x6 - bls _0804A368 - bl _0804ACB2 -_0804A368: - lsls r0, 2 - ldr r1, =_0804A38C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0804A38C: - .4byte _0804A3A8 - .4byte _0804A414 - .4byte _0804A52E - .4byte _0804A850 - .4byte _0804A954 - .4byte _0804AC40 - .4byte _0804AC88 -_0804A3A8: - ldr r4, =0x0202420d - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0804A3BC - bl _0804AC7C -_0804A3BC: - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x063f0982 - ands r0, r1 - cmp r0, 0 - beq _0804A3CC - bl _0804AC7C -_0804A3CC: - ldr r1, =0x02024474 - ldrb r0, [r1, 0x1C] - adds r0, 0x1 - strb r0, [r1, 0x1C] - ldr r0, =0x0202449c - ldr r2, [r0] - adds r2, 0xDF - ldr r3, =gUnknown_0832A328 - ldr r1, =0x0202406e - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - bl _0804ACB2 - .pool -_0804A414: - movs r5, 0 - movs r7, 0 -_0804A418: - movs r0, 0x64 - adds r1, r7, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _0804A486 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _0804A486 - ldr r0, =gUnknown_0832A328 - lsls r1, r7, 2 - adds r1, r0 - ldr r0, [r1] - mov r1, r8 - ands r0, r1 - cmp r0, 0 - beq _0804A44C - adds r5, 0x1 -_0804A44C: - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xAF - bne _0804A478 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x00003226 - adds r0, r2 - ldrb r4, [r0] - b _0804A480 - .pool -_0804A478: - bl itemid_get_x12 - lsls r0, 24 - lsrs r4, r0, 24 -_0804A480: - cmp r4, 0x19 - bne _0804A486 - adds r6, 0x1 -_0804A486: - adds r7, 0x1 - cmp r7, 0x5 - ble _0804A418 - ldr r3, =gBaseStats - ldr r2, =0x02024084 - ldr r0, =0x0202420d - ldrb r1, [r0] - movs r0, 0x58 - muls r1, r0 - adds r1, r2 - ldrh r2, [r1] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r3 - ldrb r2, [r0, 0x9] - adds r1, 0x2A - ldrb r0, [r1] - muls r0, r2 - movs r1, 0x7 - bl __divsi3 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r6, 0 - beq _0804A4FC - lsrs r4, r0, 17 - adds r0, r4, 0 - adds r1, r5, 0 - bl __divsi3 - mov r1, r9 - strh r0, [r1] - lsls r0, 16 - cmp r0, 0 - bne _0804A4D2 - movs r0, 0x1 - strh r0, [r1] -_0804A4D2: - ldr r5, =0x02024402 - adds r0, r4, 0 - adds r1, r6, 0 - bl __divsi3 - strh r0, [r5] - lsls r0, 16 - cmp r0, 0 - bne _0804A516 - movs r0, 0x1 - strh r0, [r5] - b _0804A516 - .pool -_0804A4FC: - adds r0, r1, 0 - adds r1, r5, 0 - bl __divsi3 - mov r2, r9 - strh r0, [r2] - lsls r0, 16 - cmp r0, 0 - bne _0804A512 - movs r0, 0x1 - strh r0, [r2] -_0804A512: - ldr r0, =0x02024402 - strh r6, [r0] -_0804A516: - ldr r1, =0x02024474 - ldrb r0, [r1, 0x1C] - adds r0, 0x1 - movs r2, 0 - strb r0, [r1, 0x1C] - ldr r1, =0x0202449c - ldr r0, [r1] - strb r2, [r0, 0x10] - ldr r0, [r1] - adds r0, 0x53 - mov r4, r8 - strb r4, [r0] -_0804A52E: - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - beq _0804A538 - b _0804ACB2 -_0804A538: - ldr r0, =0x0202449c - ldr r0, [r0] - ldrb r1, [r0, 0x10] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xC - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xAF - bne _0804A57C - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003226 - adds r0, r1 - ldrb r4, [r0] - b _0804A584 - .pool -_0804A57C: - bl itemid_get_x12 - lsls r0, 24 - lsrs r4, r0, 24 -_0804A584: - ldr r5, =0x0202449c - cmp r4, 0x19 - beq _0804A5AC - ldr r0, [r5] - adds r1, r0, 0 - adds r1, 0x53 - ldrb r0, [r1] - movs r2, 0x1 - ands r2, r0 - cmp r2, 0 - bne _0804A5AC - lsrs r0, 1 - strb r0, [r1] - ldr r1, =0x02024474 - b _0804A5D0 - .pool -_0804A5AC: - ldr r0, [r5] - ldrb r1, [r0, 0x10] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x38 - bl pokemon_getattr - cmp r0, 0x64 - bne _0804A5E8 - ldr r1, [r5] - adds r1, 0x53 - ldrb r0, [r1] - lsrs r0, 1 - strb r0, [r1] - ldr r1, =0x02024474 - movs r2, 0 -_0804A5D0: - movs r0, 0x5 - strb r0, [r1, 0x1C] - ldr r0, =0x020241f0 - str r2, [r0] - b _0804ACB2 - .pool -_0804A5E8: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x8 - ands r0, r1 - cmp r0, 0 - bne _0804A616 - ldr r0, =0x02024084 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _0804A616 - ldr r0, [r5] - ldrb r0, [r0, 0x12] - cmp r0, 0 - bne _0804A616 - bl sub_805EA60 - ldr r0, =0x00000161 - bl song_play_for_text - ldr r1, [r5] - ldrb r0, [r1, 0x12] - adds r0, 0x1 - strb r0, [r1, 0x12] -_0804A616: - ldr r5, =0x0202449c - ldr r0, [r5] - ldrb r1, [r0, 0x10] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - bne _0804A630 - b _0804A824 -_0804A630: - ldr r0, [r5] - adds r0, 0x53 - ldrb r0, [r0] - movs r3, 0x1 - ands r3, r0 - cmp r3, 0 - beq _0804A664 - ldr r1, =0x020241f0 - mov r2, r9 - ldrh r0, [r2] - str r0, [r1] - mov r9, r1 - b _0804A66A - .pool -_0804A664: - ldr r0, =0x020241f0 - str r3, [r0] - mov r9, r0 -_0804A66A: - cmp r4, 0x19 - bne _0804A67A - ldr r0, =0x02024402 - ldrh r1, [r0] - mov r2, r9 - ldr r0, [r2] - adds r0, r1 - str r0, [r2] -_0804A67A: - cmp r4, 0x28 - bne _0804A68E - mov r4, r9 - ldr r1, [r4] - movs r0, 0x96 - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - str r0, [r4] -_0804A68E: - ldr r5, =0x02022fec - ldr r0, [r5] - movs r1, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0804A6AA - ldr r4, =0x020241f0 - ldr r1, [r4] - movs r0, 0x96 - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - str r0, [r4] -_0804A6AA: - ldr r4, =0x0202449c - ldr r0, [r4] - ldrb r1, [r0, 0x10] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - bl sub_806E8A8 - lsls r0, 24 - cmp r0, 0 - beq _0804A714 - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 15 - ands r0, r1 - cmp r0, 0 - beq _0804A6F8 - ldr r0, [r4] - ldrb r0, [r0, 0x10] - cmp r0, 0x2 - bls _0804A6F8 - ldr r7, =0x00000149 - ldr r0, =0x020241f0 - mov r9, r0 - b _0804A71A - .pool -_0804A6F8: - ldr r4, =0x020241f0 - ldr r1, [r4] - movs r0, 0x96 - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - str r0, [r4] - movs r7, 0xA5 - lsls r7, 1 - mov r9, r4 - b _0804A71A - .pool -_0804A714: - ldr r7, =0x00000149 - ldr r1, =0x020241f0 - mov r9, r1 -_0804A71A: - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x1 - ands r1, r0 - cmp r1, 0 - beq _0804A786 - ldr r0, =0x0202406e - ldr r1, =0x0202449c - ldr r4, [r1] - ldrh r0, [r0, 0x4] - adds r5, r1, 0 - ldr r3, =gUnknown_0832A328 - ldr r2, =0x02024210 - ldrb r1, [r4, 0x10] - cmp r0, r1 - bne _0804A76C - ldrb r1, [r2] - ldr r0, [r3, 0x8] - ands r1, r0 - cmp r1, 0 - bne _0804A76C - adds r1, r4, 0 - adds r1, 0x8F - movs r0, 0x2 - strb r0, [r1] - b _0804A78E - .pool -_0804A76C: - ldrb r2, [r2] - ldr r0, [r3] - ands r2, r0 - cmp r2, 0 - bne _0804A77E - ldr r0, [r5] - adds r0, 0x8F - strb r2, [r0] - b _0804A78E -_0804A77E: - ldr r0, [r5] - adds r0, 0x8F - movs r1, 0x2 - b _0804A78C -_0804A786: - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x8F -_0804A78C: - strb r1, [r0] -_0804A78E: - ldr r1, =0x02022f58 - movs r2, 0 - mov r12, r2 - movs r3, 0xFD - strb r3, [r1] - movs r5, 0x4 - strb r5, [r1, 0x1] - ldr r6, =0x0202449c - ldr r2, [r6] - movs r4, 0x8F - adds r4, r2 - mov r8, r4 - ldrb r0, [r4] - strb r0, [r1, 0x2] - ldrb r0, [r2, 0x10] - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r1, =0x02022f68 - strb r3, [r1] - mov r0, r12 - strb r0, [r1, 0x1] - strb r7, [r1, 0x2] - movs r4, 0xFF - lsls r4, 8 - ands r7, r4 - asrs r0, r7, 8 - strb r0, [r1, 0x3] - movs r0, 0x1 - negs r0, r0 - strb r0, [r1, 0x4] - ldr r1, =0x02022f78 - strb r3, [r1] - movs r0, 0x1 - strb r0, [r1, 0x1] - strb r5, [r1, 0x2] - movs r0, 0x5 - strb r0, [r1, 0x3] - mov r0, r9 - ldr r2, [r0] - strb r2, [r1, 0x4] - adds r0, r2, 0 - ands r0, r4 - asrs r0, 8 - strb r0, [r1, 0x5] - movs r0, 0xFF - lsls r0, 16 - ands r0, r2 - asrs r0, 16 - strb r0, [r1, 0x6] - lsrs r2, 24 - strb r2, [r1, 0x7] - movs r0, 0x1 - negs r0, r0 - strb r0, [r1, 0x8] - mov r2, r8 - ldrb r1, [r2] - movs r0, 0xD - bl b_std_message - ldr r0, [r6] - ldrb r1, [r0, 0x10] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldr r3, =0x02024084 - ldr r1, =0x0202420d - ldrb r2, [r1] - movs r1, 0x58 - muls r1, r2 - adds r1, r3 - ldrh r1, [r1] - bl sub_806DADC -_0804A824: - ldr r0, =0x0202449c - ldr r1, [r0] - adds r1, 0x53 - ldrb r0, [r1] - lsrs r0, 1 - strb r0, [r1] - b _0804A92A - .pool -_0804A850: - ldr r0, =0x02024068 - ldr r2, [r0] - cmp r2, 0 - beq _0804A85A - b _0804ACB2 -_0804A85A: - ldr r1, =0x02023864 - ldr r7, =0x0202449c - ldr r0, [r7] - adds r0, 0x8F - ldrb r0, [r0] - lsls r0, 9 - adds r0, r1 - strb r2, [r0] - ldr r0, [r7] - ldrb r0, [r0, 0x10] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x020244ec - adds r0, r5 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _0804A92A - ldr r0, [r7] - ldrb r0, [r0, 0x10] - muls r0, r6 - adds r0, r5 - movs r1, 0x38 - bl pokemon_getattr - cmp r0, 0x64 - beq _0804A92A - ldr r0, [r7] - ldrb r0, [r0, 0x10] - muls r0, r6 - adds r0, r5 - movs r1, 0x3A - bl pokemon_getattr - ldr r4, =0x020244a8 - ldr r1, [r4] - ldr r1, [r1, 0x10] - strh r0, [r1] - ldr r0, [r7] - ldrb r0, [r0, 0x10] - muls r0, r6 - adds r0, r5 - movs r1, 0x3B - bl pokemon_getattr - ldr r1, [r4] - ldr r1, [r1, 0x10] - strh r0, [r1, 0x2] - ldr r0, [r7] - ldrb r0, [r0, 0x10] - muls r0, r6 - adds r0, r5 - movs r1, 0x3C - bl pokemon_getattr - ldr r1, [r4] - ldr r1, [r1, 0x10] - strh r0, [r1, 0x4] - ldr r0, [r7] - ldrb r0, [r0, 0x10] - muls r0, r6 - adds r0, r5 - movs r1, 0x3D - bl pokemon_getattr - ldr r1, [r4] - ldr r1, [r1, 0x10] - strh r0, [r1, 0x6] - ldr r0, [r7] - ldrb r0, [r0, 0x10] - muls r0, r6 - adds r0, r5 - movs r1, 0x3E - bl pokemon_getattr - ldr r1, [r4] - ldr r1, [r1, 0x10] - strh r0, [r1, 0x8] - ldr r0, [r7] - ldrb r0, [r0, 0x10] - muls r0, r6 - adds r0, r5 - movs r1, 0x3F - bl pokemon_getattr - ldr r1, [r4] - ldr r1, [r1, 0x10] - strh r0, [r1, 0xA] - ldr r4, =0x02024064 - ldr r1, [r7] - adds r0, r1, 0 - adds r0, 0x8F - ldrb r0, [r0] - strb r0, [r4] - ldrb r1, [r1, 0x10] - ldr r0, =0x020241f0 - ldrh r2, [r0] - movs r0, 0 - bl dp01_build_cmdbuf_x19_a_bb - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0804A92A: - ldr r1, =0x02024474 - ldrb r0, [r1, 0x1C] - adds r0, 0x1 - strb r0, [r1, 0x1C] - b _0804ACB2 - .pool -_0804A954: - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - beq _0804A95E - b _0804ACB2 -_0804A95E: - ldr r1, =0x02024064 - ldr r0, =0x0202449c - ldr r4, [r0] - adds r0, r4, 0 - adds r0, 0x8F - ldrb r0, [r0] - strb r0, [r1] - ldr r3, =0x02023864 - ldrb r2, [r1] - lsls r1, r2, 9 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, 0x21 - beq _0804A97C - b _0804AC28 -_0804A97C: - adds r0, r3, 0x1 - adds r0, r1, r0 - ldrb r0, [r0] - cmp r0, 0xB - beq _0804A988 - b _0804AC28 -_0804A988: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0804A9B2 - ldr r0, =0x0202406e - lsls r1, r2, 1 - adds r1, r0 - ldrh r0, [r1] - ldrb r4, [r4, 0x10] - cmp r0, r4 - bne _0804A9B2 - adds r1, r0, 0 - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - adds r1, r2, 0 - bl sub_805E990 -_0804A9B2: - ldr r1, =0x02022f58 - movs r3, 0xFD - strb r3, [r1] - movs r0, 0x4 - strb r0, [r1, 0x1] - ldr r6, =0x02024064 - ldrb r0, [r6] - strb r0, [r1, 0x2] - ldr r4, =0x0202449c - mov r9, r4 - ldr r2, [r4] - ldrb r0, [r2, 0x10] - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r4, =0x02022f68 - strb r3, [r4] - movs r0, 0x1 - strb r0, [r4, 0x1] - strb r0, [r4, 0x2] - movs r0, 0x3 - strb r0, [r4, 0x3] - ldrb r0, [r2, 0x10] - movs r1, 0x64 - mov r8, r1 - mov r2, r8 - muls r2, r0 - adds r0, r2, 0 - ldr r7, =0x020244ec - adds r0, r7 - movs r1, 0x38 - bl pokemon_getattr - strb r0, [r4, 0x4] - movs r0, 0x1 - negs r0, r0 - strb r0, [r4, 0x5] - bl b_movescr_stack_push_cursor - ldr r2, =0x03005d54 - ldr r1, =gUnknown_0832A328 - mov r4, r9 - ldr r5, [r4] - ldrb r0, [r5, 0x10] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DABBD - str r0, [r1] - ldr r4, =0x020241f0 - ldr r2, =0x02023864 - ldrb r1, [r6] - lsls r1, 9 - adds r0, r2, 0x2 - adds r0, r1, r0 - ldrb r3, [r0] - adds r2, 0x3 - adds r1, r2 - ldrb r0, [r1] - lsls r0, 8 - orrs r3, r0 - str r3, [r4] - ldrb r0, [r5, 0x10] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r7 - movs r1, 0 - bl happiness_algorithm - ldr r1, =0x0202406e - mov r2, r9 - ldr r0, [r2] - ldrb r2, [r0, 0x10] - ldrh r0, [r1] - cmp r0, r2 - bne _0804AB1E - ldr r4, =0x02024084 - ldrh r0, [r4, 0x28] - cmp r0, 0 - beq _0804AB1E - mov r0, r8 - muls r0, r2 - adds r0, r7 - movs r1, 0x38 - bl pokemon_getattr - adds r1, r4, 0 - adds r1, 0x2A - strb r0, [r1] - mov r1, r9 - ldr r0, [r1] - ldrb r0, [r0, 0x10] - mov r2, r8 - muls r2, r0 - adds r0, r2, 0 - adds r0, r7 - movs r1, 0x39 - bl pokemon_getattr - strh r0, [r4, 0x28] - mov r1, r9 - ldr r0, [r1] - ldrb r0, [r0, 0x10] - mov r2, r8 - muls r2, r0 - adds r0, r2, 0 - adds r0, r7 - movs r1, 0x3A - bl pokemon_getattr - strh r0, [r4, 0x2C] - mov r1, r9 - ldr r0, [r1] - ldrb r0, [r0, 0x10] - mov r2, r8 - muls r2, r0 - adds r0, r2, 0 - adds r0, r7 - movs r1, 0x3B - bl pokemon_getattr - strh r0, [r4, 0x2] - mov r1, r9 - ldr r0, [r1] - ldrb r0, [r0, 0x10] - mov r2, r8 - muls r2, r0 - adds r0, r2, 0 - adds r0, r7 - movs r1, 0x3C - bl pokemon_getattr - strh r0, [r4, 0x4] - mov r1, r9 - ldr r0, [r1] - ldrb r0, [r0, 0x10] - mov r2, r8 - muls r2, r0 - adds r0, r2, 0 - adds r0, r7 - movs r1, 0x3D - bl pokemon_getattr - strh r0, [r4, 0x6] - mov r1, r9 - ldr r0, [r1] - ldrb r0, [r0, 0x10] - mov r2, r8 - muls r2, r0 - adds r0, r2, 0 - adds r0, r7 - movs r1, 0x3D - bl pokemon_getattr - strh r0, [r4, 0x6] - mov r1, r9 - ldr r0, [r1] - ldrb r0, [r0, 0x10] - mov r2, r8 - muls r2, r0 - adds r0, r2, 0 - adds r0, r7 - movs r1, 0x3E - bl pokemon_getattr - strh r0, [r4, 0x8] - mov r1, r9 - ldr r0, [r1] - ldrb r0, [r0, 0x10] - mov r2, r8 - muls r2, r0 - adds r0, r2, 0 - adds r0, r7 - movs r1, 0x3F - bl pokemon_getattr - strh r0, [r4, 0xA] -_0804AB1E: - ldr r0, =0x0202406e - ldr r7, =0x0202449c - ldr r1, [r7] - ldrb r2, [r1, 0x10] - ldrh r0, [r0, 0x4] - cmp r0, r2 - beq _0804AB2E - b _0804AC2E -_0804AB2E: - ldr r6, =0x02024084 - movs r4, 0xD8 - adds r4, r6 - mov r8, r4 - ldrh r0, [r4] - cmp r0, 0 - beq _0804AC2E - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0804AC2E - movs r5, 0x64 - adds r0, r2, 0 - muls r0, r5 - ldr r4, =0x020244ec - adds r0, r4 - movs r1, 0x38 - bl pokemon_getattr - adds r1, r6, 0 - adds r1, 0xDA - strb r0, [r1] - ldr r0, [r7] - ldrb r0, [r0, 0x10] - muls r0, r5 - adds r0, r4 - movs r1, 0x39 - bl pokemon_getattr - mov r1, r8 - strh r0, [r1] - ldr r0, [r7] - ldrb r0, [r0, 0x10] - muls r0, r5 - adds r0, r4 - movs r1, 0x3A - bl pokemon_getattr - adds r1, r6, 0 - adds r1, 0xDC - strh r0, [r1] - ldr r0, [r7] - ldrb r0, [r0, 0x10] - muls r0, r5 - adds r0, r4 - movs r1, 0x3B - bl pokemon_getattr - adds r1, r6, 0 - adds r1, 0xB2 - strh r0, [r1] - ldr r0, [r7] - ldrb r0, [r0, 0x10] - muls r0, r5 - adds r0, r4 - movs r1, 0x3C - bl pokemon_getattr - adds r1, r6, 0 - adds r1, 0xB4 - strh r0, [r1] - ldr r0, [r7] - ldrb r0, [r0, 0x10] - muls r0, r5 - adds r0, r4 - movs r1, 0x3D - bl pokemon_getattr - movs r2, 0xB6 - adds r2, r6 - mov r8, r2 - strh r0, [r2] - ldr r0, [r7] - ldrb r0, [r0, 0x10] - muls r0, r5 - adds r0, r4 - movs r1, 0x3D - bl pokemon_getattr - mov r1, r8 - strh r0, [r1] - ldr r0, [r7] - ldrb r0, [r0, 0x10] - muls r0, r5 - adds r0, r4 - movs r1, 0x3E - bl pokemon_getattr - adds r1, r6, 0 - adds r1, 0xB8 - strh r0, [r1] - b _0804AC2E - .pool -_0804AC28: - ldr r1, =0x020241f0 - movs r0, 0 - str r0, [r1] -_0804AC2E: - ldr r1, =0x02024474 - movs r0, 0x5 - strb r0, [r1, 0x1C] - b _0804ACB2 - .pool -_0804AC40: - ldr r0, =0x020241f0 - ldr r0, [r0] - cmp r0, 0 - beq _0804AC58 - ldr r1, =0x02024474 - movs r0, 0x3 - strb r0, [r1, 0x1C] - b _0804ACB2 - .pool -_0804AC58: - ldr r2, =0x0202449c - ldr r1, [r2] - ldrb r0, [r1, 0x10] - adds r0, 0x1 - strb r0, [r1, 0x10] - ldr r0, [r2] - ldrb r0, [r0, 0x10] - cmp r0, 0x5 - bhi _0804AC7C - ldr r1, =0x02024474 - movs r0, 0x2 - strb r0, [r1, 0x1C] - b _0804ACB2 - .pool -_0804AC7C: - ldr r1, =0x02024474 - movs r0, 0x6 - strb r0, [r1, 0x1C] - b _0804ACB2 - .pool -_0804AC88: - ldr r0, =0x02024068 - ldr r5, [r0] - cmp r5, 0 - bne _0804ACB2 - ldr r4, =0x02024084 - ldr r2, =0x0202420d - ldrb r0, [r2] - movs r1, 0x58 - muls r0, r1 - adds r0, r4 - movs r3, 0 - strh r5, [r0, 0x2E] - ldrb r0, [r2] - muls r0, r1 - adds r0, r4 - adds r0, 0x20 - strb r3, [r0] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] -_0804ACB2: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_804A32C - - thumb_func_start sub_804ACD0 -sub_804ACD0: @ 804ACD0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r6, 0 - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - beq _0804ACE2 - b _0804AF22 -_0804ACE2: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 15 - ands r0, r1 - cmp r0, 0 - beq _0804AD48 - ldr r0, =0x02038bce - ldrh r1, [r0] - ldr r0, =0x00000c03 - cmp r1, r0 - bne _0804AD48 - movs r5, 0 -_0804ACFC: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _0804AD2C - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _0804AD2C - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - adds r0, r6, r0 - lsls r0, 16 - lsrs r6, r0, 16 -_0804AD2C: - adds r5, 0x1 - cmp r5, 0x2 - ble _0804ACFC - b _0804ADA8 - .pool -_0804AD48: - movs r5, 0 -_0804AD4A: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _0804ADA2 - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _0804ADA2 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - beq _0804AD94 - ldr r0, =0x0202449c - ldr r0, [r0] - movs r1, 0xA8 - lsls r1, 2 - adds r0, r1 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - lsls r0, r5, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0804ADA2 -_0804AD94: - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - adds r0, r6, r0 - lsls r0, 16 - lsrs r6, r0, 16 -_0804ADA2: - adds r5, 0x1 - cmp r5, 0x5 - ble _0804AD4A -_0804ADA8: - cmp r6, 0 - bne _0804ADB6 - ldr r0, =0x0202433a - ldrb r1, [r0] - movs r2, 0x2 - orrs r1, r2 - strb r1, [r0] -_0804ADB6: - movs r6, 0 - movs r5, 0 -_0804ADBA: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x02024744 - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _0804AE10 - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _0804AE10 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - beq _0804AE02 - ldr r0, =0x0202449c - ldr r0, [r0] - ldr r1, =0x000002a1 - adds r0, r1 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - lsls r0, r5, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0804AE10 -_0804AE02: - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - adds r0, r6, r0 - lsls r0, 16 - lsrs r6, r0, 16 -_0804AE10: - adds r5, 0x1 - cmp r5, 0x5 - ble _0804ADBA - ldr r2, =0x0202433a - cmp r6, 0 - bne _0804AE24 - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] -_0804AE24: - ldrb r0, [r2] - cmp r0, 0 - bne _0804AF1A - ldr r0, =0x02022fec - ldr r1, [r0] - ldr r2, =0x02000002 - ands r1, r2 - mov r8, r0 - cmp r1, 0 - beq _0804AF1A - movs r3, 0 - movs r5, 0 - ldr r0, =0x0202406c - ldrb r1, [r0] - mov r12, r0 - ldr r7, =0x02024214 - cmp r3, r1 - bge _0804AE70 - ldr r0, =0x02024280 - movs r6, 0x80 - lsls r6, 21 - ldr r4, [r0] - adds r2, r1, 0 - ldr r1, =0x0202437c -_0804AE54: - adds r0, r6, 0 - lsls r0, r5 - ands r0, r4 - cmp r0, 0 - beq _0804AE68 - ldrb r0, [r1] - lsls r0, 25 - cmp r0, 0 - blt _0804AE68 - adds r3, 0x1 -_0804AE68: - adds r1, 0x28 - adds r5, 0x2 - cmp r5, r2 - blt _0804AE54 -_0804AE70: - movs r2, 0 - movs r5, 0x1 - mov r4, r12 - ldrb r1, [r4] - cmp r5, r1 - bge _0804AEAA - ldr r0, =0x02024280 - movs r4, 0x80 - lsls r4, 21 - mov r12, r4 - ldr r6, [r0] - ldr r0, =0x0202437c - adds r4, r1, 0 - adds r1, r0, 0 - adds r1, 0x14 -_0804AE8E: - mov r0, r12 - lsls r0, r5 - ands r0, r6 - cmp r0, 0 - beq _0804AEA2 - ldrb r0, [r1] - lsls r0, 25 - cmp r0, 0 - blt _0804AEA2 - adds r2, 0x1 -_0804AEA2: - adds r1, 0x28 - adds r5, 0x2 - cmp r5, r4 - blt _0804AE8E -_0804AEAA: - mov r1, r8 - ldr r0, [r1] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0804AEF0 - adds r0, r2, r3 - cmp r0, 0x1 - bgt _0804AEF8 - b _0804AF12 - .pool -_0804AEF0: - cmp r2, 0 - beq _0804AF12 - cmp r3, 0 - beq _0804AF12 -_0804AEF8: - ldr r2, [r7] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - adds r1, r0 - str r1, [r7] - b _0804AF22 -_0804AF12: - ldr r0, [r7] - adds r0, 0x5 - str r0, [r7] - b _0804AF22 -_0804AF1A: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_0804AF22: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_804ACD0 - - thumb_func_start sub_804AF30 -sub_804AF30: @ 804AF30 - ldr r1, =0x0202427c - movs r0, 0 - strb r0, [r1] - ldr r0, =0x02024474 - movs r2, 0 - movs r1, 0x1 - strb r1, [r0, 0xE] - ldr r0, =0x02024211 - strb r1, [r0] - ldr r0, =0x02024332 - strb r2, [r0, 0x3] - strb r2, [r0, 0x6] - ldr r2, =0x02024280 - ldr r0, [r2] - subs r1, 0x42 - ands r0, r1 - ldr r1, =0xffffbfff - ands r0, r1 - str r0, [r2] - bx lr - .pool - thumb_func_end sub_804AF30 - - thumb_func_start atk25_cmd25 -atk25_cmd25: @ 804AF70 - push {lr} - bl sub_804AF30 - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end atk25_cmd25 - - thumb_func_start atk26_80225F0_storebyteforjump -atk26_80225F0_storebyteforjump: @ 804AF88 - ldr r3, =0x02024212 - ldr r2, =0x02024214 - ldr r0, [r2] - ldrb r1, [r0, 0x1] - strb r1, [r3] - adds r0, 0x2 - str r0, [r2] - bx lr - .pool - thumb_func_end atk26_80225F0_storebyteforjump - - thumb_func_start atk27_cmd27 -atk27_cmd27: @ 804AFA0 - push {lr} - ldr r1, =0x02024212 - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - lsls r0, 24 - cmp r0, 0 - bne _0804AFC4 - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _0804AFDE - .pool -_0804AFC4: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - adds r1, r0 - str r1, [r3] -_0804AFDE: - pop {r0} - bx r0 - .pool - thumb_func_end atk27_cmd27 - - thumb_func_start atk28_goto -atk28_goto: @ 804AFE8 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - adds r1, r0 - str r1, [r3] - bx lr - .pool - thumb_func_end atk28_goto - - thumb_func_start atk29_jumpifbyte -atk29_jumpifbyte: @ 804B008 - push {r4-r6,lr} - ldr r3, =0x02024214 - ldr r1, [r3] - ldrb r6, [r1, 0x1] - ldrb r2, [r1, 0x2] - ldrb r0, [r1, 0x3] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r1, 0x4] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r1, 0x5] - lsls r0, 24 - adds r5, r2, r0 - ldrb r4, [r1, 0x6] - ldrb r2, [r1, 0x7] - ldrb r0, [r1, 0x8] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r1, 0x9] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r1, 0xA] - lsls r0, 24 - adds r2, r0 - adds r1, 0xB - str r1, [r3] - cmp r6, 0x5 - bhi _0804B0A0 - lsls r0, r6, 2 - ldr r1, =_0804B054 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0804B054: - .4byte _0804B06C - .4byte _0804B074 - .4byte _0804B07C - .4byte _0804B084 - .4byte _0804B08C - .4byte _0804B096 -_0804B06C: - ldrb r0, [r5] - cmp r0, r4 - bne _0804B0A0 - b _0804B09E -_0804B074: - ldrb r0, [r5] - cmp r0, r4 - beq _0804B0A0 - b _0804B09E -_0804B07C: - ldrb r0, [r5] - cmp r0, r4 - bls _0804B0A0 - b _0804B09E -_0804B084: - ldrb r0, [r5] - cmp r0, r4 - bcs _0804B0A0 - b _0804B09E -_0804B08C: - ldrb r0, [r5] - ands r4, r0 - cmp r4, 0 - beq _0804B0A0 - b _0804B09E -_0804B096: - ldrb r0, [r5] - ands r4, r0 - cmp r4, 0 - bne _0804B0A0 -_0804B09E: - str r2, [r3] -_0804B0A0: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end atk29_jumpifbyte - - thumb_func_start sub_804B0A8 -sub_804B0A8: @ 804B0A8 - push {r4-r6,lr} - ldr r3, =0x02024214 - ldr r1, [r3] - ldrb r6, [r1, 0x1] - ldrb r2, [r1, 0x2] - ldrb r0, [r1, 0x3] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r1, 0x4] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r1, 0x5] - lsls r0, 24 - adds r5, r2, r0 - ldrb r4, [r1, 0x6] - ldrb r0, [r1, 0x7] - lsls r0, 8 - orrs r4, r0 - ldrb r2, [r1, 0x8] - ldrb r0, [r1, 0x9] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r1, 0xA] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r1, 0xB] - lsls r0, 24 - adds r2, r0 - adds r1, 0xC - str r1, [r3] - cmp r6, 0x5 - bhi _0804B148 - lsls r0, r6, 2 - ldr r1, =_0804B0FC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0804B0FC: - .4byte _0804B114 - .4byte _0804B11C - .4byte _0804B124 - .4byte _0804B12C - .4byte _0804B134 - .4byte _0804B13E -_0804B114: - ldrh r0, [r5] - cmp r0, r4 - bne _0804B148 - b _0804B146 -_0804B11C: - ldrh r0, [r5] - cmp r0, r4 - beq _0804B148 - b _0804B146 -_0804B124: - ldrh r0, [r5] - cmp r0, r4 - bls _0804B148 - b _0804B146 -_0804B12C: - ldrh r0, [r5] - cmp r0, r4 - bcs _0804B148 - b _0804B146 -_0804B134: - ldrh r0, [r5] - ands r4, r0 - cmp r4, 0 - beq _0804B148 - b _0804B146 -_0804B13E: - ldrh r0, [r5] - ands r4, r0 - cmp r4, 0 - bne _0804B148 -_0804B146: - str r2, [r3] -_0804B148: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_804B0A8 - - thumb_func_start sub_804B150 -sub_804B150: @ 804B150 - push {r4-r6,lr} - ldr r3, =0x02024214 - ldr r1, [r3] - ldrb r6, [r1, 0x1] - ldrb r2, [r1, 0x2] - ldrb r0, [r1, 0x3] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r1, 0x4] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r1, 0x5] - lsls r0, 24 - adds r5, r2, r0 - ldrb r4, [r1, 0x6] - ldrb r0, [r1, 0x7] - lsls r0, 8 - orrs r4, r0 - ldrb r0, [r1, 0x8] - lsls r0, 16 - orrs r4, r0 - ldrb r0, [r1, 0x9] - lsls r0, 24 - orrs r4, r0 - ldrb r2, [r1, 0xA] - ldrb r0, [r1, 0xB] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r1, 0xC] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r1, 0xD] - lsls r0, 24 - adds r2, r0 - adds r1, 0xE - str r1, [r3] - cmp r6, 0x5 - bhi _0804B1FC - lsls r0, r6, 2 - ldr r1, =_0804B1B0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0804B1B0: - .4byte _0804B1C8 - .4byte _0804B1D0 - .4byte _0804B1D8 - .4byte _0804B1E0 - .4byte _0804B1E8 - .4byte _0804B1F2 -_0804B1C8: - ldr r0, [r5] - cmp r0, r4 - bne _0804B1FC - b _0804B1FA -_0804B1D0: - ldr r0, [r5] - cmp r0, r4 - beq _0804B1FC - b _0804B1FA -_0804B1D8: - ldr r0, [r5] - cmp r0, r4 - bls _0804B1FC - b _0804B1FA -_0804B1E0: - ldr r0, [r5] - cmp r0, r4 - bcs _0804B1FC - b _0804B1FA -_0804B1E8: - ldr r0, [r5] - ands r0, r4 - cmp r0, 0 - beq _0804B1FC - b _0804B1FA -_0804B1F2: - ldr r0, [r5] - ands r0, r4 - cmp r0, 0 - bne _0804B1FC -_0804B1FA: - str r2, [r3] -_0804B1FC: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_804B150 - - thumb_func_start sub_804B204 -sub_804B204: @ 804B204 - push {r4-r7,lr} - ldr r2, =0x02024214 - ldr r3, [r2] - ldrb r1, [r3, 0x1] - ldrb r0, [r3, 0x2] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r3, 0x3] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r3, 0x4] - lsls r0, 24 - adds r5, r1, r0 - ldrb r1, [r3, 0x5] - ldrb r0, [r3, 0x6] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r3, 0x7] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r3, 0x8] - lsls r0, 24 - adds r4, r1, r0 - ldrb r6, [r3, 0x9] - ldrb r1, [r3, 0xA] - ldrb r0, [r3, 0xB] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r3, 0xC] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r3, 0xD] - lsls r0, 24 - adds r1, r0 - mov r12, r1 - movs r1, 0 - cmp r1, r6 - bcs _0804B27C - ldrb r0, [r5] - ldrb r7, [r4] - cmp r0, r7 - beq _0804B260 - adds r0, r3, 0 - b _0804B278 - .pool -_0804B260: - adds r5, 0x1 - adds r4, 0x1 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, r6 - bcs _0804B27C - ldrb r0, [r5] - ldrb r3, [r4] - cmp r0, r3 - beq _0804B260 - ldr r0, [r2] -_0804B278: - adds r0, 0xE - str r0, [r2] -_0804B27C: - cmp r1, r6 - bne _0804B284 - mov r7, r12 - str r7, [r2] -_0804B284: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_804B204 - - thumb_func_start sub_804B28C -sub_804B28C: @ 804B28C - push {r4-r7,lr} - movs r7, 0 - ldr r3, =0x02024214 - ldr r1, [r3] - ldrb r2, [r1, 0x1] - ldrb r0, [r1, 0x2] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r1, 0x3] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r1, 0x4] - lsls r0, 24 - adds r5, r2, r0 - ldrb r2, [r1, 0x5] - ldrb r0, [r1, 0x6] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r1, 0x7] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r1, 0x8] - lsls r0, 24 - adds r4, r2, r0 - ldrb r6, [r1, 0x9] - ldrb r2, [r1, 0xA] - ldrb r0, [r1, 0xB] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r1, 0xC] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r1, 0xD] - lsls r0, 24 - adds r2, r0 - mov r12, r2 - movs r1, 0 - cmp r7, r6 - bcs _0804B2F6 -_0804B2DA: - ldrb r0, [r5] - ldrb r2, [r4] - cmp r0, r2 - bne _0804B2E8 - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 -_0804B2E8: - adds r5, 0x1 - adds r4, 0x1 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, r6 - bcc _0804B2DA -_0804B2F6: - cmp r7, r6 - beq _0804B304 - mov r0, r12 - b _0804B308 - .pool -_0804B304: - ldr r0, [r3] - adds r0, 0xE -_0804B308: - str r0, [r3] - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_804B28C - - thumb_func_start sub_804B310 -sub_804B310: @ 804B310 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - adds r1, r0 - ldrb r0, [r2, 0x5] - strb r0, [r1] - ldr r0, [r3] - adds r0, 0x6 - str r0, [r3] - bx lr - .pool - thumb_func_end sub_804B310 - - thumb_func_start sub_804B338 -sub_804B338: @ 804B338 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - adds r1, r0 - ldrb r0, [r2, 0x5] - ldrb r2, [r1] - adds r0, r2 - strb r0, [r1] - ldr r0, [r3] - adds r0, 0x6 - str r0, [r3] - bx lr - .pool - thumb_func_end sub_804B338 - - thumb_func_start sub_804B364 -sub_804B364: @ 804B364 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - adds r1, r0 - ldrb r0, [r1] - ldrb r2, [r2, 0x5] - subs r0, r2 - strb r0, [r1] - ldr r0, [r3] - adds r0, 0x6 - str r0, [r3] - bx lr - .pool - thumb_func_end sub_804B364 - - thumb_func_start atk31_copyarray -atk31_copyarray: @ 804B390 - push {r4-r6,lr} - ldr r3, =0x02024214 - ldr r1, [r3] - ldrb r2, [r1, 0x1] - ldrb r0, [r1, 0x2] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r1, 0x3] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r1, 0x4] - lsls r0, 24 - adds r6, r2, r0 - ldrb r2, [r1, 0x5] - ldrb r0, [r1, 0x6] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r1, 0x7] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r1, 0x8] - lsls r0, 24 - adds r5, r2, r0 - ldrb r4, [r1, 0x9] - movs r2, 0 - cmp r2, r4 - bge _0804B3D4 -_0804B3C6: - adds r0, r6, r2 - adds r1, r5, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, r4 - blt _0804B3C6 -_0804B3D4: - ldr r0, [r3] - adds r0, 0xA - str r0, [r3] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atk31_copyarray - - thumb_func_start atk32_memcpy_with_offset -atk32_memcpy_with_offset: @ 804B3E4 - push {r4-r7,lr} - ldr r3, =0x02024214 - ldr r1, [r3] - ldrb r2, [r1, 0x1] - ldrb r0, [r1, 0x2] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r1, 0x3] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r1, 0x4] - lsls r0, 24 - adds r7, r2, r0 - ldrb r2, [r1, 0x5] - ldrb r0, [r1, 0x6] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r1, 0x7] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r1, 0x8] - lsls r0, 24 - adds r6, r2, r0 - ldrb r2, [r1, 0x9] - ldrb r0, [r1, 0xA] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r1, 0xB] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r1, 0xC] - lsls r0, 24 - adds r5, r2, r0 - ldrb r4, [r1, 0xD] - movs r2, 0 - cmp r2, r4 - bge _0804B440 -_0804B42E: - adds r0, r7, r2 - ldrb r1, [r5] - adds r1, r2, r1 - adds r1, r6, r1 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, r4 - blt _0804B42E -_0804B440: - ldr r0, [r3] - adds r0, 0xE - str r0, [r3] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk32_memcpy_with_offset - - thumb_func_start atk33_orbyte -atk33_orbyte: @ 804B450 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - adds r1, r0 - ldrb r0, [r1] - ldrb r2, [r2, 0x5] - orrs r0, r2 - strb r0, [r1] - ldr r0, [r3] - adds r0, 0x6 - str r0, [r3] - bx lr - .pool - thumb_func_end atk33_orbyte - - thumb_func_start atk34_orhalfword -atk34_orhalfword: @ 804B47C - push {r4,lr} - ldr r4, =0x02024214 - ldr r3, [r4] - ldrb r2, [r3, 0x1] - ldrb r0, [r3, 0x2] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r3, 0x3] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r3, 0x4] - lsls r0, 24 - adds r2, r0 - ldrb r1, [r3, 0x5] - ldrb r0, [r3, 0x6] - lsls r0, 8 - orrs r1, r0 - ldrh r0, [r2] - orrs r1, r0 - strh r1, [r2] - ldr r0, [r4] - adds r0, 0x7 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk34_orhalfword - - thumb_func_start atk35_orword -atk35_orword: @ 804B4B4 - push {r4,lr} - ldr r4, =0x02024214 - ldr r2, [r4] - ldrb r3, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - adds r3, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - adds r3, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - adds r3, r0 - ldrb r1, [r2, 0x5] - ldrb r0, [r2, 0x6] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x8] - lsls r0, 24 - adds r1, r0 - ldr r0, [r3] - orrs r0, r1 - str r0, [r3] - ldr r0, [r4] - adds r0, 0x9 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk35_orword - - thumb_func_start atk36_bicbyte -atk36_bicbyte: @ 804B4F8 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - adds r1, r0 - ldrb r2, [r2, 0x5] - ldrb r0, [r1] - bics r0, r2 - strb r0, [r1] - ldr r0, [r3] - adds r0, 0x6 - str r0, [r3] - bx lr - .pool - thumb_func_end atk36_bicbyte - - thumb_func_start atk37_bichalfword -atk37_bichalfword: @ 804B524 - push {r4,lr} - ldr r4, =0x02024214 - ldr r3, [r4] - ldrb r1, [r3, 0x1] - ldrb r0, [r3, 0x2] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r3, 0x3] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r3, 0x4] - lsls r0, 24 - adds r1, r0 - ldrb r2, [r3, 0x5] - ldrb r0, [r3, 0x6] - lsls r0, 8 - orrs r2, r0 - ldrh r0, [r1] - bics r0, r2 - strh r0, [r1] - ldr r0, [r4] - adds r0, 0x7 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk37_bichalfword - - thumb_func_start atk38_bicword -atk38_bicword: @ 804B55C - push {r4,lr} - ldr r4, =0x02024214 - ldr r2, [r4] - ldrb r3, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - adds r3, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - adds r3, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - adds r3, r0 - ldrb r1, [r2, 0x5] - ldrb r0, [r2, 0x6] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x8] - lsls r0, 24 - adds r1, r0 - ldr r0, [r3] - bics r0, r1 - str r0, [r3] - ldr r0, [r4] - adds r0, 0x9 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk38_bicword - - thumb_func_start atk39_pause -atk39_pause: @ 804B5A0 - push {r4,r5,lr} - ldr r0, =0x02024068 - ldr r4, [r0] - cmp r4, 0 - bne _0804B5CC - ldr r5, =0x02024214 - ldr r2, [r5] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldr r3, =0x0202432c - ldrh r0, [r3] - adds r0, 0x1 - strh r0, [r3] - lsls r0, 16 - lsrs r0, 16 - cmp r0, r1 - bcc _0804B5CC - strh r4, [r3] - adds r0, r2, 0x3 - str r0, [r5] -_0804B5CC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk39_pause - - thumb_func_start sub_804B5E0 -sub_804B5E0: @ 804B5E0 - push {lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0804B5F2 - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] -_0804B5F2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_804B5E0 - - thumb_func_start atk3B_8022C68 -atk3B_8022C68: @ 804B600 - push {lr} - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0 - bne _0804B620 - ldr r0, =0x02024064 - ldr r1, =0x0202420c - b _0804B624 - .pool -_0804B620: - ldr r0, =0x02024064 - ldr r1, =0x0202420b -_0804B624: - ldrb r1, [r1] - strb r1, [r0] - ldr r0, =0x020241f0 - ldrh r1, [r0] - movs r0, 0 - bl dp01_build_cmdbuf_x18_0_aa_health_bar_update - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end atk3B_8022C68 - - thumb_func_start atk3C_return -atk3C_return: @ 804B658 - push {lr} - bl b_movescr_stack_pop_cursor - pop {r0} - bx r0 - thumb_func_end atk3C_return - - thumb_func_start sub_804B664 -sub_804B664: @ 804B664 - push {lr} - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - beq _0804B67C - ldr r0, =0x0202420b - ldrb r0, [r0] - bl sub_81A5718 -_0804B67C: - ldr r0, =0x0202427c - movs r1, 0 - strb r1, [r0] - ldr r0, =0x02024064 - strb r1, [r0] - ldr r1, =0x02024083 - movs r0, 0xB - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_804B664 - - thumb_func_start atk3E_end2 -atk3E_end2: @ 804B6A4 - ldr r1, =0x02024064 - movs r0, 0 - strb r0, [r1] - ldr r1, =0x02024083 - movs r0, 0xB - strb r0, [r1] - bx lr - .pool - thumb_func_end atk3E_end2 - - thumb_func_start atk3F_end3 -atk3F_end3: @ 804B6BC - push {lr} - bl b_movescr_stack_pop_cursor - ldr r3, =0x020244a8 - ldr r0, [r3] - ldr r0, [r0, 0xC] - adds r1, r0, 0 - adds r1, 0x20 - ldrb r0, [r1] - cmp r0, 0 - beq _0804B6D6 - subs r0, 0x1 - strb r0, [r1] -_0804B6D6: - ldr r2, =0x03005d04 - ldr r0, [r3] - ldr r1, [r0, 0xC] - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - lsls r0, 2 - adds r1, r0 - ldr r0, [r1] - str r0, [r2] - pop {r0} - bx r0 - .pool - thumb_func_end atk3F_end3 - - thumb_func_start atk41_call -atk41_call: @ 804B6F8 - push {r4,lr} - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x5 - bl b_movescr_stack_push - ldr r2, [r4] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk41_call - - thumb_func_start atk42_jumpiftype2 -atk42_jumpiftype2: @ 804B728 - push {r4,lr} - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - lsls r0, 24 - lsrs r0, 24 - ldr r3, [r4] - ldr r2, =0x02024084 - movs r1, 0x58 - muls r0, r1 - adds r0, r2 - adds r1, r0, 0 - adds r1, 0x21 - ldrb r2, [r3, 0x2] - ldrb r1, [r1] - cmp r2, r1 - beq _0804B756 - adds r0, 0x22 - ldrb r0, [r0] - cmp r2, r0 - bne _0804B778 -_0804B756: - ldrb r1, [r3, 0x3] - ldrb r0, [r3, 0x4] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x5] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x6] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _0804B77C - .pool -_0804B778: - adds r0, r3, 0x7 - str r0, [r4] -_0804B77C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end atk42_jumpiftype2 - - thumb_func_start sub_804B784 -sub_804B784: @ 804B784 - push {r4,lr} - sub sp, 0x4 - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r2, [r0, 0x1] - movs r0, 0 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _0804B7C0 - ldr r2, [r4] - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _0804B7C6 - .pool -_0804B7C0: - ldr r0, [r4] - adds r0, 0x6 - str r0, [r4] -_0804B7C6: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_804B784 - - thumb_func_start sub_804B7D0 -sub_804B7D0: @ 804B7D0 - ldr r0, =0x0202420b - ldrb r0, [r0] - ldr r1, =0x0202449c - ldr r1, [r1] - adds r0, r1 - adds r0, 0x54 - movs r1, 0x1 - strb r1, [r0] - bx lr - .pool - thumb_func_end sub_804B7D0 - - thumb_func_start atk46_cmd46 -atk46_cmd46: @ 804B7EC - push {r4-r6,lr} - ldr r5, =0x02024214 - ldr r0, [r5] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r6, =0x02024064 - strb r0, [r6] - ldr r2, [r5] - ldrb r1, [r2, 0x3] - ldrb r0, [r2, 0x4] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 24 - adds r3, r1, r0 - ldrb r4, [r2, 0x2] - adds r0, r4, 0 - cmp r0, 0x1 - beq _0804B822 - cmp r0, 0x11 - beq _0804B822 - cmp r0, 0x2 - bne _0804B848 -_0804B822: - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r1, [r0, 0x2] - ldrh r2, [r3] - movs r0, 0 - bl dp01_build_cmdbuf_x34_a_bb_aka_battle_anim - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r4] - adds r0, 0x7 - str r0, [r4] - b _0804B8AA - .pool -_0804B848: - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0804B868 - adds r0, r2, 0x7 - bl b_movescr_stack_push - ldr r0, =gUnknown_082DABB9 - b _0804B8A8 - .pool -_0804B868: - adds r0, r4, 0 - subs r0, 0xA - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bls _0804B894 - ldr r1, =0x020242ac - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x000400c0 - ands r0, r1 - cmp r0, 0 - beq _0804B894 - adds r0, r2, 0x7 - b _0804B8A8 - .pool -_0804B894: - ldrb r1, [r2, 0x2] - ldrh r2, [r3] - movs r0, 0 - bl dp01_build_cmdbuf_x34_a_bb_aka_battle_anim - ldrb r0, [r6] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r5] - adds r0, 0x7 -_0804B8A8: - str r0, [r5] -_0804B8AA: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end atk46_cmd46 - - thumb_func_start sub_804B8B0 -sub_804B8B0: @ 804B8B0 - push {r4-r7,lr} - ldr r6, =0x02024214 - ldr r0, [r6] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r7, =0x02024064 - strb r0, [r7] - ldr r2, [r6] - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - adds r3, r1, r0 - ldrb r1, [r2, 0x6] - ldrb r0, [r2, 0x7] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x8] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x9] - lsls r0, 24 - adds r4, r1, r0 - ldrb r5, [r3] - adds r0, r5, 0 - cmp r0, 0x1 - beq _0804B8FA - cmp r0, 0x11 - beq _0804B8FA - cmp r0, 0x2 - bne _0804B920 -_0804B8FA: - ldrb r1, [r3] - ldrh r2, [r4] - movs r0, 0 - bl dp01_build_cmdbuf_x34_a_bb_aka_battle_anim - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0xA - str r0, [r1] - b _0804B976 - .pool -_0804B920: - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0804B934 - adds r0, r2, 0 - b _0804B972 - .pool -_0804B934: - adds r0, r5, 0 - subs r0, 0xA - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bls _0804B960 - ldr r1, =0x020242ac - ldrb r0, [r7] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x000400c0 - ands r0, r1 - cmp r0, 0 - beq _0804B960 - adds r0, r2, 0 - b _0804B972 - .pool -_0804B960: - ldrb r1, [r3] - ldrh r2, [r4] - movs r0, 0 - bl dp01_build_cmdbuf_x34_a_bb_aka_battle_anim - ldrb r0, [r7] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r6] -_0804B972: - adds r0, 0xA - str r0, [r6] -_0804B976: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_804B8B0 - - thumb_func_start sub_804B97C -sub_804B97C: @ 804B97C - push {r4,lr} - movs r3, 0 - ldr r1, =0x02024474 - ldrb r0, [r1, 0x1A] - movs r2, 0xF0 - ands r2, r0 - adds r4, r1, 0 - cmp r2, 0x20 - beq _0804B9AA - cmp r2, 0x20 - bgt _0804B99C - cmp r2, 0x10 - beq _0804B9A6 - b _0804B9B4 - .pool -_0804B99C: - cmp r2, 0x90 - beq _0804B9AE - cmp r2, 0xA0 - beq _0804B9B2 - b _0804B9B4 -_0804B9A6: - movs r3, 0xF - b _0804B9B4 -_0804B9AA: - movs r3, 0x27 - b _0804B9B4 -_0804B9AE: - movs r3, 0x16 - b _0804B9B4 -_0804B9B2: - movs r3, 0x2E -_0804B9B4: - ldrb r1, [r4, 0x1A] - movs r0, 0xF - ands r0, r1 - adds r0, r3, r0 - subs r0, 0x1 - movs r1, 0 - strb r0, [r4, 0x10] - strb r1, [r4, 0x11] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_804B97C - - thumb_func_start atk48_playstatchangeanimation -atk48_playstatchangeanimation: @ 804B9D8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r7, 0 - movs r0, 0 - mov r8, r0 - movs r3, 0 - ldr r5, =0x02024214 - ldr r0, [r5] - ldrb r0, [r0, 0x1] - str r3, [sp] - bl get_battle_side_of_something - ldr r2, =0x02024064 - strb r0, [r2] - ldr r0, [r5] - ldrb r4, [r0, 0x2] - ldrb r1, [r0, 0x3] - movs r0, 0x1 - ands r0, r1 - ldr r3, [sp] - cmp r0, 0 - beq _0804BAEC - movs r0, 0x2 - ands r0, r1 - movs r1, 0x15 - cmp r0, 0 - beq _0804BA18 - movs r1, 0x2D -_0804BA18: - cmp r4, 0 - beq _0804BAC0 - movs r0, 0x1 - mov r10, r0 - ldr r0, =0x0202409c - mov r9, r0 - lsls r5, r1, 16 -_0804BA26: - adds r0, r4, 0 - mov r1, r10 - ands r0, r1 - cmp r0, 0 - beq _0804BAB2 - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r1, [r0, 0x3] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0804BA58 - ldr r0, =0x02024064 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r7, r0 - b _0804BAA0 - .pool -_0804BA58: - ldr r6, =0x02024064 - ldrb r0, [r6] - str r3, [sp] - bl battle_get_per_side_status - mov r1, r10 - ands r1, r0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02024294 - adds r0, r1 - ldrb r0, [r0, 0x4] - ldr r3, [sp] - cmp r0, 0 - bne _0804BAB2 - ldr r0, =0x02024084 - ldrb r2, [r6] - movs r1, 0x58 - muls r2, r1 - adds r0, r2, r0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x1D - beq _0804BAB2 - cmp r0, 0x49 - beq _0804BAB2 - cmp r0, 0x33 - bne _0804BA96 - cmp r7, 0x6 - beq _0804BAB2 -_0804BA96: - cmp r0, 0x34 - bne _0804BA9E - cmp r7, 0x1 - beq _0804BAB2 -_0804BA9E: - adds r0, r7, r2 -_0804BAA0: - add r0, r9 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - ble _0804BAB2 - lsrs r0, r5, 16 - mov r8, r0 - adds r3, 0x1 -_0804BAB2: - lsrs r4, 1 - movs r1, 0x80 - lsls r1, 9 - adds r5, r1 - adds r7, 0x1 - cmp r4, 0 - bne _0804BA26 -_0804BAC0: - ldr r0, =0x02024214 - mov r9, r0 - cmp r3, 0x1 - ble _0804BB4E - ldr r0, [r0] - ldrb r1, [r0, 0x3] - movs r0, 0x2 - ands r0, r1 - movs r1, 0x39 - mov r8, r1 - cmp r0, 0 - beq _0804BB4E - movs r0, 0x3A - b _0804BB4C - .pool -_0804BAEC: - movs r0, 0x2 - ands r0, r1 - movs r1, 0xE - cmp r0, 0 - beq _0804BAF8 - movs r1, 0x26 -_0804BAF8: - mov r9, r5 - cmp r4, 0 - beq _0804BB34 - ldr r6, =0x0202409c - adds r5, r2, 0 - lsls r2, r1, 16 -_0804BB04: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _0804BB26 - ldrb r1, [r5] - movs r0, 0x58 - muls r0, r1 - adds r0, r7, r0 - adds r0, r6 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0xB - bgt _0804BB26 - lsrs r1, r2, 16 - mov r8, r1 - adds r3, 0x1 -_0804BB26: - lsrs r4, 1 - movs r0, 0x80 - lsls r0, 9 - adds r2, r0 - adds r7, 0x1 - cmp r4, 0 - bne _0804BB04 -_0804BB34: - cmp r3, 0x1 - ble _0804BB4E - mov r1, r9 - ldr r0, [r1] - ldrb r1, [r0, 0x3] - movs r0, 0x2 - ands r0, r1 - movs r1, 0x37 - mov r8, r1 - cmp r0, 0 - beq _0804BB4E - movs r0, 0x38 -_0804BB4C: - mov r8, r0 -_0804BB4E: - mov r1, r9 - ldr r2, [r1] - ldrb r1, [r2, 0x3] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0804BB6C - cmp r3, 0x1 - bgt _0804BB6C - adds r0, r2, 0x4 - mov r1, r9 - b _0804BBBA - .pool -_0804BB6C: - cmp r3, 0 - beq _0804BBB4 - ldr r4, =0x02024474 - ldrb r0, [r4, 0x1B] - cmp r0, 0 - bne _0804BBB4 - movs r0, 0 - movs r1, 0x1 - mov r2, r8 - str r3, [sp] - bl dp01_build_cmdbuf_x34_a_bb_aka_battle_anim - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r1, [r0, 0x3] - movs r0, 0x4 - ands r0, r1 - ldr r3, [sp] - cmp r0, 0 - beq _0804BBA4 - cmp r3, 0x1 - ble _0804BBA4 - movs r0, 0x1 - strb r0, [r4, 0x1B] -_0804BBA4: - ldr r1, =0x02024214 - b _0804BBB6 - .pool -_0804BBB4: - mov r1, r9 -_0804BBB6: - ldr r0, [r1] - adds r0, 0x4 -_0804BBBA: - str r0, [r1] - 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 atk48_playstatchangeanimation - - thumb_func_start sub_804BBCC -sub_804BBCC: @ 804BBCC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - movs r0, 0 - mov r10, r0 - ldr r2, =0x020241ec - ldrh r1, [r2] - ldr r0, =0x0000ffff - movs r3, 0 - str r3, [sp, 0x18] - cmp r1, r0 - beq _0804BBEE - ldrh r2, [r2] - str r2, [sp, 0x18] -_0804BBEE: - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r4, [r0, 0x1] - str r4, [sp, 0x10] - ldrb r0, [r0, 0x2] - str r0, [sp, 0x14] - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2E] - cmp r0, 0xAF - bne _0804BC34 - ldr r1, =0x02024404 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x7] - b _0804BC3E - .pool -_0804BC34: - ldrh r0, [r1, 0x2E] - bl itemid_get_x12 - lsls r0, 24 - lsrs r0, 24 -_0804BC3E: - str r0, [sp, 0x8] - ldr r1, =0x0202449c - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, 0xC8 - ldr r1, [r1] - adds r0, r1, r0 - str r0, [sp, 0xC] - ldrb r0, [r1, 0x13] - cmp r0, 0 - beq _0804BCF0 - movs r5, 0x3F - ands r5, r0 - str r5, [sp, 0x4] - b _0804BD02 - .pool -_0804BC68: - ldr r4, =0x02024064 - strb r2, [r4] - movs r0, 0 - movs r1, 0x1 - bl dp01_build_cmdbuf_x33_a_33_33 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - b _0804C15A - .pool -_0804BC80: - ldr r4, =0x02024064 - strb r2, [r4] - movs r0, 0 - movs r1, 0 - bl dp01_build_cmdbuf_x33_a_33_33 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldrb r1, [r6] - lsls r1, 2 - adds r1, r5 - ldr r0, [r1] - ldr r2, =0xfffbff3f - ands r0, r2 - str r0, [r1] - b _0804C15A - .pool -_0804BCAC: - strb r2, [r7] - ldr r0, [r5] - orrs r0, r6 - str r0, [r5] - ldr r0, =0x02024474 - strb r4, [r0, 0x14] - bl sub_804AF30 - ldr r2, =gUnknown_082D86A8 - mov r0, r8 - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - add r0, r9 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - bl b_movescr_stack_push - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB87D - bl _0804C5B8 - .pool -_0804BCF0: - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x2] - str r0, [sp, 0x4] -_0804BD02: - ldr r1, =0x02024474 - mov r12, r1 - b _0804BD1E - .pool -_0804BD14: - mov r2, r10 - cmp r2, 0 - beq _0804BD1E - bl _0804C5A4 -_0804BD1E: - mov r3, r12 - ldrb r0, [r3, 0x14] - cmp r0, 0x11 - bls _0804BD2A - bl _0804C570 -_0804BD2A: - lsls r0, 2 - ldr r1, =_0804BD38 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0804BD38: - .4byte _0804BD80 - .4byte _0804BE5C - .4byte _0804BF18 - .4byte _0804BF3C - .4byte _0804BF54 - .4byte _0804BF7C - .4byte _0804BFA0 - .4byte _0804C048 - .4byte _0804C0BE - .4byte _0804C0F4 - .4byte _0804C194 - .4byte _0804C088 - .4byte _0804C0A8 - .4byte _0804C1D8 - .4byte _0804C21C - .4byte _0804C3FC - .4byte _0804C4E4 - .4byte _0804C570 -_0804BD80: - ldr r6, =0x02024084 - ldr r5, =0x0202420c - ldrb r3, [r5] - movs r7, 0x58 - adds r2, r3, 0 - muls r2, r7 - adds r0, r6, 0 - adds r0, 0x50 - adds r0, r2, r0 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 16 - ands r0, r1 - cmp r0, 0 - bne _0804BDA0 - b _0804C184 -_0804BDA0: - adds r0, r2, r6 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _0804BDAA - b _0804C184 -_0804BDAA: - ldr r0, =0x0202420b - ldrb r1, [r0] - cmp r1, r3 - bne _0804BDB4 - b _0804C184 -_0804BDB4: - adds r0, r1, 0 - bl battle_side_get_owner - adds r4, r0, 0 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - bne _0804BDCC - b _0804C184 -_0804BDCC: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _0804BDDA - b _0804C184 -_0804BDDA: - ldr r2, =0x0202437c - ldrb r3, [r5] - lsls r0, r3, 2 - adds r0, r3 - lsls r1, r0, 2 - adds r0, r2, 0 - adds r0, 0x8 - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _0804BDFE - adds r0, r2, 0 - adds r0, 0xC - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _0804BDFE - b _0804C184 -_0804BDFE: - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0 - bne _0804BE14 - b _0804C184 -_0804BE14: - adds r0, r3, 0 - muls r0, r7 - adds r1, r0, r6 - ldrb r2, [r1, 0x19] - movs r0, 0x19 - ldrsb r0, [r1, r0] - cmp r0, 0xB - ble _0804BE26 - b _0804C184 -_0804BE26: - adds r0, r2, 0x1 - strb r0, [r1, 0x19] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAE0D - str r0, [r1] - b _0804C0B8 - .pool -_0804BE5C: - ldr r4, =0x02024084 - ldr r6, =0x0202420c - ldrb r2, [r6] - movs r5, 0x58 - mov r12, r5 - mov r1, r12 - muls r1, r2 - adds r7, r4, 0 - adds r7, 0x4C - adds r5, r1, r7 - ldr r3, [r5] - movs r0, 0x20 - ands r0, r3 - cmp r0, 0 - bne _0804BE7C - b _0804C184 -_0804BE7C: - adds r0, r1, r4 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _0804BE86 - b _0804C184 -_0804BE86: - ldr r0, =0x0202420b - ldrb r0, [r0] - cmp r0, r2 - bne _0804BE90 - b _0804C184 -_0804BE90: - ldr r0, =0x0202437c - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 2 - adds r0, 0xC - adds r1, r0 - ldr r0, [r1] - cmp r0, 0 - bne _0804BEA4 - b _0804C184 -_0804BEA4: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _0804BEB2 - b _0804C184 -_0804BEB2: - ldr r0, [sp, 0x4] - cmp r0, 0xA - beq _0804BEBA - b _0804C184 -_0804BEBA: - movs r0, 0x21 - negs r0, r0 - ands r3, r0 - str r3, [r5] - ldr r4, =0x02024064 - ldrb r0, [r6] - strb r0, [r4] - ldrb r0, [r6] - mov r1, r12 - muls r1, r0 - adds r0, r1, 0 - adds r0, r7 - str r0, [sp] - movs r0, 0 - movs r1, 0x28 - movs r2, 0 - movs r3, 0x4 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB282 - str r0, [r1] - movs r2, 0x1 - mov r10, r2 - b _0804C184 - .pool -_0804BF18: - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0 - str r0, [sp] - movs r0, 0x7 - movs r2, 0 - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - bne _0804BF32 - b _0804C184 -_0804BF32: - movs r3, 0x1 - mov r10, r3 - b _0804C184 - .pool -_0804BF3C: - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0 - str r0, [sp] - movs r0, 0x4 - movs r2, 0 - movs r3, 0 - bl ability_something - b _0804C0B2 - .pool -_0804BF54: - movs r0, 0 - str r0, [sp] - movs r0, 0x5 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - bne _0804BF6C - b _0804C184 -_0804BF6C: - movs r5, 0x1 - mov r10, r5 - ldr r0, =0x02024474 - mov r12, r0 - b _0804C570 - .pool -_0804BF7C: - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0 - str r0, [sp] - movs r0, 0x8 - movs r2, 0 - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - bne _0804BF96 - b _0804C184 -_0804BF96: - movs r1, 0x1 - mov r10, r1 - b _0804C184 - .pool -_0804BFA0: - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 18 - ands r0, r1 - cmp r0, 0 - beq _0804BFE4 - ldr r2, [sp, 0x8] - cmp r2, 0x1D - bne _0804BFE4 - ldr r0, =0x020241ec - ldrh r2, [r0] - adds r3, r0, 0 - cmp r2, 0xA5 - beq _0804BFE4 - ldr r4, [sp, 0xC] - ldrh r1, [r4] - cmp r1, 0 - beq _0804BFCC - ldr r0, =0x0000ffff - cmp r1, r0 - bne _0804BFE4 -_0804BFCC: - cmp r2, 0xE2 - bne _0804BFDE - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _0804BFDE - b _0804C4B6 -_0804BFDE: - ldrh r0, [r3] - ldr r1, [sp, 0xC] - strh r0, [r1] -_0804BFE4: - movs r4, 0 - ldr r2, =0x02024084 - ldr r3, =0x0202420b - ldrb r1, [r3] - movs r0, 0x58 - muls r0, r1 - adds r2, 0xC - adds r0, r2 - ldrh r0, [r0] - ldr r5, [sp, 0xC] - ldrh r1, [r5] - mov r9, r3 - cmp r0, r1 - beq _0804C01C - mov r6, r9 - movs r3, 0x58 - adds r5, r1, 0 -_0804C006: - adds r4, 0x1 - cmp r4, 0x3 - bgt _0804C01C - lsls r0, r4, 1 - ldrb r1, [r6] - muls r1, r3 - adds r0, r1 - adds r0, r2 - ldrh r0, [r0] - cmp r0, r5 - bne _0804C006 -_0804C01C: - cmp r4, 0x4 - bne _0804C026 - movs r0, 0 - ldr r1, [sp, 0xC] - strh r0, [r1] -_0804C026: - mov r2, r12 - ldrb r0, [r2, 0x14] - adds r0, 0x1 - strb r0, [r2, 0x14] - b _0804C570 - .pool -_0804C048: - movs r4, 0 - ldr r0, =0x0202406c - ldrb r3, [r0] - cmp r4, r3 - blt _0804C054 - b _0804C202 -_0804C054: - ldr r7, =0x0202449c - movs r6, 0 - movs r3, 0xD0 - adds r5, r0, 0 - ldr r2, =0x02024084 -_0804C05E: - ldr r0, [r7] - adds r0, r3 - ldrh r1, [r0] - cmp r1, 0 - beq _0804C06C - strh r1, [r2, 0x2E] - strh r6, [r0] -_0804C06C: - adds r3, 0x2 - adds r2, 0x58 - adds r4, 0x1 - ldrb r0, [r5] - cmp r4, r0 - blt _0804C05E - b _0804C202 - .pool -_0804C088: - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl berry_effects_maybe - lsls r0, 24 - cmp r0, 0 - beq _0804C184 - movs r2, 0x1 - mov r10, r2 - ldr r3, =0x02024474 - mov r12, r3 - b _0804C570 - .pool -_0804C0A8: - movs r0, 0x4 - movs r1, 0 - movs r2, 0 - bl berry_effects_maybe -_0804C0B2: - lsls r0, 24 - cmp r0, 0 - beq _0804C184 -_0804C0B8: - movs r4, 0x1 - mov r10, r4 - b _0804C184 -_0804C0BE: - ldr r1, =0x020242ac - ldr r0, =0x0202420b - ldrb r2, [r0] - lsls r0, r2, 2 - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x000400c0 - ands r0, r1 - cmp r0, 0 - bne _0804C0D4 - b _0804C4B6 -_0804C0D4: - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0804C0E2 - b _0804BC68 -_0804C0E2: - b _0804C4B6 - .pool -_0804C0F4: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - bne _0804C120 - ldr r1, =0x020242ac - ldr r0, =0x0202420b - ldrb r2, [r0] - lsls r0, r2, 2 - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x000400c0 - ands r0, r1 - cmp r0, 0 - beq _0804C120 - adds r0, r2, 0 - bl sub_803F90C - lsls r0, 24 - cmp r0, 0 - beq _0804C184 -_0804C120: - ldr r4, =0x02024064 - ldr r5, =0x0202420b - ldrb r0, [r5] - strb r0, [r4] - movs r0, 0 - movs r1, 0 - bl dp01_build_cmdbuf_x33_a_33_33 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, =0x020242ac - ldrb r2, [r5] - lsls r2, 2 - adds r2, r0 - ldr r0, [r2] - ldr r1, =0xfffbff3f - ands r0, r1 - str r0, [r2] - ldr r2, =0x0202437c - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_0804C15A: - ldr r1, =0x02024474 - ldrb r0, [r1, 0x14] - adds r0, 0x1 - strb r0, [r1, 0x14] - b _0804C5BA - .pool -_0804C184: - ldr r1, =0x02024474 - ldrb r0, [r1, 0x14] - adds r0, 0x1 - strb r0, [r1, 0x14] - mov r12, r1 - b _0804C570 - .pool -_0804C194: - ldr r0, =0x0202437c - ldr r6, =0x0202420c - ldrb r2, [r6] - lsls r3, r2, 2 - adds r1, r3, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 29 - cmp r0, 0 - blt _0804C202 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r2, r0 - bcs _0804C202 - ldr r5, =0x020242ac - adds r0, r3, r5 - ldr r0, [r0] - ldr r1, =0x000400c0 - ands r0, r1 - cmp r0, 0 - bne _0804C1C2 - b _0804BC80 -_0804C1C2: - b _0804C202 - .pool -_0804C1D8: - movs r4, 0 - ldr r0, =0x0202406c - ldrb r2, [r0] - cmp r4, r2 - bge _0804C202 - ldr r2, =0x020242bc - ldr r5, =0xfeffffff - adds r3, r0, 0 - ldr r1, =0x020240d4 -_0804C1EA: - ldrb r0, [r2, 0xA] - cmp r0, 0 - bne _0804C1F6 - ldr r0, [r1] - ands r0, r5 - str r0, [r1] -_0804C1F6: - adds r2, 0x1C - adds r1, 0x58 - adds r4, 0x1 - ldrb r0, [r3] - cmp r4, r0 - blt _0804C1EA -_0804C202: - mov r1, r12 - ldrb r0, [r1, 0x14] - adds r0, 0x1 - strb r0, [r1, 0x14] - b _0804C570 - .pool -_0804C21C: - ldr r1, =0x02024280 - ldr r3, [r1] - movs r0, 0x80 - lsls r0, 5 - ands r0, r3 - ldr r2, =0x0202420b - mov r9, r2 - adds r5, r1, 0 - cmp r0, 0 - beq _0804C246 - ldr r0, =0x02024064 - ldrb r2, [r2] - strb r2, [r0] - ldr r1, =0x0202420c - ldrb r0, [r1] - mov r4, r9 - strb r0, [r4] - strb r2, [r1] - ldr r0, =0xffffefff - ands r3, r0 - str r3, [r5] -_0804C246: - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 3 - ands r0, r1 - cmp r0, 0 - beq _0804C262 - ldr r0, =0x02024240 - mov r2, r9 - ldrb r1, [r2] - lsls r1, 1 - adds r1, r0 - ldr r0, =0x020241ec - ldrh r0, [r0] - strh r0, [r1] -_0804C262: - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - mov r3, r9 - ldrb r4, [r3] - lsls r0, r4, 2 - adds r0, r2 - ldr r3, [r0] - ands r1, r3 - adds r6, r2, 0 - cmp r1, 0 - beq _0804C27C - b _0804C3E8 -_0804C27C: - ldr r0, =0x0202449c - ldr r1, [r0] - adds r1, 0x91 - ldrb r1, [r1] - ands r1, r3 - adds r7, r0, 0 - cmp r1, 0 - beq _0804C28E - b _0804C3E8 -_0804C28E: - ldr r0, =gBattleMoves - ldr r2, [sp, 0x18] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r1, [r1] - mov r8, r0 - cmp r1, 0x7F - bne _0804C2A4 - b _0804C3E8 -_0804C2A4: - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 18 - ands r0, r1 - cmp r0, 0 - beq _0804C308 - ldr r0, =0x02024248 - lsls r1, r4, 1 - adds r1, r0 - ldr r0, =0x020241ec - ldrh r0, [r0] - strh r0, [r1] - ldr r0, =0x02024260 - mov r3, r9 - ldrb r1, [r3] - lsls r1, 1 - adds r1, r0 - ldr r0, =0x020241ea - ldrh r0, [r0] - strh r0, [r1] - b _0804C322 - .pool -_0804C308: - ldr r1, =0x02024248 - lsls r0, r4, 1 - adds r0, r1 - ldr r1, =0x0000ffff - strh r1, [r0] - ldr r1, =0x02024260 - mov r4, r9 - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - movs r1, 0x1 - negs r1, r1 - strh r1, [r0] -_0804C322: - ldr r2, =0x0202420c - ldrb r3, [r2] - lsls r0, r3, 2 - adds r0, r6 - ldr r0, [r0] - lsls r0, 28 - ldr r1, [r5] - ands r1, r0 - cmp r1, 0 - bne _0804C340 - ldr r0, =0x02024270 - adds r0, r3, r0 - mov r3, r9 - ldrb r1, [r3] - strb r1, [r0] -_0804C340: - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 18 - ands r0, r1 - cmp r0, 0 - beq _0804C3DC - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - bne _0804C3DC - ldr r0, =0x020241ec - ldrh r3, [r0] - ldr r0, =0x0000ffff - cmp r3, r0 - bne _0804C390 - ldr r1, =0x02024250 - ldrb r0, [r2] - lsls r0, 1 - adds r0, r1 - strh r3, [r0] - b _0804C3E8 - .pool -_0804C390: - ldr r0, =0x02024250 - ldrb r1, [r2] - lsls r1, 1 - adds r1, r0 - ldr r4, =0x020241ea - ldrh r0, [r4] - strh r0, [r1] - ldr r0, [r7] - ldrb r3, [r0, 0x13] - cmp r3, 0 - beq _0804C3C0 - ldr r0, =0x02024258 - ldrb r1, [r2] - lsls r1, 1 - adds r1, r0 - movs r0, 0x3F - ands r0, r3 - b _0804C3E6 - .pool -_0804C3C0: - ldr r0, =0x02024258 - ldrb r2, [r2] - lsls r2, 1 - adds r2, r0 - ldrh r1, [r4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - add r0, r8 - ldrb r0, [r0, 0x2] - strh r0, [r2] - b _0804C3E8 - .pool -_0804C3DC: - ldr r0, =0x02024250 - ldrb r1, [r2] - lsls r1, 1 - adds r1, r0 - ldr r0, =0x0000ffff -_0804C3E6: - strh r0, [r1] -_0804C3E8: - mov r4, r12 - ldrb r0, [r4, 0x14] - adds r0, 0x1 - strb r0, [r4, 0x14] - b _0804C570 - .pool -_0804C3FC: - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r7, =gUnknown_0832A328 - ldr r2, =0x0202420b - ldrb r3, [r2] - lsls r0, r3, 2 - adds r0, r7 - ldr r4, [r0] - ands r1, r4 - mov r9, r2 - cmp r1, 0 - bne _0804C4B6 - ldr r6, =0x0202449c - ldr r5, [r6] - adds r0, r5, 0 - adds r0, 0x91 - ldrb r0, [r0] - ands r0, r4 - cmp r0, 0 - bne _0804C4B6 - ldr r1, =gBattleMoves - ldr r2, [sp, 0x18] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x8] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0804C4B6 - ldr r0, =0x02024280 - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 18 - ands r0, r1 - cmp r0, 0 - beq _0804C4B6 - ldr r4, =0x0202420c - ldrb r0, [r4] - cmp r3, r0 - beq _0804C4B6 - ldrb r2, [r4] - lsls r0, r2, 2 - adds r0, r7 - ldr r0, [r0] - lsls r0, 28 - ands r1, r0 - cmp r1, 0 - bne _0804C4B6 - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - bne _0804C4B6 - lsls r1, r2, 1 - adds r1, r5 - adds r1, 0x98 - ldr r3, =0x020241ec - ldrh r0, [r3] - strb r0, [r1] - ldrb r1, [r4] - ldr r0, [r6] - lsls r1, 1 - adds r1, r0 - adds r1, 0x99 - ldrh r0, [r3] - lsrs r0, 8 - strb r0, [r1] - ldrb r0, [r4] - mov r2, r9 - ldrb r1, [r2] - ldr r2, [r6] - lsls r0, 3 - lsls r1, 1 - adds r0, r1 - adds r0, r2 - adds r0, 0xE0 - ldrh r1, [r3] - strb r1, [r0] - ldrb r1, [r4] - mov r4, r9 - ldrb r0, [r4] - ldr r2, [r6] - lsls r1, 3 - lsls r0, 1 - adds r1, r0 - adds r1, r2 - adds r1, 0xE1 - ldrh r0, [r3] - lsrs r0, 8 - strb r0, [r1] -_0804C4B6: - mov r5, r12 - ldrb r0, [r5, 0x14] - adds r0, 0x1 - strb r0, [r5, 0x14] - b _0804C570 - .pool -_0804C4E4: - ldr r5, =0x02024280 - ldr r2, [r5] - movs r0, 0x80 - lsls r0, 12 - ands r0, r2 - cmp r0, 0 - bne _0804C568 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0804C568 - ldr r1, =0x0202433c - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x1] - lsls r0, 29 - cmp r0, 0 - blt _0804C568 - ldr r0, =gBattleMoves - mov r9, r0 - ldr r1, =0x020241ea - mov r8, r1 - ldrh r0, [r1] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - add r1, r9 - ldrb r0, [r1, 0x6] - cmp r0, 0x8 - bne _0804C568 - movs r6, 0x80 - lsls r6, 2 - adds r4, r6, 0 - ands r4, r2 - cmp r4, 0 - bne _0804C568 - ldr r7, =0x0202420c - ldrb r0, [r7] - bl battle_get_per_side_status - movs r1, 0x2 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _0804C55E - bl _0804BCAC -_0804C55E: - ldr r0, [r5] - orrs r0, r6 - str r0, [r5] - ldr r2, =0x02024474 - mov r12, r2 -_0804C568: - mov r3, r12 - ldrb r0, [r3, 0x14] - adds r0, 0x1 - strb r0, [r3, 0x14] -_0804C570: - ldr r4, [sp, 0x10] - cmp r4, 0x1 - bne _0804C582 - mov r5, r10 - cmp r5, 0 - bne _0804C582 - movs r0, 0x11 - mov r1, r12 - strb r0, [r1, 0x14] -_0804C582: - ldr r2, [sp, 0x10] - cmp r2, 0x2 - bne _0804C598 - ldr r4, [sp, 0x14] - mov r3, r12 - ldrb r3, [r3, 0x14] - cmp r4, r3 - bne _0804C598 - movs r0, 0x11 - mov r4, r12 - strb r0, [r4, 0x14] -_0804C598: - mov r5, r12 - ldrb r0, [r5, 0x14] - cmp r0, 0x11 - beq _0804C5A4 - bl _0804BD14 -_0804C5A4: - mov r1, r12 - ldrb r0, [r1, 0x14] - cmp r0, 0x11 - bne _0804C5BA - mov r2, r10 - cmp r2, 0 - bne _0804C5BA - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x3 -_0804C5B8: - str r0, [r1] -_0804C5BA: - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_804BBCC - - thumb_func_start atk4A_damagecalc2 -atk4A_damagecalc2: @ 804C5F4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r4, 0 - movs r5, 0 - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x2] - mov r8, r0 - ldr r2, =0x02024084 - ldr r3, =0x0202420c - ldrb r1, [r3] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x20 - ldrb r0, [r0] - mov r12, r2 - adds r7, r3, 0 - cmp r0, 0x1A - bne _0804C688 - mov r1, r8 - cmp r1, 0x4 - bne _0804C688 - ldr r3, =0x0202420a - strb r0, [r3] - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x9 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024250 - ldrb r0, [r7] - lsls r0, 1 - adds r0, r1 - strh r4, [r0] - ldr r0, =0x02024332 - mov r2, r8 - strb r2, [r0, 0x6] - ldrb r0, [r7] - ldrb r1, [r3] - bl b_history__record_ability_usage_of_player - b _0804C76A - .pool -_0804C678: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0] - b _0804C76A - .pool -_0804C688: - ldr r1, =gUnknown_0831ACE8 - adds r0, r5, r1 - ldrb r0, [r0] - adds r6, r1, 0 - b _0804C74A - .pool -_0804C698: - adds r0, r5, r6 - ldrb r0, [r0] - cmp r0, r8 - bne _0804C744 - adds r2, r5, 0x1 - adds r3, r2, r6 - ldrb r1, [r7] - movs r0, 0x58 - muls r0, r1 - add r0, r12 - adds r0, 0x21 - ldrb r1, [r3] - adds r3, r2, 0 - ldrb r0, [r0] - cmp r1, r0 - bne _0804C6D6 - adds r0, r5, 0x2 - adds r0, r6 - ldrb r1, [r0] - cmp r1, 0 - beq _0804C678 - cmp r1, 0x5 - bne _0804C6CA - movs r0, 0x4 - orrs r4, r0 -_0804C6CA: - cmp r1, 0x14 - bne _0804C6D6 - movs r0, 0x2 - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_0804C6D6: - adds r2, r3, r6 - ldrb r1, [r7] - movs r0, 0x58 - muls r0, r1 - add r0, r12 - adds r1, r0, 0 - adds r1, 0x22 - ldrb r2, [r2] - ldrb r1, [r1] - cmp r2, r1 - bne _0804C744 - adds r0, 0x21 - ldrb r1, [r0] - cmp r1, r2 - beq _0804C6FE - adds r0, r5, 0x2 - adds r0, r6 - ldrb r0, [r0] - cmp r0, 0 - beq _0804C678 -_0804C6FE: - cmp r1, r2 - beq _0804C714 - adds r0, r5, 0x2 - adds r0, r6 - ldrb r0, [r0] - cmp r0, 0x5 - bne _0804C714 - movs r0, 0x4 - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_0804C714: - adds r2, r3, r6 - ldrb r1, [r7] - movs r0, 0x58 - muls r0, r1 - add r0, r12 - adds r1, r0, 0 - adds r1, 0x22 - ldrb r2, [r2] - ldrb r1, [r1] - cmp r2, r1 - bne _0804C744 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, r2 - beq _0804C744 - adds r0, r5, 0x2 - adds r0, r6 - ldrb r0, [r0] - cmp r0, 0x14 - bne _0804C744 - movs r0, 0x2 - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_0804C744: - adds r5, 0x3 - adds r0, r5, r6 - ldrb r0, [r0] -_0804C74A: - cmp r0, 0xFF - beq _0804C76A - cmp r0, 0xFE - bne _0804C698 - ldrb r1, [r7] - movs r0, 0x58 - muls r0, r1 - mov r1, r12 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 22 - ands r0, r1 - cmp r0, 0 - beq _0804C744 -_0804C76A: - ldr r2, =0x02024084 - ldr r0, =0x0202420c - mov r8, r0 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x20 - ldrb r6, [r0] - cmp r6, 0x19 - bne _0804C7E6 - movs r5, 0x29 - ands r5, r4 - cmp r5, 0 - bne _0804C7E6 - ldr r0, =0x0202420b - ldrb r0, [r0] - ldr r7, =0x020241ea - ldrh r1, [r7] - bl move_weather_interaction - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x2 - bne _0804C7E6 - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _0804C7AC - movs r0, 0x6 - ands r4, r0 - cmp r4, 0x6 - bne _0804C7E6 -_0804C7AC: - ldr r2, =gBattleMoves - ldrh r1, [r7] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0 - beq _0804C7E6 - ldr r3, =0x0202420a - strb r6, [r3] - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024250 - mov r2, r8 - ldrb r0, [r2] - lsls r0, 1 - adds r0, r1 - strh r5, [r0] - ldr r1, =0x02024332 - movs r0, 0x3 - strb r0, [r1, 0x6] - ldrb r0, [r2] - ldrb r1, [r3] - bl b_history__record_ability_usage_of_player -_0804C7E6: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0804C804 - ldr r2, =0x0202433c - ldr r0, =0x0202420b - ldrb r1, [r0] - lsls r1, 4 - adds r1, r2 - ldrb r0, [r1, 0x1] - movs r2, 0x2 - orrs r0, r2 - strb r0, [r1, 0x1] -_0804C804: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk4A_damagecalc2 - - thumb_func_start atk4B_cmd4b -atk4B_cmd4b: @ 804C844 - push {r4,lr} - ldr r4, =0x02024064 - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r4] - ldr r2, =0x02024280 - ldr r1, =gUnknown_0832A328 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - lsls r1, 28 - ldr r0, [r2] - ands r0, r1 - cmp r0, 0 - bne _0804C872 - movs r0, 0 - movs r1, 0 - bl dp01_build_cmdbuf_x06_a - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0804C872: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk4B_cmd4b - - thumb_func_start atk4C_switch1 -atk4C_switch1: @ 804C894 - push {r4,r5,lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0804C8E4 - ldr r5, =0x02024214 - ldr r0, [r5] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r4, =0x02024064 - strb r0, [r4] - ldr r3, =0x0202406e - ldrb r0, [r4] - lsls r2, r0, 1 - adds r2, r3 - ldr r1, =0x0202449c - ldr r1, [r1] - adds r0, r1 - adds r0, 0x5C - ldrb r0, [r0] - strh r0, [r2] - ldr r1, =gUnknown_0832A328 - ldrb r0, [r4] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldrb r2, [r0] - movs r0, 0 - movs r1, 0 - bl dp01_build_cmdbuf_x00_a_b_0 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r5] - adds r0, 0x2 - str r0, [r5] -_0804C8E4: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk4C_switch1 - - thumb_func_start sub_804C904 -sub_804C904: @ 804C904 - push {r4-r7,lr} - sub sp, 0x58 - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - beq _0804C912 - b _0804CAA4 -_0804C912: - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r4, =0x02024064 - strb r0, [r4] - ldr r6, =0x02024084 - ldrb r0, [r4] - movs r5, 0x58 - adds r1, r0, 0 - muls r1, r5 - adds r1, r6 - mov r0, sp - movs r2, 0x58 - bl memcpy - ldrb r0, [r4] - muls r0, r5 - adds r3, r0, r6 - movs r2, 0 - ldr r5, =0x02023864 -_0804C93E: - adds r0, r3, r2 - ldrb r1, [r4] - lsls r1, 9 - adds r1, 0x4 - adds r1, r2, r1 - adds r1, r5 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x57 - bls _0804C93E - ldr r4, =0x02024084 - ldr r6, =0x02024064 - ldrb r0, [r6] - movs r7, 0x58 - adds r2, r0, 0 - muls r2, r7 - adds r2, r4 - ldr r3, =gBaseStats - ldrh r1, [r2] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x6] - adds r2, 0x21 - strb r0, [r2] - ldrb r0, [r6] - adds r1, r0, 0 - muls r1, r7 - adds r1, r4 - ldrh r2, [r1] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x7] - adds r1, 0x22 - strb r0, [r1] - ldrb r0, [r6] - adds r1, r0, 0 - muls r1, r7 - adds r1, r4 - ldrh r0, [r1] - ldrb r1, [r1, 0x17] - lsrs r1, 7 - bl sub_806B694 - ldrb r1, [r6] - muls r1, r7 - adds r1, r4 - adds r1, 0x20 - strb r0, [r1] - ldrb r0, [r6] - bl battle_side_get_owner - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x020243d0 - adds r0, 0x29 - adds r0, r2, r0 - ldrb r1, [r0] - ldr r3, =gUnknown_0832A328 - ldr r2, =0x0202406e - ldrb r5, [r6] - lsls r0, r5, 1 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - ands r1, r0 - mov r12, r4 - cmp r1, 0 - beq _0804C9DE - adds r0, r5, 0 - muls r0, r7 - add r0, r12 - movs r1, 0 - strh r1, [r0, 0x2E] -_0804C9DE: - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0x7F - bne _0804CA26 - movs r2, 0 - adds r4, r6, 0 - movs r6, 0x58 - mov r5, r12 - adds r5, 0x18 - add r3, sp, 0x18 -_0804C9FE: - ldrb r0, [r4] - adds r1, r0, 0 - muls r1, r6 - adds r1, r2, r1 - adds r1, r5 - adds r0, r3, r2 - ldrb r0, [r0] - strb r0, [r1] - adds r2, 0x1 - cmp r2, 0x7 - ble _0804C9FE - ldr r0, =0x02024064 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - mov r1, r12 - adds r1, 0x50 - adds r0, r1 - ldr r1, [sp, 0x50] - str r1, [r0] -_0804CA26: - bl sub_803A284 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 10 - ands r0, r1 - cmp r0, 0 - beq _0804CA78 - ldr r4, =0x02024084 - ldr r0, =0x02024064 - ldrb r3, [r0] - movs r0, 0x58 - adds r2, r3, 0 - muls r2, r0 - adds r1, r2, r4 - ldrh r0, [r1, 0x2C] - lsrs r0, 1 - ldrh r1, [r1, 0x28] - cmp r0, r1 - bcc _0804CA78 - cmp r1, 0 - beq _0804CA78 - adds r0, r4, 0 - adds r0, 0x4C - adds r0, r2, r0 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - bne _0804CA78 - ldr r0, =0x0202449c - ldr r2, [r0] - adds r2, 0x92 - ldr r1, =gUnknown_0832A328 - lsls r0, r3, 2 - adds r0, r1 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] -_0804CA78: - ldr r0, =0x02024474 - ldr r3, =0x02024064 - ldrb r2, [r3] - strb r2, [r0, 0x17] - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x7 - strb r0, [r1, 0x1] - strb r2, [r1, 0x2] - ldr r2, =0x0202406e - ldrb r0, [r3] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] -_0804CAA4: - add sp, 0x58 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_804C904 - - thumb_func_start atk4E_switch3 -atk4E_switch3: @ 804CAE8 - push {r4-r6,lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0804CB86 - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r6, =0x02024064 - strb r0, [r6] - ldrb r0, [r6] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0804CB3E - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x063f0902 - ands r0, r1 - cmp r0, 0 - bne _0804CB3E - ldr r4, =0x02024084 - ldrb r0, [r6] - movs r5, 0x58 - muls r0, r5 - adds r0, r4 - ldrh r0, [r0] - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r6] - muls r1, r5 - adds r4, 0x48 - adds r1, r4 - ldr r2, [r1] - movs r1, 0x2 - bl SetPokedexFlag -_0804CB3E: - ldr r2, =0x02024210 - ldr r1, =gUnknown_0832A328 - ldr r5, =0x02024064 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - ldrb r0, [r2] - bics r0, r1 - strb r0, [r2] - ldr r1, =0x0202406e - ldrb r0, [r5] - lsls r0, 1 - adds r0, r1 - ldrb r1, [r0] - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r2, [r0, 0x2] - movs r0, 0 - bl dp01_build_cmdbuf_x05_a_b_c - ldrb r0, [r5] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r4] - adds r0, 0x3 - str r0, [r4] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - beq _0804CB86 - bl sub_81A56B4 -_0804CB86: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atk4E_switch3 - - thumb_func_start atk4F_jumpifcannotswitch -atk4F_jumpifcannotswitch: @ 804CBB0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r1, [r0, 0x1] - movs r0, 0x7F - ands r0, r1 - bl get_battle_side_of_something - ldr r3, =0x02024064 - strb r0, [r3] - ldr r2, [r4] - ldrb r1, [r2, 0x1] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0804CC28 - ldr r1, =0x02024084 - ldrb r3, [r3] - movs r0, 0x58 - muls r0, r3 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x0400e000 - ands r0, r1 - cmp r0, 0 - bne _0804CBFC - ldr r1, =0x020242ac - lsls r0, r3, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 3 - ands r0, r1 - cmp r0, 0 - beq _0804CC28 -_0804CBFC: - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _0804CF00 - .pool -_0804CC28: - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 15 - ands r0, r1 - cmp r0, 0 - beq _0804CCC0 - ldr r5, =0x02024064 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x020244ec - mov r8, r1 - cmp r0, 0x1 - bne _0804CC4E - ldr r0, =0x02024744 - mov r8, r0 -_0804CC4E: - movs r4, 0 - ldrb r1, [r5] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0804CC5C - movs r4, 0x3 -_0804CC5C: - adds r6, r4, 0x3 - cmp r4, r6 - bge _0804CCA4 - ldr r7, =0x0202406e -_0804CC64: - movs r0, 0x64 - muls r0, r4 - mov r1, r8 - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _0804CC9E - adds r0, r5, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _0804CC9E - adds r0, r5, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _0804CC9E - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - cmp r0, r4 - bne _0804CCA4 -_0804CC9E: - adds r4, 0x1 - cmp r4, r6 - blt _0804CC64 -_0804CCA4: - cmp r4, r6 - bne _0804CCAA - b _0804CED0 -_0804CCAA: - b _0804CEF8 - .pool -_0804CCC0: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0804CD8C - movs r0, 0x80 - lsls r0, 16 - ands r1, r0 - cmp r1, 0 - beq _0804CD00 - ldr r5, =0x02024064 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0804CCEC - ldr r0, =0x020244ec - b _0804CD16 - .pool -_0804CCEC: - ldr r1, =0x02024744 - mov r8, r1 - ldrb r0, [r5] - movs r4, 0x3 - cmp r0, 0x1 - bne _0804CD32 - movs r4, 0 - b _0804CD32 - .pool -_0804CD00: - ldr r5, =0x02024064 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x020244ec - mov r8, r1 - cmp r0, 0x1 - bne _0804CD18 - ldr r0, =0x02024744 -_0804CD16: - mov r8, r0 -_0804CD18: - movs r4, 0 - ldrb r0, [r5] - bl sub_806D864 - lsls r0, 24 - lsrs r0, 24 - bl sub_806D82C - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bne _0804CD32 - movs r4, 0x3 -_0804CD32: - adds r6, r4, 0x3 - cmp r4, r6 - bge _0804CCA4 - ldr r7, =0x0202406e -_0804CD3A: - movs r0, 0x64 - muls r0, r4 - mov r1, r8 - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _0804CD74 - adds r0, r5, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _0804CD74 - adds r0, r5, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _0804CD74 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - cmp r0, r4 - bne _0804CCA4 -_0804CD74: - adds r4, 0x1 - cmp r4, r6 - blt _0804CD3A - b _0804CCA4 - .pool -_0804CD8C: - movs r0, 0x80 - lsls r0, 8 - ands r1, r0 - cmp r1, 0 - beq _0804CE10 - ldr r5, =0x02024064 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0804CE10 - ldr r0, =0x02024744 - mov r8, r0 - movs r4, 0 - ldrb r0, [r5] - cmp r0, 0x3 - bne _0804CDB4 - movs r4, 0x3 -_0804CDB4: - adds r6, r4, 0x3 - cmp r4, r6 - blt _0804CDBC - b _0804CCA4 -_0804CDBC: - ldr r7, =0x0202406e -_0804CDBE: - movs r0, 0x64 - muls r0, r4 - mov r1, r8 - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _0804CDFA - adds r0, r5, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _0804CDFA - adds r0, r5, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _0804CDFA - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - cmp r0, r4 - beq _0804CDFA - b _0804CCA4 -_0804CDFA: - adds r4, 0x1 - cmp r4, r6 - blt _0804CDBE - b _0804CCA4 - .pool -_0804CE10: - ldr r0, =0x02024064 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bne _0804CE54 - movs r0, 0x1 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x02022fec - ldr r0, [r0] - ands r0, r4 - cmp r0, 0 - beq _0804CE48 - movs r0, 0x3 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r6, r0, 24 - b _0804CE4A - .pool -_0804CE48: - adds r6, r7, 0 -_0804CE4A: - ldr r0, =0x02024744 - mov r8, r0 - b _0804CE82 - .pool -_0804CE54: - movs r0, 0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0804CE7C - movs r0, 0x2 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r6, r0, 24 - b _0804CE7E - .pool -_0804CE7C: - adds r6, r7, 0 -_0804CE7E: - ldr r1, =0x020244ec - mov r8, r1 -_0804CE82: - movs r4, 0 -_0804CE84: - movs r0, 0x64 - muls r0, r4 - mov r1, r8 - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _0804CEC6 - adds r0, r5, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _0804CEC6 - adds r0, r5, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _0804CEC6 - ldr r1, =0x0202406e - lsls r0, r7, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r4, r0 - beq _0804CEC6 - lsls r0, r6, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r4, r0 - bne _0804CECC -_0804CEC6: - adds r4, 0x1 - cmp r4, 0x5 - ble _0804CE84 -_0804CECC: - cmp r4, 0x6 - bne _0804CEF8 -_0804CED0: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0804CF00 - .pool -_0804CEF8: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x6 - str r0, [r1] -_0804CF00: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk4F_jumpifcannotswitch - - thumb_func_start sub_804CF10 -sub_804CF10: @ 804CF10 - push {r4,r5,lr} - sub sp, 0x4 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r5, =0x02024064 - ldrb r0, [r5] - ldr r4, =0x0202449c - ldr r1, [r4] - adds r1, r0, r1 - adds r1, 0x58 - ldr r3, =0x0202406e - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - strb r0, [r1] - ldrb r0, [r5] - ldr r1, [r4] - adds r0, r1 - adds r0, 0x5C - movs r1, 0x6 - strb r1, [r0] - ldr r1, [r4] - adds r1, 0x93 - ldr r3, =gUnknown_0832A328 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r3 - ldr r3, [r0] - ldrb r0, [r1] - bics r0, r3 - strb r0, [r1] - ldrb r0, [r5] - lsls r1, r0, 1 - adds r1, r0 - adds r1, 0x60 - ldr r0, [r4] - adds r0, r1 - str r0, [sp] - movs r0, 0 - movs r1, 0x1 - movs r3, 0 - bl dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f - ldrb r0, [r5] - bl dp01_battle_side_mark_buffer_for_execution - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_804CF10 - - thumb_func_start atk50_openpartyscreen -atk50_openpartyscreen: @ 804CF88 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - movs r7, 0 - movs r0, 0 - mov r9, r0 - ldr r6, =0x02024214 - ldr r2, [r6] - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - mov r8, r1 - ldrb r1, [r2, 0x1] - adds r0, r1, 0 - mov r12, r6 - cmp r0, 0x5 - beq _0804CFBE - b _0804D464 -_0804CFBE: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x41 - ands r1, r0 - cmp r1, 0x1 - beq _0804D0B0 - ldr r1, =0x02024064 - strb r7, [r1] - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r7, r0 - bcc _0804CFD8 - b _0804D450 -_0804CFD8: - ldr r7, =0x02024280 - ldr r6, =gUnknown_0832A328 - adds r4, r1, 0 - ldr r2, =0x02024210 - mov r8, r2 -_0804CFE2: - ldrb r2, [r4] - lsls r0, r2, 2 - adds r0, r6 - ldr r1, [r0] - lsls r1, 28 - ldr r0, [r7] - ands r0, r1 - cmp r0, 0 - beq _0804D088 - adds r0, r2, 0 - movs r1, 0x6 - movs r2, 0x6 - bl sub_80423F4 - lsls r0, 24 - cmp r0, 0 - beq _0804D054 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - mov r2, r8 - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - ldrb r0, [r4] - lsls r0, 2 - adds r0, r6 - ldr r1, [r0] - lsls r1, 28 - ldr r0, [r7] - bics r0, r1 - str r0, [r7] - movs r0, 0 - movs r1, 0x2 - movs r2, 0 - bl sub_8034464 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - b _0804D098 - .pool -_0804D054: - ldr r5, =0x0202437c - ldrb r0, [r4] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r0, [r1] - lsls r0, 25 - cmp r0, 0 - blt _0804D098 - movs r0, 0x6 - bl sub_804CF10 - ldrb r1, [r4] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] - b _0804D098 - .pool -_0804D088: - movs r0, 0 - movs r1, 0x2 - movs r2, 0 - bl sub_8034464 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0804D098: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bcc _0804CFE2 - b _0804D450 - .pool -_0804D0B0: - ands r0, r1 - cmp r0, 0 - bne _0804D0B8 - b _0804D450 -_0804D0B8: - ldr r0, =0x02024280 - mov r8, r0 - ldr r0, [r0] - lsrs r5, r0, 28 - ldr r6, =gUnknown_0832A328 - ldr r0, [r6] - ands r0, r5 - cmp r0, 0 - beq _0804D170 - ldr r4, =0x02024064 - strb r7, [r4] - movs r0, 0 - movs r1, 0x6 - movs r2, 0x6 - bl sub_80423F4 - lsls r0, 24 - cmp r0, 0 - beq _0804D120 - ldr r2, =0x02024210 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - ldrb r0, [r4] - lsls r0, 2 - adds r0, r6 - ldr r1, [r0] - lsls r1, 28 - mov r2, r8 - ldr r0, [r2] - bics r0, r1 - str r0, [r2] - movs r0, 0 - bl dp01_build_cmdbuf_x2A_2A_2A_2A - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - b _0804D170 - .pool -_0804D120: - ldr r6, =0x0202437c - ldrb r0, [r4] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r0, [r1] - lsls r0, 25 - cmp r0, 0 - blt _0804D15C - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x5E - ldrb r0, [r0] - bl sub_804CF10 - ldrb r1, [r4] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] - b _0804D170 - .pool -_0804D15C: - movs r0, 0 - movs r1, 0x2 - movs r2, 0 - bl sub_8034464 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - movs r0, 0x1 - mov r9, r0 -_0804D170: - ldr r6, =gUnknown_0832A328 - ldr r0, [r6, 0x8] - ands r0, r5 - cmp r0, 0 - beq _0804D22E - ldr r0, [r6] - ands r0, r5 - cmp r0, 0 - bne _0804D22E - ldr r4, =0x02024064 - movs r0, 0x2 - strb r0, [r4] - movs r0, 0x2 - movs r1, 0x6 - movs r2, 0x6 - bl sub_80423F4 - lsls r0, 24 - cmp r0, 0 - beq _0804D1D8 - ldr r2, =0x02024210 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - ldr r2, =0x02024280 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r6 - ldr r1, [r0] - lsls r1, 28 - ldr r0, [r2] - bics r0, r1 - str r0, [r2] - movs r0, 0 - bl dp01_build_cmdbuf_x2A_2A_2A_2A - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - b _0804D22E - .pool -_0804D1D8: - ldr r6, =0x0202437c - ldrb r0, [r4] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r0, [r1] - lsls r0, 25 - cmp r0, 0 - blt _0804D214 - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x5C - ldrb r0, [r0] - bl sub_804CF10 - ldrb r1, [r4] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] - b _0804D22E - .pool -_0804D214: - movs r0, 0x1 - mov r1, r9 - ands r0, r1 - cmp r0, 0 - bne _0804D22E - movs r0, 0 - movs r1, 0x2 - movs r2, 0 - bl sub_8034464 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0804D22E: - ldr r6, =gUnknown_0832A328 - ldr r0, [r6, 0x4] - ands r0, r5 - cmp r0, 0 - beq _0804D2E4 - ldr r4, =0x02024064 - movs r0, 0x1 - strb r0, [r4] - movs r0, 0x1 - movs r1, 0x6 - movs r2, 0x6 - bl sub_80423F4 - lsls r0, 24 - cmp r0, 0 - beq _0804D290 - ldr r2, =0x02024210 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - ldr r2, =0x02024280 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r6 - ldr r1, [r0] - lsls r1, 28 - ldr r0, [r2] - bics r0, r1 - str r0, [r2] - movs r0, 0 - bl dp01_build_cmdbuf_x2A_2A_2A_2A - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - b _0804D2E4 - .pool -_0804D290: - ldr r6, =0x0202437c - ldrb r0, [r4] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r0, [r1] - lsls r0, 25 - cmp r0, 0 - blt _0804D2CC - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x5F - ldrb r0, [r0] - bl sub_804CF10 - ldrb r1, [r4] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] - b _0804D2E4 - .pool -_0804D2CC: - movs r0, 0 - movs r1, 0x2 - movs r2, 0 - bl sub_8034464 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - movs r0, 0x2 - mov r2, r9 - orrs r2, r0 - mov r9, r2 -_0804D2E4: - ldr r6, =gUnknown_0832A328 - ldr r0, [r6, 0xC] - ands r0, r5 - cmp r0, 0 - beq _0804D3A2 - ldr r0, [r6, 0x4] - ands r0, r5 - cmp r0, 0 - bne _0804D3A2 - ldr r4, =0x02024064 - movs r0, 0x3 - strb r0, [r4] - movs r0, 0x3 - movs r1, 0x6 - movs r2, 0x6 - bl sub_80423F4 - lsls r0, 24 - cmp r0, 0 - beq _0804D34C - ldr r2, =0x02024210 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - ldr r2, =0x02024280 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r6 - ldr r1, [r0] - lsls r1, 28 - ldr r0, [r2] - bics r0, r1 - str r0, [r2] - movs r0, 0 - bl dp01_build_cmdbuf_x2A_2A_2A_2A - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - b _0804D3A2 - .pool -_0804D34C: - ldr r6, =0x0202437c - ldrb r0, [r4] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r0, [r1] - lsls r0, 25 - cmp r0, 0 - blt _0804D388 - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x5D - ldrb r0, [r0] - bl sub_804CF10 - ldrb r1, [r4] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] - b _0804D3A2 - .pool -_0804D388: - movs r0, 0x2 - mov r1, r9 - ands r1, r0 - cmp r1, 0 - bne _0804D3A2 - movs r0, 0 - movs r1, 0x2 - movs r2, 0 - bl sub_8034464 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0804D3A2: - ldr r1, =0x0202437c - ldrb r0, [r1] - lsls r0, 25 - cmp r0, 0 - blt _0804D3FA - adds r0, r1, 0 - adds r0, 0x28 - ldrb r0, [r0] - lsls r0, 25 - cmp r0, 0 - blt _0804D3FA - cmp r5, 0 - beq _0804D3FA - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r0, =gUnknown_0832A328 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _0804D3E4 - ldr r1, =0x02024064 - movs r0, 0x2 - strb r0, [r1] - b _0804D3E8 - .pool -_0804D3E4: - ldr r0, =0x02024064 - strb r1, [r0] -_0804D3E8: - movs r0, 0 - movs r1, 0x2 - movs r2, 0 - bl sub_8034464 - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution -_0804D3FA: - ldr r1, =0x0202437c - ldrb r0, [r1, 0x14] - lsls r0, 25 - cmp r0, 0 - blt _0804D450 - adds r0, r1, 0 - adds r0, 0x3C - ldrb r0, [r0] - lsls r0, 25 - cmp r0, 0 - blt _0804D450 - cmp r5, 0 - beq _0804D450 - ldr r0, =0x02024210 - ldrb r0, [r0] - ldr r1, =gUnknown_0832A328 - ldr r1, [r1, 0x4] - ands r0, r1 - cmp r0, 0 - beq _0804D438 - ldr r1, =0x02024064 - movs r0, 0x3 - b _0804D43C - .pool -_0804D438: - ldr r1, =0x02024064 - movs r0, 0x1 -_0804D43C: - strb r0, [r1] - movs r0, 0 - movs r1, 0x2 - movs r2, 0 - bl sub_8034464 - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution -_0804D450: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x6 - str r0, [r1] - b _0804D804 - .pool -_0804D464: - cmp r0, 0x6 - beq _0804D46A - b _0804D658 -_0804D46A: - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0804D478 - b _0804D5F4 -_0804D478: - movs r0, 0x1 - ands r1, r0 - cmp r1, 0 - bne _0804D482 - b _0804D5F4 -_0804D482: - ldr r7, =0x02024280 - ldr r0, [r7] - lsrs r5, r0, 28 - ldr r4, =gUnknown_0832A328 - ldr r0, [r4, 0x8] - ands r0, r5 - cmp r0, 0 - beq _0804D52A - ldr r0, [r4] - ands r0, r5 - cmp r0, 0 - beq _0804D52A - ldr r6, =0x02024064 - movs r0, 0x2 - strb r0, [r6] - ldr r0, =0x02023864 - ldrb r1, [r0, 0x1] - movs r0, 0x2 - movs r2, 0x6 - bl sub_80423F4 - lsls r0, 24 - cmp r0, 0 - beq _0804D4F8 - ldr r2, =0x02024210 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r4 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - ldrb r0, [r6] - lsls r0, 2 - adds r0, r4 - ldr r1, [r0] - lsls r1, 28 - ldr r0, [r7] - bics r0, r1 - str r0, [r7] - movs r0, 0 - bl dp01_build_cmdbuf_x2A_2A_2A_2A - ldrb r0, [r6] - bl dp01_battle_side_mark_buffer_for_execution - b _0804D52A - .pool -_0804D4F8: - ldr r4, =0x0202437c - ldrb r0, [r6] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r0, [r1] - lsls r0, 25 - cmp r0, 0 - blt _0804D52A - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x5C - ldrb r0, [r0] - bl sub_804CF10 - ldrb r1, [r6] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] -_0804D52A: - ldr r4, =gUnknown_0832A328 - ldr r0, [r4, 0xC] - ands r0, r5 - cmp r0, 0 - beq _0804D5DA - ldr r0, [r4, 0x4] - ands r5, r0 - cmp r5, 0 - beq _0804D5DA - ldr r5, =0x02024064 - movs r0, 0x3 - strb r0, [r5] - ldr r0, =0x02023864 - ldr r2, =0x00000201 - adds r0, r2 - ldrb r1, [r0] - movs r0, 0x3 - movs r2, 0x6 - bl sub_80423F4 - lsls r0, 24 - cmp r0, 0 - beq _0804D5A8 - ldr r2, =0x02024210 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r4 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - ldr r2, =0x02024280 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r4 - ldr r1, [r0] - lsls r1, 28 - ldr r0, [r2] - bics r0, r1 - str r0, [r2] - movs r0, 0 - bl dp01_build_cmdbuf_x2A_2A_2A_2A - ldrb r0, [r5] - bl dp01_battle_side_mark_buffer_for_execution - b _0804D5DA - .pool -_0804D5A8: - ldr r4, =0x0202437c - ldrb r0, [r5] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r0, [r1] - lsls r0, 25 - cmp r0, 0 - blt _0804D5DA - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x5D - ldrb r0, [r0] - bl sub_804CF10 - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] -_0804D5DA: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x6 - str r0, [r1] - mov r12, r1 - b _0804D5F8 - .pool -_0804D5F4: - adds r0, r2, 0x6 - str r0, [r6] -_0804D5F8: - ldr r0, =0x02024280 - ldr r0, [r0] - lsrs r5, r0, 28 - ldr r1, =0x0202420d - movs r0, 0 - strb r0, [r1] - ldr r4, =gUnknown_0832A328 - ldr r2, [r4] - ands r2, r5 - ldr r6, =0x0202406c - cmp r2, 0 - bne _0804D634 - adds r7, r6, 0 - ldrb r0, [r6] - cmp r2, r0 - bcs _0804D634 - adds r3, r1, 0 -_0804D61A: - ldrb r0, [r3] - adds r0, 0x1 - strb r0, [r3] - ldrb r2, [r3] - lsls r0, r2, 2 - adds r0, r4 - ldr r0, [r0] - ands r0, r5 - cmp r0, 0 - bne _0804D634 - ldrb r0, [r7] - cmp r2, r0 - bcc _0804D61A -_0804D634: - ldrb r0, [r1] - ldrb r6, [r6] - cmp r0, r6 - beq _0804D63E - b _0804D804 -_0804D63E: - mov r1, r8 - mov r2, r12 - str r1, [r2] - b _0804D804 - .pool -_0804D658: - movs r0, 0x80 - ands r0, r1 - movs r5, 0x1 - cmp r0, 0 - beq _0804D664 - movs r5, 0 -_0804D664: - movs r0, 0x7F - ands r0, r1 - bl get_battle_side_of_something - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =0x0202437c - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 25 - cmp r0, 0 - bge _0804D690 - ldr r0, [r6] - adds r0, 0x6 - str r0, [r6] - b _0804D804 - .pool -_0804D690: - adds r0, r7, 0 - movs r1, 0x6 - movs r2, 0x6 - bl sub_80423F4 - lsls r0, 24 - cmp r0, 0 - beq _0804D6E0 - ldr r2, =0x02024064 - strb r7, [r2] - ldr r3, =0x02024210 - ldr r4, =gUnknown_0832A328 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r4 - ldr r0, [r0] - ldrb r1, [r3] - orrs r0, r1 - strb r0, [r3] - ldr r3, =0x02024280 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r4 - ldr r1, [r0] - lsls r1, 28 - ldr r0, [r3] - bics r0, r1 - str r0, [r3] - mov r0, r8 - str r0, [r6] - b _0804D804 - .pool -_0804D6E0: - ldr r4, =0x02024064 - strb r7, [r4] - ldrb r0, [r4] - ldr r3, =0x0202449c - ldr r1, [r3] - adds r1, r0, r1 - adds r1, 0x58 - ldr r2, =0x0202406e - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - strb r0, [r1] - ldrb r0, [r4] - ldr r1, [r3] - adds r0, r1 - adds r0, 0x5C - movs r1, 0x6 - strb r1, [r0] - ldr r1, [r3] - adds r1, 0x93 - ldr r2, =gUnknown_0832A328 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r2 - ldr r2, [r0] - ldrb r0, [r1] - bics r0, r2 - strb r0, [r1] - ldrb r1, [r4] - movs r0, 0x2 - eors r0, r1 - ldr r3, [r3] - adds r0, r3 - adds r0, 0x5C - ldrb r2, [r0] - ldrb r1, [r4] - lsls r0, r1, 1 - adds r0, r1 - adds r0, 0x60 - adds r3, r0 - str r3, [sp] - movs r0, 0 - adds r1, r5, 0 - movs r3, 0 - bl dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r6] - adds r0, 0x6 - str r0, [r6] - ldrb r0, [r4] - bl battle_get_per_side_status - lsls r0, 24 - cmp r0, 0 - bne _0804D760 - ldr r1, =0x03005d10 - ldrb r0, [r1, 0x2] - cmp r0, 0xFE - bhi _0804D760 - adds r0, 0x1 - strb r0, [r1, 0x2] -_0804D760: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0804D7C4 - ldr r1, =0x02024064 - movs r0, 0 - strb r0, [r1] - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r0, 0 - beq _0804D804 - adds r4, r1, 0 -_0804D77C: - ldrb r0, [r4] - cmp r0, r7 - beq _0804D792 - movs r0, 0 - movs r1, 0x2 - movs r2, 0 - bl sub_8034464 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0804D792: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bcc _0804D77C - b _0804D804 - .pool -_0804D7C4: - adds r0, r7, 0 - bl battle_get_per_side_status - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - ldr r4, =0x02024064 - strb r0, [r4] - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - ldrb r3, [r4] - lsls r0, r3, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _0804D7F4 - movs r0, 0x2 - eors r3, r0 - strb r3, [r4] -_0804D7F4: - movs r0, 0 - movs r1, 0x2 - movs r2, 0 - bl sub_8034464 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0804D804: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk50_openpartyscreen - - thumb_func_start atk51_cmd51 -atk51_cmd51: @ 804D820 - push {r4-r7,lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - beq _0804D82C - b _0804DA8A -_0804D82C: - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r5, =0x02024064 - strb r0, [r5] - ldr r0, [r4] - ldrb r0, [r0, 0x2] - cmp r0, 0x1 - beq _0804D8CC - cmp r0, 0x1 - bgt _0804D858 - cmp r0, 0 - beq _0804D862 - b _0804DA82 - .pool -_0804D858: - cmp r0, 0x2 - beq _0804D8E8 - cmp r0, 0x3 - beq _0804D922 - b _0804DA82 -_0804D862: - movs r6, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r6, r0 - blt _0804D86E - b _0804DA82 -_0804D86E: - ldr r7, =0x02023864 -_0804D870: - ldrb r0, [r7] - cmp r0, 0x22 - bne _0804D8AA - ldr r5, =0x0202449c - ldr r0, [r5] - adds r0, r6, r0 - adds r0, 0x5C - ldrb r1, [r7, 0x1] - strb r1, [r0] - ldr r0, [r5] - adds r0, 0x93 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - lsls r0, r6, 2 - adds r0, r2 - ldr r4, [r0] - ands r1, r4 - cmp r1, 0 - bne _0804D8AA - lsls r0, r6, 24 - lsrs r0, 24 - ldrb r1, [r7, 0x1] - bl sub_8184FBC - ldr r1, [r5] - adds r1, 0x93 - ldrb r0, [r1] - orrs r4, r0 - strb r4, [r1] -_0804D8AA: - movs r0, 0x80 - lsls r0, 2 - adds r7, r0 - adds r6, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r6, r0 - blt _0804D870 - b _0804DA82 - .pool -_0804D8CC: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0804D8DA - b _0804DA82 -_0804D8DA: - ldrb r0, [r5] - bl sub_803BDA0 - b _0804DA82 - .pool -_0804D8E8: - ldr r4, =0x0202449c - ldr r0, [r4] - adds r0, 0x93 - ldrb r1, [r0] - ldr r6, =gUnknown_0832A328 - ldrb r2, [r5] - lsls r0, r2, 2 - adds r0, r6 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0804D922 - ldr r0, =0x02023864 - lsls r1, r2, 9 - adds r0, 0x1 - adds r1, r0 - ldrb r1, [r1] - adds r0, r2, 0 - bl sub_8184FBC - ldr r2, [r4] - adds r2, 0x93 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] -_0804D922: - ldr r1, =0x02024332 - ldr r6, =0x02023864 - ldr r7, =0x02024064 - ldrb r0, [r7] - lsls r0, 9 - adds r2, r6, 0x1 - adds r0, r2 - ldrb r0, [r0] - strb r0, [r1] - ldrb r0, [r7] - ldr r1, =0x0202449c - mov r12, r1 - ldr r1, [r1] - adds r1, r0, r1 - adds r1, 0x5C - lsls r0, 9 - adds r0, r2 - ldrb r0, [r0] - strb r0, [r1] - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x42 - ands r0, r1 - cmp r0, 0x42 - bne _0804DA14 - ldrb r0, [r7] - mov r3, r12 - ldr r2, [r3] - lsls r1, r0, 1 - adds r1, r0 - adds r1, r2 - adds r1, 0x60 - ldrb r2, [r1] - movs r0, 0xF - ands r0, r2 - strb r0, [r1] - ldrb r0, [r7] - ldr r2, [r3] - lsls r1, r0, 1 - adds r1, r0 - adds r1, r2 - adds r1, 0x60 - lsls r0, 9 - adds r5, r6, 0x2 - adds r0, r5 - ldrb r2, [r0] - movs r3, 0xF0 - adds r0, r3, 0 - ands r0, r2 - ldrb r2, [r1] - orrs r0, r2 - strb r0, [r1] - ldrb r1, [r7] - mov r0, r12 - ldr r2, [r0] - lsls r0, r1, 1 - adds r0, r1 - adds r0, r2 - adds r0, 0x61 - lsls r1, 9 - adds r6, 0x3 - adds r1, r6 - ldrb r1, [r1] - strb r1, [r0] - ldrb r0, [r7] - movs r4, 0x2 - eors r0, r4 - mov r1, r12 - ldr r2, [r1] - lsls r1, r0, 1 - adds r1, r0 - adds r1, r2 - adds r1, 0x60 - ldrb r2, [r1] - adds r0, r3, 0 - ands r0, r2 - strb r0, [r1] - ldrb r0, [r7] - eors r0, r4 - mov r1, r12 - ldr r2, [r1] - lsls r1, r0, 1 - adds r1, r0 - adds r1, r2 - adds r1, 0x60 - ldrb r0, [r7] - lsls r0, 9 - adds r0, r5 - ldrb r0, [r0] - ands r3, r0 - lsrs r3, 4 - ldrb r0, [r1] - orrs r3, r0 - strb r3, [r1] - ldrb r0, [r7] - eors r4, r0 - mov r2, r12 - ldr r0, [r2] - lsls r1, r4, 1 - adds r1, r4 - adds r1, r0 - adds r1, 0x62 - ldrb r0, [r7] - lsls r0, 9 - adds r0, r6 - ldrb r0, [r0] - strb r0, [r1] - b _0804DA36 - .pool -_0804DA14: - movs r0, 0x80 - lsls r0, 15 - ands r1, r0 - cmp r1, 0 - beq _0804DA30 - ldrb r0, [r7] - mov r3, r12 - ldr r1, [r3] - adds r1, r0, r1 - adds r1, 0x5C - ldrb r1, [r1] - bl sub_80571DC - b _0804DA36 -_0804DA30: - ldrb r0, [r7] - bl sub_803BDA0 -_0804DA36: - ldr r1, =0x02022f58 - movs r5, 0xFD - strb r5, [r1] - movs r0, 0x6 - strb r0, [r1, 0x1] - ldr r4, =0x02024084 - ldr r3, =0x0202420b - ldrb r0, [r3] - movs r2, 0x58 - muls r0, r2 - adds r0, r4 - ldrh r0, [r0] - strb r0, [r1, 0x2] - ldrb r0, [r3] - muls r0, r2 - adds r0, r4 - ldrh r0, [r0] - lsrs r0, 8 - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r2, =0x02022f68 - strb r5, [r2] - movs r0, 0x7 - strb r0, [r2, 0x1] - ldr r3, =0x02024064 - ldrb r0, [r3] - strb r0, [r2, 0x2] - ldr r1, =0x02023864 - ldrb r0, [r3] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2, 0x3] - movs r0, 0x1 - negs r0, r0 - strb r0, [r2, 0x4] -_0804DA82: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x3 - str r0, [r1] -_0804DA8A: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk51_cmd51 - - thumb_func_start atk52_cmd52 -atk52_cmd52: @ 804DAAC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - ldr r0, =0x02024214 - mov r9, r0 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r4, =0x02024064 - strb r0, [r4] - ldrb r0, [r4] - bl sub_803FA70 - ldr r1, =0x02024280 - mov r8, r1 - ldr r1, =gUnknown_0832A328 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - lsls r1, 28 - mov r2, r8 - ldr r0, [r2] - bics r0, r1 - str r0, [r2] - ldr r2, =0x0202437c - ldrb r0, [r4] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r2, [r1] - movs r0, 0x41 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldrb r0, [r4] - bl battle_side_get_owner - ldr r5, =0x0202428e - lsls r0, 24 - lsrs r0, 23 - adds r0, r5 - ldrh r1, [r0] - movs r7, 0x80 - lsls r7, 2 - mov r10, r7 - mov r0, r10 - ands r0, r1 - cmp r0, 0 - beq _0804DB1C - b _0804DC30 -_0804DB1C: - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 23 - adds r0, r5 - ldrh r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _0804DB34 - b _0804DC30 -_0804DB34: - ldr r7, =0x02024084 - ldrb r2, [r4] - movs r6, 0x58 - adds r0, r2, 0 - muls r0, r6 - adds r1, r0, r7 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0x2 - beq _0804DC30 - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0x2 - beq _0804DC30 - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x1A - beq _0804DC30 - adds r0, r2, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 23 - adds r0, r5 - ldrh r2, [r0] - mov r1, r10 - orrs r1, r2 - strh r1, [r0] - ldrb r0, [r4] - adds r2, r0, 0 - muls r2, r6 - adds r0, r7, 0 - adds r0, 0x50 - adds r2, r0 - ldr r0, [r2] - ldr r1, =0xfdffffff - ands r0, r1 - str r0, [r2] - mov r1, r8 - ldr r0, [r1] - movs r2, 0x41 - negs r2, r2 - ands r0, r2 - str r0, [r1] - ldrb r0, [r4] - bl battle_side_get_owner - ldr r2, =0x02024294 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r0, [r1, 0xA] - movs r1, 0x5 - subs r1, r0 - lsls r1, 25 - lsrs r1, 24 - ldr r5, =0x020241f0 - ldrb r0, [r4] - muls r0, r6 - adds r0, r7 - ldrh r0, [r0, 0x2C] - bl __divsi3 - str r0, [r5] - cmp r0, 0 - bne _0804DBC8 - movs r0, 0x1 - str r0, [r5] -_0804DBC8: - ldr r0, =0x02024474 - ldrb r1, [r4] - strb r1, [r0, 0x17] - bl b_movescr_stack_push_cursor - mov r7, r9 - ldr r0, [r7] - ldrb r0, [r0, 0x1] - cmp r0, 0 - bne _0804DC14 - ldr r0, =gUnknown_082DAE90 - str r0, [r7] - b _0804DD8E - .pool -_0804DC14: - cmp r0, 0x1 - bne _0804DC24 - ldr r0, =gUnknown_082DAE59 - mov r1, r9 - str r0, [r1] - b _0804DD8E - .pool -_0804DC24: - ldr r0, =gUnknown_082DAEC7 - mov r2, r9 - str r0, [r2] - b _0804DD8E - .pool -_0804DC30: - ldr r2, =0x02024084 - ldr r1, =0x02024064 - ldrb r3, [r1] - movs r0, 0x58 - muls r0, r3 - adds r0, r2 - adds r0, 0x20 - ldrb r0, [r0] - adds r5, r1, 0 - ldr r4, =0x020242bc - cmp r0, 0x36 - bne _0804DC5E - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r2, r0, r4 - ldrb r1, [r2, 0x18] - lsls r0, r1, 30 - cmp r0, 0 - blt _0804DC5E - movs r0, 0x1 - orrs r0, r1 - strb r0, [r2, 0x18] -_0804DC5E: - ldrb r0, [r5] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r2, [r1, 0x18] - movs r0, 0x3 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x18] - ldrb r1, [r5] - movs r0, 0 - str r0, [sp] - movs r2, 0 - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _0804DC88 - b _0804DD8E -_0804DC88: - ldrb r1, [r5] - movs r0, 0 - movs r2, 0 - bl berry_effects_maybe - lsls r0, 24 - cmp r0, 0 - bne _0804DD8E - ldrb r0, [r5] - bl battle_side_get_owner - ldr r1, =0x0202428e - lsls r0, 24 - lsrs r0, 23 - adds r0, r1 - ldrh r2, [r0] - ldr r1, =0x0000fdff - ands r1, r2 - strh r1, [r0] - movs r4, 0 - ldr r0, =0x0202406c - ldrb r7, [r0] - cmp r4, r7 - bge _0804DCD8 - ldr r6, =0x0202407e - adds r1, r5, 0 - ldr r5, =0x0202407a - movs r3, 0xC - adds r2, r0, 0 -_0804DCC2: - adds r0, r4, r6 - ldrb r0, [r0] - ldrb r7, [r1] - cmp r0, r7 - bne _0804DCD0 - adds r0, r4, r5 - strb r3, [r0] -_0804DCD0: - adds r4, 0x1 - ldrb r0, [r2] - cmp r4, r0 - blt _0804DCC2 -_0804DCD8: - movs r4, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - bge _0804DD0C - ldr r6, =0x0202449c - ldr r5, =0x02024084 -_0804DCE6: - lsls r0, r4, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 23 - adds r0, 0xA8 - ldr r1, [r6] - adds r1, r0 - movs r0, 0x58 - muls r0, r4 - adds r0, r5 - ldrh r0, [r0, 0x28] - strh r0, [r1] - adds r4, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _0804DCE6 -_0804DD0C: - ldr r0, =0x02024214 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r5, r0, 0 - cmp r1, 0x5 - bne _0804DD88 - ldr r0, =0x02024280 - ldr r0, [r0] - lsrs r4, r0, 28 - ldr r1, =0x0202420d - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r2, =gUnknown_0832A328 - b _0804DD6E - .pool -_0804DD60: - ldr r0, =0x0202406c - ldrb r3, [r1] - ldrb r0, [r0] - cmp r3, r0 - bcs _0804DD88 - adds r0, r3, 0x1 - strb r0, [r1] -_0804DD6E: - ldrb r0, [r1] - lsls r0, 2 - adds r0, r2 - ldr r3, [r0] - adds r0, r4, 0 - ands r0, r3 - cmp r0, 0 - beq _0804DD60 - ldr r0, =0x02024210 - ldrb r0, [r0] - ands r0, r3 - cmp r0, 0 - bne _0804DD60 -_0804DD88: - ldr r0, [r5] - adds r0, 0x2 - str r0, [r5] -_0804DD8E: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk52_cmd52 - - thumb_func_start sub_804DDA8 -sub_804DDA8: @ 804DDA8 - push {r4,r5,lr} - ldr r5, =0x02024214 - ldr r0, [r5] - ldrb r0, [r0, 0x1] - bl battle_get_side_with_given_state - ldr r4, =0x02024064 - strb r0, [r4] - movs r0, 0 - bl dp01_build_cmdbuf_x08_8_8_8 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r5] - adds r0, 0x2 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_804DDA8 - - thumb_func_start atk54_802511C -atk54_802511C: @ 804DDD8 - push {r4,r5,lr} - ldr r5, =0x02024064 - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r5] - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r1, [r0, 0x1] - ldrb r0, [r0, 0x2] - lsls r0, 8 - orrs r1, r0 - movs r0, 0 - bl dp01_build_cmdbuf_x2B_aa_0 - ldrb r0, [r5] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r4] - adds r0, 0x3 - str r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk54_802511C - - thumb_func_start sub_804DE14 -sub_804DE14: @ 804DE14 - push {r4,r5,lr} - ldr r5, =0x02024064 - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r5] - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r1, [r0, 0x1] - ldrb r0, [r0, 0x2] - lsls r0, 8 - orrs r1, r0 - movs r0, 0 - movs r2, 0 - bl sub_8034300 - ldrb r0, [r5] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r4] - adds r0, 0x3 - str r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_804DE14 - - thumb_func_start atk56_8025194 -atk56_8025194: @ 804DE50 - push {r4,r5,lr} - ldr r5, =0x02024214 - ldr r0, [r5] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r4, =0x02024064 - strb r0, [r4] - movs r0, 0 - bl dp01_build_cmdbuf_x2D_2D_2D_2D - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r5] - adds r0, 0x2 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk56_8025194 - - thumb_func_start atk57_80251C4_flee -atk57_80251C4_flee: @ 804DE80 - push {r4,lr} - movs r0, 0 - bl battle_get_side_with_given_state - ldr r4, =0x02024064 - strb r0, [r4] - ldr r0, =0x0202433a - ldrb r1, [r0] - movs r0, 0 - bl dp01_build_cmdbuf_x37_a - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk57_80251C4_flee - - thumb_func_start atk58_cmd58 -atk58_cmd58: @ 804DEB8 - push {r4,r5,lr} - ldr r5, =0x02024214 - ldr r0, [r5] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r4, =0x02024064 - strb r0, [r4] - movs r0, 0 - movs r1, 0x1 - bl dp01_build_cmdbuf_x06_a - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r5] - adds r0, 0x2 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk58_cmd58 - - thumb_func_start atk59_8025230 -atk59_8025230: @ 804DEEC - push {r4-r7,lr} - ldr r0, =0x02024214 - ldr r2, [r0] - ldrb r6, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r6, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r6, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r6, r0 - ldrb r4, [r2, 0x5] - ldrb r0, [r2, 0x6] - lsls r0, 8 - orrs r4, r0 - ldrb r0, [r2, 0x7] - lsls r0, 16 - orrs r4, r0 - ldrb r0, [r2, 0x8] - lsls r0, 24 - orrs r4, r0 - ldr r0, =0x0202449c - ldr r0, [r0] - ldrb r1, [r0, 0x10] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldrb r1, [r2, 0x9] - bl sub_8069318 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =0x0000fffe - cmp r5, r0 - bne _0804DF56 - adds r7, r5, 0 -_0804DF3A: - ldr r0, =0x0202449c - ldr r0, [r0] - ldrb r1, [r0, 0x10] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0 - bl sub_8069318 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, r7 - beq _0804DF3A -_0804DF56: - cmp r5, 0 - bne _0804DF70 - ldr r0, =0x02024214 - str r4, [r0] - b _0804E018 - .pool -_0804DF70: - ldr r0, =0x0000ffff - cmp r5, r0 - bne _0804DF88 - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0xA - str r0, [r1] - b _0804E018 - .pool -_0804DF88: - movs r0, 0 - bl battle_get_side_with_given_state - ldr r1, =0x02024064 - strb r0, [r1] - ldr r2, =0x0202406e - ldrb r3, [r1] - lsls r0, r3, 1 - adds r0, r2 - ldr r1, =0x0202449c - ldr r1, [r1] - ldrh r0, [r0] - ldrb r1, [r1, 0x10] - cmp r0, r1 - bne _0804DFC8 - ldr r4, =0x02024084 - movs r0, 0x58 - adds r2, r3, 0 - muls r2, r0 - adds r0, r4, 0 - adds r0, 0x50 - adds r0, r2, r0 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 14 - ands r0, r1 - cmp r0, 0 - bne _0804DFC8 - adds r0, r2, r4 - adds r1, r5, 0 - bl sub_80691B0 -_0804DFC8: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0804E014 - movs r0, 0x2 - bl battle_get_side_with_given_state - ldr r1, =0x02024064 - strb r0, [r1] - ldr r2, =0x0202406e - ldrb r3, [r1] - lsls r0, r3, 1 - adds r0, r2 - ldr r1, =0x0202449c - ldr r1, [r1] - ldrh r0, [r0] - ldrb r1, [r1, 0x10] - cmp r0, r1 - bne _0804E014 - ldr r4, =0x02024084 - movs r0, 0x58 - adds r2, r3, 0 - muls r2, r0 - adds r0, r4, 0 - adds r0, 0x50 - adds r0, r2, r0 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 14 - ands r0, r1 - cmp r0, 0 - bne _0804E014 - adds r0, r2, r4 - adds r1, r5, 0 - bl sub_80691B0 -_0804E014: - ldr r0, =0x02024214 - str r6, [r0] -_0804E018: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk59_8025230 - - thumb_func_start sub_804E038 -sub_804E038: @ 804E038 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - ldr r0, =0x02024064 - movs r1, 0 - strb r1, [r0] - ldr r0, =0x02024474 - ldrb r1, [r0, 0x1F] - adds r2, r0, 0 - cmp r1, 0x6 - bls _0804E052 - b _0804E3B8 -_0804E052: - lsls r0, r1, 2 - ldr r1, =_0804E068 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0804E068: - .4byte _0804E084 - .4byte _0804E0BC - .4byte _0804E162 - .4byte _0804E1B8 - .4byte _0804E1E4 - .4byte _0804E38C - .4byte _0804E3AC -_0804E084: - movs r4, 0 - str r4, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - ldr r0, =gUnknown_085CCABB - movs r1, 0xC - bl battle_show_message_maybe - ldr r1, =0x02024474 - ldrb r0, [r1, 0x1F] - adds r0, 0x1 - strb r0, [r1, 0x1F] - ldr r0, =0x02024332 - strb r4, [r0, 0x1] - movs r0, 0 - bl sub_8056B74 - b _0804E3B8 - .pool -_0804E0BC: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0804E0E4 - ldr r4, =0x02024332 - ldrb r0, [r4, 0x1] - cmp r0, 0 - beq _0804E0E4 - movs r0, 0x5 - bl audio_play - ldrb r0, [r4, 0x1] - bl sub_8056BAC - movs r0, 0 - strb r0, [r4, 0x1] - bl sub_8056B74 -_0804E0E4: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0804E10C - ldr r4, =0x02024332 - ldrb r0, [r4, 0x1] - cmp r0, 0 - bne _0804E10C - movs r0, 0x5 - bl audio_play - ldrb r0, [r4, 0x1] - bl sub_8056BAC - movs r0, 0x1 - strb r0, [r4, 0x1] - bl sub_8056B74 -_0804E10C: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r5, 0x1 - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _0804E150 - movs r0, 0x5 - bl audio_play - ldr r0, =0x02024332 - ldrb r4, [r0, 0x1] - cmp r4, 0 - bne _0804E20A - str r5, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - movs r0, 0x1 - negs r0, r0 - str r4, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - b _0804E192 - .pool -_0804E150: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _0804E15A - b _0804E3B8 -_0804E15A: - movs r0, 0x5 - bl audio_play - b _0804E20A -_0804E162: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0804E170 - b _0804E3B8 -_0804E170: - bl FreeAllWindowBuffers - ldr r0, =0x020244ec - ldr r1, =0x0202449c - ldr r1, [r1] - ldrb r1, [r1, 0x10] - ldr r2, =0x020244e9 - ldrb r2, [r2] - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldr r3, =sub_80A92F8 - ldr r4, =0x020244e2 - ldrh r4, [r4] - str r4, [sp] - bl sub_81BFA38 -_0804E192: - ldr r1, =0x02024474 - ldrb r0, [r1, 0x1F] - adds r0, 0x1 - strb r0, [r1, 0x1F] - b _0804E3B8 - .pool -_0804E1B8: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0804E1C6 - b _0804E3B8 -_0804E1C6: - ldr r0, =0x030022c0 - ldr r1, [r0, 0x4] - ldr r0, =sub_8038420 - cmp r1, r0 - beq _0804E1D2 - b _0804E3B8 -_0804E1D2: - ldrb r0, [r2, 0x1F] - adds r0, 0x1 - b _0804E3B6 - .pool -_0804E1E4: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0804E1F2 - b _0804E3B8 -_0804E1F2: - ldr r0, =0x030022c0 - ldr r1, [r0, 0x4] - ldr r0, =sub_8038420 - cmp r1, r0 - beq _0804E1FE - b _0804E3B8 -_0804E1FE: - bl sub_81C1B94 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x4 - bne _0804E224 -_0804E20A: - ldr r1, =0x02024474 - movs r0, 0x5 - strb r0, [r1, 0x1F] - b _0804E3B8 - .pool -_0804E224: - ldr r6, =0x0202449c - ldr r0, [r6] - ldrb r0, [r0, 0x10] - movs r1, 0x64 - mov r8, r1 - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - ldr r7, =0x020244ec - adds r0, r7 - adds r1, r5, 0 - adds r1, 0xD - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - bl sub_806E804 - cmp r0, 0 - beq _0804E274 - ldr r0, =0x0000013f - ldr r1, =0x02024064 - ldrb r1, [r1] - bl b_std_message - ldr r1, =0x02024474 - movs r0, 0x6 - strb r0, [r1, 0x1F] - b _0804E3B8 - .pool -_0804E274: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - ldr r1, =0x02022f68 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x2 - strb r0, [r1, 0x1] - strb r4, [r1, 0x2] - lsrs r0, r4, 8 - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r0, [r6] - ldrb r0, [r0, 0x10] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r7 - adds r1, r5, 0 - bl sub_806B9A8 - ldr r0, [r6] - ldrb r0, [r0, 0x10] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r7 - ldr r7, =0x020244e2 - ldrh r1, [r7] - adds r2, r5, 0 - bl sub_80691F4 - ldr r0, =0x0202406e - ldr r1, [r6] - ldrh r0, [r0] - ldrb r1, [r1, 0x10] - cmp r0, r1 - bne _0804E30A - ldr r4, =0x02024084 - ldr r0, [r4, 0x50] - movs r1, 0x80 - lsls r1, 14 - ands r0, r1 - cmp r0, 0 - bne _0804E30A - ldr r0, =0x020242bc - ldrb r1, [r0, 0x18] - lsrs r1, 4 - ldr r2, =gUnknown_0832A328 - lsls r0, r5, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0804E30A - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_806B9E4 - ldrh r1, [r7] - adds r0, r4, 0 - adds r2, r5, 0 - bl sub_8069234 -_0804E30A: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0804E3B8 - ldr r2, =0x0202406e - ldr r0, =0x0202449c - ldr r1, [r0] - ldrh r0, [r2, 0x4] - ldrb r1, [r1, 0x10] - cmp r0, r1 - bne _0804E3B8 - ldr r4, =0x02024084 - movs r1, 0x80 - lsls r1, 1 - adds r0, r4, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 14 - ands r0, r1 - cmp r0, 0 - bne _0804E3B8 - ldr r0, =0x020242bc - adds r0, 0x50 - ldrb r1, [r0] - lsrs r1, 4 - ldr r2, =gUnknown_0832A328 - lsls r0, r5, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0804E3B8 - adds r4, 0xB0 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_806B9E4 - ldr r0, =0x020244e2 - ldrh r1, [r0] - adds r0, r4, 0 - adds r2, r5, 0 - bl sub_8069234 - b _0804E3B8 - .pool -_0804E38C: - movs r0, 0x1 - str r0, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _0804E3B8 - .pool -_0804E3AC: - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0804E3B8 - movs r0, 0x2 -_0804E3B6: - strb r0, [r2, 0x1F] -_0804E3B8: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_804E038 - - thumb_func_start atk5B_80256E0 -atk5B_80256E0: @ 804E3C8 - push {r4,r5,lr} - sub sp, 0x4 - ldr r5, =0x02024474 - ldrb r4, [r5, 0x1F] - cmp r4, 0 - beq _0804E3E0 - cmp r4, 0x1 - beq _0804E410 - b _0804E4FA - .pool -_0804E3E0: - str r4, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - ldr r0, =gUnknown_085CCABB - movs r1, 0xC - bl battle_show_message_maybe - ldrb r0, [r5, 0x1F] - adds r0, 0x1 - strb r0, [r5, 0x1F] - ldr r0, =0x02024332 - strb r4, [r0, 0x1] - movs r0, 0 - bl sub_8056B74 - b _0804E4FA - .pool -_0804E410: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0804E438 - ldr r4, =0x02024332 - ldrb r0, [r4, 0x1] - cmp r0, 0 - beq _0804E438 - movs r0, 0x5 - bl audio_play - ldrb r0, [r4, 0x1] - bl sub_8056BAC - movs r0, 0 - strb r0, [r4, 0x1] - bl sub_8056B74 -_0804E438: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0804E460 - ldr r4, =0x02024332 - ldrb r0, [r4, 0x1] - cmp r0, 0 - bne _0804E460 - movs r0, 0x5 - bl audio_play - ldrb r0, [r4, 0x1] - bl sub_8056BAC - movs r0, 0x1 - strb r0, [r4, 0x1] - bl sub_8056B74 -_0804E460: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r4, 0x1 - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _0804E4C4 - movs r0, 0x5 - bl audio_play - ldr r0, =0x02024332 - ldrb r0, [r0, 0x1] - cmp r0, 0 - beq _0804E4A4 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0804E4AC - .pool -_0804E4A4: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_0804E4AC: - movs r0, 0x1 - str r0, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - b _0804E4FA - .pool -_0804E4C4: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0804E4FA - movs r0, 0x5 - bl audio_play - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - str r4, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C -_0804E4FA: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk5B_80256E0 - - thumb_func_start atk5C_cmd5c -atk5C_cmd5c: @ 804E508 - push {r4,lr} - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r2, =0x02024064 - strb r0, [r2] - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - bne _0804E58C - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 1 - ands r0, r1 - cmp r0, 0 - beq _0804E55A - ldr r1, =0x02024084 - ldrb r2, [r2] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _0804E55A - ldr r0, =0x020242bc - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0xA] - cmp r0, 0 - bne _0804E58C -_0804E55A: - movs r0, 0 - bl dp01_build_cmdbuf_x29_29_29_29 - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] - b _0804E592 - .pool -_0804E58C: - ldr r0, [r4] - adds r0, 0x2 - str r0, [r4] -_0804E592: - pop {r4} - pop {r0} - bx r0 - thumb_func_end atk5C_cmd5c - - thumb_func_start sub_804E598 -sub_804E598: @ 804E598 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 16 - lsrs r6, r0, 16 - movs r7, 0 - movs r5, 0 - movs r0, 0x80 - lsls r0, 3 - cmp r6, r0 - bne _0804E5D8 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r0, [r0] - adds r0, 0x94 - ldrb r2, [r0] - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x4A - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - muls r0, r2 - b _0804E6CA - .pool -_0804E5D8: - ldr r0, =gTrainers - lsls r2, r6, 2 - adds r1, r2, r6 - lsls r1, 3 - adds r4, r1, r0 - ldrb r3, [r4] - mov r12, r0 - cmp r3, 0x1 - beq _0804E62E - cmp r3, 0x1 - bgt _0804E5F8 - cmp r3, 0 - beq _0804E602 - b _0804E644 - .pool -_0804E5F8: - cmp r3, 0x2 - beq _0804E618 - cmp r3, 0x3 - beq _0804E62E - b _0804E644 -_0804E602: - mov r0, r12 - adds r0, 0x24 - adds r0, r1, r0 - ldr r1, [r0] - adds r0, r4, 0 - adds r0, 0x20 - ldrb r0, [r0] - lsls r0, 3 - adds r0, r1 - subs r0, 0x8 - b _0804E642 -_0804E618: - mov r0, r12 - adds r0, 0x24 - adds r0, r1, r0 - ldr r1, [r0] - adds r0, r4, 0 - adds r0, 0x20 - ldrb r0, [r0] - lsls r0, 3 - adds r0, r1 - subs r0, 0x8 - b _0804E642 -_0804E62E: - mov r0, r12 - adds r0, 0x24 - adds r0, r1, r0 - ldr r1, [r0] - adds r0, r4, 0 - adds r0, 0x20 - ldrb r0, [r0] - lsls r0, 4 - adds r0, r1 - subs r0, 0x10 -_0804E642: - ldrb r5, [r0, 0x2] -_0804E644: - ldr r1, =gUnknown_0831AEB8 - lsls r0, r7, 2 - adds r4, r0, r1 - ldrb r3, [r4] - ldr r0, =0x0202449c - mov r8, r0 - mov r9, r1 - ldr r1, =0x02022fec - mov r10, r1 - cmp r3, 0xFF - beq _0804E67A - adds r0, r2, r6 - lsls r0, 3 - add r0, r12 - ldrb r1, [r0, 0x1] - cmp r3, r1 - beq _0804E67A - adds r2, r0, 0 - adds r0, r4, 0 -_0804E66A: - adds r0, 0x4 - adds r7, 0x1 - ldrb r1, [r0] - cmp r1, 0xFF - beq _0804E67A - ldrb r3, [r2, 0x1] - cmp r1, r3 - bne _0804E66A -_0804E67A: - mov r0, r10 - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 8 - ands r0, r1 - cmp r0, 0 - bne _0804E6B4 - movs r0, 0x1 - ands r1, r0 - cmp r1, 0 - beq _0804E6B4 - mov r3, r8 - ldr r0, [r3] - adds r0, 0x4A - ldrb r0, [r0] - lsls r0, 2 - adds r1, r5, 0 - muls r1, r0 - lsls r0, r7, 2 - add r0, r9 - ldrb r0, [r0, 0x1] - lsls r0, 1 - b _0804E6C8 - .pool -_0804E6B4: - mov r1, r8 - ldr r0, [r1] - adds r0, 0x4A - ldrb r0, [r0] - lsls r0, 2 - adds r1, r5, 0 - muls r1, r0 - lsls r0, r7, 2 - add r0, r9 - ldrb r0, [r0, 0x1] -_0804E6C8: - muls r0, r1 -_0804E6CA: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_804E598 - - thumb_func_start sub_804E6D8 -sub_804E6D8: @ 804E6D8 - push {r4,lr} - ldr r0, =0x02038bca - ldrh r0, [r0] - bl sub_804E598 - adds r4, r0, 0 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _0804E6FC - ldr r0, =0x02038bcc - ldrh r0, [r0] - bl sub_804E598 - adds r4, r0 -_0804E6FC: - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r1, 0x92 - lsls r1, 3 - adds r0, r1 - adds r1, r4, 0 - bl add_money - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x1 - strb r0, [r1, 0x1] - movs r0, 0x4 - strb r0, [r1, 0x2] - movs r0, 0x5 - strb r0, [r1, 0x3] - strb r4, [r1, 0x4] - movs r0, 0xFF - lsls r0, 8 - ands r0, r4 - lsrs r0, 8 - strb r0, [r1, 0x5] - movs r0, 0xFF - lsls r0, 16 - ands r0, r4 - lsrs r0, 16 - strb r0, [r1, 0x6] - lsrs r0, r4, 24 - strb r0, [r1, 0x7] - movs r0, 0xFF - strb r0, [r1, 0x8] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_804E6D8 - - thumb_func_start atk5E_8025A70 -atk5E_8025A70: @ 804E764 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r6, =0x02024064 - strb r0, [r6] - ldr r5, =0x02024332 - ldrb r0, [r5] - mov r8, r4 - cmp r0, 0 - beq _0804E794 - cmp r0, 0x1 - beq _0804E7AC - b _0804E800 - .pool -_0804E794: - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl dp01_build_cmdbuf_x00_a_b_0 - ldrb r0, [r6] - bl dp01_battle_side_mark_buffer_for_execution - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - b _0804E800 -_0804E7AC: - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0804E800 - ldrb r0, [r6] - lsls r0, 9 - ldr r1, =0x02023868 - adds r0, r1 - mov r12, r0 - movs r2, 0 - adds r4, r6, 0 - movs r5, 0x58 - ldr r6, =0x020240a8 - adds r7, r6, 0 - subs r7, 0x18 - mov r3, r12 - adds r3, 0xC -_0804E7CE: - lsls r1, r2, 1 - ldrb r0, [r4] - muls r0, r5 - adds r1, r0 - adds r1, r7 - ldrh r0, [r3] - strh r0, [r1] - ldrb r0, [r4] - adds r1, r0, 0 - muls r1, r5 - adds r1, r2, r1 - adds r1, r6 - mov r0, r12 - adds r0, 0x24 - adds r0, r2 - ldrb r0, [r0] - strb r0, [r1] - adds r3, 0x2 - adds r2, 0x1 - cmp r2, 0x3 - ble _0804E7CE - mov r1, r8 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] -_0804E800: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk5E_8025A70 - - thumb_func_start atk5F_8025B24 -atk5F_8025B24: @ 804E818 - push {lr} - ldr r0, =0x02024064 - ldr r2, =0x0202420b - ldrb r3, [r2] - strb r3, [r0] - ldr r1, =0x0202420c - ldrb r0, [r1] - strb r0, [r2] - strb r3, [r1] - ldr r2, =0x02024280 - ldr r1, [r2] - movs r3, 0x80 - lsls r3, 5 - adds r0, r1, 0 - ands r0, r3 - cmp r0, 0 - beq _0804E854 - ldr r0, =0xffffefff - ands r1, r0 - b _0804E856 - .pool -_0804E854: - orrs r1, r3 -_0804E856: - str r1, [r2] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end atk5F_8025B24 - - thumb_func_start atk60_cmd60 -atk60_cmd60: @ 804E868 - push {lr} - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0804E882 - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - bl sav12_xor_increment -_0804E882: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end atk60_cmd60 - - thumb_func_start atk61_8025BA4 -atk61_8025BA4: @ 804E898 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x30 - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0804E94C - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r1, =0x02024064 - strb r0, [r1] - ldrb r0, [r1] - bl battle_side_get_owner - lsls r0, 24 - ldr r1, =0x02024744 - mov r8, r1 - cmp r0, 0 - bne _0804E8CA - ldr r0, =0x020244ec - mov r8, r0 -_0804E8CA: - movs r7, 0 - add r6, sp, 0x4 - mov r5, sp -_0804E8D0: - movs r0, 0x64 - muls r0, r7 - mov r1, r8 - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - beq _0804E8F4 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - bne _0804E914 -_0804E8F4: - ldr r0, =0x0000ffff - strh r0, [r5] - movs r0, 0 - b _0804E926 - .pool -_0804E914: - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - strh r0, [r5] - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr -_0804E926: - str r0, [r6] - adds r6, 0x8 - adds r5, 0x8 - adds r7, 0x1 - cmp r7, 0x5 - ble _0804E8D0 - movs r0, 0 - mov r1, sp - movs r2, 0x1 - bl dp01_build_cmdbuf_x30_TODO - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] -_0804E94C: - add sp, 0x30 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk61_8025BA4 - - thumb_func_start atk62_08025C6C -atk62_08025C6C: @ 804E960 - push {r4,r5,lr} - ldr r5, =0x02024214 - ldr r0, [r5] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r4, =0x02024064 - strb r0, [r4] - movs r0, 0 - bl dp01_build_cmdbuf_x31_31_31_31 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r5] - adds r0, 0x2 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk62_08025C6C - - thumb_func_start atk63_jumptoattack -atk63_jumptoattack: @ 804E990 - push {r4,lr} - ldr r0, =0x02024214 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r4, r0, 0 - cmp r1, 0 - beq _0804E9B4 - ldr r0, =0x020241ea - ldr r1, =0x020241ee - ldrh r1, [r1] - strh r1, [r0] - b _0804E9C2 - .pool -_0804E9B4: - ldr r2, =0x020241ec - ldr r1, =0x020241ea - ldr r0, =0x020241ee - ldrh r0, [r0] - strh r0, [r1] - strh r0, [r2] - adds r0, r1, 0 -_0804E9C2: - ldr r3, =gUnknown_082D86A8 - ldr r2, =gBattleMoves - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk63_jumptoattack - - thumb_func_start atk64_statusanimation -atk64_statusanimation: @ 804E9F4 - push {r4,lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0804EA5C - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r4, =0x02024064 - strb r0, [r4] - ldr r1, =0x020242ac - ldrb r2, [r4] - lsls r0, r2, 2 - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x000400c0 - ands r0, r1 - cmp r0, 0 - bne _0804EA54 - ldr r0, =0x020242bc - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0xA] - cmp r0, 0 - bne _0804EA54 - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0804EA54 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r2 - adds r1, 0x4C - adds r0, r1 - ldr r2, [r0] - movs r0, 0 - movs r1, 0 - bl dp01_build_cmdbuf_x1B_aaaa_b - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0804EA54: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] -_0804EA5C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk64_statusanimation - - thumb_func_start atk65_8025D90 -atk65_8025D90: @ 804EA84 - push {r4,r5,lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0804EB04 - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r5, =0x02024064 - strb r0, [r5] - ldr r1, [r4] - ldrb r3, [r1, 0x2] - ldrb r0, [r1, 0x3] - lsls r0, 8 - orrs r3, r0 - ldrb r0, [r1, 0x4] - lsls r0, 16 - orrs r3, r0 - ldrb r0, [r1, 0x5] - lsls r0, 24 - orrs r3, r0 - ldr r1, =0x020242ac - ldrb r2, [r5] - lsls r0, r2, 2 - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x000400c0 - ands r0, r1 - cmp r0, 0 - bne _0804EAFC - ldr r0, =0x020242bc - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0xA] - cmp r0, 0 - bne _0804EAFC - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0804EAFC - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r2, [r0] - ands r2, r3 - movs r0, 0 - movs r1, 0x1 - bl dp01_build_cmdbuf_x1B_aaaa_b - ldrb r0, [r5] - bl dp01_battle_side_mark_buffer_for_execution -_0804EAFC: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x6 - str r0, [r1] -_0804EB04: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk65_8025D90 - - thumb_func_start atk66_8025E38 -atk66_8025E38: @ 804EB2C - push {r4,r5,lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0804EB9E - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r5, =0x02024064 - strb r0, [r5] - ldr r4, [r4] - ldrb r2, [r4, 0x3] - ldrb r0, [r4, 0x4] - lsls r0, 8 - orrs r2, r0 - ldrb r0, [r4, 0x5] - lsls r0, 16 - orrs r2, r0 - ldrb r0, [r4, 0x6] - lsls r0, 24 - orrs r2, r0 - ldr r1, =0x020242ac - ldrb r3, [r5] - lsls r0, r3, 2 - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x000400c0 - ands r0, r1 - cmp r0, 0 - bne _0804EB96 - ldr r0, =0x020242bc - lsls r1, r3, 3 - subs r1, r3 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0xA] - cmp r0, 0 - bne _0804EB96 - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0804EB96 - ldrb r1, [r4, 0x2] - movs r0, 0 - bl dp01_build_cmdbuf_x1B_aaaa_b - ldrb r0, [r5] - bl dp01_battle_side_mark_buffer_for_execution -_0804EB96: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x7 - str r0, [r1] -_0804EB9E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk66_8025E38 - - thumb_func_start atk67_8025ECC -atk67_8025ECC: @ 804EBC0 - push {r4,r5,lr} - sub sp, 0x4 - ldr r5, =0x02024332 - ldrb r4, [r5] - cmp r4, 0 - beq _0804EBD8 - cmp r4, 0x1 - beq _0804EC04 - b _0804EC96 - .pool -_0804EBD8: - str r4, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - ldr r0, =gUnknown_085CCABB - movs r1, 0xC - bl battle_show_message_maybe - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - strb r4, [r5, 0x1] - movs r0, 0 - bl sub_8056B74 - b _0804EC96 - .pool -_0804EC04: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0804EC2A - ldrb r0, [r5, 0x1] - cmp r0, 0 - beq _0804EC2A - movs r0, 0x5 - bl audio_play - ldrb r0, [r5, 0x1] - bl sub_8056BAC - movs r0, 0 - strb r0, [r5, 0x1] - bl sub_8056B74 -_0804EC2A: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0804EC52 - ldr r4, =0x02024332 - ldrb r0, [r4, 0x1] - cmp r0, 0 - bne _0804EC52 - movs r0, 0x5 - bl audio_play - ldrb r0, [r4, 0x1] - bl sub_8056BAC - movs r0, 0x1 - strb r0, [r4, 0x1] - bl sub_8056B74 -_0804EC52: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0804EC70 - ldr r0, =0x02024332 - movs r4, 0x1 - strb r4, [r0, 0x1] - b _0804EC7A - .pool -_0804EC70: - movs r4, 0x1 - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _0804EC96 -_0804EC7A: - movs r0, 0x5 - bl audio_play - str r4, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] -_0804EC96: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk67_8025ECC - - thumb_func_start sub_804ECA4 -sub_804ECA4: @ 804ECA4 - push {r4,r5,lr} - movs r1, 0 - ldr r2, =0x0202406c - ldr r5, =0x02024214 - ldrb r0, [r2] - cmp r1, r0 - bge _0804ECC2 - ldr r4, =0x0202407a - movs r3, 0xC -_0804ECB6: - adds r0, r1, r4 - strb r3, [r0] - adds r1, 0x1 - ldrb r0, [r2] - cmp r1, r0 - blt _0804ECB6 -_0804ECC2: - ldr r0, [r5] - adds r0, 0x1 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_804ECA4 - - thumb_func_start atk69_8025FE0 -atk69_8025FE0: @ 804ECDC - push {r4-r7,lr} - ldr r7, =0x02024084 - ldr r6, =0x0202420c - ldrb r2, [r6] - movs r5, 0x58 - adds r0, r2, 0 - muls r0, r5 - adds r1, r0, r7 - ldrh r0, [r1, 0x2E] - cmp r0, 0xAF - bne _0804ED10 - ldr r1, =0x02024404 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r4, [r0, 0x7] - ldrb r6, [r0, 0x1A] - b _0804ED2A - .pool -_0804ED10: - ldrh r0, [r1, 0x2E] - bl itemid_get_x12 - lsls r0, 24 - lsrs r4, r0, 24 - ldrb r0, [r6] - muls r0, r5 - adds r0, r7 - ldrh r0, [r0, 0x2E] - bl itemid_get_quality - lsls r0, 24 - lsrs r6, r0, 24 -_0804ED2A: - ldr r1, =0x0202420f - ldr r5, =0x0202420c - ldrb r0, [r5] - strb r0, [r1] - cmp r4, 0x27 - bne _0804ED68 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, r6 - bcs _0804ED68 - ldrb r0, [r5] - movs r1, 0x27 - bl b_history__record_item_x12_of_player - ldr r2, =0x0202437c - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0] -_0804ED68: - ldr r2, =0x02024084 - ldr r3, =0x0202420c - ldrb r4, [r3] - movs r0, 0x58 - muls r0, r4 - adds r1, r2, 0 - adds r1, 0x50 - adds r0, r1 - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 17 - ands r1, r0 - adds r5, r2, 0 - cmp r1, 0 - bne _0804EE38 - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0x65 - beq _0804EDBA - ldr r0, =0x0202433c - lsls r1, r4, 4 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 30 - cmp r0, 0 - blt _0804EDBA - ldr r0, =0x0202437c - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1] - lsrs r0, 7 - cmp r0, 0 - beq _0804EE38 -_0804EDBA: - ldrb r0, [r3] - movs r4, 0x58 - muls r0, r4 - adds r0, r5 - ldrh r1, [r0, 0x28] - ldr r2, =0x020241f0 - ldr r0, [r2] - cmp r1, r0 - bgt _0804EE38 - subs r0, r1, 0x1 - str r0, [r2] - ldr r1, =0x0202433c - ldrb r3, [r3] - lsls r0, r3, 4 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - cmp r0, 0 - bge _0804EE10 - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] - b _0804EE38 - .pool -_0804EE10: - ldr r0, =0x0202437c - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1] - lsrs r0, 7 - cmp r0, 0 - beq _0804EE38 - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024208 - adds r0, r3, 0 - muls r0, r4 - adds r0, r5 - ldrh r0, [r0, 0x2E] - strh r0, [r1] -_0804EE38: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk69_8025FE0 - - thumb_func_start atk6A_stash_item_for_side -atk6A_stash_item_for_side: @ 804EE58 - push {r4-r6,lr} - sub sp, 0x4 - ldr r6, =0x02024214 - ldr r0, [r6] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r5, =0x02024064 - strb r0, [r5] - ldr r1, =0x0202449c - ldrb r4, [r5] - lsls r0, r4, 1 - adds r0, 0xB8 - ldr r1, [r1] - adds r1, r0 - ldr r2, =0x02024084 - movs r3, 0x58 - adds r0, r4, 0 - muls r0, r3 - adds r0, r2 - ldrh r0, [r0, 0x2E] - strh r0, [r1] - ldrb r0, [r5] - muls r0, r3 - adds r0, r2 - movs r1, 0 - strh r1, [r0, 0x2E] - ldrb r0, [r5] - muls r0, r3 - adds r2, 0x2E - adds r0, r2 - str r0, [sp] - movs r0, 0 - movs r1, 0x2 - movs r2, 0 - movs r3, 0x2 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r5] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r6] - adds r0, 0x2 - str r0, [r6] - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atk6A_stash_item_for_side - - thumb_func_start atk6B_end_battle_80261CC -atk6B_end_battle_80261CC: @ 804EEC8 - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x7 - strb r0, [r1, 0x1] - ldr r2, =0x0202420b - ldrb r0, [r2] - strb r0, [r1, 0x2] - ldr r3, =0x0202406e - ldrb r0, [r2] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end atk6B_end_battle_80261CC - - thumb_func_start atk6C_8026208 -atk6C_8026208: @ 804EF04 - push {r4,lr} - sub sp, 0x4 - ldr r0, =0x02024474 - ldrb r1, [r0, 0x1E] - adds r4, r0, 0 - cmp r1, 0 - bne _0804EF28 - bl sub_804F498 - cmp r0, 0 - beq _0804EF24 - movs r0, 0x3 - b _0804EF26 - .pool -_0804EF24: - movs r0, 0x1 -_0804EF26: - strb r0, [r4, 0x1E] -_0804EF28: - ldrb r0, [r4, 0x1E] - subs r0, 0x1 - cmp r0, 0x9 - bls _0804EF32 - b _0804F0F2 -_0804EF32: - lsls r0, 2 - ldr r1, =_0804EF40 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0804EF40: - .4byte _0804EF68 - .4byte _0804EF94 - .4byte _0804EFAC - .4byte _0804F000 - .4byte _0804F014 - .4byte _0804F02C - .4byte _0804F014 - .4byte _0804F04C - .4byte _0804F07C - .4byte _0804F0C0 -_0804EF68: - ldr r1, =0x02022e1e - movs r0, 0x60 - strh r0, [r1] - movs r0, 0x2 - movs r1, 0x7 - movs r2, 0 - bl SetBgAttribute - movs r0, 0x2 - bl ShowBg - bl sub_804F17C - ldr r1, =0x02024474 - movs r0, 0x2 - strb r0, [r1, 0x1E] - b _0804F0F2 - .pool -_0804EF94: - bl sub_804F1CC - lsls r0, 24 - cmp r0, 0 - beq _0804EFA0 - b _0804F0F2 -_0804EFA0: - ldr r1, =0x02024474 - movs r0, 0x3 - strb r0, [r1, 0x1E] - b _0804F0F2 - .pool -_0804EFAC: - ldr r1, =0x02022e18 - movs r0, 0 - strh r0, [r1] - ldr r1, =0x02022e1a - movs r2, 0x80 - lsls r2, 1 - adds r0, r2, 0 - strh r0, [r1] - movs r0, 0 - movs r1, 0x7 - movs r2, 0x1 - bl SetBgAttribute - movs r0, 0x1 - movs r1, 0x7 - movs r2, 0 - bl SetBgAttribute - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x80 - str r0, [sp] - movs r0, 0x12 - movs r1, 0x7 - movs r2, 0x1D - movs r3, 0x13 - bl sub_8056A3C - ldr r1, =0x02024474 - movs r0, 0x4 - strb r0, [r1, 0x1E] - b _0804F0F2 - .pool -_0804F000: - bl sub_804F100 - movs r0, 0xD - bl PutWindowTilemap - movs r0, 0xD - movs r1, 0x3 - bl CopyWindowToVram - b _0804F06A -_0804F014: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _0804F0F2 - ldr r0, =0x02022e1a - strh r1, [r0] - b _0804F06A - .pool -_0804F02C: - ldr r0, =0x030022c0 - ldrh r0, [r0, 0x2E] - cmp r0, 0 - beq _0804F0F2 - movs r0, 0x5 - bl audio_play - bl sub_804F144 - movs r0, 0xD - movs r1, 0x2 - bl CopyWindowToVram - b _0804F06A - .pool -_0804F04C: - ldr r0, =0x030022c0 - ldrh r0, [r0, 0x2E] - cmp r0, 0 - beq _0804F0F2 - movs r0, 0x5 - bl audio_play - movs r0, 0x81 - str r0, [sp] - movs r0, 0x12 - movs r1, 0x7 - movs r2, 0x1D - movs r3, 0x13 - bl sub_8056A3C -_0804F06A: - ldr r1, =0x02024474 - ldrb r0, [r1, 0x1E] - adds r0, 0x1 - strb r0, [r1, 0x1E] - b _0804F0F2 - .pool -_0804F07C: - bl sub_804F344 - lsls r0, 24 - cmp r0, 0 - bne _0804F0F2 - movs r0, 0xE - bl ClearWindowTilemap - movs r0, 0xE - movs r1, 0x1 - bl CopyWindowToVram - movs r0, 0xD - bl ClearWindowTilemap - movs r0, 0xD - movs r1, 0x1 - bl CopyWindowToVram - movs r0, 0x2 - movs r1, 0x7 - movs r2, 0x2 - bl SetBgAttribute - movs r0, 0x2 - bl ShowBg - ldr r1, =0x02024474 - movs r0, 0xA - strb r0, [r1, 0x1E] - b _0804F0F2 - .pool -_0804F0C0: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0804F0F2 - movs r0, 0 - movs r1, 0x7 - movs r2, 0 - bl SetBgAttribute - movs r0, 0x1 - movs r1, 0x7 - movs r2, 0x1 - bl SetBgAttribute - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] -_0804F0F2: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk6C_8026208 - - thumb_func_start sub_804F100 -sub_804F100: @ 804F100 - push {lr} - sub sp, 0x14 - ldr r0, =0x0202449c - ldr r0, [r0] - ldrb r1, [r0, 0x10] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - add r1, sp, 0x8 - bl sub_81D388C - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r1, [r0, 0x10] - movs r0, 0xD - str r0, [sp] - movs r0, 0xF - str r0, [sp, 0x4] - movs r0, 0xD - add r2, sp, 0x8 - movs r3, 0xE - bl sub_81D3640 - add sp, 0x14 - pop {r0} - bx r0 - .pool - thumb_func_end sub_804F100 - - thumb_func_start sub_804F144 -sub_804F144: @ 804F144 - push {lr} - sub sp, 0x10 - ldr r0, =0x0202449c - ldr r0, [r0] - ldrb r1, [r0, 0x10] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - add r1, sp, 0x4 - bl sub_81D388C - movs r0, 0xF - str r0, [sp] - movs r0, 0xD - add r1, sp, 0x4 - movs r2, 0xE - movs r3, 0xD - bl sub_81D3784 - add sp, 0x10 - pop {r0} - bx r0 - .pool - thumb_func_end sub_804F144 - - thumb_func_start sub_804F17C -sub_804F17C: @ 804F17C - push {lr} - ldr r1, =0x02022e1e - movs r0, 0 - strh r0, [r1] - ldr r1, =0x02022e1c - movs r2, 0xD0 - lsls r2, 1 - adds r0, r2, 0 - strh r0, [r1] - ldr r0, =gUnknown_0831C2C8 - movs r1, 0x60 - movs r2, 0x20 - bl gpu_pal_apply - ldr r1, =gUnknown_0831C2E8 - movs r0, 0xE - movs r2, 0 - movs r3, 0 - bl CopyToWindowPixelBuffer - movs r0, 0xE - bl PutWindowTilemap - movs r0, 0xE - movs r1, 0x3 - bl CopyWindowToVram - bl sub_804F384 - pop {r0} - bx r0 - .pool - thumb_func_end sub_804F17C - - thumb_func_start sub_804F1CC -sub_804F1CC: @ 804F1CC - push {r4,r5,lr} - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _0804F1DC - movs r0, 0x1 - b _0804F216 -_0804F1DC: - ldr r4, =0x02022e1c - ldrh r1, [r4] - movs r5, 0x80 - lsls r5, 2 - cmp r1, r5 - bne _0804F1F0 - movs r0, 0 - b _0804F216 - .pool -_0804F1F0: - movs r0, 0xD0 - lsls r0, 1 - cmp r1, r0 - bne _0804F1FC - bl sub_804F220 -_0804F1FC: - ldrh r0, [r4] - adds r0, 0x8 - strh r0, [r4] - lsls r0, 16 - ldr r1, =0x01ff0000 - cmp r0, r1 - bls _0804F20C - strh r5, [r4] -_0804F20C: - ldrh r1, [r4] - eors r1, r5 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 -_0804F216: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_804F1CC - - thumb_func_start sub_804F220 -sub_804F220: @ 804F220 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - ldr r6, =0x0202449c - ldr r0, [r6] - ldrb r0, [r0, 0x10] - movs r5, 0x64 - muls r0, r5 - ldr r4, =0x020244ec - adds r0, r4 - movs r1, 0x38 - bl pokemon_getattr - mov r8, r0 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldr r0, [r6] - ldrb r0, [r0, 0x10] - muls r0, r5 - adds r0, r4 - bl pokemon_get_gender - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, [r6] - ldrb r0, [r0, 0x10] - muls r0, r5 - adds r0, r4 - ldr r5, =0x02021fc4 - adds r1, r5, 0 - bl GetMonNickname - str r5, [sp] - mov r2, sp - movs r1, 0 - movs r0, 0xE - strb r0, [r2, 0x4] - mov r0, sp - strb r1, [r0, 0x5] - movs r4, 0x20 - strb r4, [r0, 0x6] - strb r1, [r0, 0x7] - strb r4, [r0, 0x8] - strb r1, [r0, 0x9] - strb r1, [r0, 0xA] - strb r1, [r0, 0xB] - mov r3, sp - ldrb r2, [r3, 0xC] - subs r1, 0x10 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r3, 0xC] - mov r2, sp - movs r0, 0x10 - strb r0, [r2, 0xC] - ldrb r0, [r2, 0xD] - ands r1, r0 - strb r1, [r2, 0xD] - mov r0, sp - strb r4, [r0, 0xD] - movs r1, 0xFF - movs r2, 0 - bl AddTextPrinter - movs r0, 0xF9 - strb r0, [r5] - adds r5, 0x1 - movs r0, 0x5 - strb r0, [r5] - adds r5, 0x1 - adds r4, r5, 0 - adds r0, r4, 0 - mov r1, r8 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - adds r5, r0, 0 - subs r4, r5, r4 - movs r2, 0x4 - subs r2, r4 - lsls r2, 16 - lsrs r2, 16 - movs r1, 0x77 - bl RepeatChar - adds r5, r0, 0 - cmp r7, 0xFF - beq _0804F320 - cmp r7, 0 - bne _0804F300 - movs r1, 0 - movs r2, 0xC - bl WriteColorChangeControlCode - adds r5, r0, 0 - movs r1, 0x1 - movs r2, 0xD - bl WriteColorChangeControlCode - adds r5, r0, 0 - movs r0, 0xB5 - b _0804F318 - .pool -_0804F300: - adds r0, r5, 0 - movs r1, 0 - movs r2, 0xE - bl WriteColorChangeControlCode - adds r5, r0, 0 - movs r1, 0x1 - movs r2, 0xF - bl WriteColorChangeControlCode - adds r5, r0, 0 - movs r0, 0xB6 -_0804F318: - strb r0, [r5] - adds r5, 0x1 - movs r0, 0xFF - strb r0, [r5] -_0804F320: - mov r0, sp - movs r1, 0xA - strb r1, [r0, 0x7] - strb r1, [r0, 0x9] - movs r1, 0xFF - movs r2, 0 - bl AddTextPrinter - movs r0, 0xE - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_804F220 - - thumb_func_start sub_804F344 -sub_804F344: @ 804F344 - push {lr} - ldr r0, =0x02022e1c - ldrh r1, [r0] - movs r3, 0xD0 - lsls r3, 1 - adds r2, r0, 0 - cmp r1, r3 - bne _0804F35C - movs r0, 0 - b _0804F380 - .pool -_0804F35C: - ldrh r0, [r2] - adds r1, r0, 0 - subs r1, 0x10 - ldr r0, =0x0000019f - cmp r1, r0 - bgt _0804F370 - strh r3, [r2] - b _0804F372 - .pool -_0804F370: - strh r1, [r2] -_0804F372: - ldrh r1, [r2] - movs r0, 0xD0 - lsls r0, 1 - eors r1, r0 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 -_0804F380: - pop {r1} - bx r1 - thumb_func_end sub_804F344 - - thumb_func_start sub_804F384 -sub_804F384: @ 804F384 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x10 - ldr r0, =0x0202449c - mov r8, r0 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x020244ec - adds r0, r5 - movs r1, 0xB - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r1, r8 - ldr r0, [r1] - ldrb r0, [r0, 0x10] - muls r0, r6 - adds r0, r5 - movs r1, 0 - bl pokemon_getattr - adds r1, r0, 0 - adds r0, r4, 0 - movs r2, 0x1 - bl sub_80D2EDC - str r0, [sp] - ldr r5, =0xffff0000 - ldr r0, [sp, 0x4] - ands r0, r5 - movs r1, 0x80 - lsls r1, 2 - orrs r0, r1 - ldr r1, =0x0000ffff - ands r0, r1 - ldr r1, =0xd75a0000 - orrs r0, r1 - str r0, [sp, 0x4] - adds r0, r4, 0 - bl sub_80D30B0 - str r0, [sp, 0x8] - add r4, sp, 0x8 - ldr r0, [r4, 0x4] - ands r0, r5 - ldr r1, =0x0000d75a - orrs r0, r1 - str r0, [r4, 0x4] - mov r0, sp - bl LoadObjectPic - adds r0, r4, 0 - bl LoadTaggedObjectPalette - ldr r0, =gUnknown_0831C3C0 - movs r1, 0x80 - lsls r1, 1 - movs r2, 0xA - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0 - strh r0, [r1, 0x2E] - ldr r0, =0x02022e1c - ldrh r0, [r0] - strh r0, [r1, 0x30] - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_804F384 - - thumb_func_start sub_804F450 -sub_804F450: @ 804F450 - push {r4,lr} - adds r2, r0, 0 - ldr r0, =0x02022e1c - ldrh r1, [r2, 0x30] - ldrh r0, [r0] - subs r1, r0 - strh r1, [r2, 0x24] - lsls r1, 16 - cmp r1, 0 - beq _0804F470 - movs r0, 0x1 - strh r0, [r2, 0x2E] - b _0804F48C - .pool -_0804F470: - movs r1, 0x2E - ldrsh r0, [r2, r1] - cmp r0, 0 - beq _0804F48C - adds r0, r2, 0 - bl RemoveObjectAndFreeTiles - ldr r4, =0x0000d75a - adds r0, r4, 0 - bl FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag -_0804F48C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_804F450 - - thumb_func_start sub_804F498 -sub_804F498: @ 804F498 - push {lr} - ldr r3, =0x0202406e - ldr r0, =0x0202449c - ldr r0, [r0] - ldrh r1, [r3] - ldrb r2, [r0, 0x10] - cmp r1, r2 - beq _0804F4BA - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0804F4CC - ldrh r0, [r3, 0x4] - cmp r0, r2 - bne _0804F4CC -_0804F4BA: - movs r0, 0x1 - b _0804F4CE - .pool -_0804F4CC: - movs r0, 0 -_0804F4CE: - pop {r1} - bx r1 - thumb_func_end sub_804F498 - - thumb_func_start sub_804F4D4 -sub_804F4D4: @ 804F4D4 - push {lr} - bl sub_803F988 - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_804F4D4 - - thumb_func_start atk6E_state0_side_becomes_attacker -atk6E_state0_side_becomes_attacker: @ 804F4EC - push {lr} - movs r0, 0 - bl battle_get_side_with_given_state - ldr r1, =0x0202420b - strb r0, [r1] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end atk6E_state0_side_becomes_attacker - - thumb_func_start atk6F_8026810 -atk6F_8026810: @ 804F50C - push {r4,r5,lr} - ldr r5, =0x02024214 - ldr r0, [r5] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r4, =0x02024064 - strb r0, [r4] - movs r0, 0 - movs r1, 0 - bl dp01_build_cmdbuf_x33_a_33_33 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r5] - adds r0, 0x2 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk6F_8026810 - - thumb_func_start atk70_record_ability_usage_of_side -atk70_record_ability_usage_of_side: @ 804F540 - push {r4,lr} - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r1, =0x02024064 - strb r0, [r1] - ldrb r0, [r1] - ldr r1, =0x0202420a - ldrb r1, [r1] - bl b_history__record_ability_usage_of_player - ldr r0, [r4] - adds r0, 0x1 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk70_record_ability_usage_of_side - - thumb_func_start sub_804F574 -sub_804F574: @ 804F574 - ldr r2, =0x02022f68 - movs r0, 0xFD - strb r0, [r2] - movs r0, 0x2 - strb r0, [r2, 0x1] - ldr r0, =0x020244e2 - ldrh r1, [r0] - strb r1, [r2, 0x2] - movs r0, 0xFF - lsls r0, 8 - ands r0, r1 - lsrs r0, 8 - strb r0, [r2, 0x3] - movs r0, 0xFF - strb r0, [r2, 0x4] - bx lr - .pool - thumb_func_end sub_804F574 - - thumb_func_start atk71_80268A0 -atk71_80268A0: @ 804F59C - push {lr} - bl sub_804F574 - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end atk71_80268A0 - - thumb_func_start atk72_flee -atk72_flee: @ 804F5B4 - push {lr} - ldr r0, =0x0202420d - ldrb r0, [r0] - bl sub_803EC20 - lsls r0, 24 - cmp r0, 0 - beq _0804F5E8 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0804F5F0 - .pool -_0804F5E8: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_0804F5F0: - pop {r0} - bx r0 - .pool - thumb_func_end atk72_flee - - thumb_func_start atk73_cmd73 -atk73_cmd73: @ 804F5F8 - push {r4-r6,lr} - ldr r0, =0x02022fec - ldr r4, [r0] - movs r6, 0x1 - ands r4, r6 - cmp r4, 0 - bne _0804F68E - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r1, =0x02024064 - strb r0, [r1] - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02024084 - movs r1, 0x58 - muls r1, r0 - adds r1, r2 - ldrh r5, [r1, 0x28] - movs r0, 0x64 - muls r0, r5 - ldrh r1, [r1, 0x2C] - bl __divsi3 - cmp r0, 0 - bne _0804F636 - movs r0, 0x1 -_0804F636: - cmp r0, 0x45 - bgt _0804F63E - cmp r5, 0 - bne _0804F65C -_0804F63E: - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0xB1 - strb r4, [r0] - b _0804F68E - .pool -_0804F65C: - cmp r0, 0x27 - ble _0804F670 - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0xB1 - strb r6, [r0] - b _0804F68E - .pool -_0804F670: - cmp r0, 0x9 - ble _0804F684 - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0xB1 - movs r1, 0x2 - b _0804F68C - .pool -_0804F684: - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0xB1 - movs r1, 0x3 -_0804F68C: - strb r1, [r0] -_0804F68E: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atk73_cmd73 - - thumb_func_start atk74_hp_tresholds_2 -atk74_hp_tresholds_2: @ 804F6A4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =0x02022fec - ldr r7, [r0] - movs r0, 0x1 - mov r8, r0 - ands r7, r0 - cmp r7, 0 - bne _0804F73E - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - adds r4, r0, 0 - ldr r0, =0x02024064 - strb r4, [r0] - movs r0, 0x1 - eors r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - ldr r1, =0x0202449c - ldr r6, [r1] - lsrs r0, 23 - adds r0, r6 - adds r0, 0xA8 - ldrb r5, [r0] - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r4 - adds r0, r1 - ldrh r4, [r0, 0x28] - subs r1, r5, r4 - movs r0, 0x64 - muls r0, r1 - adds r1, r5, 0 - bl __divsi3 - adds r1, r0, 0 - cmp r4, r5 - bcc _0804F71C - adds r0, r6, 0 - adds r0, 0xB1 - strb r7, [r0] - b _0804F73E - .pool -_0804F71C: - cmp r0, 0x1D - bgt _0804F72A - adds r0, r6, 0 - adds r0, 0xB1 - mov r1, r8 - strb r1, [r0] - b _0804F73E -_0804F72A: - cmp r1, 0x45 - bgt _0804F736 - adds r1, r6, 0 - adds r1, 0xB1 - movs r0, 0x2 - b _0804F73C -_0804F736: - adds r1, r6, 0 - adds r1, 0xB1 - movs r0, 0x3 -_0804F73C: - strb r0, [r1] -_0804F73E: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk74_hp_tresholds_2 - - thumb_func_start atk75_8026A58 -atk75_8026A58: @ 804F754 - push {lr} - sub sp, 0x4 - ldr r2, =0x020244b8 - ldr r1, =0x0202420b - ldrb r0, [r1] - strb r0, [r2] - ldr r2, =0x0202406e - ldrb r0, [r1] - lsls r0, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r1, =0x02024744 - adds r0, r1 - ldr r1, =0x02024208 - ldrh r1, [r1] - lsls r2, 24 - lsrs r2, 24 - movs r3, 0x1 - str r3, [sp] - movs r3, 0 - bl ExecuteTableBasedItemEffect - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end atk75_8026A58 - - thumb_func_start sub_804F7AC -sub_804F7AC: @ 804F7AC - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r1, =0x02024064 - strb r0, [r1] - ldr r0, [r4] - ldrb r0, [r0, 0x2] - cmp r0, 0x1A - bls _0804F7CA - b _0804FD70 -_0804F7CA: - lsls r0, 2 - ldr r1, =_0804F7E0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0804F7E0: - .4byte _0804F84C - .4byte _0804F85C - .4byte _0804F8BC - .4byte _0804F8CC - .4byte _0804F8E4 - .4byte _0804F920 - .4byte _0804F958 - .4byte _0804F9E0 - .4byte _0804FA20 - .4byte _0804FACC - .4byte _0804FAE8 - .4byte _0804FB3C - .4byte _0804FB94 - .4byte _0804FC18 - .4byte _0804FC2C - .4byte _0804FC32 - .4byte _0804FC38 - .4byte _0804FC60 - .4byte _0804FC6A - .4byte _0804FC78 - .4byte _0804FC8C - .4byte _0804FCC4 - .4byte _0804FCD8 - .4byte _0804FCF0 - .4byte _0804FD1C - .4byte _0804FD30 - .4byte _0804FD5C -_0804F84C: - ldr r0, =0x02024064 - ldrb r0, [r0] - bl b_cancel_multi_turn_move_maybe - b _0804FD70 - .pool -_0804F85C: - ldr r1, =0x0202420b - ldr r4, =0x0202420c - ldrb r0, [r4] - strb r0, [r1] - ldrb r0, [r1] - bl battle_side_get_owner - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02024294 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r2, r1, r2 - ldrb r0, [r2, 0x8] - cmp r0, 0 - beq _0804F8A8 - ldr r1, =0x02024084 - ldrb r2, [r2, 0x9] - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _0804F8A8 - strb r2, [r4] - b _0804FD70 - .pool -_0804F8A8: - ldr r0, =0x0202420c - ldr r1, =0x02024064 - ldrb r1, [r1] - strb r1, [r0] - b _0804FD70 - .pool -_0804F8BC: - bl sub_803BB88 - ldr r1, =0x02024332 - strb r0, [r1] - b _0804FD70 - .pool -_0804F8CC: - ldr r0, =0x020241ea - ldrh r0, [r0] - movs r1, 0 - bl sub_80458E0 - ldr r1, =0x0202420c - strb r0, [r1] - b _0804FD70 - .pool -_0804F8E4: - ldr r2, =0x02024280 - ldr r1, =gUnknown_0832A328 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - lsls r0, 28 - ldr r2, [r2] - ands r2, r0 - cmp r2, 0 - beq _0804F914 - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1] - b _0804FD70 - .pool -_0804F914: - ldr r0, =0x02024332 - strb r2, [r0] - b _0804FD70 - .pool -_0804F920: - ldr r4, =0x0202437c - ldr r3, =0x02024064 - ldrb r0, [r3] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r2, [r1] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldrb r0, [r3] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r2, [r1] - movs r0, 0x11 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - b _0804FD70 - .pool -_0804F958: - ldr r4, =0x0202406e - ldr r1, =0x0202449c - ldr r0, [r1] - ldrh r3, [r4] - ldrb r2, [r0, 0x10] - adds r6, r1, 0 - cmp r3, r2 - beq _0804F974 - ldrh r0, [r4, 0x4] - cmp r0, r2 - beq _0804F970 - b _0804FD70 -_0804F970: - cmp r3, r0 - bne _0804F988 -_0804F974: - ldr r1, =0x02024064 - movs r0, 0 - b _0804F98C - .pool -_0804F988: - ldr r1, =0x02024064 - movs r0, 0x2 -_0804F98C: - strb r0, [r1] - adds r5, r1, 0 - ldrb r2, [r5] - lsls r0, r2, 1 - adds r0, 0xC8 - ldr r1, [r6] - adds r4, r1, r0 - movs r3, 0 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r2 - adds r1, 0xC - adds r0, r1 - ldrh r0, [r0] - ldrh r2, [r4] - cmp r0, r2 - beq _0804F9CC - adds r6, r5, 0 - movs r5, 0x58 - adds r2, r1, 0 -_0804F9B4: - adds r3, 0x1 - cmp r3, 0x3 - bgt _0804F9CC - lsls r1, r3, 1 - ldrb r0, [r6] - muls r0, r5 - adds r1, r0 - adds r1, r2 - ldrh r0, [r1] - ldrh r1, [r4] - cmp r0, r1 - bne _0804F9B4 -_0804F9CC: - cmp r3, 0x4 - beq _0804F9D2 - b _0804FD70 -_0804F9D2: - movs r0, 0 - strh r0, [r4] - b _0804FD70 - .pool -_0804F9E0: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0xB - ands r0, r1 - cmp r0, 0x8 - beq _0804F9EE - b _0804FD70 -_0804F9EE: - ldr r1, =0x02024084 - ldrh r0, [r1, 0x28] - cmp r0, 0 - bne _0804F9F8 - b _0804FD70 -_0804F9F8: - adds r0, r1, 0 - adds r0, 0x80 - ldrh r0, [r0] - cmp r0, 0 - bne _0804FA04 - b _0804FD70 -_0804FA04: - ldr r0, =0x02024280 - ldr r1, [r0] - ldr r2, =0xffbfffff - ands r1, r2 - str r1, [r0] - b _0804FD70 - .pool -_0804FA20: - ldr r2, =0x02024332 - mov r8, r2 - movs r0, 0 - strb r0, [r2] - ldr r1, =0x02024474 - ldr r6, =0x02024064 - ldrb r0, [r2, 0x1] - strb r0, [r6] - strb r0, [r1, 0x17] - ldr r0, =0x0202449c - ldr r0, [r0] - adds r7, r0, 0 - adds r7, 0x92 - ldrb r3, [r7] - ldr r1, =gUnknown_0832A328 - ldrb r2, [r6] - lsls r0, r2, 2 - adds r0, r1 - ldr r5, [r0] - adds r0, r3, 0 - ands r0, r5 - cmp r0, 0 - beq _0804FA50 - b _0804FD70 -_0804FA50: - ldr r4, =0x02024084 - movs r0, 0x58 - mov r12, r0 - mov r1, r12 - muls r1, r2 - adds r2, r1, 0 - adds r1, r2, r4 - ldrh r0, [r1, 0x2C] - lsrs r0, 1 - ldrh r1, [r1, 0x28] - cmp r0, r1 - bcs _0804FA6A - b _0804FD70 -_0804FA6A: - cmp r1, 0 - bne _0804FA70 - b _0804FD70 -_0804FA70: - adds r0, r4, 0 - adds r0, 0x4C - adds r0, r2, r0 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - beq _0804FA82 - b _0804FD70 -_0804FA82: - orrs r3, r5 - strb r3, [r7] - movs r0, 0x1 - mov r2, r8 - strb r0, [r2] - ldrb r0, [r6] - mov r1, r12 - muls r1, r0 - adds r0, r1, 0 - adds r1, r4, 0 - adds r1, 0x48 - adds r0, r1 - ldr r0, [r0] - bl GetNatureFromPersonality - ldr r1, =gUnknown_0831C4F8 - lsls r0, 24 - lsrs r0, 24 - adds r0, r1 - ldrb r0, [r0] - mov r2, r8 - strb r0, [r2, 0x5] - b _0804FD70 - .pool -_0804FACC: - ldr r4, =0x02024332 - adds r0, r4, 0 - bl sub_81A5258 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - bne _0804FADE - b _0804FD78 -_0804FADE: - strb r3, [r4, 0x1] - b _0804FD70 - .pool -_0804FAE8: - ldr r0, =0x02024084 - adds r0, 0x80 - movs r1, 0 - strh r1, [r0] - ldr r2, =0x02024280 - ldr r3, =gUnknown_0832A328 - ldr r1, [r3, 0x4] - lsls r1, 28 - ldr r0, [r2] - orrs r0, r1 - str r0, [r2] - ldr r0, =0x0202449c - ldr r2, [r0] - ldr r0, =0x000002a1 - adds r2, r0 - ldr r0, =0x0202406e - ldrh r0, [r0, 0x2] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x020242bc - adds r1, 0x34 - ldrb r0, [r1] - movs r2, 0x2 - b _0804FBF4 - .pool -_0804FB3C: - ldr r1, =0x02024084 - movs r0, 0 - strh r0, [r1, 0x28] - ldr r2, =0x02024280 - ldr r3, =gUnknown_0832A328 - ldr r1, [r3] - lsls r1, 28 - ldr r0, [r2] - orrs r0, r1 - movs r1, 0x80 - lsls r1, 15 - orrs r0, r1 - str r0, [r2] - ldr r0, =0x0202449c - ldr r2, [r0] - movs r1, 0xA8 - lsls r1, 2 - adds r2, r1 - ldr r0, =0x0202406e - ldrh r0, [r0] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - ldr r2, =0x020242bc - ldrb r0, [r2, 0x18] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2, 0x18] - b _0804FD70 - .pool -_0804FB94: - ldr r0, =0x02024084 - movs r1, 0 - strh r1, [r0, 0x28] - adds r0, 0x80 - strh r1, [r0] - ldr r2, =0x02024280 - ldr r3, =gUnknown_0832A328 - ldr r0, [r3] - lsls r0, 28 - ldr r1, [r2] - orrs r1, r0 - ldr r0, [r3, 0x4] - lsls r0, 28 - orrs r1, r0 - movs r0, 0x80 - lsls r0, 15 - orrs r1, r0 - str r1, [r2] - ldr r5, =0x0202449c - ldr r2, [r5] - movs r0, 0xA8 - lsls r0, 2 - adds r2, r0 - ldr r4, =0x0202406e - ldrh r0, [r4] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - ldr r2, [r5] - ldr r1, =0x000002a1 - adds r2, r1 - ldrh r0, [r4, 0x2] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x020242bc - ldrb r0, [r1, 0x18] - movs r2, 0x2 - orrs r0, r2 - strb r0, [r1, 0x18] - adds r1, 0x34 - ldrb r0, [r1] -_0804FBF4: - orrs r0, r2 - strb r0, [r1] - b _0804FD70 - .pool -_0804FC18: - movs r0, 0 - bl sub_8033E10 - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution - b _0804FD70 - .pool -_0804FC2C: - bl sub_81A5BF8 - b _0804FD70 -_0804FC32: - bl sub_81A5D44 - b _0804FD70 -_0804FC38: - ldr r1, =gUnknown_085CD1C8 - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl get_battle_strings_ - ldr r0, =0x02022e2c - movs r1, 0x16 - bl battle_show_message_maybe - b _0804FD70 - .pool -_0804FC60: - movs r0, 0x16 - bl IsTextPrinterActive - lsls r0, 16 - b _0804FD24 -_0804FC6A: - bl sub_80A3678 - lsls r0, 24 - cmp r0, 0 - bne _0804FC76 - b _0804FD78 -_0804FC76: - b _0804FD70 -_0804FC78: - ldr r4, =0x02024064 - movs r0, 0x1 - strb r0, [r4] - ldr r0, =0x02024084 - adds r0, 0x58 - b _0804FCA2 - .pool -_0804FC8C: - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r0, 0x3 - bls _0804FD70 - ldr r4, =0x02024064 - movs r0, 0x3 - strb r0, [r4] - ldr r0, =0x02024084 - movs r2, 0x84 - lsls r2, 1 - adds r0, r2 -_0804FCA2: - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _0804FD70 - movs r0, 0 - movs r1, 0 - bl dp01_build_cmdbuf_x06_a - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - b _0804FD70 - .pool -_0804FCC4: - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x55 - bl MPlayVolumeControl - b _0804FD70 - .pool -_0804FCD8: - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl MPlayVolumeControl - b _0804FD70 - .pool -_0804FCF0: - ldr r0, =0x0202449c - ldr r2, [r0] - ldr r0, =0x000002a2 - adds r2, r0 - ldr r1, =gUnknown_0832A328 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - b _0804FD70 - .pool -_0804FD1C: - ldr r0, =0x02024064 - ldrb r0, [r0] - bl sub_805725C -_0804FD24: - cmp r0, 0 - bne _0804FD78 - b _0804FD70 - .pool -_0804FD30: - ldr r0, =0x02024064 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0804FD50 - ldr r1, =0x0202433a - movs r0, 0x5 - strb r0, [r1] - b _0804FD70 - .pool -_0804FD50: - ldr r1, =0x0202433a - movs r0, 0xA - strb r0, [r1] - b _0804FD70 - .pool -_0804FD5C: - movs r1, 0xCE - lsls r1, 1 - movs r0, 0 - movs r2, 0x1 - bl sub_8034300 - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution -_0804FD70: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x3 - str r0, [r1] -_0804FD78: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_804F7AC - - thumb_func_start atk77_setprotect -atk77_setprotect: @ 804FD8C - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r6, 0x1 - ldr r2, =0x02024260 - ldr r1, =0x0202420b - ldrb r3, [r1] - lsls r0, r3, 1 - adds r0, r2 - ldrh r0, [r0] - mov r8, r1 - ldr r7, =0x020242bc - cmp r0, 0xB6 - beq _0804FDBC - cmp r0, 0xC5 - beq _0804FDBC - cmp r0, 0xCB - beq _0804FDBC - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r7 - movs r1, 0 - strb r1, [r0, 0x8] -_0804FDBC: - ldr r0, =0x02024082 - ldrb r1, [r0] - ldr r0, =0x0202406c - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - bne _0804FDCC - movs r6, 0 -_0804FDCC: - ldr r2, =gUnknown_0831C3D8 - mov r5, r8 - ldrb r1, [r5] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r7 - ldrb r4, [r0, 0x8] - lsls r4, 1 - adds r4, r2 - bl GenerateRandomNumber - ldrh r1, [r4] - lsls r0, 16 - lsrs r0, 16 - cmp r1, r0 - bcc _0804FE80 - cmp r6, 0 - beq _0804FE80 - ldr r4, =gBattleMoves - ldr r3, =0x020241ea - ldrh r0, [r3] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r0, [r1] - cmp r0, 0x6F - bne _0804FE1C - ldr r0, =0x0202433c - ldrb r1, [r5] - lsls r1, 4 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x1 - orrs r0, r2 - strb r0, [r1] - ldr r1, =0x02024332 - movs r0, 0 - strb r0, [r1, 0x5] -_0804FE1C: - ldrh r0, [r3] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r0, [r1] - cmp r0, 0x74 - bne _0804FE42 - ldr r0, =0x0202433c - ldrb r1, [r5] - lsls r1, 4 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x2 - orrs r0, r2 - strb r0, [r1] - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] -_0804FE42: - mov r1, r8 - ldrb r0, [r1] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r7 - ldrb r0, [r1, 0x8] - adds r0, 0x1 - strb r0, [r1, 0x8] - b _0804FEA2 - .pool -_0804FE80: - ldr r2, =0x020242bc - ldr r0, =0x0202420b - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strb r1, [r0, 0x8] - ldr r1, =0x02024332 - movs r0, 0x2 - strb r0, [r1, 0x5] - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] -_0804FEA2: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk77_setprotect - - thumb_func_start atk78_faintifabilitynotdamp -atk78_faintifabilitynotdamp: @ 804FEC8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =0x02024068 - ldr r2, [r0] - cmp r2, 0 - bne _0804FFCC - ldr r1, =0x0202420c - strb r2, [r1] - ldr r0, =0x0202406c - ldrb r3, [r0] - adds r5, r1, 0 - mov r8, r0 - ldr r6, =0x02024084 - cmp r2, r3 - bcs _0804FF14 - adds r0, r6, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x6 - beq _0804FF14 - adds r2, r3, 0 - adds r4, r6, 0 - movs r3, 0x58 -_0804FEF8: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, r2 - bcs _0804FF14 - ldrb r0, [r5] - muls r0, r3 - adds r0, r4 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x6 - bne _0804FEF8 -_0804FF14: - ldrb r0, [r5] - mov r1, r8 - ldrb r1, [r1] - cmp r0, r1 - bne _0804FFB0 - ldr r4, =0x02024064 - ldr r7, =0x0202420b - ldrb r0, [r7] - strb r0, [r4] - ldr r2, =0x020241f0 - ldrb r1, [r4] - movs r0, 0x58 - muls r0, r1 - adds r0, r6 - ldrh r0, [r0, 0x28] - str r0, [r2] - ldr r1, =0x00007fff - movs r0, 0 - bl dp01_build_cmdbuf_x18_0_aa_health_bar_update - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - movs r0, 0 - strb r0, [r5] - mov r2, r8 - ldrb r0, [r2] - cmp r0, 0 - beq _0804FFCC - adds r3, r5, 0 - ldrb r5, [r7] - ldr r7, =gUnknown_0832A328 - adds r4, r0, 0 - ldr r6, =0x02024210 -_0804FF60: - ldrb r2, [r3] - cmp r2, r5 - beq _0804FF76 - ldrb r0, [r6] - ldrb r1, [r3] - lsls r1, 2 - adds r1, r7 - ldr r1, [r1] - ands r0, r1 - cmp r0, 0 - beq _0804FFCC -_0804FF76: - adds r0, r2, 0x1 - strb r0, [r3] - lsls r0, 24 - lsrs r0, 24 - cmp r0, r4 - bcc _0804FF60 - b _0804FFCC - .pool -_0804FFB0: - ldr r1, =0x0202420a - movs r0, 0x6 - strb r0, [r1] - ldrb r0, [r5] - movs r1, 0x58 - muls r1, r0 - adds r1, r6 - adds r1, 0x20 - ldrb r1, [r1] - bl b_history__record_ability_usage_of_player - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB560 - str r0, [r1] -_0804FFCC: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk78_faintifabilitynotdamp - - thumb_func_start atk79_setuserhptozero -atk79_setuserhptozero: @ 804FFE4 - push {r4,lr} - sub sp, 0x4 - ldr r0, =0x02024068 - ldr r3, [r0] - cmp r3, 0 - bne _08050028 - ldr r4, =0x02024064 - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r4] - ldr r1, =0x02024084 - ldrb r0, [r4] - movs r2, 0x58 - muls r0, r2 - adds r0, r1 - strh r3, [r0, 0x28] - ldrb r0, [r4] - muls r0, r2 - adds r1, 0x28 - adds r0, r1 - str r0, [sp] - movs r0, 0 - movs r1, 0x2A - movs r2, 0 - movs r3, 0x2 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] -_08050028: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk79_setuserhptozero - - thumb_func_start sub_8050044 -sub_8050044: @ 8050044 - push {r4-r7,lr} - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r4, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r4, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r4, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r4, r0 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - adds r7, r3, 0 - cmp r0, 0 - beq _080500DC - ldr r0, =0x0202420c - ldrb r1, [r0] - adds r1, 0x1 - strb r1, [r0] - ldr r2, =0x0202420b - lsls r1, 24 - lsrs r1, 24 - adds r3, r0, 0 - ldr r6, =0x02024210 - ldr r5, =gUnknown_0832A328 - ldr r0, =0x0202406c - mov r12, r0 - ldrb r0, [r2] - cmp r1, r0 - bne _0805009A -_0805008A: - ldrb r0, [r3] - adds r0, 0x1 - strb r0, [r3] - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r2] - cmp r0, r1 - beq _0805008A -_0805009A: - ldrb r0, [r6] - ldrb r1, [r3] - lsls r1, 2 - adds r1, r5 - ldr r1, [r1] - ands r0, r1 - cmp r0, 0 - bne _0805008A - ldrb r0, [r3] - mov r2, r12 - ldrb r2, [r2] - cmp r0, r2 - bcc _080500D8 - ldr r0, [r7] - adds r0, 0x5 - str r0, [r7] - b _080500E0 - .pool -_080500D8: - str r4, [r7] - b _080500E0 -_080500DC: - adds r0, r2, 0x5 - str r0, [r3] -_080500E0: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8050044 - - thumb_func_start sub_80500E8 -sub_80500E8: @ 80500E8 - push {r4-r6,lr} - ldr r4, =0x02024214 - ldr r1, [r4] - ldrb r2, [r1, 0x1] - ldrb r0, [r1, 0x2] - lsls r0, 8 - orrs r2, r0 - ldrb r0, [r1, 0x3] - lsls r0, 16 - orrs r2, r0 - ldrb r0, [r1, 0x4] - lsls r0, 24 - orrs r2, r0 - ldrb r0, [r1, 0x5] - ldr r3, =0x0202420c - cmp r0, 0x1 - bne _08050110 - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r3] -_08050110: - ldr r1, =0x020241f0 - ldr r6, =0x02024084 - ldrb r0, [r3] - movs r5, 0x58 - muls r0, r5 - adds r0, r6 - ldrh r0, [r0, 0x2C] - lsrs r0, 1 - str r0, [r1] - cmp r0, 0 - bne _0805012A - movs r0, 0x1 - str r0, [r1] -_0805012A: - ldr r0, [r1] - negs r0, r0 - str r0, [r1] - ldrb r0, [r3] - muls r0, r5 - adds r0, r6 - ldrh r1, [r0, 0x28] - ldrh r0, [r0, 0x2C] - cmp r1, r0 - bne _08050158 - str r2, [r4] - b _0805015E - .pool -_08050158: - ldr r0, [r4] - adds r0, 0x6 - str r0, [r4] -_0805015E: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80500E8 - - thumb_func_start sub_8050164 -sub_8050164: @ 8050164 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - ldr r2, =0x0202406c - ldr r0, =0x0202420b - mov r10, r0 - movs r1, 0 - add r0, sp, 0x4 -_0805017A: - strh r1, [r0] - subs r0, 0x2 - cmp r0, sp - bge _0805017A - movs r1, 0 - mov r8, r1 - movs r5, 0 - ldrb r1, [r2] - cmp r5, r1 - bge _080501D0 - ldr r0, =0x0202420b - ldrb r6, [r0] - ldr r2, =0x0000ffff - mov r9, r2 - lsls r4, r6, 3 - mov r2, sp - ldr r0, =0x0202449c - mov r12, r0 - adds r7, r1, 0 -_080501A0: - cmp r5, r6 - beq _080501C8 - mov r1, r12 - ldr r0, [r1] - adds r0, r4, r0 - adds r1, r0, 0 - adds r1, 0xE0 - ldrb r3, [r1] - adds r0, 0xE1 - ldrb r0, [r0] - lsls r0, 8 - orrs r3, r0 - cmp r3, 0 - beq _080501C8 - cmp r3, r9 - beq _080501C8 - strh r3, [r2] - adds r2, 0x2 - movs r0, 0x1 - add r8, r0 -_080501C8: - adds r4, 0x2 - adds r5, 0x1 - cmp r5, r7 - blt _080501A0 -_080501D0: - mov r1, r10 - ldrb r0, [r1] - ldr r2, =0x0202449c - ldr r1, [r2] - lsls r0, 1 - adds r0, r1 - adds r1, r0, 0 - adds r1, 0x98 - ldrb r3, [r1] - adds r0, 0x99 - ldrb r0, [r0] - lsls r0, 8 - orrs r3, r0 - cmp r3, 0 - beq _08050220 - ldr r0, =0x0000ffff - cmp r3, r0 - beq _08050220 - ldr r2, =0x02024280 - ldr r0, [r2] - ldr r1, =0xfffffbff - ands r0, r1 - str r0, [r2] - ldr r4, =0x020241ea - strh r3, [r4] - b _0805024A - .pool -_08050220: - mov r0, r8 - cmp r0, 0 - beq _08050290 - ldr r2, =0x02024280 - ldr r0, [r2] - ldr r1, =0xfffffbff - ands r0, r1 - str r0, [r2] - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - mov r1, r8 - bl __modsi3 - adds r5, r0, 0 - ldr r4, =0x020241ea - lsls r0, r5, 1 - add r0, sp - ldrh r0, [r0] - strh r0, [r4] -_0805024A: - ldrh r0, [r4] - movs r1, 0 - bl sub_80458E0 - ldr r1, =0x0202420c - strb r0, [r1] - ldr r5, =0x02024214 - ldr r3, =gUnknown_082D86A8 - ldr r2, =gBattleMoves - ldrh r1, [r4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - str r0, [r5] - b _080502AE - .pool -_08050290: - ldr r2, =0x0202437c - mov r0, r10 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] -_080502AE: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8050164 - - thumb_func_start sub_80502C8 -sub_80502C8: @ 80502C8 - push {lr} - ldr r2, =0x020243cc - ldrh r0, [r2] - movs r1, 0x7 - ands r1, r0 - cmp r1, 0 - beq _080502F4 - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024332 - movs r0, 0x2 - strb r0, [r1, 0x5] - b _08050304 - .pool -_080502F4: - movs r0, 0x1 - strh r0, [r2] - ldr r0, =0x02024332 - strb r1, [r0, 0x5] - ldr r0, =0x020243d0 - adds r0, 0x28 - movs r1, 0x5 - strb r1, [r0] -_08050304: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80502C8 - - thumb_func_start atk7E_setreflect -atk7E_setreflect: @ 805031C - push {r4-r6,lr} - ldr r6, =0x0202420b - ldrb r0, [r6] - bl battle_get_per_side_status - ldr r4, =0x0202428e - movs r5, 0x1 - adds r1, r5, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - ldrh r1, [r1] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _0805035C - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024332 - movs r0, 0 - b _080503D0 - .pool -_0805035C: - ldrb r0, [r6] - bl battle_get_per_side_status - adds r1, r5, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - ldrh r0, [r1] - movs r2, 0x1 - orrs r0, r2 - strh r0, [r1] - ldrb r0, [r6] - bl battle_get_per_side_status - ldr r4, =0x02024294 - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x5 - strb r1, [r0] - ldrb r0, [r6] - bl battle_get_per_side_status - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r6] - strb r1, [r0, 0x1] - ldr r0, =0x02022fec - ldr r0, [r0] - ands r0, r5 - cmp r0, 0 - beq _080503CC - movs r0, 0x1 - bl sub_8069DEC - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x2 - bne _080503CC - ldr r0, =0x02024332 - strb r1, [r0, 0x5] - b _080503D2 - .pool -_080503CC: - ldr r1, =0x02024332 - movs r0, 0x1 -_080503D0: - strb r0, [r1, 0x5] -_080503D2: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atk7E_setreflect - - thumb_func_start sub_80503E8 -sub_80503E8: @ 80503E8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r7, =0x0202427c - ldrb r5, [r7] - movs r0, 0x29 - ands r0, r5 - cmp r0, 0 - bne _0805041A - ldr r0, =0x020242ac - mov r9, r0 - ldr r1, =0x0202420c - mov r8, r1 - ldrb r4, [r1] - lsls r0, r4, 2 - mov r2, r9 - adds r6, r0, r2 - ldr r2, [r6] - movs r0, 0x4 - mov r12, r0 - adds r3, r2, 0 - ands r3, r0 - cmp r3, 0 - beq _08050438 -_0805041A: - movs r0, 0x1 - orrs r0, r5 - strb r0, [r7] - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] - b _08050488 - .pool -_08050438: - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r4 - adds r1, r0, r1 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0xC - beq _08050454 - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0xC - bne _0805046C -_08050454: - movs r0, 0x1 - orrs r0, r5 - strb r0, [r7] - ldr r1, =0x02024332 - movs r0, 0x2 - strb r0, [r1, 0x5] - b _08050488 - .pool -_0805046C: - ldr r0, =0x0202420b - ldrb r0, [r0] - orrs r2, r0 - str r2, [r6] - mov r2, r8 - ldrb r1, [r2] - lsls r1, 2 - add r1, r9 - ldr r0, [r1] - mov r2, r12 - orrs r0, r2 - str r0, [r1] - ldr r0, =0x02024332 - strb r3, [r0, 0x5] -_08050488: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80503E8 - - thumb_func_start atk80_manipulatedamage -atk80_manipulatedamage: @ 80504A8 - push {r4,lr} - ldr r1, =0x02024214 - ldr r0, [r1] - ldrb r2, [r0, 0x1] - adds r4, r1, 0 - cmp r2, 0x1 - beq _080504D8 - cmp r2, 0x1 - bgt _080504C4 - cmp r2, 0 - beq _080504CA - b _08050518 - .pool -_080504C4: - cmp r2, 0x2 - beq _08050510 - b _08050518 -_080504CA: - ldr r1, =0x020241f0 - ldr r0, [r1] - negs r0, r0 - b _08050516 - .pool -_080504D8: - ldr r3, =0x020241f0 - ldr r0, [r3] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - str r0, [r3] - cmp r0, 0 - bne _080504EA - str r2, [r3] -_080504EA: - ldr r2, =0x02024084 - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r0, [r0, 0x2C] - lsrs r1, r0, 1 - ldr r0, [r3] - cmp r1, r0 - bge _08050518 - str r1, [r3] - b _08050518 - .pool -_08050510: - ldr r1, =0x020241f0 - ldr r0, [r1] - lsls r0, 1 -_08050516: - str r0, [r1] -_08050518: - ldr r0, [r4] - adds r0, 0x2 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk80_manipulatedamage - - thumb_func_start atk81_setrest -atk81_setrest: @ 8050528 - push {r4-r7,lr} - sub sp, 0x4 - ldr r0, =0x02024214 - mov r12, r0 - ldr r1, [r0] - ldrb r6, [r1, 0x1] - ldrb r0, [r1, 0x2] - lsls r0, 8 - orrs r6, r0 - ldrb r0, [r1, 0x3] - lsls r0, 16 - orrs r6, r0 - ldrb r0, [r1, 0x4] - lsls r0, 24 - orrs r6, r0 - ldr r5, =0x02024064 - ldr r2, =0x0202420c - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r2] - strb r0, [r5] - ldr r4, =0x020241f0 - ldr r1, =0x02024084 - ldrb r0, [r2] - movs r3, 0x58 - muls r0, r3 - adds r0, r1 - ldrh r0, [r0, 0x2C] - negs r0, r0 - str r0, [r4] - ldrb r0, [r2] - adds r4, r0, 0 - muls r4, r3 - adds r0, r4, r1 - ldrh r3, [r0, 0x28] - adds r7, r5, 0 - adds r5, r2, 0 - adds r2, r1, 0 - ldrh r0, [r0, 0x2C] - cmp r3, r0 - bne _08050598 - mov r0, r12 - str r6, [r0] - b _080505E8 - .pool -_08050598: - adds r0, r2, 0 - adds r0, 0x4C - adds r0, r4, r0 - ldr r1, [r0] - movs r0, 0xF8 - ands r1, r0 - cmp r1, 0 - beq _080505B4 - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] - b _080505B8 - .pool -_080505B4: - ldr r0, =0x02024332 - strb r1, [r0, 0x5] -_080505B8: - ldrb r0, [r5] - movs r3, 0x58 - muls r0, r3 - adds r2, 0x4C - adds r0, r2 - movs r1, 0x3 - str r1, [r0] - ldrb r0, [r7] - muls r0, r3 - adds r0, r2 - str r0, [sp] - movs r0, 0 - movs r1, 0x28 - movs r2, 0 - movs r3, 0x4 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r7] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_080505E8: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk81_setrest - - thumb_func_start atk82_jumpifnotfirstturn -atk82_jumpifnotfirstturn: @ 80505F8 - push {r4,r5,lr} - ldr r5, =0x02024214 - ldr r4, [r5] - ldrb r3, [r4, 0x1] - ldrb r0, [r4, 0x2] - lsls r0, 8 - orrs r3, r0 - ldrb r0, [r4, 0x3] - lsls r0, 16 - orrs r3, r0 - ldrb r0, [r4, 0x4] - lsls r0, 24 - orrs r3, r0 - ldr r2, =0x020242bc - ldr r0, =0x0202420b - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x16] - cmp r0, 0 - beq _08050638 - adds r0, r4, 0x5 - str r0, [r5] - b _0805063A - .pool -_08050638: - str r3, [r5] -_0805063A: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end atk82_jumpifnotfirstturn - - thumb_func_start sub_8050640 -sub_8050640: @ 8050640 - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_8050640 - - thumb_func_start sub_8050650 -sub_8050650: @ 8050650 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r3, r0, 24 - movs r2, 0 - ldr r0, =0x0202406c - ldrb r1, [r0] - mov r8, r0 - cmp r2, r1 - bge _080506C4 - ldr r0, =0x02024084 - mov r12, r0 - movs r0, 0x58 - muls r0, r3 - add r0, r12 - adds r5, r0, 0 - adds r5, 0x20 - adds r4, r1, 0 - movs r3, 0 - ldr r6, =0x02024474 - ldr r7, =0x02024332 -_0805067C: - mov r0, r12 - adds r0, 0x50 - adds r0, r3, r0 - ldr r0, [r0] - movs r1, 0x70 - ands r0, r1 - cmp r0, 0 - beq _080506BC - ldrb r0, [r5] - cmp r0, 0x2B - beq _080506BC - movs r3, 0 - strb r2, [r6, 0x17] - ldr r1, =0x0202420c - ldrb r0, [r1] - cmp r0, 0xFF - beq _080506DC - cmp r0, r2 - beq _080506D0 - movs r0, 0x1 - strb r0, [r7, 0x5] - b _080506C4 - .pool -_080506BC: - adds r3, 0x58 - adds r2, 0x1 - cmp r2, r4 - blt _0805067C -_080506C4: - mov r1, r8 - ldrb r1, [r1] - cmp r2, r1 - beq _080506E0 - movs r0, 0x1 - b _080506E2 -_080506D0: - ldr r0, =0x02024332 - strb r3, [r0, 0x5] - b _080506C4 - .pool -_080506DC: - strb r2, [r1] - b _080506C4 -_080506E0: - movs r0, 0 -_080506E2: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8050650 - - thumb_func_start sub_80506EC -sub_80506EC: @ 80506EC - push {r4-r6,lr} - ldr r5, =0x02024214 - ldr r1, [r5] - ldrb r4, [r1, 0x1] - ldrb r0, [r1, 0x2] - lsls r0, 8 - orrs r4, r0 - ldrb r0, [r1, 0x3] - lsls r0, 16 - orrs r4, r0 - ldrb r0, [r1, 0x4] - lsls r0, 24 - orrs r4, r0 - ldr r6, =0x0202420c - ldrb r0, [r6] - bl sub_8050650 - lsls r0, 24 - cmp r0, 0 - beq _08050720 - str r4, [r5] - b _08050762 - .pool -_08050720: - ldr r1, =0x02024084 - ldrb r3, [r6] - movs r0, 0x58 - muls r0, r3 - adds r0, r1 - adds r0, 0x20 - ldrb r0, [r0] - adds r1, r0, 0 - cmp r1, 0xF - beq _08050738 - cmp r1, 0x48 - bne _0805075C -_08050738: - ldr r2, =0x0202420a - strb r0, [r2] - ldr r1, =0x02024332 - movs r0, 0x2 - strb r0, [r1, 0x5] - str r4, [r5] - ldrb r1, [r2] - adds r0, r3, 0 - bl b_history__record_ability_usage_of_player - b _08050762 - .pool -_0805075C: - ldr r0, [r5] - adds r0, 0x5 - str r0, [r5] -_08050762: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80506EC - - thumb_func_start sub_8050768 -sub_8050768: @ 8050768 - push {r4,r5,lr} - ldr r5, =0x020242bc - ldr r4, =0x0202420b - ldrb r1, [r4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r1, r0, r5 - ldrb r0, [r1, 0x9] - cmp r0, 0x3 - bne _080507A0 - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] - b _080507CA - .pool -_080507A0: - adds r0, 0x1 - movs r3, 0 - strb r0, [r1, 0x9] - ldr r2, =0x02022f58 - movs r0, 0xFD - strb r0, [r2] - movs r0, 0x1 - strb r0, [r2, 0x1] - strb r0, [r2, 0x2] - strb r0, [r2, 0x3] - ldrb r1, [r4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r0, [r0, 0x9] - strb r0, [r2, 0x4] - movs r0, 0xFF - strb r0, [r2, 0x5] - ldr r0, =0x02024332 - strb r3, [r0, 0x5] -_080507CA: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8050768 - - thumb_func_start atk86_stockpiletobasedamage -atk86_stockpiletobasedamage: @ 80507E4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - ldr r3, =0x02024214 - ldr r1, [r3] - ldrb r2, [r1, 0x1] - ldrb r0, [r1, 0x2] - lsls r0, 8 - orrs r2, r0 - ldrb r0, [r1, 0x3] - lsls r0, 16 - orrs r2, r0 - ldrb r0, [r1, 0x4] - lsls r0, 24 - orrs r2, r0 - ldr r7, =0x020242bc - ldr r6, =0x0202420b - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r7 - ldrb r0, [r0, 0x9] - cmp r0, 0 - bne _08050828 - str r2, [r3] - b _080508CA - .pool -_08050828: - ldr r0, =0x02024332 - ldrb r0, [r0, 0x6] - cmp r0, 0x1 - beq _080508B0 - ldr r0, =0x020241f0 - mov r8, r0 - ldr r4, =0x0202428e - ldr r5, =0x0202420c - ldrb r0, [r5] - bl battle_get_per_side_status - movs r1, 0x1 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - ldrh r3, [r1] - ldrb r0, [r6] - movs r4, 0x58 - muls r0, r4 - ldr r2, =0x02024084 - adds r0, r2 - ldrb r1, [r5] - muls r1, r4 - adds r1, r2 - ldr r2, =0x020241ea - ldrh r2, [r2] - movs r4, 0 - str r4, [sp] - str r4, [sp, 0x4] - ldrb r4, [r6] - str r4, [sp, 0x8] - ldrb r4, [r5] - str r4, [sp, 0xC] - bl sub_806957C - ldrb r2, [r6] - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r7 - ldrb r1, [r1, 0x9] - adds r3, r0, 0 - muls r3, r1 - mov r1, r8 - str r3, [r1] - ldr r2, =0x02024474 - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r7 - ldrb r0, [r0, 0x9] - strb r0, [r2, 0x18] - ldr r1, =0x0202433c - ldrb r0, [r6] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 28 - cmp r0, 0 - bge _080508B0 - lsls r0, r3, 4 - subs r0, r3 - movs r1, 0xA - bl __divsi3 - mov r1, r8 - str r0, [r1] -_080508B0: - ldr r2, =0x020242bc - ldr r0, =0x0202420b - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strb r1, [r0, 0x9] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_080508CA: - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk86_stockpiletobasedamage - - thumb_func_start atk87_stockpiletohprecovery -atk87_stockpiletohprecovery: @ 8050904 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r7, =0x02024214 - ldr r1, [r7] - ldrb r2, [r1, 0x1] - ldrb r0, [r1, 0x2] - lsls r0, 8 - orrs r2, r0 - ldrb r0, [r1, 0x3] - lsls r0, 16 - orrs r2, r0 - ldrb r0, [r1, 0x4] - lsls r0, 24 - orrs r2, r0 - ldr r0, =0x020242bc - mov r8, r0 - ldr r6, =0x0202420b - ldrb r3, [r6] - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - mov r1, r8 - adds r4, r0, r1 - ldrb r1, [r4, 0x9] - cmp r1, 0 - bne _08050954 - str r2, [r7] - ldr r0, =0x02024332 - strb r1, [r0, 0x5] - b _080509D0 - .pool -_08050954: - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r3 - adds r1, r0, r1 - ldrh r0, [r1, 0x2C] - ldrh r3, [r1, 0x28] - cmp r0, r3 - bne _08050984 - movs r0, 0 - strb r0, [r4, 0x9] - str r2, [r7] - ldr r1, =0x0202420c - ldrb r0, [r6] - strb r0, [r1] - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] - b _080509D0 - .pool -_08050984: - ldr r5, =0x020241f0 - ldrh r0, [r1, 0x2C] - ldrb r1, [r4, 0x9] - movs r2, 0x3 - subs r2, r1 - movs r4, 0x1 - adds r1, r4, 0 - lsls r1, r2 - bl __divsi3 - str r0, [r5] - cmp r0, 0 - bne _080509A0 - str r4, [r5] -_080509A0: - ldr r0, [r5] - negs r0, r0 - str r0, [r5] - ldr r3, =0x02024474 - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r8 - ldrb r0, [r0, 0x9] - movs r2, 0 - strb r0, [r3, 0x18] - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r8 - strb r2, [r0, 0x9] - ldr r0, [r7] - adds r0, 0x5 - str r0, [r7] - ldr r1, =0x0202420c - ldrb r0, [r6] - strb r0, [r1] -_080509D0: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk87_stockpiletohprecovery - - thumb_func_start atk88_negativedamage -atk88_negativedamage: @ 80509E8 - push {lr} - ldr r2, =0x020241f0 - ldr r0, =0x020241f4 - ldr r0, [r0] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - negs r0, r0 - str r0, [r2] - cmp r0, 0 - bne _08050A04 - movs r0, 0x1 - negs r0, r0 - str r0, [r2] -_08050A04: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end atk88_negativedamage - - thumb_func_start sub_8050A1C -sub_8050A1C: @ 8050A1C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r8, r3 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r5, r2, 24 - movs r0, 0 - mov r9, r0 - mov r10, r0 - movs r0, 0x40 - ands r0, r5 - cmp r0, 0 - beq _08050A50 - ldr r0, =0x02024064 - ldr r1, =0x0202420b - b _08050A54 - .pool -_08050A50: - ldr r0, =0x02024064 - ldr r1, =0x0202420c -_08050A54: - ldrb r1, [r1] - strb r1, [r0] - movs r0, 0xBF - ands r5, r0 - movs r0, 0x80 - ands r0, r5 - cmp r0, 0 - beq _08050A6E - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_08050A6E: - movs r0, 0x7F - ands r5, r0 - movs r0, 0x20 - ands r0, r5 - cmp r0, 0 - beq _08050A84 - mov r0, r10 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 -_08050A84: - movs r0, 0xDF - ands r5, r0 - ldr r1, =0x02022f58 - movs r4, 0 - movs r2, 0xFD - strb r2, [r1] - movs r0, 0x5 - strb r0, [r1, 0x1] - strb r7, [r1, 0x2] - movs r3, 0x1 - negs r3, r3 - mov r12, r3 - movs r0, 0xFF - strb r0, [r1, 0x3] - lsls r0, r6, 24 - cmp r0, 0 - blt _08050AA8 - b _08050D8C -_08050AA8: - ldr r4, =0x02024294 - ldr r1, =0x02024064 - ldrb r0, [r1] - bl battle_get_per_side_status - movs r1, 0x1 - ands r1, r0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x4] - cmp r0, 0 - beq _08050B48 - mov r2, r9 - cmp r2, 0 - bne _08050B48 - ldr r0, =0x020241ea - ldrh r0, [r0] - cmp r0, 0xAE - beq _08050B78 - cmp r5, 0x1 - bne _08050B68 - ldr r4, =0x0202437c - ldr r3, =0x02024064 - ldrb r0, [r3] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r0, [r1] - lsls r0, 31 - cmp r0, 0 - beq _08050B10 - ldr r0, =0x02024214 - mov r4, r8 - str r4, [r0] - b _08050B68 - .pool -_08050B10: - mov r0, r8 - bl b_movescr_stack_push - ldr r1, =0x02024474 - ldr r6, =0x02024064 - ldrb r0, [r6] - strb r0, [r1, 0x17] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAE03 - str r0, [r1] - ldrb r1, [r6] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] - b _08050B68 - .pool -_08050B48: - ldr r0, =0x020241ea - ldrh r0, [r0] - cmp r0, 0xAE - beq _08050B78 - mov r0, r10 - cmp r0, 0x1 - beq _08050B78 - movs r0, 0 - bl sub_80464AC - lsls r0, 24 - cmp r0, 0 - beq _08050B78 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082D9F1C - str r0, [r1] -_08050B68: - movs r0, 0x1 - b _08050E80 - .pool -_08050B78: - ldr r2, =0x02024084 - ldr r1, =0x02024064 - ldrb r3, [r1] - movs r4, 0x58 - adds r0, r3, 0 - muls r0, r4 - adds r0, r2 - adds r0, 0x20 - ldrb r0, [r0] - mov r10, r2 - cmp r0, 0x1D - beq _08050B94 - cmp r0, 0x49 - bne _08050C2C -_08050B94: - mov r0, r9 - cmp r0, 0 - bne _08050C2C - ldr r0, =0x020241ea - ldrh r0, [r0] - cmp r0, 0xAE - beq _08050C2C - cmp r5, 0x1 - bne _08050B68 - ldr r4, =0x0202437c - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0] - lsls r0, 31 - cmp r0, 0 - beq _08050BD4 - ldr r0, =0x02024214 - mov r1, r8 - str r1, [r0] - b _08050B68 - .pool -_08050BD4: - mov r0, r8 - bl b_movescr_stack_push - ldr r1, =0x02024474 - ldr r2, =0x02024064 - ldrb r0, [r2] - strb r0, [r1, 0x17] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB5C7 - str r0, [r1] - ldr r1, =0x0202420a - ldrb r0, [r2] - movs r3, 0x58 - muls r0, r3 - add r0, r10 - adds r0, 0x20 - ldrb r0, [r0] - strb r0, [r1] - ldrb r0, [r2] - ldrb r1, [r1] - bl b_history__record_ability_usage_of_player - ldr r6, =0x02024064 - ldrb r1, [r6] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] - b _08050B68 - .pool -_08050C2C: - ldr r1, =0x02024064 - ldrb r0, [r1] - movs r4, 0x58 - muls r0, r4 - add r0, r10 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x33 - bne _08050C8C - mov r2, r9 - cmp r2, 0 - bne _08050C8C - cmp r7, 0x6 - bne _08050C8C - cmp r5, 0x1 - bne _08050B68 - mov r0, r8 - bl b_movescr_stack_push - ldr r1, =0x02024474 - ldr r3, =0x02024064 - ldrb r0, [r3] - strb r0, [r1, 0x17] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB62F - str r0, [r1] - ldr r1, =0x0202420a - ldrb r0, [r3] - muls r0, r4 - add r0, r10 - adds r0, 0x20 - ldrb r0, [r0] - strb r0, [r1] - ldrb r0, [r3] - ldrb r1, [r1] - bl b_history__record_ability_usage_of_player - b _08050B68 - .pool -_08050C8C: - ldr r4, =0x02024064 - ldrb r0, [r4] - movs r4, 0x58 - muls r0, r4 - add r0, r10 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x34 - bne _08050CF0 - mov r0, r9 - cmp r0, 0 - bne _08050CF0 - cmp r7, 0x1 - bne _08050CF0 - cmp r5, 0x1 - beq _08050CAE - b _08050B68 -_08050CAE: - mov r0, r8 - bl b_movescr_stack_push - ldr r1, =0x02024474 - ldr r2, =0x02024064 - ldrb r0, [r2] - strb r0, [r1, 0x17] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB62F - str r0, [r1] - ldr r1, =0x0202420a - ldrb r0, [r2] - muls r0, r4 - add r0, r10 - adds r0, 0x20 - ldrb r0, [r0] - strb r0, [r1] - ldrb r0, [r2] - ldrb r1, [r1] - bl b_history__record_ability_usage_of_player - b _08050B68 - .pool -_08050CF0: - ldr r3, =0x02024064 - ldrb r1, [r3] - movs r0, 0x58 - muls r0, r1 - add r0, r10 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x13 - bne _08050D08 - cmp r5, 0 - bne _08050D08 - b _08050B68 -_08050D08: - lsls r0, r6, 24 - asrs r0, 28 - movs r1, 0x7 - ands r0, r1 - negs r0, r0 - lsls r0, 24 - ldr r3, =0x02022f68 - movs r4, 0 - movs r1, 0xFD - strb r1, [r3] - movs r2, 0x1 - lsrs r6, r0, 24 - asrs r0, 24 - subs r1, 0xFF - cmp r0, r1 - bne _08050D32 - strb r4, [r3, 0x1] - movs r0, 0xD3 - strb r0, [r3, 0x2] - strb r4, [r3, 0x3] - movs r2, 0x4 -_08050D32: - adds r0, r2, r3 - strb r4, [r0] - adds r2, 0x1 - adds r1, r2, r3 - movs r0, 0xD4 - strb r0, [r1] - adds r2, 0x1 - adds r0, r2, r3 - strb r4, [r0] - adds r2, 0x1 - adds r1, r2, r3 - movs r0, 0xFF - strb r0, [r1] - ldr r4, =0x02024064 - ldrb r2, [r4] - movs r0, 0x58 - muls r0, r2 - adds r0, r7, r0 - mov r1, r10 - adds r1, 0x18 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - beq _08050DE2 - movs r1, 0 - ldr r0, =0x0202420c - ldrb r0, [r0] - ldr r3, =0x02024332 - mov r8, r3 - cmp r0, r2 - bne _08050D76 - movs r1, 0x1 -_08050D76: - mov r4, r8 - strb r1, [r4, 0x5] - b _08050E10 - .pool -_08050D8C: - asrs r6, r0, 28 - movs r0, 0x7 - ands r6, r0 - ldr r3, =0x02022f68 - strb r2, [r3] - movs r2, 0x1 - cmp r6, 0x2 - bne _08050DA6 - strb r4, [r3, 0x1] - movs r0, 0xD1 - strb r0, [r3, 0x2] - strb r4, [r3, 0x3] - movs r2, 0x4 -_08050DA6: - adds r0, r2, r3 - strb r4, [r0] - adds r2, 0x1 - adds r1, r2, r3 - movs r0, 0xD2 - strb r0, [r1] - adds r2, 0x1 - adds r0, r2, r3 - strb r4, [r0] - adds r2, 0x1 - adds r1, r2, r3 - ldrb r0, [r1] - mov r2, r12 - orrs r0, r2 - strb r0, [r1] - ldr r2, =0x02024084 - ldr r4, =0x02024064 - ldrb r3, [r4] - movs r0, 0x58 - muls r0, r3 - adds r0, r7, r0 - adds r1, r2, 0 - adds r1, 0x18 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - mov r10, r2 - cmp r0, 0xC - bne _08050DFC -_08050DE2: - ldr r1, =0x02024332 - movs r0, 0x2 - strb r0, [r1, 0x5] - mov r8, r1 - b _08050E10 - .pool -_08050DFC: - movs r1, 0 - ldr r0, =0x0202420c - ldrb r0, [r0] - ldr r2, =0x02024332 - mov r8, r2 - cmp r0, r3 - bne _08050E0C - movs r1, 0x1 -_08050E0C: - mov r3, r8 - strb r1, [r3, 0x5] -_08050E10: - ldr r2, =0x02024064 - ldrb r0, [r2] - movs r4, 0x58 - adds r1, r0, 0 - muls r1, r4 - adds r1, r7, r1 - mov r3, r10 - adds r3, 0x18 - adds r1, r3 - lsls r0, r6, 24 - asrs r0, 24 - ldrb r6, [r1] - adds r0, r6 - strb r0, [r1] - ldrb r0, [r2] - muls r0, r4 - adds r0, r7, r0 - adds r1, r0, r3 - movs r0, 0 - ldrsb r0, [r1, r0] - cmp r0, 0 - bge _08050E40 - movs r0, 0 - strb r0, [r1] -_08050E40: - ldr r1, =0x02024064 - ldrb r0, [r1] - muls r0, r4 - adds r0, r7, r0 - adds r1, r0, r3 - movs r0, 0 - ldrsb r0, [r1, r0] - cmp r0, 0xC - ble _08050E56 - movs r0, 0xC - strb r0, [r1] -_08050E56: - mov r2, r8 - ldrb r0, [r2, 0x5] - cmp r0, 0x2 - bne _08050E7E - movs r3, 0x1 - ands r3, r5 - cmp r3, 0 - beq _08050E70 - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] -_08050E70: - mov r4, r8 - ldrb r0, [r4, 0x5] - cmp r0, 0x2 - bne _08050E7E - cmp r3, 0 - bne _08050E7E - b _08050B68 -_08050E7E: - movs r0, 0 -_08050E80: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8050A1C - - thumb_func_start atk89_statbuffchange -atk89_statbuffchange: @ 8050EA0 - push {r4,r5,lr} - ldr r5, =0x02024214 - ldr r2, [r5] - ldrb r3, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r3, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r3, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r3, r0 - ldr r0, =0x02024474 - ldrb r4, [r0, 0x1A] - movs r0, 0xF0 - ands r0, r4 - lsls r0, 24 - asrs r0, 24 - movs r1, 0xF - ands r1, r4 - ldrb r2, [r2, 0x1] - bl sub_8050A1C - lsls r0, 24 - cmp r0, 0 - bne _08050EDC - ldr r0, [r5] - adds r0, 0x6 - str r0, [r5] -_08050EDC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk89_statbuffchange - - thumb_func_start atk8A_normalisebuffs -atk8A_normalisebuffs: @ 8050EEC - push {r4-r7,lr} - movs r2, 0 - ldr r0, =0x0202406c - ldrb r1, [r0] - ldr r0, =0x02024214 - mov r12, r0 - cmp r2, r1 - bge _08050F24 - ldr r0, =0x02024084 - movs r4, 0x6 - adds r5, r1, 0 - movs r7, 0x58 - adds r6, r0, 0 - adds r6, 0x18 -_08050F08: - adds r3, r2, 0x1 - movs r1, 0x7 - adds r0, r2, 0 - muls r0, r7 - adds r0, r6 - adds r0, 0x7 -_08050F14: - strb r4, [r0] - subs r0, 0x1 - subs r1, 0x1 - cmp r1, 0 - bge _08050F14 - adds r2, r3, 0 - cmp r2, r5 - blt _08050F08 -_08050F24: - mov r1, r12 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk8A_normalisebuffs - - thumb_func_start atk8B_setbide -atk8B_setbide: @ 8050F40 - push {r4,r5,lr} - ldr r4, =0x02024084 - ldr r3, =0x0202420b - ldrb r0, [r3] - movs r5, 0x58 - adds r2, r0, 0 - muls r2, r5 - adds r4, 0x50 - adds r2, r4 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 5 - orrs r0, r1 - str r0, [r2] - ldr r1, =0x02024268 - ldrb r0, [r3] - lsls r0, 1 - adds r0, r1 - ldr r1, =0x020241ea - ldrh r1, [r1] - movs r2, 0 - strh r1, [r0] - ldr r1, =0x020241f8 - ldrb r0, [r3] - lsls r0, 2 - adds r0, r1 - str r2, [r0] - ldrb r0, [r3] - adds r1, r0, 0 - muls r1, r5 - adds r1, r4 - ldr r0, [r1] - movs r2, 0x80 - lsls r2, 2 - orrs r0, r2 - str r0, [r1] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk8B_setbide - - thumb_func_start atk8C_confuseifrepeatingattackends -atk8C_confuseifrepeatingattackends: @ 8050FB0 - push {lr} - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0xC0 - lsls r1, 4 - ands r0, r1 - cmp r0, 0 - bne _08050FD2 - ldr r1, =0x02024332 - movs r0, 0x75 - strb r0, [r1, 0x3] -_08050FD2: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end atk8C_confuseifrepeatingattackends - - thumb_func_start atk8D_setloopcounter -atk8D_setloopcounter: @ 8050FF0 - push {r4,r5,lr} - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r1, [r0, 0x1] - cmp r1, 0 - beq _0805100C - ldr r0, =0x02024212 - strb r1, [r0] - b _08051026 - .pool -_0805100C: - ldr r4, =0x02024212 - bl GenerateRandomNumber - movs r5, 0x3 - ands r0, r5 - strb r0, [r4] - cmp r0, 0x1 - bls _08051022 - bl GenerateRandomNumber - ands r0, r5 -_08051022: - adds r0, 0x2 - strb r0, [r4] -_08051026: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk8D_setloopcounter - - thumb_func_start atk8E_cmd8e -atk8E_cmd8e: @ 805103C - ldr r1, =0x02024474 - movs r2, 0 - movs r0, 0xFD - strb r0, [r1, 0x8] - movs r0, 0x1 - strb r0, [r1, 0x9] - strb r0, [r1, 0xA] - strb r0, [r1, 0xB] - strb r2, [r1, 0xC] - movs r0, 0xFF - strb r0, [r1, 0xD] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end atk8E_cmd8e - - thumb_func_start sub_8051064 -sub_8051064: @ 8051064 - push {r4-r7,lr} - ldr r6, =0x02024084 - ldr r7, =0x0202420b - ldrb r0, [r7] - movs r5, 0x58 - adds r1, r0, 0 - muls r1, r5 - adds r1, r6 - adds r1, 0x2A - ldr r4, =0x0202420c - ldrb r3, [r4] - adds r0, r3, 0 - muls r0, r5 - adds r0, r6 - adds r0, 0x2A - ldrb r1, [r1] - ldrb r0, [r0] - cmp r1, r0 - bcc _080510AC - ldr r0, =0x0202449c - ldr r1, [r0] - adds r1, r3, r1 - adds r1, 0x58 - ldr r2, =0x0202406e - lsls r0, r3, 1 - b _08051108 - .pool -_080510AC: - bl GenerateRandomNumber - movs r3, 0xFF - ands r3, r0 - ldrb r0, [r7] - muls r0, r5 - adds r0, r6 - adds r0, 0x2A - ldrb r2, [r0] - ldrb r4, [r4] - adds r0, r4, 0 - muls r0, r5 - adds r0, r6 - adds r0, 0x2A - ldrb r1, [r0] - adds r2, r1 - adds r0, r3, 0 - muls r0, r2 - asrs r0, 8 - adds r0, 0x1 - lsrs r1, 2 - cmp r0, r1 - bhi _080510FC - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - movs r0, 0 - b _08051116 - .pool -_080510FC: - ldr r0, =0x0202449c - ldr r1, [r0] - adds r1, r4, r1 - adds r1, 0x58 - ldr r2, =0x0202406e - lsls r0, r4, 1 -_08051108: - adds r0, r2 - ldrh r0, [r0] - strb r0, [r1] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DADD8 - str r0, [r1] - movs r0, 0x1 -_08051116: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8051064 - - thumb_func_start sub_805112C -sub_805112C: @ 805112C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - movs r0, 0 - str r0, [sp, 0x4] - ldr r5, =0x02022fec - ldr r0, [r5] - movs r1, 0x8 - ands r0, r1 - cmp r0, 0 - bne _0805114A - b _08051410 -_0805114A: - ldr r4, =0x0202420c - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - ldr r1, =0x02024744 - str r1, [sp] - cmp r0, 0 - bne _08051160 - ldr r0, =0x020244ec - str r0, [sp] -_08051160: - ldr r2, [r5] - movs r1, 0x81 - lsls r1, 1 - adds r0, r2, 0 - ands r0, r1 - cmp r0, r1 - beq _08051182 - ldr r1, =0x02000100 - adds r0, r2, 0 - ands r0, r1 - cmp r0, r1 - beq _08051182 - movs r0, 0x80 - lsls r0, 15 - ands r0, r2 - cmp r0, 0 - beq _080511C8 -_08051182: - ldr r2, =0x0202420c - ldrb r1, [r2] - movs r0, 0x2 - ands r0, r1 - adds r1, r2, 0 - cmp r0, 0 - beq _080511AC - movs r0, 0x3 - mov r9, r0 - movs r0, 0x6 - b _080511B2 - .pool -_080511AC: - movs r0, 0 - mov r9, r0 - movs r0, 0x3 -_080511B2: - mov r8, r0 - movs r0, 0x3 - mov r10, r0 - movs r0, 0x1 - str r0, [sp, 0x8] - ldr r2, =0x0202406e - ldrb r1, [r1] - b _0805128E - .pool -_080511C8: - movs r0, 0x42 - ands r0, r2 - cmp r0, 0x42 - beq _080511DA - ldr r1, =0x02000040 - adds r0, r2, 0 - ands r0, r1 - cmp r0, r1 - bne _0805121C -_080511DA: - ldrb r0, [r4] - bl sub_806D864 - lsls r0, 24 - lsrs r0, 24 - bl sub_806D82C - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bne _080511FC - movs r1, 0x3 - mov r9, r1 - movs r0, 0x6 - b _08051202 - .pool -_080511FC: - movs r1, 0 - mov r9, r1 - movs r0, 0x3 -_08051202: - mov r8, r0 - movs r1, 0x3 - mov r10, r1 - movs r0, 0x1 - str r0, [sp, 0x8] - ldr r2, =0x0202406e - ldr r0, =0x0202420c - ldrb r1, [r0] - b _0805128E - .pool -_0805121C: - movs r0, 0x80 - lsls r0, 8 - ands r0, r2 - cmp r0, 0 - beq _08051274 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08051240 - movs r1, 0 - mov r9, r1 - movs r0, 0x6 - mov r8, r0 - mov r10, r0 - movs r1, 0x2 - b _08051260 -_08051240: - ldrb r1, [r4] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08051252 - movs r0, 0x3 - mov r9, r0 - movs r1, 0x6 - b _08051258 -_08051252: - movs r0, 0 - mov r9, r0 - movs r1, 0x3 -_08051258: - mov r8, r1 - movs r0, 0x3 - mov r10, r0 - movs r1, 0x1 -_08051260: - str r1, [sp, 0x8] - ldr r2, =0x0202406e - ldr r0, =0x0202420c - ldrb r1, [r0] - b _0805128E - .pool -_08051274: - movs r0, 0x1 - ands r2, r0 - cmp r2, 0 - beq _080512A4 - movs r0, 0 - mov r9, r0 - movs r1, 0x6 - mov r8, r1 - mov r10, r1 - movs r0, 0x2 - str r0, [sp, 0x8] - ldr r2, =0x0202406e - ldrb r1, [r4] -_0805128E: - lsls r0, r1, 1 - adds r0, r2 - ldrh r7, [r0] - movs r0, 0x2 - eors r1, r0 - lsls r1, 1 - adds r1, r2 - ldrh r5, [r1] - b _080512BE - .pool -_080512A4: - movs r1, 0 - mov r9, r1 - movs r0, 0x6 - mov r8, r0 - mov r10, r0 - movs r1, 0x1 - str r1, [sp, 0x8] - ldr r1, =0x0202406e - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - ldrh r5, [r0] - adds r7, r5, 0 -_080512BE: - mov r6, r9 - cmp r6, r8 - bge _080512FC -_080512C4: - movs r0, 0x64 - muls r0, r6 - ldr r1, [sp] - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _080512F6 - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _080512F6 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _080512F6 - ldr r0, [sp, 0x4] - adds r0, 0x1 - str r0, [sp, 0x4] -_080512F6: - adds r6, 0x1 - cmp r6, r8 - blt _080512C4 -_080512FC: - ldr r1, [sp, 0x4] - ldr r0, [sp, 0x8] - cmp r1, r0 - bgt _08051328 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08051414 - .pool -_08051328: - bl sub_8051064 - lsls r0, 24 - cmp r0, 0 - beq _08051378 -_08051332: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - mov r1, r10 - bl __modsi3 - adds r6, r0, 0 - add r6, r9 - cmp r6, r7 - beq _08051332 - cmp r6, r5 - beq _08051332 - movs r0, 0x64 - muls r0, r6 - ldr r1, [sp] - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _08051332 - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0x1 - beq _08051332 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _08051332 -_08051378: - ldr r4, =0x0202420c - ldrb r0, [r4] - ldr r1, =0x0202449c - ldr r1, [r1] - adds r0, r1 - adds r0, 0x5C - strb r6, [r0] - bl sub_81B1250 - lsls r0, 24 - cmp r0, 0 - bne _08051396 - ldrb r0, [r4] - bl sub_803BDA0 -_08051396: - ldr r0, =0x02022fec - ldr r2, [r0] - movs r1, 0x81 - lsls r1, 1 - adds r0, r2, 0 - ands r0, r1 - cmp r0, r1 - beq _080513C0 - movs r0, 0x42 - ands r0, r2 - cmp r0, 0x42 - beq _080513C0 - ldr r1, =0x02000100 - adds r0, r2, 0 - ands r0, r1 - cmp r0, r1 - beq _080513C0 - ldr r0, =0x02000040 - ands r2, r0 - cmp r2, r0 - bne _080513DE -_080513C0: - ldr r5, =0x0202420c - ldrb r0, [r5] - lsls r4, r6, 24 - lsrs r4, 24 - adds r1, r4, 0 - movs r2, 0 - bl sub_81B8E80 - ldrb r1, [r5] - movs r0, 0x2 - eors r0, r1 - adds r1, r4, 0 - movs r2, 0x1 - bl sub_81B8E80 -_080513DE: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 15 - ands r0, r1 - cmp r0, 0 - beq _08051414 - ldr r0, =0x0202420c - ldrb r0, [r0] - lsls r1, r6, 24 - lsrs r1, 24 - bl sub_80571DC - b _08051414 - .pool -_08051410: - bl sub_8051064 -_08051414: - 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_805112C - - thumb_func_start sub_8051424 -sub_8051424: @ 8051424 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r6, 0 - ldr r2, =0x02024084 - ldr r3, =0x0202420b - ldrb r1, [r3] - movs r0, 0x58 - muls r0, r1 - adds r1, r2, 0 - adds r1, 0xC - adds r0, r1 - ldrh r0, [r0] - mov r8, r2 - cmp r0, 0 - beq _08051466 - movs r5, 0x58 - adds r2, r1, 0 -_0805144C: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x3 - bhi _08051466 - lsls r1, r6, 1 - ldrb r0, [r3] - muls r0, r5 - adds r1, r0 - adds r1, r2 - ldrh r0, [r1] - cmp r0, 0 - bne _0805144C -_08051466: - movs r3, 0 - cmp r3, r6 - bcs _080514E8 - ldr r0, =gBattleMoves - mov r10, r0 - ldr r5, =0x02024084 - mov r12, r5 - ldr r7, =0x0202420b - ldrb r0, [r7] - movs r4, 0x58 - adds r5, r0, 0 - muls r5, r4 - movs r0, 0xC - add r0, r12 - mov r9, r0 -_08051484: - lsls r0, r3, 1 - adds r0, r5 - add r0, r9 - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - add r0, r10 - ldrb r2, [r0, 0x2] - cmp r2, 0x9 - bne _080514C6 - mov r0, r8 - adds r1, r5, r0 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0x7 - beq _080514B2 - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0x7 - bne _080514C4 -_080514B2: - movs r2, 0x7 - b _080514C6 - .pool -_080514C4: - movs r2, 0 -_080514C6: - ldrb r0, [r7] - muls r0, r4 - add r0, r12 - adds r1, r0, 0 - adds r1, 0x21 - ldrb r1, [r1] - cmp r2, r1 - beq _080514DE - adds r0, 0x22 - ldrb r0, [r0] - cmp r2, r0 - bne _080514E8 -_080514DE: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r6 - bcc _08051484 -_080514E8: - cmp r3, r6 - bne _0805150C - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _080515B0 - .pool -_0805150C: - movs r7, 0x3 - ldr r5, =gBattleMoves - mov r9, r5 -_08051512: - bl GenerateRandomNumber - adds r3, r0, 0 - ands r3, r7 - cmp r3, r6 - bcs _08051512 - ldr r4, =0x02024084 - lsls r1, r3, 1 - ldr r3, =0x0202420b - ldrb r2, [r3] - movs r0, 0x58 - adds r5, r2, 0 - muls r5, r0 - adds r1, r5 - adds r0, r4, 0 - adds r0, 0xC - adds r1, r0 - ldrh r1, [r1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - add r0, r9 - ldrb r2, [r0, 0x2] - mov r8, r4 - adds r4, r3, 0 - cmp r2, 0x9 - bne _08051572 - mov r0, r8 - adds r2, r5, r0 - adds r0, r2, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0x7 - beq _08051560 - adds r0, r2, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0x7 - bne _08051570 -_08051560: - movs r2, 0x7 - b _08051572 - .pool -_08051570: - movs r2, 0 -_08051572: - ldrb r0, [r4] - movs r3, 0x58 - muls r0, r3 - add r0, r8 - adds r1, r0, 0 - adds r1, 0x21 - ldrb r5, [r1] - cmp r2, r5 - beq _08051512 - adds r0, 0x22 - ldrb r0, [r0] - cmp r2, r0 - beq _08051512 - strb r2, [r1] - ldrb r0, [r4] - muls r0, r3 - add r0, r8 - adds r0, 0x22 - strb r2, [r0] - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x3 - strb r0, [r1, 0x1] - strb r2, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x3] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_080515B0: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8051424 - - thumb_func_start atk91_givemoney -atk91_givemoney: @ 80515C8 - push {r4,lr} - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x02000002 - ands r0, r1 - cmp r0, 0 - bne _08051650 - ldr r1, =0x0202432e - ldrh r0, [r1] - cmp r0, 0 - beq _08051650 - adds r1, r0, 0 - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x4A - ldrb r0, [r0] - adds r4, r1, 0 - muls r4, r0 - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r1, 0x92 - lsls r1, 3 - adds r0, r1 - adds r1, r4, 0 - bl add_money - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x1 - strb r0, [r1, 0x1] - movs r0, 0x2 - strb r0, [r1, 0x2] - movs r0, 0x5 - strb r0, [r1, 0x3] - strb r4, [r1, 0x4] - movs r0, 0xFF - lsls r0, 8 - ands r4, r0 - lsrs r4, 8 - strb r4, [r1, 0x5] - movs r0, 0xFF - strb r0, [r1, 0x6] - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082DB307 - str r0, [r4] - b _08051658 - .pool -_08051650: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] -_08051658: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk91_givemoney - - thumb_func_start atk92_setlightscreen -atk92_setlightscreen: @ 8051664 - push {r4-r6,lr} - ldr r5, =0x0202420b - ldrb r0, [r5] - bl battle_get_per_side_status - ldr r4, =0x0202428e - movs r6, 0x1 - adds r1, r6, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - ldrh r1, [r1] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080516A4 - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024332 - movs r0, 0 - b _08051718 - .pool -_080516A4: - ldrb r0, [r5] - bl battle_get_per_side_status - adds r1, r6, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - ldrh r0, [r1] - movs r2, 0x2 - orrs r0, r2 - strh r0, [r1] - ldrb r0, [r5] - bl battle_get_per_side_status - ldr r4, =0x02024294 - adds r1, r6, 0 - ands r1, r0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x5 - strb r1, [r0, 0x2] - ldrb r0, [r5] - bl battle_get_per_side_status - adds r1, r6, 0 - ands r1, r0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r5] - strb r1, [r0, 0x3] - ldr r0, =0x02022fec - ldr r0, [r0] - ands r0, r6 - cmp r0, 0 - beq _08051714 - movs r0, 0x1 - bl sub_8069DEC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08051714 - ldr r1, =0x02024332 - movs r0, 0x4 - b _08051718 - .pool -_08051714: - ldr r1, =0x02024332 - movs r0, 0x3 -_08051718: - strb r0, [r1, 0x5] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atk92_setlightscreen - - thumb_func_start atk93_ko_move -atk93_ko_move: @ 8051730 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r7, =0x02024084 - ldr r6, =0x0202420c - ldrb r2, [r6] - movs r5, 0x58 - adds r0, r2, 0 - muls r0, r5 - adds r1, r0, r7 - ldrh r0, [r1, 0x2E] - cmp r0, 0xAF - bne _08051768 - ldr r1, =0x02024404 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r4, [r0, 0x7] - ldrb r6, [r0, 0x1A] - b _08051782 - .pool -_08051768: - ldrh r0, [r1, 0x2E] - bl itemid_get_x12 - lsls r0, 24 - lsrs r4, r0, 24 - ldrb r0, [r6] - muls r0, r5 - adds r0, r7 - ldrh r0, [r0, 0x2E] - bl itemid_get_quality - lsls r0, 24 - lsrs r6, r0, 24 -_08051782: - ldr r1, =0x0202420f - ldr r5, =0x0202420c - ldrb r0, [r5] - strb r0, [r1] - cmp r4, 0x27 - bne _080517C0 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, r6 - bcs _080517C0 - ldrb r0, [r5] - movs r1, 0x27 - bl b_history__record_item_x12_of_player - ldr r2, =0x0202437c - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0] -_080517C0: - ldr r1, =0x02024084 - ldr r2, =0x0202420c - ldrb r3, [r2] - movs r6, 0x58 - adds r0, r3, 0 - muls r0, r6 - adds r5, r0, r1 - adds r0, r5, 0 - adds r0, 0x20 - ldrb r4, [r0] - mov r8, r1 - mov r9, r2 - cmp r4, 0x5 - bne _0805181C - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - ldr r0, =0x0202420a - strb r4, [r0] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB552 - str r0, [r1] - mov r1, r9 - ldrb r0, [r1] - movs r1, 0x5 - bl b_history__record_ability_usage_of_player - b _08051A70 - .pool -_0805181C: - ldr r1, =0x020242ac - lsls r0, r3, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x18 - ands r0, r1 - cmp r0, 0 - bne _080518A0 - ldr r1, =gBattleMoves - ldr r0, =0x020241ea - ldrh r0, [r0] - lsls r2, r0, 1 - adds r2, r0 - lsls r2, 2 - adds r2, r1 - ldr r7, =0x0202420b - ldrb r0, [r7] - muls r0, r6 - add r0, r8 - adds r0, 0x2A - ldrb r0, [r0] - adds r1, r5, 0 - adds r1, 0x2A - ldrb r1, [r1] - subs r0, r1 - ldrb r2, [r2, 0x3] - adds r0, r2 - lsls r0, 16 - lsrs r4, r0, 16 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - adds r0, 0x1 - cmp r0, r4 - blt _08051870 - b _08051A08 -_08051870: - ldrb r0, [r7] - adds r1, r0, 0 - muls r1, r6 - add r1, r8 - adds r1, 0x2A - mov r2, r9 - ldrb r0, [r2] - muls r0, r6 - add r0, r8 - adds r0, 0x2A - ldrb r1, [r1] - movs r4, 0x1 - ldrb r0, [r0] - cmp r1, r0 - bcs _08051936 - b _08051A08 - .pool -_080518A0: - ldr r1, =0x020242bc - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r1 - ldr r1, =0x0202420b - ldrb r0, [r0, 0x15] - adds r7, r1, 0 - ldrb r3, [r7] - cmp r0, r3 - bne _080518CA - ldrb r0, [r7] - muls r0, r6 - add r0, r8 - adds r0, 0x2A - adds r1, r5, 0 - adds r1, 0x2A - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bcs _08051942 -_080518CA: - ldr r1, =gBattleMoves - ldr r0, =0x020241ea - ldrh r0, [r0] - lsls r2, r0, 1 - adds r2, r0 - lsls r2, 2 - adds r2, r1 - ldr r6, =0x02024084 - ldrb r0, [r7] - movs r5, 0x58 - muls r0, r5 - adds r0, r6 - adds r0, 0x2A - ldrb r1, [r0] - ldr r0, =0x0202420c - mov r8, r0 - ldrb r0, [r0] - muls r0, r5 - adds r0, r6 - adds r0, 0x2A - ldrb r0, [r0] - subs r1, r0 - ldrb r2, [r2, 0x3] - adds r1, r2 - lsls r1, 16 - lsrs r4, r1, 16 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - adds r0, 0x1 - cmp r0, r4 - bge _08051934 - ldrb r0, [r7] - adds r1, r0, 0 - muls r1, r5 - adds r1, r6 - adds r1, 0x2A - mov r2, r8 - ldrb r0, [r2] - muls r0, r5 - adds r0, r6 - adds r0, 0x2A - ldrb r1, [r1] - movs r4, 0x1 - ldrb r0, [r0] - cmp r1, r0 - bcs _08051936 -_08051934: - movs r4, 0 -_08051936: - ldr r3, =0x02024084 - mov r8, r3 - ldr r0, =0x0202420c - mov r9, r0 - cmp r4, 0 - beq _08051A08 -_08051942: - ldr r0, =0x0202433c - mov r1, r9 - ldrb r2, [r1] - lsls r1, r2, 4 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 30 - cmp r0, 0 - bge _08051990 - ldr r1, =0x020241f0 - movs r0, 0x58 - muls r0, r2 - add r0, r8 - ldrh r0, [r0, 0x28] - subs r0, 0x1 - str r0, [r1] - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x40 - b _080519EE - .pool -_08051990: - ldr r0, =0x0202437c - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1] - lsrs r0, 7 - cmp r0, 0 - beq _080519DC - ldr r1, =0x020241f0 - movs r3, 0x58 - adds r0, r2, 0 - muls r0, r3 - add r0, r8 - ldrh r0, [r0, 0x28] - subs r0, 0x1 - str r0, [r1] - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024208 - mov r2, r9 - ldrb r0, [r2] - muls r0, r3 - add r0, r8 - ldrh r0, [r0, 0x2E] - strh r0, [r1] - b _080519F2 - .pool -_080519DC: - ldr r1, =0x020241f0 - movs r0, 0x58 - muls r0, r2 - add r0, r8 - ldrh r0, [r0, 0x28] - str r0, [r1] - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x10 -_080519EE: - orrs r0, r1 - strb r0, [r2] -_080519F2: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _08051A70 - .pool -_08051A08: - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - ldr r3, =0x02024084 - ldr r0, =0x0202420b - ldrb r0, [r0] - movs r2, 0x58 - adds r1, r0, 0 - muls r1, r2 - adds r1, r3 - adds r1, 0x2A - ldr r0, =0x0202420c - ldrb r0, [r0] - muls r0, r2 - adds r0, r3 - adds r0, 0x2A - ldrb r1, [r1] - ldrb r0, [r0] - cmp r1, r0 - bcc _08051A50 - ldr r1, =0x02024332 - movs r0, 0 - b _08051A54 - .pool -_08051A50: - ldr r1, =0x02024332 - movs r0, 0x1 -_08051A54: - strb r0, [r1, 0x5] - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_08051A70: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk93_ko_move - - thumb_func_start atk94_gethalfcurrentenemyhp -atk94_gethalfcurrentenemyhp: @ 8051A84 - push {lr} - ldr r3, =0x020241f0 - ldr r2, =0x02024084 - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r0, [r0, 0x28] - lsrs r0, 1 - str r0, [r3] - cmp r0, 0 - bne _08051AA2 - movs r0, 0x1 - str r0, [r3] -_08051AA2: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end atk94_gethalfcurrentenemyhp - - thumb_func_start sub_8051AC0 -sub_8051AC0: @ 8051AC0 - push {lr} - ldr r2, =0x020243cc - ldrh r1, [r2] - movs r0, 0x18 - ands r0, r1 - cmp r0, 0 - beq _08051AEC - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024332 - movs r0, 0x2 - strb r0, [r1, 0x5] - b _08051AFE - .pool -_08051AEC: - movs r0, 0x8 - strh r0, [r2] - ldr r1, =0x02024332 - movs r0, 0x3 - strb r0, [r1, 0x5] - ldr r0, =0x020243d0 - adds r0, 0x28 - movs r1, 0x5 - strb r1, [r0] -_08051AFE: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8051AC0 - - thumb_func_start sub_8051B18 -sub_8051B18: @ 8051B18 - push {r4,r5,lr} - sub sp, 0x4 - movs r0, 0 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _08051B36 - b _08051C48 -_08051B36: - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0x4D - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _08051B4C - b _08051C48 -_08051B4C: - ldr r2, =0x020243cc - ldrh r1, [r2] - movs r0, 0x18 - ands r0, r1 - adds r4, r2, 0 - ldr r5, =0x0202420b - cmp r0, 0 - beq _08051BDA - ldr r0, =0x02024084 - ldrb r2, [r5] - movs r1, 0x58 - muls r1, r2 - adds r3, r1, r0 - adds r0, r3, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0x5 - beq _08051BD4 - cmp r0, 0x8 - beq _08051BD4 - cmp r0, 0x4 - beq _08051BD4 - adds r0, r3, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0x5 - beq _08051BD4 - cmp r0, 0x8 - beq _08051BD4 - cmp r0, 0x4 - beq _08051BD4 - adds r0, r3, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x8 - beq _08051BD4 - ldr r0, =0x020242ac - lsls r1, r2, 2 - adds r1, r0 - ldr r1, [r1] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08051BD4 - movs r0, 0x80 - lsls r0, 11 - ands r1, r0 - cmp r1, 0 - bne _08051BD4 - ldr r1, =0x020241f0 - ldrh r0, [r3, 0x2C] - lsrs r0, 4 - str r0, [r1] - cmp r0, 0 - bne _08051BDA - movs r0, 0x1 - b _08051BD8 - .pool -_08051BD4: - ldr r1, =0x020241f0 - movs r0, 0 -_08051BD8: - str r0, [r1] -_08051BDA: - ldrh r1, [r4] - movs r4, 0x80 - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _08051C50 - ldr r1, =0x02024084 - ldrb r3, [r5] - movs r0, 0x58 - muls r0, r3 - adds r2, r0, r1 - adds r0, r2, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0xF - beq _08051C3C - adds r0, r2, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0xF - beq _08051C3C - ldr r0, =0x020242ac - lsls r1, r3, 2 - adds r1, r0 - ldr r1, [r1] - adds r0, r1, 0 - ands r0, r4 - cmp r0, 0 - bne _08051C3C - movs r0, 0x80 - lsls r0, 11 - ands r1, r0 - cmp r1, 0 - bne _08051C3C - ldr r1, =0x020241f0 - ldrh r0, [r2, 0x2C] - lsrs r0, 4 - str r0, [r1] - cmp r0, 0 - bne _08051C50 - movs r0, 0x1 - str r0, [r1] - b _08051C50 - .pool -_08051C3C: - ldr r1, =0x020241f0 - movs r0, 0 - str r0, [r1] - b _08051C50 - .pool -_08051C48: - ldr r1, =0x020241f0 - movs r0, 0 - str r0, [r1] - ldr r5, =0x0202420b -_08051C50: - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08051C6A - ldr r1, =0x020241f0 - movs r0, 0 - str r0, [r1] -_08051C6A: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8051B18 - - thumb_func_start atk97_tryinfatuatetarget -atk97_tryinfatuatetarget: @ 8051C90 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r4, =0x0202420b - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08051CC8 - ldr r1, =0x0202406e - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - b _08051CD8 - .pool -_08051CC8: - ldr r1, =0x0202406e - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 -_08051CD8: - adds r5, r1, r0 - ldr r4, =0x0202420c - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08051D0C - ldr r1, =0x0202406e - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - b _08051D1C - .pool -_08051D0C: - ldr r1, =0x0202406e - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 -_08051D1C: - adds r4, r1, r0 - adds r0, r5, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - adds r0, r5, 0 - movs r1, 0 - bl pokemon_getattr - mov r9, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - adds r7, r0, 0 - ldr r5, =0x0202420c - ldrb r0, [r5] - movs r6, 0x58 - muls r0, r6 - ldr r1, =0x02024084 - adds r0, r1 - adds r0, 0x20 - ldrb r2, [r0] - cmp r2, 0xC - bne _08051D94 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB5F5 - str r0, [r1] - ldr r0, =0x0202420a - strb r2, [r0] - ldrb r0, [r5] - movs r1, 0xC - bl b_history__record_ability_usage_of_player - b _08051E2C - .pool -_08051D94: - mov r0, r10 - mov r1, r9 - bl pokemon_species_get_gender_info - adds r4, r0, 0 - mov r0, r8 - adds r1, r7, 0 - bl pokemon_species_get_gender_info - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - beq _08051DE4 - ldrb r0, [r5] - muls r0, r6 - ldr r4, =0x02024084 - adds r4, 0x50 - adds r0, r4 - ldr r0, [r0] - movs r1, 0xF0 - lsls r1, 12 - ands r0, r1 - cmp r0, 0 - bne _08051DE4 - mov r0, r10 - mov r1, r9 - bl pokemon_species_get_gender_info - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _08051DE4 - mov r0, r8 - adds r1, r7, 0 - bl pokemon_species_get_gender_info - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _08051E08 -_08051DE4: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08051E2C - .pool -_08051E08: - ldrb r0, [r5] - adds r2, r0, 0 - muls r2, r6 - adds r2, r4 - ldr r1, =gUnknown_0832A328 - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - lsls r1, 16 - ldr r0, [r2] - orrs r0, r1 - str r0, [r2] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_08051E2C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk97_tryinfatuatetarget - - thumb_func_start sub_8051E48 -sub_8051E48: @ 8051E48 - push {r4-r7,lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _08051F34 - ldr r5, =0x02024214 - ldr r1, [r5] - ldrb r0, [r1, 0x1] - cmp r0, 0x4 - beq _08051EA0 - bl get_battle_side_of_something - ldr r4, =0x02024064 - strb r0, [r4] - ldr r3, =0x02024084 - ldrb r1, [r4] - movs r0, 0x58 - adds r2, r1, 0 - muls r2, r0 - adds r0, r3, 0 - adds r0, 0x4C - adds r0, r2, r0 - ldr r1, [r0] - adds r3, 0x50 - adds r2, r3 - ldr r2, [r2] - movs r0, 0 - bl dp01_build_cmdbuf_x1A_aaaa_bbbb - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r5] - adds r0, 0x2 - str r0, [r5] - b _08051F34 - .pool -_08051EA0: - ldr r4, =0x02024064 - ldr r5, =0x0202420b - ldrb r0, [r5] - strb r0, [r4] - ldr r6, =0x02024210 - ldrb r1, [r6] - ldr r7, =gUnknown_0832A328 - ldrb r2, [r4] - lsls r0, r2, 2 - adds r0, r7 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _08051EDC - ldr r3, =0x02024084 - movs r0, 0x58 - muls r2, r0 - adds r0, r3, 0 - adds r0, 0x4C - adds r0, r2, r0 - ldr r1, [r0] - adds r3, 0x50 - adds r2, r3 - ldr r2, [r2] - movs r0, 0 - bl dp01_build_cmdbuf_x1A_aaaa_bbbb - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_08051EDC: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08051F2C - ldrb r0, [r5] - bl battle_get_per_side_status - movs r1, 0x2 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - strb r0, [r4] - ldrb r1, [r6] - ldrb r2, [r4] - lsls r0, r2, 2 - adds r0, r7 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _08051F2C - ldr r3, =0x02024084 - movs r0, 0x58 - muls r2, r0 - adds r0, r3, 0 - adds r0, 0x4C - adds r0, r2, r0 - ldr r1, [r0] - adds r3, 0x50 - adds r2, r3 - ldr r2, [r2] - movs r0, 0 - bl dp01_build_cmdbuf_x1A_aaaa_bbbb - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_08051F2C: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] -_08051F34: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8051E48 - - thumb_func_start atk99_setmisteffect -atk99_setmisteffect: @ 8051F58 - push {r4-r6,lr} - ldr r6, =0x02024294 - ldr r4, =0x0202420b - ldrb r0, [r4] - bl battle_get_per_side_status - movs r5, 0x1 - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x4] - cmp r0, 0 - beq _08051F98 - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x20 - orrs r0, r1 - strb r0, [r2] - ldr r0, =0x02024332 - strb r5, [r0, 0x5] - b _08051FE6 - .pool -_08051F98: - ldrb r0, [r4] - bl battle_get_per_side_status - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x5 - strb r1, [r0, 0x4] - ldrb r0, [r4] - bl battle_get_per_side_status - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r1, [r4] - strb r1, [r0, 0x5] - ldrb r0, [r4] - bl battle_get_per_side_status - ldr r2, =0x0202428e - adds r1, r5, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r3, 0x80 - lsls r3, 1 - adds r0, r3, 0 - movs r3, 0 - orrs r0, r2 - strh r0, [r1] - ldr r0, =0x02024332 - strb r3, [r0, 0x5] -_08051FE6: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atk99_setmisteffect - - thumb_func_start atk9A_setincreasedcriticalchance -atk9A_setincreasedcriticalchance: @ 8052000 - push {lr} - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r1, [r0] - movs r3, 0x80 - lsls r3, 13 - adds r2, r1, 0 - ands r2, r3 - cmp r2, 0 - beq _08052040 - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x20 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] - b _08052048 - .pool -_08052040: - orrs r1, r3 - str r1, [r0] - ldr r0, =0x02024332 - strb r2, [r0, 0x5] -_08052048: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end atk9A_setincreasedcriticalchance - - thumb_func_start atk9B_transformdataexecution -atk9B_transformdataexecution: @ 805205C - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r1, =0x020241ec - ldr r2, =0x0000ffff - adds r0, r2, 0 - strh r0, [r1] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - ldr r7, =0x02024084 - ldr r0, =0x0202420c - mov r12, r0 - ldrb r1, [r0] - movs r6, 0x58 - adds r0, r1, 0 - muls r0, r6 - adds r5, r7, 0 - adds r5, 0x50 - adds r0, r5 - ldr r0, [r0] - movs r4, 0x80 - lsls r4, 14 - ands r0, r4 - cmp r0, 0 - bne _080520A2 - ldr r0, =0x020242ac - lsls r1, 2 - adds r1, r0 - ldr r2, [r1] - ldr r0, =0x000400c0 - ands r2, r0 - cmp r2, 0 - beq _080520D8 -_080520A2: - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x20 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024332 - movs r0, 0x1 - b _080521EC - .pool -_080520D8: - ldr r3, =0x0202420b - ldrb r0, [r3] - adds r1, r0, 0 - muls r1, r6 - adds r1, r5 - ldr r0, [r1] - orrs r0, r4 - str r0, [r1] - ldr r4, =0x020242bc - ldrb r1, [r3] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r4 - strh r2, [r0, 0x4] - ldrb r0, [r3] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r2, [r1, 0xB] - movs r0, 0x10 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0xB] - ldrb r1, [r3] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r4 - mov r2, r12 - ldrb r1, [r2] - muls r1, r6 - adds r2, r7, 0 - adds r2, 0x48 - adds r1, r2 - ldr r1, [r1] - str r1, [r0] - ldrb r0, [r3] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r2, [r1, 0x18] - movs r0, 0xF - ands r0, r2 - strb r0, [r1, 0x18] - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x6 - strb r0, [r1, 0x1] - mov r2, r12 - ldrb r0, [r2] - muls r0, r6 - adds r0, r7 - ldrh r0, [r0] - strb r0, [r1, 0x2] - ldrb r0, [r2] - muls r0, r6 - adds r0, r7 - ldrh r0, [r0] - lsrs r0, 8 - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldrb r0, [r3] - muls r0, r6 - adds r5, r0, r7 - ldrb r0, [r2] - muls r0, r6 - adds r2, r0, r7 - movs r4, 0 - adds r6, r3, 0 - ldr r0, =0x02024064 - mov r8, r0 -_08052170: - adds r0, r5, r4 - adds r1, r2, r4 - ldrb r1, [r1] - strb r1, [r0] - adds r4, 0x1 - cmp r4, 0x23 - bls _08052170 - movs r4, 0 - ldr r7, =gBattleMoves - ldr r3, =0x02024090 - adds r5, r3, 0 - adds r5, 0x18 -_08052188: - lsls r1, r4, 1 - ldrb r2, [r6] - movs r0, 0x58 - muls r2, r0 - adds r1, r2 - adds r1, r3 - ldrh r1, [r1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrb r1, [r0, 0x4] - cmp r1, 0x4 - bhi _080521C4 - adds r0, r4, r2 - adds r0, r5 - b _080521CA - .pool -_080521C4: - adds r0, r4, r2 - adds r0, r5 - movs r1, 0x5 -_080521CA: - strb r1, [r0] - adds r4, 0x1 - cmp r4, 0x3 - ble _08052188 - ldrb r0, [r6] - mov r1, r8 - strb r0, [r1] - movs r0, 0 - movs r1, 0x2 - bl dp01_build_cmdbuf_x38_a - mov r2, r8 - ldrb r0, [r2] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02024332 - movs r0, 0 -_080521EC: - strb r0, [r1, 0x5] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk9B_transformdataexecution - - thumb_func_start sub_80521FC -sub_80521FC: @ 80521FC - push {r4-r7,lr} - ldr r7, =0x02024084 - ldr r6, =0x0202420b - ldrb r0, [r6] - movs r5, 0x58 - muls r0, r5 - adds r3, r0, r7 - ldrh r0, [r3, 0x2C] - lsrs r1, r0, 2 - adds r2, r1, 0 - cmp r1, 0 - bne _08052216 - movs r2, 0x1 -_08052216: - ldrh r0, [r3, 0x28] - cmp r0, r2 - bhi _0805223C - ldr r1, =0x020241f0 - movs r0, 0 - str r0, [r1] - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] - b _08052290 - .pool -_0805223C: - ldr r4, =0x020241f0 - str r1, [r4] - cmp r1, 0 - bne _08052248 - movs r0, 0x1 - str r0, [r4] -_08052248: - ldrb r0, [r6] - adds r2, r0, 0 - muls r2, r5 - adds r3, r7, 0 - adds r3, 0x50 - adds r2, r3 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 17 - orrs r0, r1 - str r0, [r2] - ldrb r0, [r6] - adds r1, r0, 0 - muls r1, r5 - adds r1, r3 - ldr r0, [r1] - ldr r2, =0xffff1fff - ands r0, r2 - str r0, [r1] - ldr r2, =0x020242bc - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, [r4] - movs r2, 0 - strb r1, [r0, 0xA] - ldr r0, =0x02024332 - strb r2, [r0, 0x5] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 1 - orrs r0, r1 - str r0, [r2] -_08052290: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80521FC - - thumb_func_start sub_80522B8 -sub_80522B8: @ 80522B8 - push {r4,r5,lr} - lsls r0, 16 - lsrs r2, r0, 16 - movs r3, 0 - ldr r0, =gUnknown_0831C3E0 - ldrh r1, [r0] - ldr r4, =0x0000fffe - adds r5, r0, 0 - cmp r1, r4 - beq _080522E0 - cmp r1, r2 - beq _080522E0 - adds r1, r5, 0 -_080522D2: - adds r1, 0x2 - adds r3, 0x1 - ldrh r0, [r1] - cmp r0, r4 - beq _080522E0 - cmp r0, r2 - bne _080522D2 -_080522E0: - lsls r0, r3, 1 - adds r0, r5 - ldrh r1, [r0] - ldr r0, =0x0000fffe - eors r1, r0 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80522B8 - - thumb_func_start atk9D_copyattack -atk9D_copyattack: @ 8052300 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =0x020241ec - ldr r1, =0x0000ffff - adds r7, r1, 0 - strh r7, [r0] - ldr r5, =0x02024248 - ldr r6, =0x0202420c - ldrb r0, [r6] - lsls r0, 1 - adds r0, r5 - ldrh r0, [r0] - bl sub_80522B8 - lsls r0, 24 - cmp r0, 0 - bne _0805235A - ldr r3, =0x02024084 - ldr r2, =0x0202420b - ldrb r1, [r2] - movs r0, 0x58 - adds r4, r1, 0 - muls r4, r0 - adds r0, r3, 0 - adds r0, 0x50 - adds r0, r4, r0 - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 14 - ands r1, r0 - mov r12, r3 - mov r9, r2 - cmp r1, 0 - bne _0805235A - ldrb r0, [r6] - lsls r0, 1 - adds r0, r5 - ldrh r1, [r0] - cmp r1, 0 - beq _0805235A - cmp r1, r7 - bne _08052394 -_0805235A: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _080524CC - .pool -_08052394: - movs r2, 0 - mov r3, r12 - adds r3, 0xC - adds r0, r4, r3 - ldrh r0, [r0] - ldr r4, =0x02024214 - mov r10, r4 - cmp r0, r1 - beq _080523CE - mov r8, r3 - adds r7, r5, 0 - adds r5, r6, 0 - mov r4, r9 - movs r3, 0x58 -_080523B0: - adds r2, 0x1 - cmp r2, 0x3 - bgt _080523CE - lsls r1, r2, 1 - ldrb r0, [r4] - muls r0, r3 - adds r1, r0 - add r1, r8 - ldrb r0, [r5] - lsls r0, 1 - adds r0, r7 - ldrh r1, [r1] - ldrh r0, [r0] - cmp r1, r0 - bne _080523B0 -_080523CE: - cmp r2, 0x4 - bne _080524B0 - ldr r5, =0x020241e8 - ldrb r1, [r5] - lsls r1, 1 - mov r2, r9 - ldrb r0, [r2] - movs r6, 0x58 - muls r0, r6 - adds r1, r0 - mov r0, r12 - adds r0, 0xC - adds r1, r0 - ldr r2, =0x02024248 - ldr r3, =0x0202420c - ldrb r0, [r3] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1] - ldr r4, =gBattleMoves - ldrb r0, [r3] - lsls r0, 1 - adds r0, r2 - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r4, [r0, 0x4] - cmp r4, 0x4 - bhi _08052438 - mov r1, r9 - ldrb r0, [r1] - muls r0, r6 - ldrb r1, [r5] - adds r0, r1 - mov r1, r12 - adds r1, 0x24 - adds r0, r1 - strb r4, [r0] - b _0805244C - .pool -_08052438: - mov r4, r9 - ldrb r0, [r4] - muls r0, r6 - ldrb r1, [r5] - adds r0, r1 - mov r1, r12 - adds r1, 0x24 - adds r0, r1 - movs r1, 0x5 - strb r1, [r0] -_0805244C: - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x2 - strb r0, [r1, 0x1] - ldrb r0, [r3] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - strb r0, [r1, 0x2] - ldrb r0, [r3] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - lsrs r0, 8 - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r1, =0x020242bc - mov r2, r9 - ldrb r0, [r2] - lsls r2, r0, 3 - subs r2, r0 - lsls r2, 2 - adds r2, r1 - ldrb r4, [r2, 0x18] - lsrs r3, r4, 4 - ldr r1, =gUnknown_0832A328 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - orrs r1, r3 - lsls r1, 4 - movs r0, 0xF - ands r0, r4 - orrs r0, r1 - strb r0, [r2, 0x18] - mov r4, r10 - ldr r0, [r4] - adds r0, 0x5 - str r0, [r4] - b _080524CC - .pool -_080524B0: - mov r0, r10 - ldr r2, [r0] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - mov r2, r10 - str r1, [r2] -_080524CC: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end atk9D_copyattack - - thumb_func_start sub_80524DC -sub_80524DC: @ 80524DC - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r7, =0x020241ea - movs r6, 0xB1 - lsls r6, 1 - ldr r5, =gUnknown_0831C3E0 - ldr r0, =0x02024214 - mov r8, r0 -_080524EE: - bl GenerateRandomNumber - ldr r2, =0x000001ff - adds r1, r2, 0 - ands r0, r1 - adds r0, 0x1 - strh r0, [r7] - cmp r0, r6 - bhi _080524EE - movs r0, 0x3 -_08052502: - subs r0, 0x1 - cmp r0, 0 - bge _08052502 - ldr r4, =0x020241ea - ldrh r2, [r4] - ldr r3, =0x0000ffff - subs r0, r5, 0x2 -_08052510: - adds r0, 0x2 - ldrh r1, [r0] - cmp r1, r2 - beq _0805251C - cmp r1, r3 - bne _08052510 -_0805251C: - ldr r0, =0x0000ffff - cmp r1, r0 - bne _080524EE - ldr r2, =0x02024280 - ldr r0, [r2] - ldr r1, =0xfffffbff - ands r0, r1 - str r0, [r2] - ldr r3, =gUnknown_082D86A8 - ldr r2, =gBattleMoves - ldrh r1, [r4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - mov r1, r8 - str r0, [r1] - ldrh r0, [r4] - movs r1, 0 - bl sub_80458E0 - ldr r1, =0x0202420c - strb r0, [r1] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80524DC - - thumb_func_start atk9F_nightshadedamageeffect -atk9F_nightshadedamageeffect: @ 8052584 - ldr r3, =0x020241f0 - ldr r2, =0x02024084 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x2A - ldrb r0, [r0] - str r0, [r3] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end atk9F_nightshadedamageeffect - - thumb_func_start atkA0_psywavedamageeffect -atkA0_psywavedamageeffect: @ 80525B4 - push {r4,lr} - movs r4, 0xF -_080525B8: - bl GenerateRandomNumber - adds r3, r4, 0 - ands r3, r0 - cmp r3, 0xA - bgt _080525B8 - lsls r0, r3, 2 - adds r0, r3 - lsls r3, r0, 1 - ldr r4, =0x020241f0 - ldr r2, =0x02024084 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x2A - ldrb r1, [r0] - adds r0, r3, 0 - adds r0, 0x32 - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - str r0, [r4] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atkA0_psywavedamageeffect - - thumb_func_start atkA1_counterdamagecalculator -atkA1_counterdamagecalculator: @ 8052608 - push {r4-r6,lr} - ldr r4, =0x0202420b - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r6, r0, 24 - ldr r5, =0x0202433c - ldrb r0, [r4] - lsls r0, 4 - adds r0, r5 - ldrb r0, [r0, 0xC] - bl battle_side_get_owner - lsls r0, 24 - lsrs r2, r0, 24 - ldrb r0, [r4] - lsls r1, r0, 4 - adds r0, r5, 0x4 - adds r0, r1, r0 - ldr r3, [r0] - cmp r3, 0 - beq _080526BC - cmp r6, r2 - beq _080526BC - ldr r6, =0x02024084 - adds r0, r1, r5 - ldrb r0, [r0, 0xC] - movs r4, 0x58 - muls r0, r4 - adds r0, r6 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _080526BC - ldr r1, =0x020241f0 - lsls r0, r3, 1 - str r0, [r1] - ldr r1, =0x02024294 - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r1, r0, r1 - ldrb r0, [r1, 0x8] - cmp r0, 0 - beq _08052690 - ldrb r1, [r1, 0x9] - adds r0, r1, 0 - muls r0, r4 - adds r0, r6 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _08052690 - ldr r0, =0x0202420c - strb r1, [r0] - b _080526A0 - .pool -_08052690: - ldr r2, =0x0202420c - ldr r1, =0x0202433c - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0xC] - strb r0, [r2] -_080526A0: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _080526EC - .pool -_080526BC: - ldr r2, =0x0202437c - ldr r0, =0x0202420b - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0] - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_080526EC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atkA1_counterdamagecalculator - - thumb_func_start atkA2_mirrorcoatdamagecalculator -atkA2_mirrorcoatdamagecalculator: @ 8052700 - push {r4-r6,lr} - ldr r4, =0x0202420b - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r6, r0, 24 - ldr r5, =0x0202433c - ldrb r0, [r4] - lsls r0, 4 - adds r0, r5 - ldrb r0, [r0, 0xD] - bl battle_side_get_owner - lsls r0, 24 - lsrs r2, r0, 24 - ldrb r0, [r4] - lsls r1, r0, 4 - adds r0, r5, 0 - adds r0, 0x8 - adds r0, r1, r0 - ldr r3, [r0] - cmp r3, 0 - beq _080527B4 - cmp r6, r2 - beq _080527B4 - ldr r6, =0x02024084 - adds r0, r1, r5 - ldrb r0, [r0, 0xD] - movs r4, 0x58 - muls r0, r4 - adds r0, r6 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _080527B4 - ldr r1, =0x020241f0 - lsls r0, r3, 1 - str r0, [r1] - ldr r1, =0x02024294 - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r1, r0, r1 - ldrb r0, [r1, 0x8] - cmp r0, 0 - beq _08052788 - ldrb r1, [r1, 0x9] - adds r0, r1, 0 - muls r0, r4 - adds r0, r6 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _08052788 - ldr r0, =0x0202420c - strb r1, [r0] - b _08052798 - .pool -_08052788: - ldr r2, =0x0202420c - ldr r1, =0x0202433c - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0xD] - strb r0, [r2] -_08052798: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _080527E4 - .pool -_080527B4: - ldr r2, =0x0202437c - ldr r0, =0x0202420b - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0] - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_080527E4: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atkA2_mirrorcoatdamagecalculator - - thumb_func_start atkA3_disablelastusedattack -atkA3_disablelastusedattack: @ 80527F8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r4, 0 - ldr r2, =0x02024084 - ldr r3, =0x0202420c - ldrb r1, [r3] - movs r0, 0x58 - muls r0, r1 - adds r7, r2, 0 - adds r7, 0xC - adds r0, r7 - ldr r5, =0x02024248 - lsls r1, 1 - adds r1, r5 - ldrh r0, [r0] - mov r9, r2 - adds r6, r3, 0 - ldr r2, =0x020242bc - mov r8, r2 - ldrh r1, [r1] - cmp r0, r1 - beq _0805284C - mov r12, r6 - movs r3, 0x58 -_0805282C: - adds r4, 0x1 - cmp r4, 0x3 - bgt _0805284C - lsls r2, r4, 1 - mov r0, r12 - ldrb r1, [r0] - adds r0, r1, 0 - muls r0, r3 - adds r2, r0 - adds r2, r7 - lsls r1, 1 - adds r1, r5 - ldrh r0, [r2] - ldrh r1, [r1] - cmp r0, r1 - bne _0805282C -_0805284C: - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r8 - ldrh r0, [r0, 0x4] - cmp r0, 0 - bne _08052910 - cmp r4, 0x4 - beq _08052910 - movs r5, 0x58 - adds r0, r1, 0 - muls r0, r5 - adds r0, r4, r0 - mov r1, r9 - adds r1, 0x24 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _08052910 - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x2 - strb r0, [r1, 0x1] - lsls r2, r4, 1 - ldrb r0, [r6] - muls r0, r5 - adds r0, r2, r0 - mov r3, r9 - adds r3, 0xC - adds r0, r3 - ldrh r0, [r0] - strb r0, [r1, 0x2] - ldrb r0, [r6] - muls r0, r5 - adds r0, r2, r0 - adds r0, r3 - ldrh r0, [r0] - lsrs r0, 8 - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r8 - muls r1, r5 - adds r2, r1 - adds r2, r3 - ldrh r1, [r2] - strh r1, [r0, 0x4] - bl GenerateRandomNumber - ldrb r2, [r6] - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - add r1, r8 - movs r2, 0x3 - ands r2, r0 - adds r2, 0x2 - ldrb r3, [r1, 0xB] - movs r0, 0x10 - negs r0, r0 - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0xB] - ldrb r0, [r6] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - add r1, r8 - ldrb r3, [r1, 0xB] - lsls r2, r3, 28 - lsrs r2, 24 - movs r0, 0xF - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0xB] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _0805292A - .pool -_08052910: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_0805292A: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkA3_disablelastusedattack - - thumb_func_start atkA4_setencore -atkA4_setencore: @ 805293C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r5, 0 - ldr r3, =0x02024084 - ldr r4, =0x0202420c - ldrb r1, [r4] - movs r0, 0x58 - muls r0, r1 - adds r6, r3, 0 - adds r6, 0xC - adds r0, r6 - ldr r2, =0x02024248 - lsls r1, 1 - adds r1, r2 - ldrh r0, [r0] - mov r10, r3 - mov r8, r2 - ldr r2, =0x020242bc - mov r9, r2 - ldrh r1, [r1] - cmp r0, r1 - beq _08052996 - mov r12, r4 - adds r7, r6, 0 - mov r6, r8 - movs r3, 0x58 -_08052976: - adds r5, 0x1 - cmp r5, 0x3 - bgt _08052996 - lsls r2, r5, 1 - mov r0, r12 - ldrb r1, [r0] - adds r0, r1, 0 - muls r0, r3 - adds r2, r0 - adds r2, r7 - lsls r1, 1 - adds r1, r6 - ldrh r0, [r2] - ldrh r1, [r1] - cmp r0, r1 - bne _08052976 -_08052996: - ldrb r0, [r4] - lsls r0, 1 - add r0, r8 - ldrh r2, [r0] - cmp r2, 0xA5 - beq _080529AA - cmp r2, 0xE3 - beq _080529AA - cmp r2, 0x77 - bne _080529AC -_080529AA: - movs r5, 0x4 -_080529AC: - ldrb r1, [r4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - mov r2, r9 - adds r3, r0, r2 - ldrh r0, [r3, 0x6] - cmp r0, 0 - bne _08052A44 - cmp r5, 0x4 - beq _08052A44 - movs r0, 0x58 - adds r2, r1, 0 - muls r2, r0 - adds r0, r5, r2 - mov r1, r10 - adds r1, 0x24 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _08052A44 - lsls r0, r5, 1 - adds r0, r2 - subs r1, 0x18 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r3, 0x6] - ldrb r1, [r4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r9 - strb r5, [r0, 0xC] - bl GenerateRandomNumber - ldrb r2, [r4] - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - add r1, r9 - movs r2, 0x3 - ands r2, r0 - adds r2, 0x3 - ldrb r3, [r1, 0xE] - movs r0, 0x10 - negs r0, r0 - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0xE] - ldrb r0, [r4] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - add r1, r9 - ldrb r3, [r1, 0xE] - lsls r2, r3, 28 - lsrs r2, 24 - movs r0, 0xF - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0xE] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _08052A5E - .pool -_08052A44: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_08052A5E: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkA4_setencore - - thumb_func_start sub_8052A70 -sub_8052A70: @ 8052A70 - push {r4-r7,lr} - ldr r6, =0x02024084 - ldr r0, =0x0202420c - mov r12, r0 - ldrb r0, [r0] - movs r7, 0x58 - adds r2, r0, 0 - muls r2, r7 - adds r0, r6, 0 - adds r0, 0x50 - adds r0, r2, r0 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - bne _08052B10 - ldr r5, =0x0202420b - ldrb r0, [r5] - muls r0, r7 - adds r0, r6 - ldrh r3, [r0, 0x28] - adds r0, r2, r6 - ldrh r1, [r0, 0x28] - adds r3, r1 - asrs r3, 1 - ldr r4, =0x020241f0 - subs r1, r3 - str r1, [r4] - ldr r2, =0x02024474 - strb r1, [r2] - movs r0, 0xFF - lsls r0, 8 - ands r0, r1 - asrs r0, 8 - strb r0, [r2, 0x1] - movs r0, 0xFF - lsls r0, 16 - ands r0, r1 - asrs r0, 16 - strb r0, [r2, 0x2] - lsrs r1, 24 - strb r1, [r2, 0x3] - ldrb r0, [r5] - muls r0, r7 - adds r0, r6 - ldrh r0, [r0, 0x28] - subs r0, r3 - str r0, [r4] - ldr r2, =0x0202437c - mov r0, r12 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, 0x4 - adds r0, r2 - ldr r1, =0x0000ffff - str r1, [r0] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _08052B2A - .pool -_08052B10: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_08052B2A: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8052A70 - - thumb_func_start atkA6_settypetorandomresistance -atkA6_settypetorandomresistance: @ 8052B34 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r1, =0x02024250 - ldr r4, =0x0202420b - ldrb r0, [r4] - lsls r0, 1 - adds r2, r0, r1 - ldrh r1, [r2] - cmp r1, 0 - beq _08052B7E - ldr r0, =0x0000ffff - cmp r1, r0 - beq _08052B7E - ldrh r0, [r2] - bl sub_8052F48 - lsls r0, 24 - cmp r0, 0 - beq _08052C1C - ldr r1, =0x02024084 - ldr r2, =0x02024270 - ldrb r0, [r4] - adds r0, r2 - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 5 - ands r0, r1 - cmp r0, 0 - beq _08052C1C -_08052B7E: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08052D08 - .pool -_08052BB4: - mov r0, r12 - strb r5, [r0] - mov r1, r10 - ldrb r0, [r1] - muls r0, r2 - adds r0, r7 - adds r0, 0x22 - strb r5, [r0] - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x3 - strb r0, [r1, 0x1] - strb r5, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x3] - ldr r1, =0x02024214 - b _08052C0A - .pool -_08052BE0: - mov r0, r8 - adds r0, 0x1 - adds r0, r3 - ldrb r2, [r0] - strb r2, [r4] - mov r4, r10 - ldrb r0, [r4] - muls r0, r6 - ldr r7, =0x02024084 - adds r0, r7 - adds r0, 0x22 - strb r2, [r0] - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x3 - strb r0, [r1, 0x1] - strb r2, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x3] - mov r1, r12 -_08052C0A: - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _08052D08 - .pool -_08052C1C: - movs r4, 0 - mov r8, r4 - movs r7, 0x7F - mov r9, r7 -_08052C24: - bl GenerateRandomNumber - mov r4, r9 - ands r4, r0 - cmp r4, 0x70 - bhi _08052C24 - lsls r0, r4, 1 - adds r4, r0, r4 - ldr r6, =gUnknown_0831ACE8 - adds r3, r4, r6 - ldr r1, =0x02024258 - ldr r2, =0x0202420b - ldrb r5, [r2] - lsls r0, r5, 1 - adds r0, r1 - ldrb r1, [r3] - mov r10, r2 - ldrh r0, [r0] - cmp r1, r0 - bne _08052C80 - adds r0, r4, 0x2 - adds r0, r6 - ldrb r0, [r0] - cmp r0, 0x5 - bhi _08052C80 - ldr r7, =0x02024084 - movs r2, 0x58 - adds r0, r5, 0 - muls r0, r2 - adds r3, r0, r7 - movs r0, 0x21 - adds r0, r3 - mov r12, r0 - adds r0, r4, 0x1 - adds r0, r6 - ldrb r5, [r0] - mov r1, r12 - ldrb r0, [r1] - adds r1, r5, 0 - cmp r0, r1 - beq _08052C80 - adds r0, r3, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, r1 - bne _08052BB4 -_08052C80: - movs r7, 0x1 - add r8, r7 - ldr r0, =0x000003e7 - cmp r8, r0 - ble _08052C24 - movs r0, 0 - mov r8, r0 - ldr r1, =0x02024214 - mov r12, r1 - ldr r3, =gUnknown_0831ACE8 - adds r0, r4, 0x1 - adds r0, r3 - mov r9, r0 - adds r5, r3, 0 -_08052C9C: - ldrb r1, [r5] - cmp r1, 0xFF - bgt _08052CA6 - cmp r1, 0xFE - bge _08052CE0 -_08052CA6: - mov r4, r10 - ldrb r2, [r4] - lsls r0, r2, 1 - ldr r7, =0x02024258 - adds r0, r7 - ldrh r0, [r0] - cmp r1, r0 - bne _08052CE0 - ldrb r0, [r5, 0x2] - cmp r0, 0x5 - bhi _08052CE0 - movs r6, 0x58 - adds r0, r2, 0 - muls r0, r6 - ldr r1, =0x02024084 - adds r2, r0, r1 - adds r4, r2, 0 - adds r4, 0x21 - ldrb r0, [r4] - mov r7, r9 - ldrb r1, [r7] - cmp r0, r1 - beq _08052CE0 - adds r0, r2, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, r1 - beq _08052CE0 - b _08052BE0 -_08052CE0: - adds r5, 0x3 - movs r0, 0x3 - add r8, r0 - ldr r0, =0x0000014f - cmp r8, r0 - bls _08052C9C - mov r1, r12 - ldr r2, [r1] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - mov r4, r12 - str r1, [r4] -_08052D08: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkA6_settypetorandomresistance - - thumb_func_start atkA7_setalwayshitflag -atkA7_setalwayshitflag: @ 8052D34 - push {r4,lr} - ldr r4, =0x020242ac - ldr r3, =0x0202420c - ldrb r1, [r3] - lsls r1, 2 - adds r1, r4 - ldr r0, [r1] - movs r2, 0x19 - negs r2, r2 - ands r0, r2 - str r0, [r1] - ldrb r1, [r3] - lsls r1, 2 - adds r1, r4 - ldr r0, [r1] - movs r2, 0x10 - orrs r0, r2 - str r0, [r1] - ldr r2, =0x020242bc - ldrb r1, [r3] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0202420b - ldrb r1, [r1] - strb r1, [r0, 0x15] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atkA7_setalwayshitflag - - thumb_func_start atkA8_copymovepermanently -atkA8_copymovepermanently: @ 8052D8C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - ldr r0, =0x020241ec - ldr r1, =0x0000ffff - adds r5, r1, 0 - strh r5, [r0] - ldr r3, =0x02024084 - ldr r2, =0x0202420b - ldrb r1, [r2] - movs r0, 0x58 - adds r4, r1, 0 - muls r4, r0 - adds r0, r3, 0 - adds r0, 0x50 - adds r0, r4, r0 - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 14 - ands r1, r0 - mov r12, r3 - mov r10, r2 - cmp r1, 0 - beq _08052DC4 - b _08052F18 -_08052DC4: - ldr r0, =0x02024240 - ldr r2, =0x0202420c - ldrb r1, [r2] - lsls r1, 1 - adds r1, r0 - ldrh r1, [r1] - mov r9, r0 - mov r8, r2 - cmp r1, 0xA5 - bne _08052DDA - b _08052F18 -_08052DDA: - cmp r1, 0 - bne _08052DE0 - b _08052F18 -_08052DE0: - cmp r1, r5 - bne _08052DE6 - b _08052F18 -_08052DE6: - cmp r1, 0xA6 - bne _08052DEC - b _08052F18 -_08052DEC: - movs r7, 0 - mov r5, r9 - mov r0, r12 - adds r0, 0xC - adds r1, r4, r0 - mov r3, r8 -_08052DF8: - ldrh r2, [r1] - cmp r2, 0xA6 - beq _08052E0A - ldrb r0, [r3] - lsls r0, 1 - adds r0, r5 - ldrh r0, [r0] - cmp r2, r0 - beq _08052E12 -_08052E0A: - adds r1, 0x2 - adds r7, 0x1 - cmp r7, 0x3 - ble _08052DF8 -_08052E12: - cmp r7, 0x4 - beq _08052E18 - b _08052F18 -_08052E18: - ldr r4, =0x020241e8 - ldrb r1, [r4] - lsls r1, 1 - mov r2, r10 - ldrb r0, [r2] - movs r3, 0x58 - muls r0, r3 - adds r1, r0 - mov r6, r12 - adds r6, 0xC - adds r1, r6 - mov r2, r8 - ldrb r0, [r2] - lsls r0, 1 - add r0, r9 - ldrh r0, [r0] - strh r0, [r1] - mov r1, r10 - ldrb r0, [r1] - adds r2, r0, 0 - muls r2, r3 - ldrb r4, [r4] - adds r2, r4 - mov r5, r12 - adds r5, 0x24 - adds r2, r5 - ldr r4, =gBattleMoves - mov r1, r8 - ldrb r0, [r1] - lsls r0, 1 - add r0, r9 - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x4] - strb r0, [r2] - ldr r1, =0x02024064 - mov r2, r10 - ldrb r0, [r2] - strb r0, [r1] - movs r7, 0 - ldrb r0, [r2] - muls r0, r3 - adds r4, r0, r5 - adds r3, r0, 0 - add r2, sp, 0x4 - add r5, sp, 0xC -_08052E7A: - adds r0, r3, r6 - ldrh r0, [r0] - strh r0, [r2] - adds r1, r5, r7 - ldrb r0, [r4] - strb r0, [r1] - adds r4, 0x1 - adds r3, 0x2 - adds r2, 0x2 - adds r7, 0x1 - cmp r7, 0x3 - ble _08052E7A - add r2, sp, 0x4 - mov r0, r10 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - add r0, r12 - adds r0, 0x3B - ldrb r0, [r0] - strb r0, [r2, 0xC] - str r2, [sp] - movs r0, 0 - movs r1, 0x3 - movs r2, 0 - movs r3, 0x10 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x2 - strb r0, [r1, 0x1] - ldr r3, =0x02024240 - ldr r2, =0x0202420c - ldrb r0, [r2] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - strb r0, [r1, 0x2] - ldrb r0, [r2] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - lsrs r0, 8 - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _08052F32 - .pool -_08052F18: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_08052F32: - add sp, 0x14 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkA8_copymovepermanently - - thumb_func_start sub_8052F48 -sub_8052F48: @ 8052F48 - push {lr} - lsls r0, 16 - lsrs r0, 16 - ldr r2, =gBattleMoves - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r0, [r1] - cmp r0, 0x91 - beq _08052F72 - cmp r0, 0x27 - beq _08052F72 - cmp r0, 0x4B - beq _08052F72 - cmp r0, 0x97 - beq _08052F72 - cmp r0, 0x9B - beq _08052F72 - cmp r0, 0x1A - bne _08052F7C -_08052F72: - movs r0, 0x1 - b _08052F7E - .pool -_08052F7C: - movs r0, 0 -_08052F7E: - pop {r1} - bx r1 - thumb_func_end sub_8052F48 - - thumb_func_start sub_8052F84 -sub_8052F84: @ 8052F84 - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _08052FA2 - cmp r1, 0xD6 - beq _08052FA2 - movs r0, 0x89 - lsls r0, 1 - cmp r1, r0 - beq _08052FA2 - cmp r1, 0x77 - beq _08052FA2 - cmp r1, 0x76 - bne _08052FA6 -_08052FA2: - movs r0, 0x1 - b _08052FA8 -_08052FA6: - movs r0, 0 -_08052FA8: - pop {r1} - bx r1 - thumb_func_end sub_8052F84 - - thumb_func_start move_weather_interaction -move_weather_interaction: @ 8052FAC - push {lr} - lsls r1, 16 - lsrs r2, r1, 16 - ldr r1, =gBattleMoves - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0] - adds r3, r1, 0 - cmp r0, 0x97 - bne _08052FD0 - ldr r0, =0x020243cc - ldrh r1, [r0] - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - bne _08053010 -_08052FD0: - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0] - cmp r0, 0x91 - beq _08052FF2 - cmp r0, 0x27 - beq _08052FF2 - cmp r0, 0x4B - beq _08052FF2 - cmp r0, 0x97 - beq _08052FF2 - cmp r0, 0x9B - beq _08052FF2 - cmp r0, 0x1A - bne _08053010 -_08052FF2: - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 20 - ands r0, r1 - cmp r0, 0 - beq _08053010 - movs r0, 0x1 - b _08053012 - .pool -_08053010: - movs r0, 0x2 -_08053012: - pop {r1} - bx r1 - thumb_func_end move_weather_interaction - - thumb_func_start sub_8053018 -sub_8053018: @ 8053018 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r6, 0 - movs r5, 0 - ldr r0, =0x0202420b - mov r9, r0 - movs r1, 0x58 - mov r8, r1 - ldr r7, =0x02024090 - movs r0, 0x84 - lsls r0, 1 - mov r10, r0 -_08053036: - lsls r4, r5, 1 - mov r1, r9 - ldrb r0, [r1] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r4, r0 - adds r0, r7 - ldrh r0, [r0] - bl sub_8052F84 - lsls r0, 24 - cmp r0, 0 - bne _08053076 - mov r1, r9 - ldrb r0, [r1] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r4, r0 - adds r0, r7 - ldrh r1, [r0] - cmp r1, r10 - beq _08053076 - cmp r1, 0xFD - beq _08053076 - adds r0, r1, 0 - bl sub_8052F48 - lsls r0, 24 - cmp r0, 0 - beq _08053084 -_08053076: - ldr r1, =gUnknown_0832A328 - lsls r0, r5, 2 - adds r0, r1 - ldr r0, [r0] - orrs r6, r0 - lsls r0, r6, 24 - lsrs r6, r0, 24 -_08053084: - adds r5, 0x1 - cmp r5, 0x3 - ble _08053036 - ldr r0, =0x0202420b - ldrb r0, [r0] - adds r1, r6, 0 - movs r2, 0xFD - bl sub_803FECC - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0xF - bne _080530B8 - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _0805311C - .pool -_080530B8: - movs r7, 0x3 - ldr r4, =gUnknown_0832A328 -_080530BC: - bl GenerateRandomNumber - adds r5, r7, 0 - ands r5, r0 - lsls r0, r5, 2 - adds r0, r4 - ldr r0, [r0] - ands r0, r6 - cmp r0, 0 - bne _080530BC - ldr r4, =0x020241ee - ldr r2, =0x02024084 - lsls r1, r5, 1 - ldr r0, =0x0202420b - ldrb r3, [r0] - movs r0, 0x58 - muls r0, r3 - adds r1, r0 - adds r2, 0xC - adds r1, r2 - ldrh r0, [r1] - strh r0, [r4] - ldr r0, =0x020241e8 - strb r5, [r0] - ldr r2, =0x02024280 - ldr r0, [r2] - ldr r1, =0xfffffbff - ands r0, r1 - str r0, [r2] - ldrh r0, [r4] - movs r1, 0 - bl sub_80458E0 - ldr r1, =0x0202420c - strb r0, [r1] - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_0805311C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8053018 - - thumb_func_start atkAA_destinybondeffect -atkAA_destinybondeffect: @ 8053150 - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r2, r0 - adds r1, 0x50 - adds r2, r1 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 18 - orrs r0, r1 - str r0, [r2] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end atkAA_destinybondeffect - - thumb_func_start b_feature_update_destiny_bond -b_feature_update_destiny_bond: @ 8053180 - push {r4,r5,lr} - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =0x0202420c - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r3, r0, 24 - ldr r1, =0x02024084 - ldrb r2, [r4] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 18 - ands r0, r1 - cmp r0, 0 - beq _080531CA - cmp r5, r3 - beq _080531CA - ldr r2, =0x02024280 - ldr r1, [r2] - movs r0, 0x80 - lsls r0, 17 - ands r0, r1 - cmp r0, 0 - bne _080531CA - movs r0, 0x40 - orrs r1, r0 - str r1, [r2] -_080531CA: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end b_feature_update_destiny_bond - - thumb_func_start atkAB_802A458 -atkAB_802A458: @ 80531E0 - push {lr} - bl b_feature_update_destiny_bond - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end atkAB_802A458 - - thumb_func_start atkAC_remaininghptopower -atkAC_remaininghptopower: @ 80531F8 - push {lr} - ldr r2, =0x02024084 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - muls r1, r0 - adds r1, r2 - movs r2, 0x28 - ldrsh r0, [r1, r2] - movs r2, 0x2C - ldrsh r1, [r1, r2] - movs r2, 0x30 - bl sub_8075034 - lsls r0, 24 - lsrs r1, r0, 24 - movs r3, 0 - ldr r0, =gUnknown_0831C408 - ldrb r2, [r0] - cmp r1, r2 - ble _08053232 - adds r2, r0, 0 -_08053224: - adds r3, 0x2 - cmp r3, 0xB - bgt _08053232 - adds r0, r3, r2 - ldrb r0, [r0] - cmp r1, r0 - bgt _08053224 -_08053232: - ldr r2, =0x02024400 - ldr r1, =gUnknown_0831C408 - adds r0, r3, 0x1 - adds r0, r1 - ldrb r0, [r0] - strh r0, [r2] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end atkAC_remaininghptopower - - thumb_func_start atkAD_reducepprandom -atkAD_reducepprandom: @ 8053260 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - ldr r4, =0x02024248 - ldr r1, =0x0202420c - ldrb r3, [r1] - lsls r0, r3, 1 - adds r0, r4 - ldrh r2, [r0] - mov r8, r1 - cmp r2, 0 - bne _08053280 - b _08053408 -_08053280: - ldr r0, =0x0000ffff - cmp r2, r0 - bne _08053288 - b _08053408 -_08053288: - movs r7, 0 - ldr r0, =0x02024084 - movs r1, 0x58 - muls r1, r3 - adds r3, r0, 0 - adds r3, 0xC - adds r1, r3 - ldrh r1, [r1] - cmp r2, r1 - beq _080532C0 - adds r6, r4, 0 - mov r5, r8 - adds r4, r3, 0 - movs r3, 0x58 -_080532A4: - adds r7, 0x1 - cmp r7, 0x3 - bgt _080532C0 - ldrb r0, [r5] - lsls r2, r0, 1 - adds r2, r6 - lsls r1, r7, 1 - muls r0, r3 - adds r1, r0 - adds r1, r4 - ldrh r0, [r2] - ldrh r1, [r1] - cmp r0, r1 - bne _080532A4 -_080532C0: - cmp r7, 0x4 - bne _080532C6 - b _08053408 -_080532C6: - mov r4, r8 - ldrb r0, [r4] - movs r1, 0x58 - mov r9, r1 - mov r3, r9 - muls r3, r0 - adds r0, r3, 0 - adds r0, r7, r0 - ldr r1, =0x02024084 - adds r1, 0x24 - mov r10, r1 - add r0, r10 - ldrb r0, [r0] - cmp r0, 0x1 - bhi _080532E6 - b _08053408 -_080532E6: - bl GenerateRandomNumber - movs r1, 0x3 - ands r1, r0 - adds r6, r1, 0x2 - ldrb r0, [r4] - mov r3, r9 - muls r3, r0 - adds r0, r3, 0 - adds r0, r7, r0 - add r0, r10 - ldrb r0, [r0] - cmp r0, r6 - bge _08053304 - adds r6, r0, 0 -_08053304: - ldr r1, =0x02022f58 - movs r5, 0xFD - strb r5, [r1] - movs r0, 0x2 - strb r0, [r1, 0x1] - ldr r2, =0x02024248 - mov r3, r8 - ldrb r0, [r3] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - strb r0, [r1, 0x2] - ldrb r0, [r3] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - lsrs r0, 8 - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r4, =0x02022f68 - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0 - movs r3, 0x1 - bl ConvertIntToDecimalString - strb r5, [r4] - movs r0, 0x1 - strb r0, [r4, 0x1] - strb r0, [r4, 0x2] - strb r0, [r4, 0x3] - strb r6, [r4, 0x4] - subs r0, 0x2 - strb r0, [r4, 0x5] - mov r1, r8 - ldrb r0, [r1] - mov r1, r9 - muls r1, r0 - adds r1, r7, r1 - add r1, r10 - ldrb r0, [r1] - subs r0, r6 - strb r0, [r1] - ldr r4, =0x02024064 - mov r3, r8 - ldrb r0, [r3] - strb r0, [r4] - ldr r1, =0x020242bc - ldrb r3, [r4] - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x18] - lsrs r1, 4 - ldr r2, =gUnknown_0832A328 - lsls r0, r7, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _080533B8 - mov r2, r9 - muls r2, r3 - ldr r0, =0x02024084 - adds r0, 0x50 - adds r0, r2, r0 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 14 - ands r0, r1 - cmp r0, 0 - bne _080533B8 - adds r1, r7, 0 - adds r1, 0x9 - lsls r1, 24 - lsrs r1, 24 - mov r3, r10 - adds r0, r2, r3 - adds r0, r7 - str r0, [sp] - movs r0, 0 - movs r2, 0 - movs r3, 0x1 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_080533B8: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - ldr r1, =0x02024084 - ldr r0, =0x0202420c - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r0, r7, r0 - adds r1, 0x24 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _08053422 - adds r0, r2, 0 - bl b_cancel_multi_turn_move_maybe - b _08053422 - .pool -_08053408: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_08053422: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkAD_reducepprandom - - thumb_func_start atkAE_clearstatusifnotsoundproofed -atkAE_clearstatusifnotsoundproofed: @ 8053438 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - movs r4, 0 - str r4, [sp, 0x4] - mov r8, r4 - ldr r0, =0x020241ea - ldrh r0, [r0] - cmp r0, 0xD7 - beq _08053454 - b _0805363E -_08053454: - ldr r6, =0x02024332 - mov r0, r8 - strb r0, [r6, 0x5] - ldr r5, =0x0202420b - ldrb r0, [r5] - bl battle_side_get_owner - lsls r0, 24 - ldr r1, =0x02024744 - mov r10, r1 - cmp r0, 0 - bne _08053470 - ldr r2, =0x020244ec - mov r10, r2 -_08053470: - ldr r4, =0x02024084 - ldrb r3, [r5] - movs r7, 0x58 - adds r2, r3, 0 - muls r2, r7 - adds r0, r2, r4 - adds r1, r0, 0 - adds r1, 0x20 - ldrb r0, [r1] - cmp r0, 0x2B - beq _080534C4 - adds r0, r4, 0 - adds r0, 0x4C - adds r0, r2, r0 - mov r1, r8 - str r1, [r0] - ldrb r0, [r5] - adds r2, r0, 0 - muls r2, r7 - adds r0, r4, 0 - adds r0, 0x50 - adds r2, r0 - ldr r0, [r2] - ldr r1, =0xf7ffffff - ands r0, r1 - str r0, [r2] - b _080534D4 - .pool -_080534C4: - ldrb r1, [r1] - adds r0, r3, 0 - bl b_history__record_ability_usage_of_player - ldrb r0, [r6, 0x5] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r6, 0x5] -_080534D4: - ldr r7, =0x02024064 - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_get_per_side_status - movs r2, 0x2 - mov r9, r2 - mov r1, r9 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - ldr r1, =0x02024474 - strb r0, [r1, 0x17] - strb r0, [r7] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0805357A - ldr r0, =0x02024210 - ldrb r2, [r0] - ldr r1, =gUnknown_0832A328 - ldrb r3, [r7] - lsls r0, r3, 2 - adds r0, r1 - ldr r0, [r0] - ands r2, r0 - cmp r2, 0 - bne _0805357A - ldr r5, =0x02024084 - movs r6, 0x58 - adds r4, r3, 0 - muls r4, r6 - adds r0, r4, r5 - adds r1, r0, 0 - adds r1, 0x20 - ldrb r0, [r1] - cmp r0, 0x2B - beq _08053568 - adds r0, r5, 0 - adds r0, 0x4C - adds r0, r4, r0 - str r2, [r0] - ldrb r0, [r7] - adds r2, r0, 0 - muls r2, r6 - adds r0, r5, 0 - adds r0, 0x50 - adds r2, r0 - ldr r0, [r2] - ldr r1, =0xf7ffffff - ands r0, r1 - str r0, [r2] - b _0805357A - .pool -_08053568: - ldrb r1, [r1] - adds r0, r3, 0 - bl b_history__record_ability_usage_of_player - ldr r1, =0x02024332 - ldrb r0, [r1, 0x5] - mov r2, r9 - orrs r0, r2 - strb r0, [r1, 0x5] -_0805357A: - movs r6, 0 - ldr r7, =0x02024084 -_0805357E: - movs r0, 0x64 - adds r4, r6, 0 - muls r4, r0 - add r4, r10 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - movs r1, 0x2E - bl pokemon_getattr - lsls r0, 24 - lsrs r4, r0, 24 - cmp r5, 0 - beq _08053636 - movs r0, 0xCE - lsls r0, 1 - cmp r5, r0 - beq _08053636 - ldr r2, =0x0202406e - ldr r0, =0x0202420b - ldrb r1, [r0] - lsls r0, r1, 1 - adds r0, r2 - ldrh r0, [r0] - cmp r0, r6 - bne _080535D0 - movs r0, 0x58 - muls r0, r1 - b _08053600 - .pool -_080535D0: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08053618 - ldr r0, =0x02024064 - ldrb r3, [r0] - lsls r0, r3, 1 - adds r0, r2 - ldrh r0, [r0] - cmp r0, r6 - bne _08053618 - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - lsls r0, r3, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _08053618 - movs r0, 0x58 - muls r0, r3 -_08053600: - adds r0, r7 - adds r0, 0x20 - ldrb r0, [r0] - b _08053624 - .pool -_08053618: - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_806B694 - lsls r0, 24 - lsrs r0, 24 -_08053624: - cmp r0, 0x2B - beq _08053636 - movs r0, 0x1 - lsls r0, r6 - mov r1, r8 - orrs r1, r0 - lsls r0, r1, 24 - lsrs r0, 24 - mov r8, r0 -_08053636: - adds r6, 0x1 - cmp r6, 0x5 - ble _0805357E - b _080536BC -_0805363E: - ldr r1, =0x02024332 - movs r0, 0x4 - strb r0, [r1, 0x5] - movs r2, 0x3F - mov r8, r2 - ldr r3, =0x02024084 - ldr r2, =0x0202420b - ldrb r0, [r2] - movs r5, 0x58 - muls r0, r5 - movs r1, 0x4C - adds r1, r3 - mov r9, r1 - add r0, r9 - str r4, [r0] - ldrb r0, [r2] - adds r1, r0, 0 - muls r1, r5 - adds r7, r3, 0 - adds r7, 0x50 - adds r1, r7 - ldr r0, [r1] - ldr r6, =0xf7ffffff - ands r0, r6 - str r0, [r1] - ldrb r0, [r2] - bl battle_get_per_side_status - movs r1, 0x2 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - ldr r4, =0x02024064 - strb r0, [r4] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080536BC - ldr r0, =0x02024210 - ldrb r2, [r0] - ldr r1, =gUnknown_0832A328 - ldrb r3, [r4] - lsls r0, r3, 2 - adds r0, r1 - ldr r0, [r0] - ands r2, r0 - cmp r2, 0 - bne _080536BC - adds r0, r3, 0 - muls r0, r5 - add r0, r9 - str r2, [r0] - ldrb r0, [r4] - adds r1, r0, 0 - muls r1, r5 - adds r1, r7 - ldr r0, [r1] - ands r0, r6 - str r0, [r1] -_080536BC: - mov r2, r8 - cmp r2, 0 - beq _080536DE - ldr r4, =0x02024064 - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r4] - add r0, sp, 0x4 - str r0, [sp] - movs r0, 0 - movs r1, 0x28 - movs r3, 0x4 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_080536DE: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkAE_clearstatusifnotsoundproofed - - thumb_func_start atkAF_cursetarget -atkAF_cursetarget: @ 805371C - push {r4,r5,lr} - ldr r5, =0x02024084 - ldr r0, =0x0202420c - ldrb r0, [r0] - movs r4, 0x58 - adds r1, r0, 0 - muls r1, r4 - adds r0, r5, 0 - adds r0, 0x50 - adds r1, r0 - ldr r2, [r1] - movs r3, 0x80 - lsls r3, 21 - adds r0, r2, 0 - ands r0, r3 - cmp r0, 0 - beq _08053768 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0805378C - .pool -_08053768: - orrs r2, r3 - str r2, [r1] - ldr r1, =0x020241f0 - ldr r0, =0x0202420b - ldrb r0, [r0] - muls r0, r4 - adds r0, r5 - ldrh r0, [r0, 0x2C] - lsrs r0, 1 - str r0, [r1] - cmp r0, 0 - bne _08053784 - movs r0, 0x1 - str r0, [r1] -_08053784: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_0805378C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atkAF_cursetarget - - thumb_func_start atkB0_setspikes -atkB0_setspikes: @ 80537A0 - push {r4,lr} - ldr r4, =0x0202420b - ldrb r0, [r4] - bl battle_side_get_owner - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02024294 - lsls r2, r0, 1 - adds r0, r2, r0 - lsls r0, 2 - adds r3, r0, r1 - ldrb r0, [r3, 0xA] - cmp r0, 0x3 - bne _08053804 - ldr r2, =0x0202437c - ldrb r1, [r4] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0] - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0805381E - .pool -_08053804: - ldr r1, =0x0202428e - adds r1, r2, r1 - ldrh r2, [r1] - movs r0, 0x10 - orrs r0, r2 - strh r0, [r1] - ldrb r0, [r3, 0xA] - adds r0, 0x1 - strb r0, [r3, 0xA] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_0805381E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atkB0_setspikes - - thumb_func_start atkB1_setforesight -atkB1_setforesight: @ 805382C - ldr r1, =0x02024084 - ldr r0, =0x0202420c - ldrb r2, [r0] - movs r0, 0x58 - muls r2, r0 - adds r1, 0x50 - adds r2, r1 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 22 - orrs r0, r1 - str r0, [r2] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end atkB1_setforesight - - thumb_func_start atkB2_setperishsong -atkB2_setperishsong: @ 805385C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r6, 0 - movs r3, 0 - ldr r0, =0x0202406c - adds r7, r0, 0 - ldr r0, =0x0202420b - mov r8, r0 - ldrb r1, [r7] - cmp r6, r1 - bge _080538C8 - movs r5, 0x20 - ldr r0, =0x02024084 - mov r12, r0 - ldr r0, =0x020242bc - adds r4, r0, 0 - adds r4, 0xF - ldr r2, =0x020242ac -_08053884: - ldr r1, [r2] - adds r0, r1, 0 - ands r0, r5 - cmp r0, 0 - bne _0805389C - movs r0, 0x58 - muls r0, r3 - add r0, r12 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x2B - bne _080538B4 -_0805389C: - adds r6, 0x1 - b _080538BC - .pool -_080538B4: - orrs r1, r5 - str r1, [r2] - movs r0, 0x33 - strb r0, [r4] -_080538BC: - adds r4, 0x1C - adds r2, 0x4 - adds r3, 0x1 - ldrb r0, [r7] - cmp r3, r0 - blt _08053884 -_080538C8: - mov r1, r8 - ldrb r0, [r1] - bl sub_803F67C - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r6, r0 - bne _080538FC - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08053904 - .pool -_080538FC: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_08053904: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkB2_setperishsong - - thumb_func_start atkB3_rolloutdamagecalculation -atkB3_rolloutdamagecalculation: @ 8053914 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _08053948 - ldr r0, =0x0202420b - ldrb r0, [r0] - bl b_cancel_multi_turn_move_maybe - ldr r1, =0x02024214 - ldr r0, =gUnknown_082D8A60 - str r0, [r1] - b _08053A60 - .pool -_08053948: - ldr r2, =0x02024084 - ldr r1, =0x0202420b - ldrb r3, [r1] - movs r5, 0x58 - adds r0, r3, 0 - muls r0, r5 - adds r4, r2, 0 - adds r4, 0x50 - adds r0, r4 - ldr r0, [r0] - movs r7, 0x80 - lsls r7, 5 - ands r0, r7 - adds r6, r1, 0 - mov r9, r2 - ldr r1, =0x020242bc - mov r12, r1 - ldr r2, =0x020241ea - mov r8, r2 - cmp r0, 0 - bne _080539BA - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - add r0, r12 - ldrb r2, [r0, 0x11] - movs r1, 0x10 - negs r1, r1 - ands r1, r2 - movs r2, 0x5 - orrs r1, r2 - strb r1, [r0, 0x11] - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - ldrb r2, [r0, 0x11] - movs r1, 0xF - ands r1, r2 - movs r2, 0x50 - orrs r1, r2 - strb r1, [r0, 0x11] - ldrb r0, [r6] - adds r1, r0, 0 - muls r1, r5 - adds r1, r4 - ldr r0, [r1] - orrs r0, r7 - str r0, [r1] - ldr r1, =0x02024268 - ldrb r0, [r6] - lsls r0, 1 - adds r0, r1 - mov r2, r8 - ldrh r1, [r2] - strh r1, [r0] -_080539BA: - ldrb r0, [r6] - lsls r2, r0, 3 - subs r2, r0 - lsls r2, 2 - add r2, r12 - ldrb r3, [r2, 0x11] - lsls r1, r3, 28 - lsrs r1, 28 - subs r1, 0x1 - movs r0, 0xF - ands r1, r0 - movs r0, 0x10 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x11] - cmp r1, 0 - bne _080539EE - ldrb r0, [r6] - adds r1, r0, 0 - muls r1, r5 - adds r1, r4 - ldr r0, [r1] - ldr r2, =0xffffefff - ands r0, r2 - str r0, [r1] -_080539EE: - ldr r3, =0x02024400 - ldr r2, =gBattleMoves - mov r0, r8 - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - strh r0, [r3] - movs r2, 0x1 - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - mov r1, r12 - adds r4, r0, r1 - ldrb r0, [r4, 0x11] - lsls r0, 28 - lsrs r0, 28 - movs r1, 0x5 - subs r1, r0 - ldr r7, =0x02024214 - adds r5, r3, 0 - cmp r2, r1 - bge _08053A3C - adds r1, r5, 0 - adds r3, r4, 0 - movs r4, 0x5 -_08053A28: - ldrh r0, [r1] - lsls r0, 1 - strh r0, [r1] - adds r2, 0x1 - ldrb r0, [r3, 0x11] - lsls r0, 28 - lsrs r0, 28 - subs r0, r4, r0 - cmp r2, r0 - blt _08053A28 -_08053A3C: - ldrb r1, [r6] - movs r0, 0x58 - muls r0, r1 - mov r1, r9 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 23 - ands r0, r1 - cmp r0, 0 - beq _08053A5A - ldrh r0, [r5] - lsls r0, 1 - strh r0, [r5] -_08053A5A: - ldr r0, [r7] - adds r0, 0x1 - str r0, [r7] -_08053A60: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkB3_rolloutdamagecalculation - - thumb_func_start atkB4_jumpifconfusedandattackmaxed -atkB4_jumpifconfusedandattackmaxed: @ 8053A90 - push {r4,r5,lr} - ldr r5, =0x02024084 - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0x58 - adds r3, r1, 0 - muls r3, r0 - adds r0, r5, 0 - adds r0, 0x50 - adds r0, r3, r0 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - ldr r4, =0x02024214 - cmp r0, 0 - beq _08053AEC - ldr r2, [r4] - ldrb r0, [r2, 0x1] - adds r0, r3 - adds r1, r5, 0 - adds r1, 0x18 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0xC - bne _08053AEC - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08053AF2 - .pool -_08053AEC: - ldr r0, [r4] - adds r0, 0x6 - str r0, [r4] -_08053AF2: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end atkB4_jumpifconfusedandattackmaxed - - thumb_func_start sub_8053AF8 -sub_8053AF8: @ 8053AF8 - push {r4,r5,lr} - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _08053B34 - ldr r2, =0x020242bc - ldr r0, =0x0202420b - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strb r1, [r0, 0x10] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082D8A60 - str r0, [r1] - b _08053B8C - .pool -_08053B34: - ldr r5, =0x020242bc - ldr r4, =0x0202420b - ldrb r1, [r4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r1, r0, r5 - ldrb r0, [r1, 0x10] - cmp r0, 0x5 - beq _08053B4C - adds r0, 0x1 - strb r0, [r1, 0x10] -_08053B4C: - ldr r3, =0x02024400 - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - strh r0, [r3] - movs r2, 0x1 - ldrb r1, [r4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r4, =0x02024214 - ldrb r1, [r0, 0x10] - cmp r2, r1 - bge _08053B86 - adds r1, r3, 0 - adds r3, r0, 0 -_08053B78: - ldrh r0, [r1] - lsls r0, 1 - strh r0, [r1] - adds r2, 0x1 - ldrb r0, [r3, 0x10] - cmp r2, r0 - blt _08053B78 -_08053B86: - ldr r0, [r4] - adds r0, 0x1 - str r0, [r4] -_08053B8C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8053AF8 - - thumb_func_start atkB6_happinesstodamagecalculation -atkB6_happinesstodamagecalculation: @ 8053BAC - push {r4,lr} - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0x79 - bne _08053BEC - ldr r4, =0x02024400 - ldr r2, =0x02024084 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x2B - ldrb r1, [r0] - b _08053C02 - .pool -_08053BEC: - ldr r4, =0x02024400 - ldr r2, =0x02024084 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x2B - ldrb r0, [r0] - movs r1, 0xFF - subs r1, r0 -_08053C02: - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 1 - movs r1, 0x19 - bl __divsi3 - strh r0, [r4] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atkB6_happinesstodamagecalculation - - thumb_func_start atkB7_presentdamagecalculation -atkB7_presentdamagecalculation: @ 8053C30 - push {r4,lr} - bl GenerateRandomNumber - movs r4, 0xFF - ands r4, r0 - cmp r4, 0x65 - bgt _08053C4C - ldr r1, =0x02024400 - movs r0, 0x28 - strh r0, [r1] - b _08053C8E - .pool -_08053C4C: - cmp r4, 0xB1 - bgt _08053C5C - ldr r1, =0x02024400 - movs r0, 0x50 - strh r0, [r1] - b _08053C8E - .pool -_08053C5C: - cmp r4, 0xCB - bgt _08053C6C - ldr r1, =0x02024400 - movs r0, 0x78 - strh r0, [r1] - b _08053C8E - .pool -_08053C6C: - ldr r3, =0x020241f0 - ldr r2, =0x02024084 - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r0, [r0, 0x2C] - lsrs r0, 2 - str r0, [r3] - cmp r0, 0 - bne _08053C88 - movs r0, 0x1 - str r0, [r3] -_08053C88: - ldr r0, [r3] - negs r0, r0 - str r0, [r3] -_08053C8E: - cmp r4, 0xCB - bgt _08053CAC - ldr r1, =0x02024214 - ldr r0, =gUnknown_082D8A30 - b _08053CE6 - .pool -_08053CAC: - ldr r2, =0x02024084 - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r1, [r0, 0x2C] - ldrh r0, [r0, 0x28] - cmp r1, r0 - bne _08053CD8 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082D9EFB - b _08053CE6 - .pool -_08053CD8: - ldr r2, =0x0202427c - ldrb r1, [r2] - movs r0, 0xF7 - ands r0, r1 - strb r0, [r2] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082D9EE1 -_08053CE6: - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atkB7_presentdamagecalculation - - thumb_func_start atkB8_setsafeguard -atkB8_setsafeguard: @ 8053CFC - push {r4-r7,lr} - ldr r7, =0x0202420b - ldrb r0, [r7] - bl battle_get_per_side_status - ldr r4, =0x0202428e - movs r6, 0x1 - adds r1, r6, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - ldrh r1, [r1] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08053D40 - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024332 - movs r0, 0 - strb r0, [r1, 0x5] - b _08053D88 - .pool -_08053D40: - ldrb r0, [r7] - bl battle_get_per_side_status - adds r1, r6, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - ldrh r0, [r1] - movs r2, 0x20 - orrs r0, r2 - strh r0, [r1] - ldrb r0, [r7] - bl battle_get_per_side_status - ldr r5, =0x02024294 - adds r1, r6, 0 - ands r1, r0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r4, 0x5 - strb r4, [r0, 0x6] - ldrb r0, [r7] - bl battle_get_per_side_status - adds r1, r6, 0 - ands r1, r0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r1, [r7] - strb r1, [r0, 0x7] - ldr r0, =0x02024332 - strb r4, [r0, 0x5] -_08053D88: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkB8_setsafeguard - - thumb_func_start atkB9_magnitudedamagecalculation -atkB9_magnitudedamagecalculation: @ 8053DA4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x4 - bgt _08053DD0 - ldr r1, =0x02024400 - movs r0, 0xA - strh r0, [r1] - movs r3, 0x4 - b _08053E3C - .pool -_08053DD0: - cmp r3, 0xE - bgt _08053DE4 - ldr r1, =0x02024400 - movs r0, 0x1E - strh r0, [r1] - movs r3, 0x5 - b _08053E3C - .pool -_08053DE4: - cmp r3, 0x22 - bgt _08053DF8 - ldr r1, =0x02024400 - movs r0, 0x32 - strh r0, [r1] - movs r3, 0x6 - b _08053E3C - .pool -_08053DF8: - cmp r3, 0x40 - bgt _08053E0C - ldr r1, =0x02024400 - movs r0, 0x46 - strh r0, [r1] - movs r3, 0x7 - b _08053E3C - .pool -_08053E0C: - cmp r3, 0x54 - bgt _08053E20 - ldr r1, =0x02024400 - movs r0, 0x5A - strh r0, [r1] - movs r3, 0x8 - b _08053E3C - .pool -_08053E20: - cmp r3, 0x5E - bgt _08053E34 - ldr r1, =0x02024400 - movs r0, 0x6E - strh r0, [r1] - movs r3, 0x9 - b _08053E3C - .pool -_08053E34: - ldr r1, =0x02024400 - movs r0, 0x96 - strh r0, [r1] - movs r3, 0xA -_08053E3C: - ldr r1, =0x02022f58 - movs r2, 0 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x1 - strb r0, [r1, 0x1] - strb r0, [r1, 0x2] - movs r0, 0x2 - strb r0, [r1, 0x3] - strb r3, [r1, 0x4] - movs r0, 0xFF - strb r0, [r1, 0x5] - ldr r1, =0x0202420c - strb r2, [r1] - ldr r0, =0x0202406c - ldrb r3, [r0] - adds r6, r1, 0 - ldr r0, =0x02024214 - mov r8, r0 - cmp r2, r3 - bcs _08053E94 - adds r4, r6, 0 - ldr r0, =0x0202420b - ldrb r5, [r0] - ldr r1, =gUnknown_0832A328 - mov r12, r1 - ldr r7, =0x02024210 -_08053E72: - ldrb r2, [r4] - cmp r2, r5 - beq _08053E88 - ldrb r0, [r7] - ldrb r1, [r6] - lsls r1, 2 - add r1, r12 - ldr r1, [r1] - ands r0, r1 - cmp r0, 0 - beq _08053E94 -_08053E88: - adds r0, r2, 0x1 - strb r0, [r4] - lsls r0, 24 - lsrs r0, 24 - cmp r0, r3 - bcc _08053E72 -_08053E94: - mov r1, r8 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkB9_magnitudedamagecalculation - - thumb_func_start atkBA_802B140 -atkBA_802B140: @ 8053EC8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =0x02024212 - ldrb r0, [r0] - cmp r0, 0x1 - bne _08053EF8 - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08053EF4 - movs r0, 0x1 - b _08053F12 - .pool -_08053EF4: - movs r0, 0 - b _08053F12 -_08053EF8: - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08053F10 - movs r0, 0x3 - b _08053F12 - .pool -_08053F10: - movs r0, 0x2 -_08053F12: - bl battle_get_side_with_given_state - ldr r1, =0x0202420c - strb r0, [r1] - ldr r0, =0x0202421c - ldr r1, =0x0202420c - ldrb r3, [r1] - adds r0, r3, r0 - ldrb r0, [r0] - cmp r0, 0 - beq _08053F2A - b _08054030 -_08053F2A: - ldr r5, =0x0202420b - ldr r0, =0x0202449c - ldr r1, [r0] - adds r1, r3, r1 - ldrb r2, [r5] - ldrb r1, [r1, 0xC] - cmp r2, r1 - bne _08054030 - ldr r4, =0x02024084 - movs r2, 0x58 - adds r0, r3, 0 - muls r0, r2 - adds r1, r4, 0 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x27 - ands r0, r1 - cmp r0, 0 - bne _08054030 - ldrb r0, [r5] - muls r0, r2 - adds r0, r4 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _08054030 - ldr r0, =0x020242bc - lsls r1, r3, 3 - subs r1, r3 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x18] - lsls r0, 31 - cmp r0, 0 - bne _08054030 - ldr r0, =0x02024274 - lsls r1, r3, 1 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0xE4 - bne _08054030 - movs r1, 0 - ldr r0, =0x0202406c - ldr r2, =0x020241ea - mov r8, r2 - ldr r7, =0x020241e8 - mov r10, r7 - ldr r2, =0x020241e9 - mov r9, r2 - ldr r7, =0x02024280 - mov r12, r7 - ldrb r2, [r0] - cmp r1, r2 - bge _08053FB6 - ldr r6, =0x0202407e - ldr r5, =0x0202420c - ldr r4, =0x0202407a - movs r3, 0xB - adds r2, r0, 0 -_08053FA0: - adds r0, r1, r6 - ldrb r0, [r0] - ldrb r7, [r5] - cmp r0, r7 - bne _08053FAE - adds r0, r1, r4 - strb r3, [r0] -_08053FAE: - adds r1, 0x1 - ldrb r0, [r2] - cmp r1, r0 - blt _08053FA0 -_08053FB6: - movs r0, 0xE4 - mov r1, r8 - strh r0, [r1] - ldr r2, =0x0202420c - ldrb r0, [r2] - ldr r7, =0x0202449c - ldr r1, [r7] - adds r0, r1 - adds r0, 0x80 - ldrb r0, [r0] - mov r1, r9 - strb r0, [r1] - mov r2, r10 - strb r0, [r2] - ldr r7, =0x02024214 - ldr r0, [r7] - adds r0, 0x5 - str r0, [r7] - movs r0, 0x1 - ldr r1, =0x02024474 - strb r0, [r1, 0x18] - mov r2, r12 - ldr r0, [r2] - ldr r1, =0xfffffbff - ands r0, r1 - str r0, [r2] - b _0805404A - .pool -_08054030: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_0805404A: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkBA_802B140 - - thumb_func_start sub_805405C -sub_805405C: @ 805405C - push {lr} - ldr r2, =0x020243cc - ldrh r1, [r2] - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - beq _08054088 - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024332 - movs r0, 0x2 - strb r0, [r1, 0x5] - b _0805409A - .pool -_08054088: - movs r0, 0x20 - strh r0, [r2] - ldr r1, =0x02024332 - movs r0, 0x4 - strb r0, [r1, 0x5] - ldr r0, =0x020243d0 - adds r0, 0x28 - movs r1, 0x5 - strb r1, [r0] -_0805409A: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_805405C - - thumb_func_start atkBC_maxattackhalvehp -atkBC_maxattackhalvehp: @ 80540B4 - push {r4,r5,lr} - ldr r5, =0x02024084 - ldr r4, =0x0202420b - ldrb r0, [r4] - movs r3, 0x58 - muls r0, r3 - adds r2, r0, r5 - ldrh r0, [r2, 0x2C] - lsrs r1, r0, 1 - cmp r1, 0 - bne _080540CC - movs r1, 0x1 -_080540CC: - movs r0, 0x19 - ldrsb r0, [r2, r0] - cmp r0, 0xB - bgt _08054110 - ldrh r0, [r2, 0x28] - cmp r0, r1 - bls _08054110 - movs r0, 0xC - strb r0, [r2, 0x19] - ldr r1, =0x020241f0 - ldrb r0, [r4] - muls r0, r3 - adds r0, r5 - ldrh r0, [r0, 0x2C] - lsrs r0, 1 - str r0, [r1] - cmp r0, 0 - bne _080540F4 - movs r0, 0x1 - str r0, [r1] -_080540F4: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _0805412A - .pool -_08054110: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_0805412A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atkBC_maxattackhalvehp - - thumb_func_start atkBD_copyfoestats -atkBD_copyfoestats: @ 8054134 - push {r4-r7,lr} - movs r2, 0 - ldr r7, =0x02024214 - ldr r6, =0x0202420b - movs r4, 0x58 - ldr r3, =0x0202409c - ldr r5, =0x0202420c -_08054142: - ldrb r0, [r6] - adds r1, r0, 0 - muls r1, r4 - adds r1, r2, r1 - adds r1, r3 - ldrb r0, [r5] - muls r0, r4 - adds r0, r2, r0 - adds r0, r3 - ldrb r0, [r0] - strb r0, [r1] - adds r2, 0x1 - cmp r2, 0x7 - ble _08054142 - ldr r0, [r7] - adds r0, 0x5 - str r0, [r7] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkBD_copyfoestats - - thumb_func_start atkBE_breakfree -atkBE_breakfree: @ 805417C - push {r4-r6,lr} - ldr r1, =0x02024084 - ldr r5, =0x0202420b - ldrb r2, [r5] - movs r6, 0x58 - adds r0, r2, 0 - muls r0, r6 - adds r4, r1, 0 - adds r4, 0x50 - adds r0, r4 - ldr r0, [r0] - movs r1, 0xE0 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _08054210 - ldr r1, =0x02024474 - ldr r3, =0x0202420c - ldrb r0, [r3] - strb r0, [r1, 0x17] - ldrb r0, [r5] - adds r1, r0, 0 - muls r1, r6 - adds r1, r4 - ldr r0, [r1] - ldr r2, =0xffff1fff - ands r0, r2 - str r0, [r1] - ldrb r0, [r5] - ldr r1, =0x0202449c - ldr r2, [r1] - adds r0, r2 - ldrb r0, [r0, 0x14] - strb r0, [r3] - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x2 - strb r0, [r1, 0x1] - ldrb r0, [r5] - lsls r0, 1 - adds r0, r2 - ldrb r0, [r0, 0x4] - strb r0, [r1, 0x2] - ldrb r0, [r5] - lsls r0, 1 - adds r0, r2 - ldrb r0, [r0, 0x5] - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAFC5 - b _080542BA - .pool -_08054210: - ldr r4, =0x020242ac - lsls r0, r2, 2 - adds r3, r0, r4 - ldr r1, [r3] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08054250 - movs r0, 0x5 - negs r0, r0 - ands r1, r0 - str r1, [r3] - ldrb r1, [r5] - lsls r1, 2 - adds r1, r4 - ldr r0, [r1] - movs r2, 0x4 - negs r2, r2 - ands r0, r2 - str r0, [r1] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAFD6 - b _080542BA - .pool -_08054250: - adds r0, r2, 0 - bl battle_side_get_owner - ldr r4, =0x0202428e - lsls r0, 24 - lsrs r0, 23 - adds r0, r4 - ldrh r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080542B4 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 23 - adds r0, r4 - ldrh r2, [r0] - ldr r1, =0x0000ffef - ands r1, r2 - movs r4, 0 - strh r1, [r0] - ldrb r0, [r5] - bl battle_side_get_owner - ldr r2, =0x02024294 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - strb r4, [r1, 0xA] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAFDD - b _080542BA - .pool -_080542B4: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 -_080542BA: - str r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atkBE_breakfree - - thumb_func_start atkBF_setcurled -atkBF_setcurled: @ 80542C8 - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r2, r0 - adds r1, 0x50 - adds r2, r1 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 23 - orrs r0, r1 - str r0, [r2] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end atkBF_setcurled - - thumb_func_start atkC0_recoverbasedonsunlight -atkC0_recoverbasedonsunlight: @ 80542F8 - push {r4-r7,lr} - sub sp, 0x4 - ldr r1, =0x0202420c - ldr r5, =0x0202420b - ldrb r0, [r5] - strb r0, [r1] - ldr r7, =0x02024084 - ldrb r0, [r5] - movs r6, 0x58 - muls r0, r6 - adds r0, r7 - ldrh r1, [r0, 0x28] - ldrh r0, [r0, 0x2C] - cmp r1, r0 - beq _080543D8 - ldr r4, =0x020243cc - ldrh r0, [r4] - cmp r0, 0 - beq _0805434A - movs r0, 0 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _0805434A - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0x4D - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _08054378 -_0805434A: - ldr r3, =0x020241f0 - ldr r2, =0x02024084 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r0, [r0, 0x2C] - lsrs r0, 1 - str r0, [r3] - adds r1, r3, 0 - b _080543B2 - .pool -_08054378: - ldrh r1, [r4] - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - beq _080543A4 - ldr r4, =0x020241f0 - ldrb r0, [r5] - muls r0, r6 - adds r0, r7 - ldrh r1, [r0, 0x2C] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - movs r1, 0x1E - bl __divsi3 - str r0, [r4] - adds r1, r4, 0 - b _080543B2 - .pool -_080543A4: - ldr r1, =0x020241f0 - ldrb r0, [r5] - muls r0, r6 - adds r0, r7 - ldrh r0, [r0, 0x2C] - lsrs r0, 2 - str r0, [r1] -_080543B2: - adds r2, r1, 0 - ldr r0, [r2] - cmp r0, 0 - bne _080543BE - movs r0, 0x1 - str r0, [r2] -_080543BE: - ldr r0, [r1] - negs r0, r0 - str r0, [r1] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _080543F2 - .pool -_080543D8: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_080543F2: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkC0_recoverbasedonsunlight - - thumb_func_start sub_8054400 -sub_8054400: @ 8054400 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r2, =0x02024084 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - adds r4, r1, 0 - muls r4, r0 - adds r4, r2 - ldrb r0, [r4, 0x14] - mov r10, r0 - mov r7, r10 - lsls r7, 27 - adds r0, r7, 0 - lsrs r0, 27 - mov r10, r0 - movs r1, 0x2 - mov r2, r10 - ands r2, r1 - asrs r2, 1 - ldrh r7, [r4, 0x14] - mov r9, r7 - mov r0, r9 - lsls r0, 22 - mov r9, r0 - lsrs r3, r0, 27 - adds r0, r1, 0 - ands r0, r3 - orrs r2, r0 - ldrb r7, [r4, 0x15] - mov r8, r7 - mov r0, r8 - lsls r0, 25 - mov r8, r0 - lsrs r3, r0, 27 - adds r0, r1, 0 - ands r0, r3 - lsls r0, 1 - orrs r2, r0 - ldr r6, [r4, 0x14] - lsls r6, 12 - lsrs r3, r6, 27 - adds r0, r1, 0 - ands r0, r3 - lsls r0, 2 - orrs r2, r0 - ldrh r5, [r4, 0x16] - lsls r5, 23 - lsrs r3, r5, 27 - adds r0, r1, 0 - ands r0, r3 - lsls r0, 3 - orrs r2, r0 - ldrb r3, [r4, 0x17] - lsls r3, 26 - lsrs r0, r3, 27 - ands r1, r0 - lsls r1, 4 - orrs r2, r1 - movs r1, 0x1 - adds r4, r1, 0 - mov r7, r10 - ands r4, r7 - mov r0, r9 - lsrs r0, 27 - mov r9, r0 - adds r0, r1, 0 - mov r7, r9 - ands r0, r7 - lsls r0, 1 - orrs r4, r0 - mov r0, r8 - lsrs r0, 27 - mov r8, r0 - adds r0, r1, 0 - mov r7, r8 - ands r0, r7 - lsls r0, 2 - orrs r4, r0 - lsrs r6, 27 - adds r0, r1, 0 - ands r0, r6 - lsls r0, 3 - orrs r4, r0 - lsrs r5, 27 - adds r0, r1, 0 - ands r0, r5 - lsls r0, 4 - orrs r4, r0 - lsrs r3, 27 - ands r1, r3 - lsls r1, 5 - orrs r4, r1 - ldr r5, =0x02024400 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - movs r1, 0x3F - bl __divsi3 - adds r0, 0x1E - strh r0, [r5] - ldr r6, =0x0202449c - ldr r5, [r6] - lsls r0, r4, 4 - subs r0, r4 - movs r1, 0x3F - bl __divsi3 - adds r0, 0x1 - strb r0, [r5, 0x13] - ldr r1, [r6] - ldrb r0, [r1, 0x13] - cmp r0, 0x8 - bls _080544F0 - adds r0, 0x1 - strb r0, [r1, 0x13] -_080544F0: - ldr r2, [r6] - ldrb r0, [r2, 0x13] - movs r1, 0xC0 - orrs r0, r1 - strb r0, [r2, 0x13] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8054400 - - thumb_func_start atkC2_selectnexttarget -atkC2_selectnexttarget: @ 8054524 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =0x0202420c - movs r1, 0 - strb r1, [r0] - ldr r1, =0x0202406c - ldrb r1, [r1] - adds r6, r0, 0 - ldr r0, =0x02024214 - mov r8, r0 - cmp r1, 0 - beq _0805456E - adds r3, r6, 0 - ldr r0, =0x0202420b - ldrb r5, [r0] - ldr r0, =gUnknown_0832A328 - mov r12, r0 - adds r4, r1, 0 - ldr r7, =0x02024210 -_0805454C: - ldrb r2, [r3] - cmp r2, r5 - beq _08054562 - ldrb r0, [r7] - ldrb r1, [r6] - lsls r1, 2 - add r1, r12 - ldr r1, [r1] - ands r0, r1 - cmp r0, 0 - beq _0805456E -_08054562: - adds r0, r2, 0x1 - strb r0, [r3] - lsls r0, 24 - lsrs r0, 24 - cmp r0, r4 - bcc _0805454C -_0805456E: - mov r1, r8 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkC2_selectnexttarget - - thumb_func_start atkC3_setfutureattack -atkC3_setfutureattack: @ 8054598 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - ldr r0, =0x020243d0 - mov r8, r0 - ldr r6, =0x0202420c - ldrb r1, [r6] - adds r0, r1, r0 - ldrb r7, [r0] - cmp r7, 0 - beq _080545DC - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _080546CC - .pool -_080545DC: - adds r0, r1, 0 - bl battle_get_per_side_status - ldr r4, =0x0202428e - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - mov r10, r1 - ands r0, r1 - lsls r0, 1 - adds r0, r4 - ldrh r2, [r0] - movs r1, 0x40 - movs r5, 0 - mov r3, sp - strh r5, [r3, 0x10] - orrs r1, r2 - strh r1, [r0] - ldrb r0, [r6] - lsls r0, 1 - mov r1, r8 - adds r1, 0x18 - adds r0, r1 - ldr r1, =0x020241ea - mov r9, r1 - ldrh r1, [r1] - strh r1, [r0] - mov r0, r8 - adds r0, 0x4 - ldrb r2, [r6] - adds r0, r2 - ldr r5, =0x0202420b - ldrb r1, [r5] - strb r1, [r0] - ldrb r0, [r6] - add r0, r8 - movs r1, 0x3 - strb r1, [r0] - ldrb r0, [r6] - bl battle_get_per_side_status - mov r1, r10 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - ldrh r3, [r1] - ldrb r0, [r5] - movs r4, 0x58 - muls r0, r4 - ldr r2, =0x02024084 - adds r0, r2 - ldrb r1, [r6] - muls r1, r4 - adds r1, r2 - mov r4, r9 - ldrh r2, [r4] - str r7, [sp] - str r7, [sp, 0x4] - ldrb r4, [r5] - str r4, [sp, 0x8] - ldrb r4, [r6] - str r4, [sp, 0xC] - bl sub_806957C - ldrb r1, [r6] - lsls r1, 2 - mov r2, r8 - adds r2, 0x8 - adds r1, r2 - str r0, [r1] - ldr r1, =0x0202433c - ldrb r0, [r5] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 28 - cmp r0, 0 - bge _0805468C - ldrb r4, [r6] - lsls r4, 2 - adds r4, r2 - ldr r1, [r4] - lsls r0, r1, 4 - subs r0, r1 - movs r1, 0xA - bl __divsi3 - str r0, [r4] -_0805468C: - mov r5, r9 - ldrh r1, [r5] - ldr r0, =0x00000161 - cmp r1, r0 - bne _080546BC - ldr r0, =0x02024332 - mov r1, r10 - strb r1, [r0, 0x5] - b _080546C4 - .pool -_080546BC: - ldr r0, =0x02024332 - mov r2, sp - ldrb r2, [r2, 0x10] - strb r2, [r0, 0x5] -_080546C4: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_080546CC: - add sp, 0x14 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkC3_setfutureattack - - thumb_func_start atkC4_802B910 -atkC4_802B910: @ 80546E4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - ldr r7, =0x02024744 - cmp r0, 0 - bne _080546FE - ldr r7, =0x020244ec -_080546FE: - ldr r2, =0x02024084 - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _08054740 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - b _080548DC - .pool -_08054740: - ldr r6, =0x02024332 - ldrb r0, [r6] - mov r8, r0 - cmp r0, 0x5 - bls _0805474C - b _080548A8 -_0805474C: - adds r4, r6, 0 - movs r5, 0x64 -_08054750: - ldrb r0, [r4] - muls r0, r5 - adds r0, r7, r0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _08054794 - ldrb r0, [r6] - muls r0, r5 - adds r0, r7, r0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - beq _08054794 - ldrb r0, [r4] - muls r0, r5 - adds r0, r7, r0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _08054794 - ldrb r0, [r4] - muls r0, r5 - adds r0, r7, r0 - movs r1, 0x37 - bl pokemon_getattr - cmp r0, 0 - beq _080547A4 -_08054794: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - adds r6, r4, 0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - bls _08054750 -_080547A4: - ldr r1, =0x02024332 - mov r9, r1 - ldrb r2, [r1] - cmp r2, 0x5 - bhi _080548A8 - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x4 - strb r0, [r1, 0x1] - ldr r6, =0x0202420b - ldrb r0, [r6] - strb r0, [r1, 0x2] - strb r2, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x9 - str r0, [r1] - ldr r2, =0x020241f0 - mov r8, r2 - ldr r5, =gBaseStats - mov r1, r9 - ldrb r0, [r1] - movs r4, 0x64 - muls r0, r4 - adds r0, r7, r0 - movs r1, 0xB - bl pokemon_getattr - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r3, [r1, 0x1] - mov r2, r8 - str r3, [r2] - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - muls r0, r3 - mov r1, r8 - str r0, [r1] - mov r2, r9 - ldrb r0, [r2] - muls r0, r4 - adds r0, r7, r0 - movs r1, 0x38 - bl pokemon_getattr - lsls r0, 1 - movs r1, 0x5 - bl __udivsi3 - adds r0, 0x2 - mov r2, r8 - ldr r1, [r2] - muls r0, r1 - str r0, [r2] - ldr r3, =0x02024084 - ldr r1, =0x0202420c - ldrb r2, [r1] - movs r1, 0x58 - muls r1, r2 - adds r1, r3 - ldrh r2, [r1] - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r5 - ldrb r1, [r1, 0x2] - bl __divsi3 - mov r1, r8 - str r0, [r1] - movs r1, 0x32 - bl __divsi3 - adds r2, r0, 0x2 - mov r0, r8 - str r2, [r0] - ldr r1, =0x0202433c - ldrb r0, [r6] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 28 - cmp r0, 0 - bge _08054870 - lsls r0, r2, 4 - subs r0, r2 - movs r1, 0xA - bl __divsi3 - mov r1, r8 - str r0, [r1] -_08054870: - mov r2, r9 - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - b _080548E2 - .pool -_080548A8: - mov r0, r8 - cmp r0, 0 - beq _080548C8 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - b _080548DC - .pool -_080548C8: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x5] - ldrb r0, [r2, 0x6] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x8] -_080548DC: - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_080548E2: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkC4_802B910 - - thumb_func_start atkC5_hidepreattack -atkC5_hidepreattack: @ 80548F4 - push {lr} - ldr r0, =0x020241ea - ldrh r1, [r0] - cmp r1, 0x5B - beq _08054934 - cmp r1, 0x5B - bgt _0805490C - cmp r1, 0x13 - beq _08054918 - b _08054960 - .pool -_0805490C: - ldr r0, =0x00000123 - cmp r1, r0 - beq _0805494C - adds r0, 0x31 - cmp r1, r0 - bne _08054960 -_08054918: - ldr r2, =0x020242ac - ldr r0, =0x0202420b - ldrb r1, [r0] - lsls r1, 2 - adds r1, r2 - ldr r0, [r1] - movs r2, 0x40 - b _0805495C - .pool -_08054934: - ldr r2, =0x020242ac - ldr r0, =0x0202420b - ldrb r1, [r0] - lsls r1, 2 - adds r1, r2 - ldr r0, [r1] - movs r2, 0x80 - b _0805495C - .pool -_0805494C: - ldr r2, =0x020242ac - ldr r0, =0x0202420b - ldrb r1, [r0] - lsls r1, 2 - adds r1, r2 - ldr r0, [r1] - movs r2, 0x80 - lsls r2, 11 -_0805495C: - orrs r0, r2 - str r0, [r1] -_08054960: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end atkC5_hidepreattack - - thumb_func_start atkC6_unhidepostattack -atkC6_unhidepostattack: @ 8054978 - push {lr} - ldr r0, =0x020241ea - ldrh r1, [r0] - cmp r1, 0x5B - beq _080549BC - cmp r1, 0x5B - bgt _08054990 - cmp r1, 0x13 - beq _0805499C - b _080549EA - .pool -_08054990: - ldr r0, =0x00000123 - cmp r1, r0 - beq _080549D8 - adds r0, 0x31 - cmp r1, r0 - bne _080549EA -_0805499C: - ldr r2, =0x020242ac - ldr r0, =0x0202420b - ldrb r1, [r0] - lsls r1, 2 - adds r1, r2 - ldr r0, [r1] - movs r2, 0x41 - negs r2, r2 - b _080549E6 - .pool -_080549BC: - ldr r2, =0x020242ac - ldr r0, =0x0202420b - ldrb r1, [r0] - lsls r1, 2 - adds r1, r2 - ldr r0, [r1] - movs r2, 0x81 - negs r2, r2 - b _080549E6 - .pool -_080549D8: - ldr r2, =0x020242ac - ldr r0, =0x0202420b - ldrb r1, [r0] - lsls r1, 2 - adds r1, r2 - ldr r0, [r1] - ldr r2, =0xfffbffff -_080549E6: - ands r0, r2 - str r0, [r1] -_080549EA: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end atkC6_unhidepostattack - - thumb_func_start atkC7_setminimize -atkC7_setminimize: @ 8054A08 - push {lr} - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 18 - ands r0, r1 - cmp r0, 0 - beq _08054A2C - ldr r2, =0x020242ac - ldr r0, =0x0202420b - ldrb r1, [r0] - lsls r1, 2 - adds r1, r2 - ldr r0, [r1] - movs r2, 0x80 - lsls r2, 1 - orrs r0, r2 - str r0, [r1] -_08054A2C: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end atkC7_setminimize - - thumb_func_start sub_8054A48 -sub_8054A48: @ 8054A48 - push {lr} - ldr r3, =0x020243cc - ldrh r1, [r3] - movs r2, 0x80 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _08054A78 - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024332 - movs r0, 0x2 - strb r0, [r1, 0x5] - b _08054A86 - .pool -_08054A78: - strh r2, [r3] - ldr r0, =0x02024332 - movs r1, 0x5 - strb r1, [r0, 0x5] - ldr r0, =0x020243d0 - adds r0, 0x28 - strb r1, [r0] -_08054A86: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8054A48 - - thumb_func_start atkC9_jumpifattackandspecialattackcannotfall -atkC9_jumpifattackandspecialattackcannotfall: @ 8054AA0 - push {r4,lr} - ldr r2, =0x02024084 - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r1, r0, r2 - movs r0, 0x19 - ldrsb r0, [r1, r0] - adds r3, r2, 0 - cmp r0, 0 - bne _08054AF4 - movs r0, 0x1C - ldrsb r0, [r1, r0] - cmp r0, 0 - bne _08054AF4 - ldr r0, =0x02024332 - ldrb r0, [r0, 0x6] - cmp r0, 0x1 - beq _08054AF4 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08054B20 - .pool -_08054AF4: - ldr r4, =0x02024064 - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r4] - ldr r2, =0x020241f0 - ldrb r1, [r4] - movs r0, 0x58 - muls r0, r1 - adds r0, r3 - ldrh r0, [r0, 0x28] - str r0, [r2] - ldr r1, =0x00007fff - movs r0, 0 - bl dp01_build_cmdbuf_x18_0_aa_health_bar_update - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_08054B20: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atkC9_jumpifattackandspecialattackcannotfall - - thumb_func_start atkCA_setforcedtarget -atkCA_setforcedtarget: @ 8054B3C - push {r4,r5,lr} - ldr r4, =0x0202420b - ldrb r0, [r4] - bl battle_side_get_owner - ldr r5, =0x02024294 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - movs r0, 0x1 - strb r0, [r1, 0x8] - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r0, [r4] - strb r0, [r1, 0x9] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atkCA_setforcedtarget - - thumb_func_start atkCB_setcharge -atkCB_setcharge: @ 8054B88 - push {r4,lr} - ldr r0, =0x020242ac - ldr r3, =0x0202420b - ldrb r1, [r3] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - movs r2, 0x80 - lsls r2, 2 - orrs r0, r2 - str r0, [r1] - ldr r4, =0x020242bc - ldrb r1, [r3] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r2, [r0, 0x12] - movs r1, 0x10 - negs r1, r1 - ands r1, r2 - movs r2, 0x2 - orrs r1, r2 - strb r1, [r0, 0x12] - ldrb r1, [r3] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r2, [r0, 0x12] - movs r1, 0xF - ands r1, r2 - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0, 0x12] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atkCB_setcharge - - thumb_func_start atkCC_callterrainattack -atkCC_callterrainattack: @ 8054BEC - push {r4,lr} - ldr r2, =0x02024280 - ldr r0, [r2] - ldr r1, =0xfffffbff - ands r0, r1 - str r0, [r2] - ldr r4, =0x020241ea - ldr r1, =gUnknown_0831C414 - ldr r0, =0x02022ff0 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r4] - ldrh r0, [r4] - movs r1, 0 - bl sub_80458E0 - ldr r1, =0x0202420c - strb r0, [r1] - ldr r3, =gUnknown_082D86A8 - ldr r2, =gBattleMoves - ldrh r1, [r4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - bl b_movescr_stack_push - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atkCC_callterrainattack - - thumb_func_start atkCD_cureifburnedparalysedorpoisoned -atkCD_cureifburnedparalysedorpoisoned: @ 8054C60 - push {r4-r6,lr} - sub sp, 0x4 - ldr r1, =0x02024084 - ldr r3, =0x0202420b - ldrb r0, [r3] - movs r6, 0x58 - muls r0, r6 - adds r5, r1, 0 - adds r5, 0x4C - adds r2, r0, r5 - ldr r0, [r2] - movs r1, 0xD8 - ands r0, r1 - cmp r0, 0 - beq _08054CBC - movs r0, 0 - str r0, [r2] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - ldr r4, =0x02024064 - ldrb r0, [r3] - strb r0, [r4] - ldrb r0, [r4] - muls r0, r6 - adds r0, r5 - str r0, [sp] - movs r0, 0 - movs r1, 0x28 - movs r2, 0 - movs r3, 0x4 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - b _08054CD6 - .pool -_08054CBC: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_08054CD6: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atkCD_cureifburnedparalysedorpoisoned - - thumb_func_start atkCE_settorment -atkCE_settorment: @ 8054CE4 - push {lr} - ldr r1, =0x02024084 - ldr r0, =0x0202420c - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r1, [r0] - movs r2, 0x80 - lsls r2, 24 - cmp r1, 0 - bge _08054D28 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08054D34 - .pool -_08054D28: - orrs r1, r2 - str r1, [r0] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_08054D34: - pop {r0} - bx r0 - .pool - thumb_func_end atkCE_settorment - - thumb_func_start atkCF_jumpifnodamage -atkCF_jumpifnodamage: @ 8054D3C - push {lr} - ldr r2, =0x0202433c - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r1, r0, 4 - adds r0, r2, 0x4 - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08054D5C - adds r0, r2, 0 - adds r0, 0x8 - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - beq _08054D74 -_08054D5C: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _08054D8E - .pool -_08054D74: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_08054D8E: - pop {r0} - bx r0 - .pool - thumb_func_end atkCF_jumpifnodamage - - thumb_func_start atkD0_settaunt -atkD0_settaunt: @ 8054D98 - push {r4,lr} - ldr r4, =0x020242bc - ldr r3, =0x0202420c - ldrb r0, [r3] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r2, r1, r4 - ldrb r1, [r2, 0x13] - lsls r0, r1, 28 - cmp r0, 0 - bne _08054DE8 - movs r0, 0x10 - negs r0, r0 - ands r0, r1 - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2, 0x13] - ldrb r1, [r3] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r2, [r0, 0x13] - movs r1, 0xF - ands r1, r2 - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0, 0x13] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _08054E02 - .pool -_08054DE8: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_08054E02: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atkD0_settaunt - - thumb_func_start atkD1_sethelpinghand -atkD1_sethelpinghand: @ 8054E0C - push {r4,lr} - ldr r4, =0x0202420b - ldrb r0, [r4] - bl battle_get_per_side_status - movs r1, 0x2 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - ldr r3, =0x0202420c - strb r0, [r3] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08054E90 - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - ldrb r3, [r3] - lsls r0, r3, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _08054E90 - ldr r1, =0x0202433c - ldrb r0, [r4] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 28 - cmp r0, 0 - blt _08054E90 - lsls r0, r3, 4 - adds r2, r0, r1 - ldrb r1, [r2] - lsls r0, r1, 28 - cmp r0, 0 - blt _08054E90 - movs r0, 0x8 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _08054EAA - .pool -_08054E90: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_08054EAA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atkD1_sethelpinghand - - thumb_func_start sub_8054EB4 -sub_8054EB4: @ 8054EB4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - ldr r4, =0x02022fec - ldr r0, [r4] - movs r1, 0x80 - lsls r1, 19 - ands r0, r1 - cmp r0, 0 - bne _08054F9A - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08054EE8 - ldr r0, [r4] - ldr r1, =0x0a3f0902 - ands r0, r1 - cmp r0, 0 - beq _08054F9A -_08054EE8: - ldr r6, =0x0202420b - ldrb r0, [r6] - bl battle_side_get_owner - lsls r0, 24 - lsrs r4, r0, 24 - ldr r7, =0x0202420c - ldrb r0, [r7] - bl battle_side_get_owner - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x0a3f0902 - ands r0, r1 - cmp r0, 0 - bne _08054F46 - ldr r0, =0x020243d0 - adds r2, r0, 0 - adds r2, 0x29 - adds r0, r4, r2 - ldrb r1, [r0] - ldr r4, =gUnknown_0832A328 - ldr r3, =0x0202406e - ldrb r0, [r6] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r4 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _08054F9A - adds r0, r5, r2 - ldrb r1, [r0] - ldrb r0, [r7] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r4 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _08054F9A -_08054F46: - ldr r0, =0x02024084 - mov r8, r0 - ldr r1, =0x0202420b - ldrb r4, [r1] - movs r5, 0x58 - adds r0, r4, 0 - muls r0, r5 - add r0, r8 - mov r9, r0 - ldrh r3, [r0, 0x2E] - adds r1, r3, 0 - cmp r1, 0 - bne _08054F6E - ldr r0, =0x0202420c - ldrb r0, [r0] - muls r0, r5 - add r0, r8 - ldrh r0, [r0, 0x2E] - cmp r0, 0 - beq _08054F9A -_08054F6E: - cmp r1, 0xAF - beq _08054F9A - ldr r7, =0x0202420c - ldrb r0, [r7] - muls r0, r5 - mov r2, r8 - adds r1, r0, r2 - ldrh r2, [r1, 0x2E] - cmp r2, 0xAF - beq _08054F9A - adds r0, r3, 0 - subs r0, 0x79 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xB - bls _08054F9A - adds r0, r2, 0 - subs r0, 0x79 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xB - bhi _08054FDC -_08054F9A: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08055132 - .pool -_08054FDC: - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x3C - bne _08055010 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB63F - str r0, [r1] - ldr r1, =0x0202420a - ldrb r0, [r7] - muls r0, r5 - add r0, r8 - adds r0, 0x20 - ldrb r0, [r0] - strb r0, [r1] - ldrb r0, [r7] - ldrb r1, [r1] - bl b_history__record_ability_usage_of_player - b _08055132 - .pool -_08055010: - ldr r3, =0x0202449c - mov r10, r3 - lsls r0, r4, 1 - adds r0, 0xD0 - ldr r1, [r3] - adds r6, r1, r0 - mov r0, r9 - ldrh r0, [r0, 0x2E] - mov r9, r0 - strh r2, [r6] - ldr r1, =0x0202420b - ldrb r0, [r1] - muls r0, r5 - add r0, r8 - movs r1, 0 - strh r1, [r0, 0x2E] - ldrb r0, [r7] - muls r0, r5 - add r0, r8 - mov r2, r9 - strh r2, [r0, 0x2E] - ldr r4, =0x02024064 - ldr r3, =0x0202420b - ldrb r0, [r3] - strb r0, [r4] - str r6, [sp] - movs r0, 0 - movs r1, 0x2 - movs r2, 0 - movs r3, 0x2 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldr r1, =0x0202420b - ldrb r0, [r1] - bl dp01_battle_side_mark_buffer_for_execution - ldrb r0, [r7] - strb r0, [r4] - ldrb r0, [r7] - muls r0, r5 - mov r1, r8 - adds r1, 0x2E - adds r0, r1 - str r0, [sp] - movs r0, 0 - movs r1, 0x2 - movs r2, 0 - movs r3, 0x2 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r7] - bl dp01_battle_side_mark_buffer_for_execution - ldrb r0, [r7] - mov r2, r10 - ldr r1, [r2] - lsls r0, 1 - adds r0, r1 - adds r0, 0xC8 - movs r3, 0 - strb r3, [r0] - ldrb r0, [r7] - ldr r1, [r2] - lsls r0, 1 - adds r0, r1 - adds r0, 0xC9 - strb r3, [r0] - ldr r1, =0x0202420b - ldrb r0, [r1] - ldr r1, [r2] - lsls r0, 1 - adds r0, r1 - adds r0, 0xC8 - strb r3, [r0] - ldr r2, =0x0202420b - ldrb r0, [r2] - mov r3, r10 - ldr r1, [r3] - lsls r0, 1 - adds r0, r1 - adds r0, 0xC9 - movs r1, 0 - strb r1, [r0] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - ldr r1, =0x02022f58 - movs r3, 0xFD - strb r3, [r1] - movs r2, 0xA - strb r2, [r1, 0x1] - ldrh r0, [r6] - strb r0, [r1, 0x2] - ldrh r0, [r6] - lsrs r0, 8 - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r1, =0x02022f68 - strb r3, [r1] - strb r2, [r1, 0x1] - mov r2, r9 - strb r2, [r1, 0x2] - mov r3, r9 - lsrs r0, r3, 8 - strb r0, [r1, 0x3] - movs r0, 0x1 - negs r0, r0 - strb r0, [r1, 0x4] - cmp r3, 0 - beq _08055118 - ldrh r0, [r6] - cmp r0, 0 - beq _0805512C - ldr r1, =0x02024332 - movs r0, 0x2 - b _08055130 - .pool -_08055118: - ldrh r0, [r6] - cmp r0, 0 - beq _0805512C - ldr r0, =0x02024332 - movs r1, 0 - strb r1, [r0, 0x5] - b _08055132 - .pool -_0805512C: - ldr r1, =0x02024332 - movs r0, 0x1 -_08055130: - strb r0, [r1, 0x5] -_08055132: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8054EB4 - - thumb_func_start sub_8055148 -sub_8055148: @ 8055148 - push {r4,lr} - ldr r3, =0x02024084 - ldr r4, =0x0202420c - ldrb r0, [r4] - movs r2, 0x58 - muls r0, r2 - adds r0, r3 - adds r0, 0x20 - ldrb r1, [r0] - adds r0, r1, 0 - cmp r0, 0 - beq _0805519C - cmp r0, 0x19 - beq _0805519C - ldr r0, =0x0202420b - ldrb r0, [r0] - muls r0, r2 - adds r0, r3 - adds r0, 0x20 - strb r1, [r0] - ldr r1, =0x0202420a - ldrb r0, [r4] - muls r0, r2 - adds r0, r3 - adds r0, 0x20 - ldrb r0, [r0] - strb r0, [r1] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _080551B6 - .pool -_0805519C: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_080551B6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8055148 - - thumb_func_start atkD4_802C408 -atkD4_802C408: @ 80551C0 - push {r4-r7,lr} - ldr r7, =0x02024214 - ldr r2, [r7] - ldrb r3, [r2, 0x1] - cmp r3, 0 - beq _080551D8 - cmp r3, 0x1 - beq _08055210 - b _0805528C - .pool -_080551D8: - ldr r1, =0x020243d0 - ldr r4, =0x0202420b - adds r0, r1, 0 - adds r0, 0x20 - ldrb r5, [r4] - adds r3, r0, r5 - ldrb r0, [r3] - cmp r0, 0 - bne _0805525C - movs r0, 0x2 - strb r0, [r3] - ldrb r0, [r4] - adds r1, 0x24 - adds r1, r0, r1 - ldr r2, =0x0202406e - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - strb r0, [r1] - ldr r0, [r7] - adds r0, 0x6 - b _0805528A - .pool -_08055210: - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x4 - strb r0, [r1, 0x1] - ldr r4, =0x0202420c - ldrb r0, [r4] - strb r0, [r1, 0x2] - ldr r0, =0x020243d0 - adds r0, 0x24 - ldrb r5, [r4] - adds r0, r5 - ldrb r0, [r0] - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r1, =0x020241f0 - ldr r6, =0x02024084 - ldrb r0, [r4] - movs r5, 0x58 - muls r0, r5 - adds r0, r6 - ldrh r0, [r0, 0x2C] - lsrs r0, 1 - str r0, [r1] - cmp r0, 0 - bne _08055248 - str r3, [r1] -_08055248: - ldr r0, [r1] - negs r0, r0 - str r0, [r1] - ldrb r0, [r4] - muls r0, r5 - adds r0, r6 - ldrh r1, [r0, 0x28] - ldrh r0, [r0, 0x2C] - cmp r1, r0 - bne _08055288 -_0805525C: - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r7] - b _0805528C - .pool -_08055288: - adds r0, r2, 0x6 -_0805528A: - str r0, [r7] -_0805528C: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end atkD4_802C408 - - thumb_func_start sub_8055294 -sub_8055294: @ 8055294 - push {lr} - ldr r1, =0x020242ac - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 2 - adds r2, r0, r1 - ldr r1, [r2] - movs r3, 0x80 - lsls r3, 3 - adds r0, r1, 0 - ands r0, r3 - cmp r0, 0 - beq _080552D8 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _080552E4 - .pool -_080552D8: - orrs r1, r3 - str r1, [r2] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_080552E4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8055294 - - thumb_func_start atkD6_doubledamagedealtifdamaged -atkD6_doubledamagedealtifdamaged: @ 80552EC - push {lr} - ldr r3, =0x0202433c - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r2, r0, 4 - adds r0, r3, 0x4 - adds r0, r2, r0 - ldr r0, [r0] - cmp r0, 0 - beq _0805530C - adds r0, r2, r3 - ldr r1, =0x0202420c - ldrb r0, [r0, 0xC] - ldrb r1, [r1] - cmp r0, r1 - beq _08055324 -_0805530C: - adds r0, r3, 0 - adds r0, 0x8 - adds r0, r2, r0 - ldr r0, [r0] - cmp r0, 0 - beq _0805532A - adds r0, r2, r3 - ldr r1, =0x0202420c - ldrb r0, [r0, 0xD] - ldrb r1, [r1] - cmp r0, r1 - bne _0805532A -_08055324: - ldr r1, =0x02024474 - movs r0, 0x2 - strb r0, [r1, 0xE] -_0805532A: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end atkD6_doubledamagedealtifdamaged - - thumb_func_start sub_805534C -sub_805534C: @ 805534C - push {r4,lr} - ldr r1, =0x020242ac - ldr r0, =0x0202420c - ldrb r3, [r0] - lsls r0, r3, 2 - adds r4, r0, r1 - ldr r2, [r4] - movs r0, 0xC0 - lsls r0, 5 - ands r0, r2 - cmp r0, 0 - bne _08055374 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r3 - adds r1, 0x4C - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080553A0 -_08055374: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _080553B0 - .pool -_080553A0: - movs r0, 0x80 - lsls r0, 5 - orrs r2, r0 - str r2, [r4] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_080553B0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805534C - - thumb_func_start atkD8_setdamagetohealthdifference -atkD8_setdamagetohealthdifference: @ 80553BC - push {lr} - ldr r2, =0x02024084 - ldr r0, =0x0202420c - ldrb r0, [r0] - movs r1, 0x58 - muls r0, r1 - adds r3, r0, r2 - ldr r0, =0x0202420b - ldrb r0, [r0] - muls r0, r1 - adds r1, r0, r2 - ldrh r0, [r3, 0x28] - ldrh r2, [r1, 0x28] - cmp r0, r2 - bhi _08055408 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0805541A - .pool -_08055408: - ldr r2, =0x020241f0 - ldrh r0, [r3, 0x28] - ldrh r1, [r1, 0x28] - subs r0, r1 - str r0, [r2] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_0805541A: - pop {r0} - bx r0 - .pool - thumb_func_end atkD8_setdamagetohealthdifference - - thumb_func_start atkD9_scaledamagebyhealthratio -atkD9_scaledamagebyhealthratio: @ 8055428 - push {r4,lr} - ldr r4, =0x02024400 - ldrh r0, [r4] - cmp r0, 0 - bne _08055464 - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r3, [r0, 0x1] - ldr r2, =0x02024084 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - muls r1, r0 - adds r1, r2 - ldrh r0, [r1, 0x28] - muls r0, r3 - ldrh r1, [r1, 0x2C] - bl __divsi3 - strh r0, [r4] - lsls r0, 16 - cmp r0, 0 - bne _08055464 - movs r0, 0x1 - strh r0, [r4] -_08055464: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atkD9_scaledamagebyhealthratio - - thumb_func_start atkDA_abilityswap -atkDA_abilityswap: @ 805548C - push {r4-r6,lr} - ldr r5, =0x02024084 - ldr r0, =0x0202420b - ldrb r0, [r0] - movs r4, 0x58 - muls r0, r4 - adds r0, r5 - adds r2, r0, 0 - adds r2, 0x20 - ldrb r1, [r2] - cmp r1, 0 - bne _080554B4 - ldr r0, =0x0202420c - ldrb r0, [r0] - muls r0, r4 - adds r0, r5 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0 - beq _080554D4 -_080554B4: - cmp r1, 0x19 - beq _080554D4 - ldr r6, =0x0202420c - ldrb r0, [r6] - muls r0, r4 - adds r0, r5 - adds r0, 0x20 - ldrb r3, [r0] - cmp r3, 0x19 - beq _080554D4 - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _08055504 -_080554D4: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0805551A - .pool -_08055504: - ldrb r1, [r2] - strb r3, [r2] - ldrb r0, [r6] - muls r0, r4 - adds r0, r5 - adds r0, 0x20 - strb r1, [r0] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_0805551A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atkDA_abilityswap - - thumb_func_start atkDB_imprisoneffect -atkDB_imprisoneffect: @ 8055524 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r1, =0x020242ac - ldr r4, =0x0202420b - ldrb r2, [r4] - lsls r0, r2, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 6 - ands r0, r1 - cmp r0, 0 - beq _08055574 - b _080555F6 - .pool -_0805554C: - ldr r0, =0x020242ac - mov r2, r9 - ldrb r1, [r2] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - movs r2, 0x80 - lsls r2, 6 - orrs r0, r2 - str r0, [r1] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _080555EE - .pool -_08055574: - adds r0, r2, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldrb r0, [r4] - bl sub_803F548 - movs r6, 0 - b _080555E6 -_0805558A: - adds r0, r6, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r8, r0 - beq _080555E0 - movs r4, 0 - ldr r7, =0x0202420b - mov r9, r7 - ldr r0, =0x02024084 - mov r12, r0 - mov r1, r9 - ldrb r0, [r1] - mov r2, r12 - adds r2, 0xC - movs r1, 0x58 - muls r0, r1 - adds r3, r0, r2 - adds r5, r6, 0 - muls r5, r1 -_080555B4: - movs r2, 0 - ldrh r1, [r3] - mov r0, r12 - adds r0, 0xC - adds r0, r5, r0 -_080555BE: - ldrh r7, [r0] - cmp r1, r7 - bne _080555C8 - cmp r1, 0 - bne _080555D0 -_080555C8: - adds r0, 0x2 - adds r2, 0x1 - cmp r2, 0x3 - ble _080555BE -_080555D0: - cmp r2, 0x4 - bne _080555DC - adds r3, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - ble _080555B4 -_080555DC: - cmp r4, 0x4 - bne _0805554C -_080555E0: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_080555E6: - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r6, r0 - bcc _0805558A -_080555EE: - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r6, r0 - bne _08055610 -_080555F6: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_08055610: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkDB_imprisoneffect - - thumb_func_start atkDC_setgrudge -atkDC_setgrudge: @ 805562C - push {lr} - ldr r1, =0x020242ac - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 2 - adds r2, r0, r1 - ldr r1, [r2] - movs r3, 0x80 - lsls r3, 7 - adds r0, r1, 0 - ands r0, r3 - cmp r0, 0 - beq _08055670 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0805567C - .pool -_08055670: - orrs r1, r3 - str r1, [r2] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_0805567C: - pop {r0} - bx r0 - .pool - thumb_func_end atkDC_setgrudge - - thumb_func_start atkDD_weightdamagecalculation -atkDD_weightdamagecalculation: @ 8055684 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r5, 0 - ldr r2, =gUnknown_0831C428 - ldrh r0, [r2] - ldr r1, =0x0000ffff - cmp r0, r1 - beq _080556FC - adds r6, r2, 0 - ldr r0, =0x02024084 - mov r8, r0 - adds r7, r1, 0 - adds r4, r6, 0 -_080556A0: - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - add r0, r8 - ldrh r0, [r0] - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - bl sub_80C0630 - ldrh r1, [r4] - lsls r0, 16 - lsrs r0, 16 - cmp r1, r0 - bhi _080556CE - adds r4, 0x4 - adds r5, 0x2 - ldrh r0, [r4] - cmp r0, r7 - bne _080556A0 -_080556CE: - lsls r0, r5, 1 - adds r0, r6 - ldrh r1, [r0] - ldr r0, =0x0000ffff - cmp r1, r0 - beq _080556FC - ldr r0, =0x02024400 - adds r1, r5, 0x1 - lsls r1, 1 - adds r1, r6 - ldrh r1, [r1] - strh r1, [r0] - b _08055702 - .pool -_080556FC: - ldr r1, =0x02024400 - movs r0, 0x78 - strh r0, [r1] -_08055702: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkDD_weightdamagecalculation - - thumb_func_start atkDE_asistattackselect -atkDE_asistattackselect: @ 805571C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - movs r0, 0 - mov r10, r0 - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x18 - str r0, [sp, 0x4] - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_get_per_side_status - movs r1, 0x1 - ands r1, r0 - ldr r0, =0x020244ec - str r0, [sp] - cmp r1, 0 - beq _0805574C - ldr r1, =0x02024744 - str r1, [sp] -_0805574C: - movs r2, 0 -_0805574E: - ldr r1, =0x0202406e - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - adds r1, r2, 0x1 - str r1, [sp, 0x8] - ldrh r0, [r0] - cmp r2, r0 - beq _080557F4 - movs r0, 0x64 - adds r6, r2, 0 - muls r6, r0 - ldr r0, [sp] - adds r4, r0, r6 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - beq _080557F4 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _080557F4 - movs r5, 0 - ldr r1, =0x0000ffff - mov r8, r1 - mov r9, r6 - mov r1, r10 - lsls r0, r1, 1 - ldr r1, [sp, 0x4] - adds r6, r0, r1 -_08055798: - movs r7, 0 - adds r1, r5, 0 - adds r1, 0xD - ldr r0, [sp] - add r0, r9 - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - bl sub_8052F84 - lsls r0, 24 - adds r1, r5, 0x1 - cmp r0, 0 - bne _080557EE - ldr r0, =gUnknown_0831C3E0 - ldrh r2, [r0] - adds r3, r0, 0 - cmp r2, r8 - beq _080557E2 - cmp r4, r2 - beq _080557D8 - ldr r5, =0x0000ffff - adds r2, r3, 0 -_080557CA: - adds r2, 0x2 - adds r7, 0x1 - ldrh r0, [r2] - cmp r0, r5 - beq _080557E2 - cmp r4, r0 - bne _080557CA -_080557D8: - lsls r0, r7, 1 - adds r0, r3 - ldrh r0, [r0] - cmp r0, r8 - bne _080557EE -_080557E2: - cmp r4, 0 - beq _080557EE - strh r4, [r6] - adds r6, 0x2 - movs r0, 0x1 - add r10, r0 -_080557EE: - adds r5, r1, 0 - cmp r5, 0x3 - ble _08055798 -_080557F4: - ldr r2, [sp, 0x8] - cmp r2, 0x5 - ble _0805574E - mov r1, r10 - cmp r1, 0 - beq _0805586C - ldr r2, =0x02024280 - ldr r0, [r2] - ldr r1, =0xfffffbff - ands r0, r1 - str r0, [r2] - ldr r4, =0x020241ee - bl GenerateRandomNumber - movs r1, 0xFF - ands r1, r0 - mov r0, r10 - muls r0, r1 - asrs r0, 8 - lsls r0, 1 - ldr r1, [sp, 0x4] - adds r0, r1 - ldrh r0, [r0] - strh r0, [r4] - ldrh r0, [r4] - movs r1, 0 - bl sub_80458E0 - ldr r1, =0x0202420c - strb r0, [r1] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _08055886 - .pool -_0805586C: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_08055886: - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkDE_asistattackselect - - thumb_func_start atkDF_setmagiccoat -atkDF_setmagiccoat: @ 805589C - push {lr} - ldr r1, =0x0202420c - ldr r3, =0x0202420b - ldrb r0, [r3] - strb r0, [r1] - ldr r2, =0x0202437c - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0] - ldr r0, =0x02024082 - ldrb r1, [r0] - ldr r0, =0x0202406c - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - bne _080558FC - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08055914 - .pool -_080558FC: - ldr r0, =0x0202433c - ldrb r1, [r3] - lsls r1, 4 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x10 - orrs r0, r2 - strb r0, [r1] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_08055914: - pop {r0} - bx r0 - .pool - thumb_func_end atkDF_setmagiccoat - - thumb_func_start atkE0_setstealstatchange -atkE0_setstealstatchange: @ 8055920 - push {lr} - ldr r2, =0x0202437c - ldr r3, =0x0202420b - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0] - ldr r0, =0x02024082 - ldrb r1, [r0] - ldr r0, =0x0202406c - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - bne _08055978 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0805598E - .pool -_08055978: - ldr r0, =0x0202433c - ldrb r1, [r3] - lsls r1, 4 - adds r1, r0 - ldrb r0, [r1] - orrs r0, r2 - strb r0, [r1] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_0805598E: - pop {r0} - bx r0 - .pool - thumb_func_end atkE0_setstealstatchange - - thumb_func_start atkE1_802CBE4 -atkE1_802CBE4: @ 805599C - push {r4-r6,lr} - ldr r4, =0x02024474 - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0xD8 - ldrb r0, [r0] - strb r0, [r4, 0x17] - ldrb r0, [r4, 0x17] - bl battle_side_get_owner - lsls r0, 24 - lsrs r5, r0, 24 - ldr r2, =0x02022f58 - movs r0, 0xFD - strb r0, [r2] - movs r0, 0x9 - strb r0, [r2, 0x1] - ldr r3, =0x02024084 - ldrb r1, [r4, 0x17] - movs r0, 0x58 - muls r0, r1 - adds r0, r3 - adds r0, 0x20 - ldrb r0, [r0] - strb r0, [r2, 0x2] - movs r0, 0xFF - strb r0, [r2, 0x3] - ldr r2, =0x0202420c - ldr r1, =0x0202406c - ldrb r0, [r2] - ldrb r1, [r1] - cmp r0, r1 - bcs _08055A22 - adds r4, r2, 0 - ldr r6, =gUnknown_0832A328 -_080559E2: - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, r5 - beq _08055A04 - ldr r0, =0x02024210 - ldrb r1, [r0] - ldrb r0, [r4] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - ands r1, r0 - ldr r2, =0x0202406c - cmp r1, 0 - beq _08055A18 -_08055A04: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - adds r2, r1, 0 - ldrb r1, [r2] - cmp r0, r1 - bcc _080559E2 -_08055A18: - ldr r0, =0x0202420c - ldrb r0, [r0] - ldrb r2, [r2] - cmp r0, r2 - bcc _08055A64 -_08055A22: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08055A6C - .pool -_08055A64: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_08055A6C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atkE1_802CBE4 - - thumb_func_start atkE2_cmde2 -atkE2_cmde2: @ 8055A78 - push {r4-r6,lr} - sub sp, 0x4 - ldr r5, =0x02024214 - ldr r0, [r5] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r4, =0x02024064 - strb r0, [r4] - ldr r3, =0x02024084 - ldrb r0, [r4] - movs r6, 0x58 - adds r1, r0, 0 - muls r1, r6 - adds r0, r1, r3 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x1E - bne _08055AD2 - adds r3, 0x4C - adds r1, r3 - movs r0, 0 - str r0, [r1] - ldr r2, =gUnknown_0832A328 - ldrb r1, [r4] - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, r1, r0 - adds r0, 0x58 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r2 - ldrb r2, [r0] - adds r0, r1, 0 - muls r0, r6 - adds r0, r3 - str r0, [sp] - movs r0, 0 - movs r1, 0x28 - movs r3, 0x4 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_08055AD2: - ldr r0, [r5] - adds r0, 0x2 - str r0, [r5] - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atkE2_cmde2 - - thumb_func_start atkE3_jumpiffainted -atkE3_jumpiffainted: @ 8055AF4 - push {r4,lr} - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r1, =0x02024064 - strb r0, [r1] - ldr r2, =0x02024084 - ldrb r1, [r1] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _08055B3C - ldr r2, [r4] - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08055B42 - .pool -_08055B3C: - ldr r0, [r4] - adds r0, 0x6 - str r0, [r4] -_08055B42: - pop {r4} - pop {r0} - bx r0 - thumb_func_end atkE3_jumpiffainted - - thumb_func_start sub_8055B48 -sub_8055B48: @ 8055B48 - push {lr} - ldr r0, =0x02022ff0 - ldrb r0, [r0] - cmp r0, 0x7 - bhi _08055BE4 - lsls r0, 2 - ldr r1, =_08055B64 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08055B64: - .4byte _08055B84 - .4byte _08055B90 - .4byte _08055B9C - .4byte _08055BA8 - .4byte _08055BB4 - .4byte _08055BC0 - .4byte _08055BCC - .4byte _08055BD8 -_08055B84: - ldr r1, =0x02024332 - movs r0, 0x2 - b _08055BE8 - .pool -_08055B90: - ldr r1, =0x02024332 - movs r0, 0x1 - b _08055BE8 - .pool -_08055B9C: - ldr r1, =0x02024332 - movs r0, 0x1B - b _08055BE8 - .pool -_08055BA8: - ldr r1, =0x02024332 - movs r0, 0x17 - b _08055BE8 - .pool -_08055BB4: - ldr r1, =0x02024332 - movs r0, 0x16 - b _08055BE8 - .pool -_08055BC0: - ldr r1, =0x02024332 - movs r0, 0x18 - b _08055BE8 - .pool -_08055BCC: - ldr r1, =0x02024332 - movs r0, 0x7 - b _08055BE8 - .pool -_08055BD8: - ldr r1, =0x02024332 - movs r0, 0x8 - b _08055BE8 - .pool -_08055BE4: - ldr r1, =0x02024332 - movs r0, 0x5 -_08055BE8: - strb r0, [r1, 0x3] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8055B48 - - thumb_func_start atkE5_pickupitemcalculation -atkE5_pickupitemcalculation: @ 8055C00 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - bl InBattlePike - lsls r0, 24 - cmp r0, 0 - beq _08055C18 - b _08055DD8 -_08055C18: - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _08055CC4 - movs r6, 0 - mov r7, sp - ldr r0, =gBaseStats - mov r8, r0 -_08055C2A: - movs r0, 0x64 - adds r4, r6, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_getattr - strh r0, [r7] - adds r0, r4, 0 - movs r1, 0x2E - bl pokemon_getattr - cmp r0, 0 - beq _08055C6C - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - add r0, r8 - ldrb r0, [r0, 0x17] - b _08055C76 - .pool -_08055C6C: - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - add r0, r8 - ldrb r0, [r0, 0x16] -_08055C76: - cmp r0, 0x35 - bne _08055CB6 - cmp r5, 0 - beq _08055CB6 - movs r0, 0xCE - lsls r0, 1 - cmp r5, r0 - beq _08055CB6 - ldrh r0, [r7] - cmp r0, 0 - bne _08055CB6 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - bne _08055CB6 - bl CalculateBattlePyramidPickupItemId - strh r0, [r7] - movs r0, 0x64 - muls r0, r6 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xC - mov r2, sp - bl pokemon_setattr -_08055CB6: - adds r6, 0x1 - cmp r6, 0x5 - ble _08055C2A - b _08055DD8 - .pool -_08055CC4: - movs r6, 0 - movs r1, 0x64 - mov r8, r1 - ldr r7, =0x020244ec - mov r10, sp -_08055CCE: - mov r4, r8 - muls r4, r6 - adds r4, r7 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_getattr - mov r1, r10 - strh r0, [r1] - adds r0, r4, 0 - movs r1, 0x2E - bl pokemon_getattr - cmp r0, 0 - beq _08055D30 - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - ldr r1, =gBaseStats - adds r0, r1 - ldrb r0, [r0, 0x17] - b _08055D3C - .pool -_08055D10: - mov r0, r8 - muls r0, r6 - adds r0, r7 - adds r2, r1, 0 - adds r2, 0x63 - subs r2, r4 - lsls r2, 1 - ldr r1, =gRarePickupItems - adds r2, r1 - movs r1, 0xC - bl pokemon_setattr - b _08055DD0 - .pool -_08055D30: - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - ldr r1, =gBaseStats - adds r0, r1 - ldrb r0, [r0, 0x16] -_08055D3C: - adds r1, r6, 0x1 - mov r9, r1 - cmp r0, 0x35 - bne _08055DD0 - cmp r5, 0 - beq _08055DD0 - movs r0, 0xCE - lsls r0, 1 - cmp r5, r0 - beq _08055DD0 - mov r1, r10 - ldrh r0, [r1] - cmp r0, 0 - bne _08055DD0 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - bne _08055DD0 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r4, r0, 16 - mov r0, r8 - muls r0, r6 - adds r0, r7 - movs r1, 0x38 - bl pokemon_getattr - subs r0, 0x1 - movs r1, 0xA - bl __udivsi3 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x9 - bls _08055D9C - movs r1, 0x9 -_08055D9C: - movs r2, 0 - b _08055DAE - .pool -_08055DA4: - adds r0, r4, 0 - subs r0, 0x62 - cmp r0, 0x1 - bls _08055D10 - adds r2, 0x1 -_08055DAE: - cmp r2, 0x8 - bgt _08055DD0 - ldr r0, =gPickupProbabilities - adds r0, r2, r0 - ldrb r0, [r0] - cmp r0, r4 - ble _08055DA4 - mov r0, r8 - muls r0, r6 - adds r0, r7 - adds r2, r1, r2 - lsls r2, 1 - ldr r1, =gPickupItems - adds r2, r1 - movs r1, 0xC - bl pokemon_setattr -_08055DD0: - mov r6, r9 - cmp r6, 0x5 - bgt _08055DD8 - b _08055CCE -_08055DD8: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkE5_pickupitemcalculation - - thumb_func_start atkE6_castform_transform -atkE6_castform_transform: @ 8055DFC - push {r4,lr} - ldr r4, =0x02024064 - ldr r0, =0x02024474 - ldrb r0, [r0, 0x17] - strb r0, [r4] - ldr r1, =0x02024084 - ldrb r2, [r4] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - ldr r3, =0x0202449c - cmp r0, 0 - beq _08055E2C - ldr r0, [r3] - adds r0, 0x7F - ldrb r1, [r0] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0] -_08055E2C: - ldr r0, [r3] - adds r0, 0x7F - ldrb r2, [r0] - movs r0, 0 - movs r1, 0 - bl dp01_build_cmdbuf_x34_a_bb_aka_battle_anim - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atkE6_castform_transform - - thumb_func_start atkE7_castform_switch -atkE7_castform_switch: @ 8055E64 - push {r4,lr} - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - ldr r0, =0x02024474 - ldrb r0, [r0, 0x17] - bl castform_switch - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _08055E8E - ldr r0, =gUnknown_082DB4A9 - bl b_push_move_exec - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x7F - subs r1, r4, 0x1 - strb r1, [r0] -_08055E8E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atkE7_castform_switch - - thumb_func_start atkE8_settypebasedhalvers -atkE8_settypebasedhalvers: @ 8055EA4 - push {r4,lr} - movs r4, 0 - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0xC9 - bne _08055EF4 - ldr r1, =0x020242ac - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 2 - adds r2, r0, r1 - ldr r1, [r2] - movs r3, 0x80 - lsls r3, 9 - adds r0, r1, 0 - ands r0, r3 - cmp r0, 0 - bne _08055F18 - orrs r1, r3 - str r1, [r2] - ldr r0, =0x02024332 - strb r4, [r0, 0x5] - b _08055F1C - .pool -_08055EF4: - ldr r1, =0x020242ac - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 2 - adds r2, r0, r1 - ldr r1, [r2] - movs r3, 0x80 - lsls r3, 10 - adds r0, r1, 0 - ands r0, r3 - cmp r0, 0 - bne _08055F18 - orrs r1, r3 - str r1, [r2] - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] - movs r4, 0x1 -_08055F18: - cmp r4, 0 - beq _08055F38 -_08055F1C: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _08055F52 - .pool -_08055F38: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_08055F52: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atkE8_settypebasedhalvers - - thumb_func_start atkE9_seteffectbyweather -atkE9_seteffectbyweather: @ 8055F5C - push {lr} - sub sp, 0x4 - movs r0, 0 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08055FFC - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0x4D - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - bne _08055FFC - ldr r2, =0x020243cc - ldrb r0, [r2] - cmp r0, 0 - beq _08055F9A - ldr r1, =0x02024474 - movs r0, 0x2 - strb r0, [r1, 0xE] -_08055F9A: - ldrh r1, [r2] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - beq _08055FB8 - ldr r0, =0x0202449c - ldr r1, [r0] - movs r0, 0x8B - b _08055FFA - .pool -_08055FB8: - movs r0, 0x18 - ands r0, r1 - cmp r0, 0 - beq _08055FCC - ldr r0, =0x0202449c - ldr r1, [r0] - movs r0, 0x85 - b _08055FFA - .pool -_08055FCC: - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - beq _08055FE0 - ldr r0, =0x0202449c - ldr r1, [r0] - movs r0, 0x8A - b _08055FFA - .pool -_08055FE0: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08055FF4 - ldr r0, =0x0202449c - ldr r1, [r0] - movs r0, 0x8F - b _08055FFA - .pool -_08055FF4: - ldr r0, =0x0202449c - ldr r1, [r0] - movs r0, 0x80 -_08055FFA: - strb r0, [r1, 0x13] -_08055FFC: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end atkE9_seteffectbyweather - - thumb_func_start atkEA_recycleitem -atkEA_recycleitem: @ 8056014 - push {r4-r7,lr} - sub sp, 0x4 - ldr r7, =0x02024064 - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r7] - ldr r1, =0x0202449c - ldrb r2, [r7] - lsls r0, r2, 1 - adds r0, 0xB8 - ldr r1, [r1] - adds r6, r1, r0 - ldrh r5, [r6] - cmp r5, 0 - beq _08056094 - ldr r4, =0x02024084 - movs r3, 0x58 - adds r0, r2, 0 - muls r0, r3 - adds r0, r4 - ldrh r0, [r0, 0x2E] - cmp r0, 0 - bne _08056094 - ldr r1, =0x02024208 - strh r5, [r1] - strh r0, [r6] - ldrb r0, [r7] - muls r0, r3 - adds r0, r4 - ldrh r1, [r1] - strh r1, [r0, 0x2E] - ldrb r0, [r7] - muls r0, r3 - adds r1, r4, 0 - adds r1, 0x2E - adds r0, r1 - str r0, [sp] - movs r0, 0 - movs r1, 0x2 - movs r2, 0 - movs r3, 0x2 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r7] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _080560AE - .pool -_08056094: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_080560AE: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkEA_recycleitem - - thumb_func_start atkEB_settypetoterrain -atkEB_settypetoterrain: @ 80560BC - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =0x02024084 - mov r8, r0 - ldr r7, =0x0202420b - ldrb r0, [r7] - movs r6, 0x58 - muls r0, r6 - mov r1, r8 - adds r3, r0, r1 - movs r0, 0x21 - adds r0, r3 - mov r12, r0 - ldr r5, =gUnknown_0831C483 - ldr r4, =0x02022ff0 - ldrb r0, [r4] - adds r0, r5 - ldrb r2, [r0] - mov r1, r12 - ldrb r0, [r1] - adds r1, r2, 0 - cmp r0, r1 - beq _08056144 - adds r0, r3, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, r1 - beq _08056144 - mov r0, r12 - strb r2, [r0] - ldrb r0, [r7] - adds r1, r0, 0 - muls r1, r6 - add r1, r8 - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - adds r1, 0x22 - strb r0, [r1] - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x3 - strb r0, [r1, 0x1] - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - strb r0, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x3] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _0805615E - .pool -_08056144: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_0805615E: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkEB_settypetoterrain - - thumb_func_start atkEC_802D2A0 -atkEC_802D2A0: @ 805616C - push {r4-r6,lr} - ldr r5, =0x0202420b - ldrb r0, [r5] - bl battle_get_per_side_status - movs r1, 0x2 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - ldr r4, =0x02024064 - strb r0, [r4] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r6, 0x1 - ands r0, r6 - cmp r0, 0 - beq _0805620C - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - ldrb r3, [r4] - lsls r0, r3, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0805620C - ldr r0, =0x0202421c - adds r0, r3, r0 - ldrb r0, [r0] - cmp r0, 0 - bne _0805620C - ldr r1, =0x02024274 - lsls r0, r3, 1 - adds r0, r1 - ldrh r2, [r0] - cmp r2, 0xE4 - bne _0805620C - ldr r0, =0x0202407a - adds r0, r3, r0 - movs r1, 0xB - strb r1, [r0] - ldr r0, =0x020241ea - strh r2, [r0] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - ldr r0, =0x02024474 - strb r6, [r0, 0x18] - ldrb r1, [r5] - adds r0, 0x20 - strb r1, [r0] - ldrb r0, [r4] - strb r0, [r5] - b _08056226 - .pool -_0805620C: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_08056226: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atkEC_802D2A0 - - thumb_func_start atkED_802D364 -atkED_802D364: @ 8056230 - push {r4,lr} - ldr r1, =0x0202420e - ldr r3, =0x0202420b - ldrb r0, [r3] - strb r0, [r1] - ldr r2, =0x0202420c - lsls r0, 24 - lsrs r0, 24 - adds r4, r1, 0 - ldrb r1, [r2] - cmp r0, r1 - bne _08056264 - ldr r1, =0x02024474 - ldrb r0, [r1, 0x17] - strb r0, [r2] - strb r0, [r3] - b _0805626A - .pool -_08056264: - ldr r1, =0x02024474 - ldrb r0, [r1, 0x17] - strb r0, [r2] -_0805626A: - ldrb r0, [r4] - strb r0, [r1, 0x17] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atkED_802D364 - - thumb_func_start atkEE_removereflectlightscreen -atkEE_removereflectlightscreen: @ 8056284 - push {r4,lr} - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_side_get_owner - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02024294 - lsls r3, r0, 1 - adds r0, r3, r0 - lsls r0, 2 - adds r4, r0, r1 - ldrb r0, [r4] - cmp r0, 0 - bne _080562AC - ldrb r1, [r4, 0x2] - cmp r1, 0 - beq _080562E4 -_080562AC: - ldr r2, =0x0202428e - adds r2, r3, r2 - ldrh r1, [r2] - ldr r0, =0x0000fffe - ands r0, r1 - movs r3, 0 - ldr r1, =0x0000fffd - ands r0, r1 - strh r0, [r2] - strb r3, [r4] - strb r3, [r4, 0x2] - ldr r1, =0x02024474 - movs r0, 0x1 - strb r0, [r1, 0x18] - strb r0, [r1, 0x19] - b _080562EA - .pool -_080562E4: - ldr r0, =0x02024474 - strb r1, [r0, 0x18] - strb r1, [r0, 0x19] -_080562EA: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atkEE_removereflectlightscreen - - thumb_func_start sub_8056300 -sub_8056300: @ 8056300 - push {r4-r6,lr} - movs r4, 0 - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - beq _0805630E - b _08056696 -_0805630E: - ldr r5, =0x02024064 - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r5] - ldr r6, =0x0202420c - movs r1, 0x1 - eors r0, r1 - strb r0, [r6] - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0805635C - movs r0, 0 - movs r1, 0x5 - bl dp01_build_cmdbuf_x0D_a - ldrb r0, [r5] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DBE02 - b _08056694 - .pool -_0805635C: - movs r0, 0x80 - lsls r0, 2 - ands r1, r0 - cmp r1, 0 - beq _08056384 - movs r0, 0 - movs r1, 0x4 - bl dp01_build_cmdbuf_x0D_a - ldrb r0, [r5] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DBDCA - b _08056694 - .pool -_08056384: - ldr r0, =0x02024208 - ldrh r0, [r0] - cmp r0, 0x5 - bne _080563B0 - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x7C - ldrb r0, [r0] - lsls r1, r0, 2 - adds r1, r0 - lsls r0, r1, 8 - subs r0, r1 - movs r1, 0x64 - bl __divsi3 - lsls r0, 24 - lsrs r5, r0, 24 - b _080563C8 - .pool -_080563B0: - ldr r3, =gBaseStats - ldr r2, =0x02024084 - ldrb r1, [r6] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r5, [r0, 0x8] -_080563C8: - ldr r2, =0x02024208 - ldrh r0, [r2] - cmp r0, 0x5 - bhi _080563D2 - b _080564C8 -_080563D2: - subs r0, 0x6 - cmp r0, 0x6 - bls _080563DA - b _080564D2 -_080563DA: - lsls r0, 2 - ldr r1, =_080563F4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080563F4: - .4byte _08056410 - .4byte _08056440 - .4byte _08056452 - .4byte _08056480 - .4byte _080564B0 - .4byte _08056472 - .4byte _08056472 -_08056410: - ldr r2, =0x02024084 - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r1, r0, 0 - adds r1, 0x21 - ldrb r1, [r1] - cmp r1, 0xB - beq _080564A4 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0xB - beq _080564A4 - cmp r1, 0x6 - beq _080564A4 - cmp r0, 0x6 - beq _080564A4 - b _08056472 - .pool -_08056440: - bl sav1_map_get_light_level - lsls r0, 24 - lsrs r0, 24 - movs r4, 0xA - cmp r0, 0x5 - bne _080564D2 - movs r4, 0x23 - b _080564D2 -_08056452: - ldr r2, =0x02024084 - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x2A - ldrb r1, [r0] - cmp r1, 0x27 - bhi _08056472 - movs r0, 0x28 - subs r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x9 - bhi _080564D2 -_08056472: - movs r4, 0xA - b _080564D2 - .pool -_08056480: - ldr r2, =0x02024084 - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r0, [r0] - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - bl pokedex_flag_operation - lsls r0, 24 - movs r4, 0xA - cmp r0, 0 - beq _080564D2 -_080564A4: - movs r4, 0x1E - b _080564D2 - .pool -_080564B0: - ldr r0, =0x03005d10 - ldrb r0, [r0, 0x13] - adds r0, 0xA - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x28 - bls _080564D2 - movs r4, 0x28 - b _080564D2 - .pool -_080564C8: - ldr r1, =gUnknown_0831C48D - ldrh r0, [r2] - subs r0, 0x2 - adds r0, r1 - ldrb r4, [r0] -_080564D2: - adds r0, r5, 0 - muls r0, r4 - movs r1, 0xA - bl __divsi3 - ldr r5, =0x02024084 - ldr r1, =0x0202420c - ldrb r2, [r1] - movs r1, 0x58 - adds r4, r2, 0 - muls r4, r1 - adds r3, r4, r5 - ldrh r2, [r3, 0x2C] - lsls r1, r2, 1 - adds r1, r2 - ldrh r2, [r3, 0x28] - lsls r2, 1 - subs r2, r1, r2 - muls r0, r2 - bl __divsi3 - adds r6, r0, 0 - adds r5, 0x4C - adds r4, r5 - ldr r4, [r4] - movs r0, 0x27 - ands r0, r4 - cmp r0, 0 - beq _0805650E - lsls r6, 1 -_0805650E: - movs r0, 0xD8 - ands r4, r0 - cmp r4, 0 - beq _08056522 - lsls r0, r6, 4 - subs r0, r6 - movs r1, 0xA - bl __udivsi3 - adds r6, r0, 0 -_08056522: - ldr r1, =0x02024208 - ldrh r0, [r1] - cmp r0, 0x5 - beq _08056564 - cmp r0, 0x1 - bne _08056550 - ldr r0, =0x03005d10 - ldrb r1, [r0, 0x5] - movs r2, 0x2 - orrs r1, r2 - strb r1, [r0, 0x5] - b _08056564 - .pool -_08056550: - ldr r0, =0x03005d10 - ldrh r1, [r1] - adds r0, r1 - adds r1, r0, 0 - adds r1, 0x34 - ldrb r0, [r1] - cmp r0, 0xFE - bhi _08056564 - adds r0, 0x1 - strb r0, [r1] -_08056564: - cmp r6, 0xFE - bls _080565C8 - movs r0, 0 - movs r1, 0x4 - bl dp01_build_cmdbuf_x0D_a - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DBD84 - str r0, [r1] - ldr r1, =0x0202406e - ldr r0, =0x0202420c - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - ldr r2, =0x02024208 - movs r1, 0x26 - bl pokemon_setattr - bl calc_player_party_count - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x6 - beq _08056656 - b _08056680 - .pool -_080565C8: - movs r0, 0xFF - lsls r0, 16 - adds r1, r6, 0 - bl __udivsi3 - bl Sqrt - lsls r0, 16 - lsrs r0, 16 - bl Sqrt - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =0x000ffff0 - adds r1, r6, 0 - bl __udivsi3 - adds r6, r0, 0 - movs r4, 0 - b _080565FA - .pool -_080565F4: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_080565FA: - cmp r4, 0x3 - bhi _0805660A - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - cmp r0, r6 - bcc _080565F4 -_0805660A: - ldr r5, =0x02024208 - ldrh r0, [r5] - cmp r0, 0x1 - bne _08056614 - movs r4, 0x4 -_08056614: - movs r0, 0 - adds r1, r4, 0 - bl dp01_build_cmdbuf_x0D_a - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution - cmp r4, 0x4 - bne _0805668C - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DBD84 - str r0, [r1] - ldr r1, =0x0202406e - ldr r0, =0x0202420c - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x26 - adds r2, r5, 0 - bl pokemon_setattr - bl calc_player_party_count - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x6 - bne _08056680 -_08056656: - ldr r1, =0x02024332 - movs r0, 0 - strb r0, [r1, 0x5] - b _08056696 - .pool -_08056680: - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] - b _08056696 - .pool -_0805668C: - ldr r0, =0x02024332 - strb r4, [r0, 0x5] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DBDD4 -_08056694: - str r0, [r1] -_08056696: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8056300 - - thumb_func_start atkF0_catch_pokemon -atkF0_catch_pokemon: @ 80566A8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =0x0202406e - mov r9, r0 - ldr r5, =0x0202420b - ldrb r0, [r5] - movs r6, 0x1 - eors r0, r6 - lsls r0, 1 - add r0, r9 - ldrh r0, [r0] - movs r7, 0x64 - muls r0, r7 - ldr r1, =0x02024744 - mov r8, r1 - add r0, r8 - bl pokemon_catch - lsls r0, 24 - cmp r0, 0 - beq _08056792 - bl sub_813B21C - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _08056734 - ldr r0, =0x02024332 - strb r1, [r0, 0x5] - ldr r4, =0x02021cc4 - ldr r0, =0x00004036 - bl VarGet - lsls r0, 24 - lsrs r0, 24 - bl sav3_get_box_name - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - ldrb r0, [r5] - eors r0, r6 - lsls r0, 1 - add r0, r9 - ldrh r0, [r0] - muls r0, r7 - add r0, r8 - ldr r2, =0x02021dc4 - movs r1, 0x2 - bl pokemon_getattr - b _0805677E - .pool -_08056734: - ldr r4, =0x02021cc4 - ldr r0, =0x00004036 - bl VarGet - lsls r0, 24 - lsrs r0, 24 - bl sav3_get_box_name - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - ldrb r0, [r5] - eors r0, r6 - lsls r0, 1 - add r0, r9 - ldrh r0, [r0] - muls r0, r7 - add r0, r8 - ldr r2, =0x02021dc4 - movs r1, 0x2 - bl pokemon_getattr - ldr r4, =0x02021ec4 - bl get_unknown_box_id - lsls r0, 24 - lsrs r0, 24 - bl sav3_get_box_name - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - ldr r1, =0x02024332 - movs r0, 0x2 - strb r0, [r1, 0x5] -_0805677E: - ldr r0, =0x000008ab - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _08056792 - ldr r1, =0x02024332 - ldrb r0, [r1, 0x5] - adds r0, 0x1 - strb r0, [r1, 0x5] -_08056792: - ldr r0, =0x0202406e - mov r10, r0 - ldr r1, =0x0202420b - mov r9, r1 - ldrb r0, [r1] - movs r4, 0x1 - eors r0, r4 - lsls r0, 1 - add r0, r10 - ldrh r0, [r0] - movs r1, 0x64 - mov r8, r1 - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - ldr r6, =0x02024744 - adds r0, r6 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - ldr r5, =0x03005d10 - strh r0, [r5, 0x28] - mov r1, r9 - ldrb r0, [r1] - eors r0, r4 - lsls r0, 1 - add r0, r10 - ldrh r0, [r0] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r6 - adds r2, r5, 0 - adds r2, 0x2A - movs r1, 0x2 - bl pokemon_getattr - mov r1, r9 - ldrb r0, [r1] - eors r4, r0 - lsls r4, 1 - add r4, r10 - ldrh r0, [r4] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r6 - movs r1, 0x26 - movs r2, 0 - bl pokemon_getattr - movs r1, 0xF - ands r0, r1 - lsls r0, 2 - ldrb r2, [r5, 0x5] - movs r1, 0x3D - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r5, 0x5] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkF0_catch_pokemon - - thumb_func_start atkF1_802D95C -atkF1_802D95C: @ 8056850 - push {r4,r5,lr} - ldr r4, =0x02024744 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - adds r0, r5, 0 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - bl pokedex_flag_operation - lsls r0, 24 - cmp r0, 0 - beq _080568A8 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _080568C2 - .pool -_080568A8: - adds r0, r5, 0 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - adds r2, r4, 0 - bl SetPokedexFlag - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_080568C2: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atkF1_802D95C - - thumb_func_start sub_80568CC -sub_80568CC: @ 80568CC - push {r4,lr} - sub sp, 0x4 - ldr r0, =0x02024744 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x02024332 - ldrb r0, [r0] - cmp r0, 0x5 - bls _080568E8 - b _08056A2C -_080568E8: - lsls r0, 2 - ldr r1, =_08056900 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08056900: - .4byte _08056918 - .4byte _0805692A - .4byte _08056978 - .4byte _080569C8 - .4byte _080569E0 - .4byte _08056A18 -_08056918: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - b _08056A06 -_0805692A: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08056938 - b _08056A2C -_08056938: - bl FreeAllWindowBuffers - adds r0, r4, 0 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - ldr r3, =0x02024084 - ldr r1, =0x0202420c - ldrb r2, [r1] - movs r1, 0x58 - muls r2, r1 - adds r1, r3, 0 - adds r1, 0x54 - adds r1, r2, r1 - ldr r1, [r1] - adds r3, 0x48 - adds r2, r3 - ldr r2, [r2] - bl sub_80BFDF4 - ldr r1, =0x02024332 - strb r0, [r1, 0x1] - b _08056A08 - .pool -_08056978: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08056A2C - ldr r0, =0x030022c0 - ldr r1, [r0, 0x4] - ldr r0, =sub_8038420 - cmp r1, r0 - bne _08056A2C - ldr r2, =0x03005e00 - ldr r4, =0x02024332 - ldrb r1, [r4, 0x1] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x4] - cmp r0, 0 - bne _08056A2C - ldr r0, =vblank_cb_08078BB4 - bl SetVBlankCallback - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _08056A2C - .pool -_080569C8: - bl c2_berry_program_update_menu - bl sub_8035AA4 - ldr r1, =0x02022e20 - movs r2, 0x80 - lsls r2, 1 - adds r0, r2, 0 - strh r0, [r1] - b _08056A06 - .pool -_080569E0: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _08056A2C - ldr r0, =0x0000ffff - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - movs r0, 0 - bl ShowBg - movs r0, 0x3 - bl ShowBg -_08056A06: - ldr r1, =0x02024332 -_08056A08: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08056A2C - .pool -_08056A18: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08056A2C - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] -_08056A2C: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80568CC - - thumb_func_start sub_8056A3C -sub_8056A3C: @ 8056A3C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - ldr r4, [sp, 0x40] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x10] - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x1C] - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x14] - lsls r4, 24 - lsrs r4, 24 - mov r10, r4 - movs r1, 0 - add r0, sp, 0xC - strh r1, [r0] - ldr r6, [sp, 0x10] - cmp r6, r3 - ble _08056A76 - b _08056B62 -_08056A76: - mov r4, r8 - adds r0, r6, 0x1 - str r0, [sp, 0x18] - ldr r2, [sp, 0x1C] - cmp r4, r2 - bgt _08056B58 - add r5, sp, 0xC - lsls r7, r6, 24 - mov r9, r7 -_08056A88: - ldr r0, [sp, 0x10] - cmp r6, r0 - bne _08056AB4 - cmp r4, r8 - bne _08056A9C - ldr r0, =0x00001022 - b _08056AFE - .pool -_08056A9C: - ldr r2, [sp, 0x1C] - cmp r4, r2 - bne _08056AAC - ldr r0, =0x00001024 - b _08056AFE - .pool -_08056AAC: - ldr r0, =0x00001023 - b _08056AFE - .pool -_08056AB4: - ldr r7, [sp, 0x14] - cmp r6, r7 - bne _08056AE0 - cmp r4, r8 - bne _08056AC8 - ldr r0, =0x00001028 - b _08056AFE - .pool -_08056AC8: - ldr r0, [sp, 0x1C] - cmp r4, r0 - bne _08056AD8 - ldr r0, =0x0000102a - b _08056AFE - .pool -_08056AD8: - ldr r0, =0x00001029 - b _08056AFE - .pool -_08056AE0: - cmp r4, r8 - bne _08056AEC - ldr r0, =0x00001025 - b _08056AFE - .pool -_08056AEC: - ldr r2, [sp, 0x1C] - cmp r4, r2 - bne _08056AFC - ldr r0, =0x00001027 - b _08056AFE - .pool -_08056AFC: - ldr r0, =0x00001026 -_08056AFE: - strh r0, [r5] - movs r1, 0x1 - mov r0, r10 - ands r0, r1 - cmp r0, 0 - beq _08056B0E - movs r0, 0 - strh r0, [r5] -_08056B0E: - movs r0, 0x80 - mov r7, r10 - ands r0, r7 - cmp r0, 0 - beq _08056B38 - lsls r2, r4, 24 - lsrs r2, 24 - str r1, [sp] - str r1, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - add r1, sp, 0xC - mov r7, r9 - lsrs r3, r7, 24 - bl CopyToBgTilemapBufferRect_ChangePalette - b _08056B50 - .pool -_08056B38: - lsls r2, r4, 24 - lsrs r2, 24 - str r1, [sp] - str r1, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0 - add r1, sp, 0xC - mov r7, r9 - lsrs r3, r7, 24 - bl CopyToBgTilemapBufferRect_ChangePalette -_08056B50: - adds r4, 0x1 - ldr r0, [sp, 0x1C] - cmp r4, r0 - ble _08056A88 -_08056B58: - ldr r6, [sp, 0x18] - ldr r2, [sp, 0x14] - cmp r6, r2 - bgt _08056B62 - b _08056A76 -_08056B62: - 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_8056A3C - - thumb_func_start sub_8056B74 -sub_8056B74: @ 8056B74 - push {lr} - sub sp, 0x10 - adds r3, r0, 0 - add r0, sp, 0xC - movs r2, 0x1 - strh r2, [r0] - movs r1, 0x2 - strh r1, [r0, 0x2] - lsls r3, 25 - movs r0, 0x90 - lsls r0, 20 - adds r3, r0 - lsrs r3, 24 - str r2, [sp] - str r1, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0 - add r1, sp, 0xC - movs r2, 0x19 - bl CopyToBgTilemapBufferRect_ChangePalette - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0x10 - pop {r0} - bx r0 - thumb_func_end sub_8056B74 - - thumb_func_start sub_8056BAC -sub_8056BAC: @ 8056BAC - push {lr} - sub sp, 0x10 - adds r3, r0, 0 - add r0, sp, 0xC - ldr r1, =0x00001016 - strh r1, [r0] - strh r1, [r0, 0x2] - lsls r3, 25 - movs r0, 0x90 - lsls r0, 20 - adds r3, r0 - lsrs r3, 24 - movs r0, 0x1 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0 - add r1, sp, 0xC - movs r2, 0x19 - bl CopyToBgTilemapBufferRect_ChangePalette - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0x10 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8056BAC - - thumb_func_start atkF3_receive_new_pokemon_maybe -atkF3_receive_new_pokemon_maybe: @ 8056BEC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - ldr r0, =0x02024332 - ldrb r1, [r0] - adds r4, r0, 0 - cmp r1, 0x4 - bls _08056C04 - b _08056E62 -_08056C04: - lsls r0, r1, 2 - ldr r1, =_08056C18 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08056C18: - .4byte _08056C2C - .4byte _08056C60 - .4byte _08056CFC - .4byte _08056DD4 - .4byte _08056E2C -_08056C2C: - movs r4, 0 - str r4, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - ldr r0, =gUnknown_085CCABB - movs r1, 0xC - bl battle_show_message_maybe - ldr r1, =0x02024332 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - strb r4, [r1, 0x1] - movs r0, 0 - bl sub_8056B74 - b _08056E62 - .pool -_08056C60: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08056C86 - ldrb r0, [r4, 0x1] - cmp r0, 0 - beq _08056C86 - movs r0, 0x5 - bl audio_play - ldrb r0, [r4, 0x1] - bl sub_8056BAC - movs r0, 0 - strb r0, [r4, 0x1] - bl sub_8056B74 -_08056C86: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08056CAE - ldr r4, =0x02024332 - ldrb r0, [r4, 0x1] - cmp r0, 0 - bne _08056CAE - movs r0, 0x5 - bl audio_play - ldrb r0, [r4, 0x1] - bl sub_8056BAC - movs r0, 0x1 - strb r0, [r4, 0x1] - bl sub_8056B74 -_08056CAE: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08056CE0 - movs r0, 0x5 - bl audio_play - ldr r1, =0x02024332 - ldrb r0, [r1, 0x1] - cmp r0, 0 - bne _08056CF2 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r0, 0x3 - bl sub_80A2390 - b _08056E62 - .pool -_08056CE0: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08056CEA - b _08056E62 -_08056CEA: - movs r0, 0x5 - bl audio_play - ldr r1, =0x02024332 -_08056CF2: - movs r0, 0x4 - strb r0, [r1] - b _08056E62 - .pool -_08056CFC: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08056D0A - b _08056E62 -_08056D0A: - ldr r7, =0x0202406e - ldr r0, =0x0202420b - mov r10, r0 - ldrb r0, [r0] - movs r4, 0x1 - eors r0, r4 - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - movs r1, 0x64 - mov r9, r1 - mov r2, r9 - muls r2, r0 - adds r0, r2, 0 - ldr r1, =0x02024744 - mov r8, r1 - add r0, r8 - ldr r1, =0x0202449c - ldr r2, [r1] - adds r2, 0x6D - movs r1, 0x2 - bl pokemon_getattr - bl FreeAllWindowBuffers - mov r2, r10 - ldrb r0, [r2] - eors r0, r4 - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - mov r1, r9 - muls r1, r0 - adds r0, r1, 0 - add r0, r8 - movs r1, 0xB - bl pokemon_getattr - adds r6, r0, 0 - lsls r6, 16 - lsrs r6, 16 - mov r2, r10 - ldrb r0, [r2] - eors r0, r4 - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - mov r1, r9 - muls r1, r0 - adds r0, r1, 0 - add r0, r8 - bl pokemon_get_gender - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - mov r2, r10 - ldrb r0, [r2] - eors r4, r0 - lsls r4, 1 - adds r4, r7 - ldrh r0, [r4] - mov r1, r9 - muls r1, r0 - adds r0, r1, 0 - add r0, r8 - movs r1, 0 - movs r2, 0 - bl pokemon_getattr - ldr r2, =0x0202449c - ldr r1, [r2] - adds r1, 0x6D - str r0, [sp] - ldr r0, =sub_8038420 - str r0, [sp, 0x4] - movs r0, 0x2 - adds r2, r6, 0 - adds r3, r5, 0 - bl do_choose_name_or_words_screen - ldr r1, =0x02024332 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08056E62 - .pool -_08056DD4: - ldr r0, =0x030022c0 - ldr r1, [r0, 0x4] - ldr r0, =sub_8038420 - cmp r1, r0 - bne _08056E62 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08056E62 - ldr r2, =0x0202406e - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x1 - eors r0, r1 - lsls r0, 1 - adds r0, r2 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - ldr r1, =0x0202449c - ldr r2, [r1] - adds r2, 0x6D - movs r1, 0x2 - bl pokemon_setattr - b _08056E48 - .pool -_08056E2C: - bl calc_player_party_count - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x6 - bne _08056E48 - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _08056E62 - .pool -_08056E48: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_08056E62: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkF3_receive_new_pokemon_maybe - - thumb_func_start sub_8056E78 -sub_8056E78: @ 8056E78 - ldr r2, =0x02024084 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - muls r1, r0 - adds r1, r2 - ldr r0, =0x020241f0 - ldr r2, [r0] - ldrh r0, [r1, 0x28] - subs r0, r2 - strh r0, [r1, 0x28] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_8056E78 - - thumb_func_start atkF5_reset_attacker_bd_x4C -atkF5_reset_attacker_bd_x4C: @ 8056EA8 - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x4C - adds r0, r1 - movs r1, 0 - str r1, [r0] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end atkF5_reset_attacker_bd_x4C - - thumb_func_start sub_8056ED0 -sub_8056ED0: @ 8056ED0 - ldr r1, =0x02024083 - movs r0, 0xC - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_8056ED0 - - thumb_func_start sub_8056EDC -sub_8056EDC: @ 8056EDC - ldr r1, =0x02024083 - movs r0, 0xC - strb r0, [r1] - ldr r1, =0x02024082 - ldr r0, =0x0202406c - ldrb r0, [r0] - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_8056EDC - - thumb_func_start sub_8056EF8 -sub_8056EF8: @ 8056EF8 - push {r4,r5,lr} - ldr r5, =0x02024214 - ldr r0, [r5] - ldrb r0, [r0, 0x1] - bl battle_get_side_with_given_state - ldr r4, =0x02024064 - strb r0, [r4] - movs r0, 0 - bl dp01_build_cmdbuf_x09_9_9_9 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r5] - adds r0, 0x2 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8056EF8 - - thumb_func_start sub_8056F28 -sub_8056F28: @ 8056F28 - push {r4-r6,lr} - ldr r5, =0x020244a8 - ldr r6, =0x02022fec - ldr r0, [r6] - movs r1, 0x80 - lsls r1, 19 - ands r0, r1 - cmp r0, 0 - beq _08056F3E - bl sub_81D55D0 -_08056F3E: - ldr r4, =0x0202449c - movs r0, 0xA9 - lsls r0, 2 - bl AllocZeroed - str r0, [r4] - movs r0, 0x20 - bl AllocZeroed - str r0, [r5] - movs r0, 0xA0 - bl AllocZeroed - ldr r1, [r5] - str r0, [r1] - movs r0, 0x10 - bl AllocZeroed - ldr r1, [r5] - str r0, [r1, 0x4] - movs r0, 0x24 - bl AllocZeroed - ldr r1, [r5] - str r0, [r1, 0x8] - movs r0, 0x24 - bl AllocZeroed - ldr r1, [r5] - str r0, [r1, 0xC] - movs r0, 0xC - bl AllocZeroed - ldr r1, [r5] - str r0, [r1, 0x10] - movs r0, 0x1C - bl AllocZeroed - ldr r1, [r5] - str r0, [r1, 0x14] - movs r0, 0x54 - bl AllocZeroed - ldr r1, [r5] - str r0, [r1, 0x18] - movs r0, 0x24 - bl AllocZeroed - ldr r1, [r5] - str r0, [r1, 0x1C] - ldr r4, =0x020244a0 - movs r5, 0x80 - lsls r5, 5 - adds r0, r5, 0 - bl AllocZeroed - str r0, [r4] - ldr r4, =0x020244a4 - adds r0, r5, 0 - bl AllocZeroed - str r0, [r4] - ldr r4, =0x0202305c - movs r0, 0x80 - lsls r0, 6 - bl AllocZeroed - str r0, [r4] - ldr r4, =0x02023060 - adds r0, r5, 0 - bl AllocZeroed - str r0, [r4] - ldr r0, [r6] - movs r1, 0x80 - lsls r1, 20 - ands r0, r1 - cmp r0, 0 - beq _08056FFA - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - ldr r2, =0x03005d8c - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 5 - ldr r0, =0x00001a9c - adds r1, r0 - ldr r0, [r2] - adds r0, r1 - bl create_enemy_party -_08056FFA: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8056F28 - - thumb_func_start sub_8057028 -sub_8057028: @ 8057028 - push {r4-r6,lr} - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 19 - ands r0, r1 - cmp r0, 0 - beq _0805703C - bl sub_81D5694 -_0805703C: - ldr r6, =0x020244a8 - ldr r0, [r6] - cmp r0, 0 - beq _080570D0 - ldr r4, =0x0202449c - ldr r0, [r4] - bl Free - movs r5, 0 - str r5, [r4] - ldr r0, [r6] - ldr r0, [r0] - bl Free - ldr r0, [r6] - str r5, [r0] - ldr r0, [r0, 0x4] - bl Free - ldr r0, [r6] - str r5, [r0, 0x4] - ldr r0, [r0, 0x8] - bl Free - ldr r0, [r6] - str r5, [r0, 0x8] - ldr r0, [r0, 0xC] - bl Free - ldr r0, [r6] - str r5, [r0, 0xC] - ldr r0, [r0, 0x10] - bl Free - ldr r0, [r6] - str r5, [r0, 0x10] - ldr r0, [r0, 0x14] - bl Free - ldr r0, [r6] - str r5, [r0, 0x14] - ldr r0, [r0, 0x18] - bl Free - ldr r0, [r6] - str r5, [r0, 0x18] - ldr r0, [r0, 0x1C] - bl Free - ldr r0, [r6] - str r5, [r0, 0x1C] - bl Free - str r5, [r6] - ldr r4, =0x020244a0 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x020244a4 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0202305c - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x02023060 - ldr r0, [r4] - bl Free - str r5, [r4] -_080570D0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8057028 - - thumb_func_start sub_80570F4 -sub_80570F4: @ 80570F4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08057140 - movs r0, 0x1 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x3 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =0x02024084 - movs r0, 0x58 - adds r1, r3, 0 - muls r1, r0 - adds r1, r2 - adds r1, 0x2A - muls r0, r4 - adds r0, r2 - adds r0, 0x2A - ldrb r1, [r1] - ldrb r0, [r0] - cmp r1, r0 - bls _0805714A - adds r4, r3, 0 - b _0805714A - .pool -_08057140: - movs r0, 0x1 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r4, r0, 24 -_0805714A: - ldr r2, =0x02024084 - movs r1, 0x58 - adds r0, r4, 0 - muls r0, r1 - adds r0, r2 - adds r3, r0, 0 - adds r3, 0x2A - adds r0, r5, 0 - muls r0, r1 - adds r0, r2 - adds r1, r0, 0 - adds r1, 0x2A - ldrb r0, [r3] - ldrb r2, [r1] - cmp r0, r2 - bls _080571B8 - ldrb r1, [r1] - subs r0, r1 - cmp r0, 0x1D - ble _08057198 - ldr r1, =0x0202406e - lsls r0, r5, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x8 - bl happiness_algorithm - b _080571CE - .pool -_08057198: - ldr r1, =0x0202406e - lsls r0, r5, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x6 - bl happiness_algorithm - b _080571CE - .pool -_080571B8: - ldr r1, =0x0202406e - lsls r0, r5, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x6 - bl happiness_algorithm -_080571CE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80570F4 - - thumb_func_start sub_80571DC -sub_80571DC: @ 80571DC - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08057248 - movs r2, 0 - ldr r6, =0x0202406e - lsls r3, r4, 1 - ldr r5, =0x0203cf00 - ldr r4, =0x0202449c -_080571FE: - adds r0, r2, r5 - ldr r1, [r4] - adds r1, r2, r1 - adds r1, 0x60 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x2 - ble _080571FE - adds r0, r3, r6 - ldrb r0, [r0] - bl pokemon_order_func - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r7, 0 - bl pokemon_order_func - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_81B8FB0 - movs r2, 0 - ldr r4, =0x0202449c - ldr r3, =0x0203cf00 -_08057236: - ldr r0, [r4] - adds r0, r2, r0 - adds r0, 0x60 - adds r1, r2, r3 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x2 - ble _08057236 -_08057248: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80571DC - - thumb_func_start sub_805725C -sub_805725C: @ 805725C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r0, 0 - mov r8, r0 - ldr r1, =0x02024332 - mov r10, r1 - b _08057284 - .pool -_0805727C: - mov r2, r8 - cmp r2, 0 - beq _08057284 - b _08057406 -_08057284: - mov r1, r10 - ldrb r0, [r1] - cmp r0, 0x1 - bne _0805728E - b _08057390 -_0805728E: - cmp r0, 0x1 - ble _08057294 - b _080573FC -_08057294: - cmp r0, 0 - beq _0805729A - b _080573FC -_0805729A: - ldr r6, =0x02024084 - movs r0, 0x58 - mov r5, r9 - muls r5, r0 - adds r0, r6, 0 - adds r0, 0x4C - adds r4, r5, r0 - ldr r0, [r4] - movs r7, 0x7 - ands r0, r7 - cmp r0, 0 - beq _08057372 - mov r0, r9 - bl sub_8050650 - lsls r0, 24 - cmp r0, 0 - beq _080572FC - ldr r0, [r4] - movs r1, 0x8 - negs r1, r1 - ands r0, r1 - str r0, [r4] - adds r2, r6, 0 - adds r2, 0x50 - adds r2, r5, r2 - ldr r0, [r2] - ldr r1, =0xf7ffffff - ands r0, r1 - str r0, [r2] - bl b_movescr_stack_push_cursor - movs r0, 0x1 - mov r2, r10 - strb r0, [r2, 0x5] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB220 - str r0, [r1] - movs r0, 0x2 - mov r8, r0 - b _08057372 - .pool -_080572FC: - adds r0, r5, r6 - adds r0, 0x20 - ldrb r0, [r0] - movs r2, 0x1 - cmp r0, 0x30 - bne _0805730A - movs r2, 0x2 -_0805730A: - ldr r1, [r4] - adds r0, r1, 0 - ands r0, r7 - cmp r0, r2 - bcs _0805731E - movs r0, 0x8 - negs r0, r0 - ands r1, r0 - str r1, [r4] - b _08057322 -_0805731E: - subs r0, r1, r2 - str r0, [r4] -_08057322: - ldr r2, =0x02024084 - movs r0, 0x58 - mov r1, r9 - muls r1, r0 - adds r0, r2, 0 - adds r0, 0x4C - adds r0, r1, r0 - ldr r4, [r0] - movs r0, 0x7 - ands r4, r0 - cmp r4, 0 - beq _08057354 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB213 - str r0, [r1] - movs r1, 0x2 - mov r8, r1 - b _08057372 - .pool -_08057354: - adds r2, 0x50 - adds r2, r1, r2 - ldr r0, [r2] - ldr r1, =0xf7ffffff - ands r0, r1 - str r0, [r2] - bl b_movescr_stack_push_cursor - ldr r0, =0x02024332 - strb r4, [r0, 0x5] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB220 - str r0, [r1] - movs r2, 0x2 - mov r8, r2 -_08057372: - ldr r1, =0x02024332 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - mov r10, r1 - b _080573FC - .pool -_08057390: - ldr r1, =0x02024084 - movs r0, 0x58 - mov r2, r9 - muls r2, r0 - adds r0, r2, 0 - adds r1, 0x4C - adds r4, r0, r1 - ldr r0, [r4] - movs r1, 0x20 - ands r0, r1 - cmp r0, 0 - beq _080573F4 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x5 - bl __umodsi3 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0 - beq _080573D4 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB26A - str r0, [r1] - b _080573EC - .pool -_080573D4: - ldr r0, [r4] - movs r1, 0x21 - negs r1, r1 - ands r0, r1 - str r0, [r4] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB277 - str r0, [r1] - mov r0, r10 - strb r5, [r0, 0x5] -_080573EC: - movs r1, 0x2 - mov r8, r1 - ldr r2, =0x02024332 - mov r10, r2 -_080573F4: - mov r1, r10 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080573FC: - mov r2, r10 - ldrb r0, [r2] - cmp r0, 0x2 - beq _08057406 - b _0805727C -_08057406: - mov r0, r8 - cmp r0, 0x2 - bne _08057430 - ldr r4, =0x02024064 - mov r1, r9 - strb r1, [r4] - ldrb r1, [r4] - movs r0, 0x58 - muls r0, r1 - ldr r1, =0x020240d0 - adds r0, r1 - str r0, [sp] - movs r0, 0 - movs r1, 0x28 - movs r2, 0 - movs r3, 0x4 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_08057430: - 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 - .pool - thumb_func_end sub_805725C - - thumb_func_start nullsub_21 -nullsub_21: @ 8057458 - bx lr - thumb_func_end nullsub_21 - - thumb_func_start sub_805745C -sub_805745C: @ 805745C - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_exec_buffer_A_ch0_tbl1 - str r1, [r0] - ldr r0, =0x020244b9 - movs r1, 0 - strb r1, [r0] - ldr r0, =0x020244cc - strb r1, [r0] - bx lr - .pool - thumb_func_end sub_805745C - - thumb_func_start dp01_tbl1_exec_completed -dp01_tbl1_exec_completed: @ 805748C - push {r4,lr} - sub sp, 0x4 - ldr r1, =0x03005d60 - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_exec_buffer_A_ch0_tbl1 - str r1, [r0] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080574E0 - bl link_get_multiplayer_id - mov r1, sp - strb r0, [r1] - movs r0, 0x2 - movs r1, 0x4 - mov r2, sp - bl dp01_prepare_buffer_wireless_probably - ldr r1, =0x02023064 - ldrb r0, [r4] - lsls r0, 9 - adds r0, r1 - movs r1, 0x38 - strb r1, [r0] - b _080574F2 - .pool -_080574E0: - ldr r2, =0x02024068 - ldr r1, =gUnknown_0832A328 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - ldr r0, [r2] - bics r0, r1 - str r0, [r2] -_080574F2: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_tbl1_exec_completed - - thumb_func_start bx_exec_buffer_A_ch0_tbl1 -bx_exec_buffer_A_ch0_tbl1: @ 8057504 - push {lr} - ldr r2, =0x02024068 - ldr r1, =gUnknown_0832A328 - ldr r0, =0x02024064 - ldrb r3, [r0] - lsls r0, r3, 2 - adds r0, r1 - ldr r1, [r2] - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08057550 - ldr r0, =0x02023064 - lsls r1, r3, 9 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x38 - bhi _0805754C - ldr r0, =gUnknown_0831C514 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - bl _call_via_r0 - b _08057550 - .pool -_0805754C: - bl dp01_tbl1_exec_completed -_08057550: - pop {r0} - bx r0 - thumb_func_end bx_exec_buffer_A_ch0_tbl1 - - thumb_func_start bx_0802E404 -bx_0802E404: @ 8057554 - push {lr} - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x24 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08057576 - bl dp01_tbl1_exec_completed -_08057576: - pop {r0} - bx r0 - .pool - thumb_func_end bx_0802E404 - - thumb_func_start sub_8057588 -sub_8057588: @ 8057588 - push {r4-r7,lr} - ldr r3, =0x02023064 - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r2, r0, 9 - adds r1, r3, 0x2 - adds r1, r2, r1 - ldrb r5, [r1] - adds r3, 0x3 - adds r2, r3 - ldrb r1, [r2] - lsls r1, 8 - orrs r5, r1 - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x1 - bl dp11b_obj_instanciate - ldrb r0, [r4] - movs r1, 0 - movs r2, 0x7 - movs r3, 0x1 - bl dp11b_obj_instanciate - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x30] - movs r0, 0xF0 - ands r0, r1 - cmp r0, 0 - beq _080575EC - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x13] - cmp r0, 0x2 - bne _080575EC - ldr r1, =0x020244cc - ldrb r0, [r1] - adds r0, 0x1 - b _080575F0 - .pool -_080575EC: - ldr r1, =0x020244cc - movs r0, 0 -_080575F0: - strb r0, [r1] - ldr r0, =0x030022c0 - ldrh r2, [r0, 0x2E] - movs r3, 0x1 - adds r0, r3, 0 - ands r0, r2 - cmp r0, 0 - beq _08057658 - movs r0, 0x5 - bl audio_play - ldr r1, =0x020244ac - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _08057640 - cmp r0, 0x1 - bgt _08057630 - cmp r0, 0 - beq _0805763A - b _080577C2 - .pool -_08057630: - cmp r0, 0x2 - beq _08057646 - cmp r0, 0x3 - beq _0805764C - b _080577C2 -_0805763A: - movs r0, 0x1 - movs r1, 0 - b _080577BC -_08057640: - movs r0, 0x1 - movs r1, 0x1 - b _080577BC -_08057646: - movs r0, 0x1 - movs r1, 0x2 - b _080577BC -_0805764C: - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb - b _080577C2 -_08057658: - movs r0, 0x20 - ands r0, r2 - cmp r0, 0 - beq _08057698 - ldr r5, =0x020244ac - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - bne _08057674 - b _080577E8 -_08057674: - movs r0, 0x5 - bl audio_play - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - bl sub_8059CF8 - ldrb r1, [r4] - adds r1, r5 - ldrb r0, [r1] - movs r2, 0x1 - b _08057732 - .pool -_08057698: - movs r0, 0x10 - ands r0, r2 - cmp r0, 0 - beq _080576D8 - ldr r5, =0x020244ac - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _080576B4 - b _080577E8 -_080576B4: - movs r0, 0x5 - bl audio_play - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - bl sub_8059CF8 - ldrb r1, [r4] - adds r1, r5 - ldrb r0, [r1] - movs r2, 0x1 - b _08057732 - .pool -_080576D8: - movs r7, 0x40 - adds r0, r7, 0 - ands r0, r2 - cmp r0, 0 - beq _08057700 - ldr r5, =0x020244ac - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080577E8 - b _0805771A - .pool -_08057700: - movs r0, 0x80 - ands r0, r2 - cmp r0, 0 - beq _0805774C - ldr r5, =0x020244ac - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _080577E8 -_0805771A: - movs r0, 0x5 - bl audio_play - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - bl sub_8059CF8 - ldrb r1, [r4] - adds r1, r5 - ldrb r0, [r1] - movs r2, 0x2 -_08057732: - eors r0, r2 - strb r0, [r1] - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - movs r1, 0 - bl sub_8059CB4 - b _080577E8 - .pool -_0805774C: - movs r0, 0x2 - ands r0, r2 - cmp r0, 0 - bne _0805775A - ldrb r0, [r1] - cmp r0, 0x3B - bls _080577DC -_0805775A: - ldr r4, =0x02022fec - ldr r0, [r4] - ands r0, r3 - cmp r0, 0 - beq _080577E8 - ldr r6, =0x02024064 - ldrb r0, [r6] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _080577E8 - movs r0, 0 - bl battle_get_side_with_given_state - ldr r1, =0x02024210 - ldrb r1, [r1] - ldr r2, =gUnknown_0832A328 - lsls r0, 24 - lsrs r0, 22 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _080577E8 - ldr r0, [r4] - ands r0, r7 - cmp r0, 0 - bne _080577E8 - ldr r0, =0x02023064 - ldrb r1, [r6] - lsls r1, 9 - adds r0, 0x1 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x1 - bne _080577B2 - cmp r5, 0xC - bhi _080577E8 - adds r0, r5, 0 - movs r1, 0x1 - bl bag_add_item -_080577B2: - movs r0, 0x5 - bl audio_play - movs r0, 0x1 - movs r1, 0xC -_080577BC: - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb -_080577C2: - bl dp01_tbl1_exec_completed - b _080577E8 - .pool -_080577DC: - movs r0, 0x8 - ands r0, r2 - cmp r0, 0 - beq _080577E8 - bl sub_8073314 -_080577E8: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8057588 - - thumb_func_start sub_80577F0 -sub_80577F0: @ 80577F0 - push {r4,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - movs r1, 0x1 - bl dp11b_obj_free - ldrb r0, [r4] - movs r1, 0 - bl dp11b_obj_free - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8057824 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80577F0 - - thumb_func_start sub_8057824 -sub_8057824: @ 8057824 - push {r4,r5,lr} - sub sp, 0x4 - ldr r1, =gUnknown_0831C5F8 - mov r0, sp - movs r2, 0x4 - bl memcpy - ldr r0, =0x03005d74 - ldrb r0, [r0] - movs r1, 0x1 - movs r2, 0xF - movs r3, 0x1 - bl dp11b_obj_instanciate - movs r4, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r0, 0 - beq _08057866 -_0805784A: - ldr r0, =0x03005d74 - ldrb r0, [r0] - cmp r4, r0 - beq _0805785C - lsls r0, r4, 24 - lsrs r0, 24 - movs r1, 0x1 - bl dp11b_obj_free -_0805785C: - adds r4, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _0805784A -_08057866: - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x2C] - movs r0, 0xF0 - ands r0, r1 - cmp r0, 0 - beq _0805789C - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x13] - cmp r0, 0x2 - bne _0805789C - ldr r1, =0x020244cc - ldrb r0, [r1] - adds r0, 0x1 - b _080578A0 - .pool -_0805789C: - ldr r1, =0x020244cc - movs r0, 0 -_080578A0: - strb r0, [r1] - ldrh r2, [r2, 0x2E] - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - beq _08057910 - movs r0, 0x5 - bl audio_play - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r4, =0x03005d74 - ldrb r0, [r4] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_8039B2C - str r1, [r0] - ldr r1, =0x020244b0 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r2, [r0] - ldrb r0, [r4] - lsls r0, 8 - orrs r2, r0 - movs r0, 0x1 - movs r1, 0xA - bl dp01_build_cmdbuf_x21_a_bb - ldrb r0, [r4] - movs r1, 0x1 - bl dp11b_obj_free - bl dp01_tbl1_exec_completed - b _08057BC8 - .pool -_08057910: - movs r0, 0x2 - ands r0, r2 - cmp r0, 0 - bne _0805791E - ldrb r0, [r1] - cmp r0, 0x3B - bls _0805798C -_0805791E: - movs r0, 0x5 - bl audio_play - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r5, =0x03005d74 - ldrb r0, [r5] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_8039B2C - str r1, [r0] - ldr r1, =0x03005d60 - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8057BFC - str r1, [r0] - ldrb r0, [r4] - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x1 - bl dp11b_obj_instanciate - ldrb r0, [r4] - movs r1, 0 - movs r2, 0x7 - movs r3, 0x1 - bl dp11b_obj_instanciate - ldrb r0, [r5] - movs r1, 0x1 - bl dp11b_obj_free - b _08057BC8 - .pool -_0805798C: - movs r0, 0x60 - ands r0, r2 - cmp r0, 0 - bne _08057996 - b _08057AB0 -_08057996: - movs r0, 0x5 - bl audio_play - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r3, =0x03005d74 - ldrb r0, [r3] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_8039B2C - str r1, [r0] - adds r5, r3, 0 -_080579B8: - ldrb r0, [r5] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r1, r0, 24 - movs r4, 0 - mov r0, sp - b _080579E2 - .pool -_080579D8: - adds r4, 0x1 - cmp r4, 0x3 - bgt _080579E8 - mov r2, sp - adds r0, r2, r4 -_080579E2: - ldrb r0, [r0] - cmp r1, r0 - bne _080579D8 -_080579E8: - subs r4, 0x1 - cmp r4, 0 - bge _080579F0 - movs r4, 0x4 -_080579F0: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - bl battle_get_side_with_given_state - strb r0, [r5] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - beq _080579E8 - movs r4, 0 - ldrb r0, [r5] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08057A6E - cmp r0, 0x1 - bgt _08057A28 - cmp r0, 0 - beq _08057A32 - b _08057A70 - .pool -_08057A28: - cmp r0, 0x2 - beq _08057A32 - cmp r0, 0x3 - beq _08057A6E - b _08057A70 -_08057A32: - ldr r2, =0x02024064 - ldrb r0, [r2] - ldrb r1, [r5] - cmp r0, r1 - bne _08057A6E - ldr r1, =0x0202406e - ldrb r2, [r2] - lsls r0, r2, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x020244b0 - adds r2, r1 - ldrb r1, [r2] - adds r1, 0xD - bl pokemon_getattr - ldr r2, =gBattleMoves - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r1, [r1, 0x6] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08057A70 -_08057A6E: - adds r4, 0x1 -_08057A70: - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - ldr r0, =0x03005d74 - cmp r1, 0 - beq _08057A88 - movs r4, 0 -_08057A88: - cmp r4, 0 - beq _080579B8 - b _08057BB0 - .pool -_08057AB0: - movs r0, 0x90 - ands r0, r2 - cmp r0, 0 - bne _08057ABA - b _08057BC8 -_08057ABA: - movs r0, 0x5 - bl audio_play - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r3, =0x03005d74 - ldrb r0, [r3] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_8039B2C - str r1, [r0] - adds r5, r3, 0 -_08057ADC: - ldrb r0, [r5] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r1, r0, 24 - movs r4, 0 - mov r0, sp - b _08057B06 - .pool -_08057AFC: - adds r4, 0x1 - cmp r4, 0x3 - bgt _08057B0C - mov r2, sp - adds r0, r2, r4 -_08057B06: - ldrb r0, [r0] - cmp r1, r0 - bne _08057AFC -_08057B0C: - adds r4, 0x1 - cmp r4, 0x3 - ble _08057B14 - movs r4, 0 -_08057B14: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - bl battle_get_side_with_given_state - strb r0, [r5] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - beq _08057B0C - movs r4, 0 - ldrb r0, [r5] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08057B92 - cmp r0, 0x1 - bgt _08057B4C - cmp r0, 0 - beq _08057B56 - b _08057B94 - .pool -_08057B4C: - cmp r0, 0x2 - beq _08057B56 - cmp r0, 0x3 - beq _08057B92 - b _08057B94 -_08057B56: - ldr r2, =0x02024064 - ldrb r0, [r2] - ldrb r1, [r5] - cmp r0, r1 - bne _08057B92 - ldr r1, =0x0202406e - ldrb r2, [r2] - lsls r0, r2, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x020244b0 - adds r2, r1 - ldrb r1, [r2] - adds r1, 0xD - bl pokemon_getattr - ldr r2, =gBattleMoves - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r1, [r1, 0x6] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08057B94 -_08057B92: - adds r4, 0x1 -_08057B94: - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - ldr r0, =0x03005d74 - cmp r1, 0 - beq _08057BAC - movs r4, 0 -_08057BAC: - cmp r4, 0 - beq _08057ADC -_08057BB0: - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_8039AD8 - str r1, [r0] -_08057BC8: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8057824 - - thumb_func_start sub_8057BFC -sub_8057BFC: @ 8057BFC - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r0, 0 - mov r8, r0 - ldr r3, =0x02024064 - ldrb r0, [r3] - lsls r0, 9 - ldr r1, =0x02023068 - adds r6, r0, r1 - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x2C] - movs r0, 0xF0 - ands r0, r1 - adds r7, r3, 0 - cmp r0, 0 - beq _08057C44 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x13] - cmp r0, 0x2 - bne _08057C44 - ldr r1, =0x020244cc - ldrb r0, [r1] - adds r0, 0x1 - b _08057C48 - .pool -_08057C44: - ldr r1, =0x020244cc - movs r0, 0 -_08057C48: - strb r0, [r1] - ldrh r2, [r2, 0x2E] - movs r5, 0x1 - adds r0, r5, 0 - ands r0, r2 - cmp r0, 0 - bne _08057C58 - b _08057E04 -_08057C58: - movs r0, 0x5 - bl audio_play - ldr r1, =0x020244b0 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - lsls r0, 1 - adds r1, r6, r0 - ldrh r0, [r1] - cmp r0, 0xAE - bne _08057C98 - ldrb r0, [r6, 0x12] - movs r4, 0 - cmp r0, 0x7 - beq _08057CA6 - ldrb r1, [r6, 0x13] - movs r0, 0x7 - eors r1, r0 - negs r0, r1 - orrs r0, r1 - asrs r4, r0, 31 - movs r0, 0x10 - ands r4, r0 - b _08057CA6 - .pool -_08057C98: - ldr r2, =gBattleMoves - ldrh r1, [r1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r4, [r0, 0x6] -_08057CA6: - movs r0, 0x10 - ands r0, r4 - cmp r0, 0 - beq _08057CC4 - ldr r0, =0x03005d74 - ldr r1, =0x02024064 - ldrb r1, [r1] - strb r1, [r0] - b _08057CDE - .pool -_08057CC4: - ldr r0, =0x02024064 - ldrb r0, [r0] - bl battle_get_per_side_status - adds r1, r0, 0 - movs r2, 0x1 - movs r0, 0x1 - ands r0, r1 - eors r0, r2 - bl battle_get_side_with_given_state - ldr r1, =0x03005d74 - strb r0, [r1] -_08057CDE: - ldr r5, =0x02023064 - ldr r0, =0x02024064 - ldrb r3, [r0] - lsls r2, r3, 9 - adds r1, r5, 0x1 - adds r1, r2, r1 - ldrb r1, [r1] - adds r7, r0, 0 - cmp r1, 0 - bne _08057D18 - movs r0, 0x2 - ands r0, r4 - cmp r0, 0 - beq _08057D5A - adds r0, r5, 0x2 - adds r0, r2, r0 - ldrb r0, [r0] - cmp r0, 0 - bne _08057D5A - movs r0, 0x1 - add r8, r0 - b _08057D5A - .pool -_08057D18: - movs r0, 0x7D - ands r0, r4 - cmp r0, 0 - bne _08057D24 - movs r0, 0x1 - add r8, r0 -_08057D24: - ldr r0, =0x020244b0 - adds r0, r3, r0 - adds r1, r6, 0 - adds r1, 0x8 - ldrb r0, [r0] - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0 - beq _08057D62 - movs r0, 0x12 - ands r0, r4 - cmp r0, 0 - bne _08057D5A - movs r0, 0 - bl sub_8069DEC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _08057D5A - ldrb r0, [r7] - bl sub_8069F34 - ldr r1, =0x03005d74 - strb r0, [r1] - movs r0, 0 - mov r8, r0 -_08057D5A: - ldr r7, =0x02024064 - mov r0, r8 - cmp r0, 0 - bne _08057D80 -_08057D62: - ldr r1, =0x020244b0 - ldrb r0, [r7] - adds r0, r1 - ldrb r2, [r0] - ldr r0, =0x03005d74 - ldrb r0, [r0] - lsls r0, 8 - orrs r2, r0 - b _08057E1C - .pool -_08057D80: - ldr r1, =0x03005d60 - ldrb r0, [r7] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8057824 - str r1, [r0] - movs r0, 0x12 - ands r4, r0 - cmp r4, 0 - beq _08057DA8 - ldr r1, =0x03005d74 - ldrb r0, [r7] - b _08057DD8 - .pool -_08057DA8: - movs r0, 0x1 - bl battle_get_side_with_given_state - ldr r1, =0x02024210 - ldrb r1, [r1] - ldr r2, =gUnknown_0832A328 - lsls r0, 24 - lsrs r0, 22 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08057DD0 - movs r0, 0x3 - b _08057DD2 - .pool -_08057DD0: - movs r0, 0x1 -_08057DD2: - bl battle_get_side_with_given_state - ldr r1, =0x03005d74 -_08057DD8: - strb r0, [r1] - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r0, =0x03005d74 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_8039AD8 - b _08057F9C - .pool -_08057E04: - movs r6, 0x2 - adds r0, r6, 0 - ands r0, r2 - cmp r0, 0 - bne _08057E14 - ldrb r0, [r1] - cmp r0, 0x3B - bls _08057E30 -_08057E14: - movs r0, 0x5 - bl audio_play - ldr r2, =0x0000ffff -_08057E1C: - movs r0, 0x1 - movs r1, 0xA - bl dp01_build_cmdbuf_x21_a_bb - bl dp01_tbl1_exec_completed - b _08057F9E - .pool -_08057E30: - movs r0, 0x20 - ands r0, r2 - cmp r0, 0 - beq _08057E60 - ldr r4, =0x020244b0 - ldrb r0, [r7] - adds r2, r0, r4 - ldrb r1, [r2] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - bne _08057E4A - b _08057F9E -_08057E4A: - ldrb r0, [r2] - bl battle_menu_cursor_related - ldrb r1, [r7] - adds r1, r4 - ldrb r0, [r1] - movs r2, 0x1 - eors r0, r2 - b _08057F08 - .pool -_08057E60: - movs r0, 0x10 - ands r0, r2 - cmp r0, 0 - beq _08057EA4 - ldr r4, =0x020244b0 - ldrb r0, [r7] - adds r3, r0, r4 - ldrb r2, [r3] - movs r6, 0x1 - adds r0, r5, 0 - ands r0, r2 - cmp r0, 0 - beq _08057E7C - b _08057F9E -_08057E7C: - ldr r1, =0x03005d78 - adds r0, r6, 0 - eors r0, r2 - ldrb r1, [r1] - cmp r0, r1 - bcc _08057E8A - b _08057F9E -_08057E8A: - ldrb r0, [r3] - bl battle_menu_cursor_related - ldrb r1, [r7] - adds r1, r4 - ldrb r0, [r1] - eors r0, r6 - b _08057F08 - .pool -_08057EA4: - movs r0, 0x40 - ands r0, r2 - cmp r0, 0 - beq _08057ED4 - ldr r4, =0x020244b0 - ldrb r0, [r7] - adds r2, r0, r4 - ldrb r1, [r2] - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _08057F9E - ldrb r0, [r2] - bl battle_menu_cursor_related - ldrb r1, [r7] - adds r1, r4 - ldrb r0, [r1] - movs r2, 0x2 - eors r0, r2 - b _08057F08 - .pool -_08057ED4: - movs r0, 0x80 - ands r0, r2 - cmp r0, 0 - beq _08057F30 - ldr r4, =0x020244b0 - ldrb r0, [r7] - adds r3, r0, r4 - ldrb r2, [r3] - movs r5, 0x2 - adds r0, r6, 0 - ands r0, r2 - cmp r0, 0 - bne _08057F9E - ldr r1, =0x03005d78 - adds r0, r5, 0 - eors r0, r2 - ldrb r1, [r1] - cmp r0, r1 - bcs _08057F9E - ldrb r0, [r3] - bl battle_menu_cursor_related - ldrb r1, [r7] - adds r1, r4 - ldrb r0, [r1] - eors r0, r5 -_08057F08: - strb r0, [r1] - movs r0, 0x5 - bl audio_play - ldrb r0, [r7] - adds r0, r4 - ldrb r0, [r0] - movs r1, 0 - bl battle_menu_cursor_related_2 - bl sub_8059B3C - bl sub_8059BB0 - b _08057F9E - .pool -_08057F30: - movs r0, 0x4 - ands r0, r2 - cmp r0, 0 - beq _08057F9E - ldr r0, =0x03005d78 - ldrb r0, [r0] - cmp r0, 0x1 - bls _08057F9E - ldr r0, =0x02022fec - ldr r5, [r0] - ands r5, r6 - cmp r5, 0 - bne _08057F9E - ldr r4, =0x020244b0 - ldrb r0, [r7] - adds r0, r4 - ldrb r0, [r0] - movs r1, 0x1D - bl battle_menu_cursor_related_2 - ldrb r0, [r7] - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - beq _08057F78 - ldr r0, =0x03005d74 - strb r5, [r0] - b _08057F80 - .pool -_08057F78: - ldr r1, =0x03005d74 - adds r0, 0x1 - strb r0, [r1] - adds r0, r1, 0 -_08057F80: - ldrb r0, [r0] - movs r1, 0x1B - bl battle_menu_cursor_related_2 - ldr r0, =gUnknown_085CCACA - movs r1, 0xB - bl battle_show_message_maybe - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8058138 -_08057F9C: - str r1, [r0] -_08057F9E: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8057BFC - - thumb_func_start sub_8057FBC -sub_8057FBC: @ 8057FBC - push {r4-r7,lr} - movs r7, 0 - ldr r4, =0x030022c0 - ldrh r1, [r4, 0x2E] - movs r6, 0x1 - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _08057FD6 - movs r0, 0x5 - bl audio_play - movs r7, 0x1 -_08057FD6: - ldrh r1, [r4, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08057FF8 - movs r0, 0x5 - bl audio_play - ldr r1, =0x02022e14 - movs r0, 0 - strh r0, [r1] - ldr r1, =0x02022e16 - movs r2, 0xA0 - lsls r2, 1 - adds r0, r2, 0 - strh r0, [r1] - movs r7, 0xFF -_08057FF8: - ldrh r1, [r4, 0x2E] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08058038 - ldr r5, =0x020244b0 - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r2, r0, r5 - ldrb r1, [r2] - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _08058038 - ldrb r0, [r2] - bl battle_menu_cursor_related - ldrb r1, [r4] - adds r1, r5 - ldrb r0, [r1] - movs r2, 0x1 - eors r0, r2 - strb r0, [r1] - movs r0, 0x5 - bl audio_play - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - movs r1, 0 - bl battle_menu_cursor_related_2 -_08058038: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08058086 - ldr r5, =0x020244b0 - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r3, r0, r5 - ldrb r2, [r3] - movs r6, 0x1 - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - bne _08058086 - ldr r1, =0x03005d78 - adds r0, r6, 0 - eors r0, r2 - ldrb r1, [r1] - cmp r0, r1 - bcs _08058086 - ldrb r0, [r3] - bl battle_menu_cursor_related - ldrb r1, [r4] - adds r1, r5 - ldrb r0, [r1] - eors r0, r6 - strb r0, [r1] - movs r0, 0x5 - bl audio_play - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - movs r1, 0 - bl battle_menu_cursor_related_2 -_08058086: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080580C8 - ldr r5, =0x020244b0 - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r2, r0, r5 - ldrb r1, [r2] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080580C8 - ldrb r0, [r2] - bl battle_menu_cursor_related - ldrb r1, [r4] - adds r1, r5 - ldrb r0, [r1] - movs r2, 0x2 - eors r0, r2 - strb r0, [r1] - movs r0, 0x5 - bl audio_play - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - movs r1, 0 - bl battle_menu_cursor_related_2 -_080580C8: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08058116 - ldr r5, =0x020244b0 - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r3, r0, r5 - ldrb r2, [r3] - movs r6, 0x2 - movs r0, 0x2 - ands r0, r2 - cmp r0, 0 - bne _08058116 - ldr r1, =0x03005d78 - adds r0, r6, 0 - eors r0, r2 - ldrb r1, [r1] - cmp r0, r1 - bcs _08058116 - ldrb r0, [r3] - bl battle_menu_cursor_related - ldrb r1, [r4] - adds r1, r5 - ldrb r0, [r1] - eors r0, r6 - strb r0, [r1] - movs r0, 0x5 - bl audio_play - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - movs r1, 0 - bl battle_menu_cursor_related_2 -_08058116: - adds r0, r7, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8057FBC - - thumb_func_start sub_8058138 -sub_8058138: @ 8058138 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x5 - ands r0, r1 - cmp r0, 0 - bne _08058152 - b _08058500 -_08058152: - movs r0, 0x5 - bl audio_play - ldr r0, =0x020244b0 - mov r10, r0 - ldr r1, =0x02024064 - mov r8, r1 - ldrb r1, [r1] - adds r2, r1, r0 - ldr r5, =0x03005d74 - ldrb r0, [r2] - ldrb r3, [r5] - cmp r0, r3 - bne _08058170 - b _080584A8 -_08058170: - lsls r1, 9 - ldr r0, =0x02023068 - adds r1, r0 - mov r9, r1 - ldrb r1, [r2] - lsls r1, 1 - add r1, r9 - ldrh r6, [r1] - ldrb r0, [r5] - lsls r0, 1 - add r0, r9 - ldrh r0, [r0] - strh r0, [r1] - ldrb r0, [r5] - lsls r0, 1 - add r0, r9 - strh r6, [r0] - mov r1, r8 - ldrb r0, [r1] - add r0, r10 - ldrb r1, [r0] - mov r7, r9 - adds r7, 0x8 - adds r1, r7, r1 - ldrb r6, [r1] - ldrb r0, [r5] - adds r0, r7, r0 - ldrb r0, [r0] - strb r0, [r1] - ldrb r0, [r5] - adds r0, r7, r0 - strb r6, [r0] - mov r2, r8 - ldrb r0, [r2] - add r0, r10 - ldrb r1, [r0] - mov r2, r9 - adds r2, 0xC - adds r1, r2, r1 - ldrb r6, [r1] - ldrb r0, [r5] - adds r0, r2, r0 - ldrb r0, [r0] - strb r0, [r1] - ldrb r0, [r5] - adds r2, r0 - strb r6, [r2] - mov r3, r8 - ldrb r1, [r3] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - ldr r2, =0x020242bc - adds r6, r0, r2 - ldrb r4, [r6, 0x18] - lsls r3, r4, 24 - lsrs r2, r3, 28 - ldr r0, =gUnknown_0832A328 - mov r12, r0 - add r1, r10 - ldrb r0, [r1] - lsls r0, 2 - add r0, r12 - ldr r0, [r0] - ands r2, r0 - cmp r2, 0 - beq _0805822A - lsrs r1, r3, 28 - bics r1, r0 - lsls r1, 4 - movs r2, 0xF - adds r0, r2, 0 - ands r0, r4 - orrs r0, r1 - strb r0, [r6, 0x18] - mov r1, r8 - ldrb r0, [r1] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r3, =0x020242bc - adds r1, r3 - ldrb r4, [r1, 0x18] - lsrs r3, r4, 4 - ldrb r0, [r5] - lsls r0, 2 - add r0, r12 - ldr r0, [r0] - orrs r0, r3 - lsls r0, 4 - ands r2, r4 - orrs r2, r0 - strb r2, [r1, 0x18] -_0805822A: - bl sub_8059AAC - movs r6, 0 - mov r12, r7 - mov r5, sp - adds r5, 0x18 - str r5, [sp, 0x1C] - ldr r2, =0x02024084 - mov r0, r8 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r4, r0, 0 - adds r4, 0x3B - mov r7, r8 - mov r10, r2 - movs r5, 0x3 -_0805824E: - mov r1, sp - adds r3, r1, r6 - ldrb r1, [r4] - lsls r2, r6, 1 - adds r0, r5, 0 - lsls r0, r2 - ands r1, r0 - asrs r1, r2 - strb r1, [r3] - adds r6, 0x1 - cmp r6, 0x3 - ble _0805824E - ldr r1, =0x020244b0 - ldrb r0, [r7] - adds r0, r1 - ldrb r0, [r0] - add r0, sp - ldrb r0, [r0] - ldr r2, [sp, 0x1C] - strb r0, [r2] - ldrb r0, [r7] - adds r0, r1 - ldrb r0, [r0] - mov r3, sp - adds r2, r3, r0 - ldr r1, =0x03005d74 - ldrb r0, [r1] - add r0, sp - ldrb r0, [r0] - movs r3, 0 - strb r0, [r2] - ldrb r0, [r1] - mov r5, sp - adds r1, r5, r0 - ldr r2, [sp, 0x1C] - ldrb r0, [r2] - strb r0, [r1] - strb r3, [r2] - movs r6, 0 - ldr r2, [sp, 0x1C] -_0805829E: - mov r3, sp - adds r0, r3, r6 - ldrb r1, [r0] - lsls r0, r6, 1 - lsls r1, r0 - ldrb r0, [r2] - orrs r0, r1 - strb r0, [r2] - adds r6, 0x1 - cmp r6, 0x3 - ble _0805829E - ldrb r1, [r7] - movs r0, 0x58 - muls r0, r1 - add r0, r10 - adds r0, 0x3B - ldr r5, [sp, 0x1C] - ldrb r1, [r5] - strb r1, [r0] - movs r6, 0 - adds r4, r7, 0 - movs r3, 0x58 - movs r0, 0x24 - add r0, r10 - mov r8, r0 - mov r2, r9 - mov r7, r10 - adds r7, 0xC - mov r5, r12 -_080582D8: - lsls r1, r6, 1 - ldrb r0, [r4] - muls r0, r3 - adds r1, r0 - adds r1, r7 - ldrh r0, [r2] - strh r0, [r1] - ldrb r0, [r4] - adds r1, r0, 0 - muls r1, r3 - adds r1, r6, r1 - add r1, r8 - adds r0, r5, r6 - ldrb r0, [r0] - strb r0, [r1] - adds r2, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - ble _080582D8 - ldr r2, =0x02024064 - ldrb r1, [r2] - movs r0, 0x58 - muls r0, r1 - mov r1, r10 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 14 - ands r0, r1 - cmp r0, 0 - beq _0805831A - b _080584A8 -_0805831A: - movs r6, 0 - mov r1, sp - adds r1, 0x4 - str r1, [sp, 0x20] - add r3, sp, 0xC - mov r10, r3 - ldr r5, =0x0202406e - mov r9, r5 - mov r8, r2 - movs r7, 0x64 - ldr r5, =0x020244ec - adds r4, r1, 0 -_08058332: - mov r1, r8 - ldrb r0, [r1] - lsls r0, 1 - add r0, r9 - ldrh r0, [r0] - muls r0, r7 - adds r0, r5 - adds r1, r6, 0 - adds r1, 0xD - bl pokemon_getattr - strh r0, [r4] - mov r2, r8 - ldrb r0, [r2] - lsls r0, 1 - add r0, r9 - ldrh r0, [r0] - muls r0, r7 - adds r0, r5 - adds r1, r6, 0 - adds r1, 0x11 - bl pokemon_getattr - mov r3, r10 - adds r1, r3, r6 - strb r0, [r1] - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - ble _08058332 - ldr r1, =0x0202406e - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x15 - bl pokemon_getattr - ldr r5, [sp, 0x1C] - strb r0, [r5] - movs r6, 0 - movs r5, 0x3 - ldr r4, [sp, 0x1C] -_08058392: - mov r0, sp - adds r3, r0, r6 - lsls r2, r6, 1 - adds r1, r5, 0 - lsls r1, r2 - ldrb r0, [r4] - ands r0, r1 - asrs r0, r2 - strb r0, [r3] - adds r6, 0x1 - cmp r6, 0x3 - ble _08058392 - ldr r4, =0x020244b0 - ldr r3, =0x02024064 - ldrb r0, [r3] - adds r0, r4 - ldrb r1, [r0] - lsls r1, 1 - ldr r2, [sp, 0x20] - adds r1, r2, r1 - ldrh r6, [r1] - ldr r2, =0x03005d74 - ldrb r0, [r2] - lsls r0, 1 - ldr r5, [sp, 0x20] - adds r0, r5, r0 - ldrh r0, [r0] - movs r5, 0 - strh r0, [r1] - ldrb r0, [r2] - lsls r0, 1 - ldr r1, [sp, 0x20] - adds r0, r1, r0 - strh r6, [r0] - ldrb r0, [r3] - adds r0, r4 - ldrb r1, [r0] - add r1, r10 - ldrb r6, [r1] - ldrb r0, [r2] - add r0, r10 - ldrb r0, [r0] - strb r0, [r1] - ldrb r0, [r2] - add r0, r10 - strb r6, [r0] - ldrb r0, [r3] - adds r0, r4 - ldrb r0, [r0] - add r0, sp - ldrb r0, [r0] - ldr r1, [sp, 0x1C] - strb r0, [r1] - ldrb r0, [r3] - adds r0, r4 - ldrb r0, [r0] - mov r3, sp - adds r1, r3, r0 - ldrb r0, [r2] - add r0, sp - ldrb r0, [r0] - strb r0, [r1] - ldrb r0, [r2] - adds r1, r3, r0 - ldr r2, [sp, 0x1C] - ldrb r0, [r2] - strb r0, [r1] - strb r5, [r2] - movs r6, 0 - ldr r2, [sp, 0x1C] -_0805841E: - mov r3, sp - adds r0, r3, r6 - ldrb r1, [r0] - lsls r0, r6, 1 - lsls r1, r0 - ldrb r0, [r2] - orrs r0, r1 - strb r0, [r2] - adds r6, 0x1 - cmp r6, 0x3 - ble _0805841E - movs r6, 0 - ldr r5, =0x0202406e - mov r10, r5 - ldr r0, =0x02024064 - mov r9, r0 - movs r1, 0x64 - mov r8, r1 - ldr r7, =0x020244ec - ldr r5, [sp, 0x20] - adds r5, 0x8 - ldr r4, [sp, 0x20] -_0805844A: - mov r2, r9 - ldrb r0, [r2] - lsls r0, 1 - add r0, r10 - ldrh r0, [r0] - mov r3, r8 - muls r3, r0 - adds r0, r3, 0 - adds r0, r7 - adds r1, r6, 0 - adds r1, 0xD - adds r2, r4, 0 - bl pokemon_setattr - mov r1, r9 - ldrb r0, [r1] - lsls r0, 1 - add r0, r10 - ldrh r0, [r0] - mov r2, r8 - muls r2, r0 - adds r0, r2, 0 - adds r0, r7 - adds r1, r6, 0 - adds r1, 0x11 - adds r2, r5, 0 - bl pokemon_setattr - adds r5, 0x1 - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - ble _0805844A - ldr r1, =0x0202406e - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x15 - ldr r2, [sp, 0x1C] - bl pokemon_setattr -_080584A8: - ldr r1, =0x03005d60 - ldr r2, =0x02024064 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8057BFC - str r1, [r0] - ldr r3, =0x020244b0 - ldrb r0, [r2] - adds r0, r3 - ldr r1, =0x03005d74 - ldrb r1, [r1] - strb r1, [r0] - ldrb r0, [r2] - adds r0, r3 - ldrb r0, [r0] - movs r1, 0 - bl battle_menu_cursor_related_2 - b _08058532 - .pool -_08058500: - movs r0, 0x6 - ands r0, r1 - cmp r0, 0 - beq _08058554 - movs r0, 0x5 - bl audio_play - ldr r0, =0x03005d74 - ldrb r0, [r0] - bl battle_menu_cursor_related - ldr r1, =0x020244b0 - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r1 - ldrb r0, [r0] - movs r1, 0 - bl battle_menu_cursor_related_2 - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8057BFC - str r1, [r0] -_08058532: - bl sub_8059B18 - bl sub_8059B3C - bl sub_8059BB0 - b _080586E8 - .pool -_08058554: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _080585A4 - ldr r3, =0x03005d74 - ldrb r2, [r3] - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - bne _0805856A - b _080586E8 -_0805856A: - ldr r0, =0x020244b0 - ldr r1, =0x02024064 - ldrb r1, [r1] - adds r1, r0 - ldrb r5, [r1] - cmp r2, r5 - bne _08058590 -_08058578: - ldrb r0, [r1] - movs r1, 0x1D - bl battle_menu_cursor_related_2 - b _08058596 - .pool -_08058590: - ldrb r0, [r3] - bl battle_menu_cursor_related -_08058596: - ldr r4, =0x03005d74 - ldrb r0, [r4] - movs r1, 0x1 - b _0805862C - .pool -_080585A4: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080585E8 - ldr r3, =0x03005d74 - ldrb r2, [r3] - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - beq _080585BA - b _080586E8 -_080585BA: - ldr r1, =0x03005d78 - movs r0, 0x1 - eors r0, r2 - ldrb r1, [r1] - cmp r0, r1 - bcc _080585C8 - b _080586E8 -_080585C8: - ldr r0, =0x020244b0 - ldr r1, =0x02024064 - ldrb r1, [r1] - adds r1, r0 - ldrb r0, [r1] - cmp r2, r0 - beq _08058578 - b _08058590 - .pool -_080585E8: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0805865C - ldr r3, =0x03005d74 - ldrb r2, [r3] - movs r0, 0x2 - ands r0, r2 - cmp r0, 0 - beq _080586E8 - ldr r0, =0x020244b0 - ldr r1, =0x02024064 - ldrb r1, [r1] - adds r1, r0 - ldrb r5, [r1] - cmp r2, r5 - bne _08058620 - ldrb r0, [r1] - movs r1, 0x1D - bl battle_menu_cursor_related_2 - b _08058626 - .pool -_08058620: - ldrb r0, [r3] - bl battle_menu_cursor_related -_08058626: - ldr r4, =0x03005d74 - ldrb r0, [r4] - movs r1, 0x2 -_0805862C: - eors r0, r1 - strb r0, [r4] - movs r0, 0x5 - bl audio_play - ldr r1, =0x020244b0 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r4] - ldrb r0, [r0] - cmp r1, r0 - beq _080586CA - ldrb r0, [r4] - movs r1, 0x1B - bl battle_menu_cursor_related_2 - b _080586E8 - .pool -_0805865C: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080586E8 - ldr r3, =0x03005d74 - ldrb r2, [r3] - movs r0, 0x2 - ands r0, r2 - cmp r0, 0 - bne _080586E8 - ldr r1, =0x03005d78 - movs r0, 0x2 - eors r0, r2 - ldrb r1, [r1] - cmp r0, r1 - bcs _080586E8 - ldr r0, =0x020244b0 - ldr r1, =0x02024064 - ldrb r1, [r1] - adds r1, r0 - ldrb r0, [r1] - cmp r2, r0 - bne _080586A4 - ldrb r0, [r1] - movs r1, 0x1D - bl battle_menu_cursor_related_2 - b _080586AA - .pool -_080586A4: - ldrb r0, [r3] - bl battle_menu_cursor_related -_080586AA: - ldr r4, =0x03005d74 - ldrb r0, [r4] - movs r1, 0x2 - eors r0, r1 - strb r0, [r4] - movs r0, 0x5 - bl audio_play - ldr r1, =0x020244b0 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r4] - ldrb r0, [r0] - cmp r1, r0 - bne _080586E0 -_080586CA: - adds r0, r1, 0 - movs r1, 0 - bl battle_menu_cursor_related_2 - b _080586E8 - .pool -_080586E0: - ldrb r0, [r4] - movs r1, 0x1B - bl battle_menu_cursor_related_2 -_080586E8: - 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_8058138 - - thumb_func_start sub_80586F8 -sub_80586F8: @ 80586F8 - push {lr} - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _0805875C - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _08058798 - movs r0, 0x5A - bl m4aSongNumStop - ldr r3, =0x030022c0 - ldr r0, =0x00000439 - adds r2, r3, r0 - ldrb r1, [r2] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldr r0, =0x03005d00 - ldr r0, [r0] - str r0, [r3] - ldr r0, =sub_8038D64 - bl SetMainCallback2 - ldr r0, =0x0202433a - ldrb r0, [r0] - cmp r0, 0x1 - bne _08058738 - bl sub_817E3F4 -_08058738: - bl FreeAllWindowBuffers - b _08058798 - .pool -_0805875C: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08058798 - movs r0, 0x5A - bl m4aSongNumStop - ldr r3, =0x030022c0 - ldr r0, =0x00000439 - adds r2, r3, r0 - ldrb r1, [r2] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldr r0, =0x03005d00 - ldr r0, [r0] - str r0, [r3] - ldr r0, =sub_8038D64 - bl SetMainCallback2 - ldr r0, =0x0202433a - ldrb r0, [r0] - cmp r0, 0x1 - bne _08058794 - bl sub_817E3F4 -_08058794: - bl FreeAllWindowBuffers -_08058798: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80586F8 - - thumb_func_start sub_80587B0 -sub_80587B0: @ 80587B0 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08058832 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08058810 - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08058832 - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _080587F0 - bl sub_800AC34 - b _080587F4 - .pool -_080587F0: - bl sub_800ADF8 -_080587F4: - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_80586F8 - str r1, [r0] - b _08058832 - .pool -_08058810: - movs r0, 0x5A - bl m4aSongNumStop - ldr r2, =0x030022c0 - ldr r0, =0x00000439 - adds r3, r2, r0 - ldrb r1, [r3] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r3] - ldr r0, =0x03005d00 - ldr r0, [r0] - str r0, [r2] - ldr r0, [r2, 0x8] - bl SetMainCallback2 -_08058832: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80587B0 - - thumb_func_start sub_8058844 -sub_8058844: @ 8058844 - push {lr} - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - bne _08058868 - bl dp01_tbl1_exec_completed -_08058868: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8058844 - - thumb_func_start sub_805887C -sub_805887C: @ 805887C - push {lr} - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - bne _080588A0 - bl dp01_tbl1_exec_completed -_080588A0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_805887C - - thumb_func_start bx_802F7A0 -bx_802F7A0: @ 80588B4 - push {r4-r6,lr} - ldr r6, =0x02020630 - ldr r5, =0x020241e4 - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r6, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - bne _08058908 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - bl nullsub_25 - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - bl obj_free_rotscale_entry - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - bl RemoveObjectAndFreeTiles - bl dp01_tbl1_exec_completed -_08058908: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end bx_802F7A0 - - thumb_func_start sub_8058924 -sub_8058924: @ 8058924 - push {r4,lr} - ldr r4, =0x020244d0 - ldr r1, [r4] - ldr r3, =0x02024064 - ldrb r0, [r3] - ldr r2, [r1, 0x4] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r0, [r1, 0x9] - subs r0, 0x1 - strb r0, [r1, 0x9] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _0805895C - ldr r0, [r4] - ldrb r1, [r3] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strb r1, [r0, 0x9] - bl dp01_tbl1_exec_completed -_0805895C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8058924 - - thumb_func_start sub_805896C -sub_805896C: @ 805896C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r7, 0 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08058998 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _080589D0 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080589D0 -_08058998: - ldr r2, =0x02020630 - ldr r1, =0x03005d70 - ldr r3, =0x02024064 - ldrb r0, [r3] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - mov r10, r3 - cmp r1, r0 - bne _08058A0A - b _08058A0E - .pool -_080589D0: - ldr r3, =0x02020630 - ldr r6, =0x03005d70 - ldr r2, =0x02024064 - ldrb r4, [r2] - adds r0, r4, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r5, r3, 0 - adds r5, 0x1C - adds r0, r5 - ldr r3, [r0] - ldr r0, =DummyObjectCallback - mov r10, r2 - cmp r3, r0 - bne _08058A0A - movs r0, 0x2 - eors r4, r0 - adds r0, r4, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r0, [r0] - cmp r0, r3 - bne _08058A0A - movs r7, 0x1 -_08058A0A: - cmp r7, 0 - beq _08058B08 -_08058A0E: - ldr r0, =0x020244d0 - mov r9, r0 - ldr r0, [r0] - mov r6, r10 - ldrb r2, [r6] - ldr r3, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r4, r0, r3 - ldrb r1, [r4, 0x1] - movs r5, 0x1 - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _08058B08 - movs r1, 0x2 - mov r8, r1 - mov r1, r8 - eors r1, r2 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r1, [r0, 0x1] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _08058B08 - ldrb r1, [r4] - movs r3, 0x7F - adds r0, r3, 0 - ands r0, r1 - strb r0, [r4] - mov r2, r9 - ldr r0, [r2] - ldrb r2, [r6] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r4, 0x2 - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - strb r0, [r1, 0x1] - mov r0, r9 - ldr r2, [r0] - ldrb r0, [r6] - mov r1, r8 - eors r1, r0 - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - ands r3, r1 - strb r3, [r0] - mov r1, r9 - ldr r2, [r1] - ldrb r0, [r6] - mov r1, r8 - eors r1, r0 - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x1] - ands r4, r1 - strb r4, [r0, 0x1] - ldr r4, =0x000027f9 - adds r0, r4, 0 - bl FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - ldr r7, =0x0202406e - ldrb r1, [r6] - lsls r0, r1, 1 - adds r0, r7 - ldrh r0, [r0] - movs r5, 0x64 - muls r0, r5 - ldr r4, =0x020244ec - adds r0, r4 - bl sub_805E990 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08058AE4 - ldrb r0, [r6] - mov r1, r8 - eors r1, r0 - lsls r0, r1, 1 - adds r0, r7 - ldrh r0, [r0] - muls r0, r5 - adds r0, r4 - bl sub_805E990 -_08058AE4: - mov r2, r9 - ldr r0, [r2] - mov r2, r10 - ldrb r1, [r2] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x3 - strb r1, [r0, 0x9] - ldr r1, =0x03005d60 - mov r2, r10 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8058924 - str r1, [r0] -_08058B08: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805896C - - thumb_func_start sub_8058B40 -sub_8058B40: @ 8058B40 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r0, 0 - mov r9, r0 - mov r8, r0 - ldr r4, =0x020244d0 - ldr r0, [r4] - ldr r7, =0x02024064 - ldrb r2, [r7] - ldr r1, [r0, 0x4] - lsls r3, r2, 1 - adds r0, r3, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r5, 0x88 - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - bne _08058B80 - ldr r0, =0x0202406e - adds r0, r3, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r1, r0 - adds r0, r2, 0 - bl sub_8172EF0 -_08058B80: - ldr r1, [r4] - ldrb r0, [r7] - movs r6, 0x2 - adds r2, r6, 0 - eors r2, r0 - ldr r1, [r1, 0x4] - lsls r3, r2, 1 - adds r0, r3, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - bne _08058BB2 - ldr r0, =0x0202406e - adds r0, r3, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r1, r0 - adds r0, r2, 0 - bl sub_8172EF0 -_08058BB2: - ldr r0, [r4] - ldrb r2, [r7] - ldr r3, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r4, r0, r3 - ldrb r1, [r4] - movs r5, 0x8 - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - bne _08058C82 - adds r1, r6, 0 - eors r1, r2 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r1, [r0] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - bne _08058C82 - ldrb r1, [r4, 0x1] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08058C68 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08058C38 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _08058C38 - ldr r4, =0x03005d70 - ldrb r0, [r7] - adds r1, r6, 0 - eors r1, r0 - adds r0, r1, r4 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x020244ec - adds r1, r2 - movs r2, 0 - bl healthbar_draw_field_maybe - ldrb r0, [r7] - eors r0, r6 - bl sub_8076918 - ldrb r0, [r7] - eors r0, r6 - adds r0, r4 - ldrb r0, [r0] - bl sub_80729D0 -_08058C38: - ldr r5, =0x03005d70 - ldr r4, =0x02024064 - ldrb r1, [r4] - adds r0, r1, r5 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x020244ec - adds r1, r2 - movs r2, 0 - bl healthbar_draw_field_maybe - ldrb r0, [r4] - bl sub_8076918 - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - bl sub_80729D0 -_08058C68: - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x1] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0, 0x1] -_08058C82: - ldr r5, =0x020244d0 - ldr r0, [r5] - ldr r4, =0x02024064 - ldrb r2, [r4] - ldr r3, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r3 - ldrb r1, [r0, 0x1] - movs r0, 0xC0 - ands r0, r1 - cmp r0, 0x80 - bne _08058D32 - movs r1, 0x2 - eors r1, r2 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r1, [r0, 0x1] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _08058D32 - bl sub_80A36C8 - lsls r0, 24 - cmp r0, 0 - bne _08058D32 - ldr r0, [r5] - ldrb r1, [r4] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x1] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _08058D14 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x42 - ands r0, r1 - cmp r0, 0x42 - bne _08058D08 - ldr r0, =0x03007420 - bl m4aMPlayContinue - b _08058D14 - .pool -_08058D08: - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl MPlayVolumeControl -_08058D14: - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x1] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0, 0x1] - movs r0, 0x1 - mov r9, r0 -_08058D32: - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08058D52 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08058DAC - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08058DAC -_08058D52: - ldr r2, =0x02020630 - ldr r0, =0x03005d7c - ldr r1, =0x02024064 - ldrb r4, [r1] - adds r0, r4, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r3, [r0] - ldr r0, =DummyObjectCallback - cmp r3, r0 - bne _08058E0A - ldr r0, =0x020241e4 - adds r0, r4, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - cmp r0, r3 - bne _08058E0A - b _08058E06 - .pool -_08058DAC: - ldr r2, =0x02020630 - ldr r7, =0x03005d7c - ldr r0, =0x02024064 - ldrb r3, [r0] - adds r0, r3, r7 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r4, [r0] - ldr r0, =DummyObjectCallback - cmp r4, r0 - bne _08058E0A - ldr r6, =0x020241e4 - adds r0, r3, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r5, [r0] - cmp r5, r4 - bne _08058E0A - movs r0, 0x2 - eors r3, r0 - adds r0, r3, r7 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r4, [r0] - cmp r4, r5 - bne _08058E0A - adds r0, r3, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - cmp r0, r4 - bne _08058E0A -_08058E06: - movs r0, 0x1 - mov r8, r0 -_08058E0A: - mov r0, r9 - cmp r0, 0 - beq _08058EAA - mov r0, r8 - cmp r0, 0 - beq _08058EAA - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08058E48 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _08058E48 - ldr r2, =0x03005d7c - ldr r0, =0x02024064 - ldrb r1, [r0] - movs r0, 0x2 - eors r0, r1 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles -_08058E48: - ldr r1, =0x03005d7c - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - ldr r3, =0x020244d0 - ldr r0, [r3] - ldr r2, [r0, 0x8] - ldrb r1, [r2, 0x9] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x9] - ldr r0, [r3] - ldrb r2, [r4] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r0, 0x21 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1] - ldr r0, [r3] - ldrb r2, [r4] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r0, 0x7F - ands r0, r2 - strb r0, [r1, 0x1] - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805896C - str r1, [r0] -_08058EAA: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8058B40 - - thumb_func_start sub_8058EDC -sub_8058EDC: @ 8058EDC - push {r4-r6,lr} - ldr r2, =0x02020630 - ldr r0, =0x03005d70 - ldr r6, =0x02024064 - ldrb r3, [r6] - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r4, [r0] - ldr r0, =DummyObjectCallback - cmp r4, r0 - bne _08058F94 - ldr r5, =0x020244d0 - ldr r0, [r5] - ldr r1, [r0, 0x4] - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x1] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08058F94 - ldr r0, =0x020241e4 - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - cmp r0, r4 - bne _08058F94 - adds r0, r3, 0 - bl sub_805E408 - ldr r0, [r5] - ldrb r2, [r6] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x7F - ands r0, r2 - strb r0, [r1] - ldr r0, [r5] - ldrb r2, [r6] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1] - ldr r4, =0x000027f9 - adds r0, r4, 0 - bl FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - ldr r0, [r5] - ldrb r2, [r6] - ldr r1, [r0] - lsls r0, r2, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08058F88 - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x6 - bl move_anim_start_t4 -_08058F88: - ldr r0, =0x03005d60 - ldrb r1, [r6] - lsls r1, 2 - adds r1, r0 - ldr r0, =sub_8058FC0 - str r0, [r1] -_08058F94: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8058EDC - - thumb_func_start sub_8058FC0 -sub_8058FC0: @ 8058FC0 - push {r4,lr} - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r4, =0x02024064 - ldrb r1, [r4] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0805900E - bl sub_80A36C8 - lsls r0, 24 - cmp r0, 0 - bne _0805900E - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl MPlayVolumeControl - ldr r2, =0x0202406e - ldrb r1, [r4] - lsls r0, r1, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =0x020244ec - adds r0, r2 - bl sub_805E990 - bl dp01_tbl1_exec_completed -_0805900E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8058FC0 - - thumb_func_start sub_805902C -sub_805902C: @ 805902C - push {r4-r6,lr} - ldr r6, =0x020244d0 - ldr r0, [r6] - ldr r5, =0x02024064 - ldrb r2, [r5] - ldr r1, [r0, 0x4] - lsls r3, r2, 1 - adds r0, r3, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x88 - ands r0, r1 - cmp r0, 0 - bne _0805905E - ldr r0, =0x0202406e - adds r0, r3, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r1, r0 - adds r0, r2, 0 - bl sub_8172EF0 -_0805905E: - ldr r4, =0x02020630 - ldr r0, =0x03005d7c - ldrb r2, [r5] - adds r0, r2, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r3, r0, 2 - adds r0, r4, 0 - adds r0, 0x1C - adds r0, r3, r0 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - bne _080590D2 - ldr r0, [r6] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - bne _080590D2 - adds r0, r3, r4 - bl RemoveObjectAndFreeTiles - ldr r4, =0x03005d70 - ldrb r1, [r5] - adds r0, r1, r4 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x020244ec - adds r1, r2 - movs r2, 0 - bl healthbar_draw_field_maybe - ldrb r0, [r5] - bl sub_8076918 - ldrb r0, [r5] - adds r0, r4 - ldrb r0, [r0] - bl sub_80729D0 - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8058EDC - str r1, [r0] -_080590D2: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805902C - - thumb_func_start c3_0802FDF4 -c3_0802FDF4: @ 8059100 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80A36C8 - lsls r0, 24 - cmp r0, 0 - bne _08059122 - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl MPlayVolumeControl - adds r0, r4, 0 - bl remove_task -_08059122: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end c3_0802FDF4 - - thumb_func_start bx_t1_healthbar_update -bx_t1_healthbar_update: @ 8059130 - push {r4-r6,lr} - ldr r5, =0x02024064 - ldrb r0, [r5] - ldr r6, =0x03005d70 - adds r1, r0, r6 - ldrb r1, [r1] - movs r2, 0 - movs r3, 0 - bl sub_8074AA0 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldrb r0, [r5] - adds r0, r6 - ldrb r0, [r0] - bl sub_80729D0 - lsls r4, 16 - asrs r1, r4, 16 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08059178 - ldrb r0, [r5] - adds r0, r6 - ldrb r0, [r0] - movs r2, 0 - bl heathbar_draw_hp - b _08059192 - .pool -_08059178: - ldr r2, =0x0202406e - ldrb r1, [r5] - lsls r0, r1, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =0x020244ec - adds r0, r2 - bl sub_805E990 - bl dp01_tbl1_exec_completed -_08059192: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end bx_t1_healthbar_update - - thumb_func_start sub_80591A0 -sub_80591A0: @ 80591A0 - push {lr} - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _080591B2 - bl dp01_tbl1_exec_completed -_080591B2: - pop {r0} - bx r0 - thumb_func_end sub_80591A0 - - thumb_func_start sub_80591B8 -sub_80591B8: @ 80591B8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldr r1, =0x03005e00 - lsls r0, 2 - add r0, r9 - lsls r0, 3 - adds r0, r1 - mov r8, r0 - ldrb r0, [r0, 0x8] - mov r10, r0 - mov r1, r8 - ldrb r7, [r1, 0xC] - str r7, [sp, 0x8] - ldrh r2, [r1, 0xA] - str r2, [sp, 0xC] - bl battle_type_is_double - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080591FE - ldr r1, =0x0202406e - lsls r0, r7, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r10, r0 - bne _080591FE - b _08059314 -_080591FE: - movs r0, 0x64 - mov r1, r10 - muls r1, r0 - ldr r0, =0x020244ec - adds r6, r1, r0 - adds r0, r6, 0 - movs r1, 0xB - bl pokemon_getattr - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r6, 0 - movs r1, 0x38 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r6, 0 - movs r1, 0x19 - bl pokemon_getattr - str r0, [sp, 0x4] - ldr r3, =gExperienceTables - adds r4, 0x1 - lsls r4, 2 - ldr r2, =gBaseStats - lsls r1, r5, 3 - subs r1, r5 - lsls r1, 2 - adds r1, r2 - ldrb r2, [r1, 0x13] - movs r1, 0xCA - lsls r1, 1 - muls r1, r2 - adds r4, r1 - adds r4, r3 - ldr r2, [r4] - str r2, [sp] - ldr r3, [sp, 0xC] - lsls r1, r3, 16 - asrs r1, 16 - adds r0, r1 - cmp r0, r2 - bcc _080592EC - adds r0, r6, 0 - movs r1, 0x19 - mov r2, sp - bl pokemon_setattr - adds r0, r6, 0 - bl pokemon_calc_effective_stats - ldr r2, [sp] - add r0, sp, 0x4 - ldrh r0, [r0] - subs r2, r0 - ldr r0, [sp, 0xC] - subs r2, r0, r2 - ldr r4, =0x02024064 - ldrb r5, [r4] - strb r7, [r4] - lsls r2, 16 - lsrs r2, 16 - movs r0, 0x1 - movs r1, 0xB - bl dp01_build_cmdbuf_x21_a_bb - strb r5, [r4] - bl battle_type_is_double - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080592D4 - ldr r2, =0x0202406e - lsls r0, r7, 1 - adds r0, r2 - mov r1, r10 - ldrh r0, [r0] - cmp r1, r0 - beq _080592B2 - movs r0, 0x2 - eors r7, r0 - lsls r0, r7, 1 - adds r0, r2 - ldrh r0, [r0] - cmp r1, r0 - bne _080592D4 -_080592B2: - ldr r0, =sub_8059544 - b _08059316 - .pool -_080592D4: - ldr r0, =0x03005e00 - mov r2, r9 - lsls r1, r2, 2 - add r1, r9 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_805965C - b _08059318 - .pool -_080592EC: - str r0, [sp, 0x4] - add r2, sp, 0x4 - adds r0, r6, 0 - movs r1, 0x19 - bl pokemon_setattr - ldr r1, =0x03005d60 - ldr r3, [sp, 0x8] - lsls r0, r3, 2 - adds r0, r1 - ldr r1, =sub_80591A0 - str r1, [r0] - mov r0, r9 - bl remove_task - b _0805931A - .pool -_08059314: - ldr r0, =sub_8059330 -_08059316: - mov r1, r8 -_08059318: - str r0, [r1] -_0805931A: - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80591B8 - - thumb_func_start sub_8059330 -sub_8059330: @ 8059330 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005e00 - lsls r2, r0, 2 - mov r8, r2 - add r8, r0 - mov r0, r8 - lsls r0, 3 - mov r8, r0 - add r8, r1 - mov r2, r8 - ldrb r1, [r2, 0x8] - movs r0, 0xA - ldrsh r2, [r2, r0] - mov r9, r2 - mov r2, r8 - ldrb r2, [r2, 0xC] - mov r10, r2 - movs r0, 0x64 - adds r6, r1, 0 - muls r6, r0 - ldr r0, =0x020244ec - adds r6, r0 - adds r0, r6, 0 - movs r1, 0x38 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r6, 0 - movs r1, 0xB - bl pokemon_getattr - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r6, 0 - movs r1, 0x19 - bl pokemon_getattr - adds r3, r0, 0 - ldr r6, =gExperienceTables - lsls r1, r4, 2 - ldr r2, =gBaseStats - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - adds r0, r2 - ldrb r2, [r0, 0x13] - movs r0, 0xCA - lsls r0, 1 - muls r0, r2 - adds r1, r0 - adds r1, r6 - ldr r1, [r1] - subs r3, r1 - adds r4, 0x1 - lsls r4, 2 - adds r4, r0 - adds r4, r6 - ldr r2, [r4] - subs r2, r1 - ldr r0, =0x03005d70 - add r0, r10 - ldrb r1, [r0] - mov r0, r9 - negs r0, r0 - str r0, [sp] - mov r0, r10 - bl sub_807294C - movs r0, 0x21 - bl audio_play - ldr r0, =sub_8059400 - mov r1, r8 - str r0, [r1] - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8059330 - - thumb_func_start sub_8059400 -sub_8059400: @ 8059400 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r1, =0x03005e00 - lsls r0, 2 - add r0, r8 - lsls r0, 3 - adds r6, r0, r1 - ldrh r1, [r6, 0x1C] - movs r2, 0x1C - ldrsh r0, [r6, r2] - cmp r0, 0xC - bgt _08059430 - adds r0, r1, 0x1 - strh r0, [r6, 0x1C] - b _0805952C - .pool -_08059430: - ldrb r0, [r6, 0x8] - mov r9, r0 - ldrh r2, [r6, 0xA] - mov r10, r2 - ldrb r7, [r6, 0xC] - ldr r5, =0x03005d70 - adds r5, r7, r5 - ldrb r1, [r5] - adds r0, r7, 0 - movs r2, 0x1 - movs r3, 0 - bl sub_8074AA0 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldrb r0, [r5] - bl sub_80729D0 - lsls r4, 16 - asrs r4, 16 - movs r0, 0x1 - negs r0, r0 - cmp r4, r0 - bne _0805952C - movs r0, 0x21 - bl m4aSongNumStop - movs r0, 0x64 - mov r1, r9 - muls r1, r0 - ldr r0, =0x020244ec - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x38 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x19 - bl pokemon_getattr - str r0, [sp, 0x4] - adds r0, r5, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - ldr r3, =gExperienceTables - adds r4, 0x1 - lsls r4, 2 - ldr r2, =gBaseStats - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r1, [r1, 0x13] - movs r0, 0xCA - lsls r0, 1 - muls r0, r1 - adds r4, r0 - adds r4, r3 - ldr r1, [r4] - str r1, [sp] - mov r2, r10 - lsls r0, r2, 16 - asrs r4, r0, 16 - ldr r0, [sp, 0x4] - adds r0, r4 - cmp r0, r1 - blt _08059510 - adds r0, r5, 0 - movs r1, 0x19 - mov r2, sp - bl pokemon_setattr - adds r0, r5, 0 - bl pokemon_calc_effective_stats - ldr r2, [sp] - add r0, sp, 0x4 - ldrh r0, [r0] - subs r2, r0 - subs r2, r4, r2 - ldr r4, =0x02024064 - ldrb r5, [r4] - strb r7, [r4] - lsls r2, 16 - lsrs r2, 16 - movs r0, 0x1 - movs r1, 0xB - bl dp01_build_cmdbuf_x21_a_bb - strb r5, [r4] - ldr r0, =sub_8059544 - str r0, [r6] - b _0805952C - .pool -_08059510: - str r0, [sp, 0x4] - add r2, sp, 0x4 - adds r0, r5, 0 - movs r1, 0x19 - bl pokemon_setattr - ldr r1, =0x03005d60 - lsls r0, r7, 2 - adds r0, r1 - ldr r1, =sub_80591A0 - str r1, [r0] - mov r0, r8 - bl remove_task -_0805952C: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8059400 - - thumb_func_start sub_8059544 -sub_8059544: @ 8059544 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldrb r4, [r0, 0xC] - ldrb r6, [r0, 0x8] - bl battle_type_is_double - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08059578 - ldr r1, =0x0202406e - movs r0, 0x2 - adds r2, r4, 0 - eors r2, r0 - lsls r0, r2, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r6, r0 - bne _08059578 - adds r4, r2, 0 -_08059578: - adds r0, r4, 0 - adds r1, r4, 0 - adds r2, r4, 0 - movs r3, 0 - bl move_anim_start_t4 - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80595A4 - str r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8059544 - - thumb_func_start sub_80595A4 -sub_80595A4: @ 80595A4 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r2, r0, r1 - ldrb r5, [r2, 0xC] - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0, 0x4] - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _08059646 - ldrb r4, [r2, 0x8] - movs r0, 0x64 - adds r1, r4, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r7, r1, r0 - adds r0, r7, 0 - movs r1, 0x38 - bl pokemon_getattr - bl battle_type_is_double - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08059624 - ldr r1, =0x0202406e - movs r0, 0x2 - adds r2, r5, 0 - eors r2, r0 - lsls r0, r2, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r4, r0 - bne _08059624 - ldr r0, =0x03005d70 - adds r0, r2, r0 - ldrb r0, [r0] - adds r1, r7, 0 - movs r2, 0 - bl healthbar_draw_field_maybe - b _08059638 - .pool -_08059624: - ldr r0, =0x03005d70 - adds r0, r5, r0 - ldrb r0, [r0] - movs r1, 0x64 - muls r1, r4 - ldr r2, =0x020244ec - adds r1, r2 - movs r2, 0 - bl healthbar_draw_field_maybe -_08059638: - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_805965C - str r0, [r1] -_08059646: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80595A4 - - thumb_func_start sub_805965C -sub_805965C: @ 805965C - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =0x03005e00 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r0 - ldrb r1, [r4, 0x8] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x38 - bl pokemon_getattr - ldrb r0, [r4, 0xC] - ldr r1, =0x03005d60 - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_80591A0 - str r1, [r0] - adds r0, r5, 0 - bl remove_task - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805965C - - thumb_func_start sub_80596A8 -sub_80596A8: @ 80596A8 - push {r4-r6,lr} - ldr r6, =0x02020630 - ldr r5, =0x020241e4 - ldr r4, =0x02024064 - ldrb r2, [r4] - adds r0, r2, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r3, 0x22 - ldrsh r1, [r0, r3] - movs r3, 0x26 - ldrsh r0, [r0, r3] - adds r1, r0 - cmp r1, 0xA0 - ble _08059724 - ldr r1, =0x0202406e - lsls r0, r2, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - bl nullsub_24 - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - bl RemoveObjectAndFreeTiles - ldr r1, =0x03005d70 - ldrb r0, [r4] - adds r0, r1 - ldrb r0, [r0] - bl sub_8072984 - bl dp01_tbl1_exec_completed -_08059724: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80596A8 - - thumb_func_start sub_8059744 -sub_8059744: @ 8059744 - push {r4-r6,lr} - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r6, =0x02024064 - ldrb r2, [r6] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _08059798 - ldr r5, =0x020241e4 - adds r0, r2, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl obj_free_rotscale_entry - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r1, =0x03005d70 - ldrb r0, [r6] - adds r0, r1 - ldrb r0, [r0] - bl sub_8072984 - bl dp01_tbl1_exec_completed -_08059798: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8059744 - - thumb_func_start sub_80597B4 -sub_80597B4: @ 80597B4 - push {lr} - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _080597C6 - bl dp01_tbl1_exec_completed -_080597C6: - pop {r0} - bx r0 - thumb_func_end sub_80597B4 - - thumb_func_start sub_80597CC -sub_80597CC: @ 80597CC - push {r4,lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0805980A - ldr r1, =0x03005d60 - ldr r2, =0x02024064 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8059828 - str r1, [r0] - ldr r3, =0x03005e00 - ldr r1, =0x03005d7c - ldrb r0, [r2] - adds r0, r1 - ldrb r0, [r0] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r3 - ldrb r4, [r1, 0x8] - bl remove_task - bl FreeAllWindowBuffers - adds r0, r4, 0 - bl sub_81B89AC -_0805980A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80597CC - - thumb_func_start sub_8059828 -sub_8059828: @ 8059828 - push {lr} - ldr r0, =0x030022c0 - ldr r1, [r0, 0x4] - ldr r0, =sub_8038420 - cmp r1, r0 - bne _08059898 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08059898 - ldr r0, =0x0203cee8 - ldrb r0, [r0] - cmp r0, 0x1 - bne _08059870 - ldr r0, =0x0203cee9 - ldrb r1, [r0] - ldr r2, =0x0203cf00 - movs r0, 0x1 - bl dp01_build_cmdbuf_x22_a_three_bytes - b _0805987A - .pool -_08059870: - movs r0, 0x1 - movs r1, 0x6 - movs r2, 0 - bl dp01_build_cmdbuf_x22_a_three_bytes -_0805987A: - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x1 - bne _08059894 - bl b_link_standby_message -_08059894: - bl dp01_tbl1_exec_completed -_08059898: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8059828 - - thumb_func_start sub_80598A4 -sub_80598A4: @ 80598A4 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080598CC - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_80598E0 - str r1, [r0] - bl nullsub_35 - bl FreeAllWindowBuffers - bl sub_81AABB0 -_080598CC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80598A4 - - thumb_func_start sub_80598E0 -sub_80598E0: @ 80598E0 - push {lr} - ldr r0, =0x030022c0 - ldr r1, [r0, 0x4] - ldr r0, =sub_8038420 - cmp r1, r0 - bne _08059906 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08059906 - ldr r0, =0x0203ce7c - ldrh r1, [r0] - movs r0, 0x1 - bl dp01_build_cmdbuf_x23_aa_0 - bl dp01_tbl1_exec_completed -_08059906: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80598E0 - - thumb_func_start bx_wait_t1 -bx_wait_t1: @ 805991C - push {lr} - ldr r0, =0x020244b9 - ldrb r0, [r0] - cmp r0, 0 - beq _08059942 - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _08059946 -_08059942: - bl dp01_tbl1_exec_completed -_08059946: - pop {r0} - bx r0 - .pool - thumb_func_end bx_wait_t1 - - thumb_func_start bx_blink_t1 -bx_blink_t1: @ 8059958 - push {r4,lr} - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - ldr r2, =0x02020630 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, r0, r2 - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0x20 - bne _080599A4 - movs r3, 0 - movs r0, 0 - strh r0, [r4, 0x30] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - subs r0, 0x5 - ands r0, r1 - strb r0, [r2] - ldr r0, =0x020244b9 - strb r3, [r0] - bl dp01_tbl1_exec_completed - b _080599CE - .pool -_080599A4: - ldrh r0, [r4, 0x30] - movs r1, 0x3 - ands r0, r1 - cmp r0, 0 - bne _080599C8 - adds r3, r4, 0 - adds r3, 0x3E - ldrb r2, [r3] - lsls r0, r2, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] -_080599C8: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] -_080599CE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end bx_blink_t1 - - thumb_func_start sub_80599D4 -sub_80599D4: @ 80599D4 - push {r4,lr} - sub sp, 0x4 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08059A02 - ldr r4, =0x03005d74 - ldrb r0, [r4] - cmp r0, 0 - beq _08059A02 - movs r0, 0x5 - bl audio_play - ldrb r0, [r4] - bl sub_8056BAC - movs r0, 0 - strb r0, [r4] - movs r0, 0 - bl sub_8056B74 -_08059A02: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08059A2C - ldr r4, =0x03005d74 - ldrb r0, [r4] - cmp r0, 0 - bne _08059A2C - movs r0, 0x5 - bl audio_play - ldrb r0, [r4] - bl sub_8056BAC - movs r0, 0x1 - strb r0, [r4] - movs r0, 0x1 - bl sub_8056B74 -_08059A2C: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r2, 0x1 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _08059A7A - str r2, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - movs r0, 0x5 - bl audio_play - ldr r0, =0x03005d74 - ldrb r0, [r0] - cmp r0, 0 - beq _08059A6C - movs r0, 0x1 - movs r1, 0xE - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb - b _08059A76 - .pool -_08059A6C: - movs r0, 0x1 - movs r1, 0xD - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb -_08059A76: - bl dp01_tbl1_exec_completed -_08059A7A: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08059AA0 - movs r0, 0x1 - str r0, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - movs r0, 0x5 - bl audio_play - bl dp01_tbl1_exec_completed -_08059AA0: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80599D4 - - thumb_func_start sub_8059AAC -sub_8059AAC: @ 8059AAC - push {r4-r7,lr} - ldr r0, =0x02024064 - ldrb r1, [r0] - lsls r1, 9 - ldr r3, =0x02023068 - ldr r2, =0x03005d78 - movs r0, 0 - strb r0, [r2] - movs r5, 0 - ldr r7, =0x02022e2c - adds r4, r1, r3 - adds r6, r2, 0 -_08059AC4: - lsls r0, r5, 24 - lsrs r0, 24 - bl battle_menu_cursor_related - ldrh r1, [r4] - movs r0, 0xD - muls r1, r0 - ldr r0, =gMoveNames - adds r1, r0 - adds r0, r7, 0 - bl CopyString - adds r1, r5, 0x3 - lsls r1, 24 - lsrs r1, 24 - adds r0, r7, 0 - bl battle_show_message_maybe - ldrh r0, [r4] - cmp r0, 0 - beq _08059AF4 - ldrb r0, [r6] - adds r0, 0x1 - strb r0, [r6] -_08059AF4: - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _08059AC4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8059AAC - - thumb_func_start sub_8059B18 -sub_8059B18: @ 8059B18 - push {r4,lr} - ldr r4, =0x02022e2c - ldr r1, =gUnknown_085CCA6F - adds r0, r4, 0 - bl CopyString - adds r0, r4, 0 - movs r1, 0x7 - bl battle_show_message_maybe - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8059B18 - - thumb_func_start sub_8059B3C -sub_8059B3C: @ 8059B3C - push {r4-r7,lr} - ldr r5, =0x02023064 - ldr r7, =0x02024064 - ldrb r0, [r7] - lsls r0, 9 - adds r1, r5, 0x2 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _08059B98 - bl sub_814FBAC - ldrb r1, [r7] - lsls r4, r1, 9 - adds r0, r5, 0x4 - adds r4, r0 - ldr r6, =0x02022e2c - ldr r5, =0x020244b0 - adds r1, r5 - adds r0, r4, 0 - adds r0, 0x8 - ldrb r1, [r1] - adds r0, r1 - ldrb r1, [r0] - adds r0, r6, 0 - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalString - movs r1, 0xBA - strb r1, [r0] - adds r0, 0x1 - ldrb r1, [r7] - adds r1, r5 - adds r4, 0xC - ldrb r1, [r1] - adds r4, r1 - ldrb r1, [r4] - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalString - adds r0, r6, 0 - movs r1, 0x9 - bl battle_show_message_maybe -_08059B98: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8059B3C - - thumb_func_start sub_8059BB0 -sub_8059BB0: @ 8059BB0 - push {r4-r6,lr} - ldr r5, =0x02024064 - ldrb r4, [r5] - lsls r4, 9 - ldr r0, =0x02023068 - adds r4, r0 - ldr r6, =0x02022e2c - ldr r1, =gUnknown_085CCA73 - adds r0, r6, 0 - bl CopyString - movs r1, 0xFC - strb r1, [r0] - adds r0, 0x1 - movs r1, 0x6 - strb r1, [r0] - adds r0, 0x1 - movs r1, 0x1 - strb r1, [r0] - adds r0, 0x1 - ldr r3, =gBattleMoves - ldr r2, =0x020244b0 - ldrb r1, [r5] - adds r1, r2 - ldrb r1, [r1] - lsls r1, 1 - adds r4, r1 - ldrh r2, [r4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r3 - ldrb r2, [r1, 0x2] - lsls r1, r2, 3 - subs r1, r2 - ldr r2, =gTypeNames - adds r1, r2 - bl CopyString - adds r0, r6, 0 - movs r1, 0xA - bl battle_show_message_maybe - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8059BB0 - - thumb_func_start battle_menu_cursor_related_2 -battle_menu_cursor_related_2: @ 8059C28 - push {lr} - sub sp, 0x10 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - lsls r1, 24 - lsrs r1, 24 - add r2, sp, 0xC - adds r0, r1, 0x1 - strh r0, [r2] - adds r0, r2, 0 - adds r1, 0x2 - strh r1, [r0, 0x2] - movs r1, 0x1 - adds r0, r3, 0 - ands r0, r1 - lsls r2, r0, 3 - adds r2, r0 - adds r2, 0x1 - movs r0, 0x2 - ands r3, r0 - adds r3, 0x37 - str r1, [sp] - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0 - add r1, sp, 0xC - bl CopyToBgTilemapBufferRect_ChangePalette - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0x10 - pop {r0} - bx r0 - thumb_func_end battle_menu_cursor_related_2 - - thumb_func_start battle_menu_cursor_related -battle_menu_cursor_related: @ 8059C70 - push {lr} - sub sp, 0x10 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - add r0, sp, 0xC - ldr r1, =0x00001016 - strh r1, [r0] - strh r1, [r0, 0x2] - movs r1, 0x1 - adds r0, r3, 0 - ands r0, r1 - lsls r2, r0, 3 - adds r2, r0 - adds r2, 0x1 - movs r0, 0x2 - ands r3, r0 - adds r3, 0x37 - str r1, [sp] - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0 - add r1, sp, 0xC - bl CopyToBgTilemapBufferRect_ChangePalette - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0x10 - pop {r0} - bx r0 - .pool - thumb_func_end battle_menu_cursor_related - - thumb_func_start sub_8059CB4 -sub_8059CB4: @ 8059CB4 - push {r4,lr} - sub sp, 0x10 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - add r0, sp, 0xC - movs r4, 0x1 - strh r4, [r0] - movs r1, 0x2 - strh r1, [r0, 0x2] - adds r0, r3, 0 - ands r0, r4 - lsls r2, r0, 3 - subs r2, r0 - adds r2, 0x10 - lsls r2, 24 - lsrs r2, 24 - ands r3, r1 - adds r3, 0x23 - str r4, [sp] - str r1, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0 - add r1, sp, 0xC - bl CopyToBgTilemapBufferRect_ChangePalette - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8059CB4 - - thumb_func_start sub_8059CF8 -sub_8059CF8: @ 8059CF8 - push {lr} - sub sp, 0x10 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - add r0, sp, 0xC - ldr r1, =0x00001016 - strh r1, [r0] - strh r1, [r0, 0x2] - movs r1, 0x1 - adds r0, r3, 0 - ands r0, r1 - lsls r2, r0, 3 - subs r2, r0 - adds r2, 0x10 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x2 - ands r3, r0 - adds r3, 0x23 - str r1, [sp] - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0 - add r1, sp, 0xC - bl CopyToBgTilemapBufferRect_ChangePalette - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0x10 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8059CF8 - - thumb_func_start sub_8059D40 -sub_8059D40: @ 8059D40 - push {lr} - ldr r0, =sub_80A92F8 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8059D40 - - thumb_func_start sub_8059D50 -sub_8059D50: @ 8059D50 - push {lr} - ldr r0, =sub_80A92F8 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8059D50 - - thumb_func_start sub_8059D60 -sub_8059D60: @ 8059D60 - push {lr} - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _08059D82 - bl dp01_tbl1_exec_completed -_08059D82: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8059D60 - - thumb_func_start bx_8030B2C -bx_8030B2C: @ 8059D90 - push {lr} - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _08059DB2 - bl dp01_tbl1_exec_completed -_08059DB2: - pop {r0} - bx r0 - .pool - thumb_func_end bx_8030B2C - - thumb_func_start b_link_standby_message -b_link_standby_message: @ 8059DC0 - push {lr} - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08059DE0 - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r0, =gUnknown_085CCA29 - movs r1, 0 - bl battle_show_message_maybe -_08059DE0: - pop {r0} - bx r0 - .pool - thumb_func_end b_link_standby_message - - thumb_func_start dp01t_00_1_getattr -dp01t_00_1_getattr: @ 8059DF4 - push {r4-r6,lr} - sub sp, 0x100 - movs r6, 0 - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x2 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0 - bne _08059E2C - ldr r0, =0x0202406e - lsls r1, r2, 1 - adds r1, r0 - ldrb r0, [r1] - mov r1, sp - bl dp01_getattr_by_ch1_for_player_pokemon_ - adds r6, r0, 0 - b _08059E4E - .pool -_08059E2C: - ldrb r4, [r1] - movs r5, 0 -_08059E30: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _08059E46 - lsls r0, r5, 24 - lsrs r0, 24 - mov r2, sp - adds r1, r2, r6 - bl dp01_getattr_by_ch1_for_player_pokemon_ - adds r6, r0 -_08059E46: - lsrs r4, 1 - adds r5, 0x1 - cmp r5, 0x5 - ble _08059E30 -_08059E4E: - lsls r1, r6, 16 - lsrs r1, 16 - movs r0, 0x1 - mov r2, sp - bl dp01_build_cmdbuf_x1D_1D_numargs_varargs - bl dp01_tbl1_exec_completed - add sp, 0x100 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end dp01t_00_1_getattr - - thumb_func_start dp01_getattr_by_ch1_for_player_pokemon_ -dp01_getattr_by_ch1_for_player_pokemon_: @ 8059E68 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x90 - adds r7, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - movs r6, 0 - ldr r2, =0x02023064 - ldr r3, =0x02024064 - ldrb r0, [r3] - lsls r0, 9 - adds r1, r2, 0x1 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3B - bls _08059E92 - bl _0805A5FE -_08059E92: - lsls r0, 2 - ldr r1, =_08059EA8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08059EA8: - .4byte _08059F98 - .4byte _0805A1BC - .4byte _0805A1CC - .4byte _0805A1DC - .4byte _0805A244 - .4byte _0805A244 - .4byte _0805A244 - .4byte _0805A244 - .4byte _0805A260 - .4byte _0805A29C - .4byte _0805A29C - .4byte _0805A29C - .4byte _0805A29C - .4byte _0805A5FE - .4byte _0805A5FE - .4byte _0805A5FE - .4byte _0805A5FE - .4byte _0805A2B8 - .4byte _0805A2C8 - .4byte _0805A2F8 - .4byte _0805A308 - .4byte _0805A318 - .4byte _0805A328 - .4byte _0805A338 - .4byte _0805A348 - .4byte _0805A358 - .4byte _0805A368 - .4byte _0805A378 - .4byte _0805A388 - .4byte _0805A398 - .4byte _0805A3A8 - .4byte _0805A3B8 - .4byte _0805A408 - .4byte _0805A418 - .4byte _0805A428 - .4byte _0805A438 - .4byte _0805A448 - .4byte _0805A458 - .4byte _0805A468 - .4byte _0805A478 - .4byte _0805A488 - .4byte _0805A4BC - .4byte _0805A4CC - .4byte _0805A4DC - .4byte _0805A4EC - .4byte _0805A4FC - .4byte _0805A50C - .4byte _0805A51C - .4byte _0805A52C - .4byte _0805A54C - .4byte _0805A55C - .4byte _0805A56C - .4byte _0805A57C - .4byte _0805A58C - .4byte _0805A59C - .4byte _0805A5AC - .4byte _0805A5BC - .4byte _0805A5CC - .4byte _0805A5DC - .4byte _0805A5EC -_08059F98: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - mov r1, sp - strh r0, [r1] - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x2E] - movs r6, 0 - add r0, sp, 0x24 - mov r9, r0 - movs r1, 0x3B - add r1, sp - mov r10, r1 - mov r2, sp - adds r2, 0x2B - str r2, [sp, 0x80] - mov r0, sp - adds r0, 0x2A - str r0, [sp, 0x7C] - mov r1, sp - adds r1, 0x68 - str r1, [sp, 0x8C] - adds r2, 0x5 - str r2, [sp, 0x84] - adds r0, 0x12 - str r0, [sp, 0x88] - mov r8, r4 - add r4, sp, 0xC -_08059FE4: - adds r1, r6, 0 - adds r1, 0xD - mov r0, r8 - bl pokemon_getattr - strh r0, [r4] - adds r1, r6, 0 - adds r1, 0x11 - mov r0, r8 - bl pokemon_getattr - mov r2, r9 - adds r1, r2, r6 - strb r0, [r1] - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - ble _08059FE4 - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x15 - bl pokemon_getattr - mov r1, r10 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x20 - bl pokemon_getattr - ldr r2, [sp, 0x80] - strb r0, [r2] - adds r0, r4, 0 - movs r1, 0x19 - bl pokemon_getattr - str r0, [sp, 0x44] - adds r0, r4, 0 - movs r1, 0x27 - bl pokemon_getattr - mov r3, sp - movs r5, 0x1F - ands r0, r5 - ldrb r2, [r3, 0x14] - movs r1, 0x20 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x14] - adds r0, r4, 0 - movs r1, 0x28 - bl pokemon_getattr - mov r3, sp - movs r6, 0x1F - ands r0, r6 - lsls r0, 5 - ldrh r2, [r3, 0x14] - ldr r1, =0xfffffc1f - ands r1, r2 - orrs r1, r0 - strh r1, [r3, 0x14] - adds r0, r4, 0 - movs r1, 0x29 - bl pokemon_getattr - mov r3, sp - ands r0, r5 - lsls r0, 2 - ldrb r2, [r3, 0x15] - movs r1, 0x7D - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x15] - adds r0, r4, 0 - movs r1, 0x2A - bl pokemon_getattr - movs r1, 0x1F - ands r1, r0 - lsls r1, 15 - ldr r0, [sp, 0x14] - ldr r2, =0xfff07fff - ands r0, r2 - orrs r0, r1 - str r0, [sp, 0x14] - adds r0, r4, 0 - movs r1, 0x2B - bl pokemon_getattr - mov r3, sp - ands r0, r6 - lsls r0, 4 - ldrh r2, [r3, 0x16] - ldr r1, =0xfffffe0f - ands r1, r2 - orrs r1, r0 - strh r1, [r3, 0x16] - adds r0, r4, 0 - movs r1, 0x2C - bl pokemon_getattr - mov r3, sp - ands r0, r5 - lsls r0, 1 - ldrb r2, [r3, 0x17] - movs r1, 0x3F - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x17] - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - str r0, [sp, 0x48] - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr - str r0, [sp, 0x4C] - adds r0, r4, 0 - movs r1, 0x38 - bl pokemon_getattr - ldr r1, [sp, 0x7C] - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x28] - adds r0, r4, 0 - movs r1, 0x3A - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x2C] - adds r0, r4, 0 - movs r1, 0x3B - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x2] - adds r0, r4, 0 - movs r1, 0x3C - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x4] - adds r0, r4, 0 - movs r1, 0x3D - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x6] - adds r0, r4, 0 - movs r1, 0x3E - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x8] - adds r0, r4, 0 - movs r1, 0x3F - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0xA] - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - mov r3, sp - movs r1, 0x1 - ands r0, r1 - lsls r0, 6 - ldrb r2, [r3, 0x17] - movs r1, 0x41 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x17] - adds r0, r4, 0 - movs r1, 0x2E - bl pokemon_getattr - mov r3, sp - lsls r0, 7 - ldrb r2, [r3, 0x17] - movs r1, 0x7F - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x17] - adds r0, r4, 0 - movs r1, 0x1 - bl pokemon_getattr - str r0, [sp, 0x54] - adds r0, r4, 0 - movs r1, 0x2 - ldr r2, [sp, 0x8C] - bl pokemon_getattr - ldr r0, [sp, 0x84] - ldr r1, [sp, 0x8C] - bl CopyString_Limit10 - adds r0, r4, 0 - movs r1, 0x7 - ldr r2, [sp, 0x88] - bl pokemon_getattr - mov r2, sp - movs r6, 0 -_0805A19C: - adds r0, r7, r6 - adds r1, r2, r6 - ldrb r1, [r1] - strb r1, [r0] - adds r6, 0x1 - cmp r6, 0x57 - bls _0805A19C - b _0805A5FE - .pool -_0805A1BC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - b _0805A536 - .pool -_0805A1CC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xC - b _0805A536 - .pool -_0805A1DC: - movs r6, 0 - add r2, sp, 0x58 - mov r9, r2 - add r0, sp, 0x60 - mov r10, r0 - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - mov r8, r9 -_0805A1F2: - adds r1, r6, 0 - adds r1, 0xD - adds r0, r4, 0 - bl pokemon_getattr - mov r1, r8 - strh r0, [r1] - adds r1, r6, 0 - adds r1, 0x11 - adds r0, r4, 0 - bl pokemon_getattr - mov r2, r10 - adds r1, r2, r6 - strb r0, [r1] - movs r0, 0x2 - add r8, r0 - adds r6, 0x1 - cmp r6, 0x3 - ble _0805A1F2 - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x15 - bl pokemon_getattr - mov r1, r9 - strb r0, [r1, 0xC] - mov r2, r9 - movs r6, 0 -_0805A230: - adds r0, r7, r6 - adds r1, r2, r6 - ldrb r1, [r1] - strb r1, [r0] - adds r6, 0x1 - cmp r6, 0xF - bls _0805A230 - b _0805A5FE - .pool -_0805A244: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldrb r1, [r3] - lsls r1, 9 - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - adds r1, 0x9 - b _0805A536 - .pool -_0805A260: - movs r6, 0 - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r2, =0x020244ec - mov r8, r2 -_0805A26C: - adds r1, r6, 0 - adds r1, 0x11 - mov r2, r8 - adds r0, r4, r2 - bl pokemon_getattr - adds r1, r7, r6 - strb r0, [r1] - adds r6, 0x1 - cmp r6, 0x3 - ble _0805A26C - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x15 - bl pokemon_getattr - adds r1, r7, r6 - strb r0, [r1] - adds r6, 0x1 - b _0805A5FE - .pool -_0805A29C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldrb r1, [r3] - lsls r1, 9 - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - adds r1, 0x8 - b _0805A5F6 - .pool -_0805A2B8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1 - b _0805A2D2 - .pool -_0805A2C8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x19 -_0805A2D2: - bl pokemon_getattr - adds r1, r0, 0 - strb r1, [r7] - movs r0, 0xFF - lsls r0, 8 - ands r0, r1 - lsrs r0, 8 - strb r0, [r7, 0x1] - movs r0, 0xFF - lsls r0, 16 - ands r0, r1 - lsrs r0, 16 - strb r0, [r7, 0x2] - movs r6, 0x3 - b _0805A5FE - .pool -_0805A2F8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1A - b _0805A5F6 - .pool -_0805A308: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1B - b _0805A5F6 - .pool -_0805A318: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1C - b _0805A5F6 - .pool -_0805A328: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1D - b _0805A5F6 - .pool -_0805A338: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1E - b _0805A5F6 - .pool -_0805A348: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1F - b _0805A5F6 - .pool -_0805A358: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x20 - b _0805A5F6 - .pool -_0805A368: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x22 - b _0805A5F6 - .pool -_0805A378: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x23 - b _0805A5F6 - .pool -_0805A388: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x24 - b _0805A5F6 - .pool -_0805A398: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x25 - b _0805A5F6 - .pool -_0805A3A8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x26 - b _0805A5F6 - .pool -_0805A3B8: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x27 - bl pokemon_getattr - strb r0, [r7] - adds r0, r4, 0 - movs r1, 0x28 - bl pokemon_getattr - strb r0, [r7, 0x1] - adds r0, r4, 0 - movs r1, 0x29 - bl pokemon_getattr - strb r0, [r7, 0x2] - adds r0, r4, 0 - movs r1, 0x2A - bl pokemon_getattr - strb r0, [r7, 0x3] - adds r0, r4, 0 - movs r1, 0x2B - bl pokemon_getattr - strb r0, [r7, 0x4] - adds r0, r4, 0 - movs r1, 0x2C - bl pokemon_getattr - strb r0, [r7, 0x5] - movs r6, 0x6 - b _0805A5FE - .pool -_0805A408: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x27 - b _0805A5F6 - .pool -_0805A418: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x28 - b _0805A5F6 - .pool -_0805A428: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x29 - b _0805A5F6 - .pool -_0805A438: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2A - b _0805A5F6 - .pool -_0805A448: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2B - b _0805A5F6 - .pool -_0805A458: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2C - b _0805A5F6 - .pool -_0805A468: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0 - b _0805A492 - .pool -_0805A478: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x9 - b _0805A536 - .pool -_0805A488: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x37 -_0805A492: - bl pokemon_getattr - adds r1, r0, 0 - strb r1, [r7] - movs r0, 0xFF - lsls r0, 8 - ands r0, r1 - lsrs r0, 8 - strb r0, [r7, 0x1] - movs r0, 0xFF - lsls r0, 16 - ands r0, r1 - lsrs r0, 16 - strb r0, [r7, 0x2] - lsrs r0, r1, 24 - strb r0, [r7, 0x3] - movs r6, 0x4 - b _0805A5FE - .pool -_0805A4BC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x38 - b _0805A5F6 - .pool -_0805A4CC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x39 - b _0805A536 - .pool -_0805A4DC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3A - b _0805A536 - .pool -_0805A4EC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3B - b _0805A536 - .pool -_0805A4FC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3C - b _0805A536 - .pool -_0805A50C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3D - b _0805A536 - .pool -_0805A51C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3E - b _0805A536 - .pool -_0805A52C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3F -_0805A536: - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - strb r0, [r7] - lsrs r0, 8 - strb r0, [r7, 0x1] - movs r6, 0x2 - b _0805A5FE - .pool -_0805A54C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x16 - b _0805A5F6 - .pool -_0805A55C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x17 - b _0805A5F6 - .pool -_0805A56C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x18 - b _0805A5F6 - .pool -_0805A57C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x21 - b _0805A5F6 - .pool -_0805A58C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2F - b _0805A5F6 - .pool -_0805A59C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x30 - b _0805A5F6 - .pool -_0805A5AC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x32 - b _0805A5F6 - .pool -_0805A5BC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x33 - b _0805A5F6 - .pool -_0805A5CC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x34 - b _0805A5F6 - .pool -_0805A5DC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x35 - b _0805A5F6 - .pool -_0805A5EC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x36 -_0805A5F6: - bl pokemon_getattr - strb r0, [r7] - movs r6, 0x1 -_0805A5FE: - adds r0, r6, 0 - add sp, 0x90 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end dp01_getattr_by_ch1_for_player_pokemon_ - - thumb_func_start sub_805A614 -sub_805A614: @ 805A614 - push {r4-r7,lr} - sub sp, 0x58 - ldr r2, =0x0202406e - ldr r5, =0x02024064 - ldrb r1, [r5] - lsls r0, r1, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - adds r4, r2, 0 - muls r4, r0 - ldr r3, =0x02023064 - lsls r1, 9 - adds r0, r3, 0x1 - adds r0, r1, r0 - ldrb r2, [r0] - ldr r0, =0x020244ec - adds r0, r2, r0 - adds r6, r4, r0 - mov r0, sp - adds r4, r0, r2 - movs r2, 0 - adds r0, r3, 0x2 - adds r1, r0 - adds r7, r5, 0 - mov r12, r3 - ldrb r1, [r1] - cmp r2, r1 - bcs _0805A66A - adds r3, r0, 0 -_0805A650: - adds r1, r4, r2 - adds r0, r6, r2 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - ldrb r0, [r5] - lsls r0, 9 - adds r0, r3 - ldrb r0, [r0] - cmp r2, r0 - bcc _0805A650 -_0805A66A: - ldrb r0, [r7] - lsls r0, 9 - mov r1, r12 - adds r1, 0x2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - adds r2, r4, 0 - bl dp01_build_cmdbuf_x1D_1D_numargs_varargs - bl dp01_tbl1_exec_completed - add sp, 0x58 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805A614 - - thumb_func_start dp01t_02_1_setattr -dp01t_02_1_setattr: @ 805A69C - push {r4,r5,lr} - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x2 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0 - bne _0805A6CC - ldr r0, =0x0202406e - lsls r1, r2, 1 - adds r1, r0 - ldrb r0, [r1] - bl dp01_setattr_by_ch1_for_player_pokemon - b _0805A6EA - .pool -_0805A6CC: - ldrb r4, [r1] - movs r5, 0 -_0805A6D0: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _0805A6DE - adds r0, r5, 0 - bl dp01_setattr_by_ch1_for_player_pokemon -_0805A6DE: - lsrs r4, 1 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _0805A6D0 -_0805A6EA: - bl dp01_tbl1_exec_completed - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end dp01t_02_1_setattr - - thumb_func_start dp01_setattr_by_ch1_for_player_pokemon -dp01_setattr_by_ch1_for_player_pokemon: @ 805A6F4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x34 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 9 - ldr r2, =0x02023067 - adds r3, r0, r2 - adds r6, r3, 0 - subs r1, r2, 0x2 - adds r0, r1 - ldrb r0, [r0] - adds r7, r2, 0 - cmp r0, 0x3B - bls _0805A720 - bl _0805B0BA -_0805A720: - lsls r0, 2 - ldr r1, =_0805A738 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0805A738: - .4byte _0805A828 - .4byte _0805A9C0 - .4byte _0805A9E0 - .4byte _0805AA00 - .4byte _0805AA58 - .4byte _0805AA58 - .4byte _0805AA58 - .4byte _0805AA58 - .4byte _0805AA80 - .4byte _0805AAE4 - .4byte _0805AAE4 - .4byte _0805AAE4 - .4byte _0805AAE4 - .4byte _0805B0BA - .4byte _0805B0BA - .4byte _0805B0BA - .4byte _0805B0BA - .4byte _0805AB14 - .4byte _0805AB34 - .4byte _0805AB54 - .4byte _0805AB74 - .4byte _0805AB94 - .4byte _0805ABB4 - .4byte _0805ABD4 - .4byte _0805ABF4 - .4byte _0805AC14 - .4byte _0805AC34 - .4byte _0805AC54 - .4byte _0805AC74 - .4byte _0805AC94 - .4byte _0805ACB4 - .4byte _0805ACD4 - .4byte _0805AD44 - .4byte _0805AD64 - .4byte _0805AD84 - .4byte _0805ADA4 - .4byte _0805ADC4 - .4byte _0805ADE4 - .4byte _0805AE04 - .4byte _0805AE24 - .4byte _0805AE44 - .4byte _0805AE64 - .4byte _0805AE84 - .4byte _0805AEA4 - .4byte _0805AEC4 - .4byte _0805AEE4 - .4byte _0805AF04 - .4byte _0805AF24 - .4byte _0805AF44 - .4byte _0805AF64 - .4byte _0805AF84 - .4byte _0805AFA4 - .4byte _0805AFC4 - .4byte _0805AFE4 - .4byte _0805B004 - .4byte _0805B024 - .4byte _0805B044 - .4byte _0805B064 - .4byte _0805B084 - .4byte _0805B0A4 -_0805A828: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - adds r2, r6, 0 - bl pokemon_setattr - adds r2, r6, 0 - adds r2, 0x2E - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_setattr - movs r0, 0 - mov r8, r0 - movs r0, 0x3B - adds r0, r6 - mov r10, r0 - adds r0, r6, 0 - adds r0, 0x2B - str r0, [sp, 0x20] - adds r0, 0x19 - str r0, [sp, 0x28] - adds r0, 0x4 - str r0, [sp, 0x2C] - adds r0, 0x4 - str r0, [sp, 0x30] - subs r0, 0x22 - str r0, [sp, 0x1C] - subs r0, 0x2 - str r0, [sp, 0x18] - adds r0, 0x4 - str r0, [sp, 0x24] - adds r0, r6, 0x2 - str r0, [sp, 0x4] - adds r0, r6, 0x4 - str r0, [sp, 0x8] - adds r0, r6, 0x6 - str r0, [sp, 0xC] - adds r0, 0x2 - str r0, [sp, 0x10] - adds r0, 0x2 - str r0, [sp, 0x14] - mov r9, r4 - adds r7, r6, 0 - adds r7, 0x24 - adds r4, r6, 0 - adds r4, 0xC -_0805A88E: - mov r1, r8 - adds r1, 0xD - mov r0, r9 - adds r2, r4, 0 - bl pokemon_setattr - mov r1, r8 - adds r1, 0x11 - mov r0, r9 - adds r2, r7, 0 - bl pokemon_setattr - adds r7, 0x1 - adds r4, 0x2 - movs r0, 0x1 - add r8, r0 - mov r0, r8 - cmp r0, 0x3 - ble _0805A88E - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x15 - mov r2, r10 - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x20 - ldr r2, [sp, 0x20] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x19 - ldr r2, [sp, 0x28] - bl pokemon_setattr - ldrb r0, [r6, 0x14] - lsls r0, 27 - lsrs r0, 27 - mov r1, sp - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x27 - mov r2, sp - bl pokemon_setattr - mov r1, sp - ldrh r0, [r6, 0x14] - lsls r0, 22 - lsrs r0, 27 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x28 - mov r2, sp - bl pokemon_setattr - mov r1, sp - ldrb r0, [r6, 0x15] - lsls r0, 25 - lsrs r0, 27 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x29 - mov r2, sp - bl pokemon_setattr - mov r1, sp - ldr r0, [r6, 0x14] - lsls r0, 12 - lsrs r0, 27 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x2A - mov r2, sp - bl pokemon_setattr - mov r1, sp - ldrh r0, [r6, 0x16] - lsls r0, 23 - lsrs r0, 27 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x2B - mov r2, sp - bl pokemon_setattr - mov r1, sp - ldrb r0, [r6, 0x17] - lsls r0, 26 - lsrs r0, 27 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x2C - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0 - ldr r2, [sp, 0x2C] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x37 - ldr r2, [sp, 0x30] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x38 - ldr r2, [sp, 0x1C] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x39 - ldr r2, [sp, 0x18] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3A - ldr r2, [sp, 0x24] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3B - ldr r2, [sp, 0x4] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3C - ldr r2, [sp, 0x8] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3D - ldr r2, [sp, 0xC] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3E - ldr r2, [sp, 0x10] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3F - ldr r2, [sp, 0x14] - bl pokemon_setattr - b _0805B0BA - .pool -_0805A9C0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0xB - bl pokemon_setattr - b _0805B0BA - .pool -_0805A9E0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0xC - bl pokemon_setattr - b _0805B0BA - .pool -_0805AA00: - movs r0, 0 - mov r8, r0 - movs r0, 0xC - adds r0, r3 - mov r9, r0 - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r7, r1, r0 - adds r6, r3, 0 - adds r6, 0x8 - adds r4, r3, 0 -_0805AA1A: - mov r1, r8 - adds r1, 0xD - adds r0, r7, 0 - adds r2, r4, 0 - bl pokemon_setattr - mov r1, r8 - adds r1, 0x11 - adds r0, r7, 0 - adds r2, r6, 0 - bl pokemon_setattr - adds r6, 0x1 - adds r4, 0x2 - movs r0, 0x1 - add r8, r0 - mov r0, r8 - cmp r0, 0x3 - ble _0805AA1A - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x15 - mov r2, r9 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AA58: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r3, =0x02023064 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r1, r3, 0x1 - adds r1, r2, r1 - ldrb r1, [r1] - adds r1, 0x9 - b _0805AAFC - .pool -_0805AA80: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - ldr r5, =0x02024064 - ldrb r2, [r5] - lsls r2, 9 - adds r2, r7 - adds r0, r4, 0 - movs r1, 0x11 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x1 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x12 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x2 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x13 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x3 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x14 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x4 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x15 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AAE4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r3, =0x02023064 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r1, r3, 0x1 - adds r1, r2, r1 - ldrb r1, [r1] - adds r1, 0x8 -_0805AAFC: - adds r3, 0x3 - adds r2, r3 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AB14: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AB34: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x19 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AB54: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1A - bl pokemon_setattr - b _0805B0BA - .pool -_0805AB74: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1B - bl pokemon_setattr - b _0805B0BA - .pool -_0805AB94: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1C - bl pokemon_setattr - b _0805B0BA - .pool -_0805ABB4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1D - bl pokemon_setattr - b _0805B0BA - .pool -_0805ABD4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1E - bl pokemon_setattr - b _0805B0BA - .pool -_0805ABF4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1F - bl pokemon_setattr - b _0805B0BA - .pool -_0805AC14: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x20 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AC34: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x22 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AC54: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x23 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AC74: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x24 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AC94: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x25 - bl pokemon_setattr - b _0805B0BA - .pool -_0805ACB4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x26 - bl pokemon_setattr - b _0805B0BA - .pool -_0805ACD4: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - ldr r5, =0x02024064 - ldrb r2, [r5] - lsls r2, 9 - adds r2, r7 - adds r0, r4, 0 - movs r1, 0x27 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x1 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x28 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x2 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x29 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x3 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x2A - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x4 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x2B - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x5 - adds r2, r0 - adds r0, r4, 0 - b _0805ADF4 - .pool -_0805AD44: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x27 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AD64: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x28 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AD84: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x29 - bl pokemon_setattr - b _0805B0BA - .pool -_0805ADA4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x2A - bl pokemon_setattr - b _0805B0BA - .pool -_0805ADC4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x2B - bl pokemon_setattr - b _0805B0BA - .pool -_0805ADE4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 -_0805ADF4: - movs r1, 0x2C - bl pokemon_setattr - b _0805B0BA - .pool -_0805AE04: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AE24: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x9 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AE44: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x37 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AE64: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x38 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AE84: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x39 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AEA4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3A - bl pokemon_setattr - b _0805B0BA - .pool -_0805AEC4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3B - bl pokemon_setattr - b _0805B0BA - .pool -_0805AEE4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3C - bl pokemon_setattr - b _0805B0BA - .pool -_0805AF04: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3D - bl pokemon_setattr - b _0805B0BA - .pool -_0805AF24: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3E - bl pokemon_setattr - b _0805B0BA - .pool -_0805AF44: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3F - bl pokemon_setattr - b _0805B0BA - .pool -_0805AF64: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x16 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AF84: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x17 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AFA4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x18 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AFC4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x21 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AFE4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x2F - bl pokemon_setattr - b _0805B0BA - .pool -_0805B004: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x30 - bl pokemon_setattr - b _0805B0BA - .pool -_0805B024: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x32 - bl pokemon_setattr - b _0805B0BA - .pool -_0805B044: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x33 - bl pokemon_setattr - b _0805B0BA - .pool -_0805B064: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x34 - bl pokemon_setattr - b _0805B0BA - .pool -_0805B084: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x35 - bl pokemon_setattr - b _0805B0BA - .pool -_0805B0A4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x36 - bl pokemon_setattr -_0805B0BA: - ldr r2, =0x0202406e - ldr r0, =0x02024064 - ldrb r1, [r0] - lsls r0, r1, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =0x020244ec - adds r0, r2 - bl sub_805E990 - add sp, 0x34 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_setattr_by_ch1_for_player_pokemon - - thumb_func_start sub_805B0F0 -sub_805B0F0: @ 805B0F0 - push {r4-r7,lr} - ldr r1, =0x0202406e - ldr r7, =0x02024064 - ldrb r2, [r7] - lsls r0, r2, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - adds r3, r1, 0 - muls r3, r0 - ldr r4, =0x02023064 - lsls r2, 9 - adds r0, r4, 0x1 - adds r0, r2, r0 - ldrb r0, [r0] - ldr r1, =0x020244ec - adds r0, r1 - adds r5, r3, r0 - movs r3, 0 - adds r0, r4, 0x2 - adds r2, r0 - ldrb r2, [r2] - cmp r3, r2 - bcs _0805B148 - adds r6, r4, 0 - adds r2, r7, 0 - adds r4, r0, 0 -_0805B126: - adds r1, r5, r3 - ldrb r0, [r2] - lsls r0, 9 - adds r0, 0x3 - adds r0, r3, r0 - adds r0, r6 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - ldrb r0, [r2] - lsls r0, 9 - adds r0, r4 - ldrb r0, [r0] - cmp r3, r0 - bcc _0805B126 -_0805B148: - bl dp01_tbl1_exec_completed - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805B0F0 - - thumb_func_start sub_805B164 -sub_805B164: @ 805B164 - push {r4,lr} - ldr r2, =0x0202406e - ldr r4, =0x02024064 - ldrb r1, [r4] - lsls r0, r1, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =0x020244ec - adds r0, r2 - bl sub_805DD7C - ldr r2, =0x02020630 - ldr r0, =0x020241e4 - ldrb r3, [r4] - adds r0, r3, r0 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - lsls r3, 4 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x5] - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_0802E404 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805B164 - - thumb_func_start sub_805B1CC -sub_805B1CC: @ 805B1CC - push {r4-r6,lr} - ldr r5, =0x02024064 - ldrb r0, [r5] - ldr r4, =0x02023064 - lsls r1, r0, 9 - adds r6, r4, 0x2 - adds r1, r6 - ldrb r1, [r1] - bl sub_805EF84 - ldr r2, =0x0202406e - ldrb r0, [r5] - lsls r1, r0, 1 - adds r1, r2 - lsls r0, 9 - adds r4, 0x1 - adds r0, r4 - ldrb r0, [r0] - movs r4, 0 - strh r0, [r1] - ldrb r1, [r5] - lsls r0, r1, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =0x020244ec - adds r0, r2 - bl sub_805DD7C - ldr r1, =0x020244ac - ldrb r0, [r5] - adds r0, r1 - strb r4, [r0] - ldr r1, =0x020244b0 - ldrb r0, [r5] - adds r0, r1 - strb r4, [r0] - ldrb r0, [r5] - lsls r1, r0, 9 - adds r1, r6 - ldrb r1, [r1] - bl sub_805B258 - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805902C - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805B1CC - - thumb_func_start sub_805B258 -sub_805B258: @ 805B258 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - lsls r1, 24 - lsrs r1, 24 - adds r0, r6, 0 - bl sub_805EF84 - ldr r0, =0x0202406e - lsls r2, r6, 1 - adds r2, r0 - ldr r0, =0x02023064 - lsls r1, r6, 9 - adds r0, 0x1 - adds r1, r0 - ldrb r0, [r1] - strh r0, [r2] - ldrh r1, [r2] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - mov r8, r0 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldr r0, =sub_805D714 - bl object_new_hidden_with_callback - ldr r1, =0x03005d7c - mov r9, r1 - add r9, r6 - mov r1, r9 - strb r0, [r1] - adds r0, r6, 0 - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, r8 - bl sub_806A068 - ldr r0, =0x0202499c - mov r10, r0 - adds r0, r6, 0 - movs r1, 0x2 - bl sub_80A5C6C - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - adds r0, r6, 0 - bl sub_80A6138 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r6, 0 - bl sub_80A82E4 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - mov r0, r10 - adds r1, r5, 0 - adds r2, r4, 0 - bl AddObjectToFront - ldr r4, =0x020241e4 - adds r4, r6, r4 - strb r0, [r4] - ldr r5, =0x02020630 - mov r0, r9 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r1, [r4] - strh r1, [r0, 0x30] - mov r0, r9 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r6, [r0, 0x32] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r6, [r0, 0x2E] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - mov r1, r8 - strh r1, [r0, 0x32] - ldrb r0, [r4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - lsls r3, r6, 4 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x5] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =0x020244e4 - adds r6, r1 - ldrb r1, [r6] - bl StartObjectImageAnim - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r5, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =DummyObjectCallback - str r1, [r0] - movs r0, 0 - movs r1, 0xFF - bl sub_80753E8 - mov r1, r9 - ldrb r2, [r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r5 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1, 0x2E] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805B258 - - thumb_func_start sub_805B3D4 -sub_805B3D4: @ 805B3D4 - push {r4-r6,lr} - ldr r1, =0x02023064 - ldr r6, =0x02024064 - ldrb r2, [r6] - lsls r0, r2, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r3, [r0] - cmp r3, 0 - bne _0805B41C - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - strb r3, [r0, 0x4] - ldr r1, =0x03005d60 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805B464 - str r1, [r0] - b _0805B452 - .pool -_0805B41C: - ldr r5, =0x020241e4 - adds r0, r2, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl obj_free_rotscale_entry - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r1, =0x03005d70 - ldrb r0, [r6] - adds r0, r1 - ldrb r0, [r0] - bl sub_8072984 - bl dp01_tbl1_exec_completed -_0805B452: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805B3D4 - - thumb_func_start sub_805B464 -sub_805B464: @ 805B464 - push {r4-r6,lr} - ldr r6, =0x020244d0 - ldr r4, [r6] - ldr r5, =0x02024064 - ldrb r2, [r5] - ldr r1, [r4, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r3, r0, r1 - ldrb r0, [r3, 0x4] - cmp r0, 0 - beq _0805B48C - cmp r0, 0x1 - beq _0805B4BA - b _0805B4E2 - .pool -_0805B48C: - ldr r1, [r4] - lsls r0, r2, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0805B4A6 - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x5 - bl move_anim_start_t4 -_0805B4A6: - ldr r0, [r6] - ldrb r1, [r5] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x1 - strb r1, [r0, 0x4] - b _0805B4E2 -_0805B4BA: - ldrb r1, [r3] - movs r0, 0x40 - ands r0, r1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _0805B4E2 - strb r0, [r3, 0x4] - ldrb r2, [r5] - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x1 - bl move_anim_start_t4 - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8059744 - str r1, [r0] -_0805B4E2: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805B464 - - thumb_func_start sub_805B4F0 -sub_805B4F0: @ 805B4F0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0805B5B4 - bl link_get_multiplayer_id - ldr r5, =0x020229e8 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - movs r4, 0xFF - ldrb r0, [r1] - cmp r0, 0x4 - beq _0805B538 - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrh r1, [r1] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0x5 - bne _0805B558 -_0805B538: - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r0, [r1, 0x13] - adds r4, r0, 0x2 - b _0805B5BA - .pool -_0805B558: - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrh r1, [r1] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0x2 - beq _0805B58A - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrh r0, [r1] - ands r4, r0 - cmp r4, 0x1 - bne _0805B5A0 -_0805B58A: - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r0, [r1, 0x13] - adds r4, r0, 0x4 - b _0805B5BA -_0805B5A0: - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r4, [r1, 0x13] - b _0805B5BA -_0805B5B4: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r4, [r0, 0x8] -_0805B5BA: - ldr r0, =0x02022fec - ldr r1, [r0] - movs r2, 0x40 - ands r1, r2 - adds r5, r0, 0 - cmp r1, 0 - beq _0805B63C - ldr r0, =0x02024064 - ldrb r0, [r0] - bl battle_get_per_side_status - movs r1, 0x2 - ands r1, r0 - movs r0, 0x20 - mov r9, r0 - cmp r1, 0 - beq _0805B5E0 - movs r1, 0x5A - mov r9, r1 -_0805B5E0: - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 15 - ands r0, r1 - cmp r0, 0 - beq _0805B618 - ldr r0, =0x02038bce - ldrh r1, [r0] - ldr r0, =0x00000c03 - cmp r1, r0 - beq _0805B618 - movs r0, 0x5A - mov r9, r0 - ldr r1, =gUnknown_083054E0 - b _0805B642 - .pool -_0805B618: - ldr r1, =gUnknown_08305D2C - lsls r0, r4, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x8 - subs r0, r1 - lsls r0, 18 - movs r1, 0xA0 - lsls r1, 15 - adds r0, r1 - lsrs r7, r0, 16 - ldr r5, =0x02022fec - b _0805B656 - .pool -_0805B63C: - movs r0, 0x50 - mov r9, r0 - ldr r1, =gUnknown_08305D2C -_0805B642: - lsls r0, r4, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x8 - subs r0, r1 - lsls r0, 18 - movs r1, 0xA0 - lsls r1, 15 - adds r0, r1 - lsrs r7, r0, 16 -_0805B656: - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 15 - ands r0, r1 - cmp r0, 0 - bne _0805B664 - b _0805B794 -_0805B664: - ldr r0, =0x02038bce - ldrh r1, [r0] - ldr r0, =0x00000c03 - cmp r1, r0 - bne _0805B670 - b _0805B794 -_0805B670: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - bl sub_806F000 - lsls r0, 16 - lsrs r4, r0, 16 - adds r5, r4, 0 - ldr r6, =0x02024064 - ldrb r1, [r6] - adds r0, r5, 0 - bl sub_805DF38 - ldrb r0, [r6] - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl sub_806A1C0 - ldr r0, =0x0202499c - mov r8, r0 - lsls r4, r7, 16 - asrs r4, 16 - ldrb r0, [r6] - bl sub_80A82E4 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - mov r0, r8 - mov r1, r9 - adds r2, r4, 0 - bl AddObjectToFront - ldr r4, =0x020241e4 - ldrb r1, [r6] - adds r1, r4 - strb r0, [r1] - ldr r0, =gTrainerFrontPicPaletteTable - lsls r5, 3 - adds r5, r0 - ldrh r0, [r5, 0x4] - bl IndexOfObjectPaletteTag - ldr r5, =0x02020630 - ldrb r1, [r6] - adds r1, r4 - ldrb r1, [r1] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - adds r2, r5 - lsls r0, 4 - ldrb r3, [r2, 0x5] - movs r1, 0xF - ands r1, r3 - orrs r1, r0 - strb r1, [r2, 0x5] - ldrb r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0xF0 - strh r1, [r0, 0x24] - ldrb r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x30 - strh r1, [r0, 0x26] - ldrb r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =0x0000fffe - strh r1, [r0, 0x2E] - ldrb r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r5, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_805D7AC - str r1, [r0] - ldrb r0, [r6] - adds r0, r4 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r2, [r1, 0x1] - movs r0, 0x4 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1] - ldrb r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3F - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] - b _0805B82A - .pool -_0805B794: - ldr r5, =0x02024064 - ldrb r1, [r5] - adds r0, r4, 0 - bl sub_805DF84 - ldrb r0, [r5] - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl template_build_for_pokemon_or_trainer - ldr r6, =0x0202499c - mov r8, r9 - lsls r4, r7, 16 - asrs r4, 16 - ldrb r0, [r5] - bl sub_80A82E4 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r6, 0 - mov r1, r8 - adds r2, r4, 0 - bl AddObjectToFront - ldr r6, =0x020241e4 - ldrb r1, [r5] - adds r1, r6 - strb r0, [r1] - ldr r4, =0x02020630 - ldrb r3, [r5] - adds r0, r3, r6 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - lsls r3, 4 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x5] - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xF0 - strh r1, [r0, 0x24] - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =0x0000fffe - strh r1, [r0, 0x2E] - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, 0x1C - adds r0, r4 - ldr r1, =sub_805D7AC - str r1, [r0] -_0805B82A: - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8058844 - str r1, [r0] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805B4F0 - - thumb_func_start dp01t_08_1_8032428 -dp01t_08_1_8032428: @ 805B864 - push {r4-r6,lr} - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0805B920 - bl link_get_multiplayer_id - ldr r5, =0x020229e8 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - movs r4, 0xFF - ldrb r0, [r1] - cmp r0, 0x4 - beq _0805B8A6 - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrh r1, [r1] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0x5 - bne _0805B8C4 -_0805B8A6: - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r0, [r1, 0x13] - adds r4, r0, 0x2 - b _0805B926 - .pool -_0805B8C4: - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrh r1, [r1] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0x2 - beq _0805B8F6 - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrh r0, [r1] - ands r4, r0 - cmp r4, 0x1 - bne _0805B90C -_0805B8F6: - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r0, [r1, 0x13] - adds r4, r0, 0x4 - b _0805B926 -_0805B90C: - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r4, [r1, 0x13] - b _0805B926 -_0805B920: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r4, [r0, 0x8] -_0805B926: - ldr r5, =0x02024064 - ldrb r1, [r5] - adds r0, r4, 0 - bl sub_805DF84 - ldrb r0, [r5] - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl template_build_for_pokemon_or_trainer - ldr r0, =0x0202499c - ldr r1, =gUnknown_08305D2C - lsls r4, 2 - adds r4, r1 - ldrb r1, [r4] - movs r2, 0x8 - subs r2, r1 - lsls r2, 18 - movs r1, 0xA0 - lsls r1, 15 - adds r2, r1 - asrs r2, 16 - movs r1, 0x50 - movs r3, 0x1E - bl AddObjectToFront - ldr r6, =0x020241e4 - ldrb r1, [r5] - adds r1, r6 - strb r0, [r1] - ldr r4, =0x02020630 - ldrb r3, [r5] - adds r0, r3, r6 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - lsls r3, 4 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x5] - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =0x0000ffa0 - strh r1, [r0, 0x24] - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x2 - strh r1, [r0, 0x2E] - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, 0x1C - adds r0, r4 - ldr r1, =sub_805D7AC - str r1, [r0] - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805887C - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_08_1_8032428 - - thumb_func_start sub_805B9F8 -sub_805B9F8: @ 805B9F8 - push {r4-r6,lr} - ldr r5, =0x020241e4 - ldr r6, =0x02024064 - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl oamt_add_pos2_onto_pos1 - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x32 - strh r1, [r0, 0x2E] - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =0x0000ffd8 - strh r1, [r0, 0x32] - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x22] - strh r1, [r0, 0x36] - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_80A6EEC - str r1, [r0] - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =DummyObjectCallback - bl oamt_set_x3A_32 - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x1 - bl StartObjectImageAnim - ldr r1, =0x03005d60 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_802F7A0 - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805B9F8 - - thumb_func_start sub_805BAB8 -sub_805BAB8: @ 805BAB8 - push {r4-r6,lr} - ldr r6, =0x020244d0 - ldr r4, [r6] - ldr r5, =0x02024064 - ldrb r2, [r5] - ldr r0, [r4, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r3, r1, r0 - ldrb r0, [r3, 0x4] - cmp r0, 0 - bne _0805BB0C - ldr r1, [r4] - lsls r0, r2, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0805BAEC - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x5 - bl move_anim_start_t4 -_0805BAEC: - ldr r0, [r6] - ldrb r1, [r5] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x4] - adds r1, 0x1 - strb r1, [r0, 0x4] - b _0805BB82 - .pool -_0805BB0C: - ldrb r1, [r3] - movs r0, 0x40 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _0805BB82 - strb r4, [r3, 0x4] - ldr r2, =0x0202406e - ldrb r1, [r5] - lsls r0, r1, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =0x020244ec - adds r0, r2 - bl sub_805E990 - movs r1, 0x40 - negs r1, r1 - movs r0, 0x10 - bl audio_play_and_stuff - ldr r2, =0x02020630 - ldr r3, =0x020241e4 - ldrb r0, [r5] - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r4, [r0, 0x30] - ldrb r0, [r5] - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x5 - strh r1, [r0, 0x32] - ldrb r0, [r5] - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_8039C00 - str r1, [r0] - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_80596A8 - str r1, [r0] -_0805BB82: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805BAB8 - - thumb_func_start sub_805BBA4 -sub_805BBA4: @ 805BBA4 - push {lr} - sub sp, 0x4 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r1, 0x2 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - bl dp01_tbl1_exec_completed - add sp, 0x4 - pop {r0} - bx r0 - thumb_func_end sub_805BBA4 - - thumb_func_start sub_805BBC4 -sub_805BBC4: @ 805BBC4 - push {r4,r5,lr} - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0, 0x8] - movs r0, 0x4 - strb r0, [r1, 0x8] - ldr r1, =0x020244b9 - movs r0, 0x1 - strb r0, [r1] - ldr r5, =0x02024064 - ldrb r4, [r5] - movs r0, 0x1 - bl battle_get_side_with_given_state - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r4, 0 - movs r3, 0x3 - bl move_anim_start_t4 - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_wait_t1 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805BBC4 - - thumb_func_start sub_805BC18 -sub_805BC18: @ 805BC18 - push {r4,r5,lr} - ldr r1, =0x02023064 - ldr r5, =0x02024064 - ldrb r0, [r5] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r1, [r0] - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - strb r1, [r0, 0x8] - ldr r1, =0x020244b9 - movs r0, 0x1 - strb r0, [r1] - ldrb r4, [r5] - movs r0, 0x1 - bl battle_get_side_with_given_state - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r4, 0 - movs r3, 0x3 - bl move_anim_start_t4 - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_wait_t1 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805BC18 - - thumb_func_start sub_805BC78 -sub_805BC78: @ 805BC78 - push {lr} - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _0805BC96 -_0805BC8C: - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _0805BC8C -_0805BC96: - bl dp01_tbl1_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_805BC78 - - thumb_func_start dp01t_0F_1_move_anim -dp01t_0F_1_move_anim: @ 805BCA8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r5, =0x02024064 - ldrb r0, [r5] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - beq _0805BCBE - b _0805BDE4 -_0805BCBE: - ldr r0, =0x02023064 - mov r12, r0 - ldrb r1, [r5] - lsls r1, 9 - adds r0, 0x1 - adds r0, r1, r0 - ldrb r6, [r0] - mov r0, r12 - adds r0, 0x2 - adds r0, r1, r0 - ldrb r0, [r0] - lsls r0, 8 - orrs r6, r0 - ldr r0, =0x02038432 - mov r8, r0 - mov r0, r12 - adds r0, 0x3 - adds r1, r0 - ldrb r0, [r1] - mov r1, r8 - strb r0, [r1] - ldr r3, =0x02038408 - ldrb r1, [r5] - lsls r1, 9 - mov r0, r12 - adds r0, 0x4 - adds r0, r1, r0 - ldrb r2, [r0] - mov r0, r12 - adds r0, 0x5 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 8 - orrs r2, r0 - strh r2, [r3] - ldr r3, =0x02038404 - ldrb r1, [r5] - lsls r1, 9 - mov r0, r12 - adds r0, 0x6 - adds r0, r1, r0 - ldrb r2, [r0] - mov r0, r12 - adds r0, 0x7 - adds r0, r1, r0 - ldrb r0, [r0] - lsls r0, 8 - orrs r2, r0 - mov r0, r12 - adds r0, 0x8 - adds r0, r1, r0 - ldrb r0, [r0] - lsls r0, 16 - orrs r2, r0 - mov r0, r12 - adds r0, 0x9 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 24 - orrs r2, r0 - str r2, [r3] - ldr r2, =0x0203841a - ldrb r0, [r5] - lsls r0, 9 - mov r1, r12 - adds r1, 0xA - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - ldr r4, =0x0203841c - ldrb r1, [r5] - lsls r1, 9 - mov r0, r12 - adds r0, 0xC - adds r0, r1, r0 - ldrb r2, [r0] - mov r0, r12 - adds r0, 0xD - adds r1, r0 - ldrb r0, [r1] - lsls r0, 8 - orrs r2, r0 - strh r2, [r4] - ldr r7, =0x02038400 - ldrb r1, [r5] - lsls r1, 9 - mov r0, r12 - adds r0, 0x10 - adds r1, r0 - str r1, [r7] - ldr r2, =0x020244bc - ldrb r0, [r5] - lsls r0, 2 - adds r0, r2 - ldr r1, [r1] - str r1, [r0] - mov r0, r8 - ldrb r1, [r0] - adds r0, r6, 0 - bl sub_805DB8C - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - beq _0805BDBC - bl dp01_tbl1_exec_completed - b _0805BDE4 - .pool -_0805BDBC: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldrb r1, [r5] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strb r3, [r0, 0x4] - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_move_anim_1 - str r1, [r0] - ldrh r1, [r4] - ldr r2, [r7] - adds r0, r6, 0 - bl sub_817E0FC -_0805BDE4: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_0F_1_move_anim - - thumb_func_start bx_move_anim_1 -bx_move_anim_1: @ 805BDFC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r2, =0x02023064 - ldr r6, =0x02024064 - ldrb r3, [r6] - lsls r1, r3, 9 - adds r0, r2, 0x1 - mov r10, r0 - adds r0, r1, r0 - ldrb r4, [r0] - adds r5, r2, 0x2 - mov r9, r5 - adds r0, r1, r5 - ldrb r0, [r0] - lsls r0, 8 - orrs r4, r0 - adds r2, 0xB - adds r1, r2 - ldrb r1, [r1] - mov r8, r1 - ldr r7, =0x020244d0 - ldr r5, [r7] - ldr r1, [r5, 0x4] - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r2, [r0, 0x4] - cmp r2, 0x1 - beq _0805BE94 - cmp r2, 0x1 - bgt _0805BE54 - cmp r2, 0 - beq _0805BE5E - b _0805BF70 - .pool -_0805BE54: - cmp r2, 0x2 - beq _0805BEBE - cmp r2, 0x3 - beq _0805BF34 - b _0805BF70 -_0805BE5E: - ldr r1, [r5] - lsls r0, r3, 2 - adds r1, r0, r1 - ldrb r2, [r1] - movs r0, 0xC - ands r0, r2 - cmp r0, 0x4 - bne _0805BE80 - movs r0, 0x8 - orrs r0, r2 - strb r0, [r1] - ldrb r2, [r6] - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x5 - bl move_anim_start_t4 -_0805BE80: - ldr r0, [r7] - ldrb r1, [r6] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x1 - strb r1, [r0, 0x4] - b _0805BF70 -_0805BE94: - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0805BF70 - movs r0, 0 - bl sub_805EB9C - adds r0, r4, 0 - bl move_anim_start_t1 - ldr r0, [r7] - ldrb r1, [r6] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x2 - strb r1, [r0, 0x4] - b _0805BF70 -_0805BEBE: - ldr r0, =0x020383f8 - ldr r0, [r0] - bl _call_via_r0 - ldr r0, =0x020383fd - ldrb r0, [r0] - cmp r0, 0 - bne _0805BF70 - movs r0, 0x1 - bl sub_805EB9C - ldr r0, [r7] - ldrb r2, [r6] - ldr r1, [r0] - lsls r0, r2, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0805BF0C - mov r0, r8 - cmp r0, 0x1 - bhi _0805BF0C - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x6 - bl move_anim_start_t4 - ldr r0, [r7] - ldrb r1, [r6] - ldr r0, [r0] - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - strb r0, [r1] -_0805BF0C: - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x3 - strb r1, [r0, 0x4] - b _0805BF70 - .pool -_0805BF34: - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _0805BF70 - bl sub_805E394 - ldrb r0, [r6] - lsls r2, r0, 9 - mov r3, r10 - adds r1, r2, r3 - ldrb r1, [r1] - add r2, r9 - ldrb r2, [r2] - lsls r2, 8 - orrs r1, r2 - bl sub_805E94C - ldr r0, [r7] - ldrb r1, [r6] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strb r4, [r0, 0x4] - bl dp01_tbl1_exec_completed -_0805BF70: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end bx_move_anim_1 - - thumb_func_start sub_805BF80 -sub_805BF80: @ 805BF80 - push {r4,r5,lr} - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r5, =0x02024064 - ldrb r4, [r5] - lsls r4, 9 - ldr r0, =0x02023066 - adds r4, r0 - ldrh r0, [r4] - bl battle_pick_message - ldr r0, =0x02022e2c - movs r1, 0 - bl battle_show_message_maybe - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_80597B4 - str r1, [r0] - ldrh r0, [r4] - bl sub_817C95C - ldrb r0, [r5] - ldrh r1, [r4] - bl sub_81A57E4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805BF80 - - thumb_func_start dp01t_11_1_message_for_player_only -dp01t_11_1_message_for_player_only: @ 805BFE0 - push {lr} - ldr r0, =0x02024064 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0805BFFC - bl sub_805BF80 - b _0805C000 - .pool -_0805BFFC: - bl dp01_tbl1_exec_completed -_0805C000: - pop {r0} - bx r0 - thumb_func_end dp01t_11_1_message_for_player_only - - thumb_func_start sub_805C004 -sub_805C004: @ 805C004 - push {lr} - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _0805C02A - ldr r0, =0x02022e14 - strh r1, [r0] - ldr r1, =0x02022e16 - movs r0, 0xA0 - strh r0, [r1] - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8057588 - str r1, [r0] -_0805C02A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C004 - - thumb_func_start dp01t_12_6_battle_menu -dp01t_12_6_battle_menu: @ 805C044 - push {r4,lr} - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805C004 - str r1, [r0] - bl sub_817F2A8 - ldr r0, =gUnknown_085CCA3A - movs r1, 0x2 - bl battle_show_message_maybe - movs r4, 0 -_0805C062: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_8059CF8 - adds r4, 0x1 - cmp r4, 0x3 - ble _0805C062 - ldr r1, =0x020244ac - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - movs r1, 0 - bl sub_8059CB4 - ldr r0, =gUnknown_085CC9F3 - bl get_battle_strings_ - ldr r0, =0x02022e2c - movs r1, 0x1 - bl battle_show_message_maybe - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_12_6_battle_menu - - thumb_func_start sub_805C0B0 -sub_805C0B0: @ 805C0B0 - push {r4,lr} - sub sp, 0x4 - ldr r4, =0x02024064 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _0805C108 - str r0, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - ldr r0, =gUnknown_085CCABB - movs r1, 0xC - bl battle_show_message_maybe - ldr r1, =0x03005d74 - movs r0, 0x1 - strb r0, [r1] - movs r0, 0x1 - bl sub_8056B74 - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_80599D4 - str r1, [r0] - b _0805C10C - .pool -_0805C108: - bl dp01_tbl1_exec_completed -_0805C10C: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_805C0B0 - - thumb_func_start sub_805C114 -sub_805C114: @ 805C114 - push {lr} - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _0805C13E - ldr r0, =0x02022e14 - strh r1, [r0] - ldr r1, =0x02022e16 - movs r2, 0xA0 - lsls r2, 1 - adds r0, r2, 0 - strh r0, [r1] - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8057BFC - str r1, [r0] -_0805C13E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C114 - - thumb_func_start sub_805C158 -sub_805C158: @ 805C158 - push {lr} - ldr r0, =0x02024064 - ldrb r1, [r0] - ldr r0, =0x0202449c - ldr r0, [r0] - adds r1, r0 - movs r0, 0xA6 - lsls r0, 2 - adds r1, r0 - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - lsls r0, 24 - cmp r0, 0 - bne _0805C194 - ldr r1, =0x0203bd30 - ldr r0, =0x03005d80 - ldr r0, [r0] - str r0, [r1] - bl sub_805D19C - adds r2, r0, 0 - lsls r2, 16 - lsrs r2, 16 - movs r0, 0x1 - movs r1, 0xA - bl dp01_build_cmdbuf_x21_a_bb - bl dp01_tbl1_exec_completed -_0805C194: - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C158 - - thumb_func_start dp01t_14_5_move_menu_pokedude -dp01t_14_5_move_menu_pokedude: @ 805C1A8 - push {lr} - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 10 - ands r0, r1 - cmp r0, 0 - beq _0805C1EC - ldr r2, =0x02024064 - ldrb r0, [r2] - ldr r1, =0x0202449c - ldr r1, [r1] - adds r0, r1 - movs r1, 0xA6 - lsls r1, 2 - adds r0, r1 - movs r1, 0x8 - strb r1, [r0] - ldr r1, =0x03005d60 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805C158 - b _0805C1FC - .pool -_0805C1EC: - bl sub_805C210 - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805C114 -_0805C1FC: - str r1, [r0] - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_14_5_move_menu_pokedude - - thumb_func_start sub_805C210 -sub_805C210: @ 805C210 - push {lr} - bl sub_8059AAC - ldr r1, =0x03005d74 - movs r0, 0xFF - strb r0, [r1] - ldr r1, =0x020244b0 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - movs r1, 0 - bl battle_menu_cursor_related_2 - bl sub_8059B18 - bl sub_8059B3C - bl sub_8059BB0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C210 - - thumb_func_start sub_805C248 -sub_805C248: @ 805C248 - push {r4,r5,lr} - sub sp, 0x4 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, =0x03005d60 - ldr r2, =0x02024064 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_80598A4 - str r1, [r0] - ldr r1, =0x020244b8 - ldrb r0, [r2] - strb r0, [r1] - movs r3, 0 - ldr r5, =0x0203cf00 - ldr r4, =0x02023064 -_0805C276: - adds r0, r3, r5 - ldrb r1, [r2] - lsls r1, 9 - adds r1, 0x1 - adds r1, r3, r1 - adds r1, r4 - ldrb r1, [r1] - strb r1, [r0] - adds r3, 0x1 - cmp r3, 0x2 - ble _0805C276 - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C248 - - thumb_func_start sub_805C2AC -sub_805C2AC: @ 805C2AC - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - movs r3, 0 - ldr r0, =0x0203cf00 - mov r12, r0 - ldr r1, =0x02023064 - mov r8, r1 - ldr r2, =0x02024064 - ldr r7, =0x02022fec - mov r6, r12 - mov r5, r8 - adds r4, r2, 0 -_0805C2C8: - adds r0, r3, r6 - ldrb r1, [r4] - lsls r1, 9 - adds r1, 0x4 - adds r1, r3, r1 - adds r1, r5 - ldrb r1, [r1] - strb r1, [r0] - adds r3, 0x1 - cmp r3, 0x2 - ble _0805C2C8 - ldr r0, [r7] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - beq _0805C330 - ldrb r3, [r2] - lsls r0, r3, 9 - mov r1, r8 - adds r1, 0x1 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x2 - beq _0805C330 - ldr r1, =0x0202406e - lsls r0, r3, 1 - adds r0, r1 - ldrb r1, [r0] - adds r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x1 - mov r2, r12 - bl dp01_build_cmdbuf_x22_a_three_bytes - bl dp01_tbl1_exec_completed - b _0805C3BC - .pool -_0805C330: - ldr r0, =nullsub_4 - movs r1, 0xFF - bl AddTask - ldr r3, =0x03005d7c - ldr r4, =0x02024064 - ldrb r1, [r4] - adds r1, r3 - movs r2, 0 - mov r8, r2 - strb r0, [r1] - ldr r5, =0x03005e00 - ldrb r2, [r4] - adds r3, r2, r3 - ldrb r0, [r3] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r5 - ldr r5, =0x02023064 - lsls r2, 9 - adds r6, r5, 0x1 - adds r2, r6 - ldrb r2, [r2] - movs r0, 0xF - ands r0, r2 - strh r0, [r1, 0x8] - ldr r3, =0x0202449c - ldr r1, [r3] - adds r1, 0x49 - ldrb r0, [r4] - lsls r0, 9 - adds r0, r6 - ldrb r0, [r0] - lsrs r0, 4 - strb r0, [r1] - ldr r2, [r3] - adds r2, 0x8B - ldrb r0, [r4] - lsls r0, 9 - adds r1, r5, 0x2 - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - ldr r1, [r3] - adds r1, 0xB0 - ldrb r0, [r4] - lsls r0, 9 - adds r5, 0x3 - adds r0, r5 - ldrb r0, [r0] - strb r0, [r1] - movs r0, 0x1 - negs r0, r0 - mov r1, r8 - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_80597CC - str r1, [r0] - ldr r1, =0x020244b8 - ldrb r0, [r4] - strb r0, [r1] -_0805C3BC: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C2AC - - thumb_func_start sub_805C3EC -sub_805C3EC: @ 805C3EC - push {lr} - sub sp, 0x4 - bl sub_805EA60 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r1, 0x2 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - bl dp01_tbl1_exec_completed - add sp, 0x4 - pop {r0} - bx r0 - thumb_func_end sub_805C3EC - - thumb_func_start sub_805C410 -sub_805C410: @ 805C410 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - movs r0, 0 - bl load_gfxc_health_bar - ldr r3, =0x02023064 - ldr r0, =0x02024064 - mov r9, r0 - ldrb r1, [r0] - lsls r1, 9 - adds r0, r3, 0x2 - adds r0, r1, r0 - ldrb r2, [r0] - adds r3, 0x3 - adds r1, r3 - ldrb r0, [r1] - lsls r0, 8 - orrs r2, r0 - lsls r2, 16 - asrs r7, r2, 16 - cmp r7, 0 - ble _0805C44A - ldr r1, =0x0203cd70 - ldr r0, [r1] - adds r0, r7 - str r0, [r1] -_0805C44A: - ldr r0, =0x00007fff - cmp r7, r0 - beq _0805C4B4 - ldr r6, =0x0202406e - mov r1, r9 - ldrb r0, [r1] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - movs r5, 0x64 - muls r0, r5 - ldr r4, =0x020244ec - adds r0, r4 - movs r1, 0x3A - bl pokemon_getattr - mov r8, r0 - mov r2, r9 - ldrb r0, [r2] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - muls r0, r5 - adds r0, r4 - movs r1, 0x39 - bl pokemon_getattr - adds r3, r0, 0 - mov r1, r9 - ldrb r0, [r1] - ldr r1, =0x03005d70 - adds r1, r0, r1 - ldrb r1, [r1] - str r7, [sp] - mov r2, r8 - bl sub_807294C - b _0805C4F2 - .pool -_0805C4B4: - ldr r1, =0x0202406e - mov r2, r9 - ldrb r0, [r2] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3A - bl pokemon_getattr - adds r2, r0, 0 - mov r1, r9 - ldrb r0, [r1] - ldr r4, =0x03005d70 - adds r1, r0, r4 - ldrb r1, [r1] - str r7, [sp] - movs r3, 0 - bl sub_807294C - mov r2, r9 - ldrb r0, [r2] - adds r0, r4 - ldrb r0, [r0] - movs r1, 0 - movs r2, 0 - bl heathbar_draw_hp -_0805C4F2: - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_t1_healthbar_update - str r1, [r0] - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C410 - - thumb_func_start sub_805C528 -sub_805C528: @ 805C528 - push {r4-r7,lr} - ldr r5, =0x02023064 - ldr r6, =0x02024064 - ldrb r0, [r6] - lsls r0, 9 - adds r1, r5, 0x1 - adds r0, r1 - ldrb r7, [r0] - movs r0, 0x64 - adds r1, r7, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x38 - bl pokemon_getattr - cmp r0, 0x63 - bls _0805C560 - bl dp01_tbl1_exec_completed - b _0805C5AC - .pool -_0805C560: - movs r0, 0x1 - bl load_gfxc_health_bar - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - ldrb r1, [r6] - lsls r1, 9 - adds r0, r5, 0x2 - adds r0, r1, r0 - ldrb r4, [r0] - adds r0, r5, 0x3 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 8 - orrs r4, r0 - ldr r0, =sub_80591B8 - movs r1, 0xA - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r7, [r1, 0x8] - strh r4, [r1, 0xA] - ldrb r0, [r6] - strh r0, [r1, 0xC] - ldr r1, =0x03005d60 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =nullsub_21 - str r1, [r0] -_0805C5AC: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C528 - - thumb_func_start sub_805C5C4 -sub_805C5C4: @ 805C5C4 - push {r4,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _0805C618 - ldr r0, =0x03005d70 - ldrb r1, [r4] - adds r0, r1, r0 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x020244ec - adds r1, r2 - movs r2, 0x9 - bl healthbar_draw_field_maybe - ldrb r2, [r4] - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x11 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8059D60 - str r1, [r0] -_0805C618: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C5C4 - - thumb_func_start sub_805C63C -sub_805C63C: @ 805C63C - push {r4,r5,lr} - ldr r5, =0x02024064 - ldrb r0, [r5] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _0805C68C - ldr r4, =0x02023064 - ldrb r3, [r5] - lsls r3, 9 - adds r0, r4, 0x1 - adds r0, r3, r0 - ldrb r0, [r0] - adds r1, r4, 0x2 - adds r1, r3, r1 - ldrb r1, [r1] - adds r2, r4, 0x3 - adds r2, r3, r2 - ldrb r2, [r2] - lsls r2, 8 - orrs r1, r2 - adds r2, r4, 0x4 - adds r2, r3, r2 - ldrb r2, [r2] - lsls r2, 16 - orrs r1, r2 - adds r4, 0x5 - adds r3, r4 - ldrb r2, [r3] - lsls r2, 24 - orrs r1, r2 - bl move_anim_start_t2_for_situation - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8059D60 - str r1, [r0] -_0805C68C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C63C - - thumb_func_start sub_805C6A4 -sub_805C6A4: @ 805C6A4 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x4 - ldr r0, =0x0202406e - mov r8, r0 - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r0, 1 - add r0, r8 - ldrh r0, [r0] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x020244ec - adds r0, r5 - movs r1, 0x37 - bl pokemon_getattr - ldr r2, =0x02023064 - ldrb r1, [r4] - lsls r1, 9 - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - eors r0, r1 - mov r1, sp - strb r0, [r1] - ldrb r0, [r4] - lsls r0, 1 - add r0, r8 - ldrh r0, [r0] - muls r0, r6 - adds r0, r5 - movs r1, 0x37 - mov r2, sp - bl pokemon_setattr - bl dp01_tbl1_exec_completed - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C6A4 - - thumb_func_start sub_805C710 -sub_805C710: @ 805C710 - push {lr} - bl dp01_tbl1_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_805C710 - - thumb_func_start sub_805C71C -sub_805C71C: @ 805C71C - push {r4,r5,lr} - ldr r3, =0x02023064 - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r2, 9 - adds r0, r3, 0x1 - adds r0, r2, r0 - ldrb r5, [r0] - adds r0, r3, 0x2 - adds r0, r2, r0 - ldrb r0, [r0] - lsls r0, 8 - orrs r5, r0 - adds r0, r3, 0x3 - adds r0, r2, r0 - ldrb r0, [r0] - lsls r0, 16 - orrs r5, r0 - adds r0, r3, 0x4 - adds r0, r2, r0 - ldrb r4, [r0] - lsls r4, 24 - adds r0, r3, 0x5 - adds r0, r2, r0 - ldrb r1, [r0] - adds r0, r3, 0x6 - adds r0, r2, r0 - ldrb r0, [r0] - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - adds r3, 0x7 - adds r2, r3 - orrs r5, r4 - lsrs r4, r1, 16 - movs r0, 0x80 - lsls r0, 5 - cmp r4, r0 - bhi _0805C78C - ldr r0, =0x040000d4 - str r2, [r0] - str r5, [r0, 0x4] - lsrs r1, 17 - movs r2, 0x80 - lsls r2, 24 - orrs r1, r2 - str r1, [r0, 0x8] - ldr r0, [r0, 0x8] - b _0805C7B8 - .pool -_0805C78C: - ldr r3, =0x040000d4 - str r2, [r3] - str r5, [r3, 0x4] - ldr r0, =0x80000800 - str r0, [r3, 0x8] - ldr r0, [r3, 0x8] - movs r0, 0x80 - lsls r0, 5 - adds r2, r0 - adds r5, r0 - ldr r1, =0xfffff000 - adds r4, r1 - cmp r4, r0 - bhi _0805C78C - str r2, [r3] - str r5, [r3, 0x4] - lsrs r0, r4, 1 - movs r1, 0x80 - lsls r1, 24 - orrs r0, r1 - str r0, [r3, 0x8] - ldr r0, [r3, 0x8] -_0805C7B8: - bl dp01_tbl1_exec_completed - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C71C - - thumb_func_start sub_805C7D0 -sub_805C7D0: @ 805C7D0 - push {lr} - ldr r2, =0x02023064 - ldr r0, =0x02024064 - ldrb r1, [r0] - lsls r1, 9 - adds r0, r2, 0x1 - adds r0, r1, r0 - ldrb r0, [r0] - adds r2, 0x2 - adds r1, r2 - ldrb r1, [r1] - lsls r1, 8 - orrs r0, r1 - bl song_play_for_text - bl dp01_tbl1_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C7D0 - - thumb_func_start sub_805C800 -sub_805C800: @ 805C800 - push {lr} - bl dp01_tbl1_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_805C800 - - thumb_func_start sub_805C80C -sub_805C80C: @ 805C80C - push {lr} - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb - bl dp01_tbl1_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_805C80C - - thumb_func_start sub_805C820 -sub_805C820: @ 805C820 - push {lr} - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl dp01_build_cmdbuf_x22_a_three_bytes - bl dp01_tbl1_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_805C820 - - thumb_func_start sub_805C834 -sub_805C834: @ 805C834 - push {lr} - movs r0, 0x1 - movs r1, 0 - bl dp01_build_cmdbuf_x23_aa_0 - bl dp01_tbl1_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_805C834 - - thumb_func_start sub_805C848 -sub_805C848: @ 805C848 - push {lr} - movs r0, 0x1 - movs r1, 0 - bl dp01_build_cmdbuf_x24_aa_0 - bl dp01_tbl1_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_805C848 - - thumb_func_start sub_805C85C -sub_805C85C: @ 805C85C - push {lr} - ldr r2, =0x02022d0c - ldrb r1, [r2] - movs r0, 0x80 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - bl dp01_tbl1_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C85C - - thumb_func_start sub_805C878 -sub_805C878: @ 805C878 - push {lr} - ldr r3, =0x02022d0c - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - movs r1, 0x7F - ands r1, r0 - ldrb r2, [r3] - movs r0, 0x80 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - bl dp01_tbl1_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C878 - - thumb_func_start sub_805C8B0 -sub_805C8B0: @ 805C8B0 - push {lr} - ldr r2, =0x02022d0c - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - bl dp01_tbl1_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C8B0 - - thumb_func_start sub_805C8C8 -sub_805C8C8: @ 805C8C8 - push {lr} - ldr r3, =0x02022d0c - ldr r1, [r3] - lsls r1, 24 - lsrs r1, 31 - movs r0, 0x1 - eors r1, r0 - lsls r1, 7 - ldrb r2, [r3] - movs r0, 0x7F - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - bl dp01_tbl1_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C8C8 - - thumb_func_start dp01t_29_1_blink -dp01t_29_1_blink: @ 805C8F0 - push {r4,lr} - ldr r3, =0x02020630 - ldr r2, =0x020241e4 - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - bge _0805C924 - bl dp01_tbl1_exec_completed - b _0805C94E - .pool -_0805C924: - ldr r1, =0x020244b9 - movs r0, 0x1 - strb r0, [r1] - ldrb r0, [r4] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0 - strh r1, [r0, 0x30] - ldrb r0, [r4] - bl sub_80769F4 - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_blink_t1 - str r1, [r0] -_0805C94E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_29_1_blink - - thumb_func_start sub_805C960 -sub_805C960: @ 805C960 - push {lr} - bl dp01_tbl1_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_805C960 - - thumb_func_start sub_805C96C -sub_805C96C: @ 805C96C - push {r4,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - movs r3, 0x3F - cmp r0, 0 - bne _0805C980 - movs r3, 0xC0 -_0805C980: - ldr r2, =0x02023064 - ldrb r1, [r4] - lsls r1, 9 - adds r0, r2, 0x1 - adds r0, r1, r0 - ldrb r0, [r0] - adds r2, 0x2 - adds r1, r2 - ldrb r1, [r1] - lsls r1, 8 - orrs r0, r1 - lsls r1, r3, 24 - asrs r1, 24 - bl audio_play_and_stuff - bl dp01_tbl1_exec_completed - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C96C - - thumb_func_start sub_805C9B0 -sub_805C9B0: @ 805C9B0 - push {r4,r5,lr} - ldr r4, =0x02023064 - ldr r5, =0x02024064 - ldrb r0, [r5] - lsls r3, r0, 9 - adds r0, r4, 0x3 - adds r0, r3, r0 - ldrb r0, [r0] - cmp r0, 0 - beq _0805C9EC - bl sub_805EA60 - ldrb r1, [r5] - lsls r1, 9 - adds r0, r4, 0x1 - adds r0, r1, r0 - ldrb r0, [r0] - adds r2, r4, 0x2 - adds r1, r2 - ldrb r1, [r1] - lsls r1, 8 - orrs r0, r1 - bl song_play_for_text - b _0805CA00 - .pool -_0805C9EC: - adds r0, r4, 0x1 - adds r0, r3, r0 - ldrb r0, [r0] - adds r1, r4, 0x2 - adds r1, r3, r1 - ldrb r1, [r1] - lsls r1, 8 - orrs r0, r1 - bl fanfare_play -_0805CA00: - bl dp01_tbl1_exec_completed - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_805C9B0 - - thumb_func_start sub_805CA0C -sub_805CA0C: @ 805CA0C - push {lr} - ldr r1, =0x0202406e - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x19 - negs r1, r1 - movs r2, 0x5 - bl sub_80A32E4 - bl dp01_tbl1_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_805CA0C - - thumb_func_start dp01t_2E_1_battle_intro -dp01t_2E_1_battle_intro: @ 805CA4C - push {lr} - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - bl battle_intro_launch - ldr r2, =0x020243fc - ldrh r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strh r0, [r2] - bl dp01_tbl1_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_2E_1_battle_intro - - thumb_func_start dp01t_2F_1_pokemon_enter -dp01t_2F_1_pokemon_enter: @ 805CA80 - push {r4-r7,lr} - ldr r6, =0x020241e4 - ldr r7, =0x02024064 - ldrb r0, [r7] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =0x02020630 - adds r0, r5 - bl oamt_add_pos2_onto_pos1 - ldrb r0, [r7] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x32 - strh r1, [r0, 0x2E] - ldrb r0, [r7] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =0x0000ffd8 - strh r1, [r0, 0x32] - ldrb r0, [r7] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrh r1, [r0, 0x22] - strh r1, [r0, 0x36] - ldrb r0, [r7] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r5, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_80A6EEC - str r1, [r0] - ldrb r2, [r7] - adds r0, r2, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x38] - ldrb r0, [r7] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =sub_805CC00 - bl oamt_set_x3A_32 - ldrb r0, [r7] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x1 - bl StartObjectImageAnim - ldr r0, =0x0000d6f8 - bl AllocObjectPalette - adds r4, r0, 0 - lsls r4, 24 - ldr r1, =gTrainerBackPicPaletteTable - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 3 - adds r0, r1 - ldr r0, [r0] - lsrs r4, 20 - movs r2, 0x80 - lsls r2, 1 - adds r1, r4, r2 - movs r2, 0x20 - bl decompress_palette - ldrb r0, [r7] - adds r0, r6 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r4 - strb r0, [r1, 0x5] - ldr r0, =task05_08033660 - movs r1, 0x5 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r4 - ldrb r0, [r7] - strh r0, [r1, 0x8] - ldr r3, =0x020244d0 - ldr r0, [r3] - ldrb r2, [r7] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0805CBA2 - ldr r0, =0x020244b4 - adds r0, r2, r0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - ldr r1, =sub_8073C30 - str r1, [r0] -_0805CBA2: - ldr r0, [r3] - ldr r2, [r0, 0x8] - ldrb r0, [r2, 0x9] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x9] - ldr r1, =0x03005d60 - ldrb r0, [r7] - lsls r0, 2 - adds r0, r1 - ldr r1, =nullsub_21 - str r1, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_2F_1_pokemon_enter - - thumb_func_start sub_805CC00 -sub_805CC00: @ 805CC00 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r4, [r5, 0x38] - lsls r4, 24 - lsrs r4, 24 - bl obj_free_rotscale_entry - ldrb r0, [r5, 0x5] - lsrs r0, 4 - bl GetObjectPaletteTagBySlot - lsls r0, 16 - lsrs r0, 16 - bl FreeObjectPaletteByTag - adds r0, r5, 0 - bl RemoveObjectAndFreeTiles - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - adds r1, r4, 0 - bl sub_805DD7C - ldr r0, =0x020241e4 - adds r4, r0 - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r1, 0 - bl StartObjectImageAnim - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805CC00 - - thumb_func_start task05_08033660 -task05_08033660: @ 805CC68 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r1, =0x03005e00 - lsls r0, 2 - add r0, r8 - lsls r0, 3 - adds r1, r0, r1 - ldrh r2, [r1, 0xA] - movs r3, 0xA - ldrsh r0, [r1, r3] - cmp r0, 0x1E - bgt _0805CC94 - adds r0, r2, 0x1 - strh r0, [r1, 0xA] - b _0805CD50 - .pool -_0805CC94: - ldr r7, =0x02024064 - ldrb r0, [r7] - mov r9, r0 - ldrh r0, [r1, 0x8] - strb r0, [r7] - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0805CCB4 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0805CCE4 -_0805CCB4: - ldr r0, =0x02023064 - ldrb r1, [r7] - lsls r2, r1, 9 - adds r0, 0x1 - adds r2, r0 - ldr r0, =0x0202406e - lsls r1, 1 - adds r1, r0 - ldrh r0, [r1] - strb r0, [r2] - ldrb r0, [r7] - movs r1, 0 - bl sub_805B258 - b _0805CD38 - .pool -_0805CCE4: - ldr r4, =0x02023064 - ldrb r0, [r7] - lsls r1, r0, 9 - adds r4, 0x1 - adds r1, r4 - ldr r5, =0x0202406e - lsls r0, 1 - adds r0, r5 - ldrh r0, [r0] - strb r0, [r1] - ldrb r0, [r7] - movs r1, 0 - bl sub_805B258 - ldrb r0, [r7] - movs r6, 0x2 - eors r0, r6 - strb r0, [r7] - ldrb r0, [r7] - lsls r1, r0, 9 - adds r1, r4 - lsls r0, 1 - adds r0, r5 - ldrh r0, [r0] - strb r0, [r1] - ldrb r1, [r7] - lsls r0, r1, 1 - adds r0, r5 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =0x020244ec - adds r0, r2 - bl sub_805DD7C - ldrb r0, [r7] - movs r1, 0 - bl sub_805B258 - ldrb r0, [r7] - eors r0, r6 - strb r0, [r7] -_0805CD38: - ldr r1, =0x03005d60 - ldr r2, =0x02024064 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8058B40 - str r1, [r0] - mov r3, r9 - strb r3, [r2] - mov r0, r8 - bl remove_task -_0805CD50: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end task05_08033660 - - thumb_func_start sub_805CD74 -sub_805CD74: @ 805CD74 - push {r4-r6,lr} - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _0805CDA4 - adds r0, r2, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0805CDA4 - bl dp01_tbl1_exec_completed - b _0805CE18 - .pool -_0805CDA4: - ldr r6, =0x020244d0 - ldr r0, [r6] - ldr r5, =0x02024064 - ldrb r1, [r5] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] - ldrb r0, [r5] - lsls r3, r0, 9 - ldr r4, =0x02023068 - adds r1, r3, r4 - subs r2, r4, 0x3 - adds r2, r3, r2 - ldrb r2, [r2] - subs r4, 0x2 - adds r3, r4 - ldrb r3, [r3] - bl sub_80735DC - ldr r2, =0x020244b4 - ldrb r1, [r5] - adds r1, r2 - movs r3, 0 - strb r0, [r1] - ldr r0, [r6] - ldrb r1, [r5] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strb r3, [r0, 0x5] - ldrb r2, [r5] - lsls r0, r2, 9 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - beq _0805CE0C - ldr r0, [r6] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - movs r1, 0x5D - strb r1, [r0, 0x5] -_0805CE0C: - ldr r0, =0x03005d60 - ldrb r1, [r5] - lsls r1, 2 - adds r1, r0 - ldr r0, =sub_805CE38 - str r0, [r1] -_0805CE18: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805CD74 - - thumb_func_start sub_805CE38 -sub_805CE38: @ 805CE38 - push {r4,lr} - ldr r4, =0x020244d0 - ldr r0, [r4] - ldr r3, =0x02024064 - ldrb r1, [r3] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x5] - adds r2, r1, 0x1 - strb r2, [r0, 0x5] - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x5C - bls _0805CE70 - ldr r0, [r4] - ldrb r1, [r3] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strb r1, [r0, 0x5] - bl dp01_tbl1_exec_completed -_0805CE70: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805CE38 - - thumb_func_start sub_805CE80 -sub_805CE80: @ 805CE80 - push {lr} - ldr r0, =0x020244d0 - ldr r1, [r0] - ldr r0, =0x02024064 - ldrb r3, [r0] - ldr r1, [r1, 0x4] - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0805CEB2 - ldr r2, =0x03005e00 - ldr r0, =0x020244b4 - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldr r1, =sub_8073C30 - str r1, [r0] -_0805CEB2: - bl dp01_tbl1_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_805CE80 - - thumb_func_start sub_805CED0 -sub_805CED0: @ 805CED0 - push {r4,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - movs r1, 0x1 - bl dp11b_obj_free - ldrb r0, [r4] - movs r1, 0 - bl dp11b_obj_free - bl dp01_tbl1_exec_completed - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805CED0 - - thumb_func_start dp01t_33_1_enemy_move -dp01t_33_1_enemy_move: @ 805CEF4 - push {r4,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - bl sub_80A6A90 - lsls r0, 24 - cmp r0, 0 - beq _0805CF3A - ldr r3, =0x02020630 - ldr r0, =0x020241e4 - ldrb r1, [r4] - adds r0, r1, r0 - ldrb r0, [r0] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r3 - ldr r0, =0x02023064 - lsls r1, 9 - adds r0, 0x1 - adds r1, r0 - adds r2, 0x3E - movs r0, 0x1 - ldrb r1, [r1] - ands r1, r0 - lsls r1, 2 - ldrb r3, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldrb r0, [r4] - bl sub_805E408 -_0805CF3A: - bl dp01_tbl1_exec_completed - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_33_1_enemy_move - - thumb_func_start sub_805CF54 -sub_805CF54: @ 805CF54 - push {r4-r6,lr} - sub sp, 0x4 - ldr r5, =0x02024064 - ldrb r0, [r5] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _0805CFB6 - ldr r4, =0x02023064 - ldrb r2, [r5] - lsls r1, r2, 9 - adds r0, r4, 0x1 - adds r0, r1, r0 - ldrb r6, [r0] - adds r0, r4, 0x2 - adds r0, r1, r0 - ldrb r3, [r0] - adds r4, 0x3 - adds r1, r4 - ldrb r0, [r1] - lsls r0, 8 - orrs r3, r0 - str r3, [sp] - adds r0, r2, 0 - adds r1, r2, 0 - adds r3, r6, 0 - bl move_anim_start_t3 - lsls r0, 24 - cmp r0, 0 - beq _0805CFA4 - bl dp01_tbl1_exec_completed - b _0805CFB0 - .pool -_0805CFA4: - ldr r0, =0x03005d60 - ldrb r1, [r5] - lsls r1, 2 - adds r1, r0 - ldr r0, =bx_8030B2C - str r0, [r1] -_0805CFB0: - adds r0, r6, 0 - bl sub_817E32C -_0805CFB6: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805CF54 - - thumb_func_start dp01t_35_1_link_standby_message_and_free_vram -dp01t_35_1_link_standby_message_and_free_vram: @ 805CFC8 - push {r4,r5,lr} - ldr r5, =0x02024064 - ldrb r0, [r5] - lsls r0, 9 - ldr r4, =0x02023066 - adds r0, r4 - bl sub_81851A8 - ldrb r0, [r5] - lsls r0, 9 - subs r4, 0x1 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0805D002 - cmp r0, 0x1 - bgt _0805CFF8 - cmp r0, 0 - beq _0805CFFE - b _0805D020 - .pool -_0805CFF8: - cmp r0, 0x2 - beq _0805D01C - b _0805D020 -_0805CFFE: - bl b_link_standby_message -_0805D002: - ldr r4, =0x02024064 - ldrb r0, [r4] - movs r1, 0x1 - bl dp11b_obj_free - ldrb r0, [r4] - movs r1, 0 - bl dp11b_obj_free - b _0805D020 - .pool -_0805D01C: - bl b_link_standby_message -_0805D020: - bl dp01_tbl1_exec_completed - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end dp01t_35_1_link_standby_message_and_free_vram - - thumb_func_start sub_805D02C -sub_805D02C: @ 805D02C - push {r4,lr} - ldr r1, =0x02023064 - ldr r4, =0x02024064 - ldrb r3, [r4] - lsls r0, r3, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r2, [r0] - cmp r2, 0x1 - beq _0805D074 - cmp r2, 0x1 - bgt _0805D054 - cmp r2, 0 - beq _0805D05A - b _0805D084 - .pool -_0805D054: - cmp r2, 0x2 - beq _0805D07C - b _0805D084 -_0805D05A: - ldr r0, =0x020244ac - adds r0, r3, r0 - strb r2, [r0] - ldr r1, =0x020244b0 - ldrb r0, [r4] - adds r0, r1 - strb r2, [r0] - b _0805D084 - .pool -_0805D074: - ldr r0, =0x020244ac - b _0805D07E - .pool -_0805D07C: - ldr r0, =0x020244b0 -_0805D07E: - adds r0, r3, r0 - movs r1, 0 - strb r1, [r0] -_0805D084: - bl dp01_tbl1_exec_completed - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805D02C - - thumb_func_start sub_805D094 -sub_805D094: @ 805D094 - push {r4,r5,lr} - ldr r5, =0x02024064 - ldrb r0, [r5] - lsls r0, 9 - ldr r4, =0x02023068 - adds r0, r4 - bl sub_81851A8 - ldr r2, =0x0202433a - ldrb r0, [r5] - lsls r0, 9 - subs r1, r4, 0x3 - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - ldr r0, =0x03005d90 - ldr r3, [r0] - ldrb r0, [r5] - lsls r0, 9 - subs r4, 0x2 - adds r0, r4 - ldrb r0, [r0] - ldr r1, =0x00000ca9 - adds r3, r1 - movs r1, 0x1 - ands r1, r0 - lsls r1, 3 - ldrb r2, [r3] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - movs r0, 0x5 - bl sub_80A2F50 - movs r0, 0x3 - bl sub_80A2390 - bl dp01_tbl1_exec_completed - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_80587B0 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805D094 - - thumb_func_start nullsub_22 -nullsub_22: @ 805D114 - bx lr - thumb_func_end nullsub_22 - - thumb_func_start dp11_init -dp11_init: @ 805D118 - push {r4,lr} - ldr r4, =0x020244d0 - movs r0, 0x10 - bl AllocZeroed - str r0, [r4] - movs r0, 0x10 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1] - movs r0, 0x30 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1, 0x4] - movs r0, 0x10 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1, 0x8] - movs r0, 0x50 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1, 0xC] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp11_init - - thumb_func_start dp11_free -dp11_free: @ 805D158 - push {r4,r5,lr} - ldr r5, =0x020244d0 - ldr r0, [r5] - cmp r0, 0 - beq _0805D192 - ldr r0, [r0, 0xC] - bl Free - ldr r0, [r5] - movs r4, 0 - str r4, [r0, 0xC] - ldr r0, [r0, 0x8] - bl Free - ldr r0, [r5] - str r4, [r0, 0x8] - ldr r0, [r0, 0x4] - bl Free - ldr r0, [r5] - str r4, [r0, 0x4] - ldr r0, [r0] - bl Free - ldr r0, [r5] - str r4, [r0] - bl Free - str r4, [r5] -_0805D192: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end dp11_free - - thumb_func_start sub_805D19C -sub_805D19C: @ 805D19C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r0, 0x1 - negs r0, r0 - mov r9, r0 - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r2, r0, 9 - ldr r1, =0x02023068 - adds r2, r1 - mov r10, r2 - movs r1, 0 - movs r2, 0xFF - bl sub_803FECC - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r7, r0, 16 - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x92 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - negs r0, r1 - orrs r0, r1 - asrs r4, r0, 31 - movs r0, 0x2 - ands r4, r0 - adds r6, r4, 0 - adds r5, r4, 0x2 - b _0805D20E - .pool -_0805D20C: - adds r4, 0x1 -_0805D20E: - cmp r4, r5 - bge _0805D234 - ldr r0, =0x02024064 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - ldr r1, =0x020240cc - adds r0, r1 - ldr r0, [r0] - bl GetNatureFromPersonality - lsls r0, 24 - lsrs r0, 22 - adds r0, r4, r0 - ldr r2, =gUnknown_0831C494 - adds r0, r2 - ldrb r0, [r0] - cmp r0, r7 - ble _0805D20C -_0805D234: - subs r7, r4, r6 - cmp r4, r5 - bne _0805D23C - movs r7, 0x2 -_0805D23C: - movs r6, 0 - movs r4, 0 - mov r1, r10 - ldrh r0, [r1] - cmp r0, 0 - beq _0805D27C - mov r5, r10 -_0805D24A: - ldrh r0, [r5] - bl sub_805D4A8 - lsls r0, 24 - lsrs r0, 24 - cmp r7, r0 - bne _0805D26E - mov r0, r10 - adds r0, 0x8 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - beq _0805D26E - ldr r0, =gUnknown_0832A328 - lsls r1, r4, 2 - adds r1, r0 - ldr r0, [r1] - orrs r6, r0 -_0805D26E: - adds r5, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - bgt _0805D27C - ldrh r0, [r5] - cmp r0, 0 - bne _0805D24A -_0805D27C: - cmp r6, 0 - beq _0805D2AC - ldr r3, =0x0202449c - ldr r1, [r3] - adds r1, 0x92 - ldrb r2, [r1] - movs r0, 0xF - ands r0, r2 - strb r0, [r1] - ldr r1, [r3] - adds r1, 0x92 - lsls r0, r6, 4 - ldrb r2, [r1] - orrs r0, r2 - strb r0, [r1] - lsls r0, r6, 24 - lsrs r0, 24 - bl sub_8130950 - bl sub_8130BA4 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_0805D2AC: - movs r0, 0x1 - negs r0, r0 - cmp r9, r0 - beq _0805D2B6 - b _0805D40C -_0805D2B6: - mov r2, r8 - cmp r2, 0xF - bne _0805D2BE - b _0805D3EA -_0805D2BE: - movs r5, 0 - movs r6, 0 - ldr r7, =gUnknown_0832A328 - mov r4, r10 -_0805D2C6: - ldrh r0, [r4] - bl sub_805D4A8 - lsls r0, 24 - cmp r0, 0 - bne _0805D2DE - ldr r0, [r7] - mov r1, r8 - ands r0, r1 - cmp r0, 0 - bne _0805D2DE - adds r5, 0x1 -_0805D2DE: - ldrh r0, [r4] - bl sub_805D4A8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0805D2F8 - ldr r0, [r7] - mov r2, r8 - ands r0, r2 - cmp r0, 0 - bne _0805D2F8 - adds r5, 0x10 -_0805D2F8: - ldrh r0, [r4] - bl sub_805D4A8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _0805D316 - ldr r0, [r7] - mov r1, r8 - ands r0, r1 - cmp r0, 0 - bne _0805D316 - movs r2, 0x80 - lsls r2, 1 - adds r5, r2 -_0805D316: - adds r7, 0x4 - adds r4, 0x2 - ldr r0, =gUnknown_0832A328 - adds r0, 0xC - cmp r7, r0 - ble _0805D2C6 - movs r1, 0xF - ands r1, r5 - cmp r1, 0x1 - ble _0805D32C - adds r6, 0x1 -_0805D32C: - movs r0, 0xF0 - ands r0, r5 - cmp r0, 0x1F - ble _0805D336 - adds r6, 0x1 -_0805D336: - ldr r2, =0x000001ff - cmp r0, r2 - ble _0805D33E - adds r6, 0x1 -_0805D33E: - cmp r6, 0x1 - bgt _0805D346 - cmp r6, 0 - bne _0805D388 -_0805D346: - ldr r5, =gUnknown_0832A328 -_0805D348: - bl GenerateRandomNumber - lsls r0, 16 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r0 - lsrs r4, r1, 16 - lsls r0, r4, 2 - adds r0, r5 - ldr r0, [r0] - mov r1, r8 - ands r0, r1 - cmp r0, 0 - bne _0805D366 - mov r9, r4 -_0805D366: - movs r0, 0x1 - negs r0, r0 - cmp r9, r0 - beq _0805D348 - b _0805D3D4 - .pool -_0805D388: - cmp r1, 0x1 - ble _0805D38E - movs r6, 0 -_0805D38E: - cmp r0, 0x1F - ble _0805D394 - movs r6, 0x1 -_0805D394: - cmp r0, r2 - ble _0805D39A - movs r6, 0x2 -_0805D39A: - bl GenerateRandomNumber - lsls r0, 16 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r0 - lsrs r4, r1, 16 - ldr r1, =gUnknown_0832A328 - lsls r0, r4, 2 - adds r0, r1 - ldr r0, [r0] - mov r2, r8 - ands r0, r2 - cmp r0, 0 - bne _0805D3CC - lsls r0, r4, 1 - add r0, r10 - ldrh r0, [r0] - bl sub_805D4A8 - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - bne _0805D3CC - mov r9, r4 -_0805D3CC: - movs r0, 0x1 - negs r0, r0 - cmp r9, r0 - beq _0805D39A -_0805D3D4: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x31 - bls _0805D40C -_0805D3EA: - ldr r2, =0x0202433c - ldr r0, =0x02024064 - ldrb r1, [r0] - lsls r1, 4 - adds r1, r2 - ldrb r0, [r1, 0x2] - movs r2, 0x10 - orrs r0, r2 - strb r0, [r1, 0x2] - movs r0, 0 - b _0805D496 - .pool -_0805D40C: - mov r1, r9 - lsls r0, r1, 1 - mov r2, r10 - adds r1, r2, r0 - ldrh r0, [r1] - cmp r0, 0xAE - bne _0805D434 - ldrb r0, [r2, 0x12] - movs r5, 0 - cmp r0, 0x7 - beq _0805D442 - ldrb r1, [r2, 0x13] - movs r0, 0x7 - eors r1, r0 - negs r0, r1 - orrs r0, r1 - asrs r5, r0, 31 - movs r0, 0x10 - ands r5, r0 - b _0805D442 -_0805D434: - ldr r2, =gBattleMoves - ldrh r1, [r1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r5, [r0, 0x6] -_0805D442: - movs r0, 0x10 - ands r0, r5 - cmp r0, 0 - beq _0805D45C - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 8 - b _0805D48A - .pool -_0805D45C: - cmp r5, 0 - bne _0805D470 - bl sub_805D5F4 - lsls r0, 16 - lsrs r0, 16 - mov r2, r9 - orrs r2, r0 - mov r9, r2 - b _0805D490 -_0805D470: - ldr r0, =0x02024064 - ldrb r0, [r0] - bl battle_get_per_side_status - adds r1, r0, 0 - movs r2, 0x1 - movs r0, 0x1 - ands r0, r1 - eors r0, r2 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 16 -_0805D48A: - mov r1, r9 - orrs r1, r0 - mov r9, r1 -_0805D490: - mov r2, r9 - lsls r0, r2, 16 - lsrs r0, 16 -_0805D496: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_805D19C - - thumb_func_start sub_805D4A8 -sub_805D4A8: @ 805D4A8 - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - ldr r1, =gBattleMoves - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x6] - adds r3, r1, 0 - cmp r0, 0x40 - bls _0805D4C2 - b _0805D5EE -_0805D4C2: - lsls r0, 2 - ldr r1, =_0805D4D4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0805D4D4: - .4byte _0805D5D8 - .4byte _0805D5E6 - .4byte _0805D5D8 - .4byte _0805D5EE - .4byte _0805D5D8 - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5D8 - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EA - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5D8 - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5E6 -_0805D5D8: - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x1] - cmp r0, 0 - bne _0805D5EE -_0805D5E6: - movs r0, 0x2 - b _0805D5F0 -_0805D5EA: - movs r0, 0x1 - b _0805D5F0 -_0805D5EE: - movs r0, 0 -_0805D5F0: - pop {r1} - bx r1 - thumb_func_end sub_805D4A8 - - thumb_func_start sub_805D5F4 -sub_805D5F4: @ 805D5F4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0805D6FA - ldr r0, =0x02024064 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0805D630 - movs r0, 0x1 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r0, 0x3 - b _0805D63E - .pool -_0805D630: - movs r0, 0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r0, 0x2 -_0805D63E: - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =0x02024084 - movs r2, 0x58 - mov r0, r8 - muls r0, r2 - adds r5, r0, r1 - adds r0, r7, 0 - muls r0, r2 - adds r6, r0, r1 - ldrh r0, [r5, 0x28] - ldrh r3, [r6, 0x28] - cmp r0, r3 - bne _0805D680 - bl GenerateRandomNumber - adds r3, r0, 0 - ldr r0, =0x02024064 - ldrb r1, [r0] - movs r2, 0x1 - movs r0, 0x1 - ands r0, r1 - eors r0, r2 - movs r1, 0x2 - ands r1, r3 - adds r0, r1 - b _0805D702 - .pool -_0805D680: - ldr r4, =gUnknown_0831C604 - ldr r0, =0x02024064 - mov r9, r0 - ldrb r0, [r0] - muls r0, r2 - adds r1, 0x48 - adds r0, r1 - ldr r0, [r0] - bl GetNatureFromPersonality - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - ldrb r4, [r0] - cmp r4, 0x1 - beq _0805D6CC - cmp r4, 0x1 - bgt _0805D6B4 - cmp r4, 0 - beq _0805D6BA - b _0805D6FA - .pool -_0805D6B4: - cmp r4, 0x2 - beq _0805D6DE - b _0805D6FA -_0805D6BA: - ldrh r0, [r5, 0x28] - ldrh r6, [r6, 0x28] - cmp r0, r6 - bls _0805D6C8 - mov r1, r8 - lsls r0, r1, 8 - b _0805D704 -_0805D6C8: - lsls r0, r7, 8 - b _0805D704 -_0805D6CC: - ldrh r0, [r5, 0x28] - ldrh r6, [r6, 0x28] - cmp r0, r6 - bcs _0805D6DA - mov r3, r8 - lsls r0, r3, 8 - b _0805D704 -_0805D6DA: - lsls r0, r7, 8 - b _0805D704 -_0805D6DE: - bl GenerateRandomNumber - adds r3, r0, 0 - mov r0, r9 - ldrb r1, [r0] - movs r2, 0x1 - movs r0, 0x1 - ands r0, r1 - eors r0, r2 - ands r4, r3 - adds r0, r4 - lsls r0, 24 - lsrs r0, 16 - b _0805D704 -_0805D6FA: - ldr r0, =0x02024064 - ldrb r1, [r0] - movs r0, 0x1 - eors r0, r1 -_0805D702: - lsls r0, 8 -_0805D704: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_805D5F4 - - thumb_func_start sub_805D714 -sub_805D714: @ 805D714 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x30] - lsls r1, 24 - lsrs r1, 24 - ldr r2, =0x02020630 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - adds r0, r1, 0 - adds r0, 0x3F - ldrb r3, [r0] - lsls r0, r3, 26 - cmp r0, 0 - bge _0805D766 - adds r0, r1, 0 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _0805D766 - adds r2, r1, 0 - adds r2, 0x2C - ldrb r1, [r2] - lsls r0, r1, 25 - cmp r0, 0 - bge _0805D75C - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - b _0805D766 - .pool -_0805D75C: - lsls r0, r3, 27 - cmp r0, 0 - bge _0805D766 - ldr r0, =DummyObjectCallback - str r0, [r4, 0x1C] -_0805D766: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805D714 - - thumb_func_start sub_805D770 -sub_805D770: @ 805D770 - push {r4,lr} - adds r4, r0, 0 - lsls r1, 24 - adds r3, r4, 0 - adds r3, 0x2C - ldrb r0, [r3] - movs r2, 0x40 - orrs r0, r2 - strb r0, [r3] - ldr r0, =DummyObjectCallback - str r0, [r4, 0x1C] - cmp r1, 0 - bne _0805D798 - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim - b _0805D7A0 - .pool -_0805D798: - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim -_0805D7A0: - adds r0, r4, 0 - bl AnimateObject - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_805D770 - - thumb_func_start sub_805D7AC -sub_805D7AC: @ 805D7AC - push {lr} - adds r2, r0, 0 - ldr r0, =0x020243fc - ldrh r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0805D7E4 - ldrh r0, [r2, 0x2E] - ldrh r1, [r2, 0x24] - adds r0, r1 - strh r0, [r2, 0x24] - lsls r0, 16 - cmp r0, 0 - bne _0805D7E4 - movs r1, 0x26 - ldrsh r0, [r2, r1] - cmp r0, 0 - beq _0805D7E0 - ldr r0, =sub_805D7EC - b _0805D7E2 - .pool -_0805D7E0: - ldr r0, =DummyObjectCallback -_0805D7E2: - str r0, [r2, 0x1C] -_0805D7E4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_805D7AC - - thumb_func_start sub_805D7EC -sub_805D7EC: @ 805D7EC - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x26] - subs r0, 0x2 - strh r0, [r1, 0x26] - lsls r0, 16 - cmp r0, 0 - bne _0805D800 - ldr r0, =DummyObjectCallback - str r0, [r1, 0x1C] -_0805D800: - pop {r0} - bx r0 - .pool - thumb_func_end sub_805D7EC - - thumb_func_start move_anim_start_t2_for_situation -move_anim_start_t2_for_situation: @ 805D808 - push {r4-r6,lr} - adds r4, r1, 0 - lsls r0, 24 - ldr r6, =0x020244d0 - ldr r1, [r6] - ldr r5, =0x02024064 - ldrb r2, [r5] - ldr r3, [r1, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r3 - ldrb r2, [r1] - movs r3, 0x10 - orrs r2, r3 - strb r2, [r1] - cmp r0, 0 - bne _0805D888 - cmp r4, 0x20 - bne _0805D844 - ldrb r0, [r5] - movs r1, 0x6 - bl move_anim_start_t2 - b _0805D902 - .pool -_0805D844: - cmp r4, 0x8 - beq _0805D850 - movs r0, 0x80 - ands r0, r4 - cmp r0, 0 - beq _0805D85A -_0805D850: - ldrb r0, [r5] - movs r1, 0 - bl move_anim_start_t2 - b _0805D902 -_0805D85A: - cmp r4, 0x10 - bne _0805D868 - ldrb r0, [r5] - movs r1, 0x2 - bl move_anim_start_t2 - b _0805D902 -_0805D868: - movs r0, 0x7 - ands r0, r4 - cmp r0, 0 - beq _0805D87A - ldrb r0, [r5] - movs r1, 0x4 - bl move_anim_start_t2 - b _0805D902 -_0805D87A: - cmp r4, 0x40 - bne _0805D8EA - ldrb r0, [r5] - movs r1, 0x5 - bl move_anim_start_t2 - b _0805D902 -_0805D888: - movs r0, 0xF0 - lsls r0, 12 - ands r0, r4 - cmp r0, 0 - beq _0805D89C - ldrb r0, [r5] - movs r1, 0x3 - bl move_anim_start_t2 - b _0805D902 -_0805D89C: - movs r0, 0x7 - ands r0, r4 - cmp r0, 0 - beq _0805D8AE - ldrb r0, [r5] - movs r1, 0x1 - bl move_anim_start_t2 - b _0805D902 -_0805D8AE: - movs r0, 0x80 - lsls r0, 21 - ands r0, r4 - cmp r0, 0 - beq _0805D8C2 - ldrb r0, [r5] - movs r1, 0x7 - bl move_anim_start_t2 - b _0805D902 -_0805D8C2: - movs r0, 0x80 - lsls r0, 20 - ands r0, r4 - cmp r0, 0 - beq _0805D8D6 - ldrb r0, [r5] - movs r1, 0x8 - bl move_anim_start_t2 - b _0805D902 -_0805D8D6: - movs r0, 0xE0 - lsls r0, 8 - ands r0, r4 - cmp r0, 0 - beq _0805D8EA - ldrb r0, [r5] - movs r1, 0x9 - bl move_anim_start_t2 - b _0805D902 -_0805D8EA: - ldr r0, [r6] - ldrb r2, [r5] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x11 - negs r0, r0 - ands r0, r2 - strb r0, [r1] -_0805D902: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end move_anim_start_t2_for_situation - - thumb_func_start move_anim_start_t3 -move_anim_start_t3: @ 805D908 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - ldr r4, [sp, 0x24] - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp] - lsls r3, 24 - lsrs r5, r3, 24 - lsls r4, 16 - lsrs r7, r4, 16 - cmp r5, 0 - bne _0805D950 - movs r0, 0x80 - ands r0, r7 - cmp r0, 0 - beq _0805D950 - ldr r0, =0x020244e4 - adds r0, r6, r0 - movs r2, 0x7F - adds r1, r7, 0 - ands r1, r2 - strb r1, [r0] - movs r0, 0x1 - b _0805DA1E - .pool -_0805D950: - ldr r0, =0x020244d0 - mov r9, r0 - ldr r0, [r0] - ldr r0, [r0] - lsls r4, r6, 2 - adds r0, r4, r0 - ldrb r1, [r0] - movs r2, 0x4 - mov r8, r2 - mov r0, r8 - ands r0, r1 - cmp r0, 0 - beq _0805D9CC - adds r0, r5, 0 - bl sub_805DAA0 - lsls r0, 24 - cmp r0, 0 - bne _0805D980 - movs r0, 0x1 - b _0805DA1E - .pool -_0805D980: - mov r1, r9 - ldr r0, [r1] - ldr r0, [r0] - adds r0, r4, r0 - ldrb r1, [r0] - mov r0, r8 - ands r0, r1 - cmp r0, 0 - beq _0805D9CC - cmp r5, 0x2 - bne _0805D9CC - ldr r1, =0x02020630 - ldr r0, =0x020241e4 - adds r0, r6, r0 - ldrb r2, [r0] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - bge _0805D9CC - adds r0, r6, 0 - movs r1, 0x1 - bl refresh_graphics_maybe - adds r0, r6, 0 - bl sub_805E974 - movs r0, 0x1 - b _0805DA1E - .pool -_0805D9CC: - ldr r0, =0x02038436 - mov r2, r10 - strb r2, [r0] - ldr r0, =0x02038437 - mov r1, sp - ldrb r1, [r1] - strb r1, [r0] - ldr r4, =0x020244d0 - ldr r0, [r4] - ldr r0, [r0, 0x8] - strh r7, [r0] - ldr r0, =gUnknown_082C9320 - adds r1, r5, 0 - movs r2, 0 - bl move_something - ldr r0, =task0A_0803415C - movs r1, 0xA - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r6, [r1, 0x8] - ldr r0, [r4] - movs r2, 0x8 - ldrsh r1, [r1, r2] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0] - movs r0, 0 -_0805DA1E: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end move_anim_start_t3 - - thumb_func_start task0A_0803415C -task0A_0803415C: @ 805DA48 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x020383f8 - ldr r0, [r0] - bl _call_via_r0 - ldr r0, =0x020383fd - ldrb r0, [r0] - cmp r0, 0 - bne _0805DA8A - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0x8 - ldrsh r0, [r0, r1] - ldr r2, [r2, 0x4] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r2, [r1] - movs r0, 0x21 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - adds r0, r4, 0 - bl remove_task -_0805DA8A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task0A_0803415C - - thumb_func_start sub_805DAA0 -sub_805DAA0: @ 805DAA0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xD - bgt _0805DAB4 - cmp r0, 0xA - bge _0805DAB8 - cmp r0, 0x2 - beq _0805DAB8 - b _0805DABC -_0805DAB4: - cmp r0, 0x11 - bne _0805DABC -_0805DAB8: - movs r0, 0x1 - b _0805DABE -_0805DABC: - movs r0, 0 -_0805DABE: - pop {r1} - bx r1 - thumb_func_end sub_805DAA0 - - thumb_func_start move_anim_start_t4 -move_anim_start_t4: @ 805DAC4 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =0x02038436 - strb r1, [r0] - ldr r0, =0x02038437 - strb r2, [r0] - ldr r0, =gUnknown_082C937C - adds r1, r3, 0 - movs r2, 0 - bl move_something - ldr r0, =task0A_08034248 - movs r1, 0xA - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] - ldr r0, =0x020244d0 - ldr r0, [r0] - movs r2, 0x8 - ldrsh r1, [r1, r2] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end move_anim_start_t4 - - thumb_func_start task0A_08034248 -task0A_08034248: @ 805DB34 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x020383f8 - ldr r0, [r0] - bl _call_via_r0 - ldr r0, =0x020383fd - ldrb r0, [r0] - cmp r0, 0 - bne _0805DB76 - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0x8 - ldrsh r0, [r0, r1] - ldr r2, [r2, 0x4] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r2, [r1] - movs r0, 0x41 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - adds r0, r4, 0 - bl remove_task -_0805DB76: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task0A_08034248 - - thumb_func_start sub_805DB8C -sub_805DB8C: @ 805DB8C - movs r0, 0 - bx lr - thumb_func_end sub_805DB8C - - thumb_func_start mplay_80342A4 -mplay_80342A4: @ 805DB90 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r5, 0 - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - beq _0805DBD8 - ldr r2, =0x020244d0 - ldr r0, [r2] - ldr r1, [r0, 0x4] - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x8] - adds r1, 0x1 - strb r1, [r0, 0x8] - ldr r2, [r2] - ldr r0, =0x02024064 - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x8] - cmp r0, 0x1D - bls _0805DBDC - ldr r0, =0x030075f0 - bl MPlayStop_rev01 - ldr r0, =0x03007630 - bl MPlayStop_rev01 -_0805DBD8: - cmp r5, 0 - beq _0805DBF0 -_0805DBDC: - movs r0, 0x1 - b _0805DC02 - .pool -_0805DBF0: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0, 0x4] - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - strb r5, [r0, 0x8] - movs r0, 0 -_0805DC02: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end mplay_80342A4 - - thumb_func_start sub_805DC0C -sub_805DC0C: @ 805DC0C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - adds r4, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - movs r1, 0 - bl pokemon_getattr - str r0, [sp] - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0] - mov r2, r8 - lsls r1, r2, 2 - adds r2, r1, r0 - ldrh r0, [r2, 0x2] - cmp r0, 0 - bne _0805DC50 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - ldr r6, [sp] - b _0805DC58 - .pool -_0805DC50: - ldrh r5, [r2, 0x2] - ldr r0, =0x020244bc - adds r0, r1, r0 - ldr r6, [r0] -_0805DC58: - adds r0, r4, 0 - movs r1, 0x1 - bl pokemon_getattr - mov r10, r0 - mov r0, r8 - bl battle_get_per_side_status - lsls r0, 24 - lsls r2, r5, 3 - ldr r1, =gMonFrontPicTable - adds r2, r1 - ldr r1, =0x020244d4 - ldr r1, [r1] - lsrs r0, 22 - adds r1, 0x4 - adds r1, r0 - ldr r1, [r1] - adds r0, r2, 0 - adds r2, r5, 0 - adds r3, r6, 0 - bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack - mov r3, r8 - lsls r2, r3, 4 - movs r0, 0x80 - lsls r0, 1 - adds r7, r2, r0 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0] - lsls r1, r3, 2 - adds r0, r1, r0 - ldrh r0, [r0, 0x2] - str r1, [sp, 0x4] - mov r9, r2 - cmp r0, 0 - bne _0805DCBC - adds r0, r4, 0 - bl pokemon_get_pal - b _0805DCC6 - .pool -_0805DCBC: - adds r0, r5, 0 - mov r1, r10 - ldr r2, [sp] - bl species_and_otid_get_pal -_0805DCC6: - adds r6, r0, 0 - ldr r4, =0x0201c000 - adds r0, r6, 0 - adds r1, r4, 0 - bl LZDecompressWram - adds r0, r4, 0 - adds r1, r7, 0 - movs r2, 0x20 - bl gpu_pal_apply - mov r1, r9 - adds r1, 0x80 - adds r0, r4, 0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =0x00000181 - cmp r5, r0 - bne _0805DD1A - movs r7, 0x80 - lsls r7, 1 - add r7, r9 - ldr r5, =0x0202449c - ldr r1, [r5] - movs r4, 0x80 - lsls r4, 1 - adds r1, r4 - adds r0, r6, 0 - bl LZDecompressWram - ldr r0, =0x020244e4 - add r0, r8 - ldrb r1, [r0] - lsls r1, 5 - adds r1, r4 - ldr r0, [r5] - adds r0, r1 - adds r1, r7, 0 - movs r2, 0x20 - bl gpu_pal_apply -_0805DD1A: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0] - ldr r1, [sp, 0x4] - adds r0, r1, r0 - ldrh r0, [r0, 0x2] - cmp r0, 0 - beq _0805DD46 - ldr r3, =0x00007fff - adds r0, r7, 0 - movs r1, 0x10 - movs r2, 0x6 - bl pal_fade_1 - lsls r1, r7, 1 - ldr r0, =0x02037b14 - adds r0, r1, r0 - ldr r2, =0x02037714 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet -_0805DD46: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805DC0C - - thumb_func_start sub_805DD7C -sub_805DD7C: @ 805DD7C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - adds r6, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - movs r1, 0 - bl pokemon_getattr - str r0, [sp] - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0] - mov r2, r8 - lsls r1, r2, 2 - adds r2, r1, r0 - ldrh r0, [r2, 0x2] - cmp r0, 0 - bne _0805DDC0 - adds r0, r6, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - ldr r4, [sp] - b _0805DDC8 - .pool -_0805DDC0: - ldrh r5, [r2, 0x2] - ldr r0, =0x020244bc - adds r0, r1, r0 - ldr r4, [r0] -_0805DDC8: - adds r0, r6, 0 - movs r1, 0x1 - bl pokemon_getattr - str r0, [sp, 0x4] - mov r0, r8 - bl battle_get_per_side_status - lsls r0, 24 - lsrs r7, r0, 24 - movs r0, 0x1 - mov r1, r8 - bl sub_80688F8 - lsls r0, 24 - lsrs r0, 24 - mov r1, r8 - lsls r1, 2 - mov r10, r1 - cmp r0, 0x1 - beq _0805DE00 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0] - add r0, r10 - ldrh r0, [r0, 0x2] - cmp r0, 0 - beq _0805DE2C -_0805DE00: - lsls r0, r5, 3 - ldr r1, =gMonBackPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r1, [r1] - lsls r2, r7, 2 - adds r1, 0x4 - adds r1, r2 - ldr r1, [r1] - adds r2, r5, 0 - adds r3, r4, 0 - bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack - b _0805DE46 - .pool -_0805DE2C: - lsls r0, r5, 3 - ldr r1, =gMonBackPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r1, [r1] - lsls r2, r7, 2 - adds r1, 0x4 - adds r1, r2 - ldr r1, [r1] - adds r2, r5, 0 - adds r3, r4, 0 - bl DecompressMonPic_DetectFrontOrBack -_0805DE46: - mov r2, r8 - lsls r1, r2, 4 - movs r0, 0x80 - lsls r0, 1 - adds r7, r1, r0 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0] - add r0, r10 - ldrh r0, [r0, 0x2] - mov r9, r1 - cmp r0, 0 - bne _0805DE74 - adds r0, r6, 0 - bl pokemon_get_pal - b _0805DE7E - .pool -_0805DE74: - adds r0, r5, 0 - ldr r1, [sp, 0x4] - ldr r2, [sp] - bl species_and_otid_get_pal -_0805DE7E: - adds r6, r0, 0 - ldr r4, =0x0201c000 - adds r0, r6, 0 - adds r1, r4, 0 - bl LZDecompressWram - adds r0, r4, 0 - adds r1, r7, 0 - movs r2, 0x20 - bl gpu_pal_apply - mov r1, r9 - adds r1, 0x80 - adds r0, r4, 0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =0x00000181 - cmp r5, r0 - bne _0805DED2 - movs r7, 0x80 - lsls r7, 1 - add r7, r9 - ldr r5, =0x0202449c - ldr r1, [r5] - movs r4, 0x80 - lsls r4, 1 - adds r1, r4 - adds r0, r6, 0 - bl LZDecompressWram - ldr r0, =0x020244e4 - add r0, r8 - ldrb r1, [r0] - lsls r1, 5 - adds r1, r4 - ldr r0, [r5] - adds r0, r1 - adds r1, r7, 0 - movs r2, 0x20 - bl gpu_pal_apply -_0805DED2: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0] - add r0, r10 - ldrh r0, [r0, 0x2] - cmp r0, 0 - beq _0805DEFC - ldr r3, =0x00007fff - adds r0, r7, 0 - movs r1, 0x10 - movs r2, 0x6 - bl pal_fade_1 - lsls r1, r7, 1 - ldr r0, =0x02037b14 - adds r0, r1, r0 - ldr r2, =0x02037714 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet -_0805DEFC: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805DD7C - - thumb_func_start nullsub_23 -nullsub_23: @ 805DF30 - bx lr - thumb_func_end nullsub_23 - - thumb_func_start nullsub_24 -nullsub_24: @ 805DF34 - bx lr - thumb_func_end nullsub_24 - - thumb_func_start sub_805DF38 -sub_805DF38: @ 805DF38 - push {r4,lr} - adds r4, r0, 0 - adds r0, r1, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_per_side_status - lsls r0, 24 - lsls r4, 3 - ldr r2, =gTrainerFrontPicTable - adds r2, r4, r2 - ldr r1, =0x020244d4 - ldr r1, [r1] - lsrs r0, 22 - adds r1, 0x4 - adds r1, r0 - ldr r1, [r1] - adds r0, r2, 0 - movs r2, 0 - bl DecompressPicFromTable_2 - ldr r0, =gTrainerFrontPicPaletteTable - adds r4, r0 - adds r0, r4, 0 - bl LoadCompressedObjectPalette - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805DF38 - - thumb_func_start sub_805DF84 -sub_805DF84: @ 805DF84 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - lsls r5, 16 - lsrs r5, 16 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl battle_get_per_side_status - lsls r0, 24 - lsls r5, 3 - ldr r2, =gTrainerBackPicTable - adds r2, r5, r2 - ldr r1, =0x020244d4 - ldr r1, [r1] - lsrs r0, 22 - adds r1, 0x4 - adds r1, r0 - ldr r1, [r1] - adds r0, r2, 0 - movs r2, 0 - bl DecompressPicFromTable_2 - ldr r0, =gTrainerBackPicPaletteTable - adds r5, r0 - ldr r0, [r5] - lsls r4, 20 - movs r1, 0x80 - lsls r1, 17 - adds r4, r1 - lsrs r4, 16 - adds r1, r4, 0 - movs r2, 0x20 - bl decompress_palette - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805DF84 - - thumb_func_start nullsub_25 -nullsub_25: @ 805DFE0 - bx lr - thumb_func_end nullsub_25 - - thumb_func_start sub_805DFE4 -sub_805DFE4: @ 805DFE4 - push {lr} - lsls r0, 16 - ldr r1, =gTrainerFrontPicPaletteTable - lsrs r0, 13 - adds r0, r1 - ldrh r0, [r0, 0x4] - bl FreeObjectPaletteByTag - pop {r0} - bx r0 - .pool - thumb_func_end sub_805DFE4 - - thumb_func_start sub_805DFFC -sub_805DFFC: @ 805DFFC - push {r4-r7,lr} - ldr r4, =gUnknown_0832C128 - adds r0, r4, 0 - bl LoadTaggedObjectPalette - adds r4, 0x8 - adds r0, r4, 0 - bl LoadTaggedObjectPalette - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - bne _0805E034 - ldr r0, =gUnknown_0832C0D0 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0832C0D8 - bl LoadCompressedObjectPic - movs r5, 0x2 - b _0805E056 - .pool -_0805E034: - ldr r4, =gUnknown_0832C0E0 - adds r0, r4, 0 - bl LoadCompressedObjectPic - adds r4, 0x8 - adds r0, r4, 0 - bl LoadCompressedObjectPic - ldr r4, =gUnknown_0832C0F0 - adds r0, r4, 0 - bl LoadCompressedObjectPic - adds r4, 0x8 - adds r0, r4, 0 - bl LoadCompressedObjectPic - movs r5, 0x4 -_0805E056: - movs r4, 0 - cmp r4, r5 - bcs _0805E076 - ldr r7, =0x02024076 - ldr r6, =gUnknown_0832C108 -_0805E060: - adds r0, r4, r7 - ldrb r0, [r0] - lsls r0, 3 - adds r0, r6 - bl LoadCompressedObjectPic - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _0805E060 -_0805E076: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805DFFC - - thumb_func_start sub_805E08C -sub_805E08C: @ 805E08C - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - movs r6, 0 - cmp r4, 0 - bne _0805E09C - b _0805E1AE -_0805E09C: - cmp r4, 0x1 - bne _0805E0B8 - ldr r4, =gUnknown_0832C128 - adds r0, r4, 0 - bl LoadTaggedObjectPalette - adds r4, 0x8 - adds r0, r4, 0 - bl LoadTaggedObjectPalette - b _0805E1AE - .pool -_0805E0B8: - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - bne _0805E120 - cmp r4, 0x2 - bne _0805E0F0 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0805E0E4 - ldr r0, =gUnknown_0832C100 - bl LoadCompressedObjectPic - b _0805E1AE - .pool -_0805E0E4: - ldr r0, =gUnknown_0832C0D0 - bl LoadCompressedObjectPic - b _0805E1AE - .pool -_0805E0F0: - cmp r4, 0x3 - bne _0805E100 - ldr r0, =gUnknown_0832C0D8 - bl LoadCompressedObjectPic - b _0805E1AE - .pool -_0805E100: - cmp r4, 0x4 - bne _0805E110 - ldr r0, =0x02024076 - ldrb r0, [r0] - b _0805E198 - .pool -_0805E110: - cmp r4, 0x5 - bne _0805E1AC - ldr r0, =0x02024076 - ldrb r0, [r0, 0x1] - b _0805E198 - .pool -_0805E120: - cmp r4, 0x2 - bne _0805E130 - ldr r0, =gUnknown_0832C0E0 - bl LoadCompressedObjectPic - b _0805E1AE - .pool -_0805E130: - cmp r4, 0x3 - bne _0805E140 - ldr r0, =gUnknown_0832C0E8 - bl LoadCompressedObjectPic - b _0805E1AE - .pool -_0805E140: - cmp r4, 0x4 - bne _0805E150 - ldr r0, =gUnknown_0832C0F0 - bl LoadCompressedObjectPic - b _0805E1AE - .pool -_0805E150: - cmp r4, 0x5 - bne _0805E160 - ldr r0, =gUnknown_0832C0F8 - bl LoadCompressedObjectPic - b _0805E1AE - .pool -_0805E160: - cmp r4, 0x6 - bne _0805E170 - ldr r0, =0x02024076 - ldrb r0, [r0] - b _0805E198 - .pool -_0805E170: - cmp r4, 0x7 - bne _0805E180 - ldr r0, =0x02024076 - ldrb r0, [r0, 0x1] - b _0805E198 - .pool -_0805E180: - cmp r4, 0x8 - bne _0805E190 - ldr r0, =0x02024076 - ldrb r0, [r0, 0x2] - b _0805E198 - .pool -_0805E190: - cmp r5, 0x9 - bne _0805E1AC - ldr r0, =0x02024076 - ldrb r0, [r0, 0x3] -_0805E198: - lsls r0, 3 - ldr r1, =gUnknown_0832C108 - adds r0, r1 - bl LoadCompressedObjectPic - b _0805E1AE - .pool -_0805E1AC: - movs r6, 0x1 -_0805E1AE: - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_805E08C - - thumb_func_start load_gfxc_health_bar -load_gfxc_health_bar: @ 805E1B8 - push {lr} - ldr r0, =gUnknown_08C093F0 - ldr r1, =0x020244d4 - ldr r1, [r1] - movs r2, 0xBA - lsls r2, 1 - adds r1, r2 - ldr r1, [r1] - bl LZDecompressWram - pop {r0} - bx r0 - .pool - thumb_func_end load_gfxc_health_bar - - thumb_func_start battle_load_something -battle_load_something: @ 805E1D8 - push {r4-r6,lr} - adds r5, r0, 0 - adds r4, r1, 0 - movs r6, 0 - ldrb r0, [r5] - cmp r0, 0x6 - bls _0805E1E8 - b _0805E346 -_0805E1E8: - lsls r0, 2 - ldr r1, =_0805E1F8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0805E1F8: - .4byte _0805E214 - .4byte _0805E21A - .4byte _0805E324 - .4byte _0805E230 - .4byte _0805E260 - .4byte _0805E29C - .4byte _0805E33C -_0805E214: - bl sub_805E378 - b _0805E324 -_0805E21A: - ldrb r0, [r4] - bl sub_805E08C - lsls r0, 24 - cmp r0, 0 - beq _0805E228 - b _0805E320 -_0805E228: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _0805E346 -_0805E230: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0805E24C - ldrb r0, [r4] - cmp r0, 0 - bne _0805E24C - bl battle_make_oam_safari_battle - b _0805E252 - .pool -_0805E24C: - ldrb r0, [r4] - bl battle_make_oam_normal_battle -_0805E252: - ldr r2, =0x03005d70 - ldrb r1, [r4] - adds r1, r2 - strb r0, [r1] - b _0805E30E - .pool -_0805E260: - ldrb r0, [r4] - bl sub_8072B18 - ldr r0, =0x02024076 - ldrb r1, [r4] - adds r0, r1, r0 - ldrb r0, [r0] - cmp r0, 0x1 - bhi _0805E288 - ldr r0, =0x03005d70 - adds r0, r1, r0 - ldrb r0, [r0] - movs r1, 0 - bl nullsub_30 - b _0805E30E - .pool -_0805E288: - ldr r0, =0x03005d70 - adds r0, r1, r0 - ldrb r0, [r0] - movs r1, 0x1 - bl nullsub_30 - b _0805E30E - .pool -_0805E29C: - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0805E2E4 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0805E302 - ldr r0, =0x03005d70 - ldrb r1, [r4] - adds r0, r1, r0 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x020244ec - adds r1, r2 - movs r2, 0 - bl healthbar_draw_field_maybe - b _0805E302 - .pool -_0805E2E4: - ldr r0, =0x03005d70 - ldrb r1, [r4] - adds r0, r1, r0 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x02024744 - adds r1, r2 - movs r2, 0 - bl healthbar_draw_field_maybe -_0805E302: - ldr r1, =0x03005d70 - ldrb r0, [r4] - adds r0, r1 - ldrb r0, [r0] - bl sub_8072984 -_0805E30E: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bne _0805E346 -_0805E320: - movs r0, 0 - strb r0, [r4] -_0805E324: - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - b _0805E346 - .pool -_0805E33C: - bl sub_805EC84 - bl sub_81B8C68 - movs r6, 0x1 -_0805E346: - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end battle_load_something - - thumb_func_start sub_805E350 -sub_805E350: @ 805E350 - push {r4,lr} - ldr r4, =0x020244d0 - ldr r0, [r4] - ldr r0, [r0, 0x4] - movs r1, 0 - movs r2, 0x30 - bl memset - ldr r0, [r4] - ldr r0, [r0, 0x8] - movs r1, 0 - movs r2, 0x10 - bl memset - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805E350 - - thumb_func_start sub_805E378 -sub_805E378: @ 805E378 - push {lr} - bl sub_805E350 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0] - movs r1, 0 - movs r2, 0x10 - bl memset - pop {r0} - bx r0 - .pool - thumb_func_end sub_805E378 - - thumb_func_start sub_805E394 -sub_805E394: @ 805E394 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r4, 0 - ldr r5, =0x0202406c - ldrb r0, [r5] - cmp r4, r0 - bge _0805E3EA - ldr r0, =0x02020630 - mov r9, r0 - movs r0, 0x1 - mov r12, r0 - movs r0, 0x2 - negs r0, r0 - mov r8, r0 - ldr r7, =0x020244d0 - ldr r6, =0x020241e4 -_0805E3B8: - ldr r0, [r7] - ldr r0, [r0] - lsls r3, r4, 2 - adds r3, r0 - adds r0, r4, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r9 - adds r0, 0x3E - ldrb r1, [r0] - lsls r1, 29 - lsrs r1, 31 - mov r0, r12 - ands r1, r0 - ldrb r2, [r3] - mov r0, r8 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - adds r4, 0x1 - ldrb r0, [r5] - cmp r4, r0 - blt _0805E3B8 -_0805E3EA: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805E394 - - thumb_func_start sub_805E408 -sub_805E408: @ 805E408 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x020244d0 - ldr r1, [r1] - ldr r1, [r1] - lsls r3, r0, 2 - adds r3, r1 - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r1, [r0] - lsls r1, 29 - lsrs r1, 31 - ldrb r2, [r3] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - bx lr - .pool - thumb_func_end sub_805E408 - - thumb_func_start sub_805E448 -sub_805E448: @ 805E448 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - lsls r2, 24 - cmp r2, 0 - beq _0805E51C - ldr r0, =0x020241e4 - adds r5, r7, r0 - ldrb r1, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - mov r8, r1 - add r0, r8 - ldr r4, =0x020244d0 - ldr r1, [r4] - ldr r1, [r1, 0x8] - ldrb r1, [r1] - bl StartObjectImageAnim - lsls r0, r7, 20 - movs r2, 0x80 - lsls r2, 17 - adds r0, r2 - lsrs r6, r0, 16 - ldr r2, =0x0202449c - ldr r0, [r4] - ldr r0, [r0, 0x8] - ldrh r1, [r0] - lsls r1, 5 - movs r3, 0x80 - lsls r3, 1 - adds r1, r3 - ldr r0, [r2] - adds r0, r1 - adds r1, r6, 0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r1, =0x020244e4 - adds r1, r7, r1 - ldr r0, [r4] - ldr r0, [r0, 0x8] - ldrh r0, [r0] - strb r0, [r1] - ldr r0, [r4] - ldr r1, [r0] - lsls r0, r7, 2 - adds r0, r1 - ldrh r0, [r0, 0x2] - cmp r0, 0 - beq _0805E4DE - ldr r3, =0x00007fff - adds r0, r6, 0 - movs r1, 0x10 - movs r2, 0x6 - bl pal_fade_1 - lsls r1, r6, 1 - ldr r0, =0x02037b14 - adds r0, r1, r0 - ldr r2, =0x02037714 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet -_0805E4DE: - adds r0, r7, 0 - bl sub_80A6138 - ldrb r2, [r5] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - add r1, r8 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1, 0x22] - b _0805E77A - .pool -_0805E51C: - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0805E558 - movs r0, 0 - mov r10, r0 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0, 0x18] - ldrh r1, [r2, 0x2] - mov r8, r1 - ldr r3, [r2, 0x8] - mov r9, r3 - ldr r4, [r2, 0xC] - lsls r0, r1, 3 - ldr r1, =gMonBackPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r1, [r1] - ldr r1, [r1, 0x4] - ldr r3, [r2, 0x10] - b _0805E5FA - .pool -_0805E558: - adds r0, r7, 0 - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r0, [sp] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0805E58C - ldr r1, =0x0202406e - ldr r2, [sp] - lsls r0, r2, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - b _0805E59C - .pool -_0805E58C: - ldr r1, =0x0202406e - ldr r3, [sp] - lsls r0, r3, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec -_0805E59C: - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - adds r0, r7, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0805E618 - ldr r0, =0x0202406e - lsls r4, r7, 1 - adds r4, r0 - ldrh r0, [r4] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x020244ec - adds r0, r5 - movs r1, 0 - bl pokemon_getattr - mov r9, r0 - ldrh r0, [r4] - muls r0, r6 - adds r0, r5 - movs r1, 0x1 - bl pokemon_getattr - adds r4, r0, 0 - mov r1, r8 - lsls r0, r1, 3 - ldr r1, =gMonBackPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r1, [r1] - mov r3, r10 - lsls r2, r3, 2 - adds r1, 0x4 - adds r1, r2 - ldr r1, [r1] - ldr r3, =0x020244bc - lsls r2, r7, 2 - adds r2, r3 - ldr r3, [r2] -_0805E5FA: - mov r2, r8 - bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack - b _0805E662 - .pool -_0805E618: - ldr r0, =0x0202406e - lsls r4, r7, 1 - adds r4, r0 - ldrh r0, [r4] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x02024744 - adds r0, r5 - movs r1, 0 - bl pokemon_getattr - mov r9, r0 - ldrh r0, [r4] - muls r0, r6 - adds r0, r5 - movs r1, 0x1 - bl pokemon_getattr - adds r4, r0, 0 - mov r1, r8 - lsls r0, r1, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r1, [r1] - mov r3, r10 - lsls r2, r3, 2 - adds r1, 0x4 - adds r1, r2 - ldr r1, [r1] - ldr r3, =0x020244bc - lsls r2, r7, 2 - adds r2, r3 - ldr r3, [r2] - mov r2, r8 - bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack -_0805E662: - ldr r0, =0x020244d4 - ldr r0, [r0] - mov r2, r10 - lsls r1, r2, 2 - adds r0, 0x4 - adds r0, r1 - ldr r2, [r0] - ldr r0, =0x020241e4 - adds r0, r7 - mov r10, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r3, =0x02020630 - adds r0, r3 - ldrh r0, [r0, 0x4] - lsls r0, 22 - lsrs r0, 17 - ldr r1, =0x06010000 - adds r0, r1 - ldr r1, =0x040000d4 - str r2, [r1] - str r0, [r1, 0x4] - ldr r0, =0x84000200 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - lsls r0, r7, 20 - movs r1, 0x80 - lsls r1, 17 - adds r0, r1 - lsrs r6, r0, 16 - mov r0, r8 - adds r1, r4, 0 - mov r2, r9 - bl species_and_otid_get_pal - mov r9, r0 - ldr r4, =0x0201c000 - adds r1, r4, 0 - bl LZDecompressWram - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =0x00000181 - cmp r8, r0 - bne _0805E70A - mov r2, r10 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r1, 0x8 - adds r0, r1 - ldr r1, =gUnknown_08309AAC - mov r3, r8 - lsls r2, r3, 2 - adds r1, r2 - ldr r1, [r1] - str r1, [r0] - ldr r5, =0x0202449c - ldr r1, [r5] - movs r4, 0x80 - lsls r4, 1 - adds r1, r4 - mov r0, r9 - bl LZDecompressWram - ldr r0, =0x020244e4 - ldr r1, [sp] - adds r0, r1, r0 - ldrb r1, [r0] - lsls r1, 5 - adds r1, r4 - ldr r0, [r5] - adds r0, r1 - adds r1, r6, 0 - movs r2, 0x20 - bl gpu_pal_apply -_0805E70A: - ldr r3, =0x00007fff - adds r0, r6, 0 - movs r1, 0x10 - movs r2, 0x6 - bl pal_fade_1 - lsls r1, r6, 1 - ldr r0, =0x02037b14 - adds r0, r1, r0 - ldr r2, =0x02037714 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0805E74A - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0] - lsls r0, r7, 2 - adds r0, r1 - mov r2, r8 - strh r2, [r0, 0x2] - ldr r0, =0x020244e4 - adds r1, r7, r0 - ldr r3, [sp] - adds r0, r3, r0 - ldrb r0, [r0] - strb r0, [r1] -_0805E74A: - adds r0, r7, 0 - bl sub_80A6138 - mov r1, r10 - ldrb r2, [r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - ldr r2, =0x02020630 - adds r1, r2 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1, 0x22] - mov r3, r10 - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x020244e4 - adds r1, r7, r1 - ldrb r1, [r1] - bl StartObjectImageAnim -_0805E77A: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805E448 - - thumb_func_start sub_805E7DC -sub_805E7DC: @ 805E7DC - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - lsls r1, 24 - cmp r1, 0 - bne _0805E898 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0805E7F8 - movs r4, 0 - b _0805E802 -_0805E7F8: - adds r0, r4, 0 - bl battle_get_per_side_status - lsls r0, 24 - lsrs r4, r0, 24 -_0805E802: - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0805E814 - ldr r0, =gUnknown_08C2D120 - b _0805E822 - .pool -_0805E814: - adds r0, r5, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0805E83C - ldr r0, =gUnknown_08C2CEE0 -_0805E822: - ldr r1, =0x020244d4 - ldr r1, [r1] - lsls r4, 2 - adds r1, 0x4 - adds r1, r4 - ldr r1, [r1] - bl LZDecompressVram - b _0805E84E - .pool -_0805E83C: - ldr r0, =gUnknown_08C2D120 - ldr r1, =0x020244d4 - ldr r1, [r1] - lsls r4, 2 - adds r1, 0x4 - adds r1, r4 - ldr r1, [r1] - bl LZDecompressVram -_0805E84E: - movs r3, 0x1 - lsls r6, r5, 4 - ldr r7, =gUnknown_08C2CEBC - ldr r0, =0x020244d4 - ldr r0, [r0] - adds r0, 0x4 - adds r4, r0, r4 - ldr r2, =0x040000d4 - ldr r5, =0x84000200 -_0805E860: - ldr r0, [r4] - lsls r1, r3, 11 - adds r1, r0, r1 - str r0, [r2] - str r1, [r2, 0x4] - str r5, [r2, 0x8] - ldr r0, [r2, 0x8] - adds r3, 0x1 - cmp r3, 0x3 - ble _0805E860 - movs r0, 0x80 - lsls r0, 1 - adds r1, r6, r0 - adds r0, r7, 0 - movs r2, 0x20 - bl decompress_palette - b _0805E8E6 - .pool -_0805E898: - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0805E8E6 - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0805E8D0 - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - adds r1, r4, 0 - bl sub_805DC0C - b _0805E8E6 - .pool -_0805E8D0: - ldr r1, =0x0202406e - lsls r0, r5, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - adds r1, r5, 0 - bl sub_805DD7C -_0805E8E6: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805E7DC - - thumb_func_start refresh_graphics_maybe -refresh_graphics_maybe: @ 805E8F4 - push {r4-r6,lr} - adds r5, r1, 0 - adds r4, r2, 0 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r4, 24 - lsrs r4, 24 - adds r0, r6, 0 - adds r1, r5, 0 - bl sub_805E7DC - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =0x02020630 - adds r4, r0, r1 - ldr r0, =0x020244e4 - adds r0, r6, r0 - ldrb r1, [r0] - adds r0, r4, 0 - bl StartObjectImageAnim - cmp r5, 0 - bne _0805E938 - adds r0, r6, 0 - bl sub_80A614C - b _0805E93E - .pool -_0805E938: - adds r0, r6, 0 - bl sub_80A6138 -_0805E93E: - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x22] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end refresh_graphics_maybe - - thumb_func_start sub_805E94C -sub_805E94C: @ 805E94C - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 16 - lsrs r1, 16 - cmp r1, 0xA4 - bne _0805E96C - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0] - lsls r1, r2, 2 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] -_0805E96C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_805E94C - - thumb_func_start sub_805E974 -sub_805E974: @ 805E974 - lsls r0, 24 - ldr r1, =0x020244d0 - ldr r1, [r1] - ldr r1, [r1] - lsrs r0, 22 - adds r0, r1 - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - bx lr - .pool - thumb_func_end sub_805E974 - - thumb_func_start sub_805E990 -sub_805E990: @ 805E990 - push {r4-r7,lr} - adds r5, r0, 0 - lsls r1, 24 - lsrs r6, r1, 24 - adds r7, r6, 0 - movs r1, 0x39 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x3A - bl pokemon_getattr - adds r1, r0, 0 - lsls r4, 16 - asrs r4, 16 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - bl sub_8075060 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0805EA08 - ldr r7, =0x020244d0 - ldr r0, [r7] - ldr r2, [r0] - lsls r4, r6, 2 - adds r0, r4, r2 - ldrb r1, [r0] - movs r5, 0x2 - movs r3, 0x2 - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - bne _0805EA5A - adds r0, r6, 0 - eors r0, r5 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - bne _0805E9F6 - movs r0, 0x5A - bl audio_play -_0805E9F6: - ldr r0, [r7] - ldr r1, [r0] - adds r1, r4, r1 - ldrb r0, [r1] - orrs r0, r5 - strb r0, [r1] - b _0805EA5A - .pool -_0805EA08: - ldr r4, =0x020244d0 - ldr r0, [r4] - ldr r0, [r0] - lsls r1, r6, 2 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x3 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - bne _0805EA34 - movs r0, 0x5A - bl m4aSongNumStop - b _0805EA5A - .pool -_0805EA34: - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0805EA5A - ldr r1, [r4] - movs r0, 0x2 - eors r7, r0 - ldr r1, [r1] - lsls r0, r7, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _0805EA5A - movs r0, 0x5A - bl m4aSongNumStop -_0805EA5A: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_805E990 - - thumb_func_start sub_805EA60 -sub_805EA60: @ 805EA60 - push {r4-r6,lr} - movs r0, 0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r4, r0, 24 - ldr r5, =0x020244d0 - ldr r0, [r5] - ldr r0, [r0] - lsls r1, r4, 2 - adds r1, r0 - ldrb r2, [r1] - movs r6, 0x3 - negs r6, r6 - adds r0, r6, 0 - ands r0, r2 - strb r0, [r1] - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0805EAA2 - ldr r2, [r5] - movs r0, 0x2 - adds r1, r4, 0 - eors r1, r0 - ldr r0, [r2] - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1] - adds r0, r6, 0 - ands r0, r2 - strb r0, [r1] -_0805EAA2: - movs r0, 0x5A - bl m4aSongNumStop - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805EA60 - - thumb_func_start sub_805EAB4 -sub_805EAB4: @ 805EAB4 - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x39 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x3A - bl pokemon_getattr - adds r1, r0, 0 - lsls r4, 16 - asrs r4, 16 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - bl sub_8075060 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_805EAB4 - - thumb_func_start sub_805EAE8 -sub_805EAE8: @ 805EAE8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0805EB7E - movs r0, 0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r0, 0x2 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldr r5, =0x0202406e - mov r1, r8 - lsls r0, r1, 1 - adds r0, r5 - ldrb r0, [r0] - bl pokemon_order_func - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - mov r1, r9 - lsls r0, r1, 1 - adds r0, r5 - ldrb r0, [r0] - bl pokemon_order_func - lsls r0, 24 - lsrs r5, r0, 24 - movs r7, 0x64 - adds r0, r4, 0 - muls r0, r7 - ldr r6, =0x020244ec - adds r4, r0, r6 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _0805EB5A - adds r0, r4, 0 - mov r1, r8 - bl sub_805E990 -_0805EB5A: - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0805EB7E - adds r0, r5, 0 - muls r0, r7 - adds r4, r0, r6 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _0805EB7E - adds r0, r4, 0 - mov r1, r9 - bl sub_805E990 -_0805EB7E: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805EAE8 - - thumb_func_start sub_805EB9C -sub_805EB9C: @ 805EB9C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r5, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r5, r0 - bge _0805EC6C - movs r0, 0x3 - mov r10, r8 - mov r1, r10 - ands r1, r0 - mov r10, r1 - movs r6, 0 - movs r2, 0x3F - negs r2, r2 - mov r9, r2 -_0805EBC8: - lsls r0, r5, 24 - lsrs r0, 24 - bl sub_80A6A90 - lsls r0, 24 - cmp r0, 0 - beq _0805EC60 - ldr r4, =0x02020630 - ldr r0, =0x020241e4 - adds r3, r5, r0 - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0, 0x1] - movs r7, 0x4 - negs r7, r7 - adds r2, r7, 0 - ands r1, r2 - mov r2, r10 - orrs r1, r2 - strb r1, [r0, 0x1] - mov r7, r8 - cmp r7, 0 - bne _0805EC3C - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r2, [r0, 0x4] - adds r2, r6, r2 - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x3] - lsls r0, 26 - lsrs r0, 27 - strb r0, [r2, 0x6] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0, 0x3] - mov r2, r9 - ands r1, r2 - strb r1, [r0, 0x3] - b _0805EC60 - .pool -_0805EC3C: - ldrb r0, [r3] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r4 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x4] - adds r0, r6, r0 - ldrb r1, [r0, 0x6] - movs r0, 0x1F - ands r1, r0 - lsls r1, 1 - ldrb r0, [r2, 0x3] - mov r3, r9 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x3] -_0805EC60: - adds r6, 0xC - adds r5, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r5, r0 - blt _0805EBC8 -_0805EC6C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805EB9C - - thumb_func_start sub_805EC84 -sub_805EC84: @ 805EC84 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =gUnknown_0831C6A0 - bl LoadCompressedObjectPic - movs r0, 0x1 - bl battle_get_side_with_given_state - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_0831C6B0 - mov r8, r0 - adds r0, r5, 0 - movs r1, 0 - bl sub_80A5C6C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80A5C6C - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 8 - movs r0, 0xE8 - lsls r0, 13 - adds r2, r0 - asrs r2, 16 - mov r0, r8 - adds r1, r4, 0 - movs r3, 0xC8 - bl AddObjectToFront - ldr r6, =0x020244d0 - ldr r1, [r6] - ldr r2, [r1, 0x4] - lsls r1, r5, 1 - adds r1, r5 - lsls r1, 2 - adds r2, r1, r2 - strb r0, [r2, 0x7] - ldr r7, =0x02020630 - ldr r0, [r6] - ldr r0, [r0, 0x4] - adds r1, r0 - ldrb r1, [r1, 0x7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r5, [r0, 0x2E] - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0805ED56 - movs r0, 0x3 - bl battle_get_side_with_given_state - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - adds r0, r5, 0 - movs r1, 0 - bl sub_80A5C6C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80A5C6C - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 8 - movs r0, 0xE8 - lsls r0, 13 - adds r2, r0 - asrs r2, 16 - mov r0, r8 - adds r1, r4, 0 - movs r3, 0xC8 - bl AddObjectToFront - ldr r1, [r6] - ldr r2, [r1, 0x4] - lsls r1, r5, 1 - adds r1, r5 - lsls r1, 2 - adds r2, r1, r2 - strb r0, [r2, 0x7] - ldr r0, [r6] - ldr r0, [r0, 0x4] - adds r1, r0 - ldrb r1, [r1, 0x7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r5, [r0, 0x2E] -_0805ED56: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805EC84 - - thumb_func_start sub_805ED70 -@ int sub_805ED70(obj *a1) -sub_805ED70: @ 805ED70 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - movs r0, 0 - mov r8, r0 - ldrh r0, [r5, 0x2E] - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x020241e4 - adds r0, r4, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r7, r0, r1 - adds r6, r7, 0 - adds r6, 0x3E - ldrb r1, [r6] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0805EDAC - adds r0, r4, 0 - bl sub_80A6A90 - lsls r0, 24 - cmp r0, 0 - bne _0805EDC0 -_0805EDAC: - ldr r0, =sub_805EE48 - str r0, [r5, 0x1C] - b _0805EE36 - .pool -_0805EDC0: - ldr r0, =0x020383fd - ldrb r0, [r0] - cmp r0, 0 - bne _0805EDD2 - ldrb r1, [r6] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0805EDE4 -_0805EDD2: - movs r0, 0x1 - mov r8, r0 - ldr r2, =0x020244d0 - lsls r4, 2 - b _0805EE06 - .pool -_0805EDE4: - ldr r2, =0x020244d0 - ldr r0, [r2] - ldr r0, [r0] - lsls r1, r4, 2 - adds r3, r1, r0 - ldrh r0, [r3, 0x2] - adds r4, r1, 0 - cmp r0, 0 - beq _0805EE06 - ldr r0, =gUnknown_08305DCC - ldrh r1, [r3, 0x2] - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0 - bne _0805EE06 - movs r0, 0x1 - mov r8, r0 -_0805EE06: - ldr r0, [r2] - ldr r0, [r0] - adds r0, r4, r0 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0805EE1A - movs r0, 0x1 - mov r8, r0 -_0805EE1A: - ldrh r0, [r7, 0x20] - strh r0, [r5, 0x20] - ldrh r0, [r7, 0x24] - strh r0, [r5, 0x24] - adds r2, r5, 0 - adds r2, 0x3E - mov r0, r8 - lsls r3, r0, 2 - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - orrs r0, r3 - strb r0, [r2] -_0805EE36: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805ED70 - - thumb_func_start sub_805EE48 -sub_805EE48: @ 805EE48 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - bx lr - thumb_func_end sub_805EE48 - - thumb_func_start sub_805EE54 -sub_805EE54: @ 805EE54 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - lsls r1, 16 - lsrs r5, r1, 16 - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0805EED0 - ldr r0, =0x020244d0 - ldr r3, [r0] - ldr r1, [r3] - lsls r0, r4, 2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2] - cmp r0, 0 - beq _0805EE7E - adds r5, r0, 0 -_0805EE7E: - ldr r0, =gUnknown_08305DCC - adds r0, r5, r0 - ldrb r0, [r0] - cmp r0, 0 - beq _0805EEB4 - ldr r2, =0x02020630 - ldr r1, [r3, 0x4] - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_805ED70 - b _0805EECE - .pool -_0805EEB4: - ldr r2, =0x02020630 - ldr r1, [r3, 0x4] - lsls r0, r6, 1 - adds r0, r6 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_805EE48 -_0805EECE: - str r1, [r0] -_0805EED0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805EE54 - - thumb_func_start sub_805EEE0 -sub_805EEE0: @ 805EEE0 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02020630 - ldr r1, =0x020244d0 - ldr r1, [r1] - ldr r3, [r1, 0x4] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r1, [r1, 0x7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_805EE48 - str r1, [r0] - bx lr - .pool - thumb_func_end sub_805EEE0 - - thumb_func_start sub_805EF14 -sub_805EF14: @ 805EF14 - push {r4-r6,lr} - ldr r3, =0x06000240 - movs r0, 0 - movs r6, 0xF0 - lsls r6, 8 -_0805EF1E: - adds r5, r0, 0x1 - movs r4, 0xF -_0805EF22: - ldrh r1, [r3] - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - bne _0805EF32 - adds r0, r6, 0 - orrs r0, r1 - strh r0, [r3] -_0805EF32: - ldrh r1, [r3] - movs r2, 0xF0 - lsls r2, 4 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _0805EF46 - adds r0, r2, 0 - orrs r0, r1 - strh r0, [r3] -_0805EF46: - ldrh r1, [r3] - movs r2, 0xF0 - movs r0, 0xF0 - ands r0, r1 - cmp r0, 0 - bne _0805EF58 - adds r0, r1, 0 - orrs r0, r2 - strh r0, [r3] -_0805EF58: - ldrh r1, [r3] - movs r2, 0xF - movs r0, 0xF - ands r0, r1 - cmp r0, 0 - bne _0805EF6A - adds r0, r1, 0 - orrs r0, r2 - strh r0, [r3] -_0805EF6A: - adds r3, 0x2 - subs r4, 0x1 - cmp r4, 0 - bge _0805EF22 - adds r0, r5, 0 - cmp r0, 0x8 - ble _0805EF1E - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805EF14 - - thumb_func_start sub_805EF84 -sub_805EF84: @ 805EF84 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r2, [r0] - lsls r0, r4, 2 - adds r0, r2 - movs r3, 0 - movs r2, 0 - strh r2, [r0, 0x2] - ldr r0, =0x020244e4 - adds r0, r4, r0 - strb r3, [r0] - cmp r1, 0 - bne _0805EFAC - adds r0, r4, 0 - bl sub_805E974 -_0805EFAC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805EF84 - - thumb_func_start init_uns_table_pokemon_copy -init_uns_table_pokemon_copy: @ 805EFBC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r6, 0 - ldr r4, =0x020244d4 - str r6, [r4] - movs r0, 0xC0 - lsls r0, 1 - bl AllocZeroed - str r0, [r4] - movs r0, 0x80 - lsls r0, 8 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1] -_0805EFE2: - ldr r0, =0x020244d4 - ldr r1, [r0] - lsls r4, r6, 2 - adds r2, r1, 0x4 - adds r2, r4 - lsls r3, r6, 13 - ldr r0, [r1] - adds r0, r3 - str r0, [r2] - lsls r3, r6, 1 - adds r0, r3, r6 - lsls r0, 3 - adds r1, r0, r1 - ldr r2, =gUnknown_08329D98 - adds r1, 0x14 - adds r0, r2 - ldm r0!, {r2,r5,r7} - stm r1!, {r2,r5,r7} - ldm r0!, {r2,r5,r7} - stm r1!, {r2,r5,r7} - movs r5, 0 - mov r9, r3 - lsls r0, r6, 5 - mov r8, r0 - adds r1, r6, 0x1 - mov r10, r1 - mov r12, r8 - adds r7, r4, 0 -_0805F01A: - ldr r2, =0x020244d4 - ldr r1, [r2] - lsls r4, r5, 3 - add r4, r12 - adds r3, r1, 0 - adds r3, 0x74 - adds r3, r4 - adds r0, r1, 0x4 - adds r0, r7 - lsls r2, r5, 11 - ldr r0, [r0] - adds r0, r2 - str r0, [r3] - adds r1, r4 - adds r1, 0x78 - movs r0, 0x80 - lsls r0, 4 - strh r0, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _0805F01A - ldr r1, =0x020244d4 - ldr r2, [r1] - mov r5, r9 - adds r0, r5, r6 - lsls r0, 3 - adds r1, r2, 0 - adds r1, 0x20 - adds r1, r0 - mov r0, r8 - adds r0, 0x74 - adds r2, r0 - str r2, [r1] - mov r7, r10 - lsls r0, r7, 24 - lsrs r6, r0, 24 - cmp r6, 0x3 - bls _0805EFE2 - movs r0, 0x80 - lsls r0, 5 - bl AllocZeroed - ldr r1, =0x020244d4 - ldr r1, [r1] - movs r2, 0xBA - lsls r2, 1 - adds r1, r2 - str r0, [r1] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end init_uns_table_pokemon_copy - - thumb_func_start sub_805F094 -sub_805F094: @ 805F094 - push {r4-r6,lr} - ldr r6, =0x020244d4 - ldr r0, [r6] - cmp r0, 0 - beq _0805F106 - movs r1, 0xBE - lsls r1, 1 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - beq _0805F0BA - bl Free - ldr r0, [r6] - movs r1, 0xBE - lsls r1, 1 - adds r0, r1 - movs r1, 0 - str r1, [r0] -_0805F0BA: - ldr r0, [r6] - movs r1, 0xBC - lsls r1, 1 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - beq _0805F0D8 - bl Free - ldr r0, [r6] - movs r1, 0xBC - lsls r1, 1 - adds r0, r1 - movs r1, 0 - str r1, [r0] -_0805F0D8: - ldr r0, [r6] - movs r5, 0xBA - lsls r5, 1 - adds r0, r5 - ldr r0, [r0] - bl Free - ldr r0, [r6] - adds r5, r0, r5 - movs r4, 0 - str r4, [r5] - ldr r0, [r0] - bl Free - ldr r0, [r6] - str r4, [r0] - str r4, [r0, 0x4] - str r4, [r0, 0x8] - str r4, [r0, 0xC] - str r4, [r0, 0x10] - bl Free - str r4, [r6] -_0805F106: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805F094 - - thumb_func_start sub_805F110 -sub_805F110: @ 805F110 - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x37 - bl pokemon_getattr - ldr r1, =0x00000fff - ands r1, r0 - cmp r1, 0 - bne _0805F158 - adds r0, r5, 0 - movs r1, 0x39 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x3A - bl pokemon_getattr - adds r1, r0, 0 - lsls r4, 16 - asrs r4, 16 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - bl sub_8075060 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - ble _0805F158 - movs r0, 0x1 - b _0805F15A - .pool -_0805F158: - movs r0, 0 -_0805F15A: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_805F110 - - thumb_func_start nullsub_26 -nullsub_26: @ 805F160 - bx lr - thumb_func_end nullsub_26 - - thumb_func_start sub_805F164 -sub_805F164: @ 805F164 - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_exec_buffer_A_ch0_tbl7 - str r1, [r0] - bx lr - .pool - thumb_func_end sub_805F164 - - thumb_func_start bx_exec_buffer_A_ch0_tbl7 -bx_exec_buffer_A_ch0_tbl7: @ 805F180 - push {lr} - ldr r2, =0x02024068 - ldr r1, =gUnknown_0832A328 - ldr r0, =0x02024064 - ldrb r3, [r0] - lsls r0, r3, 2 - adds r0, r1 - ldr r1, [r2] - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _0805F1CC - ldr r0, =0x02023064 - lsls r1, r3, 9 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x38 - bhi _0805F1C8 - ldr r0, =gUnknown_0831C6C8 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - bl _call_via_r0 - b _0805F1CC - .pool -_0805F1C8: - bl dp01_tbl7_exec_completed -_0805F1CC: - pop {r0} - bx r0 - thumb_func_end bx_exec_buffer_A_ch0_tbl7 - - thumb_func_start sub_805F1D0 -sub_805F1D0: @ 805F1D0 - push {lr} - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - bne _0805F1F4 - bl dp01_tbl7_exec_completed -_0805F1F4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_805F1D0 - - thumb_func_start sub_805F208 -sub_805F208: @ 805F208 - push {lr} - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - bne _0805F22C - bl dp01_tbl7_exec_completed -_0805F22C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_805F208 - - thumb_func_start sub_805F240 -sub_805F240: @ 805F240 - push {r4-r6,lr} - ldr r5, =0x02020630 - ldr r6, =0x020241e4 - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r2, r0, 2 - adds r0, r5, 0 - adds r0, 0x1C - adds r0, r2, r0 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - bne _0805F292 - adds r0, r2, r5 - ldrh r0, [r0, 0x6] - bl sub_805DFE4 - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl obj_free_rotscale_entry - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl RemoveObjectAndFreeTiles - bl dp01_tbl7_exec_completed -_0805F292: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805F240 - - thumb_func_start sub_805F2A8 -sub_805F2A8: @ 805F2A8 - push {r4,lr} - ldr r4, =0x020244d0 - ldr r1, [r4] - ldr r3, =0x02024064 - ldrb r0, [r3] - ldr r2, [r1, 0x4] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r0, [r1, 0x9] - subs r0, 0x1 - strb r0, [r1, 0x9] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _0805F2E0 - ldr r0, [r4] - ldrb r1, [r3] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strb r1, [r0, 0x9] - bl dp01_tbl7_exec_completed -_0805F2E0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805F2A8 - - thumb_func_start sub_805F2F0 -sub_805F2F0: @ 805F2F0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r0, 0 - mov r10, r0 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0805F32C - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0805F31E - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0805F32C -_0805F31E: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _0805F368 -_0805F32C: - ldr r2, =0x02020630 - ldr r1, =0x03005d70 - ldr r3, =0x02024064 - ldrb r0, [r3] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - bne _0805F34E - movs r1, 0x1 - mov r10, r1 -_0805F34E: - movs r6, 0 - b _0805F3A2 - .pool -_0805F368: - ldr r3, =0x02020630 - ldr r6, =0x03005d70 - ldr r2, =0x02024064 - ldrb r4, [r2] - adds r0, r4, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r3, 0x1C - adds r0, r3 - ldr r5, [r0] - ldr r0, =DummyObjectCallback - cmp r5, r0 - bne _0805F3A0 - movs r0, 0x2 - eors r4, r0 - adds r0, r4, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - cmp r0, r5 - bne _0805F3A0 - movs r0, 0x1 - mov r10, r0 -_0805F3A0: - movs r6, 0x1 -_0805F3A2: - ldr r3, =0x020244d8 - ldr r1, =0x020244d0 - mov r8, r1 - ldr r2, [r1] - ldr r7, =0x02024064 - ldrb r1, [r7] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - ldr r5, [r2, 0x4] - adds r0, r5, r0 - str r0, [r3] - ldr r2, =0x020244dc - ldrb r0, [r7] - movs r1, 0x2 - mov r9, r1 - mov r1, r9 - eors r1, r0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r5, r0 - str r0, [r2] - mov r0, r10 - cmp r0, 0 - bne _0805F3D8 - b _0805F53C -_0805F3D8: - cmp r6, 0x1 - bne _0805F494 - ldrb r2, [r7] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r4, r0, r5 - ldrb r1, [r4, 0x1] - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - bne _0805F3F2 - b _0805F53C -_0805F3F2: - mov r0, r9 - eors r0, r2 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r0, [r1, 0x1] - ands r6, r0 - cmp r6, 0 - bne _0805F408 - b _0805F53C -_0805F408: - ldrb r1, [r4] - movs r3, 0x7F - adds r0, r3, 0 - ands r0, r1 - strb r0, [r4] - mov r1, r8 - ldr r0, [r1] - ldrb r2, [r7] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r4, 0x2 - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - strb r0, [r1, 0x1] - mov r0, r8 - ldr r2, [r0] - ldrb r0, [r7] - mov r1, r9 - eors r1, r0 - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - ands r3, r1 - strb r3, [r0] - mov r1, r8 - ldr r2, [r1] - ldrb r0, [r7] - mov r1, r9 - eors r1, r0 - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x1] - ands r4, r1 - strb r4, [r0, 0x1] - ldr r4, =0x000027f9 - adds r0, r4, 0 - bl FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - b _0805F51A - .pool -_0805F494: - ldrb r2, [r7] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r5 - ldrb r1, [r0, 0x1] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0805F53C - adds r0, r2, 0 - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _0805F4E4 - mov r0, r8 - ldr r2, [r0] - ldrb r0, [r7] - mov r1, r9 - eors r1, r0 - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0] - movs r0, 0xC0 - lsls r0, 1 - ands r0, r1 - cmp r0, 0 - bne _0805F53C - ldr r4, =0x000027f9 - adds r0, r4, 0 - bl FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag -_0805F4E4: - mov r1, r8 - ldr r0, [r1] - ldr r1, =0x02024064 - ldrb r2, [r1] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x7F - ands r0, r2 - strb r0, [r1] - mov r1, r8 - ldr r0, [r1] - ldr r1, =0x02024064 - ldrb r2, [r1] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1] -_0805F51A: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r3, =0x02024064 - ldrb r1, [r3] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x3 - strb r1, [r0, 0x9] - ldr r1, =0x03005d60 - ldrb r0, [r3] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805F2A8 - str r1, [r0] -_0805F53C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805F2F0 - - thumb_func_start sub_805F560 -sub_805F560: @ 805F560 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r0, 0 - str r0, [sp] - mov r10, r0 - ldr r5, =0x020244d0 - ldr r0, [r5] - ldr r4, =0x02024064 - ldrb r2, [r4] - ldr r1, [r0, 0x4] - lsls r3, r2, 1 - adds r0, r3, r2 - lsls r0, 2 - adds r0, r1 - ldrh r1, [r0] - movs r6, 0xC4 - lsls r6, 1 - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - bne _0805F5A6 - ldr r0, =0x0202406e - adds r0, r3, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 - adds r1, r0 - adds r0, r2, 0 - bl sub_8172EF0 -_0805F5A6: - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x00008040 - ands r0, r1 - cmp r0, 0 - bne _0805F5EE - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0805F5EE - ldr r2, [r5] - ldrb r1, [r4] - movs r0, 0x2 - adds r3, r0, 0 - eors r3, r1 - ldr r1, [r2, 0x4] - lsls r2, r3, 1 - adds r0, r2, r3 - lsls r0, 2 - adds r0, r1 - ldrh r1, [r0] - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - bne _0805F5EE - ldr r0, =0x0202406e - adds r0, r2, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 - adds r1, r0 - adds r0, r3, 0 - bl sub_8172EF0 -_0805F5EE: - ldr r2, =0x020244d0 - ldr r0, [r2] - ldr r1, =0x02024064 - mov r8, r1 - ldrb r4, [r1] - ldr r5, [r0, 0x4] - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r3, r0, r5 - ldrb r1, [r3] - movs r6, 0x8 - adds r0, r6, 0 - ands r0, r1 - mov r9, r2 - cmp r0, 0 - bne _0805F6D0 - movs r7, 0x2 - adds r1, r7, 0 - eors r1, r4 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r1, [r0] - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - bne _0805F6D0 - ldrb r1, [r3, 0x1] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0805F6B4 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0805F684 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0805F684 - ldr r4, =0x03005d70 - mov r1, r8 - ldrb r0, [r1] - adds r1, r7, 0 - eors r1, r0 - adds r0, r1, r4 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x02024744 - adds r1, r2 - movs r2, 0 - bl healthbar_draw_field_maybe - mov r1, r8 - ldrb r0, [r1] - eors r0, r7 - bl sub_8076918 - mov r1, r8 - ldrb r0, [r1] - eors r0, r7 - adds r0, r4 - ldrb r0, [r0] - bl sub_80729D0 -_0805F684: - ldr r5, =0x03005d70 - ldr r4, =0x02024064 - ldrb r1, [r4] - adds r0, r1, r5 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x02024744 - adds r1, r2 - movs r2, 0 - bl healthbar_draw_field_maybe - ldrb r0, [r4] - bl sub_8076918 - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - bl sub_80729D0 -_0805F6B4: - ldr r3, =0x020244d0 - ldr r2, [r3] - ldr r0, =0x02024064 - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x1] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0, 0x1] - mov r9, r3 -_0805F6D0: - mov r1, r9 - ldr r0, [r1] - ldr r4, =0x02024064 - ldrb r2, [r4] - ldr r3, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r3 - ldrb r1, [r0, 0x1] - movs r0, 0xC0 - ands r0, r1 - cmp r0, 0x80 - bne _0805F792 - movs r1, 0x2 - eors r1, r2 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r1, [r0, 0x1] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0805F792 - bl sub_80A36C8 - lsls r0, 24 - cmp r0, 0 - bne _0805F792 - mov r1, r9 - ldr r0, [r1] - ldrb r4, [r4] - ldr r1, [r0, 0x4] - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x1] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _0805F774 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x42 - ands r0, r1 - cmp r0, 0x42 - bne _0805F768 - adds r0, r4, 0 - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0805F774 - ldr r0, =0x03007420 - bl m4aMPlayContinue - b _0805F774 - .pool -_0805F768: - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl MPlayVolumeControl -_0805F774: - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x1] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0, 0x1] - movs r0, 0x1 - str r0, [sp] -_0805F792: - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0805F7B2 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0805F810 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0805F810 -_0805F7B2: - ldr r2, =0x02020630 - ldr r0, =0x03005d7c - ldr r1, =0x02024064 - ldrb r4, [r1] - adds r0, r4, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r3, [r0] - ldr r0, =DummyObjectCallback - cmp r3, r0 - bne _0805F86E - ldr r0, =0x020241e4 - adds r0, r4, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - cmp r0, r3 - bne _0805F86E - movs r1, 0x1 - mov r10, r1 - b _0805F86E - .pool -_0805F810: - ldr r2, =0x02020630 - ldr r7, =0x03005d7c - ldr r0, =0x02024064 - ldrb r3, [r0] - adds r0, r3, r7 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r4, [r0] - ldr r0, =DummyObjectCallback - cmp r4, r0 - bne _0805F86E - ldr r6, =0x020241e4 - adds r0, r3, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r5, [r0] - cmp r5, r4 - bne _0805F86E - movs r0, 0x2 - eors r3, r0 - adds r0, r3, r7 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r4, [r0] - cmp r4, r5 - bne _0805F86E - adds r0, r3, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - cmp r0, r4 - bne _0805F86E - movs r0, 0x1 - mov r10, r0 -_0805F86E: - ldr r1, [sp] - cmp r1, 0 - beq _0805F958 - mov r0, r10 - cmp r0, 0 - beq _0805F958 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0805F8D2 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0805F8D2 - ldr r1, =0x03005d7c - ldr r5, =0x02024064 - ldrb r0, [r5] - movs r4, 0x2 - eors r0, r4 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - ldrb r0, [r5] - eors r4, r0 - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_805EE54 -_0805F8D2: - ldr r1, =0x03005d7c - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - ldrb r5, [r4] - ldr r1, =0x0202406e - lsls r0, r5, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r5, 0 - bl sub_805EE54 - ldr r3, =0x020244d0 - ldr r0, [r3] - ldr r2, [r0, 0x8] - ldrb r1, [r2, 0x9] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x9] - ldr r0, [r3] - ldrb r2, [r4] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r0, 0x21 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1] - ldr r0, [r3] - ldrb r2, [r4] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r0, 0x7F - ands r0, r2 - strb r0, [r1, 0x1] - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805F2F0 - str r1, [r0] -_0805F958: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805F560 - - thumb_func_start sub_805F994 -sub_805F994: @ 805F994 - push {r4,r5,lr} - ldr r2, =0x02020630 - ldr r0, =0x020241e4 - ldr r1, =0x02024064 - ldrb r3, [r1] - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x24 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0805F9E0 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0, 0x4] - lsls r2, r3, 1 - adds r0, r2, r3 - lsls r0, 2 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0xC0 - lsls r0, 1 - ands r0, r1 - cmp r0, 0 - bne _0805F9E0 - ldr r0, =0x0202406e - adds r0, r2, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 - adds r1, r0 - adds r0, r3, 0 - bl sub_8172EF0 -_0805F9E0: - ldr r2, =0x02020630 - ldr r0, =0x020241e4 - ldr r5, =0x02024064 - ldrb r3, [r5] - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - bne _0805FA48 - ldr r4, =0x020244d0 - ldr r0, [r4] - ldr r1, [r0, 0x4] - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 2 - adds r2, r0, r1 - ldrb r1, [r2, 0x1] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0805FA48 - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - ldr r0, [r4] - ldrb r2, [r5] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1] - ldr r4, =0x000027f9 - adds r0, r4, 0 - bl FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - bl dp01_tbl7_exec_completed -_0805FA48: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805F994 - - thumb_func_start sub_805FA70 -sub_805FA70: @ 805FA70 - push {r4-r6,lr} - ldr r6, =0x02024064 - ldrb r0, [r6] - ldr r5, =0x03005d70 - adds r1, r0, r5 - ldrb r1, [r1] - movs r2, 0 - movs r3, 0 - bl sub_8074AA0 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldrb r0, [r6] - adds r0, r5 - ldrb r0, [r0] - bl sub_80729D0 - lsls r4, 16 - asrs r1, r4, 16 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _0805FAB8 - ldrb r0, [r6] - adds r0, r5 - ldrb r0, [r0] - movs r2, 0 - bl heathbar_draw_hp - b _0805FABC - .pool -_0805FAB8: - bl dp01_tbl7_exec_completed -_0805FABC: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_805FA70 - - thumb_func_start sub_805FAC4 -sub_805FAC4: @ 805FAC4 - push {lr} - ldr r2, =0x02020630 - ldr r0, =0x020241e4 - ldr r1, =0x02024064 - ldrb r3, [r1] - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 31 - cmp r0, 0 - bne _0805FAF2 - ldr r0, =0x03005d70 - adds r0, r3, r0 - ldrb r0, [r0] - bl sub_8072984 - bl dp01_tbl7_exec_completed -_0805FAF2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_805FAC4 - - thumb_func_start sub_805FB08 -sub_805FB08: @ 805FB08 - push {r4-r6,lr} - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r6, =0x02024064 - ldrb r2, [r6] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0805FB62 - ldr r5, =0x020241e4 - adds r0, r2, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl obj_free_rotscale_entry - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldrb r0, [r6] - bl sub_805EEE0 - ldr r1, =0x03005d70 - ldrb r0, [r6] - adds r0, r1 - ldrb r0, [r0] - bl sub_8072984 - bl dp01_tbl7_exec_completed -_0805FB62: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805FB08 - - thumb_func_start bx_t7_button_a -bx_t7_button_a: @ 805FB7C - push {lr} - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _0805FB8E - bl dp01_tbl7_exec_completed -_0805FB8E: - pop {r0} - bx r0 - thumb_func_end bx_t7_button_a - - thumb_func_start bx_blink_t7 -bx_blink_t7: @ 805FB94 - push {r4,lr} - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - ldr r2, =0x02020630 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, r0, r2 - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0x20 - bne _0805FBE0 - movs r3, 0 - movs r0, 0 - strh r0, [r4, 0x30] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - subs r0, 0x5 - ands r0, r1 - strb r0, [r2] - ldr r0, =0x020244b9 - strb r3, [r0] - bl dp01_tbl7_exec_completed - b _0805FC0A - .pool -_0805FBE0: - ldrh r0, [r4, 0x30] - movs r1, 0x3 - ands r0, r1 - cmp r0, 0 - bne _0805FC04 - adds r3, r4, 0 - adds r3, 0x3E - ldrb r2, [r3] - lsls r0, r2, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] -_0805FC04: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] -_0805FC0A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end bx_blink_t7 - - thumb_func_start sub_805FC10 -sub_805FC10: @ 805FC10 - push {r4,lr} - ldr r2, =0x02020630 - ldr r0, =0x03005d70 - ldr r4, =0x02024064 - ldrb r3, [r4] - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - bne _0805FC5C - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0] - lsls r0, r3, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0805FC50 - adds r0, r3, 0 - adds r1, r3, 0 - adds r2, r3, 0 - movs r3, 0x6 - bl move_anim_start_t4 -_0805FC50: - ldr r0, =0x03005d60 - ldrb r1, [r4] - lsls r1, 2 - adds r1, r0 - ldr r0, =bx_803AEDC - str r0, [r1] -_0805FC5C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805FC10 - - thumb_func_start bx_803AEDC -bx_803AEDC: @ 805FC80 - push {r4,lr} - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r4, =0x02024064 - ldrb r1, [r4] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0805FCDA - bl sub_80A36C8 - lsls r0, 24 - cmp r0, 0 - bne _0805FCDA - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldrb r0, [r4] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - beq _0805FCCA - ldr r0, =nullsub_18 - cmp r1, r0 - bne _0805FCDA -_0805FCCA: - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl MPlayVolumeControl - bl dp01_tbl7_exec_completed -_0805FCDA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end bx_803AEDC - - thumb_func_start sub_805FD00 -sub_805FD00: @ 805FD00 - push {r4-r7,lr} - ldr r4, =0x020244d0 - ldr r0, [r4] - ldr r5, =0x02024064 - ldrb r2, [r5] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r3, r0, r1 - ldrb r1, [r3, 0x1] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0805FDBC - ldr r7, =0x02020630 - ldr r6, =0x020241e4 - adds r0, r2, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r7, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - bne _0805FDBC - ldrb r1, [r3] - movs r0, 0x7F - ands r0, r1 - strb r0, [r3] - ldr r0, [r4] - ldrb r2, [r5] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1] - ldr r4, =0x000027f9 - adds r0, r4, 0 - bl FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - movs r1, 0 - bl StartObjectImageAnim - ldr r4, =0x03005d70 - ldrb r1, [r5] - adds r0, r1, r4 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x02024744 - adds r1, r2 - movs r2, 0 - bl healthbar_draw_field_maybe - ldrb r0, [r5] - bl sub_8076918 - ldrb r0, [r5] - adds r0, r4 - ldrb r0, [r0] - bl sub_80729D0 - ldrb r0, [r5] - bl sub_805E408 - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805FC10 - str r1, [r0] -_0805FDBC: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805FD00 - - thumb_func_start sub_805FDF0 -sub_805FDF0: @ 805FDF0 - push {r4-r6,lr} - ldr r6, =0x020244d0 - ldr r0, [r6] - ldr r5, =0x02024064 - ldrb r2, [r5] - ldr r1, [r0, 0x4] - lsls r3, r2, 1 - adds r0, r3, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x88 - ands r0, r1 - cmp r0, 0 - bne _0805FE22 - ldr r0, =0x0202406e - adds r0, r3, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 - adds r1, r0 - adds r0, r2, 0 - bl sub_8172EF0 -_0805FE22: - ldr r4, =0x02020630 - ldr r0, =0x03005d7c - ldrb r2, [r5] - adds r0, r2, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r3, r0, 2 - adds r0, r4, 0 - adds r0, 0x1C - adds r0, r3, r0 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - bne _0805FE8C - ldr r0, [r6] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - bne _0805FE8C - adds r0, r3, r4 - bl RemoveObjectAndFreeTiles - ldrb r4, [r5] - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_805EE54 - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805FD00 - str r1, [r0] -_0805FE8C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805FDF0 - - thumb_func_start sub_805FEB8 -sub_805FEB8: @ 805FEB8 - push {lr} - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _0805FEDA - bl dp01_tbl7_exec_completed -_0805FEDA: - pop {r0} - bx r0 - .pool - thumb_func_end sub_805FEB8 - - thumb_func_start bx_803B0F4 -bx_803B0F4: @ 805FEE8 - push {lr} - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _0805FF0A - bl dp01_tbl7_exec_completed -_0805FF0A: - pop {r0} - bx r0 - .pool - thumb_func_end bx_803B0F4 - - thumb_func_start dp01_tbl7_exec_completed -dp01_tbl7_exec_completed: @ 805FF18 - push {r4,lr} - sub sp, 0x4 - ldr r1, =0x03005d60 - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_exec_buffer_A_ch0_tbl7 - str r1, [r0] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0805FF6C - bl link_get_multiplayer_id - mov r1, sp - strb r0, [r1] - movs r0, 0x2 - movs r1, 0x4 - mov r2, sp - bl dp01_prepare_buffer_wireless_probably - ldr r1, =0x02023064 - ldrb r0, [r4] - lsls r0, 9 - adds r0, r1 - movs r1, 0x38 - strb r1, [r0] - b _0805FF7E - .pool -_0805FF6C: - ldr r2, =0x02024068 - ldr r1, =gUnknown_0832A328 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - ldr r0, [r2] - bics r0, r1 - str r0, [r2] -_0805FF7E: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_tbl7_exec_completed - - thumb_func_start dp01t_00_7_getattr -dp01t_00_7_getattr: @ 805FF90 - push {r4-r6,lr} - sub sp, 0x100 - movs r6, 0 - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x2 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0 - bne _0805FFC8 - ldr r0, =0x0202406e - lsls r1, r2, 1 - adds r1, r0 - ldrb r0, [r1] - mov r1, sp - bl sub_8060004 - adds r6, r0, 0 - b _0805FFEA - .pool -_0805FFC8: - ldrb r4, [r1] - movs r5, 0 -_0805FFCC: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _0805FFE2 - lsls r0, r5, 24 - lsrs r0, 24 - mov r2, sp - adds r1, r2, r6 - bl sub_8060004 - adds r6, r0 -_0805FFE2: - lsrs r4, 1 - adds r5, 0x1 - cmp r5, 0x5 - ble _0805FFCC -_0805FFEA: - lsls r1, r6, 16 - lsrs r1, 16 - movs r0, 0x1 - mov r2, sp - bl dp01_build_cmdbuf_x1D_1D_numargs_varargs - bl dp01_tbl7_exec_completed - add sp, 0x100 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end dp01t_00_7_getattr - - thumb_func_start sub_8060004 -sub_8060004: @ 8060004 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x90 - adds r7, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - movs r6, 0 - ldr r2, =0x02023064 - ldr r3, =0x02024064 - ldrb r0, [r3] - lsls r0, 9 - adds r1, r2, 0x1 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3B - bls _0806002E - bl _0806079A -_0806002E: - lsls r0, 2 - ldr r1, =_08060044 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08060044: - .4byte _08060134 - .4byte _08060358 - .4byte _08060368 - .4byte _08060378 - .4byte _080603E0 - .4byte _080603E0 - .4byte _080603E0 - .4byte _080603E0 - .4byte _080603FC - .4byte _08060438 - .4byte _08060438 - .4byte _08060438 - .4byte _08060438 - .4byte _0806079A - .4byte _0806079A - .4byte _0806079A - .4byte _0806079A - .4byte _08060454 - .4byte _08060464 - .4byte _08060494 - .4byte _080604A4 - .4byte _080604B4 - .4byte _080604C4 - .4byte _080604D4 - .4byte _080604E4 - .4byte _080604F4 - .4byte _08060504 - .4byte _08060514 - .4byte _08060524 - .4byte _08060534 - .4byte _08060544 - .4byte _08060554 - .4byte _080605A4 - .4byte _080605B4 - .4byte _080605C4 - .4byte _080605D4 - .4byte _080605E4 - .4byte _080605F4 - .4byte _08060604 - .4byte _08060614 - .4byte _08060624 - .4byte _08060658 - .4byte _08060668 - .4byte _08060678 - .4byte _08060688 - .4byte _08060698 - .4byte _080606A8 - .4byte _080606B8 - .4byte _080606C8 - .4byte _080606E8 - .4byte _080606F8 - .4byte _08060708 - .4byte _08060718 - .4byte _08060728 - .4byte _08060738 - .4byte _08060748 - .4byte _08060758 - .4byte _08060768 - .4byte _08060778 - .4byte _08060788 -_08060134: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - mov r1, sp - strh r0, [r1] - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x2E] - movs r6, 0 - add r0, sp, 0x24 - mov r9, r0 - movs r1, 0x3B - add r1, sp - mov r10, r1 - mov r2, sp - adds r2, 0x2B - str r2, [sp, 0x80] - mov r0, sp - adds r0, 0x2A - str r0, [sp, 0x7C] - mov r1, sp - adds r1, 0x68 - str r1, [sp, 0x8C] - adds r2, 0x5 - str r2, [sp, 0x84] - adds r0, 0x12 - str r0, [sp, 0x88] - mov r8, r4 - add r4, sp, 0xC -_08060180: - adds r1, r6, 0 - adds r1, 0xD - mov r0, r8 - bl pokemon_getattr - strh r0, [r4] - adds r1, r6, 0 - adds r1, 0x11 - mov r0, r8 - bl pokemon_getattr - mov r2, r9 - adds r1, r2, r6 - strb r0, [r1] - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - ble _08060180 - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x15 - bl pokemon_getattr - mov r1, r10 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x20 - bl pokemon_getattr - ldr r2, [sp, 0x80] - strb r0, [r2] - adds r0, r4, 0 - movs r1, 0x19 - bl pokemon_getattr - str r0, [sp, 0x44] - adds r0, r4, 0 - movs r1, 0x27 - bl pokemon_getattr - mov r3, sp - movs r5, 0x1F - ands r0, r5 - ldrb r2, [r3, 0x14] - movs r1, 0x20 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x14] - adds r0, r4, 0 - movs r1, 0x28 - bl pokemon_getattr - mov r3, sp - movs r6, 0x1F - ands r0, r6 - lsls r0, 5 - ldrh r2, [r3, 0x14] - ldr r1, =0xfffffc1f - ands r1, r2 - orrs r1, r0 - strh r1, [r3, 0x14] - adds r0, r4, 0 - movs r1, 0x29 - bl pokemon_getattr - mov r3, sp - ands r0, r5 - lsls r0, 2 - ldrb r2, [r3, 0x15] - movs r1, 0x7D - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x15] - adds r0, r4, 0 - movs r1, 0x2A - bl pokemon_getattr - movs r1, 0x1F - ands r1, r0 - lsls r1, 15 - ldr r0, [sp, 0x14] - ldr r2, =0xfff07fff - ands r0, r2 - orrs r0, r1 - str r0, [sp, 0x14] - adds r0, r4, 0 - movs r1, 0x2B - bl pokemon_getattr - mov r3, sp - ands r0, r6 - lsls r0, 4 - ldrh r2, [r3, 0x16] - ldr r1, =0xfffffe0f - ands r1, r2 - orrs r1, r0 - strh r1, [r3, 0x16] - adds r0, r4, 0 - movs r1, 0x2C - bl pokemon_getattr - mov r3, sp - ands r0, r5 - lsls r0, 1 - ldrb r2, [r3, 0x17] - movs r1, 0x3F - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x17] - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - str r0, [sp, 0x48] - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr - str r0, [sp, 0x4C] - adds r0, r4, 0 - movs r1, 0x38 - bl pokemon_getattr - ldr r1, [sp, 0x7C] - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x28] - adds r0, r4, 0 - movs r1, 0x3A - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x2C] - adds r0, r4, 0 - movs r1, 0x3B - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x2] - adds r0, r4, 0 - movs r1, 0x3C - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x4] - adds r0, r4, 0 - movs r1, 0x3D - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x6] - adds r0, r4, 0 - movs r1, 0x3E - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x8] - adds r0, r4, 0 - movs r1, 0x3F - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0xA] - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - mov r3, sp - movs r1, 0x1 - ands r0, r1 - lsls r0, 6 - ldrb r2, [r3, 0x17] - movs r1, 0x41 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x17] - adds r0, r4, 0 - movs r1, 0x2E - bl pokemon_getattr - mov r3, sp - lsls r0, 7 - ldrb r2, [r3, 0x17] - movs r1, 0x7F - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x17] - adds r0, r4, 0 - movs r1, 0x1 - bl pokemon_getattr - str r0, [sp, 0x54] - adds r0, r4, 0 - movs r1, 0x2 - ldr r2, [sp, 0x8C] - bl pokemon_getattr - ldr r0, [sp, 0x84] - ldr r1, [sp, 0x8C] - bl CopyString_Limit10 - adds r0, r4, 0 - movs r1, 0x7 - ldr r2, [sp, 0x88] - bl pokemon_getattr - mov r2, sp - movs r6, 0 -_08060338: - adds r0, r7, r6 - adds r1, r2, r6 - ldrb r1, [r1] - strb r1, [r0] - adds r6, 0x1 - cmp r6, 0x57 - bls _08060338 - b _0806079A - .pool -_08060358: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - b _080606D2 - .pool -_08060368: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xC - b _080606D2 - .pool -_08060378: - movs r6, 0 - add r2, sp, 0x58 - mov r9, r2 - add r0, sp, 0x60 - mov r10, r0 - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x02024744 - adds r4, r1, r0 - mov r8, r9 -_0806038E: - adds r1, r6, 0 - adds r1, 0xD - adds r0, r4, 0 - bl pokemon_getattr - mov r1, r8 - strh r0, [r1] - adds r1, r6, 0 - adds r1, 0x11 - adds r0, r4, 0 - bl pokemon_getattr - mov r2, r10 - adds r1, r2, r6 - strb r0, [r1] - movs r0, 0x2 - add r8, r0 - adds r6, 0x1 - cmp r6, 0x3 - ble _0806038E - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x15 - bl pokemon_getattr - mov r1, r9 - strb r0, [r1, 0xC] - mov r2, r9 - movs r6, 0 -_080603CC: - adds r0, r7, r6 - adds r1, r2, r6 - ldrb r1, [r1] - strb r1, [r0] - adds r6, 0x1 - cmp r6, 0xF - bls _080603CC - b _0806079A - .pool -_080603E0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r1, [r3] - lsls r1, 9 - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - adds r1, 0x9 - b _080606D2 - .pool -_080603FC: - movs r6, 0 - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r2, =0x02024744 - mov r8, r2 -_08060408: - adds r1, r6, 0 - adds r1, 0x11 - mov r2, r8 - adds r0, r4, r2 - bl pokemon_getattr - adds r1, r7, r6 - strb r0, [r1] - adds r6, 0x1 - cmp r6, 0x3 - ble _08060408 - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x15 - bl pokemon_getattr - adds r1, r7, r6 - strb r0, [r1] - adds r6, 0x1 - b _0806079A - .pool -_08060438: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r1, [r3] - lsls r1, 9 - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - adds r1, 0x8 - b _08060792 - .pool -_08060454: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x1 - b _0806046E - .pool -_08060464: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x19 -_0806046E: - bl pokemon_getattr - adds r1, r0, 0 - strb r1, [r7] - movs r0, 0xFF - lsls r0, 8 - ands r0, r1 - lsrs r0, 8 - strb r0, [r7, 0x1] - movs r0, 0xFF - lsls r0, 16 - ands r0, r1 - lsrs r0, 16 - strb r0, [r7, 0x2] - movs r6, 0x3 - b _0806079A - .pool -_08060494: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x1A - b _08060792 - .pool -_080604A4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x1B - b _08060792 - .pool -_080604B4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x1C - b _08060792 - .pool -_080604C4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x1D - b _08060792 - .pool -_080604D4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x1E - b _08060792 - .pool -_080604E4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x1F - b _08060792 - .pool -_080604F4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x20 - b _08060792 - .pool -_08060504: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x22 - b _08060792 - .pool -_08060514: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x23 - b _08060792 - .pool -_08060524: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x24 - b _08060792 - .pool -_08060534: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x25 - b _08060792 - .pool -_08060544: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x26 - b _08060792 - .pool -_08060554: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x27 - bl pokemon_getattr - strb r0, [r7] - adds r0, r4, 0 - movs r1, 0x28 - bl pokemon_getattr - strb r0, [r7, 0x1] - adds r0, r4, 0 - movs r1, 0x29 - bl pokemon_getattr - strb r0, [r7, 0x2] - adds r0, r4, 0 - movs r1, 0x2A - bl pokemon_getattr - strb r0, [r7, 0x3] - adds r0, r4, 0 - movs r1, 0x2B - bl pokemon_getattr - strb r0, [r7, 0x4] - adds r0, r4, 0 - movs r1, 0x2C - bl pokemon_getattr - strb r0, [r7, 0x5] - movs r6, 0x6 - b _0806079A - .pool -_080605A4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x27 - b _08060792 - .pool -_080605B4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x28 - b _08060792 - .pool -_080605C4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x29 - b _08060792 - .pool -_080605D4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x2A - b _08060792 - .pool -_080605E4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x2B - b _08060792 - .pool -_080605F4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x2C - b _08060792 - .pool -_08060604: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0 - b _0806062E - .pool -_08060614: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x9 - b _080606D2 - .pool -_08060624: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x37 -_0806062E: - bl pokemon_getattr - adds r1, r0, 0 - strb r1, [r7] - movs r0, 0xFF - lsls r0, 8 - ands r0, r1 - lsrs r0, 8 - strb r0, [r7, 0x1] - movs r0, 0xFF - lsls r0, 16 - ands r0, r1 - lsrs r0, 16 - strb r0, [r7, 0x2] - lsrs r0, r1, 24 - strb r0, [r7, 0x3] - movs r6, 0x4 - b _0806079A - .pool -_08060658: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x38 - b _08060792 - .pool -_08060668: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x39 - b _080606D2 - .pool -_08060678: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3A - b _080606D2 - .pool -_08060688: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3B - b _080606D2 - .pool -_08060698: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3C - b _080606D2 - .pool -_080606A8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3D - b _080606D2 - .pool -_080606B8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3E - b _080606D2 - .pool -_080606C8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3F -_080606D2: - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - strb r0, [r7] - lsrs r0, 8 - strb r0, [r7, 0x1] - movs r6, 0x2 - b _0806079A - .pool -_080606E8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x16 - b _08060792 - .pool -_080606F8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x17 - b _08060792 - .pool -_08060708: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x18 - b _08060792 - .pool -_08060718: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x21 - b _08060792 - .pool -_08060728: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x2F - b _08060792 - .pool -_08060738: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x30 - b _08060792 - .pool -_08060748: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x32 - b _08060792 - .pool -_08060758: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x33 - b _08060792 - .pool -_08060768: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x34 - b _08060792 - .pool -_08060778: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x35 - b _08060792 - .pool -_08060788: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x36 -_08060792: - bl pokemon_getattr - strb r0, [r7] - movs r6, 0x1 -_0806079A: - adds r0, r6, 0 - add sp, 0x90 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8060004 - - thumb_func_start dp01t_01_2_read_pokmon_data_slice -dp01t_01_2_read_pokmon_data_slice: @ 80607B0 - push {r4-r7,lr} - sub sp, 0x58 - ldr r2, =0x0202406e - ldr r5, =0x02024064 - ldrb r1, [r5] - lsls r0, r1, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - adds r4, r2, 0 - muls r4, r0 - ldr r3, =0x02023064 - lsls r1, 9 - adds r0, r3, 0x1 - adds r0, r1, r0 - ldrb r2, [r0] - ldr r0, =0x02024744 - adds r0, r2, r0 - adds r6, r4, r0 - mov r0, sp - adds r4, r0, r2 - movs r2, 0 - adds r0, r3, 0x2 - adds r1, r0 - adds r7, r5, 0 - mov r12, r3 - ldrb r1, [r1] - cmp r2, r1 - bcs _08060806 - adds r3, r0, 0 -_080607EC: - adds r1, r4, r2 - adds r0, r6, r2 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - ldrb r0, [r5] - lsls r0, 9 - adds r0, r3 - ldrb r0, [r0] - cmp r2, r0 - bcc _080607EC -_08060806: - ldrb r0, [r7] - lsls r0, 9 - mov r1, r12 - adds r1, 0x2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - adds r2, r4, 0 - bl dp01_build_cmdbuf_x1D_1D_numargs_varargs - bl dp01_tbl7_exec_completed - add sp, 0x58 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_01_2_read_pokmon_data_slice - - thumb_func_start dp01t_02_7_setattr -dp01t_02_7_setattr: @ 8060838 - push {r4,r5,lr} - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x2 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0 - bne _08060868 - ldr r0, =0x0202406e - lsls r1, r2, 1 - adds r1, r0 - ldrb r0, [r1] - bl sub_8060890 - b _08060886 - .pool -_08060868: - ldrb r4, [r1] - movs r5, 0 -_0806086C: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _0806087A - adds r0, r5, 0 - bl sub_8060890 -_0806087A: - lsrs r4, 1 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _0806086C -_08060886: - bl dp01_tbl7_exec_completed - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end dp01t_02_7_setattr - - thumb_func_start sub_8060890 -sub_8060890: @ 8060890 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x38 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r3, =0x02024064 - ldrb r0, [r3] - lsls r0, 9 - ldr r2, =0x02023067 - adds r4, r0, r2 - adds r7, r4, 0 - subs r1, r2, 0x2 - adds r0, r1 - ldrb r0, [r0] - adds r6, r3, 0 - adds r3, r2, 0 - cmp r0, 0x3B - bls _080608BE - bl _0806119C -_080608BE: - lsls r0, 2 - ldr r1, =_080608D4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080608D4: - .4byte _080609C4 - .4byte _08060B5C - .4byte _08060B78 - .4byte _08060B94 - .4byte _08060BE8 - .4byte _08060BE8 - .4byte _08060BE8 - .4byte _08060BE8 - .4byte _08060C08 - .4byte _08060C70 - .4byte _08060C70 - .4byte _08060C70 - .4byte _08060C70 - .4byte _0806119C - .4byte _0806119C - .4byte _0806119C - .4byte _0806119C - .4byte _08060C98 - .4byte _08060CB4 - .4byte _08060CD0 - .4byte _08060CEC - .4byte _08060D08 - .4byte _08060D24 - .4byte _08060D40 - .4byte _08060D5C - .4byte _08060D78 - .4byte _08060D94 - .4byte _08060DB0 - .4byte _08060DCC - .4byte _08060DE8 - .4byte _08060E04 - .4byte _08060E20 - .4byte _08060E94 - .4byte _08060EB0 - .4byte _08060ECC - .4byte _08060EE8 - .4byte _08060F04 - .4byte _08060F20 - .4byte _08060F3C - .4byte _08060F58 - .4byte _08060F74 - .4byte _08060F90 - .4byte _08060FAC - .4byte _08060FC8 - .4byte _08060FE4 - .4byte _08061000 - .4byte _0806101C - .4byte _08061038 - .4byte _08061054 - .4byte _08061070 - .4byte _0806108C - .4byte _080610A8 - .4byte _080610C4 - .4byte _080610E0 - .4byte _080610FC - .4byte _08061118 - .4byte _08061134 - .4byte _08061150 - .4byte _0806116C - .4byte _08061188 -_080609C4: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - adds r2, r7, 0 - bl pokemon_setattr - adds r2, r7, 0 - adds r2, 0x2E - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_setattr - movs r0, 0 - mov r8, r0 - movs r0, 0x3B - adds r0, r7 - mov r10, r0 - adds r0, r7, 0 - adds r0, 0x2B - str r0, [sp, 0x20] - adds r0, 0x19 - str r0, [sp, 0x28] - adds r0, 0x4 - str r0, [sp, 0x2C] - adds r0, 0x4 - str r0, [sp, 0x30] - subs r0, 0x22 - str r0, [sp, 0x1C] - subs r0, 0x2 - str r0, [sp, 0x18] - adds r0, 0x4 - str r0, [sp, 0x24] - adds r0, r7, 0x2 - str r0, [sp, 0x4] - adds r0, r7, 0x4 - str r0, [sp, 0x8] - adds r0, r7, 0x6 - str r0, [sp, 0xC] - adds r0, 0x2 - str r0, [sp, 0x10] - adds r0, 0x2 - str r0, [sp, 0x14] - mov r9, r4 - adds r6, r7, 0 - adds r6, 0x24 - adds r4, r7, 0 - adds r4, 0xC -_08060A2A: - mov r1, r8 - adds r1, 0xD - mov r0, r9 - adds r2, r4, 0 - bl pokemon_setattr - mov r1, r8 - adds r1, 0x11 - mov r0, r9 - adds r2, r6, 0 - bl pokemon_setattr - adds r6, 0x1 - adds r4, 0x2 - movs r0, 0x1 - add r8, r0 - mov r0, r8 - cmp r0, 0x3 - ble _08060A2A - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x15 - mov r2, r10 - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x20 - ldr r2, [sp, 0x20] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x19 - ldr r2, [sp, 0x28] - bl pokemon_setattr - ldrb r0, [r7, 0x14] - lsls r0, 27 - lsrs r0, 27 - mov r1, sp - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x27 - mov r2, sp - bl pokemon_setattr - mov r1, sp - ldrh r0, [r7, 0x14] - lsls r0, 22 - lsrs r0, 27 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x28 - mov r2, sp - bl pokemon_setattr - mov r1, sp - ldrb r0, [r7, 0x15] - lsls r0, 25 - lsrs r0, 27 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x29 - mov r2, sp - bl pokemon_setattr - mov r1, sp - ldr r0, [r7, 0x14] - lsls r0, 12 - lsrs r0, 27 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x2A - mov r2, sp - bl pokemon_setattr - mov r1, sp - ldrh r0, [r7, 0x16] - lsls r0, 23 - lsrs r0, 27 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x2B - mov r2, sp - bl pokemon_setattr - mov r1, sp - ldrb r0, [r7, 0x17] - lsls r0, 26 - lsrs r0, 27 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x2C - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0 - ldr r2, [sp, 0x2C] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x37 - ldr r2, [sp, 0x30] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x38 - ldr r2, [sp, 0x1C] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x39 - ldr r2, [sp, 0x18] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3A - ldr r2, [sp, 0x24] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3B - ldr r2, [sp, 0x4] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3C - ldr r2, [sp, 0x8] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3D - ldr r2, [sp, 0xC] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3E - ldr r2, [sp, 0x10] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3F - ldr r2, [sp, 0x14] - bl pokemon_setattr - b _0806119C - .pool -_08060B5C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0xB - bl pokemon_setattr - b _0806119C - .pool -_08060B78: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0xC - bl pokemon_setattr - b _0806119C - .pool -_08060B94: - movs r0, 0 - mov r8, r0 - movs r0, 0xC - adds r0, r4 - mov r9, r0 - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x02024744 - adds r7, r1, r0 - adds r6, r4, 0 - adds r6, 0x8 -_08060BAC: - mov r1, r8 - adds r1, 0xD - adds r0, r7, 0 - adds r2, r4, 0 - bl pokemon_setattr - mov r1, r8 - adds r1, 0x11 - adds r0, r7, 0 - adds r2, r6, 0 - bl pokemon_setattr - adds r6, 0x1 - adds r4, 0x2 - movs r0, 0x1 - add r8, r0 - mov r0, r8 - cmp r0, 0x3 - ble _08060BAC - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x15 - mov r2, r9 - bl pokemon_setattr - b _0806119C - .pool -_08060BE8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldr r3, =0x02023064 - ldrb r2, [r6] - lsls r2, 9 - adds r1, r3, 0x1 - adds r1, r2, r1 - ldrb r1, [r1] - adds r1, 0x9 - b _08060C86 - .pool -_08060C08: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - adds r0, r4, 0 - movs r1, 0x11 - str r3, [sp, 0x34] - bl pokemon_setattr - ldrb r2, [r6] - lsls r2, 9 - ldr r3, [sp, 0x34] - adds r0, r3, 0x1 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x12 - bl pokemon_setattr - ldrb r2, [r6] - lsls r2, 9 - ldr r3, [sp, 0x34] - adds r0, r3, 0x2 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x13 - bl pokemon_setattr - ldrb r2, [r6] - lsls r2, 9 - ldr r3, [sp, 0x34] - adds r0, r3, 0x3 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x14 - bl pokemon_setattr - ldrb r2, [r6] - lsls r2, 9 - ldr r3, [sp, 0x34] - adds r0, r3, 0x4 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x15 - bl pokemon_setattr - b _0806119C - .pool -_08060C70: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldr r3, =0x02023064 - ldrb r2, [r6] - lsls r2, 9 - adds r1, r3, 0x1 - adds r1, r2, r1 - ldrb r1, [r1] - adds r1, 0x8 -_08060C86: - adds r3, 0x3 - adds r2, r3 - bl pokemon_setattr - b _0806119C - .pool -_08060C98: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1 - bl pokemon_setattr - b _0806119C - .pool -_08060CB4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x19 - bl pokemon_setattr - b _0806119C - .pool -_08060CD0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1A - bl pokemon_setattr - b _0806119C - .pool -_08060CEC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1B - bl pokemon_setattr - b _0806119C - .pool -_08060D08: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1C - bl pokemon_setattr - b _0806119C - .pool -_08060D24: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1D - bl pokemon_setattr - b _0806119C - .pool -_08060D40: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1E - bl pokemon_setattr - b _0806119C - .pool -_08060D5C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1F - bl pokemon_setattr - b _0806119C - .pool -_08060D78: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x20 - bl pokemon_setattr - b _0806119C - .pool -_08060D94: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x22 - bl pokemon_setattr - b _0806119C - .pool -_08060DB0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x23 - bl pokemon_setattr - b _0806119C - .pool -_08060DCC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x24 - bl pokemon_setattr - b _0806119C - .pool -_08060DE8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x25 - bl pokemon_setattr - b _0806119C - .pool -_08060E04: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x26 - bl pokemon_setattr - b _0806119C - .pool -_08060E20: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - adds r0, r4, 0 - movs r1, 0x27 - str r3, [sp, 0x34] - bl pokemon_setattr - ldrb r2, [r6] - lsls r2, 9 - ldr r3, [sp, 0x34] - adds r0, r3, 0x1 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x28 - bl pokemon_setattr - ldrb r2, [r6] - lsls r2, 9 - ldr r3, [sp, 0x34] - adds r0, r3, 0x2 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x29 - bl pokemon_setattr - ldrb r2, [r6] - lsls r2, 9 - ldr r3, [sp, 0x34] - adds r0, r3, 0x3 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x2A - bl pokemon_setattr - ldrb r2, [r6] - lsls r2, 9 - ldr r3, [sp, 0x34] - adds r0, r3, 0x4 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x2B - bl pokemon_setattr - ldrb r2, [r6] - lsls r2, 9 - ldr r3, [sp, 0x34] - adds r0, r3, 0x5 - adds r2, r0 - adds r0, r4, 0 - b _08060F2E - .pool -_08060E94: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x27 - bl pokemon_setattr - b _0806119C - .pool -_08060EB0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x28 - bl pokemon_setattr - b _0806119C - .pool -_08060ECC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x29 - bl pokemon_setattr - b _0806119C - .pool -_08060EE8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x2A - bl pokemon_setattr - b _0806119C - .pool -_08060F04: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x2B - bl pokemon_setattr - b _0806119C - .pool -_08060F20: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 -_08060F2E: - movs r1, 0x2C - bl pokemon_setattr - b _0806119C - .pool -_08060F3C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0 - bl pokemon_setattr - b _0806119C - .pool -_08060F58: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x9 - bl pokemon_setattr - b _0806119C - .pool -_08060F74: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x37 - bl pokemon_setattr - b _0806119C - .pool -_08060F90: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x38 - bl pokemon_setattr - b _0806119C - .pool -_08060FAC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x39 - bl pokemon_setattr - b _0806119C - .pool -_08060FC8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3A - bl pokemon_setattr - b _0806119C - .pool -_08060FE4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3B - bl pokemon_setattr - b _0806119C - .pool -_08061000: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3C - bl pokemon_setattr - b _0806119C - .pool -_0806101C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3D - bl pokemon_setattr - b _0806119C - .pool -_08061038: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3E - bl pokemon_setattr - b _0806119C - .pool -_08061054: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3F - bl pokemon_setattr - b _0806119C - .pool -_08061070: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x16 - bl pokemon_setattr - b _0806119C - .pool -_0806108C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x17 - bl pokemon_setattr - b _0806119C - .pool -_080610A8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x18 - bl pokemon_setattr - b _0806119C - .pool -_080610C4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x21 - bl pokemon_setattr - b _0806119C - .pool -_080610E0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x2F - bl pokemon_setattr - b _0806119C - .pool -_080610FC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x30 - bl pokemon_setattr - b _0806119C - .pool -_08061118: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x32 - bl pokemon_setattr - b _0806119C - .pool -_08061134: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x33 - bl pokemon_setattr - b _0806119C - .pool -_08061150: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x34 - bl pokemon_setattr - b _0806119C - .pool -_0806116C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x35 - bl pokemon_setattr - b _0806119C - .pool -_08061188: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x36 - bl pokemon_setattr -_0806119C: - add sp, 0x38 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8060890 - - thumb_func_start sub_80611B0 -sub_80611B0: @ 80611B0 - push {r4-r7,lr} - ldr r1, =0x0202406e - ldr r7, =0x02024064 - ldrb r2, [r7] - lsls r0, r2, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - adds r3, r1, 0 - muls r3, r0 - ldr r4, =0x02023064 - lsls r2, 9 - adds r0, r4, 0x1 - adds r0, r2, r0 - ldrb r0, [r0] - ldr r1, =0x02024744 - adds r0, r1 - adds r5, r3, r0 - movs r3, 0 - adds r0, r4, 0x2 - adds r2, r0 - ldrb r2, [r2] - cmp r3, r2 - bcs _08061208 - adds r6, r4, 0 - adds r2, r7, 0 - adds r4, r0, 0 -_080611E6: - adds r1, r5, r3 - ldrb r0, [r2] - lsls r0, 9 - adds r0, 0x3 - adds r0, r3, r0 - adds r0, r6 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - ldrb r0, [r2] - lsls r0, 9 - adds r0, r4 - ldrb r0, [r0] - cmp r3, r0 - bcc _080611E6 -_08061208: - bl dp01_tbl7_exec_completed - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80611B0 - - thumb_func_start sub_8061224 -sub_8061224: @ 8061224 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r6, =0x02024064 - ldrb r0, [r6] - lsls r0, 1 - ldr r1, =0x0202406e - adds r0, r1 - ldrh r0, [r0] - movs r7, 0x64 - muls r0, r7 - ldr r2, =0x02024744 - mov r10, r2 - add r0, r10 - movs r1, 0xB - bl pokemon_getattr - mov r8, r0 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldrb r1, [r6] - lsls r0, r1, 1 - ldr r2, =0x0202406e - adds r0, r2 - ldrh r0, [r0] - muls r0, r7 - add r0, r10 - bl sub_805DC0C - ldrb r0, [r6] - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, r8 - bl sub_806A068 - ldr r0, =0x0202499c - mov r9, r0 - ldrb r0, [r6] - movs r1, 0x2 - bl sub_80A5C6C - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldrb r0, [r6] - bl sub_80A6138 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldrb r0, [r6] - bl sub_80A82E4 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - mov r0, r9 - adds r1, r5, 0 - adds r2, r4, 0 - bl AddObjectToFront - ldr r4, =0x020241e4 - ldrb r1, [r6] - adds r1, r4 - strb r0, [r1] - ldr r5, =0x02020630 - ldrb r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =0x0000ff10 - strh r1, [r0, 0x24] - ldrb r2, [r6] - adds r0, r2, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x2E] - ldrb r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - mov r1, r8 - strh r1, [r0, 0x32] - ldrb r3, [r6] - adds r0, r3, r4 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - lsls r3, 4 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x5] - ldrb r2, [r6] - adds r4, r2, r4 - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =0x020244e4 - adds r2, r1 - ldrb r1, [r2] - bl StartObjectImageAnim - ldrb r4, [r6] - lsls r0, r4, 1 - ldr r2, =0x0202406e - adds r0, r2 - ldrh r0, [r0] - muls r0, r7 - add r0, r10 - movs r1, 0xB - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_805EE54 - ldr r1, =0x03005d60 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805F994 - str r1, [r0] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8061224 - - thumb_func_start sub_806137C -sub_806137C: @ 806137C - push {r4,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - ldr r1, =0x0202449c - ldr r1, [r1] - adds r0, r1 - adds r0, 0x5C - movs r1, 0x6 - strb r1, [r0] - ldr r1, =0x0202406e - ldrb r0, [r4] - lsls r2, r0, 1 - adds r2, r1 - ldr r3, =0x02023064 - lsls r0, 9 - adds r1, r3, 0x1 - adds r0, r1 - ldrb r0, [r0] - strh r0, [r2] - ldrb r0, [r4] - lsls r1, r0, 9 - adds r3, 0x2 - adds r1, r3 - ldrb r1, [r1] - bl sub_80613DC - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805FDF0 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806137C - - thumb_func_start sub_80613DC -sub_80613DC: @ 80613DC - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - lsls r1, 24 - lsrs r1, 24 - adds r0, r6, 0 - bl sub_805EF84 - ldr r0, =0x0202406e - lsls r4, r6, 1 - adds r4, r0 - ldr r0, =0x02023064 - lsls r1, r6, 9 - adds r0, 0x1 - adds r1, r0 - ldrb r0, [r1] - strh r0, [r4] - ldrh r0, [r4] - movs r1, 0x64 - mov r9, r1 - mov r1, r9 - muls r1, r0 - adds r0, r1, 0 - ldr r5, =0x02024744 - adds r0, r5 - movs r1, 0xB - bl pokemon_getattr - mov r8, r0 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldr r0, =sub_805D714 - bl object_new_hidden_with_callback - ldr r1, =0x03005d7c - mov r10, r1 - add r10, r6 - mov r1, r10 - strb r0, [r1] - ldrh r0, [r4] - mov r1, r9 - muls r1, r0 - adds r0, r1, 0 - adds r0, r5 - adds r1, r6, 0 - bl sub_805DC0C - adds r0, r6, 0 - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, r8 - bl sub_806A068 - ldr r0, =0x0202499c - mov r9, r0 - adds r0, r6, 0 - movs r1, 0x2 - bl sub_80A5C6C - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - adds r0, r6, 0 - bl sub_80A6138 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r6, 0 - bl sub_80A82E4 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - mov r0, r9 - adds r1, r5, 0 - adds r2, r4, 0 - bl AddObjectToFront - ldr r4, =0x020241e4 - adds r4, r6, r4 - strb r0, [r4] - ldr r5, =0x02020630 - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r6, [r0, 0x2E] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - mov r1, r8 - strh r1, [r0, 0x32] - mov r0, r10 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r1, [r4] - strh r1, [r0, 0x30] - mov r0, r10 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r6, [r0, 0x32] - ldrb r0, [r4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - lsls r3, r6, 4 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x5] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =0x020244e4 - adds r6, r1 - ldrb r1, [r6] - bl StartObjectImageAnim - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r5, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =DummyObjectCallback - str r1, [r0] - movs r0, 0 - movs r1, 0xFE - bl sub_80753E8 - mov r1, r10 - ldrb r2, [r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r5 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1, 0x2E] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80613DC - - thumb_func_start sub_806156C -sub_806156C: @ 806156C - push {r4-r6,lr} - ldr r1, =0x02023064 - ldr r6, =0x02024064 - ldrb r2, [r6] - lsls r0, r2, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r3, [r0] - cmp r3, 0 - bne _080615B4 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - strb r3, [r0, 0x4] - ldr r1, =0x03005d60 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8061604 - str r1, [r0] - b _080615F0 - .pool -_080615B4: - ldr r5, =0x020241e4 - adds r0, r2, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl obj_free_rotscale_entry - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldrb r0, [r6] - bl sub_805EEE0 - ldr r1, =0x03005d70 - ldrb r0, [r6] - adds r0, r1 - ldrb r0, [r0] - bl sub_8072984 - bl dp01_tbl7_exec_completed -_080615F0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806156C - - thumb_func_start sub_8061604 -sub_8061604: @ 8061604 - push {r4-r6,lr} - ldr r6, =0x020244d0 - ldr r4, [r6] - ldr r5, =0x02024064 - ldrb r2, [r5] - ldr r1, [r4, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r3, r0, r1 - ldrb r0, [r3, 0x4] - cmp r0, 0 - beq _0806162C - cmp r0, 0x1 - beq _0806165A - b _08061682 - .pool -_0806162C: - ldr r1, [r4] - lsls r0, r2, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08061646 - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x5 - bl move_anim_start_t4 -_08061646: - ldr r0, [r6] - ldrb r1, [r5] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x1 - strb r1, [r0, 0x4] - b _08061682 -_0806165A: - ldrb r1, [r3] - movs r0, 0x40 - ands r0, r1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08061682 - strb r0, [r3, 0x4] - ldrb r2, [r5] - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x2 - bl move_anim_start_t4 - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805FB08 - str r1, [r0] -_08061682: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8061604 - - thumb_func_start sub_8061690 -sub_8061690: @ 8061690 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r0, =0x02022fec - ldr r2, [r0] - movs r0, 0x80 - lsls r0, 20 - ands r0, r2 - cmp r0, 0 - beq _080616B0 - bl sub_806B830 - b _0806175A - .pool -_080616B0: - ldr r3, =0x02038bca - ldrh r1, [r3] - ldr r0, =0x000003fe - cmp r1, r0 - bne _080616C8 - bl sub_81A4CB0 - b _0806175A - .pool -_080616C8: - movs r0, 0x80 - lsls r0, 19 - ands r0, r2 - cmp r0, 0 - beq _08061708 - movs r0, 0x80 - lsls r0, 8 - ands r2, r0 - cmp r2, 0 - beq _08061700 - ldr r0, =0x02024064 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080616F0 - ldrh r0, [r3] - bl sub_81D5588 - b _0806175A - .pool -_080616F0: - ldr r0, =0x02038bcc - ldrh r0, [r0] - bl sub_81D5588 - b _0806175A - .pool -_08061700: - ldrh r0, [r3] - bl sub_81D5588 - b _0806175A -_08061708: - ldr r0, =0x003f0100 - ands r0, r2 - cmp r0, 0 - beq _0806174C - ldr r0, =0x00808000 - ands r2, r0 - cmp r2, 0 - beq _08061744 - ldr r0, =0x02024064 - ldrb r0, [r0] - cmp r0, 0x1 - bne _08061734 - ldrh r0, [r3] - bl sub_8162AA0 - b _0806175A - .pool -_08061734: - ldr r0, =0x02038bcc - ldrh r0, [r0] - bl sub_8162AA0 - b _0806175A - .pool -_08061744: - ldrh r0, [r3] - bl sub_8162AA0 - b _0806175A -_0806174C: - movs r0, 0x80 - lsls r0, 4 - ands r0, r2 - cmp r0, 0 - beq _08061760 - bl sub_8165244 -_0806175A: - lsls r0, 24 - lsrs r4, r0, 24 - b _08061796 -_08061760: - movs r0, 0x80 - lsls r0, 8 - ands r2, r0 - cmp r2, 0 - beq _08061788 - ldr r0, =0x02024064 - ldrb r0, [r0] - cmp r0, 0x1 - beq _08061788 - ldr r2, =gTrainers - ldr r0, =0x02038bcc - ldrh r1, [r0] - b _0806178C - .pool -_08061788: - ldr r2, =gTrainers - ldrh r1, [r3] -_0806178C: - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r4, [r0, 0x3] -_08061796: - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x00008040 - ands r0, r1 - cmp r0, 0 - beq _080617C8 - ldr r0, =0x02024064 - ldrb r0, [r0] - bl battle_get_per_side_status - movs r1, 0x2 - ands r1, r0 - movs r7, 0xC8 - cmp r1, 0 - beq _080617CA - movs r7, 0x98 - b _080617CA - .pool -_080617C8: - movs r7, 0xB0 -_080617CA: - mov r8, r4 - ldr r5, =0x02024064 - ldrb r1, [r5] - mov r0, r8 - bl sub_805DF38 - ldrb r0, [r5] - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, r8 - bl template_build_for_pokemon_or_trainer - ldr r6, =0x0202499c - mov r9, r7 - ldr r1, =gUnknown_083054E0 - mov r2, r8 - lsls r0, r2, 2 - adds r0, r1 - ldrb r0, [r0] - movs r4, 0x8 - subs r4, r0 - lsls r4, 18 - movs r0, 0xA0 - lsls r0, 14 - adds r4, r0 - asrs r4, 16 - ldrb r0, [r5] - bl sub_80A82E4 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r6, 0 - mov r1, r9 - adds r2, r4, 0 - bl AddObjectToFront - ldr r6, =0x020241e4 - ldrb r1, [r5] - adds r1, r6 - strb r0, [r1] - ldr r4, =0x02020630 - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =0x0000ff10 - strh r1, [r0, 0x24] - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x2 - strh r1, [r0, 0x2E] - ldr r1, =gTrainerFrontPicPaletteTable - mov r2, r8 - lsls r0, r2, 3 - adds r0, r1 - ldrh r0, [r0, 0x4] - bl IndexOfObjectPaletteTag - ldrb r1, [r5] - adds r1, r6 - ldrb r1, [r1] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - adds r2, r4 - lsls r0, 4 - ldrb r3, [r2, 0x5] - movs r1, 0xF - ands r1, r3 - orrs r1, r0 - strb r1, [r2, 0x5] - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - mov r1, r8 - strh r1, [r0, 0x6] - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, 0x1C - adds r0, r4 - ldr r1, =sub_805D7AC - str r1, [r0] - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805F1D0 - str r1, [r0] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8061690 - - thumb_func_start sub_80618D8 -sub_80618D8: @ 80618D8 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r0, =0x02022fec - ldr r2, [r0] - movs r0, 0x80 - lsls r0, 20 - ands r0, r2 - cmp r0, 0 - beq _080618F8 - bl sub_806B830 - b _080619A2 - .pool -_080618F8: - ldr r3, =0x02038bca - ldrh r1, [r3] - ldr r0, =0x000003fe - cmp r1, r0 - bne _08061910 - bl sub_81A4CB0 - b _080619A2 - .pool -_08061910: - movs r0, 0x80 - lsls r0, 19 - ands r0, r2 - cmp r0, 0 - beq _08061950 - movs r0, 0x80 - lsls r0, 8 - ands r2, r0 - cmp r2, 0 - beq _08061948 - ldr r0, =0x02024064 - ldrb r0, [r0] - cmp r0, 0x1 - bne _08061938 - ldrh r0, [r3] - bl sub_81D5588 - b _080619A2 - .pool -_08061938: - ldr r0, =0x02038bcc - ldrh r0, [r0] - bl sub_81D5588 - b _080619A2 - .pool -_08061948: - ldrh r0, [r3] - bl sub_81D5588 - b _080619A2 -_08061950: - ldr r0, =0x003f0100 - ands r0, r2 - cmp r0, 0 - beq _08061994 - ldr r0, =0x00808000 - ands r2, r0 - cmp r2, 0 - beq _0806198C - ldr r0, =0x02024064 - ldrb r0, [r0] - cmp r0, 0x1 - bne _0806197C - ldrh r0, [r3] - bl sub_8162AA0 - b _080619A2 - .pool -_0806197C: - ldr r0, =0x02038bcc - ldrh r0, [r0] - bl sub_8162AA0 - b _080619A2 - .pool -_0806198C: - ldrh r0, [r3] - bl sub_8162AA0 - b _080619A2 -_08061994: - movs r0, 0x80 - lsls r0, 4 - ands r0, r2 - cmp r0, 0 - beq _080619A8 - bl sub_8165244 -_080619A2: - lsls r0, 24 - lsrs r0, 24 - b _080619DE -_080619A8: - movs r0, 0x80 - lsls r0, 8 - ands r2, r0 - cmp r2, 0 - beq _080619D0 - ldr r0, =0x02024064 - ldrb r0, [r0] - cmp r0, 0x1 - beq _080619D0 - ldr r2, =gTrainers - ldr r0, =0x02038bcc - ldrh r1, [r0] - b _080619D4 - .pool -_080619D0: - ldr r2, =gTrainers - ldrh r1, [r3] -_080619D4: - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x3] -_080619DE: - mov r8, r0 - ldr r6, =0x02024064 - ldrb r1, [r6] - bl sub_805DF38 - ldrb r0, [r6] - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, r8 - bl template_build_for_pokemon_or_trainer - ldr r0, =0x0202499c - ldr r2, =gUnknown_083054E0 - mov r3, r8 - lsls r1, r3, 2 - adds r1, r2 - ldrb r1, [r1] - movs r2, 0x8 - subs r2, r1 - lsls r2, 18 - movs r1, 0xA0 - lsls r1, 14 - adds r2, r1 - asrs r2, 16 - movs r1, 0xB0 - movs r3, 0x1E - bl AddObjectToFront - ldr r5, =0x020241e4 - ldrb r1, [r6] - adds r1, r5 - strb r0, [r1] - ldr r4, =0x02020630 - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x60 - strh r1, [r0, 0x24] - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x20] - adds r1, 0x20 - strh r1, [r0, 0x20] - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =0x0000fffe - strh r1, [r0, 0x2E] - ldr r1, =gTrainerFrontPicPaletteTable - mov r2, r8 - lsls r0, r2, 3 - adds r0, r1 - ldrh r0, [r0, 0x4] - bl IndexOfObjectPaletteTag - ldrb r1, [r6] - adds r1, r5 - ldrb r1, [r1] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - adds r2, r4 - lsls r0, 4 - ldrb r3, [r2, 0x5] - movs r1, 0xF - ands r1, r3 - orrs r1, r0 - strb r1, [r2, 0x5] - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - mov r3, r8 - strh r3, [r0, 0x6] - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, 0x1C - adds r0, r4 - ldr r1, =sub_805D7AC - str r1, [r0] - ldr r1, =0x03005d60 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805F208 - str r1, [r0] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80618D8 - - thumb_func_start sub_8061AF0 -sub_8061AF0: @ 8061AF0 - push {r4-r6,lr} - ldr r6, =0x020241e4 - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =0x02020630 - adds r0, r5 - bl oamt_add_pos2_onto_pos1 - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x23 - strh r1, [r0, 0x2E] - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x8C - lsls r1, 1 - strh r1, [r0, 0x32] - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrh r1, [r0, 0x22] - strh r1, [r0, 0x36] - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r5, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_80A6EEC - str r1, [r0] - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =DummyObjectCallback - bl oamt_set_x3A_32 - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805F240 - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8061AF0 - - thumb_func_start sub_8061B9C -sub_8061B9C: @ 8061B9C - push {r4-r6,lr} - ldr r6, =0x020244d0 - ldr r4, [r6] - ldr r5, =0x02024064 - ldrb r2, [r5] - ldr r0, [r4, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r3, r1, r0 - ldrb r0, [r3, 0x4] - cmp r0, 0 - bne _08061BF0 - ldr r1, [r4] - lsls r0, r2, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08061BD0 - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x5 - bl move_anim_start_t4 -_08061BD0: - ldr r0, [r6] - ldrb r1, [r5] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x4] - adds r1, 0x1 - strb r1, [r0, 0x4] - b _08061C2C - .pool -_08061BF0: - ldrb r1, [r3] - movs r0, 0x40 - ands r0, r1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08061C2C - strb r0, [r3, 0x4] - movs r0, 0x10 - movs r1, 0x3F - bl audio_play_and_stuff - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldrb r0, [r5] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_8039934 - str r1, [r0] - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805FAC4 - str r1, [r0] -_08061C2C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8061B9C - - thumb_func_start sub_8061C48 -sub_8061C48: @ 8061C48 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8061C48 - - thumb_func_start sub_8061C54 -sub_8061C54: @ 8061C54 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8061C54 - - thumb_func_start sub_8061C60 -sub_8061C60: @ 8061C60 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8061C60 - - thumb_func_start sub_8061C6C -sub_8061C6C: @ 8061C6C - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8061C6C - - thumb_func_start sub_8061C78 -sub_8061C78: @ 8061C78 - push {r4-r6,lr} - ldr r6, =0x02024064 - ldrb r0, [r6] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - beq _08061C8A - b _08061D9E -_08061C8A: - ldr r0, =0x02023064 - mov r12, r0 - ldrb r2, [r6] - lsls r2, 9 - adds r0, 0x1 - adds r0, r2, r0 - ldrb r0, [r0] - mov r1, r12 - adds r1, 0x2 - adds r1, r2, r1 - ldrb r1, [r1] - lsls r1, 8 - orrs r0, r1 - ldr r5, =0x02038432 - mov r1, r12 - adds r1, 0x3 - adds r2, r1 - ldrb r1, [r2] - strb r1, [r5] - ldr r4, =0x02038408 - ldrb r2, [r6] - lsls r2, 9 - mov r1, r12 - adds r1, 0x4 - adds r1, r2, r1 - ldrb r3, [r1] - mov r1, r12 - adds r1, 0x5 - adds r2, r1 - ldrb r1, [r2] - lsls r1, 8 - orrs r3, r1 - strh r3, [r4] - ldr r4, =0x02038404 - ldrb r2, [r6] - lsls r2, 9 - mov r1, r12 - adds r1, 0x6 - adds r1, r2, r1 - ldrb r3, [r1] - mov r1, r12 - adds r1, 0x7 - adds r1, r2, r1 - ldrb r1, [r1] - lsls r1, 8 - orrs r3, r1 - mov r1, r12 - adds r1, 0x8 - adds r1, r2, r1 - ldrb r1, [r1] - lsls r1, 16 - orrs r3, r1 - mov r1, r12 - adds r1, 0x9 - adds r2, r1 - ldrb r1, [r2] - lsls r1, 24 - orrs r3, r1 - str r3, [r4] - ldr r3, =0x0203841a - ldrb r1, [r6] - lsls r1, 9 - mov r2, r12 - adds r2, 0xA - adds r1, r2 - ldrb r1, [r1] - strb r1, [r3] - ldr r4, =0x0203841c - ldrb r2, [r6] - lsls r2, 9 - mov r1, r12 - adds r1, 0xC - adds r1, r2, r1 - ldrb r3, [r1] - mov r1, r12 - adds r1, 0xD - adds r2, r1 - ldrb r1, [r2] - lsls r1, 8 - orrs r3, r1 - strh r3, [r4] - ldr r3, =0x02038400 - ldrb r2, [r6] - lsls r2, 9 - mov r1, r12 - adds r1, 0x10 - adds r2, r1 - str r2, [r3] - ldr r3, =0x020244bc - ldrb r1, [r6] - lsls r1, 2 - adds r1, r3 - ldr r2, [r2] - str r2, [r1] - ldrb r1, [r5] - bl sub_805DB8C - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - beq _08061D80 - bl dp01_tbl7_exec_completed - b _08061D9E - .pool -_08061D80: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldrb r1, [r6] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strb r3, [r0, 0x4] - ldr r1, =0x03005d60 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_move_anim_7 - str r1, [r0] -_08061D9E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8061C78 - - thumb_func_start bx_move_anim_7 -bx_move_anim_7: @ 8061DB0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r2, =0x02023064 - ldr r6, =0x02024064 - ldrb r3, [r6] - lsls r1, r3, 9 - adds r0, r2, 0x1 - mov r10, r0 - adds r0, r1, r0 - ldrb r4, [r0] - adds r5, r2, 0x2 - mov r9, r5 - adds r0, r1, r5 - ldrb r0, [r0] - lsls r0, 8 - orrs r4, r0 - adds r2, 0xB - adds r1, r2 - ldrb r1, [r1] - mov r8, r1 - ldr r7, =0x020244d0 - ldr r5, [r7] - ldr r1, [r5, 0x4] - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r2, [r0, 0x4] - cmp r2, 0x1 - beq _08061E48 - cmp r2, 0x1 - bgt _08061E08 - cmp r2, 0 - beq _08061E12 - b _08061F24 - .pool -_08061E08: - cmp r2, 0x2 - beq _08061E72 - cmp r2, 0x3 - beq _08061EE8 - b _08061F24 -_08061E12: - ldr r1, [r5] - lsls r0, r3, 2 - adds r1, r0, r1 - ldrb r2, [r1] - movs r0, 0xC - ands r0, r2 - cmp r0, 0x4 - bne _08061E34 - movs r0, 0x8 - orrs r0, r2 - strb r0, [r1] - ldrb r2, [r6] - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x5 - bl move_anim_start_t4 -_08061E34: - ldr r0, [r7] - ldrb r1, [r6] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x1 - strb r1, [r0, 0x4] - b _08061F24 -_08061E48: - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _08061F24 - movs r0, 0 - bl sub_805EB9C - adds r0, r4, 0 - bl move_anim_start_t1 - ldr r0, [r7] - ldrb r1, [r6] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x2 - strb r1, [r0, 0x4] - b _08061F24 -_08061E72: - ldr r0, =0x020383f8 - ldr r0, [r0] - bl _call_via_r0 - ldr r0, =0x020383fd - ldrb r0, [r0] - cmp r0, 0 - bne _08061F24 - movs r0, 0x1 - bl sub_805EB9C - ldr r0, [r7] - ldrb r2, [r6] - ldr r1, [r0] - lsls r0, r2, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08061EC0 - mov r0, r8 - cmp r0, 0x1 - bhi _08061EC0 - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x6 - bl move_anim_start_t4 - ldr r0, [r7] - ldrb r1, [r6] - ldr r0, [r0] - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - strb r0, [r1] -_08061EC0: - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x3 - strb r1, [r0, 0x4] - b _08061F24 - .pool -_08061EE8: - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _08061F24 - bl sub_805E394 - ldrb r0, [r6] - lsls r2, r0, 9 - mov r3, r10 - adds r1, r2, r3 - ldrb r1, [r1] - add r2, r9 - ldrb r2, [r2] - lsls r2, 8 - orrs r1, r2 - bl sub_805E94C - ldr r0, [r7] - ldrb r1, [r6] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strb r4, [r0, 0x4] - bl dp01_tbl7_exec_completed -_08061F24: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end bx_move_anim_7 - - thumb_func_start sub_8061F34 -sub_8061F34: @ 8061F34 - push {r4,r5,lr} - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r5, =0x02024064 - ldrb r4, [r5] - lsls r4, 9 - ldr r0, =0x02023066 - adds r4, r0 - ldrh r0, [r4] - bl battle_pick_message - ldr r0, =0x02022e2c - movs r1, 0 - bl battle_show_message_maybe - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_t7_button_a - str r1, [r0] - ldrb r0, [r5] - ldrh r1, [r4] - bl sub_81A57E4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8061F34 - - thumb_func_start sub_8061F90 -sub_8061F90: @ 8061F90 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8061F90 - - thumb_func_start sub_8061F9C -sub_8061F9C: @ 8061F9C - push {lr} - bl sub_8063880 - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8061F9C - - thumb_func_start sub_8061FAC -sub_8061FAC: @ 8061FAC - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8061FAC - - thumb_func_start sub_8061FB8 -sub_8061FB8: @ 8061FB8 - push {r4-r6,lr} - ldr r0, =0x02022fec - ldr r2, [r0] - movs r0, 0x80 - lsls r0, 10 - ands r0, r2 - cmp r0, 0 - beq _08061FE4 - bl sub_805D19C - adds r2, r0, 0 - lsls r2, 16 - lsrs r2, 16 - movs r0, 0x1 - movs r1, 0xA -_08061FD6: - bl dp01_build_cmdbuf_x21_a_bb -_08061FDA: - bl dp01_tbl7_exec_completed - b _08062156 - .pool -_08061FE4: - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 9 - ldr r1, =0x02023068 - adds r5, r0, r1 - movs r0, 0x93 - lsls r0, 3 - ands r2, r0 - cmp r2, 0 - beq _080620C4 - movs r0, 0xF - bl sub_8130950 - bl sub_8130BA4 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - beq _08062022 - cmp r4, 0x5 - bgt _0806201C - cmp r4, 0x4 - beq _08062028 - b _08062040 - .pool -_0806201C: - cmp r4, 0x6 - beq _08062030 - b _08062040 -_08062022: - movs r0, 0x1 - movs r1, 0x4 - b _0806202C -_08062028: - movs r0, 0x1 - movs r1, 0x3 -_0806202C: - movs r2, 0 - b _08061FD6 -_08062030: - ldr r0, =0x0202420c - ldrb r2, [r0] - movs r0, 0x1 - movs r1, 0xF - b _08061FD6 - .pool -_08062040: - ldr r3, =gBattleMoves - lsls r0, r4, 1 - adds r2, r5, r0 - ldrh r1, [r2] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r1, [r0, 0x6] - movs r0, 0x12 - ands r0, r1 - cmp r0, 0 - beq _08062062 - ldr r0, =0x0202420c - ldr r1, =0x02024064 - ldrb r1, [r1] - strb r1, [r0] -_08062062: - ldrh r1, [r2] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r1, [r0, 0x6] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0806209C - movs r0, 0 - bl battle_get_side_with_given_state - ldr r5, =0x0202420c - strb r0, [r5] - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _0806209C - movs r0, 0x2 - bl battle_get_side_with_given_state - strb r0, [r5] -_0806209C: - ldr r0, =0x0202420c - ldrb r0, [r0] - lsls r0, 8 - orrs r4, r0 - movs r0, 0x1 - movs r1, 0xA - adds r2, r4, 0 - bl dp01_build_cmdbuf_x21_a_bb - b _08061FDA - .pool -_080620C4: - movs r6, 0x3 -_080620C6: - bl GenerateRandomNumber - adds r4, r0, 0 - ands r4, r6 - lsls r0, r4, 1 - adds r0, r5, r0 - ldrh r2, [r0] - cmp r2, 0 - beq _080620C6 - ldr r1, =gBattleMoves - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x6] - movs r0, 0x12 - ands r0, r1 - cmp r0, 0 - beq _08062108 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 8 - orrs r4, r0 - movs r0, 0x1 - movs r1, 0xA - adds r2, r4, 0 - bl dp01_build_cmdbuf_x21_a_bb - b _08062152 - .pool -_08062108: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0806213C - bl GenerateRandomNumber - movs r1, 0x2 - ands r1, r0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r1, 0 - bl battle_get_side_with_given_state - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 16 - orrs r2, r4 - movs r0, 0x1 - movs r1, 0xA - bl dp01_build_cmdbuf_x21_a_bb - b _08062152 - .pool -_0806213C: - movs r0, 0 - bl battle_get_side_with_given_state - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 16 - orrs r2, r4 - movs r0, 0x1 - movs r1, 0xA - bl dp01_build_cmdbuf_x21_a_bb -_08062152: - bl dp01_tbl7_exec_completed -_08062156: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8061FB8 - - thumb_func_start sub_806215C -sub_806215C: @ 806215C - push {lr} - ldr r0, =0x02024064 - ldrb r0, [r0] - lsrs r0, 1 - ldr r1, =0x0202449c - ldr r1, [r1] - lsls r0, 1 - adds r0, r1 - adds r0, 0xC0 - ldrb r1, [r0] - movs r0, 0x1 - bl dp01_build_cmdbuf_x23_aa_0 - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_806215C - - thumb_func_start sub_8062188 -sub_8062188: @ 8062188 - push {r4-r7,lr} - ldr r0, =0x02024064 - ldrb r0, [r0] - ldr r1, =0x0202449c - ldr r1, [r1] - adds r0, r1 - movs r2, 0xA5 - lsls r2, 2 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0x6 - bne _08062254 - bl sub_8063A90 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x6 - bne _0806225A - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080621D4 - movs r0, 0x1 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r5, r0, 24 - adds r7, r5, 0 - b _080621E8 - .pool -_080621D4: - movs r0, 0x1 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r7, r0, 24 - movs r0, 0x3 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r5, r0, 24 -_080621E8: - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x00808000 - ands r0, r1 - cmp r0, 0 - beq _08062214 - ldr r0, =0x02024064 - ldrb r0, [r0] - cmp r0, 0x1 - bne _08062210 - movs r0, 0 - movs r6, 0x3 - b _08062218 - .pool -_08062210: - movs r0, 0x3 - b _08062216 -_08062214: - movs r0, 0 -_08062216: - movs r6, 0x6 -_08062218: - adds r4, r0, 0 - b _0806221E -_0806221C: - adds r4, 0x1 -_0806221E: - cmp r4, r6 - bge _0806225A - movs r0, 0x64 - muls r0, r4 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _0806221C - ldr r1, =0x0202406e - lsls r0, r7, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r4, r0 - beq _0806221C - lsls r0, r5, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r4, r0 - beq _0806221C - b _0806225A - .pool -_08062254: - ldrb r4, [r1] - movs r0, 0x6 - strb r0, [r1] -_0806225A: - ldr r0, =0x02024064 - ldrb r0, [r0] - ldr r1, =0x0202449c - ldr r1, [r1] - adds r0, r1 - adds r0, 0x5C - strb r4, [r0] - lsls r1, r4, 24 - lsrs r1, 24 - movs r0, 0x1 - movs r2, 0 - bl dp01_build_cmdbuf_x22_a_three_bytes - bl dp01_tbl7_exec_completed - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8062188 - - thumb_func_start sub_8062288 -sub_8062288: @ 8062288 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8062288 - - thumb_func_start sub_8062294 -sub_8062294: @ 8062294 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - movs r0, 0 - bl load_gfxc_health_bar - ldr r3, =0x02023064 - ldr r0, =0x02024064 - mov r9, r0 - ldrb r4, [r0] - lsls r2, r4, 9 - adds r0, r3, 0x3 - adds r0, r2, r0 - ldrb r1, [r0] - lsls r1, 8 - adds r3, 0x2 - adds r2, r3 - ldrb r0, [r2] - orrs r0, r1 - lsls r0, 16 - asrs r7, r0, 16 - ldr r0, =0x00007fff - cmp r7, r0 - beq _08062324 - ldr r6, =0x0202406e - lsls r0, r4, 1 - adds r0, r6 - ldrh r0, [r0] - movs r5, 0x64 - muls r0, r5 - ldr r4, =0x02024744 - adds r0, r4 - movs r1, 0x3A - bl pokemon_getattr - mov r8, r0 - mov r1, r9 - ldrb r0, [r1] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - muls r0, r5 - adds r0, r4 - movs r1, 0x39 - bl pokemon_getattr - adds r3, r0, 0 - mov r1, r9 - ldrb r0, [r1] - ldr r1, =0x03005d70 - adds r1, r0, r1 - ldrb r1, [r1] - str r7, [sp] - mov r2, r8 - bl sub_807294C - b _0806234E - .pool -_08062324: - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3A - bl pokemon_getattr - adds r2, r0, 0 - mov r1, r9 - ldrb r0, [r1] - ldr r1, =0x03005d70 - adds r1, r0, r1 - ldrb r1, [r1] - str r7, [sp] - movs r3, 0 - bl sub_807294C -_0806234E: - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805FA70 - str r1, [r0] - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8062294 - - thumb_func_start sub_8062384 -sub_8062384: @ 8062384 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8062384 - - thumb_func_start sub_8062390 -sub_8062390: @ 8062390 - push {r4,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _080623E4 - ldr r0, =0x03005d70 - ldrb r1, [r4] - adds r0, r1, r0 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x02024744 - adds r1, r2 - movs r2, 0x9 - bl healthbar_draw_field_maybe - ldrb r2, [r4] - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x11 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805FEB8 - str r1, [r0] -_080623E4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8062390 - - thumb_func_start sub_8062408 -sub_8062408: @ 8062408 - push {r4,r5,lr} - ldr r5, =0x02024064 - ldrb r0, [r5] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _08062458 - ldr r4, =0x02023064 - ldrb r3, [r5] - lsls r3, 9 - adds r0, r4, 0x1 - adds r0, r3, r0 - ldrb r0, [r0] - adds r1, r4, 0x2 - adds r1, r3, r1 - ldrb r1, [r1] - adds r2, r4, 0x3 - adds r2, r3, r2 - ldrb r2, [r2] - lsls r2, 8 - orrs r1, r2 - adds r2, r4, 0x4 - adds r2, r3, r2 - ldrb r2, [r2] - lsls r2, 16 - orrs r1, r2 - adds r4, 0x5 - adds r3, r4 - ldrb r2, [r3] - lsls r2, 24 - orrs r1, r2 - bl move_anim_start_t2_for_situation - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805FEB8 - str r1, [r0] -_08062458: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8062408 - - thumb_func_start sub_8062470 -sub_8062470: @ 8062470 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8062470 - - thumb_func_start sub_806247C -sub_806247C: @ 806247C - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_806247C - - thumb_func_start sub_8062488 -sub_8062488: @ 8062488 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8062488 - - thumb_func_start sub_8062494 -sub_8062494: @ 8062494 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8062494 - - thumb_func_start sub_80624A0 -sub_80624A0: @ 80624A0 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_80624A0 - - thumb_func_start sub_80624AC -sub_80624AC: @ 80624AC - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_80624AC - - thumb_func_start sub_80624B8 -sub_80624B8: @ 80624B8 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_80624B8 - - thumb_func_start sub_80624C4 -sub_80624C4: @ 80624C4 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_80624C4 - - thumb_func_start sub_80624D0 -sub_80624D0: @ 80624D0 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_80624D0 - - thumb_func_start sub_80624DC -sub_80624DC: @ 80624DC - push {lr} - ldr r2, =0x02022d0c - ldrb r1, [r2] - movs r0, 0x80 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_80624DC - - thumb_func_start sub_80624F8 -sub_80624F8: @ 80624F8 - push {lr} - ldr r3, =0x02022d0c - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - movs r1, 0x7F - ands r1, r0 - ldrb r2, [r3] - movs r0, 0x80 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_80624F8 - - thumb_func_start sub_8062530 -sub_8062530: @ 8062530 - push {lr} - ldr r2, =0x02022d0c - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_8062530 - - thumb_func_start sub_8062548 -sub_8062548: @ 8062548 - push {lr} - ldr r3, =0x02022d0c - ldr r1, [r3] - lsls r1, 24 - lsrs r1, 31 - movs r0, 0x1 - eors r1, r0 - lsls r1, 7 - ldrb r2, [r3] - movs r0, 0x7F - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_8062548 - - thumb_func_start dp01t_29_7_blink -dp01t_29_7_blink: @ 8062570 - push {r4,lr} - ldr r3, =0x02020630 - ldr r2, =0x020241e4 - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - bge _080625A4 - bl dp01_tbl7_exec_completed - b _080625CE - .pool -_080625A4: - ldr r1, =0x020244b9 - movs r0, 0x1 - strb r0, [r1] - ldrb r0, [r4] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0 - strh r1, [r0, 0x30] - ldrb r0, [r4] - bl sub_80769F4 - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_blink_t7 - str r1, [r0] -_080625CE: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_29_7_blink - - thumb_func_start sub_80625E0 -sub_80625E0: @ 80625E0 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_80625E0 - - thumb_func_start sub_80625EC -sub_80625EC: @ 80625EC - push {r4,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - movs r3, 0x3F - cmp r0, 0 - bne _08062600 - movs r3, 0xC0 -_08062600: - ldr r2, =0x02023064 - ldrb r1, [r4] - lsls r1, 9 - adds r0, r2, 0x1 - adds r0, r1, r0 - ldrb r0, [r0] - adds r2, 0x2 - adds r1, r2 - ldrb r1, [r1] - lsls r1, 8 - orrs r0, r1 - lsls r1, r3, 24 - asrs r1, 24 - bl audio_play_and_stuff - bl dp01_tbl7_exec_completed - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80625EC - - thumb_func_start sub_8062630 -sub_8062630: @ 8062630 - push {r4,r5,lr} - ldr r4, =0x02023064 - ldr r5, =0x02024064 - ldrb r0, [r5] - lsls r3, r0, 9 - adds r0, r4, 0x3 - adds r0, r3, r0 - ldrb r0, [r0] - cmp r0, 0 - beq _0806266C - bl sub_805EA60 - ldrb r1, [r5] - lsls r1, 9 - adds r0, r4, 0x1 - adds r0, r1, r0 - ldrb r0, [r0] - adds r2, r4, 0x2 - adds r1, r2 - ldrb r1, [r1] - lsls r1, 8 - orrs r0, r1 - bl song_play_for_text - b _08062680 - .pool -_0806266C: - adds r0, r4, 0x1 - adds r0, r3, r0 - ldrb r0, [r0] - adds r1, r4, 0x2 - adds r1, r3, r1 - ldrb r1, [r1] - lsls r1, 8 - orrs r0, r1 - bl fanfare_play -_08062680: - bl dp01_tbl7_exec_completed - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8062630 - - thumb_func_start sub_806268C -sub_806268C: @ 806268C - push {lr} - ldr r1, =0x0202406e - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x19 - movs r2, 0x5 - bl sub_80A32E4 - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_806268C - - thumb_func_start dp01t_2E_7_battle_intro -dp01t_2E_7_battle_intro: @ 80626C8 - push {lr} - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - bl battle_intro_launch - ldr r2, =0x020243fc - ldrh r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strh r0, [r2] - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_2E_7_battle_intro - - thumb_func_start sub_80626FC -sub_80626FC: @ 80626FC - push {r4-r6,lr} - ldr r5, =0x020241e4 - ldr r6, =0x02024064 - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl oamt_add_pos2_onto_pos1 - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x23 - strh r1, [r0, 0x2E] - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x8C - lsls r1, 1 - strh r1, [r0, 0x32] - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x22] - strh r1, [r0, 0x36] - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_80A6EEC - str r1, [r0] - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_806280C - bl oamt_set_x3A_32 - ldr r0, =sub_8062828 - movs r1, 0x5 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r4 - ldrb r0, [r6] - strh r0, [r1, 0x8] - ldr r3, =0x020244d0 - ldr r0, [r3] - ldrb r2, [r6] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080627BE - ldr r0, =0x020244b4 - adds r0, r2, r0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - ldr r1, =sub_8073C30 - str r1, [r0] -_080627BE: - ldr r0, [r3] - ldr r2, [r0, 0x8] - ldrb r0, [r2, 0x9] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x9] - ldr r1, =0x03005d60 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =nullsub_26 - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80626FC - - thumb_func_start sub_806280C -sub_806280C: @ 806280C - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x6] - bl sub_805DFE4 - adds r0, r4, 0 - bl obj_free_rotscale_entry - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_806280C - - thumb_func_start sub_8062828 -sub_8062828: @ 8062828 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r7, =0x02024064 - ldrb r0, [r7] - mov r9, r0 - ldr r1, =0x03005e00 - mov r2, r8 - lsls r0, r2, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldrh r0, [r0, 0x8] - strb r0, [r7] - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0806286C - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0806286C - movs r0, 0x80 - lsls r0, 8 - ands r1, r0 - cmp r1, 0 - beq _080628A0 -_0806286C: - ldr r0, =0x02023064 - ldrb r1, [r7] - lsls r2, r1, 9 - adds r0, 0x1 - adds r2, r0 - ldr r0, =0x0202406e - lsls r1, 1 - adds r1, r0 - ldrh r0, [r1] - strb r0, [r2] - ldrb r0, [r7] - movs r1, 0 - bl sub_80613DC - b _080628E0 - .pool -_080628A0: - ldr r4, =0x02023064 - ldrb r0, [r7] - lsls r1, r0, 9 - adds r4, 0x1 - adds r1, r4 - ldr r6, =0x0202406e - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - strb r0, [r1] - ldrb r0, [r7] - movs r1, 0 - bl sub_80613DC - ldrb r0, [r7] - movs r5, 0x2 - eors r0, r5 - strb r0, [r7] - ldrb r0, [r7] - lsls r1, r0, 9 - adds r1, r4 - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - strb r0, [r1] - ldrb r0, [r7] - movs r1, 0 - bl sub_80613DC - ldrb r0, [r7] - eors r0, r5 - strb r0, [r7] -_080628E0: - ldr r1, =0x03005d60 - ldr r2, =0x02024064 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805F560 - str r1, [r0] - mov r0, r9 - strb r0, [r2] - mov r0, r8 - bl remove_task - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8062828 - - thumb_func_start dp01t_30_7_0803D67C -dp01t_30_7_0803D67C: @ 8062918 - push {r4-r7,lr} - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _08062948 - adds r0, r2, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08062948 - bl dp01_tbl7_exec_completed - b _08062A12 - .pool -_08062948: - ldr r4, =0x020244d0 - ldr r0, [r4] - ldr r3, =0x02024064 - ldrb r1, [r3] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] - ldr r1, =0x02023064 - ldrb r2, [r3] - lsls r0, r2, 9 - adds r1, 0x2 - adds r0, r1 - ldrb r0, [r0] - adds r7, r3, 0 - cmp r0, 0 - beq _080629B4 - ldr r0, [r4] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r3, r0, r1 - ldrb r2, [r3, 0x1] - lsls r1, r2, 27 - lsrs r0, r1, 28 - cmp r0, 0x1 - bhi _080629AC - adds r0, 0x1 - movs r1, 0xF - ands r0, r1 - lsls r0, 1 - movs r1, 0x1F - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x1] - b _08062A12 - .pool -_080629AC: - movs r0, 0x1F - negs r0, r0 - ands r0, r2 - strb r0, [r3, 0x1] -_080629B4: - adds r5, r7, 0 - ldrb r0, [r5] - lsls r3, r0, 9 - ldr r4, =0x02023068 - adds r1, r3, r4 - subs r2, r4, 0x3 - adds r2, r3, r2 - ldrb r2, [r2] - subs r4, 0x2 - adds r3, r4 - ldrb r3, [r3] - bl sub_80735DC - ldr r2, =0x020244b4 - ldrb r1, [r5] - adds r1, r2 - movs r3, 0 - strb r0, [r1] - ldr r6, =0x020244d0 - ldr r0, [r6] - ldrb r1, [r5] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strb r3, [r0, 0x5] - ldrb r2, [r5] - lsls r0, r2, 9 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - beq _08062A06 - ldr r0, [r6] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - movs r1, 0x5D - strb r1, [r0, 0x5] -_08062A06: - ldr r0, =0x03005d60 - ldrb r1, [r7] - lsls r1, 2 - adds r1, r0 - ldr r0, =bx_0803D790_t7 - str r0, [r1] -_08062A12: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_30_7_0803D67C - - thumb_func_start bx_0803D790_t7 -bx_0803D790_t7: @ 8062A2C - push {r4,lr} - ldr r4, =0x020244d0 - ldr r0, [r4] - ldr r3, =0x02024064 - ldrb r1, [r3] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x5] - adds r2, r1, 0x1 - strb r2, [r0, 0x5] - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x5C - bls _08062A64 - ldr r0, [r4] - ldrb r1, [r3] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strb r1, [r0, 0x5] - bl dp01_tbl7_exec_completed -_08062A64: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end bx_0803D790_t7 - - thumb_func_start sub_8062A74 -sub_8062A74: @ 8062A74 - push {lr} - ldr r0, =0x020244d0 - ldr r1, [r0] - ldr r0, =0x02024064 - ldrb r3, [r0] - ldr r1, [r1, 0x4] - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08062AA6 - ldr r2, =0x03005e00 - ldr r0, =0x020244b4 - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldr r1, =sub_8073C30 - str r1, [r0] -_08062AA6: - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_8062A74 - - thumb_func_start sub_8062AC4 -sub_8062AC4: @ 8062AC4 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8062AC4 - - thumb_func_start sub_8062AD0 -sub_8062AD0: @ 8062AD0 - push {r4,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - bl sub_80A6A90 - lsls r0, 24 - cmp r0, 0 - beq _08062B16 - ldr r3, =0x02020630 - ldr r0, =0x020241e4 - ldrb r1, [r4] - adds r0, r1, r0 - ldrb r0, [r0] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r3 - ldr r0, =0x02023064 - lsls r1, 9 - adds r0, 0x1 - adds r1, r0 - adds r2, 0x3E - movs r0, 0x1 - ldrb r1, [r1] - ands r1, r0 - lsls r1, 2 - ldrb r3, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldrb r0, [r4] - bl sub_805E408 -_08062B16: - bl dp01_tbl7_exec_completed - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8062AD0 - - thumb_func_start dp01t_34_7_move_anim_start_t3 -dp01t_34_7_move_anim_start_t3: @ 8062B30 - push {r4-r6,lr} - sub sp, 0x4 - ldr r6, =0x02024064 - ldrb r0, [r6] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _08062B88 - ldr r5, =0x02023064 - ldrb r2, [r6] - lsls r1, r2, 9 - adds r0, r5, 0x1 - adds r0, r1, r0 - ldrb r3, [r0] - adds r0, r5, 0x2 - adds r0, r1, r0 - ldrb r4, [r0] - adds r5, 0x3 - adds r1, r5 - ldrb r0, [r1] - lsls r0, 8 - orrs r4, r0 - str r4, [sp] - adds r0, r2, 0 - adds r1, r2, 0 - bl move_anim_start_t3 - lsls r0, 24 - cmp r0, 0 - beq _08062B7C - bl dp01_tbl7_exec_completed - b _08062B88 - .pool -_08062B7C: - ldr r0, =0x03005d60 - ldrb r1, [r6] - lsls r1, 2 - adds r1, r0 - ldr r0, =bx_803B0F4 - str r0, [r1] -_08062B88: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_34_7_move_anim_start_t3 - - thumb_func_start sub_8062B98 -sub_8062B98: @ 8062B98 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8062B98 - - thumb_func_start sub_8062BA4 -sub_8062BA4: @ 8062BA4 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8062BA4 - - thumb_func_start sub_8062BB0 -sub_8062BB0: @ 8062BB0 - push {lr} - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x6 - ands r0, r1 - cmp r0, 0x2 - bne _08062BDA - ldr r2, =0x030022c0 - ldr r0, =0x00000439 - adds r3, r2, r0 - ldrb r1, [r3] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r3] - ldr r0, =0x03005d00 - ldr r0, [r0] - str r0, [r2] - ldr r0, [r2, 0x8] - bl SetMainCallback2 -_08062BDA: - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_8062BB0 - - thumb_func_start nullsub_91 -nullsub_91: @ 8062BF4 - bx lr - thumb_func_end nullsub_91 - - thumb_func_start ai_switch_perish_song -ai_switch_perish_song: @ 8062BF8 - push {lr} - ldr r1, =0x020242ac - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r0, r2, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08062C50 - ldr r0, =0x020242bc - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0xF] - lsls r0, 28 - cmp r0, 0 - bne _08062C50 - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, r2, r0 - movs r1, 0xA5 - lsls r1, 2 - adds r0, r1 - movs r1, 0x6 - strb r1, [r0] - movs r0, 0x1 - movs r1, 0x2 - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb - movs r0, 0x1 - b _08062C52 - .pool -_08062C50: - movs r0, 0 -_08062C52: - pop {r1} - bx r1 - thumb_func_end ai_switch_perish_song - - thumb_func_start sub_8062C58 -sub_8062C58: @ 8062C58 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08062C72 - b _08062E2C -_08062C72: - ldr r0, =0x02024064 - ldrb r0, [r0] - bl battle_get_per_side_status - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r4, =0x02024084 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x58 - muls r0, r1 - adds r0, r4 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x19 - beq _08062C9E - b _08062E2C -_08062C9E: - mov r0, r10 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r2, r0, 24 - movs r6, 0 - mov r8, r4 - movs r7, 0x58 - adds r0, r2, 0 - muls r0, r7 - adds r4, r0, r4 - movs r0, 0x20 - adds r0, r4 - mov r9, r0 -_08062CBA: - lsls r1, r6, 1 - ldr r5, =0x02024064 - ldrb r0, [r5] - muls r0, r7 - adds r1, r0 - mov r0, r8 - adds r0, 0xC - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _08062CE8 - ldrh r1, [r4] - mov r3, r9 - ldrb r2, [r3] - bl ai_rate_move - lsls r0, 24 - lsrs r1, r0, 24 - movs r0, 0x2 - ands r1, r0 - cmp r1, 0 - beq _08062CE8 - b _08062E2C -_08062CE8: - adds r6, 0x1 - cmp r6, 0x3 - ble _08062CBA - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x00808000 - ands r0, r1 - cmp r0, 0 - beq _08062D50 - ldrb r1, [r5] - movs r0, 0x2 - ands r0, r1 - adds r1, r5, 0 - cmp r0, 0 - bne _08062D20 - movs r4, 0 - movs r0, 0x3 - str r0, [sp] - b _08062D58 - .pool -_08062D20: - movs r4, 0x3 - movs r3, 0x6 - str r3, [sp] - b _08062D58 -_08062D28: - ldr r0, =0x02024064 - ldrb r0, [r0] - ldr r1, =0x0202449c - ldr r1, [r1] - adds r0, r1 - movs r1, 0xA5 - lsls r1, 2 - adds r0, r1 - strb r6, [r0] - movs r0, 0x1 - movs r1, 0x2 - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb - movs r0, 0x1 - b _08062E2E - .pool -_08062D50: - movs r4, 0 - movs r3, 0x6 - str r3, [sp] - adds r1, r5, 0 -_08062D58: - ldrb r0, [r1] - bl battle_side_get_owner - lsls r0, 24 - ldr r1, =0x02024744 - mov r9, r1 - cmp r0, 0 - bne _08062D6C - ldr r3, =0x020244ec - mov r9, r3 -_08062D6C: - adds r6, r4, 0 - ldr r0, [sp] - cmp r6, r0 - bge _08062E2C -_08062D74: - movs r0, 0x64 - adds r5, r6, 0 - muls r5, r0 - mov r1, r9 - adds r4, r1, r5 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _08062E24 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - beq _08062E24 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _08062E24 - ldr r1, =0x0202406e - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r6, r0 - beq _08062E24 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - adds r0, r4, 0 - movs r1, 0x2E - bl pokemon_getattr - mov r0, r10 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r2, r0, 24 - movs r4, 0 - mov r8, r5 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r2 - adds r5, r0, r1 - adds r7, r5, 0 - adds r7, 0x20 -_08062DE0: - adds r1, r4, 0 - adds r1, 0xD - mov r0, r9 - add r0, r8 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - beq _08062E1E - ldrh r1, [r5] - ldrb r2, [r7] - bl ai_rate_move - lsls r0, 24 - lsrs r1, r0, 24 - movs r0, 0x2 - ands r1, r0 - cmp r1, 0 - beq _08062E1E - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bls _08062D28 -_08062E1E: - adds r4, 0x1 - cmp r4, 0x3 - ble _08062DE0 -_08062E24: - adds r6, 0x1 - ldr r3, [sp] - cmp r6, r3 - blt _08062D74 -_08062E2C: - movs r0, 0 -_08062E2E: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8062C58 - - thumb_func_start sub_8062E54 -sub_8062E54: @ 8062E54 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - movs r0, 0x1 - bl ai_has_super_effective_move_on_field - lsls r0, 24 - cmp r0, 0 - beq _08062E82 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - beq _08062E82 - b _080630AC -_08062E82: - ldr r1, =0x02024250 - ldr r5, =0x02024064 - ldrb r3, [r5] - lsls r0, r3, 1 - adds r4, r0, r1 - ldrh r1, [r4] - cmp r1, 0 - bne _08062E94 - b _080630AC -_08062E94: - ldr r0, =0x0000ffff - cmp r1, r0 - bne _08062E9C - b _080630AC -_08062E9C: - ldr r2, =gBattleMoves - ldrh r1, [r4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0 - bne _08062EB0 - b _080630AC -_08062EB0: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08062F1A - mov r8, r3 - mov r0, r8 - bl battle_get_per_side_status - movs r4, 0x2 - eors r0, r4 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - ldr r1, =0x02024210 - ldrb r1, [r1] - ldr r2, =gUnknown_0832A328 - lsls r0, 24 - lsrs r0, 22 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08062F04 - ldrb r7, [r5] - b _08062F1E - .pool -_08062F04: - ldrb r0, [r5] - bl battle_get_per_side_status - eors r0, r4 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r7, r0, 24 - b _08062F1E -_08062F1A: - adds r7, r3, 0 - mov r8, r7 -_08062F1E: - ldr r3, =gBattleMoves - ldr r1, =0x02024250 - ldr r2, =0x02024064 - ldrb r0, [r2] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x2] - cmp r0, 0xA - bne _08062F4C - movs r0, 0x12 - b _08062F5E - .pool -_08062F4C: - cmp r0, 0xB - bne _08062F56 - movs r1, 0xB - str r1, [sp] - b _08062F60 -_08062F56: - cmp r0, 0xD - beq _08062F5C - b _080630AC -_08062F5C: - movs r0, 0xA -_08062F5E: - str r0, [sp] -_08062F60: - ldr r1, =0x02024084 - ldrb r3, [r2] - movs r0, 0x58 - muls r0, r3 - adds r0, r1 - adds r0, 0x20 - ldrb r0, [r0] - ldr r1, [sp] - cmp r0, r1 - bne _08062F76 - b _080630AC -_08062F76: - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x00808000 - ands r0, r1 - cmp r0, 0 - beq _08062FCC - movs r0, 0x2 - ands r3, r0 - cmp r3, 0 - bne _08062F9C - movs r4, 0 - movs r0, 0x3 - b _08062FD0 - .pool -_08062F9C: - movs r4, 0x3 - movs r1, 0x6 - mov r10, r1 - b _08062FD2 -_08062FA4: - ldr r0, =0x02024064 - ldrb r0, [r0] - ldr r1, =0x0202449c - ldr r1, [r1] - adds r0, r1 - movs r2, 0xA5 - lsls r2, 2 - adds r0, r2 - strb r5, [r0] - movs r0, 0x1 - movs r1, 0x2 - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb - movs r0, 0x1 - b _080630AE - .pool -_08062FCC: - movs r4, 0 - movs r0, 0x6 -_08062FD0: - mov r10, r0 -_08062FD2: - ldrb r0, [r2] - bl battle_side_get_owner - lsls r0, 24 - ldr r1, =0x02024744 - str r1, [sp, 0x4] - cmp r0, 0 - bne _08062FE6 - ldr r2, =0x020244ec - str r2, [sp, 0x4] -_08062FE6: - adds r5, r4, 0 - cmp r5, r10 - bge _080630AC - ldr r0, =gBaseStats - mov r9, r0 -_08062FF0: - movs r0, 0x64 - muls r0, r5 - ldr r1, [sp, 0x4] - adds r6, r1, r0 - adds r0, r6, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _080630A6 - adds r0, r6, 0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - beq _080630A6 - adds r0, r6, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _080630A6 - ldr r1, =0x0202406e - mov r2, r8 - lsls r0, r2, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r5, r0 - beq _080630A6 - lsls r0, r7, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r5, r0 - beq _080630A6 - ldr r0, =0x0202449c - ldr r1, [r0] - adds r0, r2, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r5, r0 - beq _080630A6 - adds r0, r7, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r5, r0 - beq _080630A6 - adds r0, r6, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r6, 0 - movs r1, 0x2E - bl pokemon_getattr - cmp r0, 0 - beq _08063088 - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - add r0, r9 - ldrb r0, [r0, 0x17] - b _08063092 - .pool -_08063088: - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - add r0, r9 - ldrb r0, [r0, 0x16] -_08063092: - ldr r1, [sp] - cmp r1, r0 - bne _080630A6 - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _080630A6 - b _08062FA4 -_080630A6: - adds r5, 0x1 - cmp r5, r10 - blt _08062FF0 -_080630AC: - movs r0, 0 -_080630AE: - 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_8062E54 - - thumb_func_start ai_switchout_natural_cure -ai_switchout_natural_cure: @ 80630C0 - push {r4,r5,lr} - ldr r3, =0x02024084 - ldr r5, =0x02024064 - ldrb r4, [r5] - movs r0, 0x58 - adds r2, r4, 0 - muls r2, r0 - adds r0, r3, 0 - adds r0, 0x4C - adds r0, r2, r0 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - beq _08063188 - adds r1, r2, r3 - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x1E - bne _08063188 - ldrh r0, [r1, 0x2C] - ldrh r1, [r1, 0x28] - lsrs r0, 1 - cmp r1, r0 - bcc _08063188 - ldr r1, =0x02024250 - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - cmp r1, 0 - beq _08063106 - ldr r0, =0x0000ffff - cmp r1, r0 - bne _08063128 -_08063106: - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _08063128 - ldrb r0, [r5] - b _08063190 - .pool -_08063128: - ldr r2, =gBattleMoves - ldr r1, =0x02024250 - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0 - bne _08063160 - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _08063160 - ldrb r0, [r4] - b _08063190 - .pool -_08063160: - movs r0, 0x8 - movs r1, 0x1 - bl ai_switchout_something - lsls r0, 24 - cmp r0, 0 - bne _080631AA - movs r0, 0x4 - movs r1, 0x1 - bl ai_switchout_something - lsls r0, 24 - cmp r0, 0 - bne _080631AA - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - bne _0806318C -_08063188: - movs r0, 0 - b _080631AC -_0806318C: - ldr r0, =0x02024064 - ldrb r0, [r0] -_08063190: - ldr r1, =0x0202449c - ldr r1, [r1] - adds r0, r1 - movs r1, 0xA5 - lsls r1, 2 - adds r0, r1 - movs r1, 0x6 - strb r1, [r0] - movs r0, 0x1 - movs r1, 0x2 - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb -_080631AA: - movs r0, 0x1 -_080631AC: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end ai_switchout_natural_cure - - thumb_func_start ai_has_super_effective_move_on_field -ai_has_super_effective_move_on_field: @ 80631BC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldr r0, =0x02024064 - ldrb r0, [r0] - bl battle_get_per_side_status - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r3, r0, 24 - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - lsls r0, r3, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _08063256 - movs r4, 0 - ldr r6, =0x02024084 - movs r7, 0x58 - adds r0, r3, 0 - muls r0, r7 - adds r5, r0, r6 - movs r0, 0x20 - adds r0, r5 - mov r8, r0 -_0806320A: - lsls r1, r4, 1 - ldr r0, =0x02024064 - ldrb r0, [r0] - muls r0, r7 - adds r1, r0 - adds r0, r6, 0 - adds r0, 0xC - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _08063250 - ldrh r1, [r5] - mov r3, r8 - ldrb r2, [r3] - bl ai_rate_move - lsls r0, 24 - lsrs r1, r0, 24 - movs r0, 0x2 - ands r1, r0 - cmp r1, 0 - beq _08063250 - mov r0, r9 - cmp r0, 0 - bne _08063278 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - bne _08063278 -_08063250: - adds r4, 0x1 - cmp r4, 0x3 - ble _0806320A -_08063256: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0806327C - b _080632FA - .pool -_08063278: - movs r0, 0x1 - b _080632FC -_0806327C: - movs r1, 0x2 - mov r0, r10 - eors r0, r1 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r3, r0, 24 - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - lsls r0, r3, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _080632FA - movs r4, 0 - ldr r6, =0x02024084 - movs r7, 0x58 - adds r0, r3, 0 - muls r0, r7 - adds r5, r0, r6 - movs r3, 0x20 - adds r3, r5 - mov r8, r3 -_080632AE: - lsls r1, r4, 1 - ldr r0, =0x02024064 - ldrb r0, [r0] - muls r0, r7 - adds r1, r0 - adds r0, r6, 0 - adds r0, 0xC - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _080632F4 - ldrh r1, [r5] - mov r3, r8 - ldrb r2, [r3] - bl ai_rate_move - lsls r0, 24 - lsrs r1, r0, 24 - movs r0, 0x2 - ands r1, r0 - cmp r1, 0 - beq _080632F4 - mov r0, r9 - cmp r0, 0 - bne _08063278 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - bne _08063278 -_080632F4: - adds r4, 0x1 - cmp r4, 0x3 - ble _080632AE -_080632FA: - movs r0, 0 -_080632FC: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end ai_has_super_effective_move_on_field - - thumb_func_start ai_is_too_invested_in_stat_buffs -ai_is_too_invested_in_stat_buffs: @ 806331C - push {r4,lr} - movs r4, 0 - ldr r1, =0x02024084 - ldr r0, =0x02024064 - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x18 - adds r2, r0, r1 - movs r3, 0x7 -_08063330: - ldrb r1, [r2] - movs r0, 0 - ldrsb r0, [r2, r0] - cmp r0, 0x6 - ble _08063346 - subs r1, 0x6 - lsls r0, r4, 24 - asrs r0, 24 - adds r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 -_08063346: - adds r2, 0x1 - subs r3, 0x1 - cmp r3, 0 - bge _08063330 - movs r0, 0 - cmp r4, 0x3 - bls _08063356 - movs r0, 0x1 -_08063356: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end ai_is_too_invested_in_stat_buffs - - thumb_func_start ai_switchout_something -ai_switchout_something: @ 8063364 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x4] - ldr r2, =0x02024250 - ldr r1, =0x02024064 - ldrb r3, [r1] - lsls r0, r3, 1 - adds r4, r0, r2 - ldrh r2, [r4] - adds r5, r1, 0 - cmp r2, 0 - bne _08063390 - b _080635EE -_08063390: - ldr r0, =0x0000ffff - cmp r2, r0 - bne _08063398 - b _080635EE -_08063398: - ldr r0, =0x02024270 - adds r0, r3, r0 - ldrb r0, [r0] - cmp r0, 0xFF - bne _080633A4 - b _080635EE -_080633A4: - ldr r2, =gBattleMoves - ldrh r1, [r4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0 - bne _080633B8 - b _080635EE -_080633B8: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0806342C - mov r9, r3 - mov r0, r9 - bl battle_get_per_side_status - movs r4, 0x2 - eors r0, r4 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - ldr r1, =0x02024210 - ldrb r1, [r1] - ldr r2, =gUnknown_0832A328 - lsls r0, 24 - lsrs r0, 22 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08063414 - ldrb r5, [r5] - mov r10, r5 - b _08063430 - .pool -_08063414: - ldrb r0, [r5] - bl battle_get_per_side_status - eors r0, r4 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - b _08063430 -_0806342C: - mov r9, r3 - mov r10, r9 -_08063430: - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x00808000 - ands r0, r1 - cmp r0, 0 - beq _08063490 - ldr r2, =0x02024064 - ldrb r1, [r2] - movs r0, 0x2 - ands r0, r1 - adds r5, r2, 0 - cmp r0, 0 - bne _08063460 - movs r4, 0 - movs r0, 0x3 - str r0, [sp, 0x8] - b _08063498 - .pool -_08063460: - movs r4, 0x3 - movs r1, 0x6 - str r1, [sp, 0x8] - b _08063498 -_08063468: - ldr r0, =0x02024064 - ldrb r0, [r0] - ldr r1, =0x0202449c - ldr r1, [r1] - adds r0, r1 - movs r2, 0xA5 - lsls r2, 2 - adds r0, r2 - strb r6, [r0] - movs r0, 0x1 - movs r1, 0x2 - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb - movs r0, 0x1 - b _080635F0 - .pool -_08063490: - movs r4, 0 - movs r0, 0x6 - str r0, [sp, 0x8] - ldr r5, =0x02024064 -_08063498: - ldrb r0, [r5] - bl battle_side_get_owner - lsls r0, 24 - ldr r1, =0x02024744 - str r1, [sp, 0xC] - cmp r0, 0 - bne _080634AC - ldr r2, =0x020244ec - str r2, [sp, 0xC] -_080634AC: - adds r6, r4, 0 - b _080635E6 - .pool -_080634BC: - movs r0, 0x64 - muls r0, r6 - ldr r1, [sp, 0xC] - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - bne _080634D2 - b _080635E4 -_080634D2: - adds r0, r5, 0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - bne _080634E0 - b _080635E4 -_080634E0: - adds r0, r5, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _080635E4 - ldr r1, =0x0202406e - mov r2, r9 - lsls r0, r2, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r6, r0 - beq _080635E4 - mov r2, r10 - lsls r0, r2, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r6, r0 - beq _080635E4 - ldr r0, =0x0202449c - ldr r1, [r0] - mov r2, r9 - adds r0, r2, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r6, r0 - beq _080635E4 - mov r2, r10 - adds r0, r2, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r6, r0 - beq _080635E4 - adds r0, r5, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r5, 0 - movs r1, 0x2E - bl pokemon_getattr - cmp r0, 0 - beq _08063558 - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - ldr r1, =gBaseStats - adds r0, r1 - ldrb r2, [r0, 0x17] - b _08063564 - .pool -_08063558: - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - ldr r2, =gBaseStats - adds r0, r2 - ldrb r2, [r0, 0x16] -_08063564: - ldr r1, =0x02024250 - ldr r5, =0x02024064 - ldrb r0, [r5] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - adds r1, r4, 0 - bl ai_rate_move - ldr r1, [sp] - ands r1, r0 - cmp r1, 0 - beq _080635E4 - ldr r1, =0x02024270 - ldrb r0, [r5] - adds r0, r1 - ldrb r0, [r0] - mov r9, r0 - movs r4, 0 - movs r0, 0x64 - adds r1, r6, 0 - muls r1, r0 - mov r8, r1 - ldr r1, =0x02024084 - movs r0, 0x58 - mov r2, r9 - muls r2, r0 - adds r0, r2, 0 - adds r5, r0, r1 - adds r7, r5, 0 - adds r7, 0x20 -_080635A2: - adds r1, r4, 0 - adds r1, 0xD - ldr r0, [sp, 0xC] - add r0, r8 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - beq _080635DE - ldrh r1, [r5] - ldrb r2, [r7] - bl ai_rate_move - lsls r0, 24 - lsrs r1, r0, 24 - movs r0, 0x2 - ands r1, r0 - cmp r1, 0 - beq _080635DE - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - ldr r1, [sp, 0x4] - bl __modsi3 - cmp r0, 0 - bne _080635DE - b _08063468 -_080635DE: - adds r4, 0x1 - cmp r4, 0x3 - ble _080635A2 -_080635E4: - adds r6, 0x1 -_080635E6: - ldr r0, [sp, 0x8] - cmp r6, r0 - bge _080635EE - b _080634BC -_080635EE: - movs r0, 0 -_080635F0: - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end ai_switchout_something - - thumb_func_start sub_8063614 -sub_8063614: @ 8063614 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - ldr r6, =0x02024084 - ldr r4, =0x02024064 - ldrb r2, [r4] - movs r5, 0x58 - adds r0, r2, 0 - muls r0, r5 - adds r1, r6, 0 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x0400e000 - ands r0, r1 - cmp r0, 0 - beq _0806363E - b _0806386C -_0806363E: - ldr r0, =0x020242ac - lsls r1, r2, 2 - adds r1, r0 - ldr r1, [r1] - movs r0, 0x80 - lsls r0, 3 - ands r1, r0 - cmp r1, 0 - beq _08063652 - b _0806386C -_08063652: - str r1, [sp] - movs r0, 0xC - adds r1, r2, 0 - movs r2, 0x17 - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _0806366A - b _0806386C -_0806366A: - ldrb r1, [r4] - str r0, [sp] - movs r0, 0xC - movs r2, 0x47 - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _08063682 - b _0806386C -_08063682: - str r0, [sp] - movs r0, 0xE - movs r1, 0 - movs r2, 0x2A - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _080636B4 - ldrb r0, [r4] - muls r0, r5 - adds r1, r0, r6 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0x8 - bne _080636A8 - b _0806386C -_080636A8: - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0x8 - bne _080636B4 - b _0806386C -_080636B4: - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 11 - ands r0, r1 - cmp r0, 0 - beq _080636C4 - b _0806386C -_080636C4: - movs r0, 0 - mov r10, r0 - movs r0, 0x1 - ands r1, r0 - cmp r1, 0 - beq _0806372E - ldrb r7, [r4] - adds r0, r7, 0 - bl battle_get_per_side_status - movs r5, 0x2 - eors r0, r5 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - ldr r1, =0x02024210 - ldrb r1, [r1] - ldr r2, =gUnknown_0832A328 - lsls r0, 24 - lsrs r0, 22 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08063718 - ldrb r6, [r4] - b _08063732 - .pool -_08063718: - ldrb r0, [r4] - bl battle_get_per_side_status - eors r0, r5 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r6, r0, 24 - b _08063732 -_0806372E: - ldrb r6, [r4] - adds r7, r6, 0 -_08063732: - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x00808000 - ands r0, r1 - cmp r0, 0 - beq _08063768 - ldr r2, =0x02024064 - ldrb r1, [r2] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08063760 - movs r4, 0 - movs r1, 0x3 - mov r8, r1 - b _08063770 - .pool -_08063760: - movs r4, 0x3 - movs r0, 0x6 - mov r8, r0 - b _08063770 -_08063768: - movs r4, 0 - movs r1, 0x6 - mov r8, r1 - ldr r2, =0x02024064 -_08063770: - ldrb r0, [r2] - bl battle_side_get_owner - lsls r0, 24 - ldr r1, =0x02024744 - mov r9, r1 - cmp r0, 0 - bne _08063784 - ldr r0, =0x020244ec - mov r9, r0 -_08063784: - adds r5, r4, 0 - cmp r5, r8 - bge _080637F2 -_0806378A: - movs r0, 0x64 - muls r0, r5 - mov r1, r9 - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _080637EC - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - beq _080637EC - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _080637EC - ldr r1, =0x0202406e - lsls r0, r7, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r5, r0 - beq _080637EC - lsls r0, r6, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r5, r0 - beq _080637EC - ldr r0, =0x0202449c - ldr r1, [r0] - adds r0, r7, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r5, r0 - beq _080637EC - adds r0, r6, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r5, r0 - beq _080637EC - movs r0, 0x1 - add r10, r0 -_080637EC: - adds r5, 0x1 - cmp r5, r8 - blt _0806378A -_080637F2: - mov r1, r10 - cmp r1, 0 - beq _0806386C - bl ai_switch_perish_song - lsls r0, 24 - cmp r0, 0 - bne _08063852 - bl sub_8062C58 - lsls r0, 24 - cmp r0, 0 - bne _08063852 - bl sub_8062E54 - lsls r0, 24 - cmp r0, 0 - bne _08063852 - bl ai_switchout_natural_cure - lsls r0, 24 - cmp r0, 0 - bne _08063852 - movs r0, 0 - bl ai_has_super_effective_move_on_field - lsls r0, 24 - cmp r0, 0 - bne _0806386C - bl ai_is_too_invested_in_stat_buffs - lsls r0, 24 - cmp r0, 0 - bne _0806386C - movs r0, 0x8 - movs r1, 0x2 - bl ai_switchout_something - lsls r0, 24 - cmp r0, 0 - bne _08063852 - movs r0, 0x4 - movs r1, 0x3 - bl ai_switchout_something - lsls r0, 24 - cmp r0, 0 - beq _0806386C -_08063852: - movs r0, 0x1 - b _0806386E - .pool -_0806386C: - movs r0, 0 -_0806386E: - 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_8063614 - - thumb_func_start sub_8063880 -sub_8063880: @ 8063880 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r4, =0x02024064 - ldrb r0, [r4] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r6, r0, 24 - adds r5, r6, 0 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - ldr r1, =0x02024744 - mov r8, r1 - cmp r0, 0 - bne _080638A8 - ldr r2, =0x020244ec - mov r8, r2 -_080638A8: - ldr r7, =0x02022fec - ldr r0, [r7] - movs r1, 0x8 - ands r0, r1 - cmp r0, 0 - bne _080638B6 - b _080639E6 -_080638B6: - bl sub_8063614 - lsls r0, 24 - cmp r0, 0 - bne _080638C2 - b _080639DC -_080638C2: - ldrb r0, [r4] - ldr r2, =0x0202449c - ldr r1, [r2] - adds r0, r1 - movs r1, 0xA5 - lsls r1, 2 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x6 - bne _080639B8 - bl sub_8063A90 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x6 - bne _080639A6 - ldr r0, [r7] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08063910 - adds r0, r6, 0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - b _08063928 - .pool -_08063910: - adds r0, r5, 0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r6, r0, 24 - movs r0, 0x2 - eors r5, r0 - adds r0, r5, 0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r5, r0, 24 -_08063928: - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x00808000 - ands r0, r1 - cmp r0, 0 - beq _08063958 - ldr r0, =0x02024064 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08063954 - movs r0, 0 - movs r7, 0x3 - b _0806395C - .pool -_08063954: - movs r0, 0x3 - b _0806395A -_08063958: - movs r0, 0 -_0806395A: - movs r7, 0x6 -_0806395C: - adds r4, r0, 0 - cmp r4, r7 - bge _080639A6 -_08063962: - movs r0, 0x64 - muls r0, r4 - add r0, r8 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _080639A0 - ldr r1, =0x0202406e - lsls r0, r6, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r4, r0 - beq _080639A0 - lsls r0, r5, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r4, r0 - beq _080639A0 - ldr r0, =0x0202449c - ldr r1, [r0] - adds r0, r6, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r4, r0 - beq _080639A0 - adds r0, r5, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r4, r0 - bne _080639A6 -_080639A0: - adds r4, 0x1 - cmp r4, r7 - blt _08063962 -_080639A6: - ldr r0, =0x02024064 - ldrb r0, [r0] - ldr r2, =0x0202449c - ldr r1, [r2] - adds r0, r1 - movs r1, 0xA5 - lsls r1, 2 - adds r0, r1 - strb r4, [r0] -_080639B8: - ldr r0, =0x02024064 - ldrb r1, [r0] - ldr r0, [r2] - adds r0, r1, r0 - adds r1, r0, 0 - adds r1, 0x5C - movs r2, 0xA5 - lsls r2, 2 - adds r0, r2 - ldrb r0, [r0] - strb r0, [r1] - b _080639F8 - .pool -_080639DC: - bl sub_8063EE0 - lsls r0, 24 - cmp r0, 0 - bne _080639F8 -_080639E6: - ldr r0, =0x02024064 - ldrb r0, [r0] - movs r2, 0x1 - eors r2, r0 - lsls r2, 8 - movs r0, 0x1 - movs r1, 0 - bl dp01_build_cmdbuf_x21_a_bb -_080639F8: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8063880 - - thumb_func_start sub_8063A08 -sub_8063A08: @ 8063A08 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r6, r3, 0 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - movs r7, 0 - ldr r0, =gUnknown_0831ACE8 - mov r10, r0 - ldrb r0, [r0] - cmp r0, 0xFF - beq _08063A7A - mov r5, r10 -_08063A36: - ldrb r0, [r5] - cmp r0, 0xFE - beq _08063A6C - ldr r1, [sp] - cmp r0, r1 - bne _08063A6C - ldrb r4, [r5, 0x1] - cmp r4, r9 - bne _08063A56 - ldrb r1, [r6] - ldrb r0, [r5, 0x2] - muls r0, r1 - movs r1, 0xA - bl __divsi3 - strb r0, [r6] -_08063A56: - cmp r4, r8 - bne _08063A6C - cmp r9, r8 - beq _08063A6C - ldrb r1, [r6] - ldrb r0, [r5, 0x2] - muls r0, r1 - movs r1, 0xA - bl __divsi3 - strb r0, [r6] -_08063A6C: - adds r5, 0x3 - adds r7, 0x3 - mov r1, r10 - adds r0, r7, r1 - ldrb r0, [r0] - cmp r0, 0xFF - bne _08063A36 -_08063A7A: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8063A08 - - thumb_func_start sub_8063A90 -sub_8063A90: @ 8063A90 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - ldr r4, =0x02024064 - ldrb r2, [r4] - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, r2, r0 - adds r1, r0, 0 - adds r1, 0x5C - ldrb r0, [r1] - cmp r0, 0x6 - beq _08063AB2 - b _08063E50 -_08063AB2: - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 11 - ands r0, r1 - cmp r0, 0 - beq _08063AE0 - ldr r1, =0x0202406e - lsls r0, r2, 1 - adds r0, r1 - ldrb r0, [r0] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - b _08063E50 - .pool -_08063AE0: - movs r0, 0x1 - ands r1, r0 - cmp r1, 0 - beq _08063B6C - str r2, [sp, 0x10] - adds r0, r2, 0 - bl battle_get_per_side_status - movs r5, 0x2 - eors r0, r5 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - ldr r1, =0x02024210 - ldrb r1, [r1] - ldr r2, =gUnknown_0832A328 - lsls r0, 24 - lsrs r0, 22 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08063B20 - ldrb r4, [r4] - str r4, [sp, 0x14] - b _08063B36 - .pool -_08063B20: - ldrb r0, [r4] - bl battle_get_per_side_status - eors r0, r5 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x14] -_08063B36: - bl GenerateRandomNumber - movs r3, 0x2 - ands r0, r3 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - ldr r4, [sp, 0x4] - lsls r0, r4, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08063B8A - eors r4, r3 - lsls r0, r4, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - b _08063B8A - .pool -_08063B6C: - adds r0, r2, 0 - bl battle_get_per_side_status - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - ldrb r4, [r4] - str r4, [sp, 0x14] - str r4, [sp, 0x10] -_08063B8A: - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x00808000 - ands r0, r1 - cmp r0, 0 - beq _08063BC2 - ldr r2, =0x02024064 - ldrb r1, [r2] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08063BB8 - movs r0, 0 - str r0, [sp, 0x18] - movs r1, 0x3 - str r1, [sp, 0x1C] - b _08063BCC - .pool -_08063BB8: - movs r4, 0x3 - str r4, [sp, 0x18] - movs r0, 0x6 - str r0, [sp, 0x1C] - b _08063BCC -_08063BC2: - movs r1, 0 - str r1, [sp, 0x18] - movs r2, 0x6 - str r2, [sp, 0x1C] - ldr r2, =0x02024064 -_08063BCC: - ldrb r0, [r2] - bl battle_side_get_owner - lsls r0, 24 - ldr r4, =0x02024744 - str r4, [sp, 0x20] - cmp r0, 0 - bne _08063BE0 - ldr r0, =0x020244ec - str r0, [sp, 0x20] -_08063BE0: - movs r1, 0 - mov r9, r1 -_08063BE4: - movs r2, 0 - str r2, [sp, 0x8] - movs r4, 0x6 - str r4, [sp, 0xC] - ldr r7, [sp, 0x18] - ldr r0, [sp, 0x1C] - cmp r7, r0 - blt _08063BF6 - b _08063CF2 -_08063BF6: - lsls r0, r7, 2 - ldr r1, =gUnknown_0832A328 - adds r0, r1 - mov r8, r0 - mov r10, sp -_08063C00: - movs r0, 0x64 - muls r0, r7 - ldr r2, [sp, 0x20] - adds r4, r2, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0 - beq _08063CD8 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _08063CD8 - mov r4, r8 - ldr r0, [r4] - mov r1, r9 - ands r0, r1 - cmp r0, 0 - bne _08063CD8 - ldr r1, =0x0202406e - ldr r2, [sp, 0x10] - lsls r0, r2, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r7 - beq _08063CD8 - ldr r4, [sp, 0x14] - lsls r0, r4, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r7 - beq _08063CD8 - ldr r0, =0x0202449c - ldr r1, [r0] - adds r0, r2, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r7, r0 - beq _08063CD8 - adds r0, r4, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r7, r0 - beq _08063CD8 - ldr r1, =gBaseStats - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r5, [r0, 0x6] - ldrb r6, [r0, 0x7] - movs r0, 0xA - mov r1, r10 - strb r0, [r1] - movs r0, 0x58 - ldr r2, [sp, 0x4] - adds r4, r2, 0 - muls r4, r0 - ldr r0, =0x02024084 - adds r4, r0 - adds r0, r4, 0 - adds r0, 0x21 - ldrb r0, [r0] - adds r1, r5, 0 - adds r2, r6, 0 - mov r3, sp - bl sub_8063A08 - adds r4, 0x22 - ldrb r0, [r4] - adds r1, r5, 0 - adds r2, r6, 0 - mov r3, sp - bl sub_8063A08 - ldr r2, [sp, 0x8] - mov r1, r10 - ldrb r1, [r1] - cmp r2, r1 - bcs _08063CE6 - mov r2, r10 - ldrb r2, [r2] - str r2, [sp, 0x8] - lsls r0, r7, 24 - lsrs r0, 24 - str r0, [sp, 0xC] - b _08063CE6 - .pool -_08063CD8: - mov r4, r8 - ldr r0, [r4] - mov r1, r9 - orrs r1, r0 - lsls r0, r1, 24 - lsrs r0, 24 - mov r9, r0 -_08063CE6: - movs r2, 0x4 - add r8, r2 - adds r7, 0x1 - ldr r4, [sp, 0x1C] - cmp r7, r4 - blt _08063C00 -_08063CF2: - ldr r0, [sp, 0xC] - cmp r0, 0x6 - beq _08063D54 - movs r7, 0 - movs r0, 0x64 - ldr r1, [sp, 0xC] - adds r5, r1, 0 - muls r5, r0 -_08063D02: - adds r1, r7, 0 - adds r1, 0xD - ldr r2, [sp, 0x20] - adds r0, r2, r5 - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - beq _08063D2A - ldr r0, =0x02024064 - ldrb r1, [r0] - adds r0, r4, 0 - ldr r2, [sp, 0x4] - bl move_effectiveness_something - movs r1, 0x2 - ands r1, r0 - cmp r1, 0 - bne _08063D30 -_08063D2A: - adds r7, 0x1 - cmp r7, 0x3 - ble _08063D02 -_08063D30: - cmp r7, 0x4 - beq _08063D36 - b _08063E4E -_08063D36: - ldr r4, [sp, 0xC] - lsls r0, r4, 2 - ldr r1, =gUnknown_0832A328 - adds r0, r1 - ldr r0, [r0] - mov r2, r9 - orrs r2, r0 - lsls r0, r2, 24 - lsrs r0, 24 - mov r9, r0 - b _08063D58 - .pool -_08063D54: - movs r4, 0x3F - mov r9, r4 -_08063D58: - mov r0, r9 - cmp r0, 0x3F - beq _08063D60 - b _08063BE4 -_08063D60: - ldr r0, =0x02024400 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x0202449c - ldr r0, [r0] - strb r1, [r0, 0x13] - ldr r0, =0x02024474 - movs r2, 0x1 - strb r2, [r0, 0xE] - ldr r0, =0x0202427c - strb r1, [r0] - ldr r0, =0x02024211 - strb r2, [r0] - movs r1, 0 - str r1, [sp, 0x8] - movs r2, 0x6 - str r2, [sp, 0xC] - ldr r7, [sp, 0x18] - ldr r4, [sp, 0x1C] - cmp r7, r4 - bge _08063E4E -_08063D8A: - movs r0, 0x64 - adds r6, r7, 0 - muls r6, r0 - ldr r0, [sp, 0x20] - adds r4, r0, r6 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - adds r1, r7, 0x1 - mov r10, r1 - cmp r0, 0 - beq _08063E46 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _08063E46 - ldr r1, =0x0202406e - ldr r2, [sp, 0x10] - lsls r0, r2, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r7 - beq _08063E46 - ldr r4, [sp, 0x14] - lsls r0, r4, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r7 - beq _08063E46 - ldr r0, =0x0202449c - ldr r1, [r0] - adds r0, r2, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r7, r0 - beq _08063E46 - adds r0, r4, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r7, r0 - beq _08063E46 - movs r5, 0 - mov r9, r6 - ldr r0, =0x020241f0 - mov r8, r0 - ldr r6, =0x02024064 -_08063DEE: - adds r1, r5, 0 - adds r1, 0xD - ldr r0, [sp, 0x20] - add r0, r9 - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0 - mov r1, r8 - str r0, [r1] - cmp r4, 0 - beq _08063E2A - ldr r0, =gBattleMoves - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - cmp r0, 0x1 - beq _08063E2A - ldrb r0, [r6] - ldr r1, [sp, 0x4] - bl sub_8046E7C - ldrb r1, [r6] - adds r0, r4, 0 - ldr r2, [sp, 0x4] - bl move_effectiveness_something -_08063E2A: - mov r2, r8 - ldr r0, [r2] - ldr r4, [sp, 0x8] - cmp r4, r0 - bge _08063E40 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x8] - lsls r0, r7, 24 - lsrs r0, 24 - str r0, [sp, 0xC] -_08063E40: - adds r5, 0x1 - cmp r5, 0x3 - ble _08063DEE -_08063E46: - mov r7, r10 - ldr r0, [sp, 0x1C] - cmp r7, r0 - blt _08063D8A -_08063E4E: - ldr r0, [sp, 0xC] -_08063E50: - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8063A90 - - thumb_func_start ai_identify_item_effect -ai_identify_item_effect: @ 8063E84 - push {r4,lr} - adds r2, r1, 0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x13 - bne _08063E94 - movs r0, 0x1 - b _08063EDA -_08063E94: - ldrb r1, [r2, 0x4] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08063EA2 - movs r0, 0x2 - b _08063EDA -_08063EA2: - ldrb r4, [r2, 0x3] - movs r3, 0x3F - adds r0, r3, 0 - ands r0, r4 - cmp r0, 0 - beq _08063EB2 - movs r0, 0x3 - b _08063EDA -_08063EB2: - ldrb r1, [r2] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - bne _08063EC8 - ldrb r0, [r2, 0x1] - cmp r0, 0 - bne _08063EC8 - ldrb r0, [r2, 0x2] - cmp r0, 0 - beq _08063ECC -_08063EC8: - movs r0, 0x4 - b _08063EDA -_08063ECC: - movs r0, 0x80 - ands r0, r4 - cmp r0, 0 - bne _08063ED8 - movs r0, 0x6 - b _08063EDA -_08063ED8: - movs r0, 0x5 -_08063EDA: - pop {r4} - pop {r1} - bx r1 - thumb_func_end ai_identify_item_effect - - thumb_func_start sub_8063EE0 -sub_8063EE0: @ 8063EE0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r0, 0 - mov r10, r0 - movs r7, 0 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 15 - ands r0, r1 - cmp r0, 0 - beq _08063F12 - ldr r0, =0x02024064 - ldrb r0, [r0] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08063F12 - b _0806437C -_08063F12: - ldr r0, =0x02024064 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - ldr r5, =0x02024744 - cmp r0, 0 - bne _08063F24 - ldr r5, =0x020244ec -_08063F24: - movs r1, 0 - mov r8, r1 -_08063F28: - movs r0, 0x64 - mov r2, r8 - muls r2, r0 - adds r0, r2, 0 - adds r4, r5, r0 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _08063F64 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - beq _08063F64 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _08063F64 - mov r0, r10 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 -_08063F64: - movs r0, 0x1 - add r8, r0 - mov r1, r8 - cmp r1, 0x5 - ble _08063F28 - movs r2, 0 - mov r8, r2 -_08063F72: - ldr r1, =0x020244a8 - mov r0, r8 - cmp r0, 0 - beq _08063F8E - ldr r0, [r1] - ldr r0, [r0, 0x18] - adds r0, 0x50 - ldrb r0, [r0] - mov r2, r8 - subs r0, r2 - adds r0, 0x1 - cmp r10, r0 - ble _08063F8E - b _08064370 -_08063F8E: - ldr r0, [r1] - ldr r0, [r0, 0x18] - mov r2, r8 - lsls r1, r2, 1 - adds r0, 0x48 - adds r0, r1 - ldrh r0, [r0] - mov r9, r0 - str r1, [sp] - cmp r0, 0 - bne _08063FA6 - b _08064370 -_08063FA6: - ldr r1, =gItemEffectInfoPointers - subs r0, 0xD - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - cmp r1, 0 - bne _08063FB6 - b _08064370 -_08063FB6: - mov r0, r9 - cmp r0, 0xAF - bne _08063FE8 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003214 - adds r5, r0, r1 - b _08063FEA - .pool -_08063FE8: - adds r5, r1, 0 -_08063FEA: - mov r2, r9 - lsls r0, r2, 24 - lsrs r0, 24 - adds r1, r5, 0 - bl ai_identify_item_effect - ldr r4, =0x02024064 - ldrb r1, [r4] - lsrs r1, 1 - ldr r3, =0x0202449c - ldr r2, [r3] - adds r1, r2 - adds r1, 0xC4 - strb r0, [r1] - ldrb r0, [r4] - lsrs r0, 1 - ldr r1, [r3] - adds r0, r1 - adds r0, 0xC4 - ldrb r0, [r0] - subs r0, 0x1 - cmp r0, 0x5 - bls _0806401A - b _08064324 -_0806401A: - lsls r0, 2 - ldr r1, =_08064030 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08064030: - .4byte _08064048 - .4byte _08064074 - .4byte _080640BC - .4byte _08064214 - .4byte _080642F4 - .4byte _0806437C -_08064048: - ldr r2, =0x02024084 - ldr r0, =0x02024064 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r1, [r0, 0x2C] - ldrh r0, [r0, 0x28] - lsrs r1, 2 - cmp r0, r1 - bcc _08064060 - b _08064324 -_08064060: - cmp r0, 0 - bne _08064066 - b _08064324 -_08064066: - movs r7, 0x1 - b _08064328 - .pool -_08064074: - mov r0, r9 - movs r1, 0x4 - movs r2, 0x4 - bl sub_806CDDC - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _08064088 - b _08064324 -_08064088: - ldr r2, =0x02024084 - ldr r0, =0x02024064 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r1, r0, r2 - ldrh r2, [r1, 0x28] - cmp r2, 0 - bne _0806409C - b _08064324 -_0806409C: - ldrh r3, [r1, 0x2C] - lsrs r0, r3, 2 - cmp r2, r0 - bcc _08064066 - adds r0, r2, 0 - subs r0, r3, r0 - adds r1, r5, r4 - ldrb r1, [r1] - cmp r0, r1 - bgt _080640B2 - b _08064324 -_080640B2: - b _08064066 - .pool -_080640BC: - ldr r3, =0x02024064 - ldrb r0, [r3] - lsrs r0, 1 - ldr r2, =0x0202449c - ldr r1, [r2] - adds r0, r1 - adds r0, 0xC6 - movs r1, 0 - strb r1, [r0] - ldrb r1, [r5, 0x3] - movs r6, 0x20 - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08064100 - ldr r1, =0x02024084 - ldrb r4, [r3] - movs r0, 0x58 - muls r0, r4 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - beq _08064100 - lsrs r1, r4, 1 - ldr r0, [r2] - adds r1, r0 - adds r1, 0xC6 - ldrb r0, [r1] - orrs r0, r6 - strb r0, [r1] - movs r7, 0x1 -_08064100: - ldrb r1, [r5, 0x3] - movs r6, 0x10 - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0806413A - ldr r1, =0x02024084 - ldrb r4, [r3] - movs r0, 0x58 - muls r0, r4 - adds r1, 0x4C - adds r0, r1 - ldr r1, [r0] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - bne _0806412A - movs r0, 0x80 - ands r1, r0 - cmp r1, 0 - beq _0806413A -_0806412A: - lsrs r1, r4, 1 - ldr r0, [r2] - adds r1, r0 - adds r1, 0xC6 - ldrb r0, [r1] - orrs r0, r6 - strb r0, [r1] - movs r7, 0x1 -_0806413A: - ldrb r1, [r5, 0x3] - movs r6, 0x8 - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0806416C - ldr r1, =0x02024084 - ldrb r4, [r3] - movs r0, 0x58 - muls r0, r4 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0806416C - lsrs r1, r4, 1 - ldr r0, [r2] - adds r1, r0 - adds r1, 0xC6 - ldrb r0, [r1] - orrs r0, r6 - strb r0, [r1] - movs r7, 0x1 -_0806416C: - ldrb r1, [r5, 0x3] - movs r6, 0x4 - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0806419E - ldr r1, =0x02024084 - ldrb r4, [r3] - movs r0, 0x58 - muls r0, r4 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0806419E - lsrs r1, r4, 1 - ldr r0, [r2] - adds r1, r0 - adds r1, 0xC6 - ldrb r0, [r1] - orrs r0, r6 - strb r0, [r1] - movs r7, 0x1 -_0806419E: - ldrb r1, [r5, 0x3] - movs r6, 0x2 - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080641D0 - ldr r1, =0x02024084 - ldrb r4, [r3] - movs r0, 0x58 - muls r0, r4 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080641D0 - lsrs r1, r4, 1 - ldr r0, [r2] - adds r1, r0 - adds r1, 0xC6 - ldrb r0, [r1] - orrs r0, r6 - strb r0, [r1] - movs r7, 0x1 -_080641D0: - ldrb r1, [r5, 0x3] - movs r4, 0x1 - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080641DE - b _08064324 -_080641DE: - ldr r1, =0x02024084 - ldrb r3, [r3] - movs r0, 0x58 - muls r0, r3 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - bne _080641F6 - b _08064324 -_080641F6: - lsrs r1, r3, 1 - ldr r0, [r2] - adds r1, r0 - adds r1, 0xC6 - ldrb r0, [r1] - orrs r0, r4 - strb r0, [r1] - b _08064066 - .pool -_08064214: - ldr r4, =0x02024064 - ldrb r0, [r4] - lsrs r0, 1 - ldr r3, =0x0202449c - ldr r1, [r3] - adds r0, r1 - adds r0, 0xC6 - movs r1, 0 - strb r1, [r0] - ldr r1, =0x020242bc - ldrb r2, [r4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x16] - cmp r0, 0 - beq _08064324 - ldrb r1, [r5] - movs r6, 0xF - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _08064254 - lsrs r2, 1 - ldr r0, [r3] - adds r2, r0 - adds r2, 0xC6 - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] -_08064254: - ldrb r1, [r5, 0x1] - movs r7, 0xF0 - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0 - beq _08064272 - ldrb r0, [r4] - lsrs r0, 1 - ldr r1, [r3] - adds r0, r1 - adds r0, 0xC6 - ldrb r1, [r0] - movs r2, 0x2 - orrs r1, r2 - strb r1, [r0] -_08064272: - ldrb r1, [r5, 0x1] - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _0806428E - ldrb r0, [r4] - lsrs r0, 1 - ldr r1, [r3] - adds r0, r1 - adds r0, 0xC6 - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_0806428E: - ldrb r1, [r5, 0x2] - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _080642AA - ldrb r0, [r4] - lsrs r0, 1 - ldr r1, [r3] - adds r0, r1 - adds r0, 0xC6 - ldrb r1, [r0] - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0] -_080642AA: - ldrb r1, [r5, 0x2] - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0 - beq _080642C6 - ldrb r0, [r4] - lsrs r0, 1 - ldr r1, [r3] - adds r0, r1 - adds r0, 0xC6 - ldrb r1, [r0] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0] -_080642C6: - ldrb r1, [r5] - movs r0, 0x30 - ands r0, r1 - cmp r0, 0 - bne _080642D2 - b _08064066 -_080642D2: - ldrb r0, [r4] - lsrs r0, 1 - ldr r1, [r3] - adds r0, r1 - adds r0, 0xC6 - ldrb r1, [r0] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0] - b _08064066 - .pool -_080642F4: - ldr r4, =0x02024064 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =0x020242bc - ldrb r1, [r4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x16] - cmp r0, 0 - beq _08064324 - ldr r0, =0x02024294 - lsls r1, r3, 1 - adds r1, r3 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x4] - cmp r0, 0 - bne _08064324 - b _08064066 -_08064324: - cmp r7, 0 - beq _08064370 -_08064328: - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb - ldr r0, =0x02024064 - ldrb r0, [r0] - lsrs r0, 1 - ldr r1, =0x0202449c - ldr r1, [r1] - lsls r0, 1 - adds r0, r1 - adds r0, 0xC0 - mov r1, r9 - strb r1, [r0] - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r0, [r0, 0x18] - adds r0, 0x48 - ldr r2, [sp] - adds r0, r2 - movs r1, 0 - strh r1, [r0] - adds r0, r7, 0 - b _0806437E - .pool -_08064370: - movs r0, 0x1 - add r8, r0 - mov r1, r8 - cmp r1, 0x3 - bgt _0806437C - b _08063F72 -_0806437C: - movs r0, 0 -_0806437E: - 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_8063EE0 - - thumb_func_start nullsub_28 -nullsub_28: @ 8064390 - bx lr - thumb_func_end nullsub_28 - - thumb_func_start sub_8064394 -sub_8064394: @ 8064394 - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_80643B0 - str r1, [r0] - bx lr - .pool - thumb_func_end sub_8064394 - - thumb_func_start sub_80643B0 -sub_80643B0: @ 80643B0 - push {lr} - ldr r2, =0x02024068 - ldr r1, =gUnknown_0832A328 - ldr r0, =0x02024064 - ldrb r3, [r0] - lsls r0, r3, 2 - adds r0, r1 - ldr r1, [r2] - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _080643FC - ldr r0, =0x02023064 - lsls r1, r3, 9 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x38 - bhi _080643F8 - ldr r0, =gUnknown_0831C7B4 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - bl _call_via_r0 - b _080643FC - .pool -_080643F8: - bl sub_8065068 -_080643FC: - pop {r0} - bx r0 - thumb_func_end sub_80643B0 - - thumb_func_start sub_8064400 -sub_8064400: @ 8064400 - push {lr} - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - bne _08064424 - bl sub_8065068 -_08064424: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8064400 - - thumb_func_start sub_8064438 -sub_8064438: @ 8064438 - push {lr} - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - bne _0806445C - bl sub_8065068 -_0806445C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8064438 - - thumb_func_start sub_8064470 -sub_8064470: @ 8064470 - push {r4-r6,lr} - ldr r5, =0x02020630 - ldr r6, =0x020241e4 - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r2, r0, 2 - adds r0, r5, 0 - adds r0, 0x1C - adds r0, r2, r0 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - bne _080644C2 - adds r0, r2, r5 - ldrh r0, [r0, 0x6] - bl sub_805DFE4 - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl obj_free_rotscale_entry - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl RemoveObjectAndFreeTiles - bl sub_8065068 -_080644C2: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8064470 - - thumb_func_start sub_80644D8 -sub_80644D8: @ 80644D8 - push {r4,lr} - ldr r4, =0x020244d0 - ldr r1, [r4] - ldr r3, =0x02024064 - ldrb r0, [r3] - ldr r2, [r1, 0x4] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r0, [r1, 0x9] - subs r0, 0x1 - strb r0, [r1, 0x9] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _08064510 - ldr r0, [r4] - ldrb r1, [r3] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strb r1, [r0, 0x9] - bl sub_8065068 -_08064510: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80644D8 - - thumb_func_start sub_8064520 -sub_8064520: @ 8064520 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r0, 0 - mov r8, r0 - movs r4, 0 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0806454C - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08064584 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08064584 -_0806454C: - ldr r2, =0x02020630 - ldr r1, =0x03005d70 - ldr r3, =0x02024064 - ldrb r0, [r3] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - adds r7, r3, 0 - cmp r1, r0 - bne _080645C2 - b _080645CA - .pool -_08064584: - ldr r3, =0x02020630 - ldr r6, =0x03005d70 - ldr r2, =0x02024064 - ldrb r4, [r2] - adds r0, r4, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r5, r3, 0 - adds r5, 0x1C - adds r0, r5 - ldr r3, [r0] - ldr r0, =DummyObjectCallback - adds r7, r2, 0 - cmp r3, r0 - bne _080645C0 - movs r0, 0x2 - eors r4, r0 - adds r0, r4, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r0, [r0] - cmp r0, r3 - bne _080645C0 - movs r1, 0x1 - mov r8, r1 -_080645C0: - movs r4, 0x1 -_080645C2: - mov r0, r8 - cmp r0, 0 - bne _080645CA - b _08064714 -_080645CA: - cmp r4, 0 - bne _080645DE - ldrb r1, [r7] - movs r0, 0x2 - eors r0, r1 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - bne _0806469C -_080645DE: - ldr r1, =0x020244d0 - mov r12, r1 - ldr r0, [r1] - ldr r7, =0x02024064 - ldrb r2, [r7] - ldr r3, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r4, r0, r3 - ldrb r1, [r4, 0x1] - movs r5, 0x1 - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - bne _08064600 - b _08064714 -_08064600: - movs r6, 0x2 - adds r1, r6, 0 - eors r1, r2 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r1, [r0, 0x1] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _08064714 - ldrb r1, [r4] - movs r3, 0x7F - adds r0, r3, 0 - ands r0, r1 - strb r0, [r4] - mov r1, r12 - ldr r0, [r1] - ldrb r2, [r7] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r4, 0x2 - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - strb r0, [r1, 0x1] - mov r0, r12 - ldr r2, [r0] - ldrb r0, [r7] - adds r1, r6, 0 - eors r1, r0 - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - ands r3, r1 - strb r3, [r0] - mov r1, r12 - ldr r2, [r1] - ldrb r0, [r7] - adds r1, r6, 0 - eors r1, r0 - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x1] - ands r4, r1 - strb r4, [r0, 0x1] - ldr r4, =0x000027f9 - adds r0, r4, 0 - bl FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - b _080646F2 - .pool -_0806469C: - ldr r3, =0x020244d0 - ldr r0, [r3] - ldrb r1, [r7] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r2, r0, r2 - ldrb r1, [r2, 0x1] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08064714 - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - ldr r0, [r3] - ldrb r2, [r7] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1] - ldrb r0, [r7] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _080646F2 - ldr r4, =0x000027f9 - adds r0, r4, 0 - bl FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag -_080646F2: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r3, =0x02024064 - ldrb r1, [r3] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x3 - strb r1, [r0, 0x9] - ldr r1, =0x03005d60 - ldrb r0, [r3] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_80644D8 - str r1, [r0] -_08064714: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8064520 - - thumb_func_start sub_8064734 -sub_8064734: @ 8064734 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r0, 0 - mov r10, r0 - ldr r5, =0x020244d0 - ldr r0, [r5] - ldr r4, =0x02024064 - ldrb r2, [r4] - ldr r1, [r0, 0x4] - lsls r3, r2, 1 - adds r0, r3, r2 - lsls r0, 2 - adds r0, r1 - ldrh r1, [r0] - movs r6, 0xC4 - lsls r6, 1 - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - bne _08064776 - ldr r0, =0x0202406e - adds r0, r3, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 - adds r1, r0 - adds r0, r2, 0 - bl sub_8172EF0 -_08064776: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _080647B4 - ldr r2, [r5] - ldrb r1, [r4] - movs r0, 0x2 - adds r3, r0, 0 - eors r3, r1 - ldr r1, [r2, 0x4] - lsls r2, r3, 1 - adds r0, r2, r3 - lsls r0, 2 - adds r0, r1 - ldrh r1, [r0] - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - bne _080647B4 - ldr r0, =0x0202406e - adds r0, r2, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 - adds r1, r0 - adds r0, r3, 0 - bl sub_8172EF0 -_080647B4: - ldr r3, =0x020244d0 - ldr r0, [r3] - ldr r2, =0x02024064 - ldrb r5, [r2] - ldr r4, [r0, 0x4] - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r6, r0, r4 - ldrb r1, [r6] - movs r0, 0x8 - mov r12, r0 - ands r0, r1 - mov r8, r3 - mov r9, r2 - cmp r0, 0 - bne _08064898 - movs r7, 0x2 - adds r1, r7, 0 - eors r1, r5 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0] - mov r0, r12 - ands r0, r1 - cmp r0, 0 - bne _08064898 - ldrb r1, [r6, 0x1] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0806487A - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0806484A - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0806484A - ldr r4, =0x03005d70 - mov r1, r9 - ldrb r0, [r1] - adds r1, r7, 0 - eors r1, r0 - adds r0, r1, r4 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x02024744 - adds r1, r2 - movs r2, 0 - bl healthbar_draw_field_maybe - mov r1, r9 - ldrb r0, [r1] - eors r0, r7 - bl sub_8076918 - mov r1, r9 - ldrb r0, [r1] - eors r0, r7 - adds r0, r4 - ldrb r0, [r0] - bl sub_80729D0 -_0806484A: - ldr r5, =0x03005d70 - ldr r4, =0x02024064 - ldrb r1, [r4] - adds r0, r1, r5 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x02024744 - adds r1, r2 - movs r2, 0 - bl healthbar_draw_field_maybe - ldrb r0, [r4] - bl sub_8076918 - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - bl sub_80729D0 -_0806487A: - ldr r4, =0x020244d0 - ldr r0, [r4] - ldr r3, =0x02024064 - ldrb r1, [r3] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x1] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0, 0x1] - mov r8, r4 - mov r9, r3 -_08064898: - mov r1, r8 - ldr r0, [r1] - mov r1, r9 - ldrb r2, [r1] - ldr r3, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r3 - ldrb r1, [r0, 0x1] - movs r0, 0xC0 - ands r0, r1 - cmp r0, 0x80 - bne _0806495A - movs r1, 0x2 - eors r1, r2 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r1, [r0, 0x1] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0806495A - bl sub_80A36C8 - lsls r0, 24 - cmp r0, 0 - bne _0806495A - mov r1, r8 - ldr r0, [r1] - mov r1, r9 - ldrb r2, [r1] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x1] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _0806493C - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x42 - ands r0, r1 - cmp r0, 0x42 - bne _08064930 - adds r0, r2, 0 - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0806493C - ldr r0, =0x03007420 - bl m4aMPlayContinue - b _0806493C - .pool -_08064930: - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl MPlayVolumeControl -_0806493C: - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x1] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0, 0x1] - movs r0, 0x1 - mov r10, r0 -_0806495A: - mov r1, r10 - cmp r1, 0 - bne _08064962 - b _08064AC0 -_08064962: - ldr r2, =0x02020630 - ldr r0, =0x03005d7c - ldr r5, =0x02024064 - ldrb r3, [r5] - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r4, [r0] - ldr r0, =DummyObjectCallback - cmp r4, r0 - beq _08064982 - b _08064AC0 -_08064982: - ldr r0, =0x020241e4 - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - cmp r0, r4 - beq _08064998 - b _08064AC0 -_08064998: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080649E2 - adds r0, r3, 0 - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _080649E2 - ldr r3, =0x020244d0 - ldr r0, [r3] - ldrb r2, [r5] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x9] - adds r0, 0x1 - strb r0, [r1, 0x9] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08064AC0 - ldr r0, [r3] - ldrb r1, [r5] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strb r1, [r0, 0x9] -_080649E2: - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08064A3A - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _08064A3A - ldr r1, =0x03005d7c - ldr r5, =0x02024064 - ldrb r0, [r5] - movs r4, 0x2 - eors r0, r4 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - ldrb r0, [r5] - eors r4, r0 - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_805EE54 -_08064A3A: - ldr r1, =0x03005d7c - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - ldrb r5, [r4] - ldr r1, =0x0202406e - lsls r0, r5, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r5, 0 - bl sub_805EE54 - ldr r3, =0x020244d0 - ldr r0, [r3] - ldr r2, [r0, 0x8] - ldrb r1, [r2, 0x9] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x9] - ldr r0, [r3] - ldrb r2, [r4] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r0, 0x21 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1] - ldr r0, [r3] - ldrb r2, [r4] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r0, 0x7F - ands r0, r2 - strb r0, [r1, 0x1] - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8064520 - str r1, [r0] -_08064AC0: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8064734 - - thumb_func_start sub_8064B04 -sub_8064B04: @ 8064B04 - push {r4-r7,lr} - ldr r4, =0x02020630 - ldr r0, =0x020241e4 - ldr r7, =0x02024064 - ldrb r3, [r7] - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r2, r0, 2 - adds r0, r4, 0 - adds r0, 0x1C - adds r0, r2, r0 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - bne _08064BB6 - adds r0, r2, r4 - movs r1, 0x24 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08064BB6 - ldr r6, =0x020244d0 - ldr r0, [r6] - ldr r1, [r0, 0x4] - lsls r4, r3, 1 - adds r0, r4, r3 - lsls r0, 2 - adds r2, r0, r1 - ldrb r5, [r2] - movs r0, 0x80 - ands r0, r5 - cmp r0, 0 - bne _08064B7C - ldr r0, =0x0202406e - adds r0, r4, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 - adds r1, r0 - adds r0, r3, 0 - bl sub_8172EF0 - b _08064BB6 - .pool -_08064B7C: - ldrb r1, [r2, 0x1] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08064BB6 - movs r0, 0x7F - ands r0, r5 - strb r0, [r2] - ldr r0, [r6] - ldrb r2, [r7] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1] - ldr r4, =0x000027f9 - adds r0, r4, 0 - bl FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - bl sub_8065068 -_08064BB6: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8064B04 - - thumb_func_start sub_8064BC0 -sub_8064BC0: @ 8064BC0 - push {r4-r6,lr} - ldr r6, =0x02024064 - ldrb r0, [r6] - ldr r5, =0x03005d70 - adds r1, r0, r5 - ldrb r1, [r1] - movs r2, 0 - movs r3, 0 - bl sub_8074AA0 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldrb r0, [r6] - adds r0, r5 - ldrb r0, [r0] - bl sub_80729D0 - lsls r4, 16 - asrs r1, r4, 16 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08064C08 - ldrb r0, [r6] - adds r0, r5 - ldrb r0, [r0] - movs r2, 0 - bl heathbar_draw_hp - b _08064C0C - .pool -_08064C08: - bl sub_8065068 -_08064C0C: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8064BC0 - - thumb_func_start sub_8064C14 -sub_8064C14: @ 8064C14 - push {lr} - ldr r2, =0x02020630 - ldr r0, =0x020241e4 - ldr r1, =0x02024064 - ldrb r3, [r1] - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 31 - cmp r0, 0 - bne _08064C42 - ldr r0, =0x03005d70 - adds r0, r3, r0 - ldrb r0, [r0] - bl sub_8072984 - bl sub_8065068 -_08064C42: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8064C14 - - thumb_func_start sub_8064C58 -sub_8064C58: @ 8064C58 - push {r4-r6,lr} - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r6, =0x02024064 - ldrb r2, [r6] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _08064CB2 - ldr r5, =0x020241e4 - adds r0, r2, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl obj_free_rotscale_entry - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldrb r0, [r6] - bl sub_805EEE0 - ldr r1, =0x03005d70 - ldrb r0, [r6] - adds r0, r1 - ldrb r0, [r0] - bl sub_8072984 - bl sub_8065068 -_08064CB2: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8064C58 - - thumb_func_start sub_8064CCC -sub_8064CCC: @ 8064CCC - push {lr} - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _08064CDE - bl sub_8065068 -_08064CDE: - pop {r0} - bx r0 - thumb_func_end sub_8064CCC - - thumb_func_start sub_8064CE4 -sub_8064CE4: @ 8064CE4 - push {r4,lr} - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - ldr r2, =0x02020630 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, r0, r2 - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0x20 - bne _08064D30 - movs r3, 0 - movs r0, 0 - strh r0, [r4, 0x30] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - subs r0, 0x5 - ands r0, r1 - strb r0, [r2] - ldr r0, =0x020244b9 - strb r3, [r0] - bl sub_8065068 - b _08064D5A - .pool -_08064D30: - ldrh r0, [r4, 0x30] - movs r1, 0x3 - ands r0, r1 - cmp r0, 0 - bne _08064D54 - adds r3, r4, 0 - adds r3, 0x3E - ldrb r2, [r3] - lsls r0, r2, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] -_08064D54: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] -_08064D5A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8064CE4 - - thumb_func_start sub_8064D60 -sub_8064D60: @ 8064D60 - push {r4,lr} - ldr r2, =0x02020630 - ldr r0, =0x03005d70 - ldr r4, =0x02024064 - ldrb r3, [r4] - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - bne _08064DAC - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0] - lsls r0, r3, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08064DA0 - adds r0, r3, 0 - adds r1, r3, 0 - adds r2, r3, 0 - movs r3, 0x6 - bl move_anim_start_t4 -_08064DA0: - ldr r0, =0x03005d60 - ldrb r1, [r4] - lsls r1, 2 - adds r1, r0 - ldr r0, =sub_8064DD0 - str r0, [r1] -_08064DAC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8064D60 - - thumb_func_start sub_8064DD0 -sub_8064DD0: @ 8064DD0 - push {r4,lr} - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r4, =0x02024064 - ldrb r1, [r4] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _08064E2A - bl sub_80A36C8 - lsls r0, 24 - cmp r0, 0 - bne _08064E2A - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldrb r0, [r4] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - beq _08064E1A - ldr r0, =nullsub_18 - cmp r1, r0 - bne _08064E2A -_08064E1A: - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl MPlayVolumeControl - bl sub_8065068 -_08064E2A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8064DD0 - - thumb_func_start sub_8064E50 -sub_8064E50: @ 8064E50 - push {r4-r7,lr} - ldr r4, =0x020244d0 - ldr r0, [r4] - ldr r5, =0x02024064 - ldrb r2, [r5] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r3, r0, r1 - ldrb r1, [r3, 0x1] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08064F0C - ldr r7, =0x02020630 - ldr r6, =0x020241e4 - adds r0, r2, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r7, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - bne _08064F0C - ldrb r1, [r3] - movs r0, 0x7F - ands r0, r1 - strb r0, [r3] - ldr r0, [r4] - ldrb r2, [r5] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1] - ldr r4, =0x000027f9 - adds r0, r4, 0 - bl FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - movs r1, 0 - bl StartObjectImageAnim - ldr r4, =0x03005d70 - ldrb r1, [r5] - adds r0, r1, r4 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x02024744 - adds r1, r2 - movs r2, 0 - bl healthbar_draw_field_maybe - ldrb r0, [r5] - bl sub_8076918 - ldrb r0, [r5] - adds r0, r4 - ldrb r0, [r0] - bl sub_80729D0 - ldrb r0, [r5] - bl sub_805E408 - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8064D60 - str r1, [r0] -_08064F0C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8064E50 - - thumb_func_start sub_8064F40 -sub_8064F40: @ 8064F40 - push {r4-r6,lr} - ldr r6, =0x020244d0 - ldr r0, [r6] - ldr r5, =0x02024064 - ldrb r2, [r5] - ldr r1, [r0, 0x4] - lsls r3, r2, 1 - adds r0, r3, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x88 - ands r0, r1 - cmp r0, 0 - bne _08064F72 - ldr r0, =0x0202406e - adds r0, r3, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 - adds r1, r0 - adds r0, r2, 0 - bl sub_8172EF0 -_08064F72: - ldr r4, =0x02020630 - ldr r0, =0x03005d7c - ldrb r2, [r5] - adds r0, r2, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r3, r0, 2 - adds r0, r4, 0 - adds r0, 0x1C - adds r0, r3, r0 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - bne _08064FDC - ldr r0, [r6] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - bne _08064FDC - adds r0, r3, r4 - bl RemoveObjectAndFreeTiles - ldrb r4, [r5] - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_805EE54 - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8064E50 - str r1, [r0] -_08064FDC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8064F40 - - thumb_func_start sub_8065008 -sub_8065008: @ 8065008 - push {lr} - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _0806502A - bl sub_8065068 -_0806502A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8065008 - - thumb_func_start sub_8065038 -sub_8065038: @ 8065038 - push {lr} - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _0806505A - bl sub_8065068 -_0806505A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8065038 - - thumb_func_start sub_8065068 -sub_8065068: @ 8065068 - push {r4,lr} - sub sp, 0x4 - ldr r1, =0x03005d60 - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_80643B0 - str r1, [r0] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080650BC - bl link_get_multiplayer_id - mov r1, sp - strb r0, [r1] - movs r0, 0x2 - movs r1, 0x4 - mov r2, sp - bl dp01_prepare_buffer_wireless_probably - ldr r1, =0x02023064 - ldrb r0, [r4] - lsls r0, 9 - adds r0, r1 - movs r1, 0x38 - strb r1, [r0] - b _080650CE - .pool -_080650BC: - ldr r2, =0x02024068 - ldr r1, =gUnknown_0832A328 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - ldr r0, [r2] - bics r0, r1 - str r0, [r2] -_080650CE: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8065068 - - thumb_func_start dp01t_00_2_getattr -dp01t_00_2_getattr: @ 80650E0 - push {r4-r6,lr} - sub sp, 0x100 - movs r6, 0 - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x2 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0 - bne _08065118 - ldr r0, =0x0202406e - lsls r1, r2, 1 - adds r1, r0 - ldrb r0, [r1] - mov r1, sp - bl dp01_getattr_by_ch1_for_opponent_pokemon - adds r6, r0, 0 - b _0806513A - .pool -_08065118: - ldrb r4, [r1] - movs r5, 0 -_0806511C: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _08065132 - lsls r0, r5, 24 - lsrs r0, 24 - mov r2, sp - adds r1, r2, r6 - bl dp01_getattr_by_ch1_for_opponent_pokemon - adds r6, r0 -_08065132: - lsrs r4, 1 - adds r5, 0x1 - cmp r5, 0x5 - ble _0806511C -_0806513A: - lsls r1, r6, 16 - lsrs r1, 16 - movs r0, 0x1 - mov r2, sp - bl dp01_build_cmdbuf_x1D_1D_numargs_varargs - bl sub_8065068 - add sp, 0x100 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end dp01t_00_2_getattr - - thumb_func_start dp01_getattr_by_ch1_for_opponent_pokemon -dp01_getattr_by_ch1_for_opponent_pokemon: @ 8065154 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x90 - adds r7, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - movs r6, 0 - ldr r2, =0x02023064 - ldr r3, =0x02024064 - ldrb r0, [r3] - lsls r0, 9 - adds r1, r2, 0x1 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3B - bls _0806517E - bl _080658EA -_0806517E: - lsls r0, 2 - ldr r1, =_08065194 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08065194: - .4byte _08065284 - .4byte _080654A8 - .4byte _080654B8 - .4byte _080654C8 - .4byte _08065530 - .4byte _08065530 - .4byte _08065530 - .4byte _08065530 - .4byte _0806554C - .4byte _08065588 - .4byte _08065588 - .4byte _08065588 - .4byte _08065588 - .4byte _080658EA - .4byte _080658EA - .4byte _080658EA - .4byte _080658EA - .4byte _080655A4 - .4byte _080655B4 - .4byte _080655E4 - .4byte _080655F4 - .4byte _08065604 - .4byte _08065614 - .4byte _08065624 - .4byte _08065634 - .4byte _08065644 - .4byte _08065654 - .4byte _08065664 - .4byte _08065674 - .4byte _08065684 - .4byte _08065694 - .4byte _080656A4 - .4byte _080656F4 - .4byte _08065704 - .4byte _08065714 - .4byte _08065724 - .4byte _08065734 - .4byte _08065744 - .4byte _08065754 - .4byte _08065764 - .4byte _08065774 - .4byte _080657A8 - .4byte _080657B8 - .4byte _080657C8 - .4byte _080657D8 - .4byte _080657E8 - .4byte _080657F8 - .4byte _08065808 - .4byte _08065818 - .4byte _08065838 - .4byte _08065848 - .4byte _08065858 - .4byte _08065868 - .4byte _08065878 - .4byte _08065888 - .4byte _08065898 - .4byte _080658A8 - .4byte _080658B8 - .4byte _080658C8 - .4byte _080658D8 -_08065284: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - mov r1, sp - strh r0, [r1] - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x2E] - movs r6, 0 - add r0, sp, 0x24 - mov r9, r0 - movs r1, 0x3B - add r1, sp - mov r10, r1 - mov r2, sp - adds r2, 0x2B - str r2, [sp, 0x80] - mov r0, sp - adds r0, 0x2A - str r0, [sp, 0x7C] - mov r1, sp - adds r1, 0x68 - str r1, [sp, 0x8C] - adds r2, 0x5 - str r2, [sp, 0x84] - adds r0, 0x12 - str r0, [sp, 0x88] - mov r8, r4 - add r4, sp, 0xC -_080652D0: - adds r1, r6, 0 - adds r1, 0xD - mov r0, r8 - bl pokemon_getattr - strh r0, [r4] - adds r1, r6, 0 - adds r1, 0x11 - mov r0, r8 - bl pokemon_getattr - mov r2, r9 - adds r1, r2, r6 - strb r0, [r1] - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - ble _080652D0 - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x15 - bl pokemon_getattr - mov r1, r10 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x20 - bl pokemon_getattr - ldr r2, [sp, 0x80] - strb r0, [r2] - adds r0, r4, 0 - movs r1, 0x19 - bl pokemon_getattr - str r0, [sp, 0x44] - adds r0, r4, 0 - movs r1, 0x27 - bl pokemon_getattr - mov r3, sp - movs r5, 0x1F - ands r0, r5 - ldrb r2, [r3, 0x14] - movs r1, 0x20 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x14] - adds r0, r4, 0 - movs r1, 0x28 - bl pokemon_getattr - mov r3, sp - movs r6, 0x1F - ands r0, r6 - lsls r0, 5 - ldrh r2, [r3, 0x14] - ldr r1, =0xfffffc1f - ands r1, r2 - orrs r1, r0 - strh r1, [r3, 0x14] - adds r0, r4, 0 - movs r1, 0x29 - bl pokemon_getattr - mov r3, sp - ands r0, r5 - lsls r0, 2 - ldrb r2, [r3, 0x15] - movs r1, 0x7D - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x15] - adds r0, r4, 0 - movs r1, 0x2A - bl pokemon_getattr - movs r1, 0x1F - ands r1, r0 - lsls r1, 15 - ldr r0, [sp, 0x14] - ldr r2, =0xfff07fff - ands r0, r2 - orrs r0, r1 - str r0, [sp, 0x14] - adds r0, r4, 0 - movs r1, 0x2B - bl pokemon_getattr - mov r3, sp - ands r0, r6 - lsls r0, 4 - ldrh r2, [r3, 0x16] - ldr r1, =0xfffffe0f - ands r1, r2 - orrs r1, r0 - strh r1, [r3, 0x16] - adds r0, r4, 0 - movs r1, 0x2C - bl pokemon_getattr - mov r3, sp - ands r0, r5 - lsls r0, 1 - ldrb r2, [r3, 0x17] - movs r1, 0x3F - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x17] - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - str r0, [sp, 0x48] - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr - str r0, [sp, 0x4C] - adds r0, r4, 0 - movs r1, 0x38 - bl pokemon_getattr - ldr r1, [sp, 0x7C] - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x28] - adds r0, r4, 0 - movs r1, 0x3A - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x2C] - adds r0, r4, 0 - movs r1, 0x3B - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x2] - adds r0, r4, 0 - movs r1, 0x3C - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x4] - adds r0, r4, 0 - movs r1, 0x3D - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x6] - adds r0, r4, 0 - movs r1, 0x3E - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x8] - adds r0, r4, 0 - movs r1, 0x3F - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0xA] - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - mov r3, sp - movs r1, 0x1 - ands r0, r1 - lsls r0, 6 - ldrb r2, [r3, 0x17] - movs r1, 0x41 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x17] - adds r0, r4, 0 - movs r1, 0x2E - bl pokemon_getattr - mov r3, sp - lsls r0, 7 - ldrb r2, [r3, 0x17] - movs r1, 0x7F - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x17] - adds r0, r4, 0 - movs r1, 0x1 - bl pokemon_getattr - str r0, [sp, 0x54] - adds r0, r4, 0 - movs r1, 0x2 - ldr r2, [sp, 0x8C] - bl pokemon_getattr - ldr r0, [sp, 0x84] - ldr r1, [sp, 0x8C] - bl CopyString_Limit10 - adds r0, r4, 0 - movs r1, 0x7 - ldr r2, [sp, 0x88] - bl pokemon_getattr - mov r2, sp - movs r6, 0 -_08065488: - adds r0, r7, r6 - adds r1, r2, r6 - ldrb r1, [r1] - strb r1, [r0] - adds r6, 0x1 - cmp r6, 0x57 - bls _08065488 - b _080658EA - .pool -_080654A8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - b _08065822 - .pool -_080654B8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xC - b _08065822 - .pool -_080654C8: - movs r6, 0 - add r2, sp, 0x58 - mov r9, r2 - add r0, sp, 0x60 - mov r10, r0 - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x02024744 - adds r4, r1, r0 - mov r8, r9 -_080654DE: - adds r1, r6, 0 - adds r1, 0xD - adds r0, r4, 0 - bl pokemon_getattr - mov r1, r8 - strh r0, [r1] - adds r1, r6, 0 - adds r1, 0x11 - adds r0, r4, 0 - bl pokemon_getattr - mov r2, r10 - adds r1, r2, r6 - strb r0, [r1] - movs r0, 0x2 - add r8, r0 - adds r6, 0x1 - cmp r6, 0x3 - ble _080654DE - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x15 - bl pokemon_getattr - mov r1, r9 - strb r0, [r1, 0xC] - mov r2, r9 - movs r6, 0 -_0806551C: - adds r0, r7, r6 - adds r1, r2, r6 - ldrb r1, [r1] - strb r1, [r0] - adds r6, 0x1 - cmp r6, 0xF - bls _0806551C - b _080658EA - .pool -_08065530: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r1, [r3] - lsls r1, 9 - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - adds r1, 0x9 - b _08065822 - .pool -_0806554C: - movs r6, 0 - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r2, =0x02024744 - mov r8, r2 -_08065558: - adds r1, r6, 0 - adds r1, 0x11 - mov r2, r8 - adds r0, r4, r2 - bl pokemon_getattr - adds r1, r7, r6 - strb r0, [r1] - adds r6, 0x1 - cmp r6, 0x3 - ble _08065558 - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x15 - bl pokemon_getattr - adds r1, r7, r6 - strb r0, [r1] - adds r6, 0x1 - b _080658EA - .pool -_08065588: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r1, [r3] - lsls r1, 9 - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - adds r1, 0x8 - b _080658E2 - .pool -_080655A4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x1 - b _080655BE - .pool -_080655B4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x19 -_080655BE: - bl pokemon_getattr - adds r1, r0, 0 - strb r1, [r7] - movs r0, 0xFF - lsls r0, 8 - ands r0, r1 - lsrs r0, 8 - strb r0, [r7, 0x1] - movs r0, 0xFF - lsls r0, 16 - ands r0, r1 - lsrs r0, 16 - strb r0, [r7, 0x2] - movs r6, 0x3 - b _080658EA - .pool -_080655E4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x1A - b _080658E2 - .pool -_080655F4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x1B - b _080658E2 - .pool -_08065604: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x1C - b _080658E2 - .pool -_08065614: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x1D - b _080658E2 - .pool -_08065624: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x1E - b _080658E2 - .pool -_08065634: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x1F - b _080658E2 - .pool -_08065644: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x20 - b _080658E2 - .pool -_08065654: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x22 - b _080658E2 - .pool -_08065664: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x23 - b _080658E2 - .pool -_08065674: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x24 - b _080658E2 - .pool -_08065684: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x25 - b _080658E2 - .pool -_08065694: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x26 - b _080658E2 - .pool -_080656A4: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x27 - bl pokemon_getattr - strb r0, [r7] - adds r0, r4, 0 - movs r1, 0x28 - bl pokemon_getattr - strb r0, [r7, 0x1] - adds r0, r4, 0 - movs r1, 0x29 - bl pokemon_getattr - strb r0, [r7, 0x2] - adds r0, r4, 0 - movs r1, 0x2A - bl pokemon_getattr - strb r0, [r7, 0x3] - adds r0, r4, 0 - movs r1, 0x2B - bl pokemon_getattr - strb r0, [r7, 0x4] - adds r0, r4, 0 - movs r1, 0x2C - bl pokemon_getattr - strb r0, [r7, 0x5] - movs r6, 0x6 - b _080658EA - .pool -_080656F4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x27 - b _080658E2 - .pool -_08065704: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x28 - b _080658E2 - .pool -_08065714: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x29 - b _080658E2 - .pool -_08065724: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x2A - b _080658E2 - .pool -_08065734: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x2B - b _080658E2 - .pool -_08065744: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x2C - b _080658E2 - .pool -_08065754: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0 - b _0806577E - .pool -_08065764: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x9 - b _08065822 - .pool -_08065774: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x37 -_0806577E: - bl pokemon_getattr - adds r1, r0, 0 - strb r1, [r7] - movs r0, 0xFF - lsls r0, 8 - ands r0, r1 - lsrs r0, 8 - strb r0, [r7, 0x1] - movs r0, 0xFF - lsls r0, 16 - ands r0, r1 - lsrs r0, 16 - strb r0, [r7, 0x2] - lsrs r0, r1, 24 - strb r0, [r7, 0x3] - movs r6, 0x4 - b _080658EA - .pool -_080657A8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x38 - b _080658E2 - .pool -_080657B8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x39 - b _08065822 - .pool -_080657C8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3A - b _08065822 - .pool -_080657D8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3B - b _08065822 - .pool -_080657E8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3C - b _08065822 - .pool -_080657F8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3D - b _08065822 - .pool -_08065808: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3E - b _08065822 - .pool -_08065818: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3F -_08065822: - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - strb r0, [r7] - lsrs r0, 8 - strb r0, [r7, 0x1] - movs r6, 0x2 - b _080658EA - .pool -_08065838: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x16 - b _080658E2 - .pool -_08065848: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x17 - b _080658E2 - .pool -_08065858: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x18 - b _080658E2 - .pool -_08065868: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x21 - b _080658E2 - .pool -_08065878: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x2F - b _080658E2 - .pool -_08065888: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x30 - b _080658E2 - .pool -_08065898: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x32 - b _080658E2 - .pool -_080658A8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x33 - b _080658E2 - .pool -_080658B8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x34 - b _080658E2 - .pool -_080658C8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x35 - b _080658E2 - .pool -_080658D8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x36 -_080658E2: - bl pokemon_getattr - strb r0, [r7] - movs r6, 0x1 -_080658EA: - adds r0, r6, 0 - add sp, 0x90 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end dp01_getattr_by_ch1_for_opponent_pokemon - - thumb_func_start sub_8065900 -sub_8065900: @ 8065900 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_8065900 - - thumb_func_start sub_806590C -sub_806590C: @ 806590C - push {r4,r5,lr} - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x2 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0 - bne _0806593C - ldr r0, =0x0202406e - lsls r1, r2, 1 - adds r1, r0 - ldrb r0, [r1] - bl sub_8065964 - b _0806595A - .pool -_0806593C: - ldrb r4, [r1] - movs r5, 0 -_08065940: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _0806594E - adds r0, r5, 0 - bl sub_8065964 -_0806594E: - lsrs r4, 1 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _08065940 -_0806595A: - bl sub_8065068 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_806590C - - thumb_func_start sub_8065964 -sub_8065964: @ 8065964 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x38 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r3, =0x02024064 - ldrb r0, [r3] - lsls r0, 9 - ldr r2, =0x02023067 - adds r4, r0, r2 - adds r7, r4, 0 - subs r1, r2, 0x2 - adds r0, r1 - ldrb r0, [r0] - adds r6, r3, 0 - adds r3, r2, 0 - cmp r0, 0x3B - bls _08065992 - bl _08066270 -_08065992: - lsls r0, 2 - ldr r1, =_080659A8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080659A8: - .4byte _08065A98 - .4byte _08065C30 - .4byte _08065C4C - .4byte _08065C68 - .4byte _08065CBC - .4byte _08065CBC - .4byte _08065CBC - .4byte _08065CBC - .4byte _08065CDC - .4byte _08065D44 - .4byte _08065D44 - .4byte _08065D44 - .4byte _08065D44 - .4byte _08066270 - .4byte _08066270 - .4byte _08066270 - .4byte _08066270 - .4byte _08065D6C - .4byte _08065D88 - .4byte _08065DA4 - .4byte _08065DC0 - .4byte _08065DDC - .4byte _08065DF8 - .4byte _08065E14 - .4byte _08065E30 - .4byte _08065E4C - .4byte _08065E68 - .4byte _08065E84 - .4byte _08065EA0 - .4byte _08065EBC - .4byte _08065ED8 - .4byte _08065EF4 - .4byte _08065F68 - .4byte _08065F84 - .4byte _08065FA0 - .4byte _08065FBC - .4byte _08065FD8 - .4byte _08065FF4 - .4byte _08066010 - .4byte _0806602C - .4byte _08066048 - .4byte _08066064 - .4byte _08066080 - .4byte _0806609C - .4byte _080660B8 - .4byte _080660D4 - .4byte _080660F0 - .4byte _0806610C - .4byte _08066128 - .4byte _08066144 - .4byte _08066160 - .4byte _0806617C - .4byte _08066198 - .4byte _080661B4 - .4byte _080661D0 - .4byte _080661EC - .4byte _08066208 - .4byte _08066224 - .4byte _08066240 - .4byte _0806625C -_08065A98: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - adds r2, r7, 0 - bl pokemon_setattr - adds r2, r7, 0 - adds r2, 0x2E - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_setattr - movs r0, 0 - mov r8, r0 - movs r0, 0x3B - adds r0, r7 - mov r10, r0 - adds r0, r7, 0 - adds r0, 0x2B - str r0, [sp, 0x20] - adds r0, 0x19 - str r0, [sp, 0x28] - adds r0, 0x4 - str r0, [sp, 0x2C] - adds r0, 0x4 - str r0, [sp, 0x30] - subs r0, 0x22 - str r0, [sp, 0x1C] - subs r0, 0x2 - str r0, [sp, 0x18] - adds r0, 0x4 - str r0, [sp, 0x24] - adds r0, r7, 0x2 - str r0, [sp, 0x4] - adds r0, r7, 0x4 - str r0, [sp, 0x8] - adds r0, r7, 0x6 - str r0, [sp, 0xC] - adds r0, 0x2 - str r0, [sp, 0x10] - adds r0, 0x2 - str r0, [sp, 0x14] - mov r9, r4 - adds r6, r7, 0 - adds r6, 0x24 - adds r4, r7, 0 - adds r4, 0xC -_08065AFE: - mov r1, r8 - adds r1, 0xD - mov r0, r9 - adds r2, r4, 0 - bl pokemon_setattr - mov r1, r8 - adds r1, 0x11 - mov r0, r9 - adds r2, r6, 0 - bl pokemon_setattr - adds r6, 0x1 - adds r4, 0x2 - movs r0, 0x1 - add r8, r0 - mov r0, r8 - cmp r0, 0x3 - ble _08065AFE - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x15 - mov r2, r10 - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x20 - ldr r2, [sp, 0x20] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x19 - ldr r2, [sp, 0x28] - bl pokemon_setattr - ldrb r0, [r7, 0x14] - lsls r0, 27 - lsrs r0, 27 - mov r1, sp - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x27 - mov r2, sp - bl pokemon_setattr - mov r1, sp - ldrh r0, [r7, 0x14] - lsls r0, 22 - lsrs r0, 27 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x28 - mov r2, sp - bl pokemon_setattr - mov r1, sp - ldrb r0, [r7, 0x15] - lsls r0, 25 - lsrs r0, 27 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x29 - mov r2, sp - bl pokemon_setattr - mov r1, sp - ldr r0, [r7, 0x14] - lsls r0, 12 - lsrs r0, 27 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x2A - mov r2, sp - bl pokemon_setattr - mov r1, sp - ldrh r0, [r7, 0x16] - lsls r0, 23 - lsrs r0, 27 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x2B - mov r2, sp - bl pokemon_setattr - mov r1, sp - ldrb r0, [r7, 0x17] - lsls r0, 26 - lsrs r0, 27 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x2C - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0 - ldr r2, [sp, 0x2C] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x37 - ldr r2, [sp, 0x30] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x38 - ldr r2, [sp, 0x1C] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x39 - ldr r2, [sp, 0x18] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3A - ldr r2, [sp, 0x24] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3B - ldr r2, [sp, 0x4] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3C - ldr r2, [sp, 0x8] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3D - ldr r2, [sp, 0xC] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3E - ldr r2, [sp, 0x10] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3F - ldr r2, [sp, 0x14] - bl pokemon_setattr - b _08066270 - .pool -_08065C30: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0xB - bl pokemon_setattr - b _08066270 - .pool -_08065C4C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0xC - bl pokemon_setattr - b _08066270 - .pool -_08065C68: - movs r0, 0 - mov r8, r0 - movs r0, 0xC - adds r0, r4 - mov r9, r0 - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x02024744 - adds r7, r1, r0 - adds r6, r4, 0 - adds r6, 0x8 -_08065C80: - mov r1, r8 - adds r1, 0xD - adds r0, r7, 0 - adds r2, r4, 0 - bl pokemon_setattr - mov r1, r8 - adds r1, 0x11 - adds r0, r7, 0 - adds r2, r6, 0 - bl pokemon_setattr - adds r6, 0x1 - adds r4, 0x2 - movs r0, 0x1 - add r8, r0 - mov r0, r8 - cmp r0, 0x3 - ble _08065C80 - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x15 - mov r2, r9 - bl pokemon_setattr - b _08066270 - .pool -_08065CBC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldr r3, =0x02023064 - ldrb r2, [r6] - lsls r2, 9 - adds r1, r3, 0x1 - adds r1, r2, r1 - ldrb r1, [r1] - adds r1, 0x9 - b _08065D5A - .pool -_08065CDC: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - adds r0, r4, 0 - movs r1, 0x11 - str r3, [sp, 0x34] - bl pokemon_setattr - ldrb r2, [r6] - lsls r2, 9 - ldr r3, [sp, 0x34] - adds r0, r3, 0x1 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x12 - bl pokemon_setattr - ldrb r2, [r6] - lsls r2, 9 - ldr r3, [sp, 0x34] - adds r0, r3, 0x2 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x13 - bl pokemon_setattr - ldrb r2, [r6] - lsls r2, 9 - ldr r3, [sp, 0x34] - adds r0, r3, 0x3 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x14 - bl pokemon_setattr - ldrb r2, [r6] - lsls r2, 9 - ldr r3, [sp, 0x34] - adds r0, r3, 0x4 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x15 - bl pokemon_setattr - b _08066270 - .pool -_08065D44: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldr r3, =0x02023064 - ldrb r2, [r6] - lsls r2, 9 - adds r1, r3, 0x1 - adds r1, r2, r1 - ldrb r1, [r1] - adds r1, 0x8 -_08065D5A: - adds r3, 0x3 - adds r2, r3 - bl pokemon_setattr - b _08066270 - .pool -_08065D6C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1 - bl pokemon_setattr - b _08066270 - .pool -_08065D88: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x19 - bl pokemon_setattr - b _08066270 - .pool -_08065DA4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1A - bl pokemon_setattr - b _08066270 - .pool -_08065DC0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1B - bl pokemon_setattr - b _08066270 - .pool -_08065DDC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1C - bl pokemon_setattr - b _08066270 - .pool -_08065DF8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1D - bl pokemon_setattr - b _08066270 - .pool -_08065E14: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1E - bl pokemon_setattr - b _08066270 - .pool -_08065E30: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1F - bl pokemon_setattr - b _08066270 - .pool -_08065E4C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x20 - bl pokemon_setattr - b _08066270 - .pool -_08065E68: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x22 - bl pokemon_setattr - b _08066270 - .pool -_08065E84: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x23 - bl pokemon_setattr - b _08066270 - .pool -_08065EA0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x24 - bl pokemon_setattr - b _08066270 - .pool -_08065EBC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x25 - bl pokemon_setattr - b _08066270 - .pool -_08065ED8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x26 - bl pokemon_setattr - b _08066270 - .pool -_08065EF4: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - adds r0, r4, 0 - movs r1, 0x27 - str r3, [sp, 0x34] - bl pokemon_setattr - ldrb r2, [r6] - lsls r2, 9 - ldr r3, [sp, 0x34] - adds r0, r3, 0x1 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x28 - bl pokemon_setattr - ldrb r2, [r6] - lsls r2, 9 - ldr r3, [sp, 0x34] - adds r0, r3, 0x2 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x29 - bl pokemon_setattr - ldrb r2, [r6] - lsls r2, 9 - ldr r3, [sp, 0x34] - adds r0, r3, 0x3 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x2A - bl pokemon_setattr - ldrb r2, [r6] - lsls r2, 9 - ldr r3, [sp, 0x34] - adds r0, r3, 0x4 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x2B - bl pokemon_setattr - ldrb r2, [r6] - lsls r2, 9 - ldr r3, [sp, 0x34] - adds r0, r3, 0x5 - adds r2, r0 - adds r0, r4, 0 - b _08066002 - .pool -_08065F68: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x27 - bl pokemon_setattr - b _08066270 - .pool -_08065F84: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x28 - bl pokemon_setattr - b _08066270 - .pool -_08065FA0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x29 - bl pokemon_setattr - b _08066270 - .pool -_08065FBC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x2A - bl pokemon_setattr - b _08066270 - .pool -_08065FD8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x2B - bl pokemon_setattr - b _08066270 - .pool -_08065FF4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 -_08066002: - movs r1, 0x2C - bl pokemon_setattr - b _08066270 - .pool -_08066010: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0 - bl pokemon_setattr - b _08066270 - .pool -_0806602C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x9 - bl pokemon_setattr - b _08066270 - .pool -_08066048: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x37 - bl pokemon_setattr - b _08066270 - .pool -_08066064: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x38 - bl pokemon_setattr - b _08066270 - .pool -_08066080: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x39 - bl pokemon_setattr - b _08066270 - .pool -_0806609C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3A - bl pokemon_setattr - b _08066270 - .pool -_080660B8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3B - bl pokemon_setattr - b _08066270 - .pool -_080660D4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3C - bl pokemon_setattr - b _08066270 - .pool -_080660F0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3D - bl pokemon_setattr - b _08066270 - .pool -_0806610C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3E - bl pokemon_setattr - b _08066270 - .pool -_08066128: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3F - bl pokemon_setattr - b _08066270 - .pool -_08066144: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x16 - bl pokemon_setattr - b _08066270 - .pool -_08066160: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x17 - bl pokemon_setattr - b _08066270 - .pool -_0806617C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x18 - bl pokemon_setattr - b _08066270 - .pool -_08066198: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x21 - bl pokemon_setattr - b _08066270 - .pool -_080661B4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x2F - bl pokemon_setattr - b _08066270 - .pool -_080661D0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x30 - bl pokemon_setattr - b _08066270 - .pool -_080661EC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x32 - bl pokemon_setattr - b _08066270 - .pool -_08066208: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x33 - bl pokemon_setattr - b _08066270 - .pool -_08066224: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x34 - bl pokemon_setattr - b _08066270 - .pool -_08066240: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x35 - bl pokemon_setattr - b _08066270 - .pool -_0806625C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x36 - bl pokemon_setattr -_08066270: - add sp, 0x38 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8065964 - - thumb_func_start sub_8066284 -sub_8066284: @ 8066284 - push {r4-r7,lr} - ldr r1, =0x0202406e - ldr r7, =0x02024064 - ldrb r2, [r7] - lsls r0, r2, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - adds r3, r1, 0 - muls r3, r0 - ldr r4, =0x02023064 - lsls r2, 9 - adds r0, r4, 0x1 - adds r0, r2, r0 - ldrb r0, [r0] - ldr r1, =0x02024744 - adds r0, r1 - adds r5, r3, r0 - movs r3, 0 - adds r0, r4, 0x2 - adds r2, r0 - ldrb r2, [r2] - cmp r3, r2 - bcs _080662DC - adds r6, r4, 0 - adds r2, r7, 0 - adds r4, r0, 0 -_080662BA: - adds r1, r5, r3 - ldrb r0, [r2] - lsls r0, 9 - adds r0, 0x3 - adds r0, r3, r0 - adds r0, r6 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - ldrb r0, [r2] - lsls r0, 9 - adds r0, r4 - ldrb r0, [r0] - cmp r3, r0 - bcc _080662BA -_080662DC: - bl sub_8065068 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8066284 - - thumb_func_start sub_80662F8 -sub_80662F8: @ 80662F8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r7, =0x0202406e - ldr r6, =0x02024064 - ldrb r0, [r6] - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - movs r1, 0x64 - mov r10, r1 - mov r2, r10 - muls r2, r0 - adds r0, r2, 0 - ldr r1, =0x02024744 - mov r9, r1 - add r0, r9 - movs r1, 0xB - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldrb r1, [r6] - lsls r0, r1, 1 - adds r0, r7 - ldrh r0, [r0] - mov r2, r10 - muls r2, r0 - adds r0, r2, 0 - add r0, r9 - bl sub_805DC0C - ldrb r0, [r6] - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_806A068 - ldr r0, =0x0202499c - mov r8, r0 - ldrb r0, [r6] - movs r1, 0x2 - bl sub_80A5C6C - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldrb r0, [r6] - bl sub_80A6138 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldrb r0, [r6] - bl sub_80A82E4 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - mov r0, r8 - adds r1, r5, 0 - adds r2, r4, 0 - bl AddObjectToFront - ldr r4, =0x020241e4 - ldrb r1, [r6] - adds r1, r4 - strb r0, [r1] - ldr r5, =0x02020630 - ldrb r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =0x0000ff10 - strh r1, [r0, 0x24] - ldrb r2, [r6] - adds r0, r2, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x2E] - ldrb r3, [r6] - adds r0, r3, r4 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - lsls r3, 4 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x5] - ldrb r2, [r6] - adds r4, r2, r4 - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =0x020244e4 - adds r2, r1 - ldrb r1, [r2] - bl StartObjectImageAnim - ldrb r4, [r6] - lsls r0, r4, 1 - adds r0, r7 - ldrh r0, [r0] - mov r1, r10 - muls r1, r0 - adds r0, r1, 0 - add r0, r9 - movs r1, 0xB - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_805EE54 - ldr r1, =0x03005d60 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8064B04 - str r1, [r0] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80662F8 - - thumb_func_start sub_8066448 -sub_8066448: @ 8066448 - push {r4,lr} - ldr r1, =0x0202406e - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r2, r0, 1 - adds r2, r1 - ldr r3, =0x02023064 - lsls r0, 9 - adds r1, r3, 0x1 - adds r0, r1 - ldrb r0, [r0] - strh r0, [r2] - ldrb r0, [r4] - lsls r1, r0, 9 - adds r3, 0x2 - adds r1, r3 - ldrb r1, [r1] - bl sub_8066494 - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8064F40 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8066448 - - thumb_func_start sub_8066494 -sub_8066494: @ 8066494 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - lsls r1, 24 - lsrs r1, 24 - adds r0, r6, 0 - bl sub_805EF84 - ldr r0, =0x0202406e - lsls r4, r6, 1 - adds r4, r0 - ldr r0, =0x02023064 - lsls r1, r6, 9 - adds r0, 0x1 - adds r1, r0 - ldrb r0, [r1] - strh r0, [r4] - ldrh r0, [r4] - movs r1, 0x64 - mov r9, r1 - mov r1, r9 - muls r1, r0 - adds r0, r1, 0 - ldr r5, =0x02024744 - adds r0, r5 - movs r1, 0xB - bl pokemon_getattr - mov r8, r0 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldr r0, =sub_805D714 - bl object_new_hidden_with_callback - ldr r1, =0x03005d7c - mov r10, r1 - add r10, r6 - mov r1, r10 - strb r0, [r1] - ldrh r0, [r4] - mov r1, r9 - muls r1, r0 - adds r0, r1, 0 - adds r0, r5 - adds r1, r6, 0 - bl sub_805DC0C - adds r0, r6, 0 - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, r8 - bl sub_806A068 - ldr r0, =0x0202499c - mov r9, r0 - adds r0, r6, 0 - movs r1, 0x2 - bl sub_80A5C6C - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - adds r0, r6, 0 - bl sub_80A6138 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r6, 0 - bl sub_80A82E4 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - mov r0, r9 - adds r1, r5, 0 - adds r2, r4, 0 - bl AddObjectToFront - ldr r4, =0x020241e4 - adds r4, r6, r4 - strb r0, [r4] - ldr r5, =0x02020630 - mov r0, r10 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r1, [r4] - strh r1, [r0, 0x30] - mov r0, r10 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r6, [r0, 0x32] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r6, [r0, 0x2E] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - mov r1, r8 - strh r1, [r0, 0x32] - ldrb r0, [r4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - lsls r3, r6, 4 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x5] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =0x020244e4 - adds r6, r1 - ldrb r1, [r6] - bl StartObjectImageAnim - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r5, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =DummyObjectCallback - str r1, [r0] - movs r0, 0 - movs r1, 0xFE - bl sub_80753E8 - mov r1, r10 - ldrb r2, [r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r5 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1, 0x2E] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8066494 - - thumb_func_start sub_8066624 -sub_8066624: @ 8066624 - push {r4-r6,lr} - ldr r1, =0x02023064 - ldr r6, =0x02024064 - ldrb r2, [r6] - lsls r0, r2, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r3, [r0] - cmp r3, 0 - bne _0806666C - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - strb r3, [r0, 0x4] - ldr r1, =0x03005d60 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_80666BC - str r1, [r0] - b _080666A8 - .pool -_0806666C: - ldr r5, =0x020241e4 - adds r0, r2, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl obj_free_rotscale_entry - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldrb r0, [r6] - bl sub_805EEE0 - ldr r1, =0x03005d70 - ldrb r0, [r6] - adds r0, r1 - ldrb r0, [r0] - bl sub_8072984 - bl sub_8065068 -_080666A8: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8066624 - - thumb_func_start sub_80666BC -sub_80666BC: @ 80666BC - push {r4-r6,lr} - ldr r6, =0x020244d0 - ldr r4, [r6] - ldr r5, =0x02024064 - ldrb r2, [r5] - ldr r1, [r4, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r3, r0, r1 - ldrb r0, [r3, 0x4] - cmp r0, 0 - beq _080666E4 - cmp r0, 0x1 - beq _08066712 - b _0806673A - .pool -_080666E4: - ldr r1, [r4] - lsls r0, r2, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080666FE - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x5 - bl move_anim_start_t4 -_080666FE: - ldr r0, [r6] - ldrb r1, [r5] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x1 - strb r1, [r0, 0x4] - b _0806673A -_08066712: - ldrb r1, [r3] - movs r0, 0x40 - ands r0, r1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _0806673A - strb r0, [r3, 0x4] - ldrb r2, [r5] - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x2 - bl move_anim_start_t4 - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8064C58 - str r1, [r0] -_0806673A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80666BC - - thumb_func_start sub_8066748 -sub_8066748: @ 8066748 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r4, =0x02022fec - ldr r0, [r4] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08066840 - ldr r5, =0x02024064 - ldrb r0, [r5] - bl battle_get_per_side_status - movs r1, 0x2 - ands r1, r0 - movs r7, 0xC8 - cmp r1, 0 - beq _08066770 - movs r7, 0x98 -_08066770: - ldr r0, [r4] - movs r1, 0x80 - lsls r1, 1 - ands r0, r1 - cmp r0, 0 - beq _080667A8 - ldrb r0, [r5] - cmp r0, 0x1 - bne _08066794 - ldr r0, =0x02038bca - b _08066796 - .pool -_08066794: - ldr r0, =0x02038bcc -_08066796: - ldrh r0, [r0] - bl sub_8162AA0 - lsls r0, 24 - lsrs r0, 24 - b _0806694C - .pool -_080667A8: - ldrb r0, [r5] - bl sub_806D864 - ldr r6, =0x020229e8 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - movs r4, 0xFF - ldrb r0, [r1] - cmp r0, 0x4 - beq _080667D8 - ldrb r0, [r5] - bl sub_806D864 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - ldrh r1, [r1] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0x5 - bne _080667F4 -_080667D8: - ldrb r0, [r5] - bl sub_806D864 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r0, [r1, 0x13] - cmp r0, 0 - bne _080668AA - b _080668BC - .pool -_080667F4: - ldrb r0, [r5] - bl sub_806D864 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - ldrh r1, [r1] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0x2 - beq _08066822 - ldrb r0, [r5] - bl sub_806D864 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - ldrh r0, [r1] - ands r4, r0 - cmp r4, 0x1 - bne _08066838 -_08066822: - ldrb r0, [r5] - bl sub_806D864 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r0, [r1, 0x13] - cmp r0, 0 - bne _08066916 - b _08066924 -_08066838: - ldrb r0, [r5] - bl sub_806D864 - b _0806693A -_08066840: - movs r7, 0xB0 - ldr r0, =0x02038bca - ldrh r1, [r0] - movs r0, 0xC0 - lsls r0, 4 - cmp r1, r0 - bne _08066858 - bl sub_8068B48 - b _08066948 - .pool -_08066858: - bl link_get_multiplayer_id - ldr r6, =0x020229e8 - movs r5, 0x1 - eors r0, r5 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - movs r4, 0xFF - ldrb r0, [r1] - cmp r0, 0x4 - beq _08066892 - bl link_get_multiplayer_id - eors r0, r5 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - ldrh r1, [r1] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0x5 - bne _080668C8 -_08066892: - bl link_get_multiplayer_id - eors r0, r5 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r0, [r1, 0x13] - cmp r0, 0 - beq _080668BC -_080668AA: - ldr r0, =gTrainerPicIndices - adds r0, 0x4F - ldrb r0, [r0] - b _0806694C - .pool -_080668BC: - ldr r0, =gTrainerPicIndices - adds r0, 0x4E - ldrb r0, [r0] - b _0806694C - .pool -_080668C8: - bl link_get_multiplayer_id - eors r0, r5 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - ldrh r1, [r1] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0x2 - beq _080668FE - bl link_get_multiplayer_id - eors r0, r5 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - ldrh r0, [r1] - ands r4, r0 - cmp r4, 0x1 - bne _08066930 -_080668FE: - bl link_get_multiplayer_id - eors r0, r5 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r0, [r1, 0x13] - cmp r0, 0 - beq _08066924 -_08066916: - ldr r0, =gTrainerPicIndices - adds r0, 0x51 - ldrb r0, [r0] - b _0806694C - .pool -_08066924: - ldr r0, =gTrainerPicIndices - adds r0, 0x50 - ldrb r0, [r0] - b _0806694C - .pool -_08066930: - bl link_get_multiplayer_id - eors r0, r5 - lsls r0, 24 - lsrs r0, 24 -_0806693A: - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r0, [r1, 0x13] - bl sub_806F000 -_08066948: - lsls r0, 16 - lsrs r0, 16 -_0806694C: - mov r8, r0 - ldr r5, =0x02024064 - ldrb r1, [r5] - bl sub_805DF38 - ldrb r0, [r5] - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, r8 - bl template_build_for_pokemon_or_trainer - ldr r6, =0x0202499c - mov r9, r7 - ldr r1, =gUnknown_083054E0 - mov r2, r8 - lsls r0, r2, 2 - adds r0, r1 - ldrb r0, [r0] - movs r4, 0x8 - subs r4, r0 - lsls r4, 18 - movs r0, 0xA0 - lsls r0, 14 - adds r4, r0 - asrs r4, 16 - ldrb r0, [r5] - bl sub_80A82E4 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r6, 0 - mov r1, r9 - adds r2, r4, 0 - bl AddObjectToFront - ldr r6, =0x020241e4 - ldrb r1, [r5] - adds r1, r6 - strb r0, [r1] - ldr r4, =0x02020630 - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =0x0000ff10 - strh r1, [r0, 0x24] - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x2 - strh r1, [r0, 0x2E] - ldr r1, =gTrainerFrontPicPaletteTable - mov r2, r8 - lsls r0, r2, 3 - adds r0, r1 - ldrh r0, [r0, 0x4] - bl IndexOfObjectPaletteTag - ldrb r1, [r5] - adds r1, r6 - ldrb r1, [r1] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - adds r2, r4 - lsls r0, 4 - ldrb r3, [r2, 0x5] - movs r1, 0xF - ands r1, r3 - orrs r1, r0 - strb r1, [r2, 0x5] - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - mov r1, r8 - strh r1, [r0, 0x6] - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, 0x1C - adds r0, r4 - ldr r1, =sub_805D7AC - str r1, [r0] - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8064400 - str r1, [r0] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8066748 - - thumb_func_start sub_8066A58 -sub_8066A58: @ 8066A58 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r0, =0x02024064 - ldrb r0, [r0] - cmp r0, 0x1 - bne _08066A74 - ldr r0, =0x02038bca - b _08066A76 - .pool -_08066A74: - ldr r0, =0x02038bcc -_08066A76: - ldrh r0, [r0] - bl sub_8162AA0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r6, =0x02024064 - ldrb r1, [r6] - bl sub_805DF38 - ldrb r0, [r6] - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, r8 - bl template_build_for_pokemon_or_trainer - ldr r0, =0x0202499c - ldr r2, =gUnknown_083054E0 - mov r3, r8 - lsls r1, r3, 2 - adds r1, r2 - ldrb r1, [r1] - movs r2, 0x8 - subs r2, r1 - lsls r2, 18 - movs r1, 0xA0 - lsls r1, 14 - adds r2, r1 - asrs r2, 16 - movs r1, 0xB0 - movs r3, 0x1E - bl AddObjectToFront - ldr r5, =0x020241e4 - ldrb r1, [r6] - adds r1, r5 - strb r0, [r1] - ldr r4, =0x02020630 - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x60 - strh r1, [r0, 0x24] - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x20] - adds r1, 0x20 - strh r1, [r0, 0x20] - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =0x0000fffe - strh r1, [r0, 0x2E] - ldr r1, =gTrainerFrontPicPaletteTable - mov r2, r8 - lsls r0, r2, 3 - adds r0, r1 - ldrh r0, [r0, 0x4] - bl IndexOfObjectPaletteTag - ldrb r1, [r6] - adds r1, r5 - ldrb r1, [r1] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - adds r2, r4 - lsls r0, 4 - ldrb r3, [r2, 0x5] - movs r1, 0xF - ands r1, r3 - orrs r1, r0 - strb r1, [r2, 0x5] - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - mov r3, r8 - strh r3, [r0, 0x6] - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, 0x1C - adds r0, r4 - ldr r1, =sub_805D7AC - str r1, [r0] - ldr r1, =0x03005d60 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8064438 - str r1, [r0] - bl sub_8065068 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8066A58 - - thumb_func_start sub_8066B94 -sub_8066B94: @ 8066B94 - push {r4-r6,lr} - ldr r6, =0x020241e4 - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =0x02020630 - adds r0, r5 - bl oamt_add_pos2_onto_pos1 - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x23 - strh r1, [r0, 0x2E] - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x8C - lsls r1, 1 - strh r1, [r0, 0x32] - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrh r1, [r0, 0x22] - strh r1, [r0, 0x36] - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r5, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_80A6EEC - str r1, [r0] - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =DummyObjectCallback - bl oamt_set_x3A_32 - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8064470 - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8066B94 - - thumb_func_start sub_8066C40 -sub_8066C40: @ 8066C40 - push {r4-r6,lr} - ldr r6, =0x020244d0 - ldr r4, [r6] - ldr r5, =0x02024064 - ldrb r2, [r5] - ldr r0, [r4, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r3, r1, r0 - ldrb r0, [r3, 0x4] - cmp r0, 0 - bne _08066C94 - ldr r1, [r4] - lsls r0, r2, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08066C74 - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x5 - bl move_anim_start_t4 -_08066C74: - ldr r0, [r6] - ldrb r1, [r5] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x4] - adds r1, 0x1 - strb r1, [r0, 0x4] - b _08066CD0 - .pool -_08066C94: - ldrb r1, [r3] - movs r0, 0x40 - ands r0, r1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08066CD0 - strb r0, [r3, 0x4] - movs r0, 0x10 - movs r1, 0x3F - bl audio_play_and_stuff - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldrb r0, [r5] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_8039934 - str r1, [r0] - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8064C14 - str r1, [r0] -_08066CD0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8066C40 - - thumb_func_start sub_8066CEC -sub_8066CEC: @ 8066CEC - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_8066CEC - - thumb_func_start sub_8066CF8 -sub_8066CF8: @ 8066CF8 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_8066CF8 - - thumb_func_start sub_8066D04 -sub_8066D04: @ 8066D04 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_8066D04 - - thumb_func_start sub_8066D10 -sub_8066D10: @ 8066D10 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_8066D10 - - thumb_func_start sub_8066D1C -sub_8066D1C: @ 8066D1C - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r5, =0x02024064 - ldrb r0, [r5] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - beq _08066D32 - b _08066E58 -_08066D32: - ldr r0, =0x02023064 - mov r12, r0 - ldrb r1, [r5] - lsls r1, 9 - adds r0, 0x1 - adds r0, r1, r0 - ldrb r6, [r0] - mov r0, r12 - adds r0, 0x2 - adds r0, r1, r0 - ldrb r0, [r0] - lsls r0, 8 - orrs r6, r0 - ldr r0, =0x02038432 - mov r8, r0 - mov r0, r12 - adds r0, 0x3 - adds r1, r0 - ldrb r0, [r1] - mov r1, r8 - strb r0, [r1] - ldr r3, =0x02038408 - ldrb r1, [r5] - lsls r1, 9 - mov r0, r12 - adds r0, 0x4 - adds r0, r1, r0 - ldrb r2, [r0] - mov r0, r12 - adds r0, 0x5 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 8 - orrs r2, r0 - strh r2, [r3] - ldr r3, =0x02038404 - ldrb r1, [r5] - lsls r1, 9 - mov r0, r12 - adds r0, 0x6 - adds r0, r1, r0 - ldrb r2, [r0] - mov r0, r12 - adds r0, 0x7 - adds r0, r1, r0 - ldrb r0, [r0] - lsls r0, 8 - orrs r2, r0 - mov r0, r12 - adds r0, 0x8 - adds r0, r1, r0 - ldrb r0, [r0] - lsls r0, 16 - orrs r2, r0 - mov r0, r12 - adds r0, 0x9 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 24 - orrs r2, r0 - str r2, [r3] - ldr r2, =0x0203841a - ldrb r0, [r5] - lsls r0, 9 - mov r1, r12 - adds r1, 0xA - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - ldr r4, =0x0203841c - ldrb r1, [r5] - lsls r1, 9 - mov r0, r12 - adds r0, 0xC - adds r0, r1, r0 - ldrb r2, [r0] - mov r0, r12 - adds r0, 0xD - adds r1, r0 - ldrb r0, [r1] - lsls r0, 8 - orrs r2, r0 - strh r2, [r4] - ldr r7, =0x02038400 - ldrb r1, [r5] - lsls r1, 9 - mov r0, r12 - adds r0, 0x10 - adds r1, r0 - str r1, [r7] - ldr r2, =0x020244bc - ldrb r0, [r5] - lsls r0, 2 - adds r0, r2 - ldr r1, [r1] - str r1, [r0] - mov r0, r8 - ldrb r1, [r0] - adds r0, r6, 0 - bl sub_805DB8C - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - beq _08066E30 - bl sub_8065068 - b _08066E58 - .pool -_08066E30: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldrb r1, [r5] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strb r3, [r0, 0x4] - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8066E70 - str r1, [r0] - ldrh r1, [r4] - ldr r2, [r7] - adds r0, r6, 0 - bl sub_817E0FC -_08066E58: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8066D1C - - thumb_func_start sub_8066E70 -sub_8066E70: @ 8066E70 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r2, =0x02023064 - ldr r6, =0x02024064 - ldrb r3, [r6] - lsls r1, r3, 9 - adds r0, r2, 0x1 - mov r10, r0 - adds r0, r1, r0 - ldrb r4, [r0] - adds r5, r2, 0x2 - mov r9, r5 - adds r0, r1, r5 - ldrb r0, [r0] - lsls r0, 8 - orrs r4, r0 - adds r2, 0xB - adds r1, r2 - ldrb r1, [r1] - mov r8, r1 - ldr r7, =0x020244d0 - ldr r5, [r7] - ldr r1, [r5, 0x4] - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r2, [r0, 0x4] - cmp r2, 0x1 - beq _08066F08 - cmp r2, 0x1 - bgt _08066EC8 - cmp r2, 0 - beq _08066ED2 - b _08066FE4 - .pool -_08066EC8: - cmp r2, 0x2 - beq _08066F32 - cmp r2, 0x3 - beq _08066FA8 - b _08066FE4 -_08066ED2: - ldr r1, [r5] - lsls r0, r3, 2 - adds r1, r0, r1 - ldrb r2, [r1] - movs r0, 0xC - ands r0, r2 - cmp r0, 0x4 - bne _08066EF4 - movs r0, 0x8 - orrs r0, r2 - strb r0, [r1] - ldrb r2, [r6] - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x5 - bl move_anim_start_t4 -_08066EF4: - ldr r0, [r7] - ldrb r1, [r6] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x1 - strb r1, [r0, 0x4] - b _08066FE4 -_08066F08: - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _08066FE4 - movs r0, 0 - bl sub_805EB9C - adds r0, r4, 0 - bl move_anim_start_t1 - ldr r0, [r7] - ldrb r1, [r6] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x2 - strb r1, [r0, 0x4] - b _08066FE4 -_08066F32: - ldr r0, =0x020383f8 - ldr r0, [r0] - bl _call_via_r0 - ldr r0, =0x020383fd - ldrb r0, [r0] - cmp r0, 0 - bne _08066FE4 - movs r0, 0x1 - bl sub_805EB9C - ldr r0, [r7] - ldrb r2, [r6] - ldr r1, [r0] - lsls r0, r2, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08066F80 - mov r0, r8 - cmp r0, 0x1 - bhi _08066F80 - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x6 - bl move_anim_start_t4 - ldr r0, [r7] - ldrb r1, [r6] - ldr r0, [r0] - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - strb r0, [r1] -_08066F80: - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x3 - strb r1, [r0, 0x4] - b _08066FE4 - .pool -_08066FA8: - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _08066FE4 - bl sub_805E394 - ldrb r0, [r6] - lsls r2, r0, 9 - mov r3, r10 - adds r1, r2, r3 - ldrb r1, [r1] - add r2, r9 - ldrb r2, [r2] - lsls r2, 8 - orrs r1, r2 - bl sub_805E94C - ldr r0, [r7] - ldrb r1, [r6] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strb r4, [r0, 0x4] - bl sub_8065068 -_08066FE4: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8066E70 - - thumb_func_start sub_8066FF4 -sub_8066FF4: @ 8066FF4 - push {r4,r5,lr} - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r5, =0x02024064 - ldrb r4, [r5] - lsls r4, 9 - ldr r0, =0x02023066 - adds r4, r0 - ldrh r0, [r4] - bl battle_pick_message - ldr r0, =0x02022e2c - movs r1, 0 - bl battle_show_message_maybe - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8064CCC - str r1, [r0] - ldrh r0, [r4] - bl sub_817C95C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8066FF4 - - thumb_func_start sub_806704C -sub_806704C: @ 806704C - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_806704C - - thumb_func_start sub_8067058 -sub_8067058: @ 8067058 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_8067058 - - thumb_func_start sub_8067064 -sub_8067064: @ 8067064 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_8067064 - - thumb_func_start sub_8067070 -sub_8067070: @ 8067070 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_8067070 - - thumb_func_start sub_806707C -sub_806707C: @ 806707C - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_806707C - - thumb_func_start sub_8067088 -sub_8067088: @ 8067088 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_8067088 - - thumb_func_start sub_8067094 -sub_8067094: @ 8067094 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_8067094 - - thumb_func_start sub_80670A0 -sub_80670A0: @ 80670A0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - movs r0, 0 - bl load_gfxc_health_bar - ldr r3, =0x02023064 - ldr r0, =0x02024064 - mov r9, r0 - ldrb r4, [r0] - lsls r2, r4, 9 - adds r0, r3, 0x2 - adds r0, r2, r0 - ldrb r1, [r0] - adds r3, 0x3 - adds r2, r3 - ldrb r0, [r2] - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - asrs r7, r1, 16 - ldr r0, =0x00007fff - cmp r7, r0 - beq _08067130 - ldr r6, =0x0202406e - lsls r0, r4, 1 - adds r0, r6 - ldrh r0, [r0] - movs r5, 0x64 - muls r0, r5 - ldr r4, =0x02024744 - adds r0, r4 - movs r1, 0x3A - bl pokemon_getattr - mov r8, r0 - mov r1, r9 - ldrb r0, [r1] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - muls r0, r5 - adds r0, r4 - movs r1, 0x39 - bl pokemon_getattr - adds r3, r0, 0 - mov r1, r9 - ldrb r0, [r1] - ldr r1, =0x03005d70 - adds r1, r0, r1 - ldrb r1, [r1] - str r7, [sp] - mov r2, r8 - bl sub_807294C - b _0806715A - .pool -_08067130: - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3A - bl pokemon_getattr - adds r2, r0, 0 - mov r1, r9 - ldrb r0, [r1] - ldr r1, =0x03005d70 - adds r1, r0, r1 - ldrb r1, [r1] - str r7, [sp] - movs r3, 0 - bl sub_807294C -_0806715A: - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8064BC0 - str r1, [r0] - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80670A0 - - thumb_func_start sub_8067190 -sub_8067190: @ 8067190 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_8067190 - - thumb_func_start sub_806719C -sub_806719C: @ 806719C - push {r4,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _080671F0 - ldr r0, =0x03005d70 - ldrb r1, [r4] - adds r0, r1, r0 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x02024744 - adds r1, r2 - movs r2, 0x9 - bl healthbar_draw_field_maybe - ldrb r2, [r4] - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x11 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8065008 - str r1, [r0] -_080671F0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806719C - - thumb_func_start sub_8067214 -sub_8067214: @ 8067214 - push {r4,r5,lr} - ldr r5, =0x02024064 - ldrb r0, [r5] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _08067264 - ldr r4, =0x02023064 - ldrb r3, [r5] - lsls r3, 9 - adds r0, r4, 0x1 - adds r0, r3, r0 - ldrb r0, [r0] - adds r1, r4, 0x2 - adds r1, r3, r1 - ldrb r1, [r1] - adds r2, r4, 0x3 - adds r2, r3, r2 - ldrb r2, [r2] - lsls r2, 8 - orrs r1, r2 - adds r2, r4, 0x4 - adds r2, r3, r2 - ldrb r2, [r2] - lsls r2, 16 - orrs r1, r2 - adds r4, 0x5 - adds r3, r4 - ldrb r2, [r3] - lsls r2, 24 - orrs r1, r2 - bl move_anim_start_t2_for_situation - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8065008 - str r1, [r0] -_08067264: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8067214 - - thumb_func_start sub_806727C -sub_806727C: @ 806727C - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_806727C - - thumb_func_start sub_8067288 -sub_8067288: @ 8067288 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_8067288 - - thumb_func_start sub_8067294 -sub_8067294: @ 8067294 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_8067294 - - thumb_func_start sub_80672A0 -sub_80672A0: @ 80672A0 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_80672A0 - - thumb_func_start sub_80672AC -sub_80672AC: @ 80672AC - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_80672AC - - thumb_func_start sub_80672B8 -sub_80672B8: @ 80672B8 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_80672B8 - - thumb_func_start sub_80672C4 -sub_80672C4: @ 80672C4 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_80672C4 - - thumb_func_start sub_80672D0 -sub_80672D0: @ 80672D0 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_80672D0 - - thumb_func_start sub_80672DC -sub_80672DC: @ 80672DC - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_80672DC - - thumb_func_start sub_80672E8 -sub_80672E8: @ 80672E8 - push {lr} - ldr r2, =0x02022d0c - ldrb r1, [r2] - movs r0, 0x80 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - bl sub_8065068 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80672E8 - - thumb_func_start sub_8067304 -sub_8067304: @ 8067304 - push {lr} - ldr r3, =0x02022d0c - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - movs r1, 0x7F - ands r1, r0 - ldrb r2, [r3] - movs r0, 0x80 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - bl sub_8065068 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8067304 - - thumb_func_start sub_806733C -sub_806733C: @ 806733C - push {lr} - ldr r2, =0x02022d0c - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - bl sub_8065068 - pop {r0} - bx r0 - .pool - thumb_func_end sub_806733C - - thumb_func_start sub_8067354 -sub_8067354: @ 8067354 - push {lr} - ldr r3, =0x02022d0c - ldr r1, [r3] - lsls r1, 24 - lsrs r1, 31 - movs r0, 0x1 - eors r1, r0 - lsls r1, 7 - ldrb r2, [r3] - movs r0, 0x7F - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - bl sub_8065068 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8067354 - - thumb_func_start sub_806737C -sub_806737C: @ 806737C - push {r4,lr} - ldr r3, =0x02020630 - ldr r2, =0x020241e4 - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - bge _080673B0 - bl sub_8065068 - b _080673DA - .pool -_080673B0: - ldr r1, =0x020244b9 - movs r0, 0x1 - strb r0, [r1] - ldrb r0, [r4] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0 - strh r1, [r0, 0x30] - ldrb r0, [r4] - bl sub_80769F4 - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8064CE4 - str r1, [r0] -_080673DA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806737C - - thumb_func_start sub_80673EC -sub_80673EC: @ 80673EC - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_80673EC - - thumb_func_start sub_80673F8 -sub_80673F8: @ 80673F8 - push {r4,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - movs r3, 0x3F - cmp r0, 0 - bne _0806740C - movs r3, 0xC0 -_0806740C: - ldr r2, =0x02023064 - ldrb r1, [r4] - lsls r1, 9 - adds r0, r2, 0x1 - adds r0, r1, r0 - ldrb r0, [r0] - adds r2, 0x2 - adds r1, r2 - ldrb r1, [r1] - lsls r1, 8 - orrs r0, r1 - lsls r1, r3, 24 - asrs r1, 24 - bl audio_play_and_stuff - bl sub_8065068 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80673F8 - - thumb_func_start sub_806743C -sub_806743C: @ 806743C - push {r4,r5,lr} - ldr r4, =0x02023064 - ldr r5, =0x02024064 - ldrb r0, [r5] - lsls r3, r0, 9 - adds r0, r4, 0x3 - adds r0, r3, r0 - ldrb r0, [r0] - cmp r0, 0 - beq _08067478 - bl sub_805EA60 - ldrb r1, [r5] - lsls r1, 9 - adds r0, r4, 0x1 - adds r0, r1, r0 - ldrb r0, [r0] - adds r2, r4, 0x2 - adds r1, r2 - ldrb r1, [r1] - lsls r1, 8 - orrs r0, r1 - bl song_play_for_text - b _0806748C - .pool -_08067478: - adds r0, r4, 0x1 - adds r0, r3, r0 - ldrb r0, [r0] - adds r1, r4, 0x2 - adds r1, r3, r1 - ldrb r1, [r1] - lsls r1, 8 - orrs r0, r1 - bl fanfare_play -_0806748C: - bl sub_8065068 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_806743C - - thumb_func_start sub_8067498 -sub_8067498: @ 8067498 - push {lr} - ldr r1, =0x0202406e - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x19 - movs r2, 0x5 - bl sub_80A32E4 - bl sub_8065068 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8067498 - - thumb_func_start sub_80674D4 -sub_80674D4: @ 80674D4 - push {lr} - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - bl battle_intro_launch - ldr r2, =0x020243fc - ldrh r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strh r0, [r2] - bl sub_8065068 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80674D4 - - thumb_func_start sub_8067508 -sub_8067508: @ 8067508 - push {r4-r6,lr} - ldr r5, =0x020241e4 - ldr r6, =0x02024064 - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl oamt_add_pos2_onto_pos1 - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x23 - strh r1, [r0, 0x2E] - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x8C - lsls r1, 1 - strh r1, [r0, 0x32] - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x22] - strh r1, [r0, 0x36] - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_80A6EEC - str r1, [r0] - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_80676FC - bl oamt_set_x3A_32 - ldr r0, =c3_08038DC4 - movs r1, 0x5 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r4 - ldrb r0, [r6] - strh r0, [r1, 0x8] - ldr r3, =0x020244d0 - ldr r0, [r3] - ldrb r2, [r6] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080675CA - ldr r0, =0x020244b4 - adds r0, r2, r0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - ldr r1, =sub_8073C30 - str r1, [r0] -_080675CA: - ldr r0, [r3] - ldr r2, [r0, 0x8] - ldrb r0, [r2, 0x9] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x9] - ldr r1, =0x03005d60 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =nullsub_28 - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8067508 - - thumb_func_start c3_08038DC4 -c3_08038DC4: @ 8067618 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r7, =0x02024064 - ldrb r0, [r7] - mov r9, r0 - ldr r1, =0x03005e00 - mov r2, r8 - lsls r0, r2, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldrh r0, [r0, 0x8] - strb r0, [r7] - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08067652 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08067684 -_08067652: - ldr r0, =0x02023064 - ldrb r1, [r7] - lsls r2, r1, 9 - adds r0, 0x1 - adds r2, r0 - ldr r0, =0x0202406e - lsls r1, 1 - adds r1, r0 - ldrh r0, [r1] - strb r0, [r2] - ldrb r0, [r7] - movs r1, 0 - bl sub_8066494 - b _080676C4 - .pool -_08067684: - ldr r4, =0x02023064 - ldrb r0, [r7] - lsls r1, r0, 9 - adds r4, 0x1 - adds r1, r4 - ldr r6, =0x0202406e - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - strb r0, [r1] - ldrb r0, [r7] - movs r1, 0 - bl sub_8066494 - ldrb r0, [r7] - movs r5, 0x2 - eors r0, r5 - strb r0, [r7] - ldrb r0, [r7] - lsls r1, r0, 9 - adds r1, r4 - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - strb r0, [r1] - ldrb r0, [r7] - movs r1, 0 - bl sub_8066494 - ldrb r0, [r7] - eors r0, r5 - strb r0, [r7] -_080676C4: - ldr r1, =0x03005d60 - ldr r2, =0x02024064 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8064734 - str r1, [r0] - mov r0, r9 - strb r0, [r2] - mov r0, r8 - bl remove_task - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end c3_08038DC4 - - thumb_func_start sub_80676FC -sub_80676FC: @ 80676FC - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x6] - bl sub_805DFE4 - adds r0, r4, 0 - bl obj_free_rotscale_entry - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80676FC - - thumb_func_start sub_8067718 -sub_8067718: @ 8067718 - push {r4-r7,lr} - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _08067748 - adds r0, r2, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08067748 - bl sub_8065068 - b _08067812 - .pool -_08067748: - ldr r4, =0x020244d0 - ldr r0, [r4] - ldr r3, =0x02024064 - ldrb r1, [r3] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] - ldr r1, =0x02023064 - ldrb r2, [r3] - lsls r0, r2, 9 - adds r1, 0x2 - adds r0, r1 - ldrb r0, [r0] - adds r7, r3, 0 - cmp r0, 0 - beq _080677B4 - ldr r0, [r4] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r3, r0, r1 - ldrb r2, [r3, 0x1] - lsls r1, r2, 27 - lsrs r0, r1, 28 - cmp r0, 0x1 - bhi _080677AC - adds r0, 0x1 - movs r1, 0xF - ands r0, r1 - lsls r0, 1 - movs r1, 0x1F - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x1] - b _08067812 - .pool -_080677AC: - movs r0, 0x1F - negs r0, r0 - ands r0, r2 - strb r0, [r3, 0x1] -_080677B4: - adds r5, r7, 0 - ldrb r0, [r5] - lsls r3, r0, 9 - ldr r4, =0x02023068 - adds r1, r3, r4 - subs r2, r4, 0x3 - adds r2, r3, r2 - ldrb r2, [r2] - subs r4, 0x2 - adds r3, r4 - ldrb r3, [r3] - bl sub_80735DC - ldr r2, =0x020244b4 - ldrb r1, [r5] - adds r1, r2 - movs r3, 0 - strb r0, [r1] - ldr r6, =0x020244d0 - ldr r0, [r6] - ldrb r1, [r5] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strb r3, [r0, 0x5] - ldrb r2, [r5] - lsls r0, r2, 9 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - beq _08067806 - ldr r0, [r6] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - movs r1, 0x5D - strb r1, [r0, 0x5] -_08067806: - ldr r0, =0x03005d60 - ldrb r1, [r7] - lsls r1, 2 - adds r1, r0 - ldr r0, =sub_806782C - str r0, [r1] -_08067812: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8067718 - - thumb_func_start sub_806782C -sub_806782C: @ 806782C - push {r4,lr} - ldr r4, =0x020244d0 - ldr r0, [r4] - ldr r3, =0x02024064 - ldrb r1, [r3] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x5] - adds r2, r1, 0x1 - strb r2, [r0, 0x5] - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x5C - bls _08067864 - ldr r0, [r4] - ldrb r1, [r3] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strb r1, [r0, 0x5] - bl sub_8065068 -_08067864: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806782C - - thumb_func_start sub_8067874 -sub_8067874: @ 8067874 - push {lr} - ldr r0, =0x020244d0 - ldr r1, [r0] - ldr r0, =0x02024064 - ldrb r3, [r0] - ldr r1, [r1, 0x4] - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080678A6 - ldr r2, =0x03005e00 - ldr r0, =0x020244b4 - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldr r1, =sub_8073C30 - str r1, [r0] -_080678A6: - bl sub_8065068 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8067874 - - thumb_func_start sub_80678C4 -sub_80678C4: @ 80678C4 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_80678C4 - - thumb_func_start sub_80678D0 -sub_80678D0: @ 80678D0 - push {r4,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - bl sub_80A6A90 - lsls r0, 24 - cmp r0, 0 - beq _08067916 - ldr r3, =0x02020630 - ldr r0, =0x020241e4 - ldrb r1, [r4] - adds r0, r1, r0 - ldrb r0, [r0] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r3 - ldr r0, =0x02023064 - lsls r1, 9 - adds r0, 0x1 - adds r1, r0 - adds r2, 0x3E - movs r0, 0x1 - ldrb r1, [r1] - ands r1, r0 - lsls r1, 2 - ldrb r3, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldrb r0, [r4] - bl sub_805E408 -_08067916: - bl sub_8065068 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80678D0 - - thumb_func_start sub_8067930 -sub_8067930: @ 8067930 - push {r4-r6,lr} - sub sp, 0x4 - ldr r5, =0x02024064 - ldrb r0, [r5] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _08067992 - ldr r4, =0x02023064 - ldrb r2, [r5] - lsls r1, r2, 9 - adds r0, r4, 0x1 - adds r0, r1, r0 - ldrb r6, [r0] - adds r0, r4, 0x2 - adds r0, r1, r0 - ldrb r3, [r0] - adds r4, 0x3 - adds r1, r4 - ldrb r0, [r1] - lsls r0, 8 - orrs r3, r0 - str r3, [sp] - adds r0, r2, 0 - adds r1, r2, 0 - adds r3, r6, 0 - bl move_anim_start_t3 - lsls r0, 24 - cmp r0, 0 - beq _08067980 - bl sub_8065068 - b _0806798C - .pool -_08067980: - ldr r0, =0x03005d60 - ldrb r1, [r5] - lsls r1, 2 - adds r1, r0 - ldr r0, =sub_8065038 - str r0, [r1] -_0806798C: - adds r0, r6, 0 - bl sub_817E32C -_08067992: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8067930 - - thumb_func_start sub_80679A4 -sub_80679A4: @ 80679A4 - push {lr} - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 9 - ldr r1, =0x02023066 - adds r0, r1 - bl sub_81851A8 - bl sub_8065068 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80679A4 - - thumb_func_start sub_80679C4 -sub_80679C4: @ 80679C4 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_80679C4 - - thumb_func_start sub_80679D0 -sub_80679D0: @ 80679D0 - push {r4,r5,lr} - ldr r5, =0x02024064 - ldrb r0, [r5] - lsls r0, 9 - ldr r4, =0x02023068 - adds r0, r4 - bl sub_81851A8 - ldrb r0, [r5] - lsls r0, 9 - subs r4, 0x3 - adds r0, r4 - ldrb r2, [r0] - cmp r2, 0x3 - bne _08067A00 - ldr r0, =0x0202433a - strb r2, [r0] - b _08067A08 - .pool -_08067A00: - ldr r0, =0x0202433a - movs r1, 0x3 - eors r1, r2 - strb r1, [r0] -_08067A08: - ldr r0, =0x03005d90 - ldr r3, [r0] - ldr r1, =0x02023064 - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r0, 9 - adds r1, 0x2 - adds r0, r1 - ldrb r0, [r0] - ldr r1, =0x00000ca9 - adds r3, r1 - movs r1, 0x1 - ands r1, r0 - lsls r1, 3 - ldrb r2, [r3] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - movs r0, 0x5 - bl sub_80A2F50 - movs r0, 0x3 - bl sub_80A2390 - bl sub_8065068 - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_80587B0 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80679D0 - - thumb_func_start nullsub_92 -nullsub_92: @ 8067A70 - bx lr - thumb_func_end nullsub_92 - - thumb_func_start zero_pokemon_boxed_data -@ void zero_pokemon_boxed_data(pokemon *mon) -zero_pokemon_boxed_data: @ 8067A74 - push {lr} - adds r2, r0, 0 - movs r1, 0 - movs r3, 0 -_08067A7C: - adds r0, r2, r1 - strb r3, [r0] - adds r1, 0x1 - cmp r1, 0x4F - bls _08067A7C - pop {r0} - bx r0 - thumb_func_end zero_pokemon_boxed_data - - thumb_func_start zero_pokemon_struct -@ void zero_pokemon_struct(pokemon *mon) -zero_pokemon_struct: @ 8067A8C - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - bl zero_pokemon_boxed_data - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r1, 0x37 - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x38 - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x39 - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3A - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3B - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3C - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3D - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3E - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3F - mov r2, sp - bl pokemon_setattr - movs r0, 0xFF - str r0, [sp] - adds r0, r4, 0 - movs r1, 0x40 - mov r2, sp - bl pokemon_setattr - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end zero_pokemon_struct - - thumb_func_start zero_player_party_data -@ void zero_player_party_data() -zero_player_party_data: @ 8067B0C - push {r4,r5,lr} - ldr r4, =0x020244ec - movs r0, 0xFA - lsls r0, 1 - adds r5, r4, r0 -_08067B16: - adds r0, r4, 0 - bl zero_pokemon_struct - adds r4, 0x64 - cmp r4, r5 - ble _08067B16 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end zero_player_party_data - - thumb_func_start zero_enemy_party_data -zero_enemy_party_data: @ 8067B2C - push {r4,r5,lr} - ldr r4, =0x02024744 - movs r0, 0xFA - lsls r0, 1 - adds r5, r4, r0 -_08067B36: - adds r0, r4, 0 - bl zero_pokemon_struct - adds r4, 0x64 - cmp r4, r5 - ble _08067B36 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end zero_enemy_party_data - - thumb_func_start create_pokemon_set_level -@ void create_pokemon_set_level(pokemon *mon, s16 species_num, u8 level, u8 forced_iv, char pokemon_id_is_nonrandom, int pokemon_id, u8 trainer_id_mode, int trainer_id) -create_pokemon_set_level: @ 8067B4C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x1C - mov r8, r0 - adds r6, r1, 0 - ldr r4, [sp, 0x34] - ldr r7, [sp, 0x38] - ldr r5, [sp, 0x3C] - lsls r6, 16 - lsrs r6, 16 - add r0, sp, 0x10 - strb r2, [r0] - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - mov r0, r8 - str r3, [sp, 0x18] - bl zero_pokemon_struct - str r4, [sp] - str r7, [sp, 0x4] - str r5, [sp, 0x8] - ldr r0, [sp, 0x40] - str r0, [sp, 0xC] - mov r0, r8 - adds r1, r6, 0 - add r2, sp, 0x10 - ldrb r2, [r2] - ldr r3, [sp, 0x18] - bl create_pokemon - mov r0, r8 - movs r1, 0x38 - add r2, sp, 0x10 - bl pokemon_setattr - movs r0, 0xFF - str r0, [sp, 0x14] - add r2, sp, 0x14 - mov r0, r8 - movs r1, 0x40 - bl pokemon_setattr - mov r0, r8 - bl pokemon_calc_effective_stats - add sp, 0x1C - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end create_pokemon_set_level - - thumb_func_start create_pokemon -@ void create_pokemon(pokemon *mon, s16 species_num, u8 level, u8 forced_iv, char pokemon_id_is_nonrandom, int pokemon_id, u8 trainer_id_mode, int trainer_id) -create_pokemon: @ 8067BBC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - adds r7, r0, 0 - ldr r4, [sp, 0x40] - ldr r0, [sp, 0x48] - movs r5, 0xE - add r5, sp - strh r1, [r5] - add r6, sp, 0x10 - strb r2, [r6] - mov r5, sp - adds r5, 0x11 - strb r3, [r5] - lsls r4, 24 - lsrs r4, 24 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - adds r0, r7, 0 - bl zero_pokemon_boxed_data - cmp r4, 0 - beq _08067BF8 - ldr r0, [sp, 0x44] - str r0, [sp, 0x14] - b _08067C0C -_08067BF8: - bl GenerateRandomNumber - adds r4, r0, 0 - bl GenerateRandomNumber - lsls r4, 16 - lsrs r4, 16 - lsls r0, 16 - orrs r4, r0 - str r4, [sp, 0x14] -_08067C0C: - add r2, sp, 0x14 - adds r0, r7, 0 - movs r1, 0 - bl pokemon_setattr_encrypted - add r0, sp, 0x18 - mov r9, r0 - add r5, sp, 0xC - mov r1, r10 - cmp r1, 0x2 - bne _08067C64 - ldr r2, =0xffff0000 - mov r8, r2 - ldr r6, =0x0000ffff -_08067C28: - bl GenerateRandomNumber - adds r4, r0, 0 - bl GenerateRandomNumber - lsls r4, 16 - lsrs r4, 16 - lsls r0, 16 - orrs r4, r0 - str r4, [sp, 0x18] - adds r1, r4, 0 - mov r3, r8 - ands r1, r3 - lsrs r1, 16 - ands r4, r6 - eors r1, r4 - ldr r2, [sp, 0x14] - adds r0, r2, 0 - ands r0, r3 - lsrs r0, 16 - eors r1, r0 - ands r2, r6 - eors r1, r2 - cmp r1, 0x7 - bls _08067C28 - b _08067C8A - .pool -_08067C64: - mov r0, r10 - cmp r0, 0x1 - bne _08067C70 - ldr r0, [sp, 0x4C] - str r0, [sp, 0x18] - b _08067C8A -_08067C70: - ldr r0, =0x03005d90 - ldr r2, [r0] - ldrb r1, [r2, 0xA] - ldrb r0, [r2, 0xB] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0xC] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0xD] - lsls r0, 24 - orrs r1, r0 - str r1, [sp, 0x18] -_08067C8A: - adds r0, r7, 0 - movs r1, 0x1 - mov r2, r9 - bl pokemon_setattr_encrypted - adds r0, r7, 0 - bl pokemon_calc_checksum - strh r0, [r5] - adds r0, r7, 0 - movs r1, 0x9 - adds r2, r5, 0 - bl pokemon_setattr_encrypted - adds r0, r7, 0 - bl pokemon_encrypt - mov r0, sp - ldrh r1, [r0, 0xE] - bl GetSpeciesName - adds r0, r7, 0 - movs r1, 0x2 - mov r2, sp - bl pokemon_setattr_encrypted - ldr r2, =gUnknown_82E9531 - adds r0, r7, 0 - movs r1, 0x3 - bl pokemon_setattr_encrypted - ldr r5, =0x03005d90 - ldr r2, [r5] - adds r0, r7, 0 - movs r1, 0x7 - bl pokemon_setattr_encrypted - adds r0, r7, 0 - movs r1, 0xB - mov r2, sp - adds r2, 0xE - bl pokemon_setattr_encrypted - ldr r4, =gBaseStats - mov r2, sp - ldrh r1, [r2, 0xE] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0, 0x13] - movs r0, 0xCA - lsls r0, 1 - adds r2, r1, 0 - muls r2, r0 - mov r3, sp - ldrb r0, [r3, 0x10] - lsls r0, 2 - ldr r1, =gExperienceTables - adds r0, r1 - adds r2, r0 - adds r0, r7, 0 - movs r1, 0x19 - bl pokemon_setattr_encrypted - mov r1, sp - ldrh r0, [r1, 0xE] - lsls r2, r0, 3 - subs r2, r0 - lsls r2, 2 - adds r4, 0x12 - adds r2, r4 - adds r0, r7, 0 - movs r1, 0x20 - bl pokemon_setattr_encrypted - bl sav1_map_get_name - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x18] - adds r0, r7, 0 - movs r1, 0x23 - mov r2, r9 - bl pokemon_setattr_encrypted - adds r0, r7, 0 - movs r1, 0x24 - add r2, sp, 0x10 - bl pokemon_setattr_encrypted - ldr r2, =gUnknown_82E9530 - adds r0, r7, 0 - movs r1, 0x25 - bl pokemon_setattr_encrypted - movs r0, 0x4 - str r0, [sp, 0x18] - adds r0, r7, 0 - movs r1, 0x26 - mov r2, r9 - bl pokemon_setattr_encrypted - ldr r2, [r5] - adds r2, 0x8 - adds r0, r7, 0 - movs r1, 0x31 - bl pokemon_setattr_encrypted - mov r2, sp - ldrb r0, [r2, 0x11] - cmp r0, 0x1F - bhi _08067DC8 - adds r0, r7, 0 - movs r1, 0x27 - adds r2, 0x11 - bl pokemon_setattr_encrypted - adds r0, r7, 0 - movs r1, 0x28 - mov r2, sp - adds r2, 0x11 - bl pokemon_setattr_encrypted - adds r0, r7, 0 - movs r1, 0x29 - mov r2, sp - adds r2, 0x11 - bl pokemon_setattr_encrypted - adds r0, r7, 0 - movs r1, 0x2A - mov r2, sp - adds r2, 0x11 - bl pokemon_setattr_encrypted - adds r0, r7, 0 - movs r1, 0x2B - mov r2, sp - adds r2, 0x11 - bl pokemon_setattr_encrypted - adds r0, r7, 0 - movs r1, 0x2C - mov r2, sp - adds r2, 0x11 - bl pokemon_setattr_encrypted - b _08067E50 - .pool -_08067DC8: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x18] - movs r3, 0x1F - mov r8, r3 - ands r0, r3 - str r0, [sp, 0x1C] - add r4, sp, 0x1C - adds r0, r7, 0 - movs r1, 0x27 - adds r2, r4, 0 - bl pokemon_setattr_encrypted - ldr r0, [sp, 0x18] - movs r6, 0xF8 - lsls r6, 2 - ands r0, r6 - lsrs r0, 5 - str r0, [sp, 0x1C] - adds r0, r7, 0 - movs r1, 0x28 - adds r2, r4, 0 - bl pokemon_setattr_encrypted - ldr r0, [sp, 0x18] - movs r5, 0xF8 - lsls r5, 7 - ands r0, r5 - lsrs r0, 10 - str r0, [sp, 0x1C] - adds r0, r7, 0 - movs r1, 0x29 - adds r2, r4, 0 - bl pokemon_setattr_encrypted - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x18] - mov r1, r8 - ands r0, r1 - str r0, [sp, 0x1C] - adds r0, r7, 0 - movs r1, 0x2A - adds r2, r4, 0 - bl pokemon_setattr_encrypted - ldr r0, [sp, 0x18] - ands r0, r6 - lsrs r0, 5 - str r0, [sp, 0x1C] - adds r0, r7, 0 - movs r1, 0x2B - adds r2, r4, 0 - bl pokemon_setattr_encrypted - ldr r0, [sp, 0x18] - ands r0, r5 - lsrs r0, 10 - str r0, [sp, 0x1C] - adds r0, r7, 0 - movs r1, 0x2C - adds r2, r4, 0 - bl pokemon_setattr_encrypted -_08067E50: - ldr r2, =gBaseStats - mov r3, sp - ldrh r1, [r3, 0xE] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x17] - cmp r0, 0 - beq _08067E76 - ldr r0, [sp, 0x14] - movs r1, 0x1 - ands r0, r1 - str r0, [sp, 0x18] - adds r0, r7, 0 - movs r1, 0x2E - mov r2, r9 - bl pokemon_setattr_encrypted -_08067E76: - adds r0, r7, 0 - bl sub_8069270 - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end create_pokemon - - thumb_func_start pokemon_make_with_nature -pokemon_make_with_nature: @ 8067E90 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - mov r9, r0 - ldr r0, [sp, 0x2C] - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - lsls r2, 24 - lsrs r7, r2, 24 - lsls r3, 24 - lsrs r6, r3, 24 - lsls r0, 24 - lsrs r5, r0, 24 -_08067EB0: - bl GenerateRandomNumber - adds r4, r0, 0 - bl GenerateRandomNumber - lsls r4, 16 - lsrs r4, 16 - lsls r0, 16 - orrs r4, r0 - adds r0, r4, 0 - bl GetNatureFromPersonality - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - bne _08067EB0 - movs r0, 0x1 - str r0, [sp] - str r4, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - str r0, [sp, 0xC] - mov r0, r9 - mov r1, r8 - adds r2, r7, 0 - adds r3, r6, 0 - bl create_pokemon_set_level - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end pokemon_make_with_nature - - thumb_func_start sub_8067EF8 -sub_8067EF8: @ 8067EF8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - str r0, [sp, 0x10] - ldr r4, [sp, 0x38] - ldr r5, [sp, 0x3C] - ldr r0, [sp, 0x40] - lsls r1, 16 - lsrs r7, r1, 16 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x14] - lsls r3, 24 - lsrs r3, 24 - mov r10, r3 - lsls r4, 24 - lsrs r4, 24 - mov r8, r4 - lsls r5, 24 - lsrs r6, r5, 24 - lsls r0, 24 - lsrs r1, r0, 24 - mov r9, r1 - movs r1, 0xFF - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1B - bhi _08067F9E -_08067F38: - bl GenerateRandomNumber - adds r4, r0, 0 - bl GenerateRandomNumber - lsls r4, 16 - lsrs r4, 16 - lsls r0, 16 - orrs r4, r0 - movs r0, 0xC0 - lsls r0, 18 - ands r0, r4 - lsrs r0, 18 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r4 - lsrs r1, 12 - orrs r0, r1 - movs r1, 0xC0 - lsls r1, 2 - ands r1, r4 - lsrs r1, 6 - orrs r0, r1 - movs r1, 0x3 - ands r1, r4 - orrs r0, r1 - movs r1, 0x1C - bl __umodsi3 - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - bl GetNatureFromPersonality - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - bne _08067F38 - adds r0, r7, 0 - adds r1, r4, 0 - bl pokemon_species_get_gender_info - lsls r0, 24 - lsrs r0, 24 - cmp r8, r0 - bne _08067F38 - mov r0, r9 - subs r0, 0x1 - cmp r5, r0 - bne _08067F38 - b _08067FCE -_08067F9E: - bl GenerateRandomNumber - adds r4, r0, 0 - bl GenerateRandomNumber - lsls r4, 16 - lsrs r4, 16 - lsls r0, 16 - orrs r4, r0 - adds r0, r4, 0 - bl GetNatureFromPersonality - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - bne _08067F9E - adds r0, r7, 0 - adds r1, r4, 0 - bl pokemon_species_get_gender_info - lsls r0, 24 - lsrs r0, 24 - cmp r8, r0 - bne _08067F9E -_08067FCE: - movs r0, 0x1 - str r0, [sp] - str r4, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - str r0, [sp, 0xC] - ldr r0, [sp, 0x10] - adds r1, r7, 0 - ldr r2, [sp, 0x14] - mov r3, r10 - bl create_pokemon_set_level - 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_8067EF8 - - thumb_func_start sub_8067FF8 -sub_8067FF8: @ 8067FF8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - mov r8, r0 - lsls r1, 16 - lsrs r6, r1, 16 - lsls r2, 24 - lsrs r7, r2, 24 -_0806800A: - bl GenerateRandomNumber - adds r4, r0, 0 - bl GenerateRandomNumber - lsls r4, 16 - lsrs r5, r4, 16 - lsls r0, 16 - orrs r5, r0 - bl GenerateRandomNumber - adds r4, r0, 0 - bl GenerateRandomNumber - lsls r4, 16 - lsrs r4, 16 - lsls r0, 16 - orrs r4, r0 - adds r0, r6, 0 - adds r1, r4, 0 - bl pokemon_species_get_gender_info - lsls r0, 24 - cmp r0, 0 - bne _0806800A - movs r0, 0x1 - str r0, [sp] - str r4, [sp, 0x4] - str r0, [sp, 0x8] - str r5, [sp, 0xC] - mov r0, r8 - adds r1, r6, 0 - adds r2, r7, 0 - movs r3, 0x20 - bl create_pokemon_set_level - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8067FF8 - - thumb_func_start sub_8068060 -sub_8068060: @ 8068060 - push {r4,lr} - sub sp, 0x14 - adds r4, r0, 0 - str r3, [sp, 0x10] - ldr r3, [sp, 0x1C] - lsls r1, 16 - lsrs r1, 16 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x1 - str r0, [sp] - str r3, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - str r0, [sp, 0xC] - adds r0, r4, 0 - movs r3, 0 - bl create_pokemon_set_level - adds r0, r4, 0 - movs r1, 0x42 - add r2, sp, 0x10 - bl pokemon_setattr - adds r0, r4, 0 - bl pokemon_calc_effective_stats - add sp, 0x14 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8068060 - - thumb_func_start sub_80680A0 -sub_80680A0: @ 80680A0 - push {r4,r5,lr} - sub sp, 0x10 - adds r5, r0, 0 - adds r4, r3, 0 - ldr r3, [sp, 0x1C] - lsls r1, 16 - lsrs r1, 16 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - str r3, [sp, 0xC] - adds r0, r5, 0 - movs r3, 0 - bl create_pokemon_set_level - adds r0, r5, 0 - movs r1, 0x27 - adds r2, r4, 0 - bl pokemon_setattr - adds r2, r4, 0x1 - adds r0, r5, 0 - movs r1, 0x28 - bl pokemon_setattr - adds r2, r4, 0x2 - adds r0, r5, 0 - movs r1, 0x29 - bl pokemon_setattr - adds r2, r4, 0x3 - adds r0, r5, 0 - movs r1, 0x2A - bl pokemon_setattr - adds r2, r4, 0x4 - adds r0, r5, 0 - movs r1, 0x2B - bl pokemon_setattr - adds r4, 0x5 - adds r0, r5, 0 - movs r1, 0x2C - adds r2, r4, 0 - bl pokemon_setattr - adds r0, r5, 0 - bl pokemon_calc_effective_stats - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80680A0 - - thumb_func_start pokemon_make_ev_something -pokemon_make_ev_something: @ 8068114 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x14 - adds r7, r0, 0 - ldr r0, [sp, 0x2C] - lsls r1, 16 - lsrs r1, 16 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r6, 0 - str r6, [sp] - str r6, [sp, 0x4] - str r6, [sp, 0x8] - str r6, [sp, 0xC] - adds r0, r7, 0 - bl create_pokemon_set_level - mov r4, r8 - movs r1, 0x1 - movs r5, 0x5 -_08068148: - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _08068152 - adds r6, 0x1 -_08068152: - lsrs r4, 1 - subs r5, 0x1 - cmp r5, 0 - bge _08068148 - movs r0, 0xFF - lsls r0, 1 - adds r1, r6, 0 - bl __divsi3 - add r1, sp, 0x10 - strh r0, [r1] - movs r4, 0x1 - movs r5, 0 -_0806816C: - mov r0, r8 - ands r0, r4 - cmp r0, 0 - beq _08068180 - adds r1, r5, 0 - adds r1, 0x1A - adds r0, r7, 0 - add r2, sp, 0x10 - bl pokemon_setattr -_08068180: - lsls r0, r4, 25 - lsrs r4, r0, 24 - adds r5, 0x1 - cmp r5, 0x5 - ble _0806816C - adds r0, r7, 0 - bl pokemon_calc_effective_stats - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end pokemon_make_ev_something - - thumb_func_start sub_806819C -sub_806819C: @ 806819C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x34 - adds r7, r0, 0 - adds r6, r1, 0 - ldrh r1, [r6] - ldrb r2, [r6, 0xC] - movs r3, 0x1 - str r3, [sp] - ldr r0, [r6, 0x1C] - str r0, [sp, 0x4] - str r3, [sp, 0x8] - ldr r0, [r6, 0x14] - str r0, [sp, 0xC] - adds r0, r7, 0 - movs r3, 0 - bl create_pokemon_set_level - movs r5, 0 - add r0, sp, 0x30 - mov r9, r0 - movs r1, 0x31 - add r1, sp - mov r8, r1 - adds r4, r6, 0x4 -_080681D2: - ldrh r1, [r4] - lsls r2, r5, 24 - lsrs r2, 24 - adds r0, r7, 0 - bl sub_80691F4 - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _080681D2 - adds r2, r6, 0 - adds r2, 0xD - adds r0, r7, 0 - movs r1, 0x15 - bl pokemon_setattr - adds r2, r6, 0x2 - adds r0, r7, 0 - movs r1, 0xC - bl pokemon_setattr - adds r2, r6, 0 - adds r2, 0x2B - adds r0, r7, 0 - movs r1, 0x20 - bl pokemon_setattr - adds r1, r6, 0 - adds r1, 0x20 - add r0, sp, 0x10 - bl CopyString - add r0, sp, 0x10 - ldrb r0, [r0] - cmp r0, 0xFC - bne _08068230 - add r0, sp, 0x10 - ldrb r0, [r0, 0x1] - cmp r0, 0x15 - bne _08068230 - movs r0, 0x1 - mov r1, r9 - strb r0, [r1] - add r0, sp, 0x10 - bl StripExtendedControlCodes - b _08068236 -_08068230: - movs r0, 0x2 - mov r1, r9 - strb r0, [r1] -_08068236: - adds r0, r7, 0 - movs r1, 0x3 - mov r2, r9 - bl pokemon_setattr - adds r0, r7, 0 - movs r1, 0x2 - add r2, sp, 0x10 - bl pokemon_setattr - adds r2, r6, 0 - adds r2, 0xE - adds r0, r7, 0 - movs r1, 0x1A - bl pokemon_setattr - adds r2, r6, 0 - adds r2, 0xF - adds r0, r7, 0 - movs r1, 0x1B - bl pokemon_setattr - adds r2, r6, 0 - adds r2, 0x10 - adds r0, r7, 0 - movs r1, 0x1C - bl pokemon_setattr - adds r2, r6, 0 - adds r2, 0x11 - adds r0, r7, 0 - movs r1, 0x1D - bl pokemon_setattr - adds r2, r6, 0 - adds r2, 0x12 - adds r0, r7, 0 - movs r1, 0x1E - bl pokemon_setattr - adds r2, r6, 0 - adds r2, 0x13 - adds r0, r7, 0 - movs r1, 0x1F - bl pokemon_setattr - ldrb r0, [r6, 0x1B] - lsrs r0, 7 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x2E - mov r2, r8 - bl pokemon_setattr - ldrb r0, [r6, 0x18] - lsls r0, 27 - lsrs r0, 27 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x27 - mov r2, r8 - bl pokemon_setattr - ldrh r0, [r6, 0x18] - lsls r0, 22 - lsrs r0, 27 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x28 - mov r2, r8 - bl pokemon_setattr - ldrb r0, [r6, 0x19] - lsls r0, 25 - lsrs r0, 27 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x29 - mov r2, r8 - bl pokemon_setattr - ldr r0, [r6, 0x18] - lsls r0, 12 - lsrs r0, 27 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x2A - mov r2, r8 - bl pokemon_setattr - ldrh r0, [r6, 0x1A] - lsls r0, 23 - lsrs r0, 27 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x2B - mov r2, r8 - bl pokemon_setattr - ldrb r0, [r6, 0x1B] - lsls r0, 26 - lsrs r0, 27 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x2C - mov r2, r8 - bl pokemon_setattr - adds r0, r7, 0 - bl sub_806E924 - adds r0, r7, 0 - bl pokemon_calc_effective_stats - add sp, 0x34 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_806819C - - thumb_func_start sub_8068338 -sub_8068338: @ 8068338 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x58 - adds r7, r0, 0 - adds r6, r1, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _08068374 - lsls r0, r1, 30 - lsrs r0, 30 - bl sub_8165C90 - lsls r0, 24 - lsrs r3, r0, 24 - b _0806837C - .pool -_08068374: - movs r3, 0x32 - cmp r2, 0 - bne _0806837C - ldrb r3, [r6, 0xC] -_0806837C: - ldrh r1, [r6] - movs r2, 0x1 - str r2, [sp] - ldr r0, [r6, 0x1C] - str r0, [sp, 0x4] - str r2, [sp, 0x8] - ldr r0, [r6, 0x14] - str r0, [sp, 0xC] - adds r0, r7, 0 - adds r2, r3, 0 - movs r3, 0 - bl create_pokemon_set_level - movs r5, 0 - movs r0, 0xD - adds r0, r6 - mov r10, r0 - adds r1, r6, 0x2 - str r1, [sp, 0x38] - adds r0, r6, 0 - adds r0, 0x2B - str r0, [sp, 0x34] - adds r1, 0x1E - str r1, [sp, 0x54] - add r0, sp, 0x30 - mov r9, r0 - subs r1, 0x12 - str r1, [sp, 0x3C] - adds r0, r6, 0 - adds r0, 0xF - str r0, [sp, 0x40] - adds r1, 0x2 - str r1, [sp, 0x44] - adds r0, 0x2 - str r0, [sp, 0x48] - adds r1, 0x2 - str r1, [sp, 0x4C] - adds r0, 0x2 - str r0, [sp, 0x50] - movs r1, 0x31 - add r1, sp - mov r8, r1 - adds r4, r6, 0x4 -_080683D2: - ldrh r1, [r4] - lsls r2, r5, 24 - lsrs r2, 24 - adds r0, r7, 0 - bl sub_80691F4 - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _080683D2 - adds r0, r7, 0 - movs r1, 0x15 - mov r2, r10 - bl pokemon_setattr - adds r0, r7, 0 - movs r1, 0xC - ldr r2, [sp, 0x38] - bl pokemon_setattr - adds r0, r7, 0 - movs r1, 0x20 - ldr r2, [sp, 0x34] - bl pokemon_setattr - add r0, sp, 0x10 - ldr r1, [sp, 0x54] - bl CopyString - add r0, sp, 0x10 - ldrb r0, [r0] - cmp r0, 0xFC - bne _0806842A - add r0, sp, 0x10 - ldrb r0, [r0, 0x1] - cmp r0, 0x15 - bne _0806842A - movs r0, 0x1 - mov r1, r9 - strb r0, [r1] - add r0, sp, 0x10 - bl StripExtendedControlCodes - b _08068430 -_0806842A: - movs r0, 0x2 - mov r1, r9 - strb r0, [r1] -_08068430: - adds r0, r7, 0 - movs r1, 0x3 - mov r2, r9 - bl pokemon_setattr - adds r0, r7, 0 - movs r1, 0x2 - add r2, sp, 0x10 - bl pokemon_setattr - adds r0, r7, 0 - movs r1, 0x1A - ldr r2, [sp, 0x3C] - bl pokemon_setattr - adds r0, r7, 0 - movs r1, 0x1B - ldr r2, [sp, 0x40] - bl pokemon_setattr - adds r0, r7, 0 - movs r1, 0x1C - ldr r2, [sp, 0x44] - bl pokemon_setattr - adds r0, r7, 0 - movs r1, 0x1D - ldr r2, [sp, 0x48] - bl pokemon_setattr - adds r0, r7, 0 - movs r1, 0x1E - ldr r2, [sp, 0x4C] - bl pokemon_setattr - adds r0, r7, 0 - movs r1, 0x1F - ldr r2, [sp, 0x50] - bl pokemon_setattr - ldrb r0, [r6, 0x1B] - lsrs r0, 7 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x2E - mov r2, r8 - bl pokemon_setattr - ldrb r0, [r6, 0x18] - lsls r0, 27 - lsrs r0, 27 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x27 - mov r2, r8 - bl pokemon_setattr - ldrh r0, [r6, 0x18] - lsls r0, 22 - lsrs r0, 27 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x28 - mov r2, r8 - bl pokemon_setattr - ldrb r0, [r6, 0x19] - lsls r0, 25 - lsrs r0, 27 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x29 - mov r2, r8 - bl pokemon_setattr - ldr r0, [r6, 0x18] - lsls r0, 12 - lsrs r0, 27 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x2A - mov r2, r8 - bl pokemon_setattr - ldrh r0, [r6, 0x1A] - lsls r0, 23 - lsrs r0, 27 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x2B - mov r2, r8 - bl pokemon_setattr - ldrb r0, [r6, 0x1B] - lsls r0, 26 - lsrs r0, 27 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x2C - mov r2, r8 - bl pokemon_setattr - adds r0, r7, 0 - bl sub_806E924 - adds r0, r7, 0 - bl pokemon_calc_effective_stats - 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_8068338 - - thumb_func_start sub_8068528 -sub_8068528: @ 8068528 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x14 - adds r7, r0, 0 - mov r9, r1 - lsls r2, 24 - lsrs r2, 24 - ldr r6, =gUnknown_08610970 - ldrb r0, [r1] - lsls r3, r0, 27 - lsrs r1, r3, 27 - movs r5, 0x58 - muls r1, r5 - adds r1, r6 - ldrh r1, [r1, 0x30] - mov r8, r1 - lsrs r1, r3, 27 - muls r1, r5 - adds r1, r6 - ldrh r4, [r1, 0x30] - lsrs r4, 8 - lsrs r3, 27 - adds r1, r3, 0 - muls r1, r5 - adds r1, r6 - ldrh r3, [r1, 0x30] - movs r1, 0xFF - ands r1, r3 - lsls r1, 8 - lsls r5, r2, 1 - adds r5, r2 - lsls r5, 2 - mov r2, r9 - adds r6, r2, r5 - orrs r4, r1 - ldrh r1, [r6, 0x4] - adds r4, r1 - ldrb r1, [r2, 0x2] - adds r4, r1 - lsls r0, 25 - lsrs r0, 30 - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - bl sub_8165C90 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldrh r1, [r6, 0x4] - movs r0, 0x1 - str r0, [sp] - str r4, [sp, 0x4] - str r0, [sp, 0x8] - mov r0, r8 - str r0, [sp, 0xC] - adds r0, r7, 0 - movs r3, 0x1F - bl create_pokemon_set_level - mov r1, r9 - adds r2, r5, r1 - adds r2, 0xE - adds r0, r7, 0 - movs r1, 0xC - bl pokemon_setattr - movs r4, 0 - movs r2, 0x12 - add r2, sp - mov r8, r2 - mov r6, r9 - adds r6, 0x6 -_080685BE: - adds r0, r6, r5 - ldrh r1, [r0] - lsls r2, r4, 24 - lsrs r2, 24 - adds r0, r7, 0 - bl sub_80691F4 - adds r5, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - ble _080685BE - movs r1, 0x55 - add r0, sp, 0x10 - strh r1, [r0] - movs r4, 0 - mov r5, r9 - adds r5, 0x3F -_080685E0: - adds r1, r4, 0 - adds r1, 0x1A - adds r0, r7, 0 - add r2, sp, 0x10 - bl pokemon_setattr - adds r4, 0x1 - cmp r4, 0x5 - ble _080685E0 - ldrb r0, [r5] - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x3 - mov r2, r8 - bl pokemon_setattr - mov r2, r9 - ldrb r0, [r2] - lsls r0, 27 - lsrs r0, 27 - mov r2, r8 - ldrb r1, [r2] - bl sub_81A1650 - adds r2, r0, 0 - adds r0, r7, 0 - movs r1, 0x7 - bl pokemon_setattr - adds r0, r7, 0 - bl pokemon_calc_effective_stats - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8068528 - - thumb_func_start sub_8068634 -sub_8068634: @ 8068634 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - adds r7, r0, 0 - ldr r0, [sp, 0x38] - ldr r4, [sp, 0x3C] - lsls r1, 16 - lsrs r1, 16 - str r1, [sp, 0x14] - lsls r2, 24 - lsrs r2, 24 - mov r10, r2 - lsls r3, 24 - lsrs r5, r3, 24 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r4, 24 - lsrs r4, 24 - mov r8, r4 - movs r6, 0 -_08068664: - bl GenerateRandomNumber - adds r4, r0, 0 - bl GenerateRandomNumber - lsls r4, 16 - lsrs r4, 16 - lsls r0, 16 - orrs r4, r0 - adds r0, r4, 0 - bl GetNatureFromPersonality - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - bne _08068664 - movs r0, 0x1 - str r0, [sp] - str r4, [sp, 0x4] - str r0, [sp, 0x8] - ldr r0, [sp, 0x40] - str r0, [sp, 0xC] - adds r0, r7, 0 - ldr r1, [sp, 0x14] - mov r2, r10 - mov r3, r9 - bl create_pokemon_set_level - mov r5, r8 - movs r1, 0x1 - movs r4, 0x5 -_080686A2: - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _080686AC - adds r6, 0x1 -_080686AC: - lsrs r5, 1 - subs r4, 0x1 - cmp r4, 0 - bge _080686A2 - movs r0, 0xFF - lsls r0, 1 - adds r1, r6, 0 - bl __divsi3 - add r1, sp, 0x10 - strh r0, [r1] - movs r5, 0x1 - movs r4, 0 -_080686C6: - mov r0, r8 - ands r0, r5 - cmp r0, 0 - beq _080686DA - adds r1, r4, 0 - adds r1, 0x1A - adds r0, r7, 0 - add r2, sp, 0x10 - bl pokemon_setattr -_080686DA: - lsls r0, r5, 25 - lsrs r5, r0, 24 - adds r4, 0x1 - cmp r4, 0x5 - ble _080686C6 - adds r0, r7, 0 - bl pokemon_calc_effective_stats - 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_8068634 - - thumb_func_start sub_80686FC -sub_80686FC: @ 80686FC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r7, r0, 0 - adds r6, r1, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - strh r0, [r6] - adds r0, r7, 0 - movs r1, 0xC - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xAF - bne _08068726 - movs r0, 0 -_08068726: - strh r0, [r6, 0x2] - movs r5, 0 - movs r0, 0x2B - adds r0, r6 - mov r8, r0 - movs r1, 0x20 - adds r1, r6 - mov r9, r1 - adds r4, r6, 0x4 -_08068738: - adds r1, r5, 0 - adds r1, 0xD - adds r0, r7, 0 - movs r2, 0 - bl pokemon_getattr - strh r0, [r4] - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _08068738 - adds r0, r7, 0 - movs r1, 0x38 - movs r2, 0 - bl pokemon_getattr - strb r0, [r6, 0xC] - adds r0, r7, 0 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr - strb r0, [r6, 0xD] - adds r0, r7, 0 - movs r1, 0x1 - movs r2, 0 - bl pokemon_getattr - str r0, [r6, 0x14] - adds r0, r7, 0 - movs r1, 0x1A - movs r2, 0 - bl pokemon_getattr - strb r0, [r6, 0xE] - adds r0, r7, 0 - movs r1, 0x1B - movs r2, 0 - bl pokemon_getattr - strb r0, [r6, 0xF] - adds r0, r7, 0 - movs r1, 0x1C - movs r2, 0 - bl pokemon_getattr - strb r0, [r6, 0x10] - adds r0, r7, 0 - movs r1, 0x1D - movs r2, 0 - bl pokemon_getattr - strb r0, [r6, 0x11] - adds r0, r7, 0 - movs r1, 0x1E - movs r2, 0 - bl pokemon_getattr - strb r0, [r6, 0x12] - adds r0, r7, 0 - movs r1, 0x1F - movs r2, 0 - bl pokemon_getattr - strb r0, [r6, 0x13] - adds r0, r7, 0 - movs r1, 0x20 - movs r2, 0 - bl pokemon_getattr - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x27 - movs r2, 0 - bl pokemon_getattr - movs r4, 0x1F - ands r0, r4 - ldrb r2, [r6, 0x18] - movs r1, 0x20 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r6, 0x18] - adds r0, r7, 0 - movs r1, 0x28 - movs r2, 0 - bl pokemon_getattr - movs r5, 0x1F - ands r0, r5 - lsls r0, 5 - ldrh r2, [r6, 0x18] - ldr r1, =0xfffffc1f - ands r1, r2 - orrs r1, r0 - strh r1, [r6, 0x18] - adds r0, r7, 0 - movs r1, 0x29 - movs r2, 0 - bl pokemon_getattr - ands r0, r4 - lsls r0, 2 - ldrb r2, [r6, 0x19] - movs r1, 0x7D - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r6, 0x19] - adds r0, r7, 0 - movs r1, 0x2A - movs r2, 0 - bl pokemon_getattr - movs r1, 0x1F - ands r1, r0 - lsls r1, 15 - ldr r0, [r6, 0x18] - ldr r2, =0xfff07fff - ands r0, r2 - orrs r0, r1 - str r0, [r6, 0x18] - adds r0, r7, 0 - movs r1, 0x2B - movs r2, 0 - bl pokemon_getattr - ands r0, r5 - lsls r0, 4 - ldrh r2, [r6, 0x1A] - ldr r1, =0xfffffe0f - ands r1, r2 - orrs r1, r0 - strh r1, [r6, 0x1A] - adds r0, r7, 0 - movs r1, 0x2C - movs r2, 0 - bl pokemon_getattr - ands r0, r4 - lsls r0, 1 - ldrb r2, [r6, 0x1B] - movs r1, 0x3F - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r6, 0x1B] - adds r0, r7, 0 - movs r1, 0x2E - movs r2, 0 - bl pokemon_getattr - lsls r0, 7 - ldrb r2, [r6, 0x1B] - movs r1, 0x7F - ands r1, r2 - orrs r1, r0 - strb r1, [r6, 0x1B] - adds r0, r7, 0 - movs r1, 0 - movs r2, 0 - bl pokemon_getattr - str r0, [r6, 0x1C] - adds r0, r7, 0 - movs r1, 0x2 - mov r2, r9 - bl pokemon_getattr - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80686FC - - thumb_func_start sub_80688A8 -sub_80688A8: @ 80688A8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x14 - mov r8, r0 - ldr r4, [sp, 0x2C] - ldr r6, [sp, 0x30] - ldr r5, [sp, 0x34] - ldr r7, [sp, 0x38] - lsls r1, 16 - lsrs r1, 16 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - movs r0, 0x1 - str r0, [sp, 0x10] - str r4, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - str r7, [sp, 0xC] - mov r0, r8 - bl create_pokemon_set_level - mov r0, r8 - movs r1, 0x50 - add r2, sp, 0x10 - bl pokemon_setattr - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80688A8 - - thumb_func_start sub_80688F8 -sub_80688F8: @ 80688F8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - cmp r0, 0x5 - bhi _080689CE - lsls r0, 2 - ldr r1, =_08068914 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08068914: - .4byte _080689CE - .4byte _0806892C - .4byte _08068A00 - .4byte _08068958 - .4byte _08068A00 - .4byte _08068990 -_0806892C: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080689CE - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080689CE - b _080689B6 - .pool -_08068958: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080689CE - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080689CE - cmp r5, 0x1 - beq _08068A00 - cmp r5, 0x4 - beq _08068A00 - cmp r5, 0x5 - beq _08068A00 - b _080689CE - .pool -_08068990: - ldr r0, =0x02022fec - ldr r2, [r0] - movs r3, 0x2 - adds r0, r2, 0 - ands r0, r3 - cmp r0, 0 - beq _080689E4 - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _080689CE - movs r0, 0x40 - ands r2, r0 - cmp r2, 0 - beq _080689F4 -_080689B6: - ldr r4, =0x020229e8 - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r4 - ldrh r0, [r1, 0x18] - cmp r0, r5 - bne _08068A00 -_080689CE: - movs r0, 0 - b _08068A02 - .pool -_080689E4: - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _080689CE -_080689F4: - adds r0, r5, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080689CE -_08068A00: - movs r0, 0x1 -_08068A02: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80688F8 - - thumb_func_start get_pokemon_data_3 -get_pokemon_data_3: @ 8068A10 - push {r4-r6,lr} - adds r5, r0, 0 - adds r6, r1, 0 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x20 - ands r0, r1 - cmp r0, 0 - bne _08068A34 - adds r0, r5, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - movs r1, 0xCD - lsls r1, 1 - cmp r0, r1 - beq _08068A3C -_08068A34: - movs r0, 0 - b _08068A9A - .pool -_08068A3C: - adds r1, r6, 0 - adds r1, 0x27 - adds r0, r5, 0 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - adds r1, r6, 0 - adds r1, 0x1A - adds r0, r5, 0 - movs r2, 0 - bl pokemon_getattr - ldr r2, =gUnknown_08329D48 - lsls r1, r6, 1 - adds r1, r2 - ldrh r1, [r1] - lsls r1, 1 - adds r1, r4 - cmp r0, 0 - bge _08068A68 - adds r0, 0x3 -_08068A68: - asrs r0, 2 - adds r0, r1, r0 - adds r1, r5, 0 - adds r1, 0x54 - ldrb r1, [r1] - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - adds r0, 0x5 - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r5, 0 - bl GetNature - lsls r0, 24 - lsrs r0, 24 - lsls r2, r6, 24 - lsrs r2, 24 - adds r1, r4, 0 - bl nature_stat_mod - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 -_08068A9A: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end get_pokemon_data_3 - - thumb_func_start sub_8068AA4 -sub_8068AA4: @ 8068AA4 - push {r4,r5,lr} - sub sp, 0x4 - movs r5, 0 -_08068AAA: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - movs r1, 0xCD - lsls r1, 1 - cmp r0, r1 - bne _08068B34 - adds r0, r4, 0 - movs r1, 0x3B - movs r2, 0 - bl pokemon_getattr - str r0, [sp] - adds r0, r4, 0 - movs r1, 0x3B - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3C - movs r2, 0 - bl pokemon_getattr - str r0, [sp] - adds r0, r4, 0 - movs r1, 0x3C - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3D - movs r2, 0 - bl pokemon_getattr - str r0, [sp] - adds r0, r4, 0 - movs r1, 0x3D - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3E - movs r2, 0 - bl pokemon_getattr - str r0, [sp] - adds r0, r4, 0 - movs r1, 0x3E - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3F - movs r2, 0 - bl pokemon_getattr - str r0, [sp] - adds r0, r4, 0 - movs r1, 0x3F - mov r2, sp - bl pokemon_setattr -_08068B34: - adds r5, 0x1 - cmp r5, 0x5 - ble _08068AAA - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8068AA4 - - thumb_func_start sub_8068B48 -sub_8068B48: @ 8068B48 - push {lr} - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 18 - ands r0, r1 - cmp r0, 0 - beq _08068B6C - ldr r0, =0x0203c7b4 - ldrb r1, [r0] - movs r0, 0x1 - eors r0, r1 - b _08068B78 - .pool -_08068B6C: - bl link_get_multiplayer_id - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 -_08068B78: - ldr r3, =0x020229e8 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r0, r3, 0x4 - adds r0, r1, r0 - ldr r2, [r0] - movs r0, 0x7 - ands r2, r0 - adds r1, r3 - ldrb r0, [r1, 0x13] - lsls r0, 3 - orrs r2, r0 - ldr r0, =gUnknown_08329D54 - lsls r2, 1 - adds r2, r0 - ldrh r0, [r2] - bl TrainerClassToTrainerPic - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8068B48 - - thumb_func_start sub_8068BB0 -sub_8068BB0: @ 8068BB0 - push {lr} - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 18 - ands r0, r1 - cmp r0, 0 - beq _08068BD4 - ldr r0, =0x0203c7b4 - ldrb r1, [r0] - movs r0, 0x1 - eors r0, r1 - b _08068BE0 - .pool -_08068BD4: - bl link_get_multiplayer_id - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 -_08068BE0: - ldr r3, =0x020229e8 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r0, r3, 0x4 - adds r0, r1, r0 - ldr r2, [r0] - movs r0, 0x7 - ands r2, r0 - adds r1, r3 - ldrb r0, [r1, 0x13] - lsls r0, 3 - orrs r2, r0 - ldr r1, =gTrainerClassNameIndices - ldr r0, =gUnknown_08329D54 - lsls r2, 1 - adds r2, r0 - ldrh r0, [r2] - adds r0, r1 - ldrb r0, [r0] - pop {r1} - bx r1 - .pool - thumb_func_end sub_8068BB0 - - thumb_func_start DoScriptedWildBattle -DoScriptedWildBattle: @ 8068C18 - push {r4-r7,lr} - sub sp, 0x14 - ldr r0, =0x020375e0 - ldrh r5, [r0] - ldr r0, =0x020375e2 - ldrh r4, [r0] - ldr r0, =0x020375e4 - ldrh r6, [r0] - bl zero_enemy_party_data - ldr r7, =0x02024744 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - adds r0, r7, 0 - adds r1, r5, 0 - adds r2, r4, 0 - movs r3, 0x20 - bl sub_80688A8 - cmp r6, 0 - beq _08068C60 - add r0, sp, 0x10 - strb r6, [r0] - adds r1, r0, 0 - asrs r0, r6, 8 - strb r0, [r1, 0x1] - adds r0, r7, 0 - movs r1, 0xC - add r2, sp, 0x10 - bl pokemon_setattr -_08068C60: - add sp, 0x14 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end DoScriptedWildBattle - - thumb_func_start pokemon_calc_checksum -@ int pokemon_calc_checksum(pokemon *mon) -pokemon_calc_checksum: @ 8068C78 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - movs r6, 0 - ldr r1, [r4] - movs r2, 0 - bl pokemon_data_permutator - adds r5, r0, 0 - ldr r1, [r4] - adds r0, r4, 0 - movs r2, 0x1 - bl pokemon_data_permutator - adds r7, r0, 0 - ldr r1, [r4] - adds r0, r4, 0 - movs r2, 0x2 - bl pokemon_data_permutator - mov r8, r0 - ldr r1, [r4] - adds r0, r4, 0 - movs r2, 0x3 - bl pokemon_data_permutator - adds r3, r0, 0 - movs r1, 0x5 -_08068CB2: - ldrh r0, [r5] - adds r0, r6, r0 - lsls r0, 16 - lsrs r6, r0, 16 - adds r5, 0x2 - subs r1, 0x1 - cmp r1, 0 - bge _08068CB2 - adds r2, r7, 0 - movs r1, 0x5 -_08068CC6: - ldrh r0, [r2] - adds r0, r6, r0 - lsls r0, 16 - lsrs r6, r0, 16 - adds r2, 0x2 - subs r1, 0x1 - cmp r1, 0 - bge _08068CC6 - mov r2, r8 - movs r1, 0x5 -_08068CDA: - ldrh r0, [r2] - adds r0, r6, r0 - lsls r0, 16 - lsrs r6, r0, 16 - adds r2, 0x2 - subs r1, 0x1 - cmp r1, 0 - bge _08068CDA - adds r2, r3, 0 - movs r1, 0x5 -_08068CEE: - ldrh r0, [r2] - adds r0, r6, r0 - lsls r0, 16 - lsrs r6, r0, 16 - adds r2, 0x2 - subs r1, 0x1 - cmp r1, 0 - bge _08068CEE - adds r0, r6, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end pokemon_calc_checksum - - thumb_func_start pokemon_calc_effective_stats -pokemon_calc_effective_stats: @ 8068D0C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x40 - adds r5, r0, 0 - movs r1, 0x3A - movs r2, 0 - bl pokemon_getattr - mov r8, r0 - adds r0, r5, 0 - movs r1, 0x39 - movs r2, 0 - bl pokemon_getattr - str r0, [sp, 0x1C] - adds r0, r5, 0 - movs r1, 0x27 - movs r2, 0 - bl pokemon_getattr - adds r6, r0, 0 - adds r0, r5, 0 - movs r1, 0x1A - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - adds r0, r5, 0 - movs r1, 0x28 - movs r2, 0 - bl pokemon_getattr - mov r10, r0 - adds r0, r5, 0 - movs r1, 0x1B - movs r2, 0 - bl pokemon_getattr - mov r9, r0 - adds r0, r5, 0 - movs r1, 0x29 - movs r2, 0 - bl pokemon_getattr - str r0, [sp, 0x20] - adds r0, r5, 0 - movs r1, 0x1C - movs r2, 0 - bl pokemon_getattr - str r0, [sp, 0x24] - adds r0, r5, 0 - movs r1, 0x2A - movs r2, 0 - bl pokemon_getattr - str r0, [sp, 0x28] - adds r0, r5, 0 - movs r1, 0x1D - movs r2, 0 - bl pokemon_getattr - str r0, [sp, 0x2C] - adds r0, r5, 0 - movs r1, 0x2B - movs r2, 0 - bl pokemon_getattr - str r0, [sp, 0x30] - adds r0, r5, 0 - movs r1, 0x1E - movs r2, 0 - bl pokemon_getattr - str r0, [sp, 0x34] - adds r0, r5, 0 - movs r1, 0x2C - movs r2, 0 - bl pokemon_getattr - str r0, [sp, 0x38] - adds r0, r5, 0 - movs r1, 0x1F - movs r2, 0 - bl pokemon_getattr - str r0, [sp, 0x3C] - adds r0, r5, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r7, r0, 16 - adds r0, r5, 0 - bl level_by_exp - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - adds r0, r5, 0 - movs r1, 0x38 - mov r2, sp - bl pokemon_setattr - ldr r0, =0x0000012f - cmp r7, r0 - bne _08068DF8 - movs r0, 0x1 - str r0, [sp, 0x4] - lsls r6, r7, 3 - b _08068E26 - .pool -_08068DF8: - ldr r1, =gBaseStats - lsls r2, r7, 3 - subs r0, r2, r7 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 1 - adds r1, r0, r6 - adds r0, r4, 0 - adds r6, r2, 0 - cmp r0, 0 - bge _08068E12 - adds r0, 0x3 -_08068E12: - asrs r0, 2 - adds r0, r1, r0 - ldr r4, [sp] - muls r0, r4 - movs r1, 0x64 - bl __divsi3 - adds r0, r4 - adds r0, 0xA - str r0, [sp, 0x4] -_08068E26: - ldr r1, =0x02024474 - add r2, sp, 0x4 - ldrb r0, [r2] - mov r3, r8 - subs r0, r3 - adds r1, 0x23 - strb r0, [r1] - lsls r0, 24 - cmp r0, 0 - bne _08068E3E - movs r0, 0x1 - strb r0, [r1] -_08068E3E: - adds r0, r5, 0 - movs r1, 0x3A - bl pokemon_setattr - ldr r0, =gBaseStats - subs r1, r6, r7 - lsls r1, 2 - adds r6, r1, r0 - ldrb r0, [r6, 0x1] - lsls r0, 1 - mov r2, r10 - adds r1, r0, r2 - mov r0, r9 - cmp r0, 0 - bge _08068E5E - adds r0, 0x3 -_08068E5E: - asrs r0, 2 - adds r0, r1, r0 - ldr r1, [sp] - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - adds r0, 0x5 - str r0, [sp, 0x8] - adds r0, r5, 0 - bl GetNature - lsls r0, 24 - lsrs r0, 24 - add r4, sp, 0x8 - ldrh r1, [r4] - movs r2, 0x1 - bl nature_stat_mod - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x8] - adds r0, r5, 0 - movs r1, 0x3B - adds r2, r4, 0 - bl pokemon_setattr - ldrb r0, [r6, 0x2] - lsls r0, 1 - ldr r3, [sp, 0x20] - adds r1, r0, r3 - ldr r0, [sp, 0x24] - cmp r0, 0 - bge _08068EA4 - adds r0, 0x3 -_08068EA4: - asrs r0, 2 - adds r0, r1, r0 - ldr r1, [sp] - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - adds r0, 0x5 - str r0, [sp, 0xC] - adds r0, r5, 0 - bl GetNature - lsls r0, 24 - lsrs r0, 24 - add r4, sp, 0xC - ldrh r1, [r4] - movs r2, 0x2 - bl nature_stat_mod - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0xC] - adds r0, r5, 0 - movs r1, 0x3C - adds r2, r4, 0 - bl pokemon_setattr - ldrb r0, [r6, 0x3] - lsls r0, 1 - ldr r2, [sp, 0x28] - adds r1, r0, r2 - ldr r0, [sp, 0x2C] - cmp r0, 0 - bge _08068EEA - adds r0, 0x3 -_08068EEA: - asrs r0, 2 - adds r0, r1, r0 - ldr r1, [sp] - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - adds r0, 0x5 - str r0, [sp, 0x10] - adds r0, r5, 0 - bl GetNature - lsls r0, 24 - lsrs r0, 24 - add r4, sp, 0x10 - ldrh r1, [r4] - movs r2, 0x3 - bl nature_stat_mod - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x10] - adds r0, r5, 0 - movs r1, 0x3D - adds r2, r4, 0 - bl pokemon_setattr - ldrb r0, [r6, 0x4] - lsls r0, 1 - ldr r3, [sp, 0x30] - adds r1, r0, r3 - ldr r0, [sp, 0x34] - cmp r0, 0 - bge _08068F30 - adds r0, 0x3 -_08068F30: - asrs r0, 2 - adds r0, r1, r0 - ldr r1, [sp] - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - adds r0, 0x5 - str r0, [sp, 0x14] - adds r0, r5, 0 - bl GetNature - lsls r0, 24 - lsrs r0, 24 - add r4, sp, 0x14 - ldrh r1, [r4] - movs r2, 0x4 - bl nature_stat_mod - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x14] - adds r0, r5, 0 - movs r1, 0x3E - adds r2, r4, 0 - bl pokemon_setattr - ldrb r0, [r6, 0x5] - lsls r0, 1 - ldr r2, [sp, 0x38] - adds r1, r0, r2 - ldr r0, [sp, 0x3C] - cmp r0, 0 - bge _08068F76 - adds r0, 0x3 -_08068F76: - asrs r0, 2 - adds r0, r1, r0 - ldr r1, [sp] - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - adds r0, 0x5 - str r0, [sp, 0x18] - adds r0, r5, 0 - bl GetNature - lsls r0, 24 - lsrs r0, 24 - add r4, sp, 0x18 - ldrh r1, [r4] - movs r2, 0x5 - bl nature_stat_mod - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x18] - adds r0, r5, 0 - movs r1, 0x3F - adds r2, r4, 0 - bl pokemon_setattr - ldr r0, =0x0000012f - cmp r7, r0 - bne _08068FD0 - ldr r0, [sp, 0x1C] - cmp r0, 0 - bne _08068FBE - mov r3, r8 - cmp r3, 0 - bne _08068FF4 -_08068FBE: - movs r0, 0x1 - b _08068FE8 - .pool -_08068FD0: - ldr r1, [sp, 0x1C] - cmp r1, 0 - bne _08068FE0 - mov r0, r8 - cmp r0, 0 - bne _08068FF4 - ldr r0, [sp, 0x4] - b _08068FE8 -_08068FE0: - ldr r0, [sp, 0x4] - mov r2, r8 - subs r0, r2 - adds r0, r1, r0 -_08068FE8: - str r0, [sp, 0x1C] - add r2, sp, 0x1C - adds r0, r5, 0 - movs r1, 0x39 - bl pokemon_setattr -_08068FF4: - add sp, 0x40 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end pokemon_calc_effective_stats - - thumb_func_start sub_8069004 -sub_8069004: @ 8069004 - push {r4,lr} - sub sp, 0x4 - adds r2, r0, 0 - adds r4, r1, 0 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - adds r1, r2, 0 - movs r2, 0x50 - bl memcpy - adds r0, r4, 0 - movs r1, 0x37 - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x39 - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3A - mov r2, sp - bl pokemon_setattr - movs r0, 0xFF - str r0, [sp] - adds r0, r4, 0 - movs r1, 0x40 - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - bl pokemon_calc_effective_stats - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8069004 - - thumb_func_start level_by_exp -level_by_exp: @ 8069054 - push {r4-r6,lr} - adds r5, r0, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x19 - movs r2, 0 - bl pokemon_getattr - adds r3, r0, 0 - movs r2, 0x1 - ldr r6, =gExperienceTables - ldr r1, =gBaseStats - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - adds r1, r0, r1 - ldrb r0, [r1, 0x13] - movs r5, 0xCA - lsls r5, 1 - muls r0, r5 - adds r0, 0x4 - adds r0, r6 - ldr r0, [r0] - cmp r0, r3 - bhi _080690AA - adds r4, r1, 0 -_08069094: - adds r2, 0x1 - cmp r2, 0x64 - bgt _080690AA - lsls r1, r2, 2 - ldrb r0, [r4, 0x13] - muls r0, r5 - adds r1, r0 - adds r1, r6 - ldr r0, [r1] - cmp r0, r3 - bls _08069094 -_080690AA: - subs r0, r2, 0x1 - lsls r0, 24 - lsrs r0, 24 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end level_by_exp - - thumb_func_start sub_80690C0 -sub_80690C0: @ 80690C0 - push {r4-r6,lr} - adds r5, r0, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr_encrypted - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x19 - movs r2, 0 - bl pokemon_getattr_encrypted - adds r3, r0, 0 - movs r2, 0x1 - ldr r6, =gExperienceTables - ldr r1, =gBaseStats - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - adds r1, r0, r1 - ldrb r0, [r1, 0x13] - movs r5, 0xCA - lsls r5, 1 - muls r0, r5 - adds r0, 0x4 - adds r0, r6 - ldr r0, [r0] - cmp r0, r3 - bhi _08069116 - adds r4, r1, 0 -_08069100: - adds r2, 0x1 - cmp r2, 0x64 - bgt _08069116 - lsls r1, r2, 2 - ldrb r0, [r4, 0x13] - muls r0, r5 - adds r1, r0 - adds r1, r6 - ldr r0, [r1] - cmp r0, r3 - bls _08069100 -_08069116: - subs r0, r2, 0x1 - lsls r0, 24 - lsrs r0, 24 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80690C0 - - thumb_func_start pokemon_moveset_pad_ -pokemon_moveset_pad_: @ 806912C - push {lr} - lsls r1, 16 - lsrs r1, 16 - bl pokemon_moveset_pad - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - thumb_func_end pokemon_moveset_pad_ - - thumb_func_start pokemon_moveset_pad -pokemon_moveset_pad: @ 8069140 - push {r4-r7,lr} - sub sp, 0x4 - adds r7, r0, 0 - mov r0, sp - strh r1, [r0] - movs r5, 0 - mov r6, sp -_0806914E: - adds r4, r5, 0 - adds r4, 0xD - adds r0, r7, 0 - adds r1, r4, 0 - movs r2, 0 - bl pokemon_getattr_encrypted - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _0806918C - adds r0, r7, 0 - adds r1, r4, 0 - mov r2, sp - bl pokemon_setattr_encrypted - adds r1, r5, 0 - adds r1, 0x11 - ldrh r0, [r6] - lsls r2, r0, 1 - adds r2, r0 - lsls r2, 2 - ldr r0, =gBattleMoves + 0x4 @ PP offset - adds r2, r0 - adds r0, r7, 0 - bl pokemon_setattr_encrypted - ldrh r0, [r6] - b _080691A4 - .pool -_0806918C: - ldrh r1, [r6] - cmp r0, r1 - bne _0806919C - ldr r0, =0x0000fffe - b _080691A4 - .pool -_0806919C: - adds r5, 0x1 - cmp r5, 0x3 - ble _0806914E - ldr r0, =0x0000ffff -_080691A4: - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end pokemon_moveset_pad - - thumb_func_start sub_80691B0 -sub_80691B0: @ 80691B0 - push {r4,r5,lr} - lsls r1, 16 - lsrs r4, r1, 16 - movs r3, 0 - adds r5, r0, 0 - adds r5, 0x24 - ldr r2, =gBattleMoves - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 2 - adds r2, r1, r2 - adds r1, r0, 0 - adds r1, 0xC -_080691CA: - ldrh r0, [r1] - cmp r0, 0 - bne _080691E0 - strh r4, [r1] - adds r1, r5, r3 - ldrb r0, [r2, 0x4] - strb r0, [r1] - adds r0, r4, 0 - b _080691EA - .pool -_080691E0: - adds r1, 0x2 - adds r3, 0x1 - cmp r3, 0x3 - ble _080691CA - ldr r0, =0x0000ffff -_080691EA: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80691B0 - - thumb_func_start sub_80691F4 -sub_80691F4: @ 80691F4 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r4, r2, 0 - mov r0, sp - strh r1, [r0] - lsls r4, 24 - lsrs r4, 24 - adds r1, r4, 0 - adds r1, 0xD - adds r0, r5, 0 - mov r2, sp - bl pokemon_setattr - adds r4, 0x11 - mov r0, sp - ldrh r0, [r0] - lsls r2, r0, 1 - adds r2, r0 - lsls r2, 2 - ldr r0, =gBattleMoves + 0x4 @ PP offset - adds r2, r0 - adds r0, r5, 0 - adds r1, r4, 0 - bl pokemon_setattr - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80691F4 - - thumb_func_start sub_8069234 -sub_8069234: @ 8069234 - push {r4,lr} - lsls r1, 16 - lsrs r1, 16 - lsls r2, 24 - lsrs r2, 24 - lsls r4, r2, 1 - adds r3, r0, 0 - adds r3, 0xC - adds r3, r4 - strh r1, [r3] - adds r0, 0x24 - adds r0, r2 - ldr r3, =gBattleMoves - lsls r2, r1, 1 - adds r2, r1 - lsls r2, 2 - adds r2, r3 - ldrb r1, [r2, 0x4] - strb r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8069234 - - thumb_func_start sub_8069264 -sub_8069264: @ 8069264 - push {lr} - bl sub_8069270 - pop {r0} - bx r0 - thumb_func_end sub_8069264 - - thumb_func_start sub_8069270 -sub_8069270: @ 8069270 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r8, r0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr_encrypted - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r0, r8 - bl sub_80690C0 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r0, =gLevelUpLearnsetPointers - lsls r6, r4, 2 - adds r0, r6, r0 - ldr r0, [r0] - ldrh r1, [r0] - ldr r2, =0xffff0000 - lsrs r0, r2, 16 - cmp r1, r0 - beq _080692FC - mov r9, r2 - movs r3, 0 -_080692AE: - ldr r0, =gLevelUpLearnsetPointers - adds r7, r6, r0 - ldr r0, [r7] - adds r0, r3, r0 - ldrh r2, [r0] - movs r1, 0xFE - lsls r1, 8 - adds r0, r1, 0 - ands r0, r2 - mov r4, r10 - lsls r1, r4, 9 - cmp r0, r1 - bgt _080692FC - ldr r1, =0x000001ff - adds r0, r1, 0 - adds r4, r0, 0 - ands r4, r2 - mov r0, r8 - adds r1, r4, 0 - str r3, [sp] - bl pokemon_moveset_pad - lsls r0, 16 - mov r1, r9 - lsrs r5, r1, 16 - ldr r3, [sp] - cmp r0, r9 - bne _080692F0 - mov r0, r8 - adds r1, r4, 0 - bl sub_80694D0 - ldr r3, [sp] -_080692F0: - adds r3, 0x2 - ldr r0, [r7] - adds r0, r3, r0 - ldrh r0, [r0] - cmp r0, r5 - bne _080692AE -_080692FC: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8069270 - - thumb_func_start sub_8069318 -sub_8069318: @ 8069318 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r8, r0 - lsls r4, r1, 24 - lsrs r4, 24 - movs r0, 0 - str r0, [sp] - mov r0, r8 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - mov r0, r8 - movs r1, 0x38 - movs r2, 0 - bl pokemon_getattr - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - cmp r4, 0 - beq _080693B0 - ldr r4, =0x020244e8 - mov r1, sp - ldrb r1, [r1] - strb r1, [r4] - ldr r2, =gLevelUpLearnsetPointers - mov r5, r9 - lsls r3, r5, 2 - adds r5, r3, r2 - ldr r0, [r5] - ldrh r1, [r0] - movs r7, 0xFE - lsls r7, 8 - adds r0, r7, 0 - ands r0, r1 - adds r6, r4, 0 - mov r12, r2 - mov r1, r10 - lsls r4, r1, 9 - cmp r0, r4 - beq _080693D8 - adds r2, r6, 0 - ldr r0, =0x0000ffff - mov r12, r0 - adds r6, r7, 0 - adds r3, r5, 0 -_08069384: - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - ldrb r0, [r2] - ldr r1, [r3] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - cmp r1, r12 - bne _080693A8 - movs r0, 0 - b _08069404 - .pool -_080693A8: - adds r0, r6, 0 - ands r0, r1 - cmp r0, r4 - bne _08069384 -_080693B0: - ldr r3, =gLevelUpLearnsetPointers - mov r1, r9 - lsls r4, r1, 2 - adds r1, r4, r3 - ldr r2, =0x020244e8 - ldrb r0, [r2] - ldr r1, [r1] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0xFE - lsls r0, 8 - ands r0, r1 - mov r5, r10 - lsls r1, r5, 9 - adds r6, r2, 0 - mov r12, r3 - adds r3, r4, 0 - cmp r0, r1 - bne _08069402 -_080693D8: - ldr r2, =0x020244e2 - mov r0, r12 - adds r1, r3, r0 - ldrb r0, [r6] - ldr r1, [r1] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - ldr r0, =0x000001ff - ands r0, r1 - strh r0, [r2] - ldrb r0, [r6] - adds r0, 0x1 - strb r0, [r6] - ldrh r1, [r2] - mov r0, r8 - bl pokemon_moveset_pad_ - lsls r0, 16 - lsrs r0, 16 - str r0, [sp] -_08069402: - ldr r0, [sp] -_08069404: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8069318 - - thumb_func_start sub_8069424 -sub_8069424: @ 8069424 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - adds r6, r0, 0 - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - movs r4, 0 - add r7, sp, 0x8 - add r0, sp, 0xC - mov r9, r0 - mov r5, sp -_08069440: - adds r1, r4, 0 - adds r1, 0xE - adds r0, r6, 0 - movs r2, 0 - bl pokemon_getattr - strh r0, [r5] - adds r1, r4, 0 - adds r1, 0x12 - adds r0, r6, 0 - movs r2, 0 - bl pokemon_getattr - adds r1, r7, r4 - strb r0, [r1] - adds r5, 0x2 - adds r4, 0x1 - cmp r4, 0x2 - ble _08069440 - adds r0, r6, 0 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr - mov r1, r9 - strb r0, [r1] - ldrb r0, [r1] - lsrs r0, 2 - strb r0, [r1] - mov r0, sp - mov r2, r8 - strh r2, [r0, 0x6] - ldr r1, =gBattleMoves - mov r2, r8 - lsls r0, r2, 1 - add r0, r8 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x4] - strb r0, [r7, 0x3] - movs r4, 0 - mov r5, sp -_08069494: - adds r1, r4, 0 - adds r1, 0xD - adds r0, r6, 0 - adds r2, r5, 0 - bl pokemon_setattr - adds r1, r4, 0 - adds r1, 0x11 - adds r2, r7, r4 - adds r0, r6, 0 - bl pokemon_setattr - adds r5, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - ble _08069494 - adds r0, r6, 0 - movs r1, 0x15 - mov r2, r9 - bl pokemon_setattr - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8069424 - - thumb_func_start sub_80694D0 -sub_80694D0: @ 80694D0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - adds r6, r0, 0 - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - movs r4, 0 - add r7, sp, 0x8 - add r0, sp, 0xC - mov r9, r0 - mov r5, sp -_080694EC: - adds r1, r4, 0 - adds r1, 0xE - adds r0, r6, 0 - movs r2, 0 - bl pokemon_getattr_encrypted - strh r0, [r5] - adds r1, r4, 0 - adds r1, 0x12 - adds r0, r6, 0 - movs r2, 0 - bl pokemon_getattr_encrypted - adds r1, r7, r4 - strb r0, [r1] - adds r5, 0x2 - adds r4, 0x1 - cmp r4, 0x2 - ble _080694EC - adds r0, r6, 0 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr_encrypted - mov r1, r9 - strb r0, [r1] - ldrb r0, [r1] - lsrs r0, 2 - strb r0, [r1] - mov r0, sp - mov r2, r8 - strh r2, [r0, 0x6] - ldr r1, =gBattleMoves - mov r2, r8 - lsls r0, r2, 1 - add r0, r8 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x4] - strb r0, [r7, 0x3] - movs r4, 0 - mov r5, sp -_08069540: - adds r1, r4, 0 - adds r1, 0xD - adds r0, r6, 0 - adds r2, r5, 0 - bl pokemon_setattr_encrypted - adds r1, r4, 0 - adds r1, 0x11 - adds r2, r7, r4 - adds r0, r6, 0 - bl pokemon_setattr_encrypted - adds r5, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - ble _08069540 - adds r0, r6, 0 - movs r1, 0x15 - mov r2, r9 - bl pokemon_setattr_encrypted - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80694D0 - - thumb_func_start sub_806957C -sub_806957C: @ 806957C - 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, 0x4] - str r2, [sp, 0x8] - ldr r0, [sp, 0x50] - ldr r1, [sp, 0x54] - ldr r2, [sp, 0x58] - ldr r4, [sp, 0x5C] - lsls r3, 16 - lsrs r3, 16 - str r3, [sp, 0xC] - lsls r0, 16 - lsrs r3, r0, 16 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x10] - lsls r4, 24 - lsrs r4, 24 - str r4, [sp, 0x14] - movs r5, 0 - cmp r3, 0 - bne _080695D4 - ldr r2, =0x020244e0 - ldr r1, =gBattleMoves - ldr r3, [sp, 0x8] - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x1] - strh r0, [r2] - b _080695D8 - .pool -_080695D4: - ldr r0, =0x020244e0 - strh r3, [r0] -_080695D8: - cmp r7, 0 - bne _080695F8 - ldr r1, =gBattleMoves - ldr r7, [sp, 0x8] - lsls r0, r7, 1 - adds r0, r7 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x2] - mov r10, r0 - b _08069602 - .pool -_080695F8: - movs r0, 0x3F - mov r10, r0 - mov r1, r10 - ands r1, r7 - mov r10, r1 -_08069602: - ldrh r7, [r6, 0x2] - ldr r2, [sp, 0x4] - ldrh r2, [r2, 0x4] - str r2, [sp, 0x18] - ldrh r3, [r6, 0x8] - mov r8, r3 - ldr r0, [sp, 0x4] - ldrh r0, [r0, 0xA] - str r0, [sp, 0x1C] - ldrh r0, [r6, 0x2E] - cmp r0, 0xAF - bne _08069634 - ldr r1, =0x02024404 - ldr r2, [sp, 0x10] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r3, [r0, 0x7] - mov r9, r3 - ldrb r0, [r0, 0x1A] - b _0806964A - .pool -_08069634: - ldrh r0, [r6, 0x2E] - bl itemid_get_x12 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldrh r0, [r6, 0x2E] - bl itemid_get_quality - lsls r0, 24 - lsrs r0, 24 -_0806964A: - str r0, [sp, 0x24] - ldr r1, [sp, 0x4] - ldrh r0, [r1, 0x2E] - cmp r0, 0xAF - bne _0806967E - ldr r1, =0x02024404 - ldr r2, [sp, 0x14] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x7] - str r0, [sp, 0x20] - b _08069694 - .pool -_0806966C: - ldr r0, [sp, 0x24] - adds r0, 0x64 - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r7, r0, 16 - b _0806977C -_0806967E: - ldr r3, [sp, 0x4] - ldrh r0, [r3, 0x2E] - bl itemid_get_x12 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x20] - ldr r1, [sp, 0x4] - ldrh r0, [r1, 0x2E] - bl itemid_get_quality -_08069694: - adds r0, r6, 0 - adds r0, 0x20 - ldrb r1, [r0] - str r0, [sp, 0x28] - cmp r1, 0x25 - beq _080696A4 - cmp r1, 0x4A - bne _080696A8 -_080696A4: - lsls r0, r7, 17 - lsrs r7, r0, 16 -_080696A8: - ldr r0, =0x00000867 - ldr r1, [sp, 0x10] - bl sub_8069ED8 - lsls r0, 24 - cmp r0, 0 - beq _080696C4 - movs r0, 0x6E - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r7, r0, 16 -_080696C4: - ldr r0, =0x0000086b - ldr r1, [sp, 0x14] - bl sub_8069ED8 - lsls r0, 24 - cmp r0, 0 - beq _080696E4 - movs r0, 0x6E - ldr r2, [sp, 0x18] - muls r0, r2 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x18] -_080696E4: - ldr r4, =0x0000086d - adds r0, r4, 0 - ldr r1, [sp, 0x10] - bl sub_8069ED8 - lsls r0, 24 - cmp r0, 0 - beq _08069708 - movs r0, 0x6E - mov r3, r8 - muls r3, r0 - adds r0, r3, 0 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 -_08069708: - adds r0, r4, 0 - ldr r1, [sp, 0x14] - bl sub_8069ED8 - lsls r0, 24 - cmp r0, 0 - beq _08069728 - movs r0, 0x6E - ldr r1, [sp, 0x1C] - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x1C] -_08069728: - movs r2, 0 - ldr r4, =gUnknown_08329D74 - ldr r3, [sp, 0x4] - adds r3, 0x20 - str r3, [sp, 0x2C] - adds r3, r4, 0 -_08069734: - lsls r1, r2, 1 - ldrb r0, [r3] - cmp r9, r0 - bne _08069774 - adds r0, r4, 0x1 - adds r0, r1, r0 - ldrb r0, [r0] - cmp r10, r0 - bne _08069774 - mov r1, r10 - cmp r1, 0x8 - bls _0806966C - ldr r0, [sp, 0x24] - adds r0, 0x64 - mov r2, r8 - muls r2, r0 - adds r0, r2, 0 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - b _0806977C - .pool -_08069774: - adds r3, 0x2 - adds r2, 0x1 - cmp r2, 0x10 - bls _08069734 -_0806977C: - mov r3, r9 - cmp r3, 0x1D - bne _08069790 - movs r0, 0x96 - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r7, r0, 16 -_08069790: - mov r0, r9 - cmp r0, 0x22 - bne _080697C6 - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x003f0100 - ands r0, r1 - cmp r0, 0 - bne _080697C6 - ldr r1, =0xfffffe69 - adds r0, r1, 0 - ldrh r2, [r6] - adds r0, r2 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _080697C6 - movs r0, 0x96 - mov r3, r8 - muls r3, r0 - adds r0, r3, 0 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 -_080697C6: - ldr r0, [sp, 0x20] - cmp r0, 0x22 - bne _080697FC - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x003f0100 - ands r0, r1 - cmp r0, 0 - bne _080697FC - ldr r1, =0xfffffe69 - adds r0, r1, 0 - ldr r2, [sp, 0x4] - ldrh r2, [r2] - adds r0, r2 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _080697FC - movs r0, 0x96 - ldr r3, [sp, 0x1C] - muls r0, r3 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x1C] -_080697FC: - mov r0, r9 - cmp r0, 0x23 - bne _08069812 - ldrh r1, [r6] - ldr r0, =0x00000175 - cmp r1, r0 - bne _08069812 - mov r1, r8 - lsls r0, r1, 17 - lsrs r0, 16 - mov r8, r0 -_08069812: - ldr r2, [sp, 0x20] - cmp r2, 0x24 - bne _0806982A - ldr r3, [sp, 0x4] - ldrh r1, [r3] - ldr r0, =0x00000175 - cmp r1, r0 - bne _0806982A - ldr r1, [sp, 0x1C] - lsls r0, r1, 17 - lsrs r0, 16 - str r0, [sp, 0x1C] -_0806982A: - mov r2, r9 - cmp r2, 0x2D - bne _0806983E - ldrh r0, [r6] - cmp r0, 0x19 - bne _0806983E - mov r3, r8 - lsls r0, r3, 17 - lsrs r0, 16 - mov r8, r0 -_0806983E: - ldr r0, [sp, 0x20] - cmp r0, 0x40 - bne _08069854 - ldr r1, [sp, 0x4] - ldrh r0, [r1] - cmp r0, 0x84 - bne _08069854 - ldr r2, [sp, 0x18] - lsls r0, r2, 17 - lsrs r0, 16 - str r0, [sp, 0x18] -_08069854: - mov r3, r9 - cmp r3, 0x41 - bne _0806986A - ldrh r0, [r6] - subs r0, 0x68 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _0806986A - lsls r0, r7, 17 - lsrs r7, r0, 16 -_0806986A: - ldr r1, [sp, 0x2C] - ldrb r0, [r1] - cmp r0, 0x2F - bne _08069882 - mov r2, r10 - cmp r2, 0xA - beq _0806987C - cmp r2, 0xF - bne _08069882 -_0806987C: - mov r3, r8 - lsrs r3, 1 - mov r8, r3 -_08069882: - ldr r0, [sp, 0x28] - ldrb r4, [r0] - cmp r4, 0x37 - bne _08069898 - movs r0, 0x96 - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r7, r0, 16 -_08069898: - cmp r4, 0x39 - bne _080698C6 - movs r0, 0 - str r0, [sp] - movs r0, 0xE - movs r1, 0 - movs r2, 0x3A - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _080698C6 - movs r0, 0x96 - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 -_080698C6: - ldr r2, [sp, 0x28] - ldrb r0, [r2] - cmp r0, 0x3A - bne _080698F8 - movs r0, 0 - str r0, [sp] - movs r0, 0xE - movs r1, 0 - movs r2, 0x39 - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _080698F8 - movs r0, 0x96 - mov r3, r8 - muls r3, r0 - adds r0, r3, 0 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 -_080698F8: - ldr r1, [sp, 0x28] - ldrb r0, [r1] - cmp r0, 0x3E - bne _08069914 - ldr r0, [r6, 0x4C] - cmp r0, 0 - beq _08069914 - movs r0, 0x96 - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r7, r0, 16 -_08069914: - ldr r2, [sp, 0x2C] - ldrb r0, [r2] - cmp r0, 0x3F - bne _08069936 - ldr r3, [sp, 0x4] - ldr r0, [r3, 0x4C] - cmp r0, 0 - beq _08069936 - movs r0, 0x96 - ldr r1, [sp, 0x18] - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x18] -_08069936: - mov r2, r10 - cmp r2, 0xD - bne _0806995A - movs r0, 0 - str r0, [sp] - movs r0, 0xE - movs r1, 0 - movs r2, 0 - movs r3, 0xFD - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _0806995A - ldr r1, =0x020244e0 - ldrh r0, [r1] - lsrs r0, 1 - strh r0, [r1] -_0806995A: - mov r3, r10 - cmp r3, 0xA - bne _0806997E - movs r0, 0 - str r0, [sp] - movs r0, 0xE - movs r1, 0 - movs r2, 0 - movs r3, 0xFE - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _0806997E - ldr r1, =0x020244e0 - ldrh r0, [r1] - lsrs r0, 1 - strh r0, [r1] -_0806997E: - mov r0, r10 - cmp r0, 0xC - bne _080699AE - ldr r1, [sp, 0x28] - ldrb r0, [r1] - cmp r0, 0x41 - bne _080699AE - ldrh r0, [r6, 0x2C] - movs r1, 0x3 - bl __udivsi3 - ldrh r1, [r6, 0x28] - lsls r0, 16 - lsrs r0, 16 - cmp r1, r0 - bhi _080699AE - ldr r4, =0x020244e0 - ldrh r1, [r4] - movs r0, 0x96 - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - strh r0, [r4] -_080699AE: - mov r2, r10 - cmp r2, 0xA - bne _080699DE - ldr r3, [sp, 0x28] - ldrb r0, [r3] - cmp r0, 0x42 - bne _080699DE - ldrh r0, [r6, 0x2C] - movs r1, 0x3 - bl __udivsi3 - ldrh r1, [r6, 0x28] - lsls r0, 16 - lsrs r0, 16 - cmp r1, r0 - bhi _080699DE - ldr r4, =0x020244e0 - ldrh r1, [r4] - movs r0, 0x96 - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - strh r0, [r4] -_080699DE: - mov r0, r10 - cmp r0, 0xB - bne _08069A0E - ldr r1, [sp, 0x28] - ldrb r0, [r1] - cmp r0, 0x43 - bne _08069A0E - ldrh r0, [r6, 0x2C] - movs r1, 0x3 - bl __udivsi3 - ldrh r1, [r6, 0x28] - lsls r0, 16 - lsrs r0, 16 - cmp r1, r0 - bhi _08069A0E - ldr r4, =0x020244e0 - ldrh r1, [r4] - movs r0, 0x96 - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - strh r0, [r4] -_08069A0E: - mov r2, r10 - cmp r2, 0x6 - bne _08069A3E - ldr r3, [sp, 0x28] - ldrb r0, [r3] - cmp r0, 0x44 - bne _08069A3E - ldrh r0, [r6, 0x2C] - movs r1, 0x3 - bl __udivsi3 - ldrh r1, [r6, 0x28] - lsls r0, 16 - lsrs r0, 16 - cmp r1, r0 - bhi _08069A3E - ldr r4, =0x020244e0 - ldrh r1, [r4] - movs r0, 0x96 - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - strh r0, [r4] -_08069A3E: - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0x7 - bne _08069A58 - ldr r0, [sp, 0x18] - lsrs r0, 1 - str r0, [sp, 0x18] -_08069A58: - mov r1, r10 - cmp r1, 0x8 - bls _08069A60 - b _08069BC2 -_08069A60: - ldr r0, =0x02024211 - ldrb r1, [r0] - adds r4, r0, 0 - cmp r1, 0x2 - bne _08069AA0 - movs r0, 0x19 - ldrsb r0, [r6, r0] - cmp r0, 0x6 - ble _08069A9C - ldr r2, =gUnknown_08329D2E - b _08069AA6 - .pool -_08069A9C: - adds r5, r7, 0 - b _08069ABE -_08069AA0: - ldr r2, =gUnknown_08329D2E - movs r0, 0x19 - ldrsb r0, [r6, r0] -_08069AA6: - lsls r0, 1 - adds r1, r0, r2 - ldrb r1, [r1] - adds r5, r7, 0 - muls r5, r1 - adds r2, 0x1 - adds r0, r2 - ldrb r1, [r0] - adds r0, r5, 0 - bl __divsi3 - adds r5, r0, 0 -_08069ABE: - ldr r0, =0x020244e0 - ldrh r0, [r0] - muls r5, r0 - adds r0, r6, 0 - adds r0, 0x2A - ldrb r0, [r0] - lsls r0, 1 - movs r1, 0x5 - bl __divsi3 - adds r0, 0x2 - muls r5, r0 - ldrb r0, [r4] - cmp r0, 0x2 - bne _08069AFC - ldr r2, [sp, 0x4] - movs r0, 0x1A - ldrsb r0, [r2, r0] - cmp r0, 0x5 - bgt _08069AF8 - ldr r2, =gUnknown_08329D2E - ldr r3, [sp, 0x4] - movs r0, 0x1A - ldrsb r0, [r3, r0] - b _08069B04 - .pool -_08069AF8: - ldr r3, [sp, 0x18] - b _08069B1E -_08069AFC: - ldr r2, =gUnknown_08329D2E - ldr r1, [sp, 0x4] - movs r0, 0x1A - ldrsb r0, [r1, r0] -_08069B04: - lsls r0, 1 - adds r1, r0, r2 - ldrb r1, [r1] - ldr r7, [sp, 0x18] - adds r3, r7, 0 - muls r3, r1 - adds r2, 0x1 - adds r0, r2 - ldrb r1, [r0] - adds r0, r3, 0 - bl __divsi3 - adds r3, r0, 0 -_08069B1E: - adds r0, r5, 0 - adds r1, r3, 0 - bl __divsi3 - adds r5, r0, 0 - movs r1, 0x32 - bl __divsi3 - adds r5, r0, 0 - ldr r0, [r6, 0x4C] - movs r1, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08069B48 - ldr r1, [sp, 0x28] - ldrb r0, [r1] - cmp r0, 0x3E - beq _08069B48 - lsrs r0, r5, 31 - adds r0, r5, r0 - asrs r5, r0, 1 -_08069B48: - movs r0, 0x1 - ldr r2, [sp, 0xC] - ands r0, r2 - cmp r0, 0 - beq _08069B8A - ldrb r1, [r4] - cmp r1, 0x1 - bne _08069B8A - ldr r0, =0x02022fec - ldr r0, [r0] - ands r0, r1 - cmp r0, 0 - beq _08069B84 - movs r0, 0x2 - bl sub_8069DEC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08069B84 - adds r0, r5, 0 - movs r1, 0x3 - bl __divsi3 - lsls r5, r0, 1 - b _08069B8A - .pool -_08069B84: - lsrs r0, r5, 31 - adds r0, r5, r0 - asrs r5, r0, 1 -_08069B8A: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08069BBC - ldr r0, =gBattleMoves - ldr r3, [sp, 0x8] - lsls r1, r3, 1 - adds r1, r3 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x6] - cmp r0, 0x8 - bne _08069BBC - movs r0, 0x2 - bl sub_8069DEC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08069BBC - lsrs r0, r5, 31 - adds r0, r5, r0 - asrs r5, r0, 1 -_08069BBC: - cmp r5, 0 - bne _08069BC2 - movs r5, 0x1 -_08069BC2: - mov r7, r10 - cmp r7, 0x9 - bne _08069BCA - movs r5, 0 -_08069BCA: - mov r0, r10 - cmp r0, 0x9 - bhi _08069BD2 - b _08069DD4 -_08069BD2: - ldr r0, =0x02024211 - ldrb r1, [r0] - adds r4, r0, 0 - cmp r1, 0x2 - bne _08069BFC - movs r0, 0x1C - ldrsb r0, [r6, r0] - cmp r0, 0x6 - ble _08069BF8 - ldr r2, =gUnknown_08329D2E - b _08069C02 - .pool -_08069BF8: - mov r5, r8 - b _08069C1A -_08069BFC: - ldr r2, =gUnknown_08329D2E - movs r0, 0x1C - ldrsb r0, [r6, r0] -_08069C02: - lsls r0, 1 - adds r1, r0, r2 - ldrb r1, [r1] - mov r5, r8 - muls r5, r1 - adds r2, 0x1 - adds r0, r2 - ldrb r1, [r0] - adds r0, r5, 0 - bl __divsi3 - adds r5, r0, 0 -_08069C1A: - ldr r0, =0x020244e0 - ldrh r0, [r0] - muls r5, r0 - adds r0, r6, 0 - adds r0, 0x2A - ldrb r0, [r0] - lsls r0, 1 - movs r1, 0x5 - bl __divsi3 - adds r0, 0x2 - muls r5, r0 - ldrb r0, [r4] - cmp r0, 0x2 - bne _08069C54 - ldr r1, [sp, 0x4] - movs r0, 0x1D - ldrsb r0, [r1, r0] - cmp r0, 0x5 - bgt _08069C50 - ldr r2, =gUnknown_08329D2E - b _08069C5C - .pool -_08069C50: - ldr r3, [sp, 0x1C] - b _08069C76 -_08069C54: - ldr r2, =gUnknown_08329D2E - ldr r7, [sp, 0x4] - movs r0, 0x1D - ldrsb r0, [r7, r0] -_08069C5C: - lsls r0, 1 - adds r1, r0, r2 - ldrb r1, [r1] - ldr r6, [sp, 0x1C] - adds r3, r6, 0 - muls r3, r1 - adds r2, 0x1 - adds r0, r2 - ldrb r1, [r0] - adds r0, r3, 0 - bl __divsi3 - adds r3, r0, 0 -_08069C76: - adds r0, r5, 0 - adds r1, r3, 0 - bl __divsi3 - adds r5, r0, 0 - movs r1, 0x32 - bl __divsi3 - adds r5, r0, 0 - movs r0, 0x2 - ldr r7, [sp, 0xC] - ands r0, r7 - cmp r0, 0 - beq _08069CCA - ldrb r1, [r4] - cmp r1, 0x1 - bne _08069CCA - ldr r0, =0x02022fec - ldr r0, [r0] - ands r0, r1 - cmp r0, 0 - beq _08069CC4 - movs r0, 0x2 - bl sub_8069DEC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08069CC4 - adds r0, r5, 0 - movs r1, 0x3 - bl __divsi3 - lsls r5, r0, 1 - b _08069CCA - .pool -_08069CC4: - lsrs r0, r5, 31 - adds r0, r5, r0 - asrs r5, r0, 1 -_08069CCA: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08069CFC - ldr r0, =gBattleMoves - ldr r2, [sp, 0x8] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x6] - cmp r0, 0x8 - bne _08069CFC - movs r0, 0x2 - bl sub_8069DEC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08069CFC - lsrs r0, r5, 31 - adds r0, r5, r0 - asrs r5, r0, 1 -_08069CFC: - movs r0, 0 - str r0, [sp] - movs r0, 0xE - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08069DAC - str r0, [sp] - movs r0, 0xE - movs r1, 0 - movs r2, 0x4D - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - bne _08069DAC - ldr r2, =0x020243cc - ldrh r1, [r2] - movs r0, 0x1 - ands r0, r1 - adds r4, r2, 0 - cmp r0, 0 - beq _08069D64 - mov r3, r10 - cmp r3, 0xA - beq _08069D50 - cmp r3, 0xB - beq _08069D58 - b _08069D64 - .pool -_08069D50: - lsrs r0, r5, 31 - adds r0, r5, r0 - asrs r5, r0, 1 - b _08069D64 -_08069D58: - lsls r0, r5, 4 - subs r0, r5 - movs r1, 0xA - bl __divsi3 - adds r5, r0, 0 -_08069D64: - ldrh r1, [r4] - movs r0, 0x9F - ands r0, r1 - cmp r0, 0 - beq _08069D7C - ldr r0, =0x020241ea - ldrh r0, [r0] - cmp r0, 0x4C - bne _08069D7C - lsrs r0, r5, 31 - adds r0, r5, r0 - asrs r5, r0, 1 -_08069D7C: - ldrh r1, [r4] - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - beq _08069DAC - mov r6, r10 - cmp r6, 0xA - beq _08069D98 - cmp r6, 0xB - beq _08069DA6 - b _08069DAC - .pool -_08069D98: - lsls r0, r5, 4 - subs r0, r5 - movs r1, 0xA - bl __divsi3 - adds r5, r0, 0 - b _08069DAC -_08069DA6: - lsrs r0, r5, 31 - adds r0, r5, r0 - asrs r5, r0, 1 -_08069DAC: - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r0, [r0, 0x4] - ldr r7, [sp, 0x10] - lsls r1, r7, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08069DD4 - mov r0, r10 - cmp r0, 0xA - bne _08069DD4 - lsls r0, r5, 4 - subs r0, r5 - movs r1, 0xA - bl __divsi3 - adds r5, r0, 0 -_08069DD4: - adds r0, r5, 0x2 - add sp, 0x30 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806957C - - thumb_func_start sub_8069DEC -sub_8069DEC: @ 8069DEC - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - movs r6, 0 - cmp r0, 0x1 - beq _08069E40 - cmp r0, 0x1 - bgt _08069E04 - cmp r0, 0 - beq _08069E0A - b _08069EC2 -_08069E04: - cmp r1, 0x2 - beq _08069E88 - b _08069EC2 -_08069E0A: - movs r5, 0 - ldr r0, =0x02024064 - ldrb r3, [r0] - ldr r4, =0x02024210 - ldr r2, =gUnknown_0832A328 -_08069E14: - cmp r5, r3 - beq _08069E28 - ldrb r0, [r4] - ldr r1, [r2] - ands r0, r1 - cmp r0, 0 - bne _08069E28 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_08069E28: - adds r2, 0x4 - adds r5, 0x1 - cmp r5, 0x3 - ble _08069E14 - b _08069EC2 - .pool -_08069E40: - movs r5, 0 -_08069E42: - lsls r0, r5, 24 - lsrs r0, 24 - bl battle_side_get_owner - adds r4, r0, 0 - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - bne _08069E74 - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - lsls r0, r5, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _08069E74 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_08069E74: - adds r5, 0x1 - cmp r5, 0x3 - ble _08069E42 - b _08069EC2 - .pool -_08069E88: - movs r5, 0 -_08069E8A: - lsls r0, r5, 24 - lsrs r0, 24 - bl battle_side_get_owner - adds r4, r0, 0 - ldr r0, =0x0202420c - ldrb r0, [r0] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - bne _08069EBC - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - lsls r0, r5, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _08069EBC - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_08069EBC: - adds r5, 0x1 - cmp r5, 0x3 - ble _08069E8A -_08069EC2: - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8069DEC - - thumb_func_start sub_8069ED8 -sub_8069ED8: @ 8069ED8 - push {r4,r5,lr} - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 24 - lsrs r2, r1, 24 - ldr r4, =0x02022fec - ldr r0, [r4] - ldr r1, =0x023f0902 - ands r0, r1 - cmp r0, 0 - bne _08069F1C - adds r0, r2, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08069F1C - ldr r0, [r4] - movs r1, 0x8 - ands r0, r1 - cmp r0, 0 - beq _08069F10 - ldr r0, =0x02038bca - ldrh r1, [r0] - movs r0, 0x80 - lsls r0, 3 - cmp r1, r0 - beq _08069F1C -_08069F10: - adds r0, r5, 0 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _08069F2C -_08069F1C: - movs r0, 0 - b _08069F2E - .pool -_08069F2C: - movs r0, 0x1 -_08069F2E: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8069ED8 - - thumb_func_start sub_8069F34 -sub_8069F34: @ 8069F34 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - bl battle_get_per_side_status - movs r1, 0x1 - movs r6, 0x1 - adds r4, r6, 0 - ands r4, r0 - eors r4, r1 - adds r5, r4, 0 - ldr r0, =0x02022fec - ldr r0, [r0] - ands r0, r6 - cmp r0, 0 - bne _08069F5C - adds r0, r4, 0 - b _08069FA6 - .pool -_08069F5C: - movs r0, 0 - bl sub_8069DEC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _08069F80 - bl GenerateRandomNumber - adds r1, r6, 0 - ands r1, r0 - cmp r1, 0 - bne _08069F7C - movs r0, 0x2 - eors r0, r4 - b _08069FA6 -_08069F7C: - adds r0, r4, 0 - b _08069FA6 -_08069F80: - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - lsls r0, r4, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _08069FA0 - adds r0, r4, 0 - b _08069FA6 - .pool -_08069FA0: - movs r0, 0x2 - eors r5, r0 - adds r0, r5, 0 -_08069FA6: - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8069F34 - - thumb_func_start pokemon_get_gender -pokemon_get_gender: @ 8069FB4 - push {lr} - bl pokemon_roll_gender - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end pokemon_get_gender - - thumb_func_start pokemon_roll_gender -pokemon_roll_gender: @ 8069FC4 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr_encrypted - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - bl pokemon_getattr_encrypted - adds r2, r0, 0 - ldr r1, =gBaseStats - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x10] - cmp r0, 0 - beq _0806A01A - cmp r0, 0 - blt _08069FFC - cmp r0, 0xFF - bgt _08069FFC - cmp r0, 0xFE - bge _0806A01A -_08069FFC: - ldr r1, =gBaseStats - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x10] - movs r0, 0xFF - ands r0, r2 - cmp r1, r0 - bhi _0806A018 - movs r0, 0 - b _0806A01A - .pool -_0806A018: - movs r0, 0xFE -_0806A01A: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end pokemon_roll_gender - - thumb_func_start pokemon_species_get_gender_info -pokemon_species_get_gender_info: @ 806A020 - push {lr} - adds r3, r1, 0 - lsls r0, 16 - lsrs r2, r0, 16 - ldr r1, =gBaseStats - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x10] - cmp r0, 0 - beq _0806A062 - cmp r0, 0 - blt _0806A044 - cmp r0, 0xFF - bgt _0806A044 - cmp r0, 0xFE - bge _0806A062 -_0806A044: - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x10] - movs r0, 0xFF - ands r0, r3 - cmp r1, r0 - bhi _0806A060 - movs r0, 0 - b _0806A062 - .pool -_0806A060: - movs r0, 0xFE -_0806A062: - pop {r1} - bx r1 - thumb_func_end pokemon_species_get_gender_info - - thumb_func_start sub_806A068 -sub_806A068: @ 806A068 - push {r4-r7,lr} - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 24 - lsrs r4, r1, 24 - ldr r0, =0x020244d4 - ldr r2, [r0] - cmp r2, 0 - beq _0806A09C - ldr r0, =0x0202499c - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 3 - adds r1, r2, r1 - adds r2, r0, 0 - adds r1, 0x14 - ldm r1!, {r3,r6,r7} - stm r2!, {r3,r6,r7} - ldm r1!, {r3,r6,r7} - stm r2!, {r3,r6,r7} - adds r3, r0, 0 - b _0806A0DA - .pool -_0806A09C: - ldr r1, =0x020249b4 - ldr r0, [r1] - cmp r0, 0 - beq _0806A0B4 - ldr r3, =0x0202499c - ldr r2, [r0, 0xC] - b _0806A0C8 - .pool -_0806A0B4: - ldr r0, [r1, 0x4] - cmp r0, 0 - beq _0806A0C4 - ldr r3, =0x0202499c - ldr r2, [r0, 0xC] - b _0806A0C8 - .pool -_0806A0C4: - ldr r3, =0x0202499c - ldr r2, =gUnknown_08329D98 -_0806A0C8: - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 3 - adds r1, r3, 0 - adds r0, r2 - ldm r0!, {r2,r6,r7} - stm r1!, {r2,r6,r7} - ldm r0!, {r2,r6,r7} - stm r1!, {r2,r6,r7} -_0806A0DA: - adds r2, r3, 0 - strh r5, [r2, 0x2] - cmp r4, 0 - beq _0806A0E6 - cmp r4, 0x2 - bne _0806A0F8 -_0806A0E6: - ldr r0, =gUnknown_082FF70C - str r0, [r2, 0x8] - b _0806A122 - .pool -_0806A0F8: - movs r0, 0xFA - lsls r0, 1 - cmp r5, r0 - bls _0806A118 - ldr r0, =gUnknown_08309AAC - ldr r3, =0xfffffe0c - adds r1, r5, r3 - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - str r0, [r2, 0x8] - b _0806A122 - .pool -_0806A118: - ldr r0, =gUnknown_08309AAC - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - str r0, [r3, 0x8] -_0806A122: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806A068 - - thumb_func_start template_build_for_pokemon_or_trainer -template_build_for_pokemon_or_trainer: @ 806A12C - push {r4-r6,lr} - lsls r0, 16 - lsrs r4, r0, 16 - lsls r1, 24 - lsrs r3, r1, 24 - ldr r0, =0x0202499c - strh r4, [r0, 0x2] - adds r5, r0, 0 - cmp r3, 0 - beq _0806A144 - cmp r3, 0x2 - bne _0806A170 -_0806A144: - ldr r2, =gUnknown_08329DF8 - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 3 - adds r1, r5, 0 - adds r0, r2 - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - ldr r1, =gUnknown_08305D0C - lsls r0, r4, 2 - adds r0, r1 - ldr r0, [r0] - b _0806A1B0 - .pool -_0806A170: - ldr r0, =0x020244d4 - ldr r1, [r0] - cmp r1, 0 - beq _0806A194 - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 3 - adds r0, r1, r0 - adds r1, r5, 0 - adds r0, 0x14 - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - b _0806A1A8 - .pool -_0806A194: - ldr r0, =gUnknown_08329D98 - lsls r1, r3, 1 - adds r1, r3 - lsls r1, 3 - adds r2, r5, 0 - adds r1, r0 - ldm r1!, {r0,r3,r6} - stm r2!, {r0,r3,r6} - ldm r1!, {r0,r3,r6} - stm r2!, {r0,r3,r6} -_0806A1A8: - ldr r0, =gUnknown_0830536C - lsls r1, r4, 2 - adds r1, r0 - ldr r0, [r1] -_0806A1B0: - str r0, [r5, 0x8] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end template_build_for_pokemon_or_trainer - - thumb_func_start sub_806A1C0 -sub_806A1C0: @ 806A1C0 - push {r4-r6,lr} - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 24 - lsrs r4, r1, 24 - ldr r0, =0x020244d4 - ldr r2, [r0] - cmp r2, 0 - beq _0806A1F4 - ldr r0, =0x0202499c - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 3 - adds r1, r2, r1 - adds r2, r0, 0 - adds r1, 0x14 - ldm r1!, {r3,r4,r6} - stm r2!, {r3,r4,r6} - ldm r1!, {r3,r4,r6} - stm r2!, {r3,r4,r6} - adds r3, r0, 0 - b _0806A20A - .pool -_0806A1F4: - ldr r3, =0x0202499c - ldr r2, =gUnknown_08329D98 - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 3 - adds r1, r3, 0 - adds r0, r2 - ldm r0!, {r2,r4,r6} - stm r1!, {r2,r4,r6} - ldm r0!, {r2,r4,r6} - stm r1!, {r2,r4,r6} -_0806A20A: - strh r5, [r3, 0x2] - ldr r0, =gUnknown_0830536C - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - str r0, [r3, 0x8] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806A1C0 - - thumb_func_start pokemon_encrypt -@ void pokemon_encrypt(pokemon *mon) -pokemon_encrypt: @ 806A228 - push {r4,lr} - adds r3, r0, 0 - movs r4, 0 - adds r2, r3, 0 - adds r2, 0x20 -_0806A232: - ldr r0, [r2] - ldr r1, [r3] - eors r0, r1 - str r0, [r2] - ldr r1, [r3, 0x4] - eors r0, r1 - stm r2!, {r0} - adds r4, 0x1 - cmp r4, 0xB - bls _0806A232 - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemon_encrypt - - thumb_func_start pokemon_decrypt -@ void pokemon_decrypt(pokemon *mon) -pokemon_decrypt: @ 806A24C - push {r4,lr} - adds r3, r0, 0 - movs r4, 0 - adds r2, r3, 0 - adds r2, 0x20 -_0806A256: - ldr r0, [r2] - ldr r1, [r3, 0x4] - eors r0, r1 - str r0, [r2] - ldr r1, [r3] - eors r0, r1 - stm r2!, {r0} - adds r4, 0x1 - cmp r4, 0xB - bls _0806A256 - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemon_decrypt - - thumb_func_start pokemon_data_permutator -@ int pokemon_data_permutator(pokemon *mon, int a2, u8 a3) -pokemon_data_permutator: @ 806A270 - push {r4-r6,lr} - adds r5, r0, 0 - adds r0, r1, 0 - lsls r2, 24 - lsrs r4, r2, 24 - movs r6, 0 - movs r1, 0x18 - bl __umodsi3 - cmp r0, 0x17 - bls _0806A288 - b _0806A510 -_0806A288: - lsls r0, 2 - ldr r1, =_0806A298 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0806A298: - .4byte _0806A2F8 - .4byte _0806A31C - .4byte _0806A338 - .4byte _0806A34E - .4byte _0806A364 - .4byte _0806A380 - .4byte _0806A396 - .4byte _0806A3AC - .4byte _0806A3BC - .4byte _0806A3DA - .4byte _0806A3F2 - .4byte _0806A402 - .4byte _0806A416 - .4byte _0806A428 - .4byte _0806A43A - .4byte _0806A44C - .4byte _0806A45E - .4byte _0806A470 - .4byte _0806A482 - .4byte _0806A498 - .4byte _0806A4AC - .4byte _0806A4BA - .4byte _0806A4CC - .4byte _0806A4E0 -_0806A2F8: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - bne _0806A302 - b _0806A508 -_0806A302: - cmp r4, 0x1 - bgt _0806A30E -_0806A306: - cmp r4, 0 - bne _0806A30C - b _0806A50E -_0806A30C: - b _0806A510 -_0806A30E: - cmp r4, 0x2 - bne _0806A314 - b _0806A502 -_0806A314: - cmp r4, 0x3 - beq _0806A31A - b _0806A510 -_0806A31A: - b _0806A4FC -_0806A31C: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - bne _0806A326 - b _0806A508 -_0806A326: - cmp r4, 0x1 - ble _0806A306 -_0806A32A: - cmp r4, 0x2 - bne _0806A330 - b _0806A4FC -_0806A330: - cmp r4, 0x3 - beq _0806A336 - b _0806A510 -_0806A336: - b _0806A502 -_0806A338: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - bne _0806A342 - b _0806A502 -_0806A342: - cmp r4, 0x1 - ble _0806A306 - cmp r4, 0x2 - bne _0806A34C - b _0806A508 -_0806A34C: - b _0806A314 -_0806A34E: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - bne _0806A358 - b _0806A4FC -_0806A358: - cmp r4, 0x1 - ble _0806A306 - cmp r4, 0x2 - bne _0806A362 - b _0806A508 -_0806A362: - b _0806A330 -_0806A364: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - bne _0806A36E - b _0806A502 -_0806A36E: - cmp r4, 0x1 - ble _0806A306 -_0806A372: - cmp r4, 0x2 - bne _0806A378 - b _0806A4FC -_0806A378: - cmp r4, 0x3 - beq _0806A37E - b _0806A510 -_0806A37E: - b _0806A508 -_0806A380: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - bne _0806A38A - b _0806A4FC -_0806A38A: - cmp r4, 0x1 - ble _0806A306 - cmp r4, 0x2 - bne _0806A394 - b _0806A502 -_0806A394: - b _0806A378 -_0806A396: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - bne _0806A3A0 - b _0806A50E -_0806A3A0: - cmp r4, 0x1 - bgt _0806A30E -_0806A3A4: - cmp r4, 0 - bne _0806A3AA - b _0806A508 -_0806A3AA: - b _0806A510 -_0806A3AC: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - bne _0806A3B6 - b _0806A50E -_0806A3B6: - cmp r4, 0x1 - ble _0806A3A4 - b _0806A32A -_0806A3BC: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - bne _0806A3C6 - b _0806A50E -_0806A3C6: - cmp r4, 0x1 - bgt _0806A3D2 -_0806A3CA: - cmp r4, 0 - bne _0806A3D0 - b _0806A502 -_0806A3D0: - b _0806A510 -_0806A3D2: - cmp r4, 0x2 - bne _0806A3D8 - b _0806A508 -_0806A3D8: - b _0806A314 -_0806A3DA: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - bne _0806A3E4 - b _0806A50E -_0806A3E4: - cmp r4, 0x1 - bgt _0806A3EA - b _0806A4EC -_0806A3EA: - cmp r4, 0x2 - bne _0806A3F0 - b _0806A508 -_0806A3F0: - b _0806A330 -_0806A3F2: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - bne _0806A3FC - b _0806A50E -_0806A3FC: - cmp r4, 0x1 - ble _0806A3CA - b _0806A372 -_0806A402: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - bne _0806A40C - b _0806A50E -_0806A40C: - cmp r4, 0x1 - ble _0806A4EC - cmp r4, 0x2 - beq _0806A502 - b _0806A378 -_0806A416: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - beq _0806A502 - cmp r4, 0x1 - ble _0806A3A4 - cmp r4, 0x2 - beq _0806A50E - b _0806A314 -_0806A428: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - beq _0806A4FC - cmp r4, 0x1 - ble _0806A3A4 - cmp r4, 0x2 - beq _0806A50E - b _0806A330 -_0806A43A: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - beq _0806A508 - cmp r4, 0x1 - ble _0806A3CA - cmp r4, 0x2 - beq _0806A50E - b _0806A314 -_0806A44C: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - beq _0806A508 - cmp r4, 0x1 - ble _0806A4EC - cmp r4, 0x2 - beq _0806A50E - b _0806A330 -_0806A45E: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - beq _0806A4FC - cmp r4, 0x1 - ble _0806A3CA - cmp r4, 0x2 - beq _0806A50E - b _0806A378 -_0806A470: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - beq _0806A502 - cmp r4, 0x1 - ble _0806A4EC - cmp r4, 0x2 - beq _0806A50E - b _0806A378 -_0806A482: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - beq _0806A502 - cmp r4, 0x1 - ble _0806A3A4 -_0806A48E: - cmp r4, 0x2 - beq _0806A4FC -_0806A492: - cmp r4, 0x3 - bne _0806A510 - b _0806A50E -_0806A498: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - beq _0806A4FC - cmp r4, 0x1 - bgt _0806A4A6 - b _0806A3A4 -_0806A4A6: - cmp r4, 0x2 - beq _0806A502 - b _0806A492 -_0806A4AC: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - beq _0806A508 - cmp r4, 0x1 - ble _0806A3CA - b _0806A48E -_0806A4BA: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - beq _0806A508 - cmp r4, 0x1 - ble _0806A4EC - cmp r4, 0x2 - beq _0806A502 - b _0806A492 -_0806A4CC: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - beq _0806A4FC - cmp r4, 0x1 - bgt _0806A4DA - b _0806A3CA -_0806A4DA: - cmp r4, 0x2 - beq _0806A508 - b _0806A492 -_0806A4E0: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - beq _0806A502 - cmp r4, 0x1 - bgt _0806A4F2 -_0806A4EC: - cmp r4, 0 - beq _0806A4FC - b _0806A510 -_0806A4F2: - cmp r4, 0x2 - beq _0806A508 - cmp r4, 0x3 - beq _0806A50E - b _0806A510 -_0806A4FC: - adds r6, r5, 0 - adds r6, 0x44 - b _0806A510 -_0806A502: - adds r6, r5, 0 - adds r6, 0x38 - b _0806A510 -_0806A508: - adds r6, r5, 0 - adds r6, 0x2C - b _0806A510 -_0806A50E: - adds r6, r0, 0 -_0806A510: - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end pokemon_data_permutator - - thumb_func_start pokemon_getattr -@ int pokemon_getattr(pokemon *mon, enum pokemon_data_request req, void *data) -pokemon_getattr: @ 806A518 - push {r4,lr} - adds r4, r0, 0 - adds r3, r1, 0 - adds r0, r3, 0 - subs r0, 0x37 - cmp r0, 0x21 - bls _0806A528 - b _0806A666 -_0806A528: - lsls r0, 2 - ldr r1, =_0806A538 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0806A538: - .4byte _0806A5C0 - .4byte _0806A5C4 - .4byte _0806A5CC - .4byte _0806A5D4 - .4byte _0806A5DC - .4byte _0806A5EE - .4byte _0806A600 - .4byte _0806A612 - .4byte _0806A624 - .4byte _0806A65E - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A636 - .4byte _0806A63E - .4byte _0806A646 - .4byte _0806A64E - .4byte _0806A656 -_0806A5C0: - ldr r0, [r4, 0x50] - b _0806A66E -_0806A5C4: - adds r0, r4, 0 - adds r0, 0x54 - ldrb r0, [r0] - b _0806A66E -_0806A5CC: - adds r0, r4, 0 - adds r0, 0x56 - ldrh r0, [r0] - b _0806A66E -_0806A5D4: - adds r0, r4, 0 - adds r0, 0x58 - ldrh r0, [r0] - b _0806A66E -_0806A5DC: - adds r0, r4, 0 - movs r1, 0x1 - bl get_pokemon_data_3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _0806A66E - b _0806A636 -_0806A5EE: - adds r0, r4, 0 - movs r1, 0x2 - bl get_pokemon_data_3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _0806A66E - b _0806A63E -_0806A600: - adds r0, r4, 0 - movs r1, 0x3 - bl get_pokemon_data_3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _0806A66E - b _0806A646 -_0806A612: - adds r0, r4, 0 - movs r1, 0x4 - bl get_pokemon_data_3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _0806A66E - b _0806A64E -_0806A624: - adds r0, r4, 0 - movs r1, 0x5 - bl get_pokemon_data_3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _0806A66E - b _0806A656 -_0806A636: - adds r0, r4, 0 - adds r0, 0x5A - ldrh r0, [r0] - b _0806A66E -_0806A63E: - adds r0, r4, 0 - adds r0, 0x5C - ldrh r0, [r0] - b _0806A66E -_0806A646: - adds r0, r4, 0 - adds r0, 0x5E - ldrh r0, [r0] - b _0806A66E -_0806A64E: - adds r0, r4, 0 - adds r0, 0x60 - ldrh r0, [r0] - b _0806A66E -_0806A656: - adds r0, r4, 0 - adds r0, 0x62 - ldrh r0, [r0] - b _0806A66E -_0806A65E: - adds r0, r4, 0 - adds r0, 0x55 - ldrb r0, [r0] - b _0806A66E -_0806A666: - adds r0, r4, 0 - adds r1, r3, 0 - bl pokemon_getattr_encrypted -_0806A66E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end pokemon_getattr - - thumb_func_start pokemon_getattr_encrypted -@ int pokemon_getattr_encrypted(pokemon *mon, enum pokemon_data_request req, void *data) -pokemon_getattr_encrypted: @ 806A674 - 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] - adds r6, r2, 0 - movs r4, 0 - mov r9, r4 - mov r10, r4 - movs r7, 0 - movs r5, 0 - cmp r1, 0xA - ble _0806A6F2 - ldr r1, [r0] - movs r2, 0 - bl pokemon_data_permutator - mov r9, r0 - mov r0, r8 - ldr r1, [r0] - movs r2, 0x1 - bl pokemon_data_permutator - mov r10, r0 - mov r2, r8 - ldr r1, [r2] - mov r0, r8 - movs r2, 0x2 - bl pokemon_data_permutator - adds r7, r0, 0 - mov r0, r8 - ldr r1, [r0] - movs r2, 0x3 - bl pokemon_data_permutator - adds r5, r0, 0 - mov r0, r8 - bl pokemon_decrypt - mov r0, r8 - bl pokemon_calc_checksum - lsls r0, 16 - lsrs r0, 16 - mov r1, r8 - ldrh r1, [r1, 0x1C] - cmp r0, r1 - beq _0806A6F2 - mov r2, r8 - ldrb r0, [r2, 0x13] - movs r1, 0x1 - orrs r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2, 0x13] - ldrb r0, [r5, 0x7] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r5, 0x7] -_0806A6F2: - ldr r0, [sp] - cmp r0, 0x53 - bls _0806A6FA - b _0806AC8C -_0806A6FA: - lsls r0, 2 - ldr r1, =_0806A708 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0806A708: - .4byte _0806A858 - .4byte _0806A85E - .4byte _0806A864 - .4byte _0806A918 - .4byte _0806A91E - .4byte _0806A924 - .4byte _0806A92A - .4byte _0806A930 - .4byte _0806A94C - .4byte _0806A952 - .4byte _0806A958 - .4byte _0806A95E - .4byte _0806A976 - .4byte _0806A98E - .4byte _0806A98E - .4byte _0806A98E - .4byte _0806A98E - .4byte _0806A99A - .4byte _0806A99A - .4byte _0806A99A - .4byte _0806A99A - .4byte _0806A982 - .4byte _0806A9BC - .4byte _0806A9C0 - .4byte _0806A9C4 - .4byte _0806A97C - .4byte _0806A9A4 - .4byte _0806A9A8 - .4byte _0806A9AC - .4byte _0806A9B0 - .4byte _0806A9B4 - .4byte _0806A9B8 - .4byte _0806A988 - .4byte _0806A9C8 - .4byte _0806A9D4 - .4byte _0806A9D8 - .4byte _0806A9DC - .4byte _0806A9E4 - .4byte _0806A9EC - .4byte _0806A9F6 - .4byte _0806A9FE - .4byte _0806AA06 - .4byte _0806AA0E - .4byte _0806AA16 - .4byte _0806AA1E - .4byte _0806AA26 - .4byte _0806AA2A - .4byte _0806A9CC - .4byte _0806A9D0 - .4byte _0806A9F0 - .4byte _0806AA30 - .4byte _0806AA38 - .4byte _0806AA40 - .4byte _0806AA48 - .4byte _0806AA50 - .4byte _0806AC8C - .4byte _0806AC8C - .4byte _0806AC8C - .4byte _0806AC8C - .4byte _0806AC8C - .4byte _0806AC8C - .4byte _0806AC8C - .4byte _0806AC8C - .4byte _0806AC8C - .4byte _0806AC8C - .4byte _0806AAB6 - .4byte _0806AADC - .4byte _0806AA58 - .4byte _0806AA5E - .4byte _0806AA62 - .4byte _0806AA66 - .4byte _0806AA6A - .4byte _0806AA72 - .4byte _0806AA7A - .4byte _0806AA82 - .4byte _0806AA8A - .4byte _0806AA90 - .4byte _0806AA98 - .4byte _0806AAA0 - .4byte _0806AAA8 - .4byte _0806AAB0 - .4byte _0806AB16 - .4byte _0806AB70 - .4byte _0806ABF2 -_0806A858: - mov r1, r8 - ldr r4, [r1] - b _0806AC8C -_0806A85E: - mov r2, r8 - ldr r4, [r2, 0x4] - b _0806AC8C -_0806A864: - mov r0, r8 - ldrb r1, [r0, 0x13] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0806A89C - movs r4, 0 - ldr r0, =gUnknown_085CCB90 - ldrb r1, [r0] - adds r2, r0, 0 - cmp r1, 0xFF - beq _0806A944 - adds r3, r2, 0 -_0806A87E: - adds r0, r6, r4 - adds r1, r4, r3 - ldrb r1, [r1] - strb r1, [r0] - adds r4, 0x1 - cmp r4, 0x9 - bhi _0806A944 - adds r0, r4, r2 - ldrb r0, [r0] - cmp r0, 0xFF - bne _0806A87E - b _0806A944 - .pool -_0806A89C: - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0806A8BC - ldr r1, =gUnknown_085E8264 - adds r0, r6, 0 - bl CopyString - adds r0, r6, 0 - bl GetStringLength - lsls r0, 16 - lsrs r4, r0, 16 - b _0806AC8C - .pool -_0806A8BC: - mov r1, r8 - ldrb r0, [r1, 0x12] - cmp r0, 0x1 - bne _0806A902 - movs r0, 0xFC - strb r0, [r6] - movs r0, 0x15 - strb r0, [r6, 0x1] - movs r4, 0x2 - movs r3, 0 - ldrb r0, [r1, 0x8] - cmp r0, 0xFF - beq _0806A8F0 - mov r2, r8 - adds r2, 0x8 -_0806A8DA: - adds r1, r6, r4 - ldrb r0, [r2] - strb r0, [r1] - adds r4, 0x1 - adds r2, 0x1 - adds r3, 0x1 - cmp r3, 0x4 - bgt _0806A8F0 - ldrb r0, [r2] - cmp r0, 0xFF - bne _0806A8DA -_0806A8F0: - adds r1, r6, r4 - movs r0, 0xFC - strb r0, [r1] - adds r4, 0x1 - adds r1, r6, r4 - movs r0, 0x16 - strb r0, [r1] - adds r4, 0x1 - b _0806A944 -_0806A902: - movs r4, 0 - mov r2, r8 - adds r2, 0x8 -_0806A908: - adds r0, r6, r4 - adds r1, r2, r4 - ldrb r1, [r1] - strb r1, [r0] - adds r4, 0x1 - cmp r4, 0x9 - bls _0806A908 - b _0806A944 -_0806A918: - mov r2, r8 - ldrb r4, [r2, 0x12] - b _0806AC8C -_0806A91E: - mov r6, r8 - ldrb r0, [r6, 0x13] - b _0806AA92 -_0806A924: - mov r1, r8 - ldrb r0, [r1, 0x13] - b _0806AA9A -_0806A92A: - mov r2, r8 - ldrb r0, [r2, 0x13] - b _0806AAA2 -_0806A930: - movs r4, 0 - mov r2, r8 - adds r2, 0x14 -_0806A936: - adds r0, r6, r4 - adds r1, r2, r4 - ldrb r1, [r1] - strb r1, [r0] - adds r4, 0x1 - cmp r4, 0x6 - bls _0806A936 -_0806A944: - adds r1, r6, r4 - movs r0, 0xFF - strb r0, [r1] - b _0806AC8C -_0806A94C: - mov r6, r8 - ldrb r4, [r6, 0x1B] - b _0806AC8C -_0806A952: - mov r0, r8 - ldrh r4, [r0, 0x1C] - b _0806AC8C -_0806A958: - mov r1, r8 - ldrh r4, [r1, 0x1E] - b _0806AC8C -_0806A95E: - mov r2, r8 - ldrb r1, [r2, 0x13] - movs r0, 0x1 - ands r0, r1 - movs r4, 0xCE - lsls r4, 1 - cmp r0, 0 - beq _0806A970 - b _0806AC8C -_0806A970: - mov r6, r9 - ldrh r4, [r6] - b _0806AC8C -_0806A976: - mov r0, r9 - ldrh r4, [r0, 0x2] - b _0806AC8C -_0806A97C: - mov r1, r9 - ldr r4, [r1, 0x4] - b _0806AC8C -_0806A982: - mov r2, r9 - ldrb r4, [r2, 0x8] - b _0806AC8C -_0806A988: - mov r6, r9 - ldrb r4, [r6, 0x9] - b _0806AC8C -_0806A98E: - ldr r0, [sp] - subs r0, 0xD - lsls r0, 1 - add r0, r10 - ldrh r4, [r0] - b _0806AC8C -_0806A99A: - ldr r0, [sp] - add r0, r10 - subs r0, 0x9 - ldrb r4, [r0] - b _0806AC8C -_0806A9A4: - ldrb r4, [r7] - b _0806AC8C -_0806A9A8: - ldrb r4, [r7, 0x1] - b _0806AC8C -_0806A9AC: - ldrb r4, [r7, 0x2] - b _0806AC8C -_0806A9B0: - ldrb r4, [r7, 0x3] - b _0806AC8C -_0806A9B4: - ldrb r4, [r7, 0x4] - b _0806AC8C -_0806A9B8: - ldrb r4, [r7, 0x5] - b _0806AC8C -_0806A9BC: - ldrb r4, [r7, 0x6] - b _0806AC8C -_0806A9C0: - ldrb r4, [r7, 0x7] - b _0806AC8C -_0806A9C4: - ldrb r4, [r7, 0x8] - b _0806AC8C -_0806A9C8: - ldrb r4, [r7, 0x9] - b _0806AC8C -_0806A9CC: - ldrb r4, [r7, 0xA] - b _0806AC8C -_0806A9D0: - ldrb r4, [r7, 0xB] - b _0806AC8C -_0806A9D4: - ldrb r4, [r5] - b _0806AC8C -_0806A9D8: - ldrb r4, [r5, 0x1] - b _0806AC8C -_0806A9DC: - ldrb r0, [r5, 0x2] - lsls r0, 25 - lsrs r4, r0, 25 - b _0806AC8C -_0806A9E4: - ldrh r0, [r5, 0x2] - lsls r0, 21 - lsrs r4, r0, 28 - b _0806AC8C -_0806A9EC: - ldrb r0, [r5, 0x3] - b _0806AAAA -_0806A9F0: - ldrb r0, [r5, 0x3] - lsrs r4, r0, 7 - b _0806AC8C -_0806A9F6: - ldrb r0, [r5, 0x4] - lsls r0, 27 - lsrs r4, r0, 27 - b _0806AC8C -_0806A9FE: - ldrh r0, [r5, 0x4] - lsls r0, 22 - lsrs r4, r0, 27 - b _0806AC8C -_0806AA06: - ldrb r0, [r5, 0x5] - lsls r0, 25 - lsrs r4, r0, 27 - b _0806AC8C -_0806AA0E: - ldr r0, [r5, 0x4] - lsls r0, 12 - lsrs r4, r0, 27 - b _0806AC8C -_0806AA16: - ldrh r0, [r5, 0x6] - lsls r0, 23 - lsrs r4, r0, 27 - b _0806AC8C -_0806AA1E: - ldrb r0, [r5, 0x7] - lsls r0, 26 - lsrs r4, r0, 27 - b _0806AC8C -_0806AA26: - ldrb r0, [r5, 0x7] - b _0806AA84 -_0806AA2A: - ldrb r0, [r5, 0x7] - lsrs r4, r0, 7 - b _0806AC8C -_0806AA30: - ldrb r0, [r5, 0x8] - lsls r0, 29 - lsrs r4, r0, 29 - b _0806AC8C -_0806AA38: - ldrb r0, [r5, 0x8] - lsls r0, 26 - lsrs r4, r0, 29 - b _0806AC8C -_0806AA40: - ldrh r0, [r5, 0x8] - lsls r0, 23 - lsrs r4, r0, 29 - b _0806AC8C -_0806AA48: - ldrb r0, [r5, 0x9] - lsls r0, 28 - lsrs r4, r0, 29 - b _0806AC8C -_0806AA50: - ldrb r0, [r5, 0x9] - lsls r0, 25 - lsrs r4, r0, 29 - b _0806AC8C -_0806AA58: - ldrb r0, [r5, 0x9] - lsrs r4, r0, 7 - b _0806AC8C -_0806AA5E: - ldrb r0, [r5, 0xA] - b _0806AA92 -_0806AA62: - ldrb r0, [r5, 0xA] - b _0806AA9A -_0806AA66: - ldrb r0, [r5, 0xA] - b _0806AAA2 -_0806AA6A: - ldrb r0, [r5, 0xA] - lsls r0, 28 - lsrs r4, r0, 31 - b _0806AC8C -_0806AA72: - ldrb r0, [r5, 0xA] - lsls r0, 27 - lsrs r4, r0, 31 - b _0806AC8C -_0806AA7A: - ldrb r0, [r5, 0xA] - lsls r0, 26 - lsrs r4, r0, 31 - b _0806AC8C -_0806AA82: - ldrb r0, [r5, 0xA] -_0806AA84: - lsls r0, 25 - lsrs r4, r0, 31 - b _0806AC8C -_0806AA8A: - ldrb r0, [r5, 0xA] - lsrs r4, r0, 7 - b _0806AC8C -_0806AA90: - ldrb r0, [r5, 0xB] -_0806AA92: - lsls r0, 31 - lsrs r4, r0, 31 - b _0806AC8C -_0806AA98: - ldrb r0, [r5, 0xB] -_0806AA9A: - lsls r0, 30 - lsrs r4, r0, 31 - b _0806AC8C -_0806AAA0: - ldrb r0, [r5, 0xB] -_0806AAA2: - lsls r0, 29 - lsrs r4, r0, 31 - b _0806AC8C -_0806AAA8: - ldrb r0, [r5, 0xB] -_0806AAAA: - lsls r0, 25 - lsrs r4, r0, 28 - b _0806AC8C -_0806AAB0: - ldrb r0, [r5, 0xB] - lsrs r4, r0, 7 - b _0806AC8C -_0806AAB6: - mov r0, r9 - ldrh r4, [r0] - cmp r4, 0 - bne _0806AAC0 - b _0806AC8C -_0806AAC0: - ldrb r0, [r5, 0x7] - lsls r0, 25 - cmp r0, 0 - blt _0806AAD6 - mov r2, r8 - ldrb r1, [r2, 0x13] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0806AAD6 - b _0806AC8C -_0806AAD6: - movs r4, 0xCE - lsls r4, 1 - b _0806AC8C -_0806AADC: - ldrb r0, [r5, 0x4] - lsls r0, 27 - lsrs r4, r0, 27 - ldrh r1, [r5, 0x4] - movs r0, 0xF8 - lsls r0, 2 - ands r0, r1 - orrs r4, r0 - ldrb r0, [r5, 0x5] - lsls r0, 25 - lsrs r0, 27 - lsls r0, 10 - orrs r4, r0 - ldr r0, [r5, 0x4] - movs r1, 0xF8 - lsls r1, 12 - ands r0, r1 - orrs r4, r0 - ldrh r0, [r5, 0x6] - lsls r0, 23 - lsrs r0, 27 - lsls r0, 20 - orrs r4, r0 - ldrb r0, [r5, 0x7] - lsls r0, 26 - lsrs r0, 27 - lsls r0, 25 - orrs r4, r0 - b _0806AC8C -_0806AB16: - mov r1, r9 - ldrh r0, [r1] - cmp r0, 0 - bne _0806AB20 - b _0806AC8C -_0806AB20: - ldrb r0, [r5, 0x7] - lsls r0, 25 - cmp r0, 0 - bge _0806AB2A - b _0806AC8C -_0806AB2A: - ldrh r0, [r6] - ldr r1, =0x00000163 - cmp r0, r1 - bne _0806AB34 - b _0806AC8C -_0806AB34: - mov r2, r10 - ldrh r5, [r2] - adds r7, r1, 0 - adds r2, r6, 0 - ldr r1, =gUnknown_0832A328 -_0806AB3E: - ldrh r3, [r2] - cmp r5, r3 - beq _0806AB58 - mov r6, r10 - ldrh r0, [r6, 0x2] - cmp r0, r3 - beq _0806AB58 - ldrh r0, [r6, 0x4] - cmp r0, r3 - beq _0806AB58 - ldrh r0, [r6, 0x6] - cmp r0, r3 - bne _0806AB5C -_0806AB58: - ldr r0, [r1] - orrs r4, r0 -_0806AB5C: - adds r2, 0x2 - adds r1, 0x4 - ldrh r0, [r2] - cmp r0, r7 - bne _0806AB3E - b _0806AC8C - .pool -_0806AB70: - movs r4, 0 - mov r1, r9 - ldrh r0, [r1] - cmp r0, 0 - bne _0806AB7C - b _0806AC8C -_0806AB7C: - ldrb r0, [r5, 0x7] - lsls r0, 25 - cmp r0, 0 - bge _0806AB86 - b _0806AC8C -_0806AB86: - ldrb r0, [r5, 0x8] - lsls r1, r0, 29 - lsrs r4, r1, 29 - lsls r0, 26 - lsrs r0, 29 - adds r4, r0 - ldrh r0, [r5, 0x8] - lsls r0, 23 - lsrs r0, 29 - adds r4, r0 - ldrb r1, [r5, 0x9] - lsls r0, r1, 28 - lsrs r0, 29 - adds r4, r0 - lsls r0, r1, 25 - lsrs r0, 29 - adds r4, r0 - lsrs r1, 7 - adds r4, r1 - ldrb r1, [r5, 0xA] - lsls r0, r1, 31 - lsrs r0, 31 - adds r4, r0 - lsls r0, r1, 30 - lsrs r0, 31 - adds r4, r0 - lsls r0, r1, 29 - lsrs r0, 31 - adds r4, r0 - lsls r0, r1, 28 - lsrs r0, 31 - adds r4, r0 - lsls r0, r1, 27 - lsrs r0, 31 - adds r4, r0 - lsls r0, r1, 26 - lsrs r0, 31 - adds r4, r0 - lsls r0, r1, 25 - lsrs r0, 31 - adds r4, r0 - lsrs r1, 7 - adds r4, r1 - ldrb r1, [r5, 0xB] - lsls r0, r1, 31 - lsrs r0, 31 - adds r4, r0 - lsls r0, r1, 30 - lsrs r0, 31 - adds r4, r0 - lsls r1, 29 - lsrs r1, 31 - adds r4, r1 - b _0806AC8C -_0806ABF2: - movs r4, 0 - mov r2, r9 - ldrh r0, [r2] - cmp r0, 0 - beq _0806AC8C - ldrb r0, [r5, 0x7] - lsls r0, 25 - cmp r0, 0 - blt _0806AC8C - ldrb r2, [r5, 0x9] - lsrs r4, r2, 7 - ldrb r1, [r5, 0x8] - lsls r0, r1, 29 - lsrs r0, 28 - orrs r4, r0 - lsls r1, 26 - lsrs r1, 29 - lsls r1, 4 - orrs r4, r1 - ldrh r0, [r5, 0x8] - lsls r0, 23 - lsrs r0, 29 - lsls r0, 7 - orrs r4, r0 - lsls r0, r2, 28 - lsrs r0, 29 - lsls r0, 10 - orrs r4, r0 - lsls r2, 25 - lsrs r2, 29 - lsls r2, 13 - orrs r4, r2 - ldrb r1, [r5, 0xA] - lsls r0, r1, 31 - lsrs r0, 31 - lsls r0, 16 - orrs r4, r0 - lsls r0, r1, 30 - lsrs r0, 31 - lsls r0, 17 - orrs r4, r0 - lsls r0, r1, 29 - lsrs r0, 31 - lsls r0, 18 - orrs r4, r0 - lsls r0, r1, 28 - lsrs r0, 31 - lsls r0, 19 - orrs r4, r0 - lsls r0, r1, 27 - lsrs r0, 31 - lsls r0, 20 - orrs r4, r0 - lsls r0, r1, 26 - lsrs r0, 31 - lsls r0, 21 - orrs r4, r0 - lsls r0, r1, 25 - lsrs r0, 31 - lsls r0, 22 - orrs r4, r0 - lsrs r1, 7 - lsls r1, 23 - orrs r4, r1 - ldrb r1, [r5, 0xB] - lsls r0, r1, 31 - lsrs r0, 31 - lsls r0, 24 - orrs r4, r0 - lsls r0, r1, 30 - lsrs r0, 31 - lsls r0, 25 - orrs r4, r0 - lsls r1, 29 - lsrs r1, 31 - lsls r1, 26 - orrs r4, r1 -_0806AC8C: - ldr r6, [sp] - cmp r6, 0xA - ble _0806AC98 - mov r0, r8 - bl pokemon_encrypt -_0806AC98: - adds r0, r4, 0 - 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 pokemon_getattr_encrypted - - thumb_func_start pokemon_setattr -@ int pokemon_setattr(pokemon *mon, enum pokemon_data_request req, void *data) -pokemon_setattr: @ 806ACAC - push {lr} - adds r3, r0, 0 - adds r0, r1, 0 - subs r0, 0x37 - cmp r0, 0xA - bhi _0806AD90 - lsls r0, 2 - ldr r1, =_0806ACC8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0806ACC8: - .4byte _0806ACF4 - .4byte _0806AD0C - .4byte _0806AD16 - .4byte _0806AD26 - .4byte _0806AD36 - .4byte _0806AD46 - .4byte _0806AD56 - .4byte _0806AD66 - .4byte _0806AD76 - .4byte _0806AD86 - .4byte _0806AD96 -_0806ACF4: - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x2] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 24 - adds r1, r0 - str r1, [r3, 0x50] - b _0806AD96 -_0806AD0C: - ldrb r1, [r2] - adds r0, r3, 0 - adds r0, 0x54 - strb r1, [r0] - b _0806AD96 -_0806AD16: - ldrb r0, [r2] - ldrb r1, [r2, 0x1] - lsls r1, 8 - adds r0, r1 - adds r1, r3, 0 - adds r1, 0x56 - strh r0, [r1] - b _0806AD96 -_0806AD26: - ldrb r0, [r2] - ldrb r1, [r2, 0x1] - lsls r1, 8 - adds r0, r1 - adds r1, r3, 0 - adds r1, 0x58 - strh r0, [r1] - b _0806AD96 -_0806AD36: - ldrb r0, [r2] - ldrb r1, [r2, 0x1] - lsls r1, 8 - adds r0, r1 - adds r1, r3, 0 - adds r1, 0x5A - strh r0, [r1] - b _0806AD96 -_0806AD46: - ldrb r0, [r2] - ldrb r1, [r2, 0x1] - lsls r1, 8 - adds r0, r1 - adds r1, r3, 0 - adds r1, 0x5C - strh r0, [r1] - b _0806AD96 -_0806AD56: - ldrb r0, [r2] - ldrb r1, [r2, 0x1] - lsls r1, 8 - adds r0, r1 - adds r1, r3, 0 - adds r1, 0x5E - strh r0, [r1] - b _0806AD96 -_0806AD66: - ldrb r0, [r2] - ldrb r1, [r2, 0x1] - lsls r1, 8 - adds r0, r1 - adds r1, r3, 0 - adds r1, 0x60 - strh r0, [r1] - b _0806AD96 -_0806AD76: - ldrb r0, [r2] - ldrb r1, [r2, 0x1] - lsls r1, 8 - adds r0, r1 - adds r1, r3, 0 - adds r1, 0x62 - strh r0, [r1] - b _0806AD96 -_0806AD86: - ldrb r1, [r2] - adds r0, r3, 0 - adds r0, 0x55 - strb r1, [r0] - b _0806AD96 -_0806AD90: - adds r0, r3, 0 - bl pokemon_setattr_encrypted -_0806AD96: - pop {r0} - bx r0 - thumb_func_end pokemon_setattr - - thumb_func_start pokemon_setattr_encrypted -@ int pokemon_setattr_encrypted(pokemon *mon, enum pokemon_data_request req, void *data) -pokemon_setattr_encrypted: @ 806AD9C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r7, r0, 0 - mov r10, r1 - adds r4, r2, 0 - movs r0, 0 - mov r8, r0 - mov r9, r0 - movs r6, 0 - movs r5, 0 - cmp r1, 0xA - ble _0806AE1C - ldr r1, [r7] - adds r0, r7, 0 - movs r2, 0 - bl pokemon_data_permutator - mov r8, r0 - ldr r1, [r7] - adds r0, r7, 0 - movs r2, 0x1 - bl pokemon_data_permutator - mov r9, r0 - ldr r1, [r7] - adds r0, r7, 0 - movs r2, 0x2 - bl pokemon_data_permutator - adds r6, r0, 0 - ldr r1, [r7] - adds r0, r7, 0 - movs r2, 0x3 - bl pokemon_data_permutator - adds r5, r0, 0 - adds r0, r7, 0 - bl pokemon_decrypt - adds r0, r7, 0 - bl pokemon_calc_checksum - lsls r0, 16 - lsrs r0, 16 - ldrh r1, [r7, 0x1C] - cmp r0, r1 - beq _0806AE1C - ldrb r0, [r7, 0x13] - movs r1, 0x1 - orrs r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r7, 0x13] - ldrb r0, [r5, 0x7] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r5, 0x7] - adds r0, r7, 0 - bl pokemon_encrypt - b _0806B3EC -_0806AE1C: - mov r0, r10 - cmp r0, 0x50 - bls _0806AE24 - b _0806B3D8 -_0806AE24: - lsls r0, 2 - ldr r1, =_0806AE34 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0806AE34: - .4byte _0806AF78 - .4byte _0806AF90 - .4byte _0806AFA8 - .4byte _0806AFBE - .4byte _0806AFC4 - .4byte _0806AFD4 - .4byte _0806AFE6 - .4byte _0806AFF8 - .4byte _0806B00E - .4byte _0806B014 - .4byte _0806B020 - .4byte _0806B02C - .4byte _0806B04C - .4byte _0806B084 - .4byte _0806B084 - .4byte _0806B084 - .4byte _0806B084 - .4byte _0806B098 - .4byte _0806B098 - .4byte _0806B098 - .4byte _0806B098 - .4byte _0806B074 - .4byte _0806B0C8 - .4byte _0806B0CE - .4byte _0806B0D4 - .4byte _0806B05A - .4byte _0806B0A4 - .4byte _0806B0AA - .4byte _0806B0B0 - .4byte _0806B0B6 - .4byte _0806B0BC - .4byte _0806B0C2 - .4byte _0806B07C - .4byte _0806B0DA - .4byte _0806B0EC - .4byte _0806B0F2 - .4byte _0806B0F8 - .4byte _0806B10C - .4byte _0806B124 - .4byte _0806B14A - .4byte _0806B15E - .4byte _0806B178 - .4byte _0806B18E - .4byte _0806B1A8 - .4byte _0806B1C0 - .4byte _0806B1D4 - .4byte _0806B204 - .4byte _0806B0E0 - .4byte _0806B0E6 - .4byte _0806B13A - .4byte _0806B214 - .4byte _0806B222 - .4byte _0806B238 - .4byte _0806B250 - .4byte _0806B260 - .4byte _0806B3D8 - .4byte _0806B3D8 - .4byte _0806B3D8 - .4byte _0806B3D8 - .4byte _0806B3D8 - .4byte _0806B3D8 - .4byte _0806B3D8 - .4byte _0806B3D8 - .4byte _0806B3D8 - .4byte _0806B3D8 - .4byte _0806B3D8 - .4byte _0806B35E - .4byte _0806B276 - .4byte _0806B286 - .4byte _0806B294 - .4byte _0806B2A4 - .4byte _0806B2B4 - .4byte _0806B2C4 - .4byte _0806B2D4 - .4byte _0806B2E4 - .4byte _0806B2FA - .4byte _0806B30A - .4byte _0806B318 - .4byte _0806B328 - .4byte _0806B338 - .4byte _0806B34E -_0806AF78: - ldrb r1, [r4] - ldrb r0, [r4, 0x1] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r4, 0x2] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r4, 0x3] - lsls r0, 24 - adds r1, r0 - str r1, [r7] - b _0806B3D8 -_0806AF90: - ldrb r1, [r4] - ldrb r0, [r4, 0x1] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r4, 0x2] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r4, 0x3] - lsls r0, 24 - adds r1, r0 - str r1, [r7, 0x4] - b _0806B3D8 -_0806AFA8: - movs r2, 0 - adds r3, r7, 0 - adds r3, 0x8 -_0806AFAE: - adds r0, r3, r2 - adds r1, r4, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x9 - ble _0806AFAE - b _0806B3D8 -_0806AFBE: - ldrb r0, [r4] - strb r0, [r7, 0x12] - b _0806B3D8 -_0806AFC4: - ldrb r0, [r4] - movs r1, 0x1 - ands r1, r0 - ldrb r2, [r7, 0x13] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - b _0806B1F2 -_0806AFD4: - ldrb r0, [r4] - movs r1, 0x1 - ands r1, r0 - lsls r1, 1 - ldrb r2, [r7, 0x13] - movs r0, 0x3 - negs r0, r0 - ands r0, r2 - b _0806B1F2 -_0806AFE6: - ldrb r0, [r4] - movs r1, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r7, 0x13] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - b _0806B1F2 -_0806AFF8: - movs r2, 0 - adds r3, r7, 0 - adds r3, 0x14 -_0806AFFE: - adds r0, r3, r2 - adds r1, r4, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x6 - ble _0806AFFE - b _0806B3D8 -_0806B00E: - ldrb r0, [r4] - strb r0, [r7, 0x1B] - b _0806B3D8 -_0806B014: - ldrb r1, [r4] - ldrb r0, [r4, 0x1] - lsls r0, 8 - adds r1, r0 - strh r1, [r7, 0x1C] - b _0806B3D8 -_0806B020: - ldrb r1, [r4] - ldrb r0, [r4, 0x1] - lsls r0, 8 - adds r1, r0 - strh r1, [r7, 0x1E] - b _0806B3D8 -_0806B02C: - ldrb r1, [r4] - ldrb r0, [r4, 0x1] - lsls r0, 8 - adds r1, r0 - mov r0, r8 - strh r1, [r0] - lsls r1, 16 - cmp r1, 0 - beq _0806B044 - ldrb r0, [r7, 0x13] - movs r1, 0x2 - b _0806B1F2 -_0806B044: - ldrb r1, [r7, 0x13] - movs r0, 0x3 - negs r0, r0 - b _0806B1FE -_0806B04C: - ldrb r1, [r4] - ldrb r0, [r4, 0x1] - lsls r0, 8 - adds r1, r0 - mov r0, r8 - strh r1, [r0, 0x2] - b _0806B3D8 -_0806B05A: - ldrb r1, [r4] - ldrb r0, [r4, 0x1] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r4, 0x2] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r4, 0x3] - lsls r0, 24 - adds r1, r0 - mov r0, r8 - str r1, [r0, 0x4] - b _0806B3D8 -_0806B074: - ldrb r0, [r4] - mov r1, r8 - strb r0, [r1, 0x8] - b _0806B3D8 -_0806B07C: - ldrb r0, [r4] - mov r1, r8 - strb r0, [r1, 0x9] - b _0806B3D8 -_0806B084: - mov r2, r10 - subs r2, 0xD - lsls r2, 1 - add r2, r9 - ldrb r1, [r4] - ldrb r0, [r4, 0x1] - lsls r0, 8 - adds r1, r0 - strh r1, [r2] - b _0806B3D8 -_0806B098: - mov r0, r9 - add r0, r10 - subs r0, 0x9 - ldrb r1, [r4] - strb r1, [r0] - b _0806B3D8 -_0806B0A4: - ldrb r0, [r4] - strb r0, [r6] - b _0806B3D8 -_0806B0AA: - ldrb r0, [r4] - strb r0, [r6, 0x1] - b _0806B3D8 -_0806B0B0: - ldrb r0, [r4] - strb r0, [r6, 0x2] - b _0806B3D8 -_0806B0B6: - ldrb r0, [r4] - strb r0, [r6, 0x3] - b _0806B3D8 -_0806B0BC: - ldrb r0, [r4] - strb r0, [r6, 0x4] - b _0806B3D8 -_0806B0C2: - ldrb r0, [r4] - strb r0, [r6, 0x5] - b _0806B3D8 -_0806B0C8: - ldrb r0, [r4] - strb r0, [r6, 0x6] - b _0806B3D8 -_0806B0CE: - ldrb r0, [r4] - strb r0, [r6, 0x7] - b _0806B3D8 -_0806B0D4: - ldrb r0, [r4] - strb r0, [r6, 0x8] - b _0806B3D8 -_0806B0DA: - ldrb r0, [r4] - strb r0, [r6, 0x9] - b _0806B3D8 -_0806B0E0: - ldrb r0, [r4] - strb r0, [r6, 0xA] - b _0806B3D8 -_0806B0E6: - ldrb r0, [r4] - strb r0, [r6, 0xB] - b _0806B3D8 -_0806B0EC: - ldrb r0, [r4] - strb r0, [r5] - b _0806B3D8 -_0806B0F2: - ldrb r0, [r4] - strb r0, [r5, 0x1] - b _0806B3D8 -_0806B0F8: - ldrb r1, [r4] - movs r0, 0x7F - ands r1, r0 - ldrb r2, [r5, 0x2] - movs r0, 0x80 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x2] - b _0806B3D8 -_0806B10C: - ldrb r1, [r4] - movs r0, 0xF - ands r1, r0 - lsls r1, 7 - ldrh r2, [r5, 0x2] - ldr r0, =0xfffff87f - ands r0, r2 - orrs r0, r1 - strh r0, [r5, 0x2] - b _0806B3D8 - .pool -_0806B124: - ldrb r1, [r4] - movs r0, 0xF - ands r1, r0 - lsls r1, 3 - ldrb r2, [r5, 0x3] - movs r0, 0x79 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x3] - b _0806B3D8 -_0806B13A: - ldrb r0, [r4] - lsls r0, 7 - ldrb r2, [r5, 0x3] - movs r1, 0x7F - ands r1, r2 - orrs r1, r0 - strb r1, [r5, 0x3] - b _0806B3D8 -_0806B14A: - ldrb r1, [r4] - movs r0, 0x1F - ands r1, r0 - ldrb r2, [r5, 0x4] - movs r0, 0x20 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x4] - b _0806B3D8 -_0806B15E: - ldrb r1, [r4] - movs r0, 0x1F - ands r1, r0 - lsls r1, 5 - ldrh r2, [r5, 0x4] - ldr r0, =0xfffffc1f - ands r0, r2 - orrs r0, r1 - strh r0, [r5, 0x4] - b _0806B3D8 - .pool -_0806B178: - ldrb r1, [r4] - movs r0, 0x1F - ands r1, r0 - lsls r1, 2 - ldrb r2, [r5, 0x5] - movs r0, 0x7D - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x5] - b _0806B3D8 -_0806B18E: - ldrb r2, [r4] - movs r0, 0x1F - ands r2, r0 - lsls r2, 15 - ldr r0, [r5, 0x4] - ldr r1, =0xfff07fff - ands r0, r1 - orrs r0, r2 - str r0, [r5, 0x4] - b _0806B3D8 - .pool -_0806B1A8: - ldrb r1, [r4] - movs r0, 0x1F - ands r1, r0 - lsls r1, 4 - ldrh r2, [r5, 0x6] - ldr r0, =0xfffffe0f - ands r0, r2 - orrs r0, r1 - strh r0, [r5, 0x6] - b _0806B3D8 - .pool -_0806B1C0: - ldrb r1, [r4] - movs r0, 0x1F - ands r1, r0 - lsls r1, 1 - ldrb r2, [r5, 0x7] - movs r0, 0x3F - negs r0, r0 - ands r0, r2 - orrs r0, r1 - b _0806B3D6 -_0806B1D4: - ldrb r1, [r4] - movs r0, 0x1 - ands r1, r0 - lsls r1, 6 - ldrb r2, [r5, 0x7] - movs r0, 0x41 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x7] - lsls r0, 25 - cmp r0, 0 - bge _0806B1F8 - ldrb r0, [r7, 0x13] - movs r1, 0x4 -_0806B1F2: - orrs r0, r1 - strb r0, [r7, 0x13] - b _0806B3D8 -_0806B1F8: - ldrb r1, [r7, 0x13] - movs r0, 0x5 - negs r0, r0 -_0806B1FE: - ands r0, r1 - strb r0, [r7, 0x13] - b _0806B3D8 -_0806B204: - ldrb r0, [r4] - lsls r0, 7 - ldrb r2, [r5, 0x7] - movs r1, 0x7F - ands r1, r2 - orrs r1, r0 - strb r1, [r5, 0x7] - b _0806B3D8 -_0806B214: - ldrb r1, [r4] - movs r0, 0x7 - ands r1, r0 - ldrb r2, [r5, 0x8] - movs r0, 0x8 - negs r0, r0 - b _0806B230 -_0806B222: - ldrb r1, [r4] - movs r0, 0x7 - ands r1, r0 - lsls r1, 3 - ldrb r2, [r5, 0x8] - movs r0, 0x39 - negs r0, r0 -_0806B230: - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x8] - b _0806B3D8 -_0806B238: - ldrb r1, [r4] - movs r0, 0x7 - ands r1, r0 - lsls r1, 6 - ldrh r2, [r5, 0x8] - ldr r0, =0xfffffe3f - ands r0, r2 - orrs r0, r1 - strh r0, [r5, 0x8] - b _0806B3D8 - .pool -_0806B250: - ldrb r1, [r4] - movs r0, 0x7 - ands r1, r0 - lsls r1, 1 - ldrb r2, [r5, 0x9] - movs r0, 0xF - negs r0, r0 - b _0806B26E -_0806B260: - ldrb r1, [r4] - movs r0, 0x7 - ands r1, r0 - lsls r1, 4 - ldrb r2, [r5, 0x9] - movs r0, 0x71 - negs r0, r0 -_0806B26E: - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x9] - b _0806B3D8 -_0806B276: - ldrb r0, [r4] - lsls r0, 7 - ldrb r2, [r5, 0x9] - movs r1, 0x7F - ands r1, r2 - orrs r1, r0 - strb r1, [r5, 0x9] - b _0806B3D8 -_0806B286: - ldrb r1, [r4] - movs r0, 0x1 - ands r1, r0 - ldrb r2, [r5, 0xA] - movs r0, 0x2 - negs r0, r0 - b _0806B2F2 -_0806B294: - ldrb r1, [r4] - movs r0, 0x1 - ands r1, r0 - lsls r1, 1 - ldrb r2, [r5, 0xA] - movs r0, 0x3 - negs r0, r0 - b _0806B2F2 -_0806B2A4: - ldrb r1, [r4] - movs r0, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r5, 0xA] - movs r0, 0x5 - negs r0, r0 - b _0806B2F2 -_0806B2B4: - ldrb r1, [r4] - movs r0, 0x1 - ands r1, r0 - lsls r1, 3 - ldrb r2, [r5, 0xA] - movs r0, 0x9 - negs r0, r0 - b _0806B2F2 -_0806B2C4: - ldrb r1, [r4] - movs r0, 0x1 - ands r1, r0 - lsls r1, 4 - ldrb r2, [r5, 0xA] - movs r0, 0x11 - negs r0, r0 - b _0806B2F2 -_0806B2D4: - ldrb r1, [r4] - movs r0, 0x1 - ands r1, r0 - lsls r1, 5 - ldrb r2, [r5, 0xA] - movs r0, 0x21 - negs r0, r0 - b _0806B2F2 -_0806B2E4: - ldrb r1, [r4] - movs r0, 0x1 - ands r1, r0 - lsls r1, 6 - ldrb r2, [r5, 0xA] - movs r0, 0x41 - negs r0, r0 -_0806B2F2: - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0xA] - b _0806B3D8 -_0806B2FA: - ldrb r0, [r4] - lsls r0, 7 - ldrb r2, [r5, 0xA] - movs r1, 0x7F - ands r1, r2 - orrs r1, r0 - strb r1, [r5, 0xA] - b _0806B3D8 -_0806B30A: - ldrb r1, [r4] - movs r0, 0x1 - ands r1, r0 - ldrb r2, [r5, 0xB] - movs r0, 0x2 - negs r0, r0 - b _0806B346 -_0806B318: - ldrb r1, [r4] - movs r0, 0x1 - ands r1, r0 - lsls r1, 1 - ldrb r2, [r5, 0xB] - movs r0, 0x3 - negs r0, r0 - b _0806B346 -_0806B328: - ldrb r1, [r4] - movs r0, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r5, 0xB] - movs r0, 0x5 - negs r0, r0 - b _0806B346 -_0806B338: - ldrb r1, [r4] - movs r0, 0xF - ands r1, r0 - lsls r1, 3 - ldrb r2, [r5, 0xB] - movs r0, 0x79 - negs r0, r0 -_0806B346: - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0xB] - b _0806B3D8 -_0806B34E: - ldrb r0, [r4] - lsls r0, 7 - ldrb r2, [r5, 0xB] - movs r1, 0x7F - ands r1, r2 - orrs r1, r0 - strb r1, [r5, 0xB] - b _0806B3D8 -_0806B35E: - ldrb r3, [r4] - ldrb r0, [r4, 0x1] - lsls r0, 8 - orrs r3, r0 - ldrb r0, [r4, 0x2] - lsls r0, 16 - orrs r3, r0 - ldrb r0, [r4, 0x3] - lsls r0, 24 - orrs r3, r0 - movs r4, 0x1F - adds r1, r3, 0 - ands r1, r4 - ldrb r2, [r5, 0x4] - movs r0, 0x20 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x4] - lsrs r1, r3, 5 - ands r1, r4 - lsls r1, 5 - ldrh r2, [r5, 0x4] - ldr r0, =0xfffffc1f - ands r0, r2 - orrs r0, r1 - strh r0, [r5, 0x4] - lsrs r1, r3, 10 - ands r1, r4 - lsls r1, 2 - ldrb r2, [r5, 0x5] - movs r0, 0x7D - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x5] - lsrs r1, r3, 15 - ands r1, r4 - lsls r1, 15 - ldr r0, [r5, 0x4] - ldr r2, =0xfff07fff - ands r0, r2 - orrs r0, r1 - str r0, [r5, 0x4] - lsrs r1, r3, 20 - ands r1, r4 - lsls r1, 4 - ldrh r2, [r5, 0x6] - ldr r0, =0xfffffe0f - ands r0, r2 - orrs r0, r1 - strh r0, [r5, 0x6] - lsrs r3, 25 - ands r3, r4 - lsls r3, 1 - ldrb r1, [r5, 0x7] - movs r0, 0x3F - negs r0, r0 - ands r0, r1 - orrs r0, r3 -_0806B3D6: - strb r0, [r5, 0x7] -_0806B3D8: - mov r0, r10 - cmp r0, 0xA - ble _0806B3EC - adds r0, r7, 0 - bl pokemon_calc_checksum - strh r0, [r7, 0x1C] - adds r0, r7, 0 - bl pokemon_encrypt -_0806B3EC: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end pokemon_setattr_encrypted - - thumb_func_start memcpy_pokemon -@ void *memcpy_pokemon(void *dest, void *src, unsigned int size) -memcpy_pokemon: @ 806B408 - push {lr} - bl memcpy - pop {r0} - bx r0 - thumb_func_end memcpy_pokemon - - thumb_func_start pokemon_catch -@ int pokemon_catch(pokemon *mon) -pokemon_catch: @ 806B414 - push {r4-r6,lr} - adds r6, r0, 0 - ldr r4, =0x03005d90 - ldr r2, [r4] - movs r1, 0x7 - bl pokemon_setattr - ldr r2, [r4] - adds r2, 0x8 - adds r0, r6, 0 - movs r1, 0x31 - bl pokemon_setattr - ldr r2, [r4] - adds r2, 0xA - adds r0, r6, 0 - movs r1, 0x1 - bl pokemon_setattr - movs r5, 0 - b _0806B446 - .pool -_0806B444: - adds r5, 0x1 -_0806B446: - cmp r5, 0x5 - bgt _0806B480 - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - bne _0806B444 - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0x64 - bl memcpy_pokemon - ldr r1, =0x020244e9 - adds r0, r5, 0x1 - strb r0, [r1] - movs r0, 0 - b _0806B48A - .pool -_0806B480: - adds r0, r6, 0 - bl pokemon_add_to_pc - lsls r0, 24 - lsrs r0, 24 -_0806B48A: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end pokemon_catch - - thumb_func_start pokemon_add_to_pc -@ int pokemon_add_to_pc(pokemon *mon) -pokemon_add_to_pc: @ 806B490 - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r8, r0 - ldr r0, =0x00004036 - bl VarGet - lsls r0, 24 - lsrs r0, 24 - bl set_unknown_box_id - bl get_preferred_box - lsls r0, 24 - lsrs r5, r0, 24 -_0806B4AE: - movs r6, 0 - lsls r7, r5, 24 -_0806B4B2: - lsls r1, r6, 24 - lsrs r1, 24 - lsrs r0, r7, 24 - bl get_pokemon_by_box_and_pos - adds r4, r0, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr_encrypted - cmp r0, 0 - bne _0806B514 - mov r0, r8 - bl sub_806E924 - adds r0, r4, 0 - mov r1, r8 - movs r2, 0x50 - bl memcpy_pokemon - ldr r0, =0x020375f6 - strh r5, [r0] - ldr r0, =0x020375f8 - strh r6, [r0] - bl get_unknown_box_id - lsls r0, 16 - lsrs r0, 16 - cmp r0, r5 - beq _0806B4F4 - ldr r0, =0x000008d7 - bl FlagReset -_0806B4F4: - lsls r1, r5, 16 - ldr r0, =0x00004036 - lsrs r1, 16 - bl VarSet - movs r0, 0x1 - b _0806B530 - .pool -_0806B514: - adds r6, 0x1 - cmp r6, 0x1D - ble _0806B4B2 - adds r5, 0x1 - cmp r5, 0xE - bne _0806B522 - movs r5, 0 -_0806B522: - bl get_preferred_box - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - bne _0806B4AE - movs r0, 0x2 -_0806B530: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end pokemon_add_to_pc - - thumb_func_start calc_player_party_count -@ u8 calc_player_party_count() -calc_player_party_count: @ 806B53C - push {r4,lr} - ldr r0, =0x020244e9 - movs r1, 0 - strb r1, [r0] - b _0806B554 - .pool -_0806B54C: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - adds r0, r4, 0 -_0806B554: - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0x5 - bhi _0806B572 - adds r1, r0, 0 - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - bne _0806B54C -_0806B572: - ldrb r0, [r4] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end calc_player_party_count - - thumb_func_start calc_enemy_party_count -@ u8 calc_enemy_party_count() -calc_enemy_party_count: @ 806B580 - push {r4,lr} - ldr r0, =0x020244ea - movs r1, 0 - strb r1, [r0] - b _0806B598 - .pool -_0806B590: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - adds r0, r4, 0 -_0806B598: - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0x5 - bhi _0806B5B6 - adds r1, r0, 0 - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - bne _0806B590 -_0806B5B6: - ldrb r0, [r4] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end calc_enemy_party_count - - thumb_func_start sub_806B5C4 -sub_806B5C4: @ 806B5C4 - push {r4-r6,lr} - movs r6, 0 - bl calc_player_party_count - ldr r1, =0x020244e9 - ldrb r0, [r1] - cmp r0, 0x1 - beq _0806B628 - movs r5, 0 - ldrb r1, [r1] - cmp r6, r1 - bge _0806B620 -_0806B5DC: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x41 - movs r2, 0 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _0806B616 - adds r0, r4, 0 - movs r1, 0x39 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - beq _0806B616 - adds r0, r4, 0 - movs r1, 0x41 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - beq _0806B616 - adds r6, 0x1 -_0806B616: - adds r5, 0x1 - ldr r0, =0x020244e9 - ldrb r0, [r0] - cmp r5, r0 - blt _0806B5DC -_0806B620: - movs r0, 0 - cmp r6, 0x1 - bgt _0806B628 - movs r0, 0x2 -_0806B628: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806B5C4 - - thumb_func_start CheckPlayerPartySize -@ u8 CheckPlayerPartySize() -CheckPlayerPartySize: @ 806B638 - push {r4-r6,lr} - movs r6, 0 - movs r5, 0 -_0806B63E: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x41 - movs r2, 0 - bl pokemon_getattr - adds r1, r0, 0 - movs r0, 0xCE - lsls r0, 1 - cmp r1, r0 - beq _0806B670 - cmp r1, 0 - beq _0806B670 - adds r0, r4, 0 - movs r1, 0x39 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - beq _0806B670 - adds r6, 0x1 -_0806B670: - adds r5, 0x1 - cmp r5, 0x5 - ble _0806B63E - cmp r6, 0x1 - bne _0806B684 - movs r0, 0x1 - b _0806B68C - .pool -_0806B684: - movs r0, 0 - cmp r6, 0x1 - bgt _0806B68C - movs r0, 0x2 -_0806B68C: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end CheckPlayerPartySize - - thumb_func_start sub_806B694 -@ int sub_806B694(u16 a1, int a2) -sub_806B694: @ 806B694 - push {lr} - lsls r0, 16 - lsrs r3, r0, 16 - lsls r1, 24 - cmp r1, 0 - beq _0806B6B8 - ldr r2, =0x0202420a - ldr r1, =gBaseStats - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x17] - b _0806B6C6 - .pool -_0806B6B8: - ldr r2, =0x0202420a - ldr r1, =gBaseStats - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x16] -_0806B6C6: - strb r0, [r2] - ldrb r0, [r2] - pop {r1} - bx r1 - .pool - thumb_func_end sub_806B694 - - thumb_func_start GetMonAbility -@ u8 GetMonAbility(pokemon *mon) -GetMonAbility: @ 806B6D8 - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x2E - movs r2, 0 - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_806B694 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end GetMonAbility - - thumb_func_start create_enemy_party -create_enemy_party: @ 806B70C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - adds r5, r0, 0 - bl zero_enemy_party_data - ldr r4, =0x020244a8 - ldr r0, [r4] - ldr r0, [r0] - adds r1, r5, 0 - movs r2, 0xA0 - bl memcpy - movs r0, 0 - mov r9, r0 -_0806B730: - ldr r1, =0x020244a8 - ldr r3, [r1] - ldr r2, [r3] - mov r4, r9 - lsls r7, r4, 1 - adds r0, r2, 0 - adds r0, 0x7C - adds r1, r0, r7 - ldrh r0, [r1] - adds r4, 0x1 - str r4, [sp, 0x10] - cmp r0, 0 - beq _0806B80A - movs r0, 0x64 - mov r6, r9 - muls r6, r0 - ldr r4, =0x02024744 - mov r8, r4 - adds r5, r6, r4 - ldrh r1, [r1] - adds r0, r2, 0 - adds r0, 0x94 - add r0, r9 - ldrb r2, [r0] - movs r0, 0x1 - str r0, [sp] - ldr r0, [r3] - mov r3, r9 - lsls r4, r3, 2 - adds r0, 0x34 - adds r0, r4 - ldr r0, [r0] - str r0, [sp, 0x4] - movs r0, 0x2 - str r0, [sp, 0x8] - movs r0, 0 - str r0, [sp, 0xC] - adds r0, r5, 0 - movs r3, 0xF - bl create_pokemon_set_level - ldr r1, =0x020244a8 - ldr r0, [r1] - adds r1, r7, 0 - adds r1, 0x88 - ldr r2, [r0] - adds r2, r1 - adds r0, r5, 0 - movs r1, 0xC - bl pokemon_setattr - movs r5, 0 - mov r10, r4 - mov r7, r9 - adds r7, 0x9A - mov r4, r8 -_0806B7A0: - adds r1, r5, 0 - adds r1, 0x1A - ldr r2, =0x020244a8 - ldr r0, [r2] - ldr r2, [r0] - adds r2, r7 - adds r0, r6, r4 - bl pokemon_setattr - adds r5, 0x1 - cmp r5, 0x5 - ble _0806B7A0 - movs r5, 0 - movs r3, 0x64 - mov r0, r9 - muls r0, r3 - ldr r1, =0x02024744 - adds r7, r0, r1 - mov r4, r10 - lsls r0, r4, 1 - adds r6, r0, 0 - adds r6, 0x4C - adds r4, r0, 0 -_0806B7CE: - adds r1, r5, 0 - adds r1, 0xD - ldr r2, =0x020244a8 - ldr r0, [r2] - ldr r2, [r0] - adds r2, r6 - adds r0, r7, 0 - bl pokemon_setattr - adds r1, r5, 0 - adds r1, 0x11 - ldr r3, =0x020244a8 - ldr r0, [r3] - ldr r0, [r0] - adds r0, 0x4C - adds r0, r4 - ldrh r0, [r0] - lsls r2, r0, 1 - adds r2, r0 - lsls r2, 2 - ldr r0, =gBattleMoves + 0x4 @ PP offset - adds r2, r0 - adds r0, r7, 0 - bl pokemon_setattr - adds r6, 0x2 - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _0806B7CE -_0806B80A: - ldr r4, [sp, 0x10] - mov r9, r4 - cmp r4, 0x5 - ble _0806B730 - add sp, 0x14 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end create_enemy_party - - thumb_func_start sub_806B830 -sub_806B830: @ 806B830 - push {r4,r5,lr} - ldr r5, =gUnknown_08329EB8 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r4, [r0] - ldrb r0, [r4, 0x9] - movs r1, 0x5 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - ldrb r2, [r4, 0x1] - lsls r2, 27 - lsrs r2, 31 - lsls r1, r2, 2 - adds r1, r2 - adds r0, r1 - adds r0, r5 - ldrb r0, [r0] - ldr r1, =gTrainerPicIndices - adds r0, r1 - ldrb r0, [r0] - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806B830 - - thumb_func_start sub_806B870 -sub_806B870: @ 806B870 - push {r4,r5,lr} - ldr r5, =gUnknown_08329EB8 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r4, [r0] - ldrb r0, [r4, 0x9] - movs r1, 0x5 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - ldrb r2, [r4, 0x1] - lsls r2, 27 - lsrs r2, 31 - lsls r1, r2, 2 - adds r1, r2 - adds r0, r1 - adds r0, r5 - ldrb r0, [r0] - ldr r1, =gTrainerClassNameIndices - adds r0, r1 - ldrb r0, [r0] - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806B870 - - thumb_func_start sub_806B8B0 -sub_806B8B0: @ 806B8B0 - push {r4,lr} - movs r4, 0 -_0806B8B4: - movs r0, 0x64 - muls r0, r4 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - bne _0806B8D0 - movs r0, 0 - b _0806B8DE - .pool -_0806B8D0: - adds r4, 0x1 - cmp r4, 0x5 - ble _0806B8B4 - bl sub_806B8E4 - lsls r0, 24 - lsrs r0, 24 -_0806B8DE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_806B8B0 - - thumb_func_start sub_806B8E4 -sub_806B8E4: @ 806B8E4 - push {r4-r6,lr} - movs r6, 0 -_0806B8E8: - movs r4, 0 - lsls r5, r6, 24 -_0806B8EC: - lsls r1, r4, 24 - lsrs r1, 24 - lsrs r0, r5, 24 - movs r2, 0xB - bl get_pokemon_data_from_any_box - cmp r0, 0 - bne _0806B900 - movs r0, 0 - b _0806B90E -_0806B900: - adds r4, 0x1 - cmp r4, 0x1D - ble _0806B8EC - adds r6, 0x1 - cmp r6, 0xD - ble _0806B8E8 - movs r0, 0x1 -_0806B90E: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_806B8E4 - - thumb_func_start GetSpeciesName -@ void GetSpeciesName(u8 *dest, u16 speciesId) -GetSpeciesName: @ 806B914 - push {r4-r7,lr} - adds r6, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - movs r1, 0 - movs r0, 0xCE - lsls r0, 1 - mov r12, r0 - ldr r7, =gSpeciesNames - movs r0, 0xB - muls r0, r5 - adds r3, r0, r7 - adds r2, r6, 0 - b _0806B93A - .pool -_0806B934: - adds r3, 0x1 - adds r2, 0x1 - adds r1, 0x1 -_0806B93A: - adds r4, r6, r1 - cmp r1, 0xA - bgt _0806B954 - cmp r5, r12 - bls _0806B94A - adds r0, r1, r7 - ldrb r0, [r0] - b _0806B94C -_0806B94A: - ldrb r0, [r3] -_0806B94C: - strb r0, [r2] - ldrb r0, [r4] - cmp r0, 0xFF - bne _0806B934 -_0806B954: - movs r0, 0xFF - strb r0, [r4] - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end GetSpeciesName - - thumb_func_start CalcPPWithPPUps -@ u16 CalcPPWithPPUps(u16 moveId, s32 ppUpCounts, u8 monMoveIndex) -CalcPPWithPPUps: @ 806B960 - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - lsls r2, 24 - lsrs r2, 24 - ldr r4, =gBattleMoves - lsls r3, r0, 1 - adds r3, r0 - lsls r3, 2 - adds r3, r4 - ldrb r4, [r3, 0x4] - ldr r0, =gUnknown_08329D22 - adds r0, r2, r0 - ldrb r3, [r0] - ands r3, r1 - lsls r2, 1 - asrs r3, r2 - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 2 - muls r0, r4 - movs r1, 0x64 - bl __divsi3 - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end CalcPPWithPPUps - - thumb_func_start sub_806B9A8 -sub_806B9A8: @ 806B9A8 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - lsls r4, r1, 24 - lsrs r4, 24 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr - lsls r0, 24 - lsrs r0, 24 - mov r1, sp - strb r0, [r1] - ldr r1, =gUnknown_08329D26 - adds r4, r1 - ldrb r1, [r4] - ands r1, r0 - mov r0, sp - strb r1, [r0] - adds r0, r5, 0 - movs r1, 0x15 - mov r2, sp - bl pokemon_setattr - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806B9A8 - - thumb_func_start sub_806B9E4 -sub_806B9E4: @ 806B9E4 - lsls r1, 24 - lsrs r1, 24 - adds r0, 0x3B - ldr r2, =gUnknown_08329D26 - adds r1, r2 - ldrb r2, [r0] - ldrb r1, [r1] - ands r1, r2 - strb r1, [r0] - bx lr - .pool - thumb_func_end sub_806B9E4 - - thumb_func_start battle_data_fill -battle_data_fill: @ 806B9FC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x14] - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - movs r0, 0x64 - mov r5, r9 - muls r5, r0 - ldr r0, =0x020244ec - adds r5, r0 - adds r0, r5, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - ldr r1, =0x02024084 - mov r8, r1 - movs r1, 0x58 - ldr r2, [sp, 0x14] - adds r4, r2, 0 - muls r4, r1 - mov r3, r8 - adds r6, r4, r3 - strh r0, [r6] - adds r0, r5, 0 - movs r1, 0xC - movs r2, 0 - bl pokemon_getattr - strh r0, [r6, 0x2E] - movs r6, 0 - mov r0, r8 - adds r0, 0x24 - adds r7, r4, r0 -_0806BA4E: - adds r1, r6, 0 - adds r1, 0xD - adds r0, r5, 0 - movs r2, 0 - bl pokemon_getattr - movs r1, 0xC - add r1, r8 - mov r10, r1 - adds r1, r4, r1 - strh r0, [r1] - adds r1, r6, 0 - adds r1, 0x11 - adds r0, r5, 0 - movs r2, 0 - bl pokemon_getattr - strb r0, [r7] - adds r7, 0x1 - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - ble _0806BA4E - movs r0, 0x64 - mov r4, r9 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr - movs r2, 0xC - negs r2, r2 - add r2, r10 - mov r9, r2 - movs r1, 0x58 - ldr r3, [sp, 0x14] - adds r5, r3, 0 - muls r5, r1 - adds r7, r5, r2 - adds r1, r7, 0 - adds r1, 0x3B - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x20 - movs r2, 0 - bl pokemon_getattr - adds r1, r7, 0 - adds r1, 0x2B - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x19 - movs r2, 0 - bl pokemon_getattr - mov r1, r10 - adds r1, 0x38 - adds r1, r5, r1 - str r0, [r1] - adds r0, r4, 0 - movs r1, 0x27 - movs r2, 0 - bl pokemon_getattr - movs r6, 0x1F - ands r0, r6 - ldrb r2, [r7, 0x14] - movs r1, 0x20 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r7, 0x14] - adds r0, r4, 0 - movs r1, 0x28 - movs r2, 0 - bl pokemon_getattr - movs r1, 0x1F - mov r8, r1 - mov r2, r8 - ands r0, r2 - lsls r0, 5 - ldrh r2, [r7, 0x14] - ldr r1, =0xfffffc1f - ands r1, r2 - orrs r1, r0 - strh r1, [r7, 0x14] - adds r0, r4, 0 - movs r1, 0x29 - movs r2, 0 - bl pokemon_getattr - ands r0, r6 - lsls r0, 2 - ldrb r2, [r7, 0x15] - movs r1, 0x7D - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r7, 0x15] - adds r0, r4, 0 - movs r1, 0x2A - movs r2, 0 - bl pokemon_getattr - movs r1, 0x1F - ands r1, r0 - lsls r1, 15 - ldr r0, [r7, 0x14] - ldr r2, =0xfff07fff - ands r0, r2 - orrs r0, r1 - str r0, [r7, 0x14] - adds r0, r4, 0 - movs r1, 0x2B - movs r2, 0 - bl pokemon_getattr - mov r3, r8 - ands r0, r3 - lsls r0, 4 - ldrh r2, [r7, 0x16] - ldr r1, =0xfffffe0f - ands r1, r2 - orrs r1, r0 - strh r1, [r7, 0x16] - adds r0, r4, 0 - movs r1, 0x2C - movs r2, 0 - bl pokemon_getattr - ands r0, r6 - lsls r0, 1 - ldrb r2, [r7, 0x17] - movs r1, 0x3F - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r7, 0x17] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - bl pokemon_getattr - mov r1, r10 - adds r1, 0x3C - adds r1, r5, r1 - str r0, [r1] - adds r0, r4, 0 - movs r1, 0x37 - movs r2, 0 - bl pokemon_getattr - mov r1, r10 - adds r1, 0x40 - adds r1, r5, r1 - str r0, [r1] - adds r0, r4, 0 - movs r1, 0x38 - movs r2, 0 - bl pokemon_getattr - adds r1, r7, 0 - adds r1, 0x2A - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x39 - movs r2, 0 - bl pokemon_getattr - strh r0, [r7, 0x28] - adds r0, r4, 0 - movs r1, 0x3A - movs r2, 0 - bl pokemon_getattr - strh r0, [r7, 0x2C] - adds r0, r4, 0 - movs r1, 0x3B - movs r2, 0 - bl pokemon_getattr - strh r0, [r7, 0x2] - adds r0, r4, 0 - movs r1, 0x3C - movs r2, 0 - bl pokemon_getattr - strh r0, [r7, 0x4] - adds r0, r4, 0 - movs r1, 0x3D - movs r2, 0 - bl pokemon_getattr - strh r0, [r7, 0x6] - adds r0, r4, 0 - movs r1, 0x3E - movs r2, 0 - bl pokemon_getattr - strh r0, [r7, 0x8] - adds r0, r4, 0 - movs r1, 0x3F - movs r2, 0 - bl pokemon_getattr - strh r0, [r7, 0xA] - adds r0, r4, 0 - movs r1, 0x2D - movs r2, 0 - bl pokemon_getattr - movs r1, 0x1 - ands r0, r1 - lsls r0, 6 - ldrb r2, [r7, 0x17] - movs r1, 0x41 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r7, 0x17] - adds r0, r4, 0 - movs r1, 0x2E - movs r2, 0 - bl pokemon_getattr - lsls r0, 7 - ldrb r2, [r7, 0x17] - movs r1, 0x7F - ands r1, r2 - orrs r1, r0 - strb r1, [r7, 0x17] - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - bl pokemon_getattr - mov r1, r10 - adds r1, 0x48 - adds r1, r5, r1 - str r0, [r1] - ldr r2, =gBaseStats - ldrh r1, [r7] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x6] - adds r1, r7, 0 - adds r1, 0x21 - strb r0, [r1] - ldrh r1, [r7] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x7] - adds r1, r7, 0 - adds r1, 0x22 - strb r0, [r1] - ldrh r0, [r7] - ldrb r1, [r7, 0x17] - lsrs r1, 7 - bl sub_806B694 - adds r1, r7, 0 - adds r1, 0x20 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - mov r0, r10 - adds r0, 0x24 - adds r0, r5, r0 - mov r1, sp - bl CopyString_Limit10 - mov r2, r10 - adds r2, 0x30 - adds r2, r5, r2 - adds r0, r4, 0 - movs r1, 0x7 - bl pokemon_getattr - ldr r0, [sp, 0x14] - bl battle_side_get_owner - ldr r1, =0x0202449c - lsls r0, 24 - lsrs r0, 23 - adds r0, 0xA8 - ldr r1, [r1] - adds r1, r0 - ldrh r0, [r7, 0x28] - strh r0, [r1] - movs r2, 0x6 - mov r1, r9 - movs r6, 0x7 - add r5, r10 - adds r0, r5, 0 - adds r0, 0x13 -_0806BCB2: - strb r2, [r0] - subs r0, 0x1 - subs r6, 0x1 - cmp r6, 0 - bge _0806BCB2 - movs r2, 0 - movs r0, 0x58 - ldr r3, [sp, 0x14] - muls r0, r3 - adds r1, 0x50 - adds r0, r1 - str r2, [r0] - ldr r0, [sp, 0x14] - bl sub_803FA70 - ldr r0, [sp, 0x14] - movs r1, 0 - bl sub_805EF84 - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end battle_data_fill - - thumb_func_start ExecuteTableBasedItemEffect_ -@ bool8 ExecuteTableBasedItemEffect_(struct pokemon *mon, u16 itemId, u8 a3, u8 monMoveIndex) -ExecuteTableBasedItemEffect_: @ 806BD04 - push {r4,lr} - sub sp, 0x4 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - movs r4, 0 - str r4, [sp] - bl ExecuteTableBasedItemEffect - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end ExecuteTableBasedItemEffect_ - - thumb_func_start ExecuteTableBasedItemEffect -@ bool8 ExecuteTableBasedItemEffect(struct pokemon *mon, u16 itemId, u8 a3, u8 monMoveIndex, u8 a5) -ExecuteTableBasedItemEffect: @ 806BD28 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x44 - mov r8, r0 - ldr r0, [sp, 0x64] - lsls r1, 16 - lsrs r1, 16 - str r1, [sp, 0xC] - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x10] - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x14] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x18] - movs r0, 0x1 - str r0, [sp, 0x20] - movs r1, 0x6 - str r1, [sp, 0x28] - movs r2, 0 - str r2, [sp, 0x30] - movs r3, 0x4 - str r3, [sp, 0x38] - movs r5, 0 - str r5, [sp, 0x3C] - mov r0, r8 - movs r1, 0xC - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xAF - bne _0806BDBC - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0806BDA8 - ldr r2, =0x02024404 - ldr r0, =0x020244b8 - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x7] - b _0806BDC4 - .pool -_0806BDA8: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x00003226 - adds r0, r2 - ldrb r0, [r0] - b _0806BDC4 - .pool -_0806BDBC: - bl itemid_get_x12 - lsls r0, 24 - lsrs r0, 24 -_0806BDC4: - str r0, [sp, 0x34] - ldr r1, =0x0202420f - ldr r0, =0x020244b8 - ldrb r2, [r0] - strb r2, [r1] - ldr r0, =0x030022c0 - ldr r3, =0x00000439 - adds r0, r3 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _0806BE64 - ldr r0, =0x02024064 - strb r2, [r0] - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - negs r1, r0 - orrs r1, r0 - lsrs r1, 31 - str r1, [sp, 0x1C] - ldr r0, =0x0202406c - ldr r4, [sp, 0xC] - subs r4, 0xD - ldrb r0, [r0] - cmp r1, r0 - bge _0806BE70 - ldr r2, =0x0202406e - lsls r0, r1, 1 - adds r0, r2 - ldrh r3, [r0] - ldr r5, [sp, 0x10] - lsls r0, r5, 16 - lsrs r1, r0, 16 - adds r5, r0, 0 - cmp r3, r1 - bne _0806BE3C - ldr r0, [sp, 0x1C] - str r0, [sp, 0x38] - b _0806BE70 - .pool -_0806BE3C: - ldr r1, [sp, 0x1C] - adds r1, 0x2 - str r1, [sp, 0x1C] - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r1, r0 - bge _0806BE70 - lsls r0, r1, 1 - adds r0, r2 - ldrh r1, [r0] - lsrs r0, r5, 16 - cmp r1, r0 - bne _0806BE3C - ldr r2, [sp, 0x1C] - lsls r0, r2, 24 - lsrs r0, 24 - str r0, [sp, 0x38] - b _0806BE70 - .pool -_0806BE64: - ldr r0, =0x02024064 - strb r1, [r0] - movs r3, 0x4 - str r3, [sp, 0x38] - ldr r4, [sp, 0xC] - subs r4, 0xD -_0806BE70: - lsls r0, r4, 16 - lsrs r0, 16 - cmp r0, 0xA5 - bhi _0806BEF0 - ldr r1, =gItemEffectInfoPointers - lsls r0, r4, 2 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - bne _0806BE94 - ldr r5, [sp, 0xC] - cmp r5, 0xAF - beq _0806BE9A - b _0806BEF0 - .pool -_0806BE94: - ldr r1, [sp, 0xC] - cmp r1, 0xAF - bne _0806BEF6 -_0806BE9A: - ldr r0, =0x030022c0 - ldr r2, =0x00000439 - adds r0, r2 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0806BECC - ldr r0, =0x02024064 - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - ldr r1, =0x0202440c - adds r0, r1 - b _0806BEF6 - .pool -_0806BECC: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r3, =0x00003214 - adds r3, r0, r3 - str r3, [sp, 0x24] - b _0806BEF8 - .pool -_0806BEE0: - mov r0, r8 - movs r2, 0 - ldr r3, [sp, 0x10] - bl sub_813DA40 - movs r0, 0 - bl _0806CD5C -_0806BEF0: - movs r0, 0x1 - bl _0806CD5C -_0806BEF6: - str r0, [sp, 0x24] -_0806BEF8: - movs r5, 0 - str r5, [sp, 0x1C] -_0806BEFC: - ldr r0, [sp, 0x1C] - cmp r0, 0x5 - bls _0806BF06 - bl _0806CD4C -_0806BF06: - lsls r0, 2 - ldr r1, =_0806BF14 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0806BF14: - .4byte _0806BF2C - .4byte _0806BFFC - .4byte _0806C08C - .4byte _0806C120 - .4byte _0806C300 - .4byte _0806C9BE -_0806BF2C: - ldr r1, [sp, 0x24] - ldr r3, [sp, 0x1C] - adds r2, r1, r3 - ldrb r1, [r2] - movs r0, 0x80 - ands r0, r1 - adds r6, r2, 0 - cmp r0, 0 - beq _0806BF76 - ldr r0, =0x030022c0 - ldr r5, =0x00000439 - adds r0, r5 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0806BF76 - ldr r0, [sp, 0x38] - cmp r0, 0x4 - beq _0806BF76 - ldr r1, =0x02024084 - movs r0, 0x58 - ldr r2, [sp, 0x38] - muls r0, r2 - adds r1, 0x50 - adds r2, r0, r1 - ldr r1, [r2] - movs r0, 0xF0 - lsls r0, 12 - ands r0, r1 - cmp r0, 0 - beq _0806BF76 - ldr r0, =0xfff0ffff - ands r1, r0 - str r1, [r2] - movs r3, 0 - str r3, [sp, 0x20] -_0806BF76: - ldrb r1, [r6] - movs r0, 0x30 - ands r0, r1 - cmp r0, 0 - beq _0806BFA4 - ldr r1, =0x02024084 - ldr r0, =0x02024064 - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r2, r0, r1 - ldr r1, [r2] - movs r3, 0x80 - lsls r3, 13 - adds r0, r1, 0 - ands r0, r3 - cmp r0, 0 - bne _0806BFA4 - orrs r1, r3 - str r1, [r2] - movs r5, 0 - str r5, [sp, 0x20] -_0806BFA4: - ldrb r0, [r6] - movs r3, 0xF - ands r3, r0 - cmp r3, 0 - bne _0806BFB2 - bl _0806CD4C -_0806BFB2: - ldr r6, =0x02024084 - ldr r5, =0x02024064 - ldrb r0, [r5] - movs r4, 0x58 - muls r0, r4 - adds r1, r0, r6 - ldrb r2, [r1, 0x19] - movs r0, 0x19 - ldrsb r0, [r1, r0] - cmp r0, 0xB - ble _0806BFCC - bl _0806CD4C -_0806BFCC: - adds r0, r2, r3 - strb r0, [r1, 0x19] - ldrb r0, [r5] - muls r0, r4 - adds r1, r0, r6 - movs r0, 0x19 - ldrsb r0, [r1, r0] - cmp r0, 0xC - bgt _0806BFE0 - b _0806C110 -_0806BFE0: - movs r0, 0xC - strb r0, [r1, 0x19] - b _0806C110 - .pool -_0806BFFC: - ldr r1, [sp, 0x24] - ldr r3, [sp, 0x1C] - adds r2, r1, r3 - ldrb r1, [r2] - movs r0, 0xF0 - ands r0, r1 - lsls r3, r0, 24 - adds r6, r2, 0 - cmp r3, 0 - beq _0806C042 - ldr r7, =0x02024084 - ldr r5, =0x02024064 - ldrb r0, [r5] - movs r4, 0x58 - muls r0, r4 - adds r1, r0, r7 - ldrb r2, [r1, 0x1A] - movs r0, 0x1A - ldrsb r0, [r1, r0] - cmp r0, 0xB - bgt _0806C042 - lsrs r0, r3, 28 - adds r0, r2, r0 - strb r0, [r1, 0x1A] - ldrb r0, [r5] - muls r0, r4 - adds r1, r0, r7 - movs r0, 0x1A - ldrsb r0, [r1, r0] - cmp r0, 0xC - ble _0806C03E - movs r0, 0xC - strb r0, [r1, 0x1A] -_0806C03E: - movs r5, 0 - str r5, [sp, 0x20] -_0806C042: - ldrb r0, [r6] - movs r3, 0xF - ands r3, r0 - cmp r3, 0 - bne _0806C050 - bl _0806CD4C -_0806C050: - ldr r6, =0x02024084 - ldr r5, =0x02024064 - ldrb r0, [r5] - movs r4, 0x58 - muls r0, r4 - adds r1, r0, r6 - ldrb r2, [r1, 0x1B] - movs r0, 0x1B - ldrsb r0, [r1, r0] - cmp r0, 0xB - ble _0806C06A - bl _0806CD4C -_0806C06A: - adds r0, r2, r3 - strb r0, [r1, 0x1B] - ldrb r0, [r5] - muls r0, r4 - adds r1, r0, r6 - movs r0, 0x1B - ldrsb r0, [r1, r0] - cmp r0, 0xC - ble _0806C110 - movs r0, 0xC - strb r0, [r1, 0x1B] - b _0806C110 - .pool -_0806C08C: - ldr r1, [sp, 0x24] - ldr r3, [sp, 0x1C] - adds r2, r1, r3 - ldrb r1, [r2] - movs r0, 0xF0 - ands r0, r1 - lsls r3, r0, 24 - adds r6, r2, 0 - cmp r3, 0 - beq _0806C0D2 - ldr r7, =0x02024084 - ldr r5, =0x02024064 - ldrb r0, [r5] - movs r4, 0x58 - muls r0, r4 - adds r1, r0, r7 - ldrb r2, [r1, 0x1E] - movs r0, 0x1E - ldrsb r0, [r1, r0] - cmp r0, 0xB - bgt _0806C0D2 - lsrs r0, r3, 28 - adds r0, r2, r0 - strb r0, [r1, 0x1E] - ldrb r0, [r5] - muls r0, r4 - adds r1, r0, r7 - movs r0, 0x1E - ldrsb r0, [r1, r0] - cmp r0, 0xC - ble _0806C0CE - movs r0, 0xC - strb r0, [r1, 0x1E] -_0806C0CE: - movs r5, 0 - str r5, [sp, 0x20] -_0806C0D2: - ldrb r0, [r6] - movs r3, 0xF - ands r3, r0 - cmp r3, 0 - bne _0806C0E0 - bl _0806CD4C -_0806C0E0: - ldr r6, =0x02024084 - ldr r5, =0x02024064 - ldrb r0, [r5] - movs r4, 0x58 - muls r0, r4 - adds r1, r0, r6 - ldrb r2, [r1, 0x1C] - movs r0, 0x1C - ldrsb r0, [r1, r0] - cmp r0, 0xB - ble _0806C0FA - bl _0806CD4C -_0806C0FA: - adds r0, r2, r3 - strb r0, [r1, 0x1C] - ldrb r0, [r5] - muls r0, r4 - adds r1, r0, r6 - movs r0, 0x1C - ldrsb r0, [r1, r0] - cmp r0, 0xC - ble _0806C110 - movs r0, 0xC - strb r0, [r1, 0x1C] -_0806C110: - movs r0, 0 - str r0, [sp, 0x20] - bl _0806CD4C - .pool -_0806C120: - ldr r1, [sp, 0x24] - ldr r3, [sp, 0x1C] - adds r2, r1, r3 - ldrb r1, [r2] - movs r0, 0x80 - ands r0, r1 - adds r6, r2, 0 - cmp r0, 0 - beq _0806C168 - ldr r5, =0x02024294 - ldr r4, =0x02024064 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r0, [r1, 0x4] - cmp r0, 0 - bne _0806C168 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - movs r0, 0x5 - strb r0, [r1, 0x4] - movs r5, 0 - str r5, [sp, 0x20] -_0806C168: - ldrb r1, [r6] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0806C1CA - mov r0, r8 - movs r1, 0x38 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0x64 - beq _0806C1CA - ldr r5, =gExperienceTables - mov r0, r8 - movs r1, 0x38 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - mov r0, r8 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - adds r4, 0x1 - lsls r4, 2 - ldr r2, =gBaseStats - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r1, [r1, 0x13] - movs r0, 0xCA - lsls r0, 1 - muls r0, r1 - adds r4, r0 - adds r4, r5 - ldr r0, [r4] - str r0, [sp] - mov r0, r8 - movs r1, 0x19 - mov r2, sp - bl pokemon_setattr - mov r0, r8 - bl pokemon_calc_effective_stats - movs r0, 0 - str r0, [sp, 0x20] -_0806C1CA: - ldrb r1, [r6] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0806C206 - mov r0, r8 - ldr r1, [sp, 0x10] - movs r2, 0x7 - ldr r3, [sp, 0x38] - bl HealStatusConditions - lsls r0, 24 - cmp r0, 0 - bne _0806C206 - ldr r1, [sp, 0x38] - cmp r1, 0x4 - beq _0806C202 - ldr r1, =0x02024084 - movs r0, 0x58 - ldr r3, [sp, 0x38] - adds r2, r3, 0 - muls r2, r0 - adds r1, 0x50 - adds r2, r1 - ldr r0, [r2] - ldr r1, =0xf7ffffff - ands r0, r1 - str r0, [r2] -_0806C202: - movs r5, 0 - str r5, [sp, 0x20] -_0806C206: - ldrb r1, [r6] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0806C226 - ldr r2, =0x00000f88 - mov r0, r8 - ldr r1, [sp, 0x10] - ldr r3, [sp, 0x38] - bl HealStatusConditions - lsls r0, 24 - cmp r0, 0 - bne _0806C226 - movs r0, 0 - str r0, [sp, 0x20] -_0806C226: - ldrb r1, [r6] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0806C246 - mov r0, r8 - ldr r1, [sp, 0x10] - movs r2, 0x10 - ldr r3, [sp, 0x38] - bl HealStatusConditions - lsls r0, 24 - cmp r0, 0 - bne _0806C246 - movs r1, 0 - str r1, [sp, 0x20] -_0806C246: - ldrb r1, [r6] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0806C266 - mov r0, r8 - ldr r1, [sp, 0x10] - movs r2, 0x20 - ldr r3, [sp, 0x38] - bl HealStatusConditions - lsls r0, 24 - cmp r0, 0 - bne _0806C266 - movs r2, 0 - str r2, [sp, 0x20] -_0806C266: - ldrb r1, [r6] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0806C286 - mov r0, r8 - ldr r1, [sp, 0x10] - movs r2, 0x40 - ldr r3, [sp, 0x38] - bl HealStatusConditions - lsls r0, 24 - cmp r0, 0 - bne _0806C286 - movs r3, 0 - str r3, [sp, 0x20] -_0806C286: - ldrb r1, [r6] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0806C294 - bl _0806CD4C -_0806C294: - ldr r0, =0x030022c0 - ldr r5, =0x00000439 - adds r0, r5 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _0806C2A8 - bl _0806CD4C -_0806C2A8: - ldr r0, [sp, 0x38] - cmp r0, 0x4 - bne _0806C2B2 - bl _0806CD4C -_0806C2B2: - ldr r1, =0x02024084 - movs r0, 0x58 - ldr r2, [sp, 0x38] - muls r0, r2 - adds r1, 0x50 - adds r2, r0, r1 - ldr r1, [r2] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - bne _0806C2CC - bl _0806CD4C -_0806C2CC: - movs r0, 0x8 - negs r0, r0 - ands r1, r0 - str r1, [r2] - movs r3, 0 - str r3, [sp, 0x20] - bl _0806CD4C - .pool -_0806C300: - ldr r5, [sp, 0x24] - ldr r1, [sp, 0x1C] - adds r0, r5, r1 - ldrb r0, [r0] - mov r10, r0 - movs r0, 0x20 - mov r2, r10 - ands r0, r2 - cmp r0, 0 - beq _0806C3D8 - movs r0, 0xDF - ands r2, r0 - mov r10, r2 - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr - ldr r1, =gUnknown_08329D22 - ldr r3, [sp, 0x14] - adds r1, r3, r1 - ldrb r1, [r1] - ands r0, r1 - lsls r1, r3, 1 - lsrs r0, r1 - str r0, [sp] - adds r5, r3, 0 - adds r5, 0xD - mov r0, r8 - adds r1, r5, 0 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - ldr r2, [sp, 0x14] - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x2C] - ldr r0, [sp] - cmp r0, 0x2 - bhi _0806C3D8 - ldr r0, [sp, 0x2C] - cmp r0, 0x4 - bls _0806C3D8 - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr - ldr r1, =gUnknown_08329D2A - ldr r2, [sp, 0x14] - adds r1, r2, r1 - ldrb r1, [r1] - adds r0, r1 - str r0, [sp] - mov r0, r8 - movs r1, 0x15 - mov r2, sp - bl pokemon_setattr - mov r0, r8 - adds r1, r5, 0 - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - ldr r1, [sp] - lsls r1, 24 - lsrs r1, 24 - ldr r2, [sp, 0x14] - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r0, 24 - ldr r3, [sp, 0x2C] - subs r0, r3 - str r0, [sp] - ldr r4, [sp, 0x14] - adds r4, 0x11 - mov r0, r8 - adds r1, r4, 0 - movs r2, 0 - bl pokemon_getattr - ldr r1, [sp] - adds r0, r1 - str r0, [sp] - mov r0, r8 - adds r1, r4, 0 - mov r2, sp - bl pokemon_setattr - movs r5, 0 - str r5, [sp, 0x20] -_0806C3D8: - movs r0, 0 - str r0, [sp, 0x2C] - mov r1, r10 - cmp r1, 0 - bne _0806C3E6 - bl _0806CD4C -_0806C3E6: - movs r0, 0x1 - mov r2, r10 - ands r0, r2 - cmp r0, 0 - bne _0806C3F2 - b _0806C9AA -_0806C3F2: - ldr r3, [sp, 0x2C] - cmp r3, 0x7 - bls _0806C3FA - b _0806C9AA -_0806C3FA: - lsls r0, r3, 2 - ldr r1, =_0806C410 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0806C410: - .4byte _0806C430 - .4byte _0806C430 - .4byte _0806C4DC - .4byte _0806C700 - .4byte _0806C9AA - .4byte _0806C9AA - .4byte _0806C9AA - .4byte _0806C994 -_0806C430: - mov r0, r8 - bl sub_806DC8C - lsls r0, 16 - lsrs r6, r0, 16 - ldr r5, [sp, 0x24] - ldr r1, [sp, 0x28] - adds r0, r5, r1 - ldrb r5, [r0] - ldr r0, =gUnknown_08329EC2 - ldr r2, [sp, 0x2C] - adds r0, r2, r0 - ldrb r1, [r0] - mov r0, r8 - movs r2, 0 - bl pokemon_getattr - adds r1, r0, 0 - str r1, [sp, 0x4] - lsls r0, r5, 24 - asrs r2, r0, 24 - cmp r2, 0 - ble _0806C498 - ldr r0, =0x000001fd - cmp r6, r0 - bls _0806C466 - b _0806BEF0 -_0806C466: - adds r3, r1, 0 - cmp r3, 0x63 - ble _0806C46E - b _0806C9AA -_0806C46E: - adds r1, r3, r2 - cmp r1, 0x64 - ble _0806C484 - adds r0, r2, 0 - adds r0, 0x64 - subs r5, r0, r1 - b _0806C486 - .pool -_0806C484: - adds r5, r2, 0 -_0806C486: - adds r1, r6, r5 - movs r0, 0xFF - lsls r0, 1 - cmp r1, r0 - bls _0806C494 - adds r0, r5, r0 - subs r5, r0, r1 -_0806C494: - adds r0, r3, r5 - b _0806C4B2 -_0806C498: - cmp r1, 0 - bne _0806C4A8 - movs r3, 0x1 - str r3, [sp, 0x3C] - ldr r0, [sp, 0x28] - adds r0, 0x1 - lsls r0, 24 - b _0806C83E -_0806C4A8: - adds r0, r1, r2 - str r0, [sp, 0x4] - cmp r0, 0 - bge _0806C4B4 - movs r0, 0 -_0806C4B2: - str r0, [sp, 0x4] -_0806C4B4: - ldr r0, =gUnknown_08329EC2 - ldr r5, [sp, 0x2C] - adds r0, r5, r0 - ldrb r1, [r0] - add r2, sp, 0x4 - mov r0, r8 - bl pokemon_setattr - mov r0, r8 - bl pokemon_calc_effective_stats - ldr r0, [sp, 0x28] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x28] - b _0806C978 - .pool -_0806C4DC: - movs r0, 0x10 - mov r1, r10 - ands r0, r1 - cmp r0, 0 - beq _0806C59C - mov r0, r8 - movs r1, 0x39 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - beq _0806C4FC - ldr r0, [sp, 0x28] - adds r0, 0x1 - lsls r0, 24 - b _0806C83E -_0806C4FC: - ldr r0, =0x030022c0 - ldr r2, =0x00000439 - adds r0, r2 - ldrb r1, [r0] - movs r4, 0x2 - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0806C5B2 - ldr r3, [sp, 0x38] - cmp r3, 0x4 - beq _0806C55C - ldr r2, =0x02024210 - ldr r1, =gUnknown_0832A328 - lsls r0, r3, 2 - adds r0, r1 - ldr r1, [r0] - ldrb r0, [r2] - bics r0, r1 - strb r0, [r2] - ldr r1, =0x0202406e - lsls r0, r3, 1 - adds r0, r1 - ldrb r0, [r0] - bl pokemon_order_func - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r0, [sp, 0x38] - bl battle_data_fill - ldr r0, =0x02024064 - ldrb r0, [r0] - b _0806C574 - .pool -_0806C55C: - ldr r3, =0x02024210 - ldr r1, =gUnknown_0832A328 - ldr r2, =0x02024064 - ldrb r0, [r2] - eors r0, r4 - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - ldrb r0, [r3] - bics r0, r1 - strb r0, [r3] - ldrb r0, [r2] -_0806C574: - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0806C5B2 - ldr r1, =0x03005d10 - ldrb r0, [r1, 0x4] - cmp r0, 0xFE - bhi _0806C5B2 - adds r0, 0x1 - strb r0, [r1, 0x4] - b _0806C5B2 - .pool -_0806C59C: - mov r0, r8 - movs r1, 0x39 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - bne _0806C5B2 - ldr r0, [sp, 0x28] - adds r0, 0x1 - lsls r0, 24 - b _0806C83E -_0806C5B2: - ldr r1, [sp, 0x28] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x28] - ldr r5, [sp, 0x24] - adds r1, r5, r1 - ldrb r1, [r1] - str r1, [sp] - adds r0, r1, 0 - cmp r0, 0xFE - beq _0806C5F4 - cmp r0, 0xFE - bhi _0806C5D4 - cmp r0, 0xFD - beq _0806C60A - b _0806C612 -_0806C5D4: - cmp r1, 0xFF - bne _0806C612 - mov r0, r8 - movs r1, 0x3A - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - mov r0, r8 - movs r1, 0x39 - movs r2, 0 - bl pokemon_getattr - subs r4, r0 - str r4, [sp] - b _0806C612 -_0806C5F4: - mov r0, r8 - movs r1, 0x3A - movs r2, 0 - bl pokemon_getattr - lsrs r0, 1 - str r0, [sp] - cmp r0, 0 - bne _0806C612 - movs r0, 0x1 - b _0806C610 -_0806C60A: - ldr r0, =0x02024474 - adds r0, 0x23 - ldrb r0, [r0] -_0806C610: - str r0, [sp] -_0806C612: - mov r0, r8 - movs r1, 0x3A - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - mov r0, r8 - movs r1, 0x39 - movs r2, 0 - bl pokemon_getattr - cmp r4, r0 - beq _0806C6F0 - ldr r0, [sp, 0x18] - cmp r0, 0 - bne _0806C6E4 - mov r0, r8 - movs r1, 0x39 - movs r2, 0 - bl pokemon_getattr - ldr r1, [sp] - adds r0, r1 - str r0, [sp] - mov r0, r8 - movs r1, 0x3A - movs r2, 0 - bl pokemon_getattr - ldr r1, [sp] - cmp r1, r0 - bls _0806C65E - mov r0, r8 - movs r1, 0x3A - movs r2, 0 - bl pokemon_getattr - str r0, [sp] -_0806C65E: - mov r0, r8 - movs r1, 0x39 - mov r2, sp - bl pokemon_setattr - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0806C6EC - ldr r2, [sp, 0x38] - cmp r2, 0x4 - beq _0806C6EC - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldr r1, [sp] - strh r1, [r0, 0x28] - movs r0, 0x10 - mov r3, r10 - ands r0, r3 - cmp r0, 0 - bne _0806C6EC - ldr r4, =0x02024064 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0806C6EC - ldr r1, =0x03005d10 - ldrb r0, [r1, 0x3] - cmp r0, 0xFE - bhi _0806C6AE - adds r0, 0x1 - strb r0, [r1, 0x3] -_0806C6AE: - ldrb r5, [r4] - add r0, sp, 0x38 - ldrb r0, [r0] - strb r0, [r4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl dp01_build_cmdbuf_x00_a_b_0 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - strb r5, [r4] - b _0806C6EC - .pool -_0806C6E4: - ldr r1, =0x020241f0 - ldr r0, [sp] - negs r0, r0 - str r0, [r1] -_0806C6EC: - movs r1, 0 - str r1, [sp, 0x20] -_0806C6F0: - movs r0, 0xEF - mov r2, r10 - ands r2, r0 - mov r10, r2 - b _0806C9AA - .pool -_0806C700: - movs r7, 0x2 - mov r0, r10 - ands r0, r7 - cmp r0, 0 - beq _0806C70C - b _0806C858 -_0806C70C: - movs r5, 0 - ldr r3, [sp, 0x28] - adds r3, 0x1 - str r3, [sp, 0x40] -_0806C714: - movs r0, 0x11 - adds r0, r5 - mov r9, r0 - mov r0, r8 - mov r1, r9 - movs r2, 0 - bl pokemon_getattr - str r0, [sp] - adds r7, r5, 0 - adds r7, 0xD - mov r0, r8 - adds r1, r7, 0 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r5, 24 - lsrs r6, r0, 24 - adds r0, r4, 0 - adds r2, r6, 0 - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r0, 24 - ldr r1, [sp] - cmp r1, r0 - beq _0806C832 - ldr r2, [sp, 0x24] - ldr r3, [sp, 0x28] - adds r0, r2, r3 - ldrb r0, [r0] - adds r0, r1, r0 - str r0, [sp] - mov r0, r8 - adds r1, r7, 0 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - adds r2, r6, 0 - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r0, 24 - ldr r1, [sp] - cmp r1, r0 - bls _0806C7CC - mov r0, r8 - adds r1, r7, 0 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - adds r2, r6, 0 - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] -_0806C7CC: - mov r0, r8 - mov r1, r9 - mov r2, sp - bl pokemon_setattr - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0806C82E - ldr r2, [sp, 0x38] - cmp r2, 0x4 - beq _0806C82E - ldr r4, =0x02024084 - movs r0, 0x58 - adds r3, r2, 0 - muls r3, r0 - adds r0, r4, 0 - adds r0, 0x50 - adds r0, r3, r0 - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 14 - ands r1, r0 - cmp r1, 0 - bne _0806C82E - ldr r1, =0x020242bc - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x18] - lsrs r1, 4 - ldr r2, =gUnknown_0832A328 - lsls r0, r5, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0806C82E - adds r0, r5, r3 - adds r1, r4, 0 - adds r1, 0x24 - adds r0, r1 - ldr r1, [sp] - strb r1, [r0] -_0806C82E: - movs r3, 0 - str r3, [sp, 0x20] -_0806C832: - adds r5, 0x1 - cmp r5, 0x3 - bgt _0806C83A - b _0806C714 -_0806C83A: - ldr r5, [sp, 0x40] - lsls r0, r5, 24 -_0806C83E: - lsrs r0, 24 - str r0, [sp, 0x28] - b _0806C9AA - .pool -_0806C858: - ldr r6, [sp, 0x14] - adds r6, 0x11 - mov r0, r8 - adds r1, r6, 0 - movs r2, 0 - bl pokemon_getattr - str r0, [sp] - ldr r5, [sp, 0x14] - adds r5, 0xD - mov r0, r8 - adds r1, r5, 0 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - ldr r2, [sp, 0x14] - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r0, 24 - ldr r2, [sp] - cmp r2, r0 - bne _0806C8A0 - b _0806C9AA -_0806C8A0: - ldr r1, [sp, 0x28] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x28] - ldr r0, [sp, 0x24] - adds r1, r0, r1 - ldrb r0, [r1] - adds r0, r2, r0 - str r0, [sp] - mov r0, r8 - adds r1, r5, 0 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - ldr r2, [sp, 0x14] - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r0, 24 - ldr r1, [sp] - cmp r1, r0 - bls _0806C914 - mov r0, r8 - adds r1, r5, 0 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - ldr r2, [sp, 0x14] - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] -_0806C914: - mov r0, r8 - adds r1, r6, 0 - mov r2, sp - bl pokemon_setattr - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0 - beq _0806C978 - ldr r2, [sp, 0x38] - cmp r2, 0x4 - beq _0806C978 - ldr r4, =0x02024084 - movs r0, 0x58 - adds r3, r2, 0 - muls r3, r0 - adds r0, r4, 0 - adds r0, 0x50 - adds r0, r3, r0 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 14 - ands r0, r1 - cmp r0, 0 - bne _0806C978 - ldr r1, =0x020242bc - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x18] - lsrs r1, 4 - ldr r2, =gUnknown_0832A328 - ldr r5, [sp, 0x14] - lsls r0, r5, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0806C978 - adds r0, r5, r3 - adds r1, r4, 0 - adds r1, 0x24 - adds r0, r1 - ldr r1, [sp] - strb r1, [r0] -_0806C978: - movs r0, 0 - str r0, [sp, 0x20] - b _0806C9AA - .pool -_0806C994: - mov r0, r8 - movs r1, 0x2 - ldr r2, [sp, 0xC] - bl GetEvolutionTargetSpecies - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _0806C9AA - bl _0806BEE0 -_0806C9AA: - ldr r1, [sp, 0x2C] - adds r1, 0x1 - str r1, [sp, 0x2C] - mov r2, r10 - lsrs r2, 1 - mov r10, r2 - cmp r2, 0 - beq _0806C9BC - b _0806C3E6 -_0806C9BC: - b _0806CD4C -_0806C9BE: - ldr r3, [sp, 0x24] - ldr r5, [sp, 0x1C] - adds r0, r3, r5 - ldrb r0, [r0] - mov r10, r0 - movs r0, 0 - str r0, [sp, 0x2C] - mov r1, r10 - cmp r1, 0 - bne _0806C9D4 - b _0806CD4C -_0806C9D4: - movs r0, 0x1 - mov r2, r10 - ands r0, r2 - cmp r0, 0 - bne _0806C9E0 - b _0806CD3A -_0806C9E0: - ldr r3, [sp, 0x2C] - cmp r3, 0x7 - bls _0806C9E8 - b _0806CD3A -_0806C9E8: - lsls r0, r3, 2 - ldr r1, =_0806C9F8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0806C9F8: - .4byte _0806CA18 - .4byte _0806CA18 - .4byte _0806CA18 - .4byte _0806CA18 - .4byte _0806CAB8 - .4byte _0806CB94 - .4byte _0806CC00 - .4byte _0806CC68 -_0806CA18: - mov r0, r8 - bl sub_806DC8C - lsls r0, 16 - lsrs r6, r0, 16 - ldr r5, [sp, 0x24] - ldr r1, [sp, 0x28] - adds r0, r5, r1 - ldrb r5, [r0] - ldr r0, =gUnknown_08329EC2 - ldr r4, [sp, 0x2C] - adds r4, 0x2 - adds r0, r4, r0 - ldrb r1, [r0] - mov r0, r8 - movs r2, 0 - bl pokemon_getattr - adds r1, r0, 0 - str r1, [sp, 0x4] - lsls r0, r5, 24 - asrs r2, r0, 24 - cmp r2, 0 - ble _0806CA84 - ldr r0, =0x000001fd - cmp r6, r0 - bls _0806CA52 - bl _0806BEF0 -_0806CA52: - adds r3, r1, 0 - cmp r3, 0x63 - ble _0806CA5A - b _0806CD3A -_0806CA5A: - adds r1, r3, r2 - cmp r1, 0x64 - ble _0806CA70 - adds r0, r2, 0 - adds r0, 0x64 - subs r5, r0, r1 - b _0806CA72 - .pool -_0806CA70: - adds r5, r2, 0 -_0806CA72: - adds r1, r6, r5 - movs r0, 0xFF - lsls r0, 1 - cmp r1, r0 - bls _0806CA80 - adds r0, r5, r0 - subs r5, r0, r1 -_0806CA80: - adds r0, r3, r5 - b _0806CA98 -_0806CA84: - cmp r1, 0 - bne _0806CA8E - movs r2, 0x1 - str r2, [sp, 0x3C] - b _0806CD30 -_0806CA8E: - adds r0, r1, r2 - str r0, [sp, 0x4] - cmp r0, 0 - bge _0806CA9A - movs r0, 0 -_0806CA98: - str r0, [sp, 0x4] -_0806CA9A: - ldr r0, =gUnknown_08329EC2 - adds r0, r4, r0 - ldrb r1, [r0] - add r2, sp, 0x4 - mov r0, r8 - bl pokemon_setattr - mov r0, r8 - bl pokemon_calc_effective_stats - movs r3, 0 - str r3, [sp, 0x20] - b _0806CD30 - .pool -_0806CAB8: - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr - ldr r1, =gUnknown_08329D22 - ldr r5, [sp, 0x14] - adds r1, r5, r1 - ldrb r1, [r1] - ands r0, r1 - lsls r1, r5, 1 - lsrs r0, r1 - str r0, [sp] - adds r6, r5, 0 - adds r6, 0xD - mov r0, r8 - adds r1, r6, 0 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - ldr r2, [sp, 0x14] - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, [sp] - cmp r0, 0x2 - bls _0806CB0A - b _0806CD3A -_0806CB0A: - cmp r5, 0x4 - bhi _0806CB10 - b _0806CD3A -_0806CB10: - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr - str r0, [sp] - ldr r1, =gUnknown_08329D26 - ldr r2, [sp, 0x14] - adds r1, r2, r1 - ldrb r2, [r1] - ands r2, r0 - str r2, [sp] - ldr r0, =gUnknown_08329D2A - ldr r3, [sp, 0x14] - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - adds r2, r0 - str r2, [sp] - mov r0, r8 - movs r1, 0x15 - mov r2, sp - bl pokemon_setattr - mov r0, r8 - adds r1, r6, 0 - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - ldr r1, [sp] - lsls r1, 24 - lsrs r1, 24 - ldr r2, [sp, 0x14] - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r0, 24 - subs r0, r5 - str r0, [sp] - ldr r4, [sp, 0x14] - adds r4, 0x11 - mov r0, r8 - adds r1, r4, 0 - movs r2, 0 - bl pokemon_getattr - ldr r1, [sp] - adds r0, r1 - str r0, [sp] - mov r0, r8 - adds r1, r4, 0 - mov r2, sp - bl pokemon_setattr - movs r5, 0 - str r5, [sp, 0x20] - b _0806CD3A - .pool -_0806CB94: - mov r0, r8 - movs r1, 0x20 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0x63 - bls _0806CBA4 - b _0806CD30 -_0806CBA4: - ldr r0, [sp, 0x20] - cmp r0, 0 - beq _0806CBB2 - ldr r1, [sp, 0x3C] - cmp r1, 0 - bne _0806CBB2 - b _0806CD30 -_0806CBB2: - bl sub_806F104 - lsls r0, 24 - cmp r0, 0 - beq _0806CBBE - b _0806CD30 -_0806CBBE: - ldr r2, [sp, 0x30] - cmp r2, 0 - beq _0806CBC6 - b _0806CD30 -_0806CBC6: - ldr r3, [sp, 0x24] - ldr r5, [sp, 0x28] - adds r0, r3, r5 - ldrb r0, [r0] - str r0, [sp, 0x30] - mov r0, r8 - movs r1, 0x20 - movs r2, 0 - bl pokemon_getattr - adds r5, r0, 0 - str r5, [sp, 0x8] - ldr r0, [sp, 0x30] - lsls r4, r0, 24 - asrs r1, r4, 24 - cmp r1, 0 - ble _0806CCCC - ldr r2, [sp, 0x34] - cmp r2, 0x1B - bne _0806CCCC - movs r0, 0x96 - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - adds r0, r5, r0 - str r0, [sp, 0x8] - adds r2, r4, 0 - b _0806CCD8 -_0806CC00: - mov r0, r8 - movs r1, 0x20 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0x63 - bhi _0806CC10 - b _0806CD30 -_0806CC10: - mov r0, r8 - movs r1, 0x20 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0xC7 - bls _0806CC20 - b _0806CD30 -_0806CC20: - ldr r0, [sp, 0x20] - cmp r0, 0 - beq _0806CC2E - ldr r1, [sp, 0x3C] - cmp r1, 0 - bne _0806CC2E - b _0806CD30 -_0806CC2E: - bl sub_806F104 - lsls r0, 24 - cmp r0, 0 - bne _0806CD30 - ldr r2, [sp, 0x30] - cmp r2, 0 - bne _0806CD30 - ldr r3, [sp, 0x24] - ldr r5, [sp, 0x28] - adds r0, r3, r5 - ldrb r0, [r0] - str r0, [sp, 0x30] - mov r0, r8 - movs r1, 0x20 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - str r4, [sp, 0x8] - ldr r0, [sp, 0x30] - lsls r5, r0, 24 - asrs r1, r5, 24 - cmp r1, 0 - ble _0806CCCC - ldr r2, [sp, 0x34] - cmp r2, 0x1B - beq _0806CCBA - b _0806CCCC -_0806CC68: - mov r0, r8 - movs r1, 0x20 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0xC7 - bls _0806CD30 - ldr r0, [sp, 0x20] - cmp r0, 0 - beq _0806CC82 - ldr r1, [sp, 0x3C] - cmp r1, 0 - beq _0806CD30 -_0806CC82: - bl sub_806F104 - lsls r0, 24 - cmp r0, 0 - bne _0806CD30 - ldr r2, [sp, 0x30] - cmp r2, 0 - bne _0806CD30 - ldr r3, [sp, 0x24] - ldr r5, [sp, 0x28] - adds r0, r3, r5 - ldrb r0, [r0] - str r0, [sp, 0x30] - mov r0, r8 - movs r1, 0x20 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - str r4, [sp, 0x8] - ldr r0, [sp, 0x30] - lsls r5, r0, 24 - asrs r1, r5, 24 - cmp r1, 0 - ble _0806CCCC - ldr r2, [sp, 0x34] - cmp r2, 0x1B - bne _0806CCCC -_0806CCBA: - movs r0, 0x96 - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - adds r0, r4, r0 - str r0, [sp, 0x8] - adds r2, r5, 0 - b _0806CCD8 -_0806CCCC: - ldr r3, [sp, 0x30] - lsls r2, r3, 24 - asrs r1, r2, 24 - ldr r0, [sp, 0x8] - adds r0, r1 - str r0, [sp, 0x8] -_0806CCD8: - cmp r2, 0 - ble _0806CD0E - mov r0, r8 - movs r1, 0x26 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0xB - bne _0806CCF0 - ldr r0, [sp, 0x8] - adds r0, 0x1 - str r0, [sp, 0x8] -_0806CCF0: - mov r0, r8 - movs r1, 0x23 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - bl sav1_map_get_name - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bne _0806CD0E - ldr r0, [sp, 0x8] - adds r0, 0x1 - str r0, [sp, 0x8] -_0806CD0E: - ldr r0, [sp, 0x8] - cmp r0, 0 - bge _0806CD18 - movs r0, 0 - str r0, [sp, 0x8] -_0806CD18: - ldr r0, [sp, 0x8] - cmp r0, 0xFF - ble _0806CD22 - movs r0, 0xFF - str r0, [sp, 0x8] -_0806CD22: - add r2, sp, 0x8 - mov r0, r8 - movs r1, 0x20 - bl pokemon_setattr - movs r5, 0 - str r5, [sp, 0x20] -_0806CD30: - ldr r0, [sp, 0x28] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x28] -_0806CD3A: - ldr r0, [sp, 0x2C] - adds r0, 0x1 - str r0, [sp, 0x2C] - mov r1, r10 - lsrs r1, 1 - mov r10, r1 - cmp r1, 0 - beq _0806CD4C - b _0806C9D4 -_0806CD4C: - ldr r2, [sp, 0x1C] - adds r2, 0x1 - str r2, [sp, 0x1C] - cmp r2, 0x5 - bgt _0806CD5A - bl _0806BEFC -_0806CD5A: - ldr r0, [sp, 0x20] -_0806CD5C: - add sp, 0x44 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end ExecuteTableBasedItemEffect - - thumb_func_start HealStatusConditions -@ bool8 HealStatusConditions(struct pokemon *a1, int a2, u32 healMask, u8 a4) -HealStatusConditions: @ 806CD6C - push {r4-r6,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r4, r2, 0 - lsls r3, 24 - lsrs r6, r3, 24 - movs r1, 0x37 - movs r2, 0 - bl pokemon_getattr - adds r1, r0, 0 - str r1, [sp] - ands r0, r4 - cmp r0, 0 - beq _0806CDD0 - mvns r4, r4 - ands r1, r4 - str r1, [sp] - adds r0, r5, 0 - movs r1, 0x37 - mov r2, sp - bl pokemon_setattr - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0806CDBE - cmp r6, 0x4 - beq _0806CDBE - ldr r0, =0x02024084 - movs r1, 0x58 - muls r1, r6 - adds r0, 0x4C - adds r1, r0 - ldr r0, [r1] - ands r0, r4 - str r0, [r1] -_0806CDBE: - movs r0, 0 - b _0806CDD2 - .pool -_0806CDD0: - movs r0, 0x1 -_0806CDD2: - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end HealStatusConditions - - thumb_func_start sub_806CDDC -sub_806CDDC: @ 806CDDC - push {r4-r7,lr} - lsls r0, 16 - lsrs r3, r0, 16 - lsls r1, 24 - lsrs r4, r1, 24 - lsls r2, 24 - lsrs r5, r2, 24 - movs r7, 0x6 - ldr r1, =gItemEffectInfoPointers - adds r0, r3, 0 - subs r0, 0xD - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - bne _0806CE08 - cmp r3, 0xAF - beq _0806CE0C -_0806CE00: - movs r0, 0 - b _0806CF1C - .pool -_0806CE08: - cmp r3, 0xAF - bne _0806CE1A -_0806CE0C: - ldr r0, =0x02024064 - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - ldr r1, =0x0202440c - adds r0, r1 -_0806CE1A: - mov r12, r0 - movs r2, 0 -_0806CE1E: - cmp r2, 0x4 - beq _0806CE3E - cmp r2, 0x4 - ble _0806CE34 - cmp r2, 0x5 - beq _0806CEC8 - b _0806CF12 - .pool -_0806CE34: - cmp r2, 0 - blt _0806CF12 - cmp r2, r4 - bne _0806CF12 - b _0806CE00 -_0806CE3E: - mov r0, r12 - ldrb r3, [r0, 0x4] - movs r0, 0x20 - ands r0, r3 - cmp r0, 0 - beq _0806CE4E - movs r0, 0xDF - ands r3, r0 -_0806CE4E: - movs r6, 0 - cmp r3, 0 - beq _0806CF12 -_0806CE54: - movs r0, 0x1 - ands r0, r3 - cmp r0, 0 - beq _0806CEB4 - cmp r6, 0x7 - bhi _0806CEB4 - lsls r0, r6, 2 - ldr r1, =_0806CE70 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0806CE70: - .4byte _0806CE9C - .4byte _0806CE9C - .4byte _0806CE90 - .4byte _0806CE9C - .4byte _0806CEB4 - .4byte _0806CEB4 - .4byte _0806CEB4 - .4byte _0806CEB0 -_0806CE90: - movs r0, 0x10 - ands r0, r3 - cmp r0, 0 - beq _0806CE9C - movs r0, 0xEF - ands r3, r0 -_0806CE9C: - cmp r2, r4 - bne _0806CEA8 - adds r0, r3, 0 - ands r0, r5 - cmp r0, 0 - bne _0806CF1A -_0806CEA8: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - b _0806CEB4 -_0806CEB0: - cmp r2, r4 - beq _0806CE00 -_0806CEB4: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - lsrs r3, 1 - cmp r2, r4 - bne _0806CEC2 - lsrs r5, 1 -_0806CEC2: - cmp r3, 0 - bne _0806CE54 - b _0806CF12 -_0806CEC8: - mov r0, r12 - ldrb r3, [r0, 0x5] - movs r6, 0 -_0806CECE: - cmp r3, 0 - beq _0806CF12 - movs r0, 0x1 - ands r0, r3 - cmp r0, 0 - beq _0806CF02 - cmp r6, 0 - blt _0806CF02 - cmp r6, 0x6 - ble _0806CEE8 - cmp r6, 0x7 - beq _0806CEFC - b _0806CF02 -_0806CEE8: - cmp r2, r4 - bne _0806CEF4 - adds r0, r3, 0 - ands r0, r5 - cmp r0, 0 - bne _0806CF1A -_0806CEF4: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - b _0806CF02 -_0806CEFC: - cmp r2, r4 - bne _0806CF02 - b _0806CE00 -_0806CF02: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - lsrs r3, 1 - cmp r2, r4 - bne _0806CECE - lsrs r5, 1 - b _0806CECE -_0806CF12: - adds r2, 0x1 - cmp r2, 0x5 - bgt _0806CF1A - b _0806CE1E -_0806CF1A: - adds r0, r7, 0 -_0806CF1C: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_806CDDC - - thumb_func_start sub_806CF24 -sub_806CF24: @ 806CF24 - push {lr} - ldr r2, =0x0202420c - ldr r1, =0x020244b8 - ldrb r1, [r1] - strb r1, [r2] - ldr r3, =0x02022f58 - ldr r2, =gUnknown_085CBE00 - ldr r1, =gUnknown_08329EC8 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r2 - ldr r1, [r0] - adds r0, r3, 0 - bl CopyString - ldr r0, =0x02022f68 - ldr r1, =gUnknown_085CB38A - bl CopyString - ldr r0, =gUnknown_085CB3AA - bl get_battle_strings_ - pop {r0} - bx r0 - .pool - thumb_func_end sub_806CF24 - - thumb_func_start sub_806CF78 -sub_806CF78: @ 806CF78 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xAF - bne _0806CFCC - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0806CFB8 - ldr r2, =0x020244b8 - ldrb r1, [r2] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - ldr r1, =0x0202440c - adds r7, r0, r1 - b _0806CFD8 - .pool -_0806CFB8: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003214 - adds r7, r0, r1 - b _0806CFD6 - .pool -_0806CFCC: - ldr r1, =gItemEffectInfoPointers - subs r0, 0xD - lsls r0, 2 - adds r0, r1 - ldr r7, [r0] -_0806CFD6: - ldr r2, =0x020244b8 -_0806CFD8: - ldr r1, =0x0202420f - ldrb r0, [r2] - strb r0, [r1] - movs r5, 0 - ldr r0, =0x0202420b - mov r8, r0 - movs r6, 0 -_0806CFE6: - adds r4, r7, r5 - ldrb r1, [r4] - movs r0, 0xF - ands r0, r1 - cmp r0, 0 - beq _0806CFF8 - adds r0, r6, 0 - bl sub_806CF24 -_0806CFF8: - ldrb r1, [r4] - movs r0, 0xF0 - ands r0, r1 - cmp r0, 0 - beq _0806D02E - cmp r5, 0 - beq _0806D020 - adds r0, r6, 0x1 - bl sub_806CF24 - b _0806D02E - .pool -_0806D020: - ldr r0, =0x020244b8 - ldrb r0, [r0] - mov r1, r8 - strb r0, [r1] - ldr r0, =gUnknown_085CA459 - bl get_battle_strings_ -_0806D02E: - adds r6, 0x2 - adds r5, 0x1 - cmp r5, 0x2 - ble _0806CFE6 - ldrb r1, [r7, 0x3] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0806D04E - ldr r1, =0x0202420b - ldr r0, =0x020244b8 - ldrb r0, [r0] - strb r0, [r1] - ldr r0, =gUnknown_085CA424 - bl get_battle_strings_ -_0806D04E: - ldr r0, =0x02022e2c - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806CF78 - - thumb_func_start GetNature -@ u8 GetNature(pokemon *mon) -GetNature: @ 806D070 - push {lr} - movs r1, 0 - movs r2, 0 - bl pokemon_getattr - movs r1, 0x19 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end GetNature - - thumb_func_start GetNatureFromPersonality -@ u8 GetNatureFromPersonality(u32 personality) -GetNatureFromPersonality: @ 806D088 - push {lr} - movs r1, 0x19 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end GetNatureFromPersonality - - thumb_func_start GetEvolutionTargetSpecies -GetEvolutionTargetSpecies: @ 806D098 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - mov r8, r0 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r2, 16 - lsrs r2, 16 - mov r9, r2 - movs r0, 0 - mov r10, r0 - mov r0, r8 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r7, r0, 16 - mov r0, r8 - movs r1, 0xC - movs r2, 0 - bl pokemon_getattr - mov r1, sp - strh r0, [r1] - mov r0, r8 - movs r1, 0 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - mov r0, r8 - movs r1, 0x17 - movs r2, 0 - bl pokemon_getattr - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0xC] - lsrs r4, 16 - str r4, [sp, 0x10] - mov r0, sp - ldrh r0, [r0] - cmp r0, 0xAF - bne _0806D10C - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003226 - adds r0, r1 - ldrb r0, [r0] - b _0806D114 - .pool -_0806D10C: - bl itemid_get_x12 - lsls r0, 24 - lsrs r0, 24 -_0806D114: - cmp r0, 0x26 - bne _0806D120 - cmp r5, 0x3 - beq _0806D120 - movs r0, 0 - b _0806D3B0 -_0806D120: - cmp r5, 0x1 - bne _0806D126 - b _0806D340 -_0806D126: - cmp r5, 0x1 - bgt _0806D130 - cmp r5, 0 - beq _0806D144 - b _0806D3AE -_0806D130: - cmp r5, 0x3 - ble _0806D136 - b _0806D3AE -_0806D136: - movs r2, 0 - str r2, [sp, 0x4] - ldr r3, =gEvolutionTable - lsls r6, r7, 2 - b _0806D38E - .pool -_0806D144: - mov r0, r8 - movs r1, 0x38 - movs r2, 0 - bl pokemon_getattr - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - mov r0, r8 - movs r1, 0x20 - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x8] - movs r0, 0 - str r0, [sp, 0x4] - lsls r6, r7, 2 -_0806D16A: - ldr r1, =gEvolutionTable - ldr r0, [sp, 0x4] - lsls r2, r0, 3 - adds r0, r6, r7 - lsls r0, 3 - adds r0, r2, r0 - adds r0, r1 - ldrh r0, [r0] - subs r0, 0x1 - adds r3, r1, 0 - adds r4, r2, 0 - cmp r0, 0xE - bls _0806D186 - b _0806D332 -_0806D186: - lsls r0, 2 - ldr r1, =_0806D198 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0806D198: - .4byte _0806D1D4 - .4byte _0806D1E6 - .4byte _0806D208 - .4byte _0806D238 - .4byte _0806D332 - .4byte _0806D332 - .4byte _0806D332 - .4byte _0806D248 - .4byte _0806D272 - .4byte _0806D29C - .4byte _0806D2CA - .4byte _0806D2EA - .4byte _0806D30E - .4byte _0806D332 - .4byte _0806D31E -_0806D1D4: - ldr r1, [sp, 0x8] - cmp r1, 0xDB - bhi _0806D1DC - b _0806D332 -_0806D1DC: - adds r0, r6, r7 - lsls r0, 3 - adds r0, r4, r0 - adds r0, r3 - b _0806D228 -_0806D1E6: - bl GameFreakRTC_CalcLocalDateTime - ldr r0, =0x03005cf8 - ldrb r0, [r0, 0x2] - subs r0, 0xC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB - bls _0806D1FA - b _0806D332 -_0806D1FA: - ldr r2, [sp, 0x8] - cmp r2, 0xDB - bhi _0806D202 - b _0806D332 -_0806D202: - b _0806D21E - .pool -_0806D208: - bl GameFreakRTC_CalcLocalDateTime - ldr r0, =0x03005cf8 - ldrb r0, [r0, 0x2] - cmp r0, 0xB - bls _0806D216 - b _0806D332 -_0806D216: - ldr r0, [sp, 0x8] - cmp r0, 0xDB - bhi _0806D21E - b _0806D332 -_0806D21E: - ldr r1, =gEvolutionTable - adds r0, r6, r7 - lsls r0, 3 - adds r0, r4, r0 - adds r0, r1 -_0806D228: - ldrh r0, [r0, 0x4] - mov r10, r0 - b _0806D332 - .pool -_0806D238: - adds r0, r6, r7 - lsls r0, 3 - adds r0, r4, r0 - adds r1, r0, r3 - ldrh r0, [r1, 0x2] - cmp r0, r9 - bhi _0806D332 - b _0806D32E -_0806D248: - adds r0, r6, r7 - lsls r0, 3 - adds r0, r4, r0 - adds r5, r0, r3 - ldrh r0, [r5, 0x2] - cmp r0, r9 - bhi _0806D332 - mov r0, r8 - movs r1, 0x3B - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - mov r0, r8 - movs r1, 0x3C - movs r2, 0 - bl pokemon_getattr - cmp r4, r0 - bls _0806D332 - b _0806D2C4 -_0806D272: - adds r0, r6, r7 - lsls r0, 3 - adds r0, r4, r0 - adds r5, r0, r3 - ldrh r0, [r5, 0x2] - cmp r0, r9 - bhi _0806D332 - mov r0, r8 - movs r1, 0x3B - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - mov r0, r8 - movs r1, 0x3C - movs r2, 0 - bl pokemon_getattr - cmp r4, r0 - bne _0806D332 - b _0806D2C4 -_0806D29C: - adds r0, r6, r7 - lsls r0, 3 - adds r0, r4, r0 - adds r5, r0, r3 - ldrh r0, [r5, 0x2] - cmp r0, r9 - bhi _0806D332 - mov r0, r8 - movs r1, 0x3B - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - mov r0, r8 - movs r1, 0x3C - movs r2, 0 - bl pokemon_getattr - cmp r4, r0 - bcs _0806D332 -_0806D2C4: - ldrh r5, [r5, 0x4] - mov r10, r5 - b _0806D332 -_0806D2CA: - adds r0, r6, r7 - lsls r0, 3 - adds r0, r4, r0 - adds r4, r0, r3 - ldrh r0, [r4, 0x2] - cmp r0, r9 - bhi _0806D332 - ldr r0, [sp, 0x10] - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x4 - bhi _0806D332 - b _0806D308 -_0806D2EA: - adds r0, r6, r7 - lsls r0, 3 - adds r0, r4, r0 - adds r4, r0, r3 - ldrh r0, [r4, 0x2] - cmp r0, r9 - bhi _0806D332 - ldr r0, [sp, 0x10] - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x4 - bls _0806D332 -_0806D308: - ldrh r4, [r4, 0x4] - mov r10, r4 - b _0806D332 -_0806D30E: - adds r0, r6, r7 - lsls r0, 3 - adds r0, r4, r0 - adds r1, r0, r3 - ldrh r0, [r1, 0x2] - cmp r0, r9 - bhi _0806D332 - b _0806D32E -_0806D31E: - adds r0, r6, r7 - lsls r0, 3 - adds r0, r4, r0 - adds r1, r0, r3 - ldrh r0, [r1, 0x2] - ldr r2, [sp, 0xC] - cmp r0, r2 - bhi _0806D332 -_0806D32E: - ldrh r1, [r1, 0x4] - mov r10, r1 -_0806D332: - ldr r0, [sp, 0x4] - adds r0, 0x1 - str r0, [sp, 0x4] - cmp r0, 0x4 - bgt _0806D33E - b _0806D16A -_0806D33E: - b _0806D3AE -_0806D340: - lsls r6, r7, 2 - ldr r1, =gEvolutionTable - adds r0, r6, r7 - lsls r0, 3 - adds r4, r0, r1 - mov r5, sp - movs r1, 0x4 - str r1, [sp, 0x4] -_0806D350: - ldrh r0, [r4] - cmp r0, 0x5 - beq _0806D370 - cmp r0, 0x6 - bne _0806D374 - ldrh r0, [r4, 0x2] - ldrh r1, [r5] - cmp r0, r1 - bne _0806D374 - movs r0, 0 - strh r0, [r5] - mov r0, r8 - movs r1, 0xC - mov r2, sp - bl pokemon_setattr -_0806D370: - ldrh r2, [r4, 0x4] - mov r10, r2 -_0806D374: - adds r4, 0x8 - ldr r0, [sp, 0x4] - subs r0, 0x1 - str r0, [sp, 0x4] - cmp r0, 0 - bge _0806D350 - b _0806D3AE - .pool -_0806D388: - ldrh r1, [r1, 0x4] - mov r10, r1 - b _0806D3AE -_0806D38E: - adds r0, r6, r7 - ldr r1, [sp, 0x4] - adds r0, r1 - lsls r0, 3 - adds r1, r0, r3 - ldrh r0, [r1] - cmp r0, 0x7 - bne _0806D3A4 - ldrh r0, [r1, 0x2] - cmp r0, r9 - beq _0806D388 -_0806D3A4: - ldr r2, [sp, 0x4] - adds r2, 0x1 - str r2, [sp, 0x4] - cmp r2, 0x4 - ble _0806D38E -_0806D3AE: - mov r0, r10 -_0806D3B0: - 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 GetEvolutionTargetSpecies - - thumb_func_start HoennPokedexNumToSpecies -HoennPokedexNumToSpecies: @ 806D3C0 - push {r4,lr} - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0 - beq _0806D404 - movs r1, 0 - ldr r3, =gSpeciesToHoennPokedexNum - ldrh r0, [r3] - cmp r0, r2 - beq _0806D3EC - movs r4, 0xCD - lsls r4, 1 -_0806D3D8: - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r4 - bhi _0806D3EC - lsls r0, r1, 1 - adds r0, r3 - ldrh r0, [r0] - cmp r0, r2 - bne _0806D3D8 -_0806D3EC: - ldr r0, =0x0000019b - cmp r1, r0 - beq _0806D404 - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r0, 16 - b _0806D406 - .pool -_0806D404: - movs r0, 0 -_0806D406: - pop {r4} - pop {r1} - bx r1 - thumb_func_end HoennPokedexNumToSpecies - - thumb_func_start NationalPokedexNumToSpecies -NationalPokedexNumToSpecies: @ 806D40C - push {r4,lr} - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0 - beq _0806D450 - movs r1, 0 - ldr r3, =gSpeciesToNationalPokedexNum - ldrh r0, [r3] - cmp r0, r2 - beq _0806D438 - movs r4, 0xCD - lsls r4, 1 -_0806D424: - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r4 - bhi _0806D438 - lsls r0, r1, 1 - adds r0, r3 - ldrh r0, [r0] - cmp r0, r2 - bne _0806D424 -_0806D438: - ldr r0, =0x0000019b - cmp r1, r0 - beq _0806D450 - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r0, 16 - b _0806D452 - .pool -_0806D450: - movs r0, 0 -_0806D452: - pop {r4} - pop {r1} - bx r1 - thumb_func_end NationalPokedexNumToSpecies - - thumb_func_start NationalToHoennOrder -NationalToHoennOrder: @ 806D458 - push {r4,lr} - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0 - beq _0806D49C - movs r1, 0 - ldr r3, =gHoennToNationalOrder - ldrh r0, [r3] - cmp r0, r2 - beq _0806D484 - movs r4, 0xCD - lsls r4, 1 -_0806D470: - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r4 - bhi _0806D484 - lsls r0, r1, 1 - adds r0, r3 - ldrh r0, [r0] - cmp r0, r2 - bne _0806D470 -_0806D484: - ldr r0, =0x0000019b - cmp r1, r0 - beq _0806D49C - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r0, 16 - b _0806D49E - .pool -_0806D49C: - movs r0, 0 -_0806D49E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end NationalToHoennOrder - - thumb_func_start SpeciesToNationalPokedexNum -SpeciesToNationalPokedexNum: @ 806D4A4 - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _0806D4C0 - ldr r0, =gSpeciesToNationalPokedexNum - subs r1, 0x1 - lsls r1, 1 - adds r1, r0 - ldrh r0, [r1] - b _0806D4C2 - .pool -_0806D4C0: - movs r0, 0 -_0806D4C2: - pop {r1} - bx r1 - thumb_func_end SpeciesToNationalPokedexNum - - thumb_func_start SpeciesToHoennPokedexNum -SpeciesToHoennPokedexNum: @ 806D4C8 - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _0806D4E4 - ldr r0, =gSpeciesToHoennPokedexNum - subs r1, 0x1 - lsls r1, 1 - adds r1, r0 - ldrh r0, [r1] - b _0806D4E6 - .pool -_0806D4E4: - movs r0, 0 -_0806D4E6: - pop {r1} - bx r1 - thumb_func_end SpeciesToHoennPokedexNum - - thumb_func_start HoennToNationalOrder -HoennToNationalOrder: @ 806D4EC - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _0806D508 - ldr r0, =gHoennToNationalOrder - subs r1, 0x1 - lsls r1, 1 - adds r1, r0 - ldrh r0, [r1] - b _0806D50A - .pool -_0806D508: - movs r0, 0 -_0806D50A: - pop {r1} - bx r1 - thumb_func_end HoennToNationalOrder - - thumb_func_start speciesid_conv -speciesid_conv: @ 806D510 - push {lr} - lsls r0, 16 - lsrs r0, 16 - adds r1, r0, 0 - cmp r0, 0xFA - bls _0806D53E - ldr r0, =0x00000113 - cmp r1, r0 - bls _0806D53C - ldr r0, =gUnknown_0831F61C - ldr r2, =0xfffffeec - adds r1, r2 - lsls r1, 1 - adds r1, r0 - ldrh r0, [r1] - b _0806D53E - .pool -_0806D53C: - movs r0, 0xC8 -_0806D53E: - pop {r1} - bx r1 - thumb_func_end speciesid_conv - - thumb_func_start sub_806D544 -sub_806D544: @ 806D544 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - adds r6, r1, 0 - mov r10, r2 - lsls r0, 16 - movs r1, 0x9A - lsls r1, 17 - cmp r0, r1 - bne _0806D652 - ldr r0, =0x020244d4 - ldr r1, [r0] - ldr r0, [r1, 0x4] - cmp r10, r0 - beq _0806D652 - ldr r0, [r1, 0xC] - cmp r10, r0 - beq _0806D652 - movs r5, 0 -_0806D570: - lsls r3, r5, 3 - adds r3, r5 - lsls r3, 2 - ldr r0, =gSpindaSpotGraphics - adds r4, r3, r0 - ldrb r1, [r4] - adds r1, 0xF8 - movs r2, 0xF - adds r0, r6, 0 - ands r0, r2 - adds r1, r0 - lsls r1, 24 - lsrs r1, 24 - mov r12, r1 - ldrb r1, [r4, 0x1] - adds r1, 0xF8 - movs r0, 0xF0 - ands r0, r6 - lsrs r0, 4 - adds r1, r0 - lsls r1, 24 - lsrs r1, 24 - movs r2, 0 - lsrs r6, 8 - str r6, [sp, 0x4] - adds r5, 0x1 - str r5, [sp] - mov r9, r3 -_0806D5A8: - lsls r0, r2, 1 - add r0, r9 - ldr r3, =gSpindaSpotGraphics + 0x2 - adds r0, r3 - ldrh r3, [r0] - mov r4, r12 - adds r0, r4, 0 - adds r0, 0x10 - adds r7, r1, 0x1 - adds r2, 0x1 - mov r8, r2 - cmp r4, r0 - bge _0806D640 - lsrs r0, r1, 3 - lsls r6, r0, 8 - movs r0, 0x7 - ands r1, r0 - lsls r5, r1, 2 -_0806D5CC: - adds r0, r4, 0 - cmp r4, 0 - bge _0806D5D4 - adds r0, r4, 0x7 -_0806D5D4: - asrs r0, 3 - lsls r2, r0, 5 - add r2, r10 - lsls r0, 3 - subs r0, r4, r0 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - adds r2, r0 - adds r2, r6 - adds r2, r5 - movs r1, 0x1 - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _0806D634 - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _0806D620 - ldrb r1, [r2] - movs r0, 0xF0 - ands r0, r1 - subs r0, 0x10 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x20 - bhi _0806D634 - adds r0, r1, 0 - adds r0, 0x40 - b _0806D632 - .pool -_0806D620: - ldrb r1, [r2] - movs r0, 0xF - ands r0, r1 - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bhi _0806D634 - adds r0, r1, 0x4 -_0806D632: - strb r0, [r2] -_0806D634: - asrs r3, 1 - adds r4, 0x1 - mov r0, r12 - adds r0, 0x10 - cmp r4, r0 - blt _0806D5CC -_0806D640: - lsls r0, r7, 24 - lsrs r1, r0, 24 - mov r2, r8 - cmp r2, 0xF - ble _0806D5A8 - ldr r6, [sp, 0x4] - ldr r5, [sp] - cmp r5, 0x3 - ble _0806D570 -_0806D652: - 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_806D544 - - thumb_func_start DrawSpindaSpots -@ void DrawSpindaSpots(u16 species, u32 personality, u8 *pixels, u8 isFrontPic) -DrawSpindaSpots: @ 806D664 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - adds r5, r1, 0 - str r2, [sp] - lsls r0, 16 - lsls r3, 24 - lsrs r3, 24 - movs r1, 0x9A - lsls r1, 17 - cmp r0, r1 - bne _0806D766 - cmp r3, 0 - beq _0806D766 - movs r6, 0 -_0806D688: - lsls r3, r6, 3 - adds r3, r6 - lsls r3, 2 - ldr r0, =gSpindaSpotGraphics - adds r4, r3, r0 - ldrb r1, [r4] - adds r1, 0xF8 - movs r2, 0xF - adds r0, r5, 0 - ands r0, r2 - adds r1, r0 - lsls r1, 24 - lsrs r1, 24 - mov r12, r1 - ldrb r1, [r4, 0x1] - adds r1, 0xF8 - movs r0, 0xF0 - ands r0, r5 - lsrs r0, 4 - adds r1, r0 - lsls r1, 24 - lsrs r1, 24 - movs r2, 0 - lsrs r5, 8 - str r5, [sp, 0x4] - adds r6, 0x1 - mov r10, r6 - mov r9, r3 -_0806D6C0: - lsls r0, r2, 1 - add r0, r9 - ldr r3, =gSpindaSpotGraphics + 0x2 - adds r0, r3 - ldrh r3, [r0] - mov r4, r12 - adds r0, r4, 0 - adds r0, 0x10 - adds r7, r1, 0x1 - adds r2, 0x1 - mov r8, r2 - cmp r4, r0 - bge _0806D754 - lsrs r0, r1, 3 - lsls r6, r0, 8 - movs r0, 0x7 - ands r1, r0 - lsls r5, r1, 2 -_0806D6E4: - adds r0, r4, 0 - cmp r4, 0 - bge _0806D6EC - adds r0, r4, 0x7 -_0806D6EC: - asrs r0, 3 - lsls r2, r0, 5 - ldr r1, [sp] - adds r2, r1, r2 - lsls r0, 3 - subs r0, r4, r0 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - adds r2, r0 - adds r2, r6 - adds r2, r5 - movs r1, 0x1 - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _0806D748 - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _0806D734 - ldrb r1, [r2] - movs r0, 0xF0 - ands r0, r1 - subs r0, 0x10 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x20 - bhi _0806D748 - adds r0, r1, 0 - adds r0, 0x40 - b _0806D746 - .pool -_0806D734: - ldrb r1, [r2] - movs r0, 0xF - ands r0, r1 - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bhi _0806D748 - adds r0, r1, 0x4 -_0806D746: - strb r0, [r2] -_0806D748: - asrs r3, 1 - adds r4, 0x1 - mov r0, r12 - adds r0, 0x10 - cmp r4, r0 - blt _0806D6E4 -_0806D754: - lsls r0, r7, 24 - lsrs r1, r0, 24 - mov r2, r8 - cmp r2, 0xF - ble _0806D6C0 - ldr r5, [sp, 0x4] - mov r6, r10 - cmp r6, 0x3 - ble _0806D688 -_0806D766: - 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 DrawSpindaSpots - - thumb_func_start sub_806D778 -sub_806D778: @ 806D778 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - adds r5, r0, 0 - lsls r1, 16 - lsrs r7, r1, 16 - lsls r2, 16 - lsrs r2, 16 - mov r8, r2 - ldr r0, =0x02021cc4 - mov r9, r0 - adds r0, r5, 0 - movs r1, 0x2 - mov r2, r9 - bl pokemon_getattr - mov r4, sp - adds r0, r5, 0 - movs r1, 0x3 - mov r2, sp - bl pokemon_getattr - strb r0, [r4] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _0806D7D4 - movs r6, 0xB - adds r0, r7, 0 - muls r0, r6 - ldr r4, =gSpeciesNames - adds r0, r4 - mov r1, r9 - bl CompareString - cmp r0, 0 - bne _0806D7D4 - mov r2, r8 - muls r2, r6 - adds r2, r4 - adds r0, r5, 0 - movs r1, 0x2 - bl pokemon_setattr -_0806D7D4: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806D778 - - thumb_func_start sub_806D7EC -sub_806D7EC: @ 806D7EC - push {r4,r5,lr} - movs r5, 0 - ldr r4, =0x020229e8 - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r4 - ldrh r0, [r1, 0x18] - cmp r0, 0x2 - bgt _0806D818 - cmp r0, 0x1 - bge _0806D820 - cmp r0, 0 - beq _0806D81C - b _0806D822 - .pool -_0806D818: - cmp r0, 0x3 - bne _0806D822 -_0806D81C: - movs r5, 0 - b _0806D822 -_0806D820: - movs r5, 0x1 -_0806D822: - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_806D7EC - - thumb_func_start sub_806D82C -sub_806D82C: @ 806D82C - push {lr} - lsls r0, 24 - lsrs r0, 24 - movs r3, 0 - ldr r2, =0x020229e8 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r1, 0x18] - cmp r0, 0x2 - bgt _0806D854 - cmp r0, 0x1 - bge _0806D85C - cmp r0, 0 - beq _0806D858 - b _0806D85E - .pool -_0806D854: - cmp r0, 0x3 - bne _0806D85E -_0806D858: - movs r3, 0 - b _0806D85E -_0806D85C: - movs r3, 0x1 -_0806D85E: - adds r0, r3, 0 - pop {r1} - bx r1 - thumb_func_end sub_806D82C - - thumb_func_start sub_806D864 -sub_806D864: @ 806D864 - push {lr} - lsls r0, 16 - lsrs r3, r0, 16 - movs r2, 0 - ldr r1, =0x020229e8 - b _0806D87C - .pool -_0806D874: - adds r1, 0x1C - adds r2, 0x1 - cmp r2, 0x3 - bgt _0806D882 -_0806D87C: - ldrh r0, [r1, 0x18] - cmp r0, r3 - bne _0806D874 -_0806D882: - adds r0, r2, 0 - pop {r1} - bx r1 - thumb_func_end sub_806D864 - - thumb_func_start GetTrainerEncounterMusicId -@ u8 GetTrainerEncounterMusicId(u16 trainerOpponentId) -GetTrainerEncounterMusicId: @ 806D888 - push {r4,r5,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r5, r4, 0 - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _0806D8A2 - adds r0, r4, 0 - bl sub_81A9F3C - b _0806D8CA -_0806D8A2: - bl sub_81D5C18 - lsls r0, 24 - cmp r0, 0 - bne _0806D8C4 - ldr r1, =gTrainers - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0x2] - movs r0, 0x7F - ands r0, r1 - b _0806D8CE - .pool -_0806D8C4: - adds r0, r5, 0 - bl sub_81D63C8 -_0806D8CA: - lsls r0, 24 - lsrs r0, 24 -_0806D8CE: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end GetTrainerEncounterMusicId - - thumb_func_start nature_stat_mod -nature_stat_mod: @ 806D8D4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 16 - lsrs r3, r1, 16 - lsls r2, 24 - lsrs r5, r2, 24 - movs r0, 0xFF - lsls r0, 24 - adds r2, r0 - lsrs r2, 24 - cmp r2, 0x4 - bls _0806D8F2 - adds r0, r3, 0 - b _0806D92E -_0806D8F2: - ldr r0, =gNatureStatTable - lsls r1, r4, 2 - adds r1, r4 - subs r1, 0x1 - adds r1, r5, r1 - adds r1, r0 - ldrb r1, [r1] - lsls r1, 24 - asrs r1, 24 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _0806D918 - cmp r1, 0x1 - bne _0806D92C - movs r0, 0x6E - b _0806D91A - .pool -_0806D918: - movs r0, 0x5A -_0806D91A: - muls r0, r3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __udivsi3 - lsls r0, 16 - lsrs r0, 16 - b _0806D92E -_0806D92C: - adds r0, r3, 0 -_0806D92E: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end nature_stat_mod - - thumb_func_start happiness_algorithm -happiness_algorithm: @ 806D934 - push {r4-r7,lr} - sub sp, 0x4 - adds r7, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - bl sub_806F104 - lsls r0, 24 - cmp r0, 0 - beq _0806D94A - b _0806DAC2 -_0806D94A: - adds r0, r7, 0 - movs r1, 0x41 - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r6, r0, 16 - adds r0, r7, 0 - movs r1, 0xC - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xAF - bne _0806D9A0 - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0806D98C - ldr r0, =0x02024404 - ldrb r4, [r0, 0x7] - b _0806D9A8 - .pool -_0806D98C: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003226 - adds r0, r1 - ldrb r4, [r0] - b _0806D9A8 - .pool -_0806D9A0: - bl itemid_get_x12 - lsls r0, 24 - lsrs r4, r0, 24 -_0806D9A8: - cmp r6, 0 - bne _0806D9AE - b _0806DAC2 -_0806D9AE: - movs r0, 0xCE - lsls r0, 1 - cmp r6, r0 - bne _0806D9B8 - b _0806DAC2 -_0806D9B8: - movs r6, 0 - adds r0, r7, 0 - movs r1, 0x20 - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - mov r1, sp - strh r0, [r1] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x63 - ble _0806D9D6 - movs r6, 0x1 -_0806D9D6: - cmp r0, 0xC7 - ble _0806D9E0 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_0806D9E0: - cmp r5, 0x5 - bne _0806D9F0 - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - bne _0806DAC2 -_0806D9F0: - cmp r5, 0x3 - bne _0806DA20 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0806DAC2 - ldr r2, =gTrainers - ldr r0, =0x02038bca - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r1, [r0, 0x1] - adds r0, r1, 0 - subs r0, 0x1F - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _0806DA20 - cmp r1, 0x26 - bne _0806DAC2 -_0806DA20: - ldr r1, =gUnknown_08329ECE - lsls r0, r5, 1 - adds r0, r5 - adds r0, r6, r0 - adds r0, r1 - ldrb r2, [r0] - movs r1, 0 - ldrsb r1, [r0, r1] - cmp r1, 0 - ble _0806DA46 - cmp r4, 0x1B - bne _0806DA46 - movs r0, 0x96 - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - lsls r0, 24 - lsrs r2, r0, 24 -_0806DA46: - lsls r2, 24 - asrs r2, 24 - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - adds r0, r2 - mov r1, sp - strh r0, [r1] - cmp r2, 0 - ble _0806DA98 - adds r0, r7, 0 - movs r1, 0x26 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0xB - bne _0806DA74 - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - adds r0, 0x1 - mov r1, sp - strh r0, [r1] -_0806DA74: - adds r0, r7, 0 - movs r1, 0x23 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - bl sav1_map_get_name - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bne _0806DA98 - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - adds r0, 0x1 - mov r1, sp - strh r0, [r1] -_0806DA98: - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bge _0806DAA8 - movs r1, 0 - mov r0, sp - strh r1, [r0] -_0806DAA8: - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0xFF - ble _0806DAB8 - movs r1, 0xFF - mov r0, sp - strh r1, [r0] -_0806DAB8: - adds r0, r7, 0 - movs r1, 0x20 - mov r2, sp - bl pokemon_setattr -_0806DAC2: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end happiness_algorithm - - thumb_func_start sub_806DADC -sub_806DADC: @ 806DADC - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - mov r8, r0 - lsls r1, 16 - lsrs r5, r1, 16 - movs r4, 0 - movs r7, 0 - movs r6, 0 -_0806DAF0: - adds r1, r6, 0 - adds r1, 0x1A - mov r0, r8 - movs r2, 0 - bl pokemon_getattr - mov r2, sp - adds r1, r2, r6 - strb r0, [r1] - ldrb r0, [r1] - adds r0, r7, r0 - lsls r0, 16 - lsrs r7, r0, 16 - adds r6, 0x1 - cmp r6, 0x5 - ble _0806DAF0 - movs r6, 0 - b _0806DC72 -_0806DB14: - mov r0, r8 - movs r1, 0 - bl sub_806DDE4 - lsls r0, 24 - movs r2, 0x1 - cmp r0, 0 - beq _0806DB26 - movs r2, 0x2 -_0806DB26: - cmp r6, 0x5 - bhi _0806DBC8 - lsls r0, r6, 2 - ldr r1, =_0806DB38 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0806DB38: - .4byte _0806DB50 - .4byte _0806DB64 - .4byte _0806DB78 - .4byte _0806DB8C - .4byte _0806DBA0 - .4byte _0806DBB4 -_0806DB50: - ldr r0, =gBaseStats - lsls r1, r5, 3 - subs r1, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0xA] - lsls r0, 30 - b _0806DBC2 - .pool -_0806DB64: - ldr r0, =gBaseStats - lsls r1, r5, 3 - subs r1, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0xA] - b _0806DBC0 - .pool -_0806DB78: - ldr r0, =gBaseStats - lsls r1, r5, 3 - subs r1, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0xA] - lsls r0, 26 - b _0806DBC2 - .pool -_0806DB8C: - ldr r0, =gBaseStats - lsls r1, r5, 3 - subs r1, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0xA] - lsrs r0, 6 - b _0806DBC4 - .pool -_0806DBA0: - ldr r0, =gBaseStats - lsls r1, r5, 3 - subs r1, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0xB] - lsls r0, 30 - b _0806DBC2 - .pool -_0806DBB4: - ldr r0, =gBaseStats - lsls r1, r5, 3 - subs r1, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0xB] -_0806DBC0: - lsls r0, 28 -_0806DBC2: - lsrs r0, 30 -_0806DBC4: - adds r4, r0, 0 - muls r4, r2 -_0806DBC8: - mov r0, r8 - movs r1, 0xC - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xAF - bne _0806DC14 - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0806DC00 - ldr r0, =0x02024404 - ldrb r0, [r0, 0x7] - b _0806DC1C - .pool -_0806DC00: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x00003226 - adds r0, r2 - ldrb r0, [r0] - b _0806DC1C - .pool -_0806DC14: - bl itemid_get_x12 - lsls r0, 24 - lsrs r0, 24 -_0806DC1C: - cmp r0, 0x18 - bne _0806DC24 - lsls r0, r4, 17 - lsrs r4, r0, 16 -_0806DC24: - lsls r0, r4, 16 - asrs r2, r0, 16 - adds r1, r7, r2 - movs r0, 0xFF - lsls r0, 1 - cmp r1, r0 - ble _0806DC3C - adds r0, r2, r0 - adds r1, r7, r4 - subs r0, r1 - lsls r0, 16 - lsrs r4, r0, 16 -_0806DC3C: - mov r0, sp - adds r2, r0, r6 - ldrb r3, [r2] - lsls r0, r4, 16 - asrs r1, r0, 16 - adds r0, r3, r1 - cmp r0, 0xFF - ble _0806DC58 - adds r0, r1, 0 - adds r0, 0xFF - adds r1, r3, r4 - subs r0, r1 - lsls r0, 16 - lsrs r4, r0, 16 -_0806DC58: - adds r0, r3, r4 - strb r0, [r2] - adds r0, r7, r4 - lsls r0, 16 - lsrs r7, r0, 16 - adds r1, r6, 0 - adds r1, 0x1A - mov r0, r8 - bl pokemon_setattr - adds r6, 0x1 - cmp r6, 0x5 - bgt _0806DC7A -_0806DC72: - ldr r0, =0x000001fd - cmp r7, r0 - bhi _0806DC7A - b _0806DB14 -_0806DC7A: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806DADC - - thumb_func_start sub_806DC8C -sub_806DC8C: @ 806DC8C - push {r4-r6,lr} - adds r6, r0, 0 - movs r5, 0 - movs r4, 0 -_0806DC94: - adds r1, r4, 0 - adds r1, 0x1A - adds r0, r6, 0 - movs r2, 0 - bl pokemon_getattr - adds r0, r5, r0 - lsls r0, 16 - lsrs r5, r0, 16 - adds r4, 0x1 - cmp r4, 0x5 - ble _0806DC94 - adds r0, r5, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_806DC8C - - thumb_func_start sub_806DCB4 -sub_806DCB4: @ 806DCB4 - push {r4-r6,lr} - sub sp, 0x4 - adds r6, r0, 0 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r5, r0, 16 - movs r0, 0x80 - lsls r0, 7 - cmp r5, r0 - beq _0806DCDA - movs r0, 0x80 - lsls r0, 8 - cmp r5, r0 - beq _0806DCDA - movs r0, 0xC0 - lsls r0, 8 - cmp r5, r0 - bne _0806DD70 -_0806DCDA: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x6 - bl __umodsi3 - lsls r0, 16 - lsrs r5, r0, 16 - movs r0, 0x64 - muls r0, r5 - adds r4, r6, r0 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - beq _0806DCDA - adds r0, r4, 0 - movs r1, 0x2D - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - bne _0806DCDA - ldr r1, =gUnknown_0832A328 - lsls r0, r5, 2 - adds r0, r1 - ldrb r1, [r0] - adds r0, r6, 0 - bl sub_806DDE4 - lsls r0, 24 - cmp r0, 0 - bne _0806DD70 - movs r4, 0x7 -_0806DD24: - bl GenerateRandomNumber - lsls r0, 24 - lsrs r0, 24 - mov r1, sp - strb r0, [r1] - adds r2, r0, 0 - adds r1, r2, 0 - ands r1, r4 - cmp r1, 0 - beq _0806DD24 - movs r0, 0xF0 - ands r0, r2 - cmp r0, 0 - beq _0806DD46 - mov r0, sp - strb r1, [r0] -_0806DD46: - mov r0, sp - ldrb r0, [r0] - lsls r1, r0, 4 - orrs r0, r1 - lsls r0, 24 - lsrs r0, 24 - mov r1, sp - strb r0, [r1] - movs r1, 0xF3 - ands r1, r0 - mov r0, sp - strb r1, [r0] - adds r1, 0x1 - strb r1, [r0] - movs r0, 0x64 - muls r0, r5 - adds r0, r6, r0 - movs r1, 0x22 - mov r2, sp - bl pokemon_setattr -_0806DD70: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806DCB4 - - thumb_func_start sub_806DD7C -sub_806DD7C: @ 806DD7C - push {r4-r7,lr} - sub sp, 0x4 - adds r7, r0, 0 - lsls r1, 24 - lsrs r4, r1, 24 - movs r3, 0 - movs r6, 0x1 - movs r5, 0 - cmp r4, 0 - beq _0806DDC4 -_0806DD90: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _0806DDB8 - movs r0, 0x64 - muls r0, r3 - adds r0, r7, r0 - movs r1, 0x22 - movs r2, 0 - str r3, [sp] - bl pokemon_getattr - movs r1, 0xF - ands r1, r0 - ldr r3, [sp] - cmp r1, 0 - beq _0806DDB8 - orrs r5, r6 - lsls r0, r5, 24 - lsrs r5, r0, 24 -_0806DDB8: - adds r3, 0x1 - lsls r6, 1 - lsrs r4, 1 - cmp r4, 0 - bne _0806DD90 - b _0806DDD8 -_0806DDC4: - adds r0, r7, 0 - movs r1, 0x22 - movs r2, 0 - bl pokemon_getattr - movs r1, 0xF - ands r1, r0 - cmp r1, 0 - beq _0806DDD8 - movs r5, 0x1 -_0806DDD8: - adds r0, r5, 0 - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_806DD7C - - thumb_func_start sub_806DDE4 -sub_806DDE4: @ 806DDE4 - push {r4-r7,lr} - sub sp, 0x4 - adds r7, r0, 0 - lsls r1, 24 - lsrs r4, r1, 24 - movs r3, 0 - movs r6, 0x1 - movs r5, 0 - cmp r4, 0 - beq _0806DE28 -_0806DDF8: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _0806DE1C - movs r0, 0x64 - muls r0, r3 - adds r0, r7, r0 - movs r1, 0x22 - movs r2, 0 - str r3, [sp] - bl pokemon_getattr - ldr r3, [sp] - cmp r0, 0 - beq _0806DE1C - orrs r5, r6 - lsls r0, r5, 24 - lsrs r5, r0, 24 -_0806DE1C: - adds r3, 0x1 - lsls r6, 1 - lsrs r4, 1 - cmp r4, 0 - bne _0806DDF8 - b _0806DE38 -_0806DE28: - adds r0, r7, 0 - movs r1, 0x22 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - beq _0806DE38 - movs r5, 0x1 -_0806DE38: - adds r0, r5, 0 - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_806DDE4 - - thumb_func_start sub_806DE44 -sub_806DE44: @ 806DE44 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 16 - lsrs r7, r0, 16 - movs r6, 0 - mov r5, sp -_0806DE50: - movs r0, 0x64 - adds r1, r6, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - beq _0806DEB2 - adds r0, r4, 0 - movs r1, 0x22 - movs r2, 0 - bl pokemon_getattr - lsls r0, 24 - lsrs r0, 24 - strb r0, [r5] - movs r1, 0xF - adds r2, r0, 0 - ands r1, r2 - cmp r1, 0 - beq _0806DEB2 - cmp r1, r7 - bcc _0806DE8A - cmp r7, 0x4 - bls _0806DE94 -_0806DE8A: - movs r0, 0xF0 - ands r0, r2 - b _0806DE96 - .pool -_0806DE94: - subs r0, r2, r7 -_0806DE96: - strb r0, [r5] - ldrb r0, [r5] - cmp r0, 0 - bne _0806DEA2 - movs r0, 0x10 - strb r0, [r5] -_0806DEA2: - movs r0, 0x64 - muls r0, r6 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x22 - mov r2, sp - bl pokemon_setattr -_0806DEB2: - adds r6, 0x1 - cmp r6, 0x5 - ble _0806DE50 - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806DE44 - - thumb_func_start sub_806DEC4 -sub_806DEC4: @ 806DEC4 - push {r4-r7,lr} - sub sp, 0x4 - adds r7, r0, 0 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - bne _0806DF6A - movs r5, 0 -_0806DEE0: - movs r0, 0x64 - adds r6, r5, 0 - muls r6, r0 - adds r4, r7, r6 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - beq _0806DF64 - adds r0, r4, 0 - movs r1, 0x22 - movs r2, 0 - bl pokemon_getattr - lsls r0, 24 - lsrs r1, r0, 24 - mov r0, sp - strb r1, [r0] - cmp r1, 0 - beq _0806DF64 - movs r0, 0xF - ands r0, r1 - cmp r0, 0 - beq _0806DF64 - cmp r5, 0 - beq _0806DF3A - adds r0, r6, 0 - subs r0, 0x64 - adds r4, r7, r0 - adds r0, r4, 0 - movs r1, 0x22 - movs r2, 0 - bl pokemon_getattr - movs r1, 0xF0 - ands r1, r0 - cmp r1, 0 - bne _0806DF3A - adds r0, r4, 0 - movs r1, 0x22 - mov r2, sp - bl pokemon_setattr -_0806DF3A: - cmp r5, 0x5 - beq _0806DF64 - movs r0, 0x64 - muls r0, r5 - adds r0, 0x64 - adds r4, r7, r0 - adds r0, r4, 0 - movs r1, 0x22 - movs r2, 0 - bl pokemon_getattr - movs r1, 0xF0 - ands r1, r0 - cmp r1, 0 - bne _0806DF64 - adds r0, r4, 0 - movs r1, 0x22 - mov r2, sp - bl pokemon_setattr - adds r5, 0x1 -_0806DF64: - adds r5, 0x1 - cmp r5, 0x5 - ble _0806DEE0 -_0806DF6A: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_806DEC4 - - thumb_func_start sub_806DF74 -sub_806DF74: @ 806DF74 - push {r4-r6,lr} - sub sp, 0x8 - adds r5, r0, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x38 - movs r2, 0 - bl pokemon_getattr - adds r0, 0x1 - mov r1, sp - strb r0, [r1] - adds r0, r5, 0 - movs r1, 0x19 - movs r2, 0 - bl pokemon_getattr - str r0, [sp, 0x4] - ldr r6, =gExperienceTables - ldr r2, =gBaseStats - lsls r1, r4, 3 - subs r1, r4 - lsls r1, 2 - adds r1, r2 - ldrb r2, [r1, 0x13] - movs r1, 0xCA - lsls r1, 1 - adds r4, r2, 0 - muls r4, r1 - movs r2, 0xC8 - lsls r2, 1 - adds r1, r6, r2 - adds r1, r4, r1 - ldr r1, [r1] - cmp r0, r1 - bls _0806DFD4 - str r1, [sp, 0x4] - add r2, sp, 0x4 - adds r0, r5, 0 - movs r1, 0x19 - bl pokemon_setattr -_0806DFD4: - mov r0, sp - ldrb r0, [r0] - cmp r0, 0x64 - bhi _0806DFEA - lsls r0, 2 - adds r0, r4 - adds r0, r6 - ldr r1, [sp, 0x4] - ldr r0, [r0] - cmp r1, r0 - bcs _0806DFF8 -_0806DFEA: - movs r0, 0 - b _0806E004 - .pool -_0806DFF8: - adds r0, r5, 0 - movs r1, 0x38 - mov r2, sp - bl pokemon_setattr - movs r0, 0x1 -_0806E004: - add sp, 0x8 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_806DF74 - - thumb_func_start sub_806E00C -sub_806E00C: @ 806E00C - push {r4,r5,lr} - lsls r1, 24 - lsrs r4, r1, 24 - adds r5, r4, 0 - movs r1, 0x41 - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r1, r0, 16 - adds r3, r1, 0 - movs r0, 0xCE - lsls r0, 1 - cmp r1, r0 - bne _0806E02E - movs r0, 0 - b _0806E05A -_0806E02E: - cmp r4, 0x1F - bls _0806E04C - adds r0, r4, 0 - subs r0, 0x20 - movs r2, 0x1 - lsls r2, r0 - ldr r0, =gTMHMLearnsets - lsls r1, 3 - adds r0, 0x4 - adds r1, r0 - ldr r0, [r1] - ands r0, r2 - b _0806E05A - .pool -_0806E04C: - movs r1, 0x1 - lsls r1, r5 - ldr r2, =gTMHMLearnsets - lsls r0, r3, 3 - adds r0, r2 - ldr r0, [r0] - ands r0, r1 -_0806E05A: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806E00C - - thumb_func_start sub_806E064 -sub_806E064: @ 806E064 - push {r4,lr} - lsls r0, 16 - lsrs r3, r0, 16 - adds r4, r3, 0 - lsls r1, 24 - lsrs r1, 24 - adds r2, r1, 0 - movs r0, 0xCE - lsls r0, 1 - cmp r3, r0 - bne _0806E07E - movs r0, 0 - b _0806E0AA -_0806E07E: - cmp r1, 0x1F - bls _0806E09C - adds r0, r1, 0 - subs r0, 0x20 - movs r2, 0x1 - lsls r2, r0 - ldr r0, =gTMHMLearnsets - lsls r1, r3, 3 - adds r0, 0x4 - adds r1, r0 - ldr r0, [r1] - ands r0, r2 - b _0806E0AA - .pool -_0806E09C: - movs r1, 0x1 - lsls r1, r2 - ldr r2, =gTMHMLearnsets - lsls r0, r4, 3 - adds r0, r2 - ldr r0, [r0] - ands r0, r1 -_0806E0AA: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806E064 - - thumb_func_start sub_806E0B4 -sub_806E0B4: @ 806E0B4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - adds r6, r0, 0 - str r1, [sp, 0x8] - movs r0, 0 - mov r10, r0 - adds r0, r6, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r7, r0, 16 - adds r0, r6, 0 - movs r1, 0x38 - movs r2, 0 - bl pokemon_getattr - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0xC] - movs r5, 0 - mov r4, sp -_0806E0EA: - adds r1, r5, 0 - adds r1, 0xD - adds r0, r6, 0 - movs r2, 0 - bl pokemon_getattr - strh r0, [r4] - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _0806E0EA - movs r5, 0 - ldr r6, =gLevelUpLearnsetPointers - lsls r1, r7, 2 - adds r2, r1, r6 - ldr r3, [r2] - ldrh r0, [r3] - ldr r4, =0x0000ffff - str r1, [sp, 0x14] - cmp r0, r4 - beq _0806E1E4 - mov r9, r2 - str r3, [sp, 0x10] -_0806E118: - lsls r2, r5, 1 - ldr r1, [sp, 0x10] - adds r0, r2, r1 - ldrh r3, [r0] - movs r0, 0xFE - lsls r0, 8 - ands r0, r3 - ldr r4, [sp, 0xC] - lsls r1, r4, 9 - adds r7, r2, 0 - adds r5, 0x1 - mov r12, r5 - cmp r0, r1 - bgt _0806E1CE - movs r4, 0 - mov r0, sp - ldrh r1, [r0] - ldr r0, =0x000001ff - ands r0, r3 - cmp r1, r0 - beq _0806E168 - ldr r0, [sp, 0x14] - ldr r1, =gLevelUpLearnsetPointers - adds r6, r0, r1 - ldr r2, =0x000001ff - mov r8, r2 - mov r3, sp - adds r5, r7, 0 -_0806E150: - adds r3, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - bgt _0806E168 - ldr r0, [r6] - adds r0, r5, r0 - ldrh r1, [r0] - ldrh r2, [r3] - mov r0, r8 - ands r0, r1 - cmp r2, r0 - bne _0806E150 -_0806E168: - cmp r4, 0x4 - bne _0806E1CE - movs r4, 0 - cmp r4, r10 - bge _0806E1AC - mov r1, r9 - ldr r0, [r1] - adds r0, r7, r0 - ldrh r1, [r0] - ldr r0, [sp, 0x8] - ldrh r2, [r0] - ldr r0, =0x000001ff - ands r0, r1 - cmp r2, r0 - beq _0806E1AC - ldr r1, [sp, 0x14] - ldr r2, =gLevelUpLearnsetPointers - adds r6, r1, r2 - ldr r0, =0x000001ff - mov r8, r0 - ldr r3, [sp, 0x8] - adds r5, r7, 0 -_0806E194: - adds r3, 0x2 - adds r4, 0x1 - cmp r4, r10 - bge _0806E1AC - ldr r0, [r6] - adds r0, r5, r0 - ldrh r1, [r0] - ldrh r2, [r3] - mov r0, r8 - ands r0, r1 - cmp r2, r0 - bne _0806E194 -_0806E1AC: - cmp r4, r10 - bne _0806E1CE - mov r0, r10 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - lsls r2, r4, 1 - ldr r1, [sp, 0x8] - adds r2, r1 - mov r4, r9 - ldr r0, [r4] - adds r0, r7, r0 - ldrh r1, [r0] - ldr r0, =0x000001ff - ands r0, r1 - strh r0, [r2] -_0806E1CE: - mov r5, r12 - cmp r5, 0x13 - bgt _0806E1E4 - mov r1, r9 - ldr r0, [r1] - lsls r1, r5, 1 - adds r1, r0 - ldrh r0, [r1] - ldr r2, =0x0000ffff - cmp r0, r2 - bne _0806E118 -_0806E1E4: - mov r0, r10 - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806E0B4 - - thumb_func_start sub_806E204 -sub_806E204: @ 806E204 - push {r4-r7,lr} - adds r6, r1, 0 - lsls r0, 16 - movs r5, 0 - movs r4, 0 - ldr r1, =gLevelUpLearnsetPointers - lsrs r0, 14 - adds r0, r1 - ldr r2, [r0] - ldrh r0, [r2] - ldr r1, =0x0000ffff - cmp r0, r1 - beq _0806E248 - ldr r0, =0x000001ff - mov r12, r0 - adds r7, r1, 0 - adds r3, r2, 0 -_0806E226: - adds r1, r5, 0 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 1 - adds r1, r6 - ldrh r2, [r3] - mov r0, r12 - ands r0, r2 - strh r0, [r1] - adds r3, 0x2 - adds r4, 0x1 - cmp r4, 0x13 - bgt _0806E248 - ldrh r0, [r3] - cmp r0, r7 - bne _0806E226 -_0806E248: - adds r0, r5, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806E204 - - thumb_func_start sub_806E25C -sub_806E25C: @ 806E25C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x3C - adds r6, r0, 0 - movs r0, 0 - mov r10, r0 - adds r0, r6, 0 - movs r1, 0x41 - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r6, 0 - movs r1, 0x38 - movs r2, 0 - bl pokemon_getattr - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x30] - movs r0, 0xCE - lsls r0, 1 - cmp r4, r0 - bne _0806E298 - movs r0, 0 - b _0806E3A2 -_0806E298: - movs r5, 0 - lsls r4, 2 - str r4, [sp, 0x38] - mov r4, sp -_0806E2A0: - adds r1, r5, 0 - adds r1, 0xD - adds r0, r6, 0 - movs r2, 0 - bl pokemon_getattr - strh r0, [r4] - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _0806E2A0 - movs r5, 0 - ldr r3, =gLevelUpLearnsetPointers - ldr r2, [sp, 0x38] - adds r1, r2, r3 - ldr r0, [r1] - ldrh r0, [r0] - ldr r2, =0x0000ffff - cmp r0, r2 - beq _0806E3A0 - mov r9, r1 - mov r4, sp - adds r4, 0x8 - str r4, [sp, 0x34] -_0806E2D0: - mov r1, r9 - ldr r0, [r1] - lsls r2, r5, 1 - adds r0, r2, r0 - ldrh r3, [r0] - movs r0, 0xFE - lsls r0, 8 - ands r0, r3 - ldr r4, [sp, 0x30] - lsls r1, r4, 9 - adds r7, r2, 0 - adds r5, 0x1 - mov r12, r5 - cmp r0, r1 - bgt _0806E38A - movs r4, 0 - mov r0, sp - ldrh r1, [r0] - ldr r0, =0x000001ff - ands r0, r3 - cmp r1, r0 - beq _0806E322 - ldr r0, [sp, 0x38] - ldr r1, =gLevelUpLearnsetPointers - adds r6, r0, r1 - ldr r2, =0x000001ff - mov r8, r2 - mov r3, sp - adds r5, r7, 0 -_0806E30A: - adds r3, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - bgt _0806E322 - ldr r0, [r6] - adds r0, r5, r0 - ldrh r1, [r0] - ldrh r2, [r3] - mov r0, r8 - ands r0, r1 - cmp r2, r0 - bne _0806E30A -_0806E322: - cmp r4, 0x4 - bne _0806E38A - movs r4, 0 - cmp r4, r10 - bge _0806E368 - mov r1, r9 - ldr r0, [r1] - adds r0, r7, r0 - ldrh r1, [r0] - ldr r0, [sp, 0x34] - ldrh r2, [r0] - ldr r0, =0x000001ff - ands r0, r1 - add r1, sp, 0x8 - cmp r2, r0 - beq _0806E368 - ldr r2, [sp, 0x38] - ldr r0, =gLevelUpLearnsetPointers - adds r6, r2, r0 - ldr r2, =0x000001ff - mov r8, r2 - adds r3, r1, 0 - adds r5, r7, 0 -_0806E350: - adds r3, 0x2 - adds r4, 0x1 - cmp r4, r10 - bge _0806E368 - ldr r0, [r6] - adds r0, r5, r0 - ldrh r1, [r0] - ldrh r2, [r3] - mov r0, r8 - ands r0, r1 - cmp r2, r0 - bne _0806E350 -_0806E368: - cmp r4, r10 - bne _0806E38A - mov r0, r10 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - lsls r2, r4, 1 - ldr r4, [sp, 0x34] - adds r2, r4, r2 - mov r1, r9 - ldr r0, [r1] - adds r0, r7, r0 - ldrh r1, [r0] - ldr r0, =0x000001ff - ands r0, r1 - strh r0, [r2] -_0806E38A: - mov r5, r12 - cmp r5, 0x13 - bgt _0806E3A0 - mov r2, r9 - ldr r0, [r2] - lsls r1, r5, 1 - adds r1, r0 - ldrh r0, [r1] - ldr r4, =0x0000ffff - cmp r0, r4 - bne _0806E2D0 -_0806E3A0: - mov r0, r10 -_0806E3A2: - add sp, 0x3C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806E25C - - thumb_func_start sub_806E3C0 -sub_806E3C0: @ 806E3C0 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - bl sub_809D42C - cmp r0, 0 - beq _0806E3DA - adds r0, r4, 0 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - b _0806E3F2 -_0806E3DA: - adds r0, r4, 0 - bl SpeciesToHoennPokedexNum - adds r4, r0, 0 - cmp r4, 0xCA - bls _0806E3F0 - ldr r0, =0x0000ffff - b _0806E3F2 - .pool -_0806E3F0: - adds r0, r4, 0 -_0806E3F2: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_806E3C0 - - thumb_func_start sub_806E3F8 -sub_806E3F8: @ 806E3F8 - push {lr} - lsls r0, 16 - lsrs r0, 16 - bl SpeciesToHoennPokedexNum - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xCA - bhi _0806E40E - movs r0, 0x1 - b _0806E410 -_0806E40E: - movs r0, 0 -_0806E410: - pop {r1} - bx r1 - thumb_func_end sub_806E3F8 - - thumb_func_start sub_806E414 -sub_806E414: @ 806E414 - push {lr} - ldr r1, =0x020244e4 - movs r2, 0 - adds r0, r1, 0x3 -_0806E41C: - strb r2, [r0] - subs r0, 0x1 - cmp r0, r1 - bge _0806E41C - pop {r0} - bx r0 - .pool - thumb_func_end sub_806E414 - - thumb_func_start song_id_for_battle -song_id_for_battle: @ 806E42C - push {lr} - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 5 - ands r0, r1 - cmp r0, 0 - beq _0806E448 - movs r0, 0xF0 - lsls r0, 1 - b _0806E646 - .pool -_0806E448: - movs r0, 0x80 - lsls r0, 7 - ands r0, r1 - cmp r0, 0 - beq _0806E45C - ldr r0, =0x000001df - b _0806E646 - .pool -_0806E45C: - ldr r0, =0x02000002 - ands r0, r1 - cmp r0, 0 - beq _0806E466 - b _0806E63C -_0806E466: - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - bne _0806E470 - b _0806E642 -_0806E470: - ldr r0, =0x003f0100 - ands r0, r1 - cmp r0, 0 - beq _0806E494 - ldr r0, =0x02038bca - ldrh r0, [r0] - bl sub_8162BD8 - lsls r0, 24 - lsrs r0, 24 - b _0806E4B2 - .pool -_0806E494: - movs r0, 0x80 - lsls r0, 19 - ands r1, r0 - cmp r1, 0 - beq _0806E4A2 - movs r0, 0xA - b _0806E4B2 -_0806E4A2: - ldr r2, =gTrainers - ldr r0, =0x02038bca - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x1] -_0806E4B2: - subs r0, 0x3 - cmp r0, 0x3D - bls _0806E4BA - b _0806E63C -_0806E4BA: - lsls r0, 2 - ldr r1, =_0806E4D0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0806E4D0: - .4byte _0806E5D0 - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E5D0 - .4byte _0806E63C - .4byte _0806E5D0 - .4byte _0806E63C - .4byte _0806E5C8 - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E62C - .4byte _0806E5D8 - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E5E0 - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E5D0 - .4byte _0806E5E6 - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E5C8 - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E632 - .4byte _0806E632 - .4byte _0806E632 - .4byte _0806E632 - .4byte _0806E632 - .4byte _0806E632 - .4byte _0806E632 -_0806E5C8: - ldr r0, =0x000001e3 - b _0806E646 - .pool -_0806E5D0: - ldr r0, =0x000001db - b _0806E646 - .pool -_0806E5D8: - ldr r0, =0x000001dd - b _0806E646 - .pool -_0806E5E0: - movs r0, 0xEF - lsls r0, 1 - b _0806E646 -_0806E5E6: - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x003f0100 - ands r0, r1 - cmp r0, 0 - beq _0806E604 -_0806E5F2: - ldr r0, =0x000001e1 - b _0806E646 - .pool -_0806E604: - ldr r0, =0x02038bca - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - ldr r1, =gTrainers + 0x4 @ name offset - adds r0, r1 - ldr r1, =gUnknown_085CCB98 - bl CompareString - cmp r0, 0 - beq _0806E63C - b _0806E5F2 - .pool -_0806E62C: - movs r0, 0xF1 - lsls r0, 1 - b _0806E646 -_0806E632: - ldr r0, =0x000001d7 - b _0806E646 - .pool -_0806E63C: - movs r0, 0xEE - lsls r0, 1 - b _0806E646 -_0806E642: - movs r0, 0xED - lsls r0, 1 -_0806E646: - pop {r1} - bx r1 - thumb_func_end song_id_for_battle - - thumb_func_start sub_806E64C -sub_806E64C: @ 806E64C - push {lr} - bl map_music_set_to_zero - bl m4aMPlayAllStop - bl song_id_for_battle - lsls r0, 16 - lsrs r0, 16 - bl song_play_for_text - pop {r0} - bx r0 - thumb_func_end sub_806E64C - - thumb_func_start current_map_music_set__default_for_battle -current_map_music_set__default_for_battle: @ 806E668 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - bl map_music_set_to_zero - bl m4aMPlayAllStop - cmp r4, 0 - beq _0806E682 - adds r0, r4, 0 - bl current_map_music_set - b _0806E68E -_0806E682: - bl song_id_for_battle - lsls r0, 16 - lsrs r0, 16 - bl current_map_music_set -_0806E68E: - pop {r4} - pop {r0} - bx r0 - thumb_func_end current_map_music_set__default_for_battle - - thumb_func_start sub_806E694 -sub_806E694: @ 806E694 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl map_music_set_to_zero - bl m4aMPlayAllStop - ldr r0, =sub_806E6CC - movs r1, 0 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806E694 - - thumb_func_start sub_806E6CC -sub_806E6CC: @ 806E6CC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r1 - movs r2, 0x8 - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _0806E6F0 - ldrh r0, [r1, 0x8] - bl current_map_music_set - b _0806E6FC - .pool -_0806E6F0: - bl song_id_for_battle - lsls r0, 16 - lsrs r0, 16 - bl current_map_music_set -_0806E6FC: - adds r0, r4, 0 - bl remove_task - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_806E6CC - - thumb_func_start pokemon_get_pal -pokemon_get_pal: @ 806E708 - push {r4-r6,lr} - adds r5, r0, 0 - movs r1, 0x41 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x1 - movs r2, 0 - bl pokemon_getattr - adds r6, r0, 0 - adds r0, r5, 0 - movs r1, 0 - movs r2, 0 - bl pokemon_getattr - adds r2, r0, 0 - adds r0, r4, 0 - adds r1, r6, 0 - bl species_and_otid_get_pal - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end pokemon_get_pal - - thumb_func_start species_and_otid_get_pal -species_and_otid_get_pal: @ 806E740 - push {r4,r5,lr} - adds r3, r2, 0 - lsls r0, 16 - lsrs r4, r0, 16 - adds r5, r4, 0 - movs r0, 0xCE - lsls r0, 1 - cmp r4, r0 - bls _0806E75C - ldr r0, =gMonPaletteTable - ldr r0, [r0] - b _0806E788 - .pool -_0806E75C: - lsrs r0, r1, 16 - ldr r2, =0x0000ffff - ands r1, r2 - eors r0, r1 - lsrs r1, r3, 16 - eors r0, r1 - ands r3, r2 - eors r0, r3 - cmp r0, 0x7 - bls _0806E780 - ldr r0, =gMonPaletteTable - lsls r1, r4, 3 - b _0806E784 - .pool -_0806E780: - ldr r0, =gMonShinyPaletteTable - lsls r1, r5, 3 -_0806E784: - adds r1, r0 - ldr r0, [r1] -_0806E788: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end species_and_otid_get_pal - - thumb_func_start sub_806E794 -sub_806E794: @ 806E794 - push {r4-r6,lr} - adds r5, r0, 0 - movs r1, 0x41 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x1 - movs r2, 0 - bl pokemon_getattr - adds r6, r0, 0 - adds r0, r5, 0 - movs r1, 0 - movs r2, 0 - bl pokemon_getattr - adds r2, r0, 0 - adds r0, r4, 0 - adds r1, r6, 0 - bl sub_806E7CC - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_806E794 - - thumb_func_start sub_806E7CC -sub_806E7CC: @ 806E7CC - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - lsrs r0, r1, 16 - ldr r3, =0x0000ffff - ands r1, r3 - eors r0, r1 - lsrs r1, r2, 16 - eors r0, r1 - ands r2, r3 - eors r0, r2 - cmp r0, 0x7 - bls _0806E7F4 - lsls r0, r4, 3 - ldr r1, =gMonPaletteTable - b _0806E7F8 - .pool -_0806E7F4: - lsls r0, r4, 3 - ldr r1, =gMonShinyPaletteTable -_0806E7F8: - adds r0, r1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806E7CC - - thumb_func_start sub_806E804 -sub_806E804: @ 806E804 - push {r4,lr} - lsls r0, 16 - lsrs r3, r0, 16 - ldr r2, =gUnknown_08329EEA - ldrh r0, [r2] - ldr r1, =0x0000ffff - cmp r0, r1 - beq _0806E836 - adds r4, r1, 0 - adds r1, r2, 0 -_0806E818: - ldrh r0, [r2] - adds r1, 0x2 - adds r2, 0x2 - cmp r0, r3 - bne _0806E830 - movs r0, 0x1 - b _0806E838 - .pool -_0806E830: - ldrh r0, [r1] - cmp r0, r4 - bne _0806E818 -_0806E836: - movs r0, 0 -_0806E838: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_806E804 - - thumb_func_start sub_806E840 -sub_806E840: @ 806E840 - lsls r0, 16 - lsrs r0, 16 - ldr r2, =gBaseStats - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r0, [r1, 0x19] - lsrs r0, 7 - bx lr - .pool - thumb_func_end sub_806E840 - - thumb_func_start sub_806E858 -sub_806E858: @ 806E858 - push {r4,lr} - lsls r4, r1, 24 - lsrs r4, 24 - bl GetNature - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_085B25A0 - lsls r1, r0, 2 - adds r1, r0 - adds r1, r4 - adds r1, r2 - movs r0, 0 - ldrsb r0, [r1, r0] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806E858 - - thumb_func_start sub_806E880 -sub_806E880: @ 806E880 - push {r4,lr} - lsls r4, r1, 24 - lsrs r4, 24 - bl GetNatureFromPersonality - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_085B25A0 - lsls r1, r0, 2 - adds r1, r0 - adds r1, r4 - adds r1, r2 - movs r0, 0 - ldrsb r0, [r1, r0] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806E880 - - thumb_func_start sub_806E8A8 -sub_806E8A8: @ 806E8A8 - push {r4,lr} - sub sp, 0x8 - adds r4, r0, 0 - movs r1, 0x7 - mov r2, sp - bl pokemon_getattr - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - bl pokemon_getattr - mov r1, sp - bl sub_806E8D4 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_806E8A8 - - thumb_func_start sub_806E8D4 -sub_806E8D4: @ 806E8D4 - push {r4,r5,lr} - adds r5, r1, 0 - ldr r1, =0x03005d90 - ldr r3, [r1] - ldrb r2, [r3, 0xA] - ldrb r1, [r3, 0xB] - lsls r1, 8 - orrs r2, r1 - ldrb r1, [r3, 0xC] - lsls r1, 16 - orrs r2, r1 - ldrb r1, [r3, 0xD] - lsls r1, 24 - orrs r2, r1 - cmp r0, r2 - bne _0806E91C - movs r4, 0 - ldrb r0, [r5] - cmp r0, 0xFF - beq _0806E912 - adds r2, r5, 0 -_0806E8FE: - adds r1, r3, r4 - ldrb r0, [r2] - ldrb r1, [r1] - cmp r0, r1 - bne _0806E91C - adds r2, 0x1 - adds r4, 0x1 - ldrb r0, [r2] - cmp r0, 0xFF - bne _0806E8FE -_0806E912: - movs r0, 0 - b _0806E91E - .pool -_0806E91C: - movs r0, 0x1 -_0806E91E: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_806E8D4 - - thumb_func_start sub_806E924 -sub_806E924: @ 806E924 - push {lr} - bl pokemon_restore_pp - pop {r0} - bx r0 - thumb_func_end sub_806E924 - - thumb_func_start pokemon_restore_pp -pokemon_restore_pp: @ 806E930 - push {r4-r6,lr} - sub sp, 0x4 - adds r5, r0, 0 - movs r6, 0 -_0806E938: - adds r4, r6, 0 - adds r4, 0xD - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0 - bl pokemon_getattr_encrypted - cmp r0, 0 - beq _0806E984 - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0 - bl pokemon_getattr_encrypted - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr_encrypted - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r2, r6, 24 - lsrs r2, 24 - adds r0, r4, 0 - bl CalcPPWithPPUps - mov r1, sp - strb r0, [r1] - adds r1, r6, 0 - adds r1, 0x11 - adds r0, r5, 0 - mov r2, sp - bl pokemon_setattr_encrypted -_0806E984: - adds r6, 0x1 - cmp r6, 0x3 - ble _0806E938 - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end pokemon_restore_pp - - thumb_func_start sub_806E994 -sub_806E994: @ 806E994 - push {r4,r5,lr} - ldr r2, =0x0202420a - ldr r5, =0x0202449c - ldr r1, [r5] - adds r0, r1, 0 - adds r0, 0xB0 - ldrb r0, [r0] - strb r0, [r2] - ldr r4, =0x02022f58 - movs r0, 0xFD - strb r0, [r4] - movs r0, 0x4 - strb r0, [r4, 0x1] - adds r1, 0x49 - ldrb r0, [r1] - strb r0, [r4, 0x2] - movs r0, 0xFF - strb r0, [r4, 0x4] - ldrb r0, [r1] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0806E9E8 - ldr r1, =0x0202406e - ldr r0, [r5] - adds r0, 0x49 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrb r0, [r0] - bl pokemon_order_func - b _0806E9F6 - .pool -_0806E9E8: - ldr r1, =0x0202406e - ldr r0, [r5] - adds r0, 0x49 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] -_0806E9F6: - strb r0, [r4, 0x3] - ldr r4, =0x02022f68 - movs r0, 0xFD - strb r0, [r4] - movs r0, 0x4 - strb r0, [r4, 0x1] - ldr r1, =0x020244b8 - ldrb r0, [r1] - strb r0, [r4, 0x2] - ldr r2, =0x0202406e - ldrb r0, [r1] - lsls r0, 1 - adds r0, r2 - ldrb r0, [r0] - bl pokemon_order_func - strb r0, [r4, 0x3] - movs r0, 0xFF - strb r0, [r4, 0x4] - ldr r0, =gUnknown_085CB2A1 - ldr r1, =0x02021fc4 - bl get_battle_strings - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806E994 - - thumb_func_start sub_806EA40 -sub_806EA40: @ 806EA40 - push {lr} - lsls r0, 16 - lsrs r3, r0, 16 - movs r1, 0 - ldr r2, =gUnknown_08329EFC -_0806EA4A: - ldrh r0, [r2] - cmp r0, r3 - bne _0806EA58 - adds r0, r1, 0 - b _0806EA62 - .pool -_0806EA58: - adds r2, 0x4 - adds r1, 0x1 - cmp r1, 0x8 - ble _0806EA4A - movs r0, 0 -_0806EA62: - pop {r1} - bx r1 - thumb_func_end sub_806EA40 - - thumb_func_start sub_806EA68 -sub_806EA68: @ 806EA68 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x00302008 - ands r0, r1 - cmp r0, 0 - beq _0806EA7C - b _0806EB90 -_0806EA7C: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =0x02024744 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0x2D - mov r8, r0 - movs r7, 0x5F - ldr r5, =0x020244ec - adds r0, r5, 0 - movs r1, 0x6 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - bne _0806EAC6 - adds r0, r5, 0 - bl GetMonAbility - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xE - bne _0806EAC6 - movs r2, 0x14 - mov r8, r2 - movs r7, 0x50 -_0806EAC6: - ldr r0, =0x02037318 - ldrh r1, [r0, 0x12] - movs r0, 0xD2 - lsls r0, 1 - cmp r1, r0 - bne _0806EB2C - adds r0, r4, 0 - bl sub_806EA40 - adds r2, r0, 0 - cmp r2, 0 - beq _0806EB04 - cmp r6, r7 - bcc _0806EB90 - ldr r0, =0x02024744 - lsls r2, 2 - ldr r1, =gUnknown_08329EFE - b _0806EB6C - .pool -_0806EB04: - cmp r6, r8 - bcc _0806EB90 - cmp r6, r7 - bcs _0806EB18 - ldr r0, =0x02024744 - lsls r2, r4, 3 - b _0806EB66 - .pool -_0806EB18: - ldr r0, =0x02024744 - lsls r2, r4, 3 - subs r2, r4 - lsls r2, 2 - ldr r1, =gBaseStats + 0xe @ item 2 offset - b _0806EB6C - .pool -_0806EB2C: - ldr r0, =gBaseStats - mov r12, r0 - lsls r0, r4, 3 - subs r1, r0, r4 - lsls r5, r1, 2 - mov r2, r12 - adds r1, r5, r2 - ldrh r3, [r1, 0xC] - adds r2, r0, 0 - ldrh r1, [r1, 0xE] - cmp r3, r1 - bne _0806EB5C - cmp r3, 0 - beq _0806EB5C - ldr r0, =0x02024744 - mov r2, r12 - adds r2, 0xC - adds r2, r5, r2 - b _0806EB6E - .pool -_0806EB5C: - cmp r6, r8 - bcc _0806EB90 - cmp r6, r7 - bcs _0806EB80 - ldr r0, =0x02024744 -_0806EB66: - subs r2, r4 - lsls r2, 2 - ldr r1, =gBaseStats + 0xc @ item 1 offset -_0806EB6C: - adds r2, r1 -_0806EB6E: - movs r1, 0xC - bl pokemon_setattr - b _0806EB90 - .pool -_0806EB80: - ldr r0, =0x02024744 - subs r2, r4 - lsls r2, 2 - ldr r1, =gBaseStats + 0xe @ item 2 offset - adds r2, r1 - movs r1, 0xC - bl pokemon_setattr -_0806EB90: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806EA68 - - thumb_func_start sub_806EBA4 -sub_806EBA4: @ 806EBA4 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x1 - movs r2, 0 - bl pokemon_getattr - adds r5, r0, 0 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - bl pokemon_getattr - adds r1, r0, 0 - adds r0, r5, 0 - bl sub_806EBD0 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_806EBA4 - - thumb_func_start sub_806EBD0 -sub_806EBD0: @ 806EBD0 - push {r4,lr} - movs r4, 0 - lsrs r2, r0, 16 - ldr r3, =0x0000ffff - ands r0, r3 - eors r2, r0 - lsrs r0, r1, 16 - eors r2, r0 - ands r1, r3 - eors r2, r1 - cmp r2, 0x7 - bhi _0806EBEA - movs r4, 0x1 -_0806EBEA: - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806EBD0 - - thumb_func_start sub_806EBF8 -sub_806EBF8: @ 806EBF8 - push {r4,lr} - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 15 - ands r0, r1 - cmp r0, 0 - beq _0806EC3C - ldr r2, =0x02038bce - ldrh r1, [r2] - ldr r0, =0x00000c03 - cmp r1, r0 - bne _0806EC28 - ldr r0, =gTrainers + TRAINER_STEVEN * 0x28 + 0x4 @ Steven's name - b _0806EC64 - .pool -_0806EC28: - ldr r4, =0x02021cc4 - ldrh r1, [r2] - adds r0, r4, 0 - bl sub_8162E20 - adds r0, r4, 0 - b _0806EC64 - .pool -_0806EC3C: - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x020229e8 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r4 - ldrh r1, [r1, 0x18] - movs r0, 0x2 - eors r0, r1 - bl sub_806D864 - adds r1, r0, 0 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r4, 0x8 - adds r0, r4 -_0806EC64: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806EBF8 - - thumb_func_start sub_806EC70 -sub_806EC70: @ 806EC70 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r2, r0, r1 - ldrh r0, [r2, 0xE] - subs r0, 0x1 - strh r0, [r2, 0xE] - lsls r0, 16 - cmp r0, 0 - bne _0806ECA0 - ldrh r0, [r2, 0x8] - ldrh r1, [r2, 0xA] - lsls r1, 16 - orrs r0, r1 - ldrb r1, [r2, 0xC] - bl sub_817F544 - adds r0, r4, 0 - bl remove_task -_0806ECA0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806EC70 - - thumb_func_start sub_806ECAC -sub_806ECAC: @ 806ECAC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r2, r0, r1 - ldrh r0, [r2, 0xE] - subs r0, 0x1 - strh r0, [r2, 0xE] - lsls r0, 16 - cmp r0, 0 - bne _0806ECE2 - ldrh r0, [r2, 0x8] - ldrh r1, [r2, 0xA] - lsls r1, 16 - orrs r0, r1 - ldrb r1, [r2, 0xC] - bl sub_817F578 - movs r0, 0xFF - bl sub_81C488C - adds r0, r4, 0 - bl remove_task -_0806ECE2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806ECAC - - thumb_func_start sub_806ECEC -sub_806ECEC: @ 806ECEC - push {r4,r5,lr} - adds r5, r0, 0 - lsls r1, 16 - lsrs r4, r1, 16 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0806ED30 - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x02000002 - ands r0, r1 - cmp r0, 0 - bne _0806ED30 - movs r0, 0x80 - orrs r3, r0 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_806ED40 - b _0806ED38 - .pool -_0806ED30: - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_806ED40 -_0806ED38: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_806ECEC - - thumb_func_start sub_806ED40 -sub_806ED40: @ 806ED40 - push {r4-r6,lr} - adds r5, r0, 0 - lsls r1, 16 - lsrs r4, r1, 16 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x7F - ands r0, r3 - cmp r0, 0 - beq _0806ED60 - cmp r0, 0x1 - beq _0806ED64 - movs r1, 0 - b _0806ED66 -_0806ED60: - movs r1, 0xE7 - b _0806ED66 -_0806ED64: - movs r1, 0x19 -_0806ED66: - movs r0, 0x80 - ands r0, r3 - cmp r0, 0 - beq _0806ED84 - cmp r2, 0 - bne _0806ED7C - lsls r1, 24 - asrs r1, 24 - adds r0, r4, 0 - bl cry_related -_0806ED7C: - ldr r0, =DummyObjectCallback - b _0806EDFA - .pool -_0806ED84: - cmp r2, 0 - bne _0806EDA6 - lsls r1, 24 - asrs r1, 24 - adds r0, r4, 0 - bl cry_related - adds r0, r4, 0 - bl sub_806F0D4 - lsls r0, 24 - cmp r0, 0 - beq _0806EDA6 - adds r0, r5, 0 - movs r1, 0x1 - bl StartObjectImageAnim -_0806EDA6: - ldr r0, =gUnknown_08329B87 - subs r4, 0x1 - adds r6, r4, r0 - ldrb r0, [r6] - cmp r0, 0 - beq _0806EDEC - ldr r0, =sub_806EC70 - movs r1, 0 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r5, [r1, 0x8] - lsrs r0, r5, 16 - strh r0, [r1, 0xA] - ldr r0, =gUnknown_083299EC - adds r0, r4, r0 - ldrb r0, [r0] - strh r0, [r1, 0xC] - ldrb r0, [r6] - strh r0, [r1, 0xE] - b _0806EDF8 - .pool -_0806EDEC: - ldr r0, =gUnknown_083299EC - adds r0, r4, r0 - ldrb r1, [r0] - adds r0, r5, 0 - bl sub_817F544 -_0806EDF8: - ldr r0, =nullsub_18 -_0806EDFA: - str r0, [r5, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806ED40 - - thumb_func_start sub_806EE0C -sub_806EE0C: @ 806EE0C - push {r4-r6,lr} - adds r5, r0, 0 - lsls r1, 16 - lsrs r4, r1, 16 - lsls r2, 24 - cmp r2, 0 - bne _0806EE2E - adds r0, r4, 0 - bl sub_806F0D4 - lsls r0, 24 - cmp r0, 0 - beq _0806EE2E - adds r0, r5, 0 - movs r1, 0x1 - bl StartObjectImageAnim -_0806EE2E: - ldr r0, =gUnknown_08329B87 - subs r4, 0x1 - adds r6, r4, r0 - ldrb r0, [r6] - cmp r0, 0 - beq _0806EE80 - ldr r0, =sub_806ECAC - movs r1, 0 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005e00 - lsls r2, r0, 2 - adds r2, r0 - lsls r2, 3 - adds r2, r1 - strh r5, [r2, 0x8] - lsrs r1, r5, 16 - strh r1, [r2, 0xA] - ldr r1, =gUnknown_083299EC - adds r1, r4, r1 - ldrb r1, [r1] - strh r1, [r2, 0xC] - ldrb r1, [r6] - strh r1, [r2, 0xE] - bl sub_81C488C - adds r0, r5, 0 - bl sub_817F60C - b _0806EE8C - .pool -_0806EE80: - ldr r0, =gUnknown_083299EC - adds r0, r4, r0 - ldrb r1, [r0] - adds r0, r5, 0 - bl sub_817F578 -_0806EE8C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806EE0C - - thumb_func_start sub_806EE98 -sub_806EE98: @ 806EE98 - push {lr} - ldr r0, =sub_806ECAC - bl get_task_id_by_function - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _0806EEAC - bl remove_task -_0806EEAC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_806EE98 - - thumb_func_start sub_806EEB4 -sub_806EEB4: @ 806EEB4 - push {r4,lr} - adds r4, r0, 0 - lsls r1, 16 - lsrs r2, r1, 16 - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0806EEE8 - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x02000002 - ands r0, r1 - cmp r0, 0 - bne _0806EEE8 - ldr r0, =DummyObjectCallback - b _0806EEFC - .pool -_0806EEE8: - adds r0, r2, 0 - bl sub_817F474 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_817F594 - ldr r0, =nullsub_18 -_0806EEFC: - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806EEB4 - - thumb_func_start sub_806EF08 -sub_806EF08: @ 806EF08 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r5, 0 - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x020229e8 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r1, 0x18] - cmp r0, 0x1 - beq _0806EF4C - cmp r0, 0x1 - bgt _0806EF38 - cmp r0, 0 - beq _0806EF42 - b _0806EF56 - .pool -_0806EF38: - cmp r0, 0x2 - beq _0806EF42 - cmp r0, 0x3 - beq _0806EF4C - b _0806EF56 -_0806EF42: - movs r5, 0x3 - cmp r4, 0 - beq _0806EF56 - movs r5, 0x1 - b _0806EF56 -_0806EF4C: - negs r0, r4 - orrs r0, r4 - asrs r5, r0, 31 - movs r0, 0x2 - ands r5, r0 -_0806EF56: - movs r2, 0 - ldr r4, =0x020229e8 - ldrh r0, [r4, 0x18] - adds r1, r5, 0 - cmp r0, r1 - beq _0806EF74 - adds r3, r1, 0 - adds r1, r4, 0 -_0806EF66: - adds r1, 0x1C - adds r2, 0x1 - cmp r2, 0x3 - bgt _0806EF74 - ldrh r0, [r1, 0x18] - cmp r0, r3 - bne _0806EF66 -_0806EF74: - lsls r0, r2, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806EF08 - - thumb_func_start sub_806EF84 -sub_806EF84: @ 806EF84 - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r1, 24 - lsrs r1, 24 - movs r4, 0 - ldr r2, =0x020229e8 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x18] - cmp r0, 0x1 - beq _0806EFC4 - cmp r0, 0x1 - bgt _0806EFB0 - cmp r0, 0 - beq _0806EFBA - b _0806EFCE - .pool -_0806EFB0: - cmp r0, 0x2 - beq _0806EFBA - cmp r0, 0x3 - beq _0806EFC4 - b _0806EFCE -_0806EFBA: - movs r4, 0x3 - cmp r3, 0 - beq _0806EFCE - movs r4, 0x1 - b _0806EFCE -_0806EFC4: - negs r0, r3 - orrs r0, r3 - asrs r4, r0, 31 - movs r0, 0x2 - ands r4, r0 -_0806EFCE: - movs r3, 0 - ldrh r0, [r2, 0x18] - adds r1, r4, 0 - cmp r0, r1 - beq _0806EFE6 -_0806EFD8: - adds r2, 0x1C - adds r3, 0x1 - cmp r3, 0x3 - bgt _0806EFE6 - ldrh r0, [r2, 0x18] - cmp r0, r1 - bne _0806EFD8 -_0806EFE6: - lsls r0, r3, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_806EF84 - - thumb_func_start TrainerClassToTrainerPic -@ u8 TrainerClassToTrainerPic(u16 trainerClassId) -TrainerClassToTrainerPic: @ 806EFF0 - lsls r0, 16 - lsrs r0, 16 - ldr r1, =gTrainerPicIndices - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end TrainerClassToTrainerPic - - thumb_func_start sub_806F000 -sub_806F000: @ 806F000 - push {lr} - lsls r0, 24 - cmp r0, 0 - bne _0806F00C - movs r0, 0x3C - b _0806F00E -_0806F00C: - movs r0, 0x3F -_0806F00E: - bl TrainerClassToTrainerPic - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_806F000 - - thumb_func_start SetPokedexFlag -@ void SetPokedexFlag(u16 nationalPokedexNum, u8 op, u32 personality) -SetPokedexFlag: @ 806F01C - push {r4-r7,lr} - adds r7, r2, 0 - lsls r0, 16 - lsrs r4, r0, 16 - adds r6, r4, 0 - lsls r1, 24 - lsrs r5, r1, 24 - movs r0, 0x2 - eors r0, r5 - negs r1, r0 - orrs r1, r0 - lsrs r1, 31 - adds r0, r4, 0 - bl pokedex_flag_operation - lsls r0, 24 - cmp r0, 0 - bne _0806F072 - adds r0, r4, 0 - adds r1, r5, 0 - bl pokedex_flag_operation - adds r0, r4, 0 - bl NationalPokedexNumToSpecies - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xC9 - bne _0806F05C - ldr r0, =0x03005d90 - ldr r0, [r0] - str r7, [r0, 0x1C] -_0806F05C: - adds r0, r6, 0 - bl NationalPokedexNumToSpecies - lsls r0, 16 - movs r1, 0x9A - lsls r1, 17 - cmp r0, r1 - bne _0806F072 - ldr r0, =0x03005d90 - ldr r0, [r0] - str r7, [r0, 0x20] -_0806F072: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end SetPokedexFlag - - thumb_func_start sub_806F07C -sub_806F07C: @ 806F07C - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, =0x00000356 - cmp r2, r0 - bls _0806F08A - movs r2, 0 -_0806F08A: - ldr r1, =gTrainers - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0x1] - movs r0, 0xD - muls r0, r1 - ldr r1, =gTrainerClassNames - adds r0, r1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_806F07C - - thumb_func_start sub_806F0B0 -sub_806F0B0: @ 806F0B0 - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =0x00000356 - cmp r1, r0 - bls _0806F0BE - movs r1, 0 -_0806F0BE: - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - ldr r1, =gTrainers + 0x4 @ name offset - adds r0, r1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_806F0B0 - - thumb_func_start sub_806F0D4 -sub_806F0D4: @ 806F0D4 - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - movs r1, 0 - ldr r0, =0x00000181 - cmp r2, r0 - beq _0806F0F8 - adds r0, 0x19 - cmp r2, r0 - beq _0806F0F8 - subs r0, 0x66 - cmp r2, r0 - beq _0806F0F8 - movs r1, 0xC9 - eors r1, r2 - negs r0, r1 - orrs r0, r1 - lsrs r1, r0, 31 -_0806F0F8: - adds r0, r1, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_806F0D4 - - thumb_func_start sub_806F104 -sub_806F104: @ 806F104 - push {lr} - ldr r2, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r2, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0806F122 - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x003f0100 - ands r0, r1 - cmp r0, 0 - bne _0806F144 -_0806F122: - ldr r1, =0x00000439 - adds r0, r2, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _0806F158 - bl InBattlePike - lsls r0, 24 - cmp r0, 0 - bne _0806F144 - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _0806F158 -_0806F144: - movs r0, 0x1 - b _0806F15A - .pool -_0806F158: - movs r0, 0 -_0806F15A: - pop {r1} - bx r1 - thumb_func_end sub_806F104 - - thumb_func_start sub_806F160 -sub_806F160: @ 806F160 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r6, r0, 0 - ldrb r0, [r6] - lsls r0, 28 - movs r4, 0 - cmp r0, 0 - beq _0806F1EA -_0806F176: - ldr r0, [r6, 0xC] - lsls r2, r4, 1 - adds r1, r2, r4 - lsls r1, 3 - adds r0, r1, r0 - ldr r3, =gUnknown_08329D98 - adds r1, r3 - ldm r1!, {r3,r5,r7} - stm r0!, {r3,r5,r7} - ldm r1!, {r3,r5,r7} - stm r0!, {r3,r5,r7} - movs r5, 0 - ldrb r3, [r6, 0x1] - ldr r7, [r6, 0xC] - mov r9, r7 - mov r8, r2 - ldr r0, [r6, 0x10] - mov r12, r0 - adds r1, r4, 0x1 - mov r10, r1 - cmp r5, r3 - bcs _0806F1C8 - mov r7, r12 - ldr r1, [r6, 0x8] - lsls r0, r4, 2 - adds r0, r1 - ldr r2, [r0] -_0806F1AC: - adds r0, r4, 0 - muls r0, r3 - adds r0, r5 - lsls r0, 3 - adds r0, r7 - lsls r1, r5, 11 - adds r1, r2, r1 - str r1, [r0] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - ldrb r3, [r6, 0x1] - cmp r5, r3 - bcc _0806F1AC -_0806F1C8: - mov r3, r8 - adds r1, r3, r4 - lsls r1, 3 - add r1, r9 - ldrb r0, [r6, 0x1] - muls r0, r4 - lsls r0, 3 - add r0, r12 - str r0, [r1, 0xC] - mov r5, r10 - lsls r0, r5, 16 - lsrs r4, r0, 16 - ldrb r0, [r6] - lsls r0, 28 - lsrs r0, 28 - cmp r4, r0 - blt _0806F176 -_0806F1EA: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806F160 - - thumb_func_start sub_806F1FC -sub_806F1FC: @ 806F1FC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r4, r0, 0 - ldrb r0, [r4] - lsls r0, 28 - movs r3, 0 - cmp r0, 0 - beq _0806F296 - ldr r0, =gUnknown_08329F28 - mov r10, r0 -_0806F216: - ldr r0, [r4, 0xC] - lsls r2, r3, 1 - adds r1, r2, r3 - lsls r1, 3 - adds r1, r0 - mov r0, r10 - ldm r0!, {r5-r7} - stm r1!, {r5-r7} - ldm r0!, {r5-r7} - stm r1!, {r5-r7} - movs r5, 0 - ldr r0, [r4, 0xC] - mov r8, r0 - mov r12, r2 - ldr r7, [r4, 0x10] - adds r1, r3, 0x1 - mov r9, r1 - ldrb r6, [r4, 0x1] - cmp r5, r6 - bcs _0806F26A - adds r6, r7, 0 - ldr r1, [r4, 0x8] - lsls r0, r3, 2 - adds r0, r1 - ldr r2, [r0] -_0806F248: - ldrb r0, [r4] - lsls r0, 28 - lsrs r0, 28 - adds r1, r3, 0 - muls r1, r0 - adds r1, r5 - lsls r1, 3 - adds r1, r6 - lsls r0, r5, 11 - adds r0, r2, r0 - str r0, [r1] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - ldrb r0, [r4, 0x1] - cmp r5, r0 - bcc _0806F248 -_0806F26A: - mov r5, r12 - adds r1, r5, r3 - lsls r1, 3 - add r1, r8 - ldrb r0, [r4] - lsls r0, 28 - lsrs r0, 28 - muls r0, r3 - lsls r0, 3 - adds r0, r7, r0 - str r0, [r1, 0xC] - ldr r6, =gUnknown_082FF70C - str r6, [r1, 0x8] - strh r3, [r1, 0x2] - mov r7, r9 - lsls r0, r7, 16 - lsrs r3, r0, 16 - ldrb r0, [r4] - lsls r0, 28 - lsrs r0, 28 - cmp r3, r0 - blt _0806F216 -_0806F296: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806F1FC - - thumb_func_start sub_806F2AC -sub_806F2AC: @ 806F2AC - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - movs r7, 0 - movs r0, 0x1 - ands r6, r0 - movs r0, 0x14 - bl AllocZeroed - adds r4, r0, 0 - cmp r4, 0 - bne _0806F2D0 - movs r0, 0 - b _0806F46E -_0806F2D0: - cmp r5, 0 - beq _0806F2E6 - cmp r5, 0x2 - bne _0806F2E6 - movs r0, 0x77 - strb r0, [r4] - movs r0, 0x4 - strb r0, [r4, 0x1] - movs r0, 0x21 - strb r0, [r4, 0x3] - b _0806F30E -_0806F2E6: - ldrb r1, [r4] - movs r2, 0x10 - negs r2, r2 - adds r0, r2, 0 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - movs r3, 0xF - ands r0, r3 - movs r1, 0x40 - orrs r0, r1 - strb r0, [r4] - movs r0, 0x4 - strb r0, [r4, 0x1] - ldrb r0, [r4, 0x3] - ands r2, r0 - movs r0, 0x1 - orrs r2, r0 - ands r2, r3 - strb r2, [r4, 0x3] -_0806F30E: - ldrb r1, [r4, 0x3] - lsls r1, 28 - lsrs r1, 28 - ldrb r0, [r4] - lsls r0, 28 - lsrs r0, 15 - muls r0, r1 - bl AllocZeroed - str r0, [r4, 0x4] - ldrb r0, [r4] - lsls r0, 28 - lsrs r0, 23 - bl AllocZeroed - adds r1, r0, 0 - str r1, [r4, 0x8] - ldr r2, [r4, 0x4] - cmp r2, 0 - beq _0806F33A - cmp r1, 0 - bne _0806F344 -_0806F33A: - movs r0, 0x1 - orrs r7, r0 - lsls r6, 2 - mov r8, r6 - b _0806F378 -_0806F344: - ldrb r0, [r4] - lsls r0, 28 - movs r3, 0 - lsls r6, 2 - mov r8, r6 - cmp r0, 0 - beq _0806F378 - adds r6, r1, 0 - adds r5, r2, 0 -_0806F356: - lsls r2, r3, 2 - adds r2, r6 - ldrb r0, [r4, 0x3] - lsls r0, 28 - lsrs r0, 28 - lsls r1, r3, 13 - muls r0, r1 - adds r0, r5, r0 - str r0, [r2] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - ldrb r0, [r4] - lsls r0, 28 - lsrs r0, 28 - cmp r3, r0 - blt _0806F356 -_0806F378: - ldrb r1, [r4] - lsls r1, 28 - lsrs r1, 28 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - bl AllocZeroed - str r0, [r4, 0xC] - ldrb r1, [r4] - lsls r1, 28 - lsrs r1, 28 - ldrb r0, [r4, 0x1] - lsls r0, 3 - muls r0, r1 - bl AllocZeroed - adds r1, r0, 0 - str r1, [r4, 0x10] - ldr r0, [r4, 0xC] - cmp r0, 0 - beq _0806F3A8 - cmp r1, 0 - bne _0806F3B2 -_0806F3A8: - movs r0, 0x2 - orrs r7, r0 - lsls r0, r7, 24 - lsrs r7, r0, 24 - b _0806F400 -_0806F3B2: - movs r3, 0 - ldrb r0, [r4, 0x1] - ldrb r1, [r4] - lsls r1, 28 - lsrs r1, 28 - muls r0, r1 - cmp r3, r0 - bge _0806F3E2 - movs r2, 0x80 - lsls r2, 4 -_0806F3C6: - ldr r1, [r4, 0x10] - lsls r0, r3, 3 - adds r0, r1 - strh r2, [r0, 0x4] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - ldrb r1, [r4, 0x1] - ldrb r0, [r4] - lsls r0, 28 - lsrs r0, 28 - muls r0, r1 - cmp r3, r0 - blt _0806F3C6 -_0806F3E2: - ldrb r0, [r4, 0x3] - lsrs r0, 4 - cmp r0, 0 - blt _0806F3FA - cmp r0, 0x1 - ble _0806F3FA - cmp r0, 0x2 - bne _0806F3FA - adds r0, r4, 0 - bl sub_806F1FC - b _0806F400 -_0806F3FA: - adds r0, r4, 0 - bl sub_806F160 -_0806F400: - movs r0, 0x2 - ands r0, r7 - cmp r0, 0 - beq _0806F424 - ldr r0, [r4, 0x10] - cmp r0, 0 - beq _0806F416 - bl Free - movs r0, 0 - str r0, [r4, 0x10] -_0806F416: - ldr r0, [r4, 0xC] - cmp r0, 0 - beq _0806F424 - bl Free - movs r0, 0 - str r0, [r4, 0xC] -_0806F424: - movs r0, 0x1 - ands r0, r7 - cmp r0, 0 - beq _0806F448 - ldr r0, [r4, 0x8] - cmp r0, 0 - beq _0806F43A - bl Free - movs r0, 0 - str r0, [r4, 0x8] -_0806F43A: - ldr r0, [r4, 0x4] - cmp r0, 0 - beq _0806F448 - bl Free - movs r0, 0 - str r0, [r4, 0x4] -_0806F448: - cmp r7, 0 - beq _0806F45E - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x14 - bl memset - adds r0, r4, 0 - bl Free - b _0806F468 -_0806F45E: - movs r0, 0xA3 - strb r0, [r4, 0x2] - ldr r0, =0x020249b4 - add r0, r8 - str r4, [r0] -_0806F468: - ldr r0, =0x020249b4 - add r0, r8 - ldr r0, [r0] -_0806F46E: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806F2AC - - thumb_func_start sub_806F47C -sub_806F47C: @ 806F47C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - ands r0, r1 - ldr r1, =0x020249b4 - lsls r0, 2 - adds r0, r1 - ldr r4, [r0] - cmp r4, 0 - beq _0806F4F0 - ldrb r0, [r4, 0x2] - cmp r0, 0xA3 - beq _0806F4A8 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x14 - bl memset - b _0806F4F0 - .pool -_0806F4A8: - ldr r0, [r4, 0x10] - cmp r0, 0 - beq _0806F4B6 - bl Free - movs r0, 0 - str r0, [r4, 0x10] -_0806F4B6: - ldr r0, [r4, 0xC] - cmp r0, 0 - beq _0806F4C4 - bl Free - movs r0, 0 - str r0, [r4, 0xC] -_0806F4C4: - ldr r0, [r4, 0x8] - cmp r0, 0 - beq _0806F4D2 - bl Free - movs r0, 0 - str r0, [r4, 0x8] -_0806F4D2: - ldr r0, [r4, 0x4] - cmp r0, 0 - beq _0806F4E0 - bl Free - movs r0, 0 - str r0, [r4, 0x4] -_0806F4E0: - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x14 - bl memset - adds r0, r4, 0 - bl Free -_0806F4F0: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_806F47C - - thumb_func_start sub_806F4F8 -sub_806F4F8: @ 806F4F8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r3, r1, 24 - ldr r2, =0x020249b4 - movs r1, 0x1 - ands r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, [r0] - ldrb r0, [r1, 0x2] - cmp r0, 0xA3 - beq _0806F51C - movs r0, 0 - b _0806F530 - .pool -_0806F51C: - ldrb r0, [r1] - lsls r0, 28 - lsrs r0, 28 - cmp r3, r0 - blt _0806F528 - movs r3, 0 -_0806F528: - ldr r0, [r1, 0x8] - lsls r1, r3, 2 - adds r1, r0 - ldr r0, [r1] -_0806F530: - pop {r1} - bx r1 - thumb_func_end sub_806F4F8 - - thumb_func_start sine -@ s16 sine(s16 t, s16 amplitude) -sine: @ 806F534 - lsls r1, 16 - asrs r1, 16 - ldr r2, =gUnknown_08329F40 - lsls r0, 16 - asrs r0, 15 - adds r0, r2 - movs r2, 0 - ldrsh r0, [r0, r2] - muls r0, r1 - lsls r0, 8 - asrs r0, 16 - bx lr - .pool - thumb_func_end sine - - thumb_func_start cosine -@ s16 cosine(s16 t, s16 amplitude) -cosine: @ 806F550 - lsls r1, 16 - asrs r1, 16 - ldr r2, =gUnknown_08329F40 - lsls r0, 16 - asrs r0, 15 - adds r0, 0x80 - adds r0, r2 - movs r2, 0 - ldrsh r0, [r0, r2] - muls r0, r1 - lsls r0, 8 - asrs r0, 16 - bx lr - .pool - thumb_func_end cosine - - thumb_func_start sine2 -@ s16 sine2(u16 angle) -sine2: @ 806F570 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r5, 0 - movs r1, 0xB4 - bl __umodsi3 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0xB4 - bl __udivsi3 - movs r1, 0x1 - ands r0, r1 - ldr r1, =gUnknown_0832A1C0 - lsls r4, 1 - adds r4, r1 - ldrh r1, [r4] - cmp r0, 0 - bne _0806F5A8 - lsls r0, r1, 16 - b _0806F5AC - .pool -_0806F5A8: - lsls r0, r1, 16 - negs r0, r0 -_0806F5AC: - asrs r0, 16 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sine2 - - thumb_func_start cosine2 -@ s16 cosine2(u16 angle) -cosine2: @ 806F5B4 - push {lr} - lsls r0, 16 - movs r1, 0xB4 - lsls r1, 15 - adds r0, r1 - lsrs r0, 16 - bl sine2 - lsls r0, 16 - asrs r0, 16 - pop {r1} - bx r1 - thumb_func_end cosine2 - - thumb_func_start GenerateRandomNumber -@ u16 GenerateRandomNumber() -GenerateRandomNumber: @ 806F5CC - ldr r2, =0x03005d80 - ldr r1, [r2] - ldr r0, =0x41c64e6d - muls r0, r1 - ldr r1, =0x00006073 - adds r0, r1 - str r0, [r2] - ldr r2, =0x020249c0 - ldr r1, [r2] - adds r1, 0x1 - str r1, [r2] - lsrs r0, 16 - bx lr - .pool - thumb_func_end GenerateRandomNumber - - thumb_func_start SeedRng -@ void SeedRng(u16 seed) -SeedRng: @ 806F5F8 - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x03005d80 - str r0, [r1] - ldr r1, =0x020249bc - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end SeedRng - - thumb_func_start SeedRng2 -SeedRng2: @ 806F610 - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x03005d84 - str r0, [r1] - bx lr - .pool - thumb_func_end SeedRng2 - - thumb_func_start GenerateRandomNumber2 -GenerateRandomNumber2: @ 806F620 - ldr r2, =0x03005d84 - ldr r1, [r2] - ldr r0, =0x41c64e6d - muls r0, r1 - ldr r1, =0x00006073 - adds r0, r1 - str r0, [r2] - lsrs r0, 16 - bx lr - .pool - thumb_func_end GenerateRandomNumber2 - - thumb_func_start object_new_hidden_with_callback -object_new_hidden_with_callback: @ 806F640 - push {r4-r6,lr} - adds r6, r0, 0 - ldr r0, =gUnknown_0832A3A8 - movs r1, 0xF8 - movs r2, 0xA8 - movs r3, 0xE - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r5, =0x02020630 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r3, r2, r5 - adds r3, 0x3E - ldrb r1, [r3] - movs r4, 0x4 - orrs r1, r4 - strb r1, [r3] - adds r5, 0x1C - adds r2, r5 - str r6, [r2] - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end object_new_hidden_with_callback - - thumb_func_start sub_806F67C -sub_806F67C: @ 806F67C - strh r1, [r0] - lsrs r1, 16 - strh r1, [r0, 0x2] - bx lr - thumb_func_end sub_806F67C - - thumb_func_start sub_806F684 -sub_806F684: @ 806F684 - ldrh r2, [r0] - movs r3, 0x2 - ldrsh r0, [r0, r3] - lsls r0, 16 - orrs r2, r0 - str r2, [r1] - bx lr - thumb_func_end sub_806F684 - - thumb_func_start sub_806F694 -sub_806F694: @ 806F694 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r4, [sp, 0x18] - ldr r5, [sp, 0x1C] - ldr r6, [sp, 0x20] - ldr r7, [sp, 0x24] - mov r8, r7 - str r1, [r0] - str r2, [r0, 0x4] - strh r3, [r0, 0x8] - strh r4, [r0, 0xA] - strh r5, [r0, 0xC] - strh r6, [r0, 0xE] - mov r1, r8 - strh r1, [r0, 0x10] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_806F694 - - thumb_func_start sub_806F6C0 -sub_806F6C0: @ 806F6C0 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x24 - mov r8, r0 - ldr r0, [sp, 0x38] - ldr r4, [sp, 0x3C] - ldr r5, [sp, 0x40] - ldr r6, [sp, 0x44] - lsls r6, 16 - lsrs r6, 16 - lsls r3, 16 - asrs r3, 16 - lsls r0, 16 - asrs r0, 16 - str r0, [sp] - lsls r4, 16 - asrs r4, 16 - str r4, [sp, 0x4] - lsls r5, 16 - asrs r5, 16 - str r5, [sp, 0x8] - str r6, [sp, 0xC] - add r0, sp, 0x10 - bl sub_806F694 - add r0, sp, 0x10 - mov r1, r8 - movs r2, 0x1 - bl BgAffineSet - add sp, 0x24 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_806F6C0 - - thumb_func_start rfu_MBOOT_CHILD_inheritanceLinkStatus -rfu_MBOOT_CHILD_inheritanceLinkStatus: @ 806F70C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x38 - str r2, [sp, 0x20] - adds r4, r3, 0 - ldr r7, [sp, 0x58] - lsls r0, 24 - lsls r1, 24 - ldr r2, =gUnknown_0832A3C0 - lsrs r1, 23 - lsrs r0, 21 - adds r1, r0 - adds r0, r2, 0x1 - adds r0, r1, r0 - ldrb r0, [r0] - str r0, [sp, 0x24] - adds r1, r2 - ldrb r1, [r1] - str r1, [sp, 0x28] - movs r0, 0 - b _0806F88C - .pool -_0806F740: - movs r5, 0 - adds r0, 0x1 - str r0, [sp, 0x30] - b _0806F874 -_0806F748: - ldrh r0, [r4] - ldr r2, =0x000003ff - adds r1, r2, 0 - ands r1, r0 - lsls r1, 5 - mov r8, r1 - movs r2, 0xC0 - lsls r2, 4 - adds r1, r2, 0 - ands r1, r0 - mov r2, sp - strh r0, [r2, 0x34] - cmp r1, 0 - bne _0806F788 - ldr r0, [sp, 0x20] - add r0, r8 - adds r1, r7, 0 - ldr r2, =0x04000008 - bl CpuSet - adds r4, 0x2 - str r4, [sp, 0x2C] - adds r7, 0x20 - mov r10, r7 - adds r5, 0x1 - mov r9, r5 - b _0806F86A - .pool -_0806F788: - movs r0, 0x80 - lsls r0, 4 - cmp r1, r0 - bne _0806F7CC - movs r1, 0 - adds r4, 0x2 - str r4, [sp, 0x2C] - movs r2, 0x20 - adds r2, r7 - mov r10, r2 - adds r5, 0x1 - mov r9, r5 -_0806F7A0: - lsls r4, r1, 24 - asrs r4, 24 - movs r0, 0x7 - subs r0, r4 - lsls r0, 2 - add r0, r8 - ldr r1, [sp, 0x20] - adds r0, r1, r0 - lsls r1, r4, 2 - adds r1, r7, r1 - ldr r2, =0x04000001 - bl CpuSet - adds r4, 0x1 - lsls r4, 24 - lsrs r1, r4, 24 - asrs r4, 24 - cmp r4, 0x7 - ble _0806F7A0 - b _0806F86A - .pool -_0806F7CC: - movs r1, 0 - adds r4, 0x2 - str r4, [sp, 0x2C] - movs r2, 0x20 - adds r2, r7 - mov r10, r2 - adds r5, 0x1 - mov r9, r5 - movs r0, 0xF - mov r12, r0 -_0806F7E0: - movs r2, 0 - lsls r4, r1, 24 - lsls r0, r4, 2 - lsrs r0, 24 - adds r6, r0, 0x3 - mov r1, r8 - adds r5, r1, r0 -_0806F7EE: - lsls r1, r2, 24 - asrs r1, 24 - subs r0, r6, r1 - mov r2, sp - adds r3, r2, r0 - adds r0, r5, r1 - ldr r2, [sp, 0x20] - adds r0, r2, r0 - ldrb r2, [r0] - mov r0, r12 - ands r0, r2 - lsls r0, 4 - lsrs r2, 4 - orrs r0, r2 - strb r0, [r3] - adds r1, 0x1 - lsls r1, 24 - lsrs r2, r1, 24 - asrs r1, 24 - cmp r1, 0x3 - ble _0806F7EE - movs r1, 0x80 - lsls r1, 17 - adds r0, r4, r1 - lsrs r1, r0, 24 - asrs r0, 24 - cmp r0, 0x7 - ble _0806F7E0 - mov r2, sp - ldrh r0, [r2, 0x34] - movs r2, 0x80 - lsls r2, 4 - ands r0, r2 - cmp r0, 0 - beq _0806F860 - movs r1, 0 -_0806F836: - lsls r4, r1, 24 - asrs r4, 24 - movs r0, 0x7 - subs r0, r4 - lsls r0, 2 - add r0, sp - lsls r1, r4, 2 - adds r1, r7, r1 - ldr r2, =0x04000001 - bl CpuSet - adds r4, 0x1 - lsls r4, 24 - lsrs r1, r4, 24 - asrs r4, 24 - cmp r4, 0x7 - ble _0806F836 - b _0806F86A - .pool -_0806F860: - mov r0, sp - adds r1, r7, 0 - ldr r2, =0x04000008 - bl CpuSet -_0806F86A: - ldr r4, [sp, 0x2C] - mov r7, r10 - mov r1, r9 - lsls r0, r1, 24 - lsrs r5, r0, 24 -_0806F874: - ldr r2, [sp, 0x28] - cmp r5, r2 - bcs _0806F87C - b _0806F748 -_0806F87C: - movs r0, 0x20 - ldr r1, [sp, 0x28] - subs r0, r1 - lsls r0, 1 - adds r4, r0 - ldr r2, [sp, 0x30] - lsls r0, r2, 24 - lsrs r0, 24 -_0806F88C: - ldr r1, [sp, 0x24] - cmp r0, r1 - bcs _0806F894 - b _0806F740 -_0806F894: - add sp, 0x38 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end rfu_MBOOT_CHILD_inheritanceLinkStatus - - thumb_func_start sub_806F8A8 -sub_806F8A8: @ 806F8A8 - push {lr} - adds r2, r0, 0 - movs r1, 0 - movs r3, 0x1 -_0806F8B0: - adds r0, r2, 0 - ands r0, r3 - cmp r0, 0 - beq _0806F8BC - adds r0, r1, 0 - b _0806F8CA -_0806F8BC: - lsrs r2, 1 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1F - bls _0806F8B0 - movs r0, 0 -_0806F8CA: - pop {r1} - bx r1 - thumb_func_end sub_806F8A8 - - thumb_func_start sub_806F8D0 -sub_806F8D0: @ 806F8D0 - push {r4-r7,lr} - adds r7, r0, 0 - adds r4, r1, 0 - ldr r2, =0x00001121 - movs r3, 0 - cmp r3, r4 - bge _0806F91C - movs r6, 0x1 - ldr r0, =0x00008408 - adds r5, r0, 0 -_0806F8E4: - adds r0, r7, r3 - ldrb r0, [r0] - eors r2, r0 - movs r1, 0 - adds r3, 0x1 -_0806F8EE: - adds r0, r2, 0 - ands r0, r6 - cmp r0, 0 - beq _0806F908 - lsrs r0, r2, 1 - eors r0, r5 - lsls r0, 16 - lsrs r2, r0, 16 - b _0806F90A - .pool -_0806F908: - lsrs r2, 1 -_0806F90A: - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x7 - bls _0806F8EE - lsls r0, r3, 16 - lsrs r3, r0, 16 - cmp r3, r4 - blt _0806F8E4 -_0806F91C: - mvns r0, r2 - lsls r0, 16 - lsrs r0, 16 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_806F8D0 - - thumb_func_start sub_806F928 -sub_806F928: @ 806F928 - push {r4-r6,lr} - adds r5, r0, 0 - adds r4, r1, 0 - ldr r2, =0x00001121 - movs r3, 0 - cmp r3, r4 - bcs _0806F956 - ldr r6, =gUnknown_0832A3D8 -_0806F938: - lsrs r1, r2, 8 - adds r0, r5, r3 - ldrb r0, [r0] - eors r2, r0 - lsls r0, r2, 24 - lsrs r0, 23 - adds r0, r6 - ldrh r0, [r0] - adds r2, r0, 0 - eors r2, r1 - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, r4 - bcc _0806F938 -_0806F956: - mvns r0, r2 - lsls r0, 16 - lsrs r0, 16 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806F928 - - thumb_func_start sub_806F96C -sub_806F96C: @ 806F96C - push {r4,lr} - adds r4, r0, 0 - movs r3, 0 - movs r2, 0 - cmp r3, r1 - bcs _0806F984 -_0806F978: - adds r0, r4, r2 - ldrb r0, [r0] - adds r3, r0 - adds r2, 0x1 - cmp r2, r1 - bcc _0806F978 -_0806F984: - adds r0, r3, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_806F96C - - thumb_func_start pal_fade_1 -pal_fade_1: @ 806F98C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r1, 16 - lsrs r1, 16 - mov r12, r1 - lsls r2, 24 - lsrs r7, r2, 24 - mov r0, sp - strh r3, [r0] - movs r6, 0 - cmp r6, r12 - bcs _0806FA12 - ldr r0, =0x02037714 - mov r10, r0 - ldr r1, =0x02037b14 - mov r9, r1 -_0806F9BA: - mov r0, r8 - adds r5, r6, r0 - lsls r5, 16 - lsrs r5, 15 - mov r1, r10 - adds r0, r5, r1 - ldr r3, [r0] - lsls r4, r3, 27 - lsls r2, r3, 22 - lsls r3, 17 - add r5, r9 - lsrs r4, 27 - ldr r1, [sp] - lsls r0, r1, 27 - lsrs r0, 27 - subs r0, r4 - muls r0, r7 - asrs r0, 4 - adds r4, r0 - lsrs r2, 27 - lsls r0, r1, 22 - lsrs r0, 27 - subs r0, r2 - muls r0, r7 - asrs r0, 4 - adds r2, r0 - lsls r2, 5 - orrs r4, r2 - lsrs r3, 27 - lsls r1, 17 - lsrs r1, 27 - subs r1, r3 - adds r0, r1, 0 - muls r0, r7 - asrs r0, 4 - adds r3, r0 - lsls r3, 10 - orrs r4, r3 - strh r4, [r5] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, r12 - bcc _0806F9BA -_0806FA12: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end pal_fade_1 - - thumb_func_start pokemon_get_nick -pokemon_get_nick: @ 806FA2C - push {r4,lr} - sub sp, 0x14 - adds r4, r1, 0 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - adds r0, r4, 0 - mov r1, sp - bl CopyString_Limit10 - add sp, 0x14 - pop {r4} - pop {r1} - bx r1 - thumb_func_end pokemon_get_nick - - thumb_func_start pokemon_get_nick_ -pokemon_get_nick_: @ 806FA4C - push {r4,lr} - sub sp, 0x14 - adds r4, r1, 0 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr_encrypted - adds r0, r4, 0 - mov r1, sp - bl CopyString_Limit10 - add sp, 0x14 - pop {r4} - pop {r1} - bx r1 - thumb_func_end pokemon_get_nick_ - - thumb_func_start daycare_count_pokemon -daycare_count_pokemon: @ 806FA6C - push {r4-r6,lr} - adds r6, r0, 0 - movs r5, 0 - movs r4, 0 -_0806FA74: - movs r0, 0x8C - muls r0, r4 - adds r0, r6, r0 - movs r1, 0xB - bl pokemon_getattr_encrypted - cmp r0, 0 - beq _0806FA8A - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_0806FA8A: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _0806FA74 - adds r0, r5, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end daycare_count_pokemon - - thumb_func_start sub_806FA9C -sub_806FA9C: @ 806FA9C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r9, r0 - mov r10, r1 - movs r7, 0 - movs r5, 0 - mov r6, r10 - adds r6, 0x74 - movs r0, 0x1 - mov r8, r0 -_0806FAB6: - movs r0, 0x8C - muls r0, r5 - mov r1, r9 - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr_encrypted - cmp r0, 0 - beq _0806FAE4 - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_getattr_encrypted - adds r1, r0, 0 - cmp r1, 0 - bne _0806FAE4 - lsls r0, r5, 1 - adds r0, r6, r0 - b _0806FAEA -_0806FAE4: - lsls r0, r5, 1 - adds r0, r6, r0 - mov r1, r8 -_0806FAEA: - strh r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bls _0806FAB6 - mov r0, r10 - str r7, [r0, 0x70] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_806FA9C - - thumb_func_start daycare_empty_slot -@ u8 daycare_empty_slot(struct daycare_mon *dayCareMons) -daycare_empty_slot: @ 806FB08 - push {r4,r5,lr} - adds r5, r0, 0 - movs r4, 0 -_0806FB0E: - movs r0, 0x8C - muls r0, r4 - adds r0, r5, r0 - movs r1, 0xB - bl pokemon_getattr_encrypted - cmp r0, 0 - bne _0806FB24 - lsls r0, r4, 24 - asrs r0, 24 - b _0806FB32 -_0806FB24: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _0806FB0E - movs r0, 0x1 - negs r0, r0 -_0806FB32: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end daycare_empty_slot - - thumb_func_start sub_806FB38 -@ void sub_806FB38(struct pokemon *mon, struct daycare_mon *dayCareMon) -sub_806FB38: @ 806FB38 - push {r4-r6,lr} - adds r6, r0, 0 - adds r5, r1, 0 - bl sub_80D43F0 - lsls r0, 24 - cmp r0, 0 - beq _0806FBBC - adds r0, r5, 0 - adds r0, 0x74 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - adds r4, r5, 0 - adds r4, 0x7C - adds r0, r6, 0 - adds r1, r4, 0 - bl pokemon_get_nick - adds r0, r4, 0 - bl StripExtendedControlCodes - adds r4, 0xB - ldrb r1, [r4] - movs r0, 0x10 - negs r0, r0 - ands r0, r1 - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] - adds r0, r6, 0 - movs r1, 0x3 - bl pokemon_getattr - lsls r0, 4 - ldrb r2, [r4] - movs r1, 0xF - ands r1, r2 - orrs r1, r0 - strb r1, [r4] - adds r0, r6, 0 - movs r1, 0x40 - bl pokemon_getattr - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005d8c - ldr r1, [r1] - lsls r2, r0, 3 - adds r2, r0 - lsls r2, 2 - adds r1, r2 - adds r0, r5, 0 - adds r0, 0x50 - ldr r2, =0x00002be0 - adds r1, r2 - ldm r1!, {r2-r4} - stm r0!, {r2-r4} - ldm r1!, {r2-r4} - stm r0!, {r2-r4} - ldm r1!, {r2-r4} - stm r0!, {r2-r4} - adds r0, r6, 0 - bl sub_80D4680 -_0806FBBC: - adds r0, r5, 0 - adds r1, r6, 0 - movs r2, 0x50 - bl memcpy - adds r0, r5, 0 - bl pokemon_restore_pp - adds r1, r5, 0 - adds r1, 0x88 - movs r0, 0 - str r0, [r1] - adds r0, r6, 0 - bl zero_pokemon_struct - bl party_compaction - bl calc_player_party_count - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806FB38 - - thumb_func_start daycare_send -@ void daycare_send(struct pokemon *mon, struct daycare_mon *dayCareMons) -daycare_send: @ 806FBF4 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - adds r0, r4, 0 - bl daycare_empty_slot - lsls r0, 24 - asrs r0, 24 - movs r1, 0x8C - muls r0, r1 - adds r4, r0 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_806FB38 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end daycare_send - - thumb_func_start daycare_send_selected_pokemon -daycare_send_selected_pokemon: @ 806FC18 - push {lr} - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x03005d8c - ldr r1, [r1] - ldr r2, =0x00003030 - adds r1, r2 - bl daycare_send - pop {r0} - bx r0 - .pool - thumb_func_end daycare_send_selected_pokemon - - thumb_func_start sub_806FC48 -sub_806FC48: @ 806FC48 - push {r4-r6,lr} - adds r5, r0, 0 - adds r4, r5, 0 - adds r4, 0x8C - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr_encrypted - cmp r0, 0 - beq _0806FC9E - adds r0, r5, 0 - movs r1, 0xB - bl pokemon_getattr_encrypted - adds r6, r0, 0 - cmp r6, 0 - bne _0806FC9E - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x50 - bl memcpy - adds r0, r4, 0 - bl zero_pokemon_boxed_data - adds r4, 0x50 - adds r0, r5, 0 - adds r0, 0x50 - adds r1, r4, 0 - movs r2, 0x38 - bl memcpy - adds r2, r5, 0 - adds r2, 0x88 - movs r0, 0x8A - lsls r0, 1 - adds r1, r5, r0 - ldr r0, [r1] - str r0, [r2] - str r6, [r1] - adds r0, r4, 0 - bl sub_806FF80 -_0806FC9E: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_806FC48 - - thumb_func_start sub_806FCA4 -sub_806FCA4: @ 806FCA4 - push {r4-r7,lr} - adds r4, r0, 0 - movs r5, 0 - ldr r7, =0x0000ffff -_0806FCAC: - adds r0, r4, 0 - bl sub_806DF74 - lsls r0, 24 - cmp r0, 0 - beq _0806FCE8 - movs r6, 0x1 - adds r5, 0x1 - b _0806FCD4 - .pool -_0806FCC4: - movs r6, 0 - cmp r0, r7 - bne _0806FCD4 - ldr r0, =0x020244e2 - ldrh r1, [r0] - adds r0, r4, 0 - bl sub_8069424 -_0806FCD4: - adds r0, r4, 0 - adds r1, r6, 0 - bl sub_8069318 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _0806FCC4 - cmp r5, 0x63 - ble _0806FCAC -_0806FCE8: - adds r0, r4, 0 - bl pokemon_calc_effective_stats - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806FCA4 - - thumb_func_start sub_806FCF8 -sub_806FCF8: @ 806FCF8 - push {r4-r7,lr} - sub sp, 0x68 - adds r5, r0, 0 - ldr r1, =0x02021cc4 - bl pokemon_get_nick_ - adds r0, r5, 0 - movs r1, 0xB - bl pokemon_getattr_encrypted - lsls r0, 16 - lsrs r7, r0, 16 - adds r0, r5, 0 - mov r1, sp - bl sub_8069004 - mov r0, sp - movs r1, 0x38 - bl pokemon_getattr - cmp r0, 0x64 - beq _0806FD46 - mov r0, sp - movs r1, 0x19 - bl pokemon_getattr - adds r1, r5, 0 - adds r1, 0x88 - ldr r1, [r1] - adds r0, r1 - str r0, [sp, 0x64] - add r2, sp, 0x64 - mov r0, sp - movs r1, 0x19 - bl pokemon_setattr - mov r0, sp - bl sub_806FCA4 -_0806FD46: - ldr r0, =0x020244ec - movs r1, 0xFA - lsls r1, 1 - adds r6, r0, r1 - adds r0, r6, 0 - mov r1, sp - movs r2, 0x64 - bl memcpy - adds r0, r5, 0 - adds r0, 0x70 - ldrh r0, [r0] - cmp r0, 0 - beq _0806FD74 - adds r4, r5, 0 - adds r4, 0x50 - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_80D460C - adds r0, r4, 0 - bl sub_806FF80 -_0806FD74: - adds r0, r5, 0 - bl zero_pokemon_boxed_data - adds r1, r5, 0 - adds r1, 0x88 - movs r0, 0 - str r0, [r1] - bl party_compaction - bl calc_player_party_count - adds r0, r7, 0 - add sp, 0x68 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806FCF8 - - thumb_func_start sub_806FD9C -sub_806FD9C: @ 806FD9C - push {r4,r5,lr} - adds r5, r0, 0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x8C - muls r0, r1 - adds r0, r5, r0 - bl sub_806FCF8 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl sub_806FC48 - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_806FD9C - - thumb_func_start sub_806FDC4 -sub_806FDC4: @ 806FDC4 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003030 - adds r0, r1 - ldr r1, =0x020375e0 - ldrb r1, [r1] - bl sub_806FD9C - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - .pool - thumb_func_end sub_806FDC4 - - thumb_func_start sub_806FDEC -sub_806FDEC: @ 806FDEC - push {r4,r5,lr} - sub sp, 0x54 - adds r4, r0, 0 - adds r5, r1, 0 - mov r0, sp - adds r1, r4, 0 - movs r2, 0x50 - bl memcpy - adds r0, r4, 0 - movs r1, 0x19 - bl pokemon_getattr_encrypted - adds r0, r5 - str r0, [sp, 0x50] - add r2, sp, 0x50 - mov r0, sp - movs r1, 0x19 - bl pokemon_setattr_encrypted - mov r0, sp - bl sub_80690C0 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x54 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_806FDEC - - thumb_func_start sub_806FE28 -sub_806FE28: @ 806FE28 - push {r4,r5,lr} - adds r5, r0, 0 - bl sub_80690C0 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - adds r0, 0x88 - ldr r1, [r0] - adds r0, r5, 0 - bl sub_806FDEC - lsls r0, 24 - lsrs r0, 24 - subs r0, r4 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_806FE28 - - thumb_func_start sub_806FE54 -sub_806FE54: @ 806FE54 - push {r4,r5,lr} - adds r5, r0, 0 - bl sub_806FE28 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x02021dc4 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r1, =0x02021cc4 - adds r0, r5, 0 - bl pokemon_get_nick_ - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806FE54 - - thumb_func_start sub_806FE88 -sub_806FE88: @ 806FE88 - push {r4,r5,lr} - adds r5, r0, 0 - bl sub_806FE28 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =0x02021cc4 - adds r0, r5, 0 - bl pokemon_get_nick_ - movs r0, 0x64 - muls r4, r0 - adds r4, 0x64 - ldr r0, =0x02021dc4 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x5 - bl ConvertIntToDecimalString - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806FE88 - - thumb_func_start sub_806FEC0 -sub_806FEC0: @ 806FEC0 - push {lr} - lsls r1, 24 - lsrs r1, 24 - movs r2, 0x8C - muls r1, r2 - adds r0, r1 - bl sub_806FE88 - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_806FEC0 - - thumb_func_start sub_806FED8 -sub_806FED8: @ 806FED8 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003030 - adds r0, r1 - ldr r1, =0x020375e0 - ldrb r1, [r1] - bl sub_806FEC0 - ldr r1, =0x020375e2 - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_806FED8 - - thumb_func_start sub_806FF04 -sub_806FF04: @ 806FF04 - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x03005d8c - ldr r2, [r1] - ldr r1, =0x000030b8 - adds r3, r2, r1 - ldr r1, [r3] - adds r1, r0 - str r1, [r3] - ldr r1, =0x00003144 - adds r2, r1 - ldr r1, [r2] - adds r1, r0 - str r1, [r2] - bx lr - .pool - thumb_func_end sub_806FF04 - - thumb_func_start sub_806FF30 -sub_806FF30: @ 806FF30 - push {r4-r6,lr} - ldr r6, =0x03005d8c - ldr r5, =0x020375e0 - ldrh r0, [r5] - movs r4, 0x8C - adds r1, r0, 0 - muls r1, r4 - ldr r0, =0x00003030 - adds r1, r0 - ldr r0, [r6] - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr_encrypted - cmp r0, 0 - bne _0806FF60 - movs r0, 0 - b _0806FF76 - .pool -_0806FF60: - ldrh r0, [r5] - adds r1, r0, 0 - muls r1, r4 - ldr r0, =0x00003030 - adds r1, r0 - ldr r0, [r6] - adds r0, r1 - bl sub_806FE54 - lsls r0, 24 - lsrs r0, 24 -_0806FF76: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806FF30 - - thumb_func_start sub_806FF80 -sub_806FF80: @ 806FF80 - push {lr} - movs r3, 0 - movs r2, 0x7 - adds r1, r0, 0 - adds r1, 0x2B -_0806FF8A: - strb r3, [r1] - subs r1, 0x1 - subs r2, 0x1 - cmp r2, 0 - bge _0806FF8A - adds r2, r0, 0 - adds r2, 0x2C - movs r3, 0 - adds r1, r0, 0 - adds r1, 0x36 -_0806FF9E: - strb r3, [r1] - subs r1, 0x1 - cmp r1, r2 - bge _0806FF9E - bl sub_80D439C - pop {r0} - bx r0 - thumb_func_end sub_806FF80 - - thumb_func_start sub_806FFB0 -sub_806FFB0: @ 806FFB0 - push {r4,lr} - adds r4, r0, 0 - bl zero_pokemon_boxed_data - adds r1, r4, 0 - adds r1, 0x88 - movs r0, 0 - str r0, [r1] - adds r4, 0x50 - adds r0, r4, 0 - bl sub_806FF80 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_806FFB0 - - thumb_func_start sub_806FFD0 -sub_806FFD0: @ 806FFD0 - push {r4-r6,lr} - adds r5, r0, 0 - movs r4, 0 - movs r6, 0x8C -_0806FFD8: - adds r0, r4, 0 - muls r0, r6 - adds r0, r5, r0 - bl sub_806FFB0 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _0806FFD8 - movs r1, 0x8C - lsls r1, 1 - adds r0, r5, r1 - movs r1, 0 - str r1, [r0] - movs r2, 0x8E - lsls r2, 1 - adds r0, r5, r2 - strb r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_806FFD0 - - thumb_func_start sub_8070004 -sub_8070004: @ 8070004 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 16 - lsrs r2, r0, 16 - movs r0, 0 - mov r8, r0 - ldr r0, =gEvolutionTable - mov r12, r0 -_08070016: - movs r7, 0 - movs r6, 0x1 - movs r4, 0x80 - lsls r4, 9 - movs r5, 0x28 - mov r3, r12 - adds r3, 0x28 -_08070024: - movs r1, 0 - ldrh r0, [r3, 0x4] - cmp r0, r2 - bne _08070034 - lsrs r2, r4, 16 - b _08070060 - .pool -_08070034: - adds r1, 0x1 - cmp r1, 0x4 - bgt _0807004A - lsls r0, r1, 3 - adds r0, r5 - add r0, r12 - ldrh r0, [r0, 0x4] - cmp r0, r2 - bne _08070034 - lsrs r2, r4, 16 - movs r7, 0x1 -_0807004A: - cmp r7, 0 - bne _08070060 - movs r0, 0x80 - lsls r0, 9 - adds r4, r0 - adds r5, 0x28 - adds r3, 0x28 - adds r6, 0x1 - ldr r0, =0x0000019b - cmp r6, r0 - ble _08070024 -_08070060: - movs r0, 0xCE - lsls r0, 1 - cmp r6, r0 - beq _08070072 - movs r0, 0x1 - add r8, r0 - mov r0, r8 - cmp r0, 0x4 - ble _08070016 -_08070072: - adds r0, r2, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8070004 - - thumb_func_start sub_8070084 -sub_8070084: @ 8070084 - push {r4-r7,lr} - sub sp, 0x8 - adds r6, r0, 0 - movs r7, 0x1 - negs r7, r7 - movs r4, 0 -_08070090: - movs r0, 0x8C - muls r0, r4 - adds r0, r6, r0 - bl pokemon_roll_gender - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFE - bne _080700A4 - adds r7, r4, 0 -_080700A4: - adds r4, 0x1 - cmp r4, 0x1 - ble _08070090 - movs r5, 0 - movs r4, 0 -_080700AE: - movs r0, 0x8C - muls r0, r4 - adds r0, r6, r0 - movs r1, 0xB - bl pokemon_getattr_encrypted - lsls r1, r4, 2 - add r1, sp - str r0, [r1] - cmp r0, 0x84 - bne _080700C8 - adds r5, 0x1 - adds r7, r4, 0 -_080700C8: - adds r4, 0x1 - cmp r4, 0x1 - ble _080700AE - cmp r5, 0x2 - bne _080700E2 - bl GenerateRandomNumber - lsls r0, 16 - ldr r1, =0x7ffe0000 - movs r7, 0x1 - cmp r0, r1 - bls _080700E2 - movs r7, 0 -_080700E2: - movs r0, 0x8C - muls r0, r7 - adds r0, r6, r0 - movs r1, 0xC - bl pokemon_getattr_encrypted - cmp r0, 0xC3 - bne _080700FE - bl GenerateRandomNumber - lsls r0, 16 - ldr r1, =0x7ffe0000 - cmp r0, r1 - bls _08070108 -_080700FE: - movs r0, 0x1 - negs r0, r0 - b _0807010A - .pool -_08070108: - adds r0, r7, 0 -_0807010A: - add sp, 0x8 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8070084 - - thumb_func_start sub_8070114 -sub_8070114: @ 8070114 - push {r4-r7,lr} - adds r5, r0, 0 - movs r6, 0 - ldr r0, =0x030022c0 - ldrh r0, [r0, 0x24] - bl SeedRng2 - adds r0, r5, 0 - bl sub_8070084 - adds r1, r0, 0 - cmp r1, 0 - bge _08070160 - bl GenerateRandomNumber2 - adds r4, r0, 0 - bl GenerateRandomNumber - movs r1, 0x8C - lsls r1, 1 - adds r5, r1 - lsls r4, 16 - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x0000fffe - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - adds r0, 0x1 - orrs r4, r0 - str r4, [r5] - b _080701AC - .pool -_08070160: - movs r0, 0x8C - muls r0, r1 - adds r0, r5, r0 - movs r1, 0 - movs r2, 0 - bl pokemon_getattr_encrypted - bl GetNatureFromPersonality - lsls r0, 24 - lsrs r7, r0, 24 -_08070176: - bl GenerateRandomNumber2 - adds r4, r0, 0 - bl GenerateRandomNumber - lsls r4, 16 - lsls r0, 16 - lsrs r0, 16 - orrs r4, r0 - adds r0, r4, 0 - bl GetNatureFromPersonality - lsls r0, 24 - lsrs r0, 24 - cmp r7, r0 - bne _0807019A - cmp r4, 0 - bne _080701A4 -_0807019A: - adds r6, 0x1 - movs r0, 0x96 - lsls r0, 4 - cmp r6, r0 - ble _08070176 -_080701A4: - movs r1, 0x8C - lsls r1, 1 - adds r0, r5, r1 - str r4, [r0] -_080701AC: - movs r0, 0x86 - bl FlagSet - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8070114 - - thumb_func_start sub_80701B8 -sub_80701B8: @ 80701B8 - push {r4,lr} - adds r4, r0, 0 - bl GenerateRandomNumber - movs r1, 0x8C - lsls r1, 1 - adds r4, r1 - movs r2, 0x80 - lsls r2, 8 - adds r1, r2, 0 - orrs r0, r1 - lsls r0, 16 - lsrs r0, 16 - str r0, [r4] - movs r0, 0x86 - bl FlagSet - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80701B8 - - thumb_func_start sub_80701E0 -sub_80701E0: @ 80701E0 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003030 - adds r0, r1 - bl sub_8070114 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80701E0 - - thumb_func_start sub_80701FC -sub_80701FC: @ 80701FC - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003030 - adds r0, r1 - bl sub_80701B8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80701FC - - thumb_func_start sub_8070218 -sub_8070218: @ 8070218 - push {r4,lr} - sub sp, 0x8 - adds r4, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r1, r4, r1 - movs r0, 0xFF - strb r0, [r1] - movs r2, 0 -_0807022A: - mov r1, sp - adds r0, r1, r2 - adds r1, r4, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x5 - ble _0807022A - movs r3, 0 - movs r2, 0 -_0807023E: - mov r1, sp - adds r0, r1, r2 - ldrb r1, [r0] - adds r0, r1, 0 - cmp r0, 0xFF - beq _08070250 - adds r0, r4, r3 - strb r1, [r0] - adds r3, 0x1 -_08070250: - adds r2, 0x1 - cmp r2, 0x5 - ble _0807023E - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8070218 - - thumb_func_start sub_8070260 -sub_8070260: @ 8070260 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x14 - mov r9, r0 - mov r8, r1 - movs r5, 0 - add r1, sp, 0x4 - add r7, sp, 0xC - adds r2, r1, 0 -_08070276: - adds r0, r2, r5 - strb r5, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _08070276 - movs r5, 0 - adds r6, r1, 0 -_08070288: - bl GenerateRandomNumber - mov r1, sp - adds r4, r1, r5 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x6 - subs r1, r5 - bl __modsi3 - adds r0, r6, r0 - ldrb r0, [r0] - strb r0, [r4] - adds r0, r6, 0 - adds r1, r5, 0 - bl sub_8070218 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _08070288 - movs r5, 0 - movs r4, 0x1 -_080702B8: - bl GenerateRandomNumber - adds r1, r7, r5 - lsls r0, 16 - lsrs r0, 16 - ands r0, r4 - strb r0, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _080702B8 - movs r5, 0 -_080702D2: - mov r1, sp - adds r0, r1, r5 - ldrb r0, [r0] - cmp r0, 0x5 - bhi _080703AE - lsls r0, 2 - ldr r1, =_080702EC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080702EC: - .4byte _08070304 - .4byte _08070322 - .4byte _0807033C - .4byte _08070356 - .4byte _08070370 - .4byte _08070390 -_08070304: - adds r0, r7, r5 - ldrb r1, [r0] - movs r0, 0x8C - muls r0, r1 - add r0, r8 - movs r1, 0x27 - bl pokemon_getattr_encrypted - add r2, sp, 0x10 - strb r0, [r2] - mov r0, r9 - movs r1, 0x27 - bl pokemon_setattr - b _080703AE -_08070322: - add r4, sp, 0x10 - adds r0, r7, r5 - ldrb r1, [r0] - movs r0, 0x8C - muls r0, r1 - add r0, r8 - movs r1, 0x28 - bl pokemon_getattr_encrypted - strb r0, [r4] - mov r0, r9 - movs r1, 0x28 - b _08070388 -_0807033C: - add r4, sp, 0x10 - adds r0, r7, r5 - ldrb r1, [r0] - movs r0, 0x8C - muls r0, r1 - add r0, r8 - movs r1, 0x29 - bl pokemon_getattr_encrypted - strb r0, [r4] - mov r0, r9 - movs r1, 0x29 - b _08070388 -_08070356: - add r4, sp, 0x10 - adds r0, r7, r5 - ldrb r1, [r0] - movs r0, 0x8C - muls r0, r1 - add r0, r8 - movs r1, 0x2A - bl pokemon_getattr_encrypted - strb r0, [r4] - mov r0, r9 - movs r1, 0x2A - b _08070388 -_08070370: - add r4, sp, 0x10 - adds r0, r7, r5 - ldrb r1, [r0] - movs r0, 0x8C - muls r0, r1 - add r0, r8 - movs r1, 0x2B - bl pokemon_getattr_encrypted - strb r0, [r4] - mov r0, r9 - movs r1, 0x2B -_08070388: - adds r2, r4, 0 - bl pokemon_setattr - b _080703AE -_08070390: - add r4, sp, 0x10 - adds r0, r7, r5 - ldrb r1, [r0] - movs r0, 0x8C - muls r0, r1 - add r0, r8 - movs r1, 0x2C - bl pokemon_getattr_encrypted - strb r0, [r4] - mov r0, r9 - movs r1, 0x2C - adds r2, r4, 0 - bl pokemon_setattr -_080703AE: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _080702D2 - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8070260 - - thumb_func_start pokemon_get_eggmoves -pokemon_get_eggmoves: @ 80703C8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r8, r1 - movs r6, 0 - movs r4, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r3, r0, 16 - movs r2, 0 - ldr r5, =gEggMoves - ldrh r1, [r5] - ldr r7, =0x00004e20 - adds r0, r3, r7 - cmp r1, r0 - bne _080703F8 - movs r4, 0x1 - b _0807041A - .pool -_080703F8: - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, =0x00000471 - ldr r5, =gEggMoves - cmp r2, r0 - bhi _0807041A - lsls r0, r2, 1 - adds r0, r5 - ldrh r1, [r0] - ldr r7, =0x00004e20 - adds r0, r3, r7 - cmp r1, r0 - bne _080703F8 - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 -_0807041A: - movs r2, 0 - lsls r0, r4, 1 - adds r0, r5 - ldrh r0, [r0] - ldr r1, =0x00004e20 - cmp r0, r1 - bhi _08070456 - adds r7, r5, 0 - adds r3, r1, 0 -_0807042C: - lsls r1, r2, 1 - add r1, r8 - adds r0, r4, r2 - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x9 - bhi _08070456 - adds r0, r4, r2 - lsls r0, 1 - adds r0, r5 - ldrh r0, [r0] - cmp r0, r3 - bls _0807042C -_08070456: - lsls r0, r6, 24 - lsrs r0, 24 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end pokemon_get_eggmoves - - thumb_func_start daycare_build_child_moveset -daycare_build_child_moveset: @ 8070470 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - adds r7, r0, 0 - mov r10, r1 - mov r9, r2 - movs r0, 0 - str r0, [sp] - movs r6, 0 - ldr r5, =0x02024a4c - movs r2, 0 - ldr r4, =0x02024a28 - ldr r3, =0x02024a30 -_08070490: - lsls r1, r6, 1 - adds r0, r1, r5 - strh r2, [r0] - adds r0, r1, r4 - strh r2, [r0] - adds r1, r3 - strh r2, [r1] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x3 - bls _08070490 - movs r6, 0 - ldr r2, =0x02024a38 - movs r1, 0 -_080704AE: - lsls r0, r6, 1 - adds r0, r2 - strh r1, [r0] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x9 - bls _080704AE - movs r6, 0 - ldr r2, =0x020249c4 - movs r1, 0 -_080704C4: - lsls r0, r6, 1 - adds r0, r2 - strh r1, [r0] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x31 - bls _080704C4 - adds r0, r7, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x020249c4 - bl sub_806E204 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - movs r6, 0 - ldr r1, =0x02024a28 - mov r8, r1 -_080704F2: - adds r5, r6, 0 - adds r5, 0xD - mov r0, r10 - adds r1, r5, 0 - bl pokemon_getattr_encrypted - lsls r4, r6, 1 - mov r2, r8 - adds r1, r4, r2 - strh r0, [r1] - mov r0, r9 - adds r1, r5, 0 - bl pokemon_getattr_encrypted - ldr r1, =0x02024a4c - adds r4, r1 - strh r0, [r4] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x3 - bls _080704F2 - ldr r1, =0x02024a38 - adds r0, r7, 0 - bl pokemon_get_eggmoves - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r6, 0 -_0807052E: - ldr r0, =0x02024a28 - lsls r1, r6, 1 - adds r2, r1, r0 - ldrh r1, [r2] - mov r9, r0 - cmp r1, 0 - beq _080705A4 - movs r5, 0 - cmp r5, r8 - bcs _08070596 - adds r4, r2, 0 - ldr r2, =0x0000ffff -_08070546: - ldr r0, =0x02024a38 - lsls r1, r5, 1 - adds r1, r0 - ldrh r0, [r4] - ldrh r1, [r1] - cmp r0, r1 - bne _0807058C - adds r1, r0, 0 - adds r0, r7, 0 - str r2, [sp, 0x8] - bl pokemon_moveset_pad_ - lsls r0, 16 - lsrs r0, 16 - ldr r2, [sp, 0x8] - cmp r0, r2 - bne _08070596 - ldrh r1, [r4] - adds r0, r7, 0 - bl sub_8069424 - b _08070596 - .pool -_0807058C: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, r8 - bcc _08070546 -_08070596: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r3, =0x02024a28 - mov r9, r3 - cmp r6, 0x3 - bls _0807052E -_080705A4: - movs r6, 0 -_080705A6: - lsls r0, r6, 1 - mov r2, r9 - adds r1, r0, r2 - ldrh r1, [r1] - adds r2, r0, 0 - adds r6, 0x1 - mov r8, r6 - cmp r1, 0 - beq _08070608 - movs r5, 0 - ldr r0, =0x02024a28 - adds r4, r2, r0 - ldr r6, =0x0000ffff - mov r9, r0 -_080705C2: - ldr r3, =0x00000121 - adds r0, r5, r3 - lsls r0, 16 - lsrs r0, 16 - bl ItemIdToBattleMoveId - ldrh r1, [r4] - lsls r0, 16 - lsrs r0, 16 - cmp r1, r0 - bne _080705FE - lsls r1, r5, 24 - lsrs r1, 24 - adds r0, r7, 0 - bl sub_806E00C - cmp r0, 0 - beq _080705FE - ldrh r1, [r4] - adds r0, r7, 0 - bl pokemon_moveset_pad_ - lsls r0, 16 - lsrs r0, 16 - cmp r0, r6 - bne _080705FE - ldrh r1, [r4] - adds r0, r7, 0 - bl sub_8069424 -_080705FE: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x39 - bls _080705C2 -_08070608: - mov r1, r8 - lsls r0, r1, 16 - lsrs r6, r0, 16 - cmp r6, 0x3 - bls _080705A6 - movs r6, 0 - mov r2, r9 - ldrh r0, [r2] - ldr r3, =0x02024a30 - mov r10, r3 - cmp r0, 0 - beq _08070672 - mov r4, r9 - ldr r0, =0x02024a4c - mov r9, r0 - mov r12, r10 -_08070628: - movs r5, 0 - lsls r2, r6, 1 - adds r6, 0x1 - mov r8, r6 - adds r3, r2, r4 -_08070632: - lsls r0, r5, 1 - add r0, r9 - ldrh r2, [r3] - adds r1, r2, 0 - ldrh r0, [r0] - cmp r1, r0 - bne _08070654 - cmp r1, 0 - beq _08070654 - ldr r1, [sp] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp] - lsls r1, 1 - add r1, r12 - strh r2, [r1] -_08070654: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x3 - bls _08070632 - mov r1, r8 - lsls r0, r1, 16 - lsrs r6, r0, 16 - cmp r6, 0x3 - bhi _08070672 - lsls r0, r6, 1 - adds r0, r4 - ldrh r0, [r0] - cmp r0, 0 - bne _08070628 -_08070672: - movs r6, 0 - mov r2, r10 - ldrh r0, [r2] - cmp r0, 0 - beq _080706FC -_0807067C: - movs r5, 0 - adds r3, r6, 0x1 - mov r8, r3 - ldr r0, [sp, 0x4] - cmp r5, r0 - bcs _080706E4 - ldr r2, =0x0000ffff -_0807068A: - ldr r1, =0x020249c4 - lsls r0, r5, 1 - adds r0, r1 - ldrh r1, [r0] - cmp r1, 0 - beq _080706D8 - lsls r0, r6, 1 - mov r3, r10 - adds r4, r0, r3 - ldrh r0, [r4] - cmp r0, r1 - bne _080706D8 - adds r1, r0, 0 - adds r0, r7, 0 - str r2, [sp, 0x8] - bl pokemon_moveset_pad_ - lsls r0, 16 - lsrs r0, 16 - ldr r2, [sp, 0x8] - cmp r0, r2 - bne _080706E4 - ldrh r1, [r4] - adds r0, r7, 0 - bl sub_8069424 - b _080706E4 - .pool -_080706D8: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, [sp, 0x4] - cmp r5, r0 - bcc _0807068A -_080706E4: - mov r1, r8 - lsls r0, r1, 16 - lsrs r6, r0, 16 - cmp r6, 0x3 - bhi _080706FC - ldr r0, =0x02024a30 - lsls r1, r6, 1 - adds r1, r0 - ldrh r1, [r1] - mov r10, r0 - cmp r1, 0 - bne _0807067C -_080706FC: - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end daycare_build_child_moveset - - thumb_func_start sub_8070710 -sub_8070710: @ 8070710 - adds r2, r0, 0 - movs r1, 0x8C - lsls r1, 1 - adds r0, r2, r1 - movs r1, 0 - str r1, [r0] - movs r3, 0x8E - lsls r3, 1 - adds r0, r2, r3 - strb r1, [r0] - bx lr - thumb_func_end sub_8070710 - - thumb_func_start sub_8070728 -sub_8070728: @ 8070728 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003030 - adds r0, r1 - bl sub_8070710 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8070728 - - thumb_func_start incense_effects -incense_effects: @ 8070744 - push {r4-r7,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrh r1, [r4] - movs r7, 0xB4 - lsls r7, 1 - cmp r1, r7 - beq _0807075C - movs r0, 0xAF - lsls r0, 1 - cmp r1, r0 - bne _0807079E -_0807075C: - adds r0, r5, 0 - movs r1, 0xC - bl pokemon_getattr_encrypted - lsls r0, 16 - lsrs r6, r0, 16 - adds r0, r5, 0 - adds r0, 0x8C - movs r1, 0xC - bl pokemon_getattr_encrypted - lsls r0, 16 - lsrs r2, r0, 16 - ldrh r0, [r4] - cmp r0, r7 - bne _08070788 - cmp r6, 0xDD - beq _08070788 - cmp r2, 0xDD - beq _08070788 - movs r0, 0xCA - strh r0, [r4] -_08070788: - ldrh r1, [r4] - movs r0, 0xAF - lsls r0, 1 - cmp r1, r0 - bne _0807079E - cmp r6, 0xDC - beq _0807079E - cmp r2, 0xDC - beq _0807079E - movs r0, 0xB7 - strh r0, [r4] -_0807079E: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end incense_effects - - thumb_func_start sub_80707A4 -sub_80707A4: @ 80707A4 - push {r4-r6,lr} - adds r6, r0, 0 - adds r4, r1, 0 - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_getattr_encrypted - adds r5, r0, 0 - adds r4, 0x8C - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_getattr_encrypted - cmp r5, 0xCA - beq _080707C6 - cmp r0, 0xCA - bne _080707E2 -_080707C6: - movs r4, 0xAC - lsls r4, 1 - adds r0, r6, 0 - adds r1, r4, 0 - bl pokemon_moveset_pad_ - lsls r0, 16 - ldr r1, =0xffff0000 - cmp r0, r1 - bne _080707E2 - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_8069424 -_080707E2: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80707A4 - - thumb_func_start sub_80707EC -sub_80707EC: @ 80707EC - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r7, r0, 0 - adds r6, r1, 0 - movs r4, 0 - movs r0, 0x1 - mov r8, r0 -_080707FE: - movs r0, 0x8C - muls r0, r4 - adds r5, r7, r0 - adds r0, r5, 0 - movs r1, 0xB - bl pokemon_getattr_encrypted - lsls r1, r4, 1 - add r1, sp - strh r0, [r1] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x84 - bne _08070826 - adds r0, r4, 0 - mov r1, r8 - eors r0, r1 - strb r0, [r6] - strb r4, [r6, 0x1] - b _0807083E -_08070826: - adds r0, r5, 0 - bl pokemon_roll_gender - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFE - bne _0807083E - strb r4, [r6] - adds r0, r4, 0 - mov r1, r8 - eors r0, r1 - strb r0, [r6, 0x1] -_0807083E: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x1 - bls _080707FE - ldrb r0, [r6] - lsls r0, 1 - add r0, sp - ldrh r0, [r0] - bl sub_8070004 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x1D - bne _08070870 - movs r1, 0x8C - lsls r1, 1 - adds r0, r7, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _08070870 - movs r4, 0x20 -_08070870: - ldr r0, =0x00000183 - cmp r4, r0 - bne _0807088C - movs r1, 0x8C - lsls r1, 1 - adds r0, r7, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _0807088C - movs r4, 0xC1 - lsls r4, 1 -_0807088C: - ldrb r0, [r6, 0x1] - lsls r0, 1 - add r0, sp - ldrh r0, [r0] - cmp r0, 0x84 - bne _080708B4 - ldrb r1, [r6] - movs r0, 0x8C - muls r0, r1 - adds r0, r7, r0 - bl pokemon_roll_gender - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFE - beq _080708B4 - ldrb r1, [r6, 0x1] - ldrb r0, [r6] - strb r0, [r6, 0x1] - strb r1, [r6] -_080708B4: - adds r0, r4, 0 - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80707EC - - thumb_func_start sub_80708C8 -sub_80708C8: @ 80708C8 - push {r4-r6,lr} - sub sp, 0x6C - adds r6, r0, 0 - add r5, sp, 0x64 - adds r1, r5, 0 - bl sub_80707EC - add r4, sp, 0x68 - strh r0, [r4] - adds r0, r4, 0 - adds r1, r6, 0 - bl incense_effects - ldrh r1, [r4] - mov r0, sp - adds r2, r6, 0 - bl sub_8070A0C - mov r0, sp - adds r1, r6, 0 - bl sub_8070260 - ldrb r0, [r5, 0x1] - movs r2, 0x8C - adds r1, r0, 0 - muls r1, r2 - adds r1, r6, r1 - ldrb r0, [r5] - muls r2, r0 - adds r2, r6, r2 - mov r0, sp - bl daycare_build_child_moveset - ldrh r0, [r4] - cmp r0, 0xAC - bne _08070918 - mov r0, sp - adds r1, r6, 0 - bl sub_80707A4 -_08070918: - mov r2, sp - adds r2, 0x6A - movs r0, 0x1 - strb r0, [r2] - mov r0, sp - movs r1, 0x2D - bl pokemon_setattr - ldr r0, =0x020244ec - movs r1, 0xFA - lsls r1, 1 - adds r0, r1 - mov r1, sp - movs r2, 0x64 - bl memcpy - bl party_compaction - bl calc_player_party_count - adds r0, r6, 0 - bl sub_8070710 - add sp, 0x6C - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80708C8 - - thumb_func_start sub_8070954 -sub_8070954: @ 8070954 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x18 - adds r7, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - lsls r5, 16 - lsrs r5, 16 - lsls r6, 24 - lsrs r6, 24 - movs r4, 0 - str r4, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - str r4, [sp, 0xC] - adds r1, r5, 0 - movs r2, 0x5 - movs r3, 0x20 - bl create_pokemon_set_level - movs r0, 0x12 - add r0, sp - mov r8, r0 - strb r4, [r0] - movs r1, 0x4 - add r0, sp, 0x10 - strh r1, [r0] - mov r4, sp - adds r4, 0x13 - movs r0, 0x1 - mov r9, r0 - mov r0, r9 - strb r0, [r4] - adds r0, r7, 0 - movs r1, 0x26 - add r2, sp, 0x10 - bl pokemon_setattr - ldr r2, =gEggName - adds r0, r7, 0 - movs r1, 0x2 - bl pokemon_setattr - lsls r2, r5, 3 - subs r2, r5 - lsls r2, 2 - ldr r0, =gBaseStats + 0x11 @ egg cycles offset - adds r2, r0 - adds r0, r7, 0 - movs r1, 0x20 - bl pokemon_setattr - adds r0, r7, 0 - movs r1, 0x24 - mov r2, r8 - bl pokemon_setattr - adds r0, r7, 0 - movs r1, 0x3 - adds r2, r4, 0 - bl pokemon_setattr - cmp r6, 0 - beq _080709E6 - add r2, sp, 0x14 - movs r0, 0xFD - strb r0, [r2] - adds r0, r7, 0 - movs r1, 0x23 - bl pokemon_setattr -_080709E6: - mov r2, sp - adds r2, 0x15 - mov r0, r9 - strb r0, [r2] - adds r0, r7, 0 - movs r1, 0x2D - bl pokemon_setattr - add sp, 0x18 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8070954 - - thumb_func_start sub_8070A0C -sub_8070A0C: @ 8070A0C - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x14 - adds r6, r0, 0 - adds r5, r1, 0 - lsls r5, 16 - lsrs r5, 16 - movs r0, 0x8C - lsls r0, 1 - adds r2, r0 - ldr r0, [r2] - movs r1, 0x1 - mov r8, r1 - str r1, [sp] - str r0, [sp, 0x4] - movs r4, 0 - str r4, [sp, 0x8] - str r4, [sp, 0xC] - adds r0, r6, 0 - adds r1, r5, 0 - movs r2, 0x5 - movs r3, 0x20 - bl create_pokemon_set_level - movs r0, 0x12 - add r0, sp - mov r9, r0 - strb r4, [r0] - movs r1, 0x4 - add r0, sp, 0x10 - strh r1, [r0] - mov r4, sp - adds r4, 0x13 - mov r1, r8 - strb r1, [r4] - adds r0, r6, 0 - movs r1, 0x26 - add r2, sp, 0x10 - bl pokemon_setattr - ldr r2, =gEggName - adds r0, r6, 0 - movs r1, 0x2 - bl pokemon_setattr - lsls r2, r5, 3 - subs r2, r5 - lsls r2, 2 - ldr r0, =gBaseStats + 0x11 @ egg cycles offset - adds r2, r0 - adds r0, r6, 0 - movs r1, 0x20 - bl pokemon_setattr - adds r0, r6, 0 - movs r1, 0x24 - mov r2, r9 - bl pokemon_setattr - adds r0, r6, 0 - movs r1, 0x3 - adds r2, r4, 0 - bl pokemon_setattr - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8070A0C - - thumb_func_start sp0B8_daycare -sp0B8_daycare: @ 8070AA8 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003030 - adds r0, r1 - bl sub_80708C8 - pop {r0} - bx r0 - .pool - thumb_func_end sp0B8_daycare - - thumb_func_start sub_8070AC4 -sub_8070AC4: @ 8070AC4 - push {r4-r7,lr} - sub sp, 0x4 - adds r6, r0, 0 - movs r7, 0 - movs r5, 0 -_08070ACE: - movs r0, 0x8C - adds r4, r5, 0 - muls r4, r0 - adds r0, r6, r4 - movs r1, 0x5 - bl pokemon_getattr_encrypted - cmp r0, 0 - beq _08070AEE - adds r1, r6, 0 - adds r1, 0x88 - adds r1, r4 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - adds r7, 0x1 -_08070AEE: - adds r5, 0x1 - cmp r5, 0x1 - bls _08070ACE - movs r1, 0x8C - lsls r1, 1 - adds r0, r6, r1 - ldr r0, [r0] - cmp r0, 0 - bne _08070B34 - cmp r7, 0x2 - bne _08070B34 - subs r1, 0x4 - adds r0, r6, r1 - ldrb r0, [r0] - cmp r0, 0xFF - bne _08070B34 - adds r0, r6, 0 - bl daycare_relationship_score - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - muls r0, r1 - ldr r1, =0x0000ffff - bl __udivsi3 - cmp r4, r0 - bls _08070B34 - bl sub_80701E0 -_08070B34: - movs r0, 0x8E - lsls r0, 1 - adds r1, r6, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _08070BC0 - bl sub_807228C - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - ldr r0, =0x020244e9 - ldrb r0, [r0] - cmp r5, r0 - bcs _08070BC0 - ldr r4, =0x020244ec -_08070B5C: - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - beq _08070BB4 - adds r0, r4, 0 - movs r1, 0x4 - bl pokemon_getattr - cmp r0, 0 - bne _08070BB4 - adds r0, r4, 0 - movs r1, 0x20 - bl pokemon_getattr - adds r1, r0, 0 - str r1, [sp] - cmp r0, 0 - beq _08070BA8 - cmp r0, r6 - bcc _08070B98 - subs r0, r6 - b _08070B9A - .pool -_08070B98: - subs r0, r1, 0x1 -_08070B9A: - str r0, [sp] - adds r0, r4, 0 - movs r1, 0x20 - mov r2, sp - bl pokemon_setattr - b _08070BB4 -_08070BA8: - ldr r0, =0x020375e0 - strh r5, [r0] - movs r0, 0x1 - b _08070BC2 - .pool -_08070BB4: - adds r4, 0x64 - adds r5, 0x1 - ldr r0, =0x020244e9 - ldrb r0, [r0] - cmp r5, r0 - bcc _08070B5C -_08070BC0: - movs r0, 0 -_08070BC2: - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8070AC4 - - thumb_func_start sub_8070BD0 -sub_8070BD0: @ 8070BD0 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003030 - adds r0, r1 - bl sub_8070AC4 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8070BD0 - - thumb_func_start sub_8070BF0 -sub_8070BF0: @ 8070BF0 - push {lr} - movs r1, 0x8C - lsls r1, 1 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - beq _08070C00 - movs r0, 0x1 -_08070C00: - pop {r1} - bx r1 - thumb_func_end sub_8070BF0 - - thumb_func_start sub_8070C04 -sub_8070C04: @ 8070C04 - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - movs r1, 0xB - bl pokemon_getattr_encrypted - cmp r0, 0 - beq _08070C2E - ldr r1, =0x02021cc4 - adds r0, r4, 0 - bl pokemon_get_nick_ - adds r0, r4, 0 - movs r1, 0x7 - mov r2, sp - bl pokemon_getattr_encrypted - ldr r0, =0x02021ec4 - mov r1, sp - bl CopyString -_08070C2E: - adds r4, 0x8C - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr_encrypted - cmp r0, 0 - beq _08070C44 - ldr r1, =0x02021dc4 - adds r0, r4, 0 - bl pokemon_get_nick_ -_08070C44: - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8070C04 - - thumb_func_start sub_8070C58 -sub_8070C58: @ 8070C58 - push {r4,r5,lr} - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r0, 24 - movs r5, 0x64 - muls r0, r5 - ldr r4, =0x020244ec - adds r0, r4 - ldr r1, =0x02021cc4 - bl pokemon_get_nick_ - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r0, 24 - muls r0, r5 - adds r0, r4 - movs r1, 0xB - bl pokemon_getattr_encrypted - lsls r0, 16 - lsrs r0, 16 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8070C58 - - thumb_func_start sp0B5_daycare -sp0B5_daycare: @ 8070C94 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003030 - adds r0, r1 - bl sub_8070C04 - pop {r0} - bx r0 - .pool - thumb_func_end sp0B5_daycare - - thumb_func_start sp0B6_daycare -sp0B6_daycare: @ 8070CB0 - push {r4,lr} - ldr r4, =0x03005d8c - ldr r0, [r4] - ldr r1, =0x00003030 - adds r0, r1 - bl sub_8070BF0 - lsls r0, 24 - cmp r0, 0 - beq _08070CD0 - movs r0, 0x1 - b _08070CF2 - .pool -_08070CD0: - ldr r0, [r4] - ldr r1, =0x00003030 - adds r0, r1 - bl daycare_count_pokemon - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08070CEC - movs r0, 0 - b _08070CF2 - .pool -_08070CEC: - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 -_08070CF2: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sp0B6_daycare - - thumb_func_start sub_8070CF8 -sub_8070CF8: @ 8070CF8 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003030 - adds r0, r1 - bl daycare_count_pokemon - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08070D10 - movs r0, 0 -_08070D10: - pop {r1} - bx r1 - .pool - thumb_func_end sub_8070CF8 - - thumb_func_start sub_8070D1C -sub_8070D1C: @ 8070D1C - push {r4-r6,lr} - adds r5, r1, 0 - movs r4, 0 - adds r1, r0, 0 -_08070D24: - movs r3, 0 - ldrh r0, [r1] - adds r2, r5, 0 -_08070D2A: - ldrh r6, [r2] - cmp r0, r6 - bne _08070D34 - movs r0, 0x1 - b _08070D46 -_08070D34: - adds r2, 0x2 - adds r3, 0x1 - cmp r3, 0x1 - ble _08070D2A - adds r1, 0x2 - adds r4, 0x1 - cmp r4, 0x1 - ble _08070D24 - movs r0, 0 -_08070D46: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8070D1C - - thumb_func_start daycare_relationship_score -daycare_relationship_score: @ 8070D4C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x30 - str r0, [sp, 0x1C] - movs r7, 0 - mov r0, sp - adds r0, 0x8 - str r0, [sp, 0x20] - add r1, sp, 0xC - mov r9, r1 - mov r2, sp - adds r2, 0x14 - str r2, [sp, 0x24] - subs r0, 0x6 - ldr r1, =gBaseStats - mov r10, r1 - ldr r5, [sp, 0x20] - mov r8, r0 - mov r6, sp - str r2, [sp, 0x28] - mov r2, r9 - str r2, [sp, 0x2C] -_08070D7E: - movs r0, 0x8C - adds r4, r7, 0 - muls r4, r0 - ldr r0, [sp, 0x1C] - adds r4, r0, r4 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr_encrypted - strh r0, [r5] - adds r0, r4, 0 - movs r1, 0x1 - bl pokemon_getattr_encrypted - ldr r1, [sp, 0x2C] - stm r1!, {r0} - str r1, [sp, 0x2C] - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr_encrypted - adds r1, r0, 0 - ldrh r0, [r5] - bl pokemon_species_get_gender_info - lsls r0, 24 - lsrs r0, 24 - ldr r2, [sp, 0x28] - stm r2!, {r0} - str r2, [sp, 0x28] - ldrh r1, [r5] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r10 - ldrb r0, [r0, 0x14] - strh r0, [r6] - ldrh r1, [r5] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r10 - ldrb r0, [r0, 0x15] - mov r1, r8 - strh r0, [r1] - adds r5, 0x2 - movs r2, 0x4 - add r8, r2 - adds r6, 0x4 - adds r7, 0x1 - cmp r7, 0x1 - bls _08070D7E - mov r0, sp - ldrh r1, [r0] - cmp r1, 0xF - beq _08070DFC - ldrh r0, [r0, 0x4] - cmp r0, 0xF - beq _08070DFC - cmp r1, 0xD - bne _08070E04 - cmp r0, 0xD - bne _08070E08 -_08070DFC: - movs r0, 0 - b _08070E5C - .pool -_08070E04: - cmp r0, 0xD - bne _08070E14 -_08070E08: - ldr r1, [sp, 0xC] - mov r2, r9 - ldr r0, [r2, 0x4] - cmp r1, r0 - beq _08070E56 - b _08070E5A -_08070E14: - ldr r0, [sp, 0x14] - ldr r2, [sp, 0x24] - ldr r1, [r2, 0x4] - cmp r0, r1 - beq _08070DFC - cmp r0, 0xFF - beq _08070DFC - cmp r1, 0xFF - beq _08070DFC - add r1, sp, 0x4 - mov r0, sp - bl sub_8070D1C - lsls r0, 24 - cmp r0, 0 - beq _08070DFC - ldr r0, [sp, 0x20] - ldrh r1, [r0, 0x2] - ldrh r0, [r0] - cmp r0, r1 - bne _08070E4C - ldr r1, [sp, 0xC] - mov r2, r9 - ldr r0, [r2, 0x4] - cmp r1, r0 - beq _08070E5A - movs r0, 0x46 - b _08070E5C -_08070E4C: - ldr r1, [sp, 0xC] - mov r2, r9 - ldr r0, [r2, 0x4] - cmp r1, r0 - bne _08070E5A -_08070E56: - movs r0, 0x14 - b _08070E5C -_08070E5A: - movs r0, 0x32 -_08070E5C: - 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 daycare_relationship_score - - thumb_func_start daycare_relationship_score_from_savegame -daycare_relationship_score_from_savegame: @ 8070E6C - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003030 - adds r0, r1 - bl daycare_relationship_score - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end daycare_relationship_score_from_savegame - - thumb_func_start sp0B9_daycare_relationship_comment -sp0B9_daycare_relationship_comment: @ 8070E8C - push {lr} - bl daycare_relationship_score_from_savegame - lsls r0, 24 - lsrs r0, 24 - adds r2, r0, 0 - movs r1, 0 - cmp r0, 0 - bne _08070EA0 - movs r1, 0x3 -_08070EA0: - cmp r0, 0x14 - bne _08070EA6 - movs r1, 0x2 -_08070EA6: - cmp r0, 0x32 - bne _08070EAC - movs r1, 0x1 -_08070EAC: - cmp r2, 0x46 - bne _08070EB2 - movs r1, 0 -_08070EB2: - ldr r0, =0x02021fc4 - ldr r2, =gUnknown_0832B6F8 - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl CopyString - pop {r0} - bx r0 - .pool - thumb_func_end sp0B9_daycare_relationship_comment - - thumb_func_start sub_8070ECC -sub_8070ECC: @ 8070ECC - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - mov r2, sp - mov r1, sp - movs r0, 0 - strb r0, [r1, 0x1] - strb r0, [r2] - movs r3, 0 - ldrb r0, [r4] - cmp r0, 0xFF - beq _08070F10 -_08070EE8: - adds r1, r4, r3 - ldrb r0, [r1] - cmp r0, 0xB5 - bne _08070EF6 - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] -_08070EF6: - ldrb r0, [r1] - cmp r0, 0xB6 - bne _08070F02 - ldrb r0, [r2, 0x1] - adds r0, 0x1 - strb r0, [r2, 0x1] -_08070F02: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - adds r0, r4, r3 - ldrb r0, [r0] - cmp r0, 0xFF - bne _08070EE8 -_08070F10: - cmp r5, 0 - bne _08070F24 - mov r0, sp - ldrb r0, [r0] - cmp r0, 0 - beq _08070F24 - mov r0, sp - ldrb r0, [r0, 0x1] - cmp r0, 0 - beq _08070F38 -_08070F24: - cmp r5, 0xFE - bne _08070F3C - mov r0, sp - ldrb r0, [r0, 0x1] - cmp r0, 0 - beq _08070F3C - mov r0, sp - ldrb r0, [r0] - cmp r0, 0 - bne _08070F3C -_08070F38: - movs r0, 0x1 - b _08070F3E -_08070F3C: - movs r0, 0 -_08070F3E: - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8070ECC - - thumb_func_start sub_8070F48 -sub_8070F48: @ 8070F48 - push {r4,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0 - bne _08070F68 - movs r1, 0 - bl sub_8070ECC - lsls r0, 24 - cmp r0, 0 - bne _08070F84 - ldr r1, =gUnknown_0832DAC7 - b _08070F86 - .pool -_08070F68: - cmp r1, 0xFE - bne _08070F84 - adds r0, r4, 0 - movs r1, 0xFE - bl sub_8070ECC - lsls r0, 24 - cmp r0, 0 - bne _08070F84 - ldr r1, =gUnknown_0832DAC9 - b _08070F86 - .pool -_08070F84: - ldr r1, =gUnknown_0832DACB -_08070F86: - adds r0, r4, 0 - bl AppendString - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8070F48 - - thumb_func_start sub_8070F98 -sub_8070F98: @ 8070F98 - push {r4,lr} - adds r4, r0, 0 - adds r0, r1, 0 - bl pokemon_roll_gender - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_8070F48 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8070F98 - - thumb_func_start sub_8070FB4 -sub_8070FB4: @ 8070FB4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x28 - mov r8, r0 - adds r7, r1, 0 - movs r0, 0xFF - strb r0, [r7] - movs r6, 0 - add r0, sp, 0x14 - mov r9, r0 -_08070FCC: - movs r0, 0x8C - adds r4, r6, 0 - muls r4, r0 - add r4, r8 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 2 - mov r1, sp - adds r5, r1, r0 - adds r0, r4, 0 - adds r1, r5, 0 - bl pokemon_get_nick_ - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8070F98 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x1 - bls _08070FCC - adds r0, r7, 0 - mov r1, sp - bl CopyString - ldr r4, =gUnknown_085EF881 - adds r0, r7, 0 - adds r1, r4, 0 - bl AppendString - adds r0, r7, 0 - mov r1, r9 - bl AppendString - adds r0, r7, 0 - adds r1, r4, 0 - bl AppendString - ldr r1, =gUnknown_085EF883 - adds r0, r7, 0 - bl AppendString - add sp, 0x28 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8070FB4 - - thumb_func_start sub_8071038 -sub_8071038: @ 8071038 - push {r4-r6,lr} - sub sp, 0x14 - adds r6, r0, 0 - adds r4, r1, 0 - movs r0, 0xFF - strb r0, [r4] - movs r5, 0 -_08071046: - adds r0, r4, 0 - ldr r1, =gUnknown_085EF888 - bl AppendString - movs r0, 0x8C - adds r2, r5, 0 - muls r2, r0 - adds r0, r6, r2 - adds r1, r6, 0 - adds r1, 0x88 - adds r1, r2 - ldr r1, [r1] - bl sub_806FDEC - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, sp - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - adds r0, r4, 0 - mov r1, sp - bl AppendString - adds r0, r4, 0 - ldr r1, =gUnknown_085EF881 - bl AppendString - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bls _08071046 - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8071038 - - thumb_func_start sub_807109C -sub_807109C: @ 807109C - push {r4-r6,lr} - sub sp, 0x10 - str r1, [sp] - mov r1, sp - movs r5, 0 - strb r0, [r1, 0x4] - mov r0, sp - movs r6, 0x1 - movs r4, 0x1 - strb r4, [r0, 0x5] - strb r2, [r0, 0x6] - strb r3, [r0, 0x7] - strb r2, [r0, 0x8] - strb r3, [r0, 0x9] - mov r3, sp - ldrb r1, [r3, 0xC] - movs r2, 0x10 - negs r2, r2 - adds r0, r2, 0 - ands r0, r1 - strb r0, [r3, 0xC] - ldr r3, =0x03003014 - ldrb r1, [r3] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r3] - mov r0, sp - strb r5, [r0, 0xA] - strb r4, [r0, 0xB] - mov r3, sp - ldrb r1, [r3, 0xC] - movs r4, 0xF - adds r0, r4, 0 - ands r0, r1 - movs r1, 0x20 - orrs r0, r1 - strb r0, [r3, 0xC] - mov r1, sp - ldrb r0, [r1, 0xD] - ands r2, r0 - orrs r2, r6 - strb r2, [r1, 0xD] - ands r2, r4 - movs r0, 0x30 - orrs r2, r0 - strb r2, [r1, 0xD] - mov r0, sp - movs r1, 0xFF - movs r2, 0 - bl AddTextPrinter - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807109C - - thumb_func_start sub_8071110 -sub_8071110: @ 8071110 - push {r4-r6,lr} - sub sp, 0x14 - adds r5, r0, 0 - adds r4, r1, 0 - adds r6, r3, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x8C - muls r0, r2 - adds r5, r0 - adds r0, r5, 0 - mov r1, sp - bl pokemon_get_nick_ - mov r0, sp - adds r1, r5, 0 - bl sub_8070F98 - adds r0, r4, 0 - mov r1, sp - movs r2, 0x8 - adds r3, r6, 0 - bl sub_807109C - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8071110 - - thumb_func_start sub_8071148 -sub_8071148: @ 8071148 - 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 r5, 24 - lsrs r5, 24 - ldr r1, =gUnknown_085EF888 - mov r0, sp - bl CopyString - movs r0, 0x8C - adds r1, r6, 0 - muls r1, r0 - adds r0, r4, r1 - adds r4, 0x88 - adds r4, r1 - ldr r1, [r4] - bl sub_806FDEC - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - add r4, sp, 0xC - adds r0, r4, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - mov r0, sp - adds r1, r4, 0 - bl AppendString - movs r0, 0x1 - mov r1, sp - movs r2, 0x70 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - adds r0, r5, 0 - mov r1, sp - mov r3, r8 - bl sub_807109C - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8071148 - - thumb_func_start sub_80711B8 -sub_80711B8: @ 80711B8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r1, 0 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r2, 24 - lsrs r5, r2, 24 - cmp r6, 0x1 - bhi _080711F0 - ldr r0, =0x03005d8c - mov r8, r0 - ldr r0, [r0] - ldr r4, =0x00003030 - adds r0, r4 - adds r1, r7, 0 - adds r2, r6, 0 - adds r3, r5, 0 - bl sub_8071110 - mov r1, r8 - ldr r0, [r1] - adds r0, r4 - adds r1, r7, 0 - adds r2, r6, 0 - adds r3, r5, 0 - bl sub_8071148 -_080711F0: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80711B8 - - thumb_func_start c3_080469FC -c3_080469FC: @ 8071204 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - ldrb r0, [r4, 0x8] - bl ListMenuHandleInput - adds r1, r0, 0 - ldr r0, =0x030022c0 - ldrh r2, [r0, 0x2E] - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - beq _08071284 - cmp r1, 0x1 - bls _0807123C - cmp r1, 0x5 - beq _08071248 - b _0807124E - .pool -_0807123C: - ldr r0, =0x020375f0 - strh r1, [r0] - b _0807124E - .pool -_08071248: - ldr r1, =0x020375f0 - movs r0, 0x2 - strh r0, [r1] -_0807124E: - ldr r0, =0x03005e00 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r0 - ldrb r0, [r4, 0x8] - movs r1, 0 - movs r2, 0 - bl sub_81AE6C8 - ldrb r0, [r4, 0xA] - movs r1, 0x1 - bl sub_819746C - ldrb r0, [r4, 0xA] - bl RemoveWindow - adds r0, r5, 0 - bl remove_task - bl script_env_2_enable_and_set_ctx_running - b _080712B4 - .pool -_08071284: - movs r1, 0x2 - adds r0, r1, 0 - ands r0, r2 - cmp r0, 0 - beq _080712B4 - ldr r0, =0x020375f0 - strh r1, [r0] - ldrb r0, [r4, 0x8] - movs r1, 0 - movs r2, 0 - bl sub_81AE6C8 - ldrb r0, [r4, 0xA] - movs r1, 0x1 - bl sub_819746C - ldrb r0, [r4, 0xA] - bl RemoveWindow - adds r0, r5, 0 - bl remove_task - bl script_env_2_enable_and_set_ctx_running -_080712B4: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end c3_080469FC - - thumb_func_start sub_80712C0 -sub_80712C0: @ 80712C0 - push {r4,r5,lr} - sub sp, 0x18 - ldr r0, =gUnknown_0832B6C0 - bl AddWindow - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0 - bl sub_81973FC - mov r1, sp - ldr r0, =gUnknown_0832B6E0 - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - mov r0, sp - strb r4, [r0, 0x10] - movs r1, 0 - movs r2, 0 - bl ListMenuInit - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =c3_080469FC - movs r1, 0x3 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r5, [r1, 0x8] - strh r4, [r1, 0xA] - add sp, 0x18 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80712C0 - - thumb_func_start sub_8071330 -sub_8071330: @ 8071330 - push {lr} - bl sub_81B9328 - ldr r1, =0x030022c0 - ldr r0, =c2_exit_to_overworld_2_switch - str r0, [r1, 0x8] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8071330 - - thumb_func_start sub_8071348 -sub_8071348: @ 8071348 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x50 - adds r5, r0, 0 - adds r6, r1, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x3C] - movs r4, 0 - add r7, sp, 0x18 - add r0, sp, 0x30 - mov r8, r0 - movs r1, 0x31 - add r1, sp - mov r10, r1 - mov r0, sp - adds r0, 0x32 - str r0, [sp, 0x40] - mov r1, sp - adds r1, 0x34 - str r1, [sp, 0x48] - adds r0, 0x1 - str r0, [sp, 0x44] - adds r1, 0x4 - str r1, [sp, 0x4C] -_08071386: - adds r1, r4, 0 - adds r1, 0xD - adds r0, r5, 0 - bl pokemon_getattr - lsls r1, r4, 1 - add r1, sp - adds r1, 0x10 - strh r0, [r1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _08071386 - adds r0, r5, 0 - movs r1, 0 - bl pokemon_getattr - mov r9, r0 - movs r4, 0 -_080713AE: - adds r1, r4, 0 - adds r1, 0x27 - adds r0, r5, 0 - bl pokemon_getattr - lsls r1, r4, 2 - adds r1, r7, r1 - str r0, [r1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _080713AE - adds r0, r5, 0 - movs r1, 0x3 - bl pokemon_getattr - mov r1, r8 - strb r0, [r1] - adds r0, r5, 0 - movs r1, 0x25 - bl pokemon_getattr - mov r1, r10 - strb r0, [r1] - adds r0, r5, 0 - movs r1, 0x8 - bl pokemon_getattr - ldr r1, [sp, 0x40] - strb r0, [r1] - adds r0, r5, 0 - movs r1, 0x22 - bl pokemon_getattr - str r0, [sp, 0x38] - adds r0, r5, 0 - movs r1, 0x50 - bl pokemon_getattr - ldr r1, [sp, 0x48] - strb r0, [r1] - movs r0, 0x1 - str r0, [sp] - mov r0, r9 - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - str r0, [sp, 0xC] - adds r0, r6, 0 - ldr r1, [sp, 0x3C] - movs r2, 0x5 - movs r3, 0x20 - bl create_pokemon_set_level - movs r4, 0 -_0807141E: - adds r1, r4, 0 - adds r1, 0xD - lsls r0, r4, 1 - mov r2, sp - adds r2, r0 - adds r2, 0x10 - adds r0, r6, 0 - bl pokemon_setattr - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _0807141E - movs r4, 0 -_0807143C: - adds r1, r4, 0 - adds r1, 0x27 - lsls r2, r4, 2 - adds r2, r7, r2 - adds r0, r6, 0 - bl pokemon_setattr - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _0807143C - movs r0, 0x2 - mov r1, r8 - strb r0, [r1] - adds r0, r6, 0 - movs r1, 0x3 - mov r2, r8 - bl pokemon_setattr - adds r0, r6, 0 - movs r1, 0x25 - mov r2, r10 - bl pokemon_setattr - adds r0, r6, 0 - movs r1, 0x8 - ldr r2, [sp, 0x40] - bl pokemon_setattr - movs r0, 0x78 - ldr r1, [sp, 0x44] - strb r0, [r1] - adds r0, r6, 0 - movs r1, 0x20 - ldr r2, [sp, 0x44] - bl pokemon_setattr - adds r0, r6, 0 - movs r1, 0x22 - ldr r2, [sp, 0x4C] - bl pokemon_setattr - adds r0, r6, 0 - movs r1, 0x50 - ldr r2, [sp, 0x48] - bl pokemon_setattr - adds r0, r5, 0 - adds r1, r6, 0 - movs r2, 0x64 - bl memcpy - add sp, 0x50 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8071348 - - thumb_func_start sub_80714B8 -sub_80714B8: @ 80714B8 - push {r4,r5,lr} - sub sp, 0x14 - lsls r0, 24 - lsrs r0, 24 - add r4, sp, 0xC - movs r1, 0x46 - strb r1, [r4] - movs r1, 0x64 - adds r5, r0, 0 - muls r5, r1 - ldr r0, =0x020244ec - adds r5, r0 - ldr r1, =0x02024744 - adds r0, r5, 0 - bl sub_8071348 - adds r0, r5, 0 - movs r1, 0x2D - adds r2, r4, 0 - bl pokemon_setattr - adds r0, r5, 0 - movs r1, 0xB - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r0, sp - adds r1, r4, 0 - bl GetSpeciesName - adds r0, r5, 0 - movs r1, 0x2 - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - bl SpeciesToNationalPokedexNum - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r4, 0 - movs r1, 0x2 - bl pokedex_flag_operation - adds r0, r4, 0 - movs r1, 0x3 - bl pokedex_flag_operation - ldr r1, =0x02021cc4 - adds r0, r5, 0 - bl pokemon_get_nick - mov r2, sp - adds r2, 0xE - movs r0, 0x4 - strh r0, [r2] - adds r0, r5, 0 - movs r1, 0x26 - bl pokemon_setattr - add r2, sp, 0x10 - movs r0, 0 - strh r0, [r2] - adds r0, r5, 0 - movs r1, 0x24 - bl pokemon_setattr - bl sav1_map_get_name - mov r2, sp - adds r2, 0x12 - strb r0, [r2] - adds r0, r5, 0 - movs r1, 0x23 - bl pokemon_setattr - adds r0, r5, 0 - bl sub_806E924 - adds r0, r5, 0 - bl pokemon_calc_effective_stats - add sp, 0x14 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80714B8 - - thumb_func_start sub_8071578 -sub_8071578: @ 8071578 - push {lr} - ldr r0, =0x020375e0 - ldrb r0, [r0] - bl sub_80714B8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8071578 - - thumb_func_start sub_807158C -sub_807158C: @ 807158C - push {r4-r6,lr} - sub sp, 0x20 - lsls r1, 24 - lsrs r1, 24 - movs r2, 0x8C - muls r1, r2 - adds r4, r0, r1 - adds r0, r4, 0 - mov r1, sp - bl pokemon_get_nick_ - adds r0, r4, 0 - adds r0, 0x70 - ldrh r0, [r0] - cmp r0, 0 - beq _08071608 - adds r6, r4, 0 - adds r6, 0x7C - mov r0, sp - adds r1, r6, 0 - bl CompareStringWithoutExtendedControlCodes - adds r5, r4, 0 - adds r5, 0x74 - cmp r0, 0 - bne _080715CE - ldr r0, =0x03005d90 - ldr r0, [r0] - adds r1, r5, 0 - bl CompareStringWithoutExtendedControlCodes - cmp r0, 0 - beq _08071608 -_080715CE: - ldr r0, =0x02021cc4 - mov r1, sp - bl CopyString - ldr r0, =0x02021dc4 - adds r4, 0x87 - ldrb r2, [r4] - lsls r2, 28 - lsrs r2, 28 - adds r1, r5, 0 - bl sub_81DB5E8 - ldr r0, =0x02021ec4 - ldrb r2, [r4] - lsrs r2, 4 - adds r1, r6, 0 - bl sub_81DB5E8 - movs r0, 0x1 - b _0807160A - .pool -_08071608: - movs r0, 0 -_0807160A: - add sp, 0x20 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_807158C - - thumb_func_start sub_8071614 -sub_8071614: @ 8071614 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003030 - adds r0, r1 - ldr r1, =0x020375e0 - ldrb r1, [r1] - bl sub_807158C - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8071614 - - thumb_func_start sub_807163C -sub_807163C: @ 807163C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - mov r9, r3 - lsls r0, 24 - lsrs r3, r0, 24 - mov r8, r3 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r1, r2, 24 - adds r2, r1, 0 - movs r4, 0 - movs r7, 0 - movs r5, 0 - cmp r3, 0 - bne _0807166A - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r5, r1, r0 - movs r4, 0x1 -_0807166A: - cmp r3, 0x1 - bne _0807167A - movs r0, 0x64 - adds r1, r2, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r5, r1, r0 - movs r4, 0x3 -_0807167A: - cmp r6, 0 - beq _08071688 - cmp r6, 0x1 - beq _080716D8 - b _08071712 - .pool -_08071688: - adds r0, r5, 0 - movs r1, 0xB - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0 - bl pokemon_getattr - adds r3, r0, 0 - lsls r0, r4, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r2, [r1] - mov r6, r8 - lsls r1, r6, 1 - adds r1, 0x1 - lsls r1, 2 - adds r2, 0x4 - adds r2, r1 - ldr r1, [r2] - adds r2, r4, 0 - bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack - adds r0, r5, 0 - bl sub_806E794 - bl LoadCompressedObjectPalette - mov r0, r9 - strh r4, [r0] - b _08071712 - .pool -_080716D8: - adds r0, r5, 0 - bl sub_806E794 - ldrh r0, [r0, 0x4] - adds r1, r4, 0 - bl sub_806A068 - ldr r0, =0x0202499c - movs r1, 0x78 - movs r2, 0x4B - movs r3, 0x6 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - ldr r4, =0x02020630 - lsls r1, r7, 4 - adds r1, r7 - lsls r1, 2 - adds r2, r1, r4 - adds r2, 0x3E - ldrb r0, [r2] - movs r3, 0x4 - orrs r0, r3 - strb r0, [r2] - adds r4, 0x1C - adds r1, r4 - ldr r0, =DummyObjectCallback - str r0, [r1] -_08071712: - adds r0, r7, 0 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_807163C - - thumb_func_start sub_807172C -sub_807172C: @ 807172C - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_807172C - - thumb_func_start sub_8071740 -sub_8071740: @ 8071740 - push {lr} - bl script_env_2_enable - ldr r0, =sub_8071760 - movs r1, 0xA - bl AddTask - movs r0, 0x1 - movs r1, 0 - bl fade_screen - pop {r0} - bx r0 - .pool - thumb_func_end sub_8071740 - - thumb_func_start sub_8071760 -sub_8071760: @ 8071760 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08071788 - bl overworld_free_bg_tilemaps - ldr r0, =c1_hatching_egg - bl SetMainCallback2 - ldr r1, =0x03005dac - ldr r0, =sub_80AF168 - str r0, [r1] - adds r0, r4, 0 - bl remove_task -_08071788: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8071760 - - thumb_func_start c1_hatching_egg -c1_hatching_egg: @ 80717A0 - push {r4,lr} - sub sp, 0x4 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x8 - bls _080717B4 - b _080719D6 -_080717B4: - lsls r0, 2 - ldr r1, =_080717C8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080717C8: - .4byte _080717EC - .4byte _080718B8 - .4byte _080718D0 - .4byte _08071904 - .4byte _08071924 - .4byte _0807193C - .4byte _08071954 - .4byte _08071970 - .4byte _080719C8 -_080717EC: - movs r0, 0 - movs r1, 0 - bl SetGpuReg - ldr r4, =0x03000de0 - movs r0, 0x14 - bl Alloc - str r0, [r4] - bl init_uns_table_pokemon_copy - ldr r2, [r4] - ldr r0, =0x020375e0 - ldrh r0, [r0] - movs r1, 0 - strb r0, [r2, 0x4] - ldr r0, [r4] - strb r1, [r0, 0x7] - ldr r0, =sub_807172C - bl SetVBlankCallback - bl current_map_music_get - ldr r1, =0x020375e2 - strh r0, [r1] - bl reset_temp_tile_data_buffers - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0832C064 - movs r0, 0 - movs r2, 0x2 - bl InitBgsFromTemplates - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 - movs r1, 0x7 - movs r2, 0x2 - bl SetBgAttribute - movs r0, 0x80 - lsls r0, 5 - bl Alloc - adds r1, r0, 0 - movs r0, 0x1 - bl SetBgTilemapBuffer - movs r0, 0x80 - lsls r0, 6 - bl Alloc - adds r1, r0, 0 - movs r0, 0 - bl SetBgTilemapBuffer - bl DeactivateAllTextPrinters - bl sub_80A1A74 - bl ResetObjectPaletteAllocator - bl ResetAllObjectData - bl clear_tasks - bl remove_some_task - bl SoundVSyncOn_rev01 - b _080719A6 - .pool -_080718B8: - ldr r0, =gUnknown_0832C06C - bl InitWindows - ldr r0, =0x03000de0 - ldr r1, [r0] - movs r0, 0 - strb r0, [r1, 0x8] - b _080719A6 - .pool -_080718D0: - ldr r1, =gUnknown_08C00000 - movs r0, 0 - str r0, [sp] - movs r2, 0 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r1, =gUnknown_08C00524 - movs r0, 0 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - ldr r0, =gUnknown_08C004E0 - movs r1, 0 - movs r2, 0x20 - bl decompress_palette - b _080719A6 - .pool -_08071904: - ldr r0, =gUnknown_0832BFE4 - bl LoadObjectPic - ldr r0, =gUnknown_0832BFEC - bl LoadObjectPic - ldr r0, =gUnknown_0832BFF4 - bl LoadTaggedObjectPalette - b _080719A6 - .pool -_08071924: - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r0, =0x03000de0 - ldr r0, [r0] - ldrb r0, [r0, 0x4] - bl sub_80714B8 - b _080719A6 - .pool -_0807193C: - ldr r0, =0x03000de0 - ldr r3, [r0] - ldrb r2, [r3, 0x4] - adds r3, 0xC - movs r0, 0 - movs r1, 0 - bl sub_807163C - b _080719A6 - .pool -_08071954: - ldr r4, =0x03000de0 - ldr r3, [r4] - ldrb r2, [r3, 0x4] - adds r3, 0xC - movs r0, 0 - movs r1, 0x1 - bl sub_807163C - ldr r1, [r4] - strb r0, [r1, 0x1] - b _080719A6 - .pool -_08071970: - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - ldr r0, =gUnknown_08DD7300 - movs r1, 0x10 - movs r2, 0xA0 - bl gpu_pal_apply - ldr r1, =gUnknown_08DD7360 - movs r2, 0xA1 - lsls r2, 5 - movs r0, 0x1 - movs r3, 0 - bl LoadBgTiles - ldr r1, =gUnknown_08331F60 - movs r2, 0x80 - lsls r2, 5 - movs r0, 0x1 - movs r3, 0 - bl CopyToBgTilemapBuffer - movs r0, 0x1 - bl CopyBgTilemapBufferToVram -_080719A6: - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080719D6 - .pool -_080719C8: - ldr r0, =sub_8071A94 - bl SetMainCallback2 - ldr r0, =0x03000de0 - ldr r1, [r0] - movs r0, 0 - strb r0, [r1, 0x2] -_080719D6: - bl RunActiveTasks - bl RunTextPrinters - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end c1_hatching_egg - - thumb_func_start sub_80719FC -sub_80719FC: @ 80719FC - push {lr} - ldr r0, =0x020375e0 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldr r2, =0x02021ec4 - movs r1, 0x2 - bl pokemon_setattr - bl sub_805F094 - ldr r0, =0x03000de0 - ldr r0, [r0] - bl Free - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80719FC - - thumb_func_start c3_080472E4 -c3_080472E4: @ 8071A3C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08071A5C - bl sub_80A2F30 - bl play_some_sound -_08071A5C: - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _08071A6C - movs r0, 0xBC - lsls r0, 1 - bl song_play_for_text -_08071A6C: - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x3C - ble _08071A80 - ldr r0, =0x00000179 - bl song_play_for_text - adds r0, r5, 0 - bl remove_task -_08071A80: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end c3_080472E4 - - thumb_func_start sub_8071A94 -sub_8071A94: @ 8071A94 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - ldr r1, =0x03000de0 - ldr r0, [r1] - ldrb r0, [r0, 0x2] - adds r5, r1, 0 - cmp r0, 0xC - bls _08071AAC - b _08071E06 -_08071AAC: - lsls r0, 2 - ldr r1, =_08071AC0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08071AC0: - .4byte _08071AF4 - .4byte _08071B40 - .4byte _08071B68 - .4byte _08071BA0 - .4byte _08071BF8 - .4byte _08071C24 - .4byte _08071C88 - .4byte _08071C96 - .4byte _08071CA4 - .4byte _08071CE8 - .4byte _08071D1C - .4byte _08071DB4 - .4byte _08071DD4 -_08071AF4: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r0, =gUnknown_0832BFFC - movs r1, 0x78 - movs r2, 0x4B - movs r3, 0x5 - bl AddObjectToFront - ldr r4, =0x03000de0 - ldr r1, [r4] - strb r0, [r1] - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - ldr r1, [r4] - ldrb r0, [r1, 0x2] - adds r0, 0x1 - strb r0, [r1, 0x2] - ldr r0, =c3_080472E4 - movs r1, 0x5 - bl AddTask - b _08071E06 - .pool -_08071B40: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _08071B52 - b _08071E06 -_08071B52: - ldr r0, [r5] - ldrb r0, [r0, 0x8] - movs r1, 0 - bl FillWindowPixelBuffer - ldr r0, [r5] - strb r4, [r0, 0x3] - ldr r1, [r5] - b _08071DC8 - .pool -_08071B68: - ldr r1, [r5] - ldrb r0, [r1, 0x3] - adds r0, 0x1 - strb r0, [r1, 0x3] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1E - bhi _08071B7A - b _08071E06 -_08071B7A: - ldr r1, [r5] - ldrb r0, [r1, 0x2] - adds r0, 0x1 - strb r0, [r1, 0x2] - ldr r2, =0x02020630 - ldr r0, [r5] - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_8071E34 - str r1, [r0] - b _08071E06 - .pool -_08071BA0: - ldr r4, =0x02020630 - ldr r2, [r5] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - beq _08071BBC - b _08071E06 -_08071BBC: - ldrb r1, [r2, 0x4] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r7, r0, 16 - ldr r0, [r5] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r1, r7, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_806ED40 - ldr r1, [r5] - b _08071DC8 - .pool -_08071BF8: - ldr r2, =0x02020630 - ldr r3, [r5] - ldrb r1, [r3, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - beq _08071C12 - b _08071E06 -_08071C12: - ldrb r0, [r3, 0x2] - adds r0, 0x1 - strb r0, [r3, 0x2] - b _08071E06 - .pool -_08071C24: - ldr r0, [r5] - ldrb r1, [r0, 0x4] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02021cc4 - bl pokemon_get_nick - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085ED5A5 - adds r0, r4, 0 - bl ExpandStringRefs - ldr r0, [r5] - ldrb r0, [r0, 0x8] - movs r1, 0xFF - str r1, [sp] - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x3 - bl sub_8072214 - ldr r0, =0x00000173 - bl fanfare_play - ldr r1, [r5] - ldrb r0, [r1, 0x2] - adds r0, 0x1 - strb r0, [r1, 0x2] - ldr r0, [r5] - ldrb r0, [r0, 0x8] - bl PutWindowTilemap - ldr r0, [r5] - ldrb r0, [r0, 0x8] - movs r1, 0x3 - bl CopyWindowToVram - b _08071E06 - .pool -_08071C88: - bl task_is_not_running_overworld_fanfare - lsls r0, 24 - cmp r0, 0 - bne _08071C94 - b _08071E06 -_08071C94: - b _08071DC4 -_08071C96: - bl task_is_not_running_overworld_fanfare - lsls r0, 24 - cmp r0, 0 - bne _08071CA2 - b _08071E06 -_08071CA2: - b _08071DC4 -_08071CA4: - ldr r0, [r5] - ldrb r1, [r0, 0x4] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02021cc4 - bl pokemon_get_nick - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085ED5BE - adds r0, r4, 0 - bl ExpandStringRefs - ldr r0, [r5] - ldrb r0, [r0, 0x8] - movs r1, 0x1 - str r1, [sp] - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x2 - bl sub_8072214 - ldr r1, [r5] - b _08071DC8 - .pool -_08071CE8: - ldr r0, [r5] - ldrb r0, [r0, 0x8] - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - beq _08071CF8 - b _08071E06 -_08071CF8: - ldr r0, [r5] - ldrb r0, [r0, 0x8] - movs r4, 0xA0 - lsls r4, 1 - adds r1, r4, 0 - movs r2, 0xE0 - bl sub_809882C - ldr r0, =gUnknown_0832C07C - adds r1, r4, 0 - movs r2, 0xE - movs r3, 0 - bl CreateYesNoMenu - ldr r1, [r5] - b _08071DC8 - .pool -_08071D1C: - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _08071D3C - cmp r1, 0 - bgt _08071D36 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08071DC4 - b _08071E06 -_08071D36: - cmp r1, 0x1 - beq _08071DC4 - b _08071E06 -_08071D3C: - ldr r0, =0x03000de0 - mov r8, r0 - ldr r0, [r0] - ldrb r0, [r0, 0x4] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x020244ec - adds r0, r5 - ldr r1, =0x02021ec4 - mov r9, r1 - bl pokemon_get_nick - mov r1, r8 - ldr r0, [r1] - ldrb r0, [r0, 0x4] - muls r0, r6 - adds r0, r5 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r7, r0, 16 - mov r1, r8 - ldr r0, [r1] - ldrb r0, [r0, 0x4] - muls r0, r6 - adds r0, r5 - bl pokemon_get_gender - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - mov r1, r8 - ldr r0, [r1] - ldrb r0, [r0, 0x4] - muls r0, r6 - adds r0, r5 - movs r1, 0 - movs r2, 0 - bl pokemon_getattr - str r0, [sp] - ldr r0, =sub_80719FC - str r0, [sp, 0x4] - movs r0, 0x3 - mov r1, r9 - adds r2, r7, 0 - adds r3, r4, 0 - bl do_choose_name_or_words_screen - b _08071E06 - .pool -_08071DB4: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe -_08071DC4: - ldr r0, =0x03000de0 - ldr r1, [r0] -_08071DC8: - ldrb r0, [r1, 0x2] - adds r0, 0x1 - strb r0, [r1, 0x2] - b _08071E06 - .pool -_08071DD4: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08071E06 - bl sub_805F094 - ldr r4, =0x03000de0 - ldr r0, [r4] - ldrb r0, [r0, 0x8] - bl RemoveWindow - movs r0, 0 - bl UnsetBgTilemapBuffer - movs r0, 0x1 - bl UnsetBgTilemapBuffer - ldr r0, [r4] - bl Free - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 -_08071E06: - bl RunActiveTasks - bl RunTextPrinters - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8071A94 - - thumb_func_start sub_8071E34 -sub_8071E34: @ 8071E34 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - ble _08071E54 - ldr r0, =sub_8071E8C - str r0, [r4, 0x1C] - movs r0, 0 - strh r0, [r4, 0x2E] - b _08071E84 - .pool -_08071E54: - ldrh r0, [r4, 0x30] - adds r0, 0x14 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x30] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x1 - bl sine - strh r0, [r4, 0x24] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0xF - bne _08071E84 - movs r0, 0x17 - bl audio_play - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectImageAnim - bl sub_8072140 -_08071E84: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8071E34 - - thumb_func_start sub_8071E8C -sub_8071E8C: @ 8071E8C - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x32] - adds r0, 0x1 - movs r1, 0 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1E - ble _08071EE8 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - ble _08071EBC - ldr r0, =sub_8071EF0 - str r0, [r4, 0x1C] - strh r1, [r4, 0x2E] - strh r1, [r4, 0x32] - b _08071EE8 - .pool -_08071EBC: - ldrh r0, [r4, 0x30] - adds r0, 0x14 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x30] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x2 - bl sine - strh r0, [r4, 0x24] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0xF - bne _08071EE8 - movs r0, 0x17 - bl audio_play - adds r0, r4, 0 - movs r1, 0x2 - bl StartObjectImageAnim -_08071EE8: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8071E8C - - thumb_func_start sub_8071EF0 -sub_8071EF0: @ 8071EF0 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x32] - adds r0, 0x1 - movs r5, 0 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1E - ble _08071F9E - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x26 - ble _08071F5C - ldr r0, =sub_8071FA4 - str r0, [r4, 0x1C] - strh r5, [r4, 0x2E] - ldr r4, =0x03000de0 - ldr r0, [r4] - ldrb r1, [r0, 0x4] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - ldr r3, =0x02020630 - ldr r2, [r4] - ldrb r1, [r2, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r5, [r0, 0x24] - ldrb r1, [r2, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r5, [r0, 0x26] - b _08071F9E - .pool -_08071F5C: - ldrh r0, [r4, 0x30] - adds r0, 0x14 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x30] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x2 - bl sine - strh r0, [r4, 0x24] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0xF - bne _08071F90 - movs r0, 0x17 - bl audio_play - adds r0, r4, 0 - movs r1, 0x2 - bl StartObjectImageAnim - bl sub_8072140 - bl sub_8072140 -_08071F90: - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x1E - bne _08071F9E - movs r0, 0x17 - bl audio_play -_08071F9E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8071EF0 - - thumb_func_start sub_8071FA4 -sub_8071FA4: @ 8071FA4 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x2E] - adds r0, 0x1 - strh r0, [r1, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x32 - ble _08071FBE - ldr r0, =sub_8071FC8 - str r0, [r1, 0x1C] - movs r0, 0 - strh r0, [r1, 0x2E] -_08071FBE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8071FA4 - - thumb_func_start sub_8071FC8 -sub_8071FC8: @ 8071FC8 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _08071FE8 - movs r1, 0x1 - negs r1, r1 - ldr r0, =0x0000ffff - str r0, [sp] - adds r0, r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe -_08071FE8: - ldrh r0, [r5, 0x2E] - cmp r0, 0x3 - bhi _08072004 - movs r4, 0 -_08071FF0: - bl sub_8072140 - lsls r0, r4, 16 - movs r1, 0x80 - lsls r1, 9 - adds r0, r1 - lsrs r4, r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _08071FF0 -_08072004: - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _08072032 - movs r0, 0x71 - bl audio_play - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_8072048 - str r0, [r5, 0x1C] - strh r4, [r5, 0x2E] -_08072032: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8071FC8 - - thumb_func_start sub_8072048 -sub_8072048: @ 8072048 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _08072084 - ldr r4, =0x02020630 - ldr r3, =0x03000de0 - ldr r0, [r3] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - ldr r0, [r3] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x1 - bl StartObjectRotScalAnim -_08072084: - movs r2, 0x2E - ldrsh r0, [r5, r2] - cmp r0, 0x8 - bne _0807209E - movs r1, 0x1 - negs r1, r1 - ldr r0, =0x0000ffff - str r0, [sp] - adds r0, r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe -_0807209E: - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0x9 - bgt _080720BC - ldr r2, =0x02020630 - ldr r0, =0x03000de0 - ldr r0, [r0] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x22] - subs r1, 0x1 - strh r1, [r0, 0x22] -_080720BC: - ldrh r1, [r5, 0x2E] - movs r2, 0x2E - ldrsh r0, [r5, r2] - cmp r0, 0x28 - ble _080720CA - ldr r0, =DummyObjectCallback - str r0, [r5, 0x1C] -_080720CA: - adds r0, r1, 0x1 - strh r0, [r5, 0x2E] - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8072048 - - thumb_func_start sub_80720E8 -sub_80720E8: @ 80720E8 - push {r4,lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x30] - ldrh r1, [r2, 0x36] - adds r0, r1 - strh r0, [r2, 0x36] - ldrh r1, [r2, 0x32] - ldrh r3, [r2, 0x38] - adds r0, r1, r3 - strh r0, [r2, 0x38] - movs r4, 0x36 - ldrsh r0, [r2, r4] - cmp r0, 0 - bge _08072106 - adds r0, 0xFF -_08072106: - asrs r0, 8 - strh r0, [r2, 0x24] - movs r3, 0x38 - ldrsh r0, [r2, r3] - cmp r0, 0 - bge _08072114 - adds r0, 0xFF -_08072114: - asrs r0, 8 - strh r0, [r2, 0x26] - ldrh r0, [r2, 0x34] - adds r3, r1, r0 - strh r3, [r2, 0x32] - movs r4, 0x22 - ldrsh r1, [r2, r4] - movs r4, 0x26 - ldrsh r0, [r2, r4] - adds r0, r1, r0 - adds r1, 0x14 - cmp r0, r1 - ble _0807213A - lsls r0, r3, 16 - cmp r0, 0 - ble _0807213A - adds r0, r2, 0 - bl RemoveObjectAndFreeTiles -_0807213A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80720E8 - - thumb_func_start sub_8072140 -sub_8072140: @ 8072140 - push {r4-r6,lr} - sub sp, 0x8 - ldr r2, =gUnknown_0832C084 - ldr r0, =0x03000de0 - ldr r6, [r0] - ldrb r3, [r6, 0x7] - lsls r0, r3, 2 - adds r1, r0, r2 - ldrh r5, [r1] - adds r2, 0x2 - adds r0, r2 - ldrh r4, [r0] - adds r3, 0x1 - strb r3, [r6, 0x7] - bl GenerateRandomNumber - lsls r0, 16 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r0 - lsls r5, 16 - asrs r5, 16 - lsls r4, 16 - asrs r4, 16 - movs r0, 0x64 - str r0, [sp] - lsrs r1, 16 - str r1, [sp, 0x4] - movs r0, 0x78 - movs r1, 0x3C - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_8072194 - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8072140 - - thumb_func_start sub_8072194 -sub_8072194: @ 8072194 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - mov r8, r3 - ldr r0, [sp, 0x1C] - mov r9, r0 - ldr r1, [sp, 0x20] - mov r10, r1 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 16 - lsrs r6, 16 - mov r0, r8 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - mov r1, r9 - lsls r1, 16 - lsrs r1, 16 - mov r9, r1 - mov r0, r10 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r0, =gUnknown_0832C04C - adds r1, r4, 0 - adds r2, r5, 0 - movs r3, 0x4 - bl AddObjectToFront - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =0x02020630 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r6, [r0, 0x30] - mov r1, r8 - strh r1, [r0, 0x32] - mov r1, r9 - strh r1, [r0, 0x34] - mov r1, r10 - bl StartObjectImageAnim - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8072194 - - thumb_func_start sub_8072214 -sub_8072214: @ 8072214 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x14 - adds r5, r0, 0 - mov r9, r1 - adds r6, r2, 0 - mov r8, r3 - ldr r4, [sp, 0x2C] - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0xFF - bl FillWindowPixelBuffer - ldr r3, =0x03000de0 - ldr r0, [r3] - movs r2, 0 - strb r2, [r0, 0xE] - ldr r1, [r3] - movs r0, 0x5 - strb r0, [r1, 0xF] - ldr r1, [r3] - movs r0, 0x6 - strb r0, [r1, 0x10] - str r2, [sp] - str r2, [sp, 0x4] - ldr r0, [r3] - adds r0, 0xE - str r0, [sp, 0x8] - lsls r4, 24 - asrs r4, 24 - str r4, [sp, 0xC] - mov r0, r9 - str r0, [sp, 0x10] - adds r0, r5, 0 - movs r1, 0x1 - adds r2, r6, 0 - mov r3, r8 - bl AddTextPrinterParametrized2 - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8072214 - - thumb_func_start sub_807228C -sub_807228C: @ 807228C - push {r4-r6,lr} - bl calc_player_party_count - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - cmp r5, r6 - bcs _080722D6 -_0807229C: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x6 - bl pokemon_getattr - cmp r0, 0 - bne _080722CC - adds r0, r4, 0 - bl GetMonAbility - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x28 - beq _080722C4 - cmp r0, 0x31 - bne _080722CC -_080722C4: - movs r0, 0x2 - b _080722D8 - .pool -_080722CC: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r6 - bcc _0807229C -_080722D6: - movs r0, 0x1 -_080722D8: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_807228C - - thumb_func_start sub_80722E0 -sub_80722E0: @ 80722E0 - push {r4,lr} - bl sub_80D22D0 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - movs r0, 0x6 - bl sub_80C7050 - lsls r0, 24 - lsrs r0, 24 - adds r4, r0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80722E0 - - thumb_func_start sub_8072304 -sub_8072304: @ 8072304 - movs r0, 0x9 - bx lr - thumb_func_end sub_8072304 - - thumb_func_start sub_8072308 -sub_8072308: @ 8072308 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r7, r1, 0 - lsls r0, 16 - lsrs r5, r0, 16 - lsls r2, 24 - lsrs r2, 24 - mov r10, r2 - movs r3, 0 - movs r2, 0 -_08072324: - lsls r0, r3, 24 - asrs r0, 24 - mov r3, sp - adds r1, r3, r0 - strb r2, [r1] - adds r0, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - asrs r0, 24 - cmp r0, 0x3 - ble _08072324 - movs r3, 0x3 - movs r0, 0x1 - negs r0, r0 - mov r9, r0 - mov r8, sp -_08072344: - lsls r0, r5, 16 - asrs r6, r0, 16 - cmp r6, 0 - ble _08072372 - lsls r4, r3, 24 - asrs r4, 24 - mov r1, sp - adds r5, r1, r4 - adds r0, r6, 0 - movs r1, 0xA - bl __modsi3 - strb r0, [r5] - adds r0, r6, 0 - movs r1, 0xA - bl __divsi3 - lsls r0, 16 - lsrs r5, r0, 16 - subs r4, 0x1 - lsls r4, 24 - lsrs r3, r4, 24 - b _08072344 -_08072372: - lsls r1, r3, 24 - asrs r0, r1, 24 - cmp r0, r9 - ble _08072396 - movs r4, 0xFF - movs r3, 0x1 - negs r3, r3 -_08072380: - asrs r2, r1, 24 - mov r5, sp - adds r1, r5, r2 - ldrb r0, [r1] - orrs r0, r4 - strb r0, [r1] - subs r2, 0x1 - lsls r1, r2, 24 - asrs r0, r1, 24 - cmp r0, r3 - bgt _08072380 -_08072396: - mov r1, r8 - ldrb r0, [r1, 0x3] - cmp r0, 0xFF - bne _080723A2 - movs r0, 0 - strb r0, [r1, 0x3] -_080723A2: - mov r2, r10 - cmp r2, 0 - bne _08072432 - movs r3, 0 - movs r1, 0 - movs r6, 0xFC - lsls r6, 8 - movs r5, 0x1E - mov r12, r5 -_080723B4: - lsls r1, 24 - asrs r2, r1, 24 - mov r0, sp - adds r5, r0, r2 - ldrb r0, [r5] - mov r8, r1 - cmp r0, 0xFF - bne _080723EA - lsls r1, r2, 1 - adds r1, r7 - ldrh r2, [r1] - adds r0, r6, 0 - ands r0, r2 - mov r2, r12 - orrs r0, r2 - strh r0, [r1] - lsls r3, 24 - asrs r1, r3, 23 - adds r1, r7 - adds r1, 0x40 - ldrh r2, [r1] - adds r0, r6, 0 - ands r0, r2 - mov r5, r12 - orrs r0, r5 - strh r0, [r1] - b _0807241A -_080723EA: - lsls r2, 1 - adds r2, r7 - ldrh r0, [r2] - adds r1, r6, 0 - ands r1, r0 - ldrb r0, [r5] - adds r0, 0x14 - orrs r1, r0 - strh r1, [r2] - lsls r4, r3, 24 - asrs r3, r4, 24 - lsls r2, r3, 1 - adds r2, r7 - adds r2, 0x40 - ldrh r0, [r2] - adds r1, r6, 0 - ands r1, r0 - mov r5, sp - adds r0, r5, r3 - ldrb r0, [r0] - adds r0, 0x34 - orrs r1, r0 - strh r1, [r2] - adds r3, r4, 0 -_0807241A: - movs r0, 0x80 - lsls r0, 17 - add r0, r8 - lsrs r1, r0, 24 - movs r2, 0x80 - lsls r2, 17 - adds r0, r3, r2 - lsrs r3, r0, 24 - asrs r0, 24 - cmp r0, 0x3 - ble _080723B4 - b _08072496 -_08072432: - movs r3, 0 - movs r4, 0xFC - lsls r4, 8 - movs r6, 0x1E -_0807243A: - lsls r1, r3, 24 - asrs r2, r1, 24 - mov r3, sp - adds r5, r3, r2 - ldrb r0, [r5] - adds r3, r1, 0 - cmp r0, 0xFF - bne _08072466 - lsls r1, r2, 1 - adds r1, r7 - ldrh r2, [r1] - adds r0, r4, 0 - ands r0, r2 - orrs r0, r6 - strh r0, [r1] - adds r1, 0x40 - ldrh r2, [r1] - adds r0, r4, 0 - ands r0, r2 - orrs r0, r6 - strh r0, [r1] - b _08072488 -_08072466: - lsls r2, 1 - adds r2, r7 - ldrh r0, [r2] - adds r1, r4, 0 - ands r1, r0 - ldrb r0, [r5] - adds r0, 0x14 - orrs r1, r0 - strh r1, [r2] - adds r2, 0x40 - ldrh r0, [r2] - adds r1, r4, 0 - ands r1, r0 - ldrb r0, [r5] - adds r0, 0x34 - orrs r1, r0 - strh r1, [r2] -_08072488: - movs r5, 0x80 - lsls r5, 17 - adds r0, r3, r5 - lsrs r3, r0, 24 - asrs r0, 24 - cmp r0, 0x3 - ble _0807243A -_08072496: - 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_8072308 - - thumb_func_start sub_80724A8 -sub_80724A8: @ 80724A8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r0, r1, 0 - adds r5, r2, 0 - lsls r4, 16 - lsrs r4, 16 - movs r1, 0x1E - strh r1, [r5, 0x8] - lsls r0, 16 - asrs r0, 16 - adds r1, r5, 0 - movs r2, 0 - bl sub_8072308 - lsls r4, 16 - asrs r4, 16 - adds r5, 0xA - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x1 - bl sub_8072308 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80724A8 - - thumb_func_start battle_make_oam_normal_battle -battle_make_oam_normal_battle: @ 80724DC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - movs r0, 0 - str r0, [sp] - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - bne _080725F0 - mov r0, r10 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08072574 - ldr r4, =gUnknown_0832C140 - adds r0, r4, 0 - movs r1, 0xF0 - movs r2, 0xA0 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r4, 0 - movs r1, 0xF0 - movs r2, 0xA0 - movs r3, 0x1 - bl AddObjectToBack - lsls r0, 24 - lsrs r7, r0, 24 - ldr r4, =0x02020630 - lsls r1, r6, 4 - adds r1, r6 - lsls r1, 2 - adds r1, r4 - ldrb r2, [r1, 0x1] - movs r3, 0x3F - adds r0, r3, 0 - ands r0, r2 - strb r0, [r1, 0x1] - lsls r2, r7, 4 - adds r2, r7 - lsls r2, 2 - adds r2, r4 - ldrb r0, [r2, 0x1] - ands r3, r0 - strb r3, [r2, 0x1] - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x40 - ldr r4, =0x000003ff - adds r0, r4, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r3 - orrs r0, r1 - strh r0, [r2, 0x4] - b _080725BA - .pool -_08072574: - ldr r4, =gUnknown_0832C170 - adds r0, r4, 0 - movs r1, 0xF0 - movs r2, 0xA0 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r4, 0 - movs r1, 0xF0 - movs r2, 0xA0 - movs r3, 0x1 - bl AddObjectToBack - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x02020630 - lsls r2, r7, 4 - adds r2, r7 - lsls r2, 2 - adds r2, r0 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x20 - ldr r5, =0x000003ff - adds r0, r5, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r3 - orrs r0, r1 - strh r0, [r2, 0x4] - movs r0, 0x2 - str r0, [sp] -_080725BA: - ldr r2, =0x02020630 - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - adds r0, r2 - strh r7, [r0, 0x6] - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - adds r1, r0, r2 - strh r6, [r1, 0x38] - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_8072924 - str r1, [r0] - b _08072718 - .pool -_080725F0: - mov r0, r10 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08072694 - mov r0, r10 - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 25 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - ldr r4, =gUnknown_0832C140 - adds r0, r4 - movs r1, 0xF0 - movs r2, 0xA0 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - mov r0, r10 - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 25 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - movs r1, 0xF0 - movs r2, 0xA0 - movs r3, 0x1 - bl AddObjectToBack - lsls r0, 24 - lsrs r7, r0, 24 - ldr r4, =0x02020630 - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - adds r0, r4 - strh r7, [r0, 0x6] - lsls r2, r7, 4 - adds r2, r7 - lsls r2, 2 - adds r3, r2, r4 - strh r6, [r3, 0x38] - ldrh r1, [r3, 0x4] - mov r8, r1 - mov r5, r8 - lsls r1, r5, 22 - lsrs r1, 22 - adds r1, 0x20 - ldr r5, =0x000003ff - adds r0, r5, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - mov r5, r8 - ands r0, r5 - orrs r0, r1 - strh r0, [r3, 0x4] - adds r4, 0x1C - adds r2, r4 - ldr r0, =sub_8072924 - str r0, [r2] - movs r0, 0x1 - b _08072716 - .pool -_08072694: - mov r0, r10 - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 25 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - ldr r4, =gUnknown_0832C170 - adds r0, r4 - movs r1, 0xF0 - movs r2, 0xA0 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - mov r0, r10 - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 25 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - movs r1, 0xF0 - movs r2, 0xA0 - movs r3, 0x1 - bl AddObjectToBack - lsls r0, 24 - lsrs r7, r0, 24 - ldr r4, =0x02020630 - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - adds r0, r4 - strh r7, [r0, 0x6] - lsls r2, r7, 4 - adds r2, r7 - lsls r2, 2 - adds r3, r2, r4 - strh r6, [r3, 0x38] - ldrh r1, [r3, 0x4] - mov r8, r1 - mov r5, r8 - lsls r1, r5, 22 - lsrs r1, 22 - adds r1, 0x20 - ldr r5, =0x000003ff - adds r0, r5, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - mov r5, r8 - ands r0, r5 - orrs r0, r1 - strh r0, [r3, 0x4] - adds r4, 0x1C - adds r2, r4 - ldr r0, =sub_8072924 - str r0, [r2] - movs r0, 0x2 -_08072716: - str r0, [sp] -_08072718: - ldr r0, =0x02024076 - add r0, r10 - ldrb r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - ldr r1, =gUnknown_0832C1C0 - adds r0, r1 - movs r1, 0x8C - movs r2, 0x3C - movs r3, 0 - bl AddObjectToBack - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 4 - adds r4, r5 - lsls r4, 2 - ldr r1, =0x02020630 - mov r8, r1 - add r4, r8 - mov r0, r10 - bl battle_side_get_owner - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 21 - ldr r0, =gUnknown_0832C28C - adds r1, r0 - adds r0, r4, 0 - bl SetSpriteOamTables_NoPriorityFromTable - adds r2, r4, 0 - adds r2, 0x42 - ldrb r1, [r2] - movs r0, 0x3F - ands r0, r1 - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - ldrb r1, [r4, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r2, 0x4 - mov r9, r2 - mov r1, r9 - orrs r0, r1 - strb r0, [r4, 0x5] - movs r0, 0x1 - bl sub_80728A4 - ldrh r1, [r4, 0x4] - lsls r1, 22 - lsrs r1, 17 - ldr r2, =0x06010000 - adds r1, r2 - ldr r2, =0x04000010 - bl CpuSet - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - add r0, r8 - strh r5, [r0, 0x38] - mov r2, r10 - strh r2, [r0, 0x3A] - adds r0, 0x3E - ldrb r1, [r0] - mov r5, r9 - orrs r1, r5 - strb r1, [r0] - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - add r0, r8 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r5 - strb r1, [r0] - strh r6, [r4, 0x38] - mov r0, sp - ldrh r0, [r0] - strh r0, [r4, 0x3A] - adds r4, 0x3E - ldrb r0, [r4] - orrs r0, r5 - strb r0, [r4] - 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 - .pool - thumb_func_end battle_make_oam_normal_battle - - thumb_func_start battle_make_oam_safari_battle -battle_make_oam_safari_battle: @ 8072804 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r4, =gUnknown_0832C1A0 - adds r0, r4, 0 - movs r1, 0xF0 - movs r2, 0xA0 - movs r3, 0x1 - bl AddObjectToFront - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - adds r0, r4, 0 - movs r1, 0xF0 - movs r2, 0xA0 - movs r3, 0x1 - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02020630 - mov r9, r1 - lsls r4, r6, 4 - adds r4, r6 - lsls r4, 2 - add r4, r9 - ldrb r3, [r4, 0x1] - movs r2, 0x3F - adds r1, r2, 0 - ands r1, r3 - strb r1, [r4, 0x1] - lsls r3, r0, 4 - adds r3, r0 - lsls r3, 2 - mov r7, r9 - adds r5, r3, r7 - ldrb r1, [r5, 0x1] - ands r2, r1 - strb r2, [r5, 0x1] - ldrh r1, [r5, 0x4] - mov r8, r1 - mov r7, r8 - lsls r2, r7, 22 - lsrs r2, 22 - adds r2, 0x40 - ldr r7, =0x000003ff - adds r1, r7, 0 - ands r2, r1 - ldr r1, =0xfffffc00 - mov r7, r8 - ands r1, r7 - orrs r1, r2 - strh r1, [r5, 0x4] - strh r0, [r4, 0x6] - strh r6, [r5, 0x38] - movs r0, 0x1C - add r9, r0 - add r3, r9 - ldr r0, =sub_8072924 - str r0, [r3] - adds r0, r6, 0 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end battle_make_oam_safari_battle - - thumb_func_start sub_80728A4 -sub_80728A4: @ 80728A4 - lsls r0, 24 - lsrs r0, 19 - ldr r1, =gUnknown_08C11BDC - adds r0, r1 - bx lr - .pool - thumb_func_end sub_80728A4 - - thumb_func_start sub_80728B4 -sub_80728B4: @ 80728B4 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x38] - lsls r0, 24 - lsrs r5, r0, 24 - movs r1, 0x3A - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080728E4 - cmp r0, 0x1 - bgt _080728F8 - cmp r0, 0 - bne _080728F8 - ldr r2, =0x02020630 - lsls r3, r5, 4 - adds r1, r3, r5 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r1, 0x20] - adds r0, 0x10 - b _08072906 - .pool -_080728E4: - ldr r2, =0x02020630 - lsls r3, r5, 4 - adds r1, r3, r5 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r1, 0x20] - adds r0, 0x10 - b _08072906 - .pool -_080728F8: - ldr r2, =0x02020630 - lsls r3, r5, 4 - adds r1, r3, r5 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r1, 0x20] - adds r0, 0x8 -_08072906: - strh r0, [r4, 0x20] - ldrh r0, [r1, 0x22] - strh r0, [r4, 0x22] - adds r0, r3, r5 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x24] - strh r1, [r4, 0x24] - ldrh r0, [r0, 0x26] - strh r0, [r4, 0x26] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80728B4 - - thumb_func_start sub_8072924 -sub_8072924: @ 8072924 - ldrh r1, [r0, 0x38] - lsls r1, 24 - lsrs r1, 24 - ldr r3, =0x02020630 - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - adds r2, r3 - ldrh r1, [r2, 0x20] - adds r1, 0x40 - strh r1, [r0, 0x20] - ldrh r1, [r2, 0x22] - strh r1, [r0, 0x22] - ldrh r1, [r2, 0x24] - strh r1, [r0, 0x24] - ldrh r1, [r2, 0x26] - strh r1, [r0, 0x26] - bx lr - .pool - thumb_func_end sub_8072924 - - thumb_func_start sub_807294C -sub_807294C: @ 807294C - push {r4-r7,lr} - ldr r7, [sp, 0x14] - lsls r0, 24 - lsrs r0, 24 - ldr r6, =0x020244d0 - ldr r4, [r6] - ldr r5, [r4, 0xC] - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 2 - adds r5, r4, r5 - strb r1, [r5] - ldr r0, [r6] - ldr r0, [r0, 0xC] - adds r4, r0 - str r2, [r4, 0x4] - str r3, [r4, 0x8] - str r7, [r4, 0xC] - ldr r0, =0xffff8000 - str r0, [r4, 0x10] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807294C - - thumb_func_start sub_8072984 -sub_8072984: @ 8072984 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x02020630 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r4 - adds r1, r2, 0 - adds r1, 0x3E - ldrb r0, [r1] - movs r3, 0x4 - orrs r0, r3 - strb r0, [r1] - movs r0, 0x38 - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r3 - strb r1, [r0] - ldrh r1, [r2, 0x6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r3 - strb r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8072984 - - thumb_func_start sub_80729D0 -sub_80729D0: @ 80729D0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =0x02020630 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r5 - adds r4, r2, 0 - adds r4, 0x3E - ldrb r1, [r4] - movs r3, 0x5 - negs r3, r3 - adds r0, r3, 0 - ands r0, r1 - strb r0, [r4] - movs r0, 0x38 - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r4, [r0] - adds r1, r3, 0 - ands r1, r4 - strb r1, [r0] - ldrh r1, [r2, 0x6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - ands r3, r1 - strb r3, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80729D0 - - thumb_func_start sub_8072A24 -sub_8072A24: @ 8072A24 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x02020630 - lsls r3, r0, 4 - adds r3, r0 - lsls r3, 2 - adds r3, r4 - strh r1, [r3, 0x20] - strh r2, [r3, 0x22] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8072A24 - - thumb_func_start sub_8072A44 -sub_8072A44: @ 8072A44 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =0x02020630 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - adds r4, r5 - ldrh r1, [r4, 0x6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl RemoveObjectAndFreeTiles - movs r0, 0x38 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl RemoveObjectAndFreeTiles - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8072A44 - - thumb_func_start nullsub_30 -nullsub_30: @ 8072A84 - bx lr - thumb_func_end nullsub_30 - - thumb_func_start sub_8072A88 -sub_8072A88: @ 8072A88 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r0, 24 - movs r6, 0 - ldr r1, =0x0202406c - mov r8, r1 - ldrb r2, [r1] - cmp r6, r2 - bge _08072B00 - ldr r1, =0x02020630 - mov r12, r1 - movs r1, 0x3 - ands r0, r1 - lsls r5, r0, 2 - movs r7, 0xD - negs r7, r7 - ldr r2, =0x03005d70 - mov r9, r2 -_08072AB2: - mov r1, r9 - adds r0, r6, r1 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r12 - ldrb r4, [r1, 0x6] - ldrh r3, [r1, 0x38] - lsls r3, 24 - lsrs r3, 24 - ldrb r2, [r1, 0x5] - adds r0, r7, 0 - ands r0, r2 - orrs r0, r5 - strb r0, [r1, 0x5] - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - add r1, r12 - ldrb r2, [r1, 0x5] - adds r0, r7, 0 - ands r0, r2 - orrs r0, r5 - strb r0, [r1, 0x5] - lsls r1, r3, 4 - adds r1, r3 - lsls r1, 2 - add r1, r12 - ldrb r2, [r1, 0x5] - adds r0, r7, 0 - ands r0, r2 - orrs r0, r5 - strb r0, [r1, 0x5] - adds r6, 0x1 - mov r2, r8 - ldrb r2, [r2] - cmp r6, r2 - blt _08072AB2 -_08072B00: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8072A88 - - thumb_func_start sub_8072B18 -sub_8072B18: @ 8072B18 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - movs r4, 0 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - bne _08072B44 - adds r0, r6, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08072B3E - movs r5, 0x2C - movs r4, 0x1E - b _08072B7C -_08072B3E: - movs r5, 0x9E - movs r4, 0x58 - b _08072B7C -_08072B44: - adds r0, r6, 0 - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08072B72 - cmp r0, 0x1 - bgt _08072B5C - cmp r0, 0 - beq _08072B66 - b _08072B7C -_08072B5C: - cmp r0, 0x2 - beq _08072B6C - cmp r0, 0x3 - beq _08072B78 - b _08072B7C -_08072B66: - movs r5, 0x9F - movs r4, 0x4C - b _08072B7C -_08072B6C: - movs r5, 0xAB - movs r4, 0x65 - b _08072B7C -_08072B72: - movs r5, 0x2C - movs r4, 0x13 - b _08072B7C -_08072B78: - movs r5, 0x20 - movs r4, 0x2C -_08072B7C: - ldr r0, =0x03005d70 - adds r0, r6, r0 - ldrb r0, [r0] - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_8072A24 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8072B18 - - thumb_func_start healthbar_draw_level -healthbar_draw_level: @ 8072B94 - push {r4,r5,lr} - sub sp, 0x18 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r1, 24 - lsrs r1, 24 - add r2, sp, 0x4 - movs r0, 0xF9 - strb r0, [r2] - movs r0, 0x5 - strb r0, [r2, 0x1] - mov r0, sp - adds r0, 0x6 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - adds r1, r0, 0 - subs r1, 0x2 - add r0, sp, 0x4 - subs r1, r0 - movs r0, 0x3 - subs r0, r1 - lsls r1, r0, 2 - adds r1, r0 - add r0, sp, 0x14 - str r0, [sp] - add r0, sp, 0x4 - movs r2, 0x3 - movs r3, 0x2 - bl write_to_rbox - adds r5, r0, 0 - ldr r0, =0x02020630 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x4] - lsls r0, 22 - lsrs r4, r0, 17 - ldrh r0, [r1, 0x3A] - lsls r0, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08072C18 - bl battle_type_is_double - lsls r0, 24 - ldr r2, =0x06010420 - adds r1, r4, r2 - cmp r0, 0 - bne _08072C1C - ldr r0, =0x06010820 - adds r1, r4, r0 - b _08072C1C - .pool -_08072C18: - ldr r2, =0x06010400 - adds r1, r4, r2 -_08072C1C: - adds r0, r1, 0 - adds r1, r5, 0 - movs r2, 0x3 - bl sub_8075198 - ldr r0, [sp, 0x14] - bl sub_807512C - add sp, 0x18 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end healthbar_draw_level - - thumb_func_start heathbar_draw_hp -heathbar_draw_hp: @ 8072C38 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x28 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 16 - lsrs r1, 16 - mov r9, r1 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - ldr r1, =0x02020630 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - adds r4, r0, r1 - ldrh r0, [r4, 0x3A] - lsls r0, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08072D10 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - bne _08072D10 - ldrh r0, [r4, 0x4] - lsls r0, 22 - lsrs r5, r0, 17 - mov r0, r8 - cmp r0, 0 - beq _08072CB8 - mov r2, r9 - lsls r1, r2, 16 - asrs r1, 16 - add r0, sp, 0x4 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - add r0, sp, 0x24 - str r0, [sp] - add r0, sp, 0x4 - movs r1, 0 - movs r2, 0x5 - movs r3, 0x2 - bl write_to_rbox - adds r4, r0, 0 - ldr r1, =0x06010b40 - adds r0, r5, r1 - adds r1, r4, 0 - b _08072CF8 - .pool -_08072CB8: - mov r2, r9 - lsls r1, r2, 16 - asrs r1, 16 - add r0, sp, 0x4 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - add r1, sp, 0x4 - movs r0, 0xBA - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - add r0, sp, 0x24 - str r0, [sp] - adds r0, r1, 0 - movs r1, 0x4 - movs r2, 0x5 - movs r3, 0x2 - bl write_to_rbox - adds r4, r0, 0 - ldr r1, =0x060103e0 - adds r0, r5, r1 - adds r1, r4, 0 - movs r2, 0x1 - bl sub_8075170 - ldr r2, =0x06010b00 - adds r0, r5, r2 - adds r1, r4, 0 - adds r1, 0x20 -_08072CF8: - movs r2, 0x2 - bl sub_8075170 - ldr r0, [sp, 0x24] - bl sub_807512C - b _08072DEA - .pool -_08072D10: - ldr r1, =gUnknown_0832C3C4 - add r0, sp, 0x4 - movs r2, 0x14 - bl memcpy - ldr r1, =0x02020630 - lsls r4, r7, 4 - adds r0, r4, r7 - lsls r0, 2 - adds r6, r0, r1 - ldrh r0, [r6, 0x3A] - lsls r0, 24 - lsrs r5, r0, 24 - bl battle_type_is_double - lsls r0, 24 - lsrs r0, 24 - mov r10, r4 - cmp r0, 0x1 - beq _08072D46 - adds r0, r5, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08072D60 -_08072D46: - mov r0, r9 - lsls r1, r0, 16 - asrs r1, 16 - adds r0, r7, 0 - mov r2, r8 - bl sub_8072E0C - b _08072DEA - .pool -_08072D60: - ldrh r0, [r6, 0x3A] - lsls r0, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08072D7C - movs r6, 0x59 - mov r1, r8 - cmp r1, 0 - bne _08072D86 - movs r6, 0x1D - b _08072D86 -_08072D7C: - movs r6, 0x30 - mov r2, r8 - cmp r2, 0 - bne _08072D86 - movs r6, 0x14 -_08072D86: - mov r0, sp - adds r0, 0xA - mov r2, r9 - lsls r1, r2, 16 - asrs r1, 16 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r0, =0x020244d4 - ldr r0, [r0] - movs r1, 0xBA - lsls r1, 1 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x9 - add r2, sp, 0x4 - bl RenderTextFont9 - movs r4, 0 - ldr r1, =0x02020630 - mov r2, r10 - adds r0, r2, r7 - lsls r0, 2 - adds r5, r0, r1 -_08072DB8: - ldr r0, =0x020244d4 - ldr r0, [r0] - movs r1, 0xBA - lsls r1, 1 - adds r0, r1 - lsls r1, r4, 6 - adds r1, 0x20 - ldr r0, [r0] - adds r0, r1 - ldrh r1, [r5, 0x4] - lsls r1, 22 - lsrs r1, 22 - adds r1, r6 - adds r1, r4 - lsls r1, 5 - ldr r2, =0x06010000 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _08072DB8 -_08072DEA: - add sp, 0x28 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end heathbar_draw_hp - - thumb_func_start sub_8072E0C -sub_8072E0C: @ 8072E0C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x30 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r1, 16 - lsrs r4, r1, 16 - mov r10, r4 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - ldr r5, =0x02020630 - lsls r0, 4 - add r0, r9 - lsls r0, 2 - adds r7, r0, r5 - ldrh r0, [r7, 0x3A] - lsls r0, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08072F28 - ldr r0, =0x020244d0 - ldr r1, [r0] - movs r2, 0x3A - ldrsh r0, [r7, r2] - ldr r1, [r1] - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _08072E5E - b _080730B8 -_08072E5E: - movs r3, 0x38 - ldrsh r1, [r7, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrh r0, [r0, 0x4] - lsls r0, 22 - lsrs r5, r0, 17 - ldr r0, =0x06010000 - adds r6, r5, r0 - mov r0, r8 - cmp r0, 0 - beq _08072EDC - lsls r1, r4, 16 - asrs r1, 16 - add r0, sp, 0x4 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - add r0, sp, 0x28 - str r0, [sp] - add r0, sp, 0x4 - movs r1, 0 - movs r2, 0x5 - movs r3, 0 - bl write_to_rbox - adds r4, r0, 0 - ldr r1, =0x060100c0 - adds r0, r5, r1 - adds r1, r4, 0 - movs r2, 0x2 - bl sub_8075170 - ldr r0, [sp, 0x28] - bl sub_807512C - movs r0, 0x74 - bl sub_80728A4 - ldrh r1, [r7, 0x4] - lsls r1, 22 - lsrs r1, 17 - ldr r2, =0x06010680 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet - b _080730B8 - .pool -_08072EDC: - lsls r1, r4, 16 - asrs r1, 16 - add r0, sp, 0x4 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - add r1, sp, 0x4 - movs r0, 0xBA - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - add r0, sp, 0x28 - str r0, [sp] - adds r0, r1, 0 - movs r1, 0x4 - movs r2, 0x5 - movs r3, 0 - bl write_to_rbox - adds r4, r0, 0 - adds r0, r6, 0 - movs r1, 0 - movs r2, 0x3 - bl sub_807513C - ldr r3, =0x06010060 - adds r0, r5, r3 - adds r1, r4, 0 - movs r2, 0x3 - bl sub_8075170 - ldr r0, [sp, 0x28] - bl sub_807512C - b _080730B8 - .pool -_08072F28: - ldr r1, =gUnknown_0832C3D8 - add r0, sp, 0x4 - movs r2, 0x14 - bl memcpy - ldrh r0, [r7, 0x3A] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x2C] - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0] - ldr r2, [sp, 0x2C] - lsls r0, r2, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _08072F52 - b _080730B8 -_08072F52: - movs r6, 0x4 - mov r3, r8 - negs r0, r3 - orrs r0, r3 - asrs r0, 31 - ands r6, r0 - ldrh r0, [r7, 0x38] - lsls r0, 24 - lsrs r7, r0, 24 - mov r0, sp - adds r0, 0xA - mov r2, r10 - lsls r1, r2, 16 - asrs r1, 16 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - mov r3, r8 - cmp r3, 0 - bne _08072F82 - ldr r1, =gUnknown_085E8D3E - bl CopyString -_08072F82: - ldr r0, =0x020244d4 - ldr r0, [r0] - movs r1, 0xBA - lsls r1, 1 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x9 - add r2, sp, 0x4 - bl RenderTextFont9 - adds r4, r6, 0 - adds r0, r4, 0x3 - cmp r4, r0 - bge _08073024 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - adds r5, r0, r5 -_08072FA6: - cmp r4, 0x2 - bhi _08072FF0 - ldr r0, =0x020244d4 - ldr r0, [r0] - movs r2, 0xBA - lsls r2, 1 - adds r0, r2 - subs r1, r4, r6 - lsls r1, 6 - adds r1, 0x20 - ldr r0, [r0] - adds r0, r1 - ldrh r1, [r5, 0x4] - lsls r1, 22 - lsrs r1, 22 - adds r4, 0x1 - adds r1, r4 - lsls r1, 5 - ldr r3, =0x06010000 - adds r1, r3 - ldr r2, =0x04000008 - bl CpuSet - b _0807301A - .pool -_08072FF0: - ldr r0, =0x020244d4 - ldr r0, [r0] - movs r1, 0xBA - lsls r1, 1 - adds r0, r1 - subs r1, r4, r6 - lsls r1, 6 - adds r1, 0x20 - ldr r0, [r0] - adds r0, r1 - ldrh r1, [r5, 0x4] - lsls r1, 22 - lsrs r1, 22 - adds r1, r4, r1 - lsls r1, 5 - ldr r2, =0x06010020 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet - adds r4, 0x1 -_0807301A: - lsls r0, r4, 24 - lsrs r4, r0, 24 - adds r0, r6, 0x3 - cmp r4, r0 - blt _08072FA6 -_08073024: - mov r3, r8 - cmp r3, 0 - bne _08073084 - ldr r0, =0x020244d4 - ldr r0, [r0] - movs r1, 0xBA - lsls r1, 1 - adds r0, r1 - ldr r0, [r0] - adds r0, 0xE0 - ldr r1, =0x02020630 - lsls r4, r7, 4 - adds r4, r7 - lsls r4, 2 - adds r4, r1 - ldrh r1, [r4, 0x4] - lsls r1, 22 - lsrs r1, 17 - adds r1, 0x80 - ldr r5, =0x06010000 - adds r1, r5 - ldr r2, =0x04000008 - bl CpuSet - mov r2, r8 - str r2, [sp, 0x24] - add r0, sp, 0x24 - ldrh r1, [r4, 0x4] - lsls r1, 22 - lsrs r1, 17 - adds r1, r5 - ldr r2, =0x05000008 - bl CpuSet - b _080730B8 - .pool -_08073084: - ldr r0, [sp, 0x2C] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _080730B8 - movs r0, 0x74 - bl sub_80728A4 - ldr r2, =0x02020630 - mov r3, r9 - lsls r1, r3, 4 - add r1, r9 - lsls r1, 2 - adds r1, r2 - ldrh r1, [r1, 0x4] - lsls r1, 22 - lsrs r1, 17 - movs r2, 0xD0 - lsls r2, 3 - adds r1, r2 - ldr r2, =0x06010000 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet -_080730B8: - add sp, 0x30 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8072E0C - - thumb_func_start sub_80730D4 -sub_80730D4: @ 80730D4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x14] - ldr r1, =gUnknown_0832C3C4 - mov r0, sp - movs r2, 0x14 - bl memcpy - ldr r1, =0x02020630 - ldr r2, [sp, 0x14] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0, 0x3A] - lsls r0, 24 - lsrs r0, 24 - bl battle_get_per_side_status - ldr r1, =0x020244d4 - ldr r2, [r1] - movs r3, 0xBA - lsls r3, 1 - adds r2, r3 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 7 - movs r0, 0xA4 - lsls r0, 3 - adds r1, r0 - ldr r0, [r2] - adds r6, r0, r1 - movs r1, 0x5 - mov r8, r1 - adds r0, r4, 0 - bl GetNature - lsls r0, 24 - mov r4, sp - adds r4, 0x6 - ldr r1, =gNatureNamePointers - lsrs r0, 22 - adds r0, r1 - ldr r1, [r0] - adds r0, r4, 0 - bl CopyString - adds r0, r6, 0 - movs r1, 0x9 - mov r2, sp - bl RenderTextFont9 - movs r7, 0x6 - movs r5, 0 - mov r2, sp - adds r2, 0x9 - str r2, [sp, 0x1C] -_08073158: - mov r3, sp - adds r0, r3, r7 - ldrb r1, [r0] - adds r0, r1, 0 - subs r0, 0x37 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x13 - bls _08073176 - adds r0, r1, 0 - adds r0, 0x79 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x13 - bhi _0807318C -_08073176: - movs r0, 0x2C - b _080731AA - .pool -_0807318C: - adds r0, r1, 0 - subs r0, 0x4B - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bls _080731A4 - adds r0, r1, 0 - adds r0, 0x65 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bhi _080731A8 -_080731A4: - movs r0, 0x2D - b _080731AA -_080731A8: - movs r0, 0x2B -_080731AA: - bl sub_80728A4 - lsls r1, r5, 6 - adds r1, r6, r1 - ldr r2, =0x04000008 - bl CpuSet - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - adds r7, 0x1 - cmp r5, r8 - bcc _08073158 - movs r7, 0x1 - ldr r0, [sp, 0x14] - lsls r0, 4 - str r0, [sp, 0x18] - movs r1, 0x1 - add r1, r8 - mov r9, r1 - cmp r7, r9 - bge _08073236 - ldr r1, =0x02020630 - ldr r2, =0x04000008 - mov r10, r2 - ldr r3, [sp, 0x14] - adds r0, r3 - lsls r0, 2 - adds r0, r1 - mov r8, r0 -_080731E6: - mov r1, r8 - ldrh r0, [r1, 0x4] - lsls r0, 22 - lsrs r0, 22 - adds r5, r7, 0 - cmp r7, 0 - bge _080731F6 - adds r5, r7, 0x7 -_080731F6: - asrs r5, 3 - lsls r4, r5, 3 - subs r4, r7, r4 - adds r0, r4 - lsls r5, 6 - adds r0, r5 - lsls r0, 5 - ldr r2, =0x06010000 - adds r1, r0, r2 - adds r0, r6, 0 - mov r2, r10 - bl CpuSet - adds r6, 0x20 - mov r3, r8 - ldrh r0, [r3, 0x4] - lsls r0, 22 - lsrs r0, 22 - adds r4, 0x8 - adds r0, r4 - adds r0, r5 - lsls r0, 5 - ldr r2, =0x06010000 - adds r1, r0, r2 - adds r0, r6, 0 - mov r2, r10 - bl CpuSet - adds r6, 0x20 - adds r7, 0x1 - cmp r7, r9 - blt _080731E6 -_08073236: - ldr r6, =0x02020630 - ldr r3, [sp, 0x18] - ldr r1, [sp, 0x14] - adds r0, r3, r1 - lsls r0, 2 - adds r0, r6 - ldrh r4, [r0, 0x38] - lsls r4, 24 - lsrs r4, 24 - ldr r5, =0x0202449c - ldr r0, [r5] - adds r0, 0x7C - ldrb r1, [r0] - mov r0, sp - adds r0, 0x6 - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r0, [r5] - adds r0, 0x7B - ldrb r1, [r0] - ldr r0, [sp, 0x1C] - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalString - mov r1, sp - movs r0, 0 - strb r0, [r1, 0x5] - movs r0, 0xBA - strb r0, [r1, 0x8] - ldr r5, =0x020244d4 - ldr r0, [r5] - movs r2, 0xBA - lsls r2, 1 - adds r0, r2 - ldr r0, [r0] - movs r1, 0x9 - mov r2, sp - bl RenderTextFont9 - movs r7, 0 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r6, r0, r6 - movs r4, 0x20 -_08073296: - cmp r7, 0x1 - bgt _080732D4 - ldr r0, [r5] - movs r3, 0xBA - lsls r3, 1 - adds r0, r3 - ldr r0, [r0] - adds r0, r4 - ldrh r1, [r6, 0x4] - lsls r1, 22 - lsrs r1, 22 - adds r2, r7, 0x2 - adds r1, r2 - lsls r1, 5 - ldr r2, =0x06010000 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet - b _080732F4 - .pool -_080732D4: - ldr r0, [r5] - movs r3, 0xBA - lsls r3, 1 - adds r0, r3 - ldr r0, [r0] - adds r0, r4 - ldrh r1, [r6, 0x4] - lsls r1, 22 - lsrs r1, 22 - adds r1, r7, r1 - lsls r1, 5 - ldr r2, =0x060100c0 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet -_080732F4: - adds r4, 0x40 - adds r7, 0x1 - cmp r7, 0x4 - ble _08073296 - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80730D4 - - thumb_func_start sub_8073314 -sub_8073314: @ 8073314 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r0, 0 - mov r9, r0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r9, r0 - blt _0807332E - b _080735BA -_0807332E: - ldr r1, =0x02020630 - mov r10, r1 - ldr r2, =0x0202406e - mov r8, r2 -_08073336: - ldr r0, =0x03005d70 - mov r1, r9 - adds r6, r1, r0 - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - mov r1, r10 - adds r1, 0x1C - adds r0, r1 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - beq _08073354 - b _080735A8 -_08073354: - mov r2, r9 - lsls r0, r2, 24 - lsrs r7, r0, 24 - adds r0, r7, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0807336A - b _080735A8 -_0807336A: - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - bne _08073382 - adds r0, r7, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08073382 - b _080735A8 -_08073382: - ldr r5, =0x020244d0 - ldr r0, [r5] - ldr r3, [r0] - mov r0, r9 - lsls r4, r0, 2 - adds r3, r4, r3 - ldr r0, [r3] - lsls r0, 27 - lsrs r0, 31 - movs r2, 0x1 - eors r2, r0 - lsls r2, 4 - mov r12, r2 - ldrb r0, [r3] - movs r2, 0x11 - negs r2, r2 - adds r1, r2, 0 - ands r0, r1 - mov r1, r12 - orrs r0, r1 - strb r0, [r3] - ldr r0, [r5] - ldr r0, [r0] - adds r4, r0 - ldr r0, [r4] - lsls r0, 27 - lsrs r4, r0, 31 - adds r0, r7, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _080734B0 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - bne _080733D0 - b _080735A8 -_080733D0: - ldr r0, =0x02022fec - ldr r2, [r0] - movs r0, 0x80 - ands r2, r0 - cmp r2, 0 - beq _080733DE - b _080735A8 -_080733DE: - cmp r4, 0x1 - bne _08073468 - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r10 - ldrh r0, [r0, 0x38] - lsls r0, 24 - lsrs r1, r0, 24 - str r2, [sp] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r10 - ldrh r1, [r0, 0x4] - lsls r1, 22 - lsrs r1, 17 - ldr r2, =0x06010000 - adds r1, r2 - mov r0, sp - ldr r2, =0x05000040 - bl CpuSet - ldrb r4, [r6] - mov r1, r8 - ldrh r0, [r1] - movs r2, 0x64 - muls r0, r2 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x39 - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - movs r2, 0 - bl sub_8072E0C - ldrb r4, [r6] - mov r2, r8 - ldrh r0, [r2] - movs r1, 0x64 - muls r0, r1 - ldr r2, =0x020244ec - b _08073536 - .pool -_08073468: - ldrb r0, [r6] - bl draw_status_ailment_maybe - ldrb r0, [r6] - mov r2, r8 - ldrh r1, [r2] - movs r2, 0x64 - muls r1, r2 - ldr r2, =0x020244ec - adds r1, r2 - movs r2, 0x5 - bl healthbar_draw_field_maybe - movs r0, 0x75 - bl sub_80728A4 - ldrb r2, [r6] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - add r1, r10 - ldrh r1, [r1, 0x4] - lsls r1, 22 - lsrs r1, 17 - ldr r2, =0x06010680 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet - b _08073592 - .pool -_080734B0: - cmp r4, 0x1 - bne _0807355C - ldr r0, =0x02022fec - ldr r2, [r0] - movs r0, 0x80 - ands r2, r0 - cmp r2, 0 - beq _080734DC - ldrb r0, [r6] - mov r2, r8 - ldrh r1, [r2] - movs r2, 0x64 - muls r1, r2 - ldr r2, =0x02024744 - adds r1, r2 - bl sub_80730D4 - b _08073592 - .pool -_080734DC: - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r10 - ldrh r0, [r0, 0x38] - lsls r0, 24 - lsrs r1, r0, 24 - str r2, [sp] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r10 - ldrh r1, [r0, 0x4] - lsls r1, 22 - lsrs r1, 17 - ldr r0, =0x06010000 - adds r1, r0 - mov r0, sp - ldr r2, =0x05000040 - bl CpuSet - ldrb r4, [r6] - mov r1, r8 - ldrh r0, [r1] - movs r2, 0x64 - muls r0, r2 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x39 - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - movs r2, 0 - bl sub_8072E0C - ldrb r4, [r6] - mov r2, r8 - ldrh r0, [r2] - movs r1, 0x64 - muls r0, r1 - ldr r2, =0x02024744 -_08073536: - adds r0, r2 - movs r1, 0x3A - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - movs r2, 0x1 - bl sub_8072E0C - b _08073592 - .pool -_0807355C: - ldrb r0, [r6] - bl draw_status_ailment_maybe - ldrb r0, [r6] - mov r2, r8 - ldrh r1, [r2] - movs r5, 0x64 - muls r1, r5 - ldr r4, =0x02024744 - adds r1, r4 - movs r2, 0x5 - bl healthbar_draw_field_maybe - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08073592 - ldrb r0, [r6] - mov r2, r8 - ldrh r1, [r2] - muls r1, r5 - adds r1, r4 - movs r2, 0x4 - bl healthbar_draw_field_maybe -_08073592: - ldr r0, =0x03005d70 - add r0, r9 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r10 - ldrh r1, [r0, 0x3C] - movs r2, 0x1 - eors r1, r2 - strh r1, [r0, 0x3C] -_080735A8: - movs r0, 0x2 - add r8, r0 - movs r1, 0x1 - add r9, r1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r9, r0 - bge _080735BA - b _08073336 -_080735BA: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8073314 - - thumb_func_start sub_80735DC -sub_80735DC: @ 80735DC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - str r1, [sp, 0xC] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x8] - lsls r2, 24 - lsrs r2, 24 - adds r4, r2, 0 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x10] - cmp r4, 0 - beq _0807360C - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - beq _0807365C -_0807360C: - ldr r0, [sp, 0x8] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08073630 - movs r0, 0 - mov r9, r0 - movs r5, 0x88 - movs r4, 0x60 - movs r1, 0x64 - mov r10, r1 - ldr r2, =0x0000fffb - mov r8, r2 - b _0807366C - .pool -_08073630: - movs r3, 0x1 - mov r9, r3 - cmp r4, 0 - beq _08073642 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - bne _08073648 -_08073642: - movs r5, 0x68 - movs r4, 0x28 - b _0807364C -_08073648: - movs r5, 0x68 - movs r4, 0x10 -_0807364C: - ldr r6, =0x0000ff9c - mov r10, r6 - movs r0, 0x5 - mov r8, r0 - b _0807366C - .pool -_0807365C: - movs r1, 0x1 - mov r9, r1 - movs r5, 0x68 - movs r4, 0x28 - ldr r2, =0x0000ff9c - mov r10, r2 - movs r3, 0x5 - mov r8, r3 -_0807366C: - ldr r0, =gUnknown_0832C334 - bl LoadCompressedObjectPicUsingHeap - ldr r0, =gUnknown_0832C34C - bl LoadObjectPic - ldr r0, =gUnknown_0832C33C - bl LoadTaggedObjectPalette - ldr r0, =gUnknown_0832C344 - bl LoadTaggedObjectPalette - mov r0, r9 - lsls r6, r0, 1 - adds r0, r6, r0 - lsls r0, 3 - ldr r1, =gUnknown_0832C364 - adds r0, r1 - lsls r5, 16 - asrs r1, r5, 16 - lsls r4, 16 - asrs r2, r4, 16 - movs r3, 0xA - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x14] - lsls r0, 4 - ldr r1, [sp, 0x14] - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r7, r0, r1 - ldr r1, =gUnknown_0832C2C4 - adds r0, r7, 0 - bl SetSpriteOamTables_NoPriorityFromTable - mov r2, r10 - strh r2, [r7, 0x24] - mov r3, r8 - strh r3, [r7, 0x2E] - str r5, [sp, 0x1C] - str r4, [sp, 0x20] - mov r5, r9 - cmp r5, 0 - beq _08073700 - ldrh r0, [r7, 0x20] - subs r0, 0x60 - strh r0, [r7, 0x20] - ldrb r1, [r7, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r1 - movs r1, 0x10 - orrs r0, r1 - strb r0, [r7, 0x3] - b _08073706 - .pool -_08073700: - ldrh r0, [r7, 0x20] - adds r0, 0x60 - strh r0, [r7, 0x20] -_08073706: - movs r0, 0 - mov r8, r0 - ldr r1, =0x02020630 - mov r10, r1 - mov r7, sp - mov r2, r9 - adds r0, r6, r2 - lsls r0, 3 - str r0, [sp, 0x18] - movs r6, 0xA - movs r5, 0 -_0807371C: - ldr r0, =gUnknown_0832C394 - ldr r3, [sp, 0x20] - ldr r1, =0xfffc0000 - adds r2, r3, r1 - ldr r3, [sp, 0x18] - adds r0, r3, r0 - ldr r3, [sp, 0x1C] - asrs r1, r3, 16 - asrs r2, 16 - movs r3, 0x9 - bl AddObjectToBack - strb r0, [r7] - ldr r0, [sp, 0x10] - cmp r0, 0 - bne _0807374C - ldrb r0, [r7] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r2, =0x0202064c - adds r1, r2 - ldr r0, =sub_80741C8 - str r0, [r1] -_0807374C: - ldr r4, =0x02020630 - mov r3, r9 - cmp r3, 0 - bne _0807376E - ldrb r1, [r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r10 - strh r3, [r0, 0x24] - ldrb r1, [r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r10 - mov r1, r9 - strh r1, [r0, 0x26] -_0807376E: - ldrb r1, [r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0 - mov r2, sp - ldrh r2, [r2, 0x14] - strh r2, [r0, 0x2E] - mov r3, r9 - cmp r3, 0 - bne _080737C8 - ldrb r0, [r7] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrh r0, [r1, 0x20] - adds r0, 0x18 - adds r0, r5 - strh r0, [r1, 0x20] - ldrb r1, [r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r6, [r0, 0x30] - ldrb r1, [r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x78 - b _0807380A - .pool -_080737C8: - ldrb r0, [r7] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r4 - ldrh r3, [r2, 0x20] - subs r3, 0x18 - movs r1, 0x5 - mov r0, r8 - subs r1, r0 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 1 - subs r3, r0 - strh r3, [r2, 0x20] - ldrb r0, [r7] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r4 - movs r1, 0x6 - mov r3, r8 - subs r1, r3 - lsls r0, r1, 3 - subs r0, r1 - adds r0, 0xA - strh r0, [r2, 0x30] - ldrb r1, [r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =0x0000ff88 -_0807380A: - strh r1, [r0, 0x24] - ldrb r1, [r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - mov r1, r9 - strh r1, [r0, 0x32] - adds r7, 0x1 - adds r6, 0x7 - adds r5, 0xA - movs r2, 0x1 - add r8, r2 - mov r3, r8 - cmp r3, 0x5 - bgt _0807382C - b _0807371C -_0807382C: - ldr r0, [sp, 0x8] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0807383A - b _080739E8 -_0807383A: - ldr r0, =0x02022fec - ldr r1, [r0] - movs r2, 0x40 - ands r1, r2 - cmp r1, 0 - beq _080738F4 - ldr r5, =0x0000ffff - mov r10, r5 - ldr r6, =0x02020630 - ldr r0, =0x000003ff - adds r7, r0, 0 - ldr r1, =0xfffffc00 - mov r9, r1 - mov r4, sp - ldr r5, [sp, 0xC] - movs r2, 0x5 - mov r8, r2 -_0807385C: - ldrh r0, [r5] - cmp r0, r10 - bne _080738A8 - ldrb r0, [r4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r6 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x1 - ands r1, r7 - mov r0, r9 - ands r0, r3 - orrs r0, r1 - strh r0, [r2, 0x4] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x1 - strh r1, [r0, 0x3C] - b _080738E2 - .pool -_080738A8: - cmp r0, 0 - bne _080738C0 - ldrb r0, [r4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r6 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x3 - b _080738D8 -_080738C0: - ldr r0, [r5, 0x4] - cmp r0, 0 - beq _080738E2 - ldrb r0, [r4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r6 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x2 -_080738D8: - ands r1, r7 - mov r0, r9 - ands r0, r3 - orrs r0, r1 - strh r0, [r2, 0x4] -_080738E2: - adds r4, 0x1 - adds r5, 0x8 - movs r3, 0x1 - negs r3, r3 - add r8, r3 - mov r0, r8 - cmp r0, 0 - bge _0807385C - b _08073B9A -_080738F4: - movs r1, 0x5 - mov r10, r1 - movs r7, 0 - ldr r2, =0x02020630 - mov r8, r2 - ldr r3, =0x000003ff - mov r9, r3 - ldr r5, =0xfffffc00 - mov r12, r5 - ldr r6, [sp, 0xC] - mov r5, sp -_0807390A: - ldrh r0, [r6] - ldr r1, =0x0000ffff - cmp r0, r1 - bne _08073958 - mov r4, sp - add r4, r10 - ldrb r0, [r4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - add r2, r8 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x1 - mov r0, r9 - ands r1, r0 - mov r0, r12 - ands r0, r3 - orrs r0, r1 - strh r0, [r2, 0x4] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - movs r1, 0x1 - strh r1, [r0, 0x3C] - subs r1, 0x2 - add r10, r1 - b _080739DE - .pool -_08073958: - cmp r0, 0 - bne _08073970 - ldrb r0, [r5] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - add r2, r8 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x3 - b _080739D0 -_08073970: - ldr r1, =0x02022fec - ldr r0, [r1] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - beq _080739B8 - ldr r0, =0x0202449c - ldr r0, [r0] - movs r2, 0xA8 - lsls r2, 2 - adds r0, r2 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - lsls r0, r7, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _080739B8 - ldrb r0, [r5] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - add r2, r8 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x3 - b _080739D0 - .pool -_080739B8: - ldr r0, [r6, 0x4] - cmp r0, 0 - beq _080739DC - ldrb r0, [r5] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - add r2, r8 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x2 -_080739D0: - mov r0, r9 - ands r1, r0 - mov r0, r12 - ands r0, r3 - orrs r0, r1 - strh r0, [r2, 0x4] -_080739DC: - adds r5, 0x1 -_080739DE: - adds r6, 0x8 - adds r7, 0x1 - cmp r7, 0x5 - ble _0807390A - b _08073B9A -_080739E8: - ldr r0, =0x02022fec - ldr r1, [r0] - ldr r2, =0x00008040 - ands r1, r2 - cmp r1, 0 - beq _08073AA4 - ldr r1, =0x0000ffff - mov r10, r1 - ldr r6, =0x02020630 - ldr r2, =0x000003ff - adds r7, r2, 0 - ldr r3, =0xfffffc00 - mov r9, r3 - ldr r5, [sp, 0xC] - mov r4, sp - adds r4, 0x5 - movs r0, 0x5 - mov r8, r0 -_08073A0C: - ldrh r0, [r5] - cmp r0, r10 - bne _08073A58 - ldrb r0, [r4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r6 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x1 - ands r1, r7 - mov r0, r9 - ands r0, r3 - orrs r0, r1 - strh r0, [r2, 0x4] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x1 - strh r1, [r0, 0x3C] - b _08073A92 - .pool -_08073A58: - cmp r0, 0 - bne _08073A70 - ldrb r0, [r4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r6 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x3 - b _08073A88 -_08073A70: - ldr r0, [r5, 0x4] - cmp r0, 0 - beq _08073A92 - ldrb r0, [r4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r6 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x2 -_08073A88: - ands r1, r7 - mov r0, r9 - ands r0, r3 - orrs r0, r1 - strh r0, [r2, 0x4] -_08073A92: - subs r4, 0x1 - adds r5, 0x8 - movs r1, 0x1 - negs r1, r1 - add r8, r1 - mov r2, r8 - cmp r2, 0 - bge _08073A0C - b _08073B9A -_08073AA4: - movs r3, 0 - mov r8, r3 - movs r7, 0 - ldr r5, =0x02020630 - mov r9, r5 - ldr r6, =0x000003ff - mov r12, r6 - ldr r0, =0xfffffc00 - mov r10, r0 - ldr r6, [sp, 0xC] - mov r5, sp - adds r5, 0x5 -_08073ABC: - ldrh r0, [r6] - ldr r1, =0x0000ffff - cmp r0, r1 - bne _08073B08 - mov r4, sp - add r4, r8 - ldrb r0, [r4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - add r2, r9 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x1 - mov r0, r12 - ands r1, r0 - mov r0, r10 - ands r0, r3 - orrs r0, r1 - strh r0, [r2, 0x4] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r9 - movs r1, 0x1 - strh r1, [r0, 0x3C] - add r8, r1 - b _08073B92 - .pool -_08073B08: - cmp r0, 0 - bne _08073B20 - ldrb r0, [r5] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - add r2, r9 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x3 - b _08073B84 -_08073B20: - ldr r1, =0x02022fec - ldr r0, [r1] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - beq _08073B6C - ldr r2, =0x0202449c - ldr r0, [r2] - ldr r3, =0x000002a1 - adds r0, r3 - ldrb r1, [r0] - lsls r0, r7, 2 - ldr r2, =gUnknown_0832A328 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08073B6C - ldrb r0, [r5] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - add r2, r9 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x3 - b _08073B84 - .pool -_08073B6C: - ldr r0, [r6, 0x4] - cmp r0, 0 - beq _08073B90 - ldrb r0, [r5] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - add r2, r9 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x2 -_08073B84: - mov r0, r12 - ands r1, r0 - mov r0, r10 - ands r0, r3 - orrs r0, r1 - strh r0, [r2, 0x4] -_08073B90: - subs r5, 0x1 -_08073B92: - adds r6, 0x8 - adds r7, 0x1 - cmp r7, 0x5 - ble _08073ABC -_08073B9A: - ldr r0, =nullsub_4 - movs r1, 0x5 - bl AddTask - lsls r0, 24 - lsrs r4, r0, 24 - ldr r2, =0x03005e00 - lsls r3, r4, 2 - adds r1, r3, r4 - lsls r1, 3 - adds r0, r1, r2 - mov r5, sp - ldrh r5, [r5, 0x8] - strh r5, [r0, 0x8] - mov r6, sp - ldrh r6, [r6, 0x14] - strh r6, [r0, 0xA] - movs r0, 0 - mov r8, r0 - adds r0, r2, 0 - adds r0, 0xE - adds r1, r0 -_08073BC6: - mov r0, sp - add r0, r8 - ldrb r0, [r0] - strh r0, [r1] - adds r1, 0x2 - movs r5, 0x1 - add r8, r5 - mov r6, r8 - cmp r6, 0x5 - ble _08073BC6 - adds r0, r3, r4 - lsls r0, 3 - adds r0, r2 - mov r1, sp - ldrh r1, [r1, 0x10] - strh r1, [r0, 0x1C] - ldr r2, [sp, 0x10] - cmp r2, 0 - beq _08073C0A - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r3, [r0, 0x8] - ldrb r2, [r3, 0x9] - lsls r1, r2, 27 - lsrs r1, 29 - adds r1, 0x1 - movs r0, 0x7 - ands r1, r0 - lsls r1, 2 - movs r0, 0x1D - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x9] -_08073C0A: - movs r0, 0x72 - movs r1, 0 - bl audio_play_and_stuff - adds r0, r4, 0 - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80735DC - - thumb_func_start sub_8073C30 -sub_8073C30: @ 8073C30 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r2, =0x03005e00 - lsls r3, r0, 2 - adds r1, r3, r0 - lsls r1, 3 - adds r0, r1, r2 - ldrb r7, [r0, 0x1C] - ldrb r4, [r0, 0xA] - mov r10, r4 - ldrb r0, [r0, 0x8] - str r0, [sp, 0x8] - movs r5, 0 - str r3, [sp, 0xC] - adds r2, 0xE - adds r2, r1, r2 -_08073C5E: - mov r0, sp - adds r1, r0, r5 - ldrh r0, [r2] - strb r0, [r1] - adds r2, 0x2 - adds r5, 0x1 - cmp r5, 0x5 - ble _08073C5E - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0x10 - bl SetGpuReg - ldr r1, =0x03005e00 - ldr r0, [sp, 0xC] - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r1, 0x10 - strh r1, [r0, 0x26] - movs r5, 0 - mov r1, r10 - lsls r1, 4 - str r1, [sp, 0x10] - ldr r3, =0x02020630 - movs r6, 0xD - negs r6, r6 - mov r12, r3 - movs r4, 0x4 -_08073CA0: - mov r2, sp - adds r0, r2, r5 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r2, [r1, 0x1] - adds r0, r6, 0 - ands r0, r2 - orrs r0, r4 - strb r0, [r1, 0x1] - adds r5, 0x1 - cmp r5, 0x5 - ble _08073CA0 - ldr r2, [sp, 0x10] - add r2, r10 - lsls r2, 2 - add r2, r12 - ldrb r1, [r2, 0x1] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2, 0x1] - cmp r7, 0 - bne _08073CDA - b _08073DE0 -_08073CDA: - movs r5, 0 - mov r6, r12 - mov r9, r5 - adds r3, r6, 0 - adds r3, 0x1C - mov r4, sp - movs r7, 0 -_08073CE8: - ldr r0, [sp, 0x8] - str r3, [sp, 0x14] - bl battle_side_get_owner - lsls r0, 24 - lsrs r2, r0, 24 - ldr r3, [sp, 0x14] - cmp r2, 0 - beq _08073D4C - movs r0, 0x5 - subs r0, r5 - mov r1, sp - adds r2, r1, r0 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r7, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - mov r1, r9 - strh r1, [r0, 0x34] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - mov r1, r9 - strh r1, [r0, 0x36] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldr r1, =sub_8074158 - str r1, [r0] - ldr r2, =0x02020630 - mov r12, r2 - b _08073D82 - .pool -_08073D4C: - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r7, [r0, 0x30] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x34] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x36] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldr r1, =sub_8074158 - str r1, [r0] - ldr r0, =0x02020630 - mov r12, r0 -_08073D82: - adds r4, 0x1 - adds r7, 0x7 - adds r5, 0x1 - cmp r5, 0x5 - ble _08073CE8 - ldr r3, [sp, 0x10] - add r3, r10 - lsls r3, 2 - mov r1, r12 - adds r0, r3, r1 - movs r2, 0x2E - ldrsh r1, [r0, r2] - lsrs r2, r1, 31 - adds r1, r2 - asrs r1, 1 - movs r2, 0 - strh r1, [r0, 0x2E] - strh r2, [r0, 0x30] - mov r1, r12 - adds r1, 0x1C - adds r3, r1 - ldr r1, =sub_8074090 - str r1, [r3] - ldr r1, =gUnknown_0832C2CC - bl SetSpriteOamTables_NoPriorityFromTable - ldr r1, =0x03005e00 - ldr r0, [sp, 0xC] - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldr r1, =task_battle_throw_own_ball - str r1, [r0] - b _08073DEE - .pool -_08073DE0: - ldr r0, =0x03005e00 - ldr r1, [sp, 0xC] - add r1, r8 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_8073F98 - str r0, [r1] -_08073DEE: - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8073C30 - - thumb_func_start task_battle_throw_own_ball -task_battle_throw_own_ball: @ 8073E08 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - ldrh r0, [r4, 0x1E] - adds r1, r0, 0x1 - strh r1, [r4, 0x1E] - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08073E48 - ldrh r0, [r4, 0x26] - subs r1, r0, 0x1 - strh r1, [r4, 0x26] - lsls r0, r1, 16 - cmp r0, 0 - blt _08073E54 - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg -_08073E48: - movs r1, 0x26 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08073E54 - ldr r0, =sub_8073E64 - str r0, [r4] -_08073E54: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task_battle_throw_own_ball - - thumb_func_start sub_8073E64 -sub_8073E64: @ 8073E64 - push {r4-r7,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r7, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r3, r0, 3 - adds r4, r3, r7 - ldrb r2, [r4, 0x8] - ldrh r0, [r4, 0x26] - subs r0, 0x1 - strh r0, [r4, 0x26] - lsls r0, 16 - asrs r1, r0, 16 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - bne _08073F54 - ldrb r5, [r4, 0xA] - movs r4, 0 - ldr r6, =0x020244d0 - adds r0, r7, 0 - adds r0, 0xE - adds r2, r3, r0 -_08073E96: - mov r0, sp - adds r1, r0, r4 - ldrh r0, [r2] - strb r0, [r1] - adds r2, 0x2 - adds r4, 0x1 - cmp r4, 0x5 - ble _08073E96 - ldr r0, [r6] - ldr r3, [r0, 0x8] - ldrb r2, [r3, 0x9] - lsls r1, r2, 27 - lsrs r1, 29 - subs r1, 0x1 - movs r0, 0x7 - ands r1, r0 - lsls r1, 2 - movs r0, 0x1D - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x9] - ldr r0, [r6] - ldr r0, [r0, 0x8] - ldrb r1, [r0, 0x9] - movs r0, 0x1C - ands r0, r1 - cmp r0, 0 - bne _08073EFC - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl RemoveObjectAndFreeResources - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeResources - b _08073F32 - .pool -_08073EFC: - lsls r4, r5, 4 - adds r4, r5 - lsls r4, 2 - ldr r5, =0x02020630 - adds r4, r5 - adds r0, r4, 0 - bl obj_free_rotscale_entry - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl obj_free_rotscale_entry - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl RemoveObjectAndFreeTiles -_08073F32: - movs r4, 0x1 - ldr r5, =0x02020630 -_08073F36: - mov r1, sp - adds r0, r1, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl RemoveObjectAndFreeTiles - adds r4, 0x1 - cmp r4, 0x5 - ble _08073F36 - b _08073F8A - .pool -_08073F54: - movs r0, 0x3 - negs r0, r0 - cmp r1, r0 - bne _08073F8A - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r5, 0 - bl remove_task -_08073F8A: - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8073E64 - - thumb_func_start sub_8073F98 -sub_8073F98: @ 8073F98 - push {r4-r7,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - ldr r7, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r6, r0, 3 - adds r3, r6, r7 - ldrb r5, [r3, 0x8] - ldrh r0, [r3, 0x26] - subs r1, r0, 0x1 - strh r1, [r3, 0x26] - lsls r0, r1, 16 - asrs r2, r0, 16 - cmp r2, 0 - blt _08073FD4 - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - b _0807406A - .pool -_08073FD4: - movs r0, 0x1 - negs r0, r0 - cmp r2, r0 - bne _08074034 - ldrb r3, [r3, 0xA] - movs r5, 0 - adds r0, r7, 0 - adds r0, 0xE - adds r2, r6, r0 -_08073FE6: - mov r0, sp - adds r1, r0, r5 - ldrh r0, [r2] - strb r0, [r1] - adds r2, 0x2 - adds r5, 0x1 - cmp r5, 0x5 - ble _08073FE6 - lsls r0, r3, 4 - adds r0, r3 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl RemoveObjectAndFreeResources - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeResources - movs r5, 0x1 -_08074016: - mov r1, sp - adds r0, r1, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - adds r5, 0x1 - cmp r5, 0x5 - ble _08074016 - b _0807406A - .pool -_08074034: - movs r0, 0x3 - negs r0, r0 - cmp r2, r0 - bne _0807406A - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x4] - lsls r1, r5, 1 - adds r1, r5 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r4, 0 - bl remove_task -_0807406A: - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8073F98 - - thumb_func_start sub_8074078 -sub_8074078: @ 8074078 - push {lr} - adds r1, r0, 0 - ldrh r2, [r1, 0x24] - movs r3, 0x24 - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _0807408C - ldrh r0, [r1, 0x2E] - adds r0, r2, r0 - strh r0, [r1, 0x24] -_0807408C: - pop {r0} - bx r0 - thumb_func_end sub_8074078 - - thumb_func_start sub_8074090 -sub_8074090: @ 8074090 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x30] - adds r1, r0, 0 - adds r1, 0x20 - strh r1, [r2, 0x30] - movs r3, 0x2E - ldrsh r0, [r2, r3] - cmp r0, 0 - ble _080740AE - lsls r0, r1, 16 - asrs r0, 20 - ldrh r1, [r2, 0x24] - adds r0, r1 - b _080740B6 -_080740AE: - lsls r1, 16 - asrs r1, 20 - ldrh r0, [r2, 0x24] - subs r0, r1 -_080740B6: - strh r0, [r2, 0x24] - ldrh r1, [r2, 0x30] - movs r0, 0xF - ands r0, r1 - strh r0, [r2, 0x30] - pop {r0} - bx r0 - thumb_func_end sub_8074090 - - thumb_func_start sub_80740C4 -sub_80740C4: @ 80740C4 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x30] - movs r2, 0x30 - ldrsh r0, [r4, r2] - cmp r0, 0 - ble _080740D8 - subs r0, r1, 0x1 - strh r0, [r4, 0x30] - b _0807414E -_080740D8: - ldrh r0, [r4, 0x32] - lsls r0, 24 - lsrs r3, r0, 24 - ldrh r2, [r4, 0x34] - adds r0, r2, 0 - adds r0, 0x38 - lsls r1, r0, 16 - lsrs r2, r1, 16 - ldr r0, =0x0000fff0 - ands r2, r0 - strh r2, [r4, 0x34] - cmp r3, 0 - beq _0807410C - lsrs r0, r1, 20 - ldrh r1, [r4, 0x24] - adds r0, r1 - strh r0, [r4, 0x24] - lsls r0, 16 - cmp r0, 0 - ble _0807411C - movs r0, 0 - strh r0, [r4, 0x24] - b _0807411C - .pool -_0807410C: - lsrs r1, 20 - ldrh r0, [r4, 0x24] - subs r0, r1 - strh r0, [r4, 0x24] - lsls r0, 16 - cmp r0, 0 - bge _0807411C - strh r3, [r4, 0x24] -_0807411C: - movs r2, 0x24 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _0807414E - movs r1, 0x3F - cmp r3, 0 - beq _0807412C - movs r1, 0xC0 -_0807412C: - movs r2, 0x3C - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08074140 - lsls r1, 24 - asrs r1, 24 - movs r0, 0x74 - bl sub_80A383C - b _0807414A -_08074140: - lsls r1, 24 - asrs r1, 24 - movs r0, 0x73 - bl sub_80A3808 -_0807414A: - ldr r0, =DummyObjectCallback - str r0, [r4, 0x1C] -_0807414E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80740C4 - - thumb_func_start sub_8074158 -sub_8074158: @ 8074158 - push {r4,lr} - adds r3, r0, 0 - ldrh r1, [r3, 0x30] - movs r2, 0x30 - ldrsh r0, [r3, r2] - cmp r0, 0 - ble _0807416C - subs r0, r1, 0x1 - strh r0, [r3, 0x30] - b _080741BC -_0807416C: - ldrh r0, [r3, 0x32] - lsls r0, 24 - ldrh r2, [r3, 0x34] - adds r1, r2, 0 - adds r1, 0x38 - lsls r4, r1, 16 - lsrs r2, r4, 16 - ldr r1, =0x0000fff0 - ands r2, r1 - strh r2, [r3, 0x34] - cmp r0, 0 - beq _08074190 - lsrs r0, r4, 20 - ldrh r1, [r3, 0x24] - adds r0, r1 - b _08074196 - .pool -_08074190: - lsrs r1, r4, 20 - ldrh r0, [r3, 0x24] - subs r0, r1 -_08074196: - strh r0, [r3, 0x24] - movs r2, 0x24 - ldrsh r0, [r3, r2] - movs r2, 0x20 - ldrsh r1, [r3, r2] - adds r0, r1 - adds r0, 0x8 - movs r1, 0x80 - lsls r1, 1 - cmp r0, r1 - bls _080741BC - adds r2, r3, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =DummyObjectCallback - str r0, [r3, 0x1C] -_080741BC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8074158 - - thumb_func_start sub_80741C8 -sub_80741C8: @ 80741C8 - ldrh r2, [r0, 0x2E] - lsls r2, 24 - lsrs r2, 24 - ldr r3, =0x02020630 - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r3 - ldrh r2, [r1, 0x24] - strh r2, [r0, 0x24] - ldrh r1, [r1, 0x26] - strh r1, [r0, 0x26] - bx lr - .pool - thumb_func_end sub_80741C8 - - thumb_func_start sub_80741E8 -sub_80741E8: @ 80741E8 - push {r4-r7,lr} - sub sp, 0x14 - adds r4, r1, 0 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r5, =0x02022e2c - ldr r1, =gUnknown_085ED228 - adds r0, r5, 0 - bl CopyString - adds r0, r4, 0 - movs r1, 0x2 - add r2, sp, 0x4 - bl pokemon_getattr - add r0, sp, 0x4 - bl GetStringEnd_Limit7 - adds r0, r5, 0 - add r1, sp, 0x4 - bl AppendString - adds r5, r0, 0 - adds r0, r4, 0 - bl pokemon_get_gender - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - adds r1, r0, 0 - cmp r0, 0x1D - beq _08074236 - cmp r0, 0x20 - bne _0807424A -_08074236: - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - add r0, sp, 0x4 - bl CompareString - cmp r0, 0 - bne _0807424A - movs r6, 0x64 -_0807424A: - cmp r6, 0 - beq _08074268 - cmp r6, 0xFE - beq _08074270 - ldr r1, =gUnknown_085ED238 - b _08074272 - .pool -_08074268: - ldr r1, =gUnknown_085ED22E - b _08074272 - .pool -_08074270: - ldr r1, =gUnknown_085ED233 -_08074272: - adds r0, r5, 0 - bl CopyString - ldr r0, =0x02022e2c - add r1, sp, 0x10 - str r1, [sp] - movs r1, 0 - movs r2, 0x3 - movs r3, 0x2 - bl write_to_rbox - adds r6, r0, 0 - ldr r0, =0x02020630 - lsls r1, r7, 4 - adds r1, r7 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x4] - lsls r0, 22 - lsrs r4, r0, 17 - ldrh r0, [r1, 0x3A] - lsls r0, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _080742F0 - ldr r1, =0x06010040 - adds r0, r4, r1 - adds r1, r6, 0 - movs r2, 0x6 - bl sub_8075198 - bl battle_type_is_double - lsls r0, 24 - ldr r1, =0x06010400 - adds r5, r4, r1 - cmp r0, 0 - bne _080742C8 - ldr r0, =0x06010800 - adds r5, r4, r0 -_080742C8: - adds r1, r6, 0 - adds r1, 0xC0 - adds r0, r5, 0 - movs r2, 0x1 - bl sub_8075198 - b _080742FC - .pool -_080742F0: - ldr r1, =0x06010020 - adds r0, r4, r1 - adds r1, r6, 0 - movs r2, 0x7 - bl sub_8075198 -_080742FC: - ldr r0, [sp, 0x10] - bl sub_807512C - add sp, 0x14 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80741E8 - - thumb_func_start sub_8074310 -sub_8074310: @ 8074310 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 2 - ands r0, r1 - cmp r0, 0 - bne _080743E6 - movs r0, 0x8 - ands r1, r0 - cmp r1, 0 - bne _080743E6 - ldr r6, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r5, r0, r6 - ldrh r0, [r5, 0x3A] - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080743E6 - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - bl pokedex_flag_operation - lsls r0, 24 - cmp r0, 0 - beq _080743E6 - ldrh r0, [r5, 0x38] - lsls r0, 24 - lsrs r4, r0, 24 - cmp r7, 0 - beq _080743C4 - movs r0, 0x46 - bl sub_80728A4 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r1, r6 - ldrh r1, [r1, 0x4] - lsls r1, 22 - lsrs r1, 17 - movs r2, 0x80 - lsls r2, 1 - adds r1, r2 - ldr r2, =0x06010000 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet - b _080743E6 - .pool -_080743C4: - str r7, [sp] - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r6 - ldrh r1, [r0, 0x4] - lsls r1, 22 - lsrs r1, 17 - movs r0, 0x80 - lsls r0, 1 - adds r1, r0 - ldr r0, =0x06010000 - adds r1, r0 - ldr r2, =0x05000008 - mov r0, sp - bl CpuSet -_080743E6: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8074310 - - thumb_func_start draw_status_ailment_maybe -draw_status_ailment_maybe: @ 80743F8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldr r0, =0x02020630 - mov r2, r9 - lsls r1, r2, 4 - add r1, r9 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x3A] - lsls r0, 24 - lsrs r7, r0, 24 - ldrh r0, [r1, 0x38] - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - adds r0, r7, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08074468 - ldr r1, =0x0202406e - lsls r0, r7, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x37 - bl pokemon_getattr - adds r4, r0, 0 - bl battle_type_is_double - lsls r0, 24 - movs r3, 0x12 - mov r8, r3 - cmp r0, 0 - bne _08074484 - movs r0, 0x1A - mov r8, r0 - b _08074484 - .pool -_08074468: - ldr r1, =0x0202406e - lsls r0, r7, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x37 - bl pokemon_getattr - adds r4, r0, 0 - movs r1, 0x11 - mov r8, r1 -_08074484: - movs r0, 0x7 - ands r0, r4 - cmp r0, 0 - beq _080744AC - movs r0, 0x1B - adds r1, r7, 0 - bl sub_80746A8 - lsls r0, 24 - lsrs r0, 24 - bl sub_80728A4 - adds r6, r0, 0 - movs r0, 0x2 - b _080745B8 - .pool -_080744AC: - movs r0, 0x88 - ands r0, r4 - cmp r0, 0 - beq _080744CA - movs r0, 0x15 - adds r1, r7, 0 - bl sub_80746A8 - lsls r0, 24 - lsrs r0, 24 - bl sub_80728A4 - adds r6, r0, 0 - movs r0, 0 - b _080745B8 -_080744CA: - movs r0, 0x10 - ands r0, r4 - cmp r0, 0 - beq _080744E8 - movs r0, 0x21 - adds r1, r7, 0 - bl sub_80746A8 - lsls r0, 24 - lsrs r0, 24 - bl sub_80728A4 - adds r6, r0, 0 - movs r0, 0x4 - b _080745B8 -_080744E8: - movs r0, 0x20 - ands r0, r4 - cmp r0, 0 - beq _08074506 - movs r0, 0x1E - adds r1, r7, 0 - bl sub_80746A8 - lsls r0, 24 - lsrs r0, 24 - bl sub_80728A4 - adds r6, r0, 0 - movs r0, 0x3 - b _080745B8 -_08074506: - movs r0, 0x40 - ands r0, r4 - cmp r0, 0 - beq _08074524 - movs r0, 0x18 - adds r1, r7, 0 - bl sub_80746A8 - lsls r0, 24 - lsrs r0, 24 - bl sub_80728A4 - adds r6, r0, 0 - movs r0, 0x1 - b _080745B8 -_08074524: - movs r0, 0x27 - bl sub_80728A4 - adds r6, r0, 0 - movs r4, 0 - mov r2, r9 - lsls r0, r2, 4 - mov r3, r8 - lsls r3, 16 - mov r8, r3 - lsls r7, 2 - ldr r1, =0x02020630 - add r0, r9 - lsls r0, 2 - adds r5, r0, r1 -_08074542: - ldrh r1, [r5, 0x4] - lsls r1, 22 - lsrs r1, 22 - mov r2, r8 - asrs r0, r2, 16 - adds r1, r0 - adds r1, r4 - lsls r1, 5 - ldr r3, =0x06010000 - adds r1, r3 - adds r0, r6, 0 - ldr r2, =0x04000008 - bl CpuSet - adds r4, 0x1 - cmp r4, 0x2 - ble _08074542 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0] - adds r0, r7, r0 - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _08074598 - movs r0, 0x1 - bl sub_80728A4 - ldr r2, =0x02020630 - mov r3, r10 - lsls r1, r3, 4 - add r1, r10 - lsls r1, 2 - adds r1, r2 - ldrh r1, [r1, 0x4] - lsls r1, 22 - lsrs r1, 17 - ldr r2, =0x06010000 - adds r1, r2 - ldr r2, =0x04000010 - bl CpuSet -_08074598: - mov r0, r9 - movs r1, 0x1 - bl sub_8074310 - b _0807467A - .pool -_080745B8: - mov r1, r9 - lsls r5, r1, 4 - add r5, r9 - lsls r5, 2 - ldr r2, =0x02020630 - adds r5, r2 - ldrb r4, [r5, 0x5] - lsrs r4, 4 - lsls r4, 4 - adds r4, 0xC - adds r4, r7 - ldr r1, =gUnknown_0832C3EC - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - movs r3, 0x80 - lsls r3, 1 - adds r1, r4, r3 - movs r2, 0x2 - bl rboxid_80040B8 - lsls r4, 1 - ldr r0, =0x02037914 - adds r0, r4, r0 - ldr r1, =0x05000200 - adds r4, r1 - adds r1, r4, 0 - movs r2, 0x1 - bl CpuSet - ldrh r1, [r5, 0x4] - lsls r1, 22 - lsrs r1, 22 - add r1, r8 - lsls r1, 5 - ldr r2, =0x06010000 - mov r8, r2 - add r1, r8 - ldr r2, =0x04000018 - adds r0, r6, 0 - bl CpuSet - bl battle_type_is_double - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08074626 - adds r0, r7, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08074672 -_08074626: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0] - lsls r0, r7, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _08074672 - movs r0, 0 - bl sub_80728A4 - mov r3, r10 - lsls r4, r3, 4 - add r4, r10 - lsls r4, 2 - ldr r1, =0x02020630 - adds r4, r1 - ldrh r1, [r4, 0x4] - lsls r1, 22 - lsrs r1, 17 - add r1, r8 - ldr r5, =0x04000008 - adds r2, r5, 0 - bl CpuSet - movs r0, 0x41 - bl sub_80728A4 - ldrh r1, [r4, 0x4] - lsls r1, 22 - lsrs r1, 17 - adds r1, 0x20 - add r1, r8 - adds r2, r5, 0 - bl CpuSet -_08074672: - mov r0, r9 - movs r1, 0 - bl sub_8074310 -_0807467A: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end draw_status_ailment_maybe - - thumb_func_start sub_80746A8 -sub_80746A8: @ 80746A8 - push {lr} - lsls r0, 24 - lsls r1, 24 - lsrs r3, r1, 24 - lsrs r2, r0, 24 - adds r0, r2, 0 - subs r0, 0x15 - cmp r0, 0xC - bhi _08074768 - lsls r0, 2 - ldr r1, =_080746C8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080746C8: - .4byte _080746FC - .4byte _08074768 - .4byte _08074768 - .4byte _08074712 - .4byte _08074768 - .4byte _08074768 - .4byte _08074728 - .4byte _08074768 - .4byte _08074768 - .4byte _0807473E - .4byte _08074768 - .4byte _08074768 - .4byte _08074754 -_080746FC: - movs r2, 0x15 - cmp r3, 0 - beq _08074768 - movs r2, 0x47 - cmp r3, 0x1 - beq _08074768 - movs r2, 0x65 - cmp r3, 0x2 - bne _08074768 - movs r2, 0x56 - b _08074768 -_08074712: - movs r2, 0x18 - cmp r3, 0 - beq _08074768 - movs r2, 0x4A - cmp r3, 0x1 - beq _08074768 - movs r2, 0x68 - cmp r3, 0x2 - bne _08074768 - movs r2, 0x59 - b _08074768 -_08074728: - movs r2, 0x1B - cmp r3, 0 - beq _08074768 - movs r2, 0x4D - cmp r3, 0x1 - beq _08074768 - movs r2, 0x6B - cmp r3, 0x2 - bne _08074768 - movs r2, 0x5C - b _08074768 -_0807473E: - movs r2, 0x1E - cmp r3, 0 - beq _08074768 - movs r2, 0x50 - cmp r3, 0x1 - beq _08074768 - movs r2, 0x6E - cmp r3, 0x2 - bne _08074768 - movs r2, 0x5F - b _08074768 -_08074754: - movs r2, 0x21 - cmp r3, 0 - beq _08074768 - movs r2, 0x53 - cmp r3, 0x1 - beq _08074768 - movs r2, 0x71 - cmp r3, 0x2 - bne _08074768 - movs r2, 0x62 -_08074768: - adds r0, r2, 0 - pop {r1} - bx r1 - thumb_func_end sub_80746A8 - - thumb_func_start sub_8074770 -sub_8074770: @ 8074770 - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_085CCB2C - add r1, sp, 0x4 - str r1, [sp] - movs r1, 0 - movs r2, 0x3 - movs r3, 0x2 - bl write_to_rbox - adds r5, r0, 0 - ldr r1, =0x02020630 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - ldrh r4, [r0, 0x4] - lsls r4, 22 - lsrs r4, 17 - ldr r1, =0x06010040 - adds r0, r4, r1 - adds r1, r5, 0 - movs r2, 0x6 - bl sub_8075198 - ldr r0, =0x06010800 - adds r4, r0 - adds r5, 0xC0 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x2 - bl sub_8075198 - ldr r0, [sp, 0x4] - bl sub_807512C - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8074770 - - thumb_func_start sub_80747D8 -sub_80747D8: @ 80747D8 - push {r4,r5,lr} - sub sp, 0x18 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =gUnknown_085CCB3C - add r0, sp, 0x4 - bl CopyString - ldr r1, =0x0203a04c - ldrb r1, [r1] - movs r2, 0 - movs r3, 0x2 - bl ConvertIntToDecimalString - movs r0, 0 - add r1, sp, 0x4 - movs r2, 0x2F - bl GetStringRightAlignXOffset - adds r1, r0, 0 - add r0, sp, 0x14 - str r0, [sp] - add r0, sp, 0x4 - movs r2, 0x3 - movs r3, 0x2 - bl write_to_rbox - adds r5, r0, 0 - ldr r1, =0x02020630 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - ldrh r4, [r0, 0x4] - lsls r4, 22 - lsrs r4, 17 - ldr r1, =0x060102c0 - adds r0, r4, r1 - adds r1, r5, 0 - movs r2, 0x2 - bl sub_80751E4 - ldr r0, =0x06010a00 - adds r4, r0 - adds r5, 0x40 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x4 - bl sub_80751E4 - ldr r0, [sp, 0x14] - bl sub_807512C - add sp, 0x18 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80747D8 - - thumb_func_start healthbar_draw_field_maybe -healthbar_draw_field_maybe: @ 8074860 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r8, r1 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r2, 24 - lsrs r7, r2, 24 - ldr r1, =0x02020630 - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0, 0x3A] - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - cmp r7, 0 - bne _0807489C - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - bne _0807489C - mov r0, r9 - bl battle_side_get_owner -_0807489C: - ldr r1, =0x02020630 - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0, 0x3A] - lsls r0, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080748B8 - b _08074A18 -_080748B8: - cmp r7, 0x3 - beq _080748C0 - cmp r7, 0 - bne _080748D4 -_080748C0: - mov r0, r8 - movs r1, 0x38 - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r6, 0 - bl healthbar_draw_level -_080748D4: - cmp r7, 0x1 - bhi _080748EE - mov r0, r8 - movs r1, 0x39 - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 16 - asrs r1, 16 - adds r0, r6, 0 - movs r2, 0 - bl heathbar_draw_hp -_080748EE: - cmp r7, 0x2 - beq _080748F6 - cmp r7, 0 - bne _0807490C -_080748F6: - mov r0, r8 - movs r1, 0x3A - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 16 - asrs r1, 16 - adds r0, r6, 0 - movs r2, 0x1 - bl heathbar_draw_hp -_0807490C: - cmp r7, 0x5 - beq _08074914 - cmp r7, 0 - bne _08074948 -_08074914: - movs r0, 0 - bl load_gfxc_health_bar - mov r0, r8 - movs r1, 0x3A - bl pokemon_getattr - adds r4, r0, 0 - mov r0, r8 - movs r1, 0x39 - bl pokemon_getattr - adds r3, r0, 0 - movs r0, 0 - str r0, [sp] - mov r0, r9 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_807294C - mov r0, r9 - adds r1, r6, 0 - movs r2, 0 - movs r3, 0 - bl sub_8074AA0 -_08074948: - bl battle_type_is_double - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - cmp r0, 0 - bne _080749CE - cmp r7, 0x6 - beq _0807495E - cmp r7, 0 - bne _080749CE -_0807495E: - movs r0, 0x3 - bl load_gfxc_health_bar - mov r0, r8 - movs r1, 0xB - bl pokemon_getattr - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - mov r0, r8 - movs r1, 0x38 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - mov r0, r8 - movs r1, 0x19 - bl pokemon_getattr - adds r3, r0, 0 - ldr r0, =gExperienceTables - mov r12, r0 - lsls r1, r4, 2 - ldr r2, =gBaseStats - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - adds r0, r2 - ldrb r2, [r0, 0x13] - movs r0, 0xCA - lsls r0, 1 - muls r0, r2 - adds r1, r0 - add r1, r12 - ldr r1, [r1] - subs r3, r1 - adds r4, 0x1 - lsls r4, 2 - adds r4, r0 - add r4, r12 - ldr r2, [r4] - subs r2, r1 - mov r0, r10 - str r0, [sp] - mov r0, r9 - adds r1, r6, 0 - bl sub_807294C - mov r0, r9 - adds r1, r6, 0 - movs r2, 0x1 - movs r3, 0 - bl sub_8074AA0 -_080749CE: - cmp r7, 0x4 - beq _080749D6 - cmp r7, 0 - bne _080749DE -_080749D6: - adds r0, r6, 0 - mov r1, r8 - bl sub_80741E8 -_080749DE: - cmp r7, 0x9 - beq _080749E6 - cmp r7, 0 - bne _080749EC -_080749E6: - adds r0, r6, 0 - bl draw_status_ailment_maybe -_080749EC: - cmp r7, 0xA - bne _080749F6 - adds r0, r6, 0 - bl sub_8074770 -_080749F6: - adds r0, r7, 0 - subs r0, 0xA - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _08074A8E - adds r0, r6, 0 - bl sub_80747D8 - b _08074A8E - .pool -_08074A18: - cmp r7, 0x3 - beq _08074A20 - cmp r7, 0 - bne _08074A34 -_08074A20: - mov r0, r8 - movs r1, 0x38 - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r6, 0 - bl healthbar_draw_level -_08074A34: - cmp r7, 0x5 - beq _08074A3C - cmp r7, 0 - bne _08074A70 -_08074A3C: - movs r0, 0 - bl load_gfxc_health_bar - mov r0, r8 - movs r1, 0x3A - bl pokemon_getattr - adds r4, r0, 0 - mov r0, r8 - movs r1, 0x39 - bl pokemon_getattr - adds r3, r0, 0 - movs r0, 0 - str r0, [sp] - mov r0, r9 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_807294C - mov r0, r9 - adds r1, r6, 0 - movs r2, 0 - movs r3, 0 - bl sub_8074AA0 -_08074A70: - cmp r7, 0x4 - beq _08074A78 - cmp r7, 0 - bne _08074A80 -_08074A78: - adds r0, r6, 0 - mov r1, r8 - bl sub_80741E8 -_08074A80: - cmp r7, 0x9 - beq _08074A88 - cmp r7, 0 - bne _08074A8E -_08074A88: - adds r0, r6, 0 - bl draw_status_ailment_maybe -_08074A8E: - 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 healthbar_draw_field_maybe - - thumb_func_start sub_8074AA0 -sub_8074AA0: @ 8074AA0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - cmp r2, 0 - bne _08074AEC - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0xC] - mov r1, r8 - lsls r5, r1, 2 - adds r3, r5, r1 - lsls r3, 2 - adds r3, r0 - ldr r0, [r3, 0x4] - ldr r1, [r3, 0x8] - ldr r2, [r3, 0xC] - adds r3, 0x10 - movs r4, 0x6 - str r4, [sp] - movs r4, 0x1 - str r4, [sp, 0x4] - bl sub_8074DB8 - adds r4, r0, 0 - adds r7, r5, 0 - b _08074B48 - .pool -_08074AEC: - ldr r2, =0x020244d0 - mov r10, r2 - ldr r0, [r2] - ldr r2, [r0, 0xC] - mov r0, r8 - lsls r4, r0, 2 - adds r0, r4, r0 - lsls r6, r0, 2 - adds r2, r6, r2 - ldr r0, [r2, 0x8] - ldr r1, [r2, 0xC] - ldr r2, [r2, 0x4] - movs r3, 0x8 - bl sub_8074FE8 - lsls r0, 24 - lsrs r5, r0, 24 - adds r7, r4, 0 - cmp r5, 0 - bne _08074B16 - movs r5, 0x1 -_08074B16: - mov r1, r10 - ldr r0, [r1] - ldr r0, [r0, 0xC] - adds r4, r6, r0 - ldr r6, [r4, 0xC] - adds r0, r6, 0 - adds r1, r5, 0 - bl __divsi3 - cmp r0, 0 - bge _08074B2E - negs r0, r0 -_08074B2E: - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, [r4, 0x4] - ldr r1, [r4, 0x8] - adds r3, r4, 0 - adds r3, 0x10 - movs r2, 0x8 - str r2, [sp] - str r5, [sp, 0x4] - adds r2, r6, 0 - bl sub_8074DB8 - adds r4, r0, 0 -_08074B48: - mov r2, r9 - cmp r2, 0x1 - beq _08074B64 - cmp r2, 0 - bne _08074B6C - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0] - adds r0, r7, r0 - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _08074B6C -_08074B64: - mov r0, r8 - mov r1, r9 - bl sub_8074B9C -_08074B6C: - movs r0, 0x1 - negs r0, r0 - cmp r4, r0 - bne _08074B86 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0, 0xC] - mov r2, r8 - adds r0, r7, r2 - lsls r0, 2 - adds r0, r1 - movs r1, 0 - str r1, [r0, 0x10] -_08074B86: - adds r0, r4, 0 - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8074AA0 - - thumb_func_start sub_8074B9C -sub_8074B9C: @ 8074B9C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0 - beq _08074BB8 - cmp r1, 0x1 - beq _08074CA0 - b _08074D9E -_08074BB8: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0xC] - lsls r5, r6, 2 - adds r3, r5, r6 - lsls r3, 2 - adds r3, r0 - ldr r0, [r3, 0x4] - ldr r1, [r3, 0x8] - ldr r2, [r3, 0xC] - adds r3, 0x10 - add r4, sp, 0x8 - str r4, [sp] - movs r4, 0x6 - str r4, [sp, 0x4] - bl sub_8074E8C - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x3 - mov r9, r1 - adds r7, r5, 0 - cmp r0, 0x18 - bhi _08074BF4 - movs r2, 0x38 - mov r9, r2 - cmp r0, 0x9 - bls _08074BF4 - movs r4, 0x2F - mov r9, r4 -_08074BF4: - movs r5, 0 - ldr r0, =0x02020630 - mov r8, r0 -_08074BFA: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0, 0xC] - adds r0, r7, r6 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - ldrh r0, [r0, 0x38] - lsls r0, 24 - lsrs r4, r0, 24 - cmp r5, 0x1 - bhi _08074C5C - mov r0, r9 - bl sub_80728A4 - mov r1, sp - adds r1, r5 - adds r1, 0x8 - ldrb r1, [r1] - lsls r1, 5 - adds r0, r1 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - add r1, r8 - ldrh r1, [r1, 0x4] - lsls r1, 22 - lsrs r1, 22 - adds r2, r5, 0x2 - adds r1, r2 - lsls r1, 5 - ldr r2, =0x06010000 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet - b _08074C8A - .pool -_08074C5C: - mov r0, r9 - bl sub_80728A4 - mov r1, sp - adds r1, r5 - adds r1, 0x8 - ldrb r1, [r1] - lsls r1, 5 - adds r0, r1 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - add r1, r8 - ldrh r1, [r1, 0x4] - lsls r1, 22 - lsrs r1, 22 - adds r1, r5, r1 - lsls r1, 5 - ldr r4, =0x06010040 - adds r1, r4 - ldr r2, =0x04000008 - bl CpuSet -_08074C8A: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _08074BFA - b _08074D9E - .pool -_08074CA0: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0xC] - lsls r5, r6, 2 - adds r3, r5, r6 - lsls r3, 2 - adds r3, r0 - ldr r0, [r3, 0x4] - ldr r1, [r3, 0x8] - ldr r2, [r3, 0xC] - adds r3, 0x10 - add r4, sp, 0x8 - str r4, [sp] - movs r4, 0x8 - str r4, [sp, 0x4] - bl sub_8074E8C - ldr r1, =0x0202406e - lsls r0, r6, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x38 - bl pokemon_getattr - lsls r0, 24 - lsrs r0, 24 - adds r7, r5, 0 - cmp r0, 0x64 - bne _08074CF8 - movs r5, 0 - movs r1, 0 -_08074CE6: - mov r0, sp - adds r0, r5 - adds r0, 0x8 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x7 - bls _08074CE6 -_08074CF8: - movs r5, 0 - ldr r0, =0x02020630 - mov r8, r0 - adds r0, r7, r6 - lsls r4, r0, 2 -_08074D02: - cmp r5, 0x3 - bhi _08074D5C - movs r0, 0xC - bl sub_80728A4 - mov r1, sp - adds r1, r5 - adds r1, 0x8 - ldrb r1, [r1] - lsls r1, 5 - adds r0, r1 - ldr r1, =0x020244d0 - ldr r1, [r1] - ldr r1, [r1, 0xC] - adds r1, r4, r1 - ldrb r2, [r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - add r1, r8 - ldrh r1, [r1, 0x4] - lsls r1, 22 - lsrs r1, 22 - adds r2, r5, 0 - adds r2, 0x24 - adds r1, r2 - lsls r1, 5 - ldr r2, =0x06010000 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet - b _08074D94 - .pool -_08074D5C: - movs r0, 0xC - bl sub_80728A4 - mov r1, sp - adds r1, r5 - adds r1, 0x8 - ldrb r1, [r1] - lsls r1, 5 - adds r0, r1 - ldr r1, =0x020244d0 - ldr r1, [r1] - ldr r1, [r1, 0xC] - adds r1, r4, r1 - ldrb r2, [r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - add r1, r8 - ldrh r1, [r1, 0x4] - lsls r1, 22 - lsrs r1, 22 - adds r1, r5, r1 - lsls r1, 5 - ldr r2, =0x06010b80 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet -_08074D94: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x7 - bls _08074D02 -_08074D9E: - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8074B9C - - thumb_func_start sub_8074DB8 -sub_8074DB8: @ 8074DB8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r7, r0, 0 - adds r4, r1, 0 - mov r8, r2 - adds r5, r3, 0 - ldr r1, [sp, 0x18] - ldr r0, [sp, 0x1C] - lsls r0, 16 - lsrs r3, r0, 16 - lsls r1, 27 - lsrs r2, r1, 24 - ldr r1, [r5] - ldr r0, =0xffff8000 - cmp r1, r0 - bne _08074DEA - cmp r7, r2 - bge _08074DE8 - lsls r0, r4, 8 - str r0, [r5] - b _08074DEA - .pool -_08074DE8: - str r4, [r5] -_08074DEA: - mov r0, r8 - subs r4, r0 - cmp r4, 0 - bge _08074DF6 - movs r4, 0 - b _08074DFC -_08074DF6: - cmp r4, r7 - ble _08074DFC - adds r4, r7, 0 -_08074DFC: - cmp r7, r2 - bge _08074E18 - ldr r0, [r5] - asrs r1, r0, 8 - adds r6, r0, 0 - cmp r4, r1 - bne _08074E24 - movs r0, 0xFF - ands r0, r6 - cmp r0, 0 - bne _08074E24 - movs r0, 0x1 - negs r0, r0 - b _08074E80 -_08074E18: - ldr r6, [r5] - cmp r4, r6 - bne _08074E24 - movs r0, 0x1 - negs r0, r0 - b _08074E80 -_08074E24: - cmp r7, r2 - bge _08074E5E - lsls r0, r7, 8 - adds r1, r2, 0 - bl __divsi3 - mov r1, r8 - cmp r1, 0 - bge _08074E42 - adds r0, r6, r0 - str r0, [r5] - asrs r2, r0, 8 - cmp r2, r4 - blt _08074E7E - b _08074E56 -_08074E42: - subs r0, r6, r0 - str r0, [r5] - asrs r2, r0, 8 - movs r1, 0xFF - ands r0, r1 - cmp r0, 0 - ble _08074E52 - adds r2, 0x1 -_08074E52: - cmp r2, r4 - bgt _08074E7E -_08074E56: - lsls r0, r4, 8 - str r0, [r5] - adds r2, r4, 0 - b _08074E7E -_08074E5E: - mov r0, r8 - cmp r0, 0 - bge _08074E70 - ldr r0, [r5] - adds r0, r3 - str r0, [r5] - cmp r0, r4 - ble _08074E7C - b _08074E7A -_08074E70: - ldr r0, [r5] - subs r0, r3 - str r0, [r5] - cmp r0, r4 - bge _08074E7C -_08074E7A: - str r4, [r5] -_08074E7C: - ldr r2, [r5] -_08074E7E: - adds r0, r2, 0 -_08074E80: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8074DB8 - - thumb_func_start sub_8074E8C -sub_8074E8C: @ 8074E8C - push {r4-r7,lr} - adds r4, r0, 0 - mov r12, r3 - ldr r7, [sp, 0x14] - ldr r0, [sp, 0x18] - lsls r0, 24 - lsrs r6, r0, 24 - subs r5, r1, r2 - cmp r5, 0 - bge _08074EA4 - movs r5, 0 - b _08074EAA -_08074EA4: - cmp r5, r4 - ble _08074EAA - adds r5, r4, 0 -_08074EAA: - lsls r0, r6, 27 - lsrs r3, r0, 24 - movs r1, 0 - cmp r1, r6 - bcs _08074EC4 - movs r2, 0 -_08074EB6: - adds r0, r7, r1 - strb r2, [r0] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, r6 - bcc _08074EB6 -_08074EC4: - cmp r4, r3 - bge _08074ED8 - mov r1, r12 - ldr r0, [r1] - muls r0, r3 - adds r1, r4, 0 - bl __divsi3 - asrs r0, 8 - b _08074EE4 -_08074ED8: - mov r1, r12 - ldr r0, [r1] - muls r0, r3 - adds r1, r4, 0 - bl __divsi3 -_08074EE4: - lsls r0, 24 - lsrs r2, r0, 24 - adds r3, r2, 0 - cmp r3, 0 - bne _08074EFA - cmp r5, 0 - ble _08074EFA - movs r0, 0x1 - strb r0, [r7] - movs r3, 0x1 - b _08074F1E -_08074EFA: - movs r1, 0 - movs r4, 0x8 -_08074EFE: - cmp r1, r6 - bcs _08074F1E - cmp r2, 0x7 - bls _08074F1A - adds r0, r7, r1 - strb r4, [r0] - adds r0, r2, 0 - subs r0, 0x8 - lsls r0, 24 - lsrs r2, r0, 24 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - b _08074EFE -_08074F1A: - adds r0, r7, r1 - strb r2, [r0] -_08074F1E: - adds r0, r3, 0 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8074E8C - - thumb_func_start sub_8074F28 -sub_8074F28: @ 8074F28 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - adds r5, r0, 0 - adds r6, r1, 0 - adds r4, r2, 0 - mov r8, r3 - ldr r0, [r5] - ldr r1, [r5, 0x4] - ldr r2, [r5, 0x8] - movs r3, 0x6 - str r3, [sp] - movs r3, 0x1 - str r3, [sp, 0x4] - adds r3, r6, 0 - bl sub_8074DB8 - lsls r0, 16 - lsrs r7, r0, 16 - adds r0, r5, 0 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_8074F88 - ldr r0, [r5] - cmp r0, 0x2F - bgt _08074F68 - ldr r0, [r6] - lsls r0, 8 - lsrs r1, r0, 16 - b _08074F6A -_08074F68: - ldrh r1, [r6] -_08074F6A: - movs r2, 0 - ldrsh r0, [r5, r2] - lsls r1, 16 - asrs r1, 16 - mov r2, r8 - bl sub_8072304 - lsls r0, r7, 16 - asrs r0, 16 - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8074F28 - - thumb_func_start sub_8074F88 -sub_8074F88: @ 8074F88 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x1C - adds r5, r0, 0 - adds r3, r1, 0 - mov r8, r2 - ldr r0, [r5] - ldr r1, [r5, 0x4] - ldr r2, [r5, 0x8] - add r4, sp, 0x8 - str r4, [sp] - movs r4, 0x6 - str r4, [sp, 0x4] - bl sub_8074E8C - movs r3, 0 - add r7, sp, 0x10 - mov r12, r7 - ldrb r0, [r5, 0xC] - lsls r6, r0, 27 - ldr r4, [r5, 0x10] -_08074FB4: - lsls r2, r3, 1 - add r2, r12 - lsrs r1, r6, 15 - mov r0, sp - adds r0, r3 - adds r0, 0x8 - ldrb r0, [r0] - adds r0, r4, r0 - orrs r1, r0 - strh r1, [r2] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x5 - bls _08074FB4 - adds r0, r7, 0 - mov r1, r8 - movs r2, 0x6 - bl CpuSet - add sp, 0x1C - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8074F88 - - thumb_func_start sub_8074FE8 -sub_8074FE8: @ 8074FE8 - push {r4-r7,lr} - adds r6, r2, 0 - lsls r3, 27 - lsrs r7, r3, 24 - subs r5, r0, r1 - cmp r5, 0 - bge _08074FFA - movs r5, 0 - b _08075000 -_08074FFA: - cmp r5, r6 - ble _08075000 - adds r5, r6, 0 -_08075000: - muls r0, r7 - adds r1, r6, 0 - bl __divsi3 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - muls r0, r7 - adds r1, r6, 0 - bl __divsi3 - lsls r4, 24 - asrs r4, 24 - lsls r0, 24 - asrs r0, 24 - subs r0, r4, r0 - cmp r0, 0 - bge _08075028 - negs r0, r0 -_08075028: - lsls r0, 24 - lsrs r0, 24 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8074FE8 - - thumb_func_start sub_8075034 -sub_8075034: @ 8075034 - push {r4,lr} - lsls r2, 24 - lsrs r2, 24 - lsls r0, 16 - asrs r4, r0, 16 - adds r0, r4, 0 - muls r0, r2 - lsls r1, 16 - asrs r1, 16 - bl __divsi3 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08075058 - cmp r4, 0 - ble _08075058 - movs r0, 0x1 -_08075058: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8075034 - - thumb_func_start sub_8075060 -sub_8075060: @ 8075060 - push {lr} - lsls r0, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - cmp r0, r1 - bne _08075072 - movs r0, 0x4 - b _0807508E -_08075072: - movs r2, 0x30 - bl sub_8075034 - lsls r0, 24 - lsrs r1, r0, 24 - movs r0, 0x3 - cmp r1, 0x18 - bhi _0807508E - movs r0, 0x2 - cmp r1, 0x9 - bhi _0807508E - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 -_0807508E: - pop {r1} - bx r1 - thumb_func_end sub_8075060 - - thumb_func_start write_to_rbox -write_to_rbox: @ 8075094 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - mov r10, r0 - mov r8, r1 - mov r9, r2 - adds r5, r3, 0 - ldr r7, [sp, 0x40] - ldr r0, =gUnknown_0832C3F8 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp, 0x18] - str r1, [sp, 0x1C] - add r0, sp, 0x18 - bl AddWindow - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r6, r4, 24 - lsrs r6, 24 - lsls r1, r5, 4 - orrs r1, r5 - lsls r1, 24 - lsrs r1, 24 - adds r0, r6, 0 - bl FillWindowPixelBuffer - add r0, sp, 0x14 - movs r2, 0 - strb r5, [r0] - adds r1, r0, 0 - movs r0, 0x1 - strb r0, [r1, 0x1] - movs r0, 0x3 - strb r0, [r1, 0x2] - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - mov r0, r9 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - str r2, [sp] - str r2, [sp, 0x4] - str r1, [sp, 0x8] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0xC] - mov r0, r10 - str r0, [sp, 0x10] - adds r0, r6, 0 - movs r1, 0 - mov r2, r8 - mov r3, r9 - bl AddTextPrinterParametrized2 - str r4, [r7] - adds r0, r6, 0 - movs r1, 0x7 - bl GetWindowAttribute - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end write_to_rbox - - thumb_func_start sub_807512C -sub_807512C: @ 807512C - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl RemoveWindow - pop {r0} - bx r0 - thumb_func_end sub_807512C - - thumb_func_start sub_807513C -sub_807513C: @ 807513C - push {lr} - sub sp, 0x4 - adds r3, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r1, r0, 8 - adds r0, r1 - lsls r1, r0, 16 - adds r0, r1 - str r0, [sp] - lsls r2, 3 - ldr r0, =0x001fffff - ands r2, r0 - 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 - .pool - thumb_func_end sub_807513C - - thumb_func_start sub_8075170 -sub_8075170: @ 8075170 - push {lr} - adds r3, r0, 0 - adds r0, r1, 0 - movs r1, 0x80 - lsls r1, 1 - adds r0, r1 - lsls r2, 3 - ldr r1, =0x001fffff - ands r2, r1 - movs r1, 0x80 - lsls r1, 19 - orrs r2, r1 - adds r1, r3, 0 - bl CpuSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_8075170 - - thumb_func_start sub_8075198 -sub_8075198: @ 8075198 - push {r4-r6,lr} - adds r6, r0, 0 - adds r5, r1, 0 - adds r4, r2, 0 - movs r1, 0x80 - lsls r1, 1 - adds r0, r5, r1 - adds r1, r6, r1 - lsls r2, r4, 3 - ldr r3, =0x001fffff - ands r2, r3 - movs r3, 0x80 - lsls r3, 19 - orrs r2, r3 - bl CpuSet - cmp r4, 0 - ble _080751D4 -_080751BC: - adds r0, r5, 0 - adds r0, 0x14 - adds r1, r6, 0 - adds r1, 0x14 - ldr r2, =0x04000003 - bl CpuSet - adds r6, 0x20 - adds r5, 0x20 - subs r4, 0x1 - cmp r4, 0 - bne _080751BC -_080751D4: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8075198 - - thumb_func_start sub_80751E4 -sub_80751E4: @ 80751E4 - push {r4-r6,lr} - adds r6, r0, 0 - adds r5, r1, 0 - lsls r4, r2, 3 - ldr r0, =0x001fffff - ands r4, r0 - movs r0, 0x80 - lsls r0, 19 - orrs r4, r0 - adds r0, r5, 0 - adds r1, r6, 0 - adds r2, r4, 0 - bl CpuSet - movs r0, 0x80 - lsls r0, 1 - adds r5, r0 - adds r6, r0 - adds r0, r5, 0 - adds r1, r6, 0 - adds r2, r4, 0 - bl CpuSet - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80751E4 - - thumb_func_start sub_807521C -sub_807521C: @ 807521C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 16 - lsrs r7, r1, 16 - lsls r2, 24 - lsrs r4, r2, 24 - ldr r5, =gUnknown_0831C620 - ldrh r0, [r5, 0x6] - bl GetObjectTileRangeStartByTag - lsls r0, 16 - ldr r1, =0xffff0000 - cmp r0, r1 - bne _0807524E - adds r0, r5, 0 - bl LoadCompressedObjectPicUsingHeap - ldr r0, =gUnknown_0831C628 - bl LoadCompressedObjectPaletteUsingHeap -_0807524E: - ldr r0, =sub_8075370 - bl object_new_hidden_with_callback - mov r8, r0 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r5, r0, 4 - add r5, r8 - lsls r5, 2 - ldr r0, =0x02020630 - adds r5, r0 - strh r4, [r5, 0x30] - ldr r0, =gUnknown_0831C688 - mov r9, r0 - lsls r6, 16 - asrs r0, r6, 16 - mov r10, r0 - ldr r0, =0xfff00000 - adds r6, r0 - asrs r6, 16 - lsls r4, r7, 16 - asrs r7, r4, 16 - adds r4, r0 - asrs r4, 16 - mov r0, r9 - adds r1, r6, 0 - adds r2, r4, 0 - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - mov r0, r8 - strh r0, [r1, 0x2E] - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - adds r0, r1, 0 - bl AnimateObject - mov r0, r9 - mov r1, r10 - adds r2, r4, 0 - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - mov r0, r8 - strh r0, [r4, 0x2E] - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectImageAnim - adds r0, r4, 0 - bl AnimateObject - mov r0, r9 - adds r1, r6, 0 - adds r2, r7, 0 - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - mov r0, r8 - strh r0, [r4, 0x2E] - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - adds r0, r4, 0 - movs r1, 0x2 - bl StartObjectImageAnim - adds r0, r4, 0 - bl AnimateObject - mov r0, r9 - mov r1, r10 - adds r2, r7, 0 - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - mov r0, r8 - strh r0, [r4, 0x2E] - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - adds r0, r4, 0 - movs r1, 0x3 - bl StartObjectImageAnim - adds r0, r4, 0 - bl AnimateObject - mov r0, r8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_807521C - - thumb_func_start sub_8075370 -sub_8075370: @ 8075370 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080753A8 - ldr r0, =gUnknown_0831C620 - ldrh r0, [r0, 0x6] - bl FreeObjectTilesByTag - ldr r0, =gUnknown_0831C628 - ldrh r0, [r0, 0x4] - bl FreeObjectPaletteByTag - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080753A4 - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - b _080753A8 - .pool -_080753A4: - ldr r0, =DummyObjectCallback - str r0, [r4, 0x1C] -_080753A8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8075370 - - thumb_func_start sub_80753B4 -sub_80753B4: @ 80753B4 - push {lr} - adds r3, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080753DE - ldr r2, =0x02020630 - movs r0, 0x2E - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x2E] - subs r1, 0x1 - strh r1, [r0, 0x2E] - adds r0, r3, 0 - bl RemoveObjectAndFreeTiles -_080753DE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80753B4 - - thumb_func_start sub_80753E8 -sub_80753E8: @ 80753E8 - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 24 - lsrs r5, 24 - ldr r1, =0x020244b9 - movs r0, 0x1 - strb r0, [r1] - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r6, =0x02024064 - ldrb r1, [r6] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0] - ldr r0, =sub_8075450 - movs r1, 0x5 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0xA] - strh r5, [r1, 0xC] - ldrb r0, [r6] - strh r0, [r1, 0xE] - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80753E8 - - thumb_func_start sub_8075450 -sub_8075450: @ 8075450 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - movs r0, 0 - str r0, [sp] - ldr r1, =0x03005e00 - mov r2, r10 - lsls r0, r2, 2 - add r0, r10 - lsls r0, 3 - adds r1, r0, r1 - ldrh r2, [r1, 0x8] - movs r3, 0x8 - ldrsh r0, [r1, r3] - cmp r0, 0 - bne _08075488 - adds r0, r2, 0x1 - strh r0, [r1, 0x8] - b _08075602 - .pool -_08075488: - ldrh r0, [r1, 0xC] - mov r8, r0 - ldrb r5, [r1, 0xE] - adds r0, r5, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080754B4 - ldr r1, =0x0202406e - lsls r0, r5, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - b _080754C2 - .pool -_080754B4: - ldr r1, =0x0202406e - lsls r0, r5, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec -_080754C2: - adds r0, r1 - movs r1, 0x26 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - bl ball_number_to_ball_processing_index - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl sub_8076A78 - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 3 - ldr r1, =gUnknown_0832C588 - adds r0, r1 - movs r1, 0x20 - movs r2, 0x50 - movs r3, 0x1D - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - ldr r2, =0x02020630 - mov r9, r2 - lsls r0, r7, 4 - adds r0, r7 - lsls r6, r0, 2 - adds r4, r6, r2 - movs r0, 0x80 - strh r0, [r4, 0x2E] - movs r3, 0 - strh r3, [r4, 0x30] - mov r0, r8 - strh r0, [r4, 0x3C] - mov r2, r8 - cmp r2, 0xFE - beq _08075548 - cmp r2, 0xFF - bne _08075584 - ldr r0, =0x0202420c - strb r5, [r0] - movs r0, 0x18 - strh r0, [r4, 0x20] - movs r0, 0x44 - strh r0, [r4, 0x22] - mov r0, r9 - adds r0, 0x1C - adds r0, r6, r0 - ldr r1, =sub_80761B4 - str r1, [r0] - b _08075592 - .pool -_08075548: - adds r0, r5, 0 - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x20] - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x18 - strh r0, [r4, 0x22] - ldr r0, =0x0202420c - strb r5, [r0] - movs r3, 0 - strh r3, [r4, 0x2E] - mov r0, r9 - adds r0, 0x1C - adds r0, r6, r0 - ldr r1, =sub_8076398 - str r1, [r0] - b _08075592 - .pool -_08075584: - movs r0, 0x1 - bl battle_get_side_with_given_state - ldr r1, =0x0202420c - strb r0, [r1] - movs r0, 0x1 - str r0, [sp] -_08075592: - ldr r0, =0x02020630 - lsls r1, r7, 4 - adds r1, r7 - lsls r1, 2 - adds r4, r1, r0 - ldr r5, =0x0202420c - ldrb r0, [r5] - strh r0, [r4, 0x3A] - ldr r2, [sp] - cmp r2, 0 - bne _080755B8 - mov r0, r10 - bl remove_task - b _08075602 - .pool -_080755B8: - movs r0, 0x22 - strh r0, [r4, 0x2E] - ldrb r0, [r5] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x32] - ldrb r0, [r5] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x10 - strh r0, [r4, 0x36] - ldr r0, =0x0000ffd8 - strh r0, [r4, 0x38] - adds r0, r4, 0 - bl sub_80A68D4 - mov r3, r10 - strh r3, [r4, 0x6] - ldr r1, =0x03005e00 - mov r2, r10 - lsls r0, r2, 2 - add r0, r10 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r5] - strh r1, [r0, 0x10] - ldr r1, =nullsub_4 - str r1, [r0] - movs r0, 0x3D - bl audio_play -_08075602: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8075450 - - thumb_func_start objc_0804ABD4 -objc_0804ABD4: @ 8075620 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r7, r0, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - beq _080756C0 - ldrb r6, [r7, 0x6] - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldrb r5, [r0, 0x10] - ldrb r0, [r0, 0xC] - mov r8, r0 - adds r0, r7, 0 - movs r1, 0x1 - bl StartObjectImageAnim - adds r2, r7, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - ldrh r0, [r7, 0x24] - ldrh r1, [r7, 0x20] - adds r0, r1 - movs r1, 0 - strh r0, [r7, 0x20] - ldrh r0, [r7, 0x26] - ldrh r2, [r7, 0x22] - adds r0, r2 - strh r0, [r7, 0x22] - strh r1, [r7, 0x24] - strh r1, [r7, 0x26] - strh r1, [r7, 0x38] - adds r0, r5, 0 - bl sub_8076B14 - lsls r0, 16 - lsrs r0, 16 - bl ball_number_to_ball_processing_index - adds r4, r0, 0 - ldrh r0, [r7, 0x20] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r7, 0x22] - subs r1, 0x5 - lsls r1, 24 - lsrs r1, 24 - lsls r4, 24 - lsrs r4, 24 - str r4, [sp] - movs r2, 0x1 - movs r3, 0x1C - bl sub_8171D98 - movs r0, 0 - adds r1, r5, 0 - movs r2, 0xE - adds r3, r4, 0 - bl sub_81729E8 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7, 0x2E] - strh r5, [r7, 0x3A] - mov r0, r8 - strh r0, [r7, 0x3C] - adds r0, r6, 0 - bl remove_task - ldr r0, =sub_80756D4 - str r0, [r7, 0x1C] -_080756C0: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end objc_0804ABD4 - - thumb_func_start sub_80756D4 -sub_80756D4: @ 80756D4 - ldr r1, =sub_80756E0 - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_80756D4 - - thumb_func_start sub_80756E0 -sub_80756E0: @ 80756E0 - push {r4-r7,lr} - adds r6, r0, 0 - ldrh r0, [r6, 0x38] - adds r0, 0x1 - movs r7, 0 - strh r0, [r6, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA - bne _0807573A - strh r7, [r6, 0x38] - ldr r0, =sub_807574C - str r0, [r6, 0x1C] - ldr r5, =0x020241e4 - movs r1, 0x3A - ldrsh r0, [r6, r1] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - movs r1, 0x2 - bl StartObjectRotScalAnim - movs r1, 0x3A - ldrsh r0, [r6, r1] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl AnimateObject - movs r1, 0x3A - ldrsh r0, [r6, r1] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r7, [r0, 0x30] -_0807573A: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80756E0 - - thumb_func_start sub_807574C -sub_807574C: @ 807574C - push {r4-r6,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xB - bne _08075764 - movs r0, 0x3C - bl audio_play -_08075764: - ldr r6, =0x02020630 - ldr r5, =0x020241e4 - movs r1, 0x3A - ldrsh r0, [r4, r1] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r6 - adds r0, r1, 0 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 26 - cmp r0, 0 - bge _080757BC - adds r0, r4, 0 - movs r1, 0x2 - bl StartObjectImageAnim - movs r2, 0x3A - ldrsh r0, [r4, r2] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - movs r0, 0 - strh r0, [r4, 0x38] - ldr r0, =sub_80757E4 - str r0, [r4, 0x1C] - b _080757DC - .pool -_080757BC: - ldrh r0, [r1, 0x30] - adds r0, 0x60 - strh r0, [r1, 0x30] - movs r1, 0x3A - ldrsh r0, [r4, r1] - adds r0, r5 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - movs r2, 0x30 - ldrsh r0, [r1, r2] - negs r0, r0 - asrs r0, 8 - strh r0, [r1, 0x26] -_080757DC: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_807574C - - thumb_func_start sub_80757E4 -sub_80757E4: @ 80757E4 - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0807582C - ldrh r0, [r4, 0x38] - adds r0, 0x1 - movs r1, 0 - strh r0, [r4, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bne _0807582C - strh r1, [r4, 0x34] - movs r0, 0x20 - strh r0, [r4, 0x36] - strh r1, [r4, 0x38] - movs r0, 0 - movs r1, 0x20 - bl cosine - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - movs r0, 0x36 - ldrsh r1, [r4, r0] - movs r0, 0 - bl cosine - negs r0, r0 - strh r0, [r4, 0x26] - ldr r0, =sub_8075838 - str r0, [r4, 0x1C] -_0807582C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80757E4 - - thumb_func_start sub_8075838 -sub_8075838: @ 8075838 - push {r4,r5,lr} - adds r4, r0, 0 - movs r5, 0 - ldrh r0, [r4, 0x34] - movs r1, 0xFF - ands r1, r0 - cmp r1, 0 - beq _0807584E - cmp r1, 0x1 - beq _080758C2 - b _080758EE -_0807584E: - movs r1, 0x38 - ldrsh r0, [r4, r1] - movs r2, 0x36 - ldrsh r1, [r4, r2] - bl cosine - negs r0, r0 - strh r0, [r4, 0x26] - ldrh r1, [r4, 0x38] - adds r1, 0x4 - ldrh r2, [r4, 0x34] - lsls r0, r2, 16 - asrs r0, 24 - adds r1, r0 - strh r1, [r4, 0x38] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x3F - ble _080758EE - ldrh r0, [r4, 0x36] - subs r0, 0xA - strh r0, [r4, 0x36] - ldr r1, =0x00000101 - adds r0, r2, r1 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 24 - cmp r0, 0x4 - bne _0807588A - movs r5, 0x1 -_0807588A: - cmp r0, 0x2 - beq _080758AA - cmp r0, 0x2 - bgt _0807589C - cmp r0, 0x1 - beq _080758A2 - b _080758BA - .pool -_0807589C: - cmp r0, 0x3 - beq _080758B2 - b _080758BA -_080758A2: - movs r0, 0x38 - bl audio_play - b _080758EE -_080758AA: - movs r0, 0x39 - bl audio_play - b _080758EE -_080758B2: - movs r0, 0x3A - bl audio_play - b _080758EE -_080758BA: - movs r0, 0x3B - bl audio_play - b _080758EE -_080758C2: - movs r2, 0x38 - ldrsh r0, [r4, r2] - movs r2, 0x36 - ldrsh r1, [r4, r2] - bl cosine - negs r0, r0 - strh r0, [r4, 0x26] - ldrh r1, [r4, 0x38] - subs r1, 0x4 - ldrh r2, [r4, 0x34] - lsls r0, r2, 16 - asrs r0, 24 - subs r1, r0 - strh r1, [r4, 0x38] - lsls r1, 16 - cmp r1, 0 - bgt _080758EE - strh r5, [r4, 0x38] - ldr r0, =0xffffff00 - ands r0, r2 - strh r0, [r4, 0x34] -_080758EE: - cmp r5, 0 - beq _08075926 - movs r5, 0 - strh r5, [r4, 0x34] - movs r0, 0x40 - movs r1, 0x20 - bl cosine - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - strh r5, [r4, 0x26] - movs r2, 0x3C - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _0807591C - ldr r0, =sub_8075D14 - str r0, [r4, 0x1C] - b _08075926 - .pool -_0807591C: - ldr r0, =sub_8075930 - str r0, [r4, 0x1C] - movs r0, 0x1 - strh r0, [r4, 0x36] - strh r5, [r4, 0x38] -_08075926: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8075838 - - thumb_func_start sub_8075930 -sub_8075930: @ 8075930 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1F - bne _08075964 - movs r0, 0 - strh r0, [r4, 0x34] - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim - ldr r0, =sub_8075970 - str r0, [r4, 0x1C] - movs r0, 0x17 - bl audio_play -_08075964: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8075930 - - thumb_func_start sub_8075970 -sub_8075970: @ 8075970 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x34] - movs r1, 0xFF - ands r1, r0 - cmp r1, 0x4 - bhi _08075A70 - lsls r0, r1, 2 - ldr r1, =_0807598C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0807598C: - .4byte _080759A0 - .4byte _080759D2 - .4byte _080759A0 - .4byte _08075A26 - .4byte _08075A70 -_080759A0: - ldrh r0, [r4, 0x36] - ldrh r2, [r4, 0x24] - adds r1, r0, r2 - strh r1, [r4, 0x24] - ldrh r1, [r4, 0x38] - adds r0, r1 - strh r0, [r4, 0x38] - adds r2, r4, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - ldrh r0, [r4, 0x38] - adds r0, 0x3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x6 - bls _08075AB6 - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - movs r0, 0 - strh r0, [r4, 0x38] - b _08075AB6 -_080759D2: - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bne _08075A18 - movs r0, 0 - strh r0, [r4, 0x38] - ldrh r0, [r4, 0x36] - negs r0, r0 - strh r0, [r4, 0x36] - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - adds r2, r4, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - movs r2, 0x36 - ldrsh r0, [r4, r2] - cmp r0, 0 - bge _08075A0E - adds r0, r4, 0 - movs r1, 0x2 - bl sub_80082B8 - b _08075AB6 -_08075A0E: - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80082B8 - b _08075AB6 -_08075A18: - adds r0, r4, 0 - adds r0, 0x2C - ldrb r1, [r0] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0] - b _08075AB6 -_08075A26: - movs r1, 0x80 - lsls r1, 1 - adds r0, r1, 0 - ldrh r2, [r4, 0x34] - adds r0, r2 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 24 - movs r2, 0x3C - ldrsh r1, [r4, r2] - cmp r0, r1 - bne _08075A48 - ldr r0, =sub_8075D14 - str r0, [r4, 0x1C] - b _08075AB6 - .pool -_08075A48: - cmp r1, 0x4 - bne _08075A5C - cmp r0, 0x3 - bne _08075A5C - ldr r0, =sub_8075FB4 - str r0, [r4, 0x1C] - b _08075A62 - .pool -_08075A5C: - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] -_08075A62: - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - b _08075AB6 -_08075A70: - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1F - bne _08075AB6 - movs r0, 0 - strh r0, [r4, 0x38] - ldrh r1, [r4, 0x34] - ldr r0, =0xffffff00 - ands r0, r1 - strh r0, [r4, 0x34] - adds r0, r4, 0 - movs r1, 0x3 - bl StartObjectRotScalAnim - movs r1, 0x36 - ldrsh r0, [r4, r1] - cmp r0, 0 - bge _08075AA8 - adds r0, r4, 0 - movs r1, 0x2 - bl StartObjectRotScalAnim - b _08075AB0 - .pool -_08075AA8: - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim -_08075AB0: - movs r0, 0x17 - bl audio_play -_08075AB6: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8075970 - - thumb_func_start c3_0804B070 -c3_0804B070: @ 8075ABC - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r2, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r2 - ldrb r1, [r0, 0xC] - mov r12, r1 - ldrb r5, [r0, 0xA] - ldrh r6, [r0, 0x8] - ldrb r3, [r0, 0xE] - mov r8, r3 - ldrb r7, [r0, 0x10] - movs r3, 0x12 - ldrsh r1, [r0, r3] - lsls r3, r1, 16 - ldrh r1, [r0, 0x14] - orrs r3, r1 - movs r1, 0x26 - ldrsh r0, [r0, r1] - cmp r0, 0x20 - bhi _08075B88 - lsls r0, 2 - ldr r1, =_08075B04 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08075B04: - .4byte _08075B88 - .4byte _08075BB4 - .4byte _08075BDA - .4byte _08075C54 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075BF8 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075C66 - .4byte _08075C7E - .4byte _08075CA8 -_08075B88: - ldr r0, =0x02020630 - lsls r1, r7, 4 - adds r1, r7 - lsls r1, 2 - adds r1, r0 - adds r1, 0x3F - ldrb r0, [r1] - lsls r0, 26 - cmp r0, 0 - blt _08075B9E - b _08075D04 -_08075B9E: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r2 - mov r1, r12 - adds r1, 0x1 - strh r1, [r0, 0x26] - b _08075D04 - .pool -_08075BB4: - adds r0, r3, 0 - bl sub_805F110 - cmp r0, 0x1 - bne _08075BCC - lsls r1, r5, 24 - asrs r1, 24 - adds r0, r6, 0 - movs r2, 0 - bl sub_80A32E4 - b _08075C2E -_08075BCC: - lsls r1, r5, 24 - asrs r1, 24 - adds r0, r6, 0 - movs r2, 0xB - bl sub_80A32E4 - b _08075C2E -_08075BDA: - bl sub_80A369C - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0x3 - strh r1, [r0, 0x1C] - movs r1, 0x14 - strh r1, [r0, 0x26] - b _08075D04 - .pool -_08075BF8: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r2 - ldrh r2, [r1, 0x1C] - movs r7, 0x1C - ldrsh r0, [r1, r7] - cmp r0, 0 - bne _08075CBA - adds r0, r3, 0 - bl sub_805F110 - cmp r0, 0x1 - bne _08075C22 - lsls r1, r5, 24 - asrs r1, 24 - adds r0, r6, 0 - movs r2, 0x1 - bl sub_80A3344 - b _08075C2E -_08075C22: - lsls r1, r5, 24 - asrs r1, 24 - adds r0, r6, 0 - movs r2, 0xC - bl sub_80A3344 -_08075C2E: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x4] - mov r2, r8 - lsls r1, r2, 1 - add r1, r8 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r0, 0x41 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1] - adds r0, r4, 0 - bl remove_task - b _08075D04 - .pool -_08075C54: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r2 - movs r1, 0x6 - strh r1, [r0, 0x1C] - movs r1, 0x1E - strh r1, [r0, 0x26] - b _08075D04 -_08075C66: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r2 - ldrh r2, [r1, 0x1C] - movs r3, 0x1C - ldrsh r0, [r1, r3] - cmp r0, 0 - bne _08075CBA - ldrh r0, [r1, 0x26] - adds r0, 0x1 - strh r0, [r1, 0x26] -_08075C7E: - bl sub_80A36C8 - lsls r0, 24 - cmp r0, 0 - bne _08075D04 - bl sub_80A369C - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - movs r0, 0x3 - strh r0, [r1, 0x1C] - ldrh r0, [r1, 0x26] - adds r0, 0x1 - strh r0, [r1, 0x26] - b _08075D04 - .pool -_08075CA8: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r2 - ldrh r2, [r1, 0x1C] - movs r7, 0x1C - ldrsh r0, [r1, r7] - cmp r0, 0 - beq _08075CC0 -_08075CBA: - subs r0, r2, 0x1 - strh r0, [r1, 0x1C] - b _08075D04 -_08075CC0: - adds r0, r3, 0 - bl sub_805F110 - cmp r0, 0x1 - bne _08075CD8 - lsls r1, r5, 24 - asrs r1, 24 - adds r0, r6, 0 - movs r2, 0 - bl sub_80A3344 - b _08075CE4 -_08075CD8: - lsls r1, r5, 24 - asrs r1, 24 - adds r0, r6, 0 - movs r2, 0xB - bl sub_80A3344 -_08075CE4: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x4] - mov r2, r8 - lsls r1, r2, 1 - add r1, r8 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r0, 0x41 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1] - adds r0, r4, 0 - bl remove_task -_08075D04: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end c3_0804B070 - - thumb_func_start sub_8075D14 -sub_8075D14: @ 8075D14 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r6, r0, 0 - ldrh r0, [r6, 0x3A] - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r6, 0 - movs r1, 0x1 - bl StartObjectImageAnim - adds r0, r5, 0 - bl sub_8076B14 - lsls r0, 16 - lsrs r0, 16 - bl ball_number_to_ball_processing_index - adds r4, r0, 0 - ldrh r0, [r6, 0x20] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r6, 0x22] - subs r1, 0x5 - lsls r1, 24 - lsrs r1, 24 - lsls r4, 24 - lsrs r4, 24 - str r4, [sp] - movs r2, 0x1 - movs r3, 0x1C - bl sub_8171D98 - ldrh r1, [r6, 0x3A] - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x1 - movs r2, 0xE - adds r3, r4, 0 - bl sub_81729E8 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x2E] - ldr r0, =sub_8075FD4 - str r0, [r6, 0x1C] - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08075D88 - b _08075EF4 -_08075D88: - adds r0, r5, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08075DC0 - ldr r0, =0x0202406e - lsls r2, r5, 1 - adds r0, r2, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 - adds r7, r1, r0 - movs r4, 0x19 - mov r10, r4 - b _08075DD4 - .pool -_08075DC0: - ldr r0, =0x0202406e - lsls r2, r5, 1 - adds r0, r2, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r7, r1, r0 - movs r0, 0xE7 - mov r10, r0 -_08075DD4: - mov r8, r2 - adds r0, r7, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - movs r0, 0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - beq _08075E00 - movs r0, 0x1 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - bne _08075E56 -_08075E00: - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08075E56 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r1, [r0, 0x9] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08075E56 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x42 - ands r0, r1 - cmp r0, 0x42 - bne _08075E4C - bl sub_80A38E4 - lsls r0, 24 - cmp r0, 0 - beq _08075E56 - ldr r0, =0x03007420 - bl MPlayStop_rev01 - b _08075E56 - .pool -_08075E4C: - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x80 - bl MPlayVolumeControl -_08075E56: - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08075E70 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r1, [r0, 0x9] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08075E80 -_08075E70: - movs r4, 0 - b _08075EA2 - .pool -_08075E80: - movs r0, 0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - beq _08075E9C - movs r0, 0x1 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - bne _08075EA0 -_08075E9C: - movs r4, 0x1 - b _08075EA2 -_08075EA0: - movs r4, 0x2 -_08075EA2: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x4] - mov r2, r8 - adds r1, r2, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - movs r2, 0x40 - orrs r0, r2 - strb r0, [r1, 0x1] - ldr r0, =c3_0804B070 - movs r1, 0x3 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r3, 0 - mov r0, r9 - strh r0, [r1, 0x8] - mov r2, r10 - lsls r0, r2, 24 - asrs r0, 24 - strh r0, [r1, 0xA] - strh r4, [r1, 0xC] - strh r5, [r1, 0xE] - ldr r2, =0x020241e4 - movs r4, 0x3A - ldrsh r0, [r6, r4] - adds r0, r2 - ldrb r0, [r0] - strh r0, [r1, 0x10] - lsrs r0, r7, 16 - strh r0, [r1, 0x12] - strh r7, [r1, 0x14] - strh r3, [r1, 0x26] -_08075EF4: - ldr r4, =0x020241e4 - movs r1, 0x3A - ldrsh r0, [r6, r1] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =0x02020630 - adds r0, r5 - movs r1, 0x1 - bl StartObjectRotScalAnim - ldrh r0, [r6, 0x3A] - lsls r0, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08075F50 - movs r2, 0x3A - ldrsh r0, [r6, r2] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r5, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_8039B58 - b _08075F66 - .pool -_08075F50: - movs r1, 0x3A - ldrsh r0, [r6, r1] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r5, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_8039E44 -_08075F66: - str r1, [r0] - ldr r5, =0x020241e4 - movs r2, 0x3A - ldrsh r0, [r6, r2] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl AnimateObject - movs r1, 0x3A - ldrsh r0, [r6, r1] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x80 - lsls r1, 5 - strh r1, [r0, 0x30] - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8075D14 - - thumb_func_start sub_8075FB4 -sub_8075FB4: @ 8075FB4 - adds r3, r0, 0 - adds r3, 0x2C - ldrb r1, [r3] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r3] - ldr r1, =sub_80760F8 - str r1, [r0, 0x1C] - movs r1, 0 - strh r1, [r0, 0x34] - strh r1, [r0, 0x36] - strh r1, [r0, 0x38] - bx lr - .pool - thumb_func_end sub_8075FB4 - - thumb_func_start sub_8075FD4 -sub_8075FD4: @ 8075FD4 - push {r4-r7,lr} - adds r5, r0, 0 - movs r7, 0 - ldrh r0, [r5, 0x3A] - lsls r0, 24 - lsrs r6, r0, 24 - ldr r4, =0x02020630 - ldr r0, =0x020241e4 - adds r3, r6, r0 - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - adds r0, r5, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08076016 - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_08076016: - ldrb r0, [r3] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - adds r0, r1, 0 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 26 - cmp r0, 0 - bge _08076040 - adds r0, r1, 0 - movs r1, 0 - bl StartObjectRotScalAnim - movs r7, 0x1 - b _0807605C - .pool -_08076040: - ldr r2, =0xfffffee0 - adds r0, r2, 0 - ldrh r2, [r1, 0x30] - adds r0, r2 - strh r0, [r1, 0x30] - ldrb r0, [r3] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrh r0, [r1, 0x30] - lsls r0, 16 - asrs r0, 24 - strh r0, [r1, 0x26] -_0807605C: - adds r0, r5, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080760DE - cmp r7, 0 - beq _080760DE - ldr r2, =0x02020630 - ldr r0, =0x020241e4 - adds r0, r6, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r2, 0 - movs r1, 0 - strh r1, [r0, 0x26] - ldr r0, =0x020244b9 - strb r2, [r0] - ldr r4, =0x020244d0 - ldr r0, [r4] - ldr r0, [r0, 0x4] - lsls r1, r6, 1 - adds r1, r6 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - adds r0, r5, 0 - bl obj_free_rotscale_entry - adds r0, r5, 0 - bl RemoveObjectAndFreeTiles - movs r3, 0 - ldr r0, [r4] - ldr r2, [r0, 0x4] - movs r5, 0x8 - movs r4, 0x3 -_080760B6: - ldrb r1, [r2] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - bne _080760C2 - adds r3, 0x1 -_080760C2: - adds r2, 0xC - subs r4, 0x1 - cmp r4, 0 - bge _080760B6 - cmp r3, 0x4 - bne _080760DE - movs r4, 0 -_080760D0: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_8076AE8 - adds r4, 0x1 - cmp r4, 0xB - ble _080760D0 -_080760DE: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8075FD4 - - thumb_func_start sub_80760F8 -sub_80760F8: @ 80760F8 - push {r4-r7,lr} - adds r6, r0, 0 - ldrh r0, [r6, 0x3A] - lsls r0, 24 - lsrs r7, r0, 24 - ldrh r0, [r6, 0x36] - adds r0, 0x1 - strh r0, [r6, 0x36] - lsls r0, 16 - asrs r1, r0, 16 - cmp r1, 0x28 - beq _08076196 - cmp r1, 0x5F - bne _08076130 - ldr r0, =0x020244b9 - movs r1, 0 - strb r1, [r0] - bl m4aMPlayAllStop - ldr r0, =0x00000173 - bl audio_play - b _08076196 - .pool -_08076130: - ldr r0, =0x0000013b - cmp r1, r0 - bne _08076196 - ldr r5, =0x02020630 - ldr r4, =0x020241e4 - movs r1, 0x3A - ldrsh r0, [r6, r1] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r0, [r0, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - movs r1, 0x3A - ldrsh r0, [r6, r1] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl RemoveObjectAndFreeTiles - adds r0, r6, 0 - bl RemoveObjectAndFreeResources - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08076196 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x4] - lsls r1, r7, 1 - adds r1, r7 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - strb r0, [r1] -_08076196: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80760F8 - - thumb_func_start sub_80761B4 -sub_80761B4: @ 80761B4 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x19 - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x3A] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x3A] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x18 - strh r0, [r4, 0x36] - ldr r0, =0x0000ffe2 - strh r0, [r4, 0x38] - ldrh r0, [r4, 0x3A] - strh r0, [r4, 0x6] - adds r0, r4, 0 - bl sub_80A68D4 - ldr r0, =sub_8076204 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80761B4 - - thumb_func_start sub_8076204 -sub_8076204: @ 8076204 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - ldrh r0, [r5, 0x3C] - movs r1, 0xFF - mov r8, r1 - lsrs r0, 8 - subs r0, 0x23 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2C - bhi _080762F8 - ldrh r1, [r5, 0x6] - movs r0, 0xFF - lsls r0, 8 - ands r0, r1 - cmp r0, 0 - bne _08076266 - ldrh r0, [r5, 0x30] - movs r1, 0x1 - adds r6, r1, 0 - ands r6, r0 - ldrh r0, [r5, 0x32] - adds r7, r1, 0 - ands r7, r0 - movs r2, 0x30 - ldrsh r0, [r5, r2] - movs r1, 0x3 - bl __divsi3 - movs r1, 0x2 - negs r1, r1 - adds r4, r1, 0 - ands r0, r4 - orrs r6, r0 - strh r6, [r5, 0x30] - movs r2, 0x32 - ldrsh r0, [r5, r2] - movs r1, 0x3 - bl __divsi3 - ands r0, r4 - orrs r7, r0 - strh r7, [r5, 0x32] - adds r0, r5, 0 - movs r1, 0x4 - bl StartObjectRotScalAnim -_08076266: - ldrh r4, [r5, 0x2E] - adds r0, r5, 0 - bl sub_80A6F3C - movs r1, 0x3A - ldrsh r0, [r5, r1] - movs r1, 0x3 - bl __divsi3 - adds r1, r0, 0 - ldrh r0, [r5, 0x3C] - adds r0, r1 - strh r0, [r5, 0x3C] - lsls r0, 16 - asrs r0, 24 - mov r2, r8 - ands r0, r2 - movs r2, 0x38 - ldrsh r1, [r5, r2] - bl sine - ldrh r1, [r5, 0x26] - adds r0, r1 - strh r0, [r5, 0x26] - movs r2, 0x80 - lsls r2, 1 - adds r0, r2, 0 - ldrh r1, [r5, 0x6] - adds r0, r1 - strh r0, [r5, 0x6] - lsls r0, 16 - lsrs r0, 24 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - beq _080762B6 - strh r4, [r5, 0x2E] - b _080762BE -_080762B6: - lsls r0, r4, 16 - asrs r0, 16 - subs r0, 0x1 - strh r0, [r5, 0x2E] -_080762BE: - ldrh r0, [r5, 0x3C] - lsrs r0, 8 - cmp r0, 0x4F - ble _08076364 - ldrh r0, [r5, 0x30] - movs r1, 0x1 - adds r6, r1, 0 - ands r6, r0 - ldrh r0, [r5, 0x32] - adds r7, r1, 0 - ands r7, r0 - movs r2, 0x30 - ldrsh r1, [r5, r2] - lsls r0, r1, 1 - adds r0, r1 - movs r1, 0x2 - negs r1, r1 - adds r2, r1, 0 - ands r0, r2 - orrs r0, r6 - strh r0, [r5, 0x30] - movs r0, 0x32 - ldrsh r1, [r5, r0] - lsls r0, r1, 1 - adds r0, r1 - ands r0, r2 - orrs r0, r7 - strh r0, [r5, 0x32] - b _08076364 -_080762F8: - adds r0, r5, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - beq _08076364 - ldrh r0, [r5, 0x24] - ldrh r1, [r5, 0x20] - adds r0, r1 - movs r1, 0 - strh r0, [r5, 0x20] - ldrh r0, [r5, 0x26] - ldrh r2, [r5, 0x22] - adds r0, r2 - strh r0, [r5, 0x22] - strh r1, [r5, 0x26] - strh r1, [r5, 0x24] - ldrb r0, [r5, 0x6] - strh r0, [r5, 0x3A] - strh r1, [r5, 0x2E] - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08076358 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r1, [r0, 0x9] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08076358 - movs r0, 0x3A - ldrsh r4, [r5, r0] - movs r0, 0x2 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bne _08076358 - ldr r0, =sub_8076374 - b _0807635A - .pool -_08076358: - ldr r0, =sub_8075D14 -_0807635A: - str r0, [r5, 0x1C] - adds r0, r5, 0 - movs r1, 0 - bl StartObjectRotScalAnim -_08076364: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8076204 - - thumb_func_start sub_8076374 -sub_8076374: @ 8076374 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x2E] - adds r1, r0, 0x1 - strh r1, [r2, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x18 - ble _0807638E - movs r0, 0 - strh r0, [r2, 0x2E] - ldr r0, =sub_8075D14 - str r0, [r2, 0x1C] -_0807638E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8076374 - - thumb_func_start sub_8076398 -sub_8076398: @ 8076398 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xF - ble _080763EC - movs r0, 0 - strh r0, [r5, 0x2E] - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _080763E8 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r1, [r0, 0x9] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080763E8 - movs r0, 0x3A - ldrsh r4, [r5, r0] - movs r0, 0x3 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bne _080763E8 - ldr r0, =sub_8076374 - b _080763EA - .pool -_080763E8: - ldr r0, =sub_8075D14 -_080763EA: - str r0, [r5, 0x1C] -_080763EC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8076398 - - thumb_func_start sub_80763F8 -sub_80763F8: @ 80763F8 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - movs r4, 0 - str r4, [sp] - bl sub_8171D98 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80763F8 - - thumb_func_start sub_8076420 -sub_8076420: @ 8076420 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - movs r3, 0 - bl sub_81729E8 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_8076420 - - thumb_func_start sub_8076438 -sub_8076438: @ 8076438 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - adds r5, r0, 0 - mov r9, r2 - mov r10, r3 - ldr r6, [sp, 0x28] - ldr r4, [sp, 0x2C] - ldr r0, [sp, 0x30] - ldr r2, [sp, 0x38] - lsls r5, 24 - lsrs r5, 24 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - mov r1, r9 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - lsls r3, 24 - lsrs r3, 24 - mov r10, r3 - lsls r6, 24 - lsrs r6, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - lsls r0, r2, 16 - lsrs r7, r0, 16 - ldr r0, =gUnknown_0832C400 - bl LoadCompressedObjectPicUsingHeap - ldr r0, =gUnknown_0832C460 - bl LoadCompressedObjectPaletteUsingHeap - ldr r0, =gUnknown_0832C588 - mov r1, r9 - mov r2, r10 - adds r3, r4, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02020630 - mov r8, r1 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - adds r2, r4, r1 - strh r5, [r2, 0x2E] - lsls r1, r5, 4 - adds r1, r5 - lsls r1, 2 - add r1, r8 - ldrh r0, [r1, 0x20] - strh r0, [r2, 0x38] - ldrh r0, [r1, 0x22] - strh r0, [r2, 0x3A] - mov r3, r9 - strh r3, [r1, 0x20] - mov r0, r10 - strh r0, [r1, 0x22] - strh r7, [r1, 0x3C] - mov r3, sp - ldrh r3, [r3, 0x4] - strh r3, [r2, 0x30] - mov r0, sp - ldrh r0, [r0] - strh r0, [r2, 0x32] - mov r3, sp - ldrh r3, [r3, 0x34] - strh r3, [r2, 0x34] - ldr r3, [sp, 0x34] - lsrs r0, r3, 16 - strh r0, [r2, 0x36] - movs r0, 0x3 - ands r6, r0 - lsls r6, 2 - ldrb r3, [r2, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r3 - orrs r0, r6 - strb r0, [r2, 0x5] - movs r0, 0x1C - add r8, r0 - add r4, r8 - ldr r0, =sub_8076524 - str r0, [r4] - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - 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 - .pool - thumb_func_end sub_8076438 - - thumb_func_start sub_8076524 -sub_8076524: @ 8076524 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - ldrh r1, [r6, 0x30] - movs r2, 0x30 - ldrsh r0, [r6, r2] - cmp r0, 0 - bne _080765D0 - ldrh r0, [r6, 0x2E] - lsls r0, 24 - lsrs r7, r0, 24 - ldrh r0, [r6, 0x32] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldrh r4, [r6, 0x34] - ldrh r0, [r6, 0x36] - lsls r0, 16 - orrs r4, r0 - adds r0, r6, 0 - adds r0, 0x43 - ldrb r0, [r0] - cmp r0, 0 - beq _0807655E - subs r0, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - b _08076560 -_0807655E: - movs r5, 0 -_08076560: - adds r0, r6, 0 - movs r1, 0x1 - bl StartObjectImageAnim - ldrh r0, [r6, 0x20] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r6, 0x22] - subs r1, 0x5 - lsls r1, 24 - lsrs r1, 24 - ldrb r2, [r6, 0x5] - lsls r2, 28 - lsrs r2, 30 - adds r3, r5, 0 - bl sub_80763F8 - movs r0, 0x1 - mov r1, r8 - adds r2, r4, 0 - bl sub_8076420 - lsls r0, 24 - lsrs r0, 24 - movs r5, 0 - strh r0, [r6, 0x30] - ldr r0, =sub_80765E0 - str r0, [r6, 0x1C] - ldr r0, =0x02020630 - lsls r4, r7, 4 - adds r4, r7 - lsls r4, 2 - adds r4, r0 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim - adds r0, r4, 0 - bl AnimateObject - movs r0, 0x80 - lsls r0, 5 - strh r0, [r4, 0x30] - strh r5, [r6, 0x3C] - b _080765D4 - .pool -_080765D0: - subs r0, r1, 0x1 - strh r0, [r6, 0x30] -_080765D4: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8076524 - - thumb_func_start sub_80765E0 -sub_80765E0: @ 80765E0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r4, r0, 0 - movs r0, 0 - mov r12, r0 - movs r7, 0 - ldrh r0, [r4, 0x2E] - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08076610 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_08076610: - ldr r1, =0x02020630 - lsls r2, r6, 4 - adds r0, r2, r6 - lsls r0, 2 - adds r5, r0, r1 - adds r0, r5, 0 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 26 - mov r8, r2 - cmp r0, 0 - bge _08076634 - adds r0, r5, 0 - movs r1, 0 - bl StartObjectRotScalAnim - movs r1, 0x1 - mov r12, r1 -_08076634: - movs r2, 0x38 - ldrsh r0, [r4, r2] - movs r3, 0x20 - ldrsh r1, [r4, r3] - subs r0, r1 - movs r1, 0x3C - ldrsh r2, [r4, r1] - muls r0, r2 - cmp r0, 0 - bge _0807664A - adds r0, 0x7F -_0807664A: - asrs r0, 7 - ldrh r3, [r4, 0x20] - adds r0, r3 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - movs r1, 0x3A - ldrsh r0, [r4, r1] - movs r3, 0x22 - ldrsh r1, [r4, r3] - subs r0, r1 - muls r0, r2 - cmp r0, 0 - bge _08076668 - adds r0, 0x7F -_08076668: - asrs r0, 7 - ldrh r1, [r4, 0x22] - adds r0, r1 - mov r2, r9 - strh r2, [r5, 0x20] - strh r0, [r5, 0x22] - ldrh r2, [r4, 0x3C] - movs r3, 0x3C - ldrsh r0, [r4, r3] - cmp r0, 0x7F - bgt _080766AC - ldr r1, =gUnknown_08329F40 - lsls r0, r2, 24 - lsrs r0, 23 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bge _08076690 - adds r0, 0x7 -_08076690: - asrs r0, 3 - negs r0, r0 - lsls r0, 16 - lsrs r0, 16 - adds r1, r2, 0x4 - strh r1, [r4, 0x3C] - strh r0, [r5, 0x24] - strh r0, [r5, 0x26] - b _080766BA - .pool -_080766AC: - ldrh r0, [r4, 0x38] - strh r0, [r5, 0x20] - ldrh r0, [r4, 0x3A] - strh r0, [r5, 0x22] - strh r7, [r5, 0x24] - strh r7, [r5, 0x26] - movs r7, 0x1 -_080766BA: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0807670E - mov r2, r12 - cmp r2, 0 - beq _0807670E - cmp r7, 0 - beq _0807670E - ldr r1, =0x02020630 - mov r3, r8 - adds r0, r3, r6 - lsls r0, 2 - adds r2, r0, r1 - movs r0, 0x3C - ldrsh r1, [r2, r0] - movs r0, 0xCE - lsls r0, 1 - cmp r1, r0 - bne _080766FC - ldrh r1, [r2, 0x3C] - adds r0, r2, 0 - movs r2, 0x1 - movs r3, 0 - bl sub_806ED40 - b _08076708 - .pool -_080766FC: - ldrh r1, [r2, 0x3C] - adds r0, r2, 0 - movs r2, 0 - movs r3, 0 - bl sub_806ED40 -_08076708: - adds r0, r4, 0 - bl RemoveObjectAndFreeResources -_0807670E: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80765E0 - - thumb_func_start sub_807671C -sub_807671C: @ 807671C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r10, r0 - adds r6, r2, 0 - mov r8, r3 - ldr r5, [sp, 0x20] - ldr r4, [sp, 0x24] - ldr r0, [sp, 0x28] - mov r9, r0 - mov r0, r10 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r6, 24 - lsrs r6, 24 - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - lsls r5, 24 - lsrs r5, 24 - lsls r4, 24 - lsrs r4, 24 - mov r0, r9 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldr r0, =gUnknown_0832C400 - bl LoadCompressedObjectPicUsingHeap - ldr r0, =gUnknown_0832C460 - bl LoadCompressedObjectPaletteUsingHeap - ldr r0, =gUnknown_0832C588 - adds r1, r6, 0 - mov r2, r8 - adds r3, r4, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r6, =0x02020630 - lsls r3, r0, 4 - adds r3, r0 - lsls r3, 2 - adds r2, r3, r6 - mov r1, r10 - strh r1, [r2, 0x2E] - mov r4, r9 - strh r4, [r2, 0x30] - strh r7, [r2, 0x32] - mov r1, sp - ldrh r1, [r1, 0x2C] - strh r1, [r2, 0x34] - ldr r4, [sp, 0x2C] - lsrs r1, r4, 16 - strh r1, [r2, 0x36] - movs r1, 0x3 - ands r5, r1 - lsls r5, 2 - ldrb r4, [r2, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r4 - orrs r1, r5 - strb r1, [r2, 0x5] - adds r6, 0x1C - adds r3, r6 - ldr r1, =sub_80767D4 - str r1, [r3] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_807671C - - thumb_func_start sub_80767D4 -sub_80767D4: @ 80767D4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - ldrh r1, [r4, 0x30] - movs r2, 0x30 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _0807686C - ldrh r0, [r4, 0x2E] - lsls r0, 24 - lsrs r7, r0, 24 - ldrh r0, [r4, 0x32] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldrh r5, [r4, 0x34] - ldrh r0, [r4, 0x36] - lsls r0, 16 - orrs r5, r0 - adds r0, r4, 0 - adds r0, 0x43 - ldrb r0, [r0] - cmp r0, 0 - beq _0807680E - subs r0, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - b _08076810 -_0807680E: - movs r6, 0 -_08076810: - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectImageAnim - ldrh r0, [r4, 0x20] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x22] - subs r1, 0x5 - lsls r1, 24 - lsrs r1, 24 - ldrb r2, [r4, 0x5] - lsls r2, 28 - lsrs r2, 30 - adds r3, r6, 0 - bl sub_80763F8 - movs r0, 0x1 - mov r1, r8 - adds r2, r5, 0 - bl sub_8076420 - lsls r0, 24 - lsrs r0, 24 - movs r5, 0 - strh r0, [r4, 0x30] - ldr r0, =sub_807687C - str r0, [r4, 0x1C] - lsls r4, r7, 4 - adds r4, r7 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x2 - bl StartObjectRotScalAnim - adds r0, r4, 0 - bl AnimateObject - strh r5, [r4, 0x30] - b _08076870 - .pool -_0807686C: - subs r0, r1, 0x1 - strh r0, [r4, 0x30] -_08076870: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80767D4 - - thumb_func_start sub_807687C -sub_807687C: @ 807687C - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r0, [r5, 0x38] - adds r0, 0x1 - strh r0, [r5, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xB - bne _08076894 - movs r0, 0x3C - bl audio_play -_08076894: - ldrh r1, [r5, 0x2E] - lsls r1, 24 - lsrs r1, 24 - ldr r2, =0x02020630 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, r0, r2 - adds r0, r4, 0 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 26 - cmp r0, 0 - bge _080768D8 - adds r0, r5, 0 - movs r1, 0x2 - bl StartObjectImageAnim - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - movs r0, 0 - strh r0, [r5, 0x38] - ldr r0, =sub_80768F0 - str r0, [r5, 0x1C] - b _080768E8 - .pool -_080768D8: - ldrh r0, [r4, 0x30] - adds r0, 0x60 - strh r0, [r4, 0x30] - movs r1, 0x30 - ldrsh r0, [r4, r1] - negs r0, r0 - asrs r0, 8 - strh r0, [r4, 0x26] -_080768E8: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_807687C - - thumb_func_start sub_80768F0 -sub_80768F0: @ 80768F0 - push {lr} - adds r2, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08076904 - ldr r0, =DummyObjectCallback - str r0, [r2, 0x1C] -_08076904: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80768F0 - - thumb_func_start obj_delete_and_free_associated_resources_ -obj_delete_and_free_associated_resources_: @ 807690C - push {lr} - bl RemoveObjectAndFreeResources - pop {r0} - bx r0 - thumb_func_end obj_delete_and_free_associated_resources_ - - thumb_func_start sub_8076918 -sub_8076918: @ 8076918 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r0, =0x03005d70 - adds r0, r5, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r6, =0x02020630 - adds r4, r0, r6 - movs r1, 0 - movs r0, 0x5 - strh r0, [r4, 0x2E] - strh r1, [r4, 0x30] - movs r0, 0x73 - strh r0, [r4, 0x24] - strh r1, [r4, 0x26] - ldr r0, =sub_80769CC - str r0, [r4, 0x1C] - adds r0, r5, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08076966 - ldrh r0, [r4, 0x2E] - negs r0, r0 - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x30] - negs r0, r0 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x24] - negs r0, r0 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x26] - negs r0, r0 - strh r0, [r4, 0x26] -_08076966: - movs r0, 0x38 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r6, 0 - adds r1, 0x1C - adds r1, r0, r1 - adds r0, r6 - ldr r1, [r1] - bl _call_via_r1 - adds r0, r5, 0 - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08076990 - ldr r0, =sub_80769A8 - str r0, [r4, 0x1C] -_08076990: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8076918 - - thumb_func_start sub_80769A8 -sub_80769A8: @ 80769A8 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x30] - adds r0, 0x1 - strh r0, [r1, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - bne _080769C2 - movs r0, 0 - strh r0, [r1, 0x30] - ldr r0, =sub_80769CC - str r0, [r1, 0x1C] -_080769C2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80769A8 - - thumb_func_start sub_80769CC -sub_80769CC: @ 80769CC - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x24] - ldrh r1, [r2, 0x2E] - subs r0, r1 - strh r0, [r2, 0x24] - ldrh r0, [r2, 0x26] - ldrh r1, [r2, 0x30] - subs r0, r1 - strh r0, [r2, 0x26] - ldr r0, [r2, 0x24] - cmp r0, 0 - bne _080769EA - ldr r0, =DummyObjectCallback - str r0, [r2, 0x1C] -_080769EA: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80769CC - - thumb_func_start sub_80769F4 -sub_80769F4: @ 80769F4 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =oamc_804BEB4 - adds r0, r5, 0 - bl object_new_hidden_with_callback - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r3, r1, r2 - movs r0, 0x1 - strh r0, [r3, 0x2E] - ldr r0, =0x03005d70 - adds r4, r0 - ldrb r0, [r4] - strh r0, [r3, 0x30] - adds r2, 0x1C - adds r1, r2 - str r5, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80769F4 - - thumb_func_start oamc_804BEB4 -oamc_804BEB4: @ 8076A38 - push {lr} - adds r3, r0, 0 - ldrh r1, [r3, 0x30] - lsls r1, 24 - lsrs r1, 24 - ldr r2, =0x02020630 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - ldrh r0, [r3, 0x2E] - movs r2, 0 - strh r0, [r1, 0x26] - ldrh r0, [r3, 0x2E] - negs r0, r0 - strh r0, [r3, 0x2E] - ldrh r0, [r3, 0x32] - adds r0, 0x1 - strh r0, [r3, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x15 - bne _08076A70 - strh r2, [r1, 0x24] - strh r2, [r1, 0x26] - adds r0, r3, 0 - bl RemoveObjectAndFreeTiles -_08076A70: - pop {r0} - bx r0 - .pool - thumb_func_end oamc_804BEB4 - - thumb_func_start sub_8076A78 -sub_8076A78: @ 8076A78 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gUnknown_0832C400 - lsls r6, r4, 3 - adds r5, r6, r0 - ldrh r0, [r5, 0x6] - bl GetObjectTileRangeStartByTag - lsls r0, 16 - ldr r1, =0xffff0000 - cmp r0, r1 - bne _08076AA0 - adds r0, r5, 0 - bl LoadCompressedObjectPicUsingHeap - ldr r0, =gUnknown_0832C460 - adds r0, r6, r0 - bl LoadCompressedObjectPaletteUsingHeap -_08076AA0: - cmp r4, 0x6 - beq _08076ACC - cmp r4, 0x6 - blt _08076AB0 - cmp r4, 0xB - bgt _08076AB0 - cmp r4, 0xA - bge _08076ACC -_08076AB0: - ldr r1, =gUnknown_0832C400 - lsls r0, r4, 3 - adds r0, r1 - ldrh r0, [r0, 0x6] - bl GetObjectTileRangeStartByTag - adds r1, r0, 0 - lsls r1, 16 - ldr r0, =gUnknown_08C02300 - lsrs r1, 11 - ldr r2, =0x06010100 - adds r1, r2 - bl LZDecompressVram -_08076ACC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8076A78 - - thumb_func_start sub_8076AE8 -sub_8076AE8: @ 8076AE8 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - ldr r0, =gUnknown_0832C400 - lsrs r4, 21 - adds r0, r4, r0 - ldrh r0, [r0, 0x6] - bl FreeObjectTilesByTag - ldr r0, =gUnknown_0832C460 - adds r4, r0 - ldrh r0, [r4, 0x4] - bl FreeObjectPaletteByTag - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8076AE8 - - thumb_func_start sub_8076B14 -sub_8076B14: @ 8076B14 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08076B40 - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - b _08076B4E - .pool -_08076B40: - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec -_08076B4E: - adds r0, r1 - movs r1, 0x26 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8076B14 - - thumb_func_start CheckForFlashMemory -@ void CheckForFlashMemory() -CheckForFlashMemory: @ 8076B68 - push {lr} - bl IdentifyFlash - lsls r0, 16 - cmp r0, 0 - bne _08076B84 - ldr r1, =0x03005d88 - movs r0, 0x1 - str r0, [r1] - bl StartFlashMemoryTimer - b _08076B8A - .pool -_08076B84: - ldr r1, =0x03005d88 - movs r0, 0 - str r0, [r1] -_08076B8A: - pop {r0} - bx r0 - .pool - thumb_func_end CheckForFlashMemory - - thumb_func_start memclr_stdsav2 -memclr_stdsav2: @ 8076B94 - push {lr} - sub sp, 0x4 - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r1, =0x02024a54 - ldr r2, =0x010007d6 - mov r0, sp - bl CpuSet - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end memclr_stdsav2 - - thumb_func_start clear_sav1 -clear_sav1: @ 8076BB8 - push {lr} - sub sp, 0x4 - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r1, =0x02025a00 - ldr r2, =0x01001f04 - mov r0, sp - bl CpuSet - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end clear_sav1 - - thumb_func_start InitSaveBlockPointersWithRandomOffset -@ void InitSaveBlockPointersWithRandomOffset(u8 offset) -InitSaveBlockPointersWithRandomOffset: @ 8076BDC - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r5, =0x03005d8c - bl GenerateRandomNumber - adds r4, r0 - movs r0, 0x7C - ands r4, r0 - ldr r1, =0x03005d90 - ldr r0, =0x02024a54 - adds r0, r4, r0 - str r0, [r1] - ldr r0, =0x02025a00 - adds r0, r4, r0 - str r0, [r5] - ldr r1, =0x03005d94 - ldr r0, =0x02029808 - adds r4, r0 - str r4, [r1] - bl init_bag_pockets - bl sub_81617F4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end InitSaveBlockPointersWithRandomOffset - - thumb_func_start saveblock_randomize_and_relocate -saveblock_randomize_and_relocate: @ 8076C2C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - ldr r5, =0x030022c0 - ldr r0, [r5, 0xC] - str r0, [sp] - ldr r1, [r5, 0x10] - str r1, [sp, 0x4] - movs r0, 0 - str r0, [r5, 0xC] - str r0, [r5, 0x10] - ldr r1, =0x0203cf5c - str r0, [r1] - ldr r4, =0x02000000 - ldr r0, =0x03005d90 - ldr r1, [r0] - ldr r6, =0x00000f2c - adds r0, r4, 0 - adds r2, r6, 0 - bl memcpy - ldr r1, =0x03005d8c - mov r10, r1 - ldr r1, [r1] - ldr r7, =0x00003d88 - ldr r0, =0x02000f2c - adds r2, r7, 0 - bl memcpy - ldr r0, =0x03005d94 - mov r8, r0 - ldr r1, [r0] - ldr r0, =0x000083d0 - mov r9, r0 - ldr r0, =0x02004cb4 - mov r2, r9 - bl memcpy - ldrb r1, [r4, 0xA] - ldrb r0, [r4, 0xB] - adds r1, r0 - ldrb r0, [r4, 0xC] - adds r1, r0 - ldrb r0, [r4, 0xD] - adds r0, r1 - bl InitSaveBlockPointersWithRandomOffset - ldr r1, =0x03005d90 - ldr r0, [r1] - adds r1, r4, 0 - adds r2, r6, 0 - bl memcpy - mov r1, r10 - ldr r0, [r1] - ldr r1, =0x02000f2c - adds r2, r7, 0 - bl memcpy - mov r1, r8 - ldr r0, [r1] - ldr r1, =0x02004cb4 - mov r2, r9 - bl memcpy - movs r1, 0xE0 - lsls r1, 9 - adds r0, r4, 0 - bl InitHeap - ldr r0, [sp, 0x4] - str r0, [r5, 0x10] - ldr r1, [sp] - str r1, [r5, 0xC] - bl GenerateRandomNumber - adds r4, r0, 0 - bl GenerateRandomNumber - lsls r4, 16 - lsls r0, 16 - lsrs r0, 16 - adds r4, r0 - adds r0, r4, 0 - bl saveblock_apply_crypto - ldr r1, =0x03005d90 - ldr r0, [r1] - adds r0, 0xAC - str r4, [r0] - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end saveblock_randomize_and_relocate - - thumb_func_start sav2_x1_query_bit1 -sav2_x1_query_bit1: @ 8076D24 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r1, [r0, 0x9] - movs r0, 0x1 - ands r0, r1 - bx lr - .pool - thumb_func_end sav2_x1_query_bit1 - - thumb_func_start sav2_x9_clear_bit1 -sav2_x9_clear_bit1: @ 8076D34 - ldr r0, =0x03005d90 - ldr r2, [r0] - ldrb r1, [r2, 0x9] - movs r0, 0xFE - ands r0, r1 - strb r0, [r2, 0x9] - bx lr - .pool - thumb_func_end sav2_x9_clear_bit1 - - thumb_func_start sub_8076D48 -sub_8076D48: @ 8076D48 - ldr r0, =0x03005d90 - ldr r2, [r0] - ldrb r1, [r2, 0x9] - movs r0, 0x1 - orrs r0, r1 - strb r0, [r2, 0x9] - bx lr - .pool - thumb_func_end sub_8076D48 - - thumb_func_start sub_8076D5C -sub_8076D5C: @ 8076D5C - push {lr} - movs r0, 0 - bl sub_8084FAC - ldr r0, =0x03005d90 - ldr r2, [r0] - ldrb r1, [r2, 0x9] - movs r0, 0x1 - orrs r0, r1 - strb r0, [r2, 0x9] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8076D5C - - thumb_func_start sav2_gender2_inplace_and_xFE -sav2_gender2_inplace_and_xFE: @ 8076D78 - ldr r0, =0x03005d90 - ldr r2, [r0] - ldrb r1, [r2, 0x9] - movs r0, 0xFE - ands r0, r1 - strb r0, [r2, 0x9] - bx lr - .pool - thumb_func_end sav2_gender2_inplace_and_xFE - - thumb_func_start copy_player_party_to_sav1 -@ void copy_player_party_to_sav1() -copy_player_party_to_sav1: @ 8076D8C - push {r4,lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x020244e9 - ldrb r1, [r1] - movs r2, 0x8D - lsls r2, 2 - adds r0, r2 - strb r1, [r0] - movs r4, 0 -_08076DA0: - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r1, 0x64 - muls r1, r4 - adds r0, r1 - movs r2, 0x8E - lsls r2, 2 - adds r0, r2 - ldr r2, =0x020244ec - adds r1, r2 - movs r2, 0x64 - bl memcpy - adds r4, 0x1 - cmp r4, 0x5 - ble _08076DA0 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end copy_player_party_to_sav1 - - thumb_func_start copy_player_party_from_sav1 -copy_player_party_from_sav1: @ 8076DD4 - push {r4,r5,lr} - ldr r1, =0x020244e9 - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r2, 0x8D - lsls r2, 2 - adds r0, r2 - ldrb r0, [r0] - strb r0, [r1] - movs r4, 0 - ldr r5, =0x020244ec -_08076DEA: - movs r0, 0x64 - adds r2, r4, 0 - muls r2, r0 - adds r0, r2, r5 - ldr r1, =0x03005d8c - ldr r1, [r1] - adds r1, r2 - movs r2, 0x8E - lsls r2, 2 - adds r1, r2 - movs r2, 0x64 - bl memcpy - adds r4, 0x1 - cmp r4, 0x5 - ble _08076DEA - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end copy_player_party_from_sav1 - - thumb_func_start save_serialize_npcs -save_serialize_npcs: @ 8076E1C - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =0x03005d8c - mov r12, r0 - movs r5, 0xA3 - lsls r5, 4 - mov r8, r5 - ldr r4, =0x02037350 - movs r3, 0 - movs r2, 0xF -_08076E32: - 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} - ldm r0!, {r5-r7} - stm r1!, {r5-r7} - adds r4, 0x24 - adds r3, 0x24 - subs r2, 0x1 - cmp r2, 0 - bge _08076E32 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end save_serialize_npcs - - thumb_func_start save_deserialize_npcs -save_deserialize_npcs: @ 8076E64 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =0x03005d8c - mov r12, r0 - movs r5, 0xA3 - lsls r5, 4 - mov r8, r5 - ldr r4, =0x02037350 - movs r3, 0 - movs r2, 0xF -_08076E7A: - mov r6, r12 - ldr r1, [r6] - adds r1, r3 - adds r0, r4, 0 - add r1, r8 - ldm r1!, {r5-r7} - stm r0!, {r5-r7} - ldm r1!, {r5-r7} - stm r0!, {r5-r7} - ldm r1!, {r5-r7} - stm r0!, {r5-r7} - adds r4, 0x24 - adds r3, 0x24 - subs r2, 0x1 - cmp r2, 0 - bge _08076E7A - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end save_deserialize_npcs - - thumb_func_start save_serialize_game -save_serialize_game: @ 8076EAC - push {lr} - bl copy_player_party_to_sav1 - bl save_serialize_npcs - pop {r0} - bx r0 - thumb_func_end save_serialize_game - - thumb_func_start save_deserialize_game -save_deserialize_game: @ 8076EBC - push {lr} - bl copy_player_party_from_sav1 - bl save_deserialize_npcs - pop {r0} - bx r0 - thumb_func_end save_deserialize_game - - thumb_func_start copy_bags_and_unk_data_from_save_blocks -copy_bags_and_unk_data_from_save_blocks: @ 8076ECC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r2, 0 - ldr r0, =0x02032180 - mov r12, r0 - ldr r1, =0x03005d90 - mov r10, r1 - ldr r5, =0x03005d8c - movs r3, 0xAC - lsls r3, 3 - ldr r4, =0x02031c58 -_08076EE8: - lsls r0, r2, 2 - ldr r1, [r5] - adds r1, r3 - adds r1, r0 - ldr r0, [r1] - stm r4!, {r0} - adds r2, 0x1 - cmp r2, 0x1D - ble _08076EE8 - movs r2, 0 - ldr r0, =0x02031c58 - ldr r5, =0x03005d8c - movs r3, 0xBB - lsls r3, 3 - adds r4, r0, 0 - adds r4, 0x78 -_08076F08: - lsls r0, r2, 2 - ldr r1, [r5] - adds r1, r3 - adds r1, r0 - ldr r0, [r1] - stm r4!, {r0} - adds r2, 0x1 - cmp r2, 0x1D - ble _08076F08 - movs r2, 0 - ldr r0, =0x02031c58 - ldr r5, =0x03005d8c - movs r3, 0xCA - lsls r3, 3 - adds r4, r0, 0 - adds r4, 0xF0 -_08076F28: - lsls r0, r2, 2 - ldr r1, [r5] - adds r1, r3 - adds r1, r0 - ldr r0, [r1] - stm r4!, {r0} - adds r2, 0x1 - cmp r2, 0xF - ble _08076F28 - movs r2, 0 - ldr r0, =0x02031c58 - ldr r5, =0x03005d8c - movs r6, 0x98 - lsls r6, 1 - adds r4, r0, r6 - movs r3, 0xD2 - lsls r3, 3 -_08076F4A: - lsls r0, r2, 2 - ldr r1, [r5] - adds r1, r3 - adds r1, r0 - ldr r0, [r1] - stm r4!, {r0} - adds r2, 0x1 - cmp r2, 0x3F - ble _08076F4A - movs r2, 0 - ldr r0, =0x02031c58 - ldr r5, =0x03005d8c - movs r7, 0x8C - lsls r7, 2 - adds r4, r0, r7 - movs r3, 0xF2 - lsls r3, 3 -_08076F6C: - lsls r0, r2, 2 - ldr r1, [r5] - adds r1, r3 - adds r1, r0 - ldr r0, [r1] - stm r4!, {r0} - adds r2, 0x1 - cmp r2, 0x2D - ble _08076F6C - ldr r0, =0x02031c58 - ldr r1, =0x03005d8c - mov r8, r1 - movs r5, 0xBA - lsls r5, 2 - adds r4, r0, r5 - movs r3, 0 - ldr r6, =0x00002be0 - mov r9, r6 - movs r2, 0xF -_08076F92: - mov r7, r8 - ldr r1, [r7] - adds r1, r3 - adds r0, r4, 0 - add r1, r9 - ldm r1!, {r5-r7} - stm r0!, {r5-r7} - ldm r1!, {r5-r7} - stm r0!, {r5-r7} - ldm r1!, {r5-r7} - stm r0!, {r5-r7} - adds r4, 0x24 - adds r3, 0x24 - subs r2, 0x1 - cmp r2, 0 - bge _08076F92 - mov r1, r10 - ldr r0, [r1] - adds r0, 0xAC - ldr r0, [r0] - mov r5, r12 - str r0, [r5] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end copy_bags_and_unk_data_from_save_blocks - - thumb_func_start copy_bags_and_unk_data_to_save_blocks -copy_bags_and_unk_data_to_save_blocks: @ 8076FE0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r2, 0 - ldr r0, =0x03005d90 - mov r8, r0 - ldr r1, =0x02032180 - mov r12, r1 - ldr r5, =0x03005d8c - movs r3, 0xAC - lsls r3, 3 - ldr r4, =0x02031c58 -_08076FFC: - ldr r0, [r5] - lsls r1, r2, 2 - adds r0, r3 - adds r0, r1 - ldm r4!, {r1} - str r1, [r0] - adds r2, 0x1 - cmp r2, 0x1D - ble _08076FFC - movs r2, 0 - ldr r5, =0x03005d8c - movs r4, 0xBB - lsls r4, 3 - ldr r0, =0x02031c58 - adds r3, r0, 0 - adds r3, 0x78 -_0807701C: - ldr r0, [r5] - lsls r1, r2, 2 - adds r0, r4 - adds r0, r1 - ldm r3!, {r1} - str r1, [r0] - adds r2, 0x1 - cmp r2, 0x1D - ble _0807701C - movs r2, 0 - ldr r5, =0x03005d8c - movs r4, 0xCA - lsls r4, 3 - ldr r0, =0x02031c58 - adds r3, r0, 0 - adds r3, 0xF0 -_0807703C: - ldr r0, [r5] - lsls r1, r2, 2 - adds r0, r4 - adds r0, r1 - ldm r3!, {r1} - str r1, [r0] - adds r2, 0x1 - cmp r2, 0xF - ble _0807703C - movs r2, 0 - ldr r5, =0x03005d8c - movs r4, 0xD2 - lsls r4, 3 - ldr r0, =0x02031c58 - movs r6, 0x98 - lsls r6, 1 - adds r3, r0, r6 -_0807705E: - ldr r0, [r5] - lsls r1, r2, 2 - adds r0, r4 - adds r0, r1 - ldm r3!, {r1} - str r1, [r0] - adds r2, 0x1 - cmp r2, 0x3F - ble _0807705E - movs r2, 0 - ldr r5, =0x03005d8c - movs r4, 0xF2 - lsls r4, 3 - ldr r0, =0x02031c58 - movs r7, 0x8C - lsls r7, 2 - adds r3, r0, r7 -_08077080: - ldr r0, [r5] - lsls r1, r2, 2 - adds r0, r4 - adds r0, r1 - ldm r3!, {r1} - str r1, [r0] - adds r2, 0x1 - cmp r2, 0x2D - ble _08077080 - ldr r0, =0x03005d8c - mov r9, r0 - ldr r1, =0x00002be0 - mov r10, r1 - ldr r4, =0x02031c58 - movs r3, 0 - movs r2, 0xF -_080770A0: - mov r5, r9 - ldr r1, [r5] - adds r1, r3 - add r1, r10 - movs r6, 0xBA - lsls r6, 2 - adds r0, r4, r6 - ldm r0!, {r5-r7} - stm r1!, {r5-r7} - ldm r0!, {r5-r7} - stm r1!, {r5-r7} - ldm r0!, {r5-r7} - stm r1!, {r5-r7} - adds r4, 0x24 - adds r3, 0x24 - subs r2, 0x1 - cmp r2, 0 - bge _080770A0 - mov r7, r8 - ldr r0, [r7] - adds r0, 0xAC - ldr r4, [r0] - mov r2, r12 - ldr r1, [r2] - str r1, [r0] - adds r0, r4, 0 - bl encrypt_decrypt_all_item_quantities - ldr r0, [r7] - adds r0, 0xAC - str r4, [r0] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end copy_bags_and_unk_data_to_save_blocks - - thumb_func_start apply_u16_xor_crypto -apply_u16_xor_crypto: @ 8077100 - ldr r2, =0x03005d90 - ldr r2, [r2] - adds r2, 0xAC - ldr r2, [r2] - ldrh r3, [r0] - eors r2, r3 - eors r2, r1 - strh r2, [r0] - bx lr - .pool - thumb_func_end apply_u16_xor_crypto - - thumb_func_start apply_u32_xor_crypto -apply_u32_xor_crypto: @ 8077118 - ldr r2, =0x03005d90 - ldr r3, [r2] - adds r3, 0xAC - ldr r2, [r0] - ldr r3, [r3] - eors r2, r3 - eors r2, r1 - str r2, [r0] - bx lr - .pool - thumb_func_end apply_u32_xor_crypto - - thumb_func_start saveblock_apply_crypto -saveblock_apply_crypto: @ 8077130 - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_8084864 - adds r0, r4, 0 - bl call_encrypt_decrypt_all_item_quantities - adds r0, r4, 0 - bl sub_8024690 - ldr r5, =0x03005d8c - ldr r0, [r5] - movs r1, 0x92 - lsls r1, 3 - adds r0, r1 - adds r1, r4, 0 - bl apply_u32_xor_crypto - ldr r0, [r5] - ldr r1, =0x00000494 - adds r0, r1 - adds r1, r4, 0 - bl apply_u16_xor_crypto - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end saveblock_apply_crypto - - thumb_func_start sub_8077170 -sub_8077170: @ 8077170 - push {r4,lr} - adds r4, r0, 0 - adds r3, r1, 0 - ldr r0, =0x02022c2c - ldrb r0, [r0] - cmp r0, 0x1D - beq _08077194 - lsls r2, r3, 16 - lsrs r2, 16 - movs r0, 0 - adds r1, r4, 0 - bl link_0800A448 - lsls r0, 24 - lsrs r0, 24 - b _080771A2 - .pool -_08077194: - ldr r0, =0x03004140 - ldrb r0, [r0] - movs r1, 0x54 - adds r2, r4, 0 - bl rfu_NI_setSendData - movs r0, 0x1 -_080771A2: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8077170 - - thumb_func_start sub_80771AC -sub_80771AC: @ 80771AC - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl sub_800A4D8 - pop {r0} - bx r0 - thumb_func_end sub_80771AC - - thumb_func_start sub_80771BC -sub_80771BC: @ 80771BC - push {r4,lr} - ldr r0, =0x02022c2c - ldrb r0, [r0] - cmp r0, 0x1D - bne _080771F0 - ldr r4, =0x03007880 - ldr r0, =0x03004140 - ldrb r0, [r0] - bl sub_800E87C - lsls r0, 2 - adds r0, r4 - ldr r0, [r0] - ldrh r0, [r0] - cmp r0, 0 - bne _080771EC - movs r0, 0x1 - b _080771F8 - .pool -_080771EC: - movs r0, 0 - b _080771F8 -_080771F0: - bl sub_800A520 - lsls r0, 24 - lsrs r0, 24 -_080771F8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80771BC - - thumb_func_start sub_8077200 -sub_8077200: @ 8077200 - push {lr} - bl sub_800A550 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_8077200 - - thumb_func_start sub_8077210 -sub_8077210: @ 8077210 - push {lr} - bl sub_8077260 - cmp r0, 0 - beq _0807722C - ldr r0, =0x03004140 - ldrb r1, [r0] - movs r0, 0xC - bl rfu_clearSlot - b _08077230 - .pool -_0807722C: - bl sub_800A5B4 -_08077230: - pop {r0} - bx r0 - thumb_func_end sub_8077210 - - thumb_func_start sub_8077234 -sub_8077234: @ 8077234 - push {r4,lr} - adds r4, r0, 0 - bl sub_8077260 - cmp r0, 0 - beq _08077250 - ldr r0, =0x03004140 - ldrb r1, [r0] - movs r0, 0xC - bl rfu_clearSlot - b _08077258 - .pool -_08077250: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_800A5EC -_08077258: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8077234 - - thumb_func_start sub_8077260 -sub_8077260: @ 8077260 - push {lr} - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08077280 - ldr r0, =0x02022c2c - ldrb r0, [r0] - cmp r0, 0x1D - bne _08077280 - movs r0, 0x1 - b _08077282 - .pool -_08077280: - movs r0, 0 -_08077282: - pop {r1} - bx r1 - thumb_func_end sub_8077260 - - thumb_func_start sub_8077288 -sub_8077288: @ 8077288 - push {lr} - bl sub_800ADF8 - pop {r0} - bx r0 - thumb_func_end sub_8077288 - - thumb_func_start sub_8077294 -sub_8077294: @ 8077294 - push {lr} - bl sub_800A520 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_8077294 - - thumb_func_start sub_80772A4 -sub_80772A4: @ 80772A4 - push {r4,r5,lr} - sub sp, 0xC - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - bl clear_tasks - bl sub_80A1A74 - ldr r2, =0x02037fd4 - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x8] - ldr r0, =sub_807811C - bl SetVBlankCallback - ldr r4, =gUnknown_0860F074 - adds r0, r4, 0 - movs r1, 0xF0 - movs r2, 0x14 - bl gpu_pal_apply - adds r0, r4, 0 - movs r1, 0xD0 - movs r2, 0x14 - bl gpu_pal_apply - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0832DEE4 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - ldr r0, =0x0203229c - ldr r1, [r0] - movs r0, 0x8F - lsls r0, 4 - adds r1, r0 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r0, =gUnknown_0832DEF4 - bl InitWindows - lsls r0, 16 - cmp r0, 0 - beq _0807738C - bl DeactivateAllTextPrinters - movs r5, 0 -_08077310: - lsls r4, r5, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl ClearWindowTilemap - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r5, 0x1 - cmp r5, 0x11 - bls _08077310 - movs r0, 0x1E - str r0, [sp] - movs r0, 0x14 - str r0, [sp, 0x4] - movs r0, 0xF - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect - movs r0, 0 - movs r1, 0x14 - movs r2, 0xC0 - bl box_border_load_tiles_and_pal - movs r0, 0x2 - movs r1, 0x1 - movs r2, 0xE0 - bl sub_809882C - bl sub_80D2F04 - ldr r2, =0x0203229c - ldr r0, [r2] - adds r0, 0x69 - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - adds r0, 0x6F - strb r1, [r0] - ldr r0, [r2] - adds r0, 0x70 - strb r1, [r0] - ldr r0, [r2] - adds r0, 0x74 - strb r1, [r0] - ldr r0, [r2] - adds r0, 0x75 - strb r1, [r0] - ldr r0, [r2] - adds r0, 0x7A - strb r1, [r0] - ldr r0, [r2] - adds r0, 0x7B - strb r1, [r0] - ldr r0, [r2] - adds r0, 0xA8 - strb r1, [r0] -_0807738C: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80772A4 - - thumb_func_start sub_80773AC -sub_80773AC: @ 80773AC - push {lr} - ldr r0, =sub_80773D0 - bl SetMainCallback2 - ldr r0, =0x030022c0 - movs r1, 0 - str r1, [r0] - ldr r0, =0x020244ea - strb r1, [r0] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80773AC - - thumb_func_start sub_80773D0 -sub_80773D0: @ 80773D0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x28 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - adds r3, r1, 0 - cmp r0, 0x16 - bls _080773EA - b _08077B46 -_080773EA: - lsls r0, 2 - ldr r1, =_080773FC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080773FC: - .4byte _08077458 - .4byte _080774A4 - .4byte _08077560 - .4byte _0807758C - .4byte _080775E8 - .4byte _08077648 - .4byte _08077688 - .4byte _080776A8 - .4byte _080777E8 - .4byte _08077810 - .4byte _08077834 - .4byte _080778BC - .4byte _080778CA - .4byte _08077970 - .4byte _08077A40 - .4byte _08077A80 - .4byte _08077A9A - .4byte _08077AA8 - .4byte _08077ABC - .4byte _08077ADC - .4byte _08077AFC - .4byte _08077B10 - .4byte _08077B30 -_08077458: - ldr r4, =0x0203229c - ldr r0, =0x000010f0 - bl AllocZeroed - str r0, [r4] - bl sub_80772A4 - ldr r4, =0x02032184 - movs r0, 0xE0 - lsls r0, 4 - bl AllocZeroed - str r0, [r4] - movs r6, 0 - ldr r2, =0x02032188 -_08077476: - lsls r1, r6, 8 - ldr r0, [r4] - adds r0, r1 - stm r2!, {r0} - adds r6, 0x1 - cmp r6, 0xD - ble _08077476 - ldr r1, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _08077B22 - .pool -_080774A4: - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x8] - movs r6, 0 - movs r4, 0 -_080774B2: - movs r0, 0x64 - muls r0, r6 - ldr r1, =0x02024744 - adds r0, r1 - str r4, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - str r4, [sp, 0xC] - movs r1, 0 - movs r2, 0 - movs r3, 0x20 - bl create_pokemon_set_level - adds r6, 0x1 - cmp r6, 0x5 - ble _080774B2 - movs r0, 0 - bl sub_807A19C - movs r0, 0 - bl ShowBg - ldr r0, =0x03003124 - ldrb r2, [r0] - cmp r2, 0 - bne _0807754C - ldr r1, =0x020229c6 - ldr r5, =0x00001122 - adds r0, r5, 0 - strh r0, [r1] - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0xA8 - strb r2, [r0] - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08077528 - bl sub_800B488 - bl sub_8009734 - bl sub_8011BA4 - b _08077B46 - .pool -_08077528: - bl sub_8009734 - ldr r0, =0x030022c0 - movs r7, 0x87 - lsls r7, 3 - adds r0, r7 - ldrb r1, [r0] - adds r1, 0x1 - strb r1, [r0] - ldr r0, =task00_08081A90 - movs r1, 0x1 - bl AddTask - b _08077B46 - .pool -_0807754C: - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r1, 0x4 - strb r1, [r0] - b _08077B46 - .pool -_08077560: - ldr r2, =0x0203229c - ldr r1, [r2] - adds r1, 0xA8 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r2] - adds r1, r0, 0 - adds r1, 0xA8 - ldrb r0, [r1] - cmp r0, 0xB - bhi _0807757A - b _08077B46 -_0807757A: - movs r0, 0 - strb r0, [r1] - movs r2, 0x87 - lsls r2, 3 - adds r1, r3, r2 - b _08077B22 - .pool -_0807758C: - bl sub_800ABAC - adds r4, r0, 0 - bl sub_800AA48 - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - bcs _080775A0 - b _08077B46 -_080775A0: - bl sub_800ABBC - lsls r0, 24 - cmp r0, 0 - beq _080775D8 - ldr r0, =0x0203229c - ldr r1, [r0] - adds r1, 0xA8 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1E - bhi _080775C0 - b _08077B46 -_080775C0: - bl sub_800A620 - ldr r1, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _08077B22 - .pool -_080775D8: - ldr r1, =0x030022c0 - movs r5, 0x87 - lsls r5, 3 - adds r1, r5 - b _08077B22 - .pool -_080775E8: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0x1 - beq _080775F2 - b _08077B46 -_080775F2: - bl sub_800A23C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08077600 - b _08077B46 -_08077600: - bl sub_8011BD0 - bl calc_player_party_count - ldr r1, =0x030022c0 - movs r7, 0x87 - lsls r7, 3 - adds r1, r7 - ldrb r0, [r1] - adds r0, 0x1 - movs r2, 0 - strb r0, [r1] - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0xA8 - strb r2, [r0] - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _0807762A - b _08077B46 -_0807762A: - movs r0, 0x1 - bl sub_801048C - bl sub_800ADF8 - b _08077B46 - .pool -_08077648: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08077680 - bl sub_8010500 - lsls r0, 24 - cmp r0, 0 - bne _0807765C - b _08077B46 -_0807765C: - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - bl sub_800E0E8 - movs r0, 0 - movs r1, 0 - bl sub_800DFB4 - b _08077B46 - .pool -_08077680: - movs r2, 0x87 - lsls r2, 3 - adds r1, r3, r2 - b _08077B22 -_08077688: - bl shedinja_maker_maybe - lsls r0, 24 - cmp r0, 0 - bne _08077694 - b _08077B46 -_08077694: - bl sub_807A5B0 - ldr r1, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _08077B22 - .pool -_080776A8: - bl calc_enemy_party_count - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - ldr r2, =0x0203229c - ldr r0, [r2] - ldr r1, =0x020244e9 - ldrb r1, [r1] - adds r0, 0x36 - strb r1, [r0] - ldr r0, [r2] - ldr r1, =0x020244ea - ldrb r1, [r1] - adds r0, 0x37 - strb r1, [r0] - movs r6, 0 - ldr r0, [r2] - adds r0, 0x36 - ldrb r0, [r0] - cmp r6, r0 - bge _08077740 - mov r8, r2 - ldr r7, =gUnknown_0832DE24 -_080776E2: - movs r0, 0x64 - adds r4, r6, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - ldrb r2, [r7] - lsls r2, 19 - movs r1, 0xE0 - lsls r1, 12 - adds r2, r1 - asrs r2, 16 - ldrb r3, [r7, 0x1] - lsls r3, 19 - ldr r1, =0xfff40000 - adds r3, r1 - asrs r3, 16 - movs r1, 0x1 - str r1, [sp] - str r0, [sp, 0x4] - str r1, [sp, 0x8] - adds r0, r5, 0 - ldr r1, =sub_80D3014 - bl sub_80D2CC4 - mov r2, r8 - ldr r1, [r2] - adds r1, 0x28 - adds r1, r6 - strb r0, [r1] - adds r7, 0x2 - adds r6, 0x1 - ldr r0, [r2] - adds r0, 0x36 - ldrb r0, [r0] - cmp r6, r0 - blt _080776E2 -_08077740: - movs r6, 0 - ldr r1, =0x0203229c - ldr r0, [r1] - adds r0, 0x37 - ldrb r0, [r0] - cmp r6, r0 - bge _080777B8 - ldr r0, =gUnknown_0832DE24 - mov r8, r1 - adds r7, r0, 0 - adds r7, 0xC -_08077756: - movs r0, 0x64 - adds r4, r6, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x41 - movs r2, 0 - bl pokemon_getattr - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - ldrb r2, [r7] - lsls r2, 19 - movs r3, 0xE0 - lsls r3, 12 - adds r2, r3 - asrs r2, 16 - ldrb r3, [r7, 0x1] - lsls r3, 19 - ldr r1, =0xfff40000 - adds r3, r1 - asrs r3, 16 - movs r1, 0x1 - str r1, [sp] - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r5, 0 - ldr r1, =sub_80D3014 - bl sub_80D2CC4 - mov r2, r8 - ldr r1, [r2] - adds r1, 0x2E - adds r1, r6 - strb r0, [r1] - adds r7, 0x2 - adds r6, 0x1 - ldr r0, [r2] - adds r0, 0x37 - ldrb r0, [r0] - cmp r6, r0 - blt _08077756 -_080777B8: - ldr r1, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _08077B22 - .pool -_080777E8: - bl sub_81B5D30 - ldr r0, =0x0203229c - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x36 - adds r1, 0x28 - movs r2, 0 - bl sub_81B5D4C - ldr r1, =0x030022c0 - movs r5, 0x87 - lsls r5, 3 - adds r1, r5 - b _08077B22 - .pool -_08077810: - ldr r0, =0x0203229c - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x36 - adds r1, 0x28 - movs r2, 0x1 - bl sub_81B5D4C - ldr r1, =0x030022c0 - movs r7, 0x87 - lsls r7, 3 - adds r1, r7 - b _08077B22 - .pool -_08077834: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r5, =0x02032188 - ldr r1, [r5] - movs r4, 0x3 - str r4, [sp] - movs r2, 0 - movs r3, 0 - bl sub_80C6D80 - bl link_get_multiplayer_id - lsls r0, 24 - movs r1, 0x80 - lsls r1, 17 - eors r1, r0 - lsrs r1, 24 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - ldr r1, =0x020229f0 - adds r0, r1 - ldr r1, [r5, 0xC] - str r4, [sp] - movs r2, 0 - movs r3, 0 - bl sub_80C6D80 - ldr r4, =gUnknown_0832DE94 - ldr r0, [r4] - ldr r1, [r5, 0x18] - movs r2, 0x2 - str r2, [sp] - movs r2, 0 - movs r3, 0 - bl sub_80C6D80 - ldr r0, [r4, 0x4] - ldr r1, [r5, 0x20] - movs r2, 0x18 - bl sub_807A308 - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - movs r2, 0 - strb r0, [r1] - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0xA8 - strb r2, [r0] - b _08077B46 - .pool -_080778BC: - bl sub_807A1F0 - lsls r0, 24 - cmp r0, 0 - bne _080778C8 - b _08077B46 -_080778C8: - b _08077B1A -_080778CA: - ldr r0, =0x03005d90 - ldr r1, [r0] - movs r0, 0x1 - movs r2, 0x78 - bl GetStringCenterAlignXOffset - movs r6, 0 - add r5, sp, 0x10 - adds r4, r0, 0 - adds r4, 0x10 -_080778DE: - add r1, sp, 0x10 - ldr r0, =gUnknown_0832DCAC - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - ldrh r0, [r5] - adds r0, r6 - strh r0, [r5] - lsls r1, r4, 16 - asrs r1, 16 - add r0, sp, 0x10 - movs r2, 0xA - movs r3, 0x1 - bl AddObjectToFront - adds r4, 0x20 - adds r6, 0x1 - cmp r6, 0x2 - ble _080778DE - bl link_get_multiplayer_id - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r0, =0x020229f0 - adds r1, r0 - movs r0, 0x1 - movs r2, 0x78 - bl GetStringCenterAlignXOffset - movs r6, 0 - add r5, sp, 0x10 - adds r4, r0, 0 - adds r4, 0x88 -_0807792C: - add r1, sp, 0x10 - ldr r0, =gUnknown_0832DCAC - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - adds r0, r6, 0x3 - ldrh r3, [r5] - adds r0, r3 - strh r0, [r5] - lsls r1, r4, 16 - asrs r1, 16 - add r0, sp, 0x10 - movs r2, 0xA - movs r3, 0x1 - bl AddObjectToFront - adds r4, 0x20 - adds r6, 0x1 - cmp r6, 0x2 - ble _0807792C - ldr r1, =0x030022c0 - movs r5, 0x87 - lsls r5, 3 - adds r1, r5 - b _08077B22 - .pool -_08077970: - ldr r4, =gUnknown_0832DCAC - add r1, sp, 0x10 - adds r0, r4, 0 - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - ldm r0!, {r2,r5,r7} - stm r1!, {r2,r5,r7} - add r1, sp, 0x10 - adds r0, r1, 0 - ldrh r0, [r0] - adds r0, 0x6 - strh r0, [r1] - adds r0, r1, 0 - movs r1, 0xD7 - movs r2, 0x98 - movs r3, 0x1 - bl AddObjectToFront - add r0, sp, 0x10 - ldm r4!, {r3,r5,r7} - stm r0!, {r3,r5,r7} - ldm r4!, {r1-r3} - stm r0!, {r1-r3} - add r1, sp, 0x10 - adds r0, r1, 0 - ldrh r0, [r0] - adds r0, 0x7 - strh r0, [r1] - adds r0, r1, 0 - movs r1, 0xF7 - movs r2, 0x98 - movs r3, 0x1 - bl AddObjectToFront - movs r6, 0 - add r4, sp, 0x10 - movs r5, 0xC0 - lsls r5, 13 -_080779BC: - add r1, sp, 0x10 - ldr r0, =gUnknown_0832DCAC - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - adds r0, r6, 0 - adds r0, 0x8 - ldrh r7, [r4] - adds r0, r7 - strh r0, [r4] - asrs r1, r5, 16 - add r0, sp, 0x10 - movs r2, 0x96 - movs r3, 0x1 - bl AddObjectToFront - movs r0, 0x80 - lsls r0, 14 - adds r5, r0 - adds r6, 0x1 - cmp r6, 0x5 - ble _080779BC - ldr r0, =gUnknown_0832DC94 - ldr r2, =gUnknown_0832DE24 - ldrb r1, [r2] - lsls r1, 19 - movs r3, 0x80 - lsls r3, 14 - adds r1, r3 - asrs r1, 16 - ldrb r2, [r2, 0x1] - lsls r2, 3 - movs r3, 0x2 - bl AddObjectToFront - ldr r2, =0x0203229c - ldr r1, [r2] - adds r1, 0x34 - movs r3, 0 - strb r0, [r1] - ldr r0, [r2] - adds r0, 0x35 - strb r3, [r0] - ldr r1, =0x030022c0 - movs r5, 0x87 - lsls r5, 3 - adds r1, r5 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r0, 0 - bl rbox_fill_rectangle - b _08077B46 - .pool -_08077A40: - movs r0, 0 - bl sub_807A320 - movs r0, 0 - bl sub_8079BE0 - ldr r2, =0x0203229c - ldr r0, [r2] - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - strb r1, [r0, 0x1] - bl sub_8078388 - ldr r1, =0x030022c0 - movs r7, 0x87 - lsls r7, 3 - adds r1, r7 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, =0x000001b3 - bl song_play_for_text - b _08077B46 - .pool -_08077A80: - movs r0, 0x1 - bl sub_807A320 - movs r0, 0x1 - bl sub_8079BE0 - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_08077A9A: - movs r0, 0 - bl sub_80782B8 - b _08077B1A - .pool -_08077AA8: - movs r0, 0x1 - bl sub_80782B8 - ldr r1, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _08077B22 - .pool -_08077ABC: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r1, =0x030022c0 - movs r5, 0x87 - lsls r5, 3 - adds r1, r5 - b _08077B22 - .pool -_08077ADC: - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0x2 - bl sub_80782B8 - ldr r1, =0x030022c0 - movs r7, 0x87 - lsls r7, 3 - adds r1, r7 - b _08077B22 - .pool -_08077AFC: - movs r0, 0 - bl sub_807A468 - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _08077B22 - .pool -_08077B10: - movs r0, 0x1 - bl sub_807A468 - bl sub_807A53C -_08077B1A: - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 -_08077B22: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08077B46 - .pool -_08077B30: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08077B46 - ldr r0, =sub_8078C34 - str r0, [r3] - ldr r0, =sub_807825C - bl SetMainCallback2 -_08077B46: - bl RunTextPrinters - bl RunActiveTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - add sp, 0x28 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80773D0 - - thumb_func_start sub_8077B74 -sub_8077B74: @ 8077B74 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x24 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0x16 - bls _08077B8E - b _080780F6 -_08077B8E: - lsls r0, 2 - ldr r1, =_08077BA0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08077BA0: - .4byte _08077BFC - .4byte _08077C10 - .4byte _08077C18 - .4byte _08077C20 - .4byte _08077C28 - .4byte _08077C3C - .4byte _08077C64 - .4byte _08077C6C - .4byte _08077DB0 - .4byte _08077DD8 - .4byte _08077DFC - .4byte _08077E84 - .4byte _08077EA0 - .4byte _08077F48 - .4byte _080780F6 - .4byte _080780F6 - .4byte _08078038 - .4byte _08078040 - .4byte _08078068 - .4byte _080780A4 - .4byte _080780C4 - .4byte _080780CC - .4byte _080780E4 -_08077BFC: - bl sub_80772A4 - ldr r1, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _080780D8 - .pool -_08077C10: - movs r5, 0x87 - lsls r5, 3 - adds r1, r2, r5 - b _08077E58 -_08077C18: - movs r7, 0x87 - lsls r7, 3 - adds r1, r2, r7 - b _080780D8 -_08077C20: - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 - b _080780D8 -_08077C28: - bl calc_player_party_count - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _080780D8 - .pool -_08077C3C: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08077C50 - bl sub_800E0E8 - movs r0, 0 - movs r1, 0 - bl sub_800DFB4 -_08077C50: - ldr r1, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _080780D8 - .pool -_08077C64: - movs r5, 0x87 - lsls r5, 3 - adds r1, r2, r5 - b _080780D8 -_08077C6C: - bl calc_enemy_party_count - ldr r4, =0x0203229c - ldr r0, [r4] - ldr r1, =0x020244e9 - ldrb r1, [r1] - adds r0, 0x36 - strb r1, [r0] - ldr r0, [r4] - ldr r1, =0x020244ea - ldrb r1, [r1] - adds r0, 0x37 - strb r1, [r0] - movs r0, 0 - bl ClearWindowTilemap - movs r0, 0 - bl sub_8079BE0 - movs r0, 0x1 - bl sub_8079BE0 - movs r6, 0 - ldr r0, [r4] - adds r0, 0x36 - ldrb r0, [r0] - cmp r6, r0 - bge _08077D08 - mov r8, r4 - ldr r7, =gUnknown_0832DE24 -_08077CA8: - movs r0, 0x64 - adds r4, r6, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x41 - movs r2, 0 - bl pokemon_getattr - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - ldrb r2, [r7] - lsls r2, 19 - movs r1, 0xE0 - lsls r1, 12 - adds r2, r1 - asrs r2, 16 - ldrb r3, [r7, 0x1] - lsls r3, 19 - ldr r1, =0xfff40000 - adds r3, r1 - asrs r3, 16 - movs r1, 0x1 - str r1, [sp] - str r0, [sp, 0x4] - str r1, [sp, 0x8] - adds r0, r5, 0 - ldr r1, =sub_80D3014 - bl sub_80D2CC4 - mov r2, r8 - ldr r1, [r2] - adds r1, 0x28 - adds r1, r6 - strb r0, [r1] - adds r7, 0x2 - adds r6, 0x1 - ldr r0, [r2] - adds r0, 0x36 - ldrb r0, [r0] - cmp r6, r0 - blt _08077CA8 -_08077D08: - movs r6, 0 - ldr r1, =0x0203229c - ldr r0, [r1] - adds r0, 0x37 - ldrb r0, [r0] - cmp r6, r0 - bge _08077D80 - ldr r0, =gUnknown_0832DE24 - mov r8, r1 - adds r7, r0, 0 - adds r7, 0xC -_08077D1E: - movs r0, 0x64 - adds r4, r6, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x41 - movs r2, 0 - bl pokemon_getattr - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - ldrb r2, [r7] - lsls r2, 19 - movs r3, 0xE0 - lsls r3, 12 - adds r2, r3 - asrs r2, 16 - ldrb r3, [r7, 0x1] - lsls r3, 19 - ldr r1, =0xfff40000 - adds r3, r1 - asrs r3, 16 - movs r1, 0x1 - str r1, [sp] - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r5, 0 - ldr r1, =sub_80D3014 - bl sub_80D2CC4 - mov r2, r8 - ldr r1, [r2] - adds r1, 0x2E - adds r1, r6 - strb r0, [r1] - adds r7, 0x2 - adds r6, 0x1 - ldr r0, [r2] - adds r0, 0x37 - ldrb r0, [r0] - cmp r6, r0 - blt _08077D1E -_08077D80: - ldr r1, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _080780D8 - .pool -_08077DB0: - bl sub_81B5D30 - ldr r0, =0x0203229c - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x36 - adds r1, 0x28 - movs r2, 0 - bl sub_81B5D4C - ldr r1, =0x030022c0 - movs r5, 0x87 - lsls r5, 3 - adds r1, r5 - b _080780D8 - .pool -_08077DD8: - ldr r0, =0x0203229c - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x36 - adds r1, 0x28 - movs r2, 0x1 - bl sub_81B5D4C - ldr r1, =0x030022c0 - movs r7, 0x87 - lsls r7, 3 - adds r1, r7 - b _080780D8 - .pool -_08077DFC: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r5, =0x02032188 - ldr r1, [r5] - movs r4, 0x3 - str r4, [sp] - movs r2, 0 - movs r3, 0 - bl sub_80C6D80 - bl link_get_multiplayer_id - lsls r0, 24 - movs r1, 0x80 - lsls r1, 17 - eors r1, r0 - lsrs r1, 24 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - ldr r1, =0x020229f0 - adds r0, r1 - ldr r1, [r5, 0xC] - str r4, [sp] - movs r2, 0 - movs r3, 0 - bl sub_80C6D80 - ldr r4, =gUnknown_0832DE94 - ldr r0, [r4] - ldr r1, [r5, 0x18] - movs r2, 0x2 - str r2, [sp] - movs r2, 0 - movs r3, 0 - bl sub_80C6D80 - ldr r0, [r4, 0x4] - ldr r1, [r5, 0x20] - movs r2, 0x18 - bl sub_807A308 - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 -_08077E58: - ldrb r0, [r1] - adds r0, 0x1 - movs r2, 0 - strb r0, [r1] - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0xA8 - strb r2, [r0] - b _080780F6 - .pool -_08077E84: - bl sub_807A1F0 - lsls r0, 24 - cmp r0, 0 - bne _08077E90 - b _080780F6 -_08077E90: - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _080780D8 - .pool -_08077EA0: - ldr r0, =0x03005d90 - ldr r1, [r0] - movs r0, 0x1 - movs r2, 0x78 - bl GetStringCenterAlignXOffset - movs r6, 0 - add r5, sp, 0xC - adds r4, r0, 0 - adds r4, 0x10 -_08077EB4: - add r1, sp, 0xC - ldr r0, =gUnknown_0832DCAC - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - ldrh r0, [r5] - adds r0, r6 - strh r0, [r5] - lsls r1, r4, 16 - asrs r1, 16 - add r0, sp, 0xC - movs r2, 0xA - movs r3, 0x1 - bl AddObjectToFront - adds r4, 0x20 - adds r6, 0x1 - cmp r6, 0x2 - ble _08077EB4 - bl link_get_multiplayer_id - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r0, =0x020229f0 - adds r1, r0 - movs r0, 0x1 - movs r2, 0x78 - bl GetStringCenterAlignXOffset - movs r6, 0 - add r5, sp, 0xC - adds r4, r0, 0 - adds r4, 0x88 -_08077F02: - add r1, sp, 0xC - ldr r0, =gUnknown_0832DCAC - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - adds r0, r6, 0x3 - ldrh r3, [r5] - adds r0, r3 - strh r0, [r5] - lsls r1, r4, 16 - asrs r1, 16 - add r0, sp, 0xC - movs r2, 0xA - movs r3, 0x1 - bl AddObjectToFront - adds r4, 0x20 - adds r6, 0x1 - cmp r6, 0x2 - ble _08077F02 - ldr r1, =0x030022c0 - movs r5, 0x87 - lsls r5, 3 - adds r1, r5 - b _080780D8 - .pool -_08077F48: - ldr r4, =gUnknown_0832DCAC - add r1, sp, 0xC - adds r0, r4, 0 - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - ldm r0!, {r2,r5,r7} - stm r1!, {r2,r5,r7} - add r1, sp, 0xC - adds r0, r1, 0 - ldrh r0, [r0] - adds r0, 0x6 - strh r0, [r1] - adds r0, r1, 0 - movs r1, 0xD7 - movs r2, 0x98 - movs r3, 0x1 - bl AddObjectToFront - add r0, sp, 0xC - ldm r4!, {r3,r5,r7} - stm r0!, {r3,r5,r7} - ldm r4!, {r1-r3} - stm r0!, {r1-r3} - add r1, sp, 0xC - adds r0, r1, 0 - ldrh r0, [r0] - adds r0, 0x7 - strh r0, [r1] - adds r0, r1, 0 - movs r1, 0xF7 - movs r2, 0x98 - movs r3, 0x1 - bl AddObjectToFront - movs r6, 0 - add r4, sp, 0xC - movs r5, 0xC0 - lsls r5, 13 -_08077F94: - add r1, sp, 0xC - ldr r0, =gUnknown_0832DCAC - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - adds r0, r6, 0 - adds r0, 0x8 - ldrh r7, [r4] - adds r0, r7 - strh r0, [r4] - asrs r1, r5, 16 - add r0, sp, 0xC - movs r2, 0x96 - movs r3, 0x1 - bl AddObjectToFront - movs r0, 0x80 - lsls r0, 14 - adds r5, r0 - adds r6, 0x1 - cmp r6, 0x5 - ble _08077F94 - ldr r0, =0x0203229c - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0x35 - ldrb r1, [r2] - adds r4, r0, 0 - cmp r1, 0x5 - bhi _08077FE4 - ldr r0, =0x0203cf20 - ldrb r0, [r0] - b _08077FEA - .pool -_08077FE4: - ldr r0, =0x0203cf20 - ldrb r0, [r0] - adds r0, 0x6 -_08077FEA: - strb r0, [r2] - ldr r0, =gUnknown_0832DC94 - ldr r3, =gUnknown_0832DE24 - ldr r1, [r4] - adds r1, 0x35 - ldrb r2, [r1] - lsls r2, 1 - adds r1, r2, r3 - ldrb r1, [r1] - lsls r1, 19 - movs r5, 0x80 - lsls r5, 14 - adds r1, r5 - asrs r1, 16 - adds r3, 0x1 - adds r2, r3 - ldrb r2, [r2] - lsls r2, 3 - movs r3, 0x2 - bl AddObjectToFront - ldr r1, [r4] - adds r1, 0x34 - strb r0, [r1] - ldr r0, =0x030022c0 - movs r7, 0x87 - lsls r7, 3 - adds r0, r7 - movs r1, 0x10 - strb r1, [r0] - b _080780F6 - .pool -_08078038: - movs r0, 0 - bl sub_80782B8 - b _080780D0 -_08078040: - movs r0, 0x1 - bl sub_80782B8 - ldr r2, =0x0203229c - ldr r0, [r2] - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - strb r1, [r0, 0x1] - bl sub_8078388 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _080780D8 - .pool -_08078068: - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x8] - movs r4, 0x1 - negs r4, r4 - adds r0, r4, 0 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r1, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _080780D8 - .pool -_080780A4: - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0x2 - bl sub_80782B8 - ldr r1, =0x030022c0 - movs r5, 0x87 - lsls r5, 3 - adds r1, r5 - b _080780D8 - .pool -_080780C4: - movs r7, 0x87 - lsls r7, 3 - adds r1, r2, r7 - b _080780D8 -_080780CC: - bl sub_807A53C -_080780D0: - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 -_080780D8: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080780F6 - .pool -_080780E4: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080780F6 - ldr r0, =sub_807825C - bl SetMainCallback2 -_080780F6: - bl RunActiveTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - add sp, 0x24 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8077B74 - - thumb_func_start sub_807811C -sub_807811C: @ 807811C - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_807811C - - thumb_func_start sub_8078130 -sub_8078130: @ 8078130 - push {r4,lr} - sub sp, 0x4 - ldr r4, =0x0203229c - ldr r1, [r4] - adds r1, 0xA8 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xF - bls _08078160 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, [r4] - adds r0, 0x6F - movs r1, 0xA - strb r1, [r0] -_08078160: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8078130 - - thumb_func_start sub_807816C -sub_807816C: @ 807816C - push {r4,lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080781C2 - ldr r1, =0x02032298 - ldr r4, =0x0203229c - ldr r2, [r4] - adds r0, r2, 0 - adds r0, 0x35 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r2, 0 - adds r0, 0x7E - ldrb r0, [r0] - strb r0, [r1, 0x1] - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _080781B4 - adds r1, r2, 0 - adds r1, 0x6F - movs r0, 0x10 - strb r0, [r1] - b _080781C2 - .pool -_080781B4: - movs r0, 0x20 - bl sub_800ABF4 - ldr r0, [r4] - adds r0, 0x6F - movs r1, 0xD - strb r1, [r0] -_080781C2: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_807816C - - thumb_func_start sub_80781C8 -sub_80781C8: @ 80781C8 - push {r4,r5,lr} - ldr r5, =0x030022c0 - ldr r0, =sub_80773AC - str r0, [r5, 0x8] - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08078220 - bl sub_8010500 - lsls r0, 24 - cmp r0, 0 - beq _08078244 - ldr r0, =0x02032184 - ldr r0, [r0] - bl Free - bl FreeAllWindowBuffers - ldr r0, =0x0203229c - ldr r0, [r0] - bl Free - movs r0, 0 - str r0, [r5] - bl sub_800E084 - ldr r0, =sub_807AE50 - bl SetMainCallback2 - b _08078244 - .pool -_08078220: - ldr r0, =0x03003124 - ldrb r4, [r0] - cmp r4, 0 - bne _08078244 - ldr r0, =0x02032184 - ldr r0, [r0] - bl Free - bl FreeAllWindowBuffers - ldr r0, =0x0203229c - ldr r0, [r0] - bl Free - str r4, [r5] - ldr r0, =sub_807AE50 - bl SetMainCallback2 -_08078244: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80781C8 - - thumb_func_start sub_807825C -sub_807825C: @ 807825C - push {r4,lr} - bl sub_80795AC - bl sub_807A0C4 - movs r0, 0 - bl sub_80796B4 - movs r0, 0x1 - bl sub_80796B4 - ldr r4, =0x0203229c - ldr r2, [r4] - ldrb r1, [r2] - adds r0, r1, 0x1 - strb r0, [r2] - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x18 - bl SetGpuReg - ldr r2, [r4] - ldrb r1, [r2, 0x1] - adds r0, r1, 0 - adds r0, 0xFF - strb r0, [r2, 0x1] - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x1C - bl SetGpuReg - bl sub_8197224 - bl RunActiveTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807825C - - thumb_func_start sub_80782B8 -sub_80782B8: @ 80782B8 - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - beq _08078324 - cmp r4, 0x1 - bgt _080782CE - cmp r4, 0 - beq _080782D4 - b _0807837E -_080782CE: - cmp r4, 0x2 - beq _0807834C - b _0807837E -_080782D4: - ldr r0, =gUnknown_08DDB3E4 - movs r1, 0 - movs r2, 0x60 - bl gpu_pal_apply - ldr r1, =gUnknown_08DDB464 - movs r2, 0x94 - lsls r2, 5 - movs r0, 0x1 - movs r3, 0 - bl LoadBgTiles - ldr r1, =gUnknown_08DDCF04 - movs r0, 0x20 - str r0, [sp] - movs r0, 0x14 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBufferRect_ChangePalette - ldr r1, =gUnknown_0832CABC - movs r2, 0x80 - lsls r2, 4 - movs r0, 0x2 - movs r3, 0 - bl LoadBgTilemap - b _0807837E - .pool -_08078324: - ldr r1, =gUnknown_0832D2BC - movs r2, 0x80 - lsls r2, 4 - movs r0, 0x3 - movs r3, 0 - bl LoadBgTilemap - movs r0, 0 - bl sub_8079E44 - movs r0, 0x1 - bl sub_8079E44 - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - b _0807837E - .pool -_0807834C: - movs r5, 0x80 - lsls r5, 21 - movs r4, 0x3 -_08078352: - lsrs r0, r5, 24 - movs r1, 0 - bl SetGpuReg - movs r0, 0x80 - lsls r0, 18 - adds r5, r0 - subs r4, 0x1 - cmp r4, 0 - bge _08078352 - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg -_0807837E: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80782B8 - - thumb_func_start sub_8078388 -sub_8078388: @ 8078388 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r3, 0 - ldr r5, =0x0203229c - mov r8, r5 - ldr r0, =0x02020630 - mov r12, r0 - movs r1, 0x5 - negs r1, r1 - mov r9, r1 - movs r4, 0x6 - movs r7, 0x1 - movs r6, 0 -_080783A6: - mov r1, r8 - ldr r0, [r1] - adds r1, r0, 0 - adds r1, 0x36 - ldrb r1, [r1] - cmp r3, r1 - bge _080783E0 - adds r0, 0x28 - adds r0, r3 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r12 - adds r1, 0x3E - ldrb r2, [r1] - mov r0, r9 - ands r0, r2 - strb r0, [r1] - ldr r0, [r5] - adds r0, 0x38 - adds r0, r3 - strb r7, [r0] - b _080783E6 - .pool -_080783E0: - adds r0, 0x38 - adds r0, r3 - strb r6, [r0] -_080783E6: - mov r1, r8 - ldr r0, [r1] - adds r1, r0, 0 - adds r1, 0x37 - ldrb r1, [r1] - cmp r3, r1 - bge _08078416 - adds r0, 0x2E - adds r0, r3 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r12 - adds r1, 0x3E - ldrb r2, [r1] - mov r0, r9 - ands r0, r2 - strb r0, [r1] - ldr r0, [r5] - adds r0, 0x38 - adds r0, r4 - strb r7, [r0] - b _0807841C -_08078416: - adds r0, 0x38 - adds r0, r4 - strb r6, [r0] -_0807841C: - adds r4, 0x1 - adds r3, 0x1 - cmp r3, 0x5 - ble _080783A6 - ldr r0, [r5] - adds r0, 0x44 - movs r1, 0x1 - strb r1, [r0] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8078388 - - thumb_func_start sub_8078438 -sub_8078438: @ 8078438 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - movs r3, 0 - cmp r3, r2 - bcs _08078452 -_08078444: - adds r0, r5, r3 - adds r1, r4, r3 - ldrb r1, [r1] - strb r1, [r0] - adds r3, 0x1 - cmp r3, r2 - bcc _08078444 -_08078452: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8078438 - - thumb_func_start shedinja_maker_maybe -shedinja_maker_maybe: @ 8078458 - push {r4-r6,lr} - sub sp, 0xC - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x69 - ldrb r0, [r0] - cmp r0, 0x15 - bls _08078472 - b _080787AA -_08078472: - lsls r0, 2 - ldr r1, =_08078484 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08078484: - .4byte _080784DC - .4byte _08078508 - .4byte _08078784 - .4byte _08078534 - .4byte _08078548 - .4byte _0807857C - .4byte _08078784 - .4byte _08078598 - .4byte _080785AC - .4byte _080785E0 - .4byte _08078784 - .4byte _080785FC - .4byte _08078610 - .4byte _08078644 - .4byte _08078784 - .4byte _0807866C - .4byte _08078680 - .4byte _080786B4 - .4byte _08078784 - .4byte _080786DC - .4byte _080786F0 - .4byte _08078720 -_080784DC: - ldr r0, =0x020228c4 - ldr r1, =0x020244ec - movs r2, 0xC8 - bl sub_8078438 - ldr r3, =0x0203229c - ldr r1, [r3] - adds r1, 0x69 - ldrb r0, [r1] - adds r0, 0x1 - movs r2, 0 - strb r0, [r1] - ldr r0, [r3] - adds r0, 0xA8 - strb r2, [r0] - b _080787AA - .pool -_08078508: - bl sub_80771BC - cmp r0, 0 - bne _08078512 - b _080787AA -_08078512: - bl sub_8077200 - cmp r0, 0 - bne _08078524 - ldr r0, =0x0203229c - ldr r1, [r0] - b _080787A2 - .pool -_08078524: - bl sub_8077210 - ldr r0, =0x0203229c - ldr r1, [r0] - b _080787A2 - .pool -_08078534: - cmp r5, 0 - bne _0807853E - movs r0, 0x1 - bl sub_80771AC -_0807853E: - ldr r0, =0x0203229c - ldr r1, [r0] - b _080787A2 - .pool -_08078548: - bl sub_8077200 - cmp r0, 0x3 - beq _08078552 - b _080787AA -_08078552: - ldr r0, =0x02024744 - movs r2, 0x1 - adds r1, r5, 0 - eors r1, r2 - lsls r1, 8 - ldr r2, =0x020223c4 - adds r1, r2 - movs r2, 0xC8 - bl sub_8078438 - bl sub_8077210 - ldr r0, =0x0203229c - ldr r1, [r0] - b _080787A2 - .pool -_0807857C: - ldr r0, =0x020228c4 - ldr r1, =0x020245b4 - movs r2, 0xC8 - bl sub_8078438 - ldr r0, =0x0203229c - ldr r1, [r0] - b _080787A2 - .pool -_08078598: - cmp r5, 0 - bne _080785A2 - movs r0, 0x1 - bl sub_80771AC -_080785A2: - ldr r0, =0x0203229c - ldr r1, [r0] - b _080787A2 - .pool -_080785AC: - bl sub_8077200 - cmp r0, 0x3 - beq _080785B6 - b _080787AA -_080785B6: - ldr r0, =0x0202480c - movs r2, 0x1 - adds r1, r5, 0 - eors r1, r2 - lsls r1, 8 - ldr r2, =0x020223c4 - adds r1, r2 - movs r2, 0xC8 - bl sub_8078438 - bl sub_8077210 - ldr r0, =0x0203229c - ldr r1, [r0] - b _080787A2 - .pool -_080785E0: - ldr r0, =0x020228c4 - ldr r1, =0x0202467c - movs r2, 0xC8 - bl sub_8078438 - ldr r0, =0x0203229c - ldr r1, [r0] - b _080787A2 - .pool -_080785FC: - cmp r5, 0 - bne _08078606 - movs r0, 0x1 - bl sub_80771AC -_08078606: - ldr r0, =0x0203229c - ldr r1, [r0] - b _080787A2 - .pool -_08078610: - bl sub_8077200 - cmp r0, 0x3 - beq _0807861A - b _080787AA -_0807861A: - ldr r0, =0x020248d4 - movs r2, 0x1 - adds r1, r5, 0 - eors r1, r2 - lsls r1, 8 - ldr r2, =0x020223c4 - adds r1, r2 - movs r2, 0xC8 - bl sub_8078438 - bl sub_8077210 - ldr r0, =0x0203229c - ldr r1, [r0] - b _080787A2 - .pool -_08078644: - ldr r0, =0x020228c4 - ldr r1, =0x03005d8c - ldr r1, [r1] - ldr r2, =0x00002be0 - adds r1, r2 - movs r2, 0xDC - bl sub_8078438 - ldr r0, =0x0203229c - ldr r1, [r0] - b _080787A2 - .pool -_0807866C: - cmp r5, 0 - bne _08078676 - movs r0, 0x3 - bl sub_80771AC -_08078676: - ldr r0, =0x0203229c - ldr r1, [r0] - b _080787A2 - .pool -_08078680: - bl sub_8077200 - cmp r0, 0x3 - beq _0807868A - b _080787AA -_0807868A: - ldr r0, =0x020321c0 - movs r2, 0x1 - adds r1, r5, 0 - eors r1, r2 - lsls r1, 8 - ldr r2, =0x020223c4 - adds r1, r2 - movs r2, 0xD8 - bl sub_8078438 - bl sub_8077210 - ldr r0, =0x0203229c - ldr r1, [r0] - b _080787A2 - .pool -_080786B4: - ldr r0, =0x020228c4 - ldr r1, =0x03005d8c - ldr r1, [r1] - ldr r2, =0x000031a8 - adds r1, r2 - movs r2, 0xB - bl sub_8078438 - ldr r0, =0x0203229c - ldr r1, [r0] - b _080787A2 - .pool -_080786DC: - cmp r5, 0 - bne _080786E6 - movs r0, 0x4 - bl sub_80771AC -_080786E6: - ldr r0, =0x0203229c - ldr r1, [r0] - b _080787A2 - .pool -_080786F0: - bl sub_8077200 - cmp r0, 0x3 - bne _080787AA - ldr r4, =0x0203229c - ldr r0, [r4] - adds r0, 0xA9 - movs r2, 0x1 - adds r1, r5, 0 - eors r1, r2 - lsls r1, 8 - ldr r2, =0x020223c4 - adds r1, r2 - movs r2, 0xB - bl sub_8078438 - bl sub_8077210 - ldr r1, [r4] - b _080787A2 - .pool -_08078720: - ldr r4, =0x02024744 - ldr r6, =0x0000012f - movs r5, 0x5 -_08078726: - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - beq _08078766 - cmp r0, r6 - bne _08078766 - adds r0, r4, 0 - movs r1, 0x3 - bl pokemon_getattr - cmp r0, 0x1 - beq _08078766 - adds r0, r4, 0 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - mov r0, sp - ldr r1, =gUnknown_0832DF94 - bl CompareStringWithoutExtendedControlCodes - cmp r0, 0 - bne _08078766 - adds r0, r4, 0 - movs r1, 0x2 - ldr r2, =gSpeciesNames + SPECIES_SHEDINJA * POKEMON_NAME_LENGTH - bl pokemon_setattr -_08078766: - adds r4, 0x64 - subs r5, 0x1 - cmp r5, 0 - bge _08078726 - movs r0, 0x1 - b _080787AC - .pool -_08078784: - ldr r2, =0x0203229c - ldr r1, [r2] - adds r1, 0xA8 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r2] - adds r1, r0, 0 - adds r1, 0xA8 - ldrb r0, [r1] - cmp r0, 0xA - bls _080787AA - movs r0, 0 - strb r0, [r1] - ldr r1, [r2] -_080787A2: - adds r1, 0x69 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080787AA: - movs r0, 0 -_080787AC: - add sp, 0xC - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end shedinja_maker_maybe - - thumb_func_start sub_80787B8 -sub_80787B8: @ 80787B8 - push {lr} - ldr r0, =gUnknown_0832DAE5 - ldr r1, =0x0203229c - ldr r1, [r1] - adds r1, 0x72 - ldrh r1, [r1] - lsls r1, 5 - ldr r2, =0x06010000 - adds r1, r2 - movs r2, 0x18 - bl sub_807A308 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80787B8 - - thumb_func_start sub_80787E0 -sub_80787E0: @ 80787E0 - push {r4,lr} - lsls r1, 24 - lsrs r4, r1, 24 - movs r2, 0x1 - adds r0, r4, 0 - ands r0, r2 - cmp r0, 0 - beq _08078864 - ldr r0, =0x020223c4 - ldrh r1, [r0] - ldr r0, =0x0000bbbb - cmp r1, r0 - beq _08078844 - cmp r1, r0 - bgt _08078814 - ldr r0, =0x0000aabb - cmp r1, r0 - beq _08078834 - b _0807885E - .pool -_08078814: - ldr r0, =0x0000bbcc - cmp r1, r0 - beq _08078854 - ldr r0, =0x0000eeaa - cmp r1, r0 - bne _0807885E - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x78 - b _0807885A - .pool -_08078834: - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x78 - strb r2, [r0] - b _0807885E - .pool -_08078844: - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x7A - strb r2, [r0] - b _0807885E - .pool -_08078854: - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x7A -_0807885A: - movs r1, 0x2 - strb r1, [r0] -_0807885E: - movs r0, 0 - bl sub_8077234 -_08078864: - movs r2, 0x2 - adds r0, r4, 0 - ands r0, r2 - cmp r0, 0 - beq _080788F6 - ldr r3, =0x020223c4 - movs r1, 0x80 - lsls r1, 1 - adds r0, r3, r1 - ldrh r1, [r0] - ldr r0, =0x0000bbbb - cmp r1, r0 - beq _080788D8 - cmp r1, r0 - bgt _0807889C - ldr r0, =0x0000aabb - cmp r1, r0 - beq _080788BC - b _080788F0 - .pool -_0807889C: - ldr r0, =0x0000bbcc - cmp r1, r0 - beq _080788E8 - ldr r0, =0x0000eeaa - cmp r1, r0 - bne _080788F0 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x79 - b _080788EE - .pool -_080788BC: - ldr r2, =0x0203229c - ldr r1, [r2] - movs r4, 0x81 - lsls r4, 1 - adds r0, r3, r4 - ldrb r0, [r0] - adds r0, 0x6 - adds r1, 0x7E - strb r0, [r1] - ldr r0, [r2] - adds r0, 0x79 - b _080788DE - .pool -_080788D8: - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x7B -_080788DE: - movs r1, 0x1 - strb r1, [r0] - b _080788F0 - .pool -_080788E8: - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x7B -_080788EE: - strb r2, [r0] -_080788F0: - movs r0, 0x1 - bl sub_8077234 -_080788F6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80787E0 - - thumb_func_start sub_8078900 -sub_8078900: @ 8078900 - push {r4,r5,lr} - sub sp, 0x4 - lsls r1, 24 - lsrs r5, r1, 24 - movs r0, 0x1 - ands r0, r5 - cmp r0, 0 - beq _080789E2 - ldr r2, =0x020223c4 - ldrh r1, [r2] - ldr r0, =0x0000ddee - cmp r1, r0 - beq _080789CC - cmp r1, r0 - bgt _0807893C - ldr r0, =0x0000ccdd - cmp r1, r0 - beq _080789AC - ldr r0, =0x0000dddd - cmp r1, r0 - beq _08078978 - b _080789DC - .pool -_0807893C: - ldr r0, =0x0000eebb - cmp r1, r0 - beq _08078950 - adds r0, 0x11 - cmp r1, r0 - beq _08078974 - b _080789DC - .pool -_08078950: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - movs r0, 0x4 - bl sub_807A19C - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x6F - movs r1, 0xB - b _080789DA - .pool -_08078974: - movs r0, 0x5 - b _080789CE -_08078978: - ldr r4, =0x0203229c - ldr r1, [r4] - ldrb r0, [r2, 0x2] - adds r0, 0x6 - adds r1, 0x7E - strb r0, [r1] - movs r0, 0 - bl rbox_fill_rectangle - ldr r0, [r4] - adds r0, 0x35 - ldrb r0, [r0] - bl sub_807967C - ldr r0, [r4] - adds r0, 0x7E - ldrb r0, [r0] - bl sub_807967C - ldr r0, [r4] - adds r0, 0x6F - movs r1, 0x7 - b _080789DA - .pool -_080789AC: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x6F - movs r1, 0xA - b _080789DA - .pool -_080789CC: - movs r0, 0x1 -_080789CE: - bl sub_807A19C - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x6F - movs r1, 0x8 -_080789DA: - strb r1, [r0] -_080789DC: - movs r0, 0 - bl sub_8077234 -_080789E2: - movs r0, 0x2 - ands r0, r5 - cmp r0, 0 - beq _080789F0 - movs r0, 0x1 - bl sub_8077234 -_080789F0: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8078900 - - thumb_func_start sub_80789FC -sub_80789FC: @ 80789FC - push {r4-r6,lr} - sub sp, 0x4 - ldr r6, =0x0203229c - ldr r2, [r6] - adds r1, r2, 0 - adds r1, 0x78 - ldrb r0, [r1] - cmp r0, 0 - bne _08078A10 - b _08078B44 -_08078A10: - adds r0, r2, 0 - adds r0, 0x79 - ldrb r0, [r0] - cmp r0, 0 - bne _08078A1C - b _08078B44 -_08078A1C: - ldrh r1, [r1] - ldr r0, =0x00000101 - cmp r1, r0 - bne _08078A64 - adds r1, r2, 0 - adds r1, 0x6F - movs r0, 0x6 - strb r0, [r1] - ldr r2, [r6] - adds r1, r2, 0 - adds r1, 0x80 - movs r4, 0 - ldr r0, =0x0000dddd - strh r0, [r1] - adds r0, r2, 0 - adds r0, 0x35 - ldrb r1, [r0] - adds r0, 0x4D - strh r1, [r0] - movs r0, 0x5 - movs r1, 0 - bl sub_807A048 - ldr r0, [r6] - adds r2, r0, 0 - adds r2, 0x79 - strb r4, [r2] - adds r0, 0x78 - strb r4, [r0] - b _08078B44 - .pool -_08078A64: - ldr r0, =0x00000201 - cmp r1, r0 - bne _08078AB4 - movs r0, 0x1 - bl sub_807A19C - ldr r1, [r6] - adds r2, r1, 0 - adds r2, 0x80 - movs r4, 0 - movs r3, 0 - ldr r0, =0x0000eecc - strh r0, [r2] - adds r1, 0x82 - strh r3, [r1] - movs r0, 0x5 - movs r1, 0 - bl sub_807A048 - ldr r0, [r6] - adds r1, r0, 0 - adds r1, 0x7B - strb r4, [r1] - adds r0, 0x7A - strb r4, [r0] - ldr r0, [r6] - adds r1, r0, 0 - adds r1, 0x79 - strb r4, [r1] - adds r0, 0x78 - strb r4, [r0] - ldr r0, [r6] - adds r0, 0x6F - movs r1, 0x8 - b _08078B42 - .pool -_08078AB4: - movs r0, 0x81 - lsls r0, 1 - cmp r1, r0 - bne _08078B00 - movs r0, 0x5 - bl sub_807A19C - ldr r1, [r6] - adds r2, r1, 0 - adds r2, 0x80 - movs r4, 0 - movs r3, 0 - ldr r0, =0x0000ddee - strh r0, [r2] - adds r1, 0x82 - strh r3, [r1] - movs r0, 0x5 - movs r1, 0 - bl sub_807A048 - ldr r0, [r6] - adds r1, r0, 0 - adds r1, 0x7B - strb r4, [r1] - adds r0, 0x7A - strb r4, [r0] - ldr r0, [r6] - adds r1, r0, 0 - adds r1, 0x79 - strb r4, [r1] - adds r0, 0x78 - strb r4, [r0] - ldr r0, [r6] - adds r0, 0x6F - movs r1, 0x8 - b _08078B42 - .pool -_08078B00: - ldr r0, =0x00000202 - cmp r1, r0 - bne _08078B44 - adds r1, r2, 0 - adds r1, 0x80 - movs r5, 0 - movs r4, 0 - ldr r0, =0x0000eebb - strh r0, [r1] - adds r0, r2, 0 - adds r0, 0x82 - strh r4, [r0] - movs r0, 0x5 - movs r1, 0 - bl sub_807A048 - movs r0, 0x1 - negs r0, r0 - str r4, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, [r6] - adds r1, r0, 0 - adds r1, 0x79 - strb r5, [r1] - adds r0, 0x78 - strb r5, [r0] - ldr r0, [r6] - adds r0, 0x6F - movs r1, 0xB -_08078B42: - strb r1, [r0] -_08078B44: - ldr r5, =0x0203229c - ldr r3, [r5] - adds r1, r3, 0 - adds r1, 0x7A - ldrb r0, [r1] - cmp r0, 0 - beq _08078BDC - adds r0, r3, 0 - adds r0, 0x7B - ldrb r0, [r0] - cmp r0, 0 - beq _08078BDC - ldrh r1, [r1] - ldr r0, =0x00000101 - cmp r1, r0 - bne _08078B92 - adds r1, r3, 0 - adds r1, 0x80 - movs r4, 0 - movs r2, 0 - ldr r0, =0x0000ccdd - strh r0, [r1] - adds r0, r3, 0 - adds r0, 0x82 - strh r2, [r0] - movs r0, 0x5 - movs r1, 0 - bl sub_807A048 - ldr r0, [r5] - adds r0, 0x7A - strb r4, [r0] - ldr r0, [r5] - adds r0, 0x7B - strb r4, [r0] - ldr r0, [r5] - adds r0, 0x6F - movs r1, 0x9 - strb r1, [r0] -_08078B92: - ldr r1, [r5] - adds r0, r1, 0 - adds r0, 0x7A - ldrb r0, [r0] - cmp r0, 0x2 - beq _08078BA8 - adds r0, r1, 0 - adds r0, 0x7B - ldrb r0, [r0] - cmp r0, 0x2 - bne _08078BDC -_08078BA8: - movs r0, 0x1 - bl sub_807A19C - ldr r1, [r5] - adds r2, r1, 0 - adds r2, 0x80 - movs r4, 0 - movs r3, 0 - ldr r0, =0x0000ddee - strh r0, [r2] - adds r1, 0x82 - strh r3, [r1] - movs r0, 0x5 - movs r1, 0 - bl sub_807A048 - ldr r0, [r5] - adds r0, 0x7A - strb r4, [r0] - ldr r0, [r5] - adds r0, 0x7B - strb r4, [r0] - ldr r0, [r5] - adds r0, 0x6F - movs r1, 0x8 - strb r1, [r0] -_08078BDC: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80789FC - - thumb_func_start sub_8078BFC -sub_8078BFC: @ 8078BFC - push {lr} - strh r1, [r0] - strh r2, [r0, 0x2] - movs r0, 0x5 - movs r1, 0 - bl sub_807A048 - pop {r0} - bx r0 - thumb_func_end sub_8078BFC - - thumb_func_start sub_8078C10 -sub_8078C10: @ 8078C10 - push {lr} - adds r3, r0, 0 - adds r2, r1, 0 - lsls r3, 16 - lsrs r3, 16 - lsls r2, 16 - lsrs r2, 16 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x80 - adds r1, r3, 0 - bl sub_8078BFC - pop {r0} - bx r0 - .pool - thumb_func_end sub_8078C10 - - thumb_func_start sub_8078C34 -sub_8078C34: @ 8078C34 - push {r4,lr} - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8077200 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _08078C5C - cmp r4, 0 - bne _08078C56 - movs r0, 0 - bl sub_80787E0 - b _08078C5C -_08078C56: - adds r0, r4, 0 - bl sub_8078900 -_08078C5C: - cmp r4, 0 - bne _08078C64 - bl sub_80789FC -_08078C64: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8078C34 - - thumb_func_start sub_8078C6C -sub_8078C6C: @ 8078C6C - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - movs r6, 0 - movs r5, 0 - ldr r2, =0x0203229c - ldr r3, [r2] - ldr r4, =gUnknown_0832DCEC - lsls r2, r1, 1 - adds r2, r1 - lsls r2, 1 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 3 - adds r3, 0x38 - adds r2, r1 - adds r2, r4 -_08078C92: - ldrb r1, [r2] - adds r0, r3, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _08078CA8 - adds r6, r1, 0 - b _08078CB0 - .pool -_08078CA8: - adds r2, 0x1 - adds r5, 0x1 - cmp r5, 0x5 - ble _08078C92 -_08078CB0: - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8078C6C - - thumb_func_start sub_8078CB8 -sub_8078CB8: @ 8078CB8 - push {r4-r7,lr} - adds r7, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldrb r0, [r7] - bl sub_8078C6C - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0xC - bne _08078D10 - ldr r5, =0x0203229c - ldr r0, [r5] - adds r0, 0x34 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - movs r1, 0x1 - bl StartObjectImageAnim - ldr r2, [r5] - adds r2, 0x34 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xE0 - strh r1, [r0, 0x20] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xA0 - strh r1, [r0, 0x22] - b _08078D58 - .pool -_08078D10: - ldr r4, =0x0203229c - ldr r0, [r4] - adds r0, 0x34 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =0x02020630 - adds r0, r5 - movs r1, 0 - bl StartObjectImageAnim - ldr r4, [r4] - adds r4, 0x34 - ldrb r0, [r4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - ldr r2, =gUnknown_0832DE24 - lsls r3, r6, 1 - adds r0, r3, r2 - ldrb r0, [r0] - lsls r0, 3 - adds r0, 0x20 - strh r0, [r1, 0x20] - ldrb r0, [r4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - adds r2, 0x1 - adds r3, r2 - ldrb r0, [r3] - lsls r0, 3 - strh r0, [r1, 0x22] -_08078D58: - ldrb r0, [r7] - cmp r0, r6 - beq _08078D64 - movs r0, 0x5 - bl audio_play -_08078D64: - strb r6, [r7] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8078CB8 - - thumb_func_start sub_8078D78 -sub_8078D78: @ 8078D78 - push {r4,lr} - movs r0, 0 - bl sub_807A19C - ldr r4, =0x0203229c - ldr r0, [r4] - adds r0, 0x6F - movs r1, 0x64 - strb r1, [r0] - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08078DAC - ldr r0, =0x0000aabb - ldr r1, [r4] - adds r1, 0x35 - ldrb r1, [r1] - bl sub_8078C10 - b _08078DB4 - .pool -_08078DAC: - ldr r0, [r4] - adds r0, 0x78 - movs r1, 0x1 - strb r1, [r0] -_08078DB4: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8078D78 - - thumb_func_start sub_8078DBC -sub_8078DBC: @ 8078DBC - push {r4,lr} - sub sp, 0x4 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08078DE4 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x35 - movs r1, 0 - bl sub_8078CB8 - b _08078E30 - .pool -_08078DE4: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08078E00 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x35 - movs r1, 0x1 - bl sub_8078CB8 - b _08078E30 - .pool -_08078E00: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08078E1C - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x35 - movs r1, 0x2 - bl sub_8078CB8 - b _08078E30 - .pool -_08078E1C: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08078E30 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x35 - movs r1, 0x3 - bl sub_8078CB8 -_08078E30: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08078EE4 - movs r0, 0x5 - bl audio_play - ldr r4, =0x0203229c - ldr r0, [r4] - adds r0, 0x35 - ldrb r0, [r0] - cmp r0, 0x5 - bhi _08078E98 - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0xE - bl sub_8098858 - movs r0, 0x1 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r2, =gUnknown_0832DEAC - movs r0, 0x1 - movs r1, 0x2 - bl PrintMenuTable - movs r0, 0x1 - movs r1, 0x2 - movs r2, 0 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0x1 - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, [r4] - adds r0, 0x6F - movs r1, 0x1 - strb r1, [r0] - b _08078EE4 - .pool -_08078E98: - cmp r0, 0xB - bhi _08078EB6 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, [r4] - adds r0, 0x6F - movs r1, 0x2 - strb r1, [r0] - b _08078EE4 -_08078EB6: - cmp r0, 0xC - bne _08078EE4 - ldr r0, =gUnknown_0832DF8C - movs r1, 0x1 - movs r2, 0xE - movs r3, 0 - bl CreateYesNoMenu - ldr r0, [r4] - adds r0, 0x6F - movs r1, 0x4 - strb r1, [r0] - ldr r0, =gUnknown_0832DE94 - ldr r0, [r0, 0x10] - ldr r1, [r4] - adds r1, 0x72 - ldrh r1, [r1] - lsls r1, 5 - ldr r2, =0x06010000 - adds r1, r2 - movs r2, 0x18 - bl sub_807A308 -_08078EE4: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8078DBC - - thumb_func_start sub_8078EF8 -sub_8078EF8: @ 8078EF8 - push {lr} - bl sub_8079F74 - ldr r3, =0x0203229c - ldr r0, [r3] - adds r0, 0x6F - movs r1, 0 - strb r1, [r0] - ldr r2, =0x02020630 - ldr r0, [r3] - adds r0, 0x34 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - ldr r0, =gUnknown_0832DE94 - ldr r0, [r0, 0x4] - ldr r1, [r3] - adds r1, 0x72 - ldrh r1, [r1] - lsls r1, 5 - ldr r2, =0x06010000 - adds r1, r2 - movs r2, 0x18 - bl sub_807A308 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8078EF8 - - thumb_func_start sub_8078F50 -sub_8078F50: @ 8078F50 - push {lr} - sub sp, 0x4 - bl ProcessMenuInputNoWrapAround - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _08078F72 - cmp r0, r1 - ble _0807902A - cmp r0, 0 - beq _08078F7E - cmp r0, 0x1 - beq _08078F9C - b _0807902A -_08078F72: - movs r0, 0x5 - bl audio_play - bl sub_8078EF8 - b _0807902A -_08078F7E: - str r0, [sp] - adds r0, r1, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x6F - movs r1, 0x2 - b _08079028 - .pool -_08078F9C: - ldr r0, =0x020244ec - ldr r1, =0x020244e9 - ldrb r1, [r1] - ldr r2, =0x0203229c - ldr r2, [r2] - adds r2, 0x35 - ldrb r2, [r2] - bl sub_807A5F4 - cmp r0, 0x5 - bhi _0807902A - lsls r0, 2 - ldr r1, =_08078FCC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08078FCC: - .4byte _08078FE4 - .4byte _0807900C - .4byte _08079012 - .4byte _08079018 - .4byte _08079012 - .4byte _08079018 -_08078FE4: - bl sub_8078D78 - ldr r2, =0x02020630 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x34 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - b _08079028 - .pool -_0807900C: - movs r0, 0x3 - movs r1, 0x3 - b _0807901C -_08079012: - movs r0, 0x3 - movs r1, 0x6 - b _0807901C -_08079018: - movs r0, 0x3 - movs r1, 0x7 -_0807901C: - bl sub_807A048 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x6F - movs r1, 0x8 -_08079028: - strb r1, [r0] -_0807902A: - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8078F50 - - thumb_func_start sub_8079034 -sub_8079034: @ 8079034 - push {lr} - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0807904A - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08079054 -_0807904A: - movs r0, 0x5 - bl audio_play - bl sub_8078EF8 -_08079054: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8079034 - - thumb_func_start sub_807905C -sub_807905C: @ 807905C - push {lr} - sub sp, 0x4 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080790C4 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r3, r0, 0 - adds r3, 0x35 - ldrb r2, [r3] - cmp r2, 0x5 - bhi _080790A4 - ldr r1, =0x020244ec - ldrb r2, [r3] - adds r0, 0x36 - ldrb r3, [r0] - subs r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =sub_8077B74 - str r0, [sp] - movs r0, 0x1 - bl sub_81BF8EC - b _080790C0 - .pool -_080790A4: - ldr r1, =0x02024744 - subs r2, 0x6 - lsls r2, 24 - lsrs r2, 24 - adds r0, 0x37 - ldrb r3, [r0] - subs r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =sub_8077B74 - str r0, [sp] - movs r0, 0x1 - bl sub_81BF8EC -_080790C0: - bl FreeAllWindowBuffers -_080790C4: - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_807905C - - thumb_func_start sub_80790D4 -sub_80790D4: @ 80790D4 - push {r4-r7,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r6, r3, 24 - movs r5, 0 - movs r3, 0 - ldr r7, =0x02024744 - cmp r5, r1 - bge _08079102 -_080790EE: - cmp r2, r3 - beq _080790FC - adds r0, r4, r3 - ldrb r0, [r0] - adds r0, r5, r0 - lsls r0, 24 - lsrs r5, r0, 24 -_080790FC: - adds r3, 0x1 - cmp r3, r1 - blt _080790EE -_08079102: - adds r0, r6, 0 - movs r1, 0x6 - bl __umodsi3 - lsls r0, 24 - lsrs r6, r0, 24 - movs r0, 0x64 - muls r0, r6 - adds r7, r0, r7 - adds r0, r7, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0xCD - lsls r0, 1 - cmp r4, r0 - beq _0807912C - cmp r4, 0x97 - bne _08079138 -_0807912C: - adds r0, r7, 0 - movs r1, 0x50 - bl pokemon_getattr - cmp r0, 0 - beq _08079158 -_08079138: - bl sub_809D42C - cmp r0, 0 - bne _08079164 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x57 - adds r0, r6 - ldrb r0, [r0] - cmp r0, 0 - bne _08079158 - adds r0, r4, 0 - bl sub_806E3F8 - cmp r0, 0 - bne _08079164 -_08079158: - movs r0, 0x2 - b _0807916C - .pool -_08079164: - cmp r5, 0 - beq _0807916A - movs r5, 0x1 -_0807916A: - adds r0, r5, 0 -_0807916C: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80790D4 - - thumb_func_start sub_8079174 -sub_8079174: @ 8079174 - push {r4,r5,lr} - sub sp, 0xC - movs r2, 0 - ldr r0, =0x0203229c - ldr r1, [r0] - adds r3, r1, 0 - adds r3, 0x36 - adds r5, r0, 0 - ldrb r0, [r3] - cmp r2, r0 - bge _080791A0 - adds r4, r1, 0 - adds r4, 0x45 -_0807918E: - mov r1, sp - adds r0, r1, r2 - adds r1, r4, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - ldrb r0, [r3] - cmp r2, r0 - blt _0807918E -_080791A0: - ldr r0, [r5] - adds r1, r0, 0 - adds r1, 0x36 - ldrb r1, [r1] - adds r2, r0, 0 - adds r2, 0x35 - ldrb r2, [r2] - adds r0, 0x7E - ldrb r3, [r0] - mov r0, sp - bl sub_80790D4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080791E8 - cmp r0, 0x1 - bgt _080791D0 - cmp r0, 0 - beq _080791D6 - b _0807920C - .pool -_080791D0: - cmp r0, 0x2 - beq _08079200 - b _0807920C -_080791D6: - movs r0, 0x3 - movs r1, 0x3 - bl sub_807A048 - ldr r0, =0x0000bbcc - b _080791F2 - .pool -_080791E8: - movs r0, 0x3 - movs r1, 0x1 - bl sub_807A048 - ldr r0, =0x0000bbbb -_080791F2: - movs r1, 0 - bl sub_8078C10 - b _0807920C - .pool -_08079200: - movs r0, 0x3 - movs r1, 0x8 - bl sub_807A048 - movs r0, 0x1 - b _0807920E -_0807920C: - movs r0, 0 -_0807920E: - add sp, 0xC - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8079174 - - thumb_func_start sub_8079218 -sub_8079218: @ 8079218 - push {lr} - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _0807923A - cmp r1, 0 - bgt _08079234 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08079268 - b _08079290 -_08079234: - cmp r1, 0x1 - beq _08079268 - b _08079290 -_0807923A: - bl sub_8079174 - cmp r0, 0 - bne _08079250 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x6F - movs r1, 0x64 - b _08079258 - .pool -_08079250: - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x6F - movs r1, 0x11 -_08079258: - strb r1, [r0] - movs r0, 0x11 - bl PutWindowTilemap - b _08079290 - .pool -_08079268: - movs r0, 0x3 - movs r1, 0x1 - bl sub_807A048 - bl sub_80771BC - cmp r0, 0 - beq _08079280 - ldr r0, =0x0000bbcc - movs r1, 0 - bl sub_8078C10 -_08079280: - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x6F - movs r1, 0x64 - strb r1, [r0] - movs r0, 0x11 - bl PutWindowTilemap -_08079290: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8079218 - - thumb_func_start sub_807929C -sub_807929C: @ 807929C - push {r4-r6,lr} - movs r5, 0 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x37 - ldrb r0, [r0] - subs r0, 0x4 - cmp r5, r0 - bge _080792D8 - movs r6, 0xC0 - lsls r6, 20 -_080792B2: - lsrs r4, r6, 24 - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x1 - bl CopyWindowToVram - movs r0, 0x80 - lsls r0, 17 - adds r6, r0 - adds r5, 0x1 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x37 - ldrb r0, [r0] - subs r0, 0x4 - cmp r5, r0 - blt _080792B2 -_080792D8: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807929C - - thumb_func_start sub_80792E4 -sub_80792E4: @ 80792E4 - push {lr} - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _08079306 - cmp r1, 0 - bgt _08079300 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _0807934C - b _08079356 -_08079300: - cmp r1, 0x1 - beq _0807934C - b _08079356 -_08079306: - movs r0, 0x4 - bl sub_807A19C - ldr r0, =0x0000eeaa - movs r1, 0 - bl sub_8078C10 - ldr r2, =0x02020630 - ldr r3, =0x0203229c - ldr r0, [r3] - adds r0, 0x34 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r3] - adds r0, 0x6F - movs r1, 0x64 - strb r1, [r0] - bl sub_807929C - b _08079356 - .pool -_0807934C: - movs r0, 0x5 - bl audio_play - bl sub_8078EF8 -_08079356: - pop {r0} - bx r0 - thumb_func_end sub_80792E4 - - thumb_func_start sub_807935C -sub_807935C: @ 807935C - push {r4,lr} - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - bne _08079384 - movs r0, 0 - bl rbox_fill_rectangle - ldr r4, =0x0203229c - ldr r0, [r4] - adds r0, 0x35 - ldrb r0, [r0] - bl sub_807967C - ldr r0, [r4] - adds r0, 0x7E - ldrb r0, [r0] - bl sub_807967C -_08079384: - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x6F - movs r1, 0x7 - strb r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807935C - - thumb_func_start sub_8079398 -sub_8079398: @ 8079398 - push {r4,lr} - ldr r4, =0x0203229c - ldr r0, [r4] - adds r0, 0x74 - ldrh r1, [r0] - ldr r0, =0x00000505 - cmp r1, r0 - bne _080793B4 - bl sub_80787B8 - ldr r0, [r4] - adds r0, 0x6F - movs r1, 0xE - strb r1, [r0] -_080793B4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8079398 - - thumb_func_start sub_80793C4 -sub_80793C4: @ 80793C4 - push {r4,lr} - ldr r4, =0x0203229c - ldr r1, [r4] - adds r1, 0xA8 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r4] - adds r0, 0xA8 - ldrb r0, [r0] - cmp r0, 0x78 - bls _080793F8 - ldr r0, =gUnknown_0832DF8C - movs r1, 0x1 - movs r2, 0xE - movs r3, 0 - bl CreateYesNoMenu - ldr r0, [r4] - adds r0, 0xA8 - movs r1, 0 - strb r1, [r0] - ldr r0, [r4] - adds r0, 0x6F - movs r1, 0x3 - strb r1, [r0] -_080793F8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80793C4 - - thumb_func_start sub_8079408 -sub_8079408: @ 8079408 - push {r4-r6,lr} - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0807947C - movs r0, 0x5 - bl audio_play - movs r0, 0 - bl rbox_fill_rectangle - movs r0, 0x1 - bl rbox_fill_rectangle - movs r6, 0 - movs r5, 0xE0 - lsls r5, 20 -_0807942E: - lsrs r4, r5, 24 - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0 - bl rbox_fill_rectangle - movs r0, 0x80 - lsls r0, 17 - adds r5, r0 - adds r6, 0x1 - cmp r6, 0x3 - ble _0807942E - movs r0, 0 - bl sub_8079F88 - movs r0, 0x1 - bl sub_8079F88 - ldr r2, =0x0203229c - ldr r0, [r2] - adds r0, 0x6F - movs r1, 0 - strb r1, [r0] - ldr r3, =0x02020630 - ldr r0, [r2] - adds r0, 0x34 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] -_0807947C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8079408 - - thumb_func_start sub_8079490 -sub_8079490: @ 8079490 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080794C4 - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _080794B4 - bl sub_800ADF8 - b _080794BA - .pool -_080794B4: - movs r0, 0xC - bl sub_800ABF4 -_080794BA: - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x6F - movs r1, 0xC - strb r1, [r0] -_080794C4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8079490 - - thumb_func_start sub_80794CC -sub_80794CC: @ 80794CC - push {lr} - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08079518 - bl sub_80771BC - cmp r0, 0 - beq _0807953A - bl sub_807A09C - cmp r0, 0 - bne _0807953A - ldr r0, =0x02032184 - ldr r0, [r0] - bl Free - ldr r0, =0x0203229c - ldr r0, [r0] - bl Free - bl FreeAllWindowBuffers - bl sub_800E084 - ldr r0, =c2_8056854 - bl SetMainCallback2 - b _0807953A - .pool -_08079518: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _0807953A - ldr r0, =0x02032184 - ldr r0, [r0] - bl Free - ldr r0, =0x0203229c - ldr r0, [r0] - bl Free - bl FreeAllWindowBuffers - ldr r0, =c2_8056854 - bl SetMainCallback2 -_0807953A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80794CC - - thumb_func_start sub_8079550 -sub_8079550: @ 8079550 - push {lr} - movs r0, 0 - bl sub_801048C - lsls r0, 24 - cmp r0, 0 - bne _08079574 - bl sub_807A09C - cmp r0, 0 - bne _08079574 - bl sub_800ADF8 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x6F - movs r1, 0xD - strb r1, [r0] -_08079574: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8079550 - - thumb_func_start sub_807957C -sub_807957C: @ 807957C - push {lr} - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0807959C - ldr r0, =0x0000bbcc - movs r1, 0 - bl sub_8078C10 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x6F - movs r1, 0x64 - strb r1, [r0] -_0807959C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_807957C - - thumb_func_start sub_80795AC -sub_80795AC: @ 80795AC - push {lr} - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x6F - ldrb r0, [r0] - cmp r0, 0x11 - bhi _08079678 - lsls r0, 2 - ldr r1, =_080795CC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080795CC: - .4byte _08079614 - .4byte _0807961A - .4byte _08079620 - .4byte _08079626 - .4byte _0807962C - .4byte _08079678 - .4byte _08079632 - .4byte _08079638 - .4byte _0807963E - .4byte _08079644 - .4byte _0807964A - .4byte _08079650 - .4byte _08079656 - .4byte _0807965C - .4byte _08079662 - .4byte _08079668 - .4byte _0807966E - .4byte _08079674 -_08079614: - bl sub_8078DBC - b _08079678 -_0807961A: - bl sub_8078F50 - b _08079678 -_08079620: - bl sub_807905C - b _08079678 -_08079626: - bl sub_8079218 - b _08079678 -_0807962C: - bl sub_80792E4 - b _08079678 -_08079632: - bl sub_807935C - b _08079678 -_08079638: - bl sub_8079398 - b _08079678 -_0807963E: - bl sub_8079408 - b _08079678 -_08079644: - bl sub_8078130 - b _08079678 -_0807964A: - bl sub_807816C - b _08079678 -_08079650: - bl sub_8079490 - b _08079678 -_08079656: - bl sub_80794CC - b _08079678 -_0807965C: - bl sub_80781C8 - b _08079678 -_08079662: - bl sub_80793C4 - b _08079678 -_08079668: - bl sub_8079034 - b _08079678 -_0807966E: - bl sub_8079550 - b _08079678 -_08079674: - bl sub_807957C -_08079678: - pop {r0} - bx r0 - thumb_func_end sub_80795AC - - thumb_func_start sub_807967C -sub_807967C: @ 807967C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - movs r1, 0x6 - bl __udivsi3 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r3, =0x0203229c - ldr r0, [r3] - adds r0, 0x74 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0 - bne _080796A8 - movs r0, 0x1 - strb r0, [r1] - ldr r0, [r3] - adds r0, 0x76 - adds r0, r2 - strb r4, [r0] -_080796A8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807967C - - thumb_func_start sub_80796B4 -sub_80796B4: @ 80796B4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x68 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x0203229c - ldr r4, [r0] - adds r0, r4, 0 - adds r0, 0x76 - adds r0, r7 - ldrb r0, [r0] - movs r1, 0x1 - str r1, [sp, 0x60] - cmp r0, 0x5 - bhi _080796DC - movs r2, 0 - str r2, [sp, 0x60] -_080796DC: - movs r1, 0x6 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - movs r0, 0 - mov r8, r0 - adds r0, r4, 0 - adds r0, 0x74 - adds r3, r0, r7 - ldrb r0, [r3] - cmp r0, 0x2 - bne _080796FA - b _08079884 -_080796FA: - cmp r0, 0x2 - bgt _08079708 - cmp r0, 0x1 - beq _08079716 - b _08079A24 - .pool -_08079708: - cmp r0, 0x3 - bne _0807970E - b _080798BC -_0807970E: - cmp r0, 0x4 - bne _08079714 - b _080799EC -_08079714: - b _08079A24 -_08079716: - movs r5, 0 - adds r0, r4, 0 - adds r0, 0x36 - adds r0, r7 - ldr r1, [sp, 0x60] - lsls r1, 1 - mov r9, r1 - lsls r6, r7, 1 - lsls r2, r7, 4 - str r2, [sp, 0x64] - ldrb r0, [r0] - cmp r8, r0 - bcs _0807976A - ldr r0, =0x02020630 - mov r8, r0 - ldr r4, =0x0203229c - ldr r0, [sp, 0x60] - add r0, r9 - lsls r2, r0, 1 - movs r3, 0x4 -_0807973E: - ldr r0, [r4] - adds r1, r5, r2 - adds r0, 0x28 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r3 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, [r4] - adds r0, 0x36 - adds r0, r7 - ldrb r0, [r0] - cmp r5, r0 - bcc _0807973E -_0807976A: - movs r5, 0 - adds r0, r6, r7 - lsls r0, 1 - adds r4, r0, 0x2 -_08079772: - lsls r0, r5, 24 - asrs r0, 24 - adds r0, r4 - lsls r0, 24 - lsrs r0, 24 - bl ClearWindowTilemap - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _08079772 - ldr r1, =0x02020630 - mov r8, r1 - ldr r2, =0x0203229c - ldr r0, [r2] - ldr r6, [sp, 0x60] - add r6, r9 - lsls r3, r6, 1 - add r10, r3 - adds r0, 0x28 - add r0, r10 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - ldr r0, =0x0203229c - ldr r4, [r0] - adds r4, 0x28 - add r4, r10 - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - movs r1, 0x14 - strh r1, [r0, 0x2E] - ldrb r0, [r4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - add r2, r8 - ldr r5, =gUnknown_0832DE24 - lsls r6, 2 - adds r0, r6, r5 - ldrb r0, [r0] - adds r3, 0x1 - lsls r3, 1 - adds r3, r5 - ldrb r1, [r3] - adds r0, r1 - asrs r0, 1 - lsls r0, 3 - adds r0, 0xE - strh r0, [r2, 0x32] - ldrb r0, [r4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r8 - adds r5, 0x1 - adds r6, r5 - ldrb r0, [r6] - lsls r0, 3 - subs r0, 0xC - strh r0, [r1, 0x36] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - ldr r1, =sub_80D3014 - bl oamt_set_x3A_32 - ldr r2, =0x0203229c - ldr r1, [r2] - adds r1, 0x74 - adds r1, r7 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r2] - adds r0, 0x28 - add r0, r10 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - bl sub_80A6DEC - ldr r1, =gUnknown_0832C8BE - ldr r0, [sp, 0x64] - subs r2, r0, r7 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0xF - str r0, [sp] - movs r0, 0x11 - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r3, 0 - bl CopyToBgTilemapBufferRect_ChangePalette - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r1, [sp, 0x60] - cmp r1, 0 - beq _08079868 - b _08079A24 -_08079868: - bl sub_8079F74 - b _08079A24 - .pool -_08079884: - ldr r2, =0x02020630 - ldr r1, [sp, 0x60] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 1 - add r0, r10 - adds r1, r4, 0 - adds r1, 0x28 - adds r1, r0 - ldrb r1, [r1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =sub_80D3014 - cmp r1, r0 - beq _080798AC - b _08079A24 -_080798AC: - movs r0, 0x3 - strb r0, [r3] - b _08079A24 - .pool -_080798BC: - ldr r1, =gUnknown_0832C6C0 - ldr r0, [sp, 0x60] - lsls r2, r0, 4 - subs r2, r0 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0xF - str r0, [sp] - movs r0, 0x11 - str r0, [sp, 0x4] - mov r0, r8 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r3, 0 - bl CopyToBgTilemapBufferRect_ChangePalette - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - ldr r6, =0x02020630 - ldr r1, =0x0203229c - ldr r4, [r1] - ldr r2, [sp, 0x60] - lsls r3, r2, 1 - adds r3, r2 - lsls r1, r3, 1 - mov r2, r10 - adds r0, r2, r1 - adds r4, 0x28 - adds r4, r0 - ldrb r0, [r4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r6 - ldr r5, =gUnknown_0832DE24 - lsls r3, 2 - adds r0, r3, r5 - ldrb r0, [r0] - adds r1, 0x1 - lsls r1, 1 - adds r1, r5 - ldrb r1, [r1] - adds r0, r1 - asrs r0, 1 - lsls r0, 3 - adds r0, 0xE - strh r0, [r2, 0x20] - ldrb r0, [r4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - adds r5, 0x1 - adds r3, r5 - ldrb r0, [r3] - lsls r0, 3 - subs r0, 0xC - strh r0, [r1, 0x22] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - mov r1, r8 - strh r1, [r0, 0x24] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - mov r2, r8 - strh r2, [r0, 0x26] - add r0, sp, 0x14 - ldr r1, [sp, 0x60] - mov r2, r10 - bl sub_8079A3C - lsls r4, r7, 1 - adds r5, r4, 0 - adds r5, 0xE - lsls r5, 24 - lsrs r5, 24 - lsls r0, 24 - asrs r0, 24 - movs r2, 0x50 - subs r2, r0 - lsrs r0, r2, 31 - adds r2, r0 - asrs r2, 1 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_0832DEE0 - mov r8, r0 - str r0, [sp] - movs r1, 0 - str r1, [sp, 0x4] - add r0, sp, 0x14 - str r0, [sp, 0x8] - adds r0, r5, 0 - movs r3, 0x4 - bl box_print - add r6, sp, 0x28 - adds r0, r6, 0 - ldr r1, [sp, 0x60] - mov r2, r10 - bl sub_8079AA4 - adds r4, 0xF - lsls r4, 24 - lsrs r4, 24 - movs r1, 0 - str r1, [sp] - str r1, [sp, 0x4] - mov r2, r8 - str r2, [sp, 0x8] - str r1, [sp, 0xC] - str r6, [sp, 0x10] - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - movs r3, 0 - bl AddTextPrinterParametrized2 - adds r0, r5, 0 - bl PutWindowTilemap - adds r0, r5, 0 - movs r1, 0x3 - bl CopyWindowToVram - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =0x0203229c - ldr r1, [r0] - b _08079A1A - .pool -_080799EC: - ldr r0, =gUnknown_0832DF99 - lsls r1, r7, 1 - adds r4, r1, r0 - ldrb r2, [r4] - adds r2, 0x4 - lsls r2, 24 - lsrs r2, 24 - adds r0, 0x1 - adds r1, r0 - ldrb r3, [r1] - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - ldrb r0, [r4] - str r0, [sp] - ldrb r0, [r1] - str r0, [sp, 0x4] - adds r0, r7, 0 - mov r1, r10 - bl sub_8079C4C - ldr r2, =0x0203229c - ldr r1, [r2] -_08079A1A: - adds r1, 0x74 - adds r1, r7 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_08079A24: - add sp, 0x68 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80796B4 - - thumb_func_start sub_8079A3C -sub_8079A3C: @ 8079A3C - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - lsls r1, 24 - lsls r2, 24 - lsrs r2, 24 - cmp r1, 0 - bne _08079A64 - movs r0, 0x64 - muls r0, r2 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - b _08079A74 - .pool -_08079A64: - movs r0, 0x64 - muls r0, r2 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr -_08079A74: - adds r0, r4, 0 - mov r1, sp - bl CopyString_Limit10 - movs r0, 0 - movs r1, 0x2 - bl GetFontAttribute - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0 - adds r1, r4, 0 - bl GetStringWidth - lsls r0, 24 - lsrs r0, 24 - add sp, 0xC - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8079A3C - - thumb_func_start sub_8079AA4 -sub_8079AA4: @ 8079AA4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - adds r6, r0, 0 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =0x0203229c - ldr r1, [r0] - lsls r0, r7, 1 - adds r0, r7 - lsls r0, 1 - adds r0, r2, r0 - adds r1, 0x51 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0 - bne _08079B5C - movs r4, 0 - movs r0, 0x64 - adds r5, r2, 0 - muls r5, r0 - ldr r0, =0x020244ec - mov r9, r0 - ldr r2, =0x02024744 - mov r8, r2 -_08079ADE: - cmp r7, 0 - bne _08079AF8 - adds r1, r4, 0 - adds r1, 0xD - mov r2, r9 - b _08079AFE - .pool -_08079AF8: - adds r1, r4, 0 - adds r1, 0xD - mov r2, r8 -_08079AFE: - adds r0, r5, r2 - movs r2, 0 - bl pokemon_getattr - lsls r1, r4, 1 - add r1, sp - strh r0, [r1] - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x3 - bls _08079ADE - ldr r1, =gUnknown_0832DABC - adds r0, r6, 0 - bl CopyString - movs r4, 0 -_08079B20: - lsls r0, r4, 1 - mov r2, sp - adds r1, r2, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _08079B3C - adds r1, r0, 0 - movs r0, 0xD - muls r1, r0 - ldr r0, =gMoveNames - adds r1, r0 - adds r0, r6, 0 - bl AppendString -_08079B3C: - adds r0, r6, 0 - ldr r1, =gUnknown_0832DAD2 - bl AppendString - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x3 - bls _08079B20 - b _08079B6C - .pool -_08079B5C: - ldr r1, =gUnknown_0832DABC - adds r0, r6, 0 - bl CopyString - ldr r1, =gUnknown_0832DADF - adds r0, r6, 0 - bl AppendString -_08079B6C: - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8079AA4 - - thumb_func_start sub_8079B84 -sub_8079B84: @ 8079B84 - push {r4,r5,lr} - sub sp, 0xC - adds r4, r1, 0 - adds r5, r2, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 1 - adds r1, 0x2 - lsls r4, 24 - asrs r4, 24 - adds r4, r1 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - adds r1, r5, 0 - movs r2, 0x40 - bl GetStringCenterAlignXOffset - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_0832DEE0 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r5, [sp, 0x8] - adds r0, r4, 0 - movs r1, 0 - movs r3, 0x4 - bl box_print - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8079B84 - - thumb_func_start sub_8079BE0 -sub_8079BE0: @ 8079BE0 - push {r4-r7,lr} - sub sp, 0x34 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r7, =0x02024744 - cmp r6, 0 - bne _08079BF0 - ldr r7, =0x020244ec -_08079BF0: - movs r4, 0 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x36 - adds r0, r6 - ldrb r0, [r0] - cmp r4, r0 - bcs _08079C36 - add r5, sp, 0x14 -_08079C02: - movs r0, 0x64 - muls r0, r4 - adds r0, r7, r0 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - adds r0, r5, 0 - mov r1, sp - bl CopyString_Limit10 - adds r0, r6, 0 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_8079B84 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x36 - adds r0, r6 - ldrb r0, [r0] - cmp r4, r0 - bcc _08079C02 -_08079C36: - add sp, 0x34 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8079BE0 - - thumb_func_start sub_8079C4C -sub_8079C4C: @ 8079C4C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - ldr r4, [sp, 0x3C] - ldr r5, [sp, 0x40] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - lsls r3, 24 - lsrs r3, 24 - mov r10, r3 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r1, =gUnknown_08DDD704 - movs r0, 0x6 - str r0, [sp] - movs r0, 0x3 - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - movs r0, 0x1 - adds r2, r4, 0 - adds r3, r5, 0 - bl CopyToBgTilemapBufferRect_ChangePalette - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - mov r0, r8 - cmp r0, 0 - bne _08079CB0 - movs r0, 0x64 - muls r0, r7 - ldr r1, =0x020244ec - b _08079CB6 - .pool -_08079CB0: - movs r0, 0x64 - muls r0, r7 - ldr r1, =0x02024744 -_08079CB6: - adds r0, r1 - movs r1, 0x38 - movs r2, 0 - bl pokemon_getattr - lsls r0, 24 - lsrs r6, r0, 24 - ldr r4, =0x0203229c - ldr r5, [r4] - mov r1, r8 - lsls r2, r1, 1 - adds r1, r2, r1 - lsls r1, 1 - adds r1, r7, r1 - adds r0, r5, 0 - adds r0, 0x51 - adds r0, r1 - ldrb r0, [r0] - str r2, [sp, 0x18] - cmp r0, 0 - bne _08079D34 - adds r0, r6, 0 - movs r1, 0xA - bl __udivsi3 - lsls r0, 24 - lsrs r2, r0, 24 - mov r0, r10 - lsls r3, r0, 5 - cmp r2, 0 - beq _08079D08 - mov r1, r9 - adds r0, r1, r3 - lsls r0, 1 - movs r1, 0x8F - lsls r1, 4 - adds r5, r1 - adds r1, r5, r0 - adds r0, r2, 0 - adds r0, 0x60 - strh r0, [r1] -_08079D08: - ldr r4, [r4] - mov r1, r9 - adds r0, r1, r3 - adds r0, 0x1 - lsls r0, 1 - movs r3, 0x8F - lsls r3, 4 - adds r4, r3 - adds r4, r0 - adds r0, r6, 0 - movs r1, 0xA - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x70 - strh r0, [r4] - b _08079D72 - .pool -_08079D34: - mov r1, r10 - lsls r0, r1, 5 - mov r1, r9 - adds r3, r1, r0 - adds r1, r3, 0 - subs r1, 0x20 - lsls r1, 1 - movs r0, 0x8F - lsls r0, 4 - adds r2, r5, r0 - adds r1, r2, r1 - adds r0, r3, 0 - subs r0, 0x21 - lsls r0, 1 - adds r0, r2, r0 - ldrh r0, [r0] - strh r0, [r1] - adds r1, r3, 0 - subs r1, 0x1F - lsls r1, 1 - adds r1, r2, r1 - adds r0, r3, 0 - subs r0, 0x24 - lsls r0, 1 - adds r2, r0 - ldrh r2, [r2] - movs r3, 0x80 - lsls r3, 3 - adds r0, r3, 0 - orrs r0, r2 - strh r0, [r1] -_08079D72: - ldr r0, =0x0203229c - ldr r1, [r0] - ldr r0, [sp, 0x18] - add r0, r8 - lsls r0, 1 - adds r0, r7, r0 - adds r1, 0x51 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0 - beq _08079D94 - movs r2, 0x90 - lsls r2, 3 - b _08079E16 - .pool -_08079D94: - mov r0, r8 - cmp r0, 0 - bne _08079DC0 - movs r0, 0x64 - adds r4, r7, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - bl pokemon_get_gender - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r4, 0 - movs r1, 0x2 - add r2, sp, 0xC - bl pokemon_getattr - b _08079DDE - .pool -_08079DC0: - movs r0, 0x64 - adds r4, r7, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - bl pokemon_get_gender - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r4, 0 - movs r1, 0x2 - add r2, sp, 0xC - bl pokemon_getattr -_08079DDE: - cmp r5, 0 - beq _08079DF0 - cmp r5, 0xFE - beq _08079E04 - movs r2, 0x83 - b _08079E16 - .pool -_08079DF0: - add r0, sp, 0xC - movs r1, 0 - bl sub_8070ECC - lsls r0, 24 - movs r2, 0x83 - cmp r0, 0 - bne _08079E16 - movs r2, 0x84 - b _08079E16 -_08079E04: - add r0, sp, 0xC - movs r1, 0xFE - bl sub_8070ECC - lsls r0, 24 - movs r2, 0x83 - cmp r0, 0 - bne _08079E16 - movs r2, 0x85 -_08079E16: - ldr r0, =0x0203229c - ldr r1, [r0] - mov r0, r10 - subs r0, 0x1 - lsls r0, 5 - add r0, r9 - adds r0, 0x1 - lsls r0, 1 - movs r3, 0x8F - lsls r3, 4 - adds r1, r3 - adds r1, r0 - strh r2, [r1] - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8079C4C - - thumb_func_start sub_8079E44 -sub_8079E44: @ 8079E44 - push {r4-r7,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r6, r0, 24 - movs r7, 0 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x36 - adds r0, r6 - ldrb r0, [r0] - cmp r7, r0 - bge _08079E94 - lsls r0, r6, 1 - adds r0, r6 - ldr r1, =gUnknown_0832DE3E - lsls r0, 2 - adds r5, r0, r1 - ldr r1, =gUnknown_0832DE56 - adds r4, r0, r1 -_08079E6A: - lsls r1, r7, 24 - lsrs r1, 24 - ldrb r2, [r5] - ldrb r3, [r5, 0x1] - ldrb r0, [r4] - str r0, [sp] - ldrb r0, [r4, 0x1] - str r0, [sp, 0x4] - adds r0, r6, 0 - bl sub_8079C4C - adds r5, 0x2 - adds r4, 0x2 - adds r7, 0x1 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x36 - adds r0, r6 - ldrb r0, [r0] - cmp r7, r0 - blt _08079E6A -_08079E94: - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8079E44 - - thumb_func_start sub_8079EA8 -sub_8079EA8: @ 8079EA8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r12, r0 - movs r7, 0 - ldr r3, =0x0203229c - ldr r0, [r3] - adds r0, 0x36 - add r0, r12 - ldrb r0, [r0] - cmp r7, r0 - bge _08079F5A - ldr r6, =0x02020630 - mov r9, r3 - mov r1, r12 - lsls r0, r1, 1 - add r0, r12 - lsls r2, r0, 1 - mov r10, r2 - ldr r1, =gUnknown_0832DE24 - movs r2, 0 - mov r8, r2 - lsls r0, 2 - adds r5, r0, r1 -_08079EE0: - mov r1, r9 - ldr r0, [r1] - mov r2, r10 - adds r4, r7, r2 - adds r0, 0x28 - adds r0, r4 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - adds r1, 0x3E - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - mov r0, r9 - ldr r3, [r0] - adds r2, r3, 0 - adds r2, 0x28 - adds r2, r4 - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r0, [r5] - lsls r0, 3 - adds r0, 0xE - strh r0, [r1, 0x20] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r0, [r5, 0x1] - lsls r0, 3 - subs r0, 0xC - strh r0, [r1, 0x22] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - mov r1, r8 - strh r1, [r0, 0x24] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - mov r2, r8 - strh r2, [r0, 0x26] - adds r5, 0x2 - adds r7, 0x1 - adds r3, 0x36 - add r3, r12 - ldrb r3, [r3] - cmp r7, r3 - blt _08079EE0 -_08079F5A: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8079EA8 - - thumb_func_start sub_8079F74 -sub_8079F74: @ 8079F74 - push {lr} - movs r0, 0x1 - bl rbox_fill_rectangle - movs r0, 0x1 - bl sub_8079BE0 - pop {r0} - bx r0 - thumb_func_end sub_8079F74 - - thumb_func_start sub_8079F88 -sub_8079F88: @ 8079F88 - push {r4-r6,lr} - sub sp, 0xC - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =gUnknown_0832C8BE - lsls r2, r4, 4 - subs r2, r4 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0xF - str r0, [sp] - movs r0, 0x11 - str r0, [sp, 0x4] - movs r6, 0 - str r6, [sp, 0x8] - movs r0, 0x1 - movs r3, 0 - bl CopyToBgTilemapBufferRect_ChangePalette - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - adds r0, r4, 0 - bl sub_8079E44 - adds r0, r4, 0 - bl sub_8079BE0 - adds r0, r4, 0 - bl sub_8079EA8 - ldr r0, =gUnknown_0832DE94 - ldr r0, [r0, 0x4] - ldr r5, =0x0203229c - ldr r1, [r5] - adds r1, 0x72 - ldrh r1, [r1] - lsls r1, 5 - ldr r2, =0x06010000 - adds r1, r2 - movs r2, 0x18 - bl sub_807A308 - ldr r0, [r5] - adds r0, 0x74 - adds r0, r4 - strb r6, [r0] - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8079F88 - - thumb_func_start sub_807A000 -sub_807A000: @ 807A000 - push {lr} - sub sp, 0x8 - movs r0, 0x1E - str r0, [sp] - movs r0, 0x14 - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0x8 - pop {r0} - bx r0 - thumb_func_end sub_807A000 - - thumb_func_start sub_807A024 -sub_807A024: @ 807A024 - push {lr} - sub sp, 0x8 - movs r0, 0x1E - str r0, [sp] - movs r0, 0x14 - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0x8 - pop {r0} - bx r0 - thumb_func_end sub_807A024 - - thumb_func_start sub_807A048 -sub_807A048: @ 807A048 - push {r4-r7,lr} - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 24 - lsrs r6, r1, 24 - movs r3, 0 - ldr r4, =0x0203229c - mov r12, r4 - movs r7, 0x8D - lsls r7, 4 -_0807A05C: - mov r1, r12 - ldr r0, [r1] - lsls r1, r3, 3 - adds r2, r0, r1 - adds r0, r2, r7 - ldrb r0, [r0] - cmp r0, 0 - bne _0807A090 - ldr r3, =0x000008d2 - adds r0, r2, r3 - strh r5, [r0] - adds r3, 0x2 - adds r0, r2, r3 - strb r6, [r0] - ldr r0, [r4] - adds r0, r1 - movs r1, 0x8D - lsls r1, 4 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - b _0807A096 - .pool -_0807A090: - adds r3, 0x1 - cmp r3, 0x3 - ble _0807A05C -_0807A096: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_807A048 - - thumb_func_start sub_807A09C -sub_807A09C: @ 807A09C - push {lr} - movs r3, 0 - ldr r0, =0x0203229c - ldr r0, [r0] - movs r2, 0x8D - lsls r2, 4 - adds r1, r0, r2 - movs r2, 0x3 -_0807A0AC: - ldrb r0, [r1] - adds r3, r0 - adds r1, 0x8 - subs r2, 0x1 - cmp r2, 0 - bge _0807A0AC - adds r0, r3, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_807A09C - - thumb_func_start sub_807A0C4 -sub_807A0C4: @ 807A0C4 - push {r4,r5,lr} - movs r4, 0 - ldr r3, =0x0203229c -_0807A0CA: - ldr r0, [r3] - lsls r1, r4, 3 - adds r2, r0, r1 - movs r5, 0x8D - lsls r5, 4 - adds r0, r2, r5 - ldrb r0, [r0] - adds r5, r1, 0 - cmp r0, 0 - beq _0807A18C - ldr r0, =0x000008d2 - adds r1, r2, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _0807A0F8 - subs r0, 0x1 - strh r0, [r1] - b _0807A18C - .pool -_0807A0F8: - ldr r1, =0x000008d4 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x8 - bhi _0807A17A - lsls r0, 2 - ldr r1, =_0807A114 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0807A114: - .4byte _0807A138 - .4byte _0807A14C - .4byte _0807A154 - .4byte _0807A15C - .4byte _0807A15C - .4byte _0807A15C - .4byte _0807A164 - .4byte _0807A16C - .4byte _0807A174 -_0807A138: - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x80 - movs r1, 0x14 - bl sub_8077170 - b _0807A17A - .pool -_0807A14C: - movs r0, 0 - bl sub_807A19C - b _0807A17A -_0807A154: - movs r0, 0x2 - bl sub_807A19C - b _0807A17A -_0807A15C: - movs r0, 0x3 - bl sub_807A19C - b _0807A17A -_0807A164: - movs r0, 0x6 - bl sub_807A19C - b _0807A17A -_0807A16C: - movs r0, 0x7 - bl sub_807A19C - b _0807A17A -_0807A174: - movs r0, 0x8 - bl sub_807A19C -_0807A17A: - ldr r0, =0x0203229c - ldr r1, [r0] - adds r1, r5 - movs r2, 0x8D - lsls r2, 4 - adds r1, r2 - movs r2, 0 - strb r2, [r1] - adds r3, r0, 0 -_0807A18C: - adds r4, 0x1 - cmp r4, 0x3 - ble _0807A0CA - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807A0C4 - - thumb_func_start sub_807A19C -sub_807A19C: @ 807A19C - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_0832DEBC - lsls r4, 2 - adds r4, r0 - ldr r2, [r4] - movs r0, 0x1 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - movs r0, 0 - movs r1, 0x14 - movs r2, 0xC - bl sub_8098858 - movs r0, 0 - bl PutWindowTilemap - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807A19C - - thumb_func_start sub_807A1F0 -sub_807A1F0: @ 807A1F0 - push {r4,lr} - sub sp, 0x8 - ldr r0, =0x0203229c - ldr r1, [r0] - adds r3, r1, 0 - adds r3, 0xA8 - ldrb r1, [r3] - adds r4, r0, 0 - cmp r1, 0xD - bhi _0807A22C - ldr r1, =0x02032188 - ldrb r0, [r3] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - str r0, [sp] - ldr r0, =0xffff0000 - ldr r2, [sp, 0x4] - ands r2, r0 - movs r0, 0x80 - lsls r0, 1 - orrs r2, r0 - str r2, [sp, 0x4] - ldrb r1, [r3] - adds r1, 0xC8 - lsls r1, 16 - ldr r0, =0x0000ffff - ands r0, r2 - orrs r0, r1 - str r0, [sp, 0x4] -_0807A22C: - ldr r0, [r4] - adds r0, 0xA8 - ldrb r0, [r0] - cmp r0, 0x11 - bhi _0807A2FC - lsls r0, 2 - ldr r1, =_0807A254 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0807A254: - .4byte _0807A29C - .4byte _0807A29C - .4byte _0807A29C - .4byte _0807A29C - .4byte _0807A29C - .4byte _0807A29C - .4byte _0807A29C - .4byte _0807A29C - .4byte _0807A2A0 - .4byte _0807A2B8 - .4byte _0807A2B8 - .4byte _0807A2B8 - .4byte _0807A2B8 - .4byte _0807A2B8 - .4byte _0807A2BC - .4byte _0807A2C8 - .4byte _0807A2D4 - .4byte _0807A2F0 -_0807A29C: - mov r0, sp - b _0807A2D6 -_0807A2A0: - mov r0, sp - bl LoadObjectPic - ldr r1, =0x0203229c - ldr r1, [r1] - adds r2, r1, 0 - adds r2, 0x72 - strh r0, [r2] - b _0807A2DE - .pool -_0807A2B8: - mov r0, sp - b _0807A2D6 -_0807A2BC: - ldr r0, =gUnknown_0832DCE4 - bl LoadTaggedObjectPalette - b _0807A2DA - .pool -_0807A2C8: - ldr r0, =gUnknown_0832DC44 - bl LoadTaggedObjectPalette - b _0807A2DA - .pool -_0807A2D4: - ldr r0, =gUnknown_0832DC3C -_0807A2D6: - bl LoadObjectPic -_0807A2DA: - ldr r0, =0x0203229c - ldr r1, [r0] -_0807A2DE: - adds r1, 0xA8 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0807A2FC - .pool -_0807A2F0: - ldr r0, [r4] - adds r0, 0xA8 - movs r1, 0 - strb r1, [r0] - movs r0, 0x1 - b _0807A2FE -_0807A2FC: - movs r0, 0 -_0807A2FE: - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_807A1F0 - - thumb_func_start sub_807A308 -sub_807A308: @ 807A308 - push {lr} - sub sp, 0x4 - movs r2, 0x6 - str r2, [sp] - movs r2, 0 - movs r3, 0 - bl sub_80C6D80 - add sp, 0x4 - pop {r0} - bx r0 - thumb_func_end sub_807A308 - - thumb_func_start sub_807A320 -sub_807A320: @ 807A320 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0 - beq _0807A338 - cmp r0, 0x1 - beq _0807A3CC - b _0807A458 -_0807A338: - movs r7, 0 - ldr r1, =0x0203229c - ldr r0, [r1] - adds r0, 0x36 - ldrb r0, [r0] - cmp r7, r0 - blt _0807A348 - b _0807A458 -_0807A348: - adds r6, r1, 0 - movs r5, 0 - mov r9, r5 -_0807A34E: - movs r0, 0x64 - adds r1, r7, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - adds r1, r0, 0 - cmp r1, 0x1 - bne _0807A380 - ldr r0, [r6] - adds r0, 0x45 - adds r0, r5 - mov r2, r9 - strb r2, [r0] - ldr r0, [r6] - adds r0, 0x51 - adds r0, r5 - b _0807A3B0 - .pool -_0807A380: - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - adds r1, r0, 0 - cmp r1, 0 - bne _0807A39E - ldr r0, [r6] - adds r0, 0x45 - adds r0, r5 - strb r1, [r0] - ldr r0, [r6] - adds r0, 0x51 - adds r0, r5 - b _0807A3B0 -_0807A39E: - ldr r0, [r6] - adds r0, 0x45 - adds r0, r5 - movs r1, 0x1 - strb r1, [r0] - ldr r0, [r6] - adds r0, 0x51 - adds r0, r5 - mov r1, r9 -_0807A3B0: - strb r1, [r0] - ldr r0, =0x0203229c - adds r5, 0x1 - adds r7, 0x1 - ldr r0, [r0] - adds r0, 0x36 - add r0, r8 - ldrb r0, [r0] - cmp r7, r0 - blt _0807A34E - b _0807A458 - .pool -_0807A3CC: - movs r7, 0 - ldr r1, =0x0203229c - ldr r0, [r1] - adds r0, 0x37 - ldrb r0, [r0] - cmp r7, r0 - bge _0807A458 - adds r6, r1, 0 - movs r5, 0x6 - movs r2, 0 - mov r9, r2 -_0807A3E2: - movs r0, 0x64 - adds r1, r7, 0 - muls r1, r0 - ldr r0, =0x02024744 - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - adds r1, r0, 0 - cmp r1, 0x1 - bne _0807A414 - ldr r0, [r6] - adds r0, 0x45 - adds r0, r5 - mov r2, r9 - strb r2, [r0] - ldr r0, [r6] - adds r0, 0x51 - adds r0, r5 - b _0807A444 - .pool -_0807A414: - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - adds r1, r0, 0 - cmp r1, 0 - bne _0807A432 - ldr r0, [r6] - adds r0, 0x45 - adds r0, r5 - strb r1, [r0] - ldr r0, [r6] - adds r0, 0x51 - adds r0, r5 - b _0807A444 -_0807A432: - ldr r0, [r6] - adds r0, 0x45 - adds r0, r5 - movs r1, 0x1 - strb r1, [r0] - ldr r0, [r6] - adds r0, 0x51 - adds r0, r5 - mov r1, r9 -_0807A444: - strb r1, [r0] - ldr r0, =0x0203229c - adds r5, 0x1 - adds r7, 0x1 - ldr r0, [r0] - adds r0, 0x36 - add r0, r8 - ldrb r0, [r0] - cmp r7, r0 - blt _0807A3E2 -_0807A458: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807A320 - - thumb_func_start sub_807A468 -sub_807A468: @ 807A468 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _0807A478 - cmp r0, 0x1 - beq _0807A4D8 - b _0807A52C -_0807A478: - movs r6, 0 - ldr r1, =0x0203229c - ldr r0, [r1] - adds r0, 0x36 - ldrb r0, [r0] - cmp r6, r0 - bcs _0807A52C - adds r7, r1, 0 -_0807A488: - movs r0, 0x64 - adds r4, r6, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - movs r1, 0x3A - bl pokemon_getattr - adds r1, r0, 0 - lsls r0, r5, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - bl sub_8075060 - ldr r1, [r7] - adds r1, 0x5D - adds r1, r6 - strb r0, [r1] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, [r7] - adds r0, 0x36 - ldrb r0, [r0] - cmp r6, r0 - bcc _0807A488 - b _0807A52C - .pool -_0807A4D8: - movs r6, 0 - ldr r1, =0x0203229c - ldr r0, [r1] - adds r0, 0x37 - ldrb r0, [r0] - cmp r6, r0 - bcs _0807A52C - adds r7, r1, 0 -_0807A4E8: - movs r0, 0x64 - adds r4, r6, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - movs r1, 0x3A - bl pokemon_getattr - adds r1, r0, 0 - lsls r0, r5, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - bl sub_8075060 - ldr r1, [r7] - adds r1, 0x63 - adds r1, r6 - strb r0, [r1] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, [r7] - adds r0, 0x37 - ldrb r0, [r0] - cmp r6, r0 - bcc _0807A4E8 -_0807A52C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807A468 - - thumb_func_start sub_807A53C -sub_807A53C: @ 807A53C - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r5, 0 -_0807A544: - movs r4, 0 - ldr r2, =0x0203229c - ldr r0, [r2] - adds r0, 0x36 - adds r0, r5 - adds r1, r5, 0x1 - mov r8, r1 - ldrb r0, [r0] - cmp r4, r0 - bge _0807A596 - adds r6, r2, 0 - lsls r0, r5, 1 - adds r0, r5 - lsls r7, r0, 1 -_0807A560: - ldr r2, [r6] - adds r3, r4, r7 - adds r0, r2, 0 - adds r0, 0x28 - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - adds r2, 0x5D - adds r2, r3 - ldrb r2, [r2] - movs r1, 0x4 - subs r1, r2 - lsls r1, 24 - lsrs r1, 24 - bl sub_80D32C8 - adds r4, 0x1 - ldr r0, [r6] - adds r0, 0x36 - adds r0, r5 - ldrb r0, [r0] - cmp r4, r0 - blt _0807A560 -_0807A596: - mov r5, r8 - cmp r5, 0x1 - ble _0807A544 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807A53C - - thumb_func_start sub_807A5B0 -sub_807A5B0: @ 807A5B0 - push {r4,r5,lr} - movs r3, 0 - ldr r5, =0x03005d8c - ldr r4, =0x000031a8 -_0807A5B8: - ldr r0, [r5] - adds r0, r4 - adds r2, r0, r3 - ldrb r0, [r2] - cmp r0, 0 - bne _0807A5DA - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0xA9 - adds r0, r3 - ldrb r0, [r0] - adds r1, r0, 0 - cmp r1, 0 - beq _0807A5DA - cmp r1, 0x3F - bhi _0807A5DA - strb r0, [r2] -_0807A5DA: - adds r3, 0x1 - cmp r3, 0xA - ble _0807A5B8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807A5B0 - - thumb_func_start sub_807A5F4 -sub_807A5F4: @ 807A5F4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x30 - mov r8, r0 - adds r7, r1, 0 - mov r9, r2 - movs r5, 0 - cmp r5, r7 - bge _0807A62E - mov r6, sp -_0807A60C: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - add r4, r8 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - str r0, [r6, 0x18] - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - stm r6!, {r0} - adds r5, 0x1 - cmp r5, r7 - blt _0807A60C -_0807A62E: - bl sub_809D42C - mov r1, r9 - lsls r4, r1, 2 - cmp r0, 0 - bne _0807A65C - add r0, sp, 0x18 - adds r0, r4 - ldr r1, [r0] - movs r0, 0xCE - lsls r0, 1 - cmp r1, r0 - bne _0807A64C - movs r0, 0x3 - b _0807A718 -_0807A64C: - lsls r0, r1, 16 - lsrs r0, 16 - bl sub_806E3F8 - cmp r0, 0 - bne _0807A65C - movs r0, 0x2 - b _0807A718 -_0807A65C: - bl link_get_multiplayer_id - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r0, =0x020229e8 - adds r1, r0 - ldrb r0, [r1] - subs r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bls _0807A6AC - ldrb r1, [r1, 0x12] - movs r0, 0xF - ands r0, r1 - cmp r0, 0 - bne _0807A6AC - add r0, sp, 0x18 - adds r0, r4 - ldr r1, [r0] - movs r0, 0xCE - lsls r0, 1 - cmp r1, r0 - bne _0807A6A0 - movs r0, 0x5 - b _0807A718 - .pool -_0807A6A0: - lsls r0, r1, 16 - lsrs r0, 16 - bl sub_806E3F8 - cmp r0, 0 - beq _0807A6D2 -_0807A6AC: - mov r1, sp - adds r0, r1, r4 - ldr r1, [r0] - movs r0, 0xCD - lsls r0, 1 - cmp r1, r0 - beq _0807A6BE - cmp r1, 0x97 - bne _0807A6D6 -_0807A6BE: - movs r0, 0x64 - mov r1, r9 - muls r1, r0 - adds r0, r1, 0 - add r0, r8 - movs r1, 0x50 - bl pokemon_getattr - cmp r0, 0 - bne _0807A6D6 -_0807A6D2: - movs r0, 0x4 - b _0807A718 -_0807A6D6: - cmp r7, 0 - ble _0807A6F4 - movs r3, 0xCE - lsls r3, 1 - movs r2, 0 - add r1, sp, 0x18 - adds r5, r7, 0 -_0807A6E4: - ldr r0, [r1] - cmp r0, r3 - bne _0807A6EC - str r2, [r1] -_0807A6EC: - adds r1, 0x4 - subs r5, 0x1 - cmp r5, 0 - bne _0807A6E4 -_0807A6F4: - movs r2, 0 - movs r5, 0 - cmp r2, r7 - bge _0807A70E - add r1, sp, 0x18 -_0807A6FE: - cmp r5, r9 - beq _0807A706 - ldr r0, [r1] - adds r2, r0 -_0807A706: - adds r1, 0x4 - adds r5, 0x1 - cmp r5, r7 - blt _0807A6FE -_0807A70E: - cmp r2, 0 - bne _0807A716 - movs r0, 0x1 - b _0807A718 -_0807A716: - movs r0, 0 -_0807A718: - add sp, 0x30 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_807A5F4 - - thumb_func_start sub_807A728 -sub_807A728: @ 807A728 - push {r4-r7,lr} - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _0807A7B4 - movs r4, 0 - bl link_get_multiplayer_id - ldr r5, =0x020229e8 - movs r7, 0x1 - eors r0, r7 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r1, [r1] - subs r0, r1, 0x1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bls _0807A7B4 - subs r0, r1, 0x4 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _0807A762 - movs r4, 0x2 -_0807A762: - cmp r4, 0 - ble _0807A7B4 - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r1, [r1, 0x12] - movs r6, 0xF0 - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _0807A7B0 - cmp r4, 0x2 - bne _0807A7B4 - bl link_get_multiplayer_id - eors r0, r7 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r1, [r1, 0x12] - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - bne _0807A7B4 - movs r0, 0x2 - b _0807A7B6 - .pool -_0807A7B0: - movs r0, 0x1 - b _0807A7B6 -_0807A7B4: - movs r0, 0 -_0807A7B6: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_807A728 - - thumb_func_start sub_807A7BC -sub_807A7BC: @ 807A7BC - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0xCD - lsls r0, 1 - cmp r2, r0 - beq _0807A7D2 - cmp r2, 0x97 - bne _0807A7DA -_0807A7D2: - cmp r1, 0 - bne _0807A7DA - movs r0, 0x1 - b _0807A7DC -_0807A7DA: - movs r0, 0 -_0807A7DC: - pop {r1} - bx r1 - thumb_func_end sub_807A7BC - - thumb_func_start sub_807A7E0 -sub_807A7E0: @ 807A7E0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r4, [sp, 0x20] - ldr r5, [sp, 0x24] - ldr r6, [sp, 0x28] - lsls r2, 16 - lsrs r7, r2, 16 - lsls r3, 16 - lsrs r3, 16 - mov r8, r3 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 16 - lsrs r5, 16 - lsls r6, 24 - lsrs r6, 24 - lsls r2, r0, 23 - lsrs r2, 31 - mov r9, r2 - lsls r0, 24 - lsrs r2, r0, 31 - lsls r0, r1, 23 - lsrs r0, 31 - mov r10, r0 - lsls r0, r1, 24 - lsrs r0, 31 - lsls r1, 18 - lsrs r1, 28 - cmp r1, 0x3 - beq _0807A832 - cmp r2, 0 - bne _0807A82A - movs r0, 0x8 - b _0807A8C0 -_0807A82A: - cmp r0, 0 - bne _0807A832 - movs r0, 0x9 - b _0807A8C0 -_0807A832: - adds r0, r5, 0 - adds r1, r6, 0 - bl sub_807A7BC - cmp r0, 0 - bne _0807A898 - movs r0, 0xCE - lsls r0, 1 - cmp r8, r0 - bne _0807A84E - cmp r7, r8 - beq _0807A86C - movs r0, 0x2 - b _0807A8C0 -_0807A84E: - ldr r0, =gBaseStats - lsls r1, r7, 3 - subs r1, r7 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x6] - cmp r0, r4 - beq _0807A86C - ldrb r0, [r1, 0x7] - cmp r0, r4 - beq _0807A86C - movs r0, 0x1 - b _0807A8C0 - .pool -_0807A86C: - movs r0, 0xCE - lsls r0, 1 - cmp r7, r0 - bne _0807A87C - cmp r7, r8 - beq _0807A87C - movs r0, 0x3 - b _0807A8C0 -_0807A87C: - mov r0, r9 - cmp r0, 0 - bne _0807A8AA - movs r0, 0xCE - lsls r0, 1 - cmp r7, r0 - bne _0807A88E - movs r0, 0x6 - b _0807A8C0 -_0807A88E: - adds r0, r7, 0 - bl sub_806E3F8 - cmp r0, 0 - bne _0807A89C -_0807A898: - movs r0, 0x4 - b _0807A8C0 -_0807A89C: - mov r0, r8 - bl sub_806E3F8 - cmp r0, 0 - bne _0807A8AA - movs r0, 0x5 - b _0807A8C0 -_0807A8AA: - mov r0, r10 - cmp r0, 0 - bne _0807A8BE - adds r0, r7, 0 - bl sub_806E3F8 - cmp r0, 0 - bne _0807A8BE - movs r0, 0x7 - b _0807A8C0 -_0807A8BE: - movs r0, 0 -_0807A8C0: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_807A7E0 - - thumb_func_start sub_807A8D0 -sub_807A8D0: @ 807A8D0 - push {r4-r6,lr} - lsls r1, 16 - lsrs r5, r1, 16 - adds r6, r5, 0 - lsls r2, 16 - lsrs r2, 16 - lsls r3, 24 - lsrs r3, 24 - lsls r0, 23 - lsrs r4, r0, 31 - adds r0, r2, 0 - adds r1, r3, 0 - bl sub_807A7BC - cmp r0, 0 - bne _0807A90A - cmp r4, 0 - bne _0807A90E - movs r0, 0xCE - lsls r0, 1 - cmp r5, r0 - bne _0807A900 - movs r0, 0x2 - b _0807A910 -_0807A900: - adds r0, r6, 0 - bl sub_806E3F8 - cmp r0, 0 - bne _0807A90E -_0807A90A: - movs r0, 0x1 - b _0807A910 -_0807A90E: - movs r0, 0 -_0807A910: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_807A8D0 - - thumb_func_start sub_807A918 -sub_807A918: @ 807A918 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x18 - adds r6, r0, 0 - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - movs r5, 0 - ldr r0, =0x020244e9 - ldrb r0, [r0] - cmp r5, r0 - bge _0807A95A - mov r4, sp -_0807A934: - movs r0, 0x64 - muls r0, r5 - adds r0, r6, r0 - movs r1, 0x41 - bl pokemon_getattr - str r0, [r4] - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - bne _0807A94E - movs r0, 0 - str r0, [r4] -_0807A94E: - adds r4, 0x4 - adds r5, 0x1 - ldr r0, =0x020244e9 - ldrb r0, [r0] - cmp r5, r0 - blt _0807A934 -_0807A95A: - movs r7, 0 - movs r6, 0x1 - movs r5, 0 - ldr r4, =0x020229e8 - b _0807A980 - .pool -_0807A96C: - ldrb r0, [r4] - subs r0, 0x4 - cmp r0, 0x1 - bhi _0807A978 - movs r7, 0 - b _0807A97C -_0807A978: - movs r0, 0x1 - orrs r7, r0 -_0807A97C: - adds r4, 0x1C - adds r5, 0x1 -_0807A980: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - blt _0807A96C - movs r5, 0 - movs r4, 0 - b _0807A9B4 -_0807A992: - ldr r0, =0x020229e8 - adds r2, r4, r0 - ldrb r1, [r2, 0x10] - movs r0, 0xF - ands r0, r1 - cmp r0, 0 - bne _0807A9A2 - movs r6, 0 -_0807A9A2: - cmp r7, 0 - beq _0807A9B0 - ldrb r0, [r2, 0x10] - lsrs r0, 4 - cmp r0, 0 - beq _0807A9B0 - movs r6, 0 -_0807A9B0: - adds r4, 0x1C - adds r5, 0x1 -_0807A9B4: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - blt _0807A992 - cmp r6, 0 - bne _0807A9EA - mov r1, r8 - lsls r0, r1, 2 - mov r1, sp - adds r4, r1, r0 - ldrh r0, [r4] - bl sub_806E3F8 - cmp r0, 0 - bne _0807A9E0 - movs r0, 0x2 - b _0807AA1A - .pool -_0807A9E0: - ldr r0, [r4] - cmp r0, 0 - bne _0807A9EA - movs r0, 0x3 - b _0807AA1A -_0807A9EA: - movs r2, 0 - movs r5, 0 - ldr r0, =0x020244e9 - ldrb r0, [r0] - cmp r2, r0 - bge _0807AA0A - adds r3, r0, 0 - mov r1, sp -_0807A9FA: - cmp r8, r5 - beq _0807AA02 - ldr r0, [r1] - adds r2, r0 -_0807AA02: - adds r1, 0x4 - adds r5, 0x1 - cmp r5, r3 - blt _0807A9FA -_0807AA0A: - cmp r2, 0 - beq _0807AA18 - movs r0, 0 - b _0807AA1A - .pool -_0807AA18: - movs r0, 0x1 -_0807AA1A: - add sp, 0x18 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_807A918 - - thumb_func_start sub_807AA28 -sub_807AA28: @ 807AA28 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA - bne _0807AA44 - movs r0, 0x17 - bl audio_play - movs r0, 0 - strh r0, [r4, 0x2E] -_0807AA44: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_807AA28 - - thumb_func_start sub_807AA4C -sub_807AA4C: @ 807AA4C - push {r4,r5,lr} - adds r4, r0, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _0807AA76 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA - bne _0807AA76 - movs r0, 0xC2 - bl audio_play - strh r5, [r4, 0x2E] -_0807AA76: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_807AA4C - - thumb_func_start sub_807AA7C -sub_807AA7C: @ 807AA7C - push {lr} - adds r2, r0, 0 - movs r0, 0x30 - ldrsh r1, [r2, r0] - cmp r1, 0 - bne _0807AAB2 - ldrh r0, [r2, 0x2E] - adds r0, 0x1 - strh r0, [r2, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xC - bne _0807AA98 - strh r1, [r2, 0x2E] -_0807AA98: - movs r1, 0x2E - ldrsh r0, [r2, r1] - lsls r0, 1 - ldr r1, =gUnknown_08338EA4 - adds r0, r1 - ldrb r1, [r2, 0x5] - lsrs r1, 4 - adds r1, 0x10 - lsls r1, 4 - adds r1, 0x4 - movs r2, 0x2 - bl gpu_pal_apply -_0807AAB2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_807AA7C - - thumb_func_start sub_807AABC -sub_807AABC: @ 807AABC - push {lr} - adds r2, r0, 0 - ldrh r1, [r2, 0x2E] - adds r1, 0x1 - strh r1, [r2, 0x2E] - ldrh r0, [r2, 0x26] - adds r0, 0x1 - strh r0, [r2, 0x26] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0xA - bne _0807AADA - adds r0, r2, 0 - bl RemoveObjectAndFreeTiles -_0807AADA: - pop {r0} - bx r0 - thumb_func_end sub_807AABC - - thumb_func_start sub_807AAE0 -sub_807AAE0: @ 807AAE0 - push {lr} - adds r2, r0, 0 - ldrh r1, [r2, 0x2E] - adds r1, 0x1 - strh r1, [r2, 0x2E] - ldrh r0, [r2, 0x26] - subs r0, 0x1 - strh r0, [r2, 0x26] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0xA - bne _0807AAFE - adds r0, r2, 0 - bl RemoveObjectAndFreeTiles -_0807AAFE: - pop {r0} - bx r0 - thumb_func_end sub_807AAE0 - - thumb_func_start sub_807AB04 -sub_807AB04: @ 807AB04 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xF - bne _0807AB20 - movs r0, 0xCC - bl audio_play - movs r0, 0 - strh r0, [r4, 0x2E] -_0807AB20: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_807AB04 - - thumb_func_start sub_807AB28 -sub_807AB28: @ 807AB28 - push {r4,r5,lr} - sub sp, 0x20 - ldr r0, =0x020322a0 - ldr r0, [r0] - mov r12, r0 - adds r0, 0xD4 - ldrh r1, [r0] - lsls r1, 8 - adds r0, 0x2 - ldrh r2, [r0] - lsls r2, 8 - adds r0, 0x6 - movs r4, 0 - ldrsh r3, [r0, r4] - adds r0, 0x2 - movs r5, 0 - ldrsh r0, [r0, r5] - str r0, [sp] - mov r4, r12 - adds r4, 0xE8 - movs r5, 0 - ldrsh r0, [r4, r5] - str r0, [sp, 0x4] - movs r5, 0 - ldrsh r0, [r4, r5] - str r0, [sp, 0x8] - mov r0, r12 - adds r0, 0xEC - ldrh r0, [r0] - str r0, [sp, 0xC] - add r0, sp, 0x10 - bl sub_806F6C0 - add r0, sp, 0x10 - ldrh r1, [r0] - movs r0, 0x20 - bl SetGpuReg - add r0, sp, 0x10 - ldrh r1, [r0, 0x2] - movs r0, 0x22 - bl SetGpuReg - add r0, sp, 0x10 - ldrh r1, [r0, 0x4] - movs r0, 0x24 - bl SetGpuReg - add r0, sp, 0x10 - ldrh r1, [r0, 0x6] - movs r0, 0x26 - bl SetGpuReg - ldr r1, [sp, 0x18] - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x28 - bl SetGpuReg - ldr r1, [sp, 0x18] - lsrs r1, 16 - movs r0, 0x2A - bl SetGpuReg - ldr r1, [sp, 0x1C] - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x2C - bl SetGpuReg - ldr r1, [sp, 0x1C] - lsrs r1, 16 - movs r0, 0x2E - bl SetGpuReg - add sp, 0x20 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807AB28 - - thumb_func_start sub_807ABCC -sub_807ABCC: @ 807ABCC - push {r4,lr} - ldr r4, =0x020322a0 - ldr r0, [r4] - adds r0, 0xE0 - ldrh r1, [r0] - movs r0, 0x16 - bl SetGpuReg - ldr r0, [r4] - adds r0, 0xE2 - ldrh r1, [r0] - movs r0, 0x14 - bl SetGpuReg - movs r0, 0 - bl GetGpuReg - lsls r0, 16 - movs r1, 0xE0 - lsls r1, 11 - ands r1, r0 - cmp r1, 0 - bne _0807AC18 - ldr r0, [r4] - adds r0, 0xE4 - ldrh r1, [r0] - movs r0, 0x1A - bl SetGpuReg - ldr r0, [r4] - adds r0, 0xE6 - ldrh r1, [r0] - movs r0, 0x18 - bl SetGpuReg - b _0807AC1C - .pool -_0807AC18: - bl sub_807AB28 -_0807AC1C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_807ABCC - - thumb_func_start sub_807AC24 -sub_807AC24: @ 807AC24 - push {lr} - bl sub_807ABCC - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_807AC24 - - thumb_func_start sub_807AC3C -sub_807AC3C: @ 807AC3C - push {r4,lr} - ldr r3, =0x020322a0 - ldr r1, [r3] - movs r0, 0x8A - adds r0, r1 - mov r12, r0 - movs r2, 0 - movs r0, 0 - mov r4, r12 - strh r0, [r4] - adds r1, 0x88 - strb r2, [r1] - ldr r0, [r3] - adds r0, 0x89 - strb r2, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807AC3C - - thumb_func_start sub_807AC64 -sub_807AC64: @ 807AC64 - push {r4,r5,lr} - ldr r0, =0x020322a0 - ldr r2, [r0] - adds r1, r2, 0 - adds r1, 0x88 - adds r3, r2, 0 - adds r3, 0x89 - ldrb r1, [r1] - adds r5, r0, 0 - ldrb r3, [r3] - cmp r1, r3 - bne _0807AC8C - adds r1, r2, 0 - adds r1, 0x8A - ldrh r0, [r1] - adds r0, 0x1 - b _0807AC92 - .pool -_0807AC8C: - adds r1, r2, 0 - adds r1, 0x8A - movs r0, 0 -_0807AC92: - strh r0, [r1] - adds r4, r5, 0 - ldr r0, [r4] - adds r0, 0x8A - ldrh r1, [r0] - movs r0, 0x96 - lsls r0, 1 - cmp r1, r0 - bls _0807ACC4 - bl sub_80097E8 - ldr r0, =c2_800ACD4 - bl SetMainCallback2 - ldr r1, [r4] - adds r3, r1, 0 - adds r3, 0x8A - movs r2, 0 - movs r0, 0 - strh r0, [r3] - adds r1, 0x89 - strb r2, [r1] - ldr r0, [r4] - adds r0, 0x88 - strb r2, [r0] -_0807ACC4: - ldr r0, [r5] - adds r1, r0, 0 - adds r1, 0x88 - ldrb r1, [r1] - adds r0, 0x89 - strb r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807AC64 - - thumb_func_start sub_807ACDC -sub_807ACDC: @ 807ACDC - push {lr} - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _0807ACF0 - movs r0, 0 - b _0807ACF8 - .pool -_0807ACF0: - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 -_0807ACF8: - pop {r1} - bx r1 - thumb_func_end sub_807ACDC - - thumb_func_start sub_807ACFC -sub_807ACFC: @ 807ACFC - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - movs r4, 0 - mov r8, r4 - cmp r6, 0 - bne _0807AD22 - ldr r0, =0x02032298 - ldrb r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r1, r0 - mov r8, r1 - movs r4, 0x1 -_0807AD22: - cmp r6, 0x1 - bne _0807AD40 - ldr r0, =0x02032298 - ldrb r0, [r0, 0x1] - movs r1, 0x6 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r1, r0 - ldr r0, =0x02024744 - adds r1, r0 - mov r8, r1 - movs r4, 0x3 -_0807AD40: - cmp r5, 0 - beq _0807AD58 - cmp r5, 0x1 - beq _0807ADE0 - b _0807AE36 - .pool -_0807AD58: - mov r0, r8 - movs r1, 0x41 - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - mov r0, r8 - movs r1, 0 - bl pokemon_getattr - adds r7, r0, 0 - cmp r6, 0 - bne _0807AD94 - lsls r0, r5, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r1, [r1] - ldr r1, [r1, 0x8] - adds r2, r5, 0 - adds r3, r7, 0 - bl DecompressMonPic_DetectFrontOrBack_2 - movs r4, 0 - b _0807ADB2 - .pool -_0807AD94: - lsls r0, r5, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r2, [r1] - lsls r4, r6, 1 - adds r1, r4, 0x1 - lsls r1, 2 - adds r2, 0x4 - adds r2, r1 - ldr r1, [r2] - adds r2, r5, 0 - adds r3, r7, 0 - bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack -_0807ADB2: - mov r0, r8 - bl sub_806E794 - bl LoadCompressedObjectPalette - ldr r0, =0x020322a0 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0xF0 - adds r0, r4 - strh r5, [r0] - lsls r0, r6, 2 - adds r1, 0x68 - adds r1, r0 - str r7, [r1] - b _0807AE36 - .pool -_0807ADE0: - mov r0, r8 - bl sub_806E794 - ldrh r0, [r0, 0x4] - adds r1, r4, 0 - bl sub_806A068 - ldr r0, =0x0202499c - movs r1, 0x78 - movs r2, 0x3C - movs r3, 0x6 - bl AddObjectToFront - ldr r4, =0x020322a0 - ldr r1, [r4] - adds r1, 0x8E - adds r1, r6 - strb r0, [r1] - ldr r3, =0x02020630 - ldr r0, [r4] - adds r0, 0x8E - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r4] - adds r0, 0x8E - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r3, 0x1C - adds r0, r3 - ldr r1, =DummyObjectCallback - str r1, [r0] -_0807AE36: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807ACFC - - thumb_func_start sub_807AE50 -sub_807AE50: @ 807AE50 - push {r4,r5,lr} - sub sp, 0x4 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0xC - bls _0807AE66 - b _0807B116 -_0807AE66: - lsls r0, 2 - ldr r1, =_0807AE78 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0807AE78: - .4byte _0807AEAC - .4byte _0807AF58 - .4byte _0807AF9C - .4byte _0807AFBC - .4byte _0807B006 - .4byte _0807B034 - .4byte _0807B058 - .4byte _0807B070 - .4byte _0807B07A - .4byte _0807B094 - .4byte _0807B0B0 - .4byte _0807B0D4 - .4byte _0807B0F0 -_0807AEAC: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _0807AEC0 - ldr r1, =0x020229c6 - ldr r2, =0x00001144 - adds r0, r2, 0 - strh r0, [r1] - bl sub_80097E8 -_0807AEC0: - ldr r4, =0x020322a0 - movs r5, 0x80 - lsls r5, 1 - adds r0, r5, 0 - bl AllocZeroed - str r0, [r4] - bl init_uns_table_pokemon_copy - bl clear_tasks - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - ldr r0, =sub_807AC24 - bl SetVBlankCallback - bl sub_807B170 - bl sub_807AC3C - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - movs r2, 0 - strb r0, [r1] - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x8C - strh r2, [r0] - adds r0, 0x8 - strh r2, [r0] - adds r1, 0xEE - movs r0, 0x1 - strb r0, [r1] - ldr r3, [r4] - adds r0, r3, 0 - adds r0, 0xD4 - movs r1, 0x40 - strh r1, [r0] - adds r0, 0x2 - strh r1, [r0] - adds r0, 0x2 - strh r2, [r0] - adds r0, 0x2 - strh r2, [r0] - adds r1, r3, 0 - adds r1, 0xDC - movs r0, 0x78 - strh r0, [r1] - adds r1, 0x2 - movs r0, 0x50 - strh r0, [r1] - adds r0, r3, 0 - adds r0, 0xE8 - strh r5, [r0] - adds r0, 0x4 - strh r2, [r0] - b _0807B116 - .pool -_0807AF58: - ldr r0, =0x03003124 - ldrb r5, [r0] - cmp r5, 0 - bne _0807AF90 - ldr r4, =0x020322a0 - ldr r0, [r4] - adds r0, 0xFA - movs r1, 0x1 - strb r1, [r0] - bl sub_8009734 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r4] - str r5, [r0, 0x64] - b _0807B116 - .pool -_0807AF90: - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 - movs r0, 0x4 - strb r0, [r1] - b _0807B116 -_0807AF9C: - ldr r0, =0x020322a0 - ldr r1, [r0] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0x3C - bhi _0807AFAC - b _0807B116 -_0807AFAC: - movs r0, 0 - str r0, [r1, 0x64] - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 - b _0807B0E4 - .pool -_0807AFBC: - bl sub_800ABBC - lsls r0, 24 - cmp r0, 0 - bne _0807AFC8 - b _0807B0DC -_0807AFC8: - bl sub_800ABAC - adds r4, r0, 0 - bl sub_800AA48 - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - bcc _0807B000 - ldr r0, =0x020322a0 - ldr r1, [r0] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0x1E - bhi _0807AFEA - b _0807B116 -_0807AFEA: - bl sub_800A620 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _0807B0E4 - .pool -_0807B000: - bl sub_807AC64 - b _0807B116 -_0807B006: - bl sub_807AC64 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0807B014 - b _0807B116 -_0807B014: - bl sub_800A23C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0807B022 - b _0807B116 -_0807B022: - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _0807B0E4 - .pool -_0807B034: - ldr r2, =0x020322a0 - ldr r0, [r2] - adds r0, 0x72 - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - adds r0, 0x73 - strb r1, [r0] - ldr r0, [r2] - adds r0, 0x93 - strb r1, [r0] - movs r0, 0 - bl sub_807ACFC - b _0807B0DC - .pool -_0807B058: - movs r0, 0 - movs r1, 0x1 - bl sub_807ACFC - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _0807B0E4 - .pool -_0807B070: - movs r0, 0x1 - movs r1, 0 - bl sub_807ACFC - b _0807B0DC -_0807B07A: - movs r0, 0x1 - movs r1, 0x1 - bl sub_807ACFC - bl sub_807B154 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _0807B0E4 - .pool -_0807B094: - bl sub_807BA94 - ldr r0, =gUnknown_08338D18 - bl LoadObjectPic - ldr r0, =gUnknown_08338D20 - bl LoadTaggedObjectPalette - b _0807B0DC - .pool -_0807B0B0: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - movs r0, 0 - bl ShowBg - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _0807B0E4 - .pool -_0807B0D4: - bl sub_807B140 - bl sub_807BAD8 -_0807B0DC: - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 -_0807B0E4: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0807B116 - .pool -_0807B0F0: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0807B116 - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _0807B110 - bl sub_800E0E8 - movs r0, 0 - movs r1, 0 - bl sub_800DFB4 -_0807B110: - ldr r0, =sub_807EA2C - bl SetMainCallback2 -_0807B116: - bl RunActiveTasks - bl RunTextPrinters - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807AE50 - - thumb_func_start sub_807B140 -sub_807B140: @ 807B140 - push {lr} - movs r0, 0x5 - bl sub_807B62C - movs r0, 0 - bl sub_807B62C - pop {r0} - bx r0 - thumb_func_end sub_807B140 - - thumb_func_start sub_807B154 -sub_807B154: @ 807B154 - push {lr} - movs r0, 0 - movs r1, 0xFF - bl FillWindowPixelBuffer - movs r0, 0 - bl PutWindowTilemap - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - pop {r0} - bx r0 - thumb_func_end sub_807B154 - - thumb_func_start sub_807B170 -sub_807B170: @ 807B170 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - sub sp, 0x4 - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_08339014 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r5, 0x80 - lsls r5, 4 - adds r0, r5, 0 - bl Alloc - adds r1, r0, 0 - movs r0, 0 - bl SetBgTilemapBuffer - adds r0, r5, 0 - bl Alloc - adds r1, r0, 0 - movs r0, 0x1 - bl SetBgTilemapBuffer - adds r0, r5, 0 - bl Alloc - adds r1, r0, 0 - movs r0, 0x3 - bl SetBgTilemapBuffer - bl DeactivateAllTextPrinters - ldr r0, =gUnknown_08C00000 - mov r10, r0 - movs r0, 0 - mov r9, r0 - str r0, [sp] - mov r1, r10 - movs r2, 0 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r0, =gUnknown_08C00524 - mov r8, r0 - ldr r4, =0x0201c000 - adds r1, r4, 0 - bl LZDecompressWram - movs r0, 0 - adds r1, r4, 0 - adds r2, r5, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - ldr r6, =gUnknown_08C004E0 - adds r0, r6, 0 - movs r1, 0 - movs r2, 0x20 - bl decompress_palette - ldr r0, =gUnknown_08338FFC - bl InitWindows - mov r0, r9 - str r0, [sp] - movs r0, 0 - mov r1, r10 - movs r2, 0 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - mov r0, r8 - adds r1, r4, 0 - bl LZDecompressWram - movs r0, 0 - adds r1, r4, 0 - adds r2, r5, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - adds r0, r6, 0 - movs r1, 0 - movs r2, 0x20 - bl decompress_palette - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807B170 - - thumb_func_start sub_807B270 -sub_807B270: @ 807B270 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0xC - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0xC - bls _0807B288 - b _0807B43E -_0807B288: - lsls r0, 2 - ldr r1, =_0807B29C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0807B29C: - .4byte _0807B2D0 - .4byte _0807B43E - .4byte _0807B43E - .4byte _0807B43E - .4byte _0807B43E - .4byte _0807B3AC - .4byte _0807B3B6 - .4byte _0807B3C0 - .4byte _0807B3D0 - .4byte _0807B3F0 - .4byte _0807B40C - .4byte _0807B414 - .4byte _0807B438 -_0807B2D0: - ldr r1, =0x02032298 - ldr r0, =0x020375e2 - ldrh r0, [r0] - movs r6, 0 - strb r0, [r1] - movs r0, 0x6 - strb r0, [r1, 0x1] - ldr r4, =0x020229f0 - ldr r0, =0x03005d90 - ldr r1, [r0] - adds r0, r4, 0 - bl CopyString - ldr r5, =0x02024744 - adds r0, r5, 0 - movs r1, 0x7 - mov r2, sp - bl pokemon_getattr - adds r0, r4, 0 - adds r0, 0x1C - mov r1, sp - bl CopyString - subs r4, 0x8 - movs r0, 0 - mov r8, r0 - movs r0, 0x2 - strh r0, [r4, 0x1A] - adds r0, r5, 0 - movs r1, 0x3 - bl pokemon_getattr - strh r0, [r4, 0x36] - ldr r4, =0x020322a0 - movs r5, 0x80 - lsls r5, 1 - adds r0, r5, 0 - bl AllocZeroed - str r0, [r4] - bl init_uns_table_pokemon_copy - bl clear_tasks - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - ldr r0, =sub_807AC24 - bl SetVBlankCallback - bl sub_807B170 - ldr r0, [r4] - adds r0, 0xEE - mov r1, r8 - strb r1, [r0] - ldr r2, [r4] - adds r0, r2, 0 - adds r0, 0x8C - strh r6, [r0] - adds r0, 0x8 - strh r6, [r0] - adds r0, 0x40 - movs r1, 0x40 - strh r1, [r0] - adds r0, 0x2 - strh r1, [r0] - adds r0, 0x2 - strh r6, [r0] - adds r0, 0x2 - strh r6, [r0] - adds r1, r2, 0 - adds r1, 0xDC - movs r0, 0x78 - strh r0, [r1] - adds r1, 0x2 - movs r0, 0x50 - strh r0, [r1] - adds r0, r2, 0 - adds r0, 0xE8 - strh r5, [r0] - adds r0, 0x4 - strh r6, [r0] - str r6, [r2, 0x64] - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r1, 0x5 - strb r1, [r0] - b _0807B43E - .pool -_0807B3AC: - movs r0, 0 - movs r1, 0 - bl sub_807ACFC - b _0807B424 -_0807B3B6: - movs r0, 0 - movs r1, 0x1 - bl sub_807ACFC - b _0807B424 -_0807B3C0: - movs r0, 0x1 - movs r1, 0 - bl sub_807ACFC - movs r0, 0 - bl ShowBg - b _0807B424 -_0807B3D0: - movs r0, 0x1 - movs r1, 0x1 - bl sub_807ACFC - movs r0, 0 - movs r1, 0xFF - bl FillWindowPixelBuffer - movs r0, 0 - bl PutWindowTilemap - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - b _0807B424 -_0807B3F0: - bl sub_807BA94 - ldr r0, =gUnknown_08338D18 - bl LoadObjectPic - ldr r0, =gUnknown_08338D20 - bl LoadTaggedObjectPalette - b _0807B424 - .pool -_0807B40C: - movs r0, 0 - bl ShowBg - b _0807B424 -_0807B414: - movs r0, 0x5 - bl sub_807B62C - movs r0, 0 - bl sub_807B62C - bl sub_807BAD8 -_0807B424: - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0807B43E - .pool -_0807B438: - ldr r0, =sub_807B60C - bl SetMainCallback2 -_0807B43E: - bl RunActiveTasks - bl RunTextPrinters - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807B270 - - thumb_func_start sub_807B464 -sub_807B464: @ 807B464 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _0807B4B8 - adds r0, r5, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0 - movs r2, 0 - bl pokemon_getattr - adds r5, r0, 0 - adds r0, r4, 0 - bl SpeciesToNationalPokedexNum - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r4, 0 - movs r1, 0x2 - bl pokedex_flag_operation - adds r0, r4, 0 - movs r1, 0x3 - adds r2, r5, 0 - bl SetPokedexFlag -_0807B4B8: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807B464 - - thumb_func_start sub_807B4C4 -sub_807B4C4: @ 807B4C4 - push {lr} - bl link_get_multiplayer_id - pop {r0} - bx r0 - thumb_func_end sub_807B4C4 - - thumb_func_start sub_807B4D0 -sub_807B4D0: @ 807B4D0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r4, 24 - lsrs r4, 24 - movs r5, 0x64 - mov r1, r9 - muls r1, r5 - ldr r0, =0x020244ec - adds r7, r1, r0 - adds r0, r7, 0 - movs r1, 0x40 - bl pokemon_getattr - lsls r0, 16 - lsrs r6, r0, 16 - adds r1, r4, 0 - muls r1, r5 - ldr r0, =0x02024744 - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x40 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - cmp r6, 0xFF - beq _0807B52A - ldr r0, =0x03005d8c - lsls r1, r6, 3 - adds r1, r6 - lsls r1, 2 - ldr r2, =0x00002be0 - adds r1, r2 - ldr r0, [r0] - adds r0, r1 - bl sub_80D439C -_0807B52A: - ldr r4, =0x020322a0 - ldr r0, [r4] - adds r1, r7, 0 - movs r2, 0x64 - bl memcpy - adds r0, r7, 0 - adds r1, r5, 0 - movs r2, 0x64 - bl memcpy - ldr r1, [r4] - adds r0, r5, 0 - movs r2, 0x64 - bl memcpy - movs r1, 0x46 - mov r0, sp - strb r1, [r0] - adds r0, r7, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _0807B566 - adds r0, r7, 0 - movs r1, 0x20 - mov r2, sp - bl pokemon_setattr -_0807B566: - mov r0, r8 - cmp r0, 0xFF - beq _0807B57C - lsls r1, r0, 3 - add r1, r8 - lsls r1, 2 - ldr r0, =0x020321c0 - adds r1, r0 - adds r0, r7, 0 - bl sub_80D460C -_0807B57C: - mov r0, r9 - bl sub_807B464 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _0807B58E - bl sub_807B4C4 -_0807B58E: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807B4D0 - - thumb_func_start sub_807B5B8 -sub_807B5B8: @ 807B5B8 - push {r4,lr} - ldr r4, =0x020322a0 - ldr r0, [r4] - adds r0, 0x93 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0807B5D0 - cmp r0, 0x2 - beq _0807B5F6 - b _0807B600 - .pool -_0807B5D0: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _0807B5F6 - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, [r4] - adds r1, 0x74 - movs r2, 0x14 - bl link_0800A448 - ldr r1, [r4] - adds r1, 0x93 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_0807B5F6: - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0x93 - movs r1, 0 - strb r1, [r0] -_0807B600: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807B5B8 - - thumb_func_start sub_807B60C -sub_807B60C: @ 807B60C - push {lr} - bl sub_807BBC8 - bl RunActiveTasks - bl RunTextPrinters - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_807B60C - - thumb_func_start sub_807B62C -sub_807B62C: @ 807B62C - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x7 - bls _0807B638 - b _0807BA68 -_0807B638: - lsls r0, 2 - ldr r1, =_0807B648 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0807B648: - .4byte _0807B668 - .4byte _0807B6DC - .4byte _0807B784 - .4byte _0807B7F8 - .4byte _0807B840 - .4byte _0807B90C - .4byte _0807B924 - .4byte _0807B9FC -_0807B668: - ldr r0, =0x020322a0 - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0xE4 - movs r0, 0 - strh r0, [r2] - adds r1, 0xE6 - movs r0, 0xB4 - strh r0, [r1] - movs r1, 0xAA - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - ldr r1, =0x00005206 - movs r0, 0xC - bl SetGpuReg - ldr r0, =gUnknown_08DD7300 - movs r1, 0x10 - movs r2, 0x60 - bl gpu_pal_apply - ldr r3, =gUnknown_08DD7360 - ldr r4, =0x06004000 - movs r5, 0xA1 - lsls r5, 5 - ldr r1, =0x040000d4 - ldr r6, =0x80000800 - movs r2, 0x80 - lsls r2, 5 - movs r7, 0x80 - lsls r7, 24 -_0807B6AA: - str r3, [r1] - str r4, [r1, 0x4] - str r6, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r3, r2 - adds r4, r2 - subs r5, r2 - cmp r5, r2 - bhi _0807B6AA - b _0807BA4C - .pool -_0807B6DC: - ldr r4, =0x020322a0 - ldr r2, [r4] - adds r1, r2, 0 - adds r1, 0xE2 - movs r0, 0 - strh r0, [r1] - adds r2, 0xE0 - movs r1, 0xAE - lsls r1, 1 - strh r1, [r2] - movs r0, 0x16 - bl SetGpuReg - ldr r1, =0x00008502 - movs r0, 0xA - bl SetGpuReg - ldr r1, =0x00009206 - movs r0, 0xC - bl SetGpuReg - ldr r0, [r4] - adds r0, 0xFA - ldrb r0, [r0] - cmp r0, 0 - beq _0807B724 - ldr r1, =gUnknown_083369A0 - b _0807B726 - .pool -_0807B724: - ldr r1, =gUnknown_083359A0 -_0807B726: - ldr r2, =0x06002800 - ldr r0, =0x040000d4 - str r1, [r0] - str r2, [r0, 0x4] - ldr r1, =0x80000800 - str r1, [r0, 0x8] - ldr r0, [r0, 0x8] - ldr r3, =gUnknown_08DD7360 - movs r4, 0xC0 - lsls r4, 19 - movs r5, 0xA1 - lsls r5, 5 - ldr r1, =0x040000d4 - ldr r6, =0x80000800 - movs r2, 0x80 - lsls r2, 5 - movs r7, 0x80 - lsls r7, 24 -_0807B74A: - str r3, [r1] - str r4, [r1, 0x4] - str r6, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r3, r2 - adds r4, r2 - subs r5, r2 - cmp r5, r2 - bhi _0807B74A - str r3, [r1] - str r4, [r1, 0x4] - lsrs r0, r5, 1 - orrs r0, r7 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - movs r1, 0x92 - lsls r1, 5 - b _0807B820 - .pool -_0807B784: - ldr r0, =0x020322a0 - ldr r2, [r0] - adds r0, r2, 0 - adds r0, 0xE0 - movs r1, 0 - strh r1, [r0] - adds r0, 0x2 - strh r1, [r0] - adds r0, 0x18 - ldrb r0, [r0] - cmp r0, 0 - bne _0807B7C0 - ldr r1, =0x00001241 - movs r0, 0 - bl SetGpuReg - ldr r0, =gUnknown_083379A0 - ldr r1, =0x06002800 - bl LZ77UnCompVram - movs r0, 0x8 - b _0807B7DA - .pool -_0807B7C0: - ldr r1, =0x00001241 - movs r0, 0 - bl SetGpuReg - ldr r1, =gUnknown_0832FFC0 - ldr r2, =0x06002800 - ldr r0, =0x040000d4 - str r1, [r0] - str r2, [r0, 0x4] - ldr r1, =0x80000400 - str r1, [r0, 0x8] - ldr r0, [r0, 0x8] - movs r0, 0x1 -_0807B7DA: - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - b _0807BA68 - .pool -_0807B7F8: - ldr r0, =gUnknown_08337EA0 - movs r1, 0x30 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =gUnknown_08337EC0 - ldr r1, =0x06004000 - bl LZ77UnCompVram - ldr r0, =gUnknown_08338550 - ldr r1, =0x06009000 - bl LZ77UnCompVram - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0xE4 - movs r1, 0x50 - strh r1, [r0] - movs r1, 0xB2 - lsls r1, 5 -_0807B820: - movs r0, 0 - bl SetGpuReg - b _0807BA68 - .pool -_0807B840: - ldr r1, =0x00001441 - movs r0, 0 - bl SetGpuReg - ldr r1, =0x00001287 - movs r0, 0xC - bl SetGpuReg - ldr r0, =0x020322a0 - ldr r3, [r0] - adds r1, r3, 0 - adds r1, 0xD4 - movs r2, 0 - movs r0, 0x40 - strh r0, [r1] - adds r1, 0x2 - movs r0, 0x5C - strh r0, [r1] - adds r1, 0x12 - movs r0, 0x20 - strh r0, [r1] - adds r1, 0x2 - movs r0, 0x80 - lsls r0, 3 - strh r0, [r1] - adds r0, r3, 0 - adds r0, 0xEC - strh r2, [r0] - ldr r3, =gUnknown_08332F60 - ldr r4, =0x06004000 - movs r5, 0xA1 - lsls r5, 6 - ldr r1, =0x040000d4 - ldr r6, =0x80000800 - movs r2, 0x80 - lsls r2, 5 - movs r7, 0x80 - lsls r7, 24 -_0807B88C: - str r3, [r1] - str r4, [r1, 0x4] - str r6, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r3, r2 - adds r4, r2 - subs r5, r2 - cmp r5, r2 - bhi _0807B88C - str r3, [r1] - str r4, [r1, 0x4] - lsrs r0, r5, 1 - orrs r0, r7 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0xFA - ldrb r0, [r0] - cmp r0, 0 - beq _0807B8EC - ldr r1, =gUnknown_083357A0 - ldr r2, =0x06009000 - ldr r0, =0x040000d4 - str r1, [r0] - str r2, [r0, 0x4] - ldr r1, =0x80000080 - b _0807BA64 - .pool -_0807B8EC: - ldr r1, =gUnknown_083358A0 - ldr r2, =0x06009000 - ldr r0, =0x040000d4 - str r1, [r0] - str r2, [r0, 0x4] - ldr r1, =0x80000080 - b _0807BA64 - .pool -_0807B90C: - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0xE0 - movs r2, 0 - strh r2, [r1] - adds r0, 0xE2 - strh r2, [r0] - b _0807BA68 - .pool -_0807B924: - ldr r1, =0x00001441 - movs r0, 0 - bl SetGpuReg - ldr r1, =0x00001287 - movs r0, 0xC - bl SetGpuReg - ldr r0, =0x020322a0 - ldr r3, [r0] - adds r1, r3, 0 - adds r1, 0xD4 - movs r2, 0 - movs r0, 0x40 - strh r0, [r1] - adds r1, 0x2 - movs r0, 0x5C - strh r0, [r1] - adds r1, 0x12 - adds r0, 0xA4 - strh r0, [r1] - adds r1, 0x2 - movs r0, 0x80 - strh r0, [r1] - subs r1, 0xE - movs r0, 0x78 - strh r0, [r1] - adds r1, 0x2 - movs r0, 0x50 - strh r0, [r1] - adds r0, r3, 0 - adds r0, 0xEC - strh r2, [r0] - ldr r3, =gUnknown_08332F60 - ldr r4, =0x06004000 - movs r5, 0xA1 - lsls r5, 6 - ldr r1, =0x040000d4 - ldr r6, =0x80000800 - movs r2, 0x80 - lsls r2, 5 - movs r7, 0x80 - lsls r7, 24 -_0807B97A: - str r3, [r1] - str r4, [r1, 0x4] - str r6, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r3, r2 - adds r4, r2 - subs r5, r2 - cmp r5, r2 - bhi _0807B97A - str r3, [r1] - str r4, [r1, 0x4] - lsrs r0, r5, 1 - orrs r0, r7 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0xFA - ldrb r0, [r0] - cmp r0, 0 - beq _0807B9DC - ldr r1, =gUnknown_083357A0 - ldr r2, =0x06009000 - ldr r0, =0x040000d4 - str r1, [r0] - str r2, [r0, 0x4] - ldr r1, =0x80000080 - b _0807BA64 - .pool -_0807B9DC: - ldr r1, =gUnknown_083358A0 - ldr r2, =0x06009000 - ldr r0, =0x040000d4 - str r1, [r0] - str r2, [r0, 0x4] - ldr r1, =0x80000080 - b _0807BA64 - .pool -_0807B9FC: - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0xE4 - movs r2, 0 - strh r2, [r1] - adds r0, 0xE6 - strh r2, [r0] - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - ldr r1, =0x00005206 - movs r0, 0xC - bl SetGpuReg - ldr r0, =gUnknown_08DD7300 - movs r1, 0x10 - movs r2, 0x60 - bl gpu_pal_apply - ldr r3, =gUnknown_08DD7360 - ldr r4, =0x06004000 - movs r5, 0xA1 - lsls r5, 5 - ldr r1, =0x040000d4 - ldr r6, =0x80000800 - movs r2, 0x80 - lsls r2, 5 - movs r7, 0x80 - lsls r7, 24 -_0807BA3A: - str r3, [r1] - str r4, [r1, 0x4] - str r6, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r3, r2 - adds r4, r2 - subs r5, r2 - cmp r5, r2 - bhi _0807BA3A -_0807BA4C: - str r3, [r1] - str r4, [r1, 0x4] - lsrs r0, r5, 1 - orrs r0, r7 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - ldr r1, =gUnknown_08331F60 - ldr r2, =0x06009000 - ldr r0, =0x040000d4 - str r1, [r0] - str r2, [r0, 0x4] - ldr r1, =0x80000800 -_0807BA64: - str r1, [r0, 0x8] - ldr r0, [r0, 0x8] -_0807BA68: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807B62C - - thumb_func_start sub_807BA94 -sub_807BA94: @ 807BA94 - push {lr} - ldr r0, =gUnknown_08338D70 - bl LoadObjectPic - ldr r0, =gUnknown_08338DC0 - bl LoadObjectPic - ldr r0, =gUnknown_08338DF4 - bl LoadObjectPic - ldr r0, =gUnknown_08338E6C - bl LoadObjectPic - ldr r0, =gUnknown_08338D78 - bl LoadTaggedObjectPalette - ldr r0, =gUnknown_08338D80 - bl LoadTaggedObjectPalette - pop {r0} - bx r0 - .pool - thumb_func_end sub_807BA94 - - thumb_func_start sub_807BAD8 -sub_807BAD8: @ 807BAD8 - push {r4,r5,lr} - sub sp, 0x14 - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0xEE - ldrb r0, [r0] - cmp r0, 0 - beq _0807BB68 - bl link_get_multiplayer_id - lsls r0, 24 - ldr r3, =0x02021cc4 - movs r2, 0x80 - lsls r2, 17 - eors r2, r0 - lsrs r2, 24 - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - ldr r0, =0x020229f0 - adds r1, r0 - adds r0, r3, 0 - bl CopyString - ldr r5, =0x02032298 - ldrb r0, [r5, 0x1] - movs r1, 0x6 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - movs r4, 0x64 - muls r0, r4 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - ldr r0, =0x02021ec4 - mov r1, sp - bl CopyString_Limit10 - ldrb r0, [r5] - muls r0, r4 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - ldr r0, =0x02021dc4 - mov r1, sp - bl CopyString_Limit10 - b _0807BBA4 - .pool -_0807BB68: - ldr r0, =0x020375e0 - ldrh r0, [r0] - lsls r4, r0, 4 - subs r4, r0 - lsls r4, 2 - ldr r0, =gUnknown_08338ED0 - adds r4, r0 - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x2B - bl CopyString - ldr r0, =0x02021ec4 - adds r1, r4, 0 - bl CopyString_Limit10 - ldr r0, =0x020375e2 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - ldr r0, =0x02021dc4 - mov r1, sp - bl CopyString_Limit10 -_0807BBA4: - add sp, 0x14 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807BAD8 - - thumb_func_start sub_807BBC8 -sub_807BBC8: @ 807BBC8 - push {lr} - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0xFA - ldrb r0, [r0] - cmp r0, 0 - bne _0807BBE0 - bl sub_807CFC8 - b _0807BBE4 - .pool -_0807BBE0: - bl sub_807BBEC -_0807BBE4: - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_807BBC8 - - thumb_func_start sub_807BBEC -sub_807BBEC: @ 807BBEC - push {r4-r7,lr} - sub sp, 0x14 - ldr r0, =0x020322a0 - ldr r1, [r0] - adds r1, 0x94 - ldrh r5, [r1] - ldr r1, =0x0000010b - adds r7, r0, 0 - cmp r5, r1 - bls _0807BC04 - bl _0807CFB4 -_0807BC04: - lsls r0, r5, 2 - ldr r1, =_0807BC1C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0807BC1C: - .4byte _0807C04C - .4byte _0807C0C4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807C120 - .4byte _0807C168 - .4byte _0807C1DC - .4byte _0807CFB4 - .4byte _0807C248 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807C26C - .4byte _0807C29C - .4byte _0807C2AE - .4byte _0807C2D0 - .4byte _0807C318 - .4byte _0807C348 - .4byte _0807C390 - .4byte _0807C3E0 - .4byte _0807C434 - .4byte _0807C4B8 - .4byte _0807C4DC - .4byte _0807C528 - .4byte _0807C574 - .4byte _0807C5D0 - .4byte _0807C630 - .4byte _0807C644 - .4byte _0807C658 - .4byte _0807C66C - .4byte _0807C794 - .4byte _0807C864 - .4byte _0807C8EC - .4byte _0807C964 - .4byte _0807C974 - .4byte _0807C994 - .4byte _0807C9E4 - .4byte _0807CA02 - .4byte _0807CA40 - .4byte _0807CA50 - .4byte _0807CAC8 - .4byte _0807CFB4 - .4byte _0807CAF0 - .4byte _0807CB30 - .4byte _0807CB70 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CB90 - .4byte _0807CBB8 - .4byte _0807CBD4 - .4byte _0807CBF4 - .4byte _0807CC9C - .4byte _0807CCD0 - .4byte _0807CD1C - .4byte _0807CDDC - .4byte _0807CE54 - .4byte _0807CEA0 - .4byte _0807CEB0 - .4byte _0807CEB6 - .4byte _0807CEDC - .4byte _0807CF38 - .4byte _0807CF5C - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CE18 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807C460 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CE38 -_0807C04C: - ldr r3, =0x02020630 - ldr r0, [r7] - adds r0, 0x8E - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - ldr r4, [r7] - adds r2, r4, 0 - adds r2, 0x8E - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldr r1, =0x0000ff4c - strh r1, [r0, 0x24] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldr r2, =gUnknown_08300D38 - adds r0, r4, 0 - adds r0, 0xF0 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - strh r0, [r1, 0x26] - adds r1, r4, 0 - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - bl current_map_music_get - ldr r1, [r7] - adds r1, 0xF4 - strh r0, [r1] - ldr r0, =0x00000179 - bl current_map_music_set - bl _0807CFB4 - .pool -_0807C0C4: - ldr r5, [r7] - adds r6, r5, 0 - adds r6, 0xE6 - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0 - ble _0807C0F8 - ldr r2, =0x02020630 - adds r0, r5, 0 - adds r0, 0x8E - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x24] - adds r1, 0x3 - strh r1, [r0, 0x24] - ldrh r0, [r6] - subs r0, 0x3 - strh r0, [r6] - bl _0807CFB4 - .pool -_0807C0F8: - ldr r2, =0x02020630 - adds r0, r5, 0 - adds r0, 0x8E - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strh r1, [r0, 0x24] - strh r1, [r6] - adds r1, r5, 0 - adds r1, 0x94 - movs r0, 0xA - strh r0, [r1] - bl _0807CFB4 - .pool -_0807C120: - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EE942 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0 - adds r1, r4, 0 - movs r2, 0 - bl sub_807F1A8 - ldr r4, =0x020322a0 - ldr r0, [r4] - adds r2, r0, 0 - adds r2, 0xF0 - ldrh r1, [r2] - movs r0, 0xCE - lsls r0, 1 - cmp r1, r0 - beq _0807C14E - adds r0, r1, 0 - movs r1, 0 - bl cry_related -_0807C14E: - ldr r3, [r4] - adds r1, r3, 0 - adds r1, 0x94 - movs r2, 0 - movs r0, 0xB - bl _0807CE06 - .pool -_0807C168: - ldr r1, [r7] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0x50 - beq _0807C178 - bl _0807CFB4 -_0807C178: - adds r0, r1, 0 - adds r0, 0x8E - ldrb r0, [r0] - ldr r2, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r1, [r1, 0x5] - lsrs r1, 4 - movs r2, 0x2 - str r2, [sp] - movs r2, 0x1 - str r2, [sp, 0x4] - movs r2, 0x14 - str r2, [sp, 0x8] - ldr r2, =0x000fffff - str r2, [sp, 0xC] - movs r2, 0x78 - movs r3, 0x20 - bl sub_807671C - ldr r1, [r7] - adds r1, 0xD2 - strb r0, [r1] - ldr r1, [r7] - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EE959 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0 - adds r1, r4, 0 - movs r2, 0 - bl sub_807F1A8 - bl _0807CFB4 - .pool -_0807C1DC: - ldr r5, =0x02020630 - ldr r0, [r7] - adds r0, 0xD2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, r5, 0 - adds r4, 0x1C - adds r0, r4 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - beq _0807C1FC - bl _0807CFB4 -_0807C1FC: - ldr r0, =gUnknown_08338D28 - movs r1, 0x78 - movs r2, 0x20 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r7] - adds r1, 0xD3 - strb r0, [r1] - ldr r2, [r7] - adds r0, r2, 0 - adds r0, 0xD3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_807E5D8 - str r1, [r0] - adds r2, 0xD2 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl RemoveObjectAndFreeTiles - ldr r1, [r7] - bl _0807CF4C - .pool -_0807C248: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0x94 - movs r1, 0x14 - strh r1, [r0] - bl _0807CFB4 - .pool -_0807C26C: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0807C27C - bl _0807CFB4 -_0807C27C: - movs r0, 0x4 - bl sub_807B62C - movs r0, 0 - movs r1, 0xFF - bl FillWindowPixelBuffer - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - bl _0807CF48 - .pool -_0807C29C: - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - str r0, [sp] - adds r0, r1, 0 - movs r2, 0x10 - movs r3, 0 - bl _0807CF44 -_0807C2AE: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0807C2BE - bl _0807CFB4 -_0807C2BE: - ldr r0, [r7] - adds r0, 0x94 - movs r1, 0x17 - strh r1, [r0] - bl _0807CFB4 - .pool -_0807C2D0: - ldr r4, =0x020322a0 - ldr r0, [r4] - adds r2, r0, 0 - adds r2, 0xEA - ldrh r1, [r2] - movs r0, 0x80 - lsls r0, 1 - cmp r1, r0 - bls _0807C2F0 - adds r0, r1, 0 - subs r0, 0x34 - strh r0, [r2] - b _0807C30C - .pool -_0807C2F0: - movs r0, 0x1 - bl sub_807B62C - ldr r3, [r4] - adds r1, r3, 0 - adds r1, 0xEA - movs r2, 0 - movs r0, 0x80 - strh r0, [r1] - subs r1, 0x56 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - str r2, [r3, 0x64] -_0807C30C: - ldr r0, =0x020322a0 - ldr r4, [r0] - bl _0807CB5C - .pool -_0807C318: - ldr r1, [r7] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0x14 - bhi _0807C328 - bl _0807CFB4 -_0807C328: - bl sub_807AB28 - ldr r0, =gUnknown_08338E74 - movs r1, 0x78 - movs r2, 0x50 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r7] - adds r1, 0x91 - strb r0, [r1] - ldr r1, [r7] - bl _0807CF4C - .pool -_0807C348: - ldr r2, =0x02020630 - ldr r0, [r7] - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - adds r0, r1, 0 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 27 - cmp r0, 0 - blt _0807C368 - bl _0807CFB4 -_0807C368: - adds r0, r1, 0 - bl RemoveObjectAndFreeTiles - movs r1, 0xC8 - lsls r1, 3 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x0000040c - movs r0, 0x52 - bl SetGpuReg - ldr r1, [r7] - bl _0807CF4C - .pool -_0807C390: - ldr r2, [r7] - adds r0, r2, 0 - adds r0, 0xE0 - ldrh r1, [r0] - subs r1, 0x1 - strh r1, [r0] - lsls r1, 16 - movs r0, 0x9E - lsls r0, 17 - cmp r1, r0 - bne _0807C3B0 - adds r1, r2, 0 - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_0807C3B0: - ldr r0, [r7] - adds r0, 0xE0 - movs r2, 0 - ldrsh r1, [r0, r2] - movs r0, 0xA4 - lsls r0, 1 - cmp r1, r0 - beq _0807C3C4 - bl _0807CFB4 -_0807C3C4: - ldr r0, =gUnknown_08338DFC - movs r1, 0x80 - movs r2, 0x41 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r7] - adds r1, 0x92 - strb r0, [r1] - bl _0807CFB4 - .pool -_0807C3E0: - ldr r0, =gUnknown_08338D88 - movs r1, 0x80 - movs r2, 0x50 - movs r3, 0x3 - bl AddObjectToFront - ldr r4, =0x020322a0 - ldr r1, [r4] - adds r1, 0x90 - strb r0, [r1] - ldr r0, =gUnknown_08338DC8 - movs r1, 0x80 - movs r2, 0x50 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r4] - adds r1, 0x91 - strb r0, [r1] - ldr r0, [r4] - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r1, 0x1 - bl StartObjectImageAnim - ldr r1, [r4] - bl _0807CF4C - .pool -_0807C434: - ldr r2, [r7] - adds r1, r2, 0 - adds r1, 0xE0 - ldrh r0, [r1] - subs r0, 0x2 - strh r0, [r1] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA6 - bne _0807C44E - subs r1, 0x4C - movs r0, 0xC8 - strh r0, [r1] -_0807C44E: - ldr r1, =0x00001241 - movs r0, 0 - bl SetGpuReg - bl _0807CFB4 - .pool -_0807C460: - ldr r2, =0x02020630 - ldr r4, [r7] - adds r3, r4, 0 - adds r3, 0x90 - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x22] - subs r1, 0x2 - strh r1, [r0, 0x22] - adds r0, r4, 0 - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x22] - subs r1, 0x2 - strh r1, [r0, 0x22] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r3, 0x22 - ldrsh r1, [r0, r3] - movs r0, 0x8 - negs r0, r0 - cmp r1, r0 - blt _0807C4A6 - bl _0807CFB4 -_0807C4A6: - adds r1, r4, 0 - adds r1, 0x94 - movs r0, 0x1D - strh r0, [r1] - bl _0807CFB4 - .pool -_0807C4B8: - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - str r0, [sp] - adds r0, r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0x94 - movs r1, 0x1E - strh r1, [r0] - bl _0807CFB4 - .pool -_0807C4DC: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0807C4EC - bl _0807CFB4 -_0807C4EC: - ldr r0, [r7] - adds r0, 0x90 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r0, [r7] - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - movs r0, 0x2 - bl sub_807B62C - ldr r1, [r7] - bl _0807CF4C - .pool -_0807C528: - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - str r0, [sp] - adds r0, r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r5, =gUnknown_08338DC8 - adds r0, r5, 0 - movs r1, 0x6F - movs r2, 0xAA - movs r3, 0 - bl AddObjectToFront - ldr r4, =0x020322a0 - ldr r1, [r4] - adds r1, 0x90 - strb r0, [r1] - movs r2, 0xA - negs r2, r2 - adds r0, r5, 0 - movs r1, 0x81 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r4] - adds r1, 0x91 - strb r0, [r1] - ldr r1, [r4] - bl _0807CF4C - .pool -_0807C574: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0807C592 - movs r0, 0x2E - bl audio_play - ldr r0, =0x020322a0 - ldr r1, [r0] - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_0807C592: - ldr r3, =0x02020630 - ldr r0, =0x020322a0 - ldr r2, [r0] - adds r0, r2, 0 - adds r0, 0x90 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x26] - subs r1, 0x3 - strh r1, [r0, 0x26] - adds r2, 0x91 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x26] - adds r1, 0x3 - strh r1, [r0, 0x26] - bl _0807CFB4 - .pool -_0807C5D0: - ldr r5, =0x02020630 - ldr r4, [r7] - adds r2, r4, 0 - adds r2, 0x90 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrh r1, [r0, 0x26] - subs r1, 0x3 - strh r1, [r0, 0x26] - adds r6, r4, 0 - adds r6, 0x91 - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrh r1, [r0, 0x26] - adds r1, 0x3 - strh r1, [r0, 0x26] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r3, r0, r5 - movs r0, 0x26 - ldrsh r1, [r3, r0] - movs r0, 0x5A - negs r0, r0 - cmp r1, r0 - ble _0807C616 - bl _0807CFB4 -_0807C616: - movs r2, 0x1 - strh r2, [r3, 0x30] - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x30] - adds r1, r4, 0 - bl _0807CF4C - .pool -_0807C630: - ldr r2, =0x0000ffff - movs r0, 0x1 - movs r1, 0x10 - bl sub_80A2A20 - bl _0807CF48 - .pool -_0807C644: - ldr r2, =0x0000ffff - movs r0, 0x1 - movs r1, 0 - bl sub_80A2A20 - bl _0807CF48 - .pool -_0807C658: - ldr r2, =0x0000ffff - movs r0, 0x1 - movs r1, 0x10 - bl sub_80A2A20 - bl _0807CF48 - .pool -_0807C66C: - ldr r5, =0x020322a0 - ldr r0, [r5] - adds r0, 0xF0 - ldrh r0, [r0] - bl sub_806E840 - lsls r0, 24 - cmp r0, 0 - bne _0807C6E4 - ldr r4, =0x02020630 - ldr r2, [r5] - adds r2, 0x8E - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x10 - adds r0, r1 - ldr r1, =gUnknown_08338ECC - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0, 0x1] - movs r2, 0x3 - orrs r1, r2 - strb r1, [r0, 0x1] - ldr r0, [r5] - adds r0, 0x8E - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0 - movs r2, 0x3 - movs r3, 0x3 - bl CalcVecFromObjectCenterToObjectUpperLeft - ldr r0, [r5] - adds r0, 0x8E - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0 - bl StartObjectRotScalAnim - b _0807C6FA - .pool -_0807C6E4: - ldr r0, [r5] - adds r0, 0x8E - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r1, 0 - bl StartObjectRotScalAnim -_0807C6FA: - ldr r5, =0x020322a0 - ldr r0, [r5] - adds r0, 0x8F - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - movs r1, 0 - bl StartObjectRotScalAnim - ldr r2, [r5] - adds r3, r2, 0 - adds r3, 0x8E - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x3C - strh r1, [r0, 0x20] - adds r2, 0x8F - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xB4 - strh r1, [r0, 0x20] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xC0 - strh r1, [r0, 0x22] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =0x0000ffe0 - strh r1, [r0, 0x22] - ldrb r0, [r3] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - ldr r0, [r5] - adds r0, 0x8F - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - ldr r1, [r5] - bl _0807CF4C - .pool -_0807C794: - ldr r4, =0x02020630 - ldr r2, [r7] - adds r3, r2, 0 - adds r3, 0x8E - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x26] - subs r1, 0x3 - movs r5, 0 - strh r1, [r0, 0x26] - adds r2, 0x8F - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x26] - adds r1, 0x3 - strh r1, [r0, 0x26] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r0, [r0, 0x26] - adds r0, 0xA3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bhi _0807C7DC - movs r0, 0x2D - bl audio_play -_0807C7DC: - ldr r2, [r7] - adds r3, r2, 0 - adds r3, 0x8E - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r6, 0x26 - ldrsh r1, [r0, r6] - movs r0, 0xDE - negs r0, r0 - cmp r1, r0 - blt _0807C7FC - bl _0807CFB4 -_0807C7FC: - adds r0, r2, 0 - adds r0, 0x90 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r5, [r0, 0x30] - adds r0, r2, 0 - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r5, [r0, 0x30] - adds r1, r2, 0 - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r7] - adds r0, 0x8F - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - ldr r2, =0x0000ffff - movs r0, 0x1 - movs r1, 0 - bl sub_80A2A20 - b _0807CFB4 - .pool -_0807C864: - ldr r4, =0x02020630 - ldr r2, [r7] - adds r3, r2, 0 - adds r3, 0x90 - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x26] - subs r1, 0x3 - strh r1, [r0, 0x26] - adds r2, 0x91 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x26] - adds r1, 0x3 - strh r1, [r0, 0x26] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r2, 0x26 - ldrsh r1, [r0, r2] - movs r0, 0xDE - negs r0, r0 - cmp r1, r0 - ble _0807C8A6 - b _0807CFB4 -_0807C8A6: - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - str r0, [sp] - adds r0, r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, [r7] - adds r2, r1, 0 - adds r2, 0x94 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - adds r1, 0x90 - ldrb r1, [r1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r0, [r7] - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - b _0807CFB4 - .pool -_0807C8EC: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0807C8FA - b _0807CFB4 -_0807C8FA: - ldr r1, [r7] - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - movs r0, 0x1 - bl sub_807B62C - ldr r0, [r7] - adds r0, 0xE0 - movs r1, 0xA6 - strh r1, [r0] - ldr r0, =gUnknown_08338D88 - movs r4, 0x14 - negs r4, r4 - movs r1, 0x80 - adds r2, r4, 0 - movs r3, 0x3 - bl AddObjectToFront - ldr r1, [r7] - adds r1, 0x90 - strb r0, [r1] - ldr r0, =gUnknown_08338DC8 - movs r1, 0x80 - adds r2, r4, 0 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r7] - adds r1, 0x91 - strb r0, [r1] - ldr r0, [r7] - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r1, 0x1 - bl StartObjectImageAnim - b _0807CFB4 - .pool -_0807C964: - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - str r0, [sp] - adds r0, r1, 0 - movs r2, 0x10 - movs r3, 0 - b _0807CF44 -_0807C974: - movs r1, 0x92 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0807C98C - b _0807CFB4 -_0807C98C: - b _0807CF48 - .pool -_0807C994: - ldr r2, =0x02020630 - ldr r4, [r7] - adds r3, r4, 0 - adds r3, 0x90 - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x26] - adds r1, 0x3 - strh r1, [r0, 0x26] - adds r0, r4, 0 - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x26] - adds r1, 0x3 - strh r1, [r0, 0x26] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r3, 0x26 - ldrsh r1, [r0, r3] - movs r6, 0x22 - ldrsh r0, [r0, r6] - adds r1, r0 - cmp r1, 0x40 - beq _0807C9DA - b _0807CFB4 -_0807C9DA: - adds r1, r4, 0 - b _0807CF4C - .pool -_0807C9E4: - ldr r1, [r7] - adds r5, r1, 0 - adds r5, 0xE0 - ldrh r0, [r5] - adds r0, 0x2 - strh r0, [r5] - lsls r0, 16 - asrs r0, 16 - movs r6, 0x9E - lsls r6, 1 - cmp r0, r6 - bgt _0807C9FE - b _0807CFB4 -_0807C9FE: - strh r6, [r5] - b _0807CF4C -_0807CA02: - ldr r0, [r7] - adds r0, 0x90 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r0, [r7] - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r3, [r7] - adds r2, r3, 0 - adds r2, 0x94 - ldrh r0, [r2] - adds r0, 0x1 - movs r1, 0 - strh r0, [r2] - str r1, [r3, 0x64] - b _0807CFB4 - .pool -_0807CA40: - ldr r1, [r7] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0xA - beq _0807CA4E - b _0807CFB4 -_0807CA4E: - b _0807CF4C -_0807CA50: - ldr r1, [r7] - adds r2, r1, 0 - adds r2, 0xE0 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - lsls r0, 16 - asrs r0, 16 - movs r3, 0xAE - lsls r3, 1 - cmp r0, r3 - ble _0807CA72 - strh r3, [r2] - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_0807CA72: - ldr r2, [r7] - adds r0, r2, 0 - adds r0, 0xE0 - movs r3, 0 - ldrsh r1, [r0, r3] - movs r0, 0xA4 - lsls r0, 1 - cmp r1, r0 - beq _0807CA86 - b _0807CFB4 -_0807CA86: - adds r0, r2, 0 - adds r0, 0xFA - ldrb r0, [r0] - cmp r0, 0 - bne _0807CA92 - b _0807CFB4 -_0807CA92: - ldr r0, =gUnknown_08338DFC - movs r1, 0x80 - movs r2, 0x41 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r7] - adds r1, 0x92 - strb r0, [r1] - ldr r2, =0x02020630 - ldr r0, [r7] - adds r0, 0x92 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_807AAE0 - str r1, [r0] - b _0807CFB4 - .pool -_0807CAC8: - ldr r0, =gUnknown_08338E74 - movs r1, 0x78 - movs r2, 0x50 - movs r3, 0 - bl AddObjectToFront - ldr r2, =0x020322a0 - ldr r1, [r2] - adds r1, 0x91 - strb r0, [r1] - ldr r0, [r2] - adds r0, 0x94 - movs r1, 0x32 - strh r1, [r0] - b _0807CFB4 - .pool -_0807CAF0: - ldr r2, =0x02020630 - ldr r0, [r7] - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - adds r0, r1, 0 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 27 - cmp r0, 0 - blt _0807CB0E - b _0807CFB4 -_0807CB0E: - adds r0, r1, 0 - bl RemoveObjectAndFreeTiles - movs r0, 0x6 - bl sub_807B62C - ldr r1, [r7] - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - movs r0, 0x9F - bl audio_play - b _0807CFB4 - .pool -_0807CB30: - ldr r1, [r7] - adds r2, r1, 0 - adds r2, 0xEA - ldrh r3, [r2] - ldr r0, =0x000003ff - cmp r3, r0 - bhi _0807CB4C - adds r0, r3, 0 - adds r0, 0x34 - strh r0, [r2] - b _0807CB5A - .pool -_0807CB4C: - movs r0, 0x80 - lsls r0, 3 - strh r0, [r2] - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_0807CB5A: - ldr r4, [r7] -_0807CB5C: - adds r0, r4, 0 - adds r0, 0xEA - ldrh r1, [r0] - movs r0, 0x80 - lsls r0, 8 - bl __divsi3 - adds r4, 0xE8 - strh r0, [r4] - b _0807CFB4 -_0807CB70: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0x94 - movs r1, 0x3C - strh r1, [r0] - b _0807CFB4 - .pool -_0807CB90: - ldr r4, =0x02037fd4 - ldrb r1, [r4, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0807CB9E - b _0807CFB4 -_0807CB9E: - movs r0, 0x5 - bl sub_807B62C - movs r0, 0x7 - bl sub_807B62C - ldrb r0, [r4, 0x8] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r4, 0x8] - b _0807CF48 - .pool -_0807CBB8: - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x8] - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - b _0807CF44 - .pool -_0807CBD4: - movs r1, 0xA2 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0807CBEC - b _0807CFB4 -_0807CBEC: - b _0807CF48 - .pool -_0807CBF4: - ldr r0, =gUnknown_08338D28 - movs r2, 0x8 - negs r2, r2 - movs r1, 0x78 - movs r3, 0 - bl AddObjectToFront - ldr r5, =0x020322a0 - ldr r1, [r5] - adds r1, 0xD3 - movs r6, 0 - strb r0, [r1] - ldr r4, =0x02020630 - ldr r2, [r5] - adds r2, 0xD3 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x4A - strh r1, [r0, 0x34] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_807E6AC - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x1 - bl StartObjectImageAnim - ldr r0, [r5] - adds r0, 0xD3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x2 - bl StartObjectRotScalAnim - ldr r0, [r5] - adds r0, 0xD3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0, 0x5] - lsrs r1, 4 - adds r1, 0x10 - movs r0, 0x1 - lsls r0, r1 - ldr r2, =0x0000ffff - movs r1, 0x10 - bl sub_80A2A20 - ldr r2, [r5] - adds r1, r2, 0 - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - str r6, [r2, 0x64] - b _0807CFB4 - .pool -_0807CC9C: - ldr r2, =0x02020630 - ldr r0, [r7] - adds r0, 0xD3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x5] - lsrs r1, 4 - adds r1, 0x10 - movs r0, 0x1 - lsls r0, r1 - ldr r1, =0x0000ffff - str r1, [sp] - movs r1, 0x1 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r1, [r7] - b _0807CF4C - .pool -_0807CCD0: - ldr r2, =0x02020630 - ldr r3, [r7] - adds r0, r3, 0 - adds r0, 0xD3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - beq _0807CCEE - b _0807CFB4 -_0807CCEE: - adds r0, r3, 0 - adds r0, 0xF2 - ldrh r2, [r0] - lsls r0, r2, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r1, [r1] - ldr r1, [r1, 0x10] - ldr r3, [r3, 0x6C] - bl DecompressMonPic_DetectFrontOrBack_2 - ldr r1, [r7] - b _0807CF4C - .pool -_0807CD1C: - ldr r4, =0x02020630 - ldr r2, [r7] - adds r6, r2, 0 - adds r6, 0x8F - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r5, 0 - movs r1, 0x78 - strh r1, [r0, 0x20] - ldrb r0, [r6] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldr r3, =gUnknown_08300D38 - adds r2, 0xF2 - ldrh r0, [r2] - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x1] - adds r0, 0x3C - strh r0, [r1, 0x22] - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r5, [r0, 0x24] - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r5, [r0, 0x26] - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0 - bl StartObjectImageAnim - ldr r3, [r7] - adds r0, r3, 0 - adds r0, 0x8F - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r1, [r1, 0x5] - lsrs r1, 4 - movs r2, 0x2 - str r2, [sp] - movs r2, 0x1 - str r2, [sp, 0x4] - movs r2, 0x14 - str r2, [sp, 0x8] - ldr r2, =0x000fffff - str r2, [sp, 0xC] - adds r3, 0xF2 - ldrh r2, [r3] - str r2, [sp, 0x10] - movs r2, 0x78 - movs r3, 0x54 - bl sub_8076438 - ldr r0, [r7] - adds r0, 0xD3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl obj_free_rotscale_entry - ldr r0, [r7] - adds r0, 0xD3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r1, [r7] - b _0807CF4C - .pool -_0807CDDC: - movs r1, 0xAA - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EE966 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0 - adds r1, r4, 0 - movs r2, 0 - bl sub_807F1A8 - ldr r0, =0x020322a0 - ldr r3, [r0] - adds r1, r3, 0 - adds r1, 0x94 - movs r2, 0 - movs r0, 0xA7 -_0807CE06: - strh r0, [r1] - str r2, [r3, 0x64] - b _0807CFB4 - .pool -_0807CE18: - ldr r3, [r7] - ldr r0, [r3, 0x64] - adds r0, 0x1 - str r0, [r3, 0x64] - cmp r0, 0x3C - bhi _0807CE26 - b _0807CFB4 -_0807CE26: - adds r0, r3, 0 - adds r0, 0x94 - movs r2, 0 - ldr r1, =0x0000010b - strh r1, [r0] - str r2, [r3, 0x64] - b _0807CFB4 - .pool -_0807CE38: - bl sub_80A3678 - lsls r0, 24 - cmp r0, 0 - bne _0807CE44 - b _0807CFB4 -_0807CE44: - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0x94 - movs r1, 0x44 - strh r1, [r0] - b _0807CFB4 - .pool -_0807CE54: - ldr r1, [r7] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0xA - bne _0807CE66 - ldr r0, =0x00000173 - bl fanfare_play -_0807CE66: - ldr r1, [r7] - ldr r0, [r1, 0x64] - cmp r0, 0xFA - beq _0807CE70 - b _0807CFB4 -_0807CE70: - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - movs r5, 0 - strh r0, [r1] - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EE977 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0 - adds r1, r4, 0 - movs r2, 0 - bl sub_807F1A8 - ldr r0, [r7] - str r5, [r0, 0x64] - b _0807CFB4 - .pool -_0807CEA0: - ldr r1, [r7] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0x3C - beq _0807CEAE - b _0807CFB4 -_0807CEAE: - b _0807CF4C -_0807CEB0: - bl sub_807F14C - b _0807CF48 -_0807CEB6: - ldr r2, [r7] - adds r0, r2, 0 - adds r0, 0xEE - ldrb r0, [r0] - cmp r0, 0 - beq _0807CEC6 - movs r0, 0x1 - b _0807CFB6 -_0807CEC6: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0807CFB4 - adds r1, r2, 0 - b _0807CF4C - .pool -_0807CEDC: - ldr r0, =0x020375e2 - ldrb r0, [r0] - movs r1, 0 - bl sub_807B4D0 - ldr r1, =0x030061e8 - ldr r0, =sub_807B60C - str r0, [r1] - ldr r7, =0x02032298 - ldrb r0, [r7] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x020244ec - adds r0, r5 - movs r1, 0x1 - movs r2, 0 - bl GetEvolutionTargetSpecies - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - beq _0807CF48 - ldrb r3, [r7] - adds r0, r3, 0 - muls r0, r6 - adds r0, r5 - ldr r1, =0x020322a0 - ldr r1, [r1] - adds r1, 0x8F - ldrb r2, [r1] - adds r1, r4, 0 - bl sub_813E1D4 - b _0807CF48 - .pool -_0807CF38: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 -_0807CF44: - bl pal_fade_maybe -_0807CF48: - ldr r0, =0x020322a0 - ldr r1, [r0] -_0807CF4C: - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _0807CFB4 - .pool -_0807CF5C: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _0807CFB4 - ldr r0, [r7] - adds r0, 0xF4 - ldrh r0, [r0] - bl current_map_music_set - ldr r0, [r7] - cmp r0, 0 - beq _0807CFAA - bl FreeAllWindowBuffers - movs r0, 0x3 - bl GetBgTilemapBuffer - bl Free - movs r0, 0x1 - bl GetBgTilemapBuffer - bl Free - movs r0, 0 - bl GetBgTilemapBuffer - bl Free - bl sub_805F094 - ldr r0, [r7] - bl Free - str r4, [r7] -_0807CFAA: - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - bl sub_807E784 -_0807CFB4: - movs r0, 0 -_0807CFB6: - add sp, 0x14 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_807BBEC - - thumb_func_start sub_807CFC8 -sub_807CFC8: @ 807CFC8 - push {r4-r7,lr} - sub sp, 0x14 - ldr r0, =0x020322a0 - ldr r1, [r0] - adds r1, 0x94 - ldrh r5, [r1] - ldr r1, =0x0000010b - adds r7, r0, 0 - cmp r5, r1 - bls _0807CFE0 - bl _0807E400 -_0807CFE0: - lsls r0, r5, 2 - ldr r1, =_0807CFF8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0807CFF8: - .4byte _0807D428 - .4byte _0807D4A0 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807D4FC - .4byte _0807D544 - .4byte _0807D5B8 - .4byte _0807E400 - .4byte _0807D624 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807D648 - .4byte _0807D678 - .4byte _0807D68A - .4byte _0807D6AC - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807D7A4 - .4byte _0807D7C4 - .4byte _0807D830 - .4byte _0807D8B4 - .4byte _0807D8D8 - .4byte _0807D924 - .4byte _0807D970 - .4byte _0807D9CC - .4byte _0807DA38 - .4byte _0807DA4C - .4byte _0807DA60 - .4byte _0807DA74 - .4byte _0807DB9C - .4byte _0807DC6C - .4byte _0807DCF4 - .4byte _0807DD94 - .4byte _0807DDA4 - .4byte _0807DDC4 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807DEE8 - .4byte _0807DEF8 - .4byte _0807DF16 - .4byte _0807E400 - .4byte _0807DF3C - .4byte _0807DF7C - .4byte _0807DFBC - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807DFDC - .4byte _0807E004 - .4byte _0807E020 - .4byte _0807E040 - .4byte _0807E0E8 - .4byte _0807E11C - .4byte _0807E168 - .4byte _0807E228 - .4byte _0807E2A0 - .4byte _0807E2EC - .4byte _0807E2FC - .4byte _0807E302 - .4byte _0807E328 - .4byte _0807E384 - .4byte _0807E3A8 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807D6F4 - .4byte _0807D728 - .4byte _0807D77C - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807DE1C - .4byte _0807DE84 - .4byte _0807DEC0 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E264 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807D85C - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E284 -_0807D428: - ldr r3, =0x02020630 - ldr r0, [r7] - adds r0, 0x8E - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - ldr r4, [r7] - adds r2, r4, 0 - adds r2, 0x8E - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldr r1, =0x0000ff4c - strh r1, [r0, 0x24] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldr r2, =gUnknown_08300D38 - adds r0, r4, 0 - adds r0, 0xF0 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - strh r0, [r1, 0x26] - adds r1, r4, 0 - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - bl current_map_music_get - ldr r1, [r7] - adds r1, 0xF4 - strh r0, [r1] - ldr r0, =0x00000179 - bl current_map_music_set - bl _0807E400 - .pool -_0807D4A0: - ldr r5, [r7] - adds r6, r5, 0 - adds r6, 0xE6 - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0 - ble _0807D4D4 - ldr r2, =0x02020630 - adds r0, r5, 0 - adds r0, 0x8E - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x24] - adds r1, 0x3 - strh r1, [r0, 0x24] - ldrh r0, [r6] - subs r0, 0x3 - strh r0, [r6] - bl _0807E400 - .pool -_0807D4D4: - ldr r2, =0x02020630 - adds r0, r5, 0 - adds r0, 0x8E - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strh r1, [r0, 0x24] - strh r1, [r6] - adds r1, r5, 0 - adds r1, 0x94 - movs r0, 0xA - strh r0, [r1] - bl _0807E400 - .pool -_0807D4FC: - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EE942 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0 - adds r1, r4, 0 - movs r2, 0 - bl sub_807F1A8 - ldr r4, =0x020322a0 - ldr r0, [r4] - adds r2, r0, 0 - adds r2, 0xF0 - ldrh r1, [r2] - movs r0, 0xCE - lsls r0, 1 - cmp r1, r0 - beq _0807D52A - adds r0, r1, 0 - movs r1, 0 - bl cry_related -_0807D52A: - ldr r3, [r4] - adds r1, r3, 0 - adds r1, 0x94 - movs r2, 0 - movs r0, 0xB - bl _0807E252 - .pool -_0807D544: - ldr r1, [r7] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0x50 - beq _0807D554 - bl _0807E400 -_0807D554: - adds r0, r1, 0 - adds r0, 0x8E - ldrb r0, [r0] - ldr r2, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r1, [r1, 0x5] - lsrs r1, 4 - movs r2, 0x2 - str r2, [sp] - movs r2, 0x1 - str r2, [sp, 0x4] - movs r2, 0x14 - str r2, [sp, 0x8] - ldr r2, =0x000fffff - str r2, [sp, 0xC] - movs r2, 0x78 - movs r3, 0x20 - bl sub_807671C - ldr r1, [r7] - adds r1, 0xD2 - strb r0, [r1] - ldr r1, [r7] - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EE959 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0 - adds r1, r4, 0 - movs r2, 0 - bl sub_807F1A8 - bl _0807E400 - .pool -_0807D5B8: - ldr r5, =0x02020630 - ldr r0, [r7] - adds r0, 0xD2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, r5, 0 - adds r4, 0x1C - adds r0, r4 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - beq _0807D5D8 - bl _0807E400 -_0807D5D8: - ldr r0, =gUnknown_08338D28 - movs r1, 0x78 - movs r2, 0x20 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r7] - adds r1, 0xD3 - strb r0, [r1] - ldr r2, [r7] - adds r0, r2, 0 - adds r0, 0xD3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_807E5D8 - str r1, [r0] - adds r2, 0xD2 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl RemoveObjectAndFreeTiles - ldr r1, [r7] - bl _0807E398 - .pool -_0807D624: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0x94 - movs r1, 0x14 - strh r1, [r0] - bl _0807E400 - .pool -_0807D648: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0807D658 - bl _0807E400 -_0807D658: - movs r0, 0x4 - bl sub_807B62C - movs r0, 0 - movs r1, 0xFF - bl FillWindowPixelBuffer - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - bl _0807E394 - .pool -_0807D678: - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - str r0, [sp] - adds r0, r1, 0 - movs r2, 0x10 - movs r3, 0 - bl _0807E390 -_0807D68A: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0807D69A - bl _0807E400 -_0807D69A: - ldr r0, [r7] - adds r0, 0x94 - movs r1, 0x17 - strh r1, [r0] - bl _0807E400 - .pool -_0807D6AC: - ldr r4, =0x020322a0 - ldr r0, [r4] - adds r2, r0, 0 - adds r2, 0xEA - ldrh r1, [r2] - movs r0, 0x80 - lsls r0, 1 - cmp r1, r0 - bls _0807D6CC - adds r0, r1, 0 - subs r0, 0x34 - strh r0, [r2] - b _0807D6E6 - .pool -_0807D6CC: - movs r0, 0x1 - bl sub_807B62C - ldr r3, [r4] - adds r1, r3, 0 - adds r1, 0xEA - movs r2, 0 - movs r0, 0x80 - strh r0, [r1] - subs r1, 0x56 - movs r0, 0x7C - strh r0, [r1] - str r2, [r3, 0x64] -_0807D6E6: - ldr r0, =0x020322a0 - ldr r4, [r0] - bl _0807DFA8 - .pool -_0807D6F4: - ldr r1, [r7] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0x14 - bhi _0807D704 - bl _0807E400 -_0807D704: - movs r0, 0x3 - bl sub_807B62C - ldr r0, =gUnknown_08338E8C - movs r1, 0x78 - movs r2, 0x50 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r7] - adds r1, 0x91 - strb r0, [r1] - ldr r1, [r7] - bl _0807E398 - .pool -_0807D728: - ldr r2, =0x02020630 - ldr r0, [r7] - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - adds r0, r1, 0 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 27 - cmp r0, 0 - blt _0807D748 - bl _0807E400 -_0807D748: - adds r0, r1, 0 - bl RemoveObjectAndFreeTiles - ldr r1, =0x00000452 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0x82 - lsls r1, 3 - movs r0, 0x52 - bl SetGpuReg - ldr r0, =c3_08054588 - movs r1, 0x5 - bl AddTask - ldr r1, [r7] - bl _0807E398 - .pool -_0807D77C: - ldr r0, =c3_08054588 - bl is_function_an_active_task - lsls r0, 24 - cmp r0, 0 - beq _0807D78C - bl _0807E400 -_0807D78C: - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0x94 - movs r1, 0x1A - strh r1, [r0] - bl _0807E400 - .pool -_0807D7A4: - ldr r2, [r7] - adds r0, r2, 0 - adds r0, 0xE0 - ldrh r1, [r0] - subs r1, 0x1 - strh r1, [r0] - lsls r1, 16 - movs r0, 0x9E - lsls r0, 17 - cmp r1, r0 - beq _0807D7BE - bl _0807E400 -_0807D7BE: - adds r1, r2, 0 - bl _0807E398 -_0807D7C4: - ldr r0, =gUnknown_08338D88 - movs r1, 0x78 - movs r2, 0x50 - movs r3, 0x3 - bl AddObjectToFront - ldr r4, =0x020322a0 - ldr r1, [r4] - adds r1, 0x90 - strb r0, [r1] - ldr r5, =0x02020630 - ldr r0, [r4] - adds r0, 0x90 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r5, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_807AA4C - str r1, [r0] - ldr r0, =gUnknown_08338DC8 - movs r1, 0x78 - movs r2, 0x50 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r4] - adds r1, 0x91 - strb r0, [r1] - ldr r0, [r4] - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x1 - bl StartObjectImageAnim - ldr r1, [r4] - bl _0807E398 - .pool -_0807D830: - ldr r2, [r7] - adds r1, r2, 0 - adds r1, 0xE0 - ldrh r0, [r1] - subs r0, 0x3 - strh r0, [r1] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA6 - bne _0807D84A - subs r1, 0x4C - movs r0, 0xC8 - strh r0, [r1] -_0807D84A: - ldr r1, =0x00001241 - movs r0, 0 - bl SetGpuReg - bl _0807E400 - .pool -_0807D85C: - ldr r2, =0x02020630 - ldr r4, [r7] - adds r3, r4, 0 - adds r3, 0x90 - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x22] - subs r1, 0x2 - strh r1, [r0, 0x22] - adds r0, r4, 0 - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x22] - subs r1, 0x2 - strh r1, [r0, 0x22] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r2, 0x22 - ldrsh r1, [r0, r2] - movs r0, 0x8 - negs r0, r0 - cmp r1, r0 - blt _0807D8A2 - bl _0807E400 -_0807D8A2: - adds r1, r4, 0 - adds r1, 0x94 - movs r0, 0x1D - strh r0, [r1] - bl _0807E400 - .pool -_0807D8B4: - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - str r0, [sp] - adds r0, r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0x94 - movs r1, 0x1E - strh r1, [r0] - bl _0807E400 - .pool -_0807D8D8: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0807D8E8 - bl _0807E400 -_0807D8E8: - ldr r0, [r7] - adds r0, 0x90 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r0, [r7] - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - movs r0, 0x2 - bl sub_807B62C - ldr r1, [r7] - bl _0807E398 - .pool -_0807D924: - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - str r0, [sp] - adds r0, r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r5, =gUnknown_08338DC8 - adds r0, r5, 0 - movs r1, 0x6F - movs r2, 0xAA - movs r3, 0 - bl AddObjectToFront - ldr r4, =0x020322a0 - ldr r1, [r4] - adds r1, 0x90 - strb r0, [r1] - movs r2, 0xA - negs r2, r2 - adds r0, r5, 0 - movs r1, 0x81 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r4] - adds r1, 0x91 - strb r0, [r1] - ldr r1, [r4] - bl _0807E398 - .pool -_0807D970: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0807D98E - movs r0, 0x2E - bl audio_play - ldr r0, =0x020322a0 - ldr r1, [r0] - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_0807D98E: - ldr r3, =0x02020630 - ldr r0, =0x020322a0 - ldr r2, [r0] - adds r0, r2, 0 - adds r0, 0x90 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x26] - subs r1, 0x3 - strh r1, [r0, 0x26] - adds r2, 0x91 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x26] - adds r1, 0x3 - strh r1, [r0, 0x26] - bl _0807E400 - .pool -_0807D9CC: - ldr r5, =0x02020630 - ldr r4, [r7] - adds r2, r4, 0 - adds r2, 0x90 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrh r1, [r0, 0x26] - subs r1, 0x3 - strh r1, [r0, 0x26] - adds r6, r4, 0 - adds r6, 0x91 - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrh r1, [r0, 0x26] - adds r1, 0x3 - strh r1, [r0, 0x26] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r3, r0, r5 - movs r0, 0x26 - ldrsh r1, [r3, r0] - movs r0, 0x5A - negs r0, r0 - cmp r1, r0 - ble _0807DA12 - bl _0807E400 -_0807DA12: - movs r2, 0x1 - strh r2, [r3, 0x30] - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x30] - adds r1, r4, 0 - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - ldr r0, =c3_0805465C - b _0807DC5A - .pool -_0807DA38: - ldr r2, =0x0000ffff - movs r0, 0x8 - movs r1, 0x10 - bl sub_80A2A20 - bl _0807E394 - .pool -_0807DA4C: - ldr r2, =0x0000ffff - movs r0, 0x8 - movs r1, 0x10 - bl sub_80A2A20 - bl _0807E394 - .pool -_0807DA60: - ldr r2, =0x0000ffff - movs r0, 0x8 - movs r1, 0x10 - bl sub_80A2A20 - bl _0807E394 - .pool -_0807DA74: - ldr r5, =0x020322a0 - ldr r0, [r5] - adds r0, 0xF0 - ldrh r0, [r0] - bl sub_806E840 - lsls r0, 24 - cmp r0, 0 - bne _0807DAEC - ldr r4, =0x02020630 - ldr r2, [r5] - adds r2, 0x8E - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x10 - adds r0, r1 - ldr r1, =gUnknown_08338ECC - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0, 0x1] - movs r2, 0x3 - orrs r1, r2 - strb r1, [r0, 0x1] - ldr r0, [r5] - adds r0, 0x8E - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0 - movs r2, 0x3 - movs r3, 0x3 - bl CalcVecFromObjectCenterToObjectUpperLeft - ldr r0, [r5] - adds r0, 0x8E - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0 - bl StartObjectRotScalAnim - b _0807DB02 - .pool -_0807DAEC: - ldr r0, [r5] - adds r0, 0x8E - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r1, 0 - bl StartObjectRotScalAnim -_0807DB02: - ldr r5, =0x020322a0 - ldr r0, [r5] - adds r0, 0x8F - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - movs r1, 0 - bl StartObjectRotScalAnim - ldr r2, [r5] - adds r3, r2, 0 - adds r3, 0x8E - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x28 - strh r1, [r0, 0x20] - adds r2, 0x8F - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xC8 - strh r1, [r0, 0x20] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xC0 - strh r1, [r0, 0x22] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =0x0000ffe0 - strh r1, [r0, 0x22] - ldrb r0, [r3] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - ldr r0, [r5] - adds r0, 0x8F - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - ldr r1, [r5] - bl _0807E398 - .pool -_0807DB9C: - ldr r4, =0x02020630 - ldr r2, [r7] - adds r3, r2, 0 - adds r3, 0x8E - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x26] - subs r1, 0x3 - movs r5, 0 - strh r1, [r0, 0x26] - adds r2, 0x8F - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x26] - adds r1, 0x3 - strh r1, [r0, 0x26] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r0, [r0, 0x26] - adds r0, 0xA3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bhi _0807DBE4 - movs r0, 0x2D - bl audio_play -_0807DBE4: - ldr r2, [r7] - adds r3, r2, 0 - adds r3, 0x8E - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r6, 0x26 - ldrsh r1, [r0, r6] - movs r0, 0xDE - negs r0, r0 - cmp r1, r0 - blt _0807DC04 - bl _0807E400 -_0807DC04: - adds r0, r2, 0 - adds r0, 0x90 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r5, [r0, 0x30] - adds r0, r2, 0 - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r5, [r0, 0x30] - adds r1, r2, 0 - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r7] - adds r0, 0x8F - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - ldr r0, =sub_807F39C -_0807DC5A: - movs r1, 0x5 - bl AddTask - b _0807E400 - .pool -_0807DC6C: - ldr r4, =0x02020630 - ldr r2, [r7] - adds r3, r2, 0 - adds r3, 0x90 - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x26] - subs r1, 0x3 - strh r1, [r0, 0x26] - adds r2, 0x91 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x26] - adds r1, 0x3 - strh r1, [r0, 0x26] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r2, 0x26 - ldrsh r1, [r0, r2] - movs r0, 0xDE - negs r0, r0 - cmp r1, r0 - ble _0807DCAE - b _0807E400 -_0807DCAE: - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - str r0, [sp] - adds r0, r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, [r7] - adds r2, r1, 0 - adds r2, 0x94 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - adds r1, 0x90 - ldrb r1, [r1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r0, [r7] - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - b _0807E400 - .pool -_0807DCF4: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0807DD02 - b _0807E400 -_0807DD02: - ldr r1, [r7] - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - movs r0, 0x1 - bl sub_807B62C - ldr r0, [r7] - adds r0, 0xE0 - movs r1, 0xA6 - strh r1, [r0] - movs r0, 0x3 - bl sub_807B62C - ldr r0, [r7] - adds r0, 0xE4 - movs r1, 0xCE - lsls r1, 1 - strh r1, [r0] - ldr r0, =gUnknown_08338D88 - movs r4, 0x14 - negs r4, r4 - movs r1, 0x78 - adds r2, r4, 0 - movs r3, 0x3 - bl AddObjectToFront - ldr r1, [r7] - adds r1, 0x90 - strb r0, [r1] - ldr r5, =0x02020630 - ldr r0, [r7] - adds r0, 0x90 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r5, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_807AA4C - str r1, [r0] - ldr r0, =gUnknown_08338DC8 - movs r1, 0x78 - adds r2, r4, 0 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r7] - adds r1, 0x91 - strb r0, [r1] - ldr r0, [r7] - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x1 - bl StartObjectImageAnim - b _0807E400 - .pool -_0807DD94: - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - str r0, [sp] - adds r0, r1, 0 - movs r2, 0x10 - movs r3, 0 - b _0807E390 -_0807DDA4: - movs r1, 0x92 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0807DDBC - b _0807E400 -_0807DDBC: - b _0807E394 - .pool -_0807DDC4: - ldr r2, =0x02020630 - ldr r4, [r7] - adds r3, r4, 0 - adds r3, 0x90 - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x26] - adds r1, 0x4 - strh r1, [r0, 0x26] - adds r0, r4, 0 - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x26] - adds r1, 0x4 - strh r1, [r0, 0x26] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r6, 0x26 - ldrsh r1, [r0, r6] - movs r2, 0x22 - ldrsh r0, [r0, r2] - adds r1, r0 - cmp r1, 0x40 - beq _0807DE0A - b _0807E400 -_0807DE0A: - adds r0, r4, 0 - adds r0, 0x94 - movs r1, 0x90 - strh r1, [r0] - movs r0, 0 - str r0, [r4, 0x64] - b _0807E400 - .pool -_0807DE1C: - movs r1, 0xB2 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - ldr r4, =0x020322a0 - ldr r2, [r4] - adds r1, r2, 0 - adds r1, 0xE0 - ldrh r0, [r1] - adds r0, 0x3 - strh r0, [r1] - adds r1, 0x4 - ldrh r0, [r1] - adds r0, 0x3 - strh r0, [r1] - ldr r0, [r2, 0x64] - adds r0, 0x1 - str r0, [r2, 0x64] - cmp r0, 0xA - bne _0807DE60 - ldr r0, =c3_08054588 - movs r1, 0x5 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0x1 - strh r0, [r1, 0xC] -_0807DE60: - ldr r1, [r4] - adds r3, r1, 0 - adds r3, 0xE0 - movs r6, 0 - ldrsh r0, [r3, r6] - movs r2, 0x9E - lsls r2, 1 - cmp r0, r2 - bgt _0807DE74 - b _0807E400 -_0807DE74: - strh r2, [r3] - b _0807E398 - .pool -_0807DE84: - ldr r0, [r7] - adds r0, 0x90 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r0, [r7] - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r3, [r7] - adds r2, r3, 0 - adds r2, 0x94 - ldrh r0, [r2] - adds r0, 0x1 - movs r1, 0 - strh r0, [r2] - str r1, [r3, 0x64] - b _0807E400 - .pool -_0807DEC0: - ldr r0, =c3_08054588 - bl is_function_an_active_task - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - beq _0807DED0 - b _0807E400 -_0807DED0: - ldr r0, =0x020322a0 - ldr r2, [r0] - adds r1, r2, 0 - adds r1, 0x94 - movs r0, 0x2E - strh r0, [r1] - str r3, [r2, 0x64] - b _0807E400 - .pool -_0807DEE8: - ldr r1, [r7] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0xA - beq _0807DEF6 - b _0807E400 -_0807DEF6: - b _0807E398 -_0807DEF8: - ldr r1, [r7] - adds r5, r1, 0 - adds r5, 0xE0 - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - lsls r0, 16 - asrs r0, 16 - movs r6, 0xAE - lsls r6, 1 - cmp r0, r6 - bgt _0807DF12 - b _0807E400 -_0807DF12: - strh r6, [r5] - b _0807E398 -_0807DF16: - ldr r0, =gUnknown_08338E74 - movs r1, 0x78 - movs r2, 0x50 - movs r3, 0 - bl AddObjectToFront - ldr r2, =0x020322a0 - ldr r1, [r2] - adds r1, 0x91 - strb r0, [r1] - ldr r0, [r2] - adds r0, 0x94 - movs r1, 0x32 - strh r1, [r0] - b _0807E400 - .pool -_0807DF3C: - ldr r2, =0x02020630 - ldr r0, [r7] - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - adds r0, r1, 0 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 27 - cmp r0, 0 - blt _0807DF5A - b _0807E400 -_0807DF5A: - adds r0, r1, 0 - bl RemoveObjectAndFreeTiles - movs r0, 0x6 - bl sub_807B62C - ldr r1, [r7] - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - movs r0, 0x9F - bl audio_play - b _0807E400 - .pool -_0807DF7C: - ldr r1, [r7] - adds r2, r1, 0 - adds r2, 0xEA - ldrh r3, [r2] - ldr r0, =0x000003ff - cmp r3, r0 - bhi _0807DF98 - adds r0, r3, 0 - adds r0, 0x34 - strh r0, [r2] - b _0807DFA6 - .pool -_0807DF98: - movs r0, 0x80 - lsls r0, 3 - strh r0, [r2] - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_0807DFA6: - ldr r4, [r7] -_0807DFA8: - adds r0, r4, 0 - adds r0, 0xEA - ldrh r1, [r0] - movs r0, 0x80 - lsls r0, 8 - bl __divsi3 - adds r4, 0xE8 - strh r0, [r4] - b _0807E400 -_0807DFBC: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0x94 - movs r1, 0x3C - strh r1, [r0] - b _0807E400 - .pool -_0807DFDC: - ldr r4, =0x02037fd4 - ldrb r1, [r4, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0807DFEA - b _0807E400 -_0807DFEA: - movs r0, 0x5 - bl sub_807B62C - movs r0, 0x7 - bl sub_807B62C - ldrb r0, [r4, 0x8] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r4, 0x8] - b _0807E394 - .pool -_0807E004: - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x8] - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - b _0807E390 - .pool -_0807E020: - movs r1, 0xA2 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0807E038 - b _0807E400 -_0807E038: - b _0807E394 - .pool -_0807E040: - ldr r0, =gUnknown_08338D28 - movs r2, 0x8 - negs r2, r2 - movs r1, 0x78 - movs r3, 0 - bl AddObjectToFront - ldr r5, =0x020322a0 - ldr r1, [r5] - adds r1, 0xD3 - movs r6, 0 - strb r0, [r1] - ldr r4, =0x02020630 - ldr r2, [r5] - adds r2, 0xD3 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x4A - strh r1, [r0, 0x34] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_807E6AC - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x1 - bl StartObjectImageAnim - ldr r0, [r5] - adds r0, 0xD3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x2 - bl StartObjectRotScalAnim - ldr r0, [r5] - adds r0, 0xD3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0, 0x5] - lsrs r1, 4 - adds r1, 0x10 - movs r0, 0x1 - lsls r0, r1 - ldr r2, =0x0000ffff - movs r1, 0x10 - bl sub_80A2A20 - ldr r2, [r5] - adds r1, r2, 0 - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - str r6, [r2, 0x64] - b _0807E400 - .pool -_0807E0E8: - ldr r2, =0x02020630 - ldr r0, [r7] - adds r0, 0xD3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x5] - lsrs r1, 4 - adds r1, 0x10 - movs r0, 0x1 - lsls r0, r1 - ldr r1, =0x0000ffff - str r1, [sp] - movs r1, 0x1 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r1, [r7] - b _0807E398 - .pool -_0807E11C: - ldr r2, =0x02020630 - ldr r3, [r7] - adds r0, r3, 0 - adds r0, 0xD3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - beq _0807E13A - b _0807E400 -_0807E13A: - adds r0, r3, 0 - adds r0, 0xF2 - ldrh r2, [r0] - lsls r0, r2, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r1, [r1] - ldr r1, [r1, 0x10] - ldr r3, [r3, 0x6C] - bl DecompressMonPic_DetectFrontOrBack_2 - ldr r1, [r7] - b _0807E398 - .pool -_0807E168: - ldr r4, =0x02020630 - ldr r2, [r7] - adds r6, r2, 0 - adds r6, 0x8F - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r5, 0 - movs r1, 0x78 - strh r1, [r0, 0x20] - ldrb r0, [r6] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldr r3, =gUnknown_08300D38 - adds r2, 0xF2 - ldrh r0, [r2] - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x1] - adds r0, 0x3C - strh r0, [r1, 0x22] - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r5, [r0, 0x24] - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r5, [r0, 0x26] - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0 - bl StartObjectImageAnim - ldr r3, [r7] - adds r0, r3, 0 - adds r0, 0x8F - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r1, [r1, 0x5] - lsrs r1, 4 - movs r2, 0x2 - str r2, [sp] - movs r2, 0x1 - str r2, [sp, 0x4] - movs r2, 0x14 - str r2, [sp, 0x8] - ldr r2, =0x000fffff - str r2, [sp, 0xC] - adds r3, 0xF2 - ldrh r2, [r3] - str r2, [sp, 0x10] - movs r2, 0x78 - movs r3, 0x54 - bl sub_8076438 - ldr r0, [r7] - adds r0, 0xD3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl obj_free_rotscale_entry - ldr r0, [r7] - adds r0, 0xD3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r1, [r7] - b _0807E398 - .pool -_0807E228: - movs r1, 0xAA - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EE966 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0 - adds r1, r4, 0 - movs r2, 0 - bl sub_807F1A8 - ldr r0, =0x020322a0 - ldr r3, [r0] - adds r1, r3, 0 - adds r1, 0x94 - movs r2, 0 - movs r0, 0xA7 -_0807E252: - strh r0, [r1] - str r2, [r3, 0x64] - b _0807E400 - .pool -_0807E264: - ldr r3, [r7] - ldr r0, [r3, 0x64] - adds r0, 0x1 - str r0, [r3, 0x64] - cmp r0, 0x3C - bhi _0807E272 - b _0807E400 -_0807E272: - adds r0, r3, 0 - adds r0, 0x94 - movs r2, 0 - ldr r1, =0x0000010b - strh r1, [r0] - str r2, [r3, 0x64] - b _0807E400 - .pool -_0807E284: - bl sub_80A3678 - lsls r0, 24 - cmp r0, 0 - bne _0807E290 - b _0807E400 -_0807E290: - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0x94 - movs r1, 0x44 - strh r1, [r0] - b _0807E400 - .pool -_0807E2A0: - ldr r1, [r7] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0xA - bne _0807E2B2 - ldr r0, =0x00000173 - bl fanfare_play -_0807E2B2: - ldr r1, [r7] - ldr r0, [r1, 0x64] - cmp r0, 0xFA - beq _0807E2BC - b _0807E400 -_0807E2BC: - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - movs r5, 0 - strh r0, [r1] - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EE977 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0 - adds r1, r4, 0 - movs r2, 0 - bl sub_807F1A8 - ldr r0, [r7] - str r5, [r0, 0x64] - b _0807E400 - .pool -_0807E2EC: - ldr r1, [r7] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0x3C - beq _0807E2FA - b _0807E400 -_0807E2FA: - b _0807E398 -_0807E2FC: - bl sub_807F14C - b _0807E394 -_0807E302: - ldr r2, [r7] - adds r0, r2, 0 - adds r0, 0xEE - ldrb r0, [r0] - cmp r0, 0 - beq _0807E312 - movs r0, 0x1 - b _0807E402 -_0807E312: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0807E400 - adds r1, r2, 0 - b _0807E398 - .pool -_0807E328: - ldr r0, =0x020375e2 - ldrb r0, [r0] - movs r1, 0 - bl sub_807B4D0 - ldr r1, =0x030061e8 - ldr r0, =sub_807B60C - str r0, [r1] - ldr r7, =0x02032298 - ldrb r0, [r7] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x020244ec - adds r0, r5 - movs r1, 0x1 - movs r2, 0 - bl GetEvolutionTargetSpecies - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - beq _0807E394 - ldrb r3, [r7] - adds r0, r3, 0 - muls r0, r6 - adds r0, r5 - ldr r1, =0x020322a0 - ldr r1, [r1] - adds r1, 0x8F - ldrb r2, [r1] - adds r1, r4, 0 - bl sub_813E1D4 - b _0807E394 - .pool -_0807E384: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 -_0807E390: - bl pal_fade_maybe -_0807E394: - ldr r0, =0x020322a0 - ldr r1, [r0] -_0807E398: - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _0807E400 - .pool -_0807E3A8: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _0807E400 - ldr r0, [r7] - adds r0, 0xF4 - ldrh r0, [r0] - bl current_map_music_set - ldr r0, [r7] - cmp r0, 0 - beq _0807E3F6 - bl FreeAllWindowBuffers - movs r0, 0x3 - bl GetBgTilemapBuffer - bl Free - movs r0, 0x1 - bl GetBgTilemapBuffer - bl Free - movs r0, 0 - bl GetBgTilemapBuffer - bl Free - bl sub_805F094 - ldr r0, [r7] - bl Free - str r4, [r7] -_0807E3F6: - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - bl sub_807E784 -_0807E400: - movs r0, 0 -_0807E402: - add sp, 0x14 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_807CFC8 - - thumb_func_start c2_08053788 -c2_08053788: @ 807E414 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0 - beq _0807E434 - cmp r0, 0x4 - beq _0807E444 - b _0807E4B4 - .pool -_0807E434: - movs r0, 0x4 - strb r0, [r1] - ldr r1, =0x03002700 - movs r0, 0x1 - b _0807E4B2 - .pool -_0807E444: - ldr r0, =0x030061e8 - ldr r1, =sub_807EB50 - mov r8, r1 - str r1, [r0] - ldr r7, =0x02032298 - ldrb r0, [r7] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x020244ec - adds r0, r5 - movs r1, 0x1 - movs r2, 0 - bl GetEvolutionTargetSpecies - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - beq _0807E494 - ldrb r3, [r7] - adds r0, r3, 0 - muls r0, r6 - adds r0, r5 - ldr r1, =0x020322a0 - ldr r1, [r1] - adds r1, 0x8F - ldrb r2, [r1] - adds r1, r4, 0 - bl sub_813E1D4 - b _0807E4AE - .pool -_0807E494: - bl sub_8077260 - cmp r0, 0 - beq _0807E4A8 - ldr r0, =sub_807F464 - bl SetMainCallback2 - b _0807E4AE - .pool -_0807E4A8: - mov r0, r8 - bl SetMainCallback2 -_0807E4AE: - ldr r1, =0x02032298 - movs r0, 0xFF -_0807E4B2: - strb r0, [r1] -_0807E4B4: - bl sub_800B33C - lsls r0, 24 - cmp r0, 0 - bne _0807E4C2 - bl RunActiveTasks -_0807E4C2: - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end c2_08053788 - - thumb_func_start sub_807E4DC -sub_807E4DC: @ 807E4DC - push {r4-r6,lr} - bl sub_807ACDC - bl sub_800A550 - lsls r0, 24 - lsrs r5, r0, 24 - movs r6, 0x1 - adds r0, r5, 0 - ands r0, r6 - cmp r0, 0 - beq _0807E51A - ldr r4, =0x020223c4 - ldrh r1, [r4] - ldr r0, =0x0000dcba - cmp r1, r0 - bne _0807E504 - ldr r0, =c2_08053788 - bl SetMainCallback2 -_0807E504: - ldrh r1, [r4] - ldr r0, =0x0000abcd - cmp r1, r0 - bne _0807E514 - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0x72 - strb r6, [r0] -_0807E514: - movs r0, 0 - bl sub_800A5EC -_0807E51A: - movs r0, 0x2 - ands r0, r5 - cmp r0, 0 - beq _0807E542 - ldr r0, =0x020223c4 - movs r1, 0x80 - lsls r1, 1 - adds r0, r1 - ldrh r1, [r0] - ldr r0, =0x0000abcd - cmp r1, r0 - bne _0807E53C - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0x73 - movs r1, 0x1 - strb r1, [r0] -_0807E53C: - movs r0, 0x1 - bl sub_800A5EC -_0807E542: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807E4DC - - thumb_func_start sub_807E55C -sub_807E55C: @ 807E55C - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - movs r1, 0xA - bl __divsi3 - ldrh r4, [r5, 0x22] - adds r4, r0 - strh r4, [r5, 0x22] - ldrh r0, [r5, 0x30] - ldrh r2, [r5, 0x38] - adds r0, r2 - strh r0, [r5, 0x38] - movs r1, 0x38 - ldrsh r0, [r5, r1] - movs r1, 0xA - bl __divsi3 - strh r0, [r5, 0x20] - lsls r4, 16 - asrs r4, 16 - cmp r4, 0x4C - ble _0807E5AA - movs r0, 0x4C - strh r0, [r5, 0x22] - movs r2, 0x2E - ldrsh r1, [r5, r2] - movs r2, 0x32 - ldrsh r0, [r5, r2] - muls r0, r1 - negs r0, r0 - movs r1, 0x64 - bl __divsi3 - strh r0, [r5, 0x2E] - ldrh r0, [r5, 0x34] - adds r0, 0x1 - strh r0, [r5, 0x34] -_0807E5AA: - movs r1, 0x20 - ldrsh r0, [r5, r1] - cmp r0, 0x78 - bne _0807E5B6 - movs r0, 0 - strh r0, [r5, 0x30] -_0807E5B6: - ldrh r0, [r5, 0x36] - ldrh r2, [r5, 0x2E] - adds r0, r2 - strh r0, [r5, 0x2E] - movs r1, 0x34 - ldrsh r0, [r5, r1] - cmp r0, 0x4 - bne _0807E5CE - movs r0, 0x1 - strh r0, [r5, 0x3C] - ldr r0, =DummyObjectCallback - str r0, [r5, 0x1C] -_0807E5CE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807E55C - - thumb_func_start sub_807E5D8 -sub_807E5D8: @ 807E5D8 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - ldr r1, =gUnknown_08339024 - movs r2, 0x2E - ldrsh r0, [r4, r2] - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldrh r1, [r4, 0x26] - adds r0, r1 - strh r0, [r4, 0x26] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0x16 - bne _0807E600 - movs r0, 0x38 - bl audio_play -_0807E600: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2C - bne _0807E636 - movs r0, 0x8C - bl audio_play - ldr r0, =sub_807E64C - str r0, [r4, 0x1C] - movs r0, 0 - strh r0, [r4, 0x2E] - ldrb r1, [r4, 0x5] - lsrs r1, 4 - adds r1, 0x10 - movs r0, 0x1 - lsls r0, r1 - movs r1, 0x1 - negs r1, r1 - ldr r2, =0x0000ffff - str r2, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe -_0807E636: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807E5D8 - - thumb_func_start sub_807E64C -sub_807E64C: @ 807E64C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0x14 - bne _0807E660 - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim -_0807E660: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - ble _0807E69E - ldr r1, =gUnknown_08339024 - movs r2, 0x2E - ldrsh r0, [r4, r2] - adds r0, r1 - movs r1, 0 - ldrsb r1, [r0, r1] - ldrh r0, [r4, 0x26] - subs r0, r1 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x17 - bne _0807E69E - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0x94 - movs r1, 0xE - strh r1, [r0] -_0807E69E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807E64C - - thumb_func_start sub_807E6AC -sub_807E6AC: @ 807E6AC - push {r4,lr} - adds r4, r0, 0 - ldrh r2, [r4, 0x32] - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0807E6DC - ldrh r0, [r4, 0x22] - adds r0, 0x4 - strh r0, [r4, 0x22] - lsls r0, 16 - asrs r0, 16 - movs r3, 0x34 - ldrsh r1, [r4, r3] - cmp r0, r1 - ble _0807E72C - adds r0, r2, 0x1 - strh r0, [r4, 0x32] - movs r0, 0x16 - strh r0, [r4, 0x2E] - movs r0, 0x38 - bl audio_play - b _0807E72C -_0807E6DC: - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x42 - bne _0807E6EA - movs r0, 0x39 - bl audio_play -_0807E6EA: - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0x5C - bne _0807E6F8 - movs r0, 0x3A - bl audio_play -_0807E6F8: - movs r3, 0x2E - ldrsh r0, [r4, r3] - cmp r0, 0x6B - bne _0807E706 - movs r0, 0x3B - bl audio_play -_0807E706: - ldr r1, =gUnknown_08339024 - movs r2, 0x2E - ldrsh r0, [r4, r2] - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldrh r3, [r4, 0x26] - adds r0, r3 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6C - bne _0807E72C - ldr r0, =DummyObjectCallback - str r0, [r4, 0x1C] -_0807E72C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807E6AC - - thumb_func_start sub_807E73C -sub_807E73C: @ 807E73C - push {r4-r6,lr} - ldr r0, =0x020375e0 - ldrh r0, [r0] - lsls r4, r0, 4 - subs r4, r0 - lsls r4, 2 - ldr r0, =gUnknown_08338ED0 - adds r4, r0 - ldr r0, =0x02021cc4 - ldrh r1, [r4, 0x38] - movs r6, 0xB - muls r1, r6 - ldr r5, =gSpeciesNames - adds r1, r5 - bl CopyString - ldr r0, =0x02021dc4 - ldrh r1, [r4, 0xC] - muls r1, r6 - adds r1, r5 - bl CopyString - ldrh r0, [r4, 0x38] - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_807E73C - - thumb_func_start sub_807E784 -sub_807E784: @ 807E784 - push {r4,lr} - sub sp, 0x20 - ldr r0, =0x020375e0 - ldrh r0, [r0] - lsls r4, r0, 4 - subs r4, r0 - lsls r4, 2 - ldr r0, =gUnknown_08338ED0 - adds r4, r0 - ldr r0, =0x020375e2 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - ldr r0, =0x02021cc4 - mov r1, sp - bl CopyString_Limit10 - ldr r0, =0x02021dc4 - ldrh r2, [r4, 0xC] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - add sp, 0x20 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807E784 - - thumb_func_start sub_807E7E8 -sub_807E7E8: @ 807E7E8 - push {r4-r7,lr} - sub sp, 0x38 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, r1, 4 - subs r2, r1 - lsls r2, 2 - ldr r1, =gUnknown_08338ED0 - adds r5, r2, r1 - movs r1, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x38 - bl pokemon_getattr - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - add r4, sp, 0x34 - movs r0, 0xFE - strb r0, [r4] - ldr r6, =0x02024744 - ldrh r1, [r5, 0xC] - movs r3, 0x1 - str r3, [sp] - ldr r0, [r5, 0x24] - str r0, [sp, 0x4] - str r3, [sp, 0x8] - ldr r0, [r5, 0x18] - str r0, [sp, 0xC] - adds r0, r6, 0 - movs r3, 0x20 - bl create_pokemon_set_level - adds r2, r5, 0 - adds r2, 0xE - adds r0, r6, 0 - movs r1, 0x27 - bl pokemon_setattr - adds r2, r5, 0 - adds r2, 0xF - adds r0, r6, 0 - movs r1, 0x28 - bl pokemon_setattr - adds r2, r5, 0 - adds r2, 0x10 - adds r0, r6, 0 - movs r1, 0x29 - bl pokemon_setattr - adds r2, r5, 0 - adds r2, 0x11 - adds r0, r6, 0 - movs r1, 0x2A - bl pokemon_setattr - adds r2, r5, 0 - adds r2, 0x12 - adds r0, r6, 0 - movs r1, 0x2B - bl pokemon_setattr - adds r2, r5, 0 - adds r2, 0x13 - adds r0, r6, 0 - movs r1, 0x2C - bl pokemon_setattr - adds r0, r6, 0 - movs r1, 0x2 - adds r2, r5, 0 - bl pokemon_setattr - adds r2, r5, 0 - adds r2, 0x2B - adds r0, r6, 0 - movs r1, 0x7 - bl pokemon_setattr - adds r2, r5, 0 - adds r2, 0x36 - adds r0, r6, 0 - movs r1, 0x31 - bl pokemon_setattr - adds r2, r5, 0 - adds r2, 0x14 - adds r0, r6, 0 - movs r1, 0x2E - bl pokemon_setattr - adds r2, r5, 0 - adds r2, 0x1D - adds r0, r6, 0 - movs r1, 0x17 - bl pokemon_setattr - adds r2, r5, 0 - adds r2, 0x1E - adds r0, r6, 0 - movs r1, 0x18 - bl pokemon_setattr - adds r2, r5, 0 - adds r2, 0x1C - adds r0, r6, 0 - movs r1, 0x16 - bl pokemon_setattr - adds r2, r5, 0 - adds r2, 0x1F - adds r0, r6, 0 - movs r1, 0x21 - bl pokemon_setattr - adds r2, r5, 0 - adds r2, 0x20 - adds r0, r6, 0 - movs r1, 0x2F - bl pokemon_setattr - adds r2, r5, 0 - adds r2, 0x37 - adds r0, r6, 0 - movs r1, 0x30 - bl pokemon_setattr - adds r0, r6, 0 - movs r1, 0x23 - adds r2, r4, 0 - bl pokemon_setattr - mov r4, sp - adds r4, 0x35 - movs r0, 0 - strb r0, [r4] - ldrh r0, [r5, 0x28] - cmp r0, 0 - beq _0807E960 - bl itemid_is_mail - lsls r0, 24 - cmp r0, 0 - beq _0807E954 - add r0, sp, 0x10 - adds r1, r5, 0 - bl sub_807E974 - ldr r0, =0x020321c0 - add r1, sp, 0x10 - ldm r1!, {r2,r3,r7} - stm r0!, {r2,r3,r7} - ldm r1!, {r2,r3,r7} - stm r0!, {r2,r3,r7} - ldm r1!, {r2,r3,r7} - stm r0!, {r2,r3,r7} - adds r0, r6, 0 - movs r1, 0x40 - adds r2, r4, 0 - bl pokemon_setattr - adds r2, r5, 0 - adds r2, 0x28 - adds r0, r6, 0 - movs r1, 0xC - bl pokemon_setattr - b _0807E960 - .pool -_0807E954: - adds r2, r5, 0 - adds r2, 0x28 - adds r0, r6, 0 - movs r1, 0xC - bl pokemon_setattr -_0807E960: - ldr r0, =0x02024744 - bl pokemon_calc_effective_stats - add sp, 0x38 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807E7E8 - - thumb_func_start sub_807E974 -sub_807E974: @ 807E974 - push {r4-r6,lr} - adds r5, r0, 0 - adds r6, r1, 0 - ldr r2, =gUnknown_08338FC0 - adds r0, r6, 0 - adds r0, 0x2A - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, r0, r2 - adds r1, r5, 0 - movs r3, 0x8 -_0807E98E: - ldrh r0, [r2] - strh r0, [r1] - adds r2, 0x2 - adds r1, 0x2 - subs r3, 0x1 - cmp r3, 0 - bge _0807E98E - adds r4, r5, 0 - adds r4, 0x12 - adds r1, r6, 0 - adds r1, 0x2B - adds r0, r4, 0 - bl CopyString - adds r0, r4, 0 - movs r1, 0 - bl sub_81DB4DC - ldr r1, [r6, 0x18] - lsrs r0, r1, 24 - strb r0, [r5, 0x1A] - lsrs r0, r1, 16 - strb r0, [r5, 0x1B] - lsrs r0, r1, 8 - strb r0, [r5, 0x1C] - strb r1, [r5, 0x1D] - ldrh r0, [r6, 0xC] - strh r0, [r5, 0x1E] - ldrh r0, [r6, 0x28] - strh r0, [r5, 0x20] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807E974 - - thumb_func_start sub_807E9D4 -sub_807E9D4: @ 807E9D4 - push {r4-r6,lr} - ldr r6, =0x020375e2 - ldrh r0, [r6] - movs r5, 0x64 - muls r0, r5 - ldr r4, =0x020244ec - adds r0, r4 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _0807EA08 - ldrh r0, [r6] - muls r0, r5 - adds r0, r4 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - b _0807EA0A - .pool -_0807EA08: - movs r0, 0 -_0807EA0A: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_807E9D4 - - thumb_func_start sub_807EA10 -sub_807EA10: @ 807EA10 - push {lr} - ldr r0, =0x020375e2 - ldrb r0, [r0] - ldr r1, =0x020375e0 - ldrb r1, [r1] - bl sub_807E7E8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_807EA10 - - thumb_func_start sub_807EA2C -sub_807EA2C: @ 807EA2C - push {r4-r6,lr} - bl sub_807BBC8 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x1 - bne _0807EA96 - ldr r5, =0x020322a0 - ldr r0, [r5] - adds r0, 0x8E - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r0, [r5] - adds r0, 0x8F - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl obj_free_rotscale_entry - ldr r0, =0x02032298 - ldrb r4, [r0] - ldrb r0, [r0, 0x1] - movs r1, 0x6 - bl __umodsi3 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_807B4D0 - bl sub_8077260 - cmp r0, 0 - bne _0807EA90 - ldr r0, [r5] - adds r2, r0, 0 - adds r2, 0x74 - ldr r1, =0x0000abcd - strh r1, [r2] - adds r0, 0x93 - strb r6, [r0] -_0807EA90: - ldr r0, =sub_807EACC - bl SetMainCallback2 -_0807EA96: - bl sub_807B5B8 - bl sub_807E4DC - bl RunActiveTasks - bl RunTextPrinters - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807EA2C - - thumb_func_start sub_807EACC -sub_807EACC: @ 807EACC - push {r4,lr} - bl sub_807ACDC - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8077260 - cmp r0, 0 - beq _0807EAEC - ldr r0, =c2_08053788 - bl SetMainCallback2 - b _0807EB2C - .pool -_0807EAEC: - bl sub_807E4DC - cmp r4, 0 - bne _0807EB2C - ldr r4, =0x020322a0 - ldr r2, [r4] - adds r0, r2, 0 - adds r0, 0x72 - ldrh r1, [r0] - ldr r0, =0x00000101 - cmp r1, r0 - bne _0807EB2C - adds r1, r2, 0 - adds r1, 0x74 - ldr r0, =0x0000dcba - strh r0, [r1] - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, [r4] - adds r1, 0x74 - movs r2, 0x14 - bl link_0800A448 - ldr r0, [r4] - adds r0, 0x72 - movs r1, 0x2 - strb r1, [r0] - ldr r0, [r4] - adds r0, 0x73 - strb r1, [r0] -_0807EB2C: - bl RunActiveTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807EACC - - thumb_func_start sub_807EB50 -sub_807EB50: @ 807EB50 - push {r4,lr} - sub sp, 0x4 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0x65 - bls _0807EB66 - b _0807F03A -_0807EB66: - lsls r0, 2 - ldr r1, =_0807EB78 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0807EB78: - .4byte _0807ED10 - .4byte _0807ED2C - .4byte _0807ED98 - .4byte _0807F03A - .4byte _0807EE78 - .4byte _0807EF3C - .4byte _0807EF64 - .4byte _0807EF7E - .4byte _0807EFA4 - .4byte _0807EFF0 - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807EE9C - .4byte _0807EEEC - .4byte _0807EF1A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807EDC0 - .4byte _0807EE1C - .4byte _0807EE38 - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807ED44 - .4byte _0807ED7C -_0807ED10: - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EF6D2 - b _0807EDA6 - .pool -_0807ED2C: - movs r0, 0 - bl sub_8077288 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r2, 0 - movs r1, 0x64 - b _0807EE88 - .pool -_0807ED44: - ldr r0, =0x020322a0 - ldr r3, [r0] - ldr r0, [r3, 0x64] - adds r0, 0x1 - str r0, [r3, 0x64] - cmp r0, 0xB4 - bls _0807ED60 - movs r1, 0x87 - lsls r1, 3 - adds r0, r2, r1 - movs r2, 0 - movs r1, 0x65 - strb r1, [r0] - str r2, [r3, 0x64] -_0807ED60: - bl sub_8077294 - cmp r0, 0 - bne _0807ED6A - b _0807F03A -_0807ED6A: - ldr r0, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r2 - b _0807ED8E - .pool -_0807ED7C: - bl sub_8077294 - cmp r0, 0 - bne _0807ED86 - b _0807F03A -_0807ED86: - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 -_0807ED8E: - movs r1, 0x2 - strb r1, [r0] - b _0807F03A - .pool -_0807ED98: - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 - movs r0, 0x32 - strb r0, [r1] - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_082C8959 -_0807EDA6: - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0 - adds r1, r4, 0 - movs r2, 0 - bl sub_807F1A8 - b _0807F03A - .pool -_0807EDC0: - bl InUnionRoom - cmp r0, 0 - bne _0807EDCE - movs r0, 0x15 - bl sav12_xor_increment -_0807EDCE: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _0807EDF6 - ldr r4, =0x020229e8 - bl link_get_multiplayer_id - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r4, 0x4 - adds r1, r4 - ldr r1, [r1] - movs r0, 0x2 - bl sub_801B990 -_0807EDF6: - bl sub_8076D5C - bl sub_8153380 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - ldrb r0, [r1] - adds r0, 0x1 - movs r2, 0 - strb r0, [r1] - b _0807EE8A - .pool -_0807EE1C: - ldr r0, =0x020322a0 - ldr r1, [r0] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0x5 - beq _0807EE2C - b _0807F03A -_0807EE2C: - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 - b _0807EFE4 - .pool -_0807EE38: - bl sub_81533AC - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _0807EE5C - bl sav2_gender2_inplace_and_xFE - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r1, 0x4 - strb r1, [r0] - b _0807F03A - .pool -_0807EE5C: - ldr r0, =0x020322a0 - ldr r0, [r0] - str r1, [r0, 0x64] - ldr r0, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r2 - movs r1, 0x33 - strb r1, [r0] - b _0807F03A - .pool -_0807EE78: - bl sub_81533E0 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r2, 0 - movs r1, 0x28 -_0807EE88: - strb r1, [r0] -_0807EE8A: - ldr r0, =0x020322a0 - ldr r0, [r0] - str r2, [r0, 0x64] - b _0807F03A - .pool -_0807EE9C: - ldr r4, =0x020322a0 - ldr r1, [r4] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0x32 - bhi _0807EEAC - b _0807F03A -_0807EEAC: - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - bne _0807EED4 - bl GenerateRandomNumber - ldr r4, [r4] - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1E - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - str r0, [r4, 0x64] - b _0807EEDA - .pool -_0807EED4: - ldr r1, [r4] - movs r0, 0 - str r0, [r1, 0x64] -_0807EEDA: - ldr r0, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r2 - movs r1, 0x29 - strb r1, [r0] - b _0807F03A - .pool -_0807EEEC: - ldr r0, =0x020322a0 - ldr r1, [r0] - ldr r0, [r1, 0x64] - cmp r0, 0 - bne _0807EF14 - movs r0, 0x1 - bl sub_8077288 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r1, 0x2A - strb r1, [r0] - b _0807F03A - .pool -_0807EF14: - subs r0, 0x1 - str r0, [r1, 0x64] - b _0807F03A -_0807EF1A: - bl sub_8077294 - cmp r0, 0 - bne _0807EF24 - b _0807F03A -_0807EF24: - bl sub_8153408 - ldr r0, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r2 - movs r1, 0x5 - strb r1, [r0] - b _0807F03A - .pool -_0807EF3C: - ldr r0, =0x020322a0 - ldr r1, [r0] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0x3C - bls _0807F03A - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r0, 0x2 - bl sub_8077288 - b _0807F03A - .pool -_0807EF64: - bl sub_8077294 - cmp r0, 0 - beq _0807F03A - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - b _0807EFDC -_0807EF7E: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0807F03A - movs r0, 0x3 - bl play_sound_effect - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0807EFE4 - .pool -_0807EFA4: - bl sub_80A3258 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0807F03A - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _0807EFD8 - ldr r0, =0x030022c0 - ldr r1, [r0, 0x8] - ldr r0, =sub_80773AC - cmp r1, r0 - bne _0807EFD8 - movs r0, 0x3 - bl sub_8077288 - b _0807EFDC - .pool -_0807EFD8: - bl sub_800AC34 -_0807EFDC: - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 -_0807EFE4: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0807F03A - .pool -_0807EFF0: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _0807F028 - ldr r1, [r2, 0x8] - ldr r0, =sub_80773AC - cmp r1, r0 - bne _0807F028 - bl sub_8077294 - cmp r0, 0 - beq _0807F03A - ldr r0, =0x03002700 - movs r1, 0 - strb r1, [r0] - ldr r0, =c2_080543C4 - bl SetMainCallback2 - b _0807F03A - .pool -_0807F028: - ldr r0, =0x03003124 - ldrb r1, [r0] - cmp r1, 0 - bne _0807F03A - ldr r0, =0x03002700 - strb r1, [r0] - ldr r0, =c2_080543C4 - bl SetMainCallback2 -_0807F03A: - bl sub_800B33C - lsls r0, 24 - cmp r0, 0 - bne _0807F048 - bl RunActiveTasks -_0807F048: - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807EB50 - - thumb_func_start c2_080543C4 -c2_080543C4: @ 807F068 - push {r4,r5,lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _0807F0BE - bl FreeAllWindowBuffers - movs r0, 0x3 - bl GetBgTilemapBuffer - bl Free - movs r0, 0x1 - bl GetBgTilemapBuffer - bl Free - movs r0, 0 - bl GetBgTilemapBuffer - bl Free - bl sub_805F094 - ldr r4, =0x020322a0 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _0807F0B6 - bl sub_800E084 -_0807F0B6: - ldr r0, =0x030022c0 - ldr r0, [r0, 0x8] - bl SetMainCallback2 -_0807F0BE: - bl RunActiveTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end c2_080543C4 - - thumb_func_start sub_807F0E4 -sub_807F0E4: @ 807F0E4 - push {lr} - sub sp, 0x4 - bl script_env_2_enable - ldr r0, =sub_807F110 - movs r1, 0xA - bl AddTask - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_807F0E4 - - thumb_func_start sub_807F110 -sub_807F110: @ 807F110 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0807F134 - ldr r0, =sub_807B270 - bl SetMainCallback2 - ldr r1, =0x03005dac - ldr r0, =sub_80AF168 - str r0, [r1] - adds r0, r4, 0 - bl remove_task -_0807F134: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807F110 - - thumb_func_start sub_807F14C -sub_807F14C: @ 807F14C - push {r4,r5,lr} - movs r5, 0 - movs r4, 0 -_0807F152: - ldr r0, =0x02032298 - ldrb r0, [r0, 0x1] - movs r1, 0x6 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - adds r1, r4, 0 - adds r1, 0x43 - bl pokemon_getattr - adds r0, r5, r0 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xB - bls _0807F152 - cmp r5, 0 - beq _0807F18A - ldr r0, =0x0000089b - bl FlagSet -_0807F18A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807F14C - - thumb_func_start sub_807F19C -sub_807F19C: @ 807F19C - push {lr} - bl sub_807B170 - pop {r0} - bx r0 - thumb_func_end sub_807F19C - - thumb_func_start sub_807F1A8 -sub_807F1A8: @ 807F1A8 - push {r4-r6,lr} - sub sp, 0x14 - adds r5, r0, 0 - adds r6, r1, 0 - adds r4, r2, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0xFF - bl FillWindowPixelBuffer - ldr r2, =0x020322a0 - ldr r0, [r2] - adds r0, 0xF6 - movs r3, 0 - movs r1, 0xF - strb r1, [r0] - ldr r0, [r2] - adds r0, 0xF7 - movs r1, 0x1 - strb r1, [r0] - ldr r0, [r2] - adds r0, 0xF8 - movs r1, 0x6 - strb r1, [r0] - str r3, [sp] - str r3, [sp, 0x4] - ldr r0, [r2] - adds r0, 0xF6 - str r0, [sp, 0x8] - lsls r4, 24 - asrs r4, 24 - str r4, [sp, 0xC] - str r6, [sp, 0x10] - adds r0, r5, 0 - movs r1, 0x1 - movs r2, 0 - movs r3, 0x2 - bl AddTextPrinterParametrized2 - adds r0, r5, 0 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807F1A8 - - thumb_func_start c3_08054588 -c3_08054588: @ 807F210 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - ldr r1, =gUnknown_08339090 - movs r2, 0 - ldrsh r0, [r4, r2] - lsls r0, 1 - adds r0, r1 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r2, r1, 0 - movs r3, 0x4 - ldrsh r0, [r4, r3] - cmp r0, 0 - bne _0807F254 - movs r0, 0x80 - lsls r0, 1 - cmp r1, r0 - beq _0807F25C - lsls r0, r1, 1 - ldr r1, =gUnknown_08337AA0 - adds r0, r1 - b _0807F25E - .pool -_0807F254: - movs r0, 0x80 - lsls r0, 1 - cmp r1, r0 - bne _0807F26C -_0807F25C: - ldr r0, =gUnknown_08337EA0 -_0807F25E: - movs r1, 0x30 - movs r2, 0x20 - bl gpu_pal_apply - b _0807F27A - .pool -_0807F26C: - lsls r0, r2, 1 - ldr r1, =gUnknown_08337CA0 - adds r0, r1 - movs r1, 0x30 - movs r2, 0x20 - bl gpu_pal_apply -_0807F27A: - ldr r0, =gUnknown_08339090 - movs r2, 0 - ldrsh r1, [r4, r2] - lsls r1, 1 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0 - bne _0807F298 - movs r3, 0x2 - ldrsh r0, [r4, r3] - cmp r0, 0 - bne _0807F298 - movs r0, 0xC3 - bl audio_play -_0807F298: - movs r0, 0x2 - ldrsh r2, [r4, r0] - ldr r1, =gUnknown_08339090 - movs r3, 0 - ldrsh r0, [r4, r3] - lsls r0, 1 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - cmp r2, r0 - bne _0807F2D8 - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - movs r0, 0 - strh r0, [r4, 0x2] - movs r2, 0 - ldrsh r0, [r4, r2] - lsls r0, 1 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0xFF - bne _0807F2DE - adds r0, r5, 0 - bl remove_task - b _0807F2DE - .pool -_0807F2D8: - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] -_0807F2DE: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end c3_08054588 - - thumb_func_start c3_0805465C -c3_0805465C: @ 807F2E4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r5, r0, r1 - movs r0, 0 - ldrsh r4, [r5, r0] - cmp r4, 0 - bne _0807F336 - ldr r2, =0x020322a0 - ldr r0, [r2] - adds r3, r0, 0 - adds r3, 0xFD - movs r1, 0x78 - strb r1, [r3] - adds r0, 0xFB - strb r1, [r0] - ldr r0, [r2] - adds r0, 0xFC - strb r4, [r0] - ldr r0, [r2] - adds r0, 0xFE - movs r1, 0xA0 - strb r1, [r0] - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl SetGpuRegBits - movs r0, 0x4A - movs r1, 0x10 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0x13 - bl SetGpuReg -_0807F336: - ldr r4, =0x020322a0 - ldr r0, [r4] - adds r1, r0, 0 - adds r1, 0xFD - ldrb r1, [r1] - adds r0, 0xFB - ldrb r0, [r0] - lsls r0, 8 - orrs r1, r0 - movs r0, 0x40 - bl SetGpuReg - ldr r0, [r4] - adds r1, r0, 0 - adds r1, 0xFE - ldrb r1, [r1] - adds r0, 0xFC - ldrb r0, [r0] - lsls r0, 8 - orrs r1, r0 - movs r0, 0x44 - bl SetGpuReg - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - ldr r1, [r4] - adds r1, 0xFB - ldrb r0, [r1] - subs r0, 0x5 - strb r0, [r1] - ldr r1, [r4] - adds r1, 0xFD - ldrb r0, [r1] - adds r0, 0x5 - strb r0, [r1] - ldr r0, [r4] - adds r0, 0xFB - ldrb r0, [r0] - cmp r0, 0x4F - bhi _0807F38E - adds r0, r6, 0 - bl remove_task -_0807F38E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end c3_0805465C - - thumb_func_start sub_807F39C -sub_807F39C: @ 807F39C - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r5, r0, r1 - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0807F3D8 - ldr r2, =0x020322a0 - ldr r0, [r2] - adds r0, 0xFB - movs r1, 0x50 - strb r1, [r0] - ldr r0, [r2] - adds r0, 0xFD - movs r1, 0xA0 - strb r1, [r0] - movs r0, 0x4A - movs r1, 0x10 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0x13 - bl SetGpuReg -_0807F3D8: - ldr r4, =0x020322a0 - ldr r0, [r4] - adds r1, r0, 0 - adds r1, 0xFD - ldrb r1, [r1] - adds r0, 0xFB - ldrb r0, [r0] - lsls r0, 8 - orrs r1, r0 - movs r0, 0x40 - bl SetGpuReg - ldr r0, [r4] - adds r1, r0, 0 - adds r1, 0xFE - ldrb r1, [r1] - adds r0, 0xFC - ldrb r0, [r0] - lsls r0, 8 - orrs r1, r0 - movs r0, 0x44 - bl SetGpuReg - ldr r0, [r4] - adds r0, 0xFB - ldrb r0, [r0] - cmp r0, 0x78 - beq _0807F44C - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - ldr r1, [r4] - adds r1, 0xFB - ldrb r0, [r1] - adds r0, 0x5 - strb r0, [r1] - ldr r1, [r4] - adds r1, 0xFD - ldrb r0, [r1] - subs r0, 0x5 - strb r0, [r1] - ldr r0, [r4] - adds r0, 0xFB - ldrb r0, [r0] - cmp r0, 0x73 - bls _0807F45C - ldr r2, =0x0000ffff - movs r0, 0x8 - movs r1, 0 - bl sub_80A2A20 - b _0807F45C - .pool -_0807F44C: - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl ClearGpuRegBits - adds r0, r6, 0 - bl remove_task -_0807F45C: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_807F39C - - thumb_func_start sub_807F464 -sub_807F464: @ 807F464 - push {r4,r5,lr} - sub sp, 0x4 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0xC - bls _0807F47A - b _0807F70C -_0807F47A: - lsls r0, 2 - ldr r1, =_0807F48C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0807F48C: - .4byte _0807F4C0 - .4byte _0807F4E8 - .4byte _0807F500 - .4byte _0807F550 - .4byte _0807F570 - .4byte _0807F5AC - .4byte _0807F5D0 - .4byte _0807F620 - .4byte _0807F64E - .4byte _0807F66C - .4byte _0807F694 - .4byte _0807F6C4 - .4byte _0807F6F8 -_0807F4C0: - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 - movs r0, 0x1 - strb r0, [r1] - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EF6D2 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0 - adds r1, r4, 0 - movs r2, 0 - bl sub_807F1A8 - b _0807F70C - .pool -_0807F4E8: - movs r0, 0 - bl sub_8077288 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r2, 0 - movs r1, 0x2 - b _0807F5BC - .pool -_0807F500: - bl sub_8077294 - cmp r0, 0 - bne _0807F50A - b _0807F70C -_0807F50A: - ldr r0, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r2 - movs r5, 0 - movs r1, 0x3 - strb r1, [r0] - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_082C8959 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0 - adds r1, r4, 0 - movs r2, 0 - bl sub_807F1A8 - movs r0, 0x15 - bl sav12_xor_increment - bl sub_8153380 - ldr r0, =0x020322a0 - ldr r0, [r0] - str r5, [r0, 0x64] - b _0807F70C - .pool -_0807F550: - ldr r0, =0x020322a0 - ldr r1, [r0] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0x5 - beq _0807F560 - b _0807F70C -_0807F560: - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 - movs r0, 0x4 - strb r0, [r1] - b _0807F70C - .pool -_0807F570: - bl sub_81533AC - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _0807F590 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r1, 0x5 - strb r1, [r0] - b _0807F70C - .pool -_0807F590: - ldr r0, =0x020322a0 - ldr r0, [r0] - str r1, [r0, 0x64] - ldr r0, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r2 - movs r1, 0x3 - strb r1, [r0] - b _0807F70C - .pool -_0807F5AC: - bl sub_81533E0 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r2, 0 - movs r1, 0x6 -_0807F5BC: - strb r1, [r0] - ldr r0, =0x020322a0 - ldr r0, [r0] - str r2, [r0, 0x64] - b _0807F70C - .pool -_0807F5D0: - ldr r4, =0x020322a0 - ldr r1, [r4] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0xA - bhi _0807F5E0 - b _0807F70C -_0807F5E0: - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - bne _0807F608 - bl GenerateRandomNumber - ldr r4, [r4] - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1E - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - str r0, [r4, 0x64] - b _0807F60E - .pool -_0807F608: - ldr r1, [r4] - movs r0, 0 - str r0, [r1, 0x64] -_0807F60E: - ldr r0, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r2 - movs r1, 0x7 - strb r1, [r0] - b _0807F70C - .pool -_0807F620: - ldr r0, =0x020322a0 - ldr r1, [r0] - ldr r0, [r1, 0x64] - cmp r0, 0 - bne _0807F648 - movs r0, 0x1 - bl sub_8077288 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r1, 0x8 - strb r1, [r0] - b _0807F70C - .pool -_0807F648: - subs r0, 0x1 - str r0, [r1, 0x64] - b _0807F70C -_0807F64E: - bl sub_8077294 - cmp r0, 0 - beq _0807F70C - bl sub_8153408 - ldr r0, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r2 - movs r1, 0x9 - strb r1, [r0] - b _0807F70C - .pool -_0807F66C: - ldr r0, =0x020322a0 - ldr r1, [r0] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0x3C - bls _0807F70C - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r0, 0x2 - bl sub_8077288 - b _0807F70C - .pool -_0807F694: - bl sub_8077294 - cmp r0, 0 - beq _0807F70C - movs r0, 0x3 - bl play_sound_effect - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r1, 0xB - strb r1, [r0] - b _0807F70C - .pool -_0807F6C4: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0807F70C - bl sub_80A3258 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0807F70C - movs r0, 0x3 - bl sub_8077288 - ldr r0, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r2 - movs r1, 0xC - strb r1, [r0] - b _0807F70C - .pool -_0807F6F8: - bl sub_8077294 - cmp r0, 0 - beq _0807F70C - ldr r0, =0x03002700 - movs r1, 0 - strb r1, [r0] - ldr r0, =c2_080543C4 - bl SetMainCallback2 -_0807F70C: - bl sub_800B33C - lsls r0, 24 - cmp r0, 0 - bne _0807F71A - bl RunActiveTasks -_0807F71A: - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807F464 - - thumb_func_start sub_807F738 -sub_807F738: @ 807F738 - push {lr} - ldr r0, =0x03007630 - ldr r1, =0x0000ffff - ldr r2, =0x020322a4 - ldr r2, [r2] - adds r2, 0x4C - movs r3, 0 - ldrsh r2, [r2, r3] - subs r2, 0x80 - lsls r2, 17 - asrs r2, 16 - bl MPlayPitchControl - pop {r0} - bx r0 - .pool - thumb_func_end sub_807F738 - - thumb_func_start sub_807F764 -sub_807F764: @ 807F764 - push {r4,lr} - sub sp, 0x10 - bl sub_8082DF4 - ldr r0, =0x020322a4 - ldr r0, [r0] - mov r12, r0 - movs r0, 0xA0 - lsls r0, 1 - add r0, r12 - ldr r1, [r0] - movs r0, 0xA2 - lsls r0, 1 - add r0, r12 - ldr r2, [r0] - movs r0, 0xA4 - lsls r0, 1 - add r0, r12 - movs r4, 0 - ldrsh r3, [r0, r4] - movs r0, 0xA5 - lsls r0, 1 - add r0, r12 - movs r4, 0 - ldrsh r0, [r0, r4] - str r0, [sp] - movs r0, 0xA6 - lsls r0, 1 - add r0, r12 - movs r4, 0 - ldrsh r0, [r0, r4] - str r0, [sp, 0x4] - movs r0, 0xA7 - lsls r0, 1 - add r0, r12 - movs r4, 0 - ldrsh r0, [r0, r4] - str r0, [sp, 0x8] - movs r0, 0xA8 - lsls r0, 1 - add r0, r12 - ldrh r0, [r0] - str r0, [sp, 0xC] - movs r0, 0x2 - bl SetBgAffine - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807F764 - - thumb_func_start sub_807F7D8 -sub_807F7D8: @ 807F7D8 - push {r4,r5,lr} - ldr r1, =0x020322a4 - ldr r0, [r1] - ldrb r0, [r0, 0x1] - adds r5, r1, 0 - cmp r0, 0x9 - bls _0807F7E8 - b _0807F9C8 -_0807F7E8: - lsls r0, 2 - ldr r1, =_0807F7FC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0807F7FC: - .4byte _0807F824 - .4byte _0807F854 - .4byte _0807F880 - .4byte _0807F8AC - .4byte _0807F8C8 - .4byte _0807F8F4 - .4byte _0807F910 - .4byte _0807F940 - .4byte _0807F950 - .4byte _0807F980 -_0807F824: - ldr r5, =gUnknown_08D91598 - adds r0, r5, 0 - bl sub_8034974 - adds r0, 0x64 - bl AllocZeroed - adds r1, r0, 0 - ldr r4, =0x020322a4 - ldr r0, [r4] - ldr r2, =0x000011bc - adds r0, r2 - str r1, [r0] - adds r0, r5, 0 - bl LZDecompressWram - ldr r1, [r4] - b _0807F966 - .pool -_0807F854: - ldr r1, =gUnknown_083390F4 - movs r2, 0x80 - lsls r2, 3 - movs r0, 0x2 - movs r3, 0 - bl CopyToBgTilemapBuffer - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - ldr r0, =gUnknown_083390D4 - movs r2, 0x80 - lsls r2, 1 - movs r1, 0 - bl gpu_pal_apply - b _0807F962 - .pool -_0807F880: - ldr r0, [r5] - ldr r1, =0x000011bc - adds r0, r1 - ldr r4, [r0] - ldr r0, =gUnknown_08D91598 - bl sub_8034974 - adds r2, r0, 0 - lsls r2, 16 - lsrs r2, 16 - movs r0, 0x2 - adds r1, r4, 0 - movs r3, 0 - bl LoadBgTiles - ldr r1, [r5] - b _0807F966 - .pool -_0807F8AC: - ldr r0, =gUnknown_08D91DB8 - ldr r1, [r5] - ldr r2, =0x000011bc - adds r1, r2 - ldr r1, [r1] - bl LZDecompressWram - ldr r1, [r5] - b _0807F966 - .pool -_0807F8C8: - ldr r0, [r5] - ldr r1, =0x000011bc - adds r0, r1 - ldr r4, [r0] - ldr r0, =gUnknown_08D91DB8 - bl sub_8034974 - adds r2, r0, 0 - lsls r2, 16 - lsrs r2, 16 - movs r0, 0x1 - adds r1, r4, 0 - movs r3, 0 - bl LoadBgTiles - ldr r1, [r5] - b _0807F966 - .pool -_0807F8F4: - ldr r0, =gUnknown_08D927EC - ldr r1, [r5] - ldr r2, =0x000011bc - adds r1, r2 - ldr r1, [r1] - bl LZDecompressWram - ldr r1, [r5] - b _0807F966 - .pool -_0807F910: - ldr r0, [r5] - ldr r1, =0x000011bc - adds r0, r1 - ldr r4, [r0] - ldr r0, =gUnknown_08D927EC - bl sub_8034974 - adds r2, r0, 0 - lsls r2, 16 - lsrs r2, 16 - movs r0, 0x1 - adds r1, r4, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - ldr r1, [r5] - b _0807F966 - .pool -_0807F940: - ldr r0, =gUnknown_083394F4 - movs r1, 0x80 - movs r2, 0x20 - bl gpu_pal_apply - b _0807F962 - .pool -_0807F950: - ldr r0, =gUnknown_08339AC0 - bl LoadObjectPic - ldr r0, =gUnknown_08339BD8 - bl LoadObjectPic - ldr r0, =gUnknown_08339B38 - bl LoadObjectPic -_0807F962: - ldr r0, =0x020322a4 - ldr r1, [r0] -_0807F966: - ldrb r0, [r1, 0x1] - adds r0, 0x1 - strb r0, [r1, 0x1] - b _0807F9C8 - .pool -_0807F980: - ldr r0, =gUnknown_08339C24 - bl LoadObjectPic - ldr r0, =gUnknown_08339C58 - bl LoadObjectPic - ldr r0, =gUnknown_08339AD0 - bl LoadTaggedObjectPalette - ldr r0, =gUnknown_08339AC8 - bl LoadTaggedObjectPalette - ldr r4, =0x020322a4 - ldr r0, [r4] - ldr r2, =0x000011bc - adds r0, r2 - ldr r0, [r0] - bl Free - ldr r1, [r4] - movs r0, 0 - strb r0, [r1, 0x1] - movs r0, 0x1 - b _0807F9CA - .pool -_0807F9C8: - movs r0, 0 -_0807F9CA: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_807F7D8 - - thumb_func_start sub_807F9D0 -sub_807F9D0: @ 807F9D0 - push {lr} - sub sp, 0x8 - movs r0, 0x1E - str r0, [sp] - movs r0, 0x14 - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuRegBits - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - add sp, 0x8 - pop {r0} - bx r0 - thumb_func_end sub_807F9D0 - - thumb_func_start sub_807FA34 -sub_807FA34: @ 807FA34 - push {r4,lr} - sub sp, 0x8 - ldr r0, =gUnknown_08339980 - bl InitWindows - lsls r0, 16 - cmp r0, 0 - beq _0807FA74 - bl DeactivateAllTextPrinters - movs r4, 0 -_0807FA4A: - lsls r0, r4, 24 - lsrs r0, 24 - movs r1, 0 - bl FillWindowPixelBuffer - adds r4, 0x1 - cmp r4, 0x4 - ble _0807FA4A - movs r0, 0x1E - str r0, [sp] - movs r0, 0x14 - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0xE0 - bl sub_81978B0 -_0807FA74: - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807FA34 - - thumb_func_start sub_807FA80 -sub_807FA80: @ 807FA80 - push {r4,lr} - ldr r4, =0x020322a4 - ldr r0, [r4] - cmp r0, 0 - bne _0807FA94 - movs r0, 0x8F - lsls r0, 5 - bl AllocZeroed - str r0, [r4] -_0807FA94: - ldr r0, [r4] - adds r0, 0x63 - movs r1, 0 - strb r1, [r0] - ldr r0, [r4] - strb r1, [r0] - ldr r0, [r4] - adds r0, 0x63 - strb r1, [r0] - ldr r0, =0x020375e0 - ldrb r0, [r0] - bl sub_807FE54 - ldr r0, =sub_807FAC8 - bl SetMainCallback2 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807FA80 - - thumb_func_start sub_807FAC8 -sub_807FAC8: @ 807FAC8 - push {r4-r6,lr} - sub sp, 0x4 - ldr r1, =0x020322a4 - ldr r0, [r1] - ldrb r0, [r0] - adds r6, r1, 0 - cmp r0, 0x6 - bls _0807FADA - b _0807FCE2 -_0807FADA: - lsls r0, 2 - ldr r1, =_0807FAEC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0807FAEC: - .4byte _0807FB08 - .4byte _0807FBAC - .4byte _0807FC38 - .4byte _0807FC4E - .4byte _0807FC64 - .4byte _0807FC90 - .4byte _0807FCB0 -_0807FB08: - movs r0, 0 - movs r1, 0 - bl SetGpuReg - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_08339974 - movs r0, 0x1 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r4, =0x020322a4 - ldr r1, [r4] - movs r0, 0xDC - lsls r0, 1 - adds r1, r0 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x000009b8 - adds r1, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - movs r0, 0 - movs r1, 0x1 - movs r2, 0xD0 - bl sub_809882C - movs r0, 0 - movs r1, 0x14 - movs r2, 0xF0 - bl copy_textbox_border_tile_patterns_to_vram - bl sub_807FA34 - ldr r1, [r4] - ldrb r0, [r1] - adds r0, 0x1 - movs r2, 0 - strb r0, [r1] - ldr r3, [r4] - movs r1, 0x8C - lsls r1, 1 - adds r0, r3, r1 - movs r1, 0 - strh r2, [r0] - movs r4, 0x8B - lsls r4, 1 - adds r0, r3, r4 - strh r2, [r0] - movs r0, 0x8D - lsls r0, 1 - adds r4, r3, r0 - movs r0, 0x50 - strh r0, [r4] - movs r4, 0x8E - lsls r4, 1 - adds r0, r3, r4 - strh r2, [r0] - adds r4, 0x2 - adds r0, r3, r4 - strh r2, [r0] - strb r1, [r3, 0x1] - bl sub_8082D28 - b _0807FCE2 - .pool -_0807FBAC: - bl sub_807F7D8 - lsls r0, 24 - cmp r0, 0 - bne _0807FBB8 - b _0807FCE2 -_0807FBB8: - movs r4, 0 - ldr r5, =gUnknown_083399C8 - ldr r6, =0x020322a4 -_0807FBBE: - ldrb r1, [r5] - ldrb r2, [r5, 0x1] - ldr r0, =gUnknown_08339AD8 - movs r3, 0x1 - bl AddObjectToFront - ldr r1, [r6] - adds r1, 0x50 - adds r1, r4 - strb r0, [r1] - ldr r0, [r6] - adds r0, 0x50 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - adds r1, r4, 0 - adds r1, 0x8 - lsls r1, 24 - lsrs r1, 24 - bl StartObjectImageAnim - adds r5, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - ble _0807FBBE - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _0807FC14 - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _0807FC14 - bl sub_800E0E8 - movs r0, 0 - movs r1, 0 - bl sub_800DFB4 -_0807FC14: - ldr r0, =sub_807F764 - bl SetVBlankCallback - b _0807FCA0 - .pool -_0807FC38: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - bl sub_8082D28 - b _0807FCA0 -_0807FC4E: - bl sub_807F9D0 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0807FCE2 - b _0807FCA0 - .pool -_0807FC64: - ldr r4, [r6] - ldr r0, =0x000011b8 - adds r4, r0 - ldr r5, =gUnknown_0833973A - bl sav2_get_text_speed - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_808417C - cmp r0, 0 - beq _0807FCE2 - ldr r1, [r6] - b _0807FCA4 - .pool -_0807FC90: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe -_0807FCA0: - ldr r0, =0x020322a4 - ldr r1, [r0] -_0807FCA4: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0807FCE2 - .pool -_0807FCB0: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _0807FCE2 - bl FreeAllWindowBuffers - movs r0, 0x2 - bl UnsetBgTilemapBuffer - movs r0, 0x1 - bl UnsetBgTilemapBuffer - movs r0, 0 - bl SetVBlankCallback - ldr r0, =sub_807FFA4 - bl sub_81AABF0 - ldr r0, =0x020322a4 - ldr r0, [r0] - strb r4, [r0] -_0807FCE2: - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl RunTextPrinters - bl fade_and_return_progress_probably - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807FAC8 - - thumb_func_start sub_807FD08 -sub_807FD08: @ 807FD08 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x3A] - ldrh r1, [r4, 0x30] - adds r0, r1 - strh r0, [r4, 0x30] - ldrh r1, [r4, 0x32] - ldrh r2, [r4, 0x36] - subs r1, r2 - ldrh r0, [r4, 0x3C] - adds r1, r0 - strh r1, [r4, 0x32] - ldrh r3, [r4, 0x2E] - adds r0, r3 - strh r0, [r4, 0x2E] - subs r2, 0x1 - strh r2, [r4, 0x36] - lsls r0, 16 - lsls r1, 16 - cmp r0, r1 - bge _0807FD56 - ldrh r0, [r4, 0x34] - subs r0, 0x1 - strh r0, [r4, 0x36] - strh r0, [r4, 0x34] - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _0807FD50 - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - b _0807FD56 -_0807FD50: - movs r0, 0x74 - bl audio_play -_0807FD56: - ldrh r0, [r4, 0x30] - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x32] - strh r0, [r4, 0x22] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_807FD08 - - thumb_func_start sub_807FD64 -sub_807FD64: @ 807FD64 - push {r4-r6,lr} - ldr r5, [sp, 0x10] - ldr r6, [sp, 0x14] - lsls r2, 16 - lsrs r2, 16 - movs r4, 0 - strh r2, [r0, 0x2E] - strh r1, [r0, 0x30] - strh r2, [r0, 0x32] - strh r3, [r0, 0x34] - movs r1, 0xA - strh r1, [r0, 0x36] - strh r4, [r0, 0x38] - strh r5, [r0, 0x3A] - strh r6, [r0, 0x3C] - ldr r1, =sub_807FD08 - str r1, [r0, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807FD64 - - thumb_func_start sub_807FD90 -sub_807FD90: @ 807FD90 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x8 - adds r6, r1, 0 - lsls r6, 24 - lsrs r6, 24 - lsls r0, 24 - movs r1, 0xF6 - lsls r1, 23 - adds r0, r1 - lsrs r0, 24 - movs r3, 0x1 - ands r3, r6 - movs r1, 0 - movs r2, 0x50 - bl sub_80D511C - lsls r0, 24 - lsrs r0, 24 - lsls r2, r0, 4 - mov r8, r2 - add r8, r0 - mov r3, r8 - lsls r3, 2 - mov r8, r3 - ldr r0, =0x02020630 - add r8, r0 - ldr r5, =gUnknown_08339C78 - lsls r4, r6, 2 - adds r4, r6 - lsls r4, 1 - adds r0, r4, r5 - movs r6, 0 - ldrsh r1, [r0, r6] - adds r0, r5, 0x2 - adds r0, r4, r0 - movs r3, 0 - ldrsh r2, [r0, r3] - adds r0, r5, 0x4 - adds r0, r4, r0 - movs r6, 0 - ldrsh r3, [r0, r6] - adds r0, r5, 0x6 - adds r0, r4, r0 - movs r6, 0 - ldrsh r0, [r0, r6] - str r0, [sp] - adds r5, 0x8 - adds r4, r5 - movs r5, 0 - ldrsh r0, [r4, r5] - str r0, [sp, 0x4] - mov r0, r8 - bl sub_807FD64 - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807FD90 - - thumb_func_start sub_807FE14 -sub_807FE14: @ 807FE14 - push {r4-r6,lr} - adds r6, r0, 0 - lsls r5, r1, 16 - lsrs r5, 16 - adds r0, r5, 0 - adds r0, 0x7C - lsls r0, 24 - lsrs r0, 24 - bl GetBerryInfo - adds r4, r0, 0 - strh r5, [r6] - adds r0, r6, 0x2 - adds r1, r4, 0 - bl CopyString - ldrb r0, [r4, 0x15] - strb r0, [r6, 0x9] - ldrb r0, [r4, 0x16] - strb r0, [r6, 0xA] - ldrb r0, [r4, 0x17] - strb r0, [r6, 0xB] - ldrb r0, [r4, 0x18] - strb r0, [r6, 0xC] - ldrb r0, [r4, 0x19] - strb r0, [r6, 0xD] - ldrb r0, [r4, 0x1A] - strb r0, [r6, 0xE] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_807FE14 - - thumb_func_start sub_807FE54 -sub_807FE54: @ 807FE54 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - beq _0807FE7C - cmp r5, 0x1 - bgt _0807FE68 - cmp r5, 0 - beq _0807FE72 - b _0807FF88 -_0807FE68: - cmp r5, 0x2 - beq _0807FEE8 - cmp r5, 0x3 - beq _0807FF3C - b _0807FF88 -_0807FE72: - ldr r0, =0x03005d98 - strb r5, [r0] - b _0807FF88 - .pool -_0807FE7C: - ldr r0, =0x03005d98 - strb r5, [r0] - ldr r0, =0x020322a4 - ldr r0, [r0] - adds r0, 0x7C - movs r1, 0x2 - strb r1, [r0] - ldr r4, =0x020229f0 - ldr r0, =0x03005d90 - ldr r1, [r0] - adds r0, r4, 0 - bl CopyString - movs r0, 0xD0 - lsls r0, 2 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _0807FEC8 - adds r0, r4, 0 - adds r0, 0x1C - ldr r1, =gUnknown_083397D0 - ldr r1, [r1, 0xC] - bl CopyString - b _0807FED4 - .pool -_0807FEC8: - adds r0, r4, 0 - adds r0, 0x1C - ldr r1, =gUnknown_083397D0 - ldr r1, [r1] - bl CopyString -_0807FED4: - ldr r1, =0x020229e8 - movs r0, 0x2 - strh r0, [r1, 0x1A] - strh r0, [r1, 0x36] - b _0807FF88 - .pool -_0807FEE8: - ldr r0, =0x03005d98 - strb r5, [r0] - ldr r0, =0x020322a4 - ldr r0, [r0] - adds r0, 0x7C - movs r1, 0x3 - strb r1, [r0] - ldr r6, =0x020229f0 - ldr r0, =0x03005d90 - ldr r1, [r0] - adds r0, r6, 0 - bl CopyString - adds r0, r6, 0 - adds r0, 0x1C - ldr r4, =gUnknown_083397D0 - ldr r1, [r4, 0x10] - bl CopyString - adds r0, r6, 0 - adds r0, 0x38 - ldr r1, [r4, 0x8] - bl CopyString - adds r0, r6, 0 - subs r0, 0x8 - strh r5, [r0, 0x1A] - strh r5, [r0, 0x36] - adds r0, 0x52 - strh r5, [r0] - b _0807FF88 - .pool -_0807FF3C: - ldr r0, =0x03005d98 - strb r5, [r0] - ldr r0, =0x020322a4 - ldr r0, [r0] - adds r0, 0x7C - movs r1, 0x4 - strb r1, [r0] - ldr r5, =0x020229f0 - ldr r0, =0x03005d90 - ldr r1, [r0] - adds r0, r5, 0 - bl CopyString - adds r0, r5, 0 - adds r0, 0x1C - ldr r4, =gUnknown_083397D0 - ldr r1, [r4, 0x14] - bl CopyString - adds r0, r5, 0 - adds r0, 0x38 - ldr r1, [r4, 0x4] - bl CopyString - adds r0, r5, 0 - adds r0, 0x54 - ldr r1, [r4, 0x8] - bl CopyString - adds r0, r5, 0 - subs r0, 0x8 - movs r1, 0x2 - strh r1, [r0, 0x1A] - strh r1, [r0, 0x36] - adds r0, 0x52 - strh r1, [r0] - adds r0, 0x1C - strh r1, [r0] -_0807FF88: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807FE54 - - thumb_func_start sub_807FFA4 -sub_807FFA4: @ 807FFA4 - push {r4,r5,lr} - movs r0, 0 - movs r1, 0 - bl SetGpuReg - ldr r4, =0x020322a4 - ldr r0, [r4] - cmp r0, 0 - bne _0807FFC0 - movs r0, 0x8F - lsls r0, 5 - bl AllocZeroed - str r0, [r4] -_0807FFC0: - ldr r0, [r4] - movs r1, 0 - strb r1, [r0] - ldr r0, [r4] - movs r2, 0x86 - lsls r2, 1 - adds r0, r2 - str r1, [r0] - movs r2, 0 - ldr r5, =0x020375e0 - movs r3, 0 -_0807FFD6: - ldr r0, [r4] - lsls r1, r2, 1 - adds r0, 0x74 - adds r0, r1 - strh r3, [r0] - adds r2, 0x1 - cmp r2, 0x3 - ble _0807FFD6 - ldrb r0, [r5] - bl sub_807FE54 - ldrh r0, [r5] - cmp r0, 0 - bne _08080008 - ldr r0, =sub_8080018 - bl SetMainCallback2 - b _0808000E - .pool -_08080008: - ldr r0, =sub_80808D4 - bl SetMainCallback2 -_0808000E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807FFA4 - - thumb_func_start sub_8080018 -sub_8080018: @ 8080018 - push {r4-r7,lr} - sub sp, 0x4 - ldr r1, =0x020322a4 - ldr r0, [r1] - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0x15 - bls _0808002A - b _08080546 -_0808002A: - lsls r0, 2 - ldr r1, =_0808003C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0808003C: - .4byte _08080094 - .4byte _08080100 - .4byte _08080120 - .4byte _0808019C - .4byte _080801AE - .4byte _080801C8 - .4byte _08080546 - .4byte _08080546 - .4byte _080801F8 - .4byte _08080248 - .4byte _0808026C - .4byte _08080302 - .4byte _0808035C - .4byte _080803D4 - .4byte _08080408 - .4byte _0808049C - .4byte _080804D0 - .4byte _08080546 - .4byte _080804F8 - .4byte _080804E4 - .4byte _080804EA - .4byte _08080508 -_08080094: - bl sub_8080588 - ldr r1, =0x020229c6 - ldr r2, =0x00004422 - adds r0, r2, 0 - strh r0, [r1] - ldr r2, =0x020322a4 - ldr r0, [r2] - adds r0, 0x72 - movs r1, 0 - strb r1, [r0] - movs r5, 0 - movs r6, 0 - movs r7, 0x92 - lsls r7, 1 -_080800B2: - ldr r0, [r2] - lsls r1, r5, 1 - adds r0, 0x64 - adds r0, r1 - strh r6, [r0] - adds r4, r5, 0x1 - adds r1, r5 - lsls r1, 1 - movs r3, 0x2 -_080800C4: - ldr r0, [r2] - adds r0, r7 - adds r0, r1 - strh r6, [r0] - adds r1, 0x2 - subs r3, 0x1 - cmp r3, 0 - bge _080800C4 - adds r5, r4, 0 - cmp r5, 0x3 - ble _080800B2 - ldr r3, =0x020322a4 - ldr r4, [r3] - adds r1, r4, 0 - adds r1, 0x70 - movs r2, 0 - movs r0, 0 - strh r0, [r1] - subs r1, 0x22 - strh r0, [r1] - strb r2, [r4, 0x1] - ldr r1, [r3] - b _080804FC - .pool -_08080100: - bl sub_807F7D8 - lsls r0, 24 - cmp r0, 0 - bne _0808010C - b _08080546 -_0808010C: - ldr r0, =0x020322a4 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - bl sub_8082D28 - b _08080546 - .pool -_08080120: - movs r5, 0 - ldr r4, =gUnknown_083399C8 - ldr r6, =0x020322a4 -_08080126: - ldrb r1, [r4] - ldrb r2, [r4, 0x1] - ldr r0, =gUnknown_08339AD8 - movs r3, 0x1 - bl AddObjectToFront - ldr r1, [r6] - adds r1, 0x54 - adds r1, r5 - strb r0, [r1] - ldr r0, [r6] - adds r0, 0x54 - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - adds r1, r5, 0 - adds r1, 0x8 - lsls r1, 24 - lsrs r1, 24 - bl StartObjectImageAnim - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _08080126 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _0808016A - b _080804F8 -_0808016A: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _08080174 - b _080804F8 -_08080174: - bl sub_800E0E8 - movs r0, 0 - movs r1, 0 - bl sub_800DFB4 - b _080804F8 - .pool -_0808019C: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - b _080804F8 -_080801AE: - bl sub_807F9D0 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080801C0 - b _08080546 -_080801C0: - b _080804F8 - .pool -_080801C8: - ldr r4, =0x020322a4 - ldr r0, [r4] - ldr r3, =0x000011b8 - adds r0, r3 - ldr r1, =gUnknown_0833981A - movs r2, 0 - bl sub_808417C - ldr r1, [r4] - movs r2, 0 - movs r0, 0x8 - strb r0, [r1] - ldr r0, [r4] - movs r1, 0x84 - lsls r1, 1 - adds r0, r1 - str r2, [r0] - b _08080546 - .pool -_080801F8: - ldr r4, =0x020322a4 - ldr r1, [r4] - ldrb r0, [r1] - adds r0, 0x1 - movs r6, 0 - strb r0, [r1] - ldr r0, [r4] - movs r2, 0x8A - lsls r2, 1 - adds r0, r2 - strb r6, [r0] - ldr r0, [r4] - movs r5, 0xAC - lsls r5, 1 - adds r0, r5 - ldr r1, =0x0203ce7c - ldrh r1, [r1] - bl sub_807FE14 - ldr r0, =0x020228c4 - ldr r1, [r4] - adds r1, r5 - movs r2, 0x10 - bl memcpy - bl sub_800ADF8 - ldr r0, [r4] - movs r3, 0x84 - lsls r3, 1 - adds r0, r3 - str r6, [r0] - b _08080546 - .pool -_08080248: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _08080254 - b _08080546 -_08080254: - bl sub_800A5B4 - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - beq _08080264 - b _080804F8 -_08080264: - movs r0, 0x4 - bl sub_800A4D8 - b _080804F8 -_0808026C: - ldr r6, =0x020322a4 - ldr r1, [r6] - movs r0, 0x84 - lsls r0, 1 - adds r1, r0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - cmp r0, 0x14 - bgt _08080282 - b _08080546 -_08080282: - movs r0, 0x4 - movs r1, 0x1 - bl sub_8197DF8 - bl sub_800A550 - adds r4, r0, 0 - bl sub_800A9D8 - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - beq _0808029E - b _08080546 -_0808029E: - movs r5, 0 - adds r7, r6, 0 - movs r6, 0xAC - lsls r6, 1 - b _080802D4 - .pool -_080802AC: - ldr r0, [r7] - lsls r4, r5, 4 - adds r0, r4, r0 - adds r0, r6 - lsls r1, r5, 8 - ldr r2, =0x020223c4 - adds r1, r2 - movs r2, 0x10 - bl memcpy - ldr r0, [r7] - lsls r2, r5, 1 - adds r1, r0, 0 - adds r1, 0x74 - adds r1, r2 - adds r0, r4 - adds r0, r6 - ldrh r0, [r0] - strh r0, [r1] - adds r5, 0x1 -_080802D4: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - blt _080802AC - bl sub_800A5B4 - b _080804F8 - .pool -_080802EC: - ldrb r1, [r4] - lsls r1, 1 - adds r0, r2, 0 - adds r0, 0x74 - adds r0, r1 - ldrh r0, [r0] - lsls r1, r5, 24 - lsrs r1, 24 - bl sub_807FD90 - b _08080336 -_08080302: - bl sub_8009FCC - ldr r2, =0x020322a4 - ldr r1, [r2] - adds r1, 0x7C - strb r0, [r1] - movs r5, 0 - ldr r2, [r2] - movs r1, 0x8A - lsls r1, 1 - adds r4, r2, r1 - ldr r1, =gUnknown_083399D0 - adds r0, r2, 0 - adds r0, 0x7C - ldrb r0, [r0] - subs r0, 0x2 - lsls r0, 2 - ldrb r3, [r4] - adds r0, r1 -_08080328: - ldrb r1, [r0] - cmp r3, r1 - beq _080802EC - adds r0, 0x1 - adds r5, 0x1 - cmp r5, 0x3 - ble _08080328 -_08080336: - ldr r3, =0x020322a4 - ldr r1, [r3] - movs r0, 0x84 - lsls r0, 1 - adds r2, r1, r0 - movs r0, 0 - str r0, [r2] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r1, [r3] - movs r2, 0x8A - lsls r2, 1 - adds r1, r2 - b _080804FC - .pool -_0808035C: - ldr r3, [r2] - movs r0, 0x84 - lsls r0, 1 - adds r1, r3, r0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - cmp r0, 0x3C - bgt _08080370 - b _08080546 -_08080370: - movs r1, 0x8A - lsls r1, 1 - adds r0, r3, r1 - adds r1, r3, 0 - adds r1, 0x7C - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bcc _080803B8 - ldrb r0, [r3] - adds r0, 0x1 - strb r0, [r3] - ldr r2, [r2] - ldr r3, =gUnknown_083399DC - ldr r1, =gUnknown_083399E4 - adds r0, r2, 0 - adds r0, 0x7C - ldrb r0, [r0] - subs r0, 0x2 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r3 - ldr r3, =0xffffa800 - adds r1, r3, 0 - ldrh r0, [r0] - adds r1, r0 - adds r2, 0x4A - strh r1, [r2] - b _080803BE - .pool -_080803B8: - ldrb r0, [r3] - subs r0, 0x1 - strb r0, [r3] -_080803BE: - ldr r0, =0x020322a4 - ldr r0, [r0] - movs r1, 0x84 - lsls r1, 1 - adds r0, r1 - movs r1, 0 - str r1, [r0] - b _08080546 - .pool -_080803D4: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _080803E0 - b _08080546 -_080803E0: - ldr r2, =0x020322a4 - ldr r1, [r2] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r2] - movs r2, 0xA0 - lsls r2, 1 - adds r0, r2 - bl sub_8082CB4 - movs r0, 0x2B - bl audio_play - movs r0, 0x2 - bl ShowBg - b _08080546 - .pool -_08080408: - movs r1, 0x80 - lsls r1, 3 - movs r0, 0 - bl SetGpuRegBits - ldr r4, =0x020322a4 - ldr r2, [r4] - adds r1, r2, 0 - adds r1, 0x4A - movs r3, 0x80 - lsls r3, 2 - adds r0, r3, 0 - ldrh r3, [r1] - adds r0, r3 - strh r0, [r1] - movs r0, 0x8D - lsls r0, 1 - adds r1, r2, r0 - ldrh r0, [r1] - adds r0, 0x4 - strh r0, [r1] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xFF - bls _0808048C - movs r0, 0xC - movs r1, 0x2 - bl SetGpuRegBits - ldr r1, [r4] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r3, [r4] - movs r2, 0x8D - lsls r2, 1 - adds r1, r3, r2 - movs r0, 0x80 - lsls r0, 1 - strh r0, [r1] - ldr r2, =gUnknown_083399DC - ldr r1, =gUnknown_083399E4 - adds r0, r3, 0 - adds r0, 0x7C - ldrb r0, [r0] - subs r0, 0x2 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - adds r1, r3, 0 - adds r1, 0x4A - strh r0, [r1] - movs r0, 0x84 - lsls r0, 1 - adds r1, r3, r0 - movs r0, 0 - str r0, [r1] - movs r0, 0x34 - bl audio_play - bl sub_808074C - bl sub_80807BC -_0808048C: - ldr r0, [r4] - b _080804BE - .pool -_0808049C: - bl sub_8083380 - lsls r0, 24 - cmp r0, 0 - beq _080804BA - ldr r0, =0x020322a4 - ldr r1, [r0] - movs r3, 0x84 - lsls r3, 1 - adds r2, r1, r3 - movs r0, 0 - str r0, [r2] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080804BA: - ldr r0, =0x020322a4 - ldr r0, [r0] -_080804BE: - movs r1, 0xA0 - lsls r1, 1 - adds r0, r1 - bl sub_8082CB4 - b _08080546 - .pool -_080804D0: - ldr r0, =gUnknown_08339C2C - movs r2, 0x10 - negs r2, r2 - movs r1, 0x78 - movs r3, 0x3 - bl AddObjectToFront - b _080804F8 - .pool -_080804E4: - bl sub_800ADF8 - b _080804F8 -_080804EA: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08080546 - bl sub_800A418 -_080804F8: - ldr r0, =0x020322a4 - ldr r1, [r0] -_080804FC: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08080546 - .pool -_08080508: - ldr r5, =0x020322a4 - ldr r3, [r5] - adds r1, r3, 0 - adds r1, 0x4C - movs r2, 0 - movs r0, 0x80 - strh r0, [r1] - movs r1, 0x82 - lsls r1, 1 - adds r0, r3, r1 - str r2, [r0] - ldr r0, =sub_8081898 - bl SetMainCallback2 - bl current_map_music_get - lsls r0, 16 - lsrs r0, 16 - ldr r4, =0x00000193 - cmp r0, r4 - beq _08080540 - bl current_map_music_get - ldr r1, [r5] - movs r2, 0xAA - lsls r2, 1 - adds r1, r2 - strh r0, [r1] -_08080540: - adds r0, r4, 0 - bl song_play_for_text -_08080546: - ldr r0, =0x020322a4 - ldr r1, [r0] - movs r3, 0x8E - lsls r3, 1 - adds r0, r1, r3 - movs r2, 0 - ldrsh r0, [r0, r2] - adds r3, 0x2 - adds r1, r3 - movs r2, 0 - ldrsh r1, [r1, r2] - bl nullsub_31 - bl RunActiveTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl RunTextPrinters - bl fade_and_return_progress_probably - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8080018 - - thumb_func_start sub_8080588 -sub_8080588: @ 8080588 - push {r4,lr} - movs r0, 0 - movs r1, 0 - bl SetGpuReg - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - bl clear_tasks - ldr r0, =sub_807F764 - bl SetVBlankCallback - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_08339974 - movs r0, 0x1 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r4, =0x020322a4 - ldr r1, [r4] - movs r0, 0xDC - lsls r0, 1 - adds r1, r0 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r3, =0x000009b8 - adds r1, r3 - movs r0, 0x2 - bl SetBgTilemapBuffer - movs r0, 0 - movs r1, 0x1 - movs r2, 0xD0 - bl sub_809882C - movs r0, 0 - movs r1, 0x14 - movs r2, 0xF0 - bl copy_textbox_border_tile_patterns_to_vram - bl sub_807FA34 - ldr r2, [r4] - adds r0, r2, 0 - adds r0, 0x44 - movs r1, 0 - strh r1, [r0] - adds r0, 0x8 - strh r1, [r0] - subs r0, 0x2 - strh r1, [r0] - adds r0, 0x4 - strh r1, [r0] - movs r3, 0x8E - lsls r3, 1 - adds r0, r2, r3 - strh r1, [r0] - adds r3, 0x2 - adds r0, r2, r3 - strh r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8080588 - - thumb_func_start task_tutorial_oak_boy_girl -task_tutorial_oak_boy_girl: @ 8080624 - push {lr} - lsls r0, 16 - lsls r1, 24 - lsrs r0, 24 - adds r2, r0, 0 - adds r2, 0x18 - ldr r0, =0x020322a4 - ldr r0, [r0] - lsrs r1, 23 - adds r0, 0x96 - adds r0, r1 - ldrb r0, [r0] - ldr r1, =gUnknown_083399E7 - adds r0, r1 - ldrb r1, [r0] - cmp r2, r1 - bcc _0808066C - adds r0, r1, 0 - adds r0, 0x30 - cmp r2, r0 - bcs _0808066C - subs r0, 0x1C - cmp r2, r0 - bcc _08080668 - adds r0, 0x8 - cmp r2, r0 - bcs _08080668 - movs r0, 0x2 - b _0808066E - .pool -_08080668: - movs r0, 0x1 - b _0808066E -_0808066C: - movs r0, 0 -_0808066E: - pop {r1} - bx r1 - thumb_func_end task_tutorial_oak_boy_girl - - thumb_func_start sub_8080674 -sub_8080674: @ 8080674 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 24 - lsrs r1, 24 - movs r6, 0 - cmp r5, 0xAF - bne _080806AC - movs r4, 0 - subs r7, r1, 0x1 - adds r2, 0x9 -_08080690: - adds r0, r2, r6 - adds r1, r2, r4 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bls _0808069E - adds r6, r4, 0 -_0808069E: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x4 - bls _08080690 - adds r0, r6, 0x5 - b _080806C4 -_080806AC: - adds r0, r5, 0 - subs r0, 0x85 - lsls r0, 16 - lsrs r6, r0, 16 - subs r7, r1, 0x1 - cmp r6, 0x4 - bls _080806C8 - adds r0, r6, 0 - movs r1, 0x5 - bl __umodsi3 - adds r0, 0x5 -_080806C4: - lsls r0, 16 - lsrs r6, r0, 16 -_080806C8: - movs r4, 0 - cmp r4, r7 - bge _08080734 - ldr r0, =gUnknown_08339CA0 - mov r9, r0 - adds r0, r5, 0 - subs r0, 0xA3 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 -_080806DC: - lsls r0, r6, 1 - adds r0, r6 - adds r0, r4, r0 - add r0, r9 - ldrb r5, [r0] - movs r0, 0xD0 - lsls r0, 2 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _0808071A - ldr r0, =0x020375e0 - ldrh r0, [r0] - cmp r0, 0x1 - bne _0808071A - adds r0, r6, 0 - movs r1, 0x5 - bl __umodsi3 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =gUnknown_08339CBE - adds r0, r6, r0 - ldrb r5, [r0] - mov r0, r8 - cmp r0, 0x4 - bhi _0808071A - subs r0, r5, 0x5 - lsls r0, 16 - lsrs r5, r0, 16 -_0808071A: - adds r4, 0x1 - lsls r0, r4, 24 - lsrs r0, 24 - adds r1, r5, 0 - adds r1, 0x85 - lsls r1, 16 - lsrs r1, 16 - bl sub_8082FDC - lsls r4, 16 - lsrs r4, 16 - cmp r4, r7 - blt _080806DC -_08080734: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8080674 - - thumb_func_start sub_808074C -sub_808074C: @ 808074C - push {r4-r7,lr} - movs r4, 0 - ldr r7, =0x020322a4 - movs r6, 0xFF - ldr r5, =gUnknown_083399D0 -_08080756: - ldr r3, [r7] - lsls r2, r4, 1 - adds r0, r3, 0 - adds r0, 0x96 - adds r0, r2 - strh r6, [r0] - adds r1, r3, 0 - adds r1, 0x8E - adds r1, r2 - adds r0, r3, 0 - adds r0, 0x7C - ldrb r0, [r0] - subs r0, 0x2 - lsls r0, 2 - adds r0, r4, r0 - adds r0, r5 - ldrb r0, [r0] - strh r0, [r1] - adds r4, 0x1 - cmp r4, 0x3 - ble _08080756 - movs r3, 0 - ldr r7, =0x020322a4 -_08080784: - movs r4, 0 - adds r6, r3, 0x1 - lsls r5, r3, 1 -_0808078A: - ldr r2, [r7] - lsls r0, r4, 1 - adds r1, r2, 0 - adds r1, 0x8E - adds r1, r0 - ldrh r0, [r1] - cmp r0, r3 - bne _080807A2 - adds r0, r2, 0 - adds r0, 0x96 - adds r0, r5 - strh r4, [r0] -_080807A2: - adds r4, 0x1 - cmp r4, 0x3 - ble _0808078A - adds r3, r6, 0 - cmp r3, 0x3 - ble _08080784 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808074C - - thumb_func_start sub_80807BC -sub_80807BC: @ 80807BC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - movs r0, 0 - mov r10, r0 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _080807DE - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 -_080807DE: - movs r6, 0 - ldr r7, =0x020322a4 - mov r8, r6 -_080807E4: - ldr r2, [r7] - lsls r5, r6, 1 - adds r0, r2, 0 - adds r0, 0x8E - adds r3, r0, r5 - ldrh r0, [r3] - cmp r0, 0xFF - beq _080808B6 - adds r1, r2, 0 - adds r1, 0x50 - ldrh r3, [r3] - adds r1, r3 - adds r0, r2, 0 - adds r0, 0x54 - adds r0, r6 - ldrb r0, [r0] - movs r2, 0 - mov r9, r2 - strb r0, [r1] - ldr r0, [r7] - adds r1, r0, 0 - adds r1, 0x8E - adds r1, r5 - adds r0, 0x50 - ldrh r1, [r1] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - mov r1, r8 - lsrs r4, r1, 24 - adds r1, r4, 0 - bl StartObjectImageAnim - add r1, sp, 0x8 - movs r0, 0xFF - strb r0, [r1] - ldr r0, [r7] - adds r0, 0x8E - adds r0, r5 - ldrh r0, [r0] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r0, =0x020229f0 - adds r1, r0 - add r0, sp, 0x8 - bl CopyString - movs r0, 0x1 - add r1, sp, 0x8 - movs r2, 0x38 - bl GetStringCenterAlignXOffset - adds r2, r0, 0 - ldr r0, [r7] - adds r0, 0x8E - adds r0, r5 - mov r5, r8 - ldrh r0, [r0] - cmp r10, r0 - bne _08080890 - lsls r2, 24 - lsrs r2, 24 - mov r0, r9 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - adds r0, r4, 0 - add r1, sp, 0x8 - movs r3, 0x1 - bl sub_80840D4 - b _080808A6 - .pool -_08080890: - lsls r2, 24 - lsrs r2, 24 - mov r1, r9 - str r1, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - adds r0, r4, 0 - add r1, sp, 0x8 - movs r3, 0x1 - bl sub_80840D4 -_080808A6: - lsrs r4, r5, 24 - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram -_080808B6: - movs r2, 0x80 - lsls r2, 17 - add r8, r2 - adds r6, 0x1 - cmp r6, 0x3 - ble _080807E4 - 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_80807BC - - thumb_func_start sub_80808D4 -sub_80808D4: @ 80808D4 - push {r4-r7,lr} - sub sp, 0x4 - ldr r1, =0x020322a4 - ldr r0, [r1] - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0x15 - bls _080808E6 - b _08080DAE -_080808E6: - lsls r0, 2 - ldr r1, =_080808F8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080808F8: - .4byte _08080950 - .4byte _080809E4 - .4byte _08080A04 - .4byte _08080A58 - .4byte _08080A84 - .4byte _08080DAE - .4byte _08080DAE - .4byte _08080DAE - .4byte _08080ABC - .4byte _08080DAE - .4byte _08080DAE - .4byte _08080AEC - .4byte _08080B3C - .4byte _08080BB0 - .4byte _08080BDC - .4byte _08080C78 - .4byte _08080CA0 - .4byte _08080DAE - .4byte _08080CAE - .4byte _08080CAE - .4byte _08080CAE - .4byte _08080CC4 -_08080950: - bl sub_800B4C0 - bl sub_8080588 - ldr r4, =0x0203ce7c - ldrh r1, [r4] - movs r0, 0 - bl sub_8082FDC - ldr r5, =0x020322a4 - ldr r0, [r5] - movs r6, 0xAC - lsls r6, 1 - adds r0, r6 - ldrh r1, [r4] - bl sub_807FE14 - ldrh r0, [r4] - ldr r2, [r5] - adds r1, r2, 0 - adds r1, 0x7C - ldrb r1, [r1] - adds r2, r6 - bl sub_8080674 - movs r4, 0 - movs r6, 0 - ldr r0, =0x020229c6 - mov r12, r0 - movs r7, 0x92 - lsls r7, 1 -_0808098E: - ldr r0, [r5] - lsls r1, r4, 1 - adds r0, 0x64 - adds r0, r1 - strh r6, [r0] - adds r3, r4, 0x1 - adds r1, r4 - lsls r1, 1 - movs r2, 0x2 -_080809A0: - ldr r0, [r5] - adds r0, r7 - adds r0, r1 - strh r6, [r0] - adds r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _080809A0 - adds r4, r3, 0 - cmp r4, 0x3 - ble _0808098E - ldr r4, =0x020322a4 - ldr r3, [r4] - adds r1, r3, 0 - adds r1, 0x70 - movs r2, 0 - movs r0, 0 - strh r0, [r1] - strb r2, [r3, 0x1] - ldr r1, =0x00004422 - adds r0, r1, 0 - mov r2, r12 - strh r0, [r2] - ldr r1, [r4] - b _08080CB2 - .pool -_080809E4: - bl sub_807F7D8 - lsls r0, 24 - cmp r0, 0 - bne _080809F0 - b _08080DAE -_080809F0: - ldr r0, =0x020322a4 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - bl sub_8082D28 - b _08080DAE - .pool -_08080A04: - movs r4, 0 - ldr r5, =gUnknown_083399C8 - ldr r6, =0x020322a4 -_08080A0A: - ldrb r1, [r5] - ldrb r2, [r5, 0x1] - ldr r0, =gUnknown_08339AD8 - movs r3, 0x1 - bl AddObjectToFront - ldr r1, [r6] - adds r1, 0x54 - adds r1, r4 - strb r0, [r1] - ldr r0, [r6] - adds r0, 0x54 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - adds r1, r4, 0 - adds r1, 0x8 - lsls r1, 24 - lsrs r1, 24 - bl StartObjectImageAnim - adds r5, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - ble _08080A0A - b _08080CAE - .pool -_08080A58: - movs r0, 0x1 - negs r0, r0 - movs r4, 0 - str r4, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r2, =0x020322a4 - ldr r1, [r2] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r2] - movs r3, 0x84 - lsls r3, 1 - adds r0, r3 - str r4, [r0] - b _08080DAE - .pool -_08080A84: - ldr r4, =0x020322a4 - ldr r1, [r4] - movs r5, 0x84 - lsls r5, 1 - adds r1, r5 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - cmp r0, 0x2 - bne _08080A9C - bl sub_807F9D0 -_08080A9C: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08080AAA - b _08080DAE -_08080AAA: - ldr r1, [r4] - movs r0, 0x8 - strb r0, [r1] - b _08080DAE - .pool -_08080ABC: - ldr r2, =0x020322a4 - ldr r1, [r2] - movs r3, 0 - movs r0, 0xB - strb r0, [r1] - ldr r0, [r2] - movs r1, 0x8A - lsls r1, 1 - adds r0, r1 - strb r3, [r0] - b _08080DAE - .pool -_08080AD8: - lsls r1, 1 - adds r0, r3, 0 - adds r0, 0x74 - adds r0, r1 - ldrh r0, [r0] - lsls r1, r4, 24 - lsrs r1, 24 - bl sub_807FD90 - b _08080B16 -_08080AEC: - movs r4, 0 - ldr r2, =gUnknown_083399D0 - ldr r0, =0x020322a4 - ldr r3, [r0] - adds r0, r3, 0 - adds r0, 0x7C - ldrb r0, [r0] - subs r0, 0x2 - lsls r0, 2 - movs r5, 0x8A - lsls r5, 1 - adds r1, r3, r5 - ldrb r1, [r1] - adds r0, r2 -_08080B08: - ldrb r2, [r0] - cmp r1, r2 - beq _08080AD8 - adds r0, 0x1 - adds r4, 0x1 - cmp r4, 0x3 - ble _08080B08 -_08080B16: - ldr r3, =0x020322a4 - ldr r1, [r3] - movs r5, 0x84 - lsls r5, 1 - adds r2, r1, r5 - movs r0, 0 - str r0, [r2] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r1, [r3] - movs r0, 0x8A - lsls r0, 1 - adds r1, r0 - b _08080CB2 - .pool -_08080B3C: - ldr r3, [r2] - movs r2, 0x84 - lsls r2, 1 - adds r1, r3, r2 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - cmp r0, 0x3C - bgt _08080B50 - b _08080DAE -_08080B50: - movs r5, 0x8A - lsls r5, 1 - adds r0, r3, r5 - adds r4, r3, 0 - adds r4, 0x7C - ldrb r0, [r0] - ldrb r1, [r4] - cmp r0, r1 - bcc _08080B94 - ldr r2, =gUnknown_083399DC - ldr r1, =gUnknown_083399E4 - ldrb r0, [r4] - subs r0, 0x2 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r2 - ldr r2, =0xffffa800 - adds r1, r2, 0 - ldrh r0, [r0] - adds r1, r0 - adds r0, r3, 0 - adds r0, 0x4A - strh r1, [r0] - ldrb r0, [r3] - adds r0, 0x1 - b _08080B98 - .pool -_08080B94: - ldrb r0, [r3] - subs r0, 0x1 -_08080B98: - strb r0, [r3] - ldr r0, =0x020322a4 - ldr r0, [r0] - movs r3, 0x84 - lsls r3, 1 - adds r0, r3 - movs r1, 0 - str r1, [r0] - b _08080DAE - .pool -_08080BB0: - ldr r4, =0x020322a4 - ldr r1, [r4] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - bl sub_808074C - movs r0, 0x2B - bl audio_play - ldr r0, [r4] - movs r5, 0xA0 - lsls r5, 1 - adds r0, r5 - bl sub_8082CB4 - movs r0, 0x2 - bl ShowBg - b _08080DAE - .pool -_08080BDC: - movs r1, 0x80 - lsls r1, 3 - movs r0, 0 - bl SetGpuRegBits - ldr r4, =0x020322a4 - ldr r2, [r4] - adds r1, r2, 0 - adds r1, 0x4A - movs r3, 0x80 - lsls r3, 2 - adds r0, r3, 0 - ldrh r5, [r1] - adds r0, r5 - strh r0, [r1] - movs r0, 0x8D - lsls r0, 1 - adds r1, r2, r0 - ldrh r0, [r1] - adds r0, 0x4 - strh r0, [r1] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xFF - bls _08080C5C - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - ldr r3, [r4] - movs r2, 0x8D - lsls r2, 1 - adds r1, r3, r2 - movs r0, 0x80 - lsls r0, 1 - strh r0, [r1] - ldr r2, =gUnknown_083399DC - ldr r1, =gUnknown_083399E4 - adds r0, r3, 0 - adds r0, 0x7C - ldrb r0, [r0] - subs r0, 0x2 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r2 - ldrh r1, [r0] - adds r0, r3, 0 - adds r0, 0x4A - strh r1, [r0] - movs r0, 0xC - movs r1, 0x2 - bl SetGpuRegBits - ldr r0, [r4] - movs r3, 0x84 - lsls r3, 1 - adds r0, r3 - movs r1, 0 - str r1, [r0] - movs r0, 0x34 - bl audio_play - bl sub_80807BC -_08080C5C: - ldr r0, [r4] - movs r5, 0xA0 - lsls r5, 1 - adds r0, r5 - bl sub_8082CB4 - b _08080DAE - .pool -_08080C78: - bl sub_8083380 - lsls r0, 24 - cmp r0, 0 - beq _08080C8C - ldr r0, =0x020322a4 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_08080C8C: - ldr r0, =0x020322a4 - ldr r0, [r0] - movs r1, 0xA0 - lsls r1, 1 - adds r0, r1 - bl sub_8082CB4 - b _08080DAE - .pool -_08080CA0: - ldr r0, =gUnknown_08339C2C - movs r2, 0x10 - negs r2, r2 - movs r1, 0x78 - movs r3, 0x3 - bl AddObjectToFront -_08080CAE: - ldr r0, =0x020322a4 - ldr r1, [r0] -_08080CB2: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08080DAE - .pool -_08080CC4: - bl sub_8080DF8 - ldr r5, =0x020322a4 - ldr r4, [r5] - adds r1, r4, 0 - adds r1, 0x4C - movs r3, 0 - movs r2, 0 - movs r0, 0x80 - strh r0, [r1] - movs r1, 0x82 - lsls r1, 1 - adds r0, r4, r1 - str r2, [r0] - ldr r2, =0x00000123 - adds r0, r4, r2 - strb r3, [r0] - ldr r0, [r5] - adds r0, 0x72 - strb r3, [r0] - ldr r0, =sub_8081898 - bl SetMainCallback2 - ldr r0, =0x020375e0 - ldrh r0, [r0] - cmp r0, 0x1 - bne _08080D44 - movs r0, 0xD0 - lsls r0, 2 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _08080D30 - ldr r0, =sub_8081224 - movs r1, 0xA - bl AddTask - ldr r1, [r5] - movs r3, 0x90 - lsls r3, 1 - adds r1, r3 - b _08080D42 - .pool -_08080D30: - ldr r0, =gUnknown_083399EC - ldr r0, [r0] - movs r1, 0xA - bl AddTask - ldr r1, [r5] - movs r5, 0x90 - lsls r5, 1 - adds r1, r5 -_08080D42: - strb r0, [r1] -_08080D44: - ldr r1, =0x020375e0 - ldrh r0, [r1] - cmp r0, 0x1 - bls _08080D80 - movs r4, 0 - ldrh r1, [r1] - cmp r4, r1 - bge _08080D80 - movs r5, 0xA0 - lsls r5, 20 - ldr r6, =gUnknown_083399EC -_08080D5A: - ldm r6!, {r0} - lsrs r1, r5, 24 - bl AddTask - ldr r1, =0x020322a4 - ldr r1, [r1] - movs r2, 0x90 - lsls r2, 1 - adds r1, r2 - adds r1, r4 - strb r0, [r1] - movs r3, 0x80 - lsls r3, 17 - adds r5, r3 - adds r4, 0x1 - ldr r0, =0x020375e0 - ldrh r0, [r0] - cmp r4, r0 - blt _08080D5A -_08080D80: - bl current_map_music_get - lsls r0, 16 - lsrs r0, 16 - ldr r4, =0x00000193 - cmp r0, r4 - beq _08080D9E - bl current_map_music_get - ldr r1, =0x020322a4 - ldr r1, [r1] - movs r5, 0xAA - lsls r5, 1 - adds r1, r5 - strh r0, [r1] -_08080D9E: - adds r0, r4, 0 - bl song_play_for_text - movs r0, 0x35 - bl audio_play - bl sub_807F738 -_08080DAE: - ldr r0, =0x020322a4 - ldr r1, [r0] - movs r2, 0x8E - lsls r2, 1 - adds r0, r1, r2 - movs r3, 0 - ldrsh r0, [r0, r3] - movs r5, 0x8F - lsls r5, 1 - adds r1, r5 - movs r2, 0 - ldrsh r1, [r1, r2] - bl nullsub_31 - bl RunActiveTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl RunTextPrinters - bl fade_and_return_progress_probably - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80808D4 - - thumb_func_start sub_8080DF8 -sub_8080DF8: @ 8080DF8 - push {lr} - ldr r3, =0x03003110 - movs r0, 0 - ldr r1, =0x03003090 - movs r2, 0x3 -_08080E02: - strh r0, [r3] - strh r0, [r3, 0x4] - strh r0, [r1] - strh r0, [r1, 0x4] - adds r1, 0x10 - subs r2, 0x1 - cmp r2, 0 - bge _08080E02 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8080DF8 - - thumb_func_start sub_8080E20 -sub_8080E20: @ 8080E20 - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - adds r2, r0, r1 - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] - lsls r0, 16 - asrs r0, 16 - movs r4, 0xA - ldrsh r1, [r2, r4] - cmp r0, r1 - ble _08080E58 - ldr r0, =0x03003090 - movs r4, 0xC - ldrsh r1, [r2, r4] - lsls r1, 4 - adds r0, 0x4 - adds r1, r0 - ldr r0, =0x00002345 - strh r0, [r1] - adds r0, r3, 0 - bl remove_task -_08080E58: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8080E20 - - thumb_func_start sub_8080E6C -sub_8080E6C: @ 8080E6C - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =sub_8080E20 - movs r1, 0x50 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0xA] - strh r5, [r1, 0xC] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8080E6C - - thumb_func_start sub_8080EA4 -sub_8080EA4: @ 8080EA4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =0x020322a4 - ldr r0, [r4] - adds r0, 0x4A - ldrh r0, [r0] - movs r1, 0x1 - bl task_tutorial_oak_boy_girl - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _08080EC2 - b _08080FB8 -_08080EC2: - ldr r2, =0x03005e00 - lsls r1, r5, 2 - adds r0, r1, r5 - lsls r0, 3 - adds r0, r2 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r6, r1, 0 - cmp r0, 0 - beq _08080ED8 - b _08080FC6 -_08080ED8: - ldr r0, [r4] - ldr r1, =0x00000123 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _08080F9A - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x0000028f - bl __udivsi3 - lsls r0, 24 - lsrs r1, r0, 24 - adds r3, r1, 0 - ldr r0, [r4] - adds r0, 0x4C - movs r4, 0 - ldrsh r2, [r0, r4] - ldr r0, =0x000001f3 - cmp r2, r0 - bgt _08080F40 - cmp r1, 0x4B - bls _08080F2C - ldr r1, =0x03003090 - ldr r0, =0x00004523 - b _08080F30 - .pool -_08080F2C: - ldr r1, =0x03003090 - ldr r0, =0x00005432 -_08080F30: - strh r0, [r1, 0x14] - ldr r0, =0x00005432 - b _08080F9E - .pool -_08080F40: - ldr r0, =0x000005db - cmp r2, r0 - bgt _08080F6E - cmp r1, 0x50 - bhi _08080F9A - adds r0, r1, 0 - subs r0, 0x15 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3B - bhi _08080F68 - ldr r1, =0x03003090 - ldr r0, =0x00005432 - b _08080F9E - .pool -_08080F68: - cmp r1, 0x9 - bhi _08080FA0 - b _08080F90 -_08080F6E: - cmp r1, 0x5A - bhi _08080F9A - adds r0, r1, 0 - subs r0, 0x47 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x13 - bhi _08080F8C - ldr r1, =0x03003090 - ldr r0, =0x00005432 - b _08080F9E - .pool -_08080F8C: - cmp r3, 0x1D - bhi _08080FA0 -_08080F90: - movs r0, 0x1 - movs r1, 0x5 - bl sub_8080E6C - b _08080FA0 -_08080F9A: - ldr r1, =0x03003090 - ldr r0, =0x00004523 -_08080F9E: - strh r0, [r1, 0x14] -_08080FA0: - ldr r0, =0x03005e00 - adds r1, r6, r5 - lsls r1, 3 - adds r1, r0 - movs r0, 0x1 - b _08080FC4 - .pool -_08080FB8: - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - movs r0, 0 -_08080FC4: - strh r0, [r1, 0x8] -_08080FC6: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8080EA4 - - thumb_func_start sub_8080FD0 -sub_8080FD0: @ 8080FD0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r6, =0x020322a4 - ldr r3, [r6] - adds r0, r3, 0 - adds r0, 0x4A - ldrh r0, [r0] - movs r1, 0xC0 - lsls r1, 5 - adds r0, r1 - ldr r1, =0x0000ffff - ands r0, r1 - adds r1, r3, 0 - adds r1, 0x9A - ldrb r1, [r1] - lsrs r2, r0, 8 - ldr r0, =gUnknown_083399E7 - adds r1, r0 - ldrb r1, [r1] - adds r0, r1, 0 - adds r0, 0x14 - cmp r2, r0 - bls _080810E0 - adds r0, 0x14 - cmp r2, r0 - bcs _080810E0 - ldr r2, =0x03005e00 - lsls r1, r4, 2 - adds r0, r1, r4 - lsls r0, 3 - adds r2, r0, r2 - movs r5, 0x8 - ldrsh r0, [r2, r5] - adds r5, r1, 0 - cmp r0, 0 - bne _080810EE - ldr r1, =0x00000123 - adds r0, r3, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080810CC - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x0000028f - bl __udivsi3 - lsls r0, 24 - lsrs r2, r0, 24 - adds r3, r2, 0 - ldr r0, [r6] - adds r0, 0x4C - movs r6, 0 - ldrsh r1, [r0, r6] - ldr r0, =0x000001f3 - cmp r1, r0 - bgt _08081088 - cmp r2, 0x42 - bls _08081078 - ldr r1, =0x03003090 - ldr r0, =0x00004523 - strh r0, [r1, 0x24] - b _080810B0 - .pool -_08081078: - ldr r1, =0x03003090 - ldr r0, =0x00005432 - strh r0, [r1, 0x24] - b _080810B0 - .pool -_08081088: - cmp r2, 0x41 - bls _08081092 - ldr r1, =0x03003090 - ldr r0, =0x00004523 - strh r0, [r1, 0x24] -_08081092: - adds r0, r2, 0 - subs r0, 0x29 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x18 - bhi _080810A4 - ldr r1, =0x03003090 - ldr r0, =0x00005432 - strh r0, [r1, 0x24] -_080810A4: - cmp r3, 0x9 - bhi _080810B0 - movs r0, 0x2 - movs r1, 0x5 - bl sub_8080E6C -_080810B0: - ldr r0, =0x03005e00 - adds r1, r5, r4 - lsls r1, 3 - adds r1, r0 - movs r0, 0x1 - b _080810EC - .pool -_080810CC: - ldr r0, =0x03003090 - ldr r1, =0x00004523 - strh r1, [r0, 0x24] - movs r0, 0x1 - strh r0, [r2, 0x8] - b _080810EE - .pool -_080810E0: - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - movs r0, 0 -_080810EC: - strh r0, [r1, 0x8] -_080810EE: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8080FD0 - - thumb_func_start sub_80810F8 -sub_80810F8: @ 80810F8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r5, =0x020322a4 - ldr r3, [r5] - adds r0, r3, 0 - adds r0, 0x4A - ldrh r0, [r0] - movs r1, 0xC0 - lsls r1, 5 - adds r0, r1 - ldr r1, =0x0000ffff - ands r0, r1 - adds r1, r3, 0 - adds r1, 0x9C - ldrb r1, [r1] - lsrs r2, r0, 8 - ldr r0, =gUnknown_083399E7 - adds r1, r0 - ldrb r1, [r1] - adds r0, r1, 0 - adds r0, 0x14 - cmp r2, r0 - bls _0808120C - adds r0, 0x14 - cmp r2, r0 - bcs _0808120C - ldr r2, =0x03005e00 - lsls r1, r4, 2 - adds r0, r1, r4 - lsls r0, 3 - adds r2, r0, r2 - movs r6, 0x8 - ldrsh r0, [r2, r6] - adds r6, r1, 0 - cmp r0, 0 - bne _0808121A - ldr r1, =0x00000123 - adds r0, r3, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080811F8 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x0000028f - bl __udivsi3 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, [r5] - adds r0, 0x4C - movs r3, 0 - ldrsh r1, [r0, r3] - ldr r0, =0x000001f3 - cmp r1, r0 - bgt _080811AC - cmp r2, 0x58 - bls _0808119C - ldr r1, =0x03003090 - ldr r0, =0x00004523 - strh r0, [r1, 0x34] - b _080811DE - .pool -_0808119C: - ldr r1, =0x03003090 - ldr r0, =0x00005432 - strh r0, [r1, 0x34] - b _080811DE - .pool -_080811AC: - cmp r2, 0x3C - bls _080811C0 - ldr r1, =0x03003090 - ldr r0, =0x00004523 - b _080811D0 - .pool -_080811C0: - adds r0, r2, 0 - subs r0, 0x38 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bhi _080811D2 - ldr r1, =0x03003090 - ldr r0, =0x00005432 -_080811D0: - strh r0, [r1, 0x34] -_080811D2: - cmp r2, 0x4 - bhi _080811DE - movs r0, 0x3 - movs r1, 0x5 - bl sub_8080E6C -_080811DE: - ldr r0, =0x03005e00 - adds r1, r6, r4 - lsls r1, 3 - adds r1, r0 - movs r0, 0x1 - b _08081218 - .pool -_080811F8: - ldr r0, =0x03003090 - ldr r1, =0x00004523 - strh r1, [r0, 0x34] - movs r0, 0x1 - strh r0, [r2, 0x8] - b _0808121A - .pool -_0808120C: - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - movs r0, 0 -_08081218: - strh r0, [r1, 0x8] -_0808121A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80810F8 - - thumb_func_start sub_8081224 -sub_8081224: @ 8081224 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x020322a4 - ldr r0, [r0] - adds r0, 0x4A - ldrh r0, [r0] - movs r1, 0x1 - bl task_tutorial_oak_boy_girl - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08081270 - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r2, r1, r0 - movs r1, 0x8 - ldrsh r0, [r2, r1] - cmp r0, 0 - bne _0808127E - ldr r0, =0x03003090 - ldr r1, =0x00004523 - strh r1, [r0, 0x14] - movs r0, 0x1 - strh r0, [r2, 0x8] - b _0808127E - .pool -_08081270: - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - movs r0, 0 - strh r0, [r1, 0x8] -_0808127E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8081224 - - thumb_func_start sub_8081288 -sub_8081288: @ 8081288 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 16 - lsrs r7, r0, 16 - mov r8, r7 - lsls r1, 24 - ldr r0, =gUnknown_08339B40 - ldr r4, =gUnknown_083399C8 - lsrs r1, 23 - adds r2, r1, r4 - ldrb r6, [r2] - ldr r5, =gUnknown_083399C0 - adds r2, r1, r5 - movs r3, 0 - ldrsb r3, [r2, r3] - lsls r2, r3, 2 - adds r2, r3 - lsls r2, 1 - subs r6, r2 - adds r4, 0x1 - adds r4, r1, r4 - ldrb r2, [r4] - adds r5, 0x1 - adds r1, r5 - movs r3, 0 - ldrsb r3, [r1, r3] - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 1 - subs r2, r1 - adds r1, r6, 0 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - adds r2, r1, 0 - ldr r0, =0x00004523 - cmp r7, r0 - bne _08081314 - lsls r4, r1, 4 - adds r4, r1 - lsls r4, 2 - ldr r5, =0x02020630 - adds r0, r4, r5 - movs r1, 0x2 - bl StartObjectImageAnim - adds r5, 0x1C - adds r4, r5 - ldr r0, =sub_8082F9C - str r0, [r4] - movs r0, 0x28 - bl audio_play - b _08081358 - .pool -_08081314: - ldr r0, =0x00005432 - cmp r7, r0 - bne _0808133C - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r1, 0 - bl StartObjectImageAnim - movs r0, 0x1F - bl audio_play - b _08081358 - .pool -_0808133C: - ldr r0, =0x00002345 - cmp r8, r0 - bne _08081358 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r1, 0x1 - bl StartObjectImageAnim - movs r0, 0x20 - bl audio_play -_08081358: - bl sub_8082E84 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8081288 - - thumb_func_start sub_8081370 -sub_8081370: @ 8081370 - push {r4-r7,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r5, r4, 0 - bl sub_807F738 - ldr r0, =0x00004523 - cmp r4, r0 - beq _080813A4 - cmp r4, r0 - bgt _08081398 - ldr r0, =0x00002345 - cmp r4, r0 - beq _08081474 - b _080814A0 - .pool -_08081398: - ldr r0, =0x00005432 - cmp r5, r0 - beq _0808143C - b _080814A0 - .pool -_080813A4: - ldr r7, =0x020322a4 - ldr r4, [r7] - adds r5, r4, 0 - adds r5, 0x4C - ldrh r6, [r5] - movs r0, 0 - ldrsh r1, [r5, r0] - ldr r0, =0x000005db - cmp r1, r0 - bgt _080813E0 - ldr r1, =gUnknown_08339CC3 - adds r0, r4, 0 - adds r0, 0x7C - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - movs r0, 0xC0 - lsls r0, 1 - bl __divsi3 - adds r0, r6, r0 - strh r0, [r5] - b _080814A0 - .pool -_080813E0: - ldr r1, =gUnknown_08339CC3 - adds r0, r4, 0 - adds r0, 0x7C - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x80 - bl __divsi3 - adds r0, r6, r0 - strh r0, [r5] - movs r1, 0x8E - lsls r1, 1 - adds r4, r1 - movs r1, 0 - ldrsh r0, [r5, r1] - movs r1, 0x64 - bl __divsi3 - adds r1, r0, 0 - subs r1, 0xA - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_80832BC - ldr r0, [r7] - movs r1, 0x8F - lsls r1, 1 - adds r4, r0, r1 - adds r0, 0x4C - movs r1, 0 - ldrsh r0, [r0, r1] - movs r1, 0x64 - bl __divsi3 - adds r1, r0, 0 - subs r1, 0xA - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_80832BC - b _080814A0 - .pool -_0808143C: - ldr r0, =0x020322a4 - ldr r2, [r0] - adds r4, r2, 0 - adds r4, 0x4C - ldrh r5, [r4] - movs r0, 0 - ldrsh r1, [r4, r0] - ldr r0, =0x000005db - cmp r1, r0 - bgt _080814A0 - ldr r1, =gUnknown_08339CC3 - adds r0, r2, 0 - adds r0, 0x7C - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x80 - lsls r0, 1 - bl __divsi3 - adds r0, r5, r0 - b _0808149E - .pool -_08081474: - ldr r0, =0x020322a4 - ldr r0, [r0] - adds r4, r0, 0 - adds r4, 0x4C - ldr r1, =gUnknown_08339CC3 - adds r0, 0x7C - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x80 - lsls r0, 1 - bl __divsi3 - ldrh r1, [r4] - subs r1, r0 - strh r1, [r4] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x7F - bgt _080814A0 - movs r0, 0x80 -_0808149E: - strh r0, [r4] -_080814A0: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8081370 - - thumb_func_start sub_80814B0 -sub_80814B0: @ 80814B0 - push {lr} - lsls r0, 16 - lsrs r3, r0, 16 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r2, 16 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _080814E4 - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _080814E4 - movs r0, 0xFF - lsls r0, 8 - ands r0, r3 - cmp r0, r2 - bne _080814EC - movs r0, 0x1 - b _080814EE - .pool -_080814E4: - cmp r3, r1 - bne _080814EC - movs r0, 0x1 - b _080814EE -_080814EC: - movs r0, 0 -_080814EE: - pop {r1} - bx r1 - thumb_func_end sub_80814B0 - - thumb_func_start sub_80814F4 -sub_80814F4: @ 80814F4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - ldr r0, =0x020375e0 - ldrh r0, [r0] - cmp r0, 0 - beq _0808153C - ldr r3, =0x03003110 - ldrh r0, [r3, 0x4] - ldr r2, =0x03003090 - cmp r0, 0 - beq _0808151C - movs r1, 0 - strh r0, [r2, 0x4] - ldr r0, =0x00004444 - strh r0, [r2] - strh r1, [r3, 0x4] -_0808151C: - ldr r0, =0x03003090 - ldr r3, =0x00004444 - adds r1, r2, 0 - adds r1, 0x10 - adds r2, r0, 0 - adds r2, 0x14 - movs r7, 0x2 -_0808152A: - ldrh r0, [r2] - cmp r0, 0 - beq _08081532 - strh r3, [r1] -_08081532: - adds r1, 0x10 - adds r2, 0x10 - subs r7, 0x1 - cmp r7, 0 - bge _0808152A -_0808153C: - movs r7, 0 - ldr r1, =0x020322a4 - ldr r0, [r1] - adds r0, 0x7C - ldrb r0, [r0] - cmp r7, r0 - blt _0808154C - b _080816F6 -_0808154C: - ldr r0, =0x03003090 - adds r2, r0, 0 - adds r2, 0x20 - str r2, [sp] - movs r1, 0 - mov r9, r1 - movs r2, 0 - str r2, [sp, 0x4] - mov r8, r0 - ldr r0, =0x00005432 - mov r10, r0 -_08081562: - mov r1, r8 - ldrh r0, [r1] - ldr r1, =0x00004444 - movs r2, 0x88 - lsls r2, 7 - bl sub_80814B0 - cmp r0, 0 - bne _08081576 - b _080816D2 -_08081576: - ldr r6, =0x020322a4 - ldr r0, [r6] - adds r0, 0x96 - ldr r2, [sp, 0x4] - adds r0, r2 - ldrh r5, [r0] - mov r0, r8 - ldrh r4, [r0, 0x4] - ldr r1, =0x00004523 - cmp r4, r1 - bne _080815F4 - adds r0, r1, 0 - bl sub_8081370 - ldr r0, [r6] - movs r2, 0x8B - lsls r2, 1 - adds r4, r0, r2 - adds r0, 0x4C - movs r1, 0 - ldrsh r0, [r0, r1] - movs r1, 0x37 - bl __divsi3 - ldrh r1, [r4] - adds r1, r0 - strh r1, [r4] - lsls r1, 16 - ldr r0, =0x03e70000 - cmp r1, r0 - bls _080815BA - movs r0, 0xFA - lsls r0, 2 - strh r0, [r4] -_080815BA: - lsls r1, r5, 24 - lsrs r1, 24 - ldr r0, =0x00004523 - bl sub_8081288 - ldr r1, [r6] - movs r2, 0x92 - lsls r2, 1 - adds r1, r2 - add r1, r9 - ldrh r0, [r1] - adds r0, 0x1 - b _0808165E - .pool -_080815F4: - cmp r4, r10 - bne _08081632 - mov r0, r10 - bl sub_8081370 - ldr r0, [r6] - movs r1, 0x8B - lsls r1, 1 - adds r4, r0, r1 - adds r0, 0x4C - movs r2, 0 - ldrsh r0, [r0, r2] - movs r1, 0x46 - bl __divsi3 - ldrh r1, [r4] - adds r1, r0 - strh r1, [r4] - lsls r1, r5, 24 - lsrs r1, 24 - mov r0, r10 - bl sub_8081288 - ldr r1, [r6] - movs r0, 0x93 - lsls r0, 1 - adds r1, r0 - add r1, r9 - ldrh r0, [r1] - adds r0, 0x1 - b _0808165E -_08081632: - ldr r0, =0x00002345 - cmp r4, r0 - bne _0808166A - lsls r1, r5, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_8081288 - adds r0, r4, 0 - bl sub_8081370 - ldr r0, [r6] - movs r1, 0x94 - lsls r1, 1 - adds r0, r1 - mov r2, r9 - adds r1, r0, r2 - ldrh r2, [r1] - ldr r0, =0x000003e6 - cmp r2, r0 - bhi _08081660 - adds r0, r2, 0x1 -_0808165E: - strh r0, [r1] -_08081660: - mov r0, r8 - ldrh r1, [r0, 0x4] - ldr r0, =0x00002345 - cmp r1, r0 - beq _08081678 -_0808166A: - ldr r1, [sp] - ldrh r0, [r1] - ldr r2, =0x00004523 - cmp r0, r2 - beq _08081678 - cmp r0, r10 - bne _080816D2 -_08081678: - ldr r0, =0x020322a4 - ldr r0, [r0] - adds r2, r0, 0 - adds r2, 0x4C - movs r0, 0 - ldrsh r1, [r2, r0] - ldr r0, =0x000005dc - cmp r1, r0 - ble _080816C8 - adds r0, r1, 0 - ldr r2, =0xfffffd12 - adds r0, r2 - movs r1, 0x14 - bl __divsi3 - adds r1, r0, 0 - movs r0, 0x80 - lsls r0, 1 - adds r1, r0 - lsls r1, 16 - lsrs r1, 16 - ldr r0, =0x03007420 - bl MPlayTempoControl - b _080816D2 - .pool -_080816C8: - ldr r0, =0x03007420 - movs r1, 0x80 - lsls r1, 1 - bl MPlayTempoControl -_080816D2: - ldr r1, [sp] - adds r1, 0x2 - str r1, [sp] - movs r2, 0x6 - add r9, r2 - ldr r0, [sp, 0x4] - adds r0, 0x2 - str r0, [sp, 0x4] - movs r1, 0x10 - add r8, r1 - adds r7, 0x1 - ldr r0, =0x020322a4 - ldr r0, [r0] - adds r0, 0x7C - ldrb r0, [r0] - cmp r7, r0 - bge _080816F6 - b _08081562 -_080816F6: - ldr r0, =0x020375e0 - ldrh r0, [r0] - cmp r0, 0 - beq _08081722 - movs r7, 0 - ldr r3, =0x020322a4 - ldr r0, [r3] - adds r0, 0x7C - ldrb r0, [r0] - cmp r7, r0 - bge _08081722 - movs r2, 0 - ldr r1, =0x03003090 -_08081710: - strh r2, [r1] - strh r2, [r1, 0x4] - adds r1, 0x10 - adds r7, 0x1 - ldr r0, [r3] - adds r0, 0x7C - ldrb r0, [r0] - cmp r7, r0 - blt _08081710 -_08081722: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80814F4 - - thumb_func_start sub_8081744 -sub_8081744: @ 8081744 - push {r4-r6,lr} - movs r4, 0 - movs r6, 0 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _0808175A - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r6, r0, 24 -_0808175A: - ldr r3, =0x020322a4 - ldr r1, [r3] - lsls r2, r6, 1 - adds r0, r1, 0 - adds r0, 0x96 - adds r0, r2 - ldrb r5, [r0] - adds r1, 0x63 - ldrb r0, [r1] - cmp r0, 0 - bne _0808182C - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x13] - cmp r0, 0x2 - bne _080817A8 - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080817B6 - ldrh r2, [r2, 0x28] - ldr r1, =0x00000201 - adds r0, r1, 0 - ands r0, r2 - cmp r0, r1 - beq _080817B6 - b _080817BA - .pool -_080817A8: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080817B6 - movs r4, 0x1 -_080817B6: - cmp r4, 0 - beq _0808182C -_080817BA: - ldr r4, =0x020322a4 - ldr r1, [r4] - lsls r2, r5, 1 - adds r0, r1, 0 - adds r0, 0x8E - adds r0, r2 - adds r1, 0x50 - ldrh r0, [r0] - adds r1, r0 - ldrb r1, [r1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - adds r1, r5, 0x4 - lsls r1, 24 - lsrs r1, 24 - bl StartObjectImageAnim - ldr r0, [r4] - adds r0, 0x4A - ldrh r0, [r0] - adds r1, r6, 0 - bl task_tutorial_oak_boy_girl - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08081810 - ldr r1, =0x03003110 - ldr r0, =0x00004523 - b _08081828 - .pool -_08081810: - cmp r0, 0x1 - bne _08081824 - ldr r1, =0x03003110 - ldr r0, =0x00005432 - b _08081828 - .pool -_08081824: - ldr r1, =0x03003110 - ldr r0, =0x00002345 -_08081828: - strh r0, [r1, 0x4] - adds r3, r4, 0 -_0808182C: - ldr r1, [r3] - adds r1, 0x72 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - bls _0808185A - ldr r0, [r3] - adds r1, r0, 0 - adds r1, 0x4C - ldrh r2, [r1] - movs r4, 0 - ldrsh r0, [r1, r4] - cmp r0, 0x80 - ble _08081852 - subs r0, r2, 0x1 - strh r0, [r1] -_08081852: - ldr r0, [r3] - adds r0, 0x72 - movs r1, 0 - strb r1, [r0] -_0808185A: - ldr r0, =0x020322d5 - ldrb r0, [r0] - cmp r0, 0 - beq _0808187E - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x80 - lsls r0, 2 - ands r0, r1 - cmp r0, 0 - beq _0808187E - ldr r0, [r3] - ldr r1, =0x00000123 - adds r2, r0, r1 - ldrb r0, [r2] - movs r1, 0x1 - eors r0, r1 - strb r0, [r2] -_0808187E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8081744 - - thumb_func_start sub_8081898 -sub_8081898: @ 8081898 - push {r4-r6,lr} - bl sub_8082D28 - ldr r4, =0x020322a4 - ldr r0, [r4] - movs r1, 0x82 - lsls r1, 1 - adds r2, r0, r1 - ldr r1, [r2] - ldr r0, =0x00057e03 - cmp r1, r0 - bhi _080818B4 - adds r0, r1, 0x1 - str r0, [r2] -_080818B4: - bl sub_8081744 - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x4C - ldrh r0, [r0] - movs r5, 0x8B - lsls r5, 1 - adds r1, r5 - ldrh r1, [r1] - bl sub_800A994 - bl sub_80814F4 - ldr r0, [r4] - adds r0, r5 - ldrh r0, [r0] - movs r6, 0xFA - lsls r6, 2 - adds r1, r6, 0 - bl sub_8083140 - ldr r0, [r4] - adds r0, 0x4C - ldrh r0, [r0] - bl sub_8083230 - bl sub_808330C - bl sub_8082AD4 - ldr r2, [r4] - adds r3, r2, 0 - adds r3, 0x63 - ldrb r0, [r3] - cmp r0, 0 - bne _0808191A - movs r1, 0x8C - lsls r1, 1 - adds r0, r2, r1 - ldrh r1, [r0] - ldr r0, =0x000003e7 - cmp r1, r0 - bls _0808191A - adds r0, r2, r5 - strh r6, [r0] - movs r0, 0x1 - strb r0, [r3] - ldr r0, =sub_8081FC8 - bl SetMainCallback2 -_0808191A: - ldr r0, =0x020322a4 - ldr r1, [r0] - movs r2, 0x8E - lsls r2, 1 - adds r0, r1, r2 - movs r2, 0 - ldrsh r0, [r0, r2] - movs r2, 0x8F - lsls r2, 1 - adds r1, r2 - movs r2, 0 - ldrsh r1, [r1, r2] - bl nullsub_31 - bl RunActiveTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl RunTextPrinters - bl fade_and_return_progress_probably - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8081898 - - thumb_func_start nullsub_31 -nullsub_31: @ 8081960 - bx lr - thumb_func_end nullsub_31 - - thumb_func_start help_system_is_not_first_time -help_system_is_not_first_time: @ 8081964 - push {r4,r5,lr} - lsls r1, 24 - lsls r2, 24 - lsrs r1, 20 - adds r4, r1, r0 - lsrs r2, 20 - adds r5, r2, r0 - ldrh r0, [r4] - ldrh r1, [r5] - cmp r0, r1 - bne _080819A2 - adds r0, r4, 0x2 - adds r1, r5, 0x2 - bl CompareString - cmp r0, 0 - bne _080819B0 - ldr r0, [r4, 0x8] - ldr r2, =0xffffff00 - ands r0, r2 - ldr r1, [r5, 0x8] - ands r1, r2 - cmp r0, r1 - bne _080819B0 - ldr r0, [r4, 0xC] - ldr r2, =0x00ffffff - ands r0, r2 - ldr r1, [r5, 0xC] - ands r1, r2 - cmp r0, r1 - bne _080819B0 -_080819A2: - movs r0, 0x1 - b _080819B2 - .pool -_080819B0: - movs r0, 0 -_080819B2: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end help_system_is_not_first_time - - thumb_func_start sub_80819B8 -sub_80819B8: @ 80819B8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - mov r10, r0 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x10] - lsls r3, 24 - lsrs r3, 24 - mov r2, sp - movs r4, 0x5 -_080819D4: - ldrh r0, [r1] - strh r0, [r2] - adds r1, 0x2 - adds r2, 0x2 - subs r4, 0x1 - cmp r4, 0 - bge _080819D4 - movs r6, 0 - mov r1, sp - movs r4, 0x4 -_080819E8: - movs r2, 0 - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _080819F2 - adds r6, 0x1 -_080819F2: - adds r1, 0x2 - subs r4, 0x1 - cmp r4, 0 - bge _080819E8 - cmp r6, 0x5 - beq _08081A46 - cmp r3, 0x3 - bhi _08081A46 - movs r4, 0 - ldr r3, [sp, 0x10] - cmp r4, r3 - bge _08081A5E - mov r3, r10 -_08081A0C: - movs r6, 0 - ldr r7, [sp, 0x10] - cmp r6, r7 - bge _08081A54 - mov r9, r3 - mov r5, r10 - lsls r0, r4, 24 - mov r8, r0 -_08081A1C: - mov r1, r9 - ldrh r0, [r1] - ldrh r2, [r5] - cmp r0, r2 - bne _08081A4A - cmp r4, r6 - beq _08081A4A - cmp r0, 0xAF - bne _08081A46 - lsls r2, r6, 24 - lsrs r2, 24 - mov r0, r10 - mov r7, r8 - lsrs r1, r7, 24 - str r3, [sp, 0xC] - bl help_system_is_not_first_time - lsls r0, 24 - ldr r3, [sp, 0xC] - cmp r0, 0 - beq _08081A4A -_08081A46: - movs r0, 0xC - b _08081B9E -_08081A4A: - adds r5, 0x10 - adds r6, 0x1 - ldr r0, [sp, 0x10] - cmp r6, r0 - blt _08081A1C -_08081A54: - adds r3, 0x10 - adds r4, 0x1 - ldr r1, [sp, 0x10] - cmp r4, r1 - blt _08081A0C -_08081A5E: - movs r2, 0 - mov r1, sp - movs r4, 0x4 -_08081A64: - movs r3, 0 - ldrsh r0, [r1, r3] - cmp r0, 0 - ble _08081A72 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 -_08081A72: - adds r1, 0x2 - subs r4, 0x1 - cmp r4, 0 - bge _08081A64 - cmp r2, 0x3 - bls _08081A82 - movs r0, 0xD - b _08081B9E -_08081A82: - cmp r2, 0x3 - bne _08081A8A - movs r0, 0xB - b _08081B9E -_08081A8A: - movs r4, 0 - mov r1, sp -_08081A8E: - movs r7, 0 - ldrsh r0, [r1, r7] - cmp r0, 0x32 - ble _08081A98 - b _08081B98 -_08081A98: - adds r1, 0x2 - adds r4, 0x1 - cmp r4, 0x4 - ble _08081A8E - cmp r2, 0x1 - bne _08081AEA - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - ble _08081AB2 - movs r0, 0x1 - b _08081B9E -_08081AB2: - mov r0, sp - ldrh r0, [r0, 0x2] - lsls r0, 16 - cmp r0, 0 - ble _08081AC0 - movs r0, 0x2 - b _08081B9E -_08081AC0: - mov r0, sp - movs r3, 0x4 - ldrsh r0, [r0, r3] - cmp r0, 0 - ble _08081ACE - movs r0, 0x3 - b _08081B9E -_08081ACE: - mov r0, sp - movs r4, 0x6 - ldrsh r0, [r0, r4] - cmp r0, 0 - ble _08081ADC - movs r0, 0x4 - b _08081B9E -_08081ADC: - mov r0, sp - movs r7, 0x8 - ldrsh r0, [r0, r7] - cmp r0, 0 - ble _08081AEA - movs r0, 0x5 - b _08081B9E -_08081AEA: - cmp r2, 0x2 - bne _08081B9C - movs r4, 0 - ldr r5, =0x03000df8 - mov r1, sp - adds r2, r5, 0 -_08081AF6: - movs r3, 0 - ldrsh r0, [r1, r3] - cmp r0, 0 - ble _08081B02 - strh r4, [r2] - adds r2, 0x2 -_08081B02: - adds r1, 0x2 - adds r4, 0x1 - cmp r4, 0x4 - ble _08081AF6 - movs r4, 0 - ldrsh r3, [r5, r4] - lsls r0, r3, 1 - mov r7, sp - adds r1, r7, r0 - movs r0, 0x2 - ldrsh r2, [r5, r0] - lsls r0, r2, 1 - add r0, sp - movs r4, 0 - ldrsh r1, [r1, r4] - movs r7, 0 - ldrsh r0, [r0, r7] - cmp r1, r0 - blt _08081B58 - adds r0, r3, 0 - cmp r0, 0 - bne _08081B38 - lsls r0, r2, 16 - b _08081B62 - .pool -_08081B38: - cmp r0, 0x1 - bne _08081B40 - lsls r0, r2, 16 - b _08081B6E -_08081B40: - cmp r0, 0x2 - bne _08081B48 - lsls r0, r2, 16 - b _08081B7A -_08081B48: - cmp r0, 0x3 - bne _08081B50 - lsls r0, r2, 16 - b _08081B86 -_08081B50: - cmp r0, 0x4 - bne _08081B9C - lsls r0, r2, 16 - b _08081B92 -_08081B58: - movs r2, 0x2 - ldrsh r0, [r5, r2] - cmp r0, 0 - bne _08081B68 - lsls r0, r3, 16 -_08081B62: - movs r1, 0x6 - orrs r0, r1 - b _08081B9E -_08081B68: - cmp r0, 0x1 - bne _08081B74 - lsls r0, r3, 16 -_08081B6E: - movs r1, 0x7 - orrs r0, r1 - b _08081B9E -_08081B74: - cmp r0, 0x2 - bne _08081B80 - lsls r0, r3, 16 -_08081B7A: - movs r1, 0x8 - orrs r0, r1 - b _08081B9E -_08081B80: - cmp r0, 0x3 - bne _08081B8C - lsls r0, r3, 16 -_08081B86: - movs r1, 0x9 - orrs r0, r1 - b _08081B9E -_08081B8C: - cmp r0, 0x4 - bne _08081B9C - lsls r0, r3, 16 -_08081B92: - movs r1, 0xA - orrs r0, r1 - b _08081B9E -_08081B98: - movs r0, 0xE - b _08081B9E -_08081B9C: - movs r0, 0 -_08081B9E: - 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_80819B8 - - thumb_func_start sub_8081BB0 -sub_8081BB0: @ 8081BB0 - ldr r1, =0x03000e04 - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_8081BB0 - - thumb_func_start sub_8081BBC -sub_8081BBC: @ 8081BBC - ldr r0, =0x03000e04 - movs r1, 0 - ldrsh r0, [r0, r1] - bx lr - .pool - thumb_func_end sub_8081BBC - - thumb_func_start sub_8081BC8 -sub_8081BC8: @ 8081BC8 - ldr r1, =0x03000e06 - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_8081BC8 - - thumb_func_start sub_8081BD4 -sub_8081BD4: @ 8081BD4 - ldr r0, =0x03000e06 - movs r1, 0 - ldrsh r0, [r0, r1] - bx lr - .pool - thumb_func_end sub_8081BD4 - - thumb_func_start sub_8081BE0 -sub_8081BE0: @ 8081BE0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - str r0, [sp] - mov r8, r1 - str r3, [sp, 0x4] - ldr r0, [sp, 0x30] - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x8] - ldr r7, =0x03000de8 - adds r2, r7, 0 - movs r1, 0 - adds r0, r7, 0 - adds r0, 0xA -_08081C0A: - strh r1, [r0] - subs r0, 0x2 - cmp r0, r2 - bge _08081C0A - movs r6, 0 - cmp r6, r9 - bge _08081C40 - ldr r0, =0x03000de8 - mov r12, r0 - ldr r5, [sp] - adds r5, 0x9 -_08081C20: - movs r3, 0 - adds r4, r5, 0 - mov r2, r12 -_08081C26: - adds r1, r4, r3 - ldrh r0, [r2] - ldrb r1, [r1] - adds r0, r1 - strh r0, [r2] - adds r2, 0x2 - adds r3, 0x1 - cmp r3, 0x5 - ble _08081C26 - adds r5, 0x10 - adds r6, 0x1 - cmp r6, r9 - blt _08081C20 -_08081C40: - movs r1, 0 - ldrsh r3, [r7, r1] - ldrh r0, [r7] - ldrh r1, [r7, 0x2] - subs r0, r1 - strh r0, [r7] - ldrh r0, [r7, 0x4] - subs r1, r0 - strh r1, [r7, 0x2] - ldrh r1, [r7, 0x6] - subs r0, r1 - strh r0, [r7, 0x4] - ldrh r0, [r7, 0x8] - subs r1, r0 - strh r1, [r7, 0x6] - subs r0, r3 - strh r0, [r7, 0x8] - movs r3, 0 - movs r2, 0 - adds r1, r7, 0 - movs r6, 0x4 -_08081C6A: - movs r4, 0 - ldrsh r0, [r1, r4] - cmp r0, 0 - bge _08081C76 - strh r2, [r1] - adds r3, 0x1 -_08081C76: - adds r1, 0x2 - subs r6, 0x1 - cmp r6, 0 - bge _08081C6A - lsls r0, r3, 24 - lsrs r0, 24 - mov r10, r0 - movs r4, 0 - ldr r1, =0x03000de8 - movs r6, 0x4 -_08081C8A: - ldrh r2, [r1] - movs r5, 0 - ldrsh r0, [r1, r5] - cmp r0, 0 - ble _08081CA4 - cmp r0, r3 - bge _08081CA0 - strh r4, [r1] - b _08081CA4 - .pool -_08081CA0: - subs r0, r2, r3 - strh r0, [r1] -_08081CA4: - adds r1, 0x2 - subs r6, 0x1 - cmp r6, 0 - bge _08081C8A - ldr r1, =0x03000de8 - ldr r2, =0x020322a8 - movs r6, 0x4 -_08081CB2: - movs r3, 0 - ldrsh r0, [r1, r3] - stm r2!, {r0} - adds r1, 0x2 - subs r6, 0x1 - cmp r6, 0 - bge _08081CB2 - ldr r1, =0x0000014d - ldr r0, [sp, 0x8] - bl __udivsi3 - lsls r0, 16 - lsrs r0, 16 - adds r3, r0, 0 - adds r3, 0x64 - ldr r4, =0x020322d0 - str r3, [r4] - movs r6, 0x4 -_08081CD6: - movs r0, 0 - ldrsh r5, [r7, r0] - adds r0, r5, 0 - muls r0, r3 - movs r1, 0xA - str r3, [sp, 0xC] - bl __divsi3 - adds r5, r0, 0 - movs r1, 0xA - bl __modsi3 - adds r4, r0, 0 - adds r0, r5, 0 - movs r1, 0xA - bl __divsi3 - adds r5, r0, 0 - ldr r3, [sp, 0xC] - cmp r4, 0x4 - ble _08081D02 - adds r5, 0x1 -_08081D02: - strh r5, [r7] - adds r7, 0x2 - subs r6, 0x1 - cmp r6, 0 - bge _08081CD6 - ldr r1, =0x03000de8 - ldr r2, =0x020322bc - movs r6, 0x4 -_08081D12: - movs r3, 0 - ldrsh r0, [r1, r3] - stm r2!, {r0} - adds r1, 0x2 - subs r6, 0x1 - cmp r6, 0 - bge _08081D12 - ldr r4, =0x03000de8 - ldr r0, [sp] - adds r1, r4, 0 - mov r2, r9 - mov r3, r10 - bl sub_80819B8 - mov r5, r8 - strb r0, [r5] - movs r1, 0xA - ldrsh r0, [r4, r1] - mov r1, r9 - bl __divsi3 - mov r3, r9 - subs r0, r3 - strh r0, [r4, 0xA] - lsls r0, 16 - cmp r0, 0 - bge _08081D4C - movs r0, 0 - strh r0, [r4, 0xA] -_08081D4C: - mov r5, r8 - ldrb r0, [r5] - cmp r0, 0xC - bne _08081DA6 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - lsrs r3, r0, 16 - movs r6, 0 - ldr r0, =gUnknown_08339CC8 - adds r0, r3, r0 - ldrb r0, [r0] - adds r1, r4, 0 - movs r4, 0x1 - movs r3, 0x2 -_08081D74: - adds r2, r0, 0 - asrs r2, r6 - ands r2, r4 - cmp r2, 0 - beq _08081D9C - strh r3, [r1] - b _08081D9E - .pool -_08081D9C: - strh r2, [r1] -_08081D9E: - adds r1, 0x2 - adds r6, 0x1 - cmp r6, 0x4 - ble _08081D74 -_08081DA6: - ldr r7, =0x03000de8 - movs r2, 0xFF - adds r1, r7, 0 - movs r6, 0x5 -_08081DAE: - movs r3, 0 - ldrsh r0, [r1, r3] - cmp r0, 0xFF - ble _08081DB8 - strh r2, [r1] -_08081DB8: - adds r1, 0x2 - subs r6, 0x1 - cmp r6, 0 - bge _08081DAE - ldrh r0, [r7] - mov r4, r8 - strb r0, [r4, 0x1] - ldrh r0, [r7, 0x2] - strb r0, [r4, 0x2] - ldrh r0, [r7, 0x4] - strb r0, [r4, 0x3] - ldrh r0, [r7, 0x6] - strb r0, [r4, 0x4] - ldrh r0, [r7, 0x8] - strb r0, [r4, 0x5] - ldrh r0, [r7, 0xA] - strb r0, [r4, 0x6] - movs r6, 0 - adds r2, r7, 0 -_08081DDE: - ldr r5, [sp, 0x4] - adds r1, r5, r6 - ldrh r0, [r2] - strb r0, [r1] - adds r2, 0x2 - adds r6, 0x1 - cmp r6, 0x5 - ble _08081DDE - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8081BE0 - - thumb_func_start sub_8081E04 -sub_8081E04: @ 8081E04 - push {r4,lr} - sub sp, 0x4 - ldr r4, [sp, 0xC] - lsls r2, 24 - lsrs r2, 24 - lsls r4, 16 - lsrs r4, 16 - str r4, [sp] - bl sub_8081BE0 - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8081E04 - - thumb_func_start sub_8081E20 -sub_8081E20: @ 8081E20 - push {r4-r6,lr} - ldr r0, =0x020322a4 - ldr r0, [r0] - movs r2, 0x82 - lsls r2, 1 - adds r1, r0, r2 - ldrh r1, [r1] - adds r0, 0x4E - ldrh r4, [r0] - movs r2, 0 - ldr r5, =0x00000383 - cmp r1, r5 - bhi _08081E48 - movs r2, 0x5 - b _08081E9A - .pool -_08081E48: - ldr r3, =0xfffffc7c - adds r0, r1, r3 - lsls r0, 16 - lsrs r0, 16 - ldr r3, =0x00000257 - cmp r0, r3 - bhi _08081E64 - movs r2, 0x4 - b _08081E9A - .pool -_08081E64: - ldr r6, =0xfffffa24 - adds r0, r1, r6 - lsls r0, 16 - lsrs r0, 16 - cmp r0, r3 - bhi _08081E78 - movs r2, 0x3 - b _08081E9A - .pool -_08081E78: - ldr r3, =0xfffff7cc - adds r0, r1, r3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, r5 - bhi _08081E8C - movs r2, 0x2 - b _08081E9A - .pool -_08081E8C: - ldr r6, =0xfffff31c - adds r0, r1, r6 - lsls r0, 16 - ldr r1, =0x012b0000 - cmp r0, r1 - bhi _08081E9A - movs r2, 0x1 -_08081E9A: - lsls r0, r2, 16 - asrs r0, 16 - bl sub_8081BC8 - movs r2, 0 - cmp r4, 0x40 - bhi _08081F7C - adds r0, r4, 0 - subs r0, 0x32 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x31 - bhi _08081EC4 - ldr r2, =0x0000ffff - b _08081F7C - .pool -_08081EC4: - adds r0, r4, 0 - subs r0, 0x64 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x31 - bhi _08081ED8 - ldr r2, =0x0000fffe - b _08081F7C - .pool -_08081ED8: - adds r0, r4, 0 - subs r0, 0x96 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x31 - bhi _08081EEC - ldr r2, =0x0000fffd - b _08081F7C - .pool -_08081EEC: - adds r0, r4, 0 - subs r0, 0xC8 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x31 - bhi _08081F00 - ldr r2, =0x0000fffc - b _08081F7C - .pool -_08081F00: - adds r0, r4, 0 - subs r0, 0xFA - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x31 - bhi _08081F14 - ldr r2, =0x0000fffb - b _08081F7C - .pool -_08081F14: - ldr r1, =0xfffffea2 - adds r0, r4, r1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x31 - bhi _08081F2C - ldr r2, =0x0000fffa - b _08081F7C - .pool -_08081F2C: - ldr r3, =0xfffffe70 - adds r0, r4, r3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x31 - bhi _08081F44 - ldr r2, =0x0000fff9 - b _08081F7C - .pool -_08081F44: - ldr r6, =0xfffffe0c - adds r0, r4, r6 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x31 - bhi _08081F5C - ldr r2, =0x0000fff8 - b _08081F7C - .pool -_08081F5C: - ldr r1, =0xfffffdda - adds r0, r4, r1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x31 - bhi _08081F74 - ldr r2, =0x0000fff7 - b _08081F7C - .pool -_08081F74: - ldr r0, =0x00000257 - cmp r4, r0 - bls _08081F7C - ldr r2, =0x0000fff6 -_08081F7C: - lsls r0, r2, 16 - asrs r0, 16 - bl sub_8081BB0 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8081E20 - - thumb_func_start sub_8081F94 -sub_8081F94: @ 8081F94 - push {lr} - adds r1, r0, 0 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _08081FB8 - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08081FB8 - movs r2, 0xBC - lsls r2, 6 - b _08081FBA - .pool -_08081FB8: - ldr r2, =0x00002fff -_08081FBA: - adds r0, r2, 0 - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8081F94 - - thumb_func_start sub_8081FC8 -sub_8081FC8: @ 8081FC8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r4, =0x020322a4 - ldr r0, [r4] - adds r0, 0x63 - ldrb r0, [r0] - cmp r0, 0x2 - bhi _08081FDE - bl sub_8082D28 -_08081FDE: - bl link_get_multiplayer_id - ldr r0, [r4] - adds r0, 0x63 - ldrb r0, [r0] - subs r0, 0x1 - cmp r0, 0xC - bls _08081FF0 - b _0808249E -_08081FF0: - lsls r0, 2 - ldr r1, =_08082004 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08082004: - .4byte _08082038 - .4byte _08082078 - .4byte _080820D4 - .4byte _080821C8 - .4byte _08082278 - .4byte _08082286 - .4byte _080822B0 - .4byte _08082458 - .4byte _080822E4 - .4byte _08082308 - .4byte _080823B0 - .4byte _08082430 - .4byte _0808246C -_08082038: - ldr r0, =0x03007420 - movs r1, 0x80 - lsls r1, 1 - bl MPlayTempoControl - movs r4, 0 - b _08082064 - .pool -_0808204C: - ldr r0, =0x020322a4 - ldr r0, [r0] - movs r1, 0x90 - lsls r1, 1 - adds r0, r1 - adds r0, r4 - ldrb r0, [r0] - bl remove_task - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_08082064: - ldr r0, =0x020375e0 - ldrh r0, [r0] - cmp r4, r0 - bcc _0808204C - b _08082458 - .pool -_08082078: - ldr r4, =0x020322a4 - ldr r1, [r4] - adds r1, 0x4C - ldrh r0, [r1] - subs r0, 0x20 - strh r0, [r1] - lsls r0, 16 - cmp r0, 0 - bgt _080820C6 - bl sub_8009F8C - ldr r2, [r4] - adds r1, r2, 0 - adds r1, 0x4C - movs r0, 0 - strh r0, [r1] - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _080820B0 - adds r1, 0x17 - ldrb r0, [r1] - adds r0, 0x1 - b _080820B6 - .pool -_080820B0: - adds r1, r2, 0 - adds r1, 0x63 - movs r0, 0x5 -_080820B6: - strb r0, [r1] - ldr r0, =0x020322a4 - ldr r1, [r0] - movs r0, 0 - strb r0, [r1] - ldr r0, =0x03007630 - bl MPlayStop_rev01 -_080820C6: - bl sub_807F738 - b _0808249E - .pool -_080820D4: - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - beq _080820E0 - b _08082458 -_080820E0: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _080820EC - b _0808249E -_080820EC: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _0808218C - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _0808218C - ldr r3, =0x020322a4 - ldr r1, [r3] - movs r4, 0x8E - lsls r4, 5 - adds r2, r1, r4 - movs r5, 0x82 - lsls r5, 1 - adds r0, r1, r5 - ldr r0, [r0] - str r0, [r2] - adds r0, r1, 0 - adds r0, 0x4E - ldrh r0, [r0] - ldr r2, =0x000011c4 - adds r1, r2 - strh r0, [r1] - movs r4, 0 - mov r8, r3 - mov r12, r8 - ldr r7, =0x000011c8 - movs r6, 0x92 - lsls r6, 1 -_08082128: - movs r3, 0 - adds r5, r4, 0x1 - lsls r0, r4, 1 - adds r0, r4 - lsls r4, r0, 1 -_08082132: - mov r1, r12 - ldr r0, [r1] - lsls r1, r3, 1 - adds r1, r4 - adds r2, r0, r7 - adds r2, r1 - adds r0, r6 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r2] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x2 - bls _08082132 - lsls r0, r5, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _08082128 - mov r2, r8 - ldr r1, [r2] - movs r4, 0x8E - lsls r4, 5 - adds r1, r4 - movs r0, 0 - movs r2, 0x20 - bl link_0800A448 - lsls r0, 24 - cmp r0, 0 - bne _08082172 - b _0808249E -_08082172: - mov r5, r8 - ldr r1, [r5] - b _0808245C - .pool -_0808218C: - ldr r4, =0x020322a4 - ldr r3, [r4] - movs r0, 0xCC - lsls r0, 1 - adds r1, r3, r0 - movs r2, 0x82 - lsls r2, 1 - adds r0, r3, r2 - ldr r0, [r0] - str r0, [r1] - adds r0, r3, 0 - adds r0, 0x4E - ldrh r2, [r0] - movs r5, 0xCE - lsls r5, 1 - adds r0, r3, r5 - strh r2, [r0] - movs r0, 0 - movs r2, 0x28 - bl link_0800A448 - lsls r0, 24 - cmp r0, 0 - bne _080821BE - b _0808249E -_080821BE: - ldr r1, [r4] - b _0808245C - .pool -_080821C8: - bl sub_800A550 - lsls r0, 24 - cmp r0, 0 - bne _080821D4 - b _0808249E -_080821D4: - bl sub_800A5B4 - ldr r5, =0x020322a4 - ldr r1, [r5] - adds r1, 0x63 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _08082254 - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08082254 - ldr r2, =0x020223c4 - ldr r3, [r5] - ldrh r0, [r2, 0x4] - adds r1, r3, 0 - adds r1, 0x4E - strh r0, [r1] - movs r0, 0x82 - lsls r0, 1 - adds r1, r3, r0 - ldr r0, [r2] - str r0, [r1] - movs r4, 0 - adds r7, r2, 0 - adds r7, 0x8 - adds r6, r5, 0 - movs r2, 0x92 - lsls r2, 1 -_08082216: - movs r3, 0 - adds r5, r4, 0x1 - lsls r0, r4, 1 - adds r0, r4 - lsls r4, r0, 1 -_08082220: - ldr r1, [r6] - lsls r0, r3, 1 - adds r0, r4 - adds r1, r2 - adds r1, r0 - adds r0, r7, r0 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x2 - bls _08082220 - lsls r0, r5, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _08082216 - b _0808249E - .pool -_08082254: - ldr r2, =0x020223c4 - ldr r0, =0x020322a4 - ldr r3, [r0] - ldrh r0, [r2, 0x4] - adds r1, r3, 0 - adds r1, 0x4E - strh r0, [r1] - movs r4, 0x82 - lsls r4, 1 - adds r1, r3, r4 - ldr r0, [r2] - str r0, [r1] - b _0808249E - .pool -_08082278: - bl sub_8083B08 - lsls r0, 24 - cmp r0, 0 - bne _08082284 - b _0808249E -_08082284: - b _08082458 -_08082286: - bl berry_blender_related - lsls r0, 24 - cmp r0, 0 - bne _08082292 - b _0808249E -_08082292: - ldr r0, =0x03005d98 - ldrb r0, [r0] - cmp r0, 0 - bne _080822A8 - movs r0, 0x22 - bl sav12_xor_increment - b _08082458 - .pool -_080822A8: - movs r0, 0x21 - bl sav12_xor_increment - b _08082458 -_080822B0: - ldr r6, =0x020322a4 - ldr r4, [r6] - ldr r5, =0x000011b8 - adds r4, r5 - ldr r5, =gUnknown_08339831 - bl sav2_get_text_speed - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_808417C - cmp r0, 0 - bne _080822D2 - b _0808249E -_080822D2: - ldr r1, [r6] - b _0808245C - .pool -_080822E4: - ldr r4, =0x020322a4 - ldr r0, [r4] - adds r0, 0x9E - movs r1, 0 - strb r1, [r0] - ldr r0, =gUnknown_083399B8 - movs r1, 0x1 - movs r2, 0xD - movs r3, 0 - bl CreateYesNoMenu - ldr r1, [r4] - b _0808245C - .pool -_08082308: - bl sub_8198C58 - lsls r0, 24 - asrs r2, r0, 24 - cmp r2, 0 - beq _0808236C - cmp r2, 0 - bgt _08082322 - movs r0, 0x1 - negs r0, r0 - cmp r2, r0 - beq _08082328 - b _0808249E -_08082322: - cmp r2, 0x1 - beq _08082328 - b _0808249E -_08082328: - ldr r2, =0x020322a4 - ldr r0, [r2] - adds r0, 0x9E - movs r1, 0x1 - strb r1, [r0] - ldr r1, [r2] - adds r1, 0x63 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r4, 0 -_0808233E: - ldr r0, =0x020322a4 - ldr r0, [r0] - lsls r1, r4, 1 - adds r0, 0x8E - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0xFF - beq _0808235C - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram -_0808235C: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _0808233E - b _0808249E - .pool -_0808236C: - ldr r1, =0x020322a4 - ldr r0, [r1] - adds r0, 0x9E - strb r2, [r0] - ldr r1, [r1] - adds r1, 0x63 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r4, 0 -_08082380: - ldr r0, =0x020322a4 - ldr r0, [r0] - lsls r1, r4, 1 - adds r0, 0x8E - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0xFF - beq _0808239E - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram -_0808239E: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _08082380 - b _0808249E - .pool -_080823B0: - ldr r6, =0x03003110 - adds r0, r6, 0 - bl sub_8081F94 - ldr r4, =0x020322a4 - ldr r2, [r4] - adds r0, r2, 0 - adds r0, 0x9E - ldrb r5, [r0] - cmp r5, 0 - bne _0808241C - movs r0, 0x4 - bl IsBagPocketNonEmpty - lsls r0, 24 - cmp r0, 0 - bne _080823EC - ldr r0, [r4] - adds r0, 0x70 - movs r1, 0x2 - strh r1, [r0] - ldr r0, =0x00009999 - b _08082414 - .pool -_080823EC: - bl sub_8136EF4 - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0808240C - ldr r0, [r4] - adds r0, 0x70 - movs r1, 0x3 - strh r1, [r0] - ldr r0, =0x0000aaaa - b _08082414 - .pool -_0808240C: - ldr r0, [r4] - adds r0, 0x70 - strh r5, [r0] - ldr r0, =0x00007779 -_08082414: - strh r0, [r6, 0x2] - b _08082458 - .pool -_0808241C: - adds r1, r2, 0 - adds r1, 0x70 - movs r0, 0x1 - strh r0, [r1] - ldr r0, =0x00008888 - strh r0, [r6, 0x2] - subs r1, 0xD - b _0808245E - .pool -_08082430: - ldr r0, =0x03005d98 - ldrb r0, [r0] - cmp r0, 0 - beq _08082458 - ldr r0, =sub_8082924 - bl SetMainCallback2 - ldr r2, =0x020322a4 - ldr r0, [r2] - adds r0, 0x63 - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - b _0808249C - .pool -_08082458: - ldr r0, =0x020322a4 - ldr r1, [r0] -_0808245C: - adds r1, 0x63 -_0808245E: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0808249E - .pool -_0808246C: - ldr r6, =0x020322a4 - ldr r4, [r6] - ldr r0, =0x000011b8 - adds r4, r0 - ldr r5, =gUnknown_0833981A - bl sav2_get_text_speed - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_808417C - cmp r0, 0 - beq _0808249E - ldr r0, =sub_8082644 - bl SetMainCallback2 - ldr r0, [r6] - adds r0, 0x63 - movs r1, 0 - strb r1, [r0] - ldr r0, [r6] -_0808249C: - strb r1, [r0] -_0808249E: - bl sub_808330C - ldr r4, =0x020322a4 - ldr r0, [r4] - adds r0, 0x4C - ldrh r0, [r0] - bl sub_8083230 - bl sub_8082AD4 - ldr r1, [r4] - movs r2, 0x8E - lsls r2, 1 - adds r0, r1, r2 - movs r4, 0 - ldrsh r0, [r0, r4] - movs r5, 0x8F - lsls r5, 1 - adds r1, r5 - movs r2, 0 - ldrsh r1, [r1, r2] - bl nullsub_31 - bl RunActiveTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl RunTextPrinters - bl fade_and_return_progress_probably - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8081FC8 - - thumb_func_start sub_80824FC -sub_80824FC: @ 80824FC - push {r4,lr} - ldr r1, =0x020322a4 - ldr r0, [r1] - movs r2, 0xD0 - lsls r2, 1 - adds r0, r2 - ldr r0, [r0] - adds r4, r1, 0 - cmp r0, 0x6 - bls _08082512 - b _0808263C -_08082512: - lsls r0, 2 - ldr r1, =_08082524 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08082524: - .4byte _08082540 - .4byte _08082558 - .4byte _08082584 - .4byte _08082594 - .4byte _080825BA - .4byte _08082600 - .4byte _0808261A -_08082540: - bl sub_800ADF8 - ldr r0, =0x020322a4 - ldr r2, [r0] - movs r3, 0xD0 - lsls r3, 1 - adds r1, r2, r3 - movs r0, 0x1 - b _0808260C - .pool -_08082558: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _0808263C - ldr r0, =0x020322a4 - ldr r1, [r0] - movs r2, 0xD0 - lsls r2, 1 - adds r1, r2 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - ldr r1, =0x03002700 - movs r0, 0x1 - strb r0, [r1] - b _0808263C - .pool -_08082584: - bl sub_8153430 - ldr r0, =0x020322a4 - ldr r2, [r0] - b _08082602 - .pool -_08082594: - ldr r1, [r4] - movs r2, 0x84 - lsls r2, 1 - adds r1, r2 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - cmp r0, 0xA - bne _0808263C - bl sub_800ADF8 - ldr r1, [r4] - movs r3, 0xD0 - lsls r3, 1 - adds r1, r3 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - b _0808263C -_080825BA: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _0808263C - bl sub_8153474 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - beq _080825E4 - ldr r0, =0x020322a4 - ldr r0, [r0] - movs r1, 0xD0 - lsls r1, 1 - adds r0, r1 - movs r1, 0x5 - str r1, [r0] - b _0808263C - .pool -_080825E4: - ldr r0, =0x020322a4 - ldr r1, [r0] - movs r3, 0x84 - lsls r3, 1 - adds r0, r1, r3 - str r2, [r0] - movs r0, 0xD0 - lsls r0, 1 - adds r1, r0 - movs r0, 0x3 - str r0, [r1] - b _0808263C - .pool -_08082600: - ldr r2, [r4] -_08082602: - movs r3, 0xD0 - lsls r3, 1 - adds r1, r2, r3 - ldr r0, [r1] - adds r0, 0x1 -_0808260C: - str r0, [r1] - movs r0, 0x84 - lsls r0, 1 - adds r1, r2, r0 - movs r0, 0 - str r0, [r1] - b _0808263C -_0808261A: - ldr r1, [r4] - movs r2, 0x84 - lsls r2, 1 - adds r1, r2 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - cmp r0, 0x5 - ble _0808263C - ldr r1, =0x03002700 - movs r0, 0 - strb r0, [r1] - movs r0, 0x1 - b _0808263E - .pool -_0808263C: - movs r0, 0 -_0808263E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80824FC - - thumb_func_start sub_8082644 -sub_8082644: @ 8082644 - push {r4-r6,lr} - sub sp, 0x4 - ldr r1, =0x020322a4 - ldr r0, [r1] - adds r0, 0x63 - ldrb r0, [r0] - adds r6, r1, 0 - cmp r0, 0xC - bls _08082658 - b _080828DC -_08082658: - lsls r0, 2 - ldr r1, =_0808266C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0808266C: - .4byte _080826A0 - .4byte _080826EC - .4byte _0808271C - .4byte _08082754 - .4byte _0808278C - .4byte _080827AA - .4byte _080827C8 - .4byte _080827FC - .4byte _08082818 - .4byte _08082828 - .4byte _0808284C - .4byte _080828A4 - .4byte _080828C6 -_080826A0: - ldr r1, [r6] - adds r0, r1, 0 - adds r0, 0x64 - ldrh r2, [r0] - ldr r0, =0x00002222 - cmp r2, r0 - bne _080826B0 - b _080827A2 -_080826B0: - ldr r0, =0x00001111 - cmp r2, r0 - beq _080826B8 - b _080828DC -_080826B8: - adds r0, r1, 0 - adds r0, 0x6C - ldrh r2, [r0] - ldr r0, =0x00009999 - cmp r2, r0 - bne _080826D8 - adds r1, 0x63 - movs r0, 0x2 - strb r0, [r1] - b _080828DC - .pool -_080826D8: - ldr r0, =0x0000aaaa - cmp r2, r0 - bne _080827A2 - adds r1, 0x63 - movs r0, 0x1 - strb r0, [r1] - b _080828DC - .pool -_080826EC: - ldr r0, [r6] - adds r0, 0x63 - movs r1, 0x3 - strb r1, [r0] - ldr r4, =0x02021fc4 - ldr r0, [r6] - adds r0, 0x6E - ldrh r0, [r0] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r0, =0x020229f0 - adds r1, r0 - adds r0, r4, 0 - bl CopyString - ldr r1, =gUnknown_083398DD - b _08082740 - .pool -_0808271C: - ldr r1, [r6] - adds r1, 0x63 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r4, =0x02021fc4 - ldr r0, [r6] - adds r0, 0x6E - ldrh r0, [r0] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r0, =0x020229f0 - adds r1, r0 - adds r0, r4, 0 - bl CopyString - ldr r1, =gUnknown_083398B0 -_08082740: - adds r0, r4, 0 - bl AppendString - b _080828DC - .pool -_08082754: - ldr r4, [r6] - ldr r0, =0x000011b8 - adds r4, r0 - ldr r5, =0x02021fc4 - bl sav2_get_text_speed - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_808417C - cmp r0, 0 - bne _08082774 - b _080828DC -_08082774: - ldr r1, [r6] - movs r0, 0x84 - lsls r0, 1 - adds r2, r1, r0 - movs r0, 0 - str r0, [r2] - b _080828BC - .pool -_0808278C: - ldr r4, [r6] - movs r2, 0x84 - lsls r2, 1 - adds r1, r4, r2 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - cmp r0, 0x3C - bgt _080827A0 - b _080828DC -_080827A0: - adds r1, r4, 0 -_080827A2: - adds r1, 0x63 - movs r0, 0x5 - strb r0, [r1] - b _080828DC -_080827AA: - ldr r0, [r6] - ldr r1, =0x000011b8 - adds r0, r1 - ldr r1, =gUnknown_085EE42D - movs r2, 0 - bl sub_808417C - bl sub_800ADF8 - b _080828BA - .pool -_080827C8: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _080827D4 - b _080828DC -_080827D4: - ldr r3, =0x020322a4 - ldr r1, [r3] - movs r2, 0x84 - lsls r2, 1 - adds r0, r1, r2 - movs r2, 0 - str r2, [r0] - adds r1, 0x63 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r3] - movs r1, 0xD0 - lsls r1, 1 - adds r0, r1 - str r2, [r0] - b _080828DC - .pool -_080827FC: - bl sub_80824FC - lsls r0, 24 - cmp r0, 0 - beq _080828DC - movs r0, 0x37 - bl audio_play - ldr r0, =0x020322a4 - ldr r1, [r0] - b _080828BC - .pool -_08082818: - ldr r1, [r6] - adds r1, 0x63 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - bl sub_800ADF8 - b _080828DC -_08082828: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080828DC - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x020322a4 - ldr r1, [r0] - b _080828BC - .pool -_0808284C: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _080828DC - ldr r2, [r6] - adds r0, r2, 0 - adds r0, 0x64 - ldrh r1, [r0] - ldr r0, =0x00002222 - cmp r1, r0 - bne _08082898 - bl FreeAllWindowBuffers - movs r0, 0x2 - bl UnsetBgTilemapBuffer - movs r0, 0x1 - bl UnsetBgTilemapBuffer - ldr r0, [r6] - bl Free - str r4, [r6] - ldr r0, =sub_807FA80 - bl SetMainCallback2 - b _080828DC - .pool -_08082898: - movs r1, 0x84 - lsls r1, 1 - adds r0, r2, r1 - str r4, [r0] - adds r1, r2, 0 - b _080828BC -_080828A4: - ldr r1, [r6] - movs r2, 0x84 - lsls r2, 1 - adds r1, r2 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - cmp r0, 0x1E - ble _080828DC - bl sub_800AC34 -_080828BA: - ldr r1, [r6] -_080828BC: - adds r1, 0x63 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080828DC -_080828C6: - ldr r0, =0x03003124 - ldrb r4, [r0] - cmp r4, 0 - bne _080828DC - ldr r0, [r6] - bl Free - str r4, [r6] - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 -_080828DC: - bl sub_8082AD4 - ldr r0, =0x020322a4 - ldr r1, [r0] - movs r2, 0x8E - lsls r2, 1 - adds r0, r1, r2 - movs r2, 0 - ldrsh r0, [r0, r2] - movs r2, 0x8F - lsls r2, 1 - adds r1, r2 - movs r2, 0 - ldrsh r1, [r1, r2] - bl nullsub_31 - bl RunActiveTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl RunTextPrinters - bl fade_and_return_progress_probably - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8082644 - - thumb_func_start sub_8082924 -sub_8082924: @ 8082924 - push {r4-r6,lr} - ldr r1, =0x020322a4 - ldr r0, [r1] - adds r0, 0x63 - ldrb r0, [r0] - adds r6, r1, 0 - cmp r0, 0xA - bls _08082936 - b _08082A92 -_08082936: - lsls r0, 2 - ldr r1, =_08082948 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08082948: - .4byte _08082974 - .4byte _080829AA - .4byte _080829D4 - .4byte _08082A00 - .4byte _08082A92 - .4byte _08082A92 - .4byte _08082A92 - .4byte _08082A92 - .4byte _08082A92 - .4byte _08082A30 - .4byte _08082A48 -_08082974: - ldr r1, [r6] - adds r0, r1, 0 - adds r0, 0x70 - ldrh r0, [r0] - cmp r0, 0x1 - bhi _08082986 - adds r1, 0x63 - movs r0, 0x9 - strb r0, [r1] -_08082986: - ldr r2, [r6] - adds r0, r2, 0 - adds r0, 0x70 - ldrh r1, [r0] - cmp r1, 0x2 - bne _08082996 - subs r0, 0xD - strb r1, [r0] -_08082996: - ldr r1, [r6] - adds r0, r1, 0 - adds r0, 0x70 - ldrh r0, [r0] - cmp r0, 0x3 - bne _08082A92 - adds r1, 0x63 - movs r0, 0x1 - strb r0, [r1] - b _08082A92 -_080829AA: - ldr r0, [r6] - adds r0, 0x63 - movs r2, 0 - movs r1, 0x3 - strb r1, [r0] - ldr r0, [r6] - ldr r1, =0x000011b8 - adds r0, r1 - strh r2, [r0] - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_08339896 - bl CopyString - b _08082A92 - .pool -_080829D4: - ldr r1, [r6] - adds r1, 0x63 - ldrb r0, [r1] - adds r0, 0x1 - movs r2, 0 - strb r0, [r1] - ldr r0, [r6] - ldr r1, =0x000011b8 - adds r0, r1 - strh r2, [r0] - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_08339858 - bl CopyString - b _08082A92 - .pool -_08082A00: - ldr r4, [r6] - ldr r2, =0x000011b8 - adds r4, r2 - ldr r5, =0x02021fc4 - bl sav2_get_text_speed - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_808417C - cmp r0, 0 - beq _08082A92 - ldr r0, [r6] - adds r0, 0x63 - movs r1, 0x9 - strb r1, [r0] - b _08082A92 - .pool -_08082A30: - movs r0, 0x3 - bl sub_80A2390 - ldr r0, =0x020322a4 - ldr r1, [r0] - adds r1, 0x63 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08082A92 - .pool -_08082A48: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08082A92 - ldr r0, [r6] - adds r0, 0x70 - ldrh r0, [r0] - cmp r0, 0 - bne _08082A70 - ldr r0, =sub_807FA80 - bl SetMainCallback2 - b _08082A76 - .pool -_08082A70: - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 -_08082A76: - bl FreeAllWindowBuffers - movs r0, 0x2 - bl UnsetBgTilemapBuffer - movs r0, 0x1 - bl UnsetBgTilemapBuffer - ldr r4, =0x020322a4 - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] -_08082A92: - bl sub_8082AD4 - ldr r0, =0x020322a4 - ldr r1, [r0] - movs r2, 0x8E - lsls r2, 1 - adds r0, r1, r2 - movs r2, 0 - ldrsh r0, [r0, r2] - movs r2, 0x8F - lsls r2, 1 - adds r1, r2 - movs r2, 0 - ldrsh r1, [r1, r2] - bl nullsub_31 - bl RunActiveTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl RunTextPrinters - bl fade_and_return_progress_probably - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8082924 - - thumb_func_start sub_8082AD4 -sub_8082AD4: @ 8082AD4 - push {r4-r7,lr} - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _08082AE0 - b _08082CA4 -_08082AE0: - ldr r4, =0x03003090 - ldrh r0, [r4] - ldr r1, =0x00002fff - movs r2, 0xBC - lsls r2, 6 - bl sub_80814B0 - cmp r0, 0 - beq _08082B66 - ldrh r1, [r4, 0x2] - ldr r0, =0x00001111 - cmp r1, r0 - bne _08082B58 - ldrh r3, [r4, 0x4] - ldr r0, =0x00009999 - cmp r3, r0 - beq _08082B38 - cmp r3, r0 - bgt _08082B24 - ldr r0, =0x00008888 - b _08082B26 - .pool -_08082B24: - ldr r0, =0x0000aaaa -_08082B26: - cmp r3, r0 - beq _08082B38 - ldr r2, =0x020322a4 - b _08082B48 - .pool -_08082B38: - ldr r2, =0x020322a4 - ldr r0, [r2] - adds r1, r0, 0 - adds r1, 0x6C - strh r3, [r1] - ldrh r1, [r4, 0x6] - adds r0, 0x6E - strh r1, [r0] -_08082B48: - ldr r0, [r2] - adds r0, 0x64 - ldr r1, =0x00001111 - b _08082B64 - .pool -_08082B58: - ldr r0, =0x00002222 - cmp r1, r0 - bne _08082B66 - ldr r0, =0x020322a4 - ldr r0, [r0] - adds r0, 0x64 -_08082B64: - strh r1, [r0] -_08082B66: - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - beq _08082B72 - b _08082CA4 -_08082B72: - ldr r2, =0x020322a4 - ldr r0, [r2] - adds r0, 0x64 - ldrh r1, [r0] - ldr r0, =0x00001111 - cmp r1, r0 - bne _08082B82 - b _08082CA4 -_08082B82: - ldr r0, =0x00002222 - cmp r1, r0 - bne _08082B8A - b _08082CA4 -_08082B8A: - movs r5, 0 - adds r7, r2, 0 - b _08082BF4 - .pool -_08082B9C: - ldr r6, =0x03003090 - lsls r4, r5, 4 - adds r0, r4, r6 - ldrh r0, [r0] - ldr r1, =0x00002fff - movs r2, 0xBC - lsls r2, 6 - bl sub_80814B0 - cmp r0, 0 - beq _08082BEE - adds r0, r6, 0x2 - adds r0, r4, r0 - ldrh r2, [r0] - ldr r0, =0x00008888 - cmp r2, r0 - beq _08082BE4 - cmp r2, r0 - bgt _08082BD8 - ldr r0, =0x00007779 - b _08082BE0 - .pool -_08082BD8: - ldr r0, =0x00009999 - cmp r2, r0 - beq _08082BE4 - ldr r0, =0x0000aaaa -_08082BE0: - cmp r2, r0 - bne _08082BEE -_08082BE4: - ldr r0, [r7] - lsls r1, r5, 1 - adds r0, 0x64 - adds r0, r1 - strh r2, [r0] -_08082BEE: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_08082BF4: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - bcc _08082B9C - movs r5, 0 - b _08082C12 - .pool -_08082C0C: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_08082C12: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - bcs _08082C2E - ldr r0, =0x020322a4 - ldr r0, [r0] - lsls r1, r5, 1 - adds r0, 0x64 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - bne _08082C0C -_08082C2E: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - bne _08082CA4 - movs r5, 0 - ldr r4, =0x00007779 - b _08082C4E - .pool -_08082C48: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_08082C4E: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - bcs _08082C6A - ldr r0, =0x020322a4 - ldr r0, [r0] - lsls r1, r5, 1 - adds r0, 0x64 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r4 - beq _08082C48 -_08082C6A: - ldr r4, =0x03003110 - adds r0, r4, 0 - bl sub_8081F94 - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - bne _08082C90 - ldr r0, =0x00002222 - strh r0, [r4, 0x2] - b _08082CA4 - .pool -_08082C90: - ldr r0, =0x00001111 - strh r0, [r4, 0x2] - ldr r0, =0x020322a4 - ldr r0, [r0] - lsls r1, r5, 1 - adds r0, 0x64 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r4, 0x4] - strh r5, [r4, 0x6] -_08082CA4: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8082AD4 - - thumb_func_start sub_8082CB4 -sub_8082CB4: @ 8082CB4 - push {r4,lr} - sub sp, 0x14 - movs r1, 0xF0 - lsls r1, 7 - str r1, [sp] - movs r1, 0xA0 - lsls r1, 7 - str r1, [sp, 0x4] - mov r3, sp - ldr r1, =0x020322a4 - ldr r1, [r1] - mov r12, r1 - movs r1, 0x8E - lsls r1, 1 - add r1, r12 - ldrh r2, [r1] - movs r1, 0x78 - subs r1, r2 - strh r1, [r3, 0x8] - movs r1, 0x8F - lsls r1, 1 - add r1, r12 - ldrh r2, [r1] - movs r1, 0x50 - subs r1, r2 - strh r1, [r3, 0xA] - mov r2, sp - movs r3, 0x8D - lsls r3, 1 - add r3, r12 - ldrh r1, [r3] - strh r1, [r2, 0xC] - ldrh r1, [r3] - strh r1, [r2, 0xE] - mov r1, r12 - adds r1, 0x4A - ldrh r1, [r1] - strh r1, [r2, 0x10] - mov r1, sp - ldm r1!, {r2-r4} - stm r0!, {r2-r4} - ldm r1!, {r2,r3} - stm r0!, {r2,r3} - add sp, 0x14 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8082CB4 - - thumb_func_start sub_8082D18 -sub_8082D18: @ 8082D18 - ldr r0, =0x020322a4 - ldr r0, [r0] - adds r0, 0x4A - ldrh r0, [r0] - bx lr - .pool - thumb_func_end sub_8082D18 - - thumb_func_start sub_8082D28 -sub_8082D28: @ 8082D28 - push {r4,lr} - movs r1, 0 - ldr r4, =0x03003124 - ldrb r0, [r4] - cmp r0, 0 - beq _08082D3C - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r1, r0, 24 -_08082D3C: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08082DCC - ldrb r0, [r4] - cmp r0, 0 - beq _08082DCC - cmp r1, 0 - bne _08082D90 - ldr r0, =0x020322a4 - ldr r3, [r0] - adds r2, r3, 0 - adds r2, 0x4A - adds r0, r3, 0 - adds r0, 0x4C - ldrh r0, [r0] - ldrh r1, [r2] - adds r0, r1 - strh r0, [r2] - ldr r1, =0x03003110 - movs r4, 0x8B - lsls r4, 1 - adds r0, r3, r4 - ldrh r0, [r0] - strh r0, [r1, 0xA] - ldrh r0, [r2] - strh r0, [r1, 0xC] - movs r1, 0xA0 - lsls r1, 1 - adds r0, r3, r1 - bl sub_8082CB4 - b _08082DEA - .pool -_08082D90: - ldr r3, =0x03003090 - ldrh r0, [r3] - movs r1, 0xFF - lsls r1, 8 - ands r1, r0 - movs r0, 0x88 - lsls r0, 7 - cmp r1, r0 - bne _08082DEA - ldr r0, =0x020322a4 - ldr r2, [r0] - ldrh r0, [r3, 0xA] - movs r4, 0x8B - lsls r4, 1 - adds r1, r2, r4 - strh r0, [r1] - ldrh r0, [r3, 0xC] - adds r1, r2, 0 - adds r1, 0x4A - strh r0, [r1] - movs r1, 0xA0 - lsls r1, 1 - adds r0, r2, r1 - bl sub_8082CB4 - b _08082DEA - .pool -_08082DCC: - ldr r0, =0x020322a4 - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0x4A - adds r0, r1, 0 - adds r0, 0x4C - ldrh r0, [r0] - ldrh r3, [r2] - adds r0, r3 - strh r0, [r2] - movs r4, 0xA0 - lsls r4, 1 - adds r0, r1, r4 - bl sub_8082CB4 -_08082DEA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8082D28 - - thumb_func_start sub_8082DF4 -sub_8082DF4: @ 8082DF4 - push {r4-r6,lr} - ldr r4, =0x020322a4 - ldr r0, [r4] - movs r6, 0x8E - lsls r6, 1 - adds r0, r6 - ldrh r1, [r0] - movs r0, 0x14 - bl SetGpuReg - ldr r0, [r4] - movs r5, 0x8F - lsls r5, 1 - adds r0, r5 - ldrh r1, [r0] - movs r0, 0x16 - bl SetGpuReg - ldr r0, [r4] - adds r0, r6 - ldrh r1, [r0] - movs r0, 0x10 - bl SetGpuReg - ldr r0, [r4] - adds r0, r5 - ldrh r1, [r0] - movs r0, 0x12 - bl SetGpuReg - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8082DF4 - - thumb_func_start sub_8082E3C -sub_8082E3C: @ 8082E3C - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x2E] - ldrh r1, [r2, 0x32] - adds r0, r1 - strh r0, [r2, 0x32] - ldrh r0, [r2, 0x30] - ldrh r1, [r2, 0x34] - adds r0, r1 - strh r0, [r2, 0x34] - movs r1, 0x32 - ldrsh r0, [r2, r1] - cmp r0, 0 - bge _08082E5A - adds r0, 0x7 -_08082E5A: - asrs r0, 3 - strh r0, [r2, 0x24] - movs r1, 0x34 - ldrsh r0, [r2, r1] - cmp r0, 0 - bge _08082E68 - adds r0, 0x7 -_08082E68: - asrs r0, 3 - strh r0, [r2, 0x26] - adds r0, r2, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08082E80 - adds r0, r2, 0 - bl RemoveObjectAndFreeTiles -_08082E80: - pop {r0} - bx r0 - thumb_func_end sub_8082E3C - - thumb_func_start sub_8082E84 -sub_8082E84: @ 8082E84 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - bl GenerateRandomNumber - lsls r0, 16 - lsrs r1, r0, 16 - movs r0, 0x1 - ands r1, r0 - adds r0, r1, 0x1 - cmp r0, 0 - beq _08082F40 - ldr r0, =gUnknown_08329F40 - mov r9, r0 - ldr r2, =0x02020630 - mov r10, r2 - adds r6, r1, 0x1 - movs r3, 0x1F - mov r8, r3 - movs r7, 0x10 -_08082EB0: - bl GenerateRandomNumber - ldr r1, =0x020322a4 - ldr r4, [r1] - adds r4, 0x4A - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x14 - bl __umodsi3 - ldrh r1, [r4] - adds r1, r0 - lsls r1, 16 - movs r0, 0xFF - lsls r0, 16 - ands r0, r1 - lsrs r2, r0, 16 - adds r0, r2, 0 - adds r0, 0x40 - lsls r0, 1 - add r0, r9 - movs r3, 0 - ldrsh r1, [r0, r3] - cmp r1, 0 - bge _08082EE4 - adds r1, 0x3 -_08082EE4: - asrs r1, 2 - lsls r0, r2, 1 - add r0, r9 - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r0, 0 - bge _08082EF4 - adds r0, 0x3 -_08082EF4: - asrs r2, r0, 2 - adds r1, 0x78 - adds r2, 0x50 - ldr r0, =gUnknown_08339BE0 - movs r3, 0x1 - bl AddObjectToFront - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl GenerateRandomNumber - lsls r5, r4, 4 - adds r5, r4 - lsls r5, 2 - mov r3, r10 - adds r4, r5, r3 - lsls r0, 16 - lsrs r0, 16 - mov r1, r8 - ands r0, r1 - subs r0, r7, r0 - strh r0, [r4, 0x2E] - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - mov r2, r8 - ands r0, r2 - subs r0, r7, r0 - strh r0, [r4, 0x30] - ldr r3, =0x0202064c - adds r5, r3 - ldr r0, =sub_8082E3C - str r0, [r5] - subs r6, 0x1 - cmp r6, 0 - bne _08082EB0 -_08082F40: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8082E84 - - thumb_func_start sub_8082F68 -sub_8082F68: @ 8082F68 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r1, 0x2E - ldrsh r0, [r4, r1] - movs r1, 0x3 - bl __divsi3 - negs r0, r0 - strh r0, [r4, 0x26] - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08082F94 - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_08082F94: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8082F68 - - thumb_func_start sub_8082F9C -sub_8082F9C: @ 8082F9C - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x2E] - adds r0, 0x1 - strh r0, [r2, 0x2E] - movs r1, 0x2E - ldrsh r0, [r2, r1] - lsls r0, 1 - negs r0, r0 - strh r0, [r2, 0x26] - lsls r0, 16 - asrs r0, 16 - movs r1, 0xC - negs r1, r1 - cmp r0, r1 - bge _08082FC0 - ldr r0, =0x0000fff4 - strh r0, [r2, 0x26] -_08082FC0: - adds r0, r2, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08082FD4 - adds r0, r2, 0 - bl RemoveObjectAndFreeTiles -_08082FD4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8082F9C - - thumb_func_start sub_8082FDC -sub_8082FDC: @ 8082FDC - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r1, 16 - ldr r2, =0x020322a4 - ldr r3, [r2] - lsls r4, r0, 1 - adds r2, r3, 0 - adds r2, 0x74 - adds r2, r4 - strh r1, [r2] - lsls r0, 4 - movs r2, 0xAC - lsls r2, 1 - adds r0, r2 - adds r3, r0 - adds r0, r3, 0 - bl sub_807FE14 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8082FDC - - thumb_func_start sub_8083010 -sub_8083010: @ 8083010 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0808304C - cmp r0, 0x1 - bgt _08083026 - cmp r0, 0 - beq _0808302C - b _080830B2 -_08083026: - cmp r0, 0x2 - beq _08083066 - b _080830B2 -_0808302C: - ldrh r0, [r4, 0x30] - adds r0, 0x8 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x58 - ble _080830B2 - movs r0, 0x58 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r0, 0x38 - bl audio_play - b _080830B2 -_0808304C: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - ble _080830B2 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r0, 0 - strh r0, [r4, 0x32] - b _080830B2 -_08083066: - ldrh r0, [r4, 0x30] - adds r0, 0x4 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xB0 - ble _080830B2 - ldrh r0, [r4, 0x34] - adds r0, 0x1 - adds r1, r0, 0 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - bne _080830A0 - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - ldr r0, =gUnknown_08339C60 - movs r2, 0x14 - negs r2, r2 - movs r1, 0x78 - movs r3, 0x2 - bl AddObjectToFront - b _080830B2 - .pool -_080830A0: - movs r0, 0 - strh r0, [r4, 0x2E] - ldr r0, =0x0000fff0 - strh r0, [r4, 0x30] - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim -_080830B2: - ldrh r0, [r4, 0x30] - strh r0, [r4, 0x26] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8083010 - - thumb_func_start sub_80830C0 -sub_80830C0: @ 80830C0 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080830FC - cmp r0, 0x1 - bgt _080830D6 - cmp r0, 0 - beq _080830DC - b _08083130 -_080830D6: - cmp r0, 0x2 - beq _08083112 - b _08083130 -_080830DC: - ldrh r0, [r4, 0x30] - adds r0, 0x8 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5C - ble _08083130 - movs r0, 0x5C - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r0, 0x15 - bl audio_play - b _08083130 -_080830FC: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - ble _08083130 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _08083130 -_08083112: - ldrh r0, [r4, 0x30] - adds r0, 0x4 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xB0 - ble _08083130 - ldr r0, =0x020322a4 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_08083130: - ldrh r0, [r4, 0x30] - strh r0, [r4, 0x26] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80830C0 - - thumb_func_start sub_8083140 -sub_8083140: @ 8083140 - push {lr} - lsls r0, 16 - lsrs r0, 16 - lsls r1, 16 - lsrs r3, r1, 16 - ldr r1, =0x020322a4 - ldr r1, [r1] - movs r2, 0x8C - lsls r2, 1 - adds r1, r2 - ldrh r2, [r1] - cmp r2, r0 - bcs _08083166 - adds r0, r2, 0x2 - strh r0, [r1] - ldrh r0, [r1] - adds r1, r3, 0 - bl sub_8083170 -_08083166: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8083140 - - thumb_func_start sub_8083170 -sub_8083170: @ 8083170 - push {r4-r7,lr} - lsls r0, 16 - lsls r1, 16 - lsrs r1, 16 - ldr r7, =0x06006000 - lsrs r0, 10 - bl __divsi3 - adds r1, r0, 0 - cmp r1, 0 - bge _08083188 - adds r0, r1, 0x7 -_08083188: - asrs r4, r0, 3 - movs r3, 0 - cmp r3, r4 - bge _080831B0 - ldr r0, =0x000080e9 - adds r6, r0, 0 - adds r0, 0x10 - adds r5, r0, 0 - adds r2, r7, 0 - adds r2, 0x56 - adds r0, r7, 0 - adds r3, r4, 0 -_080831A0: - strh r6, [r0, 0x16] - strh r5, [r2] - adds r2, 0x2 - adds r0, 0x2 - subs r3, 0x1 - cmp r3, 0 - bne _080831A0 - adds r3, r4, 0 -_080831B0: - adds r0, r1, 0 - cmp r1, 0 - bge _080831B8 - adds r0, r1, 0x7 -_080831B8: - asrs r2, r0, 3 - lsls r0, r2, 3 - subs r2, r1, r0 - cmp r2, 0 - beq _080831D6 - lsls r0, r3, 1 - adds r0, r7 - ldr r4, =0xffff80e1 - adds r1, r2, r4 - strh r1, [r0, 0x16] - adds r0, 0x56 - adds r4, 0x10 - adds r1, r2, r4 - strh r1, [r0] - adds r3, 0x1 -_080831D6: - cmp r3, 0x7 - bgt _080831FA - ldr r0, =0x000080e1 - adds r4, r0, 0 - adds r0, 0x10 - adds r2, r0, 0 - lsls r1, r3, 1 - adds r0, r1, 0 - adds r0, 0x56 - adds r0, r7 - adds r1, r7 -_080831EC: - strh r4, [r1, 0x16] - strh r2, [r0] - adds r0, 0x2 - adds r1, 0x2 - adds r3, 0x1 - cmp r3, 0x7 - ble _080831EC -_080831FA: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8083170 - - thumb_func_start sub_8083210 -sub_8083210: @ 8083210 - push {lr} - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x00057e40 - muls r0, r1 - cmp r0, 0 - bge _08083222 - ldr r1, =0x0000ffff - adds r0, r1 -_08083222: - asrs r0, 16 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8083210 - - thumb_func_start sub_8083230 -sub_8083230: @ 8083230 - push {r4-r6,lr} - sub sp, 0x8 - lsls r0, 16 - lsrs r0, 16 - bl sub_8083210 - adds r5, r0, 0 - ldr r0, =0x020322a4 - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0x4E - ldrh r0, [r1] - cmp r0, r5 - bcs _0808324E - strh r5, [r1] -_0808324E: - movs r6, 0 -_08083250: - mov r0, sp - adds r4, r0, r6 - adds r0, r5, 0 - movs r1, 0xA - bl __umodsi3 - strb r0, [r4] - adds r0, r5, 0 - movs r1, 0xA - bl __udivsi3 - adds r5, r0, 0 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x4 - bls _08083250 - ldr r2, =0x06006458 - mov r0, sp - ldr r3, =0x00008072 - adds r1, r3, 0 - ldrb r0, [r0, 0x4] - adds r0, r1, r0 - strh r0, [r2] - adds r2, 0x2 - mov r0, sp - ldrb r0, [r0, 0x3] - adds r0, r1 - strh r0, [r2] - adds r2, 0x2 - mov r0, sp - ldrb r0, [r0, 0x2] - adds r0, r1 - strh r0, [r2] - adds r2, 0x4 - mov r0, sp - ldrb r0, [r0, 0x1] - adds r0, r1 - strh r0, [r2] - adds r2, 0x2 - mov r0, sp - ldrb r0, [r0] - adds r1, r0 - strh r1, [r2] - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8083230 - - thumb_func_start sub_80832BC -sub_80832BC: @ 80832BC - push {r4-r6,lr} - adds r6, r0, 0 - lsls r4, r1, 16 - lsrs r5, r4, 16 - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _080832E0 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r1, r5, 0 - bl __umodsi3 - lsrs r1, r4, 17 - subs r0, r1 - strh r0, [r6] -_080832E0: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80832BC - - thumb_func_start sub_80832E8 -sub_80832E8: @ 80832E8 - push {lr} - adds r1, r0, 0 - ldrh r2, [r1] - movs r3, 0 - ldrsh r0, [r1, r3] - cmp r0, 0 - bge _080832FA - adds r0, r2, 0x1 - strh r0, [r1] -_080832FA: - ldrh r2, [r1] - movs r3, 0 - ldrsh r0, [r1, r3] - cmp r0, 0 - ble _08083308 - subs r0, r2, 0x1 - strh r0, [r1] -_08083308: - pop {r0} - bx r0 - thumb_func_end sub_80832E8 - - thumb_func_start sub_808330C -sub_808330C: @ 808330C - push {r4,lr} - ldr r4, =0x020322a4 - ldr r0, [r4] - movs r1, 0x8E - lsls r1, 1 - adds r0, r1 - bl sub_80832E8 - ldr r0, [r4] - movs r1, 0x8F - lsls r1, 1 - adds r0, r1 - bl sub_80832E8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808330C - - thumb_func_start sub_8083334 -sub_8083334: @ 8083334 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r1, 16 - lsrs r1, 16 - movs r5, 0x8 - cmp r1, 0x9 - bhi _08083344 - movs r5, 0x10 -_08083344: - ldrh r0, [r4] - movs r2, 0 - ldrsh r1, [r4, r2] - cmp r1, 0 - bne _08083362 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r1, r5, 0 - bl __modsi3 - lsrs r1, r5, 1 - subs r0, r1 - b _08083376 -_08083362: - cmp r1, 0 - bge _0808336A - adds r0, 0x1 - strh r0, [r4] -_0808336A: - ldrh r1, [r4] - movs r2, 0 - ldrsh r0, [r4, r2] - cmp r0, 0 - ble _08083378 - subs r0, r1, 0x1 -_08083376: - strh r0, [r4] -_08083378: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8083334 - - thumb_func_start sub_8083380 -sub_8083380: @ 8083380 - push {r4,r5,lr} - ldr r5, =0x020322a4 - ldr r2, [r5] - movs r4, 0x84 - lsls r4, 1 - adds r0, r2, r4 - ldr r1, [r0] - cmp r1, 0 - bne _080833A0 - movs r3, 0x8E - lsls r3, 1 - adds r0, r2, r3 - strh r1, [r0] - adds r3, 0x2 - adds r0, r2, r3 - strh r1, [r0] -_080833A0: - ldr r0, [r5] - adds r2, r0, r4 - ldr r1, [r2] - adds r1, 0x1 - str r1, [r2] - movs r2, 0x8E - lsls r2, 1 - adds r0, r2 - lsls r1, 16 - lsrs r1, 16 - bl sub_8083334 - ldr r1, [r5] - movs r3, 0x8F - lsls r3, 1 - adds r0, r1, r3 - adds r1, r4 - ldrh r1, [r1] - bl sub_8083334 - ldr r2, [r5] - adds r0, r2, r4 - ldr r0, [r0] - cmp r0, 0x14 - beq _080833DC - movs r0, 0 - b _080833F0 - .pool -_080833DC: - movs r1, 0x8E - lsls r1, 1 - adds r0, r2, r1 - movs r1, 0 - strh r1, [r0] - movs r3, 0x8F - lsls r3, 1 - adds r0, r2, r3 - strh r1, [r0] - movs r0, 0x1 -_080833F0: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8083380 - - thumb_func_start sub_80833F8 -sub_80833F8: @ 80833F8 - ldr r1, =0x020322a4 - ldr r2, [r1] - movs r3, 0x8E - lsls r3, 1 - adds r1, r2, r3 - ldrh r1, [r1] - negs r1, r1 - strh r1, [r0, 0x24] - adds r3, 0x2 - adds r1, r2, r3 - ldrh r1, [r1] - negs r1, r1 - strh r1, [r0, 0x26] - bx lr - .pool - thumb_func_end sub_80833F8 - - thumb_func_start UpdateBerryBlenderRecord -@ void UpdateBerryBlenderRecord() -UpdateBerryBlenderRecord: @ 8083418 - push {lr} - ldr r0, =0x03005d8c - ldr r2, [r0] - ldr r0, =0x020322a4 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x7C - ldrb r0, [r0] - subs r0, 0x2 - lsls r0, 1 - ldr r3, =0x000009bc - adds r2, r3 - adds r2, r0 - adds r1, 0x4E - ldrh r1, [r1] - ldrh r0, [r2] - cmp r0, r1 - bcs _0808343E - strh r1, [r2] -_0808343E: - pop {r0} - bx r0 - .pool - thumb_func_end UpdateBerryBlenderRecord - - thumb_func_start berry_blender_related -berry_blender_related: @ 8083450 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4C - ldr r1, =0x020322a4 - ldr r0, [r1] - ldrb r0, [r0] - adds r4, r1, 0 - cmp r0, 0x6 - bls _0808346A - b _08083898 -_0808346A: - lsls r0, 2 - ldr r1, =_0808347C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0808347C: - .4byte _08083498 - .4byte _080834AE - .4byte _080834C8 - .4byte _08083518 - .4byte _08083790 - .4byte _080837A8 - .4byte _0808386C -_08083498: - ldr r1, [r4] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r4] - movs r1, 0x84 - lsls r1, 1 - adds r0, r1 - movs r1, 0x11 - str r1, [r0] - b _08083898 -_080834AE: - ldr r1, [r4] - movs r3, 0x84 - lsls r3, 1 - adds r2, r1, r3 - ldr r0, [r2] - subs r0, 0xA - str r0, [r2] - cmp r0, 0 - blt _080834C2 - b _08083898 -_080834C2: - movs r0, 0 - str r0, [r2] - b _08083854 -_080834C8: - ldr r1, [r4] - movs r0, 0x84 - lsls r0, 1 - adds r1, r0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - cmp r0, 0x14 - bgt _080834DC - b _08083898 -_080834DC: - movs r6, 0 -_080834DE: - ldr r4, =0x020322a4 - ldr r0, [r4] - adds r0, 0x46 - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x2 - bls _080834DE - ldr r1, [r4] - movs r3, 0x84 - lsls r3, 1 - adds r2, r1, r3 - movs r0, 0 - str r0, [r2] - b _08083854 - .pool -_08083518: - ldr r4, =gUnknown_083398F5 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0xA8 - bl GetStringCenterAlignXOffset - lsls r2, r0, 24 - lsrs r2, 24 - movs r0, 0xFF - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - movs r0, 0x5 - adds r1, r4, 0 - movs r3, 0x1 - bl sub_80840D4 - ldr r1, =0x020322a4 - ldr r0, [r1] - adds r2, r0, 0 - adds r2, 0x7C - ldrb r0, [r2] - movs r3, 0x15 - mov r9, r3 - cmp r0, 0x4 - bne _08083550 - movs r0, 0x11 - mov r9, r0 -_08083550: - movs r6, 0 - mov r3, sp - adds r3, 0x10 - str r3, [sp, 0x48] - ldrb r2, [r2] - cmp r6, r2 - bcs _0808361A - adds r7, r1, 0 - movs r0, 0x3 - mov r10, r0 -_08083564: - ldr r0, [r7] - movs r2, 0x9E - lsls r2, 1 - adds r1, r0, r2 - adds r1, r6 - ldrb r5, [r1] - adds r0, 0x9F - adds r6, 0x1 - mov r8, r6 - mov r1, r8 - movs r2, 0 - movs r3, 0x1 - bl ConvertIntToDecimalString - ldr r0, [r7] - adds r0, 0x9F - ldr r1, =gUnknown_08339941 - bl AppendString - ldr r0, [r7] - adds r0, 0x9F - ldr r1, =gUnknown_085E8D5E - bl AppendString - ldr r0, [r7] - adds r0, 0x9F - lsls r4, r5, 3 - subs r4, r5 - lsls r4, 2 - ldr r3, =0x020229f0 - adds r1, r4, r3 - bl AppendString - ldr r1, [r7] - adds r1, 0x9F - mov r0, r9 - lsls r6, r0, 24 - lsrs r6, 24 - movs r2, 0xFF - str r2, [sp] - mov r3, r10 - str r3, [sp, 0x4] - movs r0, 0x5 - movs r2, 0x8 - adds r3, r6, 0 - bl sub_80840D4 - ldr r1, [r7] - adds r0, r1, 0 - adds r0, 0x9F - lsls r5, 4 - adds r5, r1 - movs r1, 0xAD - lsls r1, 1 - adds r5, r1 - adds r1, r5, 0 - bl CopyString - ldr r0, [r7] - adds r0, 0x9F - ldr r2, =0x020229e8 - adds r4, r2 - ldrb r1, [r4, 0x1A] - bl StopMusicWhileStringIsPrinted - ldr r0, [r7] - adds r0, 0x9F - ldr r1, =gUnknown_08339914 - bl AppendString - ldr r1, [r7] - adds r1, 0x9F - movs r3, 0xFF - str r3, [sp] - mov r0, r10 - str r0, [sp, 0x4] - movs r0, 0x5 - movs r2, 0x54 - adds r3, r6, 0 - bl sub_80840D4 - movs r1, 0x10 - add r9, r1 - mov r2, r8 - lsls r2, 16 - lsrs r6, r2, 16 - ldr r0, [r7] - adds r0, 0x7C - ldrb r0, [r0] - cmp r6, r0 - bcc _08083564 -_0808361A: - ldr r1, =gUnknown_0833992E - movs r3, 0xFF - mov r10, r3 - str r3, [sp] - movs r0, 0x3 - mov r9, r0 - str r0, [sp, 0x4] - movs r0, 0x5 - movs r2, 0 - movs r3, 0x51 - bl sub_80840D4 - ldr r6, =0x020322a4 - ldr r0, [r6] - adds r4, r0, 0 - adds r4, 0x9F - adds r0, 0x4E - ldrh r0, [r0] - movs r1, 0x64 - bl __udivsi3 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r0, [r6] - adds r0, 0x9F - ldr r1, =gUnknown_08339941 - bl AppendString - ldr r0, [r6] - adds r0, 0x4E - ldrh r0, [r0] - movs r1, 0x64 - bl __umodsi3 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0x48] - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r0, [r6] - adds r0, 0x9F - ldr r1, [sp, 0x48] - bl AppendString - ldr r0, [r6] - adds r0, 0x9F - ldr r1, =gUnknown_0833993C - bl AppendString - ldr r1, [r6] - adds r1, 0x9F - movs r0, 0x1 - movs r2, 0xA8 - bl GetStringRightAlignXOffset - ldr r1, [r6] - adds r1, 0x9F - lsls r2, r0, 24 - lsrs r2, 24 - mov r3, r10 - str r3, [sp] - mov r0, r9 - str r0, [sp, 0x4] - movs r0, 0x5 - movs r3, 0x51 - bl sub_80840D4 - ldr r1, =gUnknown_0833991B - mov r2, r10 - str r2, [sp] - mov r3, r9 - str r3, [sp, 0x4] - movs r0, 0x5 - movs r2, 0 - movs r3, 0x61 - bl sub_80840D4 - ldr r5, [r6] - movs r1, 0x82 - lsls r1, 1 - adds r0, r5, r1 - ldr r0, [r0] - mov r8, r0 - movs r1, 0x3C - bl __udivsi3 - movs r1, 0x3C - bl __umodsi3 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - movs r1, 0xE1 - lsls r1, 4 - mov r0, r8 - bl __udivsi3 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r5, 0x9F - adds r0, r5, 0 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r0, [r6] - adds r0, 0x9F - ldr r1, =gUnknown_08339921 - bl AppendString - adds r1, r4, 0 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r0, [r6] - adds r0, 0x9F - ldr r1, =gUnknown_08339928 - bl AppendString - ldr r1, [r6] - adds r1, 0x9F - movs r0, 0x1 - movs r2, 0xA8 - bl GetStringRightAlignXOffset - ldr r1, [r6] - adds r1, 0x9F - lsls r2, r0, 24 - lsrs r2, 24 - mov r3, r10 - str r3, [sp] - mov r0, r9 - str r0, [sp, 0x4] - movs r0, 0x5 - movs r3, 0x61 - bl sub_80840D4 - ldr r1, [r6] - movs r3, 0x84 - lsls r3, 1 - adds r2, r1, r3 - movs r0, 0 - str r0, [r2] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r0, 0x5 - movs r1, 0x2 - bl CopyWindowToVram - b _08083898 - .pool -_08083790: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0808379E - b _08083898 -_0808379E: - ldr r1, [r4] - b _08083854 - .pool -_080837A8: - movs r0, 0x5 - movs r1, 0x1 - bl sub_8198070 - movs r6, 0 - add r7, sp, 0x40 - ldr r5, =0x020322a4 -_080837B6: - ldr r0, [r5] - lsls r2, r6, 1 - adds r0, 0x74 - adds r0, r2 - ldrh r1, [r0] - cmp r1, 0 - beq _080837CC - add r0, sp, 0x38 - adds r0, r2 - subs r1, 0x85 - strh r1, [r0] -_080837CC: - ldr r0, [r5] - adds r0, 0x8E - adds r0, r2 - ldrh r0, [r0] - cmp r0, 0xFF - beq _080837EA - lsls r4, r6, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram -_080837EA: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x3 - bls _080837B6 - bl sub_8081E20 - ldr r4, =0x020322a4 - ldr r3, [r4] - movs r1, 0xAC - lsls r1, 1 - adds r0, r3, r1 - adds r1, r3, 0 - adds r1, 0x7C - ldrb r2, [r1] - subs r1, 0x2E - ldrh r1, [r1] - str r1, [sp] - adds r1, r7, 0 - add r3, sp, 0x8 - bl sub_8081BE0 - ldr r1, [r4] - adds r1, 0x9F - adds r0, r7, 0 - bl sub_80838AC - ldr r1, [r4] - movs r2, 0xD4 - lsls r2, 1 - adds r1, r2 - adds r0, r7, 0 - bl sub_8083F94 - ldr r0, =sub_8083F3C - movs r1, 0x6 - bl AddTask - bl sub_80EECEC - ldr r0, =0x0203ce7c - ldrh r0, [r0] - movs r1, 0x1 - bl remove_item - adds r0, r7, 0 - bl sub_8136F2C - ldr r1, [r4] - ldr r3, =0x000011b8 - adds r2, r1, r3 - movs r0, 0 - strh r0, [r2] -_08083854: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08083898 - .pool -_0808386C: - ldr r4, [r4] - ldr r0, =0x000011b8 - adds r5, r4, r0 - adds r4, 0x9F - bl sav2_get_text_speed - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_808417C - cmp r0, 0 - beq _08083898 - bl UpdateBerryBlenderRecord - movs r0, 0x1 - b _0808389A - .pool -_08083898: - movs r0, 0 -_0808389A: - add sp, 0x4C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end berry_blender_related - - thumb_func_start sub_80838AC -sub_80838AC: @ 80838AC - push {r4-r6,lr} - sub sp, 0xC - adds r5, r0, 0 - adds r6, r1, 0 - movs r0, 0xFF - strb r0, [r6] - ldr r1, =gUnknown_085B262C - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r6, 0 - bl CopyString - ldr r1, =gUnknown_0833979D - adds r0, r6, 0 - bl AppendString - ldr r1, =gUnknown_08339943 - adds r0, r6, 0 - bl AppendString - adds r0, r5, 0 - bl sub_8136EA4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - bl sub_8136EDC - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r1, =gUnknown_0833994F - adds r0, r6, 0 - bl AppendString - mov r0, sp - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - adds r0, r6, 0 - mov r1, sp - bl AppendString - ldr r1, =gUnknown_0833995D - adds r0, r6, 0 - bl AppendString - mov r0, sp - adds r1, r5, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - adds r0, r6, 0 - mov r1, sp - bl AppendString - ldr r1, =gUnknown_08339970 - adds r0, r6, 0 - bl AppendString - ldr r1, =gUnknown_0833979B - adds r0, r6, 0 - bl AppendString - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80838AC - - thumb_func_start sub_808395C -sub_808395C: @ 808395C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - mov r9, r0 - mov r12, r2 - lsls r1, 24 - lsrs r7, r1, 24 - movs r0, 0 - cmp r0, r7 - bge _080839A8 -_08083972: - movs r5, 0 - adds r1, r0, 0x1 - mov r8, r1 - cmp r5, r7 - bge _080839A2 - mov r1, r9 - adds r6, r1, r0 -_08083980: - ldrb r4, [r6] - lsls r1, r4, 2 - add r1, r12 - mov r0, r9 - adds r2, r0, r5 - ldrb r3, [r2] - lsls r0, r3, 2 - add r0, r12 - ldr r1, [r1] - ldr r0, [r0] - cmp r1, r0 - bls _0808399C - strb r3, [r6] - strb r4, [r2] -_0808399C: - adds r5, 0x1 - cmp r5, r7 - blt _08083980 -_080839A2: - mov r0, r8 - cmp r0, r7 - blt _08083972 -_080839A8: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_808395C - - thumb_func_start sub_80839B4 -sub_80839B4: @ 80839B4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - movs r5, 0 - ldr r2, =0x020322a4 - ldr r0, [r2] - adds r0, 0x7C - adds r1, r2, 0 - add r3, sp, 0x4 - mov r10, r3 - b _080839E4 - .pool -_080839D4: - mov r4, sp - adds r0, r4, r5 - strb r5, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, [r2] - adds r0, 0x7C -_080839E4: - ldrb r0, [r0] - cmp r5, r0 - bcc _080839D4 - movs r5, 0 - ldr r0, [r1] - adds r1, r0, 0 - adds r1, 0x7C - ldrb r2, [r1] - cmp r5, r2 - bcs _08083A5E - mov r9, r10 - movs r3, 0x92 - lsls r3, 1 - adds r3, r0 - mov r8, r3 - mov r12, r1 - movs r4, 0x93 - lsls r4, 1 - adds r7, r0, r4 - movs r1, 0x94 - lsls r1, 1 - adds r6, r0, r1 -_08083A10: - lsls r4, r5, 2 - add r4, r9 - lsls r3, r5, 1 - adds r3, r5 - lsls r3, 1 - mov r2, r8 - adds r0, r2, r3 - ldrh r2, [r0] - lsls r0, r2, 5 - subs r0, r2 - lsls r1, r0, 6 - subs r1, r0 - lsls r1, 3 - adds r1, r2 - lsls r1, 6 - str r1, [r4] - adds r0, r7, r3 - ldrh r2, [r0] - lsls r0, r2, 5 - subs r0, r2 - lsls r0, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - str r1, [r4] - movs r0, 0xFA - lsls r0, 2 - adds r1, r0 - adds r3, r6, r3 - ldrh r0, [r3] - subs r1, r0 - str r1, [r4] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - mov r1, r12 - ldrb r1, [r1] - cmp r5, r1 - bcc _08083A10 -_08083A5E: - ldr r4, =0x020322a4 - ldr r0, [r4] - adds r0, 0x7C - ldrb r1, [r0] - mov r0, sp - mov r2, r10 - bl sub_808395C - movs r5, 0 - ldr r0, [r4] - adds r0, 0x7C - ldrb r0, [r0] - cmp r5, r0 - bcs _08083A9E - adds r2, r4, 0 - movs r3, 0x9E - lsls r3, 1 -_08083A80: - ldr r1, [r2] - adds r1, r3 - adds r1, r5 - mov r4, sp - adds r0, r4, r5 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, [r2] - adds r0, 0x7C - ldrb r0, [r0] - cmp r5, r0 - bcc _08083A80 -_08083A9E: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _08083AB4 - movs r3, 0 - b _08083ABC - .pool -_08083AB4: - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r3, r0, 24 -_08083ABC: - movs r5, 0 - ldr r1, =0x020322a4 - ldr r0, [r1] - adds r0, 0x7C - ldrb r0, [r0] - cmp r5, r0 - bcs _08083AF2 - movs r6, 0x9E - lsls r6, 1 - movs r4, 0xD2 - lsls r4, 1 -_08083AD2: - ldr r2, [r1] - adds r0, r2, r6 - adds r0, r5 - ldrb r0, [r0] - cmp r0, r3 - bne _08083AE2 - adds r0, r2, r4 - strb r5, [r0] -_08083AE2: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, [r1] - adds r0, 0x7C - ldrb r0, [r0] - cmp r5, r0 - bcc _08083AD2 -_08083AF2: - add sp, 0x14 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80839B4 - - thumb_func_start sub_8083B08 -sub_8083B08: @ 8083B08 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - ldr r1, =0x020322a4 - ldr r0, [r1] - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0x6 - bls _08083B22 - b _08083E12 -_08083B22: - lsls r0, 2 - ldr r1, =_08083B34 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08083B34: - .4byte _08083B50 - .4byte _08083B66 - .4byte _08083B80 - .4byte _08083B9A - .4byte _08083DC8 - .4byte _08083DE2 - .4byte _08083E08 -_08083B50: - ldr r1, [r2] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r2] - movs r1, 0x84 - lsls r1, 1 - adds r0, r1 - movs r1, 0xFF - str r1, [r0] - b _08083E12 -_08083B66: - ldr r1, [r2] - movs r3, 0x84 - lsls r3, 1 - adds r2, r1, r3 - ldr r0, [r2] - subs r0, 0xA - str r0, [r2] - cmp r0, 0 - blt _08083B7A - b _08083E12 -_08083B7A: - movs r0, 0 - str r0, [r2] - b _08083DF8 -_08083B80: - ldr r1, [r2] - movs r0, 0x84 - lsls r0, 1 - adds r2, r1, r0 - ldr r0, [r2] - adds r0, 0x1 - str r0, [r2] - cmp r0, 0x14 - bgt _08083B94 - b _08083E12 -_08083B94: - movs r0, 0 - str r0, [r2] - b _08083DF8 -_08083B9A: - movs r0, 0x5 - movs r1, 0 - movs r2, 0x1 - movs r3, 0xD - bl SetWindowBorderStyle - ldr r4, =gUnknown_08339947 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0xA8 - bl GetStringCenterAlignXOffset - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0xFF - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - movs r0, 0x5 - adds r1, r4, 0 - movs r3, 0x1 - bl sub_80840D4 - ldr r1, =gUnknown_08339B40 - mov r8, r1 - mov r0, r8 - movs r1, 0x80 - movs r2, 0x34 - movs r3, 0 - bl AddObjectToFront - ldr r7, =0x020322a4 - ldr r1, [r7] - adds r1, 0x46 - strb r0, [r1] - ldr r0, [r7] - adds r0, 0x46 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r6, =0x02020630 - adds r0, r6 - movs r1, 0x3 - bl StartObjectImageAnim - ldr r0, [r7] - adds r0, 0x46 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r5, r6, 0 - adds r5, 0x1C - adds r0, r5 - ldr r4, =DummyObjectCallback - str r4, [r0] - mov r0, r8 - movs r1, 0xA0 - movs r2, 0x34 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r7] - adds r1, 0x47 - strb r0, [r1] - ldr r0, [r7] - adds r0, 0x47 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - str r4, [r0] - mov r0, r8 - movs r1, 0xC0 - movs r2, 0x34 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r7] - adds r1, 0x48 - strb r0, [r1] - ldr r0, [r7] - adds r0, 0x48 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x1 - bl StartObjectImageAnim - ldr r0, [r7] - adds r0, 0x48 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - str r4, [r0] - bl sub_80839B4 - movs r2, 0x29 - str r2, [sp, 0x8] - movs r2, 0 - ldr r0, [r7] - adds r0, 0x7C - ldrb r0, [r0] - cmp r2, r0 - bcc _08083C7C - b _08083D8A -_08083C7C: - movs r3, 0xFF - mov r10, r3 - movs r0, 0x3 - mov r9, r0 -_08083C84: - ldr r0, [r7] - movs r3, 0x9E - lsls r3, 1 - adds r1, r0, r3 - adds r1, r2 - ldrb r5, [r1] - adds r0, 0x9F - adds r2, 0x1 - mov r8, r2 - mov r1, r8 - movs r2, 0 - movs r3, 0x1 - bl ConvertIntToDecimalString - ldr r0, [r7] - adds r0, 0x9F - ldr r1, =gUnknown_08339941 - bl AppendString - ldr r0, [r7] - adds r0, 0x9F - ldr r1, =gUnknown_085E8D5E - bl AppendString - ldr r0, [r7] - adds r0, 0x9F - lsls r1, r5, 3 - subs r1, r5 - lsls r1, 2 - ldr r2, =0x020229f0 - adds r1, r2 - bl AppendString - ldr r1, [r7] - adds r1, 0x9F - ldr r0, [sp, 0x8] - lsls r6, r0, 24 - lsrs r6, 24 - mov r2, r10 - str r2, [sp] - mov r3, r9 - str r3, [sp, 0x4] - movs r0, 0x5 - movs r2, 0 - adds r3, r6, 0 - bl sub_80840D4 - ldr r1, [r7] - adds r0, r1, 0 - adds r0, 0x9F - lsls r4, r5, 1 - adds r4, r5 - lsls r4, 1 - movs r2, 0x92 - lsls r2, 1 - adds r1, r2 - adds r1, r4 - ldrh r1, [r1] - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r1, [r7] - adds r1, 0x9F - mov r3, r10 - str r3, [sp] - mov r0, r9 - str r0, [sp, 0x4] - movs r0, 0x5 - movs r2, 0x4E - adds r3, r6, 0 - bl sub_80840D4 - ldr r1, [r7] - adds r0, r1, 0 - adds r0, 0x9F - movs r2, 0x93 - lsls r2, 1 - adds r1, r2 - adds r1, r4 - ldrh r1, [r1] - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r1, [r7] - adds r1, 0x9F - mov r3, r10 - str r3, [sp] - mov r0, r9 - str r0, [sp, 0x4] - movs r0, 0x5 - movs r2, 0x6E - adds r3, r6, 0 - bl sub_80840D4 - ldr r1, [r7] - adds r0, r1, 0 - adds r0, 0x9F - movs r2, 0x94 - lsls r2, 1 - adds r1, r2 - adds r1, r4 - ldrh r1, [r1] - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r1, [r7] - adds r1, 0x9F - mov r3, r10 - str r3, [sp] - mov r0, r9 - str r0, [sp, 0x4] - movs r0, 0x5 - movs r2, 0x8E - adds r3, r6, 0 - bl sub_80840D4 - ldr r1, [sp, 0x8] - adds r1, 0x10 - str r1, [sp, 0x8] - mov r2, r8 - lsls r2, 16 - lsrs r2, 16 - ldr r0, [r7] - adds r0, 0x7C - ldrb r0, [r0] - cmp r2, r0 - bcs _08083D8A - b _08083C84 -_08083D8A: - movs r0, 0x5 - bl PutWindowTilemap - movs r0, 0x5 - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =0x020322a4 - ldr r1, [r0] - movs r3, 0x84 - lsls r3, 1 - adds r2, r1, r3 - movs r0, 0 - str r0, [r2] - b _08083DF8 - .pool -_08083DC8: - ldr r2, [r2] - movs r0, 0x84 - lsls r0, 1 - adds r1, r2, r0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - cmp r0, 0x14 - ble _08083E12 - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - b _08083E12 -_08083DE2: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08083E12 - movs r0, 0x5 - bl audio_play - ldr r0, =0x020322a4 - ldr r1, [r0] -_08083DF8: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08083E12 - .pool -_08083E08: - ldr r1, [r2] - movs r0, 0 - strb r0, [r1] - movs r0, 0x1 - b _08083E14 -_08083E12: - movs r0, 0 -_08083E14: - 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_8083B08 - - thumb_func_start ShowBerryBlenderRecordWindow -ShowBerryBlenderRecordWindow: @ 8083E24 - push {r4-r7,lr} - sub sp, 0x34 - ldr r0, =gUnknown_08339D14 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp, 0x2C] - str r1, [sp, 0x30] - ldr r5, =0x0203ab74 - add r0, sp, 0x2C - bl AddWindow - strb r0, [r5] - ldrb r0, [r5] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r5] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r6, =gUnknown_085EE44F - movs r0, 0x1 - adds r1, r6, 0 - movs r2, 0x90 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - ldrb r0, [r5] - lsls r3, 24 - lsrs r3, 24 - movs r1, 0x1 - str r1, [sp] - movs r4, 0 - str r4, [sp, 0x4] - str r4, [sp, 0x8] - adds r2, r6, 0 - bl Print - ldrb r0, [r5] - ldr r2, =gUnknown_085EE473 - movs r1, 0x29 - str r1, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x4 - bl Print - movs r6, 0 - movs r7, 0xA4 - lsls r7, 22 -_08083E8A: - ldr r0, =0x03005d8c - ldr r0, [r0] - lsls r1, r6, 1 - ldr r2, =0x000009bc - adds r0, r2 - adds r0, r1 - ldrh r4, [r0] - adds r0, r4, 0 - movs r1, 0x64 - bl __udivsi3 - adds r1, r0, 0 - add r0, sp, 0xC - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - adds r5, r0, 0 - ldr r1, =gUnknown_08339941 - bl AppendString - adds r5, r0, 0 - adds r0, r4, 0 - movs r1, 0x64 - bl __umodsi3 - adds r1, r0, 0 - adds r0, r5, 0 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalString - adds r5, r0, 0 - ldr r1, =gUnknown_0833993C - bl AppendString - movs r0, 0x1 - add r1, sp, 0xC - movs r2, 0x8C - bl GetStringRightAlignXOffset - adds r3, r0, 0 - ldr r4, =0x0203ab74 - ldrb r0, [r4] - lsls r3, 24 - lsrs r3, 24 - lsrs r1, r7, 24 - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0x1 - add r2, sp, 0xC - bl Print - movs r0, 0x80 - lsls r0, 21 - adds r7, r0 - adds r6, 0x1 - cmp r6, 0x2 - ble _08083E8A - ldrb r0, [r4] - bl PutWindowTilemap - ldrb r0, [r4] - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0x34 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end ShowBerryBlenderRecordWindow - - thumb_func_start sub_8083F3C -sub_8083F3C: @ 8083F3C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08083F62 - ldr r0, =0x0000016f - bl fanfare_play - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_08083F62: - bl task_is_not_running_overworld_fanfare - lsls r0, 24 - cmp r0, 0 - beq _08083F82 - ldr r0, =0x020322a4 - ldr r0, [r0] - movs r1, 0xAA - lsls r1, 1 - adds r0, r1 - ldrh r0, [r0] - bl song_play_for_text - adds r0, r5, 0 - bl remove_task -_08083F82: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8083F3C - - thumb_func_start sub_8083F94 -sub_8083F94: @ 8083F94 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - adds r6, r0, 0 - adds r7, r1, 0 - bl sub_8136EA4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r6, 0 - bl sub_8136EDC - adds r1, r0, 0 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 1 - lsls r1, 24 - lsrs r1, 24 - bl __divsi3 - lsls r0, 16 - lsrs r3, r0, 16 - strb r3, [r7, 0xD] - ldrb r0, [r6] - strb r0, [r7, 0xC] - movs r0, 0xFF - strb r0, [r7] - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _080840C4 - ldr r0, =0x020322a4 - ldr r2, [r0] - movs r4, 0xD2 - lsls r4, 1 - adds r1, r2, r4 - ldrb r1, [r1] - mov r8, r0 - cmp r1, 0 - bne _08084058 - cmp r3, 0x14 - bls _08084058 - adds r0, r2, 0 - adds r0, 0x7C - ldrb r1, [r0] - subs r1, 0x1 - movs r0, 0x9E - lsls r0, 1 - mov r9, r0 - adds r0, r2, r0 - adds r0, r1 - ldrb r0, [r0] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r5, =0x020229f0 - adds r1, r5 - adds r0, r7, 0 - bl CopyString - adds r0, r6, 0 - bl sub_81370B4 - strb r0, [r7, 0xB] - ldrb r1, [r7, 0xB] - ldrb r2, [r7, 0xC] - ldrb r3, [r7, 0xD] - mov r6, r8 - ldr r4, [r6] - adds r0, r4, 0 - adds r0, 0x7C - ldrb r0, [r0] - subs r0, 0x1 - add r4, r9 - adds r4, r0 - ldrb r4, [r4] - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - adds r5, r0 - ldrb r0, [r5, 0x12] - str r0, [sp] - adds r0, r7, 0 - bl sub_80ECC04 - lsls r0, 24 - cmp r0, 0 - bne _080840BA - b _080840C4 - .pool -_08084058: - mov r0, r8 - ldr r2, [r0] - movs r1, 0xD2 - lsls r1, 1 - adds r0, r2, r1 - ldrb r1, [r0] - adds r0, r2, 0 - adds r0, 0x7C - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - bne _080840C4 - cmp r3, 0x14 - bhi _080840C4 - movs r4, 0x9E - lsls r4, 1 - adds r0, r2, r4 - ldrb r0, [r0] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r5, =0x020229f0 - adds r1, r5 - adds r0, r7, 0 - bl CopyString - adds r0, r6, 0 - bl sub_81370B4 - strb r0, [r7, 0xB] - ldrb r1, [r7, 0xB] - ldrb r2, [r7, 0xC] - ldrb r3, [r7, 0xD] - mov r6, r8 - ldr r0, [r6] - adds r0, r4 - ldrb r4, [r0] - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - adds r5, r0 - ldrb r0, [r5, 0x12] - str r0, [sp] - adds r0, r7, 0 - bl sub_80ECC04 - lsls r0, 24 - cmp r0, 0 - beq _080840C4 -_080840BA: - movs r0, 0x1 - b _080840C6 - .pool -_080840C4: - movs r0, 0 -_080840C6: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8083F94 - - thumb_func_start sub_80840D4 -sub_80840D4: @ 80840D4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x18 - mov r9, r1 - ldr r4, [sp, 0x38] - lsls r0, 24 - lsrs r6, r0, 24 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r3, 24 - lsrs r7, r3, 24 - movs r5, 0 - cmp r4, 0x1 - beq _08084116 - cmp r4, 0x1 - bgt _08084100 - cmp r4, 0 - beq _08084108 - b _08084132 -_08084100: - cmp r4, 0x2 - beq _08084124 - cmp r4, 0x3 - bne _08084136 -_08084108: - add r1, sp, 0x14 - movs r0, 0x1 - strb r0, [r1] - movs r0, 0x2 - strb r0, [r1, 0x1] - movs r0, 0x3 - b _08084130 -_08084116: - add r0, sp, 0x14 - strb r5, [r0] - adds r1, r0, 0 - movs r0, 0x2 - strb r0, [r1, 0x1] - movs r0, 0x3 - b _08084130 -_08084124: - add r0, sp, 0x14 - strb r5, [r0] - adds r1, r0, 0 - movs r0, 0x4 - strb r0, [r1, 0x1] - movs r0, 0x5 -_08084130: - strb r0, [r1, 0x2] -_08084132: - cmp r4, 0x3 - beq _08084148 -_08084136: - add r0, sp, 0x14 - ldrb r0, [r0] - lsls r1, r0, 4 - orrs r1, r0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r6, 0 - bl FillWindowPixelBuffer -_08084148: - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - add r0, sp, 0x14 - str r0, [sp, 0x8] - ldr r0, [sp, 0x34] - lsls r0, 24 - asrs r0, 24 - str r0, [sp, 0xC] - mov r0, r9 - str r0, [sp, 0x10] - adds r0, r6, 0 - movs r1, 0x1 - mov r2, r8 - adds r3, r7, 0 - bl AddTextPrinterParametrized2 - add sp, 0x18 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80840D4 - - thumb_func_start sub_808417C -sub_808417C: @ 808417C - push {r4-r7,lr} - sub sp, 0x8 - adds r5, r0, 0 - adds r7, r1, 0 - adds r6, r2, 0 - movs r0, 0 - ldrsh r4, [r5, r0] - cmp r4, 0 - beq _08084194 - cmp r4, 0x1 - beq _080841C6 - b _080841DA -_08084194: - movs r0, 0x4 - movs r1, 0 - movs r2, 0x14 - movs r3, 0xF - bl sub_8197B1C - str r6, [sp] - str r4, [sp, 0x4] - movs r0, 0x4 - adds r1, r7, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_80840D4 - movs r0, 0x4 - bl PutWindowTilemap - movs r0, 0x4 - movs r1, 0x3 - bl CopyWindowToVram - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - b _080841DA -_080841C6: - movs r0, 0x4 - bl IsTextPrinterActive - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _080841DA - strh r0, [r5] - movs r0, 0x1 - b _080841DC -_080841DA: - movs r0, 0 -_080841DC: - add sp, 0x8 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_808417C - - thumb_func_start reset_playtime -reset_playtime: @ 80841E4 - ldr r1, =0x03000e08 - movs r0, 0 - strb r0, [r1] - ldr r2, =0x03005d90 - ldr r3, [r2] - movs r1, 0 - movs r0, 0 - strh r0, [r3, 0xE] - strb r1, [r3, 0x10] - ldr r0, [r2] - strb r1, [r0, 0x11] - ldr r0, [r2] - strb r1, [r0, 0x12] - bx lr - .pool - thumb_func_end reset_playtime - - thumb_func_start set_max_playtime_if_appropriate -set_max_playtime_if_appropriate: @ 8084208 - push {lr} - ldr r1, =0x03000e08 - movs r0, 0x1 - strb r0, [r1] - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrh r1, [r0, 0xE] - ldr r0, =0x000003e7 - cmp r1, r0 - bls _08084220 - bl set_max_playtime -_08084220: - pop {r0} - bx r0 - .pool - thumb_func_end set_max_playtime_if_appropriate - - thumb_func_start sub_8084230 -sub_8084230: @ 8084230 - ldr r1, =0x03000e08 - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_8084230 - - thumb_func_start gametime_increment -gametime_increment: @ 808423C - push {lr} - ldr r0, =0x03000e08 - ldrb r0, [r0] - cmp r0, 0x1 - bne _08084294 - ldr r2, =0x03005d90 - ldr r0, [r2] - ldrb r1, [r0, 0x12] - adds r1, 0x1 - movs r3, 0 - strb r1, [r0, 0x12] - ldr r1, [r2] - ldrb r0, [r1, 0x12] - cmp r0, 0x3B - bls _08084294 - strb r3, [r1, 0x12] - ldr r0, [r2] - ldrb r1, [r0, 0x11] - adds r1, 0x1 - strb r1, [r0, 0x11] - ldr r1, [r2] - ldrb r0, [r1, 0x11] - cmp r0, 0x3B - bls _08084294 - strb r3, [r1, 0x11] - ldr r0, [r2] - ldrb r1, [r0, 0x10] - adds r1, 0x1 - strb r1, [r0, 0x10] - ldr r1, [r2] - ldrb r0, [r1, 0x10] - cmp r0, 0x3B - bls _08084294 - strb r3, [r1, 0x10] - ldr r0, [r2] - ldrh r1, [r0, 0xE] - adds r1, 0x1 - strh r1, [r0, 0xE] - lsls r1, 16 - ldr r0, =0x03e70000 - cmp r1, r0 - bls _08084294 - bl set_max_playtime -_08084294: - pop {r0} - bx r0 - .pool - thumb_func_end gametime_increment - - thumb_func_start set_max_playtime -set_max_playtime: @ 80842A4 - ldr r1, =0x03000e08 - movs r0, 0x2 - strb r0, [r1] - ldr r2, =0x03005d90 - ldr r3, [r2] - ldr r0, =0x000003e7 - strh r0, [r3, 0xE] - movs r1, 0x3B - strb r1, [r3, 0x10] - ldr r0, [r2] - strb r1, [r0, 0x11] - ldr r0, [r2] - strb r1, [r0, 0x12] - bx lr - .pool - thumb_func_end set_max_playtime - - thumb_func_start write_word_to_mem -@ void write_word_to_mem(int value, int *mem) -write_word_to_mem: @ 80842CC - strb r0, [r1] - lsrs r2, r0, 8 - strb r2, [r1, 0x1] - lsrs r2, r0, 16 - strb r2, [r1, 0x2] - lsrs r0, 24 - strb r0, [r1, 0x3] - bx lr - thumb_func_end write_word_to_mem - - thumb_func_start sub_80842DC -sub_80842DC: @ 80842DC - adds r2, r0, 0 - ldrb r0, [r2, 0x3] - lsls r0, 24 - ldrb r1, [r2, 0x2] - lsls r1, 16 - orrs r0, r1 - ldrb r1, [r2, 0x1] - lsls r1, 8 - orrs r0, r1 - ldrb r1, [r2] - orrs r0, r1 - bx lr - thumb_func_end sub_80842DC - - thumb_func_start sub_80842F4 -sub_80842F4: @ 80842F4 - push {r4,lr} - adds r4, r0, 0 - adds r3, r1, 0 - movs r2, 0 -_080842FC: - adds r0, r4, r2 - adds r1, r3, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x3 - ble _080842FC - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80842F4 - - thumb_func_start set_player_trainer_id -set_player_trainer_id: @ 8084310 - push {r4,lr} - bl GenerateRandomNumber - adds r4, r0, 0 - bl GetTrainerId - lsls r4, 16 - lsls r0, 16 - lsrs r0, 16 - orrs r4, r0 - ldr r0, =0x03005d90 - ldr r1, [r0] - adds r1, 0xA - adds r0, r4, 0 - bl write_word_to_mem - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end set_player_trainer_id - - thumb_func_start init_options -init_options: @ 808433C - ldr r3, =0x03005d90 - ldr r2, [r3] - ldrb r1, [r2, 0x14] - movs r0, 0x8 - negs r0, r0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x14] - ldr r2, [r3] - ldrb r1, [r2, 0x14] - movs r0, 0x7 - ands r0, r1 - strb r0, [r2, 0x14] - ldr r2, [r3] - ldrb r1, [r2, 0x15] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x15] - ldr r2, [r3] - ldrb r1, [r2, 0x15] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x15] - ldr r2, [r3] - ldrb r1, [r2, 0x15] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x15] - ldr r2, [r3] - ldrb r1, [r2, 0x15] - movs r0, 0x9 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x15] - bx lr - .pool - thumb_func_end init_options - - thumb_func_start sub_8084390 -sub_8084390: @ 8084390 - push {r4,lr} - ldr r1, =0x030060b0 - movs r0, 0 - strb r0, [r1] - ldr r4, =0x03005d90 - ldr r0, [r4] - adds r0, 0x28 - movs r1, 0 - movs r2, 0x34 - bl memset - ldr r0, [r4] - adds r0, 0x5C - movs r1, 0 - movs r2, 0x34 - bl memset - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8084390 - - thumb_func_start sub_80843C0 -sub_80843C0: @ 80843C0 - push {r4-r7,lr} - bl sub_80DF040 - movs r2, 0x8 - ldr r0, =0x03005d8c - mov r12, r0 - ldr r4, =0x00002e90 - ldr r3, =gUnknown_08339D1C -_080843D0: - mov r1, r12 - ldr r0, [r1] - lsls r1, r2, 5 - adds r0, r1 - adds r0, r4 - adds r1, r3, 0 - ldm r1!, {r5-r7} - stm r0!, {r5-r7} - ldm r1!, {r5-r7} - stm r0!, {r5-r7} - ldm r1!, {r5,r6} - stm r0!, {r5,r6} - adds r2, 0x1 - cmp r2, 0xC - ble _080843D0 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80843C0 - - thumb_func_start sub_8084400 -sub_8084400: @ 8084400 - push {r4,lr} - sub sp, 0x4 - movs r0, 0 - str r0, [sp] - ldr r4, =0x03005d90 - ldr r1, [r4] - ldr r0, =0x0000064c - adds r1, r0 - ldr r2, =0x05000238 - mov r0, sp - bl CpuSet - ldr r0, [r4] - ldr r1, =0x00000ee1 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldr r0, [r4] - ldr r1, =0x00000ee9 - adds r0, r1 - movs r1, 0x1 - negs r1, r1 - strb r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8084400 - - thumb_func_start sub_808444C -sub_808444C: @ 808444C - push {lr} - sub sp, 0x4 - movs r3, 0x1 - negs r3, r3 - str r3, [sp] - movs r0, 0x19 - movs r1, 0x28 - adds r2, r3, 0 - bl warp1_set - bl warp_in - add sp, 0x4 - pop {r0} - bx r0 - thumb_func_end sub_808444C - - thumb_func_start init_sav2 -init_sav2: @ 808446C - push {lr} - bl memclr_stdsav2 - bl init_options - pop {r0} - bx r0 - thumb_func_end init_sav2 - - thumb_func_start sub_808447C -sub_808447C: @ 808447C - push {lr} - ldr r1, =0x020322d4 - movs r0, 0 - strb r0, [r1] - bl sub_80BB358 - bl zero_player_party_data - bl zero_enemy_party_data - bl sub_81AAB70 - bl sub_813624C - pop {r0} - bx r0 - .pool - thumb_func_end sub_808447C - - thumb_func_start NewGameInitData -@ void NewGameInitData() -NewGameInitData: @ 80844A0 - push {r4,r5,lr} - ldr r0, =0x03006210 - ldrh r0, [r0] - cmp r0, 0 - beq _080844AE - cmp r0, 0x2 - bne _080844B2 -_080844AE: - bl GameFreakRTC_Reset -_080844B2: - ldr r1, =0x020322d4 - movs r0, 0x1 - strb r0, [r1] - ldr r4, =0x03005d90 - ldr r0, [r4] - adds r0, 0xAC - movs r5, 0 - str r5, [r0] - bl zero_player_party_data - bl zero_enemy_party_data - bl sub_80BB2D0 - bl sub_8084400 - bl clear_sav1 - bl sub_80D436C - ldr r0, [r4] - strb r5, [r0, 0x9] - ldr r0, [r4] - adds r0, 0xA8 - str r5, [r0] - bl set_player_trainer_id - bl reset_playtime - bl sub_8084390 - bl sub_809D300 - bl sub_80EBEE0 - bl GabbyAndTyNewGameInitData - bl sub_80E8B28 - bl RemoveAllBerryTrees - ldr r4, =0x03005d8c - ldr r0, [r4] - movs r1, 0x92 - lsls r1, 3 - adds r0, r1 - ldr r1, =0x00000bb8 - bl EncryptMoney - movs r0, 0 - bl SetCoins - bl sub_80D766C - bl sub_80847A8 - bl sub_80843C0 - bl sub_813C1F8 - bl sub_80F9A7C - bl sub_80F9AD4 - ldr r0, =0x020244e9 - strb r5, [r0] - bl zero_player_party_data - bl sub_80C7770 - bl sub_8161B34 - bl sub_8161B60 - ldr r0, [r4] - ldr r1, =0x00000496 - adds r0, r1 - strh r5, [r0] - bl sub_80D7094 - bl sub_816ADF4 - bl sub_8136E88 - bl sub_81618B4 - bl sub_811F184 - bl sub_8120160 - bl sub_81224D4 - bl sub_813BA10 - bl sub_8177558 - bl sub_808444C - ldr r0, =gUnknown_082715DE - bl script_env_2_execute_new_script - bl sub_80845CC - bl copy_strings_to_sav1 - bl sub_818DA30 - bl sub_819FAA0 - bl sub_81A4B14 - bl sub_8195E10 - bl sub_801AFD8 - bl sub_800E5AC - bl sub_81D54BC - bl sub_80DED74 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end NewGameInitData - - thumb_func_start sub_80845CC -sub_80845CC: @ 80845CC - push {r4-r6,lr} - sub sp, 0x4 - mov r0, sp - movs r5, 0 - strh r5, [r0] - ldr r4, =0x03005d90 - ldr r1, [r4] - movs r0, 0xF6 - lsls r0, 1 - adds r1, r0 - ldr r6, =0x01000008 - mov r0, sp - adds r2, r6, 0 - bl CpuSet - ldr r0, [r4] - movs r1, 0xFA - lsls r1, 1 - adds r0, r1 - movs r1, 0 - bl sub_802467C - bl sub_802E33C - mov r0, sp - adds r0, 0x2 - strh r5, [r0] - ldr r1, [r4] - movs r2, 0x83 - lsls r2, 2 - adds r1, r2 - adds r2, r6, 0 - bl CpuSet - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80845CC - - thumb_func_start sub_8084620 -sub_8084620: @ 8084620 - push {r4,lr} - ldr r0, =gUnknown_08271857 - bl script_env_2_execute_new_script - ldr r0, =0x03005d8c - ldr r4, [r0] - movs r0, 0x92 - lsls r0, 3 - adds r4, r0 - adds r0, r4, 0 - bl DecryptMoney - adds r1, r0, 0 - lsrs r1, 1 - adds r0, r4, 0 - bl EncryptMoney - bl sp000_heal_pokemon - bl sub_8084720 - bl copy_saved_warp3_bank_and_enter_x_to_warp1 - bl warp_in - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8084620 - - thumb_func_start flag_var_implications_of_teleport_ -flag_var_implications_of_teleport_: @ 8084660 - push {lr} - bl player_avatar_init_params_reset - ldr r0, =0x0000088b - bl FlagReset - ldr r0, =0x0000088d - bl FlagReset - ldr r0, =0x0000088c - bl FlagReset - ldr r0, =0x00000889 - bl FlagReset - ldr r0, =0x00000888 - bl FlagReset - pop {r0} - bx r0 - .pool - thumb_func_end flag_var_implications_of_teleport_ - - thumb_func_start sub_808469C -sub_808469C: @ 808469C - push {lr} - bl player_avatar_init_params_reset - ldr r0, =0x0000088b - bl FlagReset - ldr r0, =0x0000088d - bl FlagReset - ldr r0, =0x0000088c - bl FlagReset - ldr r0, =0x00000889 - bl FlagReset - ldr r0, =0x00000888 - bl FlagReset - ldr r0, =gUnknown_08271862 - bl script_env_2_execute_new_script - pop {r0} - bx r0 - .pool - thumb_func_end sub_808469C - - thumb_func_start flagmods_08054D70 -flagmods_08054D70: @ 80846E4 - push {lr} - bl player_avatar_init_params_reset - ldr r0, =0x0000088b - bl FlagReset - ldr r0, =0x0000088d - bl FlagReset - ldr r0, =0x0000088c - bl FlagReset - ldr r0, =0x00000889 - bl FlagReset - ldr r0, =0x00000888 - bl FlagReset - pop {r0} - bx r0 - .pool - thumb_func_end flagmods_08054D70 - - thumb_func_start sub_8084720 -sub_8084720: @ 8084720 - push {r4,lr} - bl player_avatar_init_params_reset - ldr r0, =0x0000088b - bl FlagReset - ldr r0, =0x0000088d - bl FlagReset - ldr r0, =0x0000088c - bl FlagReset - ldr r0, =0x00000889 - bl FlagReset - ldr r0, =0x00000888 - bl FlagReset - ldr r4, =0x00004039 - adds r0, r4, 0 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bne _08084764 - adds r0, r4, 0 - movs r1, 0 - bl VarSet - ldr r0, =0x00004037 - movs r1, 0 - bl VarSet -_08084764: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8084720 - - thumb_func_start sub_8084788 -sub_8084788: @ 8084788 - push {lr} - ldr r0, =0x0000088c - bl FlagReset - bl sub_8085B2C - bl wild_pokemon_reroll - bl mapnumbers_history_shift_sav1_0_2_4_out - bl sub_8161D00 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8084788 - - thumb_func_start sub_80847A8 -sub_80847A8: @ 80847A8 - push {r4,lr} - movs r4, 0 -_080847AC: - lsls r0, r4, 24 - lsrs r0, 24 - movs r1, 0 - bl sav12_xor_set - adds r4, 0x1 - cmp r4, 0x3F - ble _080847AC - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80847A8 - - thumb_func_start sav12_xor_increment -@ void sav12_xor_increment(u8 a1) -sav12_xor_increment: @ 80847C4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x33 - bhi _080847EC - adds r0, r4, 0 - bl sub_80847F8 - adds r1, r0, 0 - ldr r0, =0x00fffffe - cmp r1, r0 - bhi _080847E4 - adds r1, 0x1 - b _080847E6 - .pool -_080847E4: - ldr r1, =0x00ffffff -_080847E6: - adds r0, r4, 0 - bl sav12_xor_set -_080847EC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sav12_xor_increment - - thumb_func_start sub_80847F8 -sub_80847F8: @ 80847F8 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x33 - bhi _08084828 - ldr r0, =0x03005d8c - ldr r2, [r0] - lsls r0, r1, 2 - ldr r1, =0x0000159c - adds r2, r1 - adds r2, r0 - ldr r0, =0x03005d90 - ldr r1, [r0] - adds r1, 0xAC - ldr r0, [r2] - ldr r1, [r1] - eors r0, r1 - b _0808482A - .pool -_08084828: - movs r0, 0 -_0808482A: - pop {r1} - bx r1 - thumb_func_end sub_80847F8 - - thumb_func_start sav12_xor_set -sav12_xor_set: @ 8084830 - push {lr} - adds r3, r1, 0 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x33 - bhi _08084854 - ldr r0, =0x03005d8c - ldr r1, [r0] - lsls r0, r2, 2 - ldr r2, =0x0000159c - adds r1, r2 - adds r1, r0 - ldr r0, =0x03005d90 - ldr r0, [r0] - adds r0, 0xAC - ldr r0, [r0] - eors r0, r3 - str r0, [r1] -_08084854: - pop {r0} - bx r0 - .pool - thumb_func_end sav12_xor_set - - thumb_func_start sub_8084864 -sub_8084864: @ 8084864 - push {r4-r6,lr} - adds r5, r0, 0 - movs r4, 0 - ldr r6, =0x03005d8c -_0808486C: - lsls r1, r4, 2 - ldr r0, =0x0000159c - adds r1, r0 - ldr r0, [r6] - adds r0, r1 - adds r1, r5, 0 - bl apply_u32_xor_crypto - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3F - bls _0808486C - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8084864 - - thumb_func_start CopyFieldObjectTemplatesToSav1 -@ void CopyFieldObjectTemplatesToSav1() -CopyFieldObjectTemplatesToSav1: @ 8084894 - push {r4,r5,lr} - sub sp, 0x4 - movs r0, 0 - str r0, [sp] - ldr r5, =0x03005d8c - ldr r1, [r5] - movs r4, 0xC7 - lsls r4, 4 - adds r1, r4 - ldr r2, =0x05000180 - mov r0, sp - bl CpuSet - ldr r0, =0x02037318 - ldr r2, [r0, 0x4] - ldr r0, [r2, 0x4] - ldr r1, [r5] - adds r1, r4 - ldrb r3, [r2] - lsls r2, r3, 1 - adds r2, r3 - lsls r2, 1 - movs r3, 0x80 - lsls r3, 19 - orrs r2, r3 - bl CpuSet - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end CopyFieldObjectTemplatesToSav1 - - thumb_func_start CopyFieldObjectTemplateCoordsToSav1 -@ void CopyFieldObjectTemplateCoordsToSav1() -CopyFieldObjectTemplateCoordsToSav1: @ 80848E0 - push {lr} - ldr r0, =0x02037318 - ldr r1, [r0, 0x4] - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, [r1, 0x4] - movs r3, 0xC7 - lsls r3, 4 - adds r1, r0, r3 - movs r3, 0x3F -_080848F4: - ldr r0, [r2, 0x10] - str r0, [r1, 0x10] - adds r2, 0x18 - adds r1, 0x18 - subs r3, 0x1 - cmp r3, 0 - bge _080848F4 - pop {r0} - bx r0 - .pool - thumb_func_end CopyFieldObjectTemplateCoordsToSav1 - - thumb_func_start update_saveblock1_field_object_coords -update_saveblock1_field_object_coords: @ 8084910 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 16 - lsrs r4, r1, 16 - lsls r2, 16 - lsrs r2, 16 - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r1, 0 - movs r6, 0xC7 - lsls r6, 4 - adds r3, r0, r6 -_0808492A: - ldrb r0, [r3] - cmp r0, r5 - bne _0808493C - strh r4, [r3, 0x4] - strh r2, [r3, 0x6] - b _08084944 - .pool -_0808493C: - adds r3, 0x18 - adds r1, 0x1 - cmp r1, 0x3F - ble _0808492A -_08084944: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end update_saveblock1_field_object_coords - - thumb_func_start update_saveblock1_field_object_movement_behavior -update_saveblock1_field_object_movement_behavior: @ 808494C - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r3, 0 - movs r5, 0xC7 - lsls r5, 4 - adds r2, r0, r5 -_08084962: - ldrb r0, [r2] - cmp r0, r4 - bne _08084970 - strb r1, [r2, 0x9] - b _08084978 - .pool -_08084970: - adds r2, 0x18 - adds r3, 0x1 - cmp r3, 0x3F - ble _08084962 -_08084978: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end update_saveblock1_field_object_movement_behavior - - thumb_func_start mapdata_load_assets_to_gpu_and_full_redraw -mapdata_load_assets_to_gpu_and_full_redraw: @ 8084980 - push {r4,lr} - bl move_tilemap_camera_to_upper_left_corner - ldr r4, =0x02037318 - ldr r0, [r4] - bl copy_map_tileset1_tileset2_to_vram - ldr r0, [r4] - bl apply_map_tileset1_tileset2_palette - bl DrawWholeMapView - bl cur_mapheader_run_tileset_funcs_after_some_cpuset - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end mapdata_load_assets_to_gpu_and_full_redraw - - thumb_func_start get_mapdata_header -@ mapdata_header *get_mapdata_header() -get_mapdata_header: @ 80849A8 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r1, [r0, 0x32] - cmp r1, 0 - bne _080849BC - movs r0, 0 - b _080849C6 - .pool -_080849BC: - ldr r0, =gUnknown_08481DD4 - subs r1, 0x1 - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] -_080849C6: - pop {r1} - bx r1 - .pool - thumb_func_end get_mapdata_header - - thumb_func_start warp_shift -@ void warp_shift() -warp_shift: @ 80849D0 - ldr r3, =0x020322dc - ldr r0, =0x03005d8c - ldr r2, [r0] - ldr r0, [r2, 0x4] - ldr r1, [r2, 0x8] - str r0, [r3] - str r1, [r3, 0x4] - ldr r0, =0x020322e4 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [r2, 0x4] - str r1, [r2, 0x8] - ldr r2, =0x020322ec - ldr r0, =gUnknown_08339D3C - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [r2] - str r1, [r2, 0x4] - ldr r2, =0x020322f4 - str r0, [r2] - str r1, [r2, 0x4] - bx lr - .pool - thumb_func_end warp_shift - - thumb_func_start set_warp2_warp3_to_neg_1 -@ void set_warp2_warp3_to_neg_1() -set_warp2_warp3_to_neg_1: @ 8084A14 - ldr r2, =0x020322ec - ldr r0, =gUnknown_08339D3C - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [r2] - str r1, [r2, 0x4] - ldr r2, =0x020322f4 - str r0, [r2] - str r1, [r2, 0x4] - bx lr - .pool - thumb_func_end set_warp2_warp3_to_neg_1 - - thumb_func_start warp_set -@ void warp_set(warpdata *warp, char bank, char map, char warpid, char enter_x, char enter_y) -warp_set: @ 8084A34 - push {r4,r5,lr} - ldr r4, [sp, 0xC] - ldr r5, [sp, 0x10] - strb r1, [r0] - strb r2, [r0, 0x1] - strb r3, [r0, 0x2] - lsls r4, 24 - asrs r4, 24 - strh r4, [r0, 0x4] - lsls r5, 24 - asrs r5, 24 - strh r5, [r0, 0x6] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end warp_set - - thumb_func_start warp_data_is_not_neg_1 -@ int warp_data_is_not_neg_1(warpdata *warp) -warp_data_is_not_neg_1: @ 8084A54 - push {lr} - adds r1, r0, 0 - movs r2, 0 - ldrsb r2, [r1, r2] - movs r0, 0x1 - negs r0, r0 - cmp r2, r0 - bne _08084A88 - movs r0, 0x1 - ldrsb r0, [r1, r0] - cmp r0, r2 - bne _08084A88 - movs r2, 0x2 - ldrsb r2, [r1, r2] - cmp r2, r0 - bne _08084A88 - movs r0, 0x4 - ldrsh r3, [r1, r0] - cmp r3, r2 - bne _08084A88 - movs r2, 0x6 - ldrsh r0, [r1, r2] - cmp r0, r3 - bne _08084A88 - movs r0, 0x1 - b _08084A8A -_08084A88: - movs r0, 0 -_08084A8A: - pop {r1} - bx r1 - thumb_func_end warp_data_is_not_neg_1 - - thumb_func_start get_mapheader_by_bank_and_number -@ struct mapheader *get_mapheader_by_bank_and_number(unsigned int bank, unsigned int num) -get_mapheader_by_bank_and_number: @ 8084A90 - lsls r0, 16 - lsls r1, 16 - ldr r2, =gUnknown_08486578 - lsrs r0, 14 - adds r0, r2 - ldr r0, [r0] - lsrs r1, 14 - adds r1, r0 - ldr r0, [r1] - bx lr - .pool - thumb_func_end get_mapheader_by_bank_and_number - - thumb_func_start warp1_get_mapheader -@ struct mapheader *warp1_get_mapheader() -warp1_get_mapheader: @ 8084AA8 - push {lr} - ldr r1, =0x020322e4 - movs r0, 0 - ldrsb r0, [r1, r0] - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r1, 0x1] - lsls r1, 24 - asrs r1, 24 - lsls r1, 16 - lsrs r1, 16 - bl get_mapheader_by_bank_and_number - pop {r1} - bx r1 - .pool - thumb_func_end warp1_get_mapheader - - thumb_func_start set_current_map_header_from_sav1_save_old_name -@ void set_current_map_header_from_sav1_save_old_name() -set_current_map_header_from_sav1_save_old_name: @ 8084ACC - push {r4-r6,lr} - ldr r1, =0x020322fc - ldr r4, =0x02037318 - ldrb r0, [r4, 0x14] - strh r0, [r1] - ldr r5, =0x03005d8c - ldr r1, [r5] - movs r0, 0x4 - ldrsb r0, [r1, r0] - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r1, 0x5] - lsls r1, 24 - asrs r1, 24 - lsls r1, 16 - lsrs r1, 16 - bl get_mapheader_by_bank_and_number - adds r1, r4, 0 - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - ldr r0, [r0] - str r0, [r1] - ldr r1, [r5] - ldrh r0, [r4, 0x12] - strh r0, [r1, 0x32] - bl get_mapdata_header - str r0, [r4] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end set_current_map_header_from_sav1_save_old_name - - thumb_func_start set_current_map_header_from_sav1 -set_current_map_header_from_sav1: @ 8084B1C - push {r4,r5,lr} - ldr r4, =0x02037318 - ldr r0, =0x03005d8c - ldr r1, [r0] - movs r0, 0x4 - ldrsb r0, [r1, r0] - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r1, 0x5] - lsls r1, 24 - asrs r1, 24 - lsls r1, 16 - lsrs r1, 16 - bl get_mapheader_by_bank_and_number - adds r1, r4, 0 - 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] - bl get_mapdata_header - str r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end set_current_map_header_from_sav1 - - thumb_func_start update_camera_pos_from_warpid -@ void update_camera_pos_from_warpid() -update_camera_pos_from_warpid: @ 8084B5C - push {r4,r5,lr} - ldr r0, =0x03005d8c - ldr r2, [r0] - movs r1, 0x6 - ldrsb r1, [r2, r1] - adds r4, r0, 0 - cmp r1, 0 - blt _08084B94 - ldr r3, =0x02037318 - ldr r0, [r3, 0x4] - ldrb r5, [r0, 0x1] - cmp r1, r5 - bge _08084B94 - ldr r0, [r0, 0x8] - lsls r1, 3 - adds r0, r1, r0 - ldrh r0, [r0] - strh r0, [r2] - ldr r0, [r3, 0x4] - ldr r0, [r0, 0x8] - adds r1, r0 - ldrh r0, [r1, 0x2] - strh r0, [r2, 0x2] - b _08084BCC - .pool -_08084B94: - ldr r1, [r4] - ldrh r3, [r1, 0x8] - movs r2, 0x8 - ldrsh r0, [r1, r2] - cmp r0, 0 - blt _08084BB0 - ldrh r2, [r1, 0xA] - movs r5, 0xA - ldrsh r0, [r1, r5] - cmp r0, 0 - blt _08084BB0 - strh r3, [r1] - strh r2, [r1, 0x2] - b _08084BCC -_08084BB0: - ldr r3, [r4] - ldr r2, =0x02037318 - ldr r0, [r2] - ldr r0, [r0] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - strh r0, [r3] - ldr r0, [r2] - ldr r0, [r0, 0x4] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - strh r0, [r3, 0x2] -_08084BCC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end update_camera_pos_from_warpid - - thumb_func_start warp_in -warp_in: @ 8084BD8 - push {lr} - bl warp_shift - bl set_current_map_header_from_sav1_save_old_name - bl update_camera_pos_from_warpid - pop {r0} - bx r0 - thumb_func_end warp_in - - thumb_func_start warp1_set -@ void warp1_set(char bank, char map, char warpid, char enter_x, char enter_y) -warp1_set: @ 8084BEC - 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, =0x020322e4 - lsls r4, 24 - asrs r4, 24 - lsls r5, 24 - asrs r5, 24 - lsls r6, 24 - asrs r6, 24 - lsls r3, 24 - asrs r3, 24 - str r3, [sp] - lsls r1, 24 - asrs r1, 24 - str r1, [sp, 0x4] - adds r1, r4, 0 - adds r2, r5, 0 - adds r3, r6, 0 - bl warp_set - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end warp1_set - - thumb_func_start warp1_set_2 -@ void warp1_set_2(char bank, char map, char warpid) -warp1_set_2: @ 8084C28 - push {lr} - sub sp, 0x4 - lsls r0, 24 - asrs r0, 24 - lsls r1, 24 - asrs r1, 24 - lsls r2, 24 - asrs r2, 24 - movs r3, 0x1 - negs r3, r3 - str r3, [sp] - bl warp1_set - add sp, 0x4 - pop {r0} - bx r0 - thumb_func_end warp1_set_2 - - thumb_func_start saved_warp2_set -@ void saved_warp2_set(char bank, char map, char warpid) -saved_warp2_set: @ 8084C48 - push {r4,r5,lr} - sub sp, 0x8 - ldr r0, =0x03005d8c - ldr r5, [r0] - adds r0, r5, 0 - adds r0, 0x14 - lsls r1, 24 - asrs r1, 24 - lsls r2, 24 - asrs r2, 24 - lsls r3, 24 - asrs r3, 24 - movs r4, 0 - ldrsb r4, [r5, r4] - str r4, [sp] - movs r4, 0x2 - ldrsb r4, [r5, r4] - str r4, [sp, 0x4] - bl warp_set - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end saved_warp2_set - - thumb_func_start saved_warp2_set_2 -saved_warp2_set_2: @ 8084C7C - push {r4,r5,lr} - sub sp, 0x8 - ldr r4, [sp, 0x14] - ldr r5, [sp, 0x18] - ldr r0, =0x03005d8c - ldr r0, [r0] - adds r0, 0x14 - lsls r1, 24 - asrs r1, 24 - lsls r2, 24 - asrs r2, 24 - lsls r3, 24 - asrs r3, 24 - lsls r4, 24 - asrs r4, 24 - str r4, [sp] - lsls r5, 24 - asrs r5, 24 - str r5, [sp, 0x4] - bl warp_set - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end saved_warp2_set_2 - - thumb_func_start copy_saved_warp2_bank_and_enter_x_to_warp1 -copy_saved_warp2_bank_and_enter_x_to_warp1: @ 8084CB4 - ldr r2, =0x020322e4 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, [r0, 0x18] - ldr r0, [r0, 0x14] - str r0, [r2] - str r1, [r2, 0x4] - bx lr - .pool - thumb_func_end copy_saved_warp2_bank_and_enter_x_to_warp1 - - thumb_func_start sub_8084CCC -@ void sub_8084CCC(int a1) -sub_8084CCC: @ 8084CCC - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - bl sub_8122CBC - adds r4, r0, 0 - cmp r4, 0 - beq _08084CFA - movs r0, 0 - ldrsb r0, [r4, r0] - movs r1, 0x1 - ldrsb r1, [r4, r1] - movs r2, 0x1 - negs r2, r2 - movs r3, 0x2 - ldrsb r3, [r4, r3] - ldrb r4, [r4, 0x4] - lsls r4, 24 - asrs r4, 24 - str r4, [sp] - bl warp1_set -_08084CFA: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8084CCC - - thumb_func_start copy_saved_warp3_bank_and_enter_x_to_warp1 -@ void copy_saved_warp3_bank_and_enter_x_to_warp1() -copy_saved_warp3_bank_and_enter_x_to_warp1: @ 8084D04 - ldr r2, =0x020322e4 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, [r0, 0x20] - ldr r0, [r0, 0x1C] - str r0, [r2] - str r1, [r2, 0x4] - bx lr - .pool - thumb_func_end copy_saved_warp3_bank_and_enter_x_to_warp1 - - thumb_func_start sub_8084D1C -sub_8084D1C: @ 8084D1C - push {r4,r5,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - bl sub_8122CBC - adds r5, r0, 0 - cmp r5, 0 - beq _08084D50 - ldr r0, =0x03005d8c - ldr r0, [r0] - adds r0, 0x1C - movs r1, 0 - ldrsb r1, [r5, r1] - movs r2, 0x1 - ldrsb r2, [r5, r2] - movs r3, 0x1 - negs r3, r3 - movs r4, 0x2 - ldrsb r4, [r5, r4] - str r4, [sp] - movs r4, 0x4 - ldrsb r4, [r5, r4] - str r4, [sp, 0x4] - bl warp_set -_08084D50: - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8084D1C - - thumb_func_start sub_8084D5C -sub_8084D5C: @ 8084D5C - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 16 - lsrs r7, r1, 16 - bl sav1_map_get_light_level - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =0x020322e4 - movs r0, 0 - ldrsb r0, [r1, r0] - ldrb r1, [r1, 0x1] - lsls r1, 24 - asrs r1, 24 - bl get_map_light_level_by_bank_and_number - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r4, 0 - bl is_light_level_1_2_3_5_or_6 - lsls r0, 24 - cmp r0, 0 - beq _08084DC4 - adds r0, r5, 0 - bl is_light_level_1_2_3_5_or_6 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08084DC4 - ldr r0, =0x03005d8c - ldr r1, [r0] - movs r0, 0x4 - ldrsb r0, [r1, r0] - ldrb r1, [r1, 0x5] - lsls r1, 24 - asrs r1, 24 - movs r2, 0x1 - negs r2, r2 - subs r3, r6, 0x7 - lsls r3, 24 - asrs r3, 24 - subs r4, r7, 0x6 - lsls r4, 24 - asrs r4, 24 - str r4, [sp] - bl sub_8084DD4 -_08084DC4: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8084D5C - - thumb_func_start sub_8084DD4 -sub_8084DD4: @ 8084DD4 - 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, =0x03005d8c - ldr r0, [r0] - adds r0, 0x24 - lsls r4, 24 - asrs r4, 24 - lsls r5, 24 - asrs r5, 24 - lsls r6, 24 - asrs r6, 24 - lsls r3, 24 - asrs r3, 24 - str r3, [sp] - lsls r1, 24 - asrs r1, 24 - str r1, [sp, 0x4] - adds r1, r4, 0 - adds r2, r5, 0 - adds r3, r6, 0 - bl warp_set - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8084DD4 - - thumb_func_start sub_8084E14 -sub_8084E14: @ 8084E14 - ldr r2, =0x020322e4 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, [r0, 0x28] - ldr r0, [r0, 0x24] - str r0, [r2] - str r1, [r2, 0x4] - bx lr - .pool - thumb_func_end sub_8084E14 - - thumb_func_start sub_8084E2C -sub_8084E2C: @ 8084E2C - 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, =0x020322ec - lsls r4, 24 - asrs r4, 24 - lsls r5, 24 - asrs r5, 24 - lsls r6, 24 - asrs r6, 24 - lsls r3, 24 - asrs r3, 24 - str r3, [sp] - lsls r1, 24 - asrs r1, 24 - str r1, [sp, 0x4] - adds r1, r4, 0 - adds r2, r5, 0 - adds r3, r6, 0 - bl warp_set - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8084E2C - - thumb_func_start warp1_set_to_warp2 -warp1_set_to_warp2: @ 8084E68 - ldr r2, =0x020322e4 - ldr r0, =0x020322ec - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [r2] - str r1, [r2, 0x4] - bx lr - .pool - thumb_func_end warp1_set_to_warp2 - - thumb_func_start sub_8084E80 -sub_8084E80: @ 8084E80 - 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, =0x020322f4 - lsls r4, 24 - asrs r4, 24 - lsls r5, 24 - asrs r5, 24 - lsls r6, 24 - asrs r6, 24 - lsls r3, 24 - asrs r3, 24 - str r3, [sp] - lsls r1, 24 - asrs r1, 24 - str r1, [sp, 0x4] - adds r1, r4, 0 - adds r2, r5, 0 - adds r3, r6, 0 - bl warp_set - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8084E80 - - thumb_func_start sub_8084EBC -sub_8084EBC: @ 8084EBC - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 16 - lsrs r6, r1, 16 - ldr r4, =0x020322f4 - adds r0, r4, 0 - bl warp_data_is_not_neg_1 - cmp r0, 0x1 - bne _08084EF0 - ldr r2, =0x020322e4 - ldr r0, =0x020322dc - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [r2] - str r1, [r2, 0x4] - b _08084F0A - .pool -_08084EF0: - movs r0, 0 - ldrsb r0, [r4, r0] - movs r1, 0x1 - ldrsb r1, [r4, r1] - movs r2, 0x1 - negs r2, r2 - lsls r3, r5, 24 - asrs r3, 24 - lsls r4, r6, 24 - asrs r4, 24 - str r4, [sp] - bl warp1_set -_08084F0A: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8084EBC - - thumb_func_start warp1_set_to_sav1w -warp1_set_to_sav1w: @ 8084F14 - ldr r2, =0x020322e4 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, [r0, 0x10] - ldr r0, [r0, 0xC] - str r0, [r2] - str r1, [r2, 0x4] - bx lr - .pool - thumb_func_end warp1_set_to_sav1w - - thumb_func_start sub_8084F2C -sub_8084F2C: @ 8084F2C - 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, =0x03005d8c - ldr r0, [r0] - adds r0, 0xC - lsls r4, 24 - asrs r4, 24 - lsls r5, 24 - asrs r5, 24 - lsls r6, 24 - asrs r6, 24 - lsls r3, 24 - asrs r3, 24 - str r3, [sp] - lsls r1, 24 - asrs r1, 24 - str r1, [sp, 0x4] - adds r1, r4, 0 - adds r2, r5, 0 - adds r3, r6, 0 - bl warp_set - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8084F2C - - thumb_func_start sub_8084F6C -sub_8084F6C: @ 8084F6C - push {r4,r5,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - bl sub_8122CBC - adds r5, r0, 0 - cmp r5, 0 - beq _08084FA0 - ldr r0, =0x03005d8c - ldr r0, [r0] - adds r0, 0xC - movs r1, 0 - ldrsb r1, [r5, r1] - movs r2, 0x1 - ldrsb r2, [r5, r2] - movs r3, 0x1 - negs r3, r3 - movs r4, 0x2 - ldrsb r4, [r5, r4] - str r4, [sp] - movs r4, 0x4 - ldrsb r4, [r5, r4] - str r4, [sp, 0x4] - bl warp_set -_08084FA0: - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8084F6C - - thumb_func_start sub_8084FAC -sub_8084FAC: @ 8084FAC - ldr r0, =0x03005d8c - ldr r2, [r0] - ldr r0, [r2, 0x14] - ldr r1, [r2, 0x18] - str r0, [r2, 0xC] - str r1, [r2, 0x10] - bx lr - .pool - thumb_func_end sub_8084FAC - - thumb_func_start sub_8084FC0 -sub_8084FC0: @ 8084FC0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037318 - ldr r0, [r0, 0xC] - ldr r3, [r0] - ldr r1, [r0, 0x4] - cmp r1, 0 - bne _08084FDC - b _08084FF0 - .pool -_08084FD8: - adds r0, r1, 0 - b _08084FF2 -_08084FDC: - movs r2, 0 - cmp r2, r3 - bge _08084FF0 -_08084FE2: - ldrb r0, [r1] - cmp r0, r4 - beq _08084FD8 - adds r2, 0x1 - adds r1, 0xC - cmp r2, r3 - blt _08084FE2 -_08084FF0: - movs r0, 0 -_08084FF2: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8084FC0 - - thumb_func_start sub_8084FF8 -sub_8084FF8: @ 8084FF8 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r4, r1, 16 - lsls r2, 16 - lsrs r5, r2, 16 - bl sub_8084FC0 - adds r1, r0, 0 - cmp r1, 0 - beq _08085030 - movs r0, 0x8 - ldrsb r0, [r1, r0] - ldrb r1, [r1, 0x9] - lsls r1, 24 - asrs r1, 24 - movs r2, 0x1 - negs r2, r2 - lsls r3, r4, 24 - asrs r3, 24 - lsls r4, r5, 24 - asrs r4, 24 - str r4, [sp] - bl warp1_set - b _0808504C -_08085030: - bl mapheader_run_script_with_tag_x6 - ldr r0, =0x020322ec - bl warp_data_is_not_neg_1 - cmp r0, 0 - beq _08085048 - movs r0, 0 - b _0808504E - .pool -_08085048: - bl warp1_set_to_warp2 -_0808504C: - movs r0, 0x1 -_0808504E: - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8084FF8 - - thumb_func_start sub_8085058 -sub_8085058: @ 8085058 - push {lr} - adds r3, r0, 0 - adds r2, r1, 0 - lsls r3, 16 - lsrs r3, 16 - lsls r2, 16 - lsrs r2, 16 - movs r0, 0x6 - adds r1, r3, 0 - bl sub_8084FF8 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_8085058 - - thumb_func_start sub_8085078 -sub_8085078: @ 8085078 - push {lr} - adds r3, r0, 0 - adds r2, r1, 0 - lsls r3, 16 - lsrs r3, 16 - lsls r2, 16 - lsrs r2, 16 - movs r0, 0x5 - adds r1, r3, 0 - bl sub_8084FF8 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_8085078 - - thumb_func_start mliX_load_map -mliX_load_map: @ 8085098 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r5, r1, 0 - lsls r0, r6, 24 - asrs r0, 24 - lsls r1, r5, 24 - asrs r1, 24 - movs r3, 0x1 - negs r3, r3 - str r3, [sp] - adds r2, r3, 0 - bl warp1_set - ldr r4, =0x02037318 - ldrb r0, [r4, 0x14] - cmp r0, 0x3A - beq _080850C8 - bl sub_8085810 -_080850C8: - bl warp_shift - bl set_current_map_header_from_sav1_save_old_name - bl CopyFieldObjectTemplatesToSav1 - bl sav2_set_x9_depending_on_sav1_map - bl sub_809D344 - bl wild_pokemon_reroll - bl prev_quest_postbuffer_cursor_backup_reset - adds r0, r6, 0 - adds r1, r5, 0 - bl sub_80B21B4 - bl sub_809E7B0 - bl sub_80AEDBC - bl sub_8085B2C - bl update_sav1_flash_used_on_map - bl sav1_reset_battle_music_maybe - bl mapheader_run_script_with_tag_x3 - bl not_trainer_hill_battle_pyramid - ldr r0, [r4] - bl copy_map_tileset2_to_vram_2 - ldr r0, [r4] - bl apply_map_tileset2_palette - movs r4, 0x6 -_08085116: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_80ABF00 - adds r4, 0x1 - cmp r4, 0xC - ble _08085116 - bl sub_80A0A2C - bl mapnumbers_history_shift_sav1_0_2_4_out - bl sub_8161D54 - bl sub_80AEE20 - bl wild_encounter_reset_coro_args - bl mapheader_run_script_with_tag_x5 - ldr r2, =0x02037318 - ldrb r0, [r2, 0x14] - cmp r0, 0x3A - bne _0808514C - ldr r1, =0x020322fc - ldrh r1, [r1] - cmp r0, r1 - beq _08085150 -_0808514C: - bl AddMapNamePopUpWindowTask -_08085150: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end mliX_load_map - - thumb_func_start mli0_load_map -mli0_load_map: @ 8085160 - push {r4-r7,lr} - adds r7, r0, 0 - bl set_current_map_header_from_sav1_save_old_name - ldr r0, =0x020322d8 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080851A2 - ldr r0, =0x02037318 - ldrh r1, [r0, 0x12] - ldr r0, =0x00000169 - cmp r1, r0 - bne _08085190 - bl sub_81AA1D8 - b _080851A2 - .pool -_08085190: - bl InTrainerHill - cmp r0, 0 - beq _0808519E - bl sub_81D5DF8 - b _080851A2 -_0808519E: - bl CopyFieldObjectTemplatesToSav1 -_080851A2: - ldr r4, =0x02037318 - ldrb r0, [r4, 0x17] - bl is_light_level_1_2_3_5_or_6 - lsls r0, 24 - lsrs r5, r0, 24 - ldrb r0, [r4, 0x17] - bl is_light_level_8_or_9 - lsls r0, 24 - lsrs r6, r0, 24 - bl sub_80EB218 - bl sav2_set_x9_depending_on_sav1_map - bl sub_809D344 - bl wild_pokemon_reroll - bl prev_quest_postbuffer_cursor_backup_reset - ldr r0, =0x03005d8c - ldr r1, [r0] - movs r0, 0x4 - ldrsb r0, [r1, r0] - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r1, 0x5] - lsls r1, 24 - asrs r1, 24 - lsls r1, 16 - lsrs r1, 16 - bl sub_80B21B4 - cmp r7, 0x1 - beq _080851EE - bl sub_809E7B0 -_080851EE: - bl sub_80AEDBC - bl sub_8085B2C - cmp r5, 0 - beq _08085200 - ldr r0, =0x00000888 - bl FlagReset -_08085200: - bl update_sav1_flash_used_on_map - bl sav1_reset_battle_music_maybe - bl mapheader_run_script_with_tag_x3 - bl mapnumbers_history_shift_sav1_0_2_4_out - bl sub_8161D00 - ldrh r1, [r4, 0x12] - ldr r0, =0x00000169 - cmp r1, r0 - bne _08085234 - movs r0, 0 - bl battle_pyramid_map_load_related - b _08085246 - .pool -_08085234: - bl InTrainerHill - cmp r0, 0 - beq _08085242 - bl trainer_hill_map_load_related - b _08085246 -_08085242: - bl not_trainer_hill_battle_pyramid -_08085246: - cmp r7, 0x1 - beq _0808525E - cmp r6, 0 - beq _0808525E - ldr r1, =0x03005dc0 - ldr r0, [r1] - ldr r1, [r1, 0x4] - bl UpdateTVScreensOnMap - movs r0, 0x1 - bl sub_80E9238 -_0808525E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end mli0_load_map - - thumb_func_start player_avatar_init_params_reset -player_avatar_init_params_reset: @ 8085268 - ldr r1, =0x02032300 - movs r0, 0x1 - strb r0, [r1, 0x1] - strb r0, [r1] - bx lr - .pool - thumb_func_end player_avatar_init_params_reset - - thumb_func_start walkrun_find_lowest_active_bit_in_bitfield -walkrun_find_lowest_active_bit_in_bitfield: @ 8085278 - push {r4,lr} - bl player_get_direction_lower_nybble - ldr r4, =0x02032300 - strb r0, [r4, 0x1] - movs r0, 0x2 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _08085298 - movs r0, 0x2 - b _080852CA - .pool -_08085298: - movs r0, 0x4 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _080852A8 - movs r0, 0x4 - b _080852CA -_080852A8: - movs r0, 0x8 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _080852B8 - movs r0, 0x8 - b _080852CA -_080852B8: - movs r0, 0x10 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _080852C8 - movs r0, 0x10 - b _080852CA -_080852C8: - movs r0, 0x1 -_080852CA: - strb r0, [r4] - pop {r4} - pop {r0} - bx r0 - thumb_func_end walkrun_find_lowest_active_bit_in_bitfield - - thumb_func_start sub_80852D4 -sub_80852D4: @ 80852D4 - push {r4-r7,lr} - bl sav1_map_get_light_level - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - bl cur_mapdata_block_role_at_screen_center_acc_to_sav1 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r6, =0x02032300 - adds r0, r6, 0 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_808532C - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =0xffffff00 - ands r7, r0 - orrs r7, r1 - adds r0, r6, 0 - adds r2, r4, 0 - adds r3, r5, 0 - bl sub_808538C - lsls r0, 24 - lsrs r0, 16 - ldr r1, =0xffff00ff - ands r7, r1 - orrs r7, r0 - str r7, [r6] - adds r0, r6, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80852D4 - - thumb_func_start sub_808532C -sub_808532C: @ 808532C - push {r4-r6,lr} - adds r6, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - lsls r2, 24 - lsrs r4, r2, 24 - cmp r4, 0x8 - beq _08085348 - ldr r0, =0x0000088d - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _08085382 -_08085348: - cmp r4, 0x5 - bne _08085354 - movs r0, 0x10 - b _08085384 - .pool -_08085354: - lsls r0, r5, 24 - lsrs r0, 24 - bl MetatileBehavior_IsSurfableWaterOrUnderwater - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08085368 - movs r0, 0x8 - b _08085384 -_08085368: - bl sav1_map_is_biking_allowed - cmp r0, 0x1 - bne _08085382 - ldrb r0, [r6] - cmp r0, 0x2 - bne _0808537A - movs r0, 0x2 - b _08085384 -_0808537A: - cmp r0, 0x4 - bne _08085382 - movs r0, 0x4 - b _08085384 -_08085382: - movs r0, 0x1 -_08085384: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_808532C - - thumb_func_start sub_808538C -sub_808538C: @ 808538C - push {r4-r7,lr} - adds r6, r0, 0 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 16 - lsrs r4, r2, 16 - lsls r3, 24 - lsrs r5, r3, 24 - ldr r0, =0x0000088d - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080853AC - cmp r5, 0x6 - beq _0808540C -_080853AC: - lsls r4, 24 - lsrs r5, r4, 24 - adds r0, r5, 0 - bl sub_8088F74 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080853E8 - adds r0, r5, 0 - bl sub_8088F58 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08085442 - adds r0, r5, 0 - bl sub_8088EFC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08085442 - adds r0, r5, 0 - bl MetatileBehavior_IsSouthArrowWarp - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080853F0 -_080853E8: - movs r0, 0x2 - b _08085448 - .pool -_080853F0: - adds r0, r5, 0 - bl MetatileBehavior_IsNorthArrowWarp - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08085442 - adds r0, r5, 0 - bl MetatileBehavior_IsWestArrowWarp - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08085410 -_0808540C: - movs r0, 0x4 - b _08085448 -_08085410: - adds r0, r5, 0 - bl MetatileBehavior_IsEastArrowWarp - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08085422 - movs r0, 0x3 - b _08085448 -_08085422: - ldrb r0, [r6] - cmp r0, 0x10 - bne _0808542C - cmp r7, 0x8 - beq _08085446 -_0808542C: - cmp r0, 0x8 - bne _08085434 - cmp r7, 0x10 - beq _08085446 -_08085434: - lsrs r0, r4, 24 - bl MetatileBehavior_IsLadder - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08085446 -_08085442: - movs r0, 0x1 - b _08085448 -_08085446: - ldrb r0, [r6, 0x1] -_08085448: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_808538C - - thumb_func_start cur_mapdata_block_role_at_screen_center_acc_to_sav1 -cur_mapdata_block_role_at_screen_center_acc_to_sav1: @ 8085450 - push {lr} - ldr r0, =0x03005d8c - ldr r1, [r0] - movs r2, 0 - ldrsh r0, [r1, r2] - adds r0, 0x7 - movs r2, 0x2 - ldrsh r1, [r1, r2] - adds r1, 0x7 - bl MapGridGetMetatileBehaviorAt - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - .pool - thumb_func_end cur_mapdata_block_role_at_screen_center_acc_to_sav1 - - thumb_func_start sav1_map_is_biking_allowed -sav1_map_is_biking_allowed: @ 8085474 - push {lr} - ldr r0, =0x02037318 - ldrb r1, [r0, 0x1A] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0808548C - movs r0, 0x1 - b _0808548E - .pool -_0808548C: - movs r0, 0 -_0808548E: - pop {r1} - bx r1 - thumb_func_end sav1_map_is_biking_allowed - - thumb_func_start update_sav1_flash_used_on_map -update_sav1_flash_used_on_map: @ 8085494 - push {lr} - ldr r0, =0x02037318 - ldrb r1, [r0, 0x15] - cmp r1, 0 - bne _080854B0 - ldr r0, =0x03005d8c - ldr r0, [r0] - adds r0, 0x30 - strb r1, [r0] - b _080854DE - .pool -_080854B0: - ldr r0, =0x00000888 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080854D0 - ldr r0, =0x03005d8c - ldr r0, [r0] - adds r0, 0x30 - movs r1, 0x1 - strb r1, [r0] - b _080854DE - .pool -_080854D0: - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r0, =gUnknown_0854FE78 - ldr r0, [r0] - subs r0, 0x1 - adds r1, 0x30 - strb r0, [r1] -_080854DE: - pop {r0} - bx r0 - .pool - thumb_func_end update_sav1_flash_used_on_map - - thumb_func_start sub_80854EC -sub_80854EC: @ 80854EC - push {lr} - adds r1, r0, 0 - cmp r1, 0 - blt _080854FC - ldr r0, =gUnknown_0854FE78 - ldr r0, [r0] - cmp r1, r0 - ble _080854FE -_080854FC: - movs r1, 0 -_080854FE: - ldr r0, =0x03005d8c - ldr r0, [r0] - adds r0, 0x30 - strb r1, [r0] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80854EC - - thumb_func_start sav1_get_flash_used_on_map -sav1_get_flash_used_on_map: @ 8085514 - ldr r0, =0x03005d8c - ldr r0, [r0] - adds r0, 0x30 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sav1_get_flash_used_on_map - - thumb_func_start sub_8085524 -sub_8085524: @ 8085524 - push {lr} - ldr r1, =0x03005d8c - ldr r1, [r1] - strh r0, [r1, 0x32] - bl get_mapdata_header - ldr r1, =0x02037318 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8085524 - - thumb_func_start sub_8085540 -sub_8085540: @ 8085540 - ldr r1, =0x020322d8 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_8085540 - - thumb_func_start sub_808554C -sub_808554C: @ 808554C - ldr r0, =0x020322d8 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_808554C - - thumb_func_start sub_8085558 -sub_8085558: @ 8085558 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x0000088a - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080855AC - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0 - bne _080855AC - movs r0, 0x1 - ldrsb r0, [r4, r0] - cmp r0, 0x5 - blt _08085584 - cmp r0, 0x8 - ble _0808559E - cmp r0, 0x2B - bgt _08085584 - cmp r0, 0x27 - bge _0808559E -_08085584: - ldr r0, =0x0000405e - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x3 - bls _080855AC - movs r0, 0x1 - ldrsb r0, [r4, r0] - cmp r0, 0x2E - bgt _080855AC - cmp r0, 0x2C - blt _080855AC -_0808559E: - movs r0, 0x1 - b _080855AE - .pool -_080855AC: - movs r0, 0 -_080855AE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8085558 - - thumb_func_start sub_80855B4 -sub_80855B4: @ 80855B4 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x000040ca - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bne _080855D6 - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0 - bne _080855D6 - movs r0, 0x1 - ldrsb r0, [r4, r0] - cmp r0, 0x7 - beq _080855E0 -_080855D6: - movs r0, 0 - b _080855E2 - .pool -_080855E0: - movs r0, 0x1 -_080855E2: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80855B4 - - thumb_func_start sub_80855E8 -sub_80855E8: @ 80855E8 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x000040b3 - bl VarGet - lsls r0, 16 - cmp r0, 0 - bne _08085606 - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0x20 - bne _08085606 - ldrb r0, [r4, 0x1] - cmp r0, 0x1 - bls _08085610 -_08085606: - movs r0, 0 - b _08085612 - .pool -_08085610: - movs r0, 0x1 -_08085612: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80855E8 - - thumb_func_start sub_8085618 -sub_8085618: @ 8085618 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x0000405d - adds r0, r4, 0 - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _0808564C - adds r0, r4, 0 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bhi _0808564C - movs r0, 0 - ldrsb r0, [r5, r0] - cmp r0, 0xE - bne _0808564C - ldrb r0, [r5, 0x1] - subs r0, 0x9 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _08085654 -_0808564C: - movs r0, 0 - b _08085656 - .pool -_08085654: - movs r0, 0x1 -_08085656: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8085618 - - thumb_func_start warp_target_get_music -warp_target_get_music: @ 808565C - push {r4,lr} - adds r4, r0, 0 - bl sub_80855B4 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bne _08085674 - ldr r0, =0x0000ffff - b _080856CE - .pool -_08085674: - adds r0, r4, 0 - bl sub_8085558 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bne _0808568C - ldr r0, =0x000001bb - b _080856CE - .pool -_0808568C: - adds r0, r4, 0 - bl sub_8085618 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bne _080856A4 - ldr r0, =0x000001b9 - b _080856CE - .pool -_080856A4: - adds r0, r4, 0 - bl sub_80855E8 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - beq _080856CA - movs r0, 0 - ldrsb r0, [r4, r0] - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - ldrsb r1, [r4, r1] - lsls r1, 16 - lsrs r1, 16 - bl get_mapheader_by_bank_and_number - ldrh r0, [r0, 0x10] - b _080856CE -_080856CA: - movs r0, 0xCB - lsls r0, 1 -_080856CE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end warp_target_get_music - - thumb_func_start sav1_map_get_music -sav1_map_get_music: @ 80856D4 - push {r4,lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r1, [r0, 0x4] - movs r0, 0xD0 - lsls r0, 5 - cmp r1, r0 - bne _080856FC - bl sav1_get_weather_probably - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x8 - bne _080856FC - ldr r0, =0x00000199 - b _08085730 - .pool -_080856FC: - ldr r4, =0x03005d8c - ldr r0, [r4] - adds r0, 0x4 - bl warp_target_get_music - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =0x00007fff - cmp r1, r0 - beq _0808571C - adds r0, r1, 0 - b _08085730 - .pool -_0808571C: - ldr r0, [r4] - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0x17 - ble _0808572C - movs r0, 0xC9 - lsls r0, 1 - b _08085730 -_0808572C: - movs r0, 0xB4 - lsls r0, 1 -_08085730: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sav1_map_get_music - - thumb_func_start warp1_target_get_music -warp1_target_get_music: @ 8085738 - push {lr} - ldr r0, =0x020322e4 - bl warp_target_get_music - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =0x00007fff - cmp r1, r0 - beq _08085758 - adds r0, r1, 0 - b _08085774 - .pool -_08085758: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r1, [r0, 0x4] - movs r0, 0x80 - lsls r0, 2 - cmp r1, r0 - beq _08085770 - subs r0, 0x6E - b _08085774 - .pool -_08085770: - movs r0, 0xB4 - lsls r0, 1 -_08085774: - pop {r1} - bx r1 - thumb_func_end warp1_target_get_music - - thumb_func_start call_map_music_set_to_zero -call_map_music_set_to_zero: @ 8085778 - push {lr} - bl map_music_set_to_zero - pop {r0} - bx r0 - thumb_func_end call_map_music_set_to_zero - - thumb_func_start sub_8085784 -sub_8085784: @ 8085784 - push {r4,lr} - bl sav1_map_get_music - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x000001bb - cmp r4, r0 - beq _080857D6 - ldr r0, =0x0000ffff - cmp r4, r0 - beq _080857D6 - ldr r0, =0x03005d8c - ldr r1, [r0] - ldrh r0, [r1, 0x2C] - cmp r0, 0 - beq _080857B4 - adds r4, r0, 0 - b _080857D6 - .pool -_080857B4: - bl sav1_map_get_light_level - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - bne _080857C8 - ldr r4, =0x0000019b - b _080857D6 - .pool -_080857C8: - movs r0, 0x8 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _080857D6 - ldr r4, =0x0000016d -_080857D6: - bl current_map_music_get - lsls r0, 16 - lsrs r0, 16 - cmp r4, r0 - beq _080857E8 - adds r0, r4, 0 - bl current_map_music_set -_080857E8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8085784 - - thumb_func_start sav1_set_battle_music_maybe -sav1_set_battle_music_maybe: @ 80857F4 - ldr r1, =0x03005d8c - ldr r1, [r1] - strh r0, [r1, 0x2C] - bx lr - .pool - thumb_func_end sav1_set_battle_music_maybe - - thumb_func_start sav1_reset_battle_music_maybe -sav1_reset_battle_music_maybe: @ 8085800 - ldr r0, =0x03005d8c - ldr r1, [r0] - movs r0, 0 - strh r0, [r1, 0x2C] - bx lr - .pool - thumb_func_end sav1_reset_battle_music_maybe - - thumb_func_start sub_8085810 -sub_8085810: @ 8085810 - push {r4-r6,lr} - ldr r0, =0x00004001 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08085890 - bl warp1_target_get_music - lsls r0, 16 - lsrs r4, r0, 16 - bl current_map_music_get - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =0x000001bb - cmp r4, r0 - beq _08085856 - ldr r0, =0x0000ffff - cmp r4, r0 - beq _08085856 - ldr r0, =0x0000019b - cmp r5, r0 - beq _08085890 - ldr r6, =0x0000016d - cmp r5, r6 - beq _08085890 - movs r0, 0x8 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _08085856 - adds r4, r6, 0 -_08085856: - cmp r4, r5 - beq _08085890 - movs r0, 0x6 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _08085888 - adds r0, r4, 0 - movs r1, 0x4 - movs r2, 0x4 - bl sub_80A2FBC - b _08085890 - .pool -_08085888: - adds r0, r4, 0 - movs r1, 0x8 - bl sub_80A2F88 -_08085890: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8085810 - - thumb_func_start sub_8085898 -sub_8085898: @ 8085898 - push {r4,lr} - bl current_map_music_get - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl sav1_map_get_music - lsls r0, 16 - lsrs r0, 16 - cmp r4, r0 - beq _080858BE - bl sav1_map_get_music - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x8 - bl sub_80A2F88 -_080858BE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8085898 - - thumb_func_start sub_80858C4 -sub_80858C4: @ 80858C4 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - bl current_map_music_get - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r4 - beq _080858E4 - ldr r0, =0x000001bb - cmp r1, r0 - beq _080858E4 - adds r0, r4, 0 - movs r1, 0x8 - bl sub_80A2F88 -_080858E4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80858C4 - - thumb_func_start is_warp1_light_level_8_or_9 -is_warp1_light_level_8_or_9: @ 80858F0 - push {lr} - bl warp1_get_mapheader - ldrb r0, [r0, 0x17] - bl is_light_level_8_or_9 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08085908 - movs r0, 0x4 - b _0808590A -_08085908: - movs r0, 0x2 -_0808590A: - pop {r1} - bx r1 - thumb_func_end is_warp1_light_level_8_or_9 - - thumb_func_start music_something -music_something: @ 8085910 - push {r4,r5,lr} - bl current_map_music_get - lsls r0, 16 - lsrs r5, r0, 16 - bl warp1_target_get_music - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x00004001 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0808597E - bl current_map_music_get - lsls r0, 16 - lsrs r0, 16 - cmp r4, r0 - beq _0808597E - ldr r0, =0x0000016d - cmp r5, r0 - bne _08085972 - ldr r0, =0x000040ca - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bne _08085972 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x0000ffff - ldrh r2, [r0, 0x4] - movs r0, 0xE0 - lsls r0, 3 - cmp r2, r0 - bne _08085972 - ldr r3, =0x020322e4 - ldrh r0, [r3] - ands r1, r0 - cmp r1, r2 - bne _08085972 - ldr r1, [r3, 0x4] - ldr r0, =0x0035001d - cmp r1, r0 - beq _0808597E -_08085972: - bl is_warp1_light_level_8_or_9 - lsls r0, 24 - lsrs r0, 24 - bl sub_80A2F50 -_0808597E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end music_something - - thumb_func_start sub_80859A0 -sub_80859A0: @ 80859A0 - push {lr} - bl sub_80A303C - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_80859A0 - - thumb_func_start sub_80859B0 -sub_80859B0: @ 80859B0 - push {lr} - movs r0, 0x4 - bl sub_80A2F50 - pop {r0} - bx r0 - thumb_func_end sub_80859B0 - - thumb_func_start sub_80859BC -sub_80859BC: @ 80859BC - push {r4,lr} - sub sp, 0x4 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - ldr r0, =0x02032306 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080859F0 - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl MetatileBehavior_IsSurfableWaterOrUnderwater - lsls r0, 24 - cmp r0, 0 - beq _08085A2C -_080859F0: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x58 - bl __umodsi3 - adds r4, r0, 0 - adds r4, 0xD4 - lsls r4, 24 - lsrs r4, 24 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1E - bl __umodsi3 - adds r2, r0, 0 - adds r2, 0x32 - ldr r0, =0x02032304 - ldrh r0, [r0] - lsls r4, 24 - asrs r4, 24 - lsls r2, 24 - asrs r2, 24 - adds r1, r4, 0 - movs r3, 0x1 - bl sub_80A32C0 -_08085A2C: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80859BC - - thumb_func_start wild_encounter_related -wild_encounter_related: @ 8085A3C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r6, r0, 0 - adds r7, r1, 0 - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0x4 - bhi _08085B20 - lsls r0, 2 - ldr r1, =_08085A60 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08085A60: - .4byte _08085A74 - .4byte _08085A88 - .4byte _08085AA4 - .4byte _08085B0C - .4byte _08085B20 -_08085A74: - ldr r0, =0x02032304 - ldrh r0, [r0] - cmp r0, 0 - bne _08085A84 - movs r0, 0x4 - b _08085B1E - .pool -_08085A84: - movs r0, 0x1 - b _08085B1E -_08085A88: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x96 - lsls r1, 4 - bl __umodsi3 - movs r1, 0x96 - lsls r1, 3 - adds r0, r1 - strh r0, [r7] - movs r0, 0x3 - b _08085B1E -_08085AA4: - movs r0, 0x1 - mov r9, r0 - bl calc_player_party_count - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r5, 0 - b _08085ABC -_08085AB6: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_08085ABC: - cmp r5, r8 - bcs _08085AE4 - movs r0, 0x64 - muls r0, r5 - ldr r4, =0x020244ec - adds r0, r4 - movs r1, 0x6 - bl pokemon_getattr - cmp r0, 0 - bne _08085AB6 - adds r0, r4, 0 - bl GetMonAbility - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x44 - bne _08085AB6 - movs r1, 0x2 - mov r9, r1 -_08085AE4: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r4, 0x96 - lsls r4, 3 - adds r1, r4, 0 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - adds r0, r4 - mov r1, r9 - bl __divsi3 - strh r0, [r7] - movs r0, 0x3 - b _08085B1E - .pool -_08085B0C: - ldrh r0, [r7] - subs r0, 0x1 - strh r0, [r7] - lsls r0, 16 - cmp r0, 0 - bne _08085B20 - bl sub_80859BC - movs r0, 0x2 -_08085B1E: - strh r0, [r6] -_08085B20: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end wild_encounter_related - - thumb_func_start sub_8085B2C -sub_8085B2C: @ 8085B2C - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r1, [r0, 0x4] - movs r0, 0xB4 - lsls r0, 6 - cmp r1, r0 - bne _08085B5C - bl sub_813793C - lsls r0, 24 - cmp r0, 0 - bne _08085B5C - ldr r1, =0x02032306 - movs r0, 0x1 - strb r0, [r1] - bl sub_80B582C - b _08085B62 - .pool -_08085B5C: - ldr r0, =0x02032306 - bl wild_pokemon_rand_for_map -_08085B62: - ldr r1, =0x02032304 - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8085B2C - - thumb_func_start get_map_light_level_by_bank_and_number -@ int get_map_light_level_by_bank_and_number(int bank, int number) -get_map_light_level_by_bank_and_number: @ 8085B74 - push {lr} - lsls r0, 24 - asrs r0, 8 - lsrs r0, 16 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - bl get_mapheader_by_bank_and_number - ldrb r0, [r0, 0x17] - pop {r1} - bx r1 - thumb_func_end get_map_light_level_by_bank_and_number - - thumb_func_start get_map_light_level_from_warp -@ int get_map_light_level_from_warp(warpdata *warp) -get_map_light_level_from_warp: @ 8085B8C - push {lr} - movs r2, 0 - ldrsb r2, [r0, r2] - movs r1, 0x1 - ldrsb r1, [r0, r1] - adds r0, r2, 0 - bl get_map_light_level_by_bank_and_number - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end get_map_light_level_from_warp - - thumb_func_start sav1_map_get_light_level -sav1_map_get_light_level: @ 8085BA4 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - adds r0, 0x4 - bl get_map_light_level_from_warp - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sav1_map_get_light_level - - thumb_func_start get_map_light_from_warp0 -get_map_light_from_warp0: @ 8085BBC - push {lr} - ldr r0, =0x020322dc - bl get_map_light_level_from_warp - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end get_map_light_from_warp0 - - thumb_func_start is_light_level_1_2_3_5_or_6 -is_light_level_1_2_3_5_or_6: @ 8085BD0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - beq _08085BEA - cmp r0, 0x1 - beq _08085BEA - cmp r0, 0x5 - beq _08085BEA - cmp r0, 0x2 - beq _08085BEA - cmp r0, 0x6 - bne _08085BEE -_08085BEA: - movs r0, 0x1 - b _08085BF0 -_08085BEE: - movs r0, 0 -_08085BF0: - pop {r1} - bx r1 - thumb_func_end is_light_level_1_2_3_5_or_6 - - thumb_func_start is_light_level_1_2_3_or_6 -is_light_level_1_2_3_or_6: @ 8085BF4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - beq _08085C0A - cmp r0, 0x1 - beq _08085C0A - cmp r0, 0x6 - beq _08085C0A - cmp r0, 0x2 - bne _08085C0E -_08085C0A: - movs r0, 0x1 - b _08085C10 -_08085C0E: - movs r0, 0 -_08085C10: - pop {r1} - bx r1 - thumb_func_end is_light_level_1_2_3_or_6 - - thumb_func_start is_light_level_8_or_9 -is_light_level_8_or_9: @ 8085C14 - push {lr} - lsls r0, 24 - movs r1, 0xF8 - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1 - bls _08085C28 - movs r0, 0 - b _08085C2A -_08085C28: - movs r0, 0x1 -_08085C2A: - pop {r1} - bx r1 - thumb_func_end is_light_level_8_or_9 - - thumb_func_start sav1_saved_warp2_map_get_name -sav1_saved_warp2_map_get_name: @ 8085C30 - push {lr} - ldr r0, =0x03005d8c - ldr r1, [r0] - movs r0, 0x14 - ldrsb r0, [r1, r0] - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r1, 0x15] - lsls r1, 24 - asrs r1, 24 - lsls r1, 16 - lsrs r1, 16 - bl get_mapheader_by_bank_and_number - ldrb r0, [r0, 0x14] - pop {r1} - bx r1 - .pool - thumb_func_end sav1_saved_warp2_map_get_name - - thumb_func_start sav1_map_get_name -sav1_map_get_name: @ 8085C58 - push {lr} - ldr r0, =0x03005d8c - ldr r1, [r0] - movs r0, 0x4 - ldrsb r0, [r1, r0] - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r1, 0x5] - lsls r1, 24 - asrs r1, 24 - lsls r1, 16 - lsrs r1, 16 - bl get_mapheader_by_bank_and_number - ldrb r0, [r0, 0x14] - pop {r1} - bx r1 - .pool - thumb_func_end sav1_map_get_name - - thumb_func_start sav1_map_get_battletype -sav1_map_get_battletype: @ 8085C80 - push {lr} - ldr r0, =0x03005d8c - ldr r1, [r0] - movs r0, 0x4 - ldrsb r0, [r1, r0] - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r1, 0x5] - lsls r1, 24 - asrs r1, 24 - lsls r1, 16 - lsrs r1, 16 - bl get_mapheader_by_bank_and_number - ldrb r0, [r0, 0x1B] - pop {r1} - bx r1 - .pool - thumb_func_end sav1_map_get_battletype - - thumb_func_start overworld_bg_setup -@ void overworld_bg_setup() -overworld_bg_setup: @ 8085CA8 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r1, =gUnknown_08339DAC - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - movs r0, 0x1 - movs r1, 0x5 - movs r2, 0x1 - bl SetBgAttribute - movs r0, 0x2 - movs r1, 0x5 - movs r2, 0x1 - bl SetBgAttribute - movs r0, 0x3 - movs r1, 0x5 - movs r2, 0x1 - bl SetBgAttribute - ldr r0, =0x03005da0 - mov r8, r0 - movs r4, 0x80 - lsls r4, 4 - adds r0, r4, 0 - bl AllocZeroed - mov r1, r8 - str r0, [r1] - ldr r6, =0x03005d9c - adds r0, r4, 0 - bl AllocZeroed - str r0, [r6] - ldr r5, =0x03005da4 - adds r0, r4, 0 - bl AllocZeroed - str r0, [r5] - mov r0, r8 - ldr r1, [r0] - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r6] - movs r0, 0x2 - bl SetBgTilemapBuffer - ldr r1, [r5] - movs r0, 0x3 - bl SetBgTilemapBuffer - bl sub_81971D0 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end overworld_bg_setup - - thumb_func_start overworld_free_bg_tilemaps -overworld_free_bg_tilemaps: @ 8085D34 - push {r4,lr} - bl sub_81BE72C - bl sub_81971F4 - ldr r4, =0x03005da4 - ldr r0, [r4] - cmp r0, 0 - beq _08085D4E - bl Free - movs r0, 0 - str r0, [r4] -_08085D4E: - ldr r4, =0x03005d9c - ldr r0, [r4] - cmp r0, 0 - beq _08085D5E - bl Free - movs r0, 0 - str r0, [r4] -_08085D5E: - ldr r4, =0x03005da0 - ldr r0, [r4] - cmp r0, 0 - beq _08085D6E - bl Free - movs r0, 0 - str r0, [r4] -_08085D6E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end overworld_free_bg_tilemaps - - thumb_func_start ResetSafariZoneFlag_ -ResetSafariZoneFlag_: @ 8085D80 - push {lr} - bl ResetSafariZoneFlag - pop {r0} - bx r0 - thumb_func_end ResetSafariZoneFlag_ - - thumb_func_start is_c1_link_related_active -@ _BOOL4 is_c1_link_related_active() -is_c1_link_related_active: @ 8085D8C - push {lr} - ldr r0, =0x030022c0 - ldr r1, [r0] - ldr r0, =c1_link_related - cmp r1, r0 - beq _08085DA4 - movs r0, 0 - b _08085DA6 - .pool -_08085DA4: - movs r0, 0x1 -_08085DA6: - pop {r1} - bx r1 - thumb_func_end is_c1_link_related_active - - thumb_func_start c1_overworld_normal -@ void c1_overworld_normal(int buttons_new, int buttons_held) -c1_overworld_normal: @ 8085DAC - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 16 - lsrs r0, 16 - adds r5, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r4, r1, 0 - bl sub_808B578 - mov r6, sp - mov r0, sp - bl sub_809BEDC - mov r0, sp - adds r1, r5, 0 - adds r2, r4, 0 - bl process_overworld_input - bl script_env_2_is_enabled - lsls r0, 24 - cmp r0, 0 - bne _08085DFA - mov r0, sp - bl sub_809C014 - cmp r0, 0x1 - bne _08085DF0 - bl script_env_2_enable - bl HideMapNamePopUpWindow - b _08085DFA -_08085DF0: - ldrb r0, [r6, 0x2] - adds r1, r5, 0 - adds r2, r4, 0 - bl player_step -_08085DFA: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end c1_overworld_normal - - thumb_func_start c1_overworld -c1_overworld: @ 8085E04 - push {lr} - ldr r2, =0x030022c0 - ldr r1, [r2, 0x4] - ldr r0, =c2_overworld - cmp r1, r0 - bne _08085E18 - ldrh r0, [r2, 0x2E] - ldrh r1, [r2, 0x2C] - bl c1_overworld_normal -_08085E18: - pop {r0} - bx r0 - .pool - thumb_func_end c1_overworld - - thumb_func_start c2_overworld_basic -@ void c2_overworld_basic() -c2_overworld_basic: @ 8085E24 - push {lr} - bl script_env_2_run_current_script - bl RunActiveTasks - bl CallObjectCallbacks - bl CameraUpdate - bl UpdateCameraPanning - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - bl sub_80A0A38 - bl do_scheduled_bg_tilemap_copies_to_vram - pop {r0} - bx r0 - thumb_func_end c2_overworld_basic - - thumb_func_start sub_8085E50 -sub_8085E50: @ 8085E50 - push {lr} - bl c2_overworld_basic - pop {r0} - bx r0 - thumb_func_end sub_8085E50 - - thumb_func_start c2_overworld -c2_overworld: @ 8085E5C - push {r4,lr} - ldr r0, =0x02037fd4 - ldrb r0, [r0, 0x7] - lsrs r0, 7 - adds r4, r0, 0 - cmp r4, 0 - beq _08085E70 - movs r0, 0 - bl SetVBlankCallback -_08085E70: - bl c2_overworld_basic - cmp r4, 0 - beq _08085E7C - bl SetFieldVBlankCallback -_08085E7C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end c2_overworld - - thumb_func_start set_callback1 -set_callback1: @ 8085E88 - ldr r1, =0x030022c0 - str r0, [r1] - bx lr - .pool - thumb_func_end set_callback1 - - thumb_func_start sub_8085E94 -sub_8085E94: @ 8085E94 - ldr r1, =0x03000e0c - str r0, [r1] - bx lr - .pool - thumb_func_end sub_8085E94 - - thumb_func_start map_post_load_hook_exec -map_post_load_hook_exec: @ 8085EA0 - push {r4,lr} - ldr r4, =0x03005db0 - ldr r0, [r4] - cmp r0, 0 - beq _08085ECC - bl _call_via_r0 - lsls r0, 24 - cmp r0, 0 - bne _08085EBC - movs r0, 0 - b _08085EEC - .pool -_08085EBC: - movs r1, 0 - str r1, [r4] - ldr r0, =0x03005dac - str r1, [r0] - b _08085EEA - .pool -_08085ECC: - ldr r0, =0x03005dac - ldr r0, [r0] - cmp r0, 0 - beq _08085EE0 - bl _call_via_r0 - b _08085EE4 - .pool -_08085EE0: - bl mapldr_default -_08085EE4: - ldr r1, =0x03005dac - movs r0, 0 - str r0, [r1] -_08085EEA: - movs r0, 0x1 -_08085EEC: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end map_post_load_hook_exec - - thumb_func_start CB2_NewGame -CB2_NewGame: @ 8085EF8 - push {lr} - bl sub_808631C - bl sub_80A2F30 - bl ResetSafariZoneFlag_ - bl NewGameInitData - bl player_avatar_init_params_reset - bl set_max_playtime_if_appropriate - bl script_env_1_init - bl script_env_2_disable - ldr r1, =0x03005dac - ldr r0, =sub_80FB4E0 - str r0, [r1] - ldr r1, =0x03005db0 - movs r0, 0 - str r0, [r1] - ldr r0, =0x030026f8 - bl do_load_map_stuff_loop - bl SetFieldVBlankCallback - ldr r0, =c1_overworld - bl set_callback1 - ldr r0, =c2_overworld - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end CB2_NewGame - - thumb_func_start c2_whiteout -c2_whiteout: @ 8085F58 - push {lr} - sub sp, 0x4 - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x77 - bls _08085FB0 - bl sub_808631C - bl sub_80A2F30 - bl ResetSafariZoneFlag_ - bl sub_8084620 - bl player_avatar_init_params_reset - bl script_env_1_init - bl script_env_2_disable - ldr r1, =0x03005dac - ldr r0, =sub_80AF3C8 - str r0, [r1] - mov r1, sp - movs r0, 0 - strb r0, [r1] - mov r0, sp - bl do_load_map_stuff_loop - bl SetFieldVBlankCallback - ldr r0, =c1_overworld - bl set_callback1 - ldr r0, =c2_overworld - bl SetMainCallback2 -_08085FB0: - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end c2_whiteout - - thumb_func_start c2_load_new_map -c2_load_new_map: @ 8085FCC - push {lr} - bl sub_808631C - bl script_env_1_init - bl script_env_2_disable - movs r0, 0 - bl set_callback1 - ldr r0, =c2_change_map - bl SetMainCallback2 - ldr r1, =0x030022c0 - ldr r0, =c2_load_new_map_2 - str r0, [r1, 0x8] - pop {r0} - bx r0 - .pool - thumb_func_end c2_load_new_map - - thumb_func_start c2_load_new_map_2 -c2_load_new_map_2: @ 8085FFC - push {lr} - ldr r0, =0x030026f8 - bl do_load_map_stuff_loop - bl SetFieldVBlankCallback - ldr r0, =c1_overworld - bl set_callback1 - ldr r0, =c2_overworld - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end c2_load_new_map_2 - - thumb_func_start sub_8086024 -sub_8086024: @ 8086024 - push {r4,lr} - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r4, r0, r1 - ldrb r0, [r4] - cmp r0, 0 - bne _08086046 - bl sub_808631C - bl script_env_1_init - bl script_env_2_disable - movs r0, 0 - bl set_callback1 -_08086046: - adds r0, r4, 0 - movs r1, 0x1 - bl load_map_stuff - cmp r0, 0 - beq _08086062 - bl SetFieldVBlankCallback - ldr r0, =c1_overworld - bl set_callback1 - ldr r0, =c2_overworld - bl SetMainCallback2 -_08086062: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086024 - - thumb_func_start sub_8086074 -sub_8086074: @ 8086074 - push {lr} - bl sub_808631C - ldr r0, =0x03005dac - ldr r1, =sub_80AF314 - str r1, [r0] - ldr r0, =c2_80567AC - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086074 - - thumb_func_start c2_80567AC -c2_80567AC: @ 8086098 - push {lr} - ldr r0, =0x030026f8 - bl map_loading_iteration_3 - cmp r0, 0 - beq _080860B8 - bl SetFieldVBlankCallback - ldr r0, =c1_link_related - bl set_callback1 - bl sub_8086C2C - ldr r0, =c2_overworld - bl SetMainCallback2 -_080860B8: - pop {r0} - bx r0 - .pool - thumb_func_end c2_80567AC - - thumb_func_start c2_exit_to_overworld_2_switch -c2_exit_to_overworld_2_switch: @ 80860C8 - push {lr} - bl is_c1_link_related_active - cmp r0, 0x1 - bne _080860E0 - ldr r0, =c2_exit_to_overworld_2_link - bl SetMainCallback2 - b _080860EA - .pool -_080860E0: - bl sub_808631C - ldr r0, =c2_exit_to_overworld_2_local - bl SetMainCallback2 -_080860EA: - pop {r0} - bx r0 - .pool - thumb_func_end c2_exit_to_overworld_2_switch - - thumb_func_start c2_exit_to_overworld_2_local -c2_exit_to_overworld_2_local: @ 80860F4 - push {lr} - ldr r0, =0x030026f8 - bl sub_8086638 - cmp r0, 0 - beq _0808610A - bl SetFieldVBlankCallback - ldr r0, =c2_overworld - bl SetMainCallback2 -_0808610A: - pop {r0} - bx r0 - .pool - thumb_func_end c2_exit_to_overworld_2_local - - thumb_func_start c2_exit_to_overworld_2_link -c2_exit_to_overworld_2_link: @ 8086118 - push {lr} - bl sub_8087598 - cmp r0, 0 - bne _08086132 - ldr r0, =0x030026f8 - bl map_loading_iteration_2_link - cmp r0, 0 - beq _08086132 - ldr r0, =c2_overworld - bl SetMainCallback2 -_08086132: - pop {r0} - bx r0 - .pool - thumb_func_end c2_exit_to_overworld_2_link - - thumb_func_start c2_8056854 -c2_8056854: @ 8086140 - push {lr} - bl sub_808631C - bl sub_80A2F30 - ldr r0, =c1_link_related - bl set_callback1 - bl sub_8086C2C - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08086174 - ldr r1, =0x03005dac - ldr r0, =sub_80AF314 - b _08086178 - .pool -_08086174: - ldr r1, =0x03005dac - ldr r0, =sub_80AF214 -_08086178: - str r0, [r1] - bl script_env_1_init - bl script_env_2_disable - bl c2_exit_to_overworld_2_switch - pop {r0} - bx r0 - .pool - thumb_func_end c2_8056854 - - thumb_func_start sub_8086194 -sub_8086194: @ 8086194 - push {lr} - bl sub_808631C - ldr r1, =0x03005db0 - ldr r0, =sub_80AF6A4 - str r0, [r1] - bl c2_exit_to_overworld_2_switch - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086194 - - thumb_func_start sub_80861B0 -sub_80861B0: @ 80861B0 - push {lr} - bl sub_808631C - ldr r1, =0x03005dac - ldr r0, =sub_80AF188 - str r0, [r1] - bl c2_exit_to_overworld_2_switch - pop {r0} - bx r0 - .pool - thumb_func_end sub_80861B0 - - thumb_func_start c2_exit_to_overworld_1_continue_scripts_restart_music -c2_exit_to_overworld_1_continue_scripts_restart_music: @ 80861CC - push {lr} - bl sub_808631C - ldr r1, =0x03005dac - ldr r0, =sub_80AF168 - str r0, [r1] - bl c2_exit_to_overworld_2_switch - pop {r0} - bx r0 - .pool - thumb_func_end c2_exit_to_overworld_1_continue_scripts_restart_music - - thumb_func_start sub_80861E8 -sub_80861E8: @ 80861E8 - push {lr} - bl sub_808631C - ldr r1, =0x03005dac - ldr r0, =sub_80AF3C8 - str r0, [r1] - bl c2_exit_to_overworld_2_switch - pop {r0} - bx r0 - .pool - thumb_func_end sub_80861E8 - - thumb_func_start sub_8086204 -sub_8086204: @ 8086204 - push {lr} - ldr r0, =0x02037318 - ldrb r1, [r0, 0x1A] - movs r0, 0xF8 - ands r0, r1 - cmp r0, 0x8 - bne _08086222 - bl sub_80E909C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08086222 - bl AddMapNamePopUpWindowTask -_08086222: - bl sub_80AF3C8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086204 - - thumb_func_start sub_8086230 -sub_8086230: @ 8086230 - push {r4,lr} - bl sub_808631C - bl sub_80A2F30 - bl ResetSafariZoneFlag_ - ldr r0, =0x03006210 - ldrh r0, [r0] - cmp r0, 0xFF - bne _0808624A - bl sub_81A3908 -_0808624A: - bl set_current_map_header_from_sav1 - bl set_warp2_warp3_to_neg_1 - bl GetCurrentTrainerHillMapId - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037318 - ldrh r1, [r0, 0x12] - ldr r0, =0x00000169 - cmp r1, r0 - bne _08086278 - bl sub_81AA2F8 - b _0808628A - .pool -_08086278: - cmp r4, 0 - beq _08086286 - cmp r4, 0x6 - beq _08086286 - bl sub_81D5F48 - b _0808628A -_08086286: - bl CopyFieldObjectTemplateCoordsToSav1 -_0808628A: - bl sub_809757C - bl sub_809E7B0 - bl sub_8084788 - ldr r0, =0x02037318 - ldrh r1, [r0, 0x12] - ldr r0, =0x00000169 - cmp r1, r0 - bne _080862B0 - movs r0, 0x1 - bl battle_pyramid_map_load_related - b _080862BE - .pool -_080862B0: - cmp r4, 0 - beq _080862BA - bl trainer_hill_map_load_related - b _080862BE -_080862BA: - bl sub_8087D74 -_080862BE: - bl set_max_playtime_if_appropriate - bl script_env_1_init - bl script_env_2_disable - bl sub_8195E10 - bl sav2_x1_query_bit1 - cmp r0, 0x1 - bne _080862F4 - bl sav2_x9_clear_bit1 - bl warp1_set_to_sav1w - bl warp_in - bl sub_80EDB44 - ldr r0, =c2_load_new_map - bl SetMainCallback2 - b _08086308 - .pool -_080862F4: - bl sub_80EDB44 - ldr r0, =0x03005dac - ldr r1, =sub_8086204 - str r1, [r0] - ldr r0, =c1_overworld - bl set_callback1 - bl c2_exit_to_overworld_2_switch -_08086308: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086230 - - thumb_func_start sub_808631C -@ void sub_808631C() -sub_808631C: @ 808631C - push {r4,lr} - bl warp0_in_pokecenter - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0808632E - bl sub_80097E8 -_0808632E: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08086348 - movs r0, 0xC5 - bl EnableInterrupts - movs r0, 0x2 - bl DisableInterrupts - b _08086362 - .pool -_08086348: - ldr r4, =0x04000208 - ldrh r3, [r4] - strh r0, [r4] - ldr r2, =0x04000200 - ldrh r1, [r2] - ldr r0, =0x0000fffd - ands r0, r1 - strh r0, [r2] - ldrh r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strh r0, [r2] - strh r3, [r4] -_08086362: - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - bl SetHBlankCallback - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808631C - - thumb_func_start SetFieldVBlankCallback -@ void SetFieldVBlankCallback() -SetFieldVBlankCallback: @ 8086380 - push {lr} - ldr r0, =VBlankCB_Field - bl SetVBlankCallback - pop {r0} - bx r0 - .pool - thumb_func_end SetFieldVBlankCallback - - thumb_func_start VBlankCB_Field -VBlankCB_Field: @ 8086390 - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl sub_80BA0A8 - bl FieldUpdateBgTilemapScroll - bl copy_pal_bg_faded_to_pal_ram - bl sub_80A09D0 - pop {r0} - bx r0 - thumb_func_end VBlankCB_Field - - thumb_func_start sub_80863B0 -sub_80863B0: @ 80863B0 - push {lr} - bl sub_81A9E6C - lsls r0, 24 - cmp r0, 0 - beq _080863D4 - bl door_upload_tiles - ldr r2, =gUnknown_08339DBC - ldr r0, [r2] - ldr r1, [r2, 0x4] - ldr r2, [r2, 0x8] - bl sub_80BA038 - b _080863F0 - .pool -_080863D4: - bl sav1_get_flash_used_on_map - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _080863F0 - bl sub_80B00E8 - ldr r2, =gUnknown_08339DBC - ldr r0, [r2] - ldr r1, [r2, 0x4] - ldr r2, [r2, 0x8] - bl sub_80BA038 -_080863F0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80863B0 - - thumb_func_start map_loading_iteration_3 -map_loading_iteration_3: @ 80863F8 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0xD - bls _08086404 - b _08086512 -_08086404: - lsls r0, 2 - ldr r1, =_08086414 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08086414: - .4byte _0808644C - .4byte _08086462 - .4byte _0808646A - .4byte _08086472 - .4byte _08086484 - .4byte _08086492 - .4byte _08086498 - .4byte _080864A8 - .4byte _080864B8 - .4byte _080864D4 - .4byte _080864DA - .4byte _080864E0 - .4byte _080864FC - .4byte _0808650E -_0808644C: - bl overworld_bg_setup - bl script_env_1_init - bl script_env_2_disable - bl saveblock_randomize_and_relocate_ - bl sub_80867D8 - b _08086506 -_08086462: - movs r0, 0x1 - bl mli0_load_map - b _08086506 -_0808646A: - movs r0, 0x1 - bl sub_8086988 - b _08086506 -_08086472: - bl sub_8086AE4 - bl sub_80869DC - bl sub_8086B14 - bl sub_8086AAC - b _08086506 -_08086484: - bl sub_80863B0 - bl map_loading_lcd_reset - bl sub_8197200 - b _08086506 -_08086492: - bl move_tilemap_camera_to_upper_left_corner - b _08086506 -_08086498: - ldr r0, =0x02037318 - ldr r0, [r0] - bl copy_map_tileset1_to_vram - b _08086506 - .pool -_080864A8: - ldr r0, =0x02037318 - ldr r0, [r0] - bl copy_map_tileset2_to_vram - b _08086506 - .pool -_080864B8: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08086512 - ldr r0, =0x02037318 - ldr r0, [r0] - bl apply_map_tileset1_tileset2_palette - b _08086506 - .pool -_080864D4: - bl DrawWholeMapView - b _08086506 -_080864DA: - bl cur_mapheader_run_tileset_funcs_after_some_cpuset - b _08086506 -_080864E0: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08086506 - bl sub_800E0E8 - movs r0, 0 - movs r1, 0 - bl sub_800DFB4 - b _08086506 - .pool -_080864FC: - bl map_post_load_hook_exec - lsls r0, 24 - cmp r0, 0 - beq _08086512 -_08086506: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _08086512 -_0808650E: - movs r0, 0x1 - b _08086514 -_08086512: - movs r0, 0 -_08086514: - pop {r4} - pop {r1} - bx r1 - thumb_func_end map_loading_iteration_3 - - thumb_func_start load_map_stuff -@ int load_map_stuff(u8 *a1, int a2) -load_map_stuff: @ 808651C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4] - cmp r0, 0xD - bls _0808652A - b _0808662E -_0808652A: - lsls r0, 2 - ldr r1, =_08086538 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08086538: - .4byte _08086570 - .4byte _0808657C - .4byte _08086586 - .4byte _0808658E - .4byte _08086598 - .4byte _080865A6 - .4byte _080865AC - .4byte _080865BC - .4byte _080865CC - .4byte _080865E8 - .4byte _080865EE - .4byte _080865F4 - .4byte _08086618 - .4byte _0808662A -_08086570: - bl sub_808631C - adds r0, r5, 0 - bl mli0_load_map - b _08086622 -_0808657C: - bl saveblock_randomize_and_relocate_ - bl sub_80867D8 - b _08086622 -_08086586: - adds r0, r5, 0 - bl sub_8086988 - b _08086622 -_0808658E: - bl mli4_mapscripts_and_other - bl sub_8086A80 - b _08086622 -_08086598: - bl sub_80863B0 - bl map_loading_lcd_reset - bl sub_8197200 - b _08086622 -_080865A6: - bl move_tilemap_camera_to_upper_left_corner - b _08086622 -_080865AC: - ldr r0, =0x02037318 - ldr r0, [r0] - bl copy_map_tileset1_to_vram - b _08086622 - .pool -_080865BC: - ldr r0, =0x02037318 - ldr r0, [r0] - bl copy_map_tileset2_to_vram - b _08086622 - .pool -_080865CC: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0808662E - ldr r0, =0x02037318 - ldr r0, [r0] - bl apply_map_tileset1_tileset2_palette - b _08086622 - .pool -_080865E8: - bl DrawWholeMapView - b _08086622 -_080865EE: - bl cur_mapheader_run_tileset_funcs_after_some_cpuset - b _08086622 -_080865F4: - ldr r0, =0x02037318 - ldrb r1, [r0, 0x1A] - movs r0, 0xF8 - ands r0, r1 - cmp r0, 0x8 - bne _08086622 - bl sub_80E909C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08086622 - bl AddMapNamePopUpWindowTask - b _08086622 - .pool -_08086618: - bl map_post_load_hook_exec - lsls r0, 24 - cmp r0, 0 - beq _0808662E -_08086622: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _0808662E -_0808662A: - movs r0, 0x1 - b _08086630 -_0808662E: - movs r0, 0 -_08086630: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end load_map_stuff - - thumb_func_start sub_8086638 -sub_8086638: @ 8086638 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0x1 - beq _0808666E - cmp r0, 0x1 - bgt _0808664C - cmp r0, 0 - beq _08086656 - b _0808668E -_0808664C: - cmp r0, 0x2 - beq _08086678 - cmp r0, 0x3 - beq _0808668A - b _0808668E -_08086656: - bl saveblock_randomize_and_relocate_ - bl sub_80867D8 - movs r0, 0 - bl sub_8086988 - bl sub_8086A68 - bl sub_8086A80 - b _08086682 -_0808666E: - bl sub_8086860 - bl sub_81D64C0 - b _08086682 -_08086678: - bl map_post_load_hook_exec - lsls r0, 24 - cmp r0, 0 - beq _0808668E -_08086682: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _0808668E -_0808668A: - movs r0, 0x1 - b _08086690 -_0808668E: - movs r0, 0 -_08086690: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8086638 - - thumb_func_start map_loading_iteration_2_link -map_loading_iteration_2_link: @ 8086698 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0xD - bls _080866A4 - b _080867A8 -_080866A4: - lsls r0, 2 - ldr r1, =_080866B4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080866B4: - .4byte _080866EC - .4byte _080866FA - .4byte _08086702 - .4byte _08086710 - .4byte _0808671E - .4byte _08086724 - .4byte _08086734 - .4byte _08086744 - .4byte _08086760 - .4byte _08086766 - .4byte _08086792 - .4byte _0808676C - .4byte _08086788 - .4byte _0808679A -_080866EC: - bl sub_808631C - bl saveblock_randomize_and_relocate_ - bl sub_80867D8 - b _08086792 -_080866FA: - movs r0, 0x1 - bl sub_8086988 - b _08086792 -_08086702: - bl sub_8086B9C - bl sub_8086A68 - bl sub_8086AC8 - b _08086792 -_08086710: - bl sub_80863B0 - bl map_loading_lcd_reset - bl sub_8197200 - b _08086792 -_0808671E: - bl move_tilemap_camera_to_upper_left_corner - b _08086792 -_08086724: - ldr r0, =0x02037318 - ldr r0, [r0] - bl copy_map_tileset1_to_vram - b _08086792 - .pool -_08086734: - ldr r0, =0x02037318 - ldr r0, [r0] - bl copy_map_tileset2_to_vram - b _08086792 - .pool -_08086744: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080867A8 - ldr r0, =0x02037318 - ldr r0, [r0] - bl apply_map_tileset1_tileset2_palette - b _08086792 - .pool -_08086760: - bl DrawWholeMapView - b _08086792 -_08086766: - bl cur_mapheader_run_tileset_funcs_after_some_cpuset - b _08086792 -_0808676C: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08086792 - bl sub_800E0E8 - movs r0, 0 - movs r1, 0 - bl sub_800DFB4 - b _08086792 - .pool -_08086788: - bl map_post_load_hook_exec - lsls r0, 24 - cmp r0, 0 - beq _080867A8 -_08086792: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _080867A8 -_0808679A: - bl SetFieldVBlankCallback - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - movs r0, 0x1 - b _080867AA -_080867A8: - movs r0, 0 -_080867AA: - pop {r4} - pop {r1} - bx r1 - thumb_func_end map_loading_iteration_2_link - - thumb_func_start do_load_map_stuff_loop -do_load_map_stuff_loop: @ 80867B0 - push {r4,lr} - adds r4, r0, 0 -_080867B4: - adds r0, r4, 0 - movs r1, 0 - bl load_map_stuff - cmp r0, 0 - beq _080867B4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end do_load_map_stuff_loop - - thumb_func_start saveblock_randomize_and_relocate_ -saveblock_randomize_and_relocate_: @ 80867C8 - push {lr} - bl sub_81BE6AC - bl saveblock_randomize_and_relocate - pop {r0} - bx r0 - thumb_func_end saveblock_randomize_and_relocate_ - - thumb_func_start sub_80867D8 -sub_80867D8: @ 80867D8 - push {r4-r7,lr} - sub sp, 0x4 - movs r0, 0 - movs r1, 0 - bl SetGpuReg - bl remove_some_task - ldr r2, =0x05000002 - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r1, =0x040000d4 - mov r0, sp - str r0, [r1] - str r2, [r1, 0x4] - ldr r0, =0x810001ff - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - movs r2, 0xC0 - lsls r2, 19 - movs r3, 0xC0 - lsls r3, 9 - mov r4, sp - movs r6, 0 - movs r5, 0x80 - lsls r5, 5 - ldr r7, =0x81000800 - movs r0, 0x81 - lsls r0, 24 - mov r12, r0 -_08086816: - strh r6, [r4] - mov r0, sp - str r0, [r1] - str r2, [r1, 0x4] - str r7, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r2, r5 - subs r3, r5 - cmp r3, r5 - bhi _08086816 - strh r6, [r4] - mov r0, sp - str r0, [r1] - str r2, [r1, 0x4] - lsrs r0, r3, 1 - mov r2, r12 - orrs r0, r2 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - movs r0, 0 - movs r1, 0x80 - bl ResetSpriteRange - bl LoadOamFromSprites - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80867D8 - - thumb_func_start sub_8086860 -sub_8086860: @ 8086860 - push {lr} - bl sub_80863B0 - bl map_loading_lcd_reset - bl sub_8197200 - bl mapdata_load_assets_to_gpu_and_full_redraw - pop {r0} - bx r0 - thumb_func_end sub_8086860 - - thumb_func_start map_loading_lcd_reset -map_loading_lcd_reset: @ 8086878 - push {r4,lr} - bl clear_scheduled_bg_copies_to_vram - bl reset_temp_tile_data_buffers - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - ldr r1, =0x00001f1f - movs r0, 0x48 - bl SetGpuReg - ldr r1, =0x00000101 - movs r0, 0x4A - bl SetGpuReg - movs r0, 0x40 - movs r1, 0xFF - bl SetGpuReg - movs r0, 0x44 - movs r1, 0xFF - bl SetGpuReg - ldr r4, =0x0000ffff - movs r0, 0x42 - adds r1, r4, 0 - bl SetGpuReg - movs r0, 0x46 - adds r1, r4, 0 - bl SetGpuReg - ldr r0, =gUnknown_82EC7C4 - ldrh r1, [r0, 0x2] - ldrh r2, [r0, 0x4] - orrs r1, r2 - ldrh r0, [r0, 0x6] - orrs r1, r0 - movs r2, 0x82 - lsls r2, 5 - adds r0, r2, 0 - orrs r1, r0 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x0000070d - movs r0, 0x52 - bl SetGpuReg - bl overworld_bg_setup - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x3 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - ldr r1, =0x00007060 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - bl sub_8098128 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end map_loading_lcd_reset - - thumb_func_start sub_8086988 -sub_8086988: @ 8086988 - push {r4,lr} - adds r4, r0, 0 - bl clear_tasks - bl ResetAllObjectData - bl sub_80A1A74 - bl dp12_8087EA4 - bl dp13_810BB8C - bl ResetCameraUpdateInfo - bl InstallCameraPanAheadCallback - cmp r4, 0 - bne _080869B4 - movs r0, 0 - bl npc_paltag_set_load - b _080869BA -_080869B4: - movs r0, 0x1 - bl npc_paltag_set_load -_080869BA: - bl FieldEffectActiveListClear - bl sub_80AAFA4 - bl sub_80AEE84 - cmp r4, 0 - bne _080869CE - bl overworld_ensure_per_step_coros_running -_080869CE: - bl mapheader_run_script_with_tag_x5 - bl sub_81BE6B8 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8086988 - - thumb_func_start sub_80869DC -sub_80869DC: @ 80869DC - push {lr} - ldr r0, =0x03005dec - movs r1, 0 - strh r1, [r0] - ldr r0, =0x03005de8 - strh r1, [r0] - bl sub_808D438 - movs r0, 0 - movs r1, 0 - bl SpawnFieldObjectsInView - bl mapheader_run_first_tag4_script_list_match - pop {r0} - bx r0 - .pool - thumb_func_end sub_80869DC - - thumb_func_start mli4_mapscripts_and_other -mli4_mapscripts_and_other: @ 8086A04 - push {r4,r5,lr} - sub sp, 0x4 - ldr r0, =0x03005dec - movs r1, 0 - strh r1, [r0] - ldr r0, =0x03005de8 - strh r1, [r0] - bl sub_808D438 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl sav1_camera_get_focus_coords - bl sub_80852D4 - adds r5, r0, 0 - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - ldrb r2, [r5, 0x1] - ldr r3, =0x03005d90 - ldr r3, [r3] - ldrb r3, [r3, 0x8] - bl InitPlayerAvatar - ldrb r0, [r5] - bl SetPlayerAvatarTransitionFlags - bl player_avatar_init_params_reset - movs r0, 0 - movs r1, 0 - bl SpawnFieldObjectsInView - bl mapheader_run_first_tag4_script_list_match - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end mli4_mapscripts_and_other - - thumb_func_start sub_8086A68 -sub_8086A68: @ 8086A68 - push {lr} - movs r0, 0 - movs r1, 0 - bl sub_808E16C - bl sub_80FBED0 - bl mapheader_run_script_with_tag_x7 - pop {r0} - bx r0 - thumb_func_end sub_8086A68 - - thumb_func_start sub_8086A80 -sub_8086A80: @ 8086A80 - push {lr} - ldr r2, =0x02037350 - ldr r3, =0x02037590 - ldrb r1, [r3, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x1] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0, 0x1] - ldrb r0, [r3, 0x4] - bl InitCameraUpdateCallback - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086A80 - - thumb_func_start sub_8086AAC -sub_8086AAC: @ 8086AAC - push {lr} - ldr r0, =0x03005db4 - ldrb r0, [r0] - bl sub_8087858 - lsls r0, 24 - lsrs r0, 24 - bl InitCameraUpdateCallback - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086AAC - - thumb_func_start sub_8086AC8 -sub_8086AC8: @ 8086AC8 - push {lr} - ldr r0, =0x03005db4 - ldrb r0, [r0] - bl sub_8087858 - lsls r0, 24 - lsrs r0, 24 - bl InitCameraUpdateCallback - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086AC8 - - thumb_func_start sub_8086AE4 -sub_8086AE4: @ 8086AE4 - push {r4,lr} - sub sp, 0x4 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl sav1_camera_get_focus_coords - mov r2, sp - ldr r0, =0x03005db4 - ldrb r1, [r0] - ldrh r0, [r2] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - ldrh r1, [r4] - bl sub_8088B3C - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086AE4 - - thumb_func_start sub_8086B14 -sub_8086B14: @ 8086B14 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl sav1_camera_get_focus_coords - mov r3, sp - mov r2, sp - ldr r0, =0x03005db4 - ldrb r1, [r0] - ldrh r0, [r2] - subs r0, r1 - strh r0, [r3] - movs r6, 0 - ldr r0, =0x03005db8 - mov r8, r4 - ldrb r0, [r0] - cmp r6, r0 - bcs _08086B7E - ldr r7, =0x020229e8 -_08086B44: - lsls r5, r6, 24 - lsrs r5, 24 - mov r0, sp - ldrh r1, [r0] - adds r1, r6, r1 - lsls r1, 16 - asrs r1, 16 - mov r0, r8 - movs r3, 0 - ldrsh r2, [r0, r3] - lsls r4, r6, 3 - subs r4, r6 - lsls r4, 2 - adds r4, r7 - ldrb r3, [r4, 0x13] - adds r0, r5, 0 - bl sub_80876F0 - ldrb r1, [r4] - adds r0, r5, 0 - bl sub_8087BCC - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =0x03005db8 - ldrb r0, [r0] - cmp r6, r0 - bcc _08086B44 -_08086B7E: - bl sub_8086C40 - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086B14 - - thumb_func_start sub_8086B9C -sub_8086B9C: @ 8086B9C - push {r4,r5,lr} - movs r4, 0 - ldr r0, =0x03005db8 - ldrb r0, [r0] - cmp r4, r0 - bcs _08086BCA - ldr r5, =0x020229e8 -_08086BAA: - lsls r0, r4, 24 - lsrs r0, 24 - lsls r1, r4, 3 - subs r1, r4 - lsls r1, 2 - adds r1, r5 - ldrb r1, [r1] - bl sub_8087BCC - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x03005db8 - ldrb r0, [r0] - cmp r4, r0 - bcc _08086BAA -_08086BCA: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086B9C - - thumb_func_start c1_link_related -c1_link_related: @ 8086BD8 - push {r4,lr} - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08086BF2 - bl sub_800F0B8 - cmp r0, 0 - beq _08086BF2 - bl sub_8009F3C - cmp r0, 0 - bne _08086C14 -_08086BF2: - ldr r0, =0x03005db4 - ldrb r4, [r0] - ldr r0, =0x03003020 - adds r1, r4, 0 - bl sub_8086F38 - ldr r0, =0x03000e14 - ldr r1, [r0] - adds r0, r4, 0 - bl _call_via_r1 - lsls r0, 16 - lsrs r0, 16 - bl sub_8086FA0 - bl sub_8086C40 -_08086C14: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end c1_link_related - - thumb_func_start sub_8086C2C -sub_8086C2C: @ 8086C2C - push {lr} - bl sub_8086C90 - ldr r0, =sub_80870B0 - bl c1_link_related_func_set - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086C2C - - thumb_func_start sub_8086C40 -sub_8086C40: @ 8086C40 - push {lr} - ldr r0, =0x03003020 - bl sub_808709C - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086C40 - - thumb_func_start c1_link_related_func_set -c1_link_related_func_set: @ 8086C50 - ldr r2, =0x03000e19 - movs r1, 0 - strb r1, [r2] - ldr r1, =0x03000e14 - str r0, [r1] - bx lr - .pool - thumb_func_end c1_link_related_func_set - - thumb_func_start sub_8086C64 -sub_8086C64: @ 8086C64 - push {lr} - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08086C82 - ldr r1, =0x03000e19 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3C - bls _08086C82 - bl sub_8010198 -_08086C82: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086C64 - - thumb_func_start sub_8086C90 -sub_8086C90: @ 8086C90 - push {lr} - ldr r1, =0x03000e10 - movs r2, 0x80 - adds r0, r1, 0x3 -_08086C98: - strb r2, [r0] - subs r0, 0x1 - cmp r0, r1 - bge _08086C98 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086C90 - - thumb_func_start sub_8086CA8 -sub_8086CA8: @ 8086CA8 - push {r4,lr} - lsls r0, 16 - lsrs r3, r0, 16 - ldr r0, =0x03005db8 - ldrb r2, [r0] - movs r1, 0 - cmp r1, r2 - bge _08086CD6 - ldr r4, =0x03000e10 -_08086CBA: - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, r3 - beq _08086CD0 - movs r0, 0 - b _08086CD8 - .pool -_08086CD0: - adds r1, 0x1 - cmp r1, r2 - blt _08086CBA -_08086CD6: - movs r0, 0x1 -_08086CD8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8086CA8 - - thumb_func_start sub_8086CE0 -sub_8086CE0: @ 8086CE0 - push {r4,lr} - lsls r0, 16 - lsrs r3, r0, 16 - ldr r0, =0x03005db8 - ldrb r2, [r0] - movs r1, 0 - cmp r1, r2 - bge _08086D0E - ldr r4, =0x03000e10 -_08086CF2: - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, r3 - bne _08086D08 - movs r0, 0x1 - b _08086D10 - .pool -_08086D08: - adds r1, 0x1 - cmp r1, r2 - blt _08086CF2 -_08086D0E: - movs r0, 0 -_08086D10: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8086CE0 - - thumb_func_start sub_8086D18 -sub_8086D18: @ 8086D18 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r7, r0, 0 - adds r6, r2, 0 - mov r9, r3 - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - ldr r0, =0x03000e10 - adds r5, r7, r0 - ldrb r0, [r5] - cmp r0, 0x80 - beq _08086D38 - b _08086EB2 -_08086D38: - adds r0, r6, 0 - bl sub_8087370 - adds r4, r0, 0 - cmp r4, 0 - beq _08086D70 - bl sub_8087480 - mov r1, r9 - strh r0, [r1] - movs r0, 0x81 - strb r0, [r5] - ldrb r0, [r6, 0x1] - cmp r0, 0 - bne _08086D58 - b _08086F26 -_08086D58: - ldr r0, =sub_80870F8 - bl c1_link_related_func_set - adds r0, r4, 0 - bl sub_8087530 - b _08086F26 - .pool -_08086D70: - movs r0, 0x83 - bl sub_8086CE0 - cmp r0, 0x1 - bne _08086D98 - movs r0, 0x81 - strb r0, [r5] - ldrb r0, [r6, 0x1] - cmp r0, 0 - bne _08086D86 - b _08086F26 -_08086D86: - ldr r0, =sub_80870F8 - bl c1_link_related_func_set - bl sub_8087584 - b _08086F26 - .pool -_08086D98: - mov r0, r8 - subs r0, 0x12 - cmp r0, 0xA - bls _08086DA2 - b _08086EB2 -_08086DA2: - lsls r0, 2 - ldr r1, =_08086DB0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08086DB0: - .4byte _08086E08 - .4byte _08086EB2 - .4byte _08086EB2 - .4byte _08086EB2 - .4byte _08086EB2 - .4byte _08086EB2 - .4byte _08086DDC - .4byte _08086E34 - .4byte _08086EB2 - .4byte _08086E64 - .4byte _08086E90 -_08086DDC: - adds r0, r6, 0 - bl sub_8087358 - cmp r0, 0 - beq _08086EB2 - ldr r0, =0x03000e10 - adds r0, r7, r0 - movs r1, 0x81 - strb r1, [r0] - ldrb r0, [r6, 0x1] - cmp r0, 0 - beq _08086EB2 - ldr r0, =sub_80870F8 - bl c1_link_related_func_set - bl sub_808751C - b _08086EB2 - .pool -_08086E08: - adds r0, r6, 0 - bl sub_8087388 - cmp r0, 0x1 - bne _08086EB2 - ldr r0, =0x03000e10 - adds r0, r7, r0 - movs r1, 0x81 - strb r1, [r0] - ldrb r0, [r6, 0x1] - cmp r0, 0 - beq _08086EB2 - ldr r0, =sub_80870F8 - bl c1_link_related_func_set - bl sub_808754C - b _08086EB2 - .pool -_08086E34: - adds r0, r6, 0 - bl sub_80873B4 - adds r4, r0, 0 - cmp r4, 0 - beq _08086EB2 - ldr r0, =0x03000e10 - adds r0, r7, r0 - movs r1, 0x81 - strb r1, [r0] - ldrb r0, [r6, 0x1] - cmp r0, 0 - beq _08086EB2 - ldr r0, =sub_80870F8 - bl c1_link_related_func_set - adds r0, r4, 0 - bl sub_8087568 - b _08086EB2 - .pool -_08086E64: - adds r0, r6, 0 - bl sub_8087340 - cmp r0, 0 - beq _08086EB2 - ldr r0, =0x03000e10 - adds r0, r7, r0 - movs r1, 0x81 - strb r1, [r0] - ldrb r0, [r6, 0x1] - cmp r0, 0 - beq _08086EB2 - ldr r0, =sub_808711C - bl c1_link_related_func_set - bl sub_8087510 - b _08086EB2 - .pool -_08086E90: - adds r0, r6, 0 - bl sub_8087340 - cmp r0, 0 - beq _08086EB2 - ldr r0, =0x03000e10 - adds r0, r7, r0 - movs r1, 0x81 - strb r1, [r0] - ldrb r0, [r6, 0x1] - cmp r0, 0 - beq _08086EB2 - ldr r0, =sub_8087140 - bl c1_link_related_func_set - bl sub_8087510 -_08086EB2: - mov r0, r8 - cmp r0, 0x17 - beq _08086ED8 - cmp r0, 0x17 - bgt _08086ECC - cmp r0, 0x16 - beq _08086EE8 - b _08086F26 - .pool -_08086ECC: - mov r1, r8 - cmp r1, 0x1A - beq _08086EF8 - cmp r1, 0x1D - beq _08086F18 - b _08086F26 -_08086ED8: - ldr r0, =0x03000e10 - adds r0, r7, r0 - movs r1, 0x83 - strb r1, [r0] - b _08086F26 - .pool -_08086EE8: - ldr r0, =0x03000e10 - adds r0, r7, r0 - movs r1, 0x82 - strb r1, [r0] - b _08086F26 - .pool -_08086EF8: - ldr r0, =0x03000e10 - adds r0, r7, r0 - movs r1, 0x80 - strb r1, [r0] - ldrb r0, [r6, 0x1] - cmp r0, 0 - beq _08086F26 - ldr r0, =sub_80870B0 - bl c1_link_related_func_set - b _08086F26 - .pool -_08086F18: - ldr r0, =0x03000e10 - adds r1, r7, r0 - ldrb r0, [r1] - cmp r0, 0x82 - bne _08086F26 - movs r0, 0x81 - strb r0, [r1] -_08086F26: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086D18 - - thumb_func_start sub_8086F38 -sub_8086F38: @ 8086F38 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x14 - mov r8, r1 - movs r6, 0 - add r5, sp, 0x10 - mov r9, r5 - adds r7, r0, 0 -_08086F4C: - ldrb r4, [r7] - movs r0, 0 - strh r0, [r5] - adds r0, r6, 0 - mov r1, r8 - mov r2, sp - bl sub_80872D8 - adds r0, r6, 0 - adds r1, r4, 0 - mov r2, sp - adds r3, r5, 0 - bl sub_8086D18 - ldr r0, =0x03000e10 - adds r0, r6, r0 - ldrb r0, [r0] - cmp r0, 0x80 - bne _08086F7C - adds r0, r4, 0 - bl sub_8087068 - mov r1, r9 - strh r0, [r1] -_08086F7C: - lsls r0, r6, 24 - lsrs r0, 24 - ldrb r1, [r5] - bl sub_808796C - adds r7, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - ble _08086F4C - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086F38 - - thumb_func_start sub_8086FA0 -sub_8086FA0: @ 8086FA0 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - ldr r1, =0xffef0000 - adds r0, r1 - lsrs r0, 16 - cmp r0, 0xC - bhi _08086FC0 - ldr r0, =0x03005da8 - strh r4, [r0] - b _08086FC6 - .pool -_08086FC0: - ldr r1, =0x03005da8 - movs r0, 0x11 - strh r0, [r1] -_08086FC6: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08086FFC - bl sub_8087690 - cmp r0, 0x1 - bls _08086FFC - bl is_c1_link_related_active - cmp r0, 0x1 - bne _08086FFC - bl sub_8009F3C - cmp r0, 0x1 - bne _08086FFC - cmp r4, 0x11 - blt _08086FFC - cmp r4, 0x15 - ble _08086FF6 - cmp r4, 0x19 - bgt _08086FFC - cmp r4, 0x18 - blt _08086FFC -_08086FF6: - ldr r1, =0x03005da8 - movs r0, 0 - strh r0, [r1] -_08086FFC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086FA0 - - thumb_func_start sub_808700C -sub_808700C: @ 808700C - push {lr} - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x2C] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08087024 - movs r0, 0x13 - b _08087064 - .pool -_08087024: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08087030 - movs r0, 0x12 - b _08087064 -_08087030: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0808703C - movs r0, 0x14 - b _08087064 -_0808703C: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08087048 - movs r0, 0x15 - b _08087064 -_08087048: - ldrh r1, [r2, 0x2E] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _08087056 - movs r0, 0x18 - b _08087064 -_08087056: - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08087062 - movs r0, 0x11 - b _08087064 -_08087062: - movs r0, 0x19 -_08087064: - pop {r1} - bx r1 - thumb_func_end sub_808700C - - thumb_func_start sub_8087068 -sub_8087068: @ 8087068 - push {lr} - lsls r0, 16 - lsrs r0, 16 - adds r1, r0, 0 - cmp r0, 0x13 - beq _0808708E - cmp r0, 0x13 - bgt _0808707E - cmp r0, 0x12 - beq _08087092 - b _08087096 -_0808707E: - cmp r1, 0x14 - beq _0808708A - cmp r1, 0x15 - bne _08087096 - movs r0, 0x4 - b _08087098 -_0808708A: - movs r0, 0x3 - b _08087098 -_0808708E: - movs r0, 0x1 - b _08087098 -_08087092: - movs r0, 0x2 - b _08087098 -_08087096: - movs r0, 0 -_08087098: - pop {r1} - bx r1 - thumb_func_end sub_8087068 - - thumb_func_start sub_808709C -sub_808709C: @ 808709C - push {lr} - movs r2, 0x11 - adds r1, r0, 0x6 -_080870A2: - strh r2, [r1] - subs r1, 0x2 - cmp r1, r0 - bge _080870A2 - pop {r0} - bx r0 - thumb_func_end sub_808709C - - thumb_func_start sub_80870B0 -sub_80870B0: @ 80870B0 - push {r4,lr} - adds r4, r0, 0 - bl script_env_2_is_enabled - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080870C4 - movs r0, 0x11 - b _080870E6 -_080870C4: - bl sub_800B4DC - cmp r0, 0x4 - bls _080870D0 - movs r0, 0x1B - b _080870E6 -_080870D0: - bl sub_8087690 - cmp r0, 0x4 - bls _080870DC - movs r0, 0x1C - b _080870E6 -_080870DC: - adds r0, r4, 0 - bl sub_808700C - lsls r0, 16 - lsrs r0, 16 -_080870E6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80870B0 - - thumb_func_start sub_80870EC -sub_80870EC: @ 80870EC - push {lr} - bl sub_8086C64 - movs r0, 0x11 - pop {r1} - bx r1 - thumb_func_end sub_80870EC - - thumb_func_start sub_80870F8 -sub_80870F8: @ 80870F8 - push {r4,lr} - bl script_env_2_is_enabled - lsls r0, 24 - lsrs r0, 24 - movs r4, 0x11 - cmp r0, 0x1 - beq _08087110 - movs r4, 0x1A - ldr r0, =sub_80870EC - bl c1_link_related_func_set -_08087110: - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80870F8 - - thumb_func_start sub_808711C -sub_808711C: @ 808711C - push {r4,lr} - bl sub_800B4DC - movs r4, 0x11 - cmp r0, 0x2 - bhi _08087134 - movs r4, 0x1A - bl script_env_2_disable - ldr r0, =sub_80870EC - bl c1_link_related_func_set -_08087134: - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_808711C - - thumb_func_start sub_8087140 -sub_8087140: @ 8087140 - push {r4,lr} - bl sub_8087690 - movs r4, 0x11 - cmp r0, 0x2 - bhi _08087158 - movs r4, 0x1A - bl script_env_2_disable - ldr r0, =sub_80870EC - bl c1_link_related_func_set -_08087158: - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8087140 - - thumb_func_start sub_8087164 -sub_8087164: @ 8087164 - push {lr} - bl sub_8086C64 - movs r0, 0x11 - pop {r1} - bx r1 - thumb_func_end sub_8087164 - - thumb_func_start sub_8087170 -sub_8087170: @ 8087170 - push {lr} - ldr r1, =0x03000e10 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x82 - bne _080871A0 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080871A4 - ldr r0, =sub_8087164 - bl c1_link_related_func_set - movs r0, 0x1D - b _080871A6 - .pool -_080871A0: - bl sub_8086C64 -_080871A4: - movs r0, 0x11 -_080871A6: - pop {r1} - bx r1 - thumb_func_end sub_8087170 - - thumb_func_start sub_80871AC -sub_80871AC: @ 80871AC - push {lr} - ldr r0, =sub_8087170 - bl c1_link_related_func_set - movs r0, 0x16 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80871AC - - thumb_func_start sub_80871C0 -sub_80871C0: @ 80871C0 - movs r0, 0x11 - bx lr - thumb_func_end sub_80871C0 - - thumb_func_start sub_80871C4 -sub_80871C4: @ 80871C4 - push {lr} - ldr r1, =0x03000e10 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x83 - beq _080871D4 - bl sub_8086C64 -_080871D4: - movs r0, 0x83 - bl sub_8086CA8 - cmp r0, 0x1 - bne _080871EA - ldr r0, =gUnknown_08277513 - bl script_env_1_execute_new_script - ldr r0, =sub_80871C0 - bl c1_link_related_func_set -_080871EA: - movs r0, 0x11 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80871C4 - - thumb_func_start sub_80871FC -sub_80871FC: @ 80871FC - push {lr} - ldr r0, =sub_80871C4 - bl c1_link_related_func_set - movs r0, 0x17 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80871FC - - thumb_func_start sub_8087210 -sub_8087210: @ 8087210 - movs r0, 0x11 - bx lr - thumb_func_end sub_8087210 - - thumb_func_start sub_8087214 -sub_8087214: @ 8087214 - push {lr} - movs r0, 0x83 - bl sub_8086CE0 - cmp r0, 0x1 - beq _08087250 - ldr r0, =0x03000e14 - ldr r2, [r0] - ldr r1, =sub_8087170 - adds r3, r0, 0 - cmp r2, r1 - bne _0808723A - ldr r1, =0x03000e10 - ldr r0, =0x03005db4 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x82 - bne _08087272 -_0808723A: - ldr r1, [r3] - ldr r0, =sub_8087164 - cmp r1, r0 - bne _08087268 - ldr r1, =0x03000e10 - ldr r0, =0x03005db4 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x81 - bne _08087268 -_08087250: - movs r0, 0x2 - b _08087278 - .pool -_08087268: - movs r0, 0x82 - bl sub_8086CA8 - cmp r0, 0 - bne _08087276 -_08087272: - movs r0, 0 - b _08087278 -_08087276: - movs r0, 0x1 -_08087278: - pop {r1} - bx r1 - thumb_func_end sub_8087214 - - thumb_func_start sub_808727C -sub_808727C: @ 808727C - push {lr} - movs r0, 0x83 - bl sub_8086CE0 - pop {r1} - bx r1 - thumb_func_end sub_808727C - - thumb_func_start sub_8087288 -sub_8087288: @ 8087288 - push {lr} - ldr r0, =sub_80871AC - bl c1_link_related_func_set - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8087288 - - thumb_func_start sub_808729C -sub_808729C: @ 808729C - push {lr} - ldr r0, =sub_80870F8 - bl c1_link_related_func_set - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_808729C - - thumb_func_start sub_80872B0 -sub_80872B0: @ 80872B0 - push {lr} - ldr r0, =sub_80871FC - bl c1_link_related_func_set - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80872B0 - - thumb_func_start sub_80872C4 -sub_80872C4: @ 80872C4 - push {lr} - ldr r0, =sub_8087210 - bl c1_link_related_func_set - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80872C4 - - thumb_func_start sub_80872D8 -sub_80872D8: @ 80872D8 - push {r4-r6,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r6, r2, 0 - strb r4, [r6] - movs r0, 0 - cmp r4, r1 - bne _080872EA - movs r0, 0x1 -_080872EA: - strb r0, [r6, 0x1] - ldr r1, =0x02032308 - lsls r0, r4, 2 - adds r0, r1 - ldrb r0, [r0, 0x3] - strb r0, [r6, 0x2] - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl sub_80878A0 - strb r0, [r6, 0x3] - mov r5, sp - adds r5, 0x2 - adds r0, r4, 0 - mov r1, sp - adds r2, r5, 0 - bl sub_8087878 - mov r0, sp - ldrh r0, [r0] - strh r0, [r6, 0x4] - ldrh r0, [r5] - strh r0, [r6, 0x6] - adds r0, r4, 0 - bl sub_80878C0 - strb r0, [r6, 0x8] - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r5, r2] - bl MapGridGetMetatileBehaviorAt - strh r0, [r6, 0xC] - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80872D8 - - thumb_func_start sub_8087340 -sub_8087340: @ 8087340 - push {lr} - ldrb r0, [r0, 0x2] - cmp r0, 0x2 - beq _0808734C - cmp r0, 0 - bne _08087350 -_0808734C: - movs r0, 0x1 - b _08087352 -_08087350: - movs r0, 0 -_08087352: - pop {r1} - bx r1 - thumb_func_end sub_8087340 - - thumb_func_start sub_8087358 -sub_8087358: @ 8087358 - push {lr} - ldrb r0, [r0, 0x2] - cmp r0, 0x2 - beq _08087364 - cmp r0, 0 - bne _08087368 -_08087364: - movs r0, 0x1 - b _0808736A -_08087368: - movs r0, 0 -_0808736A: - pop {r1} - bx r1 - thumb_func_end sub_8087358 - - thumb_func_start sub_8087370 -sub_8087370: @ 8087370 - push {lr} - adds r1, r0, 0 - ldrb r0, [r1, 0x2] - cmp r0, 0x2 - bne _08087382 - adds r0, r1, 0x4 - bl sub_809D0F4 - b _08087384 -_08087382: - movs r0, 0 -_08087384: - pop {r1} - bx r1 - thumb_func_end sub_8087370 - - thumb_func_start sub_8087388 -sub_8087388: @ 8087388 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4, 0x2] - cmp r0, 0x2 - beq _08087396 - cmp r0, 0 - bne _080873AC -_08087396: - ldrb r0, [r4, 0xC] - bl MetatileBehavior_IsSouthArrowWarp - lsls r0, 24 - cmp r0, 0 - beq _080873AC - ldrb r0, [r4, 0x3] - cmp r0, 0x1 - bne _080873AC - movs r0, 0x1 - b _080873AE -_080873AC: - movs r0, 0 -_080873AE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8087388 - - thumb_func_start sub_80873B4 -sub_80873B4: @ 80873B4 - push {r4,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldrb r0, [r4, 0x2] - cmp r0, 0 - beq _080873C8 - cmp r0, 0x2 - beq _080873C8 - movs r0, 0 - b _08087476 -_080873C8: - ldr r0, [r4, 0x4] - ldr r1, [r4, 0x8] - str r0, [sp] - str r1, [sp, 0x4] - ldr r3, =gUnknown_08339D64 - ldrb r0, [r4, 0x3] - lsls r0, 3 - adds r0, r3 - ldr r0, [r0] - mov r1, sp - ldrh r1, [r1] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0xffff0000 - ldr r2, [sp] - ands r2, r1 - orrs r2, r0 - str r2, [sp] - asrs r1, r2, 16 - ldrb r0, [r4, 0x3] - lsls r0, 3 - adds r3, 0x4 - adds r0, r3 - ldr r0, [r0] - adds r0, r1 - lsls r0, 16 - ldr r1, =0x0000ffff - ands r1, r2 - orrs r1, r0 - str r1, [sp] - ldr r2, =0xffffff00 - ldr r0, [sp, 0x4] - ands r0, r2 - str r0, [sp, 0x4] - mov r0, sp - movs r2, 0 - ldrsh r0, [r0, r2] - asrs r1, 16 - bl sub_808790C - lsls r0, 24 - lsrs r1, r0, 24 - adds r2, r1, 0 - cmp r1, 0x4 - beq _0808746C - ldrb r0, [r4, 0x1] - cmp r0, 0 - beq _08087434 - ldr r0, =0x03000e10 - adds r0, r1, r0 - ldrb r0, [r0] - cmp r0, 0x80 - beq _08087450 -_08087434: - ldr r0, =gUnknown_0827749C - b _08087476 - .pool -_08087450: - adds r0, r2, 0 - bl sub_80B39D4 - cmp r0, 0 - bne _08087464 - ldr r0, =gUnknown_0827747E - b _08087476 - .pool -_08087464: - ldr r0, =gUnknown_0827748D - b _08087476 - .pool -_0808746C: - ldrb r1, [r4, 0xC] - ldrb r2, [r4, 0x3] - mov r0, sp - bl sub_809C2C8 -_08087476: - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80873B4 - - thumb_func_start sub_8087480 -sub_8087480: @ 8087480 - push {lr} - adds r1, r0, 0 - ldr r0, =gUnknown_08277388 - cmp r1, r0 - beq _080874C6 - ldr r0, =gUnknown_082773A3 - cmp r1, r0 - beq _08087508 - ldr r0, =gUnknown_082773BE - cmp r1, r0 - beq _080874C6 - ldr r0, =gUnknown_082773D9 - cmp r1, r0 - beq _08087508 - ldr r0, =gUnknown_0827741D - cmp r1, r0 - beq _080874C6 - ldr r0, =gUnknown_08277432 - cmp r1, r0 - beq _08087508 - ldr r0, =gUnknown_08277447 - cmp r1, r0 - beq _080874C6 - ldr r0, =gUnknown_0827745C - cmp r1, r0 - beq _08087508 - ldr r0, =gUnknown_08277374 - cmp r1, r0 - beq _080874C6 - ldr r0, =gUnknown_0827737E - cmp r1, r0 - beq _08087508 - ldr r0, =gUnknown_082773F5 - cmp r1, r0 - bne _080874F8 -_080874C6: - movs r0, 0xA - b _0808750A - .pool -_080874F8: - ldr r0, =gUnknown_082773FF - cmp r1, r0 - beq _08087508 - movs r0, 0 - b _0808750A - .pool -_08087508: - movs r0, 0x9 -_0808750A: - pop {r1} - bx r1 - thumb_func_end sub_8087480 - - thumb_func_start sub_8087510 -sub_8087510: @ 8087510 - push {lr} - bl script_env_2_enable - pop {r0} - bx r0 - thumb_func_end sub_8087510 - - thumb_func_start sub_808751C -sub_808751C: @ 808751C - push {lr} - movs r0, 0x6 - bl audio_play - bl sub_809FA9C - bl script_env_2_enable - pop {r0} - bx r0 - thumb_func_end sub_808751C - - thumb_func_start sub_8087530 -sub_8087530: @ 8087530 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x5 - bl audio_play - adds r0, r4, 0 - bl script_env_1_execute_new_script - bl script_env_2_enable - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8087530 - - thumb_func_start sub_808754C -sub_808754C: @ 808754C - push {lr} - movs r0, 0x6 - bl audio_play - ldr r0, =gUnknown_082774EF - bl script_env_1_execute_new_script - bl script_env_2_enable - pop {r0} - bx r0 - .pool - thumb_func_end sub_808754C - - thumb_func_start sub_8087568 -sub_8087568: @ 8087568 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x5 - bl audio_play - adds r0, r4, 0 - bl script_env_1_execute_new_script - bl script_env_2_enable - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8087568 - - thumb_func_start sub_8087584 -sub_8087584: @ 8087584 - push {lr} - ldr r0, =gUnknown_08277509 - bl script_env_1_execute_new_script - bl script_env_2_enable - pop {r0} - bx r0 - .pool - thumb_func_end sub_8087584 - - thumb_func_start sub_8087598 -sub_8087598: @ 8087598 - push {lr} - bl is_c1_link_related_active - cmp r0, 0 - bne _080875A6 - movs r0, 0 - b _080875C0 -_080875A6: - bl sub_800B4DC - cmp r0, 0x2 - bls _080875B8 - ldr r1, =0x03000e18 - movs r0, 0x1 - b _080875BC - .pool -_080875B8: - ldr r1, =0x03000e18 - movs r0, 0 -_080875BC: - strb r0, [r1] - ldrb r0, [r1] -_080875C0: - pop {r1} - bx r1 - .pool - thumb_func_end sub_8087598 - - thumb_func_start sub_80875C8 -sub_80875C8: @ 80875C8 - push {lr} - bl sub_800B4DC - cmp r0, 0x1 - bls _0808762C - bl is_c1_link_related_active - cmp r0, 0x1 - bne _0808762C - bl sub_8009F3C - cmp r0, 0x1 - bne _0808762C - ldr r0, =0x03000e14 - ldr r1, [r0] - ldr r0, =sub_808711C - cmp r1, r0 - beq _08087614 - ldr r0, =sub_80870F8 - cmp r1, r0 - bne _0808762C - ldr r0, =0x03000e18 - ldrb r2, [r0] - movs r1, 0 - strb r1, [r0] - cmp r2, 0x1 - beq _08087614 - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0808762C - ldrb r1, [r2, 0xA] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0808762C -_08087614: - movs r0, 0x1 - b _0808762E - .pool -_0808762C: - movs r0, 0 -_0808762E: - pop {r1} - bx r1 - thumb_func_end sub_80875C8 - - thumb_func_start sub_8087634 -sub_8087634: @ 8087634 - push {lr} - bl sub_8087690 - cmp r0, 0x1 - bls _08087658 - bl is_c1_link_related_active - cmp r0, 0x1 - bne _08087658 - bl sub_8009F3C - cmp r0, 0x1 - bne _08087658 - ldr r0, =0x03000e14 - ldr r1, [r0] - ldr r0, =sub_8087140 - cmp r1, r0 - beq _08087664 -_08087658: - movs r0, 0 - b _08087666 - .pool -_08087664: - movs r0, 0x1 -_08087666: - pop {r1} - bx r1 - thumb_func_end sub_8087634 - - thumb_func_start sub_808766C -sub_808766C: @ 808766C - push {lr} - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _08087688 - bl sub_8009F3C - cmp r0, 0 - beq _08087688 - movs r0, 0x1 - b _0808768A - .pool -_08087688: - movs r0, 0 -_0808768A: - pop {r1} - bx r1 - thumb_func_end sub_808766C - - thumb_func_start sub_8087690 -sub_8087690: @ 8087690 - push {lr} - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _080876B0 - ldr r0, =0x03003170 - ldr r1, =0x00000339 - adds r0, r1 - ldrb r0, [r0] - b _080876B8 - .pool -_080876B0: - ldr r0, =0x03005000 - ldr r1, =0x00000c1a - adds r0, r1 - ldrb r0, [r0] -_080876B8: - pop {r1} - bx r1 - .pool - thumb_func_end sub_8087690 - - thumb_func_start sub_80876C4 -sub_80876C4: @ 80876C4 - movs r1, 0 - str r1, [r0] - bx lr - thumb_func_end sub_80876C4 - - thumb_func_start strange_npc_table_clear -strange_npc_table_clear: @ 80876CC - push {lr} - ldr r0, =0x02032308 - movs r1, 0 - movs r2, 0x10 - bl memset - pop {r0} - bx r0 - .pool - thumb_func_end strange_npc_table_clear - - thumb_func_start sub_80876E0 -sub_80876E0: @ 80876E0 - push {lr} - movs r1, 0 - movs r2, 0x24 - bl memset - pop {r0} - bx r0 - thumb_func_end sub_80876E0 - - thumb_func_start sub_80876F0 -sub_80876F0: @ 80876F0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r9, r1 - mov r10, r2 - mov r8, r3 - lsls r0, 24 - lsrs r7, r0, 24 - mov r0, r9 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - mov r1, r10 - lsls r1, 16 - lsrs r1, 16 - mov r10, r1 - mov r2, r8 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - bl sub_808D4F4 - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - lsls r4, r7, 2 - ldr r0, =0x02032308 - adds r4, r0 - lsls r5, r6, 3 - adds r5, r6 - lsls r5, 2 - ldr r0, =0x02037350 - adds r5, r0 - adds r0, r4, 0 - bl sub_80876C4 - adds r0, r5, 0 - bl sub_80876E0 - movs r2, 0 - movs r1, 0x1 - movs r0, 0x1 - strb r0, [r4] - strb r7, [r4, 0x1] - strb r6, [r4, 0x2] - strb r2, [r4, 0x3] - ldrb r0, [r5] - orrs r0, r1 - mov r2, r8 - ands r2, r1 - lsls r2, 1 - movs r1, 0x3 - negs r1, r1 - ands r0, r1 - orrs r0, r2 - strb r0, [r5] - movs r0, 0x2 - strb r0, [r5, 0x19] - movs r0, 0x40 - strb r0, [r5, 0x4] - mov r0, r9 - lsls r0, 16 - asrs r0, 16 - mov r9, r0 - mov r1, r10 - lsls r1, 16 - asrs r1, 16 - mov r10, r1 - adds r0, r5, 0 - mov r1, r9 - mov r2, r10 - bl sub_808779C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80876F0 - - thumb_func_start sub_808779C -sub_808779C: @ 808779C - push {r4,lr} - adds r4, r0, 0 - adds r0, r1, 0 - adds r1, r2, 0 - lsls r0, 16 - lsrs r0, 16 - lsls r1, 16 - lsrs r1, 16 - strh r0, [r4, 0x10] - strh r1, [r4, 0x12] - strh r0, [r4, 0x14] - strh r1, [r4, 0x16] - lsls r0, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - adds r2, r4, 0 - adds r2, 0xC - adds r3, r4, 0 - adds r3, 0xE - bl sub_8093038 - ldrh r0, [r4, 0xC] - adds r0, 0x8 - strh r0, [r4, 0xC] - adds r0, r4, 0 - bl FieldObjectUpdateZCoord - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_808779C - - thumb_func_start sub_80877DC -sub_80877DC: @ 80877DC - push {lr} - lsls r0, 24 - lsls r1, 24 - lsrs r2, r1, 24 - ldr r1, =0x02032308 - lsrs r0, 22 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0 - beq _080877FE - ldrb r0, [r1, 0x2] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02037350 - adds r1, r0 - strb r2, [r1, 0x19] -_080877FE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80877DC - - thumb_func_start sub_808780C -sub_808780C: @ 808780C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 22 - ldr r1, =0x02032308 - adds r5, r0, r1 - ldrb r1, [r5, 0x2] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - ldrb r0, [r4, 0x4] - cmp r0, 0x40 - beq _08087838 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles -_08087838: - movs r0, 0 - strb r0, [r5] - ldrb r1, [r4] - subs r0, 0x2 - ands r0, r1 - strb r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808780C - - thumb_func_start sub_8087858 -sub_8087858: @ 8087858 - lsls r0, 24 - ldr r1, =0x02032308 - lsrs r0, 22 - adds r0, r1 - ldrb r1, [r0, 0x2] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - ldrb r0, [r0, 0x4] - bx lr - .pool - thumb_func_end sub_8087858 - - thumb_func_start sub_8087878 -sub_8087878: @ 8087878 - lsls r0, 24 - ldr r3, =0x02032308 - lsrs r0, 22 - adds r0, r3 - ldrb r3, [r0, 0x2] - lsls r0, r3, 3 - adds r0, r3 - lsls r0, 2 - ldr r3, =0x02037350 - adds r0, r3 - ldrh r3, [r0, 0x10] - strh r3, [r1] - ldrh r0, [r0, 0x12] - strh r0, [r2] - bx lr - .pool - thumb_func_end sub_8087878 - - thumb_func_start sub_80878A0 -sub_80878A0: @ 80878A0 - lsls r0, 24 - ldr r1, =0x02032308 - lsrs r0, 22 - adds r0, r1 - ldrb r1, [r0, 0x2] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - ldrb r0, [r0, 0x19] - bx lr - .pool - thumb_func_end sub_80878A0 - - thumb_func_start sub_80878C0 -sub_80878C0: @ 80878C0 - lsls r0, 24 - ldr r1, =0x02032308 - lsrs r0, 22 - adds r0, r1 - ldrb r1, [r0, 0x2] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - ldrb r0, [r0, 0xB] - lsls r0, 28 - lsrs r0, 28 - bx lr - .pool - thumb_func_end sub_80878C0 - - thumb_func_start sub_80878E4 -sub_80878E4: @ 80878E4 - lsls r0, 24 - ldr r1, =0x02032308 - lsrs r0, 22 - adds r0, r1 - ldrb r1, [r0, 0x2] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - adds r0, 0x21 - movs r1, 0 - ldrsb r1, [r0, r1] - movs r0, 0x10 - subs r0, r1 - bx lr - .pool - thumb_func_end sub_80878E4 - - thumb_func_start sub_808790C -sub_808790C: @ 808790C - push {r4-r6,lr} - movs r2, 0 - ldr r5, =0x02032308 - lsls r0, 16 - asrs r4, r0, 16 - lsls r1, 16 - asrs r3, r1, 16 -_0808791A: - lsls r0, r2, 2 - adds r1, r0, r5 - ldrb r0, [r1] - cmp r0, 0 - beq _08087958 - ldrb r0, [r1, 0x3] - cmp r0, 0 - beq _0808792E - cmp r0, 0x2 - bne _08087958 -_0808792E: - ldrb r1, [r1, 0x2] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r1, r0, r1 - movs r6, 0x10 - ldrsh r0, [r1, r6] - cmp r0, r4 - bne _08087958 - movs r6, 0x12 - ldrsh r0, [r1, r6] - cmp r0, r3 - bne _08087958 - adds r0, r2, 0 - b _08087964 - .pool -_08087958: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x3 - bls _0808791A - movs r0, 0x4 -_08087964: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_808790C - - thumb_func_start sub_808796C -sub_808796C: @ 808796C - push {r4-r6,lr} - lsls r0, 24 - lsls r1, 24 - lsrs r3, r1, 24 - adds r2, r3, 0 - lsrs r0, 22 - ldr r1, =0x02032308 - adds r5, r0, r1 - ldrb r1, [r5, 0x2] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r6, r0, r1 - ldrb r0, [r5] - cmp r0, 0 - beq _080879C8 - cmp r3, 0xA - bls _080879A4 - ldrb r0, [r6] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r6] - b _080879C8 - .pool -_080879A4: - ldr r4, =gUnknown_08339E00 - ldr r1, =gUnknown_08339DC8 - ldrb r0, [r5, 0x3] - lsls r0, 2 - adds r0, r1 - ldr r3, [r0] - adds r0, r5, 0 - adds r1, r6, 0 - bl _call_via_r3 - lsls r0, 24 - lsrs r0, 22 - adds r0, r4 - ldr r2, [r0] - adds r0, r5, 0 - adds r1, r6, 0 - bl _call_via_r2 -_080879C8: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808796C - - thumb_func_start sub_80879D8 -sub_80879D8: @ 80879D8 - push {r4,lr} - lsls r2, 24 - lsrs r2, 24 - ldr r4, =gUnknown_08339DD4 - lsls r3, r2, 2 - adds r3, r4 - ldr r3, [r3] - bl _call_via_r3 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80879D8 - - thumb_func_start sub_80879F8 -sub_80879F8: @ 80879F8 - movs r0, 0x1 - bx lr - thumb_func_end sub_80879F8 - - thumb_func_start sub_80879FC -sub_80879FC: @ 80879FC - push {r4,lr} - lsls r2, 24 - lsrs r2, 24 - ldr r4, =gUnknown_08339DD4 - lsls r3, r2, 2 - adds r3, r4 - ldr r3, [r3] - bl _call_via_r3 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80879FC - - thumb_func_start sub_8087A1C -sub_8087A1C: @ 8087A1C - movs r0, 0 - bx lr - thumb_func_end sub_8087A1C - - thumb_func_start sub_8087A20 -sub_8087A20: @ 8087A20 - push {r4-r6,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - lsls r0, r2, 24 - lsrs r0, 24 - ldrb r1, [r5, 0x19] - bl npc_something3 - strb r0, [r5, 0x19] - ldrb r1, [r5, 0x19] - mov r6, sp - adds r6, 0x2 - adds r0, r5, 0 - mov r2, sp - adds r3, r6, 0 - bl FieldObjectMoveDestCoords - ldrb r0, [r4, 0x2] - ldrb r1, [r5, 0x19] - mov r2, sp - movs r3, 0 - ldrsh r2, [r2, r3] - movs r4, 0 - ldrsh r3, [r6, r4] - bl npc_080587EC - lsls r0, 24 - cmp r0, 0 - bne _08087A7E - adds r1, r5, 0 - adds r1, 0x21 - movs r0, 0x10 - strb r0, [r1] - mov r0, sp - movs r2, 0 - ldrsh r1, [r0, r2] - movs r3, 0 - ldrsh r2, [r6, r3] - adds r0, r5, 0 - bl npc_coords_shift - adds r0, r5, 0 - bl FieldObjectUpdateZCoord - movs r0, 0x1 - b _08087A80 -_08087A7E: - movs r0, 0 -_08087A80: - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8087A20 - - thumb_func_start sub_8087A88 -sub_8087A88: @ 8087A88 - push {r4,lr} - adds r4, r1, 0 - lsls r0, r2, 24 - lsrs r0, 24 - ldrb r1, [r4, 0x19] - bl npc_something3 - strb r0, [r4, 0x19] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8087A88 - - thumb_func_start sub_8087AA0 -sub_8087AA0: @ 8087AA0 - movs r1, 0 - strb r1, [r0, 0x3] - bx lr - thumb_func_end sub_8087AA0 - - thumb_func_start sub_8087AA8 -sub_8087AA8: @ 8087AA8 - push {r4-r6,lr} - adds r6, r0, 0 - adds r4, r1, 0 - adds r5, r4, 0 - adds r5, 0x21 - ldrb r0, [r5] - subs r0, 0x1 - strb r0, [r5] - movs r0, 0x1 - strb r0, [r6, 0x3] - ldrb r0, [r4, 0x19] - adds r1, 0xC - adds r2, r4, 0 - adds r2, 0xE - bl MoveCoords - ldrb r0, [r5] - cmp r0, 0 - bne _08087AD8 - adds r0, r4, 0 - bl npc_coords_shift_still - movs r0, 0x2 - strb r0, [r6, 0x3] -_08087AD8: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8087AA8 - - thumb_func_start npc_something3 -npc_something3: @ 8087AE0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r2, r1, 24 - subs r0, 0x1 - cmp r0, 0x9 - bhi _08087B38 - lsls r0, 2 - ldr r1, =_08087B00 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08087B00: - .4byte _08087B28 - .4byte _08087B2C - .4byte _08087B30 - .4byte _08087B34 - .4byte _08087B38 - .4byte _08087B38 - .4byte _08087B28 - .4byte _08087B2C - .4byte _08087B30 - .4byte _08087B34 -_08087B28: - movs r0, 0x2 - b _08087B3A -_08087B2C: - movs r0, 0x1 - b _08087B3A -_08087B30: - movs r0, 0x3 - b _08087B3A -_08087B34: - movs r0, 0x4 - b _08087B3A -_08087B38: - adds r0, r2, 0 -_08087B3A: - pop {r1} - bx r1 - thumb_func_end npc_something3 - - thumb_func_start npc_080587EC -npc_080587EC: @ 8087B40 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r2, 16 - lsrs r2, 16 - mov r12, r2 - lsls r3, 16 - movs r4, 0 - ldr r0, =0x02037350 - mov r9, r0 - lsrs r2, r3, 16 - mov r10, r2 - asrs r6, r3, 16 -_08087B64: - mov r7, r12 - lsls r3, r7, 16 - mov r0, r10 - lsls r5, r0, 16 - cmp r4, r8 - beq _08087BA8 - lsls r0, r4, 3 - adds r0, r4 - lsls r0, 2 - mov r2, r9 - adds r1, r0, r2 - movs r7, 0x10 - ldrsh r0, [r1, r7] - asrs r2, r3, 16 - cmp r0, r2 - bne _08087B8C - movs r7, 0x12 - ldrsh r0, [r1, r7] - cmp r0, r6 - beq _08087B9E -_08087B8C: - movs r7, 0x14 - ldrsh r0, [r1, r7] - cmp r0, r2 - bne _08087BA8 - movs r0, 0x16 - ldrsh r1, [r1, r0] - asrs r0, r5, 16 - cmp r1, r0 - bne _08087BA8 -_08087B9E: - movs r0, 0x1 - b _08087BBE - .pool -_08087BA8: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _08087B64 - asrs r0, r3, 16 - asrs r1, r5, 16 - bl MapGridIsImpassableAt - lsls r0, 24 - lsrs r0, 24 -_08087BBE: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end npc_080587EC - - thumb_func_start sub_8087BCC -sub_8087BCC: @ 8087BCC - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r3, r1, 24 - lsls r2, r5, 2 - ldr r0, =0x02032308 - adds r2, r0 - ldrb r1, [r2, 0x2] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - ldrb r0, [r2] - cmp r0, 0 - beq _08087C7A - subs r0, r3, 0x1 - cmp r0, 0x4 - bhi _08087C56 - lsls r0, 2 - ldr r1, =_08087C0C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08087C0C: - .4byte _08087C2C - .4byte _08087C2C - .4byte _08087C38 - .4byte _08087C20 - .4byte _08087C20 -_08087C20: - ldrb r0, [r4] - lsls r0, 30 - lsrs r0, 31 - bl sub_808BD6C - b _08087C44 -_08087C2C: - ldrb r0, [r4] - lsls r0, 30 - lsrs r0, 31 - bl sub_808BD7C - b _08087C44 -_08087C38: - ldrb r1, [r4] - lsls r1, 30 - lsrs r1, 31 - movs r0, 0 - bl sub_808BD3C -_08087C44: - lsls r0, 24 - lsrs r0, 24 - ldr r1, =sub_8087C8C - movs r2, 0 - str r2, [sp] - movs r3, 0 - bl AddPseudoFieldObject - strb r0, [r4, 0x4] -_08087C56: - ldrb r1, [r4, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - adds r3, r0, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r2, 0x2 - orrs r1, r2 - strb r1, [r3] - strh r5, [r0, 0x2E] - ldrb r1, [r4] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r4] -_08087C7A: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8087BCC - - thumb_func_start sub_8087C8C -sub_8087C8C: @ 8087C8C - push {r4-r6,lr} - adds r5, r0, 0 - movs r0, 0x2E - ldrsh r4, [r5, r0] - lsls r4, 2 - ldr r0, =0x02032308 - adds r4, r0 - ldrb r1, [r4, 0x2] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r6, r0, r1 - ldrh r0, [r6, 0xC] - strh r0, [r5, 0x20] - ldrh r0, [r6, 0xE] - strh r0, [r5, 0x22] - ldrb r0, [r6, 0xB] - lsrs r0, 4 - adds r1, r5, 0 - movs r2, 0x1 - bl SetObjectSubpriorityByZCoord - ldrb r0, [r6, 0xB] - lsrs r0, 4 - bl ZCoordToPriority - movs r1, 0x3 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r5, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x5] - ldrb r0, [r4, 0x3] - cmp r0, 0 - bne _08087CF8 - ldrb r0, [r6, 0x19] - bl FieldObjectDirectionToImageAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl StartObjectImageAnim - b _08087D0A - .pool -_08087CF8: - ldrb r0, [r6, 0x19] - bl get_go_image_anim_num - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl StartObjectImageAnimIfDifferent -_08087D0A: - adds r0, r5, 0 - movs r1, 0 - bl sub_80979D4 - ldrb r0, [r6] - lsls r0, 29 - cmp r0, 0 - bge _08087D3C - ldrh r0, [r5, 0x3C] - movs r1, 0x4 - ands r1, r0 - lsls r1, 16 - adds r3, r5, 0 - adds r3, 0x3E - lsrs r1, 18 - lsls r1, 2 - ldrb r2, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - ldrh r0, [r5, 0x3C] - adds r0, 0x1 - strh r0, [r5, 0x3C] -_08087D3C: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8087C8C - - thumb_func_start mapconnection_get_mapheader -mapconnection_get_mapheader: @ 8087D44 - push {lr} - ldrb r2, [r0, 0x8] - ldrb r1, [r0, 0x9] - adds r0, r2, 0 - bl get_mapheader_by_bank_and_number - pop {r1} - bx r1 - thumb_func_end mapconnection_get_mapheader - - thumb_func_start not_trainer_hill_battle_pyramid -not_trainer_hill_battle_pyramid: @ 8087D54 - push {r4,lr} - ldr r4, =0x02037318 - adds r0, r4, 0 - bl mapheader_copy_mapdata_with_padding - ldr r0, [r4, 0x4] - bl sub_80E8EE0 - bl mapheader_run_script_with_tag_x1 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end not_trainer_hill_battle_pyramid - - thumb_func_start sub_8087D74 -sub_8087D74: @ 8087D74 - push {r4,lr} - ldr r4, =0x02037318 - adds r0, r4, 0 - bl mapheader_copy_mapdata_with_padding - movs r0, 0 - bl sub_80E9238 - ldr r0, [r4, 0x4] - bl sub_80E8EE0 - bl mapdata_from_sav2 - bl mapheader_run_script_with_tag_x1 - ldr r1, =0x03005dc0 - ldr r0, [r1] - ldr r1, [r1, 0x4] - bl UpdateTVScreensOnMap - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8087D74 - - thumb_func_start battle_pyramid_map_load_related -battle_pyramid_map_load_related: @ 8087DAC - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x03ff03ff - str r0, [sp] - ldr r5, =0x02032318 - ldr r2, =0x01001400 - mov r0, sp - adds r1, r5, 0 - bl CpuFastSet - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_81AA078 - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end battle_pyramid_map_load_related - - thumb_func_start trainer_hill_map_load_related -trainer_hill_map_load_related: @ 8087DE4 - push {r4,lr} - sub sp, 0x4 - ldr r0, =0x03ff03ff - str r0, [sp] - ldr r4, =0x02032318 - ldr r2, =0x01001400 - mov r0, sp - adds r1, r4, 0 - bl CpuFastSet - adds r0, r4, 0 - bl sub_81D5FB4 - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end trainer_hill_map_load_related - - thumb_func_start mapheader_copy_mapdata_with_padding -@ void mapheader_copy_mapdata_with_padding(struct mapheader *mapHeader) -mapheader_copy_mapdata_with_padding: @ 8087E14 - push {r4-r6,lr} - sub sp, 0x4 - adds r6, r0, 0 - ldr r5, [r6] - ldr r0, =0x03ff03ff - str r0, [sp] - ldr r4, =0x02032318 - ldr r2, =0x01001400 - mov r0, sp - adds r1, r4, 0 - bl CpuFastSet - ldr r2, =0x03005dc0 - str r4, [r2, 0x8] - ldr r1, [r5] - adds r1, 0xF - str r1, [r2] - ldr r0, [r5, 0x4] - adds r0, 0xE - str r0, [r2, 0x4] - muls r1, r0 - movs r0, 0xA0 - lsls r0, 6 - cmp r1, r0 - bgt _08087E56 - ldr r0, [r5, 0xC] - ldrh r1, [r5] - ldrh r2, [r5, 0x4] - bl map_copy_with_padding - adds r0, r6, 0 - bl mapheader_copy_mapdata_of_adjacent_maps -_08087E56: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end mapheader_copy_mapdata_with_padding - - thumb_func_start map_copy_with_padding -@ int map_copy_with_padding(void *src) -map_copy_with_padding: @ 8087E70 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r7, r0, 0 - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - lsls r2, 16 - lsrs r2, 16 - ldr r0, =0x03005dc0 - ldr r4, [r0, 0x8] - ldr r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 1 - adds r0, 0xE - adds r4, r0 - cmp r2, 0 - beq _08087EB8 - mov r0, r8 - lsls r6, r0, 1 - adds r5, r2, 0 - movs r0, 0x1E - adds r0, r6 - mov r9, r0 -_08087EA4: - adds r0, r7, 0 - adds r1, r4, 0 - mov r2, r8 - bl CpuSet - add r4, r9 - adds r7, r6 - subs r5, 0x1 - cmp r5, 0 - bne _08087EA4 -_08087EB8: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end map_copy_with_padding - - thumb_func_start mapheader_copy_mapdata_of_adjacent_maps -@ void mapheader_copy_mapdata_of_adjacent_maps(struct mapheader *mapHeader) -mapheader_copy_mapdata_of_adjacent_maps: @ 8087EC8 - push {r4-r7,lr} - adds r6, r0, 0 - ldr r0, [r6, 0xC] - cmp r0, 0 - beq _08087F4C - ldr r1, [r0] - ldr r5, [r0, 0x4] - ldr r2, =0x02037340 - ldr r0, =gUnknown_08486EF8 - ldr r0, [r0] - str r0, [r2] - cmp r1, 0 - ble _08087F4C - adds r4, r2, 0 - adds r7, r1, 0 -_08087EE6: - adds r0, r5, 0 - bl mapconnection_get_mapheader - adds r1, r0, 0 - ldr r2, [r5, 0x4] - ldrb r0, [r5] - cmp r0, 0x2 - beq _08087F1E - cmp r0, 0x2 - bgt _08087F08 - cmp r0, 0x1 - beq _08087F12 - b _08087F44 - .pool -_08087F08: - cmp r0, 0x3 - beq _08087F2A - cmp r0, 0x4 - beq _08087F36 - b _08087F44 -_08087F12: - adds r0, r6, 0 - bl sub_8087FB8 - ldrb r0, [r4] - movs r1, 0x1 - b _08087F40 -_08087F1E: - adds r0, r6, 0 - bl sub_8088020 - ldrb r0, [r4] - movs r1, 0x2 - b _08087F40 -_08087F2A: - adds r0, r6, 0 - bl sub_8088080 - ldrb r0, [r4] - movs r1, 0x4 - b _08087F40 -_08087F36: - adds r0, r6, 0 - bl sub_80880E0 - ldrb r0, [r4] - movs r1, 0x8 -_08087F40: - orrs r0, r1 - strb r0, [r4] -_08087F44: - subs r7, 0x1 - adds r5, 0xC - cmp r7, 0 - bne _08087EE6 -_08087F4C: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end mapheader_copy_mapdata_of_adjacent_maps - - thumb_func_start sub_8087F54 -sub_8087F54: @ 8087F54 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r5, [sp, 0x18] - ldr r4, [r2] - ldr r7, [r4] - adds r2, r7, 0 - muls r2, r5 - adds r2, r3 - lsls r2, 1 - ldr r3, [r4, 0xC] - adds r6, r3, r2 - ldr r3, =0x03005dc0 - ldr r2, [r3] - muls r1, r2 - adds r1, r0 - lsls r1, 1 - ldr r0, [r3, 0x8] - adds r5, r0, r1 - ldr r0, [sp, 0x20] - cmp r0, 0 - ble _08087FA6 - adds r4, r0, 0 - ldr r3, =0x001fffff - mov r8, r3 -_08087F86: - adds r0, r6, 0 - adds r1, r5, 0 - ldr r2, [sp, 0x1C] - mov r3, r8 - ands r2, r3 - bl CpuSet - ldr r0, =0x03005dc0 - ldr r0, [r0] - lsls r0, 1 - adds r5, r0 - lsls r0, r7, 1 - adds r6, r0 - subs r4, 0x1 - cmp r4, 0 - bne _08087F86 -_08087FA6: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8087F54 - - thumb_func_start sub_8087FB8 -sub_8087FB8: @ 8087FB8 - push {r4-r7,lr} - sub sp, 0xC - adds r3, r0, 0 - adds r5, r1, 0 - cmp r5, 0 - beq _08088012 - ldr r0, [r5] - ldr r4, [r0] - adds r2, 0x7 - ldr r0, [r3] - ldr r0, [r0, 0x4] - adds r7, r0, 0x7 - cmp r2, 0 - bge _08087FEC - negs r6, r2 - adds r2, r4 - ldr r0, =0x03005dc0 - ldr r3, [r0] - cmp r2, r3 - bge _08087FE2 - adds r3, r2, 0 -_08087FE2: - movs r2, 0 - b _08087FFC - .pool -_08087FEC: - movs r6, 0 - adds r0, r2, r4 - ldr r1, =0x03005dc0 - ldr r1, [r1] - subs r3, r1, r2 - cmp r0, r1 - bge _08087FFC - adds r3, r4, 0 -_08087FFC: - movs r0, 0 - str r0, [sp] - str r3, [sp, 0x4] - movs r0, 0x7 - str r0, [sp, 0x8] - adds r0, r2, 0 - adds r1, r7, 0 - adds r2, r5, 0 - adds r3, r6, 0 - bl sub_8087F54 -_08088012: - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8087FB8 - - thumb_func_start sub_8088020 -sub_8088020: @ 8088020 - push {r4-r7,lr} - sub sp, 0xC - adds r5, r1, 0 - cmp r5, 0 - beq _08088074 - ldr r0, [r5] - ldr r4, [r0] - ldr r0, [r0, 0x4] - adds r2, 0x7 - subs r7, r0, 0x7 - cmp r2, 0 - bge _08088050 - negs r6, r2 - adds r2, r4 - ldr r0, =0x03005dc0 - ldr r3, [r0] - cmp r2, r3 - bge _08088046 - adds r3, r2, 0 -_08088046: - movs r2, 0 - b _08088060 - .pool -_08088050: - movs r6, 0 - adds r0, r2, r4 - ldr r1, =0x03005dc0 - ldr r1, [r1] - subs r3, r1, r2 - cmp r0, r1 - bge _08088060 - adds r3, r4, 0 -_08088060: - str r7, [sp] - str r3, [sp, 0x4] - movs r0, 0x7 - str r0, [sp, 0x8] - adds r0, r2, 0 - movs r1, 0 - adds r2, r5, 0 - adds r3, r6, 0 - bl sub_8087F54 -_08088074: - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8088020 - - thumb_func_start sub_8088080 -sub_8088080: @ 8088080 - push {r4-r7,lr} - sub sp, 0xC - adds r5, r1, 0 - cmp r5, 0 - beq _080880D4 - ldr r0, [r5] - ldr r1, [r0] - ldr r4, [r0, 0x4] - adds r2, 0x7 - subs r7, r1, 0x7 - cmp r2, 0 - bge _080880B0 - negs r6, r2 - adds r1, r2, r4 - ldr r0, =0x03005dc0 - ldr r3, [r0, 0x4] - cmp r1, r3 - bge _080880A6 - adds r3, r1, 0 -_080880A6: - movs r2, 0 - b _080880C0 - .pool -_080880B0: - movs r6, 0 - adds r0, r2, r4 - ldr r1, =0x03005dc0 - ldr r1, [r1, 0x4] - subs r3, r1, r2 - cmp r0, r1 - bge _080880C0 - adds r3, r4, 0 -_080880C0: - str r6, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - str r3, [sp, 0x8] - movs r0, 0 - adds r1, r2, 0 - adds r2, r5, 0 - adds r3, r7, 0 - bl sub_8087F54 -_080880D4: - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8088080 - - thumb_func_start sub_80880E0 -sub_80880E0: @ 80880E0 - push {r4-r7,lr} - sub sp, 0xC - adds r3, r0, 0 - adds r5, r1, 0 - cmp r5, 0 - beq _08088138 - ldr r0, [r5] - ldr r4, [r0, 0x4] - ldr r0, [r3] - ldr r0, [r0] - adds r7, r0, 0x7 - adds r2, 0x7 - cmp r2, 0 - bge _08088114 - negs r6, r2 - adds r1, r2, r4 - ldr r0, =0x03005dc0 - ldr r3, [r0, 0x4] - cmp r1, r3 - bge _0808810A - adds r3, r1, 0 -_0808810A: - movs r2, 0 - b _08088124 - .pool -_08088114: - movs r6, 0 - adds r0, r2, r4 - ldr r1, =0x03005dc0 - ldr r1, [r1, 0x4] - subs r3, r1, r2 - cmp r0, r1 - bge _08088124 - adds r3, r4, 0 -_08088124: - str r6, [sp] - movs r0, 0x8 - str r0, [sp, 0x4] - str r3, [sp, 0x8] - adds r0, r7, 0 - adds r1, r2, 0 - adds r2, r5, 0 - movs r3, 0 - bl sub_8087F54 -_08088138: - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80880E0 - - thumb_func_start MapGridGetZCoordAt -@ u8 MapGridGetZCoordAt(s32 x, s32 y) -MapGridGetZCoordAt: @ 8088144 - push {r4,lr} - adds r2, r0, 0 - adds r4, r1, 0 - cmp r2, 0 - blt _08088174 - ldr r1, =0x03005dc0 - ldr r3, [r1] - cmp r2, r3 - bge _08088174 - cmp r4, 0 - blt _08088174 - ldr r0, [r1, 0x4] - cmp r4, r0 - bge _08088174 - adds r0, r3, 0 - muls r0, r4 - adds r0, r2, r0 - ldr r1, [r1, 0x8] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - b _08088196 - .pool -_08088174: - ldr r0, =0x02037318 - ldr r3, [r0] - adds r1, r2, 0x1 - movs r2, 0x1 - ands r1, r2 - adds r0, r4, 0x1 - ands r0, r2 - lsls r0, 1 - adds r1, r0 - ldr r0, [r3, 0x8] - lsls r1, 1 - adds r1, r0 - ldrh r1, [r1] - movs r2, 0xC0 - lsls r2, 4 - adds r0, r2, 0 - orrs r1, r0 -_08088196: - ldr r0, =0x000003ff - cmp r1, r0 - beq _080881A8 - lsrs r0, r1, 12 - b _080881AA - .pool -_080881A8: - movs r0, 0 -_080881AA: - pop {r4} - pop {r1} - bx r1 - thumb_func_end MapGridGetZCoordAt - - thumb_func_start MapGridIsImpassableAt -@ u8 MapGridIsImpassableAt(s32 x, s32 y) -MapGridIsImpassableAt: @ 80881B0 - push {r4,lr} - adds r2, r0, 0 - adds r4, r1, 0 - cmp r2, 0 - blt _080881E0 - ldr r1, =0x03005dc0 - ldr r3, [r1] - cmp r2, r3 - bge _080881E0 - cmp r4, 0 - blt _080881E0 - ldr r0, [r1, 0x4] - cmp r4, r0 - bge _080881E0 - adds r0, r3, 0 - muls r0, r4 - adds r0, r2, r0 - ldr r1, [r1, 0x8] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - b _08088202 - .pool -_080881E0: - ldr r0, =0x02037318 - ldr r3, [r0] - adds r1, r2, 0x1 - movs r2, 0x1 - ands r1, r2 - adds r0, r4, 0x1 - ands r0, r2 - lsls r0, 1 - adds r1, r0 - ldr r0, [r3, 0x8] - lsls r1, 1 - adds r1, r0 - ldrh r1, [r1] - movs r2, 0xC0 - lsls r2, 4 - adds r0, r2, 0 - orrs r1, r0 -_08088202: - ldr r0, =0x000003ff - cmp r1, r0 - beq _0808821C - movs r0, 0xC0 - lsls r0, 4 - ands r1, r0 - lsrs r0, r1, 10 - b _0808821E - .pool -_0808821C: - movs r0, 0x1 -_0808821E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end MapGridIsImpassableAt - - thumb_func_start MapGridGetMetatileIdAt -@ u16 MapGridGetMetatileIdAt(s32 x, s32 y) -MapGridGetMetatileIdAt: @ 8088224 - push {r4-r6,lr} - adds r5, r0, 0 - adds r6, r1, 0 - cmp r5, 0 - blt _08088254 - ldr r1, =0x03005dc0 - ldr r2, [r1] - cmp r5, r2 - bge _08088254 - cmp r6, 0 - blt _08088254 - ldr r0, [r1, 0x4] - cmp r6, r0 - bge _08088254 - adds r0, r2, 0 - muls r0, r6 - adds r0, r5, r0 - ldr r1, [r1, 0x8] - lsls r0, 1 - adds r0, r1 - ldrh r4, [r0] - b _08088278 - .pool -_08088254: - ldr r0, =0x02037318 - ldr r3, [r0] - adds r1, r5, 0x1 - movs r2, 0x1 - ands r1, r2 - adds r0, r6, 0x1 - ands r0, r2 - lsls r0, 1 - adds r1, r0 - ldr r0, [r3, 0x8] - lsls r1, 1 - adds r1, r0 - ldrh r1, [r1] - movs r2, 0xC0 - lsls r2, 4 - adds r0, r2, 0 - adds r4, r0, 0 - orrs r4, r1 -_08088278: - ldr r0, =0x000003ff - cmp r4, r0 - beq _0808828C - ands r4, r0 - adds r0, r4, 0 - b _080882B0 - .pool -_0808828C: - ldr r0, =0x02037318 - ldr r3, [r0] - adds r1, r5, 0x1 - movs r2, 0x1 - ands r1, r2 - adds r0, r6, 0x1 - ands r0, r2 - lsls r0, 1 - adds r1, r0 - ldr r0, [r3, 0x8] - lsls r1, 1 - adds r1, r0 - ldrh r0, [r1] - movs r2, 0xC0 - lsls r2, 4 - adds r1, r2, 0 - orrs r0, r1 - ands r0, r4 -_080882B0: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end MapGridGetMetatileIdAt - - thumb_func_start MapGridGetMetatileBehaviorAt -@ u8 MapGridGetMetatileBehaviorAt(s32 x, s32 y) -MapGridGetMetatileBehaviorAt: @ 80882BC - push {lr} - bl MapGridGetMetatileIdAt - lsls r0, 16 - lsrs r0, 16 - bl GetBehaviorByMetatileId - adds r1, r0, 0 - movs r0, 0xFF - ands r0, r1 - pop {r1} - bx r1 - thumb_func_end MapGridGetMetatileBehaviorAt - - thumb_func_start MapGridGetMetatileLayerTypeAt -@ u8 MapGridGetMetatileLayerTypeAt(s32 x, s32 y) -MapGridGetMetatileLayerTypeAt: @ 80882D4 - push {lr} - bl MapGridGetMetatileIdAt - lsls r0, 16 - lsrs r0, 16 - bl GetBehaviorByMetatileId - adds r1, r0, 0 - movs r0, 0xF0 - lsls r0, 8 - ands r0, r1 - lsrs r0, 12 - pop {r1} - bx r1 - thumb_func_end MapGridGetMetatileLayerTypeAt - - thumb_func_start MapGridSetMetatileIdAt -@ void MapGridSetMetatileIdAt(s32 x, s32 y, u16 metatileId) -MapGridSetMetatileIdAt: @ 80882F0 - push {r4,r5,lr} - adds r3, r0, 0 - lsls r2, 16 - lsrs r5, r2, 16 - cmp r3, 0 - blt _08088328 - ldr r2, =0x03005dc0 - ldr r4, [r2] - cmp r3, r4 - bge _08088328 - cmp r1, 0 - blt _08088328 - ldr r0, [r2, 0x4] - cmp r1, r0 - bge _08088328 - muls r1, r4 - adds r1, r3, r1 - ldr r0, [r2, 0x8] - lsls r1, 1 - adds r1, r0 - ldrh r0, [r1] - movs r2, 0xF0 - lsls r2, 8 - ands r2, r0 - ldr r0, =0x00000fff - ands r0, r5 - orrs r2, r0 - strh r2, [r1] -_08088328: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end MapGridSetMetatileIdAt - - thumb_func_start MapGridSetMetatileEntryAt -@ void MapGridSetMetatileEntryAt(s32 x, s32 y, u16 metatileEntry) -MapGridSetMetatileEntryAt: @ 8088338 - push {r4,r5,lr} - adds r3, r0, 0 - lsls r2, 16 - lsrs r5, r2, 16 - cmp r3, 0 - blt _08088364 - ldr r2, =0x03005dc0 - ldr r4, [r2] - cmp r3, r4 - bge _08088364 - cmp r1, 0 - blt _08088364 - ldr r0, [r2, 0x4] - cmp r1, r0 - bge _08088364 - adds r0, r4, 0 - muls r0, r1 - adds r0, r3, r0 - ldr r1, [r2, 0x8] - lsls r0, 1 - adds r0, r1 - strh r5, [r0] -_08088364: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end MapGridSetMetatileEntryAt - - thumb_func_start GetBehaviorByMetatileId -@ u16 GetBehaviorByMetatileId(u16 metatileId) -GetBehaviorByMetatileId: @ 8088370 - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - adds r3, r2, 0 - ldr r0, =0x000001ff - cmp r2, r0 - bhi _08088394 - ldr r0, =0x02037318 - ldr r0, [r0] - ldr r0, [r0, 0x10] - ldr r1, [r0, 0x10] - lsls r0, r2, 1 - b _080883B2 - .pool -_08088394: - ldr r0, =0x000003ff - cmp r2, r0 - bls _080883A4 - movs r0, 0xFF - b _080883B6 - .pool -_080883A4: - ldr r0, =0x02037318 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldr r1, [r0, 0x10] - lsls r0, r3, 1 - adds r0, r1 - ldr r1, =0xfffffc00 -_080883B2: - adds r0, r1 - ldrh r0, [r0] -_080883B6: - pop {r1} - bx r1 - .pool - thumb_func_end GetBehaviorByMetatileId - - thumb_func_start save_serialize_map -save_serialize_map: @ 80883C4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r0, =0x03005d8c - ldr r1, [r0] - adds r4, r1, 0 - adds r4, 0x34 - ldr r0, =0x03005dc0 - ldr r0, [r0] - mov r8, r0 - movs r0, 0 - ldrsh r6, [r1, r0] - movs r2, 0x2 - ldrsh r0, [r1, r2] - adds r1, r0, 0 - adds r1, 0xE - cmp r0, r1 - bge _08088420 - mov r12, r1 - ldr r1, =0x02032318 - mov r9, r1 - lsls r7, r6, 1 -_080883F2: - adds r1, r6, 0 - adds r3, r1, 0 - adds r3, 0xF - adds r5, r0, 0x1 - cmp r1, r3 - bge _0808841A - mov r2, r8 - muls r2, r0 - adds r0, r2, 0 - lsls r0, 1 - add r0, r9 - adds r2, r7, r0 - subs r1, r3, r1 -_0808840C: - ldrh r0, [r2] - strh r0, [r4] - adds r4, 0x2 - adds r2, 0x2 - subs r1, 0x1 - cmp r1, 0 - bne _0808840C -_0808841A: - adds r0, r5, 0 - cmp r0, r12 - blt _080883F2 -_08088420: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end save_serialize_map - - thumb_func_start sub_8088438 -sub_8088438: @ 8088438 - push {r4,lr} - movs r2, 0 - movs r1, 0 - ldr r0, =0x03005d8c - ldr r0, [r0] - adds r3, r0, 0 - adds r3, 0x34 - ldr r4, =0x000001ff -_08088448: - lsls r0, r1, 1 - adds r0, r3, r0 - ldrh r0, [r0] - orrs r2, r0 - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r4 - bls _08088448 - cmp r2, 0 - beq _0808846C - movs r0, 0 - b _0808846E - .pool -_0808846C: - movs r0, 0x1 -_0808846E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8088438 - - thumb_func_start sav2_mapdata_clear -sav2_mapdata_clear: @ 8088474 - push {lr} - sub sp, 0x4 - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r0, =0x03005d8c - ldr r1, [r0] - adds r1, 0x34 - ldr r2, =0x01000100 - mov r0, sp - bl CpuSet - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sav2_mapdata_clear - - thumb_func_start mapdata_from_sav2 -mapdata_from_sav2: @ 808849C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - ldr r4, =0x03005d8c - ldr r0, [r4] - adds r7, r0, 0 - adds r7, 0x34 - bl sub_8088438 - cmp r0, 0 - bne _080885AC - ldr r0, =0x03005dc0 - ldr r0, [r0] - str r0, [sp] - ldr r0, [r4] - movs r2, 0 - ldrsh r1, [r0, r2] - mov r10, r1 - movs r2, 0x2 - ldrsh r1, [r0, r2] - mov r8, r1 - mov r6, r8 - adds r0, r6, 0 - adds r0, 0xE - cmp r6, r0 - bge _0808855A -_080884D6: - cmp r6, r8 - bne _080884EC - cmp r6, 0 - beq _080884EC - movs r0, 0 - mov r9, r0 - b _08088508 - .pool -_080884EC: - mov r0, r8 - adds r0, 0xD - movs r1, 0xFF - mov r9, r1 - cmp r6, r0 - bne _08088508 - ldr r0, =0x02037318 - ldr r0, [r0] - ldr r0, [r0, 0x4] - subs r0, 0x1 - cmp r6, r0 - beq _08088508 - movs r2, 0x1 - mov r9, r2 -_08088508: - mov r5, r10 - adds r0, r5, 0 - adds r0, 0xF - mov r1, r8 - adds r1, 0xE - str r1, [sp, 0x8] - adds r2, r6, 0x1 - str r2, [sp, 0x4] - cmp r5, r0 - bge _08088552 - ldr r0, [sp] - lsls r3, r0, 16 -_08088520: - ldr r1, [sp] - adds r0, r1, 0 - muls r0, r6 - adds r0, r5, r0 - lsls r0, 1 - ldr r1, =0x02032318 - adds r4, r0, r1 - adds r0, r4, 0 - lsrs r1, r3, 16 - mov r2, r9 - str r3, [sp, 0xC] - bl sub_8088BF0 - lsls r0, 24 - ldr r3, [sp, 0xC] - cmp r0, 0 - bne _08088546 - ldrh r0, [r7] - strh r0, [r4] -_08088546: - adds r7, 0x2 - adds r5, 0x1 - mov r0, r10 - adds r0, 0xF - cmp r5, r0 - blt _08088520 -_08088552: - ldr r6, [sp, 0x4] - ldr r2, [sp, 0x8] - cmp r6, r2 - blt _080884D6 -_0808855A: - mov r5, r10 - adds r0, r5, 0 - adds r0, 0xF - cmp r5, r0 - bge _080885A8 - mov r0, r8 - subs r0, 0x1 - lsls r0, 16 - mov r9, r0 - lsls r4, r5, 16 - mov r0, r8 - adds r0, 0xD - lsls r7, r0, 16 -_08088574: - mov r0, r8 - cmp r0, 0 - beq _08088584 - asrs r0, r4, 16 - mov r2, r9 - asrs r1, r2, 16 - bl sub_80D423C -_08088584: - ldr r0, =0x02037318 - ldr r0, [r0] - ldr r0, [r0, 0x4] - subs r0, 0x1 - cmp r6, r0 - bge _08088598 - asrs r0, r4, 16 - asrs r1, r7, 16 - bl sub_80D42B8 -_08088598: - movs r0, 0x80 - lsls r0, 9 - adds r4, r0 - adds r5, 0x1 - mov r0, r10 - adds r0, 0xF - cmp r5, r0 - blt _08088574 -_080885A8: - bl sav2_mapdata_clear -_080885AC: - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end mapdata_from_sav2 - - thumb_func_start sub_80885C4 -sub_80885C4: @ 80885C4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - lsls r0, 24 - lsrs r3, r0, 24 - adds r2, r3, 0 - ldr r0, =0x03005d8c - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x34 - str r0, [sp, 0x4] - ldr r0, =0x03005dc0 - ldr r0, [r0] - str r0, [sp] - movs r4, 0 - mov r9, r4 - mov r8, r4 - movs r0, 0 - ldrsh r6, [r1, r0] - str r6, [sp, 0x8] - movs r4, 0x2 - ldrsh r5, [r1, r4] - movs r7, 0xF - movs r6, 0xE - mov r12, r6 - cmp r3, 0x2 - beq _0808861E - cmp r3, 0x2 - bgt _08088614 - cmp r3, 0x1 - beq _08088626 - b _0808863E - .pool -_08088614: - cmp r2, 0x3 - beq _08088630 - cmp r2, 0x4 - beq _08088638 - b _0808863E -_0808861E: - adds r5, 0x1 - movs r0, 0xD - mov r12, r0 - b _0808863E -_08088626: - movs r1, 0x1 - mov r8, r1 - movs r3, 0xD - mov r12, r3 - b _0808863E -_08088630: - ldr r4, [sp, 0x8] - adds r4, 0x1 - str r4, [sp, 0x8] - b _0808863C -_08088638: - movs r6, 0x1 - mov r9, r6 -_0808863C: - movs r7, 0xE -_0808863E: - movs r1, 0 - cmp r1, r12 - bge _08088682 - ldr r0, =0x02032318 - mov r10, r0 -_08088648: - adds r4, r1, 0x1 - cmp r7, 0 - beq _0808867C - adds r0, r1, r5 - ldr r3, [sp] - adds r2, r3, 0 - muls r2, r0 - add r1, r8 - lsls r0, r1, 4 - subs r0, r1 - add r0, r9 - ldr r6, [sp, 0x8] - adds r2, r6, r2 - adds r3, r7, 0 - lsls r2, 1 - add r2, r10 - lsls r0, 1 - ldr r6, [sp, 0x4] - adds r1, r0, r6 -_0808866E: - ldrh r0, [r1] - strh r0, [r2] - adds r1, 0x2 - adds r2, 0x2 - subs r3, 0x1 - cmp r3, 0 - bne _0808866E -_0808867C: - adds r1, r4, 0 - cmp r1, r12 - blt _08088648 -_08088682: - bl sav2_mapdata_clear - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80885C4 - - thumb_func_start GetMapBorderIdAt -@ u32 GetMapBorderIdAt(s32 x, s32 y) -GetMapBorderIdAt: @ 808869C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - cmp r4, 0 - blt _080886D8 - ldr r1, =0x03005dc0 - ldr r2, [r1] - cmp r4, r2 - bge _080886D8 - cmp r5, 0 - blt _080886D8 - ldr r0, [r1, 0x4] - cmp r5, r0 - bge _080886D8 - adds r0, r2, 0 - muls r0, r5 - adds r0, r4, r0 - ldr r1, [r1, 0x8] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - ldr r0, =0x000003ff - cmp r1, r0 - beq _08088770 - b _08088700 - .pool -_080886D8: - ldr r0, =0x02037318 - ldr r3, [r0] - adds r1, r4, 0x1 - movs r2, 0x1 - ands r1, r2 - adds r0, r5, 0x1 - ands r0, r2 - lsls r0, 1 - adds r1, r0 - ldr r0, [r3, 0x8] - lsls r1, 1 - adds r1, r0 - ldrh r1, [r1] - movs r2, 0xC0 - lsls r2, 4 - adds r0, r2, 0 - orrs r0, r1 - ldr r1, =0x000003ff - cmp r0, r1 - beq _08088770 -_08088700: - ldr r1, =0x03005dc0 - ldr r0, [r1] - subs r0, 0x8 - cmp r4, r0 - blt _0808872C - ldr r0, =0x02037340 - ldrb r1, [r0] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _08088770 - movs r0, 0x4 - b _08088782 - .pool -_0808872C: - cmp r4, 0x6 - bgt _08088744 - ldr r0, =0x02037340 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08088770 - movs r0, 0x3 - b _08088782 - .pool -_08088744: - ldr r0, [r1, 0x4] - subs r0, 0x7 - cmp r5, r0 - blt _08088760 - ldr r0, =0x02037340 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08088770 - movs r0, 0x1 - b _08088782 - .pool -_08088760: - cmp r5, 0x6 - bgt _08088780 - ldr r0, =0x02037340 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _0808877C -_08088770: - movs r0, 0x1 - negs r0, r0 - b _08088782 - .pool -_0808877C: - movs r0, 0x2 - b _08088782 -_08088780: - movs r0, 0 -_08088782: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end GetMapBorderIdAt - - thumb_func_start GetPostCameraMoveMapBorderId -@ u32 GetPostCameraMoveMapBorderId(s32 deltaX, s32 deltaY) -GetPostCameraMoveMapBorderId: @ 8088788 - push {r4,lr} - adds r3, r1, 0 - ldr r1, =0x03005d8c - ldr r1, [r1] - movs r4, 0 - ldrsh r2, [r1, r4] - adds r0, 0x7 - adds r2, r0 - movs r0, 0x2 - ldrsh r1, [r1, r0] - adds r3, 0x7 - adds r1, r3 - adds r0, r2, 0 - bl GetMapBorderIdAt - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetPostCameraMoveMapBorderId - - thumb_func_start CanCameraMoveInDirection -@ bool32 CanCameraMoveInDirection(u8 direction) -CanCameraMoveInDirection: @ 80887B0 - push {r4,r5,lr} - ldr r1, =0x03005d8c - ldr r4, [r1] - movs r1, 0 - ldrsh r3, [r4, r1] - ldr r2, =gUnknown_08339D64 - lsls r0, 3 - adds r1, r0, r2 - ldr r1, [r1] - adds r1, 0x7 - adds r3, r1 - movs r5, 0x2 - ldrsh r1, [r4, r5] - adds r2, 0x4 - adds r0, r2 - ldr r0, [r0] - adds r0, 0x7 - adds r1, r0 - adds r0, r3, 0 - bl GetMapBorderIdAt - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080887F0 - movs r0, 0x1 - b _080887F2 - .pool -_080887F0: - movs r0, 0 -_080887F2: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end CanCameraMoveInDirection - - thumb_func_start sub_80887F8 -sub_80887F8: @ 80887F8 - push {r4-r7,lr} - adds r5, r0, 0 - adds r4, r1, 0 - adds r6, r2, 0 - adds r7, r3, 0 - bl mapconnection_get_mapheader - adds r3, r0, 0 - cmp r4, 0x2 - beq _08088860 - cmp r4, 0x2 - bgt _08088816 - cmp r4, 0x1 - beq _0808884C - b _08088872 -_08088816: - cmp r4, 0x3 - beq _08088834 - cmp r4, 0x4 - bne _08088872 - ldr r0, =0x03005d8c - ldr r1, [r0] - negs r0, r6 - strh r0, [r1] - ldr r2, [r5, 0x4] - ldrh r0, [r1, 0x2] - subs r0, r2 - b _08088870 - .pool -_08088834: - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r0, [r3] - ldr r0, [r0] - strh r0, [r1] - ldr r2, [r5, 0x4] - ldrh r0, [r1, 0x2] - subs r0, r2 - b _08088870 - .pool -_0808884C: - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r2, [r5, 0x4] - ldrh r0, [r1] - subs r0, r2 - strh r0, [r1] - negs r0, r7 - b _08088870 - .pool -_08088860: - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r2, [r5, 0x4] - ldrh r0, [r1] - subs r0, r2 - strh r0, [r1] - ldr r0, [r3] - ldr r0, [r0, 0x4] -_08088870: - strh r0, [r1, 0x2] -_08088872: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80887F8 - - thumb_func_start CameraMove -@ u8 CameraMove(s32 deltaX, s32 deltaY) -CameraMove: @ 808887C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r10, r0 - mov r9, r1 - ldr r1, =0x02037334 - ldrb r0, [r1] - movs r1, 0x2 - negs r1, r1 - ands r1, r0 - ldr r2, =0x02037334 - strb r1, [r2] - mov r0, r10 - mov r1, r9 - bl GetPostCameraMoveMapBorderId - adds r7, r0, 0 - adds r0, r7, 0x1 - cmp r0, 0x1 - bhi _080888C4 - ldr r0, =0x03005d8c - ldr r1, [r0] - ldrh r0, [r1] - add r0, r10 - strh r0, [r1] - ldrh r0, [r1, 0x2] - add r0, r9 - strh r0, [r1, 0x2] - b _08088932 - .pool -_080888C4: - bl save_serialize_map - bl sub_81BE72C - ldr r1, =0x03005d8c - ldr r0, [r1] - movs r2, 0 - ldrsh r5, [r0, r2] - movs r1, 0x2 - ldrsh r6, [r0, r1] - lsls r2, r7, 24 - lsrs r2, 24 - mov r8, r2 - mov r0, r8 - adds r1, r5, 0 - adds r2, r6, 0 - bl sub_8088950 - adds r4, r0, 0 - adds r1, r7, 0 - mov r2, r10 - mov r3, r9 - bl sub_80887F8 - ldrb r0, [r4, 0x8] - ldrb r1, [r4, 0x9] - bl mliX_load_map - ldr r1, =0x02037334 - ldrb r0, [r1] - movs r1, 0x1 - orrs r0, r1 - ldr r2, =0x02037334 - strb r0, [r2] - ldr r0, =0x03005d8c - ldr r1, [r0] - movs r2, 0 - ldrsh r0, [r1, r2] - subs r5, r0 - ldr r0, =0x02037334 - str r5, [r0, 0x4] - movs r2, 0x2 - ldrsh r0, [r1, r2] - subs r6, r0 - ldr r0, =0x02037334 - str r6, [r0, 0x8] - ldrh r0, [r1] - add r0, r10 - strh r0, [r1] - ldrh r0, [r1, 0x2] - add r0, r9 - strh r0, [r1, 0x2] - mov r0, r8 - bl sub_80885C4 -_08088932: - ldr r0, =0x02037334 - ldrb r0, [r0] - lsls r0, 31 - lsrs r0, 31 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end CameraMove - - thumb_func_start sub_8088950 -sub_8088950: @ 8088950 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - mov r9, r1 - mov r8, r2 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x02037318 - ldr r0, [r0, 0xC] - ldr r7, [r0] - ldr r4, [r0, 0x4] - movs r5, 0 - cmp r5, r7 - bge _08088998 -_0808896E: - ldrb r0, [r4] - cmp r0, r6 - bne _08088990 - adds r0, r6, 0 - mov r1, r9 - mov r2, r8 - adds r3, r4, 0 - bl sub_80889A8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08088990 - adds r0, r4, 0 - b _0808899A - .pool -_08088990: - adds r5, 0x1 - adds r4, 0xC - cmp r5, r7 - blt _0808896E -_08088998: - movs r0, 0 -_0808899A: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8088950 - - thumb_func_start sub_80889A8 -sub_80889A8: @ 80889A8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r7, r1, 0 - mov r8, r2 - adds r5, r3, 0 - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - adds r0, r5, 0 - bl mapconnection_get_mapheader - adds r2, r0, 0 - cmp r4, 0x1 - blt _08088A00 - cmp r4, 0x2 - bgt _080889E0 - ldr r0, =0x02037318 - ldr r0, [r0] - ldr r1, [r0] - ldr r0, [r2] - ldr r2, [r0] - ldr r3, [r5, 0x4] - adds r0, r7, 0 - b _080889F2 - .pool -_080889E0: - cmp r6, 0x4 - bgt _08088A00 - ldr r0, =0x02037318 - ldr r0, [r0] - ldr r1, [r0, 0x4] - ldr r0, [r2] - ldr r2, [r0, 0x4] - ldr r3, [r5, 0x4] - mov r0, r8 -_080889F2: - bl sub_8088A0C - lsls r0, 24 - lsrs r0, 24 - b _08088A02 - .pool -_08088A00: - movs r0, 0 -_08088A02: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80889A8 - - thumb_func_start sub_8088A0C -sub_8088A0C: @ 8088A0C - push {r4,lr} - adds r4, r0, 0 - adds r0, r2, 0 - adds r2, r3, 0 - cmp r3, 0 - bge _08088A1A - movs r3, 0 -_08088A1A: - adds r2, r0, r2 - cmp r2, r1 - bge _08088A22 - adds r1, r2, 0 -_08088A22: - cmp r3, r4 - bgt _08088A2E - cmp r4, r1 - bgt _08088A2E - movs r0, 0x1 - b _08088A30 -_08088A2E: - movs r0, 0 -_08088A30: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8088A0C - - thumb_func_start sub_8088A38 -sub_8088A38: @ 8088A38 - push {lr} - cmp r0, 0 - blt _08088A46 - cmp r0, r1 - bge _08088A46 - movs r0, 0x1 - b _08088A48 -_08088A46: - movs r0, 0 -_08088A48: - pop {r1} - bx r1 - thumb_func_end sub_8088A38 - - thumb_func_start sub_8088A4C -sub_8088A4C: @ 8088A4C - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - bl mapconnection_get_mapheader - adds r1, r0, 0 - ldrb r0, [r4] - cmp r0, 0x1 - blt _08088A84 - cmp r0, 0x2 - bgt _08088A72 - ldr r0, [r4, 0x4] - subs r0, r5, r0 - ldr r1, [r1] - ldr r1, [r1] - bl sub_8088A38 - b _08088A86 -_08088A72: - cmp r0, 0x4 - bgt _08088A84 - ldr r0, [r4, 0x4] - subs r0, r6, r0 - ldr r1, [r1] - ldr r1, [r1, 0x4] - bl sub_8088A38 - b _08088A86 -_08088A84: - movs r0, 0 -_08088A86: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8088A4C - - thumb_func_start sub_8088A8C -sub_8088A8C: @ 8088A8C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r1, 16 - lsrs r1, 16 - ldr r2, =0x02037318 - ldr r0, [r2, 0xC] - cmp r0, 0 - bne _08088AB4 - b _08088B2A - .pool -_08088AB0: - adds r0, r4, 0 - b _08088B2C -_08088AB4: - ldr r7, [r0] - ldr r4, [r0, 0x4] - movs r6, 0 - cmp r6, r7 - bge _08088B2A - lsls r0, r1, 16 - asrs r5, r0, 16 - mov r9, r2 - mov r1, r8 - lsls r0, r1, 16 - asrs r0, 16 - mov r10, r0 -_08088ACC: - ldrb r1, [r4] - adds r3, r1, 0 - subs r0, r1, 0x5 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _08088B22 - cmp r1, 0x2 - bne _08088AE2 - cmp r5, 0x6 - bgt _08088B22 -_08088AE2: - cmp r1, 0x1 - bne _08088AF2 - mov r2, r9 - ldr r0, [r2] - ldr r0, [r0, 0x4] - adds r0, 0x7 - cmp r5, r0 - blt _08088B22 -_08088AF2: - mov r0, r8 - lsls r2, r0, 16 - cmp r1, 0x3 - bne _08088B00 - mov r1, r10 - cmp r1, 0x6 - bgt _08088B22 -_08088B00: - cmp r3, 0x4 - bne _08088B12 - asrs r1, r2, 16 - mov r3, r9 - ldr r0, [r3] - ldr r0, [r0] - adds r0, 0x7 - cmp r1, r0 - blt _08088B22 -_08088B12: - asrs r1, r2, 16 - subs r1, 0x7 - adds r0, r4, 0 - subs r2, r5, 0x7 - bl sub_8088A4C - cmp r0, 0x1 - beq _08088AB0 -_08088B22: - adds r6, 0x1 - adds r4, 0xC - cmp r6, r7 - blt _08088ACC -_08088B2A: - movs r0, 0 -_08088B2C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8088A8C - - thumb_func_start sub_8088B3C -sub_8088B3C: @ 8088B3C - lsls r0, 16 - lsrs r0, 16 - lsls r1, 16 - lsrs r1, 16 - ldr r2, =0x03005d8c - ldr r2, [r2] - subs r0, 0x7 - strh r0, [r2] - subs r1, 0x7 - strh r1, [r2, 0x2] - bx lr - .pool - thumb_func_end sub_8088B3C - - thumb_func_start sav1_camera_get_focus_coords -sav1_camera_get_focus_coords: @ 8088B58 - ldr r2, =0x03005d8c - ldr r3, [r2] - ldrh r2, [r3] - adds r2, 0x7 - strh r2, [r0] - ldrh r0, [r3, 0x2] - adds r0, 0x7 - strh r0, [r1] - bx lr - .pool - thumb_func_end sav1_camera_get_focus_coords - - thumb_func_start SetCameraCoords -@ void SetCameraCoords(u16 x, u16 y) -SetCameraCoords: @ 8088B70 - ldr r2, =0x03005d8c - ldr r2, [r2] - strh r0, [r2] - strh r1, [r2, 0x2] - bx lr - .pool - thumb_func_end SetCameraCoords - - thumb_func_start GetCameraCoords -@ void GetCameraCoords(u16 *x, u16 *y) -GetCameraCoords: @ 8088B80 - ldr r2, =0x03005d8c - ldr r3, [r2] - ldrh r2, [r3] - strh r2, [r0] - ldrh r0, [r3, 0x2] - strh r0, [r1] - bx lr - .pool - thumb_func_end GetCameraCoords - - thumb_func_start sub_8088B94 -sub_8088B94: @ 8088B94 - push {r4,r5,lr} - adds r4, r0, 0 - adds r3, r1, 0 - adds r5, r2, 0 - cmp r4, 0 - blt _08088BE6 - ldr r2, =0x03005dc0 - ldr r1, [r2] - cmp r4, r1 - bge _08088BE6 - cmp r3, 0 - blt _08088BE6 - ldr r0, [r2, 0x4] - cmp r3, r0 - bge _08088BE6 - cmp r5, 0 - beq _08088BD4 - adds r0, r1, 0 - muls r0, r3 - adds r0, r4, r0 - ldr r1, [r2, 0x8] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r3, 0xC0 - lsls r3, 4 - adds r2, r3, 0 - orrs r1, r2 - strh r1, [r0] - b _08088BE6 - .pool -_08088BD4: - muls r1, r3 - adds r1, r4, r1 - ldr r0, [r2, 0x8] - lsls r1, 1 - adds r1, r0 - ldrh r2, [r1] - ldr r0, =0x0000f3ff - ands r0, r2 - strh r0, [r1] -_08088BE6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8088B94 - - thumb_func_start sub_8088BF0 -sub_8088BF0: @ 8088BF0 - push {lr} - adds r3, r0, 0 - lsls r1, 16 - lsrs r0, r1, 16 - adds r1, r0, 0 - lsls r2, 24 - lsrs r2, 24 - cmp r2, 0xFF - beq _08088C24 - cmp r2, 0 - bne _08088C0C - lsls r0, 1 - subs r3, r0 - b _08088C10 -_08088C0C: - lsls r0, r1, 1 - adds r3, r0 -_08088C10: - ldrh r1, [r3] - ldr r0, =0x000003ff - ands r0, r1 - adds r1, r2, 0 - bl sub_80FADE4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08088C2C -_08088C24: - movs r0, 0 - b _08088C2E - .pool -_08088C2C: - movs r0, 0x1 -_08088C2E: - pop {r1} - bx r1 - thumb_func_end sub_8088BF0 - - thumb_func_start copy_tileset_patterns_to_vram -@ void copy_tileset_patterns_to_vram(tileset *tileset, int num_tiles, int offset) -copy_tileset_patterns_to_vram: @ 8088C34 - push {r4-r7,lr} - sub sp, 0x4 - adds r3, r0, 0 - lsls r1, 16 - lsrs r4, r1, 16 - adds r6, r4, 0 - lsls r2, 16 - lsrs r5, r2, 16 - adds r7, r5, 0 - cmp r3, 0 - beq _08088C70 - ldrb r0, [r3] - cmp r0, 0 - bne _08088C60 - ldr r1, [r3, 0x4] - lsls r2, r4, 21 - lsrs r2, 16 - movs r0, 0x2 - adds r3, r5, 0 - bl LoadBgTiles - b _08088C70 -_08088C60: - ldr r1, [r3, 0x4] - lsls r2, r6, 5 - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - adds r3, r7, 0 - bl decompress_and_copy_tile_data_to_vram -_08088C70: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end copy_tileset_patterns_to_vram - - thumb_func_start copy_tileset_patterns_to_vram2 -@ void copy_tileset_patterns_to_vram2(tileset *tileset, int num_tiles, int offset) -copy_tileset_patterns_to_vram2: @ 8088C78 - push {r4-r7,lr} - sub sp, 0x4 - adds r3, r0, 0 - lsls r1, 16 - lsrs r4, r1, 16 - adds r6, r4, 0 - lsls r2, 16 - lsrs r5, r2, 16 - adds r7, r5, 0 - cmp r3, 0 - beq _08088CB4 - ldrb r0, [r3] - cmp r0, 0 - bne _08088CA4 - ldr r1, [r3, 0x4] - lsls r2, r4, 21 - lsrs r2, 16 - movs r0, 0x2 - adds r3, r5, 0 - bl LoadBgTiles - b _08088CB4 -_08088CA4: - ldr r1, [r3, 0x4] - lsls r2, r6, 5 - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - adds r3, r7, 0 - bl copy_decompressed_tile_data_to_vram_autofree -_08088CB4: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end copy_tileset_patterns_to_vram2 - - thumb_func_start nullsub_3 -nullsub_3: @ 8088CBC - bx lr - thumb_func_end nullsub_3 - - thumb_func_start nullsub_90 -nullsub_90: @ 8088CC0 - bx lr - thumb_func_end nullsub_90 - - thumb_func_start apply_map_tileset_palette -@ void apply_map_tileset_palette(tileset *tileset, int dest_offset, int size) -apply_map_tileset_palette: @ 8088CC4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r4, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - mov r8, r5 - lsls r6, r2, 16 - lsrs r7, r6, 16 - adds r2, r7, 0 - movs r1, 0 - mov r0, sp - strh r1, [r0] - cmp r4, 0 - beq _08088D42 - ldrb r0, [r4, 0x1] - cmp r0, 0 - bne _08088D18 - mov r0, sp - adds r1, r5, 0 - movs r2, 0x2 - bl gpu_pal_apply - ldr r0, [r4, 0x8] - adds r0, 0x2 - adds r5, 0x1 - lsls r5, 16 - lsrs r5, 16 - subs r4, r7, 0x2 - lsls r2, r4, 16 - lsrs r2, 16 - adds r1, r5, 0 - bl gpu_pal_apply - lsls r4, 15 - lsrs r4, 16 - adds r0, r5, 0 - adds r1, r4, 0 - bl nullsub_3 - b _08088D42 -_08088D18: - cmp r0, 0x1 - bne _08088D32 - ldr r0, [r4, 0x8] - adds r0, 0xC0 - adds r1, r5, 0 - adds r2, r7, 0 - bl gpu_pal_apply - lsrs r1, r6, 17 - adds r0, r5, 0 - bl nullsub_3 - b _08088D42 -_08088D32: - ldr r0, [r4, 0x8] - mov r1, r8 - bl decompress_palette - lsrs r1, r6, 17 - mov r0, r8 - bl nullsub_3 -_08088D42: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end apply_map_tileset_palette - - thumb_func_start copy_map_tileset1_to_vram -@ void copy_map_tileset1_to_vram(mapdata_header *a1) -copy_map_tileset1_to_vram: @ 8088D50 - push {lr} - ldr r0, [r0, 0x10] - movs r1, 0x80 - lsls r1, 2 - movs r2, 0 - bl copy_tileset_patterns_to_vram - pop {r0} - bx r0 - thumb_func_end copy_map_tileset1_to_vram - - thumb_func_start copy_map_tileset2_to_vram -@ void copy_map_tileset2_to_vram(mapdata_header *a1) -copy_map_tileset2_to_vram: @ 8088D64 - push {lr} - ldr r0, [r0, 0x14] - movs r2, 0x80 - lsls r2, 2 - adds r1, r2, 0 - bl copy_tileset_patterns_to_vram - pop {r0} - bx r0 - thumb_func_end copy_map_tileset2_to_vram - - thumb_func_start copy_map_tileset2_to_vram_2 -@ void copy_map_tileset2_to_vram_2(mapdata_header *a1) -copy_map_tileset2_to_vram_2: @ 8088D78 - push {lr} - ldr r0, [r0, 0x14] - movs r2, 0x80 - lsls r2, 2 - adds r1, r2, 0 - bl copy_tileset_patterns_to_vram2 - pop {r0} - bx r0 - thumb_func_end copy_map_tileset2_to_vram_2 - - thumb_func_start apply_map_tileset1_palette -@ void apply_map_tileset1_palette(mapdata_header *a1) -apply_map_tileset1_palette: @ 8088D8C - push {lr} - ldr r0, [r0, 0x10] - movs r1, 0 - movs r2, 0xC0 - bl apply_map_tileset_palette - pop {r0} - bx r0 - thumb_func_end apply_map_tileset1_palette - - thumb_func_start apply_map_tileset2_palette -@ void apply_map_tileset2_palette(mapdata_header *a1) -apply_map_tileset2_palette: @ 8088D9C - push {lr} - ldr r0, [r0, 0x14] - movs r1, 0x60 - movs r2, 0xE0 - bl apply_map_tileset_palette - pop {r0} - bx r0 - thumb_func_end apply_map_tileset2_palette - - thumb_func_start copy_map_tileset1_tileset2_to_vram -@ void copy_map_tileset1_tileset2_to_vram(mapdata_header *a1) -copy_map_tileset1_tileset2_to_vram: @ 8088DAC - push {r4,r5,lr} - adds r5, r0, 0 - cmp r5, 0 - beq _08088DCC - ldr r0, [r5, 0x10] - movs r4, 0x80 - lsls r4, 2 - adds r1, r4, 0 - movs r2, 0 - bl copy_tileset_patterns_to_vram2 - ldr r0, [r5, 0x14] - adds r1, r4, 0 - adds r2, r4, 0 - bl copy_tileset_patterns_to_vram2 -_08088DCC: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end copy_map_tileset1_tileset2_to_vram - - thumb_func_start apply_map_tileset1_tileset2_palette -@ void apply_map_tileset1_tileset2_palette(mapdata_header *a1) -apply_map_tileset1_tileset2_palette: @ 8088DD4 - push {r4,lr} - adds r4, r0, 0 - cmp r4, 0 - beq _08088DE6 - bl apply_map_tileset1_palette - adds r0, r4, 0 - bl apply_map_tileset2_palette -_08088DE6: - pop {r4} - pop {r0} - bx r0 - thumb_func_end apply_map_tileset1_tileset2_palette - - thumb_func_start ShouldDoJumpLandingDustEffect -ShouldDoJumpLandingDustEffect: @ 8088DEC - movs r0, 0x1 - bx lr - thumb_func_end ShouldDoJumpLandingDustEffect - - thumb_func_start sub_8088DF0 -sub_8088DF0: @ 8088DF0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_08486EFC - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08088E0C - movs r0, 0 - b _08088E0E - .pool -_08088E0C: - movs r0, 0x1 -_08088E0E: - pop {r1} - bx r1 - thumb_func_end sub_8088DF0 - - thumb_func_start MetatileBehavior_IsJumpEast -MetatileBehavior_IsJumpEast: @ 8088E14 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x38 - beq _08088E22 - movs r0, 0 - b _08088E24 -_08088E22: - movs r0, 0x1 -_08088E24: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsJumpEast - - thumb_func_start MetatileBehavior_IsJumpWest -MetatileBehavior_IsJumpWest: @ 8088E28 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x39 - beq _08088E36 - movs r0, 0 - b _08088E38 -_08088E36: - movs r0, 0x1 -_08088E38: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsJumpWest - - thumb_func_start MetatileBehavior_IsJumpNorth -MetatileBehavior_IsJumpNorth: @ 8088E3C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3A - beq _08088E4A - movs r0, 0 - b _08088E4C -_08088E4A: - movs r0, 0x1 -_08088E4C: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsJumpNorth - - thumb_func_start MetatileBehavior_IsJumpSouth -MetatileBehavior_IsJumpSouth: @ 8088E50 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3B - beq _08088E5E - movs r0, 0 - b _08088E60 -_08088E5E: - movs r0, 0x1 -_08088E60: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsJumpSouth - - thumb_func_start sub_8088E64 -sub_8088E64: @ 8088E64 - push {lr} - lsls r0, 24 - movs r1, 0xFE - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1 - bls _08088E78 - movs r0, 0 - b _08088E7A -_08088E78: - movs r0, 0x1 -_08088E7A: - pop {r1} - bx r1 - thumb_func_end sub_8088E64 - - thumb_func_start MetatileBehavior_IsSandOrDeepSand -MetatileBehavior_IsSandOrDeepSand: @ 8088E80 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x21 - beq _08088E8E - cmp r0, 0x6 - bne _08088E92 -_08088E8E: - movs r0, 0x1 - b _08088E94 -_08088E92: - movs r0, 0 -_08088E94: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsSandOrDeepSand - - thumb_func_start MetatileBehavior_IsDeepSand -MetatileBehavior_IsDeepSand: @ 8088E98 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x6 - beq _08088EA6 - movs r0, 0 - b _08088EA8 -_08088EA6: - movs r0, 0x1 -_08088EA8: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsDeepSand - - thumb_func_start MetatileBehavior_IsReflective -MetatileBehavior_IsReflective: @ 8088EAC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x10 - beq _08088ECA - cmp r0, 0x16 - beq _08088ECA - cmp r0, 0x1A - beq _08088ECA - cmp r0, 0x20 - beq _08088ECA - cmp r0, 0x14 - beq _08088ECA - cmp r0, 0x2B - bne _08088ECE -_08088ECA: - movs r0, 0x1 - b _08088ED0 -_08088ECE: - movs r0, 0 -_08088ED0: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsReflective - - thumb_func_start MetatileBehavior_IsIce -MetatileBehavior_IsIce: @ 8088ED4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x20 - beq _08088EE2 - movs r0, 0 - b _08088EE4 -_08088EE2: - movs r0, 0x1 -_08088EE4: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsIce - - thumb_func_start is_tile_x69_2_warp_door -is_tile_x69_2_warp_door: @ 8088EE8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x69 - beq _08088EF6 - movs r0, 0 - b _08088EF8 -_08088EF6: - movs r0, 0x1 -_08088EF8: - pop {r1} - bx r1 - thumb_func_end is_tile_x69_2_warp_door - - thumb_func_start sub_8088EFC -sub_8088EFC: @ 8088EFC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x8D - beq _08088F0A - cmp r0, 0x69 - bne _08088F0E -_08088F0A: - movs r0, 0x1 - b _08088F10 -_08088F0E: - movs r0, 0 -_08088F10: - pop {r1} - bx r1 - thumb_func_end sub_8088EFC - - thumb_func_start MetatileBehavior_IsEscalator -MetatileBehavior_IsEscalator: @ 8088F14 - push {lr} - lsls r0, 24 - movs r1, 0x96 - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1 - bls _08088F28 - movs r0, 0 - b _08088F2A -_08088F28: - movs r0, 0x1 -_08088F2A: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsEscalator - - thumb_func_start sub_8088F30 -sub_8088F30: @ 8088F30 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - beq _08088F3E - movs r0, 0 - b _08088F40 -_08088F3E: - movs r0, 0x1 -_08088F40: - pop {r1} - bx r1 - thumb_func_end sub_8088F30 - - thumb_func_start MetatileBehavior_IsLadder -MetatileBehavior_IsLadder: @ 8088F44 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x61 - beq _08088F52 - movs r0, 0 - b _08088F54 -_08088F52: - movs r0, 0x1 -_08088F54: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsLadder - - thumb_func_start sub_8088F58 -sub_8088F58: @ 8088F58 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x60 - beq _08088F6A - cmp r0, 0x6C - beq _08088F6A - cmp r0, 0x6E - bne _08088F6E -_08088F6A: - movs r0, 0x1 - b _08088F70 -_08088F6E: - movs r0, 0 -_08088F70: - pop {r1} - bx r1 - thumb_func_end sub_8088F58 - - thumb_func_start sub_8088F74 -sub_8088F74: @ 8088F74 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x6E - beq _08088F82 - movs r0, 0 - b _08088F84 -_08088F82: - movs r0, 0x1 -_08088F84: - pop {r1} - bx r1 - thumb_func_end sub_8088F74 - - thumb_func_start MetatileBehavior_IsSurfableWaterOrUnderwater -MetatileBehavior_IsSurfableWaterOrUnderwater: @ 8088F88 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_08486EFC - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08088FA4 - movs r0, 0 - b _08088FA6 - .pool -_08088FA4: - movs r0, 0x1 -_08088FA6: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsSurfableWaterOrUnderwater - - thumb_func_start MetatileBehavior_IsEastArrowWarp -MetatileBehavior_IsEastArrowWarp: @ 8088FAC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x62 - beq _08088FBA - movs r0, 0 - b _08088FBC -_08088FBA: - movs r0, 0x1 -_08088FBC: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsEastArrowWarp - - thumb_func_start MetatileBehavior_IsWestArrowWarp -MetatileBehavior_IsWestArrowWarp: @ 8088FC0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x63 - beq _08088FCE - movs r0, 0 - b _08088FD0 -_08088FCE: - movs r0, 0x1 -_08088FD0: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsWestArrowWarp - - thumb_func_start MetatileBehavior_IsNorthArrowWarp -MetatileBehavior_IsNorthArrowWarp: @ 8088FD4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x64 - beq _08088FE2 - cmp r0, 0x1B - bne _08088FE6 -_08088FE2: - movs r0, 0x1 - b _08088FE8 -_08088FE6: - movs r0, 0 -_08088FE8: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsNorthArrowWarp - - thumb_func_start MetatileBehavior_IsSouthArrowWarp -MetatileBehavior_IsSouthArrowWarp: @ 8088FEC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x65 - beq _08088FFE - cmp r0, 0x6D - beq _08088FFE - cmp r0, 0x1C - bne _08089002 -_08088FFE: - movs r0, 0x1 - b _08089004 -_08089002: - movs r0, 0 -_08089004: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsSouthArrowWarp - - thumb_func_start sub_8089008 -sub_8089008: @ 8089008 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r5, 0 - adds r0, r4, 0 - bl MetatileBehavior_IsEastArrowWarp - lsls r0, 24 - cmp r0, 0 - bne _08089040 - adds r0, r4, 0 - bl MetatileBehavior_IsWestArrowWarp - lsls r0, 24 - cmp r0, 0 - bne _08089040 - adds r0, r4, 0 - bl MetatileBehavior_IsNorthArrowWarp - lsls r0, 24 - cmp r0, 0 - bne _08089040 - adds r0, r4, 0 - bl MetatileBehavior_IsSouthArrowWarp - lsls r0, 24 - cmp r0, 0 - beq _08089042 -_08089040: - movs r5, 0x1 -_08089042: - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8089008 - - thumb_func_start sub_808904C -sub_808904C: @ 808904C - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - movs r2, 0xC0 - lsls r2, 24 - adds r0, r2 - lsrs r0, 24 - cmp r0, 0x8 - bls _08089082 - adds r0, r1, 0 - subs r0, 0x50 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bls _08089082 - cmp r1, 0xD0 - beq _08089082 - cmp r1, 0xD2 - beq _08089082 - cmp r1, 0x13 - beq _08089082 - cmp r1, 0x20 - beq _08089082 - cmp r1, 0xBB - beq _08089082 - cmp r1, 0xBC - bne _08089086 -_08089082: - movs r0, 0x1 - b _08089088 -_08089086: - movs r0, 0 -_08089088: - pop {r1} - bx r1 - thumb_func_end sub_808904C - - thumb_func_start MetatileBehavior_IsIce_2 -@ bool8 MetatileBehavior_IsIce_2(u8 metatileBehavior) -MetatileBehavior_IsIce_2: @ 808908C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x20 - beq _0808909A - movs r0, 0 - b _0808909C -_0808909A: - movs r0, 0x1 -_0808909C: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsIce_2 - - thumb_func_start MetatileBehavior_IsTrickHouseSlipperyFloor -@ bool8 MetatileBehavior_IsTrickHouseSlipperyFloor(u8 metatileBehavior) -MetatileBehavior_IsTrickHouseSlipperyFloor: @ 80890A0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x48 - beq _080890AE - movs r0, 0 - b _080890B0 -_080890AE: - movs r0, 0x1 -_080890B0: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsTrickHouseSlipperyFloor - - thumb_func_start MetatileBehavior_0x05 -MetatileBehavior_0x05: @ 80890B4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - beq _080890C2 - movs r0, 0 - b _080890C4 -_080890C2: - movs r0, 0x1 -_080890C4: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_0x05 - - thumb_func_start MetatileBehavior_IsWalkNorth -@ bool8 MetatileBehavior_IsWalkNorth(u8 metatileBehavior) -MetatileBehavior_IsWalkNorth: @ 80890C8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x42 - beq _080890D6 - movs r0, 0 - b _080890D8 -_080890D6: - movs r0, 0x1 -_080890D8: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsWalkNorth - - thumb_func_start MetatileBehavior_IsWalkSouth -@ bool8 MetatileBehavior_IsWalkSouth(u8 metatileBehavior) -MetatileBehavior_IsWalkSouth: @ 80890DC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x43 - beq _080890EA - movs r0, 0 - b _080890EC -_080890EA: - movs r0, 0x1 -_080890EC: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsWalkSouth - - thumb_func_start MetatileBehavior_IsWalkWest -@ bool8 MetatileBehavior_IsWalkWest(u8 metatileBehavior) -MetatileBehavior_IsWalkWest: @ 80890F0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x41 - beq _080890FE - movs r0, 0 - b _08089100 -_080890FE: - movs r0, 0x1 -_08089100: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsWalkWest - - thumb_func_start MetatileBehavior_IsWalkEast -@ bool8 MetatileBehavior_IsWalkEast(u8 metatileBehavior) -MetatileBehavior_IsWalkEast: @ 8089104 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _08089112 - movs r0, 0 - b _08089114 -_08089112: - movs r0, 0x1 -_08089114: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsWalkEast - - thumb_func_start MetatileBehavior_IsNorthwardCurrent -@ bool8 MetatileBehavior_IsNorthwardCurrent(u8 metatileBehavior) -MetatileBehavior_IsNorthwardCurrent: @ 8089118 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x52 - beq _08089126 - movs r0, 0 - b _08089128 -_08089126: - movs r0, 0x1 -_08089128: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsNorthwardCurrent - - thumb_func_start MetatileBehavior_IsSouthwardCurrent -@ bool8 MetatileBehavior_IsSouthwardCurrent(u8 metatileBehavior) -MetatileBehavior_IsSouthwardCurrent: @ 808912C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x53 - beq _0808913A - movs r0, 0 - b _0808913C -_0808913A: - movs r0, 0x1 -_0808913C: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsSouthwardCurrent - - thumb_func_start MetatileBehavior_IsWestwardCurrent -@ bool8 MetatileBehavior_IsWestwardCurrent(u8 metatileBehavior) -MetatileBehavior_IsWestwardCurrent: @ 8089140 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x51 - beq _0808914E - movs r0, 0 - b _08089150 -_0808914E: - movs r0, 0x1 -_08089150: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsWestwardCurrent - - thumb_func_start MetatileBehavior_IsEastwardCurrent -@ bool8 MetatileBehavior_IsEastwardCurrent(u8 metatileBehavior) -MetatileBehavior_IsEastwardCurrent: @ 8089154 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x50 - beq _08089162 - movs r0, 0 - b _08089164 -_08089162: - movs r0, 0x1 -_08089164: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsEastwardCurrent - - thumb_func_start MetatileBehavior_IsSlideNorth -@ bool8 MetatileBehavior_IsSlideNorth(u8 metatileBehavior) -MetatileBehavior_IsSlideNorth: @ 8089168 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x46 - beq _08089176 - movs r0, 0 - b _08089178 -_08089176: - movs r0, 0x1 -_08089178: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsSlideNorth - - thumb_func_start MetatileBehavior_IsSlideSouth -@ bool8 MetatileBehavior_IsSlideSouth(u8 metatileBehavior) -MetatileBehavior_IsSlideSouth: @ 808917C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x47 - beq _0808918A - movs r0, 0 - b _0808918C -_0808918A: - movs r0, 0x1 -_0808918C: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsSlideSouth - - thumb_func_start MetatileBehavior_IsSlideWest -@ bool8 MetatileBehavior_IsSlideWest(u8 metatileBehavior) -MetatileBehavior_IsSlideWest: @ 8089190 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x45 - beq _0808919E - movs r0, 0 - b _080891A0 -_0808919E: - movs r0, 0x1 -_080891A0: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsSlideWest - - thumb_func_start MetatileBehavior_IsSlideEast -@ bool8 MetatileBehavior_IsSlideEast(u8 metatileBehavior) -MetatileBehavior_IsSlideEast: @ 80891A4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x44 - beq _080891B2 - movs r0, 0 - b _080891B4 -_080891B2: - movs r0, 0x1 -_080891B4: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsSlideEast - - thumb_func_start MetatileBehavior_IsCounter -MetatileBehavior_IsCounter: @ 80891B8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x80 - beq _080891C6 - movs r0, 0 - b _080891C8 -_080891C6: - movs r0, 0x1 -_080891C8: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsCounter - - thumb_func_start MetatileBehavior_IsPlayerFacingTVScreen -@ bool8 MetatileBehavior_IsPlayerFacingTVScreen(u8 behavior, u8 direction) -MetatileBehavior_IsPlayerFacingTVScreen: @ 80891CC - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x2 - bne _080891DE - cmp r0, 0x86 - beq _080891E2 -_080891DE: - movs r0, 0 - b _080891E4 -_080891E2: - movs r0, 0x1 -_080891E4: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsPlayerFacingTVScreen - - thumb_func_start MetatileBehavior_IsPC -MetatileBehavior_IsPC: @ 80891E8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x83 - beq _080891F6 - movs r0, 0 - b _080891F8 -_080891F6: - movs r0, 0x1 -_080891F8: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsPC - - thumb_func_start is_tile_x84 -is_tile_x84: @ 80891FC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x84 - beq _0808920A - movs r0, 0 - b _0808920C -_0808920A: - movs r0, 0x1 -_0808920C: - pop {r1} - bx r1 - thumb_func_end is_tile_x84 - - thumb_func_start sub_8089210 -sub_8089210: @ 8089210 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x91 - beq _08089232 - cmp r0, 0x93 - beq _08089232 - cmp r0, 0x95 - beq _08089232 - cmp r0, 0x97 - beq _08089232 - cmp r0, 0x99 - beq _08089232 - cmp r0, 0x9B - beq _08089232 - cmp r0, 0x9D - bne _08089236 -_08089232: - movs r0, 0x1 - b _08089238 -_08089236: - movs r0, 0 -_08089238: - pop {r1} - bx r1 - thumb_func_end sub_8089210 - - thumb_func_start sub_808923C -sub_808923C: @ 808923C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x90 - beq _08089252 - cmp r0, 0x92 - beq _08089252 - cmp r0, 0x94 - beq _08089252 - cmp r0, 0x9A - bne _08089256 -_08089252: - movs r0, 0x1 - b _08089258 -_08089256: - movs r0, 0 -_08089258: - pop {r1} - bx r1 - thumb_func_end sub_808923C - - thumb_func_start sub_808925C -sub_808925C: @ 808925C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x96 - beq _0808926A - cmp r0, 0x9C - bne _0808926E -_0808926A: - movs r0, 0x1 - b _08089270 -_0808926E: - movs r0, 0 -_08089270: - pop {r1} - bx r1 - thumb_func_end sub_808925C - - thumb_func_start is_tile_x98 -is_tile_x98: @ 8089274 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x98 - beq _08089282 - movs r0, 0 - b _08089284 -_08089282: - movs r0, 0x1 -_08089284: - pop {r1} - bx r1 - thumb_func_end is_tile_x98 - - thumb_func_start sub_8089288 -sub_8089288: @ 8089288 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB0 - beq _08089296 - movs r0, 0 - b _08089298 -_08089296: - movs r0, 0x1 -_08089298: - pop {r1} - bx r1 - thumb_func_end sub_8089288 - - thumb_func_start sub_808929C -sub_808929C: @ 808929C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB1 - beq _080892AA - movs r0, 0 - b _080892AC -_080892AA: - movs r0, 0x1 -_080892AC: - pop {r1} - bx r1 - thumb_func_end sub_808929C - - thumb_func_start sub_80892B0 -sub_80892B0: @ 80892B0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB2 - beq _080892BE - movs r0, 0 - b _080892C0 -_080892BE: - movs r0, 0x1 -_080892C0: - pop {r1} - bx r1 - thumb_func_end sub_80892B0 - - thumb_func_start sub_80892C4 -sub_80892C4: @ 80892C4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB3 - beq _080892D2 - movs r0, 0 - b _080892D4 -_080892D2: - movs r0, 0x1 -_080892D4: - pop {r1} - bx r1 - thumb_func_end sub_80892C4 - - thumb_func_start sub_80892D8 -sub_80892D8: @ 80892D8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB9 - beq _080892E6 - movs r0, 0 - b _080892E8 -_080892E6: - movs r0, 0x1 -_080892E8: - pop {r1} - bx r1 - thumb_func_end sub_80892D8 - - thumb_func_start sub_80892EC -sub_80892EC: @ 80892EC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xC6 - beq _080892FA - movs r0, 0 - b _080892FC -_080892FA: - movs r0, 0x1 -_080892FC: - pop {r1} - bx r1 - thumb_func_end sub_80892EC - - thumb_func_start sub_8089300 -sub_8089300: @ 8089300 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xC7 - beq _0808930E - movs r0, 0 - b _08089310 -_0808930E: - movs r0, 0x1 -_08089310: - pop {r1} - bx r1 - thumb_func_end sub_8089300 - - thumb_func_start sub_8089314 -sub_8089314: @ 8089314 - push {lr} - lsls r0, 24 - cmp r0, 0 - beq _08089320 - movs r0, 0 - b _08089322 -_08089320: - movs r0, 0x1 -_08089322: - pop {r1} - bx r1 - thumb_func_end sub_8089314 - - thumb_func_start sub_8089328 -sub_8089328: @ 8089328 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB7 - beq _08089336 - movs r0, 0 - b _08089338 -_08089336: - movs r0, 0x1 -_08089338: - pop {r1} - bx r1 - thumb_func_end sub_8089328 - - thumb_func_start sub_808933C -sub_808933C: @ 808933C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB2 - beq _0808934A - movs r0, 0 - b _0808934C -_0808934A: - movs r0, 0x1 -_0808934C: - pop {r1} - bx r1 - thumb_func_end sub_808933C - - thumb_func_start sub_8089350 -sub_8089350: @ 8089350 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB5 - beq _0808935E - movs r0, 0 - b _08089360 -_0808935E: - movs r0, 0x1 -_08089360: - pop {r1} - bx r1 - thumb_func_end sub_8089350 - - thumb_func_start sub_8089364 -sub_8089364: @ 8089364 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xC3 - beq _08089372 - movs r0, 0 - b _08089374 -_08089372: - movs r0, 0x1 -_08089374: - pop {r1} - bx r1 - thumb_func_end sub_8089364 - - thumb_func_start sub_8089378 -sub_8089378: @ 8089378 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xC2 - beq _08089386 - movs r0, 0 - b _08089388 -_08089386: - movs r0, 0x1 -_08089388: - pop {r1} - bx r1 - thumb_func_end sub_8089378 - - thumb_func_start sub_808938C -sub_808938C: @ 808938C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB8 - beq _0808939A - movs r0, 0 - b _0808939C -_0808939A: - movs r0, 0x1 -_0808939C: - pop {r1} - bx r1 - thumb_func_end sub_808938C - - thumb_func_start sub_80893A0 -sub_80893A0: @ 80893A0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xBE - beq _080893AE - movs r0, 0 - b _080893B0 -_080893AE: - movs r0, 0x1 -_080893B0: - pop {r1} - bx r1 - thumb_func_end sub_80893A0 - - thumb_func_start sub_80893B4 -sub_80893B4: @ 80893B4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xBD - beq _080893C2 - movs r0, 0 - b _080893C4 -_080893C2: - movs r0, 0x1 -_080893C4: - pop {r1} - bx r1 - thumb_func_end sub_80893B4 - - thumb_func_start sub_80893C8 -sub_80893C8: @ 80893C8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xBA - beq _080893D6 - movs r0, 0 - b _080893D8 -_080893D6: - movs r0, 0x1 -_080893D8: - pop {r1} - bx r1 - thumb_func_end sub_80893C8 - - thumb_func_start sub_80893DC -sub_80893DC: @ 80893DC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xBF - beq _080893EA - movs r0, 0 - b _080893EC -_080893EA: - movs r0, 0x1 -_080893EC: - pop {r1} - bx r1 - thumb_func_end sub_80893DC - - thumb_func_start sub_80893F0 -sub_80893F0: @ 80893F0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xC4 - beq _080893FE - movs r0, 0 - b _08089400 -_080893FE: - movs r0, 0x1 -_08089400: - pop {r1} - bx r1 - thumb_func_end sub_80893F0 - - thumb_func_start sub_8089404 -sub_8089404: @ 8089404 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xC5 - beq _08089412 - movs r0, 0 - b _08089414 -_08089412: - movs r0, 0x1 -_08089414: - pop {r1} - bx r1 - thumb_func_end sub_8089404 - - thumb_func_start MetatileBehavior_HasRipples -MetatileBehavior_HasRipples: @ 8089418 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x10 - beq _0808942A - cmp r0, 0x16 - beq _0808942A - cmp r0, 0x14 - bne _0808942E -_0808942A: - movs r0, 0x1 - b _08089430 -_0808942E: - movs r0, 0 -_08089430: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_HasRipples - - thumb_func_start MetatileBehavior_IsPuddle -MetatileBehavior_IsPuddle: @ 8089434 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x16 - beq _08089442 - movs r0, 0 - b _08089444 -_08089442: - movs r0, 0x1 -_08089444: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsPuddle - - thumb_func_start MetatileBehavior_IsTallGrass -MetatileBehavior_IsTallGrass: @ 8089448 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _08089456 - movs r0, 0 - b _08089458 -_08089456: - movs r0, 0x1 -_08089458: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsTallGrass - - thumb_func_start MetatileBehavior_IsLongGrass -MetatileBehavior_IsLongGrass: @ 808945C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - beq _0808946A - movs r0, 0 - b _0808946C -_0808946A: - movs r0, 0x1 -_0808946C: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsLongGrass - - thumb_func_start MetatileBehavior_IsBerryTreeSoil -MetatileBehavior_IsBerryTreeSoil: @ 8089470 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xA0 - beq _0808947E - movs r0, 0 - b _08089480 -_0808947E: - movs r0, 0x1 -_08089480: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsBerryTreeSoil - - thumb_func_start MetatileBehavior_IsAsh -MetatileBehavior_IsAsh: @ 8089484 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x24 - beq _08089492 - movs r0, 0 - b _08089494 -_08089492: - movs r0, 0x1 -_08089494: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsAsh - - thumb_func_start MetatileBehavior_IsUnusedFootprintMetatile -MetatileBehavior_IsUnusedFootprintMetatile: @ 8089498 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x25 - beq _080894A6 - movs r0, 0 - b _080894A8 -_080894A6: - movs r0, 0x1 -_080894A8: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsUnusedFootprintMetatile - - thumb_func_start sub_80894AC -sub_80894AC: @ 80894AC - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - movs r2, 0x90 - lsls r2, 24 - adds r0, r2 - lsrs r0, 24 - cmp r0, 0x3 - bls _080894CA - adds r0, r1, 0 - subs r0, 0x7C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bhi _080894CE -_080894CA: - movs r0, 0x1 - b _080894D0 -_080894CE: - movs r0, 0 -_080894D0: - pop {r1} - bx r1 - thumb_func_end sub_80894AC - - thumb_func_start sub_80894D4 -sub_80894D4: @ 80894D4 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - adds r2, r1, 0 - adds r0, r1, 0 - subs r0, 0x70 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bls _0808950A - adds r0, r1, 0 - subs r0, 0x7A - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _080894F8 - movs r0, 0x2 - b _0808950A -_080894F8: - adds r0, r2, 0 - subs r0, 0x7C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _08089508 - movs r0, 0 - b _0808950A -_08089508: - movs r0, 0x3 -_0808950A: - pop {r1} - bx r1 - thumb_func_end sub_80894D4 - - thumb_func_start sub_8089510 -sub_8089510: @ 8089510 - push {lr} - lsls r0, 24 - movs r1, 0x90 - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x3 - bls _08089524 - movs r0, 0 - b _08089526 -_08089524: - movs r0, 0x1 -_08089526: - pop {r1} - bx r1 - thumb_func_end sub_8089510 - - thumb_func_start sub_808952C -sub_808952C: @ 808952C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl MetatileBehavior_IsSurfableWaterOrUnderwater - lsls r0, 24 - cmp r0, 0 - bne _08089550 - adds r0, r4, 0 - bl sub_8088DF0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08089550 - movs r0, 0x1 - b _08089552 -_08089550: - movs r0, 0 -_08089552: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_808952C - - thumb_func_start sub_8089558 -sub_8089558: @ 8089558 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl MetatileBehavior_IsSurfableWaterOrUnderwater - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0808957E - adds r0, r4, 0 - bl sub_8088DF0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0808957E - movs r0, 0x1 - b _08089580 -_0808957E: - movs r0, 0 -_08089580: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8089558 - - thumb_func_start sub_8089588 -sub_8089588: @ 8089588 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB - beq _08089596 - movs r0, 0 - b _08089598 -_08089596: - movs r0, 0x1 -_08089598: - pop {r1} - bx r1 - thumb_func_end sub_8089588 - - thumb_func_start sub_808959C -sub_808959C: @ 808959C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xC - beq _080895AA - movs r0, 0 - b _080895AC -_080895AA: - movs r0, 0x1 -_080895AC: - pop {r1} - bx r1 - thumb_func_end sub_808959C - - thumb_func_start sub_80895B0 -sub_80895B0: @ 80895B0 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - movs r2, 0xEF - lsls r2, 24 - adds r0, r2 - lsrs r0, 24 - cmp r0, 0x1 - bls _080895C6 - cmp r1, 0x14 - bne _080895CA -_080895C6: - movs r0, 0x1 - b _080895CC -_080895CA: - movs r0, 0 -_080895CC: - pop {r1} - bx r1 - thumb_func_end sub_80895B0 - - thumb_func_start sub_80895D0 -sub_80895D0: @ 80895D0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x19 - beq _080895DE - cmp r0, 0x2A - bne _080895E2 -_080895DE: - movs r0, 0x1 - b _080895E4 -_080895E2: - movs r0, 0 -_080895E4: - pop {r1} - bx r1 - thumb_func_end sub_80895D0 - - thumb_func_start MetatileBehavior_IsShallowFlowingWater -MetatileBehavior_IsShallowFlowingWater: @ 80895E8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x17 - beq _080895FA - cmp r0, 0x1B - beq _080895FA - cmp r0, 0x1C - bne _080895FE -_080895FA: - movs r0, 0x1 - b _08089600 -_080895FE: - movs r0, 0 -_08089600: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsShallowFlowingWater - - thumb_func_start sub_8089604 -sub_8089604: @ 8089604 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x26 - beq _08089612 - movs r0, 0 - b _08089614 -_08089612: - movs r0, 0x1 -_08089614: - pop {r1} - bx r1 - thumb_func_end sub_8089604 - - thumb_func_start sub_8089618 -sub_8089618: @ 8089618 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x27 - beq _08089626 - movs r0, 0 - b _08089628 -_08089626: - movs r0, 0x1 -_08089628: - pop {r1} - bx r1 - thumb_func_end sub_8089618 - - thumb_func_start sub_808962C -sub_808962C: @ 808962C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x15 - beq _0808963E - cmp r0, 0x11 - beq _0808963E - cmp r0, 0x12 - bne _08089642 -_0808963E: - movs r0, 0x1 - b _08089644 -_08089642: - movs r0, 0 -_08089644: - pop {r1} - bx r1 - thumb_func_end sub_808962C - - thumb_func_start sub_8089648 -sub_8089648: @ 8089648 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x18 - beq _08089656 - cmp r0, 0x1A - bne _0808965A -_08089656: - movs r0, 0x1 - b _0808965C -_0808965A: - movs r0, 0 -_0808965C: - pop {r1} - bx r1 - thumb_func_end sub_8089648 - - thumb_func_start sub_8089660 -sub_8089660: @ 8089660 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl MetatileBehavior_IsSurfableWaterOrUnderwater - lsls r0, 24 - cmp r0, 0 - beq _08089682 - adds r0, r4, 0 - bl MetatileBehavior_IsWaterfall - lsls r0, 24 - cmp r0, 0 - bne _08089682 - movs r0, 0x1 - b _08089684 -_08089682: - movs r0, 0 -_08089684: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8089660 - - thumb_func_start MetatileBehavior_IsEastBlocked -MetatileBehavior_IsEastBlocked: @ 808968C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x30 - beq _080896A6 - cmp r0, 0x34 - beq _080896A6 - cmp r0, 0x36 - beq _080896A6 - cmp r0, 0xC1 - beq _080896A6 - cmp r0, 0xBE - bne _080896AA -_080896A6: - movs r0, 0x1 - b _080896AC -_080896AA: - movs r0, 0 -_080896AC: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsEastBlocked - - thumb_func_start MetatileBehavior_IsWestBlocked -MetatileBehavior_IsWestBlocked: @ 80896B0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x31 - beq _080896CA - cmp r0, 0x35 - beq _080896CA - cmp r0, 0x37 - beq _080896CA - cmp r0, 0xC1 - beq _080896CA - cmp r0, 0xBE - bne _080896CE -_080896CA: - movs r0, 0x1 - b _080896D0 -_080896CE: - movs r0, 0 -_080896D0: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsWestBlocked - - thumb_func_start MetatileBehavior_IsNorthBlocked -MetatileBehavior_IsNorthBlocked: @ 80896D4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x32 - beq _080896EA - cmp r0, 0x34 - beq _080896EA - cmp r0, 0x35 - beq _080896EA - cmp r0, 0xC0 - bne _080896EE -_080896EA: - movs r0, 0x1 - b _080896F0 -_080896EE: - movs r0, 0 -_080896F0: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsNorthBlocked - - thumb_func_start MetatileBehavior_IsSouthBlocked -MetatileBehavior_IsSouthBlocked: @ 80896F4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x33 - beq _0808970A - cmp r0, 0x36 - beq _0808970A - cmp r0, 0x37 - beq _0808970A - cmp r0, 0xC0 - bne _0808970E -_0808970A: - movs r0, 0x1 - b _08089710 -_0808970E: - movs r0, 0 -_08089710: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsSouthBlocked - - thumb_func_start MetatileBehavior_IsShortGrass -MetatileBehavior_IsShortGrass: @ 8089714 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x7 - beq _08089722 - movs r0, 0 - b _08089724 -_08089722: - movs r0, 0x1 -_08089724: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsShortGrass - - thumb_func_start MetatileBehavior_IsHotSprings -MetatileBehavior_IsHotSprings: @ 8089728 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x28 - beq _08089736 - movs r0, 0 - b _08089738 -_08089736: - movs r0, 0x1 -_08089738: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsHotSprings - - thumb_func_start MetatileBehavior_IsWaterfall -@ bool8 MetatileBehavior_IsWaterfall(u8 metatileBehavior) -MetatileBehavior_IsWaterfall: @ 808973C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x13 - beq _0808974A - movs r0, 0 - b _0808974C -_0808974A: - movs r0, 0x1 -_0808974C: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsWaterfall - - thumb_func_start MetatileBehavior_IsFortreeBridge -MetatileBehavior_IsFortreeBridge: @ 8089750 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x78 - beq _0808975E - movs r0, 0 - b _08089760 -_0808975E: - movs r0, 0x1 -_08089760: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsFortreeBridge - - thumb_func_start sub_8089764 -sub_8089764: @ 8089764 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x74 - beq _08089772 - movs r0, 0 - b _08089774 -_08089772: - movs r0, 0x1 -_08089774: - pop {r1} - bx r1 - thumb_func_end sub_8089764 - - thumb_func_start sub_8089778 -sub_8089778: @ 8089778 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x75 - beq _08089786 - movs r0, 0 - b _08089788 -_08089786: - movs r0, 0x1 -_08089788: - pop {r1} - bx r1 - thumb_func_end sub_8089778 - - thumb_func_start sub_808978C -sub_808978C: @ 808978C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x76 - beq _0808979A - movs r0, 0 - b _0808979C -_0808979A: - movs r0, 0x1 -_0808979C: - pop {r1} - bx r1 - thumb_func_end sub_808978C - - thumb_func_start sub_80897A0 -sub_80897A0: @ 80897A0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x77 - beq _080897AE - movs r0, 0 - b _080897B0 -_080897AE: - movs r0, 0x1 -_080897B0: - pop {r1} - bx r1 - thumb_func_end sub_80897A0 - - thumb_func_start MetatileBehavior_IsPacifidlogLog -MetatileBehavior_IsPacifidlogLog: @ 80897B4 - push {lr} - lsls r0, 24 - movs r1, 0x8C - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x3 - bls _080897C8 - movs r0, 0 - b _080897CA -_080897C8: - movs r0, 0x1 -_080897CA: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsPacifidlogLog - - thumb_func_start is_tile_x8C -is_tile_x8C: @ 80897D0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x8C - beq _080897DE - movs r0, 0 - b _080897E0 -_080897DE: - movs r0, 0x1 -_080897E0: - pop {r1} - bx r1 - thumb_func_end is_tile_x8C - - thumb_func_start is_tile_x85 -is_tile_x85: @ 80897E4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x85 - beq _080897F2 - movs r0, 0 - b _080897F4 -_080897F2: - movs r0, 0x1 -_080897F4: - pop {r1} - bx r1 - thumb_func_end is_tile_x85 - - thumb_func_start is_tile_x8B -is_tile_x8B: @ 80897F8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x8B - beq _08089806 - movs r0, 0 - b _08089808 -_08089806: - movs r0, 0x1 -_08089808: - pop {r1} - bx r1 - thumb_func_end is_tile_x8B - - thumb_func_start is_tile_xEA -is_tile_xEA: @ 808980C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xEA - beq _0808981A - movs r0, 0 - b _0808981C -_0808981A: - movs r0, 0x1 -_0808981C: - pop {r1} - bx r1 - thumb_func_end is_tile_xEA - - thumb_func_start is_tile_x8A -is_tile_x8A: @ 8089820 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x8A - beq _0808982E - movs r0, 0 - b _08089830 -_0808982E: - movs r0, 0x1 -_08089830: - pop {r1} - bx r1 - thumb_func_end is_tile_x8A - - thumb_func_start is_tile_x87 -is_tile_x87: @ 8089834 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x87 - beq _08089842 - movs r0, 0 - b _08089844 -_08089842: - movs r0, 0x1 -_08089844: - pop {r1} - bx r1 - thumb_func_end is_tile_x87 - - thumb_func_start MetatileBehavior_0xBB -@ bool8 MetatileBehavior_0xBB(u8 metatileBehavior) -MetatileBehavior_0xBB: @ 8089848 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xBB - beq _08089856 - movs r0, 0 - b _08089858 -_08089856: - movs r0, 0x1 -_08089858: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_0xBB - - thumb_func_start MetatileBehavior_0xBC -@ bool8 MetatileBehavior_0xBC(u8 metatileBehavior) -MetatileBehavior_0xBC: @ 808985C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xBC - beq _0808986A - movs r0, 0 - b _0808986C -_0808986A: - movs r0, 0x1 -_0808986C: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_0xBC - - thumb_func_start sub_8089870 -sub_8089870: @ 8089870 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x29 - beq _0808987E - movs r0, 0 - b _08089880 -_0808987E: - movs r0, 0x1 -_08089880: - pop {r1} - bx r1 - thumb_func_end sub_8089870 - - thumb_func_start is_role_x68 -is_role_x68: @ 8089884 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x68 - beq _08089892 - movs r0, 0 - b _08089894 -_08089892: - movs r0, 0x1 -_08089894: - pop {r1} - bx r1 - thumb_func_end is_role_x68 - - thumb_func_start MetatileBehavior_IsAquaHideoutWarp -MetatileBehavior_IsAquaHideoutWarp: @ 8089898 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x67 - beq _080898A6 - movs r0, 0 - b _080898A8 -_080898A6: - movs r0, 0x1 -_080898A8: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsAquaHideoutWarp - - thumb_func_start sub_80898AC -sub_80898AC: @ 80898AC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x70 - beq _080898BA - movs r0, 0 - b _080898BC -_080898BA: - movs r0, 0x1 -_080898BC: - pop {r1} - bx r1 - thumb_func_end sub_80898AC - - thumb_func_start sub_80898C0 -sub_80898C0: @ 80898C0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xE - beq _080898CE - movs r0, 0 - b _080898D0 -_080898CE: - movs r0, 0x1 -_080898D0: - pop {r1} - bx r1 - thumb_func_end sub_80898C0 - - thumb_func_start MetatileBehavior_IsSurfableFishableWater -MetatileBehavior_IsSurfableFishableWater: @ 80898D4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x10 - beq _080898F8 - cmp r0, 0x15 - beq _080898F8 - cmp r0, 0x11 - beq _080898F8 - cmp r0, 0x12 - beq _080898F8 - cmp r0, 0x14 - beq _080898F8 - subs r0, 0x50 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bhi _080898FC -_080898F8: - movs r0, 0x1 - b _080898FE -_080898FC: - movs r0, 0 -_080898FE: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsSurfableFishableWater - - thumb_func_start sub_8089904 -sub_8089904: @ 8089904 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xF - beq _08089912 - movs r0, 0 - b _08089914 -_08089912: - movs r0, 0x1 -_08089914: - pop {r1} - bx r1 - thumb_func_end sub_8089904 - - thumb_func_start sub_8089918 -sub_8089918: @ 8089918 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x66 - beq _08089926 - movs r0, 0 - b _08089928 -_08089926: - movs r0, 0x1 -_08089928: - pop {r1} - bx r1 - thumb_func_end sub_8089918 - - thumb_func_start sub_808992C -sub_808992C: @ 808992C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xD2 - beq _0808993A - movs r0, 0 - b _0808993C -_0808993A: - movs r0, 0x1 -_0808993C: - pop {r1} - bx r1 - thumb_func_end sub_808992C - - thumb_func_start MetatileBehavior_IsMuddySlope -@ bool8 MetatileBehavior_IsMuddySlope(u8 metatileBehavior) -MetatileBehavior_IsMuddySlope: @ 8089940 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xD0 - beq _0808994E - movs r0, 0 - b _08089950 -_0808994E: - movs r0, 0x1 -_08089950: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsMuddySlope - - thumb_func_start MetatileBehavior_IsBumpySlope -MetatileBehavior_IsBumpySlope: @ 8089954 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xD1 - beq _08089962 - movs r0, 0 - b _08089964 -_08089962: - movs r0, 0x1 -_08089964: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsBumpySlope - - thumb_func_start MetatileBehavior_IsIsolatedVerticalRail -MetatileBehavior_IsIsolatedVerticalRail: @ 8089968 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xD3 - beq _08089976 - movs r0, 0 - b _08089978 -_08089976: - movs r0, 0x1 -_08089978: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsIsolatedVerticalRail - - thumb_func_start MetatileBehavior_IsIsolatedHorizontalRail -MetatileBehavior_IsIsolatedHorizontalRail: @ 808997C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xD4 - beq _0808998A - movs r0, 0 - b _0808998C -_0808998A: - movs r0, 0x1 -_0808998C: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsIsolatedHorizontalRail - - thumb_func_start MetatileBehavior_IsVerticalRail -MetatileBehavior_IsVerticalRail: @ 8089990 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xD5 - beq _0808999E - movs r0, 0 - b _080899A0 -_0808999E: - movs r0, 0x1 -_080899A0: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsVerticalRail - - thumb_func_start MetatileBehavior_IsHorizontalRail -MetatileBehavior_IsHorizontalRail: @ 80899A4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xD6 - beq _080899B2 - movs r0, 0 - b _080899B4 -_080899B2: - movs r0, 0x1 -_080899B4: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsHorizontalRail - - thumb_func_start MetatileBehavior_IsSeaweed -MetatileBehavior_IsSeaweed: @ 80899B8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x22 - beq _080899C6 - cmp r0, 0x2A - bne _080899CA -_080899C6: - movs r0, 0x1 - b _080899CC -_080899CA: - movs r0, 0 -_080899CC: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsSeaweed - - thumb_func_start MetatileBehavior_IsRunningDisallowed -MetatileBehavior_IsRunningDisallowed: @ 80899D0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xA - beq _080899EC - cmp r0, 0x3 - beq _080899EC - cmp r0, 0x28 - beq _080899EC - bl MetatileBehavior_IsPacifidlogLog - lsls r0, 24 - cmp r0, 0 - beq _080899F0 -_080899EC: - movs r0, 0x1 - b _080899F2 -_080899F0: - movs r0, 0 -_080899F2: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsRunningDisallowed - - thumb_func_start sub_80899F8 -sub_80899F8: @ 80899F8 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - movs r2, 0xFE - lsls r2, 24 - adds r0, r2 - lsrs r0, 24 - cmp r0, 0x1 - bls _08089A12 - cmp r1, 0x24 - beq _08089A12 - cmp r1, 0x9 - bne _08089A16 -_08089A12: - movs r0, 0x1 - b _08089A18 -_08089A16: - movs r0, 0 -_08089A18: - pop {r1} - bx r1 - thumb_func_end sub_80899F8 - - thumb_func_start sub_8089A1C -sub_8089A1C: @ 8089A1C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x8E - beq _08089A2A - movs r0, 0 - b _08089A2C -_08089A2A: - movs r0, 0x1 -_08089A2C: - pop {r1} - bx r1 - thumb_func_end sub_8089A1C - - thumb_func_start sub_8089A30 -sub_8089A30: @ 8089A30 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xE0 - beq _08089A3E - movs r0, 0 - b _08089A40 -_08089A3E: - movs r0, 0x1 -_08089A40: - pop {r1} - bx r1 - thumb_func_end sub_8089A30 - - thumb_func_start sub_8089A44 -sub_8089A44: @ 8089A44 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xE1 - beq _08089A52 - movs r0, 0 - b _08089A54 -_08089A52: - movs r0, 0x1 -_08089A54: - pop {r1} - bx r1 - thumb_func_end sub_8089A44 - - thumb_func_start sub_8089A58 -sub_8089A58: @ 8089A58 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xE2 - beq _08089A66 - movs r0, 0 - b _08089A68 -_08089A66: - movs r0, 0x1 -_08089A68: - pop {r1} - bx r1 - thumb_func_end sub_8089A58 - - thumb_func_start sub_8089A6C -sub_8089A6C: @ 8089A6C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xE3 - beq _08089A7A - movs r0, 0 - b _08089A7C -_08089A7A: - movs r0, 0x1 -_08089A7C: - pop {r1} - bx r1 - thumb_func_end sub_8089A6C - - thumb_func_start sub_8089A80 -sub_8089A80: @ 8089A80 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xE4 - beq _08089A8E - movs r0, 0 - b _08089A90 -_08089A8E: - movs r0, 0x1 -_08089A90: - pop {r1} - bx r1 - thumb_func_end sub_8089A80 - - thumb_func_start sub_8089A94 -sub_8089A94: @ 8089A94 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xE5 - beq _08089AA2 - movs r0, 0 - b _08089AA4 -_08089AA2: - movs r0, 0x1 -_08089AA4: - pop {r1} - bx r1 - thumb_func_end sub_8089A94 - - thumb_func_start sub_8089AA8 -sub_8089AA8: @ 8089AA8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xE6 - beq _08089AB6 - movs r0, 0 - b _08089AB8 -_08089AB6: - movs r0, 0x1 -_08089AB8: - pop {r1} - bx r1 - thumb_func_end sub_8089AA8 - - thumb_func_start sub_8089ABC -sub_8089ABC: @ 8089ABC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xD - beq _08089ACA - movs r0, 0 - b _08089ACC -_08089ACA: - movs r0, 0x1 -_08089ACC: - pop {r1} - bx r1 - thumb_func_end sub_8089ABC - - thumb_func_start sub_8089AD0 -sub_8089AD0: @ 8089AD0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x2 - bne _08089AE2 - cmp r0, 0xE8 - beq _08089AE6 -_08089AE2: - movs r0, 0 - b _08089AE8 -_08089AE6: - movs r0, 0x1 -_08089AE8: - pop {r1} - bx r1 - thumb_func_end sub_8089AD0 - - thumb_func_start sub_8089AEC -sub_8089AEC: @ 8089AEC - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x2 - bne _08089AFE - cmp r0, 0xE7 - beq _08089B02 -_08089AFE: - movs r0, 0 - b _08089B04 -_08089B02: - movs r0, 0x1 -_08089B04: - pop {r1} - bx r1 - thumb_func_end sub_8089AEC - - thumb_func_start MetatileBehavior_IsQuestionnaire -MetatileBehavior_IsQuestionnaire: @ 8089B08 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x8F - beq _08089B16 - movs r0, 0 - b _08089B18 -_08089B16: - movs r0, 0x1 -_08089B18: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsQuestionnaire - - thumb_func_start MetatileBehavior_IsLongGrass2 -MetatileBehavior_IsLongGrass2: @ 8089B1C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - beq _08089B2A - movs r0, 0 - b _08089B2C -_08089B2A: - movs r0, 0x1 -_08089B2C: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsLongGrass2 - - thumb_func_start MetatileBehavior_IsLongGrassSouthEdge -MetatileBehavior_IsLongGrassSouthEdge: @ 8089B30 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x9 - beq _08089B3E - movs r0, 0 - b _08089B40 -_08089B3E: - movs r0, 0x1 -_08089B40: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsLongGrassSouthEdge - - thumb_func_start MetatileBehavior_IsTrainerHillTimer -MetatileBehavior_IsTrainerHillTimer: @ 8089B44 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xE9 - beq _08089B52 - movs r0, 0 - b _08089B54 -_08089B52: - movs r0, 0x1 -_08089B54: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsTrainerHillTimer - - thumb_func_start move_tilemap_camera_to_upper_left_corner_ -@ void move_tilemap_camera_to_upper_left_corner_(struc_28 *a1) -move_tilemap_camera_to_upper_left_corner_: @ 8089B58 - movs r1, 0 - strb r1, [r0, 0x2] - strb r1, [r0, 0x3] - strb r1, [r0] - strb r1, [r0, 0x1] - movs r1, 0x1 - strb r1, [r0, 0x4] - bx lr - thumb_func_end move_tilemap_camera_to_upper_left_corner_ - - thumb_func_start tilemap_move_something -@ void tilemap_move_something(struct struc_28 *, u8 deltaX, u8 deltaY) -tilemap_move_something: @ 8089B68 - ldrb r3, [r0, 0x2] - adds r3, r1 - strb r3, [r0, 0x2] - ldrb r1, [r0, 0x2] - movs r3, 0x1F - ands r1, r3 - strb r1, [r0, 0x2] - ldrb r1, [r0, 0x3] - adds r1, r2 - strb r1, [r0, 0x3] - ldrb r1, [r0, 0x3] - ands r1, r3 - strb r1, [r0, 0x3] - bx lr - thumb_func_end tilemap_move_something - - thumb_func_start coords8_add -@ void coords8_add(struct coords8 *coords, u8 x, u8 y) -coords8_add: @ 8089B84 - ldrb r3, [r0] - adds r3, r1 - strb r3, [r0] - ldrb r1, [r0, 0x1] - adds r1, r2 - strb r1, [r0, 0x1] - bx lr - thumb_func_end coords8_add - - thumb_func_start move_tilemap_camera_to_upper_left_corner -@ void move_tilemap_camera_to_upper_left_corner() -move_tilemap_camera_to_upper_left_corner: @ 8089B94 - push {lr} - ldr r0, =0x03000e20 - bl move_tilemap_camera_to_upper_left_corner_ - pop {r0} - bx r0 - .pool - thumb_func_end move_tilemap_camera_to_upper_left_corner - - thumb_func_start FieldUpdateBgTilemapScroll -@ void FieldUpdateBgTilemapScroll() -FieldUpdateBgTilemapScroll: @ 8089BA4 - push {r4,r5,lr} - ldr r1, =0x03000e20 - ldr r0, =0x03000e28 - movs r2, 0 - ldrsh r5, [r0, r2] - ldrb r0, [r1] - adds r5, r0 - ldr r0, =0x03000e2a - movs r2, 0 - ldrsh r4, [r0, r2] - ldrb r1, [r1, 0x1] - adds r4, r1 - adds r4, 0x8 - lsls r5, 16 - lsrs r5, 16 - movs r0, 0x14 - adds r1, r5, 0 - bl SetGpuReg - lsls r4, 16 - lsrs r4, 16 - movs r0, 0x16 - adds r1, r4, 0 - bl SetGpuReg - movs r0, 0x18 - adds r1, r5, 0 - bl SetGpuReg - movs r0, 0x1A - adds r1, r4, 0 - bl SetGpuReg - movs r0, 0x1C - adds r1, r5, 0 - bl SetGpuReg - movs r0, 0x1E - adds r1, r4, 0 - bl SetGpuReg - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end FieldUpdateBgTilemapScroll - - thumb_func_start sub_8089C08 -sub_8089C08: @ 8089C08 - push {r4,lr} - ldr r3, =0x03000e20 - ldr r2, =0x03000e28 - ldrh r2, [r2] - ldrb r4, [r3] - adds r2, r4 - strh r2, [r0] - ldr r0, =0x03000e2a - ldrh r0, [r0] - ldrb r3, [r3, 0x1] - adds r0, r3 - adds r0, 0x8 - strh r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8089C08 - - thumb_func_start DrawWholeMapView -@ void DrawWholeMapView() -DrawWholeMapView: @ 8089C34 - push {lr} - ldr r0, =0x03005d8c - ldr r1, [r0] - movs r2, 0 - ldrsh r0, [r1, r2] - movs r2, 0x2 - ldrsh r1, [r1, r2] - ldr r2, =0x02037318 - ldr r2, [r2] - bl DrawWholeMapViewInternal - ldr r1, =0x03000e20 - movs r0, 0x1 - strb r0, [r1, 0x4] - pop {r0} - bx r0 - .pool - thumb_func_end DrawWholeMapView - - thumb_func_start DrawWholeMapViewInternal -@ void DrawWholeMapViewInternal(s32 x, s32 y, struct mapdata_header *mapGrid) -DrawWholeMapViewInternal: @ 8089C60 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r10, r0 - mov r9, r1 - mov r8, r2 - movs r1, 0 -_08089C74: - ldr r2, =0x03000e20 - ldrb r0, [r2, 0x3] - adds r0, r1, r0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1F - bls _08089C88 - subs r0, 0x20 - lsls r0, 24 - lsrs r0, 24 -_08089C88: - lsls r6, r0, 5 - movs r4, 0 - adds r7, r1, 0x2 - str r7, [sp] - lsrs r5, r1, 1 -_08089C92: - ldr r1, =0x03000e20 - ldrb r0, [r1, 0x2] - adds r0, r4, r0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1F - bls _08089CA6 - subs r0, 0x20 - lsls r0, 24 - lsrs r0, 24 -_08089CA6: - adds r1, r6, r0 - lsls r1, 16 - lsrs r1, 16 - lsrs r2, r4, 1 - add r2, r10 - mov r0, r8 - mov r7, r9 - adds r3, r7, r5 - bl DrawMetatileAt - adds r0, r4, 0x2 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1F - bls _08089C92 - ldr r1, [sp] - lsls r0, r1, 24 - lsrs r1, r0, 24 - cmp r1, 0x1F - bls _08089C74 - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end DrawWholeMapViewInternal - - thumb_func_start RedrawMapSlicesForCameraUpdate -@ void RedrawMapSlicesForCameraUpdate(struct struc_28 *, u8 deltaX, u8 deltaY) -RedrawMapSlicesForCameraUpdate: @ 8089CE4 - push {r4-r7,lr} - adds r5, r0, 0 - adds r6, r1, 0 - adds r7, r2, 0 - ldr r0, =0x02037318 - ldr r4, [r0] - cmp r6, 0 - ble _08089CFC - adds r0, r5, 0 - adds r1, r4, 0 - bl RedrawMapSliceWest -_08089CFC: - cmp r6, 0 - bge _08089D08 - adds r0, r5, 0 - adds r1, r4, 0 - bl RedrawMapSliceEast -_08089D08: - cmp r7, 0 - ble _08089D14 - adds r0, r5, 0 - adds r1, r4, 0 - bl RedrawMapSliceNorth -_08089D14: - cmp r7, 0 - bge _08089D20 - adds r0, r5, 0 - adds r1, r4, 0 - bl RedrawMapSliceSouth -_08089D20: - movs r0, 0x1 - strb r0, [r5, 0x4] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end RedrawMapSlicesForCameraUpdate - - thumb_func_start RedrawMapSliceNorth -@ void RedrawMapSliceNorth(struct struc_28 *, struct mapdata_header *mapGrid) -RedrawMapSliceNorth: @ 8089D30 - push {r4-r7,lr} - adds r5, r0, 0 - adds r7, r1, 0 - ldrb r0, [r5, 0x3] - adds r0, 0x1C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1F - bls _08089D48 - subs r0, 0x20 - lsls r0, 24 - lsrs r0, 24 -_08089D48: - lsls r6, r0, 5 - movs r4, 0 -_08089D4C: - ldrb r0, [r5, 0x2] - adds r0, r4, r0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1F - bls _08089D5E - subs r0, 0x20 - lsls r0, 24 - lsrs r0, 24 -_08089D5E: - adds r1, r6, r0 - lsls r1, 16 - lsrs r1, 16 - ldr r0, =0x03005d8c - ldr r3, [r0] - movs r0, 0 - ldrsh r2, [r3, r0] - lsrs r0, r4, 1 - adds r2, r0 - movs r0, 0x2 - ldrsh r3, [r3, r0] - adds r3, 0xE - adds r0, r7, 0 - bl DrawMetatileAt - adds r0, r4, 0x2 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1F - bls _08089D4C - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end RedrawMapSliceNorth - - thumb_func_start RedrawMapSliceSouth -@ void RedrawMapSliceSouth(struct struc_28 *, struct mapdata_header *mapGrid) -RedrawMapSliceSouth: @ 8089D90 - push {r4-r7,lr} - adds r5, r0, 0 - adds r7, r1, 0 - ldrb r0, [r5, 0x3] - lsls r6, r0, 5 - movs r4, 0 -_08089D9C: - ldrb r0, [r5, 0x2] - adds r0, r4, r0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1F - bls _08089DAE - subs r0, 0x20 - lsls r0, 24 - lsrs r0, 24 -_08089DAE: - adds r1, r6, r0 - ldr r0, =0x03005d8c - ldr r3, [r0] - movs r0, 0 - ldrsh r2, [r3, r0] - lsrs r0, r4, 1 - adds r2, r0 - movs r0, 0x2 - ldrsh r3, [r3, r0] - adds r0, r7, 0 - bl DrawMetatileAt - adds r0, r4, 0x2 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1F - bls _08089D9C - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end RedrawMapSliceSouth - - thumb_func_start RedrawMapSliceEast -@ void RedrawMapSliceEast(struct struc_28 *, struct mapdata_header *mapGrid) -RedrawMapSliceEast: @ 8089DDC - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - mov r8, r1 - ldrb r6, [r5, 0x2] - movs r4, 0 -_08089DEA: - ldrb r0, [r5, 0x3] - adds r0, r4, r0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1F - bls _08089DFC - subs r0, 0x20 - lsls r0, 24 - lsrs r0, 24 -_08089DFC: - lsls r1, r0, 5 - adds r1, r6 - lsls r1, 16 - lsrs r1, 16 - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r3, 0 - ldrsh r2, [r0, r3] - movs r7, 0x2 - ldrsh r3, [r0, r7] - lsrs r0, r4, 1 - adds r3, r0 - mov r0, r8 - bl DrawMetatileAt - adds r0, r4, 0x2 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1F - bls _08089DEA - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end RedrawMapSliceEast - - thumb_func_start RedrawMapSliceWest -@ void RedrawMapSliceWest(struct struc_28 *, struct mapdata_header *mapGrid) -RedrawMapSliceWest: @ 8089E34 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - mov r8, r1 - ldrb r0, [r6, 0x2] - adds r0, 0x1C - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1F - bls _08089E52 - adds r0, r5, 0 - subs r0, 0x20 - lsls r0, 24 - lsrs r5, r0, 24 -_08089E52: - movs r4, 0 -_08089E54: - ldrb r0, [r6, 0x3] - adds r0, r4, r0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1F - bls _08089E66 - subs r0, 0x20 - lsls r0, 24 - lsrs r0, 24 -_08089E66: - lsls r1, r0, 5 - adds r1, r5 - lsls r1, 16 - lsrs r1, 16 - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r3, 0 - ldrsh r2, [r0, r3] - adds r2, 0xE - movs r7, 0x2 - ldrsh r3, [r0, r7] - lsrs r0, r4, 1 - adds r3, r0 - mov r0, r8 - bl DrawMetatileAt - adds r0, r4, 0x2 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1F - bls _08089E54 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end RedrawMapSliceWest - - thumb_func_start CurrentMapDrawMetatileAt -@ void CurrentMapDrawMetatileAt(u32 x, u32 y) -CurrentMapDrawMetatileAt: @ 8089EA0 - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldr r6, =0x03000e20 - adds r0, r6, 0 - adds r1, r4, 0 - adds r2, r5, 0 - bl MapPosToBgTilemapOffset - adds r1, r0, 0 - cmp r1, 0 - blt _08089ECC - ldr r0, =0x02037318 - ldr r0, [r0] - lsls r1, 16 - lsrs r1, 16 - adds r2, r4, 0 - adds r3, r5, 0 - bl DrawMetatileAt - movs r0, 0x1 - strb r0, [r6, 0x4] -_08089ECC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end CurrentMapDrawMetatileAt - - thumb_func_start DrawDoorMetatileAt -@ void DrawDoorMetatileAt(u32 x, u32 y, u16 *metatile) -DrawDoorMetatileAt: @ 8089EDC - push {r4-r6,lr} - adds r3, r0, 0 - adds r4, r1, 0 - adds r5, r2, 0 - ldr r6, =0x03000e20 - adds r0, r6, 0 - adds r1, r3, 0 - adds r2, r4, 0 - bl MapPosToBgTilemapOffset - cmp r0, 0 - blt _08089F04 - lsls r2, r0, 16 - lsrs r2, 16 - movs r0, 0x1 - adds r1, r5, 0 - bl DrawMetatile - movs r0, 0x1 - strb r0, [r6, 0x4] -_08089F04: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end DrawDoorMetatileAt - - thumb_func_start DrawMetatileAt -@ void DrawMetatileAt(struct mapdata_header *mapGrid, u16 offset, s32 x, s32 y) -DrawMetatileAt: @ 8089F10 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - adds r6, r2, 0 - adds r7, r3, 0 - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - adds r0, r6, 0 - adds r1, r7, 0 - bl MapGridGetMetatileIdAt - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0x80 - lsls r0, 3 - cmp r4, r0 - bls _08089F38 - movs r4, 0 -_08089F38: - ldr r0, =0x000001ff - cmp r4, r0 - bhi _08089F48 - ldr r0, [r5, 0x10] - ldr r5, [r0, 0xC] - b _08089F54 - .pool -_08089F48: - ldr r0, [r5, 0x14] - ldr r5, [r0, 0xC] - ldr r1, =0xfffffe00 - adds r0, r4, r1 - lsls r0, 16 - lsrs r4, r0, 16 -_08089F54: - adds r0, r6, 0 - adds r1, r7, 0 - bl MapGridGetMetatileLayerTypeAt - lsls r0, 24 - lsrs r0, 24 - lsls r1, r4, 4 - adds r1, r5, r1 - mov r2, r8 - bl DrawMetatile - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end DrawMetatileAt - - thumb_func_start DrawMetatile -@ void DrawMetatile(u32 layerType, u16 *metatile, u16 offset) -DrawMetatile: @ 8089F78 - push {r4,lr} - adds r4, r1, 0 - lsls r2, 16 - lsrs r2, 16 - cmp r0, 0x1 - beq _08089FD0 - cmp r0, 0x1 - bgt _08089F8E - cmp r0, 0 - beq _0808A030 - b _0808A082 -_08089F8E: - cmp r0, 0x2 - bne _0808A082 - ldr r0, =0x03005da4 - ldr r0, [r0] - lsls r3, r2, 1 - adds r0, r3, r0 - ldrh r1, [r4] - strh r1, [r0] - ldrh r1, [r4, 0x2] - strh r1, [r0, 0x2] - adds r2, r0, 0 - adds r2, 0x40 - ldrh r1, [r4, 0x4] - strh r1, [r2] - adds r0, 0x42 - ldrh r1, [r4, 0x6] - strh r1, [r0] - ldr r0, =0x03005d9c - ldr r0, [r0] - adds r0, r3, r0 - movs r2, 0 - strh r2, [r0] - strh r2, [r0, 0x2] - adds r1, r0, 0 - adds r1, 0x40 - strh r2, [r1] - adds r0, 0x42 - strh r2, [r0] - b _0808A066 - .pool -_08089FD0: - ldr r0, =0x03005da4 - ldr r0, [r0] - lsls r3, r2, 1 - adds r0, r3, r0 - ldrh r1, [r4] - strh r1, [r0] - ldrh r1, [r4, 0x2] - strh r1, [r0, 0x2] - adds r2, r0, 0 - adds r2, 0x40 - ldrh r1, [r4, 0x4] - strh r1, [r2] - adds r0, 0x42 - ldrh r1, [r4, 0x6] - strh r1, [r0] - ldr r0, =0x03005d9c - ldr r0, [r0] - adds r0, r3, r0 - ldrh r1, [r4, 0x8] - strh r1, [r0] - ldrh r1, [r4, 0xA] - strh r1, [r0, 0x2] - adds r2, r0, 0 - adds r2, 0x40 - ldrh r1, [r4, 0xC] - strh r1, [r2] - adds r0, 0x42 - ldrh r1, [r4, 0xE] - strh r1, [r0] - ldr r0, =0x03005da0 - ldr r0, [r0] - adds r3, r0 - movs r1, 0 - strh r1, [r3] - strh r1, [r3, 0x2] - adds r0, r3, 0 - adds r0, 0x40 - strh r1, [r0] - adds r3, 0x42 - strh r1, [r3] - b _0808A082 - .pool -_0808A030: - ldr r0, =0x03005da4 - ldr r0, [r0] - lsls r3, r2, 1 - adds r0, r3, r0 - ldr r1, =0x00003014 - adds r2, r1, 0 - strh r2, [r0] - strh r2, [r0, 0x2] - adds r1, r0, 0 - adds r1, 0x40 - strh r2, [r1] - adds r0, 0x42 - strh r2, [r0] - ldr r0, =0x03005d9c - ldr r0, [r0] - adds r0, r3, r0 - ldrh r1, [r4] - strh r1, [r0] - ldrh r1, [r4, 0x2] - strh r1, [r0, 0x2] - adds r2, r0, 0 - adds r2, 0x40 - ldrh r1, [r4, 0x4] - strh r1, [r2] - adds r0, 0x42 - ldrh r1, [r4, 0x6] - strh r1, [r0] -_0808A066: - ldr r0, =0x03005da0 - ldr r0, [r0] - adds r3, r0 - ldrh r0, [r4, 0x8] - strh r0, [r3] - ldrh r0, [r4, 0xA] - strh r0, [r3, 0x2] - adds r1, r3, 0 - adds r1, 0x40 - ldrh r0, [r4, 0xC] - strh r0, [r1] - adds r3, 0x42 - ldrh r0, [r4, 0xE] - strh r0, [r3] -_0808A082: - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x3 - bl schedule_bg_copy_tilemap_to_vram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end DrawMetatile - - thumb_func_start MapPosToBgTilemapOffset -@ u32 MapPosToBgTilemapOffset(struct struc_28 *, u32 x, u32 y) -MapPosToBgTilemapOffset: @ 808A0AC - push {r4,r5,lr} - adds r4, r0, 0 - ldr r0, =0x03005d8c - ldr r3, [r0] - movs r5, 0 - ldrsh r0, [r3, r5] - subs r1, r0 - lsls r1, 1 - cmp r1, 0x1F - bhi _0808A0D6 - ldrb r0, [r4, 0x2] - adds r1, r0 - cmp r1, 0x1F - ble _0808A0CA - subs r1, 0x20 -_0808A0CA: - movs r5, 0x2 - ldrsh r0, [r3, r5] - subs r0, r2, r0 - lsls r2, r0, 1 - cmp r2, 0x1F - bls _0808A0E0 -_0808A0D6: - movs r0, 0x1 - negs r0, r0 - b _0808A0EE - .pool -_0808A0E0: - ldrb r0, [r4, 0x3] - adds r2, r0 - cmp r2, 0x1F - ble _0808A0EA - subs r2, 0x20 -_0808A0EA: - lsls r0, r2, 5 - adds r0, r1 -_0808A0EE: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end MapPosToBgTilemapOffset - - thumb_func_start CameraUpdateCallback -@ void CameraUpdateCallback(struct CameraUpdateInfo *info) -CameraUpdateCallback: @ 808A0F4 - push {lr} - adds r3, r0, 0 - ldr r2, [r3, 0x4] - cmp r2, 0 - beq _0808A114 - ldr r1, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - movs r2, 0x32 - ldrsh r1, [r0, r2] - str r1, [r3, 0x8] - movs r1, 0x34 - ldrsh r0, [r0, r1] - str r0, [r3, 0xC] -_0808A114: - pop {r0} - bx r0 - .pool - thumb_func_end CameraUpdateCallback - - thumb_func_start ResetCameraUpdateInfo -@ void ResetCameraUpdateInfo() -ResetCameraUpdateInfo: @ 808A11C - ldr r1, =0x03005dd0 - movs r0, 0 - str r0, [r1, 0x8] - str r0, [r1, 0xC] - str r0, [r1, 0x10] - str r0, [r1, 0x14] - str r0, [r1, 0x4] - str r0, [r1] - bx lr - .pool - thumb_func_end ResetCameraUpdateInfo - - thumb_func_start InitCameraUpdateCallback -@ u8 InitCameraUpdateCallback(u8 followedObjectId) -InitCameraUpdateCallback: @ 808A134 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =0x03005dd0 - ldr r1, [r4, 0x4] - cmp r1, 0 - beq _0808A150 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles -_0808A150: - adds r0, r5, 0 - bl AddCameraObject - lsls r0, 24 - lsrs r0, 24 - str r0, [r4, 0x4] - ldr r0, =CameraUpdateCallback - str r0, [r4] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end InitCameraUpdateCallback - - thumb_func_start CameraUpdate -@ void CameraUpdate() -CameraUpdate: @ 808A174 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r6, =0x03005dd0 - ldr r1, [r6] - cmp r1, 0 - beq _0808A188 - adds r0, r6, 0 - bl _call_via_r1 -_0808A188: - ldr r7, [r6, 0x8] - ldr r0, [r6, 0xC] - mov r8, r0 - movs r4, 0 - movs r5, 0 - ldr r1, [r6, 0x10] - ldr r0, [r6, 0x14] - cmp r1, 0 - bne _0808A1A6 - cmp r7, 0 - beq _0808A1A6 - subs r4, 0x1 - cmp r7, 0 - ble _0808A1A6 - movs r4, 0x1 -_0808A1A6: - cmp r0, 0 - bne _0808A1BA - mov r2, r8 - cmp r2, 0 - beq _0808A1BA - movs r5, 0x1 - negs r5, r5 - cmp r2, 0 - ble _0808A1BA - movs r5, 0x1 -_0808A1BA: - cmp r1, 0 - beq _0808A1CC - cmn r1, r7 - bne _0808A1CC - movs r4, 0x1 - negs r4, r4 - cmp r7, 0 - ble _0808A1CC - movs r4, 0x1 -_0808A1CC: - cmp r0, 0 - beq _0808A1E0 - mov r3, r8 - cmn r0, r3 - bne _0808A1E0 - movs r4, 0x1 - negs r4, r4 - cmp r3, 0 - ble _0808A1E0 - movs r4, 0x1 -_0808A1E0: - ldr r2, =0x03005dd0 - ldr r0, [r2, 0x10] - adds r1, r0, r7 - str r1, [r2, 0x10] - adds r0, r1, 0 - cmp r1, 0 - bge _0808A1F0 - adds r0, 0xF -_0808A1F0: - asrs r0, 4 - lsls r0, 4 - subs r0, r1, r0 - str r0, [r2, 0x10] - ldr r0, [r2, 0x14] - mov r3, r8 - adds r1, r0, r3 - str r1, [r2, 0x14] - adds r0, r1, 0 - cmp r1, 0 - bge _0808A208 - adds r0, 0xF -_0808A208: - asrs r0, 4 - lsls r0, 4 - subs r0, r1, r0 - str r0, [r2, 0x14] - cmp r4, 0 - bne _0808A218 - cmp r5, 0 - beq _0808A24E -_0808A218: - adds r0, r4, 0 - adds r1, r5, 0 - bl CameraMove - adds r0, r4, 0 - adds r1, r5, 0 - bl UpdateFieldObjectsForCameraUpdate - adds r0, r4, 0 - adds r1, r5, 0 - bl RotatingGatePuzzleCameraUpdate - bl ResetBerryTreeSparkleFlags - ldr r6, =0x03000e20 - lsls r4, 1 - lsls r5, 1 - adds r0, r6, 0 - adds r1, r4, 0 - adds r2, r5, 0 - bl tilemap_move_something - adds r0, r6, 0 - adds r1, r4, 0 - adds r2, r5, 0 - bl RedrawMapSlicesForCameraUpdate -_0808A24E: - ldr r0, =0x03000e20 - adds r1, r7, 0 - mov r2, r8 - bl coords8_add - ldr r1, =0x03005dec - ldrh r0, [r1] - subs r0, r7 - strh r0, [r1] - ldr r1, =0x03005de8 - ldrh r0, [r1] - mov r2, r8 - subs r0, r2 - strh r0, [r1] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end CameraUpdate - - thumb_func_start sub_808A284 -sub_808A284: @ 808A284 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl CameraMove - lsls r0, r4, 16 - asrs r0, 16 - lsls r1, r5, 16 - asrs r1, 16 - bl UpdateFieldObjectsForCameraUpdate - bl DrawWholeMapView - ldr r1, =0x03005dec - lsls r4, 4 - ldrh r0, [r1] - subs r0, r4 - strh r0, [r1] - ldr r1, =0x03005de8 - lsls r5, 4 - ldrh r0, [r1] - subs r0, r5 - strh r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808A284 - - thumb_func_start SetCameraPanningCallback -@ void SetCameraPanningCallback(void ( *callback)()) -SetCameraPanningCallback: @ 808A2C0 - ldr r1, =0x03000e30 - str r0, [r1] - bx lr - .pool - thumb_func_end SetCameraPanningCallback - - thumb_func_start SetCameraPanning -@ void SetCameraPanning(s16 x, s16 y) -SetCameraPanning: @ 808A2CC - ldr r2, =0x03000e28 - strh r0, [r2] - ldr r0, =0x03000e2a - lsls r1, 16 - asrs r1, 16 - adds r1, 0x20 - strh r1, [r0] - bx lr - .pool - thumb_func_end SetCameraPanning - - thumb_func_start InstallCameraPanAheadCallback -@ void InstallCameraPanAheadCallback() -InstallCameraPanAheadCallback: @ 808A2E4 - ldr r1, =0x03000e30 - ldr r0, =CameraPanningCB_PanAhead - str r0, [r1] - ldr r1, =0x03000e2c - movs r0, 0 - strb r0, [r1] - ldr r1, =0x03000e28 - movs r0, 0 - strh r0, [r1] - ldr r1, =0x03000e2a - movs r0, 0x20 - strh r0, [r1] - bx lr - .pool - thumb_func_end InstallCameraPanAheadCallback - - thumb_func_start UpdateCameraPanning -@ void UpdateCameraPanning() -UpdateCameraPanning: @ 808A314 - push {lr} - ldr r0, =0x03000e30 - ldr r0, [r0] - cmp r0, 0 - beq _0808A322 - bl _call_via_r0 -_0808A322: - ldr r2, =0x02021bbc - ldr r0, =0x03005dec - ldr r1, =0x03000e28 - ldrh r0, [r0] - ldrh r1, [r1] - subs r0, r1 - strh r0, [r2] - ldr r2, =0x02021bbe - ldr r0, =0x03005de8 - ldr r1, =0x03000e2a - ldrh r0, [r0] - ldrh r1, [r1] - subs r0, r1 - subs r0, 0x8 - strh r0, [r2] - pop {r0} - bx r0 - .pool - thumb_func_end UpdateCameraPanning - - thumb_func_start CameraPanningCB_PanAhead -@ void CameraPanningCB_PanAhead() -CameraPanningCB_PanAhead: @ 808A360 - push {lr} - ldr r0, =0x02037348 - ldrb r0, [r0] - cmp r0, 0 - bne _0808A374 - bl InstallCameraPanAheadCallback - b _0808A3FC - .pool -_0808A374: - ldr r0, =0x02037590 - ldrb r0, [r0, 0x3] - cmp r0, 0x1 - bne _0808A394 - ldr r0, =0x03000e2c - ldrb r1, [r0] - movs r2, 0x1 - eors r1, r2 - strb r1, [r0] - cmp r1, 0 - beq _0808A3FC - b _0808A39A - .pool -_0808A394: - ldr r1, =0x03000e2c - movs r0, 0 - strb r0, [r1] -_0808A39A: - bl player_get_direction_upper_nybble - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _0808A3C4 - ldr r2, =0x03000e2a - ldrh r3, [r2] - movs r0, 0 - ldrsh r1, [r2, r0] - movs r0, 0x8 - negs r0, r0 - cmp r1, r0 - ble _0808A3FC - subs r0, r3, 0x2 - b _0808A3FA - .pool -_0808A3C4: - cmp r0, 0x1 - bne _0808A3E0 - ldr r1, =0x03000e2a - ldrh r2, [r1] - movs r3, 0 - ldrsh r0, [r1, r3] - cmp r0, 0x47 - bgt _0808A3FC - adds r0, r2, 0x2 - strh r0, [r1] - b _0808A3FC - .pool -_0808A3E0: - ldr r2, =0x03000e2a - ldrh r0, [r2] - movs r3, 0 - ldrsh r1, [r2, r3] - cmp r1, 0x1F - bgt _0808A3F4 - adds r0, 0x2 - b _0808A3FA - .pool -_0808A3F4: - cmp r1, 0x20 - ble _0808A3FC - subs r0, 0x2 -_0808A3FA: - strh r0, [r2] -_0808A3FC: - pop {r0} - bx r0 - thumb_func_end CameraPanningCB_PanAhead - - thumb_func_start sub_808A400 -sub_808A400: @ 808A400 - push {lr} - adds r2, r0, 0 - ldrb r0, [r2, 0x3] - cmp r0, 0x2 - bne _0808A420 - ldrh r1, [r1, 0x2] - ldr r0, [r2, 0x4] - adds r0, r1 - ldr r1, =0x06007e00 - movs r2, 0x80 - bl CpuFastSet - b _0808A42E - .pool -_0808A420: - ldrh r1, [r1, 0x2] - ldr r0, [r2, 0x4] - adds r0, r1 - ldr r1, =0x06007f00 - movs r2, 0x40 - bl CpuFastSet -_0808A42E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_808A400 - - thumb_func_start door_build_blockdef -door_build_blockdef: @ 808A438 - push {r4-r6,lr} - adds r6, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - movs r4, 0 - adds r1, r6, 0 -_0808A444: - ldrb r0, [r2] - lsls r0, 28 - lsrs r3, r0, 16 - adds r2, 0x1 - adds r0, r5, r4 - orrs r3, r0 - strh r3, [r1] - adds r1, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - ble _0808A444 - cmp r4, 0x7 - bgt _0808A472 - lsls r0, r4, 1 - adds r1, r0, r6 -_0808A462: - ldrb r0, [r2] - lsls r3, r0, 12 - adds r2, 0x1 - strh r3, [r1] - adds r1, 0x2 - adds r4, 0x1 - cmp r4, 0x7 - ble _0808A462 -_0808A472: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end door_build_blockdef - - thumb_func_start door_patch_tilemap -door_patch_tilemap: @ 808A478 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x30 - adds r7, r1, 0 - mov r9, r2 - adds r5, r3, 0 - ldrb r0, [r0, 0x3] - cmp r0, 0x2 - bne _0808A4F4 - add r4, sp, 0x10 - movs r1, 0xFC - lsls r1, 2 - adds r0, r4, 0 - adds r2, r5, 0 - bl door_build_blockdef - mov r6, r9 - subs r6, 0x1 - adds r0, r7, 0 - adds r1, r6, 0 - adds r2, r4, 0 - bl DrawDoorMetatileAt - movs r1, 0xFD - lsls r1, 2 - adds r0, r5, 0x4 - mov r8, r0 - adds r0, r4, 0 - mov r2, r8 - bl door_build_blockdef - adds r0, r7, 0 - mov r1, r9 - adds r2, r4, 0 - bl DrawDoorMetatileAt - movs r1, 0xFE - lsls r1, 2 - adds r0, r4, 0 - adds r2, r5, 0 - bl door_build_blockdef - adds r5, r7, 0x1 - adds r0, r5, 0 - adds r1, r6, 0 - adds r2, r4, 0 - bl DrawDoorMetatileAt - movs r1, 0xFF - lsls r1, 2 - adds r0, r4, 0 - mov r2, r8 - bl door_build_blockdef - adds r0, r5, 0 - mov r1, r9 - adds r2, r4, 0 - bl DrawDoorMetatileAt - b _0808A522 -_0808A4F4: - movs r1, 0xFE - lsls r1, 2 - mov r0, sp - adds r2, r5, 0 - bl door_build_blockdef - mov r1, r9 - subs r1, 0x1 - adds r0, r7, 0 - mov r2, sp - bl DrawDoorMetatileAt - movs r1, 0xFF - lsls r1, 2 - adds r2, r5, 0x4 - mov r0, sp - bl door_build_blockdef - adds r0, r7, 0 - mov r1, r9 - mov r2, sp - bl DrawDoorMetatileAt -_0808A522: - add sp, 0x30 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end door_patch_tilemap - - thumb_func_start sub_808A530 -sub_808A530: @ 808A530 - push {r4-r7,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - subs r7, r6, 0x1 - adds r0, r5, 0 - adds r1, r7, 0 - bl CurrentMapDrawMetatileAt - adds r0, r5, 0 - adds r1, r6, 0 - bl CurrentMapDrawMetatileAt - ldrb r0, [r4, 0x3] - cmp r0, 0x2 - bne _0808A562 - adds r4, r5, 0x1 - adds r0, r4, 0 - adds r1, r7, 0 - bl CurrentMapDrawMetatileAt - adds r0, r4, 0 - adds r1, r6, 0 - bl CurrentMapDrawMetatileAt -_0808A562: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_808A530 - - thumb_func_start sub_808A568 -sub_808A568: @ 808A568 - push {r4-r7,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - adds r7, r3, 0 - ldrh r1, [r5, 0x2] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _0808A5B0 - adds r0, r4, 0 - adds r1, r6, 0 - adds r2, r7, 0 - bl sub_808A530 - bl sub_808A964 - lsls r0, 24 - cmp r0, 0 - beq _0808A5E2 - ldr r0, =0x020375e0 - ldrh r1, [r0] - adds r1, 0x7 - ldr r0, =0x020375e2 - ldrh r2, [r0] - adds r2, 0x7 - adds r0, r4, 0 - bl sub_808A530 - b _0808A5E2 - .pool -_0808A5B0: - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_808A400 - ldr r3, [r4, 0x8] - adds r0, r4, 0 - adds r1, r6, 0 - adds r2, r7, 0 - bl door_patch_tilemap - bl sub_808A964 - lsls r0, 24 - cmp r0, 0 - beq _0808A5E2 - ldr r0, =0x020375e0 - ldrh r1, [r0] - adds r1, 0x7 - ldr r0, =0x020375e2 - ldrh r2, [r0] - adds r2, 0x7 - ldr r3, [r4, 0x8] - adds r0, r4, 0 - bl door_patch_tilemap -_0808A5E2: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808A568 - - thumb_func_start sub_808A5F0 -sub_808A5F0: @ 808A5F0 - push {r4-r6,lr} - adds r6, r0, 0 - adds r5, r1, 0 - adds r4, r2, 0 - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0808A616 - movs r2, 0x8 - ldrsh r1, [r4, r2] - lsls r1, 2 - adds r1, r5, r1 - movs r0, 0xC - ldrsh r2, [r4, r0] - movs r0, 0xE - ldrsh r3, [r4, r0] - adds r0, r6, 0 - bl sub_808A568 -_0808A616: - movs r2, 0xA - ldrsh r1, [r4, r2] - movs r2, 0x8 - ldrsh r0, [r4, r2] - lsls r0, 2 - adds r0, r5 - ldrb r0, [r0] - cmp r1, r0 - bne _0808A644 - movs r0, 0 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r1, 0x8 - ldrsh r0, [r4, r1] - lsls r0, 2 - adds r0, r5 - ldrb r0, [r0] - cmp r0, 0 - bne _0808A64A - movs r0, 0 - b _0808A64C -_0808A644: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] -_0808A64A: - movs r0, 0x1 -_0808A64C: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_808A5F0 - - thumb_func_start task50_overworld_door -task50_overworld_door: @ 808A654 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r2, r4, 2 - adds r2, r4 - lsls r2, 3 - ldr r0, =0x03005e08 - adds r2, r0 - ldrh r1, [r2] - lsls r1, 16 - ldrh r0, [r2, 0x2] - orrs r1, r0 - ldrh r0, [r2, 0x4] - lsls r0, 16 - ldrh r3, [r2, 0x6] - orrs r0, r3 - bl sub_808A5F0 - cmp r0, 0 - bne _0808A682 - adds r0, r4, 0 - bl remove_task -_0808A682: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task50_overworld_door - - thumb_func_start door_frame_last -door_frame_last: @ 808A68C - push {lr} - adds r1, r0, 0 - b _0808A694 -_0808A692: - adds r1, 0x4 -_0808A694: - ldrb r0, [r1] - cmp r0, 0 - bne _0808A692 - subs r0, r1, 0x4 - pop {r1} - bx r1 - thumb_func_end door_frame_last - - thumb_func_start door_find -door_find: @ 808A6A0 - push {lr} - adds r2, r0, 0 - lsls r1, 16 - lsrs r1, 16 - b _0808A6B6 -_0808A6AA: - ldrh r0, [r2] - cmp r0, r1 - bne _0808A6B4 - adds r0, r2, 0 - b _0808A6BE -_0808A6B4: - adds r2, 0xC -_0808A6B6: - ldr r0, [r2, 0x4] - cmp r0, 0 - bne _0808A6AA - movs r0, 0 -_0808A6BE: - pop {r1} - bx r1 - thumb_func_end door_find - - thumb_func_start task_overworld_door_add_if_inactive -task_overworld_door_add_if_inactive: @ 808A6C4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - adds r5, r1, 0 - adds r7, r2, 0 - mov r8, r3 - ldr r4, =task50_overworld_door - adds r0, r4, 0 - bl is_function_an_active_task - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0808A718 - adds r0, r4, 0 - movs r1, 0x50 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r2, =0x03005e08 - adds r1, r2 - strh r7, [r1, 0xC] - mov r2, r8 - strh r2, [r1, 0xE] - strh r5, [r1, 0x2] - lsrs r2, r5, 16 - strh r2, [r1] - strh r6, [r1, 0x6] - lsrs r2, r6, 16 - strh r2, [r1, 0x4] - lsls r0, 24 - asrs r0, 24 - b _0808A71C - .pool -_0808A718: - movs r0, 0x1 - negs r0, r0 -_0808A71C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end task_overworld_door_add_if_inactive - - thumb_func_start sub_808A728 -sub_808A728: @ 808A728 - push {lr} - bl sub_808A530 - pop {r0} - bx r0 - thumb_func_end sub_808A728 - - thumb_func_start sub_808A734 -sub_808A734: @ 808A734 - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - adds r0, r5, 0 - adds r1, r6, 0 - bl MapGridGetMetatileIdAt - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl door_find - adds r4, r0, 0 - cmp r4, 0 - beq _0808A76A - ldr r1, =gUnknown_08496F8C - adds r0, r1, 0 - bl door_frame_last - adds r1, r0, 0 - adds r0, r4, 0 - adds r2, r5, 0 - adds r3, r6, 0 - bl sub_808A568 -_0808A76A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808A734 - - thumb_func_start task_overworld_door_add_for_opening_door_at -@ s32 task_overworld_door_add_for_opening_door_at(void *a1, s32 x, s32 y) -task_overworld_door_add_for_opening_door_at: @ 808A774 - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - adds r0, r5, 0 - adds r1, r6, 0 - bl MapGridGetMetatileIdAt - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl door_find - adds r2, r0, 0 - adds r4, r2, 0 - cmp r2, 0 - bne _0808A79E - movs r0, 0x1 - negs r0, r0 - b _0808A7C0 -_0808A79E: - ldrb r0, [r2, 0x3] - cmp r0, 0x2 - beq _0808A7B0 - ldr r1, =gUnknown_08496F8C - adds r0, r2, 0 - b _0808A7B4 - .pool -_0808A7B0: - ldr r1, =gUnknown_08496FB4 - adds r0, r4, 0 -_0808A7B4: - adds r2, r5, 0 - adds r3, r6, 0 - bl task_overworld_door_add_if_inactive - lsls r0, 24 - asrs r0, 24 -_0808A7C0: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end task_overworld_door_add_for_opening_door_at - - thumb_func_start sub_808A7CC -sub_808A7CC: @ 808A7CC - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - adds r0, r5, 0 - adds r1, r6, 0 - bl MapGridGetMetatileIdAt - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl door_find - cmp r0, 0 - beq _0808A800 - ldr r1, =gUnknown_08496FA0 - adds r2, r5, 0 - adds r3, r6, 0 - bl task_overworld_door_add_if_inactive - lsls r0, 24 - asrs r0, 24 - b _0808A804 - .pool -_0808A800: - movs r0, 0x1 - negs r0, r0 -_0808A804: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_808A7CC - - thumb_func_start cur_mapdata_get_door_x2_at -cur_mapdata_get_door_x2_at: @ 808A80C - push {r4,lr} - adds r4, r0, 0 - adds r0, r1, 0 - adds r1, r2, 0 - bl MapGridGetMetatileIdAt - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl door_find - cmp r0, 0 - beq _0808A830 - ldrb r0, [r0, 0x2] - lsls r0, 24 - asrs r0, 24 - b _0808A834 -_0808A830: - movs r0, 0x1 - negs r0, r0 -_0808A834: - pop {r4} - pop {r1} - bx r1 - thumb_func_end cur_mapdata_get_door_x2_at - - thumb_func_start sub_808A83C -sub_808A83C: @ 808A83C - push {lr} - adds r3, r0, 0 - adds r2, r1, 0 - ldr r0, =gUnknown_08497174 - adds r1, r3, 0 - bl task_overworld_door_add_for_opening_door_at - pop {r0} - bx r0 - .pool - thumb_func_end sub_808A83C - - thumb_func_start sub_808A854 -sub_808A854: @ 808A854 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl sub_8088EFC - lsls r0, 24 - cmp r0, 0 - beq _0808A876 - ldr r0, =gUnknown_08497174 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_808A734 -_0808A876: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808A854 - - thumb_func_start sub_808A880 -sub_808A880: @ 808A880 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl sub_8088EFC - lsls r0, 24 - cmp r0, 0 - beq _0808A8A2 - ldr r0, =gUnknown_08497174 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_808A728 -_0808A8A2: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808A880 - - thumb_func_start sub_808A8AC -sub_808A8AC: @ 808A8AC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl sub_8088EFC - lsls r0, 24 - cmp r0, 0 - beq _0808A8D8 - ldr r0, =gUnknown_08497174 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_808A7CC - lsls r0, 24 - asrs r0, 24 - b _0808A8DC - .pool -_0808A8D8: - movs r0, 0x1 - negs r0, r0 -_0808A8DC: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_808A8AC - - thumb_func_start task_overworld_door_add_if_role_69_for_opening_door_at -task_overworld_door_add_if_role_69_for_opening_door_at: @ 808A8E4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl sub_8088EFC - lsls r0, 24 - cmp r0, 0 - beq _0808A910 - ldr r0, =gUnknown_08497174 - adds r1, r4, 0 - adds r2, r5, 0 - bl task_overworld_door_add_for_opening_door_at - lsls r0, 24 - asrs r0, 24 - b _0808A914 - .pool -_0808A910: - movs r0, 0x1 - negs r0, r0 -_0808A914: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end task_overworld_door_add_if_role_69_for_opening_door_at - - thumb_func_start sub_808A91C -sub_808A91C: @ 808A91C - push {lr} - ldr r0, =task50_overworld_door - bl is_function_an_active_task - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_808A91C - - thumb_func_start cur_mapdata_get_door_sound_at -cur_mapdata_get_door_sound_at: @ 808A930 - push {lr} - adds r3, r0, 0 - adds r2, r1, 0 - ldr r0, =gUnknown_08497174 - adds r1, r3, 0 - bl cur_mapdata_get_door_x2_at - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - beq _0808A958 - cmp r0, 0x1 - bne _0808A954 - movs r0, 0x12 - b _0808A95E - .pool -_0808A954: - cmp r0, 0x2 - beq _0808A95C -_0808A958: - movs r0, 0x8 - b _0808A95E -_0808A95C: - movs r0, 0x2F -_0808A95E: - pop {r1} - bx r1 - thumb_func_end cur_mapdata_get_door_sound_at - - thumb_func_start sub_808A964 -sub_808A964: @ 808A964 - push {lr} - ldr r0, =0x00004002 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0808A990 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r1, [r0, 0x4] - ldr r0, =0x0000101a - cmp r1, r0 - bne _0808A990 - movs r0, 0x1 - b _0808A992 - .pool -_0808A990: - movs r0, 0 -_0808A992: - pop {r1} - bx r1 - thumb_func_end sub_808A964 - - thumb_func_start FieldObjectCB_NoMovement2 -@ void FieldObjectCB_NoMovement2(struct obj *object) -FieldObjectCB_NoMovement2: @ 808A998 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =FieldObjectCB2_NoMovement2 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_NoMovement2 - - thumb_func_start FieldObjectCB2_NoMovement2 -FieldObjectCB2_NoMovement2: @ 808A9BC - movs r0, 0 - bx lr - thumb_func_end FieldObjectCB2_NoMovement2 - - thumb_func_start player_step -@ void player_step(int dpad_direction, int buttons_new, int buttons_held) -player_step: @ 808A9C0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, 16 - lsrs r7, r1, 16 - lsls r2, 16 - lsrs r6, r2, 16 - ldr r4, =0x02037590 - ldrb r1, [r4, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r5, r0, r1 - adds r0, r5, 0 - bl sub_808C280 - ldrb r0, [r4, 0x6] - cmp r0, 0 - bne _0808AA26 - adds r0, r7, 0 - adds r1, r6, 0 - bl sub_8119C3C - adds r0, r5, 0 - mov r1, r8 - bl TryInterruptFieldObjectSpecialAnim - lsls r0, 24 - cmp r0, 0 - bne _0808AA26 - adds r0, r5, 0 - bl npc_clear_strange_bits - bl DoPlayerAvatarTransition - bl TryDoMetatileBehaviorForcedMovment - lsls r0, 24 - cmp r0, 0 - bne _0808AA26 - mov r0, r8 - adds r1, r7, 0 - adds r2, r6, 0 - bl MovePlayerAvatarUsingKeypadInput - bl PlayerAllowForcedMovementIfMovingSameDirection -_0808AA26: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end player_step - - thumb_func_start TryInterruptFieldObjectSpecialAnim -@ bool8 TryInterruptFieldObjectSpecialAnim(struct npc_state *fieldObject, u8 direction) -TryInterruptFieldObjectSpecialAnim: @ 808AA38 - push {r4-r6,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - adds r6, r5, 0 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - cmp r0, 0 - beq _0808AA92 - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - bne _0808AA92 - adds r0, r4, 0 - bl FieldObjectGetSpecialAnim - lsls r0, 24 - movs r1, 0xE7 - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x3 - bhi _0808AA70 - cmp r5, 0 - bne _0808AA74 -_0808AA70: - movs r0, 0x1 - b _0808AA94 -_0808AA74: - ldrb r0, [r4, 0x18] - lsrs r0, 4 - cmp r0, r5 - beq _0808AA84 -_0808AA7C: - adds r0, r4, 0 - bl FieldObjectClearAnim - b _0808AA92 -_0808AA84: - adds r0, r6, 0 - bl sub_808B028 - lsls r0, 24 - cmp r0, 0 - beq _0808AA7C - b _0808AA70 -_0808AA92: - movs r0, 0 -_0808AA94: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end TryInterruptFieldObjectSpecialAnim - - thumb_func_start npc_clear_strange_bits -@ void npc_clear_strange_bits(struct npc_state *fieldObject) -npc_clear_strange_bits: @ 808AA9C - ldrb r2, [r0, 0x1] - movs r1, 0x11 - negs r1, r1 - ands r1, r2 - movs r2, 0x5 - negs r2, r2 - ands r1, r2 - adds r2, 0x2 - ands r1, r2 - strb r1, [r0, 0x1] - ldr r2, =0x02037590 - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - bx lr - .pool - thumb_func_end npc_clear_strange_bits - - thumb_func_start MovePlayerAvatarUsingKeypadInput -@ void MovePlayerAvatarUsingKeypadInput(int dpad_direction, int buttons_new, int buttons_held) -MovePlayerAvatarUsingKeypadInput: @ 808AAC0 - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r1, 16 - lsrs r4, r1, 16 - lsls r2, 16 - lsrs r2, 16 - ldr r0, =0x02037590 - ldrb r1, [r0] - movs r0, 0x6 - ands r0, r1 - cmp r0, 0 - beq _0808AAE8 - adds r0, r3, 0 - adds r1, r4, 0 - bl MovePlayerOnBike - b _0808AAF0 - .pool -_0808AAE8: - adds r0, r3, 0 - adds r1, r2, 0 - bl MovePlayerNotOnBike -_0808AAF0: - pop {r4} - pop {r0} - bx r0 - thumb_func_end MovePlayerAvatarUsingKeypadInput - - thumb_func_start PlayerAllowForcedMovementIfMovingSameDirection -@ void PlayerAllowForcedMovementIfMovingSameDirection() -PlayerAllowForcedMovementIfMovingSameDirection: @ 808AAF8 - push {lr} - ldr r2, =0x02037590 - ldrb r0, [r2, 0x2] - cmp r0, 0x2 - bne _0808AB0A - ldrb r1, [r2] - movs r0, 0xDF - ands r0, r1 - strb r0, [r2] -_0808AB0A: - pop {r0} - bx r0 - .pool - thumb_func_end PlayerAllowForcedMovementIfMovingSameDirection - - thumb_func_start TryDoMetatileBehaviorForcedMovment -@ bool8 TryDoMetatileBehaviorForcedMovment() -TryDoMetatileBehaviorForcedMovment: @ 808AB14 - push {r4,lr} - ldr r4, =gUnknown_08497444 - bl GetForcedMovementByMetatileBehavior - lsls r0, 24 - lsrs r0, 22 - adds r0, r4 - ldr r0, [r0] - bl _call_via_r0 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end TryDoMetatileBehaviorForcedMovment - - thumb_func_start GetForcedMovementByMetatileBehavior -@ u8 GetForcedMovementByMetatileBehavior() -GetForcedMovementByMetatileBehavior: @ 808AB38 - push {r4-r6,lr} - ldr r3, =0x02037590 - ldrb r1, [r3] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _0808AB8A - ldr r2, =0x02037350 - ldrb r1, [r3, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r5, [r0, 0x1E] - movs r4, 0 - ldr r6, =gUnknown_084973FC -_0808AB58: - lsls r0, r4, 2 - adds r0, r6 - ldr r1, [r0] - adds r0, r5, 0 - bl _call_via_r1 - lsls r0, 24 - cmp r0, 0 - beq _0808AB80 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r0, 24 - b _0808AB8C - .pool -_0808AB80: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x11 - bls _0808AB58 -_0808AB8A: - movs r0, 0 -_0808AB8C: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end GetForcedMovementByMetatileBehavior - - thumb_func_start ForcedMovement_None -ForcedMovement_None: @ 808AB94 - push {r4,lr} - ldr r4, =0x02037590 - ldrb r1, [r4] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0808ABCE - ldrb r1, [r4, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - ldrb r2, [r0, 0x1] - movs r1, 0x3 - negs r1, r1 - ands r1, r2 - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0, 0x1] - ldrb r1, [r0, 0x18] - lsls r1, 28 - lsrs r1, 28 - bl FieldObjectSetDirection - ldrb r1, [r4] - movs r0, 0xBF - ands r0, r1 - strb r0, [r4] -_0808ABCE: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end ForcedMovement_None - - thumb_func_start DoForcedMovement -DoForcedMovement: @ 808ABE0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r9, r1 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r6, =0x02037590 - adds r0, r5, 0 - bl CheckForPlayerAvatarCollision - lsls r0, 24 - lsrs r4, r0, 24 - adds r7, r4, 0 - ldrb r0, [r6] - movs r1, 0x40 - mov r10, r1 - movs r1, 0 - mov r8, r1 - mov r1, r10 - orrs r0, r1 - strb r0, [r6] - cmp r4, 0 - beq _0808AC3C - bl ForcedMovement_None - cmp r4, 0x4 - bhi _0808AC24 - movs r0, 0 - b _0808AC48 - .pool -_0808AC24: - cmp r7, 0x6 - bne _0808AC2E - adds r0, r5, 0 - bl PlayerJumpLedge -_0808AC2E: - ldrb r0, [r6] - mov r1, r10 - orrs r0, r1 - strb r0, [r6] - movs r0, 0x2 - strb r0, [r6, 0x2] - b _0808AC46 -_0808AC3C: - movs r0, 0x2 - strb r0, [r6, 0x2] - adds r0, r5, 0 - bl _call_via_r9 -_0808AC46: - movs r0, 0x1 -_0808AC48: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end DoForcedMovement - - thumb_func_start DoForcedMovementInCurrentDirection -DoForcedMovementInCurrentDirection: @ 808AC58 - push {lr} - adds r1, r0, 0 - ldr r0, =0x02037590 - ldrb r2, [r0, 0x5] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldrb r2, [r0, 0x1] - movs r3, 0x4 - orrs r2, r3 - strb r2, [r0, 0x1] - ldrb r0, [r0, 0x18] - lsrs r0, 4 - bl DoForcedMovement - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end DoForcedMovementInCurrentDirection - - thumb_func_start ForcedMovement_Slip -ForcedMovement_Slip: @ 808AC8C - push {lr} - ldr r0, =PlayerGoSpeed1 - bl DoForcedMovementInCurrentDirection - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end ForcedMovement_Slip - - thumb_func_start ForcedMovement_WalkSouth -ForcedMovement_WalkSouth: @ 808ACA0 - push {lr} - ldr r1, =PlayerGoSpeed0 - movs r0, 0x1 - bl DoForcedMovement - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end ForcedMovement_WalkSouth - - thumb_func_start ForcedMovement_WalkNorth -ForcedMovement_WalkNorth: @ 808ACB8 - push {lr} - ldr r1, =PlayerGoSpeed0 - movs r0, 0x2 - bl DoForcedMovement - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end ForcedMovement_WalkNorth - - thumb_func_start ForcedMovement_WalkWest -ForcedMovement_WalkWest: @ 808ACD0 - push {lr} - ldr r1, =PlayerGoSpeed0 - movs r0, 0x3 - bl DoForcedMovement - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end ForcedMovement_WalkWest - - thumb_func_start ForcedMovement_WalkEast -ForcedMovement_WalkEast: @ 808ACE8 - push {lr} - ldr r1, =PlayerGoSpeed0 - movs r0, 0x4 - bl DoForcedMovement - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end ForcedMovement_WalkEast - - thumb_func_start ForcedMovement_PushedSouthByCurrent -ForcedMovement_PushedSouthByCurrent: @ 808AD00 - push {lr} - ldr r1, =PlayerGoSpeed2 - movs r0, 0x1 - bl DoForcedMovement - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end ForcedMovement_PushedSouthByCurrent - - thumb_func_start ForcedMovement_PushedNorthByCurrent -ForcedMovement_PushedNorthByCurrent: @ 808AD18 - push {lr} - ldr r1, =PlayerGoSpeed2 - movs r0, 0x2 - bl DoForcedMovement - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end ForcedMovement_PushedNorthByCurrent - - thumb_func_start ForcedMovement_PushedWestByCurrent -ForcedMovement_PushedWestByCurrent: @ 808AD30 - push {lr} - ldr r1, =PlayerGoSpeed2 - movs r0, 0x3 - bl DoForcedMovement - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end ForcedMovement_PushedWestByCurrent - - thumb_func_start ForcedMovement_PushedEastByCurrent -ForcedMovement_PushedEastByCurrent: @ 808AD48 - push {lr} - ldr r1, =PlayerGoSpeed2 - movs r0, 0x4 - bl DoForcedMovement - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end ForcedMovement_PushedEastByCurrent - - thumb_func_start ForcedMovement_Slide -ForcedMovement_Slide: @ 808AD60 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02037590 - ldrb r3, [r2, 0x5] - lsls r2, r3, 3 - adds r2, r3 - lsls r2, 2 - ldr r3, =0x02037350 - adds r2, r3 - ldrb r3, [r2, 0x1] - movs r4, 0x4 - orrs r3, r4 - movs r4, 0x2 - orrs r3, r4 - strb r3, [r2, 0x1] - bl DoForcedMovement - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end ForcedMovement_Slide - - thumb_func_start ForcedMovement_SlideSouth -ForcedMovement_SlideSouth: @ 808AD98 - push {lr} - ldr r1, =PlayerGoSpeed1 - movs r0, 0x1 - bl ForcedMovement_Slide - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end ForcedMovement_SlideSouth - - thumb_func_start ForcedMovement_SlideNorth -ForcedMovement_SlideNorth: @ 808ADB0 - push {lr} - ldr r1, =PlayerGoSpeed1 - movs r0, 0x2 - bl ForcedMovement_Slide - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end ForcedMovement_SlideNorth - - thumb_func_start ForcedMovement_SlideWest -ForcedMovement_SlideWest: @ 808ADC8 - push {lr} - ldr r1, =PlayerGoSpeed1 - movs r0, 0x3 - bl ForcedMovement_Slide - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end ForcedMovement_SlideWest - - thumb_func_start ForcedMovement_SlideEast -ForcedMovement_SlideEast: @ 808ADE0 - push {lr} - ldr r1, =PlayerGoSpeed1 - movs r0, 0x4 - bl ForcedMovement_Slide - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end ForcedMovement_SlideEast - - thumb_func_start ForcedMovement_0xBB -ForcedMovement_0xBB: @ 808ADF8 - push {lr} - bl sub_808C4D8 - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end ForcedMovement_0xBB - - thumb_func_start ForcedMovement_0xBC -ForcedMovement_0xBC: @ 808AE04 - push {lr} - bl sub_808C5B0 - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end ForcedMovement_0xBC - - thumb_func_start ForcedMovement_MuddySlope -ForcedMovement_MuddySlope: @ 808AE10 - push {r4,lr} - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - ldrb r1, [r4, 0x18] - movs r0, 0xF0 - ands r0, r1 - cmp r0, 0x20 - bne _0808AE36 - bl sub_811A138 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - bgt _0808AE60 -_0808AE36: - movs r0, 0 - bl sub_811A114 - ldrb r0, [r4, 0x1] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4, 0x1] - ldr r1, =PlayerGoSpeed1 - movs r0, 0x1 - bl DoForcedMovement - lsls r0, 24 - lsrs r0, 24 - b _0808AE62 - .pool -_0808AE60: - movs r0, 0 -_0808AE62: - pop {r4} - pop {r1} - bx r1 - thumb_func_end ForcedMovement_MuddySlope - - thumb_func_start MovePlayerNotOnBike -@ void MovePlayerNotOnBike(u8 direction, u8 heldKeys) -MovePlayerNotOnBike: @ 808AE68 - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 16 - lsrs r5, 16 - ldr r6, =gUnknown_08497490 - adds r0, r4, 0 - bl CheckMovementInputNotOnBike - lsls r0, 24 - lsrs r0, 22 - adds r0, r6 - ldr r2, [r0] - adds r0, r4, 0 - adds r1, r5, 0 - bl _call_via_r2 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end MovePlayerNotOnBike - - thumb_func_start CheckMovementInputNotOnBike -@ u8 CheckMovementInputNotOnBike(u8 direction) -CheckMovementInputNotOnBike: @ 808AE98 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _0808AEB0 - ldr r0, =0x02037590 - strb r4, [r0, 0x2] - movs r0, 0 - b _0808AED2 - .pool -_0808AEB0: - bl player_get_direction_upper_nybble - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - beq _0808AECC - ldr r1, =0x02037590 - ldrb r0, [r1, 0x2] - cmp r0, 0x2 - beq _0808AECC - movs r0, 0x1 - b _0808AED0 - .pool -_0808AECC: - ldr r1, =0x02037590 - movs r0, 0x2 -_0808AED0: - strb r0, [r1, 0x2] -_0808AED2: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end CheckMovementInputNotOnBike - - thumb_func_start PlayerNotOnBikeNotMoving -@ void PlayerNotOnBikeNotMoving(u8 direction, u8 heldKeys) -PlayerNotOnBikeNotMoving: @ 808AEDC - push {lr} - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - bl PlayerFaceDirection - pop {r0} - bx r0 - thumb_func_end PlayerNotOnBikeNotMoving - - thumb_func_start PlayerNotOnBikeTurningInPlace -@ void PlayerNotOnBikeTurningInPlace(u8 direction, u8 heldKeys) -PlayerNotOnBikeTurningInPlace: @ 808AEF0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl PlayerTurnInPlace - pop {r0} - bx r0 - thumb_func_end PlayerNotOnBikeTurningInPlace - - thumb_func_start PlayerNotOnBikeMoving -@ void PlayerNotOnBikeMoving(u8 direction, u8 heldKeys) -PlayerNotOnBikeMoving: @ 808AF00 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 16 - lsrs r6, r1, 16 - adds r0, r5, 0 - bl CheckForPlayerAvatarCollision - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _0808AF4E - cmp r4, 0x6 - bne _0808AF24 - adds r0, r5, 0 - bl PlayerJumpLedge - b _0808AFB6 -_0808AF24: - cmp r4, 0x4 - bne _0808AF3C - adds r0, r5, 0 - bl IsPlayerCollidingWithFarawayIslandMew - lsls r0, 24 - cmp r0, 0 - beq _0808AF3C - adds r0, r5, 0 - bl PlayerNotOnBikeCollideWithFarawayIslandMew - b _0808AFB6 -_0808AF3C: - subs r0, r4, 0x5 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bls _0808AFB6 - adds r0, r5, 0 - bl PlayerNotOnBikeCollide - b _0808AFB6 -_0808AF4E: - ldr r4, =0x02037590 - ldrb r1, [r4] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0808AF68 - adds r0, r5, 0 - bl PlayerGoSpeed1 - b _0808AFB6 - .pool -_0808AF68: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _0808AFB0 - movs r0, 0x2 - ands r6, r0 - cmp r6, 0 - beq _0808AFB0 - movs r0, 0x8C - lsls r0, 4 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0808AFB0 - ldr r2, =0x02037350 - ldrb r1, [r4, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1E] - bl IsRunningDisallowed - cmp r0, 0 - bne _0808AFB0 - adds r0, r5, 0 - bl PlayerRun - ldrb r1, [r4] - movs r0, 0x80 - orrs r0, r1 - strb r0, [r4] - b _0808AFB6 - .pool -_0808AFB0: - adds r0, r5, 0 - bl PlayerGoSpeed0 -_0808AFB6: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end PlayerNotOnBikeMoving - - thumb_func_start CheckForPlayerAvatarCollision -CheckForPlayerAvatarCollision: @ 808AFBC - push {r4-r6,lr} - sub sp, 0x8 - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - ldr r0, =0x02037590 - ldrb r0, [r0, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02037350 - adds r4, r0 - ldrh r1, [r4, 0x10] - add r0, sp, 0x4 - strh r1, [r0] - ldrh r0, [r4, 0x12] - mov r5, sp - adds r5, 0x6 - strh r0, [r5] - adds r0, r6, 0 - add r1, sp, 0x4 - adds r2, r5, 0 - bl MoveCoords - add r0, sp, 0x4 - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r5, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - add r1, sp, 0x4 - movs r3, 0 - ldrsh r1, [r1, r3] - movs r3, 0 - ldrsh r2, [r5, r3] - str r0, [sp] - adds r0, r4, 0 - adds r3, r6, 0 - bl CheckForFieldObjectCollision - lsls r0, 24 - lsrs r0, 24 - add sp, 0x8 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end CheckForPlayerAvatarCollision - - thumb_func_start sub_808B028 -sub_808B028: @ 808B028 - push {r4-r6,lr} - sub sp, 0x8 - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - ldr r0, =0x02037590 - ldrb r0, [r0, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02037350 - adds r4, r0 - ldrh r1, [r4, 0x10] - add r0, sp, 0x4 - strh r1, [r0] - ldrh r0, [r4, 0x12] - mov r5, sp - adds r5, 0x6 - strh r0, [r5] - adds r0, r6, 0 - add r1, sp, 0x4 - adds r2, r5, 0 - bl MoveCoords - add r0, sp, 0x4 - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r5, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - add r1, sp, 0x4 - movs r3, 0 - ldrsh r1, [r1, r3] - movs r3, 0 - ldrsh r2, [r5, r3] - str r0, [sp] - adds r0, r4, 0 - adds r3, r6, 0 - bl sub_808B164 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x8 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_808B028 - - thumb_func_start CheckForFieldObjectCollision -@ u8 CheckForFieldObjectCollision(struct npc_state *fieldObject, u16 x, u16 y, u8 direction, u8 metatileBehavior) -CheckForFieldObjectCollision: @ 808B094 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - ldr r4, [sp, 0x24] - lsls r1, 16 - lsls r2, 16 - lsls r3, 24 - lsrs r6, r3, 24 - lsls r4, 24 - lsrs r4, 24 - mov r10, r4 - lsrs r7, r1, 16 - asrs r5, r1, 16 - lsrs r1, r2, 16 - mov r9, r1 - asrs r4, r2, 16 - adds r1, r5, 0 - adds r2, r4, 0 - adds r3, r6, 0 - bl npc_block_way - lsls r0, 24 - lsrs r0, 24 - mov r1, sp - strb r0, [r1] - cmp r0, 0x3 - bne _0808B0E4 - adds r0, r5, 0 - adds r1, r4, 0 - adds r2, r6, 0 - bl sub_808B1BC - lsls r0, 24 - cmp r0, 0 - beq _0808B0E4 - movs r0, 0x5 - b _0808B152 -_0808B0E4: - lsls r5, r7, 16 - asrs r0, r5, 16 - mov r8, r0 - mov r1, r9 - lsls r4, r1, 16 - asrs r7, r4, 16 - adds r1, r7, 0 - adds r2, r6, 0 - bl ShouldJumpLedge - lsls r0, 24 - cmp r0, 0 - beq _0808B108 - movs r0, 0x2B - bl sav12_xor_increment - movs r0, 0x6 - b _0808B152 -_0808B108: - mov r0, sp - ldrb r0, [r0] - cmp r0, 0x4 - bne _0808B124 - mov r0, r8 - adds r1, r7, 0 - adds r2, r6, 0 - bl sub_808B238 - lsls r0, 24 - cmp r0, 0 - beq _0808B124 - movs r0, 0x7 - b _0808B152 -_0808B124: - mov r0, sp - ldrb r0, [r0] - cmp r0, 0 - bne _0808B14E - asrs r5, 16 - asrs r4, 16 - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl CheckForRotatingGatePuzzleCollision - cmp r0, 0 - beq _0808B142 - movs r0, 0x8 - b _0808B152 -_0808B142: - adds r0, r5, 0 - adds r1, r4, 0 - mov r2, r10 - mov r3, sp - bl check_acro_bike_metatile -_0808B14E: - mov r0, sp - ldrb r0, [r0] -_0808B152: - 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 CheckForFieldObjectCollision - - thumb_func_start sub_808B164 -sub_808B164: @ 808B164 - push {r4-r7,lr} - sub sp, 0x4 - ldr r4, [sp, 0x18] - lsls r3, 24 - lsrs r6, r3, 24 - lsls r4, 24 - lsrs r7, r4, 24 - lsls r1, 16 - asrs r5, r1, 16 - lsls r2, 16 - asrs r4, r2, 16 - adds r1, r5, 0 - adds r2, r4, 0 - adds r3, r6, 0 - bl npc_block_way - lsls r0, 24 - lsrs r0, 24 - mov r1, sp - strb r0, [r1] - cmp r0, 0 - bne _0808B1AE - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_80FBFD4 - cmp r0, 0 - beq _0808B1A2 - movs r0, 0x8 - b _0808B1B2 -_0808B1A2: - adds r0, r5, 0 - adds r1, r4, 0 - adds r2, r7, 0 - mov r3, sp - bl check_acro_bike_metatile -_0808B1AE: - mov r0, sp - ldrb r0, [r0] -_0808B1B2: - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_808B164 - - thumb_func_start sub_808B1BC -@ bool8 sub_808B1BC(u16 x, u16 y, u8 direction) -sub_808B1BC: @ 808B1BC - push {r4-r6,lr} - lsls r0, 16 - lsrs r3, r0, 16 - lsls r1, 16 - lsrs r4, r1, 16 - lsls r2, 24 - lsrs r6, r2, 24 - ldr r0, =0x02037590 - ldrb r1, [r0] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0808B20C - lsls r5, r3, 16 - asrs r0, r5, 16 - lsls r4, 16 - asrs r1, r4, 16 - bl MapGridGetZCoordAt - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _0808B20C - lsrs r0, r5, 16 - lsrs r1, r4, 16 - movs r2, 0x3 - bl GetFieldObjectIdByXYZ - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x10 - bne _0808B20C - adds r0, r6, 0 - bl sub_808C750 - movs r0, 0x1 - b _0808B20E - .pool -_0808B20C: - movs r0, 0 -_0808B20E: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_808B1BC - - thumb_func_start ShouldJumpLedge -@ bool8 ShouldJumpLedge(s16 x, s16 y, u8 direction) -ShouldJumpLedge: @ 808B214 - push {lr} - lsls r2, 24 - lsrs r2, 24 - lsls r0, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - bl GetLedgeJumpDirection - lsls r0, 24 - cmp r0, 0 - bne _0808B230 - movs r0, 0 - b _0808B232 -_0808B230: - movs r0, 0x1 -_0808B232: - pop {r1} - bx r1 - thumb_func_end ShouldJumpLedge - - thumb_func_start sub_808B238 -sub_808B238: @ 808B238 - push {r4-r7,lr} - sub sp, 0x4 - mov r3, sp - strh r0, [r3] - mov r5, sp - adds r5, 0x2 - strh r1, [r5] - lsls r2, 24 - lsrs r7, r2, 24 - ldr r0, =0x00000889 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0808B2D8 - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r5, r2] - bl GetFieldObjectIdByXY - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x10 - beq _0808B2D8 - ldr r0, =0x02037350 - lsls r1, r6, 3 - adds r1, r6 - lsls r1, 2 - adds r4, r1, r0 - ldrb r0, [r4, 0x5] - cmp r0, 0x57 - bne _0808B2D8 - ldrh r1, [r4, 0x10] - mov r0, sp - strh r1, [r0] - ldrh r0, [r4, 0x12] - strh r0, [r5] - adds r0, r7, 0 - mov r1, sp - adds r2, r5, 0 - bl MoveCoords - mov r0, sp - movs r2, 0 - ldrsh r1, [r0, r2] - movs r0, 0 - ldrsh r2, [r5, r0] - adds r0, r4, 0 - adds r3, r7, 0 - bl npc_block_way - lsls r0, 24 - cmp r0, 0 - bne _0808B2D8 - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r5, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl sub_8088F58 - lsls r0, 24 - cmp r0, 0 - bne _0808B2D8 - adds r0, r6, 0 - adds r1, r7, 0 - bl task_add_bump_boulder - movs r0, 0x1 - b _0808B2DA - .pool -_0808B2D8: - movs r0, 0 -_0808B2DA: - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_808B238 - - thumb_func_start check_acro_bike_metatile -@ void check_acro_bike_metatile(s16 x, s16 y, u8 metatileBehavior, u8 *returnValue) -check_acro_bike_metatile: @ 808B2E4 - push {r4-r7,lr} - adds r6, r3, 0 - lsls r2, 24 - lsrs r5, r2, 24 - movs r4, 0 - ldr r7, =gUnknown_0849749C -_0808B2F0: - lsls r0, r4, 2 - adds r0, r7 - ldr r1, [r0] - adds r0, r5, 0 - bl _call_via_r1 - lsls r0, 24 - cmp r0, 0 - beq _0808B314 - ldr r0, =gUnknown_084974B0 - adds r0, r4, r0 - ldrb r0, [r0] - strb r0, [r6] - b _0808B31E - .pool -_0808B314: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x4 - bls _0808B2F0 -_0808B31E: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end check_acro_bike_metatile - - thumb_func_start IsPlayerCollidingWithFarawayIslandMew -@ bool8 IsPlayerCollidingWithFarawayIslandMew(u8 direction) -IsPlayerCollidingWithFarawayIslandMew: @ 808B324 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02037590 - ldrb r2, [r1, 0x5] - lsls r1, r2, 3 - adds r1, r2 - lsls r1, 2 - ldr r5, =0x02037350 - adds r3, r1, r5 - ldrh r2, [r3, 0x10] - mov r1, sp - strh r2, [r1] - ldrh r1, [r3, 0x12] - mov r4, sp - adds r4, 0x2 - strh r1, [r4] - mov r1, sp - adds r2, r4, 0 - bl MoveCoords - movs r0, 0x1 - movs r1, 0x39 - movs r2, 0x1A - bl GetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - lsrs r1, r0, 24 - adds r6, r4, 0 - cmp r1, 0x10 - beq _0808B3C0 - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r3, r0, r5 - mov r0, sp - movs r1, 0x14 - ldrsh r2, [r3, r1] - movs r4, 0 - ldrsh r0, [r0, r4] - cmp r2, r0 - bne _0808B3C0 - movs r5, 0x16 - ldrsh r1, [r3, r5] - movs r4, 0 - ldrsh r0, [r6, r4] - ldrh r4, [r3, 0x16] - cmp r1, r0 - bne _0808B398 - movs r5, 0x10 - ldrsh r0, [r3, r5] - cmp r0, r2 - bne _0808B398 - movs r2, 0x12 - ldrsh r0, [r3, r2] - cmp r0, r1 - beq _0808B3C0 -_0808B398: - mov r0, sp - movs r5, 0x14 - ldrsh r1, [r3, r5] - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r1, r0 - bne _0808B3C0 - lsls r0, r4, 16 - asrs r0, 16 - movs r4, 0 - ldrsh r1, [r6, r4] - cmp r0, r1 - bne _0808B3C0 - movs r0, 0x1 - b _0808B3C2 - .pool -_0808B3C0: - movs r0, 0 -_0808B3C2: - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end IsPlayerCollidingWithFarawayIslandMew - - thumb_func_start SetPlayerAvatarTransitionFlags -@ void SetPlayerAvatarTransitionFlags(u16 transitionFlags) -SetPlayerAvatarTransitionFlags: @ 808B3CC - push {lr} - lsls r0, 16 - lsrs r0, 16 - ldr r2, =0x02037590 - ldrb r1, [r2, 0x1] - orrs r0, r1 - strb r0, [r2, 0x1] - bl DoPlayerAvatarTransition - pop {r0} - bx r0 - .pool - thumb_func_end SetPlayerAvatarTransitionFlags - - thumb_func_start DoPlayerAvatarTransition -@ void DoPlayerAvatarTransition() -DoPlayerAvatarTransition: @ 808B3E8 - push {r4,r5,lr} - ldr r0, =0x02037590 - ldrb r4, [r0, 0x1] - cmp r4, 0 - beq _0808B428 - movs r5, 0 -_0808B3F4: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _0808B416 - ldr r0, =gUnknown_084974B8 - lsls r2, r5, 2 - adds r2, r0 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - ldr r1, [r2] - bl _call_via_r1 -_0808B416: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - lsrs r4, 1 - cmp r5, 0x7 - bls _0808B3F4 - ldr r1, =0x02037590 - movs r0, 0 - strb r0, [r1, 0x1] -_0808B428: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DoPlayerAvatarTransition - - thumb_func_start PlayerAvatarTransition_Dummy -@ void PlayerAvatarTransition_Dummy(struct npc_state *fieldObject) -PlayerAvatarTransition_Dummy: @ 808B43C - bx lr - thumb_func_end PlayerAvatarTransition_Dummy - - thumb_func_start PlayerAvatarTransition_Normal -@ void PlayerAvatarTransition_Normal(struct npc_state *fieldObject) -PlayerAvatarTransition_Normal: @ 808B440 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0 - bl GetPlayerAvatarGraphicsIdByStateId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetGraphicsId - ldrb r1, [r4, 0x18] - lsrs r1, 4 - adds r0, r4, 0 - bl FieldObjectTurn - movs r0, 0x1 - bl SetPlayerAvatarStateMask - pop {r4} - pop {r0} - bx r0 - thumb_func_end PlayerAvatarTransition_Normal - - thumb_func_start PlayerAvatarTransition_MachBike -@ void PlayerAvatarTransition_MachBike(struct npc_state *fieldObject) -PlayerAvatarTransition_MachBike: @ 808B46C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x1 - bl GetPlayerAvatarGraphicsIdByStateId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetGraphicsId - ldrb r1, [r4, 0x18] - lsrs r1, 4 - adds r0, r4, 0 - bl FieldObjectTurn - movs r0, 0x2 - bl SetPlayerAvatarStateMask - movs r0, 0 - movs r1, 0 - bl sub_811A0D0 - pop {r4} - pop {r0} - bx r0 - thumb_func_end PlayerAvatarTransition_MachBike - - thumb_func_start PlayerAvatarTransition_AcroBike -@ void PlayerAvatarTransition_AcroBike(struct npc_state *fieldObject) -PlayerAvatarTransition_AcroBike: @ 808B4A0 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x2 - bl GetPlayerAvatarGraphicsIdByStateId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetGraphicsId - ldrb r1, [r4, 0x18] - lsrs r1, 4 - adds r0, r4, 0 - bl FieldObjectTurn - movs r0, 0x4 - bl SetPlayerAvatarStateMask - movs r0, 0 - movs r1, 0 - bl sub_811A0D0 - bl sub_811A188 - pop {r4} - pop {r0} - bx r0 - thumb_func_end PlayerAvatarTransition_AcroBike - - thumb_func_start PlayerAvatarTransition_Surfing -@ void PlayerAvatarTransition_Surfing(struct npc_state *fieldObject) -PlayerAvatarTransition_Surfing: @ 808B4D8 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x3 - bl GetPlayerAvatarGraphicsIdByStateId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetGraphicsId - ldrb r1, [r4, 0x18] - lsrs r1, 4 - adds r0, r4, 0 - bl FieldObjectTurn - movs r0, 0x8 - bl SetPlayerAvatarStateMask - ldr r1, =0x02038c08 - movs r2, 0x10 - ldrsh r0, [r4, r2] - str r0, [r1] - movs r2, 0x12 - ldrsh r0, [r4, r2] - str r0, [r1, 0x4] - ldr r0, =0x02037590 - ldrb r0, [r0, 0x5] - str r0, [r1, 0x8] - movs r0, 0x8 - bl FieldEffectStart - lsls r0, 24 - lsrs r0, 24 - strb r0, [r4, 0x1A] - movs r1, 0x1 - bl sub_81555AC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end PlayerAvatarTransition_Surfing - - thumb_func_start PlayerAvatarTransition_Underwater -@ void PlayerAvatarTransition_Underwater(struct npc_state *fieldObject) -PlayerAvatarTransition_Underwater: @ 808B534 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x4 - bl GetPlayerAvatarGraphicsIdByStateId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetGraphicsId - ldrb r1, [r4, 0x18] - lsrs r1, 4 - adds r0, r4, 0 - bl FieldObjectTurn - movs r0, 0x10 - bl SetPlayerAvatarStateMask - ldrb r0, [r4, 0x4] - bl sub_8155800 - strb r0, [r4, 0x1A] - pop {r4} - pop {r0} - bx r0 - thumb_func_end PlayerAvatarTransition_Underwater - - thumb_func_start PlayerAvatarTransition_ReturnToField -@ void PlayerAvatarTransition_ReturnToField(struct npc_state *fieldObject) -PlayerAvatarTransition_ReturnToField: @ 808B568 - ldr r2, =0x02037590 - ldrb r1, [r2] - movs r0, 0x20 - orrs r0, r1 - strb r0, [r2] - bx lr - .pool - thumb_func_end PlayerAvatarTransition_ReturnToField - - thumb_func_start sub_808B578 -sub_808B578: @ 808B578 - push {r4,lr} - ldr r4, =0x02037590 - movs r0, 0 - strb r0, [r4, 0x3] - bl PlayerIsAnimActive - lsls r0, 24 - cmp r0, 0 - beq _0808B5B6 - bl PlayerCheckIfAnimFinishedOrInactive - lsls r0, 24 - cmp r0, 0 - bne _0808B5A8 - bl player_is_anim_in_certain_ranges - lsls r0, 24 - cmp r0, 0 - bne _0808B5B6 - movs r0, 0x1 - b _0808B5B4 - .pool -_0808B5A8: - bl sub_808B618 - lsls r0, 24 - cmp r0, 0 - bne _0808B5B6 - movs r0, 0x2 -_0808B5B4: - strb r0, [r4, 0x3] -_0808B5B6: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_808B578 - - thumb_func_start player_is_anim_in_certain_ranges -player_is_anim_in_certain_ranges: @ 808B5BC - push {lr} - ldr r2, =0x02037350 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x1C] - cmp r1, 0x3 - bls _0808B602 - adds r0, r1, 0 - subs r0, 0x10 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bls _0808B602 - adds r0, r1, 0 - subs r0, 0x19 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xF - bls _0808B602 - adds r0, r1, 0 - subs r0, 0x64 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB - bls _0808B602 - adds r0, r1, 0 - subs r0, 0x7C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bhi _0808B610 -_0808B602: - movs r0, 0x1 - b _0808B612 - .pool -_0808B610: - movs r0, 0 -_0808B612: - pop {r1} - bx r1 - thumb_func_end player_is_anim_in_certain_ranges - - thumb_func_start sub_808B618 -sub_808B618: @ 808B618 - push {lr} - bl player_is_anim_in_certain_ranges - lsls r0, 24 - cmp r0, 0 - beq _0808B634 - ldr r0, =0x02037590 - ldrb r0, [r0, 0x2] - cmp r0, 0x1 - beq _0808B634 - movs r0, 0x1 - b _0808B636 - .pool -_0808B634: - movs r0, 0 -_0808B636: - pop {r1} - bx r1 - thumb_func_end sub_808B618 - - thumb_func_start PlayerIsAnimActive -@ bool8 PlayerIsAnimActive() -PlayerIsAnimActive: @ 808B63C - push {lr} - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end PlayerIsAnimActive - - thumb_func_start PlayerCheckIfAnimFinishedOrInactive -@ bool8 PlayerCheckIfAnimFinishedOrInactive() -PlayerCheckIfAnimFinishedOrInactive: @ 808B660 - push {lr} - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - bl FieldObjectCheckIfSpecialAnimFinishedOrInactive - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end PlayerCheckIfAnimFinishedOrInactive - - thumb_func_start player_set_x22 -player_set_x22: @ 808B684 - ldr r3, =0x02037350 - ldr r1, =0x02037590 - ldrb r2, [r1, 0x5] - lsls r1, r2, 3 - adds r1, r2 - lsls r1, 2 - adds r1, r3 - adds r1, 0x22 - strb r0, [r1] - bx lr - .pool - thumb_func_end player_set_x22 - - thumb_func_start player_get_x22 -player_get_x22: @ 808B6A0 - ldr r2, =0x02037350 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x22 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end player_get_x22 - - thumb_func_start sub_808B6BC -sub_808B6BC: @ 808B6BC - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =0x02037590 - ldrb r2, [r0, 0x5] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - bl FieldObjectForceSetSpecialAnim - pop {r0} - bx r0 - .pool - thumb_func_end sub_808B6BC - - thumb_func_start player_npc_set_state_and_x22_etc -@ void player_npc_set_state_and_x22_etc(u8 animState, u8 a2) -player_npc_set_state_and_x22_etc: @ 808B6E4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - bl PlayerIsAnimActive - lsls r0, 24 - cmp r0, 0 - bne _0808B712 - adds r0, r4, 0 - bl player_set_x22 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - adds r1, r5, 0 - bl FieldObjectSetSpecialAnim -_0808B712: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end player_npc_set_state_and_x22_etc - - thumb_func_start PlayerGoSpeed0 -@ void PlayerGoSpeed0(u8 direction) -PlayerGoSpeed0: @ 808B720 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl GetGoSpeed0AnimId - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl player_npc_set_state_and_x22_etc - pop {r0} - bx r0 - thumb_func_end PlayerGoSpeed0 - - thumb_func_start PlayerGoSpeed1 -@ void PlayerGoSpeed1(u8 direction) -PlayerGoSpeed1: @ 808B738 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl GetGoSpeed1AnimId - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl player_npc_set_state_and_x22_etc - pop {r0} - bx r0 - thumb_func_end PlayerGoSpeed1 - - thumb_func_start PlayerGoSpeed2 -@ void PlayerGoSpeed2(u8 direction) -PlayerGoSpeed2: @ 808B750 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl GetGoSpeed2AnimId - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl player_npc_set_state_and_x22_etc - pop {r0} - bx r0 - thumb_func_end PlayerGoSpeed2 - - thumb_func_start PlayerGoSpeed3 -@ void PlayerGoSpeed3(u8 direction) -PlayerGoSpeed3: @ 808B768 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl GetGoSpeed3AnimId - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl player_npc_set_state_and_x22_etc - pop {r0} - bx r0 - thumb_func_end PlayerGoSpeed3 - - thumb_func_start PlayerRun -@ void PlayerRun(u8 direction) -PlayerRun: @ 808B780 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl GetRunAnimId - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl player_npc_set_state_and_x22_etc - pop {r0} - bx r0 - thumb_func_end PlayerRun - - thumb_func_start PlayerOnBikeCollide -@ void PlayerOnBikeCollide(u8 direction) -PlayerOnBikeCollide: @ 808B798 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl PlayCollisionSoundIfNotFacingWarp - adds r0, r4, 0 - bl GetStepInPlaceDelay16AnimId - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl player_npc_set_state_and_x22_etc - pop {r4} - pop {r0} - bx r0 - thumb_func_end PlayerOnBikeCollide - - thumb_func_start PlayerOnBikeCollideWithFarawayIslandMew -@ void PlayerOnBikeCollideWithFarawayIslandMew(u8 direction) -PlayerOnBikeCollideWithFarawayIslandMew: @ 808B7BC - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl GetStepInPlaceDelay16AnimId - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl player_npc_set_state_and_x22_etc - pop {r0} - bx r0 - thumb_func_end PlayerOnBikeCollideWithFarawayIslandMew - - thumb_func_start PlayerNotOnBikeCollide -@ void PlayerNotOnBikeCollide(u8 direction) -PlayerNotOnBikeCollide: @ 808B7D4 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl PlayCollisionSoundIfNotFacingWarp - adds r0, r4, 0 - bl GetStepInPlaceDelay32AnimId - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl player_npc_set_state_and_x22_etc - pop {r4} - pop {r0} - bx r0 - thumb_func_end PlayerNotOnBikeCollide - - thumb_func_start PlayerNotOnBikeCollideWithFarawayIslandMew -@ void PlayerNotOnBikeCollideWithFarawayIslandMew(u8 direction) -PlayerNotOnBikeCollideWithFarawayIslandMew: @ 808B7F8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl GetStepInPlaceDelay32AnimId - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl player_npc_set_state_and_x22_etc - pop {r0} - bx r0 - thumb_func_end PlayerNotOnBikeCollideWithFarawayIslandMew - - thumb_func_start PlayerFaceDirection -@ void PlayerFaceDirection(u8 direction) -PlayerFaceDirection: @ 808B810 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl GetFaceDirectionAnimId - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl player_npc_set_state_and_x22_etc - pop {r0} - bx r0 - thumb_func_end PlayerFaceDirection - - thumb_func_start PlayerTurnInPlace -@ void PlayerTurnInPlace(u8 direction) -PlayerTurnInPlace: @ 808B828 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl GetStepInPlaceDelay8AnimId - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl player_npc_set_state_and_x22_etc - pop {r0} - bx r0 - thumb_func_end PlayerTurnInPlace - - thumb_func_start PlayerJumpLedge -@ void PlayerJumpLedge(u8 direction) -PlayerJumpLedge: @ 808B840 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0xA - bl audio_play - adds r0, r4, 0 - bl GetJumpLedgeAnimId - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x8 - bl player_npc_set_state_and_x22_etc - pop {r4} - pop {r0} - bx r0 - thumb_func_end PlayerJumpLedge - - thumb_func_start sub_808B864 -sub_808B864: @ 808B864 - push {r4,lr} - ldr r4, =0x02037590 - ldrb r0, [r4, 0x3] - cmp r0, 0x2 - beq _0808B872 - cmp r0, 0 - bne _0808B89A -_0808B872: - bl player_should_look_direction_be_enforced_upon_movement - lsls r0, 24 - cmp r0, 0 - beq _0808B89A - ldr r2, =0x02037350 - ldrb r1, [r4, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - lsls r0, 24 - lsrs r0, 24 - bl sub_808B6BC -_0808B89A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808B864 - - thumb_func_start sub_808B8A8 -sub_808B8A8: @ 808B8A8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl sub_8093648 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl player_npc_set_state_and_x22_etc - pop {r0} - bx r0 - thumb_func_end sub_808B8A8 - - thumb_func_start sub_808B8C0 -sub_808B8C0: @ 808B8C0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl sub_8093674 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl player_npc_set_state_and_x22_etc - pop {r0} - bx r0 - thumb_func_end sub_808B8C0 - - thumb_func_start sub_808B8D8 -sub_808B8D8: @ 808B8D8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl sub_80936A0 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl player_npc_set_state_and_x22_etc - pop {r0} - bx r0 - thumb_func_end sub_808B8D8 - - thumb_func_start sub_808B8F0 -sub_808B8F0: @ 808B8F0 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x22 - bl audio_play - adds r0, r4, 0 - bl sub_80936CC - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl player_npc_set_state_and_x22_etc - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_808B8F0 - - thumb_func_start sub_808B914 -sub_808B914: @ 808B914 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x22 - bl audio_play - adds r0, r4, 0 - bl sub_80936F8 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl player_npc_set_state_and_x22_etc - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_808B914 - - thumb_func_start sub_808B938 -sub_808B938: @ 808B938 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x22 - bl audio_play - adds r0, r4, 0 - bl sub_8093724 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x8 - bl player_npc_set_state_and_x22_etc - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_808B938 - - thumb_func_start sub_808B95C -sub_808B95C: @ 808B95C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x22 - bl audio_play - adds r0, r4, 0 - bl sub_80934E8 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl player_npc_set_state_and_x22_etc - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_808B95C - - thumb_func_start sub_808B980 -sub_808B980: @ 808B980 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x7 - bl audio_play - adds r0, r4, 0 - bl sub_8093750 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl player_npc_set_state_and_x22_etc - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_808B980 - - thumb_func_start sub_808B9A4 -sub_808B9A4: @ 808B9A4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl sub_809377C - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl player_npc_set_state_and_x22_etc - pop {r0} - bx r0 - thumb_func_end sub_808B9A4 - - thumb_func_start sub_808B9BC -sub_808B9BC: @ 808B9BC - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl sub_80937A8 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl player_npc_set_state_and_x22_etc - pop {r0} - bx r0 - thumb_func_end sub_808B9BC - - thumb_func_start npc_use_some_d2s -npc_use_some_d2s: @ 808B9D4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl d2s_08064034 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl player_npc_set_state_and_x22_etc - pop {r0} - bx r0 - thumb_func_end npc_use_some_d2s - - thumb_func_start PlayCollisionSoundIfNotFacingWarp -@ void PlayCollisionSoundIfNotFacingWarp(u8 direction) -PlayCollisionSoundIfNotFacingWarp: @ 808B9EC - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r2, =0x02037350 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1E] - ldr r2, =gUnknown_084974D8 - subs r1, r4, 0x1 - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl _call_via_r1 - lsls r0, 24 - cmp r0, 0 - bne _0808BA54 - cmp r4, 0x2 - bne _0808BA4E - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - movs r0, 0x2 - mov r1, sp - adds r2, r4, 0 - bl MoveCoords - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl is_tile_x69_2_warp_door - lsls r0, 24 - cmp r0, 0 - bne _0808BA54 -_0808BA4E: - movs r0, 0x7 - bl audio_play -_0808BA54: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end PlayCollisionSoundIfNotFacingWarp - - thumb_func_start GetXYCoordsOneStepInFrontOfPlayer -GetXYCoordsOneStepInFrontOfPlayer: @ 808BA68 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldr r3, =0x02037350 - ldr r2, =0x02037590 - ldrb r1, [r2, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r0, [r0, 0x10] - strh r0, [r4] - ldrb r1, [r2, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r0, [r0, 0x12] - strh r0, [r5] - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - adds r2, r5, 0 - bl MoveCoords - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end GetXYCoordsOneStepInFrontOfPlayer - - thumb_func_start PlayerGetDestCoords -@ void PlayerGetDestCoords(u16 *x, u16 *y) -PlayerGetDestCoords: @ 808BAAC - push {r4,r5,lr} - ldr r5, =0x02037350 - ldr r4, =0x02037590 - ldrb r3, [r4, 0x5] - lsls r2, r3, 3 - adds r2, r3 - lsls r2, 2 - adds r2, r5 - ldrh r2, [r2, 0x10] - strh r2, [r0] - ldrb r2, [r4, 0x5] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - adds r0, r5 - ldrh r0, [r0, 0x12] - strh r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end PlayerGetDestCoords - - thumb_func_start plaer_get_pos_including_state_based_drift -plaer_get_pos_including_state_based_drift: @ 808BADC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r3, r0, r1 - ldrb r1, [r3] - movs r0, 0xC0 - ands r0, r1 - cmp r0, 0x40 - beq _0808BAFC - b _0808BC24 -_0808BAFC: - ldr r2, =0x02020630 - ldrb r1, [r3, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x32 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _0808BB12 - b _0808BC24 -_0808BB12: - ldrh r0, [r3, 0x10] - strh r0, [r4] - ldrh r0, [r3, 0x12] - strh r0, [r5] - ldrb r0, [r3, 0x1C] - subs r0, 0x8 - cmp r0, 0x30 - bls _0808BB24 - b _0808BC24 -_0808BB24: - lsls r0, 2 - ldr r1, =_0808BB40 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0808BB40: - .4byte _0808BC04 - .4byte _0808BC0A - .4byte _0808BC14 - .4byte _0808BC1A - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC04 - .4byte _0808BC0A - .4byte _0808BC14 - .4byte _0808BC1A -_0808BC04: - ldrh r0, [r5] - adds r0, 0x1 - b _0808BC0E -_0808BC0A: - ldrh r0, [r5] - subs r0, 0x1 -_0808BC0E: - strh r0, [r5] - movs r0, 0x1 - b _0808BC30 -_0808BC14: - ldrh r0, [r4] - subs r0, 0x1 - b _0808BC1E -_0808BC1A: - ldrh r0, [r4] - adds r0, 0x1 -_0808BC1E: - strh r0, [r4] - movs r0, 0x1 - b _0808BC30 -_0808BC24: - movs r1, 0x1 - negs r1, r1 - adds r0, r1, 0 - strh r0, [r4] - strh r0, [r5] - movs r0, 0 -_0808BC30: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end plaer_get_pos_including_state_based_drift - - thumb_func_start player_get_direction_lower_nybble -@ u8 player_get_direction_lower_nybble() -player_get_direction_lower_nybble: @ 808BC38 - ldr r2, =0x02037350 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x18] - lsls r0, 28 - lsrs r0, 28 - bx lr - .pool - thumb_func_end player_get_direction_lower_nybble - - thumb_func_start player_get_direction_upper_nybble -@ u8 player_get_direction_upper_nybble() -player_get_direction_upper_nybble: @ 808BC58 - ldr r2, =0x02037350 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x18] - lsrs r0, 4 - bx lr - .pool - thumb_func_end player_get_direction_upper_nybble - - thumb_func_start PlayerGetZCoord -@ u8 PlayerGetZCoord() -PlayerGetZCoord: @ 808BC74 - ldr r2, =0x02037350 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0xB] - lsrs r0, 4 - bx lr - .pool - thumb_func_end PlayerGetZCoord - - thumb_func_start sub_808BC90 -sub_808BC90: @ 808BC90 - push {lr} - adds r3, r0, 0 - adds r2, r1, 0 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - lsls r3, 16 - asrs r3, 16 - lsls r2, 16 - asrs r2, 16 - adds r1, r3, 0 - bl sub_808EB08 - pop {r0} - bx r0 - .pool - thumb_func_end sub_808BC90 - - thumb_func_start TestPlayerAvatarFlags -@ u32 TestPlayerAvatarFlags(u32 mask) -TestPlayerAvatarFlags: @ 808BCC0 - ldr r1, =0x02037590 - ldrb r1, [r1] - ands r1, r0 - adds r0, r1, 0 - bx lr - .pool - thumb_func_end TestPlayerAvatarFlags - - thumb_func_start sub_808BCD0 -sub_808BCD0: @ 808BCD0 - ldr r0, =0x02037590 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_808BCD0 - - thumb_func_start GetPlayerAvatarObjectId -@ u8 GetPlayerAvatarObjectId() -GetPlayerAvatarObjectId: @ 808BCDC - ldr r0, =0x02037590 - ldrb r0, [r0, 0x4] - bx lr - .pool - thumb_func_end GetPlayerAvatarObjectId - - thumb_func_start sub_808BCE8 -sub_808BCE8: @ 808BCE8 - push {lr} - bl ForcedMovement_None - pop {r0} - bx r0 - thumb_func_end sub_808BCE8 - - thumb_func_start sub_808BCF4 -sub_808BCF4: @ 808BCF4 - push {r4,lr} - ldr r0, =0x02037590 - ldrb r0, [r0, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02037350 - adds r4, r0 - adds r0, r4, 0 - bl npc_clear_strange_bits - ldrb r1, [r4, 0x18] - lsls r1, 28 - lsrs r1, 28 - adds r0, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x6 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _0808BD2C - bl sub_811A188 - movs r0, 0 - bl sub_811A114 -_0808BD2C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808BCF4 - - thumb_func_start sub_808BD3C -sub_808BD3C: @ 808BD3C - lsls r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_084974E8 - lsrs r0, 23 - adds r1, r0 - adds r1, r2 - ldrb r0, [r1] - bx lr - .pool - thumb_func_end sub_808BD3C - - thumb_func_start GetPlayerAvatarGraphicsIdByStateIdAndGender -@ u8 GetPlayerAvatarGraphicsIdByStateIdAndGender(u8 stateId, u8 gender) -GetPlayerAvatarGraphicsIdByStateIdAndGender: @ 808BD54 - lsls r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_084974F8 - lsrs r0, 23 - adds r1, r0 - adds r1, r2 - ldrb r0, [r1] - bx lr - .pool - thumb_func_end GetPlayerAvatarGraphicsIdByStateIdAndGender - - thumb_func_start sub_808BD6C -sub_808BD6C: @ 808BD6C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_08497508 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_808BD6C - - thumb_func_start sub_808BD7C -sub_808BD7C: @ 808BD7C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0849750A - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_808BD7C - - thumb_func_start GetPlayerAvatarGraphicsIdByStateId -@ u8 GetPlayerAvatarGraphicsIdByStateId(u8 stateId) -GetPlayerAvatarGraphicsIdByStateId: @ 808BD8C - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02037590 - ldrb r1, [r1, 0x7] - bl GetPlayerAvatarGraphicsIdByStateIdAndGender - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end GetPlayerAvatarGraphicsIdByStateId - - thumb_func_start sub_808BDA8 -sub_808BDA8: @ 808BDA8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, 0x70 - beq _0808BDCA - cmp r0, 0x70 - bgt _0808BDC2 - cmp r0, 0x6D - bgt _0808BDCE - cmp r0, 0x69 - blt _0808BDCE - b _0808BDCA -_0808BDC2: - cmp r1, 0x8A - beq _0808BDCA - cmp r1, 0xC0 - bne _0808BDCE -_0808BDCA: - movs r0, 0x1 - b _0808BDD0 -_0808BDCE: - movs r0, 0 -_0808BDD0: - pop {r1} - bx r1 - thumb_func_end sub_808BDA8 - - thumb_func_start GetPlayerAvatarGenderByGraphicsId -@ u8 GetPlayerAvatarGenderByGraphicsId(u8 graphicsId) -GetPlayerAvatarGenderByGraphicsId: @ 808BDD4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, 0x70 - beq _0808BDF6 - cmp r0, 0x70 - bgt _0808BDEE - cmp r0, 0x5D - bgt _0808BDFA - cmp r0, 0x59 - blt _0808BDFA - b _0808BDF6 -_0808BDEE: - cmp r1, 0x8A - beq _0808BDF6 - cmp r1, 0xC0 - bne _0808BDFA -_0808BDF6: - movs r0, 0x1 - b _0808BDFC -_0808BDFA: - movs r0, 0 -_0808BDFC: - pop {r1} - bx r1 - thumb_func_end GetPlayerAvatarGenderByGraphicsId - - thumb_func_start PartyHasMonWithSurf -@ bool8 PartyHasMonWithSurf() -PartyHasMonWithSurf: @ 808BE00 - push {r4,r5,lr} - movs r0, 0x8 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - bne _0808BE44 - movs r5, 0 - b _0808BE2A -_0808BE12: - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_has_move - lsls r0, 24 - cmp r0, 0 - beq _0808BE24 - movs r0, 0x1 - b _0808BE46 -_0808BE24: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_0808BE2A: - cmp r5, 0x5 - bhi _0808BE44 - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - bne _0808BE12 -_0808BE44: - movs r0, 0 -_0808BE46: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end PartyHasMonWithSurf - - thumb_func_start IsPlayerSurfingNorth -@ bool8 IsPlayerSurfingNorth() -IsPlayerSurfingNorth: @ 808BE50 - push {lr} - bl player_get_direction_upper_nybble - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _0808BE6E - movs r0, 0x8 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _0808BE6E - movs r0, 0x1 - b _0808BE70 -_0808BE6E: - movs r0, 0 -_0808BE70: - pop {r1} - bx r1 - thumb_func_end IsPlayerSurfingNorth - - thumb_func_start IsPlayerFacingSurfableFishableWater -@ bool8 IsPlayerFacingSurfableFishableWater() -IsPlayerFacingSurfableFishableWater: @ 808BE74 - push {r4,r5,lr} - sub sp, 0x4 - ldr r0, =0x02037590 - ldrb r0, [r0, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02037350 - adds r4, r0 - ldrh r1, [r4, 0x10] - mov r0, sp - strh r1, [r0] - ldrh r0, [r4, 0x12] - mov r5, sp - adds r5, 0x2 - strh r0, [r5] - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - mov r1, sp - adds r2, r5, 0 - bl MoveCoords - mov r0, sp - movs r2, 0 - ldrsh r1, [r0, r2] - movs r0, 0 - ldrsh r2, [r5, r0] - ldrb r3, [r4, 0x18] - lsls r3, 28 - lsrs r3, 28 - adds r0, r4, 0 - bl npc_block_way - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _0808BEF4 - bl PlayerGetZCoord - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _0808BEF4 - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r5, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl MetatileBehavior_IsSurfableFishableWater - lsls r0, 24 - cmp r0, 0 - beq _0808BEF4 - movs r0, 0x1 - b _0808BEF6 - .pool -_0808BEF4: - movs r0, 0 -_0808BEF6: - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end IsPlayerFacingSurfableFishableWater - - thumb_func_start ClearPlayerAvatarInfo -@ void ClearPlayerAvatarInfo() -ClearPlayerAvatarInfo: @ 808BF00 - push {lr} - ldr r0, =0x02037590 - movs r1, 0 - movs r2, 0x24 - bl memset - pop {r0} - bx r0 - .pool - thumb_func_end ClearPlayerAvatarInfo - - thumb_func_start SetPlayerAvatarStateMask -@ void SetPlayerAvatarStateMask(u8 stateMask) -SetPlayerAvatarStateMask: @ 808BF14 - lsls r0, 24 - lsrs r0, 24 - ldr r3, =0x02037590 - ldrb r2, [r3] - movs r1, 0xE0 - ands r1, r2 - orrs r0, r1 - strb r0, [r3] - bx lr - .pool - thumb_func_end SetPlayerAvatarStateMask - - thumb_func_start GetPlayerAvatarStateTransitionByGraphicsId -@ u8 GetPlayerAvatarStateTransitionByGraphicsId(u8 graphicsId, u8 gender) -GetPlayerAvatarStateTransitionByGraphicsId: @ 808BF2C - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r1, 24 - movs r2, 0 - ldr r3, =gUnknown_0849750C - lsls r0, r1, 2 - adds r0, r1 - lsls r4, r0, 1 - adds r6, r3, 0x1 -_0808BF42: - lsls r0, r2, 1 - adds r1, r0, r4 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r5 - bne _0808BF58 - adds r0, r1, r6 - ldrb r0, [r0] - b _0808BF64 - .pool -_0808BF58: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x4 - bls _0808BF42 - movs r0, 0x1 -_0808BF64: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end GetPlayerAvatarStateTransitionByGraphicsId - - thumb_func_start GetPlayerAvatarGraphicsIdByCurrentState -@ u8 GetPlayerAvatarGraphicsIdByCurrentState() -GetPlayerAvatarGraphicsIdByCurrentState: @ 808BF6C - push {r4-r6,lr} - ldr r0, =0x02037590 - ldrb r5, [r0] - movs r2, 0 - ldr r3, =gUnknown_0849750C - ldrb r1, [r0, 0x7] - lsls r0, r1, 2 - adds r0, r1 - lsls r4, r0, 1 - adds r6, r3, 0x1 -_0808BF80: - lsls r0, r2, 1 - adds r1, r0, r4 - adds r0, r1, r6 - ldrb r0, [r0] - ands r0, r5 - cmp r0, 0 - beq _0808BF9C - adds r0, r1, r3 - ldrb r0, [r0] - b _0808BFA8 - .pool -_0808BF9C: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x4 - bls _0808BF80 - movs r0, 0 -_0808BFA8: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end GetPlayerAvatarGraphicsIdByCurrentState - - thumb_func_start SetPlayerAvatarExtraStateTransition -@ void SetPlayerAvatarExtraStateTransition(u8 graphicsId, u8 state) -SetPlayerAvatarExtraStateTransition: @ 808BFB0 - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =0x02037590 - ldrb r1, [r5, 0x7] - bl GetPlayerAvatarStateTransitionByGraphicsId - lsls r0, 24 - lsrs r0, 24 - orrs r0, r4 - ldrb r1, [r5, 0x1] - orrs r0, r1 - strb r0, [r5, 0x1] - bl DoPlayerAvatarTransition - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end SetPlayerAvatarExtraStateTransition - - thumb_func_start InitPlayerAvatar -@ void InitPlayerAvatar(u16 x, u16 y, u8 direction, u8 gender) -InitPlayerAvatar: @ 808BFE0 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x18 - adds r4, r0, 0 - adds r5, r1, 0 - mov r9, r2 - mov r8, r3 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - mov r0, r9 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - mov r1, sp - movs r0, 0xFF - strb r0, [r1] - movs r0, 0 - mov r1, r8 - bl GetPlayerAvatarGraphicsIdByStateIdAndGender - mov r1, sp - movs r3, 0 - strb r0, [r1, 0x1] - mov r0, sp - lsls r4, 16 - asrs r4, 16 - subs r4, 0x7 - movs r6, 0 - strh r4, [r0, 0x4] - lsls r5, 16 - asrs r5, 16 - subs r5, 0x7 - strh r5, [r0, 0x6] - strb r6, [r0, 0x8] - movs r0, 0xB - strb r0, [r1, 0x9] - mov r2, sp - ldrb r1, [r2, 0xA] - subs r0, 0x1B - ands r0, r1 - strb r0, [r2, 0xA] - mov r0, sp - strb r6, [r0, 0xA] - strh r3, [r0, 0xC] - strh r3, [r0, 0xE] - str r3, [sp, 0x10] - strh r3, [r0, 0x14] - bl SpawnSpecialFieldObject - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 3 - adds r4, r5 - lsls r4, 2 - ldr r0, =0x02037350 - adds r4, r0 - ldrb r0, [r4, 0x2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r4, 0x2] - bl sub_8154228 - strb r0, [r4, 0x1B] - adds r0, r4, 0 - mov r1, r9 - bl FieldObjectTurn - bl ClearPlayerAvatarInfo - ldr r0, =0x02037590 - strb r6, [r0, 0x2] - strb r6, [r0, 0x3] - strb r5, [r0, 0x5] - ldrb r1, [r4, 0x4] - strb r1, [r0, 0x4] - mov r1, r8 - strb r1, [r0, 0x7] - movs r0, 0x21 - bl SetPlayerAvatarStateMask - add sp, 0x18 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end InitPlayerAvatar - - thumb_func_start sub_808C0A8 -sub_808C0A8: @ 808C0A8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r6, =0x02037350 - ldr r5, =0x02037590 - ldrb r0, [r5, 0x5] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - movs r0, 0x1 - ands r4, r0 - lsls r3, r4, 5 - ldrb r2, [r1, 0x1] - movs r0, 0x21 - negs r0, r0 - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x1] - movs r0, 0x8 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _0808C100 - ldr r2, =0x02020630 - ldrb r1, [r5, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x1A] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x3E - lsls r3, r4, 2 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r3 - strb r0, [r1] -_0808C100: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808C0A8 - - thumb_func_start sub_808C114 -sub_808C114: @ 808C114 - push {r4,r5,lr} - ldr r5, =0x02037590 - ldrb r0, [r5, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02037350 - adds r4, r0 - movs r0, 0x5 - bl GetPlayerAvatarGraphicsIdByStateId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetGraphicsId - ldrb r1, [r5, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r1, 0 - bl StartObjectImageAnim - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808C114 - - thumb_func_start sub_808C15C -sub_808C15C: @ 808C15C - push {r4-r6,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r6, =0x02037590 - ldrb r0, [r6, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02037350 - adds r4, r0 - movs r0, 0x6 - bl GetPlayerAvatarGraphicsIdByStateId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetGraphicsId - ldrb r0, [r6, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - adds r0, r5, 0 - bl sub_8092A0C - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808C15C - - thumb_func_start sub_808C1B4 -sub_808C1B4: @ 808C1B4 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r6, =0x02037590 - ldrb r0, [r6, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02037350 - adds r4, r0 - movs r0, 0x2 - bl GetPlayerAvatarGraphicsIdByStateId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetGraphicsId - ldrb r0, [r6, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - mov r8, r0 - add r4, r8 - adds r0, r5, 0 - bl sub_80929BC - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - ldrb r1, [r6, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - movs r1, 0x1 - bl SeekObjectImageAnim - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808C1B4 - - thumb_func_start sub_808C228 -sub_808C228: @ 808C228 - push {r4-r6,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r6, =0x02037590 - ldrb r0, [r6, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02037350 - adds r4, r0 - movs r0, 0x7 - bl GetPlayerAvatarGraphicsIdByStateId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetGraphicsId - ldrb r0, [r6, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - adds r0, r5, 0 - bl FieldObjectDirectionToImageAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808C228 - - thumb_func_start sub_808C280 -sub_808C280: @ 808C280 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - adds r5, r0, 0 - ldrb r0, [r5, 0x1E] - mov r8, r0 - movs r1, 0 - mov r0, sp - strh r1, [r0] - movs r6, 0x1 - ldr r1, =gUnknown_08497520 - mov r9, r1 - mov r4, sp - mov r7, sp - adds r7, 0x2 -_0808C2A2: - movs r1, 0 - ldrsh r0, [r4, r1] - lsls r0, 2 - add r0, r9 - ldr r1, [r0] - mov r0, r8 - bl _call_via_r1 - lsls r0, 24 - cmp r0, 0 - beq _0808C2E8 - ldrb r0, [r5, 0x18] - lsrs r0, 4 - cmp r6, r0 - bne _0808C2E8 - ldrh r0, [r5, 0x10] - strh r0, [r4] - ldrh r0, [r5, 0x12] - strh r0, [r7] - adds r0, r6, 0 - mov r1, sp - adds r2, r7, 0 - bl MoveCoords - ldrb r0, [r5, 0x1B] - movs r1, 0 - ldrsh r2, [r4, r1] - movs r1, 0 - ldrsh r3, [r7, r1] - adds r1, r6, 0 - bl sub_8154298 - b _0808C302 - .pool -_0808C2E8: - ldrh r1, [r4] - adds r1, 0x1 - strh r1, [r4] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x3 - ble _0808C2A2 - ldrb r0, [r5, 0x1B] - bl objid_set_invisible -_0808C302: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_808C280 - - thumb_func_start task_add_bump_boulder -task_add_bump_boulder: @ 808C310 - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r6, =taskFF_bump_boulder - adds r0, r6, 0 - movs r1, 0xFF - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0xA] - strh r5, [r1, 0xC] - bl _call_via_r6 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end task_add_bump_boulder - - thumb_func_start taskFF_bump_boulder -taskFF_bump_boulder: @ 808C34C - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r6, =gUnknown_08497530 - ldr r2, =0x03005e00 - ldr r5, =0x02037350 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_0808C360: - movs r0, 0x8 - ldrsh r3, [r4, r0] - lsls r3, 2 - adds r3, r6 - ldr r0, =0x02037590 - ldrb r0, [r0, 0x5] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - movs r2, 0xA - ldrsh r0, [r4, r2] - lsls r2, r0, 3 - adds r2, r0 - lsls r2, 2 - adds r2, r5 - ldr r3, [r3] - adds r0, r4, 0 - bl _call_via_r3 - lsls r0, 24 - cmp r0, 0 - bne _0808C360 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end taskFF_bump_boulder - - thumb_func_start sub_808C3A4 -sub_808C3A4: @ 808C3A4 - push {r4,lr} - adds r4, r0, 0 - bl script_env_2_enable - ldr r1, =0x02037590 - movs r0, 0x1 - strb r0, [r1, 0x6] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_808C3A4 - - thumb_func_start do_boulder_dust -@ int do_boulder_dust(int a1, struct npc_state *a2, struct npc_state *a3) -do_boulder_dust: @ 808C3C4 - push {r4-r6,lr} - adds r6, r0, 0 - adds r5, r1, 0 - adds r4, r2, 0 - adds r0, r5, 0 - bl FieldObjectIsSpecialAnimActive - lsls r0, 24 - cmp r0, 0 - beq _0808C3DE - adds r0, r5, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished -_0808C3DE: - adds r0, r4, 0 - bl FieldObjectIsSpecialAnimActive - lsls r0, 24 - cmp r0, 0 - beq _0808C3F0 - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished -_0808C3F0: - adds r0, r5, 0 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - cmp r0, 0 - bne _0808C472 - adds r0, r4, 0 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - cmp r0, 0 - bne _0808C472 - adds r0, r5, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - ldrb r0, [r6, 0xC] - bl GetStepInPlaceDelay16AnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl FieldObjectSetSpecialAnim - ldrb r0, [r6, 0xC] - bl GetSimpleGoAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim - ldr r2, =0x02038c08 - movs r1, 0x10 - ldrsh r0, [r4, r1] - str r0, [r2] - movs r1, 0x12 - ldrsh r0, [r4, r1] - str r0, [r2, 0x4] - ldrb r0, [r4, 0xB] - lsrs r0, 4 - str r0, [r2, 0x8] - ldr r3, =0x02020630 - ldrb r1, [r4, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x5] - lsls r0, 28 - lsrs r0, 30 - str r0, [r2, 0xC] - movs r0, 0xA - bl FieldEffectStart - movs r0, 0xD6 - bl audio_play - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] -_0808C472: - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end do_boulder_dust - - thumb_func_start sub_808C484 -sub_808C484: @ 808C484 - push {r4,r5,lr} - adds r4, r1, 0 - adds r5, r2, 0 - adds r0, r4, 0 - bl FieldObjectCheckIfSpecialAnimFinishedOrInactive - lsls r0, 24 - cmp r0, 0 - beq _0808C4C6 - adds r0, r5, 0 - bl FieldObjectCheckIfSpecialAnimFinishedOrInactive - lsls r0, 24 - cmp r0, 0 - beq _0808C4C6 - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - adds r0, r5, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - ldr r1, =0x02037590 - movs r0, 0 - strb r0, [r1, 0x6] - bl script_env_2_disable - ldr r0, =taskFF_bump_boulder - bl get_task_id_by_function - lsls r0, 24 - lsrs r0, 24 - bl remove_task -_0808C4C6: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_808C484 - - thumb_func_start sub_808C4D8 -sub_808C4D8: @ 808C4D8 - push {r4,lr} - ldr r4, =sub_808C4F8 - adds r0, r4, 0 - movs r1, 0xFF - bl AddTask - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808C4D8 - - thumb_func_start sub_808C4F8 -sub_808C4F8: @ 808C4F8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_0849753C - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_0808C50A: - movs r0, 0x8 - ldrsh r2, [r4, r0] - lsls r2, 2 - adds r2, r5 - ldr r0, =0x02037590 - ldrb r0, [r0, 0x5] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02037350 - adds r1, r0 - ldr r2, [r2] - adds r0, r4, 0 - bl _call_via_r2 - lsls r0, 24 - cmp r0, 0 - bne _0808C50A - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808C4F8 - - thumb_func_start sub_808C544 -sub_808C544: @ 808C544 - push {r4-r6,lr} - adds r6, r0, 0 - adds r4, r1, 0 - ldr r5, =0x02037590 - movs r0, 0x1 - strb r0, [r5, 0x6] - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _0808C5A0 - movs r0, 0xA - bl audio_play - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl sub_80934BC - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim - ldrh r0, [r6, 0xA] - adds r0, 0x1 - strh r0, [r6, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0808C5A0 - movs r0, 0 - strb r0, [r5, 0x6] - ldrb r0, [r5, 0x1] - movs r1, 0x20 - orrs r0, r1 - strb r0, [r5, 0x1] - ldr r0, =sub_808C4F8 - bl get_task_id_by_function - lsls r0, 24 - lsrs r0, 24 - bl remove_task -_0808C5A0: - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_808C544 - - thumb_func_start sub_808C5B0 -sub_808C5B0: @ 808C5B0 - push {r4,lr} - ldr r4, =sub_808C5D0 - adds r0, r4, 0 - movs r1, 0xFF - bl AddTask - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808C5B0 - - thumb_func_start sub_808C5D0 -sub_808C5D0: @ 808C5D0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_08497540 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_0808C5E2: - movs r0, 0x8 - ldrsh r2, [r4, r0] - lsls r2, 2 - adds r2, r5 - ldr r0, =0x02037590 - ldrb r0, [r0, 0x5] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02037350 - adds r1, r0 - ldr r2, [r2] - adds r0, r4, 0 - bl _call_via_r2 - lsls r0, 24 - cmp r0, 0 - bne _0808C5E2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808C5D0 - - thumb_func_start sub_808C61C -sub_808C61C: @ 808C61C - push {lr} - ldrh r2, [r0, 0x8] - adds r2, 0x1 - strh r2, [r0, 0x8] - ldrb r1, [r1, 0x18] - lsrs r1, 4 - strh r1, [r0, 0xA] - ldr r1, =0x02037590 - movs r0, 0x1 - strb r0, [r1, 0x6] - bl script_env_2_enable - movs r0, 0x2D - bl audio_play - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_808C61C - - thumb_func_start sub_808C644 -sub_808C644: @ 808C644 - push {r4-r6,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_08497550 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r0, r5, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _0808C6AC - ldrb r0, [r5, 0x18] - lsrs r0, 4 - subs r0, 0x1 - add r0, sp - ldrb r6, [r0] - adds r0, r6, 0 - bl GetFaceDirectionAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl FieldObjectSetSpecialAnim - ldrb r0, [r4, 0xA] - cmp r6, r0 - bne _0808C68A - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] -_0808C68A: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r0, 0x3 - ble _0808C6AC - ldrb r0, [r4, 0xA] - bl GetOppositeDirection - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - bne _0808C6AC - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0808C6AC: - movs r0, 0 - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_808C644 - - thumb_func_start sub_808C6BC -sub_808C6BC: @ 808C6BC - push {r4,r5,lr} - sub sp, 0x8 - adds r5, r0, 0 - adds r4, r1, 0 - ldr r1, =gUnknown_08497554 - mov r0, sp - movs r2, 0x5 - bl memcpy - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _0808C6EC - movs r1, 0xC - ldrsh r0, [r5, r1] - add r0, sp - ldrb r1, [r0] - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim - movs r0, 0x1 - strh r0, [r5, 0x8] -_0808C6EC: - movs r0, 0 - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_808C6BC - - thumb_func_start sub_808C6FC -sub_808C6FC: @ 808C6FC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _0808C740 - ldrb r0, [r4, 0xA] - bl GetOppositeDirection - lsls r0, 24 - lsrs r0, 24 - bl GetSimpleGoAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl FieldObjectSetSpecialAnim - bl script_env_2_disable - ldr r1, =0x02037590 - movs r0, 0 - strb r0, [r1, 0x6] - ldr r0, =sub_808C5D0 - bl get_task_id_by_function - lsls r0, 24 - lsrs r0, 24 - bl remove_task -_0808C740: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_808C6FC - - thumb_func_start sub_808C750 -sub_808C750: @ 808C750 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl script_env_2_enable - bl sav1_reset_battle_music_maybe - bl sub_8085898 - ldr r2, =0x02037590 - ldrb r1, [r2] - movs r0, 0xF7 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x1 - strb r0, [r2, 0x6] - ldr r5, =taskFF_0805D1D4 - adds r0, r5, 0 - movs r1, 0xFF - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] - bl _call_via_r5 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808C750 - - thumb_func_start taskFF_0805D1D4 -taskFF_0805D1D4: @ 808C7A8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r5, r0, r1 - adds r0, r5, 0 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - cmp r0, 0 - beq _0808C7D4 - adds r0, r5, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _0808C7FC -_0808C7D4: - ldrb r0, [r5, 0x1A] - movs r1, 0x2 - bl sub_81555AC - ldr r0, =0x03005e00 - lsls r4, r6, 2 - adds r4, r6 - lsls r4, 3 - adds r4, r0 - ldrb r0, [r4, 0x8] - bl sub_8093540 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl FieldObjectSetSpecialAnim - ldr r0, =sub_808C814 - str r0, [r4] -_0808C7FC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end taskFF_0805D1D4 - - thumb_func_start sub_808C814 -sub_808C814: @ 808C814 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r6, =0x02037590 - ldrb r1, [r6, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _0808C87A - movs r0, 0 - bl GetPlayerAvatarGraphicsIdByStateId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetGraphicsId - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim - movs r0, 0 - strb r0, [r6, 0x6] - bl script_env_2_disable - ldrb r1, [r4, 0x1A] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - adds r0, r5, 0 - bl remove_task -_0808C87A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808C814 - - thumb_func_start StartFishing -StartFishing: @ 808C88C - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =Task_Fish - adds r0, r5, 0 - movs r1, 0xFF - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x26] - bl _call_via_r5 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end StartFishing - - thumb_func_start Task_Fish -Task_Fish: @ 808C8C0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_0849755C - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_0808C8D2: - movs r1, 0x8 - ldrsh r0, [r4, r1] - lsls r0, 2 - adds r0, r5 - ldr r1, [r0] - adds r0, r4, 0 - bl _call_via_r1 - lsls r0, 24 - cmp r0, 0 - bne _0808C8D2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end Task_Fish - - thumb_func_start fish0 -fish0: @ 808C8F8 - push {r4,lr} - adds r4, r0, 0 - bl script_env_2_enable - ldr r1, =0x02037590 - movs r0, 0x1 - strb r0, [r1, 0x6] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end fish0 - - thumb_func_start fish1 -fish1: @ 808C918 - push {r4-r6,lr} - sub sp, 0x10 - adds r5, r0, 0 - ldr r1, =gUnknown_0849759C - mov r0, sp - movs r2, 0x6 - bl memcpy - add r4, sp, 0x8 - ldr r1, =gUnknown_084975A2 - adds r0, r4, 0 - movs r2, 0x6 - bl memcpy - movs r0, 0 - strh r0, [r5, 0x20] - bl GenerateRandomNumber - movs r2, 0x26 - ldrsh r1, [r5, r2] - lsls r1, 1 - mov r2, sp - adds r6, r2, r1 - lsls r0, 16 - lsrs r0, 16 - adds r4, r1 - movs r2, 0 - ldrsh r1, [r4, r2] - bl __modsi3 - ldrh r1, [r6] - adds r1, r0 - strh r1, [r5, 0x22] - ldr r3, =0x02037350 - ldr r2, =0x02037590 - ldrb r1, [r2, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x5] - strh r0, [r5, 0x24] - ldrb r0, [r2, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - adds r4, r3 - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimActive - ldrb r0, [r4, 0x1] - movs r1, 0x8 - orrs r0, r1 - strb r0, [r4, 0x1] - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl sub_808C15C - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0 - add sp, 0x10 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end fish1 - - thumb_func_start fish2 -fish2: @ 808C9B0 - push {r4,lr} - adds r4, r0, 0 - bl sub_808CF78 - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3B - ble _0808C9CC - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0808C9CC: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end fish2 - - thumb_func_start fish3 -fish3: @ 808C9D4 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0 - movs r1, 0x1 - bl sub_819786C - ldrh r0, [r4, 0x8] - adds r0, 0x1 - movs r1, 0 - strh r0, [r4, 0x8] - strh r1, [r4, 0xA] - strh r1, [r4, 0xC] - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - adds r1, r0, 0 - adds r0, r1, 0x1 - strh r0, [r4, 0xE] - movs r2, 0x20 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _0808CA0C - adds r0, r1, 0x4 - strh r0, [r4, 0xE] -_0808CA0C: - movs r1, 0xE - ldrsh r0, [r4, r1] - cmp r0, 0x9 - ble _0808CA18 - movs r0, 0xA - strh r0, [r4, 0xE] -_0808CA18: - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - thumb_func_end fish3 - - thumb_func_start fish4 -fish4: @ 808CA20 - push {r4,r5,lr} - sub sp, 0x10 - adds r4, r0, 0 - ldr r1, =gUnknown_084975A8 - add r0, sp, 0xC - movs r2, 0x2 - bl memcpy - bl sub_808CF78 - ldrh r0, [r4, 0xA] - adds r1, r0, 0x1 - strh r1, [r4, 0xA] - ldr r0, =0x030022c0 - ldrh r0, [r0, 0x2E] - movs r5, 0x1 - adds r2, r5, 0 - ands r2, r0 - cmp r2, 0 - beq _0808CA64 - movs r0, 0xB - strh r0, [r4, 0x8] - movs r1, 0x20 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0808CA58 - movs r0, 0xC - strh r0, [r4, 0x8] -_0808CA58: - movs r0, 0x1 - b _0808CAB4 - .pool -_0808CA64: - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x13 - ble _0808CAB2 - strh r2, [r4, 0xA] - movs r3, 0xC - ldrsh r1, [r4, r3] - movs r3, 0xE - ldrsh r0, [r4, r3] - cmp r1, r0 - blt _0808CA94 - ldrh r0, [r4, 0x8] - adds r1, r0, 0x1 - strh r1, [r4, 0x8] - ldrh r2, [r4, 0x20] - movs r3, 0x20 - ldrsh r0, [r4, r3] - cmp r0, 0 - beq _0808CA8E - adds r0, r1, 0x1 - strh r0, [r4, 0x8] -_0808CA8E: - adds r0, r2, 0x1 - strh r0, [r4, 0x20] - b _0808CAB2 -_0808CA94: - movs r0, 0xC - ldrsh r3, [r4, r0] - lsls r3, 27 - lsrs r3, 24 - str r5, [sp] - str r2, [sp, 0x4] - str r2, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - add r2, sp, 0xC - bl Print - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] -_0808CAB2: - movs r0, 0 -_0808CAB4: - add sp, 0x10 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end fish4 - - thumb_func_start fish5 -fish5: @ 808CABC - push {r4-r6,lr} - adds r5, r0, 0 - bl sub_808CF78 - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r6, 0 - bl GetFishingWildMonListHeader - lsls r0, 24 - cmp r0, 0 - bne _0808CADC - movs r0, 0xB - strh r0, [r5, 0x8] - b _0808CB5C -_0808CADC: - ldr r4, =0x020244ec - adds r0, r4, 0 - movs r1, 0x6 - bl pokemon_getattr - cmp r0, 0 - bne _0808CB14 - adds r0, r4, 0 - bl GetMonAbility - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x15 - beq _0808CAFC - cmp r0, 0x3C - bne _0808CB14 -_0808CAFC: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xE - bls _0808CB14 - movs r6, 0x1 -_0808CB14: - cmp r6, 0 - bne _0808CB32 - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _0808CB30 - movs r0, 0xB - strh r0, [r5, 0x8] - b _0808CB32 - .pool -_0808CB30: - movs r6, 0x1 -_0808CB32: - cmp r6, 0x1 - bne _0808CB5C - ldr r0, =0x02037590 - ldrb r0, [r0, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - bl sub_8092A2C - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim -_0808CB5C: - movs r0, 0x1 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end fish5 - - thumb_func_start fish6 -fish6: @ 808CB6C - push {r4,r5,lr} - sub sp, 0xC - adds r5, r0, 0 - bl sub_808CF78 - ldr r2, =gUnknown_085EE8F7 - movs r0, 0x11 - str r0, [sp] - movs r4, 0 - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r3, 0 - bl Print - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - strh r4, [r5, 0xA] - movs r0, 0 - add sp, 0xC - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end fish6 - - thumb_func_start fish7 -fish7: @ 808CBA4 - push {r4,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldr r1, =gUnknown_084975AA - mov r0, sp - movs r2, 0x6 - bl memcpy - bl sub_808CF78 - ldrh r1, [r4, 0xA] - adds r1, 0x1 - strh r1, [r4, 0xA] - movs r2, 0x26 - ldrsh r0, [r4, r2] - lsls r0, 1 - add r0, sp - lsls r1, 16 - asrs r1, 16 - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r1, r0 - blt _0808CBDC - movs r0, 0xC - b _0808CBEC - .pool -_0808CBDC: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0808CBEE - ldrh r0, [r4, 0x8] - adds r0, 0x1 -_0808CBEC: - strh r0, [r4, 0x8] -_0808CBEE: - movs r0, 0 - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end fish7 - - thumb_func_start fish8 -fish8: @ 808CBFC - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - ldr r1, =gUnknown_084975B0 - mov r0, sp - movs r2, 0xC - bl memcpy - bl sub_808CF78 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0x20 - ldrsh r1, [r4, r0] - movs r2, 0x22 - ldrsh r0, [r4, r2] - cmp r1, r0 - blt _0808CC52 - cmp r1, 0x1 - bgt _0808CC56 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - movs r3, 0x20 - ldrsh r2, [r4, r3] - lsls r2, 1 - movs r3, 0x26 - ldrsh r1, [r4, r3] - lsls r1, 2 - adds r2, r1 - mov r3, sp - adds r1, r3, r2 - movs r2, 0 - ldrsh r1, [r1, r2] - lsls r0, 16 - asrs r0, 16 - cmp r1, r0 - ble _0808CC56 -_0808CC52: - movs r0, 0x3 - strh r0, [r4, 0x8] -_0808CC56: - movs r0, 0 - add sp, 0xC - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end fish8 - - thumb_func_start fish9 -fish9: @ 808CC64 - push {r4,r5,lr} - sub sp, 0x10 - adds r4, r0, 0 - bl sub_808CF78 - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r2, =gUnknown_085EE903 - movs r5, 0 - str r5, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - movs r3, 0x1 - bl AddTextPrinterParametrized - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - strh r5, [r4, 0xA] - movs r0, 0 - add sp, 0x10 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end fish9 - - thumb_func_start fishA_wait_for_a_pressed -fishA_wait_for_a_pressed: @ 808CCA8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - movs r1, 0xA - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0808CCBC - bl sub_808CF78 -_0808CCBC: - bl RunTextPrinters - movs r1, 0xA - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0808CD58 - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0 - bne _0808CD50 - ldr r7, =0x02037590 - ldrb r0, [r7, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02037350 - mov r8, r0 - add r4, r8 - ldrh r1, [r5, 0x24] - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetGraphicsId - ldrb r1, [r4, 0x18] - lsrs r1, 4 - adds r0, r4, 0 - bl FieldObjectTurn - ldrb r1, [r7] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0808CD1A - ldrb r0, [r7, 0x5] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - add r1, r8 - ldrb r0, [r1, 0x1A] - movs r1, 0 - movs r2, 0 - bl sub_8155604 -_0808CD1A: - ldr r2, =0x02020630 - ldrb r1, [r7, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r6, [r0, 0x24] - ldrb r1, [r7, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r6, [r0, 0x26] - movs r0, 0 - movs r1, 0x1 - bl sub_8197434 - ldrh r0, [r5, 0xA] - adds r0, 0x1 - strh r0, [r5, 0xA] - b _0808CD80 - .pool -_0808CD50: - movs r1, 0xA - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _0808CD80 -_0808CD58: - ldr r1, =0x02037590 - movs r0, 0 - strb r0, [r1, 0x6] - bl script_env_2_disable - ldrh r0, [r5, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl sub_80B5734 - movs r0, 0x1 - bl sub_80ED950 - ldr r0, =Task_Fish - bl get_task_id_by_function - lsls r0, 24 - lsrs r0, 24 - bl remove_task -_0808CD80: - movs r0, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end fishA_wait_for_a_pressed - - thumb_func_start fishB -fishB: @ 808CD94 - push {r4,r5,lr} - sub sp, 0x10 - adds r5, r0, 0 - bl sub_808CF78 - ldr r0, =0x02037590 - ldrb r0, [r0, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - bl sub_8092A1C - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r2, =gUnknown_085EE91E - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - movs r3, 0x1 - bl AddTextPrinterParametrized - movs r0, 0xD - strh r0, [r5, 0x8] - movs r0, 0x1 - add sp, 0x10 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end fishB - - thumb_func_start fishC -fishC: @ 808CE04 - push {r4,r5,lr} - sub sp, 0x10 - adds r5, r0, 0 - bl sub_808CF78 - ldr r0, =0x02037590 - ldrb r0, [r0, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - bl sub_8092A1C - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r2, =gUnknown_085EE933 - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - movs r3, 0x1 - bl AddTextPrinterParametrized - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0x1 - add sp, 0x10 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end fishC - - thumb_func_start fishD -fishD: @ 808CE74 - push {r4,lr} - adds r4, r0, 0 - bl sub_808CF78 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end fishD - - thumb_func_start fishE -fishE: @ 808CE8C - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - bl sub_808CF78 - ldr r7, =0x02020630 - ldr r5, =0x02037590 - ldrb r0, [r5, 0x4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r7 - adds r1, 0x3F - ldrb r0, [r1] - lsls r0, 27 - cmp r0, 0 - bge _0808CF12 - ldrb r0, [r5, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02037350 - mov r8, r0 - add r4, r8 - ldrh r1, [r6, 0x24] - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetGraphicsId - ldrb r1, [r4, 0x18] - lsrs r1, 4 - adds r0, r4, 0 - bl FieldObjectTurn - ldrb r1, [r5] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0808CEF2 - ldrb r0, [r5, 0x5] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - add r1, r8 - ldrb r0, [r1, 0x1A] - movs r1, 0 - movs r2, 0 - bl sub_8155604 -_0808CEF2: - ldrb r1, [r5, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - movs r2, 0 - strh r2, [r0, 0x24] - ldrb r1, [r5, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] -_0808CF12: - movs r0, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end fishE - - thumb_func_start fishF -fishF: @ 808CF2C - push {lr} - bl RunTextPrinters - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - bne _0808CF68 - ldr r0, =0x02037590 - strb r1, [r0, 0x6] - bl script_env_2_disable - bl sub_809757C - movs r0, 0 - movs r1, 0x1 - bl sub_8197434 - movs r0, 0 - bl sub_80ED950 - ldr r0, =Task_Fish - bl get_task_id_by_function - lsls r0, 24 - lsrs r0, 24 - bl remove_task -_0808CF68: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end fishF - - thumb_func_start sub_808CF78 -sub_808CF78: @ 808CF78 - push {r4-r7,lr} - ldr r0, =0x02037590 - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r4, r0, r1 - adds r0, r4, 0 - bl AnimateObject - movs r0, 0 - strh r0, [r4, 0x24] - strh r0, [r4, 0x26] - adds r0, r4, 0 - adds r0, 0x2B - ldrb r5, [r0] - movs r0, 0x2A - adds r0, r4 - mov r12, r0 - ldrb r0, [r0] - ldr r1, [r4, 0x8] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - lsls r6, r5, 2 - adds r0, r6, r0 - movs r1, 0 - ldrsh r0, [r0, r1] - movs r7, 0x1 - negs r7, r7 - cmp r0, r7 - beq _0808CFEA - adds r3, r4, 0 - adds r3, 0x2C - ldrb r2, [r3] - lsls r1, r2, 26 - lsrs r1, 26 - adds r1, 0x1 - movs r0, 0x3F - ands r1, r0 - movs r0, 0x40 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - mov r1, r12 - ldrb r0, [r1] - ldr r1, [r4, 0x8] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - adds r0, r6, r0 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, r7 - bne _0808CFF0 -_0808CFEA: - subs r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_0808CFF0: - adds r0, r4, 0 - adds r0, 0x2A - ldrb r0, [r0] - ldr r1, [r4, 0x8] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - lsls r0, r5, 2 - adds r0, r1 - ldrb r5, [r0] - subs r0, r5, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bhi _0808D022 - movs r0, 0x8 - strh r0, [r4, 0x24] - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _0808D022 - ldr r0, =0x0000fff8 - strh r0, [r4, 0x24] -_0808D022: - cmp r5, 0x5 - bne _0808D02A - ldr r0, =0x0000fff8 - strh r0, [r4, 0x26] -_0808D02A: - adds r0, r5, 0 - subs r0, 0xA - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _0808D03A - movs r0, 0x8 - strh r0, [r4, 0x26] -_0808D03A: - ldr r3, =0x02037590 - ldrb r1, [r3] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0808D05E - ldr r2, =0x02037350 - ldrb r1, [r3, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1A] - movs r1, 0x26 - ldrsh r2, [r4, r1] - movs r1, 0x1 - bl sub_8155604 -_0808D05E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808CF78 - - thumb_func_start sub_808D074 -sub_808D074: @ 808D074 - ldr r1, =0x0203734c - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_808D074 - - thumb_func_start sub_808D080 -sub_808D080: @ 808D080 - push {lr} - ldr r1, =0x0203734c - ldrb r0, [r1] - cmp r0, 0 - bne _0808D08C - movs r0, 0x1 -_0808D08C: - pop {r1} - bx r1 - .pool - thumb_func_end sub_808D080 - - thumb_func_start sub_808D094 -sub_808D094: @ 808D094 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - adds r2, r0, 0 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - ldrb r1, [r4, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r7, r0, r1 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r5, r0, r1 - movs r0, 0 - ldrsh r6, [r5, r0] - cmp r6, 0x1 - beq _0808D14A - cmp r6, 0x1 - bgt _0808D0E8 - cmp r6, 0 - beq _0808D0EE - b _0808D18A - .pool -_0808D0E8: - cmp r6, 0x2 - beq _0808D184 - b _0808D18A -_0808D0EE: - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _0808D18A - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl sub_808D074 - movs r1, 0 - mov r8, r1 - strh r6, [r5, 0x2] - movs r0, 0x1 - strh r0, [r5, 0x4] - ldrh r0, [r7, 0x26] - ldrh r2, [r7, 0x22] - adds r0, r2 - lsls r0, 4 - strh r0, [r5, 0x6] - strh r6, [r7, 0x26] - bl CameraObjectReset2 - ldrb r0, [r4, 0x3] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r4, 0x3] - ldrb r1, [r7, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - strb r0, [r7, 0x5] - adds r0, r7, 0 - adds r0, 0x43 - mov r1, r8 - strb r1, [r0] - adds r2, r7, 0 - adds r2, 0x42 - ldrb r1, [r2] - movs r0, 0x3F - ands r0, r1 - strb r0, [r2] - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] -_0808D14A: - adds r1, r5, 0x2 - adds r0, r4, 0 - bl sub_808D38C - ldrh r0, [r5, 0x6] - ldrh r1, [r5, 0x4] - subs r0, r1 - strh r0, [r5, 0x6] - adds r1, 0x3 - strh r1, [r5, 0x4] - lsls r0, 16 - asrs r0, 20 - strh r0, [r7, 0x22] - movs r2, 0x22 - ldrsh r1, [r7, r2] - ldr r0, =0x03005de8 - movs r2, 0 - ldrsh r0, [r0, r2] - adds r1, r0 - movs r0, 0x20 - negs r0, r0 - cmp r1, r0 - bge _0808D18A - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - b _0808D18A - .pool -_0808D184: - adds r0, r2, 0 - bl remove_task -_0808D18A: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_808D094 - - thumb_func_start sub_808D194 -sub_808D194: @ 808D194 - push {r4,lr} - ldr r4, =sub_808D1FC - adds r0, r4, 0 - movs r1, 0 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808D194 - - thumb_func_start sub_808D1B4 -sub_808D1B4: @ 808D1B4 - push {lr} - ldr r0, =sub_808D1FC - bl is_function_an_active_task - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_808D1B4 - - thumb_func_start sub_808D1C8 -sub_808D1C8: @ 808D1C8 - push {r4,lr} - ldr r4, =sub_808D094 - adds r0, r4, 0 - movs r1, 0 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808D1C8 - - thumb_func_start sub_808D1E8 -sub_808D1E8: @ 808D1E8 - push {lr} - ldr r0, =sub_808D094 - bl is_function_an_active_task - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_808D1E8 - - thumb_func_start sub_808D1FC -sub_808D1FC: @ 808D1FC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - ldrb r1, [r4, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r7, r0, r1 - mov r1, r8 - lsls r0, r1, 2 - add r0, r8 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r5, r0, r1 - movs r2, 0 - ldrsh r6, [r5, r2] - cmp r6, 0x1 - beq _0808D2DE - cmp r6, 0x1 - bgt _0808D254 - cmp r6, 0 - beq _0808D25E - b _0808D37E - .pool -_0808D254: - cmp r6, 0x2 - beq _0808D31C - cmp r6, 0x3 - beq _0808D33A - b _0808D37E -_0808D25E: - bl sub_808D080 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0xA] - ldr r1, =gUnknown_084975BC - movs r3, 0xA - ldrsh r0, [r5, r3] - adds r0, r1 - ldrb r0, [r0] - bl GetFaceDirectionAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectForceSetSpecialAnim - movs r0, 0 - mov r9, r0 - strh r6, [r5, 0x2] - movs r0, 0x74 - strh r0, [r5, 0x4] - ldrh r0, [r7, 0x22] - strh r0, [r5, 0x8] - ldrb r0, [r7, 0x5] - lsls r0, 28 - lsrs r0, 30 - strh r0, [r5, 0xC] - movs r1, 0x43 - adds r1, r7 - mov r8, r1 - ldrb r0, [r1] - strh r0, [r5, 0xE] - ldrh r0, [r7, 0x26] - adds r0, 0x20 - negs r0, r0 - lsls r0, 4 - strh r0, [r5, 0x6] - strh r6, [r7, 0x26] - bl CameraObjectReset2 - ldrb r0, [r4, 0x3] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r4, 0x3] - ldrb r1, [r7, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - orrs r0, r2 - strb r0, [r7, 0x5] - mov r3, r9 - mov r2, r8 - strb r3, [r2] - adds r2, r7, 0 - adds r2, 0x42 - ldrb r1, [r2] - movs r0, 0x3F - ands r0, r1 - strb r0, [r2] - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] -_0808D2DE: - adds r1, r5, 0x2 - adds r0, r4, 0 - bl sub_808D38C - ldrh r0, [r5, 0x4] - ldrh r2, [r5, 0x6] - adds r1, r0, r2 - strh r1, [r5, 0x6] - subs r0, 0x3 - strh r0, [r5, 0x4] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - bgt _0808D2FE - movs r0, 0x4 - strh r0, [r5, 0x4] -_0808D2FE: - ldrh r0, [r5, 0x6] - lsls r0, 16 - asrs r0, 20 - strh r0, [r7, 0x22] - ldrh r2, [r5, 0x8] - movs r3, 0x8 - ldrsh r1, [r5, r3] - cmp r0, r1 - blt _0808D37E - strh r2, [r7, 0x22] - movs r0, 0 - strh r0, [r5, 0x10] - b _0808D332 - .pool -_0808D31C: - adds r1, r5, 0x2 - adds r0, r4, 0 - bl sub_808D38C - ldrh r0, [r5, 0x10] - adds r0, 0x1 - strh r0, [r5, 0x10] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - ble _0808D37E -_0808D332: - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - b _0808D37E -_0808D33A: - movs r0, 0xA - ldrsh r6, [r5, r0] - adds r1, r5, 0x2 - adds r0, r4, 0 - bl sub_808D38C - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - bne _0808D37E - ldrb r1, [r4, 0x3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x3] - movs r0, 0x3 - ldrb r1, [r5, 0xC] - ands r1, r0 - lsls r1, 2 - ldrb r2, [r7, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r7, 0x5] - ldrh r1, [r5, 0xE] - adds r0, r7, 0 - adds r0, 0x43 - strb r1, [r0] - bl CameraObjectReset1 - mov r0, r8 - bl remove_task -_0808D37E: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_808D1FC - - thumb_func_start sub_808D38C -sub_808D38C: @ 808D38C - push {r4-r6,lr} - adds r5, r0, 0 - adds r6, r1, 0 - ldrh r1, [r6] - movs r2, 0 - ldrsh r0, [r6, r2] - cmp r0, 0x7 - bgt _0808D3A8 - adds r0, r1, 0x1 - strh r0, [r6] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _0808D3E4 -_0808D3A8: - adds r0, r5, 0 - bl FieldObjectCheckIfSpecialAnimFinishedOrInactive - lsls r0, 24 - cmp r0, 0 - beq _0808D3E4 - ldr r4, =gUnknown_084975BC - ldrb r0, [r5, 0x18] - lsls r0, 28 - lsrs r0, 28 - adds r0, r4 - ldrb r0, [r0] - bl GetFaceDirectionAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl FieldObjectForceSetSpecialAnim - movs r0, 0 - strh r0, [r6] - ldrb r0, [r5, 0x18] - lsls r0, 28 - lsrs r0, 28 - adds r0, r4 - ldrb r0, [r0] - b _0808D3EA - .pool -_0808D3E4: - ldrb r0, [r5, 0x18] - lsls r0, 28 - lsrs r0, 28 -_0808D3EA: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_808D38C - - thumb_func_start npc_clear_ids_and_state -npc_clear_ids_and_state: @ 808D3F0 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0 - movs r2, 0x24 - bl memset - movs r0, 0xFF - strb r0, [r4, 0x8] - movs r0, 0x1 - negs r0, r0 - strb r0, [r4, 0x9] - strb r0, [r4, 0xA] - strb r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - thumb_func_end npc_clear_ids_and_state - - thumb_func_start npcs_clear_ids_and_state -npcs_clear_ids_and_state: @ 808D410 - push {r4,r5,lr} - movs r4, 0 - ldr r5, =0x02037350 -_0808D416: - lsls r0, r4, 3 - adds r0, r4 - lsls r0, 2 - adds r0, r5 - bl npc_clear_ids_and_state - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _0808D416 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end npcs_clear_ids_and_state - - thumb_func_start sub_808D438 -sub_808D438: @ 808D438 - push {lr} - bl strange_npc_table_clear - bl npcs_clear_ids_and_state - bl ClearPlayerAvatarInfo - bl sub_808D450 - pop {r0} - bx r0 - thumb_func_end sub_808D438 - - thumb_func_start sub_808D450 -sub_808D450: @ 808D450 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - ldr r0, =gFieldEffectObjectTemplatePointers - ldr r0, [r0, 0x54] - mov r9, r0 - movs r1, 0 - movs r2, 0 - movs r3, 0x1F - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02020630 - mov r10, r1 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - add r4, r10 - ldrb r1, [r4, 0x1] - movs r5, 0x4 - negs r5, r5 - adds r0, r5, 0 - ands r0, r1 - movs r1, 0x1 - mov r8, r1 - mov r1, r8 - orrs r0, r1 - strb r0, [r4, 0x1] - adds r0, r4, 0 - bl obj_alloc_rotscale_entry - adds r0, r4, 0 - movs r1, 0 - bl StartObjectRotScalAnim - adds r4, 0x3E - ldrb r0, [r4] - movs r6, 0x4 - orrs r0, r6 - strb r0, [r4] - mov r0, r9 - movs r1, 0 - movs r2, 0 - movs r3, 0x1F - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - add r4, r10 - ldrb r0, [r4, 0x1] - ands r5, r0 - mov r0, r8 - orrs r5, r0 - strb r5, [r4, 0x1] - adds r0, r4, 0 - bl obj_alloc_rotscale_entry - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim - adds r4, 0x3E - ldrb r0, [r4] - orrs r0, r6 - strb r0, [r4] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808D450 - - thumb_func_start sub_808D4F4 -sub_808D4F4: @ 808D4F4 - push {lr} - movs r1, 0 - ldr r2, =0x02037350 - ldrb r0, [r2] - b _0808D518 - .pool -_0808D504: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xF - bhi _0808D51E - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] -_0808D518: - lsls r0, 31 - cmp r0, 0 - bne _0808D504 -_0808D51E: - adds r0, r1, 0 - pop {r1} - bx r1 - thumb_func_end sub_808D4F4 - - thumb_func_start GetFieldObjectIdByLocalIdAndMap -@ u8 GetFieldObjectIdByLocalIdAndMap(u8 localId, u8 mapId, u8 mapGroupId) -GetFieldObjectIdByLocalIdAndMap: @ 808D524 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - cmp r0, 0xFE - bls _0808D53C - bl GetFieldObjectIdByLocalId - b _0808D540 -_0808D53C: - bl GetFieldObjectIdByLocalIdAndMapInternal -_0808D540: - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end GetFieldObjectIdByLocalIdAndMap - - thumb_func_start TryGetFieldObjectIdByLocalIdAndMap -@ bool8 TryGetFieldObjectIdByLocalIdAndMap(u8 localId, u8 mapId, u8 mapGroupId, u8 *fieldObjectId) -TryGetFieldObjectIdByLocalIdAndMap: @ 808D548 - push {r4,lr} - adds r4, r3, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - bl GetFieldObjectIdByLocalIdAndMap - strb r0, [r4] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x10 - beq _0808D56A - movs r0, 0 - b _0808D56C -_0808D56A: - movs r0, 0x1 -_0808D56C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end TryGetFieldObjectIdByLocalIdAndMap - - thumb_func_start GetFieldObjectIdByXY -@ u8 GetFieldObjectIdByXY(s16 x, s16 y) -GetFieldObjectIdByXY: @ 808D574 - push {r4-r6,lr} - movs r3, 0 - ldr r5, =0x02037350 - lsls r0, 16 - asrs r4, r0, 16 - lsls r1, 16 - asrs r1, 16 -_0808D582: - lsls r0, r3, 3 - adds r0, r3 - lsls r0, 2 - adds r2, r0, r5 - ldrb r0, [r2] - lsls r0, 31 - cmp r0, 0 - beq _0808D5A2 - movs r6, 0x10 - ldrsh r0, [r2, r6] - cmp r0, r4 - bne _0808D5A2 - movs r6, 0x12 - ldrsh r0, [r2, r6] - cmp r0, r1 - beq _0808D5AC -_0808D5A2: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0xF - bls _0808D582 -_0808D5AC: - adds r0, r3, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end GetFieldObjectIdByXY - - thumb_func_start GetFieldObjectIdByLocalIdAndMapInternal -@ u8 GetFieldObjectIdByLocalIdAndMapInternal(u8 localId, u8 mapId, u8 mapGroupId) -GetFieldObjectIdByLocalIdAndMapInternal: @ 808D5B8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - lsls r2, 24 - lsrs r2, 24 - movs r1, 0 - ldr r6, =0x02037350 -_0808D5CA: - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r3, r0, r6 - ldrb r0, [r3] - lsls r0, 31 - cmp r0, 0 - beq _0808D5F4 - ldrb r0, [r3, 0x8] - cmp r0, r5 - bne _0808D5F4 - ldrb r0, [r3, 0x9] - cmp r0, r4 - bne _0808D5F4 - ldrb r0, [r3, 0xA] - cmp r0, r2 - bne _0808D5F4 - adds r0, r1, 0 - b _0808D600 - .pool -_0808D5F4: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xF - bls _0808D5CA - movs r0, 0x10 -_0808D600: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end GetFieldObjectIdByLocalIdAndMapInternal - - thumb_func_start GetFieldObjectIdByLocalId -@ u8 GetFieldObjectIdByLocalId(u8 localId) -GetFieldObjectIdByLocalId: @ 808D608 - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - movs r2, 0 - ldr r4, =0x02037350 -_0808D612: - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - adds r1, r0, r4 - ldrb r0, [r1] - lsls r0, 31 - cmp r0, 0 - beq _0808D630 - ldrb r0, [r1, 0x8] - cmp r0, r3 - bne _0808D630 - adds r0, r2, 0 - b _0808D63C - .pool -_0808D630: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xF - bls _0808D612 - movs r0, 0x10 -_0808D63C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end GetFieldObjectIdByLocalId - - thumb_func_start InitFieldObjectStateFromTemplate -@ u8 InitFieldObjectStateFromTemplate(struct FieldObjectTemplate *fieldObjectTemplate, u8 mapId, u8 mapGroupId) -InitFieldObjectStateFromTemplate: @ 808D644 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - adds r5, r0, 0 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r7, r2, 24 - ldrb r0, [r5] - adds r1, r6, 0 - adds r2, r7, 0 - mov r3, sp - bl GetAvailableFieldObjectSlot - lsls r0, 24 - cmp r0, 0 - beq _0808D66E - movs r0, 0x10 - b _0808D762 -_0808D66E: - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - adds r0, r4, 0 - bl npc_clear_ids_and_state - ldrh r3, [r5, 0x4] - adds r3, 0x7 - lsls r3, 16 - lsrs r3, 16 - ldrh r2, [r5, 0x6] - adds r2, 0x7 - lsls r2, 16 - lsrs r2, 16 - ldrb r0, [r4] - movs r1, 0x1 - orrs r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r4] - ldrb r0, [r5, 0x1] - strb r0, [r4, 0x5] - ldrb r0, [r5, 0x9] - strb r0, [r4, 0x6] - ldrb r0, [r5] - strb r0, [r4, 0x8] - strb r6, [r4, 0x9] - strb r7, [r4, 0xA] - strh r3, [r4, 0xC] - strh r2, [r4, 0xE] - strh r3, [r4, 0x10] - strh r2, [r4, 0x12] - strh r3, [r4, 0x14] - strh r2, [r4, 0x16] - ldrb r0, [r5, 0x8] - movs r7, 0xF - adds r1, r7, 0 - ands r1, r0 - ldrb r2, [r4, 0xB] - movs r0, 0x10 - negs r0, r0 - mov r8, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0xB] - ldrb r1, [r5, 0x8] - lsls r1, 4 - ands r0, r7 - orrs r0, r1 - strb r0, [r4, 0xB] - ldrb r1, [r5, 0xA] - lsls r1, 28 - movs r0, 0xF - mov r9, r0 - lsrs r1, 28 - ldrb r2, [r4, 0x19] - mov r0, r8 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x19] - ldrb r1, [r5, 0xA] - lsrs r1, 4 - lsls r1, 4 - ands r0, r7 - orrs r0, r1 - strb r0, [r4, 0x19] - ldrh r0, [r5, 0xC] - strb r0, [r4, 0x7] - ldrh r0, [r5, 0xE] - strb r0, [r4, 0x1D] - ldr r1, =gUnknown_085055CD - ldrb r0, [r5, 0x9] - adds r0, r1 - ldrb r1, [r0] - adds r0, r4, 0 - adds r0, 0x20 - strb r1, [r0] - ldrb r1, [r0] - adds r0, r4, 0 - bl FieldObjectSetDirection - adds r0, r4, 0 - bl FieldObjectHandleDynamicGraphicsId - ldr r1, =gUnknown_0850557C - ldrb r0, [r4, 0x6] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _0808D75E - ldrb r2, [r4, 0x19] - adds r0, r7, 0 - ands r0, r2 - cmp r0, 0 - bne _0808D746 - lsls r0, r2, 28 - lsrs r0, 28 - adds r0, 0x1 - mov r1, r9 - ands r0, r1 - mov r1, r8 - ands r1, r2 - orrs r1, r0 - strb r1, [r4, 0x19] -_0808D746: - ldrb r2, [r4, 0x19] - movs r0, 0xF0 - ands r0, r2 - cmp r0, 0 - bne _0808D75E - lsrs r1, r2, 4 - adds r1, 0x1 - lsls r1, 4 - adds r0, r7, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x19] -_0808D75E: - mov r0, sp - ldrb r0, [r0] -_0808D762: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end InitFieldObjectStateFromTemplate - - thumb_func_start sub_808D77C -sub_808D77C: @ 808D77C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r4, =0x02037318 - ldr r0, [r4, 0x4] - cmp r0, 0 - beq _0808D7FE - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _0808D7A8 - bl sub_81AAA40 - lsls r0, 24 - lsrs r6, r0, 24 - b _0808D7CA - .pool -_0808D7A8: - bl InTrainerHill - cmp r0, 0 - beq _0808D7C6 - movs r6, 0x2 - b _0808D7CA -_0808D7B4: - ldr r0, [r7] - ldrb r1, [r0, 0x5] - ldrb r2, [r0, 0x4] - adds r0, r4, 0 - bl InitFieldObjectStateFromTemplate - lsls r0, 24 - lsrs r0, 24 - b _0808D800 -_0808D7C6: - ldr r0, [r4, 0x4] - ldrb r6, [r0] -_0808D7CA: - movs r5, 0 - cmp r5, r6 - bcs _0808D7FE - ldr r7, =0x03005d8c -_0808D7D2: - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 3 - movs r1, 0xC7 - lsls r1, 4 - adds r0, r1 - ldr r1, [r7] - adds r4, r1, r0 - ldrb r0, [r4] - cmp r0, r8 - bne _0808D7F4 - ldrh r0, [r4, 0x14] - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0808D7B4 -_0808D7F4: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r6 - bcc _0808D7D2 -_0808D7FE: - movs r0, 0x10 -_0808D800: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_808D77C - - thumb_func_start GetAvailableFieldObjectSlot -@ bool8 GetAvailableFieldObjectSlot(u16 localId, u8 mapId, u8 mapGroupId, u8 *fieldObjectId) -GetAvailableFieldObjectSlot: @ 808D810 - push {r4-r7,lr} - mov r12, r3 - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r2, 24 - lsrs r4, r2, 24 - movs r2, 0 - ldr r1, =0x02037350 - ldrb r0, [r1] - lsls r0, 31 - adds r7, r1, 0 - cmp r0, 0 - beq _0808D864 - adds r3, r1, 0 -_0808D830: - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - adds r1, r0, r3 - ldrb r0, [r1, 0x8] - cmp r0, r6 - bne _0808D84A - ldrb r0, [r1, 0x9] - cmp r0, r5 - bne _0808D84A - ldrb r0, [r1, 0xA] - cmp r0, r4 - beq _0808D868 -_0808D84A: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xF - bhi _0808D868 - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - adds r0, r7 - ldrb r0, [r0] - lsls r0, 31 - cmp r0, 0 - bne _0808D830 -_0808D864: - cmp r2, 0xF - bls _0808D870 -_0808D868: - movs r0, 0x1 - b _0808D8A4 - .pool -_0808D870: - mov r0, r12 - strb r2, [r0] - ldr r1, =0x02037350 -_0808D876: - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - adds r3, r0, r1 - ldrb r0, [r3] - lsls r0, 31 - cmp r0, 0 - beq _0808D898 - ldrb r0, [r3, 0x8] - cmp r0, r6 - bne _0808D898 - ldrb r0, [r3, 0x9] - cmp r0, r5 - bne _0808D898 - ldrb r0, [r3, 0xA] - cmp r0, r4 - beq _0808D868 -_0808D898: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xF - bls _0808D876 - movs r0, 0 -_0808D8A4: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end GetAvailableFieldObjectSlot - - thumb_func_start RemoveFieldObject -@ void RemoveFieldObject(npc_state *fieldObject) -RemoveFieldObject: @ 808D8B0 - push {lr} - ldrb r2, [r0] - movs r1, 0x2 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - bl RemoveFieldObjectInternal - pop {r0} - bx r0 - thumb_func_end RemoveFieldObject - - thumb_func_start RemoveFieldObjectByLocalIdAndMap -@ void RemoveFieldObjectByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapBank) -RemoveFieldObjectByLocalIdAndMap: @ 808D8C4 - push {lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _0808D902 - mov r0, sp - ldrb r0, [r0] - bl GetFieldObjectFlagIdByFieldObjectId - lsls r0, 16 - lsrs r0, 16 - bl FlagSet - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - bl RemoveFieldObject -_0808D902: - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end RemoveFieldObjectByLocalIdAndMap - - thumb_func_start RemoveFieldObjectInternal -@ void RemoveFieldObjectInternal(npc_state *fieldObject) -RemoveFieldObjectInternal: @ 808D90C - push {r4,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldrb r0, [r4, 0x5] - bl GetFieldObjectGraphicsInfo - ldrh r2, [r0, 0x6] - ldr r1, =0xffff0000 - ldr r0, [sp, 0x4] - ands r0, r1 - orrs r0, r2 - str r0, [sp, 0x4] - ldr r2, =0x02020630 - ldrb r1, [r4, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r2, 0 - adds r1, 0xC - adds r0, r1 - mov r1, sp - str r1, [r0] - ldrb r1, [r4, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - bl RemoveObjectAndFreeTiles - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end RemoveFieldObjectInternal - - thumb_func_start sub_808D958 -sub_808D958: @ 808D958 - push {r4,lr} - movs r4, 0 -_0808D95C: - ldr r0, =0x02037590 - ldrb r0, [r0, 0x5] - cmp r4, r0 - beq _0808D972 - lsls r0, r4, 3 - adds r0, r4 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - bl RemoveFieldObject -_0808D972: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _0808D95C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808D958 - - thumb_func_start SpawnFieldObjectInternal -@ u8 SpawnFieldObjectInternal(struct FieldObjectTemplate *romFieldObject, struct objtemplate *template, int mapId, int mapGroupId, u16 movingCameraOffsetX, u16 movingCameraOffsetY) -SpawnFieldObjectInternal: @ 808D98C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r8, r1 - adds r1, r2, 0 - adds r2, r3, 0 - ldr r3, [sp, 0x24] - ldr r4, [sp, 0x28] - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 16 - lsrs r3, 16 - mov r10, r3 - lsls r4, 16 - lsrs r4, 16 - str r4, [sp] - bl InitFieldObjectStateFromTemplate - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - cmp r0, 0x10 - bne _0808D9C8 - movs r0, 0x10 - b _0808DB2C -_0808D9C8: - mov r0, r9 - lsls r4, r0, 3 - adds r0, r4, r0 - lsls r0, 2 - ldr r1, =0x02037350 - adds r6, r0, r1 - ldrb r0, [r6, 0x5] - bl GetFieldObjectGraphicsInfo - adds r7, r0, 0 - ldrb r0, [r7, 0xC] - lsls r0, 28 - lsrs r5, r0, 28 - cmp r5, 0 - bne _0808D9F4 - ldrh r0, [r7, 0x2] - movs r1, 0 - bl npc_load_two_palettes__no_record - b _0808DA16 - .pool -_0808D9F4: - cmp r5, 0xA - bne _0808DA02 - ldrh r0, [r7, 0x2] - movs r1, 0xA - bl npc_load_two_palettes__and_record - b _0808DA16 -_0808DA02: - cmp r5, 0xF - bls _0808DA16 - adds r0, r5, 0 - subs r0, 0x10 - lsls r0, 24 - lsrs r5, r0, 24 - ldrh r0, [r7, 0x2] - adds r1, r5, 0 - bl sub_808EAB0 -_0808DA16: - ldrb r0, [r6, 0x6] - cmp r0, 0x4C - bne _0808DA24 - ldrb r0, [r6, 0x1] - movs r1, 0x20 - orrs r0, r1 - strb r0, [r6, 0x1] -_0808DA24: - ldr r1, =0x0000ffff - adds r0, r1, 0 - mov r2, r8 - strh r0, [r2, 0x2] - mov r0, r8 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0x40 - bne _0808DA64 - ldr r0, =0x02037350 - mov r2, r9 - adds r1, r4, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - movs r0, 0x10 - b _0808DB2C - .pool -_0808DA64: - mov r1, r8 - lsls r0, r1, 4 - add r0, r8 - lsls r0, 2 - ldr r1, =0x02020630 - adds r4, r0, r1 - mov r2, r10 - lsls r0, r2, 16 - asrs r0, 16 - ldrh r1, [r6, 0x10] - adds r0, r1 - lsls r0, 16 - asrs r0, 16 - ldr r2, [sp] - lsls r1, r2, 16 - asrs r1, 16 - ldrh r2, [r6, 0x12] - adds r1, r2 - lsls r1, 16 - asrs r1, 16 - adds r2, r4, 0 - adds r2, 0x20 - adds r3, r4, 0 - adds r3, 0x22 - bl sub_8092FF0 - ldrh r0, [r7, 0x8] - lsls r0, 16 - asrs r0, 17 - negs r0, r0 - adds r1, r4, 0 - adds r1, 0x28 - strb r0, [r1] - ldrh r0, [r7, 0xA] - lsls r0, 16 - asrs r0, 17 - negs r0, r0 - adds r2, r4, 0 - adds r2, 0x29 - strb r0, [r2] - ldrh r0, [r4, 0x20] - adds r0, 0x8 - strh r0, [r4, 0x20] - ldrh r1, [r4, 0x22] - adds r1, 0x10 - movs r0, 0 - ldrsb r0, [r2, r0] - adds r0, r1 - strh r0, [r4, 0x22] - lsls r2, r5, 4 - ldrb r1, [r4, 0x5] - movs r0, 0xF - ands r0, r1 - orrs r0, r2 - strb r0, [r4, 0x5] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2] - mov r0, r9 - strh r0, [r4, 0x2E] - mov r1, r8 - strb r1, [r6, 0x4] - ldrb r1, [r7, 0xC] - lsls r1, 25 - lsrs r1, 31 - lsls r1, 4 - ldrb r2, [r6, 0x1] - movs r0, 0x11 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r6, 0x1] - lsls r0, 27 - cmp r0, 0 - blt _0808DB16 - ldrb r0, [r6, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl FieldObjectDirectionToImageAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim -_0808DB16: - ldrb r0, [r6, 0xB] - lsrs r0, 4 - adds r1, r4, 0 - movs r2, 0x1 - bl SetObjectSubpriorityByZCoord - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_8096518 - mov r0, r9 -_0808DB2C: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end SpawnFieldObjectInternal - - thumb_func_start SpawnFieldObject -@ u8 SpawnFieldObject(struct FieldObjectTemplate *romNpc, u8 mapId, u8 mapGroupId, u16 movingCameraOffsetX, u16 movingCameraOffsetY) -SpawnFieldObject: @ 808DB40 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x2C - mov r9, r0 - adds r6, r1, 0 - mov r8, r2 - adds r4, r3, 0 - ldr r5, [sp, 0x48] - lsls r6, 24 - lsrs r6, 24 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - movs r0, 0 - str r0, [sp, 0x20] - mov r1, r9 - ldrb r0, [r1, 0x1] - bl GetFieldObjectGraphicsInfo - adds r7, r0, 0 - add r2, sp, 0x20 - mov r0, r9 - add r1, sp, 0x8 - bl MakeObjectTemplateFromFieldObjectTemplate - ldrh r3, [r7, 0x6] - ldr r2, =0xffff0000 - add r1, sp, 0x24 - ldr r0, [r1, 0x4] - ands r0, r2 - orrs r0, r3 - str r0, [r1, 0x4] - str r1, [sp, 0x14] - lsls r4, 16 - asrs r4, 16 - str r4, [sp] - lsls r5, 16 - asrs r5, 16 - str r5, [sp, 0x4] - mov r0, r9 - add r1, sp, 0x8 - adds r2, r6, 0 - mov r3, r8 - bl SpawnFieldObjectInternal - lsls r0, 24 - lsrs r2, r0, 24 - adds r5, r2, 0 - cmp r2, 0x10 - bne _0808DBBC - movs r0, 0x10 - b _0808DBF2 - .pool -_0808DBBC: - ldr r4, =0x02020630 - ldr r1, =0x02037350 - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - adds r3, r0, r1 - ldrb r1, [r3, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0xC - adds r0, r1 - ldr r1, [r7, 0x1C] - str r1, [r0] - ldr r2, [sp, 0x20] - cmp r2, 0 - beq _0808DBF0 - ldrb r1, [r3, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r1, r2, 0 - bl SetSpriteOamTables_NoPriorityFromTable -_0808DBF0: - adds r0, r5, 0 -_0808DBF2: - add sp, 0x2C - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end SpawnFieldObject - - thumb_func_start SpawnSpecialFieldObject -@ u8 SpawnSpecialFieldObject(struct FieldObjectTemplate *romFieldObject) -SpawnSpecialFieldObject: @ 808DC08 - push {r4-r6,lr} - sub sp, 0x8 - adds r5, r0, 0 - mov r4, sp - adds r4, 0x6 - add r0, sp, 0x4 - adds r1, r4, 0 - bl GetFieldObjectMovingCameraOffset - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrb r1, [r0, 0x5] - ldrb r2, [r0, 0x4] - add r0, sp, 0x4 - movs r6, 0 - ldrsh r3, [r0, r6] - movs r6, 0 - ldrsh r0, [r4, r6] - str r0, [sp] - adds r0, r5, 0 - bl SpawnFieldObject - lsls r0, 24 - lsrs r0, 24 - add sp, 0x8 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end SpawnSpecialFieldObject - - thumb_func_start SpawnSpecialFieldObjectParametrized -@ u8 SpawnSpecialFieldObjectParametrized(u8 graphicsId, u8 movementBehavior, u8 localId, u16 x, u16 y, u8 z) -SpawnSpecialFieldObjectParametrized: @ 808DC44 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x18 - ldr r4, [sp, 0x2C] - ldr r5, [sp, 0x30] - mov r8, r5 - lsls r0, 24 - lsrs r0, 24 - lsls r3, 16 - ldr r5, =0xfff90000 - adds r3, r5 - lsrs r3, 16 - lsls r4, 16 - adds r4, r5 - lsrs r4, 16 - mov r5, sp - movs r6, 0 - strb r2, [r5] - mov r2, sp - strb r0, [r2, 0x1] - mov r0, sp - strb r6, [r0, 0x2] - movs r5, 0 - strh r3, [r0, 0x4] - strh r4, [r0, 0x6] - mov r2, r8 - strb r2, [r0, 0x8] - strb r1, [r0, 0x9] - mov r2, sp - ldrb r1, [r2, 0xA] - movs r0, 0x10 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0xA] - mov r0, sp - strb r5, [r0, 0xA] - strh r6, [r0, 0xC] - strh r6, [r0, 0xE] - bl SpawnSpecialFieldObject - lsls r0, 24 - lsrs r0, 24 - add sp, 0x18 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end SpawnSpecialFieldObjectParametrized - - thumb_func_start show_sprite -show_sprite: @ 808DCAC - push {r4-r7,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r6, r2, 24 - adds r1, r7, 0 - adds r2, r6, 0 - bl GetFieldObjectTemplateByLocalIdAndMap - adds r5, r0, 0 - cmp r5, 0 - beq _0808DCF2 - mov r4, sp - adds r4, 0x6 - add r0, sp, 0x4 - adds r1, r4, 0 - bl GetFieldObjectMovingCameraOffset - add r0, sp, 0x4 - movs r1, 0 - ldrsh r3, [r0, r1] - movs r1, 0 - ldrsh r0, [r4, r1] - str r0, [sp] - adds r0, r5, 0 - adds r1, r7, 0 - adds r2, r6, 0 - bl SpawnFieldObject - lsls r0, 24 - lsrs r0, 24 - b _0808DCF4 -_0808DCF2: - movs r0, 0x10 -_0808DCF4: - add sp, 0x8 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end show_sprite - - thumb_func_start MakeObjectTemplateFromFieldObjectGraphicsInfo -@ void MakeObjectTemplateFromFieldObjectGraphicsInfo(u8 graphicsId, void ( *callback)(), struct objtemplate *objectTemplate, SpriteOamTable **spriteOamTables) -MakeObjectTemplateFromFieldObjectGraphicsInfo: @ 808DCFC - push {r4-r6,lr} - adds r5, r1, 0 - adds r4, r2, 0 - adds r6, r3, 0 - lsls r0, 24 - lsrs r0, 24 - bl GetFieldObjectGraphicsInfo - ldrh r1, [r0] - strh r1, [r4] - ldrh r1, [r0, 0x2] - strh r1, [r4, 0x2] - ldr r1, [r0, 0x10] - str r1, [r4, 0x4] - ldr r1, [r0, 0x18] - str r1, [r4, 0x8] - ldr r1, [r0, 0x1C] - str r1, [r4, 0xC] - ldr r1, [r0, 0x20] - str r1, [r4, 0x10] - str r5, [r4, 0x14] - ldr r0, [r0, 0x14] - str r0, [r6] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end MakeObjectTemplateFromFieldObjectGraphicsInfo - - thumb_func_start MakeObjectTemplateFromFieldObjectGraphicsInfoWithCallbackIndex -@ void MakeObjectTemplateFromFieldObjectGraphicsInfoWithCallbackIndex(u16 graphicsId, u16 callbackIndex, struct objtemplate *objectTemplate, SpriteOamTable **spriteOamTables) -MakeObjectTemplateFromFieldObjectGraphicsInfoWithCallbackIndex: @ 808DD30 - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - lsls r1, 16 - ldr r4, =gUnknown_08505438 - lsrs r1, 14 - adds r1, r4 - ldr r1, [r1] - bl MakeObjectTemplateFromFieldObjectGraphicsInfo - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end MakeObjectTemplateFromFieldObjectGraphicsInfoWithCallbackIndex - - thumb_func_start MakeObjectTemplateFromFieldObjectTemplate -@ void MakeObjectTemplateFromFieldObjectTemplate(struct FieldObjectTemplate *fieldObjectTemplate, struct objtemplate *objectTemplate, SpriteOamTable **spriteOamTables) -MakeObjectTemplateFromFieldObjectTemplate: @ 808DD50 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r3, r2, 0 - ldrb r0, [r4, 0x1] - ldrb r1, [r4, 0x9] - adds r2, r5, 0 - bl MakeObjectTemplateFromFieldObjectGraphicsInfoWithCallbackIndex - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end MakeObjectTemplateFromFieldObjectTemplate - - thumb_func_start AddPseudoFieldObject -@ void AddPseudoFieldObject(u8 graphicsId, void ( *callback)(), u16 x, u16 y, u8 subpriority) -AddPseudoFieldObject: @ 808DD68 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r0, [sp, 0x20] - lsls r4, 16 - lsrs r4, 16 - lsls r2, 16 - lsrs r2, 16 - mov r8, r2 - lsls r3, 16 - lsrs r7, r3, 16 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r0, 0x18 - bl Alloc - adds r6, r0, 0 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - mov r3, sp - bl MakeObjectTemplateFromFieldObjectGraphicsInfo - ldrh r1, [r6, 0x2] - ldr r0, =0x0000ffff - cmp r1, r0 - beq _0808DDAE - adds r0, r1, 0 - bl sub_808E894 -_0808DDAE: - mov r0, r8 - lsls r1, r0, 16 - asrs r1, 16 - lsls r2, r7, 16 - asrs r2, 16 - adds r0, r6, 0 - mov r3, r9 - bl AddObjectToFront - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r6, 0 - bl Free - cmp r5, 0x40 - beq _0808DDF2 - ldr r1, [sp] - cmp r1, 0 - beq _0808DDF2 - lsls r4, r5, 4 - adds r4, r5 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - adds r0, r4, 0 - bl SetSpriteOamTables_NoPriorityFromTable - adds r4, 0x42 - ldrb r1, [r4] - movs r0, 0x3F - ands r0, r1 - movs r1, 0x80 - orrs r0, r1 - strb r0, [r4] -_0808DDF2: - adds r0, r5, 0 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end AddPseudoFieldObject - - thumb_func_start sprite_new -sprite_new: @ 808DE0C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - adds r5, r0, 0 - ldr r0, [sp, 0x40] - ldr r4, [sp, 0x44] - lsls r5, 24 - lsrs r5, 24 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - add r1, sp, 0x18 - mov r8, r1 - strh r2, [r1] - mov r6, sp - adds r6, 0x1A - strh r3, [r6] - lsls r0, 24 - lsrs r7, r0, 24 - lsls r4, 24 - lsrs r4, 24 - mov r10, r4 - adds r0, r5, 0 - bl GetFieldObjectGraphicsInfo - adds r4, r0, 0 - ldr r1, =sub_8097AC8 - add r3, sp, 0x1C - adds r0, r5, 0 - mov r2, sp - bl MakeObjectTemplateFromFieldObjectGraphicsInfo - mov r1, sp - ldr r2, =0x0000ffff - adds r0, r2, 0 - strh r0, [r1, 0x2] - mov r1, r8 - movs r2, 0 - ldrsh r0, [r1, r2] - adds r0, 0x7 - strh r0, [r1] - movs r1, 0 - ldrsh r0, [r6, r1] - adds r0, 0x7 - strh r0, [r6] - mov r0, r8 - adds r1, r6, 0 - movs r2, 0x8 - movs r3, 0x10 - bl sub_80930E0 - mov r2, r8 - movs r0, 0 - ldrsh r1, [r2, r0] - movs r0, 0 - ldrsh r2, [r6, r0] - mov r0, sp - movs r3, 0 - bl AddObjectToBack - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x40 - beq _0808DF6C - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - ldr r1, =0x02020630 - adds r5, r0, r1 - ldrh r0, [r4, 0x8] - lsls r0, 16 - asrs r0, 17 - negs r0, r0 - adds r1, r5, 0 - adds r1, 0x28 - strb r0, [r1] - ldrh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 17 - negs r0, r0 - adds r1, 0x1 - strb r0, [r1] - movs r0, 0 - ldrsb r0, [r1, r0] - ldrh r1, [r5, 0x22] - adds r0, r1 - strh r0, [r5, 0x22] - ldrb r0, [r4, 0xC] - lsls r0, 28 - lsrs r0, 24 - ldrb r1, [r5, 0x5] - movs r3, 0xF - adds r2, r3, 0 - ands r2, r1 - orrs r2, r0 - strb r2, [r5, 0x5] - lsls r1, r2, 24 - lsrs r0, r1, 28 - cmp r0, 0xF - bls _0808DEE4 - subs r0, 0x10 - lsls r0, 4 - ands r2, r3 - orrs r2, r0 - strb r2, [r5, 0x5] -_0808DEE4: - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2] - mov r2, r9 - strh r2, [r5, 0x2E] - strh r7, [r5, 0x30] - ldrb r1, [r4, 0xC] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0xA - bne _0808DF18 - ldrh r0, [r4, 0x2] - lsls r1, 28 - lsrs r1, 28 - bl npc_load_two_palettes__and_record - b _0808DF2C - .pool -_0808DF18: - lsls r1, 28 - lsrs r0, r1, 28 - cmp r0, 0xF - bls _0808DF2C - ldrh r0, [r4, 0x2] - lsrs r2, r1, 28 - movs r1, 0xF0 - orrs r1, r2 - bl sub_808EAB0 -_0808DF2C: - ldr r1, [sp, 0x1C] - cmp r1, 0 - beq _0808DF48 - adds r0, r5, 0 - bl SetSpriteOamTables_NoPriorityFromTable - adds r2, r5, 0 - adds r2, 0x42 - ldrb r0, [r2] - movs r1, 0x3F - ands r1, r0 - movs r0, 0x80 - orrs r1, r0 - strb r1, [r2] -_0808DF48: - adds r0, r5, 0 - adds r1, r7, 0 - bl InitObjectPriorityByZCoord - adds r0, r7, 0 - adds r1, r5, 0 - movs r2, 0x1 - bl SetObjectSubpriorityByZCoord - mov r0, r10 - bl FieldObjectDirectionToImageAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl StartObjectImageAnim -_0808DF6C: - adds r0, r6, 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 sprite_new - - thumb_func_start SpawnFieldObjectsInView -@ void SpawnFieldObjectsInView(u16 movingCameraOffsetX, u16 movingCameraOffsetY) -SpawnFieldObjectsInView: @ 808DF80 - 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 - str r0, [sp, 0x4] - lsls r1, 16 - lsrs r1, 16 - str r1, [sp, 0x8] - ldr r5, =0x02037318 - ldr r0, [r5, 0x4] - cmp r0, 0 - beq _0808E078 - ldr r0, =0x03005d8c - ldr r2, [r0] - ldrh r1, [r2] - subs r0, r1, 0x2 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - adds r1, 0x11 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp, 0xC] - ldrh r4, [r2, 0x2] - adds r0, r4, 0 - adds r0, 0x10 - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _0808DFE0 - bl sub_81AAA40 - lsls r0, 24 - lsrs r6, r0, 24 - b _0808DFF0 - .pool -_0808DFE0: - bl InTrainerHill - cmp r0, 0 - beq _0808DFEC - movs r6, 0x2 - b _0808DFF0 -_0808DFEC: - ldr r0, [r5, 0x4] - ldrb r6, [r0] -_0808DFF0: - movs r5, 0 - cmp r5, r6 - bcs _0808E078 - lsls r0, r4, 16 - asrs r0, 16 - mov r9, r0 - mov r1, r8 - lsls r0, r1, 16 - asrs r0, 16 - mov r8, r0 -_0808E004: - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 3 - movs r2, 0xC7 - lsls r2, 4 - adds r0, r2 - ldr r3, =0x03005d8c - ldr r1, [r3] - adds r4, r1, r0 - ldrh r0, [r4, 0x4] - adds r0, 0x7 - lsls r0, 16 - lsrs r2, r0, 16 - ldrh r0, [r4, 0x6] - adds r0, 0x7 - lsls r0, 16 - asrs r1, r0, 16 - cmp r9, r1 - bgt _0808E06E - mov r7, r10 - lsls r0, r7, 16 - asrs r0, 16 - cmp r0, r1 - blt _0808E06E - lsls r0, r2, 16 - asrs r1, r0, 16 - cmp r8, r1 - bgt _0808E06E - ldr r2, [sp, 0xC] - lsls r0, r2, 16 - asrs r0, 16 - cmp r0, r1 - blt _0808E06E - ldrh r0, [r4, 0x14] - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _0808E06E - ldr r3, =0x03005d8c - ldr r0, [r3] - ldrb r1, [r0, 0x5] - ldrb r2, [r0, 0x4] - ldr r7, [sp, 0x4] - lsls r3, r7, 16 - ldr r7, [sp, 0x8] - lsls r0, r7, 16 - asrs r0, 16 - str r0, [sp] - adds r0, r4, 0 - asrs r3, 16 - bl SpawnFieldObject -_0808E06E: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r6 - bcc _0808E004 -_0808E078: - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end SpawnFieldObjectsInView - - thumb_func_start RemoveFieldObjectsOutsideView -@ void RemoveFieldObjectsOutsideView() -RemoveFieldObjectsOutsideView: @ 808E08C - push {r4-r6,lr} - movs r3, 0 - ldr r6, =0x02032308 -_0808E092: - movs r2, 0 - movs r4, 0 - adds r5, r3, 0x1 -_0808E098: - lsls r0, r2, 2 - adds r1, r0, r6 - ldrb r0, [r1] - cmp r0, 0 - beq _0808E0AA - ldrb r1, [r1, 0x2] - cmp r3, r1 - bne _0808E0AA - movs r4, 0x1 -_0808E0AA: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x3 - bls _0808E098 - cmp r4, 0 - bne _0808E0D2 - lsls r0, r3, 3 - adds r0, r3 - lsls r0, 2 - ldr r1, =0x02037350 - adds r2, r0, r1 - ldr r0, [r2] - ldr r1, =0x00010001 - ands r0, r1 - cmp r0, 0x1 - bne _0808E0D2 - adds r0, r2, 0 - bl RemoveFieldObjectIfOutsideView -_0808E0D2: - lsls r0, r5, 24 - lsrs r3, r0, 24 - cmp r3, 0xF - bls _0808E092 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end RemoveFieldObjectsOutsideView - - thumb_func_start RemoveFieldObjectIfOutsideView -@ void RemoveFieldObjectIfOutsideView(npc_state *fieldObject) -RemoveFieldObjectIfOutsideView: @ 808E0EC - push {r4-r7,lr} - adds r3, r0, 0 - ldr r0, =0x03005d8c - ldr r2, [r0] - ldrh r0, [r2] - subs r1, r0, 0x2 - lsls r1, 16 - adds r0, 0x11 - lsls r0, 16 - lsrs r5, r0, 16 - ldrh r4, [r2, 0x2] - adds r0, r4, 0 - adds r0, 0x10 - lsls r0, 16 - lsrs r6, r0, 16 - movs r0, 0x10 - ldrsh r2, [r3, r0] - lsrs r7, r1, 16 - asrs r1, 16 - cmp r2, r1 - blt _0808E132 - lsls r0, r5, 16 - asrs r0, 16 - cmp r2, r0 - bgt _0808E132 - movs r0, 0x12 - ldrsh r1, [r3, r0] - lsls r0, r4, 16 - asrs r0, 16 - cmp r1, r0 - blt _0808E132 - lsls r0, r6, 16 - asrs r0, 16 - cmp r1, r0 - ble _0808E160 -_0808E132: - movs r0, 0xC - ldrsh r1, [r3, r0] - lsls r0, r7, 16 - asrs r0, 16 - cmp r1, r0 - blt _0808E15A - lsls r0, r5, 16 - asrs r0, 16 - cmp r1, r0 - bgt _0808E15A - movs r0, 0xE - ldrsh r1, [r3, r0] - lsls r0, r4, 16 - asrs r0, 16 - cmp r1, r0 - blt _0808E15A - lsls r0, r6, 16 - asrs r0, 16 - cmp r1, r0 - ble _0808E160 -_0808E15A: - adds r0, r3, 0 - bl RemoveFieldObject -_0808E160: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end RemoveFieldObjectIfOutsideView - - thumb_func_start sub_808E16C -sub_808E16C: @ 808E16C - push {r4-r7,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - bl ClearPlayerAvatarInfo - movs r6, 0 - ldr r7, =0x02037350 - lsls r4, 16 - lsls r5, 16 -_0808E186: - lsls r0, r6, 3 - adds r0, r6 - lsls r0, 2 - adds r0, r7 - ldrb r0, [r0] - lsls r0, 31 - cmp r0, 0 - beq _0808E1A0 - adds r0, r6, 0 - asrs r1, r4, 16 - asrs r2, r5, 16 - bl sub_808E1B8 -_0808E1A0: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0xF - bls _0808E186 - bl sub_808D450 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808E16C - - thumb_func_start sub_808E1B8 -sub_808E1B8: @ 808E1B8 - 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 r9, r0 - lsls r1, 16 - lsrs r1, 16 - mov r10, r1 - lsls r2, 16 - lsrs r2, 16 - str r2, [sp, 0x24] - movs r7, 0 - ldr r2, =0x02032308 -_0808E1DA: - lsls r0, r7, 2 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0 - beq _0808E1EC - ldrb r1, [r1, 0x2] - cmp r9, r1 - bne _0808E1EC - b _0808E374 -_0808E1EC: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x3 - bls _0808E1DA - mov r1, r9 - lsls r0, r1, 3 - add r0, r9 - lsls r0, 2 - ldr r1, =0x02037350 - adds r6, r0, r1 - movs r0, 0 - str r0, [sp, 0x20] - ldrb r0, [r6, 0x5] - bl GetFieldObjectGraphicsInfo - adds r5, r0, 0 - ldrh r2, [r5, 0x6] - ldr r1, =0xffff0000 - add r4, sp, 0x18 - ldr r0, [r4, 0x4] - ands r0, r1 - orrs r0, r2 - str r0, [r4, 0x4] - ldrb r0, [r6, 0x5] - ldrb r1, [r6, 0x6] - add r3, sp, 0x20 - mov r2, sp - bl MakeObjectTemplateFromFieldObjectGraphicsInfoWithCallbackIndex - str r4, [sp, 0xC] - mov r1, sp - ldr r2, =0x0000ffff - adds r0, r2, 0 - strh r0, [r1, 0x2] - ldrb r0, [r5, 0xC] - lsls r1, r0, 28 - lsrs r0, r1, 28 - mov r8, r0 - cmp r0, 0 - bne _0808E258 - ldrh r0, [r5, 0x2] - lsrs r1, 28 - bl npc_load_two_palettes__no_record - b _0808E27E - .pool -_0808E258: - mov r2, r8 - cmp r2, 0xA - bne _0808E268 - ldrh r0, [r5, 0x2] - lsrs r1, 28 - bl npc_load_two_palettes__and_record - b _0808E27E -_0808E268: - mov r0, r8 - cmp r0, 0xF - bls _0808E27E - subs r0, 0x10 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldrh r0, [r5, 0x2] - mov r1, r8 - bl sub_808EAB0 -_0808E27E: - mov r1, sp - ldr r2, =0x0000ffff - adds r0, r2, 0 - strh r0, [r1, 0x2] - mov r0, sp - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x40 - beq _0808E374 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - ldr r1, =0x02020630 - adds r4, r0, r1 - mov r1, r10 - lsls r0, r1, 16 - asrs r0, 16 - ldrh r2, [r6, 0x10] - adds r0, r2 - lsls r0, 16 - asrs r0, 16 - ldr r2, [sp, 0x24] - lsls r1, r2, 16 - asrs r1, 16 - ldrh r2, [r6, 0x12] - adds r1, r2 - lsls r1, 16 - asrs r1, 16 - adds r2, r4, 0 - adds r2, 0x20 - adds r3, r4, 0 - adds r3, 0x22 - bl sub_8092FF0 - ldrh r0, [r5, 0x8] - lsls r0, 16 - asrs r0, 17 - negs r0, r0 - adds r1, r4, 0 - adds r1, 0x28 - strb r0, [r1] - ldrh r0, [r5, 0xA] - lsls r0, 16 - asrs r0, 17 - negs r0, r0 - adds r2, r4, 0 - adds r2, 0x29 - strb r0, [r2] - ldrh r0, [r4, 0x20] - adds r0, 0x8 - strh r0, [r4, 0x20] - ldrh r1, [r4, 0x22] - adds r1, 0x10 - movs r0, 0 - ldrsb r0, [r2, r0] - adds r0, r1 - strh r0, [r4, 0x22] - ldr r0, [r5, 0x1C] - str r0, [r4, 0xC] - ldrb r0, [r6, 0x6] - cmp r0, 0xB - bne _0808E312 - mov r0, r9 - adds r1, r7, 0 - bl SetPlayerAvatarFieldObjectIdAndObjectId - bl sub_8154228 - strb r0, [r6, 0x1B] -_0808E312: - ldr r1, [sp, 0x20] - cmp r1, 0 - beq _0808E31E - adds r0, r4, 0 - bl SetSpriteOamTables_NoPriorityFromTable -_0808E31E: - mov r0, r8 - lsls r2, r0, 4 - ldrb r1, [r4, 0x5] - movs r0, 0xF - ands r0, r1 - orrs r0, r2 - strb r0, [r4, 0x5] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2] - mov r1, r9 - strh r1, [r4, 0x2E] - strb r7, [r6, 0x4] - ldrb r0, [r6, 0x1] - lsls r0, 27 - cmp r0, 0 - blt _0808E362 - ldrb r0, [r6, 0x6] - cmp r0, 0xB - beq _0808E362 - ldrb r0, [r6, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl FieldObjectDirectionToImageAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim -_0808E362: - adds r0, r6, 0 - bl sub_808E38C - ldrb r0, [r6, 0xB] - lsrs r0, 4 - adds r1, r4, 0 - movs r2, 0x1 - bl SetObjectSubpriorityByZCoord -_0808E374: - add sp, 0x28 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808E1B8 - - thumb_func_start sub_808E38C -@ void sub_808E38C(struct npc_state *fieldObject) -sub_808E38C: @ 808E38C - push {lr} - ldrb r2, [r0] - movs r3, 0x3 - negs r3, r3 - adds r1, r3, 0 - ands r1, r2 - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldrb r2, [r0, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r2 - ands r1, r3 - movs r2, 0x5 - negs r2, r2 - ands r1, r2 - subs r2, 0x4 - ands r1, r2 - subs r2, 0x8 - ands r1, r2 - subs r2, 0x10 - ands r1, r2 - strb r1, [r0, 0x2] - bl FieldObjectClearAnim - pop {r0} - bx r0 - thumb_func_end sub_808E38C - - thumb_func_start SetPlayerAvatarFieldObjectIdAndObjectId -@ void SetPlayerAvatarFieldObjectIdAndObjectId(u8 fieldObjectId, u8 objectId) -SetPlayerAvatarFieldObjectIdAndObjectId: @ 808E3C4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =0x02037590 - strb r0, [r5, 0x5] - strb r1, [r5, 0x4] - ldr r1, =0x02037350 - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - adds r4, r1 - ldrb r0, [r4, 0x5] - bl GetPlayerAvatarGenderByGraphicsId - strb r0, [r5, 0x7] - ldrb r0, [r4, 0x5] - movs r1, 0x20 - bl SetPlayerAvatarExtraStateTransition - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end SetPlayerAvatarFieldObjectIdAndObjectId - - thumb_func_start FieldObjectSetGraphicsId -@ void FieldObjectSetGraphicsId(npc_state *npcState, u8 graphicsId) -FieldObjectSetGraphicsId: @ 808E3F8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r7, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - mov r0, r8 - bl GetFieldObjectGraphicsInfo - adds r6, r0, 0 - ldrb r1, [r7, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r4, r0, r1 - ldrb r0, [r6, 0xC] - lsls r1, r0, 28 - lsrs r5, r1, 28 - cmp r5, 0 - bne _0808E434 - ldrh r0, [r6, 0x2] - adds r1, r5, 0 - bl pal_patch_for_npc - b _0808E456 - .pool -_0808E434: - cmp r5, 0xA - bne _0808E442 - ldrh r0, [r6, 0x2] - lsrs r1, 28 - bl npc_load_two_palettes__and_record - b _0808E456 -_0808E442: - cmp r5, 0xF - bls _0808E456 - adds r0, r5, 0 - subs r0, 0x10 - lsls r0, 24 - lsrs r5, r0, 24 - ldrh r0, [r6, 0x2] - adds r1, r5, 0 - bl sub_808EAB0 -_0808E456: - ldr r0, [r6, 0x10] - ldrb r2, [r0, 0x1] - lsrs r2, 6 - lsls r2, 6 - ldrb r3, [r4, 0x1] - movs r1, 0x3F - adds r0, r1, 0 - ands r0, r3 - orrs r0, r2 - strb r0, [r4, 0x1] - ldr r0, [r6, 0x10] - ldrb r0, [r0, 0x3] - lsrs r0, 6 - lsls r0, 6 - ldrb r2, [r4, 0x3] - ands r1, r2 - orrs r1, r0 - strb r1, [r4, 0x3] - ldr r0, [r6, 0x1C] - str r0, [r4, 0xC] - ldr r0, [r6, 0x18] - str r0, [r4, 0x8] - ldr r0, [r6, 0x14] - str r0, [r4, 0x18] - lsls r2, r5, 4 - ldrb r1, [r4, 0x5] - movs r0, 0xF - ands r0, r1 - orrs r0, r2 - strb r0, [r4, 0x5] - ldrb r1, [r6, 0xC] - lsls r1, 25 - lsrs r1, 31 - lsls r1, 4 - ldrb r2, [r7, 0x1] - movs r0, 0x11 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r7, 0x1] - mov r0, r8 - strb r0, [r7, 0x5] - movs r1, 0x10 - ldrsh r0, [r7, r1] - movs r2, 0x12 - ldrsh r1, [r7, r2] - adds r2, r4, 0 - adds r2, 0x20 - adds r3, r4, 0 - adds r3, 0x22 - bl sub_8093038 - ldrh r0, [r6, 0x8] - lsls r0, 16 - asrs r0, 17 - negs r0, r0 - adds r1, r4, 0 - adds r1, 0x28 - strb r0, [r1] - ldrh r0, [r6, 0xA] - lsls r0, 16 - asrs r0, 17 - negs r0, r0 - adds r2, r4, 0 - adds r2, 0x29 - strb r0, [r2] - ldrh r0, [r4, 0x20] - adds r0, 0x8 - strh r0, [r4, 0x20] - ldrh r1, [r4, 0x22] - adds r1, 0x10 - movs r0, 0 - ldrsb r0, [r2, r0] - adds r0, r1 - strh r0, [r4, 0x22] - ldrb r0, [r7, 0x1] - lsrs r0, 7 - cmp r0, 0 - beq _0808E4F8 - bl CameraObjectReset1 -_0808E4F8: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end FieldObjectSetGraphicsId - - thumb_func_start sub_808E504 -sub_808E504: @ 808E504 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r4, r3, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _0808E538 - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - adds r1, r4, 0 - bl FieldObjectSetGraphicsId -_0808E538: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808E504 - - thumb_func_start FieldObjectTurn -@ void FieldObjectTurn(struct npc_state *fieldObject, u8 direction) -FieldObjectTurn: @ 808E544 - push {r4-r6,lr} - adds r6, r0, 0 - lsls r1, 24 - lsrs r1, 24 - bl FieldObjectSetDirection - ldrb r0, [r6, 0x1] - lsls r0, 27 - cmp r0, 0 - blt _0808E58A - ldrb r0, [r6, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r5, =0x02020630 - adds r4, r5 - ldrb r0, [r6, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl FieldObjectDirectionToImageAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - ldrb r1, [r6, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0 - bl SeekObjectImageAnim -_0808E58A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectTurn - - thumb_func_start FieldObjectTurnByLocalIdAndMap -@ void FieldObjectTurnByLocalIdAndMap(u8 localId, u8 mapId, u8 mapGroupId) -FieldObjectTurnByLocalIdAndMap: @ 808E594 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r4, r3, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _0808E5C8 - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - adds r1, r4, 0 - bl FieldObjectTurn -_0808E5C8: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectTurnByLocalIdAndMap - - thumb_func_start sub_808E5D4 -sub_808E5D4: @ 808E5D4 - push {lr} - lsls r1, 24 - lsrs r1, 24 - ldrb r2, [r0, 0x5] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - bl FieldObjectTurn - pop {r0} - bx r0 - .pool - thumb_func_end sub_808E5D4 - - thumb_func_start get_berry_tree_graphics -@ void get_berry_tree_graphics(npc_state *npcState, struct obj *obj) -get_berry_tree_graphics: @ 808E5F4 - push {r4-r7,lr} - adds r5, r0, 0 - adds r7, r1, 0 - ldrb r0, [r5, 0x1] - movs r1, 0x20 - orrs r0, r1 - strb r0, [r5, 0x1] - adds r4, r7, 0 - adds r4, 0x3E - ldrb r0, [r4] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r4] - ldrb r0, [r5, 0x1D] - bl GetStageByBerryTreeId - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - beq _0808E680 - ldrb r1, [r5, 0x1] - movs r0, 0x21 - negs r0, r0 - ands r0, r1 - strb r0, [r5, 0x1] - ldrb r1, [r4] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r4] - ldrb r0, [r5, 0x1D] - bl GetBerryTypeByBerryTreeId - subs r0, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - subs r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r4, 0x2B - bls _0808E648 - movs r4, 0 -_0808E648: - ldr r0, =gBerryTreeFieldObjectGraphicsIdTablePointers - lsls r4, 2 - adds r0, r4, r0 - ldr r0, [r0] - adds r0, r6 - ldrb r1, [r0] - adds r0, r5, 0 - bl FieldObjectSetGraphicsId - ldr r0, =gBerryTreePicTablePointers - adds r0, r4, r0 - ldr r0, [r0] - str r0, [r7, 0xC] - ldr r0, =gBerryTreePaletteSlotTablePointers - adds r4, r0 - ldr r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r1, 4 - ldrb r2, [r7, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r1 - strb r0, [r7, 0x5] - adds r0, r7, 0 - adds r1, r6, 0 - bl StartObjectImageAnim -_0808E680: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end get_berry_tree_graphics - - thumb_func_start GetFieldObjectGraphicsInfo -@ FieldObjectGraphicsInfo *GetFieldObjectGraphicsInfo(u8 graphicsId) -GetFieldObjectGraphicsInfo: @ 808E694 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xEF - bls _0808E6AC - adds r0, r1, 0 - adds r0, 0x10 - lsls r0, 24 - lsrs r0, 24 - bl VarGetFieldObjectGraphicsId - adds r1, r0, 0 -_0808E6AC: - cmp r1, 0x45 - bne _0808E6C4 - bl sub_81201C8 - lsls r0, 24 - ldr r1, =gMauvilleOldManGraphicsInfoPointers - lsrs r0, 22 - adds r0, r1 - ldr r0, [r0] - b _0808E6D2 - .pool -_0808E6C4: - cmp r1, 0xEE - bls _0808E6CA - movs r1, 0x5 -_0808E6CA: - ldr r0, =gFieldObjectGraphicsInfoPointers - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] -_0808E6D2: - pop {r1} - bx r1 - .pool - thumb_func_end GetFieldObjectGraphicsInfo - - thumb_func_start FieldObjectHandleDynamicGraphicsId -@ void FieldObjectHandleDynamicGraphicsId(struct npc_state *fieldObject) -FieldObjectHandleDynamicGraphicsId: @ 808E6DC - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4, 0x5] - cmp r0, 0xEF - bls _0808E6F2 - adds r0, 0x10 - lsls r0, 24 - lsrs r0, 24 - bl VarGetFieldObjectGraphicsId - strb r0, [r4, 0x5] -_0808E6F2: - pop {r4} - pop {r0} - bx r0 - thumb_func_end FieldObjectHandleDynamicGraphicsId - - thumb_func_start npc_by_local_id_and_map_set_field_1_bit_x20 -npc_by_local_id_and_map_set_field_1_bit_x20: @ 808E6F8 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r4, r3, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _0808E73A - ldr r2, =0x02037350 - mov r0, sp - ldrb r0, [r0] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x1 - adds r2, r4, 0 - ands r2, r0 - lsls r2, 5 - ldrb r3, [r1, 0x1] - movs r0, 0x21 - negs r0, r0 - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0x1] -_0808E73A: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end npc_by_local_id_and_map_set_field_1_bit_x20 - - thumb_func_start FieldObjectGetLocalIdAndMap -@ void FieldObjectGetLocalIdAndMap(struct npc_state *fieldObject, u8 *localId, u8 *mapId, u8 *mapGroupId) -FieldObjectGetLocalIdAndMap: @ 808E748 - push {r4,lr} - ldrb r4, [r0, 0x8] - strb r4, [r1] - ldrb r1, [r0, 0x9] - strb r1, [r2] - ldrb r0, [r0, 0xA] - strb r0, [r3] - pop {r4} - pop {r0} - bx r0 - thumb_func_end FieldObjectGetLocalIdAndMap - - thumb_func_start sub_808E75C -sub_808E75C: @ 808E75C - push {lr} - lsls r0, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - bl GetFieldObjectIdByXY - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x10 - beq _0808E784 - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_0808E784: - pop {r0} - bx r0 - .pool - thumb_func_end sub_808E75C - - thumb_func_start sub_808E78C -sub_808E78C: @ 808E78C - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r4, r3, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _0808E7D2 - mov r0, sp - ldrb r0, [r0] - lsls r2, r0, 3 - adds r2, r0 - lsls r2, 2 - ldr r0, =0x02037350 - adds r2, r0 - ldrb r1, [r2, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - ldrb r1, [r2, 0x3] - movs r3, 0x4 - orrs r1, r3 - strb r1, [r2, 0x3] - adds r0, 0x43 - strb r4, [r0] -_0808E7D2: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808E78C - - thumb_func_start sub_808E7E4 -sub_808E7E4: @ 808E7E4 - push {lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _0808E820 - mov r0, sp - ldrb r0, [r0] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02037350 - adds r1, r0 - ldrb r2, [r1, 0x3] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x3] - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] -_0808E820: - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_808E7E4 - - thumb_func_start sub_808E82C -sub_808E82C: @ 808E82C - push {r4,r5,lr} - sub sp, 0x4 - ldr r4, [sp, 0x10] - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 16 - lsrs r5, r3, 16 - lsls r4, 16 - lsrs r4, 16 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _0808E870 - ldr r2, =0x02037350 - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - strh r5, [r0, 0x24] - strh r4, [r0, 0x26] -_0808E870: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808E82C - - thumb_func_start gpu_pal_allocator_reset__manage_upper_four -gpu_pal_allocator_reset__manage_upper_four: @ 808E880 - push {lr} - bl ResetObjectPaletteAllocator - ldr r1, =0x0300301c - movs r0, 0xC - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end gpu_pal_allocator_reset__manage_upper_four - - thumb_func_start sub_808E894 -sub_808E894: @ 808E894 - push {lr} - lsls r0, 16 - lsrs r0, 16 - bl FindFieldObjectPaletteIndexByTag - lsls r0, 24 - lsrs r1, r0, 24 - ldr r0, =0x000011ff - cmp r1, r0 - beq _0808E8B2 - lsls r0, r1, 3 - ldr r1, =gUnknown_0850BBC8 - adds r0, r1 - bl sub_808E8F4 -_0808E8B2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_808E894 - - thumb_func_start sub_808E8C0 -sub_808E8C0: @ 808E8C0 - push {r4-r6,lr} - adds r5, r0, 0 - movs r4, 0 - ldrh r0, [r5] - ldr r1, =0x000011ff - cmp r0, r1 - beq _0808E8EA - adds r6, r1, 0 -_0808E8D0: - lsls r0, r4, 1 - adds r0, r5 - ldrh r0, [r0] - bl sub_808E894 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 1 - adds r0, r5 - ldrh r0, [r0] - cmp r0, r6 - bne _0808E8D0 -_0808E8EA: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808E8C0 - - thumb_func_start sub_808E8F4 -@ u8 sub_808E8F4(struct TaggedObjectPalette *taggedPalette) -sub_808E8F4: @ 808E8F4 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x4] - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _0808E912 - adds r0, r4, 0 - bl LoadTaggedObjectPalette - lsls r0, 24 - lsrs r0, 24 - b _0808E914 -_0808E912: - movs r0, 0xFF -_0808E914: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_808E8F4 - - thumb_func_start pal_patch_for_npc -@ void pal_patch_for_npc(u16 tag, u8 slot) -pal_patch_for_npc: @ 808E91C - push {r4,lr} - adds r4, r1, 0 - lsls r0, 16 - lsrs r0, 16 - lsls r4, 24 - lsrs r4, 24 - bl FindFieldObjectPaletteIndexByTag - lsls r0, 24 - ldr r1, =gUnknown_0850BBC8 - lsrs r0, 21 - adds r0, r1 - ldr r0, [r0] - lsls r4, 20 - movs r1, 0x80 - lsls r1, 17 - adds r4, r1 - lsrs r4, 16 - adds r1, r4, 0 - movs r2, 0x20 - bl gpu_pal_apply - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pal_patch_for_npc - - thumb_func_start pal_patch_for_npc_range -@ void pal_patch_for_npc_range(u16 *tags, u8 minSlot, u8 maxSlot) -pal_patch_for_npc_range: @ 808E954 - push {r4-r6,lr} - adds r5, r0, 0 - lsls r1, 24 - lsrs r4, r1, 24 - lsls r2, 24 - lsrs r6, r2, 24 - cmp r4, r6 - bcs _0808E978 -_0808E964: - ldrh r0, [r5] - adds r1, r4, 0 - bl pal_patch_for_npc - adds r5, 0x2 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r6 - bcc _0808E964 -_0808E978: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end pal_patch_for_npc_range - - thumb_func_start FindFieldObjectPaletteIndexByTag -@ u8 FindFieldObjectPaletteIndexByTag(u16 tag) -FindFieldObjectPaletteIndexByTag: @ 808E980 - push {r4-r6,lr} - lsls r0, 16 - lsrs r5, r0, 16 - movs r2, 0 - ldr r0, =gUnknown_0850BBC8 - ldrh r1, [r0, 0x4] - ldr r3, =0x000011ff - adds r4, r0, 0 - cmp r1, r3 - beq _0808E9C0 - adds r6, r4, 0 - adds r1, r3, 0 -_0808E998: - lsls r0, r2, 3 - adds r0, r6 - ldrh r0, [r0, 0x4] - cmp r0, r5 - bne _0808E9B0 - adds r0, r2, 0 - b _0808E9C2 - .pool -_0808E9B0: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 3 - adds r0, r4 - ldrh r0, [r0, 0x4] - cmp r0, r1 - bne _0808E998 -_0808E9C0: - movs r0, 0xFF -_0808E9C2: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end FindFieldObjectPaletteIndexByTag - - thumb_func_start npc_load_two_palettes__no_record -@ void npc_load_two_palettes__no_record(u16 tag, u8 slot) -npc_load_two_palettes__no_record: @ 808E9C8 - push {r4-r6,lr} - lsls r0, 16 - lsrs r4, r0, 16 - lsls r1, 24 - lsrs r5, r1, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl pal_patch_for_npc - movs r3, 0 - ldr r1, =gUnknown_0850BD00 - ldrh r0, [r1] - ldr r2, =0x000011ff - cmp r0, r2 - beq _0808EA30 - ldr r0, =gUnknown_084975C4 - adds r5, r0 - adds r6, r2, 0 -_0808E9EC: - lsls r2, r3, 3 - adds r0, r2, r1 - ldrh r0, [r0] - cmp r0, r4 - bne _0808EA20 - adds r1, 0x4 - adds r1, r2, r1 - ldr r0, =0x020375b4 - ldrb r0, [r0] - ldr r1, [r1] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - ldrb r1, [r5] - bl pal_patch_for_npc - b _0808EA30 - .pool -_0808EA20: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - lsls r0, r3, 3 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r6 - bne _0808E9EC -_0808EA30: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end npc_load_two_palettes__no_record - - thumb_func_start npc_load_two_palettes__and_record -@ void npc_load_two_palettes__and_record(u16 tag, u8 slot) -npc_load_two_palettes__and_record: @ 808EA38 - push {r4-r6,lr} - lsls r0, 16 - lsrs r4, r0, 16 - lsls r1, 24 - lsrs r5, r1, 24 - ldr r0, =0x020375b6 - strh r4, [r0] - adds r0, r4, 0 - adds r1, r5, 0 - bl pal_patch_for_npc - movs r3, 0 - ldr r1, =gUnknown_0850BD78 - ldrh r0, [r1] - ldr r2, =0x000011ff - cmp r0, r2 - beq _0808EAA8 - ldr r0, =gUnknown_084975C4 - adds r5, r0 - adds r6, r2, 0 -_0808EA60: - lsls r2, r3, 3 - adds r0, r2, r1 - ldrh r0, [r0] - cmp r0, r4 - bne _0808EA98 - adds r1, 0x4 - adds r1, r2, r1 - ldr r0, =0x020375b4 - ldrb r0, [r0] - ldr r1, [r1] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - ldrb r1, [r5] - bl pal_patch_for_npc - b _0808EAA8 - .pool -_0808EA98: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - lsls r0, r3, 3 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r6 - bne _0808EA60 -_0808EAA8: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end npc_load_two_palettes__and_record - - thumb_func_start sub_808EAB0 -sub_808EAB0: @ 808EAB0 - push {lr} - lsls r0, 16 - lsrs r0, 16 - lsls r1, 24 - lsrs r1, 24 - bl pal_patch_for_npc - pop {r0} - bx r0 - thumb_func_end sub_808EAB0 - - thumb_func_start sub_808EAC4 -sub_808EAC4: @ 808EAC4 - push {r4,lr} - ldrh r3, [r0, 0x10] - strh r3, [r0, 0x14] - ldrh r4, [r0, 0x12] - strh r4, [r0, 0x16] - lsls r1, 16 - asrs r1, 16 - adds r1, r3 - strh r1, [r0, 0x10] - lsls r2, 16 - asrs r2, 16 - adds r2, r4 - strh r2, [r0, 0x12] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_808EAC4 - - thumb_func_start npc_coords_shift -@ void npc_coords_shift(struct npc_state *fieldObject, u16 x, u16 y) -npc_coords_shift: @ 808EAE4 - ldrh r3, [r0, 0x10] - strh r3, [r0, 0x14] - ldrh r3, [r0, 0x12] - strh r3, [r0, 0x16] - strh r1, [r0, 0x10] - strh r2, [r0, 0x12] - bx lr - thumb_func_end npc_coords_shift - - thumb_func_start npc_coords_set -@ void npc_coords_set(struct npc_state *fieldObject, u16 x, u16 y) -npc_coords_set: @ 808EAF4 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r2, 16 - strh r1, [r0, 0x14] - strh r2, [r0, 0x16] - strh r1, [r0, 0x10] - strh r2, [r0, 0x12] - bx lr - thumb_func_end npc_coords_set - - thumb_func_start sub_808EB08 -sub_808EB08: @ 808EB08 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - adds r4, r1, 0 - adds r5, r2, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - ldrb r1, [r6, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r7, r0, r1 - ldrb r0, [r6, 0x5] - bl GetFieldObjectGraphicsInfo - mov r8, r0 - lsls r4, 16 - asrs r4, 16 - lsls r5, 16 - asrs r5, 16 - adds r0, r6, 0 - adds r1, r4, 0 - adds r2, r5, 0 - bl npc_coords_set - movs r1, 0x10 - ldrsh r0, [r6, r1] - movs r2, 0x12 - ldrsh r1, [r6, r2] - adds r2, r7, 0 - adds r2, 0x20 - adds r3, r7, 0 - adds r3, 0x22 - bl sub_8093038 - mov r1, r8 - ldrh r0, [r1, 0x8] - lsls r0, 16 - asrs r0, 17 - negs r0, r0 - adds r1, r7, 0 - adds r1, 0x28 - strb r0, [r1] - mov r2, r8 - ldrh r0, [r2, 0xA] - lsls r0, 16 - asrs r0, 17 - negs r0, r0 - adds r2, r7, 0 - adds r2, 0x29 - strb r0, [r2] - ldrh r0, [r7, 0x20] - adds r0, 0x8 - strh r0, [r7, 0x20] - ldrh r1, [r7, 0x22] - adds r1, 0x10 - movs r0, 0 - ldrsb r0, [r2, r0] - adds r0, r1 - strh r0, [r7, 0x22] - adds r0, r6, 0 - bl sub_808E38C - ldrb r0, [r6, 0x1] - lsrs r0, 7 - cmp r0, 0 - beq _0808EB9A - bl CameraObjectReset1 -_0808EB9A: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808EB08 - - thumb_func_start sub_808EBA8 -sub_808EBA8: @ 808EBA8 - push {r4,r5,lr} - sub sp, 0x4 - ldr r4, [sp, 0x10] - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 16 - lsrs r5, r3, 16 - lsls r4, 16 - lsrs r4, 16 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _0808EBF0 - lsls r1, r5, 16 - lsls r2, r4, 16 - mov r0, sp - ldrb r3, [r0] - lsls r0, r3, 3 - adds r0, r3 - lsls r0, 2 - ldr r3, =0x02037350 - adds r0, r3 - movs r3, 0xE0 - lsls r3, 11 - adds r1, r3 - asrs r1, 16 - adds r2, r3 - asrs r2, 16 - bl sub_808EB08 -_0808EBF0: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808EBA8 - - thumb_func_start npc_coords_shift_still -@ void npc_coords_shift_still(struct npc_state *fieldObject) -npc_coords_shift_still: @ 808EBFC - push {lr} - movs r2, 0x10 - ldrsh r1, [r0, r2] - movs r3, 0x12 - ldrsh r2, [r0, r3] - bl npc_coords_shift - pop {r0} - bx r0 - thumb_func_end npc_coords_shift_still - - thumb_func_start UpdateFieldObjectCoordsForCameraUpdate -@ void UpdateFieldObjectCoordsForCameraUpdate() -UpdateFieldObjectCoordsForCameraUpdate: @ 808EC10 - push {r4,r5,lr} - ldr r2, =0x02037334 - ldrb r1, [r2] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0808EC68 - movs r3, 0 - ldr r5, =0x02037350 - movs r0, 0x4 - ldrsh r4, [r2, r0] - movs r0, 0x8 - ldrsh r1, [r2, r0] -_0808EC2A: - lsls r0, r3, 3 - adds r0, r3 - lsls r0, 2 - adds r2, r0, r5 - ldrb r0, [r2] - lsls r0, 31 - cmp r0, 0 - beq _0808EC5E - ldrh r0, [r2, 0xC] - subs r0, r4 - strh r0, [r2, 0xC] - ldrh r0, [r2, 0xE] - subs r0, r1 - strh r0, [r2, 0xE] - ldrh r0, [r2, 0x10] - subs r0, r4 - strh r0, [r2, 0x10] - ldrh r0, [r2, 0x12] - subs r0, r1 - strh r0, [r2, 0x12] - ldrh r0, [r2, 0x14] - subs r0, r4 - strh r0, [r2, 0x14] - ldrh r0, [r2, 0x16] - subs r0, r1 - strh r0, [r2, 0x16] -_0808EC5E: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0xF - bls _0808EC2A -_0808EC68: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end UpdateFieldObjectCoordsForCameraUpdate - - thumb_func_start GetFieldObjectIdByXYZ -@ u8 GetFieldObjectIdByXYZ(u16 x, u16 y, u8 z) -GetFieldObjectIdByXYZ: @ 808EC78 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 16 - lsrs r7, r0, 16 - lsls r1, 16 - lsrs r6, r1, 16 - lsls r2, 24 - lsrs r5, r2, 24 - movs r4, 0 - ldr r0, =0x02037350 - mov r8, r0 -_0808EC90: - lsls r0, r4, 3 - adds r0, r4 - lsls r0, 2 - mov r2, r8 - adds r1, r0, r2 - ldrb r0, [r1] - lsls r0, 31 - cmp r0, 0 - beq _0808ECC8 - movs r2, 0x10 - ldrsh r0, [r1, r2] - cmp r0, r7 - bne _0808ECC8 - movs r2, 0x12 - ldrsh r0, [r1, r2] - cmp r0, r6 - bne _0808ECC8 - adds r0, r1, 0 - adds r1, r5, 0 - bl FieldObjectDoesZCoordMatch - lsls r0, 24 - cmp r0, 0 - beq _0808ECC8 - adds r0, r4, 0 - b _0808ECD4 - .pool -_0808ECC8: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _0808EC90 - movs r0, 0x10 -_0808ECD4: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end GetFieldObjectIdByXYZ - - thumb_func_start FieldObjectDoesZCoordMatch -@ bool8 FieldObjectDoesZCoordMatch(struct npc_state *fieldObject) -FieldObjectDoesZCoordMatch: @ 808ECE0 - push {lr} - lsls r1, 24 - lsrs r1, 24 - ldrb r2, [r0, 0xB] - movs r0, 0xF - ands r0, r2 - cmp r0, 0 - beq _0808ED00 - cmp r1, 0 - beq _0808ED00 - lsls r0, r2, 28 - lsrs r0, 28 - cmp r0, r1 - beq _0808ED00 - movs r0, 0 - b _0808ED02 -_0808ED00: - movs r0, 0x1 -_0808ED02: - pop {r1} - bx r1 - thumb_func_end FieldObjectDoesZCoordMatch - - thumb_func_start UpdateFieldObjectsForCameraUpdate -@ void UpdateFieldObjectsForCameraUpdate(u16 movingCameraOffsetX, u16 movingCameraOffsetY) -UpdateFieldObjectsForCameraUpdate: @ 808ED08 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - bl UpdateFieldObjectCoordsForCameraUpdate - lsls r4, 16 - asrs r4, 16 - lsls r5, 16 - asrs r5, 16 - adds r0, r4, 0 - adds r1, r5, 0 - bl SpawnFieldObjectsInView - bl RemoveFieldObjectsOutsideView - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end UpdateFieldObjectsForCameraUpdate - - thumb_func_start AddCameraObject -@ u8 AddCameraObject(u8 followedObjectId) -AddCameraObject: @ 808ED34 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_084975D4 - movs r1, 0 - movs r2, 0 - movs r3, 0x4 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r2, 0x3E - adds r2, r1 - mov r12, r2 - ldrb r2, [r2] - movs r3, 0x4 - orrs r2, r3 - mov r3, r12 - strb r2, [r3] - strh r4, [r1, 0x2E] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end AddCameraObject - - thumb_func_start ObjectCB_CameraObject -@ void ObjectCB_CameraObject(struct obj *object) -ObjectCB_CameraObject: @ 808ED78 - push {r4,r5,lr} - sub sp, 0xC - mov r2, sp - ldr r1, =gUnknown_084975EC - ldm r1!, {r3-r5} - stm r2!, {r3-r5} - movs r2, 0x30 - ldrsh r1, [r0, r2] - lsls r1, 2 - add r1, sp - ldr r1, [r1] - bl _call_via_r1 - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ObjectCB_CameraObject - - thumb_func_start CameraObject_0 -@ void CameraObject_0(struct obj *object) -CameraObject_0: @ 808EDA0 - push {lr} - ldr r3, =0x02020630 - movs r1, 0x2E - ldrsh r2, [r0, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r3 - ldrh r1, [r1, 0x20] - strh r1, [r0, 0x20] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r3 - ldrh r1, [r1, 0x22] - strh r1, [r0, 0x22] - adds r3, r0, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r3] - movs r1, 0x1 - strh r1, [r0, 0x30] - bl CameraObject_1 - pop {r0} - bx r0 - .pool - thumb_func_end CameraObject_0 - - thumb_func_start CameraObject_1 -@ void CameraObject_1(struct obj *object) -CameraObject_1: @ 808EDDC - push {r4,r5,lr} - ldr r3, =0x02020630 - movs r1, 0x2E - ldrsh r2, [r0, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r3 - ldrh r3, [r1, 0x22] - ldrh r2, [r0, 0x20] - ldrh r4, [r1, 0x20] - movs r5, 0x20 - ldrsh r1, [r1, r5] - subs r1, r2 - strh r1, [r0, 0x32] - ldrh r2, [r0, 0x22] - lsls r1, r3, 16 - asrs r1, 16 - subs r1, r2 - strh r1, [r0, 0x34] - strh r4, [r0, 0x20] - strh r3, [r0, 0x22] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end CameraObject_1 - - thumb_func_start CameraObject_2 -@ void CameraObject_2(struct obj *object) -CameraObject_2: @ 808EE14 - push {r4,lr} - ldr r4, =0x02020630 - movs r1, 0x2E - ldrsh r2, [r0, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - ldrh r1, [r1, 0x20] - movs r3, 0 - strh r1, [r0, 0x20] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - ldrh r1, [r1, 0x22] - strh r1, [r0, 0x22] - strh r3, [r0, 0x32] - strh r3, [r0, 0x34] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end CameraObject_2 - - thumb_func_start FindCameraObject -@ struct obj *FindCameraObject() -FindCameraObject: @ 808EE44 - push {r4,r5,lr} - movs r3, 0 - ldr r4, =0x02020630 - adds r5, r4, 0 - adds r5, 0x1C -_0808EE4E: - lsls r0, r3, 4 - adds r0, r3 - lsls r1, r0, 2 - adds r2, r1, r4 - adds r0, r2, 0 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 31 - cmp r0, 0 - beq _0808EE78 - adds r0, r1, r5 - ldr r1, [r0] - ldr r0, =ObjectCB_CameraObject - cmp r1, r0 - bne _0808EE78 - adds r0, r2, 0 - b _0808EE84 - .pool -_0808EE78: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x3F - bls _0808EE4E - movs r0, 0 -_0808EE84: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end FindCameraObject - - thumb_func_start CameraObjectReset1 -@ void CameraObjectReset1() -CameraObjectReset1: @ 808EE8C - push {lr} - bl FindCameraObject - adds r2, r0, 0 - cmp r2, 0 - beq _0808EEA4 - movs r0, 0 - strh r0, [r2, 0x30] - ldr r1, [r2, 0x1C] - adds r0, r2, 0 - bl _call_via_r1 -_0808EEA4: - pop {r0} - bx r0 - thumb_func_end CameraObjectReset1 - - thumb_func_start CameraObjectSetFollowedObjectId -@ void CameraObjectSetFollowedObjectId(u8 objectId) -CameraObjectSetFollowedObjectId: @ 808EEA8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl FindCameraObject - cmp r0, 0 - beq _0808EEBC - strh r4, [r0, 0x2E] - bl CameraObjectReset1 -_0808EEBC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end CameraObjectSetFollowedObjectId - - thumb_func_start CameraObjectGetFollowedObjectId -@ u8 CameraObjectGetFollowedObjectId() -CameraObjectGetFollowedObjectId: @ 808EEC4 - push {lr} - bl FindCameraObject - cmp r0, 0 - beq _0808EED6 - ldrh r0, [r0, 0x2E] - lsls r0, 24 - lsrs r0, 24 - b _0808EED8 -_0808EED6: - movs r0, 0x40 -_0808EED8: - pop {r1} - bx r1 - thumb_func_end CameraObjectGetFollowedObjectId - - thumb_func_start CameraObjectReset2 -@ void CameraObjectReset2() -CameraObjectReset2: @ 808EEDC - push {lr} - bl FindCameraObject - movs r1, 0x2 - strh r1, [r0, 0x30] - pop {r0} - bx r0 - thumb_func_end CameraObjectReset2 - - thumb_func_start sub_808EEEC -sub_808EEEC: @ 808EEEC - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r12, r0 - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - lsls r2, 16 - lsrs r6, r2, 16 - lsls r3, 24 - lsrs r7, r3, 24 - movs r5, 0 - ldr r1, =0x02020630 -_0808EF06: - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r4, r0, r1 - adds r0, r4, 0 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 31 - cmp r0, 0 - bne _0808EF38 - adds r0, r4, 0 - mov r1, r12 - movs r2, 0x44 - bl memcpy - mov r0, r8 - strh r0, [r4, 0x20] - strh r6, [r4, 0x22] - adds r0, r4, 0 - adds r0, 0x43 - strb r7, [r0] - b _0808EF42 - .pool -_0808EF38: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3F - bls _0808EF06 -_0808EF42: - adds r0, r5, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_808EEEC - - thumb_func_start obj_unfreeze -obj_unfreeze: @ 808EF50 - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r12, r0 - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - lsls r2, 16 - lsrs r6, r2, 16 - lsls r3, 24 - lsrs r7, r3, 24 - movs r5, 0x3F - ldr r3, =0x02020630 - movs r2, 0x1 - negs r2, r2 -_0808EF6E: - lsls r0, r5, 16 - asrs r1, r0, 16 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, r0, r3 - adds r0, r4, 0 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 31 - cmp r0, 0 - bne _0808EFA8 - adds r0, r4, 0 - mov r1, r12 - movs r2, 0x44 - bl memcpy - mov r0, r8 - strh r0, [r4, 0x20] - strh r6, [r4, 0x22] - adds r0, r4, 0 - adds r0, 0x43 - strb r7, [r0] - lsls r0, r5, 24 - lsrs r0, 24 - b _0808EFB6 - .pool -_0808EFA8: - subs r0, r1, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - asrs r0, 16 - cmp r0, r2 - bgt _0808EF6E - movs r0, 0x40 -_0808EFB6: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end obj_unfreeze - - thumb_func_start FieldObjectSetDirection -@ void FieldObjectSetDirection(struct npc_state *fieldObject, u8 direction) -FieldObjectSetDirection: @ 808EFC0 - push {r4,lr} - adds r3, r0, 0 - lsls r1, 24 - lsrs r2, r1, 24 - adds r4, r2, 0 - ldrb r0, [r3, 0x18] - lsls r0, 28 - lsrs r0, 28 - adds r1, r3, 0 - adds r1, 0x20 - strb r0, [r1] - ldrb r0, [r3, 0x1] - lsls r0, 30 - cmp r0, 0 - blt _0808EFF0 - movs r0, 0xF - adds r1, r2, 0 - ands r1, r0 - ldrb r2, [r3, 0x18] - movs r0, 0x10 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x18] -_0808EFF0: - lsls r2, r4, 4 - ldrb r1, [r3, 0x18] - movs r0, 0xF - ands r0, r1 - orrs r0, r2 - strb r0, [r3, 0x18] - pop {r4} - pop {r0} - bx r0 - thumb_func_end FieldObjectSetDirection - - thumb_func_start GetFieldObjectScriptPointerByLocalIdAndMap -@ u32 GetFieldObjectScriptPointerByLocalIdAndMap(u8 localId, u8 mapId, u8 mapGroupId) -GetFieldObjectScriptPointerByLocalIdAndMap: @ 808F004 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - bl GetFieldObjectTemplateByLocalIdAndMap - ldr r0, [r0, 0x10] - pop {r1} - bx r1 - thumb_func_end GetFieldObjectScriptPointerByLocalIdAndMap - - thumb_func_start GetFieldObjectScriptPointerByFieldObjectId -@ u32 GetFieldObjectScriptPointerByFieldObjectId(u8 fieldObjectId) -GetFieldObjectScriptPointerByFieldObjectId: @ 808F01C - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02037350 - lsls r2, r0, 3 - adds r2, r0 - lsls r2, 2 - adds r2, r1 - ldrb r0, [r2, 0x8] - ldrb r1, [r2, 0x9] - ldrb r2, [r2, 0xA] - bl GetFieldObjectScriptPointerByLocalIdAndMap - pop {r1} - bx r1 - .pool - thumb_func_end GetFieldObjectScriptPointerByFieldObjectId - - thumb_func_start GetFieldObjectFlagIdByLocalIdAndMap -@ u16 GetFieldObjectFlagIdByLocalIdAndMap(u8 localId, u8 mapId, u8 mapGroupId) -GetFieldObjectFlagIdByLocalIdAndMap: @ 808F040 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - bl GetFieldObjectTemplateByLocalIdAndMap - ldrh r0, [r0, 0x14] - pop {r1} - bx r1 - thumb_func_end GetFieldObjectFlagIdByLocalIdAndMap - - thumb_func_start GetFieldObjectFlagIdByFieldObjectId -@ u16 GetFieldObjectFlagIdByFieldObjectId(u8 fieldObjectId) -GetFieldObjectFlagIdByFieldObjectId: @ 808F058 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02037350 - lsls r2, r0, 3 - adds r2, r0 - lsls r2, 2 - adds r2, r1 - ldrb r0, [r2, 0x8] - ldrb r1, [r2, 0x9] - ldrb r2, [r2, 0xA] - bl GetFieldObjectFlagIdByLocalIdAndMap - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - .pool - thumb_func_end GetFieldObjectFlagIdByFieldObjectId - - thumb_func_start sub_808F080 -sub_808F080: @ 808F080 - push {lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _0808F0B4 - ldr r2, =0x02037350 - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x7] - b _0808F0B6 - .pool -_0808F0B4: - movs r0, 0xFF -_0808F0B6: - add sp, 0x4 - pop {r1} - bx r1 - thumb_func_end sub_808F080 - - thumb_func_start sub_808F0BC -sub_808F0BC: @ 808F0BC - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02037350 - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r0, [r1, 0x7] - bx lr - .pool - thumb_func_end sub_808F0BC - - thumb_func_start sub_808F0D4 -sub_808F0D4: @ 808F0D4 - push {lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _0808F108 - ldr r2, =0x02037350 - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1D] - b _0808F10A - .pool -_0808F108: - movs r0, 0xFF -_0808F10A: - add sp, 0x4 - pop {r1} - bx r1 - thumb_func_end sub_808F0D4 - - thumb_func_start FieldObjectGetBerryTreeId -@ u8 FieldObjectGetBerryTreeId(u8 fieldObjectId) -FieldObjectGetBerryTreeId: @ 808F110 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02037350 - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r0, [r1, 0x1D] - bx lr - .pool - thumb_func_end FieldObjectGetBerryTreeId - - thumb_func_start GetFieldObjectTemplateByLocalIdAndMap -@ struct FieldObjectTemplate *GetFieldObjectTemplateByLocalIdAndMap(u8 localId, u8 mapId, u8 mapGroupId) -GetFieldObjectTemplateByLocalIdAndMap: @ 808F128 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r3, r1, 24 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =0x03005d8c - ldr r1, [r0] - movs r0, 0x5 - ldrsb r0, [r1, r0] - cmp r0, r3 - bne _0808F160 - movs r0, 0x4 - ldrsb r0, [r1, r0] - cmp r0, r2 - bne _0808F160 - movs r0, 0xC7 - lsls r0, 4 - adds r1, r0 - ldr r0, =0x02037318 - ldr r0, [r0, 0x4] - b _0808F16C - .pool -_0808F160: - adds r0, r2, 0 - adds r1, r3, 0 - bl get_mapheader_by_bank_and_number - ldr r0, [r0, 0x4] - ldr r1, [r0, 0x4] -_0808F16C: - ldrb r2, [r0] - adds r0, r4, 0 - bl FindFieldObjectTemplateInArrayByLocalId - pop {r4} - pop {r1} - bx r1 - thumb_func_end GetFieldObjectTemplateByLocalIdAndMap - - thumb_func_start FindFieldObjectTemplateInArrayByLocalId -@ struct FieldObjectTemplate *FindFieldObjectTemplateInArrayByLocalId(u8 localId, struct FieldObjectTemplate *templates, u8 numTemplates) -FindFieldObjectTemplateInArrayByLocalId: @ 808F17C - push {r4,r5,lr} - adds r5, r1, 0 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r2, 24 - lsrs r2, 24 - movs r1, 0 - cmp r1, r2 - bcs _0808F1AA -_0808F18E: - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r3, r0, r5 - ldrb r0, [r3] - cmp r0, r4 - bne _0808F1A0 - adds r0, r3, 0 - b _0808F1AC -_0808F1A0: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, r2 - bcc _0808F18E -_0808F1AA: - movs r0, 0 -_0808F1AC: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end FindFieldObjectTemplateInArrayByLocalId - - thumb_func_start sub_808F1B4 -@ int sub_808F1B4(struct npc_state *fieldObject) -sub_808F1B4: @ 808F1B4 - push {r4,r5,lr} - adds r3, r0, 0 - ldrb r0, [r3, 0x9] - ldr r1, =0x03005d8c - ldr r2, [r1] - movs r1, 0x5 - ldrsb r1, [r2, r1] - cmp r0, r1 - bne _0808F200 - ldrb r1, [r3, 0xA] - movs r0, 0x4 - ldrsb r0, [r2, r0] - cmp r1, r0 - beq _0808F1E2 - b _0808F200 - .pool -_0808F1D8: - movs r1, 0xC7 - lsls r1, 4 - adds r0, r1 - adds r0, r4, r0 - b _0808F202 -_0808F1E2: - movs r1, 0 - adds r4, r2, 0 - ldrb r3, [r3, 0x8] - movs r5, 0xC7 - lsls r5, 4 - adds r2, r4, r5 - movs r0, 0 -_0808F1F0: - ldrb r5, [r2] - cmp r3, r5 - beq _0808F1D8 - adds r2, 0x18 - adds r0, 0x18 - adds r1, 0x1 - cmp r1, 0x3F - ble _0808F1F0 -_0808F200: - movs r0, 0 -_0808F202: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_808F1B4 - - thumb_func_start sub_808F208 -@ void sub_808F208(struct npc_state *fieldObject) -sub_808F208: @ 808F208 - push {r4,lr} - adds r4, r0, 0 - bl sub_808F1B4 - adds r1, r0, 0 - cmp r1, 0 - beq _0808F222 - ldrh r0, [r4, 0x10] - subs r0, 0x7 - strh r0, [r1, 0x4] - ldrh r0, [r4, 0x12] - subs r0, 0x7 - strh r0, [r1, 0x6] -_0808F222: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_808F208 - - thumb_func_start sub_808F228 -sub_808F228: @ 808F228 - push {r4,lr} - adds r4, r1, 0 - bl sub_808F1B4 - cmp r0, 0 - beq _0808F236 - str r4, [r0, 0x10] -_0808F236: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_808F228 - - thumb_func_start sub_808F23C -sub_808F23C: @ 808F23C - push {r4,lr} - lsls r1, 24 - lsrs r4, r1, 24 - bl sub_808F1B4 - cmp r0, 0 - beq _0808F24C - strb r4, [r0, 0x9] -_0808F24C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_808F23C - - thumb_func_start sub_808F254 -@ void sub_808F254(u8 localId, u8 mapId, u8 mapGroupId) -sub_808F254: @ 808F254 - push {lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _0808F282 - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - bl sub_808F208 -_0808F282: - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_808F254 - - thumb_func_start sub_808F28C -sub_808F28C: @ 808F28C - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r4, r3, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _0808F2E8 - cmp r4, 0x6 - beq _0808F2B6 - cmp r4, 0x7 - beq _0808F2D4 - b _0808F2E8 -_0808F2B6: - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - ldr r1, =gUnknown_082766A2 - bl sub_808F228 - b _0808F2E8 - .pool -_0808F2D4: - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - ldr r1, =gUnknown_082766A6 - bl sub_808F228 -_0808F2E8: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808F28C - - thumb_func_start npc_paltag_set_load -npc_paltag_set_load: @ 808F2F8 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl gpu_pal_allocator_reset__manage_upper_four - ldr r1, =0x020375b6 - ldr r2, =0x000011ff - adds r0, r2, 0 - strh r0, [r1] - ldr r2, =0x020375b4 - strb r4, [r2] - cmp r4, 0x1 - bne _0808F344 - ldr r1, =gUnknown_0850BE38 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0 - movs r2, 0x6 - bl pal_patch_for_npc_range - ldr r1, =0x0300301c - movs r0, 0x8 - strb r0, [r1] - b _0808F356 - .pool -_0808F344: - ldr r0, =gUnknown_0850BE38 - ldrb r1, [r2] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - movs r1, 0 - movs r2, 0xA - bl pal_patch_for_npc_range -_0808F356: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end npc_paltag_set_load - - thumb_func_start npc_paltag_by_palslot -npc_paltag_by_palslot: @ 808F360 - push {r4-r6,lr} - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x9 - bhi _0808F39C - ldr r1, =gUnknown_0850BE38 - ldr r0, =0x020375b4 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - lsls r0, r2, 1 - b _0808F390 - .pool -_0808F384: - adds r1, r4, 0x4 - adds r1, r2, r1 - ldr r0, =0x020375b4 - ldrb r0, [r0] - ldr r1, [r1] - lsls r0, 1 -_0808F390: - adds r0, r1 - ldrh r0, [r0] - b _0808F3CE - .pool -_0808F39C: - movs r3, 0 - ldr r0, =gUnknown_0850BD78 - ldrh r1, [r0] - ldr r2, =0x000011ff - adds r4, r0, 0 - cmp r1, r2 - beq _0808F3CC - adds r6, r4, 0 - ldr r0, =0x020375b6 - ldrh r1, [r0] - adds r5, r2, 0 -_0808F3B2: - lsls r2, r3, 3 - adds r0, r2, r6 - ldrh r0, [r0] - cmp r0, r1 - beq _0808F384 - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - lsls r0, r3, 3 - adds r0, r4 - ldrh r0, [r0] - cmp r0, r5 - bne _0808F3B2 -_0808F3CC: - ldr r0, =0x000011ff -_0808F3CE: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end npc_paltag_by_palslot - - thumb_func_start FieldObjectCB_NoMovement1 -FieldObjectCB_NoMovement1: @ 808F3E0 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =FieldObjectCB2_NoMovement1 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_NoMovement1 - - thumb_func_start FieldObjectCB2_NoMovement1 -FieldObjectCB2_NoMovement1: @ 808F404 - movs r0, 0 - bx lr - thumb_func_end FieldObjectCB2_NoMovement1 - - thumb_func_start FieldObjectCB_GoRandomDirections -FieldObjectCB_GoRandomDirections: @ 808F408 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =FieldObjectCB2_GoRandomDirections - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoRandomDirections - - thumb_func_start FieldObjectCB2_GoRandomDirections -FieldObjectCB2_GoRandomDirections: @ 808F42C - push {r4,lr} - ldr r3, =gUnknown_0850D6F4 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end FieldObjectCB2_GoRandomDirections - - thumb_func_start sub_808F44C -sub_808F44C: @ 808F44C - push {r4,lr} - adds r4, r1, 0 - bl npc_reset - movs r0, 0x1 - strh r0, [r4, 0x30] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_808F44C - - thumb_func_start sub_808F460 -sub_808F460: @ 808F460 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_808F460 - - thumb_func_start sub_808F48C -sub_808F48C: @ 808F48C - push {r4-r6,lr} - adds r6, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _0808F4C0 - ldr r5, =gUnknown_0850D6DC - bl GenerateRandomNumber - movs r4, 0x3 - adds r1, r4, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r5 - movs r0, 0 - ldrsh r1, [r1, r0] - adds r0, r6, 0 - bl sub_8097978 - strh r4, [r6, 0x30] - movs r0, 0x1 - b _0808F4C2 - .pool -_0808F4C0: - movs r0, 0 -_0808F4C2: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_808F48C - - thumb_func_start sub_808F4C8 -sub_808F4C8: @ 808F4C8 - push {r4,lr} - adds r4, r1, 0 - adds r0, r4, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - bne _0808F4DC - movs r0, 0 - b _0808F4E2 -_0808F4DC: - movs r0, 0x4 - strh r0, [r4, 0x30] - movs r0, 0x1 -_0808F4E2: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_808F4C8 - - thumb_func_start sub_808F4E8 -sub_808F4E8: @ 808F4E8 - push {r4-r6,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r6, r1, 0 - ldr r1, =gUnknown_0850D710 - mov r0, sp - movs r2, 0x4 - bl memcpy - bl GenerateRandomNumber - movs r1, 0x3 - ands r1, r0 - mov r2, sp - adds r0, r2, r1 - ldrb r4, [r0] - adds r0, r5, 0 - adds r1, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x5 - strh r0, [r6, 0x30] - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8092B88 - lsls r0, 24 - cmp r0, 0 - beq _0808F526 - movs r0, 0x1 - strh r0, [r6, 0x30] -_0808F526: - movs r0, 0x1 - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_808F4E8 - - thumb_func_start sub_808F534 -sub_808F534: @ 808F534 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsrs r0, 4 - bl GetGoSpeed0AnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - ldrb r0, [r4] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] - movs r0, 0x6 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_808F534 - - thumb_func_start sub_808F564 -sub_808F564: @ 808F564 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _0808F582 - ldrb r0, [r4] - movs r1, 0x3 - negs r1, r1 - ands r1, r0 - strb r1, [r4] - movs r0, 0x1 - strh r0, [r5, 0x30] -_0808F582: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_808F564 - - thumb_func_start FieldObjectIsTrainerAndCloseToPlayer -@ bool8 FieldObjectIsTrainerAndCloseToPlayer(struct npc_state *fieldObject) -FieldObjectIsTrainerAndCloseToPlayer: @ 808F58C - push {r4-r7,lr} - sub sp, 0x4 - adds r5, r0, 0 - movs r0, 0x80 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _0808F5F8 - ldrb r0, [r5, 0x7] - cmp r0, 0x1 - beq _0808F5A8 - cmp r0, 0x3 - bne _0808F5F8 -_0808F5A8: - mov r7, sp - adds r7, 0x2 - mov r0, sp - adds r1, r7, 0 - bl PlayerGetDestCoords - ldrh r2, [r5, 0x10] - ldrh r4, [r5, 0x12] - ldrb r1, [r5, 0x1D] - subs r3, r2, r1 - subs r0, r4, r1 - lsls r0, 16 - lsrs r5, r0, 16 - adds r2, r1, r2 - lsls r2, 16 - lsrs r2, 16 - adds r1, r4 - lsls r1, 16 - lsrs r6, r1, 16 - mov r0, sp - lsls r3, 16 - asrs r3, 16 - movs r1, 0 - ldrsh r4, [r0, r1] - cmp r3, r4 - bgt _0808F5F8 - lsls r0, r2, 16 - asrs r0, 16 - cmp r0, r4 - blt _0808F5F8 - lsls r0, r5, 16 - asrs r0, 16 - movs r2, 0 - ldrsh r1, [r7, r2] - cmp r0, r1 - bgt _0808F5F8 - lsls r0, r6, 16 - asrs r0, 16 - cmp r0, r1 - bge _0808F5FC -_0808F5F8: - movs r0, 0 - b _0808F5FE -_0808F5FC: - movs r0, 0x1 -_0808F5FE: - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end FieldObjectIsTrainerAndCloseToPlayer - - thumb_func_start sub_808F608 -sub_808F608: @ 808F608 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - lsls r1, 16 - lsrs r0, r1, 16 - lsls r2, 16 - lsls r3, 16 - cmp r2, r3 - ble _0808F626 - movs r2, 0x4 - lsls r0, r4, 16 - cmp r0, 0 - bge _0808F630 - movs r2, 0x3 - b _0808F630 -_0808F626: - movs r2, 0x1 - lsls r0, 16 - cmp r0, 0 - bge _0808F630 - movs r2, 0x2 -_0808F630: - adds r0, r2, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_808F608 - - thumb_func_start sub_808F638 -sub_808F638: @ 808F638 - push {lr} - movs r0, 0x1 - lsls r1, 16 - cmp r1, 0 - bge _0808F644 - movs r0, 0x2 -_0808F644: - pop {r1} - bx r1 - thumb_func_end sub_808F638 - - thumb_func_start sub_808F648 -sub_808F648: @ 808F648 - push {lr} - movs r1, 0x4 - lsls r0, 16 - cmp r0, 0 - bge _0808F654 - movs r1, 0x3 -_0808F654: - adds r0, r1, 0 - pop {r1} - bx r1 - thumb_func_end sub_808F648 - - thumb_func_start sub_808F65C -sub_808F65C: @ 808F65C - push {r4-r7,lr} - lsls r0, 16 - asrs r4, r0, 16 - lsls r1, 16 - asrs r5, r1, 16 - lsls r2, 16 - asrs r6, r2, 16 - lsls r3, 16 - asrs r7, r3, 16 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - adds r3, r7, 0 - bl sub_808F608 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0808F698 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - adds r3, r7, 0 - bl sub_808F648 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bne _0808F6B2 - b _0808F6B0 -_0808F698: - cmp r0, 0x4 - bne _0808F6B2 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - adds r3, r7, 0 - bl sub_808F638 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0808F6B2 -_0808F6B0: - movs r0, 0x2 -_0808F6B2: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_808F65C - - thumb_func_start sub_808F6B8 -sub_808F6B8: @ 808F6B8 - push {r4-r7,lr} - lsls r0, 16 - asrs r4, r0, 16 - lsls r1, 16 - asrs r5, r1, 16 - lsls r2, 16 - asrs r6, r2, 16 - lsls r3, 16 - asrs r7, r3, 16 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - adds r3, r7, 0 - bl sub_808F608 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0808F6F4 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - adds r3, r7, 0 - bl sub_808F648 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _0808F70E - b _0808F70C -_0808F6F4: - cmp r0, 0x3 - bne _0808F70E - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - adds r3, r7, 0 - bl sub_808F638 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0808F70E -_0808F70C: - movs r0, 0x2 -_0808F70E: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_808F6B8 - - thumb_func_start sub_808F714 -sub_808F714: @ 808F714 - push {r4-r7,lr} - lsls r0, 16 - asrs r4, r0, 16 - lsls r1, 16 - asrs r5, r1, 16 - lsls r2, 16 - asrs r6, r2, 16 - lsls r3, 16 - asrs r7, r3, 16 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - adds r3, r7, 0 - bl sub_808F608 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _0808F750 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - adds r3, r7, 0 - bl sub_808F648 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bne _0808F76A - b _0808F768 -_0808F750: - cmp r0, 0x4 - bne _0808F76A - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - adds r3, r7, 0 - bl sub_808F638 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _0808F76A -_0808F768: - movs r0, 0x1 -_0808F76A: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_808F714 - - thumb_func_start sub_808F770 -sub_808F770: @ 808F770 - push {r4-r7,lr} - lsls r0, 16 - asrs r4, r0, 16 - lsls r1, 16 - asrs r5, r1, 16 - lsls r2, 16 - asrs r6, r2, 16 - lsls r3, 16 - asrs r7, r3, 16 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - adds r3, r7, 0 - bl sub_808F608 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _0808F7AC - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - adds r3, r7, 0 - bl sub_808F648 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _0808F7C6 - b _0808F7C4 -_0808F7AC: - cmp r0, 0x3 - bne _0808F7C6 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - adds r3, r7, 0 - bl sub_808F638 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _0808F7C6 -_0808F7C4: - movs r0, 0x1 -_0808F7C6: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_808F770 - - thumb_func_start sub_808F7CC -sub_808F7CC: @ 808F7CC - push {r4-r7,lr} - lsls r0, 16 - asrs r7, r0, 16 - lsls r1, 16 - asrs r6, r1, 16 - lsls r2, 16 - asrs r5, r2, 16 - lsls r3, 16 - asrs r4, r3, 16 - adds r0, r7, 0 - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_808F608 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bne _0808F802 - adds r0, r7, 0 - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_808F638 - lsls r0, 24 - lsrs r0, 24 -_0808F802: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_808F7CC - - thumb_func_start sub_808F808 -sub_808F808: @ 808F808 - push {r4-r7,lr} - lsls r0, 16 - asrs r7, r0, 16 - lsls r1, 16 - asrs r6, r1, 16 - lsls r2, 16 - asrs r5, r2, 16 - lsls r3, 16 - asrs r4, r3, 16 - adds r0, r7, 0 - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_808F608 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _0808F83E - adds r0, r7, 0 - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_808F638 - lsls r0, 24 - lsrs r0, 24 -_0808F83E: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_808F808 - - thumb_func_start sub_808F844 -sub_808F844: @ 808F844 - push {r4-r7,lr} - lsls r0, 16 - asrs r7, r0, 16 - lsls r1, 16 - asrs r6, r1, 16 - lsls r2, 16 - asrs r5, r2, 16 - lsls r3, 16 - asrs r4, r3, 16 - adds r0, r7, 0 - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_808F608 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0808F87A - adds r0, r7, 0 - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_808F648 - lsls r0, 24 - lsrs r0, 24 -_0808F87A: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_808F844 - - thumb_func_start sub_808F880 -sub_808F880: @ 808F880 - push {r4-r7,lr} - lsls r0, 16 - asrs r7, r0, 16 - lsls r1, 16 - asrs r6, r1, 16 - lsls r2, 16 - asrs r5, r2, 16 - lsls r3, 16 - asrs r4, r3, 16 - adds r0, r7, 0 - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_808F608 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _0808F8B6 - adds r0, r7, 0 - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_808F648 - lsls r0, 24 - lsrs r0, 24 -_0808F8B6: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_808F880 - - thumb_func_start sub_808F8BC -sub_808F8BC: @ 808F8BC - push {r4-r6,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r1, 24 - lsrs r6, r1, 24 - bl FieldObjectIsTrainerAndCloseToPlayer - lsls r0, 24 - cmp r0, 0 - bne _0808F8D4 - movs r0, 0 - b _0808F938 -_0808F8D4: - mov r5, sp - adds r5, 0x2 - mov r0, sp - adds r1, r5, 0 - bl PlayerGetDestCoords - mov r2, sp - mov r0, sp - ldrh r0, [r0] - ldrh r1, [r4, 0x10] - subs r0, r1 - strh r0, [r2] - ldrh r0, [r5] - ldrh r1, [r4, 0x12] - subs r0, r1 - strh r0, [r5] - mov r0, sp - ldrh r3, [r5] - ldrh r2, [r0] - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bge _0808F908 - negs r0, r0 - lsls r0, 16 - lsrs r2, r0, 16 -_0808F908: - lsls r0, r3, 16 - asrs r0, 16 - cmp r0, 0 - bge _0808F916 - negs r0, r0 - lsls r0, 16 - lsrs r3, r0, 16 -_0808F916: - ldr r0, =gUnknown_0850D714 - lsls r4, r6, 2 - adds r4, r0 - mov r0, sp - movs r6, 0 - ldrsh r0, [r0, r6] - movs r6, 0 - ldrsh r1, [r5, r6] - lsls r2, 16 - asrs r2, 16 - lsls r3, 16 - asrs r3, 16 - ldr r4, [r4] - bl _call_via_r4 - lsls r0, 24 - lsrs r0, 24 -_0808F938: - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_808F8BC - - thumb_func_start FieldObjectCB_LookRandomDirections -FieldObjectCB_LookRandomDirections: @ 808F944 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =FieldObjectCB2_LookRandomDirections - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_LookRandomDirections - - thumb_func_start FieldObjectCB2_LookRandomDirections -@ bool8 FieldObjectCB2_LookRandomDirections(struct npc_state *fieldObject, struct obj *object) -FieldObjectCB2_LookRandomDirections: @ 808F968 - push {r4,lr} - ldr r3, =gUnknown_0850D740 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end FieldObjectCB2_LookRandomDirections - - thumb_func_start sub_808F988 -@ bool8 sub_808F988(struct npc_state *fieldObject, struct obj *object) -sub_808F988: @ 808F988 - push {r4,lr} - adds r4, r1, 0 - bl npc_reset - movs r0, 0x1 - strh r0, [r4, 0x30] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_808F988 - - thumb_func_start sub_808F99C -@ bool8 sub_808F99C(struct npc_state *fieldObject, struct obj *object) -sub_808F99C: @ 808F99C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_808F99C - - thumb_func_start sub_808F9C8 -@ bool8 sub_808F9C8(struct npc_state *fieldObject, struct obj *object) -sub_808F9C8: @ 808F9C8 - push {r4-r7,lr} - adds r6, r0, 0 - adds r7, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _0808F9FE - ldr r4, =gUnknown_0850D6DC - bl GenerateRandomNumber - movs r5, 0x3 - adds r1, r5, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - movs r0, 0 - ldrsh r1, [r1, r0] - adds r0, r7, 0 - bl sub_8097978 - ldrb r1, [r6] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r6] - strh r5, [r7, 0x30] -_0808F9FE: - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_808F9C8 - - thumb_func_start sub_808FA0C -@ bool8 sub_808FA0C(struct npc_state *fieldObject, struct obj *object) -sub_808FA0C: @ 808FA0C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - bne _0808FA2A - adds r0, r4, 0 - bl FieldObjectIsTrainerAndCloseToPlayer - lsls r0, 24 - cmp r0, 0 - beq _0808FA32 -_0808FA2A: - movs r0, 0x4 - strh r0, [r5, 0x30] - movs r0, 0x1 - b _0808FA34 -_0808FA32: - movs r0, 0 -_0808FA34: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_808FA0C - - thumb_func_start sub_808FA3C -@ bool8 sub_808FA3C(struct npc_state *fieldObject, struct obj *object) -sub_808FA3C: @ 808FA3C - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D710 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r0, r4, 0 - movs r1, 0 - bl sub_808F8BC - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _0808FA6C - bl GenerateRandomNumber - movs r1, 0x3 - ands r1, r0 - mov r2, sp - adds r0, r2, r1 - ldrb r1, [r0] -_0808FA6C: - adds r0, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x1 - strh r0, [r5, 0x30] - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_808FA3C - - thumb_func_start FieldObjectCB_RandomlyGoNorthOrSouth -FieldObjectCB_RandomlyGoNorthOrSouth: @ 808FA84 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =FieldObjectCB2_RandomlyGoNorthOrSouth - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_RandomlyGoNorthOrSouth - - thumb_func_start FieldObjectCB2_RandomlyGoNorthOrSouth -FieldObjectCB2_RandomlyGoNorthOrSouth: @ 808FAA8 - push {r4,lr} - ldr r3, =gUnknown_0850D754 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end FieldObjectCB2_RandomlyGoNorthOrSouth - - thumb_func_start sub_808FAC8 -sub_808FAC8: @ 808FAC8 - push {r4,lr} - adds r4, r1, 0 - bl npc_reset - movs r0, 0x1 - strh r0, [r4, 0x30] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_808FAC8 - - thumb_func_start sub_808FADC -sub_808FADC: @ 808FADC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_808FADC - - thumb_func_start sub_808FB08 -@ bool8 sub_808FB08(struct npc_state *fieldObject, struct obj *object) -sub_808FB08: @ 808FB08 - push {r4-r6,lr} - adds r6, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _0808FB3C - ldr r5, =gUnknown_0850D6DC - bl GenerateRandomNumber - movs r4, 0x3 - adds r1, r4, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r5 - movs r0, 0 - ldrsh r1, [r1, r0] - adds r0, r6, 0 - bl sub_8097978 - strh r4, [r6, 0x30] - movs r0, 0x1 - b _0808FB3E - .pool -_0808FB3C: - movs r0, 0 -_0808FB3E: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_808FB08 - - thumb_func_start sub_808FB44 -@ bool8 sub_808FB44(struct npc_state *fieldObject, struct obj *object) -sub_808FB44: @ 808FB44 - push {r4,lr} - adds r4, r1, 0 - adds r0, r4, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - bne _0808FB58 - movs r0, 0 - b _0808FB5E -_0808FB58: - movs r0, 0x4 - strh r0, [r4, 0x30] - movs r0, 0x1 -_0808FB5E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_808FB44 - - thumb_func_start sub_808FB64 -@ bool8 sub_808FB64(struct npc_state *fieldObject, struct obj *object) -sub_808FB64: @ 808FB64 - push {r4-r7,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r6, r1, 0 - ldr r1, =gUnknown_0850D770 - mov r0, sp - movs r2, 0x2 - bl memcpy - bl GenerateRandomNumber - movs r7, 0x1 - adds r1, r7, 0 - ands r1, r0 - mov r2, sp - adds r0, r2, r1 - ldrb r4, [r0] - adds r0, r5, 0 - adds r1, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x5 - strh r0, [r6, 0x30] - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8092B88 - lsls r0, 24 - cmp r0, 0 - beq _0808FBA2 - strh r7, [r6, 0x30] -_0808FBA2: - movs r0, 0x1 - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_808FB64 - - thumb_func_start sub_808FBB0 -sub_808FBB0: @ 808FBB0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsrs r0, 4 - bl GetGoSpeed0AnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - ldrb r0, [r4] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] - movs r0, 0x6 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_808FBB0 - - thumb_func_start sub_808FBE0 -sub_808FBE0: @ 808FBE0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _0808FBFE - ldrb r0, [r4] - movs r1, 0x3 - negs r1, r1 - ands r1, r0 - strb r1, [r4] - movs r0, 0x1 - strh r0, [r5, 0x30] -_0808FBFE: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_808FBE0 - - thumb_func_start FieldObjectCB_RandomlyGoEastOrWest -FieldObjectCB_RandomlyGoEastOrWest: @ 808FC08 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =FieldObjectCB2_RandomlyGoEastOrWest - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_RandomlyGoEastOrWest - - thumb_func_start FieldObjectCB2_RandomlyGoEastOrWest -FieldObjectCB2_RandomlyGoEastOrWest: @ 808FC2C - push {r4,lr} - ldr r3, =gUnknown_0850D774 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end FieldObjectCB2_RandomlyGoEastOrWest - - thumb_func_start sub_808FC4C -sub_808FC4C: @ 808FC4C - push {r4,lr} - adds r4, r1, 0 - bl npc_reset - movs r0, 0x1 - strh r0, [r4, 0x30] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_808FC4C - - thumb_func_start sub_808FC60 -sub_808FC60: @ 808FC60 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_808FC60 - - thumb_func_start sub_808FC8C -sub_808FC8C: @ 808FC8C - push {r4-r6,lr} - adds r6, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _0808FCC0 - ldr r5, =gUnknown_0850D6DC - bl GenerateRandomNumber - movs r4, 0x3 - adds r1, r4, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r5 - movs r0, 0 - ldrsh r1, [r1, r0] - adds r0, r6, 0 - bl sub_8097978 - strh r4, [r6, 0x30] - movs r0, 0x1 - b _0808FCC2 - .pool -_0808FCC0: - movs r0, 0 -_0808FCC2: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_808FC8C - - thumb_func_start sub_808FCC8 -sub_808FCC8: @ 808FCC8 - push {r4,lr} - adds r4, r1, 0 - adds r0, r4, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - bne _0808FCDC - movs r0, 0 - b _0808FCE2 -_0808FCDC: - movs r0, 0x4 - strh r0, [r4, 0x30] - movs r0, 0x1 -_0808FCE2: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_808FCC8 - - thumb_func_start sub_808FCE8 -sub_808FCE8: @ 808FCE8 - push {r4-r7,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r6, r1, 0 - ldr r1, =gUnknown_0850D790 - mov r0, sp - movs r2, 0x2 - bl memcpy - bl GenerateRandomNumber - movs r7, 0x1 - adds r1, r7, 0 - ands r1, r0 - mov r2, sp - adds r0, r2, r1 - ldrb r4, [r0] - adds r0, r5, 0 - adds r1, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x5 - strh r0, [r6, 0x30] - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8092B88 - lsls r0, 24 - cmp r0, 0 - beq _0808FD26 - strh r7, [r6, 0x30] -_0808FD26: - movs r0, 0x1 - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_808FCE8 - - thumb_func_start sub_808FD34 -sub_808FD34: @ 808FD34 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsrs r0, 4 - bl GetGoSpeed0AnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - ldrb r0, [r4] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] - movs r0, 0x6 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_808FD34 - - thumb_func_start sub_808FD64 -sub_808FD64: @ 808FD64 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _0808FD82 - ldrb r0, [r4] - movs r1, 0x3 - negs r1, r1 - ands r1, r0 - strb r1, [r4] - movs r0, 0x1 - strh r0, [r5, 0x30] -_0808FD82: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_808FD64 - - thumb_func_start FieldObjectCB_FaceFixedDirection -FieldObjectCB_FaceFixedDirection: @ 808FD8C - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =FieldObjectCB2_FaceFixedDirection - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_FaceFixedDirection - - thumb_func_start FieldObjectCB2_FaceFixedDirection -@ bool8 FieldObjectCB2_FaceFixedDirection(struct npc_state *fieldObject, struct obj *object) -FieldObjectCB2_FaceFixedDirection: @ 808FDB0 - push {r4,lr} - ldr r3, =gUnknown_0850D794 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end FieldObjectCB2_FaceFixedDirection - - thumb_func_start sub_808FDD0 -@ bool8 sub_808FDD0(struct npc_state *fieldObject, struct obj *object) -sub_808FDD0: @ 808FDD0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl npc_reset - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x1 - strh r0, [r5, 0x30] - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_808FDD0 - - thumb_func_start sub_808FDFC -@ bool8 sub_808FDFC(struct npc_state *fieldObject, struct obj *object) -sub_808FDFC: @ 808FDFC - push {r4,lr} - adds r4, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - bne _0808FE0E - movs r0, 0 - b _0808FE14 -_0808FE0E: - movs r0, 0x2 - strh r0, [r4, 0x30] - movs r0, 0x1 -_0808FE14: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_808FDFC - - thumb_func_start sub_808FE1C -@ bool8 sub_808FE1C(struct npc_state *fieldObject, struct obj *object) -sub_808FE1C: @ 808FE1C - ldrb r2, [r0] - movs r1, 0x3 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - movs r0, 0 - bx lr - thumb_func_end sub_808FE1C - - thumb_func_start FieldObjectCB_BerryTree -FieldObjectCB_BerryTree: @ 808FE2C - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r5, r0, r1 - ldrh r1, [r4, 0x3C] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0808FE58 - adds r0, r5, 0 - adds r1, r4, 0 - bl get_berry_tree_graphics - ldrh r1, [r4, 0x3C] - movs r0, 0x1 - orrs r0, r1 - strh r0, [r4, 0x3C] -_0808FE58: - ldr r2, =FieldObjectCB2_BerryTree - adds r0, r5, 0 - adds r1, r4, 0 - bl FieldObjectStep - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_BerryTree - - thumb_func_start FieldObjectCB2_BerryTree -FieldObjectCB2_BerryTree: @ 808FE70 - push {r4,lr} - ldr r3, =gUnknown_0850D7A0 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end FieldObjectCB2_BerryTree - - thumb_func_start do_berry_tree_growth_sparkle_1 -@ bool8 do_berry_tree_growth_sparkle_1(struct npc_state *fieldObject, struct obj *object) -do_berry_tree_growth_sparkle_1: @ 808FE90 - push {r4-r7,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl npc_reset - ldrb r0, [r4, 0x1] - movs r1, 0x20 - orrs r0, r1 - strb r0, [r4, 0x1] - adds r6, r5, 0 - adds r6, 0x3E - ldrb r0, [r6] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r6] - ldrb r0, [r4, 0x1D] - bl GetStageByBerryTreeId - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0 - bne _0808FF00 - ldrh r1, [r5, 0x3C] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - bne _0808FEF6 - subs r6, 0x14 - ldrb r0, [r6] - cmp r0, 0x4 - bne _0808FEF6 - ldr r1, =0x02038c08 - movs r2, 0x10 - ldrsh r0, [r4, r2] - str r0, [r1] - movs r2, 0x12 - ldrsh r0, [r4, r2] - str r0, [r1, 0x4] - adds r0, r5, 0 - adds r0, 0x43 - ldrb r0, [r0] - subs r0, 0x1 - str r0, [r1, 0x8] - ldrb r0, [r5, 0x5] - lsls r0, 28 - lsrs r0, 30 - str r0, [r1, 0xC] - movs r0, 0x17 - bl FieldEffectStart - strb r7, [r6] -_0808FEF6: - movs r0, 0 - b _0808FF42 - .pool -_0808FF00: - ldrb r1, [r4, 0x1] - movs r0, 0x21 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x1] - ldrb r1, [r6] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r6] - subs r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r5, 0 - adds r0, 0x2A - ldrb r0, [r0] - cmp r0, r7 - bne _0808FF3C - adds r0, r4, 0 - adds r1, r5, 0 - bl get_berry_tree_graphics - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x39 - bl FieldObjectSetRegularAnim - movs r0, 0x1 - strh r0, [r5, 0x30] - b _0808FF42 -_0808FF3C: - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 -_0808FF42: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end do_berry_tree_growth_sparkle_1 - - thumb_func_start sub_808FF48 -@ bool8 sub_808FF48(struct npc_state *fieldObject, struct obj *object) -sub_808FF48: @ 808FF48 - push {r4,lr} - adds r4, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - bne _0808FF5A - movs r0, 0 - b _0808FF60 -_0808FF5A: - movs r0, 0 - strh r0, [r4, 0x30] - movs r0, 0x1 -_0808FF60: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_808FF48 - - thumb_func_start do_berry_tree_growth_sparkle_2 -@ bool8 do_berry_tree_growth_sparkle_2(struct npc_state *fieldObject, struct obj *object) -do_berry_tree_growth_sparkle_2: @ 808FF68 - push {r4,lr} - ldrb r2, [r0] - movs r3, 0x2 - orrs r2, r3 - strb r2, [r0] - movs r3, 0 - movs r2, 0x3 - strh r2, [r1, 0x30] - strh r3, [r1, 0x32] - ldrh r3, [r1, 0x3C] - movs r2, 0x2 - orrs r2, r3 - strh r2, [r1, 0x3C] - ldr r3, =0x02038c08 - movs r4, 0x10 - ldrsh r2, [r0, r4] - str r2, [r3] - movs r2, 0x12 - ldrsh r0, [r0, r2] - str r0, [r3, 0x4] - adds r0, r1, 0 - adds r0, 0x43 - ldrb r0, [r0] - subs r0, 0x1 - str r0, [r3, 0x8] - ldrb r0, [r1, 0x5] - lsls r0, 28 - lsrs r0, 30 - str r0, [r3, 0xC] - movs r0, 0x17 - bl FieldEffectStart - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end do_berry_tree_growth_sparkle_2 - - thumb_func_start sub_808FFB4 -@ bool8 sub_808FFB4(struct npc_state *fieldObject, struct obj *object) -sub_808FFB4: @ 808FFB4 - push {r4,lr} - adds r3, r0, 0 - adds r4, r1, 0 - ldrh r1, [r4, 0x32] - adds r1, 0x1 - strh r1, [r4, 0x32] - movs r0, 0x2 - ands r1, r0 - lsls r1, 16 - lsrs r1, 17 - lsls r1, 5 - ldrb r2, [r3, 0x1] - subs r0, 0x23 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x1] - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0x40 - bgt _0808FFEC - movs r0, 0 - b _0808FFFE -_0808FFEC: - adds r0, r3, 0 - adds r1, r4, 0 - bl get_berry_tree_graphics - movs r0, 0x4 - strh r0, [r4, 0x30] - movs r0, 0 - strh r0, [r4, 0x32] - movs r0, 0x1 -_0808FFFE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_808FFB4 - - thumb_func_start sub_8090004 -@ bool8 sub_8090004(struct npc_state *fieldObject, struct obj *object) -sub_8090004: @ 8090004 - push {r4,lr} - adds r4, r1, 0 - ldrh r2, [r4, 0x32] - adds r2, 0x1 - strh r2, [r4, 0x32] - movs r1, 0x2 - ands r2, r1 - lsls r2, 16 - lsrs r2, 17 - lsls r2, 5 - ldrb r3, [r0, 0x1] - subs r1, 0x23 - ands r1, r3 - orrs r1, r2 - strb r1, [r0, 0x1] - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0x40 - bgt _0809003A - movs r0, 0 - b _08090048 -_0809003A: - movs r0, 0 - strh r0, [r4, 0x30] - ldrh r1, [r4, 0x3C] - subs r0, 0x3 - ands r0, r1 - strh r0, [r4, 0x3C] - movs r0, 0x1 -_08090048: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8090004 - - thumb_func_start FieldObjectCB_RandomlyLookNorthOrSouth -FieldObjectCB_RandomlyLookNorthOrSouth: @ 8090050 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =FieldObjectCB2_RandomlyLookNorthOrSouth - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_RandomlyLookNorthOrSouth - - thumb_func_start FieldObjectCB2_RandomlyLookNorthOrSouth -FieldObjectCB2_RandomlyLookNorthOrSouth: @ 8090074 - push {r4,lr} - ldr r3, =gUnknown_0850D7B4 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end FieldObjectCB2_RandomlyLookNorthOrSouth - - thumb_func_start sub_8090094 -sub_8090094: @ 8090094 - push {r4,lr} - adds r4, r1, 0 - bl npc_reset - movs r0, 0x1 - strh r0, [r4, 0x30] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8090094 - - thumb_func_start sub_80900A8 -sub_80900A8: @ 80900A8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80900A8 - - thumb_func_start sub_80900D4 -sub_80900D4: @ 80900D4 - push {r4-r7,lr} - adds r6, r0, 0 - adds r7, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _0809010A - ldr r4, =gUnknown_0850D6DC - bl GenerateRandomNumber - movs r5, 0x3 - adds r1, r5, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - movs r0, 0 - ldrsh r1, [r1, r0] - adds r0, r7, 0 - bl sub_8097978 - ldrb r1, [r6] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r6] - strh r5, [r7, 0x30] -_0809010A: - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80900D4 - - thumb_func_start sub_8090118 -sub_8090118: @ 8090118 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - bne _08090136 - adds r0, r4, 0 - bl FieldObjectIsTrainerAndCloseToPlayer - lsls r0, 24 - cmp r0, 0 - beq _0809013E -_08090136: - movs r0, 0x4 - strh r0, [r5, 0x30] - movs r0, 0x1 - b _08090140 -_0809013E: - movs r0, 0 -_08090140: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090118 - - thumb_func_start sub_8090148 -sub_8090148: @ 8090148 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D770 - mov r0, sp - movs r2, 0x2 - bl memcpy - adds r0, r4, 0 - movs r1, 0x1 - bl sub_808F8BC - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _08090178 - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - mov r2, sp - adds r0, r2, r1 - ldrb r1, [r0] -_08090178: - adds r0, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x1 - strh r0, [r5, 0x30] - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090148 - - thumb_func_start FieldObjectCB_RandomlyLookEastOrWest -FieldObjectCB_RandomlyLookEastOrWest: @ 8090190 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =FieldObjectCB2_RandomlyLookEastOrWest - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_RandomlyLookEastOrWest - - thumb_func_start FieldObjectCB2_RandomlyLookEastOrWest -FieldObjectCB2_RandomlyLookEastOrWest: @ 80901B4 - push {r4,lr} - ldr r3, =gUnknown_0850D7C8 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end FieldObjectCB2_RandomlyLookEastOrWest - - thumb_func_start sub_80901D4 -sub_80901D4: @ 80901D4 - push {r4,lr} - adds r4, r1, 0 - bl npc_reset - movs r0, 0x1 - strh r0, [r4, 0x30] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80901D4 - - thumb_func_start sub_80901E8 -sub_80901E8: @ 80901E8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80901E8 - - thumb_func_start sub_8090214 -sub_8090214: @ 8090214 - push {r4-r7,lr} - adds r6, r0, 0 - adds r7, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _0809024A - ldr r4, =gUnknown_0850D6DC - bl GenerateRandomNumber - movs r5, 0x3 - adds r1, r5, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - movs r0, 0 - ldrsh r1, [r1, r0] - adds r0, r7, 0 - bl sub_8097978 - ldrb r1, [r6] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r6] - strh r5, [r7, 0x30] -_0809024A: - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090214 - - thumb_func_start sub_8090258 -sub_8090258: @ 8090258 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - bne _08090276 - adds r0, r4, 0 - bl FieldObjectIsTrainerAndCloseToPlayer - lsls r0, 24 - cmp r0, 0 - beq _0809027E -_08090276: - movs r0, 0x4 - strh r0, [r5, 0x30] - movs r0, 0x1 - b _08090280 -_0809027E: - movs r0, 0 -_08090280: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090258 - - thumb_func_start sub_8090288 -sub_8090288: @ 8090288 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D790 - mov r0, sp - movs r2, 0x2 - bl memcpy - adds r0, r4, 0 - movs r1, 0x2 - bl sub_808F8BC - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _080902B8 - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - mov r2, sp - adds r0, r2, r1 - ldrb r1, [r0] -_080902B8: - adds r0, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x1 - strh r0, [r5, 0x30] - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090288 - - thumb_func_start FieldObjectCB_RandomlyLookNorthOrWest -FieldObjectCB_RandomlyLookNorthOrWest: @ 80902D0 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =FieldObjectCB2_RandomlyLookNorthOrWest - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_RandomlyLookNorthOrWest - - thumb_func_start FieldObjectCB2_RandomlyLookNorthOrWest -FieldObjectCB2_RandomlyLookNorthOrWest: @ 80902F4 - push {r4,lr} - ldr r3, =gUnknown_0850D7DC - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end FieldObjectCB2_RandomlyLookNorthOrWest - - thumb_func_start sub_8090314 -sub_8090314: @ 8090314 - push {r4,lr} - adds r4, r1, 0 - bl npc_reset - movs r0, 0x1 - strh r0, [r4, 0x30] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8090314 - - thumb_func_start sub_8090328 -sub_8090328: @ 8090328 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090328 - - thumb_func_start sub_8090354 -sub_8090354: @ 8090354 - push {r4-r7,lr} - adds r6, r0, 0 - adds r7, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _0809038A - ldr r4, =gUnknown_0850D6EC - bl GenerateRandomNumber - movs r5, 0x3 - adds r1, r5, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - movs r0, 0 - ldrsh r1, [r1, r0] - adds r0, r7, 0 - bl sub_8097978 - ldrb r1, [r6] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r6] - strh r5, [r7, 0x30] -_0809038A: - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090354 - - thumb_func_start sub_8090398 -sub_8090398: @ 8090398 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - bne _080903B6 - adds r0, r4, 0 - bl FieldObjectIsTrainerAndCloseToPlayer - lsls r0, 24 - cmp r0, 0 - beq _080903BE -_080903B6: - movs r0, 0x4 - strh r0, [r5, 0x30] - movs r0, 0x1 - b _080903C0 -_080903BE: - movs r0, 0 -_080903C0: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090398 - - thumb_func_start sub_80903C8 -sub_80903C8: @ 80903C8 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D7F0 - mov r0, sp - movs r2, 0x2 - bl memcpy - adds r0, r4, 0 - movs r1, 0x3 - bl sub_808F8BC - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _080903F8 - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - mov r2, sp - adds r0, r2, r1 - ldrb r1, [r0] -_080903F8: - adds r0, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x1 - strh r0, [r5, 0x30] - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80903C8 - - thumb_func_start FieldObjectCB_RandomlyLookNorthOrEast -FieldObjectCB_RandomlyLookNorthOrEast: @ 8090410 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8090434 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_RandomlyLookNorthOrEast - - thumb_func_start sub_8090434 -sub_8090434: @ 8090434 - push {r4,lr} - ldr r3, =gUnknown_0850D7F4 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090434 - - thumb_func_start sub_8090454 -sub_8090454: @ 8090454 - push {r4,lr} - adds r4, r1, 0 - bl npc_reset - movs r0, 0x1 - strh r0, [r4, 0x30] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8090454 - - thumb_func_start sub_8090468 -sub_8090468: @ 8090468 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090468 - - thumb_func_start sub_8090494 -sub_8090494: @ 8090494 - push {r4-r7,lr} - adds r6, r0, 0 - adds r7, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _080904CA - ldr r4, =gUnknown_0850D6EC - bl GenerateRandomNumber - movs r5, 0x3 - adds r1, r5, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - movs r0, 0 - ldrsh r1, [r1, r0] - adds r0, r7, 0 - bl sub_8097978 - ldrb r1, [r6] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r6] - strh r5, [r7, 0x30] -_080904CA: - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090494 - - thumb_func_start sub_80904D8 -sub_80904D8: @ 80904D8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - bne _080904F6 - adds r0, r4, 0 - bl FieldObjectIsTrainerAndCloseToPlayer - lsls r0, 24 - cmp r0, 0 - beq _080904FE -_080904F6: - movs r0, 0x4 - strh r0, [r5, 0x30] - movs r0, 0x1 - b _08090500 -_080904FE: - movs r0, 0 -_08090500: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80904D8 - - thumb_func_start sub_8090508 -sub_8090508: @ 8090508 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D808 - mov r0, sp - movs r2, 0x2 - bl memcpy - adds r0, r4, 0 - movs r1, 0x4 - bl sub_808F8BC - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _08090538 - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - mov r2, sp - adds r0, r2, r1 - ldrb r1, [r0] -_08090538: - adds r0, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x1 - strh r0, [r5, 0x30] - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090508 - - thumb_func_start FieldObjectCB_RandomlyLookSouthOrWest -FieldObjectCB_RandomlyLookSouthOrWest: @ 8090550 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8090574 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_RandomlyLookSouthOrWest - - thumb_func_start sub_8090574 -sub_8090574: @ 8090574 - push {r4,lr} - ldr r3, =gUnknown_0850D80C - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090574 - - thumb_func_start sub_8090594 -sub_8090594: @ 8090594 - push {r4,lr} - adds r4, r1, 0 - bl npc_reset - movs r0, 0x1 - strh r0, [r4, 0x30] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8090594 - - thumb_func_start sub_80905A8 -sub_80905A8: @ 80905A8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80905A8 - - thumb_func_start sub_80905D4 -sub_80905D4: @ 80905D4 - push {r4-r7,lr} - adds r6, r0, 0 - adds r7, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _0809060A - ldr r4, =gUnknown_0850D6EC - bl GenerateRandomNumber - movs r5, 0x3 - adds r1, r5, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - movs r0, 0 - ldrsh r1, [r1, r0] - adds r0, r7, 0 - bl sub_8097978 - ldrb r1, [r6] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r6] - strh r5, [r7, 0x30] -_0809060A: - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80905D4 - - thumb_func_start sub_8090618 -sub_8090618: @ 8090618 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - bne _08090636 - adds r0, r4, 0 - bl FieldObjectIsTrainerAndCloseToPlayer - lsls r0, 24 - cmp r0, 0 - beq _0809063E -_08090636: - movs r0, 0x4 - strh r0, [r5, 0x30] - movs r0, 0x1 - b _08090640 -_0809063E: - movs r0, 0 -_08090640: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090618 - - thumb_func_start sub_8090648 -sub_8090648: @ 8090648 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D820 - mov r0, sp - movs r2, 0x2 - bl memcpy - adds r0, r4, 0 - movs r1, 0x5 - bl sub_808F8BC - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _08090678 - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - mov r2, sp - adds r0, r2, r1 - ldrb r1, [r0] -_08090678: - adds r0, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x1 - strh r0, [r5, 0x30] - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090648 - - thumb_func_start FieldObjectCB_RandomlyLookSouthOrEast -FieldObjectCB_RandomlyLookSouthOrEast: @ 8090690 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_80906B4 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_RandomlyLookSouthOrEast - - thumb_func_start sub_80906B4 -sub_80906B4: @ 80906B4 - push {r4,lr} - ldr r3, =gUnknown_0850D824 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80906B4 - - thumb_func_start sub_80906D4 -sub_80906D4: @ 80906D4 - push {r4,lr} - adds r4, r1, 0 - bl npc_reset - movs r0, 0x1 - strh r0, [r4, 0x30] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80906D4 - - thumb_func_start sub_80906E8 -sub_80906E8: @ 80906E8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80906E8 - - thumb_func_start sub_8090714 -sub_8090714: @ 8090714 - push {r4-r7,lr} - adds r6, r0, 0 - adds r7, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _0809074A - ldr r4, =gUnknown_0850D6EC - bl GenerateRandomNumber - movs r5, 0x3 - adds r1, r5, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - movs r0, 0 - ldrsh r1, [r1, r0] - adds r0, r7, 0 - bl sub_8097978 - ldrb r1, [r6] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r6] - strh r5, [r7, 0x30] -_0809074A: - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090714 - - thumb_func_start sub_8090758 -sub_8090758: @ 8090758 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - bne _08090776 - adds r0, r4, 0 - bl FieldObjectIsTrainerAndCloseToPlayer - lsls r0, 24 - cmp r0, 0 - beq _0809077E -_08090776: - movs r0, 0x4 - strh r0, [r5, 0x30] - movs r0, 0x1 - b _08090780 -_0809077E: - movs r0, 0 -_08090780: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090758 - - thumb_func_start sub_8090788 -sub_8090788: @ 8090788 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D838 - mov r0, sp - movs r2, 0x2 - bl memcpy - adds r0, r4, 0 - movs r1, 0x6 - bl sub_808F8BC - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _080907B8 - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - mov r2, sp - adds r0, r2, r1 - ldrb r1, [r0] -_080907B8: - adds r0, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x1 - strh r0, [r5, 0x30] - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090788 - - thumb_func_start FieldObjectCB_RandomlyLookNorthOrSouthOrWest -FieldObjectCB_RandomlyLookNorthOrSouthOrWest: @ 80907D0 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_80907F4 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_RandomlyLookNorthOrSouthOrWest - - thumb_func_start sub_80907F4 -sub_80907F4: @ 80907F4 - push {r4,lr} - ldr r3, =gUnknown_0850D83C - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80907F4 - - thumb_func_start sub_8090814 -sub_8090814: @ 8090814 - push {r4,lr} - adds r4, r1, 0 - bl npc_reset - movs r0, 0x1 - strh r0, [r4, 0x30] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8090814 - - thumb_func_start sub_8090828 -sub_8090828: @ 8090828 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090828 - - thumb_func_start sub_8090854 -sub_8090854: @ 8090854 - push {r4-r7,lr} - adds r6, r0, 0 - adds r7, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _0809088A - ldr r4, =gUnknown_0850D6EC - bl GenerateRandomNumber - movs r5, 0x3 - adds r1, r5, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - movs r0, 0 - ldrsh r1, [r1, r0] - adds r0, r7, 0 - bl sub_8097978 - ldrb r1, [r6] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r6] - strh r5, [r7, 0x30] -_0809088A: - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090854 - - thumb_func_start sub_8090898 -sub_8090898: @ 8090898 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - bne _080908B6 - adds r0, r4, 0 - bl FieldObjectIsTrainerAndCloseToPlayer - lsls r0, 24 - cmp r0, 0 - beq _080908BE -_080908B6: - movs r0, 0x4 - strh r0, [r5, 0x30] - movs r0, 0x1 - b _080908C0 -_080908BE: - movs r0, 0 -_080908C0: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090898 - - thumb_func_start sub_80908C8 -sub_80908C8: @ 80908C8 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D850 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r0, r4, 0 - movs r1, 0x7 - bl sub_808F8BC - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _080908F8 - bl GenerateRandomNumber - movs r1, 0x3 - ands r1, r0 - mov r2, sp - adds r0, r2, r1 - ldrb r1, [r0] -_080908F8: - adds r0, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x1 - strh r0, [r5, 0x30] - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80908C8 - - thumb_func_start FieldObjectCB_RandomlyLookNorthOrSouthOrEast -FieldObjectCB_RandomlyLookNorthOrSouthOrEast: @ 8090910 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8090934 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_RandomlyLookNorthOrSouthOrEast - - thumb_func_start sub_8090934 -sub_8090934: @ 8090934 - push {r4,lr} - ldr r3, =gUnknown_0850D854 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090934 - - thumb_func_start sub_8090954 -sub_8090954: @ 8090954 - push {r4,lr} - adds r4, r1, 0 - bl npc_reset - movs r0, 0x1 - strh r0, [r4, 0x30] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8090954 - - thumb_func_start sub_8090968 -sub_8090968: @ 8090968 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090968 - - thumb_func_start sub_8090994 -sub_8090994: @ 8090994 - push {r4-r7,lr} - adds r6, r0, 0 - adds r7, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _080909CA - ldr r4, =gUnknown_0850D6EC - bl GenerateRandomNumber - movs r5, 0x3 - adds r1, r5, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - movs r0, 0 - ldrsh r1, [r1, r0] - adds r0, r7, 0 - bl sub_8097978 - ldrb r1, [r6] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r6] - strh r5, [r7, 0x30] -_080909CA: - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090994 - - thumb_func_start sub_80909D8 -sub_80909D8: @ 80909D8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - bne _080909F6 - adds r0, r4, 0 - bl FieldObjectIsTrainerAndCloseToPlayer - lsls r0, 24 - cmp r0, 0 - beq _080909FE -_080909F6: - movs r0, 0x4 - strh r0, [r5, 0x30] - movs r0, 0x1 - b _08090A00 -_080909FE: - movs r0, 0 -_08090A00: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80909D8 - - thumb_func_start sub_8090A08 -sub_8090A08: @ 8090A08 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D868 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r0, r4, 0 - movs r1, 0x8 - bl sub_808F8BC - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _08090A38 - bl GenerateRandomNumber - movs r1, 0x3 - ands r1, r0 - mov r2, sp - adds r0, r2, r1 - ldrb r1, [r0] -_08090A38: - adds r0, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x1 - strh r0, [r5, 0x30] - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090A08 - - thumb_func_start FieldObjectCB_RandomlyLookNorthOrEastOrWest -FieldObjectCB_RandomlyLookNorthOrEastOrWest: @ 8090A50 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8090A74 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_RandomlyLookNorthOrEastOrWest - - thumb_func_start sub_8090A74 -sub_8090A74: @ 8090A74 - push {r4,lr} - ldr r3, =gUnknown_0850D86C - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090A74 - - thumb_func_start sub_8090A94 -sub_8090A94: @ 8090A94 - push {r4,lr} - adds r4, r1, 0 - bl npc_reset - movs r0, 0x1 - strh r0, [r4, 0x30] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8090A94 - - thumb_func_start sub_8090AA8 -sub_8090AA8: @ 8090AA8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090AA8 - - thumb_func_start sub_8090AD4 -sub_8090AD4: @ 8090AD4 - push {r4-r7,lr} - adds r6, r0, 0 - adds r7, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _08090B0A - ldr r4, =gUnknown_0850D6EC - bl GenerateRandomNumber - movs r5, 0x3 - adds r1, r5, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - movs r0, 0 - ldrsh r1, [r1, r0] - adds r0, r7, 0 - bl sub_8097978 - ldrb r1, [r6] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r6] - strh r5, [r7, 0x30] -_08090B0A: - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090AD4 - - thumb_func_start sub_8090B18 -sub_8090B18: @ 8090B18 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - bne _08090B36 - adds r0, r4, 0 - bl FieldObjectIsTrainerAndCloseToPlayer - lsls r0, 24 - cmp r0, 0 - beq _08090B3E -_08090B36: - movs r0, 0x4 - strh r0, [r5, 0x30] - movs r0, 0x1 - b _08090B40 -_08090B3E: - movs r0, 0 -_08090B40: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090B18 - - thumb_func_start sub_8090B48 -sub_8090B48: @ 8090B48 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D880 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r0, r4, 0 - movs r1, 0x9 - bl sub_808F8BC - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _08090B78 - bl GenerateRandomNumber - movs r1, 0x3 - ands r1, r0 - mov r2, sp - adds r0, r2, r1 - ldrb r1, [r0] -_08090B78: - adds r0, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x1 - strh r0, [r5, 0x30] - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090B48 - - thumb_func_start FieldObjectCB_RandomlyLookSouthOrEastOrWest -FieldObjectCB_RandomlyLookSouthOrEastOrWest: @ 8090B90 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8090BB4 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_RandomlyLookSouthOrEastOrWest - - thumb_func_start sub_8090BB4 -sub_8090BB4: @ 8090BB4 - push {r4,lr} - ldr r3, =gUnknown_0850D884 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090BB4 - - thumb_func_start sub_8090BD4 -sub_8090BD4: @ 8090BD4 - push {r4,lr} - adds r4, r1, 0 - bl npc_reset - movs r0, 0x1 - strh r0, [r4, 0x30] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8090BD4 - - thumb_func_start sub_8090BE8 -sub_8090BE8: @ 8090BE8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090BE8 - - thumb_func_start sub_8090C14 -sub_8090C14: @ 8090C14 - push {r4-r7,lr} - adds r6, r0, 0 - adds r7, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _08090C4A - ldr r4, =gUnknown_0850D6EC - bl GenerateRandomNumber - movs r5, 0x3 - adds r1, r5, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - movs r0, 0 - ldrsh r1, [r1, r0] - adds r0, r7, 0 - bl sub_8097978 - ldrb r1, [r6] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r6] - strh r5, [r7, 0x30] -_08090C4A: - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090C14 - - thumb_func_start sub_8090C58 -sub_8090C58: @ 8090C58 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - bne _08090C76 - adds r0, r4, 0 - bl FieldObjectIsTrainerAndCloseToPlayer - lsls r0, 24 - cmp r0, 0 - beq _08090C7E -_08090C76: - movs r0, 0x4 - strh r0, [r5, 0x30] - movs r0, 0x1 - b _08090C80 -_08090C7E: - movs r0, 0 -_08090C80: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090C58 - - thumb_func_start sub_8090C88 -sub_8090C88: @ 8090C88 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D898 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r0, r4, 0 - movs r1, 0xA - bl sub_808F8BC - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _08090CB8 - bl GenerateRandomNumber - movs r1, 0x3 - ands r1, r0 - mov r2, sp - adds r0, r2, r1 - ldrb r1, [r0] -_08090CB8: - adds r0, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x1 - strh r0, [r5, 0x30] - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090C88 - - thumb_func_start FieldObjectCB_LookAroundCounterclockwise -FieldObjectCB_LookAroundCounterclockwise: @ 8090CD0 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8090CF4 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_LookAroundCounterclockwise - - thumb_func_start sub_8090CF4 -sub_8090CF4: @ 8090CF4 - push {r4,lr} - ldr r3, =gUnknown_0850D89C - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090CF4 - - thumb_func_start sub_8090D14 -sub_8090D14: @ 8090D14 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl npc_reset - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x1 - strh r0, [r5, 0x30] - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090D14 - - thumb_func_start sub_8090D40 -sub_8090D40: @ 8090D40 - push {r4,lr} - adds r4, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _08090D5A - adds r0, r4, 0 - movs r1, 0x30 - bl sub_8097978 - movs r0, 0x2 - strh r0, [r4, 0x30] -_08090D5A: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8090D40 - - thumb_func_start sub_8090D64 -sub_8090D64: @ 8090D64 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - bne _08090D82 - adds r0, r4, 0 - bl FieldObjectIsTrainerAndCloseToPlayer - lsls r0, 24 - cmp r0, 0 - beq _08090D86 -_08090D82: - movs r0, 0x3 - strh r0, [r5, 0x30] -_08090D86: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090D64 - - thumb_func_start sub_8090D90 -@ bool8 sub_8090D90(struct npc_state *fieldObject, struct obj *object) -sub_8090D90: @ 8090D90 - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D8AC - mov r0, sp - movs r2, 0x5 - bl memcpy - adds r0, r4, 0 - movs r1, 0 - bl sub_808F8BC - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _08090DBC - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - add r0, sp - ldrb r1, [r0] -_08090DBC: - adds r0, r4, 0 - bl FieldObjectSetDirection - movs r0, 0 - strh r0, [r5, 0x30] - movs r0, 0x1 - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090D90 - - thumb_func_start FieldObjectCB_LookAroundClockwise -FieldObjectCB_LookAroundClockwise: @ 8090DD4 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8090DF8 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_LookAroundClockwise - - thumb_func_start sub_8090DF8 -sub_8090DF8: @ 8090DF8 - push {r4,lr} - ldr r3, =gUnknown_0850D8B4 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090DF8 - - thumb_func_start sub_8090E18 -sub_8090E18: @ 8090E18 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl npc_reset - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x1 - strh r0, [r5, 0x30] - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090E18 - - thumb_func_start sub_8090E44 -sub_8090E44: @ 8090E44 - push {r4,lr} - adds r4, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _08090E5E - adds r0, r4, 0 - movs r1, 0x30 - bl sub_8097978 - movs r0, 0x2 - strh r0, [r4, 0x30] -_08090E5E: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8090E44 - - thumb_func_start sub_8090E68 -sub_8090E68: @ 8090E68 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - bne _08090E86 - adds r0, r4, 0 - bl FieldObjectIsTrainerAndCloseToPlayer - lsls r0, 24 - cmp r0, 0 - beq _08090E8A -_08090E86: - movs r0, 0x3 - strh r0, [r5, 0x30] -_08090E8A: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090E68 - - thumb_func_start sub_8090E94 -sub_8090E94: @ 8090E94 - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D8C4 - mov r0, sp - movs r2, 0x5 - bl memcpy - adds r0, r4, 0 - movs r1, 0 - bl sub_808F8BC - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _08090EC0 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - add r0, sp - ldrb r1, [r0] -_08090EC0: - adds r0, r4, 0 - bl FieldObjectSetDirection - movs r0, 0 - strh r0, [r5, 0x30] - movs r0, 0x1 - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090E94 - - thumb_func_start FieldObjectCB_AlternatelyGoInOppositeDirections -FieldObjectCB_AlternatelyGoInOppositeDirections: @ 8090ED8 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8090EFC - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_AlternatelyGoInOppositeDirections - - thumb_func_start sub_8090EFC -sub_8090EFC: @ 8090EFC - push {r4,lr} - ldr r3, =gUnknown_0850D8CC - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090EFC - - thumb_func_start sub_8090F1C -sub_8090F1C: @ 8090F1C - push {r4,lr} - adds r4, r1, 0 - bl npc_reset - movs r0, 0x1 - strh r0, [r4, 0x30] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8090F1C - - thumb_func_start sub_8090F30 -@ bool8 sub_8090F30(struct npc_state *fieldObject, struct obj *object) -sub_8090F30: @ 8090F30 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldr r0, =gUnknown_085055CD - ldrb r1, [r4, 0x6] - adds r1, r0 - ldrb r1, [r1] - adds r0, r4, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0 - beq _08090F52 - adds r0, r1, 0 - bl GetOppositeDirection - lsls r0, 24 - lsrs r1, r0, 24 -_08090F52: - adds r0, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090F30 - - thumb_func_start sub_8090F68 -@ bool8 sub_8090F68(struct npc_state *fieldObject, struct obj *object) -sub_8090F68: @ 8090F68 - push {r4-r7,lr} - adds r4, r0, 0 - adds r7, r1, 0 - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0 - beq _08090F98 - ldr r1, [r4, 0xC] - ldr r0, [r4, 0x10] - cmp r1, r0 - bne _08090F98 - movs r0, 0 - strb r0, [r2] - ldrb r0, [r4, 0x18] - lsrs r0, 4 - bl GetOppositeDirection - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetDirection -_08090F98: - ldrb r1, [r4, 0x18] - lsrs r1, 4 - adds r0, r4, 0 - bl sub_8092B88 - lsls r0, 24 - lsrs r5, r0, 24 - ldrb r0, [r4, 0x18] - lsrs r0, 4 - bl GetGoSpeed0AnimId - lsls r0, 24 - lsrs r6, r0, 24 - cmp r5, 0x1 - bne _08090FEE - adds r1, r4, 0 - adds r1, 0x21 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldrb r0, [r4, 0x18] - lsrs r0, 4 - bl GetOppositeDirection - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetDirection - ldrb r0, [r4, 0x18] - lsrs r0, 4 - bl GetGoSpeed0AnimId - lsls r0, 24 - lsrs r6, r0, 24 - ldrb r1, [r4, 0x18] - lsrs r1, 4 - adds r0, r4, 0 - bl sub_8092B88 - lsls r0, 24 - lsrs r5, r0, 24 -_08090FEE: - cmp r5, 0 - beq _08091000 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetStepInPlaceDelay16AnimId - lsls r0, 24 - lsrs r6, r0, 24 -_08091000: - adds r0, r4, 0 - adds r1, r7, 0 - adds r2, r6, 0 - bl FieldObjectSetRegularAnim - ldrb r0, [r4] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] - movs r0, 0x3 - strh r0, [r7, 0x30] - movs r0, 0x1 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8090F68 - - thumb_func_start sub_8091020 -@ bool8 sub_8091020(struct npc_state *fieldObject, struct obj *object) -sub_8091020: @ 8091020 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _0809103E - ldrb r0, [r4] - movs r1, 0x3 - negs r1, r1 - ands r1, r0 - strb r1, [r4] - movs r0, 0x1 - strh r0, [r5, 0x30] -_0809103E: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8091020 - - thumb_func_start sub_8091048 -@ bool8 sub_8091048(struct npc_state *fieldObject, struct obj *object) -sub_8091048: @ 8091048 - push {r4,lr} - adds r4, r1, 0 - bl npc_reset - movs r0, 0x1 - strh r0, [r4, 0x30] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8091048 - - thumb_func_start MoveFieldObjectInNextDirectionInSequence -@ bool8 MoveFieldObjectInNextDirectionInSequence(struct npc_state *fieldObject, struct obj *object, u8 *directions) -MoveFieldObjectInNextDirectionInSequence: @ 809105C - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - mov r8, r1 - adds r7, r2, 0 - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x3 - bne _0809107E - ldr r1, [r4, 0xC] - ldr r0, [r4, 0x10] - cmp r1, r0 - bne _0809107E - movs r0, 0 - strb r0, [r2] -_0809107E: - adds r5, r4, 0 - adds r5, 0x21 - ldrb r0, [r5] - adds r0, r7, r0 - ldrb r1, [r0] - adds r0, r4, 0 - bl FieldObjectSetDirection - ldrb r0, [r4, 0x18] - lsrs r0, 4 - bl GetGoSpeed0AnimId - lsls r0, 24 - lsrs r6, r0, 24 - ldrb r1, [r4, 0x18] - lsrs r1, 4 - adds r0, r4, 0 - bl sub_8092B88 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080910D8 - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - ldrb r0, [r5] - adds r0, r7, r0 - ldrb r1, [r0] - adds r0, r4, 0 - bl FieldObjectSetDirection - ldrb r0, [r4, 0x18] - lsrs r0, 4 - bl GetGoSpeed0AnimId - lsls r0, 24 - lsrs r6, r0, 24 - ldrb r1, [r4, 0x18] - lsrs r1, 4 - adds r0, r4, 0 - bl sub_8092B88 - lsls r0, 24 - lsrs r0, 24 -_080910D8: - cmp r0, 0 - beq _080910EA - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetStepInPlaceDelay16AnimId - lsls r0, 24 - lsrs r6, r0, 24 -_080910EA: - adds r0, r4, 0 - mov r1, r8 - adds r2, r6, 0 - bl FieldObjectSetRegularAnim - ldrb r0, [r4] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] - movs r0, 0x2 - mov r1, r8 - strh r0, [r1, 0x30] - movs r0, 0x1 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end MoveFieldObjectInNextDirectionInSequence - - thumb_func_start sub_8091110 -@ bool8 sub_8091110(struct npc_state *fieldObject, struct obj *object) -sub_8091110: @ 8091110 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _0809112E - ldrb r0, [r4] - movs r1, 0x3 - negs r1, r1 - ands r1, r0 - strb r1, [r4] - movs r0, 0x1 - strh r0, [r5, 0x30] -_0809112E: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8091110 - - thumb_func_start FieldObjectCB_GoInDirectionSequence1 -FieldObjectCB_GoInDirectionSequence1: @ 8091138 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_809115C - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence1 - - thumb_func_start sub_809115C -sub_809115C: @ 809115C - push {r4,lr} - ldr r3, =gUnknown_0850D8DC - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809115C - - thumb_func_start sub_809117C -sub_809117C: @ 809117C - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D8E8 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x2 - bne _080911A8 - movs r0, 0xC - ldrsh r1, [r4, r0] - movs r3, 0x10 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _080911A8 - movs r0, 0x3 - strb r0, [r2] -_080911A8: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809117C - - thumb_func_start FieldObjectCB_GoInDirectionSequence2 -FieldObjectCB_GoInDirectionSequence2: @ 80911C4 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_80911E8 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence2 - - thumb_func_start sub_80911E8 -sub_80911E8: @ 80911E8 - push {r4,lr} - ldr r3, =gUnknown_0850D8EC - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80911E8 - - thumb_func_start sub_8091208 -sub_8091208: @ 8091208 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D8F8 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x1 - bne _08091234 - movs r0, 0xC - ldrsh r1, [r4, r0] - movs r3, 0x10 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _08091234 - movs r0, 0x2 - strb r0, [r2] -_08091234: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091208 - - thumb_func_start FieldObjectCB_GoInDirectionSequence3 -FieldObjectCB_GoInDirectionSequence3: @ 8091250 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091274 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence3 - - thumb_func_start sub_8091274 -sub_8091274: @ 8091274 - push {r4,lr} - ldr r3, =gUnknown_0850D8FC - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091274 - - thumb_func_start sub_8091294 -sub_8091294: @ 8091294 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D908 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x1 - bne _080912C0 - movs r0, 0xE - ldrsh r1, [r4, r0] - movs r3, 0x12 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _080912C0 - movs r0, 0x2 - strb r0, [r2] -_080912C0: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091294 - - thumb_func_start FieldObjectCB_GoInDirectionSequence4 -FieldObjectCB_GoInDirectionSequence4: @ 80912DC - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091300 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence4 - - thumb_func_start sub_8091300 -sub_8091300: @ 8091300 - push {r4,lr} - ldr r3, =gUnknown_0850D90C - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091300 - - thumb_func_start sub_8091320 -sub_8091320: @ 8091320 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D918 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x2 - bne _0809134C - movs r0, 0xE - ldrsh r1, [r4, r0] - movs r3, 0x12 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _0809134C - movs r0, 0x3 - strb r0, [r2] -_0809134C: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091320 - - thumb_func_start FieldObjectCB_GoInDirectionSequence5 -FieldObjectCB_GoInDirectionSequence5: @ 8091368 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_809138C - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence5 - - thumb_func_start sub_809138C -sub_809138C: @ 809138C - push {r4,lr} - ldr r3, =gUnknown_0850D91C - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809138C - - thumb_func_start sub_80913AC -@ bool8 sub_80913AC(struct npc_state *fieldObject, struct obj *object) -sub_80913AC: @ 80913AC - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D928 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x2 - bne _080913D8 - movs r0, 0xC - ldrsh r1, [r4, r0] - movs r3, 0x10 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _080913D8 - movs r0, 0x3 - strb r0, [r2] -_080913D8: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80913AC - - thumb_func_start FieldObjectCB_GoInDirectionSequence6 -FieldObjectCB_GoInDirectionSequence6: @ 80913F4 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091418 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence6 - - thumb_func_start sub_8091418 -sub_8091418: @ 8091418 - push {r4,lr} - ldr r3, =gUnknown_0850D92C - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091418 - - thumb_func_start sub_8091438 -sub_8091438: @ 8091438 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D938 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x1 - bne _08091464 - movs r0, 0xC - ldrsh r1, [r4, r0] - movs r3, 0x10 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _08091464 - movs r0, 0x2 - strb r0, [r2] -_08091464: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091438 - - thumb_func_start FieldObjectCB_GoInDirectionSequence7 -FieldObjectCB_GoInDirectionSequence7: @ 8091480 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_80914A4 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence7 - - thumb_func_start sub_80914A4 -sub_80914A4: @ 80914A4 - push {r4,lr} - ldr r3, =gUnknown_0850D93C - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80914A4 - - thumb_func_start sub_80914C4 -sub_80914C4: @ 80914C4 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D710 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x1 - bne _080914F0 - movs r0, 0xE - ldrsh r1, [r4, r0] - movs r3, 0x12 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _080914F0 - movs r0, 0x2 - strb r0, [r2] -_080914F0: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80914C4 - - thumb_func_start FieldObjectCB_GoInDirectionSequence8 -FieldObjectCB_GoInDirectionSequence8: @ 809150C - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091530 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence8 - - thumb_func_start sub_8091530 -sub_8091530: @ 8091530 - push {r4,lr} - ldr r3, =gUnknown_0850D948 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091530 - - thumb_func_start sub_8091550 -sub_8091550: @ 8091550 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D954 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x2 - bne _0809157C - movs r0, 0xE - ldrsh r1, [r4, r0] - movs r3, 0x12 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _0809157C - movs r0, 0x3 - strb r0, [r2] -_0809157C: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091550 - - thumb_func_start FieldObjectCB_GoInDirectionSequence9 -FieldObjectCB_GoInDirectionSequence9: @ 8091598 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_80915BC - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence9 - - thumb_func_start sub_80915BC -sub_80915BC: @ 80915BC - push {r4,lr} - ldr r3, =gUnknown_0850D958 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80915BC - - thumb_func_start sub_80915DC -sub_80915DC: @ 80915DC - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D964 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x2 - bne _08091608 - movs r0, 0xE - ldrsh r1, [r4, r0] - movs r3, 0x12 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _08091608 - movs r0, 0x3 - strb r0, [r2] -_08091608: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80915DC - - thumb_func_start FieldObjectCB_GoInDirectionSequence10 -FieldObjectCB_GoInDirectionSequence10: @ 8091624 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091648 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence10 - - thumb_func_start sub_8091648 -sub_8091648: @ 8091648 - push {r4,lr} - ldr r3, =gUnknown_0850D968 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091648 - - thumb_func_start sub_8091668 -sub_8091668: @ 8091668 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D974 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x1 - bne _08091694 - movs r0, 0xE - ldrsh r1, [r4, r0] - movs r3, 0x12 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _08091694 - movs r0, 0x2 - strb r0, [r2] -_08091694: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091668 - - thumb_func_start FieldObjectCB_GoInDirectionSequence11 -FieldObjectCB_GoInDirectionSequence11: @ 80916B0 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_80916D4 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence11 - - thumb_func_start sub_80916D4 -sub_80916D4: @ 80916D4 - push {r4,lr} - ldr r3, =gUnknown_0850D978 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80916D4 - - thumb_func_start sub_80916F4 -sub_80916F4: @ 80916F4 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D984 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x1 - bne _08091720 - movs r0, 0xC - ldrsh r1, [r4, r0] - movs r3, 0x10 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _08091720 - movs r0, 0x2 - strb r0, [r2] -_08091720: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80916F4 - - thumb_func_start FieldObjectCB_GoInDirectionSequence12 -FieldObjectCB_GoInDirectionSequence12: @ 809173C - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091760 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence12 - - thumb_func_start sub_8091760 -sub_8091760: @ 8091760 - push {r4,lr} - ldr r3, =gUnknown_0850D988 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091760 - - thumb_func_start sub_8091780 -sub_8091780: @ 8091780 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D994 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x2 - bne _080917AC - movs r0, 0xC - ldrsh r1, [r4, r0] - movs r3, 0x10 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _080917AC - movs r0, 0x3 - strb r0, [r2] -_080917AC: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091780 - - thumb_func_start FieldObjectCB_GoInDirectionSequence13 -FieldObjectCB_GoInDirectionSequence13: @ 80917C8 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_80917EC - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence13 - - thumb_func_start sub_80917EC -sub_80917EC: @ 80917EC - push {r4,lr} - ldr r3, =gUnknown_0850D998 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80917EC - - thumb_func_start sub_809180C -sub_809180C: @ 809180C - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D9A4 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x2 - bne _08091838 - movs r0, 0xE - ldrsh r1, [r4, r0] - movs r3, 0x12 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _08091838 - movs r0, 0x3 - strb r0, [r2] -_08091838: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809180C - - thumb_func_start FieldObjectCB_GoInDirectionSequence14 -FieldObjectCB_GoInDirectionSequence14: @ 8091854 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091878 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence14 - - thumb_func_start sub_8091878 -sub_8091878: @ 8091878 - push {r4,lr} - ldr r3, =gUnknown_0850D9A8 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091878 - - thumb_func_start sub_8091898 -sub_8091898: @ 8091898 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D9B4 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x1 - bne _080918C4 - movs r0, 0xE - ldrsh r1, [r4, r0] - movs r3, 0x12 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _080918C4 - movs r0, 0x2 - strb r0, [r2] -_080918C4: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091898 - - thumb_func_start FieldObjectCB_GoInDirectionSequence15 -FieldObjectCB_GoInDirectionSequence15: @ 80918E0 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091904 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence15 - - thumb_func_start sub_8091904 -sub_8091904: @ 8091904 - push {r4,lr} - ldr r3, =gUnknown_0850D9B8 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091904 - - thumb_func_start sub_8091924 -sub_8091924: @ 8091924 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D9C4 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x1 - bne _08091950 - movs r0, 0xC - ldrsh r1, [r4, r0] - movs r3, 0x10 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _08091950 - movs r0, 0x2 - strb r0, [r2] -_08091950: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091924 - - thumb_func_start FieldObjectCB_GoInDirectionSequence16 -FieldObjectCB_GoInDirectionSequence16: @ 809196C - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091990 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence16 - - thumb_func_start sub_8091990 -sub_8091990: @ 8091990 - push {r4,lr} - ldr r3, =gUnknown_0850D9C8 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091990 - - thumb_func_start sub_80919B0 -sub_80919B0: @ 80919B0 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D9D4 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x2 - bne _080919DC - movs r0, 0xC - ldrsh r1, [r4, r0] - movs r3, 0x10 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _080919DC - movs r0, 0x3 - strb r0, [r2] -_080919DC: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80919B0 - - thumb_func_start FieldObjectCB_GoInDirectionSequence17 -FieldObjectCB_GoInDirectionSequence17: @ 80919F8 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091A1C - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence17 - - thumb_func_start sub_8091A1C -sub_8091A1C: @ 8091A1C - push {r4,lr} - ldr r3, =gUnknown_0850D9D8 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091A1C - - thumb_func_start sub_8091A3C -sub_8091A3C: @ 8091A3C - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D9E4 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x2 - bne _08091A68 - movs r0, 0xE - ldrsh r1, [r4, r0] - movs r3, 0x12 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _08091A68 - movs r0, 0x3 - strb r0, [r2] -_08091A68: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091A3C - - thumb_func_start FieldObjectCB_GoInDirectionSequence18 -FieldObjectCB_GoInDirectionSequence18: @ 8091A84 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091AA8 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence18 - - thumb_func_start sub_8091AA8 -sub_8091AA8: @ 8091AA8 - push {r4,lr} - ldr r3, =gUnknown_0850D9E8 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091AA8 - - thumb_func_start sub_8091AC8 -sub_8091AC8: @ 8091AC8 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D9F4 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x2 - bne _08091AF4 - movs r0, 0xE - ldrsh r1, [r4, r0] - movs r3, 0x12 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _08091AF4 - movs r0, 0x3 - strb r0, [r2] -_08091AF4: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091AC8 - - thumb_func_start FieldObjectCB_GoInDirectionSequence19 -FieldObjectCB_GoInDirectionSequence19: @ 8091B10 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091B34 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence19 - - thumb_func_start sub_8091B34 -sub_8091B34: @ 8091B34 - push {r4,lr} - ldr r3, =gUnknown_0850D9F8 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091B34 - - thumb_func_start sub_8091B54 -sub_8091B54: @ 8091B54 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850DA04 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x2 - bne _08091B80 - movs r0, 0xC - ldrsh r1, [r4, r0] - movs r3, 0x10 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _08091B80 - movs r0, 0x3 - strb r0, [r2] -_08091B80: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091B54 - - thumb_func_start FieldObjectCB_GoInDirectionSequence20 -FieldObjectCB_GoInDirectionSequence20: @ 8091B9C - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091BC0 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence20 - - thumb_func_start sub_8091BC0 -sub_8091BC0: @ 8091BC0 - push {r4,lr} - ldr r3, =gUnknown_0850DA08 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091BC0 - - thumb_func_start sub_8091BE0 -sub_8091BE0: @ 8091BE0 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850DA14 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x2 - bne _08091C0C - movs r0, 0xC - ldrsh r1, [r4, r0] - movs r3, 0x10 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _08091C0C - movs r0, 0x3 - strb r0, [r2] -_08091C0C: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091BE0 - - thumb_func_start FieldObjectCB_GoInDirectionSequence21 -FieldObjectCB_GoInDirectionSequence21: @ 8091C28 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091C4C - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence21 - - thumb_func_start sub_8091C4C -sub_8091C4C: @ 8091C4C - push {r4,lr} - ldr r3, =gUnknown_0850DA18 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091C4C - - thumb_func_start sub_8091C6C -sub_8091C6C: @ 8091C6C - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850DA24 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x2 - bne _08091C98 - movs r0, 0xE - ldrsh r1, [r4, r0] - movs r3, 0x12 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _08091C98 - movs r0, 0x3 - strb r0, [r2] -_08091C98: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091C6C - - thumb_func_start FieldObjectCB_GoInDirectionSequence22 -FieldObjectCB_GoInDirectionSequence22: @ 8091CB4 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091CD8 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence22 - - thumb_func_start sub_8091CD8 -sub_8091CD8: @ 8091CD8 - push {r4,lr} - ldr r3, =gUnknown_0850DA28 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091CD8 - - thumb_func_start sub_8091CF8 -sub_8091CF8: @ 8091CF8 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850DA34 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x2 - bne _08091D24 - movs r0, 0xE - ldrsh r1, [r4, r0] - movs r3, 0x12 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _08091D24 - movs r0, 0x3 - strb r0, [r2] -_08091D24: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091CF8 - - thumb_func_start FieldObjectCB_GoInDirectionSequence23 -FieldObjectCB_GoInDirectionSequence23: @ 8091D40 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091D64 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence23 - - thumb_func_start sub_8091D64 -sub_8091D64: @ 8091D64 - push {r4,lr} - ldr r3, =gUnknown_0850DA38 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091D64 - - thumb_func_start sub_8091D84 -sub_8091D84: @ 8091D84 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850DA44 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x2 - bne _08091DB0 - movs r0, 0xC - ldrsh r1, [r4, r0] - movs r3, 0x10 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _08091DB0 - movs r0, 0x3 - strb r0, [r2] -_08091DB0: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091D84 - - thumb_func_start FieldObjectCB_GoInDirectionSequence24 -FieldObjectCB_GoInDirectionSequence24: @ 8091DCC - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091DF0 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence24 - - thumb_func_start sub_8091DF0 -sub_8091DF0: @ 8091DF0 - push {r4,lr} - ldr r3, =gUnknown_0850DA48 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091DF0 - - thumb_func_start sub_8091E10 -sub_8091E10: @ 8091E10 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850DA54 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x2 - bne _08091E3C - movs r0, 0xC - ldrsh r1, [r4, r0] - movs r3, 0x10 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _08091E3C - movs r0, 0x3 - strb r0, [r2] -_08091E3C: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091E10 - - thumb_func_start FieldObjectCB_CopyPlayer1 -FieldObjectCB_CopyPlayer1: @ 8091E58 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091E7C - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_CopyPlayer1 - - thumb_func_start sub_8091E7C -sub_8091E7C: @ 8091E7C - push {r4,lr} - ldr r3, =gUnknown_0850DA58 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091E7C - - thumb_func_start mss_npc_reset_oampriv3_1_unk2_unk3 -@ bool8 mss_npc_reset_oampriv3_1_unk2_unk3(struct npc_state *fieldObject, struct obj *object) -mss_npc_reset_oampriv3_1_unk2_unk3: @ 8091E9C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl npc_reset - adds r4, 0x21 - ldrb r0, [r4] - cmp r0, 0 - bne _08091EB4 - bl player_get_direction_lower_nybble - strb r0, [r4] -_08091EB4: - movs r0, 0x1 - strh r0, [r5, 0x30] - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end mss_npc_reset_oampriv3_1_unk2_unk3 - - thumb_func_start sub_8091EC0 -@ bool8 sub_8091EC0(struct npc_state *fieldObject, struct obj *object) -sub_8091EC0: @ 8091EC0 - push {r4-r7,lr} - adds r6, r0, 0 - adds r7, r1, 0 - ldr r2, =0x02037350 - ldr r3, =0x02037590 - ldrb r1, [r3, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1C] - cmp r0, 0xFF - beq _08091EE0 - ldrb r0, [r3, 0x3] - cmp r0, 0x2 - bne _08091EEC -_08091EE0: - movs r0, 0 - b _08091F14 - .pool -_08091EEC: - ldr r5, =gUnknown_0850DA64 - bl player_get_x22 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 22 - adds r4, r5 - bl player_get_direction_upper_nybble - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r4, [r4] - adds r0, r6, 0 - adds r1, r7, 0 - movs r3, 0 - bl _call_via_r4 - lsls r0, 24 - lsrs r0, 24 -_08091F14: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091EC0 - - thumb_func_start sub_8091F20 -sub_8091F20: @ 8091F20 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _08091F3E - ldrb r0, [r4] - movs r1, 0x3 - negs r1, r1 - ands r1, r0 - strb r1, [r4] - movs r0, 0x1 - strh r0, [r5, 0x30] -_08091F3E: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8091F20 - - thumb_func_start sub_8091F48 -sub_8091F48: @ 8091F48 - movs r0, 0 - bx lr - thumb_func_end sub_8091F48 - - thumb_func_start sub_8091F4C -sub_8091F4C: @ 8091F4C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r1, =gUnknown_085055CD - ldrb r0, [r4, 0x6] - adds r0, r1 - ldrb r0, [r0] - adds r1, r4, 0 - adds r1, 0x21 - ldrb r1, [r1] - bl state_to_direction - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - ldrb r0, [r4] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091F4C - - thumb_func_start sub_8091F94 -sub_8091F94: @ 8091F94 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r4, r0, 0 - adds r7, r1, 0 - mov r8, r3 - lsls r2, 24 - lsrs r5, r2, 24 - adds r6, r5, 0 - bl FieldObjectIsFarawayIslandMew - lsls r0, 24 - cmp r0, 0 - beq _08091FFC - bl sub_81D427C - adds r5, r0, 0 - cmp r5, 0 - bne _08092012 - adds r5, r6, 0 - ldr r1, =gUnknown_085055CD - ldrb r0, [r4, 0x6] - adds r0, r1 - ldrb r0, [r0] - adds r1, r4, 0 - adds r1, 0x21 - ldrb r1, [r1] - adds r2, r5, 0 - bl state_to_direction - adds r5, r0, 0 - mov r3, sp - adds r3, 0x2 - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl FieldObjectMoveDestCoords - adds r0, r5, 0 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r7, 0 - bl FieldObjectSetRegularAnim - b _08092084 - .pool -_08091FFC: - ldr r1, =gUnknown_085055CD - ldrb r0, [r4, 0x6] - adds r0, r1 - ldrb r0, [r0] - adds r1, r4, 0 - adds r1, 0x21 - ldrb r1, [r1] - adds r2, r5, 0 - bl state_to_direction - adds r5, r0, 0 -_08092012: - mov r6, sp - adds r6, 0x2 - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - adds r3, r6, 0 - bl FieldObjectMoveDestCoords - adds r0, r5, 0 - bl GetGoSpeed0AnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r7, 0 - bl FieldObjectSetRegularAnim - mov r0, sp - movs r2, 0 - ldrsh r1, [r0, r2] - movs r0, 0 - ldrsh r2, [r6, r0] - adds r0, r4, 0 - adds r3, r5, 0 - bl npc_block_way - lsls r0, 24 - cmp r0, 0 - bne _08092070 - mov r1, r8 - cmp r1, 0 - beq _08092084 - mov r0, sp - movs r2, 0 - ldrsh r0, [r0, r2] - movs r2, 0 - ldrsh r1, [r6, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r8 - lsls r0, 24 - cmp r0, 0 - bne _08092084 -_08092070: - adds r0, r5, 0 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r7, 0 - bl FieldObjectSetRegularAnim -_08092084: - ldrb r0, [r4] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] - movs r0, 0x2 - strh r0, [r7, 0x30] - movs r0, 0x1 - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091F94 - - thumb_func_start sub_80920A4 -sub_80920A4: @ 80920A4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r4, r0, 0 - adds r7, r1, 0 - mov r8, r3 - lsls r2, 24 - lsrs r6, r2, 24 - ldr r1, =gUnknown_085055CD - ldrb r0, [r4, 0x6] - adds r0, r1 - ldrb r0, [r0] - adds r1, r4, 0 - adds r1, 0x21 - ldrb r1, [r1] - adds r2, r6, 0 - bl state_to_direction - adds r6, r0, 0 - mov r5, sp - adds r5, 0x2 - adds r0, r4, 0 - adds r1, r6, 0 - mov r2, sp - adds r3, r5, 0 - bl FieldObjectMoveDestCoords - adds r0, r6, 0 - bl GetGoSpeed1AnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r7, 0 - bl FieldObjectSetRegularAnim - mov r0, sp - movs r2, 0 - ldrsh r1, [r0, r2] - movs r0, 0 - ldrsh r2, [r5, r0] - adds r0, r4, 0 - adds r3, r6, 0 - bl npc_block_way - lsls r0, 24 - cmp r0, 0 - bne _0809212A - mov r1, r8 - cmp r1, 0 - beq _0809213E - mov r0, sp - movs r2, 0 - ldrsh r0, [r0, r2] - movs r2, 0 - ldrsh r1, [r5, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r8 - lsls r0, 24 - cmp r0, 0 - bne _0809213E -_0809212A: - adds r0, r6, 0 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r7, 0 - bl FieldObjectSetRegularAnim -_0809213E: - ldrb r0, [r4] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] - movs r0, 0x2 - strh r0, [r7, 0x30] - movs r0, 0x1 - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80920A4 - - thumb_func_start sub_809215C -sub_809215C: @ 809215C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r4, r0, 0 - adds r7, r1, 0 - mov r8, r3 - lsls r2, 24 - lsrs r6, r2, 24 - ldr r1, =gUnknown_085055CD - ldrb r0, [r4, 0x6] - adds r0, r1 - ldrb r0, [r0] - adds r1, r4, 0 - adds r1, 0x21 - ldrb r1, [r1] - adds r2, r6, 0 - bl state_to_direction - adds r6, r0, 0 - mov r5, sp - adds r5, 0x2 - adds r0, r4, 0 - adds r1, r6, 0 - mov r2, sp - adds r3, r5, 0 - bl FieldObjectMoveDestCoords - adds r0, r6, 0 - bl GetGoSpeed3AnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r7, 0 - bl FieldObjectSetRegularAnim - mov r0, sp - movs r2, 0 - ldrsh r1, [r0, r2] - movs r0, 0 - ldrsh r2, [r5, r0] - adds r0, r4, 0 - adds r3, r6, 0 - bl npc_block_way - lsls r0, 24 - cmp r0, 0 - bne _080921E2 - mov r1, r8 - cmp r1, 0 - beq _080921F6 - mov r0, sp - movs r2, 0 - ldrsh r0, [r0, r2] - movs r2, 0 - ldrsh r1, [r5, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r8 - lsls r0, 24 - cmp r0, 0 - bne _080921F6 -_080921E2: - adds r0, r6, 0 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r7, 0 - bl FieldObjectSetRegularAnim -_080921F6: - ldrb r0, [r4] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] - movs r0, 0x2 - strh r0, [r7, 0x30] - movs r0, 0x1 - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809215C - - thumb_func_start sub_8092214 -sub_8092214: @ 8092214 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r4, r0, 0 - adds r7, r1, 0 - mov r8, r3 - lsls r2, 24 - lsrs r6, r2, 24 - ldr r1, =gUnknown_085055CD - ldrb r0, [r4, 0x6] - adds r0, r1 - ldrb r0, [r0] - adds r1, r4, 0 - adds r1, 0x21 - ldrb r1, [r1] - adds r2, r6, 0 - bl state_to_direction - adds r6, r0, 0 - mov r5, sp - adds r5, 0x2 - adds r0, r4, 0 - adds r1, r6, 0 - mov r2, sp - adds r3, r5, 0 - bl FieldObjectMoveDestCoords - adds r0, r6, 0 - bl sub_8093438 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r7, 0 - bl FieldObjectSetRegularAnim - mov r0, sp - movs r2, 0 - ldrsh r1, [r0, r2] - movs r0, 0 - ldrsh r2, [r5, r0] - adds r0, r4, 0 - adds r3, r6, 0 - bl npc_block_way - lsls r0, 24 - cmp r0, 0 - bne _0809229A - mov r1, r8 - cmp r1, 0 - beq _080922AE - mov r0, sp - movs r2, 0 - ldrsh r0, [r0, r2] - movs r2, 0 - ldrsh r1, [r5, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r8 - lsls r0, 24 - cmp r0, 0 - bne _080922AE -_0809229A: - adds r0, r6, 0 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r7, 0 - bl FieldObjectSetRegularAnim -_080922AE: - ldrb r0, [r4] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] - movs r0, 0x2 - strh r0, [r7, 0x30] - movs r0, 0x1 - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8092214 - - thumb_func_start cph_IM_DIFFERENT -cph_IM_DIFFERENT: @ 80922CC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r1, =gUnknown_085055CD - ldrb r0, [r4, 0x6] - adds r0, r1 - ldrb r0, [r0] - adds r1, r4, 0 - adds r1, 0x21 - ldrb r1, [r1] - bl state_to_direction - bl sub_80934BC - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - ldrb r0, [r4] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end cph_IM_DIFFERENT - - thumb_func_start sub_8092314 -sub_8092314: @ 8092314 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r4, r0, 0 - adds r7, r1, 0 - mov r8, r3 - lsls r2, 24 - lsrs r6, r2, 24 - ldr r1, =gUnknown_085055CD - ldrb r0, [r4, 0x6] - adds r0, r1 - ldrb r0, [r0] - adds r1, r4, 0 - adds r1, 0x21 - ldrb r1, [r1] - adds r2, r6, 0 - bl state_to_direction - adds r6, r0, 0 - mov r5, sp - adds r5, 0x2 - adds r0, r4, 0 - adds r1, r6, 0 - mov r2, sp - adds r3, r5, 0 - bl FieldObjectMoveDestCoords - adds r0, r6, 0 - bl sub_8093514 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r7, 0 - bl FieldObjectSetRegularAnim - mov r0, sp - movs r2, 0 - ldrsh r1, [r0, r2] - movs r0, 0 - ldrsh r2, [r5, r0] - adds r0, r4, 0 - adds r3, r6, 0 - bl npc_block_way - lsls r0, 24 - cmp r0, 0 - bne _0809239A - mov r1, r8 - cmp r1, 0 - beq _080923AE - mov r0, sp - movs r2, 0 - ldrsh r0, [r0, r2] - movs r2, 0 - ldrsh r1, [r5, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r8 - lsls r0, 24 - cmp r0, 0 - bne _080923AE -_0809239A: - adds r0, r6, 0 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r7, 0 - bl FieldObjectSetRegularAnim -_080923AE: - ldrb r0, [r4] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] - movs r0, 0x2 - strh r0, [r7, 0x30] - movs r0, 0x1 - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8092314 - - thumb_func_start oac_hopping -oac_hopping: @ 80923CC - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - adds r4, r0, 0 - adds r7, r1, 0 - mov r8, r3 - lsls r2, 24 - lsrs r6, r2, 24 - ldr r1, =gUnknown_085055CD - ldrb r0, [r4, 0x6] - adds r0, r1 - ldrb r0, [r0] - adds r1, r4, 0 - adds r1, 0x21 - ldrb r1, [r1] - adds r2, r6, 0 - bl state_to_direction - adds r6, r0, 0 - ldrh r1, [r4, 0x10] - add r0, sp, 0x4 - strh r1, [r0] - ldrh r0, [r4, 0x12] - mov r5, sp - adds r5, 0x6 - strh r0, [r5] - movs r0, 0x2 - str r0, [sp] - adds r0, r6, 0 - add r1, sp, 0x4 - adds r2, r5, 0 - movs r3, 0x2 - bl sub_8092F88 - adds r0, r6, 0 - bl GetJumpLedgeAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r7, 0 - bl FieldObjectSetRegularAnim - add r0, sp, 0x4 - movs r2, 0 - ldrsh r1, [r0, r2] - movs r0, 0 - ldrsh r2, [r5, r0] - adds r0, r4, 0 - adds r3, r6, 0 - bl npc_block_way - lsls r0, 24 - cmp r0, 0 - bne _08092460 - mov r1, r8 - cmp r1, 0 - beq _08092474 - add r0, sp, 0x4 - movs r2, 0 - ldrsh r0, [r0, r2] - movs r2, 0 - ldrsh r1, [r5, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r8 - lsls r0, 24 - cmp r0, 0 - bne _08092474 -_08092460: - adds r0, r6, 0 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r7, 0 - bl FieldObjectSetRegularAnim -_08092474: - ldrb r0, [r4] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] - movs r0, 0x2 - strh r0, [r7, 0x30] - movs r0, 0x1 - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end oac_hopping - - thumb_func_start FieldObjectCB_CopyPlayer2 -FieldObjectCB_CopyPlayer2: @ 8092494 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_80924B8 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_CopyPlayer2 - - thumb_func_start sub_80924B8 -sub_80924B8: @ 80924B8 - push {r4,lr} - ldr r3, =gUnknown_0850DA90 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80924B8 - - thumb_func_start mss_08062EA4 -mss_08062EA4: @ 80924D8 - push {r4-r7,lr} - adds r6, r0, 0 - adds r7, r1, 0 - ldr r2, =0x02037350 - ldr r3, =0x02037590 - ldrb r1, [r3, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1C] - cmp r0, 0xFF - beq _080924F8 - ldrb r0, [r3, 0x3] - cmp r0, 0x2 - bne _08092504 -_080924F8: - movs r0, 0 - b _0809252C - .pool -_08092504: - ldr r5, =gUnknown_0850DA64 - bl player_get_x22 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 22 - adds r4, r5 - bl player_get_direction_upper_nybble - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r3, =sub_8088E64 - ldr r4, [r4] - adds r0, r6, 0 - adds r1, r7, 0 - bl _call_via_r4 - lsls r0, 24 - lsrs r0, 24 -_0809252C: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end mss_08062EA4 - - thumb_func_start FieldObjectCB_TreeDisguise -@ void FieldObjectCB_TreeDisguise(struct obj *object) -FieldObjectCB_TreeDisguise: @ 809253C - push {r4-r6,lr} - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02037350 - adds r4, r1, r0 - adds r6, r4, 0 - adds r6, 0x21 - ldrb r0, [r6] - cmp r0, 0 - beq _08092564 - cmp r0, 0x1 - bne _08092584 - movs r1, 0x3C - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _08092584 -_08092564: - ldr r1, =0x02038c08 - adds r2, r1, 0x4 - adds r3, r1, 0 - adds r3, 0x8 - adds r0, r4, 0 - bl FieldObjectGetLocalIdAndMap - movs r0, 0x1C - bl FieldEffectStart - strb r0, [r4, 0x1A] - movs r0, 0x1 - strb r0, [r6] - ldrh r0, [r5, 0x3C] - adds r0, 0x1 - strh r0, [r5, 0x3C] -_08092584: - movs r0, 0x2E - ldrsh r1, [r5, r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - ldr r2, =sub_80925AC - adds r1, r5, 0 - bl FieldObjectStep - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_TreeDisguise - - thumb_func_start sub_80925AC -sub_80925AC: @ 80925AC - push {lr} - bl npc_reset - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_80925AC - - thumb_func_start FieldObjectCB_MountainDisguise -FieldObjectCB_MountainDisguise: @ 80925B8 - push {r4-r6,lr} - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02037350 - adds r4, r1, r0 - adds r6, r4, 0 - adds r6, 0x21 - ldrb r0, [r6] - cmp r0, 0 - beq _080925E0 - cmp r0, 0x1 - bne _08092600 - movs r1, 0x3C - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _08092600 -_080925E0: - ldr r1, =0x02038c08 - adds r2, r1, 0x4 - adds r3, r1, 0 - adds r3, 0x8 - adds r0, r4, 0 - bl FieldObjectGetLocalIdAndMap - movs r0, 0x1D - bl FieldEffectStart - strb r0, [r4, 0x1A] - movs r0, 0x1 - strb r0, [r6] - ldrh r0, [r5, 0x3C] - adds r0, 0x1 - strh r0, [r5, 0x3C] -_08092600: - movs r0, 0x2E - ldrsh r1, [r5, r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - ldr r2, =sub_80925AC - adds r1, r5, 0 - bl FieldObjectStep - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_MountainDisguise - - thumb_func_start FieldObjectCB_Hidden1 -@ void FieldObjectCB_Hidden1(struct obj *object) -FieldObjectCB_Hidden1: @ 8092628 - push {r4,lr} - adds r3, r0, 0 - movs r1, 0x3C - ldrsh r0, [r3, r1] - ldr r4, =0x02037350 - cmp r0, 0 - bne _08092668 - movs r0, 0x2E - ldrsh r1, [r3, r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0, 0x3] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0, 0x3] - adds r2, r3, 0 - adds r2, 0x42 - ldrb r1, [r2] - movs r0, 0x3F - ands r0, r1 - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - ldrb r0, [r3, 0x5] - movs r1, 0xC - orrs r0, r1 - strb r0, [r3, 0x5] - ldrh r0, [r3, 0x3C] - adds r0, 0x1 - strh r0, [r3, 0x3C] -_08092668: - movs r0, 0x2E - ldrsh r1, [r3, r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r2, =sub_809268C - adds r1, r3, 0 - bl FieldObjectStep - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_Hidden1 - - thumb_func_start sub_809268C -sub_809268C: @ 809268C - push {r4,lr} - ldr r3, =gUnknown_0850DA9C - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809268C - - thumb_func_start sub_80926AC -sub_80926AC: @ 80926AC - push {lr} - bl npc_reset - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_80926AC - - thumb_func_start sub_80926B8 -@ bool8 sub_80926B8(struct npc_state *fieldObject, struct obj *object) -sub_80926B8: @ 80926B8 - push {r4,lr} - adds r4, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _080926CA - movs r0, 0 - strh r0, [r4, 0x30] -_080926CA: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80926B8 - - thumb_func_start FieldObjectCB_WalkInPlace1 -FieldObjectCB_WalkInPlace1: @ 80926D4 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_80926F8 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_WalkInPlace1 - - thumb_func_start sub_80926F8 -sub_80926F8: @ 80926F8 - push {r4,lr} - ldr r3, =gUnknown_0850DAA0 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80926F8 - - thumb_func_start sub_8092718 -sub_8092718: @ 8092718 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl npc_reset - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetStepInPlaceDelay16AnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x1 - strh r0, [r5, 0x30] - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8092718 - - thumb_func_start FieldObjectCB_WalkInPlace4 -FieldObjectCB_WalkInPlace4: @ 8092744 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8092768 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_WalkInPlace4 - - thumb_func_start sub_8092768 -sub_8092768: @ 8092768 - push {r4,lr} - ldr r3, =gUnknown_0850DAA8 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8092768 - - thumb_func_start sub_8092788 -sub_8092788: @ 8092788 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl npc_reset - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetStepInPlaceDelay32AnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x1 - strh r0, [r5, 0x30] - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8092788 - - thumb_func_start FieldObjectCB_WalkInPlace2 -FieldObjectCB_WalkInPlace2: @ 80927B4 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_80927D8 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_WalkInPlace2 - - thumb_func_start sub_80927D8 -sub_80927D8: @ 80927D8 - push {r4,lr} - ldr r3, =gUnknown_0850DAB0 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80927D8 - - thumb_func_start sub_80927F8 -@ bool8 sub_80927F8(struct npc_state *fieldObject, struct obj *object) -sub_80927F8: @ 80927F8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl npc_reset - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetStepInPlaceDelay8AnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x1 - strh r0, [r5, 0x30] - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80927F8 - - thumb_func_start FieldObjectCB_WalkInPlace3 -FieldObjectCB_WalkInPlace3: @ 8092824 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8092848 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_WalkInPlace3 - - thumb_func_start sub_8092848 -sub_8092848: @ 8092848 - push {r4,lr} - ldr r3, =gUnknown_0850DAB8 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8092848 - - thumb_func_start sub_8092868 -sub_8092868: @ 8092868 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl npc_reset - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetStepInPlaceDelay4AnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x1 - strh r0, [r5, 0x30] - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8092868 - - thumb_func_start FieldObjectCB_Hidden2 -FieldObjectCB_Hidden2: @ 8092894 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_80928B8 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_Hidden2 - - thumb_func_start sub_80928B8 -sub_80928B8: @ 80928B8 - push {r4,lr} - ldr r3, =gUnknown_0850DAC0 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80928B8 - - thumb_func_start sub_80928D8 -sub_80928D8: @ 80928D8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl npc_reset - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - ldrb r0, [r4, 0x1] - movs r1, 0x20 - orrs r0, r1 - strb r0, [r4, 0x1] - movs r0, 0x1 - strh r0, [r5, 0x30] - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80928D8 - - thumb_func_start sub_809290C -sub_809290C: @ 809290C - push {r4,lr} - adds r4, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - bne _0809291E - movs r0, 0 - b _08092924 -_0809291E: - movs r0, 0x2 - strh r0, [r4, 0x30] - movs r0, 0x1 -_08092924: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_809290C - - thumb_func_start sub_809292C -sub_809292C: @ 809292C - ldrb r2, [r0] - movs r1, 0x3 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - movs r0, 0 - bx lr - thumb_func_end sub_809292C - - thumb_func_start npc_reset -@ void npc_reset(struct npc_state *fieldObject, struct obj *object) -npc_reset: @ 809293C - ldrb r3, [r0] - movs r2, 0x3 - negs r2, r2 - ands r2, r3 - movs r3, 0x41 - negs r3, r3 - ands r2, r3 - movs r3, 0x7F - ands r2, r3 - strb r2, [r0] - movs r2, 0xFF - strb r2, [r0, 0x1C] - movs r0, 0 - strh r0, [r1, 0x30] - bx lr - thumb_func_end npc_reset - - thumb_func_start FieldObjectDirectionToImageAnimId -@ u8 FieldObjectDirectionToImageAnimId(u8 direction) -FieldObjectDirectionToImageAnimId: @ 809295C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850DACC - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end FieldObjectDirectionToImageAnimId - - thumb_func_start get_go_image_anim_num -get_go_image_anim_num: @ 809296C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850DAD5 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end get_go_image_anim_num - - thumb_func_start get_go_fast_image_anim_num -get_go_fast_image_anim_num: @ 809297C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850DADE - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end get_go_fast_image_anim_num - - thumb_func_start get_go_faster_image_anim_num -get_go_faster_image_anim_num: @ 809298C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850DAE7 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end get_go_faster_image_anim_num - - thumb_func_start get_go_fastest_image_anim_num -get_go_fastest_image_anim_num: @ 809299C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850DAF0 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end get_go_fastest_image_anim_num - - thumb_func_start sub_80929AC -sub_80929AC: @ 80929AC - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850DAF9 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_80929AC - - thumb_func_start sub_80929BC -sub_80929BC: @ 80929BC - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850DB02 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_80929BC - - thumb_func_start sub_80929CC -sub_80929CC: @ 80929CC - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850DB0B - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_80929CC - - thumb_func_start sub_80929DC -sub_80929DC: @ 80929DC - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850DB14 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_80929DC - - thumb_func_start sub_80929EC -sub_80929EC: @ 80929EC - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850DB1D - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_80929EC - - thumb_func_start sub_80929FC -sub_80929FC: @ 80929FC - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850DB26 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_80929FC - - thumb_func_start sub_8092A0C -sub_8092A0C: @ 8092A0C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850DB2F - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8092A0C - - thumb_func_start sub_8092A1C -sub_8092A1C: @ 8092A1C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850DB38 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8092A1C - - thumb_func_start sub_8092A2C -sub_8092A2C: @ 8092A2C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850DB41 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8092A2C - - thumb_func_start get_run_image_anim_num -get_run_image_anim_num: @ 8092A3C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850DB4A - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end get_run_image_anim_num - - thumb_func_start sub_8092A4C -sub_8092A4C: @ 8092A4C - push {lr} - adds r2, r0, 0 - ldr r1, =gUnknown_085094AC - b _08092A64 - .pool -_08092A58: - ldr r0, [r1] - cmp r0, r2 - bne _08092A62 - adds r0, r1, 0 - b _08092A6C -_08092A62: - adds r1, 0x8 -_08092A64: - ldr r0, [r1] - cmp r0, 0 - bne _08092A58 - movs r0, 0 -_08092A6C: - pop {r1} - bx r1 - thumb_func_end sub_8092A4C - - thumb_func_start npc_apply_anim_looping -@ void npc_apply_anim_looping(struct npc_state *fieldObject, struct obj *object, u8 anim) -npc_apply_anim_looping: @ 8092A70 - push {r4,lr} - adds r4, r1, 0 - lsls r2, 24 - lsrs r2, 24 - ldrb r0, [r0, 0x1] - lsls r0, 27 - cmp r0, 0 - blt _08092AB2 - adds r0, r4, 0 - adds r0, 0x2A - strb r2, [r0] - ldr r0, [r4, 0x8] - bl sub_8092A4C - adds r1, r4, 0 - adds r1, 0x2B - cmp r0, 0 - beq _08092AAA - ldrb r2, [r1] - ldrb r3, [r0, 0x4] - cmp r2, r3 - bne _08092AA0 - ldrb r0, [r0, 0x7] - b _08092AA8 -_08092AA0: - ldrb r3, [r0, 0x5] - cmp r2, r3 - bne _08092AAA - ldrb r0, [r0, 0x6] -_08092AA8: - strb r0, [r1] -_08092AAA: - ldrb r1, [r1] - adds r0, r4, 0 - bl SeekObjectImageAnim -_08092AB2: - pop {r4} - pop {r0} - bx r0 - thumb_func_end npc_apply_anim_looping - - thumb_func_start obj_npc_animation_step -@ void obj_npc_animation_step(struct npc_state *fieldObject, struct obj *object, u8 anim) -obj_npc_animation_step: @ 8092AB8 - push {r4,lr} - adds r4, r1, 0 - lsls r2, 24 - lsrs r2, 24 - ldrb r0, [r0, 0x1] - lsls r0, 27 - cmp r0, 0 - blt _08092AF0 - adds r0, r4, 0 - adds r0, 0x2A - strb r2, [r0] - ldr r0, [r4, 0x8] - bl sub_8092A4C - adds r2, r0, 0 - cmp r2, 0 - beq _08092AF0 - ldrb r1, [r2, 0x5] - adds r0, r4, 0 - adds r0, 0x2B - ldrb r0, [r0] - ldrb r3, [r2, 0x4] - cmp r0, r3 - bhi _08092AEA - ldrb r1, [r2, 0x4] -_08092AEA: - adds r0, r4, 0 - bl SeekObjectImageAnim -_08092AF0: - pop {r4} - pop {r0} - bx r0 - thumb_func_end obj_npc_animation_step - - thumb_func_start sub_8092AF8 -sub_8092AF8: @ 8092AF8 - push {lr} - lsls r1, 16 - lsrs r1, 16 - lsls r3, 16 - lsrs r3, 16 - lsls r0, 16 - asrs r0, 16 - lsls r2, 16 - asrs r2, 16 - cmp r0, r2 - ble _08092B12 - movs r0, 0x3 - b _08092B28 -_08092B12: - cmp r0, r2 - bge _08092B1A - movs r0, 0x4 - b _08092B28 -_08092B1A: - lsls r1, 16 - lsls r0, r3, 16 - cmp r1, r0 - bgt _08092B26 - movs r0, 0x1 - b _08092B28 -_08092B26: - movs r0, 0x2 -_08092B28: - pop {r1} - bx r1 - thumb_func_end sub_8092AF8 - - thumb_func_start npc_set_running_behaviour_etc -npc_set_running_behaviour_etc: @ 8092B2C - push {r4,lr} - mov r12, r0 - lsls r1, 24 - lsrs r1, 24 - movs r3, 0 - strb r1, [r0, 0x6] - adds r0, 0x21 - strb r3, [r0] - adds r0, 0x1 - strb r3, [r0] - ldr r4, =0x02020630 - mov r0, r12 - ldrb r2, [r0, 0x4] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r2, r4, 0 - adds r2, 0x1C - adds r0, r2 - ldr r2, =gUnknown_08505438 - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - str r1, [r0] - mov r0, r12 - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r3, [r0, 0x30] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end npc_set_running_behaviour_etc - - thumb_func_start npc_running_behaviour_by_direction -npc_running_behaviour_by_direction: @ 8092B78 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850DB53 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end npc_running_behaviour_by_direction - - thumb_func_start sub_8092B88 -sub_8092B88: @ 8092B88 - push {r4-r6,lr} - sub sp, 0x4 - adds r6, r0, 0 - lsls r5, r1, 24 - lsrs r5, 24 - ldrh r1, [r6, 0x10] - mov r0, sp - strh r1, [r0] - ldrh r0, [r6, 0x12] - mov r4, sp - adds r4, 0x2 - strh r0, [r4] - adds r0, r5, 0 - mov r1, sp - adds r2, r4, 0 - bl MoveCoords - mov r0, sp - movs r2, 0 - ldrsh r1, [r0, r2] - movs r0, 0 - ldrsh r2, [r4, r0] - adds r0, r6, 0 - adds r3, r5, 0 - bl npc_block_way - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8092B88 - - thumb_func_start npc_block_way -@ u8 npc_block_way(struct npc_state *fieldObject, u16 x, u16 y, u8 direction) -npc_block_way: @ 8092BC8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r6, r0, 0 - lsls r1, 16 - lsls r2, 16 - lsls r3, 24 - lsrs r7, r3, 24 - mov r8, r7 - lsrs r0, r1, 16 - mov r9, r0 - asrs r5, r1, 16 - lsrs r0, r2, 16 - mov r10, r0 - asrs r4, r2, 16 - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl IsCoordOutsideFieldObjectMovementRect - lsls r0, 24 - cmp r0, 0 - beq _08092BFE - movs r0, 0x1 - b _08092C7E -_08092BFE: - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridIsImpassableAt - lsls r0, 24 - cmp r0, 0 - bne _08092C40 - adds r0, r5, 0 - adds r1, r4, 0 - bl GetMapBorderIdAt - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _08092C40 - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r4, 0 - adds r3, r7, 0 - bl IsMetatileDirectionallyImpassable - lsls r0, 24 - cmp r0, 0 - bne _08092C40 - ldrb r0, [r6, 0x1] - lsrs r0, 7 - cmp r0, 0 - beq _08092C44 - mov r0, r8 - bl CanCameraMoveInDirection - cmp r0, 0 - bne _08092C44 -_08092C40: - movs r0, 0x2 - b _08092C7E -_08092C44: - ldrb r0, [r6, 0xB] - lsls r0, 28 - lsrs r0, 28 - mov r2, r9 - lsls r1, r2, 16 - asrs r5, r1, 16 - mov r2, r10 - lsls r1, r2, 16 - asrs r4, r1, 16 - adds r1, r5, 0 - adds r2, r4, 0 - bl IsZCoordMismatchAt - lsls r0, 24 - cmp r0, 0 - beq _08092C68 - movs r0, 0x3 - b _08092C7E -_08092C68: - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl CheckForCollisionBetweenFieldObjects - lsls r0, 24 - cmp r0, 0 - bne _08092C7C - movs r0, 0 - b _08092C7E -_08092C7C: - movs r0, 0x4 -_08092C7E: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end npc_block_way - - thumb_func_start sub_8092C8C -sub_8092C8C: @ 8092C8C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r7, r0, 0 - lsls r1, 16 - lsls r2, 16 - lsls r3, 24 - lsrs r3, 24 - mov r8, r3 - lsrs r0, r1, 16 - mov r9, r0 - asrs r6, r1, 16 - lsrs r0, r2, 16 - mov r10, r0 - asrs r5, r2, 16 - adds r0, r7, 0 - adds r1, r6, 0 - adds r2, r5, 0 - bl IsCoordOutsideFieldObjectMovementRect - lsls r0, 24 - lsrs r0, 24 - negs r1, r0 - orrs r1, r0 - lsrs r4, r1, 31 - adds r0, r6, 0 - adds r1, r5, 0 - bl MapGridIsImpassableAt - lsls r0, 24 - cmp r0, 0 - bne _08092D04 - adds r0, r6, 0 - adds r1, r5, 0 - bl GetMapBorderIdAt - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _08092D04 - adds r0, r7, 0 - adds r1, r6, 0 - adds r2, r5, 0 - mov r3, r8 - bl IsMetatileDirectionallyImpassable - lsls r0, 24 - cmp r0, 0 - bne _08092D04 - ldrb r0, [r7, 0x1] - lsrs r0, 7 - cmp r0, 0 - beq _08092D08 - mov r0, r8 - bl CanCameraMoveInDirection - cmp r0, 0 - bne _08092D08 -_08092D04: - movs r0, 0x2 - orrs r4, r0 -_08092D08: - ldrb r0, [r7, 0xB] - lsls r0, 28 - lsrs r0, 28 - mov r2, r9 - lsls r1, r2, 16 - asrs r6, r1, 16 - mov r2, r10 - lsls r1, r2, 16 - asrs r5, r1, 16 - adds r1, r6, 0 - adds r2, r5, 0 - bl IsZCoordMismatchAt - lsls r0, 24 - cmp r0, 0 - beq _08092D30 - movs r0, 0x4 - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_08092D30: - adds r0, r7, 0 - adds r1, r6, 0 - adds r2, r5, 0 - bl CheckForCollisionBetweenFieldObjects - lsls r0, 24 - cmp r0, 0 - beq _08092D48 - movs r0, 0x8 - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_08092D48: - adds r0, r4, 0 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8092C8C - - thumb_func_start IsCoordOutsideFieldObjectMovementRect -@ bool8 IsCoordOutsideFieldObjectMovementRect(struct npc_state *fieldObject, u16 x, u16 y) -IsCoordOutsideFieldObjectMovementRect: @ 8092D58 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r1, 16 - lsrs r3, r1, 16 - lsls r2, 16 - lsrs r5, r2, 16 - ldrb r1, [r4, 0x19] - movs r0, 0xF - ands r0, r1 - cmp r0, 0 - beq _08092D90 - lsls r1, 28 - lsrs r2, r1, 28 - ldrh r0, [r4, 0xC] - subs r2, r0, r2 - lsrs r1, 28 - adds r0, r1 - lsls r0, 16 - lsrs r1, r0, 16 - lsls r2, 16 - lsls r0, r3, 16 - asrs r3, r0, 16 - cmp r2, r0 - bgt _08092DBC - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, r3 - blt _08092DBC -_08092D90: - ldrb r1, [r4, 0x19] - movs r0, 0xF0 - ands r0, r1 - cmp r0, 0 - beq _08092DC0 - lsls r1, 24 - lsrs r2, r1, 28 - ldrh r0, [r4, 0xE] - subs r2, r0, r2 - lsrs r1, 28 - adds r0, r1 - lsls r0, 16 - lsrs r1, r0, 16 - lsls r2, 16 - lsls r0, r5, 16 - asrs r3, r0, 16 - cmp r2, r0 - bgt _08092DBC - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, r3 - bge _08092DC0 -_08092DBC: - movs r0, 0x1 - b _08092DC2 -_08092DC0: - movs r0, 0 -_08092DC2: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end IsCoordOutsideFieldObjectMovementRect - - thumb_func_start IsMetatileDirectionallyImpassable -@ bool8 IsMetatileDirectionallyImpassable(struct npc_state *fieldObject, u16 x, u16 y, u8 direction) -IsMetatileDirectionallyImpassable: @ 8092DC8 - push {r4-r7,lr} - lsls r1, 16 - lsrs r6, r1, 16 - lsls r2, 16 - lsrs r7, r2, 16 - lsls r3, 24 - ldr r1, =gUnknown_0850DB5C - lsrs r3, 22 - subs r5, r3, 0x4 - adds r1, r5, r1 - ldrb r0, [r0, 0x1E] - ldr r1, [r1] - bl _call_via_r1 - lsls r0, 24 - cmp r0, 0 - bne _08092E0A - ldr r4, =gUnknown_0850DB6C - adds r4, r5, r4 - lsls r0, r6, 16 - asrs r0, 16 - lsls r1, r7, 16 - asrs r1, 16 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - ldr r1, [r4] - bl _call_via_r1 - lsls r0, 24 - cmp r0, 0 - beq _08092E18 -_08092E0A: - movs r0, 0x1 - b _08092E1A - .pool -_08092E18: - movs r0, 0 -_08092E1A: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end IsMetatileDirectionallyImpassable - - thumb_func_start CheckForCollisionBetweenFieldObjects -@ bool8 CheckForCollisionBetweenFieldObjects(struct npc_state *fieldObject, u16 x, u16 y) -CheckForCollisionBetweenFieldObjects: @ 8092E20 - push {r4-r7,lr} - adds r6, r0, 0 - lsls r1, 16 - lsrs r7, r1, 16 - movs r4, 0 - lsls r2, 16 - asrs r5, r2, 16 -_08092E2E: - lsls r0, r4, 3 - adds r0, r4 - lsls r0, 2 - ldr r1, =0x02037350 - adds r2, r0, r1 - ldrb r0, [r2] - lsls r0, 31 - cmp r0, 0 - beq _08092E88 - cmp r2, r6 - beq _08092E88 - movs r0, 0x10 - ldrsh r1, [r2, r0] - lsls r0, r7, 16 - asrs r3, r0, 16 - cmp r1, r3 - bne _08092E58 - movs r1, 0x12 - ldrsh r0, [r2, r1] - cmp r0, r5 - beq _08092E68 -_08092E58: - movs r1, 0x14 - ldrsh r0, [r2, r1] - cmp r0, r3 - bne _08092E88 - movs r1, 0x16 - ldrsh r0, [r2, r1] - cmp r0, r5 - bne _08092E88 -_08092E68: - ldrb r0, [r6, 0xB] - lsls r0, 28 - lsrs r0, 28 - ldrb r1, [r2, 0xB] - lsls r1, 28 - lsrs r1, 28 - bl AreZCoordsCompatible - lsls r0, 24 - cmp r0, 0 - beq _08092E88 - movs r0, 0x1 - b _08092E94 - .pool -_08092E88: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _08092E2E - movs r0, 0 -_08092E94: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end CheckForCollisionBetweenFieldObjects - - thumb_func_start sub_8092E9C -sub_8092E9C: @ 8092E9C - push {lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _08092EE8 - ldr r3, =0x02020630 - ldr r2, =0x02037350 - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x3C] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08092EE8 - movs r0, 0x1 - b _08092EEA - .pool -_08092EE8: - movs r0, 0 -_08092EEA: - add sp, 0x4 - pop {r1} - bx r1 - thumb_func_end sub_8092E9C - - thumb_func_start sub_8092EF0 -sub_8092EF0: @ 8092EF0 - push {lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _08092F2E - ldr r3, =0x02020630 - ldr r2, =0x02037350 - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r2, [r1, 0x3C] - movs r0, 0x4 - orrs r0, r2 - strh r0, [r1, 0x3C] -_08092F2E: - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8092EF0 - - thumb_func_start MoveCoords -@ void MoveCoords(u8 direction, u16 *x, u16 *y) -MoveCoords: @ 8092F3C - push {r4,lr} - lsls r0, 24 - ldr r3, =gUnknown_0850DB7C - lsrs r0, 22 - adds r0, r3 - ldrh r3, [r0] - ldrh r4, [r1] - adds r3, r4 - strh r3, [r1] - ldrh r0, [r0, 0x2] - ldrh r1, [r2] - adds r0, r1 - strh r0, [r2] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end MoveCoords - - thumb_func_start sub_8092F60 -sub_8092F60: @ 8092F60 - push {r4,lr} - lsls r0, 24 - ldr r3, =gUnknown_0850DB7C - lsrs r0, 22 - adds r0, r3 - ldrh r3, [r0] - lsls r3, 4 - ldrh r4, [r1] - adds r3, r4 - strh r3, [r1] - ldrh r0, [r0, 0x2] - lsls r0, 4 - ldrh r1, [r2] - adds r0, r1 - strh r0, [r2] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8092F60 - - thumb_func_start sub_8092F88 -sub_8092F88: @ 8092F88 - push {r4-r7,lr} - adds r4, r1, 0 - ldr r1, [sp, 0x14] - lsls r0, 24 - lsls r3, 16 - lsrs r3, 16 - adds r7, r3, 0 - lsls r1, 16 - lsrs r6, r1, 16 - mov r12, r6 - ldr r1, =gUnknown_0850DB7C - lsrs r0, 22 - adds r5, r0, r1 - movs r0, 0 - ldrsh r1, [r5, r0] - cmp r1, 0 - ble _08092FB4 - lsls r0, r3, 16 - asrs r0, 16 - ldrh r3, [r4] - adds r0, r3 - strh r0, [r4] -_08092FB4: - cmp r1, 0 - bge _08092FC2 - ldrh r1, [r4] - lsls r0, r7, 16 - asrs r0, 16 - subs r1, r0 - strh r1, [r4] -_08092FC2: - movs r0, 0x2 - ldrsh r1, [r5, r0] - cmp r1, 0 - ble _08092FD4 - lsls r0, r6, 16 - asrs r0, 16 - ldrh r3, [r2] - adds r0, r3 - strh r0, [r2] -_08092FD4: - cmp r1, 0 - bge _08092FE4 - ldrh r1, [r2] - mov r3, r12 - lsls r0, r3, 16 - asrs r0, 16 - subs r1, r0 - strh r1, [r2] -_08092FE4: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8092F88 - - thumb_func_start sub_8092FF0 -sub_8092FF0: @ 8092FF0 - push {r4,r5,lr} - ldr r5, =0x03005d8c - ldr r4, [r5] - ldrh r4, [r4] - lsls r0, 16 - asrs r0, 16 - subs r0, r4 - lsls r0, 4 - strh r0, [r2] - ldr r0, [r5] - ldrh r0, [r0, 0x2] - lsls r1, 16 - asrs r1, 16 - subs r1, r0 - lsls r1, 4 - strh r1, [r3] - ldr r1, =0x03005dec - ldrh r0, [r2] - ldrh r1, [r1] - subs r0, r1 - strh r0, [r2] - ldr r1, =0x03005de8 - ldrh r0, [r3] - ldrh r1, [r1] - subs r0, r1 - strh r0, [r3] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8092FF0 - - thumb_func_start sub_8093038 -sub_8093038: @ 8093038 - push {r4-r7,lr} - adds r7, r2, 0 - mov r12, r3 - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 16 - lsrs r6, r1, 16 - ldr r0, =0x03005dec - ldrh r0, [r0] - negs r0, r0 - ldr r1, =0x03005dd0 - ldr r2, [r1, 0x10] - subs r0, r2 - lsls r0, 16 - lsrs r3, r0, 16 - ldr r0, =0x03005de8 - ldrh r0, [r0] - negs r0, r0 - ldr r1, [r1, 0x14] - subs r0, r1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r2, 0 - ble _08093072 - lsls r0, r3, 16 - movs r3, 0x80 - lsls r3, 13 - adds r0, r3 - lsrs r3, r0, 16 -_08093072: - cmp r2, 0 - bge _0809307E - lsls r0, r3, 16 - ldr r2, =0xfff00000 - adds r0, r2 - lsrs r3, r0, 16 -_0809307E: - cmp r1, 0 - ble _0809308C - lsls r0, r4, 16 - movs r2, 0x80 - lsls r2, 13 - adds r0, r2 - lsrs r4, r0, 16 -_0809308C: - cmp r1, 0 - bge _08093098 - lsls r0, r4, 16 - ldr r1, =0xfff00000 - adds r0, r1 - lsrs r4, r0, 16 -_08093098: - ldr r2, =0x03005d8c - ldr r0, [r2] - ldrh r1, [r0] - lsls r0, r5, 16 - asrs r0, 16 - subs r0, r1 - lsls r0, 4 - lsls r1, r3, 16 - asrs r1, 16 - adds r1, r0 - strh r1, [r7] - ldr r0, [r2] - ldrh r1, [r0, 0x2] - lsls r0, r6, 16 - asrs r0, 16 - subs r0, r1 - lsls r0, 4 - lsls r1, r4, 16 - asrs r1, 16 - adds r1, r0 - mov r2, r12 - strh r1, [r2] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8093038 - - thumb_func_start sub_80930E0 -sub_80930E0: @ 80930E0 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r6, r0, 0 - mov r8, r1 - adds r4, r2, 0 - adds r5, r3, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - movs r1, 0 - ldrsh r0, [r6, r1] - mov r2, r8 - movs r3, 0 - ldrsh r1, [r2, r3] - adds r2, r6, 0 - mov r3, r8 - bl sub_8093038 - lsls r4, 16 - asrs r4, 16 - ldrh r0, [r6] - adds r4, r0 - strh r4, [r6] - lsls r5, 16 - asrs r5, 16 - mov r1, r8 - ldrh r1, [r1] - adds r5, r1 - mov r2, r8 - strh r5, [r2] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80930E0 - - thumb_func_start GetFieldObjectMovingCameraOffset -@ void GetFieldObjectMovingCameraOffset(s16 *x, s16 *y) -GetFieldObjectMovingCameraOffset: @ 809312C - push {lr} - adds r2, r0, 0 - movs r0, 0 - strh r0, [r2] - strh r0, [r1] - ldr r3, =0x03005dd0 - ldr r0, [r3, 0x10] - cmp r0, 0 - ble _08093142 - movs r0, 0x1 - strh r0, [r2] -_08093142: - ldr r0, [r3, 0x10] - cmp r0, 0 - bge _0809314E - ldrh r0, [r2] - subs r0, 0x1 - strh r0, [r2] -_0809314E: - ldr r2, [r3, 0x14] - cmp r2, 0 - ble _0809315A - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_0809315A: - cmp r2, 0 - bge _08093164 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] -_08093164: - pop {r0} - bx r0 - .pool - thumb_func_end GetFieldObjectMovingCameraOffset - - thumb_func_start FieldObjectMoveDestCoords -@ void FieldObjectMoveDestCoords(struct npc_state *fieldObject, u8 direction) -FieldObjectMoveDestCoords: @ 809316C - push {r4,lr} - lsls r1, 24 - lsrs r1, 24 - ldrh r4, [r0, 0x10] - strh r4, [r2] - ldrh r0, [r0, 0x12] - strh r0, [r3] - adds r0, r1, 0 - adds r1, r2, 0 - adds r2, r3, 0 - bl MoveCoords - pop {r4} - pop {r0} - bx r0 - thumb_func_end FieldObjectMoveDestCoords - - thumb_func_start FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive -@ bool8 FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive(struct npc_state *fieldObject) -FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive: @ 809318C - push {lr} - ldrb r1, [r0] - movs r0, 0x42 - ands r0, r1 - cmp r0, 0 - bne _0809319C - movs r0, 0 - b _0809319E -_0809319C: - movs r0, 0x1 -_0809319E: - pop {r1} - bx r1 - thumb_func_end FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - - thumb_func_start FieldObjectIsSpecialAnimActive -@ bool8 FieldObjectIsSpecialAnimActive(struct npc_state *fieldObject) -FieldObjectIsSpecialAnimActive: @ 80931A4 - push {lr} - adds r1, r0, 0 - ldrb r0, [r1] - lsls r0, 25 - cmp r0, 0 - bge _080931BA - ldrb r0, [r1, 0x1C] - cmp r0, 0xFF - beq _080931BA - movs r0, 0x1 - b _080931BC -_080931BA: - movs r0, 0 -_080931BC: - pop {r1} - bx r1 - thumb_func_end FieldObjectIsSpecialAnimActive - - thumb_func_start FieldObjectSetSpecialAnim -@ bool8 FieldObjectSetSpecialAnim(struct npc_state *fieldObject, u8 animId) -FieldObjectSetSpecialAnim: @ 80931C0 - push {r4-r6,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - bne _08093200 - adds r0, r4, 0 - bl npc_sync_anim_pause_bits - strb r5, [r4, 0x1C] - ldrb r0, [r4] - movs r1, 0x40 - orrs r0, r1 - movs r1, 0x7F - ands r0, r1 - strb r0, [r4] - ldr r2, =0x02020630 - ldrb r1, [r4, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r6, [r0, 0x32] - movs r0, 0 - b _08093202 - .pool -_08093200: - movs r0, 0x1 -_08093202: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end FieldObjectSetSpecialAnim - - thumb_func_start FieldObjectForceSetSpecialAnim -@ void FieldObjectForceSetSpecialAnim(struct npc_state *fieldObject, u8 animId) -FieldObjectForceSetSpecialAnim: @ 8093208 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r4, r1, 24 - lsrs r4, 24 - bl FieldObjectClearAnimIfSpecialAnimActive - adds r0, r5, 0 - adds r1, r4, 0 - bl FieldObjectSetSpecialAnim - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end FieldObjectForceSetSpecialAnim - - thumb_func_start FieldObjectClearAnimIfSpecialAnimActive -@ void FieldObjectClearAnimIfSpecialAnimActive(struct npc_state *fieldObject) -FieldObjectClearAnimIfSpecialAnimActive: @ 8093224 - push {lr} - adds r1, r0, 0 - ldrb r0, [r1] - lsls r0, 25 - cmp r0, 0 - bge _08093236 - adds r0, r1, 0 - bl FieldObjectClearAnim -_08093236: - pop {r0} - bx r0 - thumb_func_end FieldObjectClearAnimIfSpecialAnimActive - - thumb_func_start FieldObjectClearAnim -@ void FieldObjectClearAnim(struct npc_state *fieldObject) -FieldObjectClearAnim: @ 809323C - movs r1, 0xFF - strb r1, [r0, 0x1C] - ldrb r2, [r0] - movs r1, 0x41 - negs r1, r1 - ands r1, r2 - movs r2, 0x7F - ands r1, r2 - strb r1, [r0] - ldr r3, =0x02020630 - ldrb r2, [r0, 0x4] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r3 - movs r2, 0 - strh r2, [r1, 0x30] - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r2, [r0, 0x32] - bx lr - .pool - thumb_func_end FieldObjectClearAnim - - thumb_func_start FieldObjectCheckIfSpecialAnimFinishedOrInactive -@ u8 FieldObjectCheckIfSpecialAnimFinishedOrInactive(struct npc_state *fieldObject) -FieldObjectCheckIfSpecialAnimFinishedOrInactive: @ 8093270 - push {lr} - ldrb r1, [r0] - lsls r0, r1, 25 - cmp r0, 0 - blt _0809327E - movs r0, 0x10 - b _08093280 -_0809327E: - lsrs r0, r1, 7 -_08093280: - pop {r1} - bx r1 - thumb_func_end FieldObjectCheckIfSpecialAnimFinishedOrInactive - - thumb_func_start FieldObjectClearAnimIfSpecialAnimFinished -@ u8 FieldObjectClearAnimIfSpecialAnimFinished(struct npc_state *fieldObject) -FieldObjectClearAnimIfSpecialAnimFinished: @ 8093284 - push {r4,r5,lr} - adds r5, r0, 0 - bl FieldObjectCheckIfSpecialAnimFinishedOrInactive - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _0809329E - cmp r4, 0x10 - beq _0809329E - adds r0, r5, 0 - bl FieldObjectClearAnimIfSpecialAnimActive -_0809329E: - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end FieldObjectClearAnimIfSpecialAnimFinished - - thumb_func_start FieldObjectGetSpecialAnim -@ u8 FieldObjectGetSpecialAnim(struct npc_state *fieldObject) -FieldObjectGetSpecialAnim: @ 80932A8 - push {lr} - adds r1, r0, 0 - ldrb r0, [r1] - lsls r0, 25 - cmp r0, 0 - blt _080932B8 - movs r0, 0xFF - b _080932BA -_080932B8: - ldrb r0, [r1, 0x1C] -_080932BA: - pop {r1} - bx r1 - thumb_func_end FieldObjectGetSpecialAnim - - thumb_func_start FieldObjectStep -@ void FieldObjectStep(struct npc_state *fieldObject, struct obj *object, bool8 ( *callback)(struct npc_state *fieldObject, struct obj *object)) -FieldObjectStep: @ 80932C0 - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - bl DoGroundEffects_OnSpawn - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80964E8 - adds r0, r4, 0 - bl FieldObjectIsSpecialAnimActive - lsls r0, 24 - cmp r0, 0 - beq _080932EA - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectExecSpecialAnim - b _08093300 -_080932EA: - ldrb r0, [r4, 0x1] - lsls r0, 31 - cmp r0, 0 - bne _08093300 -_080932F2: - adds r0, r4, 0 - adds r1, r5, 0 - bl _call_via_r6 - lsls r0, 24 - cmp r0, 0 - bne _080932F2 -_08093300: - adds r0, r4, 0 - adds r1, r5, 0 - bl DoGroundEffects_OnBeginStep - adds r0, r4, 0 - adds r1, r5, 0 - bl DoGroundEffects_OnFinishStep - adds r0, r4, 0 - adds r1, r5, 0 - bl npc_obj_transfer_image_anim_pause_flag - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8096518 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectUpdateSubpriority - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end FieldObjectStep - - thumb_func_start GetFaceDirectionAnimId -@ u8 GetFaceDirectionAnimId(u8 direction) -GetFaceDirectionAnimId: @ 8093330 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBA0 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _08093348 - movs r4, 0 -_08093348: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetFaceDirectionAnimId - - thumb_func_start GetSimpleGoAnimId -@ u8 GetSimpleGoAnimId(u8 direction) -GetSimpleGoAnimId: @ 809335C - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBA5 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _08093374 - movs r4, 0 -_08093374: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetSimpleGoAnimId - - thumb_func_start GetGoSpeed0AnimId -@ u8 GetGoSpeed0AnimId(u8 direction) -GetGoSpeed0AnimId: @ 8093388 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBAA - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _080933A0 - movs r4, 0 -_080933A0: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetGoSpeed0AnimId - - thumb_func_start GetGoSpeed1AnimId -@ u8 GetGoSpeed1AnimId(u8 direction) -GetGoSpeed1AnimId: @ 80933B4 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBAF - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _080933CC - movs r4, 0 -_080933CC: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetGoSpeed1AnimId - - thumb_func_start GetGoSpeed2AnimId -@ u8 GetGoSpeed2AnimId(u8 direction) -GetGoSpeed2AnimId: @ 80933E0 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBB4 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _080933F8 - movs r4, 0 -_080933F8: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetGoSpeed2AnimId - - thumb_func_start GetGoSpeed3AnimId -@ u8 GetGoSpeed3AnimId(u8 direction) -GetGoSpeed3AnimId: @ 809340C - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBB9 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _08093424 - movs r4, 0 -_08093424: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetGoSpeed3AnimId - - thumb_func_start sub_8093438 -@ u8 sub_8093438(u8 direction) -sub_8093438: @ 8093438 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBBE - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _08093450 - movs r4, 0 -_08093450: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8093438 - - thumb_func_start GetRunAnimId -@ u8 GetRunAnimId(u8 direction) -GetRunAnimId: @ 8093464 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBC3 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _0809347C - movs r4, 0 -_0809347C: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetRunAnimId - - thumb_func_start GetJumpLedgeAnimId -@ u8 GetJumpLedgeAnimId(u8 direction) -GetJumpLedgeAnimId: @ 8093490 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBC8 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _080934A8 - movs r4, 0 -_080934A8: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetJumpLedgeAnimId - - thumb_func_start sub_80934BC -@ u8 sub_80934BC(u8 direction) -sub_80934BC: @ 80934BC - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBCD - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _080934D4 - movs r4, 0 -_080934D4: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80934BC - - thumb_func_start sub_80934E8 -@ u8 sub_80934E8(u8 direction) -sub_80934E8: @ 80934E8 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBD2 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _08093500 - movs r4, 0 -_08093500: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80934E8 - - thumb_func_start sub_8093514 -@ u8 sub_8093514(u8 direction) -sub_8093514: @ 8093514 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBD7 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _0809352C - movs r4, 0 -_0809352C: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8093514 - - thumb_func_start sub_8093540 -@ u8 sub_8093540(u8 direction) -sub_8093540: @ 8093540 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBDC - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _08093558 - movs r4, 0 -_08093558: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8093540 - - thumb_func_start GetStepInPlaceDelay32AnimId -@ u8 GetStepInPlaceDelay32AnimId(u8 direction) -GetStepInPlaceDelay32AnimId: @ 809356C - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBE1 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _08093584 - movs r4, 0 -_08093584: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetStepInPlaceDelay32AnimId - - thumb_func_start GetStepInPlaceDelay16AnimId -@ u8 GetStepInPlaceDelay16AnimId(u8 direction) -GetStepInPlaceDelay16AnimId: @ 8093598 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBE6 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _080935B0 - movs r4, 0 -_080935B0: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetStepInPlaceDelay16AnimId - - thumb_func_start GetStepInPlaceDelay8AnimId -@ u8 GetStepInPlaceDelay8AnimId(u8 direction) -GetStepInPlaceDelay8AnimId: @ 80935C4 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBEB - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _080935DC - movs r4, 0 -_080935DC: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetStepInPlaceDelay8AnimId - - thumb_func_start GetStepInPlaceDelay4AnimId -@ u8 GetStepInPlaceDelay4AnimId(u8 direction) -GetStepInPlaceDelay4AnimId: @ 80935F0 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBF0 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _08093608 - movs r4, 0 -_08093608: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetStepInPlaceDelay4AnimId - - thumb_func_start FieldObjectFaceOppositeDirection -@ bool8 FieldObjectFaceOppositeDirection(struct npc_state *fieldObject, u8 direction) -FieldObjectFaceOppositeDirection: @ 809361C - push {r4,lr} - adds r4, r0, 0 - lsls r0, r1, 24 - lsrs r0, 24 - bl GetOppositeDirection - lsls r0, 24 - lsrs r0, 24 - bl GetFaceDirectionAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - thumb_func_end FieldObjectFaceOppositeDirection - - thumb_func_start sub_8093648 -sub_8093648: @ 8093648 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBF5 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _08093660 - movs r4, 0 -_08093660: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8093648 - - thumb_func_start sub_8093674 -sub_8093674: @ 8093674 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBFA - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _0809368C - movs r4, 0 -_0809368C: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8093674 - - thumb_func_start sub_80936A0 -sub_80936A0: @ 80936A0 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBFF - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _080936B8 - movs r4, 0 -_080936B8: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80936A0 - - thumb_func_start sub_80936CC -sub_80936CC: @ 80936CC - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DC04 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _080936E4 - movs r4, 0 -_080936E4: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80936CC - - thumb_func_start sub_80936F8 -sub_80936F8: @ 80936F8 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DC09 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _08093710 - movs r4, 0 -_08093710: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80936F8 - - thumb_func_start sub_8093724 -sub_8093724: @ 8093724 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DC0E - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _0809373C - movs r4, 0 -_0809373C: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8093724 - - thumb_func_start sub_8093750 -sub_8093750: @ 8093750 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DC13 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _08093768 - movs r4, 0 -_08093768: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8093750 - - thumb_func_start sub_809377C -sub_809377C: @ 809377C - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DC18 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _08093794 - movs r4, 0 -_08093794: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809377C - - thumb_func_start sub_80937A8 -sub_80937A8: @ 80937A8 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DC1D - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _080937C0 - movs r4, 0 -_080937C0: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80937A8 - - thumb_func_start d2s_08064034 -d2s_08064034: @ 80937D4 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DC22 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _080937EC - movs r4, 0 -_080937EC: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end d2s_08064034 - - thumb_func_start GetOppositeDirection -@ u8 GetOppositeDirection(u8 direction) -GetOppositeDirection: @ 8093800 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DC27 - mov r0, sp - movs r2, 0x8 - bl memcpy - subs r1, r4, 0x1 - lsls r0, r1, 24 - lsrs r0, 24 - cmp r0, 0x7 - bhi _08093828 - mov r2, sp - adds r0, r2, r1 - ldrb r0, [r0] - b _0809382A - .pool -_08093828: - adds r0, r4, 0 -_0809382A: - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - thumb_func_end GetOppositeDirection - - thumb_func_start zffu_offset_calc -zffu_offset_calc: @ 8093834 - lsls r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_0850DC2F - lsrs r0, 22 - subs r0, 0x5 - adds r1, r0 - adds r1, r2 - ldrb r0, [r1] - bx lr - .pool - thumb_func_end zffu_offset_calc - - thumb_func_start state_to_direction -state_to_direction: @ 809384C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r1, 24 - adds r0, r1, 0 - lsls r2, 24 - lsrs r2, 24 - cmp r1, 0 - beq _0809386C - cmp r2, 0 - beq _0809386C - cmp r1, 0x4 - bhi _0809386C - cmp r2, 0x4 - bls _08093870 -_0809386C: - movs r0, 0 - b _08093882 -_08093870: - adds r1, r2, 0 - bl zffu_offset_calc - ldr r2, =gUnknown_0850DC3F - lsls r1, r4, 2 - subs r1, 0x5 - adds r0, r1 - adds r0, r2 - ldrb r0, [r0] -_08093882: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end state_to_direction - - thumb_func_start FieldObjectExecSpecialAnim -@ void FieldObjectExecSpecialAnim(struct npc_state *fieldObject, struct obj *object) -FieldObjectExecSpecialAnim: @ 809388C - push {r4,lr} - adds r4, r0, 0 - ldr r2, =gUnknown_0850DC50 - ldrb r0, [r4, 0x1C] - lsls r0, 2 - adds r0, r2 - movs r3, 0x32 - ldrsh r2, [r1, r3] - ldr r0, [r0] - lsls r2, 2 - adds r2, r0 - ldr r2, [r2] - adds r0, r4, 0 - bl _call_via_r2 - lsls r0, 24 - cmp r0, 0 - beq _080938B8 - ldrb r0, [r4] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r4] -_080938B8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectExecSpecialAnim - - thumb_func_start FieldObjectExecRegularAnim -@ bool8 FieldObjectExecRegularAnim(struct npc_state *fieldObject, struct obj *object) -FieldObjectExecRegularAnim: @ 80938C4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850DC50 - ldrb r0, [r4, 0x1C] - lsls r0, 2 - adds r0, r1 - movs r2, 0x32 - ldrsh r1, [r5, r2] - ldr r0, [r0] - lsls r1, 2 - adds r1, r0 - ldr r2, [r1] - adds r0, r4, 0 - adds r1, r5, 0 - bl _call_via_r2 - lsls r0, 24 - cmp r0, 0 - bne _080938F4 - movs r0, 0 - b _080938FE - .pool -_080938F4: - movs r0, 0xFF - strb r0, [r4, 0x1C] - movs r0, 0 - strh r0, [r5, 0x32] - movs r0, 0x1 -_080938FE: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end FieldObjectExecRegularAnim - - thumb_func_start FieldObjectSetRegularAnim -@ void FieldObjectSetRegularAnim(struct npc_state *fieldObject, struct obj *object, u8 animState) -FieldObjectSetRegularAnim: @ 8093904 - movs r3, 0 - strb r2, [r0, 0x1C] - strh r3, [r1, 0x32] - bx lr - thumb_func_end FieldObjectSetRegularAnim - - thumb_func_start an_look_any -@ void an_look_any(struct npc_state *fieldObject, struct obj *object, u8 direction) -an_look_any: @ 809390C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r1, r2, 24 - lsrs r1, 24 - bl FieldObjectSetDirection - adds r0, r4, 0 - bl npc_coords_shift_still - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl get_go_image_anim_num - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl obj_npc_animation_step - adds r2, r5, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x1 - strh r0, [r5, 0x32] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end an_look_any - - thumb_func_start sub_8093950 -sub_8093950: @ 8093950 - push {lr} - movs r2, 0x1 - bl an_look_any - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_8093950 - - thumb_func_start sub_8093960 -sub_8093960: @ 8093960 - push {lr} - movs r2, 0x2 - bl an_look_any - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_8093960 - - thumb_func_start sub_8093970 -sub_8093970: @ 8093970 - push {lr} - movs r2, 0x3 - bl an_look_any - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_8093970 - - thumb_func_start sub_8093980 -sub_8093980: @ 8093980 - push {lr} - movs r2, 0x4 - bl an_look_any - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_8093980 - - thumb_func_start npc_apply_direction -@ void npc_apply_direction(struct npc_state *fieldObject, struct obj *object, u8 direction, u8 speed) -npc_apply_direction: @ 8093990 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r7, r0, 0 - mov r8, r1 - adds r4, r2, 0 - adds r6, r3, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r6, 24 - lsrs r6, 24 - ldrh r1, [r7, 0x10] - mov r0, sp - strh r1, [r0] - ldrh r0, [r7, 0x12] - mov r5, sp - adds r5, 0x2 - strh r0, [r5] - adds r0, r7, 0 - adds r1, r4, 0 - bl FieldObjectSetDirection - adds r0, r4, 0 - mov r1, sp - adds r2, r5, 0 - bl MoveCoords - mov r0, sp - movs r2, 0 - ldrsh r1, [r0, r2] - movs r0, 0 - ldrsh r2, [r5, r0] - adds r0, r7, 0 - bl npc_coords_shift - mov r0, r8 - adds r1, r4, 0 - adds r2, r6, 0 - bl oamt_npc_ministep_reset - mov r4, r8 - adds r4, 0x2C - ldrb r1, [r4] - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - strb r0, [r4] - ldr r0, =0x020375b8 - ldr r0, [r0] - cmp r0, 0 - beq _08093A0E - adds r0, r7, 0 - bl sub_8097F78 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x10 - beq _08093A0E - ldrb r0, [r4] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r4] -_08093A0E: - ldrb r0, [r7] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r7] - movs r0, 0x1 - mov r1, r8 - strh r0, [r1, 0x32] - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end npc_apply_direction - - thumb_func_start do_go_anim -@ void do_go_anim(struct npc_state *fieldObject, struct obj *object, u8 direction, u8 speed) -do_go_anim: @ 8093A2C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x14 - adds r5, r0, 0 - mov r8, r1 - adds r4, r3, 0 - lsls r2, 24 - lsrs r2, 24 - lsls r4, 24 - lsrs r4, 24 - mov r1, sp - ldr r0, =gUnknown_0850DEE8 - ldm r0!, {r3,r6,r7} - stm r1!, {r3,r6,r7} - ldm r0!, {r3,r6} - stm r1!, {r3,r6} - adds r0, r5, 0 - mov r1, r8 - adds r3, r4, 0 - bl npc_apply_direction - lsls r4, 2 - mov r7, sp - adds r1, r7, r4 - ldrb r0, [r5, 0x18] - lsls r0, 28 - lsrs r0, 28 - ldr r1, [r1] - bl _call_via_r1 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r5, 0 - mov r1, r8 - bl npc_apply_anim_looping - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end do_go_anim - - thumb_func_start do_run_anim -@ void do_run_anim(struct npc_state *fieldObject, struct obj *object, u8 direction) -do_run_anim: @ 8093A88 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r2, 24 - lsrs r2, 24 - movs r3, 0x1 - bl npc_apply_direction - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl get_run_image_anim_num - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl npc_apply_anim_looping - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end do_run_anim - - thumb_func_start npc_obj_ministep_stop_on_arrival -@ bool8 npc_obj_ministep_stop_on_arrival(struct npc_state *fieldObject, struct obj *object) -npc_obj_ministep_stop_on_arrival: @ 8093AB8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl obj_npc_ministep - lsls r0, 24 - cmp r0, 0 - bne _08093ACE - movs r0, 0 - b _08093AEA -_08093ACE: - adds r0, r4, 0 - bl npc_coords_shift_still - ldrb r0, [r4] - movs r1, 0x8 - orrs r0, r1 - strb r0, [r4] - adds r2, r5, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x1 -_08093AEA: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end npc_obj_ministep_stop_on_arrival - - thumb_func_start sub_8093AF0 -@ void sub_8093AF0(struct npc_state *fieldObject, struct obj *object, u8 direction) -sub_8093AF0: @ 8093AF0 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x4 - adds r6, r0, 0 - mov r8, r1 - lsls r5, r2, 24 - lsrs r5, 24 - ldrh r1, [r6, 0x10] - mov r0, sp - strh r1, [r0] - ldrh r0, [r6, 0x12] - mov r4, sp - adds r4, 0x2 - strh r0, [r4] - adds r0, r6, 0 - adds r1, r5, 0 - bl FieldObjectSetDirection - adds r0, r5, 0 - mov r1, sp - adds r2, r4, 0 - bl MoveCoords - mov r0, sp - movs r2, 0 - ldrsh r1, [r0, r2] - movs r0, 0 - ldrsh r2, [r4, r0] - adds r0, r6, 0 - bl npc_coords_shift - mov r0, r8 - adds r1, r5, 0 - bl sub_80976DC - mov r2, r8 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldrb r0, [r6] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r6] - movs r0, 0x1 - mov r1, r8 - strh r0, [r1, 0x32] - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8093AF0 - - thumb_func_start sub_8093B60 -@ void sub_8093B60(struct npc_state *fieldObject, struct obj *object, u8 direction) -sub_8093B60: @ 8093B60 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r2, 24 - lsrs r2, 24 - bl sub_8093AF0 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl get_go_image_anim_num - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl npc_apply_anim_looping - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8093B60 - - thumb_func_start an_walk_any_2 -@ bool8 an_walk_any_2(struct npc_state *fieldObject, struct obj *object) -an_walk_any_2: @ 8093B8C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl sub_80976EC - lsls r0, 24 - cmp r0, 0 - bne _08093BA2 - movs r0, 0 - b _08093BBE -_08093BA2: - adds r0, r4, 0 - bl npc_coords_shift_still - ldrb r0, [r4] - movs r1, 0x8 - orrs r0, r1 - strb r0, [r4] - adds r2, r5, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x1 -_08093BBE: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end an_walk_any_2 - - thumb_func_start sub_8093BC4 -sub_8093BC4: @ 8093BC4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x7 - bl sub_8093B60 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8093BE4 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8093BC4 - - thumb_func_start sub_8093BE4 -sub_8093BE4: @ 8093BE4 - push {r4,lr} - adds r4, r1, 0 - bl an_walk_any_2 - lsls r0, 24 - cmp r0, 0 - bne _08093BF6 - movs r0, 0 - b _08093BFC -_08093BF6: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08093BFC: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8093BE4 - - thumb_func_start sub_8093C04 -sub_8093C04: @ 8093C04 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x8 - bl sub_8093B60 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8093C24 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8093C04 - - thumb_func_start sub_8093C24 -sub_8093C24: @ 8093C24 - push {r4,lr} - adds r4, r1, 0 - bl an_walk_any_2 - lsls r0, 24 - cmp r0, 0 - bne _08093C36 - movs r0, 0 - b _08093C3C -_08093C36: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08093C3C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8093C24 - - thumb_func_start sub_8093C44 -sub_8093C44: @ 8093C44 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x5 - bl sub_8093B60 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8093C64 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8093C44 - - thumb_func_start sub_8093C64 -sub_8093C64: @ 8093C64 - push {r4,lr} - adds r4, r1, 0 - bl an_walk_any_2 - lsls r0, 24 - cmp r0, 0 - bne _08093C76 - movs r0, 0 - b _08093C7C -_08093C76: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08093C7C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8093C64 - - thumb_func_start sub_8093C84 -sub_8093C84: @ 8093C84 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x6 - bl sub_8093B60 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8093CA4 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8093C84 - - thumb_func_start sub_8093CA4 -sub_8093CA4: @ 8093CA4 - push {r4,lr} - adds r4, r1, 0 - bl an_walk_any_2 - lsls r0, 24 - cmp r0, 0 - bne _08093CB6 - movs r0, 0 - b _08093CBC -_08093CB6: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08093CBC: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8093CA4 - - thumb_func_start sub_8093CC4 -@ bool8 sub_8093CC4(struct npc_state *fieldObject, struct obj *object) -sub_8093CC4: @ 8093CC4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x1 - bl sub_8093B60 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8093CE4 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8093CC4 - - thumb_func_start sub_8093CE4 -@ bool8 sub_8093CE4(struct npc_state *fieldObject, struct obj *object) -sub_8093CE4: @ 8093CE4 - push {r4,lr} - adds r4, r1, 0 - bl an_walk_any_2 - lsls r0, 24 - cmp r0, 0 - bne _08093CF6 - movs r0, 0 - b _08093CFC -_08093CF6: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08093CFC: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8093CE4 - - thumb_func_start sub_8093D04 -sub_8093D04: @ 8093D04 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x2 - bl sub_8093B60 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8093D24 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8093D04 - - thumb_func_start sub_8093D24 -sub_8093D24: @ 8093D24 - push {r4,lr} - adds r4, r1, 0 - bl an_walk_any_2 - lsls r0, 24 - cmp r0, 0 - bne _08093D36 - movs r0, 0 - b _08093D3C -_08093D36: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08093D3C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8093D24 - - thumb_func_start sub_8093D44 -sub_8093D44: @ 8093D44 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x3 - bl sub_8093B60 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8093D64 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8093D44 - - thumb_func_start sub_8093D64 -sub_8093D64: @ 8093D64 - push {r4,lr} - adds r4, r1, 0 - bl an_walk_any_2 - lsls r0, 24 - cmp r0, 0 - bne _08093D76 - movs r0, 0 - b _08093D7C -_08093D76: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08093D7C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8093D64 - - thumb_func_start sub_8093D84 -sub_8093D84: @ 8093D84 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x4 - bl sub_8093B60 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8093DA4 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8093D84 - - thumb_func_start sub_8093DA4 -sub_8093DA4: @ 8093DA4 - push {r4,lr} - adds r4, r1, 0 - bl an_walk_any_2 - lsls r0, 24 - cmp r0, 0 - bne _08093DB6 - movs r0, 0 - b _08093DBC -_08093DB6: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08093DBC: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8093DA4 - - thumb_func_start sub_8093DC4 -sub_8093DC4: @ 8093DC4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x7 - movs r3, 0 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8093DE4 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8093DC4 - - thumb_func_start sub_8093DE4 -@ bool8 sub_8093DE4(struct npc_state *fieldObject, struct obj *object) -sub_8093DE4: @ 8093DE4 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08093DF6 - movs r0, 0 - b _08093DFC -_08093DF6: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08093DFC: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8093DE4 - - thumb_func_start sub_8093E04 -sub_8093E04: @ 8093E04 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x8 - movs r3, 0 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8093E24 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8093E04 - - thumb_func_start sub_8093E24 -sub_8093E24: @ 8093E24 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08093E36 - movs r0, 0 - b _08093E3C -_08093E36: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08093E3C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8093E24 - - thumb_func_start sub_8093E44 -sub_8093E44: @ 8093E44 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x5 - movs r3, 0 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8093E64 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8093E44 - - thumb_func_start sub_8093E64 -sub_8093E64: @ 8093E64 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08093E76 - movs r0, 0 - b _08093E7C -_08093E76: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08093E7C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8093E64 - - thumb_func_start sub_8093E84 -sub_8093E84: @ 8093E84 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x6 - movs r3, 0 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8093EA4 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8093E84 - - thumb_func_start sub_8093EA4 -sub_8093EA4: @ 8093EA4 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08093EB6 - movs r0, 0 - b _08093EBC -_08093EB6: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08093EBC: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8093EA4 - - thumb_func_start sub_8093EC4 -sub_8093EC4: @ 8093EC4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x1 - movs r3, 0 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8093EE4 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8093EC4 - - thumb_func_start sub_8093EE4 -sub_8093EE4: @ 8093EE4 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08093EF6 - movs r0, 0 - b _08093EFC -_08093EF6: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08093EFC: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8093EE4 - - thumb_func_start sub_8093F04 -sub_8093F04: @ 8093F04 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x2 - movs r3, 0 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8093F24 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8093F04 - - thumb_func_start sub_8093F24 -sub_8093F24: @ 8093F24 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08093F36 - movs r0, 0 - b _08093F3C -_08093F36: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08093F3C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8093F24 - - thumb_func_start sub_8093F44 -sub_8093F44: @ 8093F44 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x3 - movs r3, 0 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8093F64 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8093F44 - - thumb_func_start sub_8093F64 -sub_8093F64: @ 8093F64 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08093F76 - movs r0, 0 - b _08093F7C -_08093F76: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08093F7C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8093F64 - - thumb_func_start sub_8093F84 -sub_8093F84: @ 8093F84 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x4 - movs r3, 0 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8093FA4 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8093F84 - - thumb_func_start sub_8093FA4 -sub_8093FA4: @ 8093FA4 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08093FB6 - movs r0, 0 - b _08093FBC -_08093FB6: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08093FBC: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8093FA4 - - thumb_func_start sub_8093FC4 -sub_8093FC4: @ 8093FC4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - adds r7, r0, 0 - mov r10, r1 - adds r4, r2, 0 - mov r8, r3 - ldr r0, [sp, 0x30] - lsls r4, 24 - lsrs r4, 24 - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldr r1, =gUnknown_0850DFBC - add r0, sp, 0x4 - movs r2, 0x6 - bl memcpy - add r5, sp, 0xC - movs r0, 0 - strh r0, [r5] - mov r6, sp - adds r6, 0xE - strh r0, [r6] - adds r0, r7, 0 - adds r1, r4, 0 - bl FieldObjectSetDirection - mov r1, r8 - lsls r0, r1, 1 - add r0, sp - adds r0, 0x4 - movs r1, 0 - ldrsh r3, [r0, r1] - str r3, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - bl sub_8092F88 - ldrh r1, [r5] - ldrh r0, [r7, 0x10] - adds r1, r0 - lsls r1, 16 - asrs r1, 16 - ldrh r2, [r6] - ldrh r0, [r7, 0x12] - adds r2, r0 - lsls r2, 16 - asrs r2, 16 - adds r0, r7, 0 - bl npc_coords_shift - mov r0, r10 - adds r1, r4, 0 - mov r2, r8 - mov r3, r9 - bl sub_809783C - movs r0, 0x1 - mov r1, r10 - strh r0, [r1, 0x32] - movs r0, 0x2C - add r10, r0 - mov r0, r10 - ldrb r1, [r0] - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - mov r1, r10 - strb r0, [r1] - ldrb r0, [r7] - movs r1, 0x4 - orrs r0, r1 - movs r1, 0x10 - orrs r0, r1 - strb r0, [r7] - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8093FC4 - - thumb_func_start maybe_shadow_1 -maybe_shadow_1: @ 8094080 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r0, [sp, 0x10] - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - adds r0, r4, 0 - bl sub_8093FC4 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl get_go_image_anim_num - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl npc_apply_anim_looping - adds r0, r4, 0 - bl DoShadowFieldEffect - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end maybe_shadow_1 - - thumb_func_start sub_80940C4 -@ int sub_80940C4(int a1, int a2, int a3) -sub_80940C4: @ 80940C4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - adds r6, r0, 0 - adds r7, r1, 0 - adds r4, r2, 0 - ldr r1, =gUnknown_0850DFC2 - add r0, sp, 0x4 - movs r2, 0x6 - bl memcpy - adds r0, r7, 0 - bl _call_via_r4 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0x1 - bne _08094154 - movs r1, 0x36 - ldrsh r0, [r7, r1] - lsls r0, 1 - add r0, sp - adds r0, 0x4 - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r0, 0 - beq _08094154 - add r4, sp, 0xC - movs r0, 0 - strh r0, [r4] - mov r5, sp - adds r5, 0xE - strh r0, [r5] - ldrb r0, [r6, 0x18] - lsrs r0, 4 - movs r2, 0x36 - ldrsh r1, [r7, r2] - lsls r1, 1 - add r1, sp - adds r1, 0x4 - movs r2, 0 - ldrsh r3, [r1, r2] - str r3, [sp] - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_8092F88 - ldrh r1, [r4] - ldrh r0, [r6, 0x10] - adds r1, r0 - lsls r1, 16 - asrs r1, 16 - ldrh r2, [r5] - ldrh r0, [r6, 0x12] - adds r2, r0 - lsls r2, 16 - asrs r2, 16 - adds r0, r6, 0 - bl npc_coords_shift - ldrb r0, [r6] - movs r1, 0x4 - orrs r0, r1 - movs r1, 0x10 - orrs r0, r1 - strb r0, [r6] - b _08094178 - .pool -_08094154: - mov r1, r8 - cmp r1, 0xFF - bne _08094178 - adds r0, r6, 0 - bl npc_coords_shift_still - ldrb r0, [r6] - movs r1, 0x8 - orrs r0, r1 - movs r1, 0x20 - orrs r0, r1 - strb r0, [r6] - adds r2, r7, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] -_08094178: - mov r0, r8 - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80940C4 - - thumb_func_start sub_8094188 -sub_8094188: @ 8094188 - push {lr} - ldr r2, =sub_809785C - bl sub_80940C4 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8094188 - - thumb_func_start sub_809419C -sub_809419C: @ 809419C - push {lr} - ldr r2, =sub_80978E4 - bl sub_80940C4 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_809419C - - thumb_func_start sub_80941B0 -sub_80941B0: @ 80941B0 - push {lr} - bl sub_8094188 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _080941C2 - movs r0, 0 - b _080941C4 -_080941C2: - movs r0, 0x1 -_080941C4: - pop {r1} - bx r1 - thumb_func_end sub_80941B0 - - thumb_func_start sub_80941C8 -sub_80941C8: @ 80941C8 - push {lr} - bl sub_809419C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _080941DA - movs r0, 0 - b _080941DC -_080941DA: - movs r0, 0x1 -_080941DC: - pop {r1} - bx r1 - thumb_func_end sub_80941C8 - - thumb_func_start sub_80941E0 -sub_80941E0: @ 80941E0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_8094188 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080941FA - cmp r0, 0xFF - bne _08094226 - movs r0, 0x1 - b _08094228 -_080941FA: - ldrb r0, [r4, 0x18] - lsrs r0, 4 - bl GetOppositeDirection - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetDirection - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl get_go_image_anim_num - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl obj_npc_animation_step -_08094226: - movs r0, 0 -_08094228: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80941E0 - - thumb_func_start sub_8094230 -sub_8094230: @ 8094230 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x2 - bl maybe_shadow_1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809425C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094230 - - thumb_func_start sub_809425C -sub_809425C: @ 809425C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08094270 - movs r0, 0 - b _08094280 -_08094270: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08094280: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_809425C - - thumb_func_start sub_8094288 -sub_8094288: @ 8094288 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x2 - movs r3, 0x2 - bl maybe_shadow_1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80942B4 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094288 - - thumb_func_start sub_80942B4 -sub_80942B4: @ 80942B4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _080942C8 - movs r0, 0 - b _080942D8 -_080942C8: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_080942D8: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80942B4 - - thumb_func_start sub_80942E0 -sub_80942E0: @ 80942E0 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x3 - movs r3, 0x2 - bl maybe_shadow_1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809430C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80942E0 - - thumb_func_start sub_809430C -sub_809430C: @ 809430C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08094320 - movs r0, 0 - b _08094330 -_08094320: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08094330: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_809430C - - thumb_func_start sub_8094338 -sub_8094338: @ 8094338 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x4 - movs r3, 0x2 - bl maybe_shadow_1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094364 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094338 - - thumb_func_start sub_8094364 -sub_8094364: @ 8094364 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08094378 - movs r0, 0 - b _08094388 -_08094378: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08094388: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094364 - - thumb_func_start sub_8094390 -sub_8094390: @ 8094390 - movs r2, 0x1 - strh r2, [r0, 0x32] - strh r1, [r0, 0x34] - bx lr - thumb_func_end sub_8094390 - - thumb_func_start sub_8094398 -sub_8094398: @ 8094398 - push {lr} - ldrh r0, [r1, 0x34] - subs r0, 0x1 - strh r0, [r1, 0x34] - lsls r0, 16 - cmp r0, 0 - beq _080943AA - movs r0, 0 - b _080943B0 -_080943AA: - movs r0, 0x2 - strh r0, [r1, 0x32] - movs r0, 0x1 -_080943B0: - pop {r1} - bx r1 - thumb_func_end sub_8094398 - - thumb_func_start sub_80943B4 -sub_80943B4: @ 80943B4 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_8094390 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8094398 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80943B4 - - thumb_func_start sub_80943D4 -sub_80943D4: @ 80943D4 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - adds r0, r4, 0 - movs r1, 0x2 - bl sub_8094390 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8094398 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80943D4 - - thumb_func_start sub_80943F4 -sub_80943F4: @ 80943F4 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - adds r0, r4, 0 - movs r1, 0x4 - bl sub_8094390 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8094398 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80943F4 - - thumb_func_start sub_8094414 -sub_8094414: @ 8094414 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - adds r0, r4, 0 - movs r1, 0x8 - bl sub_8094390 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8094398 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094414 - - thumb_func_start sub_8094434 -sub_8094434: @ 8094434 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - adds r0, r4, 0 - movs r1, 0x10 - bl sub_8094390 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8094398 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094434 - - thumb_func_start sub_8094454 -sub_8094454: @ 8094454 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x1 - movs r3, 0x1 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094474 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094454 - - thumb_func_start sub_8094474 -sub_8094474: @ 8094474 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094486 - movs r0, 0 - b _0809448C -_08094486: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_0809448C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094474 - - thumb_func_start sub_8094494 -sub_8094494: @ 8094494 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x2 - movs r3, 0x1 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80944B4 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094494 - - thumb_func_start sub_80944B4 -sub_80944B4: @ 80944B4 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _080944C6 - movs r0, 0 - b _080944CC -_080944C6: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_080944CC: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80944B4 - - thumb_func_start sub_80944D4 -sub_80944D4: @ 80944D4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x3 - movs r3, 0x1 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80944F4 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80944D4 - - thumb_func_start sub_80944F4 -sub_80944F4: @ 80944F4 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094506 - movs r0, 0 - b _0809450C -_08094506: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_0809450C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80944F4 - - thumb_func_start sub_8094514 -sub_8094514: @ 8094514 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x4 - movs r3, 0x1 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094534 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094514 - - thumb_func_start sub_8094534 -sub_8094534: @ 8094534 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094546 - movs r0, 0 - b _0809454C -_08094546: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_0809454C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094534 - - thumb_func_start sub_8094554 -sub_8094554: @ 8094554 - push {r4-r6,lr} - mov r6, r8 - push {r6} - mov r8, r0 - adds r6, r1, 0 - adds r1, r2, 0 - adds r4, r3, 0 - ldr r5, [sp, 0x14] - lsls r1, 24 - lsrs r1, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 16 - lsrs r5, 16 - bl FieldObjectSetDirection - mov r0, r8 - adds r1, r6, 0 - adds r2, r4, 0 - bl npc_apply_anim_looping - adds r2, r6, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - movs r0, 0x1 - strh r0, [r6, 0x32] - strh r5, [r6, 0x34] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8094554 - - thumb_func_start sub_809459C -@ signed int sub_809459C(int a1, obj *a2) -sub_809459C: @ 809459C - push {lr} - ldrh r0, [r1, 0x34] - subs r0, 0x1 - strh r0, [r1, 0x34] - lsls r0, 16 - cmp r0, 0 - beq _080945AE - movs r0, 0 - b _080945C0 -_080945AE: - movs r0, 0x2 - strh r0, [r1, 0x32] - adds r2, r1, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x1 -_080945C0: - pop {r1} - bx r1 - thumb_func_end sub_809459C - - thumb_func_start sub_80945C4 -@ int sub_80945C4(int a1, obj *a2) -sub_80945C4: @ 80945C4 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - ldrh r1, [r4, 0x34] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080945EE - adds r3, r4, 0 - adds r3, 0x2C - ldrb r2, [r3] - lsls r1, r2, 26 - lsrs r1, 26 - adds r1, 0x1 - movs r0, 0x3F - ands r1, r0 - movs r0, 0x40 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] -_080945EE: - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80945C4 - - thumb_func_start sub_8094600 -sub_8094600: @ 8094600 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - bl get_go_image_anim_num - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x20 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x1 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80945C4 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094600 - - thumb_func_start sub_8094638 -sub_8094638: @ 8094638 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x2 - bl get_go_image_anim_num - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x20 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x2 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80945C4 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094638 - - thumb_func_start sub_8094670 -sub_8094670: @ 8094670 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x3 - bl get_go_image_anim_num - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x20 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x3 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80945C4 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094670 - - thumb_func_start sub_80946A8 -sub_80946A8: @ 80946A8 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x4 - bl get_go_image_anim_num - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x20 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x4 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80945C4 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80946A8 - - thumb_func_start sub_80946E0 -sub_80946E0: @ 80946E0 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - bl get_go_image_anim_num - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x10 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x1 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80946E0 - - thumb_func_start sub_8094718 -sub_8094718: @ 8094718 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x2 - bl get_go_image_anim_num - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x10 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x2 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094718 - - thumb_func_start sub_8094750 -sub_8094750: @ 8094750 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x3 - bl get_go_image_anim_num - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x10 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x3 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094750 - - thumb_func_start sub_8094788 -sub_8094788: @ 8094788 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x4 - bl get_go_image_anim_num - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x10 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x4 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094788 - - thumb_func_start sub_80947C0 -sub_80947C0: @ 80947C0 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - bl get_go_fast_image_anim_num - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x8 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x1 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80947C0 - - thumb_func_start sub_80947F8 -sub_80947F8: @ 80947F8 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x2 - bl get_go_fast_image_anim_num - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x8 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x2 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80947F8 - - thumb_func_start sub_8094830 -sub_8094830: @ 8094830 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x3 - bl get_go_fast_image_anim_num - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x8 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x3 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094830 - - thumb_func_start sub_8094868 -sub_8094868: @ 8094868 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x4 - bl get_go_fast_image_anim_num - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x8 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x4 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094868 - - thumb_func_start sub_80948A0 -sub_80948A0: @ 80948A0 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - bl get_go_faster_image_anim_num - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x4 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x1 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80948A0 - - thumb_func_start sub_80948D8 -sub_80948D8: @ 80948D8 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x2 - bl get_go_faster_image_anim_num - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x4 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x2 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80948D8 - - thumb_func_start sub_8094910 -sub_8094910: @ 8094910 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x3 - bl get_go_faster_image_anim_num - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x4 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x3 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094910 - - thumb_func_start sub_8094948 -sub_8094948: @ 8094948 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x4 - bl get_go_faster_image_anim_num - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x4 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x4 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094948 - - thumb_func_start sub_8094980 -sub_8094980: @ 8094980 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x1 - movs r3, 0x2 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80949A0 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094980 - - thumb_func_start sub_80949A0 -sub_80949A0: @ 80949A0 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _080949B2 - movs r0, 0 - b _080949B8 -_080949B2: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_080949B8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80949A0 - - thumb_func_start sub_80949C0 -sub_80949C0: @ 80949C0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x2 - movs r3, 0x2 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80949E0 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80949C0 - - thumb_func_start sub_80949E0 -sub_80949E0: @ 80949E0 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _080949F2 - movs r0, 0 - b _080949F8 -_080949F2: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_080949F8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80949E0 - - thumb_func_start sub_8094A00 -sub_8094A00: @ 8094A00 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x3 - movs r3, 0x2 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094A20 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094A00 - - thumb_func_start sub_8094A20 -sub_8094A20: @ 8094A20 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094A32 - movs r0, 0 - b _08094A38 -_08094A32: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08094A38: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094A20 - - thumb_func_start sub_8094A40 -sub_8094A40: @ 8094A40 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x4 - movs r3, 0x2 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094A60 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094A40 - - thumb_func_start sub_8094A60 -sub_8094A60: @ 8094A60 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094A72 - movs r0, 0 - b _08094A78 -_08094A72: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08094A78: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094A60 - - thumb_func_start sub_8094A80 -sub_8094A80: @ 8094A80 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x1 - movs r3, 0x3 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094AA0 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094A80 - - thumb_func_start sub_8094AA0 -sub_8094AA0: @ 8094AA0 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094AB2 - movs r0, 0 - b _08094AB8 -_08094AB2: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08094AB8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094AA0 - - thumb_func_start sub_8094AC0 -sub_8094AC0: @ 8094AC0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x2 - movs r3, 0x3 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094AE0 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094AC0 - - thumb_func_start sub_8094AE0 -sub_8094AE0: @ 8094AE0 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094AF2 - movs r0, 0 - b _08094AF8 -_08094AF2: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08094AF8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094AE0 - - thumb_func_start sub_8094B00 -sub_8094B00: @ 8094B00 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x3 - movs r3, 0x3 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094B20 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094B00 - - thumb_func_start sub_8094B20 -sub_8094B20: @ 8094B20 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094B32 - movs r0, 0 - b _08094B38 -_08094B32: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08094B38: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094B20 - - thumb_func_start sub_8094B40 -sub_8094B40: @ 8094B40 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x4 - movs r3, 0x3 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094B60 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094B40 - - thumb_func_start sub_8094B60 -sub_8094B60: @ 8094B60 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094B72 - movs r0, 0 - b _08094B78 -_08094B72: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08094B78: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094B60 - - thumb_func_start sub_8094B80 -sub_8094B80: @ 8094B80 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x1 - movs r3, 0x4 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094BA0 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094B80 - - thumb_func_start sub_8094BA0 -sub_8094BA0: @ 8094BA0 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094BB2 - movs r0, 0 - b _08094BB8 -_08094BB2: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08094BB8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094BA0 - - thumb_func_start sub_8094BC0 -sub_8094BC0: @ 8094BC0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x2 - movs r3, 0x4 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094BE0 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094BC0 - - thumb_func_start sub_8094BE0 -sub_8094BE0: @ 8094BE0 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094BF2 - movs r0, 0 - b _08094BF8 -_08094BF2: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08094BF8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094BE0 - - thumb_func_start sub_8094C00 -sub_8094C00: @ 8094C00 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x3 - movs r3, 0x4 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094C20 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094C00 - - thumb_func_start sub_8094C20 -sub_8094C20: @ 8094C20 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094C32 - movs r0, 0 - b _08094C38 -_08094C32: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08094C38: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094C20 - - thumb_func_start sub_8094C40 -sub_8094C40: @ 8094C40 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x4 - movs r3, 0x4 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094C60 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094C40 - - thumb_func_start sub_8094C60 -sub_8094C60: @ 8094C60 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094C72 - movs r0, 0 - b _08094C78 -_08094C72: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08094C78: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094C60 - - thumb_func_start do_run_south_anim -@ bool8 do_run_south_anim(struct npc_state *fieldObject, struct obj *object) -do_run_south_anim: @ 8094C80 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x1 - bl do_run_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094CA0 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end do_run_south_anim - - thumb_func_start sub_8094CA0 -@ bool8 sub_8094CA0(struct npc_state *fieldObject, struct obj *object) -sub_8094CA0: @ 8094CA0 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094CB2 - movs r0, 0 - b _08094CB8 -_08094CB2: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08094CB8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094CA0 - - thumb_func_start do_run_north_anim -do_run_north_anim: @ 8094CC0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x2 - bl do_run_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094CE0 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end do_run_north_anim - - thumb_func_start sub_8094CE0 -sub_8094CE0: @ 8094CE0 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094CF2 - movs r0, 0 - b _08094CF8 -_08094CF2: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08094CF8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094CE0 - - thumb_func_start do_run_west_anim -do_run_west_anim: @ 8094D00 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x3 - bl do_run_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094D20 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end do_run_west_anim - - thumb_func_start sub_8094D20 -sub_8094D20: @ 8094D20 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094D32 - movs r0, 0 - b _08094D38 -_08094D32: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08094D38: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094D20 - - thumb_func_start do_run_east_anim -do_run_east_anim: @ 8094D40 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x4 - bl do_run_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094D60 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end do_run_east_anim - - thumb_func_start sub_8094D60 -sub_8094D60: @ 8094D60 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094D72 - movs r0, 0 - b _08094D78 -_08094D72: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08094D78: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094D60 - - thumb_func_start npc_set_direction_and_anim__an_proceed -npc_set_direction_and_anim__an_proceed: @ 8094D80 - push {r4-r6,lr} - adds r6, r0, 0 - adds r5, r1, 0 - adds r4, r2, 0 - adds r1, r3, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - movs r2, 0 - bl obj_anim_image_set_and_seek - adds r0, r6, 0 - adds r1, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x1 - strh r0, [r5, 0x32] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end npc_set_direction_and_anim__an_proceed - - thumb_func_start sub_8094DAC -sub_8094DAC: @ 8094DAC - push {lr} - ldrb r2, [r0, 0x18] - lsrs r2, 4 - adds r3, r1, 0 - adds r3, 0x2A - ldrb r3, [r3] - bl npc_set_direction_and_anim__an_proceed - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_8094DAC - - thumb_func_start sub_8094DC4 -sub_8094DC4: @ 8094DC4 - push {r4,lr} - adds r4, r1, 0 - adds r0, r4, 0 - bl sub_80979BC - lsls r0, 24 - cmp r0, 0 - bne _08094DD8 - movs r0, 0 - b _08094DDE -_08094DD8: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08094DDE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094DC4 - - thumb_func_start sub_8094DE4 -sub_8094DE4: @ 8094DE4 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r1, 0 - lsls r4, r2, 24 - lsrs r4, 24 - movs r1, 0 - str r1, [sp] - adds r1, r5, 0 - adds r2, r4, 0 - movs r3, 0x1 - bl sub_8093FC4 - adds r0, r4, 0 - bl sub_80929AC - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl StartObjectImageAnim - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8094DE4 - - thumb_func_start sub_8094E18 -sub_8094E18: @ 8094E18 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x1 - bl sub_8094DE4 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094E38 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094E18 - - thumb_func_start sub_8094E38 -sub_8094E38: @ 8094E38 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941C8 - lsls r0, 24 - cmp r0, 0 - bne _08094E4C - movs r0, 0 - b _08094E5A -_08094E4C: - movs r0, 0x2 - strh r0, [r5, 0x32] - ldrb r1, [r4] - subs r0, 0x23 - ands r0, r1 - strb r0, [r4] - movs r0, 0x1 -_08094E5A: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094E38 - - thumb_func_start sub_8094E60 -sub_8094E60: @ 8094E60 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x2 - bl sub_8094DE4 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094E80 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094E60 - - thumb_func_start sub_8094E80 -sub_8094E80: @ 8094E80 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941C8 - lsls r0, 24 - cmp r0, 0 - bne _08094E94 - movs r0, 0 - b _08094EA2 -_08094E94: - movs r0, 0x2 - strh r0, [r5, 0x32] - ldrb r1, [r4] - subs r0, 0x23 - ands r0, r1 - strb r0, [r4] - movs r0, 0x1 -_08094EA2: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094E80 - - thumb_func_start sub_8094EA8 -sub_8094EA8: @ 8094EA8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x3 - bl sub_8094DE4 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094EC8 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094EA8 - - thumb_func_start sub_8094EC8 -sub_8094EC8: @ 8094EC8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941C8 - lsls r0, 24 - cmp r0, 0 - bne _08094EDC - movs r0, 0 - b _08094EEA -_08094EDC: - movs r0, 0x2 - strh r0, [r5, 0x32] - ldrb r1, [r4] - subs r0, 0x23 - ands r0, r1 - strb r0, [r4] - movs r0, 0x1 -_08094EEA: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094EC8 - - thumb_func_start sub_8094EF0 -sub_8094EF0: @ 8094EF0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x4 - bl sub_8094DE4 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094F10 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094EF0 - - thumb_func_start sub_8094F10 -sub_8094F10: @ 8094F10 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941C8 - lsls r0, 24 - cmp r0, 0 - bne _08094F24 - movs r0, 0 - b _08094F32 -_08094F24: - movs r0, 0x2 - strh r0, [r5, 0x32] - ldrb r1, [r4] - subs r0, 0x23 - ands r0, r1 - strb r0, [r4] - movs r0, 0x1 -_08094F32: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094F10 - - thumb_func_start sub_8094F38 -sub_8094F38: @ 8094F38 - push {r4-r6,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r6, r1, 0 - movs r0, 0xFF - movs r1, 0 - movs r2, 0 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _08094F82 - movs r1, 0x10 - ldrsh r0, [r5, r1] - movs r2, 0x12 - ldrsh r1, [r5, r2] - ldr r4, =0x02037350 - mov r2, sp - ldrb r2, [r2] - lsls r3, r2, 3 - adds r3, r2 - lsls r3, 2 - adds r3, r4 - movs r4, 0x10 - ldrsh r2, [r3, r4] - movs r4, 0x12 - ldrsh r3, [r3, r4] - bl sub_8092AF8 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r5, 0 - adds r1, r6, 0 - bl an_look_any -_08094F82: - movs r0, 0x1 - strh r0, [r6, 0x32] - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8094F38 - - thumb_func_start sub_8094F94 -sub_8094F94: @ 8094F94 - push {r4-r6,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r6, r1, 0 - movs r0, 0xFF - movs r1, 0 - movs r2, 0 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _08094FE6 - movs r1, 0x10 - ldrsh r0, [r5, r1] - movs r2, 0x12 - ldrsh r1, [r5, r2] - ldr r4, =0x02037350 - mov r2, sp - ldrb r2, [r2] - lsls r3, r2, 3 - adds r3, r2 - lsls r3, 2 - adds r3, r4 - movs r4, 0x10 - ldrsh r2, [r3, r4] - movs r4, 0x12 - ldrsh r3, [r3, r4] - bl sub_8092AF8 - lsls r0, 24 - lsrs r0, 24 - bl GetOppositeDirection - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r5, 0 - adds r1, r6, 0 - bl an_look_any -_08094FE6: - movs r0, 0x1 - strh r0, [r6, 0x32] - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8094F94 - - thumb_func_start sub_8094FF8 -sub_8094FF8: @ 8094FF8 - ldrb r2, [r0, 0x1] - movs r3, 0x2 - orrs r2, r3 - strb r2, [r0, 0x1] - movs r0, 0x1 - strh r0, [r1, 0x32] - bx lr - thumb_func_end sub_8094FF8 - - thumb_func_start sub_8095008 -sub_8095008: @ 8095008 - ldrb r3, [r0, 0x1] - movs r2, 0x3 - negs r2, r2 - ands r2, r3 - strb r2, [r0, 0x1] - movs r0, 0x1 - strh r0, [r1, 0x32] - bx lr - thumb_func_end sub_8095008 - - thumb_func_start sub_8095018 -sub_8095018: @ 8095018 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x2 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x1 - bl maybe_shadow_1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8095044 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095018 - - thumb_func_start sub_8095044 -sub_8095044: @ 8095044 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095058 - movs r0, 0 - b _08095068 -_08095058: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095068: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095044 - - thumb_func_start sub_8095070 -sub_8095070: @ 8095070 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x2 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x2 - movs r3, 0x1 - bl maybe_shadow_1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809509C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095070 - - thumb_func_start sub_809509C -sub_809509C: @ 809509C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _080950B0 - movs r0, 0 - b _080950C0 -_080950B0: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_080950C0: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_809509C - - thumb_func_start sub_80950C8 -sub_80950C8: @ 80950C8 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x2 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x3 - movs r3, 0x1 - bl maybe_shadow_1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80950F4 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80950C8 - - thumb_func_start sub_80950F4 -sub_80950F4: @ 80950F4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095108 - movs r0, 0 - b _08095118 -_08095108: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095118: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80950F4 - - thumb_func_start sub_8095120 -sub_8095120: @ 8095120 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x2 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x4 - movs r3, 0x1 - bl maybe_shadow_1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809514C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095120 - - thumb_func_start sub_809514C -sub_809514C: @ 809514C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095160 - movs r0, 0 - b _08095170 -_08095160: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095170: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_809514C - - thumb_func_start sub_8095178 -sub_8095178: @ 8095178 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0 - bl maybe_shadow_1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80951A4 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095178 - - thumb_func_start sub_80951A4 -sub_80951A4: @ 80951A4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _080951B8 - movs r0, 0 - b _080951C8 -_080951B8: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_080951C8: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80951A4 - - thumb_func_start sub_80951D0 -sub_80951D0: @ 80951D0 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x2 - movs r3, 0 - bl maybe_shadow_1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80951FC - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80951D0 - - thumb_func_start sub_80951FC -sub_80951FC: @ 80951FC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095210 - movs r0, 0 - b _08095220 -_08095210: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095220: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80951FC - - thumb_func_start sub_8095228 -sub_8095228: @ 8095228 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x3 - movs r3, 0 - bl maybe_shadow_1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8095254 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095228 - - thumb_func_start sub_8095254 -sub_8095254: @ 8095254 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095268 - movs r0, 0 - b _08095278 -_08095268: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095278: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095254 - - thumb_func_start sub_8095280 -sub_8095280: @ 8095280 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x4 - movs r3, 0 - bl maybe_shadow_1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80952AC - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095280 - - thumb_func_start sub_80952AC -sub_80952AC: @ 80952AC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _080952C0 - movs r0, 0 - b _080952D0 -_080952C0: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_080952D0: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80952AC - - thumb_func_start sub_80952D8 -sub_80952D8: @ 80952D8 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x2 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0 - bl maybe_shadow_1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8095304 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80952D8 - - thumb_func_start sub_8095304 -sub_8095304: @ 8095304 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941E0 - lsls r0, 24 - cmp r0, 0 - bne _08095318 - movs r0, 0 - b _08095328 -_08095318: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095328: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095304 - - thumb_func_start sub_8095330 -sub_8095330: @ 8095330 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x2 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x2 - movs r3, 0 - bl maybe_shadow_1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809535C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095330 - - thumb_func_start sub_809535C -sub_809535C: @ 809535C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941E0 - lsls r0, 24 - cmp r0, 0 - bne _08095370 - movs r0, 0 - b _08095380 -_08095370: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095380: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_809535C - - thumb_func_start sub_8095388 -sub_8095388: @ 8095388 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x2 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x3 - movs r3, 0 - bl maybe_shadow_1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80953B4 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095388 - - thumb_func_start sub_80953B4 -sub_80953B4: @ 80953B4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941E0 - lsls r0, 24 - cmp r0, 0 - bne _080953C8 - movs r0, 0 - b _080953D8 -_080953C8: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_080953D8: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80953B4 - - thumb_func_start sub_80953E0 -sub_80953E0: @ 80953E0 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x2 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x4 - movs r3, 0 - bl maybe_shadow_1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809540C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80953E0 - - thumb_func_start sub_809540C -sub_809540C: @ 809540C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941E0 - lsls r0, 24 - cmp r0, 0 - bne _08095420 - movs r0, 0 - b _08095430 -_08095420: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095430: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_809540C - - thumb_func_start sub_8095438 -sub_8095438: @ 8095438 - push {lr} - ldr r3, =gUnknown_085055CD - ldrb r2, [r0, 0x6] - adds r2, r3 - ldrb r2, [r2] - bl an_look_any - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8095438 - - thumb_func_start sub_8095450 -sub_8095450: @ 8095450 - push {lr} - movs r2, 0x1 - movs r3, 0x14 - bl npc_set_direction_and_anim__an_proceed - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_8095450 - - thumb_func_start sub_8095460 -sub_8095460: @ 8095460 - ldrb r3, [r0, 0x3] - movs r2, 0x3 - negs r2, r2 - ands r2, r3 - strb r2, [r0, 0x3] - movs r0, 0x1 - strh r0, [r1, 0x32] - bx lr - thumb_func_end sub_8095460 - - thumb_func_start sub_8095470 -sub_8095470: @ 8095470 - ldrb r2, [r0, 0x3] - movs r3, 0x2 - orrs r2, r3 - strb r2, [r0, 0x3] - movs r0, 0x1 - strh r0, [r1, 0x32] - bx lr - thumb_func_end sub_8095470 - - thumb_func_start sub_8095480 -sub_8095480: @ 8095480 - ldrb r2, [r0, 0x1] - movs r3, 0x10 - orrs r2, r3 - strb r2, [r0, 0x1] - movs r0, 0x1 - strh r0, [r1, 0x32] - bx lr - thumb_func_end sub_8095480 - - thumb_func_start sub_8095490 -@ int sub_8095490(npc_state *npcState, int a2) -sub_8095490: @ 8095490 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x5] - bl GetFieldObjectGraphicsInfo - ldrb r1, [r0, 0xC] - lsls r1, 25 - lsrs r1, 31 - lsls r1, 4 - ldrb r2, [r4, 0x1] - movs r0, 0x11 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x1] - movs r0, 0x1 - strh r0, [r5, 0x32] - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095490 - - thumb_func_start sub_80954BC -sub_80954BC: @ 80954BC - ldrb r2, [r0, 0x1] - movs r3, 0x20 - orrs r2, r3 - strb r2, [r0, 0x1] - movs r0, 0x1 - strh r0, [r1, 0x32] - bx lr - thumb_func_end sub_80954BC - - thumb_func_start sub_80954CC -sub_80954CC: @ 80954CC - ldrb r3, [r0, 0x1] - movs r2, 0x21 - negs r2, r2 - ands r2, r3 - strb r2, [r0, 0x1] - movs r0, 0x1 - strh r0, [r1, 0x32] - bx lr - thumb_func_end sub_80954CC - - thumb_func_start do_exclamation_mark_bubble_1 -do_exclamation_mark_bubble_1: @ 80954DC - push {r4,lr} - adds r4, r1, 0 - ldr r1, =0x02038c08 - adds r2, r1, 0x4 - adds r3, r1, 0 - adds r3, 0x8 - bl FieldObjectGetLocalIdAndMap - movs r0, 0 - bl FieldEffectStart - movs r0, 0x1 - strh r0, [r4, 0x32] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end do_exclamation_mark_bubble_1 - - thumb_func_start do_exclamation_mark_bubble_2 -do_exclamation_mark_bubble_2: @ 8095500 - push {r4,lr} - adds r4, r1, 0 - ldr r1, =0x02038c08 - adds r2, r1, 0x4 - adds r3, r1, 0 - adds r3, 0x8 - bl FieldObjectGetLocalIdAndMap - movs r0, 0x21 - bl FieldEffectStart - movs r0, 0x1 - strh r0, [r4, 0x32] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end do_exclamation_mark_bubble_2 - - thumb_func_start do_heart_bubble -do_heart_bubble: @ 8095524 - push {r4,lr} - adds r4, r1, 0 - ldr r1, =0x02038c08 - adds r2, r1, 0x4 - adds r3, r1, 0 - adds r3, 0x8 - bl FieldObjectGetLocalIdAndMap - movs r0, 0x2E - bl FieldEffectStart - movs r0, 0x1 - strh r0, [r4, 0x32] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end do_heart_bubble - - thumb_func_start sub_8095548 -sub_8095548: @ 8095548 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x6] - cmp r0, 0x3F - bne _0809555E - adds r0, r4, 0 - bl sub_80B4578 - movs r0, 0 - b _08095586 -_0809555E: - subs r0, 0x39 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _08095580 - adds r0, r4, 0 - bl sub_8155D78 - movs r0, 0x1 - strh r0, [r5, 0x32] - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809558C - lsls r0, 24 - lsrs r0, 24 - b _08095586 -_08095580: - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095586: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095548 - - thumb_func_start sub_809558C -sub_809558C: @ 809558C - push {r4,lr} - adds r4, r1, 0 - bl sub_8155DA0 - lsls r0, 24 - cmp r0, 0 - bne _0809559E - movs r0, 0 - b _080955A4 -_0809559E: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_080955A4: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_809558C - - thumb_func_start sub_80955AC -sub_80955AC: @ 80955AC - push {r4,lr} - adds r4, r1, 0 - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - bl obj_anim_image_set_and_seek - movs r0, 0x1 - strh r0, [r4, 0x32] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80955AC - - thumb_func_start sub_80955C8 -sub_80955C8: @ 80955C8 - push {r4,lr} - adds r4, r1, 0 - adds r0, r4, 0 - bl sub_80979BC - lsls r0, 24 - cmp r0, 0 - beq _080955E4 - adds r0, r4, 0 - movs r1, 0x20 - bl sub_8097978 - movs r0, 0x2 - strh r0, [r4, 0x32] -_080955E4: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80955C8 - - thumb_func_start sub_80955EC -sub_80955EC: @ 80955EC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r2, [r4, 0x1] - lsls r1, r2, 26 - lsrs r1, 31 - movs r0, 0x1 - eors r1, r0 - lsls r1, 5 - subs r0, 0x22 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x1] - adds r0, r5, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - beq _0809561E - ldrb r0, [r4, 0x1] - movs r1, 0x20 - orrs r0, r1 - strb r0, [r4, 0x1] - movs r0, 0x3 - strh r0, [r5, 0x32] -_0809561E: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80955EC - - thumb_func_start sub_8095628 -sub_8095628: @ 8095628 - push {r4,lr} - adds r4, r1, 0 - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - bl obj_anim_image_set_and_seek - movs r0, 0x1 - strh r0, [r4, 0x32] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8095628 - - thumb_func_start sub_8095644 -sub_8095644: @ 8095644 - push {r4,lr} - adds r4, r1, 0 - adds r0, r4, 0 - bl sub_80979BC - lsls r0, 24 - cmp r0, 0 - beq _08095660 - adds r0, r4, 0 - movs r1, 0x20 - bl sub_8097978 - movs r0, 0x2 - strh r0, [r4, 0x32] -_08095660: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8095644 - - thumb_func_start sub_8095668 -sub_8095668: @ 8095668 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r2, [r4, 0x1] - lsls r1, r2, 26 - lsrs r1, 31 - movs r0, 0x1 - eors r1, r0 - lsls r1, 5 - subs r0, 0x22 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x1] - adds r0, r5, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - beq _0809569A - ldrb r0, [r4, 0x1] - movs r1, 0x20 - orrs r0, r1 - strb r0, [r4, 0x1] - movs r0, 0x3 - strh r0, [r5, 0x32] -_0809569A: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095668 - - thumb_func_start sub_80956A4 -sub_80956A4: @ 80956A4 - ldrb r2, [r0, 0x3] - movs r3, 0x4 - orrs r2, r3 - strb r2, [r0, 0x3] - movs r0, 0x1 - strh r0, [r1, 0x32] - bx lr - thumb_func_end sub_80956A4 - - thumb_func_start sub_80956B4 -sub_80956B4: @ 80956B4 - ldrb r3, [r0, 0x3] - movs r2, 0x5 - negs r2, r2 - ands r2, r3 - strb r2, [r0, 0x3] - movs r0, 0x1 - strh r0, [r1, 0x32] - bx lr - thumb_func_end sub_80956B4 - - thumb_func_start sub_80956C4 -sub_80956C4: @ 80956C4 - push {r4,lr} - adds r4, r1, 0 - ldrb r0, [r4, 0x1] - movs r1, 0x3 - orrs r0, r1 - strb r0, [r4, 0x1] - adds r0, r4, 0 - bl obj_alloc_rotscale_entry - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - adds r4, 0x42 - ldrb r1, [r4] - movs r0, 0x3F - ands r0, r1 - strb r0, [r4] - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80956C4 - - thumb_func_start sub_80956F4 -sub_80956F4: @ 80956F4 - push {r4,lr} - adds r4, r1, 0 - ldrb r0, [r4, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - ldrb r0, [r4, 0x1] - movs r1, 0x4 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x1] - lsrs r1, 6 - ldrb r2, [r4, 0x3] - lsrs r2, 6 - movs r3, 0 - adds r0, r4, 0 - bl CalcVecFromObjectCenterToObjectUpperLeft - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80956F4 - - thumb_func_start sub_8095724 -sub_8095724: @ 8095724 - ldrb r1, [r0, 0x3] - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0, 0x3] - movs r0, 0x1 - bx lr - thumb_func_end sub_8095724 - - thumb_func_start sub_8095730 -sub_8095730: @ 8095730 - ldrb r2, [r0, 0x3] - movs r1, 0x9 - negs r1, r1 - ands r1, r2 - strb r1, [r0, 0x3] - movs r0, 0x1 - bx lr - thumb_func_end sub_8095730 - - thumb_func_start sub_8095740 -sub_8095740: @ 8095740 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - movs r2, 0x1 - bl sub_8093B60 - adds r2, r4, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - adds r0, r4, 0 - movs r1, 0 - bl StartObjectRotScalAnimIfDifferent - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8095774 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095740 - - thumb_func_start sub_8095774 -sub_8095774: @ 8095774 - push {r4,lr} - adds r4, r1, 0 - bl an_walk_any_2 - lsls r0, 24 - cmp r0, 0 - bne _08095786 - movs r0, 0 - b _08095798 -_08095786: - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08095798: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8095774 - - thumb_func_start sub_80957A0 -sub_80957A0: @ 80957A0 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - movs r2, 0x1 - bl sub_8093B60 - adds r2, r4, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80082F0 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_80957D4 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80957A0 - - thumb_func_start sub_80957D4 -sub_80957D4: @ 80957D4 - push {r4,lr} - adds r4, r1, 0 - bl an_walk_any_2 - lsls r0, 24 - cmp r0, 0 - bne _080957E6 - movs r0, 0 - b _080957F8 -_080957E6: - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_080957F8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80957D4 - - thumb_func_start sub_8095800 -sub_8095800: @ 8095800 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - movs r2, 0x3 - movs r3, 0x1 - bl do_go_anim - adds r2, r4, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - adds r0, r4, 0 - movs r1, 0x2 - bl sub_80082F0 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8095834 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095800 - - thumb_func_start sub_8095834 -sub_8095834: @ 8095834 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08095846 - movs r0, 0 - b _08095858 -_08095846: - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08095858: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8095834 - - thumb_func_start sub_8095860 -sub_8095860: @ 8095860 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - movs r2, 0x4 - movs r3, 0x1 - bl do_go_anim - adds r2, r4, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - adds r0, r4, 0 - movs r1, 0x3 - bl sub_80082F0 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8095894 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095860 - - thumb_func_start sub_8095894 -sub_8095894: @ 8095894 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _080958A6 - movs r0, 0 - b _080958B8 -_080958A6: - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_080958B8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8095894 - - thumb_func_start sub_80958C0 -sub_80958C0: @ 80958C0 - push {r4-r6,lr} - adds r5, r0, 0 - adds r6, r1, 0 - lsls r4, r2, 24 - lsrs r4, 24 - adds r1, r4, 0 - bl FieldObjectSetDirection - adds r0, r5, 0 - bl npc_coords_shift_still - adds r0, r4, 0 - bl sub_80929FC - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r5, 0 - adds r1, r6, 0 - bl obj_npc_animation_step - adds r2, r6, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x1 - strh r0, [r6, 0x32] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80958C0 - - thumb_func_start sub_8095900 -sub_8095900: @ 8095900 - push {lr} - movs r2, 0x1 - bl sub_80958C0 - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_8095900 - - thumb_func_start sub_8095910 -sub_8095910: @ 8095910 - push {lr} - movs r2, 0x2 - bl sub_80958C0 - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_8095910 - - thumb_func_start sub_8095920 -sub_8095920: @ 8095920 - push {lr} - movs r2, 0x3 - bl sub_80958C0 - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_8095920 - - thumb_func_start sub_8095930 -sub_8095930: @ 8095930 - push {lr} - movs r2, 0x4 - bl sub_80958C0 - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_8095930 - - thumb_func_start sub_8095940 -sub_8095940: @ 8095940 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - bl sub_80929BC - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x1 - bl npc_set_direction_and_anim__an_proceed - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095940 - - thumb_func_start sub_8095964 -sub_8095964: @ 8095964 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x2 - bl sub_80929BC - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x2 - bl npc_set_direction_and_anim__an_proceed - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095964 - - thumb_func_start sub_8095988 -sub_8095988: @ 8095988 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x3 - bl sub_80929BC - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x3 - bl npc_set_direction_and_anim__an_proceed - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095988 - - thumb_func_start sub_80959AC -sub_80959AC: @ 80959AC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x4 - bl sub_80929BC - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x4 - bl npc_set_direction_and_anim__an_proceed - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80959AC - - thumb_func_start sub_80959D0 -sub_80959D0: @ 80959D0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - bl sub_80929DC - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x1 - bl npc_set_direction_and_anim__an_proceed - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80959D0 - - thumb_func_start sub_80959F4 -sub_80959F4: @ 80959F4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x2 - bl sub_80929DC - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x2 - bl npc_set_direction_and_anim__an_proceed - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80959F4 - - thumb_func_start sub_8095A18 -sub_8095A18: @ 8095A18 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x3 - bl sub_80929DC - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x3 - bl npc_set_direction_and_anim__an_proceed - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095A18 - - thumb_func_start sub_8095A3C -sub_8095A3C: @ 8095A3C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x4 - bl sub_80929DC - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x4 - bl npc_set_direction_and_anim__an_proceed - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095A3C - - thumb_func_start sub_8095A60 -sub_8095A60: @ 8095A60 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - bl sub_80929EC - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x1 - bl npc_set_direction_and_anim__an_proceed - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095A60 - - thumb_func_start sub_8095A84 -sub_8095A84: @ 8095A84 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x2 - bl sub_80929EC - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x2 - bl npc_set_direction_and_anim__an_proceed - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095A84 - - thumb_func_start sub_8095AA8 -sub_8095AA8: @ 8095AA8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x3 - bl sub_80929EC - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x3 - bl npc_set_direction_and_anim__an_proceed - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095AA8 - - thumb_func_start sub_8095ACC -sub_8095ACC: @ 8095ACC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x4 - bl sub_80929EC - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x4 - bl npc_set_direction_and_anim__an_proceed - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095ACC - - thumb_func_start sub_8095AF0 -sub_8095AF0: @ 8095AF0 - push {r4,lr} - adds r4, r1, 0 - adds r0, r4, 0 - bl sub_8097750 - adds r4, 0x2C - ldrb r1, [r4] - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - strb r0, [r4] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8095AF0 - - thumb_func_start sub_8095B0C -sub_8095B0C: @ 8095B0C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl sub_8097758 - lsls r0, 24 - cmp r0, 0 - bne _08095B22 - movs r0, 0 - b _08095B3E -_08095B22: - adds r0, r4, 0 - bl npc_coords_shift_still - ldrb r0, [r4] - movs r1, 0x8 - orrs r0, r1 - strb r0, [r4] - adds r2, r5, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x1 -_08095B3E: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095B0C - - thumb_func_start sub_8095B44 -sub_8095B44: @ 8095B44 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - bl sub_8095AF0 - movs r0, 0x1 - strh r0, [r4, 0x32] - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8095B64 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095B44 - - thumb_func_start sub_8095B64 -sub_8095B64: @ 8095B64 - push {r4,lr} - adds r4, r1, 0 - bl sub_8095B0C - lsls r0, 24 - cmp r0, 0 - bne _08095B76 - movs r0, 0 - b _08095B7C -_08095B76: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08095B7C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8095B64 - - thumb_func_start sub_8095B84 -sub_8095B84: @ 8095B84 - push {r4-r6,lr} - sub sp, 0x4 - adds r6, r0, 0 - adds r5, r1, 0 - adds r4, r2, 0 - ldr r0, [sp, 0x14] - lsls r4, 24 - lsrs r4, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - adds r0, r6, 0 - adds r2, r4, 0 - bl sub_8093FC4 - adds r0, r4, 0 - bl sub_80929BC - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl StartObjectImageAnimIfDifferent - adds r0, r6, 0 - bl DoShadowFieldEffect - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8095B84 - - thumb_func_start sub_8095BC8 -sub_8095BC8: @ 8095BC8 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0 - bl sub_8095B84 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8095BF4 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095BC8 - - thumb_func_start sub_8095BF4 -sub_8095BF4: @ 8095BF4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095C08 - movs r0, 0 - b _08095C18 -_08095C08: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095C18: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095BF4 - - thumb_func_start sub_8095C20 -sub_8095C20: @ 8095C20 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x2 - movs r3, 0 - bl sub_8095B84 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8095C4C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095C20 - - thumb_func_start sub_8095C4C -sub_8095C4C: @ 8095C4C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095C60 - movs r0, 0 - b _08095C70 -_08095C60: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095C70: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095C4C - - thumb_func_start sub_8095C78 -sub_8095C78: @ 8095C78 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x3 - movs r3, 0 - bl sub_8095B84 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8095CA4 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095C78 - - thumb_func_start sub_8095CA4 -sub_8095CA4: @ 8095CA4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095CB8 - movs r0, 0 - b _08095CC8 -_08095CB8: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095CC8: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095CA4 - - thumb_func_start sub_8095CD0 -sub_8095CD0: @ 8095CD0 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x4 - movs r3, 0 - bl sub_8095B84 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8095CFC - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095CD0 - - thumb_func_start sub_8095CFC -sub_8095CFC: @ 8095CFC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095D10 - movs r0, 0 - b _08095D20 -_08095D10: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095D20: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095CFC - - thumb_func_start sub_8095D28 -sub_8095D28: @ 8095D28 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x1 - bl sub_8095B84 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8095D54 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095D28 - - thumb_func_start sub_8095D54 -sub_8095D54: @ 8095D54 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095D68 - movs r0, 0 - b _08095D78 -_08095D68: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095D78: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095D54 - - thumb_func_start sub_8095D80 -sub_8095D80: @ 8095D80 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x2 - movs r3, 0x1 - bl sub_8095B84 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8095DAC - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095D80 - - thumb_func_start sub_8095DAC -sub_8095DAC: @ 8095DAC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095DC0 - movs r0, 0 - b _08095DD0 -_08095DC0: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095DD0: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095DAC - - thumb_func_start sub_8095DD8 -sub_8095DD8: @ 8095DD8 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x3 - movs r3, 0x1 - bl sub_8095B84 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8095E04 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095DD8 - - thumb_func_start sub_8095E04 -sub_8095E04: @ 8095E04 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095E18 - movs r0, 0 - b _08095E28 -_08095E18: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095E28: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095E04 - - thumb_func_start sub_8095E30 -sub_8095E30: @ 8095E30 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x4 - movs r3, 0x1 - bl sub_8095B84 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8095E5C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095E30 - - thumb_func_start sub_8095E5C -sub_8095E5C: @ 8095E5C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095E70 - movs r0, 0 - b _08095E80 -_08095E70: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095E80: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095E5C - - thumb_func_start sub_8095E88 -sub_8095E88: @ 8095E88 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x2 - bl sub_8095B84 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8095EB4 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095E88 - - thumb_func_start sub_8095EB4 -sub_8095EB4: @ 8095EB4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095EC8 - movs r0, 0 - b _08095ED8 -_08095EC8: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095ED8: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095EB4 - - thumb_func_start sub_8095EE0 -sub_8095EE0: @ 8095EE0 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x2 - movs r3, 0x2 - bl sub_8095B84 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8095F0C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095EE0 - - thumb_func_start sub_8095F0C -sub_8095F0C: @ 8095F0C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095F20 - movs r0, 0 - b _08095F30 -_08095F20: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095F30: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095F0C - - thumb_func_start sub_8095F38 -sub_8095F38: @ 8095F38 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x3 - movs r3, 0x2 - bl sub_8095B84 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8095F64 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095F38 - - thumb_func_start sub_8095F64 -sub_8095F64: @ 8095F64 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095F78 - movs r0, 0 - b _08095F88 -_08095F78: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095F88: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095F64 - - thumb_func_start sub_8095F90 -sub_8095F90: @ 8095F90 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x4 - movs r3, 0x2 - bl sub_8095B84 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8095FBC - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095F90 - - thumb_func_start sub_8095FBC -sub_8095FBC: @ 8095FBC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095FD0 - movs r0, 0 - b _08095FE0 -_08095FD0: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095FE0: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095FBC - - thumb_func_start sub_8095FE8 -sub_8095FE8: @ 8095FE8 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - bl sub_80929FC - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x8 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x1 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095FE8 - - thumb_func_start sub_8096020 -sub_8096020: @ 8096020 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x2 - bl sub_80929FC - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x8 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x2 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8096020 - - thumb_func_start sub_8096058 -sub_8096058: @ 8096058 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x3 - bl sub_80929FC - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x8 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x3 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8096058 - - thumb_func_start sub_8096090 -sub_8096090: @ 8096090 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x4 - bl sub_80929FC - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x8 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x4 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8096090 - - thumb_func_start sub_80960C8 -sub_80960C8: @ 80960C8 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - bl npc_apply_direction - ldrb r0, [r5, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl sub_80929BC - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - adds r0, r4, 0 - movs r1, 0 - bl SeekObjectImageAnim - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80960C8 - - thumb_func_start sub_8096100 -sub_8096100: @ 8096100 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x1 - movs r3, 0x1 - bl sub_80960C8 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8096120 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8096100 - - thumb_func_start sub_8096120 -sub_8096120: @ 8096120 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08096132 - movs r0, 0 - b _08096138 -_08096132: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08096138: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8096120 - - thumb_func_start sub_8096140 -sub_8096140: @ 8096140 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x2 - movs r3, 0x1 - bl sub_80960C8 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8096160 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8096140 - - thumb_func_start sub_8096160 -sub_8096160: @ 8096160 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08096172 - movs r0, 0 - b _08096178 -_08096172: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08096178: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8096160 - - thumb_func_start sub_8096180 -sub_8096180: @ 8096180 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x3 - movs r3, 0x1 - bl sub_80960C8 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80961A0 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8096180 - - thumb_func_start sub_80961A0 -sub_80961A0: @ 80961A0 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _080961B2 - movs r0, 0 - b _080961B8 -_080961B2: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_080961B8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80961A0 - - thumb_func_start sub_80961C0 -sub_80961C0: @ 80961C0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x4 - movs r3, 0x1 - bl sub_80960C8 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80961E0 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80961C0 - - thumb_func_start sub_80961E0 -sub_80961E0: @ 80961E0 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _080961F2 - movs r0, 0 - b _080961F8 -_080961F2: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_080961F8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80961E0 - - thumb_func_start sub_8096200 -sub_8096200: @ 8096200 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - bl npc_apply_direction - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl sub_80929FC - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl npc_apply_anim_looping - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8096200 - - thumb_func_start sub_8096230 -sub_8096230: @ 8096230 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x1 - movs r3, 0x1 - bl sub_8096200 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8096250 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8096230 - - thumb_func_start sub_8096250 -sub_8096250: @ 8096250 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08096262 - movs r0, 0 - b _08096268 -_08096262: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08096268: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8096250 - - thumb_func_start sub_8096270 -sub_8096270: @ 8096270 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x2 - movs r3, 0x1 - bl sub_8096200 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8096290 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8096270 - - thumb_func_start sub_8096290 -sub_8096290: @ 8096290 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _080962A2 - movs r0, 0 - b _080962A8 -_080962A2: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_080962A8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8096290 - - thumb_func_start sub_80962B0 -sub_80962B0: @ 80962B0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x3 - movs r3, 0x1 - bl sub_8096200 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80962D0 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80962B0 - - thumb_func_start sub_80962D0 -sub_80962D0: @ 80962D0 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _080962E2 - movs r0, 0 - b _080962E8 -_080962E2: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_080962E8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80962D0 - - thumb_func_start sub_80962F0 -sub_80962F0: @ 80962F0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x4 - movs r3, 0x1 - bl sub_8096200 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8096310 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80962F0 - - thumb_func_start sub_8096310 -sub_8096310: @ 8096310 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08096322 - movs r0, 0 - b _08096328 -_08096322: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08096328: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8096310 - - thumb_func_start sub_8096330 -sub_8096330: @ 8096330 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - bl npc_apply_direction - ldrb r0, [r5, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl sub_80929DC - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - adds r0, r4, 0 - movs r1, 0 - bl SeekObjectImageAnim - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8096330 - - thumb_func_start sub_8096368 -sub_8096368: @ 8096368 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x1 - movs r3, 0x1 - bl sub_8096330 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8096388 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8096368 - - thumb_func_start sub_8096388 -sub_8096388: @ 8096388 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _0809639A - movs r0, 0 - b _080963A0 -_0809639A: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_080963A0: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8096388 - - thumb_func_start sub_80963A8 -sub_80963A8: @ 80963A8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x2 - movs r3, 0x1 - bl sub_8096330 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80963C8 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80963A8 - - thumb_func_start sub_80963C8 -sub_80963C8: @ 80963C8 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _080963DA - movs r0, 0 - b _080963E0 -_080963DA: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_080963E0: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80963C8 - - thumb_func_start sub_80963E8 -sub_80963E8: @ 80963E8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x3 - movs r3, 0x1 - bl sub_8096330 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8096408 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80963E8 - - thumb_func_start sub_8096408 -sub_8096408: @ 8096408 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _0809641A - movs r0, 0 - b _08096420 -_0809641A: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08096420: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8096408 - - thumb_func_start sub_8096428 -sub_8096428: @ 8096428 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x4 - movs r3, 0x1 - bl sub_8096330 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8096448 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8096428 - - thumb_func_start sub_8096448 -sub_8096448: @ 8096448 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _0809645A - movs r0, 0 - b _08096460 -_0809645A: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08096460: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8096448 - - thumb_func_start sub_8096468 -sub_8096468: @ 8096468 - push {r4,lr} - adds r4, r1, 0 - bl sub_8097FA4 - movs r0, 0x1 - strh r0, [r4, 0x32] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8096468 - - thumb_func_start sub_809647C -sub_809647C: @ 809647C - push {r4,lr} - adds r4, r1, 0 - ldrb r0, [r0, 0x1B] - bl sub_8098044 - movs r0, 0 - strh r0, [r4, 0x26] - movs r0, 0x1 - strh r0, [r4, 0x32] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_809647C - - thumb_func_start sub_8096494 -sub_8096494: @ 8096494 - push {r4,lr} - adds r2, r0, 0 - adds r4, r1, 0 - movs r1, 0x26 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _080964A6 - movs r0, 0 - b _080964B0 -_080964A6: - ldrb r0, [r2, 0x1B] - bl sub_8098044 - movs r0, 0x1 - strh r0, [r4, 0x32] -_080964B0: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8096494 - - thumb_func_start sub_80964B8 -sub_80964B8: @ 80964B8 - movs r0, 0x1 - bx lr - thumb_func_end sub_80964B8 - - thumb_func_start sub_80964BC -@ bool8 sub_80964BC(struct npc_state *fieldObject, struct obj *object) -sub_80964BC: @ 80964BC - adds r1, 0x2C - ldrb r0, [r1] - movs r2, 0x40 - orrs r0, r2 - strb r0, [r1] - movs r0, 0x1 - bx lr - thumb_func_end sub_80964BC - - thumb_func_start npc_obj_transfer_image_anim_pause_flag -@ void npc_obj_transfer_image_anim_pause_flag(struct npc_state *fieldObject, struct obj *object) -npc_obj_transfer_image_anim_pause_flag: @ 80964CC - push {lr} - ldrb r0, [r0, 0x1] - lsls r0, 29 - cmp r0, 0 - bge _080964E2 - adds r0, r1, 0 - adds r0, 0x2C - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] -_080964E2: - pop {r0} - bx r0 - thumb_func_end npc_obj_transfer_image_anim_pause_flag - - thumb_func_start sub_80964E8 -@ void sub_80964E8(struct npc_state *fieldObject, struct obj *object) -sub_80964E8: @ 80964E8 - push {r4,lr} - adds r4, r0, 0 - ldrb r3, [r4, 0x1] - lsls r0, r3, 28 - cmp r0, 0 - bge _08096510 - adds r2, r1, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r3 - movs r1, 0x9 - negs r1, r1 - ands r0, r1 - strb r0, [r4, 0x1] -_08096510: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80964E8 - - thumb_func_start sub_8096518 -@ void sub_8096518(struct npc_state *fieldObject, struct obj *object) -sub_8096518: @ 8096518 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_8096530 - adds r0, r4, 0 - adds r1, r5, 0 - bl npc_update_obj_anim_flag - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8096518 - - thumb_func_start sub_8096530 -sub_8096530: @ 8096530 - push {r4-r6,lr} - adds r5, r0, 0 - adds r4, r1, 0 - ldrb r1, [r5, 0x1] - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - strb r0, [r5, 0x1] - ldrb r0, [r5, 0x5] - bl GetFieldObjectGraphicsInfo - adds r6, r0, 0 - adds r0, r4, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08096594 - ldrh r1, [r4, 0x24] - ldrh r0, [r4, 0x20] - adds r1, r0 - adds r0, r4, 0 - adds r0, 0x28 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldr r2, =0x02021bbc - adds r0, r1 - ldrh r2, [r2] - adds r0, r2 - lsls r0, 16 - lsrs r3, r0, 16 - ldrh r1, [r4, 0x26] - ldrh r0, [r4, 0x22] - adds r1, r0 - adds r0, r4, 0 - adds r0, 0x29 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldr r2, =0x02021bbe - adds r0, r1 - ldrh r2, [r2] - adds r0, r2 - b _080965BC - .pool -_08096594: - ldrh r1, [r4, 0x24] - ldrh r0, [r4, 0x20] - adds r1, r0 - adds r0, r4, 0 - adds r0, 0x28 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - adds r0, r1 - lsls r0, 16 - lsrs r3, r0, 16 - ldrh r1, [r4, 0x26] - ldrh r0, [r4, 0x22] - adds r1, r0 - adds r0, r4, 0 - adds r0, 0x29 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - adds r0, r1 -_080965BC: - lsls r0, 16 - lsrs r2, r0, 16 - ldrh r0, [r6, 0x8] - adds r0, r3 - lsls r0, 16 - lsrs r1, r0, 16 - ldrh r0, [r6, 0xA] - adds r0, r2 - lsls r0, 16 - lsrs r4, r0, 16 - lsls r0, r3, 16 - asrs r0, 16 - cmp r0, 0xFF - bgt _080965E4 - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x10 - negs r1, r1 - cmp r0, r1 - bge _080965EC -_080965E4: - ldrb r0, [r5, 0x1] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r5, 0x1] -_080965EC: - lsls r0, r2, 16 - asrs r0, 16 - cmp r0, 0xAF - bgt _08096600 - lsls r0, r4, 16 - asrs r0, 16 - movs r1, 0x10 - negs r1, r1 - cmp r0, r1 - bge _08096608 -_08096600: - ldrb r0, [r5, 0x1] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r5, 0x1] -_08096608: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8096530 - - thumb_func_start npc_update_obj_anim_flag -@ void npc_update_obj_anim_flag(struct npc_state *fieldObject, struct obj *object) -npc_update_obj_anim_flag: @ 8096610 - push {lr} - adds r2, r1, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r3, 0x5 - negs r3, r3 - ands r3, r1 - strb r3, [r2] - ldrb r1, [r0, 0x1] - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - beq _08096632 - movs r1, 0x4 - adds r0, r3, 0 - orrs r0, r1 - strb r0, [r2] -_08096632: - pop {r0} - bx r0 - thumb_func_end npc_update_obj_anim_flag - - thumb_func_start GetAllGroundEffectFlags_OnSpawn -@ void GetAllGroundEffectFlags_OnSpawn(struct npc_state *fieldObject, u32 *flags) -GetAllGroundEffectFlags_OnSpawn: @ 8096638 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl FieldObjectUpdateMetatileBehaviors - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_Reflection - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_TallGrassOnSpawn - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_LongGrassOnSpawn - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_SandHeap - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_ShallowFlowingWater - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_ShortGrass - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_HotSprings - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end GetAllGroundEffectFlags_OnSpawn - - thumb_func_start GetAllGroundEffectFlags_OnBeginStep -@ void GetAllGroundEffectFlags_OnBeginStep(struct npc_state *fieldObject, u32 *flags) -GetAllGroundEffectFlags_OnBeginStep: @ 8096680 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl FieldObjectUpdateMetatileBehaviors - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_Reflection - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_TallGrassOnBeginStep - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_LongGrassOnBeginStep - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_Tracks - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_SandHeap - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_ShallowFlowingWater - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_Puddle - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_ShortGrass - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_HotSprings - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end GetAllGroundEffectFlags_OnBeginStep - - thumb_func_start GetAllGroundEffectFlags_OnFinishStep -@ void GetAllGroundEffectFlags_OnFinishStep(struct npc_state *fieldObject, u32 *flags) -GetAllGroundEffectFlags_OnFinishStep: @ 80966D8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl FieldObjectUpdateMetatileBehaviors - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_ShallowFlowingWater - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_SandHeap - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_Puddle - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_Ripple - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_ShortGrass - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_HotSprings - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_Seaweed - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_JumpLanding - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end GetAllGroundEffectFlags_OnFinishStep - - thumb_func_start FieldObjectUpdateMetatileBehaviors -@ void FieldObjectUpdateMetatileBehaviors(struct npc_state *fieldObject) -FieldObjectUpdateMetatileBehaviors: @ 8096728 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x14 - ldrsh r0, [r4, r1] - movs r2, 0x16 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileBehaviorAt - strb r0, [r4, 0x1F] - movs r1, 0x10 - ldrsh r0, [r4, r1] - movs r2, 0x12 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileBehaviorAt - strb r0, [r4, 0x1E] - pop {r4} - pop {r0} - bx r0 - thumb_func_end FieldObjectUpdateMetatileBehaviors - - thumb_func_start GetGroundEffectFlags_Reflection -@ void GetGroundEffectFlags_Reflection(struct npc_state *fieldObject, u32 *flags) -GetGroundEffectFlags_Reflection: @ 8096750 - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r0, =gUnknown_0850E5DC - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp] - str r1, [sp, 0x4] - adds r0, r4, 0 - bl FieldObjectCheckForReflectiveSurface - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - beq _08096798 - ldrb r1, [r4, 0x2] - lsls r0, r1, 30 - cmp r0, 0 - blt _080967A2 - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4, 0x2] - subs r0, r2, 0x1 - lsls r0, 2 - add r0, sp - ldr r1, [r5] - ldr r0, [r0] - orrs r1, r0 - str r1, [r5] - b _080967A2 - .pool -_08096798: - ldrb r1, [r4, 0x2] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x2] -_080967A2: - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end GetGroundEffectFlags_Reflection - - thumb_func_start GetGroundEffectFlags_TallGrassOnSpawn -@ void GetGroundEffectFlags_TallGrassOnSpawn(struct npc_state *fieldObject, u32 *flags) -GetGroundEffectFlags_TallGrassOnSpawn: @ 80967AC - push {r4,lr} - adds r4, r1, 0 - ldrb r0, [r0, 0x1E] - bl MetatileBehavior_IsTallGrass - lsls r0, 24 - cmp r0, 0 - beq _080967C4 - ldr r0, [r4] - movs r1, 0x1 - orrs r0, r1 - str r0, [r4] -_080967C4: - pop {r4} - pop {r0} - bx r0 - thumb_func_end GetGroundEffectFlags_TallGrassOnSpawn - - thumb_func_start GetGroundEffectFlags_TallGrassOnBeginStep -@ void GetGroundEffectFlags_TallGrassOnBeginStep(struct npc_state *fieldObject, u32 *flags) -GetGroundEffectFlags_TallGrassOnBeginStep: @ 80967CC - push {r4,lr} - adds r4, r1, 0 - ldrb r0, [r0, 0x1E] - bl MetatileBehavior_IsTallGrass - lsls r0, 24 - cmp r0, 0 - beq _080967E4 - ldr r0, [r4] - movs r1, 0x2 - orrs r0, r1 - str r0, [r4] -_080967E4: - pop {r4} - pop {r0} - bx r0 - thumb_func_end GetGroundEffectFlags_TallGrassOnBeginStep - - thumb_func_start GetGroundEffectFlags_LongGrassOnSpawn -@ void GetGroundEffectFlags_LongGrassOnSpawn(struct npc_state *fieldObject, u32 *flags) -GetGroundEffectFlags_LongGrassOnSpawn: @ 80967EC - push {r4,lr} - adds r4, r1, 0 - ldrb r0, [r0, 0x1E] - bl MetatileBehavior_IsLongGrass - lsls r0, 24 - cmp r0, 0 - beq _08096804 - ldr r0, [r4] - movs r1, 0x4 - orrs r0, r1 - str r0, [r4] -_08096804: - pop {r4} - pop {r0} - bx r0 - thumb_func_end GetGroundEffectFlags_LongGrassOnSpawn - - thumb_func_start GetGroundEffectFlags_LongGrassOnBeginStep -@ void GetGroundEffectFlags_LongGrassOnBeginStep(struct npc_state *fieldObject, u32 *flags) -GetGroundEffectFlags_LongGrassOnBeginStep: @ 809680C - push {r4,lr} - adds r4, r1, 0 - ldrb r0, [r0, 0x1E] - bl MetatileBehavior_IsLongGrass - lsls r0, 24 - cmp r0, 0 - beq _08096824 - ldr r0, [r4] - movs r1, 0x8 - orrs r0, r1 - str r0, [r4] -_08096824: - pop {r4} - pop {r0} - bx r0 - thumb_func_end GetGroundEffectFlags_LongGrassOnBeginStep - - thumb_func_start GetGroundEffectFlags_Tracks -@ void GetGroundEffectFlags_Tracks(struct npc_state *fieldObject, u32 *flags) -GetGroundEffectFlags_Tracks: @ 809682C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x1F] - bl MetatileBehavior_IsDeepSand - lsls r0, 24 - cmp r0, 0 - beq _08096846 - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 1 - b _08096862 -_08096846: - ldrb r0, [r4, 0x1F] - bl MetatileBehavior_IsSandOrDeepSand - lsls r0, 24 - cmp r0, 0 - bne _0809685E - ldrb r0, [r4, 0x1F] - bl MetatileBehavior_IsUnusedFootprintMetatile - lsls r0, 24 - cmp r0, 0 - beq _08096866 -_0809685E: - ldr r0, [r5] - movs r1, 0x80 -_08096862: - orrs r0, r1 - str r0, [r5] -_08096866: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end GetGroundEffectFlags_Tracks - - thumb_func_start GetGroundEffectFlags_SandHeap -@ void GetGroundEffectFlags_SandHeap(struct npc_state *fieldObject, u32 *flags) -GetGroundEffectFlags_SandHeap: @ 809686C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x1E] - bl MetatileBehavior_IsDeepSand - lsls r0, 24 - cmp r0, 0 - beq _080968AA - ldrb r0, [r4, 0x1F] - bl MetatileBehavior_IsDeepSand - lsls r0, 24 - cmp r0, 0 - beq _080968AA - ldrb r1, [r4, 0x2] - lsls r0, r1, 27 - cmp r0, 0 - blt _080968B4 - movs r0, 0x11 - negs r0, r0 - ands r0, r1 - movs r1, 0x10 - orrs r0, r1 - strb r0, [r4, 0x2] - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 4 - orrs r0, r1 - str r0, [r5] - b _080968B4 -_080968AA: - ldrb r1, [r4, 0x2] - movs r0, 0x11 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x2] -_080968B4: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end GetGroundEffectFlags_SandHeap - - thumb_func_start GetGroundEffectFlags_ShallowFlowingWater -@ void GetGroundEffectFlags_ShallowFlowingWater(struct npc_state *fieldObject, u32 *flags) -GetGroundEffectFlags_ShallowFlowingWater: @ 80968BC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x1E] - bl MetatileBehavior_IsShallowFlowingWater - lsls r0, 24 - cmp r0, 0 - beq _080968DA - ldrb r0, [r4, 0x1F] - bl MetatileBehavior_IsShallowFlowingWater - lsls r0, 24 - cmp r0, 0 - bne _080968F2 -_080968DA: - ldrb r0, [r4, 0x1E] - bl MetatileBehavior_IsPacifidlogLog - lsls r0, 24 - cmp r0, 0 - beq _08096910 - ldrb r0, [r4, 0x1F] - bl MetatileBehavior_IsPacifidlogLog - lsls r0, 24 - cmp r0, 0 - beq _08096910 -_080968F2: - ldrb r1, [r4, 0x2] - lsls r0, r1, 28 - cmp r0, 0 - blt _0809691A - movs r0, 0x9 - negs r0, r0 - ands r0, r1 - movs r1, 0x8 - orrs r0, r1 - strb r0, [r4, 0x2] - ldr r0, [r5] - movs r1, 0x40 - orrs r0, r1 - str r0, [r5] - b _0809691A -_08096910: - ldrb r1, [r4, 0x2] - movs r0, 0x9 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x2] -_0809691A: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end GetGroundEffectFlags_ShallowFlowingWater - - thumb_func_start GetGroundEffectFlags_Puddle -@ void GetGroundEffectFlags_Puddle(struct npc_state *fieldObject, u32 *flags) -GetGroundEffectFlags_Puddle: @ 8096920 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x1E] - bl MetatileBehavior_IsPuddle - lsls r0, 24 - cmp r0, 0 - beq _08096948 - ldrb r0, [r4, 0x1F] - bl MetatileBehavior_IsPuddle - lsls r0, 24 - cmp r0, 0 - beq _08096948 - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 3 - orrs r0, r1 - str r0, [r5] -_08096948: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end GetGroundEffectFlags_Puddle - - thumb_func_start GetGroundEffectFlags_Ripple -@ void GetGroundEffectFlags_Ripple(struct npc_state *fieldObject, u32 *flags) -GetGroundEffectFlags_Ripple: @ 8096950 - push {r4,lr} - adds r4, r1, 0 - ldrb r0, [r0, 0x1E] - bl MetatileBehavior_HasRipples - lsls r0, 24 - cmp r0, 0 - beq _0809696A - ldr r0, [r4] - movs r1, 0x80 - lsls r1, 2 - orrs r0, r1 - str r0, [r4] -_0809696A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end GetGroundEffectFlags_Ripple - - thumb_func_start GetGroundEffectFlags_ShortGrass -@ void GetGroundEffectFlags_ShortGrass(struct npc_state *fieldObject, u32 *flags) -GetGroundEffectFlags_ShortGrass: @ 8096970 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x1E] - bl MetatileBehavior_IsShortGrass - lsls r0, 24 - cmp r0, 0 - beq _080969AE - ldrb r0, [r4, 0x1F] - bl MetatileBehavior_IsShortGrass - lsls r0, 24 - cmp r0, 0 - beq _080969AE - ldrb r1, [r4, 0x2] - lsls r0, r1, 29 - cmp r0, 0 - blt _080969B8 - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r4, 0x2] - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 10 - orrs r0, r1 - str r0, [r5] - b _080969B8 -_080969AE: - ldrb r1, [r4, 0x2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x2] -_080969B8: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end GetGroundEffectFlags_ShortGrass - - thumb_func_start GetGroundEffectFlags_HotSprings -@ void GetGroundEffectFlags_HotSprings(struct npc_state *fieldObject, u32 *flags) -GetGroundEffectFlags_HotSprings: @ 80969C0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x1E] - bl MetatileBehavior_IsHotSprings - lsls r0, 24 - cmp r0, 0 - beq _080969FE - ldrb r0, [r4, 0x1F] - bl MetatileBehavior_IsHotSprings - lsls r0, 24 - cmp r0, 0 - beq _080969FE - ldrb r1, [r4, 0x2] - lsls r0, r1, 26 - cmp r0, 0 - blt _08096A08 - movs r0, 0x21 - negs r0, r0 - ands r0, r1 - movs r1, 0x20 - orrs r0, r1 - strb r0, [r4, 0x2] - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 11 - orrs r0, r1 - str r0, [r5] - b _08096A08 -_080969FE: - ldrb r1, [r4, 0x2] - movs r0, 0x21 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x2] -_08096A08: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end GetGroundEffectFlags_HotSprings - - thumb_func_start GetGroundEffectFlags_Seaweed -@ void GetGroundEffectFlags_Seaweed(struct npc_state *fieldObject, u32 *flags) -GetGroundEffectFlags_Seaweed: @ 8096A10 - push {r4,lr} - adds r4, r1, 0 - ldrb r0, [r0, 0x1E] - bl MetatileBehavior_IsSeaweed - lsls r0, 24 - cmp r0, 0 - beq _08096A2A - ldr r0, [r4] - movs r1, 0x80 - lsls r1, 12 - orrs r0, r1 - str r0, [r4] -_08096A2A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end GetGroundEffectFlags_Seaweed - - thumb_func_start GetGroundEffectFlags_JumpLanding -@ void GetGroundEffectFlags_JumpLanding(struct npc_state *fieldObject, u32 *flags) -GetGroundEffectFlags_JumpLanding: @ 8096A30 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r7, r0, 0 - adds r6, r1, 0 - ldr r0, [r7] - ldr r1, =0x02000020 - ands r0, r1 - cmp r0, 0x20 - bne _08096A82 - movs r5, 0 - ldr r0, =gUnknown_0850E5E4 - mov r8, r0 -_08096A4A: - lsls r4, r5, 2 - mov r0, r8 - adds r1, r4, r0 - ldrb r0, [r7, 0x1E] - ldr r1, [r1] - bl _call_via_r1 - lsls r0, 24 - cmp r0, 0 - beq _08096A78 - ldr r0, =gUnknown_0850E5FC - adds r0, r4, r0 - ldr r1, [r6] - ldr r0, [r0] - orrs r1, r0 - str r1, [r6] - b _08096A82 - .pool -_08096A78: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _08096A4A -_08096A82: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end GetGroundEffectFlags_JumpLanding - - thumb_func_start FieldObjectCheckForReflectiveSurface -@ u8 FieldObjectCheckForReflectiveSurface(struct npc_state *fieldObject) -FieldObjectCheckForReflectiveSurface: @ 8096A8C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - adds r5, r0, 0 - ldrb r0, [r5, 0x5] - bl GetFieldObjectGraphicsInfo - movs r2, 0x8 - ldrsh r1, [r0, r2] - adds r1, 0x8 - lsls r1, 12 - lsrs r1, 16 - str r1, [sp] - movs r1, 0xA - ldrsh r0, [r0, r1] - adds r0, 0x8 - lsls r0, 12 - movs r4, 0 - lsrs r2, r0, 16 - str r2, [sp, 0x4] - asrs r0, 16 - cmp r4, r0 - blt _08096AC2 - b _08096BC8 -_08096AC2: - movs r0, 0x1 - mov r10, r0 -_08096AC6: - movs r1, 0x10 - ldrsh r0, [r5, r1] - movs r2, 0x12 - ldrsh r1, [r5, r2] - add r1, r10 - lsls r4, 16 - asrs r6, r4, 16 - adds r1, r6 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl GetReflectionTypeByMetatileBehavior - lsls r0, 24 - lsrs r0, 24 - mov r9, r4 - cmp r0, 0 - bne _08096BCA - movs r1, 0x14 - ldrsh r0, [r5, r1] - movs r2, 0x16 - ldrsh r1, [r5, r2] - add r1, r10 - adds r1, r6 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl GetReflectionTypeByMetatileBehavior - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08096BCA - movs r2, 0x1 - ldr r1, [sp] - lsls r0, r1, 16 - asrs r1, r0, 16 - mov r8, r0 - cmp r2, r1 - bge _08096BB6 - movs r0, 0x80 - lsls r0, 9 - asrs r7, r0, 16 -_08096B20: - movs r1, 0x10 - ldrsh r0, [r5, r1] - lsls r1, r2, 16 - asrs r4, r1, 16 - adds r0, r4 - movs r2, 0x12 - ldrsh r1, [r5, r2] - adds r1, r7 - adds r1, r6 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl GetReflectionTypeByMetatileBehavior - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08096BCA - movs r1, 0x10 - ldrsh r0, [r5, r1] - subs r0, r4 - movs r2, 0x12 - ldrsh r1, [r5, r2] - adds r1, r7 - adds r1, r6 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl GetReflectionTypeByMetatileBehavior - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08096BCA - movs r1, 0x14 - ldrsh r0, [r5, r1] - adds r0, r4 - movs r2, 0x16 - ldrsh r1, [r5, r2] - adds r1, r7 - adds r1, r6 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl GetReflectionTypeByMetatileBehavior - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08096BCA - movs r1, 0x14 - ldrsh r0, [r5, r1] - subs r0, r4 - movs r2, 0x16 - ldrsh r1, [r5, r2] - adds r1, r7 - adds r1, r6 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl GetReflectionTypeByMetatileBehavior - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08096BCA - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r0, r8 - blt _08096B20 -_08096BB6: - movs r1, 0x80 - lsls r1, 9 - add r1, r9 - lsrs r4, r1, 16 - ldr r2, [sp, 0x4] - lsls r0, r2, 16 - cmp r1, r0 - bge _08096BC8 - b _08096AC6 -_08096BC8: - movs r0, 0 -_08096BCA: - 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 FieldObjectCheckForReflectiveSurface - - thumb_func_start GetReflectionTypeByMetatileBehavior -@ u8 GetReflectionTypeByMetatileBehavior(u8 metatileBehavior) -GetReflectionTypeByMetatileBehavior: @ 8096BDC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl MetatileBehavior_IsIce - lsls r0, 24 - cmp r0, 0 - beq _08096BF2 - movs r0, 0x1 - b _08096C04 -_08096BF2: - adds r0, r4, 0 - bl MetatileBehavior_IsReflective - lsls r0, 24 - cmp r0, 0 - bne _08096C02 - movs r0, 0 - b _08096C04 -_08096C02: - movs r0, 0x2 -_08096C04: - pop {r4} - pop {r1} - bx r1 - thumb_func_end GetReflectionTypeByMetatileBehavior - - thumb_func_start GetLedgeJumpDirection -@ u8 GetLedgeJumpDirection(u16 x, u16 y, u8 direction) -GetLedgeJumpDirection: @ 8096C0C - push {r4,lr} - lsls r0, 16 - lsrs r3, r0, 16 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 24 - lsrs r4, r2, 24 - cmp r4, 0 - beq _08096C52 - cmp r4, 0x4 - bls _08096C28 - subs r0, r4, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 -_08096C28: - subs r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r3, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_0850E614 - lsls r1, r4, 2 - adds r1, r2 - ldr r1, [r1] - bl _call_via_r1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08096C5C -_08096C52: - movs r0, 0 - b _08096C62 - .pool -_08096C5C: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r0, 24 -_08096C62: - pop {r4} - pop {r1} - bx r1 - thumb_func_end GetLedgeJumpDirection - - thumb_func_start FieldObjectSetSpriteOamTableForLongGrass -@ void FieldObjectSetSpriteOamTableForLongGrass(struct npc_state *fieldObject, struct obj *object) -FieldObjectSetSpriteOamTableForLongGrass: @ 8096C68 - push {r4-r6,lr} - adds r5, r0, 0 - adds r4, r1, 0 - ldrb r0, [r5] - lsls r0, 27 - cmp r0, 0 - blt _08096CBC - ldrb r0, [r5, 0x1E] - bl MetatileBehavior_IsLongGrass - lsls r0, 24 - cmp r0, 0 - beq _08096CBC - ldrb r0, [r5, 0x1F] - bl MetatileBehavior_IsLongGrass - lsls r0, 24 - cmp r0, 0 - beq _08096CBC - adds r4, 0x42 - ldrb r1, [r4] - movs r6, 0x40 - negs r6, r6 - adds r0, r6, 0 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r4] - ldrb r0, [r5, 0xB] - lsrs r0, 4 - bl ZCoordToPriority - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08096CBC - ldrb r0, [r4] - adds r1, r6, 0 - ands r1, r0 - movs r0, 0x5 - orrs r1, r0 - strb r1, [r4] -_08096CBC: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end FieldObjectSetSpriteOamTableForLongGrass - - thumb_func_start IsZCoordMismatchAt -@ bool8 IsZCoordMismatchAt(u8 z, u16 x, u16 y) -IsZCoordMismatchAt: @ 8096CC4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 16 - lsrs r0, r1, 16 - lsls r2, 16 - lsrs r1, r2, 16 - cmp r4, 0 - beq _08096CF2 - lsls r0, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - bl MapGridGetZCoordAt - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _08096CF2 - cmp r0, 0xF - beq _08096CF2 - cmp r0, r4 - bne _08096CF6 -_08096CF2: - movs r0, 0 - b _08096CF8 -_08096CF6: - movs r0, 0x1 -_08096CF8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end IsZCoordMismatchAt - - thumb_func_start FieldObjectUpdateZCoordAndPriority -@ void FieldObjectUpdateZCoordAndPriority(struct npc_state *fieldObject, struct obj *object) -FieldObjectUpdateZCoordAndPriority: @ 8096D00 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x3] - lsls r0, 29 - cmp r0, 0 - blt _08096D4E - adds r0, r4, 0 - bl FieldObjectUpdateZCoord - ldr r1, =gUnknown_0850E644 - ldrb r2, [r4, 0xB] - lsls r2, 24 - lsrs r0, r2, 28 - adds r0, r1 - ldrb r0, [r0] - adds r4, r5, 0 - adds r4, 0x42 - movs r1, 0x3F - ands r1, r0 - ldrb r3, [r4] - movs r0, 0x40 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r4] - ldr r0, =gUnknown_0850E634 - lsrs r2, 28 - adds r2, r0 - movs r0, 0x3 - ldrb r1, [r2] - ands r1, r0 - lsls r1, 2 - ldrb r2, [r5, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x5] -_08096D4E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectUpdateZCoordAndPriority - - thumb_func_start InitObjectPriorityByZCoord -@ void InitObjectPriorityByZCoord(struct obj *object, u8 z) -InitObjectPriorityByZCoord: @ 8096D5C - push {r4,lr} - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_0850E644 - adds r2, r1, r2 - ldrb r2, [r2] - movs r3, 0x42 - adds r3, r0 - mov r12, r3 - movs r3, 0x3F - ands r3, r2 - mov r2, r12 - ldrb r4, [r2] - movs r2, 0x40 - negs r2, r2 - ands r2, r4 - orrs r2, r3 - mov r3, r12 - strb r2, [r3] - ldr r2, =gUnknown_0850E634 - adds r1, r2 - movs r3, 0x3 - ldrb r2, [r1] - ands r2, r3 - lsls r2, 2 - ldrb r3, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r3 - orrs r1, r2 - strb r1, [r0, 0x5] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end InitObjectPriorityByZCoord - - thumb_func_start ZCoordToPriority -@ u8 ZCoordToPriority(u8 z) -ZCoordToPriority: @ 8096DA8 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850E634 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end ZCoordToPriority - - thumb_func_start FieldObjectUpdateZCoord -@ void FieldObjectUpdateZCoord(struct npc_state *fieldObject) -FieldObjectUpdateZCoord: @ 8096DB8 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x10 - ldrsh r0, [r4, r1] - movs r2, 0x12 - ldrsh r1, [r4, r2] - bl MapGridGetZCoordAt - lsls r0, 24 - lsrs r5, r0, 24 - movs r1, 0x14 - ldrsh r0, [r4, r1] - movs r2, 0x16 - ldrsh r1, [r4, r2] - bl MapGridGetZCoordAt - lsls r0, 24 - lsrs r0, 24 - cmp r5, 0xF - beq _08096E06 - cmp r0, 0xF - beq _08096E06 - movs r3, 0xF - adds r0, r5, 0 - ands r0, r3 - ldrb r1, [r4, 0xB] - movs r2, 0x10 - negs r2, r2 - ands r2, r1 - orrs r2, r0 - strb r2, [r4, 0xB] - cmp r5, 0 - beq _08096E06 - cmp r5, 0xF - beq _08096E06 - lsls r0, r5, 4 - ands r2, r3 - orrs r2, r0 - strb r2, [r4, 0xB] -_08096E06: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end FieldObjectUpdateZCoord - - thumb_func_start SetObjectSubpriorityByZCoord -@ void SetObjectSubpriorityByZCoord(u8 z, struct obj *object, u8 offset) -SetObjectSubpriorityByZCoord: @ 8096E0C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r2, 24 - lsrs r2, 24 - adds r3, r1, 0 - adds r3, 0x29 - movs r5, 0 - ldrsb r5, [r3, r5] - ldrh r4, [r1, 0x22] - ldr r3, =0x02021bbe - subs r4, r5 - ldrh r3, [r3] - adds r4, r3 - adds r4, 0x8 - movs r3, 0xFF - ands r4, r3 - lsrs r4, 4 - movs r3, 0x10 - subs r3, r4 - lsls r3, 17 - ldr r4, =gUnknown_0850E624 - adds r0, r4 - lsrs r3, 16 - ldrb r0, [r0] - adds r3, r0 - adds r2, r3 - adds r1, 0x43 - strb r2, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end SetObjectSubpriorityByZCoord - - thumb_func_start FieldObjectUpdateSubpriority -@ void FieldObjectUpdateSubpriority(struct npc_state *fieldObject, struct obj *object) -FieldObjectUpdateSubpriority: @ 8096E54 - push {lr} - adds r2, r0, 0 - ldrb r0, [r2, 0x3] - lsls r0, 29 - cmp r0, 0 - blt _08096E6A - ldrb r0, [r2, 0xB] - lsrs r0, 4 - movs r2, 0x1 - bl SetObjectSubpriorityByZCoord -_08096E6A: - pop {r0} - bx r0 - thumb_func_end FieldObjectUpdateSubpriority - - thumb_func_start AreZCoordsCompatible -@ bool8 AreZCoordsCompatible(u8 z1, u8 z2) -AreZCoordsCompatible: @ 8096E70 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - cmp r0, 0 - beq _08096E86 - cmp r1, 0 - beq _08096E86 - cmp r0, r1 - bne _08096E8A -_08096E86: - movs r0, 0x1 - b _08096E8C -_08096E8A: - movs r0, 0 -_08096E8C: - pop {r1} - bx r1 - thumb_func_end AreZCoordsCompatible - - thumb_func_start GroundEffect_SpawnOnTallGrass -@ void GroundEffect_SpawnOnTallGrass(struct npc_state *fieldObject, struct obj *object) -GroundEffect_SpawnOnTallGrass: @ 8096E90 - push {lr} - ldr r3, =0x02038c08 - movs r2, 0x10 - ldrsh r1, [r0, r2] - str r1, [r3] - movs r2, 0x12 - ldrsh r1, [r0, r2] - str r1, [r3, 0x4] - ldrb r1, [r0, 0xB] - lsrs r1, 4 - str r1, [r3, 0x8] - movs r1, 0x2 - str r1, [r3, 0xC] - ldrb r1, [r0, 0x8] - lsls r1, 8 - ldrb r2, [r0, 0x9] - orrs r1, r2 - str r1, [r3, 0x10] - ldrb r0, [r0, 0xA] - str r0, [r3, 0x14] - ldr r0, =0x03005d8c - ldr r1, [r0] - ldrb r0, [r1, 0x5] - lsls r0, 8 - ldrb r1, [r1, 0x4] - orrs r0, r1 - str r0, [r3, 0x18] - movs r0, 0x1 - str r0, [r3, 0x1C] - movs r0, 0x4 - bl FieldEffectStart - pop {r0} - bx r0 - .pool - thumb_func_end GroundEffect_SpawnOnTallGrass - - thumb_func_start GroundEffect_StepOnTallGrass -@ void GroundEffect_StepOnTallGrass(struct npc_state *fieldObject, struct obj *object) -GroundEffect_StepOnTallGrass: @ 8096EDC - push {lr} - ldr r3, =0x02038c08 - movs r2, 0x10 - ldrsh r1, [r0, r2] - str r1, [r3] - movs r2, 0x12 - ldrsh r1, [r0, r2] - str r1, [r3, 0x4] - ldrb r1, [r0, 0xB] - lsrs r1, 4 - str r1, [r3, 0x8] - movs r1, 0x2 - str r1, [r3, 0xC] - ldrb r1, [r0, 0x8] - lsls r1, 8 - ldrb r2, [r0, 0x9] - orrs r1, r2 - str r1, [r3, 0x10] - ldrb r0, [r0, 0xA] - str r0, [r3, 0x14] - ldr r0, =0x03005d8c - ldr r1, [r0] - ldrb r0, [r1, 0x5] - lsls r0, 8 - ldrb r1, [r1, 0x4] - orrs r0, r1 - str r0, [r3, 0x18] - movs r0, 0 - str r0, [r3, 0x1C] - movs r0, 0x4 - bl FieldEffectStart - pop {r0} - bx r0 - .pool - thumb_func_end GroundEffect_StepOnTallGrass - - thumb_func_start GroundEffect_SpawnOnLongGrass -@ void GroundEffect_SpawnOnLongGrass(struct npc_state *fieldObject, struct obj *object) -GroundEffect_SpawnOnLongGrass: @ 8096F28 - push {lr} - ldr r3, =0x02038c08 - movs r2, 0x10 - ldrsh r1, [r0, r2] - str r1, [r3] - movs r2, 0x12 - ldrsh r1, [r0, r2] - str r1, [r3, 0x4] - ldrb r1, [r0, 0xB] - lsrs r1, 4 - str r1, [r3, 0x8] - movs r1, 0x2 - str r1, [r3, 0xC] - ldrb r1, [r0, 0x8] - lsls r1, 8 - ldrb r2, [r0, 0x9] - orrs r1, r2 - str r1, [r3, 0x10] - ldrb r0, [r0, 0xA] - str r0, [r3, 0x14] - ldr r0, =0x03005d8c - ldr r1, [r0] - ldrb r0, [r1, 0x5] - lsls r0, 8 - ldrb r1, [r1, 0x4] - orrs r0, r1 - str r0, [r3, 0x18] - movs r0, 0x1 - str r0, [r3, 0x1C] - movs r0, 0x11 - bl FieldEffectStart - pop {r0} - bx r0 - .pool - thumb_func_end GroundEffect_SpawnOnLongGrass - - thumb_func_start GroundEffect_StepOnLongGrass -@ void GroundEffect_StepOnLongGrass(struct npc_state *fieldObject, struct obj *object) -GroundEffect_StepOnLongGrass: @ 8096F74 - push {lr} - ldr r3, =0x02038c08 - movs r2, 0x10 - ldrsh r1, [r0, r2] - str r1, [r3] - movs r2, 0x12 - ldrsh r1, [r0, r2] - str r1, [r3, 0x4] - ldrb r1, [r0, 0xB] - lsrs r1, 4 - str r1, [r3, 0x8] - movs r1, 0x2 - str r1, [r3, 0xC] - ldrb r1, [r0, 0x8] - lsls r1, 8 - ldrb r2, [r0, 0x9] - orrs r1, r2 - str r1, [r3, 0x10] - ldrb r0, [r0, 0xA] - str r0, [r3, 0x14] - ldr r0, =0x03005d8c - ldr r1, [r0] - ldrb r0, [r1, 0x5] - lsls r0, 8 - ldrb r1, [r1, 0x4] - orrs r0, r1 - str r0, [r3, 0x18] - movs r0, 0 - str r0, [r3, 0x1C] - movs r0, 0x11 - bl FieldEffectStart - pop {r0} - bx r0 - .pool - thumb_func_end GroundEffect_StepOnLongGrass - - thumb_func_start GroundEffect_WaterReflection -@ void GroundEffect_WaterReflection(struct npc_state *fieldObject, struct obj *object) -GroundEffect_WaterReflection: @ 8096FC0 - push {lr} - movs r2, 0 - bl SetUpReflection - pop {r0} - bx r0 - thumb_func_end GroundEffect_WaterReflection - - thumb_func_start GroundEffect_IceReflection -@ void GroundEffect_IceReflection(struct npc_state *fieldObject, struct obj *object) -GroundEffect_IceReflection: @ 8096FCC - push {lr} - movs r2, 0x1 - bl SetUpReflection - pop {r0} - bx r0 - thumb_func_end GroundEffect_IceReflection - - thumb_func_start GroundEffect_FlowingWater -@ void GroundEffect_FlowingWater(struct npc_state *fieldObject, struct obj *object) -GroundEffect_FlowingWater: @ 8096FD8 - push {lr} - adds r1, r0, 0 - movs r0, 0x22 - bl oe_exec_and_other_stuff - pop {r0} - bx r0 - thumb_func_end GroundEffect_FlowingWater - - thumb_func_start GroundEffect_SandTracks -@ void GroundEffect_SandTracks(struct npc_state *fieldObject, struct obj *object) -GroundEffect_SandTracks: @ 8096FE8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x5] - bl GetFieldObjectGraphicsInfo - ldr r1, =gUnknown_0850E654 - ldrb r0, [r0, 0xD] - lsls r0, 2 - adds r0, r1 - ldr r3, [r0] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0 - bl _call_via_r3 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end GroundEffect_SandTracks - - thumb_func_start GroundEffect_DeepSandTracks -@ void GroundEffect_DeepSandTracks(struct npc_state *fieldObject, struct obj *object) -GroundEffect_DeepSandTracks: @ 8097014 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x5] - bl GetFieldObjectGraphicsInfo - ldr r1, =gUnknown_0850E654 - ldrb r0, [r0, 0xD] - lsls r0, 2 - adds r0, r1 - ldr r3, [r0] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x1 - bl _call_via_r3 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end GroundEffect_DeepSandTracks - - thumb_func_start DoTracksGroundEffect_None -@ void DoTracksGroundEffect_None(struct npc_state *fieldObject, struct obj *object) -DoTracksGroundEffect_None: @ 8097040 - bx lr - thumb_func_end DoTracksGroundEffect_None - - thumb_func_start DoTracksGroundEffect_Footprints -@ void DoTracksGroundEffect_Footprints(struct npc_state *fieldObject, struct obj *object) -DoTracksGroundEffect_Footprints: @ 8097044 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - lsls r4, r2, 24 - lsrs r4, 24 - ldr r1, =gUnknown_0850E660 - mov r0, sp - movs r2, 0x4 - bl memcpy - ldr r1, =0x02038c08 - movs r2, 0x14 - ldrsh r0, [r5, r2] - str r0, [r1] - movs r2, 0x16 - ldrsh r0, [r5, r2] - str r0, [r1, 0x4] - movs r0, 0x95 - str r0, [r1, 0x8] - movs r0, 0x2 - str r0, [r1, 0xC] - ldrb r0, [r5, 0x18] - lsls r0, 28 - lsrs r0, 28 - str r0, [r1, 0x10] - lsls r4, 1 - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - bl FieldEffectStart - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DoTracksGroundEffect_Footprints - - thumb_func_start DoTracksGroundEffect_BikeTireTracks -@ void DoTracksGroundEffect_BikeTireTracks(struct npc_state *fieldObject, struct obj *object) -DoTracksGroundEffect_BikeTireTracks: @ 8097094 - push {r4,lr} - adds r4, r0, 0 - ldr r1, [r4, 0x10] - ldr r0, [r4, 0x14] - cmp r1, r0 - beq _080970D6 - ldr r2, =0x02038c08 - movs r1, 0x14 - ldrsh r0, [r4, r1] - str r0, [r2] - movs r1, 0x16 - ldrsh r0, [r4, r1] - str r0, [r2, 0x4] - movs r0, 0x95 - str r0, [r2, 0x8] - movs r0, 0x2 - str r0, [r2, 0xC] - ldr r3, =gUnknown_0850E664 - ldrb r1, [r4, 0x18] - lsls r1, 28 - lsrs r1, 28 - adds r0, r4, 0 - adds r0, 0x20 - ldrb r0, [r0] - lsls r0, 2 - subs r0, 0x5 - adds r1, r0 - adds r1, r3 - ldrb r0, [r1] - str r0, [r2, 0x10] - movs r0, 0x23 - bl FieldEffectStart -_080970D6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end DoTracksGroundEffect_BikeTireTracks - - thumb_func_start GroundEffect_Ripple -@ void GroundEffect_Ripple(struct npc_state *fieldObject, struct obj *object) -GroundEffect_Ripple: @ 80970E4 - push {lr} - bl DoRippleFieldEffect - pop {r0} - bx r0 - thumb_func_end GroundEffect_Ripple - - thumb_func_start GroundEffect_StepOnPuddle -@ void GroundEffect_StepOnPuddle(struct npc_state *fieldObject, struct obj *object) -GroundEffect_StepOnPuddle: @ 80970F0 - push {lr} - adds r1, r0, 0 - movs r0, 0xF - bl oe_exec_and_other_stuff - pop {r0} - bx r0 - thumb_func_end GroundEffect_StepOnPuddle - - thumb_func_start GroundEffect_SandHeap -@ void GroundEffect_SandHeap(struct npc_state *fieldObject, struct obj *object) -GroundEffect_SandHeap: @ 8097100 - push {lr} - adds r1, r0, 0 - movs r0, 0x27 - bl oe_exec_and_other_stuff - pop {r0} - bx r0 - thumb_func_end GroundEffect_SandHeap - - thumb_func_start GroundEffect_JumpOnTallGrass -@ void GroundEffect_JumpOnTallGrass(struct npc_state *fieldObject, struct obj *object) -GroundEffect_JumpOnTallGrass: @ 8097110 - push {r4-r7,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r6, r1, 0 - ldr r1, =0x02038c08 - movs r2, 0x10 - ldrsh r0, [r5, r2] - str r0, [r1] - movs r4, 0x12 - ldrsh r0, [r5, r4] - str r0, [r1, 0x4] - ldrb r0, [r5, 0xB] - lsrs r0, 4 - str r0, [r1, 0x8] - movs r0, 0x2 - str r0, [r1, 0xC] - movs r0, 0xC - bl FieldEffectStart - ldrb r0, [r5, 0x8] - ldrb r1, [r5, 0x9] - ldrb r2, [r5, 0xA] - movs r7, 0x10 - ldrsh r3, [r5, r7] - movs r7, 0x12 - ldrsh r4, [r5, r7] - str r4, [sp] - bl sub_81546C8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - bne _0809715A - adds r0, r5, 0 - adds r1, r6, 0 - bl GroundEffect_SpawnOnTallGrass -_0809715A: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end GroundEffect_JumpOnTallGrass - - thumb_func_start GroundEffect_JumpOnLongGrass -@ void GroundEffect_JumpOnLongGrass(struct npc_state *fieldObject, struct obj *object) -GroundEffect_JumpOnLongGrass: @ 8097168 - push {lr} - ldr r2, =0x02038c08 - movs r3, 0x10 - ldrsh r1, [r0, r3] - str r1, [r2] - movs r3, 0x12 - ldrsh r1, [r0, r3] - str r1, [r2, 0x4] - ldrb r0, [r0, 0xB] - lsrs r0, 4 - str r0, [r2, 0x8] - movs r0, 0x2 - str r0, [r2, 0xC] - movs r0, 0x12 - bl FieldEffectStart - pop {r0} - bx r0 - .pool - thumb_func_end GroundEffect_JumpOnLongGrass - - thumb_func_start GroundEffect_JumpOnShallowWater -@ void GroundEffect_JumpOnShallowWater(struct npc_state *fieldObject, struct obj *object) -GroundEffect_JumpOnShallowWater: @ 8097190 - push {r4,lr} - ldr r3, =0x02038c08 - movs r4, 0x10 - ldrsh r2, [r0, r4] - str r2, [r3] - movs r4, 0x12 - ldrsh r2, [r0, r4] - str r2, [r3, 0x4] - ldrb r0, [r0, 0xB] - lsrs r0, 4 - str r0, [r3, 0x8] - ldrb r0, [r1, 0x5] - lsls r0, 28 - lsrs r0, 30 - str r0, [r3, 0xC] - movs r0, 0x10 - bl FieldEffectStart - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end GroundEffect_JumpOnShallowWater - - thumb_func_start GroundEffect_JumpOnWater -@ void GroundEffect_JumpOnWater(struct npc_state *fieldObject, struct obj *object) -GroundEffect_JumpOnWater: @ 80971C0 - push {r4,lr} - ldr r3, =0x02038c08 - movs r4, 0x10 - ldrsh r2, [r0, r4] - str r2, [r3] - movs r4, 0x12 - ldrsh r2, [r0, r4] - str r2, [r3, 0x4] - ldrb r0, [r0, 0xB] - lsrs r0, 4 - str r0, [r3, 0x8] - ldrb r0, [r1, 0x5] - lsls r0, 28 - lsrs r0, 30 - str r0, [r3, 0xC] - movs r0, 0xE - bl FieldEffectStart - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end GroundEffect_JumpOnWater - - thumb_func_start GroundEffect_JumpLandingDust -@ void GroundEffect_JumpLandingDust(struct npc_state *fieldObject, struct obj *object) -GroundEffect_JumpLandingDust: @ 80971F0 - push {r4,lr} - ldr r3, =0x02038c08 - movs r4, 0x10 - ldrsh r2, [r0, r4] - str r2, [r3] - movs r4, 0x12 - ldrsh r2, [r0, r4] - str r2, [r3, 0x4] - ldrb r0, [r0, 0xB] - lsrs r0, 4 - str r0, [r3, 0x8] - ldrb r0, [r1, 0x5] - lsls r0, 28 - lsrs r0, 30 - str r0, [r3, 0xC] - movs r0, 0xA - bl FieldEffectStart - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end GroundEffect_JumpLandingDust - - thumb_func_start GroundEffect_ShortGrass -@ void GroundEffect_ShortGrass(struct npc_state *fieldObject, struct obj *object) -GroundEffect_ShortGrass: @ 8097220 - push {lr} - adds r1, r0, 0 - movs r0, 0x29 - bl oe_exec_and_other_stuff - pop {r0} - bx r0 - thumb_func_end GroundEffect_ShortGrass - - thumb_func_start GroundEffect_HotSprings -@ void GroundEffect_HotSprings(struct npc_state *fieldObject, struct obj *object) -GroundEffect_HotSprings: @ 8097230 - push {lr} - adds r1, r0, 0 - movs r0, 0x2A - bl oe_exec_and_other_stuff - pop {r0} - bx r0 - thumb_func_end GroundEffect_HotSprings - - thumb_func_start GroundEffect_Seaweed -@ void GroundEffect_Seaweed(struct npc_state *fieldObject, struct obj *object) -GroundEffect_Seaweed: @ 8097240 - push {lr} - ldr r2, =0x02038c08 - movs r3, 0x10 - ldrsh r1, [r0, r3] - str r1, [r2] - movs r1, 0x12 - ldrsh r0, [r0, r1] - str r0, [r2, 0x4] - movs r0, 0x35 - bl FieldEffectStart - pop {r0} - bx r0 - .pool - thumb_func_end GroundEffect_Seaweed - - thumb_func_start DoFlaggedGroundEffects -@ void DoFlaggedGroundEffects(struct npc_state *fieldObject, struct obj *object, u32 flags) -DoFlaggedGroundEffects: @ 8097260 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - adds r7, r1, 0 - adds r5, r2, 0 - bl FieldObjectIsFarawayIslandMew - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08097284 - adds r0, r6, 0 - bl sub_81D4A58 - lsls r0, 24 - cmp r0, 0 - beq _080972AC -_08097284: - movs r4, 0 - ldr r0, =gUnknown_0850E674 - mov r8, r0 -_0809728A: - movs r0, 0x1 - ands r0, r5 - cmp r0, 0 - beq _080972A0 - lsls r0, r4, 2 - add r0, r8 - ldr r2, [r0] - adds r0, r6, 0 - adds r1, r7, 0 - bl _call_via_r2 -_080972A0: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - lsrs r5, 1 - cmp r4, 0x13 - bls _0809728A -_080972AC: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end DoFlaggedGroundEffects - - thumb_func_start filters_out_some_ground_effects -@ void filters_out_some_ground_effects(struct npc_state *fieldObject, u32 *flags) -filters_out_some_ground_effects: @ 80972BC - push {lr} - adds r2, r0, 0 - adds r3, r1, 0 - ldrb r0, [r2] - lsls r0, 27 - cmp r0, 0 - bge _080972EA - ldrb r1, [r2, 0x2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - movs r1, 0x11 - negs r1, r1 - ands r0, r1 - adds r1, 0x8 - ands r0, r1 - subs r1, 0x18 - ands r0, r1 - strb r0, [r2, 0x2] - ldr r0, [r3] - ldr r1, =0xfff9f7bd - ands r0, r1 - str r0, [r3] -_080972EA: - pop {r0} - bx r0 - .pool - thumb_func_end filters_out_some_ground_effects - - thumb_func_start FilterOutStepOnPuddleGroundEffectIfJumping -@ void FilterOutStepOnPuddleGroundEffectIfJumping(struct npc_state *fieldObject, u32 *flags) -FilterOutStepOnPuddleGroundEffectIfJumping: @ 80972F4 - push {lr} - adds r2, r1, 0 - ldrb r0, [r0] - lsls r0, 26 - cmp r0, 0 - bge _08097308 - ldr r0, [r2] - ldr r1, =0xfffffbff - ands r0, r1 - str r0, [r2] -_08097308: - pop {r0} - bx r0 - .pool - thumb_func_end FilterOutStepOnPuddleGroundEffectIfJumping - - thumb_func_start DoGroundEffects_OnSpawn -@ void DoGroundEffects_OnSpawn(struct npc_state *fieldObject, struct obj *object) -DoGroundEffects_OnSpawn: @ 8097310 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4] - lsls r0, 29 - cmp r0, 0 - bge _08097354 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - bl FieldObjectUpdateZCoordAndPriority - adds r0, r4, 0 - mov r1, sp - bl GetAllGroundEffectFlags_OnSpawn - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetSpriteOamTableForLongGrass - ldr r2, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - bl DoFlaggedGroundEffects - ldrb r1, [r4] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - movs r1, 0x11 - negs r1, r1 - ands r0, r1 - strb r0, [r4] -_08097354: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end DoGroundEffects_OnSpawn - - thumb_func_start DoGroundEffects_OnBeginStep -@ void DoGroundEffects_OnBeginStep(struct npc_state *fieldObject, struct obj *object) -DoGroundEffects_OnBeginStep: @ 809735C - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4] - lsls r0, 29 - cmp r0, 0 - bge _080973A8 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - bl FieldObjectUpdateZCoordAndPriority - adds r0, r4, 0 - mov r1, sp - bl GetAllGroundEffectFlags_OnBeginStep - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetSpriteOamTableForLongGrass - adds r0, r4, 0 - mov r1, sp - bl filters_out_some_ground_effects - ldr r2, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - bl DoFlaggedGroundEffects - ldrb r1, [r4] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - movs r1, 0x11 - negs r1, r1 - ands r0, r1 - strb r0, [r4] -_080973A8: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end DoGroundEffects_OnBeginStep - - thumb_func_start DoGroundEffects_OnFinishStep -@ void DoGroundEffects_OnFinishStep(struct npc_state *fieldObject, struct obj *object) -DoGroundEffects_OnFinishStep: @ 80973B0 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4] - lsls r0, 28 - cmp r0, 0 - bge _080973FC - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - bl FieldObjectUpdateZCoordAndPriority - adds r0, r4, 0 - mov r1, sp - bl GetAllGroundEffectFlags_OnFinishStep - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetSpriteOamTableForLongGrass - adds r0, r4, 0 - mov r1, sp - bl FilterOutStepOnPuddleGroundEffectIfJumping - ldr r2, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - bl DoFlaggedGroundEffects - ldrb r1, [r4] - movs r0, 0x9 - negs r0, r0 - ands r0, r1 - movs r1, 0x21 - negs r1, r1 - ands r0, r1 - strb r0, [r4] -_080973FC: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end DoGroundEffects_OnFinishStep - - thumb_func_start sub_8097404 -@ bool8 sub_8097404(struct npc_state *fieldObject) -sub_8097404: @ 8097404 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r1, [r5] - movs r0, 0xA0 - lsls r0, 1 - ands r0, r1 - cmp r0, 0 - bne _0809748C - ldrb r0, [r5, 0x1] - movs r4, 0x1 - orrs r0, r4 - strb r0, [r5, 0x1] - ldr r3, =0x02020630 - ldrb r1, [r5, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x2C - ldrb r1, [r0] - lsls r1, 25 - lsrs r1, 31 - lsls r1, 7 - ldrb r2, [r5, 0x2] - movs r0, 0x7F - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x2] - ldrb r1, [r5, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x2C - ldrb r1, [r0] - lsrs r1, 7 - ands r1, r4 - ldrb r2, [r5, 0x3] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x3] - ldrb r1, [r5, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x2C - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] - ldrb r1, [r5, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x2C - ldrb r1, [r0] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0] - movs r0, 0 - b _0809748E - .pool -_0809748C: - movs r0, 0x1 -_0809748E: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8097404 - - thumb_func_start player_bitmagic -@ void player_bitmagic() -player_bitmagic: @ 8097494 - push {r4,r5,lr} - movs r4, 0 - ldr r5, =0x02037350 -_0809749A: - lsls r0, r4, 3 - adds r0, r4 - lsls r0, 2 - adds r1, r0, r5 - ldrb r0, [r1] - lsls r0, 31 - cmp r0, 0 - beq _080974B8 - ldr r0, =0x02037590 - ldrb r0, [r0, 0x5] - cmp r4, r0 - beq _080974B8 - adds r0, r1, 0 - bl sub_8097404 -_080974B8: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _0809749A - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end player_bitmagic - - thumb_func_start sub_80974D0 -sub_80974D0: @ 80974D0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - ldr r6, =0x02037350 -_080974DA: - cmp r4, r5 - beq _080974FC - lsls r0, r4, 3 - adds r0, r4 - lsls r0, 2 - adds r1, r0, r6 - ldrb r0, [r1] - lsls r0, 31 - cmp r0, 0 - beq _080974FC - ldr r0, =0x02037590 - ldrb r0, [r0, 0x5] - cmp r4, r0 - beq _080974FC - adds r0, r1, 0 - bl sub_8097404 -_080974FC: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _080974DA - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80974D0 - - thumb_func_start npc_sync_anim_pause_bits -@ void npc_sync_anim_pause_bits(struct npc_state *fieldObject) -npc_sync_anim_pause_bits: @ 8097514 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r2, [r5] - ldr r1, =0x00000101 - adds r0, r1, 0 - ands r0, r2 - cmp r0, r1 - bne _0809756C - ldrb r1, [r5, 0x1] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - strb r0, [r5, 0x1] - ldr r4, =0x02020630 - ldrb r0, [r5, 0x4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r2, [r5, 0x2] - adds r1, 0x2C - lsrs r2, 7 - lsls r2, 6 - ldrb r3, [r1] - movs r0, 0x41 - negs r0, r0 - ands r0, r3 - orrs r0, r2 - strb r0, [r1] - ldrb r0, [r5, 0x4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r4 - ldrb r1, [r5, 0x3] - lsls r1, 31 - lsrs r1, 31 - adds r2, 0x2C - lsls r1, 7 - ldrb r3, [r2] - movs r0, 0x7F - ands r0, r3 - orrs r0, r1 - strb r0, [r2] -_0809756C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end npc_sync_anim_pause_bits - - thumb_func_start sub_809757C -sub_809757C: @ 809757C - push {r4,r5,lr} - movs r4, 0 - ldr r5, =0x02037350 -_08097582: - lsls r0, r4, 3 - adds r0, r4 - lsls r0, 2 - adds r1, r0, r5 - ldrb r0, [r1] - lsls r0, 31 - cmp r0, 0 - beq _08097598 - adds r0, r1, 0 - bl npc_sync_anim_pause_bits -_08097598: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _08097582 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809757C - - thumb_func_start little_step -@ void little_step(struct obj *object, u8 direction) -little_step: @ 80975AC - lsls r1, 24 - ldr r2, =gUnknown_0850DB7C - lsrs r1, 22 - adds r1, r2 - ldrh r2, [r1] - ldrh r3, [r0, 0x20] - adds r2, r3 - strh r2, [r0, 0x20] - ldrh r1, [r1, 0x2] - ldrh r2, [r0, 0x22] - adds r1, r2 - strh r1, [r0, 0x22] - bx lr - .pool - thumb_func_end little_step - - thumb_func_start double_little_steps -double_little_steps: @ 80975CC - lsls r1, 24 - ldr r2, =gUnknown_0850DB7C - lsrs r1, 22 - adds r1, r2 - ldrh r2, [r1] - lsls r2, 1 - ldrh r3, [r0, 0x20] - adds r2, r3 - strh r2, [r0, 0x20] - ldrh r1, [r1, 0x2] - lsls r1, 1 - ldrh r2, [r0, 0x22] - adds r1, r2 - strh r1, [r0, 0x22] - bx lr - .pool - thumb_func_end double_little_steps - - thumb_func_start triple_little_steps -triple_little_steps: @ 80975F0 - lsls r1, 24 - ldr r2, =gUnknown_0850DB7C - lsrs r1, 22 - adds r1, r2 - ldrh r2, [r1] - lsls r3, r2, 1 - adds r2, r3 - ldrh r3, [r0, 0x20] - adds r2, r3 - strh r2, [r0, 0x20] - ldrh r1, [r1, 0x2] - lsls r2, r1, 1 - adds r1, r2 - ldrh r2, [r0, 0x22] - adds r1, r2 - strh r1, [r0, 0x22] - bx lr - .pool - thumb_func_end triple_little_steps - - thumb_func_start quad_little_steps -quad_little_steps: @ 8097618 - lsls r1, 24 - ldr r2, =gUnknown_0850DB7C - lsrs r1, 22 - adds r1, r2 - ldrh r2, [r1] - lsls r2, 2 - ldrh r3, [r0, 0x20] - adds r2, r3 - strh r2, [r0, 0x20] - ldrh r1, [r1, 0x2] - lsls r1, 2 - ldrh r2, [r0, 0x22] - adds r1, r2 - strh r1, [r0, 0x22] - bx lr - .pool - thumb_func_end quad_little_steps - - thumb_func_start oct_little_steps -@ void oct_little_steps(struct obj *object, u8 direction) -oct_little_steps: @ 809763C - lsls r1, 24 - ldr r2, =gUnknown_0850DB7C - lsrs r1, 22 - adds r1, r2 - ldrh r2, [r1] - lsls r2, 3 - ldrh r3, [r0, 0x20] - adds r2, r3 - strh r2, [r0, 0x20] - ldrh r1, [r1, 0x2] - lsls r1, 3 - ldrh r2, [r0, 0x22] - adds r1, r2 - strh r1, [r0, 0x22] - bx lr - .pool - thumb_func_end oct_little_steps - - thumb_func_start oamt_npc_ministep_reset -@ void oamt_npc_ministep_reset(struct obj *object, u8 direction, u8 speed) -oamt_npc_ministep_reset: @ 8097660 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - movs r3, 0 - strh r1, [r0, 0x34] - strh r2, [r0, 0x36] - strh r3, [r0, 0x38] - bx lr - thumb_func_end oamt_npc_ministep_reset - - thumb_func_start obj_npc_ministep -@ bool8 obj_npc_ministep(struct obj *object) -obj_npc_ministep: @ 8097674 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =gUnknown_0850E768 - movs r0, 0x36 - ldrsh r2, [r4, r0] - lsls r0, r2, 1 - adds r0, r5 - movs r3, 0x38 - ldrsh r1, [r4, r3] - movs r3, 0 - ldrsh r0, [r0, r3] - cmp r1, r0 - bge _080976D4 - ldr r1, =gUnknown_0850E754 - lsls r0, r2, 2 - adds r0, r1 - movs r1, 0x38 - ldrsh r2, [r4, r1] - ldr r0, [r0] - lsls r2, 2 - adds r2, r0 - ldrh r1, [r4, 0x34] - lsls r1, 24 - lsrs r1, 24 - ldr r2, [r2] - adds r0, r4, 0 - bl _call_via_r2 - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - movs r2, 0x36 - ldrsh r1, [r4, r2] - lsls r1, 1 - adds r1, r5 - lsls r0, 16 - asrs r0, 16 - movs r3, 0 - ldrsh r1, [r1, r3] - cmp r0, r1 - blt _080976D4 - movs r0, 0x1 - b _080976D6 - .pool -_080976D4: - movs r0, 0 -_080976D6: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end obj_npc_ministep - - thumb_func_start sub_80976DC -@ void sub_80976DC(struct obj *object, u8 direction) -sub_80976DC: @ 80976DC - lsls r1, 24 - lsrs r1, 24 - movs r2, 0 - strh r1, [r0, 0x34] - strh r2, [r0, 0x36] - strh r2, [r0, 0x38] - bx lr - thumb_func_end sub_80976DC - - thumb_func_start sub_80976EC -@ bool8 sub_80976EC(struct obj *object) -sub_80976EC: @ 80976EC - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x36] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0809770C - ldrh r1, [r4, 0x34] - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl little_step - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] -_0809770C: - ldrh r0, [r4, 0x36] - adds r0, 0x1 - strh r0, [r4, 0x36] - movs r1, 0x38 - ldrsh r0, [r4, r1] - cmp r0, 0xF - bgt _0809771E - movs r0, 0 - b _08097720 -_0809771E: - movs r0, 0x1 -_08097720: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80976EC - - thumb_func_start sub_8097728 -sub_8097728: @ 8097728 - ldr r1, =gUnknown_0850E7BA - lsls r0, 16 - asrs r0, 16 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - bx lr - .pool - thumb_func_end sub_8097728 - - thumb_func_start sub_809773C -sub_809773C: @ 809773C - ldr r1, =gUnknown_0850E772 - lsls r0, 16 - asrs r0, 16 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - bx lr - .pool - thumb_func_end sub_809773C - - thumb_func_start sub_8097750 -sub_8097750: @ 8097750 - movs r1, 0 - strh r1, [r0, 0x3A] - strh r1, [r0, 0x3C] - bx lr - thumb_func_end sub_8097750 - - thumb_func_start sub_8097758 -sub_8097758: @ 8097758 - push {r4-r6,lr} - adds r5, r0, 0 - movs r6, 0 - movs r1, 0x3C - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _0809778E - cmp r0, 0x1 - bgt _08097770 - cmp r0, 0 - beq _0809777A - b _080977F2 -_08097770: - cmp r0, 0x2 - beq _080977B6 - cmp r0, 0x3 - beq _080977CA - b _080977F2 -_0809777A: - movs r2, 0x3A - ldrsh r0, [r5, r2] - bl sub_809773C - ldrh r1, [r5, 0x24] - adds r0, r1 - strh r0, [r5, 0x24] - movs r2, 0x3A - ldrsh r0, [r5, r2] - b _080977E8 -_0809778E: - ldrh r0, [r5, 0x3A] - movs r4, 0x47 - subs r0, r4, r0 - lsls r0, 16 - asrs r0, 16 - bl sub_809773C - ldrh r1, [r5, 0x24] - subs r1, r0 - strh r1, [r5, 0x24] - ldrh r0, [r5, 0x3A] - subs r4, r0 - lsls r4, 16 - asrs r4, 16 - adds r0, r4, 0 - bl sub_8097728 - ldrh r2, [r5, 0x26] - adds r0, r2 - b _080977F0 -_080977B6: - movs r1, 0x3A - ldrsh r0, [r5, r1] - bl sub_809773C - ldrh r1, [r5, 0x24] - subs r1, r0 - strh r1, [r5, 0x24] - movs r2, 0x3A - ldrsh r0, [r5, r2] - b _080977E8 -_080977CA: - ldrh r0, [r5, 0x3A] - movs r4, 0x47 - subs r0, r4, r0 - lsls r0, 16 - asrs r0, 16 - bl sub_809773C - ldrh r2, [r5, 0x24] - adds r0, r2 - strh r0, [r5, 0x24] - ldrh r0, [r5, 0x3A] - subs r4, r0 - lsls r4, 16 - asrs r4, 16 - adds r0, r4, 0 -_080977E8: - bl sub_8097728 - ldrh r1, [r5, 0x26] - adds r0, r1 -_080977F0: - strh r0, [r5, 0x26] -_080977F2: - ldrh r0, [r5, 0x3A] - adds r0, 0x1 - movs r1, 0 - strh r0, [r5, 0x3A] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x48 - bne _0809780A - strh r1, [r5, 0x3A] - ldrh r0, [r5, 0x3C] - adds r0, 0x1 - strh r0, [r5, 0x3C] -_0809780A: - movs r2, 0x3C - ldrsh r0, [r5, r2] - cmp r0, 0x4 - bne _08097818 - strh r1, [r5, 0x26] - strh r1, [r5, 0x24] - movs r6, 0x1 -_08097818: - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8097758 - - thumb_func_start sub_8097820 -sub_8097820: @ 8097820 - lsls r1, 24 - ldr r2, =gUnknown_0850E834 - lsrs r1, 22 - adds r1, r2 - lsls r0, 16 - asrs r0, 16 - ldr r1, [r1] - adds r1, r0 - movs r0, 0 - ldrsb r0, [r1, r0] - bx lr - .pool - thumb_func_end sub_8097820 - - thumb_func_start sub_809783C -sub_809783C: @ 809783C - push {r4,lr} - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - movs r4, 0 - strh r1, [r0, 0x34] - strh r2, [r0, 0x36] - strh r3, [r0, 0x38] - strh r4, [r0, 0x3A] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_809783C - - thumb_func_start sub_809785C -sub_809785C: @ 809785C - push {r4-r6,lr} - sub sp, 0xC - adds r4, r0, 0 - ldr r1, =gUnknown_0850E840 - mov r0, sp - movs r2, 0x6 - bl memcpy - add r5, sp, 0x8 - ldr r1, =gUnknown_0850E846 - adds r0, r5, 0 - movs r2, 0x3 - bl memcpy - movs r6, 0 - movs r1, 0x36 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0809788E - ldrh r1, [r4, 0x34] - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl little_step -_0809788E: - movs r2, 0x3A - ldrsh r0, [r4, r2] - movs r2, 0x36 - ldrsh r1, [r4, r2] - adds r1, r5, r1 - ldrb r1, [r1] - asrs r0, r1 - ldrh r1, [r4, 0x38] - lsls r1, 24 - lsrs r1, 24 - bl sub_8097820 - strh r0, [r4, 0x26] - ldrh r1, [r4, 0x3A] - adds r1, 0x1 - strh r1, [r4, 0x3A] - movs r2, 0x36 - ldrsh r0, [r4, r2] - lsls r0, 1 - add r0, sp - ldrh r0, [r0] - lsls r0, 16 - asrs r2, r0, 16 - lsls r1, 16 - asrs r1, 16 - asrs r0, 17 - cmp r1, r0 - bne _080978C8 - movs r6, 0x1 -_080978C8: - cmp r1, r2 - blt _080978D2 - movs r0, 0 - strh r0, [r4, 0x26] - movs r6, 0xFF -_080978D2: - adds r0, r6, 0 - add sp, 0xC - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809785C - - thumb_func_start sub_80978E4 -sub_80978E4: @ 80978E4 - push {r4-r6,lr} - sub sp, 0xC - adds r5, r0, 0 - ldr r1, =gUnknown_0850E84A - mov r0, sp - movs r2, 0x6 - bl memcpy - add r4, sp, 0x8 - ldr r1, =gUnknown_0850E850 - adds r0, r4, 0 - movs r2, 0x3 - bl memcpy - movs r6, 0 - movs r1, 0x36 - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _08097920 - ldrh r1, [r5, 0x3A] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08097920 - ldrh r1, [r5, 0x34] - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl little_step -_08097920: - movs r2, 0x3A - ldrsh r0, [r5, r2] - movs r2, 0x36 - ldrsh r1, [r5, r2] - adds r1, r4, r1 - ldrb r1, [r1] - asrs r0, r1 - ldrh r1, [r5, 0x38] - lsls r1, 24 - lsrs r1, 24 - bl sub_8097820 - strh r0, [r5, 0x26] - ldrh r1, [r5, 0x3A] - adds r1, 0x1 - strh r1, [r5, 0x3A] - movs r2, 0x36 - ldrsh r0, [r5, r2] - lsls r0, 1 - add r0, sp - ldrh r0, [r0] - lsls r0, 16 - asrs r2, r0, 16 - lsls r1, 16 - asrs r1, 16 - asrs r0, 17 - cmp r1, r0 - bne _0809795A - movs r6, 0x1 -_0809795A: - cmp r1, r2 - blt _08097964 - movs r0, 0 - strh r0, [r5, 0x26] - movs r6, 0xFF -_08097964: - adds r0, r6, 0 - add sp, 0xC - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80978E4 - - thumb_func_start sub_8097978 -@ void sub_8097978(struct obj *object, u16 a2) -sub_8097978: @ 8097978 - strh r1, [r0, 0x34] - bx lr - thumb_func_end sub_8097978 - - thumb_func_start sub_809797C -@ bool8 sub_809797C(struct obj *object) -sub_809797C: @ 809797C - push {lr} - ldrh r1, [r0, 0x34] - subs r1, 0x1 - strh r1, [r0, 0x34] - lsls r1, 16 - cmp r1, 0 - beq _0809798E - movs r0, 0 - b _08097990 -_0809798E: - movs r0, 0x1 -_08097990: - pop {r1} - bx r1 - thumb_func_end sub_809797C - - thumb_func_start obj_anim_image_set_and_seek -obj_anim_image_set_and_seek: @ 8097994 - push {r4,lr} - lsls r2, 24 - lsrs r2, 24 - adds r3, r0, 0 - adds r3, 0x2A - strb r1, [r3] - adds r4, r0, 0 - adds r4, 0x2C - ldrb r3, [r4] - movs r1, 0x41 - negs r1, r1 - ands r1, r3 - strb r1, [r4] - adds r1, r2, 0 - bl SeekObjectImageAnim - pop {r4} - pop {r0} - bx r0 - thumb_func_end obj_anim_image_set_and_seek - - thumb_func_start sub_80979BC -sub_80979BC: @ 80979BC - push {lr} - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _080979CE - movs r0, 0 - b _080979D0 -_080979CE: - movs r0, 0x1 -_080979D0: - pop {r1} - bx r1 - thumb_func_end sub_80979BC - - thumb_func_start sub_80979D4 -sub_80979D4: @ 80979D4 - push {r4-r6,lr} - mov r12, r0 - lsls r1, 24 - lsrs r1, 24 - mov r3, r12 - adds r3, 0x3E - movs r0, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08097A3C - mov r0, r12 - ldrh r1, [r0, 0x24] - ldrh r2, [r0, 0x20] - adds r1, r2 - mov r4, r12 - adds r4, 0x28 - movs r0, 0 - ldrsb r0, [r4, r0] - ldr r2, =0x02021bbc - adds r0, r1 - ldrh r2, [r2] - adds r0, r2 - lsls r0, 16 - lsrs r6, r0, 16 - mov r0, r12 - ldrh r1, [r0, 0x26] - ldrh r2, [r0, 0x22] - adds r1, r2 - subs r3, 0x15 - movs r0, 0 - ldrsb r0, [r3, r0] - ldr r2, =0x02021bbe - adds r0, r1 - ldrh r2, [r2] - adds r0, r2 - lsls r0, 16 - lsrs r5, r0, 16 - adds r2, r3, 0 - b _08097A6A - .pool -_08097A3C: - mov r0, r12 - ldrh r1, [r0, 0x24] - ldrh r2, [r0, 0x20] - adds r1, r2 - mov r3, r12 - adds r3, 0x28 - movs r0, 0 - ldrsb r0, [r3, r0] - adds r0, r1 - lsls r0, 16 - lsrs r6, r0, 16 - mov r0, r12 - ldrh r1, [r0, 0x26] - ldrh r2, [r0, 0x22] - adds r1, r2 - mov r2, r12 - adds r2, 0x29 - movs r0, 0 - ldrsb r0, [r2, r0] - adds r0, r1 - lsls r0, 16 - lsrs r5, r0, 16 - adds r4, r3, 0 -_08097A6A: - ldrb r0, [r4] - lsls r0, 24 - asrs r0, 25 - subs r0, r6, r0 - lsls r0, 16 - lsrs r3, r0, 16 - ldrb r0, [r2] - lsls r0, 24 - asrs r0, 25 - subs r0, r5, r0 - lsls r0, 16 - lsrs r2, r0, 16 - lsls r0, r6, 16 - asrs r0, 16 - cmp r0, 0xFF - bgt _08097A96 - lsls r0, r3, 16 - asrs r0, 16 - movs r1, 0x10 - negs r1, r1 - cmp r0, r1 - bge _08097AA2 -_08097A96: - mov r4, r12 - adds r4, 0x3E - ldrb r0, [r4] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r4] -_08097AA2: - lsls r0, r5, 16 - asrs r0, 16 - cmp r0, 0xAF - bgt _08097AB6 - lsls r0, r2, 16 - asrs r0, 16 - movs r1, 0x10 - negs r1, r1 - cmp r0, r1 - bge _08097AC2 -_08097AB6: - mov r0, r12 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_08097AC2: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80979D4 - - thumb_func_start sub_8097AC8 -sub_8097AC8: @ 8097AC8 - push {r4,lr} - adds r4, r0, 0 - bl sub_8097D68 - ldrh r0, [r4, 0x30] - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - movs r2, 0x1 - bl SetObjectSubpriorityByZCoord - ldrh r1, [r4, 0x32] - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_80979D4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8097AC8 - - thumb_func_start sub_8097AF0 -sub_8097AF0: @ 8097AF0 - push {r4,r5,lr} - movs r5, 0 - movs r4, 0x3F -_08097AF6: - ldr r0, =0x02020630 - adds r2, r5, r0 - adds r0, r2, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08097B16 - ldr r1, [r2, 0x1C] - ldr r0, =sub_8097AC8 - cmp r1, r0 - bne _08097B16 - adds r0, r2, 0 - bl RemoveObjectAndFreeTiles -_08097B16: - adds r5, 0x44 - subs r4, 0x1 - cmp r4, 0 - bge _08097AF6 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8097AF0 - - thumb_func_start sub_8097B2C -sub_8097B2C: @ 8097B2C - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r3, 0 - ldr r6, =0x02020630 - movs r4, 0 -_08097B38: - adds r2, r4, r6 - adds r0, r2, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08097B68 - ldr r1, [r2, 0x1C] - ldr r0, =sub_8097AC8 - cmp r1, r0 - bne _08097B68 - ldrh r0, [r2, 0x2E] - lsls r0, 24 - lsrs r0, 24 - cmp r0, r5 - bne _08097B68 - adds r0, r3, 0 - b _08097B72 - .pool -_08097B68: - adds r4, 0x44 - adds r3, 0x1 - cmp r3, 0x3F - ble _08097B38 - movs r0, 0x40 -_08097B72: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8097B2C - - thumb_func_start sub_8097B78 -sub_8097B78: @ 8097B78 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - bl sub_8097B2C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _08097BAA - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - adds r0, r5, 0 - bl FieldObjectDirectionToImageAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim -_08097BAA: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8097B78 - - thumb_func_start sub_8097BB4 -sub_8097BB4: @ 8097BB4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - bl sub_8097B2C - adds r1, r0, 0 - cmp r1, 0x40 - beq _08097C3E - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r4, r0, r1 - adds r0, r5, 0 - bl GetFieldObjectGraphicsInfo - ldrh r3, [r4, 0x4] - lsls r3, 22 - ldr r1, [r0, 0x10] - ldr r2, [r1, 0x4] - ldr r1, [r1] - str r1, [r4] - str r2, [r4, 0x4] - lsrs r3, 22 - ldrh r2, [r4, 0x4] - ldr r1, =0xfffffc00 - ands r1, r2 - orrs r1, r3 - strh r1, [r4, 0x4] - ldrb r2, [r0, 0xC] - lsls r2, 28 - lsrs r2, 24 - ldrb r3, [r4, 0x5] - movs r1, 0xF - ands r1, r3 - orrs r1, r2 - strb r1, [r4, 0x5] - ldr r1, [r0, 0x1C] - str r1, [r4, 0xC] - ldr r1, [r0, 0x14] - cmp r1, 0 - bne _08097C20 - str r1, [r4, 0x18] - adds r0, r4, 0 - adds r0, 0x42 - strb r1, [r0] - b _08097C36 - .pool -_08097C20: - adds r0, r4, 0 - bl SetSpriteOamTables_NoPriorityFromTable - adds r2, r4, 0 - adds r2, 0x42 - ldrb r0, [r2] - movs r1, 0x3F - ands r1, r0 - movs r0, 0x80 - orrs r1, r0 - strb r1, [r2] -_08097C36: - adds r0, r4, 0 - movs r1, 0 - bl StartObjectImageAnim -_08097C3E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8097BB4 - - thumb_func_start sub_8097C44 -sub_8097C44: @ 8097C44 - push {r4,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - bl sub_8097B2C - lsls r0, 24 - lsrs r2, r0, 24 - adds r3, r2, 0 - cmp r2, 0x40 - beq _08097C80 - cmp r4, 0 - beq _08097C74 - ldr r0, =0x02020630 - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0x32] - b _08097C80 - .pool -_08097C74: - ldr r1, =0x02020630 - lsls r0, r3, 4 - adds r0, r3 - lsls r0, 2 - adds r0, r1 - strh r4, [r0, 0x32] -_08097C80: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8097C44 - - thumb_func_start sub_8097C8C -sub_8097C8C: @ 8097C8C - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl sub_8097B2C - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x40 - bne _08097CA2 - movs r0, 0 - b _08097CBA -_08097CA2: - movs r3, 0 - ldr r0, =0x02020630 - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - movs r2, 0x32 - ldrsh r0, [r1, r2] - cmp r0, 0x1 - bne _08097CB8 - movs r3, 0x1 -_08097CB8: - adds r0, r3, 0 -_08097CBA: - pop {r1} - bx r1 - .pool - thumb_func_end sub_8097C8C - - thumb_func_start sub_8097CC4 -sub_8097CC4: @ 8097CC4 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - bl sub_8097B2C - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x40 - beq _08097CEA - ldr r0, =0x02020630 - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - movs r0, 0 - strh r4, [r1, 0x34] - strh r0, [r1, 0x36] -_08097CEA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8097CC4 - - thumb_func_start sub_8097CF4 -sub_8097CF4: @ 8097CF4 - push {lr} - adds r2, r0, 0 - movs r1, 0x36 - ldrsh r0, [r2, r1] - cmp r0, 0 - beq _08097D06 - cmp r0, 0x1 - beq _08097D0E - b _08097D2C -_08097D06: - strh r0, [r2, 0x26] - ldrh r0, [r2, 0x36] - adds r0, 0x1 - strh r0, [r2, 0x36] -_08097D0E: - ldrh r0, [r2, 0x26] - subs r0, 0x8 - movs r3, 0 - strh r0, [r2, 0x26] - lsls r0, 16 - asrs r0, 16 - movs r1, 0xA0 - negs r1, r1 - cmp r0, r1 - bne _08097D2C - strh r3, [r2, 0x26] - movs r0, 0x1 - strh r0, [r2, 0x32] - strh r3, [r2, 0x34] - strh r3, [r2, 0x36] -_08097D2C: - pop {r0} - bx r0 - thumb_func_end sub_8097CF4 - - thumb_func_start sub_8097D30 -sub_8097D30: @ 8097D30 - push {lr} - adds r1, r0, 0 - movs r2, 0x36 - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _08097D42 - cmp r0, 0x1 - beq _08097D4C - b _08097D5E -_08097D42: - ldr r0, =0x0000ff60 - strh r0, [r1, 0x26] - ldrh r0, [r1, 0x36] - adds r0, 0x1 - strh r0, [r1, 0x36] -_08097D4C: - ldrh r0, [r1, 0x26] - adds r0, 0x8 - strh r0, [r1, 0x26] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bne _08097D5E - strh r0, [r1, 0x34] - strh r0, [r1, 0x36] -_08097D5E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8097D30 - - thumb_func_start sub_8097D68 -sub_8097D68: @ 8097D68 - push {lr} - adds r1, r0, 0 - movs r2, 0x34 - ldrsh r0, [r1, r2] - cmp r0, 0x1 - beq _08097D84 - cmp r0, 0x1 - bgt _08097D7E - cmp r0, 0 - beq _08097D98 - b _08097D94 -_08097D7E: - cmp r0, 0x2 - beq _08097D8C - b _08097D94 -_08097D84: - adds r0, r1, 0 - bl sub_8097D30 - b _08097D98 -_08097D8C: - adds r0, r1, 0 - bl sub_8097CF4 - b _08097D98 -_08097D94: - movs r0, 0 - strh r0, [r1, 0x34] -_08097D98: - pop {r0} - bx r0 - thumb_func_end sub_8097D68 - - thumb_func_start sub_8097D9C -sub_8097D9C: @ 8097D9C - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl sub_8097B2C - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x40 - beq _08097DC0 - ldr r0, =0x02020630 - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - movs r2, 0x34 - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _08097DC8 -_08097DC0: - movs r0, 0 - b _08097DCA - .pool -_08097DC8: - movs r0, 0x1 -_08097DCA: - pop {r1} - bx r1 - thumb_func_end sub_8097D9C - - thumb_func_start oe_exec_and_other_stuff -oe_exec_and_other_stuff: @ 8097DD0 - push {r4,lr} - adds r4, r0, 0 - adds r0, r1, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =0x02038c08 - adds r2, r1, 0x4 - adds r3, r1, 0 - adds r3, 0x8 - bl FieldObjectGetLocalIdAndMap - adds r0, r4, 0 - bl FieldEffectStart - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end oe_exec_and_other_stuff - - thumb_func_start DoShadowFieldEffect -DoShadowFieldEffect: @ 8097DF8 - push {lr} - adds r1, r0, 0 - ldrb r2, [r1, 0x2] - lsls r0, r2, 25 - cmp r0, 0 - blt _08097E10 - movs r0, 0x40 - orrs r0, r2 - strb r0, [r1, 0x2] - movs r0, 0x3 - bl oe_exec_and_other_stuff -_08097E10: - pop {r0} - bx r0 - thumb_func_end DoShadowFieldEffect - - thumb_func_start DoRippleFieldEffect -@ void DoRippleFieldEffect(struct npc_state *fieldObject, struct obj *object) -DoRippleFieldEffect: @ 8097E14 - push {r4,lr} - adds r4, r1, 0 - ldrb r0, [r0, 0x5] - bl GetFieldObjectGraphicsInfo - ldr r2, =0x02038c08 - movs r3, 0x20 - ldrsh r1, [r4, r3] - str r1, [r2] - movs r3, 0x22 - ldrsh r1, [r4, r3] - ldrh r0, [r0, 0xA] - lsls r0, 16 - asrs r0, 17 - adds r1, r0 - subs r1, 0x2 - str r1, [r2, 0x4] - movs r0, 0x97 - str r0, [r2, 0x8] - movs r0, 0x3 - str r0, [r2, 0xC] - movs r0, 0x5 - bl FieldEffectStart - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end DoRippleFieldEffect - - thumb_func_start sub_8097E50 -sub_8097E50: @ 8097E50 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - mov r8, r1 - movs r0, 0 - mov r12, r0 - ldr r0, =0x020375b8 - ldr r1, [r0] - adds r6, r0, 0 - cmp r1, 0 - bne _08097E80 - movs r0, 0x14 - bl AllocZeroed - str r0, [r6] - ldrb r1, [r4, 0x8] - strb r1, [r0] - ldr r1, [r6] - movs r0, 0x1 - strb r0, [r1, 0x10] - b _08097ECC - .pool -_08097E80: - movs r2, 0x10 - movs r5, 0 - movs r1, 0 - adds r3, r6, 0 - b _08097E90 -_08097E8A: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 -_08097E90: - cmp r1, 0xF - bhi _08097EB2 - cmp r2, 0x10 - bne _08097EA4 - ldr r0, [r3] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _08097EA4 - adds r2, r1, 0 -_08097EA4: - ldr r0, [r3] - adds r0, r1 - ldrb r0, [r0] - ldrb r7, [r4, 0x8] - cmp r0, r7 - bne _08097E8A - movs r5, 0x1 -_08097EB2: - cmp r5, 0 - bne _08097ECE - cmp r2, 0x10 - beq _08097ECE - ldr r0, [r6] - adds r0, r2 - ldrb r1, [r4, 0x8] - strb r1, [r0] - ldr r1, [r6] - ldrb r0, [r1, 0x10] - adds r0, 0x1 - strb r0, [r1, 0x10] - movs r0, 0x1 -_08097ECC: - mov r12, r0 -_08097ECE: - mov r1, r12 - cmp r1, 0x1 - bne _08097EE0 - ldrb r0, [r4, 0x1] - movs r1, 0x10 - orrs r0, r1 - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4, 0x1] -_08097EE0: - movs r0, 0x1 - mov r7, r8 - strh r0, [r7, 0x32] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8097E50 - - thumb_func_start sub_8097EF0 -sub_8097EF0: @ 8097EF0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - mov r8, r1 - movs r0, 0x1 - strh r0, [r1, 0x32] - ldr r5, =0x020375b8 - ldr r0, [r5] - cmp r0, 0 - beq _08097F68 - movs r7, 0 - adds r0, r6, 0 - bl sub_8097F78 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x10 - beq _08097F28 - ldr r0, [r5] - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldr r1, [r5] - ldrb r0, [r1, 0x10] - subs r0, 0x1 - strb r0, [r1, 0x10] - movs r7, 0x1 -_08097F28: - ldr r0, [r5] - ldrb r4, [r0, 0x10] - cmp r4, 0 - bne _08097F36 - bl Free - str r4, [r5] -_08097F36: - cmp r7, 0x1 - bne _08097F68 - ldrb r0, [r6, 0x5] - bl GetFieldObjectGraphicsInfo - ldrb r1, [r0, 0xC] - lsls r1, 25 - lsrs r1, 31 - lsls r1, 4 - ldrb r2, [r6, 0x1] - movs r0, 0x11 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - movs r1, 0x3 - negs r1, r1 - ands r0, r1 - strb r0, [r6, 0x1] - mov r2, r8 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_08097F68: - movs r0, 0x1 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8097EF0 - - thumb_func_start sub_8097F78 -@ signed int sub_8097F78(npc_state *a1) -sub_8097F78: @ 8097F78 - push {lr} - movs r2, 0 - ldr r1, =0x020375b8 - ldr r1, [r1] - ldrb r3, [r0, 0x8] -_08097F82: - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, r3 - bne _08097F94 - adds r0, r2, 0 - b _08097FA0 - .pool -_08097F94: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xF - bls _08097F82 - movs r0, 0x10 -_08097FA0: - pop {r1} - bx r1 - thumb_func_end sub_8097F78 - - thumb_func_start sub_8097FA4 -sub_8097FA4: @ 8097FA4 - push {r4-r6,lr} - adds r6, r0, 0 - ldr r0, =sub_8097FE4 - movs r1, 0xFF - bl AddTask - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =0x03005e00 - adds r4, r0 - adds r0, r4, 0 - adds r0, 0x8 - adds r1, r6, 0 - bl sub_806F67C - strb r5, [r6, 0x1B] - ldr r0, =0x0000ffff - strh r0, [r4, 0xE] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8097FA4 - - thumb_func_start sub_8097FE4 -sub_8097FE4: @ 8097FE4 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r4, r1, r0 - adds r0, r4, 0 - adds r0, 0x8 - mov r1, sp - bl sub_806F684 - ldr r0, [sp] - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r2, r0, r1 - ldrh r1, [r4, 0xC] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _08098020 - ldrh r0, [r4, 0xE] - ldrh r1, [r2, 0x26] - adds r0, r1 - strh r0, [r2, 0x26] -_08098020: - ldrh r1, [r4, 0xC] - movs r0, 0xF - ands r0, r1 - cmp r0, 0 - bne _08098030 - ldrh r0, [r4, 0xE] - negs r0, r0 - strh r0, [r4, 0xE] -_08098030: - adds r0, r1, 0x1 - strh r0, [r4, 0xC] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8097FE4 - - thumb_func_start sub_8098044 -sub_8098044: @ 8098044 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r0, r1 - adds r0, 0x8 - mov r1, sp - bl sub_806F684 - adds r0, r4, 0 - bl remove_task - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8098044 - - thumb_func_start sub_8098074 -sub_8098074: @ 8098074 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - movs r4, 0 - ldr r7, =0x02037350 -_08098082: - cmp r4, r6 - beq _080980A8 - cmp r4, r5 - beq _080980A8 - lsls r0, r4, 3 - adds r0, r4 - lsls r0, 2 - adds r1, r0, r7 - ldrb r0, [r1] - lsls r0, 31 - cmp r0, 0 - beq _080980A8 - ldr r0, =0x02037590 - ldrb r0, [r0, 0x5] - cmp r4, r0 - beq _080980A8 - adds r0, r1, 0 - bl sub_8097404 -_080980A8: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _08098082 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8098074 - - thumb_func_start sub_80980C0 -sub_80980C0: @ 80980C0 - movs r0, 0 - strh r0, [r1, 0x26] - ldrh r0, [r1, 0x32] - adds r0, 0x1 - strh r0, [r1, 0x32] - movs r0, 0 - bx lr - thumb_func_end sub_80980C0 - - thumb_func_start sub_80980D0 -sub_80980D0: @ 80980D0 - push {lr} - adds r2, r1, 0 - ldrh r0, [r2, 0x26] - subs r0, 0x8 - strh r0, [r2, 0x26] - lsls r0, 16 - asrs r0, 16 - movs r1, 0xA0 - negs r1, r1 - cmp r0, r1 - bne _080980EC - ldrh r0, [r2, 0x32] - adds r0, 0x1 - strh r0, [r2, 0x32] -_080980EC: - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_80980D0 - - thumb_func_start sub_80980F4 -sub_80980F4: @ 80980F4 - ldr r0, =0x0000ff60 - strh r0, [r1, 0x26] - ldrh r0, [r1, 0x32] - adds r0, 0x1 - strh r0, [r1, 0x32] - movs r0, 0 - bx lr - .pool - thumb_func_end sub_80980F4 - - thumb_func_start sub_8098108 -sub_8098108: @ 8098108 - push {lr} - ldrh r0, [r1, 0x26] - adds r0, 0x8 - strh r0, [r1, 0x26] - lsls r0, 16 - cmp r0, 0 - bne _0809811C - ldrh r0, [r1, 0x32] - adds r0, 0x1 - strh r0, [r1, 0x32] -_0809811C: - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_8098108 - - thumb_func_start sub_8098124 -sub_8098124: @ 8098124 - movs r0, 0x1 - bx lr - thumb_func_end sub_8098124 - - thumb_func_start sub_8098128 -sub_8098128: @ 8098128 - ldr r1, =0x020375bc - movs r0, 0 - strb r0, [r1] - ldr r2, =0x03003014 - ldrb r1, [r2] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - movs r1, 0x3 - negs r1, r1 - ands r0, r1 - subs r1, 0x2 - ands r0, r1 - subs r1, 0x4 - ands r0, r1 - strb r0, [r2] - bx lr - .pool - thumb_func_end sub_8098128 - - thumb_func_start sub_8098154 -sub_8098154: @ 8098154 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _08098188 - cmp r0, 0x1 - bgt _0809817C - cmp r0, 0 - beq _08098182 - b _080981B0 - .pool -_0809817C: - cmp r0, 0x2 - beq _08098198 - b _080981B0 -_08098182: - bl sub_81973A4 - b _08098190 -_08098188: - movs r0, 0 - movs r1, 0x1 - bl sub_81973C4 -_08098190: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080981B0 -_08098198: - bl sub_8197224 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - beq _080981B0 - ldr r1, =0x020375bc - movs r0, 0 - strb r0, [r1] - adds r0, r5, 0 - bl remove_task -_080981B0: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8098154 - - thumb_func_start task_add_textbox -task_add_textbox: @ 80981BC - push {lr} - ldr r0, =sub_8098154 - movs r1, 0x50 - bl AddTask - pop {r0} - bx r0 - .pool - thumb_func_end task_add_textbox - - thumb_func_start task_del_textbox -task_del_textbox: @ 80981D0 - push {lr} - ldr r0, =sub_8098154 - bl get_task_id_by_function - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _080981E4 - bl remove_task -_080981E4: - pop {r0} - bx r0 - .pool - thumb_func_end task_del_textbox - - thumb_func_start box_related_two__2 -box_related_two__2: @ 80981EC - push {r4,lr} - adds r1, r0, 0 - ldr r4, =0x020375bc - ldrb r0, [r4] - cmp r0, 0 - bne _0809820C - adds r0, r1, 0 - movs r1, 0x1 - bl textbox_fdecode_auto_and_task_add - movs r0, 0x2 - strb r0, [r4] - movs r0, 0x1 - b _0809820E - .pool -_0809820C: - movs r0, 0 -_0809820E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end box_related_two__2 - - thumb_func_start sub_8098214 -sub_8098214: @ 8098214 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8196094 - adds r1, r0, 0 - cmp r1, 0 - bne _0809822E - ldr r0, =0x020375bc - strb r1, [r0] - adds r0, r4, 0 - bl remove_task -_0809822E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8098214 - - thumb_func_start sub_8098238 -sub_8098238: @ 8098238 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =0x020375bc - ldrb r0, [r5] - cmp r0, 0 - bne _08098270 - ldr r0, =0x02021fc4 - adds r1, r4, 0 - bl ExpandStringRefs - ldr r0, =sub_8098214 - movs r1, 0 - bl AddTask - adds r0, r4, 0 - bl sub_8196080 - movs r0, 0x2 - strb r0, [r5] - movs r0, 0x1 - b _08098272 - .pool -_08098270: - movs r0, 0 -_08098272: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8098238 - - thumb_func_start box_related_two__3 -box_related_two__3: @ 8098278 - push {lr} - adds r1, r0, 0 - ldr r2, =0x020375bc - ldrb r0, [r2] - cmp r0, 0 - bne _08098298 - movs r0, 0x3 - strb r0, [r2] - adds r0, r1, 0 - movs r1, 0 - bl textbox_fdecode_auto_and_task_add - movs r0, 0x1 - b _0809829A - .pool -_08098298: - movs r0, 0 -_0809829A: - pop {r1} - bx r1 - thumb_func_end box_related_two__3 - - thumb_func_start sub_80982A0 -sub_80982A0: @ 80982A0 - push {lr} - ldr r2, =0x020375bc - movs r1, 0x3 - strb r1, [r2] - movs r1, 0x1 - bl textbox_fdecode_auto_and_task_add - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80982A0 - - thumb_func_start sub_80982B8 -sub_80982B8: @ 80982B8 - push {lr} - ldr r1, =0x020375bc - ldrb r0, [r1] - cmp r0, 0 - bne _080982D4 - movs r0, 0x2 - strb r0, [r1] - bl textbox_auto_and_task_add - movs r0, 0x1 - b _080982D6 - .pool -_080982D4: - movs r0, 0 -_080982D6: - pop {r1} - bx r1 - thumb_func_end sub_80982B8 - - thumb_func_start textbox_fdecode_auto_and_task_add -textbox_fdecode_auto_and_task_add: @ 80982DC - push {r4,lr} - adds r2, r0, 0 - adds r4, r1, 0 - ldr r0, =0x02021fc4 - adds r1, r2, 0 - bl ExpandStringRefs - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl AddTextPrinterForMessage - bl task_add_textbox - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end textbox_fdecode_auto_and_task_add - - thumb_func_start textbox_auto_and_task_add -textbox_auto_and_task_add: @ 8098304 - push {lr} - movs r0, 0x1 - bl AddTextPrinterForMessage - bl task_add_textbox - pop {r0} - bx r0 - thumb_func_end textbox_auto_and_task_add - - thumb_func_start textbox_close -textbox_close: @ 8098314 - push {lr} - bl task_del_textbox - movs r0, 0 - movs r1, 0x1 - bl sub_8197434 - ldr r1, =0x020375bc - movs r0, 0 - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end textbox_close - - thumb_func_start textbox_any_visible -textbox_any_visible: @ 8098330 - ldr r0, =0x020375bc - ldrb r0, [r0] - bx lr - .pool - thumb_func_end textbox_any_visible - - thumb_func_start sub_809833C -sub_809833C: @ 809833C - push {lr} - ldr r0, =0x020375bc - ldrb r0, [r0] - cmp r0, 0 - beq _08098350 - movs r0, 0 - b _08098352 - .pool -_08098350: - movs r0, 0x1 -_08098352: - pop {r1} - bx r1 - thumb_func_end sub_809833C - - thumb_func_start sub_8098358 -sub_8098358: @ 8098358 - push {lr} - bl task_del_textbox - movs r0, 0 - movs r1, 0x1 - bl sub_81973FC - ldr r1, =0x020375bc - movs r0, 0 - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8098358 - - thumb_func_start sub_8098374 -sub_8098374: @ 8098374 - push {lr} - bl task_del_textbox - ldr r1, =0x020375bc - movs r0, 0 - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8098374 - - thumb_func_start walkrun_is_standing_still -walkrun_is_standing_still: @ 8098388 - push {lr} - ldr r0, =0x02037590 - ldrb r0, [r0, 0x3] - cmp r0, 0x1 - beq _0809839C - movs r0, 0x1 - b _0809839E - .pool -_0809839C: - movs r0, 0 -_0809839E: - pop {r1} - bx r1 - thumb_func_end walkrun_is_standing_still - - thumb_func_start sub_80983A4 -sub_80983A4: @ 80983A4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl walkrun_is_standing_still - lsls r0, 24 - cmp r0, 0 - beq _080983BE - bl sub_808B864 - adds r0, r4, 0 - bl remove_task -_080983BE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80983A4 - - thumb_func_start sub_80983C4 -sub_80983C4: @ 80983C4 - push {lr} - ldr r0, =sub_80983A4 - bl is_function_an_active_task - lsls r0, 24 - cmp r0, 0 - bne _080983E0 - bl sub_808BCF4 - movs r0, 0x1 - b _080983E2 - .pool -_080983E0: - movs r0, 0 -_080983E2: - pop {r1} - bx r1 - thumb_func_end sub_80983C4 - - thumb_func_start sub_80983E8 -sub_80983E8: @ 80983E8 - push {lr} - bl player_bitmagic - ldr r0, =sub_80983A4 - movs r1, 0x50 - bl AddTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80983E8 - - thumb_func_start sub_8098400 -sub_8098400: @ 8098400 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r5, r0, r1 - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0809842A - bl walkrun_is_standing_still - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bne _0809842A - bl sub_808B864 - strh r4, [r5, 0x8] -_0809842A: - movs r1, 0xA - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _08098452 - ldr r2, =0x02037350 - ldr r0, =0x03005df0 - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - ldrb r0, [r1] - lsls r0, 30 - cmp r0, 0 - blt _08098452 - adds r0, r1, 0 - bl sub_8097404 - movs r0, 0x1 - strh r0, [r5, 0xA] -_08098452: - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _08098468 - movs r1, 0xA - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _08098468 - adds r0, r6, 0 - bl remove_task -_08098468: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8098400 - - thumb_func_start sub_809847C -sub_809847C: @ 809847C - push {lr} - ldr r0, =sub_8098400 - bl is_function_an_active_task - lsls r0, 24 - cmp r0, 0 - bne _08098498 - bl sub_808BCF4 - movs r0, 0x1 - b _0809849A - .pool -_08098498: - movs r0, 0 -_0809849A: - pop {r1} - bx r1 - thumb_func_end sub_809847C - - thumb_func_start sub_80984A0 -sub_80984A0: @ 80984A0 - push {r4,r5,lr} - ldr r4, =0x03005df0 - ldrb r0, [r4] - bl sub_80974D0 - ldr r0, =sub_8098400 - movs r1, 0x50 - bl AddTask - lsls r0, 24 - lsrs r5, r0, 24 - ldr r2, =0x02037350 - ldrb r1, [r4] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - ldrb r0, [r1] - lsls r0, 30 - cmp r0, 0 - blt _080984DE - adds r0, r1, 0 - bl sub_8097404 - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0xA] -_080984DE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80984A0 - - thumb_func_start sub_80984F4 -sub_80984F4: @ 80984F4 - push {lr} - movs r0, 0xFF - movs r1, 0 - movs r2, 0 - bl GetFieldObjectIdByLocalIdAndMap - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - bl FieldObjectClearAnimIfSpecialAnimFinished - bl sub_80D338C - bl sub_809757C - pop {r0} - bx r0 - .pool - thumb_func_end sub_80984F4 - - thumb_func_start sub_8098524 -sub_8098524: @ 8098524 - push {r4,lr} - ldr r4, =0x02037350 - ldr r0, =0x03005df0 - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r4 - ldrb r0, [r1] - lsls r0, 31 - cmp r0, 0 - beq _08098542 - adds r0, r1, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished -_08098542: - movs r0, 0xFF - movs r1, 0 - movs r2, 0 - bl GetFieldObjectIdByLocalIdAndMap - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl FieldObjectClearAnimIfSpecialAnimFinished - bl sub_80D338C - bl sub_809757C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8098524 - - thumb_func_start sub_8098574 -sub_8098574: @ 8098574 - push {lr} - ldr r0, =0x03005df0 - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - ldr r1, =0x020375f4 - ldrb r1, [r1] - bl FieldObjectFaceOppositeDirection - pop {r0} - bx r0 - .pool - thumb_func_end sub_8098574 - - thumb_func_start sub_809859C -sub_809859C: @ 809859C - push {lr} - ldr r0, =0x03005df0 - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - bl FieldObjectClearAnimIfSpecialAnimActive - pop {r0} - bx r0 - .pool - thumb_func_end sub_809859C - - thumb_func_start sub_80985BC -sub_80985BC: @ 80985BC - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r5, r0, r1 - ldrb r7, [r5, 0xC] - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _080985E8 - bl walkrun_is_standing_still - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bne _080985E8 - bl sub_808B864 - strh r4, [r5, 0x8] -_080985E8: - movs r1, 0xA - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0809860C - ldr r0, =0x02037350 - lsls r1, r7, 3 - adds r1, r7 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 30 - cmp r0, 0 - blt _0809860C - adds r0, r1, 0 - bl sub_8097404 - movs r0, 0x1 - strh r0, [r5, 0xA] -_0809860C: - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _08098622 - movs r1, 0xA - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _08098622 - adds r0, r6, 0 - bl remove_task -_08098622: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80985BC - - thumb_func_start sub_8098630 -sub_8098630: @ 8098630 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r0, 0 - bl sub_80B47E0 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x030060a8 - ldrb r0, [r0] - cmp r0, 0x2 - bne _080986E0 - movs r0, 0x1 - bl sub_80B47E0 - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8098074 - ldr r7, =sub_80985BC - adds r0, r7, 0 - movs r1, 0x50 - bl AddTask - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x03005e00 - mov r9, r0 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - mov r1, r9 - adds r6, r0, r1 - strh r4, [r6, 0xC] - ldr r2, =0x02037350 - mov r8, r2 - lsls r0, r4, 3 - adds r0, r4 - lsls r0, 2 - adds r1, r0, r2 - ldrb r0, [r1] - lsls r0, 30 - cmp r0, 0 - blt _0809869A - adds r0, r1, 0 - bl sub_8097404 - movs r0, 0x1 - strh r0, [r6, 0xA] -_0809869A: - adds r0, r7, 0 - movs r1, 0x51 - bl AddTask - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - mov r1, r9 - adds r4, r0, r1 - strh r5, [r4, 0xC] - lsls r0, r5, 3 - adds r0, r5 - lsls r0, 2 - mov r2, r8 - adds r1, r0, r2 - ldrb r0, [r1] - lsls r0, 30 - cmp r0, 0 - blt _0809871A - adds r0, r1, 0 - bl sub_8097404 - movs r0, 0x1 - strh r0, [r4, 0xA] - b _0809871A - .pool -_080986E0: - adds r0, r4, 0 - bl sub_80974D0 - ldr r0, =sub_80985BC - movs r1, 0x50 - bl AddTask - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r5, r0, r1 - strh r4, [r5, 0xC] - ldr r1, =0x02037350 - lsls r0, r4, 3 - adds r0, r4 - lsls r0, 2 - adds r1, r0, r1 - ldrb r0, [r1] - lsls r0, 30 - cmp r0, 0 - blt _0809871A - adds r0, r1, 0 - bl sub_8097404 - movs r0, 0x1 - strh r0, [r5, 0xA] -_0809871A: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8098630 - - thumb_func_start sub_8098734 -sub_8098734: @ 8098734 - push {lr} - ldr r0, =sub_80985BC - bl is_function_an_active_task - lsls r0, 24 - cmp r0, 0 - bne _08098750 - bl sub_808BCF4 - movs r0, 0x1 - b _08098752 - .pool -_08098750: - movs r0, 0 -_08098752: - pop {r1} - bx r1 - thumb_func_end sub_8098734 - - thumb_func_start sub_8098758 -sub_8098758: @ 8098758 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x13 - bhi _08098770 - lsls r0, 3 - ldr r1, =gUnknown_0851021C - adds r0, r1 - b _08098772 - .pool -_08098770: - ldr r0, =gUnknown_0851021C -_08098772: - pop {r1} - bx r1 - .pool - thumb_func_end sub_8098758 - - thumb_func_start copy_textbox_border_tile_patterns_to_vram -@ void copy_textbox_border_tile_patterns_to_vram(u8 rbox_id, u16 tile_pattern_dest_offset, u8 pal_dest_offset) -copy_textbox_border_tile_patterns_to_vram: @ 809877C - push {r4,r5,lr} - adds r4, r1, 0 - adds r5, r2, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 24 - lsrs r5, 24 - movs r1, 0 - bl GetWindowAttribute - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_08DDD748 - movs r2, 0xE0 - lsls r2, 1 - adds r3, r4, 0 - bl LoadBgTiles - bl sub_8098C64 - adds r1, r5, 0 - movs r2, 0x20 - bl gpu_pal_apply - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end copy_textbox_border_tile_patterns_to_vram - - thumb_func_start box_border_load_tiles_and_pal -box_border_load_tiles_and_pal: @ 80987BC - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 24 - lsrs r2, 24 - bl sub_809882C - pop {r0} - bx r0 - thumb_func_end box_border_load_tiles_and_pal - - thumb_func_start sub_80987D4 -sub_80987D4: @ 80987D4 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r4, r1, 0 - adds r6, r2, 0 - mov r8, r3 - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r6, 16 - lsrs r6, 16 - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - movs r1, 0 - bl GetWindowAttribute - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_0851021C - lsls r4, 3 - adds r1, r4, r5 - ldr r1, [r1] - movs r2, 0x90 - lsls r2, 1 - adds r3, r6, 0 - bl LoadBgTiles - adds r5, 0x4 - adds r4, r5 - ldr r0, [r4] - mov r1, r8 - movs r2, 0x20 - bl gpu_pal_apply - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80987D4 - - thumb_func_start sub_809882C -sub_809882C: @ 809882C - push {r4,lr} - adds r4, r1, 0 - adds r3, r2, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r4, 16 - lsrs r4, 16 - lsls r3, 24 - lsrs r3, 24 - ldr r1, =0x03005d90 - ldr r1, [r1] - ldrb r1, [r1, 0x14] - lsrs r1, 3 - adds r2, r4, 0 - bl sub_80987D4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809882C - - thumb_func_start sub_8098858 -sub_8098858: @ 8098858 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 16 - lsrs r5, 16 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0xC] - adds r0, r4, 0 - movs r1, 0 - bl GetWindowAttribute - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r4, 0 - movs r1, 0x1 - bl GetWindowAttribute - mov r8, r0 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - adds r0, r4, 0 - movs r1, 0x2 - bl GetWindowAttribute - adds r6, r0, 0 - lsls r6, 16 - lsrs r6, 16 - adds r0, r4, 0 - movs r1, 0x3 - bl GetWindowAttribute - mov r9, r0 - mov r2, r9 - lsls r2, 16 - lsrs r2, 16 - mov r9, r2 - adds r0, r4, 0 - movs r1, 0x4 - bl GetWindowAttribute - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x10] - mov r0, r8 - subs r0, 0x1 - lsls r2, r0, 24 - lsrs r2, 24 - str r2, [sp, 0x14] - subs r4, r6, 0x1 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - mov r10, r0 - str r0, [sp] - str r0, [sp, 0x4] - ldr r2, [sp, 0xC] - str r2, [sp, 0x8] - adds r0, r7, 0 - adds r1, r5, 0 - ldr r2, [sp, 0x14] - adds r3, r4, 0 - bl FillBgTilemapBufferRect - adds r1, r5, 0x1 - lsls r1, 16 - lsrs r1, 16 - mov r0, r8 - lsls r2, r0, 24 - lsrs r2, 24 - str r2, [sp, 0x18] - mov r2, r9 - lsls r0, r2, 24 - lsrs r0, 24 - str r0, [sp, 0x1C] - str r0, [sp] - mov r0, r10 - str r0, [sp, 0x4] - ldr r2, [sp, 0xC] - str r2, [sp, 0x8] - adds r0, r7, 0 - ldr r2, [sp, 0x18] - adds r3, r4, 0 - bl FillBgTilemapBufferRect - adds r1, r5, 0x2 - lsls r1, 16 - lsrs r1, 16 - add r8, r9 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - mov r2, r10 - str r2, [sp] - str r2, [sp, 0x4] - ldr r0, [sp, 0xC] - str r0, [sp, 0x8] - adds r0, r7, 0 - mov r2, r8 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - adds r1, r5, 0x3 - lsls r1, 16 - lsrs r1, 16 - lsls r2, r6, 24 - lsrs r2, 24 - mov r9, r2 - mov r0, r10 - str r0, [sp] - ldr r2, [sp, 0x10] - lsls r4, r2, 24 - lsrs r4, 24 - str r4, [sp, 0x4] - ldr r0, [sp, 0xC] - str r0, [sp, 0x8] - adds r0, r7, 0 - ldr r2, [sp, 0x14] - mov r3, r9 - bl FillBgTilemapBufferRect - adds r1, r5, 0x5 - lsls r1, 16 - lsrs r1, 16 - mov r2, r10 - str r2, [sp] - str r4, [sp, 0x4] - ldr r0, [sp, 0xC] - str r0, [sp, 0x8] - adds r0, r7, 0 - mov r2, r8 - mov r3, r9 - bl FillBgTilemapBufferRect - adds r1, r5, 0x6 - lsls r1, 16 - lsrs r1, 16 - ldr r2, [sp, 0x10] - adds r6, r2 - lsls r6, 24 - lsrs r6, 24 - mov r0, r10 - str r0, [sp] - str r0, [sp, 0x4] - ldr r2, [sp, 0xC] - str r2, [sp, 0x8] - adds r0, r7, 0 - ldr r2, [sp, 0x14] - adds r3, r6, 0 - bl FillBgTilemapBufferRect - adds r1, r5, 0x7 - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0x1C] - str r0, [sp] - mov r2, r10 - str r2, [sp, 0x4] - ldr r0, [sp, 0xC] - str r0, [sp, 0x8] - adds r0, r7, 0 - ldr r2, [sp, 0x18] - adds r3, r6, 0 - bl FillBgTilemapBufferRect - adds r5, 0x8 - lsls r5, 16 - lsrs r5, 16 - mov r2, r10 - str r2, [sp] - str r2, [sp, 0x4] - ldr r0, [sp, 0xC] - str r0, [sp, 0x8] - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - adds r3, r6, 0 - bl FillBgTilemapBufferRect - 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_8098858 - - thumb_func_start sub_80989E0 -sub_80989E0: @ 80989E0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - adds r4, r0, 0 - mov r9, r1 - lsls r4, 24 - lsrs r4, 24 - mov r0, r9 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - lsls r2, 24 - lsrs r2, 24 - mov r10, r2 - adds r0, r4, 0 - movs r1, 0 - bl GetWindowAttribute - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r4, 0 - movs r1, 0x1 - bl GetWindowAttribute - mov r8, r0 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - adds r0, r4, 0 - movs r1, 0x2 - bl GetWindowAttribute - adds r6, r0, 0 - lsls r6, 16 - lsrs r6, 16 - adds r0, r4, 0 - movs r1, 0x3 - bl GetWindowAttribute - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - movs r1, 0x4 - bl GetWindowAttribute - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0xC] - mov r0, r8 - lsls r2, r0, 24 - lsrs r2, 24 - str r2, [sp, 0x10] - lsls r4, r6, 24 - lsrs r4, 24 - movs r0, 0x1 - str r0, [sp] - str r0, [sp, 0x4] - mov r0, r10 - str r0, [sp, 0x8] - adds r0, r7, 0 - mov r1, r9 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - mov r1, r9 - adds r1, 0x1 - lsls r1, 16 - lsrs r1, 16 - mov r0, r8 - adds r0, 0x1 - lsls r2, r0, 24 - lsrs r2, 24 - str r2, [sp, 0x14] - subs r0, r5, 0x2 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x18] - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - mov r0, r10 - str r0, [sp, 0x8] - adds r0, r7, 0 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - mov r1, r9 - adds r1, 0x2 - lsls r1, 16 - lsrs r1, 16 - add r8, r5 - movs r0, 0x1 - negs r0, r0 - add r8, r0 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r0, 0x1 - str r0, [sp] - str r0, [sp, 0x4] - mov r0, r10 - str r0, [sp, 0x8] - adds r0, r7, 0 - mov r2, r8 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - mov r1, r9 - adds r1, 0x3 - lsls r1, 16 - lsrs r1, 16 - adds r5, r6, 0x1 - lsls r5, 24 - lsrs r5, 24 - movs r0, 0x1 - str r0, [sp] - ldr r4, [sp, 0xC] - subs r4, 0x2 - lsls r4, 24 - lsrs r4, 24 - str r4, [sp, 0x4] - mov r0, r10 - str r0, [sp, 0x8] - adds r0, r7, 0 - ldr r2, [sp, 0x10] - adds r3, r5, 0 - bl FillBgTilemapBufferRect - mov r1, r9 - adds r1, 0x5 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x1 - str r0, [sp] - str r4, [sp, 0x4] - mov r0, r10 - str r0, [sp, 0x8] - adds r0, r7, 0 - mov r2, r8 - adds r3, r5, 0 - bl FillBgTilemapBufferRect - mov r1, r9 - adds r1, 0x6 - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0xC] - adds r6, r0 - subs r6, 0x1 - lsls r6, 24 - lsrs r6, 24 - movs r0, 0x1 - str r0, [sp] - str r0, [sp, 0x4] - mov r0, r10 - str r0, [sp, 0x8] - adds r0, r7, 0 - ldr r2, [sp, 0x10] - adds r3, r6, 0 - bl FillBgTilemapBufferRect - mov r1, r9 - adds r1, 0x7 - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0x18] - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - mov r0, r10 - str r0, [sp, 0x8] - adds r0, r7, 0 - ldr r2, [sp, 0x14] - adds r3, r6, 0 - bl FillBgTilemapBufferRect - movs r0, 0x8 - add r9, r0 - mov r0, r9 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - movs r0, 0x1 - str r0, [sp] - str r0, [sp, 0x4] - mov r0, r10 - str r0, [sp, 0x8] - adds r0, r7, 0 - mov r1, r9 - mov r2, r8 - adds r3, r6, 0 - bl FillBgTilemapBufferRect - 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_80989E0 - - thumb_func_start rbox_fill_rectangle -rbox_fill_rectangle: @ 8098B7C - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0xC - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - adds r0, r6, 0 - movs r1, 0 - bl GetWindowAttribute - mov r9, r0 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - adds r0, r6, 0 - movs r1, 0x1 - bl GetWindowAttribute - mov r8, r0 - mov r1, r8 - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - adds r0, r6, 0 - movs r1, 0x2 - bl GetWindowAttribute - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r6, 0 - movs r1, 0x3 - bl GetWindowAttribute - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r6, 0 - movs r1, 0x4 - bl GetWindowAttribute - movs r1, 0x1 - negs r1, r1 - add r8, r1 - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - subs r5, 0x1 - lsls r5, 24 - lsrs r5, 24 - adds r4, 0x2 - lsls r4, 24 - lsrs r4, 24 - str r4, [sp] - lsls r0, 24 - movs r1, 0x80 - lsls r1, 18 - adds r0, r1 - lsrs r0, 24 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - mov r0, r9 - movs r1, 0 - mov r2, r8 - adds r3, r5, 0 - bl FillBgTilemapBufferRect - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end rbox_fill_rectangle - - thumb_func_start stdpal_get -stdpal_get: @ 8098C18 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bhi _08098C54 - lsls r0, 2 - ldr r1, =_08098C30 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08098C30: - .4byte _08098C44 - .4byte _08098C48 - .4byte _08098C4C - .4byte _08098C50 - .4byte _08098C54 -_08098C44: - movs r0, 0 - b _08098C56 -_08098C48: - movs r0, 0x10 - b _08098C56 -_08098C4C: - movs r0, 0x20 - b _08098C56 -_08098C50: - movs r0, 0x30 - b _08098C56 -_08098C54: - movs r0, 0x40 -_08098C56: - lsls r0, 1 - ldr r1, =gUnknown_0851017C - adds r0, r1 - pop {r1} - bx r1 - .pool - thumb_func_end stdpal_get - - thumb_func_start sub_8098C64 -sub_8098C64: @ 8098C64 - ldr r0, =gUnknown_08DDD728 - bx lr - .pool - thumb_func_end sub_8098C64 - - thumb_func_start sub_8098C6C -sub_8098C6C: @ 8098C6C - push {r4,r5,lr} - adds r3, r1, 0 - adds r4, r2, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r3, 16 - lsrs r3, 16 - lsls r4, 24 - lsrs r4, 24 - ldr r2, =gUnknown_0851021C - ldr r5, =0x03005d90 - ldr r1, [r5] - ldrb r1, [r1, 0x14] - lsrs r1, 3 - lsls r1, 3 - adds r1, r2 - ldr r1, [r1] - movs r2, 0x90 - lsls r2, 1 - bl LoadBgTiles - ldr r0, [r5] - ldrb r0, [r0, 0x14] - lsrs r0, 3 - bl sub_8098758 - ldr r0, [r0, 0x4] - adds r1, r4, 0 - movs r2, 0x20 - bl gpu_pal_apply - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8098C6C - - thumb_func_start script_env_init -@ void script_env_init(script_env *env, int a2, int a3) -script_env_init: @ 8098CB8 - push {lr} - adds r3, r0, 0 - movs r0, 0 - strb r0, [r3, 0x1] - str r0, [r3, 0x8] - strb r0, [r3] - str r0, [r3, 0x4] - str r1, [r3, 0x5C] - str r2, [r3, 0x60] - movs r2, 0 - movs r1, 0x3 - adds r0, r3, 0 - adds r0, 0x70 -_08098CD2: - str r2, [r0] - subs r0, 0x4 - subs r1, 0x1 - cmp r1, 0 - bge _08098CD2 - adds r1, r3, 0 - adds r1, 0xC - movs r2, 0 - adds r0, r3, 0 - adds r0, 0x58 -_08098CE6: - str r2, [r0] - subs r0, 0x4 - cmp r0, r1 - bge _08098CE6 - pop {r0} - bx r0 - thumb_func_end script_env_init - - thumb_func_start script_setup_bytecode_script -@ int script_setup_bytecode_script(script_env *env, void *script_ptr) -script_setup_bytecode_script: @ 8098CF4 - str r1, [r0, 0x8] - movs r1, 0x1 - strb r1, [r0, 0x1] - movs r0, 0x1 - bx lr - thumb_func_end script_setup_bytecode_script - - thumb_func_start script_setup_asm_script -script_setup_asm_script: @ 8098D00 - movs r2, 0x2 - strb r2, [r0, 0x1] - str r1, [r0, 0x4] - bx lr - thumb_func_end script_setup_asm_script - - thumb_func_start script_stop -@ void script_stop(script_env *env) -script_stop: @ 8098D08 - movs r1, 0 - strb r1, [r0, 0x1] - str r1, [r0, 0x8] - bx lr - thumb_func_end script_stop - - thumb_func_start script_main_handler -@ int script_main_handler(script_env *env) -script_main_handler: @ 8098D10 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4, 0x1] - cmp r0, 0 - bne _08098D1E -_08098D1A: - movs r0, 0 - b _08098D90 -_08098D1E: - ldrb r0, [r4, 0x1] - cmp r0, 0x1 - beq _08098D56 - cmp r0, 0x1 - bgt _08098D2E - cmp r0, 0 - beq _08098D1A - b _08098D8E -_08098D2E: - cmp r0, 0x2 - bne _08098D8E - ldr r0, [r4, 0x4] - cmp r0, 0 - beq _08098D52 - bl _call_via_r0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08098D8E - strb r0, [r4, 0x1] - b _08098D8E -_08098D48: - strb r2, [r4, 0x1] - b _08098D1A -_08098D4C: - movs r0, 0 - strb r0, [r4, 0x1] - b _08098D90 -_08098D52: - movs r0, 0x1 - strb r0, [r4, 0x1] -_08098D56: - ldr r2, [r4, 0x8] - cmp r2, 0 - beq _08098D48 - ldr r0, =gUnknown_085102BC - ldr r0, [r0] - cmp r2, r0 - bne _08098D6C -_08098D64: - swi 0x2 - b _08098D64 - .pool -_08098D6C: - ldrb r1, [r2] - adds r0, r2, 0x1 - str r0, [r4, 0x8] - lsls r1, 2 - ldr r0, [r4, 0x5C] - adds r1, r0, r1 - ldr r0, [r4, 0x60] - cmp r1, r0 - bcs _08098D4C - ldr r1, [r1] - adds r0, r4, 0 - bl _call_via_r1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08098D56 -_08098D8E: - movs r0, 0x1 -_08098D90: - pop {r4} - pop {r1} - bx r1 - thumb_func_end script_main_handler - - thumb_func_start script_stack_push -@ int script_stack_push(script_env *env, int value) -script_stack_push: @ 8098D98 - push {lr} - adds r2, r0, 0 - adds r3, r1, 0 - ldrb r1, [r2] - adds r0, r1, 0x1 - cmp r0, 0x13 - bgt _08098DBA - lsls r0, r1, 2 - adds r1, r2, 0 - adds r1, 0xC - adds r1, r0 - str r3, [r1] - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - movs r0, 0 - b _08098DBC -_08098DBA: - movs r0, 0x1 -_08098DBC: - pop {r1} - bx r1 - thumb_func_end script_stack_push - - thumb_func_start script_stack_pop -@ int script_stack_pop(script_env *env) -script_stack_pop: @ 8098DC0 - push {lr} - adds r2, r0, 0 - ldrb r0, [r2] - cmp r0, 0 - beq _08098DDC - subs r0, 0x1 - strb r0, [r2] - ldrb r1, [r2] - lsls r1, 2 - adds r0, r2, 0 - adds r0, 0xC - adds r0, r1 - ldr r0, [r0] - b _08098DDE -_08098DDC: - movs r0, 0 -_08098DDE: - pop {r1} - bx r1 - thumb_func_end script_stack_pop - - thumb_func_start script_jump -@ void script_jump(script_env *env, int address) -script_jump: @ 8098DE4 - str r1, [r0, 0x8] - bx lr - thumb_func_end script_jump - - thumb_func_start script_call -@ void script_call(script_env *env, int address) -script_call: @ 8098DE8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, [r4, 0x8] - bl script_stack_push - str r5, [r4, 0x8] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end script_call - - thumb_func_start script_return -@ void script_return(script_env *env) -script_return: @ 8098DFC - push {r4,lr} - adds r4, r0, 0 - bl script_stack_pop - str r0, [r4, 0x8] - pop {r4} - pop {r0} - bx r0 - thumb_func_end script_return - - thumb_func_start script_read_halfword -@ int script_read_halfword(script_env *env) -script_read_halfword: @ 8098E0C - adds r3, r0, 0 - ldr r2, [r3, 0x8] - ldrb r0, [r2] - adds r2, 0x1 - str r2, [r3, 0x8] - ldrb r1, [r2] - lsls r1, 8 - orrs r0, r1 - adds r2, 0x1 - str r2, [r3, 0x8] - bx lr - thumb_func_end script_read_halfword - - thumb_func_start script_read_word -@ int script_read_word(script_env *env) -script_read_word: @ 8098E24 - push {r4-r6,lr} - adds r3, r0, 0 - ldr r0, [r3, 0x8] - ldrb r6, [r0] - adds r0, 0x1 - str r0, [r3, 0x8] - ldrb r5, [r0] - adds r2, r0, 0x1 - str r2, [r3, 0x8] - ldrb r4, [r0, 0x1] - adds r1, r2, 0x1 - str r1, [r3, 0x8] - ldrb r0, [r2, 0x1] - adds r1, 0x1 - str r1, [r3, 0x8] - lsls r0, 8 - adds r0, r4 - lsls r0, 8 - adds r0, r5 - lsls r0, 8 - adds r0, r6 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end script_read_word - - thumb_func_start script_env_2_enable -script_env_2_enable: @ 8098E54 - ldr r1, =0x03000f2c - movs r0, 0x1 - strb r0, [r1] - bx lr - .pool - thumb_func_end script_env_2_enable - - thumb_func_start script_env_2_disable -@ void script_env_2_disable() -script_env_2_disable: @ 8098E60 - ldr r1, =0x03000f2c - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end script_env_2_disable - - thumb_func_start script_env_2_is_enabled -@ int script_env_2_is_enabled() -script_env_2_is_enabled: @ 8098E6C - ldr r0, =0x03000f2c - ldrb r0, [r0] - bx lr - .pool - thumb_func_end script_env_2_is_enabled - - thumb_func_start script_env_context_is_running -@ int script_env_context_is_running() -script_env_context_is_running: @ 8098E78 - push {lr} - ldr r0, =0x03000e38 - ldrb r0, [r0] - cmp r0, 0 - beq _08098E8C - movs r0, 0 - b _08098E8E - .pool -_08098E8C: - movs r0, 0x1 -_08098E8E: - pop {r1} - bx r1 - thumb_func_end script_env_context_is_running - - thumb_func_start script_env_1_init -script_env_1_init: @ 8098E94 - push {lr} - ldr r0, =0x03000e40 - ldr r1, =gEventScriptCommandFunctionTable - ldr r2, =gUnknown_081DBA08 - bl script_env_init - ldr r1, =0x03000e38 - movs r0, 0x2 - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end script_env_1_init - - thumb_func_start script_env_2_run_current_script -script_env_2_run_current_script: @ 8098EBC - push {r4,lr} - ldr r4, =0x03000e38 - ldrb r0, [r4] - cmp r0, 0x2 - beq _08098EF0 - cmp r0, 0x1 - beq _08098EF0 - bl script_env_2_enable - ldr r0, =0x03000e40 - bl script_main_handler - lsls r0, 24 - cmp r0, 0 - beq _08098EE8 - movs r0, 0x1 - b _08098EF2 - .pool -_08098EE8: - movs r0, 0x2 - strb r0, [r4] - bl script_env_2_disable -_08098EF0: - movs r0, 0 -_08098EF2: - pop {r4} - pop {r1} - bx r1 - thumb_func_end script_env_2_run_current_script - - thumb_func_start script_env_1_execute_new_script -script_env_1_execute_new_script: @ 8098EF8 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x03000e40 - ldr r1, =gEventScriptCommandFunctionTable - ldr r2, =gUnknown_081DBA08 - adds r0, r4, 0 - bl script_env_init - adds r0, r4, 0 - adds r1, r5, 0 - bl script_setup_bytecode_script - bl script_env_2_enable - ldr r1, =0x03000e38 - movs r0, 0 - strb r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end script_env_1_execute_new_script - - thumb_func_start script_env_2_set_ctx_paused -script_env_2_set_ctx_paused: @ 8098F30 - ldr r1, =0x03000e38 - movs r0, 0x1 - strb r0, [r1] - bx lr - .pool - thumb_func_end script_env_2_set_ctx_paused - - thumb_func_start script_env_2_enable_and_set_ctx_running -script_env_2_enable_and_set_ctx_running: @ 8098F3C - push {lr} - ldr r1, =0x03000e38 - movs r0, 0 - strb r0, [r1] - bl script_env_2_enable - pop {r0} - bx r0 - .pool - thumb_func_end script_env_2_enable_and_set_ctx_running - - thumb_func_start script_env_2_execute_new_script -@ void script_env_2_execute_new_script(void *script_ptr) -script_env_2_execute_new_script: @ 8098F50 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x03000eb8 - ldr r1, =gEventScriptCommandFunctionTable - ldr r2, =gUnknown_081DBA08 - adds r0, r4, 0 - bl script_env_init - adds r0, r4, 0 - adds r1, r5, 0 - bl script_setup_bytecode_script -_08098F68: - ldr r0, =0x03000eb8 - bl script_main_handler - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08098F68 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end script_env_2_execute_new_script - - thumb_func_start mapheader_get_tagged_pointer -mapheader_get_tagged_pointer: @ 8098F88 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - ldr r0, =0x02037318 - ldr r2, [r0, 0x8] - cmp r2, 0 - beq _08098F9C -_08098F96: - ldrb r0, [r2] - cmp r0, 0 - bne _08098FA4 -_08098F9C: - movs r0, 0 - b _08098FC2 - .pool -_08098FA4: - cmp r0, r1 - beq _08098FAC - adds r2, 0x5 - b _08098F96 -_08098FAC: - adds r2, 0x1 - ldrb r0, [r2] - ldrb r1, [r2, 0x1] - lsls r1, 8 - adds r0, r1 - ldrb r1, [r2, 0x2] - lsls r1, 16 - adds r0, r1 - ldrb r1, [r2, 0x3] - lsls r1, 24 - adds r0, r1 -_08098FC2: - pop {r1} - bx r1 - thumb_func_end mapheader_get_tagged_pointer - - thumb_func_start mapheader_run_script_by_tag -mapheader_run_script_by_tag: @ 8098FC8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl mapheader_get_tagged_pointer - cmp r0, 0 - beq _08098FDA - bl script_env_2_execute_new_script -_08098FDA: - pop {r0} - bx r0 - thumb_func_end mapheader_run_script_by_tag - - thumb_func_start mapheader_get_first_match_from_tagged_ptr_list -@ int mapheader_get_first_match_from_tagged_ptr_list(int tag) -mapheader_get_first_match_from_tagged_ptr_list: @ 8098FE0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - bl mapheader_get_tagged_pointer - adds r6, r0, 0 - cmp r6, 0 - beq _08098FFC -_08098FF0: - ldrb r1, [r6] - ldrb r0, [r6, 0x1] - lsls r0, 8 - orrs r1, r0 - cmp r1, 0 - bne _08099000 -_08098FFC: - movs r0, 0 - b _0809903A -_08099000: - adds r6, 0x2 - ldrb r5, [r6] - ldrb r0, [r6, 0x1] - lsls r0, 8 - orrs r5, r0 - adds r6, 0x2 - adds r0, r1, 0 - bl VarGet - adds r4, r0, 0 - adds r0, r5, 0 - bl VarGet - lsls r4, 16 - lsls r0, 16 - cmp r4, r0 - beq _08099026 - adds r6, 0x4 - b _08098FF0 -_08099026: - ldrb r0, [r6] - ldrb r1, [r6, 0x1] - lsls r1, 8 - adds r0, r1 - ldrb r1, [r6, 0x2] - lsls r1, 16 - adds r0, r1 - ldrb r1, [r6, 0x3] - lsls r1, 24 - adds r0, r1 -_0809903A: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end mapheader_get_first_match_from_tagged_ptr_list - - thumb_func_start mapheader_run_script_with_tag_x1 -mapheader_run_script_with_tag_x1: @ 8099040 - push {lr} - movs r0, 0x1 - bl mapheader_run_script_by_tag - pop {r0} - bx r0 - thumb_func_end mapheader_run_script_with_tag_x1 - - thumb_func_start mapheader_run_script_with_tag_x3 -mapheader_run_script_with_tag_x3: @ 809904C - push {lr} - movs r0, 0x3 - bl mapheader_run_script_by_tag - pop {r0} - bx r0 - thumb_func_end mapheader_run_script_with_tag_x3 - - thumb_func_start mapheader_run_script_with_tag_x5 -mapheader_run_script_with_tag_x5: @ 8099058 - push {lr} - movs r0, 0x5 - bl mapheader_run_script_by_tag - pop {r0} - bx r0 - thumb_func_end mapheader_run_script_with_tag_x5 - - thumb_func_start mapheader_run_script_with_tag_x7 -mapheader_run_script_with_tag_x7: @ 8099064 - push {lr} - movs r0, 0x7 - bl mapheader_run_script_by_tag - pop {r0} - bx r0 - thumb_func_end mapheader_run_script_with_tag_x7 - - thumb_func_start mapheader_run_script_with_tag_x6 -mapheader_run_script_with_tag_x6: @ 8099070 - push {lr} - movs r0, 0x6 - bl mapheader_run_script_by_tag - pop {r0} - bx r0 - thumb_func_end mapheader_run_script_with_tag_x6 - - thumb_func_start mapheader_run_first_tag2_script_list_match -@ int mapheader_run_first_tag2_script_list_match() -mapheader_run_first_tag2_script_list_match: @ 809907C - push {lr} - movs r0, 0x2 - bl mapheader_get_first_match_from_tagged_ptr_list - cmp r0, 0 - beq _08099090 - bl script_env_1_execute_new_script - movs r0, 0x1 - b _08099092 -_08099090: - movs r0, 0 -_08099092: - pop {r1} - bx r1 - thumb_func_end mapheader_run_first_tag2_script_list_match - - thumb_func_start mapheader_run_first_tag4_script_list_match -@ void mapheader_run_first_tag4_script_list_match() -mapheader_run_first_tag4_script_list_match: @ 8099098 - push {lr} - movs r0, 0x4 - bl mapheader_get_first_match_from_tagged_ptr_list - cmp r0, 0 - beq _080990A8 - bl script_env_2_execute_new_script -_080990A8: - pop {r0} - bx r0 - thumb_func_end mapheader_run_first_tag4_script_list_match - - thumb_func_start sub_80990AC -sub_80990AC: @ 80990AC - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x0000372c - adds r0, r1 - movs r1, 0xFA - lsls r1, 2 - bl sub_806F928 - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80990AC - - thumb_func_start killram -killram: @ 80990D0 - push {lr} - sub sp, 0x4 - movs r0, 0 - str r0, [sp] - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r0, =0x00003728 - adds r1, r0 - ldr r2, =0x050000fb - mov r0, sp - bl CpuSet - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end killram - - thumb_func_start sub_80990FC -sub_80990FC: @ 80990FC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - str r0, [sp] - ldr r0, [sp, 0x24] - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - lsls r3, 24 - lsrs r7, r3, 24 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x03005d8c - mov r10, r0 - ldr r5, [r0] - ldr r1, =0x0000372c - adds r4, r5, r1 - bl killram - ldr r0, =0x000003e3 - cmp r8, r0 - bhi _08099174 - movs r0, 0x33 - strb r0, [r4] - mov r2, r9 - strb r2, [r4, 0x1] - strb r7, [r4, 0x2] - strb r6, [r4, 0x3] - ldr r1, =0x00003730 - adds r0, r5, r1 - ldr r1, [sp] - mov r2, r8 - bl memcpy - bl sub_80990AC - mov r2, r10 - ldr r1, [r2] - ldr r2, =0x00003728 - adds r1, r2 - str r0, [r1] - movs r0, 0x1 - b _08099176 - .pool -_08099174: - movs r0, 0 -_08099176: - 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_80990FC - - thumb_func_start sub_8099188 -@ u32 sub_8099188(u8 a1, u32 script) -sub_8099188: @ 8099188 - push {r4-r7,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r3, r0, 24 - ldr r6, =0x03005d8c - ldr r5, [r6] - ldr r0, =0x0000372c - adds r2, r5, r0 - ldr r7, =0x020375c0 - movs r0, 0 - str r0, [r7] - ldrb r0, [r2] - cmp r0, 0x33 - bne _080991F0 - ldrb r1, [r2, 0x1] - movs r0, 0x4 - ldrsb r0, [r5, r0] - cmp r1, r0 - bne _080991F0 - ldrb r1, [r2, 0x2] - movs r0, 0x5 - ldrsb r0, [r5, r0] - cmp r1, r0 - bne _080991F0 - ldrb r0, [r2, 0x3] - cmp r0, r3 - bne _080991F0 - bl sub_80990AC - ldr r1, [r6] - ldr r2, =0x00003728 - adds r1, r2 - ldr r1, [r1] - cmp r0, r1 - bne _080991EC - str r4, [r7] - ldr r1, =0x00003730 - adds r0, r5, r1 - b _080991F2 - .pool -_080991EC: - bl killram -_080991F0: - adds r0, r4, 0 -_080991F2: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8099188 - - thumb_func_start sub_80991F8 -sub_80991F8: @ 80991F8 - push {r4,lr} - ldr r4, =0x03005d8c - ldr r0, [r4] - ldr r2, =0x0000372c - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0x33 - bne _0809923C - ldrb r0, [r1, 0x1] - cmp r0, 0xFF - bne _0809923C - ldrb r0, [r1, 0x2] - cmp r0, 0xFF - bne _0809923C - ldrb r0, [r1, 0x3] - cmp r0, 0xFF - bne _0809923C - bl sub_80990AC - ldr r1, [r4] - ldr r2, =0x00003728 - adds r1, r2 - ldr r1, [r1] - cmp r0, r1 - bne _0809923C - movs r0, 0x1 - b _0809923E - .pool -_0809923C: - movs r0, 0 -_0809923E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80991F8 - - thumb_func_start sub_8099244 -sub_8099244: @ 8099244 - push {r4-r6,lr} - ldr r6, =0x03005d8c - ldr r5, [r6] - ldr r0, =0x0000372c - adds r4, r5, r0 - bl sub_801B27C - cmp r0, 0 - beq _08099298 - ldrb r0, [r4] - cmp r0, 0x33 - bne _08099298 - ldrb r0, [r4, 0x1] - cmp r0, 0xFF - bne _08099298 - ldrb r0, [r4, 0x2] - cmp r0, 0xFF - bne _08099298 - ldrb r0, [r4, 0x3] - cmp r0, 0xFF - bne _08099298 - bl sub_80990AC - ldr r1, [r6] - ldr r2, =0x00003728 - adds r1, r2 - ldr r1, [r1] - cmp r0, r1 - bne _08099294 - ldr r1, =0x00003730 - adds r0, r5, r1 - b _0809929A - .pool -_08099294: - bl killram -_08099298: - movs r0, 0 -_0809929A: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8099244 - - thumb_func_start sub_80992A0 -sub_80992A0: @ 80992A0 - push {lr} - sub sp, 0x4 - adds r2, r0, 0 - lsls r1, 16 - lsrs r1, 16 - ldr r0, =0x000003e3 - cmp r1, r0 - bls _080992B2 - adds r1, r0, 0 -_080992B2: - movs r0, 0xFF - str r0, [sp] - adds r0, r2, 0 - movs r2, 0xFF - movs r3, 0xFF - bl sub_80990FC - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80992A0 - - thumb_func_start s00_nop -s00_nop: @ 80992CC - movs r0, 0 - bx lr - thumb_func_end s00_nop - - thumb_func_start s01_nop -s01_nop: @ 80992D0 - movs r0, 0 - bx lr - thumb_func_end s01_nop - - thumb_func_start s02_end -s02_end: @ 80992D4 - push {lr} - bl script_stop - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s02_end - - thumb_func_start s24_execute_ASM_2 -s24_execute_ASM_2: @ 80992E0 - push {r4,lr} - adds r4, r0, 0 - bl script_read_word - adds r1, r0, 0 - adds r0, r4, 0 - bl script_setup_asm_script - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s24_execute_ASM_2 - - thumb_func_start s25_extended_cmd -s25_extended_cmd: @ 80992F8 - push {lr} - bl script_read_halfword - lsls r0, 16 - ldr r1, =gUnknown_081DBA64 - lsrs r0, 14 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end s25_extended_cmd - - thumb_func_start s26_extended_cmd_setvar -s26_extended_cmd_setvar: @ 8099318 - push {r4-r6,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl GetVarPointer - adds r6, r0, 0 - ldr r4, =gUnknown_081DBA64 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 14 - adds r0, r4 - ldr r0, [r0] - bl _call_via_r0 - strh r0, [r6] - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end s26_extended_cmd_setvar - - thumb_func_start s23_execute_ASM -s23_execute_ASM: @ 809934C - push {lr} - bl script_read_word - bl _call_via_r0 - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s23_execute_ASM - - thumb_func_start s27_set_to_waitstate -s27_set_to_waitstate: @ 809935C - push {lr} - bl script_env_2_set_ctx_paused - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end s27_set_to_waitstate - - thumb_func_start s05_goto -s05_goto: @ 8099368 - push {r4,lr} - adds r4, r0, 0 - bl script_read_word - adds r1, r0, 0 - adds r0, r4, 0 - bl script_jump - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s05_goto - - thumb_func_start s03_return -s03_return: @ 8099380 - push {lr} - bl script_return - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s03_return - - thumb_func_start s04_call -s04_call: @ 809938C - push {r4,lr} - adds r4, r0, 0 - bl script_read_word - adds r1, r0, 0 - adds r0, r4, 0 - bl script_call - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s04_call - - thumb_func_start s06_if_jump -@ int s06_if_jump(script_env *env) -s06_if_jump: @ 80993A4 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r4, [r0] - adds r0, 0x1 - str r0, [r5, 0x8] - adds r0, r5, 0 - bl script_read_word - adds r2, r0, 0 - ldr r1, =gUnknown_085102C0 - lsls r0, r4, 1 - adds r0, r4 - ldrb r3, [r5, 0x2] - adds r0, r3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080993D2 - adds r0, r5, 0 - adds r1, r2, 0 - bl script_jump -_080993D2: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end s06_if_jump - - thumb_func_start s07_if_call -s07_if_call: @ 80993E0 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r4, [r0] - adds r0, 0x1 - str r0, [r5, 0x8] - adds r0, r5, 0 - bl script_read_word - adds r2, r0, 0 - ldr r1, =gUnknown_085102C0 - lsls r0, r4, 1 - adds r0, r4 - ldrb r3, [r5, 0x2] - adds r0, r3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _0809940E - adds r0, r5, 0 - adds r1, r2, 0 - bl script_call -_0809940E: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end s07_if_call - - thumb_func_start sB8_set_virtual_address -@ int sB8_set_virtual_address(script_env *env) -sB8_set_virtual_address: @ 809941C - push {r4,lr} - ldr r4, [r0, 0x8] - subs r4, 0x1 - bl script_read_word - ldr r1, =0x020375c4 - subs r0, r4 - str r0, [r1] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sB8_set_virtual_address - - thumb_func_start sB9_virtual_jump -@ int sB9_virtual_jump(script_env *env) -sB9_virtual_jump: @ 8099438 - push {r4,lr} - adds r4, r0, 0 - bl script_read_word - adds r1, r0, 0 - ldr r0, =0x020375c4 - ldr r0, [r0] - subs r1, r0 - adds r0, r4, 0 - bl script_jump - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sB9_virtual_jump - - thumb_func_start sBA_virtual_call -sBA_virtual_call: @ 809945C - push {r4,lr} - adds r4, r0, 0 - bl script_read_word - adds r1, r0, 0 - ldr r0, =0x020375c4 - ldr r0, [r0] - subs r1, r0 - adds r0, r4, 0 - bl script_call - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sBA_virtual_call - - thumb_func_start sBB_virtual_if_jump -sBB_virtual_if_jump: @ 8099480 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r4, [r0] - adds r0, 0x1 - str r0, [r5, 0x8] - adds r0, r5, 0 - bl script_read_word - ldr r1, =0x020375c4 - ldr r1, [r1] - subs r2, r0, r1 - ldr r1, =gUnknown_085102C0 - lsls r0, r4, 1 - adds r0, r4 - ldrb r3, [r5, 0x2] - adds r0, r3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080994B2 - adds r0, r5, 0 - adds r1, r2, 0 - bl script_jump -_080994B2: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sBB_virtual_if_jump - - thumb_func_start sBC_virtual_if_call -sBC_virtual_if_call: @ 80994C4 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r4, [r0] - adds r0, 0x1 - str r0, [r5, 0x8] - adds r0, r5, 0 - bl script_read_word - ldr r1, =0x020375c4 - ldr r1, [r1] - subs r2, r0, r1 - ldr r1, =gUnknown_085102C0 - lsls r0, r4, 1 - adds r0, r4 - ldrb r3, [r5, 0x2] - adds r0, r3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080994F6 - adds r0, r5, 0 - adds r1, r2, 0 - bl script_call -_080994F6: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sBC_virtual_if_call - - thumb_func_start s08_jumpstd -s08_jumpstd: @ 8099508 - push {lr} - adds r2, r0, 0 - ldr r0, [r2, 0x8] - ldrb r1, [r0] - adds r0, 0x1 - str r0, [r2, 0x8] - lsls r1, 2 - ldr r0, =gUnknown_081DC2A0 - adds r1, r0 - ldr r0, =gUnknown_081DC2CC - cmp r1, r0 - bcs _08099528 - ldr r1, [r1] - adds r0, r2, 0 - bl script_jump -_08099528: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end s08_jumpstd - - thumb_func_start s09_callstd -s09_callstd: @ 8099538 - push {lr} - adds r2, r0, 0 - ldr r0, [r2, 0x8] - ldrb r1, [r0] - adds r0, 0x1 - str r0, [r2, 0x8] - lsls r1, 2 - ldr r0, =gUnknown_081DC2A0 - adds r1, r0 - ldr r0, =gUnknown_081DC2CC - cmp r1, r0 - bcs _08099558 - ldr r1, [r1] - adds r0, r2, 0 - bl script_call -_08099558: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end s09_callstd - - thumb_func_start s0A_jumpstd_if -s0A_jumpstd_if: @ 8099568 - push {r4,lr} - adds r3, r0, 0 - ldr r0, [r3, 0x8] - ldrb r2, [r0] - adds r0, 0x1 - str r0, [r3, 0x8] - ldrb r4, [r0] - adds r0, 0x1 - str r0, [r3, 0x8] - ldr r1, =gUnknown_085102C0 - lsls r0, r2, 1 - adds r0, r2 - ldrb r2, [r3, 0x2] - adds r0, r2 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080995A0 - lsls r0, r4, 2 - ldr r1, =gUnknown_081DC2A0 - adds r1, r0, r1 - ldr r0, =gUnknown_081DC2CC - cmp r1, r0 - bcs _080995A0 - ldr r1, [r1] - adds r0, r3, 0 - bl script_jump -_080995A0: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s0A_jumpstd_if - - thumb_func_start s0B_callstd_if -s0B_callstd_if: @ 80995B4 - push {r4,lr} - adds r3, r0, 0 - ldr r0, [r3, 0x8] - ldrb r2, [r0] - adds r0, 0x1 - str r0, [r3, 0x8] - ldrb r4, [r0] - adds r0, 0x1 - str r0, [r3, 0x8] - ldr r1, =gUnknown_085102C0 - lsls r0, r2, 1 - adds r0, r2 - ldrb r2, [r3, 0x2] - adds r0, r2 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080995EC - lsls r0, r4, 2 - ldr r1, =gUnknown_081DC2A0 - adds r1, r0, r1 - ldr r0, =gUnknown_081DC2CC - cmp r1, r0 - bcs _080995EC - ldr r1, [r1] - adds r0, r3, 0 - bl script_call -_080995EC: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s0B_callstd_if - - thumb_func_start s0C_restore_execution_after_sCF -s0C_restore_execution_after_sCF: @ 8099600 - push {lr} - ldr r1, =0x020375c0 - ldr r1, [r1] - bl script_jump - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end s0C_restore_execution_after_sCF - - thumb_func_start s0D_endscript_killram -s0D_endscript_killram: @ 8099614 - push {r4,lr} - adds r4, r0, 0 - bl killram - adds r0, r4, 0 - bl script_stop - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s0D_endscript_killram - - thumb_func_start s0E_set_byte -s0E_set_byte: @ 809962C - push {lr} - ldr r1, [r0, 0x8] - ldrb r2, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - adds r0, r2, 0 - bl sub_81538C4 - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s0E_set_byte - - thumb_func_start s0F_u32_var_to_const -@ int s0F_u32_var_to_const(script_env *env) -s0F_u32_var_to_const: @ 8099644 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r0, [r4, 0x8] - ldrb r5, [r0] - adds r0, 0x1 - str r0, [r4, 0x8] - adds r0, r4, 0 - bl script_read_word - lsls r5, 2 - adds r4, 0x64 - adds r4, r5 - str r0, [r4] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end s0F_u32_var_to_const - - thumb_func_start s12_u32_var_to_ptr -@ int s12_u32_var_to_ptr(script_env *env) -s12_u32_var_to_ptr: @ 8099668 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r0, [r4, 0x8] - ldrb r5, [r0] - adds r0, 0x1 - str r0, [r4, 0x8] - adds r0, r4, 0 - bl script_read_word - lsls r5, 2 - adds r4, 0x64 - adds r4, r5 - ldrb r0, [r0] - str r0, [r4] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end s12_u32_var_to_ptr - - thumb_func_start s11_u8_ptr_to_const -@ int s11_u8_ptr_to_const(script_env *env) -s11_u8_ptr_to_const: @ 809968C - push {r4,lr} - ldr r1, [r0, 0x8] - ldrb r4, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl script_read_word - strb r4, [r0] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s11_u8_ptr_to_const - - thumb_func_start s10_u8_var_to_const -@ int s10_u8_var_to_const(script_env *env) -s10_u8_var_to_const: @ 80996A4 - ldr r1, [r0, 0x8] - ldrb r3, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - lsls r3, 2 - adds r2, r0, 0 - adds r2, 0x64 - adds r2, r3 - ldrb r3, [r1] - str r3, [r2] - adds r1, 0x1 - str r1, [r0, 0x8] - movs r0, 0 - bx lr - thumb_func_end s10_u8_var_to_const - - thumb_func_start s13_u8_var_to_ptr -@ int s13_u8_var_to_ptr(script_env *env) -s13_u8_var_to_ptr: @ 80996C0 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r0, [r4, 0x8] - ldrb r5, [r0] - adds r0, 0x1 - str r0, [r4, 0x8] - adds r0, r4, 0 - bl script_read_word - lsls r5, 2 - adds r4, 0x64 - adds r4, r5 - ldr r1, [r4] - strb r1, [r0] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end s13_u8_var_to_ptr - - thumb_func_start s14_u32_var_to_var -s14_u32_var_to_var: @ 80996E4 - ldr r1, [r0, 0x8] - ldrb r3, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - ldrb r2, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - lsls r3, 2 - adds r0, 0x64 - adds r3, r0, r3 - lsls r2, 2 - adds r0, r2 - ldr r0, [r0] - str r0, [r3] - movs r0, 0 - bx lr - thumb_func_end s14_u32_var_to_var - - thumb_func_start s15_u8_ptr_to_ptr -s15_u8_ptr_to_ptr: @ 8099704 - push {r4,r5,lr} - adds r4, r0, 0 - bl script_read_word - adds r5, r0, 0 - adds r0, r4, 0 - bl script_read_word - ldrb r0, [r0] - strb r0, [r5] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end s15_u8_ptr_to_ptr - - thumb_func_start s16_u16_gvar_to_const -s16_u16_gvar_to_const: @ 8099720 - push {r4,r5,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl GetVarPointer - adds r4, r0, 0 - adds r0, r5, 0 - bl script_read_halfword - strh r0, [r4] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end s16_u16_gvar_to_const - - thumb_func_start s19_u16_gvar_gvar -s19_u16_gvar_gvar: @ 8099744 - push {r4,r5,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl GetVarPointer - adds r5, r0, 0 - adds r0, r4, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl GetVarPointer - ldrh r0, [r0] - strh r0, [r5] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end s19_u16_gvar_gvar - - thumb_func_start s1A_u16_gvar_gvar -s1A_u16_gvar_gvar: @ 8099770 - push {r4,r5,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl GetVarPointer - adds r5, r0, 0 - adds r0, r4, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - strh r0, [r5] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end s1A_u16_gvar_gvar - - thumb_func_start compare_012 -compare_012: @ 809979C - push {lr} - lsls r0, 16 - lsrs r0, 16 - lsls r1, 16 - lsrs r1, 16 - cmp r0, r1 - bcs _080997AE - movs r0, 0 - b _080997B8 -_080997AE: - cmp r0, r1 - beq _080997B6 - movs r0, 0x2 - b _080997B8 -_080997B6: - movs r0, 0x1 -_080997B8: - pop {r1} - bx r1 - thumb_func_end compare_012 - - thumb_func_start s1B_cmp_u8_var_var -s1B_cmp_u8_var_var: @ 80997BC - push {r4,lr} - adds r4, r0, 0 - ldr r2, [r4, 0x8] - ldrb r0, [r2] - lsls r0, 2 - adds r3, r4, 0 - adds r3, 0x64 - adds r0, r3, r0 - ldrb r0, [r0] - adds r2, 0x1 - str r2, [r4, 0x8] - ldrb r1, [r2] - lsls r1, 2 - adds r3, r1 - ldrb r1, [r3] - adds r2, 0x1 - str r2, [r4, 0x8] - bl compare_012 - strb r0, [r4, 0x2] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s1B_cmp_u8_var_var - - thumb_func_start s1C_cmp_u8_var_const -s1C_cmp_u8_var_const: @ 80997EC - push {r4,lr} - adds r4, r0, 0 - ldr r2, [r4, 0x8] - ldrb r1, [r2] - lsls r1, 2 - adds r0, 0x64 - adds r0, r1 - ldrb r0, [r0] - adds r2, 0x1 - str r2, [r4, 0x8] - ldrb r1, [r2] - adds r2, 0x1 - str r2, [r4, 0x8] - bl compare_012 - strb r0, [r4, 0x2] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s1C_cmp_u8_var_const - - thumb_func_start s1D_cmp_u8_var_ptr -s1D_cmp_u8_var_ptr: @ 8099814 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r2, [r4, 0x8] - ldrb r1, [r2] - lsls r1, 2 - adds r0, 0x64 - adds r0, r1 - ldrb r5, [r0] - adds r2, 0x1 - str r2, [r4, 0x8] - adds r0, r4, 0 - bl script_read_word - ldrb r1, [r0] - adds r0, r5, 0 - bl compare_012 - strb r0, [r4, 0x2] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end s1D_cmp_u8_var_ptr - - thumb_func_start s1E_cmp_u8_ptr_var -s1E_cmp_u8_ptr_var: @ 8099840 - push {r4,lr} - adds r4, r0, 0 - bl script_read_word - ldrb r0, [r0] - ldr r3, [r4, 0x8] - ldrb r2, [r3] - lsls r2, 2 - adds r1, r4, 0 - adds r1, 0x64 - adds r1, r2 - ldrb r1, [r1] - adds r3, 0x1 - str r3, [r4, 0x8] - bl compare_012 - strb r0, [r4, 0x2] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s1E_cmp_u8_ptr_var - - thumb_func_start s1F_cmp_u8_ptr_const -s1F_cmp_u8_ptr_const: @ 809986C - push {r4,lr} - adds r4, r0, 0 - bl script_read_word - ldrb r0, [r0] - ldr r2, [r4, 0x8] - ldrb r1, [r2] - adds r2, 0x1 - str r2, [r4, 0x8] - bl compare_012 - strb r0, [r4, 0x2] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s1F_cmp_u8_ptr_const - - thumb_func_start s20_cmp_u8_ptr_ptr -s20_cmp_u8_ptr_ptr: @ 809988C - push {r4,r5,lr} - adds r4, r0, 0 - bl script_read_word - ldrb r5, [r0] - adds r0, r4, 0 - bl script_read_word - ldrb r1, [r0] - adds r0, r5, 0 - bl compare_012 - strb r0, [r4, 0x2] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end s20_cmp_u8_ptr_ptr - - thumb_func_start s21_cmp_u16_gvar_const -s21_cmp_u16_gvar_const: @ 80998B0 - push {r4,r5,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl GetVarPointer - ldrh r5, [r0] - adds r0, r4, 0 - bl script_read_halfword - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r5, 0 - bl compare_012 - strb r0, [r4, 0x2] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end s21_cmp_u16_gvar_const - - thumb_func_start s22_cmp_u16_gvar_gvar -s22_cmp_u16_gvar_gvar: @ 80998E0 - push {r4,r5,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl GetVarPointer - adds r5, r0, 0 - adds r0, r4, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl GetVarPointer - ldrh r2, [r5] - ldrh r1, [r0] - adds r0, r2, 0 - bl compare_012 - strb r0, [r4, 0x2] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end s22_cmp_u16_gvar_gvar - - thumb_func_start s17_u16_gvar_add_const -s17_u16_gvar_add_const: @ 8099914 - push {r4,r5,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl GetVarPointer - adds r4, r0, 0 - adds r0, r5, 0 - bl script_read_halfword - ldrh r1, [r4] - adds r0, r1 - strh r0, [r4] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end s17_u16_gvar_add_const - - thumb_func_start sub_809993C -sub_809993C: @ 809993C - push {r4,r5,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl GetVarPointer - adds r5, r0, 0 - adds r0, r4, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldrh r1, [r5] - subs r1, r0 - strh r1, [r5] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_809993C - - thumb_func_start s8F_get_random_val -s8F_get_random_val: @ 809996C - push {r4,r5,lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r5, =0x020375f0 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0 - bl __umodsi3 - strh r0, [r5] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end s8F_get_random_val - - thumb_func_start sub_80999A0 -sub_80999A0: @ 80999A0 - push {r4,r5,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r1, r0, 0 - ldr r5, =0x020375f0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl bag_add_item - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80999A0 - - thumb_func_start sub_80999E4 -sub_80999E4: @ 80999E4 - push {r4,r5,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r1, r0, 0 - ldr r5, =0x020375f0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl remove_item - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80999E4 - - thumb_func_start sub_8099A28 -sub_8099A28: @ 8099A28 - push {r4,r5,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r1, r0, 0 - ldr r5, =0x020375f0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_80D6800 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8099A28 - - thumb_func_start sub_8099A6C -sub_8099A6C: @ 8099A6C - push {r4,r5,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r1, r0, 0 - ldr r5, =0x020375f0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_80D6724 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8099A6C - - thumb_func_start s48_get_item_type -s48_get_item_type: @ 8099AB0 - push {r4,lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - ldr r4, =0x020375f0 - bl sub_80D6C68 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s48_get_item_type - - thumb_func_start sub_8099ADC -sub_8099ADC: @ 8099ADC - push {r4,r5,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - ldr r5, =0x020375f0 - adds r0, r4, 0 - bl sub_80D6D70 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8099ADC - - thumb_func_start sub_8099B20 -sub_8099B20: @ 8099B20 - push {r4,r5,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - ldr r5, =0x020375f0 - adds r0, r4, 0 - bl sub_80D6D1C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8099B20 - - thumb_func_start sub_8099B64 -sub_8099B64: @ 8099B64 - push {r4,lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldr r4, =0x020375f0 - lsls r0, 24 - lsrs r0, 24 - bl IsThereStorageSpaceForDecoration - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8099B64 - - thumb_func_start sub_8099B90 -sub_8099B90: @ 8099B90 - push {r4,lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldr r4, =0x020375f0 - lsls r0, 24 - lsrs r0, 24 - bl sub_81619DC - lsls r0, 24 - asrs r0, 24 - strh r0, [r4] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8099B90 - - thumb_func_start sub_8099BBC -sub_8099BBC: @ 8099BBC - push {r4,lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldr r4, =0x020375f0 - lsls r0, 24 - lsrs r0, 24 - bl sub_81619A8 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8099BBC - - thumb_func_start sub_8099BE8 -sub_8099BE8: @ 8099BE8 - push {r4,lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldr r4, =0x020375f0 - lsls r0, 24 - lsrs r0, 24 - bl sub_8161918 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8099BE8 - - thumb_func_start s29_flag_set -@ int s29_flag_set(script_env *env) -s29_flag_set: @ 8099C14 - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl FlagSet - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s29_flag_set - - thumb_func_start s2A_flag_clear -@ int s2A_flag_clear(script_env *env) -s2A_flag_clear: @ 8099C28 - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl FlagReset - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s2A_flag_clear - - thumb_func_start s2B_flag_check -@ int s2B_flag_check(script_env *env) -s2B_flag_check: @ 8099C3C - push {r4,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl FlagGet - strb r0, [r4, 0x2] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s2B_flag_check - - thumb_func_start sC3_unknown -@ int sC3_unknown(script_env *env) -sC3_unknown: @ 8099C58 - push {lr} - ldr r1, [r0, 0x8] - ldrb r2, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - adds r0, r2, 0 - bl sav12_xor_increment - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sC3_unknown - - thumb_func_start s9A_unknown -@ int s9A_unknown(script_env *env) -s9A_unknown: @ 8099C70 - push {lr} - ldr r1, [r0, 0x8] - ldrb r2, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - adds r0, r2, 0 - bl sub_80B009C - bl script_env_2_set_ctx_paused - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end s9A_unknown - - thumb_func_start s99_unknown -@ int s99_unknown(script_env *env) -s99_unknown: @ 8099C8C - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - bl sub_80854EC - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s99_unknown - - thumb_func_start sub_8099CA8 -sub_8099CA8: @ 8099CA8 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08099CC0 - movs r0, 0 - b _08099CC2 - .pool -_08099CC0: - movs r0, 0x1 -_08099CC2: - pop {r1} - bx r1 - thumb_func_end sub_8099CA8 - - thumb_func_start s97_screen_special_effect -@ int s97_screen_special_effect(script_env *env) -s97_screen_special_effect: @ 8099CC8 - push {r4,lr} - adds r4, r0, 0 - ldr r1, [r4, 0x8] - ldrb r0, [r1] - adds r1, 0x1 - str r1, [r4, 0x8] - movs r1, 0 - bl fade_screen - ldr r1, =sub_8099CA8 - adds r0, r4, 0 - bl script_setup_asm_script - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s97_screen_special_effect - - thumb_func_start s98_refade_with_timer -@ int s98_refade_with_timer(script_env *env) -s98_refade_with_timer: @ 8099CF0 - push {r4,lr} - adds r4, r0, 0 - ldr r2, [r4, 0x8] - ldrb r0, [r2] - adds r2, 0x1 - str r2, [r4, 0x8] - ldrb r1, [r2] - adds r2, 0x1 - str r2, [r4, 0x8] - lsls r1, 24 - asrs r1, 24 - bl fade_screen - ldr r1, =sub_8099CA8 - adds r0, r4, 0 - bl script_setup_asm_script - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s98_refade_with_timer - - thumb_func_start sub_8099D20 -@ int sub_8099D20(script_env *env) -sub_8099D20: @ 8099D20 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r4, [r0] - adds r0, 0x1 - str r0, [r5, 0x8] - cmp r4, 0x1 - beq _08099D3E - cmp r4, 0x1 - bgt _08099D3A - cmp r4, 0 - beq _08099D60 - b _08099D3E -_08099D3A: - cmp r4, 0x2 - beq _08099D60 -_08099D3E: - ldr r0, =0x02037714 - ldr r1, =0x02037fe8 - ldr r2, =0x04000100 - bl CpuSet - adds r0, r4, 0 - movs r1, 0 - bl fade_screen - b _08099D72 - .pool -_08099D60: - ldr r0, =0x02037fe8 - ldr r1, =0x02037714 - ldr r2, =0x04000100 - bl CpuSet - adds r0, r4, 0 - movs r1, 0 - bl fade_screen -_08099D72: - ldr r1, =sub_8099CA8 - adds r0, r5, 0 - bl script_setup_asm_script - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8099D20 - - thumb_func_start s28_pause_asm -s28_pause_asm: @ 8099D94 - push {lr} - ldr r1, =0x020375c8 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - lsls r0, 16 - cmp r0, 0 - beq _08099DAC - movs r0, 0 - b _08099DAE - .pool -_08099DAC: - movs r0, 0x1 -_08099DAE: - pop {r1} - bx r1 - thumb_func_end s28_pause_asm - - thumb_func_start s28_pause -@ int s28_pause(script_env *env) -s28_pause: @ 8099DB4 - push {r4,lr} - adds r4, r0, 0 - bl script_read_halfword - ldr r1, =0x020375c8 - strh r0, [r1] - ldr r1, =s28_pause_asm - adds r0, r4, 0 - bl script_setup_asm_script - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s28_pause - - thumb_func_start s2C_unknown -@ int s2C_unknown(script_env *env) -s2C_unknown: @ 8099DD8 - push {r4,r5,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl GameFreakRTC_CalcRTCToLocalDelta_DayZero - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end s2C_unknown - - thumb_func_start s2D_unknown -@ int s2D_unknown(script_env *env) -s2D_unknown: @ 8099E10 - push {lr} - bl sub_809E7B0 - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s2D_unknown - - thumb_func_start s2E_unknown -@ int s2E_unknown(script_env *env) -s2E_unknown: @ 8099E1C - push {lr} - bl GameFreakRTC_CalcLocalDateTime - ldr r2, =0x020375d8 - ldr r1, =0x03005cf8 - movs r0, 0x2 - ldrsb r0, [r1, r0] - strh r0, [r2] - ldr r2, =0x020375da - movs r0, 0x3 - ldrsb r0, [r1, r0] - strh r0, [r2] - ldr r2, =0x020375dc - movs r0, 0x4 - ldrsb r0, [r1, r0] - strh r0, [r2] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end s2E_unknown - - thumb_func_start sA4_set_weather_data -@ int sA4_set_weather_data(script_env *env) -sA4_set_weather_data: @ 8099E54 - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - bl sub_80AED7C - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sA4_set_weather_data - - thumb_func_start sA3_set_standard_weather_data -@ int sA3_set_standard_weather_data(script_env *env) -sA3_set_standard_weather_data: @ 8099E70 - push {lr} - bl sub_80AEDBC - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sA3_set_standard_weather_data - - thumb_func_start sub_8099E7C -@ int sub_8099E7C(script_env *env) -sub_8099E7C: @ 8099E7C - push {lr} - bl sub_80AEE20 - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_8099E7C - - thumb_func_start sA6_activate_per_step_callback_eg_ash -@ int sA6_activate_per_step_callback_eg_ash(script_env *env) -sA6_activate_per_step_callback_eg_ash: @ 8099E88 - push {lr} - ldr r1, [r0, 0x8] - ldrb r2, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - adds r0, r2, 0 - bl activate_per_step_callback - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sA6_activate_per_step_callback_eg_ash - - thumb_func_start sA7_set_new_map_footer -@ int sA7_set_new_map_footer(script_env *env) -sA7_set_new_map_footer: @ 8099EA0 - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - bl sub_8085524 - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sA7_set_new_map_footer - - thumb_func_start s39_warp_sfx -@ int s39_warp_sfx(script_env *env) -s39_warp_sfx: @ 8099EBC - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r1, [r0] - mov r9, r1 - adds r0, 0x1 - str r0, [r5, 0x8] - ldrb r1, [r0] - mov r8, r1 - adds r1, r0, 0x1 - str r1, [r5, 0x8] - ldrb r6, [r0, 0x1] - adds r1, 0x1 - str r1, [r5, 0x8] - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - mov r1, r9 - lsls r1, 24 - asrs r1, 24 - mov r9, r1 - mov r1, r8 - lsls r1, 24 - asrs r1, 24 - mov r8, r1 - lsls r6, 24 - asrs r6, 24 - lsls r4, 24 - asrs r4, 24 - lsls r0, 24 - asrs r0, 24 - str r0, [sp] - mov r0, r9 - adds r2, r6, 0 - adds r3, r4, 0 - bl warp1_set - bl sub_80AF734 - bl player_avatar_init_params_reset - movs r0, 0x1 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end s39_warp_sfx - - thumb_func_start s3A_warp_new_music -@ int s3A_warp_new_music(script_env *env) -s3A_warp_new_music: @ 8099F44 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r1, [r0] - mov r9, r1 - adds r0, 0x1 - str r0, [r5, 0x8] - ldrb r1, [r0] - mov r8, r1 - adds r1, r0, 0x1 - str r1, [r5, 0x8] - ldrb r6, [r0, 0x1] - adds r1, 0x1 - str r1, [r5, 0x8] - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - mov r1, r9 - lsls r1, 24 - asrs r1, 24 - mov r9, r1 - mov r1, r8 - lsls r1, 24 - asrs r1, 24 - mov r8, r1 - lsls r6, 24 - asrs r6, 24 - lsls r4, 24 - asrs r4, 24 - lsls r0, 24 - asrs r0, 24 - str r0, [sp] - mov r0, r9 - adds r2, r6, 0 - adds r3, r4, 0 - bl warp1_set - bl sp13E_warp_to_last_warp - bl player_avatar_init_params_reset - movs r0, 0x1 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end s3A_warp_new_music - - thumb_func_start s3B_warp_keep_music -@ int s3B_warp_keep_music(script_env *env) -s3B_warp_keep_music: @ 8099FCC - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r1, [r0] - mov r9, r1 - adds r0, 0x1 - str r0, [r5, 0x8] - ldrb r1, [r0] - mov r8, r1 - adds r1, r0, 0x1 - str r1, [r5, 0x8] - ldrb r6, [r0, 0x1] - adds r1, 0x1 - str r1, [r5, 0x8] - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - mov r1, r9 - lsls r1, 24 - asrs r1, 24 - mov r9, r1 - mov r1, r8 - lsls r1, 24 - asrs r1, 24 - mov r8, r1 - lsls r6, 24 - asrs r6, 24 - lsls r4, 24 - asrs r4, 24 - lsls r0, 24 - asrs r0, 24 - str r0, [sp] - mov r0, r9 - adds r2, r6, 0 - adds r3, r4, 0 - bl warp1_set - bl sub_80AF7D0 - bl player_avatar_init_params_reset - movs r0, 0x1 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end s3B_warp_keep_music - - thumb_func_start sub_809A054 -sub_809A054: @ 809A054 - push {r4-r6,lr} - sub sp, 0x8 - ldr r1, [r0, 0x8] - ldrb r6, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - ldrb r5, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - mov r4, sp - adds r4, 0x6 - add r0, sp, 0x4 - adds r1, r4, 0 - bl PlayerGetDestCoords - cmp r6, 0xFF - bne _0809A092 - cmp r5, 0xFF - bne _0809A092 - add r0, sp, 0x4 - ldrh r0, [r0] - subs r0, 0x7 - lsls r0, 16 - asrs r0, 16 - ldrh r1, [r4] - subs r1, 0x7 - lsls r1, 16 - asrs r1, 16 - bl sub_8084EBC - b _0809A0B6 -_0809A092: - lsls r0, r6, 24 - asrs r0, 24 - lsls r1, r5, 24 - asrs r1, 24 - movs r2, 0x1 - negs r2, r2 - add r3, sp, 0x4 - ldrb r3, [r3] - subs r3, 0x7 - lsls r3, 24 - asrs r3, 24 - ldrb r4, [r4] - subs r4, 0x7 - lsls r4, 24 - asrs r4, 24 - str r4, [sp] - bl warp1_set -_0809A0B6: - bl sp13F_fall_to_last_warp - bl player_avatar_init_params_reset - movs r0, 0x1 - add sp, 0x8 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_809A054 - - thumb_func_start s3D_warp_v4 -s3D_warp_v4: @ 809A0C8 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r1, [r0] - mov r9, r1 - adds r0, 0x1 - str r0, [r5, 0x8] - ldrb r1, [r0] - mov r8, r1 - adds r1, r0, 0x1 - str r1, [r5, 0x8] - ldrb r6, [r0, 0x1] - adds r1, 0x1 - str r1, [r5, 0x8] - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - mov r1, r9 - lsls r1, 24 - asrs r1, 24 - mov r9, r1 - mov r1, r8 - lsls r1, 24 - asrs r1, 24 - mov r8, r1 - lsls r6, 24 - asrs r6, 24 - lsls r4, 24 - asrs r4, 24 - lsls r0, 24 - asrs r0, 24 - str r0, [sp] - mov r0, r9 - adds r2, r6, 0 - adds r3, r4, 0 - bl warp1_set - bl sub_80AF848 - bl player_avatar_init_params_reset - movs r0, 0x1 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end s3D_warp_v4 - - thumb_func_start sub_809A150 -sub_809A150: @ 809A150 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r1, [r0] - mov r9, r1 - adds r0, 0x1 - str r0, [r5, 0x8] - ldrb r1, [r0] - mov r8, r1 - adds r1, r0, 0x1 - str r1, [r5, 0x8] - ldrb r6, [r0, 0x1] - adds r1, 0x1 - str r1, [r5, 0x8] - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - mov r1, r9 - lsls r1, 24 - asrs r1, 24 - mov r9, r1 - mov r1, r8 - lsls r1, 24 - asrs r1, 24 - mov r8, r1 - lsls r6, 24 - asrs r6, 24 - lsls r4, 24 - asrs r4, 24 - lsls r0, 24 - asrs r0, 24 - str r0, [sp] - mov r0, r9 - adds r2, r6, 0 - adds r3, r4, 0 - bl warp1_set - bl sub_80AF87C - bl player_avatar_init_params_reset - movs r0, 0x1 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_809A150 - - thumb_func_start s3E_set_new_map -s3E_set_new_map: @ 809A1D8 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r1, [r0] - mov r9, r1 - adds r0, 0x1 - str r0, [r5, 0x8] - ldrb r1, [r0] - mov r8, r1 - adds r1, r0, 0x1 - str r1, [r5, 0x8] - ldrb r6, [r0, 0x1] - adds r1, 0x1 - str r1, [r5, 0x8] - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - mov r1, r9 - lsls r1, 24 - asrs r1, 24 - mov r9, r1 - mov r1, r8 - lsls r1, 24 - asrs r1, 24 - mov r8, r1 - lsls r6, 24 - asrs r6, 24 - lsls r4, 24 - asrs r4, 24 - lsls r0, 24 - asrs r0, 24 - str r0, [sp] - mov r0, r9 - adds r2, r6, 0 - adds r3, r4, 0 - bl warp1_set - movs r0, 0 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end s3E_set_new_map - - thumb_func_start s3F_set_new_map_DMA -s3F_set_new_map_DMA: @ 809A258 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x8 - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r1, [r0] - mov r9, r1 - adds r0, 0x1 - str r0, [r5, 0x8] - ldrb r1, [r0] - mov r8, r1 - adds r1, r0, 0x1 - str r1, [r5, 0x8] - ldrb r6, [r0, 0x1] - adds r1, 0x1 - str r1, [r5, 0x8] - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - mov r1, r9 - lsls r1, 24 - asrs r1, 24 - mov r9, r1 - mov r1, r8 - lsls r1, 24 - asrs r1, 24 - mov r8, r1 - lsls r6, 24 - asrs r6, 24 - lsls r4, 24 - asrs r4, 24 - str r4, [sp] - lsls r0, 24 - asrs r0, 24 - str r0, [sp, 0x4] - movs r0, 0 - mov r1, r9 - mov r2, r8 - adds r3, r6, 0 - bl saved_warp2_set_2 - movs r0, 0 - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end s3F_set_new_map_DMA - - thumb_func_start sub_809A2DC -sub_809A2DC: @ 809A2DC - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r1, [r0] - mov r9, r1 - adds r0, 0x1 - str r0, [r5, 0x8] - ldrb r1, [r0] - mov r8, r1 - adds r1, r0, 0x1 - str r1, [r5, 0x8] - ldrb r6, [r0, 0x1] - adds r1, 0x1 - str r1, [r5, 0x8] - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - mov r1, r9 - lsls r1, 24 - asrs r1, 24 - mov r9, r1 - mov r1, r8 - lsls r1, 24 - asrs r1, 24 - mov r8, r1 - lsls r6, 24 - asrs r6, 24 - lsls r4, 24 - asrs r4, 24 - lsls r0, 24 - asrs r0, 24 - str r0, [sp] - mov r0, r9 - adds r2, r6, 0 - adds r3, r4, 0 - bl sub_8084E2C - movs r0, 0 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_809A2DC - - thumb_func_start sub_809A35C -sub_809A35C: @ 809A35C - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r1, [r0] - mov r9, r1 - adds r0, 0x1 - str r0, [r5, 0x8] - ldrb r1, [r0] - mov r8, r1 - adds r1, r0, 0x1 - str r1, [r5, 0x8] - ldrb r6, [r0, 0x1] - adds r1, 0x1 - str r1, [r5, 0x8] - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - mov r1, r9 - lsls r1, 24 - asrs r1, 24 - mov r9, r1 - mov r1, r8 - lsls r1, 24 - asrs r1, 24 - mov r8, r1 - lsls r6, 24 - asrs r6, 24 - lsls r4, 24 - asrs r4, 24 - lsls r0, 24 - asrs r0, 24 - str r0, [sp] - mov r0, r9 - adds r2, r6, 0 - adds r3, r4, 0 - bl sub_8084E80 - movs r0, 0 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_809A35C - - thumb_func_start sC4_unknown -sC4_unknown: @ 809A3DC - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r1, [r0] - mov r9, r1 - adds r0, 0x1 - str r0, [r5, 0x8] - ldrb r1, [r0] - mov r8, r1 - adds r1, r0, 0x1 - str r1, [r5, 0x8] - ldrb r6, [r0, 0x1] - adds r1, 0x1 - str r1, [r5, 0x8] - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - mov r1, r9 - lsls r1, 24 - asrs r1, 24 - mov r9, r1 - mov r1, r8 - lsls r1, 24 - asrs r1, 24 - mov r8, r1 - lsls r6, 24 - asrs r6, 24 - lsls r4, 24 - asrs r4, 24 - lsls r0, 24 - asrs r0, 24 - str r0, [sp] - mov r0, r9 - adds r2, r6, 0 - adds r3, r4, 0 - bl sub_8084DD4 - movs r0, 0 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sC4_unknown - - thumb_func_start s42_get_map_camera_pos -@ int s42_get_map_camera_pos(script_env *env) -s42_get_map_camera_pos: @ 809A45C - push {r4,r5,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl GetVarPointer - adds r5, r0, 0 - adds r0, r4, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl GetVarPointer - ldr r2, =0x03005d8c - ldr r1, [r2] - ldrh r1, [r1] - strh r1, [r5] - ldr r1, [r2] - ldrh r1, [r1, 0x2] - strh r1, [r0] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end s42_get_map_camera_pos - - thumb_func_start s43_get_player_party_count -s43_get_player_party_count: @ 809A498 - push {r4,lr} - ldr r4, =0x020375f0 - bl calc_player_party_count - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s43_get_player_party_count - - thumb_func_start s2F_music_play -s2F_music_play: @ 809A4B4 - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl audio_play - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s2F_music_play - - thumb_func_start s30_music_check_asm -s30_music_check_asm: @ 809A4C8 - push {lr} - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - beq _0809A4D8 - movs r0, 0 - b _0809A4DA -_0809A4D8: - movs r0, 0x1 -_0809A4DA: - pop {r1} - bx r1 - thumb_func_end s30_music_check_asm - - thumb_func_start s30_music_check -s30_music_check: @ 809A4E0 - push {lr} - ldr r1, =s30_music_check_asm - bl script_setup_asm_script - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end s30_music_check - - thumb_func_start s31_fanfare_play -s31_fanfare_play: @ 809A4F4 - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl fanfare_play - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s31_fanfare_play - - thumb_func_start s32_fanfare_wait_asm -s32_fanfare_wait_asm: @ 809A508 - push {lr} - bl task_is_not_running_overworld_fanfare - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end s32_fanfare_wait_asm - - thumb_func_start s32_fanfare_wait -s32_fanfare_wait: @ 809A518 - push {lr} - ldr r1, =s32_fanfare_wait_asm - bl script_setup_asm_script - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end s32_fanfare_wait - - thumb_func_start s33_play_music -@ int s33_play_music(script_env *env) -s33_play_music: @ 809A52C - push {r4,r5,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r2, r0, 16 - adds r5, r2, 0 - ldr r0, [r4, 0x8] - ldrb r1, [r0] - adds r0, 0x1 - str r0, [r4, 0x8] - cmp r1, 0x1 - bne _0809A54C - adds r0, r2, 0 - bl sav1_set_battle_music_maybe -_0809A54C: - adds r0, r5, 0 - bl current_map_music_set - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end s33_play_music - - thumb_func_start s34_unknown -s34_unknown: @ 809A55C - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl sav1_set_battle_music_maybe - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s34_unknown - - thumb_func_start s35_fade_to_default -s35_fade_to_default: @ 809A570 - push {lr} - bl sub_8085898 - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s35_fade_to_default - - thumb_func_start s36_fade_to_music -s36_fade_to_music: @ 809A57C - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl sub_80858C4 - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s36_fade_to_music - - thumb_func_start s37_fadeout -s37_fadeout: @ 809A590 - push {r4,lr} - adds r4, r0, 0 - ldr r0, [r4, 0x8] - ldrb r1, [r0] - adds r0, 0x1 - str r0, [r4, 0x8] - cmp r1, 0 - beq _0809A5AA - lsls r0, r1, 26 - lsrs r0, 24 - bl sub_80A31E8 - b _0809A5B0 -_0809A5AA: - movs r0, 0x4 - bl sub_80A31E8 -_0809A5B0: - ldr r1, =sub_80A3200 - adds r0, r4, 0 - bl script_setup_asm_script - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s37_fadeout - - thumb_func_start s38_fadein -s38_fadein: @ 809A5C4 - push {lr} - ldr r1, [r0, 0x8] - ldrb r2, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - cmp r2, 0 - beq _0809A5DC - lsls r0, r2, 26 - lsrs r0, 24 - bl sub_80A3228 - b _0809A5E2 -_0809A5DC: - movs r0, 0x4 - bl sub_80A3228 -_0809A5E2: - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s38_fadein - - thumb_func_start s4F_execute_movement -s4F_execute_movement: @ 809A5E8 - push {r4,r5,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_word - adds r3, r0, 0 - lsls r0, r4, 24 - lsrs r0, 24 - ldr r1, =0x03005d8c - ldr r2, [r1] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl exec_movement - ldr r0, =0x020375ca - strh r4, [r0] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end s4F_execute_movement - - thumb_func_start s50_execute_movement_remote -s50_execute_movement_remote: @ 809A62C - push {r4,r5,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_word - adds r3, r0, 0 - ldr r0, [r5, 0x8] - ldrb r2, [r0] - adds r0, 0x1 - str r0, [r5, 0x8] - ldrb r1, [r0] - adds r0, 0x1 - str r0, [r5, 0x8] - lsls r0, r4, 24 - lsrs r0, 24 - bl exec_movement - ldr r0, =0x020375ca - strh r4, [r0] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end s50_execute_movement_remote - - thumb_func_start s51a_0806B288 -s51a_0806B288: @ 809A670 - push {lr} - ldr r0, =0x020375ca - ldrb r0, [r0] - ldr r1, =0x020375ce - ldrb r1, [r1] - ldr r2, =0x020375cc - ldrb r2, [r2] - bl sub_80D3340 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end s51a_0806B288 - - thumb_func_start s51_waitmove -s51_waitmove: @ 809A698 - push {r4,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _0809A6B4 - ldr r0, =0x020375ca - strh r1, [r0] -_0809A6B4: - ldr r1, =0x020375cc - ldr r0, =0x03005d8c - ldr r2, [r0] - movs r0, 0x4 - ldrsb r0, [r2, r0] - strh r0, [r1] - ldr r1, =0x020375ce - movs r0, 0x5 - ldrsb r0, [r2, r0] - strh r0, [r1] - ldr r1, =s51a_0806B288 - adds r0, r4, 0 - bl script_setup_asm_script - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s51_waitmove - - thumb_func_start s52_waitmove_remote -s52_waitmove_remote: @ 809A6EC - push {r4,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _0809A708 - ldr r0, =0x020375ca - strh r1, [r0] -_0809A708: - ldr r0, [r4, 0x8] - ldrb r2, [r0] - adds r0, 0x1 - str r0, [r4, 0x8] - ldrb r1, [r0] - adds r0, 0x1 - str r0, [r4, 0x8] - ldr r0, =0x020375cc - strh r2, [r0] - ldr r0, =0x020375ce - strh r1, [r0] - ldr r1, =s51a_0806B288 - adds r0, r4, 0 - bl script_setup_asm_script - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s52_waitmove_remote - - thumb_func_start s53_hide_sprite -s53_hide_sprite: @ 809A740 - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005d8c - ldr r2, [r1] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl RemoveFieldObjectByLocalIdAndMap - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end s53_hide_sprite - - thumb_func_start s54_hide_sprite_set_coords -s54_hide_sprite_set_coords: @ 809A768 - push {r4,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldr r3, [r4, 0x8] - ldrb r2, [r3] - adds r3, 0x1 - str r3, [r4, 0x8] - ldrb r1, [r3] - adds r3, 0x1 - str r3, [r4, 0x8] - lsls r0, 24 - lsrs r0, 24 - bl RemoveFieldObjectByLocalIdAndMap - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s54_hide_sprite_set_coords - - thumb_func_start s55_show_sprite -s55_show_sprite: @ 809A798 - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005d8c - ldr r2, [r1] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl show_sprite - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end s55_show_sprite - - thumb_func_start s56_show_sprite_set_coords -s56_show_sprite_set_coords: @ 809A7C0 - push {r4,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldr r3, [r4, 0x8] - ldrb r2, [r3] - adds r3, 0x1 - str r3, [r4, 0x8] - ldrb r1, [r3] - adds r3, 0x1 - str r3, [r4, 0x8] - lsls r0, 24 - lsrs r0, 24 - bl show_sprite - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s56_show_sprite_set_coords - - thumb_func_start s57_move_sprites -s57_move_sprites: @ 809A7F0 - push {r4-r6,lr} - sub sp, 0x4 - adds r6, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r6, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r6, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r5, 24 - lsrs r5, 24 - ldr r1, =0x03005d8c - ldr r2, [r1] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - lsls r4, 16 - asrs r4, 16 - lsls r0, 16 - asrs r0, 16 - str r0, [sp] - adds r0, r5, 0 - adds r3, r4, 0 - bl sub_808EBA8 - movs r0, 0 - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end s57_move_sprites - - thumb_func_start s63_new_sprite_location_permanent -s63_new_sprite_location_permanent: @ 809A858 - push {r4-r6,lr} - adds r6, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r6, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r6, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r2, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, 16 - asrs r4, 16 - lsls r2, 16 - asrs r2, 16 - adds r0, r5, 0 - adds r1, r4, 0 - bl update_saveblock1_field_object_coords - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end s63_new_sprite_location_permanent - - thumb_func_start s64_set_sprite_top_left_corner -s64_set_sprite_top_left_corner: @ 809A8B0 - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005d8c - ldr r2, [r1] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl sub_808F254 - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end s64_set_sprite_top_left_corner - - thumb_func_start s58_npc_f1_clear_x20 -s58_npc_f1_clear_x20: @ 809A8D8 - push {r4,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldr r3, [r4, 0x8] - ldrb r2, [r3] - adds r3, 0x1 - str r3, [r4, 0x8] - ldrb r1, [r3] - adds r3, 0x1 - str r3, [r4, 0x8] - lsls r0, 24 - lsrs r0, 24 - movs r3, 0 - bl npc_by_local_id_and_map_set_field_1_bit_x20 - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s58_npc_f1_clear_x20 - - thumb_func_start s59_npc_f1_set_x20 -s59_npc_f1_set_x20: @ 809A908 - push {r4,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldr r3, [r4, 0x8] - ldrb r2, [r3] - adds r3, 0x1 - str r3, [r4, 0x8] - ldrb r1, [r3] - adds r3, 0x1 - str r3, [r4, 0x8] - lsls r0, 24 - lsrs r0, 24 - movs r3, 0x1 - bl npc_by_local_id_and_map_set_field_1_bit_x20 - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s59_npc_f1_set_x20 - - thumb_func_start sA8_unknown -sA8_unknown: @ 809A938 - push {r4,r5,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldr r3, [r5, 0x8] - ldrb r2, [r3] - adds r3, 0x1 - str r3, [r5, 0x8] - ldrb r1, [r3] - adds r4, r3, 0x1 - str r4, [r5, 0x8] - ldrb r3, [r3, 0x1] - adds r4, 0x1 - str r4, [r5, 0x8] - lsls r0, 24 - lsrs r0, 24 - adds r3, 0x53 - lsls r3, 24 - lsrs r3, 24 - bl sub_808E78C - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sA8_unknown - - thumb_func_start sA9_unknown -sA9_unknown: @ 809A974 - push {r4,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldr r3, [r4, 0x8] - ldrb r2, [r3] - adds r3, 0x1 - str r3, [r4, 0x8] - ldrb r1, [r3] - adds r3, 0x1 - str r3, [r4, 0x8] - lsls r0, 24 - lsrs r0, 24 - bl sub_808E7E4 - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sA9_unknown - - thumb_func_start s5A_face_player -s5A_face_player: @ 809A9A4 - push {r4,lr} - ldr r2, =0x02037350 - ldr r0, =0x03005df0 - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r4, r0, r2 - ldrb r0, [r4] - lsls r0, 31 - cmp r0, 0 - beq _0809A9CC - bl player_get_direction_lower_nybble - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectFaceOppositeDirection -_0809A9CC: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s5A_face_player - - thumb_func_start s5B_npc_set_direction -s5B_npc_set_direction: @ 809A9DC - push {r4,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldr r1, [r4, 0x8] - ldrb r3, [r1] - adds r1, 0x1 - str r1, [r4, 0x8] - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005d8c - ldr r2, [r1] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl FieldObjectTurnByLocalIdAndMap - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s5B_npc_set_direction - - thumb_func_start s65_set_sprite_behaviour -s65_set_sprite_behaviour: @ 809AA10 - push {r4,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldr r2, [r4, 0x8] - ldrb r1, [r2] - adds r2, 0x1 - str r2, [r4, 0x8] - lsls r0, 24 - lsrs r0, 24 - bl update_saveblock1_field_object_movement_behavior - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s65_set_sprite_behaviour - - thumb_func_start sAA_create_new_sprite -sAA_create_new_sprite: @ 809AA38 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x8 - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r1, [r0] - mov r8, r1 - adds r0, 0x1 - str r0, [r5, 0x8] - ldrb r6, [r0] - adds r0, 0x1 - str r0, [r5, 0x8] - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r3, r0, 0 - ldr r0, [r5, 0x8] - ldrb r2, [r0] - adds r0, 0x1 - str r0, [r5, 0x8] - ldrb r1, [r0] - adds r0, 0x1 - str r0, [r5, 0x8] - lsls r4, 16 - asrs r4, 16 - lsls r3, 16 - asrs r3, 16 - str r2, [sp] - str r1, [sp, 0x4] - mov r0, r8 - adds r1, r6, 0 - adds r2, r4, 0 - bl sprite_new - movs r0, 0 - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sAA_create_new_sprite - - thumb_func_start sAB_unknown -sAB_unknown: @ 809AAA8 - push {lr} - ldr r2, [r0, 0x8] - ldrb r3, [r2] - adds r2, 0x1 - str r2, [r0, 0x8] - ldrb r1, [r2] - adds r2, 0x1 - str r2, [r0, 0x8] - adds r0, r3, 0 - bl sub_8097B78 - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sAB_unknown - - thumb_func_start sub_809AAC4 -sub_809AAC4: @ 809AAC4 - push {r4,lr} - adds r4, r0, 0 - bl is_c1_link_related_active - cmp r0, 0 - bne _0809AAE4 - bl sub_80983E8 - ldr r1, =sub_80983C4 - adds r0, r4, 0 - bl script_setup_asm_script - movs r0, 0x1 - b _0809AAE6 - .pool -_0809AAE4: - movs r0, 0 -_0809AAE6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_809AAC4 - - thumb_func_start sub_809AAEC -sub_809AAEC: @ 809AAEC - push {r4,lr} - adds r4, r0, 0 - bl is_c1_link_related_active - cmp r0, 0 - beq _0809AAFC - movs r0, 0 - b _0809AB3A -_0809AAFC: - ldr r2, =0x02037350 - ldr r0, =0x03005df0 - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 31 - cmp r0, 0 - beq _0809AB2C - bl sub_80984A0 - ldr r1, =sub_809847C - adds r0, r4, 0 - bl script_setup_asm_script - b _0809AB38 - .pool -_0809AB2C: - bl sub_80983E8 - ldr r1, =sub_80983C4 - adds r0, r4, 0 - bl script_setup_asm_script -_0809AB38: - movs r0, 0x1 -_0809AB3A: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809AAEC - - thumb_func_start s6B_release -s6B_release: @ 809AB44 - push {lr} - bl textbox_close - movs r0, 0xFF - movs r1, 0 - movs r2, 0 - bl GetFieldObjectIdByLocalIdAndMap - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - bl FieldObjectClearAnimIfSpecialAnimFinished - bl sub_80D338C - bl sub_809757C - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end s6B_release - - thumb_func_start s6C_release_2 -s6C_release_2: @ 809AB7C - push {r4,lr} - bl textbox_close - ldr r4, =0x02037350 - ldr r0, =0x03005df0 - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r4 - ldrb r0, [r1] - lsls r0, 31 - cmp r0, 0 - beq _0809AB9E - adds r0, r1, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished -_0809AB9E: - movs r0, 0xFF - movs r1, 0 - movs r2, 0 - bl GetFieldObjectIdByLocalIdAndMap - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl FieldObjectClearAnimIfSpecialAnimFinished - bl sub_80D338C - bl sub_809757C - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s6C_release_2 - - thumb_func_start s67_execute_box -s67_execute_box: @ 809ABD4 - push {r4,lr} - adds r4, r0, 0 - bl script_read_word - cmp r0, 0 - bne _0809ABE2 - ldr r0, [r4, 0x64] -_0809ABE2: - bl box_related_two__2 - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s67_execute_box - - thumb_func_start sub_809ABF0 -sub_809ABF0: @ 809ABF0 - push {r4,lr} - adds r4, r0, 0 - bl script_read_word - cmp r0, 0 - bne _0809ABFE - ldr r0, [r4, 0x64] -_0809ABFE: - bl sub_8098238 - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_809ABF0 - - thumb_func_start s9B_unknown -s9B_unknown: @ 809AC0C - push {r4,lr} - adds r4, r0, 0 - bl script_read_word - adds r3, r0, 0 - cmp r3, 0 - bne _0809AC1C - ldr r3, [r4, 0x64] -_0809AC1C: - ldr r2, =0x03003014 - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - movs r1, 0x8 - orrs r0, r1 - strb r0, [r2] - adds r0, r3, 0 - bl box_related_two__3 - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s9B_unknown - - thumb_func_start sub_809AC3C -sub_809AC3C: @ 809AC3C - push {r4,r5,lr} - sub sp, 0xC - adds r5, r0, 0 - bl script_read_word - adds r4, r0, 0 - cmp r4, 0 - bne _0809AC4E - ldr r4, [r5, 0x64] -_0809AC4E: - bl sub_81973A4 - movs r0, 0 - movs r1, 0x1 - bl sub_81973C4 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0 - bl Print - movs r0, 0 - add sp, 0xC - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_809AC3C - - thumb_func_start sub_809AC78 -sub_809AC78: @ 809AC78 - push {lr} - ldr r1, =sub_809833C - bl script_setup_asm_script - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_809AC78 - - thumb_func_start s68_close_box -s68_close_box: @ 809AC8C - push {lr} - bl textbox_close - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s68_close_box - - thumb_func_start sub_809AC98 -sub_809AC98: @ 809AC98 - push {lr} - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0809ACB8 - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _0809ACB8 - movs r0, 0 - b _0809ACBA - .pool -_0809ACB8: - movs r0, 0x1 -_0809ACBA: - pop {r1} - bx r1 - thumb_func_end sub_809AC98 - - thumb_func_start sub_809ACC0 -sub_809ACC0: @ 809ACC0 - push {lr} - ldr r1, =sub_809AC98 - bl script_setup_asm_script - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_809ACC0 - - thumb_func_start s6E_yes_no -s6E_yes_no: @ 809ACD4 - push {lr} - ldr r2, [r0, 0x8] - ldrb r3, [r2] - adds r2, 0x1 - str r2, [r0, 0x8] - ldrb r1, [r2] - adds r2, 0x1 - str r2, [r0, 0x8] - adds r0, r3, 0 - bl yes_no_box - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809ACF6 - movs r0, 0 - b _0809ACFC -_0809ACF6: - bl script_env_2_set_ctx_paused - movs r0, 0x1 -_0809ACFC: - pop {r1} - bx r1 - thumb_func_end s6E_yes_no - - thumb_func_start s6F_multichoice -s6F_multichoice: @ 809AD00 - push {r4,r5,lr} - ldr r2, [r0, 0x8] - ldrb r5, [r2] - adds r2, 0x1 - str r2, [r0, 0x8] - ldrb r1, [r2] - adds r3, r2, 0x1 - str r3, [r0, 0x8] - ldrb r2, [r2, 0x1] - adds r4, r3, 0x1 - str r4, [r0, 0x8] - ldrb r3, [r3, 0x1] - adds r4, 0x1 - str r4, [r0, 0x8] - adds r0, r5, 0 - bl Multichoice - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809AD2E - movs r0, 0 - b _0809AD34 -_0809AD2E: - bl script_env_2_set_ctx_paused - movs r0, 0x1 -_0809AD34: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end s6F_multichoice - - thumb_func_start sub_809AD3C -sub_809AD3C: @ 809AD3C - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x4 - ldr r2, [r0, 0x8] - ldrb r1, [r2] - mov r8, r1 - adds r2, 0x1 - str r2, [r0, 0x8] - ldrb r1, [r2] - adds r3, r2, 0x1 - str r3, [r0, 0x8] - ldrb r2, [r2, 0x1] - adds r5, r3, 0x1 - str r5, [r0, 0x8] - ldrb r6, [r3, 0x1] - adds r4, r5, 0x1 - str r4, [r0, 0x8] - ldrb r3, [r5, 0x1] - adds r4, 0x1 - str r4, [r0, 0x8] - str r6, [sp] - mov r0, r8 - bl sub_80E1E58 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809AD7A - movs r0, 0 - b _0809AD80 -_0809AD7A: - bl script_env_2_set_ctx_paused - movs r0, 0x1 -_0809AD80: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_809AD3C - - thumb_func_start sub_809AD8C -sub_809AD8C: @ 809AD8C - movs r0, 0 - bx lr - thumb_func_end sub_809AD8C - - thumb_func_start sub_809AD90 -sub_809AD90: @ 809AD90 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x4 - ldr r2, [r0, 0x8] - ldrb r1, [r2] - mov r8, r1 - adds r2, 0x1 - str r2, [r0, 0x8] - ldrb r1, [r2] - adds r3, r2, 0x1 - str r3, [r0, 0x8] - ldrb r2, [r2, 0x1] - adds r5, r3, 0x1 - str r5, [r0, 0x8] - ldrb r6, [r3, 0x1] - adds r4, r5, 0x1 - str r4, [r0, 0x8] - ldrb r3, [r5, 0x1] - adds r4, 0x1 - str r4, [r0, 0x8] - str r6, [sp] - mov r0, r8 - bl sub_80E21D0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809ADCE - movs r0, 0 - b _0809ADD4 -_0809ADCE: - bl script_env_2_set_ctx_paused - movs r0, 0x1 -_0809ADD4: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_809AD90 - - thumb_func_start s73_nop_skip_word -s73_nop_skip_word: @ 809ADE0 - ldr r1, [r0, 0x8] - adds r1, 0x4 - str r1, [r0, 0x8] - movs r0, 0 - bx lr - thumb_func_end s73_nop_skip_word - - thumb_func_start sub_809ADEC -sub_809ADEC: @ 809ADEC - ldr r1, [r0, 0x8] - adds r1, 0x4 - str r1, [r0, 0x8] - movs r0, 0 - bx lr - thumb_func_end sub_809ADEC - - thumb_func_start sub_809ADF8 -sub_809ADF8: @ 809ADF8 - push {r4,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - ldr r3, [r4, 0x8] - ldrb r1, [r3] - adds r3, 0x1 - str r3, [r4, 0x8] - ldrb r2, [r3] - adds r3, 0x1 - str r3, [r4, 0x8] - bl sub_80E2900 - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_809ADF8 - - thumb_func_start s76_close_picture_box -s76_close_picture_box: @ 809AE28 - push {r4,lr} - adds r4, r0, 0 - bl picbox_close - adds r1, r0, 0 - cmp r1, 0 - beq _0809AE40 - adds r0, r4, 0 - bl script_setup_asm_script - movs r0, 0x1 - b _0809AE42 -_0809AE40: - movs r0, 0 -_0809AE42: - pop {r4} - pop {r1} - bx r1 - thumb_func_end s76_close_picture_box - - thumb_func_start sub_809AE48 -sub_809AE48: @ 809AE48 - push {lr} - ldr r1, [r0, 0x8] - ldrb r2, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - cmp r2, 0 - beq _0809AE5C - adds r0, r2, 0 - bl sub_812FDA8 -_0809AE5C: - bl sub_80F8ADC - bl script_env_2_set_ctx_paused - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_809AE48 - - thumb_func_start sub_809AE6C -sub_809AE6C: @ 809AE6C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x20 - bl script_read_word - adds r1, r0, 0 - ldr r4, =0x02021fc4 - adds r1, 0x6 - adds r0, r4, 0 - bl ExpandStringRefs - movs r2, 0x1 - negs r2, r2 - movs r0, 0x6 - adds r1, r4, 0 - bl GetStringWidth - lsrs r0, 3 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x1C - bls _0809AE9C - movs r7, 0x1C -_0809AE9C: - movs r5, 0x4 - ldrb r0, [r4] - adds r2, r7, 0x2 - add r1, sp, 0x18 - mov r8, r1 - cmp r0, 0xFF - beq _0809AEC0 - adds r1, r4, 0 -_0809AEAC: - ldrb r0, [r1] - adds r1, 0x1 - cmp r0, 0xFE - bne _0809AEBA - adds r0, r5, 0x3 - lsls r0, 24 - lsrs r5, r0, 24 -_0809AEBA: - ldrb r0, [r1] - cmp r0, 0xFF - bne _0809AEAC -_0809AEC0: - cmp r5, 0x12 - bls _0809AEC6 - movs r5, 0x12 -_0809AEC6: - lsls r0, r2, 24 - lsrs r0, 24 - movs r2, 0x1E - subs r2, r0 - lsrs r0, r2, 31 - adds r2, r0 - asrs r2, 1 - lsls r2, 24 - adds r0, r5, 0x2 - lsls r0, 24 - lsrs r0, 24 - movs r4, 0x14 - subs r4, r0 - lsrs r0, r4, 31 - adds r4, r0 - asrs r4, 1 - lsls r4, 24 - lsrs r6, r2, 24 - movs r0, 0x80 - lsls r0, 17 - adds r2, r0 - lsrs r2, 24 - lsrs r3, r4, 24 - movs r1, 0x80 - lsls r1, 18 - adds r4, r1 - lsrs r4, 24 - subs r6, r2, r6 - subs r6, 0x1 - lsls r6, 3 - adds r6, 0x3 - lsls r6, 24 - lsrs r6, 24 - subs r4, r3 - subs r4, 0x1 - lsls r4, 27 - lsrs r4, 24 - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - str r7, [sp] - str r5, [sp, 0x4] - movs r0, 0xF - str r0, [sp, 0x8] - movs r0, 0x1 - str r0, [sp, 0xC] - add r0, sp, 0x10 - movs r1, 0 - bl sub_8198A50 - ldr r0, [sp, 0x10] - ldr r1, [sp, 0x14] - str r0, [sp, 0x18] - str r1, [sp, 0x1C] - ldr r5, =0x03000f30 - mov r0, r8 - bl AddWindow - strb r0, [r5] - ldrb r0, [r5] - movs r1, 0x85 - lsls r1, 2 - movs r2, 0xE0 - bl sub_809882C - ldrb r0, [r5] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r5] - bl PutWindowTilemap - ldrb r0, [r5] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldrb r0, [r5] - ldr r2, =0x02021fc4 - str r4, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x6 - adds r3, r6, 0 - bl Print - ldrb r0, [r5] - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0 - add sp, 0x20 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809AE6C - - thumb_func_start sub_809AF94 -sub_809AF94: @ 809AF94 - push {lr} - bl sub_809BDB4 - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_809AF94 - - thumb_func_start sBD_virtual_message -sBD_virtual_message: @ 809AFA0 - push {lr} - bl script_read_word - ldr r1, =0x020375c4 - ldr r1, [r1] - subs r0, r1 - bl box_related_two__2 - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sBD_virtual_message - - thumb_func_start s7D_load_pokename -s7D_load_pokename: @ 809AFBC - push {r4,lr} - ldr r1, [r0, 0x8] - ldrb r4, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - ldr r1, =gUnknown_085102D4 - lsls r4, 2 - adds r4, r1 - ldr r2, [r4] - movs r1, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r2, 0 - bl CopyString - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s7D_load_pokename - - thumb_func_start s7E_load_first_pokenames -s7E_load_first_pokenames: @ 809AFFC - push {r4,lr} - ldr r1, [r0, 0x8] - ldrb r2, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - ldr r0, =gUnknown_085102D4 - lsls r2, 2 - adds r2, r0 - ldr r4, [r2] - bl sub_8139688 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - movs r1, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r4, 0 - bl CopyString - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s7E_load_first_pokenames - - thumb_func_start s7F_load_pokename_team -s7F_load_pokename_team: @ 809B048 - push {r4,lr} - ldr r1, [r0, 0x8] - ldrb r4, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =gUnknown_085102D4 - lsls r4, 2 - adds r4, r1 - ldr r4, [r4] - movs r1, 0x2 - adds r2, r4, 0 - bl pokemon_getattr - adds r0, r4, 0 - bl GetStringEnd_Limit7 - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s7F_load_pokename_team - - thumb_func_start s80_load_item_name -s80_load_item_name: @ 809B090 - push {r4,lr} - ldr r1, [r0, 0x8] - ldrb r4, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - ldr r1, =gUnknown_085102D4 - lsls r4, 2 - adds r4, r1 - ldr r1, [r4] - bl itemid_get_name - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s80_load_item_name - - thumb_func_start sub_809B0C4 -sub_809B0C4: @ 809B0C4 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r6, [r0] - adds r0, 0x1 - str r0, [r5, 0x8] - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r2, r0, 0 - lsls r2, 16 - lsrs r2, 16 - ldr r0, =gUnknown_085102D4 - lsls r6, 2 - adds r6, r0 - ldr r1, [r6] - adds r0, r4, 0 - bl sub_80D6660 - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809B0C4 - - thumb_func_start sub_809B114 -sub_809B114: @ 809B114 - push {r4,lr} - ldr r1, [r0, 0x8] - ldrb r4, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r1, r0, 0 - lsls r1, 16 - ldr r0, =gUnknown_085102D4 - lsls r4, 2 - adds r4, r0 - ldr r0, [r4] - lsrs r1, 11 - ldr r2, =gUnknown_085A5C09 - adds r1, r2 - bl CopyString - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809B114 - - thumb_func_start s82_load_item_name -s82_load_item_name: @ 809B150 - push {r4,lr} - ldr r1, [r0, 0x8] - ldrb r4, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - ldr r1, =gUnknown_085102D4 - lsls r4, 2 - adds r4, r1 - ldr r2, [r4] - movs r1, 0xD - muls r1, r0 - ldr r0, =gMoveNames - adds r1, r0 - adds r0, r2, 0 - bl CopyString - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s82_load_item_name - - thumb_func_start s83_load_textvar_var -s83_load_textvar_var: @ 809B190 - push {r4,r5,lr} - ldr r1, [r0, 0x8] - ldrb r5, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r4, 0 - bl sub_80EF370 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =gUnknown_085102D4 - lsls r5, 2 - adds r5, r0 - ldr r0, [r5] - adds r1, r4, 0 - movs r2, 0 - bl ConvertIntToDecimalString - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end s83_load_textvar_var - - thumb_func_start s84_load_textvar_std_expression -s84_load_textvar_std_expression: @ 809B1D4 - push {r4,lr} - ldr r1, [r0, 0x8] - ldrb r4, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - ldr r1, =gUnknown_085102D4 - lsls r4, 2 - adds r4, r1 - ldr r2, [r4] - ldr r1, =gUnknown_0858BAF0 - lsrs r0, 14 - adds r0, r1 - ldr r1, [r0] - adds r0, r2, 0 - bl CopyString - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s84_load_textvar_std_expression - - thumb_func_start sub_809B214 -sub_809B214: @ 809B214 - push {r4,lr} - ldr r1, [r0, 0x8] - ldrb r4, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r1, r0, 0 - ldr r0, =gUnknown_085102D4 - lsls r4, 2 - adds r4, r0 - ldr r0, [r4] - lsls r1, 24 - lsrs r1, 24 - bl sub_818E868 - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809B214 - - thumb_func_start s85_load_textvar_pointer -s85_load_textvar_pointer: @ 809B248 - push {r4,lr} - ldr r1, [r0, 0x8] - ldrb r4, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl script_read_word - adds r1, r0, 0 - ldr r0, =gUnknown_085102D4 - lsls r4, 2 - adds r4, r0 - ldr r0, [r4] - bl CopyString - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s85_load_textvar_pointer - - thumb_func_start sBE_virtual_load_text -sBE_virtual_load_text: @ 809B270 - push {lr} - bl script_read_word - adds r1, r0, 0 - ldr r0, =0x020375c4 - ldr r0, [r0] - subs r1, r0 - ldr r0, =0x02021fc4 - bl ExpandStringRefs - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sBE_virtual_load_text - - thumb_func_start sBF_virtual_load_textbuffer -sBF_virtual_load_textbuffer: @ 809B294 - push {r4,lr} - ldr r1, [r0, 0x8] - ldrb r4, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl script_read_word - adds r1, r0, 0 - ldr r0, =0x020375c4 - ldr r0, [r0] - subs r1, r0 - ldr r0, =gUnknown_085102D4 - lsls r4, 2 - adds r4, r0 - ldr r0, [r4] - bl CopyString - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sBF_virtual_load_textbuffer - - thumb_func_start sC6_load_textvar_box_label -sC6_load_textvar_box_label: @ 809B2C8 - push {r4,lr} - ldr r1, [r0, 0x8] - ldrb r4, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldr r1, =gUnknown_085102D4 - lsls r4, 2 - adds r4, r1 - ldr r4, [r4] - lsls r0, 24 - lsrs r0, 24 - bl sav3_get_box_name - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sC6_load_textvar_box_label - - thumb_func_start s79_give_pokemon -s79_give_pokemon: @ 809B304 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x8 - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r6, r0, 0 - lsls r6, 16 - lsrs r6, 16 - ldr r0, [r4, 0x8] - ldrb r1, [r0] - mov r9, r1 - adds r0, 0x1 - str r0, [r4, 0x8] - adds r0, r4, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - bl script_read_word - mov r8, r0 - adds r0, r4, 0 - bl script_read_word - ldr r1, [r4, 0x8] - ldrb r2, [r1] - adds r1, 0x1 - str r1, [r4, 0x8] - ldr r4, =0x020375f0 - str r0, [sp] - str r2, [sp, 0x4] - adds r0, r6, 0 - mov r1, r9 - adds r2, r5, 0 - mov r3, r8 - bl sub_80F9244 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - movs r0, 0 - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end s79_give_pokemon - - thumb_func_start s7A_create_egg -s7A_create_egg: @ 809B384 - push {r4,lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - ldr r4, =0x020375f0 - bl sub_80F92C8 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s7A_create_egg - - thumb_func_start s7B_change_pokedata_AP -s7B_change_pokedata_AP: @ 809B3B0 - push {r4,r5,lr} - ldr r1, [r0, 0x8] - ldrb r5, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - ldrb r4, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl script_read_halfword - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r5, 0 - adds r2, r4, 0 - bl sub_80F9400 - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end s7B_change_pokedata_AP - - thumb_func_start sub_809B3DC -sub_809B3DC: @ 809B3DC - push {r4-r7,lr} - bl script_read_halfword - lsls r0, 16 - lsrs r7, r0, 16 - ldr r1, =0x020375f0 - movs r0, 0x6 - strh r0, [r1] - movs r6, 0 - b _0809B42A - .pool -_0809B3F4: - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _0809B424 - adds r0, r4, 0 - adds r1, r7, 0 - bl pokemon_has_move - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809B424 - ldr r0, =0x020375f0 - strh r6, [r0] - ldr r0, =0x020375e0 - strh r5, [r0] - b _0809B44A - .pool -_0809B424: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_0809B42A: - cmp r6, 0x5 - bhi _0809B44A - movs r0, 0x64 - adds r1, r6, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0 - bne _0809B3F4 -_0809B44A: - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809B3DC - - thumb_func_start s90_add_money -@ int s90_add_money(script_env *env) -s90_add_money: @ 809B458 - push {r4,lr} - adds r4, r0, 0 - bl script_read_word - adds r2, r0, 0 - ldr r0, [r4, 0x8] - ldrb r1, [r0] - adds r0, 0x1 - str r0, [r4, 0x8] - cmp r1, 0 - bne _0809B47E - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r1, 0x92 - lsls r1, 3 - adds r0, r1 - adds r1, r2, 0 - bl add_money -_0809B47E: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s90_add_money - - thumb_func_start s91_subtract_money -@ int s91_subtract_money(script_env *env) -s91_subtract_money: @ 809B48C - push {r4,lr} - adds r4, r0, 0 - bl script_read_word - adds r2, r0, 0 - ldr r0, [r4, 0x8] - ldrb r1, [r0] - adds r0, 0x1 - str r0, [r4, 0x8] - cmp r1, 0 - bne _0809B4B2 - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r1, 0x92 - lsls r1, 3 - adds r0, r1 - adds r1, r2, 0 - bl subtract_money -_0809B4B2: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s91_subtract_money - - thumb_func_start s92_check_money -@ int s92_check_money(script_env *env) -s92_check_money: @ 809B4C0 - push {r4,lr} - adds r4, r0, 0 - bl script_read_word - adds r2, r0, 0 - ldr r0, [r4, 0x8] - ldrb r1, [r0] - adds r0, 0x1 - str r0, [r4, 0x8] - cmp r1, 0 - bne _0809B4EE - ldr r4, =0x020375f0 - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r1, 0x92 - lsls r1, 3 - adds r0, r1 - adds r1, r2, 0 - bl IsEnoughMoney - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] -_0809B4EE: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s92_check_money - - thumb_func_start s93_display_money -@ int s93_display_money(script_env *env) -s93_display_money: @ 809B500 - push {r4,r5,lr} - ldr r1, [r0, 0x8] - ldrb r5, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - ldrb r4, [r1] - adds r2, r1, 0x1 - str r2, [r0, 0x8] - ldrb r1, [r1, 0x1] - adds r2, 0x1 - str r2, [r0, 0x8] - cmp r1, 0 - bne _0809B530 - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r1, 0x92 - lsls r1, 3 - adds r0, r1 - bl DecryptMoney - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_80E52EC -_0809B530: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end s93_display_money - - thumb_func_start s94_hide_money -s94_hide_money: @ 809B53C - push {lr} - bl sub_80E5384 - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s94_hide_money - - thumb_func_start s95_update_money -@ int s95_update_money(script_env *env) -s95_update_money: @ 809B548 - push {lr} - ldr r1, [r0, 0x8] - adds r1, 0x1 - adds r2, r1, 0x1 - str r2, [r0, 0x8] - ldrb r1, [r1, 0x1] - adds r2, 0x1 - str r2, [r0, 0x8] - cmp r1, 0 - bne _0809B56E - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r1, 0x92 - lsls r1, 3 - adds r0, r1 - bl DecryptMoney - bl sub_80E52D4 -_0809B56E: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end s95_update_money - - thumb_func_start sub_809B578 -sub_809B578: @ 809B578 - push {r4,r5,lr} - ldr r1, [r0, 0x8] - ldrb r5, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - ldrb r4, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl GetCoins - lsls r0, 16 - lsrs r0, 16 - adds r1, r5, 0 - adds r2, r4, 0 - bl ShowCoinsWindow - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_809B578 - - thumb_func_start sC1_hide_coins -sC1_hide_coins: @ 809B5A0 - push {lr} - ldr r1, [r0, 0x8] - adds r1, 0x2 - str r1, [r0, 0x8] - bl HideCoinsWindow - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sC1_hide_coins - - thumb_func_start sC2_update_coins -sC2_update_coins: @ 809B5B4 - push {lr} - ldr r1, [r0, 0x8] - adds r1, 0x2 - str r1, [r0, 0x8] - bl GetCoins - lsls r0, 16 - lsrs r0, 16 - bl PrintCoinsString - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sC2_update_coins - - thumb_func_start s5C_trainer_battle_configure_and_start -s5C_trainer_battle_configure_and_start: @ 809B5D0 - push {r4,lr} - adds r4, r0, 0 - ldr r0, [r4, 0x8] - bl TrainerBattleConfigure - str r0, [r4, 0x8] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s5C_trainer_battle_configure_and_start - - thumb_func_start sub_809B5E4 -sub_809B5E4: @ 809B5E4 - push {lr} - bl sub_80B17E0 - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_809B5E4 - - thumb_func_start sub_809B5F0 -sub_809B5F0: @ 809B5F0 - push {r4,lr} - adds r4, r0, 0 - bl sub_80B1AF8 - str r0, [r4, 0x8] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_809B5F0 - - thumb_func_start sub_809B604 -@ bool8 sub_809B604(struct script_env *env) -sub_809B604: @ 809B604 - push {r4,lr} - adds r4, r0, 0 - bl sub_80B1B10 - str r0, [r4, 0x8] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_809B604 - - thumb_func_start s60_check_trainer_flag -s60_check_trainer_flag: @ 809B618 - push {r4,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - bl trainer_flag_check - strb r0, [r4, 0x2] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s60_check_trainer_flag - - thumb_func_start s61_set_trainer_flag -s61_set_trainer_flag: @ 809B63C - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - bl trainer_flag_set - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s61_set_trainer_flag - - thumb_func_start s62_unset_trainer_flag -s62_unset_trainer_flag: @ 809B658 - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - bl trainer_flag_clear - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s62_unset_trainer_flag - - thumb_func_start sB6_load_battle -sB6_load_battle: @ 809B674 - push {r4-r6,lr} - adds r4, r0, 0 - bl script_read_halfword - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - ldr r0, [r4, 0x8] - ldrb r6, [r0] - adds r0, 0x1 - str r0, [r4, 0x8] - adds r0, r4, 0 - bl script_read_halfword - adds r2, r0, 0 - lsls r2, 16 - lsrs r2, 16 - adds r0, r5, 0 - adds r1, r6, 0 - bl sub_80F93A0 - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sB6_load_battle - - thumb_func_start sub_809B6A8 -sub_809B6A8: @ 809B6A8 - push {lr} - bl sub_80B08A8 - bl script_env_2_set_ctx_paused - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_809B6A8 - - thumb_func_start s86_pokemart -s86_pokemart: @ 809B6B8 - push {lr} - bl script_read_word - bl CreatePokemartMenu - bl script_env_2_set_ctx_paused - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end s86_pokemart - - thumb_func_start s87_pokemartdecor -s87_pokemartdecor: @ 809B6CC - push {lr} - bl script_read_word - bl CreateDecorationShop1Menu - bl script_env_2_set_ctx_paused - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end s87_pokemartdecor - - thumb_func_start s88_pokemartbp -s88_pokemartbp: @ 809B6E0 - push {lr} - bl script_read_word - bl CreateDecorationShop2Menu - bl script_env_2_set_ctx_paused - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end s88_pokemartbp - - thumb_func_start s89_open_casino_game1 -s89_open_casino_game1: @ 809B6F4 - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 24 - lsrs r0, 24 - ldr r1, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl sub_812A540 - bl script_env_2_set_ctx_paused - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end s89_open_casino_game1 - - thumb_func_start berry_script_cmd -@ bool8 berry_script_cmd(struct script_env *env) -berry_script_cmd: @ 809B71C - push {r4,r5,lr} - ldr r1, [r0, 0x8] - ldrb r5, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - ldrb r3, [r1] - adds r2, r1, 0x1 - str r2, [r0, 0x8] - ldrb r4, [r1, 0x1] - adds r2, 0x1 - str r2, [r0, 0x8] - cmp r3, 0 - bne _0809B744 - adds r0, r5, 0 - movs r1, 0 - adds r2, r4, 0 - movs r3, 0 - bl PlantBerryTree - b _0809B750 -_0809B744: - adds r0, r5, 0 - adds r1, r3, 0 - adds r2, r4, 0 - movs r3, 0 - bl PlantBerryTree -_0809B750: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end berry_script_cmd - - thumb_func_start sub_809B758 -sub_809B758: @ 809B758 - push {r4,lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldr r4, =0x020375f0 - lsls r0, 24 - lsrs r0, 24 - bl GetPriceReduction - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809B758 - - thumb_func_start sub_809B784 -sub_809B784: @ 809B784 - push {lr} - bl sub_81B9404 - bl script_env_2_set_ctx_paused - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_809B784 - - thumb_func_start sub_809B794 -sub_809B794: @ 809B794 - push {lr} - bl sub_80F840C - bl script_env_2_set_ctx_paused - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_809B794 - - thumb_func_start sub_809B7A4 -sub_809B7A4: @ 809B7A4 - push {lr} - bl sub_80F8484 - bl script_env_2_set_ctx_paused - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_809B7A4 - - thumb_func_start sub_809B7B4 -sub_809B7B4: @ 809B7B4 - push {lr} - ldr r0, =0x02039f2c - ldrb r0, [r0] - bl sub_80F84C4 - bl script_env_2_set_ctx_paused - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_809B7B4 - - thumb_func_start s9C_execute_HM -s9C_execute_HM: @ 809B7CC - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x020375d0 - strh r0, [r1] - lsls r0, 24 - lsrs r0, 24 - bl FieldEffectStart - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end s9C_execute_HM - - thumb_func_start s9D_set_HM_animation_data -s9D_set_HM_animation_data: @ 809B7F4 - push {r4,lr} - ldr r1, [r0, 0x8] - ldrb r4, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldr r1, =0x02038c08 - lsls r4, 2 - adds r4, r1 - lsls r0, 16 - asrs r0, 16 - str r0, [r4] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s9D_set_HM_animation_data - - thumb_func_start sub_809B824 -sub_809B824: @ 809B824 - push {lr} - ldr r0, =0x020375d0 - ldrb r0, [r0] - bl FieldEffectActiveListContains - lsls r0, 24 - cmp r0, 0 - beq _0809B83C - movs r0, 0 - b _0809B83E - .pool -_0809B83C: - movs r0, 0x1 -_0809B83E: - pop {r1} - bx r1 - thumb_func_end sub_809B824 - - thumb_func_start s9E_checkarray_HM_animation -s9E_checkarray_HM_animation: @ 809B844 - push {r4,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldr r1, =0x020375d0 - strh r0, [r1] - ldr r1, =sub_809B824 - adds r0, r4, 0 - bl script_setup_asm_script - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s9E_checkarray_HM_animation - - thumb_func_start s9F_changeposition_fly -s9F_changeposition_fly: @ 809B870 - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 24 - lsrs r0, 24 - bl sub_8084D1C - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s9F_changeposition_fly - - thumb_func_start sA0_check_gender -sA0_check_gender: @ 809B88C - ldr r1, =0x020375f0 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - strh r0, [r1] - movs r0, 0 - bx lr - .pool - thumb_func_end sA0_check_gender - - thumb_func_start sA1_play_cry -sA1_play_cry: @ 809B8A4 - push {r4,r5,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_80A3404 - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sA1_play_cry - - thumb_func_start sub_809B8DC -sub_809B8DC: @ 809B8DC - push {lr} - ldr r1, =sub_80A3678 - bl script_setup_asm_script - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_809B8DC - - thumb_func_start sA2_setmaptile -sA2_setmaptile: @ 809B8F0 - push {r4-r7,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r6, r0, 16 - adds r0, r4, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r7, r0, 16 - adds r0, r4, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - adds r1, r6, 0x7 - lsls r1, 16 - lsrs r6, r1, 16 - adds r1, r5, 0x7 - lsls r1, 16 - lsrs r5, r1, 16 - cmp r0, 0 - bne _0809B954 - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r7, 0 - bl MapGridSetMetatileIdAt - b _0809B966 -_0809B954: - movs r1, 0xC0 - lsls r1, 4 - adds r0, r1, 0 - adds r2, r7, 0 - orrs r2, r0 - adds r0, r6, 0 - adds r1, r5, 0 - bl MapGridSetMetatileIdAt -_0809B966: - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sA2_setmaptile - - thumb_func_start sAC_open_door -sAC_open_door: @ 809B970 - push {r4,r5,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - adds r5, 0x7 - lsls r5, 16 - lsrs r5, 16 - movs r0, 0xE0 - lsls r0, 11 - adds r4, r0 - lsrs r4, 16 - adds r0, r5, 0 - adds r1, r4, 0 - bl cur_mapdata_get_door_sound_at - lsls r0, 16 - lsrs r0, 16 - bl audio_play - adds r0, r5, 0 - adds r1, r4, 0 - bl task_overworld_door_add_if_role_69_for_opening_door_at - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sAC_open_door - - thumb_func_start sub_809B9C8 -sub_809B9C8: @ 809B9C8 - push {r4,r5,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r1, r0, 0 - lsls r1, 16 - adds r4, 0x7 - lsls r4, 16 - lsrs r4, 16 - movs r0, 0xE0 - lsls r0, 11 - adds r1, r0 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_808A8AC - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_809B9C8 - - thumb_func_start sub_809BA0C -sub_809BA0C: @ 809BA0C - push {lr} - bl sub_808A91C - lsls r0, 24 - cmp r0, 0 - beq _0809BA1C - movs r0, 0 - b _0809BA1E -_0809BA1C: - movs r0, 0x1 -_0809BA1E: - pop {r1} - bx r1 - thumb_func_end sub_809BA0C - - thumb_func_start sub_809BA24 -sub_809BA24: @ 809BA24 - push {lr} - ldr r1, =sub_809BA0C - bl script_setup_asm_script - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_809BA24 - - thumb_func_start sub_809BA38 -sub_809BA38: @ 809BA38 - push {r4,r5,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r1, r0, 0 - lsls r1, 16 - adds r4, 0x7 - lsls r4, 16 - lsrs r4, 16 - movs r0, 0xE0 - lsls r0, 11 - adds r1, r0 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_808A854 - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_809BA38 - - thumb_func_start sub_809BA7C -sub_809BA7C: @ 809BA7C - push {r4,r5,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r1, r0, 0 - lsls r1, 16 - adds r4, 0x7 - lsls r4, 16 - lsrs r4, 16 - movs r0, 0xE0 - lsls r0, 11 - adds r1, r0 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_808A880 - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_809BA7C - - thumb_func_start sub_809BAC0 -sub_809BAC0: @ 809BAC0 - push {r4,lr} - adds r4, r0, 0 - ldr r0, [r4, 0x8] - adds r0, 0x1 - str r0, [r4, 0x8] - adds r0, r4, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r0, r4, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r0, r4, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_809BAC0 - - thumb_func_start sub_809BAFC -sub_809BAFC: @ 809BAFC - movs r0, 0 - bx lr - thumb_func_end sub_809BAFC - - thumb_func_start sB3_get_coin_amount -sB3_get_coin_amount: @ 809BB00 - push {r4,lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl GetVarPointer - adds r4, r0, 0 - bl GetCoins - strh r0, [r4] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sB3_get_coin_amount - - thumb_func_start sub_809BB20 -sub_809BB20: @ 809BB20 - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - bl AddCoins - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809BB48 - ldr r1, =0x020375f0 - movs r0, 0 - b _0809BB4C - .pool -_0809BB48: - ldr r1, =0x020375f0 - movs r0, 0x1 -_0809BB4C: - strh r0, [r1] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_809BB20 - - thumb_func_start sub_809BB58 -sub_809BB58: @ 809BB58 - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - bl SubtractCoins - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809BB80 - ldr r1, =0x020375f0 - movs r0, 0 - b _0809BB84 - .pool -_0809BB80: - ldr r1, =0x020375f0 - movs r0, 0x1 -_0809BB84: - strh r0, [r1] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_809BB58 - - thumb_func_start sub_809BB90 -sub_809BB90: @ 809BB90 - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 24 - lsrs r0, 24 - bl sub_81A89A0 - ldr r1, =0x020375ca - strh r0, [r1] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_809BB90 - - thumb_func_start sub_809BBB4 -sub_809BBB4: @ 809BBB4 - push {lr} - bl sub_81A8AF8 - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_809BBB4 - - thumb_func_start ScrCmd_MossdeepGymSwitch -ScrCmd_MossdeepGymSwitch: @ 809BBC0 - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 24 - lsrs r0, 24 - bl sub_81A8934 - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end ScrCmd_MossdeepGymSwitch - - thumb_func_start sub_809BBDC -sub_809BBDC: @ 809BBDC - push {lr} - bl sub_81A895C - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_809BBDC - - thumb_func_start sub_809BBE8 -sub_809BBE8: @ 809BBE8 - push {lr} - bl sub_80B47BC - ldr r1, =0x03005df0 - strb r0, [r1] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_809BBE8 - - thumb_func_start sub_809BBFC -sub_809BBFC: @ 809BBFC - push {r4,lr} - adds r4, r0, 0 - bl is_c1_link_related_active - cmp r0, 0 - beq _0809BC0C - movs r0, 0 - b _0809BC30 -_0809BC0C: - ldr r2, =0x02037350 - ldr r0, =0x03005df0 - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 31 - cmp r0, 0 - beq _0809BC2E - bl sub_8098630 - ldr r1, =sub_8098734 - adds r0, r4, 0 - bl script_setup_asm_script -_0809BC2E: - movs r0, 0x1 -_0809BC30: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809BBFC - - thumb_func_start sCD_set_obedient_bit -sCD_set_obedient_bit: @ 809BC44 - push {lr} - sub sp, 0x4 - movs r2, 0x1 - mov r1, sp - strb r2, [r1] - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x50 - mov r2, sp - bl pokemon_setattr - movs r0, 0 - add sp, 0x4 - pop {r1} - bx r1 - .pool - thumb_func_end sCD_set_obedient_bit - - thumb_func_start sCE_check_obedient_bit -sCE_check_obedient_bit: @ 809BC7C - push {r4,lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - ldr r4, =0x020375f0 - movs r1, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x50 - movs r2, 0 - bl pokemon_getattr - strh r0, [r4] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sCE_check_obedient_bit - - thumb_func_start sCF_execute_RAM_script_DMA -sCF_execute_RAM_script_DMA: @ 809BCB4 - push {r4,lr} - adds r4, r0, 0 - bl sub_8099244 - adds r2, r0, 0 - cmp r2, 0 - beq _0809BCD0 - ldr r1, =0x020375c0 - ldr r0, [r4, 0x8] - str r0, [r1] - adds r0, r4, 0 - adds r1, r2, 0 - bl script_jump -_0809BCD0: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sCF_execute_RAM_script_DMA - - thumb_func_start sD1_warp_v5 -sD1_warp_v5: @ 809BCDC - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r1, [r0] - mov r9, r1 - adds r0, 0x1 - str r0, [r5, 0x8] - ldrb r1, [r0] - mov r8, r1 - adds r1, r0, 0x1 - str r1, [r5, 0x8] - ldrb r6, [r0, 0x1] - adds r1, 0x1 - str r1, [r5, 0x8] - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - mov r1, r9 - lsls r1, 24 - asrs r1, 24 - mov r9, r1 - mov r1, r8 - lsls r1, 24 - asrs r1, 24 - mov r8, r1 - lsls r6, 24 - asrs r6, 24 - lsls r4, 24 - asrs r4, 24 - lsls r0, 24 - asrs r0, 24 - str r0, [sp] - mov r0, r9 - adds r2, r6, 0 - adds r3, r4, 0 - bl warp1_set - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - bl sub_808D074 - bl sub_80B0244 - bl player_avatar_init_params_reset - movs r0, 0x1 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sD1_warp_v5 - - thumb_func_start sub_809BD70 -sub_809BD70: @ 809BD70 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r3, r0, 16 - ldr r0, [r4, 0x8] - ldrb r2, [r0] - mov r1, sp - strb r2, [r1] - adds r0, 0x1 - str r0, [r4, 0x8] - cmp r3, 0x5 - bhi _0809BDA6 - movs r0, 0x64 - muls r0, r3 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x23 - mov r2, sp - bl pokemon_setattr -_0809BDA6: - movs r0, 0 - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809BD70 - - thumb_func_start sub_809BDB4 -sub_809BDB4: @ 809BDB4 - push {r4,lr} - ldr r4, =0x03000f30 - ldrb r0, [r4] - movs r1, 0x1 - bl sub_819746C - ldrb r0, [r4] - bl RemoveWindow - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809BDB4 - - thumb_func_start sub_809BDD0 -sub_809BDD0: @ 809BDD0 - push {r4,lr} - ldr r1, [r0, 0x8] - ldrb r4, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - ldr r1, =gUnknown_085102D4 - lsls r4, 2 - adds r4, r1 - ldr r4, [r4] - bl sub_806F07C - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809BDD0 - - thumb_func_start sub_809BE0C -sub_809BE0C: @ 809BE0C - push {r4,lr} - ldr r1, [r0, 0x8] - ldrb r4, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - ldr r1, =gUnknown_085102D4 - lsls r4, 2 - adds r4, r1 - ldr r4, [r4] - bl sub_806F0B0 - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809BE0C - - thumb_func_start sub_809BE48 -sub_809BE48: @ 809BE48 - ldr r1, =0x020375ca - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_809BE48 - - thumb_func_start sub_809BE54 -sub_809BE54: @ 809BE54 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r1, [r0] - mov r9, r1 - adds r0, 0x1 - str r0, [r5, 0x8] - ldrb r1, [r0] - mov r8, r1 - adds r1, r0, 0x1 - str r1, [r5, 0x8] - ldrb r6, [r0, 0x1] - adds r1, 0x1 - str r1, [r5, 0x8] - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - mov r1, r9 - lsls r1, 24 - asrs r1, 24 - mov r9, r1 - mov r1, r8 - lsls r1, 24 - asrs r1, 24 - mov r8, r1 - lsls r6, 24 - asrs r6, 24 - lsls r4, 24 - asrs r4, 24 - lsls r0, 24 - asrs r0, 24 - str r0, [sp] - mov r0, r9 - adds r2, r6, 0 - adds r3, r4, 0 - bl warp1_set - bl sub_80AF79C - bl player_avatar_init_params_reset - movs r0, 0x1 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_809BE54 - - thumb_func_start sub_809BEDC -sub_809BEDC: @ 809BEDC - push {r4,r5,lr} - movs r1, 0x2 - negs r1, r1 - movs r3, 0x3 - negs r3, r3 - movs r4, 0x5 - negs r4, r4 - movs r5, 0x9 - negs r5, r5 - movs r2, 0 - strb r2, [r0] - ldrb r2, [r0, 0x1] - ands r1, r2 - ands r1, r3 - ands r1, r4 - ands r1, r5 - strb r1, [r0, 0x1] - movs r1, 0 - strb r1, [r0, 0x2] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_809BEDC - - thumb_func_start process_overworld_input -@ void process_overworld_input(overworld_input_data *input_data, char buttons_new, char buttons_held) -process_overworld_input: @ 809BF08 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r4, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - lsls r2, 16 - lsrs r2, 16 - mov r8, r2 - ldr r0, =0x02037590 - ldrb r6, [r0, 0x3] - ldrb r0, [r0, 0x2] - mov r9, r0 - bl cur_mapdata_block_role_at_player_pos - lsls r0, 24 - lsrs r0, 24 - bl sub_808904C - lsls r0, 24 - lsrs r7, r0, 24 - cmp r6, 0x2 - bne _0809BF3C - cmp r7, 0 - beq _0809BF40 -_0809BF3C: - cmp r6, 0 - bne _0809BFA2 -_0809BF40: - bl sub_811A138 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - beq _0809BF8C - movs r0, 0x8 - ands r0, r5 - cmp r0, 0 - beq _0809BF5C - ldrb r0, [r4] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r4] -_0809BF5C: - movs r0, 0x4 - ands r0, r5 - cmp r0, 0 - beq _0809BF6C - ldrb r0, [r4] - movs r1, 0x8 - orrs r0, r1 - strb r0, [r4] -_0809BF6C: - movs r0, 0x1 - ands r0, r5 - cmp r0, 0 - beq _0809BF7C - ldrb r0, [r4] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r4] -_0809BF7C: - movs r0, 0x2 - ands r0, r5 - cmp r0, 0 - beq _0809BF8C - ldrb r0, [r4] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r4] -_0809BF8C: - movs r0, 0xF0 - mov r1, r8 - ands r0, r1 - cmp r0, 0 - beq _0809BFA2 - ldrb r0, [r4] - movs r1, 0x10 - orrs r0, r1 - movs r1, 0x20 - orrs r0, r1 - strb r0, [r4] -_0809BFA2: - cmp r7, 0 - bne _0809BFC8 - cmp r6, 0x2 - bne _0809BFB8 - mov r0, r9 - cmp r0, 0x2 - bne _0809BFB8 - ldrb r0, [r4] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r4] -_0809BFB8: - cmp r7, 0 - bne _0809BFC8 - cmp r6, 0x2 - bne _0809BFC8 - ldrb r0, [r4] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] -_0809BFC8: - movs r0, 0x40 - mov r1, r8 - ands r0, r1 - cmp r0, 0 - beq _0809BFDC - movs r0, 0x2 - b _0809C004 - .pool -_0809BFDC: - movs r0, 0x80 - mov r1, r8 - ands r0, r1 - cmp r0, 0 - beq _0809BFEA - movs r0, 0x1 - b _0809C004 -_0809BFEA: - movs r0, 0x20 - mov r1, r8 - ands r0, r1 - cmp r0, 0 - beq _0809BFF8 - movs r0, 0x3 - b _0809C004 -_0809BFF8: - movs r0, 0x10 - mov r1, r8 - ands r0, r1 - cmp r0, 0 - beq _0809C006 - movs r0, 0x4 -_0809C004: - strb r0, [r4, 0x2] -_0809C006: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end process_overworld_input - - thumb_func_start sub_809C014 -@ int sub_809C014(overworld_input_data *input_data) -sub_809C014: @ 809C014 - push {r4-r6,lr} - sub sp, 0x8 - adds r5, r0, 0 - ldr r0, =0x020375f2 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x03005df0 - strb r1, [r0] - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r6, r0, 24 - mov r4, sp - mov r0, sp - bl player_get_pos_to_and_height - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0x2 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 16 - lsrs r4, r0, 16 - bl CheckForTrainersWantingBattle - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809C14E - bl mapheader_run_first_tag2_script_list_match - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809C14E - ldrb r1, [r5] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0809C070 - bl sub_809C89C - cmp r0, 0x1 - beq _0809C14E -_0809C070: - ldrb r1, [r5] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0809C096 - movs r0, 0x5 - bl sav12_xor_increment - bl increment_var_x4026_on_birth_island_modulo_100 - mov r0, sp - adds r1, r4, 0 - adds r2, r6, 0 - bl sub_809C8DC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809C14E -_0809C096: - ldrb r1, [r5] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0809C0AE - adds r0, r4, 0 - bl is_it_battle_time_3 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809C14E -_0809C0AE: - ldrb r1, [r5] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0809C0D0 - ldrb r0, [r5, 0x2] - cmp r0, r6 - bne _0809C0D0 - mov r0, sp - adds r1, r4, 0 - adds r2, r6, 0 - bl mapheader_run_first_tag2_script_list_match_conditionally - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809C14E -_0809C0D0: - mov r4, sp - mov r0, sp - bl player_get_next_pos_and_height - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0x2 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 16 - lsrs r4, r0, 16 - ldrb r1, [r5] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0809C106 - mov r0, sp - adds r1, r4, 0 - adds r2, r6, 0 - bl sub_809C1FC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809C14E -_0809C106: - ldrb r1, [r5] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0809C128 - ldrb r0, [r5, 0x2] - cmp r0, r6 - bne _0809C128 - mov r0, sp - adds r1, r4, 0 - adds r2, r6, 0 - bl map_warp_consider_2_to_inside - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809C14E -_0809C128: - ldrb r1, [r5] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0809C13A - bl sub_809C868 - cmp r0, 0x1 - beq _0809C14E -_0809C13A: - ldrb r1, [r5] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0809C15C - movs r0, 0x6 - bl audio_play - bl sub_809FA9C -_0809C14E: - movs r0, 0x1 - b _0809C172 - .pool -_0809C15C: - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0809C170 - bl UseRegisteredKeyItemOnField - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809C14E -_0809C170: - movs r0, 0 -_0809C172: - add sp, 0x8 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_809C014 - - thumb_func_start player_get_pos_to_and_height -player_get_pos_to_and_height: @ 809C17C - push {r4,lr} - adds r4, r0, 0 - adds r1, r4, 0x2 - bl PlayerGetDestCoords - bl PlayerGetZCoord - strb r0, [r4, 0x4] - pop {r4} - pop {r0} - bx r0 - thumb_func_end player_get_pos_to_and_height - - thumb_func_start player_get_next_pos_and_height -player_get_next_pos_and_height: @ 809C194 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r1, r5, 0x2 - bl GetXYCoordsOneStepInFrontOfPlayer - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - bl MapGridGetZCoordAt - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _0809C1C6 - bl PlayerGetZCoord -_0809C1C6: - strb r0, [r5, 0x4] - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end player_get_next_pos_and_height - - thumb_func_start cur_mapdata_block_role_at_player_pos -cur_mapdata_block_role_at_player_pos: @ 809C1D0 - push {r4,lr} - sub sp, 0x4 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 16 - lsrs r0, 16 - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end cur_mapdata_block_role_at_player_pos - - thumb_func_start sub_809C1FC -sub_809C1FC: @ 809C1FC - push {r4,lr} - lsls r2, 24 - lsrs r2, 24 - lsls r1, 24 - lsrs r1, 24 - bl TryGetScriptOnPressingA - adds r4, r0, 0 - cmp r4, 0 - bne _0809C214 - movs r0, 0 - b _0809C24C -_0809C214: - ldr r0, =gUnknown_081F860D - cmp r4, r0 - beq _0809C244 - ldr r0, =gUnknown_081F9553 - cmp r4, r0 - beq _0809C244 - ldr r0, =gUnknown_0823B4BB - cmp r4, r0 - beq _0809C244 - ldr r0, =gUnknown_0823B589 - cmp r4, r0 - beq _0809C244 - ldr r0, =gUnknown_082766A2 - cmp r4, r0 - beq _0809C244 - ldr r0, =gUnknown_082766A6 - cmp r4, r0 - beq _0809C244 - ldr r0, =gUnknown_08271D92 - cmp r4, r0 - beq _0809C244 - movs r0, 0x5 - bl audio_play -_0809C244: - adds r0, r4, 0 - bl script_env_1_execute_new_script - movs r0, 0x1 -_0809C24C: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809C1FC - - thumb_func_start TryGetScriptOnPressingA -TryGetScriptOnPressingA: @ 809C270 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - mov r8, r5 - lsls r2, 24 - lsrs r4, r2, 24 - adds r7, r4, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl TryGetMapObjectScript - cmp r0, 0 - bne _0809C2BC - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl TryGetInvisibleMapObjectScript - cmp r0, 0 - bne _0809C2BC - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl TryGetMetatileBehaviorScript - cmp r0, 0 - bne _0809C2BC - adds r0, r6, 0 - mov r1, r8 - adds r2, r7, 0 - bl TryGetFieldMoveScript - cmp r0, 0 - bne _0809C2BC - movs r0, 0 -_0809C2BC: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end TryGetScriptOnPressingA - - thumb_func_start sub_809C2C8 -sub_809C2C8: @ 809C2C8 - push {r4-r6,lr} - adds r4, r0, 0 - lsls r2, 24 - lsrs r6, r2, 24 - movs r1, 0 - ldrsh r0, [r4, r1] - movs r2, 0x2 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl MetatileBehavior_IsCounter - lsls r0, 24 - cmp r0, 0 - bne _0809C2F0 - ldrh r0, [r4] - ldrh r1, [r4, 0x2] - b _0809C30E -_0809C2F0: - ldr r1, =gUnknown_08339D64 - lsls r2, r6, 3 - adds r0, r2, r1 - ldr r3, [r0] - ldrh r0, [r4] - adds r0, r3 - lsls r0, 16 - lsrs r0, 16 - adds r1, 0x4 - adds r2, r1 - ldr r2, [r2] - ldrh r1, [r4, 0x2] - adds r1, r2 - lsls r1, 16 - lsrs r1, 16 -_0809C30E: - ldrb r2, [r4, 0x4] - bl GetFieldObjectIdByXYZ - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x10 - beq _0809C32E - ldr r1, =0x02037350 - lsls r2, r3, 3 - adds r0, r2, r3 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x8] - adds r5, r1, 0 - cmp r0, 0xFF - bne _0809C33C -_0809C32E: - movs r0, 0 - b _0809C36E - .pool -_0809C33C: - movs r4, 0 - ldr r1, =0x02032308 -_0809C340: - ldrb r0, [r1] - cmp r0, 0x1 - bne _0809C34C - ldrb r0, [r1, 0x2] - cmp r0, r3 - beq _0809C32E -_0809C34C: - adds r1, 0x4 - adds r4, 0x1 - cmp r4, 0x3 - ble _0809C340 - ldr r0, =0x03005df0 - strb r3, [r0] - ldr r1, =0x020375f2 - adds r0, r2, r3 - lsls r0, 2 - adds r0, r5 - ldrb r0, [r0, 0x8] - strh r0, [r1] - ldr r0, =0x020375f4 - strh r6, [r0] - adds r0, r3, 0 - bl GetFieldObjectScriptPointerByFieldObjectId -_0809C36E: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809C2C8 - - thumb_func_start TryGetMapObjectScript -TryGetMapObjectScript: @ 809C384 - push {r4-r7,lr} - adds r5, r0, 0 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r7, r2, 24 - ldrh r0, [r5] - ldrh r1, [r5, 0x2] - ldrb r2, [r5, 0x4] - bl GetFieldObjectIdByXYZ - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x10 - beq _0809C3B4 - ldr r1, =0x02037350 - lsls r2, r4, 3 - adds r0, r2, r4 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x8] - adds r3, r1, 0 - cmp r0, 0xFF - bne _0809C40C -_0809C3B4: - adds r0, r6, 0 - bl MetatileBehavior_IsCounter - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C400 - ldr r1, =gUnknown_08339D64 - lsls r2, r7, 3 - adds r0, r2, r1 - ldr r3, [r0] - ldrh r0, [r5] - adds r0, r3 - lsls r0, 16 - lsrs r0, 16 - adds r1, 0x4 - adds r2, r1 - ldr r2, [r2] - ldrh r1, [r5, 0x2] - adds r1, r2 - lsls r1, 16 - lsrs r1, 16 - ldrb r2, [r5, 0x4] - bl GetFieldObjectIdByXYZ - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x10 - beq _0809C400 - ldr r1, =0x02037350 - lsls r2, r4, 3 - adds r0, r2, r4 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x8] - adds r3, r1, 0 - cmp r0, 0xFF - bne _0809C40C -_0809C400: - movs r0, 0 - b _0809C44E - .pool -_0809C40C: - ldr r0, =0x03005df0 - strb r4, [r0] - ldr r1, =0x020375f2 - adds r0, r2, r4 - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x8] - strh r0, [r1] - ldr r0, =0x020375f4 - strh r7, [r0] - bl InTrainerHill - cmp r0, 0x1 - bne _0809C43C - bl sub_81D62AC - b _0809C442 - .pool -_0809C43C: - adds r0, r4, 0 - bl GetFieldObjectScriptPointerByFieldObjectId -_0809C442: - adds r1, r0, 0 - ldr r0, =0x020375f2 - ldrb r0, [r0] - bl sub_8099188 - adds r1, r0, 0 -_0809C44E: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end TryGetMapObjectScript - - thumb_func_start TryGetInvisibleMapObjectScript -@ signed int TryGetInvisibleMapObjectScript(int a1, int a2, u8 playerFacingDirection) -TryGetInvisibleMapObjectScript: @ 809C458 - push {r4,r5,lr} - lsls r2, 24 - lsrs r5, r2, 24 - ldr r4, =0x02037318 - ldrh r1, [r0] - subs r1, 0x7 - lsls r1, 16 - lsrs r1, 16 - ldrh r2, [r0, 0x2] - subs r2, 0x7 - lsls r2, 16 - lsrs r2, 16 - ldrb r3, [r0, 0x4] - adds r0, r4, 0 - bl FindInvisibleMapObjectByPosition - cmp r0, 0 - beq _0809C4CC - ldr r2, [r0, 0x8] - cmp r2, 0 - bne _0809C490 - ldr r0, =gUnknown_082C8436 - b _0809C532 - .pool -_0809C490: - ldrb r0, [r0, 0x5] - cmp r0, 0x8 - bhi _0809C530 - lsls r0, 2 - ldr r1, =_0809C4A4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0809C4A4: - .4byte _0809C530 - .4byte _0809C4C8 - .4byte _0809C4D0 - .4byte _0809C4D6 - .4byte _0809C4DC - .4byte _0809C4E2 - .4byte _0809C4E2 - .4byte _0809C4E2 - .4byte _0809C510 -_0809C4C8: - cmp r5, 0x2 - beq _0809C530 -_0809C4CC: - movs r0, 0 - b _0809C532 -_0809C4D0: - cmp r5, 0x1 - beq _0809C530 - b _0809C4CC -_0809C4D6: - cmp r5, 0x4 - beq _0809C530 - b _0809C4CC -_0809C4DC: - cmp r5, 0x3 - beq _0809C530 - b _0809C4CC -_0809C4E2: - ldr r1, =0x020375e0 - lsrs r0, r2, 16 - movs r3, 0xFA - lsls r3, 1 - adds r0, r3 - strh r0, [r1] - ldr r0, =0x020375e2 - strh r2, [r0] - ldrh r0, [r1] - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809C4CC - ldr r0, =gUnknown_08271CB7 - b _0809C532 - .pool -_0809C510: - cmp r5, 0x2 - bne _0809C4CC - ldr r0, =0x020375e0 - strh r2, [r0] - bl sub_80E9680 - lsls r0, 24 - cmp r0, 0 - beq _0809C4CC - ldr r0, =gUnknown_082759F1 - b _0809C532 - .pool -_0809C530: - adds r0, r2, 0 -_0809C532: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end TryGetInvisibleMapObjectScript - - thumb_func_start TryGetMetatileBehaviorScript -TryGetMetatileBehaviorScript: @ 809C538 - push {r4-r6,lr} - adds r6, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r2, 24 - lsrs r4, r2, 24 - adds r0, r5, 0 - adds r1, r4, 0 - bl MetatileBehavior_IsPlayerFacingTVScreen - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C55C - ldr r0, =gUnknown_0827EE0B - b _0809C7E4 - .pool -_0809C55C: - adds r0, r5, 0 - bl MetatileBehavior_IsPC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C574 - ldr r0, =gUnknown_08271D92 - b _0809C7E4 - .pool -_0809C574: - adds r0, r5, 0 - bl is_tile_x8B - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C58C - ldr r0, =gUnknown_081E615D - b _0809C7E4 - .pool -_0809C58C: - adds r0, r5, 0 - bl is_tile_xEA - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C5A4 - ldr r0, =gUnknown_082393F9 - b _0809C7E4 - .pool -_0809C5A4: - adds r0, r5, 0 - bl is_tile_x84 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C5B4 - b _0809C6E4 -_0809C5B4: - adds r0, r5, 0 - bl is_tile_x87 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C5CC - ldr r0, =gUnknown_082A4BAC - b _0809C7E4 - .pool -_0809C5CC: - adds r0, r5, 0 - bl is_tile_x8C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C5E4 - ldr r0, =gUnknown_0826A22A - b _0809C7E4 - .pool -_0809C5E4: - adds r0, r5, 0 - bl is_tile_x85 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C5FC - ldr r0, =gUnknown_0827208F - b _0809C7E4 - .pool -_0809C5FC: - adds r0, r5, 0 - bl sub_8089A1C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C614 - ldr r0, =gUnknown_08292DE5 - b _0809C7E4 - .pool -_0809C614: - adds r0, r5, 0 - bl sub_8089A30 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C62C - ldr r0, =gUnknown_082725CE - b _0809C7E4 - .pool -_0809C62C: - adds r0, r5, 0 - bl sub_8089A44 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C644 - ldr r0, =gUnknown_082725D7 - b _0809C7E4 - .pool -_0809C644: - adds r0, r5, 0 - bl sub_8089A58 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C65C - ldr r0, =gUnknown_082725E0 - b _0809C7E4 - .pool -_0809C65C: - adds r0, r5, 0 - bl sub_8089A6C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C674 - ldr r0, =gUnknown_082725E9 - b _0809C7E4 - .pool -_0809C674: - adds r0, r5, 0 - bl sub_8089A80 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C68C - ldr r0, =gUnknown_082725F2 - b _0809C7E4 - .pool -_0809C68C: - adds r0, r5, 0 - bl sub_8089A94 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C6A4 - ldr r0, =gUnknown_082725FB - b _0809C7E4 - .pool -_0809C6A4: - adds r0, r5, 0 - bl sub_8089AA8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C6BC - ldr r0, =gUnknown_08272604 - b _0809C7E4 - .pool -_0809C6BC: - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8089AD0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C6D4 - ldr r0, =gUnknown_08277B8A - b _0809C7E4 - .pool -_0809C6D4: - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8089AEC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C6EC -_0809C6E4: - ldr r0, =gUnknown_08277365 - b _0809C7E4 - .pool -_0809C6EC: - adds r0, r5, 0 - bl MetatileBehavior_IsQuestionnaire - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C704 - ldr r0, =gUnknown_0827381B - b _0809C7E4 - .pool -_0809C704: - adds r0, r5, 0 - bl MetatileBehavior_IsTrainerHillTimer - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C71C - ldr r0, =gUnknown_082C8393 - b _0809C7E4 - .pool -_0809C71C: - movs r4, 0x4 - ldrsb r4, [r6, r4] - movs r1, 0 - ldrsh r0, [r6, r1] - movs r2, 0x2 - ldrsh r1, [r6, r2] - bl MapGridGetZCoordAt - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bne _0809C7D0 - adds r0, r5, 0 - bl sub_8089288 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C74C - ldr r0, =gUnknown_0823B4BB - b _0809C7E4 - .pool -_0809C74C: - adds r0, r5, 0 - bl sub_808929C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C764 - ldr r0, =gUnknown_0823B589 - b _0809C7E4 - .pool -_0809C764: - adds r0, r5, 0 - bl sub_80893DC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C77C - ldr r0, =gUnknown_0823B684 - b _0809C7E4 - .pool -_0809C77C: - adds r0, r5, 0 - bl sub_80893F0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C794 - ldr r0, =gUnknown_0823B68C - b _0809C7E4 - .pool -_0809C794: - adds r0, r5, 0 - bl sub_80892EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C7A8 - bl sub_80EB56C - b _0809C7E2 -_0809C7A8: - adds r0, r5, 0 - bl sub_8089364 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C7BC - bl sub_80EB9E0 - b _0809C7E2 -_0809C7BC: - adds r0, r5, 0 - bl sub_8089350 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C7E2 - bl sub_80EBB28 - b _0809C7E2 -_0809C7D0: - adds r0, r5, 0 - bl sub_8089300 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C7E2 - bl sub_80EB498 -_0809C7E2: - movs r0, 0 -_0809C7E4: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end TryGetMetatileBehaviorScript - - thumb_func_start TryGetFieldMoveScript -TryGetFieldMoveScript: @ 809C7EC - push {r4,lr} - lsls r1, 24 - lsrs r4, r1, 24 - ldr r0, =0x0000086b - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C824 - bl PartyHasMonWithSurf - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C824 - bl IsPlayerFacingSurfableFishableWater - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C824 - ldr r0, =gUnknown_08271EA0 - b _0809C862 - .pool -_0809C824: - adds r0, r4, 0 - bl MetatileBehavior_IsWaterfall - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C860 - ldr r0, =0x0000086e - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C858 - bl IsPlayerSurfingNorth - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C858 - ldr r0, =gUnknown_08290A49 - b _0809C862 - .pool -_0809C858: - ldr r0, =gUnknown_08290A83 - b _0809C862 - .pool -_0809C860: - movs r0, 0 -_0809C862: - pop {r4} - pop {r1} - bx r1 - thumb_func_end TryGetFieldMoveScript - - thumb_func_start sub_809C868 -sub_809C868: @ 809C868 - push {lr} - ldr r0, =0x0000086d - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0809C894 - bl sub_809D1E8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _0809C894 - ldr r0, =gUnknown_08290B0F - bl script_env_1_execute_new_script - movs r0, 0x1 - b _0809C896 - .pool -_0809C894: - movs r0, 0 -_0809C896: - pop {r1} - bx r1 - thumb_func_end sub_809C868 - - thumb_func_start sub_809C89C -sub_809C89C: @ 809C89C - push {lr} - ldr r0, =0x0000086d - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0809C8D4 - ldr r0, =0x02037318 - ldrb r0, [r0, 0x17] - cmp r0, 0x5 - bne _0809C8D4 - bl sub_809D1E8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C8D4 - ldr r0, =gUnknown_08290B5A - bl script_env_1_execute_new_script - movs r0, 0x1 - b _0809C8D6 - .pool -_0809C8D4: - movs r0, 0 -_0809C8D6: - pop {r1} - bx r1 - thumb_func_end sub_809C89C - - thumb_func_start sub_809C8DC -sub_809C8DC: @ 809C8DC - push {r4-r6,lr} - adds r5, r0, 0 - lsls r1, 16 - lsrs r4, r1, 16 - adds r6, r4, 0 - bl mapheader_trigger_activate_at__run_now - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809C92E - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_809CC9C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809C92E - adds r0, r4, 0 - bl sub_809C96C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809C92E - adds r0, r6, 0 - bl per_step_scripts - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809C92E - bl sub_80B5870 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809C92E - movs r0, 0 - b _0809C930 -_0809C92E: - movs r0, 0x1 -_0809C930: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_809C8DC - - thumb_func_start mapheader_trigger_activate_at__run_now -mapheader_trigger_activate_at__run_now: @ 809C938 - push {r4,lr} - ldr r4, =0x02037318 - ldrh r1, [r0] - subs r1, 0x7 - lsls r1, 16 - lsrs r1, 16 - ldrh r2, [r0, 0x2] - subs r2, 0x7 - lsls r2, 16 - lsrs r2, 16 - ldrb r3, [r0, 0x4] - adds r0, r4, 0 - bl mapheader_trigger_activate_at - cmp r0, 0 - beq _0809C964 - bl script_env_1_execute_new_script - movs r0, 0x1 - b _0809C966 - .pool -_0809C964: - movs r0, 0 -_0809C966: - pop {r4} - pop {r1} - bx r1 - thumb_func_end mapheader_trigger_activate_at__run_now - - thumb_func_start sub_809C96C -sub_809C96C: @ 809C96C - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_8089918 - lsls r0, 24 - cmp r0, 0 - beq _0809C988 - ldr r0, =gUnknown_082A8337 - b _0809C996 - .pool -_0809C988: - adds r0, r4, 0 - bl sub_8089ABC - lsls r0, 24 - cmp r0, 0 - beq _0809C9A4 - ldr r0, =gUnknown_08252BE8 -_0809C996: - bl script_env_1_execute_new_script - movs r0, 0x1 - b _0809C9EA - .pool -_0809C9A4: - adds r0, r4, 0 - bl sub_80893C8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C9B8 - bl sub_80FA9D0 - b _0809C9E8 -_0809C9B8: - adds r0, r4, 0 - bl sub_80893B4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C9E8 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileIdAt - lsls r0, 16 - asrs r0, 16 - bl sub_80FA970 -_0809C9E8: - movs r0, 0 -_0809C9EA: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_809C96C - - thumb_func_start per_step_scripts -per_step_scripts: @ 809C9F4 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - bl InUnionRoom - cmp r0, 0x1 - bne _0809CA04 - b _0809CB24 -_0809CA04: - bl sub_80B215C - bl happiness_algorithm_step - bl sub_81D4998 - ldr r0, =0x02037590 - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0809CAF8 - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_808904C - lsls r0, 24 - cmp r0, 0 - bne _0809CAF8 - bl overworld_poison_step - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809CA48 - ldr r0, =gUnknown_082736BC - bl script_env_1_execute_new_script - b _0809CB28 - .pool -_0809CA48: - bl sub_8070BD0 - lsls r0, 24 - cmp r0, 0 - beq _0809CA64 - movs r0, 0xD - bl sav12_xor_increment - ldr r0, =gUnknown_08291FC0 - bl script_env_1_execute_new_script - b _0809CB28 - .pool -_0809CA64: - bl sub_813B3B0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809CA7C - ldr r0, =gUnknown_08273D1F - bl script_env_1_execute_new_script - b _0809CB28 - .pool -_0809CA7C: - bl sub_8179A04 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809CA94 - ldr r0, =gUnknown_08238EAF - bl script_env_1_execute_new_script - b _0809CB28 - .pool -_0809CA94: - bl is_tile_that_overrides_player_control - cmp r0, 0x1 - bne _0809CAA8 - ldr r0, =gUnknown_081DF7BA - bl script_env_1_execute_new_script - b _0809CB28 - .pool -_0809CAA8: - bl sub_8138120 - cmp r0, 0x1 - bne _0809CABC - ldr r0, =gUnknown_081F49EC - bl script_env_1_execute_new_script - b _0809CB28 - .pool -_0809CABC: - bl sub_8138168 - cmp r0, 0x1 - bne _0809CAD0 - ldr r0, =gUnknown_081FA4D6 - bl script_env_1_execute_new_script - b _0809CB28 - .pool -_0809CAD0: - bl sub_81381B0 - cmp r0, 0x1 - bne _0809CAE4 - ldr r0, =gUnknown_0821307B - bl script_env_1_execute_new_script - b _0809CB28 - .pool -_0809CAE4: - bl sub_81381F8 - cmp r0, 0x1 - bne _0809CAF8 - ldr r0, =gUnknown_08224175 - bl script_env_1_execute_new_script - b _0809CB28 - .pool -_0809CAF8: - bl safari_step - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809CB28 - movs r0, 0x1 - bl sub_8137FC0 - cmp r0, 0x1 - bne _0809CB1C - ldr r0, =gUnknown_0823C050 - bl script_env_1_execute_new_script - b _0809CB28 - .pool -_0809CB1C: - bl sub_8196034 - cmp r0, 0 - bne _0809CB28 -_0809CB24: - movs r0, 0 - b _0809CB2A -_0809CB28: - movs r0, 0x1 -_0809CB2A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end per_step_scripts - - thumb_func_start sub_809CB30 -sub_809CB30: @ 809CB30 - push {lr} - ldr r0, =0x0000402a - movs r1, 0 - bl VarSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_809CB30 - - thumb_func_start happiness_algorithm_step -happiness_algorithm_step: @ 809CB44 - push {r4,r5,lr} - ldr r0, =0x0000402a - bl GetVarPointer - ldrh r1, [r0] - adds r1, 0x1 - strh r1, [r0] - ldrh r1, [r0] - movs r2, 0x7F - ands r1, r2 - strh r1, [r0] - cmp r1, 0 - bne _0809CB72 - ldr r5, =0x020244ec - movs r4, 0x5 -_0809CB62: - adds r0, r5, 0 - movs r1, 0x5 - bl happiness_algorithm - adds r5, 0x64 - subs r4, 0x1 - cmp r4, 0 - bge _0809CB62 -_0809CB72: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end happiness_algorithm_step - - thumb_func_start overworld_poison_timer_set -overworld_poison_timer_set: @ 809CB80 - push {lr} - ldr r0, =0x0000402b - movs r1, 0 - bl VarSet - pop {r0} - bx r0 - .pool - thumb_func_end overworld_poison_timer_set - - thumb_func_start overworld_poison_step -overworld_poison_step: @ 809CB94 - push {lr} - ldr r0, =0x02037318 - ldrb r0, [r0, 0x17] - cmp r0, 0x9 - beq _0809CBD4 - ldr r0, =0x0000402b - bl GetVarPointer - ldrh r1, [r0] - adds r1, 0x1 - strh r1, [r0] - ldrh r1, [r0] - movs r2, 0x3 - ands r1, r2 - strh r1, [r0] - cmp r1, 0 - bne _0809CBD4 - bl overworld_poison - cmp r0, 0x1 - beq _0809CBD4 - cmp r0, 0x1 - ble _0809CBD4 - cmp r0, 0x2 - bne _0809CBD4 - movs r0, 0x1 - b _0809CBD6 - .pool -_0809CBD4: - movs r0, 0 -_0809CBD6: - pop {r1} - bx r1 - thumb_func_end overworld_poison_step - - thumb_func_start prev_quest_postbuffer_cursor_backup_reset -prev_quest_postbuffer_cursor_backup_reset: @ 809CBDC - ldr r1, =0x020375d4 - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end prev_quest_postbuffer_cursor_backup_reset - - thumb_func_start is_it_battle_time_3 -is_it_battle_time_3: @ 809CBE8 - push {r4-r7,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r7, r4, 0 - ldr r6, =0x020375d4 - ldrb r0, [r6] - cmp r0, 0x3 - bhi _0809CC0C - adds r0, 0x1 - strb r0, [r6] - ldr r0, =0x020375d6 - strh r4, [r0] - movs r0, 0 - b _0809CC30 - .pool -_0809CC0C: - ldr r5, =0x020375d6 - ldrh r1, [r5] - adds r0, r4, 0 - bl is_it_battle_time_2 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809CC28 - strh r4, [r5] - movs r0, 0 - b _0809CC30 - .pool -_0809CC28: - movs r0, 0 - strb r0, [r6] - strh r7, [r5] - movs r0, 0x1 -_0809CC30: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end is_it_battle_time_3 - - thumb_func_start mapheader_run_first_tag2_script_list_match_conditionally -mapheader_run_first_tag2_script_list_match_conditionally: @ 809CC38 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r7, r0, 0 - adds r4, r1, 0 - adds r5, r2, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =0x02037318 - mov r8, r0 - adds r1, r7, 0 - bl map_warp_check_packed - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl is_non_stair_warp_tile - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809CC90 - lsls r0, r6, 24 - asrs r4, r0, 24 - movs r0, 0x1 - negs r0, r0 - cmp r4, r0 - beq _0809CC90 - bl walkrun_find_lowest_active_bit_in_bitfield - mov r0, r8 - adds r1, r4, 0 - adds r2, r7, 0 - bl sub_809CEB0 - bl sub_80AF734 - movs r0, 0x1 - b _0809CC92 - .pool -_0809CC90: - movs r0, 0 -_0809CC92: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end mapheader_run_first_tag2_script_list_match_conditionally - - thumb_func_start sub_809CC9C -sub_809CC9C: @ 809CC9C - push {r4-r7,lr} - adds r6, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - ldr r7, =0x02037318 - adds r0, r7, 0 - adds r1, r6, 0 - bl map_warp_check_packed - lsls r0, 24 - asrs r4, r0, 24 - movs r0, 0x1 - negs r0, r0 - cmp r4, r0 - beq _0809CD8A - adds r0, r5, 0 - bl is_warp_tile - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809CD8A - bl walkrun_find_lowest_active_bit_in_bitfield - adds r0, r7, 0 - adds r1, r4, 0 - adds r2, r6, 0 - bl sub_809CEB0 - lsls r0, r5, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl MetatileBehavior_IsEscalator - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809CCF8 - adds r0, r4, 0 - bl sub_80AF80C - movs r0, 0x1 - b _0809CD8C - .pool -_0809CCF8: - adds r0, r4, 0 - bl sub_8089870 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809CD0E - bl sub_80AF828 - movs r0, 0x1 - b _0809CD8C -_0809CD0E: - adds r0, r4, 0 - bl is_role_x68 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809CD24 - bl sub_80AF838 - movs r0, 0x1 - b _0809CD8C -_0809CD24: - adds r0, r4, 0 - bl MetatileBehavior_IsAquaHideoutWarp - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809CD3A - bl sub_80AF848 - movs r0, 0x1 - b _0809CD8C -_0809CD3A: - adds r0, r4, 0 - bl sub_80898AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809CD50 - bl sub_80B0268 - movs r0, 0x1 - b _0809CD8C -_0809CD50: - adds r0, r4, 0 - bl sub_8089904 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809CD6C - ldr r0, =gUnknown_082A8350 - bl script_env_1_execute_new_script - movs r0, 0x1 - b _0809CD8C - .pool -_0809CD6C: - adds r0, r4, 0 - bl sub_80898C0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809CD82 - bl sub_80AF87C - movs r0, 0x1 - b _0809CD8C -_0809CD82: - bl sub_80AF734 - movs r0, 0x1 - b _0809CD8C -_0809CD8A: - movs r0, 0 -_0809CD8C: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_809CC9C - - thumb_func_start is_warp_tile -is_warp_tile: @ 809CD94 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl is_tile_x69_2_warp_door - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809CE2A - adds r0, r4, 0 - bl MetatileBehavior_IsLadder - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809CE2A - adds r0, r4, 0 - bl MetatileBehavior_IsEscalator - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809CE2A - adds r0, r4, 0 - bl sub_8088F58 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809CE2A - adds r0, r4, 0 - bl sub_8089870 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809CE2A - adds r0, r4, 0 - bl is_role_x68 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809CE2A - adds r0, r4, 0 - bl MetatileBehavior_IsAquaHideoutWarp - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809CE2A - adds r0, r4, 0 - bl sub_8089904 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809CE2A - adds r0, r4, 0 - bl sub_80898C0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809CE2A - adds r0, r4, 0 - bl sub_80898AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809CE2A - movs r0, 0 - b _0809CE2C -_0809CE2A: - movs r0, 0x1 -_0809CE2C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end is_warp_tile - - thumb_func_start is_non_stair_warp_tile -is_non_stair_warp_tile: @ 809CE34 - push {lr} - lsls r0, 16 - lsrs r0, 16 - lsls r1, 24 - lsrs r1, 24 - adds r2, r1, 0 - cmp r1, 0x2 - beq _0809CE58 - cmp r1, 0x2 - bgt _0809CE4E - cmp r1, 0x1 - beq _0809CE62 - b _0809CE84 -_0809CE4E: - cmp r2, 0x3 - beq _0809CE6C - cmp r2, 0x4 - beq _0809CE76 - b _0809CE84 -_0809CE58: - lsls r0, 24 - lsrs r0, 24 - bl MetatileBehavior_IsNorthArrowWarp - b _0809CE7E -_0809CE62: - lsls r0, 24 - lsrs r0, 24 - bl MetatileBehavior_IsSouthArrowWarp - b _0809CE7E -_0809CE6C: - lsls r0, 24 - lsrs r0, 24 - bl MetatileBehavior_IsWestArrowWarp - b _0809CE7E -_0809CE76: - lsls r0, 24 - lsrs r0, 24 - bl MetatileBehavior_IsEastArrowWarp -_0809CE7E: - lsls r0, 24 - lsrs r0, 24 - b _0809CE86 -_0809CE84: - movs r0, 0 -_0809CE86: - pop {r1} - bx r1 - thumb_func_end is_non_stair_warp_tile - - thumb_func_start map_warp_check_packed -map_warp_check_packed: @ 809CE8C - push {lr} - adds r3, r1, 0 - ldrh r1, [r3] - subs r1, 0x7 - lsls r1, 16 - lsrs r1, 16 - ldrh r2, [r3, 0x2] - subs r2, 0x7 - lsls r2, 16 - lsrs r2, 16 - ldrb r3, [r3, 0x4] - bl map_warp_check - lsls r0, 24 - asrs r0, 24 - pop {r1} - bx r1 - thumb_func_end map_warp_check_packed - - thumb_func_start sub_809CEB0 -sub_809CEB0: @ 809CEB0 - push {r4-r7,lr} - adds r7, r2, 0 - lsls r1, 24 - lsrs r4, r1, 24 - bl GetCurrentTrainerHillMapId - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - cmp r5, 0 - beq _0809CF00 - bl sub_81D6490 - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - bne _0809CEF0 - lsls r0, r4, 24 - adds r4, r0, 0 - cmp r4, 0 - bne _0809CEE8 - ldr r0, =0x02037318 - ldr r0, [r0, 0x4] - ldr r5, [r0, 0x8] - b _0809CF0E - .pool -_0809CEE8: - bl sub_81D6120 - adds r5, r0, 0 - b _0809CF0E -_0809CEF0: - cmp r6, 0x5 - bne _0809CF00 - lsls r4, 24 - lsrs r0, r4, 24 - bl sub_81D6134 - adds r5, r0, 0 - b _0809CF0E -_0809CF00: - ldr r0, =0x02037318 - ldr r0, [r0, 0x4] - lsls r2, r4, 24 - asrs r1, r2, 21 - ldr r0, [r0, 0x8] - adds r5, r0, r1 - adds r4, r2, 0 -_0809CF0E: - ldrb r0, [r5, 0x6] - cmp r0, 0x7F - bne _0809CF20 - ldrb r0, [r5, 0x5] - bl copy_saved_warp2_bank_and_enter_x_to_warp1 - b _0809CF6E - .pool -_0809CF20: - movs r0, 0x7 - ldrsb r0, [r5, r0] - movs r1, 0x6 - ldrsb r1, [r5, r1] - movs r2, 0x5 - ldrsb r2, [r5, r2] - bl warp1_set_2 - movs r1, 0 - ldrsh r0, [r7, r1] - movs r2, 0x2 - ldrsh r1, [r7, r2] - bl sub_8084D5C - ldrb r0, [r5, 0x7] - ldrb r1, [r5, 0x6] - bl get_mapheader_by_bank_and_number - ldr r1, [r0, 0x4] - ldrb r0, [r5, 0x5] - ldr r1, [r1, 0x8] - lsls r0, 3 - adds r0, r1 - ldrb r0, [r0, 0x6] - cmp r0, 0x7F - bne _0809CF6E - asrs r3, r4, 24 - lsls r0, r3, 3 - adds r0, r1 - ldrb r0, [r0, 0x5] - ldr r1, =0x03005d8c - ldr r2, [r1] - movs r1, 0x4 - ldrsb r1, [r2, r1] - ldrb r2, [r2, 0x5] - lsls r2, 24 - asrs r2, 24 - bl saved_warp2_set -_0809CF6E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809CEB0 - - thumb_func_start map_warp_consider_2_to_inside -map_warp_consider_2_to_inside: @ 809CF78 - push {r4-r7,lr} - adds r5, r0, 0 - lsls r1, 16 - lsrs r0, r1, 16 - adds r7, r0, 0 - lsls r2, 24 - lsrs r2, 24 - cmp r2, 0x2 - bne _0809CFFC - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_8089210 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809CFB0 - ldr r0, =0x02037318 - ldr r1, [r0, 0x4] - adds r0, r5, 0 - bl sub_80E9668 - movs r0, 0x1 - b _0809CFFE - .pool -_0809CFB0: - adds r0, r4, 0 - bl is_tile_x69_2_warp_door - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809CFFC - ldr r6, =0x02037318 - adds r0, r6, 0 - adds r1, r5, 0 - bl map_warp_check_packed - lsls r0, 24 - asrs r4, r0, 24 - movs r0, 0x1 - negs r0, r0 - cmp r4, r0 - beq _0809CFFC - adds r0, r7, 0 - bl is_warp_tile - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809CFFC - bl walkrun_find_lowest_active_bit_in_bitfield - adds r0, r6, 0 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_809CEB0 - bl sub_80AF7D0 - movs r0, 0x1 - b _0809CFFE - .pool -_0809CFFC: - movs r0, 0 -_0809CFFE: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end map_warp_consider_2_to_inside - - thumb_func_start map_warp_check -map_warp_check: @ 809D004 - push {r4-r6,lr} - lsls r1, 16 - lsrs r6, r1, 16 - lsls r2, 16 - lsrs r5, r2, 16 - lsls r3, 24 - lsrs r4, r3, 24 - ldr r0, [r0, 0x4] - ldr r1, [r0, 0x8] - ldrb r3, [r0, 0x1] - movs r2, 0 - cmp r2, r3 - bge _0809D042 -_0809D01E: - ldrh r0, [r1] - cmp r0, r6 - bne _0809D03A - ldrh r0, [r1, 0x2] - cmp r0, r5 - bne _0809D03A - ldrb r0, [r1, 0x4] - cmp r0, r4 - beq _0809D034 - cmp r0, 0 - bne _0809D03A -_0809D034: - lsls r0, r2, 24 - asrs r0, 24 - b _0809D046 -_0809D03A: - adds r2, 0x1 - adds r1, 0x8 - cmp r2, r3 - blt _0809D01E -_0809D042: - movs r0, 0x1 - negs r0, r0 -_0809D046: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end map_warp_check - - thumb_func_start trigger_activate -trigger_activate: @ 809D04C - push {r4,lr} - adds r4, r0, 0 - cmp r4, 0 - beq _0809D082 - ldr r1, [r4, 0xC] - cmp r1, 0 - bne _0809D062 - ldrb r0, [r4, 0x6] - bl trigger_activate_weather - b _0809D082 -_0809D062: - ldrh r0, [r4, 0x6] - cmp r0, 0 - beq _0809D07C - ldrh r0, [r4, 0x6] - bl VarGet - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r4, 0x8] - cmp r0, r1 - bne _0809D082 - ldr r0, [r4, 0xC] - b _0809D084 -_0809D07C: - adds r0, r1, 0 - bl script_env_2_execute_new_script -_0809D082: - movs r0, 0 -_0809D084: - pop {r4} - pop {r1} - bx r1 - thumb_func_end trigger_activate - - thumb_func_start mapheader_trigger_activate_at -mapheader_trigger_activate_at: @ 809D08C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r1, 16 - lsrs r1, 16 - mov r10, r1 - lsls r2, 16 - lsrs r2, 16 - mov r9, r2 - lsls r3, 24 - lsrs r3, 24 - mov r8, r3 - ldr r0, [r0, 0x4] - ldr r1, [r0, 0xC] - ldrb r7, [r0, 0x2] - movs r6, 0 - cmp r6, r7 - bge _0809D0E2 - adds r5, r1, 0 - adds r4, r5, 0 -_0809D0B8: - ldrh r0, [r4] - cmp r0, r10 - bne _0809D0D8 - ldrh r0, [r4, 0x2] - cmp r0, r9 - bne _0809D0D8 - ldrb r0, [r4, 0x4] - cmp r0, r8 - beq _0809D0CE - cmp r0, 0 - bne _0809D0D8 -_0809D0CE: - adds r0, r5, 0 - bl trigger_activate - cmp r0, 0 - bne _0809D0E4 -_0809D0D8: - adds r4, 0x10 - adds r5, 0x10 - adds r6, 0x1 - cmp r6, r7 - blt _0809D0B8 -_0809D0E2: - movs r0, 0 -_0809D0E4: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end mapheader_trigger_activate_at - - thumb_func_start sub_809D0F4 -sub_809D0F4: @ 809D0F4 - push {r4,lr} - ldr r4, =0x02037318 - ldrh r1, [r0] - subs r1, 0x7 - lsls r1, 16 - lsrs r1, 16 - ldrh r2, [r0, 0x2] - subs r2, 0x7 - lsls r2, 16 - lsrs r2, 16 - ldrb r3, [r0, 0x4] - adds r0, r4, 0 - bl mapheader_trigger_activate_at - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809D0F4 - - thumb_func_start FindInvisibleMapObjectByPosition -@ int FindInvisibleMapObjectByPosition(struct mapheader *mapHeader, u16 x, u16 y, u8 elevation) -FindInvisibleMapObjectByPosition: @ 809D11C - push {r4-r7,lr} - lsls r1, 16 - lsrs r7, r1, 16 - lsls r2, 16 - lsrs r6, r2, 16 - lsls r3, 24 - lsrs r5, r3, 24 - ldr r0, [r0, 0x4] - ldr r4, [r0, 0x10] - ldrb r3, [r0, 0x3] - movs r2, 0 - cmp r2, r3 - bcs _0809D162 -_0809D136: - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r1, r0, r4 - ldrh r0, [r1] - cmp r0, r7 - bne _0809D158 - ldrh r0, [r1, 0x2] - cmp r0, r6 - bne _0809D158 - ldrb r0, [r1, 0x4] - cmp r0, r5 - beq _0809D154 - cmp r0, 0 - bne _0809D158 -_0809D154: - adds r0, r1, 0 - b _0809D164 -_0809D158: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, r3 - bcc _0809D136 -_0809D162: - movs r0, 0 -_0809D164: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end FindInvisibleMapObjectByPosition - - thumb_func_start dive_warp -dive_warp: @ 809D16C - push {r4,r5,lr} - adds r4, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - ldr r0, =0x02037318 - ldrb r0, [r0, 0x17] - cmp r0, 0x5 - bne _0809D1A4 - lsls r0, r5, 24 - lsrs r0, 24 - bl sub_80895D0 - lsls r0, 24 - cmp r0, 0 - bne _0809D1A4 - ldrh r0, [r4] - subs r0, 0x7 - lsls r0, 16 - lsrs r0, 16 - ldrh r1, [r4, 0x2] - subs r1, 0x7 - lsls r1, 16 - lsrs r1, 16 - bl sub_8085058 - b _0809D1C8 - .pool -_0809D1A4: - lsls r0, r5, 24 - lsrs r0, 24 - bl sub_80895B0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809D1E0 - ldrh r0, [r4] - subs r0, 0x7 - lsls r0, 16 - lsrs r0, 16 - ldrh r1, [r4, 0x2] - subs r1, 0x7 - lsls r1, 16 - lsrs r1, 16 - bl sub_8085078 -_0809D1C8: - lsls r0, 24 - cmp r0, 0 - beq _0809D1E0 - bl walkrun_find_lowest_active_bit_in_bitfield - bl sp13E_warp_to_last_warp - movs r0, 0xE9 - bl audio_play - movs r0, 0x1 - b _0809D1E2 -_0809D1E0: - movs r0, 0 -_0809D1E2: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end dive_warp - - thumb_func_start sub_809D1E8 -sub_809D1E8: @ 809D1E8 - push {r4,r5,lr} - sub sp, 0x4 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02037318 - ldrb r0, [r0, 0x17] - cmp r0, 0x5 - bne _0809D244 - adds r0, r5, 0 - bl sub_80895D0 - lsls r0, 24 - cmp r0, 0 - bne _0809D244 - mov r0, sp - ldrh r0, [r0] - subs r0, 0x7 - lsls r0, 16 - lsrs r0, 16 - ldrh r1, [r4] - subs r1, 0x7 - lsls r1, 16 - lsrs r1, 16 - bl sub_8085058 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809D274 - movs r0, 0x1 - b _0809D276 - .pool -_0809D244: - adds r0, r5, 0 - bl sub_80895B0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809D274 - mov r0, sp - ldrh r0, [r0] - subs r0, 0x7 - lsls r0, 16 - lsrs r0, 16 - ldrh r1, [r4] - subs r1, 0x7 - lsls r1, 16 - lsrs r1, 16 - bl sub_8085078 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809D274 - movs r0, 0x2 - b _0809D276 -_0809D274: - movs r0, 0 -_0809D276: - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_809D1E8 - - thumb_func_start GetFieldObjectScriptPointerForComparison -@ u8 *GetFieldObjectScriptPointerForComparison() -GetFieldObjectScriptPointerForComparison: @ 809D280 - push {r4,r5,lr} - sub sp, 0x8 - bl player_get_direction_upper_nybble - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - mov r5, sp - mov r0, sp - bl player_get_next_pos_and_height - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0x2 - ldrsh r1, [r5, r2] - bl MapGridGetMetatileBehaviorAt - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, sp - adds r2, r4, 0 - bl TryGetMapObjectScript - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end GetFieldObjectScriptPointerForComparison - - thumb_func_start sub_809D2BC -sub_809D2BC: @ 809D2BC - push {r4,lr} - sub sp, 0x8 - bl player_get_direction_upper_nybble - mov r4, sp - mov r0, sp - bl player_get_pos_to_and_height - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0x2 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileBehaviorAt - ldr r4, =0x02037318 - adds r0, r4, 0 - mov r1, sp - bl map_warp_check_packed - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - adds r0, r4, 0 - mov r2, sp - bl sub_809CEB0 - movs r0, 0 - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809D2BC - - thumb_func_start sub_809D300 -sub_809D300: @ 809D300 - push {r4,lr} - ldr r4, =0x03005d8c - ldr r0, [r4] - ldr r1, =0x00001270 - adds r0, r1 - movs r2, 0x96 - lsls r2, 1 - movs r1, 0 - bl memset - ldr r0, [r4] - ldr r1, =0x0000139c - adds r0, r1 - movs r2, 0x80 - lsls r2, 2 - movs r1, 0 - bl memset - ldr r0, =0x020375fc - movs r1, 0 - movs r2, 0x10 - bl memset - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D300 - - thumb_func_start sub_809D344 -sub_809D344: @ 809D344 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00001270 - adds r2, r0, r1 - movs r1, 0 - str r1, [r2] - ldr r1, =0x0000139c - adds r0, r1 - movs r1, 0 - movs r2, 0x20 - bl memset - ldr r0, =0x000008ad - bl FlagReset - ldr r0, =0x000008ae - bl FlagReset - ldr r0, =0x00000889 - bl FlagReset - ldr r0, =0x000008c1 - bl FlagReset - movs r0, 0x88 - lsls r0, 4 - bl FlagReset - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D344 - - thumb_func_start sub_809D3A0 -sub_809D3A0: @ 809D3A0 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00001394 - adds r0, r1 - movs r1, 0 - movs r2, 0x8 - bl memset - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D3A0 - - thumb_func_start sub_809D3C0 -sub_809D3C0: @ 809D3C0 - push {lr} - ldr r0, =0x00004046 - bl GetVarPointer - ldr r1, =0x03005d90 - ldr r2, [r1] - movs r1, 0 - strb r1, [r2, 0x1A] - strh r1, [r0] - ldr r0, =0x00000896 - bl FlagReset - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D3C0 - - thumb_func_start sub_809D3E8 -sub_809D3E8: @ 809D3E8 - push {r4,r5,lr} - ldr r0, =0x00004046 - bl GetVarPointer - ldr r4, =0x03005d90 - ldr r2, [r4] - movs r5, 0 - movs r1, 0xDA - strb r1, [r2, 0x1A] - ldr r2, =0x00000302 - adds r1, r2, 0 - strh r1, [r0] - ldr r0, =0x00000896 - bl FlagSet - ldr r1, [r4] - movs r0, 0x1 - strb r0, [r1, 0x19] - ldr r0, [r4] - strb r5, [r0, 0x18] - bl sub_80BB358 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D3E8 - - thumb_func_start sub_809D42C -sub_809D42C: @ 809D42C - push {lr} - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x1A] - cmp r0, 0xDA - bne _0809D468 - ldr r0, =0x00004046 - bl VarGet - lsls r0, 16 - ldr r1, =0x03020000 - cmp r0, r1 - bne _0809D468 - ldr r0, =0x00000896 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0809D468 - movs r0, 0x1 - b _0809D46A - .pool -_0809D468: - movs r0, 0 -_0809D46A: - pop {r1} - bx r1 - thumb_func_end sub_809D42C - - thumb_func_start sub_809D470 -sub_809D470: @ 809D470 - push {lr} - ldr r0, =0x000008ac - bl FlagReset - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D470 - - thumb_func_start sub_809D480 -sub_809D480: @ 809D480 - push {lr} - ldr r0, =0x000008ac - bl FlagSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D480 - - thumb_func_start sub_809D490 -sub_809D490: @ 809D490 - push {lr} - ldr r0, =0x000008ac - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_809D490 - - thumb_func_start sub_809D4A4 -sub_809D4A4: @ 809D4A4 - push {lr} - ldr r0, =0x000008db - bl FlagReset - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D4A4 - - thumb_func_start sub_809D4B4 -sub_809D4B4: @ 809D4B4 - push {lr} - ldr r0, =0x000008db - bl FlagSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D4B4 - - thumb_func_start sub_809D4C4 -sub_809D4C4: @ 809D4C4 - push {lr} - ldr r0, =0x000008db - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_809D4C4 - - thumb_func_start sub_809D4D8 -sub_809D4D8: @ 809D4D8 - push {lr} - movs r0, 0xF2 - lsls r0, 1 - bl FlagReset - ldr r0, =0x000001e5 - bl FlagReset - movs r0, 0xF3 - lsls r0, 1 - bl FlagReset - ldr r0, =0x000001e7 - bl FlagReset - movs r0, 0xF4 - lsls r0, 1 - bl FlagReset - ldr r0, =0x000001e9 - bl FlagReset - movs r0, 0xF5 - lsls r0, 1 - bl FlagReset - ldr r0, =0x000001eb - bl FlagReset - movs r0, 0xF6 - lsls r0, 1 - bl FlagReset - ldr r0, =0x000001ed - bl FlagReset - movs r0, 0xF7 - lsls r0, 1 - bl FlagReset - ldr r0, =0x000001ef - bl FlagReset - movs r0, 0xF8 - lsls r0, 1 - bl FlagReset - ldr r0, =0x000001f1 - bl FlagReset - movs r0, 0xF9 - lsls r0, 1 - bl FlagReset - ldr r0, =0x000001f3 - bl FlagReset - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D4D8 - - thumb_func_start sub_809D570 -sub_809D570: @ 809D570 - push {lr} - ldr r0, =0x000040dd - movs r1, 0 - bl VarSet - ldr r0, =0x000040de - movs r1, 0 - bl VarSet - ldr r0, =0x000040df - movs r1, 0 - bl VarSet - ldr r0, =0x000040e0 - movs r1, 0 - bl VarSet - ldr r0, =0x000040e1 - movs r1, 0 - bl VarSet - ldr r0, =0x000040e2 - movs r1, 0 - bl VarSet - ldr r0, =0x000040e3 - movs r1, 0 - bl VarSet - ldr r0, =0x000040e4 - movs r1, 0 - bl VarSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D570 - - thumb_func_start sub_809D5D8 -sub_809D5D8: @ 809D5D8 - push {lr} - ldr r0, =0x0000402c - movs r1, 0 - bl VarSet - ldr r0, =0x000008c2 - bl FlagReset - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D5D8 - - thumb_func_start sub_809D5F4 -sub_809D5F4: @ 809D5F4 - push {lr} - ldr r0, =0x0000402c - movs r1, 0x92 - lsls r1, 4 - bl VarSet - ldr r0, =0x000008c2 - bl FlagSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D5F4 - - thumb_func_start sub_809D614 -sub_809D614: @ 809D614 - push {lr} - ldr r0, =0x000008c2 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0809D640 - ldr r0, =0x0000402c - bl VarGet - lsls r0, 16 - movs r1, 0x92 - lsls r1, 20 - cmp r0, r1 - bne _0809D640 - movs r0, 0x1 - b _0809D642 - .pool -_0809D640: - movs r0, 0 -_0809D642: - pop {r1} - bx r1 - thumb_func_end sub_809D614 - - thumb_func_start GetVarPointer -@ u16 *GetVarPointer(u16 varId) -GetVarPointer: @ 809D648 - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - adds r2, r1, 0 - ldr r0, =0x00003fff - cmp r1, r0 - bhi _0809D660 - movs r0, 0 - b _0809D688 - .pool -_0809D660: - lsls r0, r1, 16 - cmp r0, 0 - bge _0809D67C - ldr r0, =gUnknown_081DBA0C - ldr r2, =0xffff8000 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - b _0809D688 - .pool -_0809D67C: - ldr r0, =0x03005d8c - lsls r1, r2, 1 - ldr r2, =0xffff939c - adds r1, r2 - ldr r0, [r0] - adds r0, r1 -_0809D688: - pop {r1} - bx r1 - .pool - thumb_func_end GetVarPointer - - thumb_func_start VarGet -@ u16 VarGet(u16 varId) -VarGet: @ 809D694 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - bl GetVarPointer - cmp r0, 0 - beq _0809D6A8 - ldrh r0, [r0] - b _0809D6AA -_0809D6A8: - adds r0, r4, 0 -_0809D6AA: - pop {r4} - pop {r1} - bx r1 - thumb_func_end VarGet - - thumb_func_start VarSet -@ bool8 VarSet(u16 varId, u16 value) -VarSet: @ 809D6B0 - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - lsls r1, 16 - lsrs r4, r1, 16 - bl GetVarPointer - cmp r0, 0 - beq _0809D6C8 - strh r4, [r0] - movs r0, 0x1 - b _0809D6CA -_0809D6C8: - movs r0, 0 -_0809D6CA: - pop {r4} - pop {r1} - bx r1 - thumb_func_end VarSet - - thumb_func_start VarGetFieldObjectGraphicsId -@ u8 VarGetFieldObjectGraphicsId(u8 index) -VarGetFieldObjectGraphicsId: @ 809D6D0 - push {lr} - lsls r0, 24 - lsrs r0, 8 - ldr r1, =0x40100000 - adds r0, r1 - lsrs r0, 16 - bl VarGet - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end VarGetFieldObjectGraphicsId - - thumb_func_start GetFlagPointer -@ u8 *GetFlagPointer(u16 flagId) -GetFlagPointer: @ 809D6EC - push {lr} - lsls r1, r0, 16 - lsrs r2, r1, 16 - adds r3, r2, 0 - cmp r2, 0 - bne _0809D6FC - movs r0, 0 - b _0809D72E -_0809D6FC: - ldr r0, =0x00003fff - cmp r2, r0 - bhi _0809D71C - ldr r0, =0x03005d8c - lsrs r1, 19 - ldr r2, =0x00001270 - adds r1, r2 - ldr r0, [r0] - b _0809D72C - .pool -_0809D71C: - ldr r1, =0xffffc000 - adds r0, r3, r1 - cmp r0, 0 - bge _0809D728 - ldr r2, =0xffffc007 - adds r0, r3, r2 -_0809D728: - asrs r0, 3 - ldr r1, =0x020375fc -_0809D72C: - adds r0, r1 -_0809D72E: - pop {r1} - bx r1 - .pool - thumb_func_end GetFlagPointer - - thumb_func_start FlagSet -@ bool8 FlagSet(u16 flagId) -FlagSet: @ 809D740 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - bl GetFlagPointer - adds r2, r0, 0 - cmp r2, 0 - beq _0809D760 - movs r0, 0x7 - ands r0, r4 - movs r1, 0x1 - lsls r1, r0 - ldrb r0, [r2] - orrs r1, r0 - strb r1, [r2] -_0809D760: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end FlagSet - - thumb_func_start FlagReset -@ bool8 FlagReset(u16 flagId) -FlagReset: @ 809D768 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - bl GetFlagPointer - adds r2, r0, 0 - cmp r2, 0 - beq _0809D788 - movs r0, 0x7 - ands r0, r4 - movs r1, 0x1 - lsls r1, r0 - ldrb r0, [r2] - bics r0, r1 - strb r0, [r2] -_0809D788: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end FlagReset - - thumb_func_start FlagGet -@ bool8 FlagGet(u16 flagId) -FlagGet: @ 809D790 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - bl GetFlagPointer - cmp r0, 0 - beq _0809D7B4 - ldrb r0, [r0] - movs r1, 0x7 - ands r1, r4 - asrs r0, r1 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0809D7B4 - movs r0, 0x1 - b _0809D7B6 -_0809D7B4: - movs r0, 0 -_0809D7B6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end FlagGet - - thumb_func_start sub_809D7BC -sub_809D7BC: @ 809D7BC - push {lr} - movs r0, 0x1 - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D7BC - - thumb_func_start sub_809D7C8 -sub_809D7C8: @ 809D7C8 - push {lr} - movs r0, 0x2 - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D7C8 - - thumb_func_start sub_809D7D4 -sub_809D7D4: @ 809D7D4 - push {lr} - movs r0, 0x3 - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D7D4 - - thumb_func_start sub_809D7E0 -sub_809D7E0: @ 809D7E0 - push {lr} - movs r0, 0x4 - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D7E0 - - thumb_func_start sub_809D7EC -sub_809D7EC: @ 809D7EC - push {lr} - movs r0, 0x5 - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D7EC - - thumb_func_start sub_809D7F8 -sub_809D7F8: @ 809D7F8 - push {lr} - movs r0, 0x6 - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D7F8 - - thumb_func_start sub_809D804 -sub_809D804: @ 809D804 - push {lr} - movs r0, 0x9 - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D804 - - thumb_func_start sub_809D810 -sub_809D810: @ 809D810 - push {lr} - movs r0, 0x7 - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D810 - - thumb_func_start sub_809D81C -sub_809D81C: @ 809D81C - push {lr} - movs r0, 0x8 - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D81C - - thumb_func_start sub_809D828 -sub_809D828: @ 809D828 - push {lr} - movs r0, 0xB - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D828 - - thumb_func_start sub_809D834 -sub_809D834: @ 809D834 - push {lr} - movs r0, 0xC - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D834 - - thumb_func_start sub_809D840 -sub_809D840: @ 809D840 - push {lr} - movs r0, 0x14 - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D840 - - thumb_func_start sub_809D84C -sub_809D84C: @ 809D84C - push {lr} - movs r0, 0x15 - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D84C - - thumb_func_start trigger_activate_weather -trigger_activate_weather: @ 809D858 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r2, 0 - ldr r3, =gUnknown_085102E0 -_0809D862: - lsls r1, r2, 3 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r4 - bne _0809D87C - adds r0, r3, 0x4 - adds r0, r1, r0 - ldr r0, [r0] - bl _call_via_r0 - b _0809D886 - .pool -_0809D87C: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xC - bls _0809D862 -_0809D886: - pop {r4} - pop {r0} - bx r0 - thumb_func_end trigger_activate_weather - - thumb_func_start task_per_step_callback_manager -task_per_step_callback_manager: @ 809D88C - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r2, 0x8 - ldrsh r1, [r1, r2] - ldr r2, =gUnknown_08510348 - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end task_per_step_callback_manager - - thumb_func_start sub_809D8B8 -sub_809D8B8: @ 809D8B8 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0809D8CA - cmp r0, 0x1 - beq _0809D8E8 - b _0809D8FC -_0809D8CA: - ldr r0, =0x030022c0 - ldr r0, [r0, 0x20] - movs r1, 0x80 - lsls r1, 5 - ands r0, r1 - cmp r0, 0 - beq _0809D8FC - bl sub_809E7B0 - ldrh r0, [r4] - adds r0, 0x1 - b _0809D8FA - .pool -_0809D8E8: - ldr r0, =0x030022c0 - ldr r0, [r0, 0x20] - movs r1, 0x80 - lsls r1, 5 - ands r0, r1 - cmp r0, 0 - bne _0809D8FC - ldrh r0, [r4] - subs r0, 0x1 -_0809D8FA: - strh r0, [r4] -_0809D8FC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D8B8 - - thumb_func_start sub_809D908 -sub_809D908: @ 809D908 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r4, r1, r0 - bl script_env_2_is_enabled - lsls r0, 24 - cmp r0, 0 - bne _0809D930 - adds r0, r4, 0 - bl sub_809D8B8 - adds r0, r4, 0x2 - adds r1, r4, 0x4 - bl wild_encounter_related -_0809D930: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D908 - - thumb_func_start overworld_ensure_per_step_coros_running -overworld_ensure_per_step_coros_running: @ 809D93C - push {r4,r5,lr} - ldr r5, =task_per_step_callback_manager - adds r0, r5, 0 - bl is_function_an_active_task - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _0809D966 - adds r0, r5, 0 - movs r1, 0x50 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] -_0809D966: - ldr r4, =sub_809E638 - adds r0, r4, 0 - bl is_function_an_active_task - lsls r0, 24 - cmp r0, 0 - bne _0809D97C - adds r0, r4, 0 - movs r1, 0x50 - bl AddTask -_0809D97C: - ldr r4, =sub_809D908 - adds r0, r4, 0 - bl is_function_an_active_task - lsls r0, 24 - cmp r0, 0 - bne _0809D992 - adds r0, r4, 0 - movs r1, 0x50 - bl AddTask -_0809D992: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end overworld_ensure_per_step_coros_running - - thumb_func_start activate_per_step_callback -activate_per_step_callback: @ 809D9A8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =task_per_step_callback_manager - bl get_task_id_by_function - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xFF - beq _0809D9EA - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r1, r0, r1 - movs r2, 0 - adds r0, r1, 0 - adds r0, 0x1E -_0809D9CC: - strh r2, [r0] - subs r0, 0x2 - cmp r0, r1 - bge _0809D9CC - cmp r4, 0x7 - bls _0809D9E8 - movs r0, 0 - strh r0, [r1] - b _0809D9EA - .pool -_0809D9E8: - strh r4, [r1] -_0809D9EA: - pop {r4} - pop {r0} - bx r0 - thumb_func_end activate_per_step_callback - - thumb_func_start wild_encounter_reset_coro_args -wild_encounter_reset_coro_args: @ 809D9F0 - push {lr} - ldr r0, =task_per_step_callback_manager - bl get_task_id_by_function - lsls r0, 24 - lsrs r1, r0, 24 - ldr r0, =sub_809D908 - bl get_task_id_by_function - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xFF - beq _0809DA1A - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x2] - strh r1, [r0, 0x4] -_0809DA1A: - pop {r0} - bx r0 - .pool - thumb_func_end wild_encounter_reset_coro_args - - thumb_func_start nullsub_34 -nullsub_34: @ 809DA2C - bx lr - thumb_func_end nullsub_34 - - thumb_func_start sub_809DA30 -sub_809DA30: @ 809DA30 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r1, 24 - lsrs r4, r1, 24 - adds r0, r4, 0 - bl sub_8089764 - lsls r0, 24 - cmp r0, 0 - beq _0809DA48 - adds r0, r5, 0 - b _0809DA80 -_0809DA48: - adds r0, r4, 0 - bl sub_8089778 - lsls r0, 24 - cmp r0, 0 - beq _0809DA5A - adds r0, r5, 0 - adds r0, 0x8 - b _0809DA80 -_0809DA5A: - adds r0, r4, 0 - bl sub_808978C - lsls r0, 24 - cmp r0, 0 - beq _0809DA6C - adds r0, r5, 0 - adds r0, 0x10 - b _0809DA80 -_0809DA6C: - adds r0, r4, 0 - bl sub_80897A0 - lsls r0, 24 - cmp r0, 0 - bne _0809DA7C - movs r0, 0 - b _0809DA80 -_0809DA7C: - adds r0, r5, 0 - adds r0, 0x18 -_0809DA80: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_809DA30 - - thumb_func_start sub_809DA88 -sub_809DA88: @ 809DA88 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - mov r8, r3 - lsls r1, 16 - asrs r6, r1, 16 - lsls r2, 16 - asrs r7, r2, 16 - adds r0, r6, 0 - adds r1, r7, 0 - bl MapGridGetMetatileBehaviorAt - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r5, 0 - bl sub_809DA30 - adds r4, r0, 0 - adds r5, r4, 0 - cmp r4, 0 - beq _0809DB06 - movs r0, 0 - ldrsb r0, [r4, r0] - adds r0, r6, r0 - movs r1, 0x1 - ldrsb r1, [r4, r1] - adds r1, r7, r1 - ldrh r2, [r4, 0x2] - bl MapGridSetMetatileIdAt - mov r0, r8 - cmp r0, 0 - beq _0809DADE - movs r0, 0 - ldrsb r0, [r4, r0] - adds r0, r6, r0 - movs r1, 0x1 - ldrsb r1, [r4, r1] - adds r1, r7, r1 - bl CurrentMapDrawMetatileAt -_0809DADE: - movs r0, 0x4 - ldrsb r0, [r5, r0] - adds r0, r6, r0 - movs r1, 0x5 - ldrsb r1, [r5, r1] - adds r1, r7, r1 - ldrh r2, [r5, 0x6] - bl MapGridSetMetatileIdAt - mov r0, r8 - cmp r0, 0 - beq _0809DB06 - movs r0, 0x4 - ldrsb r0, [r5, r0] - adds r0, r6, r0 - movs r1, 0x5 - ldrsb r1, [r5, r1] - adds r1, r7, r1 - bl CurrentMapDrawMetatileAt -_0809DB06: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_809DA88 - - thumb_func_start sub_809DB10 -sub_809DB10: @ 809DB10 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r3, r2, 0 - ldr r0, =gUnknown_08510368 - lsls r4, 16 - asrs r4, 16 - lsls r5, 16 - asrs r5, 16 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_809DA88 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809DB10 - - thumb_func_start sub_809DB34 -sub_809DB34: @ 809DB34 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r3, r2, 0 - ldr r0, =gUnknown_08510388 - lsls r4, 16 - asrs r4, 16 - lsls r5, 16 - asrs r5, 16 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_809DA88 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809DB34 - - thumb_func_start sub_809DB58 -sub_809DB58: @ 809DB58 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r3, r2, 0 - ldr r0, =gUnknown_085103A8 - lsls r4, 16 - asrs r4, 16 - lsls r5, 16 - asrs r5, 16 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_809DA88 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809DB58 - - thumb_func_start sub_809DB7C -sub_809DB7C: @ 809DB7C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - mov r10, r8 - lsls r1, 16 - lsrs r7, r1, 16 - mov r9, r7 - lsls r2, 16 - asrs r6, r2, 16 - lsls r3, 16 - asrs r5, r3, 16 - adds r0, r6, 0 - adds r1, r5, 0 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_8089764 - lsls r0, 24 - cmp r0, 0 - beq _0809DBC0 - lsls r0, r7, 16 - asrs r0, 16 - cmp r0, r5 - ble _0809DC06 -_0809DBBC: - movs r0, 0 - b _0809DC08 -_0809DBC0: - adds r0, r4, 0 - bl sub_8089778 - lsls r0, 24 - cmp r0, 0 - beq _0809DBD8 - mov r1, r9 - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, r5 - bge _0809DC06 - b _0809DBBC -_0809DBD8: - adds r0, r4, 0 - bl sub_808978C - lsls r0, 24 - cmp r0, 0 - beq _0809DBF0 - mov r1, r8 - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, r6 - ble _0809DC06 - b _0809DBBC -_0809DBF0: - adds r0, r4, 0 - bl sub_80897A0 - lsls r0, 24 - cmp r0, 0 - beq _0809DC06 - mov r1, r10 - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, r6 - blt _0809DBBC -_0809DC06: - movs r0, 0x1 -_0809DC08: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_809DB7C - - thumb_func_start sub_809DC18 -sub_809DC18: @ 809DC18 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r2, 16 - lsrs r2, 16 - mov r8, r2 - mov r10, r8 - lsls r3, 16 - lsrs r7, r3, 16 - mov r9, r7 - lsls r0, 16 - asrs r6, r0, 16 - lsls r1, 16 - asrs r5, r1, 16 - adds r0, r6, 0 - adds r1, r5, 0 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_8089764 - lsls r0, 24 - cmp r0, 0 - beq _0809DC5C - lsls r0, r7, 16 - asrs r0, 16 - cmp r5, r0 - bge _0809DCA2 -_0809DC58: - movs r0, 0 - b _0809DCA4 -_0809DC5C: - adds r0, r4, 0 - bl sub_8089778 - lsls r0, 24 - cmp r0, 0 - beq _0809DC74 - mov r1, r9 - lsls r0, r1, 16 - asrs r0, 16 - cmp r5, r0 - ble _0809DCA2 - b _0809DC58 -_0809DC74: - adds r0, r4, 0 - bl sub_808978C - lsls r0, 24 - cmp r0, 0 - beq _0809DC8C - mov r1, r8 - lsls r0, r1, 16 - asrs r0, 16 - cmp r6, r0 - bge _0809DCA2 - b _0809DC58 -_0809DC8C: - adds r0, r4, 0 - bl sub_80897A0 - lsls r0, 24 - cmp r0, 0 - beq _0809DCA2 - mov r1, r10 - lsls r0, r1, 16 - asrs r0, 16 - cmp r6, r0 - bgt _0809DC58 -_0809DCA2: - movs r0, 0x1 -_0809DCA4: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_809DC18 - - thumb_func_start sub_809DCB4 -sub_809DCB4: @ 809DCB4 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r4, r1, r0 - mov r5, sp - adds r5, 0x2 - mov r0, sp - adds r1, r5, 0 - bl PlayerGetDestCoords - movs r1, 0x2 - ldrsh r0, [r4, r1] - adds r6, r5, 0 - cmp r0, 0x1 - beq _0809DD0E - cmp r0, 0x1 - bgt _0809DCEC - cmp r0, 0 - beq _0809DCF2 - b _0809DE1E - .pool -_0809DCEC: - cmp r0, 0x2 - beq _0809DDDC - b _0809DE1E -_0809DCF2: - mov r0, sp - ldrh r0, [r0] - strh r0, [r4, 0x4] - ldrh r0, [r5] - strh r0, [r4, 0x6] - mov r0, sp - movs r2, 0 - ldrsh r0, [r0, r2] - movs r3, 0 - ldrsh r1, [r5, r3] - movs r2, 0x1 - bl sub_809DB34 - b _0809DE1A -_0809DD0E: - mov r0, sp - movs r7, 0 - ldrsh r1, [r0, r7] - movs r2, 0x4 - ldrsh r0, [r4, r2] - cmp r1, r0 - bne _0809DD28 - movs r3, 0 - ldrsh r1, [r5, r3] - movs r7, 0x6 - ldrsh r0, [r4, r7] - cmp r1, r0 - beq _0809DE1E -_0809DD28: - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r5, r2] - movs r3, 0x4 - ldrsh r2, [r4, r3] - movs r5, 0x6 - ldrsh r3, [r4, r5] - bl sub_809DB7C - cmp r0, 0 - beq _0809DD70 - movs r7, 0x4 - ldrsh r0, [r4, r7] - movs r2, 0x6 - ldrsh r1, [r4, r2] - movs r2, 0x1 - bl sub_809DB10 - movs r3, 0x4 - ldrsh r0, [r4, r3] - movs r5, 0x6 - ldrsh r1, [r4, r5] - movs r2, 0 - bl sub_809DB58 - ldrh r0, [r4, 0x4] - strh r0, [r4, 0x8] - ldrh r0, [r4, 0x6] - strh r0, [r4, 0xA] - movs r0, 0x2 - strh r0, [r4, 0x2] - movs r0, 0x8 - strh r0, [r4, 0xC] - b _0809DD7A -_0809DD70: - movs r7, 0x1 - negs r7, r7 - adds r0, r7, 0 - strh r0, [r4, 0x8] - strh r0, [r4, 0xA] -_0809DD7A: - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - adds r5, r6, 0 - movs r2, 0 - ldrsh r1, [r5, r2] - movs r3, 0x4 - ldrsh r2, [r4, r3] - movs r7, 0x6 - ldrsh r3, [r4, r7] - bl sub_809DC18 - cmp r0, 0 - beq _0809DDAE - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r5, r2] - movs r2, 0x1 - bl sub_809DB10 - movs r0, 0x2 - strh r0, [r4, 0x2] - movs r0, 0x8 - strh r0, [r4, 0xC] -_0809DDAE: - mov r0, sp - ldrh r0, [r0] - strh r0, [r4, 0x4] - ldrh r0, [r6] - strh r0, [r4, 0x6] - mov r0, sp - movs r3, 0 - ldrsh r0, [r0, r3] - movs r5, 0 - ldrsh r1, [r6, r5] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl MetatileBehavior_IsPacifidlogLog - lsls r0, 24 - cmp r0, 0 - beq _0809DE1E - movs r0, 0x46 - bl audio_play - b _0809DE1E -_0809DDDC: - ldrh r0, [r4, 0xC] - subs r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - cmp r0, 0 - bne _0809DE1E - mov r0, sp - movs r7, 0 - ldrsh r0, [r0, r7] - movs r2, 0 - ldrsh r1, [r5, r2] - movs r2, 0x1 - bl sub_809DB34 - movs r3, 0x8 - ldrsh r0, [r4, r3] - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _0809DE1A - movs r5, 0xA - ldrsh r0, [r4, r5] - cmp r0, r1 - beq _0809DE1A - movs r7, 0x8 - ldrsh r0, [r4, r7] - movs r2, 0xA - ldrsh r1, [r4, r2] - movs r2, 0x1 - bl sub_809DB58 -_0809DE1A: - movs r0, 0x1 - strh r0, [r4, 0x2] -_0809DE1E: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_809DCB4 - - thumb_func_start sub_809DE28 -sub_809DE28: @ 809DE28 - push {r4,r5,lr} - lsls r0, 16 - lsrs r4, r0, 16 - lsls r1, 16 - lsrs r5, r1, 16 - bl PlayerGetZCoord - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0809DE82 - lsls r0, r4, 16 - asrs r4, r0, 16 - lsls r0, r5, 16 - asrs r5, r0, 16 - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridGetMetatileIdAt - adds r1, r0, 0 - ldr r0, =0x0000024e - cmp r1, r0 - beq _0809DE68 - adds r0, 0x8 - cmp r1, r0 - beq _0809DE78 - b _0809DE82 - .pool -_0809DE68: - ldr r2, =0x0000024f - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridSetMetatileIdAt - b _0809DE82 - .pool -_0809DE78: - ldr r2, =0x00000257 - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridSetMetatileIdAt -_0809DE82: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809DE28 - - thumb_func_start sub_809DE8C -sub_809DE8C: @ 809DE8C - push {r4,r5,lr} - lsls r0, 16 - lsrs r4, r0, 16 - lsls r1, 16 - lsrs r5, r1, 16 - bl PlayerGetZCoord - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0809DEE6 - lsls r0, r4, 16 - asrs r4, r0, 16 - lsls r0, r5, 16 - asrs r5, r0, 16 - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridGetMetatileIdAt - adds r1, r0, 0 - ldr r0, =0x0000024f - cmp r1, r0 - beq _0809DECC - adds r0, 0x8 - cmp r1, r0 - beq _0809DEDC - b _0809DEE6 - .pool -_0809DECC: - ldr r2, =0x0000024e - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridSetMetatileIdAt - b _0809DEE6 - .pool -_0809DEDC: - ldr r2, =0x00000256 - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridSetMetatileIdAt -_0809DEE6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809DE8C - - thumb_func_start sub_809DEF0 -sub_809DEF0: @ 809DEF0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r6, r1, r0 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - movs r0, 0x2 - ldrsh r5, [r6, r0] - mov r9, r4 - cmp r5, 0x1 - beq _0809DF84 - cmp r5, 0x1 - bgt _0809DF30 - cmp r5, 0 - beq _0809DF38 - b _0809E0F6 - .pool -_0809DF30: - cmp r5, 0x2 - bne _0809DF36 - b _0809E064 -_0809DF36: - b _0809E0F6 -_0809DF38: - mov r0, sp - ldrh r0, [r0] - strh r0, [r6, 0x4] - mov r1, r9 - ldrh r0, [r1] - strh r0, [r6, 0x6] - mov r0, sp - movs r2, 0 - ldrsh r0, [r0, r2] - movs r3, 0 - ldrsh r1, [r1, r3] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl MetatileBehavior_IsFortreeBridge - lsls r0, 24 - cmp r0, 0 - bne _0809DF62 - b _0809E0F2 -_0809DF62: - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - mov r2, r9 - movs r3, 0 - ldrsh r1, [r2, r3] - bl sub_809DE28 - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - mov r2, r9 - movs r3, 0 - ldrsh r1, [r2, r3] - bl CurrentMapDrawMetatileAt - b _0809E0F2 -_0809DF84: - ldrh r0, [r6, 0x6] - mov r8, r0 - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - ldrh r2, [r6, 0x4] - mov r10, r2 - movs r3, 0x4 - ldrsh r7, [r6, r3] - cmp r0, r7 - bne _0809DFAC - mov r0, r9 - movs r2, 0 - ldrsh r1, [r0, r2] - mov r3, r8 - lsls r0, r3, 16 - asrs r0, 16 - cmp r1, r0 - bne _0809DFAC - b _0809E0F6 -_0809DFAC: - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - mov r2, r9 - movs r3, 0 - ldrsh r1, [r2, r3] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl MetatileBehavior_IsFortreeBridge - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - mov r0, r8 - lsls r4, r0, 16 - asrs r1, r4, 16 - adds r0, r7, 0 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl MetatileBehavior_IsFortreeBridge - lsls r0, 24 - lsrs r7, r0, 24 - bl PlayerGetZCoord - movs r1, 0 - ands r5, r0 - lsls r0, r5, 24 - adds r5, r4, 0 - cmp r0, 0 - bne _0809DFF4 - movs r1, 0x1 -_0809DFF4: - cmp r1, 0 - beq _0809E008 - ldr r1, [sp, 0x4] - cmp r1, 0x1 - beq _0809E002 - cmp r7, 0x1 - bne _0809E008 -_0809E002: - movs r0, 0x47 - bl audio_play -_0809E008: - cmp r7, 0 - beq _0809E044 - mov r2, r10 - lsls r4, r2, 16 - asrs r4, 16 - asrs r5, 16 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809DE8C - adds r0, r4, 0 - adds r1, r5, 0 - bl CurrentMapDrawMetatileAt - mov r0, sp - movs r3, 0 - ldrsh r0, [r0, r3] - mov r2, r9 - movs r3, 0 - ldrsh r1, [r2, r3] - bl sub_809DE28 - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - mov r2, r9 - movs r3, 0 - ldrsh r1, [r2, r3] - bl CurrentMapDrawMetatileAt -_0809E044: - mov r0, r10 - strh r0, [r6, 0x8] - mov r1, r8 - strh r1, [r6, 0xA] - mov r0, sp - ldrh r0, [r0] - strh r0, [r6, 0x4] - mov r2, r9 - ldrh r0, [r2] - strh r0, [r6, 0x6] - cmp r7, 0 - beq _0809E0F6 - movs r0, 0x10 - strh r0, [r6, 0xC] - movs r0, 0x2 - strh r0, [r6, 0x2] -_0809E064: - ldrh r0, [r6, 0xC] - subs r0, 0x1 - strh r0, [r6, 0xC] - ldrh r3, [r6, 0x8] - mov r10, r3 - ldrh r0, [r6, 0xA] - mov r8, r0 - movs r1, 0xC - ldrsh r0, [r6, r1] - movs r1, 0x7 - bl __modsi3 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - bhi _0809E0EA - lsls r0, 2 - ldr r1, =_0809E094 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0809E094: - .4byte _0809E0B4 - .4byte _0809E0EA - .4byte _0809E0EA - .4byte _0809E0EA - .4byte _0809E0C6 - .4byte _0809E0EA - .4byte _0809E0EA - .4byte _0809E0EA -_0809E0B4: - mov r2, r10 - lsls r0, r2, 16 - asrs r0, 16 - mov r3, r8 - lsls r1, r3, 16 - asrs r1, 16 - bl CurrentMapDrawMetatileAt - b _0809E0EA -_0809E0C6: - mov r0, r10 - lsls r5, r0, 16 - asrs r5, 16 - mov r1, r8 - lsls r4, r1, 16 - asrs r4, 16 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_809DE28 - adds r0, r5, 0 - adds r1, r4, 0 - bl CurrentMapDrawMetatileAt - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_809DE8C -_0809E0EA: - movs r2, 0xC - ldrsh r0, [r6, r2] - cmp r0, 0 - bne _0809E0F6 -_0809E0F2: - movs r0, 0x1 - strh r0, [r6, 0x2] -_0809E0F6: - 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_809DEF0 - - thumb_func_start sub_809E108 -sub_809E108: @ 809E108 - push {lr} - lsls r1, 16 - lsrs r1, 16 - lsls r0, 16 - ldr r2, =0xfffd0000 - adds r0, r2 - lsrs r0, 16 - cmp r0, 0xA - bhi _0809E144 - lsls r0, r1, 16 - asrs r1, r0, 16 - ldr r2, =0xfffa0000 - adds r0, r2 - lsrs r0, 16 - cmp r0, 0xD - bhi _0809E144 - ldr r0, =gUnknown_085103C8 - lsls r1, 1 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _0809E144 - movs r0, 0x1 - b _0809E146 - .pool -_0809E144: - movs r0, 0 -_0809E146: - pop {r1} - bx r1 - thumb_func_end sub_809E108 - - thumb_func_start sub_809E14C -sub_809E14C: @ 809E14C - push {r4,r5,lr} - lsls r0, 16 - asrs r5, r0, 16 - lsls r1, 16 - asrs r4, r1, 16 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_809E108 - cmp r0, 0 - beq _0809E17A - ldr r1, =gUnknown_085103C8 - lsls r0, r4, 1 - adds r0, r1 - ldrh r0, [r0] - bl GetVarPointer - subs r2, r5, 0x3 - movs r1, 0x1 - lsls r1, r2 - ldrh r2, [r0] - orrs r1, r2 - strh r1, [r0] -_0809E17A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809E14C - - thumb_func_start sub_809E184 -sub_809E184: @ 809E184 - push {r4,r5,lr} - lsls r0, 16 - asrs r5, r0, 16 - lsls r1, 16 - asrs r4, r1, 16 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_809E108 - cmp r0, 0 - beq _0809E1B6 - ldr r1, =gUnknown_085103C8 - lsls r0, r4, 1 - adds r0, r1 - ldrh r0, [r0] - bl VarGet - lsls r0, 16 - subs r2, r5, 0x3 - movs r1, 0x80 - lsls r1, 9 - lsls r1, r2 - ands r1, r0 - cmp r1, 0 - bne _0809E1C0 -_0809E1B6: - movs r0, 0 - b _0809E1C2 - .pool -_0809E1C0: - movs r0, 0x1 -_0809E1C2: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_809E184 - - thumb_func_start sub_809E1C8 -sub_809E1C8: @ 809E1C8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r0, =0x02037318 - ldr r0, [r0] - ldr r1, [r0] - mov r9, r1 - ldr r7, [r0, 0x4] - movs r5, 0 - cmp r5, r9 - bge _0809E210 -_0809E1E0: - movs r4, 0 - adds r0, r5, 0x1 - mov r8, r0 - cmp r4, r7 - bge _0809E20A - lsls r6, r5, 16 -_0809E1EC: - lsls r1, r4, 16 - asrs r1, 16 - asrs r0, r6, 16 - bl sub_809E184 - cmp r0, 0x1 - bne _0809E204 - adds r1, r4, 0x7 - adds r0, r5, 0x7 - ldr r2, =0x0000020e - bl MapGridSetMetatileIdAt -_0809E204: - adds r4, 0x1 - cmp r4, r7 - blt _0809E1EC -_0809E20A: - mov r5, r8 - cmp r5, r9 - blt _0809E1E0 -_0809E210: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809E1C8 - - thumb_func_start sub_809E224 -sub_809E224: @ 809E224 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r5, r1, r0 - movs r1, 0x2 - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _0809E270 - cmp r0, 0x1 - bgt _0809E24C - cmp r0, 0 - beq _0809E258 - b _0809E3A6 - .pool -_0809E24C: - cmp r0, 0x2 - beq _0809E306 - cmp r0, 0x3 - bne _0809E256 - b _0809E360 -_0809E256: - b _0809E3A6 -_0809E258: - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - mov r0, sp - ldrh r0, [r0] - strh r0, [r5, 0x4] - ldrh r0, [r4] - strh r0, [r5, 0x6] - b _0809E3A2 -_0809E270: - mov r7, sp - adds r7, 0x2 - mov r0, sp - adds r1, r7, 0 - bl PlayerGetDestCoords - mov r0, sp - ldrh r2, [r0] - movs r3, 0 - ldrsh r1, [r0, r3] - movs r3, 0x4 - ldrsh r0, [r5, r3] - cmp r1, r0 - bne _0809E29A - movs r0, 0 - ldrsh r1, [r7, r0] - movs r3, 0x6 - ldrsh r0, [r5, r3] - cmp r1, r0 - bne _0809E29A - b _0809E3A6 -_0809E29A: - strh r2, [r5, 0x4] - ldrh r0, [r7] - strh r0, [r5, 0x6] - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r7, r2] - bl MapGridGetMetatileBehaviorAt - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r0, =0x00004022 - bl GetVarPointer - adds r6, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl sub_8089604 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809E2E0 - ldrh r0, [r6] - adds r0, 0x1 - strh r0, [r6] - movs r0, 0x4 - strh r0, [r5, 0xC] - movs r0, 0x2 - b _0809E2F8 - .pool -_0809E2E0: - adds r0, r4, 0 - bl sub_8089618 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809E3A6 - movs r0, 0 - strh r0, [r6] - movs r0, 0x4 - strh r0, [r5, 0xC] - movs r0, 0x3 -_0809E2F8: - strh r0, [r5, 0x2] - mov r0, sp - ldrh r0, [r0] - strh r0, [r5, 0x8] - ldrh r0, [r7] - strh r0, [r5, 0xA] - b _0809E3A6 -_0809E306: - ldrh r1, [r5, 0xC] - movs r3, 0xC - ldrsh r0, [r5, r3] - cmp r0, 0 - bne _0809E36A - mov r1, sp - ldrh r0, [r5, 0x8] - strh r0, [r1] - mov r4, sp - adds r4, 0x2 - ldrh r0, [r5, 0xA] - strh r0, [r4] - movs r0, 0x2A - bl audio_play - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - ldr r2, =0x0000020e - bl MapGridSetMetatileIdAt - mov r0, sp - movs r3, 0 - ldrsh r0, [r0, r3] - movs r2, 0 - ldrsh r1, [r4, r2] - bl CurrentMapDrawMetatileAt - mov r0, sp - ldrh r0, [r0] - subs r0, 0x7 - lsls r0, 16 - asrs r0, 16 - ldrh r1, [r4] - subs r1, 0x7 - lsls r1, 16 - asrs r1, 16 - bl sub_809E14C - b _0809E3A2 - .pool -_0809E360: - ldrh r1, [r5, 0xC] - movs r3, 0xC - ldrsh r0, [r5, r3] - cmp r0, 0 - beq _0809E370 -_0809E36A: - subs r0, r1, 0x1 - strh r0, [r5, 0xC] - b _0809E3A6 -_0809E370: - mov r1, sp - ldrh r0, [r5, 0x8] - strh r0, [r1] - mov r4, sp - adds r4, 0x2 - ldrh r0, [r5, 0xA] - strh r0, [r4] - movs r0, 0x29 - bl audio_play - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - ldr r2, =0x00000206 - bl MapGridSetMetatileIdAt - mov r0, sp - movs r3, 0 - ldrsh r0, [r0, r3] - movs r2, 0 - ldrsh r1, [r4, r2] - bl CurrentMapDrawMetatileAt -_0809E3A2: - movs r0, 0x1 - strh r0, [r5, 0x2] -_0809E3A6: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809E224 - - thumb_func_start sub_809E3B4 -sub_809E3B4: @ 809E3B4 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r5, r1, r0 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - mov r0, sp - ldrh r2, [r0] - movs r3, 0 - ldrsh r1, [r0, r3] - movs r3, 0x2 - ldrsh r0, [r5, r3] - cmp r1, r0 - bne _0809E3EE - movs r0, 0 - ldrsh r1, [r4, r0] - movs r3, 0x4 - ldrsh r0, [r5, r3] - cmp r1, r0 - beq _0809E47A -_0809E3EE: - strh r2, [r5, 0x2] - ldrh r0, [r4] - strh r0, [r5, 0x4] - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl MetatileBehavior_IsAsh - lsls r0, 24 - cmp r0, 0 - beq _0809E47A - mov r0, sp - movs r3, 0 - ldrsh r0, [r0, r3] - movs r2, 0 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileIdAt - ldr r1, =0x0000020a - cmp r0, r1 - bne _0809E444 - mov r0, sp - movs r3, 0 - ldrsh r0, [r0, r3] - movs r2, 0 - ldrsh r1, [r4, r2] - ldr r2, =0x00000212 - movs r3, 0x4 - bl ash - b _0809E456 - .pool -_0809E444: - mov r0, sp - movs r3, 0 - ldrsh r0, [r0, r3] - movs r2, 0 - ldrsh r1, [r4, r2] - ldr r2, =0x00000206 - movs r3, 0x4 - bl ash -_0809E456: - movs r0, 0x87 - lsls r0, 1 - movs r1, 0x1 - bl sub_80D6724 - lsls r0, 24 - cmp r0, 0 - beq _0809E47A - ldr r0, =0x00004048 - bl GetVarPointer - adds r2, r0, 0 - ldrh r1, [r2] - ldr r0, =0x0000270e - cmp r1, r0 - bhi _0809E47A - adds r0, r1, 0x1 - strh r0, [r2] -_0809E47A: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809E3B4 - - thumb_func_start sub_809E490 -sub_809E490: @ 809E490 - push {r4,r5,lr} - lsls r0, 16 - asrs r5, r0, 16 - lsls r1, 16 - asrs r4, r1, 16 - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileIdAt - ldr r1, =0x0000022f - ldr r2, =0x00000237 - cmp r0, r1 - bne _0809E4AC - subs r2, 0x31 -_0809E4AC: - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridSetMetatileIdAt - adds r0, r5, 0 - adds r1, r4, 0 - bl CurrentMapDrawMetatileAt - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809E490 - - thumb_func_start sub_809E4CC -sub_809E4CC: @ 809E4CC - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r5, r1, r0 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 16 - lsrs r6, r0, 16 - ldrh r1, [r5, 0x8] - movs r3, 0x8 - ldrsh r0, [r5, r3] - adds r7, r4, 0 - cmp r0, 0 - beq _0809E51E - subs r0, r1, 0x1 - strh r0, [r5, 0x8] - lsls r0, 16 - cmp r0, 0 - bne _0809E51E - movs r1, 0xA - ldrsh r0, [r5, r1] - movs r2, 0xC - ldrsh r1, [r5, r2] - bl sub_809E490 -_0809E51E: - ldrh r1, [r5, 0xE] - movs r3, 0xE - ldrsh r0, [r5, r3] - cmp r0, 0 - beq _0809E53E - subs r0, r1, 0x1 - strh r0, [r5, 0xE] - lsls r0, 16 - cmp r0, 0 - bne _0809E53E - movs r1, 0x10 - ldrsh r0, [r5, r1] - movs r2, 0x12 - ldrsh r1, [r5, r2] - bl sub_809E490 -_0809E53E: - lsls r0, r6, 24 - lsrs r6, r0, 24 - adds r0, r6, 0 - bl sub_8089918 - lsls r0, 24 - cmp r0, 0 - beq _0809E556 - ldr r0, =0x00004022 - movs r1, 0 - bl VarSet -_0809E556: - mov r0, sp - ldrh r2, [r0] - movs r3, 0 - ldrsh r1, [r0, r3] - movs r3, 0x4 - ldrsh r0, [r5, r3] - cmp r1, r0 - bne _0809E572 - movs r0, 0 - ldrsh r1, [r7, r0] - movs r3, 0x6 - ldrsh r0, [r5, r3] - cmp r1, r0 - beq _0809E5D2 -_0809E572: - strh r2, [r5, 0x4] - adds r4, r7, 0 - ldrh r0, [r4] - strh r0, [r5, 0x6] - adds r0, r6, 0 - bl sub_808992C - lsls r0, 24 - cmp r0, 0 - beq _0809E5D2 - bl sub_811A138 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - beq _0809E59A - ldr r0, =0x00004022 - movs r1, 0 - bl VarSet -_0809E59A: - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0809E5BC - movs r0, 0x3 - strh r0, [r5, 0x8] - mov r0, sp - ldrh r0, [r0] - strh r0, [r5, 0xA] - ldrh r0, [r4] - strh r0, [r5, 0xC] - b _0809E5D2 - .pool -_0809E5BC: - movs r2, 0xE - ldrsh r0, [r5, r2] - cmp r0, 0 - bne _0809E5D2 - movs r0, 0x3 - strh r0, [r5, 0xE] - mov r0, sp - ldrh r0, [r0] - strh r0, [r5, 0x10] - ldrh r0, [r7] - strh r0, [r5, 0x12] -_0809E5D2: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_809E4CC - - thumb_func_start sub_809E5DC -sub_809E5DC: @ 809E5DC - push {r4,r5,lr} - adds r3, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - lsls r2, 16 - lsrs r4, r2, 16 - ldrh r0, [r3] - subs r0, 0x1 - strh r0, [r3] - lsls r0, 16 - cmp r0, 0 - bne _0809E5F8 - movs r2, 0xE8 - b _0809E60C -_0809E5F8: - ldr r1, =gUnknown_085103FC - movs r2, 0 - ldrsh r0, [r3, r2] - cmp r0, 0 - bge _0809E604 - adds r0, 0x7 -_0809E604: - asrs r0, 3 - lsls r0, 1 - adds r0, r1 - ldrh r2, [r0] -_0809E60C: - lsls r5, 16 - asrs r5, 16 - lsls r4, 16 - asrs r4, 16 - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridSetMetatileIdAt - adds r0, r5, 0 - adds r1, r4, 0 - bl CurrentMapDrawMetatileAt - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0xE8 - bl MapGridSetMetatileIdAt - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809E5DC - - thumb_func_start sub_809E638 -sub_809E638: @ 809E638 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r4, r1, r0 - mov r5, sp - adds r5, 0x2 - mov r0, sp - adds r1, r5, 0 - bl PlayerGetDestCoords - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r1, 0x4 - ldrsb r1, [r0, r1] - lsls r1, 8 - ldrb r0, [r0, 0x5] - lsls r0, 24 - asrs r0, 24 - orrs r0, r1 - lsls r0, 16 - lsrs r7, r0, 16 - movs r0, 0x2 - ldrsh r1, [r4, r0] - mov r8, r5 - cmp r1, 0 - beq _0809E688 - cmp r1, 0x1 - beq _0809E6B4 - b _0809E708 - .pool -_0809E688: - strh r7, [r4] - mov r0, sp - ldrh r0, [r0] - strh r0, [r4, 0x4] - ldrh r0, [r5] - strh r0, [r4, 0x6] - movs r0, 0x1 - strh r0, [r4, 0x2] - strh r1, [r4, 0x8] - strh r1, [r4, 0xE] - strh r1, [r4, 0x14] - strh r1, [r4, 0x1A] - b _0809E708 -_0809E6A2: - movs r0, 0x20 - strh r0, [r1] - mov r0, sp - ldrh r0, [r0] - strh r0, [r1, 0x2] - mov r2, r8 - ldrh r0, [r2] - strh r0, [r1, 0x4] - b _0809E708 -_0809E6B4: - mov r0, sp - movs r3, 0x4 - ldrsh r1, [r4, r3] - ldrh r2, [r0] - movs r3, 0 - ldrsh r0, [r0, r3] - cmp r1, r0 - bne _0809E6D0 - movs r0, 0x6 - ldrsh r1, [r4, r0] - movs r3, 0 - ldrsh r0, [r5, r3] - cmp r1, r0 - beq _0809E708 -_0809E6D0: - strh r2, [r4, 0x4] - ldrh r0, [r5] - strh r0, [r4, 0x6] - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r5, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl MetatileBehavior_IsMuddySlope - lsls r0, 24 - cmp r0, 0 - beq _0809E708 - movs r6, 0x4 - adds r1, r4, 0 - adds r1, 0x8 -_0809E6F8: - movs r3, 0 - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _0809E6A2 - adds r1, 0x6 - adds r6, 0x3 - cmp r6, 0xD - ble _0809E6F8 -_0809E708: - ldr r2, =0x02037334 - ldrb r1, [r2] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0809E728 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r7, r0 - beq _0809E728 - strh r7, [r4] - ldrh r0, [r2, 0x4] - ldrh r1, [r2, 0x8] - b _0809E72C - .pool -_0809E728: - movs r0, 0 - movs r1, 0 -_0809E72C: - lsls r0, 16 - asrs r0, 16 - mov r8, r0 - lsls r0, r1, 16 - asrs r7, r0, 16 - adds r5, r4, 0 - adds r5, 0x8 - adds r4, r5, 0 - movs r6, 0x9 -_0809E73E: - movs r2, 0 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _0809E762 - ldrh r0, [r4, 0x2] - mov r3, r8 - subs r0, r3 - strh r0, [r4, 0x2] - ldrh r0, [r4, 0x4] - subs r0, r7 - strh r0, [r4, 0x4] - movs r0, 0x2 - ldrsh r1, [r4, r0] - movs r3, 0x4 - ldrsh r2, [r4, r3] - adds r0, r5, 0 - bl sub_809E5DC -_0809E762: - adds r4, 0x6 - adds r5, 0x6 - subs r6, 0x3 - cmp r6, 0 - bge _0809E73E - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_809E638 - - thumb_func_start sub_809E778 -sub_809E778: @ 809E778 - push {lr} - ldr r0, =0x00000895 - bl FlagSet - bl GameFreakRTC_CalcLocalDateTime - ldr r0, =0x03005d90 - ldr r2, [r0] - adds r2, 0xA0 - ldr r3, =0x03005cf8 - ldr r0, [r3] - ldr r1, [r3, 0x4] - str r0, [r2] - str r1, [r2, 0x4] - ldr r0, =0x00004040 - ldrh r1, [r3] - bl VarSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_809E778 - - thumb_func_start sub_809E7B0 -sub_809E7B0: @ 809E7B0 - push {r4,lr} - ldr r0, =0x00000895 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0809E7DA - bl sub_813B9C0 - lsls r0, 24 - cmp r0, 0 - bne _0809E7DA - bl GameFreakRTC_CalcLocalDateTime - ldr r4, =0x03005cf8 - adds r0, r4, 0 - bl sub_809E7E8 - adds r0, r4, 0 - bl sub_809E858 -_0809E7DA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809E7B0 - - thumb_func_start sub_809E7E8 -sub_809E7E8: @ 809E7E8 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r0, =0x00004040 - bl GetVarPointer - adds r6, r0, 0 - ldrh r0, [r6] - movs r2, 0 - ldrsh r1, [r5, r2] - cmp r0, r1 - beq _0809E84E - cmp r0, r1 - bgt _0809E84E - ldrh r4, [r5] - subs r4, r0 - lsls r4, 16 - lsrs r4, 16 - bl sub_809D3A0 - adds r0, r4, 0 - bl sub_8122580 - adds r0, r4, 0 - bl sub_80ED888 - adds r0, r4, 0 - bl sub_80AEFBC - adds r0, r4, 0 - bl sub_806DE44 - adds r0, r4, 0 - bl sub_8137904 - adds r0, r4, 0 - bl sub_8137A20 - adds r0, r4, 0 - bl sub_8139EF4 - adds r0, r4, 0 - bl sub_813A7F4 - adds r0, r4, 0 - bl sub_813945C - adds r0, r4, 0 - bl sub_8177584 - ldrh r0, [r5] - strh r0, [r6] -_0809E84E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809E7E8 - - thumb_func_start sub_809E858 -sub_809E858: @ 809E858 - push {r4-r6,lr} - sub sp, 0x8 - adds r5, r0, 0 - mov r4, sp - ldr r6, =0x03005d90 - ldr r1, [r6] - adds r1, 0xA0 - mov r0, sp - adds r2, r5, 0 - bl GameFreakRTC_GetDelta - mov r0, sp - movs r2, 0 - ldrsh r1, [r0, r2] - lsls r0, r1, 1 - adds r0, r1 - lsls r1, r0, 4 - subs r1, r0 - lsls r1, 5 - movs r2, 0x2 - ldrsb r2, [r4, r2] - lsls r0, r2, 4 - subs r0, r2 - lsls r0, 2 - adds r1, r0 - movs r0, 0x3 - ldrsb r0, [r4, r0] - adds r0, r1, r0 - cmp r0, 0 - beq _0809E8A8 - cmp r0, 0 - blt _0809E8A8 - bl BerryTreeTimeUpdate - ldr r2, [r6] - adds r2, 0xA0 - ldr r0, [r5] - ldr r1, [r5, 0x4] - str r0, [r2] - str r1, [r2, 0x4] -_0809E8A8: - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809E858 - - thumb_func_start sub_809E8B4 -sub_809E8B4: @ 809E8B4 - push {lr} - bl sub_809E778 - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_809E8B4 - - thumb_func_start Special_StartWallClock -Special_StartWallClock: @ 809E8C8 - push {lr} - ldr r0, =Cb2_StartWallClock - bl SetMainCallback2 - ldr r1, =0x030022c0 - ldr r0, =sub_809E8B4 - str r0, [r1, 0x8] - pop {r0} - bx r0 - .pool - thumb_func_end Special_StartWallClock - - thumb_func_start sub_809E8E8 -sub_809E8E8: @ 809E8E8 - push {lr} - adds r3, r0, 0 - ldr r2, =0x03005e00 - movs r0, 0x2E - ldrsh r1, [r3, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r2, 0xC - ldrsh r1, [r0, r2] - movs r2, 0x30 - ldrsh r0, [r3, r2] - cmp r1, r0 - beq _0809E9FE - strh r1, [r3, 0x30] - subs r0, r1, 0x1 - cmp r0, 0x5 - bhi _0809E9FE - lsls r0, 2 - ldr r1, =_0809E920 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0809E920: - .4byte _0809E938 - .4byte _0809E95C - .4byte _0809E980 - .4byte _0809E9A4 - .4byte _0809E9CE - .4byte _0809E9F8 -_0809E938: - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r1, r3, 0 - adds r1, 0x2A - movs r0, 0x1 - strb r0, [r1] - subs r2, 0x12 - ldrb r1, [r2] - subs r0, 0x41 - ands r0, r1 - strb r0, [r2] - movs r0, 0x35 - b _0809E9C6 -_0809E95C: - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r1, r3, 0 - adds r1, 0x2A - movs r0, 0x1 - strb r0, [r1] - subs r2, 0x12 - ldrb r1, [r2] - subs r0, 0x41 - ands r0, r1 - strb r0, [r2] - movs r0, 0x56 - b _0809E9C6 -_0809E980: - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r1, r3, 0 - adds r1, 0x2A - movs r0, 0x1 - strb r0, [r1] - subs r2, 0x12 - ldrb r1, [r2] - subs r0, 0x41 - ands r0, r1 - strb r0, [r2] - movs r0, 0x65 - b _0809E9C6 -_0809E9A4: - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r1, r3, 0 - adds r1, 0x2A - movs r0, 0x1 - strb r0, [r1] - subs r2, 0x12 - ldrb r1, [r2] - subs r0, 0x41 - ands r0, r1 - strb r0, [r2] - movs r0, 0x74 -_0809E9C6: - strh r0, [r3, 0x20] - movs r0, 0x44 - strh r0, [r3, 0x22] - b _0809E9FE -_0809E9CE: - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r1, r3, 0 - adds r1, 0x2A - movs r0, 0x2 - strb r0, [r1] - subs r2, 0x12 - ldrb r1, [r2] - subs r0, 0x42 - ands r0, r1 - strb r0, [r2] - movs r0, 0x99 - strh r0, [r3, 0x20] - movs r0, 0x50 - strh r0, [r3, 0x22] - b _0809E9FE -_0809E9F8: - adds r0, r3, 0 - bl RemoveObjectAndFreeTiles -_0809E9FE: - pop {r0} - bx r0 - thumb_func_end sub_809E8E8 - - thumb_func_start sub_809EA04 -sub_809EA04: @ 809EA04 - push {lr} - adds r3, r0, 0 - ldr r2, =0x03005e00 - movs r0, 0x2E - ldrsh r1, [r3, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r2, 0xC - ldrsh r1, [r0, r2] - movs r2, 0x30 - ldrsh r0, [r3, r2] - cmp r1, r0 - beq _0809EAFE - strh r1, [r3, 0x30] - subs r0, r1, 0x1 - cmp r0, 0x5 - bhi _0809EAFE - lsls r0, 2 - ldr r1, =_0809EA3C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0809EA3C: - .4byte _0809EA54 - .4byte _0809EA78 - .4byte _0809EA9C - .4byte _0809EAC0 - .4byte _0809EAEA - .4byte _0809EAF8 -_0809EA54: - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r1, r3, 0 - adds r1, 0x2A - movs r0, 0 - strb r0, [r1] - subs r2, 0x12 - ldrb r1, [r2] - subs r0, 0x40 - ands r0, r1 - strb r0, [r2] - movs r0, 0x35 - b _0809EAE2 -_0809EA78: - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r1, r3, 0 - adds r1, 0x2A - movs r0, 0 - strb r0, [r1] - subs r2, 0x12 - ldrb r1, [r2] - subs r0, 0x40 - ands r0, r1 - strb r0, [r2] - movs r0, 0x56 - b _0809EAE2 -_0809EA9C: - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r1, r3, 0 - adds r1, 0x2A - movs r0, 0 - strb r0, [r1] - subs r2, 0x12 - ldrb r1, [r2] - subs r0, 0x40 - ands r0, r1 - strb r0, [r2] - movs r0, 0x65 - b _0809EAE2 -_0809EAC0: - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r1, r3, 0 - adds r1, 0x2A - movs r0, 0 - strb r0, [r1] - subs r2, 0x12 - ldrb r1, [r2] - subs r0, 0x40 - ands r0, r1 - strb r0, [r2] - movs r0, 0x74 -_0809EAE2: - strh r0, [r3, 0x20] - movs r0, 0x5C - strh r0, [r3, 0x22] - b _0809EAFE -_0809EAEA: - adds r0, r3, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - b _0809EAFE -_0809EAF8: - adds r0, r3, 0 - bl RemoveObjectAndFreeTiles -_0809EAFE: - pop {r0} - bx r0 - thumb_func_end sub_809EA04 - - thumb_func_start sub_809EB04 -sub_809EB04: @ 809EB04 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_085104C4 - bl LoadTaggedObjectPalette - ldr r0, =gUnknown_085104F0 - mov r8, r0 - movs r1, 0x35 - movs r2, 0x44 - movs r3, 0 - bl AddObjectToBack - lsls r0, 24 - lsrs r1, r0, 24 - ldr r6, =0x02020630 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, r6, 0 - adds r4, 0x1C - adds r2, r0, r4 - ldr r1, =sub_809E8E8 - str r1, [r2] - adds r0, r6 - strh r5, [r0, 0x2E] - ldr r1, =0x0000ffff - strh r1, [r0, 0x30] - mov r0, r8 - movs r1, 0x35 - movs r2, 0x44 - movs r3, 0 - bl AddObjectToBack - lsls r0, 24 - lsrs r1, r0, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, r0, r4 - ldr r1, =sub_809EA04 - str r1, [r4] - adds r0, r6 - strh r5, [r0, 0x2E] - movs r1, 0x1 - negs r1, r1 - strh r1, [r0, 0x30] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809EB04 - - thumb_func_start sub_809EB8C -sub_809EB8C: @ 809EB8C - push {lr} - ldr r0, =gUnknown_085104C4 - ldrh r0, [r0, 0x4] - bl FreeObjectPaletteByTag - pop {r0} - bx r0 - .pool - thumb_func_end sub_809EB8C - - thumb_func_start sub_809EBA0 -sub_809EBA0: @ 809EBA0 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0 - bl sub_8198070 - adds r0, r4, 0 - bl RemoveWindow - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_809EBA0 - - thumb_func_start sub_809EBC4 -sub_809EBC4: @ 809EBC4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - mov r10, r0 - adds r0, r1, 0 - mov r9, r2 - adds r1, r3, 0 - ldr r5, [sp, 0x30] - ldr r6, [sp, 0x34] - ldr r2, [sp, 0x38] - mov r8, r2 - mov r2, r10 - lsls r2, 24 - lsrs r2, 24 - mov r10, r2 - lsls r3, r0, 24 - lsrs r3, 24 - str r3, [sp, 0xC] - mov r0, r9 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r1, 16 - lsrs r1, 16 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - mov r2, r8 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - ldr r7, =0x02021fc4 - ldr r4, =0x02021cc4 - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalString - adds r0, r7, 0 - adds r1, r4, 0 - bl CopyString - adds r7, r0, 0 - ldr r1, =gUnknown_085EE68A - bl CopyString - adds r7, r0, 0 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - adds r0, r7, 0 - adds r1, r4, 0 - bl CopyString - adds r7, r0, 0 - ldr r5, =gUnknown_085EE68E - adds r1, r5, 0 - bl CopyString - adds r7, r0, 0 - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalString - adds r0, r7, 0 - adds r1, r4, 0 - bl CopyString - adds r7, r0, 0 - adds r1, r5, 0 - bl CopyString - adds r7, r0, 0 - adds r0, r4, 0 - mov r1, r8 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalString - adds r0, r7, 0 - adds r1, r4, 0 - bl CopyString - ldr r2, =0x02021fc4 - mov r0, r9 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - mov r0, r10 - movs r1, 0x1 - ldr r3, [sp, 0xC] - bl Print - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809EBC4 - - thumb_func_start sub_809ECB4 -sub_809ECB4: @ 809ECB4 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0xC - adds r4, r0, 0 - mov r9, r1 - adds r5, r2, 0 - adds r6, r3, 0 - ldr r0, [sp, 0x24] - mov r8, r0 - lsls r4, 24 - lsrs r4, 24 - mov r0, r9 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r2, 0x85 - lsls r2, 2 - adds r0, r4, 0 - movs r1, 0 - movs r3, 0xE - bl SetWindowBorderStyle - str r5, [sp] - str r6, [sp, 0x4] - mov r0, r8 - str r0, [sp, 0x8] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x1 - mov r3, r9 - bl sub_809EBC4 - ldr r2, =gUnknown_085EE690 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - adds r0, r4, 0 - movs r1, 0x1 - movs r3, 0x7E - bl Print - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809ECB4 - - thumb_func_start sub_809ED38 -sub_809ED38: @ 809ED38 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r3, 16 - lsrs r3, 16 - adds r1, r3, 0 - movs r0, 0x80 - ands r0, r3 - cmp r0, 0 - beq _0809ED52 - ldrh r0, [r4] - subs r0, 0x1 - b _0809ED6C -_0809ED52: - movs r0, 0x40 - ands r0, r3 - cmp r0, 0 - beq _0809ED60 - ldrh r0, [r4] - adds r0, 0x1 - b _0809ED8A -_0809ED60: - movs r0, 0x20 - ands r0, r3 - cmp r0, 0 - beq _0809ED7A - ldrh r0, [r4] - subs r0, 0xA -_0809ED6C: - strh r0, [r4] - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, r5 - bge _0809ED96 - strh r2, [r4] - b _0809ED96 -_0809ED7A: - movs r0, 0x10 - ands r1, r0 - cmp r1, 0 - bne _0809ED86 - movs r0, 0 - b _0809ED98 -_0809ED86: - ldrh r0, [r4] - adds r0, 0xA -_0809ED8A: - strh r0, [r4] - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, r2 - ble _0809ED96 - strh r5, [r4] -_0809ED96: - movs r0, 0x1 -_0809ED98: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_809ED38 - - thumb_func_start sub_809EDA0 -sub_809EDA0: @ 809EDA0 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0x1 - strh r0, [r1, 0x8] - bx lr - .pool - thumb_func_end sub_809EDA0 - - thumb_func_start sub_809EDB8 -sub_809EDB8: @ 809EDB8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r5, =0x03005e08 - adds r0, r4, r5 - ldrb r0, [r0, 0x10] - bl sub_809EBA0 - bl sub_809EB8C - subs r5, 0x8 - adds r4, r5 - ldr r0, =sub_809EDA0 - str r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809EDB8 - - thumb_func_start sub_809EDE8 -sub_809EDE8: @ 809EDE8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r7, r0, 3 - ldr r0, =0x03005e08 - mov r8, r0 - adds r5, r7, r0 - ldrb r4, [r5, 0x4] - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - ldr r1, =gUnknown_0851041C - adds r2, r0, r1 - ldr r1, =0x030022c0 - ldrh r3, [r1, 0x2E] - movs r0, 0x2 - ands r0, r3 - mov r12, r1 - cmp r0, 0 - beq _0809EE3C - mov r0, r8 - subs r0, 0x8 - adds r0, r7, r0 - ldr r1, =sub_809EDB8 - str r1, [r0] - movs r0, 0 - strh r0, [r5, 0x2] - movs r0, 0x6 - b _0809EE5C - .pool -_0809EE3C: - movs r0, 0x10 - ands r0, r3 - cmp r0, 0 - beq _0809EE4A - ldrb r0, [r2, 0x7] - cmp r0, 0 - bne _0809EE5C -_0809EE4A: - mov r3, r12 - ldrh r1, [r3, 0x2E] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0809EE66 - ldrb r0, [r2, 0x6] - cmp r0, 0 - beq _0809EE66 -_0809EE5C: - strh r0, [r5, 0x4] - movs r0, 0x5 - bl audio_play - b _0809EEF4 -_0809EE66: - cmp r4, 0x5 - bne _0809EEB4 - mov r0, r12 - ldrh r1, [r0, 0x2E] - movs r4, 0x1 - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _0809EEF4 - ldr r1, =0x03005cf8 - ldrh r0, [r5, 0x6] - strh r0, [r1] - ldrh r0, [r5, 0x8] - strb r0, [r1, 0x2] - ldrh r0, [r5, 0xA] - strb r0, [r1, 0x3] - ldrh r0, [r5, 0xC] - strb r0, [r1, 0x4] - movs r0, 0x5 - bl audio_play - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_809EDB8 - str r1, [r0] - strh r4, [r5, 0x2] - movs r0, 0x6 - strh r0, [r5, 0x4] - b _0809EEF4 - .pool -_0809EEB4: - ldrb r0, [r2] - lsls r0, 1 - adds r0, r5, r0 - ldrh r1, [r2, 0x2] - ldrh r2, [r2, 0x4] - mov r3, r12 - ldrh r4, [r3, 0x30] - movs r3, 0xC0 - ands r3, r4 - bl sub_809ED38 - cmp r0, 0 - beq _0809EEF4 - movs r0, 0x5 - bl audio_play - ldrb r0, [r5, 0x10] - ldrh r3, [r5, 0x6] - ldrb r1, [r5, 0x8] - str r1, [sp] - ldrb r1, [r5, 0xA] - str r1, [sp, 0x4] - ldrb r1, [r5, 0xC] - str r1, [sp, 0x8] - movs r1, 0 - movs r2, 0x1 - bl sub_809EBC4 - ldrb r0, [r5, 0x10] - movs r1, 0x2 - bl CopyWindowToVram -_0809EEF4: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_809EDE8 - - thumb_func_start sub_809EF00 -sub_809EF00: @ 809EF00 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - mov r8, r0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r6, r0, 2 - add r6, r8 - lsls r6, 3 - ldr r0, =0x03005e08 - mov r9, r0 - adds r5, r6, r0 - movs r0, 0 - strh r0, [r5] - ldr r1, =0x03005cf8 - ldrh r0, [r1] - strh r0, [r5, 0x6] - movs r0, 0x2 - ldrsb r0, [r1, r0] - strh r0, [r5, 0x8] - movs r0, 0x3 - ldrsb r0, [r1, r0] - strh r0, [r5, 0xA] - movs r0, 0x4 - ldrsb r0, [r1, r0] - strh r0, [r5, 0xC] - ldr r0, =gUnknown_08510420 - bl AddWindow - strh r0, [r5, 0x10] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r5, 0x6] - ldrb r2, [r5, 0x8] - ldrb r3, [r5, 0xA] - ldrb r4, [r5, 0xC] - str r4, [sp] - bl sub_809ECB4 - mov r0, r8 - bl sub_809EB04 - movs r0, 0x2 - strh r0, [r5, 0x4] - movs r0, 0x8 - negs r0, r0 - add r9, r0 - add r6, r9 - ldr r0, =sub_809EDE8 - str r0, [r6] - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809EF00 - - thumb_func_start sub_809EF88 -sub_809EF88: @ 809EF88 - push {r4-r7,lr} - sub sp, 0x4 - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0 - bl SetVBlankCallback - movs r2, 0xA0 - lsls r2, 19 - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r1, =0x040000d4 - mov r0, sp - str r0, [r1] - str r2, [r1, 0x4] - ldr r0, =0x81000200 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - movs r2, 0xC0 - lsls r2, 19 - movs r3, 0xC0 - lsls r3, 9 - mov r4, sp - movs r6, 0 - movs r5, 0x80 - lsls r5, 5 - ldr r7, =0x81000800 - movs r0, 0x81 - lsls r0, 24 - mov r12, r0 -_0809EFCA: - strh r6, [r4] - mov r0, sp - str r0, [r1] - str r2, [r1, 0x4] - str r7, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r2, r5 - subs r3, r5 - cmp r3, r5 - bhi _0809EFCA - strh r6, [r4] - mov r0, sp - str r0, [r1] - str r2, [r1, 0x4] - lsrs r0, r3, 1 - mov r2, r12 - orrs r0, r2 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - movs r0, 0 - movs r1, 0x80 - bl ResetSpriteRange - bl LoadOamFromSprites - bl remove_some_task - bl dp12_8087EA4 - bl ResetAllObjectData - bl clear_tasks - bl sub_80A1A74 - bl sub_809F048 - ldr r0, =sub_809F0AC - bl SetVBlankCallback - ldr r0, =sub_809F090 - bl SetMainCallback2 - ldr r0, =sub_809F200 - movs r1, 0x50 - bl AddTask - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809EF88 - - thumb_func_start sub_809F048 -sub_809F048: @ 809F048 - push {lr} - bl clear_scheduled_bg_copies_to_vram - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_08510404 - movs r0, 0 - movs r2, 0x1 - bl InitBgsFromTemplates - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - ldr r0, =gUnknown_08510408 - bl InitWindows - bl DeactivateAllTextPrinters - bl sub_81973A4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_809F048 - - thumb_func_start sub_809F090 -sub_809F090: @ 809F090 - push {lr} - bl RunActiveTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl do_scheduled_bg_tilemap_copies_to_vram - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_809F090 - - thumb_func_start sub_809F0AC -sub_809F0AC: @ 809F0AC - push {lr} - bl ProcessObjectCopyRequests - bl LoadOamFromSprites - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_809F0AC - - thumb_func_start sub_809F0C0 -sub_809F0C0: @ 809F0C0 - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - movs r2, 0x80 - lsls r2, 2 - movs r0, 0x1 - movs r1, 0 - movs r3, 0xF - bl sub_8197B1C - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0 - bl Print - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_809F0C0 - - thumb_func_start sub_809F0F8 -sub_809F0F8: @ 809F0F8 - push {r4-r7,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r6, r0, r1 - movs r0, 0 - ldrsh r5, [r6, r0] - cmp r5, 0 - beq _0809F11C - cmp r5, 0x1 - beq _0809F1B2 - b _0809F1F8 - .pool -_0809F11C: - movs r2, 0x85 - lsls r2, 2 - movs r0, 0 - movs r1, 0 - movs r3, 0xE - bl SetWindowBorderStyle - ldr r2, =gUnknown_085ECA0D - movs r0, 0x1 - str r0, [sp] - movs r4, 0xFF - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r3, 0 - bl Print - ldr r1, =0x03005cf8 - ldrh r3, [r1] - ldrb r0, [r1, 0x2] - str r0, [sp] - ldrb r0, [r1, 0x3] - str r0, [sp, 0x4] - ldrb r0, [r1, 0x4] - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0x11 - bl sub_809EBC4 - ldr r2, =gUnknown_085ECA22 - movs r0, 0x21 - str r0, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r3, 0 - bl Print - ldr r0, =0x03005d90 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0xA0 - ldrh r3, [r0] - adds r0, 0x2 - ldrb r0, [r0] - str r0, [sp] - adds r0, r1, 0 - adds r0, 0xA3 - ldrb r0, [r0] - str r0, [sp, 0x4] - adds r0, r1, 0 - adds r0, 0xA4 - ldrb r0, [r0] - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0x31 - bl sub_809EBC4 - ldr r0, =gUnknown_085EC9EC - bl sub_809F0C0 - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldrh r0, [r6] - adds r0, 0x1 - strh r0, [r6] -_0809F1B2: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0809F1E4 - adds r0, r7, 0 - bl remove_task - bl Reset - b _0809F1F8 - .pool -_0809F1E4: - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0809F1F8 - movs r0, 0x5 - bl audio_play - adds r0, r7, 0 - bl remove_task -_0809F1F8: - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_809F0F8 - - thumb_func_start sub_809F200 -sub_809F200: @ 809F200 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r5, r0, r1 - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0x6 - bls _0809F21C - b _0809F404 -_0809F21C: - lsls r0, 2 - ldr r1, =_0809F230 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0809F230: - .4byte _0809F24C - .4byte _0809F268 - .4byte _0809F2B4 - .4byte _0809F310 - .4byte _0809F398 - .4byte _0809F3C8 - .4byte _0809F3EA -_0809F24C: - movs r0, 0x1 - negs r0, r0 - ldr r1, =0x0000ffff - str r1, [sp] - movs r1, 0x1 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - movs r0, 0x1 - strh r0, [r5] - b _0809F404 - .pool -_0809F268: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0809F276 - b _0809F404 -_0809F276: - ldr r0, =0x03006210 - ldrh r0, [r0] - cmp r0, 0 - beq _0809F282 - cmp r0, 0x2 - bne _0809F29C -_0809F282: - ldr r0, =gUnknown_085ECAA7 - bl sub_809F0C0 - movs r0, 0x5 - strh r0, [r5] - b _0809F404 - .pool -_0809F29C: - bl GameFreakRTC_CalcLocalDateTime - ldr r0, =sub_809F0F8 - movs r1, 0x50 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x2] - b _0809F334 - .pool -_0809F2B4: - ldr r2, =0x03005e00 - movs r0, 0x2 - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x4] - cmp r0, 0x1 - bne _0809F2CA - b _0809F404 -_0809F2CA: - movs r0, 0 - movs r1, 0 - bl sub_8198070 - ldr r0, =gUnknown_085ECA38 - bl sub_809F0C0 - ldr r2, =0x03005cf8 - ldr r0, =0x03005d90 - ldr r0, [r0] - adds r0, 0xA0 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [r2] - str r1, [r2, 0x4] - ldr r0, =sub_809EF00 - movs r1, 0x50 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x2] - movs r0, 0x3 - strh r0, [r5] - b _0809F404 - .pool -_0809F310: - ldr r2, =0x03005e00 - movs r0, 0x2 - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r1, r0, r2 - movs r2, 0x8 - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _0809F404 - movs r2, 0xA - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _0809F340 - ldrb r0, [r5, 0x2] - bl remove_task -_0809F334: - movs r0, 0x2 - strh r0, [r5] - b _0809F404 - .pool -_0809F340: - ldrb r0, [r5, 0x2] - bl remove_task - bl GameFreakRTC_Reset - ldr r4, =0x03005cf8 - movs r1, 0 - ldrsh r0, [r4, r1] - movs r1, 0x2 - ldrsb r1, [r4, r1] - movs r2, 0x3 - ldrsb r2, [r4, r2] - movs r3, 0x4 - ldrsb r3, [r4, r3] - bl GameFreakRTC_CalcRTCToLocalDelta - ldr r0, =0x03005d90 - ldr r2, [r0] - adds r2, 0xA0 - ldr r0, [r4] - ldr r1, [r4, 0x4] - str r0, [r2] - str r1, [r2, 0x4] - ldr r0, =0x00004040 - ldrh r1, [r4] - bl VarSet - bl sub_809D5D8 - ldr r0, =gUnknown_085ECA4F - bl sub_809F0C0 - movs r0, 0x4 - strh r0, [r5] - b _0809F404 - .pool -_0809F398: - movs r0, 0 - bl save_game_when_memory_present - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809F3B8 - ldr r0, =gUnknown_085ECA8A - bl sub_809F0C0 - movs r0, 0x49 - bl audio_play - b _0809F3C4 - .pool -_0809F3B8: - ldr r0, =gUnknown_085ECA9A - bl sub_809F0C0 - movs r0, 0x16 - bl audio_play -_0809F3C4: - movs r0, 0x5 - strh r0, [r5] -_0809F3C8: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0809F404 - movs r0, 0x1 - negs r0, r0 - ldr r1, =0x0000ffff - str r1, [sp] - movs r1, 0x1 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - movs r0, 0x6 - strh r0, [r5] -_0809F3EA: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0809F404 - adds r0, r4, 0 - bl remove_task - bl FreeAllWindowBuffers - bl Reset -_0809F404: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809F200 - - thumb_func_start sub_809F41C -sub_809F41C: @ 809F41C - push {lr} - ldr r0, =0x00000861 - bl FlagSet - movs r0, 0x86 - lsls r0, 4 - bl FlagSet - ldr r0, =0x00000862 - bl FlagSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_809F41C - - thumb_func_start BuildStartMenuActions -BuildStartMenuActions: @ 809F440 - push {lr} - ldr r0, =0x0203760f - movs r1, 0 - strb r1, [r0] - bl is_c1_link_related_active - cmp r0, 0x1 - bne _0809F45C - bl BuildStartMenuActions_LinkMode - b _0809F4AC - .pool -_0809F45C: - bl InUnionRoom - cmp r0, 0x1 - bne _0809F46A - bl BuildStartMenuActions_UnionRoom - b _0809F4AC -_0809F46A: - bl GetSafariZoneFlag - cmp r0, 0x1 - bne _0809F478 - bl BuildStartMenuActions_SafariZone - b _0809F4AC -_0809F478: - bl InBattlePike - lsls r0, 24 - cmp r0, 0 - beq _0809F488 - bl BuildStartMenuActions_BattlePike - b _0809F4AC -_0809F488: - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _0809F498 - bl BuildStartMenuActions_BattlePyramid - b _0809F4AC -_0809F498: - bl in_multi_battle_room_with_var_condition - lsls r0, 24 - cmp r0, 0 - beq _0809F4A8 - bl BuildStartMenuActions_MultiBattleRoom - b _0809F4AC -_0809F4A8: - bl BuildStartMenuActions_Normal -_0809F4AC: - pop {r0} - bx r0 - thumb_func_end BuildStartMenuActions - - thumb_func_start AddStartMenuAction -@ void AddStartMenuAction(u8 entry) -AddStartMenuAction: @ 809F4B0 - push {lr} - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =0x02037610 - ldr r1, =0x0203760f - bl append_byte - pop {r0} - bx r0 - .pool - thumb_func_end AddStartMenuAction - - thumb_func_start BuildStartMenuActions_Normal -BuildStartMenuActions_Normal: @ 809F4CC - push {lr} - ldr r0, =0x00000861 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809F4E2 - movs r0, 0 - bl AddStartMenuAction -_0809F4E2: - movs r0, 0x86 - lsls r0, 4 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809F4F8 - movs r0, 0x1 - bl AddStartMenuAction -_0809F4F8: - movs r0, 0x2 - bl AddStartMenuAction - ldr r0, =0x00000862 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809F512 - movs r0, 0x3 - bl AddStartMenuAction -_0809F512: - movs r0, 0x4 - bl AddStartMenuAction - movs r0, 0x5 - bl AddStartMenuAction - movs r0, 0x6 - bl AddStartMenuAction - movs r0, 0x7 - bl AddStartMenuAction - pop {r0} - bx r0 - .pool - thumb_func_end BuildStartMenuActions_Normal - - thumb_func_start BuildStartMenuActions_SafariZone -BuildStartMenuActions_SafariZone: @ 809F538 - push {lr} - movs r0, 0x8 - bl AddStartMenuAction - movs r0, 0 - bl AddStartMenuAction - movs r0, 0x1 - bl AddStartMenuAction - movs r0, 0x2 - bl AddStartMenuAction - movs r0, 0x4 - bl AddStartMenuAction - movs r0, 0x6 - bl AddStartMenuAction - movs r0, 0x7 - bl AddStartMenuAction - pop {r0} - bx r0 - thumb_func_end BuildStartMenuActions_SafariZone - - thumb_func_start BuildStartMenuActions_LinkMode -BuildStartMenuActions_LinkMode: @ 809F568 - push {lr} - movs r0, 0x1 - bl AddStartMenuAction - movs r0, 0x2 - bl AddStartMenuAction - ldr r0, =0x00000862 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809F58A - movs r0, 0x3 - bl AddStartMenuAction -_0809F58A: - movs r0, 0x9 - bl AddStartMenuAction - movs r0, 0x6 - bl AddStartMenuAction - movs r0, 0x7 - bl AddStartMenuAction - pop {r0} - bx r0 - .pool - thumb_func_end BuildStartMenuActions_LinkMode - - thumb_func_start BuildStartMenuActions_UnionRoom -BuildStartMenuActions_UnionRoom: @ 809F5A4 - push {lr} - movs r0, 0x1 - bl AddStartMenuAction - movs r0, 0x2 - bl AddStartMenuAction - ldr r0, =0x00000862 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809F5C6 - movs r0, 0x3 - bl AddStartMenuAction -_0809F5C6: - movs r0, 0x4 - bl AddStartMenuAction - movs r0, 0x6 - bl AddStartMenuAction - movs r0, 0x7 - bl AddStartMenuAction - pop {r0} - bx r0 - .pool - thumb_func_end BuildStartMenuActions_UnionRoom - - thumb_func_start BuildStartMenuActions_BattlePike -BuildStartMenuActions_BattlePike: @ 809F5E0 - push {lr} - movs r0, 0 - bl AddStartMenuAction - movs r0, 0x1 - bl AddStartMenuAction - movs r0, 0x4 - bl AddStartMenuAction - movs r0, 0x6 - bl AddStartMenuAction - movs r0, 0x7 - bl AddStartMenuAction - pop {r0} - bx r0 - thumb_func_end BuildStartMenuActions_BattlePike - - thumb_func_start BuildStartMenuActions_BattlePyramid -BuildStartMenuActions_BattlePyramid: @ 809F604 - push {lr} - movs r0, 0x1 - bl AddStartMenuAction - movs r0, 0xC - bl AddStartMenuAction - movs r0, 0x4 - bl AddStartMenuAction - movs r0, 0xA - bl AddStartMenuAction - movs r0, 0xB - bl AddStartMenuAction - movs r0, 0x6 - bl AddStartMenuAction - movs r0, 0x7 - bl AddStartMenuAction - pop {r0} - bx r0 - thumb_func_end BuildStartMenuActions_BattlePyramid - - thumb_func_start BuildStartMenuActions_MultiBattleRoom -BuildStartMenuActions_MultiBattleRoom: @ 809F634 - push {lr} - movs r0, 0x1 - bl AddStartMenuAction - movs r0, 0x4 - bl AddStartMenuAction - movs r0, 0x6 - bl AddStartMenuAction - movs r0, 0x7 - bl AddStartMenuAction - pop {r0} - bx r0 - thumb_func_end BuildStartMenuActions_MultiBattleRoom - - thumb_func_start sub_809F654 -sub_809F654: @ 809F654 - push {r4,r5,lr} - sub sp, 0xC - ldr r4, =0x0203760c - ldr r0, =gUnknown_08510508 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - bl PutWindowTilemap - ldrb r0, [r4] - movs r1, 0 - bl sub_81973FC - ldr r0, =0x02021cc4 - ldr r1, =0x0203a04c - ldrb r1, [r1] - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r5, =0x02021fc4 - ldr r1, =gUnknown_085EE6FF - adds r0, r5, 0 - bl ExpandStringRefs - ldrb r0, [r4] - movs r1, 0x1 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - movs r3, 0 - bl Print - ldrb r0, [r4] - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809F654 - - thumb_func_start sub_809F6C8 -sub_809F6C8: @ 809F6C8 - push {r4,r5,lr} - sub sp, 0xC - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0x7 - bne _0809F6F0 - ldr r4, =0x0203760d - ldr r0, =gUnknown_08510538 - b _0809F6F4 - .pool -_0809F6F0: - ldr r4, =0x0203760d - ldr r0, =gUnknown_08510530 -_0809F6F4: - bl AddWindow - strb r0, [r4] - ldr r4, =0x0203760d - ldrb r0, [r4] - bl PutWindowTilemap - ldrb r0, [r4] - movs r1, 0 - bl sub_81973FC - ldr r0, =0x02021cc4 - ldr r2, =gUnknown_08510510 - ldr r1, =0x03005d90 - ldr r1, [r1] - ldr r3, =0x00000cb2 - adds r1, r3 - ldrh r1, [r1] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl CopyString - ldr r5, =0x02021fc4 - ldr r1, =gUnknown_085EE716 - adds r0, r5, 0 - bl ExpandStringRefs - ldrb r0, [r4] - movs r1, 0x1 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - movs r3, 0 - bl Print - ldrb r0, [r4] - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809F6C8 - - thumb_func_start RemoveExtraStartMenuWindows -RemoveExtraStartMenuWindows: @ 809F774 - push {r4,lr} - bl GetSafariZoneFlag - cmp r0, 0 - beq _0809F796 - ldr r4, =0x0203760c - ldrb r0, [r4] - movs r1, 0 - bl sub_8198070 - ldrb r0, [r4] - movs r1, 0x2 - bl CopyWindowToVram - ldrb r0, [r4] - bl RemoveWindow -_0809F796: - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _0809F7B0 - ldr r4, =0x0203760d - ldrb r0, [r4] - movs r1, 0 - bl sub_8198070 - ldrb r0, [r4] - bl RemoveWindow -_0809F7B0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end RemoveExtraStartMenuWindows - - thumb_func_start PrintStartMenuActions -PrintStartMenuActions: @ 809F7C0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - mov r8, r0 - adds r6, r1, 0 - ldrb r2, [r0] - ldr r0, =gUnknown_08510540 - mov r9, r0 - ldr r1, =0x02021fc4 - mov r10, r1 -_0809F7DA: - ldr r0, =0x02037610 - lsls r2, 24 - asrs r4, r2, 24 - adds r5, r4, r0 - ldrb r0, [r5] - lsls r3, r0, 3 - mov r0, r9 - adds r0, 0x4 - adds r0, r3, r0 - ldr r1, [r0] - ldr r0, =StartMenu_PlayerName - adds r7, r2, 0 - cmp r1, r0 - bne _0809F828 - bl get_start_menu_window_id_maybe - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r5] - lsls r1, 3 - add r1, r9 - ldr r1, [r1] - lsls r3, r4, 4 - adds r3, 0x9 - lsls r3, 16 - lsrs r3, 16 - movs r2, 0x8 - bl sub_819A024 - b _0809F858 - .pool -_0809F828: - mov r1, r9 - adds r0, r3, r1 - ldr r1, [r0] - mov r0, r10 - bl ExpandStringRefs - bl get_start_menu_window_id_maybe - lsls r0, 24 - lsrs r0, 24 - lsls r1, r4, 4 - adds r1, 0x9 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - mov r2, r10 - movs r3, 0x8 - bl Print -_0809F858: - movs r0, 0x80 - lsls r0, 17 - adds r1, r7, r0 - lsrs r2, r1, 24 - asrs r1, 24 - ldr r0, =0x0203760f - ldrb r0, [r0] - cmp r1, r0 - bge _0809F87C - subs r6, 0x1 - cmp r6, 0 - bne _0809F7DA - mov r1, r8 - strb r2, [r1] - movs r0, 0 - b _0809F882 - .pool -_0809F87C: - mov r0, r8 - strb r2, [r0] - movs r0, 0x1 -_0809F882: - 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 PrintStartMenuActions - - thumb_func_start sub_809F894 -sub_809F894: @ 809F894 - push {r4,lr} - sub sp, 0xC - ldr r0, =0x02037619 - movs r1, 0 - ldrsb r1, [r0, r1] - adds r2, r0, 0 - cmp r1, 0x5 - bhi _0809F98C - lsls r0, r1, 2 - ldr r1, =_0809F8B8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0809F8B8: - .4byte _0809F8D0 - .4byte _0809F8D8 - .4byte _0809F8E4 - .4byte _0809F90C - .4byte _0809F930 - .4byte _0809F94C -_0809F8D0: - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - b _0809F98C -_0809F8D8: - bl BuildStartMenuActions - ldr r1, =0x02037619 - b _0809F940 - .pool -_0809F8E4: - bl sub_81973A4 - ldr r0, =0x0203760f - ldrb r0, [r0] - bl sub_81979C4 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl sub_81973FC - ldr r1, =0x02037619 - movs r0, 0 - strb r0, [r1, 0x1] - b _0809F940 - .pool -_0809F90C: - bl GetSafariZoneFlag - cmp r0, 0 - beq _0809F918 - bl sub_809F654 -_0809F918: - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _0809F926 - bl sub_809F6C8 -_0809F926: - ldr r1, =0x02037619 - b _0809F940 - .pool -_0809F930: - ldr r4, =0x0203761a - adds r0, r4, 0 - movs r1, 0x2 - bl PrintStartMenuActions - cmp r0, 0 - beq _0809F98C - subs r1, r4, 0x1 -_0809F940: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0809F98C - .pool -_0809F94C: - bl get_start_menu_window_id_maybe - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x10 - str r1, [sp] - ldr r1, =0x0203760f - ldrb r1, [r1] - str r1, [sp, 0x4] - ldr r4, =0x0203760e - ldrb r1, [r4] - str r1, [sp, 0x8] - movs r1, 0x1 - movs r2, 0 - movs r3, 0x9 - bl sub_81983AC - strb r0, [r4] - bl get_start_menu_window_id_maybe - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl CopyWindowToVram - movs r0, 0x1 - b _0809F98E - .pool -_0809F98C: - movs r0, 0 -_0809F98E: - add sp, 0xC - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_809F894 - - thumb_func_start sub_809F998 -sub_809F998: @ 809F998 - push {lr} - ldr r1, =0x02037619 - movs r0, 0 - strb r0, [r1] - strb r0, [r1, 0x1] -_0809F9A2: - bl sub_809F894 - cmp r0, 0 - beq _0809F9A2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_809F998 - - thumb_func_start task50_startmenu -task50_startmenu: @ 809F9B4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_809F894 - cmp r0, 0x1 - bne _0809F9C8 - adds r0, r4, 0 - bl set_task_function_to_args_14_15 -_0809F9C8: - pop {r4} - pop {r0} - bx r0 - thumb_func_end task50_startmenu - - thumb_func_start sub_809F9D0 -sub_809F9D0: @ 809F9D0 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r1, =0x02037619 - movs r0, 0 - strb r0, [r1] - strb r0, [r1, 0x1] - ldr r4, =task50_startmenu - adds r0, r4, 0 - movs r1, 0x50 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - adds r2, r5, 0 - bl set_task_function_and_args_14_15 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809F9D0 - - thumb_func_start sub_809FA00 -sub_809FA00: @ 809FA00 - push {lr} - bl sub_809F894 - cmp r0, 0 - beq _0809FA12 - bl sub_80AF688 - movs r0, 0x1 - b _0809FA14 -_0809FA12: - movs r0, 0 -_0809FA14: - pop {r1} - bx r1 - thumb_func_end sub_809FA00 - - thumb_func_start sub_809FA18 -sub_809FA18: @ 809FA18 - ldr r1, =0x02037619 - movs r0, 0 - strb r0, [r1] - strb r0, [r1, 0x1] - ldr r1, =0x03005db0 - ldr r0, =sub_809FA00 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_809FA18 - - thumb_func_start sub_809FA34 -sub_809FA34: @ 809FA34 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0809FA58 - cmp r0, 0x1 - beq _0809FA7C - b _0809FA92 - .pool -_0809FA58: - bl InUnionRoom - cmp r0, 0x1 - bne _0809FA64 - bl var_800D_set_xB -_0809FA64: - ldr r1, =0x03005df4 - ldr r0, =HandleStartMenuInput - str r0, [r1] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0809FA92 - .pool -_0809FA7C: - ldr r0, =0x03005df4 - ldr r0, [r0] - bl _call_via_r0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809FA92 - adds r0, r5, 0 - bl remove_task -_0809FA92: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809FA34 - - thumb_func_start sub_809FA9C -sub_809FA9C: @ 809FA9C - push {lr} - bl is_c1_link_related_active - cmp r0, 0 - bne _0809FAB2 - bl player_bitmagic - bl sub_808B864 - bl sub_808BCF4 -_0809FAB2: - ldr r0, =sub_809FA34 - bl sub_809F9D0 - bl script_env_2_enable - pop {r0} - bx r0 - .pool - thumb_func_end sub_809FA9C - - thumb_func_start HandleStartMenuInput -HandleStartMenuInput: @ 809FAC4 - push {r4,lr} - ldr r4, =0x030022c0 - ldrh r1, [r4, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0809FAE4 - movs r0, 0x5 - bl audio_play - movs r0, 0x1 - negs r0, r0 - bl MoveMenuCursor - ldr r1, =0x0203760e - strb r0, [r1] -_0809FAE4: - ldrh r1, [r4, 0x2E] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0809FAFE - movs r0, 0x5 - bl audio_play - movs r0, 0x1 - bl MoveMenuCursor - ldr r1, =0x0203760e - strb r0, [r1] -_0809FAFE: - ldrh r1, [r4, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0809FB98 - movs r0, 0x5 - bl audio_play - ldr r1, =gUnknown_08510540 - ldr r2, =0x02037610 - ldr r0, =0x0203760e - ldrb r0, [r0] - adds r0, r2 - ldrb r0, [r0] - lsls r0, 3 - adds r1, 0x4 - adds r0, r1 - ldr r1, [r0] - ldr r0, =StartMenu_Pokedex - cmp r1, r0 - bne _0809FB34 - movs r0, 0 - bl pokedex_count - lsls r0, 16 - cmp r0, 0 - beq _0809FBA0 -_0809FB34: - ldr r3, =0x03005df4 - ldr r1, =gUnknown_08510540 - ldr r2, =0x02037610 - ldr r0, =0x0203760e - ldrb r0, [r0] - adds r0, r2 - ldrb r0, [r0] - lsls r0, 3 - adds r1, 0x4 - adds r0, r1 - ldr r1, [r0] - str r1, [r3] - ldr r0, =StartMenu_Save - cmp r1, r0 - beq _0809FBA0 - ldr r0, =StartMenu_Exit - cmp r1, r0 - beq _0809FBA0 - ldr r0, =StartMenu_SafariZoneRetire - cmp r1, r0 - beq _0809FBA0 - ldr r0, =StartMenu_BattlePyramidRetire - cmp r1, r0 - beq _0809FBA0 - movs r0, 0x1 - movs r1, 0 - bl fade_screen - b _0809FBA0 - .pool -_0809FB98: - movs r0, 0xA - ands r0, r1 - cmp r0, 0 - bne _0809FBA4 -_0809FBA0: - movs r0, 0 - b _0809FBAE -_0809FBA4: - bl RemoveExtraStartMenuWindows - bl sub_80A0934 - movs r0, 0x1 -_0809FBAE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end HandleStartMenuInput - - thumb_func_start StartMenu_Pokedex -StartMenu_Pokedex: @ 809FBB4 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0809FBCC - movs r0, 0 - b _0809FBE6 - .pool -_0809FBCC: - movs r0, 0x29 - bl sav12_xor_increment - bl play_some_sound - bl RemoveExtraStartMenuWindows - bl overworld_free_bg_tilemaps - ldr r0, =sub_80BB534 - bl SetMainCallback2 - movs r0, 0x1 -_0809FBE6: - pop {r1} - bx r1 - .pool - thumb_func_end StartMenu_Pokedex - - thumb_func_start StartMenu_Pokemon -StartMenu_Pokemon: @ 809FBF0 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0809FC08 - movs r0, 0 - b _0809FC1C - .pool -_0809FC08: - bl play_some_sound - bl RemoveExtraStartMenuWindows - bl overworld_free_bg_tilemaps - ldr r0, =CB2_PartyMenuFromStartMenu - bl SetMainCallback2 - movs r0, 0x1 -_0809FC1C: - pop {r1} - bx r1 - .pool - thumb_func_end StartMenu_Pokemon - - thumb_func_start StartMenu_Bag -StartMenu_Bag: @ 809FC24 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0809FC3C - movs r0, 0 - b _0809FC50 - .pool -_0809FC3C: - bl play_some_sound - bl RemoveExtraStartMenuWindows - bl overworld_free_bg_tilemaps - ldr r0, =CB2_BagMenuFromStartMenu - bl SetMainCallback2 - movs r0, 0x1 -_0809FC50: - pop {r1} - bx r1 - .pool - thumb_func_end StartMenu_Bag - - thumb_func_start StartMenu_PokeNav -StartMenu_PokeNav: @ 809FC58 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0809FC70 - movs r0, 0 - b _0809FC84 - .pool -_0809FC70: - bl play_some_sound - bl RemoveExtraStartMenuWindows - bl overworld_free_bg_tilemaps - ldr r0, =CB2_PokeNav - bl SetMainCallback2 - movs r0, 0x1 -_0809FC84: - pop {r1} - bx r1 - .pool - thumb_func_end StartMenu_PokeNav - - thumb_func_start StartMenu_PlayerName -StartMenu_PlayerName: @ 809FC8C - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0809FCF4 - bl play_some_sound - bl RemoveExtraStartMenuWindows - bl overworld_free_bg_tilemaps - bl is_c1_link_related_active - cmp r0, 0 - bne _0809FCB6 - bl InUnionRoom - cmp r0, 0 - beq _0809FCC8 -_0809FCB6: - ldr r0, =sub_8086194 - bl sub_80C4DDC - b _0809FCEA - .pool -_0809FCC8: - ldr r0, =0x000008d2 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0809FCE4 - ldr r0, =sub_8086194 - bl sub_80C51C4 - b _0809FCEA - .pool -_0809FCE4: - ldr r0, =sub_8086194 - bl sub_80C4DDC -_0809FCEA: - movs r0, 0x1 - b _0809FCF6 - .pool -_0809FCF4: - movs r0, 0 -_0809FCF6: - pop {r1} - bx r1 - thumb_func_end StartMenu_PlayerName - - thumb_func_start StartMenu_Save -StartMenu_Save: @ 809FCFC - push {lr} - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _0809FD0C - bl RemoveExtraStartMenuWindows -_0809FD0C: - ldr r1, =0x03005df4 - ldr r0, =sub_809FE28 - str r0, [r1] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end StartMenu_Save - - thumb_func_start StartMenu_Option -StartMenu_Option: @ 809FD20 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0809FD38 - movs r0, 0 - b _0809FD52 - .pool -_0809FD38: - bl play_some_sound - bl RemoveExtraStartMenuWindows - bl overworld_free_bg_tilemaps - ldr r0, =CB2_OptionsMenu - bl SetMainCallback2 - ldr r1, =0x030022c0 - ldr r0, =sub_8086194 - str r0, [r1, 0x8] - movs r0, 0x1 -_0809FD52: - pop {r1} - bx r1 - .pool - thumb_func_end StartMenu_Option - - thumb_func_start StartMenu_Exit -StartMenu_Exit: @ 809FD64 - push {lr} - bl RemoveExtraStartMenuWindows - bl sub_80A0934 - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end StartMenu_Exit - - thumb_func_start StartMenu_SafariZoneRetire -StartMenu_SafariZoneRetire: @ 809FD74 - push {lr} - bl RemoveExtraStartMenuWindows - bl sub_80A0934 - bl sub_80FC180 - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end StartMenu_SafariZoneRetire - - thumb_func_start StartMenu_LinkModePlayerName -StartMenu_LinkModePlayerName: @ 809FD88 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0809FDA0 - movs r0, 0 - b _0809FDB4 - .pool -_0809FDA0: - bl play_some_sound - bl overworld_free_bg_tilemaps - ldr r0, =0x03005db4 - ldrb r0, [r0] - ldr r1, =sub_8086194 - bl sub_80C4E74 - movs r0, 0x1 -_0809FDB4: - pop {r1} - bx r1 - .pool - thumb_func_end StartMenu_LinkModePlayerName - - thumb_func_start StartMenu_BattlePyramidRetire -StartMenu_BattlePyramidRetire: @ 809FDC0 - ldr r1, =0x03005df4 - ldr r0, =sub_809FE9C - str r0, [r1] - movs r0, 0 - bx lr - .pool - thumb_func_end StartMenu_BattlePyramidRetire - - thumb_func_start sub_809FDD4 -sub_809FDD4: @ 809FDD4 - push {lr} - movs r0, 0 - movs r1, 0 - bl sub_8197DF8 - bl sub_80984F4 - ldr r0, =sub_809FA34 - bl sub_809F9D0 - bl script_env_2_enable - pop {r0} - bx r0 - .pool - thumb_func_end sub_809FDD4 - - thumb_func_start StartMenu_BattlePyramidBag -StartMenu_BattlePyramidBag: @ 809FDF4 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0809FE0C - movs r0, 0 - b _0809FE20 - .pool -_0809FE0C: - bl play_some_sound - bl RemoveExtraStartMenuWindows - bl overworld_free_bg_tilemaps - ldr r0, =sub_81C4EFC - bl SetMainCallback2 - movs r0, 0x1 -_0809FE20: - pop {r1} - bx r1 - .pool - thumb_func_end StartMenu_BattlePyramidBag - - thumb_func_start sub_809FE28 -sub_809FE28: @ 809FE28 - push {lr} - bl sub_809FF28 - ldr r1, =0x03005df4 - ldr r0, =sub_809FE44 - str r0, [r1] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_809FE28 - - thumb_func_start sub_809FE44 -sub_809FE44: @ 809FE44 - push {lr} - bl sub_809FF4C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809FE7C - cmp r0, 0x1 - ble _0809FE94 - cmp r0, 0x2 - beq _0809FE60 - cmp r0, 0x3 - beq _0809FE7C - b _0809FE94 -_0809FE60: - movs r0, 0 - movs r1, 0 - bl sub_8197DF8 - bl sub_809F998 - ldr r1, =0x03005df4 - ldr r0, =HandleStartMenuInput - str r0, [r1] - b _0809FE94 - .pool -_0809FE7C: - movs r0, 0 - movs r1, 0x1 - bl sub_8197DF8 - bl sub_80984F4 - bl script_env_2_disable - bl sub_81A9EC8 - movs r0, 0x1 - b _0809FE96 -_0809FE94: - movs r0, 0 -_0809FE96: - pop {r1} - bx r1 - thumb_func_end sub_809FE44 - - thumb_func_start sub_809FE9C -sub_809FE9C: @ 809FE9C - push {lr} - bl sub_80A0340 - ldr r1, =0x03005df4 - ldr r0, =sub_809FED4 - str r0, [r1] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_809FE9C - - thumb_func_start sub_809FEB8 -sub_809FEB8: @ 809FEB8 - push {lr} - bl sub_809F998 - ldr r1, =0x03005df4 - ldr r0, =HandleStartMenuInput - str r0, [r1] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_809FEB8 - - thumb_func_start sub_809FED4 -sub_809FED4: @ 809FED4 - push {lr} - bl sub_809FF4C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809FEEC - cmp r0, 0x1 - ble _0809FF20 - cmp r0, 0x2 - beq _0809FF00 - b _0809FF20 -_0809FEEC: - bl RemoveExtraStartMenuWindows - ldr r1, =0x03005df4 - ldr r0, =sub_809FEB8 - str r0, [r1] - b _0809FF20 - .pool -_0809FF00: - movs r0, 0 - movs r1, 0x1 - bl sub_8197DF8 - bl sub_80984F4 - bl script_env_2_disable - ldr r0, =gUnknown_08252C88 - bl script_env_1_execute_new_script - movs r0, 0x1 - b _0809FF22 - .pool -_0809FF20: - movs r0, 0 -_0809FF22: - pop {r1} - bx r1 - thumb_func_end sub_809FED4 - - thumb_func_start sub_809FF28 -sub_809FF28: @ 809FF28 - push {lr} - bl save_serialize_map - ldr r1, =0x0203761c - ldr r0, =sub_80A00A0 - str r0, [r1] - ldr r1, =0x02037621 - movs r0, 0 - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_809FF28 - - thumb_func_start sub_809FF4C -sub_809FF4C: @ 809FF4C - push {lr} - bl sub_8197224 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - beq _0809FF78 - ldr r1, =0x02037621 - movs r0, 0 - strb r0, [r1] - ldr r0, =0x0203761c - ldr r0, [r0] - bl _call_via_r0 - lsls r0, 24 - lsrs r0, 24 - b _0809FF7A - .pool -_0809FF78: - movs r0, 0 -_0809FF7A: - pop {r1} - bx r1 - thumb_func_end sub_809FF4C - - thumb_func_start sub_809FF80 -sub_809FF80: @ 809FF80 - push {lr} - bl sub_809FF28 - ldr r0, =task50_save_game - movs r1, 0x50 - bl AddTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_809FF80 - - thumb_func_start sub_809FF98 -sub_809FF98: @ 809FF98 - push {r4,lr} - adds r2, r0, 0 - adds r4, r1, 0 - ldr r0, =0x02021fc4 - adds r1, r2, 0 - bl ExpandStringRefs - movs r0, 0 - movs r1, 0x1 - bl sub_819786C - movs r0, 0x1 - bl AddTextPrinterForMessage_2 - ldr r1, =0x02037621 - movs r0, 0x1 - strb r0, [r1] - ldr r0, =0x0203761c - str r4, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809FF98 - - thumb_func_start task50_save_game -task50_save_game: @ 809FFD0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_809FF4C - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1 - beq _0809FFFC - cmp r1, 0x1 - bgt _0809FFEC - cmp r1, 0 - beq _080A000A - b _080A0000 -_0809FFEC: - cmp r1, 0x3 - bgt _080A0000 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - b _080A0000 - .pool -_0809FFFC: - ldr r0, =0x020375f0 - strh r1, [r0] -_080A0000: - adds r0, r4, 0 - bl remove_task - bl script_env_2_enable_and_set_ctx_running -_080A000A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task50_save_game - - thumb_func_start sub_80A0014 -sub_80A0014: @ 80A0014 - push {lr} - movs r0, 0 - movs r1, 0x1 - bl sub_8197434 - pop {r0} - bx r0 - thumb_func_end sub_80A0014 - - thumb_func_start sub_80A0024 -sub_80A0024: @ 80A0024 - push {lr} - bl sub_80A0888 - pop {r0} - bx r0 - thumb_func_end sub_80A0024 - - thumb_func_start sub_80A0030 -sub_80A0030: @ 80A0030 - ldr r1, =0x02037620 - movs r0, 0x3C - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_80A0030 - - thumb_func_start sub_80A003C -sub_80A003C: @ 80A003C - push {lr} - ldr r1, =0x02037620 - ldrb r0, [r1] - subs r2, r0, 0x1 - strb r2, [r1] - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2C] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080A0064 - lsls r0, r2, 24 - cmp r0, 0 - beq _080A006A - movs r0, 0 - b _080A006C - .pool -_080A0064: - movs r0, 0x5 - bl audio_play -_080A006A: - movs r0, 0x1 -_080A006C: - pop {r1} - bx r1 - thumb_func_end sub_80A003C - - thumb_func_start sub_80A0070 -sub_80A0070: @ 80A0070 - push {lr} - ldr r1, =0x02037620 - ldrb r0, [r1] - cmp r0, 0 - bne _080A0094 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2C] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080A0098 - movs r0, 0x1 - b _080A009A - .pool -_080A0094: - subs r0, 0x1 - strb r0, [r1] -_080A0098: - movs r0, 0 -_080A009A: - pop {r1} - bx r1 - thumb_func_end sub_80A0070 - - thumb_func_start sub_80A00A0 -sub_80A00A0: @ 80A00A0 - push {lr} - bl get_start_menu_window_id_maybe - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl sub_819746C - bl remove_start_menu_window_maybe - bl sub_80A06B4 - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _080A00D4 - ldr r0, =gUnknown_08252CA7 - ldr r1, =sub_80A00EC - bl sub_809FF98 - b _080A00DC - .pool -_080A00D4: - ldr r0, =gUnknown_082C87B4 - ldr r1, =sub_80A00EC - bl sub_809FF98 -_080A00DC: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A00A0 - - thumb_func_start sub_80A00EC -sub_80A00EC: @ 80A00EC - push {lr} - bl sub_8197930 - ldr r1, =0x0203761c - ldr r0, =sub_80A0108 - str r0, [r1] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A00EC - - thumb_func_start sub_80A0108 -sub_80A0108: @ 80A0108 - push {lr} - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _080A012A - cmp r1, 0 - bgt _080A0124 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _080A0168 - b _080A0174 -_080A0124: - cmp r1, 0x1 - beq _080A0168 - b _080A0174 -_080A012A: - ldr r0, =0x03006210 - ldrh r0, [r0] - cmp r0, 0 - beq _080A0136 - cmp r0, 0x2 - bne _080A013E -_080A0136: - ldr r0, =0x020322d4 - ldrb r0, [r0] - cmp r0, 0 - bne _080A0158 -_080A013E: - ldr r1, =0x0203761c - ldr r0, =sub_80A017C - str r0, [r1] - b _080A0174 - .pool -_080A0158: - ldr r1, =0x0203761c - ldr r0, =sub_80A0234 - str r0, [r1] - b _080A0174 - .pool -_080A0168: - bl sub_80A0024 - bl sub_80A0014 - movs r0, 0x2 - b _080A0176 -_080A0174: - movs r0, 0 -_080A0176: - pop {r1} - bx r1 - thumb_func_end sub_80A0108 - - thumb_func_start sub_80A017C -sub_80A017C: @ 80A017C - push {lr} - ldr r0, =0x020322d4 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080A019C - ldr r0, =gUnknown_082C8845 - ldr r1, =sub_80A01B4 - bl sub_809FF98 - b _080A01A4 - .pool -_080A019C: - ldr r0, =gUnknown_082C87D5 - ldr r1, =sub_80A01D0 - bl sub_809FF98 -_080A01A4: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A017C - - thumb_func_start sub_80A01B4 -sub_80A01B4: @ 80A01B4 - push {lr} - movs r0, 0x1 - bl sub_8197948 - ldr r1, =0x0203761c - ldr r0, =sub_80A01EC - str r0, [r1] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A01B4 - - thumb_func_start sub_80A01D0 -sub_80A01D0: @ 80A01D0 - push {lr} - bl sub_8197930 - ldr r1, =0x0203761c - ldr r0, =sub_80A01EC - str r0, [r1] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A01D0 - - thumb_func_start sub_80A01EC -sub_80A01EC: @ 80A01EC - push {lr} - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _080A020E - cmp r1, 0 - bgt _080A0208 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _080A0220 - b _080A022C -_080A0208: - cmp r1, 0x1 - beq _080A0220 - b _080A022C -_080A020E: - ldr r1, =0x0203761c - ldr r0, =sub_80A0234 - str r0, [r1] - b _080A022C - .pool -_080A0220: - bl sub_80A0024 - bl sub_80A0014 - movs r0, 0x2 - b _080A022E -_080A022C: - movs r0, 0 -_080A022E: - pop {r1} - bx r1 - thumb_func_end sub_80A01EC - - thumb_func_start sub_80A0234 -sub_80A0234: @ 80A0234 - push {lr} - ldr r0, =gUnknown_082C8810 - ldr r1, =sub_80A024C - bl sub_809FF98 - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A0234 - - thumb_func_start sub_80A024C -sub_80A024C: @ 80A024C - push {r4,lr} - movs r0, 0 - bl sav12_xor_increment - bl sub_81A9E90 - ldr r4, =0x020322d4 - ldrb r0, [r4] - cmp r0, 0x1 - bne _080A0274 - movs r0, 0x4 - bl save_game_when_memory_present - lsls r0, 24 - lsrs r1, r0, 24 - movs r0, 0 - strb r0, [r4] - b _080A027E - .pool -_080A0274: - movs r0, 0 - bl save_game_when_memory_present - lsls r0, 24 - lsrs r1, r0, 24 -_080A027E: - cmp r1, 0x1 - bne _080A0294 - ldr r0, =gUnknown_082C8832 - ldr r1, =sub_80A02B0 - bl sub_809FF98 - b _080A029C - .pool -_080A0294: - ldr r0, =gUnknown_082C892A - ldr r1, =sub_80A02FC - bl sub_809FF98 -_080A029C: - bl sub_80A0030 - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A024C - - thumb_func_start sub_80A02B0 -sub_80A02B0: @ 80A02B0 - push {lr} - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _080A02CA - movs r0, 0x37 - bl audio_play - ldr r1, =0x0203761c - ldr r0, =sub_80A02D8 - str r0, [r1] -_080A02CA: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A02B0 - - thumb_func_start sub_80A02D8 -sub_80A02D8: @ 80A02D8 - push {lr} - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - bne _080A02F6 - bl sub_80A003C - lsls r0, 24 - cmp r0, 0 - beq _080A02F6 - bl sub_80A0024 - movs r0, 0x1 - b _080A02F8 -_080A02F6: - movs r0, 0 -_080A02F8: - pop {r1} - bx r1 - thumb_func_end sub_80A02D8 - - thumb_func_start sub_80A02FC -sub_80A02FC: @ 80A02FC - push {lr} - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _080A0316 - movs r0, 0x16 - bl audio_play - ldr r1, =0x0203761c - ldr r0, =sub_80A0324 - str r0, [r1] -_080A0316: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A02FC - - thumb_func_start sub_80A0324 -sub_80A0324: @ 80A0324 - push {lr} - bl sub_80A0070 - lsls r0, 24 - cmp r0, 0 - beq _080A0338 - bl sub_80A0024 - movs r0, 0x3 - b _080A033A -_080A0338: - movs r0, 0 -_080A033A: - pop {r1} - bx r1 - thumb_func_end sub_80A0324 - - thumb_func_start sub_80A0340 -sub_80A0340: @ 80A0340 - ldr r1, =0x0203761c - ldr r0, =sub_80A035C - str r0, [r1] - ldr r1, =0x02037621 - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_80A0340 - - thumb_func_start sub_80A035C -sub_80A035C: @ 80A035C - push {lr} - bl get_start_menu_window_id_maybe - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl sub_819746C - bl remove_start_menu_window_maybe - ldr r0, =gUnknown_08252CFB - ldr r1, =sub_80A0388 - bl sub_809FF98 - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A035C - - thumb_func_start sub_80A0388 -sub_80A0388: @ 80A0388 - push {lr} - movs r0, 0x1 - bl sub_8197948 - ldr r1, =0x0203761c - ldr r0, =sub_80A03A4 - str r0, [r1] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A0388 - - thumb_func_start sub_80A03A4 -sub_80A03A4: @ 80A03A4 - push {lr} - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _080A03C6 - cmp r1, 0 - bgt _080A03C0 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _080A03CA - b _080A03D2 -_080A03C0: - cmp r1, 0x1 - beq _080A03CA - b _080A03D2 -_080A03C6: - movs r0, 0x2 - b _080A03D4 -_080A03CA: - bl sub_80A0014 - movs r0, 0x1 - b _080A03D4 -_080A03D2: - movs r0, 0 -_080A03D4: - pop {r1} - bx r1 - thumb_func_end sub_80A03A4 - - thumb_func_start sub_80A03D8 -sub_80A03D8: @ 80A03D8 - push {lr} - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_80A03D8 - - thumb_func_start sub_80A03E4 -sub_80A03E4: @ 80A03E4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - mov r8, r0 - ldrb r0, [r0] - cmp r0, 0x4 - bls _080A03F6 - b _080A04FC -_080A03F6: - lsls r0, 2 - ldr r1, =_080A0404 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080A0404: - .4byte _080A0418 - .4byte _080A0490 - .4byte _080A04A2 - .4byte _080A04D4 - .4byte _080A04F8 -_080A0418: - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0 - bl SetVBlankCallback - bl remove_some_task - movs r2, 0xA0 - lsls r2, 19 - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r1, =0x040000d4 - mov r0, sp - str r0, [r1] - str r2, [r1, 0x4] - ldr r0, =0x81000200 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - movs r2, 0xC0 - lsls r2, 19 - movs r3, 0xC0 - lsls r3, 9 - mov r4, sp - movs r6, 0 - movs r5, 0x80 - lsls r5, 5 - ldr r7, =0x81000800 - movs r0, 0x81 - lsls r0, 24 - mov r12, r0 -_080A045A: - strh r6, [r4] - mov r0, sp - str r0, [r1] - str r2, [r1, 0x4] - str r7, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r2, r5 - subs r3, r5 - cmp r3, r5 - bhi _080A045A - strh r6, [r4] - mov r0, sp - str r0, [r1] - str r2, [r1, 0x4] - lsrs r0, r3, 1 - mov r2, r12 - orrs r0, r2 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - b _080A04FC - .pool -_080A0490: - bl ResetAllObjectData - bl clear_tasks - bl sub_80A1A74 - bl dp12_8087EA4 - b _080A04FC -_080A04A2: - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085105A8 - movs r0, 0 - movs r2, 0x1 - bl InitBgsFromTemplates - ldr r0, =gUnknown_085105AC - bl InitWindows - movs r0, 0 - movs r1, 0x8 - movs r2, 0xE0 - bl box_border_load_tiles_and_pal - movs r0, 0xF0 - bl sub_81978B0 - b _080A04FC - .pool -_080A04D4: - movs r0, 0 - bl ShowBg - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - ldr r0, =sub_80A03D8 - bl SetVBlankCallback - movs r0, 0x1 - bl EnableInterrupts - b _080A04FC - .pool -_080A04F8: - movs r0, 0x1 - b _080A0506 -_080A04FC: - mov r1, r8 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r0, 0 -_080A0506: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80A03E4 - - thumb_func_start sub_80A0514 -sub_80A0514: @ 80A0514 - push {lr} - ldr r0, =0x030026f8 - bl sub_80A03E4 - cmp r0, 0 - beq _080A052E - ldr r0, =sub_80A0550 - movs r1, 0x50 - bl AddTask - ldr r0, =sub_80A0540 - bl SetMainCallback2 -_080A052E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A0514 - - thumb_func_start sub_80A0540 -sub_80A0540: @ 80A0540 - push {lr} - bl RunActiveTasks - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_80A0540 - - thumb_func_start sub_80A0550 -sub_80A0550: @ 80A0550 - push {r4-r6,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r5, r0, r1 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080A0570 - b _080A06A8 -_080A0570: - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0x6 - bls _080A057A - b _080A06A8 -_080A057A: - lsls r0, 2 - ldr r1, =_080A0590 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080A0590: - .4byte _080A05AC - .4byte _080A0630 - .4byte _080A063C - .4byte _080A065C - .4byte _080A0670 - .4byte _080A0688 - .4byte _080A0698 -_080A05AC: - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r2, =gUnknown_082C8959 - movs r4, 0 - str r4, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r6, 0x1 - str r6, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - movs r3, 0xFF - bl AddTextPrinterParametrized - movs r0, 0 - movs r1, 0x8 - movs r2, 0xE - bl sub_8098858 - movs r0, 0 - bl PutWindowTilemap - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0x1 - negs r0, r0 - str r4, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _080A0620 - bl InUnionRoom - cmp r0, 0 - beq _080A0620 - bl sub_800A07C - cmp r0, 0 - beq _080A061C - strh r6, [r5] - b _080A06A8 - .pool -_080A061C: - movs r0, 0x5 - b _080A06A6 -_080A0620: - ldr r0, =0x03002700 - movs r1, 0x1 - strb r1, [r0] - movs r0, 0x1 - b _080A06A6 - .pool -_080A0630: - bl sub_8076D5C - bl sub_8153430 - movs r0, 0x2 - b _080A06A6 -_080A063C: - bl sub_8153474 - lsls r0, 24 - cmp r0, 0 - beq _080A06A8 - bl sav2_gender2_inplace_and_xFE - movs r0, 0x3 - strh r0, [r5] - ldr r1, =0x03002700 - movs r0, 0 - strb r0, [r1] - b _080A06A8 - .pool -_080A065C: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - movs r0, 0x4 - b _080A06A6 -_080A0670: - bl FreeAllWindowBuffers - ldr r0, =0x030022c0 - ldr r0, [r0, 0x8] - bl SetMainCallback2 - adds r0, r4, 0 - bl remove_task - b _080A06A8 - .pool -_080A0688: - ldr r0, =sub_8153688 - movs r1, 0x5 - bl AddTask - movs r0, 0x6 - b _080A06A6 - .pool -_080A0698: - ldr r0, =sub_8153688 - bl is_function_an_active_task - lsls r0, 24 - cmp r0, 0 - bne _080A06A8 - movs r0, 0x3 -_080A06A6: - strh r0, [r5] -_080A06A8: - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A0550 - - thumb_func_start sub_80A06B4 -sub_80A06B4: @ 80A06B4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - ldr r0, =gUnknown_085105BC - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp, 0xC] - str r1, [sp, 0x10] - ldr r0, =0x00000861 - mov r10, r0 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _080A06EC - add r0, sp, 0xC - ldrb r1, [r0, 0x4] - subs r1, 0x2 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =0xffffff00 - ldr r0, [sp, 0x10] - ands r0, r2 - orrs r0, r1 - str r0, [sp, 0x10] -_080A06EC: - ldr r6, =0x02037622 - add r0, sp, 0xC - bl AddWindow - strb r0, [r6] - ldrb r0, [r6] - movs r1, 0 - bl sub_81973FC - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - movs r1, 0x4 - mov r9, r1 - cmp r0, 0 - bne _080A0710 - movs r0, 0x8 - mov r9, r0 -_080A0710: - movs r4, 0x1 - ldr r5, =0x02021fc4 - movs r0, 0x3 - adds r1, r5, 0 - movs r2, 0x6 - bl sub_819A344 - ldrb r0, [r6] - str r4, [sp] - movs r1, 0xFF - mov r8, r1 - str r1, [sp, 0x4] - movs r7, 0 - str r7, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - movs r3, 0 - bl Print - movs r4, 0x11 - ldrb r0, [r6] - ldr r2, =gUnknown_085EED26 - str r4, [sp] - mov r1, r8 - str r1, [sp, 0x4] - str r7, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - movs r0, 0 - adds r1, r5, 0 - mov r2, r9 - bl sub_819A344 - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x70 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - ldrb r0, [r6] - lsls r2, 16 - lsrs r2, 16 - adds r1, r5, 0 - movs r3, 0x11 - bl sub_819A024 - movs r4, 0x21 - ldrb r0, [r6] - ldr r2, =gUnknown_085EED2D - str r4, [sp] - mov r1, r8 - str r1, [sp, 0x4] - str r7, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - movs r0, 0x4 - adds r1, r5, 0 - mov r2, r9 - bl sub_819A344 - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x70 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - ldrb r0, [r6] - lsls r3, r2, 24 - lsrs r3, 24 - str r4, [sp] - mov r1, r8 - str r1, [sp, 0x4] - str r7, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - bl Print - mov r0, r10 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080A0802 - movs r4, 0x31 - ldrb r0, [r6] - ldr r2, =gUnknown_085EED34 - str r4, [sp] - mov r1, r8 - str r1, [sp, 0x4] - str r7, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - movs r0, 0x1 - adds r1, r5, 0 - mov r2, r9 - bl sub_819A344 - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x70 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - ldrb r0, [r6] - lsls r3, r2, 24 - lsrs r3, 24 - str r4, [sp] - mov r1, r8 - str r1, [sp, 0x4] - str r7, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - bl Print -_080A0802: - adds r4, 0x10 - ldrb r0, [r6] - ldr r2, =gUnknown_085EED3C - lsls r4, 24 - lsrs r4, 24 - str r4, [sp] - mov r1, r8 - str r1, [sp, 0x4] - str r7, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - movs r0, 0x2 - adds r1, r5, 0 - mov r2, r9 - bl sub_819A344 - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x70 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - ldrb r0, [r6] - lsls r3, r2, 24 - lsrs r3, 24 - str r4, [sp] - mov r1, r8 - str r1, [sp, 0x4] - str r7, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - bl Print - ldrb r0, [r6] - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x14 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A06B4 - - thumb_func_start sub_80A0888 -sub_80A0888: @ 80A0888 - push {r4,lr} - ldr r4, =0x02037622 - ldrb r0, [r4] - movs r1, 0 - bl sub_819746C - ldrb r0, [r4] - bl RemoveWindow - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A0888 - - thumb_func_start sub_80A08A4 -sub_80A08A4: @ 80A08A4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =sub_8153688 - bl is_function_an_active_task - lsls r0, 24 - cmp r0, 0 - bne _080A08C0 - adds r0, r4, 0 - bl remove_task - bl script_env_2_enable_and_set_ctx_running -_080A08C0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A08A4 - - thumb_func_start sub_80A08CC -sub_80A08CC: @ 80A08CC - push {r4,r5,lr} - ldr r0, =sub_8153688 - movs r1, 0x5 - bl AddTask - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r5 - movs r1, 0x1 - strh r1, [r0, 0xC] - ldr r0, =sub_80A08A4 - movs r1, 0x6 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r5 - strh r4, [r1, 0xA] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A08CC - - thumb_func_start sub_80A0914 -sub_80A0914: @ 80A0914 - push {lr} - bl get_start_menu_window_id_maybe - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl sub_819746C - bl remove_start_menu_window_maybe - bl sub_80984F4 - bl script_env_2_disable - pop {r0} - bx r0 - thumb_func_end sub_80A0914 - - thumb_func_start sub_80A0934 -sub_80A0934: @ 80A0934 - push {lr} - movs r0, 0x5 - bl audio_play - bl sub_80A0914 - pop {r0} - bx r0 - thumb_func_end sub_80A0934 - - thumb_func_start append_byte -append_byte: @ 80A0944 - ldrb r3, [r1] - adds r0, r3 - strb r2, [r0] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - bx lr - thumb_func_end append_byte - - .include "asm/tileset_animation.s" - - thumb_func_start decompress_palette -@ void decompress_palette(void *src, u16 offset, u16 size) -decompress_palette: @ 80A18F4 - push {r4-r6,lr} - adds r4, r1, 0 - adds r5, r2, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - ldr r6, =0x02037fe8 - adds r1, r6, 0 - bl LZDecompressWram - lsls r4, 1 - ldr r1, =0x02037714 - adds r1, r4, r1 - lsrs r5, 17 - adds r0, r6, 0 - adds r2, r5, 0 - bl CpuSet - ldr r0, =0x02037b14 - adds r4, r0 - adds r0, r6, 0 - adds r1, r4, 0 - adds r2, r5, 0 - bl CpuSet - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end decompress_palette - - thumb_func_start gpu_pal_apply -@ void gpu_pal_apply(void *src, int dest_offset, int mode) -gpu_pal_apply: @ 80A1938 - push {r4-r6,lr} - adds r6, r0, 0 - adds r4, r1, 0 - adds r5, r2, 0 - lsls r4, 16 - lsls r5, 16 - lsrs r4, 15 - ldr r1, =0x02037714 - adds r1, r4, r1 - lsrs r5, 17 - adds r2, r5, 0 - bl CpuSet - ldr r0, =0x02037b14 - adds r4, r0 - adds r0, r6, 0 - adds r1, r4, 0 - adds r2, r5, 0 - bl CpuSet - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end gpu_pal_apply - - thumb_func_start rboxid_80040B8 -rboxid_80040B8: @ 80A1970 - push {r4-r6,lr} - sub sp, 0x4 - adds r6, r0, 0 - adds r4, r1, 0 - adds r5, r2, 0 - lsls r6, 16 - lsrs r6, 16 - lsls r4, 16 - lsls r5, 16 - mov r0, sp - strh r6, [r0] - lsrs r4, 15 - ldr r1, =0x02037714 - adds r1, r4, r1 - lsrs r5, 17 - movs r0, 0x80 - lsls r0, 17 - orrs r5, r0 - mov r0, sp - adds r2, r5, 0 - bl CpuSet - mov r0, sp - adds r0, 0x2 - strh r6, [r0] - ldr r1, =0x02037b14 - adds r4, r1 - adds r1, r4, 0 - adds r2, r5, 0 - bl CpuSet - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end rboxid_80040B8 - - thumb_func_start copy_pal_bg_faded_to_pal_ram -@ void copy_pal_bg_faded_to_pal_ram() -copy_pal_bg_faded_to_pal_ram: @ 80A19C0 - push {r4,r5,lr} - ldr r4, =0x02037fd4 - ldrb r1, [r4, 0x8] - movs r5, 0x80 - adds r0, r5, 0 - ands r0, r1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - bne _080A1A02 - ldr r1, =0x02037b14 - movs r2, 0xA0 - lsls r2, 19 - ldr r0, =0x040000d4 - str r1, [r0] - str r2, [r0, 0x4] - ldr r1, =0x80000200 - str r1, [r0, 0x8] - ldr r0, [r0, 0x8] - ldr r0, =0x02037fe4 - str r3, [r0] - ldrb r1, [r4, 0x9] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x2 - bne _080A1A02 - ldrb r1, [r4, 0x7] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _080A1A02 - bl sub_80A2968 -_080A1A02: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end copy_pal_bg_faded_to_pal_ram - - thumb_func_start fade_and_return_progress_probably -@ int fade_and_return_progress_probably() -fade_and_return_progress_probably: @ 80A1A1C - push {lr} - ldr r0, =0x02037fe4 - ldr r0, [r0] - cmp r0, 0 - beq _080A1A30 - movs r0, 0xFF - b _080A1A68 - .pool -_080A1A30: - ldr r0, =0x02037fd4 - ldrb r0, [r0, 0x9] - movs r1, 0x3 - ands r1, r0 - cmp r1, 0 - bne _080A1A48 - bl pal_fade__0 - b _080A1A56 - .pool -_080A1A48: - cmp r1, 0x1 - bne _080A1A52 - bl pal_fade__1 - b _080A1A56 -_080A1A52: - bl pal_fade__2 -_080A1A56: - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =0x02037fe4 - ldr r0, =0x02037fd4 - ldr r0, [r0] - movs r1, 0 - orrs r0, r1 - str r0, [r2] - adds r0, r3, 0 -_080A1A68: - pop {r1} - bx r1 - .pool - thumb_func_end fade_and_return_progress_probably - - thumb_func_start sub_80A1A74 -sub_80A1A74: @ 80A1A74 - push {r4,lr} - movs r4, 0 -_080A1A78: - adds r0, r4, 0 - bl palslot_dead_struct_update - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _080A1A78 - bl pal_fade_control_reset_maybe - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A1A74 - - thumb_func_start sub_80A1A94 -sub_80A1A94: @ 80A1A94 - push {r4-r7,lr} - movs r0, 0xA0 - lsls r0, 19 - mov r12, r0 - movs r4, 0 - ldr r7, =0x02037714 - ldr r6, =0x02037b14 - ldr r5, =0x000001ff -_080A1AA4: - lsls r1, r4, 1 - adds r3, r1, r7 - mov r0, r12 - adds r2, r1, r0 - ldrh r0, [r2] - strh r0, [r3] - adds r1, r6 - ldrh r0, [r2] - strh r0, [r1] - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, r5 - bls _080A1AA4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A1A94 - - thumb_func_start pal_fade_maybe -pal_fade_maybe: @ 80A1AD4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - ldr r0, [sp, 0x18] - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r12, r2 - lsls r3, 24 - lsrs r7, r3, 24 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldr r5, =0x02037fd4 - ldrb r1, [r5, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080A1B08 - movs r0, 0 - b _080A1C00 - .pool -_080A1B08: - ldrb r0, [r5, 0xA] - movs r3, 0x79 - negs r3, r3 - adds r2, r3, 0 - ands r2, r0 - movs r0, 0x10 - orrs r2, r0 - strb r2, [r5, 0xA] - lsls r0, r6, 24 - asrs r1, r0, 24 - cmp r1, 0 - bge _080A1B36 - lsls r0, r2, 25 - lsrs r0, 28 - negs r1, r1 - adds r0, r1 - movs r1, 0xF - ands r0, r1 - lsls r0, 3 - ands r2, r3 - orrs r2, r0 - strb r2, [r5, 0xA] - movs r6, 0 -_080A1B36: - str r4, [r5] - movs r4, 0x3F - adds r1, r6, 0 - ands r1, r4 - ldrb r2, [r5, 0x4] - movs r3, 0x40 - negs r3, r3 - adds r0, r3, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x4] - ands r6, r4 - ldrb r0, [r5, 0x8] - ands r3, r0 - orrs r3, r6 - strb r3, [r5, 0x8] - movs r0, 0x1F - mov r1, r12 - ands r1, r0 - lsls r1, 6 - ldrh r2, [r5, 0x4] - ldr r0, =0xfffff83f - ands r0, r2 - orrs r0, r1 - strh r0, [r5, 0x4] - lsls r2, r7, 3 - ldrb r1, [r5, 0x5] - movs r0, 0x7 - ands r0, r1 - orrs r0, r2 - strb r0, [r5, 0x5] - ldr r1, =0x00007fff - mov r0, r8 - ands r1, r0 - ldrh r2, [r5, 0x6] - ldr r0, =0xffff8000 - ands r0, r2 - orrs r0, r1 - strh r0, [r5, 0x6] - ldrb r0, [r5, 0x7] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r5, 0x7] - ldrb r1, [r5, 0x9] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - strb r0, [r5, 0x9] - cmp r12, r7 - bcs _080A1BB0 - movs r0, 0x41 - negs r0, r0 - ands r3, r0 - b _080A1BB4 - .pool -_080A1BB0: - movs r0, 0x40 - orrs r3, r0 -_080A1BB4: - strb r3, [r5, 0x8] - bl fade_and_return_progress_probably - ldr r4, =0x02037fd4 - ldrb r1, [r4, 0x8] - lsrs r5, r1, 7 - movs r0, 0x7F - ands r0, r1 - strb r0, [r4, 0x8] - ldr r0, =0x02037b14 - movs r1, 0xA0 - lsls r1, 19 - ldr r2, =0x04000100 - bl CpuSet - ldr r1, =0x02037fe4 - movs r0, 0 - str r0, [r1] - ldrb r1, [r4, 0x9] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x2 - bne _080A1BF0 - ldrb r1, [r4, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080A1BF0 - bl sub_80A2968 -_080A1BF0: - ldr r2, =0x02037fd4 - lsls r3, r5, 7 - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 - orrs r0, r3 - strb r0, [r2, 0x8] - movs r0, 0x1 -_080A1C00: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end pal_fade_maybe - - thumb_func_start sub_80A1C1C -sub_80A1C1C: @ 80A1C1C - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x8 - mov r8, r0 - adds r4, r1, 0 - adds r6, r2, 0 - ldr r5, [sp, 0x1C] - lsls r4, 24 - lsrs r4, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r5, 16 - lsrs r5, 16 - str r3, [sp, 0x4] - bl sub_80A1A94 - lsls r4, 24 - asrs r4, 24 - str r5, [sp] - mov r0, r8 - adds r1, r4, 0 - adds r2, r6, 0 - ldr r3, [sp, 0x4] - bl pal_fade_maybe - lsls r0, 24 - lsrs r0, 24 - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80A1C1C - - thumb_func_start sub_80A1C64 -sub_80A1C64: @ 80A1C64 - push {r4-r7,lr} - adds r6, r1, 0 - lsls r0, 24 - lsrs r7, r0, 24 - movs r5, 0 -_080A1C6E: - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - ldr r1, =0x02037f14 - adds r4, r0, r1 - ldrb r0, [r4, 0x4] - lsls r0, 31 - cmp r0, 0 - beq _080A1CCC - ldr r2, [r4] - ldrb r0, [r2, 0x8] - lsls r0, 31 - lsrs r0, 31 - cmp r0, r7 - bne _080A1CCC - ldrh r1, [r4, 0x6] - lsls r1, 20 - lsrs r1, 25 - ldrb r0, [r2, 0xB] - lsls r0, 27 - lsrs r0, 27 - cmp r1, r0 - bne _080A1CAA - adds r0, r4, 0 - bl sub_80A1F00 - ldrb r0, [r4, 0x4] - lsls r0, 31 - cmp r0, 0 - beq _080A1CCC -_080A1CAA: - ldrb r0, [r4, 0x8] - cmp r0, 0 - bne _080A1CC0 - adds r0, r4, 0 - adds r1, r6, 0 - bl sub_80A1CDC - b _080A1CC4 - .pool -_080A1CC0: - subs r0, 0x1 - strb r0, [r4, 0x8] -_080A1CC4: - adds r0, r4, 0 - adds r1, r6, 0 - bl sub_80A1E40 -_080A1CCC: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0xF - bls _080A1C6E - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80A1C64 - - thumb_func_start sub_80A1CDC -sub_80A1CDC: @ 80A1CDC - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - mov r8, r1 - movs r6, 0 - ldrh r1, [r4, 0x6] - lsls r1, 20 - lsrs r1, 25 - ldr r3, [r4] - ldrb r0, [r3, 0x9] - lsls r2, r0, 25 - lsrs r0, r2, 27 - adds r5, r1, 0 - muls r5, r0 - ldrb r1, [r3, 0x8] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080A1D78 - lsrs r0, r2, 27 - cmp r6, r0 - bcs _080A1DC4 - ldr r0, =0x02037714 - mov r12, r0 - ldr r7, =0x02037b14 -_080A1D10: - ldr r0, [r4, 0x4] - lsls r0, 11 - lsrs r0, 22 - lsls r0, 1 - add r0, r12 - ldr r1, [r3, 0x4] - lsls r2, r5, 1 - adds r1, r2, r1 - ldrh r1, [r1] - strh r1, [r0] - ldr r0, [r4, 0x4] - lsls r0, 11 - lsrs r0, 22 - lsls r0, 1 - adds r0, r7 - ldr r1, [r4] - ldr r1, [r1, 0x4] - adds r2, r1 - ldrh r1, [r2] - strh r1, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r2, [r4, 0x4] - lsls r1, r2, 11 - lsrs r1, 22 - adds r1, 0x1 - ldr r0, =0x000003ff - ands r1, r0 - lsls r1, 11 - ldr r0, =0xffe007ff - ands r0, r2 - orrs r0, r1 - str r0, [r4, 0x4] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r3, [r4] - ldrb r0, [r3, 0x9] - lsls r0, 25 - lsrs r0, 27 - cmp r6, r0 - bcc _080A1D10 - b _080A1DC4 - .pool -_080A1D78: - lsrs r0, r2, 27 - cmp r6, r0 - bcs _080A1DC4 - ldr r3, =0x02037b14 -_080A1D80: - ldr r1, [r4, 0x4] - lsls r1, 11 - lsrs r1, 22 - lsls r1, 1 - adds r1, r3 - ldr r0, [r4] - ldr r2, [r0, 0x4] - lsls r0, r5, 1 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r2, [r4, 0x4] - lsls r1, r2, 11 - lsrs r1, 22 - adds r1, 0x1 - ldr r0, =0x000003ff - ands r1, r0 - lsls r1, 11 - ldr r0, =0xffe007ff - ands r0, r2 - orrs r0, r1 - str r0, [r4, 0x4] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, [r4] - ldrb r0, [r0, 0x9] - lsls r0, 25 - lsrs r0, 27 - cmp r6, r0 - bcc _080A1D80 -_080A1DC4: - ldrh r0, [r4, 0x4] - lsls r0, 21 - lsrs r0, 23 - lsls r0, 11 - ldr r1, [r4, 0x4] - ldr r2, =0xffe007ff - ands r1, r2 - orrs r1, r0 - str r1, [r4, 0x4] - ldr r3, [r4] - ldrb r0, [r3, 0xA] - strb r0, [r4, 0x8] - ldrh r2, [r4, 0x6] - lsls r0, r2, 20 - lsrs r0, 25 - adds r0, 0x1 - movs r1, 0x7F - ands r0, r1 - lsls r0, 5 - ldr r5, =0xfffff01f - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strh r1, [r4, 0x6] - lsls r1, 20 - lsrs r1, 25 - ldrb r0, [r3, 0xB] - lsls r0, 27 - lsrs r0, 27 - cmp r1, r0 - blt _080A1E14 - ldrb r0, [r4, 0x9] - cmp r0, 0 - beq _080A1E0C - subs r0, 0x1 - strb r0, [r4, 0x9] -_080A1E0C: - ldrh r1, [r4, 0x6] - adds r0, r5, 0 - ands r0, r1 - strh r0, [r4, 0x6] -_080A1E14: - ldrh r0, [r4, 0x4] - lsls r0, 21 - lsrs r0, 27 - movs r1, 0x1 - lsls r1, r0 - mov r2, r8 - ldr r0, [r2] - orrs r0, r1 - str r0, [r2] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A1CDC - - thumb_func_start sub_80A1E40 -sub_80A1E40: @ 80A1E40 - push {r4-r6,lr} - adds r4, r0, 0 - ldr r3, =0x02037fd4 - ldrb r1, [r3, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080A1EF4 - ldrh r0, [r4, 0x4] - lsls r0, 21 - lsrs r6, r0, 23 - asrs r1, r6, 4 - movs r5, 0x1 - adds r0, r5, 0 - lsls r0, r1 - ldr r1, [r3] - ands r0, r1 - cmp r0, 0 - beq _080A1EF4 - ldr r2, [r4] - ldrb r1, [r2, 0x8] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - bne _080A1E9C - ldrb r1, [r3, 0x4] - lsls r1, 26 - ldrb r0, [r3, 0x8] - lsls r0, 26 - cmp r1, r0 - beq _080A1EF4 - adds r0, r6, 0 - ldrb r1, [r2, 0x9] - lsls r1, 25 - lsrs r1, 27 - ldrh r2, [r3, 0x4] - lsls r2, 21 - lsrs r2, 27 - ldrh r3, [r3, 0x6] - lsls r3, 17 - lsrs r3, 17 - bl pal_fade_1 - b _080A1EF4 - .pool -_080A1E9C: - ldrb r1, [r3, 0x4] - movs r0, 0x3F - ands r0, r1 - cmp r0, 0 - bne _080A1EF4 - ldrb r0, [r4, 0x8] - ldrb r1, [r2, 0xA] - cmp r0, r1 - beq _080A1EF4 - ldrh r0, [r4, 0x6] - lsls r0, 20 - lsrs r0, 25 - ldrb r1, [r2, 0x9] - lsls r1, 25 - lsrs r2, r1, 27 - adds r5, r0, 0 - muls r5, r2 - movs r3, 0 - adds r1, r2, 0 - cmp r3, r1 - bcs _080A1EF4 - ldr r6, =0x02037b14 -_080A1EC8: - ldrh r1, [r4, 0x4] - lsls r1, 21 - lsrs r1, 23 - adds r1, r3 - lsls r1, 1 - adds r1, r6 - ldr r2, [r4] - adds r0, r5, r3 - ldr r2, [r2, 0x4] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - ldr r0, [r4] - ldrb r0, [r0, 0x9] - lsls r0, 25 - lsrs r0, 27 - cmp r3, r0 - bcc _080A1EC8 -_080A1EF4: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A1E40 - - thumb_func_start sub_80A1F00 -sub_80A1F00: @ 80A1F00 - push {lr} - adds r3, r0, 0 - ldrb r0, [r3, 0x9] - cmp r0, 0 - bne _080A1F50 - ldr r2, [r3] - ldrb r0, [r2, 0xB] - lsrs r0, 5 - cmp r0, 0 - bne _080A1F40 - ldrh r1, [r3, 0x6] - ldr r0, =0xfffff01f - ands r0, r1 - strh r0, [r3, 0x6] - ldrb r0, [r2, 0xA] - strb r0, [r3, 0x8] - ldrb r0, [r2, 0xC] - strb r0, [r3, 0x9] - ldrh r0, [r3, 0x4] - lsls r0, 21 - lsrs r0, 23 - lsls r0, 11 - ldr r1, [r3, 0x4] - ldr r2, =0xffe007ff - ands r1, r2 - orrs r1, r0 - str r1, [r3, 0x4] - b _080A1F54 - .pool -_080A1F40: - cmp r0, 0 - blt _080A1F54 - cmp r0, 0x2 - bgt _080A1F54 - ldrh r0, [r2] - bl sub_80A1F58 - b _080A1F54 -_080A1F50: - subs r0, 0x1 - strb r0, [r3, 0x9] -_080A1F54: - pop {r0} - bx r0 - thumb_func_end sub_80A1F00 - - thumb_func_start sub_80A1F58 -sub_80A1F58: @ 80A1F58 - push {lr} - lsls r0, 16 - lsrs r0, 16 - bl sub_80A20A4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x10 - beq _080A1F6E - bl palslot_dead_struct_update -_080A1F6E: - pop {r0} - bx r0 - thumb_func_end sub_80A1F58 - - thumb_func_start palslot_dead_struct_update -palslot_dead_struct_update: @ 80A1F74 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02037f14 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldr r0, =gUnknown_0852488C - str r0, [r1] - ldrb r2, [r1, 0x4] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x4] - ldrh r2, [r1, 0x4] - ldr r0, =0xfffff803 - ands r0, r2 - strh r0, [r1, 0x4] - ldr r0, [r1, 0x4] - ldr r2, =0xffe007ff - ands r0, r2 - str r0, [r1, 0x4] - ldrh r2, [r1, 0x6] - ldr r0, =0xfffff01f - ands r0, r2 - strh r0, [r1, 0x6] - ldrb r2, [r1, 0x4] - movs r0, 0x3 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x4] - movs r0, 0 - strb r0, [r1, 0x8] - strb r0, [r1, 0x9] - bx lr - .pool - thumb_func_end palslot_dead_struct_update - - thumb_func_start pal_fade_control_reset_maybe -pal_fade_control_reset_maybe: @ 80A1FD0 - ldr r2, =0x02037fd4 - movs r0, 0 - str r0, [r2] - subs r0, 0x40 - ldrb r1, [r2, 0x4] - ands r0, r1 - strb r0, [r2, 0x4] - ldrh r1, [r2, 0x4] - ldr r0, =0xfffff83f - ands r0, r1 - strh r0, [r2, 0x4] - ldrb r1, [r2, 0x5] - movs r0, 0x7 - ands r0, r1 - strb r0, [r2, 0x5] - ldrh r1, [r2, 0x6] - ldr r0, =0xffff8000 - ands r0, r1 - strh r0, [r2, 0x6] - ldrb r1, [r2, 0x7] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x7] - movs r0, 0 - strb r0, [r2, 0x8] - ldrb r1, [r2, 0x9] - movs r3, 0x5 - negs r3, r3 - adds r0, r3, 0 - ands r0, r1 - movs r1, 0x9 - negs r1, r1 - ands r0, r1 - strb r0, [r2, 0x9] - ldrb r1, [r2, 0xA] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0xA] - ldr r0, [r2, 0x8] - ldr r1, =0xfffe0fff - ands r0, r1 - str r0, [r2, 0x8] - ldrb r0, [r2, 0xA] - ands r3, r0 - movs r0, 0x79 - negs r0, r0 - ands r3, r0 - movs r0, 0x10 - orrs r3, r0 - strb r3, [r2, 0xA] - bx lr - .pool - thumb_func_end pal_fade_control_reset_maybe - - thumb_func_start sub_80A2048 -sub_80A2048: @ 80A2048 - push {lr} - lsls r0, 16 - lsrs r0, 16 - bl sub_80A20A4 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x10 - beq _080A206C - ldr r1, =0x02037f14 - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x4] - movs r2, 0x2 - orrs r1, r2 - strb r1, [r0, 0x4] -_080A206C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2048 - - thumb_func_start sub_80A2074 -sub_80A2074: @ 80A2074 - push {lr} - lsls r0, 16 - lsrs r0, 16 - bl sub_80A20A4 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x10 - beq _080A209A - ldr r0, =0x02037f14 - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x4] - movs r0, 0x3 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x4] -_080A209A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2074 - - thumb_func_start sub_80A20A4 -sub_80A20A4: @ 80A20A4 - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - movs r1, 0 - ldr r3, =0x02037f14 -_080A20AE: - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - ldrh r0, [r0] - cmp r0, r2 - bne _080A20C8 - adds r0, r1, 0 - b _080A20D4 - .pool -_080A20C8: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xF - bls _080A20AE - movs r0, 0x10 -_080A20D4: - pop {r1} - bx r1 - thumb_func_end sub_80A20A4 - - thumb_func_start pal_fade__0 -pal_fade__0: @ 80A20D8 - push {r4-r7,lr} - ldr r4, =0x02037fd4 - ldrb r1, [r4, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080A20F0 - movs r0, 0 - b _080A220C - .pool -_080A20F0: - bl sub_80A29BC - lsls r0, 24 - cmp r0, 0 - beq _080A20FE - ldrb r0, [r4, 0x7] - b _080A220A -_080A20FE: - ldrb r1, [r4, 0xA] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - bne _080A2132 - ldrb r2, [r4, 0x4] - lsls r1, r2, 26 - ldrb r0, [r4, 0x8] - lsls r0, 26 - cmp r1, r0 - bcs _080A212A - lsrs r0, r1, 26 - adds r0, 0x1 - movs r1, 0x3F - ands r0, r1 - movs r1, 0x40 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r4, 0x4] - movs r0, 0x2 - b _080A220C -_080A212A: - movs r0, 0x40 - negs r0, r0 - ands r0, r2 - strb r0, [r4, 0x4] -_080A2132: - movs r5, 0 - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0xA] - movs r0, 0x4 - ands r0, r1 - adds r7, r2, 0 - cmp r0, 0 - bne _080A214C - ldrh r4, [r7] - b _080A2152 - .pool -_080A214C: - ldrh r4, [r7, 0x2] - movs r5, 0x80 - lsls r5, 1 -_080A2152: - cmp r4, 0 - beq _080A2184 - ldr r7, =0x02037fd4 - adds r6, r7, 0 -_080A215A: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _080A2176 - ldrh r2, [r6, 0x4] - lsls r2, 21 - lsrs r2, 27 - ldrh r3, [r6, 0x6] - lsls r3, 17 - lsrs r3, 17 - adds r0, r5, 0 - movs r1, 0x10 - bl pal_fade_1 -_080A2176: - lsrs r4, 1 - adds r0, r5, 0 - adds r0, 0x10 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r4, 0 - bne _080A215A -_080A2184: - ldrb r2, [r7, 0xA] - lsls r0, r2, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r4, 0x5 - negs r4, r4 - ands r4, r2 - orrs r4, r1 - strb r4, [r7, 0xA] - movs r0, 0x4 - ands r0, r4 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - bne _080A2208 - ldrh r6, [r7, 0x4] - lsls r2, r6, 21 - ldrb r0, [r7, 0x5] - lsls r5, r0, 24 - lsrs r1, r2, 27 - lsrs r0, r5, 27 - cmp r1, r0 - bne _080A21C4 - str r3, [r7] - movs r0, 0x2 - orrs r4, r0 - strb r4, [r7, 0xA] - b _080A2208 - .pool -_080A21C4: - ldrb r1, [r7, 0x8] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _080A21E0 - lsrs r3, r2, 27 - lsls r0, r4, 25 - lsrs r0, 28 - adds r3, r0, r3 - lsrs r0, r5, 27 - cmp r3, r0 - ble _080A21F6 - adds r3, r0, 0 - b _080A21F6 -_080A21E0: - lsrs r3, r2, 27 - lsls r0, r4, 25 - lsrs r0, 28 - subs r0, r3, r0 - lsls r0, 24 - lsrs r3, r0, 24 - asrs r0, 24 - lsrs r1, r5, 27 - cmp r0, r1 - bge _080A21F6 - adds r3, r1, 0 -_080A21F6: - lsls r0, r3, 24 - asrs r0, 24 - movs r1, 0x1F - ands r0, r1 - lsls r0, 6 - ldr r1, =0xfffff83f - ands r1, r6 - orrs r1, r0 - strh r1, [r7, 0x4] -_080A2208: - ldrb r0, [r7, 0x7] -_080A220A: - lsrs r0, 7 -_080A220C: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end pal_fade__0 - - thumb_func_start sub_80A2218 -sub_80A2218: @ 80A2218 - push {r4-r7,lr} - adds r1, r0, 0 - movs r3, 0 - cmp r1, 0 - beq _080A2256 - ldr r7, =0x02037b14 -_080A2224: - movs r0, 0x1 - ands r0, r1 - lsrs r4, r1, 1 - adds r5, r3, 0 - adds r5, 0x10 - cmp r0, 0 - beq _080A224C - movs r2, 0 - adds r6, r7, 0 -_080A2236: - adds r0, r3, r2 - lsls r0, 1 - adds r0, r6 - ldrh r1, [r0] - mvns r1, r1 - strh r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xF - bls _080A2236 -_080A224C: - adds r1, r4, 0 - lsls r0, r5, 16 - lsrs r3, r0, 16 - cmp r1, 0 - bne _080A2224 -_080A2256: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2218 - - thumb_func_start sub_80A2260 -sub_80A2260: @ 80A2260 - 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 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp] - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x4] - movs r0, 0 - mov r9, r0 - cmp r4, 0 - beq _080A231C - lsls r1, 24 - str r1, [sp, 0x8] -_080A228A: - movs r0, 0x1 - ands r0, r4 - lsrs r4, 1 - str r4, [sp, 0xC] - movs r1, 0x10 - add r1, r9 - mov r10, r1 - cmp r0, 0 - beq _080A230E - movs r4, 0 - ldr r2, =0x02037b14 - mov r8, r2 - ldr r1, [sp] - lsls r0, r1, 24 - ldr r2, [sp, 0x4] - lsls r1, r2, 24 - ldr r2, [sp, 0x8] - asrs r2, 24 - mov r12, r2 - movs r5, 0x1F - asrs r7, r0, 24 - asrs r6, r1, 24 -_080A22B6: - mov r0, r9 - adds r2, r0, r4 - lsls r2, 1 - add r2, r8 - ldr r1, [r2] - lsls r1, 27 - lsrs r1, 27 - add r1, r12 - ands r1, r5 - ldrb r3, [r2] - movs r0, 0x20 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldr r1, [r2] - lsls r1, 22 - lsrs r1, 27 - adds r1, r7 - movs r0, 0x1F - ands r1, r0 - lsls r1, 5 - ldrh r3, [r2] - ldr r0, =0xfffffc1f - ands r0, r3 - orrs r0, r1 - strh r0, [r2] - ldr r1, [r2] - lsls r1, 17 - lsrs r1, 27 - adds r1, r6 - ands r1, r5 - lsls r1, 2 - ldrb r3, [r2, 0x1] - movs r0, 0x7D - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _080A22B6 -_080A230E: - ldr r4, [sp, 0xC] - mov r1, r10 - lsls r0, r1, 16 - lsrs r0, 16 - mov r9, r0 - cmp r4, 0 - bne _080A228A -_080A231C: - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2260 - - thumb_func_start sub_80A2334 -sub_80A2334: @ 80A2334 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r1, r0, 0 - movs r3, 0 - cmp r1, 0 - beq _080A237E - ldr r0, =0x02037b14 - mov r8, r0 - ldr r0, =0x02037714 - mov r12, r0 -_080A234A: - movs r0, 0x1 - ands r0, r1 - lsrs r4, r1, 1 - adds r5, r3, 0 - adds r5, 0x10 - cmp r0, 0 - beq _080A2374 - movs r2, 0 - mov r7, r8 - mov r6, r12 -_080A235E: - adds r0, r3, r2 - lsls r0, 1 - adds r1, r0, r7 - adds r0, r6 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xF - bls _080A235E -_080A2374: - adds r1, r4, 0 - lsls r0, r5, 16 - lsrs r3, r0, 16 - cmp r1, 0 - bne _080A234A -_080A237E: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2334 - - thumb_func_start sub_80A2390 -sub_80A2390: @ 80A2390 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r3, =0x02037fd4 - ldrb r2, [r3, 0xA] - movs r1, 0x79 - negs r1, r1 - ands r1, r2 - movs r2, 0x10 - orrs r1, r2 - strb r1, [r3, 0xA] - bl sub_80A23B4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2390 - - thumb_func_start sub_80A23B4 -sub_80A23B4: @ 80A23B4 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - ldr r2, =0x02037fd4 - ldrh r0, [r2, 0x4] - movs r3, 0xF8 - lsls r3, 3 - adds r1, r3, 0 - orrs r0, r1 - strh r0, [r2, 0x4] - movs r1, 0x3F - ands r1, r4 - ldrb r3, [r2, 0x8] - movs r0, 0x40 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x8] - ldrb r0, [r2, 0x7] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x7] - ldrb r1, [r2, 0x9] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x9] - cmp r4, 0x2 - bne _080A2406 - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r1, =0x02037b14 - ldr r2, =0x01000200 - mov r0, sp - bl CpuSet -_080A2406: - cmp r4, 0 - bne _080A241C - mov r0, sp - adds r0, 0x2 - ldr r2, =0x00007fff - adds r1, r2, 0 - strh r1, [r0] - ldr r1, =0x02037b14 - ldr r2, =0x01000200 - bl CpuSet -_080A241C: - bl fade_and_return_progress_probably - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A23B4 - - thumb_func_start pal_fade__1 -pal_fade__1: @ 80A2438 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - ldr r4, =0x02037fd4 - ldrb r1, [r4, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080A2458 - movs r0, 0 - b _080A2792 - .pool -_080A2458: - bl sub_80A29BC - lsls r0, 24 - cmp r0, 0 - beq _080A2466 - ldrb r0, [r4, 0x7] - b _080A2790 -_080A2466: - ldrb r1, [r4, 0xA] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080A247C - movs r2, 0x80 - lsls r2, 1 - movs r0, 0x80 - lsls r0, 2 - mov r10, r0 - b _080A2484 -_080A247C: - movs r2, 0 - movs r1, 0x80 - lsls r1, 1 - mov r10, r1 -_080A2484: - ldr r1, =0x02037fd4 - ldrb r0, [r1, 0x8] - lsls r0, 26 - lsrs r0, 26 - cmp r0, 0x1 - beq _080A2544 - cmp r0, 0x1 - bgt _080A24A0 - cmp r0, 0 - beq _080A24AE - b _080A2694 - .pool -_080A24A0: - cmp r0, 0x2 - bne _080A24A6 - b _080A25A8 -_080A24A6: - cmp r0, 0x3 - bne _080A24AC - b _080A2630 -_080A24AC: - b _080A2694 -_080A24AE: - adds r7, r2, 0 - cmp r7, r10 - bcc _080A24B6 - b _080A2694 -_080A24B6: - lsls r2, r7, 1 - ldr r0, =0x02037714 - adds r0, r2, r0 - ldr r1, [r0] - lsls r3, r1, 27 - lsls r0, r1, 22 - lsrs r0, 27 - mov r12, r0 - lsls r1, 17 - lsrs r1, 27 - mov r8, r1 - ldr r0, =0x02037b14 - adds r2, r0 - mov r9, r2 - ldr r1, [r2] - lsls r2, r1, 27 - lsrs r2, 3 - movs r4, 0xFE - lsls r4, 24 - adds r2, r4 - lsls r0, r1, 22 - lsrs r0, 27 - subs r0, 0x2 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 17 - lsrs r1, 27 - subs r1, 0x2 - lsls r1, 24 - lsrs r4, r1, 24 - lsrs r6, r2, 24 - asrs r2, 24 - lsrs r3, 3 - asrs r0, r3, 24 - cmp r2, r0 - bge _080A2500 - lsrs r6, r3, 24 -_080A2500: - lsls r0, r5, 24 - asrs r0, 24 - mov r2, r12 - lsls r1, r2, 24 - cmp r0, r12 - bge _080A250E - lsrs r5, r1, 24 -_080A250E: - lsls r0, r4, 24 - asrs r0, 24 - mov r3, r8 - lsls r1, r3, 24 - cmp r0, r8 - bge _080A251C - lsrs r4, r1, 24 -_080A251C: - lsls r1, r6, 24 - asrs r1, 24 - lsls r0, r5, 24 - asrs r0, 19 - orrs r1, r0 - lsls r0, r4, 24 - asrs r0, 14 - orrs r1, r0 - mov r4, r9 - strh r1, [r4] - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r7, r10 - bcc _080A24B6 - b _080A2694 - .pool -_080A2544: - adds r7, r2, 0 - cmp r7, r10 - bcc _080A254C - b _080A2694 -_080A254C: - lsls r1, r7, 1 - ldr r0, =0x02037b14 - adds r2, r1, r0 - ldr r1, [r2] - lsls r0, r1, 27 - lsrs r0, 3 - movs r3, 0x80 - lsls r3, 18 - adds r0, r3 - lsrs r6, r0, 24 - lsls r0, r1, 22 - lsrs r0, 27 - adds r5, r0, 0x2 - lsls r1, 17 - lsrs r1, 27 - adds r4, r1, 0x2 - cmp r6, 0x1F - ble _080A2572 - movs r6, 0x1F -_080A2572: - lsls r0, r5, 24 - asrs r0, 24 - cmp r0, 0x1F - ble _080A257C - movs r5, 0x1F -_080A257C: - lsls r0, r4, 24 - asrs r0, 24 - cmp r0, 0x1F - ble _080A2586 - movs r4, 0x1F -_080A2586: - lsls r1, r6, 24 - asrs r1, 24 - lsls r0, r5, 24 - asrs r0, 19 - orrs r1, r0 - lsls r0, r4, 24 - asrs r0, 14 - orrs r1, r0 - strh r1, [r2] - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r7, r10 - bcc _080A254C - b _080A2694 - .pool -_080A25A8: - adds r7, r2, 0 - cmp r7, r10 - bcs _080A2694 -_080A25AE: - lsls r2, r7, 1 - ldr r0, =0x02037714 - adds r0, r2, r0 - ldr r1, [r0] - lsls r3, r1, 27 - lsls r0, r1, 22 - lsrs r0, 27 - mov r12, r0 - lsls r1, 17 - lsrs r1, 27 - mov r8, r1 - ldr r0, =0x02037b14 - adds r2, r0 - ldr r1, [r2] - lsls r0, r1, 27 - lsrs r0, 3 - movs r4, 0x80 - lsls r4, 18 - adds r0, r4 - lsrs r6, r0, 24 - lsls r0, r1, 22 - lsrs r0, 27 - adds r5, r0, 0x2 - lsls r1, 17 - lsrs r1, 27 - adds r4, r1, 0x2 - lsrs r3, 3 - asrs r0, r3, 24 - cmp r6, r0 - ble _080A25EC - lsrs r6, r3, 24 -_080A25EC: - lsls r0, r5, 24 - asrs r0, 24 - mov r3, r12 - lsls r1, r3, 24 - cmp r0, r12 - ble _080A25FA - lsrs r5, r1, 24 -_080A25FA: - lsls r0, r4, 24 - asrs r0, 24 - mov r3, r8 - lsls r1, r3, 24 - cmp r0, r8 - ble _080A2608 - lsrs r4, r1, 24 -_080A2608: - lsls r1, r6, 24 - asrs r1, 24 - lsls r0, r5, 24 - asrs r0, 19 - orrs r1, r0 - lsls r0, r4, 24 - asrs r0, 14 - orrs r1, r0 - strh r1, [r2] - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r7, r10 - bcc _080A25AE - b _080A2694 - .pool -_080A2630: - adds r7, r2, 0 - cmp r7, r10 - bcs _080A2694 - ldr r4, =0x02037b14 - mov r8, r4 -_080A263A: - lsls r0, r7, 1 - mov r1, r8 - adds r3, r0, r1 - ldr r1, [r3] - lsls r2, r1, 27 - lsrs r2, 3 - movs r4, 0xFE - lsls r4, 24 - adds r2, r4 - lsls r0, r1, 22 - lsrs r0, 27 - subs r0, 0x2 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 17 - lsrs r1, 27 - subs r1, 0x2 - lsls r1, 24 - lsrs r4, r1, 24 - lsrs r6, r2, 24 - cmp r2, 0 - bge _080A2668 - movs r6, 0 -_080A2668: - lsls r0, r5, 24 - cmp r0, 0 - bge _080A2670 - movs r5, 0 -_080A2670: - lsls r0, r4, 24 - cmp r0, 0 - bge _080A2678 - movs r4, 0 -_080A2678: - lsls r1, r6, 24 - asrs r1, 24 - lsls r0, r5, 24 - asrs r0, 19 - orrs r1, r0 - lsls r0, r4, 24 - asrs r0, 14 - orrs r1, r0 - strh r1, [r3] - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r7, r10 - bcc _080A263A -_080A2694: - ldr r0, =0x02037fd4 - ldrb r2, [r0, 0xA] - lsls r0, r2, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r3, 0x5 - negs r3, r3 - ands r3, r2 - orrs r3, r1 - ldr r1, =0x02037fd4 - strb r3, [r1, 0xA] - movs r0, 0x4 - ands r0, r3 - cmp r0, 0 - beq _080A26C4 - ldrb r0, [r1, 0x7] - b _080A2790 - .pool -_080A26C4: - ldr r2, =0x02037fd4 - ldrh r4, [r2, 0x4] - lsls r5, r4, 21 - lsrs r0, r5, 27 - lsls r2, r3, 25 - lsrs r1, r2, 28 - subs r0, r1 - cmp r0, 0 - bge _080A26E8 - ldr r0, =0xfffff83f - ands r0, r4 - ldr r3, =0x02037fd4 - strh r0, [r3, 0x4] - b _080A26FE - .pool -_080A26E8: - lsrs r1, r5, 27 - lsrs r0, r2, 28 - subs r1, r0 - movs r0, 0x1F - ands r1, r0 - lsls r1, 6 - ldr r0, =0xfffff83f - ands r0, r4 - orrs r0, r1 - ldr r4, =0x02037fd4 - strh r0, [r4, 0x4] -_080A26FE: - ldr r1, =0x02037fd4 - ldrh r0, [r1, 0x4] - movs r1, 0xF8 - lsls r1, 3 - ands r1, r0 - cmp r1, 0 - bne _080A278C - ldr r2, =0x02037fd4 - ldrb r0, [r2, 0x8] - lsls r0, 26 - lsrs r0, 26 - cmp r0, 0x1 - beq _080A2750 - cmp r0, 0x1 - bgt _080A272C - cmp r0, 0 - beq _080A2736 - b _080A2778 - .pool -_080A272C: - cmp r0, 0x2 - beq _080A2736 - cmp r0, 0x3 - beq _080A276C - b _080A2778 -_080A2736: - ldr r0, =0x02037714 - ldr r1, =0x02037b14 - ldr r2, =0x04000100 - bl CpuSet - b _080A2778 - .pool -_080A2750: - movs r0, 0x1 - negs r0, r0 - str r0, [sp] - ldr r1, =0x02037b14 - ldr r2, =0x05000100 - mov r0, sp - bl CpuSet - b _080A2778 - .pool -_080A276C: - str r1, [sp, 0x4] - add r0, sp, 0x4 - ldr r1, =0x02037b14 - ldr r2, =0x05000100 - bl CpuSet -_080A2778: - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0x9] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x9] - ldrb r0, [r2, 0xA] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2, 0xA] -_080A278C: - ldr r3, =0x02037fd4 - ldrb r0, [r3, 0x7] -_080A2790: - lsrs r0, 7 -_080A2792: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end pal_fade__1 - - thumb_func_start sub_80A27B0 -sub_80A27B0: @ 80A27B0 - push {r4-r7,lr} - ldr r5, [sp, 0x14] - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r7, =0x02037fd4 - str r0, [r7] - movs r0, 0x3F - ands r1, r0 - ldrb r4, [r7, 0x4] - movs r6, 0x40 - negs r6, r6 - adds r0, r6, 0 - ands r0, r4 - orrs r0, r1 - strb r0, [r7, 0x4] - ldrb r0, [r7, 0x8] - ands r6, r0 - orrs r6, r1 - strb r6, [r7, 0x8] - movs r0, 0x1F - adds r1, r2, 0 - ands r1, r0 - lsls r1, 6 - ldrh r4, [r7, 0x4] - ldr r0, =0xfffff83f - ands r0, r4 - orrs r0, r1 - strh r0, [r7, 0x4] - lsls r4, r3, 3 - ldrb r1, [r7, 0x5] - movs r0, 0x7 - ands r0, r1 - orrs r0, r4 - strb r0, [r7, 0x5] - ldrb r0, [r7, 0x7] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r7, 0x7] - ldrb r1, [r7, 0x9] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - movs r1, 0x2 - orrs r0, r1 - movs r1, 0x1 - ands r5, r1 - lsls r5, 2 - subs r1, 0x6 - ands r0, r1 - orrs r0, r5 - subs r1, 0x4 - ands r0, r1 - strb r0, [r7, 0x9] - cmp r2, r3 - bcs _080A2840 - movs r0, 0x41 - negs r0, r0 - ands r6, r0 - b _080A2844 - .pool -_080A2840: - movs r0, 0x40 - orrs r6, r0 -_080A2844: - strb r6, [r7, 0x8] - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80A27B0 - - thumb_func_start pal_fade__2 -pal_fade__2: @ 80A284C - push {r4-r7,lr} - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0x7] - movs r0, 0x80 - ands r0, r1 - adds r4, r2, 0 - cmp r0, 0 - bne _080A2864 - movs r0, 0 - b _080A295C - .pool -_080A2864: - ldrb r2, [r4, 0x4] - lsls r1, r2, 26 - ldrb r3, [r4, 0x8] - lsls r0, r3, 26 - cmp r1, r0 - bcs _080A2886 - lsrs r0, r1, 26 - adds r0, 0x1 - movs r1, 0x3F - ands r0, r1 - movs r1, 0x40 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r4, 0x4] - movs r0, 0x2 - b _080A295C -_080A2886: - movs r0, 0x40 - negs r0, r0 - ands r0, r2 - strb r0, [r4, 0x4] - movs r0, 0x40 - ands r0, r3 - cmp r0, 0 - bne _080A28E4 - ldrh r1, [r4, 0x4] - lsls r0, r1, 21 - lsrs r0, 27 - adds r0, 0x1 - movs r7, 0x1F - ands r0, r7 - lsls r0, 6 - ldr r6, =0xfffff83f - adds r3, r6, 0 - ands r3, r1 - orrs r3, r0 - strh r3, [r4, 0x4] - lsls r5, r3, 21 - ldrb r0, [r4, 0x5] - lsrs r1, r5, 27 - lsrs r0, 3 - cmp r1, r0 - bls _080A2930 - ldrb r2, [r4, 0x9] - lsls r1, r2, 28 - lsrs r1, 31 - adds r1, 0x1 - movs r0, 0x1 - ands r1, r0 - lsls r1, 3 - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x9] - lsrs r0, r5, 27 - subs r0, 0x1 - ands r0, r7 - lsls r0, 6 - ands r3, r6 - b _080A292C - .pool -_080A28E4: - ldrh r2, [r4, 0x4] - lsls r1, r2, 21 - lsrs r0, r1, 27 - subs r0, 0x1 - movs r6, 0x1F - ands r0, r6 - lsls r0, 6 - ldr r5, =0xfffff83f - adds r3, r5, 0 - ands r3, r2 - orrs r3, r0 - strh r3, [r4, 0x4] - lsrs r1, 27 - subs r1, 0x1 - ldrb r0, [r4, 0x5] - lsrs r0, 3 - cmp r1, r0 - bge _080A2930 - ldrb r2, [r4, 0x9] - lsls r1, r2, 28 - lsrs r1, 31 - adds r1, 0x1 - movs r0, 0x1 - ands r1, r0 - lsls r1, 3 - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x9] - lsls r0, r3, 21 - lsrs r0, 27 - adds r0, 0x1 - ands r0, r6 - lsls r0, 6 - ands r3, r5 -_080A292C: - orrs r3, r0 - strh r3, [r4, 0x4] -_080A2930: - ldrb r1, [r4, 0x9] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _080A2958 - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080A294E - movs r0, 0 - str r0, [r4] - ldrh r1, [r4, 0x4] - ldr r0, =0xfffff83f - ands r0, r1 - strh r0, [r4, 0x4] -_080A294E: - ldrb r1, [r4, 0x9] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x9] -_080A2958: - ldrb r0, [r4, 0x7] - lsrs r0, 7 -_080A295C: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end pal_fade__2 - - thumb_func_start sub_80A2968 -sub_80A2968: @ 80A2968 - push {r4,lr} - ldr r4, =0x02037fd4 - ldrh r1, [r4] - movs r0, 0x50 - bl SetGpuReg - ldrh r1, [r4, 0x4] - lsls r1, 21 - lsrs r1, 27 - movs r0, 0x54 - bl SetGpuReg - ldrb r1, [r4, 0x9] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _080A29AC - movs r0, 0x9 - negs r0, r0 - ands r0, r1 - movs r1, 0x4 - negs r1, r1 - ands r0, r1 - strb r0, [r4, 0x9] - movs r0, 0 - str r0, [r4] - ldrh r1, [r4, 0x4] - ldr r0, =0xfffff83f - ands r0, r1 - strh r0, [r4, 0x4] - ldrb r1, [r4, 0x7] - movs r0, 0x7F - ands r0, r1 - strb r0, [r4, 0x7] -_080A29AC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2968 - - thumb_func_start sub_80A29BC -sub_80A29BC: @ 80A29BC - push {r4,lr} - ldr r3, =0x02037fd4 - ldrb r4, [r3, 0xA] - movs r0, 0x2 - ands r0, r4 - cmp r0, 0 - beq _080A2A18 - ldr r2, [r3, 0x8] - movs r0, 0xF8 - lsls r0, 9 - ands r0, r2 - movs r1, 0x80 - lsls r1, 7 - cmp r0, r1 - bne _080A29FC - ldrb r1, [r3, 0x7] - movs r0, 0x7F - ands r0, r1 - strb r0, [r3, 0x7] - movs r0, 0x3 - negs r0, r0 - ands r0, r4 - strb r0, [r3, 0xA] - ldr r0, [r3, 0x8] - ldr r1, =0xfffe0fff - ands r0, r1 - str r0, [r3, 0x8] - b _080A2A10 - .pool -_080A29FC: - lsls r0, r2, 15 - lsrs r0, 27 - adds r0, 0x1 - movs r1, 0x1F - ands r0, r1 - lsls r0, 12 - ldr r1, =0xfffe0fff - ands r1, r2 - orrs r1, r0 - str r1, [r3, 0x8] -_080A2A10: - movs r0, 0x1 - b _080A2A1A - .pool -_080A2A18: - movs r0, 0 -_080A2A1A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80A29BC - - thumb_func_start sub_80A2A20 -sub_80A2A20: @ 80A2A20 - push {r4-r7,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 16 - lsrs r6, r2, 16 - movs r5, 0 - cmp r4, 0 - beq _080A2A54 -_080A2A32: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _080A2A46 - adds r0, r5, 0 - movs r1, 0x10 - adds r2, r7, 0 - adds r3, r6, 0 - bl pal_fade_1 -_080A2A46: - lsrs r4, 1 - adds r0, r5, 0 - adds r0, 0x10 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r4, 0 - bne _080A2A32 -_080A2A54: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80A2A20 - - thumb_func_start sub_80A2A5C -sub_80A2A5C: @ 80A2A5C - push {r4,r5,lr} - lsls r1, 24 - lsrs r1, 24 - lsls r2, 16 - lsrs r2, 16 - ldr r4, =0x02037714 - ldr r5, =0x02037b14 - ldr r3, =0x040000d4 - str r4, [r3] - str r5, [r3, 0x4] - ldr r4, =0x84000100 - str r4, [r3, 0x8] - ldr r3, [r3, 0x8] - bl sub_80A2A20 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2A5C - - thumb_func_start TintPalette_GrayScale -TintPalette_GrayScale: @ 80A2A90 - push {r4-r6,lr} - adds r4, r0, 0 - lsls r1, 16 - lsrs r1, 16 - cmp r1, 0 - beq _080A2AD8 - movs r6, 0x1F - adds r5, r1, 0 -_080A2AA0: - ldrh r1, [r4] - movs r2, 0x1F - ands r2, r1 - lsls r1, 16 - lsrs r3, r1, 21 - ands r3, r6 - lsrs r1, 26 - ands r1, r6 - movs r0, 0x4C - muls r2, r0 - movs r0, 0x97 - muls r0, r3 - adds r2, r0 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r1 - adds r2, r0 - asrs r2, 8 - lsls r0, r2, 10 - lsls r1, r2, 5 - orrs r0, r1 - orrs r0, r2 - strh r0, [r4] - adds r4, 0x2 - subs r5, 0x1 - cmp r5, 0 - bne _080A2AA0 -_080A2AD8: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end TintPalette_GrayScale - - thumb_func_start sub_80A2AE0 -sub_80A2AE0: @ 80A2AE0 - push {r4-r7,lr} - adds r4, r0, 0 - lsls r1, 16 - lsrs r1, 16 - cmp r1, 0 - beq _080A2B34 - movs r6, 0x1F - ldr r7, =gUnknown_0852489C - adds r5, r1, 0 -_080A2AF2: - ldrh r1, [r4] - movs r2, 0x1F - ands r2, r1 - lsls r1, 16 - lsrs r3, r1, 21 - ands r3, r6 - lsrs r1, 26 - ands r1, r6 - movs r0, 0x4C - muls r2, r0 - movs r0, 0x97 - muls r0, r3 - adds r2, r0 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r1 - adds r2, r0 - asrs r2, 8 - cmp r2, 0x1F - bls _080A2B1E - movs r2, 0x1F -_080A2B1E: - adds r0, r2, r7 - ldrb r2, [r0] - lsls r0, r2, 10 - lsls r1, r2, 5 - orrs r0, r1 - orrs r0, r2 - strh r0, [r4] - adds r4, 0x2 - subs r5, 0x1 - cmp r5, 0 - bne _080A2AF2 -_080A2B34: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2AE0 - - thumb_func_start TintPalette_SepiaTone -TintPalette_SepiaTone: @ 80A2B40 - push {r4-r7,lr} - adds r5, r0, 0 - lsls r1, 16 - lsrs r1, 16 - cmp r1, 0 - beq _080A2BA2 - movs r7, 0x1F - adds r6, r1, 0 -_080A2B50: - ldrh r0, [r5] - movs r1, 0x1F - ands r1, r0 - lsls r0, 16 - lsrs r2, r0, 21 - ands r2, r7 - lsrs r3, r0, 26 - ands r3, r7 - movs r0, 0x4C - muls r1, r0 - movs r0, 0x97 - muls r0, r2 - adds r1, r0 - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r3 - adds r1, r0 - asrs r1, 8 - ldr r0, =0x00000133 - muls r0, r1 - lsls r0, 16 - lsrs r2, r0, 24 - lsls r0, r1, 24 - lsrs r4, r0, 24 - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 20 - lsrs r3, r0, 24 - cmp r2, 0x1F - ble _080A2B90 - movs r2, 0x1F -_080A2B90: - lsls r0, r3, 10 - lsls r1, r4, 5 - orrs r0, r1 - orrs r0, r2 - strh r0, [r5] - adds r5, 0x2 - subs r6, 0x1 - cmp r6, 0 - bne _080A2B50 -_080A2BA2: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end TintPalette_SepiaTone - - thumb_func_start sub_80A2BAC -sub_80A2BAC: @ 80A2BAC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r5, r0, 0 - ldr r0, [sp, 0x1C] - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r2, 16 - mov r9, r2 - lsls r3, 16 - lsrs r3, 16 - mov r8, r3 - lsls r0, 16 - lsrs r0, 16 - mov r12, r0 - cmp r1, 0 - beq _080A2C38 - movs r7, 0x1F - adds r6, r1, 0 -_080A2BD6: - ldrh r0, [r5] - movs r1, 0x1F - ands r1, r0 - lsls r0, 16 - lsrs r2, r0, 21 - ands r2, r7 - lsrs r3, r0, 26 - ands r3, r7 - movs r0, 0x4C - muls r1, r0 - movs r0, 0x97 - muls r0, r2 - adds r1, r0 - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r3 - adds r1, r0 - asrs r1, 8 - mov r0, r9 - muls r0, r1 - lsls r0, 16 - lsrs r4, r0, 24 - mov r0, r8 - muls r0, r1 - lsls r0, 16 - lsrs r2, r0, 24 - mov r0, r12 - muls r0, r1 - lsls r0, 16 - lsrs r3, r0, 24 - cmp r4, 0x1F - ble _080A2C1A - movs r4, 0x1F -_080A2C1A: - cmp r2, 0x1F - ble _080A2C20 - movs r2, 0x1F -_080A2C20: - cmp r3, 0x1F - ble _080A2C26 - movs r3, 0x1F -_080A2C26: - lsls r0, r3, 10 - lsls r1, r2, 5 - orrs r0, r1 - orrs r0, r4 - strh r0, [r5] - adds r5, 0x2 - subs r6, 0x1 - cmp r6, 0 - bne _080A2BD6 -_080A2C38: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80A2BAC - - thumb_func_start sub_80A2C44 -sub_80A2C44: @ 80A2C44 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r10, r0 - adds r4, r1, 0 - ldr r0, [sp, 0x20] - ldr r1, [sp, 0x24] - ldr r5, [sp, 0x28] - lsls r4, 24 - lsrs r4, 24 - lsls r2, 24 - lsrs r7, r2, 24 - lsls r3, 24 - lsrs r6, r3, 24 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - lsls r1, 24 - lsrs r1, 24 - lsls r5, 24 - lsrs r5, 24 - mov r8, r5 - ldr r0, =sub_80A2D54 - bl AddTask - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r1, r0, r1 - strh r7, [r1, 0x8] - strh r6, [r1, 0xA] - lsls r4, 24 - asrs r4, 24 - cmp r4, 0 - blt _080A2CA4 - strh r4, [r1, 0xE] - movs r0, 0x1 - b _080A2CAC - .pool -_080A2CA4: - movs r0, 0 - strh r0, [r1, 0xE] - negs r0, r4 - adds r0, 0x1 -_080A2CAC: - strh r0, [r1, 0xC] - lsls r4, r5, 2 - cmp r6, r7 - bcs _080A2CC4 - ldr r0, =0x03005e00 - adds r1, r4, r5 - lsls r1, 3 - adds r1, r0 - movs r2, 0xC - ldrsh r0, [r1, r2] - negs r0, r0 - strh r0, [r1, 0xC] -_080A2CC4: - adds r0, r5, 0 - movs r1, 0x5 - mov r2, r10 - bl set_word_task_arg - ldr r0, =0x03005e00 - adds r1, r4, r5 - lsls r1, 3 - adds r1, r0 - mov r0, r9 - strh r0, [r1, 0x16] - mov r2, r8 - strh r2, [r1, 0x18] - ldr r1, [r1] - adds r0, r5, 0 - bl _call_via_r1 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2C44 - - thumb_func_start sub_80A2CF8 -sub_80A2CF8: @ 80A2CF8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r3, r0, 24 - movs r2, 0 - ldr r4, =sub_80A2D54 - ldr r1, =0x03005e00 -_080A2D04: - ldrb r0, [r1, 0x4] - cmp r0, 0x1 - bne _080A2D24 - ldr r0, [r1] - cmp r0, r4 - bne _080A2D24 - movs r5, 0x18 - ldrsh r0, [r1, r5] - cmp r0, r3 - bne _080A2D24 - movs r0, 0x1 - b _080A2D2E - .pool -_080A2D24: - adds r1, 0x28 - adds r2, 0x1 - cmp r2, 0xF - ble _080A2D04 - movs r0, 0 -_080A2D2E: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80A2CF8 - - thumb_func_start sub_80A2D34 -sub_80A2D34: @ 80A2D34 - push {lr} - b _080A2D3C -_080A2D38: - bl remove_task -_080A2D3C: - ldr r0, =sub_80A2D54 - bl get_task_id_by_function - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _080A2D38 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2D34 - - thumb_func_start sub_80A2D54 -sub_80A2D54: @ 80A2D54 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - adds r0, r5, 0 - movs r1, 0x5 - bl get_word_task_arg - adds r3, r0, 0 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x6 - ldrsh r1, [r4, r2] - cmp r0, r1 - ble _080A2DCC - movs r0, 0 - strh r0, [r4, 0x8] - ldrb r1, [r4] - ldrh r2, [r4, 0xE] - adds r0, r3, 0 - bl sub_80A2A20 - ldrh r1, [r4] - movs r6, 0 - ldrsh r0, [r4, r6] - ldrh r3, [r4, 0x2] - movs r6, 0x2 - ldrsh r2, [r4, r6] - cmp r0, r2 - bne _080A2DAC - adds r0, r5, 0 - bl remove_task - b _080A2DCC - .pool -_080A2DAC: - ldrh r0, [r4, 0x4] - adds r1, r0 - strh r1, [r4] - lsls r0, 16 - cmp r0, 0 - blt _080A2DC2 - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, r2 - blt _080A2DCC - b _080A2DCA -_080A2DC2: - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, r2 - bgt _080A2DCC -_080A2DCA: - strh r3, [r4] -_080A2DCC: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80A2D54 - - thumb_func_start sound_sources_off -sound_sources_off: @ 80A2DD4 - push {lr} - ldr r1, =0x03005df8 - movs r0, 0 - strb r0, [r1] - bl map_music_set_to_zero - pop {r0} - bx r0 - .pool - thumb_func_end sound_sources_off - - thumb_func_start sound_something -sound_something: @ 80A2DE8 - push {r4,r5,lr} - ldr r0, =0x03000f4c - ldrb r1, [r0] - adds r2, r0, 0 - cmp r1, 0x7 - bhi _080A2ECA - lsls r0, r1, 2 - ldr r1, =_080A2E08 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080A2E08: - .4byte _080A2ECA - .4byte _080A2E28 - .4byte _080A2ECA - .4byte _080A2ECA - .4byte _080A2ECA - .4byte _080A2E3C - .4byte _080A2E5C - .4byte _080A2E98 -_080A2E28: - movs r0, 0x2 - strb r0, [r2] - ldr r0, =0x03000f48 - ldrh r0, [r0] - bl song_play_for_text - b _080A2ECA - .pool -_080A2E3C: - bl sub_80A3258 - lsls r0, 24 - cmp r0, 0 - beq _080A2ECA - ldr r0, =0x03000f4a - movs r1, 0 - strh r1, [r0] - ldr r0, =0x03000f4c - strb r1, [r0] - b _080A2ECA - .pool -_080A2E5C: - bl sub_80A3258 - lsls r0, 24 - cmp r0, 0 - beq _080A2ECA - bl task_is_not_running_overworld_fanfare - lsls r0, 24 - cmp r0, 0 - beq _080A2ECA - ldr r2, =0x03000f48 - ldr r1, =0x03000f4a - ldrh r0, [r1] - strh r0, [r2] - movs r0, 0 - strh r0, [r1] - ldr r1, =0x03000f4c - movs r0, 0x2 - strb r0, [r1] - ldrh r0, [r2] - bl song_play_for_text - b _080A2ECA - .pool -_080A2E98: - bl sub_80A3258 - lsls r0, 24 - cmp r0, 0 - beq _080A2ECA - bl task_is_not_running_overworld_fanfare - lsls r0, 24 - cmp r0, 0 - beq _080A2ECA - ldr r4, =0x03000f4a - ldrh r0, [r4] - ldr r5, =0x03000f4d - ldrb r1, [r5] - bl sub_80A3194 - ldr r1, =0x03000f48 - ldrh r0, [r4] - strh r0, [r1] - movs r2, 0 - strh r2, [r4] - ldr r1, =0x03000f4c - movs r0, 0x2 - strb r0, [r1] - strb r2, [r5] -_080A2ECA: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sound_something - - thumb_func_start map_music_set_to_zero -map_music_set_to_zero: @ 80A2EE0 - ldr r0, =0x03000f48 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x03000f4a - strh r1, [r0] - ldr r0, =0x03000f4c - strb r1, [r0] - ldr r0, =0x03000f4d - strb r1, [r0] - bx lr - .pool - thumb_func_end map_music_set_to_zero - - thumb_func_start current_map_music_get -current_map_music_get: @ 80A2F04 - ldr r0, =0x03000f48 - ldrh r0, [r0] - bx lr - .pool - thumb_func_end current_map_music_get - - thumb_func_start current_map_music_set -current_map_music_set: @ 80A2F10 - ldr r1, =0x03000f48 - strh r0, [r1] - ldr r1, =0x03000f4a - movs r0, 0 - strh r0, [r1] - ldr r1, =0x03000f4c - movs r0, 0x1 - strb r0, [r1] - bx lr - .pool - thumb_func_end current_map_music_set - - thumb_func_start sub_80A2F30 -sub_80A2F30: @ 80A2F30 - ldr r0, =0x03000f48 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x03000f4a - strh r1, [r0] - ldr r1, =0x03000f4c - movs r0, 0x1 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_80A2F30 - - thumb_func_start sub_80A2F50 -sub_80A2F50: @ 80A2F50 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80A303C - lsls r0, 24 - cmp r0, 0 - beq _080A2F66 - adds r0, r4, 0 - bl play_sound_effect -_080A2F66: - ldr r0, =0x03000f48 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x03000f4a - strh r1, [r0] - ldr r1, =0x03000f4c - movs r0, 0x5 - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2F50 - - thumb_func_start sub_80A2F88 -sub_80A2F88: @ 80A2F88 - push {r4,lr} - adds r4, r0, 0 - adds r0, r1, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r0, 24 - lsrs r0, 24 - bl sub_80A2F50 - ldr r1, =0x03000f48 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x03000f4a - strh r4, [r0] - ldr r1, =0x03000f4c - movs r0, 0x6 - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2F88 - - thumb_func_start sub_80A2FBC -sub_80A2FBC: @ 80A2FBC - push {r4,r5,lr} - adds r4, r0, 0 - adds r0, r1, 0 - adds r5, r2, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r0, 24 - lsrs r0, 24 - lsls r5, 24 - lsrs r5, 24 - bl sub_80A2F50 - ldr r1, =0x03000f48 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x03000f4a - strh r4, [r0] - ldr r1, =0x03000f4c - movs r0, 0x7 - strb r0, [r1] - ldr r0, =0x03000f4d - strb r5, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2FBC - - thumb_func_start sub_80A3000 -sub_80A3000: @ 80A3000 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_80A3194 - ldr r0, =0x03000f48 - strh r4, [r0] - ldr r0, =0x03000f4a - movs r2, 0 - strh r2, [r0] - ldr r1, =0x03000f4c - movs r0, 0x2 - strb r0, [r1] - ldr r0, =0x03000f4d - strb r2, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A3000 - - thumb_func_start sub_80A303C -sub_80A303C: @ 80A303C - push {lr} - ldr r0, =0x03000f4c - ldrb r0, [r0] - cmp r0, 0x6 - beq _080A3058 - cmp r0, 0x5 - beq _080A3058 - cmp r0, 0x7 - beq _080A3058 - movs r0, 0x1 - b _080A305A - .pool -_080A3058: - movs r0, 0 -_080A305A: - pop {r1} - bx r1 - thumb_func_end sub_80A303C - - thumb_func_start pause_music_for_sound_maybe -@ void pause_music_for_sound_maybe(u8 a1) -pause_music_for_sound_maybe: @ 80A3060 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x03007420 - bl MPlayStop_rev01 - ldr r0, =gUnknown_085248BC - lsls r4, 2 - adds r4, r0 - ldrh r0, [r4] - ldr r2, =0x03000f4e - ldrh r1, [r4, 0x2] - strh r1, [r2] - bl m4aSongNumStart - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pause_music_for_sound_maybe - - thumb_func_start ducking_tick -ducking_tick: @ 80A3094 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - ldr r2, =0x03000f4e - ldrh r0, [r2] - cmp r0, 0 - beq _080A30B0 - subs r0, 0x1 - strh r0, [r2] - movs r0, 0 - b _080A30C8 - .pool -_080A30B0: - cmp r1, 0 - bne _080A30C0 - ldr r0, =0x03007420 - bl m4aMPlayContinue - b _080A30C6 - .pool -_080A30C0: - movs r0, 0 - bl m4aSongNumStart -_080A30C6: - movs r0, 0x1 -_080A30C8: - pop {r1} - bx r1 - thumb_func_end ducking_tick - - thumb_func_start sub_80A30CC -sub_80A30CC: @ 80A30CC - push {lr} - lsls r0, 24 - ldr r1, =gUnknown_085248BC - lsrs r0, 22 - adds r0, r1 - ldrh r0, [r0] - bl m4aSongNumStop - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A30CC - - thumb_func_start fanfare_play -@ void fanfare_play(u16 a1) -fanfare_play: @ 80A30E4 - push {lr} - lsls r0, 16 - lsrs r3, r0, 16 - movs r1, 0 - ldr r2, =gUnknown_085248BC -_080A30EE: - ldrh r0, [r2] - cmp r0, r3 - bne _080A3108 - lsls r0, r1, 24 - lsrs r0, 24 - bl pause_music_for_sound_maybe - bl task_add_50_overworld_fanfare_if_not_running - b _080A311A - .pool -_080A3108: - adds r2, 0x4 - adds r1, 0x1 - cmp r1, 0x11 - bls _080A30EE - movs r0, 0 - bl pause_music_for_sound_maybe - bl task_add_50_overworld_fanfare_if_not_running -_080A311A: - pop {r0} - bx r0 - thumb_func_end fanfare_play - - thumb_func_start task_is_not_running_overworld_fanfare -task_is_not_running_overworld_fanfare: @ 80A3120 - push {lr} - ldr r0, =task50_overworld_fanfare - bl is_function_an_active_task - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080A3138 - movs r0, 0x1 - b _080A313A - .pool -_080A3138: - movs r0, 0 -_080A313A: - pop {r1} - bx r1 - thumb_func_end task_is_not_running_overworld_fanfare - - thumb_func_start task50_overworld_fanfare -task50_overworld_fanfare: @ 80A3140 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03000f4e - ldrh r0, [r1] - cmp r0, 0 - beq _080A3158 - subs r0, 0x1 - strh r0, [r1] - b _080A3164 - .pool -_080A3158: - ldr r0, =0x03007420 - bl m4aMPlayContinue - adds r0, r4, 0 - bl remove_task -_080A3164: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task50_overworld_fanfare - - thumb_func_start task_add_50_overworld_fanfare_if_not_running -@ void task_add_50_overworld_fanfare_if_not_running() -task_add_50_overworld_fanfare_if_not_running: @ 80A3170 - push {r4,lr} - ldr r4, =task50_overworld_fanfare - adds r0, r4, 0 - bl is_function_an_active_task - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080A318A - adds r0, r4, 0 - movs r1, 0x50 - bl AddTask -_080A318A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task_add_50_overworld_fanfare_if_not_running - - thumb_func_start sub_80A3194 -sub_80A3194: @ 80A3194 - push {r4-r7,lr} - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 24 - lsrs r7, r1, 24 - ldr r0, =0x03005df8 - ldrb r0, [r0] - cmp r0, 0 - beq _080A31A8 - movs r5, 0 -_080A31A8: - ldr r6, =0x0000ffff - cmp r5, r6 - bne _080A31B0 - movs r5, 0 -_080A31B0: - adds r0, r5, 0 - bl m4aSongNumStart - ldr r4, =0x03007420 - adds r0, r4, 0 - bl m4aMPlayImmInit - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0 - bl MPlayVolumeControl - adds r0, r5, 0 - bl m4aSongNumStop - adds r0, r4, 0 - adds r1, r7, 0 - bl sub_82E0328 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A3194 - - thumb_func_start sub_80A31E8 -sub_80A31E8: @ 80A31E8 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =0x03007420 - bl sub_82E0308 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A31E8 - - thumb_func_start sub_80A3200 -sub_80A3200: @ 80A3200 - push {lr} - ldr r0, =0x03007420 - ldr r1, [r0, 0x4] - cmp r1, 0 - blt _080A3220 - ldr r0, =0x0000ffff - ands r1, r0 - cmp r1, 0 - beq _080A3220 - movs r0, 0 - b _080A3222 - .pool -_080A3220: - movs r0, 0x1 -_080A3222: - pop {r1} - bx r1 - thumb_func_end sub_80A3200 - - thumb_func_start sub_80A3228 -sub_80A3228: @ 80A3228 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =0x03007420 - bl sub_82E0328 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A3228 - - thumb_func_start play_sound_effect -@ void play_sound_effect(u8 a1) -play_sound_effect: @ 80A3240 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =0x03007420 - bl m4aMPlayFadeOut - pop {r0} - bx r0 - .pool - thumb_func_end play_sound_effect - - thumb_func_start sub_80A3258 -sub_80A3258: @ 80A3258 - push {lr} - ldr r0, =0x03007420 - ldrh r0, [r0, 0x4] - cmp r0, 0 - beq _080A326C - movs r0, 0 - b _080A326E - .pool -_080A326C: - movs r0, 0x1 -_080A326E: - pop {r1} - bx r1 - thumb_func_end sub_80A3258 - - thumb_func_start cry_related -cry_related: @ 80A3274 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r4, r1, 0 - lsls r5, 16 - lsrs r5, 16 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x55 - bl MPlayVolumeControl - lsls r4, 24 - asrs r4, 24 - movs r0, 0 - str r0, [sp] - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x78 - movs r3, 0xA - bl sub_80A344C - ldr r1, =0x020383ec - movs r0, 0x2 - strb r0, [r1] - bl sub_80A3754 - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end cry_related - - thumb_func_start sub_80A32C0 -sub_80A32C0: @ 80A32C0 - push {r4,lr} - sub sp, 0x4 - lsls r0, 16 - lsrs r0, 16 - lsls r3, 24 - lsrs r3, 24 - lsls r1, 24 - asrs r1, 24 - lsls r2, 24 - asrs r2, 24 - movs r4, 0 - str r4, [sp] - bl sub_80A344C - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A32C0 - - thumb_func_start sub_80A32E4 -sub_80A32E4: @ 80A32E4 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r2, 24 - lsrs r4, r2, 24 - cmp r4, 0x1 - bne _080A330A - lsls r1, r5, 24 - asrs r1, 24 - str r4, [sp] - adds r0, r6, 0 - movs r2, 0x78 - movs r3, 0xA - bl sub_80A344C - b _080A332E -_080A330A: - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x55 - bl MPlayVolumeControl - lsls r1, r5, 24 - asrs r1, 24 - str r4, [sp] - adds r0, r6, 0 - movs r2, 0x78 - movs r3, 0xA - bl sub_80A344C - ldr r1, =0x020383ec - movs r0, 0x2 - strb r0, [r1] - bl sub_80A3754 -_080A332E: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A32E4 - - thumb_func_start sub_80A3344 -sub_80A3344: @ 80A3344 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 16 - lsrs r0, 16 - adds r6, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r5, r1, 0 - lsls r2, 24 - lsrs r2, 24 - adds r4, r2, 0 - cmp r2, 0x1 - bne _080A336E - lsls r1, 24 - asrs r1, 24 - str r2, [sp] - movs r2, 0x78 - movs r3, 0xA - bl sub_80A344C - b _080A3394 -_080A336E: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _080A3384 - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x55 - bl MPlayVolumeControl -_080A3384: - lsls r1, r5, 24 - asrs r1, 24 - str r4, [sp] - adds r0, r6, 0 - movs r2, 0x78 - movs r3, 0xA - bl sub_80A344C -_080A3394: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A3344 - - thumb_func_start play_cry_maybe -play_cry_maybe: @ 80A33A8 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r2, 24 - lsrs r4, r2, 24 - cmp r4, 0x1 - bne _080A33CE - lsls r1, r5, 24 - asrs r1, 24 - str r4, [sp] - adds r0, r6, 0 - movs r2, 0x78 - movs r3, 0xA - bl sub_80A344C - b _080A33EE -_080A33CE: - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x55 - bl MPlayVolumeControl - lsls r1, r5, 24 - asrs r1, 24 - str r4, [sp] - adds r0, r6, 0 - movs r2, 0x78 - movs r3, 0xA - bl sub_80A344C - ldr r1, =0x020383ec - movs r0, 0x2 - strb r0, [r1] -_080A33EE: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end play_cry_maybe - - thumb_func_start sub_80A3404 -sub_80A3404: @ 80A3404 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r4, r1, 0 - lsls r5, 16 - lsrs r5, 16 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x55 - bl MPlayVolumeControl - str r4, [sp] - adds r0, r5, 0 - movs r1, 0 - movs r2, 0x78 - movs r3, 0xA - bl sub_80A344C - ldr r1, =0x020383ec - movs r0, 0x2 - strb r0, [r1] - bl sub_80A3754 - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A3404 - - thumb_func_start sub_80A344C -sub_80A344C: @ 80A344C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - ldr r4, [sp, 0x24] - lsls r0, 16 - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp] - lsls r4, 24 - lsrs r1, r4, 24 - ldr r3, =0xffff0000 - adds r0, r3 - lsrs r7, r0, 16 - movs r6, 0x8C - movs r0, 0 - mov r9, r0 - movs r5, 0 - movs r4, 0xF0 - lsls r4, 6 - mov r8, r5 - cmp r1, 0xC - bhi _080A3562 - lsls r0, r1, 2 - ldr r1, =_080A349C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080A349C: - .4byte _080A3562 - .4byte _080A34D0 - .4byte _080A34D6 - .4byte _080A34E4 - .4byte _080A34F8 - .4byte _080A3510 - .4byte _080A351C - .4byte _080A352C - .4byte _080A3536 - .4byte _080A3540 - .4byte _080A3550 - .4byte _080A3560 - .4byte _080A355C -_080A34D0: - movs r6, 0x14 - movs r5, 0xE1 - b _080A3562 -_080A34D6: - movs r5, 0xE1 - ldr r4, =0x00003cf0 - movs r1, 0x14 - b _080A3504 - .pool -_080A34E4: - movs r6, 0x32 - movs r5, 0xC8 - ldr r4, =0x00003db8 - movs r3, 0x14 - mov r8, r3 - movs r2, 0x5A - b _080A3562 - .pool -_080A34F8: - movs r6, 0x19 - movs r0, 0x1 - mov r9, r0 - movs r5, 0x64 - ldr r4, =0x00003cf0 - movs r1, 0xC0 -_080A3504: - mov r8, r1 - movs r2, 0x5A - b _080A3562 - .pool -_080A3510: - movs r5, 0xC8 - ldr r4, =0x00003868 - b _080A3562 - .pool -_080A351C: - movs r5, 0xDC - ldr r4, =0x00003cc3 - movs r3, 0xC0 - mov r8, r3 - movs r2, 0x46 - b _080A3562 - .pool -_080A352C: - movs r6, 0xA - movs r5, 0x64 - movs r4, 0xE8 - lsls r4, 6 - b _080A3562 -_080A3536: - movs r6, 0x3C - movs r5, 0xE1 - movs r4, 0xF4 - lsls r4, 6 - b _080A3562 -_080A3540: - movs r6, 0xF - movs r0, 0x1 - mov r9, r0 - movs r5, 0x7D - ldr r4, =0x00003b60 - b _080A3562 - .pool -_080A3550: - movs r6, 0x64 - movs r5, 0xE1 - ldr r4, =0x00003b60 - b _080A3562 - .pool -_080A355C: - movs r6, 0x14 - movs r5, 0xE1 -_080A3560: - ldr r4, =0x00003a98 -_080A3562: - adds r0, r2, 0 - bl sub_82E1744 - mov r1, r10 - lsls r0, r1, 24 - asrs r0, 24 - bl sub_82E1758 - adds r0, r4, 0 - bl sub_82E1770 - adds r0, r6, 0 - bl sub_82E17A8 - movs r0, 0 - bl sub_82E17C0 - adds r0, r5, 0 - bl sub_82E17B4 - mov r3, r8 - lsls r0, r3, 24 - asrs r0, 24 - bl sub_82E17E4 - ldr r0, [sp] - bl sub_82E1850 - adds r0, r7, 0 - bl speciesid_conv - adds r7, r0, 0 - movs r1, 0x7F - ands r1, r7 - lsrs r0, r7, 7 - lsls r0, 24 - lsrs r0, 24 - adds r2, r0, 0 - cmp r0, 0x1 - beq _080A35F0 - cmp r0, 0x1 - bgt _080A35C0 - cmp r0, 0 - beq _080A35CA - b _080A365E - .pool -_080A35C0: - cmp r2, 0x2 - beq _080A3614 - cmp r2, 0x3 - beq _080A3638 - b _080A365E -_080A35CA: - mov r0, r9 - cmp r0, 0 - beq _080A35E0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_0869EF24 - b _080A3654 - .pool -_080A35E0: - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_0869DCF4 - b _080A3654 - .pool -_080A35F0: - mov r3, r9 - cmp r3, 0 - beq _080A3604 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_0869F524 - b _080A3654 - .pool -_080A3604: - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_0869E2F4 - b _080A3654 - .pool -_080A3614: - mov r0, r9 - cmp r0, 0 - beq _080A3628 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_0869FB24 - b _080A3654 - .pool -_080A3628: - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_0869E8F4 - b _080A3654 - .pool -_080A3638: - mov r3, r9 - cmp r3, 0 - beq _080A364C - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_086A0124 - b _080A3654 - .pool -_080A364C: - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_0869EEF4 -_080A3654: - adds r0, r1 - bl sub_82E1674 - ldr r1, =0x020383e8 - str r0, [r1] -_080A365E: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A344C - - thumb_func_start sub_80A3678 -sub_80A3678: @ 80A3678 - push {lr} - ldr r0, =sub_80A370C - bl is_function_an_active_task - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080A3694 - bl sub_8000964 - movs r0, 0x1 - b _080A3696 - .pool -_080A3694: - movs r0, 0 -_080A3696: - pop {r1} - bx r1 - thumb_func_end sub_80A3678 - - thumb_func_start sub_80A369C -sub_80A369C: @ 80A369C - push {lr} - ldr r0, =0x020383e8 - ldr r0, [r0] - bl MPlayStop_rev01 - bl sub_8000964 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A369C - - thumb_func_start sub_80A36B4 -sub_80A36B4: @ 80A36B4 - push {lr} - ldr r0, =0x020383e8 - ldr r0, [r0] - bl MPlayStop_rev01 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A36B4 - - thumb_func_start sub_80A36C8 -sub_80A36C8: @ 80A36C8 - push {lr} - ldr r0, =0x020383e8 - ldr r0, [r0] - bl sub_82E17CC - cmp r0, 0 - bne _080A36E4 - bl sub_8000964 - movs r0, 0 - b _080A36E6 - .pool -_080A36E4: - movs r0, 0x1 -_080A36E6: - pop {r1} - bx r1 - thumb_func_end sub_80A36C8 - - thumb_func_start sub_80A36EC -sub_80A36EC: @ 80A36EC - push {lr} - ldr r0, =0x020383e8 - ldr r0, [r0] - bl sub_82E17CC - cmp r0, 0 - bne _080A3704 - movs r0, 0 - b _080A3706 - .pool -_080A3704: - movs r0, 0x1 -_080A3706: - pop {r1} - bx r1 - thumb_func_end sub_80A36EC - - thumb_func_start sub_80A370C -sub_80A370C: @ 80A370C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x020383ec - ldrb r0, [r1] - cmp r0, 0 - beq _080A3724 - subs r0, 0x1 - strb r0, [r1] - b _080A3742 - .pool -_080A3724: - ldr r0, =0x020383e8 - ldr r0, [r0] - bl sub_82E17CC - cmp r0, 0 - bne _080A3742 - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl MPlayVolumeControl - adds r0, r4, 0 - bl remove_task -_080A3742: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A370C - - thumb_func_start sub_80A3754 -sub_80A3754: @ 80A3754 - push {r4,lr} - ldr r4, =sub_80A370C - adds r0, r4, 0 - bl is_function_an_active_task - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080A376E - adds r0, r4, 0 - movs r1, 0x50 - bl AddTask -_080A376E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A3754 - - thumb_func_start song_play_for_text -song_play_for_text: @ 80A3778 - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =0x03005df8 - ldrb r0, [r0] - cmp r0, 0 - beq _080A3788 - movs r1, 0 -_080A3788: - ldr r0, =0x0000ffff - cmp r1, r0 - bne _080A3790 - movs r1, 0 -_080A3790: - adds r0, r1, 0 - bl m4aSongNumStart - pop {r0} - bx r0 - .pool - thumb_func_end song_play_for_text - - thumb_func_start audio_play -audio_play: @ 80A37A4 - push {lr} - lsls r0, 16 - lsrs r0, 16 - bl m4aSongNumStart - pop {r0} - bx r0 - thumb_func_end audio_play - - thumb_func_start audio_play_and_stuff -audio_play_and_stuff: @ 80A37B4 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r4, r1, 0 - lsls r0, 16 - lsrs r0, 16 - lsls r4, 24 - lsrs r4, 24 - bl m4aSongNumStart - ldr r6, =0x030075f0 - adds r0, r6, 0 - bl m4aMPlayImmInit - ldr r0, =0x03007630 - mov r8, r0 - bl m4aMPlayImmInit - ldr r5, =0x0000ffff - lsls r4, 24 - asrs r4, 24 - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl MPlayPanpotControl - mov r0, r8 - adds r1, r5, 0 - adds r2, r4, 0 - bl MPlayPanpotControl - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end audio_play_and_stuff - - thumb_func_start sub_80A3808 -sub_80A3808: @ 80A3808 - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 16 - lsrs r0, 16 - lsls r4, 24 - lsrs r4, 24 - bl m4aSongNumStart - ldr r5, =0x030075f0 - adds r0, r5, 0 - bl m4aMPlayImmInit - ldr r1, =0x0000ffff - lsls r4, 24 - asrs r4, 24 - adds r0, r5, 0 - adds r2, r4, 0 - bl MPlayPanpotControl - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A3808 - - thumb_func_start sub_80A383C -sub_80A383C: @ 80A383C - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 16 - lsrs r0, 16 - lsls r4, 24 - lsrs r4, 24 - bl m4aSongNumStart - ldr r5, =0x03007630 - adds r0, r5, 0 - bl m4aMPlayImmInit - ldr r1, =0x0000ffff - lsls r4, 24 - asrs r4, 24 - adds r0, r5, 0 - adds r2, r4, 0 - bl MPlayPanpotControl - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A383C - - thumb_func_start sub_80A3870 -sub_80A3870: @ 80A3870 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r0, =0x030075f0 - ldr r5, =0x0000ffff - lsls r4, 24 - asrs r4, 24 - adds r1, r5, 0 - adds r2, r4, 0 - bl MPlayPanpotControl - ldr r0, =0x03007630 - adds r1, r5, 0 - adds r2, r4, 0 - bl MPlayPanpotControl - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A3870 - - thumb_func_start mplay_has_finished_maybe -mplay_has_finished_maybe: @ 80A38A0 - push {lr} - ldr r0, =0x030075f0 - ldr r1, [r0, 0x4] - movs r2, 0x80 - lsls r2, 24 - adds r3, r0, 0 - cmp r1, 0 - bge _080A38BA - ldr r0, =0x03007630 - ldr r0, [r0, 0x4] - ands r0, r2 - cmp r0, 0 - bne _080A38CC -_080A38BA: - ldr r1, =0x0000ffff - ldrh r0, [r3, 0x4] - cmp r0, 0 - bne _080A38DC - ldr r0, =0x03007630 - ldr r0, [r0, 0x4] - ands r0, r1 - cmp r0, 0 - bne _080A38DC -_080A38CC: - movs r0, 0 - b _080A38DE - .pool -_080A38DC: - movs r0, 0x1 -_080A38DE: - pop {r1} - bx r1 - thumb_func_end mplay_has_finished_maybe - - thumb_func_start sub_80A38E4 -sub_80A38E4: @ 80A38E4 - push {lr} - ldr r0, =0x03007420 - ldr r1, [r0, 0x4] - cmp r1, 0 - blt _080A3904 - ldr r0, =0x0000ffff - ands r1, r0 - cmp r1, 0 - beq _080A3904 - movs r0, 0x1 - b _080A3906 - .pool -_080A3904: - movs r0, 0 -_080A3906: - pop {r1} - bx r1 - thumb_func_end sub_80A38E4 - - thumb_func_start sub_80A390C -sub_80A390C: @ 80A390C - push {lr} - ldr r0, =0x03007800 - ldr r1, [r0, 0x4] - cmp r1, 0 - blt _080A392C - ldr r0, =0x0000ffff - ands r1, r0 - cmp r1, 0 - beq _080A392C - movs r0, 0x1 - b _080A392E - .pool -_080A392C: - movs r0, 0 -_080A392E: - pop {r1} - bx r1 - thumb_func_end sub_80A390C - - thumb_func_start sub_80A3934 -sub_80A3934: @ 80A3934 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r0, =0x020383fc - movs r1, 0 - strb r1, [r0] - ldr r0, =0x020383fd - strb r1, [r0] - ldr r0, =0x020383fe - strb r1, [r0] - ldr r0, =0x020383ff - strb r1, [r0] - ldr r0, =0x02038400 - movs r1, 0 - str r1, [r0] - ldr r0, =0x02038404 - str r1, [r0] - ldr r0, =0x02038408 - movs r2, 0 - strh r1, [r0] - ldr r0, =0x0203841a - strb r2, [r0] - ldr r4, =0x02038430 - ldr r5, =0x02038432 - ldr r6, =0x02038433 - ldr r7, =0x02038434 - ldr r0, =0x02038436 - mov r12, r0 - ldr r1, =0x02038437 - mov r8, r1 - ldr r0, =0x02038440 - mov r9, r0 - ldr r1, =0x0000ffff - adds r3, r1, 0 - ldr r1, =0x0203840a - movs r2, 0x7 -_080A397E: - ldrh r0, [r1] - orrs r0, r3 - strh r0, [r1] - adds r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _080A397E - ldr r1, =0x0203841e - movs r2, 0 - adds r0, r1, 0 - adds r0, 0xE -_080A3994: - strh r2, [r0] - subs r0, 0x2 - cmp r0, r1 - bge _080A3994 - movs r1, 0 - movs r0, 0xFF - strb r0, [r4] - movs r0, 0x1 - negs r0, r0 - strb r0, [r4, 0x1] - strb r1, [r5] - strb r1, [r6] - movs r0, 0 - strh r1, [r7] - mov r1, r12 - strb r0, [r1] - mov r1, r8 - strb r0, [r1] - mov r1, r9 - strb r0, [r1] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A3934 - - thumb_func_start move_anim_start_t1 -move_anim_start_t1: @ 80A3A10 - push {lr} - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - ldr r2, =0x02038436 - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r2] - ldr r2, =0x02038437 - ldr r0, =0x0202420c - ldrb r0, [r0] - strb r0, [r2] - ldr r0, =gUnknown_082C8D6C - movs r2, 0x1 - bl move_something - pop {r0} - bx r0 - .pool - thumb_func_end move_anim_start_t1 - - thumb_func_start move_something -move_something: @ 80A3A48 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - str r0, [sp] - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A3AE8 - bl sub_80A8278 - movs r0, 0 - bl sub_8072A88 - movs r4, 0 - mov r0, r8 - lsls r0, 2 - mov r10, r0 - ldr r6, =0x0202406e - movs r7, 0x64 - ldr r5, =0x02038438 -_080A3A84: - lsls r0, r4, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080A3AA8 - ldrh r0, [r6] - muls r0, r7 - ldr r1, =0x02024744 - b _080A3AAE - .pool -_080A3AA8: - ldrh r0, [r6] - muls r0, r7 - ldr r1, =0x020244ec -_080A3AAE: - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - strh r0, [r5] - adds r6, 0x2 - adds r5, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - ble _080A3A84 - ldr r3, =0x02038434 - ldr r5, =0x02038430 - ldr r1, =0x020383fd - mov r12, r1 - ldr r7, =0x020383f8 - ldr r6, =move_anim_execute - b _080A3B10 - .pool -_080A3AE8: - ldr r3, =0x02038434 - ldr r5, =0x02038430 - mov r0, r8 - lsls r0, 2 - mov r10, r0 - ldr r1, =0x020383fd - mov r12, r1 - ldr r7, =0x020383f8 - ldr r6, =move_anim_execute - ldr r2, =0x02039f34 - ldr r1, =0x02038438 - movs r4, 0x3 -_080A3B00: - ldr r0, [r2] - ldr r0, [r0, 0x18] - ldrh r0, [r0] - strh r0, [r1] - adds r1, 0x2 - subs r4, 0x1 - cmp r4, 0 - bge _080A3B00 -_080A3B10: - mov r0, r9 - cmp r0, 0 - bne _080A3B38 - strh r0, [r3] - b _080A3B3C - .pool -_080A3B38: - mov r1, r8 - strh r1, [r3] -_080A3B3C: - ldr r1, =0x0203841e - movs r2, 0 - adds r0, r1, 0 - adds r0, 0xE -_080A3B44: - strh r2, [r0] - subs r0, 0x2 - cmp r0, r1 - bge _080A3B44 - movs r0, 0xFF - strb r0, [r5] - movs r0, 0x1 - negs r0, r0 - strb r0, [r5, 0x1] - ldr r0, [sp] - add r0, r10 - ldr r0, [r0] - ldr r1, =0x020383f0 - str r0, [r1] - movs r0, 0x1 - mov r1, r12 - strb r0, [r1] - movs r0, 0 - ldr r1, =0x020383fc - strb r0, [r1] - str r6, [r7] - ldr r0, =0x0000ffff - adds r2, r0, 0 - ldr r1, =0x0203840a - movs r4, 0x7 -_080A3B76: - ldrh r0, [r1] - orrs r0, r2 - strh r0, [r1] - adds r1, 0x2 - subs r4, 0x1 - cmp r4, 0 - bge _080A3B76 - mov r1, r9 - cmp r1, 0 - beq _080A3BC2 - movs r4, 0 - ldr r2, =gUnknown_082C8D64 - b _080A3BAA - .pool -_080A3BA8: - adds r4, 0x1 -_080A3BAA: - lsls r0, r4, 1 - adds r0, r2 - ldrh r0, [r0] - ldr r1, =0x0000ffff - cmp r0, r1 - beq _080A3BC2 - cmp r8, r0 - bne _080A3BA8 - ldr r0, =0x03007420 - movs r2, 0x80 - bl MPlayVolumeControl -_080A3BC2: - ldr r0, =0x02022e24 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e26 - strh r1, [r0] - ldr r0, =0x02022e28 - strh r1, [r0] - ldr r0, =0x02022e2a - strh r1, [r0] - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end move_something - - thumb_func_start move_anim_8072740 -move_anim_8072740: @ 80A3BFC - push {r4,lr} - adds r4, r0, 0 - bl obj_free_rotscale_entry - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - ldr r1, =0x020383fe - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end move_anim_8072740 - - thumb_func_start move_anim_task_del -move_anim_task_del: @ 80A3C1C - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl remove_task - ldr r1, =0x020383fe - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end move_anim_task_del - - thumb_func_start move_anim_related_task_del -move_anim_related_task_del: @ 80A3C38 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl remove_task - ldr r1, =0x020383ff - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end move_anim_related_task_del - - thumb_func_start sub_80A3C54 -sub_80A3C54: @ 80A3C54 - push {r4,lr} - lsls r0, 16 - lsrs r3, r0, 16 - movs r2, 0 - ldr r4, =0x0000ffff - ldr r1, =0x0203840a -_080A3C60: - ldrh r0, [r1] - cmp r0, r4 - bne _080A3C74 - strh r3, [r1] - b _080A3C7C - .pool -_080A3C74: - adds r1, 0x2 - adds r2, 0x1 - cmp r2, 0x7 - ble _080A3C60 -_080A3C7C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A3C54 - - thumb_func_start sub_80A3C84 -sub_80A3C84: @ 80A3C84 - push {r4,lr} - lsls r0, 16 - lsrs r3, r0, 16 - movs r2, 0 - ldr r0, =0x0000ffff - adds r4, r0, 0 - ldr r1, =0x0203840a -_080A3C92: - ldrh r0, [r1] - cmp r0, r3 - bne _080A3CA8 - orrs r0, r4 - strh r0, [r1] - b _080A3CB0 - .pool -_080A3CA8: - adds r1, 0x2 - adds r2, 0x1 - cmp r2, 0x7 - ble _080A3C92 -_080A3CB0: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A3C84 - - thumb_func_start move_anim_waiter -move_anim_waiter: @ 80A3CB8 - push {lr} - ldr r2, =0x020383fc - ldrb r1, [r2] - movs r0, 0 - ldrsb r0, [r2, r0] - cmp r0, 0 - bgt _080A3CDC - ldr r0, =0x020383f8 - ldr r1, =move_anim_execute - str r1, [r0] - movs r0, 0 - b _080A3CDE - .pool -_080A3CDC: - subs r0, r1, 0x1 -_080A3CDE: - strb r0, [r2] - pop {r0} - bx r0 - thumb_func_end move_anim_waiter - - thumb_func_start move_anim_execute -move_anim_execute: @ 80A3CE4 - push {r4,lr} - ldr r4, =gUnknown_08525E98 -_080A3CE8: - ldr r0, =0x020383f0 - ldr r0, [r0] - ldrb r0, [r0] - lsls r0, 2 - adds r0, r4 - ldr r0, [r0] - bl _call_via_r0 - ldr r0, =0x020383fc - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - bne _080A3D0C - ldr r0, =0x020383fd - ldrb r0, [r0] - cmp r0, 0 - bne _080A3CE8 -_080A3D0C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end move_anim_execute - - thumb_func_start ma00_load_graphics -ma00_load_graphics: @ 80A3D24 - push {r4-r6,lr} - ldr r6, =0x020383f0 - ldr r0, [r6] - adds r1, r0, 0x1 - str r1, [r6] - ldrb r4, [r0, 0x1] - ldrb r0, [r1, 0x1] - lsls r0, 8 - orrs r4, r0 - lsls r5, r4, 3 - ldr r0, =gUnknown_085112C4 - adds r0, r5, r0 - bl LoadCompressedObjectPicUsingHeap - ldr r0, =gUnknown_08511BCC - adds r5, r0 - adds r0, r5, 0 - bl LoadCompressedObjectPaletteUsingHeap - ldr r0, [r6] - adds r0, 0x2 - str r0, [r6] - ldr r0, =0xffffd8f0 - adds r4, r0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r4, 0 - bl sub_80A3C54 - ldr r1, =0x020383fc - movs r0, 0x1 - strb r0, [r1] - ldr r1, =0x020383f8 - ldr r0, =move_anim_waiter - str r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end ma00_load_graphics - - thumb_func_start ma01_080728D0 -@ void ma01_080728D0() -ma01_080728D0: @ 80A3D8C - push {r4-r6,lr} - ldr r6, =0x020383f0 - ldr r0, [r6] - adds r1, r0, 0x1 - str r1, [r6] - ldrb r4, [r0, 0x1] - ldrb r0, [r1, 0x1] - lsls r0, 8 - orrs r4, r0 - ldr r1, =gUnknown_08524B44 - ldr r0, =0xffffd8f0 - adds r4, r0 - lsls r0, r4, 3 - adds r0, r1 - ldrh r5, [r0, 0x6] - adds r0, r5, 0 - bl FreeObjectTilesByTag - adds r0, r5, 0 - bl FreeObjectPaletteByTag - ldr r0, [r6] - adds r0, 0x2 - str r0, [r6] - lsls r4, 16 - lsrs r4, 16 - adds r0, r4, 0 - bl sub_80A3C84 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end ma01_080728D0 - - thumb_func_start ma02_instanciate_template -ma02_instanciate_template: @ 80A3DD8 - push {r4-r7,lr} - ldr r5, =0x020383f0 - ldr r1, [r5] - adds r3, r1, 0x1 - str r3, [r5] - ldrb r2, [r1, 0x1] - ldrb r0, [r3, 0x1] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r3, 0x2] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r3, 0x3] - lsls r0, 24 - adds r7, r2, r0 - adds r0, r1, 0x5 - str r0, [r5] - ldrb r4, [r1, 0x5] - adds r0, r1, 0x6 - str r0, [r5] - ldrb r0, [r1, 0x6] - adds r1, 0x7 - str r1, [r5] - cmp r0, 0 - beq _080A3E28 - adds r6, r5, 0 - ldr r5, =0x0203841e - adds r3, r0, 0 -_080A3E10: - ldr r2, [r6] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - orrs r1, r0 - strh r1, [r5] - adds r2, 0x2 - str r2, [r6] - adds r5, 0x2 - subs r3, 0x1 - cmp r3, 0 - bne _080A3E10 -_080A3E28: - movs r0, 0x80 - ands r0, r4 - cmp r0, 0 - beq _080A3E58 - movs r0, 0x80 - eors r4, r0 - cmp r4, 0x3F - bls _080A3E48 - adds r0, r4, 0 - subs r0, 0x40 - b _080A3E4A - .pool -_080A3E48: - negs r0, r4 -_080A3E4A: - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02038437 - b _080A3E6A - .pool -_080A3E58: - cmp r4, 0x3F - bls _080A3E62 - adds r0, r4, 0 - subs r0, 0x40 - b _080A3E64 -_080A3E62: - negs r0, r4 -_080A3E64: - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02038436 -_080A3E6A: - ldrb r0, [r0] - bl sub_80A82E4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r4, 24 - asrs r1, 24 - adds r0, r1 - lsls r0, 16 - lsrs r6, r0, 16 - lsls r0, r6, 16 - asrs r0, 16 - cmp r0, 0x2 - bgt _080A3E88 - movs r6, 0x3 -_080A3E88: - ldr r5, =0x02038437 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - lsls r3, r6, 24 - lsrs r3, 24 - adds r0, r7, 0 - adds r1, r4, 0 - bl AddObjectAndAnimateForOneFrame - ldr r1, =0x020383fe - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end ma02_instanciate_template - - thumb_func_start sub_80A3ECC -sub_80A3ECC: @ 80A3ECC - push {r4-r7,lr} - ldr r4, =0x020383f0 - ldr r1, [r4] - adds r3, r1, 0x1 - str r3, [r4] - ldrb r2, [r1, 0x1] - ldrb r0, [r3, 0x1] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r3, 0x2] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r3, 0x3] - lsls r0, 24 - adds r6, r2, r0 - adds r0, r1, 0x5 - str r0, [r4] - ldrb r7, [r1, 0x5] - adds r0, r1, 0x6 - str r0, [r4] - ldrb r0, [r1, 0x6] - adds r1, 0x7 - str r1, [r4] - cmp r0, 0 - beq _080A3F1C - adds r5, r4, 0 - ldr r4, =0x0203841e - adds r3, r0, 0 -_080A3F04: - ldr r2, [r5] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - orrs r1, r0 - strh r1, [r4] - adds r2, 0x2 - str r2, [r5] - adds r4, 0x2 - subs r3, 0x1 - cmp r3, 0 - bne _080A3F04 -_080A3F1C: - adds r0, r6, 0 - adds r1, r7, 0 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r6 - ldr r1, =0x020383fe - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A3ECC - - thumb_func_start ma04_wait_countdown -ma04_wait_countdown: @ 80A3F48 - push {r4,lr} - ldr r1, =0x020383f0 - ldr r0, [r1] - adds r2, r0, 0x1 - str r2, [r1] - ldr r3, =0x020383fc - ldrb r0, [r0, 0x1] - strb r0, [r3] - lsls r0, 24 - cmp r0, 0 - bne _080A3F66 - movs r4, 0x1 - negs r4, r4 - adds r0, r4, 0 - strb r0, [r3] -_080A3F66: - adds r0, r2, 0x1 - str r0, [r1] - ldr r1, =0x020383f8 - ldr r0, =move_anim_waiter - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ma04_wait_countdown - - thumb_func_start sub_80A3F88 -sub_80A3F88: @ 80A3F88 - push {lr} - ldr r0, =0x020383fe - ldrb r2, [r0] - cmp r2, 0 - bne _080A3FAC - ldr r0, =0x020383f0 - ldr r1, [r0] - adds r1, 0x1 - str r1, [r0] - ldr r0, =0x020383fc - strb r2, [r0] - b _080A3FB2 - .pool -_080A3FAC: - ldr r1, =0x020383fc - movs r0, 0x1 - strb r0, [r1] -_080A3FB2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A3F88 - - thumb_func_start nullsub_6 -nullsub_6: @ 80A3FBC - bx lr - thumb_func_end nullsub_6 - - thumb_func_start nullsub_7 -nullsub_7: @ 80A3FC0 - bx lr - thumb_func_end nullsub_7 - - thumb_func_start sub_80A3FC4 -sub_80A3FC4: @ 80A3FC4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r0, 0 - mov r8, r0 - ldr r0, =0x020383fe - ldrb r0, [r0] - cmp r0, 0 - bne _080A3FEC - ldr r0, =0x020383ff - ldrb r0, [r0] - cmp r0, 0 - bne _080A3FEC - ldr r1, =0x02038430 - ldrb r0, [r1] - cmp r0, 0xFF - bne _080A3FEC - ldrb r0, [r1, 0x1] - cmp r0, 0xFF - beq _080A4004 -_080A3FEC: - ldr r1, =0x0203842e - movs r0, 0 - strh r0, [r1] - b _080A401E - .pool -_080A4004: - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - beq _080A403C - ldr r1, =0x0203842e - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x5A - bhi _080A4030 -_080A401E: - ldr r1, =0x020383fc - movs r0, 0x1 - strb r0, [r1] - b _080A40A2 - .pool -_080A4030: - ldr r0, =0x030075f0 - bl MPlayStop_rev01 - ldr r0, =0x03007630 - bl MPlayStop_rev01 -_080A403C: - ldr r1, =0x0203842e - movs r0, 0 - strh r0, [r1] - movs r5, 0 - ldr r7, =0x0000ffff - ldr r6, =gUnknown_08524B44 - ldr r4, =0x0203840a -_080A404A: - ldrh r0, [r4] - cmp r0, r7 - beq _080A406E - lsls r0, 3 - adds r0, r6 - ldrh r0, [r0, 0x6] - bl FreeObjectTilesByTag - ldrh r0, [r4] - lsls r0, 3 - adds r0, r6 - ldrh r0, [r0, 0x6] - bl FreeObjectPaletteByTag - ldrh r1, [r4] - adds r0, r7, 0 - orrs r0, r1 - strh r0, [r4] -_080A406E: - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x7 - ble _080A404A - mov r1, r8 - cmp r1, 0 - bne _080A40A2 - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl MPlayVolumeControl - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A409C - bl sub_80A8278 - movs r0, 0x1 - bl sub_8072A88 -_080A409C: - ldr r0, =0x020383fd - mov r1, r8 - strb r1, [r0] -_080A40A2: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A3FC4 - - thumb_func_start ma09_play_sound -ma09_play_sound: @ 80A40CC - push {r4,lr} - ldr r4, =0x020383f0 - ldr r0, [r4] - adds r1, r0, 0x1 - str r1, [r4] - ldrb r0, [r0, 0x1] - ldrb r1, [r1, 0x1] - lsls r1, 8 - orrs r0, r1 - bl audio_play - ldr r0, [r4] - adds r0, 0x2 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ma09_play_sound - - thumb_func_start sub_80A40F4 -sub_80A40F4: @ 80A40F4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - ldr r1, =0x03005e08 - mov r8, r1 - adds r6, r0, r1 - ldr r1, =0x020241e4 - movs r2, 0 - ldrsh r0, [r6, r2] - adds r0, r1 - ldrb r5, [r0] - ldr r1, =0x02020630 - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r4, r0, r1 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - movs r3, 0x4 - ldrsh r0, [r6, r3] - cmp r0, 0 - bne _080A4148 - adds r0, r7, 0 - bl move_anim_task_del - b _080A41BE - .pool -_080A4148: - ldr r0, =task_pA_ma0A_obj_to_bg_pal - movs r1, 0xA - bl AddTask - lsls r0, 24 - lsrs r2, r0, 24 - mov r1, r8 - subs r1, 0x8 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0, r1 - strh r5, [r1, 0x8] - ldrh r0, [r4, 0x24] - ldrh r3, [r4, 0x20] - adds r0, r3 - strh r0, [r1, 0xA] - ldrh r0, [r4, 0x26] - ldrh r4, [r4, 0x22] - adds r0, r4 - strh r0, [r1, 0xC] - movs r3, 0x2 - ldrsh r0, [r6, r3] - cmp r0, 0 - bne _080A4190 - ldr r0, =0x02022e18 - ldrh r0, [r0] - strh r0, [r1, 0xE] - ldr r0, =0x02022e1a - b _080A4198 - .pool -_080A4190: - ldr r0, =0x02022e1c - ldrh r0, [r0] - strh r0, [r1, 0xE] - ldr r0, =0x02022e1e -_080A4198: - ldrh r0, [r0] - strh r0, [r1, 0x10] - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r6, 0x2] - strh r1, [r0, 0x12] - ldrh r1, [r6] - strh r1, [r0, 0x14] - ldr r1, =0x02038430 - movs r3, 0x6 - ldrsh r0, [r6, r3] - adds r0, r1 - strb r2, [r0] - adds r0, r7, 0 - bl move_anim_task_del -_080A41BE: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A40F4 - - thumb_func_start sub_80A41D8 -sub_80A41D8: @ 80A41D8 - push {r4,r5,lr} - ldr r1, =0x020383f0 - ldr r2, [r1] - adds r0, r2, 0x1 - str r0, [r1] - ldrb r0, [r2, 0x1] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080A41F8 - ldr r0, =0x02038437 - b _080A41FA - .pool -_080A41F8: - ldr r0, =0x02038436 -_080A41FA: - ldrb r4, [r0] - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A4266 - adds r0, r4, 0 - bl battle_get_per_side_status - lsls r0, 24 - movs r1, 0xFF - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1 - bls _080A4226 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A4230 -_080A4226: - movs r5, 0 - b _080A4232 - .pool -_080A4230: - movs r5, 0x1 -_080A4232: - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0 - bl sub_80A438C - ldr r0, =sub_80A40F4 - movs r1, 0xA - bl AddTask - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =0x020383fe - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - movs r2, 0 - strh r4, [r0, 0x8] - strh r5, [r0, 0xA] - movs r1, 0x1 - strh r1, [r0, 0xC] - strh r2, [r0, 0xE] -_080A4266: - movs r0, 0x2 - eors r4, r0 - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A42D8 - adds r0, r4, 0 - bl battle_get_per_side_status - lsls r0, 24 - movs r1, 0xFF - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1 - bls _080A4294 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A42A4 -_080A4294: - movs r5, 0 - b _080A42A6 - .pool -_080A42A4: - movs r5, 0x1 -_080A42A6: - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0 - bl sub_80A438C - ldr r0, =sub_80A40F4 - movs r1, 0xA - bl AddTask - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =0x020383fe - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - strh r4, [r0, 0x8] - strh r5, [r0, 0xA] - movs r1, 0x1 - strh r1, [r0, 0xC] - strh r1, [r0, 0xE] -_080A42D8: - ldr r1, =0x020383f0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - ldr r1, =0x020383fc - movs r0, 0x1 - strb r0, [r1] - ldr r1, =0x020383f8 - ldr r0, =move_anim_waiter - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A41D8 - - thumb_func_start b_side_obj__get_some_boolean -b_side_obj__get_some_boolean: @ 80A4310 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A4330 - ldr r0, =0x02038436 - ldrb r0, [r0] - cmp r4, r0 - beq _080A4374 - b _080A4384 - .pool -_080A4330: - adds r0, r4, 0 - bl sub_80A6A90 - lsls r0, 24 - cmp r0, 0 - beq _080A4384 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A4374 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0] - lsls r0, r5, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080A4374 - ldr r2, =0x02020630 - ldr r0, =0x020241e4 - adds r0, r5, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _080A4384 -_080A4374: - movs r0, 0x1 - b _080A4386 - .pool -_080A4384: - movs r0, 0 -_080A4386: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end b_side_obj__get_some_boolean - - thumb_func_start sub_80A438C -sub_80A438C: @ 80A438C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x28 - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - lsls r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - cmp r1, 0 - beq _080A43AA - b _080A455E -_080A43AA: - bl sub_80A4DF0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080A43DC - ldr r1, =0x06008000 - movs r2, 0x80 - lsls r2, 6 - movs r0, 0 - movs r3, 0x1 - bl RequestDma3Fill - ldr r1, =0x0600f000 - movs r2, 0x80 - lsls r2, 5 - movs r0, 0xFF - movs r3, 0 - bl RequestDma3Fill - b _080A43F8 - .pool -_080A43DC: - ldr r1, =0x06004000 - movs r2, 0x80 - lsls r2, 6 - movs r0, 0 - movs r3, 0x1 - bl RequestDma3Fill - ldr r1, =0x0600e000 - movs r2, 0x80 - lsls r2, 5 - movs r0, 0xFF - movs r3, 0 - bl RequestDma3Fill -_080A43F8: - add r0, sp, 0x10 - bl sub_80A6B30 - add r0, sp, 0x20 - movs r1, 0 - strh r1, [r0] - ldr r1, [sp, 0x10] - ldr r2, =0x01000800 - bl CpuSet - mov r0, sp - adds r0, 0x22 - movs r1, 0xFF - strh r1, [r0] - ldr r1, [sp, 0x14] - ldr r2, =0x01000400 - bl CpuSet - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x2 - bl lcd_bg_operations - movs r0, 0x1 - movs r1, 0 - movs r2, 0x1 - bl lcd_bg_operations - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - bl lcd_bg_operations - ldr r0, =0x020241e4 - adds r0, r6, r0 - ldrb r4, [r0] - ldr r5, =0x02022e18 - ldr r0, =0x02020630 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x24] - ldrh r1, [r1, 0x20] - adds r0, r1 - negs r0, r0 - adds r0, 0x20 - strh r0, [r5] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A447A - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x18] - ldrh r0, [r0] - bl sub_80DB2A8 - lsls r0, 24 - cmp r0, 0 - beq _080A447A - ldrh r0, [r5] - subs r0, 0x1 - strh r0, [r5] -_080A447A: - ldr r5, =0x02022e1a - ldr r2, =0x02020630 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r1, 0x26] - ldrh r1, [r1, 0x22] - adds r0, r1 - negs r0, r0 - adds r0, 0x20 - strh r0, [r5] - mov r0, r9 - cmp r0, 0 - beq _080A44B0 - ldr r0, =0x020241e4 - adds r0, r6, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_080A44B0: - ldr r0, =0x02022e18 - ldrh r1, [r0] - movs r0, 0x14 - bl SetGpuReg - ldrh r1, [r5] - movs r0, 0x16 - bl SetGpuReg - lsls r4, r6, 5 - ldr r0, =0x02037914 - adds r4, r0 - add r0, sp, 0x10 - ldrb r1, [r0, 0x8] - lsls r1, 4 - adds r0, r4, 0 - movs r2, 0x20 - bl gpu_pal_apply - add r0, sp, 0x10 - ldrb r1, [r0, 0x8] - lsls r1, 5 - movs r0, 0xA0 - lsls r0, 19 - adds r1, r0 - ldr r2, =0x04000008 - adds r0, r4, 0 - bl CpuSet - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A4524 - movs r3, 0 - b _080A452E - .pool -_080A4524: - adds r0, r6, 0 - bl battle_get_per_side_status - lsls r0, 24 - lsrs r3, r0, 24 -_080A452E: - add r0, sp, 0x10 - ldrb r0, [r0, 0x8] - str r0, [sp] - ldr r0, [sp, 0x10] - str r0, [sp, 0x4] - ldr r0, [sp, 0x14] - str r0, [sp, 0x8] - add r0, sp, 0x10 - ldrh r0, [r0, 0xA] - str r0, [sp, 0xC] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl sub_8118FBC - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A4558 - b _080A4666 -_080A4558: - bl sub_80A46A0 - b _080A4666 -_080A455E: - ldr r1, =0x06006000 - movs r2, 0x80 - lsls r2, 6 - movs r0, 0 - movs r3, 0x1 - bl RequestDma3Fill - ldr r1, =0x0600f000 - movs r7, 0x80 - lsls r7, 5 - movs r0, 0 - adds r2, r7, 0 - movs r3, 0x1 - bl RequestDma3Fill - add r0, sp, 0x10 - movs r1, 0x2 - bl sub_80A6B90 - add r0, sp, 0x24 - movs r4, 0 - strh r4, [r0] - ldr r1, [sp, 0x10] - adds r1, r7 - ldr r2, =0x01000800 - bl CpuSet - mov r0, sp - adds r0, 0x26 - strh r4, [r0] - ldr r1, [sp, 0x14] - movs r2, 0x80 - lsls r2, 4 - mov r8, r2 - add r1, r8 - ldr r2, =0x01000400 - bl CpuSet - movs r0, 0x2 - movs r1, 0x4 - movs r2, 0x2 - bl lcd_bg_operations - movs r0, 0x2 - movs r1, 0 - movs r2, 0x1 - bl lcd_bg_operations - movs r0, 0x2 - movs r1, 0x1 - movs r2, 0 - bl lcd_bg_operations - ldr r0, =0x020241e4 - adds r2, r5, r0 - ldrb r4, [r2] - ldr r5, =0x02022e1c - ldr r3, =0x02020630 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r1, 0x24] - ldrh r4, [r1, 0x20] - adds r0, r4 - negs r0, r0 - adds r0, 0x20 - strh r0, [r5] - ldr r4, =0x02022e1e - ldrh r0, [r1, 0x26] - ldrh r1, [r1, 0x22] - adds r0, r1 - negs r0, r0 - adds r0, 0x20 - strh r0, [r4] - mov r0, r9 - cmp r0, 0 - beq _080A460E - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_080A460E: - ldrh r1, [r5] - movs r0, 0x18 - bl SetGpuReg - ldrh r1, [r4] - movs r0, 0x1A - bl SetGpuReg - lsls r4, r6, 5 - ldr r0, =0x02037914 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x90 - movs r2, 0x20 - bl gpu_pal_apply - ldr r1, =0x05000120 - ldr r2, =0x04000008 - adds r0, r4, 0 - bl CpuSet - adds r0, r6, 0 - bl battle_get_per_side_status - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - add r0, sp, 0x10 - ldrb r0, [r0, 0x8] - str r0, [sp] - ldr r0, [sp, 0x10] - adds r0, r7 - str r0, [sp, 0x4] - ldr r0, [sp, 0x14] - add r0, r8 - str r0, [sp, 0x8] - add r0, sp, 0x10 - ldrh r0, [r0, 0xA] - str r0, [sp, 0xC] - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl sub_8118FBC -_080A4666: - add sp, 0x28 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A438C - - thumb_func_start sub_80A46A0 -sub_80A46A0: @ 80A46A0 - push {r4-r7,lr} - sub sp, 0x10 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x18] - ldrh r0, [r0] - bl sub_80DB2A8 - lsls r0, 24 - cmp r0, 0 - beq _080A4712 - mov r0, sp - bl sub_80A6B30 - ldr r6, [sp, 0x4] - movs r5, 0 - movs r0, 0x7 - mov r12, r0 - movs r7, 0 -_080A46C6: - movs r4, 0 - adds r3, r7, r6 - mov r1, r12 - lsls r0, r1, 1 - adds r2, r0, r6 -_080A46D0: - ldrh r1, [r3] - ldrh r0, [r2] - strh r0, [r3] - strh r1, [r2] - adds r3, 0x2 - subs r2, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - ble _080A46D0 - movs r0, 0x20 - add r12, r0 - adds r7, 0x40 - adds r5, 0x1 - cmp r5, 0x7 - ble _080A46C6 - movs r5, 0 - movs r1, 0x80 - lsls r1, 3 - adds r3, r1, 0 -_080A46F6: - adds r2, r5, 0x1 - lsls r0, r5, 6 - adds r1, r0, r6 - movs r4, 0x7 -_080A46FE: - ldrh r0, [r1] - eors r0, r3 - strh r0, [r1] - adds r1, 0x2 - subs r4, 0x1 - cmp r4, 0 - bge _080A46FE - adds r5, r2, 0 - cmp r5, 0x7 - ble _080A46F6 -_080A4712: - add sp, 0x10 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A46A0 - - thumb_func_start sub_80A4720 -sub_80A4720: @ 80A4720 - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r8, r1 - adds r6, r2, 0 - lsls r0, 16 - lsrs r5, r0, 16 - lsls r3, 24 - movs r0, 0x40 - mov r12, r0 - cmp r3, 0 - bne _080A473C - movs r1, 0x20 - mov r12, r1 -_080A473C: - lsls r0, r5, 28 - lsrs r5, r0, 16 - movs r0, 0 - cmp r0, r12 - bge _080A476C - ldr r7, =0x00000fff -_080A4748: - adds r4, r0, 0x1 - lsls r0, 6 - mov r1, r8 - adds r3, r0, r1 - movs r2, 0x1F -_080A4752: - ldrh r1, [r3] - adds r0, r7, 0 - ands r0, r1 - orrs r0, r5 - adds r0, r6 - strh r0, [r3] - adds r3, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _080A4752 - adds r0, r4, 0 - cmp r0, r12 - blt _080A4748 -_080A476C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A4720 - - thumb_func_start sub_80A477C -sub_80A477C: @ 80A477C - push {r4,lr} - sub sp, 0x10 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - mov r0, sp - bl sub_80A6B30 - cmp r4, 0 - beq _080A479C - bl sub_80A4DF0 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _080A47B8 -_080A479C: - movs r0, 0x1 - bl sub_80A6C68 - ldr r0, =0x02022e18 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e1a - strh r1, [r0] - b _080A47C6 - .pool -_080A47B8: - movs r0, 0x2 - bl sub_80A6C68 - ldr r0, =0x02022e1c - strh r4, [r0] - ldr r0, =0x02022e1e - strh r4, [r0] -_080A47C6: - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A477C - - thumb_func_start task_pA_ma0A_obj_to_bg_pal -@ void task_pA_ma0A_obj_to_bg_pal(int task_id) -task_pA_ma0A_obj_to_bg_pal: @ 80A47D8 - push {r4-r6,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r5, r1, r2 - ldrb r4, [r5, 0x8] - ldrb r6, [r5, 0x14] - mov r0, sp - bl sub_80A6B30 - ldr r0, =0x02020630 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r1, r0 - ldrh r2, [r1, 0x24] - ldrh r0, [r1, 0x20] - adds r2, r0 - ldrh r0, [r5, 0xA] - subs r0, r2 - lsls r0, 16 - lsrs r3, r0, 16 - ldrh r2, [r1, 0x26] - ldrh r1, [r1, 0x22] - adds r2, r1 - ldrh r0, [r5, 0xC] - subs r0, r2 - lsls r0, 16 - lsrs r2, r0, 16 - movs r1, 0x12 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _080A4870 - ldr r1, =0x02022e18 - lsls r0, r3, 16 - asrs r0, 16 - ldrh r3, [r5, 0xE] - adds r0, r3 - strh r0, [r1] - ldr r1, =0x02022e1a - lsls r0, r2, 16 - asrs r0, 16 - ldrh r5, [r5, 0x10] - adds r0, r5 - strh r0, [r1] - lsls r0, r6, 5 - ldr r2, =0x02037d14 - adds r0, r2 - mov r1, sp - ldrb r1, [r1, 0x8] - lsls r1, 5 - ldr r3, =0xfffffe00 - adds r2, r3 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet - b _080A4896 - .pool -_080A4870: - ldr r1, =0x02022e1c - lsls r0, r3, 16 - asrs r0, 16 - ldrh r3, [r5, 0xE] - adds r0, r3 - strh r0, [r1] - ldr r1, =0x02022e1e - lsls r0, r2, 16 - asrs r0, 16 - ldrh r5, [r5, 0x10] - adds r0, r5 - strh r0, [r1] - lsls r0, r6, 5 - ldr r1, =0x02037d14 - adds r0, r1 - subs r1, 0xE0 - ldr r2, =0x04000008 - bl CpuSet -_080A4896: - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end task_pA_ma0A_obj_to_bg_pal - - thumb_func_start ma0B_0807324C -ma0B_0807324C: @ 80A48B0 - push {r4,r5,lr} - ldr r0, =0x020383f0 - ldr r2, [r0] - adds r1, r2, 0x1 - str r1, [r0] - ldrb r4, [r2, 0x1] - cmp r4, 0 - bne _080A48C8 - movs r4, 0x2 - b _080A48D2 - .pool -_080A48C8: - cmp r4, 0x1 - bne _080A48CE - movs r4, 0x3 -_080A48CE: - cmp r4, 0 - beq _080A48D6 -_080A48D2: - cmp r4, 0x2 - bne _080A48E0 -_080A48D6: - ldr r0, =0x02038436 - b _080A48E2 - .pool -_080A48E0: - ldr r0, =0x02038437 -_080A48E2: - ldrb r5, [r0] - ldr r3, =0x02038430 - ldrb r0, [r3] - cmp r0, 0xFF - beq _080A4908 - ldr r2, =0x02020630 - ldr r0, =0x020241e4 - adds r0, r5, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] -_080A4908: - cmp r4, 0x1 - bls _080A4948 - ldrb r0, [r3, 0x1] - cmp r0, 0xFF - beq _080A4948 - ldr r3, =0x02020630 - ldr r2, =0x020241e4 - movs r1, 0x2 - adds r0, r5, 0 - eors r0, r1 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - b _080A494A - .pool -_080A4948: - movs r4, 0 -_080A494A: - ldr r0, =sub_80A4980 - movs r1, 0x5 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] - strh r5, [r1, 0xC] - ldr r1, =0x020383f0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ma0B_0807324C - - thumb_func_start sub_80A4980 -sub_80A4980: @ 80A4980 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r1, r0, r1 - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - beq _080A4A0A - ldrb r0, [r1, 0xC] - bl battle_get_per_side_status - lsls r0, 24 - movs r1, 0xFF - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1 - bls _080A49BC - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A49C4 -_080A49BC: - movs r4, 0 - b _080A49C6 - .pool -_080A49C4: - movs r4, 0x1 -_080A49C6: - ldr r6, =0x02038430 - ldrb r0, [r6] - cmp r0, 0xFF - beq _080A49DE - adds r0, r4, 0 - bl sub_80A477C - ldrb r0, [r6] - bl remove_task - movs r0, 0xFF - strb r0, [r6] -_080A49DE: - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - movs r2, 0x8 - ldrsh r0, [r1, r2] - cmp r0, 0x1 - ble _080A4A04 - movs r0, 0x1 - eors r4, r0 - adds r0, r4, 0 - bl sub_80A477C - ldrb r0, [r6, 0x1] - bl remove_task - movs r0, 0xFF - strb r0, [r6, 0x1] -_080A4A04: - adds r0, r5, 0 - bl remove_task -_080A4A0A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A4980 - - thumb_func_start sub_80A4A18 -sub_80A4A18: @ 80A4A18 - push {r4,r5,lr} - ldr r0, =0x020383f0 - ldr r2, [r0] - adds r1, r2, 0x1 - str r1, [r0] - ldrb r5, [r2, 0x1] - cmp r5, 0 - bne _080A4A30 - movs r5, 0x2 - b _080A4A3A - .pool -_080A4A30: - cmp r5, 0x1 - bne _080A4A36 - movs r5, 0x3 -_080A4A36: - cmp r5, 0 - beq _080A4A3E -_080A4A3A: - cmp r5, 0x2 - bne _080A4A48 -_080A4A3E: - ldr r0, =0x02038436 - b _080A4A4A - .pool -_080A4A48: - ldr r0, =0x02038437 -_080A4A4A: - ldrb r4, [r0] - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A4A8A - adds r0, r4, 0 - bl battle_get_per_side_status - lsls r0, 24 - movs r1, 0xFF - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1 - bls _080A4A76 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A4A80 -_080A4A76: - movs r1, 0 - b _080A4A82 - .pool -_080A4A80: - movs r1, 0x1 -_080A4A82: - adds r0, r4, 0 - movs r2, 0 - bl sub_80A438C -_080A4A8A: - movs r0, 0x2 - eors r4, r0 - cmp r5, 0x1 - bls _080A4ACA - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A4ACA - adds r0, r4, 0 - bl battle_get_per_side_status - lsls r0, 24 - movs r1, 0xFF - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1 - bls _080A4ABC - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A4AC0 -_080A4ABC: - movs r1, 0 - b _080A4AC2 -_080A4AC0: - movs r1, 0x1 -_080A4AC2: - adds r0, r4, 0 - movs r2, 0 - bl sub_80A438C -_080A4ACA: - ldr r1, =0x020383f0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A4A18 - - thumb_func_start ma23_8073484 -ma23_8073484: @ 80A4ADC - push {r4-r6,lr} - ldr r0, =0x020383f0 - ldr r2, [r0] - adds r1, r2, 0x1 - str r1, [r0] - ldrb r5, [r2, 0x1] - cmp r5, 0 - bne _080A4AF4 - movs r5, 0x2 - b _080A4AFE - .pool -_080A4AF4: - cmp r5, 0x1 - bne _080A4AFA - movs r5, 0x3 -_080A4AFA: - cmp r5, 0 - beq _080A4B02 -_080A4AFE: - cmp r5, 0x2 - bne _080A4B0C -_080A4B02: - ldr r0, =0x02038436 - b _080A4B0E - .pool -_080A4B0C: - ldr r0, =0x02038437 -_080A4B0E: - ldrb r6, [r0] - adds r0, r6, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A4B38 - ldr r2, =0x02020630 - ldr r0, =0x020241e4 - adds r0, r6, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] -_080A4B38: - cmp r5, 0x1 - bls _080A4B78 - movs r0, 0x2 - adds r4, r6, 0 - eors r4, r0 - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A4B78 - ldr r2, =0x02020630 - ldr r0, =0x020241e4 - adds r0, r4, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - b _080A4B7A - .pool -_080A4B78: - movs r5, 0 -_080A4B7A: - ldr r0, =sub_80A4BB0 - movs r1, 0x5 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r5, [r1, 0x8] - strh r6, [r1, 0xC] - ldr r1, =0x020383f0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end ma23_8073484 - - thumb_func_start sub_80A4BB0 -sub_80A4BB0: @ 80A4BB0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r1, r0, r1 - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - beq _080A4C3E - ldrb r4, [r1, 0xC] - adds r0, r4, 0 - bl battle_get_per_side_status - lsls r0, 24 - movs r1, 0xFF - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1 - bls _080A4BEE - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A4BF8 -_080A4BEE: - movs r5, 0 - b _080A4BFA - .pool -_080A4BF8: - movs r5, 0x1 -_080A4BFA: - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A4C0C - adds r0, r5, 0 - bl sub_80A477C -_080A4C0C: - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - movs r2, 0x8 - ldrsh r0, [r1, r2] - cmp r0, 0x1 - ble _080A4C38 - movs r0, 0x2 - eors r4, r0 - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A4C38 - movs r0, 0x1 - eors r5, r0 - adds r0, r5, 0 - bl sub_80A477C -_080A4C38: - adds r0, r6, 0 - bl remove_task -_080A4C3E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A4BB0 - - thumb_func_start ma0C_set_BLDCNT_to_x3F40_and_BLDALPHA_to_argument -ma0C_set_BLDCNT_to_x3F40_and_BLDALPHA_to_argument: @ 80A4C48 - push {r4,r5,lr} - ldr r2, =0x020383f0 - ldr r0, [r2] - adds r1, r0, 0x1 - str r1, [r2] - ldrb r5, [r0, 0x1] - adds r0, r1, 0x1 - str r0, [r2] - ldrb r4, [r1, 0x1] - lsls r4, 8 - adds r0, 0x1 - str r0, [r2] - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - orrs r5, r4 - movs r0, 0x52 - adds r1, r5, 0 - bl SetGpuReg - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ma0C_set_BLDCNT_to_x3F40_and_BLDALPHA_to_argument - - thumb_func_start ma1E_set_BLDCNT -ma1E_set_BLDCNT: @ 80A4C80 - push {lr} - ldr r3, =0x020383f0 - ldr r0, [r3] - adds r2, r0, 0x1 - str r2, [r3] - ldrb r1, [r0, 0x1] - adds r0, r2, 0x1 - str r0, [r3] - ldrb r2, [r2, 0x1] - lsls r2, 8 - adds r0, 0x1 - str r0, [r3] - orrs r1, r2 - movs r0, 0x50 - bl SetGpuReg - pop {r0} - bx r0 - .pool - thumb_func_end ma1E_set_BLDCNT - - thumb_func_start ma0D_reset_BLDCNT_and_BLDALPHA -ma0D_reset_BLDCNT_and_BLDALPHA: @ 80A4CA8 - push {lr} - ldr r1, =0x020383f0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - pop {r0} - bx r0 - .pool - thumb_func_end ma0D_reset_BLDCNT_and_BLDALPHA - - thumb_func_start ma0E_call -ma0E_call: @ 80A4CCC - push {r4,lr} - ldr r4, =0x020383f0 - ldr r1, [r4] - adds r3, r1, 0x1 - str r3, [r4] - ldr r2, =0x020383f4 - adds r0, r1, 0x5 - str r0, [r2] - ldrb r1, [r1, 0x1] - ldrb r0, [r3, 0x1] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r3, 0x2] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r3, 0x3] - lsls r0, 24 - adds r1, r0 - str r1, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ma0E_call - - thumb_func_start sub_80A4D00 -sub_80A4D00: @ 80A4D00 - ldr r0, =0x020383f0 - ldr r1, =0x020383f4 - ldr r1, [r1] - str r1, [r0] - bx lr - .pool - thumb_func_end sub_80A4D00 - - thumb_func_start ma10_080736AC -ma10_080736AC: @ 80A4D14 - push {r4,r5,lr} - ldr r5, =0x020383f0 - ldr r1, [r5] - adds r0, r1, 0x1 - str r0, [r5] - ldrb r2, [r1, 0x1] - adds r3, r0, 0x1 - str r3, [r5] - ldrb r4, [r0, 0x1] - ldrb r0, [r3, 0x1] - lsls r0, 8 - orrs r4, r0 - adds r1, 0x4 - str r1, [r5] - ldr r0, =0x0203841e - lsls r2, 1 - adds r2, r0 - strh r4, [r2] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ma10_080736AC - - thumb_func_start ma11_if_else -ma11_if_else: @ 80A4D48 - push {lr} - ldr r3, =0x020383f0 - ldr r2, [r3] - adds r0, r2, 0x1 - str r0, [r3] - ldr r0, =0x02038432 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080A4D62 - adds r0, r2, 0x5 - str r0, [r3] -_080A4D62: - ldr r2, [r3] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x2] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 24 - adds r1, r0 - str r1, [r3] - pop {r0} - bx r0 - .pool - thumb_func_end ma11_if_else - - thumb_func_start ma12_cond_if -ma12_cond_if: @ 80A4D88 - push {r4,r5,lr} - ldr r5, =0x020383f0 - ldr r4, [r5] - adds r2, r4, 0x1 - str r2, [r5] - ldrb r1, [r4, 0x1] - adds r3, r2, 0x1 - str r3, [r5] - ldr r0, =0x02038432 - ldrb r0, [r0] - cmp r1, r0 - bne _080A4DC0 - ldrb r1, [r2, 0x1] - ldrb r0, [r3, 0x1] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r3, 0x2] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r3, 0x3] - lsls r0, 24 - adds r1, r0 - str r1, [r5] - b _080A4DC4 - .pool -_080A4DC0: - adds r0, r4, 0x6 - str r0, [r5] -_080A4DC4: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end ma12_cond_if - - thumb_func_start ma13_goto -ma13_goto: @ 80A4DCC - ldr r3, =0x020383f0 - ldr r0, [r3] - adds r2, r0, 0x1 - str r2, [r3] - ldrb r1, [r0, 0x1] - ldrb r0, [r2, 0x1] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x2] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 24 - adds r1, r0 - str r1, [r3] - bx lr - .pool - thumb_func_end ma13_goto - - thumb_func_start sub_80A4DF0 -sub_80A4DF0: @ 80A4DF0 - push {lr} - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080A4E10 - movs r0, 0 - b _080A4E12 - .pool -_080A4E10: - movs r0, 0x1 -_080A4E12: - pop {r1} - bx r1 - thumb_func_end sub_80A4DF0 - - thumb_func_start ma14_load_background -ma14_load_background: @ 80A4E18 - push {r4,lr} - ldr r1, =0x020383f0 - ldr r2, [r1] - adds r0, r2, 0x1 - str r0, [r1] - ldrb r4, [r2, 0x1] - adds r0, 0x1 - str r0, [r1] - ldr r0, =task_p5_load_battle_screen_elements - movs r1, 0x5 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] - ldr r1, =0x02038433 - movs r0, 0x1 - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ma14_load_background - - thumb_func_start sub_80A4E5C -sub_80A4E5C: @ 80A4E5C - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r2, =0x020383f0 - ldr r1, [r2] - adds r0, r1, 0x1 - str r0, [r2] - ldrb r3, [r1, 0x1] - mov r8, r3 - ldrb r7, [r0, 0x1] - ldrb r6, [r0, 0x2] - adds r1, 0x4 - str r1, [r2] - ldr r0, =task_p5_load_battle_screen_elements - movs r1, 0x5 - bl AddTask - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A4EA8 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - strh r6, [r0, 0x8] - b _080A4EDA - .pool -_080A4EA8: - ldr r0, =0x02038437 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _080A4ECC - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - strh r7, [r0, 0x8] - b _080A4EDA - .pool -_080A4ECC: - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - mov r1, r8 - strh r1, [r0, 0x8] -_080A4EDA: - ldr r1, =0x02038433 - movs r0, 0x1 - strb r0, [r1] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A4E5C - - thumb_func_start task_p5_load_battle_screen_elements -task_p5_load_battle_screen_elements: @ 80A4EF4 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - ldrh r6, [r4, 0x1C] - movs r0, 0x1C - ldrsh r3, [r4, r0] - adds r7, r1, 0 - cmp r3, 0 - bne _080A4F2C - str r3, [sp] - movs r0, 0xE8 - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl sub_80A27B0 - ldrh r0, [r4, 0x1C] - adds r0, 0x1 - strh r0, [r4, 0x1C] - b _080A4FBC - .pool -_080A4F2C: - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080A4FBC - cmp r3, 0x1 - bne _080A4F50 - adds r0, r6, 0x1 - strh r0, [r4, 0x1C] - ldr r1, =0x02038433 - movs r0, 0x2 - strb r0, [r1] - b _080A4F94 - .pool -_080A4F50: - cmp r3, 0x2 - bne _080A4F94 - ldrh r0, [r4, 0x8] - lsls r2, r0, 16 - asrs r1, r2, 16 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - bne _080A4F68 - bl dp01t_11_3_message_for_player_only - b _080A4F6E -_080A4F68: - lsrs r0, r2, 16 - bl sub_80A4FC8 -_080A4F6E: - movs r0, 0x1 - str r0, [sp] - movs r0, 0xE8 - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl sub_80A27B0 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x1C] - adds r1, 0x1 - strh r1, [r0, 0x1C] - b _080A4FBC - .pool -_080A4F94: - ldrb r1, [r2, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _080A4FBC - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r7 - movs r1, 0x1C - ldrsh r0, [r0, r1] - cmp r0, 0x3 - bne _080A4FBC - adds r0, r5, 0 - bl remove_task - ldr r0, =0x02038433 - strb r4, [r0] -_080A4FBC: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end task_p5_load_battle_screen_elements - - thumb_func_start sub_80A4FC8 -sub_80A4FC8: @ 80A4FC8 - push {r4-r7,lr} - lsls r0, 16 - lsrs r7, r0, 16 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A5050 - ldr r6, =gUnknown_08525D54 - lsls r4, r7, 1 - adds r4, r7 - lsls r4, 2 - adds r0, r6, 0 - adds r0, 0x8 - adds r0, r4, r0 - ldr r0, [r0] - ldr r5, =0x0201c000 - adds r1, r5, 0 - bl LZDecompressWram - bl sub_80A6D94 - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x80 - lsls r2, 1 - adds r1, r5, 0 - movs r3, 0 - bl sub_80A4720 - ldr r1, =0x0600d000 - ldr r0, =0x040000d4 - str r5, [r0] - str r1, [r0, 0x4] - ldr r1, =0x84000200 - str r1, [r0, 0x8] - ldr r0, [r0, 0x8] - adds r0, r4, r6 - ldr r0, [r0] - ldr r1, =0x06002000 - bl LZDecompressVram - adds r6, 0x4 - adds r4, r6 - ldr r4, [r4] - bl sub_80A6D94 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 20 - adds r0, r4, 0 - movs r2, 0x20 - bl decompress_palette - b _080A507E - .pool -_080A5050: - ldr r5, =gUnknown_08525D54 - lsls r4, r7, 1 - adds r4, r7 - lsls r4, 2 - adds r0, r5, 0 - adds r0, 0x8 - adds r0, r4, r0 - ldr r0, [r0] - ldr r1, =0x0600d000 - bl LZDecompressVram - adds r0, r4, r5 - ldr r0, [r0] - ldr r1, =0x06008000 - bl LZDecompressVram - adds r5, 0x4 - adds r4, r5 - ldr r0, [r4] - movs r1, 0x20 - movs r2, 0x20 - bl decompress_palette -_080A507E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A4FC8 - - thumb_func_start dp01t_11_3_message_for_player_only -dp01t_11_3_message_for_player_only: @ 80A5090 - push {lr} - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A50A2 - bl sub_80D7724 - b _080A50A6 -_080A50A2: - bl load_battle_oval_graphics -_080A50A6: - pop {r0} - bx r0 - thumb_func_end dp01t_11_3_message_for_player_only - - thumb_func_start ma15_load_battle_screen_elements -ma15_load_battle_screen_elements: @ 80A50AC - push {lr} - ldr r1, =0x020383f0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - ldr r0, =task_p5_load_battle_screen_elements - movs r1, 0x5 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r0, =0x0000ffff - strh r0, [r1, 0x8] - ldr r1, =0x02038433 - movs r0, 0x1 - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end ma15_load_battle_screen_elements - - thumb_func_start ma16_wait_for_battle_screen_elements_s2 -ma16_wait_for_battle_screen_elements_s2: @ 80A50F0 - push {lr} - ldr r0, =0x02038433 - ldrb r0, [r0] - cmp r0, 0x2 - bne _080A5114 - ldr r1, =0x020383f0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - ldr r1, =0x020383fc - movs r0, 0 - b _080A5118 - .pool -_080A5114: - ldr r1, =0x020383fc - movs r0, 0x1 -_080A5118: - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end ma16_wait_for_battle_screen_elements_s2 - - thumb_func_start sub_80A5124 -sub_80A5124: @ 80A5124 - push {lr} - ldr r0, =0x02038433 - ldrb r2, [r0] - cmp r2, 0 - bne _080A5148 - ldr r0, =0x020383f0 - ldr r1, [r0] - adds r1, 0x1 - str r1, [r0] - ldr r0, =0x020383fc - strb r2, [r0] - b _080A514E - .pool -_080A5148: - ldr r1, =0x020383fc - movs r0, 0x1 - strb r0, [r1] -_080A514E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A5124 - - thumb_func_start ma18_load_background_probably -ma18_load_background_probably: @ 80A5158 - push {r4,lr} - ldr r4, =0x020383f0 - ldr r1, [r4] - adds r0, r1, 0x1 - str r0, [r4] - ldrb r0, [r1, 0x1] - bl sub_80A4FC8 - ldr r0, [r4] - adds r0, 0x1 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ma18_load_background_probably - - thumb_func_start sub_80A5178 -sub_80A5178: @ 80A5178 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A51C0 - ldr r0, =0x020244d0 - ldr r1, [r0] - ldr r0, =0x02038436 - ldrb r2, [r0] - ldr r1, [r1, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080A51C0 - adds r0, r2, 0 - bl battle_side_get_owner - lsls r0, 24 - movs r4, 0xC0 - cmp r0, 0 - beq _080A5252 - movs r4, 0x3F - b _080A5252 - .pool -_080A51C0: - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A51E8 - ldr r0, =0x02038436 - ldr r1, =0x02038437 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bne _080A524C - cmp r0, 0x2 - bne _080A524C - cmp r4, 0x3F - beq _080A525E - b _080A524C - .pool -_080A51E8: - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _080A5226 - ldr r0, =0x02038437 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _080A5252 - lsls r0, r4, 24 - asrs r1, r0, 24 - cmp r1, 0x3F - bne _080A5218 - movs r4, 0xC0 - b _080A5252 - .pool -_080A5218: - movs r0, 0x40 - negs r0, r0 - cmp r1, r0 - beq _080A5252 - negs r0, r1 - lsls r0, 24 - b _080A5250 -_080A5226: - ldr r0, =0x02038437 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080A524C - lsls r0, r4, 24 - asrs r0, 24 - movs r1, 0x40 - negs r1, r1 - cmp r0, r1 - bne _080A5252 - movs r4, 0x3F - b _080A5252 - .pool -_080A524C: - lsls r0, r4, 24 - negs r0, r0 -_080A5250: - lsrs r4, r0, 24 -_080A5252: - lsls r0, r4, 24 - asrs r0, 24 - cmp r0, 0x3F - ble _080A525E - movs r4, 0x3F - b _080A526C -_080A525E: - lsls r0, r4, 24 - asrs r0, 24 - movs r1, 0x40 - negs r1, r1 - cmp r0, r1 - bge _080A526C - movs r4, 0xC0 -_080A526C: - lsls r0, r4, 24 - asrs r0, 24 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80A5178 - - thumb_func_start sub_80A5278 -sub_80A5278: @ 80A5278 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A52C0 - ldr r0, =0x020244d0 - ldr r1, [r0] - ldr r0, =0x02038436 - ldrb r2, [r0] - ldr r1, [r1, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080A52C0 - adds r0, r2, 0 - bl battle_side_get_owner - lsls r0, 24 - movs r4, 0xC0 - cmp r0, 0 - beq _080A52DE - movs r4, 0x3F - b _080A52DE - .pool -_080A52C0: - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _080A52D8 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A52DE -_080A52D8: - lsls r0, r4, 24 - negs r0, r0 - lsrs r4, r0, 24 -_080A52DE: - lsls r0, r4, 24 - asrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A5278 - - thumb_func_start sub_80A52EC -sub_80A52EC: @ 80A52EC - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - asrs r2, r0, 16 - cmp r2, 0x3F - ble _080A52FC - movs r1, 0x3F - b _080A5306 -_080A52FC: - movs r0, 0x40 - negs r0, r0 - cmp r2, r0 - bge _080A5306 - ldr r1, =0x0000ffc0 -_080A5306: - lsls r0, r1, 16 - asrs r0, 16 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A52EC - - thumb_func_start sub_80A5314 -sub_80A5314: @ 80A5314 - push {lr} - lsls r2, 16 - lsrs r2, 16 - adds r3, r2, 0 - lsls r0, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - cmp r0, r1 - bge _080A5332 - lsls r0, r2, 16 - asrs r0, 16 - cmp r0, 0 - bge _080A5342 - b _080A5340 -_080A5332: - cmp r0, r1 - ble _080A5348 - lsls r0, r3, 16 - asrs r0, 16 - cmp r0, 0 - bge _080A5340 - negs r0, r0 -_080A5340: - negs r0, r0 -_080A5342: - lsls r0, 16 - lsrs r0, 16 - b _080A534A -_080A5348: - movs r0, 0 -_080A534A: - lsls r0, 16 - asrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_80A5314 - - thumb_func_start ma19_08073BC8 -ma19_08073BC8: @ 80A5354 - push {r4,r5,lr} - ldr r5, =0x020383f0 - ldr r0, [r5] - adds r1, r0, 0x1 - str r1, [r5] - ldrb r4, [r0, 0x1] - ldrb r0, [r1, 0x1] - lsls r0, 8 - orrs r4, r0 - movs r0, 0x2 - ldrsb r0, [r1, r0] - bl sub_80A5178 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - adds r0, r4, 0 - bl audio_play_and_stuff - ldr r0, [r5] - adds r0, 0x3 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ma19_08073BC8 - - thumb_func_start ma1A_8073C00 -ma1A_8073C00: @ 80A538C - push {r4,lr} - ldr r4, =0x020383f0 - ldr r1, [r4] - adds r0, r1, 0x1 - str r0, [r4] - movs r0, 0x1 - ldrsb r0, [r1, r0] - bl sub_80A5178 - lsls r0, 24 - asrs r0, 24 - bl sub_80A3870 - ldr r0, [r4] - adds r0, 0x1 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ma1A_8073C00 - - thumb_func_start ma1B_8073C2C -ma1B_8073C2C: @ 80A53B8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =0x020383f0 - mov r10, r0 - ldr r0, [r0] - adds r1, r0, 0x1 - mov r2, r10 - str r1, [r2] - ldrb r0, [r0, 0x1] - mov r9, r0 - ldrb r0, [r1, 0x1] - lsls r0, 8 - mov r2, r9 - orrs r2, r0 - mov r9, r2 - ldrb r4, [r1, 0x3] - ldrb r6, [r1, 0x4] - ldrb r7, [r1, 0x5] - movs r0, 0x2 - ldrsb r0, [r1, r0] - bl sub_80A5178 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, 24 - asrs r4, 24 - adds r0, r4, 0 - bl sub_80A5178 - mov r8, r0 - lsls r5, 24 - asrs r5, 24 - mov r0, r8 - lsls r0, 24 - asrs r0, 24 - mov r8, r0 - lsls r6, 24 - asrs r6, 24 - adds r0, r5, 0 - mov r1, r8 - adds r2, r6, 0 - bl sub_80A5314 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =c3_08073CEC - movs r1, 0x1 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r5, [r1, 0x8] - mov r2, r8 - strh r2, [r1, 0xA] - lsls r4, 24 - asrs r4, 24 - strh r4, [r1, 0xC] - strh r7, [r1, 0xE] - strh r5, [r1, 0x10] - mov r0, r9 - adds r1, r5, 0 - bl audio_play_and_stuff - ldr r1, =0x020383ff - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - mov r1, r10 - ldr r0, [r1] - adds r0, 0x6 - str r0, [r1] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end ma1B_8073C2C - - thumb_func_start c3_08073CEC -c3_08073CEC: @ 80A5478 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r7, 0 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r2, r0, r1 - ldrh r0, [r2, 0x18] - adds r1, r0, 0x1 - strh r1, [r2, 0x18] - lsls r0, 16 - asrs r0, 16 - movs r3, 0xE - ldrsh r1, [r2, r3] - cmp r0, r1 - blt _080A54FC - strh r7, [r2, 0x18] - ldrh r6, [r2, 0x8] - ldrh r3, [r2, 0xA] - movs r4, 0x10 - ldrsh r0, [r2, r4] - movs r4, 0xC - ldrsh r1, [r2, r4] - adds r0, r1 - lsls r0, 16 - lsrs r4, r0, 16 - strh r4, [r2, 0x10] - cmp r1, 0 - bne _080A54C0 - lsls r2, r3, 16 - b _080A54E4 - .pool -_080A54C0: - lsls r1, r6, 16 - lsls r0, r3, 16 - asrs r3, r0, 16 - adds r2, r0, 0 - cmp r1, r2 - bge _080A54D6 - lsls r0, r4, 16 - asrs r0, 16 - cmp r0, r3 - blt _080A54E0 - b _080A54E4 -_080A54D6: - lsls r0, r4, 16 - asrs r0, 16 - cmp r0, r3 - bgt _080A54E0 - movs r7, 0x1 -_080A54E0: - cmp r7, 0 - beq _080A54F4 -_080A54E4: - lsrs r4, r2, 16 - adds r0, r5, 0 - bl remove_task - ldr r1, =0x020383ff - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] -_080A54F4: - lsls r0, r4, 24 - asrs r0, 24 - bl sub_80A3870 -_080A54FC: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end c3_08073CEC - - thumb_func_start sub_80A5508 -sub_80A5508: @ 80A5508 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - ldr r0, =0x020383f0 - mov r9, r0 - ldr r0, [r0] - adds r1, r0, 0x1 - mov r2, r9 - str r1, [r2] - ldrb r0, [r0, 0x1] - mov r8, r0 - ldrb r0, [r1, 0x1] - lsls r0, 8 - mov r2, r8 - orrs r2, r0 - mov r8, r2 - ldrb r4, [r1, 0x2] - ldrb r5, [r1, 0x3] - ldrb r6, [r1, 0x4] - ldrb r1, [r1, 0x5] - mov r10, r1 - ldr r0, =c3_08073CEC - movs r1, 0x1 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - lsls r4, 24 - asrs r4, 24 - strh r4, [r1, 0x8] - lsls r5, 24 - asrs r5, 24 - strh r5, [r1, 0xA] - lsls r6, 24 - asrs r6, 24 - strh r6, [r1, 0xC] - mov r0, r10 - strh r0, [r1, 0xE] - strh r4, [r1, 0x10] - mov r0, r8 - adds r1, r4, 0 - bl audio_play_and_stuff - ldr r1, =0x020383ff - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - mov r1, r9 - ldr r0, [r1] - adds r0, 0x6 - str r0, [r1] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A5508 - - thumb_func_start sub_80A559C -sub_80A559C: @ 80A559C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =0x020383f0 - mov r10, r0 - ldr r0, [r0] - adds r1, r0, 0x1 - mov r2, r10 - str r1, [r2] - ldrb r0, [r0, 0x1] - mov r9, r0 - ldrb r0, [r1, 0x1] - lsls r0, 8 - mov r2, r9 - orrs r2, r0 - mov r9, r2 - ldrb r4, [r1, 0x3] - ldrb r0, [r1, 0x4] - mov r8, r0 - ldrb r7, [r1, 0x5] - movs r0, 0x2 - ldrsb r0, [r1, r0] - bl sub_80A5278 - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - lsls r4, 24 - asrs r4, 24 - adds r0, r4, 0 - bl sub_80A5278 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - mov r1, r8 - lsls r1, 24 - asrs r1, 24 - mov r8, r1 - mov r0, r8 - bl sub_80A5278 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =c3_08073CEC - movs r1, 0x1 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - lsls r6, 24 - asrs r6, 24 - strh r6, [r1, 0x8] - lsls r5, 24 - asrs r5, 24 - strh r5, [r1, 0xA] - lsls r4, 24 - asrs r4, 24 - strh r4, [r1, 0xC] - strh r7, [r1, 0xE] - strh r6, [r1, 0x10] - mov r0, r9 - adds r1, r6, 0 - bl audio_play_and_stuff - ldr r1, =0x020383ff - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - mov r2, r10 - ldr r0, [r2] - adds r0, 0x6 - str r0, [r2] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A559C - - thumb_func_start ma1C_8073ED0 -ma1C_8073ED0: @ 80A565C - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - ldr r6, =0x020383f0 - ldr r0, [r6] - adds r1, r0, 0x1 - str r1, [r6] - ldrb r5, [r0, 0x1] - ldrb r0, [r1, 0x1] - lsls r0, 8 - orrs r5, r0 - ldrb r0, [r1, 0x3] - mov r8, r0 - ldrb r2, [r1, 0x4] - mov r9, r2 - movs r0, 0x2 - ldrsb r0, [r1, r0] - bl sub_80A5178 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =sub_80A56E4 - movs r1, 0x1 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r5, [r1, 0x8] - lsls r4, 24 - asrs r4, 24 - strh r4, [r1, 0xA] - mov r2, r8 - strh r2, [r1, 0xC] - mov r2, r9 - strh r2, [r1, 0xE] - mov r2, r8 - strh r2, [r1, 0x18] - ldr r1, [r1] - bl _call_via_r1 - ldr r1, =0x020383ff - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r6] - adds r0, 0x5 - str r0, [r6] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end ma1C_8073ED0 - - thumb_func_start sub_80A56E4 -sub_80A56E4: @ 80A56E4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r2, r0, r1 - ldrh r0, [r2, 0x18] - adds r1, r0, 0x1 - strh r1, [r2, 0x18] - lsls r0, 16 - asrs r0, 16 - movs r3, 0xC - ldrsh r1, [r2, r3] - cmp r0, r1 - blt _080A5732 - movs r0, 0 - strh r0, [r2, 0x18] - ldrh r0, [r2, 0x8] - ldrb r1, [r2, 0xA] - ldrh r4, [r2, 0xE] - subs r4, 0x1 - strh r4, [r2, 0xE] - lsls r4, 24 - lsrs r4, 24 - lsls r1, 24 - asrs r1, 24 - bl audio_play_and_stuff - cmp r4, 0 - bne _080A5732 - adds r0, r5, 0 - bl remove_task - ldr r1, =0x020383ff - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] -_080A5732: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A56E4 - - thumb_func_start ma1D_08073FB4 -ma1D_08073FB4: @ 80A5740 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r6, =0x020383f0 - ldr r0, [r6] - adds r1, r0, 0x1 - str r1, [r6] - ldrb r5, [r0, 0x1] - ldrb r0, [r1, 0x1] - lsls r0, 8 - orrs r5, r0 - ldrb r0, [r1, 0x3] - mov r8, r0 - movs r0, 0x2 - ldrsb r0, [r1, r0] - bl sub_80A5178 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =sub_80A57B4 - movs r1, 0x1 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r5, [r1, 0x8] - lsls r4, 24 - asrs r4, 24 - strh r4, [r1, 0xA] - mov r0, r8 - strh r0, [r1, 0xC] - ldr r1, =0x020383ff - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r6] - adds r0, 0x4 - str r0, [r6] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end ma1D_08073FB4 - - thumb_func_start sub_80A57B4 -sub_80A57B4: @ 80A57B4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r2, r0, r1 - ldrh r0, [r2, 0xC] - subs r1, r0, 0x1 - strh r1, [r2, 0xC] - lsls r0, 16 - cmp r0, 0 - bgt _080A57E8 - ldrh r0, [r2, 0x8] - movs r1, 0xA - ldrsb r1, [r2, r1] - bl audio_play_and_stuff - adds r0, r4, 0 - bl remove_task - ldr r1, =0x020383ff - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] -_080A57E8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A57B4 - - thumb_func_start sub_80A57F8 -sub_80A57F8: @ 80A57F8 - push {r4-r6,lr} - ldr r4, =0x020383f0 - ldr r1, [r4] - adds r3, r1, 0x1 - str r3, [r4] - ldrb r2, [r1, 0x1] - ldrb r0, [r3, 0x1] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r3, 0x2] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r3, 0x3] - lsls r0, 24 - adds r6, r2, r0 - adds r0, r1, 0x5 - str r0, [r4] - ldrb r0, [r1, 0x5] - adds r1, 0x6 - str r1, [r4] - cmp r0, 0 - beq _080A5842 - adds r5, r4, 0 - ldr r4, =0x0203841e - adds r3, r0, 0 -_080A582A: - ldr r2, [r5] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - orrs r1, r0 - strh r1, [r4] - adds r2, 0x2 - str r2, [r5] - adds r4, 0x2 - subs r3, 0x1 - cmp r3, 0 - bne _080A582A -_080A5842: - adds r0, r6, 0 - movs r1, 0x1 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r6 - ldr r1, =0x020383ff - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A57F8 - - thumb_func_start ma20_wait_for_something -ma20_wait_for_something: @ 80A586C - push {r4,r5,lr} - ldr r0, =0x020383ff - ldrb r5, [r0] - cmp r5, 0 - bne _080A58B4 - bl mplay_has_finished_maybe - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _080A58CC - ldr r4, =0x0203842e - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x5A - bls _080A58BA - ldr r0, =0x030075f0 - bl MPlayStop_rev01 - ldr r0, =0x03007630 - bl MPlayStop_rev01 - strh r5, [r4] - b _080A58DE - .pool -_080A58B4: - ldr r1, =0x0203842e - movs r0, 0 - strh r0, [r1] -_080A58BA: - ldr r1, =0x020383fc - movs r0, 0x1 - strb r0, [r1] - b _080A58DE - .pool -_080A58CC: - ldr r0, =0x0203842e - movs r2, 0 - strh r1, [r0] - ldr r1, =0x020383f0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - ldr r0, =0x020383fc - strb r2, [r0] -_080A58DE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ma20_wait_for_something - - thumb_func_start ma21_08074164 -ma21_08074164: @ 80A58F0 - push {r4-r6,lr} - ldr r5, =0x020383f0 - ldr r4, [r5] - adds r3, r4, 0x1 - str r3, [r5] - ldrb r2, [r4, 0x1] - ldrb r1, [r3, 0x1] - ldrb r0, [r3, 0x2] - lsls r0, 8 - orrs r1, r0 - ldr r0, =0x0203841e - lsls r2, 1 - adds r2, r0 - lsls r1, 16 - asrs r1, 16 - movs r6, 0 - ldrsh r0, [r2, r6] - cmp r1, r0 - bne _080A5938 - ldrb r1, [r3, 0x3] - ldrb r0, [r3, 0x4] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r3, 0x5] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r3, 0x6] - lsls r0, 24 - adds r1, r0 - str r1, [r5] - b _080A593E - .pool -_080A5938: - adds r0, r4, 0 - adds r0, 0x8 - str r0, [r5] -_080A593E: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end ma21_08074164 - - thumb_func_start sub_80A5944 -sub_80A5944: @ 80A5944 - push {r4,lr} - ldr r4, =0x020383f0 - ldr r0, [r4] - adds r0, 0x1 - str r0, [r4] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A5978 - ldr r2, [r4] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x2] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 24 - adds r1, r0 - str r1, [r4] - b _080A597E - .pool -_080A5978: - ldr r0, [r4] - adds r0, 0x4 - str r0, [r4] -_080A597E: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A5944 - - thumb_func_start sub_80A5984 -sub_80A5984: @ 80A5984 - push {r4,lr} - ldr r0, =0x020383f0 - ldr r1, [r0] - ldrb r2, [r1, 0x1] - adds r1, 0x2 - str r1, [r0] - cmp r2, 0 - beq _080A59A0 - ldr r0, =0x02038437 - b _080A59A2 - .pool -_080A59A0: - ldr r0, =0x02038436 -_080A59A2: - ldrb r0, [r0] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A59D2 - cmp r4, 0 - beq _080A59BE - cmp r4, 0x3 - bne _080A59D2 -_080A59BE: - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl lcd_bg_operations - movs r0, 0x2 - movs r1, 0x4 - movs r2, 0x2 - bl lcd_bg_operations -_080A59D2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A5984 - - thumb_func_start sub_80A59DC -sub_80A59DC: @ 80A59DC - push {lr} - ldr r0, =0x020383f0 - ldr r1, [r0] - adds r1, 0x1 - str r1, [r0] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A5A04 - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl lcd_bg_operations - movs r0, 0x2 - movs r1, 0x4 - movs r2, 0x2 - bl lcd_bg_operations -_080A5A04: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A59DC - - thumb_func_start sub_80A5A0C -sub_80A5A0C: @ 80A5A0C - push {r4-r7,lr} - ldr r1, =0x020383f0 - ldr r0, [r1] - ldrb r6, [r0, 0x1] - adds r0, 0x2 - str r0, [r1] - ldr r7, =0x02038436 - ldrb r0, [r7] - bl battle_side_get_owner - adds r4, r0, 0 - ldr r5, =0x02038437 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - beq _080A5A78 - cmp r6, 0 - beq _080A5A48 - ldrb r0, [r5] - b _080A5A4A - .pool -_080A5A48: - ldrb r0, [r7] -_080A5A4A: - bl battle_get_per_side_status - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A5A78 - cmp r4, 0 - beq _080A5A64 - cmp r4, 0x3 - bne _080A5A78 -_080A5A64: - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl lcd_bg_operations - movs r0, 0x2 - movs r1, 0x4 - movs r2, 0x2 - bl lcd_bg_operations -_080A5A78: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80A5A0C - - thumb_func_start ma2B_make_side_invisible -ma2B_make_side_invisible: @ 80A5A80 - push {r4,lr} - ldr r4, =0x020383f0 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - beq _080A5AA8 - ldr r1, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_080A5AA8: - ldr r0, [r4] - adds r0, 0x2 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ma2B_make_side_invisible - - thumb_func_start ma2C_make_side_visible -ma2C_make_side_visible: @ 80A5ABC - push {r4,lr} - ldr r4, =0x020383f0 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - beq _080A5AE6 - ldr r1, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] -_080A5AE6: - ldr r0, [r4] - adds r0, 0x2 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ma2C_make_side_visible - - thumb_func_start sub_80A5AFC -sub_80A5AFC: @ 80A5AFC - push {r4-r7,lr} - ldr r1, =0x020383f0 - ldr r0, [r1] - ldrb r7, [r0, 0x1] - adds r0, 0x2 - str r0, [r1] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A5BA6 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _080A5BA6 - ldr r6, =0x02038436 - ldrb r0, [r6] - bl battle_side_get_owner - adds r4, r0, 0 - ldr r5, =0x02038437 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - bne _080A5BA6 - cmp r7, 0 - bne _080A5B54 - ldrb r0, [r6] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0 - b _080A5B60 - .pool -_080A5B54: - ldrb r0, [r5] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x1 -_080A5B60: - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - beq _080A5BA6 - ldr r1, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r2, r0, r1 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r3] - cmp r4, 0x2 - bne _080A5B90 - ldrb r0, [r2, 0x5] - movs r1, 0xC - orrs r0, r1 - strb r0, [r2, 0x5] -_080A5B90: - cmp r4, 0x1 - bne _080A5BA0 - movs r0, 0 - bl sub_80A477C - b _080A5BA6 - .pool -_080A5BA0: - movs r0, 0x1 - bl sub_80A477C -_080A5BA6: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80A5AFC - - thumb_func_start sub_80A5BAC -sub_80A5BAC: @ 80A5BAC - push {r4-r7,lr} - ldr r1, =0x020383f0 - ldr r0, [r1] - ldrb r7, [r0, 0x1] - adds r0, 0x2 - str r0, [r1] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A5C38 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _080A5C38 - ldr r6, =0x02038436 - ldrb r0, [r6] - bl battle_side_get_owner - adds r4, r0, 0 - ldr r5, =0x02038437 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - bne _080A5C38 - cmp r7, 0 - bne _080A5C04 - ldrb r0, [r6] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0 - b _080A5C10 - .pool -_080A5C04: - ldrb r0, [r5] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x1 -_080A5C10: - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - beq _080A5C38 - cmp r4, 0x2 - bne _080A5C38 - ldr r1, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r2, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0, 0x5] -_080A5C38: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A5BAC - - thumb_func_start ma2F_stop_music -ma2F_stop_music: @ 80A5C44 - push {lr} - ldr r0, =0x030075f0 - bl MPlayStop_rev01 - ldr r0, =0x03007630 - bl MPlayStop_rev01 - ldr r1, =0x020383f0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end ma2F_stop_music - - thumb_func_start sub_80A5C6C -sub_80A5C6C: @ 80A5C6C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A5C8A - cmp r4, 0x3 - bne _080A5C8A - cmp r5, 0x3 - bne _080A5C8A - movs r4, 0x1 -_080A5C8A: - cmp r4, 0x4 - bhi _080A5D00 - lsls r0, r4, 2 - ldr r1, =_080A5C9C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080A5C9C: - .4byte _080A5CB0 - .4byte _080A5CD8 - .4byte _080A5CB0 - .4byte _080A5D00 - .4byte _080A5D00 -_080A5CB0: - ldr r4, =gUnknown_08525F58 - adds r0, r5, 0 - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 22 - ldr r1, =0x02022fec - ldr r1, [r1] - movs r2, 0x1 - ands r1, r2 - lsls r1, 4 - adds r0, r1 - adds r0, r4 - ldrb r0, [r0] - b _080A5DB0 - .pool -_080A5CD8: - ldr r4, =gUnknown_08525F58 - adds r0, r5, 0 - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 22 - ldr r1, =0x02022fec - ldr r1, [r1] - movs r2, 0x1 - ands r1, r2 - lsls r1, 4 - adds r0, r1 - adds r0, r4 - ldrb r0, [r0, 0x1] - b _080A5DB0 - .pool -_080A5D00: - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A5D28 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0, 0x18] - ldrb r1, [r2, 0x4] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080A5D24 - ldrh r1, [r2, 0x2] - b _080A5D9A - .pool -_080A5D24: - ldrh r1, [r2] - b _080A5D9A -_080A5D28: - adds r0, r5, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080A5D60 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0] - lsls r0, r5, 2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2] - cmp r0, 0 - bne _080A5D98 - ldr r1, =0x0202406e - lsls r0, r5, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - b _080A5D7E - .pool -_080A5D60: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0] - lsls r0, r5, 2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2] - cmp r0, 0 - bne _080A5D98 - ldr r1, =0x0202406e - lsls r0, r5, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec -_080A5D7E: - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r1, r0, 16 - b _080A5D9A - .pool -_080A5D98: - ldrh r1, [r1, 0x2] -_080A5D9A: - cmp r4, 0x3 - bne _080A5DA4 - adds r0, r5, 0 - movs r2, 0x1 - b _080A5DA8 -_080A5DA4: - adds r0, r5, 0 - movs r2, 0 -_080A5DA8: - bl sub_80A600C - lsls r0, 24 - lsrs r0, 24 -_080A5DB0: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80A5C6C - - thumb_func_start sub_80A5DB8 -sub_80A5DB8: @ 80A5DB8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 16 - lsrs r5, r1, 16 - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080A5DDA - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A5DDA - b _080A5EC8 -_080A5DDA: - cmp r5, 0xC9 - bne _080A5E90 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A5E04 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0, 0x18] - ldrb r1, [r2, 0x4] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080A5E00 - ldr r2, [r2, 0x10] - b _080A5E42 - .pool -_080A5E00: - ldr r2, [r2, 0x8] - b _080A5E42 -_080A5E04: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0] - lsls r1, r4, 2 - adds r0, r1, r0 - ldrh r0, [r0, 0x2] - cmp r0, 0 - bne _080A5E3C - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0 - bl pokemon_getattr - adds r2, r0, 0 - b _080A5E42 - .pool -_080A5E3C: - ldr r0, =0x020244bc - adds r0, r1, r0 - ldr r2, [r0] -_080A5E42: - movs r0, 0xC0 - lsls r0, 18 - ands r0, r2 - lsrs r0, 18 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r2 - lsrs r1, 12 - orrs r0, r1 - movs r1, 0xC0 - lsls r1, 2 - ands r1, r2 - lsrs r1, 6 - orrs r0, r1 - movs r1, 0x3 - ands r1, r2 - orrs r0, r1 - movs r1, 0x1C - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _080A5E7C - adds r0, r5, 0 - b _080A5E86 - .pool -_080A5E7C: - movs r1, 0xCE - lsls r1, 1 - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 -_080A5E86: - ldr r1, =gUnknown_083021D8 - lsls r0, 2 - b _080A5F90 - .pool -_080A5E90: - ldr r0, =0x00000181 - cmp r5, r0 - bne _080A5EB0 - ldr r0, =gUnknown_08525F8C - ldr r1, =0x020244e4 - adds r1, r4, r1 - ldrb r1, [r1] - adds r1, r0 - ldrb r0, [r1] - b _080A5F94 - .pool -_080A5EB0: - movs r0, 0xCE - lsls r0, 1 - cmp r5, r0 - bls _080A5EC0 - ldr r0, =gUnknown_083021D8 - b _080A5F92 - .pool -_080A5EC0: - ldr r1, =gUnknown_083021D8 - b _080A5F8E - .pool -_080A5EC8: - cmp r5, 0xC9 - bne _080A5F58 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0] - lsls r1, r4, 2 - adds r0, r1, r0 - ldrh r0, [r0, 0x2] - cmp r0, 0 - bne _080A5F04 - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0 - bl pokemon_getattr - adds r2, r0, 0 - b _080A5F0A - .pool -_080A5F04: - ldr r0, =0x020244bc - adds r0, r1, r0 - ldr r2, [r0] -_080A5F0A: - movs r0, 0xC0 - lsls r0, 18 - ands r0, r2 - lsrs r0, 18 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r2 - lsrs r1, 12 - orrs r0, r1 - movs r1, 0xC0 - lsls r1, 2 - ands r1, r2 - lsrs r1, 6 - orrs r0, r1 - movs r1, 0x3 - ands r1, r2 - orrs r0, r1 - movs r1, 0x1C - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _080A5F44 - adds r0, r5, 0 - b _080A5F4E - .pool -_080A5F44: - movs r1, 0xCE - lsls r1, 1 - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 -_080A5F4E: - ldr r1, =gUnknown_08300D38 - lsls r0, 2 - b _080A5F90 - .pool -_080A5F58: - ldr r0, =0x00000181 - cmp r5, r0 - bne _080A5F7C - ldr r0, =gUnknown_08525F78 - ldr r1, =0x020244e4 - adds r1, r4, r1 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - b _080A5F94 - .pool -_080A5F7C: - movs r0, 0xCE - lsls r0, 1 - cmp r5, r0 - bls _080A5F8C - ldr r0, =gUnknown_08300D38 - b _080A5F92 - .pool -_080A5F8C: - ldr r1, =gUnknown_08300D38 -_080A5F8E: - lsls r0, r5, 2 -_080A5F90: - adds r0, r1 -_080A5F92: - ldrb r0, [r0, 0x1] -_080A5F94: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A5DB8 - - thumb_func_start sub_80A5FA0 -sub_80A5FA0: @ 80A5FA0 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 16 - lsrs r4, r1, 16 - adds r7, r4, 0 - movs r5, 0 - adds r0, r6, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080A5FFE - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A5FFE - ldr r0, =0x00000181 - cmp r4, r0 - bne _080A5FE8 - ldr r0, =gUnknown_08525F88 - ldr r1, =0x020244e4 - adds r1, r6, r1 - ldrb r1, [r1] - adds r1, r0 - ldrb r5, [r1] - b _080A5FFE - .pool -_080A5FE8: - movs r0, 0xCE - lsls r0, 1 - cmp r4, r0 - bls _080A5FF8 - ldr r0, =gUnknown_08305DCC - b _080A5FFC - .pool -_080A5FF8: - ldr r0, =gUnknown_08305DCC - adds r0, r7, r0 -_080A5FFC: - ldrb r5, [r0] -_080A5FFE: - adds r0, r5, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A5FA0 - - thumb_func_start sub_80A600C -sub_80A600C: @ 80A600C - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 16 - lsrs r5, r1, 16 - lsls r2, 24 - lsrs r7, r2, 24 - adds r0, r6, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080A6030 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A603E -_080A6030: - adds r0, r6, 0 - adds r1, r5, 0 - bl sub_80A5DB8 - lsls r0, 24 - lsrs r4, r0, 24 - b _080A605C -_080A603E: - adds r0, r6, 0 - adds r1, r5, 0 - bl sub_80A5DB8 - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r6, 0 - adds r1, r5, 0 - bl sub_80A5FA0 - lsls r0, 24 - lsrs r0, 24 - subs r0, r4, r0 - lsls r0, 16 - lsrs r4, r0, 16 -_080A605C: - adds r0, r6, 0 - bl battle_get_per_side_status - ldr r3, =gUnknown_08525F58 - lsls r0, 24 - lsrs r0, 22 - ldr r1, =0x02022fec - ldr r1, [r1] - movs r2, 0x1 - ands r1, r2 - lsls r1, 4 - adds r0, r1 - adds r0, r3 - ldrb r0, [r0, 0x1] - adds r0, r4 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r7, 0 - beq _080A609C - adds r0, r6, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _080A6096 - adds r0, r4, 0 - adds r0, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 -_080A6096: - cmp r4, 0x68 - bls _080A609C - movs r4, 0x68 -_080A609C: - adds r0, r4, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A600C - - thumb_func_start sub_80A60AC -sub_80A60AC: @ 80A60AC - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - movs r0, 0xFD - lsls r0, 24 - adds r1, r0 - lsrs r1, 24 - cmp r1, 0x1 - bhi _080A6126 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A60E8 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0, 0x18] - ldrb r1, [r2, 0x4] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080A60E4 - ldrh r1, [r2, 0x2] - b _080A610E - .pool -_080A60E4: - ldrh r1, [r2] - b _080A610E -_080A60E8: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0] - lsls r0, r4, 2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2] - cmp r0, 0 - bne _080A610C - ldr r1, =0x02038438 - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - b _080A610E - .pool -_080A610C: - ldrh r1, [r1, 0x2] -_080A610E: - cmp r5, 0x3 - bne _080A611C - adds r0, r4, 0 - movs r2, 0x1 - bl sub_80A600C - b _080A612E -_080A611C: - adds r0, r4, 0 - movs r2, 0 - bl sub_80A600C - b _080A612E -_080A6126: - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80A5C6C -_080A612E: - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80A60AC - - thumb_func_start sub_80A6138 -sub_80A6138: @ 80A6138 - push {lr} - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x4 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_80A6138 - - thumb_func_start sub_80A614C -sub_80A614C: @ 80A614C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080A6170 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 8 - movs r1, 0x80 - lsls r1, 13 - b _080A6180 -_080A6170: - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 8 - movs r1, 0x88 - lsls r1, 13 -_080A6180: - adds r0, r1 - lsrs r0, 16 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80A614C - - thumb_func_start sub_80A6190 -sub_80A6190: @ 80A6190 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r6, r0, 24 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A6238 - adds r0, r5, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080A61E4 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0] - lsls r0, r5, 2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2] - cmp r0, 0 - bne _080A621C - ldr r1, =0x0202406e - lsls r0, r5, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - b _080A6202 - .pool -_080A61E4: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0] - lsls r0, r5, 2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2] - cmp r0, 0 - bne _080A621C - ldr r1, =0x0202406e - lsls r0, r5, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec -_080A6202: - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 - b _080A621E - .pool -_080A621C: - ldrh r4, [r1, 0x2] -_080A621E: - adds r0, r5, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080A6238 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_80A5FA0 - subs r0, r6, r0 - lsls r0, 24 - lsrs r6, r0, 24 -_080A6238: - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80A6190 - - thumb_func_start obj_id_for_side_relative_to_move -obj_id_for_side_relative_to_move: @ 80A6240 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, 0 - bne _080A6268 - ldr r4, =0x02038436 - ldrb r0, [r4] - bl sub_80A6A90 - lsls r0, 24 - cmp r0, 0 - beq _080A62B6 - ldr r1, =0x020241e4 - ldrb r0, [r4] - b _080A62C6 - .pool -_080A6268: - cmp r0, 0x1 - bne _080A6288 - ldr r4, =0x02038437 - ldrb r0, [r4] - bl sub_80A6A90 - lsls r0, 24 - cmp r0, 0 - beq _080A62B6 - ldr r1, =0x020241e4 - ldrb r0, [r4] - b _080A62C6 - .pool -_080A6288: - cmp r1, 0x2 - bne _080A62A4 - ldr r5, =0x02038436 - ldrb r0, [r5] - movs r4, 0x2 - eors r0, r4 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A62B6 - b _080A62C0 - .pool -_080A62A4: - ldr r5, =0x02038437 - ldrb r0, [r5] - movs r4, 0x2 - eors r0, r4 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - bne _080A62C0 -_080A62B6: - movs r0, 0xFF - b _080A62CA - .pool -_080A62C0: - ldr r1, =0x020241e4 - ldrb r0, [r5] - eors r0, r4 -_080A62C6: - adds r0, r1 - ldrb r0, [r0] -_080A62CA: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end obj_id_for_side_relative_to_move - - thumb_func_start oamt_set_x3A_32 -oamt_set_x3A_32: @ 80A62D4 - strh r1, [r0, 0x3A] - lsrs r1, 16 - strh r1, [r0, 0x3C] - bx lr - thumb_func_end oamt_set_x3A_32 - - thumb_func_start sub_80A62DC -sub_80A62DC: @ 80A62DC - ldrh r2, [r0, 0x3A] - movs r3, 0x3C - ldrsh r1, [r0, r3] - lsls r1, 16 - orrs r2, r1 - str r2, [r0, 0x1C] - bx lr - thumb_func_end sub_80A62DC - - thumb_func_start sub_80A62EC -sub_80A62EC: @ 80A62EC - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _080A6340 - movs r2, 0x2E - ldrsh r0, [r4, r2] - movs r2, 0x30 - ldrsh r1, [r4, r2] - bl sine - strh r0, [r4, 0x24] - movs r1, 0x2E - ldrsh r0, [r4, r1] - movs r2, 0x30 - ldrsh r1, [r4, r2] - bl cosine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x32] - ldrh r2, [r4, 0x2E] - adds r1, r0, r2 - strh r1, [r4, 0x2E] - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0xFF - ble _080A632C - ldr r2, =0xffffff00 - b _080A6334 - .pool -_080A632C: - cmp r0, 0 - bge _080A6338 - movs r2, 0x80 - lsls r2, 1 -_080A6334: - adds r0, r1, r2 - strh r0, [r4, 0x2E] -_080A6338: - ldrh r0, [r4, 0x34] - subs r0, 0x1 - strh r0, [r4, 0x34] - b _080A6346 -_080A6340: - adds r0, r4, 0 - bl sub_80A62DC -_080A6346: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A62EC - - thumb_func_start sub_80A634C -sub_80A634C: @ 80A634C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _080A63BC - movs r2, 0x2E - ldrsh r0, [r4, r2] - ldrh r1, [r4, 0x38] - lsls r1, 16 - asrs r1, 24 - ldrh r2, [r4, 0x30] - adds r1, r2 - lsls r1, 16 - asrs r1, 16 - bl sine - strh r0, [r4, 0x24] - movs r1, 0x2E - ldrsh r0, [r4, r1] - ldrh r1, [r4, 0x38] - lsls r1, 16 - asrs r1, 24 - ldrh r2, [r4, 0x30] - adds r1, r2 - lsls r1, 16 - asrs r1, 16 - bl cosine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x32] - ldrh r2, [r4, 0x2E] - adds r1, r0, r2 - strh r1, [r4, 0x2E] - ldrh r0, [r4, 0x36] - ldrh r2, [r4, 0x38] - adds r0, r2 - strh r0, [r4, 0x38] - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0xFF - ble _080A63A8 - ldr r2, =0xffffff00 - b _080A63B0 - .pool -_080A63A8: - cmp r0, 0 - bge _080A63B4 - movs r2, 0x80 - lsls r2, 1 -_080A63B0: - adds r0, r1, r2 - strh r0, [r4, 0x2E] -_080A63B4: - ldrh r0, [r4, 0x34] - subs r0, 0x1 - strh r0, [r4, 0x34] - b _080A63C2 -_080A63BC: - adds r0, r4, 0 - bl sub_80A62DC -_080A63C2: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A634C - - thumb_func_start sub_80A63C8 -sub_80A63C8: @ 80A63C8 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _080A6444 - movs r2, 0x2E - ldrsh r0, [r4, r2] - movs r2, 0x30 - ldrsh r1, [r4, r2] - bl sine - strh r0, [r4, 0x24] - movs r1, 0x36 - ldrsh r0, [r4, r1] - movs r2, 0x30 - ldrsh r1, [r4, r2] - bl cosine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x32] - ldrh r2, [r4, 0x2E] - adds r1, r0, r2 - strh r1, [r4, 0x2E] - ldrh r0, [r4, 0x38] - ldrh r2, [r4, 0x36] - adds r0, r2 - strh r0, [r4, 0x36] - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0xFF - ble _080A6410 - ldr r2, =0xffffff00 - b _080A6418 - .pool -_080A6410: - cmp r0, 0 - bge _080A641C - movs r2, 0x80 - lsls r2, 1 -_080A6418: - adds r0, r1, r2 - strh r0, [r4, 0x2E] -_080A641C: - ldrh r1, [r4, 0x36] - movs r2, 0x36 - ldrsh r0, [r4, r2] - cmp r0, 0xFF - ble _080A6430 - ldr r2, =0xffffff00 - b _080A6438 - .pool -_080A6430: - cmp r0, 0 - bge _080A643C - movs r2, 0x80 - lsls r2, 1 -_080A6438: - adds r0, r1, r2 - strh r0, [r4, 0x36] -_080A643C: - ldrh r0, [r4, 0x34] - subs r0, 0x1 - strh r0, [r4, 0x34] - b _080A644A -_080A6444: - adds r0, r4, 0 - bl sub_80A62DC -_080A644A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A63C8 - - thumb_func_start sub_80A6450 -sub_80A6450: @ 80A6450 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _080A64A4 - movs r2, 0x2E - ldrsh r0, [r4, r2] - movs r2, 0x30 - ldrsh r1, [r4, r2] - bl sine - strh r0, [r4, 0x24] - movs r1, 0x2E - ldrsh r0, [r4, r1] - movs r2, 0x36 - ldrsh r1, [r4, r2] - bl cosine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x32] - ldrh r2, [r4, 0x2E] - adds r1, r0, r2 - strh r1, [r4, 0x2E] - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0xFF - ble _080A6490 - ldr r2, =0xffffff00 - b _080A6498 - .pool -_080A6490: - cmp r0, 0 - bge _080A649C - movs r2, 0x80 - lsls r2, 1 -_080A6498: - adds r0, r1, r2 - strh r0, [r4, 0x2E] -_080A649C: - ldrh r0, [r4, 0x34] - subs r0, 0x1 - strh r0, [r4, 0x34] - b _080A64AA -_080A64A4: - adds r0, r4, 0 - bl sub_80A62DC -_080A64AA: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A6450 - - thumb_func_start sub_80A64B0 -sub_80A64B0: @ 80A64B0 - push {lr} - adds r1, r0, 0 - ldrh r2, [r1, 0x2E] - movs r3, 0x2E - ldrsh r0, [r1, r3] - cmp r0, 0 - ble _080A64C4 - subs r0, r2, 0x1 - strh r0, [r1, 0x2E] - b _080A64CA -_080A64C4: - adds r0, r1, 0 - bl sub_80A62DC -_080A64CA: - pop {r0} - bx r0 - thumb_func_end sub_80A64B0 - - thumb_func_start sub_80A64D0 -sub_80A64D0: @ 80A64D0 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A64EC - ldr r1, =sub_80A653C - str r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A64D0 - - thumb_func_start sub_80A64EC -sub_80A64EC: @ 80A64EC - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x30 - ldrsh r1, [r4, r0] - movs r2, 0x32 - ldrsh r0, [r4, r2] - cmp r1, r0 - ble _080A6502 - ldrh r0, [r4, 0x2E] - negs r0, r0 - strh r0, [r4, 0x2E] -_080A6502: - movs r1, 0x32 - ldrsh r0, [r4, r1] - movs r2, 0x30 - ldrsh r1, [r4, r2] - subs r0, r1 - ldrh r5, [r4, 0x2E] - movs r2, 0x2E - ldrsh r1, [r4, r2] - bl __divsi3 - cmp r0, 0 - bge _080A651C - negs r0, r0 -_080A651C: - strh r0, [r4, 0x2E] - movs r1, 0x36 - ldrsh r0, [r4, r1] - movs r2, 0x34 - ldrsh r1, [r4, r2] - subs r0, r1 - movs r2, 0x2E - ldrsh r1, [r4, r2] - bl __divsi3 - strh r0, [r4, 0x32] - strh r5, [r4, 0x30] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80A64EC - - thumb_func_start sub_80A653C -sub_80A653C: @ 80A653C - push {lr} - adds r1, r0, 0 - ldrh r2, [r1, 0x2E] - movs r3, 0x2E - ldrsh r0, [r1, r3] - cmp r0, 0 - ble _080A6560 - subs r0, r2, 0x1 - strh r0, [r1, 0x2E] - ldrh r0, [r1, 0x30] - ldrh r2, [r1, 0x24] - adds r0, r2 - strh r0, [r1, 0x24] - ldrh r0, [r1, 0x32] - ldrh r3, [r1, 0x26] - adds r0, r3 - strh r0, [r1, 0x26] - b _080A6566 -_080A6560: - adds r0, r1, 0 - bl sub_80A62DC -_080A6566: - pop {r0} - bx r0 - thumb_func_end sub_80A653C - - thumb_func_start sub_80A656C -sub_80A656C: @ 80A656C - push {lr} - adds r2, r0, 0 - ldrh r1, [r2, 0x2E] - movs r3, 0x2E - ldrsh r0, [r2, r3] - cmp r0, 0 - ble _080A659C - subs r0, r1, 0x1 - strh r0, [r2, 0x2E] - ldrh r0, [r2, 0x30] - ldrh r1, [r2, 0x34] - adds r0, r1 - strh r0, [r2, 0x34] - ldrh r1, [r2, 0x32] - ldrh r3, [r2, 0x36] - adds r1, r3 - strh r1, [r2, 0x36] - lsls r0, 16 - asrs r0, 24 - strh r0, [r2, 0x24] - lsls r1, 16 - asrs r1, 24 - strh r1, [r2, 0x26] - b _080A65A2 -_080A659C: - adds r0, r2, 0 - bl sub_80A62DC -_080A65A2: - pop {r0} - bx r0 - thumb_func_end sub_80A656C - - thumb_func_start sub_80A65A8 -sub_80A65A8: @ 80A65A8 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x2E] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0 - ble _080A65D8 - subs r0, r1, 0x1 - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x30] - ldrh r1, [r4, 0x34] - adds r0, r1 - strh r0, [r4, 0x34] - ldrh r1, [r4, 0x32] - ldrh r2, [r4, 0x36] - adds r1, r2 - strh r1, [r4, 0x36] - lsls r0, 16 - asrs r0, 24 - strh r0, [r4, 0x24] - lsls r1, 16 - asrs r1, 24 - strh r1, [r4, 0x26] - b _080A65DE -_080A65D8: - adds r0, r4, 0 - bl sub_80A62DC -_080A65DE: - adds r0, r4, 0 - bl sub_80D30DC - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A65A8 - - thumb_func_start sub_80A65EC -sub_80A65EC: @ 80A65EC - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x26] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x34] - ldr r5, =0x02038437 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x32] - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x36] - ldr r0, =sub_80A64D0 - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A65EC - - thumb_func_start sub_80A6630 -sub_80A6630: @ 80A6630 - push {r4,lr} - adds r3, r0, 0 - ldrh r1, [r3, 0x2E] - movs r2, 0x2E - ldrsh r0, [r3, r2] - cmp r0, 0 - ble _080A6674 - subs r0, r1, 0x1 - strh r0, [r3, 0x2E] - ldr r2, =0x02020630 - movs r4, 0x34 - ldrsh r1, [r3, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r3, 0x30] - ldrh r4, [r0, 0x24] - adds r1, r4 - strh r1, [r0, 0x24] - movs r0, 0x34 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r3, 0x32] - ldrh r2, [r0, 0x26] - adds r1, r2 - strh r1, [r0, 0x26] - b _080A667A - .pool -_080A6674: - adds r0, r3, 0 - bl sub_80A62DC -_080A667A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A6630 - - thumb_func_start sub_80A6680 -sub_80A6680: @ 80A6680 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x2E] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0 - ble _080A66D0 - subs r0, r1, 0x1 - strh r0, [r4, 0x2E] - ldrh r1, [r4, 0x30] - ldrh r0, [r4, 0x34] - adds r1, r0 - strh r1, [r4, 0x34] - ldrh r0, [r4, 0x32] - ldrh r2, [r4, 0x36] - adds r0, r2 - strh r0, [r4, 0x36] - ldr r3, =0x02020630 - movs r0, 0x38 - ldrsh r2, [r4, r0] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r3 - lsls r1, 16 - asrs r1, 24 - strh r1, [r0, 0x24] - movs r1, 0x38 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r4, 0x36] - lsls r0, 16 - asrs r0, 24 - strh r0, [r1, 0x26] - b _080A66D6 - .pool -_080A66D0: - adds r0, r4, 0 - bl sub_80A62DC -_080A66D6: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A6680 - - thumb_func_start sub_80A66DC -sub_80A66DC: @ 80A66DC - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x2E] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0 - ble _080A673E - subs r0, r1, 0x1 - strh r0, [r4, 0x2E] - ldrh r1, [r4, 0x32] - lsls r0, r1, 16 - asrs r0, 24 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x30] - adds r1, r0 - strh r1, [r4, 0x32] - ldrh r1, [r4, 0x36] - lsls r0, r1, 16 - asrs r0, 24 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x34] - adds r1, r0 - strh r1, [r4, 0x36] - movs r1, 0x2E - ldrsh r0, [r4, r1] - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl __modsi3 - cmp r0, 0 - bne _080A6744 - movs r1, 0x38 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _080A6744 - adds r3, r4, 0 - adds r3, 0x3E - ldrb r2, [r3] - lsls r0, r2, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - b _080A6744 -_080A673E: - adds r0, r4, 0 - bl sub_80A62DC -_080A6744: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A66DC - - thumb_func_start move_anim_8074EE0 -move_anim_8074EE0: @ 80A674C - push {r4,lr} - adds r4, r0, 0 - bl obj_free_rotscale_entry - adds r0, r4, 0 - bl move_anim_8072740 - pop {r4} - pop {r0} - bx r0 - thumb_func_end move_anim_8074EE0 - - thumb_func_start sub_80A6760 -sub_80A6760: @ 80A6760 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x26] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x34] - ldr r5, =0x02038436 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x32] - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x36] - ldr r0, =sub_80A64D0 - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A6760 - - thumb_func_start sub_80A67A4 -sub_80A67A4: @ 80A67A4 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x38] - bl sub_80A1F58 - adds r0, r4, 0 - bl move_anim_8074EE0 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A67A4 - - thumb_func_start sub_80A67BC -sub_80A67BC: @ 80A67BC - push {lr} - adds r2, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _080A67D2 - adds r0, r2, 0 - bl sub_80A62DC -_080A67D2: - pop {r0} - bx r0 - thumb_func_end sub_80A67BC - - thumb_func_start sub_80A67D8 -sub_80A67D8: @ 80A67D8 - push {lr} - adds r2, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080A67EE - adds r0, r2, 0 - bl sub_80A62DC -_080A67EE: - pop {r0} - bx r0 - thumb_func_end sub_80A67D8 - - thumb_func_start sub_80A67F4 -sub_80A67F4: @ 80A67F4 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r4, 0 - bl move_anim_8072740 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A67F4 - - thumb_func_start sub_80A6814 -sub_80A6814: @ 80A6814 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r4, 0 - bl move_anim_task_del - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A6814 - - thumb_func_start sub_80A6838 -sub_80A6838: @ 80A6838 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A6838 - - thumb_func_start sub_80A6864 -sub_80A6864: @ 80A6864 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - mov r8, r5 - ldr r7, =0x02038436 - ldrb r0, [r7] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x02038437 - ldrb r0, [r0] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - bhi _080A68B0 - cmp r6, r0 - bcs _080A68A4 - lsls r0, r5, 16 - b _080A68C0 - .pool -_080A68A4: - ldrb r0, [r7] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080A68BC -_080A68B0: - ldrh r1, [r4, 0x20] - lsls r0, r5, 16 - asrs r0, 16 - subs r1, r0 - strh r1, [r4, 0x20] - b _080A68C8 -_080A68BC: - mov r1, r8 - lsls r0, r1, 16 -_080A68C0: - asrs r0, 16 - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] -_080A68C8: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80A6864 - - thumb_func_start sub_80A68D4 -sub_80A68D4: @ 80A68D4 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x20] - movs r5, 0 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x22] - strh r0, [r4, 0x34] - adds r0, r4, 0 - bl obj_translate_based_on_private_1_2_3_4 - movs r0, 0x2E - ldrsh r1, [r4, r0] - movs r0, 0x80 - lsls r0, 8 - bl __divsi3 - strh r0, [r4, 0x3A] - strh r5, [r4, 0x3C] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80A68D4 - - thumb_func_start sub_80A6900 -sub_80A6900: @ 80A6900 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6F3C - lsls r0, 24 - cmp r0, 0 - bne _080A692C - ldrh r0, [r4, 0x3A] - ldrh r1, [r4, 0x3C] - adds r0, r1 - strh r0, [r4, 0x3C] - lsls r0, 16 - lsrs r0, 24 - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl sine - ldrh r1, [r4, 0x26] - adds r0, r1 - strh r0, [r4, 0x26] - movs r0, 0 - b _080A692E -_080A692C: - movs r0, 0x1 -_080A692E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80A6900 - - thumb_func_start sub_80A6934 -sub_80A6934: @ 80A6934 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6F3C - lsls r0, 24 - cmp r0, 0 - bne _080A6960 - ldrh r0, [r4, 0x3A] - ldrh r1, [r4, 0x3C] - adds r0, r1 - strh r0, [r4, 0x3C] - lsls r0, 16 - lsrs r0, 24 - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl sine - ldrh r1, [r4, 0x24] - adds r0, r1 - strh r0, [r4, 0x24] - movs r0, 0 - b _080A6962 -_080A6960: - movs r0, 0x1 -_080A6962: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80A6934 - - thumb_func_start oamt_add_pos2_onto_pos1 -oamt_add_pos2_onto_pos1: @ 80A6968 - ldrh r1, [r0, 0x24] - ldrh r2, [r0, 0x20] - adds r1, r2 - movs r2, 0 - strh r1, [r0, 0x20] - ldrh r1, [r0, 0x26] - ldrh r3, [r0, 0x22] - adds r1, r3 - strh r1, [r0, 0x22] - strh r2, [r0, 0x24] - strh r2, [r0, 0x26] - bx lr - thumb_func_end oamt_add_pos2_onto_pos1 - - thumb_func_start sub_80A6980 -sub_80A6980: @ 80A6980 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r1, 24 - cmp r1, 0 - bne _080A69A8 - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0 - bl sub_80A60AC - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x1 - bl sub_80A60AC - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] -_080A69A8: - ldr r4, =0x0203841e - movs r0, 0 - ldrsh r1, [r4, r0] - adds r0, r5, 0 - bl sub_80A6864 - ldrh r0, [r4, 0x2] - ldrh r1, [r5, 0x22] - adds r0, r1 - strh r0, [r5, 0x22] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A6980 - - thumb_func_start sub_80A69CC -sub_80A69CC: @ 80A69CC - push {r4,r5,lr} - adds r5, r0, 0 - lsls r1, 24 - cmp r1, 0 - bne _080A69F0 - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0 - bl sub_80A60AC - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x1 - b _080A6A04 - .pool -_080A69F0: - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A60AC - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 -_080A6A04: - bl sub_80A60AC - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - ldr r4, =0x0203841e - movs r0, 0 - ldrsh r1, [r4, r0] - adds r0, r5, 0 - bl sub_80A6864 - ldrh r0, [r4, 0x2] - ldrh r1, [r5, 0x22] - adds r0, r1 - strh r0, [r5, 0x22] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A69CC - - thumb_func_start battle_side_get_owner -battle_side_get_owner: @ 80A6A30 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02024076 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - bx lr - .pool - thumb_func_end battle_side_get_owner - - thumb_func_start battle_get_per_side_status -battle_get_per_side_status: @ 80A6A44 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02024076 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end battle_get_per_side_status - - thumb_func_start battle_get_side_with_given_state -battle_get_side_with_given_state: @ 80A6A54 - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - movs r1, 0 - ldr r0, =0x0202406c - ldrb r2, [r0] - cmp r1, r2 - bcs _080A6A7E - ldr r4, =0x02024076 - ldrb r0, [r4] - cmp r0, r3 - beq _080A6A7E -_080A6A6C: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, r2 - bcs _080A6A7E - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, r3 - bne _080A6A6C -_080A6A7E: - adds r0, r1, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end battle_get_side_with_given_state - - thumb_func_start sub_80A6A90 -sub_80A6A90: @ 80A6A90 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A6ABC - ldr r0, =0x02038436 - ldrb r0, [r0] - cmp r0, r4 - beq _080A6B0A - ldr r0, =0x02038437 - ldrb r0, [r0] - cmp r0, r4 - beq _080A6B0A - b _080A6B18 - .pool -_080A6ABC: - ldr r0, =0x02024076 - adds r0, r4, r0 - ldrb r0, [r0] - cmp r0, 0xFF - beq _080A6B18 - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080A6AF0 - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - b _080A6AFE - .pool -_080A6AF0: - ldr r1, =0x0202406e - lsls r0, r5, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec -_080A6AFE: - adds r0, r1 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _080A6B18 -_080A6B0A: - movs r0, 0x1 - b _080A6B1A - .pool -_080A6B18: - movs r0, 0 -_080A6B1A: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80A6A90 - - thumb_func_start battle_type_is_double -battle_type_is_double: @ 80A6B20 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - bx lr - .pool - thumb_func_end battle_type_is_double - - thumb_func_start sub_80A6B30 -sub_80A6B30: @ 80A6B30 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A4DF0 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _080A6B64 - ldr r0, =0x0202305c - ldr r0, [r0] - str r0, [r4] - ldr r0, =0x02023060 - ldr r0, [r0] - str r0, [r4, 0x4] - movs r1, 0 - movs r0, 0xE - strb r0, [r4, 0x8] - movs r0, 0x1 - strb r0, [r4, 0x9] - strh r1, [r4, 0xA] - b _080A6B7E - .pool -_080A6B64: - ldr r0, =0x0202305c - ldr r0, [r0] - str r0, [r4] - ldr r0, =0x02023060 - ldr r0, [r0] - str r0, [r4, 0x4] - movs r0, 0x8 - strb r0, [r4, 0x8] - movs r0, 0x1 - strb r0, [r4, 0x9] - movs r0, 0x80 - lsls r0, 2 - strh r0, [r4, 0xA] -_080A6B7E: - strh r1, [r4, 0xC] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A6B30 - - thumb_func_start sub_80A6B90 -sub_80A6B90: @ 80A6B90 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80A4DF0 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _080A6BC4 - ldr r0, =0x0202305c - ldr r0, [r0] - str r0, [r4] - ldr r0, =0x02023060 - ldr r0, [r0] - str r0, [r4, 0x4] - movs r1, 0 - movs r0, 0xE - strb r0, [r4, 0x8] - movs r0, 0x1 - strb r0, [r4, 0x9] - strh r1, [r4, 0xA] - b _080A6BEA - .pool -_080A6BC4: - cmp r5, 0x1 - bne _080A6BD0 - adds r0, r4, 0 - bl sub_80A6B30 - b _080A6BEC -_080A6BD0: - ldr r0, =0x0202305c - ldr r0, [r0] - str r0, [r4] - ldr r0, =0x02023060 - ldr r0, [r0] - str r0, [r4, 0x4] - movs r0, 0x9 - strb r0, [r4, 0x8] - movs r0, 0x2 - strb r0, [r4, 0x9] - movs r0, 0xC0 - lsls r0, 2 - strh r0, [r4, 0xA] -_080A6BEA: - strh r1, [r4, 0xC] -_080A6BEC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A6B90 - - thumb_func_start sub_80A6BFC -sub_80A6BFC: @ 80A6BFC - push {r4,r5,lr} - adds r4, r0, 0 - ldr r0, =0x0202305c - ldr r0, [r0] - str r0, [r4] - ldr r0, =0x02023060 - ldr r0, [r0] - str r0, [r4, 0x4] - bl sub_80A4DF0 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - beq _080A6C30 - movs r0, 0 - movs r1, 0xE - strb r1, [r4, 0x8] - movs r1, 0x1 - strb r1, [r4, 0x9] - strh r0, [r4, 0xA] - strh r0, [r4, 0xC] - b _080A6C60 - .pool -_080A6C30: - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1 - bne _080A6C50 - movs r0, 0x8 - strb r0, [r4, 0x8] - strb r1, [r4, 0x9] - movs r0, 0x80 - lsls r0, 2 - b _080A6C5C - .pool -_080A6C50: - movs r0, 0x9 - strb r0, [r4, 0x8] - movs r0, 0x2 - strb r0, [r4, 0x9] - movs r0, 0xC0 - lsls r0, 2 -_080A6C5C: - strh r0, [r4, 0xA] - strh r5, [r4, 0xC] -_080A6C60: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80A6BFC - - thumb_func_start sub_80A6C68 -sub_80A6C68: @ 80A6C68 - push {lr} - sub sp, 0x20 - adds r1, r0, 0 - add r0, sp, 0xC - bl sub_80A6B90 - movs r0, 0 - str r0, [sp, 0x1C] - add r0, sp, 0x1C - ldr r1, [sp, 0xC] - ldr r2, =0x05000800 - bl CpuSet - add r0, sp, 0xC - ldrb r0, [r0, 0x9] - ldr r1, [sp, 0xC] - movs r2, 0x80 - lsls r2, 6 - add r3, sp, 0xC - ldrh r3, [r3, 0xA] - bl LoadBgTiles - add r0, sp, 0xC - ldrb r0, [r0, 0x9] - movs r1, 0x20 - str r1, [sp] - movs r1, 0x40 - str r1, [sp, 0x4] - movs r1, 0x11 - str r1, [sp, 0x8] - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect - add r0, sp, 0xC - ldrb r0, [r0, 0x9] - bl CopyBgTilemapBufferToVram - add sp, 0x20 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A6C68 - - thumb_func_start sub_80A6CC0 -sub_80A6CC0: @ 80A6CC0 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x4 - adds r5, r0, 0 - mov r8, r1 - adds r6, r2, 0 - movs r0, 0 - str r0, [sp] - ldr r4, =0x0202305c - ldr r1, [r4] - ldr r2, =0x05000800 - mov r0, sp - bl CpuSet - ldr r1, [r4] - mov r0, r8 - bl LZDecompressWram - lsls r5, 24 - lsrs r5, 24 - ldr r1, [r4] - movs r2, 0x80 - lsls r2, 6 - lsls r6, 16 - lsrs r6, 16 - adds r0, r5, 0 - adds r3, r6, 0 - bl LoadBgTiles - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A6CC0 - - thumb_func_start sub_80A6D10 -sub_80A6D10: @ 80A6D10 - push {r4,r5,lr} - sub sp, 0xC - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x20 - str r0, [sp] - movs r0, 0x40 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80A6D10 - - thumb_func_start sub_80A6D48 -sub_80A6D48: @ 80A6D48 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6D10 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl CopyBgTilemapBufferToVram - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A6D48 - - thumb_func_start sub_80A6D60 -sub_80A6D60: @ 80A6D60 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r2, 0 - ldrb r0, [r4, 0x9] - bl sub_80A6D10 - bl sub_80A4DF0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080A6D86 - ldrb r0, [r4, 0x8] - ldr r1, [r4, 0x4] - lsls r3, r5, 24 - lsrs r3, 24 - movs r2, 0 - bl sub_80A4720 -_080A6D86: - ldrb r0, [r4, 0x9] - bl CopyBgTilemapBufferToVram - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80A6D60 - - thumb_func_start sub_80A6D94 -sub_80A6D94: @ 80A6D94 - push {lr} - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A6DA4 - movs r0, 0x2 - b _080A6DA6 -_080A6DA4: - movs r0, 0x1 -_080A6DA6: - pop {r1} - bx r1 - thumb_func_end sub_80A6D94 - - thumb_func_start sub_80A6DAC -sub_80A6DAC: @ 80A6DAC - push {lr} - lsls r0, 24 - cmp r0, 0 - beq _080A6DBE - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A6DD4 -_080A6DBE: - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl lcd_bg_operations - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0x1 - bl lcd_bg_operations - b _080A6DE8 -_080A6DD4: - movs r0, 0x3 - movs r1, 0 - movs r2, 0x1 - bl lcd_bg_operations - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0 - bl lcd_bg_operations -_080A6DE8: - pop {r0} - bx r0 - thumb_func_end sub_80A6DAC - - thumb_func_start sub_80A6DEC -sub_80A6DEC: @ 80A6DEC - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x20] - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x22] - strh r0, [r4, 0x34] - adds r0, r4, 0 - bl sub_80A6E14 - ldr r1, =sub_80A65A8 - str r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A6DEC - - thumb_func_start sub_80A6E14 -sub_80A6E14: @ 80A6E14 - push {r4-r6,lr} - adds r5, r0, 0 - ldrh r0, [r5, 0x32] - ldrh r1, [r5, 0x30] - subs r0, r1 - ldrh r4, [r5, 0x36] - ldrh r1, [r5, 0x34] - subs r4, r1 - lsls r4, 24 - lsrs r4, 16 - lsls r0, 24 - asrs r0, 16 - movs r2, 0x2E - ldrsh r1, [r5, r2] - bl __divsi3 - movs r6, 0 - strh r0, [r5, 0x30] - lsls r4, 16 - asrs r4, 16 - movs r0, 0x2E - ldrsh r1, [r5, r0] - adds r0, r4, 0 - bl __divsi3 - strh r0, [r5, 0x32] - strh r6, [r5, 0x36] - strh r6, [r5, 0x34] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80A6E14 - - thumb_func_start obj_translate_based_on_private_1_2_3_4 -obj_translate_based_on_private_1_2_3_4: @ 80A6E54 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r7, r0, 0 - movs r0, 0x32 - ldrsh r1, [r7, r0] - movs r2, 0x30 - ldrsh r0, [r7, r2] - subs r1, r0 - movs r3, 0x36 - ldrsh r2, [r7, r3] - movs r3, 0x34 - ldrsh r0, [r7, r3] - subs r2, r0 - lsrs r0, r1, 31 - mov r8, r0 - lsrs r3, r2, 31 - mov r9, r3 - cmp r1, 0 - bge _080A6E80 - negs r1, r1 -_080A6E80: - lsls r0, r1, 24 - lsrs r6, r0, 16 - adds r0, r2, 0 - cmp r0, 0 - bge _080A6E8C - negs r0, r0 -_080A6E8C: - lsls r0, 24 - lsrs r5, r0, 16 - movs r0, 0x2E - ldrsh r4, [r7, r0] - adds r0, r6, 0 - adds r1, r4, 0 - bl __divsi3 - lsls r0, 16 - lsrs r6, r0, 16 - adds r0, r5, 0 - adds r1, r4, 0 - bl __divsi3 - lsls r0, 16 - lsrs r5, r0, 16 - mov r2, r8 - cmp r2, 0 - beq _080A6EB8 - movs r0, 0x1 - orrs r6, r0 - b _080A6EBC -_080A6EB8: - ldr r0, =0x0000fffe - ands r6, r0 -_080A6EBC: - mov r3, r9 - cmp r3, 0 - beq _080A6ECC - movs r0, 0x1 - orrs r5, r0 - b _080A6ED0 - .pool -_080A6ECC: - ldr r0, =0x0000fffe - ands r5, r0 -_080A6ED0: - movs r0, 0 - strh r6, [r7, 0x30] - strh r5, [r7, 0x32] - strh r0, [r7, 0x36] - strh r0, [r7, 0x34] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end obj_translate_based_on_private_1_2_3_4 - - thumb_func_start sub_80A6EEC -sub_80A6EEC: @ 80A6EEC - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x20] - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x22] - strh r0, [r4, 0x34] - adds r0, r4, 0 - bl obj_translate_based_on_private_1_2_3_4 - ldr r1, =sub_80A6F98 - str r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A6EEC - - thumb_func_start sub_80A6F14 -sub_80A6F14: @ 80A6F14 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x20] - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x22] - strh r0, [r4, 0x34] - adds r0, r4, 0 - bl obj_translate_based_on_private_1_2_3_4 - ldr r1, =sub_80A6FB4 - str r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A6F14 - - thumb_func_start sub_80A6F3C -sub_80A6F3C: @ 80A6F3C - push {r4-r6,lr} - adds r2, r0, 0 - movs r1, 0x2E - ldrsh r0, [r2, r1] - cmp r0, 0 - bne _080A6F4C - movs r0, 0x1 - b _080A6F90 -_080A6F4C: - ldrh r1, [r2, 0x30] - ldrh r4, [r2, 0x32] - ldrh r6, [r2, 0x34] - ldrh r5, [r2, 0x36] - adds r0, r6, r1 - lsls r3, r0, 16 - lsrs r6, r3, 16 - adds r0, r5, r4 - lsls r0, 16 - lsrs r5, r0, 16 - movs r0, 0x1 - ands r1, r0 - cmp r1, 0 - beq _080A6F6E - lsrs r0, r3, 24 - negs r0, r0 - b _080A6F70 -_080A6F6E: - lsrs r0, r3, 24 -_080A6F70: - strh r0, [r2, 0x24] - movs r0, 0x1 - ands r4, r0 - cmp r4, 0 - beq _080A6F80 - lsrs r0, r5, 8 - negs r0, r0 - b _080A6F82 -_080A6F80: - lsrs r0, r5, 8 -_080A6F82: - strh r0, [r2, 0x26] - strh r6, [r2, 0x34] - strh r5, [r2, 0x36] - ldrh r0, [r2, 0x2E] - subs r0, 0x1 - strh r0, [r2, 0x2E] - movs r0, 0 -_080A6F90: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80A6F3C - - thumb_func_start sub_80A6F98 -sub_80A6F98: @ 80A6F98 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6F3C - lsls r0, 24 - cmp r0, 0 - beq _080A6FAC - adds r0, r4, 0 - bl sub_80A62DC -_080A6FAC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A6F98 - - thumb_func_start sub_80A6FB4 -sub_80A6FB4: @ 80A6FB4 - push {r4,lr} - adds r4, r0, 0 - bl sub_8039E9C - adds r0, r4, 0 - bl sub_80A6F3C - lsls r0, 24 - cmp r0, 0 - beq _080A6FCE - adds r0, r4, 0 - bl sub_80A62DC -_080A6FCE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A6FB4 - - thumb_func_start sub_80A6FD4 -sub_80A6FD4: @ 80A6FD4 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r1, [r4, r0] - movs r2, 0x30 - ldrsh r0, [r4, r2] - subs r0, r1, r0 - cmp r0, 0 - bge _080A6FE8 - negs r0, r0 -_080A6FE8: - lsls r0, 8 - movs r2, 0x2E - ldrsh r1, [r4, r2] - bl __divsi3 - strh r0, [r4, 0x2E] - adds r0, r4, 0 - bl obj_translate_based_on_private_1_2_3_4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A6FD4 - - thumb_func_start sub_80A7000 -sub_80A7000: @ 80A7000 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x20] - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x22] - strh r0, [r4, 0x34] - adds r0, r4, 0 - bl sub_80A6FD4 - ldr r1, =sub_80A6F98 - str r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A7000 - - thumb_func_start sub_80A7028 -sub_80A7028: @ 80A7028 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r7, r0, 0 - movs r0, 0x32 - ldrsh r1, [r7, r0] - movs r2, 0x30 - ldrsh r0, [r7, r2] - subs r1, r0 - movs r3, 0x36 - ldrsh r2, [r7, r3] - movs r3, 0x34 - ldrsh r0, [r7, r3] - subs r2, r0 - lsrs r0, r1, 31 - mov r8, r0 - lsrs r3, r2, 31 - mov r9, r3 - cmp r1, 0 - bge _080A7054 - negs r1, r1 -_080A7054: - lsls r0, r1, 20 - lsrs r6, r0, 16 - adds r0, r2, 0 - cmp r0, 0 - bge _080A7060 - negs r0, r0 -_080A7060: - lsls r0, 20 - lsrs r5, r0, 16 - movs r0, 0x2E - ldrsh r4, [r7, r0] - adds r0, r6, 0 - adds r1, r4, 0 - bl __divsi3 - lsls r0, 16 - lsrs r6, r0, 16 - adds r0, r5, 0 - adds r1, r4, 0 - bl __divsi3 - lsls r0, 16 - lsrs r5, r0, 16 - mov r2, r8 - cmp r2, 0 - beq _080A708C - movs r0, 0x1 - orrs r6, r0 - b _080A7090 -_080A708C: - ldr r0, =0x0000fffe - ands r6, r0 -_080A7090: - mov r3, r9 - cmp r3, 0 - beq _080A70A0 - movs r0, 0x1 - orrs r5, r0 - b _080A70A4 - .pool -_080A70A0: - ldr r0, =0x0000fffe - ands r5, r0 -_080A70A4: - movs r0, 0 - strh r6, [r7, 0x30] - strh r5, [r7, 0x32] - strh r0, [r7, 0x36] - strh r0, [r7, 0x34] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A7028 - - thumb_func_start sub_80A70C0 -sub_80A70C0: @ 80A70C0 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x20] - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x22] - strh r0, [r4, 0x34] - adds r0, r4, 0 - bl sub_80A7028 - ldr r1, =sub_80A7144 - str r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A70C0 - - thumb_func_start sub_80A70E8 -sub_80A70E8: @ 80A70E8 - push {r4-r6,lr} - adds r2, r0, 0 - movs r1, 0x2E - ldrsh r0, [r2, r1] - cmp r0, 0 - bne _080A70F8 - movs r0, 0x1 - b _080A713C -_080A70F8: - ldrh r1, [r2, 0x30] - ldrh r4, [r2, 0x32] - ldrh r6, [r2, 0x34] - ldrh r5, [r2, 0x36] - adds r0, r6, r1 - lsls r3, r0, 16 - lsrs r6, r3, 16 - adds r0, r5, r4 - lsls r0, 16 - lsrs r5, r0, 16 - movs r0, 0x1 - ands r1, r0 - cmp r1, 0 - beq _080A711A - lsrs r0, r3, 20 - negs r0, r0 - b _080A711C -_080A711A: - lsrs r0, r3, 20 -_080A711C: - strh r0, [r2, 0x24] - movs r0, 0x1 - ands r4, r0 - cmp r4, 0 - beq _080A712C - lsrs r0, r5, 4 - negs r0, r0 - b _080A712E -_080A712C: - lsrs r0, r5, 4 -_080A712E: - strh r0, [r2, 0x26] - strh r6, [r2, 0x34] - strh r5, [r2, 0x36] - ldrh r0, [r2, 0x2E] - subs r0, 0x1 - strh r0, [r2, 0x2E] - movs r0, 0 -_080A713C: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80A70E8 - - thumb_func_start sub_80A7144 -sub_80A7144: @ 80A7144 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A70E8 - lsls r0, 24 - cmp r0, 0 - beq _080A7158 - adds r0, r4, 0 - bl sub_80A62DC -_080A7158: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A7144 - - thumb_func_start sub_80A7160 -sub_80A7160: @ 80A7160 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r1, [r4, r0] - movs r2, 0x30 - ldrsh r0, [r4, r2] - subs r0, r1, r0 - cmp r0, 0 - bge _080A7174 - negs r0, r0 -_080A7174: - lsls r0, 4 - movs r2, 0x2E - ldrsh r1, [r4, r2] - bl __divsi3 - strh r0, [r4, 0x2E] - adds r0, r4, 0 - bl sub_80A7028 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A7160 - - thumb_func_start sub_80A718C -sub_80A718C: @ 80A718C - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x20] - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x22] - strh r0, [r4, 0x34] - adds r0, r4, 0 - bl sub_80A7160 - ldr r1, =sub_80A7144 - str r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A718C - - thumb_func_start obj_id_set_rotscale -obj_id_set_rotscale: @ 80A71B4 - push {r4,r5,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 16 - lsls r3, 16 - lsrs r3, 16 - ldr r5, =0xffff0000 - lsls r2, 16 - lsrs r1, 16 - orrs r1, r2 - str r1, [sp] - ldr r0, [sp, 0x4] - ands r0, r5 - orrs r0, r3 - str r0, [sp, 0x4] - bl sub_80A7238 - lsls r0, 24 - cmp r0, 0 - beq _080A71F0 - mov r0, sp - ldrh r0, [r0] - negs r0, r0 - lsls r0, 16 - lsrs r0, 16 - ldr r1, [sp] - ands r1, r5 - orrs r1, r0 - str r1, [sp] -_080A71F0: - ldr r1, =0x02020630 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - ldrb r4, [r0, 0x3] - lsls r4, 26 - lsrs r4, 27 - add r5, sp, 0x8 - mov r0, sp - adds r1, r5, 0 - movs r2, 0x1 - movs r3, 0x2 - bl ObjAffineSet - ldr r0, =0x02021bc0 - lsls r4, 3 - adds r4, r0 - ldrh r0, [r5] - strh r0, [r4] - ldrh r0, [r5, 0x2] - strh r0, [r4, 0x2] - ldrh r0, [r5, 0x4] - strh r0, [r4, 0x4] - ldrh r0, [r5, 0x6] - strh r0, [r4, 0x6] - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end obj_id_set_rotscale - - thumb_func_start sub_80A7238 -sub_80A7238: @ 80A7238 - push {r4,lr} - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A7268 - ldr r4, =0x02020630 - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - movs r2, 0x32 - ldrsh r0, [r1, r2] - cmp r0, 0xC9 - beq _080A7268 - movs r0, 0x1 - b _080A726A - .pool -_080A7268: - movs r0, 0 -_080A726A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80A7238 - - thumb_func_start sub_80A7270 -sub_80A7270: @ 80A7270 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - ldr r1, =0x02020630 - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - adds r4, r0, r1 - ldrh r0, [r4, 0x2E] - lsls r0, 24 - lsrs r7, r0, 24 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A72A6 - adds r0, r7, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A72B4 -_080A72A6: - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_080A72B4: - ldr r1, =0x02020630 - lsls r4, r6, 4 - adds r0, r4, r6 - lsls r0, 2 - adds r5, r0, r1 - movs r0, 0x3 - mov r1, r8 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r5, 0x1] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x1] - adds r2, r5, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A7312 - ldrb r0, [r5, 0x1] - lsls r0, 30 - cmp r0, 0 - bne _080A7312 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0, 0x4] - lsls r0, r7, 1 - adds r0, r7 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x6] - movs r0, 0x1F - ands r1, r0 - lsls r1, 1 - ldrb r2, [r5, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x3] -_080A7312: - ldr r1, =0x02020630 - adds r0, r4, r6 - lsls r0, 2 - adds r0, r1 - ldrb r3, [r0, 0x1] - movs r1, 0x3 - orrs r3, r1 - strb r3, [r0, 0x1] - lsrs r1, r3, 6 - ldrb r2, [r0, 0x3] - lsrs r2, 6 - lsls r3, 30 - lsrs r3, 30 - bl CalcVecFromObjectCenterToObjectUpperLeft - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A7270 - - thumb_func_start sub_80A7344 -sub_80A7344: @ 80A7344 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r2, 0x80 - lsls r2, 1 - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl obj_id_set_rotscale - ldr r1, =0x02020630 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - ldrb r2, [r0, 0x1] - movs r1, 0x4 - negs r1, r1 - ands r1, r2 - movs r2, 0x1 - orrs r1, r2 - movs r2, 0xD - negs r2, r2 - ands r1, r2 - strb r1, [r0, 0x1] - adds r3, r0, 0 - adds r3, 0x2C - ldrb r2, [r3] - movs r1, 0x7F - ands r1, r2 - strb r1, [r3] - ldrb r3, [r0, 0x1] - lsrs r1, r3, 6 - ldrb r2, [r0, 0x3] - lsrs r2, 6 - lsls r3, 30 - lsrs r3, 30 - bl CalcVecFromObjectCenterToObjectUpperLeft - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A7344 - - thumb_func_start sub_80A73A0 -sub_80A73A0: @ 80A73A0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r2, r1, r2 - ldrb r0, [r2, 0x3] - lsls r0, 26 - lsrs r0, 27 - ldr r1, =0x02021bc0 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x4] - movs r3, 0x4 - ldrsh r0, [r0, r3] - cmp r0, 0 - bge _080A73CC - negs r0, r0 - lsls r0, 16 - lsrs r1, r0, 16 -_080A73CC: - lsls r0, r1, 16 - asrs r0, 19 - strh r0, [r2, 0x26] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A73A0 - - thumb_func_start sub_80A73E0 -sub_80A73E0: @ 80A73E0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - adds r4, r0, 0 - ldr r0, [sp, 0x28] - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 16 - lsrs r5, r2, 16 - lsls r3, 16 - lsrs r7, r3, 16 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldrb r0, [r4, 0x1] - lsls r0, 30 - lsrs r0, 30 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080A7486 - adds r0, r4, 0 - adds r0, 0x2C - ldrb r1, [r0] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0] - cmp r6, 0 - beq _080A742E - ldrb r3, [r4, 0x1] - lsrs r1, r3, 6 - ldrb r2, [r4, 0x3] - lsrs r2, 6 - lsls r3, 30 - lsrs r3, 30 - adds r0, r4, 0 - bl CalcVecFromObjectCenterToObjectUpperLeft -_080A742E: - ldr r6, =0xffff0000 - lsls r0, r7, 16 - orrs r5, r0 - str r5, [sp] - ldr r0, [sp, 0x4] - ands r0, r6 - mov r1, r8 - orrs r0, r1 - str r0, [sp, 0x4] - bl sub_80A7238 - lsls r0, 24 - cmp r0, 0 - beq _080A745C - mov r0, sp - ldrh r0, [r0] - negs r0, r0 - lsls r0, 16 - lsrs r0, 16 - ldr r1, [sp] - ands r1, r6 - orrs r1, r0 - str r1, [sp] -_080A745C: - ldrb r4, [r4, 0x3] - lsls r4, 26 - lsrs r4, 27 - add r5, sp, 0x8 - mov r0, sp - adds r1, r5, 0 - movs r2, 0x1 - movs r3, 0x2 - bl ObjAffineSet - ldr r0, =0x02021bc0 - lsls r4, 3 - adds r4, r0 - ldrh r0, [r5] - strh r0, [r4] - ldrh r0, [r5, 0x2] - strh r0, [r4, 0x2] - ldrh r0, [r5, 0x4] - strh r0, [r4, 0x4] - ldrh r0, [r5, 0x6] - strh r0, [r4, 0x6] -_080A7486: - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A73E0 - - thumb_func_start sub_80A749C -sub_80A749C: @ 80A749C - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - movs r3, 0x80 - lsls r3, 1 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r1, 0x1 - adds r2, r3, 0 - bl sub_80A73E0 - adds r2, r4, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - ldrb r3, [r4, 0x1] - lsrs r1, r3, 6 - ldrb r2, [r4, 0x3] - lsrs r2, 6 - lsls r3, 30 - lsrs r3, 30 - adds r0, r4, 0 - bl CalcVecFromObjectCenterToObjectUpperLeft - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A749C - - thumb_func_start sub_80A74DC -sub_80A74DC: @ 80A74DC - push {lr} - lsls r0, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - bl ArcTan2 - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_80A74DC - - thumb_func_start sub_80A74F4 -sub_80A74F4: @ 80A74F4 - push {lr} - lsls r0, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - bl sub_80A74DC - lsls r0, 16 - negs r0, r0 - lsrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_80A74F4 - - thumb_func_start sub_80A750C -sub_80A750C: @ 80A750C - push {r4-r7,lr} - lsls r1, 24 - lsls r0, 20 - lsrs r0, 16 - cmp r1, 0 - bne _080A7588 - ldr r2, =0x02037714 - ldr r1, =0x02037b14 - lsls r0, 1 - adds r4, r0, r1 - adds r5, r0, r2 - movs r6, 0xF -_080A7524: - ldr r0, [r5] - lsls r2, r0, 27 - lsrs r2, 27 - lsls r1, r0, 22 - lsrs r1, 27 - adds r2, r1 - lsls r0, 17 - lsrs r0, 27 - adds r0, r2 - movs r1, 0x3 - bl __udivsi3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1F - ands r0, r1 - ldrb r1, [r4] - movs r3, 0x20 - negs r3, r3 - adds r2, r3, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r4] - lsls r3, r0, 5 - ldrh r1, [r4] - ldr r7, =0xfffffc1f - adds r2, r7, 0 - ands r1, r2 - orrs r1, r3 - strh r1, [r4] - lsls r0, 2 - ldrb r1, [r4, 0x1] - movs r3, 0x7D - negs r3, r3 - adds r2, r3, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r4, 0x1] - adds r4, 0x2 - adds r5, 0x2 - subs r6, 0x1 - cmp r6, 0 - bge _080A7524 - b _080A7598 - .pool -_080A7588: - lsls r1, r0, 1 - ldr r0, =0x02037714 - adds r0, r1, r0 - ldr r2, =0x02037b14 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet -_080A7598: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A750C - - thumb_func_start sub_80A75AC -sub_80A75AC: @ 80A75AC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - ldr r4, [sp, 0x28] - ldr r5, [sp, 0x2C] - ldr r6, [sp, 0x30] - lsls r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r3, 24 - lsrs r3, 24 - mov r9, r3 - lsls r4, 24 - lsrs r4, 24 - mov r10, r4 - lsls r5, 24 - lsrs r5, 24 - str r5, [sp] - lsls r6, 24 - lsrs r6, 24 - str r6, [sp, 0x4] - movs r4, 0 - cmp r0, 0 - beq _080A7602 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A75F6 - movs r4, 0xE - b _080A7602 -_080A75F6: - bl sub_80A6D94 - lsls r0, 24 - lsrs r0, 24 - movs r4, 0x1 - lsls r4, r0 -_080A7602: - cmp r7, 0 - beq _080A7614 - ldr r0, =0x02038436 - ldrb r0, [r0] - adds r1, r0, 0 - adds r1, 0x10 - movs r0, 0x1 - lsls r0, r1 - orrs r4, r0 -_080A7614: - mov r0, r8 - cmp r0, 0 - beq _080A7628 - ldr r0, =0x02038437 - ldrb r0, [r0] - adds r1, r0, 0 - adds r1, 0x10 - movs r0, 0x1 - lsls r0, r1 - orrs r4, r0 -_080A7628: - mov r0, r9 - cmp r0, 0 - beq _080A764E - ldr r6, =0x02038436 - ldrb r0, [r6] - movs r5, 0x2 - eors r0, r5 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A764E - ldrb r0, [r6] - eors r0, r5 - adds r1, r0, 0 - adds r1, 0x10 - movs r0, 0x1 - lsls r0, r1 - orrs r4, r0 -_080A764E: - mov r0, r10 - cmp r0, 0 - beq _080A7674 - ldr r6, =0x02038437 - ldrb r0, [r6] - movs r5, 0x2 - eors r0, r5 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A7674 - ldrb r0, [r6] - eors r0, r5 - adds r1, r0, 0 - adds r1, 0x10 - movs r0, 0x1 - lsls r0, r1 - orrs r4, r0 -_080A7674: - ldr r0, [sp] - cmp r0, 0 - beq _080A769A - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A7694 - movs r0, 0x80 - lsls r0, 1 - b _080A7698 - .pool -_080A7694: - movs r0, 0x80 - lsls r0, 7 -_080A7698: - orrs r4, r0 -_080A769A: - ldr r0, [sp, 0x4] - cmp r0, 0 - beq _080A76B0 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A76B0 - movs r0, 0x80 - lsls r0, 2 - orrs r4, r0 -_080A76B0: - adds r0, r4, 0 - 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_80A75AC - - thumb_func_start sub_80A76C4 -sub_80A76C4: @ 80A76C4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r7, r2, 24 - lsls r3, 24 - lsrs r3, 24 - mov r8, r3 - movs r4, 0 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A76F2 - cmp r5, 0 - beq _080A77A0 - movs r4, 0x80 - lsls r4, 11 - b _080A77A0 -_080A76F2: - cmp r5, 0 - beq _080A771A - movs r0, 0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A771A - movs r0, 0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x10 - movs r4, 0x1 - lsls r4, r0 -_080A771A: - cmp r6, 0 - beq _080A7746 - movs r0, 0x2 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A7746 - movs r0, 0x2 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - adds r1, 0x10 - movs r0, 0x1 - lsls r0, r1 - orrs r4, r0 -_080A7746: - cmp r7, 0 - beq _080A7772 - movs r0, 0x1 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A7772 - movs r0, 0x1 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - adds r1, 0x10 - movs r0, 0x1 - lsls r0, r1 - orrs r4, r0 -_080A7772: - mov r0, r8 - cmp r0, 0 - beq _080A77A0 - movs r0, 0x3 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A77A0 - movs r0, 0x3 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - adds r1, 0x10 - movs r0, 0x1 - lsls r0, r1 - orrs r4, r0 -_080A77A0: - adds r0, r4, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80A76C4 - - thumb_func_start sub_80A77AC -sub_80A77AC: @ 80A77AC - lsls r0, 24 - lsrs r0, 24 - bx lr - thumb_func_end sub_80A77AC - - thumb_func_start sub_80A77B4 -sub_80A77B4: @ 80A77B4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_80A77B4 - - thumb_func_start sub_80A77C8 -sub_80A77C8: @ 80A77C8 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080A7806 - ldr r2, =0x0203841e - movs r3, 0x6 - ldrsh r0, [r2, r3] - movs r1, 0 - cmp r0, 0 - bne _080A77E2 - movs r1, 0x1 -_080A77E2: - movs r3, 0x4 - ldrsh r0, [r2, r3] - cmp r0, 0 - bne _080A77F8 - adds r0, r4, 0 - bl sub_80A69CC - b _080A77FE - .pool -_080A77F8: - adds r0, r4, 0 - bl sub_80A6980 -_080A77FE: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _080A781A -_080A7806: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x30 - ands r0, r1 - cmp r0, 0 - beq _080A781A - adds r0, r4, 0 - bl move_anim_8074EE0 -_080A781A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A77C8 - - thumb_func_start sub_80A7820 -sub_80A7820: @ 80A7820 - push {r4-r7,lr} - adds r5, r0, 0 - ldr r6, =0x0203841e - movs r1, 0xA - ldrsh r0, [r6, r1] - movs r1, 0xFF - lsls r1, 8 - ands r0, r1 - movs r1, 0 - cmp r0, 0 - bne _080A7838 - movs r1, 0x1 -_080A7838: - ldrb r0, [r6, 0xA] - movs r7, 0x1 - cmp r0, 0 - bne _080A7842 - movs r7, 0x3 -_080A7842: - adds r0, r5, 0 - bl sub_80A69CC - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080A785C - ldrh r0, [r6, 0x4] - negs r0, r0 - strh r0, [r6, 0x4] -_080A785C: - ldrh r0, [r6, 0x8] - strh r0, [r5, 0x2E] - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r6, 0x4] - adds r0, r1 - strh r0, [r5, 0x32] - ldrb r0, [r4] - adds r1, r7, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r6, [r6, 0x6] - adds r0, r6 - strh r0, [r5, 0x36] - ldr r0, =sub_80A6EEC - str r0, [r5, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r5, 0 - bl oamt_set_x3A_32 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A7820 - - thumb_func_start sub_80A78AC -sub_80A78AC: @ 80A78AC - push {r4-r6,lr} - adds r6, r0, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080A78CC - ldr r1, =0x0203841e - ldrh r0, [r1, 0x4] - negs r0, r0 - strh r0, [r1, 0x4] -_080A78CC: - ldr r4, =0x0203841e - ldrh r0, [r4, 0x8] - strh r0, [r6, 0x2E] - ldr r5, =0x02038437 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x4] - adds r0, r1 - strh r0, [r6, 0x32] - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x6] - adds r0, r1 - strh r0, [r6, 0x36] - ldrh r0, [r4, 0xA] - strh r0, [r6, 0x38] - adds r0, r6, 0 - bl sub_80A68D4 - ldr r0, =sub_80A791C - str r0, [r6, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A78AC - - thumb_func_start sub_80A791C -sub_80A791C: @ 80A791C - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - beq _080A7930 - adds r0, r4, 0 - bl move_anim_8072740 -_080A7930: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A791C - - thumb_func_start sub_80A7938 -sub_80A7938: @ 80A7938 - push {r4-r7,lr} - adds r5, r0, 0 - ldr r0, =0x0203841e - movs r2, 0xC - ldrsh r1, [r0, r2] - cmp r1, 0 - bne _080A7950 - movs r4, 0x1 - movs r7, 0x3 - b _080A7954 - .pool -_080A7950: - movs r4, 0 - movs r7, 0x1 -_080A7954: - movs r1, 0xA - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _080A796C - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_80A69CC - ldr r0, =0x02038436 - b _080A7976 - .pool -_080A796C: - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_80A6980 - ldr r0, =0x02038437 -_080A7976: - ldrb r6, [r0] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080A798E - ldr r1, =0x0203841e - ldrh r0, [r1, 0x4] - negs r0, r0 - strh r0, [r1, 0x4] -_080A798E: - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_80A6980 - ldr r4, =0x0203841e - ldrh r0, [r4, 0x8] - strh r0, [r5, 0x2E] - adds r0, r6, 0 - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r2, [r4, 0x4] - adds r0, r2 - strh r0, [r5, 0x32] - adds r0, r6, 0 - adds r1, r7, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r4, [r4, 0x6] - adds r0, r4 - strh r0, [r5, 0x36] - ldr r0, =sub_80A6EEC - str r0, [r5, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r5, 0 - bl oamt_set_x3A_32 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A7938 - - thumb_func_start duplicate_obj_of_side_rel2move_in_transparent_mode -duplicate_obj_of_side_rel2move_in_transparent_mode: @ 80A79E8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xFF - beq _080A7A52 - movs r6, 0 - ldr r2, =0x02020630 - lsls r0, r1, 4 - adds r0, r1 - lsls r1, r0, 2 -_080A7A04: - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - adds r4, r0, r2 - adds r5, r4, 0 - adds r5, 0x3E - ldrb r0, [r5] - lsls r0, 31 - cmp r0, 0 - bne _080A7A48 - adds r0, r4, 0 - adds r1, r2 - movs r2, 0x44 - bl memcpy - ldrb r1, [r4, 0x1] - movs r2, 0xD - negs r2, r2 - adds r0, r2, 0 - ands r1, r0 - movs r0, 0x4 - orrs r1, r0 - strb r1, [r4, 0x1] - ldrb r0, [r5] - adds r2, 0x8 - adds r1, r2, 0 - ands r0, r1 - strb r0, [r5] - lsls r0, r6, 16 - asrs r0, 16 - b _080A7A56 - .pool -_080A7A48: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x3F - bls _080A7A04 -_080A7A52: - movs r0, 0x1 - negs r0, r0 -_080A7A56: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end duplicate_obj_of_side_rel2move_in_transparent_mode - - thumb_func_start obj_delete_but_dont_free_vram -obj_delete_but_dont_free_vram: @ 80A7A5C - push {lr} - adds r3, r0, 0 - adds r3, 0x3F - ldrb r1, [r3] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r3] - bl RemoveObjectAndFreeTiles - pop {r0} - bx r0 - thumb_func_end obj_delete_but_dont_free_vram - - thumb_func_start sub_80A7A74 -sub_80A7A74: @ 80A7A74 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r6, 0 - movs r3, 0 - ldr r2, =0x0203841e - movs r0, 0x4 - ldrsh r1, [r2, r0] - movs r4, 0 - ldrsh r0, [r2, r4] - cmp r1, r0 - ble _080A7A8E - movs r3, 0x1 -_080A7A8E: - cmp r1, r0 - bge _080A7A94 - ldr r3, =0x0000ffff -_080A7A94: - movs r0, 0x6 - ldrsh r1, [r2, r0] - movs r4, 0x2 - ldrsh r0, [r2, r4] - cmp r1, r0 - ble _080A7AA2 - movs r6, 0x1 -_080A7AA2: - cmp r1, r0 - bge _080A7AA8 - ldr r6, =0x0000ffff -_080A7AA8: - ldr r0, =0x03005e00 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r0 - movs r1, 0 - strh r1, [r4, 0x8] - ldrh r0, [r2, 0x8] - strh r0, [r4, 0xA] - strh r1, [r4, 0xC] - ldrh r0, [r2] - strh r0, [r4, 0xE] - ldrh r0, [r2, 0x2] - strh r0, [r4, 0x10] - strh r3, [r4, 0x12] - strh r6, [r4, 0x14] - ldrh r0, [r2, 0x4] - strh r0, [r4, 0x16] - ldrh r0, [r2, 0x6] - strh r0, [r4, 0x18] - ldrh r1, [r2, 0x2] - lsls r1, 8 - ldrh r0, [r2] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - ldr r0, =sub_80A7AFC - str r0, [r4] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A7A74 - - thumb_func_start sub_80A7AFC -sub_80A7AFC: @ 80A7AFC - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - lsls r0, 16 - asrs r0, 16 - movs r2, 0xA - ldrsh r1, [r4, r2] - cmp r0, r1 - ble _080A7B90 - movs r0, 0 - strh r0, [r4, 0x8] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080A7B4C - ldrh r2, [r4, 0xE] - movs r3, 0xE - ldrsh r1, [r4, r3] - movs r3, 0x16 - ldrsh r0, [r4, r3] - cmp r1, r0 - beq _080A7B60 - ldrh r0, [r4, 0x12] - adds r0, r2, r0 - strh r0, [r4, 0xE] - b _080A7B60 - .pool -_080A7B4C: - ldrh r2, [r4, 0x10] - movs r0, 0x10 - ldrsh r1, [r4, r0] - movs r3, 0x18 - ldrsh r0, [r4, r3] - cmp r1, r0 - beq _080A7B60 - ldrh r0, [r4, 0x14] - adds r0, r2, r0 - strh r0, [r4, 0x10] -_080A7B60: - ldrh r1, [r4, 0x10] - lsls r1, 8 - ldrh r0, [r4, 0xE] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0xE - ldrsh r1, [r4, r0] - movs r2, 0x16 - ldrsh r0, [r4, r2] - cmp r1, r0 - bne _080A7B90 - movs r3, 0x10 - ldrsh r1, [r4, r3] - movs r2, 0x18 - ldrsh r0, [r4, r2] - cmp r1, r0 - bne _080A7B90 - adds r0, r5, 0 - bl move_anim_task_del -_080A7B90: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80A7AFC - - thumb_func_start sub_80A7B98 -sub_80A7B98: @ 80A7B98 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x0203841e - ldrb r0, [r0] - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0xFF - bne _080A7BBC - adds r0, r4, 0 - bl move_anim_task_del - b _080A7BE2 - .pool -_080A7BBC: - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r2, =0x02020630 - lsls r1, r3, 4 - adds r1, r3 - lsls r1, 2 - adds r1, r2 - ldrb r1, [r1, 0x5] - lsrs r1, 4 - lsls r1, 4 - ldr r3, =0x00000101 - adds r2, r3, 0 - adds r1, r2 - strh r1, [r0, 0x8] - bl sub_80A7BF4 -_080A7BE2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A7B98 - - thumb_func_start sub_80A7BF4 -sub_80A7BF4: @ 80A7BF4 - ldr r3, =0x0203841e - ldrh r1, [r3, 0x2] - movs r2, 0 - strh r1, [r0, 0xA] - strh r2, [r0, 0xC] - ldrh r1, [r3, 0x4] - strh r1, [r0, 0xE] - strh r2, [r0, 0x10] - ldrh r1, [r3, 0x6] - strh r1, [r0, 0x12] - strh r2, [r0, 0x14] - ldrh r1, [r3, 0x8] - strh r1, [r0, 0x16] - ldr r1, =sub_80A7C1C - str r1, [r0] - bx lr - .pool - thumb_func_end sub_80A7BF4 - - thumb_func_start sub_80A7C1C -sub_80A7C1C: @ 80A7C1C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - ldrh r0, [r4, 0x10] - adds r0, 0x1 - strh r0, [r4, 0x10] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x12 - ldrsh r1, [r4, r2] - cmp r0, r1 - blt _080A7CAC - movs r0, 0 - strh r0, [r4, 0x10] - movs r1, 0x14 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080A7C78 - ldrh r2, [r4, 0xC] - adds r2, 0x1 - strh r2, [r4, 0xC] - ldrh r0, [r4, 0x8] - lsls r2, 24 - lsrs r2, 24 - ldrh r3, [r4, 0xA] - movs r1, 0xF - bl pal_fade_1 - movs r2, 0xC - ldrsh r1, [r4, r2] - movs r2, 0xE - ldrsh r0, [r4, r2] - cmp r1, r0 - bne _080A7CAC - movs r0, 0x1 - strh r0, [r4, 0x14] - b _080A7CAC - .pool -_080A7C78: - ldrh r2, [r4, 0xC] - subs r2, 0x1 - strh r2, [r4, 0xC] - ldrh r0, [r4, 0x8] - lsls r2, 24 - lsrs r2, 24 - ldrh r3, [r4, 0xA] - movs r1, 0xF - bl pal_fade_1 - movs r0, 0xC - ldrsh r1, [r4, r0] - cmp r1, 0 - bne _080A7CAC - ldrh r0, [r4, 0x16] - subs r0, 0x1 - strh r0, [r4, 0x16] - lsls r0, 16 - cmp r0, 0 - beq _080A7CA6 - strh r1, [r4, 0x10] - strh r1, [r4, 0x14] - b _080A7CAC -_080A7CA6: - adds r0, r5, 0 - bl move_anim_task_del -_080A7CAC: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80A7C1C - - thumb_func_start sub_80A7CB4 -sub_80A7CB4: @ 80A7CB4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x0203841e - ldrh r0, [r0] - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - bne _080A7CD8 - adds r0, r4, 0 - bl move_anim_task_del - b _080A7CEE - .pool -_080A7CD8: - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - lsls r1, r2, 4 - ldr r2, =0x00000101 - adds r1, r2 - strh r1, [r0, 0x8] - bl sub_80A7BF4 -_080A7CEE: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A7CB4 - - thumb_func_start sub_80A7CFC -sub_80A7CFC: @ 80A7CFC - push {r4,lr} - adds r3, r0, 0 - adds r4, r1, 0 - lsls r4, 24 - lsrs r4, 24 - movs r1, 0 - strh r1, [r3, 0x16] - strh r1, [r3, 0x18] - strh r1, [r3, 0x1A] - strh r4, [r3, 0x26] - movs r0, 0x80 - lsls r0, 1 - strh r0, [r3, 0x1C] - strh r0, [r3, 0x1E] - strh r1, [r3, 0x20] - adds r0, r3, 0 - adds r0, 0x22 - adds r3, 0x24 - adds r1, r3, 0 - bl sub_80A8048 - adds r0, r4, 0 - movs r1, 0 - bl sub_80A7270 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A7CFC - - thumb_func_start sub_80A7D34 -sub_80A7D34: @ 80A7D34 - push {r4-r6,lr} - adds r4, r0, 0 - ldr r5, =0x02038444 - movs r1, 0x22 - ldrsh r0, [r4, r1] - movs r2, 0x24 - ldrsh r1, [r4, r2] - bl sub_80A8050 - movs r3, 0x16 - ldrsh r1, [r4, r3] - lsls r1, 3 - adds r1, r0, r1 - str r1, [r5] - movs r6, 0 - ldrsh r2, [r1, r6] - ldr r0, =0x00007ffe - cmp r2, r0 - beq _080A7DDC - cmp r2, r0 - bgt _080A7E3C - subs r0, 0x1 - cmp r2, r0 - beq _080A7DE2 - ldrb r0, [r1, 0x5] - cmp r0, 0 - bne _080A7D82 - ldrh r0, [r1] - strh r0, [r4, 0x1C] - ldrh r0, [r1, 0x2] - strh r0, [r4, 0x1E] - ldrb r0, [r1, 0x4] - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x16] - adds r0, 0x1 - strh r0, [r4, 0x16] - adds r0, r1, 0 - adds r0, 0x8 - str r0, [r5] -_080A7D82: - ldr r1, [r5] - ldrh r0, [r1] - ldrh r2, [r4, 0x1C] - adds r0, r2 - strh r0, [r4, 0x1C] - ldrh r0, [r1, 0x2] - ldrh r3, [r4, 0x1E] - adds r0, r3 - strh r0, [r4, 0x1E] - ldrh r0, [r4, 0x20] - ldrb r1, [r1, 0x4] - adds r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - movs r6, 0x1C - ldrsh r1, [r4, r6] - movs r3, 0x1E - ldrsh r2, [r4, r3] - ldrh r3, [r4, 0x20] - bl obj_id_set_rotscale - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl sub_80A7E6C - ldrh r0, [r4, 0x18] - adds r0, 0x1 - strh r0, [r4, 0x18] - lsls r0, 16 - asrs r0, 16 - ldr r1, [r5] - ldrb r1, [r1, 0x5] - cmp r0, r1 - blt _080A7E62 - movs r0, 0 - strh r0, [r4, 0x18] - b _080A7E34 - .pool -_080A7DDC: - ldrh r0, [r1, 0x2] - strh r0, [r4, 0x16] - b _080A7E62 -_080A7DE2: - ldrh r2, [r1, 0x2] - movs r6, 0x2 - ldrsh r0, [r1, r6] - cmp r0, 0 - beq _080A7E34 - ldrh r1, [r4, 0x1A] - movs r3, 0x1A - ldrsh r0, [r4, r3] - cmp r0, 0 - beq _080A7E02 - subs r0, r1, 0x1 - strh r0, [r4, 0x1A] - lsls r0, 16 - cmp r0, 0 - bne _080A7E04 - b _080A7E34 -_080A7E02: - strh r2, [r4, 0x1A] -_080A7E04: - movs r6, 0x16 - ldrsh r0, [r4, r6] - cmp r0, 0 - beq _080A7E62 - ldr r3, =0x02038444 - ldr r5, =0x00007ffd -_080A7E10: - ldrh r2, [r4, 0x16] - subs r1, r2, 0x1 - strh r1, [r4, 0x16] - ldr r0, [r3] - subs r0, 0x8 - str r0, [r3] - movs r6, 0 - ldrsh r0, [r0, r6] - cmp r0, r5 - beq _080A7E60 - lsls r0, r1, 16 - cmp r0, 0 - bne _080A7E10 - b _080A7E62 - .pool -_080A7E34: - ldrh r0, [r4, 0x16] - adds r0, 0x1 - strh r0, [r4, 0x16] - b _080A7E62 -_080A7E3C: - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strh r1, [r0, 0x26] - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl sub_80A7344 - movs r0, 0 - b _080A7E64 - .pool -_080A7E60: - strh r2, [r4, 0x16] -_080A7E62: - movs r0, 0x1 -_080A7E64: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80A7D34 - - thumb_func_start sub_80A7E6C -sub_80A7E6C: @ 80A7E6C - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl sub_80A7F18 - lsls r0, 16 - lsrs r0, 15 - movs r1, 0x40 - subs r5, r1, r0 - ldr r1, =0x02020630 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r4, r0, r1 - ldrb r1, [r4, 0x3] - lsls r1, 26 - lsrs r1, 27 - lsls r0, r5, 8 - ldr r2, =0x02021bc0 - lsls r1, 3 - adds r1, r2 - movs r2, 0x6 - ldrsh r1, [r1, r2] - bl __divsi3 - cmp r0, 0x80 - ble _080A7EA8 - movs r0, 0x80 -_080A7EA8: - subs r0, r5, r0 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - strh r0, [r4, 0x26] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A7E6C - - thumb_func_start sub_80A7EC0 -sub_80A7EC0: @ 80A7EC0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r0, r1, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r0, 24 - lsrs r0, 24 - bl sub_80A7F18 - lsls r0, 16 - lsrs r0, 15 - movs r1, 0x40 - subs r5, r1, r0 - ldr r1, =0x02020630 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r4, r0, r1 - ldrb r1, [r4, 0x3] - lsls r1, 26 - lsrs r1, 27 - lsls r0, r5, 8 - ldr r2, =0x02021bc0 - lsls r1, 3 - adds r1, r2 - movs r2, 0x6 - ldrsh r1, [r1, r2] - bl __divsi3 - cmp r0, 0x80 - ble _080A7F00 - movs r0, 0x80 -_080A7F00: - subs r0, r5, r0 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - strh r0, [r4, 0x26] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A7EC0 - - thumb_func_start sub_80A7F18 -sub_80A7F18: @ 80A7F18 - push {r4-r7,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0, 0x2E] - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - ldr r1, =0x020241e4 - ldr r7, =0x00000181 - ldr r0, =0x020244e4 - adds r6, r5, r0 -_080A7F38: - adds r0, r4, r1 - ldrb r0, [r0] - cmp r0, r2 - beq _080A7F42 - b _080A8034 -_080A7F42: - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A7F78 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x18] - ldrh r2, [r0] - ldr r1, =gUnknown_083021D8 - lsls r0, r2, 2 - adds r0, r1 - ldrb r0, [r0, 0x1] - b _080A8042 - .pool -_080A7F78: - lsls r0, r4, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _080A7FD8 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0] - lsls r0, r5, 2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2] - cmp r0, 0 - bne _080A7FC0 - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r2, r0, 16 - b _080A7FC2 - .pool -_080A7FC0: - ldrh r2, [r1, 0x2] -_080A7FC2: - cmp r2, r7 - bne _080A7FD0 - ldr r0, =gUnknown_08525F8C - b _080A8018 - .pool -_080A7FD0: - ldr r0, =gUnknown_083021D8 - b _080A8026 - .pool -_080A7FD8: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0] - lsls r0, r5, 2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2] - cmp r0, 0 - bne _080A8010 - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r2, r0, 16 - b _080A8012 - .pool -_080A8010: - ldrh r2, [r1, 0x2] -_080A8012: - cmp r2, r7 - bne _080A8024 - ldr r0, =gUnknown_08525F88 -_080A8018: - ldrb r1, [r6] - adds r1, r0 - ldrb r0, [r1] - b _080A8042 - .pool -_080A8024: - ldr r0, =gUnknown_08300D38 -_080A8026: - lsls r1, r2, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - b _080A8042 - .pool -_080A8034: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x3 - bhi _080A8040 - b _080A7F38 -_080A8040: - movs r0, 0x40 -_080A8042: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80A7F18 - - thumb_func_start sub_80A8048 -sub_80A8048: @ 80A8048 - strh r2, [r0] - asrs r2, 16 - strh r2, [r1] - bx lr - thumb_func_end sub_80A8048 - - thumb_func_start sub_80A8050 -sub_80A8050: @ 80A8050 - lsls r0, 16 - lsrs r0, 16 - lsls r1, 16 - orrs r0, r1 - bx lr - thumb_func_end sub_80A8050 - - thumb_func_start sub_80A805C -sub_80A805C: @ 80A805C - push {r4-r6,lr} - mov r6, r8 - push {r6} - mov r8, r0 - adds r5, r3, 0 - ldr r0, [sp, 0x14] - ldr r4, [sp, 0x18] - ldr r6, [sp, 0x1C] - lsls r1, 24 - lsrs r1, 24 - lsls r2, 16 - lsrs r2, 16 - lsls r5, 16 - lsrs r5, 16 - lsls r0, 16 - lsrs r0, 16 - lsls r4, 16 - lsrs r4, 16 - lsls r6, 16 - lsrs r6, 16 - mov r3, r8 - strh r6, [r3, 0x18] - strh r1, [r3, 0x26] - strh r2, [r3, 0x1A] - strh r5, [r3, 0x1C] - strh r0, [r3, 0x22] - strh r4, [r3, 0x24] - lsls r0, 16 - asrs r0, 16 - lsls r2, 16 - asrs r2, 16 - subs r0, r2 - adds r1, r6, 0 - bl __divsi3 - mov r1, r8 - strh r0, [r1, 0x1E] - lsls r4, 16 - asrs r4, 16 - lsls r5, 16 - asrs r5, 16 - subs r4, r5 - adds r0, r4, 0 - adds r1, r6, 0 - bl __divsi3 - mov r3, r8 - strh r0, [r3, 0x20] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80A805C - - thumb_func_start sub_80A80C8 -sub_80A80C8: @ 80A80C8 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x18] - movs r2, 0x18 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _080A80DA - movs r0, 0 - b _080A8136 -_080A80DA: - subs r0, r1, 0x1 - strh r0, [r4, 0x18] - lsls r0, 16 - cmp r0, 0 - beq _080A80F4 - ldrh r0, [r4, 0x1E] - ldrh r3, [r4, 0x1A] - adds r0, r3 - strh r0, [r4, 0x1A] - ldrh r0, [r4, 0x20] - ldrh r1, [r4, 0x1C] - adds r0, r1 - b _080A80FA -_080A80F4: - ldrh r0, [r4, 0x22] - strh r0, [r4, 0x1A] - ldrh r0, [r4, 0x24] -_080A80FA: - strh r0, [r4, 0x1C] - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x1A - ldrsh r1, [r4, r2] - movs r3, 0x1C - ldrsh r2, [r4, r3] - movs r3, 0 - bl obj_id_set_rotscale - movs r0, 0x18 - ldrsh r3, [r4, r0] - cmp r3, 0 - beq _080A8124 - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl sub_80A7E6C - b _080A8134 -_080A8124: - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r3, [r0, 0x26] -_080A8134: - ldrb r0, [r4, 0x18] -_080A8136: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A80C8 - - thumb_func_start sub_80A8140 -sub_80A8140: @ 80A8140 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x0203841a - ldrb r0, [r0] - movs r1, 0 - cmp r0, 0x1E - bls _080A815E - movs r1, 0x1 - cmp r0, 0x64 - bls _080A815E - movs r1, 0x3 - cmp r0, 0xC8 - bhi _080A815E - movs r1, 0x2 -_080A815E: - ldr r0, =0x0203841e - strh r1, [r0, 0xE] - adds r0, r2, 0 - bl move_anim_task_del - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A8140 - - thumb_func_start sub_80A8174 -sub_80A8174: @ 80A8174 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r4, r0, 24 - adds r7, r4, 0 - ldr r6, =0x02038437 - ldrb r0, [r6] - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A81B4 - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldrb r0, [r6] - adds r0, r1 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x3 - adds r2, r4, 0 - ands r2, r0 - lsls r2, 2 - ldrb r3, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0x5] -_080A81B4: - ldr r0, =0x02038436 - mov r8, r0 - ldrb r0, [r0] - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A81EC - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - mov r3, r8 - ldrb r0, [r3] - adds r0, r1 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x3 - adds r2, r4, 0 - ands r2, r0 - lsls r2, 2 - ldrb r3, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0x5] -_080A81EC: - ldrb r0, [r6] - movs r5, 0x2 - eors r0, r5 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A8224 - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldrb r0, [r6] - eors r0, r5 - adds r0, r1 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x3 - adds r2, r4, 0 - ands r2, r0 - lsls r2, 2 - ldrb r3, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0x5] -_080A8224: - mov r1, r8 - ldrb r0, [r1] - eors r0, r5 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A825C - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - mov r3, r8 - ldrb r0, [r3] - eors r0, r5 - adds r0, r1 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x3 - ands r7, r0 - lsls r3, r7, 2 - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x5] -_080A825C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A8174 - - thumb_func_start sub_80A8278 -sub_80A8278: @ 80A8278 - push {r4-r6,lr} - movs r5, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r5, r0 - bge _080A82D2 - ldr r6, =0x02020630 -_080A8286: - lsls r0, r5, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A82C8 - adds r0, r4, 0 - bl sub_80A82E4 - ldr r3, =0x020241e4 - adds r3, r5, r3 - ldrb r2, [r3] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r6 - adds r1, 0x43 - strb r0, [r1] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r2, [r0, 0x5] - movs r3, 0xD - negs r3, r3 - adds r1, r3, 0 - ands r2, r1 - movs r1, 0x8 - orrs r2, r1 - strb r2, [r0, 0x5] -_080A82C8: - adds r5, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r5, r0 - blt _080A8286 -_080A82D2: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A8278 - - thumb_func_start sub_80A82E4 -sub_80A82E4: @ 80A82E4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A8300 - cmp r4, 0x2 - bne _080A82FC - movs r0, 0x1E - b _080A8320 -_080A82FC: - movs r0, 0x28 - b _080A8320 -_080A8300: - adds r0, r4, 0 - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1E - cmp r0, 0 - beq _080A831E - movs r1, 0x14 - cmp r0, 0x2 - beq _080A831E - movs r1, 0x32 - cmp r0, 0x1 - bne _080A831E - movs r1, 0x28 -_080A831E: - adds r0, r1, 0 -_080A8320: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80A82E4 - - thumb_func_start sub_80A8328 -sub_80A8328: @ 80A8328 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - bl battle_get_per_side_status - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A8344 - movs r0, 0x2 - b _080A835C -_080A8344: - cmp r4, 0 - beq _080A834C - cmp r4, 0x3 - bne _080A8350 -_080A834C: - movs r0, 0x2 - b _080A8352 -_080A8350: - movs r0, 0x1 -_080A8352: - movs r1, 0x4 - bl sub_8118140 - lsls r0, 24 - lsrs r0, 24 -_080A835C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80A8328 - - thumb_func_start battle_get_per_side_status_permutated -battle_get_per_side_status_permutated: @ 80A8364 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A838A - adds r0, r4, 0 - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _080A8386 - cmp r0, 0x3 - bne _080A838A -_080A8386: - movs r0, 0x2 - b _080A838C -_080A838A: - movs r0, 0x1 -_080A838C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end battle_get_per_side_status_permutated - - thumb_func_start sub_80A8394 -sub_80A8394: @ 80A8394 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - ldr r4, [sp, 0x30] - ldr r5, [sp, 0x34] - ldr r6, [sp, 0x38] - mov r8, r6 - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - lsls r2, 24 - lsrs r7, r2, 24 - lsls r3, 16 - lsrs r3, 16 - mov r10, r3 - lsls r4, 16 - lsrs r4, 16 - str r4, [sp, 0x4] - lsls r5, 24 - lsrs r5, 24 - str r5, [sp, 0x8] - lsls r0, r7, 3 - ldr r1, =gUnknown_08525FC0 - adds r0, r1 - bl LoadObjectPic - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0xC] - ldr r1, =gUnknown_08525F90 - lsls r0, r7, 1 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldrh r0, [r0, 0x2] - bl AllocObjectPalette - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =0x020244d4 - ldr r0, [r4] - cmp r0, 0 - beq _080A8412 - movs r1, 0xBE - lsls r1, 1 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - bne _080A8412 - movs r0, 0x80 - lsls r0, 6 - bl AllocZeroed - ldr r1, [r4] - movs r2, 0xBE - lsls r2, 1 - adds r1, r2 - str r0, [r1] -_080A8412: - mov r3, r9 - cmp r3, 0 - bne _080A84B0 - adds r0, r6, 0 - ldr r1, [sp, 0x3C] - mov r2, r8 - bl species_and_otid_get_pal - lsls r1, r5, 20 - movs r2, 0x80 - lsls r2, 17 - adds r1, r2 - lsrs r1, 16 - movs r2, 0x20 - bl decompress_palette - ldr r3, [sp, 0x44] - cmp r3, 0x1 - beq _080A845E - ldr r0, [sp, 0x40] - lsls r1, r0, 24 - lsrs r1, 24 - movs r0, 0x5 - bl sub_80688F8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080A845E - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0] - ldr r2, [sp, 0x40] - lsls r0, r2, 2 - adds r0, r1 - ldrh r0, [r0, 0x2] - cmp r0, 0 - beq _080A8488 -_080A845E: - lsls r0, r6, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r1, [r1] - movs r3, 0xBE - lsls r3, 1 - adds r1, r3 - ldr r1, [r1] - movs r2, 0x1 - b _080A850A - .pool -_080A8488: - lsls r0, r6, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r1, [r1] - movs r2, 0xBE - lsls r2, 1 - adds r1, r2 - ldr r1, [r1] - movs r2, 0x1 - str r2, [sp] - adds r2, r6, 0 - mov r3, r8 - bl DecompressMonPic_2 - b _080A8540 - .pool -_080A84B0: - adds r0, r6, 0 - ldr r1, [sp, 0x3C] - mov r2, r8 - bl species_and_otid_get_pal - lsls r1, r5, 20 - movs r3, 0x80 - lsls r3, 17 - adds r1, r3 - lsrs r1, 16 - movs r2, 0x20 - bl decompress_palette - ldr r0, [sp, 0x44] - cmp r0, 0x1 - beq _080A84F6 - ldr r2, [sp, 0x40] - lsls r1, r2, 24 - lsrs r1, 24 - movs r0, 0x5 - bl sub_80688F8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080A84F6 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0] - ldr r3, [sp, 0x40] - lsls r0, r3, 2 - adds r0, r1 - ldrh r2, [r0, 0x2] - cmp r2, 0 - beq _080A8524 -_080A84F6: - lsls r0, r6, 3 - ldr r1, =gMonBackPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r1, [r1] - movs r2, 0xBE - lsls r2, 1 - adds r1, r2 - ldr r1, [r1] - movs r2, 0 -_080A850A: - str r2, [sp] - adds r2, r6, 0 - mov r3, r8 - bl DecompressMonPicWithoutDuplicatingDeoxysTiles - b _080A8540 - .pool -_080A8524: - lsls r0, r6, 3 - ldr r1, =gMonBackPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r1, [r1] - movs r3, 0xBE - lsls r3, 1 - adds r1, r3 - ldr r1, [r1] - str r2, [sp] - adds r2, r6, 0 - mov r3, r8 - bl DecompressMonPic_2 -_080A8540: - ldr r5, =0x020244d4 - ldr r0, [r5] - movs r4, 0xBE - lsls r4, 1 - adds r0, r4 - ldr r0, [r0] - ldr r2, [sp, 0xC] - lsls r1, r2, 5 - ldr r3, =0x06010000 - adds r1, r3 - movs r2, 0x80 - lsls r2, 4 - movs r3, 0x1 - bl RequestDma3Copy - ldr r0, [r5] - adds r0, r4 - ldr r0, [r0] - bl Free - ldr r0, [r5] - adds r0, r4 - movs r1, 0 - str r1, [r0] - mov r0, r9 - cmp r0, 0 - bne _080A85A0 - lsls r0, r7, 1 - adds r0, r7 - lsls r0, 3 - ldr r1, =gUnknown_08525F90 - adds r0, r1 - mov r2, r10 - lsls r1, r2, 16 - asrs r1, 16 - ldr r3, =gUnknown_08300D38 - b _080A85B2 - .pool -_080A85A0: - lsls r0, r7, 1 - adds r0, r7 - lsls r0, 3 - ldr r1, =gUnknown_08525F90 - adds r0, r1 - mov r2, r10 - lsls r1, r2, 16 - asrs r1, 16 - ldr r3, =gUnknown_083021D8 -_080A85B2: - lsls r2, r6, 2 - adds r2, r3 - ldrb r2, [r2, 0x1] - ldr r3, [sp, 0x4] - adds r2, r3 - lsls r2, 16 - asrs r2, 16 - ldr r3, [sp, 0x8] - bl AddObjectToFront - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A85EE - ldr r3, =0x02020630 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r1, r3, 0 - adds r1, 0x10 - adds r1, r0, r1 - ldr r2, =gUnknown_082FF6C0 - str r2, [r1] - adds r0, r3 - movs r1, 0 - bl StartObjectRotScalAnim -_080A85EE: - adds r0, r4, 0 - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A8394 - - thumb_func_start sub_80A8610 -sub_80A8610: @ 80A8610 - push {lr} - bl RemoveObjectAndFreeResources - pop {r0} - bx r0 - thumb_func_end sub_80A8610 - - thumb_func_start sub_80A861C -sub_80A861C: @ 80A861C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A86C4 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0, 0x18] - ldrb r1, [r2, 0x4] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080A8654 - ldrh r7, [r2, 0x2] - ldr r2, [r2, 0x10] - b _080A8658 - .pool -_080A8654: - ldrh r7, [r2] - ldr r2, [r2, 0x8] -_080A8658: - cmp r7, 0xC9 - bne _080A86A4 - movs r0, 0xC0 - lsls r0, 18 - ands r0, r2 - lsrs r0, 18 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r2 - lsrs r1, 12 - orrs r0, r1 - movs r1, 0xC0 - lsls r1, 2 - ands r1, r2 - lsrs r1, 6 - orrs r0, r1 - movs r1, 0x3 - ands r1, r2 - orrs r0, r1 - movs r1, 0x1C - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _080A8690 - movs r0, 0xC9 - b _080A869A -_080A8690: - movs r1, 0xCE - lsls r1, 1 - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 -_080A869A: - lsls r1, r0, 2 - ldr r0, =gUnknown_083021D8 - b _080A8864 - .pool -_080A86A4: - ldr r0, =0x00000181 - cmp r7, r0 - bne _080A86AC - b _080A8834 -_080A86AC: - movs r0, 0xCE - lsls r0, 1 - cmp r7, r0 - bhi _080A877C - lsls r1, r7, 2 - ldr r0, =gUnknown_083021D8 - b _080A8864 - .pool -_080A86C4: - mov r0, r8 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _080A8790 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0] - mov r1, r8 - lsls r2, r1, 2 - adds r1, r2, r0 - ldrh r0, [r1, 0x2] - cmp r0, 0 - bne _080A871C - ldr r0, =0x0202406e - mov r1, r8 - lsls r4, r1, 1 - adds r4, r0 - ldrh r0, [r4] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x020244ec - adds r0, r5 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r7, r0, 16 - ldrh r0, [r4] - muls r0, r6 - adds r0, r5 - movs r1, 0 - bl pokemon_getattr - adds r2, r0, 0 - b _080A8724 - .pool -_080A871C: - ldrh r7, [r1, 0x2] - ldr r0, =0x020244bc - adds r0, r2, r0 - ldr r2, [r0] -_080A8724: - cmp r7, 0xC9 - bne _080A8774 - movs r0, 0xC0 - lsls r0, 18 - ands r0, r2 - lsrs r0, 18 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r2 - lsrs r1, 12 - orrs r0, r1 - movs r1, 0xC0 - lsls r1, 2 - ands r1, r2 - lsrs r1, 6 - orrs r0, r1 - movs r1, 0x3 - ands r1, r2 - orrs r0, r1 - movs r1, 0x1C - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _080A8760 - movs r0, 0xC9 - b _080A876A - .pool -_080A8760: - movs r1, 0xCE - lsls r1, 1 - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 -_080A876A: - lsls r1, r0, 2 - ldr r0, =gUnknown_083021D8 - b _080A8864 - .pool -_080A8774: - movs r0, 0xCE - lsls r0, 1 - cmp r7, r0 - bls _080A8784 -_080A877C: - ldr r4, =gUnknown_083021D8 - b _080A8866 - .pool -_080A8784: - lsls r1, r7, 2 - ldr r0, =gUnknown_083021D8 - b _080A8864 - .pool -_080A8790: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0] - mov r1, r8 - lsls r2, r1, 2 - adds r1, r2, r0 - ldrh r0, [r1, 0x2] - cmp r0, 0 - bne _080A87DC - ldr r0, =0x0202406e - mov r1, r8 - lsls r4, r1, 1 - adds r4, r0 - ldrh r0, [r4] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x02024744 - adds r0, r5 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r7, r0, 16 - ldrh r0, [r4] - muls r0, r6 - adds r0, r5 - movs r1, 0 - bl pokemon_getattr - adds r2, r0, 0 - b _080A87E4 - .pool -_080A87DC: - ldrh r7, [r1, 0x2] - ldr r0, =0x020244bc - adds r0, r2, r0 - ldr r2, [r0] -_080A87E4: - cmp r7, 0xC9 - bne _080A882E - movs r0, 0xC0 - lsls r0, 18 - ands r0, r2 - lsrs r0, 18 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r2 - lsrs r1, 12 - orrs r0, r1 - movs r1, 0xC0 - lsls r1, 2 - ands r1, r2 - lsrs r1, 6 - orrs r0, r1 - movs r1, 0x3 - ands r1, r2 - orrs r0, r1 - movs r1, 0x1C - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _080A8820 - movs r0, 0xC9 - b _080A882A - .pool -_080A8820: - movs r1, 0xCE - lsls r1, 1 - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 -_080A882A: - lsls r1, r0, 2 - b _080A8862 -_080A882E: - ldr r0, =0x00000181 - cmp r7, r0 - bne _080A8850 -_080A8834: - ldr r0, =0x020244e4 - add r0, r8 - ldrb r0, [r0] - lsls r0, 2 - ldr r1, =gUnknown_08525F78 - adds r4, r0, r1 - b _080A8866 - .pool -_080A8850: - movs r0, 0xCE - lsls r0, 1 - cmp r7, r0 - bls _080A8860 - ldr r4, =gUnknown_08300D38 - b _080A8866 - .pool -_080A8860: - lsls r1, r7, 2 -_080A8862: - ldr r0, =gUnknown_08300D38 -_080A8864: - adds r4, r1, r0 -_080A8866: - mov r0, r9 - cmp r0, 0x6 - bhi _080A8916 - lsls r0, 2 - ldr r1, =_080A8880 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080A8880: - .4byte _080A889C - .4byte _080A88A6 - .4byte _080A88D2 - .4byte _080A88EA - .4byte _080A88AE - .4byte _080A88C0 - .4byte _080A8902 -_080A889C: - ldrb r1, [r4] - movs r0, 0xF - ands r0, r1 - lsls r0, 3 - b _080A8918 -_080A88A6: - ldrb r0, [r4] - lsrs r0, 4 - lsls r0, 3 - b _080A8918 -_080A88AE: - mov r0, r8 - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r4] - lsrs r1, 4 - b _080A88E4 -_080A88C0: - mov r0, r8 - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r4] - lsrs r1, 4 - b _080A88FC -_080A88D2: - mov r0, r8 - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrb r2, [r4] - movs r1, 0xF - ands r1, r2 -_080A88E4: - lsls r1, 2 - subs r0, r1 - b _080A8918 -_080A88EA: - mov r0, r8 - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrb r2, [r4] - movs r1, 0xF - ands r1, r2 -_080A88FC: - lsls r1, 2 - adds r0, r1 - b _080A8918 -_080A8902: - mov r0, r8 - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x1F - ldrb r1, [r4, 0x1] - subs r0, r1 - b _080A8918 -_080A8916: - movs r0, 0 -_080A8918: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80A861C - - thumb_func_start sub_80A8924 -sub_80A8924: @ 80A8924 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r9, r2 - mov r10, r3 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - cmp r1, 0 - bne _080A8942 - movs r5, 0 - movs r6, 0x1 - b _080A8946 -_080A8942: - movs r5, 0x2 - movs r6, 0x3 -_080A8946: - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - adds r0, r4, 0 - adds r1, r6, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r7, r0, 24 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _080A8998 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A8998 - movs r0, 0x2 - eors r4, r0 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r4, 0 - adds r1, r6, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r3, r0, 24 - mov r0, r8 - lsls r1, r0, 16 - lsls r2, r7, 16 - b _080A89A4 -_080A8998: - mov r0, r8 - lsls r1, r0, 16 - lsrs r5, r1, 16 - lsls r0, r7, 16 - lsrs r3, r0, 16 - adds r2, r0, 0 -_080A89A4: - asrs r0, r1, 16 - adds r0, r5 - asrs r0, 1 - mov r1, r9 - strh r0, [r1] - asrs r0, r2, 16 - adds r0, r3 - asrs r0, 1 - mov r1, r10 - strh r0, [r1] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80A8924 - - thumb_func_start sub_80A89C8 -sub_80A89C8: @ 80A89C8 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - sub sp, 0x4 - lsls r6, r1, 24 - lsrs r6, 24 - ldr r0, =DummyObjectCallback - mov r10, r0 - bl object_new_hidden_with_callback - mov r8, r0 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r0, =0x02020630 - mov r9, r0 - mov r0, r8 - lsls r3, r0, 4 - add r3, r8 - lsls r3, 2 - mov r0, r9 - adds r5, r3, r0 - lsls r4, r6, 4 - adds r4, r6 - lsls r4, 2 - add r4, r9 - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x44 - str r3, [sp] - bl memcpy - adds r2, r5, 0 - adds r2, 0x3F - ldrb r0, [r2] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - ldrb r2, [r5, 0x5] - movs r1, 0xD - negs r1, r1 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r5, 0x5] - ldrb r0, [r5, 0x1] - ands r1, r0 - movs r0, 0x8 - orrs r1, r0 - strb r1, [r5, 0x1] - ldrh r1, [r4, 0x4] - lsls r1, 22 - lsrs r1, 22 - ldrh r2, [r5, 0x4] - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r5, 0x4] - movs r0, 0x1C - add r9, r0 - ldr r3, [sp] - add r3, r9 - mov r0, r10 - str r0, [r3] - mov r0, r8 - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A89C8 - - thumb_func_start sub_80A8A6C -sub_80A8A6C: @ 80A8A6C - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6838 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080A8AAC - ldr r2, =0x0203841e - ldrh r0, [r4, 0x20] - ldrh r1, [r2] - subs r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r2, 0x6] - negs r0, r0 - strh r0, [r2, 0x6] - adds r3, r4, 0 - adds r3, 0x3F - ldrb r0, [r3] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r3] - adds r1, r2, 0 - b _080A8AB6 - .pool -_080A8AAC: - ldr r1, =0x0203841e - ldrh r0, [r1] - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r4, 0x20] -_080A8AB6: - ldrh r0, [r1, 0x2] - ldrh r2, [r4, 0x22] - adds r0, r2 - strh r0, [r4, 0x22] - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x2E] - ldrh r0, [r1, 0x6] - strh r0, [r4, 0x30] - ldrh r0, [r1, 0x8] - strh r0, [r4, 0x34] - ldrh r0, [r1, 0xA] - strh r0, [r4, 0x38] - ldr r1, =move_anim_8074EE0 - adds r0, r4, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A66DC - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A8A6C - - thumb_func_start sub_80A8AEC -sub_80A8AEC: @ 80A8AEC - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080A8B1C - ldr r2, =0x0203841e - ldrh r0, [r4, 0x20] - ldrh r1, [r2] - subs r0, r1 - strh r0, [r4, 0x20] - movs r1, 0x6 - ldrsh r0, [r2, r1] - negs r0, r0 - strh r0, [r2, 0x6] - adds r1, r2, 0 - b _080A8B26 - .pool -_080A8B1C: - ldr r1, =0x0203841e - ldrh r0, [r1] - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r4, 0x20] -_080A8B26: - ldrh r0, [r1, 0x2] - ldrh r2, [r4, 0x22] - adds r0, r2 - strh r0, [r4, 0x22] - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x2E] - ldrh r0, [r1, 0x6] - strh r0, [r4, 0x30] - ldrh r0, [r1, 0x8] - strh r0, [r4, 0x34] - ldrh r0, [r1, 0xA] - strh r0, [r4, 0x38] - ldrb r1, [r1, 0xC] - adds r0, r4, 0 - bl StartObjectImageAnim - ldr r1, =move_anim_8074EE0 - adds r0, r4, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A66DC - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A8AEC - - thumb_func_start sub_80A8B64 -sub_80A8B64: @ 80A8B64 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6838 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080A8B90 - ldr r0, =0x0203841e - ldrh r1, [r4, 0x20] - ldrh r2, [r0] - subs r1, r2 - strh r1, [r4, 0x20] - b _080A8B9C - .pool -_080A8B90: - ldr r1, =0x0203841e - ldrh r0, [r1] - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r4, 0x20] - adds r0, r1, 0 -_080A8B9C: - ldrh r0, [r0, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldr r0, =sub_80A67D8 - str r0, [r4, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r4, 0 - bl oamt_set_x3A_32 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A8B64 - - thumb_func_start sub_80A8BC4 -sub_80A8BC4: @ 80A8BC4 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r5, r1, r0 - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - movs r6, 0 - strh r0, [r5, 0x8] - ldr r7, =0x02038436 - ldrb r0, [r7] - bl battle_side_get_owner - lsls r0, 24 - movs r1, 0x8 - cmp r0, 0 - beq _080A8BF8 - movs r0, 0x8 - negs r0, r0 - adds r1, r0, 0 -_080A8BF8: - strh r1, [r5, 0xA] - strh r6, [r5, 0xC] - strh r6, [r5, 0xE] - ldr r4, =0x02020630 - movs r0, 0x8 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x24] - ldrh r2, [r5, 0x8] - subs r1, r2 - strh r1, [r0, 0x24] - ldr r0, =0x00002771 - bl AllocObjectPalette - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x10] - strh r6, [r5, 0x12] - movs r1, 0x10 - ldrsh r0, [r5, r1] - adds r0, 0x10 - lsls r0, 20 - lsrs r6, r0, 16 - movs r0, 0x8 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x5] - lsrs r0, 4 - adds r0, 0x10 - lsls r4, r0, 4 - ldrb r0, [r7] - bl sub_80A82E4 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x14] - cmp r0, 0x14 - beq _080A8C54 - cmp r0, 0x28 - bne _080A8C68 -_080A8C54: - movs r0, 0x2 - b _080A8C6A - .pool -_080A8C68: - movs r0, 0x3 -_080A8C6A: - strh r0, [r5, 0x14] - lsls r0, r4, 1 - ldr r1, =0x02037714 - adds r0, r1 - lsls r1, r6, 1 - ldr r2, =0x02037b14 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet - ldr r0, =0x0203841e - ldrb r2, [r0, 0x2] - ldrh r3, [r0] - adds r0, r6, 0 - movs r1, 0x10 - bl pal_fade_1 - ldr r0, =sub_80A8CAC - str r0, [r5] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A8BC4 - - thumb_func_start sub_80A8CAC -sub_80A8CAC: @ 80A8CAC - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080A8D10 - cmp r0, 0x1 - bgt _080A8CD4 - cmp r0, 0 - beq _080A8CDA - b _080A8D6C - .pool -_080A8CD4: - cmp r0, 0x2 - beq _080A8D58 - b _080A8D6C -_080A8CDA: - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80A8D78 - ldr r2, =0x02020630 - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r4, 0xA] - ldrh r2, [r0, 0x24] - adds r1, r2 - strh r1, [r0, 0x24] - ldrh r1, [r4, 0xE] - adds r0, r1, 0x1 - strh r0, [r4, 0xE] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - bne _080A8D6C - strh r1, [r4, 0xE] - b _080A8D4A - .pool -_080A8D10: - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80A8D78 - ldr r3, =0x02020630 - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x24] - ldrh r2, [r4, 0xA] - subs r1, r2 - strh r1, [r0, 0x24] - ldrh r0, [r4, 0xE] - subs r0, 0x1 - strh r0, [r4, 0xE] - lsls r0, 16 - asrs r2, r0, 16 - cmp r2, 0 - bne _080A8D6C - movs r1, 0x8 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - strh r2, [r1, 0x24] -_080A8D4A: - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - b _080A8D6C - .pool -_080A8D58: - movs r2, 0x12 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _080A8D6C - ldr r0, =0x00002771 - bl FreeObjectPaletteByTag - adds r0, r5, 0 - bl move_anim_task_del -_080A8D6C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A8CAC - - thumb_func_start sub_80A8D78 -sub_80A8D78: @ 80A8D78 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - movs r0, 0 - bl duplicate_obj_of_side_rel2move_in_transparent_mode - lsls r0, 16 - lsrs r7, r0, 16 - asrs r0, 16 - cmp r0, 0 - blt _080A8DE8 - ldr r5, =0x02020630 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - adds r3, r4, r5 - movs r0, 0x3 - ldrb r1, [r6, 0x14] - ands r1, r0 - lsls r1, 2 - ldrb r2, [r3, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x5] - ldrb r1, [r6, 0x10] - lsls r1, 4 - movs r2, 0xF - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x5] - movs r0, 0x8 - strh r0, [r3, 0x2E] - mov r0, r8 - strh r0, [r3, 0x30] - strh r7, [r3, 0x32] - movs r0, 0x8 - ldrsh r1, [r6, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrh r0, [r0, 0x24] - strh r0, [r3, 0x24] - adds r5, 0x1C - adds r4, r5 - ldr r0, =sub_80A8DFC - str r0, [r4] - ldrh r0, [r6, 0x12] - adds r0, 0x1 - strh r0, [r6, 0x12] -_080A8DE8: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A8D78 - - thumb_func_start sub_80A8DFC -sub_80A8DFC: @ 80A8DFC - push {lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x2E] - subs r0, 0x1 - strh r0, [r3, 0x2E] - lsls r0, 16 - cmp r0, 0 - bne _080A8E26 - ldr r2, =0x03005e00 - movs r0, 0x30 - ldrsh r1, [r3, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrh r1, [r0, 0x12] - subs r1, 0x1 - strh r1, [r0, 0x12] - adds r0, r3, 0 - bl obj_delete_but_dont_free_vram -_080A8E26: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A8DFC - - thumb_func_start sub_80A8E30 -sub_80A8E30: @ 80A8E30 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _080A8E68 - movs r0, 0x5 - b _080A8E6A - .pool -_080A8E68: - ldr r0, =0x0000fff6 -_080A8E6A: - strh r0, [r5, 0x2E] - ldr r0, =0x0000ffd8 - strh r0, [r5, 0x30] - ldr r0, =sub_80A8E88 - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A8E30 - - thumb_func_start sub_80A8E88 -sub_80A8E88: @ 80A8E88 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - ldrh r1, [r4, 0x32] - adds r0, r1 - strh r0, [r4, 0x32] - ldrh r5, [r4, 0x30] - ldrh r2, [r4, 0x34] - adds r0, r5, r2 - strh r0, [r4, 0x34] - movs r1, 0x32 - ldrsh r0, [r4, r1] - movs r1, 0xA - bl __divsi3 - strh r0, [r4, 0x24] - movs r2, 0x34 - ldrsh r0, [r4, r2] - movs r1, 0xA - bl __divsi3 - strh r0, [r4, 0x26] - lsls r0, r5, 16 - asrs r0, 16 - movs r1, 0x14 - negs r1, r1 - cmp r0, r1 - bge _080A8EC4 - adds r0, r5, 0x1 - strh r0, [r4, 0x30] -_080A8EC4: - movs r1, 0x22 - ldrsh r0, [r4, r1] - movs r2, 0x26 - ldrsh r1, [r4, r2] - adds r0, r1 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - bge _080A8EDC - adds r0, r4, 0 - bl move_anim_8072740 -_080A8EDC: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80A8E88 - - thumb_func_start sub_80A8EE4 -sub_80A8EE4: @ 80A8EE4 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =0x0203841e - ldrh r0, [r5, 0x4] - strh r0, [r4, 0x2E] - ldrh r0, [r5, 0x8] - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x32] - ldrh r0, [r5, 0xA] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x36] - ldr r0, =0x02038437 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _080A8F24 - ldrh r0, [r5, 0x8] - adds r0, 0x1E - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r5, 0xA] - subs r0, 0x14 - b _080A8F32 - .pool -_080A8F24: - ldrh r0, [r5, 0x8] - subs r0, 0x1E - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r5, 0xA] - subs r0, 0x50 -_080A8F32: - strh r0, [r4, 0x22] - ldr r0, =sub_80A6EEC - str r0, [r4, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r4, 0 - bl oamt_set_x3A_32 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A8EE4 - - .include "asm/task.s" - thumb_func_start nullsub_35 nullsub_35: @ 80A92F4 bx lr @@ -825075,63148 +524204,4 @@ GetGlyphWidthFont6: @ 81BA6CC bx lr thumb_func_end GetGlyphWidthFont6 - .include "asm/multiboot.s" - - thumb_func_start sub_81BAD84 -sub_81BAD84: @ 81BAD84 - push {r4-r6,lr} - movs r6, 0x80 - lsls r6, 19 - movs r2, 0 - strh r2, [r6] - ldr r1, =0x04000010 - strh r2, [r1] - adds r1, 0x2 - strh r2, [r1] - adds r1, 0x3E - strh r2, [r1] - ldr r5, =gUnknown_08617128 - lsls r4, r0, 1 - adds r4, r0 - lsls r4, 2 - adds r0, r4, r5 - ldr r0, [r0] - movs r1, 0xC0 - lsls r1, 19 - bl LZ77UnCompVram - adds r0, r5, 0x4 - adds r0, r4, r0 - ldr r0, [r0] - ldr r1, =0x0600f800 - bl LZ77UnCompVram - adds r5, 0x8 - adds r4, r5 - ldr r0, [r4] - movs r1, 0xA0 - lsls r1, 19 - movs r4, 0x80 - lsls r4, 1 - adds r2, r4, 0 - bl CpuSet - ldr r1, =0x04000008 - movs r2, 0xF8 - lsls r2, 5 - adds r0, r2, 0 - strh r0, [r1] - strh r4, [r6] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BAD84 - - thumb_func_start nullsub_77 -nullsub_77: @ 81BADF0 - bx lr - thumb_func_end nullsub_77 - - thumb_func_start sub_81BADF4 -sub_81BADF4: @ 81BADF4 - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_exec_buffer_A_ch0_tbl3 - str r1, [r0] - bx lr - .pool - thumb_func_end sub_81BADF4 - - thumb_func_start bx_exec_buffer_A_ch0_tbl3 -bx_exec_buffer_A_ch0_tbl3: @ 81BAE10 - push {lr} - ldr r2, =0x02024068 - ldr r1, =gUnknown_0832A328 - ldr r0, =0x02024064 - ldrb r3, [r0] - lsls r0, r3, 2 - adds r0, r1 - ldr r1, [r2] - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _081BAE5C - ldr r0, =0x02023064 - lsls r1, r3, 9 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x38 - bhi _081BAE58 - ldr r0, =gUnknown_08617170 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - bl _call_via_r0 - b _081BAE5C - .pool -_081BAE58: - bl dp01_tbl3_exec_completed -_081BAE5C: - pop {r0} - bx r0 - thumb_func_end bx_exec_buffer_A_ch0_tbl3 - - thumb_func_start sub_81BAE60 -sub_81BAE60: @ 81BAE60 - push {lr} - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - bne _081BAE84 - bl dp01_tbl3_exec_completed -_081BAE84: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BAE60 - - thumb_func_start sub_81BAE98 -sub_81BAE98: @ 81BAE98 - push {r4-r6,lr} - ldr r6, =0x02020630 - ldr r5, =0x020241e4 - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r6, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - bne _081BAEE8 - movs r0, 0 - bl nullsub_25 - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - bl obj_free_rotscale_entry - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - bl RemoveObjectAndFreeTiles - bl dp01_tbl3_exec_completed -_081BAEE8: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BAE98 - - thumb_func_start sub_81BAF00 -sub_81BAF00: @ 81BAF00 - push {r4,lr} - ldr r4, =0x020244d0 - ldr r1, [r4] - ldr r3, =0x02024064 - ldrb r0, [r3] - ldr r2, [r1, 0x4] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r0, [r1, 0x9] - subs r0, 0x1 - strb r0, [r1, 0x9] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _081BAF38 - ldr r0, [r4] - ldrb r1, [r3] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strb r1, [r0, 0x9] - bl dp01_tbl3_exec_completed -_081BAF38: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BAF00 - - thumb_func_start sub_81BAF48 -sub_81BAF48: @ 81BAF48 - push {r4-r6,lr} - movs r6, 0 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _081BAF6C - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _081BAFA0 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081BAFA0 -_081BAF6C: - ldr r2, =0x02020630 - ldr r1, =0x03005d70 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - bne _081BAFD8 - b _081BAFD6 - .pool -_081BAFA0: - ldr r2, =0x02020630 - ldr r5, =0x03005d70 - ldr r0, =0x02024064 - ldrb r3, [r0] - adds r0, r3, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, r2, 0 - adds r4, 0x1C - adds r0, r4 - ldr r2, [r0] - ldr r0, =DummyObjectCallback - cmp r2, r0 - bne _081BAFD8 - movs r0, 0x2 - eors r3, r0 - adds r0, r3, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r0, [r0] - cmp r0, r2 - bne _081BAFD8 -_081BAFD6: - movs r6, 0x1 -_081BAFD8: - bl sub_80A36C8 - lsls r0, 24 - cmp r0, 0 - beq _081BAFE4 - movs r6, 0 -_081BAFE4: - cmp r6, 0 - beq _081BB00A - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r3, =0x02024064 - ldrb r1, [r3] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x3 - strb r1, [r0, 0x9] - ldr r1, =0x03005d60 - ldrb r0, [r3] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_81BAF00 - str r1, [r0] -_081BB00A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BAF48 - - thumb_func_start sub_81BB02C -sub_81BB02C: @ 81BB02C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =0x020244d0 - mov r12, r0 - ldr r0, [r0] - ldr r7, =0x02024064 - ldrb r2, [r7] - ldr r3, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r4, r0, r3 - ldrb r1, [r4] - movs r5, 0x8 - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _081BB058 - b _081BB196 -_081BB058: - movs r1, 0x2 - mov r8, r1 - adds r1, r2, 0 - mov r0, r8 - eors r1, r0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r1, [r0] - adds r0, r5, 0 - ands r0, r1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - beq _081BB07A - b _081BB196 -_081BB07A: - ldr r1, =0x02020630 - mov r10, r1 - ldr r0, =0x03005d7c - mov r9, r0 - adds r0, r2, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - mov r5, r10 - adds r5, 0x1C - adds r0, r5 - ldr r3, [r0] - ldr r0, =DummyObjectCallback - cmp r3, r0 - bne _081BB196 - ldr r0, =0x020241e4 - adds r0, r2, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r0, [r0] - cmp r0, r3 - bne _081BB196 - ldrb r0, [r4, 0x9] - adds r0, 0x1 - strb r0, [r4, 0x9] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081BB196 - mov r1, r12 - ldr r0, [r1] - ldrb r1, [r7] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strb r6, [r0, 0x9] - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _081BB134 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _081BB134 - ldrb r0, [r7] - mov r1, r8 - eors r0, r1 - add r0, r9 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r10 - bl RemoveObjectAndFreeTiles - ldr r4, =0x03005d70 - ldrb r0, [r7] - mov r1, r8 - eors r1, r0 - adds r0, r1, r4 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x020244ec - adds r1, r2 - movs r2, 0 - bl healthbar_draw_field_maybe - ldrb r0, [r7] - mov r1, r8 - eors r0, r1 - bl sub_8076918 - ldrb r0, [r7] - mov r1, r8 - eors r0, r1 - adds r0, r4 - ldrb r0, [r0] - bl sub_80729D0 -_081BB134: - ldr r1, =0x03005d7c - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - ldr r5, =0x03005d70 - ldrb r1, [r4] - adds r0, r1, r5 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x020244ec - adds r1, r2 - movs r2, 0 - bl healthbar_draw_field_maybe - ldrb r0, [r4] - bl sub_8076918 - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - bl sub_80729D0 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r2, [r0, 0x8] - ldrb r1, [r2, 0x9] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x9] - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_81BAF48 - str r1, [r0] -_081BB196: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BB02C - - thumb_func_start sub_81BB1D4 -sub_81BB1D4: @ 81BB1D4 - push {lr} - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - adds r0, r1, 0 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 27 - cmp r0, 0 - bge _081BB202 - movs r2, 0x24 - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _081BB202 - bl dp01_tbl3_exec_completed -_081BB202: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BB1D4 - - thumb_func_start bx_t3_healthbar_update -bx_t3_healthbar_update: @ 81BB214 - push {r4-r6,lr} - ldr r5, =0x02024064 - ldrb r0, [r5] - ldr r6, =0x03005d70 - adds r1, r0, r6 - ldrb r1, [r1] - movs r2, 0 - movs r3, 0 - bl sub_8074AA0 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldrb r0, [r5] - adds r0, r6 - ldrb r0, [r0] - bl sub_80729D0 - lsls r4, 16 - asrs r1, r4, 16 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081BB25C - ldrb r0, [r5] - adds r0, r6 - ldrb r0, [r0] - movs r2, 0 - bl heathbar_draw_hp - b _081BB276 - .pool -_081BB25C: - ldr r2, =0x0202406e - ldrb r1, [r5] - lsls r0, r1, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =0x020244ec - adds r0, r2 - bl sub_805E990 - bl dp01_tbl3_exec_completed -_081BB276: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end bx_t3_healthbar_update - - thumb_func_start sub_81BB284 -sub_81BB284: @ 81BB284 - push {lr} - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _081BB296 - bl dp01_tbl3_exec_completed -_081BB296: - pop {r0} - bx r0 - thumb_func_end sub_81BB284 - - thumb_func_start sub_81BB29C -sub_81BB29C: @ 81BB29C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldr r1, =0x03005e00 - lsls r0, 2 - add r0, r9 - lsls r0, 3 - adds r0, r1 - mov r8, r0 - ldrb r0, [r0, 0x8] - mov r10, r0 - mov r1, r8 - ldrb r7, [r1, 0xC] - str r7, [sp, 0x8] - ldrh r2, [r1, 0xA] - str r2, [sp, 0xC] - bl battle_type_is_double - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081BB2E2 - ldr r1, =0x0202406e - lsls r0, r7, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r10, r0 - bne _081BB2E2 - b _081BB3F8 -_081BB2E2: - movs r0, 0x64 - mov r1, r10 - muls r1, r0 - ldr r0, =0x020244ec - adds r6, r1, r0 - adds r0, r6, 0 - movs r1, 0xB - bl pokemon_getattr - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r6, 0 - movs r1, 0x38 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r6, 0 - movs r1, 0x19 - bl pokemon_getattr - str r0, [sp, 0x4] - ldr r3, =gExperienceTables - adds r4, 0x1 - lsls r4, 2 - ldr r2, =gBaseStats - lsls r1, r5, 3 - subs r1, r5 - lsls r1, 2 - adds r1, r2 - ldrb r2, [r1, 0x13] - movs r1, 0xCA - lsls r1, 1 - muls r1, r2 - adds r4, r1 - adds r4, r3 - ldr r2, [r4] - str r2, [sp] - ldr r3, [sp, 0xC] - lsls r1, r3, 16 - asrs r1, 16 - adds r0, r1 - cmp r0, r2 - bcc _081BB3D0 - adds r0, r6, 0 - movs r1, 0x19 - mov r2, sp - bl pokemon_setattr - adds r0, r6, 0 - bl pokemon_calc_effective_stats - ldr r2, [sp] - add r0, sp, 0x4 - ldrh r0, [r0] - subs r2, r0 - ldr r0, [sp, 0xC] - subs r2, r0, r2 - ldr r4, =0x02024064 - ldrb r5, [r4] - strb r7, [r4] - lsls r2, 16 - lsrs r2, 16 - movs r0, 0x1 - movs r1, 0xB - bl dp01_build_cmdbuf_x21_a_bb - strb r5, [r4] - bl battle_type_is_double - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081BB3B8 - ldr r2, =0x0202406e - lsls r0, r7, 1 - adds r0, r2 - mov r1, r10 - ldrh r0, [r0] - cmp r1, r0 - beq _081BB396 - movs r0, 0x2 - eors r7, r0 - lsls r0, r7, 1 - adds r0, r2 - ldrh r0, [r0] - cmp r1, r0 - bne _081BB3B8 -_081BB396: - ldr r0, =sub_81BB628 - b _081BB3FA - .pool -_081BB3B8: - ldr r0, =0x03005e00 - mov r2, r9 - lsls r1, r2, 2 - add r1, r9 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81BB740 - b _081BB3FC - .pool -_081BB3D0: - str r0, [sp, 0x4] - add r2, sp, 0x4 - adds r0, r6, 0 - movs r1, 0x19 - bl pokemon_setattr - ldr r1, =0x03005d60 - ldr r3, [sp, 0x8] - lsls r0, r3, 2 - adds r0, r1 - ldr r1, =sub_81BB284 - str r1, [r0] - mov r0, r9 - bl remove_task - b _081BB3FE - .pool -_081BB3F8: - ldr r0, =sub_81BB414 -_081BB3FA: - mov r1, r8 -_081BB3FC: - str r0, [r1] -_081BB3FE: - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BB29C - - thumb_func_start sub_81BB414 -sub_81BB414: @ 81BB414 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005e00 - lsls r2, r0, 2 - mov r8, r2 - add r8, r0 - mov r0, r8 - lsls r0, 3 - mov r8, r0 - add r8, r1 - mov r2, r8 - ldrb r1, [r2, 0x8] - movs r0, 0xA - ldrsh r2, [r2, r0] - mov r9, r2 - mov r2, r8 - ldrb r2, [r2, 0xC] - mov r10, r2 - movs r0, 0x64 - adds r6, r1, 0 - muls r6, r0 - ldr r0, =0x020244ec - adds r6, r0 - adds r0, r6, 0 - movs r1, 0x38 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r6, 0 - movs r1, 0xB - bl pokemon_getattr - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r6, 0 - movs r1, 0x19 - bl pokemon_getattr - adds r3, r0, 0 - ldr r6, =gExperienceTables - lsls r1, r4, 2 - ldr r2, =gBaseStats - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - adds r0, r2 - ldrb r2, [r0, 0x13] - movs r0, 0xCA - lsls r0, 1 - muls r0, r2 - adds r1, r0 - adds r1, r6 - ldr r1, [r1] - subs r3, r1 - adds r4, 0x1 - lsls r4, 2 - adds r4, r0 - adds r4, r6 - ldr r2, [r4] - subs r2, r1 - ldr r0, =0x03005d70 - add r0, r10 - ldrb r1, [r0] - mov r0, r9 - negs r0, r0 - str r0, [sp] - mov r0, r10 - bl sub_807294C - movs r0, 0x21 - bl audio_play - ldr r0, =sub_81BB4E4 - mov r1, r8 - str r0, [r1] - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BB414 - - thumb_func_start sub_81BB4E4 -sub_81BB4E4: @ 81BB4E4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r1, =0x03005e00 - lsls r0, 2 - add r0, r8 - lsls r0, 3 - adds r6, r0, r1 - ldrh r1, [r6, 0x1C] - movs r2, 0x1C - ldrsh r0, [r6, r2] - cmp r0, 0xC - bgt _081BB514 - adds r0, r1, 0x1 - strh r0, [r6, 0x1C] - b _081BB610 - .pool -_081BB514: - ldrb r0, [r6, 0x8] - mov r9, r0 - ldrh r2, [r6, 0xA] - mov r10, r2 - ldrb r7, [r6, 0xC] - ldr r5, =0x03005d70 - adds r5, r7, r5 - ldrb r1, [r5] - adds r0, r7, 0 - movs r2, 0x1 - movs r3, 0 - bl sub_8074AA0 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldrb r0, [r5] - bl sub_80729D0 - lsls r4, 16 - asrs r4, 16 - movs r0, 0x1 - negs r0, r0 - cmp r4, r0 - bne _081BB610 - movs r0, 0x21 - bl m4aSongNumStop - movs r0, 0x64 - mov r1, r9 - muls r1, r0 - ldr r0, =0x020244ec - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x38 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x19 - bl pokemon_getattr - str r0, [sp, 0x4] - adds r0, r5, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - ldr r3, =gExperienceTables - adds r4, 0x1 - lsls r4, 2 - ldr r2, =gBaseStats - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r1, [r1, 0x13] - movs r0, 0xCA - lsls r0, 1 - muls r0, r1 - adds r4, r0 - adds r4, r3 - ldr r1, [r4] - str r1, [sp] - mov r2, r10 - lsls r0, r2, 16 - asrs r4, r0, 16 - ldr r0, [sp, 0x4] - adds r0, r4 - cmp r0, r1 - blt _081BB5F4 - adds r0, r5, 0 - movs r1, 0x19 - mov r2, sp - bl pokemon_setattr - adds r0, r5, 0 - bl pokemon_calc_effective_stats - ldr r2, [sp] - add r0, sp, 0x4 - ldrh r0, [r0] - subs r2, r0 - subs r2, r4, r2 - ldr r4, =0x02024064 - ldrb r5, [r4] - strb r7, [r4] - lsls r2, 16 - lsrs r2, 16 - movs r0, 0x1 - movs r1, 0xB - bl dp01_build_cmdbuf_x21_a_bb - strb r5, [r4] - ldr r0, =sub_81BB628 - str r0, [r6] - b _081BB610 - .pool -_081BB5F4: - str r0, [sp, 0x4] - add r2, sp, 0x4 - adds r0, r5, 0 - movs r1, 0x19 - bl pokemon_setattr - ldr r1, =0x03005d60 - lsls r0, r7, 2 - adds r0, r1 - ldr r1, =sub_81BB284 - str r1, [r0] - mov r0, r8 - bl remove_task -_081BB610: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BB4E4 - - thumb_func_start sub_81BB628 -sub_81BB628: @ 81BB628 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldrb r4, [r0, 0xC] - ldrb r6, [r0, 0x8] - bl battle_type_is_double - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081BB65C - ldr r1, =0x0202406e - movs r0, 0x2 - adds r2, r4, 0 - eors r2, r0 - lsls r0, r2, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r6, r0 - bne _081BB65C - adds r4, r2, 0 -_081BB65C: - adds r0, r4, 0 - adds r1, r4, 0 - adds r2, r4, 0 - movs r3, 0 - bl move_anim_start_t4 - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81BB688 - str r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BB628 - - thumb_func_start sub_81BB688 -sub_81BB688: @ 81BB688 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r2, r0, r1 - ldrb r5, [r2, 0xC] - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0, 0x4] - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _081BB72A - ldrb r4, [r2, 0x8] - movs r0, 0x64 - adds r1, r4, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r7, r1, r0 - adds r0, r7, 0 - movs r1, 0x38 - bl pokemon_getattr - bl battle_type_is_double - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081BB708 - ldr r1, =0x0202406e - movs r0, 0x2 - adds r2, r5, 0 - eors r2, r0 - lsls r0, r2, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r4, r0 - bne _081BB708 - ldr r0, =0x03005d70 - adds r0, r2, r0 - ldrb r0, [r0] - adds r1, r7, 0 - movs r2, 0 - bl healthbar_draw_field_maybe - b _081BB71C - .pool -_081BB708: - ldr r0, =0x03005d70 - adds r0, r5, r0 - ldrb r0, [r0] - movs r1, 0x64 - muls r1, r4 - ldr r2, =0x020244ec - adds r1, r2 - movs r2, 0 - bl healthbar_draw_field_maybe -_081BB71C: - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81BB740 - str r0, [r1] -_081BB72A: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BB688 - - thumb_func_start sub_81BB740 -sub_81BB740: @ 81BB740 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =0x03005e00 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r0 - ldrb r1, [r4, 0x8] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x38 - bl pokemon_getattr - ldrb r0, [r4, 0xC] - ldr r1, =0x03005d60 - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_81BB284 - str r1, [r0] - adds r0, r5, 0 - bl remove_task - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BB740 - - thumb_func_start sub_81BB78C -sub_81BB78C: @ 81BB78C - push {r4-r6,lr} - ldr r6, =0x02020630 - ldr r5, =0x020241e4 - ldr r4, =0x02024064 - ldrb r2, [r4] - adds r0, r2, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r3, 0x22 - ldrsh r1, [r0, r3] - movs r3, 0x26 - ldrsh r0, [r0, r3] - adds r1, r0 - cmp r1, 0xA0 - ble _081BB808 - ldr r1, =0x0202406e - lsls r0, r2, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - bl nullsub_24 - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - bl RemoveObjectAndFreeTiles - ldr r1, =0x03005d70 - ldrb r0, [r4] - adds r0, r1 - ldrb r0, [r0] - bl sub_8072984 - bl dp01_tbl3_exec_completed -_081BB808: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BB78C - - thumb_func_start sub_81BB828 -sub_81BB828: @ 81BB828 - push {r4-r6,lr} - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r6, =0x02024064 - ldrb r2, [r6] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _081BB87C - ldr r5, =0x020241e4 - adds r0, r2, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl obj_free_rotscale_entry - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r1, =0x03005d70 - ldrb r0, [r6] - adds r0, r1 - ldrb r0, [r0] - bl sub_8072984 - bl dp01_tbl3_exec_completed -_081BB87C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BB828 - - thumb_func_start sub_81BB898 -sub_81BB898: @ 81BB898 - push {lr} - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _081BB8AA - bl dp01_tbl3_exec_completed -_081BB8AA: - pop {r0} - bx r0 - thumb_func_end sub_81BB898 - - thumb_func_start bx_blink_t3 -bx_blink_t3: @ 81BB8B0 - push {r4,lr} - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - ldr r2, =0x02020630 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, r0, r2 - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0x20 - bne _081BB8FC - movs r3, 0 - movs r0, 0 - strh r0, [r4, 0x30] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - subs r0, 0x5 - ands r0, r1 - strb r0, [r2] - ldr r0, =0x020244b9 - strb r3, [r0] - bl dp01_tbl3_exec_completed - b _081BB926 - .pool -_081BB8FC: - ldrh r0, [r4, 0x30] - movs r1, 0x3 - ands r0, r1 - cmp r0, 0 - bne _081BB920 - adds r3, r4, 0 - adds r3, 0x3E - ldrb r2, [r3] - lsls r0, r2, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] -_081BB920: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] -_081BB926: - pop {r4} - pop {r0} - bx r0 - thumb_func_end bx_blink_t3 - - thumb_func_start sub_81BB92C -sub_81BB92C: @ 81BB92C - push {r4,lr} - ldr r2, =0x02020630 - ldr r0, =0x03005d70 - ldr r4, =0x02024064 - ldrb r3, [r4] - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - bne _081BB97E - adds r0, r3, 0 - bl sub_805E408 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldrb r2, [r4] - ldr r1, [r0] - lsls r0, r2, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _081BB972 - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x6 - bl move_anim_start_t4 -_081BB972: - ldr r0, =0x03005d60 - ldrb r1, [r4] - lsls r1, 2 - adds r1, r0 - ldr r0, =dp01t_35_3_free_vram - str r0, [r1] -_081BB97E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BB92C - - thumb_func_start dp01t_35_3_free_vram -dp01t_35_3_free_vram: @ 81BB9A0 - push {lr} - ldr r0, =0x020244d0 - ldr r1, [r0] - ldr r0, =0x02024064 - ldrb r3, [r0] - ldr r1, [r1, 0x4] - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _081BB9DC - ldr r2, =0x02020630 - ldr r0, =0x020241e4 - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - bne _081BB9DC - bl dp01_tbl3_exec_completed -_081BB9DC: - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_35_3_free_vram - - thumb_func_start sub_81BB9F4 -sub_81BB9F4: @ 81BB9F4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r3, =0x020244d0 - ldr r0, [r3] - ldr r7, =0x02024064 - ldrb r1, [r7] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r2, r0, r2 - ldrb r1, [r2, 0x1] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081BBAB0 - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - ldr r0, [r3] - ldrb r2, [r7] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1] - ldr r4, =0x000027f9 - adds r0, r4, 0 - bl FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - ldr r0, =c3_0802FDF4 - movs r1, 0xA - bl AddTask - ldr r0, =0x0202406e - mov r8, r0 - ldrb r1, [r7] - lsls r0, r1, 1 - add r0, r8 - ldrh r0, [r0] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x020244ec - adds r0, r5 - bl sub_805E990 - ldr r1, =0x020241e4 - ldrb r0, [r7] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r1, 0 - bl StartObjectImageAnim - ldr r4, =0x03005d70 - ldrb r1, [r7] - adds r0, r1, r4 - ldrb r0, [r0] - lsls r1, 1 - add r1, r8 - ldrh r1, [r1] - muls r1, r6 - adds r1, r5 - movs r2, 0 - bl healthbar_draw_field_maybe - ldrb r0, [r7] - bl sub_8076918 - ldrb r0, [r7] - adds r0, r4 - ldrb r0, [r0] - bl sub_80729D0 - ldr r1, =0x03005d60 - ldrb r0, [r7] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_81BB92C - str r1, [r0] -_081BBAB0: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BB9F4 - - thumb_func_start sub_81BBAE8 -sub_81BBAE8: @ 81BBAE8 - push {r4-r6,lr} - ldr r6, =0x020244d0 - ldr r0, [r6] - ldr r4, =0x02024064 - ldrb r2, [r4] - ldr r1, [r0, 0x4] - lsls r3, r2, 1 - adds r0, r3, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x88 - ands r0, r1 - cmp r0, 0 - bne _081BBB1A - ldr r0, =0x0202406e - adds r0, r3, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r1, r0 - adds r0, r2, 0 - bl sub_8172EF0 -_081BBB1A: - ldr r5, =0x02020630 - ldr r0, =0x03005d7c - ldrb r2, [r4] - adds r0, r2, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r3, r0, 2 - adds r0, r5, 0 - adds r0, 0x1C - adds r0, r3, r0 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - bne _081BBB60 - ldr r0, [r6] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - bne _081BBB60 - adds r0, r3, r5 - bl RemoveObjectAndFreeTiles - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_81BB9F4 - str r1, [r0] -_081BBB60: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BBAE8 - - thumb_func_start dp01_tbl3_exec_completed -dp01_tbl3_exec_completed: @ 81BBB8C - push {r4,lr} - sub sp, 0x4 - ldr r1, =0x03005d60 - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_exec_buffer_A_ch0_tbl3 - str r1, [r0] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081BBBE0 - bl link_get_multiplayer_id - mov r1, sp - strb r0, [r1] - movs r0, 0x2 - movs r1, 0x4 - mov r2, sp - bl dp01_prepare_buffer_wireless_probably - ldr r1, =0x02023064 - ldrb r0, [r4] - lsls r0, 9 - adds r0, r1 - movs r1, 0x38 - strb r1, [r0] - b _081BBBF2 - .pool -_081BBBE0: - ldr r2, =0x02024068 - ldr r1, =gUnknown_0832A328 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - ldr r0, [r2] - bics r0, r1 - str r0, [r2] -_081BBBF2: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_tbl3_exec_completed - - thumb_func_start sub_81BBC04 -sub_81BBC04: @ 81BBC04 - push {lr} - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _081BBC26 - bl dp01_tbl3_exec_completed -_081BBC26: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BBC04 - - thumb_func_start bx_80E8A6C -bx_80E8A6C: @ 81BBC34 - push {lr} - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _081BBC56 - bl dp01_tbl3_exec_completed -_081BBC56: - pop {r0} - bx r0 - .pool - thumb_func_end bx_80E8A6C - - thumb_func_start dp01t_00_3_getattr -dp01t_00_3_getattr: @ 81BBC64 - push {r4-r6,lr} - sub sp, 0x100 - movs r6, 0 - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x2 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0 - bne _081BBC9C - ldr r0, =0x0202406e - lsls r1, r2, 1 - adds r1, r0 - ldrb r0, [r1] - mov r1, sp - bl dp01_getattr_by_ch1_for_player_pokemon - adds r6, r0, 0 - b _081BBCBE - .pool -_081BBC9C: - ldrb r4, [r1] - movs r5, 0 -_081BBCA0: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _081BBCB6 - lsls r0, r5, 24 - lsrs r0, 24 - mov r2, sp - adds r1, r2, r6 - bl dp01_getattr_by_ch1_for_player_pokemon - adds r6, r0 -_081BBCB6: - lsrs r4, 1 - adds r5, 0x1 - cmp r5, 0x5 - ble _081BBCA0 -_081BBCBE: - lsls r1, r6, 16 - lsrs r1, 16 - movs r0, 0x1 - mov r2, sp - bl dp01_build_cmdbuf_x1D_1D_numargs_varargs - bl dp01_tbl3_exec_completed - add sp, 0x100 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end dp01t_00_3_getattr - - thumb_func_start dp01_getattr_by_ch1_for_player_pokemon -dp01_getattr_by_ch1_for_player_pokemon: @ 81BBCD8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x90 - adds r7, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - movs r6, 0 - ldr r2, =0x02023064 - ldr r3, =0x02024064 - ldrb r0, [r3] - lsls r0, 9 - adds r1, r2, 0x1 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3B - bls _081BBD02 - bl _081BC46E -_081BBD02: - lsls r0, 2 - ldr r1, =_081BBD18 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081BBD18: - .4byte _081BBE08 - .4byte _081BC02C - .4byte _081BC03C - .4byte _081BC04C - .4byte _081BC0B4 - .4byte _081BC0B4 - .4byte _081BC0B4 - .4byte _081BC0B4 - .4byte _081BC0D0 - .4byte _081BC10C - .4byte _081BC10C - .4byte _081BC10C - .4byte _081BC10C - .4byte _081BC46E - .4byte _081BC46E - .4byte _081BC46E - .4byte _081BC46E - .4byte _081BC128 - .4byte _081BC138 - .4byte _081BC168 - .4byte _081BC178 - .4byte _081BC188 - .4byte _081BC198 - .4byte _081BC1A8 - .4byte _081BC1B8 - .4byte _081BC1C8 - .4byte _081BC1D8 - .4byte _081BC1E8 - .4byte _081BC1F8 - .4byte _081BC208 - .4byte _081BC218 - .4byte _081BC228 - .4byte _081BC278 - .4byte _081BC288 - .4byte _081BC298 - .4byte _081BC2A8 - .4byte _081BC2B8 - .4byte _081BC2C8 - .4byte _081BC2D8 - .4byte _081BC2E8 - .4byte _081BC2F8 - .4byte _081BC32C - .4byte _081BC33C - .4byte _081BC34C - .4byte _081BC35C - .4byte _081BC36C - .4byte _081BC37C - .4byte _081BC38C - .4byte _081BC39C - .4byte _081BC3BC - .4byte _081BC3CC - .4byte _081BC3DC - .4byte _081BC3EC - .4byte _081BC3FC - .4byte _081BC40C - .4byte _081BC41C - .4byte _081BC42C - .4byte _081BC43C - .4byte _081BC44C - .4byte _081BC45C -_081BBE08: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - mov r1, sp - strh r0, [r1] - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x2E] - movs r6, 0 - add r0, sp, 0x24 - mov r9, r0 - movs r1, 0x3B - add r1, sp - mov r10, r1 - mov r2, sp - adds r2, 0x2B - str r2, [sp, 0x80] - mov r0, sp - adds r0, 0x2A - str r0, [sp, 0x7C] - mov r1, sp - adds r1, 0x68 - str r1, [sp, 0x8C] - adds r2, 0x5 - str r2, [sp, 0x84] - adds r0, 0x12 - str r0, [sp, 0x88] - mov r8, r4 - add r4, sp, 0xC -_081BBE54: - adds r1, r6, 0 - adds r1, 0xD - mov r0, r8 - bl pokemon_getattr - strh r0, [r4] - adds r1, r6, 0 - adds r1, 0x11 - mov r0, r8 - bl pokemon_getattr - mov r2, r9 - adds r1, r2, r6 - strb r0, [r1] - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - ble _081BBE54 - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x15 - bl pokemon_getattr - mov r1, r10 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x20 - bl pokemon_getattr - ldr r2, [sp, 0x80] - strb r0, [r2] - adds r0, r4, 0 - movs r1, 0x19 - bl pokemon_getattr - str r0, [sp, 0x44] - adds r0, r4, 0 - movs r1, 0x27 - bl pokemon_getattr - mov r3, sp - movs r5, 0x1F - ands r0, r5 - ldrb r2, [r3, 0x14] - movs r1, 0x20 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x14] - adds r0, r4, 0 - movs r1, 0x28 - bl pokemon_getattr - mov r3, sp - movs r6, 0x1F - ands r0, r6 - lsls r0, 5 - ldrh r2, [r3, 0x14] - ldr r1, =0xfffffc1f - ands r1, r2 - orrs r1, r0 - strh r1, [r3, 0x14] - adds r0, r4, 0 - movs r1, 0x29 - bl pokemon_getattr - mov r3, sp - ands r0, r5 - lsls r0, 2 - ldrb r2, [r3, 0x15] - movs r1, 0x7D - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x15] - adds r0, r4, 0 - movs r1, 0x2A - bl pokemon_getattr - movs r1, 0x1F - ands r1, r0 - lsls r1, 15 - ldr r0, [sp, 0x14] - ldr r2, =0xfff07fff - ands r0, r2 - orrs r0, r1 - str r0, [sp, 0x14] - adds r0, r4, 0 - movs r1, 0x2B - bl pokemon_getattr - mov r3, sp - ands r0, r6 - lsls r0, 4 - ldrh r2, [r3, 0x16] - ldr r1, =0xfffffe0f - ands r1, r2 - orrs r1, r0 - strh r1, [r3, 0x16] - adds r0, r4, 0 - movs r1, 0x2C - bl pokemon_getattr - mov r3, sp - ands r0, r5 - lsls r0, 1 - ldrb r2, [r3, 0x17] - movs r1, 0x3F - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x17] - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - str r0, [sp, 0x48] - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr - str r0, [sp, 0x4C] - adds r0, r4, 0 - movs r1, 0x38 - bl pokemon_getattr - ldr r1, [sp, 0x7C] - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x28] - adds r0, r4, 0 - movs r1, 0x3A - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x2C] - adds r0, r4, 0 - movs r1, 0x3B - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x2] - adds r0, r4, 0 - movs r1, 0x3C - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x4] - adds r0, r4, 0 - movs r1, 0x3D - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x6] - adds r0, r4, 0 - movs r1, 0x3E - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x8] - adds r0, r4, 0 - movs r1, 0x3F - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0xA] - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - mov r3, sp - movs r1, 0x1 - ands r0, r1 - lsls r0, 6 - ldrb r2, [r3, 0x17] - movs r1, 0x41 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x17] - adds r0, r4, 0 - movs r1, 0x2E - bl pokemon_getattr - mov r3, sp - lsls r0, 7 - ldrb r2, [r3, 0x17] - movs r1, 0x7F - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x17] - adds r0, r4, 0 - movs r1, 0x1 - bl pokemon_getattr - str r0, [sp, 0x54] - adds r0, r4, 0 - movs r1, 0x2 - ldr r2, [sp, 0x8C] - bl pokemon_getattr - ldr r0, [sp, 0x84] - ldr r1, [sp, 0x8C] - bl CopyString_Limit10 - adds r0, r4, 0 - movs r1, 0x7 - ldr r2, [sp, 0x88] - bl pokemon_getattr - mov r2, sp - movs r6, 0 -_081BC00C: - adds r0, r7, r6 - adds r1, r2, r6 - ldrb r1, [r1] - strb r1, [r0] - adds r6, 0x1 - cmp r6, 0x57 - bls _081BC00C - b _081BC46E - .pool -_081BC02C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - b _081BC3A6 - .pool -_081BC03C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xC - b _081BC3A6 - .pool -_081BC04C: - movs r6, 0 - add r2, sp, 0x58 - mov r9, r2 - add r0, sp, 0x60 - mov r10, r0 - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - mov r8, r9 -_081BC062: - adds r1, r6, 0 - adds r1, 0xD - adds r0, r4, 0 - bl pokemon_getattr - mov r1, r8 - strh r0, [r1] - adds r1, r6, 0 - adds r1, 0x11 - adds r0, r4, 0 - bl pokemon_getattr - mov r2, r10 - adds r1, r2, r6 - strb r0, [r1] - movs r0, 0x2 - add r8, r0 - adds r6, 0x1 - cmp r6, 0x3 - ble _081BC062 - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x15 - bl pokemon_getattr - mov r1, r9 - strb r0, [r1, 0xC] - mov r2, r9 - movs r6, 0 -_081BC0A0: - adds r0, r7, r6 - adds r1, r2, r6 - ldrb r1, [r1] - strb r1, [r0] - adds r6, 0x1 - cmp r6, 0xF - bls _081BC0A0 - b _081BC46E - .pool -_081BC0B4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldrb r1, [r3] - lsls r1, 9 - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - adds r1, 0x9 - b _081BC3A6 - .pool -_081BC0D0: - movs r6, 0 - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r2, =0x020244ec - mov r8, r2 -_081BC0DC: - adds r1, r6, 0 - adds r1, 0x11 - mov r2, r8 - adds r0, r4, r2 - bl pokemon_getattr - adds r1, r7, r6 - strb r0, [r1] - adds r6, 0x1 - cmp r6, 0x3 - ble _081BC0DC - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x15 - bl pokemon_getattr - adds r1, r7, r6 - strb r0, [r1] - adds r6, 0x1 - b _081BC46E - .pool -_081BC10C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldrb r1, [r3] - lsls r1, 9 - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - adds r1, 0x8 - b _081BC466 - .pool -_081BC128: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1 - b _081BC142 - .pool -_081BC138: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x19 -_081BC142: - bl pokemon_getattr - adds r1, r0, 0 - strb r1, [r7] - movs r0, 0xFF - lsls r0, 8 - ands r0, r1 - lsrs r0, 8 - strb r0, [r7, 0x1] - movs r0, 0xFF - lsls r0, 16 - ands r0, r1 - lsrs r0, 16 - strb r0, [r7, 0x2] - movs r6, 0x3 - b _081BC46E - .pool -_081BC168: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1A - b _081BC466 - .pool -_081BC178: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1B - b _081BC466 - .pool -_081BC188: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1C - b _081BC466 - .pool -_081BC198: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1D - b _081BC466 - .pool -_081BC1A8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1E - b _081BC466 - .pool -_081BC1B8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1F - b _081BC466 - .pool -_081BC1C8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x20 - b _081BC466 - .pool -_081BC1D8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x22 - b _081BC466 - .pool -_081BC1E8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x23 - b _081BC466 - .pool -_081BC1F8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x24 - b _081BC466 - .pool -_081BC208: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x25 - b _081BC466 - .pool -_081BC218: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x26 - b _081BC466 - .pool -_081BC228: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x27 - bl pokemon_getattr - strb r0, [r7] - adds r0, r4, 0 - movs r1, 0x28 - bl pokemon_getattr - strb r0, [r7, 0x1] - adds r0, r4, 0 - movs r1, 0x29 - bl pokemon_getattr - strb r0, [r7, 0x2] - adds r0, r4, 0 - movs r1, 0x2A - bl pokemon_getattr - strb r0, [r7, 0x3] - adds r0, r4, 0 - movs r1, 0x2B - bl pokemon_getattr - strb r0, [r7, 0x4] - adds r0, r4, 0 - movs r1, 0x2C - bl pokemon_getattr - strb r0, [r7, 0x5] - movs r6, 0x6 - b _081BC46E - .pool -_081BC278: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x27 - b _081BC466 - .pool -_081BC288: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x28 - b _081BC466 - .pool -_081BC298: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x29 - b _081BC466 - .pool -_081BC2A8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2A - b _081BC466 - .pool -_081BC2B8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2B - b _081BC466 - .pool -_081BC2C8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2C - b _081BC466 - .pool -_081BC2D8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0 - b _081BC302 - .pool -_081BC2E8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x9 - b _081BC3A6 - .pool -_081BC2F8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x37 -_081BC302: - bl pokemon_getattr - adds r1, r0, 0 - strb r1, [r7] - movs r0, 0xFF - lsls r0, 8 - ands r0, r1 - lsrs r0, 8 - strb r0, [r7, 0x1] - movs r0, 0xFF - lsls r0, 16 - ands r0, r1 - lsrs r0, 16 - strb r0, [r7, 0x2] - lsrs r0, r1, 24 - strb r0, [r7, 0x3] - movs r6, 0x4 - b _081BC46E - .pool -_081BC32C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x38 - b _081BC466 - .pool -_081BC33C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x39 - b _081BC3A6 - .pool -_081BC34C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3A - b _081BC3A6 - .pool -_081BC35C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3B - b _081BC3A6 - .pool -_081BC36C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3C - b _081BC3A6 - .pool -_081BC37C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3D - b _081BC3A6 - .pool -_081BC38C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3E - b _081BC3A6 - .pool -_081BC39C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3F -_081BC3A6: - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - strb r0, [r7] - lsrs r0, 8 - strb r0, [r7, 0x1] - movs r6, 0x2 - b _081BC46E - .pool -_081BC3BC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x16 - b _081BC466 - .pool -_081BC3CC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x17 - b _081BC466 - .pool -_081BC3DC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x18 - b _081BC466 - .pool -_081BC3EC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x21 - b _081BC466 - .pool -_081BC3FC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2F - b _081BC466 - .pool -_081BC40C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x30 - b _081BC466 - .pool -_081BC41C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x32 - b _081BC466 - .pool -_081BC42C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x33 - b _081BC466 - .pool -_081BC43C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x34 - b _081BC466 - .pool -_081BC44C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x35 - b _081BC466 - .pool -_081BC45C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x36 -_081BC466: - bl pokemon_getattr - strb r0, [r7] - movs r6, 0x1 -_081BC46E: - adds r0, r6, 0 - add sp, 0x90 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end dp01_getattr_by_ch1_for_player_pokemon - - thumb_func_start sub_81BC484 -sub_81BC484: @ 81BC484 - push {lr} - bl dp01_tbl3_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81BC484 - - thumb_func_start sub_81BC490 -sub_81BC490: @ 81BC490 - push {r4,r5,lr} - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x2 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0 - bne _081BC4C0 - ldr r0, =0x0202406e - lsls r1, r2, 1 - adds r1, r0 - ldrb r0, [r1] - bl sub_81BC4E8 - b _081BC4DE - .pool -_081BC4C0: - ldrb r4, [r1] - movs r5, 0 -_081BC4C4: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _081BC4D2 - adds r0, r5, 0 - bl sub_81BC4E8 -_081BC4D2: - lsrs r4, 1 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _081BC4C4 -_081BC4DE: - bl dp01_tbl3_exec_completed - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81BC490 - - thumb_func_start sub_81BC4E8 -sub_81BC4E8: @ 81BC4E8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x34 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 9 - ldr r2, =0x02023067 - adds r3, r0, r2 - adds r6, r3, 0 - subs r1, r2, 0x2 - adds r0, r1 - ldrb r0, [r0] - adds r7, r2, 0 - cmp r0, 0x3B - bls _081BC514 - bl _081BCEAE -_081BC514: - lsls r0, 2 - ldr r1, =_081BC52C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081BC52C: - .4byte _081BC61C - .4byte _081BC7B4 - .4byte _081BC7D4 - .4byte _081BC7F4 - .4byte _081BC84C - .4byte _081BC84C - .4byte _081BC84C - .4byte _081BC84C - .4byte _081BC874 - .4byte _081BC8D8 - .4byte _081BC8D8 - .4byte _081BC8D8 - .4byte _081BC8D8 - .4byte _081BCEAE - .4byte _081BCEAE - .4byte _081BCEAE - .4byte _081BCEAE - .4byte _081BC908 - .4byte _081BC928 - .4byte _081BC948 - .4byte _081BC968 - .4byte _081BC988 - .4byte _081BC9A8 - .4byte _081BC9C8 - .4byte _081BC9E8 - .4byte _081BCA08 - .4byte _081BCA28 - .4byte _081BCA48 - .4byte _081BCA68 - .4byte _081BCA88 - .4byte _081BCAA8 - .4byte _081BCAC8 - .4byte _081BCB38 - .4byte _081BCB58 - .4byte _081BCB78 - .4byte _081BCB98 - .4byte _081BCBB8 - .4byte _081BCBD8 - .4byte _081BCBF8 - .4byte _081BCC18 - .4byte _081BCC38 - .4byte _081BCC58 - .4byte _081BCC78 - .4byte _081BCC98 - .4byte _081BCCB8 - .4byte _081BCCD8 - .4byte _081BCCF8 - .4byte _081BCD18 - .4byte _081BCD38 - .4byte _081BCD58 - .4byte _081BCD78 - .4byte _081BCD98 - .4byte _081BCDB8 - .4byte _081BCDD8 - .4byte _081BCDF8 - .4byte _081BCE18 - .4byte _081BCE38 - .4byte _081BCE58 - .4byte _081BCE78 - .4byte _081BCE98 -_081BC61C: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - adds r2, r6, 0 - bl pokemon_setattr - adds r2, r6, 0 - adds r2, 0x2E - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_setattr - movs r0, 0 - mov r8, r0 - movs r0, 0x3B - adds r0, r6 - mov r10, r0 - adds r0, r6, 0 - adds r0, 0x2B - str r0, [sp, 0x20] - adds r0, 0x19 - str r0, [sp, 0x28] - adds r0, 0x4 - str r0, [sp, 0x2C] - adds r0, 0x4 - str r0, [sp, 0x30] - subs r0, 0x22 - str r0, [sp, 0x1C] - subs r0, 0x2 - str r0, [sp, 0x18] - adds r0, 0x4 - str r0, [sp, 0x24] - adds r0, r6, 0x2 - str r0, [sp, 0x4] - adds r0, r6, 0x4 - str r0, [sp, 0x8] - adds r0, r6, 0x6 - str r0, [sp, 0xC] - adds r0, 0x2 - str r0, [sp, 0x10] - adds r0, 0x2 - str r0, [sp, 0x14] - mov r9, r4 - adds r7, r6, 0 - adds r7, 0x24 - adds r4, r6, 0 - adds r4, 0xC -_081BC682: - mov r1, r8 - adds r1, 0xD - mov r0, r9 - adds r2, r4, 0 - bl pokemon_setattr - mov r1, r8 - adds r1, 0x11 - mov r0, r9 - adds r2, r7, 0 - bl pokemon_setattr - adds r7, 0x1 - adds r4, 0x2 - movs r0, 0x1 - add r8, r0 - mov r0, r8 - cmp r0, 0x3 - ble _081BC682 - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x15 - mov r2, r10 - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x20 - ldr r2, [sp, 0x20] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x19 - ldr r2, [sp, 0x28] - bl pokemon_setattr - ldrb r0, [r6, 0x14] - lsls r0, 27 - lsrs r0, 27 - mov r1, sp - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x27 - mov r2, sp - bl pokemon_setattr - mov r1, sp - ldrh r0, [r6, 0x14] - lsls r0, 22 - lsrs r0, 27 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x28 - mov r2, sp - bl pokemon_setattr - mov r1, sp - ldrb r0, [r6, 0x15] - lsls r0, 25 - lsrs r0, 27 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x29 - mov r2, sp - bl pokemon_setattr - mov r1, sp - ldr r0, [r6, 0x14] - lsls r0, 12 - lsrs r0, 27 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x2A - mov r2, sp - bl pokemon_setattr - mov r1, sp - ldrh r0, [r6, 0x16] - lsls r0, 23 - lsrs r0, 27 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x2B - mov r2, sp - bl pokemon_setattr - mov r1, sp - ldrb r0, [r6, 0x17] - lsls r0, 26 - lsrs r0, 27 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x2C - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0 - ldr r2, [sp, 0x2C] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x37 - ldr r2, [sp, 0x30] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x38 - ldr r2, [sp, 0x1C] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x39 - ldr r2, [sp, 0x18] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3A - ldr r2, [sp, 0x24] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3B - ldr r2, [sp, 0x4] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3C - ldr r2, [sp, 0x8] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3D - ldr r2, [sp, 0xC] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3E - ldr r2, [sp, 0x10] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3F - ldr r2, [sp, 0x14] - bl pokemon_setattr - b _081BCEAE - .pool -_081BC7B4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0xB - bl pokemon_setattr - b _081BCEAE - .pool -_081BC7D4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0xC - bl pokemon_setattr - b _081BCEAE - .pool -_081BC7F4: - movs r0, 0 - mov r8, r0 - movs r0, 0xC - adds r0, r3 - mov r9, r0 - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r7, r1, r0 - adds r6, r3, 0 - adds r6, 0x8 - adds r4, r3, 0 -_081BC80E: - mov r1, r8 - adds r1, 0xD - adds r0, r7, 0 - adds r2, r4, 0 - bl pokemon_setattr - mov r1, r8 - adds r1, 0x11 - adds r0, r7, 0 - adds r2, r6, 0 - bl pokemon_setattr - adds r6, 0x1 - adds r4, 0x2 - movs r0, 0x1 - add r8, r0 - mov r0, r8 - cmp r0, 0x3 - ble _081BC80E - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x15 - mov r2, r9 - bl pokemon_setattr - b _081BCEAE - .pool -_081BC84C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r3, =0x02023064 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r1, r3, 0x1 - adds r1, r2, r1 - ldrb r1, [r1] - adds r1, 0x9 - b _081BC8F0 - .pool -_081BC874: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - ldr r5, =0x02024064 - ldrb r2, [r5] - lsls r2, 9 - adds r2, r7 - adds r0, r4, 0 - movs r1, 0x11 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x1 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x12 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x2 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x13 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x3 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x14 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x4 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x15 - bl pokemon_setattr - b _081BCEAE - .pool -_081BC8D8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r3, =0x02023064 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r1, r3, 0x1 - adds r1, r2, r1 - ldrb r1, [r1] - adds r1, 0x8 -_081BC8F0: - adds r3, 0x3 - adds r2, r3 - bl pokemon_setattr - b _081BCEAE - .pool -_081BC908: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1 - bl pokemon_setattr - b _081BCEAE - .pool -_081BC928: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x19 - bl pokemon_setattr - b _081BCEAE - .pool -_081BC948: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1A - bl pokemon_setattr - b _081BCEAE - .pool -_081BC968: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1B - bl pokemon_setattr - b _081BCEAE - .pool -_081BC988: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1C - bl pokemon_setattr - b _081BCEAE - .pool -_081BC9A8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1D - bl pokemon_setattr - b _081BCEAE - .pool -_081BC9C8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1E - bl pokemon_setattr - b _081BCEAE - .pool -_081BC9E8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1F - bl pokemon_setattr - b _081BCEAE - .pool -_081BCA08: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x20 - bl pokemon_setattr - b _081BCEAE - .pool -_081BCA28: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x22 - bl pokemon_setattr - b _081BCEAE - .pool -_081BCA48: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x23 - bl pokemon_setattr - b _081BCEAE - .pool -_081BCA68: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x24 - bl pokemon_setattr - b _081BCEAE - .pool -_081BCA88: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x25 - bl pokemon_setattr - b _081BCEAE - .pool -_081BCAA8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x26 - bl pokemon_setattr - b _081BCEAE - .pool -_081BCAC8: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - ldr r5, =0x02024064 - ldrb r2, [r5] - lsls r2, 9 - adds r2, r7 - adds r0, r4, 0 - movs r1, 0x27 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x1 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x28 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x2 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x29 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x3 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x2A - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x4 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x2B - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x5 - adds r2, r0 - adds r0, r4, 0 - b _081BCBE8 - .pool -_081BCB38: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x27 - bl pokemon_setattr - b _081BCEAE - .pool -_081BCB58: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x28 - bl pokemon_setattr - b _081BCEAE - .pool -_081BCB78: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x29 - bl pokemon_setattr - b _081BCEAE - .pool -_081BCB98: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x2A - bl pokemon_setattr - b _081BCEAE - .pool -_081BCBB8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x2B - bl pokemon_setattr - b _081BCEAE - .pool -_081BCBD8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 -_081BCBE8: - movs r1, 0x2C - bl pokemon_setattr - b _081BCEAE - .pool -_081BCBF8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0 - bl pokemon_setattr - b _081BCEAE - .pool -_081BCC18: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x9 - bl pokemon_setattr - b _081BCEAE - .pool -_081BCC38: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x37 - bl pokemon_setattr - b _081BCEAE - .pool -_081BCC58: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x38 - bl pokemon_setattr - b _081BCEAE - .pool -_081BCC78: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x39 - bl pokemon_setattr - b _081BCEAE - .pool -_081BCC98: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3A - bl pokemon_setattr - b _081BCEAE - .pool -_081BCCB8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3B - bl pokemon_setattr - b _081BCEAE - .pool -_081BCCD8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3C - bl pokemon_setattr - b _081BCEAE - .pool -_081BCCF8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3D - bl pokemon_setattr - b _081BCEAE - .pool -_081BCD18: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3E - bl pokemon_setattr - b _081BCEAE - .pool -_081BCD38: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3F - bl pokemon_setattr - b _081BCEAE - .pool -_081BCD58: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x16 - bl pokemon_setattr - b _081BCEAE - .pool -_081BCD78: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x17 - bl pokemon_setattr - b _081BCEAE - .pool -_081BCD98: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x18 - bl pokemon_setattr - b _081BCEAE - .pool -_081BCDB8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x21 - bl pokemon_setattr - b _081BCEAE - .pool -_081BCDD8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x2F - bl pokemon_setattr - b _081BCEAE - .pool -_081BCDF8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x30 - bl pokemon_setattr - b _081BCEAE - .pool -_081BCE18: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x32 - bl pokemon_setattr - b _081BCEAE - .pool -_081BCE38: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x33 - bl pokemon_setattr - b _081BCEAE - .pool -_081BCE58: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x34 - bl pokemon_setattr - b _081BCEAE - .pool -_081BCE78: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x35 - bl pokemon_setattr - b _081BCEAE - .pool -_081BCE98: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x36 - bl pokemon_setattr -_081BCEAE: - ldr r2, =0x0202406e - ldr r0, =0x02024064 - ldrb r1, [r0] - lsls r0, r1, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =0x020244ec - adds r0, r2 - bl sub_805E990 - add sp, 0x34 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BC4E8 - - thumb_func_start sub_81BCEE4 -sub_81BCEE4: @ 81BCEE4 - push {r4-r7,lr} - ldr r1, =0x0202406e - ldr r7, =0x02024064 - ldrb r2, [r7] - lsls r0, r2, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - adds r3, r1, 0 - muls r3, r0 - ldr r4, =0x02023064 - lsls r2, 9 - adds r0, r4, 0x1 - adds r0, r2, r0 - ldrb r0, [r0] - ldr r1, =0x020244ec - adds r0, r1 - adds r5, r3, r0 - movs r3, 0 - adds r0, r4, 0x2 - adds r2, r0 - ldrb r2, [r2] - cmp r3, r2 - bcs _081BCF3C - adds r6, r4, 0 - adds r2, r7, 0 - adds r4, r0, 0 -_081BCF1A: - adds r1, r5, r3 - ldrb r0, [r2] - lsls r0, 9 - adds r0, 0x3 - adds r0, r3, r0 - adds r0, r6 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - ldrb r0, [r2] - lsls r0, 9 - adds r0, r4 - ldrb r0, [r0] - cmp r3, r0 - bcc _081BCF1A -_081BCF3C: - bl dp01_tbl3_exec_completed - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BCEE4 - - thumb_func_start sub_81BCF58 -sub_81BCF58: @ 81BCF58 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r0, =0x0202406e - mov r8, r0 - ldr r6, =0x02024064 - ldrb r1, [r6] - lsls r0, r1, 1 - add r0, r8 - ldrh r0, [r0] - movs r5, 0x64 - muls r0, r5 - ldr r4, =0x020244ec - adds r0, r4 - bl sub_805DD7C - ldrb r0, [r6] - lsls r0, 1 - add r0, r8 - ldrh r0, [r0] - muls r0, r5 - adds r0, r4 - movs r1, 0xB - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldrb r0, [r6] - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_806A068 - ldr r0, =0x0202499c - mov r8, r0 - ldrb r0, [r6] - movs r1, 0x2 - bl sub_80A5C6C - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldrb r0, [r6] - bl sub_80A6138 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldrb r0, [r6] - bl sub_80A82E4 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - mov r0, r8 - adds r1, r5, 0 - adds r2, r4, 0 - bl AddObjectToFront - ldr r4, =0x020241e4 - ldrb r1, [r6] - adds r1, r4 - strb r0, [r1] - ldr r5, =0x02020630 - ldrb r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =0x0000ff10 - strh r1, [r0, 0x24] - ldrb r2, [r6] - adds r0, r2, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x2E] - ldrb r3, [r6] - adds r0, r3, r4 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - lsls r3, 4 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x5] - ldrb r2, [r6] - adds r4, r2, r4 - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =0x020244e4 - adds r2, r1 - ldrb r1, [r2] - bl StartObjectImageAnim - ldr r1, =0x03005d60 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_81BB1D4 - str r1, [r0] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BCF58 - - thumb_func_start sub_81BD074 -sub_81BD074: @ 81BD074 - push {r4-r6,lr} - ldr r5, =0x02024064 - ldrb r0, [r5] - ldr r4, =0x02023064 - lsls r1, r0, 9 - adds r6, r4, 0x2 - adds r1, r6 - ldrb r1, [r1] - bl sub_805EF84 - ldr r2, =0x0202406e - ldrb r0, [r5] - lsls r1, r0, 1 - adds r1, r2 - lsls r0, 9 - adds r4, 0x1 - adds r0, r4 - ldrb r0, [r0] - strh r0, [r1] - ldrb r1, [r5] - lsls r0, r1, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =0x020244ec - adds r0, r2 - bl sub_805DD7C - ldrb r0, [r5] - lsls r1, r0, 9 - adds r1, r6 - ldrb r1, [r1] - bl sub_81BD0E4 - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_81BBAE8 - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BD074 - - thumb_func_start sub_81BD0E4 -sub_81BD0E4: @ 81BD0E4 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - lsls r1, 24 - lsrs r1, 24 - adds r0, r6, 0 - bl sub_805EF84 - ldr r0, =0x0202406e - lsls r2, r6, 1 - adds r2, r0 - ldr r0, =0x02023064 - lsls r1, r6, 9 - adds r0, 0x1 - adds r1, r0 - ldrb r0, [r1] - strh r0, [r2] - ldrh r1, [r2] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - mov r8, r0 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldr r0, =sub_805D714 - bl object_new_hidden_with_callback - ldr r1, =0x03005d7c - mov r9, r1 - add r9, r6 - mov r1, r9 - strb r0, [r1] - adds r0, r6, 0 - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, r8 - bl sub_806A068 - ldr r0, =0x0202499c - mov r10, r0 - adds r0, r6, 0 - movs r1, 0x2 - bl sub_80A5C6C - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - adds r0, r6, 0 - bl sub_80A6138 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r6, 0 - bl sub_80A82E4 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - mov r0, r10 - adds r1, r5, 0 - adds r2, r4, 0 - bl AddObjectToFront - ldr r4, =0x020241e4 - adds r4, r6, r4 - strb r0, [r4] - ldr r5, =0x02020630 - mov r0, r9 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r1, [r4] - strh r1, [r0, 0x30] - mov r0, r9 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r6, [r0, 0x32] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r6, [r0, 0x2E] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - mov r1, r8 - strh r1, [r0, 0x32] - ldrb r0, [r4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - lsls r3, r6, 4 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x5] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =0x020244e4 - adds r6, r1 - ldrb r1, [r6] - bl StartObjectImageAnim - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r5, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =DummyObjectCallback - str r1, [r0] - movs r0, 0 - movs r1, 0xFF - bl sub_80753E8 - mov r1, r9 - ldrb r2, [r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r5 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1, 0x2E] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BD0E4 - - thumb_func_start sub_81BD260 -sub_81BD260: @ 81BD260 - push {r4-r6,lr} - ldr r1, =0x02023064 - ldr r6, =0x02024064 - ldrb r2, [r6] - lsls r0, r2, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r3, [r0] - cmp r3, 0 - bne _081BD2A8 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - strb r3, [r0, 0x4] - ldr r1, =0x03005d60 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_81BD2F0 - str r1, [r0] - b _081BD2DE - .pool -_081BD2A8: - ldr r5, =0x020241e4 - adds r0, r2, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl obj_free_rotscale_entry - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r1, =0x03005d70 - ldrb r0, [r6] - adds r0, r1 - ldrb r0, [r0] - bl sub_8072984 - bl dp01_tbl3_exec_completed -_081BD2DE: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BD260 - - thumb_func_start sub_81BD2F0 -sub_81BD2F0: @ 81BD2F0 - push {r4-r6,lr} - ldr r6, =0x020244d0 - ldr r4, [r6] - ldr r5, =0x02024064 - ldrb r2, [r5] - ldr r1, [r4, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r3, r0, r1 - ldrb r0, [r3, 0x4] - cmp r0, 0 - beq _081BD318 - cmp r0, 0x1 - beq _081BD346 - b _081BD36E - .pool -_081BD318: - ldr r1, [r4] - lsls r0, r2, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _081BD332 - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x5 - bl move_anim_start_t4 -_081BD332: - ldr r0, [r6] - ldrb r1, [r5] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x1 - strb r1, [r0, 0x4] - b _081BD36E -_081BD346: - ldrb r1, [r3] - movs r0, 0x40 - ands r0, r1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _081BD36E - strb r0, [r3, 0x4] - ldrb r2, [r5] - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x1 - bl move_anim_start_t4 - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_81BB828 - str r1, [r0] -_081BD36E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BD2F0 - - thumb_func_start sub_81BD37C -sub_81BD37C: @ 81BD37C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r2, =0x02038bce - ldrh r1, [r2] - ldr r0, =0x00000c03 - cmp r1, r0 - bne _081BD3A8 - movs r4, 0x7 - movs r0, 0x5A - mov r9, r0 - ldr r0, =gUnknown_08305D2C - ldrb r1, [r0, 0x1C] - b _081BD3BE - .pool -_081BD3A8: - ldrh r0, [r2] - bl sub_8162AA0 - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x20 - mov r9, r0 - ldr r1, =gUnknown_083054E0 - lsls r0, r4, 2 - adds r0, r1 - ldrb r1, [r0] -_081BD3BE: - movs r0, 0x8 - subs r0, r1 - lsls r0, 18 - movs r1, 0xA0 - lsls r1, 15 - adds r0, r1 - lsrs r7, r0, 16 - ldr r0, =0x02038bce - ldrh r1, [r0] - ldr r0, =0x00000c03 - cmp r1, r0 - bne _081BD494 - ldr r5, =0x02024064 - ldrb r1, [r5] - adds r0, r4, 0 - bl sub_805DF84 - ldrb r0, [r5] - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl template_build_for_pokemon_or_trainer - ldr r6, =0x0202499c - mov r8, r9 - lsls r4, r7, 16 - asrs r4, 16 - ldrb r0, [r5] - bl sub_80A82E4 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r6, 0 - mov r1, r8 - adds r2, r4, 0 - bl AddObjectToFront - ldr r6, =0x020241e4 - ldrb r1, [r5] - adds r1, r6 - strb r0, [r1] - ldr r4, =0x02020630 - ldrb r3, [r5] - adds r0, r3, r6 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - lsls r3, 4 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x5] - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xF0 - strh r1, [r0, 0x24] - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =0x0000fffe - strh r1, [r0, 0x2E] - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, 0x1C - adds r0, r4 - ldr r1, =sub_805D7AC - str r1, [r0] - b _081BD57C - .pool -_081BD494: - adds r5, r4, 0 - ldr r6, =0x02024064 - ldrb r1, [r6] - adds r0, r5, 0 - bl sub_805DF38 - ldrb r0, [r6] - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl sub_806A1C0 - ldr r0, =0x0202499c - mov r8, r0 - lsls r4, r7, 16 - asrs r4, 16 - ldrb r0, [r6] - bl sub_80A82E4 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - mov r0, r8 - mov r1, r9 - adds r2, r4, 0 - bl AddObjectToFront - ldr r4, =0x020241e4 - ldrb r1, [r6] - adds r1, r4 - strb r0, [r1] - ldr r0, =gTrainerFrontPicPaletteTable - lsls r5, 3 - adds r5, r0 - ldrh r0, [r5, 0x4] - bl IndexOfObjectPaletteTag - ldr r5, =0x02020630 - ldrb r1, [r6] - adds r1, r4 - ldrb r1, [r1] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - adds r2, r5 - lsls r0, 4 - ldrb r3, [r2, 0x5] - movs r1, 0xF - ands r1, r3 - orrs r1, r0 - strb r1, [r2, 0x5] - ldrb r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0xF0 - strh r1, [r0, 0x24] - ldrb r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x30 - strh r1, [r0, 0x26] - ldrb r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =0x0000fffe - strh r1, [r0, 0x2E] - ldrb r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r5, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_805D7AC - str r1, [r0] - ldrb r0, [r6] - adds r0, r4 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r2, [r1, 0x1] - movs r0, 0x4 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1] - ldrb r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3F - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] -_081BD57C: - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_81BAE60 - str r1, [r0] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BD37C - - thumb_func_start sub_81BD5BC -sub_81BD5BC: @ 81BD5BC - push {lr} - bl dp01_tbl3_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81BD5BC - - thumb_func_start sub_81BD5C8 -sub_81BD5C8: @ 81BD5C8 - push {r4-r6,lr} - ldr r6, =0x020241e4 - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =0x02020630 - adds r0, r5 - bl oamt_add_pos2_onto_pos1 - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x23 - strh r1, [r0, 0x2E] - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =0x0000ffd8 - strh r1, [r0, 0x32] - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrh r1, [r0, 0x22] - strh r1, [r0, 0x36] - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r5, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_80A6EEC - str r1, [r0] - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =DummyObjectCallback - bl oamt_set_x3A_32 - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_81BAE98 - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BD5C8 - - thumb_func_start sub_81BD674 -sub_81BD674: @ 81BD674 - push {r4-r6,lr} - ldr r6, =0x020244d0 - ldr r4, [r6] - ldr r5, =0x02024064 - ldrb r2, [r5] - ldr r0, [r4, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r3, r1, r0 - ldrb r0, [r3, 0x4] - cmp r0, 0 - bne _081BD6C8 - ldr r1, [r4] - lsls r0, r2, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _081BD6A8 - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x5 - bl move_anim_start_t4 -_081BD6A8: - ldr r0, [r6] - ldrb r1, [r5] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x4] - adds r1, 0x1 - strb r1, [r0, 0x4] - b _081BD73E - .pool -_081BD6C8: - ldrb r1, [r3] - movs r0, 0x40 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _081BD73E - strb r4, [r3, 0x4] - ldr r2, =0x0202406e - ldrb r1, [r5] - lsls r0, r1, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =0x020244ec - adds r0, r2 - bl sub_805E990 - movs r1, 0x40 - negs r1, r1 - movs r0, 0x10 - bl audio_play_and_stuff - ldr r2, =0x02020630 - ldr r3, =0x020241e4 - ldrb r0, [r5] - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r4, [r0, 0x30] - ldrb r0, [r5] - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x5 - strh r1, [r0, 0x32] - ldrb r0, [r5] - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_8039C00 - str r1, [r0] - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_81BB78C - str r1, [r0] -_081BD73E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BD674 - - thumb_func_start sub_81BD760 -sub_81BD760: @ 81BD760 - push {lr} - bl dp01_tbl3_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81BD760 - - thumb_func_start sub_81BD76C -sub_81BD76C: @ 81BD76C - push {lr} - bl dp01_tbl3_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81BD76C - - thumb_func_start sub_81BD778 -sub_81BD778: @ 81BD778 - push {lr} - bl dp01_tbl3_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81BD778 - - thumb_func_start sub_81BD784 -sub_81BD784: @ 81BD784 - push {lr} - bl dp01_tbl3_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81BD784 - - thumb_func_start sub_81BD790 -sub_81BD790: @ 81BD790 - push {r4-r6,lr} - ldr r6, =0x02024064 - ldrb r0, [r6] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - beq _081BD7A2 - b _081BD8B6 -_081BD7A2: - ldr r0, =0x02023064 - mov r12, r0 - ldrb r2, [r6] - lsls r2, 9 - adds r0, 0x1 - adds r0, r2, r0 - ldrb r0, [r0] - mov r1, r12 - adds r1, 0x2 - adds r1, r2, r1 - ldrb r1, [r1] - lsls r1, 8 - orrs r0, r1 - ldr r5, =0x02038432 - mov r1, r12 - adds r1, 0x3 - adds r2, r1 - ldrb r1, [r2] - strb r1, [r5] - ldr r4, =0x02038408 - ldrb r2, [r6] - lsls r2, 9 - mov r1, r12 - adds r1, 0x4 - adds r1, r2, r1 - ldrb r3, [r1] - mov r1, r12 - adds r1, 0x5 - adds r2, r1 - ldrb r1, [r2] - lsls r1, 8 - orrs r3, r1 - strh r3, [r4] - ldr r4, =0x02038404 - ldrb r2, [r6] - lsls r2, 9 - mov r1, r12 - adds r1, 0x6 - adds r1, r2, r1 - ldrb r3, [r1] - mov r1, r12 - adds r1, 0x7 - adds r1, r2, r1 - ldrb r1, [r1] - lsls r1, 8 - orrs r3, r1 - mov r1, r12 - adds r1, 0x8 - adds r1, r2, r1 - ldrb r1, [r1] - lsls r1, 16 - orrs r3, r1 - mov r1, r12 - adds r1, 0x9 - adds r2, r1 - ldrb r1, [r2] - lsls r1, 24 - orrs r3, r1 - str r3, [r4] - ldr r3, =0x0203841a - ldrb r1, [r6] - lsls r1, 9 - mov r2, r12 - adds r2, 0xA - adds r1, r2 - ldrb r1, [r1] - strb r1, [r3] - ldr r4, =0x0203841c - ldrb r2, [r6] - lsls r2, 9 - mov r1, r12 - adds r1, 0xC - adds r1, r2, r1 - ldrb r3, [r1] - mov r1, r12 - adds r1, 0xD - adds r2, r1 - ldrb r1, [r2] - lsls r1, 8 - orrs r3, r1 - strh r3, [r4] - ldr r3, =0x02038400 - ldrb r2, [r6] - lsls r2, 9 - mov r1, r12 - adds r1, 0x10 - adds r2, r1 - str r2, [r3] - ldr r3, =0x020244bc - ldrb r1, [r6] - lsls r1, 2 - adds r1, r3 - ldr r2, [r2] - str r2, [r1] - ldrb r1, [r5] - bl sub_805DB8C - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - beq _081BD898 - bl dp01_tbl3_exec_completed - b _081BD8B6 - .pool -_081BD898: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldrb r1, [r6] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strb r3, [r0, 0x4] - ldr r1, =0x03005d60 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_move_anim_3 - str r1, [r0] -_081BD8B6: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BD790 - - thumb_func_start bx_move_anim_3 -bx_move_anim_3: @ 81BD8C8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r2, =0x02023064 - ldr r6, =0x02024064 - ldrb r3, [r6] - lsls r1, r3, 9 - adds r0, r2, 0x1 - mov r10, r0 - adds r0, r1, r0 - ldrb r4, [r0] - adds r5, r2, 0x2 - mov r9, r5 - adds r0, r1, r5 - ldrb r0, [r0] - lsls r0, 8 - orrs r4, r0 - adds r2, 0xB - adds r1, r2 - ldrb r1, [r1] - mov r8, r1 - ldr r7, =0x020244d0 - ldr r5, [r7] - ldr r1, [r5, 0x4] - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r2, [r0, 0x4] - cmp r2, 0x1 - beq _081BD960 - cmp r2, 0x1 - bgt _081BD920 - cmp r2, 0 - beq _081BD92A - b _081BDA3C - .pool -_081BD920: - cmp r2, 0x2 - beq _081BD98A - cmp r2, 0x3 - beq _081BDA00 - b _081BDA3C -_081BD92A: - ldr r1, [r5] - lsls r0, r3, 2 - adds r1, r0, r1 - ldrb r2, [r1] - movs r0, 0xC - ands r0, r2 - cmp r0, 0x4 - bne _081BD94C - movs r0, 0x8 - orrs r0, r2 - strb r0, [r1] - ldrb r2, [r6] - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x5 - bl move_anim_start_t4 -_081BD94C: - ldr r0, [r7] - ldrb r1, [r6] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x1 - strb r1, [r0, 0x4] - b _081BDA3C -_081BD960: - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _081BDA3C - movs r0, 0 - bl sub_805EB9C - adds r0, r4, 0 - bl move_anim_start_t1 - ldr r0, [r7] - ldrb r1, [r6] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x2 - strb r1, [r0, 0x4] - b _081BDA3C -_081BD98A: - ldr r0, =0x020383f8 - ldr r0, [r0] - bl _call_via_r0 - ldr r0, =0x020383fd - ldrb r0, [r0] - cmp r0, 0 - bne _081BDA3C - movs r0, 0x1 - bl sub_805EB9C - ldr r0, [r7] - ldrb r2, [r6] - ldr r1, [r0] - lsls r0, r2, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _081BD9D8 - mov r0, r8 - cmp r0, 0x1 - bhi _081BD9D8 - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x6 - bl move_anim_start_t4 - ldr r0, [r7] - ldrb r1, [r6] - ldr r0, [r0] - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - strb r0, [r1] -_081BD9D8: - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x3 - strb r1, [r0, 0x4] - b _081BDA3C - .pool -_081BDA00: - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _081BDA3C - bl sub_805E394 - ldrb r0, [r6] - lsls r2, r0, 9 - mov r3, r10 - adds r1, r2, r3 - ldrb r1, [r1] - add r2, r9 - ldrb r2, [r2] - lsls r2, 8 - orrs r1, r2 - bl sub_805E94C - ldr r0, [r7] - ldrb r1, [r6] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strb r4, [r0, 0x4] - bl dp01_tbl3_exec_completed -_081BDA3C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end bx_move_anim_3 - - thumb_func_start sub_81BDA4C -sub_81BDA4C: @ 81BDA4C - push {r4,lr} - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r0, 9 - ldr r1, =0x02023066 - adds r0, r1 - ldrh r0, [r0] - bl battle_pick_message - ldr r0, =0x02022e2c - movs r1, 0 - bl battle_show_message_maybe - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_81BB898 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BDA4C - - thumb_func_start sub_81BDAA0 -sub_81BDAA0: @ 81BDAA0 - push {lr} - bl dp01_tbl3_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81BDAA0 - - thumb_func_start sub_81BDAAC -sub_81BDAAC: @ 81BDAAC - push {lr} - bl sub_8063880 - bl dp01_tbl3_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81BDAAC - - thumb_func_start sub_81BDABC -sub_81BDABC: @ 81BDABC - push {lr} - bl dp01_tbl3_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81BDABC - - thumb_func_start sub_81BDAC8 -sub_81BDAC8: @ 81BDAC8 - push {r4-r6,lr} - ldr r6, =0x02024064 - ldrb r4, [r6] - lsls r4, 9 - ldr r0, =0x02023068 - adds r4, r0 - movs r0, 0xF - bl sub_8130950 - bl sub_8130BA4 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r2, =gBattleMoves - lsls r0, r5, 1 - adds r4, r0 - ldrh r1, [r4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x6] - movs r0, 0x12 - ands r0, r1 - cmp r0, 0 - beq _081BDB02 - ldr r1, =0x0202420c - ldrb r0, [r6] - strb r0, [r1] -_081BDB02: - ldrh r1, [r4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x6] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _081BDB3C - movs r0, 0x1 - bl battle_get_side_with_given_state - ldr r4, =0x0202420c - strb r0, [r4] - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _081BDB3C - movs r0, 0x3 - bl battle_get_side_with_given_state - strb r0, [r4] -_081BDB3C: - ldr r0, =0x0202420c - ldrb r2, [r0] - lsls r2, 8 - orrs r2, r5 - movs r0, 0x1 - movs r1, 0xA - bl dp01_build_cmdbuf_x21_a_bb - bl dp01_tbl3_exec_completed - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BDAC8 - - thumb_func_start sub_81BDB70 -sub_81BDB70: @ 81BDB70 - push {lr} - bl dp01_tbl3_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81BDB70 - - thumb_func_start sub_81BDB7C -sub_81BDB7C: @ 81BDB7C - push {r4-r6,lr} - bl sub_8063A90 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x6 - bne _081BDBD0 - movs r0, 0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r6, r0, 24 - movs r0, 0x2 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0x3 - b _081BDBA4 -_081BDBA2: - adds r4, 0x1 -_081BDBA4: - cmp r4, 0x5 - bgt _081BDBD0 - movs r0, 0x64 - muls r0, r4 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _081BDBA2 - ldr r1, =0x0202406e - lsls r0, r6, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r4, r0 - beq _081BDBA2 - lsls r0, r5, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r4, r0 - beq _081BDBA2 -_081BDBD0: - ldr r0, =0x02024064 - ldrb r0, [r0] - ldr r1, =0x0202449c - ldr r1, [r1] - adds r0, r1 - adds r0, 0x5C - strb r4, [r0] - lsls r1, r4, 24 - lsrs r1, 24 - movs r0, 0x1 - movs r2, 0 - bl dp01_build_cmdbuf_x22_a_three_bytes - bl dp01_tbl3_exec_completed - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BDB7C - - thumb_func_start sub_81BDC04 -sub_81BDC04: @ 81BDC04 - push {lr} - bl dp01_tbl3_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81BDC04 - - thumb_func_start sub_81BDC10 -sub_81BDC10: @ 81BDC10 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - movs r0, 0 - bl load_gfxc_health_bar - ldr r3, =0x02023064 - ldr r0, =0x02024064 - mov r9, r0 - ldrb r4, [r0] - lsls r2, r4, 9 - adds r0, r3, 0x2 - adds r0, r2, r0 - ldrb r1, [r0] - adds r3, 0x3 - adds r2, r3 - ldrb r0, [r2] - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - asrs r7, r1, 16 - ldr r0, =0x00007fff - cmp r7, r0 - beq _081BDCA0 - ldr r6, =0x0202406e - lsls r0, r4, 1 - adds r0, r6 - ldrh r0, [r0] - movs r5, 0x64 - muls r0, r5 - ldr r4, =0x020244ec - adds r0, r4 - movs r1, 0x3A - bl pokemon_getattr - mov r8, r0 - mov r1, r9 - ldrb r0, [r1] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - muls r0, r5 - adds r0, r4 - movs r1, 0x39 - bl pokemon_getattr - adds r3, r0, 0 - mov r1, r9 - ldrb r0, [r1] - ldr r1, =0x03005d70 - adds r1, r0, r1 - ldrb r1, [r1] - str r7, [sp] - mov r2, r8 - bl sub_807294C - b _081BDCCA - .pool -_081BDCA0: - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3A - bl pokemon_getattr - adds r2, r0, 0 - mov r1, r9 - ldrb r0, [r1] - ldr r1, =0x03005d70 - adds r1, r0, r1 - ldrb r1, [r1] - str r7, [sp] - movs r3, 0 - bl sub_807294C -_081BDCCA: - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_t3_healthbar_update - str r1, [r0] - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BDC10 - - thumb_func_start sub_81BDD00 -sub_81BDD00: @ 81BDD00 - push {r4-r7,lr} - ldr r5, =0x02023064 - ldr r6, =0x02024064 - ldrb r0, [r6] - lsls r0, 9 - adds r1, r5, 0x1 - adds r0, r1 - ldrb r7, [r0] - movs r0, 0x64 - adds r1, r7, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x38 - bl pokemon_getattr - cmp r0, 0x63 - bls _081BDD38 - bl dp01_tbl3_exec_completed - b _081BDD84 - .pool -_081BDD38: - movs r0, 0x1 - bl load_gfxc_health_bar - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - ldrb r1, [r6] - lsls r1, 9 - adds r0, r5, 0x2 - adds r0, r1, r0 - ldrb r4, [r0] - adds r0, r5, 0x3 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 8 - orrs r4, r0 - ldr r0, =sub_81BB29C - movs r1, 0xA - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r7, [r1, 0x8] - strh r4, [r1, 0xA] - ldrb r0, [r6] - strh r0, [r1, 0xC] - ldr r1, =0x03005d60 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =nullsub_21 - str r1, [r0] -_081BDD84: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BDD00 - - thumb_func_start sub_81BDD9C -sub_81BDD9C: @ 81BDD9C - push {r4,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _081BDDF0 - ldr r0, =0x03005d70 - ldrb r1, [r4] - adds r0, r1, r0 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x020244ec - adds r1, r2 - movs r2, 0x9 - bl healthbar_draw_field_maybe - ldrb r2, [r4] - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x11 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_81BBC04 - str r1, [r0] -_081BDDF0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BDD9C - - thumb_func_start sub_81BDE14 -sub_81BDE14: @ 81BDE14 - push {r4,r5,lr} - ldr r5, =0x02024064 - ldrb r0, [r5] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _081BDE64 - ldr r4, =0x02023064 - ldrb r3, [r5] - lsls r3, 9 - adds r0, r4, 0x1 - adds r0, r3, r0 - ldrb r0, [r0] - adds r1, r4, 0x2 - adds r1, r3, r1 - ldrb r1, [r1] - adds r2, r4, 0x3 - adds r2, r3, r2 - ldrb r2, [r2] - lsls r2, 8 - orrs r1, r2 - adds r2, r4, 0x4 - adds r2, r3, r2 - ldrb r2, [r2] - lsls r2, 16 - orrs r1, r2 - adds r4, 0x5 - adds r3, r4 - ldrb r2, [r3] - lsls r2, 24 - orrs r1, r2 - bl move_anim_start_t2_for_situation - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_81BBC04 - str r1, [r0] -_081BDE64: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BDE14 - - thumb_func_start sub_81BDE7C -sub_81BDE7C: @ 81BDE7C - push {lr} - bl dp01_tbl3_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81BDE7C - - thumb_func_start sub_81BDE88 -sub_81BDE88: @ 81BDE88 - push {lr} - bl dp01_tbl3_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81BDE88 - - thumb_func_start sub_81BDE94 -sub_81BDE94: @ 81BDE94 - push {lr} - bl dp01_tbl3_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81BDE94 - - thumb_func_start sub_81BDEA0 -sub_81BDEA0: @ 81BDEA0 - push {lr} - bl dp01_tbl3_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81BDEA0 - - thumb_func_start sub_81BDEAC -sub_81BDEAC: @ 81BDEAC - push {lr} - bl dp01_tbl3_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81BDEAC - - thumb_func_start sub_81BDEB8 -sub_81BDEB8: @ 81BDEB8 - push {lr} - bl dp01_tbl3_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81BDEB8 - - thumb_func_start sub_81BDEC4 -sub_81BDEC4: @ 81BDEC4 - push {lr} - bl dp01_tbl3_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81BDEC4 - - thumb_func_start sub_81BDED0 -sub_81BDED0: @ 81BDED0 - push {lr} - bl dp01_tbl3_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81BDED0 - - thumb_func_start sub_81BDEDC -sub_81BDEDC: @ 81BDEDC - push {lr} - bl dp01_tbl3_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81BDEDC - - thumb_func_start sub_81BDEE8 -sub_81BDEE8: @ 81BDEE8 - push {lr} - ldr r2, =0x02022d0c - ldrb r1, [r2] - movs r0, 0x80 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - bl dp01_tbl3_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BDEE8 - - thumb_func_start sub_81BDF04 -sub_81BDF04: @ 81BDF04 - push {lr} - ldr r3, =0x02022d0c - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - movs r1, 0x7F - ands r1, r0 - ldrb r2, [r3] - movs r0, 0x80 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - bl dp01_tbl3_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BDF04 - - thumb_func_start sub_81BDF3C -sub_81BDF3C: @ 81BDF3C - push {lr} - ldr r2, =0x02022d0c - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - bl dp01_tbl3_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BDF3C - - thumb_func_start sub_81BDF54 -sub_81BDF54: @ 81BDF54 - push {lr} - ldr r3, =0x02022d0c - ldr r1, [r3] - lsls r1, 24 - lsrs r1, 31 - movs r0, 0x1 - eors r1, r0 - lsls r1, 7 - ldrb r2, [r3] - movs r0, 0x7F - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - bl dp01_tbl3_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BDF54 - - thumb_func_start dp01t_29_3_blink -dp01t_29_3_blink: @ 81BDF7C - push {r4,lr} - ldr r3, =0x02020630 - ldr r2, =0x020241e4 - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - bge _081BDFB0 - bl dp01_tbl3_exec_completed - b _081BDFDA - .pool -_081BDFB0: - ldr r1, =0x020244b9 - movs r0, 0x1 - strb r0, [r1] - ldrb r0, [r4] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0 - strh r1, [r0, 0x30] - ldrb r0, [r4] - bl sub_80769F4 - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_blink_t3 - str r1, [r0] -_081BDFDA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_29_3_blink - - thumb_func_start sub_81BDFEC -sub_81BDFEC: @ 81BDFEC - push {lr} - bl dp01_tbl3_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81BDFEC - - thumb_func_start sub_81BDFF8 -sub_81BDFF8: @ 81BDFF8 - push {r4,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - movs r3, 0x3F - cmp r0, 0 - bne _081BE00C - movs r3, 0xC0 -_081BE00C: - ldr r2, =0x02023064 - ldrb r1, [r4] - lsls r1, 9 - adds r0, r2, 0x1 - adds r0, r1, r0 - ldrb r0, [r0] - adds r2, 0x2 - adds r1, r2 - ldrb r1, [r1] - lsls r1, 8 - orrs r0, r1 - lsls r1, r3, 24 - asrs r1, 24 - bl audio_play_and_stuff - bl dp01_tbl3_exec_completed - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BDFF8 - - thumb_func_start sub_81BE03C -sub_81BE03C: @ 81BE03C - push {r4,r5,lr} - ldr r4, =0x02023064 - ldr r5, =0x02024064 - ldrb r0, [r5] - lsls r3, r0, 9 - adds r0, r4, 0x3 - adds r0, r3, r0 - ldrb r0, [r0] - cmp r0, 0 - beq _081BE078 - bl sub_805EA60 - ldrb r1, [r5] - lsls r1, 9 - adds r0, r4, 0x1 - adds r0, r1, r0 - ldrb r0, [r0] - adds r2, r4, 0x2 - adds r1, r2 - ldrb r1, [r1] - lsls r1, 8 - orrs r0, r1 - bl song_play_for_text - b _081BE08C - .pool -_081BE078: - adds r0, r4, 0x1 - adds r0, r3, r0 - ldrb r0, [r0] - adds r1, r4, 0x2 - adds r1, r3, r1 - ldrb r1, [r1] - lsls r1, 8 - orrs r0, r1 - bl fanfare_play -_081BE08C: - bl dp01_tbl3_exec_completed - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81BE03C - - thumb_func_start sub_81BE098 -sub_81BE098: @ 81BE098 - push {lr} - ldr r1, =0x0202406e - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x19 - negs r1, r1 - movs r2, 0x5 - bl sub_80A32E4 - bl dp01_tbl3_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BE098 - - thumb_func_start dp01t_2E_3_battle_intro -dp01t_2E_3_battle_intro: @ 81BE0D8 - push {lr} - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - bl battle_intro_launch - ldr r2, =0x020243fc - ldrh r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strh r0, [r2] - bl dp01_tbl3_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_2E_3_battle_intro - - thumb_func_start sub_81BE10C -sub_81BE10C: @ 81BE10C - push {r4-r6,lr} - ldr r6, =0x020241e4 - ldr r5, =0x02024064 - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl oamt_add_pos2_onto_pos1 - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x32 - strh r1, [r0, 0x2E] - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =0x0000ffd8 - strh r1, [r0, 0x32] - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x22] - strh r1, [r0, 0x36] - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_80A6EEC - str r1, [r0] - ldrb r2, [r5] - adds r0, r2, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r2, [r0, 0x38] - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_805CC00 - bl oamt_set_x3A_32 - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x1 - bl StartObjectImageAnim - ldr r0, =0x0000d6f9 - bl AllocObjectPalette - lsls r0, 24 - lsrs r4, r0, 24 - ldr r2, =0x02038bce - ldrh r1, [r2] - ldr r0, =0x00000c03 - cmp r1, r0 - bne _081BE1FC - ldr r0, =gTrainerBackPicPaletteTable - ldr r0, [r0, 0x38] - lsls r4, 4 - movs r2, 0x80 - lsls r2, 1 - adds r1, r4, r2 - movs r2, 0x20 - bl decompress_palette - b _081BE21A - .pool -_081BE1FC: - ldrh r0, [r2] - bl sub_8162AA0 - lsls r0, 24 - ldr r1, =gTrainerFrontPicPaletteTable - lsrs r0, 21 - adds r0, r1 - ldr r0, [r0] - lsls r4, 4 - movs r2, 0x80 - lsls r2, 1 - adds r1, r4, r2 - movs r2, 0x20 - bl decompress_palette -_081BE21A: - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r5, =0x02024064 - ldrb r0, [r5] - adds r0, r1 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r4 - strb r0, [r1, 0x5] - ldr r0, =sub_81BE2C8 - movs r1, 0x5 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r4 - ldrb r0, [r5] - strh r0, [r1, 0x8] - ldr r3, =0x020244d0 - ldr r0, [r3] - ldrb r2, [r5] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081BE27E - ldr r0, =0x020244b4 - adds r0, r2, r0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - ldr r1, =sub_8073C30 - str r1, [r0] -_081BE27E: - ldr r0, [r3] - ldr r2, [r0, 0x8] - ldrb r0, [r2, 0x9] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x9] - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =nullsub_77 - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BE10C - - thumb_func_start sub_81BE2C8 -sub_81BE2C8: @ 81BE2C8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r1, =0x03005e00 - lsls r0, 2 - add r0, r8 - lsls r0, 3 - adds r1, r0, r1 - ldrh r2, [r1, 0xA] - movs r3, 0xA - ldrsh r0, [r1, r3] - cmp r0, 0x17 - bgt _081BE2F4 - adds r0, r2, 0x1 - strh r0, [r1, 0xA] - b _081BE3B0 - .pool -_081BE2F4: - ldr r7, =0x02024064 - ldrb r0, [r7] - mov r9, r0 - ldrh r0, [r1, 0x8] - strb r0, [r7] - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _081BE314 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081BE344 -_081BE314: - ldr r0, =0x02023064 - ldrb r1, [r7] - lsls r2, r1, 9 - adds r0, 0x1 - adds r2, r0 - ldr r0, =0x0202406e - lsls r1, 1 - adds r1, r0 - ldrh r0, [r1] - strb r0, [r2] - ldrb r0, [r7] - movs r1, 0 - bl sub_81BD0E4 - b _081BE398 - .pool -_081BE344: - ldr r4, =0x02023064 - ldrb r0, [r7] - lsls r1, r0, 9 - adds r4, 0x1 - adds r1, r4 - ldr r5, =0x0202406e - lsls r0, 1 - adds r0, r5 - ldrh r0, [r0] - strb r0, [r1] - ldrb r0, [r7] - movs r1, 0 - bl sub_81BD0E4 - ldrb r0, [r7] - movs r6, 0x2 - eors r0, r6 - strb r0, [r7] - ldrb r0, [r7] - lsls r1, r0, 9 - adds r1, r4 - lsls r0, 1 - adds r0, r5 - ldrh r0, [r0] - strb r0, [r1] - ldrb r1, [r7] - lsls r0, r1, 1 - adds r0, r5 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =0x020244ec - adds r0, r2 - bl sub_805DD7C - ldrb r0, [r7] - movs r1, 0 - bl sub_81BD0E4 - ldrb r0, [r7] - eors r0, r6 - strb r0, [r7] -_081BE398: - ldr r1, =0x03005d60 - ldr r2, =0x02024064 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_81BB02C - str r1, [r0] - mov r3, r9 - strb r3, [r2] - mov r0, r8 - bl remove_task -_081BE3B0: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BE2C8 - - thumb_func_start dp01t_30_3_80EB11C -dp01t_30_3_80EB11C: @ 81BE3D4 - push {r4-r6,lr} - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _081BE404 - adds r0, r2, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _081BE404 - bl dp01_tbl3_exec_completed - b _081BE478 - .pool -_081BE404: - ldr r6, =0x020244d0 - ldr r0, [r6] - ldr r5, =0x02024064 - ldrb r1, [r5] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] - ldrb r0, [r5] - lsls r3, r0, 9 - ldr r4, =0x02023068 - adds r1, r3, r4 - subs r2, r4, 0x3 - adds r2, r3, r2 - ldrb r2, [r2] - subs r4, 0x2 - adds r3, r4 - ldrb r3, [r3] - bl sub_80735DC - ldr r2, =0x020244b4 - ldrb r1, [r5] - adds r1, r2 - movs r3, 0 - strb r0, [r1] - ldr r0, [r6] - ldrb r1, [r5] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strb r3, [r0, 0x5] - ldrb r2, [r5] - lsls r0, r2, 9 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - beq _081BE46C - ldr r0, [r6] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - movs r1, 0x5D - strb r1, [r0, 0x5] -_081BE46C: - ldr r0, =0x03005d60 - ldrb r1, [r5] - lsls r1, 2 - adds r1, r0 - ldr r0, =sub_81BE498 - str r0, [r1] -_081BE478: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_30_3_80EB11C - - thumb_func_start sub_81BE498 -sub_81BE498: @ 81BE498 - push {r4,lr} - ldr r4, =0x020244d0 - ldr r0, [r4] - ldr r3, =0x02024064 - ldrb r1, [r3] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x5] - adds r2, r1, 0x1 - strb r2, [r0, 0x5] - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x5C - bls _081BE4D0 - ldr r0, [r4] - ldrb r1, [r3] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strb r1, [r0, 0x5] - bl dp01_tbl3_exec_completed -_081BE4D0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BE498 - - thumb_func_start sub_81BE4E0 -sub_81BE4E0: @ 81BE4E0 - push {lr} - ldr r0, =0x020244d0 - ldr r1, [r0] - ldr r0, =0x02024064 - ldrb r3, [r0] - ldr r1, [r1, 0x4] - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081BE512 - ldr r2, =0x03005e00 - ldr r0, =0x020244b4 - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldr r1, =sub_8073C30 - str r1, [r0] -_081BE512: - bl dp01_tbl3_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BE4E0 - - thumb_func_start sub_81BE530 -sub_81BE530: @ 81BE530 - push {lr} - bl dp01_tbl3_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81BE530 - - thumb_func_start sub_81BE53C -sub_81BE53C: @ 81BE53C - push {r4,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - bl sub_80A6A90 - lsls r0, 24 - cmp r0, 0 - beq _081BE582 - ldr r3, =0x02020630 - ldr r0, =0x020241e4 - ldrb r1, [r4] - adds r0, r1, r0 - ldrb r0, [r0] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r3 - ldr r0, =0x02023064 - lsls r1, 9 - adds r0, 0x1 - adds r1, r0 - adds r2, 0x3E - movs r0, 0x1 - ldrb r1, [r1] - ands r1, r0 - lsls r1, 2 - ldrb r3, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldrb r0, [r4] - bl sub_805E408 -_081BE582: - bl dp01_tbl3_exec_completed - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BE53C - - thumb_func_start sub_81BE59C -sub_81BE59C: @ 81BE59C - push {r4-r6,lr} - sub sp, 0x4 - ldr r6, =0x02024064 - ldrb r0, [r6] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _081BE5F4 - ldr r5, =0x02023064 - ldrb r2, [r6] - lsls r1, r2, 9 - adds r0, r5, 0x1 - adds r0, r1, r0 - ldrb r3, [r0] - adds r0, r5, 0x2 - adds r0, r1, r0 - ldrb r4, [r0] - adds r5, 0x3 - adds r1, r5 - ldrb r0, [r1] - lsls r0, 8 - orrs r4, r0 - str r4, [sp] - adds r0, r2, 0 - adds r1, r2, 0 - bl move_anim_start_t3 - lsls r0, 24 - cmp r0, 0 - beq _081BE5E8 - bl dp01_tbl3_exec_completed - b _081BE5F4 - .pool -_081BE5E8: - ldr r0, =0x03005d60 - ldrb r1, [r6] - lsls r1, 2 - adds r1, r0 - ldr r0, =bx_80E8A6C - str r0, [r1] -_081BE5F4: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BE59C - - thumb_func_start sub_81BE604 -sub_81BE604: @ 81BE604 - push {lr} - bl dp01_tbl3_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81BE604 - - thumb_func_start sub_81BE610 -sub_81BE610: @ 81BE610 - push {lr} - bl dp01_tbl3_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81BE610 - - thumb_func_start sub_81BE61C -sub_81BE61C: @ 81BE61C - push {r4,lr} - ldr r2, =0x0202433a - ldr r1, =0x02023064 - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - movs r0, 0x5 - bl sub_80A2F50 - movs r0, 0x3 - bl sub_80A2390 - bl dp01_tbl3_exec_completed - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_80587B0 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BE61C - - thumb_func_start nullsub_128 -nullsub_128: @ 81BE668 - bx lr - thumb_func_end nullsub_128 - - thumb_func_start sub_81BE66C -sub_81BE66C: @ 81BE66C - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r1, [r0, 0x4] - movs r0, 0xD0 - lsls r0, 5 - cmp r1, r0 - bne _081BE690 - movs r0, 0xA7 - lsls r0, 1 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - b _081BE692 - .pool -_081BE690: - movs r0, 0 -_081BE692: - pop {r1} - bx r1 - thumb_func_end sub_81BE66C - - thumb_func_start sub_81BE698 -sub_81BE698: @ 81BE698 - push {lr} - ldr r0, =0x0203cf18 - ldr r0, [r0] - adds r0, 0x4 - bl sub_8151E50 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BE698 - - thumb_func_start sub_81BE6AC -sub_81BE6AC: @ 81BE6AC - ldr r1, =0x0203cf18 - movs r0, 0 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_81BE6AC - - thumb_func_start sub_81BE6B8 -sub_81BE6B8: @ 81BE6B8 - push {r4,lr} - ldr r4, =0x0203cf18 - ldr r0, [r4] - cmp r0, 0 - beq _081BE6CC - movs r0, 0 - str r0, [r4] - b _081BE718 - .pool -_081BE6CC: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r1, [r0, 0x4] - movs r0, 0xD0 - lsls r0, 5 - cmp r1, r0 - bne _081BE718 - movs r0, 0xA7 - lsls r0, 1 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _081BE718 - movs r0, 0xC8 - bl AllocZeroed - str r0, [r4] - adds r0, 0x4 - bl sub_8151B3C - ldr r0, [r4] - adds r0, 0x4 - ldr r1, =gUnknown_08617E18 - bl sub_8151B68 - ldr r0, [r4] - adds r0, 0x4 - movs r1, 0x1 - movs r2, 0x1 - bl sub_8151CA8 - ldr r0, =sub_81BE698 - movs r1, 0xFF - bl AddTask - ldr r1, [r4] - strb r0, [r1] -_081BE718: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BE6B8 - - thumb_func_start sub_81BE72C -sub_81BE72C: @ 81BE72C - push {r4,lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r1, [r0, 0x4] - movs r0, 0xD0 - lsls r0, 5 - cmp r1, r0 - bne _081BE788 - movs r0, 0xA7 - lsls r0, 1 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _081BE788 - ldr r4, =0x0203cf18 - ldr r0, [r4] - cmp r0, 0 - beq _081BE788 - ldr r0, =sub_81BE698 - bl is_function_an_active_task - lsls r0, 24 - cmp r0, 0 - beq _081BE766 - ldr r0, [r4] - ldrb r0, [r0] - bl remove_task -_081BE766: - ldr r0, [r4] - adds r0, 0x4 - movs r1, 0x1 - movs r2, 0x1 - bl sub_8151D28 - ldr r0, [r4] - adds r0, 0x4 - movs r1, 0x1 - movs r2, 0x1 - bl sub_8151C50 - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] -_081BE788: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BE72C - - thumb_func_start sub_81BE79C -sub_81BE79C: @ 81BE79C - push {r4,lr} - ldr r0, =0x000040cb - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _081BE7B8 - movs r0, 0xA7 - lsls r0, 1 - bl FlagReset - b _081BE7EE - .pool -_081BE7B8: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0x1 - ands r4, r0 - movs r0, 0x9D - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081BE7D4 - movs r4, 0x1 -_081BE7D4: - cmp r4, 0 - beq _081BE7E6 - movs r0, 0xA7 - lsls r0, 1 - bl FlagSet - bl sub_81BE6B8 - b _081BE7EE -_081BE7E6: - movs r0, 0xA7 - lsls r0, 1 - bl FlagReset -_081BE7EE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81BE79C - - thumb_func_start sub_81BE7F4 -sub_81BE7F4: @ 81BE7F4 - push {lr} - ldr r0, =sub_81BE808 - movs r1, 0x8 - bl AddTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BE7F4 - - thumb_func_start sub_81BE808 -sub_81BE808: @ 81BE808 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrb r1, [r0, 0x5] - ldrb r2, [r0, 0x4] - movs r0, 0x2D - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - mov r0, sp - ldrb r0, [r0] - lsls r2, r0, 3 - adds r2, r0 - lsls r2, 2 - ldr r4, =0x02037350 - adds r2, r4 - ldr r3, =0x02020630 - ldrb r1, [r2, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x26] - adds r1, 0x4 - strh r1, [r0, 0x26] - ldr r0, =0x02037590 - ldrb r0, [r0, 0x5] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r2, [r2, 0x4] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r3 - movs r4, 0x22 - ldrsh r2, [r0, r4] - movs r4, 0x26 - ldrsh r0, [r0, r4] - adds r2, r0 - ldrb r1, [r1, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r3, 0x22 - ldrsh r1, [r0, r3] - movs r4, 0x26 - ldrsh r0, [r0, r4] - adds r1, r0 - cmp r2, r1 - blt _081BE882 - adds r0, r5, 0 - bl remove_task - bl script_env_2_enable_and_set_ctx_running -_081BE882: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BE808 - - thumb_func_start sp136_strengh_sound -sp136_strengh_sound: @ 81BE89C - 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 r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - ldr r0, =sub_81BE900 - movs r1, 0x9 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0 - strh r4, [r1, 0x8] - strh r0, [r1, 0xA] - strh r5, [r1, 0xC] - strh r6, [r1, 0xE] - mov r0, r8 - strh r0, [r1, 0x10] - movs r0, 0 - bl SetCameraPanningCallback - movs r0, 0xD6 - bl audio_play - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sp136_strengh_sound - - thumb_func_start sub_81BE900 -sub_81BE900: @ 81BE900 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] - movs r1, 0x2 - ldrsh r0, [r4, r1] - movs r2, 0x6 - ldrsh r1, [r4, r2] - bl __modsi3 - cmp r0, 0 - bne _081BE95C - strh r0, [r4, 0x2] - ldrh r0, [r4, 0x4] - subs r0, 0x1 - strh r0, [r4, 0x4] - ldrh r0, [r4] - negs r0, r0 - strh r0, [r4] - ldrh r0, [r4, 0x8] - negs r0, r0 - strh r0, [r4, 0x8] - movs r1, 0 - ldrsh r0, [r4, r1] - movs r2, 0x8 - ldrsh r1, [r4, r2] - bl SetCameraPanning - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081BE95C - bl sub_81BE968 - adds r0, r5, 0 - bl remove_task - bl InstallCameraPanAheadCallback -_081BE95C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BE900 - - thumb_func_start sub_81BE968 -sub_81BE968: @ 81BE968 - push {lr} - ldr r0, =sub_81BE9C0 - bl get_task_id_by_function - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - beq _081BE988 - ldr r0, =0x03005e00 - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_081BE988: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BE968 - - thumb_func_start sub_81BE994 -sub_81BE994: @ 81BE994 - push {lr} - ldr r0, =gUnknown_08617D94 - bl LoadObjectPics - bl sub_81BEA20 - ldr r0, =sub_81BE9C0 - movs r1, 0x8 - bl AddTask - movs r0, 0x2 - movs r1, 0x1 - movs r2, 0x10 - movs r3, 0x3 - bl sp136_strengh_sound - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BE994 - - thumb_func_start sub_81BE9C0 -sub_81BE9C0: @ 81BE9C0 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r3, r1, 3 - ldr r4, =0x03005e08 - adds r2, r3, r4 - ldrh r0, [r2, 0x2] - adds r0, 0x1 - strh r0, [r2, 0x2] - lsls r0, 16 - movs r1, 0xFA - lsls r1, 18 - cmp r0, r1 - beq _081BE9E6 - ldrh r0, [r2] - cmp r0, 0x11 - bne _081BE9F0 -_081BE9E6: - adds r0, r4, 0 - subs r0, 0x8 - adds r0, r3, r0 - ldr r1, =sub_81BEA00 - str r1, [r0] -_081BE9F0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BE9C0 - - thumb_func_start sub_81BEA00 -sub_81BEA00: @ 81BEA00 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0xFA - lsls r0, 4 - bl FreeObjectTilesByTag - adds r0, r4, 0 - bl remove_task - bl script_env_2_enable_and_set_ctx_running - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81BEA00 - - thumb_func_start sub_81BEA20 -sub_81BEA20: @ 81BEA20 - push {r4-r7,lr} - movs r4, 0 - ldr r5, =gUnknown_08617D64 - adds r7, r5, 0x2 - ldr r6, =0x02020630 -_081BEA2A: - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 1 - adds r1, r0, r5 - ldrh r1, [r1] - adds r1, 0x78 - lsls r1, 16 - asrs r1, 16 - adds r0, r7 - movs r3, 0 - ldrsh r2, [r0, r3] - ldr r0, =gUnknown_08617E60 - movs r3, 0x8 - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r2, [r0, 0x5] - movs r3, 0xD - negs r3, r3 - adds r1, r3, 0 - ands r2, r1 - movs r1, 0xF - ands r2, r1 - strb r2, [r0, 0x5] - strh r4, [r0, 0x2E] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _081BEA2A - movs r4, 0 - ldr r5, =gUnknown_08617D64 - adds r7, r5, 0x2 - ldr r6, =0x02020630 -_081BEA78: - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 1 - adds r1, r0, r5 - ldrh r1, [r1] - adds r1, 0x73 - lsls r1, 16 - asrs r1, 16 - adds r0, r7 - ldrh r2, [r0] - subs r2, 0x3 - lsls r2, 16 - asrs r2, 16 - ldr r0, =gUnknown_08617E34 - movs r3, 0x8 - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r2, [r0, 0x5] - movs r3, 0xD - negs r3, r3 - adds r1, r3, 0 - ands r2, r1 - movs r1, 0xF - ands r2, r1 - strb r2, [r0, 0x5] - strh r4, [r0, 0x2E] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _081BEA78 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BEA20 - - thumb_func_start sub_81BEAD8 -sub_81BEAD8: @ 81BEAD8 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - adds r0, 0x2 - strh r0, [r4, 0x30] - movs r1, 0x30 - ldrsh r0, [r4, r1] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - strh r0, [r4, 0x26] - movs r0, 0x22 - ldrsh r3, [r4, r0] - movs r1, 0x26 - ldrsh r0, [r4, r1] - adds r3, r0 - ldr r2, =gUnknown_08617D64 - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 1 - adds r2, 0x4 - adds r0, r2 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r3, r0 - ble _081BEB1A - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - bl sub_81BE968 -_081BEB1A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BEAD8 - - thumb_func_start sub_81BEB24 -sub_81BEB24: @ 81BEB24 - push {r4,r5,lr} - movs r4, 0 - ldr r5, =gUnknown_08617DA4 -_081BEB2A: - lsls r2, r4, 2 - adds r2, r5 - ldrb r0, [r2] - adds r0, 0x7 - ldrb r1, [r2, 0x1] - adds r1, 0x7 - ldrh r2, [r2, 0x2] - bl MapGridSetMetatileIdAt - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x11 - bls _081BEB2A - bl DrawWholeMapView - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BEB24 - - thumb_func_start sub_81BEB54 -sub_81BEB54: @ 81BEB54 - push {lr} - ldr r0, =sub_81BED50 - movs r1, 0x9 - bl AddTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BEB54 - - thumb_func_start sub_81BEB68 -sub_81BEB68: @ 81BEB68 - push {lr} - ldr r0, =sub_81BEBF4 - movs r1, 0x9 - bl AddTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BEB68 - - thumb_func_start sub_81BEB7C -sub_81BEB7C: @ 81BEB7C - push {lr} - ldr r0, =sub_81BF028 - movs r1, 0x9 - bl AddTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BEB7C - - thumb_func_start sub_81BEB90 -sub_81BEB90: @ 81BEB90 - push {r4,lr} - ldr r4, =0x0203cf14 - ldr r0, [r4] - ldrh r1, [r0] - movs r0, 0x10 - bl SetGpuReg - ldr r0, [r4] - ldrh r1, [r0, 0x2] - movs r0, 0x12 - bl SetGpuReg - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BEB90 - - thumb_func_start sub_81BEBB4 -sub_81BEBB4: @ 81BEBB4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r2, r1, r2 - ldrh r1, [r2, 0x8] - movs r3, 0x8 - ldrsh r0, [r2, r3] - cmp r0, 0 - bne _081BEBEC - ldr r0, =0x0203cf14 - ldr r1, [r0] - ldrh r0, [r1] - negs r0, r0 - strh r0, [r1] - movs r0, 0x2 - strh r0, [r2, 0x8] - bl sub_81BEB90 - b _081BEBF0 - .pool -_081BEBEC: - subs r0, r1, 0x1 - strh r0, [r2, 0x8] -_081BEBF0: - pop {r0} - bx r0 - thumb_func_end sub_81BEBB4 - - thumb_func_start sub_81BEBF4 -sub_81BEBF4: @ 81BEBF4 - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0x8 - ldrsh r0, [r0, r1] - cmp r0, 0x6 - bls _081BEC10 - b _081BED40 -_081BEC10: - lsls r0, 2 - ldr r1, =_081BEC24 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081BEC24: - .4byte _081BEC40 - .4byte _081BEC50 - .4byte _081BEC88 - .4byte _081BECB0 - .4byte _081BECF8 - .4byte _081BED00 - .4byte _081BED1C -_081BEC40: - bl FreeAllWindowBuffers - movs r0, 0 - movs r1, 0x7 - movs r2, 0x2 - bl SetBgAttribute - b _081BED04 -_081BEC50: - ldr r4, =0x0203cf04 - movs r0, 0x92 - lsls r0, 4 - bl AllocZeroed - str r0, [r4] - ldr r4, =0x0203cf08 - movs r0, 0x80 - lsls r0, 4 - bl AllocZeroed - str r0, [r4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - b _081BECD8 - .pool -_081BEC88: - ldr r0, =gUnknown_08617274 - ldr r4, =0x0203cf04 - ldr r1, [r4] - movs r2, 0x92 - lsls r2, 3 - bl CpuSet - ldr r1, [r4] - movs r2, 0x92 - lsls r2, 4 - movs r0, 0 - movs r3, 0 - bl LoadBgTiles - b _081BECD8 - .pool -_081BECB0: - ldr r0, =0x0203cf08 - ldr r1, [r0] - movs r0, 0 - bl SetBgTilemapBuffer - ldr r1, =gUnknown_08617B94 - movs r0, 0x6 - str r0, [sp] - movs r0, 0xC - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0 - movs r2, 0xC - movs r3, 0x1D - bl CopyToBgTilemapBufferRect_ChangePalette - movs r0, 0 - bl CopyBgTilemapBufferToVram -_081BECD8: - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] - b _081BED40 - .pool -_081BECF8: - movs r0, 0 - bl ShowBg - b _081BED04 -_081BED00: - bl sub_81BEB24 -_081BED04: - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _081BED40 - .pool -_081BED1C: - ldr r4, =0x0203cf14 - movs r0, 0x4 - bl Alloc - str r0, [r4] - movs r2, 0 - movs r1, 0x2 - strh r1, [r0] - strh r2, [r0, 0x2] - ldr r0, =sub_81BEBB4 - movs r1, 0xA - bl AddTask - adds r0, r5, 0 - bl remove_task - bl script_env_2_enable_and_set_ctx_running -_081BED40: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BEBF4 - - thumb_func_start sub_81BED50 -sub_81BED50: @ 81BED50 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r1, =0x03005e00 - lsls r0, 2 - add r0, r10 - lsls r0, 3 - adds r0, r1 - ldrh r0, [r0, 0x8] - subs r0, 0x1 - lsls r0, 16 - asrs r0, 16 - adds r6, r1, 0 - cmp r0, 0x7 - bls _081BED7C - b _081BF002 -_081BED7C: - lsls r0, 2 - ldr r1, =_081BED90 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081BED90: - .4byte _081BEDB0 - .4byte _081BF002 - .4byte _081BEDC4 - .4byte _081BEF64 - .4byte _081BEF94 - .4byte _081BEFD0 - .4byte _081BEFF0 - .4byte _081BEFF8 -_081BEDB0: - ldr r4, =0x0203cf10 - movs r0, 0xC0 - lsls r0, 2 - bl AllocZeroed - str r0, [r4] - b _081BF002 - .pool -_081BEDC4: - mov r1, r10 - lsls r0, r1, 2 - adds r1, r0, r1 - lsls r1, 3 - adds r2, r1, r6 - ldrh r3, [r2, 0xE] - movs r4, 0xE - ldrsh r1, [r2, r4] - str r0, [sp, 0x8] - cmp r1, 0x5F - bgt _081BEE8A - movs r1, 0xA - ldrsh r0, [r2, r1] - cmp r0, 0x1 - ble _081BEE7C - lsls r0, r3, 24 - lsrs r4, r0, 24 - movs r0, 0x30 - bl Alloc - ldr r3, =0x0203cf10 - ldr r1, [r3] - lsls r2, r4, 3 - adds r1, r2, r1 - str r0, [r1] - movs r5, 0 - adds r4, r2, 0 -_081BEDFA: - ldr r0, [r3] - adds r0, r4, r0 - ldr r0, [r0] - adds r0, r5 - strb r5, [r0] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x2F - bls _081BEDFA - movs r5, 0 - ldr r7, =0x0203cf10 - adds r6, r2, 0 -_081BEE14: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x30 - bl __umodsi3 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x30 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - ldr r1, [r7] - adds r1, r6, r1 - ldr r1, [r1] - adds r0, r1, r0 - ldrb r2, [r0] - adds r1, r4 - ldrb r1, [r1] - strb r1, [r0] - ldr r0, [r7] - adds r0, r6, r0 - ldr r0, [r0] - adds r0, r4 - strb r2, [r0] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x2F - bls _081BEE14 - ldr r0, =0x03005e00 - ldr r1, [sp, 0x8] - add r1, r10 - lsls r1, 3 - adds r2, r1, r0 - ldrh r3, [r2, 0xE] - movs r4, 0xE - ldrsh r1, [r2, r4] - adds r6, r0, 0 - cmp r1, 0x5F - bgt _081BEE78 - adds r0, r3, 0x1 - strh r0, [r2, 0xE] -_081BEE78: - movs r0, 0 - strh r0, [r2, 0xA] -_081BEE7C: - ldr r1, [sp, 0x8] - add r1, r10 - lsls r1, 3 - adds r1, r6 - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] -_081BEE8A: - ldr r0, [sp, 0x8] - add r0, r10 - lsls r0, 3 - adds r0, r6 - ldrb r4, [r0, 0xE] - ldrb r5, [r0, 0xC] - lsls r0, r4, 16 - cmp r5, r4 - bcs _081BEF32 - str r0, [sp, 0xC] -_081BEE9E: - movs r6, 0 - adds r0, r5, 0x1 - str r0, [sp, 0x4] - lsls r4, r5, 3 - movs r2, 0x5F - subs r1, r2, r5 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 4 - mov r9, r0 -_081BEEB2: - ldr r0, =0x0203cf04 - ldr r0, [r0] - ldr r7, =0x0203cf10 - ldr r3, [r7] - adds r3, r4, r3 - ldrb r2, [r3, 0x4] - adds r1, r2, 0x1 - strb r1, [r3, 0x4] - lsls r2, 24 - lsrs r2, 24 - ldr r1, [r3] - adds r1, r2 - ldrb r1, [r1] - add r1, r9 - lsls r1, 16 - lsrs r1, 16 - movs r2, 0x1 - mov r8, r2 - str r2, [sp] - movs r2, 0 - movs r3, 0x30 - bl sub_81BF2B8 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - beq _081BEEB2 - ldr r0, [r7] - adds r1, r4, r0 - ldrb r0, [r1, 0x4] - cmp r0, 0x2F - bls _081BEF24 - ldr r0, [r1] - bl Free - ldr r0, [r7] - adds r0, r4, r0 - movs r1, 0 - str r1, [r0] - ldr r1, [sp, 0x8] - add r1, r10 - lsls r1, 3 - ldr r4, =0x03005e00 - adds r1, r4 - ldrh r0, [r1, 0xC] - adds r0, 0x1 - strh r0, [r1, 0xC] - mov r0, r8 - ands r5, r0 - cmp r5, 0x1 - bne _081BEF24 - ldr r0, =0x0203cf14 - ldr r1, [r0] - ldrh r0, [r1, 0x2] - subs r0, 0x1 - strh r0, [r1, 0x2] -_081BEF24: - ldr r1, [sp, 0x4] - lsls r0, r1, 16 - lsrs r5, r0, 16 - ldr r2, [sp, 0xC] - lsrs r0, r2, 16 - cmp r5, r0 - bcc _081BEE9E -_081BEF32: - ldr r0, =0x0203cf04 - ldr r1, [r0] - movs r2, 0x92 - lsls r2, 4 - movs r0, 0 - movs r3, 0 - bl LoadBgTiles - ldr r0, =0x0203cf10 - ldr r0, [r0] - movs r4, 0xBE - lsls r4, 2 - adds r0, r4 - ldrb r0, [r0, 0x4] - cmp r0, 0x2F - bhi _081BF002 - b _081BF014 - .pool -_081BEF64: - movs r0, 0 - bl UnsetBgTilemapBuffer - ldr r0, =sub_81BEBB4 - bl get_task_id_by_function - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _081BEF7C - bl remove_task -_081BEF7C: - ldr r0, =0x0203cf14 - ldr r1, [r0] - movs r0, 0 - strh r0, [r1] - strh r0, [r1, 0x2] - bl sub_81BEB90 - b _081BF002 - .pool -_081BEF94: - ldr r4, =0x0203cf14 - ldr r0, [r4] - bl Free - movs r5, 0 - str r5, [r4] - ldr r4, =0x0203cf10 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203cf04 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203cf08 - ldr r0, [r4] - bl Free - str r5, [r4] - b _081BF002 - .pool -_081BEFD0: - movs r0, 0xC - movs r1, 0x2 - bl SetGpuRegBits - movs r0, 0x8 - movs r1, 0 - bl SetGpuRegBits - movs r0, 0 - movs r1, 0x7 - movs r2, 0 - bl SetBgAttribute - bl sub_81971D0 - b _081BF002 -_081BEFF0: - movs r0, 0 - bl ShowBg - b _081BF002 -_081BEFF8: - mov r0, r10 - bl remove_task - bl script_env_2_enable_and_set_ctx_running -_081BF002: - ldr r0, =0x03005e00 - mov r2, r10 - lsls r1, r2, 2 - add r1, r10 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_081BF014: - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BED50 - - thumb_func_start sub_81BF028 -sub_81BF028: @ 81BF028 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x18 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldrh r0, [r0, 0x8] - subs r0, 0x1 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - bls _081BF04C - b _081BF228 -_081BF04C: - lsls r0, 2 - ldr r1, =_081BF060 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081BF060: - .4byte _081BF080 - .4byte _081BF0B4 - .4byte _081BF0DC - .4byte _081BF0F0 - .4byte _081BF148 - .4byte _081BF170 - .4byte _081BF1CC - .4byte _081BF224 -_081BF080: - ldr r4, =0x0203cf0c - movs r0, 0x14 - bl AllocZeroed - str r0, [r4] - movs r0, 0x80 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1] - movs r0, 0x8 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1, 0x4] - movs r0, 0x80 - lsls r0, 2 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1, 0xC] - movs r0, 0 - strh r0, [r1, 0x10] - b _081BF228 - .pool -_081BF0B4: - ldr r0, =0x0203cf0c - ldr r0, [r0] - ldr r1, [r0] - movs r5, 0 - ldr r2, =gUnknown_08617C44 -_081BF0BE: - adds r0, r5, r2 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - adds r1, 0x1 - cmp r5, 0x7F - bls _081BF0BE - b _081BF228 - .pool -_081BF0DC: - ldr r0, =0x0203cf0c - ldr r0, [r0] - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [r1] - movs r0, 0x80 - strh r0, [r1, 0x4] - b _081BF228 - .pool -_081BF0F0: - mov r1, sp - ldr r0, =gUnknown_08617E00 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldr r4, =0x0203cf0c - ldr r0, [r4] - ldr r0, [r0, 0x4] - str r0, [sp, 0xC] - movs r2, 0x10 - negs r2, r2 - mov r0, sp - movs r1, 0x80 - movs r3, 0x1 - bl AddObjectToFront - ldr r1, [r4] - movs r3, 0 - strb r0, [r1, 0x8] - ldr r2, =0x02020630 - ldr r0, [r4] - ldrb r1, [r0, 0x8] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x28 - strb r3, [r0] - ldr r3, [r4] - ldrb r1, [r3, 0x8] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x20] - strh r1, [r0, 0x2E] - ldrb r1, [r3, 0x8] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x1 - strh r1, [r0, 0x30] -_081BF148: - movs r5, 0 - ldr r2, =0x0203cf0c -_081BF14C: - ldr r0, [r2] - ldr r1, [r0, 0xC] - lsls r0, r5, 1 - adds r0, r1 - strh r5, [r0] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0xFF - bls _081BF14C - b _081BF228 - .pool -_081BF170: - movs r5, 0 - movs r6, 0xFF - ldr r0, =0x000001ff - mov r8, r0 -_081BF178: - bl GenerateRandomNumber - adds r4, r6, 0 - ands r4, r0 - bl GenerateRandomNumber - adds r1, r6, 0 - ands r1, r0 - ldr r0, =0x0203cf0c - ldr r3, [r0] - ldr r0, [r3, 0xC] - lsls r1, 1 - adds r1, r0 - ldrh r2, [r1] - lsls r4, 1 - adds r4, r0 - ldrh r0, [r4] - strh r0, [r1] - strh r2, [r4] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, r8 - bls _081BF178 - ldr r2, =0x02020630 - ldrb r1, [r3, 0x8] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_81BF248 - str r1, [r0] - b _081BF228 - .pool -_081BF1CC: - ldr r3, =0x02020630 - ldr r5, =0x0203cf0c - ldr r0, [r5] - ldrb r1, [r0, 0x8] - lsls r0, r1, 4 - adds r0, r1 - lsls r2, r0, 2 - adds r0, r3, 0 - adds r0, 0x1C - adds r0, r2, r0 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - bne _081BF238 - adds r0, r2, r3 - bl RemoveObjectAndFreeTiles - ldr r0, [r5] - ldr r0, [r0, 0xC] - bl Free - ldr r0, [r5] - movs r4, 0 - str r4, [r0, 0xC] - ldr r0, [r0, 0x4] - bl Free - ldr r0, [r5] - str r4, [r0, 0x4] - ldr r0, [r0] - bl Free - ldr r0, [r5] - str r4, [r0] - bl Free - str r4, [r5] - b _081BF228 - .pool -_081BF224: - bl script_env_2_enable_and_set_ctx_running -_081BF228: - ldr r0, =0x03005e00 - lsls r1, r7, 2 - adds r1, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_081BF238: - add sp, 0x18 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BF028 - - thumb_func_start sub_81BF248 -sub_81BF248: @ 81BF248 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - ldr r0, =0x0203cf0c - ldr r0, [r0] - ldrh r0, [r0, 0x10] - cmp r0, 0xFF - bls _081BF268 - ldr r0, =DummyObjectCallback - str r0, [r5, 0x1C] - b _081BF2B0 - .pool -_081BF268: - ldrh r1, [r5, 0x22] - movs r2, 0x22 - ldrsh r0, [r5, r2] - cmp r0, 0x5F - ble _081BF2AC - movs r4, 0 -_081BF274: - ldr r0, =0x0203cf0c - ldr r3, [r0] - ldr r0, [r3] - ldrh r1, [r3, 0x10] - adds r2, r1, 0x1 - strh r2, [r3, 0x10] - lsls r1, 16 - ldr r2, [r3, 0xC] - lsrs r1, 15 - adds r1, r2 - ldrh r1, [r1] - movs r2, 0 - str r2, [sp] - movs r3, 0x10 - bl sub_81BF2B8 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _081BF274 - adds r0, r5, 0 - movs r1, 0 - bl StartObjectImageAnim - b _081BF2B0 - .pool -_081BF2AC: - adds r0, r1, 0x1 - strh r0, [r5, 0x22] -_081BF2B0: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81BF248 - - thumb_func_start sub_81BF2B8 -sub_81BF2B8: @ 81BF2B8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - str r0, [sp] - mov r10, r1 - adds r6, r2, 0 - mov r8, r3 - ldr r0, [sp, 0x28] - mov r9, r0 - lsls r1, 16 - lsrs r1, 16 - mov r10, r1 - lsls r6, 24 - lsrs r6, 24 - mov r0, r8 - lsls r0, 24 - mov r8, r0 - lsrs r7, r0, 24 - mov r1, r9 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - mov r0, r10 - adds r1, r7, 0 - bl __divsi3 - adds r5, r0, 0 - lsls r5, 24 - lsrs r4, r5, 24 - ldr r3, =0x030012a8 - strh r4, [r3] - mov r0, r10 - adds r1, r7, 0 - str r3, [sp, 0x4] - bl __modsi3 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r3, [sp, 0x4] - strh r2, [r3, 0x2] - movs r1, 0x7 - ands r4, r1 - ands r2, r1 - strh r4, [r3, 0x4] - strh r2, [r3, 0x6] - lsrs r0, 27 - lsrs r5, 27 - strh r0, [r3, 0x8] - strh r5, [r3, 0xA] - mov r1, r8 - lsrs r1, 27 - lsls r1, 6 - mov r8, r1 - mov r1, r8 - muls r1, r5 - lsls r0, 6 - adds r1, r0 - lsls r1, 16 - lsrs r1, 16 - strh r1, [r3, 0xC] - lsls r4, 3 - adds r4, r2 - adds r1, r4 - lsls r4, r1, 16 - lsrs r4, 17 - strh r1, [r3, 0xE] - movs r1, 0x1 - mov r0, r10 - ands r1, r0 - movs r2, 0x1 - eors r1, r2 - lsls r0, r1, 2 - lsls r6, r0 - eors r1, r2 - lsls r1, 2 - movs r0, 0xF - lsls r0, r1 - orrs r6, r0 - lsls r6, 24 - lsrs r6, 24 - mov r1, r9 - lsls r1, 5 - mov r9, r1 - add r9, r4 - ldr r1, [sp] - add r1, r9 - ldrb r0, [r1] - ands r6, r0 - strb r6, [r1] - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BF2B8 - - thumb_func_start sub_81BF384 -sub_81BF384: @ 81BF384 - push {r4,lr} - ldr r0, =0x0000ffff - bl DisableInterrupts - movs r0, 0x1 - bl EnableInterrupts - bl SoundVSyncOff_rev01 - movs r0, 0 - bl SetVBlankCallback - bl ResetAllObjectData - bl clear_tasks - bl remove_some_task - movs r0, 0 - movs r1, 0 - bl SetGpuReg - ldr r4, =0x030012b8 - movs r0, 0x50 - bl AllocZeroed - str r0, [r4] - movs r1, 0 - strb r1, [r0] - ldr r1, [r4] - movs r0, 0x6 - strb r0, [r1, 0x1] - ldr r0, =sub_81BF3DC - bl SetMainCallback2 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BF384 - - thumb_func_start sub_81BF3DC -sub_81BF3DC: @ 81BF3DC - push {r4,r5,lr} - sub sp, 0x4 - ldr r1, =0x030012b8 - ldr r0, [r1] - ldrb r0, [r0] - adds r5, r1, 0 - cmp r0, 0x7 - bls _081BF3EE - b _081BF592 -_081BF3EE: - lsls r0, 2 - ldr r1, =_081BF400 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081BF400: - .4byte _081BF420 - .4byte _081BF430 - .4byte _081BF45C - .4byte _081BF488 - .4byte _081BF4BC - .4byte _081BF514 - .4byte _081BF552 - .4byte _081BF574 -_081BF420: - bl sub_81BF5A4 - ldr r0, =0x030012b8 - ldr r1, [r0] - movs r0, 0x1 - b _081BF590 - .pool -_081BF430: - movs r0, 0x5 - bl sub_81BF7A4 - cmp r0, 0x5 - beq _081BF43C - b _081BF592 -_081BF43C: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081BF44A - b _081BF592 -_081BF44A: - ldr r0, =0x030012b8 - ldr r1, [r0] - movs r0, 0x2 - b _081BF590 - .pool -_081BF45C: - movs r0, 0 - bl sub_81BF7A4 - cmp r0, 0 - beq _081BF468 - b _081BF592 -_081BF468: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081BF476 - b _081BF592 -_081BF476: - ldr r0, =0x030012b8 - ldr r1, [r0] - movs r0, 0x3 - b _081BF590 - .pool -_081BF488: - movs r0, 0x1 - bl sub_81BF7A4 - cmp r0, 0x1 - beq _081BF494 - b _081BF592 -_081BF494: - ldr r4, =0x030012b8 - ldr r0, [r4] - ldr r1, =gUnknown_089A6550 - str r1, [r0, 0x2C] - adds r0, 0x4F - movs r5, 0 - strb r5, [r0] - ldr r0, [r4] - adds r0, 0x4 - bl MultiBootInit - ldr r1, [r4] - strh r5, [r1, 0x2] - movs r0, 0x4 - b _081BF590 - .pool -_081BF4BC: - adds r4, r5, 0 - ldr r0, [r4] - adds r0, 0x4 - bl MultiBootMain - ldr r4, [r4] - ldrb r0, [r4, 0x1C] - cmp r0, 0 - bne _081BF4D8 - ldr r0, [r4, 0x20] - ldr r1, =0x00020200 - ands r0, r1 - cmp r0, r1 - beq _081BF4E4 -_081BF4D8: - movs r0, 0 - strh r0, [r4, 0x2] - b _081BF592 - .pool -_081BF4E4: - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xB4 - bls _081BF592 - adds r0, r4, 0x4 - ldr r1, =gMultiBootProgram_BerryGlitchFix_Start - ldr r2, =gMultiBootProgram_BerryGlitchFix_End - subs r2, r1 - movs r3, 0x1 - str r3, [sp] - movs r3, 0x4 - bl MultiBootStartMaster - ldr r1, [r5] - movs r0, 0x5 - b _081BF590 - .pool -_081BF514: - movs r0, 0x2 - bl sub_81BF7A4 - adds r4, r0, 0 - cmp r4, 0x2 - bne _081BF592 - ldr r5, =0x030012b8 - ldr r0, [r5] - adds r0, 0x4 - bl MultiBootMain - ldr r0, [r5] - adds r0, 0x4 - bl MultiBootCheckComplete - cmp r0, 0 - beq _081BF540 - ldr r1, [r5] - movs r0, 0x6 - b _081BF590 - .pool -_081BF540: - ldr r1, [r5] - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - ands r4, r0 - cmp r4, 0 - bne _081BF592 - movs r0, 0x7 - b _081BF590 -_081BF552: - movs r0, 0x3 - bl sub_81BF7A4 - cmp r0, 0x3 - bne _081BF592 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081BF592 - bl Reset - b _081BF592 - .pool -_081BF574: - movs r0, 0x4 - bl sub_81BF7A4 - cmp r0, 0x4 - bne _081BF592 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081BF592 - ldr r0, =0x030012b8 - ldr r1, [r0] - movs r0, 0x1 -_081BF590: - strb r0, [r1] -_081BF592: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BF3DC - - thumb_func_start sub_81BF5A4 -sub_81BF5A4: @ 81BF5A4 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x10 - movs r0, 0x8 - movs r1, 0 - bl SetGpuReg - movs r0, 0xA - movs r1, 0 - bl SetGpuReg - movs r0, 0x10 - movs r1, 0 - bl SetGpuReg - movs r0, 0x12 - movs r1, 0 - bl SetGpuReg - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - movs r0, 0x16 - movs r1, 0 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r1, 0 - str r1, [sp, 0xC] - ldr r4, =0x040000d4 - add r0, sp, 0xC - str r0, [r4] - movs r0, 0xC0 - lsls r0, 19 - str r0, [r4, 0x4] - ldr r0, =0x85006000 - str r0, [r4, 0x8] - ldr r0, [r4, 0x8] - str r1, [sp, 0xC] - add r0, sp, 0xC - str r0, [r4] - movs r0, 0xE0 - lsls r0, 19 - str r0, [r4, 0x4] - ldr r2, =0x85000100 - str r2, [r4, 0x8] - ldr r0, [r4, 0x8] - str r1, [sp, 0xC] - add r0, sp, 0xC - str r0, [r4] - movs r0, 0xA0 - lsls r0, 19 - str r0, [r4, 0x4] - str r2, [r4, 0x8] - ldr r0, [r4, 0x8] - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_08618108 - movs r0, 0 - movs r2, 0x2 - bl InitBgsFromTemplates - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - ldr r0, =gUnknown_08618110 - bl InitWindows - bl DeactivateAllTextPrinters - ldr r0, =gUnknown_08618138 - str r0, [r4] - ldr r0, =0x050001e0 - str r0, [r4, 0x4] - ldr r0, =0x84000008 - str r0, [r4, 0x8] - ldr r0, [r4, 0x8] - movs r0, 0 - movs r1, 0x40 - bl SetGpuReg - movs r0, 0x2 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x3 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0 - movs r1, 0xAA - bl FillWindowPixelBuffer - ldr r5, =gUnknown_08617E9B - movs r0, 0 - adds r1, r5, 0 - movs r2, 0 - bl GetStringWidth - adds r1, r0, 0 - movs r4, 0x78 - subs r0, r4, r1 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - lsls r2, r0, 24 - lsrs r2, 24 - ldr r6, =gUnknown_0861815B - str r6, [sp] - movs r0, 0x1 - negs r0, r0 - mov r8, r0 - str r0, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x2 - movs r1, 0 - movs r3, 0x3 - bl box_print - ldr r5, =gUnknown_08617E8D - movs r0, 0 - adds r1, r5, 0 - movs r2, 0 - bl GetStringWidth - adds r1, r0, 0 - subs r4, r1 - lsrs r0, r4, 31 - adds r4, r0 - asrs r4, 1 - adds r0, r4, 0 - adds r0, 0x78 - lsls r2, r0, 24 - lsrs r2, 24 - str r6, [sp] - mov r0, r8 - str r0, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x2 - movs r1, 0 - movs r3, 0x3 - bl box_print - movs r0, 0 - adds r1, r5, 0 - movs r2, 0 - bl GetStringWidth - adds r1, r0, 0 - movs r0, 0x70 - subs r0, r1 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - lsls r2, r0, 24 - lsrs r2, 24 - str r6, [sp] - mov r0, r8 - str r0, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x3 - movs r1, 0 - movs r3, 0 - bl box_print - ldr r4, =gUnknown_08617E78 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0 - bl GetStringWidth - adds r1, r0, 0 - movs r0, 0xD0 - subs r0, r1 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - lsls r2, r0, 24 - lsrs r2, 24 - ldr r0, =gUnknown_08618158 - str r0, [sp] - mov r0, r8 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r3, 0x2 - bl box_print - movs r0, 0x2 - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0x3 - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BF5A4 - - thumb_func_start sub_81BF7A4 -sub_81BF7A4: @ 81BF7A4 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =0x030012b8 - ldr r0, [r5] - ldrb r0, [r0, 0x1] - cmp r0, r4 - bne _081BF7BC - adds r0, r4, 0 - b _081BF7DC - .pool -_081BF7BC: - cmp r0, 0x6 - bne _081BF7CC - adds r0, r4, 0 - bl sub_81BF7E8 - ldr r0, [r5] - strb r4, [r0, 0x1] - b _081BF7D6 -_081BF7CC: - bl sub_81BF8D8 - ldr r1, [r5] - movs r0, 0x6 - strb r0, [r1, 0x1] -_081BF7D6: - ldr r0, =0x030012b8 - ldr r0, [r0] - ldrb r0, [r0, 0x1] -_081BF7DC: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81BF7A4 - - thumb_func_start sub_81BF7E8 -sub_81BF7E8: @ 81BF7E8 - push {r4-r6,lr} - sub sp, 0xC - adds r6, r0, 0 - movs r0, 0x20 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0x1 - movs r1, 0xAA - bl FillWindowPixelBuffer - ldr r0, =gUnknown_08618158 - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - ldr r0, =gUnknown_08618160 - lsls r4, r6, 2 - adds r0, r4, r0 - ldr r0, [r0] - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - movs r3, 0 - bl box_print - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0x1 - movs r1, 0x2 - bl CopyWindowToVram - cmp r6, 0x5 - bhi _081BF87E - ldr r0, =_081BF850 - adds r0, r4, r0 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081BF850: - .4byte _081BF868 - .4byte _081BF870 - .4byte _081BF868 - .4byte _081BF868 - .4byte _081BF868 - .4byte _081BF878 -_081BF868: - movs r0, 0x2 - bl PutWindowTilemap - b _081BF87E -_081BF870: - movs r0, 0x3 - bl PutWindowTilemap - b _081BF87E -_081BF878: - movs r0, 0 - bl PutWindowTilemap -_081BF87E: - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r5, =gUnknown_08618178 - lsls r4, r6, 1 - adds r4, r6 - lsls r4, 2 - adds r0, r4, r5 - ldr r0, [r0] - ldr r1, =0x06004000 - bl LZ77UnCompVram - adds r0, r5, 0x4 - adds r0, r4, r0 - ldr r0, [r0] - ldr r1, =0x0600f800 - bl LZ77UnCompVram - adds r5, 0x8 - adds r4, r5 - ldr r0, [r4] - movs r1, 0xA0 - lsls r1, 19 - ldr r2, =0x04000040 - bl CpuSet - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BF7E8 - - thumb_func_start sub_81BF8D8 -sub_81BF8D8: @ 81BF8D8 - push {lr} - movs r0, 0 - bl HideBg - movs r0, 0x1 - bl HideBg - pop {r0} - bx r0 - thumb_func_end sub_81BF8D8 - - thumb_func_start sub_81BF8EC -sub_81BF8EC: @ 81BF8EC - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r8, r1 - adds r5, r2, 0 - adds r6, r3, 0 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - ldr r4, =0x0203cf1c - ldr r0, =0x000040f8 - bl AllocZeroed - str r0, [r4] - ldr r1, =0x000040bc - adds r0, r1 - strb r7, [r0] - ldr r0, [r4] - mov r2, r8 - str r2, [r0] - adds r1, 0x2 - adds r0, r1 - strb r5, [r0] - ldr r0, [r4] - ldr r2, =0x000040bf - adds r0, r2 - strb r6, [r0] - ldr r1, [r4] - ldr r0, [sp, 0x18] - str r0, [r1, 0x4] - cmp r7, 0x2 - bne _081BF94C - subs r2, 0x2 - adds r1, r2 - movs r0, 0x1 - b _081BF952 - .pool -_081BF94C: - ldr r0, =0x000040bd - adds r1, r0 - movs r0, 0 -_081BF952: - strb r0, [r1] - cmp r7, 0x1 - beq _081BF9A0 - cmp r7, 0x1 - bgt _081BF96C - cmp r7, 0 - beq _081BF97C - ldr r2, =0x0203cf1c - b _081BF9EE - .pool -_081BF96C: - cmp r7, 0x2 - beq _081BF97C - cmp r7, 0x3 - beq _081BF9D0 - ldr r2, =0x0203cf1c - b _081BF9EE - .pool -_081BF97C: - ldr r2, =0x0203cf1c - ldr r0, [r2] - ldr r1, =0x000040c1 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - ldr r1, =0x000040c2 - adds r0, r1 - movs r1, 0x3 - b _081BF9EC - .pool -_081BF9A0: - ldr r2, =0x0203cf1c - ldr r0, [r2] - ldr r1, =0x000040c1 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - ldr r1, =0x000040c2 - adds r0, r1 - movs r1, 0x3 - strb r1, [r0] - ldr r0, [r2] - ldr r1, =0x000040c8 - adds r0, r1 - strb r7, [r0] - b _081BF9EE - .pool -_081BF9D0: - ldr r2, =0x0203cf1c - ldr r0, [r2] - ldr r1, =0x000040c1 - adds r0, r1 - movs r1, 0x2 - strb r1, [r0] - ldr r0, [r2] - ldr r1, =0x000040c2 - adds r0, r1 - strb r7, [r0] - ldr r0, [r2] - adds r1, 0x1 - adds r0, r1 - movs r1, 0x1 -_081BF9EC: - strb r1, [r0] -_081BF9EE: - ldr r0, [r2] - ldr r2, =0x000040c1 - adds r1, r0, r2 - ldrb r1, [r1] - subs r2, 0x1 - adds r0, r2 - strb r1, [r0] - movs r0, 0xFF - bl sub_81C488C - ldr r0, =0x020244d4 - ldr r0, [r0] - cmp r0, 0 - bne _081BFA12 - movs r0, 0 - movs r1, 0 - bl sub_806F2AC -_081BFA12: - ldr r0, =sub_81BFAE4 - bl SetMainCallback2 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BF8EC - - thumb_func_start sub_81BFA38 -sub_81BFA38: @ 81BFA38 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x4 - mov r8, r0 - adds r4, r1, 0 - adds r5, r2, 0 - ldr r6, [sp, 0x18] - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 16 - lsrs r6, 16 - str r3, [sp] - movs r0, 0x3 - mov r1, r8 - adds r2, r4, 0 - adds r3, r5, 0 - bl sub_81BF8EC - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040c4 - adds r0, r1 - strh r6, [r0] - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BFA38 - - thumb_func_start sub_81BFA80 -sub_81BFA80: @ 81BFA80 - push {r4,lr} - sub sp, 0x4 - ldr r4, [sp, 0xC] - lsls r0, 24 - lsrs r0, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - str r4, [sp] - bl sub_81BF8EC - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040ef - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BFA80 - - thumb_func_start sub_81BFAB4 -sub_81BFAB4: @ 81BFAB4 - push {lr} - bl RunActiveTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl do_scheduled_bg_tilemap_copies_to_vram - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_81BFAB4 - - thumb_func_start sub_81BFAD0 -sub_81BFAD0: @ 81BFAD0 - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_81BFAD0 - - thumb_func_start sub_81BFAE4 -sub_81BFAE4: @ 81BFAE4 - push {lr} -_081BFAE6: - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081BFB0A - bl sub_81BFB10 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081BFB0A - bl sub_81221AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081BFAE6 -_081BFB0A: - pop {r0} - bx r0 - thumb_func_end sub_81BFAE4 - - thumb_func_start sub_81BFB10 -sub_81BFB10: @ 81BFB10 - push {r4,lr} - sub sp, 0x4 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x18 - bls _081BFB24 - b _081BFE00 -_081BFB24: - lsls r0, 2 - ldr r1, =_081BFB38 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081BFB38: - .4byte _081BFB9C - .4byte _081BFBAA - .4byte _081BFBBC - .4byte _081BFBD0 - .4byte _081BFBE4 - .4byte _081BFBEA - .4byte _081BFC04 - .4byte _081BFC20 - .4byte _081BFC26 - .4byte _081BFC38 - .4byte _081BFC58 - .4byte _081BFC7C - .4byte _081BFC82 - .4byte _081BFC94 - .4byte _081BFCAC - .4byte _081BFCC0 - .4byte _081BFCD8 - .4byte _081BFCF8 - .4byte _081BFD34 - .4byte _081BFD50 - .4byte _081BFD60 - .4byte _081BFD74 - .4byte _081BFD7A - .4byte _081BFDB0 - .4byte _081BFDCC -_081BFB9C: - bl SetVBlankHBlankCallbacksToNull - bl sub_8121DA0 - bl clear_scheduled_bg_copies_to_vram - b _081BFDE6 -_081BFBAA: - bl remove_some_task - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081BFDEE - .pool -_081BFBBC: - bl sub_80A1A74 - ldr r2, =0x02037fd4 - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - b _081BFDE4 - .pool -_081BFBD0: - bl ResetAllObjectData - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081BFDEE - .pool -_081BFBE4: - bl ResetObjectPaletteAllocator - b _081BFDE6 -_081BFBEA: - bl sub_81BFE24 - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040f0 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - b _081BFDE6 - .pool -_081BFC04: - bl sub_81BFEB0 - lsls r0, 24 - cmp r0, 0 - bne _081BFC10 - b _081BFE18 -_081BFC10: - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081BFDEE - .pool -_081BFC20: - bl sub_81C2554 - b _081BFDE6 -_081BFC26: - bl sub_81C1BA0 - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081BFDEE - .pool -_081BFC38: - ldr r4, =0x0203cf1c - ldr r0, [r4] - adds r0, 0xC - bl sub_81C0098 - ldr r0, [r4] - ldr r1, =0x000040f0 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - b _081BFDE6 - .pool -_081BFC58: - ldr r0, =0x0203cf1c - ldr r0, [r0] - adds r0, 0xC - bl sub_81C00F0 - lsls r0, 24 - cmp r0, 0 - bne _081BFC6A - b _081BFE18 -_081BFC6A: - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081BFDEE - .pool -_081BFC7C: - bl sub_81C25E8 - b _081BFDE6 -_081BFC82: - bl sub_81C286C - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081BFDEE - .pool -_081BFC94: - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040c0 - adds r0, r1 - ldrb r0, [r0] - bl sub_81C2D9C - b _081BFDE6 - .pool -_081BFCAC: - bl sub_81C0348 - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081BFDEE - .pool -_081BFCC0: - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040c0 - adds r0, r1 - ldrb r0, [r0] - bl sub_81C2AFC - b _081BFDE6 - .pool -_081BFCD8: - bl sub_81C4190 - bl sub_81C42C8 - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040f0 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - b _081BFDE6 - .pool -_081BFCF8: - ldr r4, =0x0203cf1c - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0xC - ldr r2, =0x000040f0 - adds r1, r2 - bl sub_81C45F4 - ldr r1, [r4] - ldr r2, =0x000040d3 - adds r1, r2 - strb r0, [r1] - ldr r1, [r4] - adds r2, r1, r2 - ldrb r0, [r2] - cmp r0, 0xFF - bne _081BFD1C - b _081BFE18 -_081BFD1C: - ldr r0, =0x000040f0 - adds r1, r0 - movs r0, 0 - strh r0, [r1] - b _081BFDE6 - .pool -_081BFD34: - ldr r0, =0x0203cf1c - ldr r0, [r0] - adds r0, 0xC - bl sub_81C4984 - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081BFDEE - .pool -_081BFD50: - ldr r0, =0x0203cf1c - ldr r0, [r0] - adds r0, 0xC - bl sub_81C4A08 - b _081BFDE6 - .pool -_081BFD60: - bl sub_81C4A88 - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081BFDEE - .pool -_081BFD74: - bl sub_81C4280 - b _081BFDE6 -_081BFD7A: - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040bc - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3 - beq _081BFDA0 - ldr r0, =sub_81C0510 - movs r1, 0 - bl AddTask - b _081BFDE6 - .pool -_081BFDA0: - ldr r0, =sub_81C171C - movs r1, 0 - bl AddTask - b _081BFDE6 - .pool -_081BFDB0: - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081BFDEE - .pool -_081BFDCC: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 -_081BFDE4: - strb r0, [r2, 0x8] -_081BFDE6: - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 -_081BFDEE: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _081BFE18 - .pool -_081BFE00: - ldr r0, =sub_81BFAD0 - bl SetVBlankCallback - ldr r0, =sub_81BFAB4 - bl SetMainCallback2 - movs r0, 0x1 - b _081BFE1A - .pool -_081BFE18: - movs r0, 0 -_081BFE1A: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81BFB10 - - thumb_func_start sub_81BFE24 -sub_81BFE24: @ 81BFE24 - push {r4,lr} - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0861CBB4 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - ldr r4, =0x0203cf1c - ldr r1, [r4] - ldr r0, =0x000020bc - adds r1, r0 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x000010bc - adds r1, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - ldr r1, [r4] - adds r1, 0xBC - movs r0, 0x3 - bl SetBgTilemapBuffer - bl sub_8121E10 - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x3 - bl schedule_bg_copy_tilemap_to_vram - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BFE24 - - thumb_func_start sub_81BFEB0 -sub_81BFEB0: @ 81BFEB0 - push {r4,lr} - sub sp, 0x4 - ldr r1, =0x0203cf1c - ldr r0, [r1] - ldr r2, =0x000040f0 - adds r0, r2 - movs r2, 0 - ldrsh r0, [r0, r2] - adds r4, r1, 0 - cmp r0, 0xC - bls _081BFEC8 - b _081C008C -_081BFEC8: - lsls r0, 2 - ldr r1, =_081BFEE0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081BFEE0: - .4byte _081BFF14 - .4byte _081BFF30 - .4byte _081BFF60 - .4byte _081BFF78 - .4byte _081BFF90 - .4byte _081BFFA8 - .4byte _081BFFC0 - .4byte _081BFFF0 - .4byte _081BFFFC - .4byte _081C0018 - .4byte _081C0024 - .4byte _081C0040 - .4byte _081C0064 -_081BFF14: - bl reset_temp_tile_data_buffers - ldr r1, =gUnknown_08D97D0C - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - b _081C0046 - .pool -_081BFF30: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081BFF3E - b _081C008C -_081BFF3E: - ldr r0, =gUnknown_08D9862C - ldr r4, =0x0203cf1c - ldr r1, [r4] - adds r1, 0xBC - bl LZDecompressWram - ldr r1, [r4] - ldr r2, =0x000040f0 - adds r1, r2 - b _081C004E - .pool -_081BFF60: - ldr r0, =gUnknown_08D98CC8 - ldr r1, [r4] - ldr r2, =0x000008bc - adds r1, r2 - bl LZDecompressWram - ldr r1, [r4] - b _081C004A - .pool -_081BFF78: - ldr r0, =gUnknown_08D987FC - ldr r1, [r4] - ldr r2, =0x000018bc - adds r1, r2 - bl LZDecompressWram - ldr r1, [r4] - b _081C004A - .pool -_081BFF90: - ldr r0, =gUnknown_08D9898C - ldr r1, [r4] - ldr r2, =0x000028bc - adds r1, r2 - bl LZDecompressWram - ldr r1, [r4] - b _081C004A - .pool -_081BFFA8: - ldr r0, =gUnknown_08D98B28 - ldr r1, [r4] - ldr r2, =0x000038bc - adds r1, r2 - bl LZDecompressWram - ldr r1, [r4] - b _081C004A - .pool -_081BFFC0: - ldr r0, =gUnknown_08D9853C - movs r2, 0x80 - lsls r2, 1 - movs r1, 0 - bl decompress_palette - ldr r0, =gUnknown_08D85620 - movs r1, 0x81 - movs r2, 0x1E - bl gpu_pal_apply - ldr r0, =0x0203cf1c - ldr r1, [r0] - ldr r2, =0x000040f0 - adds r1, r2 - b _081C004E - .pool -_081BFFF0: - ldr r0, =gUnknown_0861CFBC - bl LoadCompressedObjectPic - b _081C0046 - .pool -_081BFFFC: - ldr r0, =gUnknown_0861D074 - bl LoadCompressedObjectPic - ldr r0, =0x0203cf1c - ldr r1, [r0] - ldr r2, =0x000040f0 - adds r1, r2 - b _081C004E - .pool -_081C0018: - ldr r0, =gUnknown_0861D0F8 - bl LoadCompressedObjectPic - b _081C0046 - .pool -_081C0024: - ldr r0, =gUnknown_0861D100 - bl LoadCompressedObjectPalette - ldr r0, =0x0203cf1c - ldr r1, [r0] - ldr r2, =0x000040f0 - adds r1, r2 - b _081C004E - .pool -_081C0040: - ldr r0, =gUnknown_0861D07C - bl LoadCompressedObjectPalette -_081C0046: - ldr r0, =0x0203cf1c - ldr r1, [r0] -_081C004A: - ldr r0, =0x000040f0 - adds r1, r0 -_081C004E: - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _081C008C - .pool -_081C0064: - ldr r0, =gUnknown_08D97B84 - movs r1, 0xE8 - lsls r1, 1 - movs r2, 0x60 - bl decompress_palette - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040f0 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - movs r0, 0x1 - b _081C008E - .pool -_081C008C: - movs r0, 0 -_081C008E: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81BFEB0 - - thumb_func_start sub_81C0098 -sub_81C0098: @ 81C0098 - push {r4,lr} - adds r3, r0, 0 - ldr r0, =0x0203cf1c - ldr r1, [r0] - ldr r2, =0x000040bd - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _081C00D0 - ldr r2, [r1] - ldr r4, =0x000040be - adds r0, r1, r4 - ldrb r1, [r0] - movs r0, 0x64 - muls r1, r0 - adds r1, r2 - adds r0, r3, 0 - movs r2, 0x64 - bl memcpy - b _081C00E6 - .pool -_081C00D0: - ldr r0, [r1] - ldr r2, =0x000040be - adds r1, r2 - ldrb r2, [r1] - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 4 - adds r0, r1 - adds r1, r3, 0 - bl sub_8069004 -_081C00E6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0098 - - thumb_func_start sub_81C00F0 -sub_81C00F0: @ 81C00F0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r5, r0, 0 - ldr r0, =0x0203cf1c - ldr r7, [r0] - adds r6, r7, 0 - adds r6, 0x70 - ldr r1, =0x000040f0 - adds r0, r7, r1 - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r0, 0x1 - beq _081C0198 - cmp r0, 0x1 - bgt _081C0120 - cmp r0, 0 - beq _081C012C - b _081C0314 - .pool -_081C0120: - cmp r0, 0x2 - beq _081C01DC - cmp r0, 0x3 - bne _081C012A - b _081C02A8 -_081C012A: - b _081C0314 -_081C012C: - adds r0, r5, 0 - movs r1, 0xB - bl pokemon_getattr - strh r0, [r6] - adds r0, r5, 0 - movs r1, 0x41 - bl pokemon_getattr - strh r0, [r6, 0x2] - adds r0, r5, 0 - movs r1, 0x19 - bl pokemon_getattr - str r0, [r6, 0x10] - adds r0, r5, 0 - movs r1, 0x38 - bl pokemon_getattr - strb r0, [r6, 0x5] - adds r0, r5, 0 - movs r1, 0x2E - bl pokemon_getattr - strb r0, [r6, 0x8] - adds r0, r5, 0 - movs r1, 0xC - bl pokemon_getattr - strh r0, [r6, 0x2E] - adds r0, r5, 0 - movs r1, 0 - bl pokemon_getattr - str r0, [r6, 0xC] - adds r0, r5, 0 - movs r1, 0x4 - bl pokemon_getattr - adds r1, r7, 0 - adds r1, 0xA5 - strb r0, [r1] - lsls r0, 24 - cmp r0, 0 - beq _081C018C - movs r0, 0x1 - strb r0, [r6, 0x4] - b _081C0322 -_081C018C: - adds r0, r5, 0 - movs r1, 0x2D - bl pokemon_getattr - strb r0, [r6, 0x4] - b _081C0322 -_081C0198: - movs r4, 0 - movs r0, 0x8C - adds r0, r7 - mov r8, r0 - movs r1, 0xA4 - adds r1, r7 - mov r9, r1 - adds r6, r7, 0 - adds r6, 0x84 -_081C01AA: - adds r1, r4, 0 - adds r1, 0xD - adds r0, r5, 0 - bl pokemon_getattr - strh r0, [r6] - adds r1, r4, 0 - adds r1, 0x11 - adds r0, r5, 0 - bl pokemon_getattr - mov r2, r8 - adds r1, r2, r4 - strb r0, [r1] - adds r6, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - bls _081C01AA - adds r0, r5, 0 - movs r1, 0x15 - bl pokemon_getattr - mov r1, r9 - strb r0, [r1] - b _081C0322 -_081C01DC: - ldr r1, [r7] - ldr r0, =0x020244ec - cmp r1, r0 - beq _081C01F8 - ldr r2, =0x000040bc - adds r0, r7, r2 - ldrb r0, [r0] - cmp r0, 0x2 - beq _081C01F8 - ldr r1, =0x000040ef - adds r0, r7, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081C0254 -_081C01F8: - adds r0, r5, 0 - bl GetNature - adds r1, r6, 0 - adds r1, 0x33 - strb r0, [r1] - adds r0, r5, 0 - movs r1, 0x39 - bl pokemon_getattr - strh r0, [r6, 0x20] - adds r0, r5, 0 - movs r1, 0x3A - bl pokemon_getattr - strh r0, [r6, 0x22] - adds r0, r5, 0 - movs r1, 0x3B - bl pokemon_getattr - strh r0, [r6, 0x24] - adds r0, r5, 0 - movs r1, 0x3C - bl pokemon_getattr - strh r0, [r6, 0x26] - adds r0, r5, 0 - movs r1, 0x3E - bl pokemon_getattr - strh r0, [r6, 0x28] - adds r0, r5, 0 - movs r1, 0x3F - bl pokemon_getattr - strh r0, [r6, 0x2A] - adds r0, r5, 0 - movs r1, 0x3D - b _081C02A0 - .pool -_081C0254: - adds r0, r5, 0 - bl GetNature - adds r1, r7, 0 - adds r1, 0xA3 - strb r0, [r1] - adds r0, r5, 0 - movs r1, 0x39 - bl pokemon_getattr - strh r0, [r6, 0x20] - adds r0, r5, 0 - movs r1, 0x3A - bl pokemon_getattr - strh r0, [r6, 0x22] - adds r0, r5, 0 - movs r1, 0x54 - bl pokemon_getattr - strh r0, [r6, 0x24] - adds r0, r5, 0 - movs r1, 0x55 - bl pokemon_getattr - strh r0, [r6, 0x26] - adds r0, r5, 0 - movs r1, 0x57 - bl pokemon_getattr - strh r0, [r6, 0x28] - adds r0, r5, 0 - movs r1, 0x58 - bl pokemon_getattr - strh r0, [r6, 0x2A] - adds r0, r5, 0 - movs r1, 0x56 -_081C02A0: - bl pokemon_getattr - strh r0, [r6, 0x2C] - b _081C0322 -_081C02A8: - adds r4, r7, 0 - adds r4, 0xA6 - adds r0, r5, 0 - movs r1, 0x7 - adds r2, r4, 0 - bl pokemon_getattr - adds r0, r5, 0 - movs r1, 0x3 - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StopMusicWhileStringIsPrinted - adds r0, r5, 0 - bl sub_81B205C - strb r0, [r6, 0x7] - adds r0, r5, 0 - movs r1, 0x31 - bl pokemon_getattr - adds r1, r7, 0 - adds r1, 0xA2 - strb r0, [r1] - adds r0, r5, 0 - movs r1, 0x1 - bl pokemon_getattr - str r0, [r6, 0x48] - adds r0, r5, 0 - movs r1, 0x23 - bl pokemon_getattr - strb r0, [r6, 0x9] - adds r0, r5, 0 - movs r1, 0x24 - bl pokemon_getattr - strb r0, [r6, 0xA] - adds r0, r5, 0 - movs r1, 0x25 - bl pokemon_getattr - strb r0, [r6, 0xB] - adds r0, r5, 0 - movs r1, 0x20 - bl pokemon_getattr - strh r0, [r6, 0x30] - b _081C0322 -_081C0314: - adds r0, r5, 0 - movs r1, 0x52 - bl pokemon_getattr - strb r0, [r6, 0x6] - movs r0, 0x1 - b _081C0332 -_081C0322: - ldr r0, =0x0203cf1c - ldr r1, [r0] - ldr r2, =0x000040f0 - adds r1, r2 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - movs r0, 0 -_081C0332: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81C00F0 - - thumb_func_start sub_81C0348 -sub_81C0348: @ 81C0348 - push {r4-r6,lr} - ldr r6, =0x0203cf1c - ldr r2, [r6] - ldr r1, =0x000040c0 - adds r0, r2, r1 - ldrb r0, [r0] - subs r0, 0x2 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _081C037C - movs r0, 0 - movs r1, 0xFF - bl sub_81C1DA4 - movs r0, 0 - movs r1, 0xFF - movs r2, 0 - bl sub_81C1EFC - b _081C03D8 - .pool -_081C037C: - ldr r1, =0x000040c6 - adds r0, r2, r1 - ldrb r1, [r0] - lsls r1, 1 - adds r0, r2, 0 - adds r0, 0x84 - adds r0, r1 - ldrh r0, [r0] - bl sub_81C240C - ldr r0, [r6] - ldr r5, =0x000020bc - adds r0, r5 - movs r1, 0x3 - movs r2, 0 - bl sub_81C2194 - ldr r0, [r6] - ldr r4, =0x000030bc - adds r0, r4 - movs r1, 0x1 - movs r2, 0 - bl sub_81C2194 - ldr r1, [r6] - adds r1, r4 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r6] - adds r1, r5 - movs r0, 0x2 - bl SetBgTilemapBuffer - movs r1, 0x80 - lsls r1, 9 - movs r0, 0x2 - movs r2, 0x1 - bl ChangeBgX - movs r0, 0x13 - bl ClearWindowTilemap - movs r0, 0xD - bl ClearWindowTilemap -_081C03D8: - ldr r0, =0x0203cf1c - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x77 - ldrb r0, [r0] - cmp r0, 0 - bne _081C0400 - movs r0, 0 - movs r1, 0xFF - bl sub_81C2074 - b _081C0416 - .pool -_081C0400: - ldr r2, =0x000040c0 - adds r0, r1, r2 - ldrb r0, [r0] - subs r0, 0x2 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _081C0416 - movs r0, 0xD - bl PutWindowTilemap -_081C0416: - bl sub_81C2524 - ldr r0, =0x0203cf1c - ldr r0, [r0] - adds r0, 0xC - bl sub_81C2228 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0348 - - thumb_func_start sub_81C0434 -sub_81C0434: @ 81C0434 - push {lr} - bl FreeAllWindowBuffers - ldr r0, =0x0203cf1c - ldr r0, [r0] - bl Free - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0434 - - thumb_func_start sub_81C044C -sub_81C044C: @ 81C044C - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81C0484 - str r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C044C - - thumb_func_start sub_81C0484 -sub_81C0484: @ 81C0484 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C04EC - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081C04EC - ldr r4, =0x0203cf1c - ldr r0, [r4] - ldr r0, [r0, 0x4] - bl SetMainCallback2 - ldr r1, =0x0203cf20 - ldr r0, [r4] - ldr r2, =0x000040be - adds r0, r2 - ldrb r0, [r0] - strb r0, [r1] - bl sub_81C4898 - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - bl sub_80A369C - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl MPlayVolumeControl - ldr r0, =0x020244d4 - ldr r0, [r0] - cmp r0, 0 - bne _081C04E2 - movs r0, 0 - bl sub_806F47C -_081C04E2: - bl sub_81C0434 - adds r0, r5, 0 - bl remove_task -_081C04EC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0484 - - thumb_func_start sub_81C0510 -sub_81C0510: @ 81C0510 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C05FE - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r2, 0x80 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _081C05FE - ldr r5, =0x030022c0 - ldrh r1, [r5, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081C0550 - movs r1, 0x1 - negs r1, r1 - adds r0, r4, 0 - bl sub_81C0604 - b _081C05FE - .pool -_081C0550: - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _081C0562 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81C0604 - b _081C05FE -_081C0562: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _081C0576 - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C0582 -_081C0576: - movs r1, 0x1 - negs r1, r1 - adds r0, r4, 0 - bl sub_81C0A8C - b _081C05FE -_081C0582: - ldrh r1, [r5, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _081C0598 - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _081C05A2 -_081C0598: - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81C0A8C - b _081C05FE -_081C05A2: - ldrh r1, [r5, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081C05E6 - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040c0 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _081C05FE - cmp r0, 0 - bne _081C05D8 - bl sub_81C48F0 - movs r0, 0x5 - bl audio_play - adds r0, r4, 0 - bl sub_81C044C - b _081C05FE - .pool -_081C05D8: - movs r0, 0x5 - bl audio_play - adds r0, r4, 0 - bl sub_81C0E48 - b _081C05FE -_081C05E6: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081C05FE - bl sub_81C48F0 - movs r0, 0x5 - bl audio_play - adds r0, r4, 0 - bl sub_81C044C -_081C05FE: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81C0510 - - thumb_func_start sub_81C0604 -sub_81C0604: @ 81C0604 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - adds r4, r5, 0 - ldr r1, =0x0203cf1c - ldr r3, [r1] - ldr r2, =0x000040c3 - adds r0, r3, r2 - ldrb r0, [r0] - adds r6, r1, 0 - cmp r0, 0 - bne _081C06EE - ldr r1, =0x000040bd - adds r0, r3, r1 - ldrb r2, [r0] - cmp r2, 0x1 - bne _081C0678 - adds r1, 0x3 - adds r0, r3, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _081C0654 - lsls r1, r5, 24 - asrs r1, 24 - movs r4, 0x2 - eors r1, r2 - negs r0, r1 - orrs r0, r1 - asrs r0, 31 - ands r4, r0 - b _081C065C - .pool -_081C0654: - movs r4, 0x3 - cmp r5, 0x1 - bne _081C065C - movs r4, 0x1 -_081C065C: - ldr r2, [r6] - ldr r0, [r2] - ldr r3, =0x000040be - adds r1, r2, r3 - ldrb r1, [r1] - adds r3, 0x1 - adds r2, r3 - ldrb r2, [r2] - adds r3, r4, 0 - bl sub_80D214C - b _081C0696 - .pool -_081C0678: - bl sub_81B1250 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C068E - lsls r0, r5, 24 - asrs r0, 24 - bl sub_81C09B4 - b _081C0696 -_081C068E: - lsls r0, r4, 24 - asrs r0, 24 - bl sub_81C08F8 -_081C0696: - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _081C06EE - movs r0, 0x5 - bl audio_play - ldr r5, =0x0203cf1c - ldr r0, [r5] - adds r0, 0x77 - ldrb r0, [r0] - cmp r0, 0 - beq _081C06D4 - movs r0, 0x2 - movs r1, 0x1 - bl sub_81C4204 - movs r0, 0xD - bl ClearWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0 - movs r1, 0x2 - bl sub_81C2074 -_081C06D4: - ldr r0, [r5] - ldr r1, =0x000040be - adds r0, r1 - movs r2, 0 - strb r4, [r0] - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - strh r2, [r0, 0x8] - ldr r1, =sub_81C0704 - str r1, [r0] -_081C06EE: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0604 - - thumb_func_start sub_81C0704 -sub_81C0704: @ 81C0704 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r4, r1, 3 - ldr r6, =0x03005e08 - adds r5, r4, r6 - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0xC - bls _081C071E - b _081C08BC -_081C071E: - lsls r0, 2 - ldr r1, =_081C0730 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C0730: - .4byte _081C0764 - .4byte _081C076A - .4byte _081C0780 - .4byte _081C07A8 - .4byte _081C07C8 - .4byte _081C07E0 - .4byte _081C07F0 - .4byte _081C0800 - .4byte _081C0828 - .4byte _081C086C - .4byte _081C0872 - .4byte _081C0878 - .4byte _081C0894 -_081C0764: - bl sub_80A369C - b _081C08EC -_081C076A: - bl sub_81C4898 - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040d3 - b _081C0786 - .pool -_081C0780: - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040d4 -_081C0786: - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeResources - b _081C08EC - .pool -_081C07A8: - ldr r4, =0x0203cf1c - ldr r0, [r4] - adds r0, 0xC - bl sub_81C0098 - ldr r0, [r4] - ldr r1, =0x000040f0 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - b _081C08EC - .pool -_081C07C8: - ldr r0, =0x0203cf1c - ldr r0, [r0] - adds r0, 0xC - bl sub_81C00F0 - lsls r0, 24 - cmp r0, 0 - bne _081C07DA - b _081C08F2 -_081C07DA: - b _081C08EC - .pool -_081C07E0: - ldr r0, =0x0203cf1c - ldr r0, [r0] - adds r0, 0xC - bl sub_81C49E0 - b _081C08EC - .pool -_081C07F0: - ldr r0, =0x0203cf1c - ldr r0, [r0] - adds r0, 0xC - bl sub_81C4A08 - b _081C08EC - .pool -_081C0800: - ldr r4, =0x0203cf1c - ldr r0, [r4] - adds r0, 0x77 - ldrb r0, [r0] - cmp r0, 0 - beq _081C0816 - movs r1, 0x2 - negs r1, r1 - movs r0, 0xA - bl sub_81C2074 -_081C0816: - ldr r0, [r4] - adds r0, 0xC - bl sub_81C2228 - movs r0, 0 - strh r0, [r5, 0x2] - b _081C08EC - .pool -_081C0828: - ldr r4, =0x0203cf1c - ldr r0, [r4] - adds r0, 0xC - adds r1, r5, 0x2 - bl sub_81C45F4 - ldr r1, [r4] - ldr r2, =0x000040d3 - adds r1, r2 - strb r0, [r1] - ldr r0, [r4] - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0xFF - beq _081C08F2 - ldr r2, =0x02020630 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x1 - strh r1, [r0, 0x32] - bl sub_81C0E24 - movs r0, 0 - strh r0, [r5, 0x2] - b _081C08EC - .pool -_081C086C: - bl sub_81C4280 - b _081C08EC -_081C0872: - bl sub_81C25E8 - b _081C08EC -_081C0878: - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040c0 - adds r0, r1 - ldrb r0, [r0] - bl sub_81C2D9C - bl sub_81C2524 - b _081C08EC - .pool -_081C0894: - ldr r2, =0x02020630 - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040d3 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strh r1, [r0, 0x32] - b _081C08EC - .pool -_081C08BC: - bl sub_81221EC - lsls r0, 24 - cmp r0, 0 - bne _081C08F2 - ldr r0, =sub_81C20F0 - bl is_function_an_active_task - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _081C08F2 - strh r0, [r5] - adds r0, r6, 0 - subs r0, 0x8 - adds r0, r4, r0 - ldr r1, =sub_81C0510 - str r1, [r0] - b _081C08F2 - .pool -_081C08EC: - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] -_081C08F2: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81C0704 - - thumb_func_start sub_81C08F8 -sub_81C08F8: @ 81C08F8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x0203cf1c - ldr r2, [r1] - ldr r7, [r2] - ldr r3, =0x000040c0 - adds r0, r2, r3 - ldrb r0, [r0] - adds r5, r1, 0 - cmp r0, 0 - bne _081C0960 - lsls r0, r4, 24 - asrs r3, r0, 24 - movs r1, 0x1 - negs r1, r1 - adds r6, r0, 0 - cmp r3, r1 - bne _081C0928 - ldr r1, =0x000040be - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _081C0988 -_081C0928: - asrs r0, r6, 24 - cmp r0, 0x1 - bne _081C0940 - ldr r0, [r5] - ldr r2, =0x000040be - adds r1, r0, r2 - ldr r3, =0x000040bf - adds r0, r3 - ldrb r1, [r1] - ldrb r0, [r0] - cmp r1, r0 - bcs _081C0988 -_081C0940: - ldr r0, [r5] - ldr r1, =0x000040be - adds r0, r1 - ldrb r0, [r0] - adds r0, r4 - lsls r0, 24 - asrs r0, 24 - b _081C09AE - .pool -_081C0960: - ldr r3, =0x000040be - adds r0, r2, r3 - ldrb r5, [r0] - lsls r6, r4, 24 -_081C0968: - lsls r0, r5, 24 - asrs r0, 24 - asrs r1, r6, 24 - adds r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - asrs r4, r0, 24 - cmp r4, 0 - blt _081C0988 - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040bf - adds r0, r1 - ldrb r0, [r0] - cmp r4, r0 - ble _081C099C -_081C0988: - movs r0, 0x1 - negs r0, r0 - b _081C09AE - .pool -_081C099C: - movs r0, 0x64 - muls r0, r4 - adds r0, r7, r0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _081C0968 - adds r0, r4, 0 -_081C09AE: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81C08F8 - - thumb_func_start sub_81C09B4 -sub_81C09B4: @ 81C09B4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - mov r12, r0 - ldr r6, =0x0203cf1c - ldr r0, [r6] - ldr r1, [r0] - mov r8, r1 - movs r5, 0 - movs r2, 0 - ldr r3, =gUnknown_0861CC1C - movs r1, 0 - ldrsb r1, [r3, r1] - ldr r4, =0x000040be - adds r0, r4 - ldrb r0, [r0] - cmp r1, r0 - beq _081C09FC - adds r7, r3, 0 - adds r3, r4, 0 -_081C09E0: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x5 - bhi _081C09FC - adds r0, r2, r7 - movs r1, 0 - ldrsb r1, [r0, r1] - ldr r0, [r6] - adds r0, r3 - ldrb r0, [r0] - cmp r1, r0 - bne _081C09E0 - adds r5, r2, 0 -_081C09FC: - mov r0, r12 - lsls r6, r0, 24 - ldr r7, =gUnknown_0861CC1C -_081C0A02: - lsls r0, r5, 24 - asrs r0, 24 - asrs r1, r6, 24 - adds r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, r5, 24 - lsrs r0, r1, 24 - cmp r0, 0x5 - bhi _081C0A40 - asrs r0, r1, 24 - adds r0, r7 - movs r4, 0 - ldrsb r4, [r0, r4] - movs r0, 0x64 - muls r0, r4 - add r0, r8 - bl sub_81C0A50 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C0A02 - adds r0, r4, 0 - b _081C0A44 - .pool -_081C0A40: - movs r0, 0x1 - negs r0, r0 -_081C0A44: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81C09B4 - - thumb_func_start sub_81C0A50 -sub_81C0A50: @ 81C0A50 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _081C0A84 - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040be - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _081C0A78 - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _081C0A84 -_081C0A78: - movs r0, 0x1 - b _081C0A86 - .pool -_081C0A84: - movs r0, 0 -_081C0A86: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81C0A50 - - thumb_func_start sub_81C0A8C -sub_81C0A8C: @ 81C0A8C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - lsls r0, 24 - lsrs r6, r0, 24 - str r6, [sp] - lsls r1, 24 - lsrs r3, r1, 24 - str r3, [sp, 0x4] - ldr r0, =0x0203cf1c - mov r8, r0 - ldr r2, [r0] - adds r1, r2, 0 - adds r1, 0x70 - lsls r0, r6, 2 - adds r0, r6 - lsls r7, r0, 3 - ldr r0, =0x03005e08 - mov r9, r0 - adds r0, r7, r0 - str r0, [sp, 0x8] - ldrb r1, [r1, 0x4] - mov r10, r1 - cmp r1, 0 - bne _081C0B6E - lsls r0, r3, 24 - asrs r5, r0, 24 - movs r0, 0x1 - negs r0, r0 - cmp r5, r0 - bne _081C0AE0 - ldr r1, =0x000040c0 - adds r0, r2, r1 - ldr r3, =0x000040c1 - adds r1, r2, r3 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - beq _081C0B6E -_081C0AE0: - cmp r5, 0x1 - bne _081C0AF4 - ldr r1, =0x000040c0 - adds r0, r2, r1 - ldr r3, =0x000040c2 - adds r1, r2, r3 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - beq _081C0B6E -_081C0AF4: - movs r0, 0x5 - bl audio_play - mov r1, r8 - ldr r0, [r1] - ldr r4, =0x000040c0 - adds r0, r4 - ldrb r0, [r0] - bl sub_81C2C38 - mov r2, r8 - ldr r1, [r2] - adds r1, r4 - ldrb r0, [r1] - ldr r3, [sp, 0x4] - adds r0, r3 - strb r0, [r1] - mov r1, r10 - ldr r0, [sp, 0x8] - strh r1, [r0] - cmp r5, 0x1 - bne _081C0B4C - ldr r1, =sub_81C0B8C - mov r0, r9 - subs r0, 0x8 - adds r0, r7, r0 - ldr r2, [r0] - adds r0, r6, 0 - bl set_task_function_and_args_14_15 - b _081C0B5C - .pool -_081C0B4C: - ldr r1, =sub_81C0CC4 - mov r0, r9 - subs r0, 0x8 - adds r0, r7, r0 - ldr r2, [r0] - ldr r0, [sp] - bl set_task_function_and_args_14_15 -_081C0B5C: - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r2, =0x000040c0 - adds r0, r2 - ldrb r0, [r0] - bl sub_81C2DE4 - bl sub_81C424C -_081C0B6E: - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0A8C - - thumb_func_start sub_81C0B8C -sub_81C0B8C: @ 81C0B8C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081C0C2A - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r3, =0x000040c9 - adds r0, r3 - ldrb r0, [r0] - cmp r0, 0 - bne _081C0BE0 - movs r0, 0x1 - strh r0, [r4, 0x2] - movs r0, 0x1 - movs r1, 0x7 - movs r2, 0x1 - bl SetBgAttribute - movs r0, 0x2 - movs r1, 0x7 - movs r2, 0x2 - bl SetBgAttribute - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - b _081C0BFE - .pool -_081C0BE0: - movs r0, 0x2 - strh r0, [r4, 0x2] - movs r0, 0x2 - movs r1, 0x7 - movs r2, 0x1 - bl SetBgAttribute - movs r0, 0x1 - movs r1, 0x7 - movs r2, 0x2 - bl SetBgAttribute - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram -_081C0BFE: - ldrb r0, [r4, 0x2] - movs r1, 0 - movs r2, 0 - bl ChangeBgX - ldrb r0, [r4, 0x2] - ldr r1, =0x0203cf1c - ldr r1, [r1] - ldr r3, =0x000040c0 - adds r2, r1, r3 - ldrb r2, [r2] - lsls r2, 12 - adds r2, 0xBC - adds r1, r2 - bl SetBgTilemapBuffer - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg -_081C0C2A: - ldrb r0, [r4, 0x2] - movs r1, 0x80 - lsls r1, 6 - movs r2, 0x1 - bl ChangeBgX - ldrh r0, [r4] - adds r0, 0x20 - strh r0, [r4] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xFF - ble _081C0C52 - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81C0C68 - str r0, [r1] -_081C0C52: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0B8C - - thumb_func_start sub_81C0C68 -sub_81C0C68: @ 81C0C68 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r2, r4, 2 - adds r2, r4 - lsls r2, 3 - ldr r0, =0x03005e08 - adds r2, r0 - ldr r5, =0x0203cf1c - ldr r3, [r5] - ldr r0, =0x000040c9 - adds r3, r0 - ldrb r0, [r3] - movs r1, 0x1 - eors r0, r1 - movs r1, 0 - strb r0, [r3] - strh r1, [r2, 0x2] - strh r1, [r2] - bl sub_81C1BA0 - ldr r0, [r5] - ldr r1, =0x000040c0 - adds r0, r1 - ldrb r0, [r0] - bl sub_81C2AFC - bl sub_81C4280 - bl sub_81C0E24 - adds r0, r4, 0 - bl set_task_function_to_args_14_15 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0C68 - - thumb_func_start sub_81C0CC4 -sub_81C0CC4: @ 81C0CC4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081C0D0C - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040c9 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _081C0CFC - movs r0, 0x2 - b _081C0CFE - .pool -_081C0CFC: - movs r0, 0x1 -_081C0CFE: - strh r0, [r4, 0x2] - ldrb r0, [r4, 0x2] - movs r1, 0x80 - lsls r1, 9 - movs r2, 0 - bl ChangeBgX -_081C0D0C: - ldrb r0, [r4, 0x2] - movs r1, 0x80 - lsls r1, 6 - movs r2, 0x2 - bl ChangeBgX - ldrh r0, [r4] - adds r0, 0x20 - strh r0, [r4] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xFF - ble _081C0D34 - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81C0D44 - str r0, [r1] -_081C0D34: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0CC4 - - thumb_func_start sub_81C0D44 -sub_81C0D44: @ 81C0D44 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040c9 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _081C0D8C - movs r0, 0x1 - movs r1, 0x7 - movs r2, 0x1 - bl SetBgAttribute - movs r0, 0x2 - movs r1, 0x7 - movs r2, 0x2 - bl SetBgAttribute - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - b _081C0DA6 - .pool -_081C0D8C: - movs r0, 0x2 - movs r1, 0x7 - movs r2, 0x1 - bl SetBgAttribute - movs r0, 0x1 - movs r1, 0x7 - movs r2, 0x2 - bl SetBgAttribute - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram -_081C0DA6: - ldr r6, =0x0203cf1c - ldr r2, [r6] - ldr r7, =0x000040c0 - adds r1, r2, r7 - ldrb r0, [r1] - cmp r0, 0x1 - bls _081C0DD0 - ldrb r0, [r4, 0x2] - ldrb r1, [r1] - lsls r1, 12 - ldr r3, =0xfffff0bc - adds r1, r3 - adds r1, r2, r1 - bl SetBgTilemapBuffer - ldrb r0, [r4, 0x2] - movs r1, 0x80 - lsls r1, 9 - movs r2, 0 - bl ChangeBgX -_081C0DD0: - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - ldr r2, [r6] - ldr r0, =0x000040c9 - adds r2, r0 - ldrb r0, [r2] - movs r1, 0x1 - eors r0, r1 - movs r1, 0 - strb r0, [r2] - strh r1, [r4, 0x2] - strh r1, [r4] - bl sub_81C1BA0 - ldr r0, [r6] - adds r0, r7 - ldrb r0, [r0] - bl sub_81C2AFC - bl sub_81C4280 - bl sub_81C0E24 - adds r0, r5, 0 - bl set_task_function_to_args_14_15 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0D44 - - thumb_func_start sub_81C0E24 -sub_81C0E24: @ 81C0E24 - push {lr} - ldr r0, =0x0203cf1c - ldr r1, [r0] - ldr r2, =0x000040c0 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081C0E3C - adds r0, r1, 0 - adds r0, 0xC - bl sub_81C22CC -_081C0E3C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0E24 - - thumb_func_start sub_81C0E48 -sub_81C0E48: @ 81C0E48 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r5, =0x0203cf1c - ldr r0, [r5] - ldr r2, =0x000040c6 - adds r0, r2 - movs r1, 0 - strb r1, [r0] - ldr r1, [r5] - adds r2, r1, r2 - ldrb r0, [r2] - lsls r0, 1 - adds r1, 0x84 - adds r1, r0 - ldrh r6, [r1] - mov r8, r6 - movs r0, 0x13 - bl ClearWindowTilemap - ldr r2, =0x02020630 - ldr r0, [r5] - ldr r1, =0x000040d5 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _081C0E96 - movs r0, 0xD - bl ClearWindowTilemap -_081C0E96: - movs r4, 0x3 - negs r4, r4 - movs r0, 0x9 - adds r1, r4, 0 - bl sub_81C1DA4 - movs r0, 0x9 - adds r1, r4, 0 - adds r2, r6, 0 - bl sub_81C1EFC - ldr r0, [r5] - ldr r1, =0x000040c8 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _081C0EC4 - movs r0, 0x5 - bl ClearWindowTilemap - movs r0, 0x6 - bl PutWindowTilemap -_081C0EC4: - ldr r0, [r5] - ldr r1, =0x000020bc - adds r0, r1 - movs r1, 0x3 - movs r2, 0 - bl sub_81C2194 - ldr r0, [r5] - ldr r1, =0x000030bc - adds r0, r1 - movs r1, 0x1 - movs r2, 0 - bl sub_81C2194 - mov r0, r8 - bl sub_81C3E9C - bl sub_81C3F44 - bl sub_81C44F0 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x8 - bl sub_81C4AF8 - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81C0F44 - str r1, [r0] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C0E48 - - thumb_func_start sub_81C0F44 -sub_81C0F44: @ 81C0F44 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C103A - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081C0F98 - movs r0, 0x4 - strh r0, [r4] - movs r1, 0x1 - negs r1, r1 - ldr r0, =0x0203cf1c - ldr r2, [r0] - ldr r0, =0x000040c6 - adds r2, r0 - adds r0, r4, 0 - bl sub_81C1070 - b _081C103A - .pool -_081C0F98: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081C0FC0 - movs r0, 0x4 - strh r0, [r4] - ldr r0, =0x0203cf1c - ldr r2, [r0] - ldr r0, =0x000040c6 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81C1070 - b _081C103A - .pool -_081C0FC0: - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081C1026 - ldr r0, =0x0203cf1c - ldr r1, [r0] - ldr r2, =0x000040c8 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x1 - beq _081C0FE8 - subs r2, 0x4 - adds r0, r1, r2 - ldr r0, [r0] - ldr r1, =0x00ffffff - ands r0, r1 - movs r1, 0x80 - lsls r1, 11 - cmp r0, r1 - bne _081C1004 -_081C0FE8: - movs r0, 0x5 - bl audio_play - adds r0, r5, 0 - bl sub_81C11F4 - b _081C103A - .pool -_081C1004: - bl sub_81C1040 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C101E - movs r0, 0x5 - bl audio_play - adds r0, r5, 0 - bl sub_81C129C - b _081C103A -_081C101E: - movs r0, 0x20 - bl audio_play - b _081C103A -_081C1026: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081C103A - movs r0, 0x5 - bl audio_play - adds r0, r6, 0 - bl sub_81C11F4 -_081C103A: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81C0F44 - - thumb_func_start sub_81C1040 -sub_81C1040: @ 81C1040 - push {lr} - movs r1, 0x1 - ldr r0, =0x0203cf1c - ldr r0, [r0] - adds r2, r0, 0 - adds r2, 0x84 -_081C104C: - lsls r0, r1, 1 - adds r0, r2, r0 - ldrh r0, [r0] - cmp r0, 0 - beq _081C1060 - movs r0, 0x1 - b _081C106C - .pool -_081C1060: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x3 - bls _081C104C - movs r0, 0 -_081C106C: - pop {r1} - bx r1 - thumb_func_end sub_81C1040 - - thumb_func_start sub_81C1070 -sub_81C1070: @ 81C1070 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r7, r0, 0 - adds r4, r1, 0 - mov r8, r2 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl audio_play - mov r0, r8 - ldrb r6, [r0] - movs r2, 0 - lsls r4, 24 - asrs r4, 24 - mov r12, r4 - movs r1, 0 - ldrsh r4, [r7, r1] - ldrb r0, [r7] - lsls r3, r0, 24 -_081C109C: - lsls r0, r6, 24 - asrs r0, 24 - add r0, r12 - lsls r0, 24 - lsrs r6, r0, 24 - asrs r0, 24 - cmp r0, r4 - ble _081C10B0 - movs r6, 0 - b _081C10B6 -_081C10B0: - cmp r0, 0 - bge _081C10B6 - lsrs r6, r3, 24 -_081C10B6: - lsls r0, r6, 24 - asrs r1, r0, 24 - mov r9, r0 - cmp r1, 0x4 - bne _081C10C2 - b _081C11CC -_081C10C2: - ldr r0, =0x0203cf1c - ldr r0, [r0] - lsls r1, 1 - adds r0, 0x84 - adds r0, r1 - ldrh r5, [r0] - cmp r5, 0 - bne _081C10E2 - lsls r0, r2, 24 - movs r1, 0x80 - lsls r1, 17 - adds r0, r1 - lsrs r2, r0, 24 - asrs r0, 24 - cmp r0, 0x3 - ble _081C109C -_081C10E2: - adds r0, r5, 0 - bl sub_81C240C - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - adds r0, r5, 0 - bl sub_81C3E9C - mov r1, r8 - ldrb r0, [r1] - cmp r0, 0x4 - bne _081C1110 - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040c4 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - beq _081C1118 -_081C1110: - movs r1, 0x2 - ldrsh r0, [r7, r1] - cmp r0, 0x1 - bne _081C115E -_081C1118: - movs r0, 0x13 - bl ClearWindowTilemap - ldr r2, =0x02020630 - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040d5 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _081C1142 - movs r0, 0xD - bl ClearWindowTilemap -_081C1142: - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r4, 0x3 - negs r4, r4 - movs r0, 0x9 - adds r1, r4, 0 - bl sub_81C1DA4 - movs r0, 0x9 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_81C1EFC -_081C115E: - mov r1, r8 - ldrb r0, [r1] - cmp r0, 0x4 - beq _081C11A0 - mov r1, r9 - asrs r0, r1, 24 - cmp r0, 0x4 - bne _081C11A0 - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040c4 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - bne _081C11A0 - movs r0, 0xE - bl ClearWindowTilemap - movs r0, 0xF - bl ClearWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0 - movs r1, 0x3 - bl sub_81C1DA4 - movs r0, 0 - movs r1, 0x3 - movs r2, 0 - bl sub_81C1EFC -_081C11A0: - mov r0, r8 - strb r6, [r0] - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040c6 - adds r0, r1 - cmp r8, r0 - bne _081C11E0 - movs r0, 0x8 - bl sub_81C4D18 - b _081C11E6 - .pool -_081C11CC: - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040c4 - adds r0, r1 - ldrh r5, [r0] - b _081C10E2 - .pool -_081C11E0: - movs r0, 0x12 - bl sub_81C4D18 -_081C11E6: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81C1070 - - thumb_func_start sub_81C11F4 -sub_81C11F4: @ 81C11F4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0x8 - bl sub_81C4C60 - movs r0, 0x6 - bl ClearWindowTilemap - movs r0, 0x5 - bl PutWindowTilemap - movs r0, 0 - bl sub_81C3E9C - ldr r4, =0x0203cf1c - ldr r0, [r4] - ldr r1, =0x000020bc - adds r0, r1 - movs r1, 0x3 - movs r2, 0x1 - bl sub_81C2194 - ldr r0, [r4] - ldr r1, =0x000030bc - adds r0, r1 - movs r1, 0x1 - movs r2, 0x1 - bl sub_81C2194 - bl sub_81C4064 - ldr r0, [r4] - ldr r1, =0x000040c6 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x4 - beq _081C125E - movs r0, 0xE - bl ClearWindowTilemap - movs r0, 0xF - bl ClearWindowTilemap - movs r0, 0 - movs r1, 0x3 - bl sub_81C1DA4 - movs r0, 0 - movs r1, 0x3 - movs r2, 0 - bl sub_81C1EFC -_081C125E: - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81C0510 - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C11F4 - - thumb_func_start sub_81C129C -sub_81C129C: @ 81C129C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r2, =0x000040c6 - adds r1, r0, r2 - ldrb r1, [r1] - adds r2, 0x1 - adds r0, r2 - strb r1, [r0] - movs r0, 0x1 - bl sub_81C4C84 - movs r0, 0x12 - bl sub_81C4AF8 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81C12E4 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C129C - - thumb_func_start sub_81C12E4 -sub_81C12E4: @ 81C12E4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C13AA - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081C1338 - movs r0, 0x3 - strh r0, [r4] - movs r1, 0x1 - negs r1, r1 - ldr r0, =0x0203cf1c - ldr r2, [r0] - ldr r0, =0x000040c7 - adds r2, r0 - adds r0, r4, 0 - bl sub_81C1070 - b _081C13AA - .pool -_081C1338: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081C1360 - movs r0, 0x3 - strh r0, [r4] - ldr r0, =0x0203cf1c - ldr r2, [r0] - ldr r0, =0x000040c7 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81C1070 - b _081C13AA - .pool -_081C1360: - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081C139A - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r2, =0x000040c6 - adds r1, r0, r2 - adds r2, 0x1 - adds r0, r2 - ldrb r1, [r1] - ldrb r0, [r0] - cmp r1, r0 - bne _081C1390 - adds r0, r5, 0 - movs r1, 0 - bl sub_81C13B0 - b _081C13AA - .pool -_081C1390: - adds r0, r5, 0 - movs r1, 0x1 - bl sub_81C13B0 - b _081C13AA -_081C139A: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081C13AA - adds r0, r6, 0 - movs r1, 0 - bl sub_81C13B0 -_081C13AA: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81C12E4 - - thumb_func_start sub_81C13B0 -sub_81C13B0: @ 81C13B0 - push {r4-r7,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl audio_play - movs r0, 0 - bl sub_81C4C84 - movs r0, 0x12 - bl sub_81C4C60 - cmp r4, 0x1 - bne _081C1464 - ldr r0, =0x0203cf1c - ldr r3, [r0] - ldr r1, =0x000040bd - adds r0, r3, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _081C1410 - ldr r0, [r3] - ldr r2, =0x000040be - adds r1, r3, r2 - ldrb r2, [r1] - movs r1, 0x64 - muls r1, r2 - adds r0, r1 - ldr r4, =0x000040c6 - adds r1, r3, r4 - ldrb r1, [r1] - adds r4, 0x1 - adds r2, r3, r4 - ldrb r2, [r2] - bl sub_81C14BC - b _081C1430 - .pool -_081C1410: - ldr r0, [r3] - ldr r2, =0x000040be - adds r1, r3, r2 - ldrb r2, [r1] - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 4 - adds r0, r1 - ldr r4, =0x000040c6 - adds r1, r3, r4 - ldrb r1, [r1] - adds r4, 0x1 - adds r2, r3, r4 - ldrb r2, [r2] - bl sub_81C15EC -_081C1430: - ldr r5, =0x0203cf1c - ldr r0, [r5] - adds r0, 0xC - bl sub_81C0098 - ldr r1, [r5] - ldr r6, =0x000040c6 - adds r0, r1, r6 - ldrb r0, [r0] - ldr r4, =0x000040c7 - adds r1, r4 - ldrb r1, [r1] - bl sub_81C40A0 - ldr r1, [r5] - adds r0, r1, r6 - ldrb r0, [r0] - adds r1, r4 - ldrb r1, [r1] - bl sub_81C4568 - ldr r0, [r5] - adds r4, r0, r4 - ldrb r1, [r4] - adds r0, r6 - strb r1, [r0] -_081C1464: - ldr r0, =0x0203cf1c - ldr r1, [r0] - ldr r2, =0x000040c6 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 1 - adds r1, 0x84 - adds r1, r0 - ldrh r4, [r1] - adds r0, r4, 0 - bl sub_81C3E9C - adds r0, r4, 0 - bl sub_81C240C - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81C0F44 - str r1, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C13B0 - - thumb_func_start sub_81C14BC -sub_81C14BC: @ 81C14BC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x28 - adds r7, r0, 0 - adds r4, r1, 0 - adds r6, r2, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r6, 24 - lsrs r6, 24 - ldr r0, =0x0203cf1c - ldr r2, [r0] - lsls r0, r4, 1 - mov r10, r0 - adds r1, r2, 0 - adds r1, 0x84 - adds r0, r1, r0 - str r0, [sp, 0x8] - ldrh r0, [r0] - mov r3, sp - adds r3, 0x2 - str r3, [sp, 0x1C] - strh r0, [r3] - lsls r0, r6, 1 - mov r9, r0 - add r1, r9 - str r1, [sp, 0xC] - ldrh r1, [r1] - mov r0, sp - strh r1, [r0] - adds r1, r2, 0 - adds r1, 0x8C - adds r3, r1, r4 - str r3, [sp, 0x10] - ldrb r0, [r3] - mov r3, sp - adds r3, 0x5 - str r3, [sp, 0x24] - strb r0, [r3] - adds r1, r6 - str r1, [sp, 0x14] - ldrb r0, [r1] - mov r1, sp - adds r1, 0x4 - str r1, [sp, 0x20] - strb r0, [r1] - adds r2, 0xA4 - str r2, [sp, 0x18] - ldrb r0, [r2] - mov r5, sp - adds r5, 0x6 - strb r0, [r5] - ldr r1, =gUnknown_08329D22 - adds r0, r4, r1 - ldrb r0, [r0] - mov r8, r0 - ldrb r0, [r5] - adds r2, r0, 0 - mov r3, r8 - ands r2, r3 - mov r3, r10 - asrs r2, r3 - lsls r2, 24 - lsrs r2, 24 - adds r1, r6, r1 - ldrb r1, [r1] - mov r12, r1 - adds r1, r0, 0 - mov r3, r12 - ands r1, r3 - mov r3, r9 - asrs r1, r3 - lsls r1, 24 - lsrs r1, 24 - mov r3, r8 - bics r0, r3 - strb r0, [r5] - ldrb r0, [r5] - mov r3, r12 - bics r0, r3 - strb r0, [r5] - mov r0, r9 - lsls r2, r0 - mov r3, r10 - lsls r1, r3 - adds r2, r1 - ldrb r0, [r5] - orrs r0, r2 - strb r0, [r5] - adds r1, r4, 0 - adds r1, 0xD - adds r0, r7, 0 - mov r2, sp - bl pokemon_setattr - adds r1, r6, 0 - adds r1, 0xD - adds r0, r7, 0 - ldr r2, [sp, 0x1C] - bl pokemon_setattr - adds r4, 0x11 - adds r0, r7, 0 - adds r1, r4, 0 - ldr r2, [sp, 0x20] - bl pokemon_setattr - adds r6, 0x11 - adds r0, r7, 0 - adds r1, r6, 0 - ldr r2, [sp, 0x24] - bl pokemon_setattr - adds r0, r7, 0 - movs r1, 0x15 - adds r2, r5, 0 - bl pokemon_setattr - mov r0, sp - ldrh r0, [r0] - ldr r1, [sp, 0x8] - strh r0, [r1] - ldr r3, [sp, 0x1C] - ldrh r0, [r3] - ldr r1, [sp, 0xC] - strh r0, [r1] - ldr r3, [sp, 0x20] - ldrb r0, [r3] - ldr r1, [sp, 0x10] - strb r0, [r1] - ldr r3, [sp, 0x24] - ldrb r0, [r3] - ldr r1, [sp, 0x14] - strb r0, [r1] - ldrb r0, [r5] - ldr r3, [sp, 0x18] - strb r0, [r3] - add sp, 0x28 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C14BC - - thumb_func_start sub_81C15EC -sub_81C15EC: @ 81C15EC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x28 - adds r7, r0, 0 - adds r4, r1, 0 - adds r6, r2, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r6, 24 - lsrs r6, 24 - ldr r0, =0x0203cf1c - ldr r2, [r0] - lsls r0, r4, 1 - mov r10, r0 - adds r1, r2, 0 - adds r1, 0x84 - adds r0, r1, r0 - str r0, [sp, 0x8] - ldrh r0, [r0] - mov r3, sp - adds r3, 0x2 - str r3, [sp, 0x1C] - strh r0, [r3] - lsls r0, r6, 1 - mov r9, r0 - add r1, r9 - str r1, [sp, 0xC] - ldrh r1, [r1] - mov r0, sp - strh r1, [r0] - adds r1, r2, 0 - adds r1, 0x8C - adds r3, r1, r4 - str r3, [sp, 0x10] - ldrb r0, [r3] - mov r3, sp - adds r3, 0x5 - str r3, [sp, 0x24] - strb r0, [r3] - adds r1, r6 - str r1, [sp, 0x14] - ldrb r0, [r1] - mov r1, sp - adds r1, 0x4 - str r1, [sp, 0x20] - strb r0, [r1] - adds r2, 0xA4 - str r2, [sp, 0x18] - ldrb r0, [r2] - mov r5, sp - adds r5, 0x6 - strb r0, [r5] - ldr r1, =gUnknown_08329D22 - adds r0, r4, r1 - ldrb r0, [r0] - mov r8, r0 - ldrb r0, [r5] - adds r2, r0, 0 - mov r3, r8 - ands r2, r3 - mov r3, r10 - asrs r2, r3 - lsls r2, 24 - lsrs r2, 24 - adds r1, r6, r1 - ldrb r1, [r1] - mov r12, r1 - adds r1, r0, 0 - mov r3, r12 - ands r1, r3 - mov r3, r9 - asrs r1, r3 - lsls r1, 24 - lsrs r1, 24 - mov r3, r8 - bics r0, r3 - strb r0, [r5] - ldrb r0, [r5] - mov r3, r12 - bics r0, r3 - strb r0, [r5] - mov r0, r9 - lsls r2, r0 - mov r3, r10 - lsls r1, r3 - adds r2, r1 - ldrb r0, [r5] - orrs r0, r2 - strb r0, [r5] - adds r1, r4, 0 - adds r1, 0xD - adds r0, r7, 0 - mov r2, sp - bl pokemon_setattr_encrypted - adds r1, r6, 0 - adds r1, 0xD - adds r0, r7, 0 - ldr r2, [sp, 0x1C] - bl pokemon_setattr_encrypted - adds r4, 0x11 - adds r0, r7, 0 - adds r1, r4, 0 - ldr r2, [sp, 0x20] - bl pokemon_setattr_encrypted - adds r6, 0x11 - adds r0, r7, 0 - adds r1, r6, 0 - ldr r2, [sp, 0x24] - bl pokemon_setattr_encrypted - adds r0, r7, 0 - movs r1, 0x15 - adds r2, r5, 0 - bl pokemon_setattr_encrypted - mov r0, sp - ldrh r0, [r0] - ldr r1, [sp, 0x8] - strh r0, [r1] - ldr r3, [sp, 0x1C] - ldrh r0, [r3] - ldr r1, [sp, 0xC] - strh r0, [r1] - ldr r3, [sp, 0x20] - ldrb r0, [r3] - ldr r1, [sp, 0x10] - strb r0, [r1] - ldr r3, [sp, 0x24] - ldrb r0, [r3] - ldr r1, [sp, 0x14] - strb r0, [r1] - ldrb r0, [r5] - ldr r3, [sp, 0x18] - strb r0, [r3] - add sp, 0x28 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C15EC - - thumb_func_start sub_81C171C -sub_81C171C: @ 81C171C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_81C44F0 - movs r0, 0x8 - bl sub_81C4AF8 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81C174C - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C171C - - thumb_func_start sub_81C174C -sub_81C174C: @ 81C174C - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C176A - b _081C189A -_081C176A: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r2, 0x80 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _081C177A - b _081C189A -_081C177A: - ldr r6, =0x030022c0 - ldrh r1, [r6, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081C17B4 - movs r0, 0x4 - strh r0, [r4] - movs r1, 0x1 - negs r1, r1 - ldr r0, =0x0203cf1c - ldr r2, [r0] - ldr r0, =0x000040c6 - adds r2, r0 - adds r0, r4, 0 - bl sub_81C1070 - b _081C189A - .pool -_081C17B4: - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _081C17DC - movs r0, 0x4 - strh r0, [r4] - ldr r0, =0x0203cf1c - ldr r2, [r0] - ldr r1, =0x000040c6 - adds r2, r1 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81C1070 - b _081C189A - .pool -_081C17DC: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _081C17F0 - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C17FC -_081C17F0: - movs r1, 0x1 - negs r1, r1 - adds r0, r5, 0 - bl sub_81C0A8C - b _081C189A -_081C17FC: - ldrh r1, [r6, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _081C1812 - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _081C181C -_081C1812: - adds r0, r5, 0 - movs r1, 0x1 - bl sub_81C0A8C - b _081C189A -_081C181C: - ldrh r1, [r6, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081C1876 - bl sub_81C18A8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C1868 - bl sub_81C48F0 - movs r0, 0x5 - bl audio_play - ldr r2, =0x0203cf21 - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040c6 - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - ldr r1, =0x020375e2 - ldrb r0, [r2] - strh r0, [r1] - adds r0, r5, 0 - bl sub_81C044C - b _081C189A - .pool -_081C1868: - movs r0, 0x20 - bl audio_play - adds r0, r5, 0 - bl sub_81C18F4 - b _081C189A -_081C1876: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081C189A - bl sub_81C48F0 - movs r0, 0x5 - bl audio_play - ldr r1, =0x0203cf21 - movs r0, 0x4 - strb r0, [r1] - ldr r1, =0x020375e2 - movs r0, 0x4 - strh r0, [r1] - adds r0, r5, 0 - bl sub_81C044C -_081C189A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C174C - - thumb_func_start sub_81C18A8 -sub_81C18A8: @ 81C18A8 - push {lr} - ldr r0, =0x0203cf1c - ldr r2, [r0] - ldr r0, =0x000040c6 - adds r1, r2, r0 - ldrb r0, [r1] - cmp r0, 0x4 - beq _081C18DA - ldr r3, =0x000040c4 - adds r0, r2, r3 - ldrh r0, [r0] - cmp r0, 0 - beq _081C18DA - ldrb r1, [r1] - lsls r1, 1 - adds r0, r2, 0 - adds r0, 0x84 - adds r0, r1 - ldrh r0, [r0] - bl sub_81B6D14 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C18EC -_081C18DA: - movs r0, 0x1 - b _081C18EE - .pool -_081C18EC: - movs r0, 0 -_081C18EE: - pop {r1} - bx r1 - thumb_func_end sub_81C18A8 - - thumb_func_start sub_81C18F4 -sub_81C18F4: @ 81C18F4 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0xE - bl ClearWindowTilemap - movs r0, 0xF - bl ClearWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0 - movs r1, 0x3 - bl sub_81C1DA4 - movs r0, 0 - movs r1, 0x3 - movs r2, 0 - bl sub_81C1EFC - bl sub_81C4154 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81C1940 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C18F4 - - thumb_func_start sub_81C1940 -sub_81C1940: @ 81C1940 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - mov r8, r0 - ldr r0, =0x03005e08 - mov r9, r0 - mov r4, r8 - add r4, r9 - ldr r0, =sub_81C1E20 - bl is_function_an_active_task - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C196C - b _081C1B74 -_081C196C: - ldr r6, =0x030022c0 - ldrh r1, [r6, 0x2E] - movs r0, 0x40 - ands r0, r1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0 - beq _081C19B0 - movs r0, 0x1 - strh r0, [r4, 0x2] - movs r0, 0x4 - strh r0, [r4] - movs r1, 0x1 - negs r1, r1 - ldr r0, =0x0203cf1c - ldr r2, [r0] - ldr r0, =0x000040c6 - adds r2, r0 - adds r0, r4, 0 - bl sub_81C1070 - movs r0, 0 - strh r0, [r4, 0x2] - b _081C1B6A - .pool -_081C19B0: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081C19DC - movs r0, 0x1 - strh r0, [r4, 0x2] - movs r0, 0x4 - strh r0, [r4] - ldr r0, =0x0203cf1c - ldr r2, [r0] - ldr r1, =0x000040c6 - adds r2, r1 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81C1070 - strh r5, [r4, 0x2] - b _081C1B6A - .pool -_081C19DC: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _081C19F0 - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C1A64 -_081C19F0: - ldr r4, =0x0203cf1c - ldr r0, [r4] - ldr r2, =0x000040c0 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0x2 - bne _081C1A00 - b _081C1B74 -_081C1A00: - movs r0, 0x13 - bl ClearWindowTilemap - ldr r2, =0x02020630 - ldr r0, [r4] - ldr r1, =0x000040d5 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _081C1A28 - movs r0, 0xD - bl ClearWindowTilemap -_081C1A28: - ldr r1, [r4] - ldr r2, =0x000040c6 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 1 - adds r1, 0x84 - adds r1, r0 - ldrh r5, [r1] - mov r0, r9 - subs r0, 0x8 - add r0, r8 - ldr r1, =sub_81C174C - str r1, [r0] - movs r1, 0x1 - negs r1, r1 - adds r0, r7, 0 - b _081C1ACE - .pool -_081C1A64: - ldrh r1, [r6, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _081C1A7A - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _081C1B04 -_081C1A7A: - ldr r4, =0x0203cf1c - ldr r0, [r4] - ldr r1, =0x000040c0 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3 - beq _081C1B74 - movs r0, 0x13 - bl ClearWindowTilemap - ldr r2, =0x02020630 - ldr r0, [r4] - ldr r1, =0x000040d5 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _081C1AB0 - movs r0, 0xD - bl ClearWindowTilemap -_081C1AB0: - ldr r1, [r4] - ldr r2, =0x000040c6 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 1 - adds r1, 0x84 - adds r1, r0 - ldrh r5, [r1] - mov r0, r9 - subs r0, 0x8 - add r0, r8 - ldr r1, =sub_81C174C - str r1, [r0] - adds r0, r7, 0 - movs r1, 0x1 -_081C1ACE: - bl sub_81C0A8C - movs r4, 0x2 - negs r4, r4 - movs r0, 0x9 - adds r1, r4, 0 - bl sub_81C1DA4 - movs r0, 0x9 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_81C1EFC - b _081C1B74 - .pool -_081C1B04: - ldrh r1, [r6, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _081C1B74 - movs r0, 0x13 - bl ClearWindowTilemap - ldr r2, =0x02020630 - ldr r4, =0x0203cf1c - ldr r0, [r4] - ldr r1, =0x000040d5 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _081C1B38 - movs r0, 0xD - bl ClearWindowTilemap -_081C1B38: - ldr r1, [r4] - ldr r2, =0x000040c6 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 1 - adds r1, 0x84 - adds r1, r0 - ldrh r5, [r1] - adds r0, r5, 0 - bl sub_81C3E9C - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r4, 0x3 - negs r4, r4 - movs r0, 0x9 - adds r1, r4, 0 - bl sub_81C1DA4 - movs r0, 0x9 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_81C1EFC -_081C1B6A: - mov r0, r9 - subs r0, 0x8 - add r0, r8 - ldr r1, =sub_81C174C - str r1, [r0] -_081C1B74: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C1940 - - thumb_func_start sub_81C1B94 -sub_81C1B94: @ 81C1B94 - ldr r0, =0x0203cf21 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_81C1B94 - - thumb_func_start sub_81C1BA0 -sub_81C1BA0: @ 81C1BA0 - push {r4-r7,lr} - sub sp, 0xC - movs r0, 0x20 - bl Alloc - adds r4, r0, 0 - movs r5, 0 -_081C1BAE: - lsls r0, r5, 25 - lsrs r1, r0, 24 - adds r6, r1, 0 - ldr r0, =0x0203cf1c - ldr r3, [r0] - ldr r2, =0x000040c1 - adds r0, r3, r2 - ldrb r0, [r0] - cmp r5, r0 - bcs _081C1BD8 - lsls r0, r1, 1 - adds r0, r4 - movs r1, 0x40 - strh r1, [r0] - strh r1, [r0, 0x2] - movs r1, 0x50 - b _081C1BEE - .pool -_081C1BD8: - ldr r7, =0x000040c2 - adds r0, r3, r7 - ldrb r2, [r0] - cmp r5, r2 - bls _081C1BF8 - lsls r0, r1, 1 - adds r0, r4 - movs r1, 0x4A - strh r1, [r0] - strh r1, [r0, 0x2] - movs r1, 0x5A -_081C1BEE: - strh r1, [r0, 0x10] - strh r1, [r0, 0x12] - b _081C1C78 - .pool -_081C1BF8: - ldr r7, =0x000040c0 - adds r0, r3, r7 - ldrb r0, [r0] - cmp r5, r0 - bcs _081C1C1C - lsls r1, 1 - adds r1, r4 - movs r0, 0x46 - strh r0, [r1] - movs r0, 0x47 - strh r0, [r1, 0x2] - movs r0, 0x56 - strh r0, [r1, 0x10] - movs r0, 0x57 - b _081C1C76 - .pool -_081C1C1C: - cmp r5, r0 - bne _081C1C4C - cmp r5, r2 - beq _081C1C38 - lsls r1, 1 - adds r1, r4 - movs r0, 0x41 - strh r0, [r1] - movs r0, 0x42 - strh r0, [r1, 0x2] - movs r0, 0x51 - strh r0, [r1, 0x10] - movs r0, 0x52 - b _081C1C76 -_081C1C38: - lsls r1, 1 - adds r1, r4 - movs r0, 0x4B - strh r0, [r1] - movs r0, 0x4C - strh r0, [r1, 0x2] - movs r0, 0x5B - strh r0, [r1, 0x10] - movs r0, 0x5C - b _081C1C76 -_081C1C4C: - cmp r5, r2 - beq _081C1C64 - lsls r1, 1 - adds r1, r4 - movs r0, 0x43 - strh r0, [r1] - movs r0, 0x44 - strh r0, [r1, 0x2] - movs r0, 0x53 - strh r0, [r1, 0x10] - movs r0, 0x54 - b _081C1C76 -_081C1C64: - lsls r1, r6, 1 - adds r1, r4 - movs r0, 0x48 - strh r0, [r1] - movs r0, 0x49 - strh r0, [r1, 0x2] - movs r0, 0x58 - strh r0, [r1, 0x10] - movs r0, 0x59 -_081C1C76: - strh r0, [r1, 0x12] -_081C1C78: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _081C1BAE - movs r0, 0x8 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x10 - str r0, [sp, 0x8] - movs r0, 0x3 - adds r1, r4, 0 - movs r2, 0xB - movs r3, 0 - bl CopyToBgTilemapBufferRect_ChangePalette - movs r0, 0x3 - bl schedule_bg_copy_tilemap_to_vram - adds r0, r4, 0 - bl Free - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81C1BA0 - - thumb_func_start sub_81C1CB0 -sub_81C1CB0: @ 81C1CB0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r4, r0, 0 - mov r8, r1 - lsls r2, 24 - lsrs r6, r2, 24 - lsls r3, 24 - lsrs r5, r3, 24 - ldrb r1, [r4, 0x6] - ldrb r0, [r4, 0x7] - lsls r0, 1 - muls r0, r1 - bl Alloc - adds r7, r0, 0 - mov r1, sp - ldrh r0, [r4, 0x4] - strh r0, [r1] - ldrb r1, [r4, 0x7] - ldrb r0, [r4, 0x6] - adds r2, r1, 0 - muls r2, r0 - movs r0, 0x80 - lsls r0, 17 - orrs r2, r0 - mov r0, sp - adds r1, r7, 0 - bl CpuSet - ldrb r0, [r4, 0x6] - cmp r0, r6 - beq _081C1D60 - cmp r5, 0 - bne _081C1D30 - movs r5, 0 - ldrb r0, [r4, 0x7] - cmp r5, r0 - bcs _081C1D60 -_081C1D00: - ldrb r2, [r4, 0x6] - adds r1, r2, 0 - muls r1, r5 - adds r3, r6, r1 - lsls r3, 1 - ldr r0, [r4] - adds r0, r3 - lsls r1, 1 - adds r1, r7, r1 - subs r2, r6 - ldr r3, =0x001fffff - ands r2, r3 - bl CpuSet - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - ldrb r3, [r4, 0x7] - cmp r5, r3 - bcc _081C1D00 - b _081C1D60 - .pool -_081C1D30: - movs r5, 0 - ldrb r0, [r4, 0x7] - cmp r5, r0 - bcs _081C1D60 -_081C1D38: - ldrb r2, [r4, 0x6] - adds r1, r2, 0 - muls r1, r5 - lsls r3, r1, 1 - ldr r0, [r4] - adds r0, r3 - adds r1, r6, r1 - lsls r1, 1 - adds r1, r7, r1 - subs r2, r6 - ldr r3, =0x001fffff - ands r2, r3 - bl CpuSet - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - ldrb r3, [r4, 0x7] - cmp r5, r3 - bcc _081C1D38 -_081C1D60: - movs r5, 0 - b _081C1D8A - .pool -_081C1D68: - ldrb r2, [r4, 0x6] - adds r0, r2, 0 - muls r0, r5 - lsls r0, 1 - adds r0, r7, r0 - ldrb r1, [r4, 0x9] - adds r1, r5 - lsls r1, 5 - ldrb r3, [r4, 0x8] - adds r1, r3 - lsls r1, 1 - add r1, r8 - bl CpuSet - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 -_081C1D8A: - ldrb r0, [r4, 0x7] - cmp r5, r0 - bcc _081C1D68 - adds r0, r7, 0 - bl Free - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81C1CB0 - - thumb_func_start sub_81C1DA4 -sub_81C1DA4: @ 81C1DA4 - push {r4-r6,lr} - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 16 - lsrs r4, r1, 16 - asrs r1, 16 - ldr r3, =gUnknown_0861CC04 - ldrb r2, [r3, 0x6] - cmp r1, r2 - ble _081C1DBA - adds r4, r2, 0 -_081C1DBA: - lsls r0, r4, 16 - asrs r0, 16 - cmp r0, 0 - beq _081C1DC6 - cmp r0, r2 - bne _081C1DE8 -_081C1DC6: - ldr r0, =0x0203cf1c - ldr r1, [r0] - ldr r0, =0x000020bc - adds r1, r0 - lsls r2, r4, 24 - lsrs r2, 24 - adds r0, r3, 0 - movs r3, 0x1 - bl sub_81C1CB0 - b _081C1E12 - .pool -_081C1DE8: - ldr r5, =sub_81C1E20 - adds r0, r5, 0 - bl get_task_id_by_function - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - bne _081C1E04 - adds r0, r5, 0 - movs r1, 0x8 - bl AddTask - lsls r0, 24 - lsrs r2, r0, 24 -_081C1E04: - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - strh r4, [r0, 0x8] - strh r6, [r0, 0xA] -_081C1E12: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C1DA4 - - thumb_func_start sub_81C1E20 -sub_81C1E20: @ 81C1E20 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - ldrh r0, [r4] - ldrh r1, [r4, 0x2] - adds r0, r1 - strh r0, [r4, 0x2] - lsls r0, 16 - cmp r0, 0 - bge _081C1E50 - movs r0, 0 - strh r0, [r4, 0x2] - ldr r7, =gUnknown_0861CC04 - b _081C1E60 - .pool -_081C1E50: - movs r0, 0x2 - ldrsh r1, [r4, r0] - ldr r0, =gUnknown_0861CC04 - ldrb r2, [r0, 0x6] - adds r7, r0, 0 - cmp r1, r2 - ble _081C1E60 - strh r2, [r4, 0x2] -_081C1E60: - ldr r5, =0x0203cf1c - ldr r1, [r5] - ldr r0, =0x000020bc - adds r1, r0 - ldrb r2, [r4, 0x2] - adds r0, r7, 0 - movs r3, 0x1 - bl sub_81C1CB0 - movs r1, 0x2 - ldrsh r0, [r4, r1] - cmp r0, 0 - ble _081C1E80 - ldrb r7, [r7, 0x6] - cmp r0, r7 - blt _081C1EE0 -_081C1E80: - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - bge _081C1EAC - ldr r0, [r5] - ldr r1, =0x000040c0 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x2 - bne _081C1ED4 - movs r0, 0xE - bl PutWindowTilemap - b _081C1ED4 - .pool -_081C1EAC: - ldr r2, =0x02020630 - ldr r0, [r5] - ldr r1, =0x000040d5 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _081C1ECE - movs r0, 0xD - bl PutWindowTilemap -_081C1ECE: - movs r0, 0x13 - bl PutWindowTilemap -_081C1ED4: - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - adds r0, r6, 0 - bl remove_task -_081C1EE0: - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C1E20 - - thumb_func_start sub_81C1EFC -sub_81C1EFC: @ 81C1EFC - push {r4-r7,lr} - lsls r0, 16 - lsrs r7, r0, 16 - lsls r1, 16 - lsls r2, 16 - lsrs r6, r2, 16 - lsrs r4, r1, 16 - asrs r1, 16 - ldr r3, =gUnknown_0861CC10 - ldrb r2, [r3, 0x6] - cmp r1, r2 - ble _081C1F16 - adds r4, r2, 0 -_081C1F16: - lsls r0, r4, 16 - asrs r0, 16 - cmp r0, 0 - beq _081C1F22 - cmp r0, r2 - bne _081C1F44 -_081C1F22: - ldr r0, =0x0203cf1c - ldr r1, [r0] - ldr r0, =0x000030bc - adds r1, r0 - lsls r2, r4, 24 - lsrs r2, 24 - adds r0, r3, 0 - movs r3, 0x1 - bl sub_81C1CB0 - b _081C1F70 - .pool -_081C1F44: - ldr r5, =sub_81C1F80 - adds r0, r5, 0 - bl get_task_id_by_function - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - bne _081C1F60 - adds r0, r5, 0 - movs r1, 0x8 - bl AddTask - lsls r0, 24 - lsrs r2, r0, 24 -_081C1F60: - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - strh r4, [r0, 0x8] - strh r7, [r0, 0xA] - strh r6, [r0, 0xC] -_081C1F70: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C1EFC - - thumb_func_start sub_81C1F80 -sub_81C1F80: @ 81C1F80 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - ldrh r0, [r4] - ldrh r1, [r4, 0x2] - adds r0, r1 - strh r0, [r4, 0x2] - lsls r0, 16 - cmp r0, 0 - bge _081C1FB0 - movs r0, 0 - strh r0, [r4, 0x2] - ldr r7, =gUnknown_0861CC10 - b _081C1FC0 - .pool -_081C1FB0: - movs r0, 0x2 - ldrsh r1, [r4, r0] - ldr r0, =gUnknown_0861CC10 - ldrb r2, [r0, 0x6] - adds r7, r0, 0 - cmp r1, r2 - ble _081C1FC0 - strh r2, [r4, 0x2] -_081C1FC0: - ldr r5, =0x0203cf1c - ldr r1, [r5] - ldr r0, =0x000030bc - adds r1, r0 - ldrb r2, [r4, 0x2] - adds r0, r7, 0 - movs r3, 0x1 - bl sub_81C1CB0 - movs r1, 0x2 - ldrsh r0, [r4, r1] - cmp r0, 0 - ble _081C1FE0 - ldrb r7, [r7, 0x6] - cmp r0, r7 - blt _081C2058 -_081C1FE0: - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - bge _081C2024 - ldr r0, [r5] - ldr r1, =0x000040c0 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C2006 - ldr r0, =sub_81C0B8C - bl is_function_an_active_task - lsls r0, 24 - cmp r0, 0 - bne _081C2006 - movs r0, 0xF - bl PutWindowTilemap -_081C2006: - ldrh r0, [r4, 0x4] - bl sub_81C240C - b _081C204C - .pool -_081C2024: - ldr r2, =0x02020630 - ldr r0, [r5] - ldr r1, =0x000040d5 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _081C2046 - movs r0, 0xD - bl PutWindowTilemap -_081C2046: - movs r0, 0x13 - bl PutWindowTilemap -_081C204C: - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - adds r0, r6, 0 - bl remove_task -_081C2058: - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C1F80 - - thumb_func_start sub_81C2074 -sub_81C2074: @ 81C2074 - push {r4,r5,lr} - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 16 - lsrs r4, r1, 16 - asrs r1, 16 - ldr r3, =gUnknown_0861CBEC - ldrb r2, [r3, 0x6] - cmp r1, r2 - ble _081C208A - adds r4, r2, 0 -_081C208A: - lsls r0, r4, 16 - asrs r0, 16 - cmp r0, 0 - beq _081C2096 - cmp r0, r2 - bne _081C20C8 -_081C2096: - ldr r5, =0x0203cf1c - ldr r1, [r5] - adds r1, 0xBC - lsls r4, 24 - lsrs r4, 24 - adds r0, r3, 0 - adds r2, r4, 0 - movs r3, 0 - bl sub_81C1CB0 - ldr r0, =gUnknown_0861CBF8 - ldr r1, [r5] - adds r1, 0xBC - adds r2, r4, 0 - movs r3, 0 - bl sub_81C1CB0 - b _081C20E2 - .pool -_081C20C8: - ldr r0, =sub_81C20F0 - movs r1, 0x8 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] - strh r5, [r1, 0xA] -_081C20E2: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2074 - - thumb_func_start sub_81C20F0 -sub_81C20F0: @ 81C20F0 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r5, r0, r1 - ldrh r0, [r5] - ldrh r1, [r5, 0x2] - adds r0, r1 - strh r0, [r5, 0x2] - lsls r0, 16 - cmp r0, 0 - bge _081C2120 - movs r0, 0 - strh r0, [r5, 0x2] - ldr r7, =gUnknown_0861CBEC - b _081C2130 - .pool -_081C2120: - movs r0, 0x2 - ldrsh r1, [r5, r0] - ldr r0, =gUnknown_0861CBEC - ldrb r2, [r0, 0x6] - adds r7, r0, 0 - cmp r1, r2 - ble _081C2130 - strh r2, [r5, 0x2] -_081C2130: - ldr r4, =0x0203cf1c - ldr r1, [r4] - adds r1, 0xBC - ldrb r2, [r5, 0x2] - adds r0, r7, 0 - movs r3, 0 - bl sub_81C1CB0 - ldr r0, =gUnknown_0861CBF8 - ldr r1, [r4] - adds r1, 0xBC - ldrb r2, [r5, 0x2] - movs r3, 0 - bl sub_81C1CB0 - movs r0, 0x3 - bl schedule_bg_copy_tilemap_to_vram - movs r1, 0x2 - ldrsh r0, [r5, r1] - cmp r0, 0 - ble _081C2162 - ldrb r7, [r7, 0x6] - cmp r0, r7 - blt _081C2180 -_081C2162: - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0 - bge _081C217A - bl sub_81C4A88 - movs r0, 0xD - bl PutWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram -_081C217A: - adds r0, r6, 0 - bl remove_task -_081C2180: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C20F0 - - thumb_func_start sub_81C2194 -sub_81C2194: @ 81C2194 - push {r4-r7,lr} - adds r6, r0, 0 - lsls r2, 24 - lsls r1, 28 - lsrs r4, r1, 16 - ldr r7, =0x0000056a - cmp r2, 0 - bne _081C21E4 - movs r3, 0 - ldr r5, =gUnknown_08DC3CD4 -_081C21A8: - adds r2, r7, r3 - lsls r2, 1 - adds r2, r6 - lsls r0, r3, 1 - adds r0, r5 - ldrh r1, [r0] - adds r1, r4, r1 - strh r1, [r2] - adds r0, r2, 0 - adds r0, 0x40 - strh r1, [r0] - adds r2, 0x80 - adds r0, r3, 0 - adds r0, 0x14 - lsls r0, 1 - adds r0, r5 - ldrh r0, [r0] - adds r0, r4, r0 - strh r0, [r2] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x13 - bls _081C21A8 - b _081C221C - .pool -_081C21E4: - movs r3, 0 - ldr r5, =gUnknown_08DC3CD4 -_081C21E8: - adds r1, r7, r3 - lsls r1, 1 - adds r1, r6 - adds r0, r3, 0 - adds r0, 0x14 - lsls r0, 1 - adds r0, r5 - ldrh r0, [r0] - adds r0, r4, r0 - strh r0, [r1] - adds r2, r1, 0 - adds r2, 0x40 - adds r0, r3, 0 - adds r0, 0x28 - lsls r0, 1 - adds r0, r5 - ldrh r0, [r0] - adds r0, r4, r0 - strh r0, [r2] - adds r1, 0x80 - strh r0, [r1] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x13 - bls _081C21E8 -_081C221C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2194 - - thumb_func_start sub_81C2228 -sub_81C2228: @ 81C2228 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0 - bl sub_806DD7C - lsls r0, 24 - cmp r0, 0 - bne _081C225C - adds r0, r4, 0 - movs r1, 0 - bl sub_806DDE4 - lsls r0, 24 - cmp r0, 0 - beq _081C225C - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r2, =0x00000502 - adds r1, r0, r2 - movs r2, 0x2C - b _081C2266 - .pool -_081C225C: - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r2, =0x00000502 - adds r1, r0, r2 - ldr r2, =0x0000081a -_081C2266: - strh r2, [r1] - ldr r1, =0x00000d02 - adds r0, r1 - strh r2, [r0] - movs r0, 0x3 - bl schedule_bg_copy_tilemap_to_vram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2228 - - thumb_func_start sub_81C228C -sub_81C228C: @ 81C228C - push {lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _081C22AC - movs r0, 0x8 - str r0, [sp] - str r1, [sp, 0x4] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0x4 - movs r3, 0x8 - bl sub_8199C30 - b _081C22C0 -_081C22AC: - movs r0, 0x8 - str r0, [sp] - movs r0, 0x5 - str r0, [sp, 0x4] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0x4 - movs r3, 0x8 - bl sub_8199C30 -_081C22C0: - movs r0, 0x3 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0x8 - pop {r0} - bx r0 - thumb_func_end sub_81C228C - - thumb_func_start sub_81C22CC -sub_81C22CC: @ 81C22CC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =0x0203cf1c - ldr r1, [r0] - adds r6, r1, 0 - adds r6, 0x70 - ldrb r1, [r6, 0x5] - mov r8, r0 - cmp r1, 0x63 - bhi _081C2340 - ldr r5, =gExperienceTables - adds r2, r1, 0 - adds r1, r2, 0x1 - lsls r1, 2 - ldr r4, =gBaseStats - ldrh r3, [r6] - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r4 - ldrb r3, [r0, 0x13] - movs r0, 0xCA - lsls r0, 1 - muls r0, r3 - adds r1, r0 - adds r1, r5 - lsls r2, 2 - adds r2, r0 - adds r2, r5 - ldr r1, [r1] - ldr r2, [r2] - subs r1, r2 - ldr r0, [r6, 0x10] - subs r4, r0, r2 - lsls r0, r4, 6 - bl __udivsi3 - adds r6, r0, 0 - movs r7, 0 - adds r0, r7, 0 - orrs r0, r6 - cmp r0, 0 - bne _081C2344 - cmp r4, 0 - beq _081C2344 - movs r6, 0x1 - movs r7, 0 - b _081C2344 - .pool -_081C2340: - movs r6, 0 - movs r7, 0 -_081C2344: - mov r1, r8 - ldr r0, [r1] - ldr r2, =0x00001d66 - adds r2, r0 - mov r9, r2 - movs r0, 0 - mov r12, r0 - ldr r1, =0x00002062 - mov r10, r1 -_081C2356: - cmp r7, 0 - bgt _081C2362 - cmp r7, 0 - bne _081C237C - cmp r6, 0x7 - bls _081C237C -_081C2362: - mov r2, r12 - lsls r0, r2, 1 - add r0, r9 - ldr r2, =0x0000206a - adds r1, r2, 0 - strh r1, [r0] - b _081C23B6 - .pool -_081C237C: - mov r1, r12 - lsls r0, r1, 1 - add r0, r9 - mov r8, r0 - adds r5, r7, 0 - adds r4, r6, 0 - cmp r7, 0 - bge _081C2394 - movs r4, 0x7 - movs r5, 0 - adds r4, r6 - adcs r5, r7 -_081C2394: - lsls r3, r5, 29 - lsrs r2, r4, 3 - adds r0, r3, 0 - orrs r0, r2 - asrs r1, r5, 3 - lsrs r5, r0, 29 - lsls r4, r1, 3 - adds r3, r5, 0 - orrs r3, r4 - lsls r2, r0, 3 - adds r1, r7, 0 - adds r0, r6, 0 - subs r0, r2 - sbcs r1, r3 - add r0, r10 - mov r2, r8 - strh r0, [r2] -_081C23B6: - movs r0, 0x8 - negs r0, r0 - asrs r1, r0, 31 - adds r6, r0 - adcs r7, r1 - cmp r7, 0 - bge _081C23C8 - movs r6, 0 - movs r7, 0 -_081C23C8: - mov r0, r12 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r12, r0 - cmp r0, 0x7 - bls _081C2356 - movs r0, 0x1 - bl GetBgTilemapBuffer - ldr r1, =0x0203cf1c - ldr r1, [r1] - ldr r2, =0x000010bc - adds r1, r2 - cmp r0, r1 - bne _081C23F8 - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - b _081C23FE - .pool -_081C23F8: - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram -_081C23FE: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81C22CC - - thumb_func_start sub_81C240C -sub_81C240C: @ 81C240C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 16 - lsrs r3, r0, 16 - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000038bc - adds r5, r0, r1 - cmp r3, 0 - beq _081C2510 - ldr r1, =gContestEffects - ldr r2, =gContestMoves - lsls r3, 3 - adds r0, r3, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldrb r4, [r0, 0x1] - mov r9, r1 - mov r8, r2 - mov r10, r3 - cmp r4, 0xFF - beq _081C244C - adds r0, r4, 0 - movs r1, 0xA - bl __udivsi3 - lsls r0, 24 - lsrs r4, r0, 24 -_081C244C: - movs r2, 0 - movs r6, 0x3 - movs r3, 0xF3 - lsls r3, 2 -_081C2454: - cmp r4, 0xFF - beq _081C2484 - cmp r2, r4 - bcs _081C2484 - lsrs r0, r2, 2 - adds r1, r2, 0 - ands r1, r6 - lsls r0, 5 - adds r0, r1 - lsls r0, 1 - adds r0, r5 - adds r0, r3 - ldr r7, =0x0000103a - b _081C2496 - .pool -_081C2484: - lsrs r0, r2, 2 - adds r1, r2, 0 - ands r1, r6 - lsls r0, 5 - adds r0, r1 - lsls r0, 1 - adds r0, r5 - adds r0, r3 - ldr r7, =0x00001039 -_081C2496: - adds r1, r7, 0 - strh r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x7 - bls _081C2454 - mov r0, r10 - add r0, r8 - ldrb r0, [r0] - lsls r0, 2 - add r0, r9 - ldrb r4, [r0, 0x2] - cmp r4, 0xFF - beq _081C24C0 - adds r0, r4, 0 - movs r1, 0xA - bl __udivsi3 - lsls r0, 24 - lsrs r4, r0, 24 -_081C24C0: - movs r2, 0 - movs r6, 0x3 - ldr r3, =0x0000044c -_081C24C6: - cmp r4, 0xFF - beq _081C24F0 - cmp r2, r4 - bcs _081C24F0 - lsrs r0, r2, 2 - adds r1, r2, 0 - ands r1, r6 - lsls r0, 5 - adds r0, r1 - lsls r0, 1 - adds r0, r5 - adds r0, r3 - ldr r7, =0x0000103c - b _081C2502 - .pool -_081C24F0: - lsrs r0, r2, 2 - adds r1, r2, 0 - ands r1, r6 - lsls r0, 5 - adds r0, r1 - lsls r0, 1 - adds r0, r5 - adds r0, r3 - ldr r7, =0x0000103d -_081C2502: - adds r1, r7, 0 - strh r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x7 - bls _081C24C6 -_081C2510: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C240C - - thumb_func_start sub_81C2524 -sub_81C2524: @ 81C2524 - push {lr} - ldr r0, =0x0203cf1c - ldr r0, [r0] - adds r0, 0x74 - ldrb r0, [r0] - cmp r0, 0 - beq _081C2544 - movs r1, 0x80 - lsls r1, 9 - movs r0, 0x3 - movs r2, 0 - bl ChangeBgX - b _081C254E - .pool -_081C2544: - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgX -_081C254E: - pop {r0} - bx r0 - thumb_func_end sub_81C2524 - - thumb_func_start sub_81C2554 -sub_81C2554: @ 81C2554 - push {r4,r5,lr} - ldr r0, =gUnknown_0861CC24 - bl InitWindows - bl DeactivateAllTextPrinters - movs r4, 0 -_081C2562: - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x13 - bls _081C2562 - movs r4, 0 - ldr r5, =0x0203cf1c - ldr r3, =0x000040cb - movs r2, 0xFF -_081C257C: - ldr r0, [r5] - adds r0, r3 - adds r0, r4 - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _081C257C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2554 - - thumb_func_start sub_81C25A4 -sub_81C25A4: @ 81C25A4 - push {r4-r6,lr} - sub sp, 0x14 - ldr r4, [sp, 0x24] - ldr r5, [sp, 0x28] - lsls r0, 24 - lsrs r0, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - movs r6, 0 - str r6, [sp] - str r4, [sp, 0x4] - lsls r4, r5, 1 - adds r4, r5 - ldr r5, =gUnknown_0861CD2C - adds r4, r5 - str r4, [sp, 0x8] - str r6, [sp, 0xC] - str r1, [sp, 0x10] - movs r1, 0x1 - bl AddTextPrinterParametrized2 - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C25A4 - - thumb_func_start sub_81C25E8 -sub_81C25E8: @ 81C25E8 - push {lr} - movs r0, 0x11 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x12 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x13 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r0, =0x0203cf1c - ldr r0, [r0] - adds r0, 0x74 - ldrb r0, [r0] - cmp r0, 0 - bne _081C2618 - bl sub_81C2628 - b _081C261C - .pool -_081C2618: - bl sub_81C2794 -_081C261C: - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - pop {r0} - bx r0 - thumb_func_end sub_81C25E8 - - thumb_func_start sub_81C2628 -sub_81C2628: @ 81C2628 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x18 - ldr r0, =0x0203cf1c - ldr r0, [r0] - movs r1, 0xC - adds r1, r0 - mov r8, r1 - adds r7, r0, 0 - adds r7, 0x70 - ldrh r0, [r7] - bl sub_806E3C0 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =0x0000ffff - cmp r5, r0 - beq _081C26CE - ldr r6, =0x02021cc4 - ldr r1, =gUnknown_085E8D4F - adds r0, r6, 0 - bl CopyString - ldr r4, =0x02021dc4 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x2 - movs r3, 0x3 - bl ConvertIntToDecimalString - adds r0, r6, 0 - adds r1, r4, 0 - bl AppendString - mov r0, r8 - bl sub_806EBA4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _081C26AC - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r0, 0x11 - adds r1, r6, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - movs r0, 0 - bl sub_81C228C - b _081C26C6 - .pool -_081C26AC: - movs r0, 0 - str r0, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - movs r0, 0x11 - adds r1, r6, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - movs r0, 0x1 - bl sub_81C228C -_081C26C6: - movs r0, 0x11 - bl PutWindowTilemap - b _081C26EE -_081C26CE: - movs r0, 0x11 - bl ClearWindowTilemap - mov r0, r8 - bl sub_806EBA4 - lsls r0, 24 - cmp r0, 0 - bne _081C26E8 - movs r0, 0 - bl sub_81C228C - b _081C26EE -_081C26E8: - movs r0, 0x1 - bl sub_81C228C -_081C26EE: - ldr r4, =0x02021cc4 - ldr r1, =gUnknown_085E8D4D - adds r0, r4, 0 - bl CopyString - ldr r5, =0x02021dc4 - ldrb r1, [r7, 0x5] - adds r0, r5, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - adds r0, r4, 0 - adds r1, r5, 0 - bl AppendString - movs r6, 0 - str r6, [sp] - movs r5, 0x1 - str r5, [sp, 0x4] - movs r0, 0x13 - adds r1, r4, 0 - movs r2, 0x18 - movs r3, 0x11 - bl sub_81C25A4 - mov r0, r8 - adds r1, r4, 0 - bl GetMonNickname - str r6, [sp] - str r5, [sp, 0x4] - movs r0, 0x12 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - add r1, sp, 0x8 - movs r0, 0xBA - strb r0, [r1] - mov r0, sp - adds r0, 0x9 - ldrh r2, [r7, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - str r6, [sp] - str r5, [sp, 0x4] - movs r0, 0x13 - add r1, sp, 0x8 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldrh r1, [r7, 0x2] - mov r0, r8 - bl sub_81C27DC - movs r0, 0x12 - bl PutWindowTilemap - movs r0, 0x13 - bl PutWindowTilemap - add sp, 0x18 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2628 - - thumb_func_start sub_81C2794 -sub_81C2794: @ 81C2794 - push {r4,lr} - sub sp, 0x8 - ldr r0, =0x0203cf1c - ldr r0, [r0] - adds r0, 0xC - ldr r4, =0x02021cc4 - adds r1, r4, 0 - bl GetMonNickname - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r0, 0x12 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - movs r0, 0x12 - bl PutWindowTilemap - movs r0, 0x11 - bl ClearWindowTilemap - movs r0, 0x13 - bl ClearWindowTilemap - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2794 - - thumb_func_start sub_81C27DC -sub_81C27DC: @ 81C27DC - push {lr} - sub sp, 0x8 - lsls r1, 16 - lsrs r1, 16 - cmp r1, 0x20 - beq _081C282C - cmp r1, 0x1D - beq _081C282C - bl pokemon_get_gender - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _081C27FE - cmp r0, 0xFE - beq _081C2818 - b _081C282C -_081C27FE: - ldr r1, =gUnknown_085E8D49 - str r0, [sp] - movs r0, 0x3 - str r0, [sp, 0x4] - movs r0, 0x13 - movs r2, 0x39 - movs r3, 0x11 - bl sub_81C25A4 - b _081C282C - .pool -_081C2818: - ldr r1, =gUnknown_085E8D4B - movs r0, 0 - str r0, [sp] - movs r0, 0x4 - str r0, [sp, 0x4] - movs r0, 0x13 - movs r2, 0x39 - movs r3, 0x11 - bl sub_81C25A4 -_081C282C: - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C27DC - - thumb_func_start sub_81C2838 -sub_81C2838: @ 81C2838 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - ldr r3, =gUnknown_0861CDD3 - cmp r1, 0 - bne _081C284A - subs r3, 0x80 -_081C284A: - lsls r2, 16 - lsrs r2, 16 - movs r0, 0x10 - str r0, [sp] - str r0, [sp, 0x4] - adds r0, r4, 0 - adds r1, r3, 0 - movs r3, 0 - bl BlitBitmapToWindow - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2838 - - thumb_func_start sub_81C286C -sub_81C286C: @ 81C286C - push {r4-r7,lr} - sub sp, 0x8 - ldr r1, =gUnknown_085EA3CF - movs r5, 0 - str r5, [sp] - movs r6, 0x1 - str r6, [sp, 0x4] - movs r0, 0 - movs r2, 0x2 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gUnknown_085EA3DC - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0x1 - movs r2, 0x2 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gUnknown_085EA3EB - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0x2 - movs r2, 0x2 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gUnknown_085EA3F8 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0x3 - movs r2, 0x2 - movs r3, 0x1 - bl sub_81C25A4 - ldr r7, =gUnknown_085E8CF7 - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x3E - bl GetStringRightAlignXOffset - adds r4, r0, 0 - adds r2, r4, 0 - subs r2, 0x10 - cmp r2, 0 - bge _081C28CC - movs r2, 0 -_081C28CC: - movs r0, 0x4 - movs r1, 0 - bl sub_81C2838 - lsls r2, r4, 24 - lsrs r2, 24 - str r5, [sp] - str r5, [sp, 0x4] - movs r0, 0x4 - adds r1, r7, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r7, =gUnknown_085EA406 - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x3E - bl GetStringRightAlignXOffset - adds r4, r0, 0 - adds r2, r4, 0 - subs r2, 0x10 - cmp r2, 0 - bge _081C28FE - movs r2, 0 -_081C28FE: - movs r0, 0x5 - movs r1, 0 - bl sub_81C2838 - lsls r2, r4, 24 - lsrs r2, 24 - str r5, [sp] - str r5, [sp, 0x4] - movs r0, 0x5 - adds r1, r7, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r7, =gUnknown_085EA3C8 - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x3E - bl GetStringRightAlignXOffset - adds r4, r0, 0 - adds r2, r4, 0 - subs r2, 0x10 - cmp r2, 0 - bge _081C2930 - movs r2, 0 -_081C2930: - movs r0, 0x6 - movs r1, 0 - bl sub_81C2838 - lsls r2, r4, 24 - lsrs r2, 24 - str r5, [sp] - str r5, [sp, 0x4] - movs r0, 0x6 - adds r1, r7, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gUnknown_085EA369 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0x8 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gUnknown_085EA378 - str r5, [sp] - str r5, [sp, 0x4] - movs r0, 0x9 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r4, =gUnknown_085EA361 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x2A - bl GetStringCenterAlignXOffset - adds r0, 0x6 - lsls r2, r0, 24 - lsrs r2, 24 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xA - adds r1, r4, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r4, =gUnknown_085EA33C - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x2A - bl GetStringCenterAlignXOffset - adds r0, 0x6 - lsls r2, r0, 24 - lsrs r2, 24 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xA - adds r1, r4, 0 - movs r3, 0x11 - bl sub_81C25A4 - ldr r4, =gUnknown_085EA343 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x2A - bl GetStringCenterAlignXOffset - adds r0, 0x6 - lsls r2, r0, 24 - lsrs r2, 24 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xA - adds r1, r4, 0 - movs r3, 0x21 - bl sub_81C25A4 - ldr r4, =gUnknown_085EA34B - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x24 - bl GetStringCenterAlignXOffset - adds r0, 0x2 - lsls r2, r0, 24 - lsrs r2, 24 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xB - adds r1, r4, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r4, =gUnknown_085EA353 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x24 - bl GetStringCenterAlignXOffset - adds r0, 0x2 - lsls r2, r0, 24 - lsrs r2, 24 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xB - adds r1, r4, 0 - movs r3, 0x11 - bl sub_81C25A4 - ldr r4, =gUnknown_085EA35B - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x24 - bl GetStringCenterAlignXOffset - adds r0, 0x2 - lsls r2, r0, 24 - lsrs r2, 24 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xB - adds r1, r4, 0 - movs r3, 0x21 - bl sub_81C25A4 - ldr r1, =gUnknown_085EA39F - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xC - movs r2, 0x6 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gUnknown_085EA3AB - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xC - movs r2, 0x6 - movs r3, 0x11 - bl sub_81C25A4 - ldr r1, =gUnknown_085EA398 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xD - movs r2, 0x2 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gUnknown_085EA37E - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xE - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gUnknown_085EA384 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xE - movs r2, 0 - movs r3, 0x11 - bl sub_81C25A4 - ldr r1, =gUnknown_085EA38D - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xF - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gUnknown_085EA394 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xF - movs r2, 0 - movs r3, 0x11 - bl sub_81C25A4 - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C286C - - thumb_func_start sub_81C2AFC -sub_81C2AFC: @ 81C2AFC - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - movs r0, 0 - bl ClearWindowTilemap - movs r0, 0x1 - bl ClearWindowTilemap - movs r0, 0x2 - bl ClearWindowTilemap - movs r0, 0x3 - bl ClearWindowTilemap - cmp r4, 0x1 - beq _081C2B66 - cmp r4, 0x1 - bgt _081C2B2A - cmp r4, 0 - beq _081C2B34 - b _081C2C06 -_081C2B2A: - cmp r5, 0x2 - beq _081C2B80 - cmp r5, 0x3 - beq _081C2BC4 - b _081C2C06 -_081C2B34: - movs r0, 0 - bl PutWindowTilemap - movs r0, 0x4 - bl PutWindowTilemap - bl sub_81A6BF4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C2B58 - bl sub_81B9E94 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C2B5E -_081C2B58: - movs r0, 0x8 - bl PutWindowTilemap -_081C2B5E: - movs r0, 0x9 - bl PutWindowTilemap - b _081C2C06 -_081C2B66: - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0xA - bl PutWindowTilemap - movs r0, 0xB - bl PutWindowTilemap - movs r0, 0xC - bl PutWindowTilemap - b _081C2C06 -_081C2B80: - movs r0, 0x2 - bl PutWindowTilemap - ldr r0, =0x0203cf1c - ldr r1, [r0] - ldr r2, =0x000040bc - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C2BBC - adds r2, 0x8 - adds r0, r1, r2 - ldr r0, [r0] - ldr r1, =0x00ffffff - ands r0, r1 - movs r1, 0x80 - lsls r1, 11 - cmp r0, r1 - beq _081C2C06 - movs r0, 0xE - bl PutWindowTilemap - b _081C2C06 - .pool -_081C2BBC: - movs r0, 0x5 - bl PutWindowTilemap - b _081C2C06 -_081C2BC4: - movs r0, 0x3 - bl PutWindowTilemap - ldr r0, =0x0203cf1c - ldr r1, [r0] - ldr r2, =0x000040bc - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C2C00 - adds r2, 0x8 - adds r0, r1, r2 - ldr r0, [r0] - ldr r1, =0x00ffffff - ands r0, r1 - movs r1, 0x80 - lsls r1, 11 - cmp r0, r1 - beq _081C2C06 - movs r0, 0xF - bl PutWindowTilemap - b _081C2C06 - .pool -_081C2C00: - movs r0, 0x5 - bl PutWindowTilemap -_081C2C06: - movs r4, 0 - ldr r5, =0x0203cf1c -_081C2C0A: - ldr r0, [r5] - ldr r1, =0x000040cb - adds r0, r1 - adds r0, r4 - ldrb r0, [r0] - bl PutWindowTilemap - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _081C2C0A - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2AFC - - thumb_func_start sub_81C2C38 -sub_81C2C38: @ 81C2C38 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, 0x1 - beq _081C2C84 - cmp r0, 0x1 - bgt _081C2C4E - cmp r0, 0 - beq _081C2C58 - b _081C2D0E -_081C2C4E: - cmp r1, 0x2 - beq _081C2C98 - cmp r1, 0x3 - beq _081C2CD4 - b _081C2D0E -_081C2C58: - movs r0, 0x4 - bl ClearWindowTilemap - bl sub_81A6BF4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C2C76 - bl sub_81B9E94 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C2C7C -_081C2C76: - movs r0, 0x8 - bl ClearWindowTilemap -_081C2C7C: - movs r0, 0x9 - bl ClearWindowTilemap - b _081C2D0E -_081C2C84: - movs r0, 0xA - bl ClearWindowTilemap - movs r0, 0xB - bl ClearWindowTilemap - movs r0, 0xC - bl ClearWindowTilemap - b _081C2D0E -_081C2C98: - ldr r0, =0x0203cf1c - ldr r1, [r0] - ldr r2, =0x000040bc - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C2CCC - adds r2, 0x8 - adds r0, r1, r2 - ldr r0, [r0] - ldr r1, =0x00ffffff - ands r0, r1 - movs r1, 0x80 - lsls r1, 11 - cmp r0, r1 - beq _081C2D0E - movs r0, 0xE - bl ClearWindowTilemap - b _081C2D0E - .pool -_081C2CCC: - movs r0, 0x5 - bl ClearWindowTilemap - b _081C2D0E -_081C2CD4: - ldr r0, =0x0203cf1c - ldr r1, [r0] - ldr r2, =0x000040bc - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C2D08 - adds r2, 0x8 - adds r0, r1, r2 - ldr r0, [r0] - ldr r1, =0x00ffffff - ands r0, r1 - movs r1, 0x80 - lsls r1, 11 - cmp r0, r1 - beq _081C2D0E - movs r0, 0xF - bl ClearWindowTilemap - b _081C2D0E - .pool -_081C2D08: - movs r0, 0x5 - bl ClearWindowTilemap -_081C2D0E: - movs r4, 0 -_081C2D10: - adds r0, r4, 0 - bl sub_81C2D68 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _081C2D10 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C2C38 - - thumb_func_start sub_81C2D2C -sub_81C2D2C: @ 81C2D2C - push {r4,lr} - adds r3, r0, 0 - lsls r1, 24 - lsrs r2, r1, 24 - ldr r0, =0x0203cf1c - ldr r4, =0x000040cb - adds r1, r2, r4 - ldr r0, [r0] - adds r4, r0, r1 - ldrb r0, [r4] - cmp r0, 0xFF - bne _081C2D56 - lsls r0, r2, 3 - adds r0, r3, r0 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - bl FillWindowPixelBuffer -_081C2D56: - ldrb r0, [r4] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81C2D2C - - thumb_func_start sub_81C2D68 -sub_81C2D68: @ 81C2D68 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0203cf1c - ldr r2, =0x000040cb - adds r0, r2 - ldr r1, [r1] - adds r4, r1, r0 - ldrb r0, [r4] - cmp r0, 0xFF - beq _081C2D8C - bl ClearWindowTilemap - ldrb r0, [r4] - bl RemoveWindow - movs r0, 0xFF - strb r0, [r4] -_081C2D8C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2D68 - - thumb_func_start sub_81C2D9C -sub_81C2D9C: @ 81C2D9C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 -_081C2DA4: - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040cb - adds r0, r1 - adds r1, r0, r4 - ldrb r0, [r1] - cmp r0, 0xFF - beq _081C2DBA - movs r1, 0 - bl FillWindowPixelBuffer -_081C2DBA: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x7 - bls _081C2DA4 - ldr r0, =gUnknown_0861CE54 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl _call_via_r0 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2D9C - - thumb_func_start sub_81C2DE4 -sub_81C2DE4: @ 81C2DE4 - push {lr} - lsls r0, 24 - ldr r1, =gUnknown_0861CE64 - lsrs r0, 22 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x10 - bl AddTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2DE4 - - thumb_func_start sub_81C2E00 -sub_81C2E00: @ 81C2E00 - push {lr} - ldr r0, =0x0203cf1c - ldr r0, [r0] - adds r0, 0x74 - ldrb r0, [r0] - cmp r0, 0 - beq _081C2E24 - bl sub_81C335C - bl sub_81C33CC - bl sub_81C3428 - bl sub_81C349C - b _081C2E3C - .pool -_081C2E24: - bl sub_81C2EC4 - bl sub_81C2F5C - bl sub_81C2FD8 - bl sub_81C302C - bl sub_81C307C - bl sub_81C3194 -_081C2E3C: - pop {r0} - bx r0 - thumb_func_end sub_81C2E00 - - thumb_func_start sub_81C2E40 -sub_81C2E40: @ 81C2E40 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - ldrh r0, [r4] - subs r0, 0x1 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - bhi _081C2EB8 - lsls r0, 2 - ldr r1, =_081C2E70 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C2E70: - .4byte _081C2E8C - .4byte _081C2E92 - .4byte _081C2E98 - .4byte _081C2E9E - .4byte _081C2EA4 - .4byte _081C2EAA - .4byte _081C2EB0 -_081C2E8C: - bl sub_81C2EC4 - b _081C2EB8 -_081C2E92: - bl sub_81C2F5C - b _081C2EB8 -_081C2E98: - bl sub_81C2FD8 - b _081C2EB8 -_081C2E9E: - bl sub_81C302C - b _081C2EB8 -_081C2EA4: - bl sub_81C307C - b _081C2EB8 -_081C2EAA: - bl sub_81C3194 - b _081C2EB8 -_081C2EB0: - adds r0, r2, 0 - bl remove_task - b _081C2EBE -_081C2EB8: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_081C2EBE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C2E40 - - thumb_func_start sub_81C2EC4 -sub_81C2EC4: @ 81C2EC4 - push {r4-r6,lr} - sub sp, 0x8 - bl sub_81A6BF4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C2F54 - bl sub_81B9E94 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C2F54 - ldr r0, =gUnknown_0861CCCC - movs r1, 0 - bl sub_81C2D2C - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =gUnknown_085EA365 - movs r6, 0 - str r6, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0 - bl GetStringWidth - adds r2, r0, 0 - ldr r0, =0x0203cf1c - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0xA2 - ldrb r0, [r0] - cmp r0, 0 - bne _081C2F40 - adds r1, 0xA6 - lsls r2, 24 - lsrs r2, 24 - str r6, [sp] - movs r0, 0x5 - str r0, [sp, 0x4] - adds r0, r5, 0 - movs r3, 0x1 - bl sub_81C25A4 - b _081C2F54 - .pool -_081C2F40: - adds r1, 0xA6 - lsls r2, 24 - lsrs r2, 24 - str r6, [sp] - movs r0, 0x6 - str r0, [sp, 0x4] - adds r0, r5, 0 - movs r3, 0x1 - bl sub_81C25A4 -_081C2F54: - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81C2EC4 - - thumb_func_start sub_81C2F5C -sub_81C2F5C: @ 81C2F5C - push {r4,r5,lr} - sub sp, 0x8 - bl sub_81A6BF4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C2FC0 - bl sub_81B9E94 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C2FC0 - ldr r5, =0x02021cc4 - ldr r1, =gUnknown_085E8D59 - adds r0, r5, 0 - bl CopyString - ldr r1, =0x0203cf1c - ldr r1, [r1] - adds r1, 0xB8 - ldrh r1, [r1] - movs r2, 0x2 - movs r3, 0x5 - bl ConvertIntToDecimalString - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x38 - bl GetStringRightAlignXOffset - adds r4, r0, 0 - ldr r0, =gUnknown_0861CCCC - movs r1, 0x1 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsrs r4, 24 - movs r1, 0 - str r1, [sp] - movs r1, 0x1 - str r1, [sp, 0x4] - adds r1, r5, 0 - adds r2, r4, 0 - movs r3, 0x1 - bl sub_81C25A4 -_081C2FC0: - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2F5C - - thumb_func_start sub_81C2FD8 -sub_81C2FD8: @ 81C2FD8 - push {r4,lr} - sub sp, 0x8 - ldr r0, =0x0203cf1c - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x70 - ldrh r0, [r0] - adds r1, 0x78 - ldrb r1, [r1] - bl sub_806B694 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0861CCCC - movs r1, 0x2 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - movs r1, 0xD - muls r1, r4 - ldr r2, =gAbilityNames - adds r1, r2 - movs r2, 0 - str r2, [sp] - movs r2, 0x1 - str r2, [sp, 0x4] - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2FD8 - - thumb_func_start sub_81C302C -sub_81C302C: @ 81C302C - push {r4,lr} - sub sp, 0x8 - ldr r0, =0x0203cf1c - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x70 - ldrh r0, [r0] - adds r1, 0x78 - ldrb r1, [r1] - bl sub_806B694 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0861CCCC - movs r1, 0x2 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gAbilityDescriptionPointers - lsls r4, 2 - adds r4, r1 - ldr r1, [r4] - movs r2, 0 - str r2, [sp] - str r2, [sp, 0x4] - movs r3, 0x11 - bl sub_81C25A4 - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C302C - - thumb_func_start sub_81C307C -sub_81C307C: @ 81C307C - push {r4-r6,lr} - ldr r0, =0x0203cf1c - ldr r0, [r0] - adds r4, r0, 0 - adds r4, 0x70 - bl sub_81AFBF0 - ldr r1, =gUnknown_0861CE74 - movs r0, 0 - bl sub_81AFC0C - ldr r1, =gUnknown_0861CE7B - movs r0, 0x1 - bl sub_81AFC0C - bl sub_81C31C0 - bl sub_81A6BF4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C30C2 - bl sub_81B9E94 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C30C2 - bl sub_81C3304 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C30E0 -_081C30C2: - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085EA5DB - bl sub_81AFC28 - b _081C3182 - .pool -_081C30E0: - movs r0, 0x20 - bl Alloc - adds r6, r0, 0 - movs r0, 0x20 - bl Alloc - adds r5, r0, 0 - adds r0, r6, 0 - bl sub_81C31F0 - ldrb r0, [r4, 0x9] - cmp r0, 0xD4 - bhi _081C310C - adds r1, r0, 0 - adds r0, r5, 0 - bl sub_8124610 - movs r0, 0x4 - adds r1, r5, 0 - bl sub_81AFC0C -_081C310C: - bl sub_81C3220 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C3148 - ldrb r0, [r4, 0xA] - cmp r0, 0 - bne _081C3134 - ldrb r0, [r4, 0x9] - ldr r1, =gUnknown_085EA516 - cmp r0, 0xD4 - bls _081C3170 - ldr r1, =gUnknown_085EA617 - b _081C3170 - .pool -_081C3134: - ldrb r0, [r4, 0x9] - ldr r1, =gUnknown_085EA4EC - cmp r0, 0xD4 - bls _081C3170 - ldr r1, =gUnknown_085EA5EB - b _081C3170 - .pool -_081C3148: - ldrb r0, [r4, 0x9] - cmp r0, 0xFF - bne _081C3158 - ldr r1, =gUnknown_085EA56A - b _081C3170 - .pool -_081C3158: - cmp r0, 0xFE - beq _081C316E - bl sub_81C32BC - lsls r0, 24 - cmp r0, 0 - beq _081C316E - ldrb r0, [r4, 0x9] - ldr r1, =gUnknown_085EA5A8 - cmp r0, 0xD4 - bls _081C3170 -_081C316E: - ldr r1, =gUnknown_085EA544 -_081C3170: - ldr r0, =0x02021fc4 - bl sub_81AFC28 - adds r0, r6, 0 - bl Free - adds r0, r5, 0 - bl Free -_081C3182: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C307C - - thumb_func_start sub_81C3194 -sub_81C3194: @ 81C3194 - push {lr} - sub sp, 0x8 - ldr r0, =gUnknown_0861CCCC - movs r1, 0x3 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02021fc4 - movs r2, 0 - str r2, [sp] - str r2, [sp, 0x4] - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3194 - - thumb_func_start sub_81C31C0 -sub_81C31C0: @ 81C31C0 - push {lr} - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =gNatureNamePointers - adds r0, 0xA3 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - movs r0, 0x2 - bl sub_81AFC0C - ldr r1, =gUnknown_085EA3C0 - movs r0, 0x5 - bl sub_81AFC0C - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C31C0 - - thumb_func_start sub_81C31F0 -sub_81C31F0: @ 81C31F0 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x0203cf1c - ldr r0, [r0] - adds r0, 0x7A - ldrb r1, [r0] - cmp r1, 0 - bne _081C3202 - movs r1, 0x5 -_081C3202: - adds r0, r4, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - movs r0, 0x3 - adds r1, r4, 0 - bl sub_81AFC0C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C31F0 - - thumb_func_start sub_81C3220 -sub_81C3220: @ 81C3220 - push {r4-r6,lr} - ldr r0, =0x0203cf1c - ldr r0, [r0] - adds r6, r0, 0 - adds r6, 0x70 - ldr r1, [r0] - ldr r0, =0x02024744 - cmp r1, r0 - bne _081C326C - bl link_get_multiplayer_id - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x020229e8 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r0, r2, 0x4 - adds r0, r1, r0 - ldrh r4, [r0] - adds r0, r1, r2 - ldrb r5, [r0, 0x13] - ldr r0, =0x02021cc4 - adds r2, 0x8 - adds r1, r2 - bl CopyString - b _081C3282 - .pool -_081C326C: - bl sub_80F0020 - adds r4, r0, 0 - ldr r0, =0x0000ffff - ands r4, r0 - ldr r0, =0x03005d90 - ldr r1, [r0] - ldrb r5, [r1, 0x8] - ldr r0, =0x02021cc4 - bl CopyString -_081C3282: - adds r0, r6, 0 - adds r0, 0x32 - ldrb r0, [r0] - cmp r5, r0 - bne _081C32A4 - ldr r0, [r6, 0x48] - ldr r1, =0x0000ffff - ands r0, r1 - cmp r4, r0 - bne _081C32A4 - ldr r0, =0x02021cc4 - adds r1, r6, 0 - adds r1, 0x36 - bl CompareStringWithoutExtendedControlCodes - cmp r0, 0 - beq _081C32B4 -_081C32A4: - movs r0, 0 - b _081C32B6 - .pool -_081C32B4: - movs r0, 0x1 -_081C32B6: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81C3220 - - thumb_func_start sub_81C32BC -sub_81C32BC: @ 81C32BC - push {lr} - ldr r0, =0x0203cf1c - ldr r0, [r0] - adds r0, 0x70 - ldrb r0, [r0, 0xB] - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bls _081C32D8 - movs r0, 0 - b _081C32DA - .pool -_081C32D8: - movs r0, 0x1 -_081C32DA: - pop {r1} - bx r1 - thumb_func_end sub_81C32BC - - thumb_func_start sub_81C32E0 -sub_81C32E0: @ 81C32E0 - push {lr} - ldr r0, =0x0203cf1c - ldr r0, [r0] - adds r0, 0x70 - ldrb r0, [r0, 0xB] - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bls _081C32FC - movs r0, 0 - b _081C32FE - .pool -_081C32FC: - movs r0, 0x1 -_081C32FE: - pop {r1} - bx r1 - thumb_func_end sub_81C32E0 - - thumb_func_start sub_81C3304 -sub_81C3304: @ 81C3304 - push {lr} - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 15 - ands r0, r1 - cmp r0, 0 - beq _081C3354 - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081C3354 - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040be - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _081C333A - cmp r0, 0x4 - beq _081C333A - cmp r0, 0x5 - bne _081C3354 -_081C333A: - movs r0, 0x1 - b _081C3356 - .pool -_081C3354: - movs r0, 0 -_081C3356: - pop {r1} - bx r1 - thumb_func_end sub_81C3304 - - thumb_func_start sub_81C335C -sub_81C335C: @ 81C335C - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x8 - ldr r0, =gUnknown_0861CCCC - movs r1, 0 - bl sub_81C2D2C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_085EA365 - mov r8, r0 - movs r0, 0x1 - mov r1, r8 - movs r2, 0 - bl GetStringWidth - adds r5, r0, 0 - movs r0, 0 - mov r9, r0 - str r0, [sp] - movs r6, 0x1 - str r6, [sp, 0x4] - adds r0, r4, 0 - mov r1, r8 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gUnknown_085E8D38 - lsls r5, 24 - lsrs r5, 24 - mov r0, r9 - str r0, [sp] - str r6, [sp, 0x4] - adds r0, r4, 0 - adds r2, r5, 0 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C335C - - thumb_func_start sub_81C33CC -sub_81C33CC: @ 81C33CC - push {r4,r5,lr} - sub sp, 0x8 - ldr r5, =0x02021cc4 - ldr r1, =gUnknown_085E8D59 - adds r0, r5, 0 - bl CopyString - ldr r1, =gUnknown_085E8D38 - adds r0, r5, 0 - bl AppendString - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x38 - bl GetStringRightAlignXOffset - adds r4, r0, 0 - ldr r0, =gUnknown_0861CCCC - movs r1, 0x1 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsrs r4, 24 - movs r1, 0 - str r1, [sp] - movs r1, 0x1 - str r1, [sp, 0x4] - adds r1, r5, 0 - adds r2, r4, 0 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C33CC - - thumb_func_start sub_81C3428 -sub_81C3428: @ 81C3428 - push {r4,lr} - sub sp, 0x8 - ldr r0, =0x0203cf1c - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0x70 - adds r0, 0xA5 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081C3448 - ldr r4, =gUnknown_085EA40B - b _081C346C - .pool -_081C3448: - ldrh r0, [r1, 0x30] - cmp r0, 0x5 - bhi _081C3458 - ldr r4, =gUnknown_085EA4A2 - b _081C346C - .pool -_081C3458: - cmp r0, 0xA - bhi _081C3464 - ldr r4, =gUnknown_085EA475 - b _081C346C - .pool -_081C3464: - ldr r4, =gUnknown_085EA40B - cmp r0, 0x28 - bhi _081C346C - ldr r4, =gUnknown_085EA442 -_081C346C: - ldr r0, =gUnknown_0861CCCC - movs r1, 0x2 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - str r1, [sp] - str r1, [sp, 0x4] - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3428 - - thumb_func_start sub_81C349C -sub_81C349C: @ 81C349C - push {r4,lr} - sub sp, 0x8 - ldr r0, =0x0203cf1c - ldr r0, [r0] - adds r4, r0, 0 - adds r4, 0x70 - adds r0, 0xA5 - ldrb r0, [r0] - cmp r0, 0x1 - beq _081C3500 - ldrb r0, [r4, 0x9] - cmp r0, 0xFF - bne _081C34C4 - ldr r4, =gUnknown_085EA678 - b _081C3502 - .pool -_081C34C4: - bl sub_81C32BC - lsls r0, 24 - cmp r0, 0 - beq _081C34D8 - bl sub_81C3220 - lsls r0, 24 - cmp r0, 0 - bne _081C34E0 -_081C34D8: - ldr r4, =gUnknown_085EA6AB - b _081C3502 - .pool -_081C34E0: - ldrb r0, [r4, 0x9] - cmp r0, 0xFD - bne _081C3500 - bl sub_81C32E0 - lsls r0, 24 - lsrs r0, 24 - ldr r4, =gUnknown_085EA702 - cmp r0, 0x1 - bne _081C3502 - ldr r4, =gUnknown_085EA6D7 - b _081C3502 - .pool -_081C3500: - ldr r4, =gUnknown_085EA647 -_081C3502: - ldr r0, =gUnknown_0861CCCC - movs r1, 0x3 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - str r1, [sp] - str r1, [sp, 0x4] - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C349C - - thumb_func_start sub_81C3530 -sub_81C3530: @ 81C3530 - push {lr} - bl sub_81C35E4 - bl sub_81C3690 - bl sub_81C3710 - bl sub_81C37D8 - bl sub_81C3808 - bl sub_81C3890 - bl sub_81C38C0 - pop {r0} - bx r0 - thumb_func_end sub_81C3530 - - thumb_func_start sub_81C3554 -sub_81C3554: @ 81C3554 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - ldrh r0, [r4] - subs r0, 0x1 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - bhi _081C35D6 - lsls r0, 2 - ldr r1, =_081C3584 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C3584: - .4byte _081C35A4 - .4byte _081C35AA - .4byte _081C35B0 - .4byte _081C35B6 - .4byte _081C35BC - .4byte _081C35C2 - .4byte _081C35C8 - .4byte _081C35CE -_081C35A4: - bl sub_81C35E4 - b _081C35D6 -_081C35AA: - bl sub_81C3690 - b _081C35D6 -_081C35B0: - bl sub_81C3710 - b _081C35D6 -_081C35B6: - bl sub_81C37D8 - b _081C35D6 -_081C35BC: - bl sub_81C3808 - b _081C35D6 -_081C35C2: - bl sub_81C3890 - b _081C35D6 -_081C35C8: - bl sub_81C38C0 - b _081C35D6 -_081C35CE: - adds r0, r2, 0 - bl remove_task - b _081C35DC -_081C35D6: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_081C35DC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C3554 - - thumb_func_start sub_81C35E4 -sub_81C35E4: @ 81C35E4 - push {r4,r5,lr} - sub sp, 0x8 - ldr r4, =0x0203cf1c - ldr r0, [r4] - adds r0, 0x9E - ldrh r0, [r0] - cmp r0, 0xAF - bne _081C3628 - bl sub_81B1250 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C3628 - ldr r0, [r4] - ldr r1, =0x000040be - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _081C3614 - cmp r0, 0x4 - beq _081C3614 - cmp r0, 0x5 - bne _081C3628 -_081C3614: - movs r0, 0xAF - bl itemid_get_item - adds r5, r0, 0 - b _081C3650 - .pool -_081C3628: - ldr r0, =0x0203cf1c - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0x9E - ldrh r0, [r1] - cmp r0, 0 - bne _081C3644 - ldr r5, =gUnknown_085E8D26 - b _081C3650 - .pool -_081C3644: - ldrh r0, [r1] - ldr r4, =0x02021cc4 - adds r1, r4, 0 - bl itemid_get_name - adds r5, r4, 0 -_081C3650: - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x48 - bl GetStringCenterAlignXOffset - adds r4, r0, 0 - adds r4, 0x6 - ldr r0, =gUnknown_0861CCEC - movs r1, 0 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsrs r4, 24 - movs r1, 0 - str r1, [sp] - str r1, [sp, 0x4] - adds r1, r5, 0 - adds r2, r4, 0 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C35E4 - - thumb_func_start sub_81C3690 -sub_81C3690: @ 81C3690 - push {r4,r5,lr} - sub sp, 0x8 - ldr r0, =0x0203cf1c - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0x76 - ldrb r0, [r1] - cmp r0, 0 - bne _081C36B0 - ldr r5, =gUnknown_085E8D26 - b _081C36C8 - .pool -_081C36B0: - ldr r0, =0x02021cc4 - ldrb r1, [r1] - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EA3B4 - adds r0, r4, 0 - bl ExpandStringRefs - adds r5, r4, 0 -_081C36C8: - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x46 - bl GetStringCenterAlignXOffset - adds r4, r0, 0 - adds r4, 0x6 - ldr r0, =gUnknown_0861CCEC - movs r1, 0x1 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsrs r4, 24 - movs r1, 0 - str r1, [sp] - str r1, [sp, 0x4] - adds r1, r5, 0 - adds r2, r4, 0 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3690 - - thumb_func_start sub_81C3710 -sub_81C3710: @ 81C3710 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - movs r0, 0x8 - bl Alloc - mov r9, r0 - movs r0, 0x8 - bl Alloc - mov r8, r0 - movs r0, 0x8 - bl Alloc - adds r6, r0, 0 - movs r0, 0x8 - bl Alloc - adds r5, r0, 0 - ldr r4, =0x0203cf1c - ldr r0, [r4] - adds r0, 0x90 - ldrh r1, [r0] - mov r0, r9 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r0, [r4] - adds r0, 0x92 - ldrh r1, [r0] - mov r0, r8 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r0, [r4] - adds r0, 0x94 - ldrh r1, [r0] - adds r0, r6, 0 - movs r2, 0x1 - movs r3, 0x7 - bl ConvertIntToDecimalString - ldr r0, [r4] - adds r0, 0x96 - ldrh r1, [r0] - adds r0, r5, 0 - movs r2, 0x1 - movs r3, 0x7 - bl ConvertIntToDecimalString - bl sub_81AFBF0 - movs r0, 0 - mov r1, r9 - bl sub_81AFC0C - movs r0, 0x1 - mov r1, r8 - bl sub_81AFC0C - movs r0, 0x2 - adds r1, r6, 0 - bl sub_81AFC0C - movs r0, 0x3 - adds r1, r5, 0 - bl sub_81AFC0C - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_0861CE82 - bl sub_81AFC28 - mov r0, r9 - bl Free - mov r0, r8 - bl Free - adds r0, r6, 0 - bl Free - adds r0, r5, 0 - bl Free - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3710 - - thumb_func_start sub_81C37D8 -sub_81C37D8: @ 81C37D8 - push {lr} - sub sp, 0x8 - ldr r0, =gUnknown_0861CCEC - movs r1, 0x2 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02021fc4 - movs r2, 0 - str r2, [sp] - str r2, [sp, 0x4] - movs r2, 0x4 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C37D8 - - thumb_func_start sub_81C3808 -sub_81C3808: @ 81C3808 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r0, =0x02021cc4 - mov r8, r0 - ldr r4, =0x0203cf1c - ldr r0, [r4] - adds r0, 0x98 - ldrh r1, [r0] - mov r0, r8 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r6, =0x02021dc4 - ldr r0, [r4] - adds r0, 0x9A - ldrh r1, [r0] - adds r0, r6, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r5, =0x02021ec4 - ldr r0, [r4] - adds r0, 0x9C - ldrh r1, [r0] - adds r0, r5, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - bl sub_81AFBF0 - movs r0, 0 - mov r1, r8 - bl sub_81AFC0C - movs r0, 0x1 - adds r1, r6, 0 - bl sub_81AFC0C - movs r0, 0x2 - adds r1, r5, 0 - bl sub_81AFC0C - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_0861CE8E - bl sub_81AFC28 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3808 - - thumb_func_start sub_81C3890 -sub_81C3890: @ 81C3890 - push {lr} - sub sp, 0x8 - ldr r0, =gUnknown_0861CCEC - movs r1, 0x3 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02021fc4 - movs r2, 0 - str r2, [sp] - str r2, [sp, 0x4] - movs r2, 0x2 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3890 - - thumb_func_start sub_81C38C0 -sub_81C38C0: @ 81C38C0 - push {r4-r6,lr} - sub sp, 0x8 - ldr r0, =0x0203cf1c - ldr r0, [r0] - adds r5, r0, 0 - adds r5, 0x70 - ldr r0, =gUnknown_0861CCEC - movs r1, 0x4 - bl sub_81C2D2C - lsls r0, 24 - lsrs r6, r0, 24 - ldr r4, =0x02021cc4 - ldr r1, [r5, 0x10] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x7 - bl ConvertIntToDecimalString - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x2A - bl GetStringRightAlignXOffset - adds r0, 0x2 - lsls r2, r0, 24 - lsrs r2, 24 - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - adds r0, r6, 0 - adds r1, r4, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldrb r0, [r5, 0x5] - cmp r0, 0x63 - bhi _081C3948 - ldr r4, =gExperienceTables - adds r1, r0, 0 - adds r1, 0x1 - lsls r1, 2 - ldr r3, =gBaseStats - ldrh r2, [r5] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r3 - ldrb r2, [r0, 0x13] - movs r0, 0xCA - lsls r0, 1 - muls r0, r2 - adds r1, r0 - adds r1, r4 - ldr r1, [r1] - ldr r0, [r5, 0x10] - subs r1, r0 - b _081C394A - .pool -_081C3948: - movs r1, 0 -_081C394A: - ldr r4, =0x02021cc4 - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x6 - bl ConvertIntToDecimalString - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x2A - bl GetStringRightAlignXOffset - adds r0, 0x2 - lsls r2, r0, 24 - lsrs r2, 24 - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - adds r0, r6, 0 - adds r1, r4, 0 - movs r3, 0x11 - bl sub_81C25A4 - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C38C0 - - thumb_func_start sub_81C3984 -sub_81C3984: @ 81C3984 - push {r4,lr} - movs r0, 0 - bl sub_81C3B08 - movs r0, 0x1 - bl sub_81C3B08 - movs r0, 0x2 - bl sub_81C3B08 - movs r0, 0x3 - bl sub_81C3B08 - ldr r4, =0x0203cf1c - ldr r0, [r4] - ldr r1, =0x000040bc - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C39EA - bl sub_81C3F44 - ldr r1, [r4] - ldr r0, =0x000040c6 - adds r2, r1, r0 - ldrb r0, [r2] - cmp r0, 0x4 - bne _081C39DC - ldr r0, =0x000040c4 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _081C39EA - bl sub_81C3E9C - b _081C39EA - .pool -_081C39DC: - ldrb r0, [r2] - lsls r0, 1 - adds r1, 0x84 - adds r1, r0 - ldrh r0, [r1] - bl sub_81C3E9C -_081C39EA: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C3984 - - thumb_func_start sub_81C39F0 -sub_81C39F0: @ 81C39F0 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - ldrh r0, [r4] - subs r0, 0x1 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - bhi _081C3AFC - lsls r0, 2 - ldr r1, =_081C3A20 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C3A20: - .4byte _081C3A40 - .4byte _081C3A48 - .4byte _081C3A50 - .4byte _081C3A58 - .4byte _081C3A60 - .4byte _081C3A7C - .4byte _081C3ABE - .4byte _081C3AF4 -_081C3A40: - movs r0, 0 - bl sub_81C3B08 - b _081C3AFC -_081C3A48: - movs r0, 0x1 - bl sub_81C3B08 - b _081C3AFC -_081C3A50: - movs r0, 0x2 - bl sub_81C3B08 - b _081C3AFC -_081C3A58: - movs r0, 0x3 - bl sub_81C3B08 - b _081C3AFC -_081C3A60: - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040bc - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C3AFC - bl sub_81C3F44 - b _081C3AFC - .pool -_081C3A7C: - ldr r0, =0x0203cf1c - ldr r1, [r0] - ldr r2, =0x000040bc - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C3AFC - ldr r0, =0x000040c6 - adds r2, r1, r0 - ldrb r0, [r2] - cmp r0, 0x4 - bne _081C3AB0 - ldr r2, =0x000040c4 - adds r0, r1, r2 - ldrh r0, [r0] - strh r0, [r4, 0x2] - b _081C3AFC - .pool -_081C3AB0: - ldrb r0, [r2] - lsls r0, 1 - adds r1, 0x84 - adds r1, r0 - ldrh r0, [r1] - strh r0, [r4, 0x2] - b _081C3AFC -_081C3ABE: - ldr r0, =0x0203cf1c - ldr r1, [r0] - ldr r2, =0x000040bc - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C3AFC - adds r2, 0x8 - adds r0, r1, r2 - ldr r0, [r0] - ldr r1, =0x00ffffff - ands r0, r1 - movs r1, 0x80 - lsls r1, 11 - cmp r0, r1 - beq _081C3AFC - ldrh r0, [r4, 0x2] - bl sub_81C3E9C - b _081C3AFC - .pool -_081C3AF4: - adds r0, r2, 0 - bl remove_task - b _081C3B02 -_081C3AFC: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_081C3B02: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C39F0 - - thumb_func_start sub_81C3B08 -sub_81C3B08: @ 81C3B08 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x0203cf1c - ldr r0, [r0] - mov r10, r0 - ldr r4, =gUnknown_0861CD14 - adds r0, r4, 0 - movs r1, 0 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x8] - lsls r1, r7, 1 - mov r0, r10 - adds r0, 0x84 - adds r0, r1 - ldrh r5, [r0] - cmp r5, 0 - beq _081C3C00 - mov r0, r10 - adds r0, 0xA4 - ldrb r1, [r0] - adds r0, r5, 0 - adds r2, r7, 0 - bl CalcPPWithPPUps - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - movs r0, 0xD - adds r1, r5, 0 - muls r1, r0 - ldr r0, =gMoveNames - adds r1, r0 - lsls r0, r7, 4 - mov r9, r0 - mov r3, r9 - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - mov r0, r8 - movs r2, 0 - bl sub_81C25A4 - ldr r0, =0x02021cc4 - mov r8, r0 - mov r5, r10 - adds r5, 0x8C - adds r5, r7 - ldrb r1, [r5] - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r4, =0x02021dc4 - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalString - bl sub_81AFBF0 - movs r0, 0 - mov r1, r8 - bl sub_81AFC0C - movs r0, 0x1 - adds r1, r4, 0 - bl sub_81AFC0C - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_0861CE97 - adds r0, r4, 0 - bl sub_81AFC28 - adds r7, r4, 0 - ldrb r0, [r5] - adds r1, r6, 0 - bl sub_814FC20 - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - adds r5, 0x9 - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x2C - bl GetStringRightAlignXOffset - mov r4, r9 - b _081C3C26 - .pool -_081C3C00: - ldr r1, =gUnknown_085E8D40 - lsls r4, r7, 4 - adds r3, r4, 0x1 - lsls r3, 24 - lsrs r3, 24 - str r5, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - mov r0, r8 - movs r2, 0 - bl sub_81C25A4 - ldr r7, =gUnknown_085E8D42 - movs r5, 0xC - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x2C - bl GetStringCenterAlignXOffset -_081C3C26: - lsls r2, r0, 24 - lsrs r2, 24 - adds r3, r4, 0x1 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0 - str r0, [sp] - lsls r0, r5, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - ldr r0, [sp, 0x8] - adds r1, r7, 0 - bl sub_81C25A4 - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3B08 - - thumb_func_start sub_81C3C5C -sub_81C3C5C: @ 81C3C5C - push {r4-r6,lr} - sub sp, 0x8 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0 - beq _081C3CFC - movs r0, 0x13 - str r0, [sp] - movs r0, 0x20 - str r0, [sp, 0x4] - movs r0, 0xE - movs r1, 0 - movs r2, 0x35 - movs r3, 0 - bl FillWindowPixelRect - ldr r2, =gBattleMoves - lsls r1, r5, 1 - adds r0, r1, r5 - lsls r0, 2 - adds r2, r0, r2 - ldrb r0, [r2, 0x1] - adds r6, r1, 0 - cmp r0, 0x1 - bhi _081C3C9C - ldr r1, =gUnknown_085E8D45 - b _081C3CAC - .pool -_081C3C9C: - ldr r4, =0x02021cc4 - ldrb r1, [r2, 0x1] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - adds r1, r4, 0 -_081C3CAC: - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0xE - movs r2, 0x35 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gBattleMoves - adds r0, r6, r5 - lsls r0, 2 - adds r1, r0, r1 - ldrb r0, [r1, 0x3] - cmp r0, 0 - bne _081C3CDC - ldr r1, =gUnknown_085E8D45 - b _081C3CEC - .pool -_081C3CDC: - ldr r4, =0x02021cc4 - ldrb r1, [r1, 0x3] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - adds r1, r4, 0 -_081C3CEC: - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0xE - movs r2, 0x35 - movs r3, 0x11 - bl sub_81C25A4 -_081C3CFC: - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3C5C - - thumb_func_start sub_81C3D08 -sub_81C3D08: @ 81C3D08 - push {r4,lr} - movs r0, 0 - bl sub_81C3B08 - movs r0, 0x1 - bl sub_81C3B08 - movs r0, 0x2 - bl sub_81C3B08 - movs r0, 0x3 - bl sub_81C3B08 - ldr r4, =0x0203cf1c - ldr r0, [r4] - ldr r1, =0x000040bc - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C3D40 - bl sub_81C3F44 - ldr r0, [r4] - ldr r1, =0x000040c6 - adds r0, r1 - ldrb r0, [r0] - bl sub_81C3E2C -_081C3D40: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3D08 - - thumb_func_start sub_81C3D54 -sub_81C3D54: @ 81C3D54 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - ldrh r0, [r4] - subs r0, 0x1 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - bhi _081C3E20 - lsls r0, 2 - ldr r1, =_081C3D84 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C3D84: - .4byte _081C3DA0 - .4byte _081C3DA8 - .4byte _081C3DB0 - .4byte _081C3DB8 - .4byte _081C3DC0 - .4byte _081C3DDC - .4byte _081C3E18 -_081C3DA0: - movs r0, 0 - bl sub_81C3B08 - b _081C3E20 -_081C3DA8: - movs r0, 0x1 - bl sub_81C3B08 - b _081C3E20 -_081C3DB0: - movs r0, 0x2 - bl sub_81C3B08 - b _081C3E20 -_081C3DB8: - movs r0, 0x3 - bl sub_81C3B08 - b _081C3E20 -_081C3DC0: - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040bc - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C3E20 - bl sub_81C3F44 - b _081C3E20 - .pool -_081C3DDC: - ldr r0, =0x0203cf1c - ldr r2, [r0] - ldr r1, =0x000040bc - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C3E20 - adds r1, 0x8 - adds r0, r2, r1 - ldr r0, [r0] - ldr r1, =0x00ffffff - ands r0, r1 - movs r1, 0x80 - lsls r1, 11 - cmp r0, r1 - beq _081C3E20 - ldr r1, =0x000040c6 - adds r0, r2, r1 - ldrb r0, [r0] - bl sub_81C3E2C - b _081C3E20 - .pool -_081C3E18: - adds r0, r2, 0 - bl remove_task - b _081C3E26 -_081C3E20: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_081C3E26: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C3D54 - - thumb_func_start sub_81C3E2C -sub_81C3E2C: @ 81C3E2C - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x4 - bne _081C3E48 - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040c4 - b _081C3E50 - .pool -_081C3E48: - ldr r0, =0x0203cf1c - ldr r0, [r0] - lsls r1, 1 - adds r0, 0x84 -_081C3E50: - adds r0, r1 - ldrh r4, [r0] - cmp r4, 0 - beq _081C3E82 - ldr r0, =gUnknown_0861CD14 - movs r1, 0x2 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - ldr r3, =gContestEffectDescriptionPointers - ldr r2, =gContestMoves - lsls r1, r4, 3 - adds r1, r2 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r3 - ldr r1, [r1] - movs r2, 0 - str r2, [sp] - str r2, [sp, 0x4] - movs r2, 0x6 - movs r3, 0x1 - bl sub_81C25A4 -_081C3E82: - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3E2C - - thumb_func_start sub_81C3E9C -sub_81C3E9C: @ 81C3E9C - push {r4-r6,lr} - sub sp, 0x8 - lsls r0, 16 - lsrs r4, r0, 16 - adds r6, r4, 0 - ldr r0, =gUnknown_0861CD14 - movs r1, 0x2 - bl sub_81C2D2C - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r5, 0 - movs r1, 0 - bl FillWindowPixelBuffer - cmp r4, 0 - beq _081C3F30 - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040c0 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x2 - bne _081C3F00 - adds r0, r4, 0 - bl sub_81C3C5C - ldr r1, =gMoveDescriptionPointers - subs r0, r4, 0x1 - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - adds r0, r5, 0 - movs r2, 0x6 - movs r3, 0x1 - bl sub_81C25A4 - b _081C3F20 - .pool -_081C3F00: - ldr r2, =gContestEffectDescriptionPointers - ldr r1, =gContestMoves - lsls r0, r6, 3 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r2 - ldr r1, [r0] - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - adds r0, r5, 0 - movs r2, 0x6 - movs r3, 0x1 - bl sub_81C25A4 -_081C3F20: - adds r0, r5, 0 - bl PutWindowTilemap - b _081C3F36 - .pool -_081C3F30: - adds r0, r5, 0 - bl ClearWindowTilemap -_081C3F36: - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81C3E9C - - thumb_func_start sub_81C3F44 -sub_81C3F44: @ 81C3F44 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - ldr r4, =gUnknown_0861CD14 - adds r0, r4, 0 - movs r1, 0 - bl sub_81C2D2C - lsls r0, 24 - lsrs r6, r0, 24 - adds r7, r6, 0 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r0, =0x0203cf1c - ldr r1, [r0] - ldr r2, =0x000040c4 - adds r0, r1, r2 - ldrh r2, [r0] - cmp r2, 0 - bne _081C3F9C - ldr r1, =gUnknown_085E8CF0 - str r2, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - adds r0, r6, 0 - movs r2, 0 - movs r3, 0x41 - bl sub_81C25A4 - b _081C4044 - .pool -_081C3F9C: - ldrh r5, [r0] - ldr r2, =0x000040c0 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x2 - bne _081C3FD0 - movs r0, 0xD - adds r1, r5, 0 - muls r1, r0 - ldr r0, =gMoveNames - adds r1, r0 - movs r0, 0 - str r0, [sp] - movs r0, 0x6 - str r0, [sp, 0x4] - adds r0, r6, 0 - movs r2, 0 - movs r3, 0x41 - bl sub_81C25A4 - b _081C3FEC - .pool -_081C3FD0: - movs r0, 0xD - adds r1, r5, 0 - muls r1, r0 - ldr r0, =gMoveNames - adds r1, r0 - movs r0, 0 - str r0, [sp] - movs r0, 0x5 - str r0, [sp, 0x4] - adds r0, r7, 0 - movs r2, 0 - movs r3, 0x41 - bl sub_81C25A4 -_081C3FEC: - ldr r4, =0x02021cc4 - ldr r1, =gBattleMoves - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x4] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalString - bl sub_81AFBF0 - movs r0, 0 - adds r1, r4, 0 - bl sub_81AFC0C - movs r0, 0x1 - adds r1, r4, 0 - bl sub_81AFC0C - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_0861CE97 - adds r0, r4, 0 - bl sub_81AFC28 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x2C - bl GetStringRightAlignXOffset - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0 - str r0, [sp] - movs r0, 0xC - str r0, [sp, 0x4] - mov r0, r8 - adds r1, r4, 0 - movs r3, 0x41 - bl sub_81C25A4 -_081C4044: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3F44 - - thumb_func_start sub_81C4064 -sub_81C4064: @ 81C4064 - push {r4,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0861CD14 - movs r1, 0 - bl sub_81C2D2C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x48 - str r0, [sp] - movs r0, 0x10 - str r0, [sp, 0x4] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0x42 - bl FillWindowPixelRect - adds r0, r4, 0 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4064 - - thumb_func_start sub_81C40A0 -sub_81C40A0: @ 81C40A0 - 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 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - mov r0, r10 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r5, =gUnknown_0861CD14 - adds r0, r5, 0 - movs r1, 0 - bl sub_81C2D2C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_81C2D2C - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - mov r0, r9 - lsls r6, r0, 4 - movs r0, 0x48 - mov r8, r0 - str r0, [sp] - movs r0, 0x10 - str r0, [sp, 0x4] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - adds r3, r6, 0 - bl FillWindowPixelRect - mov r0, r10 - lsls r7, r0, 4 - mov r0, r8 - str r0, [sp] - movs r0, 0x10 - str r0, [sp, 0x4] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - adds r3, r7, 0 - bl FillWindowPixelRect - movs r4, 0x30 - str r4, [sp] - movs r0, 0x10 - str r0, [sp, 0x4] - adds r0, r5, 0 - movs r1, 0 - movs r2, 0 - adds r3, r6, 0 - bl FillWindowPixelRect - str r4, [sp] - movs r0, 0x10 - str r0, [sp, 0x4] - adds r0, r5, 0 - movs r1, 0 - movs r2, 0 - adds r3, r7, 0 - bl FillWindowPixelRect - mov r0, r9 - bl sub_81C3B08 - mov r0, r10 - bl sub_81C3B08 - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C40A0 - - thumb_func_start sub_81C4154 -sub_81C4154: @ 81C4154 - push {r4,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0861CD14 - movs r1, 0x2 - bl sub_81C2D2C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r1, =gUnknown_085EA4CB - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - adds r0, r4, 0 - movs r2, 0x6 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4154 - - thumb_func_start sub_81C4190 -sub_81C4190: @ 81C4190 - push {r4,r5,lr} - movs r2, 0 - ldr r5, =0x0203cf1c - ldr r4, =0x000040d3 - movs r3, 0xFF -_081C419A: - ldr r0, [r5] - adds r0, r4 - adds r0, r2 - ldrb r1, [r0] - orrs r1, r3 - strb r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x1B - bls _081C419A - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4190 - - thumb_func_start sub_81C41C0 -sub_81C41C0: @ 81C41C0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r5, =0x0203cf1c - ldr r0, [r5] - ldr r1, =0x000040d3 - adds r0, r1 - adds r1, r0, r4 - ldrb r0, [r1] - cmp r0, 0xFF - beq _081C41F2 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - ldr r0, [r5] - ldr r1, =0x000040d3 - adds r0, r1 - adds r0, r4 - movs r1, 0xFF - strb r1, [r0] -_081C41F2: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C41C0 - - thumb_func_start sub_81C4204 -sub_81C4204: @ 81C4204 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =0x02020630 - ldr r2, =0x0203cf1c - ldr r2, [r2] - ldr r4, =0x000040d3 - adds r2, r4 - adds r2, r0 - ldrb r0, [r2] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r3 - adds r2, 0x3E - movs r0, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r3, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4204 - - thumb_func_start sub_81C424C -sub_81C424C: @ 81C424C - push {r4,lr} - movs r4, 0x3 -_081C4250: - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040d3 - adds r0, r1 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0xFF - beq _081C4268 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81C4204 -_081C4268: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1B - bls _081C4250 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C424C - - thumb_func_start sub_81C4280 -sub_81C4280: @ 81C4280 - push {lr} - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040c0 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x2 - beq _081C42B0 - cmp r0, 0x2 - bgt _081C42A4 - cmp r0, 0 - beq _081C42AA - b _081C42C2 - .pool -_081C42A4: - cmp r0, 0x3 - beq _081C42BA - b _081C42C2 -_081C42AA: - bl sub_81C43A0 - b _081C42C2 -_081C42B0: - bl sub_81C4420 - bl sub_81C44F0 - b _081C42C2 -_081C42BA: - bl sub_81C4484 - bl sub_81C44F0 -_081C42C2: - pop {r0} - bx r0 - thumb_func_end sub_81C4280 - - thumb_func_start sub_81C42C8 -sub_81C42C8: @ 81C42C8 - push {r4,r5,lr} - movs r4, 0x3 - ldr r5, =0x0203cf1c -_081C42CE: - ldr r0, [r5] - ldr r1, =0x000040d3 - adds r0, r1 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0xFF - bne _081C42F2 - ldr r0, =gUnknown_0861CFC4 - movs r1, 0 - movs r2, 0 - movs r3, 0x2 - bl AddObjectToFront - ldr r1, [r5] - ldr r2, =0x000040d3 - adds r1, r2 - adds r1, r4 - strb r0, [r1] -_081C42F2: - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81C4204 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _081C42CE - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C42C8 - - thumb_func_start sub_81C4318 -sub_81C4318: @ 81C4318 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x4 - adds r5, r0, 0 - adds r6, r1, 0 - mov r8, r2 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040d3 - adds r0, r1 - adds r0, r3 - ldrb r0, [r0] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - adds r0, r4, 0 - adds r1, r5, 0 - str r3, [sp] - bl StartObjectImageAnim - ldr r0, =gUnknown_0861CFDC - adds r5, r0 - ldrb r1, [r5] - lsls r1, 4 - ldrb r2, [r4, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x5] - adds r6, 0x10 - strh r6, [r4, 0x20] - movs r0, 0x8 - add r8, r0 - mov r1, r8 - strh r1, [r4, 0x22] - ldr r3, [sp] - adds r0, r3, 0 - movs r1, 0 - bl sub_81C4204 - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4318 - - thumb_func_start sub_81C43A0 -sub_81C43A0: @ 81C43A0 - push {r4,r5,lr} - ldr r0, =0x0203cf1c - ldr r0, [r0] - adds r5, r0, 0 - adds r5, 0x70 - ldrb r0, [r5, 0x4] - cmp r0, 0 - beq _081C43CC - movs r0, 0x9 - movs r1, 0x78 - movs r2, 0x30 - movs r3, 0x3 - bl sub_81C4318 - movs r0, 0x4 - movs r1, 0x1 - bl sub_81C4204 - b _081C4418 - .pool -_081C43CC: - ldr r4, =gBaseStats - ldrh r1, [r5] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x6] - movs r1, 0x78 - movs r2, 0x30 - movs r3, 0x3 - bl sub_81C4318 - ldrh r1, [r5] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r1, r0, r4 - ldrb r0, [r1, 0x6] - ldrb r2, [r1, 0x7] - cmp r0, r2 - beq _081C4410 - ldrb r0, [r1, 0x7] - movs r1, 0xA0 - movs r2, 0x30 - movs r3, 0x4 - bl sub_81C4318 - movs r0, 0x4 - movs r1, 0 - bl sub_81C4204 - b _081C4418 - .pool -_081C4410: - movs r0, 0x4 - movs r1, 0x1 - bl sub_81C4204 -_081C4418: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81C43A0 - - thumb_func_start sub_81C4420 -sub_81C4420: @ 81C4420 - push {r4-r6,lr} - ldr r0, =0x0203cf1c - ldr r0, [r0] - adds r5, r0, 0 - adds r5, 0x70 - movs r4, 0 - ldr r6, =gBattleMoves -_081C442E: - lsls r0, r4, 1 - adds r1, r5, 0 - adds r1, 0x14 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _081C4468 - adds r1, r0, 0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x2] - lsls r2, r4, 28 - movs r1, 0x80 - lsls r1, 22 - adds r2, r1 - lsrs r2, 24 - adds r3, r4, 0x3 - lsls r3, 24 - lsrs r3, 24 - movs r1, 0x55 - bl sub_81C4318 - b _081C4474 - .pool -_081C4468: - adds r0, r4, 0x3 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl sub_81C4204 -_081C4474: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _081C442E - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81C4420 - - thumb_func_start sub_81C4484 -sub_81C4484: @ 81C4484 - push {r4,r5,lr} - ldr r0, =0x0203cf1c - ldr r0, [r0] - adds r5, r0, 0 - adds r5, 0x70 - movs r4, 0 -_081C4490: - lsls r0, r4, 1 - adds r1, r5, 0 - adds r1, 0x14 - adds r2, r1, r0 - ldrh r0, [r2] - cmp r0, 0 - beq _081C44D4 - ldr r1, =gContestMoves - lsls r0, 3 - adds r0, r1 - ldrb r0, [r0, 0x1] - lsls r0, 29 - lsrs r0, 5 - movs r1, 0x90 - lsls r1, 21 - adds r0, r1 - lsrs r0, 24 - lsls r2, r4, 28 - movs r1, 0x80 - lsls r1, 22 - adds r2, r1 - lsrs r2, 24 - adds r3, r4, 0x3 - lsls r3, 24 - lsrs r3, 24 - movs r1, 0x55 - bl sub_81C4318 - b _081C44E0 - .pool -_081C44D4: - adds r0, r4, 0x3 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl sub_81C4204 -_081C44E0: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _081C4490 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81C4484 - - thumb_func_start sub_81C44F0 -sub_81C44F0: @ 81C44F0 - push {lr} - ldr r0, =0x0203cf1c - ldr r1, [r0] - ldr r0, =0x000040c4 - adds r3, r1, r0 - ldrh r0, [r3] - cmp r0, 0 - bne _081C4514 - movs r0, 0x7 - movs r1, 0x1 - bl sub_81C4204 - b _081C4560 - .pool -_081C4514: - ldr r2, =0x000040c0 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x2 - bne _081C4540 - ldr r2, =gBattleMoves - ldrh r1, [r3] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x2] - movs r1, 0x55 - movs r2, 0x60 - movs r3, 0x7 - bl sub_81C4318 - b _081C4560 - .pool -_081C4540: - ldr r1, =gContestMoves - ldrh r0, [r3] - lsls r0, 3 - adds r0, r1 - ldrb r0, [r0, 0x1] - lsls r0, 29 - lsrs r0, 5 - movs r1, 0x90 - lsls r1, 21 - adds r0, r1 - lsrs r0, 24 - movs r1, 0x55 - movs r2, 0x60 - movs r3, 0x7 - bl sub_81C4318 -_081C4560: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C44F0 - - thumb_func_start sub_81C4568 -sub_81C4568: @ 81C4568 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =0x0203cf1c - ldr r2, [r2] - adds r0, 0x3 - ldr r3, =0x000040d3 - adds r2, r3 - adds r0, r2, r0 - ldrb r0, [r0] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r5, =0x02020630 - adds r4, r5 - adds r1, 0x3 - adds r2, r1 - ldrb r0, [r2] - lsls r3, r0, 4 - adds r3, r0 - lsls r3, 2 - adds r3, r5 - adds r5, r4, 0 - adds r5, 0x2A - ldrb r1, [r5] - adds r2, r3, 0 - adds r2, 0x2A - ldrb r0, [r2] - strb r0, [r5] - strb r1, [r2] - ldrb r6, [r4, 0x5] - lsrs r5, r6, 4 - ldrb r2, [r3, 0x5] - lsrs r2, 4 - lsls r2, 4 - movs r1, 0xF - adds r0, r1, 0 - ands r0, r6 - orrs r0, r2 - strb r0, [r4, 0x5] - lsls r5, 4 - ldrb r0, [r3, 0x5] - ands r1, r0 - orrs r1, r5 - strb r1, [r3, 0x5] - adds r4, 0x3F - ldrb r0, [r4] - movs r2, 0x4 - orrs r0, r2 - movs r1, 0x11 - negs r1, r1 - ands r0, r1 - strb r0, [r4] - adds r3, 0x3F - ldrb r0, [r3] - orrs r0, r2 - ands r0, r1 - strb r0, [r3] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4568 - - thumb_func_start sub_81C45F4 -sub_81C45F4: @ 81C45F4 - push {r4-r6,lr} - adds r3, r0, 0 - adds r6, r1, 0 - ldr r0, =0x0203cf1c - ldr r2, [r0] - adds r5, r2, 0 - adds r5, 0x70 - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0 - beq _081C4620 - cmp r0, 0x1 - bne _081C4610 - b _081C4750 -_081C4610: - adds r0, r3, 0 - bl sub_81C47B4 - lsls r0, 24 - lsrs r0, 24 - b _081C4770 - .pool -_081C4620: - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081C4680 - ldr r1, =0x000040be - adds r0, r2, r1 - ldrb r1, [r0] - movs r0, 0x3 - bl sub_80688F8 - lsls r0, 24 - cmp r0, 0 - beq _081C4668 - ldrh r2, [r5, 0x2] - lsls r0, r2, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r1, [r1] - ldr r1, [r1, 0x8] - b _081C46D6 - .pool -_081C4668: - ldrh r2, [r5, 0x2] - lsls r0, r2, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r1, [r1] - b _081C46B0 - .pool -_081C4680: - ldr r0, =0x020244d4 - ldr r3, [r0] - adds r4, r0, 0 - cmp r3, 0 - beq _081C46E4 - ldr r1, [r2] - ldr r0, =0x020244ec - cmp r1, r0 - beq _081C46A6 - ldr r1, =0x000040bc - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x2 - beq _081C46A6 - adds r1, 0x33 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081C46CC -_081C46A6: - ldrh r2, [r5, 0x2] - lsls r0, r2, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r1, [r4] -_081C46B0: - ldr r1, [r1, 0x8] - ldr r3, [r5, 0xC] - bl DecompressMonPic_DetectFrontOrBack_2 - b _081C4768 - .pool -_081C46CC: - ldrh r2, [r5, 0x2] - lsls r0, r2, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r1, [r3, 0x8] -_081C46D6: - ldr r3, [r5, 0xC] - bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack - b _081C4768 - .pool -_081C46E4: - ldr r1, [r2] - ldr r0, =0x020244ec - cmp r1, r0 - beq _081C4700 - ldr r1, =0x000040bc - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x2 - beq _081C4700 - adds r1, 0x33 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081C472C -_081C4700: - ldrh r4, [r5, 0x2] - lsls r4, 3 - ldr r0, =gMonFrontPicTable - adds r4, r0 - movs r0, 0 - movs r1, 0x1 - bl sub_806F4F8 - adds r1, r0, 0 - ldrh r2, [r5, 0x2] - ldr r3, [r5, 0xC] - adds r0, r4, 0 - bl DecompressMonPic_DetectFrontOrBack_2 - b _081C4768 - .pool -_081C472C: - ldrh r4, [r5, 0x2] - lsls r4, 3 - ldr r0, =gMonFrontPicTable - adds r4, r0 - movs r0, 0 - movs r1, 0x1 - bl sub_806F4F8 - adds r1, r0, 0 - ldrh r2, [r5, 0x2] - ldr r3, [r5, 0xC] - adds r0, r4, 0 - bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack - b _081C4768 - .pool -_081C4750: - ldrh r0, [r5, 0x2] - ldr r1, [r5, 0x48] - ldr r2, [r5, 0xC] - bl sub_806E7CC - adds r4, r0, 0 - bl LoadCompressedObjectPalette - ldrh r0, [r4, 0x4] - movs r1, 0x1 - bl sub_806A068 -_081C4768: - ldrh r0, [r6] - adds r0, 0x1 - strh r0, [r6] - movs r0, 0xFF -_081C4770: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81C45F4 - - thumb_func_start sub_81C4778 -sub_81C4778: @ 81C4778 - push {r4,lr} - ldr r0, =0x0203cf1c - ldr r1, [r0] - adds r4, r1, 0 - adds r4, 0x70 - ldrb r0, [r4, 0x4] - cmp r0, 0 - bne _081C47AE - adds r0, r1, 0 - adds r0, 0xC - bl sub_805F110 - cmp r0, 0x1 - bne _081C47A4 - ldrh r0, [r4, 0x2] - movs r1, 0 - movs r2, 0 - bl sub_80A32E4 - b _081C47AE - .pool -_081C47A4: - ldrh r0, [r4, 0x2] - movs r1, 0 - movs r2, 0xB - bl sub_80A32E4 -_081C47AE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C4778 - - thumb_func_start sub_81C47B4 -sub_81C47B4: @ 81C47B4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =0x0203cf1c - ldr r6, [r0] - adds r6, 0x70 - ldr r0, =0x0202499c - movs r1, 0x28 - movs r2, 0x40 - movs r3, 0x5 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r4, r0, 4 - add r4, r8 - lsls r4, 2 - ldr r5, =0x02020630 - adds r7, r4, r5 - adds r0, r7, 0 - bl obj_free_rotscale_entry - ldrh r0, [r6, 0x2] - movs r1, 0 - strh r0, [r7, 0x2E] - strh r1, [r7, 0x32] - adds r5, 0x1C - adds r4, r5 - ldr r0, =sub_81C4844 - str r0, [r4] - ldrb r1, [r7, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - strb r0, [r7, 0x5] - ldrh r0, [r6, 0x2] - bl sub_806E840 - lsls r0, 24 - cmp r0, 0 - bne _081C4828 - adds r0, r7, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] - b _081C4836 - .pool -_081C4828: - adds r2, r7, 0 - adds r2, 0x3F - ldrb r1, [r2] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_081C4836: - mov r0, r8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81C47B4 - - thumb_func_start sub_81C4844 -sub_81C4844: @ 81C4844 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r0, =0x0203cf1c - ldr r0, [r0] - adds r5, r0, 0 - adds r5, 0x70 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081C487E - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _081C487E - ldrh r0, [r4, 0x2E] - bl sub_806E840 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x30] - bl sub_81C4778 - ldrh r1, [r4, 0x2E] - ldrb r2, [r5, 0x4] - adds r0, r4, 0 - bl sub_806EE0C -_081C487E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4844 - - thumb_func_start sub_81C488C -sub_81C488C: @ 81C488C - ldr r1, =0x0203cf24 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_81C488C - - thumb_func_start sub_81C4898 -sub_81C4898: @ 81C4898 - push {r4,lr} - ldr r4, =0x0203cf24 - ldrb r0, [r4] - cmp r0, 0xFF - beq _081C48AA - bl remove_task - movs r0, 0xFF - strb r0, [r4] -_081C48AA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4898 - - thumb_func_start sub_81C48B4 -sub_81C48B4: @ 81C48B4 - push {lr} - ldr r2, =0x02020630 - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040d3 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - beq _081C48E8 - movs r0, 0x1 - b _081C48EA - .pool -_081C48E8: - movs r0, 0 -_081C48EA: - pop {r1} - bx r1 - thumb_func_end sub_81C48B4 - - thumb_func_start sub_81C48F0 -sub_81C48F0: @ 81C48F0 - push {r4-r6,lr} - ldr r6, =0x02020630 - ldr r5, =0x0203cf1c - ldr r0, [r5] - ldr r4, =0x000040d3 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x2C - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r6, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =DummyObjectCallback - str r1, [r0] - bl sub_806EE98 - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x5] - lsrs r0, 4 - lsls r3, r0, 4 - movs r1, 0x80 - lsls r1, 1 - adds r0, r1, 0 - orrs r3, r0 - movs r2, 0 - ldr r5, =0x02037714 - ldr r4, =0x02037b14 -_081C494C: - adds r0, r2, r3 - lsls r0, 16 - lsrs r0, 15 - adds r1, r0, r5 - adds r0, r4 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0xF - bls _081C494C - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C48F0 - - thumb_func_start sub_81C4984 -sub_81C4984: @ 81C4984 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r1, =0x00007533 - ldr r2, =gUnknown_0861D120 - adds r0, r1, 0 - bl sub_811FF94 - adds r4, r0, 0 - ldr r6, =0x0203cf1c - ldr r0, [r6] - str r4, [r0, 0x8] - cmp r4, 0 - beq _081C49CE - adds r0, r5, 0 - movs r1, 0x8 - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - ldr r1, [r6] - ldr r2, [r1, 0x8] - movs r0, 0x3C - strh r0, [r2, 0x20] - ldr r2, [r1, 0x8] - movs r0, 0x1A - strh r0, [r2, 0x22] - ldr r2, [r1, 0x8] - ldrb r1, [r2, 0x5] - subs r0, 0x27 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2, 0x5] -_081C49CE: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4984 - - thumb_func_start sub_81C49E0 -sub_81C49E0: @ 81C49E0 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r0, [r0, 0x8] - bl RemoveObjectAndFreeTiles - ldr r0, =0x00007533 - bl FreeObjectTilesByTag - adds r0, r4, 0 - bl sub_81C4984 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C49E0 - - thumb_func_start sub_81C4A08 -sub_81C4A08: @ 81C4A08 - push {r4,lr} - movs r1, 0x26 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - bl ball_number_to_ball_processing_index - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl sub_8076A78 - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 3 - ldr r1, =gUnknown_0832C588 - adds r0, r1 - movs r1, 0x10 - movs r2, 0x88 - movs r3, 0 - bl AddObjectToFront - ldr r2, =0x0203cf1c - ldr r1, [r2] - ldr r3, =0x000040d4 - adds r1, r3 - strb r0, [r1] - ldr r4, =0x02020630 - ldr r2, [r2] - adds r2, r3 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =DummyObjectCallback - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0, 0x5] - movs r2, 0xC - orrs r1, r2 - strb r1, [r0, 0x5] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4A08 - - thumb_func_start sub_81C4A88 -sub_81C4A88: @ 81C4A88 - push {r4,r5,lr} - ldr r5, =0x0203cf1c - ldr r0, [r5] - ldr r1, =0x000040d5 - adds r4, r0, r1 - ldrb r0, [r4] - cmp r0, 0xFF - bne _081C4AA6 - ldr r0, =gUnknown_0861D108 - movs r1, 0x40 - movs r2, 0x98 - movs r3, 0 - bl AddObjectToFront - strb r0, [r4] -_081C4AA6: - ldr r0, [r5] - adds r0, 0xC - bl sub_81B205C - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - beq _081C4AE8 - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - subs r1, r2, 0x1 - lsls r1, 24 - lsrs r1, 24 - bl StartObjectImageAnim - movs r0, 0x2 - movs r1, 0 - bl sub_81C4204 - b _081C4AF0 - .pool -_081C4AE8: - movs r0, 0x2 - movs r1, 0x1 - bl sub_81C4204 -_081C4AF0: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81C4A88 - - thumb_func_start sub_81C4AF8 -sub_81C4AF8: @ 81C4AF8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r0, =0x0203cf1c - ldr r1, =0x000040d3 - add r1, r8 - ldr r0, [r0] - adds r7, r0, r1 - ldr r1, =0x000040c0 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bls _081C4BD2 - movs r0, 0 - mov r9, r0 - mov r1, r8 - cmp r1, 0x8 - bne _081C4B2A - movs r0, 0x1 - mov r9, r0 -_081C4B2A: - movs r5, 0 - ldr r6, =0x02020630 - mov r10, r5 -_081C4B30: - lsls r1, r5, 20 - movs r0, 0xB2 - lsls r0, 15 - adds r1, r0 - asrs r1, 16 - ldr r0, =gUnknown_0861D084 - movs r2, 0x28 - mov r3, r9 - bl AddObjectToFront - adds r1, r7, r5 - strb r0, [r1] - adds r4, r1, 0 - cmp r5, 0 - bne _081C4B74 - ldrb r1, [r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x4 - bl StartObjectImageAnim - b _081C4B9A - .pool -_081C4B74: - cmp r5, 0x9 - bne _081C4B8A - ldrb r1, [r7, 0x9] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x5 - bl StartObjectImageAnim - b _081C4B9A -_081C4B8A: - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x6 - bl StartObjectImageAnim -_081C4B9A: - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r6, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_81C4BE4 - str r1, [r0] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - mov r1, r8 - strh r1, [r0, 0x2E] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - mov r1, r10 - strh r1, [r0, 0x30] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x9 - bls _081C4B30 -_081C4BD2: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4AF8 - - thumb_func_start sub_81C4BE4 -sub_81C4BE4: @ 81C4BE4 - push {lr} - adds r3, r0, 0 - adds r0, 0x2A - ldrb r0, [r0] - subs r0, 0x4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bhi _081C4C1C - ldrh r0, [r3, 0x30] - adds r0, 0x1 - movs r1, 0x1F - ands r0, r1 - strh r0, [r3, 0x30] - cmp r0, 0x18 - ble _081C4C10 - adds r2, r3, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - b _081C4C2A -_081C4C10: - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - b _081C4C28 -_081C4C1C: - movs r0, 0 - strh r0, [r3, 0x30] - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - subs r0, 0x5 -_081C4C28: - ands r0, r1 -_081C4C2A: - strb r0, [r2] - movs r1, 0x2E - ldrsh r0, [r3, r1] - cmp r0, 0x8 - bne _081C4C44 - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040c6 - b _081C4C4A - .pool -_081C4C44: - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040c7 -_081C4C4A: - adds r0, r1 - ldrb r0, [r0] - lsls r0, 4 - strh r0, [r3, 0x26] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4BE4 - - thumb_func_start sub_81C4C60 -sub_81C4C60: @ 81C4C60 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 -_081C4C68: - adds r0, r5, r4 - lsls r0, 24 - lsrs r0, 24 - bl sub_81C41C0 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x9 - bls _081C4C68 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81C4C60 - - thumb_func_start sub_81C4C84 -sub_81C4C84: @ 81C4C84 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x0203cf1c - ldr r0, [r0] - ldr r1, =0x000040db - adds r5, r0, r1 - lsls r0, r6, 1 - adds r0, r6 - lsls r0, 24 - movs r4, 0 - ldr r7, =0x02020630 - movs r2, 0x80 - lsls r2, 19 - adds r2, r0 - mov r9, r2 - lsrs r6, r0, 24 - movs r1, 0xA0 - lsls r1, 19 - adds r1, r0 - mov r8, r1 -_081C4CB4: - cmp r4, 0 - bne _081C4CD4 - ldrb r1, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - mov r2, r9 - b _081C4CE4 - .pool -_081C4CD4: - cmp r4, 0x9 - bne _081C4CEC - ldrb r1, [r5, 0x9] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - mov r2, r8 -_081C4CE4: - lsrs r1, r2, 24 - bl StartObjectImageAnim - b _081C4D02 -_081C4CEC: - adds r0, r5, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - adds r1, r6, 0x6 - lsls r1, 24 - lsrs r1, 24 - bl StartObjectImageAnim -_081C4D02: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x9 - bls _081C4CB4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81C4C84 - - thumb_func_start sub_81C4D18 -sub_81C4D18: @ 81C4D18 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0203cf1c - ldr r2, =0x000040d3 - adds r0, r2 - ldr r1, [r1] - adds r5, r1, r0 - movs r3, 0 - ldr r4, =0x02020630 - movs r7, 0x5 - negs r7, r7 - movs r6, 0 -_081C4D32: - adds r2, r5, r3 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r6, [r0, 0x30] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - adds r1, 0x3E - ldrb r2, [r1] - adds r0, r7, 0 - ands r0, r2 - strb r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x9 - bls _081C4D32 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4D18 - - thumb_func_start sub_81C4D70 -sub_81C4D70: @ 81C4D70 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - ldr r4, =0x0203cf28 - movs r0, 0x4 - bl Alloc - str r0, [r4] - ldr r1, [r5] - lsls r0, r1, 20 - lsrs r4, r0, 30 - cmp r4, 0 - bne _081C4DDC - lsls r0, r1, 30 - lsrs r0, 30 - movs r1, 0x8 - movs r2, 0 - bl SetBgAttribute - ldr r3, [r5] - lsls r0, r3, 30 - lsrs r0, 30 - ldr r1, =gUnknown_0861D1A0 - lsls r3, 22 - lsrs r3, 24 - str r4, [sp] - movs r2, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r0, [r5] - lsls r0, 30 - lsrs r0, 30 - ldr r1, =gUnknown_0861DEF4 - movs r2, 0x1 - str r2, [sp] - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r1, [r5] - lsls r1, 22 - lsrs r1, 24 - str r4, [sp] - movs r2, 0x20 - movs r3, 0x20 - bl sub_8199D3C - b _081C4E2E - .pool -_081C4DDC: - lsls r0, r1, 30 - lsrs r0, 30 - movs r1, 0x8 - movs r2, 0x2 - bl SetBgAttribute - ldr r0, [r5] - lsls r0, 30 - lsrs r0, 30 - movs r1, 0x9 - movs r2, 0x1 - bl SetBgAttribute - ldr r3, [r5] - lsls r0, r3, 30 - lsrs r0, 30 - ldr r1, =gUnknown_0861E208 - lsls r3, 22 - lsrs r3, 24 - movs r2, 0 - str r2, [sp] - bl decompress_and_copy_tile_data_to_vram - ldr r0, [r5] - lsls r0, 30 - lsrs r0, 30 - ldr r1, =gUnknown_0861EF64 - movs r4, 0x1 - str r4, [sp] - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r1, [r5] - lsls r1, 22 - lsrs r1, 24 - str r4, [sp] - movs r2, 0x40 - movs r3, 0x40 - bl sub_8199D3C -_081C4E2E: - ldr r0, [r5] - lsls r0, 30 - lsrs r0, 30 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - ldr r0, [r5] - lsls r0, 30 - lsrs r0, 30 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - ldr r0, [r5] - lsls r0, 30 - lsrs r0, 30 - movs r1, 0x4 - movs r2, 0x1 - bl SetBgAttribute - ldr r0, =gUnknown_0861D140 - ldr r1, =0x020377f4 - ldr r2, =0x04000018 - bl CpuSet - ldr r0, =0x0203cf28 - ldr r1, [r0] - ldr r0, [r5] - lsls r0, 30 - lsrs r0, 30 - strb r0, [r1] - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4D70 - - thumb_func_start sub_81C4E90 -sub_81C4E90: @ 81C4E90 - push {lr} - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - beq _081C4EA0 - movs r0, 0x1 - b _081C4EAC -_081C4EA0: - ldr r0, =0x0203cf28 - ldr r0, [r0] - ldrb r0, [r0] - bl ShowBg - movs r0, 0 -_081C4EAC: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81C4E90 - - thumb_func_start sub_81C4EB4 -sub_81C4EB4: @ 81C4EB4 - push {r4,lr} - ldr r4, =0x0203cf28 - ldr r0, [r4] - cmp r0, 0 - beq _081C4EC6 - bl Free - movs r0, 0 - str r0, [r4] -_081C4EC6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4EB4 - - thumb_func_start sub_81C4ED0 -sub_81C4ED0: @ 81C4ED0 - push {lr} - adds r1, r0, 0 - ldr r0, =0x0203cf28 - ldr r0, [r0] - ldrb r0, [r0] - lsls r1, 8 - movs r2, 0 - bl ChangeBgY - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4ED0 - - thumb_func_start sub_81C4EEC -sub_81C4EEC: @ 81C4EEC - ldr r1, =0x0203cf30 - movs r0, 0 - strh r0, [r1, 0x6] - strh r0, [r1, 0x8] - bx lr - .pool - thumb_func_end sub_81C4EEC - - thumb_func_start sub_81C4EFC -sub_81C4EFC: @ 81C4EFC - push {lr} - ldr r1, =sub_8086194 - movs r0, 0 - bl sub_81C4F98 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4EFC - - thumb_func_start sub_81C4F10 -sub_81C4F10: @ 81C4F10 - push {lr} - ldr r1, =sub_8059D50 - movs r0, 0x1 - bl sub_81C4F98 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4F10 - - thumb_func_start sub_81C4F24 -sub_81C4F24: @ 81C4F24 - push {lr} - bl script_env_2_enable - movs r0, 0x1 - movs r1, 0 - bl fade_screen - ldr r0, =sub_81C4F44 - movs r1, 0xA - bl AddTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4F24 - - thumb_func_start sub_81C4F44 -sub_81C4F44: @ 81C4F44 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081C4F6E - bl overworld_free_bg_tilemaps - ldr r0, =0x03005db0 - ldr r1, =hm_add_c3_without_phase_2 - str r1, [r0] - ldr r1, =c2_exit_to_overworld_2_switch - movs r0, 0x3 - bl sub_81C4F98 - adds r0, r4, 0 - bl remove_task -_081C4F6E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4F44 - - thumb_func_start sub_81C4F84 -sub_81C4F84: @ 81C4F84 - push {lr} - ldr r0, =0x0203cf30 - ldr r1, [r0] - movs r0, 0x4 - bl sub_81C4F98 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4F84 - - thumb_func_start sub_81C4F98 -sub_81C4F98: @ 81C4F98 - push {r4-r6,lr} - adds r5, r1, 0 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r6, =0x0203cf2c - ldr r0, =0x0000098c - bl AllocZeroed - str r0, [r6] - cmp r4, 0x4 - beq _081C4FB2 - ldr r0, =0x0203cf30 - strb r4, [r0, 0x4] -_081C4FB2: - cmp r5, 0 - beq _081C4FBA - ldr r0, =0x0203cf30 - str r5, [r0] -_081C4FBA: - ldr r0, [r6] - movs r1, 0 - str r1, [r0] - ldr r1, =0x00000814 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldr r0, [r6] - ldr r1, =0x00000816 - adds r0, r1 - movs r1, 0x1 - negs r1, r1 - strb r1, [r0] - ldr r0, [r6] - ldr r1, =0x00000804 - adds r0, r1 - movs r1, 0xFF - movs r2, 0xB - bl memset - ldr r0, [r6] - ldr r1, =0x0000080f - adds r0, r1 - movs r1, 0xFF - movs r2, 0x5 - bl memset - ldr r0, =sub_81C504C - bl SetMainCallback2 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4F98 - - thumb_func_start sub_81C501C -sub_81C501C: @ 81C501C - push {lr} - bl RunActiveTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl do_scheduled_bg_tilemap_copies_to_vram - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_81C501C - - thumb_func_start sub_81C5038 -sub_81C5038: @ 81C5038 - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_81C5038 - - thumb_func_start sub_81C504C -sub_81C504C: @ 81C504C - push {lr} -_081C504E: - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C5072 - bl sub_81C5078 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C5072 - bl sub_81221AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C504E -_081C5072: - pop {r0} - bx r0 - thumb_func_end sub_81C504C - - thumb_func_start sub_81C5078 -sub_81C5078: @ 81C5078 - push {lr} - sub sp, 0x4 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x10 - bls _081C508C - b _081C51BC -_081C508C: - lsls r0, 2 - ldr r1, =_081C50A0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C50A0: - .4byte _081C50E4 - .4byte _081C50EE - .4byte _081C50F4 - .4byte _081C50FA - .4byte _081C510C - .4byte _081C5112 - .4byte _081C5122 - .4byte _081C513C - .4byte _081C5148 - .4byte _081C514E - .4byte _081C515C - .4byte _081C5162 - .4byte _081C5168 - .4byte _081C516E - .4byte _081C5174 - .4byte _081C517A - .4byte _081C5188 -_081C50E4: - bl SetVBlankHBlankCallbacksToNull - bl clear_scheduled_bg_copies_to_vram - b _081C51A2 -_081C50EE: - bl remove_some_task - b _081C51A2 -_081C50F4: - bl ResetObjectPaletteAllocator - b _081C51A2 -_081C50FA: - bl sub_80A1A74 - ldr r2, =0x02037fd4 - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - b _081C51A0 - .pool -_081C510C: - bl ResetAllObjectData - b _081C51A2 -_081C5112: - bl sub_81221AC - lsls r0, 24 - cmp r0, 0 - bne _081C51A2 - bl clear_tasks - b _081C51A2 -_081C5122: - bl sub_81C51DC - ldr r0, =0x0203cf2c - ldr r0, [r0] - ldr r1, =0x00000984 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - b _081C51A2 - .pool -_081C513C: - bl sub_81C5238 - lsls r0, 24 - cmp r0, 0 - beq _081C51D4 - b _081C51A2 -_081C5148: - bl sub_81C6BD8 - b _081C51A2 -_081C514E: - bl sub_81C5924 - bl sub_81C59BC - bl sub_81C5A20 - b _081C51A2 -_081C515C: - bl sub_81C5314 - b _081C51A2 -_081C5162: - bl sub_81C56F8 - b _081C51A2 -_081C5168: - bl sub_81C6EF4 - b _081C51A2 -_081C516E: - bl sub_81C5674 - b _081C51A2 -_081C5174: - bl sub_81C700C - b _081C51A2 -_081C517A: - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - b _081C51A2 -_081C5188: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 -_081C51A0: - strb r0, [r2, 0x8] -_081C51A2: - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _081C51D4 - .pool -_081C51BC: - ldr r0, =sub_81C5038 - bl SetVBlankCallback - ldr r0, =sub_81C501C - bl SetMainCallback2 - movs r0, 0x1 - b _081C51D6 - .pool -_081C51D4: - movs r0, 0 -_081C51D6: - add sp, 0x4 - pop {r1} - bx r1 - thumb_func_end sub_81C5078 - - thumb_func_start sub_81C51DC -sub_81C51DC: @ 81C51DC - push {lr} - bl sub_8121DA0 - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0861F2B4 - movs r0, 0 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r0, =0x0203cf2c - ldr r1, [r0] - adds r1, 0x4 - movs r0, 0x2 - bl SetBgTilemapBuffer - bl sub_8121E10 - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C51DC - - thumb_func_start sub_81C5238 -sub_81C5238: @ 81C5238 - push {r4,lr} - sub sp, 0x4 - ldr r4, =0x0203cf2c - ldr r0, [r4] - ldr r1, =0x00000984 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0x4 - bhi _081C52F0 - lsls r0, 2 - ldr r1, =_081C5264 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C5264: - .4byte _081C5278 - .4byte _081C5294 - .4byte _081C52B8 - .4byte _081C52C8 - .4byte _081C52D4 -_081C5278: - bl reset_temp_tile_data_buffers - ldr r1, =gUnknown_08D9A620 - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - b _081C52D8 - .pool -_081C5294: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C5308 - ldr r0, =gUnknown_08D9AE04 - ldr r4, =0x0203cf2c - ldr r1, [r4] - adds r1, 0x4 - bl LZDecompressWram - ldr r1, [r4] - b _081C52DC - .pool -_081C52B8: - ldr r0, =gUnknown_08D9AF44 - movs r1, 0 - movs r2, 0x20 - bl decompress_palette - b _081C52D8 - .pool -_081C52C8: - ldr r0, =gUnknown_0861F3CC - bl LoadCompressedObjectPic - b _081C52D8 - .pool -_081C52D4: - bl sub_81C6E98 -_081C52D8: - ldr r0, =0x0203cf2c - ldr r1, [r0] -_081C52DC: - ldr r0, =0x00000984 - adds r1, r0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _081C5308 - .pool -_081C52F0: - bl sub_8122328 - ldr r0, [r4] - ldr r1, =0x00000984 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - movs r0, 0x1 - b _081C530A - .pool -_081C5308: - movs r0, 0 -_081C530A: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81C5238 - - thumb_func_start sub_81C5314 -sub_81C5314: @ 81C5314 - push {r4-r7,lr} - ldr r0, =0x03005d90 - ldr r2, [r0] - ldr r1, =0x00000ca9 - adds r0, r2, r1 - ldrb r1, [r0] - lsls r1, 30 - lsrs r1, 30 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - ldr r3, =0x00000e2c - adds r0, r3 - adds r7, r2, r0 - movs r6, 0 - ldr r1, =0x0203cf2c - ldr r0, [r1] - ldr r4, =0x00000821 - adds r0, r4 - ldrb r0, [r0] - subs r0, 0x1 - cmp r6, r0 - bge _081C5382 - adds r5, r1, 0 -_081C5344: - lsls r1, r6, 1 - adds r4, r1, r6 - lsls r4, 3 - ldr r0, =0x0000087c - adds r4, r0 - ldr r0, [r5] - adds r0, r4 - adds r1, r7 - ldrh r1, [r1] - bl sub_81C540C - ldr r1, [r5] - lsls r2, r6, 3 - ldr r3, =0x00000824 - adds r0, r1, r3 - adds r0, r2 - adds r4, r1, r4 - str r4, [r0] - ldr r4, =0x00000828 - adds r0, r1, r4 - adds r0, r2 - str r6, [r0] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =0x00000821 - adds r1, r0 - ldrb r0, [r1] - subs r0, 0x1 - cmp r6, r0 - blt _081C5344 -_081C5382: - ldr r5, =0x0203cf2c - lsls r4, r6, 1 - adds r4, r6 - lsls r4, 3 - ldr r1, =0x0000087c - adds r4, r1 - ldr r0, [r5] - adds r0, r4 - ldr r1, =gUnknown_085E8DB4 - bl CopyString - ldr r1, [r5] - lsls r2, r6, 3 - ldr r3, =0x00000824 - adds r0, r1, r3 - adds r0, r2 - adds r4, r1, r4 - str r4, [r0] - ldr r4, =0x00000828 - adds r1, r4 - adds r1, r2 - movs r0, 0x2 - negs r0, r0 - str r0, [r1] - ldr r2, =0x03006310 - adds r1, r2, 0 - ldr r0, =gUnknown_0861F2C0 - ldm r0!, {r4,r6,r7} - stm r1!, {r4,r6,r7} - ldm r0!, {r4,r6,r7} - stm r1!, {r4,r6,r7} - ldr r1, [r5] - ldr r6, =0x00000821 - adds r0, r1, r6 - ldrb r0, [r0] - strh r0, [r2, 0xC] - adds r3, r1, r3 - str r3, [r2] - ldr r7, =0x00000822 - adds r1, r7 - ldrb r0, [r1] - strh r0, [r2, 0xE] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C5314 - - thumb_func_start sub_81C540C -sub_81C540C: @ 81C540C - push {r4,r5,lr} - adds r5, r0, 0 - lsls r1, 16 - lsrs r4, r1, 16 - adds r0, r4, 0 - bl itemid_get_pocket_number - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bne _081C5450 - ldr r0, =0x02021cc4 - adds r1, r4, 0 - subs r1, 0x84 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r1, =0x02021dc4 - adds r0, r4, 0 - bl itemid_get_name - ldr r1, =gUnknown_085E9210 - adds r0, r5, 0 - bl ExpandStringRefs - b _081C5458 - .pool -_081C5450: - adds r0, r4, 0 - adds r1, r5, 0 - bl itemid_get_name -_081C5458: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81C540C - - thumb_func_start sub_81C5460 -sub_81C5460: @ 81C5460 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x1 - beq _081C5476 - movs r0, 0x5 - bl audio_play - bl sub_81C6F20 -_081C5476: - ldr r5, =0x0203cf2c - ldr r1, [r5] - ldr r2, =0x00000814 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0xFF - bne _081C5504 - adds r2, 0x1 - adds r0, r1, r2 - ldrb r1, [r0] - movs r0, 0x1 - eors r0, r1 - bl sub_81C6FF8 - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - beq _081C54E0 - ldr r0, =0x03005d90 - ldr r2, [r0] - lsls r3, r4, 1 - ldr r1, =0x00000ca9 - adds r0, r2, r1 - ldrb r1, [r0] - lsls r1, 30 - lsrs r1, 30 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r3, r0 - ldr r0, =0x00000e2c - adds r2, r0 - adds r2, r3 - ldrh r0, [r2] - ldr r1, [r5] - ldr r2, =0x00000815 - adds r1, r2 - ldrb r1, [r1] - bl sub_81C6F90 - b _081C54EE - .pool -_081C54E0: - ldr r0, =0x0000ffff - ldr r1, [r5] - ldr r2, =0x00000815 - adds r1, r2 - ldrb r1, [r1] - bl sub_81C6F90 -_081C54EE: - ldr r0, =0x0203cf2c - ldr r1, [r0] - ldr r0, =0x00000815 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x1 - eors r0, r2 - strb r0, [r1] - adds r0, r4, 0 - bl sub_81C55D8 -_081C5504: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C5460 - - thumb_func_start sub_81C5518 -sub_81C5518: @ 81C5518 - push {r4-r6,lr} - sub sp, 0x10 - adds r4, r1, 0 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r2, 24 - lsrs r5, r2, 24 - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - beq _081C55B8 - ldr r0, =0x0203cf2c - ldr r0, [r0] - ldr r1, =0x00000814 - adds r0, r1 - ldrb r1, [r0] - cmp r1, 0xFF - beq _081C5560 - lsls r0, r4, 24 - lsrs r0, 24 - cmp r1, r0 - bne _081C5558 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_81C5AB8 - b _081C5560 - .pool -_081C5558: - adds r0, r5, 0 - movs r1, 0xFF - bl sub_81C5AB8 -_081C5560: - ldr r0, =0x02021cc4 - ldr r1, =0x03005d90 - ldr r3, [r1] - ldr r2, =0x00000ca9 - adds r1, r3, r2 - ldrb r2, [r1] - lsls r2, 30 - lsrs r2, 30 - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 1 - adds r1, r4, r1 - ldr r2, =0x00000e54 - adds r3, r2 - adds r3, r1 - ldrb r1, [r3] - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E8DA0 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0x7 - adds r1, r4, 0 - movs r2, 0x77 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - movs r1, 0 - str r1, [sp] - str r1, [sp, 0x4] - movs r0, 0xFF - str r0, [sp, 0x8] - str r1, [sp, 0xC] - adds r0, r6, 0 - adds r1, r4, 0 - adds r3, r5, 0 - bl sub_81C6C94 -_081C55B8: - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C5518 - - thumb_func_start sub_81C55D8 -sub_81C55D8: @ 81C55D8 - push {r4,lr} - sub sp, 0x10 - adds r3, r0, 0 - movs r0, 0x2 - negs r0, r0 - cmp r3, r0 - beq _081C561C - ldr r0, =0x03005d90 - ldr r2, [r0] - lsls r3, 1 - ldr r1, =0x00000ca9 - adds r0, r2, r1 - ldrb r1, [r0] - lsls r1, 30 - lsrs r1, 30 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r3, r0 - ldr r0, =0x00000e2c - adds r2, r0 - adds r2, r3 - ldrh r0, [r2] - bl itemid_get_description - adds r4, r0, 0 - b _081C5638 - .pool -_081C561C: - ldr r0, =0x02021cc4 - ldr r2, =gUnknown_085E91B0 - ldr r1, =0x0203cf30 - ldrb r1, [r1, 0x4] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl CopyString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E91C0 - adds r0, r4, 0 - bl ExpandStringRefs -_081C5638: - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r1, 0 - str r1, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - str r1, [sp, 0x8] - str r1, [sp, 0xC] - adds r1, r4, 0 - movs r2, 0x3 - movs r3, 0 - bl sub_81C6C3C - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C55D8 - - thumb_func_start sub_81C5674 -sub_81C5674: @ 81C5674 - push {r4,lr} - sub sp, 0x10 - ldr r4, =0x0203cf2c - ldr r1, [r4] - ldr r2, =0x00000816 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0xFF - bne _081C56B4 - adds r2, 0xB - adds r0, r1, r2 - ldrb r0, [r0] - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - subs r0, r1 - str r0, [sp] - ldr r0, =0x00000b5e - str r0, [sp, 0x4] - str r0, [sp, 0x8] - ldr r0, =0x0203cf38 - str r0, [sp, 0xC] - movs r0, 0x2 - movs r1, 0xAC - movs r2, 0xC - movs r3, 0x94 - bl AddScrollIndicatorArrowPairParametrized - ldr r1, [r4] - ldr r2, =0x00000816 - adds r1, r2 - strb r0, [r1] -_081C56B4: - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C5674 - - thumb_func_start sub_81C56CC -sub_81C56CC: @ 81C56CC - push {r4,lr} - ldr r4, =0x0203cf2c - ldr r0, [r4] - ldr r2, =0x00000816 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0xFF - beq _081C56EA - bl RemoveScrollIndicatorArrowPair - ldr r0, [r4] - ldr r1, =0x00000816 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] -_081C56EA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C56CC - - thumb_func_start sub_81C56F8 -sub_81C56F8: @ 81C56F8 - push {r4,lr} - ldr r0, =sub_81C5BC8 - movs r1, 0 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =0x03005e08 - adds r4, r0 - ldr r0, =0x03006310 - ldr r2, =0x0203cf30 - ldrh r1, [r2, 0x8] - ldrh r2, [r2, 0x6] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C56F8 - - thumb_func_start sub_81C5738 -sub_81C5738: @ 81C5738 - push {r4-r6,lr} - mov r6, r8 - push {r6} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =0x03005d90 - ldr r6, [r2] - ldr r3, =0x00000ca9 - adds r2, r6, r3 - ldrb r3, [r2] - lsls r3, 30 - lsrs r2, r3, 30 - lsls r4, r2, 2 - adds r4, r2 - lsls r4, 2 - ldr r2, =0x00000e2c - adds r4, r2 - adds r4, r6, r4 - lsrs r3, 30 - lsls r2, r3, 2 - adds r2, r3 - lsls r2, 1 - ldr r3, =0x00000e54 - adds r2, r3 - adds r6, r2 - lsls r5, r0, 1 - adds r5, r4 - ldrh r2, [r5] - mov r8, r2 - lsls r2, r1, 1 - adds r2, r4 - ldrh r3, [r2] - strh r3, [r5] - mov r3, r8 - strh r3, [r2] - adds r0, r6, r0 - ldrb r2, [r0] - adds r6, r1 - ldrb r1, [r6] - strb r1, [r0] - strb r2, [r6] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C5738 - - thumb_func_start sub_81C57A8 -sub_81C57A8: @ 81C57A8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r4, r0, 24 - adds r7, r4, 0 - lsls r1, 24 - lsrs r5, r1, 24 - ldr r0, =0x03005d90 - ldr r3, [r0] - ldr r1, =0x00000ca9 - adds r0, r3, r1 - ldrb r1, [r0] - lsls r1, 30 - lsrs r2, r1, 30 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x00000e2c - adds r0, r2 - adds r6, r3, r0 - lsrs r1, 30 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 1 - ldr r1, =0x00000e54 - adds r0, r1 - adds r3, r0 - cmp r4, r5 - beq _081C5862 - lsls r0, r4, 1 - adds r0, r6 - ldrh r0, [r0] - mov r12, r0 - adds r0, r3, r4 - ldrb r0, [r0] - mov r8, r0 - cmp r5, r4 - bls _081C5830 - subs r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r2, r4, 16 - cmp r4, r5 - bge _081C5854 -_081C5802: - asrs r2, 16 - lsls r0, r2, 1 - adds r0, r6 - ldrh r1, [r0, 0x2] - strh r1, [r0] - adds r1, r3, r2 - ldrb r0, [r1, 0x1] - strb r0, [r1] - adds r2, 0x1 - lsls r2, 16 - asrs r0, r2, 16 - cmp r0, r5 - blt _081C5802 - b _081C5854 - .pool -_081C5830: - lsls r2, r7, 16 - cmp r7, r5 - ble _081C5854 -_081C5836: - asrs r2, 16 - lsls r1, r2, 1 - adds r1, r6 - subs r0, r1, 0x2 - ldrh r0, [r0] - strh r0, [r1] - adds r1, r3, r2 - subs r0, r1, 0x1 - ldrb r0, [r0] - strb r0, [r1] - subs r2, 0x1 - lsls r2, 16 - asrs r0, r2, 16 - cmp r0, r5 - bgt _081C5836 -_081C5854: - lsls r0, r5, 1 - adds r0, r6 - mov r2, r12 - strh r2, [r0] - adds r0, r3, r5 - mov r1, r8 - strb r1, [r0] -_081C5862: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81C57A8 - - thumb_func_start sub_81C586C -sub_81C586C: @ 81C586C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r0, =0x03005d90 - ldr r3, [r0] - ldr r1, =0x00000ca9 - adds r0, r3, r1 - ldrb r1, [r0] - lsls r1, 30 - lsrs r2, r1, 30 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x00000e2c - adds r0, r2 - adds r0, r3 - mov r9, r0 - lsrs r1, 30 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 1 - ldr r4, =0x00000e54 - adds r0, r4 - adds r3, r0 - mov r8, r3 - movs r5, 0 - movs r3, 0 -_081C58A4: - lsls r0, r5, 1 - mov r1, r9 - adds r2, r0, r1 - ldrh r0, [r2] - mov r4, r8 - adds r1, r4, r5 - cmp r0, 0 - beq _081C58BA - ldrb r0, [r1] - cmp r0, 0 - bne _081C58BE -_081C58BA: - strh r3, [r2] - strb r3, [r1] -_081C58BE: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x9 - bls _081C58A4 - movs r5, 0 -_081C58CA: - adds r1, r5, 0x1 - lsls r0, r1, 24 - lsrs r4, r0, 24 - adds r7, r1, 0 - cmp r4, 0x9 - bhi _081C58FE - lsls r0, r5, 1 - mov r1, r9 - adds r6, r0, r1 -_081C58DC: - ldrh r0, [r6] - cmp r0, 0 - beq _081C58EC - mov r2, r8 - adds r0, r2, r5 - ldrb r0, [r0] - cmp r0, 0 - bne _081C58F4 -_081C58EC: - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_81C5738 -_081C58F4: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x9 - bls _081C58DC -_081C58FE: - lsls r0, r7, 24 - lsrs r5, r0, 24 - cmp r5, 0x8 - bls _081C58CA - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C586C - - thumb_func_start sub_81C5924 -sub_81C5924: @ 81C5924 - push {r4-r6,lr} - ldr r0, =0x03005d90 - ldr r2, [r0] - ldr r1, =0x00000ca9 - adds r0, r2, r1 - ldrb r1, [r0] - lsls r1, 30 - lsrs r1, 30 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x00000e2c - adds r0, r1 - adds r5, r2, r0 - bl sub_81C586C - ldr r3, =0x0203cf2c - ldr r0, [r3] - ldr r2, =0x00000821 - adds r0, r2 - movs r1, 0 - strb r1, [r0] - movs r4, 0 - adds r6, r3, 0 -_081C5954: - lsls r0, r4, 1 - adds r0, r5 - ldrh r0, [r0] - ldr r3, =0x0203cf2c - cmp r0, 0 - beq _081C596A - ldr r1, [r6] - adds r1, r2 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_081C596A: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x9 - bls _081C5954 - ldr r0, [r3] - ldr r2, =0x00000821 - adds r0, r2 - ldrb r1, [r0] - adds r1, 0x1 - strb r1, [r0] - ldr r0, [r3] - adds r2, r0, r2 - ldrb r2, [r2] - cmp r2, 0x8 - bls _081C59AC - ldr r2, =0x00000822 - adds r1, r0, r2 - movs r0, 0x8 - strb r0, [r1] - b _081C59B2 - .pool -_081C59AC: - ldr r1, =0x00000822 - adds r0, r1 - strb r2, [r0] -_081C59B2: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C5924 - - thumb_func_start sub_81C59BC -sub_81C59BC: @ 81C59BC - push {r4,r5,lr} - ldr r0, =0x0203cf30 - ldrh r1, [r0, 0x8] - adds r3, r0, 0 - ldr r4, =0x0203cf2c - cmp r1, 0 - beq _081C59E4 - ldrh r0, [r3, 0x8] - ldr r1, [r4] - ldr r5, =0x00000822 - adds r2, r1, r5 - ldrb r2, [r2] - adds r0, r2 - subs r5, 0x1 - adds r1, r5 - ldrb r1, [r1] - cmp r0, r1 - ble _081C59E4 - subs r0, r1, r2 - strh r0, [r3, 0x8] -_081C59E4: - adds r2, r3, 0 - ldrh r1, [r2, 0x8] - ldrh r0, [r2, 0x6] - adds r1, r0 - ldr r0, [r4] - ldr r4, =0x00000821 - adds r0, r4 - ldrb r0, [r0] - cmp r1, r0 - blt _081C5A18 - adds r1, r0, 0 - cmp r1, 0 - bne _081C5A14 - strh r1, [r2, 0x6] - b _081C5A18 - .pool -_081C5A14: - subs r0, 0x1 - strh r0, [r3, 0x6] -_081C5A18: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81C59BC - - thumb_func_start sub_81C5A20 -sub_81C5A20: @ 81C5A20 - push {r4-r7,lr} - ldr r0, =0x0203cf30 - ldrh r1, [r0, 0x6] - adds r5, r0, 0 - cmp r1, 0x4 - bls _081C5A80 - movs r4, 0 - ldrh r0, [r5, 0x6] - subs r0, 0x4 - cmp r4, r0 - bgt _081C5A80 - ldrh r2, [r5, 0x8] - ldr r6, =0x0203cf2c - ldr r0, [r6] - ldr r3, =0x00000822 - adds r1, r0, r3 - ldrb r1, [r1] - adds r2, r1 - ldr r7, =0x00000821 - adds r0, r7 - ldrb r0, [r0] - cmp r2, r0 - beq _081C5A80 - adds r3, r5, 0 -_081C5A50: - ldrh r0, [r3, 0x6] - subs r0, 0x1 - strh r0, [r3, 0x6] - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - ldrh r0, [r3, 0x6] - subs r0, 0x4 - cmp r4, r0 - bgt _081C5A80 - ldrh r2, [r5, 0x8] - ldr r1, [r6] - ldr r7, =0x00000822 - adds r0, r1, r7 - ldrb r0, [r0] - adds r2, r0 - ldr r0, =0x00000821 - adds r1, r0 - ldrb r1, [r1] - cmp r2, r1 - bne _081C5A50 -_081C5A80: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C5A20 - - thumb_func_start sub_81C5A98 -sub_81C5A98: @ 81C5A98 - push {r4,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsrs r4, 24 - bl ListMenuGetYCoordForPrintingArrowCursor - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - bl sub_81C5AB8 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C5A98 - - thumb_func_start sub_81C5AB8 -sub_81C5AB8: @ 81C5AB8 - push {r4,r5,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r2, r1, 24 - cmp r2, 0xFF - bne _081C5AF4 - movs r0, 0x1 - movs r1, 0 - bl GetMenuCursorDimensionByFont - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - movs r1, 0x1 - bl GetMenuCursorDimensionByFont - lsls r0, 24 - lsrs r0, 24 - str r4, [sp] - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - adds r3, r5, 0 - bl FillWindowPixelRect - b _081C5B08 -_081C5AF4: - ldr r1, =gUnknown_085E8D60 - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r2, [sp, 0xC] - movs r2, 0 - adds r3, r5, 0 - bl sub_81C6C3C -_081C5B08: - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C5AB8 - - thumb_func_start sub_81C5B14 -sub_81C5B14: @ 81C5B14 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81C5B4C - str r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C5B14 - - thumb_func_start sub_81C5B4C -sub_81C5B4C: @ 81C5B4C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r2, r0, r1 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081C5BBC - ldrb r0, [r2] - ldr r4, =0x0203cf38 - subs r2, r4, 0x2 - adds r1, r4, 0 - bl sub_81AE6C8 - ldr r0, =0x0203cf2c - ldr r0, [r0] - ldr r0, [r0] - cmp r0, 0 - beq _081C5B94 - bl SetMainCallback2 - b _081C5B9E - .pool -_081C5B94: - adds r0, r4, 0 - subs r0, 0x8 - ldr r0, [r0] - bl SetMainCallback2 -_081C5B9E: - bl sub_81C56CC - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - bl FreeAllWindowBuffers - ldr r0, =0x0203cf2c - ldr r0, [r0] - bl Free - adds r0, r5, 0 - bl remove_task -_081C5BBC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C5B4C - - thumb_func_start sub_81C5BC8 -sub_81C5BC8: @ 81C5BC8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r7, r0, r1 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C5BEA - b _081C5D16 -_081C5BEA: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081C5BF8 - b _081C5D16 -_081C5BF8: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x4 - ands r0, r1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - beq _081C5C5C - ldr r4, =0x0203cf30 - ldrb r0, [r4, 0x4] - cmp r0, 0x2 - bne _081C5C12 - b _081C5D16 -_081C5C12: - ldrb r0, [r7] - adds r1, r4, 0 - adds r1, 0x8 - adds r2, r4, 0x6 - bl get_coro_args_x18_x1A - ldrh r1, [r4, 0x8] - ldrh r0, [r4, 0x6] - adds r1, r0 - ldr r0, =0x0203cf2c - ldr r0, [r0] - ldr r2, =0x00000821 - adds r0, r2 - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - beq _081C5D16 - movs r0, 0x5 - bl audio_play - adds r0, r5, 0 - bl sub_81C67CC - b _081C5D16 - .pool -_081C5C5C: - ldrb r0, [r7] - bl ListMenuHandleInput - adds r6, r0, 0 - ldrb r0, [r7] - ldr r1, =0x0203cf38 - mov r8, r1 - mov r2, r8 - subs r2, 0x2 - bl get_coro_args_x18_x1A - movs r0, 0x2 - negs r0, r0 - cmp r6, r0 - beq _081C5C88 - adds r0, 0x1 - cmp r6, r0 - bne _081C5CA0 - b _081C5D16 - .pool -_081C5C88: - movs r0, 0x5 - bl audio_play - ldr r0, =0x0203ce7c - strh r4, [r0] - adds r0, r5, 0 - bl sub_81C5B14 - b _081C5D16 - .pool -_081C5CA0: - movs r0, 0x5 - bl audio_play - ldr r2, =0x0203ce7c - mov r12, r2 - ldr r0, =0x03005d90 - ldr r2, [r0] - lsls r3, r6, 1 - ldr r0, =0x00000ca9 - adds r4, r2, r0 - ldrb r1, [r4] - lsls r1, 30 - lsrs r1, 30 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r3, r0 - ldr r1, =0x00000e2c - adds r0, r2, r1 - adds r0, r3 - ldrh r0, [r0] - mov r1, r12 - strh r0, [r1] - strh r6, [r7, 0x2] - ldrb r1, [r4] - lsls r1, 30 - lsrs r1, 30 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 1 - adds r0, r6, r0 - ldr r1, =0x00000e54 - adds r2, r1 - adds r2, r0 - ldrb r0, [r2] - strh r0, [r7, 0x4] - mov r0, r8 - subs r0, 0x8 - ldrb r0, [r0, 0x4] - cmp r0, 0x2 - bne _081C5D10 - adds r0, r5, 0 - bl sub_81C674C - b _081C5D16 - .pool -_081C5D10: - adds r0, r5, 0 - bl sub_81C5D20 -_081C5D16: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81C5BC8 - - thumb_func_start sub_81C5D20 -sub_81C5D20: @ 81C5D20 - push {r4,r5,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =0x03005e08 - adds r4, r0 - bl sub_81C56CC - ldrb r0, [r4] - movs r1, 0x1 - bl sub_81C5A98 - ldr r0, =0x0203cf30 - ldrb r4, [r0, 0x4] - cmp r4, 0x1 - beq _081C5D74 - cmp r4, 0x3 - beq _081C5DC4 - ldr r0, =0x0203cf2c - ldr r1, [r0] - ldr r0, =0x00000818 - adds r2, r1, r0 - ldr r0, =gUnknown_0861F308 - str r0, [r2] - movs r0, 0x82 - lsls r0, 4 - adds r1, r0 - movs r0, 0x4 - b _081C5DD8 - .pool -_081C5D74: - ldr r0, =0x0203ce7c - ldrh r0, [r0] - bl itemid_get_usage - lsls r0, 24 - cmp r0, 0 - beq _081C5DA0 - ldr r0, =0x0203cf2c - ldr r1, [r0] - ldr r0, =0x00000818 - adds r2, r1, r0 - ldr r0, =gUnknown_0861F30E - b _081C5DCE - .pool -_081C5DA0: - ldr r0, =0x0203cf2c - ldr r0, [r0] - ldr r1, =0x00000818 - adds r2, r0, r1 - ldr r1, =gUnknown_0861F310 - str r1, [r2] - movs r1, 0x82 - lsls r1, 4 - adds r0, r1 - strb r4, [r0] - b _081C5DDA - .pool -_081C5DC4: - ldr r0, =0x0203cf2c - ldr r1, [r0] - ldr r0, =0x00000818 - adds r2, r1, r0 - ldr r0, =gUnknown_0861F30C -_081C5DCE: - str r0, [r2] - movs r0, 0x82 - lsls r0, 4 - adds r1, r0 - movs r0, 0x2 -_081C5DD8: - strb r0, [r1] -_081C5DDA: - ldr r0, =0x0203ce7c - ldrh r0, [r0] - ldr r1, =0x02021cc4 - bl itemid_get_name - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E8DBE - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r1, 0 - str r1, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - str r1, [sp, 0x8] - str r1, [sp, 0xC] - adds r1, r4, 0 - movs r2, 0x3 - movs r3, 0 - bl sub_81C6C3C - ldr r0, =0x0203cf2c - ldr r0, [r0] - movs r1, 0x82 - lsls r1, 4 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081C5E3C - movs r0, 0 - b _081C5E42 - .pool -_081C5E3C: - cmp r0, 0x2 - bne _081C5E50 - movs r0, 0x1 -_081C5E42: - bl sub_81C6D24 - lsls r0, 24 - lsrs r0, 24 - bl sub_81C5EAC - b _081C5E62 -_081C5E50: - movs r0, 0x2 - bl sub_81C6D24 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - movs r2, 0x2 - bl sub_81C5F08 -_081C5E62: - ldr r0, =0x0203cf2c - ldr r0, [r0] - movs r1, 0x82 - lsls r1, 4 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x4 - bne _081C5E8C - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81C5FE4 - b _081C5E98 - .pool -_081C5E8C: - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81C5F68 -_081C5E98: - str r0, [r1] - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C5D20 - - thumb_func_start sub_81C5EAC -sub_81C5EAC: @ 81C5EAC - push {r4-r6,lr} - sub sp, 0x14 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - str r0, [sp] - movs r0, 0x10 - str r0, [sp, 0x4] - ldr r6, =0x0203cf2c - ldr r1, [r6] - movs r5, 0x82 - lsls r5, 4 - adds r0, r1, r5 - ldrb r0, [r0] - str r0, [sp, 0x8] - ldr r0, =gUnknown_0861F2D8 - str r0, [sp, 0xC] - ldr r0, =0x00000818 - adds r1, r0 - ldr r0, [r1] - str r0, [sp, 0x10] - adds r0, r4, 0 - movs r1, 0x7 - movs r2, 0x8 - movs r3, 0x1 - bl AddItemMenuActionTextPrinters - ldr r0, [r6] - adds r0, r5 - ldrb r1, [r0] - adds r0, r4, 0 - movs r2, 0 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C5EAC - - thumb_func_start sub_81C5F08 -sub_81C5F08: @ 81C5F08 - push {r4-r6,lr} - sub sp, 0x14 - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - movs r0, 0x38 - str r0, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - ldr r0, =gUnknown_0861F2D8 - str r0, [sp, 0xC] - ldr r0, =0x0203cf2c - ldr r0, [r0] - ldr r1, =0x00000818 - adds r0, r1 - ldr r0, [r0] - str r0, [sp, 0x10] - adds r0, r4, 0 - movs r1, 0x7 - movs r2, 0x8 - movs r3, 0x1 - bl sub_8198DBC - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r1, 0x38 - adds r2, r5, 0 - adds r3, r6, 0 - bl sub_8199944 - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C5F08 - - thumb_func_start sub_81C5F68 -sub_81C5F68: @ 81C5F68 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C5FD0 - bl ProcessMenuInputNoWrapAround - lsls r0, 24 - asrs r4, r0, 24 - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - beq _081C5FD0 - adds r0, 0x1 - cmp r4, r0 - bne _081C5FA8 - movs r0, 0x5 - bl audio_play - ldr r0, =gUnknown_0861F2D8 - ldr r1, [r0, 0x1C] - adds r0, r5, 0 - bl _call_via_r1 - b _081C5FD0 - .pool -_081C5FA8: - movs r0, 0x5 - bl audio_play - ldr r1, =gUnknown_0861F2D8 - ldr r0, =0x0203cf2c - ldr r0, [r0] - ldr r2, =0x00000818 - adds r0, r2 - ldr r0, [r0] - adds r0, r4 - ldrb r0, [r0] - lsls r0, 3 - adds r1, 0x4 - adds r0, r1 - ldr r1, [r0] - cmp r1, 0 - beq _081C5FD0 - adds r0, r6, 0 - bl _call_via_r1 -_081C5FD0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C5F68 - - thumb_func_start sub_81C5FE4 -sub_81C5FE4: @ 81C5FE4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C5FF8 - b _081C6160 -_081C5FF8: - bl GetMenuCursorPos - lsls r0, 24 - lsrs r4, r0, 24 - ldr r5, =0x030022c0 - ldrh r1, [r5, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081C6040 - lsls r0, r4, 24 - asrs r0, 24 - cmp r0, 0 - bgt _081C6016 - b _081C6160 -_081C6016: - subs r0, 0x2 - lsls r0, 24 - asrs r0, 24 - bl sub_81C616C - lsls r0, 24 - cmp r0, 0 - bne _081C6028 - b _081C6160 -_081C6028: - movs r0, 0x5 - bl audio_play - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - bl sub_8199134 - b _081C6160 - .pool -_081C6040: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081C6084 - lsls r0, r4, 24 - asrs r1, r0, 24 - ldr r0, =0x0203cf2c - ldr r0, [r0] - movs r2, 0x82 - lsls r2, 4 - adds r0, r2 - ldrb r0, [r0] - subs r0, 0x2 - cmp r1, r0 - blt _081C6060 - b _081C6160 -_081C6060: - adds r0, r1, 0x2 - lsls r0, 24 - asrs r0, 24 - bl sub_81C616C - lsls r0, 24 - cmp r0, 0 - beq _081C6160 - movs r0, 0x5 - bl audio_play - movs r0, 0 - movs r1, 0x1 - bl sub_8199134 - b _081C6160 - .pool -_081C6084: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _081C6098 - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C60C0 -_081C6098: - lsls r0, r4, 24 - asrs r1, r0, 24 - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081C6160 - subs r0, r1, 0x1 - lsls r0, 24 - asrs r0, 24 - bl sub_81C616C - lsls r0, 24 - cmp r0, 0 - beq _081C6160 - movs r0, 0x5 - bl audio_play - movs r0, 0x1 - negs r0, r0 - b _081C60FA -_081C60C0: - ldrh r1, [r5, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _081C60D6 - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _081C6102 -_081C60D6: - lsls r0, r4, 24 - asrs r1, r0, 24 - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081C6160 - adds r0, r1, 0x1 - lsls r0, 24 - asrs r0, 24 - bl sub_81C616C - lsls r0, 24 - cmp r0, 0 - beq _081C6160 - movs r0, 0x5 - bl audio_play - movs r0, 0x1 -_081C60FA: - movs r1, 0 - bl sub_8199134 - b _081C6160 -_081C6102: - ldrh r1, [r5, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081C6148 - movs r0, 0x5 - bl audio_play - ldr r2, =gUnknown_0861F2D8 - ldr r0, =0x0203cf2c - ldr r0, [r0] - lsls r1, r4, 24 - asrs r1, 24 - ldr r3, =0x00000818 - adds r0, r3 - ldr r0, [r0] - adds r0, r1 - ldrb r0, [r0] - lsls r0, 3 - adds r2, 0x4 - adds r0, r2 - ldr r1, [r0] - cmp r1, 0 - beq _081C6160 - adds r0, r6, 0 - bl _call_via_r1 - b _081C6160 - .pool -_081C6148: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081C6160 - movs r0, 0x5 - bl audio_play - ldr r0, =gUnknown_0861F2D8 - ldr r1, [r0, 0x1C] - adds r0, r6, 0 - bl _call_via_r1 -_081C6160: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C5FE4 - - thumb_func_start sub_81C616C -sub_81C616C: @ 81C616C - push {lr} - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - blt _081C61A0 - ldr r0, =0x0203cf2c - ldr r2, [r0] - movs r3, 0x82 - lsls r3, 4 - adds r0, r2, r3 - ldrb r0, [r0] - cmp r1, r0 - bgt _081C61A0 - ldr r3, =0x00000818 - adds r0, r2, r3 - ldr r0, [r0] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x5 - beq _081C61A0 - movs r0, 0x1 - b _081C61A2 - .pool -_081C61A0: - movs r0, 0 -_081C61A2: - pop {r1} - bx r1 - thumb_func_end sub_81C616C - - thumb_func_start sub_81C61A8 -sub_81C61A8: @ 81C61A8 - push {lr} - ldr r0, =0x0203cf2c - ldr r0, [r0] - movs r1, 0x82 - lsls r1, 4 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081C61C8 - movs r0, 0 - bl sub_81C6D6C - b _081C61DA - .pool -_081C61C8: - cmp r0, 0x2 - bne _081C61D4 - movs r0, 0x1 - bl sub_81C6D6C - b _081C61DA -_081C61D4: - movs r0, 0x2 - bl sub_81C6D6C -_081C61DA: - pop {r0} - bx r0 - thumb_func_end sub_81C61A8 - - thumb_func_start sub_81C61E0 -sub_81C61E0: @ 81C61E0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =0x0203ce7c - ldrh r0, [r4] - bl itemid_get_pocket_number - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - beq _081C620C - cmp r0, 0x2 - beq _081C620C - cmp r0, 0x3 - beq _081C620C - ldrh r0, [r4] - bl itemid_is_mail - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C6228 -_081C620C: - bl sub_81C61A8 - ldr r1, =gUnknown_085E8F31 - ldr r2, =sub_81C6714 - adds r0, r5, 0 - bl DisplayItemMessageInBattlePyramid - b _081C6252 - .pool -_081C6228: - ldrh r0, [r4] - bl itemid_get_overworld_function - cmp r0, 0 - beq _081C6252 - bl sub_81C61A8 - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldrh r0, [r4] - bl itemid_get_overworld_function - adds r1, r0, 0 - adds r0, r5, 0 - bl _call_via_r1 -_081C6252: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81C61E0 - - thumb_func_start sub_81C6258 -sub_81C6258: @ 81C6258 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =0x03005e08 - adds r4, r0 - bl sub_81C61A8 - movs r1, 0x2 - ldrsh r0, [r4, r1] - bl sub_81C55D8 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - ldrb r0, [r4] - movs r1, 0 - bl sub_81C5A98 - adds r0, r5, 0 - bl sub_81C629C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6258 - - thumb_func_start sub_81C629C -sub_81C629C: @ 81C629C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_81C5674 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81C5BC8 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C629C - - thumb_func_start sub_81C62C4 -sub_81C62C4: @ 81C62C4 - push {r4-r7,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r6, r0, 3 - ldr r7, =0x03005e08 - adds r4, r6, r7 - bl sub_81C61A8 - movs r0, 0x1 - strh r0, [r4, 0x10] - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _081C62F4 - adds r0, r5, 0 - bl sub_81C6350 - b _081C6334 - .pool -_081C62F4: - ldr r0, =0x0203ce7c - ldrh r0, [r0] - ldr r1, =0x02021cc4 - bl itemid_get_name - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E8EE0 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r1, 0 - str r1, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - str r1, [sp, 0x8] - str r1, [sp, 0xC] - adds r1, r4, 0 - movs r2, 0x3 - movs r3, 0 - bl sub_81C6C3C - bl sub_81C6404 - adds r0, r7, 0 - subs r0, 0x8 - adds r0, r6, r0 - ldr r1, =sub_81C64B4 - str r1, [r0] -_081C6334: - add sp, 0x10 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C62C4 - - thumb_func_start sub_81C6350 -sub_81C6350: @ 81C6350 - push {r4,r5,lr} - sub sp, 0x10 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =0x03005e08 - adds r4, r0 - ldr r0, =0x0203ce7c - ldrh r0, [r0] - ldr r1, =0x02021cc4 - bl itemid_get_name - ldr r0, =0x02021dc4 - movs r2, 0x10 - ldrsh r1, [r4, r2] - movs r2, 0 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E8F0E - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r1, 0 - str r1, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - str r1, [sp, 0x8] - str r1, [sp, 0xC] - adds r1, r4, 0 - movs r2, 0x3 - movs r3, 0 - bl sub_81C6C3C - ldr r1, =gUnknown_0861F314 - adds r0, r5, 0 - bl sub_81C6DAC - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6350 - - thumb_func_start sub_81C63D0 -sub_81C63D0: @ 81C63D0 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =0x03005e08 - adds r4, r0 - movs r1, 0x2 - ldrsh r0, [r4, r1] - bl sub_81C55D8 - ldrb r0, [r4] - movs r1, 0 - bl sub_81C5A98 - adds r0, r5, 0 - bl sub_81C629C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C63D0 - - thumb_func_start sub_81C6404 -sub_81C6404: @ 81C6404 - push {r4,lr} - sub sp, 0xC - ldr r0, =0x02021cc4 - movs r1, 0x1 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E8DA0 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0x3 - bl sub_81C6CEC - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x28 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x2 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - adds r2, r4, 0 - bl Print - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6404 - - thumb_func_start sub_81C645C -sub_81C645C: @ 81C645C - push {r4,lr} - sub sp, 0xC - adds r1, r0, 0 - ldr r0, =0x02021cc4 - lsls r1, 16 - asrs r1, 16 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E8DA0 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x28 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x2 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - adds r2, r4, 0 - bl Print - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C645C - - thumb_func_start sub_81C64B4 -sub_81C64B4: @ 81C64B4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - adds r0, r4, 0 - adds r0, 0x10 - ldrh r1, [r4, 0x4] - bl AdjustQuantityAccordingToDPadInput - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C64E8 - movs r1, 0x10 - ldrsh r0, [r4, r1] - bl sub_81C645C - b _081C6544 - .pool -_081C64E8: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081C651C - movs r0, 0x5 - bl audio_play - movs r0, 0x3 - movs r1, 0 - bl sub_8198070 - movs r0, 0x3 - bl ClearWindowTilemap - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - adds r0, r5, 0 - bl sub_81C6350 - b _081C6544 - .pool -_081C651C: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081C6544 - movs r0, 0x5 - bl audio_play - movs r0, 0x3 - movs r1, 0 - bl sub_8198070 - movs r0, 0x3 - bl ClearWindowTilemap - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - adds r0, r6, 0 - bl sub_81C63D0 -_081C6544: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81C64B4 - - thumb_func_start sub_81C654C -sub_81C654C: @ 81C654C - push {r4-r6,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r5, =0x03005e08 - adds r6, r4, r5 - ldr r0, =0x0203ce7c - ldrh r0, [r0] - ldr r1, =0x02021cc4 - bl itemid_get_name - ldr r0, =0x02021dc4 - movs r2, 0x10 - ldrsh r1, [r6, r2] - movs r2, 0 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r6, =0x02021fc4 - ldr r1, =gUnknown_085E8EF9 - adds r0, r6, 0 - bl ExpandStringRefs - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r1, 0 - str r1, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - str r1, [sp, 0x8] - str r1, [sp, 0xC] - adds r1, r6, 0 - movs r2, 0x3 - movs r3, 0 - bl sub_81C6C3C - subs r5, 0x8 - adds r4, r5 - ldr r0, =sub_81C65CC - str r0, [r4] - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C654C - - thumb_func_start sub_81C65CC -sub_81C65CC: @ 81C65CC - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - ldr r6, =0x0203cf38 - subs r7, r6, 0x2 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _081C662E - movs r0, 0x5 - bl audio_play - ldr r0, =0x0203ce7c - ldrh r0, [r0] - ldrh r1, [r4, 0x10] - bl sub_80D7334 - ldrb r0, [r4] - adds r1, r6, 0 - adds r2, r7, 0 - bl sub_81AE6C8 - bl sub_81C5924 - bl sub_81C59BC - bl sub_81C5314 - ldr r0, =0x03006310 - ldrh r1, [r6] - ldrh r2, [r7] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - adds r0, r5, 0 - bl sub_81C629C -_081C662E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C65CC - - thumb_func_start sub_81C6648 -sub_81C6648: @ 81C6648 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - bl sub_81C61A8 - ldr r5, =0x0203ce7c - ldrh r0, [r5] - bl itemid_is_mail - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C667C - ldr r1, =gUnknown_085E8DCE - ldr r2, =sub_81C66EC - adds r0, r4, 0 - bl DisplayItemMessageInBattlePyramid - b _081C66A6 - .pool -_081C667C: - ldrh r0, [r5] - bl itemid_is_unique - lsls r0, 24 - cmp r0, 0 - bne _081C66A0 - ldr r0, =0x0203cf2c - ldr r1, [r0] - ldr r0, =sub_81B7F60 - str r0, [r1] - adds r0, r4, 0 - bl sub_81C5B14 - b _081C66A6 - .pool -_081C66A0: - adds r0, r6, 0 - bl sub_81C66AC -_081C66A6: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81C6648 - - thumb_func_start sub_81C66AC -sub_81C66AC: @ 81C66AC - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x0203ce7c - ldrh r0, [r0] - ldr r1, =0x02021cc4 - bl itemid_get_name - ldr r5, =0x02021fc4 - ldr r1, =gUnknown_085E8E11 - adds r0, r5, 0 - bl ExpandStringRefs - ldr r2, =sub_81C66EC - adds r0, r4, 0 - adds r1, r5, 0 - bl DisplayItemMessageInBattlePyramid - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C66AC - - thumb_func_start sub_81C66EC -sub_81C66EC: @ 81C66EC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081C670A - movs r0, 0x5 - bl audio_play - adds r0, r4, 0 - bl sub_81C6714 -_081C670A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C66EC - - thumb_func_start sub_81C6714 -sub_81C6714: @ 81C6714 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =0x03005e08 - adds r4, r0 - bl sub_81C6E1C - movs r1, 0x2 - ldrsh r0, [r4, r1] - bl sub_81C55D8 - ldrb r0, [r4] - movs r1, 0 - bl sub_81C5A98 - adds r0, r5, 0 - bl sub_81C629C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6714 - - thumb_func_start sub_81C674C -sub_81C674C: @ 81C674C - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - ldr r5, =0x0203ce7c - ldrh r0, [r5] - bl itemid_80BF6D8_mail_related - lsls r0, 24 - cmp r0, 0 - bne _081C677C - ldr r1, =gUnknown_085E8DCE - ldr r2, =sub_81C66EC - adds r0, r4, 0 - bl DisplayItemMessageInBattlePyramid - b _081C6796 - .pool -_081C677C: - ldrh r0, [r5] - bl itemid_is_unique - lsls r0, 24 - cmp r0, 0 - bne _081C6790 - adds r0, r4, 0 - bl sub_81C5B14 - b _081C6796 -_081C6790: - adds r0, r6, 0 - bl sub_81C66AC -_081C6796: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81C674C - - thumb_func_start sub_81C679C -sub_81C679C: @ 81C679C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =0x0203ce7c - ldrh r0, [r4] - bl itemid_get_battle_function - cmp r0, 0 - beq _081C67C0 - bl sub_81C61A8 - ldrh r0, [r4] - bl itemid_get_battle_function - adds r1, r0, 0 - adds r0, r5, 0 - bl _call_via_r1 -_081C67C0: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C679C - - thumb_func_start sub_81C67CC -sub_81C67CC: @ 81C67CC - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =0x03005e08 - mov r9, r0 - adds r5, r4, r0 - ldr r0, =0x0203cf30 - ldrh r1, [r0, 0x6] - ldrh r0, [r0, 0x8] - adds r1, r0 - strh r1, [r5, 0x2] - ldr r0, =0x0203cf2c - ldr r0, [r0] - ldr r2, =0x00000814 - adds r0, r2 - movs r2, 0 - mov r8, r2 - strb r1, [r0] - ldrb r0, [r5] - movs r1, 0x10 - movs r2, 0x1 - bl sub_81AF15C - ldr r0, =0x03005d90 - ldr r3, [r0] - movs r0, 0x2 - ldrsh r2, [r5, r0] - lsls r2, 1 - ldr r1, =0x00000ca9 - adds r0, r3, r1 - ldrb r1, [r0] - lsls r1, 30 - lsrs r1, 30 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, r0 - ldr r0, =0x00000e2c - adds r3, r0 - adds r3, r2 - ldrh r0, [r3] - ldr r1, =0x02021cc4 - bl itemid_get_name - ldr r6, =0x02021fc4 - ldr r1, =gUnknown_085E8DFE - adds r0, r6, 0 - bl ExpandStringRefs - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - mov r1, r8 - str r1, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - str r1, [sp, 0x8] - str r1, [sp, 0xC] - adds r1, r6, 0 - movs r2, 0x3 - movs r3, 0 - bl sub_81C6C3C - ldrb r0, [r5] - movs r1, 0x1 - bl sub_81C5A98 - ldrb r0, [r5, 0x2] - bl sub_81C704C - movs r2, 0x8 - negs r2, r2 - add r9, r2 - add r4, r9 - ldr r0, =sub_81C68B0 - str r0, [r4] - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C67CC - - thumb_func_start sub_81C68B0 -sub_81C68B0: @ 81C68B0 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C695C - ldr r7, =0x030022c0 - ldrh r1, [r7, 0x2E] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _081C68F8 - movs r0, 0x5 - bl audio_play - ldrb r0, [r4] - ldr r1, =0x0203cf38 - subs r2, r1, 0x2 - bl get_coro_args_x18_x1A - b _081C6940 - .pool -_081C68F8: - ldrb r0, [r4] - bl ListMenuHandleInput - adds r6, r0, 0 - ldrb r0, [r4] - ldr r4, =0x0203cf38 - subs r2, r4, 0x2 - adds r1, r4, 0 - bl get_coro_args_x18_x1A - movs r0, 0 - bl sub_81C7028 - subs r4, 0x8 - ldrb r0, [r4, 0x6] - bl sub_81C704C - movs r0, 0x2 - negs r0, r0 - cmp r6, r0 - beq _081C6930 - adds r0, 0x1 - cmp r6, r0 - bne _081C6950 - b _081C695C - .pool -_081C6930: - movs r0, 0x5 - bl audio_play - ldrh r1, [r7, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081C6948 -_081C6940: - adds r0, r5, 0 - bl sub_81C6964 - b _081C695C -_081C6948: - adds r0, r5, 0 - bl sub_81C6A14 - b _081C695C -_081C6950: - movs r0, 0x5 - bl audio_play - adds r0, r5, 0 - bl sub_81C6964 -_081C695C: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81C68B0 - - thumb_func_start sub_81C6964 -sub_81C6964: @ 81C6964 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r5, r0, r1 - ldr r7, =0x0203cf38 - subs r0, r7, 0x2 - mov r8, r0 - ldrh r0, [r0] - ldrh r1, [r7] - adds r0, r1 - lsls r0, 16 - lsrs r4, r0, 16 - movs r3, 0x2 - ldrsh r1, [r5, r3] - cmp r1, r4 - beq _081C6996 - subs r0, r4, 0x1 - cmp r1, r0 - bne _081C69A8 -_081C6996: - adds r0, r6, 0 - bl sub_81C6A14 - b _081C69FC - .pool -_081C69A8: - ldrb r0, [r5, 0x2] - lsls r1, r4, 24 - lsrs r1, 24 - bl sub_81C57A8 - ldr r0, =0x0203cf2c - ldr r0, [r0] - ldr r1, =0x00000814 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - movs r0, 0x1 - bl sub_81C7028 - ldrb r0, [r5] - adds r1, r7, 0 - mov r2, r8 - bl sub_81AE6C8 - movs r3, 0x2 - ldrsh r0, [r5, r3] - cmp r0, r4 - bge _081C69E0 - adds r1, r7, 0 - subs r1, 0x8 - ldrh r0, [r1, 0x6] - subs r0, 0x1 - strh r0, [r1, 0x6] -_081C69E0: - bl sub_81C5314 - ldr r0, =0x03006310 - ldrh r1, [r7] - mov r3, r8 - ldrh r2, [r3] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5] - adds r0, r6, 0 - bl sub_81C629C -_081C69FC: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6964 - - thumb_func_start sub_81C6A14 -sub_81C6A14: @ 81C6A14 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - ldr r5, =0x0203cf38 - subs r7, r5, 0x2 - ldr r0, =0x0203cf2c - ldr r0, [r0] - ldr r1, =0x00000814 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - movs r0, 0x1 - bl sub_81C7028 - ldrb r0, [r4] - adds r1, r5, 0 - adds r2, r7, 0 - bl sub_81AE6C8 - movs r0, 0x2 - ldrsh r2, [r4, r0] - ldrh r0, [r5] - ldrh r1, [r7] - adds r0, r1 - cmp r2, r0 - bge _081C6A5E - adds r1, r5, 0 - subs r1, 0x8 - ldrh r0, [r1, 0x6] - subs r0, 0x1 - strh r0, [r1, 0x6] -_081C6A5E: - bl sub_81C5314 - ldr r0, =0x03006310 - ldrh r1, [r5] - ldrh r2, [r7] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - adds r0, r6, 0 - bl sub_81C629C - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6A14 - - thumb_func_start sub_81C6A94 -sub_81C6A94: @ 81C6A94 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - ldr r0, =0x020244ec - mov r9, r0 - movs r0, 0x14 - bl Alloc - adds r7, r0, 0 - movs r0, 0xA - bl Alloc - adds r5, r0, 0 - ldr r1, =0x03005d90 - mov r8, r1 - ldr r2, [r1] - ldr r4, =0x00000ca9 - adds r0, r2, r4 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldr r0, =0x00000e2c - adds r1, r0 - adds r0, r7, 0 - movs r2, 0x14 - bl memcpy - mov r1, r8 - ldr r2, [r1] - adds r0, r2, r4 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 1 - adds r1, r2 - ldr r0, =0x00000e54 - adds r1, r0 - adds r0, r5, 0 - movs r2, 0xA - bl memcpy - movs r6, 0 -_081C6AF8: - movs r0, 0x64 - muls r0, r6 - add r0, r9 - movs r1, 0xC - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - mov r1, sp - strh r0, [r1] - cmp r0, 0 - beq _081C6B88 - movs r1, 0x1 - bl bag_add_item - lsls r0, 24 - cmp r0, 0 - bne _081C6B88 - mov r1, r8 - ldr r2, [r1] - adds r0, r2, r4 - ldrb r1, [r0] - lsls r1, 30 - lsrs r1, 30 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x00000e2c - adds r0, r1 - adds r1, r7, 0 - movs r2, 0x14 - bl memcpy - mov r0, r8 - ldr r2, [r0] - adds r0, r2, r4 - ldrb r1, [r0] - lsls r1, 30 - lsrs r1, 30 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 1 - adds r0, r2 - ldr r1, =0x00000e54 - adds r0, r1 - adds r1, r5, 0 - movs r2, 0xA - bl memcpy - adds r0, r7, 0 - bl Free - adds r0, r5, 0 - bl Free - ldr r1, =0x020375f0 - movs r0, 0x1 - strh r0, [r1] - b _081C6BC6 - .pool -_081C6B88: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x2 - bls _081C6AF8 - movs r1, 0 - mov r0, sp - strh r1, [r0] - movs r6, 0 - movs r4, 0x64 -_081C6B9C: - adds r0, r6, 0 - muls r0, r4 - add r0, r9 - movs r1, 0xC - mov r2, sp - bl pokemon_setattr - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x2 - bls _081C6B9C - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - adds r0, r7, 0 - bl Free - adds r0, r5, 0 - bl Free -_081C6BC6: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6A94 - - thumb_func_start sub_81C6BD8 -sub_81C6BD8: @ 81C6BD8 - push {r4,lr} - ldr r0, =gUnknown_0861F328 - bl InitWindows - bl DeactivateAllTextPrinters - movs r0, 0 - movs r1, 0x1 - movs r2, 0xE0 - bl sub_809882C - movs r0, 0 - movs r1, 0xA - movs r2, 0xD0 - bl copy_textbox_border_tile_patterns_to_vram - ldr r0, =gUnknown_0860F074 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - movs r4, 0 -_081C6C04: - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x4 - bls _081C6C04 - movs r0, 0 - bl PutWindowTilemap - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6BD8 - - thumb_func_start sub_81C6C3C -sub_81C6C3C: @ 81C6C3C - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x14 - ldr r4, [sp, 0x28] - ldr r6, [sp, 0x2C] - ldr r5, [sp, 0x30] - mov r8, r5 - ldr r5, [sp, 0x34] - lsls r0, 24 - lsrs r0, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r5, 24 - lsrs r5, 24 - str r4, [sp] - str r6, [sp, 0x4] - lsls r4, r5, 1 - adds r4, r5 - ldr r5, =gUnknown_0861F31C - adds r4, r5 - str r4, [sp, 0x8] - mov r4, r8 - lsls r4, 24 - asrs r4, 24 - str r4, [sp, 0xC] - str r1, [sp, 0x10] - movs r1, 0x1 - bl AddTextPrinterParametrized2 - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6C3C - - thumb_func_start sub_81C6C94 -sub_81C6C94: @ 81C6C94 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x14 - ldr r4, [sp, 0x28] - ldr r6, [sp, 0x2C] - ldr r5, [sp, 0x30] - mov r8, r5 - ldr r5, [sp, 0x34] - lsls r0, 24 - lsrs r0, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r5, 24 - lsrs r5, 24 - str r4, [sp] - str r6, [sp, 0x4] - lsls r4, r5, 1 - adds r4, r5 - ldr r5, =gUnknown_0861F31C - adds r4, r5 - str r4, [sp, 0x8] - mov r4, r8 - lsls r4, 24 - asrs r4, 24 - str r4, [sp, 0xC] - str r1, [sp, 0x10] - movs r1, 0x7 - bl AddTextPrinterParametrized2 - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6C94 - - thumb_func_start sub_81C6CEC -sub_81C6CEC: @ 81C6CEC - push {lr} - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - movs r2, 0x1 - movs r3, 0xE - bl SetWindowBorderStyle - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - pop {r0} - bx r0 - thumb_func_end sub_81C6CEC - - thumb_func_start sub_81C6D08 -sub_81C6D08: @ 81C6D08 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0203cf2c - ldr r1, [r1] - ldr r2, =0x0000080f - adds r1, r2 - adds r1, r0 - ldrb r0, [r1] - bx lr - .pool - thumb_func_end sub_81C6D08 - - thumb_func_start sub_81C6D24 -sub_81C6D24: @ 81C6D24 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x0203cf2c - ldr r3, =0x0000080f - adds r1, r2, r3 - ldr r0, [r0] - adds r4, r0, r1 - ldrb r0, [r4] - cmp r0, 0xFF - bne _081C6D58 - lsls r0, r2, 3 - ldr r1, =gUnknown_0861F350 - adds r0, r1 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - movs r2, 0x1 - movs r3, 0xE - bl SetWindowBorderStyle - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram -_081C6D58: - ldrb r0, [r4] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81C6D24 - - thumb_func_start sub_81C6D6C -sub_81C6D6C: @ 81C6D6C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0203cf2c - ldr r2, =0x0000080f - adds r0, r2 - ldr r1, [r1] - adds r4, r1, r0 - ldrb r0, [r4] - cmp r0, 0xFF - beq _081C6D9E - movs r1, 0 - bl sub_8198070 - ldrb r0, [r4] - bl ClearWindowTilemap - ldrb r0, [r4] - bl RemoveWindow - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0xFF - strb r0, [r4] -_081C6D9E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6D6C - - thumb_func_start sub_81C6DAC -sub_81C6DAC: @ 81C6DAC - push {lr} - sub sp, 0x10 - adds r3, r1, 0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0861F370 - movs r2, 0x2 - str r2, [sp] - movs r2, 0x1 - str r2, [sp, 0x4] - movs r2, 0xE - str r2, [sp, 0x8] - str r3, [sp, 0xC] - movs r2, 0x1 - movs r3, 0 - bl CreateYesNoMenuWithCallbacks - add sp, 0x10 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6DAC - - thumb_func_start DisplayItemMessageInBattlePyramid -@ void DisplayItemMessageInBattlePyramid(u8 taskId, u8 *str, void ( *callback)(u8 taskId)) -DisplayItemMessageInBattlePyramid: @ 81C6DD8 - push {r4-r6,lr} - sub sp, 0x10 - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x2 - movs r1, 0x11 - bl FillWindowPixelBuffer - bl sav2_get_text_speed - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - str r1, [sp] - str r0, [sp, 0x4] - str r5, [sp, 0x8] - str r6, [sp, 0xC] - adds r0, r4, 0 - movs r1, 0x2 - movs r2, 0xA - movs r3, 0xD - bl DisplayMessageAndContinueTask - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end DisplayItemMessageInBattlePyramid - - thumb_func_start sub_81C6E1C -sub_81C6E1C: @ 81C6E1C - push {lr} - movs r0, 0x2 - movs r1, 0 - bl sub_8197DF8 - movs r0, 0x2 - bl ClearWindowTilemap - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - pop {r0} - bx r0 - thumb_func_end sub_81C6E1C - - thumb_func_start sub_81C6E38 -sub_81C6E38: @ 81C6E38 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x0203cf2c - ldr r2, =0x00000804 - adds r1, r4, r2 - ldr r0, [r0] - adds r5, r0, r1 - ldrb r0, [r5] - cmp r0, 0xFF - beq _081C6E80 - ldr r0, =0x00001024 - adds r4, r0 - adds r0, r4, 0 - bl FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - ldrb r1, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl obj_free_rotscale_entry - ldrb r1, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - movs r0, 0xFF - strb r0, [r5] -_081C6E80: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6E38 - - thumb_func_start sub_81C6E98 -sub_81C6E98: @ 81C6E98 - push {r4,lr} - sub sp, 0x8 - movs r0, 0x40 - bl Alloc - adds r4, r0, 0 - ldr r0, =gUnknown_08D9ADD0 - adds r1, r4, 0 - bl LZDecompressWram - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 25 - adds r0, r4, r0 - str r0, [sp] - ldr r1, =0xffff0000 - ldr r0, [sp, 0x4] - ands r0, r1 - ldr r1, =0x00001024 - orrs r0, r1 - str r0, [sp, 0x4] - mov r0, sp - bl LoadTaggedObjectPalette - adds r0, r4, 0 - bl Free - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6E98 - - thumb_func_start sub_81C6EF4 -sub_81C6EF4: @ 81C6EF4 - push {r4,lr} - ldr r0, =0x0203cf2c - ldr r4, [r0] - ldr r0, =0x00000804 - adds r4, r0 - ldr r0, =gUnknown_0861F3D4 - movs r1, 0x44 - movs r2, 0x38 - movs r3, 0 - bl AddObjectToFront - strb r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6EF4 - - thumb_func_start sub_81C6F20 -sub_81C6F20: @ 81C6F20 - push {r4,lr} - ldr r0, =0x0203cf2c - ldr r0, [r0] - ldr r1, =0x00000804 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r4, r0, r1 - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _081C6F50 - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim - ldr r0, =sub_81C6F68 - str r0, [r4, 0x1C] -_081C6F50: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6F20 - - thumb_func_start sub_81C6F68 -sub_81C6F68: @ 81C6F68 - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _081C6F84 - adds r0, r4, 0 - movs r1, 0 - bl StartObjectRotScalAnim - ldr r0, =DummyObjectCallback - str r0, [r4, 0x1C] -_081C6F84: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6F68 - - thumb_func_start sub_81C6F90 -sub_81C6F90: @ 81C6F90 - push {r4-r6,lr} - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 24 - lsrs r4, r1, 24 - ldr r0, =0x0203cf2c - ldr r2, =0x00000805 - adds r1, r4, r2 - ldr r0, [r0] - adds r5, r0, r1 - ldrb r0, [r5] - cmp r0, 0xFF - bne _081C6FE0 - ldr r0, =0x00001025 - adds r4, r0 - adds r0, r4, 0 - bl FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - adds r0, r4, 0 - adds r1, r4, 0 - adds r2, r6, 0 - bl AddItemIconObject - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x40 - beq _081C6FE0 - strb r2, [r5] - ldr r1, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - movs r1, 0x18 - strh r1, [r0, 0x24] - movs r1, 0x58 - strh r1, [r0, 0x26] -_081C6FE0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C6F90 - - thumb_func_start sub_81C6FF8 -sub_81C6FF8: @ 81C6FF8 - push {lr} - lsls r0, 24 - movs r1, 0x80 - lsls r1, 17 - adds r0, r1 - lsrs r0, 24 - bl sub_81C6E38 - pop {r0} - bx r0 - thumb_func_end sub_81C6FF8 - - thumb_func_start sub_81C700C -sub_81C700C: @ 81C700C - push {lr} - ldr r0, =0x0203cf2c - ldr r0, [r0] - ldr r1, =0x00000807 - adds r0, r1 - movs r1, 0x8 - bl sub_8122344 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C700C - - thumb_func_start sub_81C7028 -sub_81C7028: @ 81C7028 - push {lr} - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =0x0203cf2c - ldr r0, [r0] - ldr r1, =0x00000807 - adds r0, r1 - movs r1, 0x8 - bl sub_81223FC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C7028 - - thumb_func_start sub_81C704C -sub_81C704C: @ 81C704C - push {lr} - adds r3, r0, 0 - lsls r3, 24 - ldr r0, =0x0203cf2c - ldr r0, [r0] - ldr r1, =0x00000807 - adds r0, r1 - lsrs r3, 4 - movs r1, 0x80 - lsls r1, 13 - adds r3, r1 - lsrs r3, 16 - movs r1, 0x88 - movs r2, 0x78 - bl sub_8122448 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C704C - - thumb_func_start sub_81C7078 -sub_81C7078: @ 81C7078 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - bl is_c1_link_related_active - cmp r0, 0 - bne _081C7090 - ldr r0, =sub_81C7170 - b _081C7092 - .pool -_081C7090: - ldr r0, =sub_81C71E4 -_081C7092: - lsls r1, r4, 24 - lsrs r1, 24 - bl AddTask - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - movs r1, 0x1 - adds r2, r5, 0 - bl set_word_task_arg - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r2, =0x0203cf3c - ldrb r1, [r2] - strh r1, [r0, 0xE] - ldrb r0, [r2] - adds r1, r0, 0x1 - strb r1, [r2] - lsls r0, 24 - lsrs r0, 8 - orrs r0, r4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81C7078 - - thumb_func_start sub_81C70D8 -sub_81C70D8: @ 81C70D8 - push {lr} - ldr r1, =0x0000ffff - ands r1, r0 - lsrs r3, r0, 16 - ldr r2, =0x03005e00 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r1, r0, r2 - ldrb r0, [r1, 0x4] - cmp r0, 0 - beq _081C711C - ldr r2, [r1] - ldr r0, =sub_81C7170 - cmp r2, r0 - beq _081C70FE - ldr r0, =sub_81C71E4 - cmp r2, r0 - bne _081C711C -_081C70FE: - movs r2, 0xE - ldrsh r0, [r1, r2] - cmp r0, r3 - bne _081C711C - movs r0, 0x1 - b _081C711E - .pool -_081C711C: - movs r0, 0 -_081C711E: - pop {r1} - bx r1 - thumb_func_end sub_81C70D8 - - thumb_func_start sub_81C7124 -sub_81C7124: @ 81C7124 - push {r4-r6,lr} - adds r6, r0, 0 - movs r5, 0 - ldr r4, =0x03005e00 -_081C712C: - ldrb r0, [r4, 0x4] - cmp r0, 0 - beq _081C7160 - ldr r1, [r4] - ldr r0, =sub_81C7170 - cmp r1, r0 - beq _081C7140 - ldr r0, =sub_81C71E4 - cmp r1, r0 - bne _081C7160 -_081C7140: - lsls r0, r5, 24 - lsrs r0, 24 - movs r1, 0x1 - bl get_word_task_arg - cmp r0, r6 - bne _081C7160 - movs r0, 0x1 - b _081C716A - .pool -_081C7160: - adds r4, 0x28 - adds r5, 0x1 - cmp r5, 0xF - ble _081C712C - movs r0, 0 -_081C716A: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81C7124 - - thumb_func_start sub_81C7170 -sub_81C7170: @ 81C7170 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r5, 0 - movs r1, 0x1 - bl get_word_task_arg - adds r6, r0, 0 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - movs r7, 0 -_081C718C: - movs r1, 0 - ldrsh r0, [r4, r1] - bl _call_via_r6 - cmp r0, 0x4 - bhi _081C71D6 - lsls r0, 2 - ldr r1, =_081C71AC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C71AC: - .4byte _081C71C6 - .4byte _081C71C0 - .4byte _081C71DE - .4byte _081C71DA - .4byte _081C71CE -_081C71C0: - ldrh r0, [r4] - adds r0, 0x1 - b _081C71D8 -_081C71C6: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - b _081C71DE -_081C71CE: - adds r0, r5, 0 - bl remove_task - b _081C71DE -_081C71D6: - subs r0, 0x5 -_081C71D8: - strh r0, [r4] -_081C71DA: - cmp r7, 0 - beq _081C718C -_081C71DE: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81C7170 - - thumb_func_start sub_81C71E4 -sub_81C71E4: @ 81C71E4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_8087598 - cmp r0, 0 - bne _081C724A - adds r0, r5, 0 - movs r1, 0x1 - bl get_word_task_arg - adds r2, r0, 0 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - movs r1, 0 - ldrsh r0, [r4, r1] - bl _call_via_r2 - cmp r0, 0x4 - bhi _081C7246 - lsls r0, 2 - ldr r1, =_081C7224 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C7224: - .4byte _081C7238 - .4byte _081C7238 - .4byte _081C724A - .4byte _081C724A - .4byte _081C723E -_081C7238: - ldrh r0, [r4] - adds r0, 0x1 - b _081C7248 -_081C723E: - adds r0, r5, 0 - bl remove_task - b _081C724A -_081C7246: - subs r0, 0x5 -_081C7248: - strh r0, [r4] -_081C724A: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81C71E4 - - thumb_func_start CB2_PokeNav -CB2_PokeNav: @ 81C7250 - push {r4,lr} - ldr r4, =0x0203cf40 - movs r0, 0x5C - bl Alloc - str r0, [r4] - cmp r0, 0 - bne _081C7270 - ldr r0, =sub_8086194 - bl SetMainCallback2 - b _081C7292 - .pool -_081C7270: - bl sub_81C7360 - bl clear_tasks - movs r0, 0 - bl SetVBlankCallback - ldr r0, =sub_81C742C - movs r1, 0 - bl AddTask - ldr r0, =sub_81C7400 - bl SetMainCallback2 - ldr r0, =sub_81C7418 - bl SetVBlankCallback -_081C7292: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end CB2_PokeNav - - thumb_func_start sub_81C72A4 -sub_81C72A4: @ 81C72A4 - push {lr} - ldr r0, =sub_81C72BC - bl SetMainCallback2 - movs r0, 0x1 - movs r1, 0 - bl fade_screen - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C72A4 - - thumb_func_start sub_81C72BC -sub_81C72BC: @ 81C72BC - push {r4,lr} - bl fade_and_return_progress_probably - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081C7320 - ldr r4, =0x0203cf40 - movs r0, 0x5C - bl Alloc - str r0, [r4] - cmp r0, 0 - bne _081C72F0 - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 - b _081C7320 - .pool -_081C72F0: - bl sub_81C7360 - ldr r1, [r4] - movs r0, 0x1 - strh r0, [r1, 0x8] - bl clear_tasks - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - movs r0, 0 - bl SetVBlankCallback - ldr r0, =sub_81C742C - movs r1, 0 - bl AddTask - ldr r0, =sub_81C7400 - bl SetMainCallback2 - ldr r0, =sub_81C7418 - bl SetVBlankCallback -_081C7320: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C72BC - - thumb_func_start sub_81C7334 -sub_81C7334: @ 81C7334 - push {r4,lr} - movs r4, 0 -_081C7338: - adds r0, r4, 0 - bl sub_81C7650 - adds r4, 0x1 - cmp r4, 0x12 - ble _081C7338 - ldr r4, =0x0203cf40 - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] - bl InitKeypadData - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C7334 - - thumb_func_start sub_81C7360 -sub_81C7360: @ 81C7360 - push {r4,r5,lr} - adds r5, r0, 0 - movs r2, 0 - movs r1, 0x12 - adds r0, 0x58 -_081C736A: - str r2, [r0] - subs r0, 0x4 - subs r1, 0x1 - cmp r1, 0 - bge _081C736A - movs r4, 0 - strh r4, [r5, 0x8] - str r4, [r5, 0x4] - bl sub_81C7388 - str r0, [r5, 0xC] - str r4, [r5] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81C7360 - - thumb_func_start sub_81C7388 -sub_81C7388: @ 81C7388 - push {r4-r6,lr} - movs r5, 0 -_081C738C: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x5 - bl pokemon_getattr - cmp r0, 0 - beq _081C73BA - adds r0, r4, 0 - movs r1, 0x6 - bl pokemon_getattr - cmp r0, 0 - bne _081C73BA - adds r0, r4, 0 - movs r1, 0x52 - bl pokemon_getattr - cmp r0, 0 - bne _081C73E2 -_081C73BA: - adds r5, 0x1 - cmp r5, 0x5 - ble _081C738C - movs r4, 0 -_081C73C2: - movs r5, 0 - lsls r6, r4, 24 -_081C73C6: - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80D2270 - cmp r0, 0 - beq _081C73EC - lsls r1, r5, 24 - lsrs r1, 24 - lsrs r0, r6, 24 - movs r2, 0x52 - bl get_pokemon_data_from_any_box - cmp r0, 0 - beq _081C73EC -_081C73E2: - movs r0, 0x1 - b _081C73FA - .pool -_081C73EC: - adds r5, 0x1 - cmp r5, 0x1D - ble _081C73C6 - adds r4, 0x1 - cmp r4, 0xD - ble _081C73C2 - movs r0, 0 -_081C73FA: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81C7388 - - thumb_func_start sub_81C7400 -sub_81C7400: @ 81C7400 - push {lr} - bl RunActiveTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_81C7400 - - thumb_func_start sub_81C7418 -sub_81C7418: @ 81C7418 - push {lr} - bl copy_pal_bg_faded_to_pal_ram - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - pop {r0} - bx r0 - thumb_func_end sub_81C7418 - - thumb_func_start sub_81C742C -sub_81C742C: @ 81C742C - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r7, r1, r0 - movs r1, 0 - ldrsh r0, [r7, r1] - cmp r0, 0x5 - bls _081C7446 - b _081C7562 -_081C7446: - lsls r0, 2 - ldr r1, =_081C7458 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C7458: - .4byte _081C7470 - .4byte _081C747A - .4byte _081C7490 - .4byte _081C749C - .4byte _081C751E - .4byte _081C752C -_081C7470: - bl sub_81C76C4 - movs r0, 0x1 - strh r0, [r7] - b _081C7562 -_081C747A: - bl sub_81C76FC - cmp r0, 0 - bne _081C7562 - ldr r0, =0x000186a0 - bl sub_81C756C - b _081C74E8 - .pool -_081C7490: - bl sub_81C786C - cmp r0, 0 - bne _081C7562 - movs r0, 0x3 - strh r0, [r7] -_081C749C: - bl sub_81C75E0 - adds r6, r0, 0 - movs r0, 0x1 - negs r0, r0 - cmp r6, r0 - beq _081C74FC - ldr r0, =0x0001869f - cmp r6, r0 - bls _081C7506 - ldr r4, =gUnknown_0861F3EC - ldr r5, =0x0203cf40 - ldr r0, [r5] - ldr r1, [r0, 0x4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x18 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - ldr r0, [r5] - ldr r1, [r0, 0x4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r4, 0x14 - adds r0, r4 - ldr r0, [r0] - bl _call_via_r0 - adds r0, r6, 0 - bl sub_81C756C - cmp r0, 0 - beq _081C74FC -_081C74E8: - movs r0, 0x4 - strh r0, [r7] - b _081C7562 - .pool -_081C74FC: - bl sub_81C7710 - movs r0, 0x5 - strh r0, [r7] - b _081C7562 -_081C7506: - cmp r6, 0 - beq _081C7562 - adds r0, r6, 0 - bl sub_81C7850 - bl sub_81C786C - cmp r0, 0 - beq _081C7562 - movs r0, 0x2 - strh r0, [r7] - b _081C7562 -_081C751E: - bl sub_81C75D4 - cmp r0, 0 - bne _081C7562 - movs r0, 0x3 - strh r0, [r7] - b _081C7562 -_081C752C: - bl sub_81C7738 - cmp r0, 0 - bne _081C7562 - ldr r0, =0x0203cf40 - ldr r0, [r0] - ldrh r0, [r0, 0x8] - negs r4, r0 - orrs r4, r0 - lsrs r4, 31 - bl sub_81C9430 - bl sub_81C7334 - cmp r4, 0 - beq _081C755C - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 - b _081C7562 - .pool -_081C755C: - ldr r0, =sub_8086194 - bl SetMainCallback2 -_081C7562: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C742C - - thumb_func_start sub_81C756C -sub_81C756C: @ 81C756C - push {r4-r6,lr} - ldr r1, =0xfffe7960 - adds r6, r0, r1 - bl sub_81C75F4 - ldr r5, =gUnknown_0861F3EC - lsls r0, r6, 3 - subs r0, r6 - lsls r4, r0, 2 - adds r0, r4, r5 - ldr r0, [r0] - bl _call_via_r0 - cmp r0, 0 - beq _081C75CC - adds r0, r5, 0 - adds r0, 0x8 - adds r0, r4, r0 - ldr r0, [r0] - bl _call_via_r0 - cmp r0, 0 - beq _081C75CC - adds r0, r5, 0 - adds r0, 0xC - adds r0, r4, r0 - ldr r0, [r0] - adds r1, r5, 0 - adds r1, 0x10 - adds r1, r4, r1 - ldr r1, [r1] - bl sub_81C7834 - ldr r0, =0x0203cf40 - ldr r1, [r0] - adds r0, r5, 0x4 - adds r0, r4, r0 - ldr r0, [r0] - str r0, [r1] - str r6, [r1, 0x4] - movs r0, 0x1 - b _081C75CE - .pool -_081C75CC: - movs r0, 0 -_081C75CE: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81C756C - - thumb_func_start sub_81C75D4 -sub_81C75D4: @ 81C75D4 - push {lr} - bl sub_81C786C - pop {r1} - bx r1 - thumb_func_end sub_81C75D4 - - thumb_func_start sub_81C75E0 -sub_81C75E0: @ 81C75E0 - push {lr} - ldr r0, =0x0203cf40 - ldr r0, [r0] - ldr r0, [r0] - bl _call_via_r0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81C75E0 - - thumb_func_start sub_81C75F4 -sub_81C75F4: @ 81C75F4 - push {lr} - bl InitKeypadData - pop {r0} - bx r0 - thumb_func_end sub_81C75F4 - - thumb_func_start c3args_set_0toR1_1to0 -c3args_set_0toR1_1to0: @ 81C7600 - push {lr} - bl SetVBlankCallback - pop {r0} - bx r0 - thumb_func_end c3args_set_0toR1_1to0 - - thumb_func_start sub_81C760C -sub_81C760C: @ 81C760C - push {lr} - ldr r0, =sub_81C7418 - bl SetVBlankCallback - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C760C - - thumb_func_start sub_81C761C -sub_81C761C: @ 81C761C - push {r4,lr} - adds r4, r0, 0 - adds r0, r1, 0 - bl Alloc - ldr r1, =0x0203cf40 - ldr r1, [r1] - lsls r4, 2 - adds r1, 0x10 - adds r1, r4 - str r0, [r1] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81C761C - - thumb_func_start sub_81C763C -sub_81C763C: @ 81C763C - ldr r1, =0x0203cf40 - ldr r1, [r1] - lsls r0, 2 - adds r1, 0x10 - adds r1, r0 - ldr r0, [r1] - bx lr - .pool - thumb_func_end sub_81C763C - - thumb_func_start sub_81C7650 -sub_81C7650: @ 81C7650 - push {r4,r5,lr} - ldr r5, =0x0203cf40 - ldr r1, [r5] - lsls r4, r0, 2 - adds r1, 0x10 - adds r1, r4 - ldr r0, [r1] - cmp r0, 0 - beq _081C7670 - bl Free - ldr r0, [r5] - adds r0, 0x10 - adds r0, r4 - movs r1, 0 - str r1, [r0] -_081C7670: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C7650 - - thumb_func_start sub_81C767C -sub_81C767C: @ 81C767C - ldr r0, =0x0203cf40 - ldr r0, [r0] - ldrh r0, [r0, 0x8] - bx lr - .pool - thumb_func_end sub_81C767C - - thumb_func_start sub_81C7688 -sub_81C7688: @ 81C7688 - ldr r1, =0x0203cf40 - ldr r1, [r1] - strh r0, [r1, 0x8] - bx lr - .pool - thumb_func_end sub_81C7688 - - thumb_func_start sub_81C7694 -sub_81C7694: @ 81C7694 - push {lr} - adds r1, r0, 0 - cmp r1, 0x4 - bls _081C769E - movs r1, 0 -_081C769E: - ldr r0, =0x0203cf40 - ldr r0, [r0] - strh r1, [r0, 0xA] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C7694 - - thumb_func_start sub_81C76AC -sub_81C76AC: @ 81C76AC - ldr r0, =0x0203cf40 - ldr r0, [r0] - ldrh r0, [r0, 0xA] - bx lr - .pool - thumb_func_end sub_81C76AC - - thumb_func_start sub_81C76B8 -sub_81C76B8: @ 81C76B8 - ldr r0, =0x0203cf40 - ldr r0, [r0] - ldr r0, [r0, 0xC] - bx lr - .pool - thumb_func_end sub_81C76B8 - - thumb_func_start sub_81C76C4 -sub_81C76C4: @ 81C76C4 - push {r4,lr} - ldr r1, =0x0000082c - movs r0, 0 - bl sub_81C761C - adds r4, r0, 0 - cmp r4, 0 - beq _081C76F4 - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - ldr r0, =sub_81C7764 - movs r1, 0x1 - bl sub_81C7078 - str r0, [r4, 0xC] - movs r0, 0x1 - b _081C76F6 - .pool -_081C76F4: - movs r0, 0 -_081C76F6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81C76C4 - - thumb_func_start sub_81C76FC -sub_81C76FC: @ 81C76FC - push {lr} - movs r0, 0 - bl sub_81C763C - ldr r0, [r0, 0xC] - bl sub_81C70D8 - pop {r1} - bx r1 - thumb_func_end sub_81C76FC - - thumb_func_start sub_81C7710 -sub_81C7710: @ 81C7710 - push {lr} - sub sp, 0x4 - movs r0, 0x6F - bl audio_play - bl sub_81CAADC - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - str r0, [sp] - adds r0, r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - add sp, 0x4 - pop {r0} - bx r0 - thumb_func_end sub_81C7710 - - thumb_func_start sub_81C7738 -sub_81C7738: @ 81C7738 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081C7750 - movs r0, 0x1 - b _081C775E - .pool -_081C7750: - bl sub_81C99D4 - bl sub_81C7C94 - bl FreeAllWindowBuffers - movs r0, 0 -_081C775E: - pop {r1} - bx r1 - thumb_func_end sub_81C7738 - - thumb_func_start sub_81C7764 -sub_81C7764: @ 81C7764 - push {r4,lr} - sub sp, 0x4 - cmp r0, 0x1 - beq _081C77B0 - cmp r0, 0x1 - bgt _081C7776 - cmp r0, 0 - beq _081C7780 - b _081C782A -_081C7776: - cmp r0, 0x2 - beq _081C77FC - cmp r0, 0x3 - beq _081C780E - b _081C782A -_081C7780: - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - bl FreeAllWindowBuffers - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0861FA04 - movs r0, 0 - movs r2, 0x1 - bl InitBgsFromTemplates - bl sub_8199D98 - bl reset_temp_tile_data_buffers - movs r0, 0x1 - b _081C782C - .pool -_081C77B0: - movs r0, 0 - bl sub_81C763C - adds r4, r0, 0 - ldr r1, =gUnknown_08DC7B80 - movs r0, 0 - str r0, [sp] - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - adds r4, 0x2C - movs r0, 0 - adds r1, r4, 0 - bl SetBgTilemapBuffer - ldr r1, =gUnknown_08DC7D84 - movs r0, 0 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - ldr r0, =gUnknown_08DC7B60 - movs r1, 0 - movs r2, 0x20 - bl sub_81C7944 - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0 - b _081C782C - .pool -_081C77FC: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - bne _081C7818 - bl sub_81C7B74 - movs r0, 0 - b _081C782C -_081C780E: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _081C781C -_081C7818: - movs r0, 0x2 - b _081C782C -_081C781C: - bl sub_81C7C28 - bl sub_81C7D28 - movs r0, 0 - bl ShowBg -_081C782A: - movs r0, 0x4 -_081C782C: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81C7764 - - thumb_func_start sub_81C7834 -sub_81C7834: @ 81C7834 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0 - bl sub_81C763C - str r4, [r0] - str r5, [r0, 0x4] - movs r1, 0 - str r1, [r0, 0x8] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81C7834 - - thumb_func_start sub_81C7850 -sub_81C7850: @ 81C7850 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0 - bl sub_81C763C - movs r1, 0 - str r1, [r0, 0x8] - ldr r1, [r0] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C7850 - - thumb_func_start sub_81C786C -sub_81C786C: @ 81C786C - push {lr} - movs r0, 0 - bl sub_81C763C - ldr r0, [r0, 0x4] - bl _call_via_r0 - pop {r1} - bx r1 - thumb_func_end sub_81C786C - - thumb_func_start sub_81C7880 -sub_81C7880: @ 81C7880 - push {r4,lr} - movs r0, 0 - bl sub_81C763C - adds r4, r0, 0 - ldr r0, =atk47_cmd47 - movs r1, 0x4 - bl sub_81C7078 - str r0, [r4, 0xC] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C7880 - - thumb_func_start sub_81C78A0 -sub_81C78A0: @ 81C78A0 - push {r4,lr} - movs r0, 0 - bl sub_81C763C - adds r4, r0, 0 - ldr r0, =sub_81C791C - movs r1, 0x4 - bl sub_81C7078 - str r0, [r4, 0xC] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C78A0 - - thumb_func_start sub_81C78C0 -sub_81C78C0: @ 81C78C0 - push {lr} - movs r0, 0 - bl sub_81C763C - ldr r0, [r0, 0xC] - bl sub_81C70D8 - pop {r1} - bx r1 - thumb_func_end sub_81C78C0 - - thumb_func_start atk47_cmd47 -atk47_cmd47: @ 81C78D4 - push {lr} - cmp r0, 0x1 - beq _081C78EA - cmp r0, 0x1 - bgt _081C78E4 - cmp r0, 0 - beq _081C78EA - b _081C7914 -_081C78E4: - cmp r0, 0x2 - beq _081C78EE - b _081C7914 -_081C78EA: - movs r0, 0 - b _081C7916 -_081C78EE: - movs r1, 0xC0 - lsls r1, 1 - movs r0, 0 - movs r2, 0x1 - bl ChangeBgY - ldr r1, =0x00001fff - cmp r0, r1 - bhi _081C7908 - movs r0, 0x2 - b _081C7916 - .pool -_081C7908: - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - movs r2, 0 - bl ChangeBgY -_081C7914: - movs r0, 0x4 -_081C7916: - pop {r1} - bx r1 - thumb_func_end atk47_cmd47 - - thumb_func_start sub_81C791C -sub_81C791C: @ 81C791C - push {lr} - movs r1, 0xC0 - lsls r1, 1 - movs r0, 0 - movs r2, 0x2 - bl ChangeBgY - cmp r0, 0 - ble _081C7932 - movs r0, 0x2 - b _081C793E -_081C7932: - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x4 -_081C793E: - pop {r1} - bx r1 - thumb_func_end sub_81C791C - - thumb_func_start sub_81C7944 -sub_81C7944: @ 81C7944 - push {lr} - lsls r1, 1 - ldr r3, =0x02037714 - adds r1, r3 - lsls r2, 10 - lsrs r2, 11 - bl CpuSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C7944 - - thumb_func_start sub_81C795C -sub_81C795C: @ 81C795C - push {r4,lr} - adds r4, r0, 0 - b _081C7974 -_081C7962: - lsls r0, r1, 4 - movs r2, 0x80 - lsls r2, 1 - adds r1, r0, r2 - ldr r0, [r4] - movs r2, 0x20 - bl sub_81C7944 - adds r4, 0x8 -_081C7974: - ldr r0, [r4] - cmp r0, 0 - beq _081C7988 - ldrh r0, [r4, 0x4] - bl AllocObjectPalette - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xFF - bne _081C7962 -_081C7988: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C795C - - thumb_func_start sub_81C7990 -sub_81C7990: @ 81C7990 - push {lr} - sub sp, 0x4 - adds r3, r0, 0 - lsls r1, 16 - lsrs r1, 16 - mov r0, sp - strh r1, [r0] - lsls r3, 5 - ldr r0, =0x02037d14 - adds r3, r0 - ldr r2, =0x01000010 - mov r0, sp - adds r1, r3, 0 - bl CpuSet - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C7990 - - thumb_func_start sub_81C79BC -sub_81C79BC: @ 81C79BC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - str r0, [sp] - str r1, [sp, 0x4] - mov r10, r2 - str r3, [sp, 0x8] - ldr r0, [sp, 0x2C] - cmp r0, 0 - bne _081C79E4 - ldr r2, =0x001fffff - mov r1, r10 - ands r2, r1 - ldr r0, [sp] - b _081C79F4 - .pool -_081C79E4: - ldr r2, [sp, 0x2C] - ldr r0, [sp, 0x8] - cmp r2, r0 - blt _081C7A00 - ldr r2, =0x001fffff - mov r1, r10 - ands r2, r1 - ldr r0, [sp, 0x4] -_081C79F4: - ldr r1, [sp, 0x30] - bl CpuSet - b _081C7AAE - .pool -_081C7A00: - movs r2, 0x1 - negs r2, r2 - add r10, r2 - b _081C7AA6 -_081C7A08: - ldr r1, [sp] - ldrh r0, [r1] - movs r2, 0x1F - mov r9, r2 - mov r1, r9 - ands r1, r0 - mov r9, r1 - lsls r0, 16 - lsrs r2, r0, 21 - movs r1, 0x1F - ands r1, r2 - mov r8, r1 - lsrs r7, r0, 26 - movs r2, 0x1F - ands r7, r2 - ldr r0, [sp, 0x4] - ldrh r4, [r0] - movs r0, 0x1F - ands r0, r4 - mov r1, r9 - subs r0, r1 - lsls r0, 8 - ldr r1, [sp, 0x8] - bl __divsi3 - ldr r2, [sp, 0x2C] - adds r6, r0, 0 - muls r6, r2 - asrs r6, 8 - lsls r4, 16 - lsrs r0, r4, 21 - movs r1, 0x1F - ands r0, r1 - mov r2, r8 - subs r0, r2 - lsls r0, 8 - ldr r1, [sp, 0x8] - bl __divsi3 - ldr r1, [sp, 0x2C] - adds r5, r0, 0 - muls r5, r1 - asrs r5, 8 - lsrs r4, 26 - movs r2, 0x1F - ands r4, r2 - subs r4, r7 - lsls r4, 8 - adds r0, r4, 0 - ldr r1, [sp, 0x8] - bl __divsi3 - ldr r1, [sp, 0x2C] - muls r0, r1 - asrs r0, 8 - add r6, r9 - movs r2, 0x1F - ands r6, r2 - add r5, r8 - ands r5, r2 - adds r0, r7, r0 - ands r0, r2 - lsls r0, 10 - lsls r5, 5 - orrs r0, r5 - orrs r0, r6 - ldr r1, [sp, 0x30] - strh r0, [r1] - ldr r2, [sp] - adds r2, 0x2 - str r2, [sp] - ldr r0, [sp, 0x4] - adds r0, 0x2 - str r0, [sp, 0x4] - adds r1, 0x2 - str r1, [sp, 0x30] - movs r1, 0x1 - negs r1, r1 - add r10, r1 -_081C7AA6: - movs r0, 0x1 - negs r0, r0 - cmp r10, r0 - bne _081C7A08 -_081C7AAE: - 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_81C79BC - - thumb_func_start sub_81C7AC0 -sub_81C7AC0: @ 81C7AC0 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - movs r0, 0 - bl sub_81C763C - cmp r4, 0x1 - beq _081C7AF0 - cmp r4, 0x1 - bgt _081C7ADA - cmp r4, 0 - beq _081C7AE4 - b _081C7B2C -_081C7ADA: - cmp r4, 0x2 - beq _081C7B04 - cmp r4, 0x3 - beq _081C7B18 - b _081C7B2C -_081C7AE4: - ldr r0, [r0, 0x14] - movs r1, 0x2 - negs r1, r1 - str r4, [sp] - movs r2, 0 - b _081C7B10 -_081C7AF0: - ldr r0, [r0, 0x14] - movs r1, 0x2 - negs r1, r1 - movs r2, 0 - str r2, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - b _081C7B2C -_081C7B04: - movs r0, 0x1 - negs r0, r0 - movs r1, 0x2 - negs r1, r1 - movs r2, 0 - str r2, [sp] -_081C7B10: - movs r3, 0x10 - bl pal_fade_maybe - b _081C7B2C -_081C7B18: - movs r0, 0x1 - negs r0, r0 - movs r1, 0x2 - negs r1, r1 - movs r2, 0 - str r2, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe -_081C7B2C: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C7AC0 - - thumb_func_start sub_81C7B34 -sub_81C7B34: @ 81C7B34 - ldr r0, =0x02037fd4 - ldrb r0, [r0, 0x7] - lsrs r0, 7 - bx lr - .pool - thumb_func_end sub_81C7B34 - - thumb_func_start sub_81C7B40 -sub_81C7B40: @ 81C7B40 - push {lr} - ldr r0, =0xfffefffe - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C7B40 - - thumb_func_start sub_81C7B54 -sub_81C7B54: @ 81C7B54 - push {r4,r5,lr} - adds r5, r0, 0 - cmp r1, 0 - ble _081C7B6C - adds r4, r1, 0 -_081C7B5E: - adds r0, r5, 0 - adds r5, 0x4 - bl InitBgFromTemplate - subs r4, 0x1 - cmp r4, 0 - bne _081C7B5E -_081C7B6C: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81C7B54 - - thumb_func_start sub_81C7B74 -sub_81C7B74: @ 81C7B74 - push {r4,lr} - movs r0, 0 - bl sub_81C763C - adds r4, r0, 0 - ldr r0, =gUnknown_0861FA08 - bl InitWindows - movs r0, 0 - str r0, [r4, 0x10] - bl sub_81C7BF8 - ldrb r0, [r4, 0x10] - bl PutWindowTilemap - ldrb r0, [r4, 0x10] - movs r1, 0x3 - bl CopyWindowToVram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C7B74 - - thumb_func_start sub_81C7BA4 -sub_81C7BA4: @ 81C7BA4 - push {r4,r5,lr} - sub sp, 0xC - adds r4, r0, 0 - movs r0, 0 - bl sub_81C763C - adds r5, r0, 0 - ldr r0, [r5, 0x10] - bl sub_81C7BF8 - ldrb r0, [r5, 0x10] - ldr r1, =gUnknown_0861FA48 - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - ldr r1, =gUnknown_0861FA18 - lsls r4, 2 - adds r4, r1 - ldr r1, [r4] - str r1, [sp, 0x8] - movs r1, 0x1 - movs r2, 0 - movs r3, 0x1 - bl box_print - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C7BA4 - - thumb_func_start sub_81C7BE8 -sub_81C7BE8: @ 81C7BE8 - push {lr} - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_81C7BE8 - - thumb_func_start sub_81C7BF8 -sub_81C7BF8: @ 81C7BF8 - push {r4,lr} - sub sp, 0x8 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0x44 - bl FillWindowPixelBuffer - movs r0, 0x80 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - adds r0, r4, 0 - movs r1, 0x55 - movs r2, 0 - movs r3, 0 - bl FillWindowPixelRect - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C7BF8 - - thumb_func_start sub_81C7C28 -sub_81C7C28: @ 81C7C28 - push {r4-r6,lr} - movs r0, 0 - bl sub_81C763C - adds r6, r0, 0 - movs r5, 0 - ldr r4, =gUnknown_0861FA4C -_081C7C36: - adds r0, r4, 0 - bl LoadCompressedObjectPic - adds r4, 0x8 - adds r5, 0x1 - cmp r5, 0 - beq _081C7C36 - ldr r0, =gUnknown_0861FA54 - bl sub_81C795C - movs r0, 0 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x80 - lsls r1, 9 - lsls r1, r0 - movs r0, 0x2 - negs r0, r0 - bics r0, r1 - str r0, [r6, 0x14] - ldr r0, =gUnknown_0861FB04 - movs r1, 0xDC - movs r2, 0xC - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - str r1, [r6, 0x18] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C7C28 - - thumb_func_start sub_81C7C94 -sub_81C7C94: @ 81C7C94 - push {lr} - movs r0, 0 - bl sub_81C763C - ldr r0, [r0, 0x18] - bl RemoveObjectAndFreeTiles - movs r0, 0 - bl FreeObjectTilesByTag - movs r0, 0 - bl FreeObjectPaletteByTag - pop {r0} - bx r0 - thumb_func_end sub_81C7C94 - - thumb_func_start sub_81C7CB4 -sub_81C7CB4: @ 81C7CB4 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0 - bl GetBgY - lsrs r0, 8 - negs r0, r0 - strh r0, [r4, 0x26] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C7CB4 - - thumb_func_start sub_81C7CCC -sub_81C7CCC: @ 81C7CCC - push {lr} - movs r0, 0 - bl sub_81C763C - ldr r0, [r0, 0x18] - ldr r1, =DummyObjectCallback - str r1, [r0, 0x1C] - pop {r1} - bx r1 - .pool - thumb_func_end sub_81C7CCC - - thumb_func_start sub_81C7CE4 -sub_81C7CE4: @ 81C7CE4 - push {r4,lr} - movs r0, 0 - bl sub_81C763C - ldr r2, [r0, 0x18] - movs r4, 0 - movs r1, 0xDC - strh r1, [r2, 0x20] - ldr r2, [r0, 0x18] - movs r1, 0xC - strh r1, [r2, 0x22] - ldr r2, [r0, 0x18] - ldr r1, =sub_81C7CB4 - str r1, [r2, 0x1C] - adds r2, 0x3E - ldrb r3, [r2] - movs r1, 0x5 - negs r1, r1 - ands r1, r3 - strb r1, [r2] - ldr r3, [r0, 0x18] - ldrb r2, [r3, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - strb r1, [r3, 0x5] - ldr r0, [r0, 0x18] - adds r0, 0x43 - strb r4, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C7CE4 - - thumb_func_start sub_81C7D28 -sub_81C7D28: @ 81C7D28 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r0, 0 - bl sub_81C763C - adds r6, r0, 0 - ldr r0, =gUnknown_0861FA64 - bl LoadCompressedObjectPic - movs r0, 0x1 - bl AllocObjectPalette - movs r0, 0x2 - bl AllocObjectPalette - movs r5, 0 - ldr r0, =0x02020630 - mov r8, r0 - movs r7, 0x4 -_081C7D50: - ldr r0, =gUnknown_0861FB2C - movs r1, 0 - movs r2, 0 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - lsls r4, r5, 2 - adds r2, r6, 0 - adds r2, 0x1C - adds r2, r4 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - str r0, [r2] - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r7 - strb r1, [r0] - ldr r1, [r2] - lsls r0, r5, 6 - strh r0, [r1, 0x24] - ldr r0, =gUnknown_0861FB44 - movs r1, 0 - movs r2, 0 - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - adds r2, r6, 0 - adds r2, 0x24 - adds r2, r4 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - str r0, [r2] - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r7 - strb r1, [r0] - ldr r1, [r2] - lsls r0, r5, 5 - strh r0, [r1, 0x24] - ldr r1, [r2] - movs r0, 0x12 - strh r0, [r1, 0x26] - ldr r3, [r2] - ldrh r2, [r3, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - lsls r0, r5, 3 - adds r0, 0x40 - adds r1, r0 - ldr r4, =0x000003ff - adds r0, r4, 0 - ands r1, r0 - ldr r4, =0xfffffc00 - adds r0, r4, 0 - ands r2, r0 - orrs r2, r1 - strh r2, [r3, 0x4] - adds r5, 0x1 - cmp r5, 0x1 - ble _081C7D50 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C7D28 - - thumb_func_start sub_81C7DFC -sub_81C7DFC: @ 81C7DFC - push {lr} - cmp r0, 0x5 - bhi _081C7E08 - bl sub_81C7E58 - b _081C7E0E -_081C7E08: - subs r0, 0x6 - bl sub_81C7F24 -_081C7E0E: - pop {r0} - bx r0 - thumb_func_end sub_81C7DFC - - thumb_func_start sub_81C7E14 -sub_81C7E14: @ 81C7E14 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0 - bl sub_81C763C - adds r5, r0, 0 - cmp r4, 0x4 - bne _081C7E30 - movs r0, 0x2 - bl GetObjectTileRangeStartByTag - ldr r3, [r5, 0x20] - adds r0, 0x20 - b _081C7E3A -_081C7E30: - movs r0, 0x2 - bl GetObjectTileRangeStartByTag - ldr r3, [r5, 0x20] - adds r0, 0x40 -_081C7E3A: - ldr r2, =0x000003ff - adds r1, r2, 0 - ands r0, r1 - ldrh r2, [r3, 0x4] - ldr r1, =0xfffffc00 - ands r1, r2 - orrs r1, r0 - strh r1, [r3, 0x4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C7E14 - - thumb_func_start sub_81C7E58 -sub_81C7E58: @ 81C7E58 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - mov r9, r0 - cmp r0, 0x5 - bhi _081C7F16 - movs r0, 0 - bl sub_81C763C - adds r7, r0, 0 - ldr r0, =gUnknown_0861FA6C - mov r1, r9 - lsls r6, r1, 3 - adds r6, r0 - ldrh r4, [r6, 0x6] - ldr r2, [r6] - mov r8, r2 - mov r0, r8 - bl sub_8034974 - adds r5, r0, 0 - lsls r4, 5 - ldr r0, =gUnknown_08DC7F00 - adds r4, r0 - movs r0, 0x1 - bl IndexOfObjectPaletteTag - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 4 - movs r0, 0x80 - lsls r0, 17 - adds r1, r0 - lsrs r1, 16 - adds r0, r4, 0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r4, =0x0201c000 - mov r0, r8 - adds r1, r4, 0 - bl LZ77UnCompWram - movs r0, 0x2 - bl GetObjectTileRangeStartByTag - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 11 - ldr r2, =0x06010000 - adds r1, r2 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - adds r2, r5, 0 - movs r3, 0x1 - bl RequestDma3Copy - movs r0, 0x2 - bl GetObjectTileRangeStartByTag - ldr r3, [r7, 0x20] - ldrh r1, [r6, 0x4] - adds r0, r1 - ldr r2, =0x000003ff - adds r1, r2, 0 - ands r0, r1 - ldrh r2, [r3, 0x4] - ldr r1, =0xfffffc00 - ands r1, r2 - orrs r1, r0 - strh r1, [r3, 0x4] - mov r0, r9 - subs r0, 0x4 - cmp r0, 0x1 - bhi _081C7F10 - ldr r1, [r7, 0x20] - movs r0, 0x38 - b _081C7F14 - .pool -_081C7F10: - ldr r1, [r7, 0x20] - movs r0, 0x40 -_081C7F14: - strh r0, [r1, 0x24] -_081C7F16: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81C7E58 - - thumb_func_start sub_81C7F24 -sub_81C7F24: @ 81C7F24 - push {r4-r6,lr} - cmp r0, 0x6 - bhi _081C7F8A - ldr r2, =gUnknown_0861FA9C - lsls r1, r0, 3 - adds r0, r2, 0x4 - adds r0, r1, r0 - ldr r4, [r0] - adds r1, r2 - ldr r6, [r1] - adds r0, r6, 0 - bl sub_8034974 - adds r5, r0, 0 - lsls r4, 5 - ldr r0, =gUnknown_08DC7F00 - adds r4, r0 - movs r0, 0x2 - bl IndexOfObjectPaletteTag - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 4 - movs r0, 0x80 - lsls r0, 17 - adds r1, r0 - lsrs r1, 16 - adds r0, r4, 0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r4, =0x0201d000 - adds r0, r6, 0 - adds r1, r4, 0 - bl LZ77UnCompWram - movs r0, 0x2 - bl GetObjectTileRangeStartByTag - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 11 - ldr r0, =0x06010800 - adds r1, r0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - adds r2, r5, 0 - movs r3, 0x1 - bl RequestDma3Copy -_081C7F8A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C7F24 - - thumb_func_start sub_81C7FA0 -sub_81C7FA0: @ 81C7FA0 - push {lr} - adds r3, r0, 0 - movs r0, 0x10 - cmp r1, 0 - bne _081C7FAC - movs r0, 0x30 -_081C7FAC: - cmp r3, 0x5 - bhi _081C7FB8 - adds r1, r2, 0 - bl sub_81C803C - b _081C7FBE -_081C7FB8: - adds r1, r2, 0 - bl sub_81C8088 -_081C7FBE: - pop {r0} - bx r0 - thumb_func_end sub_81C7FA0 - - thumb_func_start sub_81C7FC4 -sub_81C7FC4: @ 81C7FC4 - push {lr} - cmp r0, 0x5 - bhi _081C7FD2 - adds r0, r1, 0 - bl sub_81C80D4 - b _081C7FD8 -_081C7FD2: - adds r0, r1, 0 - bl sub_81C8110 -_081C7FD8: - pop {r0} - bx r0 - thumb_func_end sub_81C7FC4 - - thumb_func_start sub_81C7FDC -sub_81C7FDC: @ 81C7FDC - push {r4,lr} - movs r0, 0 - bl sub_81C763C - movs r4, 0x4 - adds r2, r0, 0 - adds r2, 0x1C - movs r3, 0x1 -_081C7FEC: - ldr r1, [r2] - adds r1, 0x3E - ldrb r0, [r1] - orrs r0, r4 - strb r0, [r1] - ldr r1, [r2, 0x8] - adds r1, 0x3E - ldrb r0, [r1] - orrs r0, r4 - strb r0, [r1] - adds r2, 0x4 - subs r3, 0x1 - cmp r3, 0 - bge _081C7FEC - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C7FDC - - thumb_func_start sub_81C8010 -sub_81C8010: @ 81C8010 - push {lr} - movs r0, 0 - bl sub_81C763C - adds r1, r0, 0 - ldr r0, [r1, 0x1C] - ldr r2, [r0, 0x1C] - ldr r0, =DummyObjectCallback - cmp r2, r0 - bne _081C8034 - ldr r0, [r1, 0x24] - ldr r0, [r0, 0x1C] - cmp r0, r2 - bne _081C8034 - movs r0, 0 - b _081C8036 - .pool -_081C8034: - movs r0, 0x1 -_081C8036: - pop {r1} - bx r1 - thumb_func_end sub_81C8010 - - thumb_func_start sub_81C803C -sub_81C803C: @ 81C803C - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r8, r0 - adds r4, r1, 0 - movs r0, 0 - bl sub_81C763C - cmp r4, 0 - bne _081C8058 - movs r7, 0x60 - negs r7, r7 - movs r6, 0x20 - b _081C805E -_081C8058: - movs r7, 0x80 - lsls r7, 1 - movs r6, 0xA0 -_081C805E: - adds r4, r0, 0 - adds r4, 0x1C - movs r5, 0x1 -_081C8064: - ldr r0, [r4] - mov r1, r8 - strh r1, [r0, 0x22] - ldm r4!, {r0} - adds r1, r7, 0 - adds r2, r6, 0 - movs r3, 0xC - bl sub_81C814C - subs r5, 0x1 - cmp r5, 0 - bge _081C8064 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81C803C - - thumb_func_start sub_81C8088 -sub_81C8088: @ 81C8088 - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r8, r0 - adds r4, r1, 0 - movs r0, 0 - bl sub_81C763C - cmp r4, 0 - bne _081C80A4 - movs r7, 0x60 - negs r7, r7 - movs r6, 0x10 - b _081C80AA -_081C80A4: - movs r7, 0x80 - lsls r7, 1 - movs r6, 0xC0 -_081C80AA: - adds r4, r0, 0 - adds r4, 0x24 - movs r5, 0x1 -_081C80B0: - ldr r0, [r4] - mov r1, r8 - strh r1, [r0, 0x22] - ldm r4!, {r0} - adds r1, r7, 0 - adds r2, r6, 0 - movs r3, 0xC - bl sub_81C814C - subs r5, 0x1 - cmp r5, 0 - bge _081C80B0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81C8088 - - thumb_func_start sub_81C80D4 -sub_81C80D4: @ 81C80D4 - push {r4-r7,lr} - adds r4, r0, 0 - movs r0, 0 - bl sub_81C763C - cmp r4, 0 - bne _081C80EA - movs r6, 0x20 - movs r5, 0x60 - negs r5, r5 - b _081C80F0 -_081C80EA: - movs r6, 0xC0 - movs r5, 0x80 - lsls r5, 1 -_081C80F0: - adds r7, r0, 0 - adds r7, 0x1C - movs r4, 0x1 -_081C80F6: - ldm r7!, {r0} - adds r1, r6, 0 - adds r2, r5, 0 - movs r3, 0xC - bl sub_81C814C - subs r4, 0x1 - cmp r4, 0 - bge _081C80F6 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81C80D4 - - thumb_func_start sub_81C8110 -sub_81C8110: @ 81C8110 - push {r4-r7,lr} - adds r4, r0, 0 - movs r0, 0 - bl sub_81C763C - cmp r4, 0 - bne _081C8126 - movs r6, 0x10 - movs r5, 0x60 - negs r5, r5 - b _081C812C -_081C8126: - movs r6, 0xC0 - movs r5, 0x80 - lsls r5, 1 -_081C812C: - adds r7, r0, 0 - adds r7, 0x24 - movs r4, 0x1 -_081C8132: - ldm r7!, {r0} - adds r1, r6, 0 - adds r2, r5, 0 - movs r3, 0xC - bl sub_81C814C - subs r4, 0x1 - cmp r4, 0 - bge _081C8132 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81C8110 - - thumb_func_start sub_81C814C -sub_81C814C: @ 81C814C - push {r4-r6,lr} - adds r4, r0, 0 - adds r0, r1, 0 - adds r6, r2, 0 - adds r5, r3, 0 - strh r0, [r4, 0x20] - lsls r1, r0, 4 - strh r1, [r4, 0x2E] - subs r0, r6, r0 - lsls r0, 4 - adds r1, r5, 0 - bl __divsi3 - strh r0, [r4, 0x30] - strh r5, [r4, 0x32] - strh r6, [r4, 0x3C] - ldr r0, =sub_81C817C - str r0, [r4, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C814C - - thumb_func_start sub_81C817C -sub_81C817C: @ 81C817C - push {lr} - adds r2, r0, 0 - ldrh r1, [r2, 0x32] - movs r3, 0x32 - ldrsh r0, [r2, r3] - cmp r0, 0 - beq _081C81C4 - subs r0, r1, 0x1 - strh r0, [r2, 0x32] - ldrh r0, [r2, 0x30] - ldrh r1, [r2, 0x2E] - adds r0, r1 - strh r0, [r2, 0x2E] - lsls r0, 16 - asrs r0, 20 - strh r0, [r2, 0x20] - adds r0, 0x10 - lsls r0, 16 - movs r1, 0x88 - lsls r1, 17 - cmp r0, r1 - bls _081C81B6 - adds r0, r2, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - b _081C81CC -_081C81B6: - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - b _081C81CC -_081C81C4: - ldrh r0, [r2, 0x3C] - strh r0, [r2, 0x20] - ldr r0, =DummyObjectCallback - str r0, [r2, 0x1C] -_081C81CC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C817C - - thumb_func_start sub_81C81D4 -sub_81C81D4: @ 81C81D4 - push {r4-r7,lr} - adds r6, r0, 0 - adds r5, r1, 0 - adds r7, r2, 0 - ldr r1, =0x000008a4 - movs r0, 0x11 - bl sub_81C761C - adds r4, r0, 0 - cmp r4, 0 - beq _081C821C - ldr r1, =0x00000888 - adds r0, r4, r1 - adds r1, r5, 0 - bl sub_81C9160 - adds r0, r4, 0 - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r7, 0 - bl sub_81C91AC - cmp r0, 0 - beq _081C821C - ldr r0, =sub_81C8254 - movs r1, 0x6 - bl sub_81C7078 - movs r0, 0x1 - b _081C821E - .pool -_081C821C: - movs r0, 0 -_081C821E: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81C81D4 - - thumb_func_start sub_81C8224 -sub_81C8224: @ 81C8224 - push {lr} - ldr r0, =sub_81C8254 - bl sub_81C7124 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81C8224 - - thumb_func_start sub_81C8234 -sub_81C8234: @ 81C8234 - push {r4,lr} - movs r0, 0x11 - bl sub_81C763C - adds r4, r0, 0 - bl sub_81C8FE0 - ldrb r0, [r4, 0x8] - bl RemoveWindow - movs r0, 0x11 - bl sub_81C7650 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C8234 - - thumb_func_start sub_81C8254 -sub_81C8254: @ 81C8254 - push {r4,lr} - adds r4, r0, 0 - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _081C82C0 - movs r0, 0x11 - bl sub_81C763C - adds r2, r0, 0 - cmp r4, 0x4 - bhi _081C82D6 - lsls r0, r4, 2 - ldr r1, =_081C827C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C827C: - .4byte _081C8290 - .4byte _081C829A - .4byte _081C82A4 - .4byte _081C82B8 - .4byte _081C82CC -_081C8290: - adds r0, r2, 0 - bl sub_81C82E4 - movs r0, 0 - b _081C82D8 -_081C829A: - adds r0, r2, 0 - bl sub_81C835C - movs r0, 0 - b _081C82D8 -_081C82A4: - ldr r1, =0x00000888 - adds r0, r2, r1 - adds r1, r2, 0 - bl sub_81C837C - movs r0, 0 - b _081C82D8 - .pool -_081C82B8: - bl sub_81C83E0 - cmp r0, 0 - beq _081C82C4 -_081C82C0: - movs r0, 0x2 - b _081C82D8 -_081C82C4: - bl sub_81C8ED0 - movs r0, 0x1 - b _081C82D8 -_081C82CC: - ldr r1, =0x00000888 - adds r0, r2, r1 - adds r1, r2, 0 - bl sub_81C8EF8 -_081C82D6: - movs r0, 0x4 -_081C82D8: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81C8254 - - thumb_func_start sub_81C82E4 -sub_81C82E4: @ 81C82E4 - push {r4,r5,lr} - sub sp, 0x8 - adds r5, r0, 0 - ldrb r4, [r5, 0x1] - lsls r4, 12 - ldrh r0, [r5, 0x6] - orrs r4, r0 - lsls r4, 16 - lsrs r4, 16 - ldrb r0, [r5] - ldrh r2, [r5, 0x6] - movs r1, 0x11 - movs r3, 0x1 - bl sub_8199DF0 - ldrb r0, [r5] - ldrh r2, [r5, 0x6] - adds r2, 0x1 - movs r1, 0x44 - movs r3, 0x1 - bl sub_8199DF0 - ldrb r0, [r5] - adds r1, r5, 0 - adds r1, 0x88 - bl SetBgTilemapBuffer - ldrb r0, [r5] - movs r1, 0x20 - str r1, [sp] - str r1, [sp, 0x4] - adds r1, r4, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - ldrb r0, [r5] - movs r1, 0 - movs r2, 0 - bl ChangeBgY - ldrb r0, [r5] - movs r1, 0 - movs r2, 0 - bl ChangeBgX - ldrb r0, [r5] - ldrb r1, [r5, 0x3] - lsls r1, 11 - movs r2, 0x2 - bl ChangeBgY - ldrb r0, [r5] - bl CopyBgTilemapBufferToVram - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81C82E4 - - thumb_func_start sub_81C835C -sub_81C835C: @ 81C835C - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4, 0x8] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldrb r0, [r4, 0x8] - bl PutWindowTilemap - ldrb r0, [r4, 0x8] - movs r1, 0x1 - bl CopyWindowToVram - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C835C - - thumb_func_start sub_81C837C -sub_81C837C: @ 81C837C - push {r4,r5,lr} - sub sp, 0x8 - adds r3, r0, 0 - adds r5, r1, 0 - ldrh r0, [r3, 0x2] - ldrh r4, [r3] - subs r2, r0, r4 - ldrh r0, [r3, 0x8] - cmp r2, r0 - ble _081C8392 - adds r2, r0, 0 -_081C8392: - ldr r0, [r3, 0x10] - ldr r3, [r3, 0xC] - movs r1, 0 - str r1, [sp] - str r5, [sp, 0x4] - adds r1, r4, 0 - bl sub_81C83AC - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81C837C - - thumb_func_start sub_81C83AC -sub_81C83AC: @ 81C83AC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, [sp, 0x10] - cmp r2, 0 - beq _081C83D6 - adds r0, r5, 0 - muls r0, r3 - adds r0, r4, r0 - str r0, [r1, 0x1C] - str r3, [r1, 0x18] - movs r0, 0 - strh r0, [r1, 0xC] - strh r2, [r1, 0xE] - str r5, [r1, 0x14] - ldr r0, [sp, 0xC] - str r0, [r1, 0x10] - ldr r0, =sub_81C83F0 - movs r1, 0x5 - bl sub_81C7078 -_081C83D6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C83AC - - thumb_func_start sub_81C83E0 -sub_81C83E0: @ 81C83E0 - push {lr} - ldr r0, =sub_81C83F0 - bl sub_81C7124 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81C83E0 - - thumb_func_start sub_81C83F0 -sub_81C83F0: @ 81C83F0 - push {r4-r7,lr} - sub sp, 0xC - adds r6, r0, 0 - movs r0, 0x11 - bl sub_81C763C - adds r4, r0, 0 - cmp r6, 0 - beq _081C8408 - cmp r6, 0x1 - beq _081C848C - b _081C849A -_081C8408: - ldrh r0, [r4, 0xA] - ldrh r1, [r4, 0xC] - adds r0, r1 - ldr r1, [r4, 0x10] - adds r5, r0, r1 - movs r0, 0xF - ands r5, r0 - ldr r0, [r4, 0x1C] - adds r7, r4, 0 - adds r7, 0x48 - ldr r2, [r4, 0x34] - adds r1, r7, 0 - bl _call_via_r2 - ldr r3, [r4, 0x38] - cmp r3, 0 - beq _081C8434 - ldrh r0, [r4, 0x8] - ldr r1, [r4, 0x14] - adds r2, r5, 0 - bl _call_via_r3 -_081C8434: - ldrb r0, [r4, 0x8] - ldrb r1, [r4, 0x5] - lsls r2, r5, 4 - movs r3, 0x1 - orrs r2, r3 - str r2, [sp] - movs r2, 0xFF - str r2, [sp, 0x4] - str r6, [sp, 0x8] - adds r2, r7, 0 - movs r3, 0x8 - bl Print - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - lsrs r0, 16 - ldrh r1, [r4, 0xE] - cmp r0, r1 - bcc _081C847A - ldr r0, [r4, 0x38] - cmp r0, 0 - beq _081C846E - ldrb r0, [r4, 0x8] - movs r1, 0x3 - bl CopyWindowToVram - b _081C8476 -_081C846E: - ldrb r0, [r4, 0x8] - movs r1, 0x2 - bl CopyWindowToVram -_081C8476: - movs r0, 0 - b _081C849C -_081C847A: - ldr r0, [r4, 0x1C] - ldr r1, [r4, 0x18] - adds r0, r1 - str r0, [r4, 0x1C] - ldr r0, [r4, 0x14] - adds r0, 0x1 - str r0, [r4, 0x14] - movs r0, 0x3 - b _081C849C -_081C848C: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _081C849A - movs r0, 0x2 - b _081C849C -_081C849A: - movs r0, 0x4 -_081C849C: - add sp, 0xC - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81C83F0 - - thumb_func_start sub_81C84A4 -sub_81C84A4: @ 81C84A4 - push {lr} - movs r0, 0x11 - bl sub_81C763C - ldr r1, =0x00000888 - adds r0, r1 - ldrh r1, [r0] - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81C84A4 - - thumb_func_start sub_81C84C0 -sub_81C84C0: @ 81C84C0 - push {lr} - movs r0, 0x11 - bl sub_81C763C - ldr r1, =0x00000888 - adds r0, r1 - movs r3, 0 - ldrh r1, [r0] - ldrh r2, [r0, 0x8] - adds r1, r2 - ldrh r0, [r0, 0x2] - cmp r1, r0 - bge _081C84DC - movs r3, 0x1 -_081C84DC: - adds r0, r3, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81C84C0 - - thumb_func_start sub_81C84E8 -sub_81C84E8: @ 81C84E8 - push {r4-r7,lr} - sub sp, 0x8 - adds r6, r0, 0 - adds r4, r1, 0 - movs r0, 0x11 - bl sub_81C763C - adds r7, r0, 0 - ldr r0, =0x00000888 - adds r5, r7, r0 - cmp r6, 0 - bge _081C8524 - ldrh r1, [r5] - adds r0, r1, r6 - cmp r0, 0 - bge _081C850A - negs r6, r1 -_081C850A: - cmp r4, 0 - beq _081C854E - ldr r0, [r5, 0x10] - adds r1, r6 - negs r2, r6 - ldr r3, [r5, 0xC] - str r6, [sp] - str r7, [sp, 0x4] - bl sub_81C83AC - b _081C854E - .pool -_081C8524: - cmp r4, 0 - beq _081C854E - ldr r2, =0x0203cf44 - ldrh r1, [r5] - ldrh r0, [r5, 0x8] - adds r4, r1, r0 - str r4, [r2] - adds r0, r4, r6 - ldrh r1, [r5, 0x2] - cmp r0, r1 - blt _081C853C - subs r6, r1, r4 -_081C853C: - ldr r0, [r5, 0x10] - ldr r3, [r5, 0xC] - ldrh r1, [r5, 0x8] - str r1, [sp] - str r7, [sp, 0x4] - adds r1, r4, 0 - adds r2, r6, 0 - bl sub_81C83AC -_081C854E: - adds r0, r6, 0 - adds r1, r7, 0 - bl sub_81C8568 - ldrh r0, [r5] - adds r0, r6 - strh r0, [r5] - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C84E8 - - thumb_func_start sub_81C8568 -sub_81C8568: @ 81C8568 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - ldrb r0, [r4] - bl GetBgY - str r0, [r4, 0x20] - lsls r1, r5, 12 - adds r0, r1 - str r0, [r4, 0x24] - cmp r5, 0 - ble _081C8584 - movs r0, 0x1 - b _081C8586 -_081C8584: - movs r0, 0x2 -_081C8586: - str r0, [r4, 0x30] - str r5, [r4, 0x2C] - ldr r0, =sub_81C85A0 - movs r1, 0x6 - bl sub_81C7078 - str r0, [r4, 0x28] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C8568 - - thumb_func_start sub_81C85A0 -sub_81C85A0: @ 81C85A0 - push {r4-r6,lr} - adds r5, r0, 0 - movs r0, 0x11 - bl sub_81C763C - adds r4, r0, 0 - cmp r5, 0 - beq _081C85B8 - cmp r5, 0x1 - beq _081C85C4 - movs r0, 0x4 - b _081C862A -_081C85B8: - bl sub_81C83E0 - cmp r0, 0 - bne _081C8628 - movs r0, 0x1 - b _081C862A -_081C85C4: - movs r6, 0 - ldrb r0, [r4] - bl GetBgY - adds r5, r0, 0 - ldrb r0, [r4] - movs r1, 0x80 - lsls r1, 5 - ldr r2, [r4, 0x30] - lsls r2, 24 - lsrs r2, 24 - bl ChangeBgY - adds r1, r0, 0 - ldr r0, [r4, 0x30] - cmp r0, 0x2 - bne _081C85F8 - ldr r2, [r4, 0x24] - cmp r5, r2 - bgt _081C85F2 - ldr r0, [r4, 0x20] - cmp r5, r0 - bgt _081C860A -_081C85F2: - cmp r1, r2 - bgt _081C860A - b _081C860E -_081C85F8: - ldr r2, [r4, 0x24] - cmp r5, r2 - blt _081C8604 - ldr r0, [r4, 0x20] - cmp r5, r0 - blt _081C860A -_081C8604: - cmp r1, r2 - blt _081C860A - movs r6, 0x1 -_081C860A: - cmp r6, 0 - beq _081C8628 -_081C860E: - ldr r1, [r4, 0x2C] - ldrh r0, [r4, 0xA] - adds r0, r1 - movs r1, 0xF - ands r0, r1 - strh r0, [r4, 0xA] - ldrb r0, [r4] - adds r1, r2, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x4 - b _081C862A -_081C8628: - movs r0, 0x2 -_081C862A: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81C85A0 - - thumb_func_start sub_81C8630 -sub_81C8630: @ 81C8630 - push {lr} - movs r0, 0x11 - bl sub_81C763C - ldr r0, [r0, 0x28] - bl sub_81C70D8 - pop {r1} - bx r1 - thumb_func_end sub_81C8630 - - thumb_func_start sub_81C8644 -sub_81C8644: @ 81C8644 - push {lr} - movs r0, 0x11 - bl sub_81C763C - ldr r1, =0x00000888 - adds r0, r1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81C8644 - - thumb_func_start sub_81C8658 -sub_81C8658: @ 81C8658 - push {lr} - bl sub_81C8644 - adds r1, r0, 0 - ldrh r0, [r1, 0x6] - cmp r0, 0 - beq _081C866E - subs r0, 0x1 - strh r0, [r1, 0x6] - movs r0, 0x1 - b _081C8686 -_081C866E: - bl sub_81C84A4 - cmp r0, 0 - bne _081C867A - movs r0, 0 - b _081C8686 -_081C867A: - movs r0, 0x1 - negs r0, r0 - movs r1, 0x1 - bl sub_81C84E8 - movs r0, 0x2 -_081C8686: - pop {r1} - bx r1 - thumb_func_end sub_81C8658 - - thumb_func_start sub_81C868C -sub_81C868C: @ 81C868C - push {lr} - bl sub_81C8644 - adds r2, r0, 0 - ldrh r1, [r2] - ldrh r3, [r2, 0x6] - adds r1, r3 - ldrh r0, [r2, 0x2] - subs r0, 0x1 - cmp r1, r0 - bge _081C86BA - ldrh r0, [r2, 0x8] - subs r0, 0x1 - cmp r3, r0 - bge _081C86B2 - adds r0, r3, 0x1 - strh r0, [r2, 0x6] - movs r0, 0x1 - b _081C86C8 -_081C86B2: - bl sub_81C84C0 - cmp r0, 0 - bne _081C86BE -_081C86BA: - movs r0, 0 - b _081C86C8 -_081C86BE: - movs r0, 0x1 - movs r1, 0x1 - bl sub_81C84E8 - movs r0, 0x2 -_081C86C8: - pop {r1} - bx r1 - thumb_func_end sub_81C868C - - thumb_func_start sub_81C86CC -sub_81C86CC: @ 81C86CC - push {r4,lr} - bl sub_81C8644 - adds r4, r0, 0 - bl sub_81C84A4 - adds r1, r0, 0 - cmp r1, 0 - beq _081C86F8 - ldrh r0, [r4] - ldrh r1, [r4, 0x8] - cmp r0, r1 - bcc _081C86EA - ldrh r0, [r4, 0x8] - b _081C86EC -_081C86EA: - ldrh r0, [r4] -_081C86EC: - negs r0, r0 - movs r1, 0x1 - bl sub_81C84E8 - movs r0, 0x2 - b _081C8706 -_081C86F8: - ldrh r0, [r4, 0x6] - cmp r0, 0 - bne _081C8702 - movs r0, 0 - b _081C8706 -_081C8702: - strh r1, [r4, 0x6] - movs r0, 0x1 -_081C8706: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81C86CC - - thumb_func_start sub_81C870C -sub_81C870C: @ 81C870C - push {r4,lr} - bl sub_81C8644 - adds r4, r0, 0 - bl sub_81C84C0 - cmp r0, 0 - beq _081C8736 - ldrh r0, [r4] - ldrh r3, [r4, 0x8] - adds r2, r0, r3 - ldrh r1, [r4, 0x4] - subs r0, r1, r0 - cmp r2, r1 - bgt _081C872C - adds r0, r3, 0 -_081C872C: - movs r1, 0x1 - bl sub_81C84E8 - movs r0, 0x2 - b _081C8756 -_081C8736: - ldrh r0, [r4, 0x2] - ldrh r1, [r4, 0x8] - cmp r0, r1 - bcc _081C8744 - ldrh r1, [r4, 0x6] - ldrh r0, [r4, 0x8] - b _081C8748 -_081C8744: - ldrh r1, [r4, 0x6] - ldrh r0, [r4, 0x2] -_081C8748: - subs r0, 0x1 - cmp r1, r0 - bge _081C8754 - strh r0, [r4, 0x6] - movs r0, 0x1 - b _081C8756 -_081C8754: - movs r0, 0 -_081C8756: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81C870C - - thumb_func_start sub_81C875C -sub_81C875C: @ 81C875C - push {lr} - bl sub_81C8644 - adds r1, r0, 0 - ldrh r0, [r1] - ldrh r1, [r1, 0x6] - adds r0, r1 - pop {r1} - bx r1 - thumb_func_end sub_81C875C - - thumb_func_start sub_81C8770 -sub_81C8770: @ 81C8770 - push {lr} - bl sub_81C8644 - ldrh r0, [r0] - pop {r1} - bx r1 - thumb_func_end sub_81C8770 - - thumb_func_start sub_81C877C -sub_81C877C: @ 81C877C - push {r4,lr} - movs r0, 0x11 - bl sub_81C763C - adds r4, r0, 0 - ldr r0, =0x0000089c - adds r1, r4, r0 - movs r0, 0 - str r0, [r1] - ldr r0, =sub_81C8870 - movs r1, 0x6 - bl sub_81C7078 - movs r1, 0x8A - lsls r1, 4 - adds r4, r1 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C877C - - thumb_func_start sub_81C87AC -sub_81C87AC: @ 81C87AC - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - movs r0, 0x11 - bl sub_81C763C - adds r5, r0, 0 - ldr r0, =0x00000888 - adds r1, r5, r0 - ldrh r0, [r1] - adds r0, r4 - movs r2, 0 - strh r0, [r1] - ldr r1, =0x0000089c - adds r0, r5, r1 - str r2, [r0] - ldr r0, =sub_81C8958 - movs r1, 0x6 - bl sub_81C7078 - movs r1, 0x8A - lsls r1, 4 - adds r5, r1 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C87AC - - thumb_func_start sub_81C87F0 -sub_81C87F0: @ 81C87F0 - push {r4,lr} - movs r0, 0x11 - bl sub_81C763C - adds r4, r0, 0 - ldr r0, =0x0000089c - adds r1, r4, r0 - movs r0, 0 - str r0, [r1] - ldr r0, =sub_81C8A28 - movs r1, 0x6 - bl sub_81C7078 - movs r1, 0x8A - lsls r1, 4 - adds r4, r1 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C87F0 - - thumb_func_start sub_81C8820 -sub_81C8820: @ 81C8820 - push {lr} - movs r0, 0x11 - bl sub_81C763C - movs r1, 0x8A - lsls r1, 4 - adds r0, r1 - ldr r0, [r0] - bl sub_81C70D8 - pop {r1} - bx r1 - thumb_func_end sub_81C8820 - - thumb_func_start sub_81C8838 -sub_81C8838: @ 81C8838 - push {r4,lr} - movs r0, 0x11 - bl sub_81C763C - adds r4, r0, 0 - ldr r0, =0x00000888 - adds r2, r4, r0 - ldrh r0, [r4, 0x8] - ldrh r1, [r2] - ldrh r3, [r2, 0x6] - adds r1, r3 - ldrh r2, [r4, 0xA] - adds r2, r3 - movs r3, 0xF - ands r2, r3 - ldr r3, [r4, 0x38] - bl _call_via_r3 - ldrb r0, [r4, 0x8] - movs r1, 0x1 - bl CopyWindowToVram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C8838 - - thumb_func_start sub_81C8870 -sub_81C8870: @ 81C8870 - push {r4,r5,lr} - adds r5, r0, 0 - movs r0, 0x11 - bl sub_81C763C - adds r4, r0, 0 - cmp r5, 0x4 - bhi _081C894C - lsls r0, r5, 2 - ldr r1, =_081C8890 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C8890: - .4byte _081C88A4 - .4byte _081C88AC - .4byte _081C88D8 - .4byte _081C8918 - .4byte _081C8938 -_081C88A4: - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81C9008 -_081C88AC: - ldr r0, =0x0000089c - adds r5, r4, r0 - ldr r1, =0x0000088e - adds r0, r4, r1 - ldr r1, [r5] - ldrh r0, [r0] - cmp r1, r0 - beq _081C88C4 - adds r0, r4, 0 - movs r2, 0x1 - bl sub_81C8B70 -_081C88C4: - ldr r0, [r5] - adds r0, 0x1 - str r0, [r5] -_081C88CA: - movs r0, 0 - b _081C894E - .pool -_081C88D8: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _081C8942 - ldr r2, =0x0000089c - adds r0, r4, r2 - subs r2, 0xC - adds r1, r4, r2 - ldr r3, [r0] - ldrh r1, [r1] - cmp r3, r1 - beq _081C88FC - movs r0, 0x6 - b _081C894E - .pool -_081C88FC: - ldr r0, =0x0000088e - adds r1, r4, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _081C88CA - adds r2, r0, 0 - adds r0, r4, 0 - adds r1, r3, 0 - bl sub_81C8B70 - b _081C88CA - .pool -_081C8918: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _081C8942 - ldr r2, =0x0000088e - adds r1, r4, r2 - ldrh r0, [r1] - cmp r0, 0 - beq _081C894C - movs r1, 0 - bl sub_81C84E8 - b _081C88CA - .pool -_081C8938: - bl sub_81C8630 - adds r1, r0, 0 - cmp r1, 0 - beq _081C8946 -_081C8942: - movs r0, 0x2 - b _081C894E -_081C8946: - ldr r2, =0x0000088e - adds r0, r4, r2 - strh r1, [r0] -_081C894C: - movs r0, 0x4 -_081C894E: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81C8870 - - thumb_func_start sub_81C8958 -sub_81C8958: @ 81C8958 - push {r4,r5,lr} - adds r5, r0, 0 - movs r0, 0x11 - bl sub_81C763C - adds r4, r0, 0 - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _081C8972 - movs r0, 0x2 - b _081C8A22 -_081C8972: - cmp r5, 0x7 - bhi _081C8A1C - lsls r0, r5, 2 - ldr r1, =_081C8984 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C8984: - .4byte _081C89A4 - .4byte _081C89B4 - .4byte _081C89BE - .4byte _081C89D0 - .4byte _081C89DA - .4byte _081C89EC - .4byte _081C89F6 - .4byte _081C8A08 -_081C89A4: - ldr r1, =0x00000888 - adds r0, r4, r1 - adds r1, r4, 0 - bl sub_81C8CB4 - b _081C8A20 - .pool -_081C89B4: - adds r0, r4, 0 - movs r1, 0 - bl sub_81C8DBC - b _081C8A20 -_081C89BE: - ldr r1, =0x00000888 - adds r0, r4, r1 - adds r1, r4, 0 - movs r2, 0 - bl sub_81C8E54 - b _081C8A20 - .pool -_081C89D0: - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81C8DBC - b _081C8A20 -_081C89DA: - ldr r1, =0x00000888 - adds r0, r4, r1 - adds r1, r4, 0 - movs r2, 0x1 - bl sub_81C8E54 - b _081C8A20 - .pool -_081C89EC: - adds r0, r4, 0 - movs r1, 0x2 - bl sub_81C8DBC - b _081C8A20 -_081C89F6: - ldr r1, =0x00000888 - adds r0, r4, r1 - adds r1, r4, 0 - movs r2, 0x2 - bl sub_81C8E54 - b _081C8A20 - .pool -_081C8A08: - ldr r1, =0x00000888 - adds r0, r4, r1 - adds r1, r4, 0 - movs r2, 0x3 - bl sub_81C8E54 - b _081C8A20 - .pool -_081C8A1C: - movs r0, 0x4 - b _081C8A22 -_081C8A20: - movs r0, 0 -_081C8A22: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81C8958 - - thumb_func_start sub_81C8A28 -sub_81C8A28: @ 81C8A28 - push {r4-r7,lr} - sub sp, 0x8 - adds r5, r0, 0 - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _081C8AA6 - movs r0, 0x11 - bl sub_81C763C - adds r4, r0, 0 - ldr r0, =0x00000888 - adds r6, r4, r0 - adds r2, r4, 0 - cmp r5, 0x6 - bls _081C8A4C - b _081C8B64 -_081C8A4C: - lsls r0, r5, 2 - ldr r1, =_081C8A60 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C8A60: - .4byte _081C8A7C - .4byte _081C8A88 - .4byte _081C8AE8 - .4byte _081C8AFC - .4byte _081C8B14 - .4byte _081C8B34 - .4byte _081C8B5C -_081C8A7C: - adds r0, r6, 0 - adds r1, r2, 0 - bl sub_81C8D4C - movs r0, 0 - b _081C8B66 -_081C8A88: - ldr r1, =0x0000089c - adds r7, r4, r1 - ldr r0, [r7] - adds r1, r0, 0x1 - str r1, [r7] - movs r3, 0x89 - lsls r3, 4 - adds r0, r4, r3 - ldrh r0, [r0] - cmp r1, r0 - bge _081C8AB0 - adds r0, r2, 0 - movs r2, 0x1 - bl sub_81C8B70 -_081C8AA6: - movs r0, 0x2 - b _081C8B66 - .pool -_081C8AB0: - movs r0, 0 - str r0, [r7] - ldrh r0, [r6, 0x2] - ldrh r1, [r6, 0x8] - cmp r0, r1 - bhi _081C8AC6 - ldrh r0, [r6] - cmp r0, 0 - beq _081C8B52 - adds r4, r0, 0 - b _081C8AD4 -_081C8AC6: - ldrh r1, [r6] - ldrh r0, [r6, 0x8] - adds r4, r1, r0 - ldrh r1, [r6, 0x2] - cmp r4, r1 - ble _081C8B52 - subs r4, r1 -_081C8AD4: - negs r5, r4 - adds r0, r2, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_81C8B70 - strh r4, [r6, 0x6] - str r5, [r7] - movs r0, 0 - b _081C8B66 -_081C8AE8: - ldr r2, =0x0000089c - adds r0, r4, r2 - ldr r0, [r0] - movs r1, 0 - bl sub_81C84E8 - movs r0, 0 - b _081C8B66 - .pool -_081C8AFC: - bl sub_81C8630 - adds r1, r0, 0 - cmp r1, 0 - bne _081C8AA6 - ldr r3, =0x0000089c - adds r0, r4, r3 - str r1, [r0] -_081C8B0C: - movs r0, 0x1 - b _081C8B66 - .pool -_081C8B14: - ldr r0, [r6, 0x10] - ldrh r1, [r6] - ldr r3, =0x0000089c - adds r2, r4, r3 - ldr r2, [r2] - adds r1, r2 - ldr r3, [r6, 0xC] - str r2, [sp] - str r4, [sp, 0x4] - movs r2, 0x1 - bl sub_81C83AC - movs r0, 0 - b _081C8B66 - .pool -_081C8B34: - bl sub_81C83E0 - cmp r0, 0 - bne _081C8AA6 - ldr r0, =0x0000089c - adds r1, r4, r0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - ldrh r1, [r6, 0x2] - cmp r0, r1 - bge _081C8B0C - ldrh r6, [r6, 0x8] - cmp r0, r6 - bge _081C8B0C -_081C8B52: - movs r0, 0x9 - b _081C8B66 - .pool -_081C8B5C: - adds r0, r2, 0 - movs r1, 0 - bl sub_81C9008 -_081C8B64: - movs r0, 0x4 -_081C8B66: - add sp, 0x8 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81C8A28 - - thumb_func_start sub_81C8B70 -sub_81C8B70: @ 81C8B70 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - mov r9, r0 - adds r7, r1, 0 - adds r6, r2, 0 - ldrb r0, [r0, 0x8] - movs r1, 0x7 - bl GetWindowAttribute - mov r10, r0 - mov r1, r9 - ldrb r0, [r1, 0x4] - lsls r3, r0, 6 - ldrh r0, [r1, 0xA] - adds r7, r0, r7 - movs r0, 0xF - ands r7, r0 - adds r0, r7, r6 - cmp r0, 0x10 - bgt _081C8BD4 - ldr r0, =0x11111111 - str r0, [sp] - adds r1, r7, 0 - muls r1, r3 - add r1, r10 - adds r2, r6, 0 - muls r2, r3 - lsrs r2, 2 - ldr r0, =0x001fffff - ands r2, r0 - movs r0, 0x80 - lsls r0, 17 - orrs r2, r0 - mov r0, sp - bl CpuFastSet - mov r1, r9 - ldrb r0, [r1, 0x8] - movs r1, 0x2 - bl CopyWindowToVram - b _081C8C1E - .pool -_081C8BD4: - movs r2, 0x10 - subs r2, r7 - subs r0, r6, r2 - mov r8, r0 - ldr r1, =0x11111111 - str r1, [sp, 0x4] - add r0, sp, 0x4 - adds r1, r7, 0 - muls r1, r3 - add r1, r10 - muls r2, r3 - lsrs r2, 2 - ldr r5, =0x001fffff - ands r2, r5 - movs r4, 0x80 - lsls r4, 17 - orrs r2, r4 - str r3, [sp, 0xC] - bl CpuFastSet - ldr r0, =0x11111111 - str r0, [sp, 0x8] - add r0, sp, 0x8 - ldr r3, [sp, 0xC] - mov r2, r8 - muls r2, r3 - lsrs r2, 2 - ands r2, r5 - orrs r2, r4 - mov r1, r10 - bl CpuFastSet - mov r1, r9 - ldrb r0, [r1, 0x8] - movs r1, 0x2 - bl CopyWindowToVram -_081C8C1E: - subs r6, 0x1 - movs r0, 0x1 - negs r0, r0 - cmp r6, r0 - beq _081C8C40 - movs r5, 0xF - adds r4, r0, 0 -_081C8C2C: - mov r1, r9 - ldrh r0, [r1, 0x8] - adds r1, r7, 0 - bl sub_81CBD48 - adds r7, 0x1 - ands r7, r5 - subs r6, 0x1 - cmp r6, r4 - bne _081C8C2C -_081C8C40: - mov r1, r9 - ldrb r0, [r1, 0x8] - movs r1, 0x1 - bl CopyWindowToVram - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C8B70 - - thumb_func_start sub_81C8C64 -sub_81C8C64: @ 81C8C64 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - ldrb r0, [r5, 0x8] - movs r1, 0 - bl GetWindowAttribute - lsls r0, 24 - lsrs r0, 24 - bl GetBgTilemapBuffer - adds r2, r0, 0 - ldrh r0, [r5, 0xA] - lsls r0, 6 - ldrb r1, [r5, 0x2] - adds r0, r1 - lsls r0, 1 - subs r0, 0x2 - adds r2, r0 - cmp r4, 0 - beq _081C8C98 - ldrb r0, [r5, 0x1] - lsls r0, 12 - ldrh r1, [r5, 0x6] - adds r1, 0x1 - b _081C8C9E -_081C8C98: - ldrb r0, [r5, 0x1] - lsls r0, 12 - ldrh r1, [r5, 0x6] -_081C8C9E: - orrs r0, r1 - lsls r0, 16 - lsrs r1, r0, 16 - strh r1, [r2] - adds r0, r2, 0 - adds r0, 0x40 - strh r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81C8C64 - - thumb_func_start sub_81C8CB4 -sub_81C8CB4: @ 81C8CB4 - push {r4-r6,lr} - sub sp, 0x10 - adds r5, r0, 0 - adds r4, r1, 0 - ldr r1, =gUnknown_0861FBE4 - add r0, sp, 0xC - movs r2, 0x3 - bl memcpy - ldrh r1, [r5] - ldr r0, [r5, 0xC] - muls r1, r0 - ldr r0, [r5, 0x10] - adds r0, r1 - adds r6, r4, 0 - adds r6, 0x48 - ldr r2, [r4, 0x34] - adds r1, r6, 0 - bl _call_via_r2 - ldrh r0, [r4, 0x8] - ldrh r1, [r5] - ldrh r2, [r4, 0xA] - ldr r3, [r4, 0x38] - bl _call_via_r3 - ldrb r0, [r4, 0x8] - ldrh r3, [r4, 0xA] - lsls r3, 20 - lsrs r3, 16 - ldrb r1, [r4, 0x4] - lsls r1, 3 - str r1, [sp] - movs r1, 0x10 - str r1, [sp, 0x4] - movs r1, 0x44 - movs r2, 0 - bl FillWindowPixelRect - ldrb r0, [r4, 0x8] - ldrb r1, [r4, 0x5] - ldrh r3, [r4, 0xA] - lsls r3, 4 - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - add r2, sp, 0xC - str r2, [sp] - movs r2, 0x1 - negs r2, r2 - str r2, [sp, 0x4] - str r6, [sp, 0x8] - movs r2, 0x8 - bl box_print - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81C8C64 - ldrh r0, [r4, 0x8] - ldrh r3, [r4, 0xA] - lsls r3, 1 - ldrb r1, [r4, 0x4] - str r1, [sp] - movs r1, 0x2 - str r1, [sp, 0x4] - movs r1, 0x3 - movs r2, 0 - bl CopyWindowRectToVram - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C8CB4 - - thumb_func_start sub_81C8D4C -sub_81C8D4C: @ 81C8D4C - push {r4,r5,lr} - sub sp, 0xC - adds r4, r1, 0 - ldrh r2, [r0] - ldr r1, [r0, 0xC] - muls r1, r2 - ldr r0, [r0, 0x10] - adds r0, r1 - adds r5, r4, 0 - adds r5, 0x48 - ldr r2, [r4, 0x34] - adds r1, r5, 0 - bl _call_via_r2 - ldrb r0, [r4, 0x8] - ldrh r3, [r4, 0xA] - lsls r3, 20 - lsrs r3, 16 - ldrb r1, [r4, 0x4] - lsls r1, 3 - str r1, [sp] - movs r1, 0x10 - str r1, [sp, 0x4] - movs r1, 0x11 - movs r2, 0 - bl FillWindowPixelRect - ldrb r0, [r4, 0x8] - ldrb r1, [r4, 0x5] - ldrh r2, [r4, 0xA] - lsls r2, 4 - adds r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp] - movs r2, 0xFF - str r2, [sp, 0x4] - movs r2, 0 - str r2, [sp, 0x8] - adds r2, r5, 0 - movs r3, 0x8 - bl Print - adds r0, r4, 0 - movs r1, 0 - bl sub_81C8C64 - ldrb r0, [r4, 0x8] - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81C8D4C - - thumb_func_start sub_81C8DBC -sub_81C8DBC: @ 81C8DBC - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x1C - adds r6, r0, 0 - mov r8, r1 - add r1, sp, 0xC - ldr r0, =gUnknown_0861FBE8 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - add r0, sp, 0x18 - mov r9, r0 - ldr r1, =gUnknown_0861FBF4 - movs r2, 0x3 - bl memcpy - ldrh r4, [r6, 0xA] - mov r1, r8 - lsls r0, r1, 1 - adds r0, 0x1 - adds r4, r0 - movs r0, 0xF - ands r4, r0 - ldrb r0, [r6, 0x8] - lsls r5, r4, 4 - adds r3, r5, 0 - ldrb r1, [r6, 0x4] - str r1, [sp] - movs r1, 0x10 - str r1, [sp, 0x4] - movs r1, 0x11 - movs r2, 0 - bl FillWindowPixelRect - ldrb r0, [r6, 0x8] - movs r1, 0x1 - orrs r5, r1 - mov r2, r9 - str r2, [sp] - subs r1, 0x2 - str r1, [sp, 0x4] - mov r3, r8 - lsls r3, 2 - mov r8, r3 - mov r1, sp - add r1, r8 - adds r1, 0xC - ldr r1, [r1] - str r1, [sp, 0x8] - movs r1, 0x7 - movs r2, 0x2 - adds r3, r5, 0 - bl box_print - ldrh r0, [r6, 0x8] - lsls r4, 1 - ldrb r1, [r6, 0x4] - str r1, [sp] - movs r1, 0x2 - str r1, [sp, 0x4] - movs r2, 0 - adds r3, r4, 0 - bl CopyWindowRectToVram - add sp, 0x1C - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C8DBC - - thumb_func_start sub_81C8E54 -sub_81C8E54: @ 81C8E54 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - adds r7, r1, 0 - adds r1, r2, 0 - ldrh r3, [r7, 0xA] - ldr r2, =gUnknown_0861FBF7 - adds r2, r1, r2 - ldrb r2, [r2] - adds r6, r3, r2 - movs r2, 0xF - ands r6, r2 - ldrh r0, [r0] - bl sub_81CAFD8 - adds r5, r0, 0 - cmp r5, 0 - beq _081C8EC0 - ldrh r0, [r7, 0x8] - lsls r4, r6, 1 - ldrb r3, [r7, 0x4] - subs r3, 0x1 - movs r1, 0x2 - mov r8, r1 - str r1, [sp] - movs r1, 0x1 - adds r2, r4, 0 - bl sub_81DB620 - ldrb r0, [r7, 0x8] - lsls r1, r6, 4 - movs r2, 0x1 - orrs r1, r2 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x7 - adds r2, r5, 0 - movs r3, 0x2 - bl Print - ldrh r0, [r7, 0x8] - ldrb r1, [r7, 0x4] - str r1, [sp] - mov r1, r8 - str r1, [sp, 0x4] - movs r1, 0x2 - movs r2, 0 - adds r3, r4, 0 - bl CopyWindowRectToVram -_081C8EC0: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C8E54 - - thumb_func_start sub_81C8ED0 -sub_81C8ED0: @ 81C8ED0 - push {r4,r5,lr} - movs r5, 0 - ldr r4, =gUnknown_0861FBFC -_081C8ED6: - adds r0, r4, 0 - bl LoadCompressedObjectPic - adds r4, 0x8 - adds r5, 0x1 - cmp r5, 0 - beq _081C8ED6 - ldr r0, =gUnknown_0861FC04 - bl sub_81C795C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C8ED0 - - thumb_func_start sub_81C8EF8 -sub_81C8EF8: @ 81C8EF8 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - adds r4, r0, 0 - adds r5, r1, 0 - ldr r0, =gUnknown_0861FC1C - ldrb r1, [r5, 0x2] - lsls r1, 3 - adds r1, 0x3 - ldrb r2, [r5, 0x3] - adds r2, 0x1 - lsls r2, 3 - movs r3, 0x7 - bl AddObjectToFront - lsls r0, 24 - lsrs r3, r0, 24 - lsls r0, r3, 4 - adds r0, r3 - lsls r0, 2 - ldr r1, =0x02020630 - mov r8, r1 - add r0, r8 - str r0, [r5, 0x3C] - ldrb r6, [r5, 0x2] - lsls r6, 3 - ldrb r0, [r5, 0x4] - subs r0, 0x1 - lsls r0, 2 - ldr r3, =gUnknown_0861FC3C - mov r10, r3 - adds r6, r0 - ldrb r2, [r5, 0x3] - lsls r2, 3 - ldrh r0, [r4, 0x8] - lsls r0, 4 - adds r2, r0 - lsls r2, 16 - asrs r2, 16 - mov r0, r10 - adds r1, r6, 0 - movs r3, 0x7 - bl AddObjectToFront - lsls r0, 24 - lsrs r3, r0, 24 - lsls r2, r3, 4 - adds r2, r3 - lsls r2, 2 - add r2, r8 - str r2, [r5, 0x44] - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x2 - ldr r0, =0x000003ff - mov r9, r0 - mov r0, r9 - ands r1, r0 - ldr r4, =0xfffffc00 - adds r0, r4, 0 - ands r0, r3 - orrs r0, r1 - strh r0, [r2, 0x4] - ldr r1, [r5, 0x44] - ldr r0, =sub_81C90A0 - str r0, [r1, 0x1C] - ldrb r2, [r5, 0x3] - lsls r2, 3 - mov r0, r10 - adds r1, r6, 0 - movs r3, 0x7 - bl AddObjectToFront - lsls r0, 24 - lsrs r3, r0, 24 - lsls r1, r3, 4 - adds r1, r3 - lsls r1, 2 - add r1, r8 - str r1, [r5, 0x40] - ldrh r2, [r1, 0x4] - lsls r0, r2, 22 - lsrs r0, 22 - adds r0, 0x4 - mov r3, r9 - ands r0, r3 - ands r4, r2 - orrs r4, r0 - strh r4, [r1, 0x4] - ldr r1, [r5, 0x40] - ldr r0, =sub_81C90F4 - str r0, [r1, 0x1C] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C8EF8 - - thumb_func_start sub_81C8FE0 -sub_81C8FE0: @ 81C8FE0 - push {r4,lr} - adds r4, r0, 0 - ldr r0, [r4, 0x3C] - bl RemoveObjectAndFreeTiles - ldr r0, [r4, 0x40] - bl RemoveObjectAndFreeTiles - ldr r0, [r4, 0x44] - bl RemoveObjectAndFreeTiles - movs r0, 0xA - bl FreeObjectTilesByTag - movs r0, 0x14 - bl FreeObjectPaletteByTag - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C8FE0 - - thumb_func_start sub_81C9008 -sub_81C9008: @ 81C9008 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - cmp r4, 0 - beq _081C9028 - ldr r2, [r5, 0x3C] - ldr r1, =DummyObjectCallback - str r1, [r2, 0x1C] - ldr r0, [r5, 0x40] - str r1, [r0, 0x1C] - ldr r0, [r5, 0x44] - str r1, [r0, 0x1C] - b _081C903A - .pool -_081C9028: - ldr r2, [r5, 0x3C] - ldr r0, =sub_81C9080 - str r0, [r2, 0x1C] - ldr r1, [r5, 0x40] - ldr r0, =sub_81C90F4 - str r0, [r1, 0x1C] - ldr r1, [r5, 0x44] - ldr r0, =sub_81C90A0 - str r0, [r1, 0x1C] -_081C903A: - adds r3, r2, 0 - adds r3, 0x3E - movs r0, 0x1 - ands r4, r0 - lsls r4, 2 - ldrb r2, [r3] - movs r1, 0x5 - negs r1, r1 - adds r0, r1, 0 - ands r0, r2 - orrs r0, r4 - strb r0, [r3] - ldr r2, [r5, 0x40] - adds r2, 0x3E - ldrb r3, [r2] - adds r0, r1, 0 - ands r0, r3 - orrs r0, r4 - strb r0, [r2] - ldr r0, [r5, 0x44] - adds r0, 0x3E - ldrb r2, [r0] - ands r1, r2 - orrs r1, r4 - strb r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C9008 - - thumb_func_start sub_81C9080 -sub_81C9080: @ 81C9080 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x11 - bl sub_81C763C - ldr r1, =0x0000088e - adds r0, r1 - ldrh r0, [r0] - lsls r0, 4 - strh r0, [r4, 0x26] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C9080 - - thumb_func_start sub_81C90A0 -sub_81C90A0: @ 81C90A0 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081C90C2 - bl sub_81C84C0 - cmp r0, 0 - beq _081C90C2 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - b _081C90CC -_081C90C2: - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 -_081C90CC: - strb r0, [r2] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _081C90EC - movs r0, 0 - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x30] - adds r0, 0x1 - movs r1, 0x7 - ands r0, r1 - strh r0, [r4, 0x30] - strh r0, [r4, 0x26] -_081C90EC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C90A0 - - thumb_func_start sub_81C90F4 -sub_81C90F4: @ 81C90F4 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081C9116 - bl sub_81C84A4 - cmp r0, 0 - beq _081C9116 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - b _081C9120 -_081C9116: - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 -_081C9120: - strb r0, [r2] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _081C9142 - movs r0, 0 - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x30] - adds r0, 0x1 - movs r1, 0x7 - ands r0, r1 - strh r0, [r4, 0x30] - negs r0, r0 - strh r0, [r4, 0x26] -_081C9142: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C90F4 - - thumb_func_start sub_81C9148 -sub_81C9148: @ 81C9148 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x11 - bl sub_81C763C - ldr r1, [r0, 0x40] - strh r4, [r1, 0x3C] - ldr r0, [r0, 0x44] - strh r4, [r0, 0x3C] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C9148 - - thumb_func_start sub_81C9160 -sub_81C9160: @ 81C9160 - push {r4,r5,lr} - adds r2, r0, 0 - ldr r0, [r1] - str r0, [r2, 0x10] - ldrh r4, [r1, 0x6] - movs r5, 0 - strh r4, [r2] - ldrh r3, [r1, 0x4] - strh r3, [r2, 0x2] - ldrb r0, [r1, 0x8] - str r0, [r2, 0xC] - ldrb r1, [r1, 0xC] - strh r1, [r2, 0x8] - lsls r0, r3, 16 - lsrs r0, 16 - cmp r1, r0 - bcc _081C918A - strh r5, [r2] - strh r5, [r2, 0x4] - strh r4, [r2, 0x6] - b _081C91A6 -_081C918A: - subs r0, r3, r1 - strh r0, [r2, 0x4] - ldrh r1, [r2] - ldrh r0, [r2, 0x8] - adds r1, r0 - ldrh r0, [r2, 0x2] - cmp r1, r0 - ble _081C91A4 - subs r0, r1, r0 - strh r0, [r2, 0x6] - subs r0, r4, r0 - strh r0, [r2] - b _081C91A6 -_081C91A4: - strh r5, [r2, 0x6] -_081C91A6: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81C9160 - - thumb_func_start sub_81C91AC -sub_81C91AC: @ 81C91AC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - adds r7, r0, 0 - ldr r4, [r1] - lsls r4, 30 - lsrs r0, r4, 30 - movs r1, 0 - mov r9, r1 - strb r0, [r7] - strh r3, [r7, 0x6] - ldr r0, [r2, 0x10] - str r0, [r7, 0x34] - ldr r0, [r2, 0x14] - str r0, [r7, 0x38] - ldrb r6, [r2, 0xD] - strb r6, [r7, 0x1] - ldrb r1, [r2, 0x9] - strb r1, [r7, 0x2] - ldrb r0, [r2, 0xB] - strb r0, [r7, 0x3] - ldrb r5, [r2, 0xA] - strb r5, [r7, 0x4] - ldrb r0, [r2, 0xE] - strb r0, [r7, 0x5] - lsrs r4, 30 - ldr r2, =0xffffff00 - mov r8, r2 - ldr r0, [sp] - ands r0, r2 - orrs r0, r4 - lsls r1, 24 - lsrs r1, 16 - ldr r2, =0xffff00ff - ands r0, r2 - orrs r0, r1 - ldr r1, =0xff00ffff - ands r0, r1 - lsls r5, 24 - ldr r1, =0x00ffffff - ands r0, r1 - orrs r0, r5 - str r0, [sp] - ldr r0, [sp, 0x4] - mov r1, r8 - ands r0, r1 - movs r1, 0x20 - orrs r0, r1 - lsls r6, 24 - lsrs r6, 16 - ands r0, r2 - orrs r0, r6 - adds r3, 0x2 - lsls r3, 16 - ldr r1, =0x0000ffff - ands r0, r1 - orrs r0, r3 - str r0, [sp, 0x4] - mov r0, sp - bl AddWindow - strh r0, [r7, 0x8] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xFF - beq _081C9258 - mov r2, r9 - strh r2, [r7, 0xA] - mov r0, r9 - str r0, [r7, 0x3C] - str r0, [r7, 0x40] - str r0, [r7, 0x44] - movs r0, 0x1 - b _081C925A - .pool -_081C9258: - movs r0, 0 -_081C925A: - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81C91AC - - thumb_func_start sub_81C9268 -sub_81C9268: @ 81C9268 - push {r4,lr} - movs r4, 0 - movs r0, 0x98 - lsls r0, 1 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _081C928A - movs r4, 0x1 - ldr r0, =0x0000089b - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _081C928A - movs r4, 0x2 -_081C928A: - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81C9268 - - thumb_func_start sub_81C9298 -sub_81C9298: @ 81C9298 - push {r4,lr} - movs r0, 0x1 - movs r1, 0x10 - bl sub_81C761C - adds r4, r0, 0 - cmp r4, 0 - beq _081C92C4 - bl sub_81C9268 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - strh r0, [r4] - strh r1, [r4, 0x2] - strh r1, [r4, 0x4] - strh r1, [r4, 0x6] - adds r0, r4, 0 - bl sub_81C939C - movs r0, 0x1 - b _081C92C6 -_081C92C4: - movs r0, 0 -_081C92C6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81C9298 - - thumb_func_start sub_81C92CC -sub_81C92CC: @ 81C92CC - push {r4,lr} - movs r0, 0x1 - movs r1, 0x10 - bl sub_81C761C - adds r4, r0, 0 - cmp r4, 0 - beq _081C92FA - bl sub_81C9268 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - strh r0, [r4] - movs r0, 0x2 - strh r0, [r4, 0x2] - strh r0, [r4, 0x4] - strh r1, [r4, 0x6] - adds r0, r4, 0 - bl sub_81C939C - movs r0, 0x1 - b _081C92FC -_081C92FA: - movs r0, 0 -_081C92FC: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81C92CC - - thumb_func_start sub_81C9304 -sub_81C9304: @ 81C9304 - push {r4,lr} - movs r0, 0x1 - movs r1, 0x10 - bl sub_81C761C - adds r4, r0, 0 - cmp r4, 0 - beq _081C932E - bl sub_81C9268 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - movs r0, 0x3 - strh r0, [r4, 0x2] - strh r0, [r4, 0x4] - adds r0, r4, 0 - bl sub_81C939C - movs r0, 0x1 - b _081C9330 -_081C932E: - movs r0, 0 -_081C9330: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81C9304 - - thumb_func_start sub_81C9338 -sub_81C9338: @ 81C9338 - push {lr} - movs r0, 0x1 - movs r1, 0x10 - bl sub_81C761C - adds r2, r0, 0 - cmp r2, 0 - beq _081C9360 - movs r0, 0 - movs r1, 0x3 - strh r1, [r2] - strh r0, [r2, 0x2] - movs r1, 0x5 - strh r1, [r2, 0x4] - strh r0, [r2, 0x6] - adds r0, r2, 0 - bl sub_81C939C - movs r0, 0x1 - b _081C9362 -_081C9360: - movs r0, 0 -_081C9362: - pop {r1} - bx r1 - thumb_func_end sub_81C9338 - - thumb_func_start sub_81C9368 -sub_81C9368: @ 81C9368 - push {r4,r5,lr} - movs r0, 0x1 - movs r1, 0x10 - bl sub_81C761C - adds r5, r0, 0 - cmp r5, 0 - beq _081C9394 - movs r4, 0 - movs r0, 0x4 - strh r0, [r5] - bl sub_81C76AC - strh r0, [r5, 0x2] - adds r0, 0x8 - strh r0, [r5, 0x4] - strh r4, [r5, 0x6] - adds r0, r5, 0 - bl sub_81C939C - movs r0, 0x1 - b _081C9396 -_081C9394: - movs r0, 0 -_081C9396: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81C9368 - - thumb_func_start sub_81C939C -sub_81C939C: @ 81C939C - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4] - cmp r0, 0x4 - bhi _081C93E0 - lsls r0, 2 - ldr r1, =_081C93B4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C93B4: - .4byte _081C93C8 - .4byte _081C93CE - .4byte _081C93CE - .4byte _081C93D4 - .4byte _081C93DC -_081C93C8: - movs r0, 0 - bl sub_81C7688 -_081C93CE: - bl sub_81C93EC - b _081C93DE -_081C93D4: - ldr r0, =sub_81C963C - b _081C93DE - .pool -_081C93DC: - ldr r0, =sub_81C96FC -_081C93DE: - str r0, [r4, 0xC] -_081C93E0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C939C - - thumb_func_start sub_81C93EC -sub_81C93EC: @ 81C93EC - push {lr} - bl sub_81C767C - cmp r0, 0x1 - beq _081C9408 - cmp r0, 0x1 - bcc _081C93FE - cmp r0, 0x2 - beq _081C9410 -_081C93FE: - ldr r0, =sub_81C943C - b _081C9412 - .pool -_081C9408: - ldr r0, =sub_81C9520 - b _081C9412 - .pool -_081C9410: - ldr r0, =c2_pre_battle_1 -_081C9412: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81C93EC - - thumb_func_start sub_81C941C -sub_81C941C: @ 81C941C - push {lr} - movs r0, 0x1 - bl sub_81C763C - ldr r1, [r0, 0xC] - bl _call_via_r1 - pop {r1} - bx r1 - thumb_func_end sub_81C941C - - thumb_func_start sub_81C9430 -sub_81C9430: @ 81C9430 - push {lr} - movs r0, 0x1 - bl sub_81C7650 - pop {r0} - bx r0 - thumb_func_end sub_81C9430 - - thumb_func_start sub_81C943C -sub_81C943C: @ 81C943C - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_81C9814 - cmp r0, 0 - beq _081C944C - movs r0, 0x1 - b _081C951A -_081C944C: - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x2E] - movs r0, 0x1 - ands r0, r1 - adds r5, r2, 0 - cmp r0, 0 - beq _081C9508 - ldr r3, =gUnknown_0861FC59 - movs r0, 0x2 - ldrsh r1, [r4, r0] - ldrh r2, [r4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 1 - adds r1, r0 - adds r1, r3 - ldrb r0, [r1] - cmp r0, 0x4 - bhi _081C9508 - lsls r0, 2 - ldr r1, =_081C9488 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C9488: - .4byte _081C949C - .4byte _081C94BC - .4byte _081C94D4 - .4byte _081C94E0 - .4byte _081C9516 -_081C949C: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r1, [r0, 0x15] - movs r0, 0x8 - ands r0, r1 - movs r1, 0x1 - cmp r0, 0 - beq _081C94AE - movs r1, 0x2 -_081C94AE: - strh r1, [r4, 0x6] - ldr r1, =0x000186a6 - b _081C94EE - .pool -_081C94BC: - movs r1, 0 - movs r0, 0x3 - strh r0, [r4] - strh r1, [r4, 0x2] - ldrb r0, [r3, 0x12] - strh r0, [r4, 0x4] - ldr r0, =sub_81C963C - str r0, [r4, 0xC] - movs r0, 0x2 - b _081C951A - .pool -_081C94D4: - movs r0, 0x6 - strh r0, [r4, 0x6] - ldr r1, =0x000186ab - b _081C94EE - .pool -_081C94E0: - bl sub_81C76B8 - cmp r0, 0 - beq _081C94FC - movs r0, 0x9 - strh r0, [r4, 0x6] - ldr r1, =0x000186ac -_081C94EE: - adds r0, r4, 0 - bl sub_81C97B0 - movs r0, 0x8 - b _081C951A - .pool -_081C94FC: - ldr r0, =sub_81C9600 - str r0, [r4, 0xC] - movs r0, 0x6 - b _081C951A - .pool -_081C9508: - ldrh r1, [r5, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _081C9516 - movs r0, 0 - b _081C951A -_081C9516: - movs r0, 0x1 - negs r0, r0 -_081C951A: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81C943C - - thumb_func_start sub_81C9520 -sub_81C9520: @ 81C9520 - push {r4,lr} - adds r4, r0, 0 - bl sub_81C9814 - cmp r0, 0 - beq _081C9530 - movs r0, 0x1 - b _081C9580 -_081C9530: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081C9570 - ldr r3, =gUnknown_0861FC59 - movs r0, 0x2 - ldrsh r1, [r4, r0] - ldrh r2, [r4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 1 - adds r1, r0 - adds r1, r3 - ldrb r0, [r1] - cmp r0, 0x2 - bne _081C9578 - movs r0, 0x6 - strh r0, [r4, 0x6] - ldr r1, =0x000186ab - adds r0, r4, 0 - bl sub_81C97B0 - movs r0, 0x8 - b _081C9580 - .pool -_081C9570: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081C957E -_081C9578: - movs r0, 0x20 - bl audio_play -_081C957E: - movs r0, 0 -_081C9580: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81C9520 - - thumb_func_start c2_pre_battle_1 -c2_pre_battle_1: @ 81C9588 - push {r4,lr} - adds r4, r0, 0 - bl sub_81C9814 - cmp r0, 0 - beq _081C9598 - movs r0, 0x1 - b _081C95F8 -_081C9598: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081C95E8 - ldr r3, =gUnknown_0861FC59 - movs r0, 0x2 - ldrsh r1, [r4, r0] - ldrh r2, [r4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 1 - adds r1, r0 - adds r1, r3 - ldrb r0, [r1] - cmp r0, 0x2 - beq _081C95D4 - cmp r0, 0x4 - beq _081C95F4 - movs r0, 0x20 - bl audio_play - movs r0, 0 - b _081C95F8 - .pool -_081C95D4: - movs r0, 0x6 - strh r0, [r4, 0x6] - ldr r1, =0x000186ab - adds r0, r4, 0 - bl sub_81C97B0 - movs r0, 0x8 - b _081C95F8 - .pool -_081C95E8: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _081C95F4 - movs r0, 0 - b _081C95F8 -_081C95F4: - movs r0, 0x1 - negs r0, r0 -_081C95F8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end c2_pre_battle_1 - - thumb_func_start sub_81C9600 -sub_81C9600: @ 81C9600 - push {r4,lr} - adds r4, r0, 0 - bl sub_81C9814 - cmp r0, 0 - beq _081C9616 - bl sub_81C93EC - str r0, [r4, 0xC] - movs r0, 0x1 - b _081C9634 -_081C9616: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _081C962C - movs r0, 0 - b _081C9634 - .pool -_081C962C: - bl sub_81C93EC - str r0, [r4, 0xC] - movs r0, 0x7 -_081C9634: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81C9600 - - thumb_func_start sub_81C963C -sub_81C963C: @ 81C963C - push {r4-r6,lr} - adds r4, r0, 0 - bl sub_81C9814 - adds r3, r0, 0 - cmp r3, 0 - beq _081C964E - movs r0, 0x1 - b _081C96F6 -_081C964E: - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x2E] - movs r0, 0x1 - ands r0, r1 - adds r6, r2, 0 - cmp r0, 0 - beq _081C96B8 - ldr r5, =gUnknown_0861FC59 - movs r1, 0x2 - ldrsh r0, [r4, r1] - ldrh r2, [r4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 1 - adds r0, r1 - adds r0, r5 - ldrb r0, [r0] - cmp r0, 0x6 - beq _081C968E - cmp r0, 0x6 - bgt _081C9688 - cmp r0, 0x5 - beq _081C96A4 - b _081C96B8 - .pool -_081C9688: - cmp r0, 0x7 - beq _081C96E4 - b _081C96B8 -_081C968E: - movs r0, 0x4 - strh r0, [r4] - strh r3, [r4, 0x2] - ldrb r0, [r5, 0x18] - strh r0, [r4, 0x4] - ldr r0, =sub_81C96FC - str r0, [r4, 0xC] - movs r0, 0x4 - b _081C96F6 - .pool -_081C96A4: - strh r3, [r4, 0x6] - ldr r1, =0x000186a7 - adds r0, r4, 0 - bl sub_81C97B0 - movs r0, 0x8 - b _081C96F6 - .pool -_081C96B8: - ldrh r1, [r6, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081C96F4 - movs r0, 0x2 - ldrsh r2, [r4, r0] - ldr r1, =gUnknown_0861FC54 - ldrh r0, [r4] - adds r0, r1 - ldrb r0, [r0] - cmp r2, r0 - beq _081C96E4 - strh r0, [r4, 0x2] - ldr r0, =sub_81C9798 - str r0, [r4, 0xC] - movs r0, 0x1 - b _081C96F6 - .pool -_081C96E4: - movs r0, 0x5 - bl audio_play - adds r0, r4, 0 - bl sub_81C97C0 - movs r0, 0x3 - b _081C96F6 -_081C96F4: - movs r0, 0 -_081C96F6: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81C963C - - thumb_func_start sub_81C96FC -sub_81C96FC: @ 81C96FC - push {r4,lr} - adds r4, r0, 0 - bl sub_81C9814 - cmp r0, 0 - beq _081C970C - movs r0, 0x1 - b _081C9792 -_081C970C: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081C9754 - ldr r3, =gUnknown_0861FC59 - movs r0, 0x2 - ldrsh r1, [r4, r0] - ldrh r2, [r4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 1 - adds r1, r0 - adds r1, r3 - ldrb r0, [r1] - cmp r0, 0xD - beq _081C9780 - subs r0, 0x8 - bl sub_81C7694 - ldr r1, =0x000186a8 - adds r0, r4, 0 - bl sub_81C97B0 - movs r0, 0x3 - strh r0, [r4, 0x6] - movs r0, 0x8 - b _081C9792 - .pool -_081C9754: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081C9790 - movs r0, 0x2 - ldrsh r2, [r4, r0] - ldr r1, =gUnknown_0861FC54 - ldrh r0, [r4] - adds r0, r1 - ldrb r0, [r0] - cmp r2, r0 - beq _081C9780 - strh r0, [r4, 0x2] - ldr r0, =sub_81C97A4 - str r0, [r4, 0xC] - movs r0, 0x1 - b _081C9792 - .pool -_081C9780: - movs r0, 0x5 - bl audio_play - adds r0, r4, 0 - bl sub_81C97F8 - movs r0, 0x5 - b _081C9792 -_081C9790: - movs r0, 0 -_081C9792: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81C96FC - - thumb_func_start sub_81C9798 -sub_81C9798: @ 81C9798 - push {lr} - bl sub_81C97C0 - movs r0, 0x3 - pop {r1} - bx r1 - thumb_func_end sub_81C9798 - - thumb_func_start sub_81C97A4 -sub_81C97A4: @ 81C97A4 - push {lr} - bl sub_81C97F8 - movs r0, 0x5 - pop {r1} - bx r1 - thumb_func_end sub_81C97A4 - - thumb_func_start sub_81C97B0 -sub_81C97B0: @ 81C97B0 - str r1, [r0, 0x8] - ldr r1, =sub_81C97BC - str r1, [r0, 0xC] - bx lr - .pool - thumb_func_end sub_81C97B0 - - thumb_func_start sub_81C97BC -sub_81C97BC: @ 81C97BC - ldr r0, [r0, 0x8] - bx lr - thumb_func_end sub_81C97BC - - thumb_func_start sub_81C97C0 -sub_81C97C0: @ 81C97C0 - push {r4,lr} - adds r4, r0, 0 - bl sub_81C9268 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - movs r0, 0x1 - strh r0, [r4, 0x2] - ldr r2, =gUnknown_0861FC59 - ldrh r1, [r4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 1 - adds r0, 0x1 - adds r0, r2 - ldrb r0, [r0] - strh r0, [r4, 0x4] - ldr r0, =sub_81C943C - str r0, [r4, 0xC] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C97C0 - - thumb_func_start sub_81C97F8 -sub_81C97F8: @ 81C97F8 - movs r1, 0x3 - strh r1, [r0] - movs r1, 0x1 - strh r1, [r0, 0x2] - ldr r1, =gUnknown_0861FC59 - ldrb r1, [r1, 0x13] - strh r1, [r0, 0x4] - ldr r1, =sub_81C963C - str r1, [r0, 0xC] - bx lr - .pool - thumb_func_end sub_81C97F8 - - thumb_func_start sub_81C9814 -sub_81C9814: @ 81C9814 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x40 - ands r0, r1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0 - beq _081C9848 - ldrh r0, [r4, 0x2] - subs r0, 0x1 - strh r0, [r4, 0x2] - lsls r0, 16 - ldrh r3, [r4] - cmp r0, 0 - bge _081C986A - ldr r0, =gUnknown_0861FC54 - adds r0, r3, r0 - ldrb r0, [r0] - strh r0, [r4, 0x2] - b _081C986A - .pool -_081C9848: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081C988C - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] - movs r0, 0x2 - ldrsh r2, [r4, r0] - ldr r0, =gUnknown_0861FC54 - ldrh r1, [r4] - adds r0, r1, r0 - adds r3, r1, 0 - ldrb r0, [r0] - cmp r2, r0 - ble _081C986A - strh r5, [r4, 0x2] -_081C986A: - ldr r2, =gUnknown_0861FC59 - movs r0, 0x2 - ldrsh r1, [r4, r0] - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 1 - adds r1, r0 - adds r1, r2 - ldrb r0, [r1] - strh r0, [r4, 0x4] - movs r0, 0x1 - b _081C988E - .pool -_081C988C: - movs r0, 0 -_081C988E: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81C9814 - - thumb_func_start sub_81C9894 -sub_81C9894: @ 81C9894 - push {lr} - movs r0, 0x1 - bl sub_81C763C - ldrh r0, [r0] - pop {r1} - bx r1 - thumb_func_end sub_81C9894 - - thumb_func_start sub_81C98A4 -sub_81C98A4: @ 81C98A4 - push {lr} - movs r0, 0x1 - bl sub_81C763C - movs r1, 0x2 - ldrsh r0, [r0, r1] - pop {r1} - bx r1 - thumb_func_end sub_81C98A4 - - thumb_func_start sub_81C98B4 -sub_81C98B4: @ 81C98B4 - push {lr} - movs r0, 0x1 - bl sub_81C763C - ldrh r0, [r0, 0x4] - pop {r1} - bx r1 - thumb_func_end sub_81C98B4 - - thumb_func_start sub_81C98C4 -sub_81C98C4: @ 81C98C4 - push {lr} - movs r0, 0x1 - bl sub_81C763C - ldrh r0, [r0, 0x6] - pop {r1} - bx r1 - thumb_func_end sub_81C98C4 - - thumb_func_start sub_81C98D4 -sub_81C98D4: @ 81C98D4 - push {r4,lr} - movs r4, 0 -_081C98D8: - adds r0, r4, 0 - bl sub_81CB0C8 - ldr r1, =0x02037318 - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1, 0x14] - cmp r0, r1 - bne _081C9914 - adds r0, r4, 0 - bl sub_81CAE08 - cmp r0, 0 - beq _081C9914 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x000009ca - adds r0, r1 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - beq _081C9914 - movs r0, 0x1 - b _081C991C - .pool -_081C9914: - adds r4, 0x1 - cmp r4, 0x4D - ble _081C98D8 - movs r0, 0 -_081C991C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81C98D4 - - thumb_func_start sub_81C9924 -sub_81C9924: @ 81C9924 - push {lr} - bl sub_81C9958 - adds r1, r0, 0 - cmp r1, 0 - beq _081C9938 - movs r0, 0 - strb r0, [r1, 0xD] - movs r0, 0x1 - b _081C993A -_081C9938: - movs r0, 0 -_081C993A: - pop {r1} - bx r1 - thumb_func_end sub_81C9924 - - thumb_func_start sub_81C9940 -sub_81C9940: @ 81C9940 - push {lr} - bl sub_81C9958 - adds r1, r0, 0 - cmp r1, 0 - beq _081C9952 - movs r0, 0x1 - strb r0, [r1, 0xD] - b _081C9954 -_081C9952: - movs r0, 0 -_081C9954: - pop {r1} - bx r1 - thumb_func_end sub_81C9940 - - thumb_func_start sub_81C9958 -sub_81C9958: @ 81C9958 - push {r4,lr} - ldr r1, =0x0000088c - movs r0, 0x2 - bl sub_81C761C - adds r4, r0, 0 - cmp r4, 0 - beq _081C997A - movs r0, 0 - strb r0, [r4, 0xC] - ldr r0, =sub_81C9A10 - movs r1, 0x1 - bl sub_81C7078 - str r0, [r4, 0x4] - ldr r0, =sub_81C99FC - str r0, [r4] -_081C997A: - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81C9958 - - thumb_func_start sub_81C9990 -sub_81C9990: @ 81C9990 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x2 - bl sub_81C763C - adds r5, r0, 0 - ldr r0, =gUnknown_086201A0 - lsls r4, 2 - adds r4, r0 - ldr r0, [r4] - movs r1, 0x1 - bl sub_81C7078 - str r0, [r5, 0x4] - ldr r0, =sub_81C99FC - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C9990 - - thumb_func_start sub_81C99C0 -sub_81C99C0: @ 81C99C0 - push {lr} - movs r0, 0x2 - bl sub_81C763C - ldr r0, [r0] - bl _call_via_r0 - pop {r1} - bx r1 - thumb_func_end sub_81C99C0 - - thumb_func_start sub_81C99D4 -sub_81C99D4: @ 81C99D4 - push {r4,lr} - movs r0, 0x2 - bl sub_81C763C - adds r4, r0, 0 - bl sub_81CA7F4 - ldrb r0, [r4, 0x8] - bl RemoveWindow - bl sub_81C9FEC - bl sub_81CA994 - movs r0, 0x2 - bl sub_81C7650 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C99D4 - - thumb_func_start sub_81C99FC -sub_81C99FC: @ 81C99FC - push {lr} - movs r0, 0x2 - bl sub_81C763C - ldr r0, [r0, 0x4] - bl sub_81C70D8 - pop {r1} - bx r1 - thumb_func_end sub_81C99FC - - thumb_func_start sub_81C9A10 -sub_81C9A10: @ 81C9A10 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - movs r0, 0x2 - bl sub_81C763C - adds r5, r0, 0 - cmp r4, 0x9 - bls _081C9A24 - b _081C9C60 -_081C9A24: - lsls r0, r4, 2 - ldr r1, =_081C9A34 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C9A34: - .4byte _081C9A5C - .4byte _081C9AEC - .4byte _081C9B30 - .4byte _081C9B88 - .4byte _081C9B9E - .4byte _081C9BA4 - .4byte _081C9BB6 - .4byte _081C9BC0 - .4byte _081C9C0E - .4byte _081C9C4C -_081C9A5C: - ldr r0, =gUnknown_08620194 - movs r1, 0x3 - bl sub_81C7B54 - ldr r1, =gUnknown_08DC90E0 - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - adds r1, r5, 0 - adds r1, 0x8C - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, =gUnknown_08DC9130 - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - ldr r0, =gUnknown_08DC90C0 - movs r1, 0x10 - movs r2, 0x20 - bl sub_81C7944 - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgY -_081C9AD6: - movs r0, 0 - b _081C9C62 - .pool -_081C9AEC: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _081C9AFA - b _081C9C5C -_081C9AFA: - ldr r1, =gUnknown_0861FD6C - str r0, [sp] - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r1, =gUnknown_0861FFF4 - movs r0, 0x1 - str r0, [sp] - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r0, =gUnknown_0861FD4C - movs r1, 0x20 - movs r2, 0x20 - bl sub_81C7944 - b _081C9AD6 - .pool -_081C9B30: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _081C9B3E - b _081C9C5C -_081C9B3E: - ldr r1, =gUnknown_0861FC98 - str r0, [sp] - movs r0, 0x3 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r1, =gUnknown_0861FCAC - movs r0, 0x1 - str r0, [sp] - movs r0, 0x3 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r0, =gUnknown_0861FC78 - movs r1, 0x30 - movs r2, 0x20 - bl sub_81C7944 - bl sub_81C9894 - cmp r0, 0x3 - beq _081C9B76 - bl sub_81C9894 - cmp r0, 0x4 - bne _081C9AD6 -_081C9B76: - bl sub_81CA850 - b _081C9AD6 - .pool -_081C9B88: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - bne _081C9C5C - bl sub_81CA6E0 - bl sub_81CA7D4 -_081C9B9A: - movs r0, 0x1 - b _081C9C62 -_081C9B9E: - bl sub_81C9FC4 - b _081C9B9A -_081C9BA4: - bl sub_81CA714 - bl sub_81CA02C - bl sub_81CA640 - bl sub_81CA0C8 - b _081C9AD6 -_081C9BB6: - bl sub_81CA7C4 - cmp r0, 0 - bne _081C9C5C - b _081C9B9A -_081C9BC0: - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - ldrb r0, [r5, 0xD] - cmp r0, 0 - beq _081C9BE0 - movs r0, 0x1 - bl sub_81C7AC0 - b _081C9BEC -_081C9BE0: - movs r0, 0x6E - bl audio_play - movs r0, 0x3 - bl sub_81C7AC0 -_081C9BEC: - bl sub_81C9894 - cmp r0, 0x3 - beq _081C9BFE - cmp r0, 0x4 - bne _081C9C06 - movs r0, 0x7 - bl sub_81C7DFC -_081C9BFE: - movs r0, 0x1 - bl sub_81C7DFC - b _081C9AD6 -_081C9C06: - movs r0, 0 - bl sub_81C7DFC - b _081C9AD6 -_081C9C0E: - bl sub_81C7B34 - cmp r0, 0 - bne _081C9C5C - bl sub_81C9894 - cmp r0, 0x3 - beq _081C9C2C - cmp r0, 0x4 - bne _081C9C38 - movs r0, 0x7 - movs r1, 0 - movs r2, 0 - bl sub_81C7FA0 -_081C9C2C: - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl sub_81C7FA0 - b _081C9C42 -_081C9C38: - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl sub_81C7FA0 -_081C9C42: - bl sub_81CA20C - bl titlescreen_0 - b _081C9B9A -_081C9C4C: - bl sub_81CA324 - cmp r0, 0 - bne _081C9C5C - bl sub_81C8010 - cmp r0, 0 - beq _081C9C60 -_081C9C5C: - movs r0, 0x2 - b _081C9C62 -_081C9C60: - movs r0, 0x4 -_081C9C62: - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81C9A10 - - thumb_func_start sub_81C9C6C -sub_81C9C6C: @ 81C9C6C - push {lr} - cmp r0, 0 - beq _081C9C78 - cmp r0, 0x1 - beq _081C9C8E - b _081C9CA2 -_081C9C78: - bl sub_81CAA3C - bl sub_81CA278 - bl sub_81CA714 - movs r0, 0x5 - bl audio_play - movs r0, 0 - b _081C9CA4 -_081C9C8E: - bl sub_81CA324 - cmp r0, 0 - bne _081C9C9E - bl sub_81CA7C4 - cmp r0, 0 - beq _081C9CA2 -_081C9C9E: - movs r0, 0x2 - b _081C9CA4 -_081C9CA2: - movs r0, 0x4 -_081C9CA4: - pop {r1} - bx r1 - thumb_func_end sub_81C9C6C - - thumb_func_start sub_81C9CA8 -sub_81C9CA8: @ 81C9CA8 - push {lr} - cmp r0, 0x1 - beq _081C9CDC - cmp r0, 0x1 - bgt _081C9CB8 - cmp r0, 0 - beq _081C9CC2 - b _081C9D3C -_081C9CB8: - cmp r0, 0x2 - beq _081C9CFA - cmp r0, 0x3 - beq _081C9D14 - b _081C9D3C -_081C9CC2: - bl sub_81CA9C8 - bl sub_81CA2DC - movs r0, 0 - movs r1, 0 - bl sub_81C7FC4 - movs r0, 0x5 - bl audio_play - movs r0, 0 - b _081C9D3E -_081C9CDC: - bl sub_81CA324 - cmp r0, 0 - bne _081C9D34 - bl sub_81C8010 - cmp r0, 0 - bne _081C9D34 - bl sub_81CA0C8 - movs r0, 0x1 - bl sub_81C7DFC - movs r0, 0 - b _081C9D3E -_081C9CFA: - bl sub_81CA20C - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl sub_81C7FA0 - bl sub_81CA818 - bl sub_81CA714 - movs r0, 0 - b _081C9D3E -_081C9D14: - bl sub_81CA324 - cmp r0, 0 - bne _081C9D34 - bl sub_81C8010 - cmp r0, 0 - bne _081C9D34 - bl sub_81CA89C - cmp r0, 0 - bne _081C9D34 - bl sub_81CA7C4 - cmp r0, 0 - beq _081C9D38 -_081C9D34: - movs r0, 0x2 - b _081C9D3E -_081C9D38: - bl sub_81CA9D8 -_081C9D3C: - movs r0, 0x4 -_081C9D3E: - pop {r1} - bx r1 - thumb_func_end sub_81C9CA8 - - thumb_func_start sub_81C9D44 -sub_81C9D44: @ 81C9D44 - push {lr} - cmp r0, 0x1 - beq _081C9D72 - cmp r0, 0x1 - bgt _081C9D54 - cmp r0, 0 - beq _081C9D5E - b _081C9DD2 -_081C9D54: - cmp r0, 0x2 - beq _081C9D90 - cmp r0, 0x3 - beq _081C9DAA - b _081C9DD2 -_081C9D5E: - bl sub_81CA9C8 - bl sub_81CA2DC - movs r0, 0x1 - movs r1, 0 - bl sub_81C7FC4 - movs r0, 0 - b _081C9DD4 -_081C9D72: - bl sub_81CA324 - cmp r0, 0 - bne _081C9DCA - bl sub_81C8010 - cmp r0, 0 - bne _081C9DCA - bl sub_81CA0C8 - movs r0, 0 - bl sub_81C7DFC - movs r0, 0 - b _081C9DD4 -_081C9D90: - bl sub_81CA20C - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl sub_81C7FA0 - bl sub_81CA864 - bl sub_81CA714 - movs r0, 0 - b _081C9DD4 -_081C9DAA: - bl sub_81CA324 - cmp r0, 0 - bne _081C9DCA - bl sub_81C8010 - cmp r0, 0 - bne _081C9DCA - bl sub_81CA89C - cmp r0, 0 - bne _081C9DCA - bl sub_81CA7C4 - cmp r0, 0 - beq _081C9DCE -_081C9DCA: - movs r0, 0x2 - b _081C9DD4 -_081C9DCE: - bl sub_81CA9D8 -_081C9DD2: - movs r0, 0x4 -_081C9DD4: - pop {r1} - bx r1 - thumb_func_end sub_81C9D44 - - thumb_func_start sub_81C9DD8 -sub_81C9DD8: @ 81C9DD8 - push {lr} - cmp r0, 0x1 - beq _081C9E04 - cmp r0, 0x1 - bgt _081C9DE8 - cmp r0, 0 - beq _081C9DF2 - b _081C9E50 -_081C9DE8: - cmp r0, 0x2 - beq _081C9E1A - cmp r0, 0x3 - beq _081C9E30 - b _081C9E50 -_081C9DF2: - bl sub_81CA9C8 - bl sub_81CA2DC - movs r0, 0x5 - bl audio_play - movs r0, 0 - b _081C9E52 -_081C9E04: - bl sub_81CA324 - cmp r0, 0 - bne _081C9E48 - movs r0, 0x7 - bl sub_81C7DFC - bl sub_81CA0C8 - movs r0, 0 - b _081C9E52 -_081C9E1A: - bl sub_81CA20C - movs r0, 0x7 - movs r1, 0 - movs r2, 0 - bl sub_81C7FA0 - bl sub_81CA714 - movs r0, 0 - b _081C9E52 -_081C9E30: - bl sub_81CA324 - cmp r0, 0 - bne _081C9E48 - bl sub_81C8010 - cmp r0, 0 - bne _081C9E48 - bl sub_81CA89C - cmp r0, 0 - beq _081C9E4C -_081C9E48: - movs r0, 0x2 - b _081C9E52 -_081C9E4C: - bl sub_81CA9D8 -_081C9E50: - movs r0, 0x4 -_081C9E52: - pop {r1} - bx r1 - thumb_func_end sub_81C9DD8 - - thumb_func_start sub_81C9E58 -sub_81C9E58: @ 81C9E58 - push {lr} - cmp r0, 0x1 - beq _081C9E86 - cmp r0, 0x1 - bgt _081C9E68 - cmp r0, 0 - beq _081C9E72 - b _081C9EC2 -_081C9E68: - cmp r0, 0x2 - beq _081C9E9E - cmp r0, 0x3 - beq _081C9EAA - b _081C9EC2 -_081C9E72: - bl sub_81CA9C8 - bl sub_81CA2DC - movs r0, 0x7 - movs r1, 0 - bl sub_81C7FC4 - movs r0, 0 - b _081C9EC4 -_081C9E86: - bl sub_81CA324 - cmp r0, 0 - bne _081C9EBA - bl sub_81C8010 - cmp r0, 0 - bne _081C9EBA - bl sub_81CA0C8 - movs r0, 0 - b _081C9EC4 -_081C9E9E: - bl sub_81CA20C - bl sub_81CA714 - movs r0, 0 - b _081C9EC4 -_081C9EAA: - bl sub_81CA324 - cmp r0, 0 - bne _081C9EBA - bl sub_81CA89C - cmp r0, 0 - beq _081C9EBE -_081C9EBA: - movs r0, 0x2 - b _081C9EC4 -_081C9EBE: - bl sub_81CA9D8 -_081C9EC2: - movs r0, 0x4 -_081C9EC4: - pop {r1} - bx r1 - thumb_func_end sub_81C9E58 - - thumb_func_start sub_81C9EC8 -sub_81C9EC8: @ 81C9EC8 - push {lr} - cmp r0, 0 - beq _081C9ED4 - cmp r0, 0x1 - beq _081C9EE2 - b _081C9EF0 -_081C9ED4: - movs r0, 0x20 - bl audio_play - bl sub_81CA770 - movs r0, 0 - b _081C9EF2 -_081C9EE2: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _081C9EF0 - movs r0, 0x2 - b _081C9EF2 -_081C9EF0: - movs r0, 0x4 -_081C9EF2: - pop {r1} - bx r1 - thumb_func_end sub_81C9EC8 - - thumb_func_start sub_81C9EF8 -sub_81C9EF8: @ 81C9EF8 - push {lr} - cmp r0, 0 - beq _081C9F04 - cmp r0, 0x1 - beq _081C9F12 - b _081C9F20 -_081C9F04: - movs r0, 0x5 - bl audio_play - bl sub_81CA714 - movs r0, 0 - b _081C9F22 -_081C9F12: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _081C9F20 - movs r0, 0x2 - b _081C9F22 -_081C9F20: - movs r0, 0x4 -_081C9F22: - pop {r1} - bx r1 - thumb_func_end sub_81C9EF8 - - thumb_func_start sub_81C9F28 -sub_81C9F28: @ 81C9F28 - push {lr} - cmp r0, 0x1 - beq _081C9F52 - cmp r0, 0x1 - bgt _081C9F38 - cmp r0, 0 - beq _081C9F42 - b _081C9FBC -_081C9F38: - cmp r0, 0x2 - beq _081C9F96 - cmp r0, 0x3 - beq _081C9FB0 - b _081C9FBC -_081C9F42: - bl sub_81C98C4 - lsls r0, 16 - lsrs r0, 16 - bl sub_81C7BA4 - movs r0, 0 - b _081C9FBE -_081C9F52: - bl sub_81C7BE8 - cmp r0, 0 - bne _081C9FB8 - bl sub_81C7880 - bl sub_81CA9C8 - bl sub_81CA2DC - bl sub_81C9894 - cmp r0, 0x3 - beq _081C9F7A - cmp r0, 0x4 - bne _081C9F84 - movs r0, 0x7 - movs r1, 0 - bl sub_81C7FC4 -_081C9F7A: - movs r0, 0x1 - movs r1, 0 - bl sub_81C7FC4 - b _081C9F8C -_081C9F84: - movs r0, 0 - movs r1, 0 - bl sub_81C7FC4 -_081C9F8C: - movs r0, 0x5 - bl audio_play - movs r0, 0 - b _081C9FBE -_081C9F96: - bl sub_81CA324 - cmp r0, 0 - bne _081C9FB8 - bl sub_81C8010 - cmp r0, 0 - bne _081C9FB8 - movs r0, 0 - bl sub_81C7AC0 - movs r0, 0 - b _081C9FBE -_081C9FB0: - bl sub_81C7B34 - cmp r0, 0 - beq _081C9FBC -_081C9FB8: - movs r0, 0x2 - b _081C9FBE -_081C9FBC: - movs r0, 0x4 -_081C9FBE: - pop {r1} - bx r1 - thumb_func_end sub_81C9F28 - - thumb_func_start sub_81C9FC4 -sub_81C9FC4: @ 81C9FC4 - push {r4,r5,lr} - movs r5, 0 - ldr r4, =gUnknown_086201C4 -_081C9FCA: - adds r0, r4, 0 - bl LoadCompressedObjectPic - adds r4, 0x8 - adds r5, 0x1 - cmp r5, 0x1 - bls _081C9FCA - ldr r0, =gUnknown_086201D4 - bl sub_81C795C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C9FC4 - - thumb_func_start sub_81C9FEC -sub_81C9FEC: @ 81C9FEC - push {lr} - movs r0, 0x3 - bl FreeObjectTilesByTag - movs r0, 0x1 - bl FreeObjectTilesByTag - movs r0, 0x4 - bl FreeObjectPaletteByTag - movs r0, 0x5 - bl FreeObjectPaletteByTag - movs r0, 0x6 - bl FreeObjectPaletteByTag - movs r0, 0x7 - bl FreeObjectPaletteByTag - movs r0, 0x8 - bl FreeObjectPaletteByTag - movs r0, 0x3 - bl FreeObjectPaletteByTag - bl sub_81CA094 - bl sub_81CA698 - pop {r0} - bx r0 - thumb_func_end sub_81C9FEC - - thumb_func_start sub_81CA02C -sub_81CA02C: @ 81CA02C - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r0, 0x2 - bl sub_81C763C - movs r2, 0 - adds r0, 0x2C - mov r8, r0 -_081CA03E: - movs r4, 0 - lsls r0, r2, 2 - lsls r1, r2, 4 - adds r7, r2, 0x1 - adds r0, r2 - lsls r0, 18 - movs r2, 0xA0 - lsls r2, 14 - adds r5, r0, r2 - mov r0, r8 - adds r6, r1, r0 -_081CA054: - ldr r0, =gUnknown_0862034C - movs r1, 0x8C - asrs r2, r5, 16 - movs r3, 0x3 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - stm r6!, {r1} - lsls r0, r4, 5 - strh r0, [r1, 0x24] - adds r4, 0x1 - cmp r4, 0x3 - ble _081CA054 - adds r2, r7, 0 - cmp r2, 0x5 - ble _081CA03E - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CA02C - - thumb_func_start sub_81CA094 -sub_81CA094: @ 81CA094 - push {r4-r7,lr} - movs r0, 0x2 - bl sub_81C763C - movs r1, 0 - adds r7, r0, 0 - adds r7, 0x2C -_081CA0A2: - lsls r0, r1, 4 - adds r6, r1, 0x1 - adds r4, r0, r7 - movs r5, 0x3 -_081CA0AA: - ldr r0, [r4] - bl obj_free_rotscale_entry - ldm r4!, {r0} - bl RemoveObjectAndFreeTiles - subs r5, 0x1 - cmp r5, 0 - bge _081CA0AA - adds r1, r6, 0 - cmp r1, 0x5 - ble _081CA0A2 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81CA094 - - thumb_func_start sub_81CA0C8 -sub_81CA0C8: @ 81CA0C8 - push {lr} - bl sub_81C9894 - lsls r2, r0, 3 - subs r2, r0 - lsls r2, 2 - ldr r1, =gUnknown_08620244 - adds r0, r2, r1 - subs r1, 0x4 - adds r2, r1 - ldrh r1, [r2] - ldrh r2, [r2, 0x2] - bl sub_81CA0EC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CA0C8 - - thumb_func_start sub_81CA0EC -sub_81CA0EC: @ 81CA0EC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - adds r6, r0, 0 - str r1, [sp, 0x14] - str r2, [sp] - movs r0, 0x2 - bl sub_81C763C - mov r10, r0 - movs r0, 0x3 - bl GetObjectTileRangeStartByTag - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x4] - movs r1, 0 -_081CA114: - ldr r0, [r6] - cmp r0, 0 - beq _081CA1B0 - movs r5, 0 - lsls r2, r1, 4 - mov r0, r10 - adds r0, 0x2C - lsls r3, r1, 2 - mov r9, r3 - movs r4, 0x10 - add r4, r10 - mov r8, r4 - adds r7, r6, 0x4 - str r7, [sp, 0xC] - ldr r3, [sp, 0x14] - ldr r4, [sp] - adds r3, r4 - str r3, [sp, 0x8] - adds r1, 0x1 - str r1, [sp, 0x10] - adds r4, r2, r0 -_081CA13E: - ldr r3, [r4] - ldr r0, [r6] - ldrh r2, [r0] - ldr r7, [sp, 0x4] - adds r2, r7 - lsls r0, r5, 3 - adds r2, r0 - ldr r1, =0x000003ff - adds r0, r1, 0 - ands r2, r0 - ldrh r0, [r3, 0x4] - ldr r7, =0xfffffc00 - adds r1, r7, 0 - ands r0, r1 - orrs r0, r2 - strh r0, [r3, 0x4] - ldr r0, [r6] - ldrh r0, [r0, 0x2] - adds r0, 0x4 - lsls r0, 16 - lsrs r0, 16 - bl IndexOfObjectPaletteTag - ldr r3, [r4] - lsls r0, 4 - ldrb r2, [r3, 0x5] - movs r1, 0xF - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x5] - ldr r2, [r4] - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, [r4] - mov r1, sp - ldrh r1, [r1, 0x14] - strh r1, [r0, 0x22] - ldr r1, [r4] - movs r0, 0x8C - strh r0, [r1, 0x20] - ldm r4!, {r1} - lsls r0, r5, 5 - strh r0, [r1, 0x24] - adds r5, 0x1 - cmp r5, 0x3 - ble _081CA13E - mov r1, r8 - add r1, r9 - movs r0, 0x1 - b _081CA1EC - .pool -_081CA1B0: - lsls r2, r1, 4 - mov r0, r10 - adds r0, 0x2C - lsls r3, r1, 2 - mov r9, r3 - movs r4, 0x10 - add r4, r10 - mov r8, r4 - adds r6, 0x4 - str r6, [sp, 0xC] - ldr r7, [sp, 0x14] - ldr r3, [sp] - adds r7, r3 - str r7, [sp, 0x8] - adds r1, 0x1 - str r1, [sp, 0x10] - movs r3, 0x4 - adds r2, r0 - movs r5, 0x3 -_081CA1D6: - ldm r2!, {r1} - adds r1, 0x3E - ldrb r0, [r1] - orrs r0, r3 - strb r0, [r1] - subs r5, 0x1 - cmp r5, 0 - bge _081CA1D6 - mov r1, r8 - add r1, r9 - movs r0, 0 -_081CA1EC: - str r0, [r1] - ldr r6, [sp, 0xC] - ldr r4, [sp, 0x8] - str r4, [sp, 0x14] - ldr r1, [sp, 0x10] - cmp r1, 0x5 - ble _081CA114 - 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_81CA0EC - - thumb_func_start sub_81CA20C -sub_81CA20C: @ 81CA20C - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r0, 0x2 - bl sub_81C763C - adds r6, r0, 0 - bl sub_81C98A4 - mov r8, r0 - movs r7, 0 - movs r5, 0 - adds r4, r6, 0 - adds r4, 0x2C -_081CA228: - lsls r0, r5, 2 - adds r1, r6, 0 - adds r1, 0x10 - adds r1, r0 - ldr r0, [r1] - cmp r0, 0 - beq _081CA25C - adds r0, r7, 0 - adds r7, 0x1 - cmp r0, r8 - bne _081CA244 - movs r2, 0x82 - strb r5, [r6, 0xB] - b _081CA246 -_081CA244: - movs r2, 0x8C -_081CA246: - adds r0, r4, 0 - movs r1, 0x80 - lsls r1, 1 - movs r3, 0xC - bl sub_81CA35C - adds r0, r4, 0 - movs r1, 0 - bl sub_81CA448 - b _081CA264 -_081CA25C: - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81CA448 -_081CA264: - adds r4, 0x10 - adds r5, 0x1 - cmp r5, 0x5 - ble _081CA228 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81CA20C - - thumb_func_start sub_81CA278 -sub_81CA278: @ 81CA278 - push {r4,r5,lr} - movs r0, 0x2 - bl sub_81C763C - adds r4, r0, 0 - bl sub_81C98A4 - adds r3, r0, 0 - movs r2, 0 - movs r5, 0 - ldr r0, [r4, 0x10] - cmp r0, 0 - beq _081CA298 - cmp r5, r3 - beq _081CA2B2 -_081CA296: - adds r5, 0x1 -_081CA298: - adds r2, 0x1 - cmp r2, 0x5 - bgt _081CA2B2 - lsls r0, r2, 2 - adds r1, r4, 0 - adds r1, 0x10 - adds r1, r0 - ldr r0, [r1] - cmp r0, 0 - beq _081CA298 - cmp r5, r3 - bne _081CA296 - adds r5, r2, 0 -_081CA2B2: - ldrb r0, [r4, 0xB] - lsls r0, 4 - adds r0, 0x2C - adds r0, r4, r0 - movs r1, 0x82 - movs r2, 0x8C - movs r3, 0x4 - bl sub_81CA35C - lsls r0, r5, 4 - adds r0, 0x2C - adds r0, r4, r0 - movs r1, 0x8C - movs r2, 0x82 - movs r3, 0x4 - bl sub_81CA35C - strb r5, [r4, 0xB] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81CA278 - - thumb_func_start sub_81CA2DC -sub_81CA2DC: @ 81CA2DC - push {r4-r6,lr} - movs r0, 0x2 - bl sub_81C763C - adds r6, r0, 0 - movs r5, 0 - adds r4, r6, 0 - adds r4, 0x2C -_081CA2EC: - lsls r0, r5, 2 - adds r1, r6, 0 - adds r1, 0x10 - adds r1, r0 - ldr r0, [r1] - cmp r0, 0 - beq _081CA316 - ldrb r0, [r6, 0xB] - cmp r0, r5 - beq _081CA310 - adds r0, r4, 0 - movs r1, 0x8C - movs r2, 0x80 - lsls r2, 1 - movs r3, 0x8 - bl sub_81CA35C - b _081CA316 -_081CA310: - adds r0, r4, 0 - bl sub_81CA3B4 -_081CA316: - adds r4, 0x10 - adds r5, 0x1 - cmp r5, 0x5 - ble _081CA2EC - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81CA2DC - - thumb_func_start sub_81CA324 -sub_81CA324: @ 81CA324 - push {r4,lr} - movs r0, 0x2 - bl sub_81C763C - adds r3, r0, 0 - movs r2, 0 - ldr r4, =DummyObjectCallback - adds r1, r3, 0 - adds r1, 0x2C -_081CA336: - ldr r0, [r1] - ldr r0, [r0, 0x1C] - cmp r0, r4 - bne _081CA354 - adds r1, 0x10 - adds r2, 0x1 - cmp r2, 0x5 - ble _081CA336 - ldrb r0, [r3, 0xC] - cmp r0, 0 - bne _081CA354 - movs r0, 0 - b _081CA356 - .pool -_081CA354: - movs r0, 0x1 -_081CA356: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CA324 - - thumb_func_start sub_81CA35C -sub_81CA35C: @ 81CA35C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r4, r0, 0 - adds r5, r1, 0 - mov r9, r2 - adds r6, r3, 0 - ldr r0, =sub_81CA474 - mov r8, r0 - subs r0, r2, r5 - lsls r0, 4 - adds r1, r6, 0 - bl __divsi3 - adds r3, r0, 0 - movs r1, 0x3 - lsls r2, r5, 4 -_081CA380: - ldr r0, [r4] - strh r5, [r0, 0x20] - ldr r0, [r4] - strh r6, [r0, 0x2E] - ldr r0, [r4] - strh r3, [r0, 0x30] - ldr r0, [r4] - strh r2, [r0, 0x32] - ldr r0, [r4] - mov r7, r9 - strh r7, [r0, 0x3C] - ldm r4!, {r0} - mov r7, r8 - str r7, [r0, 0x1C] - subs r1, 0x1 - cmp r1, 0 - bge _081CA380 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CA35C - - thumb_func_start sub_81CA3B4 -sub_81CA3B4: @ 81CA3B4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - movs r0, 0x2 - bl sub_81C763C - adds r7, r0, 0 - movs r5, 0 - mov r8, r5 -_081CA3C8: - ldr r2, [r4] - ldrb r1, [r2, 0x1] - movs r3, 0xD - negs r3, r3 - adds r0, r3, 0 - ands r1, r0 - movs r0, 0x4 - orrs r1, r0 - strb r1, [r2, 0x1] - ldr r2, [r4] - ldrb r0, [r2, 0x1] - movs r1, 0x3 - orrs r0, r1 - strb r0, [r2, 0x1] - ldr r1, [r4] - ldr r0, =sub_81CA4AC - str r0, [r1, 0x1C] - movs r6, 0x8 - strh r6, [r1, 0x2E] - ldr r0, [r4] - mov r1, r8 - strh r1, [r0, 0x30] - ldr r0, [r4] - strh r5, [r0, 0x3C] - ldr r0, [r4] - bl obj_alloc_rotscale_entry - ldm r4!, {r0} - movs r1, 0 - bl StartObjectRotScalAnim - adds r5, 0x1 - cmp r5, 0x3 - ble _081CA3C8 - movs r0, 0x52 - movs r1, 0x10 - bl SetGpuReg - ldr r0, =sub_81CA580 - movs r1, 0x3 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r6, [r1, 0x8] - ldrb r0, [r7, 0xC] - adds r0, 0x1 - strb r0, [r7, 0xC] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CA3B4 - - thumb_func_start sub_81CA448 -sub_81CA448: @ 81CA448 - push {r4-r6,lr} - adds r5, r0, 0 - movs r0, 0x1 - ands r1, r0 - lsls r4, r1, 2 - movs r6, 0x5 - negs r6, r6 - movs r3, 0x3 -_081CA458: - ldm r5!, {r0} - adds r0, 0x3E - ldrb r2, [r0] - adds r1, r6, 0 - ands r1, r2 - orrs r1, r4 - strb r1, [r0] - subs r3, 0x1 - cmp r3, 0 - bge _081CA458 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81CA448 - - thumb_func_start sub_81CA474 -sub_81CA474: @ 81CA474 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x2E] - subs r0, 0x1 - strh r0, [r2, 0x2E] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _081CA49A - ldrh r0, [r2, 0x30] - ldrh r1, [r2, 0x32] - adds r0, r1 - strh r0, [r2, 0x32] - lsls r0, 16 - asrs r0, 20 - strh r0, [r2, 0x20] - b _081CA4A2 -_081CA49A: - ldrh r0, [r2, 0x3C] - strh r0, [r2, 0x20] - ldr r0, =DummyObjectCallback - str r0, [r2, 0x1C] -_081CA4A2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CA474 - - thumb_func_start sub_81CA4AC -sub_81CA4AC: @ 81CA4AC - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x2E] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _081CA574 - movs r0, 0x30 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _081CA4E2 - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - movs r0, 0x80 - lsls r0, 1 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] - strh r5, [r4, 0x24] - b _081CA578 -_081CA4E2: - ldrh r0, [r4, 0x32] - adds r0, 0x10 - strh r0, [r4, 0x32] - movs r2, 0x32 - ldrsh r0, [r4, r2] - asrs r1, r0, 3 - adds r0, r1, 0 - subs r0, 0x20 - lsrs r1, r0, 31 - adds r0, r1 - asrs r1, r0, 1 - movs r2, 0x3C - ldrsh r0, [r4, r2] - cmp r0, 0x1 - beq _081CA518 - cmp r0, 0x1 - bgt _081CA50A - cmp r0, 0 - beq _081CA514 - b _081CA526 -_081CA50A: - cmp r0, 0x2 - beq _081CA51C - cmp r0, 0x3 - beq _081CA520 - b _081CA526 -_081CA514: - negs r1, r1 - b _081CA520 -_081CA518: - negs r0, r1 - b _081CA524 -_081CA51C: - strh r1, [r4, 0x24] - b _081CA526 -_081CA520: - lsls r0, r1, 1 - adds r0, r1 -_081CA524: - strh r0, [r4, 0x24] -_081CA526: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _081CA578 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldrb r0, [r4, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - ldrb r1, [r4, 0x1] - lsrs r1, 6 - ldrb r2, [r4, 0x3] - lsrs r2, 6 - adds r0, r4, 0 - movs r3, 0 - bl CalcVecFromObjectCenterToObjectUpperLeft - ldrb r1, [r4, 0x1] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - movs r1, 0xD - negs r1, r1 - ands r0, r1 - strb r0, [r4, 0x1] - ldr r0, =DummyObjectCallback - str r0, [r4, 0x1C] - b _081CA578 - .pool -_081CA574: - subs r0, r1, 0x1 - strh r0, [r4, 0x2E] -_081CA578: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81CA4AC - - thumb_func_start sub_81CA580 -sub_81CA580: @ 81CA580 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - ldrh r0, [r4] - movs r1, 0 - ldrsh r2, [r4, r1] - cmp r2, 0 - bne _081CA634 - movs r0, 0x2 - ldrsh r1, [r4, r0] - cmp r1, 0 - beq _081CA5AC - cmp r1, 0x1 - beq _081CA5CC - b _081CA638 - .pool -_081CA5AC: - movs r0, 0x10 - strh r0, [r4, 0x4] - strh r2, [r4, 0x6] - movs r1, 0xFC - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0x10 - bl SetGpuReg - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] - b _081CA638 -_081CA5CC: - ldrh r0, [r4, 0x8] - ands r1, r0 - cmp r1, 0 - beq _081CA5E4 - ldrh r0, [r4, 0x4] - subs r0, 0x3 - strh r0, [r4, 0x4] - lsls r0, 16 - cmp r0, 0 - bge _081CA5F6 - strh r2, [r4, 0x4] - b _081CA5F6 -_081CA5E4: - ldrh r0, [r4, 0x6] - adds r0, 0x3 - strh r0, [r4, 0x6] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x10 - ble _081CA5F6 - movs r0, 0x10 - strh r0, [r4, 0x6] -_081CA5F6: - ldrh r1, [r4, 0x6] - lsls r1, 8 - ldrh r0, [r4, 0x4] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xC - bne _081CA638 - movs r0, 0x2 - bl sub_81C763C - ldrb r1, [r0, 0xC] - subs r1, 0x1 - strb r1, [r0, 0xC] - movs r1, 0x80 - lsls r1, 5 - movs r0, 0x52 - bl SetGpuReg - adds r0, r5, 0 - bl remove_task - b _081CA638 -_081CA634: - subs r0, 0x1 - strh r0, [r4] -_081CA638: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81CA580 - - thumb_func_start sub_81CA640 -sub_81CA640: @ 81CA640 - push {r4,lr} - movs r0, 0x2 - bl sub_81C763C - adds r4, r0, 0 - ldr r0, =gUnknown_0862036C - movs r1, 0x10 - movs r2, 0x60 - movs r3, 0x4 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - str r1, [r4, 0x28] - bl sub_81C98D4 - cmp r0, 0 - beq _081CA684 - ldr r1, [r4, 0x28] - ldr r0, =sub_81CA6AC - str r0, [r1, 0x1C] - b _081CA690 - .pool -_081CA684: - ldr r0, [r4, 0x28] - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_081CA690: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81CA640 - - thumb_func_start sub_81CA698 -sub_81CA698: @ 81CA698 - push {lr} - movs r0, 0x2 - bl sub_81C763C - ldr r0, [r0, 0x28] - bl RemoveObjectAndFreeTiles - pop {r0} - bx r0 - thumb_func_end sub_81CA698 - - thumb_func_start sub_81CA6AC -sub_81CA6AC: @ 81CA6AC - push {lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - ble _081CA6DA - movs r0, 0 - strh r0, [r3, 0x2E] - adds r3, 0x3E - ldrb r2, [r3] - lsls r0, r2, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] -_081CA6DA: - pop {r0} - bx r0 - thumb_func_end sub_81CA6AC - - thumb_func_start sub_81CA6E0 -sub_81CA6E0: @ 81CA6E0 - push {r4,lr} - movs r0, 0x2 - bl sub_81C763C - adds r4, r0, 0 - ldr r0, =gUnknown_086202CC - bl AddWindow - strh r0, [r4, 0x8] - lsls r0, 24 - lsrs r0, 24 - bl PutWindowTilemap - ldrb r0, [r4, 0x8] - movs r1, 0x66 - bl FillWindowPixelBuffer - ldrb r0, [r4, 0x8] - movs r1, 0x3 - bl CopyWindowToVram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CA6E0 - - thumb_func_start sub_81CA714 -sub_81CA714: @ 81CA714 - push {r4-r6,lr} - sub sp, 0xC - movs r0, 0x2 - bl sub_81C763C - adds r5, r0, 0 - bl sub_81C98B4 - ldr r1, =gUnknown_086202D4 - lsls r0, 2 - adds r0, r1 - ldr r6, [r0] - movs r2, 0x1 - negs r2, r2 - movs r0, 0x1 - adds r1, r6, 0 - bl GetStringWidth - adds r4, r0, 0 - ldrb r0, [r5, 0x8] - movs r1, 0x66 - bl FillWindowPixelBuffer - ldrb r0, [r5, 0x8] - movs r2, 0xC0 - subs r2, r4 - lsrs r2, 1 - lsls r2, 24 - lsrs r2, 24 - ldr r1, =gUnknown_0862030C - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - str r6, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x1 - bl box_print - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CA714 - - thumb_func_start sub_81CA770 -sub_81CA770: @ 81CA770 - push {r4-r6,lr} - sub sp, 0xC - movs r0, 0x2 - bl sub_81C763C - adds r5, r0, 0 - ldr r6, =gUnknown_085EBD4A - movs r2, 0x1 - negs r2, r2 - movs r0, 0x1 - adds r1, r6, 0 - bl GetStringWidth - adds r4, r0, 0 - ldrb r0, [r5, 0x8] - movs r1, 0x66 - bl FillWindowPixelBuffer - ldrb r0, [r5, 0x8] - movs r2, 0xC0 - subs r2, r4 - lsrs r2, 1 - lsls r2, 24 - lsrs r2, 24 - ldr r1, =gUnknown_0862030F - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - str r6, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x1 - bl box_print - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CA770 - - thumb_func_start sub_81CA7C4 -sub_81CA7C4: @ 81CA7C4 - push {lr} - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_81CA7C4 - - thumb_func_start sub_81CA7D4 -sub_81CA7D4: @ 81CA7D4 - push {r4,lr} - movs r0, 0x2 - bl sub_81C763C - adds r4, r0, 0 - ldr r0, =sub_81CA808 - movs r1, 0x2 - bl AddTask - strb r0, [r4, 0xA] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CA7D4 - - thumb_func_start sub_81CA7F4 -sub_81CA7F4: @ 81CA7F4 - push {lr} - movs r0, 0x2 - bl sub_81C763C - ldrb r0, [r0, 0xA] - bl remove_task - pop {r0} - bx r0 - thumb_func_end sub_81CA7F4 - - thumb_func_start sub_81CA808 -sub_81CA808: @ 81CA808 - push {lr} - movs r0, 0x3 - movs r1, 0x80 - movs r2, 0x1 - bl ChangeBgX - pop {r0} - bx r0 - thumb_func_end sub_81CA808 - - thumb_func_start sub_81CA818 -sub_81CA818: @ 81CA818 - push {r4,r5,lr} - ldr r0, =sub_81CA8B0 - movs r1, 0x3 - bl AddTask - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =gUnknown_0861FC7A - adds r0, r4, 0 - movs r1, 0x1 - adds r2, r5, 0 - bl set_word_task_arg - adds r5, 0xC - adds r0, r4, 0 - movs r1, 0x3 - adds r2, r5, 0 - bl set_word_task_arg - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CA818 - - thumb_func_start sub_81CA850 -sub_81CA850: @ 81CA850 - push {lr} - ldr r0, =gUnknown_0861FC86 - movs r1, 0x31 - movs r2, 0x4 - bl sub_81C7944 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CA850 - - thumb_func_start sub_81CA864 -sub_81CA864: @ 81CA864 - push {r4,r5,lr} - ldr r0, =sub_81CA8B0 - movs r1, 0x3 - bl AddTask - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =gUnknown_0861FC86 - adds r0, r4, 0 - movs r1, 0x1 - adds r2, r5, 0 - bl set_word_task_arg - subs r5, 0xC - adds r0, r4, 0 - movs r1, 0x3 - adds r2, r5, 0 - bl set_word_task_arg - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CA864 - - thumb_func_start sub_81CA89C -sub_81CA89C: @ 81CA89C - push {lr} - ldr r0, =sub_81CA8B0 - bl is_function_an_active_task - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CA89C - - thumb_func_start sub_81CA8B0 -sub_81CA8B0: @ 81CA8B0 - push {r4-r6,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r6, r0, 24 - lsls r4, r6, 2 - adds r4, r6 - lsls r4, 3 - ldr r0, =0x03005e08 - adds r4, r0 - adds r0, r6, 0 - movs r1, 0x1 - bl get_word_task_arg - adds r5, r0, 0 - adds r0, r6, 0 - movs r1, 0x3 - bl get_word_task_arg - adds r1, r0, 0 - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - lsls r0, 16 - asrs r0, 16 - str r0, [sp] - add r0, sp, 0x8 - str r0, [sp, 0x4] - adds r0, r5, 0 - movs r2, 0x2 - movs r3, 0xC - bl sub_81C79BC - add r0, sp, 0x8 - movs r1, 0x31 - movs r2, 0x4 - bl gpu_pal_apply - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0xC - bne _081CA908 - adds r0, r6, 0 - bl remove_task -_081CA908: - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CA8B0 - - thumb_func_start sub_81CA914 -sub_81CA914: @ 81CA914 - push {lr} - bl copy_pal_bg_faded_to_pal_ram - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl sub_80BA0A8 - pop {r0} - bx r0 - thumb_func_end sub_81CA914 - - thumb_func_start titlescreen_0 -titlescreen_0: @ 81CA92C - push {lr} - movs r0, 0x50 - movs r1, 0x90 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl SetGpuRegBits - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuRegBits - movs r0, 0x4A - movs r1, 0x1F - bl SetGpuRegBits - movs r0, 0x44 - movs r1, 0xA0 - bl SetGpuRegBits - bl remove_some_task - bl sub_81CAA3C - ldr r2, =gUnknown_08620384 - ldr r0, [r2] - ldr r1, [r2, 0x4] - ldr r2, [r2, 0x8] - bl sub_80BA038 - ldr r0, =sub_81CA914 - bl c3args_set_0toR1_1to0 - ldr r0, =sub_81CA9EC - movs r1, 0x3 - bl AddTask - pop {r0} - bx r0 - .pool - thumb_func_end titlescreen_0 - - thumb_func_start sub_81CA994 -sub_81CA994: @ 81CA994 - push {lr} - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl ClearGpuRegBits - bl remove_some_task - ldr r0, =sub_81CA9EC - bl get_task_id_by_function - lsls r0, 24 - lsrs r0, 24 - bl remove_task - bl sub_81C760C - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CA994 - - thumb_func_start sub_81CA9C8 -sub_81CA9C8: @ 81CA9C8 - push {lr} - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - pop {r0} - bx r0 - thumb_func_end sub_81CA9C8 - - thumb_func_start sub_81CA9D8 -sub_81CA9D8: @ 81CA9D8 - push {lr} - bl sub_81CAA3C - movs r0, 0x50 - movs r1, 0x90 - bl SetGpuReg - pop {r0} - bx r0 - thumb_func_end sub_81CA9D8 - - thumb_func_start sub_81CA9EC -sub_81CA9EC: @ 81CA9EC - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r2, r1, r0 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - lsls r0, 16 - cmp r0, 0 - ble _081CAA30 - movs r0, 0 - strh r0, [r2] - ldrh r0, [r2, 0x2] - adds r0, 0x3 - movs r1, 0x7F - ands r0, r1 - strh r0, [r2, 0x2] - ldr r1, =gUnknown_08329F40 - movs r3, 0x2 - ldrsh r0, [r2, r3] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - lsls r1, 16 - asrs r1, 21 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x54 - bl SetGpuReg -_081CAA30: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CA9EC - - thumb_func_start sub_81CAA3C -sub_81CAA3C: @ 81CAA3C - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x8 - bl sub_81C9894 - adds r4, r0, 0 - bl sub_81C98A4 - ldr r2, =gUnknown_08620240 - lsls r1, r4, 3 - subs r1, r4 - lsls r1, 2 - adds r1, r2 - ldrh r2, [r1, 0x2] - adds r4, r2, 0 - muls r4, r0 - ldrh r1, [r1] - adds r4, r1 - subs r4, 0x8 - mov r0, sp - movs r6, 0 - strh r6, [r0] - ldr r5, =0x02038c28 - ldr r0, =0x010000a0 - mov r8, r0 - mov r0, sp - adds r1, r5, 0 - mov r2, r8 - bl CpuSet - mov r0, sp - adds r0, 0x2 - strh r6, [r0] - movs r1, 0xF0 - lsls r1, 3 - adds r1, r5 - mov r9, r1 - mov r2, r8 - bl CpuSet - add r0, sp, 0x4 - ldr r1, =0x000072f0 - adds r6, r1, 0 - strh r6, [r0] - lsls r4, 1 - adds r5, r4, r5 - ldr r1, =0x01000010 - mov r8, r1 - adds r1, r5, 0 - mov r2, r8 - bl CpuSet - mov r0, sp - adds r0, 0x6 - strh r6, [r0] - add r4, r9 - adds r1, r4, 0 - mov r2, r8 - bl CpuSet - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CAA3C - - thumb_func_start sub_81CAADC -sub_81CAADC: @ 81CAADC - push {lr} - bl sub_81CA9C8 - pop {r0} - bx r0 - thumb_func_end sub_81CAADC - - thumb_func_start sub_81CAAE8 -sub_81CAAE8: @ 81CAAE8 - push {r4,lr} - movs r1, 0xD4 - lsls r1, 1 - movs r0, 0x5 - bl sub_81C761C - adds r4, r0, 0 - cmp r4, 0 - beq _081CAB1C - ldr r0, =sub_81CAB44 - str r0, [r4, 0x18] - movs r0, 0 - strh r0, [r4, 0x8] - str r0, [r4, 0x10] - ldr r0, =sub_81CAD20 - movs r1, 0x1 - bl sub_81C7078 - str r0, [r4, 0x14] - movs r0, 0x1 - b _081CAB1E - .pool -_081CAB1C: - movs r0, 0 -_081CAB1E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CAAE8 - - thumb_func_start sub_81CAB24 -sub_81CAB24: @ 81CAB24 - push {lr} - movs r0, 0x5 - bl sub_81C763C - ldr r1, [r0, 0x18] - bl _call_via_r1 - pop {r1} - bx r1 - thumb_func_end sub_81CAB24 - - thumb_func_start sub_81CAB38 -sub_81CAB38: @ 81CAB38 - push {lr} - movs r0, 0x5 - bl sub_81C7650 - pop {r0} - bx r0 - thumb_func_end sub_81CAB38 - - thumb_func_start sub_81CAB44 -sub_81CAB44: @ 81CAB44 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r3, =0x030022c0 - ldrh r1, [r3, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081CAB5C - movs r0, 0x2 - b _081CABF4 - .pool -_081CAB5C: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081CAB68 - movs r0, 0x1 - b _081CABF4 -_081CAB68: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _081CAB74 - movs r0, 0x4 - b _081CABF4 -_081CAB74: - movs r0, 0x10 - ands r0, r1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0 - beq _081CAB84 - movs r0, 0x3 - b _081CABF4 -_081CAB84: - ldrh r1, [r3, 0x2E] - movs r5, 0x1 - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _081CABD0 - ldr r0, =sub_81CAC04 - str r0, [r4, 0x18] - strh r2, [r4] - bl sub_81C875C - lsls r0, 2 - adds r1, r4, r0 - ldrb r0, [r1, 0x1C] - cmp r0, 0 - beq _081CABAE - ldrh r0, [r1, 0x1E] - bl sub_81D17E8 - cmp r0, 0 - beq _081CABC0 -_081CABAE: - ldr r0, =gUnknown_0862250A - str r0, [r4, 0x4] - movs r0, 0x2 - strh r0, [r4, 0x2] - b _081CABC6 - .pool -_081CABC0: - ldr r0, =gUnknown_08622508 - str r0, [r4, 0x4] - strh r5, [r4, 0x2] -_081CABC6: - movs r0, 0x5 - b _081CABF4 - .pool -_081CABD0: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081CABF2 - bl sub_81C767C - cmp r0, 0x1 - beq _081CABEC - ldr r0, =sub_81CABFC - str r0, [r4, 0x18] - movs r0, 0xF - b _081CABF4 - .pool -_081CABEC: - movs r0, 0x20 - bl audio_play -_081CABF2: - movs r0, 0 -_081CABF4: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81CAB44 - - thumb_func_start sub_81CABFC -sub_81CABFC: @ 81CABFC - ldr r0, =0x000186a4 - bx lr - .pool - thumb_func_end sub_81CABFC - - thumb_func_start sub_81CAC04 -sub_81CAC04: @ 81CAC04 - push {r4,lr} - adds r4, r0, 0 - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081CAC24 - ldrh r0, [r4] - cmp r0, 0 - beq _081CAC24 - subs r0, 0x1 - b _081CAC38 - .pool -_081CAC24: - ldrh r1, [r2, 0x2E] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081CAC3E - ldrh r0, [r4] - ldrh r1, [r4, 0x2] - cmp r0, r1 - bcs _081CAC3E - adds r0, 0x1 -_081CAC38: - strh r0, [r4] - movs r0, 0x6 - b _081CACAC -_081CAC3E: - ldrh r1, [r2, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081CAC98 - ldrh r1, [r4] - ldr r0, [r4, 0x4] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _081CAC8C - cmp r0, 0x1 - bgt _081CAC5E - cmp r0, 0 - beq _081CAC64 - b _081CAC98 -_081CAC5E: - cmp r0, 0x2 - bne _081CAC98 - b _081CACA6 -_081CAC64: - bl sub_81C767C - cmp r0, 0x1 - bne _081CAC72 - movs r0, 0x2 - bl sub_81C7688 -_081CAC72: - ldr r0, =sub_81CACF8 - str r0, [r4, 0x18] - bl sub_81CB1D0 - cmp r0, 0 - beq _081CAC88 - movs r0, 0x9 - b _081CACAC - .pool -_081CAC88: - movs r0, 0x8 - b _081CACAC -_081CAC8C: - ldr r0, =sub_81CACB8 - str r0, [r4, 0x18] - movs r0, 0xB - b _081CACAC - .pool -_081CAC98: - ldrh r1, [r2, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _081CACA6 - movs r0, 0 - b _081CACAC -_081CACA6: - ldr r0, =sub_81CAB44 - str r0, [r4, 0x18] - movs r0, 0x7 -_081CACAC: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CAC04 - - thumb_func_start sub_81CACB8 -sub_81CACB8: @ 81CACB8 - push {lr} - adds r3, r0, 0 - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081CACD0 - movs r0, 0xC - b _081CACF0 - .pool -_081CACD0: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081CACDC - movs r0, 0xD - b _081CACF0 -_081CACDC: - ldrh r1, [r2, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _081CACEA - movs r0, 0 - b _081CACF0 -_081CACEA: - ldr r0, =sub_81CAB44 - str r0, [r3, 0x18] - movs r0, 0xE -_081CACF0: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CACB8 - - thumb_func_start sub_81CACF8 -sub_81CACF8: @ 81CACF8 - push {lr} - adds r2, r0, 0 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _081CAD10 - movs r0, 0 - b _081CAD16 - .pool -_081CAD10: - ldr r0, =sub_81CAB44 - str r0, [r2, 0x18] - movs r0, 0xA -_081CAD16: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CACF8 - - thumb_func_start sub_81CAD20 -sub_81CAD20: @ 81CAD20 - push {r4-r7,lr} - adds r5, r0, 0 - movs r0, 0x5 - bl sub_81C763C - adds r4, r0, 0 - cmp r5, 0x1 - beq _081CAD4C - cmp r5, 0x1 - bgt _081CAD3A - cmp r5, 0 - beq _081CAD44 - b _081CAE00 -_081CAD3A: - cmp r5, 0x2 - beq _081CAD9C - cmp r5, 0x3 - beq _081CADFC - b _081CAE00 -_081CAD44: - strh r5, [r4, 0x8] - strh r5, [r4, 0xA] -_081CAD48: - movs r0, 0x1 - b _081CAE02 -_081CAD4C: - movs r6, 0 - ldrh r5, [r4, 0x8] -_081CAD50: - adds r0, r5, 0 - bl sub_81D15F4 - cmp r0, 0 - beq _081CAD80 - ldrh r0, [r4, 0xA] - lsls r0, 2 - adds r0, r4, r0 - strh r5, [r0, 0x1E] - ldrh r0, [r4, 0xA] - lsls r0, 2 - adds r0, r4, r0 - movs r1, 0x1 - strb r1, [r0, 0x1C] - adds r0, r5, 0 - bl sub_81D16DC - ldrh r1, [r4, 0xA] - lsls r1, 2 - adds r1, r4, r1 - strb r0, [r1, 0x1D] - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] -_081CAD80: - ldrh r0, [r4, 0x8] - adds r1, r0, 0x1 - movs r2, 0 - strh r1, [r4, 0x8] - lsls r0, r1, 16 - lsrs r0, 16 - cmp r0, 0x14 - bhi _081CADF6 - adds r6, 0x1 - adds r5, 0x1 - cmp r6, 0x1D - ble _081CAD50 - movs r0, 0x3 - b _081CAE02 -_081CAD9C: - movs r6, 0 - ldrh r5, [r4, 0x8] - movs r7, 0 -_081CADA2: - ldrh r0, [r4, 0x8] - bl sub_81D1BF8 - cmp r0, 0 - bne _081CADDC - ldrh r0, [r4, 0x8] - bl sub_81CAE08 - cmp r0, 0 - beq _081CADDC - ldrh r0, [r4, 0xA] - lsls r0, 2 - adds r0, r4, r0 - ldrh r1, [r4, 0x8] - strh r1, [r0, 0x1E] - ldrh r0, [r4, 0xA] - lsls r0, 2 - adds r0, r4, r0 - strb r7, [r0, 0x1C] - adds r0, r5, 0 - bl sub_81CB0C8 - ldrh r1, [r4, 0xA] - lsls r1, 2 - adds r1, r4, r1 - strb r0, [r1, 0x1D] - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] -_081CADDC: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x4D - bhi _081CAD48 - adds r6, 0x1 - adds r5, 0x1 - cmp r6, 0x1D - ble _081CADA2 - movs r0, 0x3 - b _081CAE02 -_081CADF6: - strh r1, [r4, 0xC] - strh r2, [r4, 0x8] - b _081CAD48 -_081CADFC: - movs r0, 0x1 - str r0, [r4, 0x10] -_081CAE00: - movs r0, 0x4 -_081CAE02: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81CAD20 - - thumb_func_start sub_81CAE08 -sub_81CAE08: @ 81CAE08 - push {lr} - cmp r0, 0x4D - ble _081CAE12 - movs r0, 0 - b _081CAE24 -_081CAE12: - movs r1, 0xAE - lsls r1, 1 - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 -_081CAE24: - pop {r1} - bx r1 - thumb_func_end sub_81CAE08 - - thumb_func_start sub_81CAE28 -sub_81CAE28: @ 81CAE28 - push {lr} - movs r0, 0x5 - bl sub_81C763C - ldr r0, [r0, 0x10] - pop {r1} - bx r1 - thumb_func_end sub_81CAE28 - - thumb_func_start sub_81CAE38 -sub_81CAE38: @ 81CAE38 - push {lr} - movs r0, 0x5 - bl sub_81C763C - ldrh r0, [r0, 0xA] - pop {r1} - bx r1 - thumb_func_end sub_81CAE38 - - thumb_func_start sub_81CAE48 -sub_81CAE48: @ 81CAE48 - push {lr} - movs r0, 0x5 - bl sub_81C763C - ldrh r0, [r0, 0xC] - pop {r1} - bx r1 - thumb_func_end sub_81CAE48 - - thumb_func_start sub_81CAE58 -sub_81CAE58: @ 81CAE58 - push {lr} - movs r0, 0x5 - bl sub_81C763C - adds r1, r0, 0 - ldrh r0, [r1, 0xA] - ldrh r1, [r1, 0xC] - subs r0, r1 - pop {r1} - bx r1 - thumb_func_end sub_81CAE58 - - thumb_func_start sub_81CAE6C -sub_81CAE6C: @ 81CAE6C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x5 - bl sub_81C763C - adds r1, r0, 0 - ldrh r0, [r1, 0xC] - adds r4, r0 - ldrh r0, [r1, 0xA] - cmp r4, r0 - bge _081CAE8A - lsls r0, r4, 2 - adds r0, r1, r0 - ldrh r0, [r0, 0x1E] - b _081CAE8C -_081CAE8A: - movs r0, 0x4E -_081CAE8C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CAE6C - - thumb_func_start sub_81CAE94 -sub_81CAE94: @ 81CAE94 - push {lr} - movs r0, 0x5 - bl sub_81C763C - adds r0, 0x1C - pop {r1} - bx r1 - thumb_func_end sub_81CAE94 - - thumb_func_start sub_81CAEA4 -sub_81CAEA4: @ 81CAEA4 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x5 - bl sub_81C763C - lsls r4, 2 - adds r0, r4 - ldrb r0, [r0, 0x1D] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CAEA4 - - thumb_func_start sub_81CAEBC -sub_81CAEBC: @ 81CAEBC - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x5 - bl sub_81C763C - lsls r1, r4, 2 - adds r1, r0, r1 - ldrb r0, [r1, 0x1C] - cmp r0, 0 - bne _081CAED4 - ldrh r4, [r1, 0x1E] - b _081CAEDC -_081CAED4: - ldrh r0, [r1, 0x1E] - bl sub_81D1854 - adds r4, r0, 0 -_081CAEDC: - cmp r4, 0x4E - beq _081CAEFC - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x000009ca - adds r0, r1 - adds r0, r4 - ldrb r1, [r0] - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - b _081CAEFE - .pool -_081CAEFC: - movs r0, 0 -_081CAEFE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CAEBC - - thumb_func_start sub_81CAF04 -sub_81CAF04: @ 81CAF04 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x5 - bl sub_81C763C - lsls r1, r4, 2 - adds r1, r0, r1 - ldrb r0, [r1, 0x1C] - cmp r0, 0 - bne _081CAF34 - ldrh r0, [r1, 0x1E] - bl sub_81D15BC - adds r4, r0, 0 - ldr r1, =gTrainers - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldrb r0, [r0, 0x3] - b _081CAF6C - .pool -_081CAF34: - ldrh r5, [r1, 0x1E] - adds r0, r5, 0 - bl sub_81D1854 - adds r4, r0, 0 - cmp r4, 0x4E - bne _081CAF58 - adds r0, r5, 0 - bl sub_81D1BD0 - adds r4, r0, 0 - ldr r0, =gTrainerPicIndices - adds r0, r4, r0 - ldrb r0, [r0] - b _081CAF6C - .pool -_081CAF58: - adds r0, r4, 0 - bl sub_81D15BC - adds r4, r0, 0 - ldr r0, =gTrainers - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldrb r0, [r1, 0x3] -_081CAF6C: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CAF04 - - thumb_func_start sub_81CAF78 -sub_81CAF78: @ 81CAF78 - push {r4-r6,lr} - adds r5, r0, 0 - adds r6, r1, 0 - movs r0, 0x5 - bl sub_81C763C - adds r4, r0, 0 - movs r0, 0 - strb r0, [r6] - ldr r0, =0x02037318 - ldrb r0, [r0, 0x17] - bl is_light_level_1_2_3_or_6 - lsls r0, 24 - cmp r0, 0 - bne _081CAFA4 - ldr r0, =gUnknown_085EEB0B - b _081CAFCE - .pool -_081CAFA4: - lsls r0, r5, 2 - adds r1, r4, r0 - ldrb r0, [r1, 0x1C] - cmp r0, 0 - bne _081CAFC4 - ldrh r0, [r1, 0x1E] - bl sub_81D15BC - ldr r1, =0x02021fc4 - bl sub_81967AC - strb r0, [r6] - b _081CAFCC - .pool -_081CAFC4: - ldrh r0, [r1, 0x1E] - ldr r1, =0x02021fc4 - bl sub_81D189C -_081CAFCC: - ldr r0, =0x02021fc4 -_081CAFCE: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CAF78 - - thumb_func_start sub_81CAFD8 -sub_81CAFD8: @ 81CAFD8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x5 - bl sub_81C763C - lsls r4, 2 - adds r4, r0, r4 - ldrb r0, [r4, 0x1C] - cmp r0, 0 - beq _081CB004 - ldrh r0, [r4, 0x1E] - bl sub_81D1854 - adds r1, r0, 0 - cmp r1, 0x4E - bne _081CB006 - ldrh r0, [r4, 0x1E] - adds r1, r5, 0 - bl sub_81D1B40 - b _081CB012 -_081CB004: - ldrh r1, [r4, 0x1E] -_081CB006: - ldr r2, =gUnknown_08622028 - lsls r0, r5, 2 - lsls r1, 4 - adds r0, r1 - adds r0, r2 - ldr r0, [r0] -_081CB012: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CAFD8 - - thumb_func_start sub_81CB01C -sub_81CB01C: @ 81CB01C - push {lr} - movs r0, 0x5 - bl sub_81C763C - ldrh r0, [r0] - pop {r1} - bx r1 - thumb_func_end sub_81CB01C - - thumb_func_start sub_81CB02C -sub_81CB02C: @ 81CB02C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x5 - bl sub_81C763C - adds r1, r0, 0 - ldrh r0, [r1, 0x2] - cmp r0, r4 - blt _081CB046 - ldr r0, [r1, 0x4] - adds r0, r4 - ldrb r0, [r0] - b _081CB048 -_081CB046: - movs r0, 0x3 -_081CB048: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CB02C - - thumb_func_start sub_81CB050 -sub_81CB050: @ 81CB050 - push {r4,lr} - sub sp, 0x8 - adds r2, r0, 0 - adds r4, r1, 0 - ldrb r0, [r2] - cmp r0, 0 - bne _081CB088 - ldrh r0, [r2, 0x2] - bl sub_81D15BC - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTrainers - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r0, 0xD - muls r0, r2 - ldr r2, =gTrainerClassNames - adds r0, r2 - str r0, [sp] - adds r1, 0x4 - str r1, [sp, 0x4] - b _081CB092 - .pool -_081CB088: - ldrh r0, [r2, 0x2] - add r2, sp, 0x4 - mov r1, sp - bl sub_81D1A78 -_081CB092: - ldr r2, [sp] - cmp r2, 0 - beq _081CB0B4 - ldr r0, [sp, 0x4] - cmp r0, 0 - beq _081CB0B4 - adds r0, r4, 0 - movs r1, 0x7 - movs r3, 0x45 - bl sub_81DB494 - ldr r2, [sp, 0x4] - movs r1, 0x7 - movs r3, 0x33 - bl sub_81DB494 - b _081CB0C0 -_081CB0B4: - adds r0, r4, 0 - movs r1, 0x7 - movs r2, 0 - movs r3, 0x78 - bl sub_81DB494 -_081CB0C0: - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81CB050 - - thumb_func_start sub_81CB0C8 -sub_81CB0C8: @ 81CB0C8 - push {lr} - ldr r1, =gUnknown_085500A4 - lsls r0, 4 - adds r0, r1 - ldrh r2, [r0, 0xA] - ldrh r1, [r0, 0xC] - adds r0, r2, 0 - bl get_mapheader_by_bank_and_number - ldrb r0, [r0, 0x14] - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CB0C8 - - thumb_func_start sub_81CB0E4 -sub_81CB0E4: @ 81CB0E4 - push {r4-r7,lr} - adds r5, r0, 0 - movs r0, 0x5 - bl sub_81C763C - adds r7, r0, 0 - movs r6, 0x1 - adds r5, 0x1 - ldrh r0, [r7, 0xA] - cmp r5, r0 - bge _081CB120 - lsls r0, r5, 2 - adds r0, 0x1C - adds r4, r0, r7 -_081CB100: - ldrb r0, [r4] - cmp r0, 0 - beq _081CB110 - ldrh r0, [r4, 0x2] - bl sub_81D17E8 - cmp r0, 0 - beq _081CB114 -_081CB110: - adds r0, r6, 0 - b _081CB122 -_081CB114: - adds r6, 0x1 - adds r4, 0x4 - adds r5, 0x1 - ldrh r0, [r7, 0xA] - cmp r5, r0 - blt _081CB100 -_081CB120: - movs r0, 0 -_081CB122: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81CB0E4 - - thumb_func_start sub_81CB128 -sub_81CB128: @ 81CB128 - push {r4-r6,lr} - adds r5, r0, 0 - movs r0, 0x5 - bl sub_81C763C - adds r1, r0, 0 - movs r6, 0x1 - negs r6, r6 - subs r5, 0x1 - cmp r5, 0 - blt _081CB162 - lsls r0, r5, 2 - adds r0, 0x1C - adds r4, r0, r1 -_081CB144: - ldrb r0, [r4] - cmp r0, 0 - beq _081CB154 - ldrh r0, [r4, 0x2] - bl sub_81D17E8 - cmp r0, 0 - beq _081CB158 -_081CB154: - adds r0, r6, 0 - b _081CB164 -_081CB158: - subs r6, 0x1 - subs r4, 0x4 - subs r5, 0x1 - cmp r5, 0 - bge _081CB144 -_081CB162: - movs r0, 0 -_081CB164: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81CB128 - - thumb_func_start sub_81CB16C -sub_81CB16C: @ 81CB16C - push {r4,lr} - movs r4, 0 -_081CB170: - adds r0, r4, 0 - bl sub_81CAE08 - cmp r0, 0 - beq _081CB18A - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x000009ca - adds r0, r1 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - bne _081CB1B2 -_081CB18A: - adds r4, 0x1 - cmp r4, 0x4D - ble _081CB170 - movs r4, 0 -_081CB192: - adds r0, r4, 0 - bl sub_81D15F4 - cmp r0, 0 - beq _081CB1C0 - adds r0, r4, 0 - bl sub_81D1854 - ldr r1, =0x03005d8c - ldr r1, [r1] - ldr r2, =0x000009ca - adds r1, r2 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0 - beq _081CB1C0 -_081CB1B2: - movs r0, 0x1 - b _081CB1C8 - .pool -_081CB1C0: - adds r4, 0x1 - cmp r4, 0x14 - ble _081CB192 - movs r0, 0 -_081CB1C8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CB16C - - thumb_func_start sub_81CB1D0 -sub_81CB1D0: @ 81CB1D0 - push {r4,lr} - movs r0, 0x5 - bl sub_81C763C - adds r4, r0, 0 - bl sub_81C875C - adds r1, r0, 0 - lsls r0, r1, 2 - adds r4, r0 - ldrb r0, [r4, 0x1C] - cmp r0, 0 - bne _081CB218 - adds r0, r1, 0 - bl sub_81CAEA4 - ldr r1, =0x02037318 - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r1, 0x14] - cmp r0, r1 - bne _081CB258 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x000009ca - adds r0, r1 - ldrh r4, [r4, 0x1E] - adds r0, r4 - ldrb r0, [r0] - b _081CB246 - .pool -_081CB218: - ldrh r0, [r4, 0x1E] - cmp r0, 0xB - bne _081CB258 - adds r0, r1, 0 - bl sub_81CAEA4 - ldr r1, =0x02037318 - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r1, 0x14] - cmp r0, r1 - bne _081CB258 - ldr r0, =0x0000086b - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081CB258 - movs r0, 0x5B - bl FlagGet - lsls r0, 24 -_081CB246: - cmp r0, 0 - bne _081CB258 - movs r0, 0x1 - b _081CB25A - .pool -_081CB258: - movs r0, 0 -_081CB25A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CB1D0 - - thumb_func_start sub_81CB260 -sub_81CB260: @ 81CB260 - push {r4,lr} - ldr r1, =0x00002048 - movs r0, 0x6 - bl sub_81C761C - adds r4, r0, 0 - cmp r4, 0 - beq _081CB294 - movs r0, 0 - strb r0, [r4, 0x19] - ldr r0, =sub_81CB324 - movs r1, 0x1 - bl sub_81C7078 - str r0, [r4, 0x4] - ldr r0, =sub_81CB310 - str r0, [r4] - movs r0, 0x1 - b _081CB296 - .pool -_081CB294: - movs r0, 0 -_081CB296: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CB260 - - thumb_func_start sub_81CB29C -sub_81CB29C: @ 81CB29C - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x6 - bl sub_81C763C - adds r5, r0, 0 - ldr r0, =gUnknown_08622798 - lsls r4, 2 - adds r4, r0 - ldr r0, [r4] - movs r1, 0x1 - bl sub_81C7078 - str r0, [r5, 0x4] - ldr r0, =sub_81CB310 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CB29C - - thumb_func_start sub_81CB2CC -sub_81CB2CC: @ 81CB2CC - push {lr} - movs r0, 0x6 - bl sub_81C763C - ldr r0, [r0] - bl _call_via_r0 - pop {r1} - bx r1 - thumb_func_end sub_81CB2CC - - thumb_func_start sub_81CB2E0 -sub_81CB2E0: @ 81CB2E0 - push {r4,lr} - movs r0, 0x6 - bl sub_81C763C - adds r4, r0, 0 - bl sub_81CC2B4 - bl sub_81CBC1C - ldrb r0, [r4, 0x12] - bl RemoveWindow - ldrb r0, [r4, 0x10] - bl RemoveWindow - ldrb r0, [r4, 0x14] - bl RemoveWindow - movs r0, 0x6 - bl sub_81C7650 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81CB2E0 - - thumb_func_start sub_81CB310 -sub_81CB310: @ 81CB310 - push {lr} - movs r0, 0x6 - bl sub_81C763C - ldr r0, [r0, 0x4] - bl sub_81C70D8 - pop {r1} - bx r1 - thumb_func_end sub_81CB310 - - thumb_func_start sub_81CB324 -sub_81CB324: @ 81CB324 - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - movs r0, 0x6 - bl sub_81C763C - adds r5, r0, 0 - cmp r4, 0x7 - bls _081CB338 - b _081CB504 -_081CB338: - lsls r0, r4, 2 - ldr r1, =_081CB348 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081CB348: - .4byte _081CB368 - .4byte _081CB3D4 - .4byte _081CB424 - .4byte _081CB468 - .4byte _081CB482 - .4byte _081CB494 - .4byte _081CB4A6 - .4byte _081CB4EA -_081CB368: - ldr r0, =gUnknown_0862278C - movs r1, 0x3 - bl sub_81C7B54 - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - ldr r1, =gUnknown_08622530 - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r0, =0x00001024 - adds r1, r5, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - ldr r1, =gUnknown_086225D4 - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - ldr r0, =gUnknown_08622510 - movs r1, 0x20 - movs r2, 0x20 - bl sub_81C7944 - movs r0, 0x2 - b _081CB418 - .pool -_081CB3D4: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - beq _081CB3E0 - b _081CB4FA -_081CB3E0: - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_8199DF0 - adds r1, r5, 0 - adds r1, 0x24 - movs r0, 0x1 - bl SetBgTilemapBuffer - movs r1, 0x80 - lsls r1, 5 - movs r0, 0x20 - str r0, [sp] - movs r0, 0x14 - str r0, [sp, 0x4] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - ldr r0, =gUnknown_086226E0 - movs r1, 0x10 - movs r2, 0x20 - bl sub_81C7944 - movs r0, 0x1 -_081CB418: - bl CopyBgTilemapBufferToVram - movs r0, 0 - b _081CB506 - .pool -_081CB424: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _081CB4FA - adds r0, r5, 0 - bl sub_81CC034 - ldr r1, =gUnknown_08622760 - str r4, [sp] - movs r0, 0x3 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r0, =gUnknown_08622700 - movs r1, 0x30 - movs r2, 0x20 - bl sub_81C7944 - ldr r0, =gUnknown_08622720 - movs r1, 0x50 - movs r2, 0x20 - bl sub_81C7944 - movs r0, 0 - b _081CB506 - .pool -_081CB468: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - bne _081CB4FA - bl sub_81CAE28 - cmp r0, 0 - beq _081CB4FA - bl sub_81CBBB8 - movs r0, 0 - b _081CB506 -_081CB482: - bl sub_81C8224 - cmp r0, 0 - bne _081CB4FA - adds r0, r5, 0 - bl sub_81CBD78 - movs r0, 0 - b _081CB506 -_081CB494: - adds r0, r5, 0 - bl sub_81CBDC0 - adds r0, r5, 0 - movs r1, 0 - bl sub_81CBEF8 - movs r0, 0 - b _081CB506 -_081CB4A6: - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - movs r0, 0x1 - bl ShowBg - bl sub_81CC214 - movs r0, 0x3 - bl sub_81C7DFC - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0 - bl sub_81C7FA0 - movs r0, 0x1 - bl sub_81C7AC0 - movs r0, 0 - b _081CB506 -_081CB4EA: - bl sub_81C7B34 - cmp r0, 0 - bne _081CB4FA - bl sub_81C8010 - cmp r0, 0 - beq _081CB4FE -_081CB4FA: - movs r0, 0x2 - b _081CB506 -_081CB4FE: - movs r0, 0x1 - bl sub_81CBC38 -_081CB504: - movs r0, 0x4 -_081CB506: - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81CB324 - - thumb_func_start sub_81CB510 -sub_81CB510: @ 81CB510 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x6 - bl sub_81C763C - adds r5, r0, 0 - cmp r4, 0x1 - beq _081CB55E - cmp r4, 0x1 - bgt _081CB52A - cmp r4, 0 - beq _081CB534 - b _081CB580 -_081CB52A: - cmp r4, 0x2 - beq _081CB566 - cmp r4, 0x3 - beq _081CB572 - b _081CB580 -_081CB534: - bl sub_81C868C - cmp r0, 0x1 - beq _081CB54C - cmp r0, 0x1 - bgt _081CB546 - cmp r0, 0 - beq _081CB580 - b _081CB56E -_081CB546: - cmp r0, 0x2 - beq _081CB556 - b _081CB56E -_081CB54C: - movs r0, 0x5 - bl audio_play - movs r0, 0x7 - b _081CB582 -_081CB556: - movs r0, 0x5 - bl audio_play - b _081CB56E -_081CB55E: - bl sub_81C8630 - cmp r0, 0 - bne _081CB57C -_081CB566: - adds r0, r5, 0 - movs r1, 0 - bl sub_81CBEF8 -_081CB56E: - movs r0, 0 - b _081CB582 -_081CB572: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _081CB580 -_081CB57C: - movs r0, 0x2 - b _081CB582 -_081CB580: - movs r0, 0x4 -_081CB582: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81CB510 - - thumb_func_start sub_81CB588 -sub_81CB588: @ 81CB588 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x6 - bl sub_81C763C - adds r5, r0, 0 - cmp r4, 0x1 - beq _081CB5D6 - cmp r4, 0x1 - bgt _081CB5A2 - cmp r4, 0 - beq _081CB5AC - b _081CB5F8 -_081CB5A2: - cmp r4, 0x2 - beq _081CB5DE - cmp r4, 0x3 - beq _081CB5EA - b _081CB5F8 -_081CB5AC: - bl sub_81C8658 - cmp r0, 0x1 - beq _081CB5C4 - cmp r0, 0x1 - bgt _081CB5BE - cmp r0, 0 - beq _081CB5F8 - b _081CB5E6 -_081CB5BE: - cmp r0, 0x2 - beq _081CB5CE - b _081CB5E6 -_081CB5C4: - movs r0, 0x5 - bl audio_play - movs r0, 0x7 - b _081CB5FA -_081CB5CE: - movs r0, 0x5 - bl audio_play - b _081CB5E6 -_081CB5D6: - bl sub_81C8630 - cmp r0, 0 - bne _081CB5F4 -_081CB5DE: - adds r0, r5, 0 - movs r1, 0 - bl sub_81CBEF8 -_081CB5E6: - movs r0, 0 - b _081CB5FA -_081CB5EA: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _081CB5F8 -_081CB5F4: - movs r0, 0x2 - b _081CB5FA -_081CB5F8: - movs r0, 0x4 -_081CB5FA: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81CB588 - - thumb_func_start sub_81CB600 -sub_81CB600: @ 81CB600 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x6 - bl sub_81C763C - adds r5, r0, 0 - cmp r4, 0x1 - beq _081CB64E - cmp r4, 0x1 - bgt _081CB61A - cmp r4, 0 - beq _081CB624 - b _081CB670 -_081CB61A: - cmp r4, 0x2 - beq _081CB656 - cmp r4, 0x3 - beq _081CB662 - b _081CB670 -_081CB624: - bl sub_81C870C - cmp r0, 0x1 - beq _081CB63C - cmp r0, 0x1 - bgt _081CB636 - cmp r0, 0 - beq _081CB670 - b _081CB65E -_081CB636: - cmp r0, 0x2 - beq _081CB646 - b _081CB65E -_081CB63C: - movs r0, 0x5 - bl audio_play - movs r0, 0x7 - b _081CB672 -_081CB646: - movs r0, 0x5 - bl audio_play - b _081CB65E -_081CB64E: - bl sub_81C8630 - cmp r0, 0 - bne _081CB66C -_081CB656: - adds r0, r5, 0 - movs r1, 0 - bl sub_81CBEF8 -_081CB65E: - movs r0, 0 - b _081CB672 -_081CB662: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _081CB670 -_081CB66C: - movs r0, 0x2 - b _081CB672 -_081CB670: - movs r0, 0x4 -_081CB672: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81CB600 - - thumb_func_start sub_81CB678 -sub_81CB678: @ 81CB678 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x6 - bl sub_81C763C - adds r5, r0, 0 - cmp r4, 0x1 - beq _081CB6C6 - cmp r4, 0x1 - bgt _081CB692 - cmp r4, 0 - beq _081CB69C - b _081CB6E8 -_081CB692: - cmp r4, 0x2 - beq _081CB6CE - cmp r4, 0x3 - beq _081CB6DA - b _081CB6E8 -_081CB69C: - bl sub_81C86CC - cmp r0, 0x1 - beq _081CB6B4 - cmp r0, 0x1 - bgt _081CB6AE - cmp r0, 0 - beq _081CB6E8 - b _081CB6D6 -_081CB6AE: - cmp r0, 0x2 - beq _081CB6BE - b _081CB6D6 -_081CB6B4: - movs r0, 0x5 - bl audio_play - movs r0, 0x7 - b _081CB6EA -_081CB6BE: - movs r0, 0x5 - bl audio_play - b _081CB6D6 -_081CB6C6: - bl sub_81C8630 - cmp r0, 0 - bne _081CB6E4 -_081CB6CE: - adds r0, r5, 0 - movs r1, 0 - bl sub_81CBEF8 -_081CB6D6: - movs r0, 0 - b _081CB6EA -_081CB6DA: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _081CB6E8 -_081CB6E4: - movs r0, 0x2 - b _081CB6EA -_081CB6E8: - movs r0, 0x4 -_081CB6EA: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81CB678 - - thumb_func_start sub_81CB6F0 -sub_81CB6F0: @ 81CB6F0 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x6 - bl sub_81C763C - adds r5, r0, 0 - cmp r4, 0 - beq _081CB706 - cmp r4, 0x1 - beq _081CB71C - b _081CB72A -_081CB706: - movs r0, 0x5 - bl audio_play - adds r0, r5, 0 - bl sub_81CBF60 - movs r0, 0x7 - bl sub_81C7BA4 - movs r0, 0 - b _081CB72C -_081CB71C: - adds r0, r5, 0 - bl sub_81CBFC4 - cmp r0, 0 - beq _081CB72A - movs r0, 0x2 - b _081CB72C -_081CB72A: - movs r0, 0x4 -_081CB72C: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81CB6F0 - - thumb_func_start sub_81CB734 -sub_81CB734: @ 81CB734 - push {r4,lr} - movs r0, 0x5 - bl audio_play - movs r0, 0x6 - bl sub_81C763C - adds r4, r0, 0 - bl sub_81CB01C - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_81CC344 - movs r0, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CB734 - - thumb_func_start sub_81CB75C -sub_81CB75C: @ 81CB75C - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x6 - bl sub_81C763C - adds r5, r0, 0 - cmp r4, 0 - beq _081CB772 - cmp r4, 0x1 - beq _081CB788 - b _081CB796 -_081CB772: - movs r0, 0x5 - bl audio_play - adds r0, r5, 0 - bl sub_81CBFF0 - movs r0, 0x6 - bl sub_81C7BA4 - movs r0, 0 - b _081CB798 -_081CB788: - adds r0, r5, 0 - bl sub_81CC004 - cmp r0, 0 - beq _081CB796 - movs r0, 0x2 - b _081CB798 -_081CB796: - movs r0, 0x4 -_081CB798: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81CB75C - - thumb_func_start sub_81CB7A0 -sub_81CB7A0: @ 81CB7A0 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x6 - bl sub_81C763C - adds r5, r0, 0 - cmp r4, 0x1 - beq _081CB7D4 - cmp r4, 0x1 - bgt _081CB7BA - cmp r4, 0 - beq _081CB7C4 - b _081CB81A -_081CB7BA: - cmp r4, 0x2 - beq _081CB7F8 - cmp r4, 0x3 - beq _081CB80C - b _081CB81A -_081CB7C4: - movs r0, 0x1 - bl sub_81C9148 - adds r0, r5, 0 - bl sub_81CC058 - movs r0, 0 - b _081CB81C -_081CB7D4: - adds r0, r5, 0 - bl sub_81CC0D0 - adds r4, r0, 0 - cmp r4, 0 - bne _081CB816 - adds r0, r5, 0 - bl sub_81CC0E0 - ldr r0, =0x00000107 - bl audio_play - strb r4, [r5, 0xE] - movs r0, 0 - b _081CB81C - .pool -_081CB7F8: - adds r0, r5, 0 - bl sub_81CC104 - cmp r0, 0 - bne _081CB816 - adds r0, r5, 0 - bl sub_81CC158 - movs r0, 0 - b _081CB81C -_081CB80C: - adds r0, r5, 0 - bl sub_81CC194 - cmp r0, 0 - beq _081CB81A -_081CB816: - movs r0, 0x2 - b _081CB81C -_081CB81A: - movs r0, 0x4 -_081CB81C: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81CB7A0 - - thumb_func_start sub_81CB824 -sub_81CB824: @ 81CB824 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x6 - bl sub_81C763C - adds r5, r0, 0 - cmp r4, 0x1 - beq _081CB85E - cmp r4, 0x1 - bgt _081CB83E - cmp r4, 0 - beq _081CB844 - b _081CB880 -_081CB83E: - cmp r4, 0x2 - beq _081CB872 - b _081CB880 -_081CB844: - movs r0, 0x5 - bl audio_play - adds r0, r5, 0 - bl sub_81CC09C - movs r0, 0x1 - bl sub_81C9148 - movs r0, 0x1 - strb r0, [r5, 0xE] - movs r0, 0 - b _081CB882 -_081CB85E: - adds r0, r5, 0 - bl sub_81CC0D0 - cmp r0, 0 - bne _081CB87C - adds r0, r5, 0 - bl sub_81CC11C - movs r0, 0 - b _081CB882 -_081CB872: - adds r0, r5, 0 - bl sub_81CC140 - cmp r0, 0 - beq _081CB880 -_081CB87C: - movs r0, 0x2 - b _081CB882 -_081CB880: - movs r0, 0x4 -_081CB882: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81CB824 - - thumb_func_start sub_81CB888 -sub_81CB888: @ 81CB888 - push {r4-r6,lr} - adds r5, r0, 0 - movs r0, 0x6 - bl sub_81C763C - adds r4, r0, 0 - movs r6, 0 - cmp r5, 0x6 - bhi _081CB934 - lsls r0, r5, 2 - ldr r1, =_081CB8A8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081CB8A8: - .4byte _081CB8C4 - .4byte _081CB8DA - .4byte _081CB8E2 - .4byte _081CB8F0 - .4byte _081CB8F8 - .4byte _081CB90C - .4byte _081CB922 -_081CB8C4: - ldrb r0, [r4, 0xE] - cmp r0, 0 - bne _081CB8D2 - movs r0, 0x84 - lsls r0, 1 - bl audio_play -_081CB8D2: - movs r0, 0x5 - bl audio_play - b _081CB934 -_081CB8DA: - adds r0, r4, 0 - bl sub_81CC1DC - b _081CB934 -_081CB8E2: - adds r0, r4, 0 - bl sub_81CC204 - cmp r0, 0 - beq _081CB934 -_081CB8EC: - movs r6, 0x2 - b _081CB934 -_081CB8F0: - adds r0, r4, 0 - bl sub_81CBFF0 - b _081CB934 -_081CB8F8: - adds r0, r4, 0 - bl sub_81CC004 - cmp r0, 0 - beq _081CB904 - movs r6, 0x2 -_081CB904: - movs r0, 0x6 - bl sub_81C7BA4 - b _081CB934 -_081CB90C: - bl sub_81C7BE8 - cmp r0, 0 - bne _081CB8EC - ldrb r0, [r4, 0xF] - cmp r0, 0 - beq _081CB92C - bl sub_81C8838 - movs r6, 0x1 - b _081CB934 -_081CB922: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _081CB8EC -_081CB92C: - movs r0, 0 - bl sub_81C9148 - movs r6, 0x4 -_081CB934: - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81CB888 - - thumb_func_start sub_81CB93C -sub_81CB93C: @ 81CB93C - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x6 - bl sub_81C763C - adds r5, r0, 0 - cmp r4, 0x1 - beq _081CB974 - cmp r4, 0x1 - bgt _081CB956 - cmp r4, 0 - beq _081CB960 - b _081CB9BE -_081CB956: - cmp r4, 0x2 - beq _081CB990 - cmp r4, 0x3 - beq _081CB9A0 - b _081CB9BE -_081CB960: - movs r0, 0x5 - bl audio_play - bl sub_81C877C - adds r0, r5, 0 - bl sub_81CC014 - movs r0, 0 - b _081CB9C0 -_081CB974: - bl sub_81C8820 - cmp r0, 0 - bne _081CB9BA - adds r0, r5, 0 - bl sub_81CC004 - cmp r0, 0 - bne _081CB9BA - movs r0, 0x8 - bl sub_81C7BA4 - movs r0, 0 - b _081CB9C0 -_081CB990: - movs r0, 0 - bl sub_81C87AC - adds r0, r5, 0 - bl sub_81CC39C - movs r0, 0 - b _081CB9C0 -_081CB9A0: - bl sub_81C8820 - cmp r0, 0 - bne _081CB9BA - adds r0, r5, 0 - bl sub_81CC42C - cmp r0, 0 - bne _081CB9BA - bl sub_81C7BE8 - cmp r0, 0 - beq _081CB9BE -_081CB9BA: - movs r0, 0x2 - b _081CB9C0 -_081CB9BE: - movs r0, 0x4 -_081CB9C0: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81CB93C - - thumb_func_start sub_81CB9C8 -sub_81CB9C8: @ 81CB9C8 - push {r4,r5,lr} - adds r5, r0, 0 - movs r0, 0x6 - bl sub_81C763C - adds r4, r0, 0 - cmp r5, 0x4 - bhi _081CBA60 - lsls r0, r5, 2 - ldr r1, =_081CB9E8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081CB9E8: - .4byte _081CB9FC - .4byte _081CBA1C - .4byte _081CBA34 - .4byte _081CBA40 - .4byte _081CBA4A -_081CB9FC: - bl sub_81C8770 - bl sub_81CB0E4 - adds r5, r0, 0 - cmp r5, 0 - beq _081CBA60 - movs r0, 0x5 - bl audio_play - strh r5, [r4, 0x16] - adds r0, r4, 0 - bl sub_81CC420 - movs r0, 0 - b _081CBA62 -_081CBA1C: - adds r0, r4, 0 - bl sub_81CC42C - cmp r0, 0 - bne _081CBA5C - movs r0, 0x16 - ldrsh r1, [r4, r0] - adds r0, r4, 0 - bl sub_81CBEF8 - movs r0, 0 - b _081CBA62 -_081CBA34: - movs r1, 0x16 - ldrsh r0, [r4, r1] - bl sub_81C87AC - movs r0, 0 - b _081CBA62 -_081CBA40: - adds r0, r4, 0 - bl sub_81CC39C - movs r0, 0 - b _081CBA62 -_081CBA4A: - bl sub_81C8820 - cmp r0, 0 - bne _081CBA5C - adds r0, r4, 0 - bl sub_81CC42C - cmp r0, 0 - beq _081CBA60 -_081CBA5C: - movs r0, 0x2 - b _081CBA62 -_081CBA60: - movs r0, 0x4 -_081CBA62: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81CB9C8 - - thumb_func_start sub_81CBA68 -sub_81CBA68: @ 81CBA68 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x6 - bl sub_81C763C - adds r5, r0, 0 - cmp r4, 0x1 - beq _081CBA9C - cmp r4, 0x1 - bgt _081CBA82 - cmp r4, 0 - beq _081CBA88 - b _081CBACC -_081CBA82: - cmp r4, 0x2 - beq _081CBABE - b _081CBACC -_081CBA88: - movs r0, 0x5 - bl audio_play - adds r0, r5, 0 - bl sub_81CC420 - bl sub_81C87F0 - movs r0, 0 - b _081CBACE -_081CBA9C: - bl sub_81C8820 - cmp r0, 0 - bne _081CBAC8 - adds r0, r5, 0 - bl sub_81CC42C - cmp r0, 0 - bne _081CBAC8 - movs r0, 0x6 - bl sub_81C7BA4 - adds r0, r5, 0 - bl sub_81CBDC0 - movs r0, 0 - b _081CBACE -_081CBABE: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _081CBACC -_081CBAC8: - movs r0, 0x2 - b _081CBACE -_081CBACC: - movs r0, 0x4 -_081CBACE: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81CBA68 - - thumb_func_start sub_81CBAD4 -sub_81CBAD4: @ 81CBAD4 - push {r4,r5,lr} - adds r5, r0, 0 - movs r0, 0x6 - bl sub_81C763C - adds r4, r0, 0 - cmp r5, 0x4 - bhi _081CBB6C - lsls r0, r5, 2 - ldr r1, =_081CBAF4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081CBAF4: - .4byte _081CBB08 - .4byte _081CBB28 - .4byte _081CBB40 - .4byte _081CBB4C - .4byte _081CBB56 -_081CBB08: - bl sub_81C8770 - bl sub_81CB128 - adds r5, r0, 0 - cmp r5, 0 - beq _081CBB6C - movs r0, 0x5 - bl audio_play - strh r5, [r4, 0x16] - adds r0, r4, 0 - bl sub_81CC420 - movs r0, 0 - b _081CBB6E -_081CBB28: - adds r0, r4, 0 - bl sub_81CC42C - cmp r0, 0 - bne _081CBB68 - movs r0, 0x16 - ldrsh r1, [r4, r0] - adds r0, r4, 0 - bl sub_81CBEF8 - movs r0, 0 - b _081CBB6E -_081CBB40: - movs r1, 0x16 - ldrsh r0, [r4, r1] - bl sub_81C87AC - movs r0, 0 - b _081CBB6E -_081CBB4C: - adds r0, r4, 0 - bl sub_81CC39C - movs r0, 0 - b _081CBB6E -_081CBB56: - bl sub_81C8820 - cmp r0, 0 - bne _081CBB68 - adds r0, r4, 0 - bl sub_81CC42C - cmp r0, 0 - beq _081CBB6C -_081CBB68: - movs r0, 0x2 - b _081CBB6E -_081CBB6C: - movs r0, 0x4 -_081CBB6E: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81CBAD4 - - thumb_func_start sub_81CBB74 -sub_81CBB74: @ 81CBB74 - push {lr} - cmp r0, 0 - beq _081CBB80 - cmp r0, 0x1 - beq _081CBB9A - b _081CBBB2 -_081CBB80: - movs r0, 0x5 - bl audio_play - movs r0, 0 - bl sub_81CBC38 - movs r0, 0 - bl sub_81C7AC0 - bl sub_81C78A0 - movs r0, 0 - b _081CBBB4 -_081CBB9A: - bl sub_81C7B34 - cmp r0, 0 - bne _081CBBAA - bl sub_81C78C0 - cmp r0, 0 - beq _081CBBAE -_081CBBAA: - movs r0, 0x2 - b _081CBBB4 -_081CBBAE: - bl sub_81C7FDC -_081CBBB2: - movs r0, 0x4 -_081CBBB4: - pop {r1} - bx r1 - thumb_func_end sub_81CBB74 - - thumb_func_start sub_81CBBB8 -sub_81CBBB8: @ 81CBBB8 - push {lr} - sub sp, 0x18 - bl sub_81CAE94 - str r0, [sp] - bl sub_81CAE38 - mov r1, sp - movs r2, 0 - strh r0, [r1, 0x4] - movs r0, 0x4 - strb r0, [r1, 0x8] - mov r0, sp - strh r2, [r0, 0x6] - movs r0, 0xD - strb r0, [r1, 0x9] - movs r0, 0x10 - strb r0, [r1, 0xA] - movs r0, 0x1 - strb r0, [r1, 0xB] - movs r0, 0x8 - strb r0, [r1, 0xC] - movs r0, 0x3 - strb r0, [r1, 0xD] - movs r0, 0x7 - strb r0, [r1, 0xE] - ldr r0, =sub_81CB050 - str r0, [sp, 0x10] - ldr r0, =sub_81CBCEC - str r0, [sp, 0x14] - ldr r0, =gUnknown_08622794 - movs r2, 0x2 - bl sub_81C81D4 - ldr r0, =sub_81CBC64 - movs r1, 0x7 - bl AddTask - add sp, 0x18 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CBBB8 - - thumb_func_start sub_81CBC1C -sub_81CBC1C: @ 81CBC1C - push {lr} - bl sub_81C8234 - ldr r0, =sub_81CBC64 - bl get_task_id_by_function - lsls r0, 24 - lsrs r0, 24 - bl remove_task - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CBC1C - - thumb_func_start sub_81CBC38 -sub_81CBC38: @ 81CBC38 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =sub_81CBC64 - bl get_task_id_by_function - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - beq _081CBC56 - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - strh r4, [r0, 0x26] -_081CBC56: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CBC38 - - thumb_func_start sub_81CBC64 -sub_81CBC64: @ 81CBC64 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r2, r1, r0 - movs r1, 0x1E - ldrsh r0, [r2, r1] - cmp r0, 0 - beq _081CBCC8 - ldrh r0, [r2] - adds r0, 0x4 - movs r1, 0x7F - ands r0, r1 - strh r0, [r2] - ldr r1, =gUnknown_08329F40 - movs r3, 0 - ldrsh r0, [r2, r3] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 20 - strh r0, [r2, 0x2] - ldr r0, =gUnknown_08622720 - adds r1, r0, 0 - adds r1, 0x20 - movs r3, 0x2 - ldrsh r2, [r2, r3] - str r2, [sp] - ldr r4, =0x020377b4 - str r4, [sp, 0x4] - movs r2, 0x10 - movs r3, 0x10 - bl sub_81C79BC - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081CBCC8 - ldr r1, =0x02037bb4 - ldr r2, =0x04000008 - adds r0, r4, 0 - bl CpuSet -_081CBCC8: - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CBC64 - - thumb_func_start sub_81CBCEC -sub_81CBCEC: @ 81CBCEC - push {r4-r6,lr} - adds r5, r1, 0 - adds r4, r2, 0 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl GetWindowAttribute - lsls r0, 24 - lsrs r0, 24 - bl GetBgTilemapBuffer - adds r6, r0, 0 - lsls r4, 7 - adds r4, 0x3A - adds r6, r4 - adds r0, r5, 0 - bl sub_81CAEBC - cmp r0, 0 - beq _081CBD30 - movs r1, 0xA0 - lsls r1, 7 - adds r0, r1, 0 - strh r0, [r6] - adds r1, r6, 0 - adds r1, 0x40 - ldr r2, =0x00005001 - adds r0, r2, 0 - strh r0, [r1] - b _081CBD3C - .pool -_081CBD30: - ldr r0, =0x00005002 - adds r1, r0, 0 - strh r1, [r6] - adds r0, r6, 0 - adds r0, 0x40 - strh r1, [r0] -_081CBD3C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CBCEC - - thumb_func_start sub_81CBD48 -sub_81CBD48: @ 81CBD48 - push {r4,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl GetWindowAttribute - lsls r0, 24 - lsrs r0, 24 - bl GetBgTilemapBuffer - lsls r4, 7 - adds r4, 0x3A - adds r0, r4 - ldr r2, =0x00005002 - adds r1, r2, 0 - strh r1, [r0] - adds r0, 0x40 - strh r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CBD48 - - thumb_func_start sub_81CBD78 -sub_81CBD78: @ 81CBD78 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gUnknown_086227D8 - bl AddWindow - strh r0, [r4, 0x10] - ldr r0, =gUnknown_086227E0 - bl AddWindow - strh r0, [r4, 0x12] - ldrb r0, [r4, 0x10] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldrb r0, [r4, 0x10] - bl PutWindowTilemap - ldrb r0, [r4, 0x12] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldrb r0, [r4, 0x12] - bl PutWindowTilemap - ldrb r0, [r4, 0x10] - movs r1, 0x1 - bl CopyWindowToVram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CBD78 - - thumb_func_start sub_81CBDC0 -sub_81CBDC0: @ 81CBDC0 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4, 0x12] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldrh r0, [r4, 0x12] - bl sub_81CBDF4 - ldrh r0, [r4, 0x12] - bl sub_81CBE0C - ldrh r0, [r4, 0x12] - bl sub_81CBE38 - ldrh r0, [r4, 0x12] - bl sub_81CBE50 - ldrb r0, [r4, 0x12] - movs r1, 0x2 - bl CopyWindowToVram - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81CBDC0 - - thumb_func_start sub_81CBDF4 -sub_81CBDF4: @ 81CBDF4 - push {lr} - lsls r0, 16 - lsrs r0, 16 - ldr r1, =gUnknown_085EBE5F - movs r2, 0 - bl sub_81CBE88 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CBDF4 - - thumb_func_start sub_81CBE0C -sub_81CBE0C: @ 81CBE0C - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl sub_81CAE38 - adds r1, r0, 0 - mov r0, sp - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - adds r0, r4, 0 - mov r1, sp - movs r2, 0x1 - bl sub_81CBEB4 - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81CBE0C - - thumb_func_start sub_81CBE38 -sub_81CBE38: @ 81CBE38 - push {lr} - lsls r0, 16 - lsrs r0, 16 - ldr r1, =gUnknown_085EBE6E - movs r2, 0x2 - bl sub_81CBE88 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CBE38 - - thumb_func_start sub_81CBE50 -sub_81CBE50: @ 81CBE50 - push {r4,lr} - sub sp, 0x8 - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0x9 - bl sub_80847F8 - adds r1, r0, 0 - ldr r0, =0x0001869f - cmp r1, r0 - ble _081CBE68 - adds r1, r0, 0 -_081CBE68: - mov r0, sp - movs r2, 0 - movs r3, 0x5 - bl ConvertIntToDecimalString - adds r0, r4, 0 - mov r1, sp - movs r2, 0x3 - bl sub_81CBEB4 - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CBE50 - - thumb_func_start sub_81CBE88 -sub_81CBE88: @ 81CBE88 - push {lr} - sub sp, 0xC - adds r3, r1, 0 - lsls r2, 4 - adds r2, 0x1 - lsls r0, 24 - lsrs r0, 24 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x7 - adds r2, r3, 0 - movs r3, 0x2 - bl Print - add sp, 0xC - pop {r0} - bx r0 - thumb_func_end sub_81CBE88 - - thumb_func_start sub_81CBEB4 -sub_81CBEB4: @ 81CBEB4 - push {r4-r6,lr} - sub sp, 0xC - adds r5, r0, 0 - adds r6, r1, 0 - adds r4, r2, 0 - lsls r5, 16 - lsrs r5, 16 - movs r0, 0x7 - movs r2, 0x56 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - lsls r4, 4 - adds r4, 0x1 - lsls r5, 24 - lsrs r5, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - str r4, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r5, 0 - movs r1, 0x7 - adds r2, r6, 0 - bl Print - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81CBEB4 - - thumb_func_start sub_81CBEF8 -sub_81CBEF8: @ 81CBEF8 - push {r4,r5,lr} - sub sp, 0x2C - adds r5, r0, 0 - adds r4, r1, 0 - bl sub_81C875C - adds r0, r4 - bl sub_81CAEA4 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0xD5 - beq _081CBF1C - add r0, sp, 0xC - movs r2, 0 - bl GetMapName - b _081CBF24 -_081CBF1C: - ldr r1, =gUnknown_085EC00F - add r0, sp, 0xC - bl CopyString -_081CBF24: - movs r0, 0x7 - add r1, sp, 0xC - movs r2, 0x58 - bl GetStringCenterAlignXOffset - adds r4, r0, 0 - ldrb r0, [r5, 0x10] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldrb r0, [r5, 0x10] - lsls r4, 24 - lsrs r4, 24 - movs r1, 0x1 - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0x7 - add r2, sp, 0xC - adds r3, r4, 0 - bl Print - add sp, 0x2C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CBEF8 - - thumb_func_start sub_81CBF60 -sub_81CBF60: @ 81CBF60 - push {r4-r6,lr} - sub sp, 0xC - adds r5, r0, 0 - ldrb r0, [r5, 0x12] - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r4, 0 - movs r6, 0x80 - lsls r6, 17 - b _081CBF9C -_081CBF76: - ldrb r0, [r5, 0x12] - ldr r2, =gUnknown_086227E8 - lsls r1, 2 - adds r1, r2 - ldr r2, [r1] - lsrs r1, r6, 24 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x7 - movs r3, 0x10 - bl Print - movs r0, 0x80 - lsls r0, 21 - adds r6, r0 - adds r4, 0x1 -_081CBF9C: - cmp r4, 0x2 - bhi _081CBFAE - adds r0, r4, 0 - bl sub_81CB02C - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x3 - bne _081CBF76 -_081CBFAE: - ldrb r0, [r5, 0x12] - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CBF60 - - thumb_func_start sub_81CBFC4 -sub_81CBFC4: @ 81CBFC4 - push {r4,lr} - adds r4, r0, 0 - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _081CBFD6 - movs r0, 0x1 - b _081CBFE8 -_081CBFD6: - bl sub_81CB01C - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_81CC2F0 - movs r0, 0 -_081CBFE8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CBFC4 - - thumb_func_start sub_81CBFF0 -sub_81CBFF0: @ 81CBFF0 - push {r4,lr} - adds r4, r0, 0 - bl sub_81CC330 - adds r0, r4, 0 - bl sub_81CBDC0 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81CBFF0 - - thumb_func_start sub_81CC004 -sub_81CC004: @ 81CC004 - push {lr} - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_81CC004 - - thumb_func_start sub_81CC014 -sub_81CC014: @ 81CC014 - push {r4,lr} - adds r4, r0, 0 - bl sub_81CC330 - ldrb r0, [r4, 0x12] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldrb r0, [r4, 0x12] - movs r1, 0x2 - bl CopyWindowToVram - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81CC014 - - thumb_func_start sub_81CC034 -sub_81CC034: @ 81CC034 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gUnknown_08622808 - bl AddWindow - strh r0, [r4, 0x14] - ldrh r0, [r4, 0x14] - movs r1, 0x1 - movs r2, 0x4 - bl sub_8197184 - bl sub_81C7B40 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CC034 - - thumb_func_start sub_81CC058 -sub_81CC058: @ 81CC058 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x14] - movs r1, 0x1 - movs r2, 0x4 - bl sub_8197184 - ldrh r0, [r4, 0x14] - movs r1, 0x1 - movs r2, 0x4 - bl sub_81971C4 - ldrb r0, [r4, 0x14] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldrb r0, [r4, 0x14] - bl PutWindowTilemap - ldrb r0, [r4, 0x14] - movs r1, 0x3 - bl CopyWindowToVram - bl sub_81C7CCC - movs r2, 0 - movs r1, 0x18 - strh r1, [r0, 0x20] - movs r1, 0x70 - strh r1, [r0, 0x22] - strh r2, [r0, 0x26] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81CC058 - - thumb_func_start sub_81CC09C -sub_81CC09C: @ 81CC09C - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4, 0x14] - movs r1, 0x1 - movs r2, 0x40 - bl sub_809882C - ldrb r0, [r4, 0x14] - movs r1, 0x1 - movs r2, 0x4 - bl sub_8098858 - ldrb r0, [r4, 0x14] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldrb r0, [r4, 0x14] - bl PutWindowTilemap - ldrb r0, [r4, 0x14] - movs r1, 0x3 - bl CopyWindowToVram - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81CC09C - - thumb_func_start sub_81CC0D0 -sub_81CC0D0: @ 81CC0D0 - push {lr} - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_81CC0D0 - - thumb_func_start sub_81CC0E0 -sub_81CC0E0: @ 81CC0E0 - push {lr} - sub sp, 0xC - ldrb r0, [r0, 0x14] - ldr r2, =gUnknown_086227F4 - movs r1, 0x1 - str r1, [sp] - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x20 - bl Print - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CC0E0 - - thumb_func_start sub_81CC104 -sub_81CC104: @ 81CC104 - push {r4,lr} - adds r4, r0, 0 - bl RunTextPrinters - ldrb r0, [r4, 0x14] - bl IsTextPrinterActive - lsls r0, 16 - lsrs r0, 16 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CC104 - - thumb_func_start sub_81CC11C -sub_81CC11C: @ 81CC11C - push {lr} - sub sp, 0xC - ldrb r0, [r0, 0x14] - ldr r2, =gUnknown_085EBF95 - movs r1, 0x1 - str r1, [sp] - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CC11C - - thumb_func_start sub_81CC140 -sub_81CC140: @ 81CC140 - push {r4,lr} - adds r4, r0, 0 - bl RunTextPrinters - ldrb r0, [r4, 0x14] - bl IsTextPrinterActive - lsls r0, 16 - lsrs r0, 16 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CC140 - - thumb_func_start sub_81CC158 -sub_81CC158: @ 81CC158 - push {r4,r5,lr} - sub sp, 0xC - adds r4, r0, 0 - bl sub_81C875C - adds r1, r4, 0 - adds r1, 0xF - bl sub_81CAF78 - adds r5, r0, 0 - bl sav2_get_text_speed - lsls r0, 24 - lsrs r0, 24 - ldrb r2, [r4, 0x14] - movs r1, 0x1 - str r1, [sp] - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r2, 0 - adds r2, r5, 0 - movs r3, 0x20 - bl Print - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81CC158 - - thumb_func_start sub_81CC194 -sub_81CC194: @ 81CC194 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2C] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081CC1B8 - ldr r0, =0x03003014 - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] - b _081CC1C4 - .pool -_081CC1B8: - ldr r2, =0x03003014 - ldrb r1, [r2] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_081CC1C4: - bl RunTextPrinters - ldrb r0, [r4, 0x14] - bl IsTextPrinterActive - lsls r0, 16 - lsrs r0, 16 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CC194 - - thumb_func_start sub_81CC1DC -sub_81CC1DC: @ 81CC1DC - push {lr} - sub sp, 0x8 - bl sub_81C7CE4 - movs r0, 0x20 - str r0, [sp] - movs r0, 0x14 - str r0, [sp, 0x4] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - add sp, 0x8 - pop {r0} - bx r0 - thumb_func_end sub_81CC1DC - - thumb_func_start sub_81CC204 -sub_81CC204: @ 81CC204 - push {lr} - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_81CC204 - - thumb_func_start sub_81CC214 -sub_81CC214: @ 81CC214 - push {r4-r6,lr} - sub sp, 0x8 - movs r0, 0x6 - bl sub_81C763C - adds r6, r0, 0 - movs r5, 0 - ldr r4, =gUnknown_08622810 -_081CC224: - adds r0, r4, 0 - bl LoadCompressedObjectPic - adds r4, 0x8 - adds r5, 0x1 - cmp r5, 0 - beq _081CC224 - ldr r0, =gUnknown_08622818 - bl sub_81C795C - movs r0, 0 - str r0, [r6, 0x1C] - ldr r1, =0x00001828 - adds r0, r6, r1 - str r0, [sp] - ldr r1, =0xffff0000 - ldr r0, [sp, 0x4] - ands r0, r1 - movs r1, 0x80 - lsls r1, 4 - orrs r0, r1 - ldr r1, =0x0000ffff - ands r0, r1 - movs r1, 0x80 - lsls r1, 12 - orrs r0, r1 - str r0, [sp, 0x4] - mov r0, sp - bl LoadObjectPic - ldr r2, =0x00001824 - adds r1, r6, r2 - lsls r0, 16 - lsrs r0, 11 - ldr r2, =0x06010000 - adds r0, r2 - str r0, [r1] - movs r0, 0xD - bl AllocObjectPalette - lsls r0, 24 - lsrs r0, 20 - movs r1, 0x80 - lsls r1, 1 - adds r0, r1 - strh r0, [r6, 0x1A] - bl sub_81CC370 - str r0, [r6, 0x20] - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CC214 - - thumb_func_start sub_81CC2B4 -sub_81CC2B4: @ 81CC2B4 - push {r4,lr} - movs r0, 0x6 - bl sub_81C763C - adds r4, r0, 0 - ldr r0, [r4, 0x1C] - cmp r0, 0 - beq _081CC2C8 - bl RemoveObjectAndFreeTiles -_081CC2C8: - ldr r0, [r4, 0x20] - cmp r0, 0 - beq _081CC2D2 - bl RemoveObjectAndFreeTiles -_081CC2D2: - movs r0, 0x8 - bl FreeObjectTilesByTag - movs r0, 0x7 - bl FreeObjectTilesByTag - movs r0, 0xC - bl FreeObjectPaletteByTag - movs r0, 0xD - bl FreeObjectPaletteByTag - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81CC2B4 - - thumb_func_start sub_81CC2F0 -sub_81CC2F0: @ 81CC2F0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldr r0, [r4, 0x1C] - cmp r0, 0 - bne _081CC320 - ldr r0, =gUnknown_08622830 - movs r1, 0x4 - movs r2, 0x50 - movs r3, 0x5 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - str r1, [r4, 0x1C] - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_81CC344 -_081CC320: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CC2F0 - - thumb_func_start sub_81CC330 -sub_81CC330: @ 81CC330 - push {r4,lr} - adds r4, r0, 0 - ldr r0, [r4, 0x1C] - bl RemoveObjectAndFreeTiles - movs r0, 0 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81CC330 - - thumb_func_start sub_81CC344 -sub_81CC344: @ 81CC344 - ldr r0, [r0, 0x1C] - lsls r1, 4 - strh r1, [r0, 0x26] - bx lr - thumb_func_end sub_81CC344 - - thumb_func_start sub_81CC34C -sub_81CC34C: @ 81CC34C - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x2E] - adds r0, 0x1 - strh r0, [r2, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _081CC36C - movs r0, 0 - strh r0, [r2, 0x2E] - ldrh r0, [r2, 0x24] - adds r0, 0x1 - movs r1, 0x7 - ands r0, r1 - strh r0, [r2, 0x24] -_081CC36C: - pop {r0} - bx r0 - thumb_func_end sub_81CC34C - - thumb_func_start sub_81CC370 -sub_81CC370: @ 81CC370 - push {lr} - ldr r0, =gUnknown_08622850 - movs r1, 0x2C - movs r2, 0x68 - movs r3, 0x6 - bl AddObjectToFront - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CC370 - - thumb_func_start sub_81CC39C -sub_81CC39C: @ 81CC39C - push {r4-r7,lr} - adds r7, r0, 0 - bl sub_81C875C - bl sub_81CAF04 - cmp r0, 0 - blt _081CC400 - lsls r4, r0, 3 - ldr r0, =gTrainerFrontPicTable - adds r0, r4, r0 - ldr r1, =0x00001828 - adds r5, r7, r1 - adds r1, r5, 0 - movs r2, 0 - bl DecompressPicFromTable - ldr r0, =gTrainerFrontPicPaletteTable - adds r4, r0 - ldr r0, [r4] - ldr r1, =0x00002028 - adds r6, r7, r1 - adds r1, r6, 0 - bl LZ77UnCompWram - ldr r1, =0x00001824 - adds r0, r7, r1 - ldr r1, [r0] - movs r2, 0x80 - lsls r2, 4 - adds r0, r5, 0 - movs r3, 0x1 - bl RequestDma3Copy - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldrh r1, [r7, 0x1A] - adds r0, r6, 0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r1, [r7, 0x20] - movs r0, 0 - strh r0, [r1, 0x2E] - ldr r0, [r7, 0x20] - strh r4, [r0, 0x3C] - ldr r1, [r7, 0x20] - ldr r0, =sub_81CC440 - str r0, [r1, 0x1C] -_081CC400: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CC39C - - thumb_func_start sub_81CC420 -sub_81CC420: @ 81CC420 - ldr r1, [r0, 0x20] - ldr r0, =sub_81CC4A4 - str r0, [r1, 0x1C] - bx lr - .pool - thumb_func_end sub_81CC420 - - thumb_func_start sub_81CC42C -sub_81CC42C: @ 81CC42C - ldr r0, [r0, 0x20] - ldr r1, [r0, 0x1C] - ldr r0, =DummyObjectCallback - eors r1, r0 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - bx lr - .pool - thumb_func_end sub_81CC42C - - thumb_func_start sub_81CC440 -sub_81CC440: @ 81CC440 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _081CC452 - cmp r0, 0x1 - beq _081CC484 - b _081CC498 -_081CC452: - movs r1, 0x3C - ldrsh r0, [r4, r1] - bl CheckForSpaceForDma3Request - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _081CC498 - ldr r0, =0x0000ffb0 - strh r0, [r4, 0x24] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _081CC498 - .pool -_081CC484: - ldrh r0, [r4, 0x24] - adds r0, 0x8 - strh r0, [r4, 0x24] - lsls r0, 16 - cmp r0, 0 - blt _081CC498 - movs r0, 0 - strh r0, [r4, 0x24] - ldr r0, =DummyObjectCallback - str r0, [r4, 0x1C] -_081CC498: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CC440 - - thumb_func_start sub_81CC4A4 -sub_81CC4A4: @ 81CC4A4 - push {lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x24] - subs r0, 0x8 - strh r0, [r3, 0x24] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x50 - negs r1, r1 - cmp r0, r1 - bgt _081CC4CA - adds r2, r3, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =DummyObjectCallback - str r0, [r3, 0x1C] -_081CC4CA: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CC4A4 - - thumb_func_start sub_81CC4D4 -sub_81CC4D4: @ 81CC4D4 - push {r4,lr} - movs r0, 0x3 - movs r1, 0x14 - bl sub_81C761C - adds r4, r0, 0 - cmp r4, 0 - beq _081CC4F0 - ldr r1, =0x00000884 - movs r0, 0x10 - bl sub_81C761C - cmp r0, 0 - bne _081CC4F8 -_081CC4F0: - movs r0, 0 - b _081CC51A - .pool -_081CC4F8: - ldr r0, =0x02037318 - ldrb r0, [r0, 0x14] - bl sub_8124668 - str r0, [r4, 0xC] - cmp r0, 0 - bne _081CC514 - ldr r0, =sub_81CC568 - b _081CC516 - .pool -_081CC514: - ldr r0, =sub_81CC5B4 -_081CC516: - str r0, [r4, 0x10] - movs r0, 0x1 -_081CC51A: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CC4D4 - - thumb_func_start sub_81CC524 -sub_81CC524: @ 81CC524 - push {lr} - bl sub_8124658 - ldr r1, =0x03005d90 - ldr r3, [r1] - movs r1, 0x1 - ands r1, r0 - lsls r1, 3 - ldrb r2, [r3, 0x15] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x15] - movs r0, 0x10 - bl sub_81C7650 - movs r0, 0x3 - bl sub_81C7650 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CC524 - - thumb_func_start sub_81CC554 -sub_81CC554: @ 81CC554 - push {lr} - movs r0, 0x3 - bl sub_81C763C - ldr r1, [r0, 0x10] - bl _call_via_r1 - pop {r1} - bx r1 - thumb_func_end sub_81CC554 - - thumb_func_start sub_81CC568 -sub_81CC568: @ 81CC568 - push {r4,lr} - adds r4, r0, 0 - bl sub_81230AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - beq _081CC58C - cmp r0, 0x4 - bgt _081CC582 - cmp r0, 0x3 - beq _081CC588 - b _081CC5AC -_081CC582: - cmp r0, 0x5 - beq _081CC59E - b _081CC5AC -_081CC588: - movs r0, 0x1 - b _081CC5AE -_081CC58C: - bl sub_8124658 - lsls r0, 24 - cmp r0, 0 - bne _081CC59A - movs r0, 0x3 - b _081CC5AE -_081CC59A: - movs r0, 0x2 - b _081CC5AE -_081CC59E: - ldr r0, =sub_81CC5DC - str r0, [r4, 0x10] - movs r0, 0x4 - b _081CC5AE - .pool -_081CC5AC: - movs r0, 0 -_081CC5AE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CC568 - - thumb_func_start sub_81CC5B4 -sub_81CC5B4: @ 81CC5B4 - push {lr} - adds r2, r0, 0 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _081CC5CC - movs r0, 0 - b _081CC5D2 - .pool -_081CC5CC: - ldr r0, =sub_81CC5DC - str r0, [r2, 0x10] - movs r0, 0x4 -_081CC5D2: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CC5B4 - - thumb_func_start sub_81CC5DC -sub_81CC5DC: @ 81CC5DC - ldr r0, =0x000186a1 - bx lr - .pool - thumb_func_end sub_81CC5DC - - thumb_func_start sub_81CC5E4 -sub_81CC5E4: @ 81CC5E4 - push {lr} - movs r0, 0x3 - bl sub_81C763C - ldr r0, [r0, 0xC] - pop {r1} - bx r1 - thumb_func_end sub_81CC5E4 - - thumb_func_start sub_81CC5F4 -sub_81CC5F4: @ 81CC5F4 - push {r4,lr} - ldr r1, =0x00001948 - movs r0, 0x4 - bl sub_81C761C - adds r4, r0, 0 - cmp r4, 0 - beq _081CC624 - ldr r0, =sub_81CC6F4 - movs r1, 0x1 - bl sub_81C7078 - str r0, [r4, 0x4] - ldr r0, =sub_81CC6BC - str r0, [r4] - movs r0, 0x1 - b _081CC626 - .pool -_081CC624: - movs r0, 0 -_081CC626: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CC5F4 - - thumb_func_start sub_81CC62C -sub_81CC62C: @ 81CC62C - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x4 - bl sub_81C763C - adds r5, r0, 0 - ldr r0, =gUnknown_086230E4 - lsls r4, 2 - adds r4, r0 - ldr r0, [r4] - movs r1, 0x1 - bl sub_81C7078 - str r0, [r5, 0x4] - ldr r0, =sub_81CC6BC - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CC62C - - thumb_func_start sub_81CC65C -sub_81CC65C: @ 81CC65C - push {lr} - movs r0, 0x4 - bl sub_81C763C - ldr r0, [r0] - bl _call_via_r0 - pop {r1} - bx r1 - thumb_func_end sub_81CC65C - - thumb_func_start sub_81CC670 -sub_81CC670: @ 81CC670 - push {r4,lr} - movs r0, 0x4 - bl sub_81C763C - adds r4, r0, 0 - bl sub_812305C - bl sub_81CC9EC - ldrb r0, [r4, 0x8] - bl RemoveWindow - movs r0, 0x10 - bl sub_81C7650 - movs r0, 0x4 - bl sub_81C7650 - bl sub_81C760C - movs r0, 0 - bl SetBgMode - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81CC670 - - thumb_func_start sub_81CC6A4 -sub_81CC6A4: @ 81CC6A4 - push {lr} - bl copy_pal_bg_faded_to_pal_ram - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl sub_81237B4 - pop {r0} - bx r0 - thumb_func_end sub_81CC6A4 - - thumb_func_start sub_81CC6BC -sub_81CC6BC: @ 81CC6BC - push {lr} - movs r0, 0x4 - bl sub_81C763C - ldr r0, [r0, 0x4] - bl sub_81C70D8 - pop {r1} - bx r1 - thumb_func_end sub_81CC6BC - - thumb_func_start sub_81CC6D0 -sub_81CC6D0: @ 81CC6D0 - push {lr} - bl sub_81CC5E4 - cmp r0, 0 - bne _081CC6EC - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x15] - lsrs r0, 3 - movs r1, 0x1 - ands r0, r1 - b _081CC6EE - .pool -_081CC6EC: - movs r0, 0 -_081CC6EE: - pop {r1} - bx r1 - thumb_func_end sub_81CC6D0 - - thumb_func_start sub_81CC6F4 -sub_81CC6F4: @ 81CC6F4 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x4 - bl sub_81C763C - adds r5, r0, 0 - cmp r4, 0x7 - bls _081CC706 - b _081CC83E -_081CC706: - lsls r0, r4, 2 - ldr r1, =_081CC714 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081CC714: - .4byte _081CC734 - .4byte _081CC784 - .4byte _081CC7B6 - .4byte _081CC7BE - .4byte _081CC7CE - .4byte _081CC7E2 - .4byte _081CC804 - .4byte _081CC82A -_081CC734: - movs r0, 0 - bl c3args_set_0toR1_1to0 - movs r0, 0x1 - bl HideBg - movs r0, 0x2 - bl HideBg - movs r0, 0x3 - bl HideBg - movs r0, 0x1 - bl SetBgMode - ldr r4, =gUnknown_086230D8 - adds r0, r4, 0 - movs r1, 0x2 - bl sub_81C7B54 - movs r0, 0x10 - bl sub_81C763C - adds r5, r0, 0 - adds r4, 0x4 - bl sub_81CC6D0 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8122CF8 - bl sub_81CC9C0 -_081CC77C: - movs r0, 0 - b _081CC840 - .pool -_081CC784: - bl sub_8122DB0 - lsls r0, 24 - cmp r0, 0 - bne _081CC83A - bl sub_81CC5E4 - cmp r0, 0 - bne _081CC7AC - movs r0, 0x4 - movs r1, 0x9 - bl sub_8124288 - movs r0, 0x5 - movs r1, 0xA - bl sub_81240D4 - bl sub_812454C - b _081CC77C -_081CC7AC: - movs r0, 0 - movs r1, 0x6 - bl sub_8123030 - b _081CC77C -_081CC7B6: - bl sub_81CCD10 -_081CC7BA: - movs r0, 0x1 - b _081CC840 -_081CC7BE: - bl sub_81CCD24 - cmp r0, 0 - bne _081CC83A - adds r0, r5, 0 - bl sub_81CCA1C - b _081CC7BA -_081CC7CE: - bl sub_81CCAFC - cmp r0, 0 - bne _081CC83A - adds r0, r5, 0 - bl sub_81CCB0C - bl sub_81C7B40 - b _081CC77C -_081CC7E2: - adds r0, r5, 0 - bl sub_81CCC4C - cmp r0, 0 - bne _081CC83A - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - ldr r0, =sub_81CC6A4 - bl c3args_set_0toR1_1to0 - b _081CC77C - .pool -_081CC804: - bl sub_81CC6D0 - lsls r0, 24 - movs r4, 0x5 - cmp r0, 0 - bne _081CC812 - movs r4, 0x4 -_081CC812: - adds r0, r4, 0 - bl sub_81C7DFC - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0x1 - bl sub_81C7FA0 - movs r0, 0x1 - bl sub_81C7AC0 - b _081CC77C -_081CC82A: - bl sub_81C7B34 - cmp r0, 0 - bne _081CC83A - bl sub_81C8010 - cmp r0, 0 - beq _081CC7BA -_081CC83A: - movs r0, 0x2 - b _081CC840 -_081CC83E: - movs r0, 0x4 -_081CC840: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81CC6F4 - - thumb_func_start sub_81CC848 -sub_81CC848: @ 81CC848 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x4 - bl sub_81C763C - cmp r4, 0 - beq _081CC85C - cmp r4, 0x1 - beq _081CC864 - b _081CC870 -_081CC85C: - bl sub_81CCB0C - movs r0, 0 - b _081CC872 -_081CC864: - bl sub_81CCC4C - cmp r0, 0 - beq _081CC870 - movs r0, 0x2 - b _081CC872 -_081CC870: - movs r0, 0x4 -_081CC872: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CC848 - - thumb_func_start sub_81CC878 -sub_81CC878: @ 81CC878 - push {lr} - cmp r0, 0x1 - beq _081CC8A2 - cmp r0, 0x1 - bgt _081CC888 - cmp r0, 0 - beq _081CC88E - b _081CC8D0 -_081CC888: - cmp r0, 0x2 - beq _081CC8BE - b _081CC8D0 -_081CC88E: - movs r0, 0x5 - bl audio_play - movs r0, 0 - bl sub_81CCC5C - bl sub_8123418 - movs r0, 0 - b _081CC8D2 -_081CC8A2: - bl sub_8123514 - lsls r0, 24 - cmp r0, 0 - bne _081CC8C6 - bl sub_81CCC88 - cmp r0, 0 - bne _081CC8C6 - movs r0, 0x1 - bl sub_81C7BA4 - movs r0, 0 - b _081CC8D2 -_081CC8BE: - bl sub_81C7BE8 - cmp r0, 0 - beq _081CC8CA -_081CC8C6: - movs r0, 0x2 - b _081CC8D2 -_081CC8CA: - movs r0, 0x4 - bl sub_81C7E14 -_081CC8D0: - movs r0, 0x4 -_081CC8D2: - pop {r1} - bx r1 - thumb_func_end sub_81CC878 - - thumb_func_start sub_81CC8D8 -sub_81CC8D8: @ 81CC8D8 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x4 - bl sub_81C763C - adds r5, r0, 0 - cmp r4, 0x1 - beq _081CC90C - cmp r4, 0x1 - bgt _081CC8F2 - cmp r4, 0 - beq _081CC8FC - b _081CC952 -_081CC8F2: - cmp r4, 0x2 - beq _081CC924 - cmp r4, 0x3 - beq _081CC940 - b _081CC952 -_081CC8FC: - movs r0, 0x5 - bl audio_play - adds r0, r5, 0 - bl sub_81CCB0C - movs r0, 0 - b _081CC954 -_081CC90C: - adds r0, r5, 0 - bl sub_81CCC4C - cmp r0, 0 - bne _081CC948 - movs r0, 0x1 - bl sub_81CCC5C - bl sub_8123418 - movs r0, 0 - b _081CC954 -_081CC924: - bl sub_8123514 - lsls r0, 24 - cmp r0, 0 - bne _081CC948 - bl sub_81CCC88 - cmp r0, 0 - bne _081CC948 - movs r0, 0x2 - bl sub_81C7BA4 - movs r0, 0 - b _081CC954 -_081CC940: - bl sub_81C7BE8 - cmp r0, 0 - beq _081CC94C -_081CC948: - movs r0, 0x2 - b _081CC954 -_081CC94C: - movs r0, 0x5 - bl sub_81C7E14 -_081CC952: - movs r0, 0x4 -_081CC954: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81CC8D8 - - thumb_func_start sub_81CC95C -sub_81CC95C: @ 81CC95C - push {lr} - cmp r0, 0x1 - beq _081CC982 - cmp r0, 0x1 - bgt _081CC96C - cmp r0, 0 - beq _081CC972 - b _081CC9B8 -_081CC96C: - cmp r0, 0x2 - beq _081CC996 - b _081CC9B8 -_081CC972: - movs r0, 0x5 - bl audio_play - movs r0, 0 - bl sub_81C7AC0 - movs r0, 0 - b _081CC9BA -_081CC982: - bl sub_81C7B34 - cmp r0, 0 - bne _081CC99E - bl sub_81C7FDC - bl sub_81C78A0 - movs r0, 0 - b _081CC9BA -_081CC996: - bl sub_81C78C0 - cmp r0, 0 - beq _081CC9A2 -_081CC99E: - movs r0, 0x2 - b _081CC9BA -_081CC9A2: - movs r0, 0x1 - bl HideBg - movs r0, 0x2 - bl HideBg - movs r0, 0x3 - bl HideBg - movs r0, 0 - b _081CC9BA -_081CC9B8: - movs r0, 0x4 -_081CC9BA: - pop {r1} - bx r1 - thumb_func_end sub_81CC95C - - thumb_func_start sub_81CC9C0 -sub_81CC9C0: @ 81CC9C0 - push {r4,r5,lr} - movs r5, 0 - ldr r4, =gUnknown_086230F8 -_081CC9C6: - adds r0, r4, 0 - bl LoadCompressedObjectPic - adds r4, 0x8 - adds r5, 0x1 - cmp r5, 0 - beq _081CC9C6 - ldr r0, =gUnknown_08623100 - bl sub_81C795C - bl sub_81CCE58 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CC9C0 - - thumb_func_start sub_81CC9EC -sub_81CC9EC: @ 81CC9EC - push {r4,r5,lr} - movs r0, 0x4 - bl sub_81C763C - adds r4, r0, 0 - movs r0, 0x6 - bl FreeObjectTilesByTag - movs r0, 0xB - bl FreeObjectPaletteByTag - adds r5, r4, 0 - adds r5, 0xC - movs r4, 0x2 -_081CCA08: - ldm r5!, {r0} - bl RemoveObjectAndFreeTiles - subs r4, 0x1 - cmp r4, 0 - bge _081CCA08 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81CC9EC - - thumb_func_start sub_81CCA1C -sub_81CCA1C: @ 81CCA1C - push {r4,r5,lr} - sub sp, 0x8 - adds r5, r0, 0 - movs r0, 0x1 - movs r1, 0 - movs r2, 0x40 - movs r3, 0x1 - bl sub_8199DF0 - movs r0, 0x1 - movs r1, 0x11 - movs r2, 0x41 - movs r3, 0x1 - bl sub_8199DF0 - add r1, sp, 0x4 - movs r2, 0x82 - lsls r2, 5 - adds r0, r2, 0 - strh r0, [r1] - adds r4, r5, 0 - adds r4, 0x18 - ldr r2, =0x01000400 - adds r0, r1, 0 - adds r1, r4, 0 - bl CpuSet - movs r0, 0x1 - adds r1, r4, 0 - bl SetBgTilemapBuffer - ldr r0, =gUnknown_08623110 - bl AddWindow - movs r4, 0 - strh r0, [r5, 0x8] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x42 - movs r2, 0x40 - bl box_border_load_tiles_and_pal - ldrb r0, [r5, 0x8] - movs r1, 0x42 - movs r2, 0x4 - bl sub_8098858 - ldr r1, =gUnknown_08622888 - str r4, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldrb r0, [r5, 0x8] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldrb r0, [r5, 0x8] - bl PutWindowTilemap - ldrb r0, [r5, 0x8] - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =gUnknown_08622868 - movs r1, 0x10 - movs r2, 0x20 - bl sub_81C7944 - ldr r0, =gUnknown_08DC91E8 - movs r1, 0x30 - movs r2, 0x20 - bl sub_81C7944 - bl sub_8124658 - lsls r0, 24 - cmp r0, 0 - bne _081CCAE0 - ldr r1, =0xffffa000 - movs r0, 0x1 - movs r2, 0 - bl ChangeBgY - b _081CCAEA - .pool -_081CCAE0: - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY -_081CCAEA: - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81CCA1C - - thumb_func_start sub_81CCAFC -sub_81CCAFC: @ 81CCAFC - push {lr} - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_81CCAFC - - thumb_func_start sub_81CCB0C -sub_81CCB0C: @ 81CCB0C - push {r4,r5,lr} - sub sp, 0xC - adds r4, r0, 0 - movs r0, 0x10 - bl sub_81C763C - adds r5, r0, 0 - ldrb r0, [r5, 0x2] - cmp r0, 0x4 - bls _081CCB22 - b _081CCC40 -_081CCB22: - lsls r0, 2 - ldr r1, =_081CCB30 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081CCB30: - .4byte _081CCC1C - .4byte _081CCBDC - .4byte _081CCB44 - .4byte _081CCB8E - .4byte _081CCBDC -_081CCB44: - ldrb r0, [r4, 0x8] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldrb r0, [r4, 0x8] - movs r1, 0x2 - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0xC - bl PutWindowRectTilemap - ldrb r0, [r4, 0x8] - adds r2, r5, 0x4 - movs r1, 0x1 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x7 - movs r3, 0 - bl Print - ldrh r1, [r5] - ldrb r2, [r5, 0x3] - adds r0, r4, 0 - bl sub_81CCD70 - ldrb r0, [r4, 0x8] - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0 - bl sub_81CCFA4 - b _081CCC40 -_081CCB8E: - ldrb r0, [r4, 0x8] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldrb r0, [r4, 0x8] - movs r1, 0x2 - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0xC - bl PutWindowRectTilemap - ldrb r0, [r4, 0x8] - adds r2, r5, 0x4 - movs r1, 0x1 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x7 - movs r3, 0 - bl Print - ldr r1, =0x00001041 - movs r0, 0xC - str r0, [sp] - movs r0, 0xB - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x11 - movs r3, 0x6 - bl FillBgTilemapBufferRect - b _081CCC0C - .pool -_081CCBDC: - ldrb r0, [r4, 0x8] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldrb r0, [r4, 0x8] - bl PutWindowTilemap - ldrb r0, [r4, 0x8] - adds r2, r5, 0x4 - movs r1, 0x1 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x7 - movs r3, 0 - bl Print - ldrh r1, [r5] - ldrb r2, [r5, 0x3] - adds r0, r4, 0 - bl sub_81CCDE8 -_081CCC0C: - ldrb r0, [r4, 0x8] - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0x1 - bl sub_81CCFA4 - b _081CCC40 -_081CCC1C: - ldr r1, =0x00001041 - movs r0, 0xC - str r0, [sp] - movs r0, 0xD - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x11 - movs r3, 0x4 - bl FillBgTilemapBufferRect - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0x1 - bl sub_81CCFA4 -_081CCC40: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CCB0C - - thumb_func_start sub_81CCC4C -sub_81CCC4C: @ 81CCC4C - push {lr} - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_81CCC4C - - thumb_func_start sub_81CCC5C -sub_81CCC5C: @ 81CCC5C - push {r4,lr} - adds r4, r0, 0 - ldr r0, =sub_81CCC9C - movs r1, 0x3 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CCC5C - - thumb_func_start sub_81CCC88 -sub_81CCC88: @ 81CCC88 - push {lr} - ldr r0, =sub_81CCC9C - bl is_function_an_active_task - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CCC88 - - thumb_func_start sub_81CCC9C -sub_81CCC9C: @ 81CCC9C - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0x8 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _081CCCE0 - movs r1, 0x90 - lsls r1, 3 - movs r0, 0x1 - movs r2, 0x1 - bl ChangeBgY - cmp r0, 0 - blt _081CCCD6 - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - adds r0, r4, 0 - bl remove_task -_081CCCD6: - bl sub_81CCF78 - b _081CCD04 - .pool -_081CCCE0: - movs r1, 0x90 - lsls r1, 3 - movs r0, 0x1 - movs r2, 0x2 - bl ChangeBgY - ldr r1, =0xffffa000 - cmp r0, r1 - bgt _081CCD00 - movs r0, 0x1 - movs r2, 0 - bl ChangeBgY - adds r0, r5, 0 - bl remove_task -_081CCD00: - bl sub_81CCF78 -_081CCD04: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CCC9C - - thumb_func_start sub_81CCD10 -sub_81CCD10: @ 81CCD10 - push {lr} - ldr r0, =sub_81CCD34 - movs r1, 0x1 - bl sub_81C7078 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CCD10 - - thumb_func_start sub_81CCD24 -sub_81CCD24: @ 81CCD24 - push {lr} - ldr r0, =sub_81CCD34 - bl sub_81C7124 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CCD24 - - thumb_func_start sub_81CCD34 -sub_81CCD34: @ 81CCD34 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x4 - bl sub_81C763C - adds r2, r0, 0 - cmp r4, 0x15 - ble _081CCD48 - movs r0, 0x4 - b _081CCD62 -_081CCD48: - ldr r0, =gUnknown_08623118 - lsls r1, r4, 3 - adds r0, 0x4 - adds r1, r0 - ldr r0, [r1] - movs r1, 0xC8 - muls r1, r4 - ldr r3, =0x00000818 - adds r1, r3 - adds r1, r2, r1 - bl LZ77UnCompWram - movs r0, 0x1 -_081CCD62: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CCD34 - - thumb_func_start sub_81CCD70 -sub_81CCD70: @ 81CCD70 - push {r4-r6,lr} - sub sp, 0x8 - adds r6, r0, 0 - adds r3, r1, 0 - movs r4, 0 - ldr r0, =gUnknown_08623118 - ldrh r1, [r0] - adds r5, r0, 0 - cmp r1, r3 - bne _081CCD8A - ldrh r0, [r5, 0x2] - cmp r0, r2 - beq _081CCDA0 -_081CCD8A: - adds r4, 0x1 - cmp r4, 0x15 - bgt _081CCDA0 - lsls r0, r4, 3 - adds r1, r0, r5 - ldrh r0, [r1] - cmp r0, r3 - bne _081CCD8A - ldrh r0, [r1, 0x2] - cmp r0, r2 - bne _081CCD8A -_081CCDA0: - cmp r4, 0x16 - beq _081CCDD4 - ldr r1, =0x00001041 - movs r0, 0xC - str r0, [sp] - movs r0, 0xB - str r0, [sp, 0x4] - movs r0, 0x1 - movs r2, 0x11 - movs r3, 0x6 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0xC8 - adds r1, r4, 0 - muls r1, r0 - ldr r0, =0x00000818 - adds r1, r0 - adds r1, r6, r1 - movs r0, 0xA - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x1 - movs r2, 0x12 - movs r3, 0x6 - bl CopyToBgTilemapBufferRect -_081CCDD4: - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CCD70 - - thumb_func_start sub_81CCDE8 -sub_81CCDE8: @ 81CCDE8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0xC - mov r9, r0 - movs r5, 0 - ldr r6, =0x02021cc4 - movs r4, 0x88 - lsls r4, 21 - lsls r1, 24 - mov r8, r1 - lsls r7, r2, 24 - b _081CCE34 - .pool -_081CCE08: - adds r0, r6, 0 - movs r2, 0 - movs r3, 0xC - bl CopyStringPadded - mov r1, r9 - ldrb r0, [r1, 0x8] - lsrs r1, r4, 24 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x7 - adds r2, r6, 0 - movs r3, 0 - bl Print - movs r0, 0x80 - lsls r0, 21 - adds r4, r0 - adds r5, 0x1 -_081CCE34: - lsls r2, r5, 24 - lsrs r2, 24 - mov r1, r8 - lsrs r0, r1, 24 - lsrs r1, r7, 24 - bl sub_8145CF4 - adds r1, r0, 0 - cmp r1, 0 - bne _081CCE08 - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81CCDE8 - - thumb_func_start sub_81CCE58 -sub_81CCE58: @ 81CCE58 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r0, 0x4 - bl sub_81C763C - adds r4, r0, 0 - bl sub_8124658 - lsls r0, 24 - movs r2, 0x84 - cmp r0, 0 - bne _081CCE74 - movs r2, 0xE4 -_081CCE74: - movs r5, 0 - lsls r7, r2, 16 - adds r4, 0xC - mov r8, r4 - movs r6, 0x98 - lsls r6, 16 -_081CCE80: - asrs r1, r6, 16 - ldr r0, =gUnknown_086231D0 - asrs r2, r7, 16 - movs r3, 0x8 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r0, =0x02020630 - adds r2, r0 - movs r0, 0 - strh r0, [r2, 0x2E] - lsls r4, r5, 2 - strh r4, [r2, 0x30] - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r0, r1, 22 - adds r1, r0, 0 - strh r0, [r2, 0x32] - movs r0, 0x96 - strh r0, [r2, 0x34] - strh r4, [r2, 0x36] - adds r1, r4 - ldr r4, =0x000003ff - adds r0, r4, 0 - ands r1, r0 - ldr r4, =0xfffffc00 - adds r0, r4, 0 - ands r3, r0 - orrs r3, r1 - strh r3, [r2, 0x4] - mov r0, r8 - adds r0, 0x4 - mov r8, r0 - subs r0, 0x4 - stm r0!, {r2} - movs r4, 0x80 - lsls r4, 14 - adds r6, r4 - adds r5, 0x1 - cmp r5, 0x2 - ble _081CCE80 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CCE58 - - thumb_func_start sub_81CCEF4 -sub_81CCEF4: @ 81CCEF4 - push {r4,r5,lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x34] - movs r1, 0x34 - ldrsh r4, [r3, r1] - cmp r4, 0 - beq _081CCF06 - subs r0, 0x1 - b _081CCF6E -_081CCF06: - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xB - ble _081CCF16 - strh r4, [r3, 0x2E] -_081CCF16: - ldrh r0, [r3, 0x30] - adds r0, 0x1 - strh r0, [r3, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3C - ble _081CCF26 - strh r4, [r3, 0x30] -_081CCF26: - ldrh r5, [r3, 0x30] - ldrh r2, [r3, 0x32] - adds r1, r5, r2 - ldr r2, =0x000003ff - adds r0, r2, 0 - ands r1, r0 - ldrh r2, [r3, 0x4] - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r3, 0x4] - ldrh r1, [r3, 0x38] - movs r2, 0x38 - ldrsh r0, [r3, r2] - cmp r0, 0x3 - bgt _081CCF5C - movs r2, 0x2E - ldrsh r0, [r3, r2] - cmp r0, 0 - bne _081CCF70 - adds r0, r1, 0x1 - strh r0, [r3, 0x38] - b _081CCF6C - .pool -_081CCF5C: - lsls r0, r5, 16 - asrs r0, 16 - movs r2, 0x36 - ldrsh r1, [r3, r2] - cmp r0, r1 - bne _081CCF70 - strh r4, [r3, 0x38] - strh r4, [r3, 0x2E] -_081CCF6C: - movs r0, 0x78 -_081CCF6E: - strh r0, [r3, 0x34] -_081CCF70: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81CCEF4 - - thumb_func_start sub_81CCF78 -sub_81CCF78: @ 81CCF78 - push {r4,lr} - movs r0, 0x4 - bl sub_81C763C - adds r4, r0, 0 - movs r0, 0x1 - bl GetBgY - asrs r0, 8 - movs r1, 0x84 - subs r1, r0 - adds r4, 0xC - movs r2, 0x2 -_081CCF92: - ldm r4!, {r0} - strh r1, [r0, 0x22] - subs r2, 0x1 - cmp r2, 0 - bge _081CCF92 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81CCF78 - - thumb_func_start sub_81CCFA4 -sub_81CCFA4: @ 81CCFA4 - push {r4-r6,lr} - adds r4, r0, 0 - movs r0, 0x4 - bl sub_81C763C - movs r1, 0x1 - ands r4, r1 - lsls r5, r4, 2 - movs r6, 0x5 - negs r6, r6 - adds r4, r0, 0 - adds r4, 0xC - movs r3, 0x2 -_081CCFBE: - ldm r4!, {r0} - adds r0, 0x3E - ldrb r2, [r0] - adds r1, r6, 0 - ands r1, r2 - orrs r1, r5 - strb r1, [r0] - subs r3, 0x1 - cmp r3, 0 - bge _081CCFBE - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81CCFA4 - - thumb_func_start sub_81CCFD8 -sub_81CCFD8: @ 81CCFD8 - push {r4,lr} - ldr r1, =0x0000678c - movs r0, 0xB - bl sub_81C761C - adds r4, r0, 0 - cmp r4, 0 - beq _081CD01C - ldr r1, =0x00006428 - adds r0, r4, r1 - bl sub_81D1ED4 - bl sub_81CD970 - ldr r1, =0x030022b0 - movs r0, 0x14 - strh r0, [r1] - ldr r0, =0x00006304 - adds r1, r4, r0 - ldr r0, =sub_81CD08C - str r0, [r1] - movs r0, 0x1 - b _081CD01E - .pool -_081CD01C: - movs r0, 0 -_081CD01E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CCFD8 - - thumb_func_start sub_81CD024 -sub_81CD024: @ 81CD024 - push {r4,lr} - ldr r1, =0x0000678c - movs r0, 0xB - bl sub_81C761C - adds r4, r0, 0 - cmp r4, 0 - beq _081CD068 - ldr r1, =0x00006428 - adds r0, r4, r1 - bl sub_81D1ED4 - bl sub_81CD9F8 - ldr r1, =0x030022b0 - movs r0, 0x14 - strh r0, [r1] - ldr r0, =0x00006304 - adds r1, r4, r0 - ldr r0, =sub_81CD08C - str r0, [r1] - movs r0, 0x1 - b _081CD06A - .pool -_081CD068: - movs r0, 0 -_081CD06A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CD024 - - thumb_func_start sub_81CD070 -sub_81CD070: @ 81CD070 - push {lr} - movs r0, 0xB - bl sub_81C763C - ldr r2, =0x00006304 - adds r1, r0, r2 - ldr r1, [r1] - bl _call_via_r1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CD070 - - thumb_func_start sub_81CD08C -sub_81CD08C: @ 81CD08C - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x12 - bl sub_81C763C - adds r5, r0, 0 - adds r0, r4, 0 - bl sub_81CD1E4 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - bne _081CD100 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _081CD0D0 - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081CD100 - movs r1, 0xC6 - lsls r1, 7 - adds r0, r4, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _081CD0F0 - ldrh r1, [r5, 0x2] - ldrh r0, [r5] - subs r0, 0x1 - cmp r1, r0 - bne _081CD100 -_081CD0D0: - movs r0, 0x5 - bl audio_play - ldr r0, =0x00006304 - adds r1, r4, r0 - ldr r0, =sub_81CD19C - str r0, [r1] - movs r2, 0x2 - b _081CD100 - .pool -_081CD0F0: - movs r0, 0x5 - bl audio_play - movs r2, 0x5 - ldr r0, =0x00006304 - adds r1, r4, r0 - ldr r0, =sub_81CD110 - str r0, [r1] -_081CD100: - adds r0, r2, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CD08C - - thumb_func_start sub_81CD110 -sub_81CD110: @ 81CD110 - push {r4-r6,lr} - sub sp, 0x4 - adds r6, r0, 0 - movs r4, 0 - bl sub_811FBA4 - lsls r0, 24 - cmp r0, 0 - bne _081CD18A - bl sub_81CEF14 - ldr r1, =0x00006786 - adds r5, r6, r1 - movs r1, 0 - ldrsb r1, [r5, r1] - ldr r2, =0x00006783 - adds r4, r6, r2 - adds r1, r4, r1 - strb r0, [r1] - movs r0, 0x12 - bl sub_81C763C - ldrh r1, [r0, 0x2] - lsls r1, 2 - adds r0, r1 - ldrb r2, [r0, 0x4] - ldrb r3, [r0, 0x5] - movs r0, 0 - ldrsb r0, [r5, r0] - adds r4, r0 - ldrb r1, [r4] - mov r0, sp - strb r1, [r0] - cmp r2, 0xE - bne _081CD174 - movs r0, 0x64 - muls r0, r3 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x8 - mov r2, sp - bl pokemon_setattr - b _081CD180 - .pool -_081CD174: - adds r0, r2, 0 - adds r1, r3, 0 - movs r2, 0x8 - mov r3, sp - bl set_pokemon_data_from_any_box -_081CD180: - ldr r0, =0x00006304 - adds r1, r6, r0 - ldr r0, =sub_81CD08C - str r0, [r1] - movs r4, 0x6 -_081CD18A: - adds r0, r4, 0 - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CD110 - - thumb_func_start sub_81CD19C -sub_81CD19C: @ 81CD19C - push {lr} - movs r1, 0xC6 - lsls r1, 7 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _081CD1B4 - ldr r0, =0x000186aa - b _081CD1B6 - .pool -_081CD1B4: - ldr r0, =0x000186a2 -_081CD1B6: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CD19C - - thumb_func_start sub_81CD1C0 -sub_81CD1C0: @ 81CD1C0 - push {lr} - movs r0, 0xB - bl sub_81C763C - movs r1, 0xC6 - lsls r1, 7 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _081CD1DA - movs r0, 0x12 - bl sub_81C7650 -_081CD1DA: - movs r0, 0xB - bl sub_81C7650 - pop {r0} - bx r0 - thumb_func_end sub_81CD1C0 - - thumb_func_start sub_81CD1E4 -sub_81CD1E4: @ 81CD1E4 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x12 - bl sub_81C763C - adds r2, r0, 0 - movs r3, 0 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2C] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081CD220 - movs r1, 0xC6 - lsls r1, 7 - adds r0, r4, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _081CD210 - ldrh r0, [r2, 0x2] - cmp r0, 0 - beq _081CD24E -_081CD210: - movs r0, 0x5 - bl audio_play - movs r0, 0x1 - b _081CD246 - .pool -_081CD220: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081CD24E - movs r1, 0xC6 - lsls r1, 7 - adds r0, r4, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _081CD23E - ldrh r1, [r2, 0x2] - ldrh r0, [r2] - subs r0, 0x1 - cmp r1, r0 - bge _081CD24E -_081CD23E: - movs r0, 0x5 - bl audio_play - movs r0, 0 -_081CD246: - bl sub_81CD258 - lsls r0, 24 - lsrs r3, r0, 24 -_081CD24E: - adds r0, r3, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CD1E4 - - thumb_func_start sub_81CD258 -sub_81CD258: @ 81CD258 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r0, 0xB - bl sub_81C763C - adds r4, r0, 0 - movs r0, 0x12 - bl sub_81C763C - adds r5, r0, 0 - mov r0, r8 - cmp r0, 0 - beq _081CD284 - ldr r1, =0x00006788 - adds r0, r4, r1 - b _081CD288 - .pool -_081CD284: - ldr r2, =0x00006787 - adds r0, r4, r2 -_081CD288: - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - lsls r0, 16 - lsrs r0, 16 - adds r7, r0, 0 - ldr r1, =0x00006428 - adds r0, r4, r1 - ldr r2, =0x00006786 - adds r1, r4, r2 - movs r2, 0 - ldrsb r2, [r1, r2] - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 2 - ldr r3, =0x0000643c - adds r1, r3 - adds r1, r4, r1 - lsls r2, r7, 2 - adds r2, r7 - lsls r2, 2 - adds r2, r3 - adds r2, r4, r2 - bl sub_81D1F84 - ldrh r6, [r5, 0x2] - bl sub_81CDD5C - cmp r0, 0 - beq _081CD2D8 - ldrh r1, [r5] - b _081CD2DC - .pool -_081CD2D8: - ldrh r1, [r5] - subs r1, 0x1 -_081CD2DC: - eors r1, r6 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - adds r6, r0, 0 - mov r0, r8 - cmp r0, 0 - beq _081CD332 - ldr r1, =0x00006787 - adds r2, r4, r1 - ldrb r0, [r2] - adds r1, 0x1 - adds r3, r4, r1 - strb r0, [r3] - ldr r0, =0x00006786 - adds r1, r4, r0 - ldrb r0, [r1] - strb r0, [r2] - strb r7, [r1] - ldrb r1, [r3] - ldr r2, =0x00006789 - adds r0, r4, r2 - strb r1, [r0] - ldrh r0, [r5, 0x2] - cmp r0, 0 - bne _081CD312 - ldrh r0, [r5] -_081CD312: - subs r1, r0, 0x1 - strh r1, [r5, 0x2] - lsls r0, r1, 16 - cmp r0, 0 - beq _081CD32C - subs r1, 0x1 - b _081CD384 - .pool -_081CD32C: - ldrh r0, [r5] - subs r1, r0, 0x1 - b _081CD384 -_081CD332: - ldr r0, =0x00006788 - adds r2, r4, r0 - ldrb r0, [r2] - ldr r1, =0x00006787 - adds r3, r4, r1 - strb r0, [r3] - ldr r0, =0x00006786 - adds r1, r4, r0 - ldrb r0, [r1] - strb r0, [r2] - strb r7, [r1] - ldrb r1, [r3] - ldr r2, =0x00006789 - adds r0, r4, r2 - strb r1, [r0] - ldrh r1, [r5, 0x2] - ldrh r0, [r5] - subs r0, 0x1 - cmp r1, r0 - bge _081CD370 - adds r0, r1, 0x1 - b _081CD372 - .pool -_081CD370: - movs r0, 0 -_081CD372: - strh r0, [r5, 0x2] - ldrh r1, [r5, 0x2] - ldrh r0, [r5] - subs r0, 0x1 - cmp r1, r0 - bge _081CD382 - adds r1, 0x1 - b _081CD384 -_081CD382: - movs r1, 0 -_081CD384: - ldr r2, =0x00006302 - adds r0, r4, r2 - strh r1, [r0] - ldrh r4, [r5, 0x2] - bl sub_81CDD5C - cmp r0, 0 - beq _081CD39C - ldrh r1, [r5] - b _081CD3A0 - .pool -_081CD39C: - ldrh r1, [r5] - subs r1, 0x1 -_081CD3A0: - eors r1, r4 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - cmp r6, 0 - bne _081CD3B0 - movs r0, 0x3 - b _081CD3BA -_081CD3B0: - cmp r0, 0 - beq _081CD3B8 - movs r0, 0x1 - b _081CD3BA -_081CD3B8: - movs r0, 0x4 -_081CD3BA: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81CD258 - - thumb_func_start sub_81CD3C4 -sub_81CD3C4: @ 81CD3C4 - push {r4,lr} - movs r0, 0xB - bl sub_81C763C - adds r4, r0, 0 - movs r0, 0x12 - bl sub_81C763C - adds r2, r0, 0 - ldr r1, =0x0000678a - adds r0, r4, r1 - ldrb r0, [r0] - cmp r0, 0x9 - bls _081CD3E2 - b _081CD530 -_081CD3E2: - lsls r0, 2 - ldr r1, =_081CD3F4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081CD3F4: - .4byte _081CD41C - .4byte _081CD428 - .4byte _081CD434 - .4byte _081CD440 - .4byte _081CD490 - .4byte _081CD4A8 - .4byte _081CD4C0 - .4byte _081CD4D8 - .4byte _081CD4F0 - .4byte _081CD508 -_081CD41C: - movs r1, 0x2 - ldrsh r0, [r2, r1] - movs r1, 0 - bl sub_81CD824 - b _081CD530 -_081CD428: - movs r1, 0x2 - ldrsh r0, [r2, r1] - movs r1, 0 - bl sub_81CDA1C - b _081CD530 -_081CD434: - movs r1, 0x2 - ldrsh r0, [r2, r1] - movs r1, 0 - bl sub_81CDB98 - b _081CD530 -_081CD440: - ldrh r0, [r2] - cmp r0, 0x1 - bne _081CD468 - ldr r2, =0x00006786 - adds r0, r4, r2 - movs r1, 0 - strb r1, [r0] - adds r2, 0x1 - adds r0, r4, r2 - strb r1, [r0] - adds r2, 0x1 - adds r0, r4, r2 - strb r1, [r0] - adds r2, 0x2 - adds r0, r4, r2 - strb r1, [r0] - movs r0, 0x1 - b _081CD53C - .pool -_081CD468: - ldr r0, =0x00006786 - adds r1, r4, r0 - movs r0, 0 - strb r0, [r1] - ldr r2, =0x00006787 - adds r1, r4, r2 - movs r0, 0x1 - strb r0, [r1] - ldr r0, =0x00006788 - adds r1, r4, r0 - movs r0, 0x2 - strb r0, [r1] - b _081CD530 - .pool -_081CD490: - ldrh r0, [r2, 0x2] - adds r0, 0x1 - ldrh r2, [r2] - cmp r0, r2 - blt _081CD49C - movs r0, 0 -_081CD49C: - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - bl sub_81CD824 - b _081CD530 -_081CD4A8: - ldrh r0, [r2, 0x2] - adds r0, 0x1 - ldrh r2, [r2] - cmp r0, r2 - blt _081CD4B4 - movs r0, 0 -_081CD4B4: - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - bl sub_81CDA1C - b _081CD530 -_081CD4C0: - ldrh r0, [r2, 0x2] - adds r0, 0x1 - ldrh r2, [r2] - cmp r0, r2 - blt _081CD4CC - movs r0, 0 -_081CD4CC: - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - bl sub_81CDB98 - b _081CD530 -_081CD4D8: - ldrh r0, [r2, 0x2] - subs r0, 0x1 - cmp r0, 0 - bge _081CD4E4 - ldrh r0, [r2] - subs r0, 0x1 -_081CD4E4: - lsls r0, 16 - asrs r0, 16 - movs r1, 0x2 - bl sub_81CD824 - b _081CD530 -_081CD4F0: - ldrh r0, [r2, 0x2] - subs r0, 0x1 - cmp r0, 0 - bge _081CD4FC - ldrh r0, [r2] - subs r0, 0x1 -_081CD4FC: - lsls r0, 16 - asrs r0, 16 - movs r1, 0x2 - bl sub_81CDA1C - b _081CD530 -_081CD508: - ldrh r0, [r2, 0x2] - subs r0, 0x1 - cmp r0, 0 - bge _081CD514 - ldrh r0, [r2] - subs r0, 0x1 -_081CD514: - lsls r0, 16 - asrs r0, 16 - movs r1, 0x2 - bl sub_81CDB98 - ldr r2, =0x0000678a - adds r1, r4, r2 - movs r0, 0 - strb r0, [r1] - movs r0, 0x1 - b _081CD53C - .pool -_081CD530: - ldr r0, =0x0000678a - adds r1, r4, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r0, 0 -_081CD53C: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CD3C4 - - thumb_func_start sub_81CD548 -sub_81CD548: @ 81CD548 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - movs r0, 0xB - bl sub_81C763C - adds r1, r0, 0 - cmp r4, 0x1 - beq _081CD588 - cmp r4, 0x1 - bgt _081CD566 - cmp r4, 0 - beq _081CD56C - b _081CD5C4 -_081CD566: - cmp r5, 0x2 - beq _081CD5A4 - b _081CD5C4 -_081CD56C: - ldr r2, =0x00006302 - adds r0, r1, r2 - movs r2, 0 - ldrsh r0, [r0, r2] - ldr r2, =0x00006789 - adds r1, r2 - ldrb r1, [r1] - bl sub_81CD824 - b _081CD5C4 - .pool -_081CD588: - ldr r2, =0x00006302 - adds r0, r1, r2 - movs r2, 0 - ldrsh r0, [r0, r2] - ldr r2, =0x00006789 - adds r1, r2 - ldrb r1, [r1] - bl sub_81CDA1C - b _081CD5C4 - .pool -_081CD5A4: - ldr r2, =0x00006302 - adds r0, r1, r2 - movs r2, 0 - ldrsh r0, [r0, r2] - ldr r2, =0x00006789 - adds r1, r2 - ldrb r1, [r1] - bl sub_81CDB98 - movs r0, 0x1 - b _081CD5C6 - .pool -_081CD5C4: - movs r0, 0 -_081CD5C6: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81CD548 - - thumb_func_start sub_81CD5CC -sub_81CD5CC: @ 81CD5CC - push {r4,lr} - adds r4, r0, 0 - lsls r2, 16 - lsrs r2, 16 - b _081CD5E4 -_081CD5D6: - strb r3, [r4] - adds r1, 0x1 - adds r4, 0x1 - lsls r0, r2, 16 - ldr r2, =0xffff0000 - adds r0, r2 - lsrs r2, r0, 16 -_081CD5E4: - ldrb r3, [r1] - adds r0, r3, 0 - cmp r0, 0xFF - bne _081CD5D6 - adds r1, r2, 0 - lsls r0, r1, 16 - ldr r2, =0xffff0000 - adds r0, r2 - lsrs r2, r0, 16 - lsls r1, 16 - cmp r1, 0 - ble _081CD612 - movs r3, 0 -_081CD5FE: - strb r3, [r4] - adds r4, 0x1 - adds r1, r2, 0 - lsls r0, r1, 16 - ldr r2, =0xffff0000 - adds r0, r2 - lsrs r2, r0, 16 - lsls r1, 16 - cmp r1, 0 - bgt _081CD5FE -_081CD612: - movs r0, 0xFF - strb r0, [r4] - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CD5CC - - thumb_func_start sub_81CD624 -sub_81CD624: @ 81CD624 - 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 r4, 16 - lsrs r4, 16 - lsls r2, 24 - lsrs r2, 24 - mov r10, r2 - movs r0, 0x12 - bl sub_81C763C - lsls r4, 2 - adds r0, r4 - ldrb r4, [r0, 0x4] - mov r8, r4 - ldrb r6, [r0, 0x5] - mov r9, r6 - movs r0, 0xFC - strb r0, [r5] - adds r5, 0x1 - movs r0, 0x4 - strb r0, [r5] - adds r5, 0x1 - movs r0, 0x8 - strb r0, [r5] - adds r5, 0x1 - movs r0, 0 - strb r0, [r5] - adds r5, 0x1 - movs r0, 0x9 - strb r0, [r5] - adds r5, 0x1 - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0x2D - movs r3, 0 - bl sub_81D2C68 - cmp r0, 0 - beq _081CD690 - ldr r1, =gUnknown_085E8264 - adds r0, r5, 0 - movs r2, 0 - movs r3, 0xC - bl CopyStringPadded - b _081CD80E - .pool -_081CD690: - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0x2 - adds r3, r5, 0 - bl sub_81D2C68 - adds r0, r5, 0 - bl GetStringEnd_Limit7 - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0xB - movs r3, 0 - bl sub_81D2C68 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r4, 0xE - bne _081CD6E0 - movs r0, 0x64 - adds r4, r6, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x38 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - adds r0, r4, 0 - bl pokemon_get_gender - lsls r0, 24 - lsrs r6, r0, 24 - b _081CD6FE - .pool -_081CD6E0: - mov r0, r8 - mov r1, r9 - bl get_pokemon_by_box_and_pos - adds r4, r0, 0 - bl pokemon_roll_gender - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r4, 0 - bl sub_80690C0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 -_081CD6FE: - cmp r7, 0x1D - beq _081CD706 - cmp r7, 0x20 - bne _081CD71C -_081CD706: - movs r0, 0xB - adds r1, r7, 0 - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r5, 0 - bl CompareString - cmp r0, 0 - bne _081CD71C - movs r6, 0xFF -_081CD71C: - adds r3, r5, 0 - b _081CD726 - .pool -_081CD724: - adds r3, 0x1 -_081CD726: - ldrb r0, [r3] - cmp r0, 0xFF - bne _081CD724 - movs r1, 0xFC - strb r1, [r3] - adds r3, 0x1 - movs r0, 0x12 - strb r0, [r3] - adds r3, 0x1 - movs r0, 0x3C - strb r0, [r3] - adds r3, 0x1 - cmp r6, 0 - beq _081CD74A - cmp r6, 0xFE - beq _081CD76E - movs r0, 0x77 - b _081CD790 -_081CD74A: - strb r1, [r3] - adds r3, 0x1 - movs r0, 0x1 - strb r0, [r3] - adds r3, 0x1 - movs r0, 0x4 - strb r0, [r3] - adds r3, 0x1 - strb r1, [r3] - adds r3, 0x1 - movs r0, 0x3 - strb r0, [r3] - adds r3, 0x1 - movs r0, 0x5 - strb r0, [r3] - adds r3, 0x1 - movs r0, 0xB5 - b _081CD790 -_081CD76E: - strb r1, [r3] - adds r3, 0x1 - movs r0, 0x1 - strb r0, [r3] - adds r3, 0x1 - movs r0, 0x6 - strb r0, [r3] - adds r3, 0x1 - strb r1, [r3] - adds r3, 0x1 - movs r0, 0x3 - strb r0, [r3] - adds r3, 0x1 - movs r0, 0x7 - strb r0, [r3] - adds r3, 0x1 - movs r0, 0xB6 -_081CD790: - strb r0, [r3] - adds r3, 0x1 - movs r0, 0xFC - strb r0, [r3] - adds r3, 0x1 - movs r0, 0x4 - strb r0, [r3] - adds r3, 0x1 - movs r0, 0x8 - strb r0, [r3] - adds r3, 0x1 - movs r5, 0 - strb r5, [r3] - adds r3, 0x1 - movs r0, 0x9 - strb r0, [r3] - adds r3, 0x1 - movs r0, 0xBA - strb r0, [r3] - adds r3, 0x1 - movs r0, 0xF9 - strb r0, [r3] - adds r3, 0x1 - movs r0, 0x5 - strb r0, [r3] - adds r3, 0x1 - adds r4, r3, 0 - adds r0, r4, 0 - mov r1, r8 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - adds r3, r0, 0 - subs r4, r3, r4 - lsls r4, 16 - lsrs r4, 16 - strb r5, [r3] - adds r3, 0x1 - mov r0, r10 - cmp r0, 0 - bne _081CD808 - movs r0, 0x3 - subs r0, r4 - lsls r0, 16 - ldr r1, =0xffff0000 - adds r0, r1 - lsrs r4, r0, 16 - ldr r0, =0x0000ffff - cmp r4, r0 - beq _081CD808 - movs r2, 0 - adds r1, r0, 0 -_081CD7FA: - strb r2, [r3] - adds r3, 0x1 - subs r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, r1 - bne _081CD7FA -_081CD808: - movs r0, 0xFF - strb r0, [r3] - adds r0, r3, 0 -_081CD80E: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CD624 - - thumb_func_start sub_81CD824 -sub_81CD824: @ 81CD824 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r1, 24 - lsrs r6, r1, 24 - movs r0, 0xB - bl sub_81C763C - adds r5, r0, 0 - movs r0, 0x12 - bl sub_81C763C - adds r7, r0, 0 - mov r1, r8 - lsls r0, r1, 16 - asrs r4, r0, 16 - bl sub_81CDD5C - cmp r0, 0 - beq _081CD85A - ldrh r2, [r7] - cmp r4, r2 - bne _081CD862 - b _081CD900 -_081CD85A: - ldrh r0, [r7] - subs r0, 0x1 - cmp r4, r0 - beq _081CD900 -_081CD862: - lsls r0, r6, 6 - ldr r1, =0x00006368 - adds r0, r1 - adds r0, r5, r0 - mov r2, r8 - lsls r4, r2, 16 - lsrs r1, r4, 16 - movs r2, 0 - bl sub_81CD624 - asrs r4, 14 - adds r4, r7, r4 - ldrb r3, [r4, 0x4] - lsls r0, r6, 1 - adds r0, r6 - lsls r4, r0, 3 - ldr r1, =0x00006320 - adds r0, r5, r1 - adds r0, r4 - movs r2, 0 - movs r1, 0xFC - strb r1, [r0] - ldr r1, =0x00006321 - adds r0, r5, r1 - adds r0, r4 - movs r1, 0x4 - strb r1, [r0] - ldr r1, =0x00006322 - adds r0, r5, r1 - adds r0, r4 - movs r1, 0x8 - strb r1, [r0] - ldr r1, =0x00006323 - adds r0, r5, r1 - adds r0, r4 - strb r2, [r0] - ldr r2, =0x00006324 - adds r0, r5, r2 - adds r0, r4 - movs r1, 0x9 - strb r1, [r0] - cmp r3, 0xE - bne _081CD8E4 - adds r0, r4, r5 - ldr r1, =0x00006325 - adds r0, r1 - ldr r1, =gUnknown_085EBFCE - b _081CD8F4 - .pool -_081CD8E4: - adds r4, r5 - ldr r2, =0x00006325 - adds r4, r2 - adds r0, r3, 0 - bl sav3_get_box_name - adds r1, r0, 0 - adds r0, r4, 0 -_081CD8F4: - movs r2, 0x8 - bl sub_81CD5CC - b _081CD95C - .pool -_081CD900: - movs r1, 0 - lsls r4, r6, 6 - lsls r0, r6, 1 - mov r8, r0 - adds r3, r4, 0 - ldr r0, =0x00006368 - adds r2, r5, r0 - movs r7, 0 -_081CD910: - adds r0, r1, r3 - adds r0, r2, r0 - strb r7, [r0] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0xB - bls _081CD910 - adds r1, r4 - ldr r2, =0x00006368 - adds r0, r5, r2 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - movs r1, 0 - mov r2, r8 - adds r0, r2, r6 - lsls r3, r0, 3 - ldr r0, =0x00006320 - adds r2, r5, r0 - movs r4, 0 -_081CD93A: - adds r0, r1, r3 - adds r0, r2, r0 - strb r4, [r0] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x7 - bls _081CD93A - mov r2, r8 - adds r0, r2, r6 - lsls r0, 3 - adds r0, r1, r0 - ldr r2, =0x00006320 - adds r1, r5, r2 - adds r1, r0 - movs r0, 0xFF - strb r0, [r1] -_081CD95C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CD824 - - thumb_func_start sub_81CD970 -sub_81CD970: @ 81CD970 - push {r4-r7,lr} - movs r0, 0xB - bl sub_81C763C - adds r7, r0, 0 - ldr r1, =0x000006ac - movs r0, 0x12 - bl sub_81C761C - adds r6, r0, 0 - movs r0, 0xC6 - lsls r0, 7 - adds r1, r7, r0 - movs r0, 0 - strb r0, [r1] - movs r4, 0 - movs r5, 0 - b _081CD9C4 - .pool -_081CD998: - movs r0, 0x64 - muls r0, r4 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2D - bl pokemon_getattr - adds r2, r0, 0 - cmp r2, 0 - bne _081CD9BE - lsls r1, r5, 2 - adds r1, r6, r1 - movs r0, 0xE - strb r0, [r1, 0x4] - strb r4, [r1, 0x5] - strh r2, [r1, 0x6] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 -_081CD9BE: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 -_081CD9C4: - bl calc_player_party_count - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bcc _081CD998 - lsls r0, r5, 2 - adds r0, r6, r0 - movs r1, 0 - strb r1, [r0, 0x4] - strb r1, [r0, 0x5] - movs r2, 0 - strh r1, [r0, 0x6] - strh r1, [r6, 0x2] - adds r0, r5, 0x1 - strh r0, [r6] - ldr r1, =0x0000678a - adds r0, r7, r1 - strb r2, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CD970 - - thumb_func_start sub_81CD9F8 -sub_81CD9F8: @ 81CD9F8 - push {lr} - movs r0, 0xB - bl sub_81C763C - movs r1, 0xC6 - lsls r1, 7 - adds r2, r0, r1 - movs r3, 0 - movs r1, 0x1 - strb r1, [r2] - ldr r1, =0x0000678a - adds r0, r1 - strb r3, [r0] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CD9F8 - - thumb_func_start sub_81CDA1C -sub_81CDA1C: @ 81CDA1C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - movs r0, 0xB - bl sub_81C763C - mov r8, r0 - movs r0, 0x12 - bl sub_81C763C - adds r4, r0, 0 - lsls r0, r6, 16 - asrs r5, r0, 16 - bl sub_81CDD5C - cmp r0, 0 - beq _081CDA52 - ldrh r0, [r4] - cmp r5, r0 - bne _081CDA5A - b _081CDB48 -_081CDA52: - ldrh r0, [r4] - subs r0, 0x1 - cmp r5, r0 - beq _081CDB48 -_081CDA5A: - lsls r0, r6, 16 - asrs r0, 14 - adds r0, r4, r0 - ldrb r6, [r0, 0x4] - ldrb r7, [r0, 0x5] - adds r0, r6, 0 - adds r1, r7, 0 - movs r2, 0x16 - movs r3, 0 - bl sub_81D2C68 - mov r1, r9 - lsls r5, r1, 2 - adds r4, r5, r1 - ldr r1, =0x00006428 - add r1, r8 - adds r1, r4 - strb r0, [r1] - adds r0, r6, 0 - adds r1, r7, 0 - movs r2, 0x2F - movs r3, 0 - bl sub_81D2C68 - ldr r1, =0x00006429 - add r1, r8 - adds r1, r4 - strb r0, [r1] - adds r0, r6, 0 - adds r1, r7, 0 - movs r2, 0x21 - movs r3, 0 - bl sub_81D2C68 - ldr r1, =0x0000642a - add r1, r8 - adds r1, r4 - strb r0, [r1] - adds r0, r6, 0 - adds r1, r7, 0 - movs r2, 0x18 - movs r3, 0 - bl sub_81D2C68 - ldr r1, =0x0000642b - add r1, r8 - adds r1, r4 - strb r0, [r1] - adds r0, r6, 0 - adds r1, r7, 0 - movs r2, 0x17 - movs r3, 0 - bl sub_81D2C68 - ldr r1, =0x0000642c - add r1, r8 - adds r1, r4 - strb r0, [r1] - movs r0, 0xCF - lsls r0, 7 - add r0, r8 - mov r2, r9 - adds r4, r0, r2 - adds r0, r6, 0 - adds r1, r7, 0 - movs r2, 0x30 - movs r3, 0 - bl sub_81D2C68 - cmp r0, 0xFF - beq _081CDB10 - adds r0, r6, 0 - adds r1, r7, 0 - movs r2, 0x30 - movs r3, 0 - bl sub_81D2C68 - movs r1, 0x1D - bl __udivsi3 - b _081CDB12 - .pool -_081CDB10: - movs r0, 0x9 -_081CDB12: - strb r0, [r4] - adds r0, r6, 0 - adds r1, r7, 0 - movs r2, 0x8 - movs r3, 0 - bl sub_81D2C68 - ldr r1, =0x00006783 - add r1, r8 - add r1, r9 - strb r0, [r1] - mov r0, r9 - adds r1, r5, r0 - ldr r2, =0x00006428 - adds r0, r1, r2 - add r0, r8 - lsls r1, 2 - adds r2, 0x14 - adds r1, r2 - add r1, r8 - bl sub_81D2754 - b _081CDB80 - .pool -_081CDB48: - movs r2, 0 - mov r0, r9 - lsls r5, r0, 2 - add r5, r9 - ldr r4, =0x00006428 - add r4, r8 - lsls r3, r5, 2 - mov r9, r2 - ldr r7, =0x0000643c - movs r6, 0x9B -_081CDB5C: - adds r0, r2, r5 - adds r0, r4, r0 - mov r1, r9 - strb r1, [r0] - lsls r0, r2, 2 - adds r0, r3 - add r0, r8 - adds r1, r0, r7 - strh r6, [r1] - ldr r1, =0x0000643e - adds r0, r1 - movs r1, 0x5B - strh r1, [r0] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x4 - bls _081CDB5C -_081CDB80: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CDA1C - - thumb_func_start sub_81CDB98 -sub_81CDB98: @ 81CDB98 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - movs r0, 0xB - bl sub_81C763C - adds r7, r0, 0 - movs r0, 0x12 - bl sub_81C763C - adds r4, r0, 0 - lsls r0, r6, 16 - asrs r5, r0, 16 - bl sub_81CDD5C - cmp r0, 0 - beq _081CDBCC - ldrh r0, [r4] - b _081CDBD0 -_081CDBCC: - ldrh r0, [r4] - subs r0, 0x1 -_081CDBD0: - cmp r5, r0 - beq _081CDC3E - lsls r0, r6, 16 - asrs r0, 14 - adds r0, r4, r0 - ldrb r5, [r0, 0x4] - ldrb r6, [r0, 0x5] - adds r0, r5, 0 - adds r1, r6, 0 - movs r2, 0x41 - movs r3, 0 - bl sub_81D2C68 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - adds r1, r6, 0 - movs r2, 0x1 - movs r3, 0 - bl sub_81D2C68 - mov r8, r0 - adds r0, r5, 0 - adds r1, r6, 0 - movs r2, 0 - movs r3, 0 - bl sub_81D2C68 - adds r5, r0, 0 - lsls r0, r4, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - mov r2, r9 - lsls r1, r2, 13 - movs r2, 0xC0 - lsls r2, 2 - adds r1, r2 - adds r1, r7, r1 - movs r2, 0x1 - str r2, [sp] - adds r2, r4, 0 - adds r3, r5, 0 - bl DecompressMonPic - adds r0, r4, 0 - mov r1, r8 - adds r2, r5, 0 - bl species_and_otid_get_pal - mov r2, r9 - lsls r1, r2, 7 - adds r1, r7, r1 - bl LZ77UnCompWram -_081CDC3E: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CDB98 - - thumb_func_start sub_81CDC50 -sub_81CDC50: @ 81CDC50 - push {lr} - movs r0, 0x12 - bl sub_81C763C - ldrh r0, [r0] - pop {r1} - bx r1 - thumb_func_end sub_81CDC50 - - thumb_func_start sub_81CDC60 -sub_81CDC60: @ 81CDC60 - push {lr} - movs r0, 0x12 - bl sub_81C763C - ldrh r0, [r0, 0x2] - pop {r1} - bx r1 - thumb_func_end sub_81CDC60 - - thumb_func_start sub_81CDC70 -sub_81CDC70: @ 81CDC70 - push {lr} - movs r0, 0xB - bl sub_81C763C - ldr r1, =0x00006428 - adds r0, r1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CDC70 - - thumb_func_start sub_81CDC84 -sub_81CDC84: @ 81CDC84 - push {lr} - movs r0, 0xB - bl sub_81C763C - ldr r1, =0x00006786 - adds r0, r1 - ldrb r0, [r0] - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CDC84 - - thumb_func_start sub_81CDC9C -sub_81CDC9C: @ 81CDC9C - push {lr} - movs r0, 0xB - bl sub_81C763C - ldr r1, =0x00006302 - adds r0, r1 - ldrb r0, [r0] - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CDC9C - - thumb_func_start sub_81CDCB4 -sub_81CDCB4: @ 81CDCB4 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0xB - bl sub_81C763C - lsls r4, 13 - movs r1, 0xC0 - lsls r1, 2 - adds r4, r1 - adds r0, r4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CDCB4 - - thumb_func_start sub_81CDCD4 -sub_81CDCD4: @ 81CDCD4 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0xB - bl sub_81C763C - lsls r4, 7 - adds r0, r4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CDCD4 - - thumb_func_start sub_81CDCEC -sub_81CDCEC: @ 81CDCEC - push {lr} - movs r0, 0xB - bl sub_81C763C - ldr r1, =0x00006789 - adds r0, r1 - ldrb r0, [r0] - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CDCEC - - thumb_func_start sub_81CDD04 -sub_81CDD04: @ 81CDD04 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0xB - bl sub_81C763C - lsls r4, 6 - ldr r1, =0x00006368 - adds r4, r1 - adds r0, r4 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CDD04 - - thumb_func_start sub_81CDD24 -sub_81CDD24: @ 81CDD24 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0xB - bl sub_81C763C - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 3 - ldr r2, =0x00006320 - adds r1, r2 - adds r0, r1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CDD24 - - thumb_func_start sub_81CDD48 -sub_81CDD48: @ 81CDD48 - push {lr} - movs r0, 0x12 - bl sub_81C763C - ldrh r1, [r0, 0x2] - lsls r1, 2 - adds r0, r1 - ldrh r0, [r0, 0x6] - pop {r1} - bx r1 - thumb_func_end sub_81CDD48 - - thumb_func_start sub_81CDD5C -sub_81CDD5C: @ 81CDD5C - push {lr} - movs r0, 0xB - bl sub_81C763C - movs r1, 0xC6 - lsls r1, 7 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _081CDD74 - movs r0, 0 - b _081CDD76 -_081CDD74: - movs r0, 0x1 -_081CDD76: - pop {r1} - bx r1 - thumb_func_end sub_81CDD5C - - thumb_func_start sub_81CDD7C -sub_81CDD7C: @ 81CDD7C - push {lr} - movs r0, 0xB - bl sub_81C763C - adds r2, r0, 0 - movs r1, 0xC6 - lsls r1, 7 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _081CDD96 - movs r0, 0 - b _081CDDA6 -_081CDD96: - ldr r3, =0x00006786 - adds r0, r2, r3 - movs r1, 0 - ldrsb r1, [r0, r1] - subs r3, 0x3 - adds r0, r2, r3 - adds r0, r1 - ldrb r0, [r0] -_081CDDA6: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CDD7C - - thumb_func_start sub_81CDDB0 -sub_81CDDB0: @ 81CDDB0 - push {lr} - movs r0, 0xB - bl sub_81C763C - ldr r2, =0x00006786 - adds r1, r0, r2 - ldrb r1, [r1] - lsls r1, 24 - asrs r1, 24 - subs r2, 0x6 - adds r0, r2 - adds r0, r1 - ldrb r0, [r0] - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CDDB0 - - thumb_func_start sub_81CDDD4 -sub_81CDDD4: @ 81CDDD4 - push {r4,lr} - ldr r1, =0x000038ac - movs r0, 0xC - bl sub_81C761C - adds r4, r0, 0 - cmp r4, 0 - beq _081CDE24 - ldr r0, =0x00001816 - adds r1, r4, r0 - movs r0, 0xFF - strb r0, [r1] - ldr r0, =sub_81CDE94 - movs r1, 0x1 - bl sub_81C7078 - str r0, [r4] - ldr r0, =0x00001810 - adds r1, r4, r0 - ldr r0, =sub_81CDE80 - str r0, [r1] - ldr r0, =0x00002908 - adds r1, r4, r0 - movs r0, 0 - strb r0, [r1] - movs r0, 0x1 - b _081CDE26 - .pool -_081CDE24: - movs r0, 0 -_081CDE26: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CDDD4 - - thumb_func_start sub_81CDE2C -sub_81CDE2C: @ 81CDE2C - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0xC - bl sub_81C763C - adds r5, r0, 0 - ldr r0, =gUnknown_08623384 - lsls r4, 2 - adds r4, r0 - ldr r0, [r4] - movs r1, 0x1 - bl sub_81C7078 - str r0, [r5] - ldr r0, =0x00001810 - adds r5, r0 - ldr r0, =sub_81CDE80 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CDE2C - - thumb_func_start sub_81CDE64 -sub_81CDE64: @ 81CDE64 - push {lr} - movs r0, 0xC - bl sub_81C763C - ldr r1, =0x00001810 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CDE64 - - thumb_func_start sub_81CDE80 -sub_81CDE80: @ 81CDE80 - push {lr} - movs r0, 0xC - bl sub_81C763C - ldr r0, [r0] - bl sub_81C70D8 - pop {r1} - bx r1 - thumb_func_end sub_81CDE80 - - thumb_func_start sub_81CDE94 -sub_81CDE94: @ 81CDE94 - push {r4-r6,lr} - sub sp, 0xC - adds r4, r0, 0 - movs r0, 0xC - bl sub_81C763C - adds r5, r0, 0 - cmp r4, 0x14 - bls _081CDEA8 - b _081CE2C4 -_081CDEA8: - lsls r0, r4, 2 - ldr r1, =_081CDEB8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081CDEB8: - .4byte _081CDF0C - .4byte _081CDF18 - .4byte _081CDF94 - .4byte _081CDFB8 - .4byte _081CE030 - .4byte _081CE074 - .4byte _081CE0B0 - .4byte _081CE118 - .4byte _081CE120 - .4byte _081CE126 - .4byte _081CE136 - .4byte _081CE146 - .4byte _081CE156 - .4byte _081CE16C - .4byte _081CE1C8 - .4byte _081CE1EC - .4byte _081CE218 - .4byte _081CE23C - .4byte _081CE24A - .4byte _081CE25A - .4byte _081CE262 -_081CDF0C: - bl sub_81CD3C4 - cmp r0, 0x1 - beq _081CDF16 - b _081CE2C0 -_081CDF16: - b _081CDFB0 -_081CDF18: - ldr r0, =gUnknown_08623358 - movs r1, 0x3 - bl sub_81C7B54 - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - ldr r1, =0x00007940 - movs r0, 0 - bl SetGpuReg - ldr r1, =0x00000844 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x0000040b - movs r0, 0x52 - bl SetGpuReg - ldr r1, =gUnknown_08DC6548 - movs r0, 0 - str r0, [sp] - movs r0, 0x3 - b _081CDFA8 - .pool -_081CDF94: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _081CDFA2 - b _081CE2C0 -_081CDFA2: - ldr r1, =gUnknown_08623228 - str r0, [sp] - movs r0, 0x2 -_081CDFA8: - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram -_081CDFB0: - movs r0, 0 - b _081CE2C6 - .pool -_081CDFB8: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - beq _081CDFC4 - b _081CE2C0 -_081CDFC4: - ldr r0, =gUnknown_08DC6DFC - adds r4, r5, 0x4 - adds r1, r4, 0 - bl LZ77UnCompVram - movs r0, 0x3 - adds r1, r4, 0 - bl SetBgTilemapBuffer - bl sub_81CDD5C - cmp r0, 0x1 - bne _081CDFF2 - ldr r1, =gUnknown_08DC7070 - movs r0, 0x9 - str r0, [sp] - movs r0, 0x4 - str r0, [sp, 0x4] - movs r0, 0x3 - movs r2, 0 - movs r3, 0x5 - bl CopyToBgTilemapBufferRect -_081CDFF2: - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - ldr r0, =gUnknown_08DC6528 - movs r1, 0x10 - movs r2, 0x20 - bl sub_81C7944 - ldr r0, =gUnknown_08623208 - movs r1, 0xF0 - movs r2, 0x20 - bl sub_81C7944 - ldr r0, =0x00001814 - adds r1, r5, r0 - ldr r0, =0x0000ffb0 - strh r0, [r1] - b _081CDFB0 - .pool -_081CE030: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - beq _081CE03C - b _081CE2C0 -_081CE03C: - ldr r0, =gUnknown_0862323C - ldr r1, =0x00001004 - adds r4, r5, r1 - adds r1, r4, 0 - bl LZ77UnCompVram - movs r0, 0x2 - adds r1, r4, 0 - bl SetBgTilemapBuffer - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - ldr r0, =gUnknown_086231E8 - movs r1, 0x30 - movs r2, 0x20 - bl sub_81C7944 - movs r0, 0x2 - bl sub_81D21DC - b _081CDFB0 - .pool -_081CE074: - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_8199DF0 - movs r0, 0x1 - movs r1, 0x11 - movs r2, 0x1 - movs r3, 0x1 - bl sub_8199DF0 - movs r0, 0 - str r0, [sp, 0x8] - ldr r2, =0x00000804 - adds r4, r5, r2 - ldr r2, =0x05000200 - add r0, sp, 0x8 - adds r1, r4, 0 - bl CpuSet - movs r0, 0x1 - adds r1, r4, 0 - bl SetBgTilemapBuffer - b _081CDFB0 - .pool -_081CE0B0: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - beq _081CE0BC - b _081CE2C0 -_081CE0BC: - ldr r0, =gUnknown_08623364 - bl AddWindow - movs r2, 0xC1 - lsls r2, 5 - adds r1, r5, r2 - strb r0, [r1] - bl sub_81CDD5C - cmp r0, 0x1 - bne _081CE0F6 - ldr r0, =gUnknown_0862336C - bl AddWindow - ldr r2, =0x00001821 - adds r1, r5, r2 - strb r0, [r1] - ldr r0, =gUnknown_08623374 - bl AddWindow - ldr r2, =0x00001822 - adds r1, r5, r2 - strb r0, [r1] - ldr r0, =gUnknown_0862337C - bl AddWindow - ldr r2, =0x00001823 - adds r1, r5, r2 - strb r0, [r1] -_081CE0F6: - bl DeactivateAllTextPrinters - b _081CDFB0 - .pool -_081CE118: - movs r0, 0 - bl sub_81CED30 - b _081CDFB0 -_081CE120: - bl sub_81CE9E4 - b _081CDFB0 -_081CE126: - bl sub_81CDD5C - cmp r0, 0x1 - beq _081CE130 - b _081CDFB0 -_081CE130: - bl sub_81CE934 - b _081CDFB0 -_081CE136: - bl sub_81CDC84 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - movs r0, 0 - b _081CE164 -_081CE146: - bl sub_81CDC84 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - movs r0, 0x1 - b _081CE164 -_081CE156: - bl sub_81CDC84 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - movs r0, 0x2 -_081CE164: - movs r2, 0x1 - bl sub_81CE754 - b _081CDFB0 -_081CE16C: - bl sub_81CDC84 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - movs r0, 0x3 - movs r2, 0x1 - bl sub_81CE754 - cmp r0, 0x1 - beq _081CE186 - b _081CE2C0 -_081CE186: - movs r1, 0xC1 - lsls r1, 5 - adds r0, r5, r1 - ldrb r0, [r0] - bl PutWindowTilemap - bl sub_81CDD5C - cmp r0, 0x1 - beq _081CE19C - b _081CDFB0 -_081CE19C: - ldr r2, =0x00001821 - adds r0, r5, r2 - ldrb r0, [r0] - bl PutWindowTilemap - ldr r1, =0x00001822 - adds r0, r5, r1 - ldrb r0, [r0] - bl PutWindowTilemap - ldr r2, =0x00001823 - adds r0, r5, r2 - ldrb r0, [r0] - bl PutWindowTilemap - b _081CDFB0 - .pool -_081CE1C8: - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl HideBg - movs r0, 0x3 - bl ShowBg - bl sub_81CDD5C - cmp r0, 0x1 - beq _081CE1E4 - b _081CDFB0 -_081CE1E4: - movs r0, 0x4 - bl sub_81C7BA4 - b _081CDFB0 -_081CE1EC: - movs r0, 0x1 - bl sub_81C7AC0 - bl sub_81CDD5C - cmp r0, 0 - beq _081CE1FC - b _081CDFB0 -_081CE1FC: - movs r0, 0x6 - bl sub_81C7DFC - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - bl sub_81C7FA0 - movs r0, 0x6 - movs r1, 0x1 - movs r2, 0 - bl sub_81C7FA0 - b _081CDFB0 -_081CE218: - bl sub_81C7B34 - cmp r0, 0 - bne _081CE2C0 - bl sub_81CDD5C - cmp r0, 0 - bne _081CE230 - bl sub_81C8010 - cmp r0, 0 - bne _081CE2C0 -_081CE230: - ldr r0, =sub_81CEE44 - bl c3args_set_0toR1_1to0 - b _081CDFB0 - .pool -_081CE23C: - bl sub_81CEE90 - bl sub_81CDC70 - bl sub_81D20AC - b _081CDFB0 -_081CE24A: - bl sub_81CDC70 - bl sub_81D20BC - lsls r0, 24 - cmp r0, 0 - bne _081CE2C0 - b _081CDFB0 -_081CE25A: - movs r0, 0x1 - bl sub_81CEE74 - b _081CDFB0 -_081CE262: - bl sub_81CDC70 - ldr r2, =0x00001814 - adds r1, r5, r2 - bl sub_81D3178 - lsls r0, 24 - cmp r0, 0 - bne _081CE2C0 - ldr r0, =0x000028e0 - adds r6, r5, r0 - adds r0, r6, 0 - bl sub_81D3464 - bl sub_81CDD5C - cmp r0, 0x1 - beq _081CE298 - bl sub_81CDC60 - adds r4, r0, 0 - bl sub_81CDC50 - lsls r4, 16 - lsls r0, 16 - cmp r4, r0 - beq _081CE2C4 -_081CE298: - ldr r1, =0x00001816 - adds r0, r5, r1 - ldrb r4, [r0] - bl sub_81CDDB0 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_81D3480 - b _081CE2C4 - .pool -_081CE2C0: - movs r0, 0x2 - b _081CE2C6 -_081CE2C4: - movs r0, 0x4 -_081CE2C6: - add sp, 0xC - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81CDE94 - - thumb_func_start sub_81CE2D0 -sub_81CE2D0: @ 81CE2D0 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0xC - bl sub_81C763C - adds r5, r0, 0 - cmp r4, 0x1 - beq _081CE308 - cmp r4, 0x1 - bgt _081CE2EA - cmp r4, 0 - beq _081CE2F4 - b _081CE374 -_081CE2EA: - cmp r4, 0x2 - beq _081CE328 - cmp r4, 0x3 - beq _081CE33E - b _081CE374 -_081CE2F4: - bl sub_81CEEC8 - ldr r1, =0x000028e0 - adds r0, r5, r1 - bl sub_81D3520 - movs r0, 0x1 - b _081CE376 - .pool -_081CE308: - bl sub_81CDC70 - ldr r2, =0x00001814 - adds r1, r5, r2 - bl sub_81D31A4 - lsls r0, 24 - cmp r0, 0 - bne _081CE34E - movs r0, 0 - bl sub_81CEE74 - movs r0, 0x1 - b _081CE376 - .pool -_081CE328: - movs r0, 0 - bl sub_81C7AC0 - bl sub_81CDD5C - cmp r0, 0 - bne _081CE33A - bl sub_81C78A0 -_081CE33A: - movs r0, 0 - b _081CE376 -_081CE33E: - bl sub_81C7B34 - cmp r0, 0 - bne _081CE34E - bl sub_81C78C0 - cmp r0, 0 - beq _081CE352 -_081CE34E: - movs r0, 0x2 - b _081CE376 -_081CE352: - ldr r1, =0x000028e0 - adds r0, r5, r1 - bl sub_81D354C - movs r0, 0x1 - bl HideBg - movs r0, 0x2 - bl HideBg - movs r0, 0x3 - bl HideBg - movs r0, 0x1 - b _081CE376 - .pool -_081CE374: - movs r0, 0x4 -_081CE376: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81CE2D0 - - thumb_func_start sub_81CE37C -sub_81CE37C: @ 81CE37C - push {r4-r6,lr} - adds r4, r0, 0 - movs r0, 0xC - bl sub_81C763C - adds r6, r0, 0 - bl sub_81CDC70 - adds r2, r0, 0 - cmp r4, 0x9 - bls _081CE394 - b _081CE4D0 -_081CE394: - lsls r0, r4, 2 - ldr r1, =_081CE3A4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081CE3A4: - .4byte _081CE3CC - .4byte _081CE3D0 - .4byte _081CE3DA - .4byte _081CE3F0 - .4byte _081CE3F8 - .4byte _081CE418 - .4byte _081CE428 - .4byte _081CE438 - .4byte _081CE44E - .4byte _081CE468 -_081CE3CC: - movs r0, 0 - b _081CE3D2 -_081CE3D0: - movs r0, 0x1 -_081CE3D2: - bl sub_81CD548 -_081CE3D6: - movs r0, 0x1 - b _081CE4D2 -_081CE3DA: - movs r0, 0x2 - bl sub_81CD548 - ldr r1, =0x000028e0 - adds r0, r6, r1 - bl sub_81D3520 - b _081CE3D6 - .pool -_081CE3F0: - adds r0, r2, 0 - bl sub_81D2074 - b _081CE3D6 -_081CE3F8: - ldr r1, =0x00001814 - adds r0, r6, r1 - bl sub_81D3150 - lsls r0, 24 - cmp r0, 0 - bne _081CE4CC - bl sub_81CDC84 - lsls r0, 24 - lsrs r0, 24 - bl sub_81CED30 - b _081CE3D6 - .pool -_081CE418: - bl sub_81CDC84 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - movs r0, 0 - b _081CE446 -_081CE428: - bl sub_81CDC84 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - movs r0, 0x1 - b _081CE446 -_081CE438: - bl sub_81CDC84 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - movs r0, 0x2 -_081CE446: - movs r2, 0 - bl sub_81CE754 - b _081CE3D6 -_081CE44E: - bl sub_81CDC84 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - movs r0, 0x3 - movs r2, 0 - bl sub_81CE754 - cmp r0, 0x1 - beq _081CE3D6 - b _081CE4CC -_081CE468: - bl sub_81CDC70 - adds r2, r0, 0 - ldr r0, =0x00001814 - adds r1, r6, r0 - adds r0, r2, 0 - bl sub_81D3178 - lsls r0, 24 - cmp r0, 0 - bne _081CE4CC - ldr r1, =0x000028e0 - adds r0, r6, r1 - bl sub_81D3464 - bl sub_81CDD5C - cmp r0, 0x1 - beq _081CE4A0 - bl sub_81CDC60 - adds r4, r0, 0 - bl sub_81CDC50 - lsls r4, 16 - lsls r0, 16 - cmp r4, r0 - beq _081CE3D6 -_081CE4A0: - ldr r0, =0x000028e0 - adds r5, r6, r0 - ldr r1, =0x00001816 - adds r0, r6, r1 - ldrb r4, [r0] - bl sub_81CDDB0 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_81D3480 - b _081CE3D6 - .pool -_081CE4CC: - movs r0, 0x2 - b _081CE4D2 -_081CE4D0: - movs r0, 0x4 -_081CE4D2: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81CE37C - - thumb_func_start sub_81CE4D8 -sub_81CE4D8: @ 81CE4D8 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0xC - bl sub_81C763C - adds r5, r0, 0 - cmp r4, 0x8 - bhi _081CE5DC - lsls r0, r4, 2 - ldr r1, =_081CE4F8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081CE4F8: - .4byte _081CE51C - .4byte _081CE520 - .4byte _081CE524 - .4byte _081CE52E - .4byte _081CE53E - .4byte _081CE54E - .4byte _081CE55E - .4byte _081CE576 - .4byte _081CE592 -_081CE51C: - movs r0, 0 - b _081CE526 -_081CE520: - movs r0, 0x1 - b _081CE526 -_081CE524: - movs r0, 0x2 -_081CE526: - bl sub_81CD548 - movs r0, 0x1 - b _081CE5DE -_081CE52E: - bl sub_81CDC84 - lsls r0, 24 - lsrs r0, 24 - bl sub_81CED30 - movs r0, 0x1 - b _081CE5DE -_081CE53E: - bl sub_81CDC84 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - movs r0, 0 - b _081CE56C -_081CE54E: - bl sub_81CDC84 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - movs r0, 0x1 - b _081CE56C -_081CE55E: - bl sub_81CDC84 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - movs r0, 0x2 -_081CE56C: - movs r2, 0 - bl sub_81CE754 - movs r0, 0x1 - b _081CE5DE -_081CE576: - bl sub_81CDC84 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - movs r0, 0x3 - movs r2, 0 - bl sub_81CE754 - cmp r0, 0x1 - bne _081CE5D8 - movs r0, 0x1 - b _081CE5DE -_081CE592: - bl sub_81CDC70 - ldr r2, =0x00001814 - adds r1, r5, r2 - bl sub_81D3178 - lsls r0, 24 - cmp r0, 0 - bne _081CE5D8 - ldr r0, =0x000028e0 - adds r4, r5, r0 - adds r0, r4, 0 - bl sub_81D3464 - ldr r1, =0x00001816 - adds r0, r5, r1 - ldrb r5, [r0] - bl sub_81CDDB0 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_81D3480 - movs r0, 0x1 - b _081CE5DE - .pool -_081CE5D8: - movs r0, 0x2 - b _081CE5DE -_081CE5DC: - movs r0, 0x4 -_081CE5DE: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81CE4D8 - - thumb_func_start sub_81CE5E4 -sub_81CE5E4: @ 81CE5E4 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0xC - bl sub_81C763C - adds r5, r0, 0 - cmp r4, 0x7 - bhi _081CE6B2 - lsls r0, r4, 2 - ldr r1, =_081CE604 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081CE604: - .4byte _081CE624 - .4byte _081CE628 - .4byte _081CE632 - .4byte _081CE648 - .4byte _081CE660 - .4byte _081CE670 - .4byte _081CE680 - .4byte _081CE696 -_081CE624: - movs r0, 0 - b _081CE62A -_081CE628: - movs r0, 0x1 -_081CE62A: - bl sub_81CD548 -_081CE62E: - movs r0, 0x1 - b _081CE6B4 -_081CE632: - movs r0, 0x2 - bl sub_81CD548 - ldr r1, =0x000028e0 - adds r0, r5, r1 - bl sub_81D3520 - b _081CE62E - .pool -_081CE648: - bl sub_81CDC70 - ldr r2, =0x00001814 - adds r1, r5, r2 - bl sub_81D31A4 - lsls r0, 24 - cmp r0, 0 - beq _081CE62E - b _081CE6AE - .pool -_081CE660: - bl sub_81CDC84 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - movs r0, 0 - b _081CE68E -_081CE670: - bl sub_81CDC84 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - movs r0, 0x1 - b _081CE68E -_081CE680: - bl sub_81CDC84 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - movs r0, 0x2 -_081CE68E: - movs r2, 0 - bl sub_81CE754 - b _081CE62E -_081CE696: - bl sub_81CDC84 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - movs r0, 0x3 - movs r2, 0 - bl sub_81CE754 - cmp r0, 0x1 - beq _081CE62E -_081CE6AE: - movs r0, 0x2 - b _081CE6B4 -_081CE6B2: - movs r0, 0x4 -_081CE6B4: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81CE5E4 - - thumb_func_start sub_81CE6BC -sub_81CE6BC: @ 81CE6BC - push {lr} - cmp r0, 0x1 - beq _081CE6E6 - cmp r0, 0x1 - bgt _081CE6CC - cmp r0, 0 - beq _081CE6D2 - b _081CE6FA -_081CE6CC: - cmp r0, 0x2 - beq _081CE6EE - b _081CE6FA -_081CE6D2: - bl sub_81CDD7C - lsls r0, 24 - lsrs r0, 24 - movs r1, 0xB0 - movs r2, 0x20 - bl sub_811FAA4 -_081CE6E2: - movs r0, 0x1 - b _081CE6FC -_081CE6E6: - movs r0, 0x5 - bl sub_81C7BA4 - b _081CE6E2 -_081CE6EE: - bl sub_81C7BE8 - cmp r0, 0x1 - bne _081CE6E2 - movs r0, 0x2 - b _081CE6FC -_081CE6FA: - movs r0, 0x4 -_081CE6FC: - pop {r1} - bx r1 - thumb_func_end sub_81CE6BC - - thumb_func_start sub_81CE700 -sub_81CE700: @ 81CE700 - push {lr} - cmp r0, 0x1 - beq _081CE71E - cmp r0, 0x1 - bgt _081CE710 - cmp r0, 0 - beq _081CE716 - b _081CE732 -_081CE710: - cmp r0, 0x2 - beq _081CE726 - b _081CE732 -_081CE716: - bl sub_811FAF8 -_081CE71A: - movs r0, 0x1 - b _081CE734 -_081CE71E: - movs r0, 0x4 - bl sub_81C7BA4 - b _081CE71A -_081CE726: - bl sub_81C7BE8 - cmp r0, 0x1 - bne _081CE71A - movs r0, 0x2 - b _081CE734 -_081CE732: - movs r0, 0x4 -_081CE734: - pop {r1} - bx r1 - thumb_func_end sub_81CE700 - - thumb_func_start sub_81CE738 -sub_81CE738: @ 81CE738 - push {lr} - lsls r1, 16 - lsrs r1, 16 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r1, =gUnknown_085EBFD7 - bl CopyString - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CE738 - - thumb_func_start sub_81CE754 -sub_81CE754: @ 81CE754 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x2C - lsls r0, 24 - lsrs r4, r0, 24 - adds r7, r4, 0 - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - lsls r2, 24 - lsrs r5, r2, 24 - movs r0, 0xC - bl sub_81C763C - adds r6, r0, 0 - cmp r4, 0x1 - beq _081CE7B8 - cmp r4, 0x1 - bgt _081CE782 - cmp r4, 0 - beq _081CE78E - b _081CE924 -_081CE782: - cmp r4, 0x2 - beq _081CE800 - cmp r4, 0x3 - bne _081CE78C - b _081CE89C -_081CE78C: - b _081CE924 -_081CE78E: - movs r1, 0xC1 - lsls r1, 5 - adds r0, r6, r1 - ldrb r0, [r0] - movs r1, 0 - bl FillWindowPixelBuffer - bl sub_81CDD5C - cmp r0, 0x1 - beq _081CE7A6 - b _081CE924 -_081CE7A6: - ldr r1, =0x00001821 - adds r0, r6, r1 - ldrb r0, [r0] - movs r1, 0 - bl FillWindowPixelBuffer - b _081CE924 - .pool -_081CE7B8: - bl sub_81CDC60 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl sub_81CDC50 - lsls r0, 16 - lsrs r0, 16 - subs r0, 0x1 - cmp r4, r0 - bne _081CE7DA - bl sub_81CDD5C - cmp r0, 0x1 - beq _081CE7DA - b _081CE924 -_081CE7DA: - mov r1, r8 - lsls r0, r1, 24 - lsrs r0, 24 - bl sub_81CDD04 - adds r2, r0, 0 - movs r1, 0xC1 - lsls r1, 5 - adds r0, r6, r1 - ldrb r0, [r0] - str r7, [sp] - movs r1, 0 - str r1, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - b _081CE924 -_081CE800: - bl sub_81CDD5C - adds r7, r0, 0 - cmp r7, 0x1 - beq _081CE80C - b _081CE924 -_081CE80C: - mov r1, r8 - lsls r0, r1, 24 - lsrs r0, 24 - bl sub_81CDD24 - adds r2, r0, 0 - movs r1, 0xC1 - lsls r1, 5 - adds r0, r6, r1 - ldrb r0, [r0] - movs r1, 0x11 - str r1, [sp] - movs r4, 0 - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - add r1, sp, 0xC - movs r0, 0xFC - strb r0, [r1] - movs r0, 0x4 - strb r0, [r1, 0x1] - movs r0, 0x8 - strb r0, [r1, 0x2] - adds r0, r1, 0 - strb r4, [r0, 0x3] - movs r0, 0x9 - strb r0, [r1, 0x4] - mov r5, sp - adds r5, 0x11 - ldr r1, =gUnknown_085EBFD7 - adds r0, r5, 0 - bl CopyString - ldr r0, =0x00001821 - adds r6, r0 - ldrb r0, [r6] - str r7, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - add r2, sp, 0xC - movs r3, 0x4 - bl Print - bl sub_81CDD48 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r5, 0 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalString - ldrb r0, [r6] - str r7, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - add r2, sp, 0xC - movs r3, 0x1C - bl Print - b _081CE924 - .pool -_081CE89C: - ldr r1, =0x00002908 - adds r0, r6, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _081CE8B0 - cmp r0, 0x1 - beq _081CE8EC - b _081CE924 - .pool -_081CE8B0: - cmp r5, 0 - beq _081CE8C4 - movs r1, 0xC1 - lsls r1, 5 - adds r0, r6, r1 - ldrb r0, [r0] - movs r1, 0x3 - bl CopyWindowToVram - b _081CE8D2 -_081CE8C4: - movs r1, 0xC1 - lsls r1, 5 - adds r0, r6, r1 - ldrb r0, [r0] - movs r1, 0x2 - bl CopyWindowToVram -_081CE8D2: - bl sub_81CDD5C - cmp r0, 0x1 - bne _081CE910 - ldr r0, =0x00002908 - adds r1, r6, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _081CE924 - .pool -_081CE8EC: - cmp r5, 0 - beq _081CE904 - ldr r1, =0x00001821 - adds r0, r6, r1 - ldrb r0, [r0] - movs r1, 0x3 - bl CopyWindowToVram - b _081CE910 - .pool -_081CE904: - ldr r1, =0x00001821 - adds r0, r6, r1 - ldrb r0, [r0] - movs r1, 0x2 - bl CopyWindowToVram -_081CE910: - ldr r0, =0x00002908 - adds r1, r6, r0 - movs r0, 0 - strb r0, [r1] - movs r0, 0x1 - b _081CE926 - .pool -_081CE924: - movs r0, 0 -_081CE926: - add sp, 0x2C - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81CE754 - - thumb_func_start sub_81CE934 -sub_81CE934: @ 81CE934 - push {r4,lr} - movs r0, 0xC - bl sub_81C763C - adds r4, r0, 0 - ldr r1, =0x00001822 - adds r0, r4, r1 - ldrb r0, [r0] - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =0x00001823 - adds r4, r0 - ldrb r0, [r4] - movs r1, 0x3 - bl CopyWindowToVram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CE934 - - thumb_func_start sub_81CE964 -sub_81CE964: @ 81CE964 - push {r4,r5,lr} - adds r5, r0, 0 - movs r0, 0x2E - ldrsh r4, [r5, r0] - bl sub_81CDC60 - lsls r0, 16 - lsrs r0, 16 - cmp r4, r0 - bne _081CE982 - adds r0, r5, 0 - movs r1, 0 - bl StartObjectImageAnim - b _081CE98A -_081CE982: - adds r0, r5, 0 - movs r1, 0x1 - bl StartObjectImageAnim -_081CE98A: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81CE964 - - thumb_func_start sub_81CE990 -sub_81CE990: @ 81CE990 - push {r4,r5,lr} - adds r5, r0, 0 - bl sub_81CDC60 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl sub_81CDC50 - lsls r0, 16 - lsrs r0, 16 - subs r0, 0x1 - cmp r4, r0 - bne _081CE9B0 - movs r0, 0x65 - b _081CE9B2 -_081CE9B0: - movs r0, 0x66 -_081CE9B2: - bl IndexOfObjectPaletteTag - lsls r0, 4 - ldrb r2, [r5, 0x5] - movs r1, 0xF - ands r1, r2 - orrs r1, r0 - strb r1, [r5, 0x5] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81CE990 - - thumb_func_start sub_81CE9C8 -sub_81CE9C8: @ 81CE9C8 - push {r4,lr} - adds r4, r0, 0 - bl sub_81CDD7C - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81CE9C8 - - thumb_func_start sub_81CE9E4 -sub_81CE9E4: @ 81CE9E4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x58 - movs r0, 0xC - bl sub_81C763C - adds r6, r0, 0 - add r4, sp, 0x20 - add r5, sp, 0x38 - mov r0, sp - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_81D321C - bl sub_81CDD5C - adds r7, r4, 0 - mov r10, r5 - cmp r0, 0x1 - bne _081CEA78 - ldr r1, =0x00001824 - adds r0, r6, r1 - movs r2, 0x6A - strh r2, [r0] - ldr r3, =0x00001826 - adds r1, r6, r3 - strh r2, [r1] - bl sub_811F90C - bl sub_811FA90 - ldr r2, =gUnknown_08623338 - movs r0, 0x69 - movs r1, 0x69 - bl sub_811FF94 - ldrb r1, [r0, 0x5] - movs r2, 0xC - orrs r1, r2 - strb r1, [r0, 0x5] - movs r1, 0xC0 - strh r1, [r0, 0x20] - movs r1, 0x20 - strh r1, [r0, 0x22] - ldr r1, =sub_81CE9C8 - str r1, [r0, 0x1C] - ldr r2, =0x000028dc - adds r1, r6, r2 - str r0, [r1] - movs r0, 0x69 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl sub_81C7990 - add r3, sp, 0x50 - mov r8, r3 - b _081CEBC6 - .pool -_081CEA78: - mov r0, sp - bl LoadObjectPics - mov r0, r10 - bl sub_81C795C - movs r4, 0 - add r0, sp, 0x50 - mov r8, r0 - b _081CEAE8 -_081CEA8C: - lsls r2, r4, 2 - adds r2, r4 - lsls r2, 18 - movs r1, 0x80 - lsls r1, 12 - adds r2, r1 - asrs r2, 16 - adds r0, r7, 0 - movs r1, 0xE2 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x40 - beq _081CEAD8 - ldr r2, =0x00001806 - adds r0, r6, r2 - adds r0, r4 - strb r3, [r0] - ldr r2, =0x02020630 - lsls r0, r3, 4 - adds r0, r3 - lsls r0, 2 - adds r1, r0, r2 - strh r4, [r1, 0x2E] - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_81CE964 - str r1, [r0] - b _081CEAE2 - .pool -_081CEAD8: - ldr r3, =0x00001806 - adds r0, r6, r3 - adds r0, r4 - movs r1, 0xFF - strb r1, [r0] -_081CEAE2: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 -_081CEAE8: - bl sub_81CDC50 - lsls r0, 16 - lsrs r0, 16 - subs r0, 0x1 - cmp r4, r0 - blt _081CEA8C - movs r0, 0x67 - strh r0, [r7] - ldr r0, =DummyObjectCallback - str r0, [r7, 0x14] - cmp r4, 0x5 - bhi _081CEB5C - ldr r0, =0x00001806 - adds r5, r6, r0 - ldr r1, =0x02020630 - mov r9, r1 -_081CEB0A: - lsls r2, r4, 2 - adds r2, r4 - lsls r2, 18 - movs r3, 0x80 - lsls r3, 12 - adds r2, r3 - asrs r2, 16 - adds r0, r7, 0 - movs r1, 0xE6 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x40 - beq _081CEB4C - adds r0, r5, r4 - strb r3, [r0] - lsls r1, r3, 4 - adds r1, r3 - lsls r1, 2 - add r1, r9 - ldrb r2, [r1, 0x3] - movs r0, 0x3F - ands r0, r2 - strb r0, [r1, 0x3] - b _081CEB52 - .pool -_081CEB4C: - adds r1, r5, r4 - movs r0, 0xFF - strb r0, [r1] -_081CEB52: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x5 - bls _081CEB0A -_081CEB5C: - movs r0, 0x66 - strh r0, [r7] - ldr r0, =sub_81CE990 - str r0, [r7, 0x14] - lsls r2, r4, 2 - adds r2, r4 - lsls r2, 18 - movs r0, 0x80 - lsls r0, 12 - adds r2, r0 - asrs r2, 16 - adds r0, r7, 0 - movs r1, 0xDE - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x40 - beq _081CEBBC - ldr r1, =0x00001806 - adds r0, r6, r1 - adds r0, r4 - strb r3, [r0] - ldr r0, =0x02020630 - lsls r2, r3, 4 - adds r2, r3 - lsls r2, 2 - adds r2, r0 - ldrb r3, [r2, 0x1] - movs r1, 0x3F - adds r0, r1, 0 - ands r0, r3 - movs r3, 0x40 - orrs r0, r3 - strb r0, [r2, 0x1] - ldrb r0, [r2, 0x3] - ands r1, r0 - movs r0, 0x80 - orrs r1, r0 - strb r1, [r2, 0x3] - b _081CEBC6 - .pool -_081CEBBC: - ldr r2, =0x00001806 - adds r0, r6, r2 - adds r0, r4 - movs r1, 0xFF - strb r1, [r0] -_081CEBC6: - mov r0, r8 - mov r1, r10 - bl sub_81D32B0 - mov r0, r8 - bl LoadObjectPic - movs r0, 0 - mov r3, r10 - str r0, [r3, 0x8] - mov r0, r10 - bl sub_81C795C - add sp, 0x58 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CE9E4 - - thumb_func_start sub_81CEBF4 -sub_81CEBF4: @ 81CEBF4 - push {r4,r5,lr} - adds r5, r0, 0 - bl sub_81CDD5C - cmp r0, 0x1 - bne _081CEC28 - ldr r1, =0x000028dc - adds r0, r5, r1 - ldr r0, [r0] - bl RemoveObjectAndFreeTiles - movs r0, 0x6A - bl FreeObjectTilesByTag - movs r0, 0x69 - bl FreeObjectTilesByTag - movs r0, 0x6A - bl FreeObjectPaletteByTag - movs r0, 0x69 - bl FreeObjectPaletteByTag - b _081CEC68 - .pool -_081CEC28: - movs r4, 0 -_081CEC2A: - ldr r1, =0x00001806 - adds r0, r5, r1 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x6 - bls _081CEC2A - movs r0, 0x65 - bl FreeObjectTilesByTag - movs r0, 0x66 - bl FreeObjectTilesByTag - movs r0, 0x67 - bl FreeObjectTilesByTag - movs r0, 0x65 - bl FreeObjectPaletteByTag - movs r0, 0x66 - bl FreeObjectPaletteByTag -_081CEC68: - ldr r0, =0x00001816 - adds r1, r5, r0 - ldrb r0, [r1] - cmp r0, 0xFF - beq _081CEC8E - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - movs r0, 0x64 - bl FreeObjectTilesByTag - movs r0, 0x64 - bl FreeObjectPaletteByTag -_081CEC8E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CEBF4 - - thumb_func_start sub_81CECA0 -sub_81CECA0: @ 81CECA0 - push {r4,lr} - movs r0, 0xC - bl sub_81C763C - adds r4, r0, 0 - movs r1, 0xC1 - lsls r1, 5 - adds r0, r4, r1 - ldrb r0, [r0] - bl RemoveWindow - bl sub_81CDD5C - cmp r0, 0x1 - bne _081CECEC - ldr r1, =0x00001821 - adds r0, r4, r1 - ldrb r0, [r0] - bl RemoveWindow - ldr r1, =0x00001822 - adds r0, r4, r1 - ldrb r0, [r0] - bl RemoveWindow - ldr r1, =0x00001823 - adds r0, r4, r1 - ldrb r0, [r0] - bl RemoveWindow - b _081CECF0 - .pool -_081CECEC: - bl sub_81C7FDC -_081CECF0: - movs r1, 0x8A - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - adds r0, r4, 0 - bl sub_81CEBF4 - bl sub_81CEE68 - movs r0, 0xC - bl sub_81C7650 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81CECA0 - - thumb_func_start sub_81CED10 -sub_81CED10: @ 81CED10 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0xC - bl sub_81C763C - ldr r1, =0x00001814 - adds r0, r1 - ldrh r0, [r0] - adds r0, 0x26 - strh r0, [r4, 0x20] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CED10 - - thumb_func_start sub_81CED30 -sub_81CED30: @ 81CED30 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x28 - lsls r0, 24 - lsrs r6, r0, 24 - movs r0, 0xC - bl sub_81C763C - mov r8, r0 - ldr r7, =0x00001816 - add r7, r8 - ldrb r0, [r7] - cmp r0, 0xFF - bne _081CEDFC - add r5, sp, 0x18 - add r4, sp, 0x20 - adds r0, r5, 0 - mov r1, sp - adds r2, r4, 0 - bl sub_81D31D0 - adds r0, r6, 0 - bl sub_81CDCB4 - str r0, [sp, 0x18] - adds r0, r6, 0 - bl sub_81CDCD4 - str r0, [sp, 0x20] - adds r0, r4, 0 - bl LoadTaggedObjectPalette - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x00001818 - add r4, r8 - strh r0, [r4] - adds r0, r5, 0 - bl LoadObjectPic - ldr r5, =0x0000181a - add r5, r8 - strh r0, [r5] - mov r0, sp - movs r1, 0x26 - movs r2, 0x68 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - strb r0, [r7] - cmp r0, 0x40 - bne _081CEDBC - movs r0, 0x64 - bl FreeObjectTilesByTag - movs r0, 0x64 - bl FreeObjectPaletteByTag - movs r0, 0xFF - strb r0, [r7] - b _081CEE26 - .pool -_081CEDBC: - strb r0, [r7] - ldr r2, =0x02020630 - ldrb r1, [r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_81CED10 - str r1, [r0] - ldr r1, =0x0000181c - add r1, r8 - ldrh r0, [r5] - lsls r0, 5 - ldr r2, =0x06010000 - adds r0, r2 - str r0, [r1] - ldrh r0, [r4] - lsls r0, 4 - movs r1, 0x80 - lsls r1, 1 - adds r0, r1 - strh r0, [r4] - b _081CEE26 - .pool -_081CEDFC: - adds r0, r6, 0 - bl sub_81CDCB4 - ldr r1, =0x0000181c - add r1, r8 - ldr r2, [r1] - ldr r1, =0x040000d4 - str r0, [r1] - str r2, [r1, 0x4] - ldr r0, =0x80000400 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r0, r6, 0 - bl sub_81CDCD4 - ldr r1, =0x00001818 - add r1, r8 - ldrh r1, [r1] - movs r2, 0x20 - bl gpu_pal_apply -_081CEE26: - add sp, 0x28 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CED30 - - thumb_func_start sub_81CEE44 -sub_81CEE44: @ 81CEE44 - push {r4,lr} - bl sub_81CDC70 - adds r4, r0, 0 - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - adds r0, r4, 0 - bl sub_81D2108 - bl sub_80BA0A8 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81CEE44 - - thumb_func_start sub_81CEE68 -sub_81CEE68: @ 81CEE68 - push {lr} - bl sub_81C760C - pop {r0} - bx r0 - thumb_func_end sub_81CEE68 - - thumb_func_start sub_81CEE74 -sub_81CEE74: @ 81CEE74 - push {lr} - lsls r0, 24 - cmp r0, 0 - beq _081CEE84 - movs r0, 0x2 - bl ShowBg - b _081CEE8A -_081CEE84: - movs r0, 0x2 - bl HideBg -_081CEE8A: - pop {r0} - bx r0 - thumb_func_end sub_81CEE74 - - thumb_func_start sub_81CEE90 -sub_81CEE90: @ 81CEE90 - push {r4,lr} - bl sub_81CDC70 - adds r4, r0, 0 - bl sub_81CDC84 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x030012bc - strb r0, [r1] - adds r1, r4, 0 - adds r1, 0x50 - lsls r2, r0, 2 - adds r2, r0 - lsls r2, 2 - adds r2, 0x14 - adds r2, r4, r2 - adds r0, r4, 0 - bl sub_81D1F84 - adds r0, r4, 0 - bl sub_81D2074 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CEE90 - - thumb_func_start sub_81CEEC8 -sub_81CEEC8: @ 81CEEC8 - push {r4,r5,lr} - bl sub_81CDC70 - adds r5, r0, 0 - bl sub_81CDD5C - cmp r0, 0 - bne _081CEEF0 - bl sub_81CDC60 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl sub_81CDC50 - lsls r0, 16 - lsrs r0, 16 - subs r0, 0x1 - cmp r4, r0 - beq _081CEF0C -_081CEEF0: - bl sub_81CDC84 - lsls r0, 24 - asrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, 0x14 - adds r1, r5, r1 - adds r2, r5, 0 - adds r2, 0x50 - adds r0, r5, 0 - bl sub_81D1F84 -_081CEF0C: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81CEEC8 - - thumb_func_start sub_81CEF14 -sub_81CEF14: @ 81CEF14 - push {r4,lr} - movs r0, 0xC - bl sub_81C763C - adds r4, r0, 0 - bl sub_81CDD5C - cmp r0, 0x1 - beq _081CEF2A - movs r0, 0 - b _081CEF30 -_081CEF2A: - ldr r1, =0x00001828 - adds r0, r4, r1 - ldrb r0, [r0] -_081CEF30: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CEF14 - - thumb_func_start sub_81CEF3C -sub_81CEF3C: @ 81CEF3C - push {r4,lr} - movs r0, 0x7 - movs r1, 0x24 - bl sub_81C761C - adds r4, r0, 0 - cmp r4, 0 - beq _081CEF90 - ldr r1, =0x000006ac - movs r0, 0x12 - bl sub_81C761C - str r0, [r4, 0x20] - cmp r0, 0 - beq _081CEF90 - ldr r0, =sub_81CF010 - str r0, [r4] - ldr r0, =sub_81CF11C - movs r1, 0x1 - bl sub_81C7078 - str r0, [r4, 0x4] - movs r0, 0 - str r0, [r4, 0x18] - bl sub_81C76AC - ldr r1, =gUnknown_086233A0 - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - str r0, [r4, 0x14] - movs r0, 0x1 - b _081CEF92 - .pool -_081CEF90: - movs r0, 0 -_081CEF92: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CEF3C - - thumb_func_start sub_81CEF98 -sub_81CEF98: @ 81CEF98 - push {r4,lr} - movs r0, 0x7 - movs r1, 0x24 - bl sub_81C761C - adds r4, r0, 0 - cmp r4, 0 - beq _081CEFD4 - movs r0, 0x12 - bl sub_81C763C - str r0, [r4, 0x20] - ldr r0, =sub_81CF030 - str r0, [r4] - movs r0, 0x1 - str r0, [r4, 0x18] - bl sub_81C76AC - ldr r1, =gUnknown_086233A0 - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - str r0, [r4, 0x14] - movs r0, 0x1 - b _081CEFD6 - .pool -_081CEFD4: - movs r0, 0 -_081CEFD6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CEF98 - - thumb_func_start sub_81CEFDC -sub_81CEFDC: @ 81CEFDC - push {lr} - movs r0, 0x7 - bl sub_81C763C - ldr r1, [r0] - bl _call_via_r1 - pop {r1} - bx r1 - thumb_func_end sub_81CEFDC - - thumb_func_start sub_81CEFF0 -sub_81CEFF0: @ 81CEFF0 - push {lr} - movs r0, 0x7 - bl sub_81C763C - ldr r0, [r0, 0x1C] - cmp r0, 0 - bne _081CF004 - movs r0, 0x12 - bl sub_81C7650 -_081CF004: - movs r0, 0x7 - bl sub_81C7650 - pop {r0} - bx r0 - thumb_func_end sub_81CEFF0 - - thumb_func_start sub_81CF010 -sub_81CF010: @ 81CF010 - push {r4,lr} - adds r4, r0, 0 - ldr r0, [r4, 0x4] - bl sub_81C70D8 - cmp r0, 0 - bne _081CF022 - ldr r0, =sub_81CF030 - str r0, [r4] -_081CF022: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CF010 - - thumb_func_start sub_81CF030 -sub_81CF030: @ 81CF030 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081CF048 - movs r0, 0x1 - b _081CF0A6 - .pool -_081CF048: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081CF054 - movs r0, 0x2 - b _081CF0A6 -_081CF054: - ldrh r1, [r2, 0x2E] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _081CF062 - movs r0, 0x3 - b _081CF0A6 -_081CF062: - movs r0, 0x10 - ands r0, r1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0 - beq _081CF072 - movs r0, 0x4 - b _081CF0A6 -_081CF072: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081CF088 - str r2, [r4, 0x1C] - ldr r0, =sub_81CF0B0 - str r0, [r4] - movs r0, 0x5 - b _081CF0A6 - .pool -_081CF088: - movs r5, 0x1 - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - bne _081CF096 - movs r0, 0 - b _081CF0A6 -_081CF096: - bl sub_81C875C - ldr r1, [r4, 0x20] - strh r0, [r1, 0x2] - str r5, [r4, 0x1C] - ldr r0, =sub_81CF0B8 - str r0, [r4] - movs r0, 0x6 -_081CF0A6: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CF030 - - thumb_func_start sub_81CF0B0 -sub_81CF0B0: @ 81CF0B0 - ldr r0, =0x000186a3 - bx lr - .pool - thumb_func_end sub_81CF0B0 - - thumb_func_start sub_81CF0B8 -sub_81CF0B8: @ 81CF0B8 - ldr r0, =0x000186a9 - bx lr - .pool - thumb_func_end sub_81CF0B8 - - thumb_func_start sub_81CF0C0 -sub_81CF0C0: @ 81CF0C0 - push {lr} - movs r0, 0x7 - bl sub_81C763C - ldr r0, [r0, 0x18] - pop {r1} - bx r1 - thumb_func_end sub_81CF0C0 - - thumb_func_start sub_81CF0D0 -sub_81CF0D0: @ 81CF0D0 - push {lr} - movs r0, 0x7 - bl sub_81C763C - ldr r0, [r0, 0x20] - adds r0, 0x4 - pop {r1} - bx r1 - thumb_func_end sub_81CF0D0 - - thumb_func_start sub_81CF0E0 -sub_81CF0E0: @ 81CF0E0 - push {lr} - movs r0, 0x7 - bl sub_81C763C - ldr r0, [r0, 0x20] - ldrh r0, [r0] - pop {r1} - bx r1 - thumb_func_end sub_81CF0E0 - - thumb_func_start sub_81CF0F0 -sub_81CF0F0: @ 81CF0F0 - push {r4,lr} - movs r0, 0x7 - bl sub_81C763C - adds r4, r0, 0 - bl sub_81C875C - ldr r1, [r4, 0x20] - lsls r0, 2 - adds r1, r0 - ldrh r0, [r1, 0x6] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CF0F0 - - thumb_func_start sub_81CF10C -sub_81CF10C: @ 81CF10C - push {lr} - movs r0, 0x7 - bl sub_81C763C - ldr r0, [r0, 0x20] - ldrh r0, [r0, 0x2] - pop {r1} - bx r1 - thumb_func_end sub_81CF10C - - thumb_func_start sub_81CF11C -sub_81CF11C: @ 81CF11C - push {lr} - ldr r2, =gUnknown_086233B4 - lsls r1, r0, 2 - adds r1, r2 - ldr r1, [r1] - bl _call_via_r1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CF11C - - thumb_func_start sub_81CF134 -sub_81CF134: @ 81CF134 - push {r4-r6,lr} - sub sp, 0x4 - movs r0, 0x7 - bl sub_81C763C - adds r6, r0, 0 - ldr r0, [r6, 0x20] - movs r1, 0 - strh r1, [r0] - ldr r0, [r6, 0x20] - strh r1, [r0, 0x2] - ldr r1, =0xffffff00 - ldr r0, [sp] - ands r0, r1 - movs r1, 0xE - orrs r0, r1 - str r0, [sp] - movs r5, 0 -_081CF158: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x5 - bl pokemon_getattr - cmp r0, 0 - beq _081CF1AA - adds r0, r4, 0 - movs r1, 0x6 - bl pokemon_getattr - cmp r0, 0 - bne _081CF1A4 - lsls r1, r5, 24 - lsrs r1, 16 - ldr r2, =0xffff00ff - ldr r0, [sp] - ands r0, r2 - orrs r0, r1 - str r0, [sp] - ldr r1, [r6, 0x14] - adds r0, r4, 0 - bl pokemon_getattr - lsls r0, 16 - ldr r2, =0x0000ffff - ldr r1, [sp] - ands r1, r2 - orrs r1, r0 - str r1, [sp] - adds r0, r6, 0 - mov r1, sp - bl sub_81CF2C4 -_081CF1A4: - adds r5, 0x1 - cmp r5, 0x5 - ble _081CF158 -_081CF1AA: - movs r0, 0x1 - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CF134 - - thumb_func_start sub_81CF1C4 -sub_81CF1C4: @ 81CF1C4 - push {lr} - movs r0, 0x7 - bl sub_81C763C - movs r1, 0 - str r1, [r0, 0x10] - str r1, [r0, 0xC] - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_81CF1C4 - - thumb_func_start sub_81CF1D8 -sub_81CF1D8: @ 81CF1D8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - movs r0, 0x7 - bl sub_81C763C - adds r6, r0, 0 - ldr r5, [r6, 0xC] - ldr r4, [r6, 0x10] - movs r0, 0 - mov r8, r0 - cmp r5, 0xD - bgt _081CF268 -_081CF1F4: - cmp r4, 0x1D - bgt _081CF260 - lsls r0, r5, 24 - lsrs r7, r0, 24 -_081CF1FC: - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_80D2270 - cmp r0, 0 - beq _081CF23A - ldr r1, =0xffffff00 - ldr r0, [sp] - ands r0, r1 - orrs r0, r7 - lsls r1, r4, 24 - lsrs r1, 24 - lsls r3, r1, 8 - ldr r2, =0xffff00ff - ands r0, r2 - orrs r0, r3 - str r0, [sp] - ldr r2, [r6, 0x14] - adds r0, r7, 0 - bl get_pokemon_data_from_any_box - lsls r0, 16 - ldr r2, =0x0000ffff - ldr r1, [sp] - ands r1, r2 - orrs r1, r0 - str r1, [sp] - adds r0, r6, 0 - mov r1, sp - bl sub_81CF2C4 -_081CF23A: - movs r0, 0x1 - add r8, r0 - adds r4, 0x1 - mov r0, r8 - cmp r0, 0xE - ble _081CF25C - str r5, [r6, 0xC] - str r4, [r6, 0x10] - movs r0, 0x3 - b _081CF26A - .pool -_081CF25C: - cmp r4, 0x1D - ble _081CF1FC -_081CF260: - movs r4, 0 - adds r5, 0x1 - cmp r5, 0xD - ble _081CF1F4 -_081CF268: - movs r0, 0x1 -_081CF26A: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81CF1D8 - - thumb_func_start sub_81CF278 -sub_81CF278: @ 81CF278 - push {r4-r6,lr} - movs r0, 0x7 - bl sub_81C763C - adds r5, r0, 0 - ldr r0, [r5, 0x20] - ldrh r6, [r0] - ldrh r4, [r0, 0x6] - movs r1, 0x1 - strh r1, [r0, 0x6] - movs r3, 0x1 - cmp r3, r6 - bge _081CF2B8 -_081CF292: - ldr r2, [r5, 0x20] - lsls r0, r3, 2 - adds r1, r2, r0 - ldrh r0, [r1, 0x6] - cmp r0, r4 - bne _081CF2AC - subs r0, r3, 0x1 - lsls r0, 2 - adds r0, r2, r0 - ldrh r0, [r0, 0x6] - strh r0, [r1, 0x6] - adds r0, r3, 0x1 - b _081CF2B2 -_081CF2AC: - adds r4, r0, 0 - adds r0, r3, 0x1 - strh r0, [r1, 0x6] -_081CF2B2: - adds r3, r0, 0 - cmp r3, r6 - blt _081CF292 -_081CF2B8: - movs r0, 0x1 - str r0, [r5, 0x18] - movs r0, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81CF278 - - thumb_func_start sub_81CF2C4 -sub_81CF2C4: @ 81CF2C4 - push {r4-r7,lr} - adds r5, r0, 0 - adds r7, r1, 0 - movs r1, 0 - ldr r0, [r5, 0x20] - ldrh r2, [r0] - lsrs r3, r2, 1 - cmp r2, r3 - beq _081CF2F4 - adds r6, r0, 0 - ldrh r4, [r7, 0x2] -_081CF2DA: - lsls r0, r3, 2 - adds r0, r6, r0 - ldrh r0, [r0, 0x6] - cmp r4, r0 - bls _081CF2E8 - adds r2, r3, 0 - b _081CF2EA -_081CF2E8: - adds r1, r3, 0x1 -_081CF2EA: - subs r0, r2, r1 - lsrs r0, 1 - adds r3, r1, r0 - cmp r2, r3 - bne _081CF2DA -_081CF2F4: - ldr r0, [r5, 0x20] - ldrh r2, [r0] - lsls r6, r3, 2 - cmp r2, r3 - bls _081CF318 - lsls r0, r2, 2 - subs r4, r0, 0x4 -_081CF302: - ldr r0, [r5, 0x20] - lsls r1, r2, 2 - adds r0, 0x4 - adds r1, r0, r1 - adds r0, r4 - ldr r0, [r0] - str r0, [r1] - subs r4, 0x4 - subs r2, 0x1 - cmp r2, r3 - bhi _081CF302 -_081CF318: - ldr r0, [r5, 0x20] - adds r0, 0x4 - adds r0, r6 - ldr r1, [r7] - str r1, [r0] - ldr r1, [r5, 0x20] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81CF2C4 - - thumb_func_start sub_81CF330 -sub_81CF330: @ 81CF330 - push {r4,lr} - movs r1, 0x81 - lsls r1, 4 - movs r0, 0x8 - bl sub_81C761C - adds r4, r0, 0 - cmp r4, 0 - beq _081CF360 - ldr r0, =sub_81CF418 - movs r1, 0x1 - bl sub_81C7078 - str r0, [r4, 0x4] - ldr r0, =sub_81CF3E4 - str r0, [r4] - movs r0, 0 - str r0, [r4, 0xC] - movs r0, 0x1 - b _081CF362 - .pool -_081CF360: - movs r0, 0 -_081CF362: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CF330 - - thumb_func_start sub_81CF368 -sub_81CF368: @ 81CF368 - push {r4,lr} - movs r1, 0x81 - lsls r1, 4 - movs r0, 0x8 - bl sub_81C761C - adds r4, r0, 0 - cmp r4, 0 - beq _081CF398 - ldr r0, =sub_81CF418 - movs r1, 0x1 - bl sub_81C7078 - str r0, [r4, 0x4] - ldr r0, =sub_81CF3E4 - str r0, [r4] - movs r0, 0x1 - str r0, [r4, 0xC] - b _081CF39A - .pool -_081CF398: - movs r0, 0 -_081CF39A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CF368 - - thumb_func_start sub_81CF3A0 -sub_81CF3A0: @ 81CF3A0 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x8 - bl sub_81C763C - adds r5, r0, 0 - ldr r0, =gUnknown_08623598 - lsls r4, 2 - adds r4, r0 - ldr r0, [r4] - movs r1, 0x1 - bl sub_81C7078 - str r0, [r5, 0x4] - ldr r0, =sub_81CF3E4 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CF3A0 - - thumb_func_start sub_81CF3D0 -sub_81CF3D0: @ 81CF3D0 - push {lr} - movs r0, 0x8 - bl sub_81C763C - ldr r0, [r0] - bl _call_via_r0 - pop {r1} - bx r1 - thumb_func_end sub_81CF3D0 - - thumb_func_start sub_81CF3E4 -sub_81CF3E4: @ 81CF3E4 - push {lr} - movs r0, 0x8 - bl sub_81C763C - ldr r0, [r0, 0x4] - bl sub_81C70D8 - pop {r1} - bx r1 - thumb_func_end sub_81CF3E4 - - thumb_func_start sub_81CF3F8 -sub_81CF3F8: @ 81CF3F8 - push {r4,lr} - movs r0, 0x8 - bl sub_81C763C - adds r4, r0, 0 - bl sub_81C8234 - ldrb r0, [r4, 0x8] - bl RemoveWindow - movs r0, 0x8 - bl sub_81C7650 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81CF3F8 - - thumb_func_start sub_81CF418 -sub_81CF418: @ 81CF418 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - movs r0, 0x8 - bl sub_81C763C - adds r5, r0, 0 - cmp r4, 0x5 - bls _081CF42C - b _081CF56E -_081CF42C: - lsls r0, r4, 2 - ldr r1, =_081CF43C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081CF43C: - .4byte _081CF454 - .4byte _081CF4AC - .4byte _081CF4C0 - .4byte _081CF4E0 - .4byte _081CF4F6 - .4byte _081CF55A -_081CF454: - ldr r0, =gUnknown_08623590 - movs r1, 0x2 - bl sub_81C7B54 - ldr r1, =gUnknown_086233E4 - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - adds r1, r5, 0 - adds r1, 0x10 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, =gUnknown_086234AC - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - ldr r0, =gUnknown_086233C4 - movs r1, 0x10 - movs r2, 0x20 - bl sub_81C7944 - movs r0, 0x1 - bl CopyBgTilemapBufferToVram -_081CF498: - movs r0, 0 - b _081CF570 - .pool -_081CF4AC: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - bne _081CF56A - bl sub_81CF0C0 - cmp r0, 0 - beq _081CF56A - b _081CF498 -_081CF4C0: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - bne _081CF56A - ldr r0, =gUnknown_08623570 - movs r1, 0x20 - movs r2, 0x20 - bl sub_81C7944 - bl sub_81CF88C - b _081CF498 - .pool -_081CF4E0: - bl sub_81C8224 - cmp r0, 0 - bne _081CF56A - adds r0, r5, 0 - bl sub_81CF7C8 - movs r0, 0x3 - bl sub_81C7BA4 - b _081CF498 -_081CF4F6: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - bne _081CF56A - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl HideBg - ldr r0, [r5, 0xC] - cmp r0, 0 - bne _081CF552 - bl sub_81C76AC - adds r4, r0, 0 - adds r4, 0x8 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl sub_81C7DFC - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - bl sub_81C7FA0 - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - bl sub_81C7FA0 -_081CF552: - movs r0, 0x1 - bl sub_81C7AC0 - b _081CF498 -_081CF55A: - bl sub_81C7B34 - cmp r0, 0 - bne _081CF56A - bl sub_81C8010 - cmp r0, 0 - beq _081CF56E -_081CF56A: - movs r0, 0x2 - b _081CF570 -_081CF56E: - movs r0, 0x4 -_081CF570: - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81CF418 - - thumb_func_start sub_81CF578 -sub_81CF578: @ 81CF578 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x8 - bl sub_81C763C - adds r5, r0, 0 - cmp r4, 0x1 - beq _081CF5C6 - cmp r4, 0x1 - bgt _081CF592 - cmp r4, 0 - beq _081CF59C - b _081CF5E6 -_081CF592: - cmp r4, 0x2 - beq _081CF5CE - cmp r4, 0x3 - beq _081CF5D8 - b _081CF5E6 -_081CF59C: - bl sub_81C8658 - cmp r0, 0x1 - beq _081CF5B4 - cmp r0, 0x1 - bgt _081CF5AE - cmp r0, 0 - beq _081CF5E6 - b _081CF5D4 -_081CF5AE: - cmp r0, 0x2 - beq _081CF5BE - b _081CF5D4 -_081CF5B4: - movs r0, 0x5 - bl audio_play - movs r0, 0x7 - b _081CF5E8 -_081CF5BE: - movs r0, 0x5 - bl audio_play - b _081CF5D4 -_081CF5C6: - bl sub_81C8630 - cmp r0, 0 - bne _081CF5E2 -_081CF5CE: - adds r0, r5, 0 - bl sub_81CF7F4 -_081CF5D4: - movs r0, 0 - b _081CF5E8 -_081CF5D8: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _081CF5E6 -_081CF5E2: - movs r0, 0x2 - b _081CF5E8 -_081CF5E6: - movs r0, 0x4 -_081CF5E8: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81CF578 - - thumb_func_start sub_81CF5F0 -sub_81CF5F0: @ 81CF5F0 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x8 - bl sub_81C763C - adds r5, r0, 0 - cmp r4, 0x1 - beq _081CF63E - cmp r4, 0x1 - bgt _081CF60A - cmp r4, 0 - beq _081CF614 - b _081CF65E -_081CF60A: - cmp r4, 0x2 - beq _081CF646 - cmp r4, 0x3 - beq _081CF650 - b _081CF65E -_081CF614: - bl sub_81C868C - cmp r0, 0x1 - beq _081CF62C - cmp r0, 0x1 - bgt _081CF626 - cmp r0, 0 - beq _081CF65E - b _081CF64C -_081CF626: - cmp r0, 0x2 - beq _081CF636 - b _081CF64C -_081CF62C: - movs r0, 0x5 - bl audio_play - movs r0, 0x7 - b _081CF660 -_081CF636: - movs r0, 0x5 - bl audio_play - b _081CF64C -_081CF63E: - bl sub_81C8630 - cmp r0, 0 - bne _081CF65A -_081CF646: - adds r0, r5, 0 - bl sub_81CF7F4 -_081CF64C: - movs r0, 0 - b _081CF660 -_081CF650: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _081CF65E -_081CF65A: - movs r0, 0x2 - b _081CF660 -_081CF65E: - movs r0, 0x4 -_081CF660: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81CF5F0 - - thumb_func_start sub_81CF668 -sub_81CF668: @ 81CF668 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x8 - bl sub_81C763C - adds r5, r0, 0 - cmp r4, 0x1 - beq _081CF6B6 - cmp r4, 0x1 - bgt _081CF682 - cmp r4, 0 - beq _081CF68C - b _081CF6D6 -_081CF682: - cmp r4, 0x2 - beq _081CF6BE - cmp r4, 0x3 - beq _081CF6C8 - b _081CF6D6 -_081CF68C: - bl sub_81C86CC - cmp r0, 0x1 - beq _081CF6A4 - cmp r0, 0x1 - bgt _081CF69E - cmp r0, 0 - beq _081CF6D6 - b _081CF6C4 -_081CF69E: - cmp r0, 0x2 - beq _081CF6AE - b _081CF6C4 -_081CF6A4: - movs r0, 0x5 - bl audio_play - movs r0, 0x7 - b _081CF6D8 -_081CF6AE: - movs r0, 0x5 - bl audio_play - b _081CF6C4 -_081CF6B6: - bl sub_81C8630 - cmp r0, 0 - bne _081CF6D2 -_081CF6BE: - adds r0, r5, 0 - bl sub_81CF7F4 -_081CF6C4: - movs r0, 0 - b _081CF6D8 -_081CF6C8: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _081CF6D6 -_081CF6D2: - movs r0, 0x2 - b _081CF6D8 -_081CF6D6: - movs r0, 0x4 -_081CF6D8: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81CF668 - - thumb_func_start sub_81CF6E0 -sub_81CF6E0: @ 81CF6E0 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x8 - bl sub_81C763C - adds r5, r0, 0 - cmp r4, 0x1 - beq _081CF72E - cmp r4, 0x1 - bgt _081CF6FA - cmp r4, 0 - beq _081CF704 - b _081CF74E -_081CF6FA: - cmp r4, 0x2 - beq _081CF736 - cmp r4, 0x3 - beq _081CF740 - b _081CF74E -_081CF704: - bl sub_81C870C - cmp r0, 0x1 - beq _081CF71C - cmp r0, 0x1 - bgt _081CF716 - cmp r0, 0 - beq _081CF74E - b _081CF73C -_081CF716: - cmp r0, 0x2 - beq _081CF726 - b _081CF73C -_081CF71C: - movs r0, 0x5 - bl audio_play - movs r0, 0x7 - b _081CF750 -_081CF726: - movs r0, 0x5 - bl audio_play - b _081CF73C -_081CF72E: - bl sub_81C8630 - cmp r0, 0 - bne _081CF74A -_081CF736: - adds r0, r5, 0 - bl sub_81CF7F4 -_081CF73C: - movs r0, 0 - b _081CF750 -_081CF740: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _081CF74E -_081CF74A: - movs r0, 0x2 - b _081CF750 -_081CF74E: - movs r0, 0x4 -_081CF750: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81CF6E0 - - thumb_func_start sub_81CF758 -sub_81CF758: @ 81CF758 - push {lr} - cmp r0, 0 - beq _081CF764 - cmp r0, 0x1 - beq _081CF778 - b _081CF790 -_081CF764: - movs r0, 0x5 - bl audio_play - movs r0, 0 - bl sub_81C7AC0 - bl sub_81C78A0 - movs r0, 0 - b _081CF792 -_081CF778: - bl sub_81C7B34 - cmp r0, 0 - bne _081CF788 - bl sub_81C78C0 - cmp r0, 0 - beq _081CF78C -_081CF788: - movs r0, 0x2 - b _081CF792 -_081CF78C: - bl sub_81C7FDC -_081CF790: - movs r0, 0x4 -_081CF792: - pop {r1} - bx r1 - thumb_func_end sub_81CF758 - - thumb_func_start sub_81CF798 -sub_81CF798: @ 81CF798 - push {lr} - cmp r0, 0 - beq _081CF7A4 - cmp r0, 0x1 - beq _081CF7B4 - b _081CF7C0 -_081CF7A4: - movs r0, 0x5 - bl audio_play - movs r0, 0 - bl sub_81C7AC0 - movs r0, 0 - b _081CF7C2 -_081CF7B4: - bl sub_81C7B34 - cmp r0, 0 - beq _081CF7C0 - movs r0, 0x2 - b _081CF7C2 -_081CF7C0: - movs r0, 0x4 -_081CF7C2: - pop {r1} - bx r1 - thumb_func_end sub_81CF798 - - thumb_func_start sub_81CF7C8 -sub_81CF7C8: @ 81CF7C8 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gUnknown_086235B4 - bl AddWindow - strh r0, [r4, 0x8] - lsls r0, 24 - lsrs r0, 24 - bl PutWindowTilemap - ldrb r0, [r4, 0x8] - movs r1, 0x1 - bl CopyWindowToVram - adds r0, r4, 0 - bl sub_81CF7F4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CF7C8 - - thumb_func_start sub_81CF7F4 -sub_81CF7F4: @ 81CF7F4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - mov r8, r0 - bl sub_81CF0F0 - adds r7, r0, 0 - bl sub_81AFBF0 - ldr r4, =0x02021cc4 - movs r0, 0 - adds r1, r4, 0 - bl sub_81AFC0C - movs r0, 0xFF - strb r0, [r4] - ldr r5, =0x02021dc4 - ldr r1, =gUnknown_085EC029 - adds r0, r5, 0 - bl sub_81AFC28 - mov r1, r8 - ldrb r0, [r1, 0x8] - movs r1, 0x1 - mov r10, r1 - str r1, [sp] - movs r1, 0xFF - mov r9, r1 - str r1, [sp, 0x4] - movs r6, 0 - str r6, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - movs r3, 0x4 - bl Print - adds r0, r4, 0 - adds r1, r7, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - mov r1, r8 - ldrb r0, [r1, 0x8] - mov r1, r10 - str r1, [sp] - mov r1, r9 - str r1, [sp, 0x4] - str r6, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x22 - bl Print - mov r1, r8 - ldrb r0, [r1, 0x8] - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CF7F4 - - thumb_func_start sub_81CF88C -sub_81CF88C: @ 81CF88C - push {r4,lr} - sub sp, 0x18 - bl sub_81CF0D0 - str r0, [sp] - bl sub_81CF0E0 - mov r1, sp - movs r4, 0 - strh r0, [r1, 0x4] - movs r0, 0x4 - strb r0, [r1, 0x8] - bl sub_81CF10C - mov r1, sp - strh r0, [r1, 0x6] - movs r0, 0xD - strb r0, [r1, 0x9] - movs r0, 0x11 - strb r0, [r1, 0xA] - mov r0, sp - movs r2, 0x1 - strb r2, [r0, 0xB] - movs r0, 0x8 - strb r0, [r1, 0xC] - movs r0, 0x2 - strb r0, [r1, 0xD] - mov r0, sp - strb r2, [r0, 0xE] - ldr r0, =sub_81CF8E4 - str r0, [sp, 0x10] - str r4, [sp, 0x14] - ldr r0, =gUnknown_08623594 - movs r2, 0 - bl sub_81C81D4 - add sp, 0x18 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CF88C - - thumb_func_start sub_81CF8E4 -sub_81CF8E4: @ 81CF8E4 - push {r4-r7,lr} - adds r2, r0, 0 - adds r6, r1, 0 - ldrb r0, [r2] - cmp r0, 0xE - bne _081CF924 - ldrb r1, [r2, 0x1] - movs r0, 0x64 - adds r4, r1, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - bl pokemon_get_gender - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r4, 0 - bl level_by_exp - lsls r0, 24 - lsrs r7, r0, 24 - ldr r2, =0x02021ec4 - adds r0, r4, 0 - movs r1, 0x2 - bl pokemon_getattr - b _081CF94A - .pool -_081CF924: - ldrb r0, [r2] - ldrb r1, [r2, 0x1] - bl get_pokemon_by_box_and_pos - adds r4, r0, 0 - bl pokemon_roll_gender - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r4, 0 - bl sub_80690C0 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r2, =0x02021ec4 - adds r0, r4, 0 - movs r1, 0x2 - bl pokemon_getattr_encrypted -_081CF94A: - ldr r4, =0x02021ec4 - adds r0, r4, 0 - bl GetStringEnd_Limit7 - adds r0, r6, 0 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x3C - bl sub_81DB494 - adds r6, r0, 0 - cmp r5, 0 - beq _081CF974 - cmp r5, 0xFE - beq _081CF97C - ldr r1, =gUnknown_086235D4 - b _081CF97E - .pool -_081CF974: - ldr r1, =gUnknown_086235BC - b _081CF97E - .pool -_081CF97C: - ldr r1, =gUnknown_086235C8 -_081CF97E: - ldr r4, =0x02021cc4 - adds r0, r4, 0 - bl CopyString - movs r1, 0xBA - strb r1, [r0] - adds r0, 0x1 - movs r1, 0xF9 - strb r1, [r0] - adds r0, 0x1 - movs r1, 0x5 - strb r1, [r0] - adds r0, 0x1 - adds r1, r7, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - adds r0, r6, 0 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x28 - bl sub_81DB494 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CF8E4 - - thumb_func_start sub_81CF9BC -sub_81CF9BC: @ 81CF9BC - push {r4,lr} - movs r0, 0x9 - movs r1, 0x20 - bl sub_81C761C - adds r4, r0, 0 - cmp r4, 0 - beq _081CF9FC - ldr r1, =0x000006ac - movs r0, 0x12 - bl sub_81C761C - str r0, [r4, 0x1C] - cmp r0, 0 - beq _081CF9FC - ldr r0, =sub_81CFA68 - str r0, [r4] - ldr r0, =sub_81CFB74 - movs r1, 0x1 - bl sub_81C7078 - str r0, [r4, 0x4] - movs r0, 0 - str r0, [r4, 0x14] - movs r0, 0x1 - b _081CF9FE - .pool -_081CF9FC: - movs r0, 0 -_081CF9FE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CF9BC - - thumb_func_start sub_81CFA04 -sub_81CFA04: @ 81CFA04 - push {r4,lr} - movs r0, 0x9 - movs r1, 0x20 - bl sub_81C761C - adds r4, r0, 0 - cmp r4, 0 - beq _081CFA2C - movs r0, 0x12 - bl sub_81C763C - str r0, [r4, 0x1C] - ldr r0, =sub_81CFA88 - str r0, [r4] - movs r0, 0x1 - str r0, [r4, 0x14] - b _081CFA2E - .pool -_081CFA2C: - movs r0, 0 -_081CFA2E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CFA04 - - thumb_func_start sub_81CFA34 -sub_81CFA34: @ 81CFA34 - push {lr} - movs r0, 0x9 - bl sub_81C763C - ldr r1, [r0] - bl _call_via_r1 - pop {r1} - bx r1 - thumb_func_end sub_81CFA34 - - thumb_func_start sub_81CFA48 -sub_81CFA48: @ 81CFA48 - push {lr} - movs r0, 0x9 - bl sub_81C763C - ldr r0, [r0, 0x18] - cmp r0, 0 - bne _081CFA5C - movs r0, 0x12 - bl sub_81C7650 -_081CFA5C: - movs r0, 0x9 - bl sub_81C7650 - pop {r0} - bx r0 - thumb_func_end sub_81CFA48 - - thumb_func_start sub_81CFA68 -sub_81CFA68: @ 81CFA68 - push {r4,lr} - adds r4, r0, 0 - ldr r0, [r4, 0x4] - bl sub_81C70D8 - cmp r0, 0 - bne _081CFA7A - ldr r0, =sub_81CFA88 - str r0, [r4] -_081CFA7A: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CFA68 - - thumb_func_start sub_81CFA88 -sub_81CFA88: @ 81CFA88 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081CFAA0 - movs r0, 0x1 - b _081CFAFE - .pool -_081CFAA0: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081CFAAC - movs r0, 0x2 - b _081CFAFE -_081CFAAC: - ldrh r1, [r2, 0x2E] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _081CFABA - movs r0, 0x3 - b _081CFAFE -_081CFABA: - movs r0, 0x10 - ands r0, r1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0 - beq _081CFACA - movs r0, 0x4 - b _081CFAFE -_081CFACA: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081CFAE0 - str r2, [r4, 0x18] - ldr r0, =sub_81CFB08 - str r0, [r4] - movs r0, 0x5 - b _081CFAFE - .pool -_081CFAE0: - movs r5, 0x1 - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - bne _081CFAEE - movs r0, 0 - b _081CFAFE -_081CFAEE: - bl sub_81C875C - ldr r1, [r4, 0x1C] - strh r0, [r1, 0x2] - str r5, [r4, 0x18] - ldr r0, =sub_81CFB10 - str r0, [r4] - movs r0, 0x6 -_081CFAFE: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CFA88 - - thumb_func_start sub_81CFB08 -sub_81CFB08: @ 81CFB08 - ldr r0, =0x000186a5 - bx lr - .pool - thumb_func_end sub_81CFB08 - - thumb_func_start sub_81CFB10 -sub_81CFB10: @ 81CFB10 - ldr r0, =0x000186ad - bx lr - .pool - thumb_func_end sub_81CFB10 - - thumb_func_start sub_81CFB18 -sub_81CFB18: @ 81CFB18 - push {lr} - movs r0, 0x9 - bl sub_81C763C - ldr r0, [r0, 0x14] - pop {r1} - bx r1 - thumb_func_end sub_81CFB18 - - thumb_func_start sub_81CFB28 -sub_81CFB28: @ 81CFB28 - push {lr} - movs r0, 0x9 - bl sub_81C763C - ldr r0, [r0, 0x1C] - adds r0, 0x4 - pop {r1} - bx r1 - thumb_func_end sub_81CFB28 - - thumb_func_start sub_81CFB38 -sub_81CFB38: @ 81CFB38 - push {lr} - movs r0, 0x9 - bl sub_81C763C - ldr r0, [r0, 0x1C] - ldrh r0, [r0] - pop {r1} - bx r1 - thumb_func_end sub_81CFB38 - - thumb_func_start sub_81CFB48 -sub_81CFB48: @ 81CFB48 - push {r4,lr} - movs r0, 0x9 - bl sub_81C763C - adds r4, r0, 0 - bl sub_81C875C - ldr r1, [r4, 0x1C] - lsls r0, 2 - adds r1, r0 - ldrh r0, [r1, 0x6] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CFB48 - - thumb_func_start sub_81CFB64 -sub_81CFB64: @ 81CFB64 - push {lr} - movs r0, 0x9 - bl sub_81C763C - ldr r0, [r0, 0x1C] - ldrh r0, [r0, 0x2] - pop {r1} - bx r1 - thumb_func_end sub_81CFB64 - - thumb_func_start sub_81CFB74 -sub_81CFB74: @ 81CFB74 - push {lr} - ldr r2, =gUnknown_086235D8 - lsls r1, r0, 2 - adds r1, r2 - ldr r1, [r1] - bl _call_via_r1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CFB74 - - thumb_func_start sub_81CFB8C -sub_81CFB8C: @ 81CFB8C - push {r4-r6,lr} - sub sp, 0x4 - movs r0, 0x9 - bl sub_81C763C - adds r6, r0, 0 - ldr r0, [r6, 0x1C] - movs r1, 0 - strh r1, [r0] - ldr r0, [r6, 0x1C] - strh r1, [r0, 0x2] - ldr r1, =0xffffff00 - ldr r0, [sp] - ands r0, r1 - movs r1, 0xE - orrs r0, r1 - str r0, [sp] - movs r5, 0 -_081CFBB0: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x5 - bl pokemon_getattr - cmp r0, 0 - beq _081CFC10 - adds r0, r4, 0 - movs r1, 0x6 - bl pokemon_getattr - cmp r0, 0 - bne _081CFC0A - adds r0, r4, 0 - movs r1, 0x4 - bl pokemon_getattr - cmp r0, 0 - bne _081CFC0A - adds r0, r4, 0 - movs r1, 0x52 - bl pokemon_getattr - adds r3, r0, 0 - cmp r3, 0 - beq _081CFC0A - lsls r1, r5, 24 - lsrs r1, 16 - ldr r2, =0xffff00ff - ldr r0, [sp] - ands r0, r2 - orrs r0, r1 - lsls r2, r3, 16 - ldr r1, =0x0000ffff - ands r0, r1 - orrs r0, r2 - str r0, [sp] - adds r0, r6, 0 - mov r1, sp - bl sub_81CFCEC -_081CFC0A: - adds r5, 0x1 - cmp r5, 0x5 - ble _081CFBB0 -_081CFC10: - movs r0, 0x1 - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CFB8C - - thumb_func_start sub_81CFC2C -sub_81CFC2C: @ 81CFC2C - push {lr} - movs r0, 0x9 - bl sub_81C763C - movs r1, 0 - str r1, [r0, 0x10] - str r1, [r0, 0xC] - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_81CFC2C - - thumb_func_start sub_81CFC40 -sub_81CFC40: @ 81CFC40 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - movs r0, 0x9 - bl sub_81C763C - mov r8, r0 - ldr r7, [r0, 0xC] - ldr r6, [r0, 0x10] - movs r0, 0 - mov r9, r0 - cmp r7, 0xD - bgt _081CFCD4 - b _081CFCC8 -_081CFC60: - adds r0, r7, 0 - adds r1, r6, 0 - bl sub_80D2270 - cmp r0, 0 - beq _081CFCA6 - lsls r0, r7, 24 - lsrs r5, r0, 24 - lsls r0, r6, 24 - lsrs r4, r0, 24 - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x52 - bl get_pokemon_data_from_any_box - adds r3, r0, 0 - cmp r3, 0 - beq _081CFCA6 - ldr r1, =0xffffff00 - ldr r0, [sp] - ands r0, r1 - orrs r0, r5 - lsls r2, r4, 8 - ldr r1, =0xffff00ff - ands r0, r1 - orrs r0, r2 - lsls r2, r3, 16 - ldr r1, =0x0000ffff - ands r0, r1 - orrs r0, r2 - str r0, [sp] - mov r0, r8 - mov r1, sp - bl sub_81CFCEC -_081CFCA6: - movs r1, 0x1 - add r9, r1 - adds r6, 0x1 - mov r0, r9 - cmp r0, 0xE - ble _081CFCC8 - mov r1, r8 - str r7, [r1, 0xC] - str r6, [r1, 0x10] - movs r0, 0x3 - b _081CFCDC - .pool -_081CFCC8: - cmp r6, 0x1D - ble _081CFC60 - movs r6, 0 - adds r7, 0x1 - cmp r7, 0xD - ble _081CFCC8 -_081CFCD4: - movs r0, 0x1 - mov r1, r8 - str r0, [r1, 0x14] - movs r0, 0x4 -_081CFCDC: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81CFC40 - - thumb_func_start sub_81CFCEC -sub_81CFCEC: @ 81CFCEC - push {r4-r7,lr} - adds r5, r0, 0 - adds r7, r1, 0 - movs r1, 0 - ldr r0, [r5, 0x1C] - ldrh r2, [r0] - lsrs r3, r2, 1 - cmp r2, r3 - beq _081CFD1C - adds r6, r0, 0 - ldrh r4, [r7, 0x2] -_081CFD02: - lsls r0, r3, 2 - adds r0, r6, r0 - ldrh r0, [r0, 0x6] - cmp r4, r0 - bls _081CFD10 - adds r2, r3, 0 - b _081CFD12 -_081CFD10: - adds r1, r3, 0x1 -_081CFD12: - subs r0, r2, r1 - lsrs r0, 1 - adds r3, r1, r0 - cmp r2, r3 - bne _081CFD02 -_081CFD1C: - ldr r0, [r5, 0x1C] - ldrh r2, [r0] - lsls r6, r3, 2 - cmp r2, r3 - bls _081CFD40 - lsls r0, r2, 2 - subs r4, r0, 0x4 -_081CFD2A: - ldr r0, [r5, 0x1C] - lsls r1, r2, 2 - adds r0, 0x4 - adds r1, r0, r1 - adds r0, r4 - ldr r0, [r0] - str r0, [r1] - subs r4, 0x4 - subs r2, 0x1 - cmp r2, r3 - bhi _081CFD2A -_081CFD40: - ldr r0, [r5, 0x1C] - adds r0, 0x4 - adds r0, r6 - ldr r1, [r7] - str r1, [r0] - ldr r1, [r5, 0x1C] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81CFCEC - - thumb_func_start sub_81CFD58 -sub_81CFD58: @ 81CFD58 - push {r4-r6,lr} - movs r5, 0 -_081CFD5C: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x5 - bl pokemon_getattr - cmp r0, 0 - beq _081CFD8A - adds r0, r4, 0 - movs r1, 0x6 - bl pokemon_getattr - cmp r0, 0 - bne _081CFD8A - adds r0, r4, 0 - movs r1, 0x53 - bl pokemon_getattr - cmp r0, 0 - bne _081CFDB2 -_081CFD8A: - adds r5, 0x1 - cmp r5, 0x5 - ble _081CFD5C - movs r5, 0 -_081CFD92: - movs r4, 0 - lsls r6, r5, 24 -_081CFD96: - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_80D2270 - cmp r0, 0 - beq _081CFDBC - lsls r1, r4, 24 - lsrs r1, 24 - lsrs r0, r6, 24 - movs r2, 0x53 - bl get_pokemon_data_from_any_box - cmp r0, 0 - beq _081CFDBC -_081CFDB2: - movs r0, 0x1 - b _081CFDCA - .pool -_081CFDBC: - adds r4, 0x1 - cmp r4, 0x1D - ble _081CFD96 - adds r5, 0x1 - cmp r5, 0xD - ble _081CFD92 - movs r0, 0 -_081CFDCA: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81CFD58 - - thumb_func_start sub_81CFDD0 -sub_81CFDD0: @ 81CFDD0 - push {r4,lr} - movs r1, 0x81 - lsls r1, 4 - movs r0, 0xA - bl sub_81C761C - adds r4, r0, 0 - cmp r4, 0 - beq _081CFE00 - ldr r0, =sub_81CFEB8 - movs r1, 0x1 - bl sub_81C7078 - str r0, [r4, 0x4] - ldr r0, =sub_81CFE84 - str r0, [r4] - movs r0, 0 - str r0, [r4, 0xC] - movs r0, 0x1 - b _081CFE02 - .pool -_081CFE00: - movs r0, 0 -_081CFE02: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CFDD0 - - thumb_func_start sub_81CFE08 -sub_81CFE08: @ 81CFE08 - push {r4,lr} - movs r1, 0x81 - lsls r1, 4 - movs r0, 0xA - bl sub_81C761C - adds r4, r0, 0 - cmp r4, 0 - beq _081CFE38 - ldr r0, =sub_81CFEB8 - movs r1, 0x1 - bl sub_81C7078 - str r0, [r4, 0x4] - ldr r0, =sub_81CFE84 - str r0, [r4] - movs r0, 0x1 - str r0, [r4, 0xC] - b _081CFE3A - .pool -_081CFE38: - movs r0, 0 -_081CFE3A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CFE08 - - thumb_func_start sub_81CFE40 -sub_81CFE40: @ 81CFE40 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0xA - bl sub_81C763C - adds r5, r0, 0 - ldr r0, =gUnknown_086237B8 - lsls r4, 2 - adds r4, r0 - ldr r0, [r4] - movs r1, 0x1 - bl sub_81C7078 - str r0, [r5, 0x4] - ldr r0, =sub_81CFE84 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CFE40 - - thumb_func_start sub_81CFE70 -sub_81CFE70: @ 81CFE70 - push {lr} - movs r0, 0xA - bl sub_81C763C - ldr r0, [r0] - bl _call_via_r0 - pop {r1} - bx r1 - thumb_func_end sub_81CFE70 - - thumb_func_start sub_81CFE84 -sub_81CFE84: @ 81CFE84 - push {lr} - movs r0, 0xA - bl sub_81C763C - ldr r0, [r0, 0x4] - bl sub_81C70D8 - pop {r1} - bx r1 - thumb_func_end sub_81CFE84 - - thumb_func_start sub_81CFE98 -sub_81CFE98: @ 81CFE98 - push {r4,lr} - movs r0, 0xA - bl sub_81C763C - adds r4, r0, 0 - bl sub_81C8234 - ldrb r0, [r4, 0x8] - bl RemoveWindow - movs r0, 0xA - bl sub_81C7650 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81CFE98 - - thumb_func_start sub_81CFEB8 -sub_81CFEB8: @ 81CFEB8 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - movs r0, 0xA - bl sub_81C763C - adds r5, r0, 0 - cmp r4, 0x5 - bls _081CFECC - b _081CFFF2 -_081CFECC: - lsls r0, r4, 2 - ldr r1, =_081CFEDC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081CFEDC: - .4byte _081CFEF4 - .4byte _081CFF48 - .4byte _081CFF76 - .4byte _081CFF94 - .4byte _081CFFA4 - .4byte _081CFFDE -_081CFEF4: - ldr r0, =gUnknown_086237B0 - movs r1, 0x2 - bl sub_81C7B54 - ldr r1, =gUnknown_08623604 - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - adds r1, r5, 0 - adds r1, 0x10 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, =gUnknown_086236CC - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - ldr r0, =gUnknown_086235E4 - movs r1, 0x10 - movs r2, 0x20 - bl sub_81C7944 - movs r0, 0x1 - bl CopyBgTilemapBufferToVram -_081CFF32: - movs r0, 0 - b _081CFFF4 - .pool -_081CFF48: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - bne _081CFFEE - bl sub_81CFB18 - cmp r0, 0 - beq _081CFFEE - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 - bl ShowBg - b _081CFF32 -_081CFF76: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - bne _081CFFEE - ldr r0, =gUnknown_08623790 - movs r1, 0x20 - movs r2, 0x20 - bl sub_81C7944 - bl sub_81D0304 - b _081CFF32 - .pool -_081CFF94: - bl sub_81C8224 - cmp r0, 0 - bne _081CFFEE - adds r0, r5, 0 - bl sub_81D024C - b _081CFF32 -_081CFFA4: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - bne _081CFFEE - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl HideBg - movs r0, 0x9 - bl sub_81C7BA4 - movs r0, 0x1 - bl sub_81C7AC0 - ldr r0, [r5, 0xC] - cmp r0, 0 - bne _081CFF32 - movs r0, 0x2 - bl sub_81C7DFC - movs r0, 0x2 - movs r1, 0x1 - movs r2, 0 - bl sub_81C7FA0 - b _081CFF32 -_081CFFDE: - bl sub_81C7B34 - cmp r0, 0 - bne _081CFFEE - bl sub_81C8010 - cmp r0, 0 - beq _081CFFF2 -_081CFFEE: - movs r0, 0x2 - b _081CFFF4 -_081CFFF2: - movs r0, 0x4 -_081CFFF4: - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81CFEB8 - - thumb_func_start sub_81CFFFC -sub_81CFFFC: @ 81CFFFC - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0xA - bl sub_81C763C - adds r5, r0, 0 - cmp r4, 0x1 - beq _081D004A - cmp r4, 0x1 - bgt _081D0016 - cmp r4, 0 - beq _081D0020 - b _081D006A -_081D0016: - cmp r4, 0x2 - beq _081D0052 - cmp r4, 0x3 - beq _081D005C - b _081D006A -_081D0020: - bl sub_81C8658 - cmp r0, 0x1 - beq _081D0038 - cmp r0, 0x1 - bgt _081D0032 - cmp r0, 0 - beq _081D006A - b _081D0058 -_081D0032: - cmp r0, 0x2 - beq _081D0042 - b _081D0058 -_081D0038: - movs r0, 0x5 - bl audio_play - movs r0, 0x7 - b _081D006C -_081D0042: - movs r0, 0x5 - bl audio_play - b _081D0058 -_081D004A: - bl sub_81C8630 - cmp r0, 0 - bne _081D0066 -_081D0052: - adds r0, r5, 0 - bl sub_81D0288 -_081D0058: - movs r0, 0 - b _081D006C -_081D005C: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _081D006A -_081D0066: - movs r0, 0x2 - b _081D006C -_081D006A: - movs r0, 0x4 -_081D006C: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81CFFFC - - thumb_func_start sub_81D0074 -sub_81D0074: @ 81D0074 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0xA - bl sub_81C763C - adds r5, r0, 0 - cmp r4, 0x1 - beq _081D00C2 - cmp r4, 0x1 - bgt _081D008E - cmp r4, 0 - beq _081D0098 - b _081D00E2 -_081D008E: - cmp r4, 0x2 - beq _081D00CA - cmp r4, 0x3 - beq _081D00D4 - b _081D00E2 -_081D0098: - bl sub_81C868C - cmp r0, 0x1 - beq _081D00B0 - cmp r0, 0x1 - bgt _081D00AA - cmp r0, 0 - beq _081D00E2 - b _081D00D0 -_081D00AA: - cmp r0, 0x2 - beq _081D00BA - b _081D00D0 -_081D00B0: - movs r0, 0x5 - bl audio_play - movs r0, 0x7 - b _081D00E4 -_081D00BA: - movs r0, 0x5 - bl audio_play - b _081D00D0 -_081D00C2: - bl sub_81C8630 - cmp r0, 0 - bne _081D00DE -_081D00CA: - adds r0, r5, 0 - bl sub_81D0288 -_081D00D0: - movs r0, 0 - b _081D00E4 -_081D00D4: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _081D00E2 -_081D00DE: - movs r0, 0x2 - b _081D00E4 -_081D00E2: - movs r0, 0x4 -_081D00E4: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81D0074 - - thumb_func_start sub_81D00EC -sub_81D00EC: @ 81D00EC - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0xA - bl sub_81C763C - adds r5, r0, 0 - cmp r4, 0x1 - beq _081D013A - cmp r4, 0x1 - bgt _081D0106 - cmp r4, 0 - beq _081D0110 - b _081D015A -_081D0106: - cmp r4, 0x2 - beq _081D0142 - cmp r4, 0x3 - beq _081D014C - b _081D015A -_081D0110: - bl sub_81C86CC - cmp r0, 0x1 - beq _081D0128 - cmp r0, 0x1 - bgt _081D0122 - cmp r0, 0 - beq _081D015A - b _081D0148 -_081D0122: - cmp r0, 0x2 - beq _081D0132 - b _081D0148 -_081D0128: - movs r0, 0x5 - bl audio_play - movs r0, 0x7 - b _081D015C -_081D0132: - movs r0, 0x5 - bl audio_play - b _081D0148 -_081D013A: - bl sub_81C8630 - cmp r0, 0 - bne _081D0156 -_081D0142: - adds r0, r5, 0 - bl sub_81D0288 -_081D0148: - movs r0, 0 - b _081D015C -_081D014C: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _081D015A -_081D0156: - movs r0, 0x2 - b _081D015C -_081D015A: - movs r0, 0x4 -_081D015C: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81D00EC - - thumb_func_start sub_81D0164 -sub_81D0164: @ 81D0164 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0xA - bl sub_81C763C - adds r5, r0, 0 - cmp r4, 0x1 - beq _081D01B2 - cmp r4, 0x1 - bgt _081D017E - cmp r4, 0 - beq _081D0188 - b _081D01D2 -_081D017E: - cmp r4, 0x2 - beq _081D01BA - cmp r4, 0x3 - beq _081D01C4 - b _081D01D2 -_081D0188: - bl sub_81C870C - cmp r0, 0x1 - beq _081D01A0 - cmp r0, 0x1 - bgt _081D019A - cmp r0, 0 - beq _081D01D2 - b _081D01C0 -_081D019A: - cmp r0, 0x2 - beq _081D01AA - b _081D01C0 -_081D01A0: - movs r0, 0x5 - bl audio_play - movs r0, 0x7 - b _081D01D4 -_081D01AA: - movs r0, 0x5 - bl audio_play - b _081D01C0 -_081D01B2: - bl sub_81C8630 - cmp r0, 0 - bne _081D01CE -_081D01BA: - adds r0, r5, 0 - bl sub_81D0288 -_081D01C0: - movs r0, 0 - b _081D01D4 -_081D01C4: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _081D01D2 -_081D01CE: - movs r0, 0x2 - b _081D01D4 -_081D01D2: - movs r0, 0x4 -_081D01D4: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81D0164 - - thumb_func_start sub_81D01DC -sub_81D01DC: @ 81D01DC - push {lr} - cmp r0, 0 - beq _081D01E8 - cmp r0, 0x1 - beq _081D01FC - b _081D0214 -_081D01E8: - movs r0, 0x5 - bl audio_play - movs r0, 0 - bl sub_81C7AC0 - bl sub_81C78A0 - movs r0, 0 - b _081D0216 -_081D01FC: - bl sub_81C7B34 - cmp r0, 0 - bne _081D020C - bl sub_81C78C0 - cmp r0, 0 - beq _081D0210 -_081D020C: - movs r0, 0x2 - b _081D0216 -_081D0210: - bl sub_81C7FDC -_081D0214: - movs r0, 0x4 -_081D0216: - pop {r1} - bx r1 - thumb_func_end sub_81D01DC - - thumb_func_start sub_81D021C -sub_81D021C: @ 81D021C - push {lr} - cmp r0, 0 - beq _081D0228 - cmp r0, 0x1 - beq _081D0238 - b _081D0244 -_081D0228: - movs r0, 0x5 - bl audio_play - movs r0, 0 - bl sub_81C7AC0 - movs r0, 0 - b _081D0246 -_081D0238: - bl sub_81C7B34 - cmp r0, 0 - beq _081D0244 - movs r0, 0x2 - b _081D0246 -_081D0244: - movs r0, 0x4 -_081D0246: - pop {r1} - bx r1 - thumb_func_end sub_81D021C - - thumb_func_start sub_81D024C -sub_81D024C: @ 81D024C - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gUnknown_086237D4 - bl AddWindow - strh r0, [r4, 0x8] - lsls r0, 24 - lsrs r0, 24 - bl PutWindowTilemap - bl sub_81CFB38 - adds r2, r0, 0 - ldrh r0, [r4, 0x8] - movs r1, 0 - bl sub_81D02B0 - ldrb r0, [r4, 0x8] - movs r1, 0x1 - bl CopyWindowToVram - adds r0, r4, 0 - bl sub_81D0288 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D024C - - thumb_func_start sub_81D0288 -sub_81D0288: @ 81D0288 - push {r4,r5,lr} - adds r5, r0, 0 - bl sub_81C875C - adds r4, r0, 0 - bl sub_81CFB38 - adds r2, r0, 0 - ldrh r0, [r5, 0x8] - adds r4, 0x1 - adds r1, r4, 0 - bl sub_81D02B0 - ldrb r0, [r5, 0x8] - movs r1, 0x2 - bl CopyWindowToVram - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81D0288 - - thumb_func_start sub_81D02B0 -sub_81D02B0: @ 81D02B0 - push {r4,r5,lr} - sub sp, 0x1C - adds r4, r0, 0 - adds r5, r2, 0 - add r0, sp, 0xC - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - movs r1, 0xBA - strb r1, [r0] - adds r0, 0x1 - adds r1, r5, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - movs r0, 0x1 - add r1, sp, 0xC - movs r2, 0x38 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x1 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r4, 0 - movs r1, 0x1 - add r2, sp, 0xC - bl Print - add sp, 0x1C - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81D02B0 - - thumb_func_start sub_81D0304 -sub_81D0304: @ 81D0304 - push {r4,lr} - sub sp, 0x18 - bl sub_81CFB28 - str r0, [sp] - bl sub_81CFB38 - mov r1, sp - movs r4, 0 - strh r0, [r1, 0x4] - movs r0, 0x4 - strb r0, [r1, 0x8] - bl sub_81CFB64 - mov r1, sp - strh r0, [r1, 0x6] - movs r0, 0xD - strb r0, [r1, 0x9] - movs r0, 0x11 - strb r0, [r1, 0xA] - mov r0, sp - movs r2, 0x1 - strb r2, [r0, 0xB] - movs r0, 0x8 - strb r0, [r1, 0xC] - movs r0, 0x2 - strb r0, [r1, 0xD] - mov r0, sp - strb r2, [r0, 0xE] - ldr r0, =sub_81D035C - str r0, [sp, 0x10] - str r4, [sp, 0x14] - ldr r0, =gUnknown_086237B4 - movs r2, 0 - bl sub_81C81D4 - add sp, 0x18 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D0304 - - thumb_func_start sub_81D035C -sub_81D035C: @ 81D035C - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r1, 0 - adds r7, r0, 0 - ldrb r0, [r7] - cmp r0, 0xE - bne _081D03A4 - ldrb r1, [r7, 0x1] - movs r0, 0x64 - adds r4, r1, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - bl pokemon_get_gender - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r4, 0 - bl level_by_exp - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r2, =0x02021ec4 - adds r0, r4, 0 - movs r1, 0x2 - bl pokemon_getattr - b _081D03CC - .pool -_081D03A4: - ldrb r0, [r7] - ldrb r1, [r7, 0x1] - bl get_pokemon_by_box_and_pos - adds r4, r0, 0 - bl pokemon_roll_gender - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r4, 0 - bl sub_80690C0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r2, =0x02021ec4 - adds r0, r4, 0 - movs r1, 0x2 - bl pokemon_getattr_encrypted -_081D03CC: - ldr r4, =0x02021ec4 - adds r0, r4, 0 - bl GetStringEnd_Limit7 - adds r0, r6, 0 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x3C - bl sub_81DB494 - adds r6, r0, 0 - cmp r5, 0 - beq _081D03F8 - cmp r5, 0xFE - beq _081D0400 - ldr r1, =gUnknown_086237F4 - b _081D0402 - .pool -_081D03F8: - ldr r1, =gUnknown_086237DC - b _081D0402 - .pool -_081D0400: - ldr r1, =gUnknown_086237E8 -_081D0402: - ldr r4, =0x02021cc4 - adds r0, r4, 0 - bl CopyString - movs r1, 0xBA - strb r1, [r0] - adds r0, 0x1 - movs r1, 0xF9 - strb r1, [r0] - adds r0, 0x1 - movs r1, 0x5 - strb r1, [r0] - adds r0, 0x1 - mov r1, r8 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - adds r0, r6, 0 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x36 - bl sub_81DB494 - adds r6, r0, 0 - ldrh r1, [r7, 0x2] - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalString - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D035C - - thumb_func_start sub_81D0450 -sub_81D0450: @ 81D0450 - push {r4,lr} - movs r0, 0xD - movs r1, 0x9C - bl sub_81C761C - adds r4, r0, 0 - cmp r4, 0 - beq _081D0498 - movs r0, 0x12 - bl sub_81C763C - str r0, [r4, 0x8] - cmp r0, 0 - beq _081D0498 - adds r0, r4, 0 - bl sub_81D0814 - adds r1, r4, 0 - adds r1, 0x98 - ldr r0, =sub_81D04C4 - str r0, [r1] - ldr r1, =0x030026fc - movs r0, 0x3 - strh r0, [r1] - ldr r1, =0x030022b0 - movs r0, 0xA - strh r0, [r1] - movs r0, 0x1 - b _081D049A - .pool -_081D0498: - movs r0, 0 -_081D049A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81D0450 - - thumb_func_start sub_81D04A0 -sub_81D04A0: @ 81D04A0 - push {lr} - movs r0, 0xD - bl sub_81C763C - adds r1, r0, 0 - adds r1, 0x98 - ldr r1, [r1] - bl _call_via_r1 - pop {r1} - bx r1 - thumb_func_end sub_81D04A0 - - thumb_func_start sub_81D04B8 -sub_81D04B8: @ 81D04B8 - push {lr} - movs r0, 0xD - bl sub_81C7650 - pop {r0} - bx r0 - thumb_func_end sub_81D04B8 - - thumb_func_start sub_81D04C4 -sub_81D04C4: @ 81D04C4 - push {r4,lr} - adds r4, r0, 0 - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081D04E4 - ldr r3, [r4, 0x8] - ldrh r0, [r3, 0x2] - cmp r0, 0 - beq _081D04E4 - subs r0, 0x1 - b _081D04FC - .pool -_081D04E4: - ldrh r1, [r2, 0x30] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081D050C - ldr r3, [r4, 0x8] - ldrh r1, [r3, 0x2] - ldrh r0, [r3] - subs r0, 0x1 - cmp r1, r0 - bge _081D050C - adds r0, r1, 0x1 -_081D04FC: - movs r1, 0 - strh r0, [r3, 0x2] - strh r1, [r4, 0xC] - adds r0, r4, 0 - bl sub_81D0814 - movs r0, 0x1 - b _081D053E -_081D050C: - ldrh r2, [r2, 0x2E] - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - beq _081D0528 - adds r1, r4, 0 - adds r1, 0x98 - ldr r0, =sub_81D0548 - str r0, [r1] - movs r0, 0x2 - b _081D053E - .pool -_081D0528: - movs r0, 0x2 - ands r0, r2 - cmp r0, 0 - bne _081D0534 - movs r0, 0 - b _081D053E -_081D0534: - adds r1, r4, 0 - adds r1, 0x98 - ldr r0, =sub_81D05D4 - str r0, [r1] - movs r0, 0x5 -_081D053E: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D04C4 - - thumb_func_start sub_81D0548 -sub_81D0548: @ 81D0548 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081D0562 - adds r0, r4, 0 - bl sub_81D05DC - cmp r0, 0 - bne _081D05A4 -_081D0562: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x30] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081D0578 - adds r0, r4, 0 - bl sub_81D061C - cmp r0, 0 - bne _081D05A4 -_081D0578: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x30] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _081D058E - adds r0, r4, 0 - bl sub_81D0664 - cmp r0, 0 - bne _081D05A4 -_081D058E: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x30] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _081D05AC - adds r0, r4, 0 - bl sub_81D0688 - cmp r0, 0 - beq _081D05AC -_081D05A4: - movs r0, 0x3 - b _081D05CA - .pool -_081D05AC: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _081D05C0 - movs r0, 0 - b _081D05CA - .pool -_081D05C0: - adds r1, r4, 0 - adds r1, 0x98 - ldr r0, =sub_81D04C4 - str r0, [r1] - movs r0, 0x4 -_081D05CA: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D0548 - - thumb_func_start sub_81D05D4 -sub_81D05D4: @ 81D05D4 - ldr r0, =0x000186ae - bx lr - .pool - thumb_func_end sub_81D05D4 - - thumb_func_start sub_81D05DC -sub_81D05DC: @ 81D05DC - push {r4,lr} - adds r1, r0, 0 - ldrh r0, [r1, 0xC] - adds r2, r0, 0 - cmp r2, 0x18 - bhi _081D05F0 - cmp r2, 0x8 - bls _081D0612 - subs r0, 0x9 - b _081D060C -_081D05F0: - ldrh r3, [r1, 0x10] - adds r2, r3, 0 - cmp r2, 0 - beq _081D0612 - ldrh r0, [r1, 0xC] - subs r0, 0x1B - ldrh r4, [r1, 0xE] - adds r0, r4 - strh r0, [r1, 0xC] - lsls r0, 16 - lsrs r0, 16 - cmp r0, r2 - bcc _081D060E - subs r0, r3, 0x1 -_081D060C: - strh r0, [r1, 0xC] -_081D060E: - movs r0, 0x1 - b _081D0614 -_081D0612: - movs r0, 0 -_081D0614: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81D05DC - - thumb_func_start sub_81D061C -sub_81D061C: @ 81D061C - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0xC] - adds r1, r0, 0 - cmp r1, 0x18 - bhi _081D065C - ldrh r3, [r2, 0xE] - cmp r1, r3 - bcs _081D0640 - adds r0, 0x9 - strh r0, [r2, 0xC] - ldrh r1, [r2, 0x10] - lsls r0, 16 - lsrs r0, 16 - cmp r0, r1 - bcc _081D0658 - subs r0, r1, 0x1 - b _081D0656 -_081D0640: - ldrh r0, [r2, 0x12] - cmp r0, 0 - beq _081D065C - ldrh r1, [r2, 0xC] - ldrh r0, [r2, 0xE] - subs r0, r1, r0 - ldrh r1, [r2, 0x12] - cmp r0, r1 - blt _081D0654 - subs r0, r1, 0x1 -_081D0654: - adds r0, 0x1B -_081D0656: - strh r0, [r2, 0xC] -_081D0658: - movs r0, 0x1 - b _081D065E -_081D065C: - movs r0, 0 -_081D065E: - pop {r1} - bx r1 - thumb_func_end sub_81D061C - - thumb_func_start sub_81D0664 -sub_81D0664: @ 81D0664 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r4, [r5, 0xC] - adds r0, r4, 0 - movs r1, 0x9 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - bne _081D067C - movs r0, 0 - b _081D0682 -_081D067C: - subs r0, r4, 0x1 - strh r0, [r5, 0xC] - movs r0, 0x1 -_081D0682: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81D0664 - - thumb_func_start sub_81D0688 -sub_81D0688: @ 81D0688 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r4, [r5, 0xC] - adds r0, r4, 0 - movs r1, 0x9 - bl __umodsi3 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x7 - bgt _081D06BC - cmp r4, 0x1A - bhi _081D06AC - ldrh r0, [r5, 0x10] - subs r0, 0x1 - cmp r4, r0 - bge _081D06BC - b _081D06B4 -_081D06AC: - ldrh r0, [r5, 0x12] - subs r0, 0x1 - cmp r1, r0 - bge _081D06BC -_081D06B4: - adds r0, r4, 0x1 - strh r0, [r5, 0xC] - movs r0, 0x1 - b _081D06BE -_081D06BC: - movs r0, 0 -_081D06BE: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81D0688 - - thumb_func_start sub_81D06C4 -sub_81D06C4: @ 81D06C4 - push {lr} - movs r0, 0xD - bl sub_81C763C - ldr r0, [r0, 0x8] - ldrh r0, [r0, 0x2] - pop {r1} - bx r1 - thumb_func_end sub_81D06C4 - - thumb_func_start sub_81D06D4 -sub_81D06D4: @ 81D06D4 - push {lr} - movs r0, 0xD - bl sub_81C763C - ldr r0, [r0, 0x8] - ldrh r0, [r0] - pop {r1} - bx r1 - thumb_func_end sub_81D06D4 - - thumb_func_start sub_81D06E4 -sub_81D06E4: @ 81D06E4 - push {r4-r7,lr} - adds r5, r0, 0 - adds r7, r1, 0 - adds r6, r2, 0 - movs r0, 0xD - bl sub_81C763C - ldr r1, [r0, 0x8] - ldrh r0, [r1, 0x2] - lsls r0, 2 - adds r0, 0x4 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0xE - bne _081D0730 - ldrb r1, [r1, 0x1] - movs r0, 0x64 - adds r4, r1, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x2 - adds r2, r5, 0 - bl pokemon_getattr - adds r0, r4, 0 - bl level_by_exp - strb r0, [r7] - adds r0, r4, 0 - bl pokemon_get_gender - strb r0, [r6] - b _081D0752 - .pool -_081D0730: - ldrb r0, [r1] - ldrb r1, [r1, 0x1] - bl get_pokemon_by_box_and_pos - adds r4, r0, 0 - bl pokemon_roll_gender - strb r0, [r6] - adds r0, r4, 0 - bl sub_80690C0 - strb r0, [r7] - adds r0, r4, 0 - movs r1, 0x2 - adds r2, r5, 0 - bl pokemon_getattr_encrypted -_081D0752: - adds r0, r5, 0 - bl GetStringEnd_Limit7 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81D06E4 - - thumb_func_start sub_81D0760 -sub_81D0760: @ 81D0760 - push {r4-r7,lr} - adds r5, r0, 0 - adds r6, r1, 0 - adds r7, r2, 0 - movs r0, 0xD - bl sub_81C763C - ldr r1, [r0, 0x8] - ldrh r0, [r1, 0x2] - lsls r0, 2 - adds r0, 0x4 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0xE - bne _081D07AC - ldrb r1, [r1, 0x1] - movs r0, 0x64 - adds r4, r1, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - strh r0, [r5] - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - str r0, [r6] - adds r0, r4, 0 - movs r1, 0x1 - bl pokemon_getattr - b _081D07D0 - .pool -_081D07AC: - ldrb r0, [r1] - ldrb r1, [r1, 0x1] - bl get_pokemon_by_box_and_pos - adds r4, r0, 0 - movs r1, 0xB - bl pokemon_getattr_encrypted - strh r0, [r5] - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr_encrypted - str r0, [r6] - adds r0, r4, 0 - movs r1, 0x1 - bl pokemon_getattr_encrypted -_081D07D0: - str r0, [r7] - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81D0760 - - thumb_func_start sub_81D07D8 -sub_81D07D8: @ 81D07D8 - push {lr} - movs r0, 0xD - bl sub_81C763C - ldr r1, [r0, 0x8] - ldrh r0, [r1, 0x2] - lsls r0, 2 - adds r0, 0x4 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0xE - beq _081D07FA - ldrb r1, [r1, 0x1] - movs r2, 0x52 - bl get_pokemon_data_from_any_box - b _081D080A -_081D07FA: - ldrb r1, [r1, 0x1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x52 - bl pokemon_getattr -_081D080A: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D07D8 - - thumb_func_start sub_81D0814 -sub_81D0814: @ 81D0814 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrh r1, [r0, 0x2] - lsls r1, 2 - adds r1, 0x4 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0xE - bne _081D0848 - ldrb r1, [r1, 0x1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x53 - bl pokemon_getattr - b _081D0852 - .pool -_081D0848: - ldrb r0, [r1] - ldrb r1, [r1, 0x1] - movs r2, 0x53 - bl get_pokemon_data_from_any_box -_081D0852: - mov r12, r0 - movs r0, 0 - strh r0, [r5, 0x10] - strh r0, [r5, 0x12] - movs r6, 0 - ldr r0, =gUnknown_086237F8 - mov r9, r0 - mov r10, r9 -_081D0862: - lsls r2, r6, 2 - mov r3, r9 - adds r1, r2, r3 - movs r0, 0x1 - ldrb r3, [r1] - lsls r0, r3 - subs r4, r0, 0x1 - mov r0, r12 - ands r4, r0 - ldrb r0, [r1, 0x3] - adds r7, r2, 0 - cmp r0, 0 - bne _081D08AC - movs r3, 0 - adds r6, 0x1 - mov r8, r6 - cmp r3, r4 - bge _081D08D6 - adds r6, r5, 0 - adds r6, 0x14 - mov r1, r10 - adds r0, r7, r1 - ldrb r2, [r0, 0x2] -_081D0890: - ldrh r0, [r5, 0x10] - adds r1, r0, 0x1 - strh r1, [r5, 0x10] - lsls r0, 16 - lsrs r0, 14 - adds r0, r6, r0 - adds r1, r2, r3 - str r1, [r0] - adds r3, 0x1 - cmp r3, r4 - blt _081D0890 - b _081D08D6 - .pool -_081D08AC: - movs r3, 0 - adds r6, 0x1 - mov r8, r6 - cmp r3, r4 - bge _081D08D6 - adds r6, r5, 0 - adds r6, 0x78 - mov r1, r10 - adds r0, r7, r1 - ldrb r2, [r0, 0x2] -_081D08C0: - ldrh r0, [r5, 0x12] - adds r1, r0, 0x1 - strh r1, [r5, 0x12] - lsls r0, 16 - lsrs r0, 14 - adds r0, r6, r0 - adds r1, r2, r3 - str r1, [r0] - adds r3, 0x1 - cmp r3, r4 - blt _081D08C0 -_081D08D6: - mov r3, r9 - adds r0, r7, r3 - mov r1, r12 - ldrb r0, [r0] - lsrs r1, r0 - mov r12, r1 - mov r6, r8 - cmp r6, 0x10 - bls _081D0862 - ldrh r0, [r5, 0x10] - cmp r0, 0 - beq _081D0900 - subs r0, 0x1 - movs r1, 0x9 - bl __divsi3 - lsls r1, r0, 3 - adds r1, r0 - movs r0, 0 - strh r1, [r5, 0xE] - b _081D0904 -_081D0900: - strh r0, [r5, 0xE] - movs r0, 0x1B -_081D0904: - strh r0, [r5, 0xC] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81D0814 - - thumb_func_start sub_81D0914 -sub_81D0914: @ 81D0914 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0xD - bl sub_81C763C - ldrh r1, [r0, 0x10] - str r1, [r4] - adds r0, 0x14 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81D0914 - - thumb_func_start sub_81D092C -sub_81D092C: @ 81D092C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0xD - bl sub_81C763C - ldrh r1, [r0, 0x12] - str r1, [r4] - adds r0, 0x78 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81D092C - - thumb_func_start sub_81D0944 -sub_81D0944: @ 81D0944 - push {lr} - movs r0, 0xD - bl sub_81C763C - ldrh r0, [r0, 0xC] - pop {r1} - bx r1 - thumb_func_end sub_81D0944 - - thumb_func_start sub_81D0954 -sub_81D0954: @ 81D0954 - push {lr} - movs r0, 0xD - bl sub_81C763C - adds r1, r0, 0 - ldrh r0, [r1, 0xC] - cmp r0, 0x18 - ble _081D096C - subs r0, 0x1B - lsls r0, 2 - adds r1, 0x78 - b _081D0970 -_081D096C: - lsls r0, 2 - adds r1, 0x14 -_081D0970: - adds r1, r0 - ldr r0, [r1] - pop {r1} - bx r1 - thumb_func_end sub_81D0954 - - thumb_func_start sub_81D0978 -sub_81D0978: @ 81D0978 - push {r4,lr} - ldr r1, =0x0000101c - movs r0, 0xE - bl sub_81C761C - adds r4, r0, 0 - cmp r4, 0 - beq _081D09A8 - ldr r0, =sub_81D0A6C - movs r1, 0x1 - bl sub_81C7078 - str r0, [r4, 0x4] - ldr r0, =sub_81D0A58 - str r0, [r4] - movs r0, 0x1 - b _081D09AA - .pool -_081D09A8: - movs r0, 0 -_081D09AA: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81D0978 - - thumb_func_start sub_81D09B0 -sub_81D09B0: @ 81D09B0 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0xE - bl sub_81C763C - adds r5, r0, 0 - ldr r0, =gUnknown_08624BA0 - lsls r4, 2 - adds r4, r0 - ldr r0, [r4] - movs r1, 0x1 - bl sub_81C7078 - str r0, [r5, 0x4] - ldr r0, =sub_81D0A58 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D09B0 - - thumb_func_start sub_81D09E0 -sub_81D09E0: @ 81D09E0 - push {lr} - movs r0, 0xE - bl sub_81C763C - ldr r0, [r0] - bl _call_via_r0 - pop {r1} - bx r1 - thumb_func_end sub_81D09E0 - - thumb_func_start sub_81D09F4 -sub_81D09F4: @ 81D09F4 - push {r4,lr} - movs r0, 0xE - bl sub_81C763C - adds r4, r0, 0 - ldrb r0, [r4, 0xA] - bl RemoveWindow - ldrb r0, [r4, 0x8] - bl RemoveWindow - ldrb r0, [r4, 0xC] - bl RemoveWindow - ldrb r0, [r4, 0xE] - bl RemoveWindow - adds r0, r4, 0 - bl sub_81D1178 - movs r0, 0x9 - bl FreeObjectTilesByTag - movs r0, 0xF - bl FreeObjectPaletteByTag - movs r0, 0x10 - bl FreeObjectPaletteByTag - movs r0, 0x11 - bl FreeObjectPaletteByTag - movs r0, 0x12 - bl FreeObjectPaletteByTag - movs r0, 0x13 - bl FreeObjectPaletteByTag - ldr r0, [r4, 0x14] - bl obj_free_rotscale_entry - ldr r0, [r4, 0x14] - bl RemoveObjectAndFreeTiles - movs r0, 0xE - bl sub_81C7650 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81D09F4 - - thumb_func_start sub_81D0A58 -sub_81D0A58: @ 81D0A58 - push {lr} - movs r0, 0xE - bl sub_81C763C - ldr r0, [r0, 0x4] - bl sub_81C70D8 - pop {r1} - bx r1 - thumb_func_end sub_81D0A58 - - thumb_func_start sub_81D0A6C -sub_81D0A6C: @ 81D0A6C - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - movs r0, 0xE - bl sub_81C763C - adds r5, r0, 0 - cmp r4, 0x9 - bls _081D0A80 - b _081D0C48 -_081D0A80: - lsls r0, r4, 2 - ldr r1, =_081D0A90 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081D0A90: - .4byte _081D0AB8 - .4byte _081D0B04 - .4byte _081D0B74 - .4byte _081D0B88 - .4byte _081D0B9C - .4byte _081D0BB0 - .4byte _081D0BC4 - .4byte _081D0BD8 - .4byte _081D0BE8 - .4byte _081D0C3C -_081D0AB8: - ldr r0, =gUnknown_08624B98 - movs r1, 0x2 - bl sub_81C7B54 - ldr r1, =gUnknown_08DDE030 - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - adds r1, r5, 0 - adds r1, 0x1C - movs r0, 0x2 - bl SetBgTilemapBuffer - ldr r1, =gUnknown_08DDE12C - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - ldr r0, =gUnknown_08DDE010 - movs r1, 0x10 - movs r2, 0x20 - bl sub_81C7944 - b _081D0BBA - .pool -_081D0B04: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _081D0B12 - b _081D0C44 -_081D0B12: - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_8199DF0 - ldr r1, =gUnknown_086240B8 - str r4, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0x1 - bl decompress_and_copy_tile_data_to_vram - ldr r0, =0x0000081c - adds r1, r5, r0 - movs r0, 0x1 - bl SetBgTilemapBuffer - movs r0, 0x20 - str r0, [sp] - movs r0, 0x14 - str r0, [sp, 0x4] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - ldr r0, =gUnknown_08623FF8 - movs r1, 0x20 - movs r2, 0xA0 - bl sub_81C7944 - ldr r0, =gUnknown_08624098 - movs r1, 0xA0 - movs r2, 0x20 - bl sub_81C7944 - movs r0, 0x1 - b _081D0BBC - .pool -_081D0B74: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - bne _081D0C44 - adds r0, r5, 0 - bl sub_81D0E60 - movs r0, 0 - b _081D0C4A -_081D0B88: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - bne _081D0C44 - adds r0, r5, 0 - bl sub_81D0FCC - movs r0, 0 - b _081D0C4A -_081D0B9C: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - bne _081D0C44 - adds r0, r5, 0 - bl sub_81D10A4 - movs r0, 0 - b _081D0C4A -_081D0BB0: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _081D0C44 -_081D0BBA: - movs r0, 0x2 -_081D0BBC: - bl CopyBgTilemapBufferToVram - movs r0, 0 - b _081D0C4A -_081D0BC4: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _081D0C44 - adds r0, r5, 0 - bl sub_81D1148 - movs r0, 0x1 - b _081D0C4A -_081D0BD8: - adds r0, r5, 0 - bl sub_81D12D8 - movs r0, 0xA - bl sub_81C7BA4 - movs r0, 0 - b _081D0C4A -_081D0BE8: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _081D0C44 - adds r0, r5, 0 - bl sub_81D13FC - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl HideBg - movs r0, 0x1 - bl sub_81C7AC0 - movs r0, 0 - b _081D0C4A -_081D0C3C: - bl sub_81C7B34 - cmp r0, 0 - beq _081D0C48 -_081D0C44: - movs r0, 0x2 - b _081D0C4A -_081D0C48: - movs r0, 0x4 -_081D0C4A: - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81D0A6C - - thumb_func_start sub_81D0C54 -sub_81D0C54: @ 81D0C54 - push {lr} - cmp r0, 0 - beq _081D0C60 - cmp r0, 0x1 - beq _081D0C70 - b _081D0C7C -_081D0C60: - movs r0, 0x5 - bl audio_play - movs r0, 0 - bl sub_81C7AC0 - movs r0, 0 - b _081D0C7E -_081D0C70: - bl sub_81C7B34 - cmp r0, 0 - beq _081D0C7C - movs r0, 0x2 - b _081D0C7E -_081D0C7C: - movs r0, 0x4 -_081D0C7E: - pop {r1} - bx r1 - thumb_func_end sub_81D0C54 - - thumb_func_start sub_81D0C84 -sub_81D0C84: @ 81D0C84 - push {r4,r5,lr} - adds r5, r0, 0 - movs r0, 0xE - bl sub_81C763C - adds r4, r0, 0 - cmp r5, 0x6 - bhi _081D0D24 - lsls r0, r5, 2 - ldr r1, =_081D0CA4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081D0CA4: - .4byte _081D0CC0 - .4byte _081D0CD0 - .4byte _081D0CE4 - .4byte _081D0CEE - .4byte _081D0CF8 - .4byte _081D0D02 - .4byte _081D0D16 -_081D0CC0: - movs r0, 0x5 - bl audio_play - adds r0, r4, 0 - bl sub_81D11D8 - movs r0, 0 - b _081D0D26 -_081D0CD0: - adds r0, r4, 0 - bl sub_81D1234 - cmp r0, 0 - bne _081D0D20 - adds r0, r4, 0 - bl sub_81D0FF0 - movs r0, 0x1 - b _081D0D26 -_081D0CE4: - adds r0, r4, 0 - bl sub_81D12D8 - movs r0, 0x1 - b _081D0D26 -_081D0CEE: - adds r0, r4, 0 - bl sub_81D10D0 - movs r0, 0x1 - b _081D0D26 -_081D0CF8: - adds r0, r4, 0 - bl sub_81D0E84 - movs r0, 0x1 - b _081D0D26 -_081D0D02: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _081D0D20 - adds r0, r4, 0 - bl sub_81D11FC - movs r0, 0 - b _081D0D26 -_081D0D16: - adds r0, r4, 0 - bl sub_81D1234 - cmp r0, 0 - beq _081D0D24 -_081D0D20: - movs r0, 0x2 - b _081D0D26 -_081D0D24: - movs r0, 0x4 -_081D0D26: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81D0C84 - - thumb_func_start sub_81D0D2C -sub_81D0D2C: @ 81D0D2C - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0xE - bl sub_81C763C - adds r5, r0, 0 - cmp r4, 0x1 - beq _081D0D5C - cmp r4, 0x1 - bgt _081D0D46 - cmp r4, 0 - beq _081D0D4C - b _081D0D84 -_081D0D46: - cmp r4, 0x2 - beq _081D0D76 - b _081D0D84 -_081D0D4C: - movs r0, 0x5 - bl audio_play - adds r0, r5, 0 - bl sub_81D1448 - movs r0, 0 - b _081D0D86 -_081D0D5C: - adds r0, r5, 0 - bl sub_81D1524 - cmp r0, 0 - bne _081D0D80 - adds r0, r5, 0 - bl sub_81D0EFC - movs r0, 0xB - bl sub_81C7BA4 - movs r0, 0 - b _081D0D86 -_081D0D76: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _081D0D84 -_081D0D80: - movs r0, 0x2 - b _081D0D86 -_081D0D84: - movs r0, 0x4 -_081D0D86: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81D0D2C - - thumb_func_start sub_81D0D8C -sub_81D0D8C: @ 81D0D8C - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0xE - bl sub_81C763C - adds r5, r0, 0 - cmp r4, 0x1 - beq _081D0DC0 - cmp r4, 0x1 - bgt _081D0DA6 - cmp r4, 0 - beq _081D0DB0 - b _081D0DF6 -_081D0DA6: - cmp r4, 0x2 - beq _081D0DD4 - cmp r4, 0x3 - beq _081D0DE8 - b _081D0DF6 -_081D0DB0: - movs r0, 0x5 - bl audio_play - adds r0, r5, 0 - bl sub_81D1500 - movs r0, 0 - b _081D0DF8 -_081D0DC0: - adds r0, r5, 0 - bl sub_81D1524 - cmp r0, 0 - bne _081D0DF2 - adds r0, r5, 0 - bl sub_81D1448 - movs r0, 0 - b _081D0DF8 -_081D0DD4: - adds r0, r5, 0 - bl sub_81D1524 - cmp r0, 0 - bne _081D0DF2 - adds r0, r5, 0 - bl sub_81D0EFC - movs r0, 0 - b _081D0DF8 -_081D0DE8: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _081D0DF6 -_081D0DF2: - movs r0, 0x2 - b _081D0DF8 -_081D0DF6: - movs r0, 0x4 -_081D0DF8: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81D0D8C - - thumb_func_start sub_81D0E00 -sub_81D0E00: @ 81D0E00 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0xE - bl sub_81C763C - adds r5, r0, 0 - cmp r4, 0x1 - beq _081D0E30 - cmp r4, 0x1 - bgt _081D0E1A - cmp r4, 0 - beq _081D0E20 - b _081D0E58 -_081D0E1A: - cmp r4, 0x2 - beq _081D0E4A - b _081D0E58 -_081D0E20: - movs r0, 0x5 - bl audio_play - adds r0, r5, 0 - bl sub_81D1500 - movs r0, 0 - b _081D0E5A -_081D0E30: - adds r0, r5, 0 - bl sub_81D1524 - cmp r0, 0 - bne _081D0E54 - adds r0, r5, 0 - bl sub_81D0E84 - movs r0, 0xA - bl sub_81C7BA4 - movs r0, 0 - b _081D0E5A -_081D0E4A: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _081D0E58 -_081D0E54: - movs r0, 0x2 - b _081D0E5A -_081D0E58: - movs r0, 0x4 -_081D0E5A: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81D0E00 - - thumb_func_start sub_81D0E60 -sub_81D0E60: @ 81D0E60 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gUnknown_08624BB8 - bl AddWindow - strh r0, [r4, 0xA] - lsls r0, 24 - lsrs r0, 24 - bl PutWindowTilemap - adds r0, r4, 0 - bl sub_81D0E84 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D0E60 - - thumb_func_start sub_81D0E84 -sub_81D0E84: @ 81D0E84 - push {r4,r5,lr} - sub sp, 0x10 - adds r5, r0, 0 - ldr r1, =gUnknown_08624BC0 - add r0, sp, 0xC - movs r2, 0x3 - bl memcpy - ldr r4, =0x02021cc4 - bl sub_81D07D8 - adds r1, r0, 0 - adds r0, r4, 0 - movs r2, 0 - movs r3, 0x2 - bl ConvertIntToDecimalString - bl sub_81AFBF0 - movs r0, 0 - adds r1, r4, 0 - bl sub_81AFC0C - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EC030 - adds r0, r4, 0 - bl sub_81AFC28 - ldrb r0, [r5, 0xA] - movs r1, 0x44 - bl FillWindowPixelBuffer - ldrb r0, [r5, 0xA] - add r1, sp, 0xC - str r1, [sp] - movs r1, 0x1 - negs r1, r1 - str r1, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r2, 0 - movs r3, 0x1 - bl box_print - ldrb r0, [r5, 0xA] - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D0E84 - - thumb_func_start sub_81D0EFC -sub_81D0EFC: @ 81D0EFC - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - adds r7, r0, 0 - bl sub_81D0954 - adds r5, r0, 0 - ldr r1, =gUnknown_08624BC0 - add r0, sp, 0xC - movs r2, 0x3 - bl memcpy - ldrb r0, [r7, 0xA] - movs r1, 0x44 - bl FillWindowPixelBuffer - cmp r5, 0x18 - bhi _081D0F60 - lsls r1, r5, 3 - ldr r0, =gRibbonDescriptionPointers - adds r6, r1, r0 - movs r5, 0x80 - lsls r5, 17 - movs r4, 0x1 -_081D0F2E: - ldrb r0, [r7, 0xA] - lsrs r3, r5, 24 - add r1, sp, 0xC - str r1, [sp] - movs r1, 0x1 - negs r1, r1 - str r1, [sp, 0x4] - ldm r6!, {r1} - str r1, [sp, 0x8] - movs r1, 0x1 - movs r2, 0 - bl box_print - movs r0, 0x80 - lsls r0, 21 - adds r5, r0 - subs r4, 0x1 - cmp r4, 0 - bge _081D0F2E - b _081D0FAA - .pool -_081D0F60: - ldr r0, =0x03005d8c - ldr r0, [r0] - adds r0, r5 - ldr r1, =0x0000318f - adds r0, r1 - ldrb r5, [r0] - cmp r5, 0 - beq _081D0FB2 - subs r5, 0x1 - movs r4, 0 - ldr r0, =gGiftRibbonDescriptionPointers - mov r8, r0 - movs r6, 0x80 - lsls r6, 17 -_081D0F7C: - ldrb r0, [r7, 0xA] - lsrs r3, r6, 24 - add r1, sp, 0xC - str r1, [sp] - movs r1, 0x1 - negs r1, r1 - str r1, [sp, 0x4] - lsls r1, r4, 2 - lsls r2, r5, 3 - adds r1, r2 - add r1, r8 - ldr r1, [r1] - str r1, [sp, 0x8] - movs r1, 0x1 - movs r2, 0 - bl box_print - movs r0, 0x80 - lsls r0, 21 - adds r6, r0 - adds r4, 0x1 - cmp r4, 0x1 - ble _081D0F7C -_081D0FAA: - ldrb r0, [r7, 0xA] - movs r1, 0x2 - bl CopyWindowToVram -_081D0FB2: - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D0EFC - - thumb_func_start sub_81D0FCC -sub_81D0FCC: @ 81D0FCC - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gUnknown_08624BC4 - bl AddWindow - strh r0, [r4, 0x8] - lsls r0, 24 - lsrs r0, 24 - bl PutWindowTilemap - adds r0, r4, 0 - bl sub_81D0FF0 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D0FCC - - thumb_func_start sub_81D0FF0 -sub_81D0FF0: @ 81D0FF0 - push {r4-r7,lr} - sub sp, 0x10 - ldrh r7, [r0, 0x8] - ldrb r5, [r0, 0x8] - adds r0, r5, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r4, =0x02021ec4 - mov r6, sp - adds r6, 0xD - adds r0, r4, 0 - add r1, sp, 0xC - adds r2, r6, 0 - bl sub_81D06E4 - movs r0, 0x1 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r5, 0 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0 - bl Print - ldrb r0, [r6] - cmp r0, 0 - beq _081D1040 - cmp r0, 0xFE - beq _081D1048 - ldr r1, =gUnknown_08624BE4 - b _081D104A - .pool -_081D1040: - ldr r1, =gUnknown_08624BCC - b _081D104A - .pool -_081D1048: - ldr r1, =gUnknown_08624BD8 -_081D104A: - ldr r5, =0x02021cc4 - adds r0, r5, 0 - bl CopyString - movs r1, 0xBA - strb r1, [r0] - adds r0, 0x1 - movs r1, 0xF9 - strb r1, [r0] - adds r0, 0x1 - movs r1, 0x5 - strb r1, [r0] - adds r0, 0x1 - add r1, sp, 0xC - ldrb r1, [r1] - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - lsls r4, r7, 24 - lsrs r4, 24 - movs r0, 0x1 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r4, 0 - movs r1, 0x1 - adds r2, r5, 0 - movs r3, 0x3C - bl Print - adds r0, r4, 0 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x10 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D0FF0 - - thumb_func_start sub_81D10A4 -sub_81D10A4: @ 81D10A4 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gUnknown_08624BE8 - bl AddWindow - strh r0, [r4, 0xC] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldrb r0, [r4, 0xC] - bl PutWindowTilemap - adds r0, r4, 0 - bl sub_81D10D0 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D10A4 - - thumb_func_start sub_81D10D0 -sub_81D10D0: @ 81D10D0 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0xC - mov r8, r0 - bl sub_81D06C4 - adds r4, r0, 0 - adds r4, 0x1 - bl sub_81D06D4 - adds r6, r0, 0 - ldr r5, =0x02021cc4 - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - movs r1, 0xBA - strb r1, [r0] - adds r0, 0x1 - adds r1, r6, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x38 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - mov r1, r8 - ldrb r0, [r1, 0xC] - lsls r3, 24 - lsrs r3, 24 - movs r1, 0x1 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - bl Print - mov r1, r8 - ldrb r0, [r1, 0xC] - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D10D0 - - thumb_func_start sub_81D1148 -sub_81D1148: @ 81D1148 - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - add r1, sp, 0x4 - add r2, sp, 0x8 - mov r0, sp - bl sub_81D0760 - bl dp13_810BB8C - movs r0, 0x28 - movs r1, 0x68 - bl sub_81D1184 - strh r0, [r4, 0x10] - movs r0, 0xF - movs r1, 0 - bl sub_81C7990 - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81D1148 - - thumb_func_start sub_81D1178 -sub_81D1178: @ 81D1178 - push {lr} - ldrh r0, [r0, 0x10] - bl sub_818D820 - pop {r0} - bx r0 - thumb_func_end sub_81D1178 - - thumb_func_start sub_81D1184 -sub_81D1184: @ 81D1184 - push {lr} - sub sp, 0x1C - add r1, sp, 0x14 - add r2, sp, 0x18 - add r0, sp, 0x10 - bl sub_81D0760 - add r0, sp, 0x10 - ldrh r0, [r0] - ldr r1, [sp, 0x18] - ldr r2, [sp, 0x14] - movs r3, 0x28 - str r3, [sp] - movs r3, 0x68 - str r3, [sp, 0x4] - movs r3, 0xF - str r3, [sp, 0x8] - ldr r3, =0x0000ffff - str r3, [sp, 0xC] - movs r3, 0x1 - bl sub_818D7D8 - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x02020630 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r1 - ldrb r3, [r2, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r3 - strb r1, [r2, 0x5] - add sp, 0x1C - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D1184 - - thumb_func_start sub_81D11D8 -sub_81D11D8: @ 81D11D8 - push {lr} - ldrh r1, [r0, 0x10] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r2, 0x20 - negs r2, r2 - movs r1, 0x28 - movs r3, 0x6 - bl sub_81D1258 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D11D8 - - thumb_func_start sub_81D11FC -sub_81D11FC: @ 81D11FC - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x10] - bl sub_818D820 - movs r5, 0x20 - negs r5, r5 - adds r0, r5, 0 - movs r1, 0x68 - bl sub_81D1184 - strh r0, [r4, 0x10] - ldrh r1, [r4, 0x10] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - adds r1, r5, 0 - movs r2, 0x28 - movs r3, 0x6 - bl sub_81D1258 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D11FC - - thumb_func_start sub_81D1234 -sub_81D1234: @ 81D1234 - ldr r2, =0x02020630 - ldrh r1, [r0, 0x10] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - eors r1, r0 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - bx lr - .pool - thumb_func_end sub_81D1234 - - thumb_func_start sub_81D1258 -sub_81D1258: @ 81D1258 - push {r4-r6,lr} - adds r4, r0, 0 - adds r6, r2, 0 - adds r5, r3, 0 - subs r0, r6, r1 - strh r1, [r4, 0x20] - lsls r1, 4 - strh r1, [r4, 0x2E] - lsls r0, 4 - adds r1, r5, 0 - bl __udivsi3 - strh r0, [r4, 0x30] - strh r5, [r4, 0x32] - strh r6, [r4, 0x34] - ldr r0, =sub_81D1284 - str r0, [r4, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D1258 - - thumb_func_start sub_81D1284 -sub_81D1284: @ 81D1284 - push {lr} - adds r2, r0, 0 - ldrh r1, [r2, 0x32] - movs r3, 0x32 - ldrsh r0, [r2, r3] - cmp r0, 0 - beq _081D12C8 - subs r0, r1, 0x1 - strh r0, [r2, 0x32] - ldrh r0, [r2, 0x30] - ldrh r1, [r2, 0x2E] - adds r0, r1 - strh r0, [r2, 0x2E] - lsls r0, 16 - asrs r0, 20 - strh r0, [r2, 0x20] - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - bgt _081D12BA - adds r0, r2, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - b _081D12D0 -_081D12BA: - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - b _081D12D0 -_081D12C8: - ldrh r0, [r2, 0x34] - strh r0, [r2, 0x20] - ldr r0, =DummyObjectCallback - str r0, [r2, 0x1C] -_081D12D0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D1284 - - thumb_func_start sub_81D12D8 -sub_81D12D8: @ 81D12D8 - push {r4-r6,lr} - bl sub_81D1350 - ldr r5, =0x030012c0 - adds r0, r5, 0 - bl sub_81D0914 - adds r6, r0, 0 - ldr r2, =0x030012c4 - movs r1, 0 - str r1, [r2] - ldr r0, [r5] - cmp r1, r0 - bcs _081D130A - adds r4, r2, 0 -_081D12F6: - ldr r0, [r4] - ldm r6!, {r1} - bl sub_81D1370 - ldr r1, [r4] - adds r1, 0x1 - str r1, [r4] - ldr r0, [r5] - cmp r1, r0 - bcc _081D12F6 -_081D130A: - ldr r4, =0x030012c0 - adds r0, r4, 0 - bl sub_81D092C - adds r6, r0, 0 - ldr r2, =0x030012c4 - movs r1, 0 - str r1, [r2] - ldr r0, [r4] - cmp r1, r0 - bcs _081D133A - adds r4, r2, 0 -_081D1322: - ldr r0, [r4] - adds r0, 0x1B - ldm r6!, {r1} - bl sub_81D1370 - ldr r1, [r4] - adds r1, 0x1 - str r1, [r4] - ldr r0, =0x030012c0 - ldr r0, [r0] - cmp r1, r0 - bcc _081D1322 -_081D133A: - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D12D8 - - thumb_func_start sub_81D1350 -sub_81D1350: @ 81D1350 - push {lr} - sub sp, 0x8 - movs r0, 0x20 - str r0, [sp] - movs r0, 0x14 - str r0, [sp, 0x4] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - add sp, 0x8 - pop {r0} - bx r0 - thumb_func_end sub_81D1350 - - thumb_func_start sub_81D1370 -sub_81D1370: @ 81D1370 - push {r4-r6,lr} - sub sp, 0x10 - adds r4, r0, 0 - adds r6, r1, 0 - movs r1, 0x9 - bl __umodsi3 - adds r5, r0, 0 - lsls r5, 1 - adds r5, 0xB - adds r0, r4, 0 - movs r1, 0x9 - bl __udivsi3 - adds r4, r0, 0 - lsls r4, 1 - adds r4, 0x4 - add r0, sp, 0x8 - adds r1, r6, 0 - bl sub_81D13BC - lsls r5, 24 - lsrs r5, 24 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x2 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x1 - add r1, sp, 0x8 - adds r2, r5, 0 - adds r3, r4, 0 - bl CopyToBgTilemapBufferRect - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81D1370 - - thumb_func_start sub_81D13BC -sub_81D13BC: @ 81D13BC - push {r4,r5,lr} - ldr r2, =gUnknown_08624BF8 - lsls r1, 2 - adds r1, r2 - ldrh r3, [r1, 0x2] - adds r3, 0x2 - lsls r3, 16 - ldrh r1, [r1] - lsls r1, 1 - adds r1, 0x1 - lsls r1, 16 - lsrs r1, 16 - lsrs r3, 4 - adds r2, r1, 0 - orrs r2, r3 - strh r2, [r0] - movs r5, 0x80 - lsls r5, 3 - adds r4, r5, 0 - orrs r2, r4 - strh r2, [r0, 0x2] - adds r1, 0x1 - orrs r1, r3 - strh r1, [r0, 0x4] - orrs r1, r4 - strh r1, [r0, 0x6] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D13BC - - thumb_func_start sub_81D13FC -sub_81D13FC: @ 81D13FC - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gUnknown_08624C78 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_08624C80 - bl sub_81C795C - ldr r0, =gUnknown_08624D04 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - str r1, [r4, 0x14] - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D13FC - - thumb_func_start sub_81D1448 -sub_81D1448: @ 81D1448 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r6, r0, 0 - bl sub_81D0944 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r4, 0 - movs r1, 0x9 - bl __modsi3 - adds r5, r0, 0 - lsls r5, 4 - adds r5, 0x60 - adds r0, r4, 0 - movs r1, 0x9 - bl __divsi3 - lsls r0, 4 - adds r0, 0x28 - ldr r1, [r6, 0x14] - movs r2, 0 - mov r8, r2 - strh r5, [r1, 0x20] - ldr r1, [r6, 0x14] - strh r0, [r1, 0x22] - bl sub_81D0954 - adds r4, r0, 0 - movs r0, 0x9 - bl GetObjectTileRangeStartByTag - ldr r3, [r6, 0x14] - ldr r1, =gUnknown_08624BF8 - lsls r4, 2 - adds r4, r1 - ldrh r1, [r4] - lsls r1, 4 - adds r0, r1 - ldr r2, =0x000003ff - adds r1, r2, 0 - ands r0, r1 - ldrh r2, [r3, 0x4] - ldr r1, =0xfffffc00 - ands r1, r2 - orrs r1, r0 - strh r1, [r3, 0x4] - ldrh r0, [r4, 0x2] - adds r0, 0xF - lsls r0, 16 - lsrs r0, 16 - bl IndexOfObjectPaletteTag - ldr r3, [r6, 0x14] - lsls r0, 4 - ldrb r2, [r3, 0x5] - movs r1, 0xF - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x5] - ldr r0, [r6, 0x14] - movs r1, 0x1 - bl StartObjectRotScalAnim - ldr r1, [r6, 0x14] - adds r1, 0x3E - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r0, [r6, 0x14] - mov r1, r8 - strh r1, [r0, 0x2E] - ldr r1, [r6, 0x14] - ldr r0, =sub_81D1538 - str r0, [r1, 0x1C] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D1448 - - thumb_func_start sub_81D1500 -sub_81D1500: @ 81D1500 - push {r4,lr} - adds r4, r0, 0 - ldr r1, [r4, 0x14] - movs r0, 0x1 - strh r0, [r1, 0x2E] - ldr r0, [r4, 0x14] - movs r1, 0x2 - bl StartObjectRotScalAnim - ldr r1, [r4, 0x14] - ldr r0, =sub_81D1538 - str r0, [r1, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D1500 - - thumb_func_start sub_81D1524 -sub_81D1524: @ 81D1524 - ldr r0, [r0, 0x14] - ldr r1, [r0, 0x1C] - ldr r0, =DummyObjectCallback - eors r1, r0 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - bx lr - .pool - thumb_func_end sub_81D1524 - - thumb_func_start sub_81D1538 -sub_81D1538: @ 81D1538 - push {lr} - adds r3, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _081D156A - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - movs r0, 0x1 - ldrh r1, [r3, 0x2E] - ands r1, r0 - lsls r1, 2 - mov r0, r12 - ldrb r2, [r0] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - ldr r0, =DummyObjectCallback - str r0, [r3, 0x1C] -_081D156A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D1538 - - thumb_func_start sub_81D1574 -sub_81D1574: @ 81D1574 - push {lr} - ldrb r0, [r0] - cmp r0, 0x5 - bhi _081D15A4 - lsls r0, 2 - ldr r1, =_081D158C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081D158C: - .4byte _081D15A4 - .4byte _081D15A8 - .4byte _081D15AC - .4byte _081D15B4 - .4byte _081D15B0 - .4byte _081D15A8 -_081D15A4: - movs r0, 0 - b _081D15B6 -_081D15A8: - movs r0, 0x1 - b _081D15B6 -_081D15AC: - movs r0, 0x2 - b _081D15B6 -_081D15B0: - movs r0, 0x3 - b _081D15B6 -_081D15B4: - movs r0, 0x4 -_081D15B6: - pop {r1} - bx r1 - thumb_func_end sub_81D1574 - - thumb_func_start sub_81D15BC -sub_81D15BC: @ 81D15BC - ldr r1, =gUnknown_085500A4 - lsls r0, 4 - adds r0, r1 - ldrh r0, [r0] - bx lr - .pool - thumb_func_end sub_81D15BC - - thumb_func_start sub_81D15CC -sub_81D15CC: @ 81D15CC - push {lr} - adds r3, r0, 0 - movs r1, 0 - ldr r2, =gUnknown_085500A4 -_081D15D4: - ldrh r0, [r2] - cmp r0, r3 - bne _081D15E4 - adds r0, r1, 0 - b _081D15F0 - .pool -_081D15E4: - adds r2, 0x10 - adds r1, 0x1 - cmp r1, 0x4D - ble _081D15D4 - movs r0, 0x1 - negs r0, r0 -_081D15F0: - pop {r1} - bx r1 - thumb_func_end sub_81D15CC - - thumb_func_start sub_81D15F4 -sub_81D15F4: @ 81D15F4 - push {r4,lr} - cmp r0, 0x14 - bhi _081D1620 - ldr r1, =gUnknown_086252A8 - lsls r0, 2 - adds r0, r1 - ldr r4, [r0] - adds r0, r4, 0 - bl sub_81D1574 - ldr r1, =gUnknown_086252FC - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r4, 0 - bl _call_via_r1 - b _081D1622 - .pool -_081D1620: - movs r0, 0 -_081D1622: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81D15F4 - - thumb_func_start sub_81D1628 -sub_81D1628: @ 81D1628 - push {lr} - adds r2, r0, 0 - ldrh r1, [r2, 0x2] - ldr r0, =0x0000ffff - cmp r1, r0 - beq _081D1644 - adds r0, r1, 0 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - b _081D1646 - .pool -_081D1644: - movs r0, 0x1 -_081D1646: - pop {r1} - bx r1 - thumb_func_end sub_81D1628 - - thumb_func_start sub_81D164C -sub_81D164C: @ 81D164C - push {lr} - adds r2, r0, 0 - ldrh r1, [r2, 0x2] - ldr r0, =0x0000ffff - cmp r1, r0 - beq _081D1668 - adds r0, r1, 0 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - b _081D166A - .pool -_081D1668: - movs r0, 0x1 -_081D166A: - pop {r1} - bx r1 - thumb_func_end sub_81D164C - - thumb_func_start sub_81D1670 -sub_81D1670: @ 81D1670 - push {lr} - adds r2, r0, 0 - ldrh r1, [r2, 0x2] - ldr r0, =0x0000ffff - cmp r1, r0 - beq _081D168C - adds r0, r1, 0 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - b _081D168E - .pool -_081D168C: - movs r0, 0x1 -_081D168E: - pop {r1} - bx r1 - thumb_func_end sub_81D1670 - - thumb_func_start sub_81D1694 -sub_81D1694: @ 81D1694 - push {lr} - adds r2, r0, 0 - ldr r0, =0x03005d90 - ldr r1, [r0] - ldrb r0, [r2, 0x1] - ldrb r1, [r1, 0x8] - cmp r0, r1 - beq _081D16AC - movs r0, 0 - b _081D16C6 - .pool -_081D16AC: - ldrh r1, [r2, 0x2] - ldr r0, =0x0000ffff - cmp r1, r0 - beq _081D16C4 - adds r0, r1, 0 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - b _081D16C6 - .pool -_081D16C4: - movs r0, 0x1 -_081D16C6: - pop {r1} - bx r1 - thumb_func_end sub_81D1694 - - thumb_func_start sub_81D16CC -sub_81D16CC: @ 81D16CC - push {lr} - ldrh r0, [r0, 0x2] - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_81D16CC - - thumb_func_start sub_81D16DC -sub_81D16DC: @ 81D16DC - push {r4,lr} - cmp r0, 0x14 - bhi _081D170C - ldr r1, =gUnknown_086252A8 - lsls r0, 2 - adds r0, r1 - ldr r4, [r0] - adds r0, r4, 0 - bl sub_81D1574 - ldr r1, =gUnknown_08625310 - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r4, 0 - bl _call_via_r1 - lsls r0, 24 - lsrs r0, 24 - b _081D170E - .pool -_081D170C: - movs r0, 0 -_081D170E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81D16DC - - thumb_func_start sub_81D1714 -sub_81D1714: @ 81D1714 - ldrb r0, [r0, 0x1] - bx lr - thumb_func_end sub_81D1714 - - thumb_func_start sub_81D1718 -sub_81D1718: @ 81D1718 - ldrb r0, [r0, 0x1] - bx lr - thumb_func_end sub_81D1718 - - thumb_func_start sub_81D171C -sub_81D171C: @ 81D171C - push {r4-r7,lr} - adds r5, r0, 0 - movs r6, 0 - ldr r7, =0x0000ffff - b _081D172E - .pool -_081D172C: - adds r6, 0x1 -_081D172E: - ldr r0, [r5, 0x10] - lsls r4, r6, 2 - adds r1, r4, r0 - ldrh r0, [r1] - cmp r0, r7 - beq _081D1744 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _081D172C -_081D1744: - ldr r0, [r5, 0x10] - adds r0, r4, r0 - ldrb r0, [r0, 0x2] - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81D171C - - thumb_func_start sub_81D1750 -sub_81D1750: @ 81D1750 - movs r0, 0xD5 - bx lr - thumb_func_end sub_81D1750 - - thumb_func_start sub_81D1754 -sub_81D1754: @ 81D1754 - movs r0, 0xD5 - bx lr - thumb_func_end sub_81D1754 - - thumb_func_start sub_81D1758 -sub_81D1758: @ 81D1758 - push {r4,lr} - cmp r0, 0x14 - bhi _081D1784 - ldr r1, =gUnknown_086252A8 - lsls r0, 2 - adds r0, r1 - ldr r4, [r0] - adds r0, r4, 0 - bl sub_81D1574 - ldr r1, =gUnknown_08625324 - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r4, 0 - bl _call_via_r1 - b _081D1786 - .pool -_081D1784: - movs r0, 0 -_081D1786: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81D1758 - - thumb_func_start sub_81D178C -sub_81D178C: @ 81D178C - movs r0, 0 - bx lr - thumb_func_end sub_81D178C - - thumb_func_start sub_81D1790 -sub_81D1790: @ 81D1790 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x4] - cmp r0, 0x48 - bhi _081D17B8 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x000009ca - adds r0, r2 - ldrh r1, [r1, 0x4] - adds r0, r1 - ldrb r1, [r0] - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - b _081D17BA - .pool -_081D17B8: - movs r0, 0 -_081D17BA: - pop {r1} - bx r1 - thumb_func_end sub_81D1790 - - thumb_func_start sub_81D17C0 -sub_81D17C0: @ 81D17C0 - ldr r1, =0x03005d8c - ldr r1, [r1] - ldr r2, =0x000009ca - adds r1, r2 - ldrh r0, [r0, 0x4] - adds r1, r0 - ldrb r1, [r1] - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - bx lr - .pool - thumb_func_end sub_81D17C0 - - thumb_func_start sub_81D17E0 -sub_81D17E0: @ 81D17E0 - movs r0, 0 - bx lr - thumb_func_end sub_81D17E0 - - thumb_func_start sub_81D17E4 -sub_81D17E4: @ 81D17E4 - movs r0, 0 - bx lr - thumb_func_end sub_81D17E4 - - thumb_func_start sub_81D17E8 -sub_81D17E8: @ 81D17E8 - push {r4,r5,lr} - adds r5, r0, 0 - cmp r5, 0x14 - bhi _081D1832 - ldr r1, =gUnknown_086252A8 - lsls r0, r5, 2 - adds r0, r1 - ldr r4, [r0] - adds r0, r4, 0 - bl sub_81D1574 - adds r2, r0, 0 - ldr r1, =gUnknown_08625338 - lsls r0, r2, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r4, 0 - bl _call_via_r1 - cmp r0, 0 - beq _081D1820 -_081D1812: - movs r0, 0x1 - b _081D1834 - .pool -_081D1820: - movs r2, 0 - ldr r1, =gUnknown_08625388 -_081D1824: - ldrh r0, [r1] - cmp r0, r5 - beq _081D1812 - adds r1, 0x18 - adds r2, 0x1 - cmp r2, 0x3 - bls _081D1824 -_081D1832: - movs r0, 0 -_081D1834: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D17E8 - - thumb_func_start sub_81D1840 -sub_81D1840: @ 81D1840 - movs r0, 0 - bx lr - thumb_func_end sub_81D1840 - - thumb_func_start sub_81D1844 -sub_81D1844: @ 81D1844 - movs r0, 0x1 - bx lr - thumb_func_end sub_81D1844 - - thumb_func_start sub_81D1848 -sub_81D1848: @ 81D1848 - movs r0, 0x1 - bx lr - thumb_func_end sub_81D1848 - - thumb_func_start sub_81D184C -sub_81D184C: @ 81D184C - movs r0, 0 - bx lr - thumb_func_end sub_81D184C - - thumb_func_start sub_81D1850 -sub_81D1850: @ 81D1850 - movs r0, 0 - bx lr - thumb_func_end sub_81D1850 - - thumb_func_start sub_81D1854 -sub_81D1854: @ 81D1854 - push {r4,lr} - cmp r0, 0x14 - bhi _081D1880 - ldr r1, =gUnknown_086252A8 - lsls r0, 2 - adds r0, r1 - ldr r4, [r0] - adds r0, r4, 0 - bl sub_81D1574 - ldr r1, =gUnknown_0862534C - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r4, 0 - bl _call_via_r1 - b _081D1882 - .pool -_081D1880: - movs r0, 0x4E -_081D1882: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81D1854 - - thumb_func_start sub_81D1888 -sub_81D1888: @ 81D1888 - movs r0, 0x4E - bx lr - thumb_func_end sub_81D1888 - - thumb_func_start sub_81D188C -sub_81D188C: @ 81D188C - ldrh r0, [r0, 0x4] - bx lr - thumb_func_end sub_81D188C - - thumb_func_start sub_81D1890 -sub_81D1890: @ 81D1890 - ldrh r0, [r0, 0x4] - bx lr - thumb_func_end sub_81D1890 - - thumb_func_start sub_81D1894 -sub_81D1894: @ 81D1894 - movs r0, 0x4E - bx lr - thumb_func_end sub_81D1894 - - thumb_func_start sub_81D1898 -sub_81D1898: @ 81D1898 - movs r0, 0x4E - bx lr - thumb_func_end sub_81D1898 - - thumb_func_start sub_81D189C -sub_81D189C: @ 81D189C - push {r4,r5,lr} - adds r5, r1, 0 - cmp r0, 0x14 - bhi _081D18C2 - ldr r1, =gUnknown_086252A8 - lsls r0, 2 - adds r0, r1 - ldr r4, [r0] - adds r0, r4, 0 - bl sub_81D1574 - ldr r1, =gUnknown_08625360 - lsls r0, 2 - adds r0, r1 - ldr r2, [r0] - adds r0, r4, 0 - adds r1, r5, 0 - bl _call_via_r2 -_081D18C2: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D189C - - thumb_func_start sub_81D18D0 -sub_81D18D0: @ 81D18D0 - push {lr} - ldr r0, [r0, 0xC] - bl sub_81D1920 - pop {r0} - bx r0 - thumb_func_end sub_81D18D0 - - thumb_func_start sub_81D18DC -sub_81D18DC: @ 81D18DC - push {lr} - adds r3, r0, 0 - adds r2, r1, 0 - ldrb r0, [r3] - cmp r0, 0x5 - beq _081D18F0 - ldr r0, [r3, 0x10] - bl sub_81D1920 - b _081D18F8 -_081D18F0: - ldr r0, [r3, 0x10] - ldrh r1, [r3, 0x4] - bl sub_81D199C -_081D18F8: - pop {r0} - bx r0 - thumb_func_end sub_81D18DC - - thumb_func_start sub_81D18FC -sub_81D18FC: @ 81D18FC - push {lr} - ldr r0, [r0, 0xC] - bl sub_81D1920 - pop {r0} - bx r0 - thumb_func_end sub_81D18FC - - thumb_func_start sub_81D1908 -sub_81D1908: @ 81D1908 - push {lr} - ldr r0, [r0, 0xC] - bl sub_81D1920 - pop {r0} - bx r0 - thumb_func_end sub_81D1908 - - thumb_func_start sub_81D1914 -sub_81D1914: @ 81D1914 - push {lr} - adds r0, r1, 0 - bl sub_8197080 - pop {r0} - bx r0 - thumb_func_end sub_81D1914 - - thumb_func_start sub_81D1920 -sub_81D1920: @ 81D1920 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r6, r0, 0 - mov r9, r1 - movs r5, 0 - ldr r0, [r6] - cmp r0, 0 - beq _081D1940 - adds r1, r6, 0 -_081D1936: - adds r1, 0x8 - adds r5, 0x1 - ldr r0, [r1] - cmp r0, 0 - bne _081D1936 -_081D1940: - cmp r5, 0 - beq _081D1946 - subs r5, 0x1 -_081D1946: - ldr r0, =0x0000ffff - mov r8, r0 - lsls r0, r5, 3 - adds r0, 0x4 - adds r4, r0, r6 - b _081D195C - .pool -_081D1958: - subs r4, 0x8 - subs r5, 0x1 -_081D195C: - lsls r7, r5, 3 - cmp r5, 0 - beq _081D1974 - ldrh r0, [r4] - cmp r0, r8 - beq _081D1958 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081D1958 -_081D1974: - adds r4, r7, r6 - ldrh r1, [r4, 0x6] - ldr r0, =0x0000ffff - cmp r1, r0 - beq _081D1984 - adds r0, r1, 0 - bl FlagSet -_081D1984: - ldr r1, [r4] - mov r0, r9 - bl ExpandStringRefs - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D1920 - - thumb_func_start sub_81D199C -sub_81D199C: @ 81D199C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r6, r0, 0 - mov r10, r2 - lsls r1, 16 - lsrs r7, r1, 16 - movs r5, 0 - ldr r0, [r6] - cmp r0, 0 - beq _081D19E6 - ldrh r0, [r6, 0x4] - ldr r1, =0x0000fffe - cmp r0, r1 - beq _081D1A24 - ldr r0, =0x0000ffff - mov r9, r0 - mov r8, r1 - adds r4, r6, 0 -_081D19C6: - ldrh r0, [r4, 0x4] - cmp r0, r9 - beq _081D19D6 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _081D19E6 -_081D19D6: - adds r4, 0x8 - adds r5, 0x1 - ldr r0, [r4] - cmp r0, 0 - beq _081D19E6 - ldrh r0, [r4, 0x4] - cmp r0, r8 - bne _081D19C6 -_081D19E6: - lsls r0, r5, 3 - adds r0, r6 - ldrh r1, [r0, 0x4] - ldr r0, =0x0000fffe - cmp r1, r0 - beq _081D1A24 - cmp r5, 0 - beq _081D19F8 - subs r5, 0x1 -_081D19F8: - lsls r0, r5, 3 - adds r4, r0, r6 - ldrh r1, [r4, 0x6] - ldr r0, =0x0000ffff - cmp r1, r0 - beq _081D1A0A - adds r0, r1, 0 - bl FlagSet -_081D1A0A: - ldr r1, [r4] - mov r0, r10 - bl ExpandStringRefs - b _081D1A5C - .pool -_081D1A1C: - adds r5, 0x2 - b _081D1A50 -_081D1A20: - adds r5, 0x3 - b _081D1A50 -_081D1A24: - ldr r0, =0x00000864 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _081D1A50 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x000009ca - adds r0, r1 - adds r0, r7 - ldrb r0, [r0] - cmp r0, 0 - bne _081D1A1C - adds r0, r7, 0 - bl sub_80B2318 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _081D1A20 - adds r5, 0x1 -_081D1A50: - lsls r0, r5, 3 - adds r0, r6 - ldr r1, [r0] - mov r0, r10 - bl ExpandStringRefs -_081D1A5C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D199C - - thumb_func_start sub_81D1A78 -sub_81D1A78: @ 81D1A78 - push {r4-r6,lr} - adds r5, r1, 0 - adds r6, r2, 0 - cmp r0, 0x14 - bhi _081D1AA2 - ldr r1, =gUnknown_086252A8 - lsls r0, 2 - adds r0, r1 - ldr r4, [r0] - adds r0, r4, 0 - bl sub_81D1574 - ldr r1, =gUnknown_08625374 - lsls r0, 2 - adds r0, r1 - ldr r3, [r0] - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - bl _call_via_r3 -_081D1AA2: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D1A78 - - thumb_func_start sub_81D1AB0 -sub_81D1AB0: @ 81D1AB0 - ldr r3, [r0, 0x4] - str r3, [r1] - ldr r0, [r0, 0x8] - str r0, [r2] - bx lr - thumb_func_end sub_81D1AB0 - - thumb_func_start sub_81D1ABC -sub_81D1ABC: @ 81D1ABC - push {r4,r5,lr} - adds r5, r1, 0 - adds r4, r0, 0 - ldr r0, [r4, 0xC] - cmp r0, 0 - bne _081D1AD0 - ldrh r0, [r4, 0x4] - bl sub_81D1B0C - b _081D1AD2 -_081D1AD0: - str r0, [r2] -_081D1AD2: - ldr r0, [r4, 0x8] - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81D1ABC - - thumb_func_start sub_81D1ADC -sub_81D1ADC: @ 81D1ADC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrh r0, [r4, 0x4] - bl sub_81D1B0C - ldr r0, [r4, 0x8] - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81D1ADC - - thumb_func_start sub_81D1AF4 -sub_81D1AF4: @ 81D1AF4 - ldr r3, [r0, 0x4] - str r3, [r1] - ldr r0, [r0, 0x8] - str r0, [r2] - bx lr - thumb_func_end sub_81D1AF4 - - thumb_func_start sub_81D1B00 -sub_81D1B00: @ 81D1B00 - ldr r3, [r0, 0x4] - str r3, [r1] - ldr r0, [r0, 0x8] - str r0, [r2] - bx lr - thumb_func_end sub_81D1B00 - - thumb_func_start sub_81D1B0C -sub_81D1B0C: @ 81D1B0C - push {r4,r5,lr} - adds r4, r1, 0 - adds r5, r2, 0 - bl sub_81D15BC - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTrainers - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r0, 0xD - muls r0, r2 - ldr r2, =gTrainerClassNames - adds r0, r2 - str r0, [r4] - adds r1, 0x4 - str r1, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D1B0C - - thumb_func_start sub_81D1B40 -sub_81D1B40: @ 81D1B40 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r6, r0, 0 - movs r5, 0 - ldr r2, =gUnknown_08625388 - movs r0, 0x8 - adds r0, r2 - mov r9, r0 -_081D1B54: - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 3 - adds r0, r2 - ldrh r0, [r0] - cmp r0, r6 - bne _081D1BBC - adds r4, r5, 0x1 - lsls r1, 2 - mov r8, r1 - cmp r4, 0x3 - bhi _081D1BA8 - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 3 - adds r0, r2 - ldrh r0, [r0] - cmp r0, r6 - bne _081D1BA8 - ldr r7, =gUnknown_08625388 -_081D1B7C: - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 3 - adds r1, r7, 0x4 - adds r0, r1 - ldrh r0, [r0] - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _081D1BA8 - adds r5, r4, 0 - adds r4, r5, 0x1 - cmp r4, 0x3 - bhi _081D1BA8 - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 3 - adds r0, r7 - ldrh r0, [r0] - cmp r0, r6 - beq _081D1B7C -_081D1BA8: - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 3 - add r0, r8 - add r0, r9 - ldr r0, [r0] - b _081D1BC4 - .pool -_081D1BBC: - adds r5, 0x1 - cmp r5, 0x3 - bls _081D1B54 - movs r0, 0 -_081D1BC4: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81D1B40 - - thumb_func_start sub_81D1BD0 -sub_81D1BD0: @ 81D1BD0 - push {lr} - adds r3, r0, 0 - movs r2, 0 - ldr r1, =gUnknown_08625388 -_081D1BD8: - ldrh r0, [r1] - cmp r0, r3 - bne _081D1BE8 - ldrh r0, [r1, 0x2] - b _081D1BF4 - .pool -_081D1BE8: - adds r1, 0x18 - adds r2, 0x1 - cmp r2, 0x3 - bls _081D1BD8 - movs r0, 0x1 - negs r0, r0 -_081D1BF4: - pop {r1} - bx r1 - thumb_func_end sub_81D1BD0 - - thumb_func_start sub_81D1BF8 -sub_81D1BF8: @ 81D1BF8 - push {r4,r5,lr} - adds r5, r0, 0 - movs r4, 0 -_081D1BFE: - adds r0, r4, 0 - bl sub_81D1854 - cmp r0, 0x4E - beq _081D1C10 - cmp r0, r5 - bne _081D1C10 - movs r0, 0x1 - b _081D1C18 -_081D1C10: - adds r4, 0x1 - cmp r4, 0x14 - ble _081D1BFE - movs r0, 0 -_081D1C18: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81D1BF8 - - thumb_func_start sub_81D1C20 -sub_81D1C20: @ 81D1C20 - push {lr} - ldr r0, =0x020375e0 - ldrh r0, [r0] - bl sub_81D15CC - cmp r0, 0 - blt _081D1C3C - movs r1, 0xAE - lsls r1, 1 - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - bl FlagSet -_081D1C3C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D1C20 - - thumb_func_start sub_81D1C44 -sub_81D1C44: @ 81D1C44 - push {r4,lr} - lsls r0, 24 - ldr r4, =0x0203cf4c - lsrs r0, 21 - adds r0, 0x8 - bl Alloc - str r0, [r4] - cmp r0, 0 - bne _081D1C60 - movs r0, 0 - b _081D1C7A - .pool -_081D1C60: - movs r2, 0 - ldr r4, =0x0203cf48 - movs r3, 0xFF -_081D1C66: - adds r0, r2, r4 - ldrb r1, [r0] - orrs r1, r3 - strb r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x2 - bls _081D1C66 - movs r0, 0x1 -_081D1C7A: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D1C44 - - thumb_func_start sub_81D1C84 -sub_81D1C84: @ 81D1C84 - push {r4-r6,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r6, =0x0203cf48 - adds r5, r4, r6 - ldrb r0, [r5] - cmp r0, 0xFF - bne _081D1CEC - cmp r4, 0x2 - bne _081D1CD4 - ldr r0, =gUnknown_086253E8 - ldr r1, [r0, 0x14] - ldr r0, [r0, 0x10] - str r0, [sp] - str r1, [sp, 0x4] - ldr r0, =gUnknown_085DFF04 - movs r1, 0x4 - bl GetMaxWidthInMenuTable - lsls r0, 24 - ldr r2, =0x00ffffff - ldr r1, [sp] - ands r1, r2 - orrs r1, r0 - str r1, [sp] - mov r0, sp - bl AddWindow - strb r0, [r6, 0x2] - b _081D1CE0 - .pool -_081D1CD4: - lsls r0, r4, 3 - ldr r1, =gUnknown_086253E8 - adds r0, r1 - bl AddWindow - strb r0, [r5] -_081D1CE0: - ldr r0, =0x0203cf48 - adds r0, r4, r0 - ldrb r0, [r0] - movs r1, 0 - bl SetStandardWindowBorderStyle -_081D1CEC: - ldr r0, =0x0203cf48 - adds r0, r4, r0 - ldrb r0, [r0] - add sp, 0x8 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D1C84 - - thumb_func_start sub_81D1D04 -sub_81D1D04: @ 81D1D04 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x0203cf48 - adds r4, r0 - ldrb r0, [r4] - movs r1, 0 - bl sub_8198070 - ldrb r0, [r4] - bl ClearWindowTilemap - ldrb r0, [r4] - bl RemoveWindow - movs r0, 0xFF - strb r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D1D04 - - thumb_func_start sub_81D1D34 -sub_81D1D34: @ 81D1D34 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0203cf48 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_81D1D34 - - thumb_func_start sub_81D1D44 -sub_81D1D44: @ 81D1D44 - push {r4,r5,lr} - sub sp, 0x34 - adds r3, r1, 0 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r2, 24 - lsrs r5, r2, 24 - movs r0, 0x2 - negs r0, r0 - cmp r3, r0 - beq _081D1DAC - ldr r0, =0x03005d8c - lsls r1, r3, 3 - adds r1, r3 - lsls r1, 2 - ldr r0, [r0] - adds r1, r0 - ldr r0, =0x00002cca - adds r1, r0 - add r0, sp, 0x14 - bl CopyString - add r0, sp, 0x14 - bl sub_81DB52C - add r0, sp, 0x14 - bl GetStringLength - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x5 - bhi _081D1D8C - add r0, sp, 0x14 - movs r1, 0x1 - bl StopMusicWhileStringIsPrinted -_081D1D8C: - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - ldr r0, =gUnknown_08625400 - str r0, [sp, 0x8] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0xC] - add r0, sp, 0x14 - str r0, [sp, 0x10] - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0x8 - adds r3, r5, 0 - bl AddTextPrinterParametrized2 -_081D1DAC: - add sp, 0x34 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D1D44 - - thumb_func_start sub_81D1DC0 -sub_81D1DC0: @ 81D1DC0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r5, r0, 0 - movs r3, 0 - ldr r7, =0x0203cf4c - ldr r0, =gUnknown_085E8CF7 - mov r12, r0 - ldr r4, =0x03006310 - ldr r1, =0x0203cf48 - mov r8, r1 - ldr r2, =sub_81D1E7C - mov r9, r2 - ldr r0, =sub_81D1D44 - mov r10, r0 - ldrb r1, [r5, 0x5] - cmp r3, r1 - bcs _081D1E02 - adds r6, r7, 0 - ldr r2, =gUnknown_08625403 -_081D1DEC: - ldr r1, [r6] - lsls r0, r3, 3 - adds r0, r1 - str r2, [r0] - str r3, [r0, 0x4] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - ldrb r0, [r5, 0x5] - cmp r3, r0 - bcc _081D1DEC -_081D1E02: - ldr r2, [r7] - lsls r0, r3, 3 - adds r0, r2 - mov r1, r12 - str r1, [r0] - movs r1, 0x2 - negs r1, r1 - str r1, [r0, 0x4] - str r2, [r4] - ldrb r0, [r5, 0x5] - adds r0, 0x1 - movs r1, 0 - strh r0, [r4, 0xC] - mov r2, r8 - ldrb r0, [r2, 0x1] - strb r0, [r4, 0x10] - strb r1, [r4, 0x11] - movs r0, 0x8 - strb r0, [r4, 0x12] - strb r1, [r4, 0x13] - strh r0, [r4, 0xE] - movs r0, 0x29 - strb r0, [r4, 0x14] - movs r0, 0x31 - strb r0, [r4, 0x15] - mov r0, r9 - str r0, [r4, 0x4] - mov r1, r10 - str r1, [r4, 0x8] - movs r0, 0x1 - strb r0, [r4, 0x17] - movs r0, 0 - strb r0, [r4, 0x16] - ldrh r1, [r5, 0x2] - ldrh r2, [r5] - adds r0, r4, 0 - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D1DC0 - - thumb_func_start sub_81D1E7C -sub_81D1E7C: @ 81D1E7C - push {lr} - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x1 - beq _081D1E8C - movs r0, 0x5 - bl audio_play -_081D1E8C: - pop {r0} - bx r0 - thumb_func_end sub_81D1E7C - - thumb_func_start sub_81D1E90 -sub_81D1E90: @ 81D1E90 - push {r4,lr} - sub sp, 0x10 - adds r4, r0, 0 - ldrb r0, [r4, 0x5] - ldrb r1, [r4, 0x4] - subs r0, r1 - adds r0, 0x1 - str r0, [sp] - movs r0, 0x6E - str r0, [sp, 0x4] - str r0, [sp, 0x8] - adds r0, r4, 0x2 - str r0, [sp, 0xC] - movs r0, 0x2 - movs r1, 0xC8 - movs r2, 0xC - movs r3, 0x94 - bl AddScrollIndicatorArrowPairParametrized - strb r0, [r4, 0x9] - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81D1E90 - - thumb_func_start sub_81D1EC0 -sub_81D1EC0: @ 81D1EC0 - push {lr} - ldr r0, =0x0203cf4c - ldr r0, [r0] - bl Free - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D1EC0 - - thumb_func_start sub_81D1ED4 -sub_81D1ED4: @ 81D1ED4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r3, r0, 0 - movs r6, 0 - movs r7, 0 -_081D1EE6: - movs r2, 0 - lsls r5, r6, 2 - adds r0, r6, 0x1 - mov r10, r0 - adds r4, r5, 0 -_081D1EF0: - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 2 - adds r0, r4, r0 - adds r0, r3, r0 - adds r1, r0, 0 - adds r1, 0x64 - strh r7, [r1] - adds r0, 0x66 - strh r7, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x9 - bls _081D1EF0 - movs r2, 0 - mov r9, r2 - str r5, [sp] - movs r1, 0x9B - mov r8, r1 - movs r4, 0x5B - mov r12, r4 -_081D1F1C: - lsls r0, r2, 2 - adds r0, r2 - adds r1, r6, r0 - adds r1, r3, r1 - mov r4, r9 - strb r4, [r1] - lsls r0, 2 - ldr r1, [sp] - adds r0, r1, r0 - adds r0, r3, r0 - mov r4, r8 - strh r4, [r0, 0x14] - mov r1, r12 - strh r1, [r0, 0x16] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x3 - bls _081D1F1C - adds r1, r3, r5 - movs r2, 0x96 - lsls r2, 1 - adds r0, r1, r2 - strh r7, [r0] - movs r4, 0x97 - lsls r4, 1 - adds r0, r1, r4 - strh r7, [r0] - mov r1, r10 - lsls r0, r1, 24 - lsrs r6, r0, 24 - cmp r6, 0x4 - bls _081D1EE6 - movs r2, 0xD5 - lsls r2, 2 - adds r0, r3, r2 - movs r1, 0 - strb r1, [r0] - ldr r4, =0x00000352 - adds r0, r3, r4 - strh r1, [r0] - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D1ED4 - - thumb_func_start sub_81D1F84 -sub_81D1F84: @ 81D1F84 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - mov r8, r0 - str r1, [sp] - mov r9, r2 - movs r7, 0 -_081D1F98: - lsls r4, r7, 2 - ldr r1, [sp] - adds r0, r4, r1 - ldrh r1, [r0] - lsls r5, r1, 8 - mov r2, r9 - adds r0, r4, r2 - ldrh r0, [r0] - subs r0, r1 - lsls r0, 8 - movs r1, 0xA - bl __divsi3 - adds r6, r0, 0 - movs r3, 0 - adds r7, 0x1 - mov r10, r7 - mov r12, r4 -_081D1FBC: - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 2 - add r0, r12 - add r0, r8 - asrs r2, r5, 8 - asrs r1, r5, 7 - movs r7, 0x1 - ands r1, r7 - adds r2, r1 - adds r0, 0x64 - strh r2, [r0] - adds r5, r6 - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x8 - bls _081D1FBC - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 2 - adds r0, r4, r0 - add r0, r8 - mov r1, r9 - adds r2, r4, r1 - ldrh r1, [r2] - adds r0, 0x64 - strh r1, [r0] - ldr r7, [sp] - adds r0, r4, r7 - ldrh r1, [r0, 0x2] - lsls r5, r1, 8 - ldrh r0, [r2, 0x2] - subs r0, r1 - lsls r0, 8 - movs r1, 0xA - bl __divsi3 - adds r6, r0, 0 - movs r3, 0 - str r4, [sp, 0x4] - movs r0, 0x1 - mov r12, r0 -_081D2012: - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 2 - ldr r1, [sp, 0x4] - adds r0, r1, r0 - add r0, r8 - asrs r2, r5, 8 - asrs r1, r5, 7 - mov r7, r12 - ands r1, r7 - adds r2, r1 - adds r0, 0x66 - strh r2, [r0] - adds r5, r6 - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x8 - bls _081D2012 - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 2 - adds r0, r4, r0 - add r0, r8 - mov r2, r9 - adds r1, r4, r2 - ldrh r1, [r1, 0x2] - adds r0, 0x66 - strh r1, [r0] - mov r7, r10 - lsls r0, r7, 16 - lsrs r7, r0, 16 - cmp r7, 0x4 - bls _081D1F98 - ldr r1, =0x00000352 - add r1, r8 - movs r0, 0 - strh r0, [r1] - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D1F84 - - thumb_func_start sub_81D2074 -sub_81D2074: @ 81D2074 - push {r4,lr} - adds r1, r0, 0 - ldr r0, =0x00000352 - adds r4, r1, r0 - ldrh r0, [r4] - cmp r0, 0x9 - bls _081D208C - movs r0, 0 - b _081D20A6 - .pool -_081D208C: - adds r0, r1, 0 - bl sub_81D2230 - ldrh r1, [r4] - adds r1, 0x1 - strh r1, [r4] - lsls r1, 16 - lsrs r1, 16 - movs r0, 0xA - eors r1, r0 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 -_081D20A6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81D2074 - - thumb_func_start sub_81D20AC -sub_81D20AC: @ 81D20AC - ldr r1, =0x00000355 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - bx lr - .pool - thumb_func_end sub_81D20AC - - thumb_func_start sub_81D20BC -sub_81D20BC: @ 81D20BC - push {r4,r5,lr} - sub sp, 0xC - ldr r1, =0x00000355 - adds r4, r0, r1 - ldrb r0, [r4] - cmp r0, 0 - beq _081D20D4 - cmp r0, 0x1 - beq _081D20E2 - b _081D20FA - .pool -_081D20D4: - bl dp12_8087EA4 - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - movs r0, 0x1 - b _081D20FC -_081D20E2: - mov r0, sp - ldr r1, =gUnknown_08625404 - ldm r1!, {r2,r3,r5} - stm r0!, {r2,r3,r5} - ldr r0, [sp] - ldr r1, [sp, 0x4] - ldr r2, [sp, 0x8] - bl sub_80BA038 - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] -_081D20FA: - movs r0, 0 -_081D20FC: - add sp, 0xC - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D20BC - - thumb_func_start sub_81D2108 -sub_81D2108: @ 81D2108 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - adds r6, r0, 0 - movs r1, 0xD5 - lsls r1, 2 - adds r0, r6, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _081D21BE - adds r0, r6, 0 - bl sub_81D24A4 - adds r0, r6, 0 - bl sub_81D2634 - movs r7, 0 - ldr r5, =0x02038c28 - mov r12, r5 - movs r0, 0xF0 - lsls r0, 3 - add r0, r12 - mov r9, r0 - movs r1, 0xA0 - lsls r1, 1 - adds r1, r6, r1 - str r1, [sp] - ldr r5, =0x0000ffff - mov r8, r5 - movs r0, 0xA1 - lsls r0, 1 - adds r0, r6, r0 - str r0, [sp, 0x4] - movs r1, 0x92 - lsls r1, 2 - adds r1, r6, r1 - str r1, [sp, 0x8] - ldr r5, =0x0000024a - adds r5, r6 - mov r10, r5 -_081D215E: - adds r2, r7, 0 - adds r2, 0x37 - lsls r3, r2, 2 - mov r0, r9 - adds r0, r3, r0 - str r0, [sp, 0xC] - add r3, r12 - lsls r4, r7, 2 - ldr r1, [sp] - adds r0, r1, r4 - ldrh r0, [r0] - lsls r0, 8 - ldr r5, [sp, 0x4] - adds r1, r5, r4 - ldrh r1, [r1] - orrs r0, r1 - strh r0, [r3] - mov r1, r8 - ands r0, r1 - ldr r5, [sp, 0xC] - strh r0, [r5] - lsls r2, 1 - adds r2, 0x1 - lsls r2, 1 - mov r0, r9 - adds r3, r2, r0 - add r2, r12 - ldr r1, [sp, 0x8] - adds r0, r1, r4 - ldrh r0, [r0] - lsls r0, 8 - add r4, r10 - ldrh r1, [r4] - orrs r0, r1 - strh r0, [r2] - mov r5, r8 - ands r0, r5 - strh r0, [r3] - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r7, 0x41 - bls _081D215E - movs r0, 0xD5 - lsls r0, 2 - adds r1, r6, r0 - movs r0, 0 - strb r0, [r1] -_081D21BE: - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D2108 - - thumb_func_start sub_81D21DC -sub_81D21DC: @ 81D21DC - push {r4,r5,lr} - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x3 - bls _081D21E8 - movs r1, 0 -_081D21E8: - movs r0, 0x1 - lsls r0, r1 - movs r5, 0x1F - bics r5, r0 - movs r0, 0x40 - movs r1, 0xF0 - bl SetGpuReg - movs r0, 0x42 - movs r1, 0x9B - bl SetGpuReg - ldr r4, =0x00003879 - movs r0, 0x44 - adds r1, r4, 0 - bl SetGpuReg - movs r0, 0x46 - adds r1, r4, 0 - bl SetGpuReg - ldr r1, =0x00003f3f - movs r0, 0x48 - bl SetGpuReg - movs r0, 0x4A - adds r1, r5, 0 - bl SetGpuReg - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D21DC - - thumb_func_start sub_81D2230 -sub_81D2230: @ 81D2230 - push {r4-r7,lr} - mov r12, r0 - movs r4, 0 - movs r7, 0x96 - lsls r7, 1 - add r7, r12 - ldr r6, =0x00000352 - add r6, r12 - mov r5, r12 - adds r5, 0x64 -_081D2244: - lsls r2, r4, 2 - adds r3, r7, r2 - ldrh r1, [r6] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, r0 - adds r2, r5, r2 - ldr r0, [r2] - str r0, [r3] - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x4 - bls _081D2244 - movs r1, 0xD5 - lsls r1, 2 - add r1, r12 - movs r0, 0x1 - strb r0, [r1] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D2230 - - thumb_func_start sub_81D2278 -sub_81D2278: @ 81D2278 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - str r0, [sp] - adds r6, r1, 0 - adds r5, r2, 0 - str r3, [sp, 0x4] - ldr r0, [sp, 0x38] - ldr r7, [sp, 0x3C] - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r0, 0 - str r0, [sp, 0xC] - ldrh r0, [r5, 0x2] - ldrh r1, [r3, 0x2] - cmp r0, r1 - bcs _081D22B2 - adds r2, r0, 0 - mov r10, r2 - ldrh r0, [r3, 0x2] - ldrh r1, [r5] - lsls r4, r1, 10 - ldrh r3, [r3] - str r3, [sp, 0x8] - b _081D22C6 -_081D22B2: - ldrh r0, [r5, 0x2] - ldr r1, [sp, 0x4] - ldrh r1, [r1, 0x2] - mov r10, r1 - ldr r2, [sp, 0x4] - ldrh r1, [r2] - lsls r4, r1, 10 - ldrh r3, [r5] - str r3, [sp, 0x8] - mov r2, r10 -_081D22C6: - subs r0, r2 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - cmp r0, 0 - beq _081D22DE - subs r0, r3, r1 - lsls r0, 10 - mov r1, r8 - bl __divsi3 - str r0, [sp, 0xC] -_081D22DE: - mov r0, r8 - adds r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - cmp r7, 0 - bne _081D2328 - mov r0, r10 - subs r0, 0x38 - lsls r0, 2 - adds r6, r0 - movs r5, 0 - mov r3, r9 - lsls r3, 1 - mov r12, r3 - ldr r0, [sp, 0x8] - add r0, r9 - str r0, [sp, 0x10] - cmp r7, r8 - bcs _081D23B6 - movs r7, 0x1 -_081D2308: - adds r2, r3, r6 - asrs r1, r4, 10 - asrs r0, r4, 9 - ands r0, r7 - adds r1, r0 - add r1, r9 - strh r1, [r2] - ldr r1, [sp, 0xC] - adds r4, r1 - adds r6, 0x4 - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, r8 - bcc _081D2308 - b _081D23B6 -_081D2328: - ldr r2, [sp, 0xC] - cmp r2, 0 - ble _081D23C0 - mov r0, r10 - subs r0, 0x38 - lsls r0, 2 - adds r7, r0 - movs r5, 0 - mov r3, r9 - lsls r3, 1 - mov r12, r3 - ldr r0, [sp, 0x8] - add r0, r9 - str r0, [sp, 0x10] - cmp r5, r8 - bcs _081D237A - ldr r0, =0x00026bff - cmp r4, r0 - bgt _081D237A - mov r1, r12 - str r1, [sp, 0x14] -_081D2352: - ldr r3, [sp, 0x14] - adds r2, r3, r7 - asrs r1, r4, 10 - asrs r0, r4, 9 - movs r3, 0x1 - ands r0, r3 - adds r1, r0 - add r1, r9 - strh r1, [r2] - ldr r0, [sp, 0xC] - adds r4, r0 - adds r7, 0x4 - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, r8 - bcs _081D237A - ldr r1, =0x00026bff - cmp r4, r1 - ble _081D2352 -_081D237A: - mov r2, r10 - adds r1, r2, r5 - ldr r3, [sp] - movs r2, 0xD4 - lsls r2, 2 - adds r0, r3, r2 - strh r1, [r0] - ldrh r0, [r0] - subs r0, 0x38 - lsls r0, 2 - adds r6, r0 - cmp r5, r8 - bcs _081D23B6 - mov r3, r12 - movs r7, 0x1 -_081D2398: - adds r2, r3, r6 - asrs r1, r4, 10 - asrs r0, r4, 9 - ands r0, r7 - adds r1, r0 - add r1, r9 - strh r1, [r2] - ldr r0, [sp, 0xC] - adds r4, r0 - adds r6, 0x4 - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, r8 - bcc _081D2398 -_081D23B6: - subs r0, r6, 0x4 - b _081D248C - .pool -_081D23C0: - ldr r1, [sp, 0xC] - cmp r1, 0 - bge _081D2464 - mov r0, r10 - subs r0, 0x38 - lsls r0, 2 - adds r6, r0 - movs r5, 0 - mov r2, r9 - lsls r2, 1 - mov r12, r2 - ldr r3, [sp, 0x8] - add r3, r9 - str r3, [sp, 0x10] - cmp r5, r8 - bcs _081D241E - adds r3, r2, r6 - asrs r1, r4, 10 - asrs r0, r4, 9 - movs r2, 0x1 - ands r0, r2 - adds r1, r0 - add r1, r9 - strh r1, [r3] - b _081D2414 -_081D23F2: - ldr r0, [sp, 0xC] - adds r4, r0 - adds r6, 0x4 - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, r8 - bcs _081D241E - mov r1, r12 - adds r3, r1, r6 - asrs r2, r4, 10 - asrs r0, r4, 9 - movs r1, 0x1 - ands r0, r1 - adds r2, r0 - add r2, r9 - strh r2, [r3] -_081D2414: - ldr r0, =0x00026bff - cmp r4, r0 - bgt _081D23F2 - movs r0, 0x9B - strh r0, [r3] -_081D241E: - mov r2, r10 - adds r1, r2, r5 - ldr r3, [sp] - movs r2, 0xD4 - lsls r2, 2 - adds r0, r3, r2 - strh r1, [r0] - ldrh r0, [r0] - subs r0, 0x38 - lsls r0, 2 - adds r7, r0 - cmp r5, r8 - bcs _081D245A - mov r3, r12 - movs r6, 0x1 -_081D243C: - adds r2, r3, r7 - asrs r1, r4, 10 - asrs r0, r4, 9 - ands r0, r6 - adds r1, r0 - add r1, r9 - strh r1, [r2] - ldr r0, [sp, 0xC] - adds r4, r0 - adds r7, 0x4 - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, r8 - bcc _081D243C -_081D245A: - subs r0, r7, 0x4 - b _081D248C - .pool -_081D2464: - ldr r1, [sp] - movs r2, 0xD4 - lsls r2, 2 - adds r0, r1, r2 - mov r3, r10 - strh r3, [r0] - mov r0, r10 - subs r0, 0x38 - lsls r0, 2 - adds r6, r0 - adds r7, r0 - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r6, 0x2] - ldr r1, [sp, 0x4] - ldrh r0, [r1] - strh r0, [r7] - movs r0, 0x9B - strh r0, [r7, 0x2] - b _081D2494 -_081D248C: - add r0, r12 - mov r2, sp - ldrh r2, [r2, 0x10] - strh r2, [r0] -_081D2494: - 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_81D2278 - - thumb_func_start sub_81D24A4 -sub_81D24A4: @ 81D24A4 - push {r4-r7,lr} - sub sp, 0x8 - adds r4, r0, 0 - movs r0, 0x97 - lsls r0, 1 - adds r2, r4, r0 - movs r3, 0x99 - lsls r3, 1 - adds r1, r4, r3 - ldrh r0, [r2] - ldrh r3, [r1] - cmp r0, r3 - bcs _081D24E0 - adds r7, r0, 0 - movs r0, 0xA0 - lsls r0, 1 - adds r1, r4, r0 - movs r3, 0x96 - lsls r3, 1 - adds r2, r4, r3 - subs r0, 0x10 - adds r3, r4, r0 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - adds r0, r4, 0 - bl sub_81D2278 - b _081D2500 -_081D24E0: - ldrh r7, [r1] - movs r2, 0xA0 - lsls r2, 1 - adds r1, r4, r2 - movs r3, 0x98 - lsls r3, 1 - adds r2, r4, r3 - movs r0, 0x96 - lsls r0, 1 - adds r3, r4, r0 - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - adds r0, r4, 0 - bl sub_81D2278 -_081D2500: - movs r1, 0xA0 - lsls r1, 1 - adds r5, r4, r1 - movs r3, 0x98 - lsls r3, 1 - adds r2, r4, r3 - movs r0, 0x9A - lsls r0, 1 - adds r6, r4, r0 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - adds r0, r4, 0 - adds r1, r5, 0 - adds r3, r6, 0 - bl sub_81D2278 - movs r2, 0 - movs r1, 0x9B - lsls r1, 1 - adds r0, r4, r1 - movs r3, 0x9D - lsls r3, 1 - adds r1, r4, r3 - ldrh r0, [r0] - ldrh r1, [r1] - cmp r0, r1 - bhi _081D253C - movs r2, 0x1 -_081D253C: - movs r0, 0x9C - lsls r0, 1 - adds r3, r4, r0 - str r2, [sp] - movs r1, 0x92 - lsls r1, 2 - adds r0, r4, r1 - str r0, [sp, 0x4] - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - bl sub_81D2278 - movs r2, 0x38 - cmp r2, r7 - bcs _081D257E - adds r6, r5, 0 - movs r3, 0 - movs r0, 0xA1 - lsls r0, 1 - adds r5, r4, r0 -_081D2566: - adds r0, r2, 0 - subs r0, 0x38 - lsls r0, 2 - adds r1, r6, r0 - strh r3, [r1] - adds r0, r5, r0 - strh r3, [r0] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, r7 - bcc _081D2566 -_081D257E: - movs r1, 0x97 - lsls r1, 1 - adds r0, r4, r1 - ldrh r2, [r0] - movs r3, 0xD4 - lsls r3, 2 - adds r0, r4, r3 - ldrh r1, [r0] - cmp r2, r1 - bhi _081D25B2 - movs r1, 0xA0 - lsls r1, 1 - adds r3, r4, r1 - movs r5, 0x9B - adds r1, r0, 0 -_081D259C: - adds r0, r2, 0 - subs r0, 0x38 - lsls r0, 2 - adds r0, r3, r0 - strh r5, [r0] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - ldrh r0, [r1] - cmp r2, r0 - bls _081D259C -_081D25B2: - movs r2, 0x9B - lsls r2, 1 - adds r1, r4, r2 - movs r3, 0xD4 - lsls r3, 2 - adds r0, r4, r3 - ldrh r0, [r0] - ldrh r1, [r1] - cmp r0, r1 - bcs _081D25C8 - adds r0, r1, 0 -_081D25C8: - adds r0, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x79 - bhi _081D25F8 - movs r0, 0xA0 - lsls r0, 1 - adds r6, r4, r0 - movs r3, 0 - movs r1, 0xA1 - lsls r1, 1 - adds r5, r4, r1 -_081D25E0: - adds r0, r2, 0 - subs r0, 0x38 - lsls r0, 2 - adds r1, r6, r0 - strh r3, [r1] - adds r0, r5, r0 - strh r3, [r0] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x79 - bls _081D25E0 -_081D25F8: - movs r2, 0x38 - movs r3, 0xA0 - lsls r3, 1 - adds r5, r4, r3 - movs r0, 0xA1 - lsls r0, 1 - adds r4, r0 - movs r6, 0x9B -_081D2608: - adds r0, r2, 0 - subs r0, 0x38 - lsls r1, r0, 2 - adds r3, r5, r1 - ldrh r0, [r3] - cmp r0, 0 - bne _081D2620 - adds r0, r4, r1 - ldrh r0, [r0] - cmp r0, 0 - beq _081D2620 - strh r6, [r3] -_081D2620: - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x79 - bls _081D2608 - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81D24A4 - - thumb_func_start sub_81D2634 -sub_81D2634: @ 81D2634 - push {r4-r6,lr} - sub sp, 0x8 - adds r4, r0, 0 - movs r0, 0x97 - lsls r0, 1 - adds r2, r4, r0 - movs r3, 0x9F - lsls r3, 1 - adds r1, r4, r3 - ldrh r0, [r2] - ldrh r5, [r1] - cmp r0, r5 - bcs _081D266E - adds r6, r0, 0 - movs r0, 0x92 - lsls r0, 2 - adds r1, r4, r0 - subs r3, 0x12 - adds r2, r4, r3 - movs r5, 0x9E - lsls r5, 1 - adds r3, r4, r5 - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - adds r0, r4, 0 - bl sub_81D2278 - b _081D2690 -_081D266E: - ldrh r6, [r1] - movs r0, 0x92 - lsls r0, 2 - adds r1, r4, r0 - movs r3, 0x9E - lsls r3, 1 - adds r2, r4, r3 - movs r5, 0x96 - lsls r5, 1 - adds r3, r4, r5 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - adds r0, r4, 0 - bl sub_81D2278 -_081D2690: - movs r0, 0x92 - lsls r0, 2 - adds r5, r4, r0 - movs r1, 0x9E - lsls r1, 1 - adds r2, r4, r1 - movs r0, 0x9C - lsls r0, 1 - adds r3, r4, r0 - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_81D2278 - cmp r6, 0x38 - ble _081D26C8 - movs r0, 0 - adds r1, r5, 0 - adds r2, r6, 0 - subs r2, 0x38 -_081D26BC: - strh r0, [r1] - strh r0, [r1, 0x2] - adds r1, 0x4 - subs r2, 0x1 - cmp r2, 0 - bne _081D26BC -_081D26C8: - movs r1, 0x97 - lsls r1, 1 - adds r0, r4, r1 - ldrh r2, [r0] - movs r3, 0xD4 - lsls r3, 2 - adds r0, r4, r3 - ldrh r5, [r0] - cmp r2, r5 - bgt _081D26F6 - movs r3, 0x9B - adds r1, r0, 0 - lsls r0, r2, 2 - movs r5, 0xB5 - lsls r5, 1 - adds r0, r5 - adds r0, r4 -_081D26EA: - strh r3, [r0] - adds r0, 0x4 - adds r2, 0x1 - ldrh r5, [r1] - cmp r2, r5 - ble _081D26EA -_081D26F6: - movs r1, 0x9D - lsls r1, 1 - adds r0, r4, r1 - ldrh r0, [r0] - adds r1, r0, 0x1 - movs r2, 0xD4 - lsls r2, 2 - adds r0, r4, r2 - ldrh r0, [r0] - cmp r0, r1 - bge _081D270E - adds r0, r1, 0 -_081D270E: - adds r2, r0, 0 - cmp r2, 0x79 - bgt _081D272C - movs r1, 0 - lsls r0, r2, 2 - movs r3, 0xB4 - lsls r3, 1 - adds r0, r3 - adds r0, r4 -_081D2720: - strh r1, [r0] - strh r1, [r0, 0x2] - adds r0, 0x4 - adds r2, 0x1 - cmp r2, 0x79 - ble _081D2720 -_081D272C: - movs r3, 0 - movs r5, 0x92 - lsls r5, 2 - adds r1, r4, r5 - movs r2, 0x41 -_081D2736: - ldrh r0, [r1] - ldrh r4, [r1, 0x2] - cmp r0, r4 - bcc _081D2742 - strh r3, [r1, 0x2] - strh r3, [r1] -_081D2742: - adds r1, 0x4 - subs r2, 0x1 - cmp r2, 0 - bge _081D2736 - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81D2634 - - thumb_func_start sub_81D2754 -sub_81D2754: @ 81D2754 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r6, r0, 0 - mov r8, r1 - ldr r1, =gUnknown_08625410 - ldrb r0, [r6] - adds r0, r1 - ldrb r2, [r0] - adds r6, 0x1 - movs r0, 0x9B - mov r3, r8 - strh r0, [r3] - movs r0, 0x5B - subs r0, r2 - strh r0, [r3, 0x2] - movs r7, 0x40 - movs r0, 0 - mov r12, r0 - movs r2, 0x1 - mov r9, r2 - ldr r3, =gUnknown_08329F40 - mov r10, r3 -_081D2786: - adds r0, r7, 0 - adds r0, 0x33 - lsls r0, 24 - lsrs r7, r0, 24 - mov r1, r12 - lsls r0, r1, 24 - movs r2, 0xFF - lsls r2, 24 - adds r0, r2 - lsrs r3, r0, 24 - mov r12, r3 - cmp r0, 0 - bge _081D27A4 - movs r0, 0x4 - mov r12, r0 -_081D27A4: - mov r1, r12 - lsls r0, r1, 24 - asrs r4, r0, 24 - cmp r4, 0x2 - bne _081D27B4 - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 -_081D27B4: - ldrb r0, [r6] - ldr r2, =gUnknown_08625410 - adds r0, r2 - ldrb r2, [r0] - adds r6, 0x1 - lsls r0, r4, 2 - mov r1, r8 - adds r3, r0, r1 - adds r0, r7, 0 - adds r0, 0x40 - lsls r0, 1 - add r0, r10 - movs r1, 0 - ldrsh r0, [r0, r1] - muls r0, r2 - asrs r5, r0, 8 - adds r0, r5, 0 - adds r0, 0x9B - strh r0, [r3] - lsls r0, r7, 1 - add r0, r10 - movs r1, 0 - ldrsh r0, [r0, r1] - adds r1, r2, 0 - muls r1, r0 - asrs r1, 8 - movs r0, 0x5B - subs r0, r1 - strh r0, [r3, 0x2] - cmp r4, 0x2 - bgt _081D2800 - cmp r2, 0x20 - bne _081D27FA - cmp r4, 0x2 - beq _081D2800 -_081D27FA: - adds r0, r5, 0 - adds r0, 0x9C - strh r0, [r3] -_081D2800: - mov r0, r9 - adds r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - cmp r0, 0x4 - bls _081D2786 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D2754 - - thumb_func_start sub_81D2824 -sub_81D2824: @ 81D2824 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gUnknown_08625510 - bl InitWindows - bl DeactivateAllTextPrinters - movs r0, 0 - movs r1, 0x1 - movs r2, 0xE0 - bl sub_809882C - ldr r0, =gUnknown_0860F074 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - movs r4, 0 -_081D284A: - adds r0, r4, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x4 - bls _081D284A - cmp r5, 0 - bne _081D287C - movs r0, 0 - bl PutWindowTilemap - movs r0, 0 - movs r1, 0 - movs r2, 0x1 - movs r3, 0xE - bl SetWindowBorderStyle - b _081D288E - .pool -_081D287C: - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0x1 - movs r1, 0 - movs r2, 0x1 - movs r3, 0xE - bl SetWindowBorderStyle -_081D288E: - movs r0, 0x2 - bl PutWindowTilemap - movs r0, 0x3 - bl PutWindowTilemap - movs r0, 0x2 - movs r1, 0 - movs r2, 0x1 - movs r3, 0xE - bl SetWindowBorderStyle - movs r0, 0x3 - movs r1, 0 - movs r2, 0x1 - movs r3, 0xE - bl SetWindowBorderStyle - bl nullsub_79 - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81D2824 - - thumb_func_start nullsub_79 -nullsub_79: @ 81D28C4 - bx lr - thumb_func_end nullsub_79 - - thumb_func_start sub_81D28C8 -sub_81D28C8: @ 81D28C8 - push {r4-r7,lr} - lsls r1, 16 - lsrs r4, r1, 16 - ldr r3, =0x03006310 - adds r2, r3, 0 - ldr r1, =gUnknown_08625548 - ldm r1!, {r5-r7} - stm r2!, {r5-r7} - ldm r1!, {r5-r7} - stm r2!, {r5-r7} - strh r4, [r3, 0xC] - str r0, [r3] - cmp r4, 0x5 - bhi _081D28F0 - strh r4, [r3, 0xE] - b _081D28F4 - .pool -_081D28F0: - movs r0, 0x6 - strh r0, [r3, 0xE] -_081D28F4: - ldrb r0, [r3, 0xE] - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81D28C8 - - thumb_func_start sub_81D28FC -sub_81D28FC: @ 81D28FC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x2C - mov r9, r0 - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r5, =gUnknown_085EFA31 - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x80 - bl GetStringCenterAlignXOffset - adds r4, r0, 0 - lsls r3, r4, 24 - lsrs r3, 24 - movs r0, 0x1 - str r0, [sp] - movs r0, 0xFF - mov r8, r0 - str r0, [sp, 0x4] - movs r7, 0 - str r7, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - adds r2, r5, 0 - bl Print - ldr r5, =gUnknown_085EFA52 - movs r1, 0x29 - mov r10, r1 - str r1, [sp] - mov r0, r8 - str r0, [sp, 0x4] - str r7, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - adds r2, r5, 0 - movs r3, 0x4 - bl Print - ldr r5, =gUnknown_085EFA56 - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x6A - bl GetStringRightAlignXOffset - adds r4, r0, 0 - lsls r3, r4, 24 - lsrs r3, 24 - movs r1, 0x19 - str r1, [sp] - mov r0, r8 - str r0, [sp, 0x4] - str r7, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - adds r2, r5, 0 - bl Print - ldr r5, =gUnknown_085EFA5D - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x6A - bl GetStringRightAlignXOffset - adds r4, r0, 0 - lsls r3, r4, 24 - lsrs r3, 24 - mov r1, r10 - str r1, [sp] - mov r0, r8 - str r0, [sp, 0x4] - str r7, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - adds r2, r5, 0 - bl Print - movs r0, 0x2 - negs r0, r0 - cmp r9, r0 - bne _081D29C4 - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram - b _081D2AB6 - .pool -_081D29C4: - mov r1, r9 - lsls r0, r1, 1 - add r0, r9 - lsls r0, 2 - ldr r1, =gBattleMoves - adds r6, r0, r1 - ldrb r1, [r6, 0x2] - lsls r0, r1, 3 - subs r0, r1 - ldr r1, =gTypeNames - adds r5, r0, r1 - movs r0, 0x19 - str r0, [sp] - mov r1, r8 - str r1, [sp, 0x4] - str r7, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - adds r2, r5, 0 - movs r3, 0x4 - bl Print - ldr r1, =gUnknown_085EFA52 - movs r0, 0x1 - movs r2, 0 - bl GetStringWidth - adds r4, r0, 0x4 - ldrb r1, [r6, 0x4] - add r0, sp, 0xC - movs r2, 0 - movs r3, 0x2 - bl ConvertIntToDecimalString - lsls r3, r4, 24 - lsrs r3, 24 - mov r0, r10 - str r0, [sp] - mov r1, r8 - str r1, [sp, 0x4] - str r7, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - add r2, sp, 0xC - bl Print - ldrb r0, [r6, 0x1] - cmp r0, 0x1 - bhi _081D2A3C - ldr r5, =gUnknown_085E8D45 - b _081D2A4A - .pool -_081D2A3C: - ldrb r1, [r6, 0x1] - add r0, sp, 0xC - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - add r5, sp, 0xC -_081D2A4A: - movs r0, 0x19 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - movs r3, 0x6A - bl Print - ldrb r0, [r6, 0x3] - cmp r0, 0 - bne _081D2A70 - ldr r5, =gUnknown_085E8D45 - b _081D2A7E - .pool -_081D2A70: - ldrb r1, [r6, 0x3] - add r0, sp, 0xC - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - add r5, sp, 0xC -_081D2A7E: - movs r0, 0x29 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r4, 0 - str r4, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - adds r2, r5, 0 - movs r3, 0x6A - bl Print - ldr r1, =gMoveDescriptionPointers - mov r0, r9 - subs r0, 0x1 - lsls r0, 2 - adds r0, r1 - ldr r5, [r0] - movs r0, 0x41 - str r0, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0 - movs r1, 0x7 - adds r2, r5, 0 - movs r3, 0 - bl Print -_081D2AB6: - add sp, 0x2C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D28FC - - thumb_func_start sub_81D2ACC -sub_81D2ACC: @ 81D2ACC - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - adds r4, r0, 0 - bl sub_816137C - movs r0, 0x1 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r5, =gUnknown_085EFA3E - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x80 - bl GetStringCenterAlignXOffset - lsls r3, r0, 24 - lsrs r3, 24 - movs r0, 0x1 - str r0, [sp] - movs r7, 0xFF - str r7, [sp, 0x4] - movs r6, 0 - str r6, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - bl Print - ldr r5, =gUnknown_085EFA67 - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x5C - bl GetStringRightAlignXOffset - lsls r3, r0, 24 - lsrs r3, 24 - movs r0, 0x19 - mov r8, r0 - str r0, [sp] - str r7, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - adds r2, r5, 0 - bl Print - ldr r5, =gUnknown_085EFA6E - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x5C - bl GetStringRightAlignXOffset - lsls r3, r0, 24 - lsrs r3, 24 - movs r0, 0x29 - str r0, [sp] - str r7, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - adds r2, r5, 0 - bl Print - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - bne _081D2B6C - movs r0, 0x1 - movs r1, 0x2 - bl CopyWindowToVram - b _081D2BB8 - .pool -_081D2B6C: - lsls r4, 3 - ldr r0, =gContestMoves - adds r4, r0 - ldr r1, =gContestMoveTypeTextPointers - ldrb r0, [r4, 0x1] - lsls r0, 29 - lsrs r0, 27 - adds r0, r1 - ldr r5, [r0] - mov r0, r8 - str r0, [sp] - str r7, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - adds r2, r5, 0 - movs r3, 0x4 - bl Print - ldr r1, =gContestEffectDescriptionPointers - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r5, [r0] - movs r0, 0x41 - str r0, [sp] - str r7, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x7 - adds r2, r5, 0 - movs r3, 0 - bl Print - movs r0, 0x1 - movs r1, 0x2 - bl CopyWindowToVram -_081D2BB8: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D2ACC - - thumb_func_start sub_81D2BD0 -sub_81D2BD0: @ 81D2BD0 - push {r4,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x1 - beq _081D2BE2 - movs r0, 0x5 - bl audio_play -_081D2BE2: - adds r0, r4, 0 - bl sub_81D28FC - adds r0, r4, 0 - bl sub_81D2ACC - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81D2BD0 - - thumb_func_start sub_81D2BF4 -sub_81D2BF4: @ 81D2BF4 - push {r4,lr} - sub sp, 0x10 - adds r4, r0, 0 - movs r0, 0x3 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r2, =0x03003014 - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - bl sav2_get_text_speed - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r1, 0x1 - adds r2, r4, 0 - bl AddTextPrinterParametrized - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D2BF4 - - thumb_func_start sub_81D2C3C -sub_81D2C3C: @ 81D2C3C - push {lr} - bl RunTextPrinters - movs r0, 0x3 - bl IsTextPrinterActive - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_81D2C3C - - thumb_func_start sub_81D2C50 -sub_81D2C50: @ 81D2C50 - push {lr} - ldr r0, =gUnknown_08625540 - movs r1, 0x1 - movs r2, 0xE - movs r3, 0 - bl CreateYesNoMenu - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D2C50 - - thumb_func_start sub_81D2C68 -sub_81D2C68: @ 81D2C68 - push {lr} - lsls r0, 16 - lsrs r0, 16 - lsls r1, 16 - lsrs r1, 16 - cmp r0, 0xE - bne _081D2CA8 - cmp r2, 0x2 - beq _081D2C7E - cmp r2, 0x7 - bne _081D2C94 -_081D2C7E: - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - adds r1, r2, 0 - adds r2, r3, 0 - bl pokemon_getattr - b _081D2CCA - .pool -_081D2C94: - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - adds r1, r2, 0 - bl pokemon_getattr - b _081D2CCA - .pool -_081D2CA8: - cmp r2, 0x2 - beq _081D2CB0 - cmp r2, 0x7 - bne _081D2CBE -_081D2CB0: - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - bl sub_80D1ED0 - b _081D2CCA -_081D2CBE: - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - bl get_pokemon_data_from_any_box -_081D2CCA: - pop {r1} - bx r1 - thumb_func_end sub_81D2C68 - - thumb_func_start sub_81D2CD0 -sub_81D2CD0: @ 81D2CD0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - lsls r1, 16 - lsrs r4, r1, 16 - lsls r2, 16 - lsrs r6, r2, 16 - movs r0, 0xFC - strb r0, [r5] - adds r5, 0x1 - movs r0, 0x4 - strb r0, [r5] - adds r5, 0x1 - movs r0, 0x8 - strb r0, [r5] - adds r5, 0x1 - movs r0, 0 - strb r0, [r5] - adds r5, 0x1 - movs r0, 0x9 - strb r0, [r5] - adds r5, 0x1 - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0x2D - movs r3, 0 - bl sub_81D2C68 - cmp r0, 0 - beq _081D2D20 - ldr r1, =gUnknown_085E8264 - adds r0, r5, 0 - movs r2, 0 - movs r3, 0xC - bl CopyStringPadded - b _081D2E70 - .pool -_081D2D20: - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0x2 - adds r3, r5, 0 - bl sub_81D2C68 - adds r0, r5, 0 - bl GetStringEnd_Limit7 - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0xB - movs r3, 0 - bl sub_81D2C68 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r4, 0xE - bne _081D2D70 - movs r0, 0x64 - adds r4, r6, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x38 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - adds r0, r4, 0 - bl pokemon_get_gender - lsls r0, 24 - lsrs r6, r0, 24 - b _081D2D92 - .pool -_081D2D70: - lsls r0, r4, 24 - lsrs r0, 24 - lsls r1, r6, 24 - lsrs r1, 24 - bl get_pokemon_by_box_and_pos - adds r4, r0, 0 - bl pokemon_roll_gender - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r4, 0 - bl sub_80690C0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 -_081D2D92: - cmp r7, 0x1D - beq _081D2D9A - cmp r7, 0x20 - bne _081D2DB0 -_081D2D9A: - movs r0, 0xB - adds r1, r7, 0 - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r5, 0 - bl CompareString - cmp r0, 0 - bne _081D2DB0 - movs r6, 0xFF -_081D2DB0: - adds r3, r5, 0 - b _081D2DBA - .pool -_081D2DB8: - adds r3, 0x1 -_081D2DBA: - ldrb r0, [r3] - cmp r0, 0xFF - bne _081D2DB8 - movs r1, 0xFC - strb r1, [r3] - adds r3, 0x1 - movs r0, 0x12 - strb r0, [r3] - adds r3, 0x1 - movs r0, 0x3C - strb r0, [r3] - adds r3, 0x1 - cmp r6, 0 - beq _081D2DDE - cmp r6, 0xFE - beq _081D2E02 - movs r0, 0 - b _081D2E24 -_081D2DDE: - strb r1, [r3] - adds r3, 0x1 - movs r0, 0x1 - strb r0, [r3] - adds r3, 0x1 - movs r0, 0x4 - strb r0, [r3] - adds r3, 0x1 - strb r1, [r3] - adds r3, 0x1 - movs r0, 0x3 - strb r0, [r3] - adds r3, 0x1 - movs r0, 0x5 - strb r0, [r3] - adds r3, 0x1 - movs r0, 0xB5 - b _081D2E24 -_081D2E02: - strb r1, [r3] - adds r3, 0x1 - movs r0, 0x1 - strb r0, [r3] - adds r3, 0x1 - movs r0, 0x6 - strb r0, [r3] - adds r3, 0x1 - strb r1, [r3] - adds r3, 0x1 - movs r0, 0x3 - strb r0, [r3] - adds r3, 0x1 - movs r0, 0x7 - strb r0, [r3] - adds r3, 0x1 - movs r0, 0xB6 -_081D2E24: - strb r0, [r3] - adds r3, 0x1 - movs r0, 0xFC - strb r0, [r3] - adds r3, 0x1 - movs r0, 0x4 - strb r0, [r3] - adds r3, 0x1 - movs r0, 0x8 - strb r0, [r3] - adds r3, 0x1 - movs r4, 0 - strb r4, [r3] - adds r3, 0x1 - movs r0, 0x9 - strb r0, [r3] - adds r3, 0x1 - movs r0, 0xBA - strb r0, [r3] - adds r3, 0x1 - movs r0, 0xF9 - strb r0, [r3] - adds r3, 0x1 - movs r0, 0x5 - strb r0, [r3] - adds r3, 0x1 - adds r0, r3, 0 - mov r1, r8 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - adds r3, r0, 0 - strb r4, [r3] - adds r3, 0x1 - movs r0, 0xFF - strb r0, [r3] - adds r0, r3, 0 -_081D2E70: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81D2CD0 - - thumb_func_start sub_81D2E7C -sub_81D2E7C: @ 81D2E7C - push {r4,lr} - adds r4, r0, 0 - lsls r2, 16 - lsrs r2, 16 - b _081D2E94 -_081D2E86: - strb r3, [r4] - adds r1, 0x1 - adds r4, 0x1 - lsls r0, r2, 16 - ldr r2, =0xffff0000 - adds r0, r2 - lsrs r2, r0, 16 -_081D2E94: - ldrb r3, [r1] - adds r0, r3, 0 - cmp r0, 0xFF - bne _081D2E86 - adds r1, r2, 0 - lsls r0, r1, 16 - ldr r2, =0xffff0000 - adds r0, r2 - lsrs r2, r0, 16 - lsls r1, 16 - cmp r1, 0 - ble _081D2EC2 - movs r3, 0 -_081D2EAE: - strb r3, [r4] - adds r4, 0x1 - adds r1, r2, 0 - lsls r0, r1, 16 - ldr r2, =0xffff0000 - adds r0, r2 - lsrs r2, r0, 16 - lsls r1, 16 - cmp r1, 0 - bgt _081D2EAE -_081D2EC2: - movs r0, 0xFF - strb r0, [r4] - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D2E7C - - thumb_func_start sub_81D2ED4 -sub_81D2ED4: @ 81D2ED4 - push {r4-r7,lr} - adds r5, r0, 0 - adds r6, r1, 0 - ldr r0, [sp, 0x14] - ldr r1, [sp, 0x18] - ldr r4, [sp, 0x1C] - lsls r2, 16 - lsrs r7, r2, 16 - lsls r3, 16 - lsrs r3, 16 - lsls r0, 16 - lsrs r2, r0, 16 - lsls r1, 16 - lsrs r0, r1, 16 - lsls r4, 24 - cmp r4, 0 - bne _081D2EFC - subs r0, 0x1 - lsls r0, 16 - lsrs r0, 16 -_081D2EFC: - cmp r2, r0 - beq _081D2F42 - adds r0, r6, 0 - adds r1, r7, 0 - adds r2, r3, 0 - bl sub_81D2CD0 - movs r0, 0xFC - strb r0, [r5] - movs r0, 0x4 - strb r0, [r5, 0x1] - movs r0, 0x8 - strb r0, [r5, 0x2] - movs r0, 0 - strb r0, [r5, 0x3] - movs r0, 0x9 - strb r0, [r5, 0x4] - cmp r7, 0xE - bne _081D2F2C - adds r0, r5, 0x5 - ldr r1, =gUnknown_085EBFCE - b _081D2F3A - .pool -_081D2F2C: - adds r4, r5, 0x5 - lsls r0, r7, 24 - lsrs r0, 24 - bl sav3_get_box_name - adds r1, r0, 0 - adds r0, r4, 0 -_081D2F3A: - movs r2, 0x8 - bl sub_81D2E7C - b _081D2F72 -_081D2F42: - movs r1, 0 - movs r2, 0 -_081D2F46: - adds r0, r6, r1 - strb r2, [r0] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0xB - bls _081D2F46 - adds r1, r6, r1 - movs r0, 0xFF - strb r0, [r1] - movs r1, 0 - movs r2, 0 -_081D2F5E: - adds r0, r5, r1 - strb r2, [r0] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x7 - bls _081D2F5E - adds r1, r5, r1 - movs r0, 0xFF - strb r0, [r1] -_081D2F72: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81D2ED4 - - thumb_func_start sub_81D2F78 -sub_81D2F78: @ 81D2F78 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r8, r0 - mov r10, r1 - ldr r0, [sp, 0x20] - ldr r1, [sp, 0x24] - ldr r4, [sp, 0x28] - ldr r5, [sp, 0x2C] - lsls r2, 16 - lsrs r7, r2, 16 - lsls r3, 16 - lsrs r6, r3, 16 - lsls r0, 16 - lsrs r2, r0, 16 - lsls r1, 16 - lsrs r1, 16 - mov r9, r1 - lsls r4, 16 - lsrs r0, r4, 16 - lsls r5, 24 - cmp r5, 0 - bne _081D2FB0 - subs r0, 0x1 - lsls r0, 16 - lsrs r0, 16 -_081D2FB0: - cmp r2, r0 - beq _081D305C - adds r0, r7, 0 - adds r1, r6, 0 - movs r2, 0x16 - movs r3, 0 - bl sub_81D2C68 - mov r1, r9 - lsls r5, r1, 2 - adds r4, r5, r1 - mov r2, r8 - adds r1, r2, r4 - strb r0, [r1] - adds r0, r7, 0 - adds r1, r6, 0 - movs r2, 0x2F - movs r3, 0 - bl sub_81D2C68 - mov r1, r8 - adds r1, 0x1 - adds r1, r4 - strb r0, [r1] - adds r0, r7, 0 - adds r1, r6, 0 - movs r2, 0x21 - movs r3, 0 - bl sub_81D2C68 - mov r1, r8 - adds r1, 0x2 - adds r1, r4 - strb r0, [r1] - adds r0, r7, 0 - adds r1, r6, 0 - movs r2, 0x18 - movs r3, 0 - bl sub_81D2C68 - mov r1, r8 - adds r1, 0x3 - adds r1, r4 - strb r0, [r1] - adds r0, r7, 0 - adds r1, r6, 0 - movs r2, 0x17 - movs r3, 0 - bl sub_81D2C68 - mov r1, r8 - adds r1, 0x4 - adds r1, r4 - strb r0, [r1] - mov r4, r10 - add r4, r9 - adds r0, r7, 0 - adds r1, r6, 0 - movs r2, 0x30 - movs r3, 0 - bl sub_81D2C68 - cmp r0, 0xFF - beq _081D3044 - adds r0, r7, 0 - adds r1, r6, 0 - movs r2, 0x30 - movs r3, 0 - bl sub_81D2C68 - movs r1, 0x1D - bl __udivsi3 - b _081D3046 -_081D3044: - movs r0, 0x9 -_081D3046: - strb r0, [r4] - mov r0, r9 - adds r1, r5, r0 - mov r2, r8 - adds r0, r2, r1 - lsls r1, 2 - adds r1, 0x14 - add r1, r8 - bl sub_81D2754 - b _081D3086 -_081D305C: - movs r2, 0 - mov r0, r9 - lsls r5, r0, 2 - adds r1, r5, r0 - movs r6, 0 - lsls r3, r1, 2 - movs r5, 0x9B - movs r4, 0x5B -_081D306C: - adds r0, r2, r1 - add r0, r8 - strb r6, [r0] - lsls r0, r2, 2 - adds r0, r3 - add r0, r8 - strh r5, [r0, 0x14] - strh r4, [r0, 0x16] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x4 - bls _081D306C -_081D3086: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81D2F78 - - thumb_func_start sub_81D3094 -sub_81D3094: @ 81D3094 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - mov r8, r0 - mov r9, r1 - ldr r0, [sp, 0x20] - ldr r1, [sp, 0x24] - ldr r4, [sp, 0x28] - lsls r2, 16 - lsrs r7, r2, 16 - lsls r3, 16 - lsrs r5, r3, 16 - lsls r0, 16 - lsrs r2, r0, 16 - lsls r1, 16 - lsrs r0, r1, 16 - lsls r4, 24 - cmp r4, 0 - bne _081D30C4 - subs r0, 0x1 - lsls r0, 16 - lsrs r0, 16 -_081D30C4: - cmp r2, r0 - beq _081D311A - adds r0, r7, 0 - adds r1, r5, 0 - movs r2, 0x41 - movs r3, 0 - bl sub_81D2C68 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r7, 0 - adds r1, r5, 0 - movs r2, 0x1 - movs r3, 0 - bl sub_81D2C68 - adds r6, r0, 0 - adds r0, r7, 0 - adds r1, r5, 0 - movs r2, 0 - movs r3, 0 - bl sub_81D2C68 - adds r5, r0, 0 - lsls r0, r4, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - movs r1, 0x1 - str r1, [sp] - mov r1, r8 - adds r2, r4, 0 - adds r3, r5, 0 - bl DecompressMonPic - adds r0, r4, 0 - adds r1, r6, 0 - adds r2, r5, 0 - bl species_and_otid_get_pal - mov r1, r9 - bl LZ77UnCompWram -_081D311A: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D3094 - - thumb_func_start sub_81D312C -sub_81D312C: @ 81D312C - push {lr} - adds r1, r0, 0 - ldrh r0, [r1] - adds r0, 0x18 - strh r0, [r1] - lsls r0, 16 - cmp r0, 0 - ble _081D3140 - movs r0, 0 - strh r0, [r1] -_081D3140: - movs r0, 0 - ldrsh r1, [r1, r0] - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - pop {r1} - bx r1 - thumb_func_end sub_81D312C - - thumb_func_start sub_81D3150 -sub_81D3150: @ 81D3150 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1] - subs r0, 0x18 - strh r0, [r1] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x50 - negs r2, r2 - cmp r0, r2 - bge _081D3168 - strh r2, [r1] -_081D3168: - movs r0, 0 - ldrsh r1, [r1, r0] - eors r1, r2 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - pop {r1} - bx r1 - thumb_func_end sub_81D3150 - - thumb_func_start sub_81D3178 -sub_81D3178: @ 81D3178 - push {r4,r5,lr} - adds r5, r1, 0 - bl sub_81D2074 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - bl sub_81D312C - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - cmp r4, 0 - bne _081D319A - cmp r0, 0 - beq _081D319C -_081D319A: - movs r1, 0x1 -_081D319C: - adds r0, r1, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81D3178 - - thumb_func_start sub_81D31A4 -sub_81D31A4: @ 81D31A4 - push {r4,r5,lr} - adds r5, r1, 0 - bl sub_81D2074 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - bl sub_81D3150 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - cmp r4, 0 - bne _081D31C6 - cmp r0, 0 - beq _081D31C8 -_081D31C6: - movs r1, 0x1 -_081D31C8: - adds r0, r1, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81D31A4 - - thumb_func_start sub_81D31D0 -sub_81D31D0: @ 81D31D0 - push {r4-r7,lr} - sub sp, 0x20 - ldr r3, =gUnknown_08625A48 - ldr r4, [r3] - ldr r5, [r3, 0x4] - str r4, [sp, 0x18] - str r5, [sp, 0x1C] - mov r4, sp - ldr r3, =gUnknown_08625A50 - ldm r3!, {r5-r7} - stm r4!, {r5-r7} - ldm r3!, {r5-r7} - stm r4!, {r5-r7} - ldr r3, =gUnknown_08625A68 - ldr r4, [r3, 0x4] - ldr r3, [r3] - ldr r5, [sp, 0x18] - ldr r6, [sp, 0x1C] - str r5, [r0] - str r6, [r0, 0x4] - mov r0, sp - ldm r0!, {r5-r7} - stm r1!, {r5-r7} - ldm r0!, {r5-r7} - stm r1!, {r5-r7} - str r3, [r2] - str r4, [r2, 0x4] - add sp, 0x20 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D31D0 - - thumb_func_start sub_81D321C -sub_81D321C: @ 81D321C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x50 - adds r5, r0, 0 - mov r12, r1 - mov r8, r2 - mov r1, sp - ldr r0, =gUnknown_08625A70 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2,r6,r7} - stm r1!, {r2,r6,r7} - ldm r0!, {r3,r4} - stm r1!, {r3,r4} - add r3, sp, 0x20 - adds r1, r3, 0 - ldr r0, =gUnknown_08625A90 - ldm r0!, {r2,r6,r7} - stm r1!, {r2,r6,r7} - ldm r0!, {r4,r6,r7} - stm r1!, {r4,r6,r7} - add r2, sp, 0x38 - adds r1, r2, 0 - ldr r0, =gUnknown_08625AA8 - ldm r0!, {r4,r6,r7} - stm r1!, {r4,r6,r7} - ldm r0!, {r4,r6,r7} - stm r1!, {r4,r6,r7} - movs r4, 0 -_081D3258: - lsls r0, r4, 3 - add r0, sp - ldr r1, [r0, 0x4] - ldr r0, [r0] - stm r5!, {r0,r1} - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _081D3258 - mov r1, r12 - adds r0, r2, 0 - ldm r0!, {r2,r4,r5} - stm r1!, {r2,r4,r5} - ldm r0!, {r2,r6,r7} - stm r1!, {r2,r6,r7} - movs r4, 0 -_081D327A: - lsls r0, r4, 3 - adds r0, r3, r0 - ldr r1, [r0, 0x4] - ldr r0, [r0] - mov r5, r8 - adds r5, 0x8 - mov r8, r5 - subs r5, 0x8 - stm r5!, {r0,r1} - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _081D327A - add sp, 0x50 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D321C - - thumb_func_start sub_81D32B0 -sub_81D32B0: @ 81D32B0 - push {r4,r5,lr} - ldr r2, =gUnknown_08625AC0 - ldr r4, [r2] - ldr r5, [r2, 0x4] - ldr r2, =gUnknown_08625AC8 - ldr r3, [r2, 0x4] - ldr r2, [r2] - str r4, [r0] - str r5, [r0, 0x4] - str r2, [r1] - str r3, [r1, 0x4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D32B0 - - thumb_func_start sub_81D32D4 -sub_81D32D4: @ 81D32D4 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x30] - adds r0, 0x1 - strh r0, [r1, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3C - ble _081D32F0 - movs r0, 0 - strh r0, [r1, 0x30] - adds r0, r1, 0 - bl sub_81D3408 -_081D32F0: - pop {r0} - bx r0 - thumb_func_end sub_81D32D4 - - thumb_func_start sub_81D32F4 -sub_81D32F4: @ 81D32F4 - push {lr} - adds r2, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _081D330C - movs r0, 0 - strh r0, [r2, 0x30] - ldr r0, =sub_81D32D4 - str r0, [r2, 0x1C] -_081D330C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D32F4 - - thumb_func_start sub_81D3314 -sub_81D3314: @ 81D3314 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x36 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r3, r1, r0 - cmp r3, 0 - beq _081D3360 - ldrh r1, [r3, 0x24] - ldrh r2, [r3, 0x20] - adds r1, r2 - ldr r2, =gUnknown_08625B2C - movs r5, 0x2E - ldrsh r0, [r4, r5] - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0] - adds r0, r1 - strh r0, [r4, 0x20] - ldrh r1, [r3, 0x26] - ldrh r3, [r3, 0x22] - adds r1, r3 - movs r3, 0x2E - ldrsh r0, [r4, r3] - lsls r0, 2 - adds r2, 0x2 - adds r0, r2 - ldrh r0, [r0] - adds r0, r1 - b _081D337E - .pool -_081D3360: - ldr r1, =gUnknown_08625B2C - movs r5, 0x2E - ldrsh r0, [r4, r5] - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0] - adds r0, 0x28 - strh r0, [r4, 0x20] - movs r2, 0x2E - ldrsh r0, [r4, r2] - lsls r0, 2 - adds r1, 0x2 - adds r0, r1 - ldrh r0, [r0] - adds r0, 0x68 -_081D337E: - strh r0, [r4, 0x22] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D3314 - - thumb_func_start sub_81D338C -sub_81D338C: @ 81D338C - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r8, r2 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - movs r5, 0 -_081D339E: - lsls r0, r5, 2 - mov r1, r8 - adds r4, r0, r1 - ldr r0, [r4] - cmp r0, 0 - beq _081D33F0 - strh r5, [r0, 0x2E] - ldr r1, [r4] - lsls r0, r5, 4 - adds r0, 0x1 - strh r0, [r1, 0x30] - ldr r0, [r4] - strh r6, [r0, 0x32] - ldr r0, [r4] - strh r5, [r0, 0x34] - cmp r7, 0 - beq _081D33C4 - cmp r6, 0x9 - beq _081D33D0 -_081D33C4: - ldr r1, [r4] - ldr r0, =sub_81D3564 - str r0, [r1, 0x1C] - b _081D33F0 - .pool -_081D33D0: - ldr r0, [r4] - bl sub_81D3314 - ldr r0, [r4] - bl sub_81D35E8 - ldr r2, [r4] - ldr r0, =sub_81D32F4 - str r0, [r2, 0x1C] - adds r2, 0x3E - ldrb r0, [r2] - movs r3, 0x5 - negs r3, r3 - adds r1, r3, 0 - ands r0, r1 - strb r0, [r2] -_081D33F0: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x9 - bls _081D339E - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D338C - - thumb_func_start sub_81D3408 -sub_81D3408: @ 81D3408 - push {r4-r7,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x38] - lsls r0, 24 - lsrs r2, r0, 24 - movs r3, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - adds r0, 0x1 - cmp r3, r0 - bge _081D3454 - ldr r5, =0x02020630 - movs r7, 0x1C - adds r7, r5 - mov r12, r7 - ldr r6, =sub_81D3564 -_081D3428: - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r2, r1, r5 - movs r7, 0x2E - ldrsh r0, [r2, r7] - lsls r0, 4 - adds r0, 0x1 - strh r0, [r2, 0x30] - add r1, r12 - str r6, [r1] - ldrh r0, [r2, 0x38] - lsls r0, 24 - lsrs r2, r0, 24 - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - movs r1, 0x32 - ldrsh r0, [r4, r1] - adds r0, 0x1 - cmp r3, r0 - blt _081D3428 -_081D3454: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D3408 - - thumb_func_start sub_81D3464 -sub_81D3464: @ 81D3464 - push {lr} - adds r2, r0, 0 - movs r1, 0 - movs r3, 0 -_081D346C: - lsls r0, r1, 2 - adds r0, r2 - str r3, [r0] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x9 - bls _081D346C - pop {r0} - bx r0 - thumb_func_end sub_81D3464 - - thumb_func_start sub_81D3480 -sub_81D3480: @ 81D3480 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r8, r0 - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - lsls r2, 24 - movs r0, 0 - mov r9, r0 - lsrs r7, r2, 24 - movs r5, 0 - adds r0, r7, 0x1 - cmp r9, r0 - bge _081D34FE -_081D34A2: - ldr r0, =gUnknown_08625B14 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r3, r0, 24 - adds r6, r3, 0 - cmp r3, 0x40 - beq _081D34FE - lsls r0, r5, 2 - mov r1, r8 - adds r4, r0, r1 - lsls r0, r3, 4 - adds r0, r3 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - str r0, [r4] - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r4] - mov r1, r10 - strh r1, [r0, 0x36] - cmp r5, 0 - beq _081D34F0 - subs r0, r4, 0x4 - ldr r0, [r0] - strh r3, [r0, 0x38] - b _081D34F2 - .pool -_081D34F0: - mov r9, r6 -_081D34F2: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r7, 0x1 - cmp r5, r0 - blt _081D34A2 -_081D34FE: - lsls r0, r7, 2 - add r0, r8 - ldr r0, [r0] - mov r1, r9 - strh r1, [r0, 0x38] - adds r0, r7, 0 - movs r1, 0x1 - mov r2, r8 - bl sub_81D338C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81D3480 - - thumb_func_start sub_81D3520 -sub_81D3520: @ 81D3520 - push {r4-r6,lr} - adds r6, r0, 0 - movs r5, 0 -_081D3526: - cmp r5, 0x9 - bhi _081D3544 - lsls r0, r5, 2 - adds r4, r0, r6 - ldr r0, [r4] - cmp r0, 0 - beq _081D3544 - bl RemoveObjectAndFreeTiles - movs r0, 0 - str r0, [r4] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - b _081D3526 -_081D3544: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81D3520 - - thumb_func_start sub_81D354C -sub_81D354C: @ 81D354C - push {lr} - bl sub_81D3520 - movs r0, 0x68 - bl FreeObjectTilesByTag - movs r0, 0x68 - bl FreeObjectPaletteByTag - pop {r0} - bx r0 - thumb_func_end sub_81D354C - - thumb_func_start sub_81D3564 -sub_81D3564: @ 81D3564 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x30] - movs r2, 0x30 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _081D3592 - subs r0, r1, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - cmp r0, 0 - bne _081D35DC - adds r0, r4, 0 - movs r1, 0 - bl SeekObjectImageAnim - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_081D3592: - adds r0, r4, 0 - bl sub_81D3314 - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _081D35DC - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x34 - ldrsh r1, [r4, r0] - movs r2, 0x32 - ldrsh r0, [r4, r2] - cmp r1, r0 - bne _081D35D8 - cmp r1, 0x9 - bne _081D35D0 - adds r0, r4, 0 - bl sub_81D35E8 - ldr r0, =sub_81D32F4 - b _081D35DA - .pool -_081D35D0: - ldr r0, =sub_81D32D4 - b _081D35DA - .pool -_081D35D8: - ldr r0, =DummyObjectCallback -_081D35DA: - str r0, [r4, 0x1C] -_081D35DC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D3564 - - thumb_func_start sub_81D35E8 -sub_81D35E8: @ 81D35E8 - push {r4-r7,lr} - adds r6, r0, 0 - ldrh r0, [r6, 0x38] - lsls r0, 24 - lsrs r1, r0, 24 - movs r5, 0 - movs r2, 0x32 - ldrsh r0, [r6, r2] - adds r0, 0x1 - cmp r5, r0 - bge _081D3636 - movs r0, 0x5 - negs r0, r0 - adds r7, r0, 0 -_081D3604: - lsls r4, r1, 4 - adds r4, r1 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0 - bl SeekObjectImageAnim - adds r1, r4, 0 - adds r1, 0x3E - ldrb r0, [r1] - ands r0, r7 - strb r0, [r1] - ldrh r0, [r4, 0x38] - lsls r0, 24 - lsrs r1, r0, 24 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - movs r2, 0x32 - ldrsh r0, [r6, r2] - adds r0, 0x1 - cmp r5, r0 - blt _081D3604 -_081D3636: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D35E8 - - thumb_func_start sub_81D3640 -sub_81D3640: @ 81D3640 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x2C - mov r8, r0 - adds r6, r1, 0 - adds r5, r2, 0 - adds r4, r3, 0 - ldr r3, [sp, 0x4C] - ldr r0, [sp, 0x50] - mov r9, r0 - lsls r4, 24 - lsrs r4, 24 - lsls r3, 24 - lsrs r3, 24 - mov r1, r9 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, r4, 4 - orrs r1, r4 - lsls r1, 24 - lsrs r1, 24 - str r3, [sp, 0x28] - bl FillWindowPixelBuffer - add r2, sp, 0xC - ldrh r0, [r5] - ldrh r1, [r6] - subs r0, r1 - strh r0, [r2] - ldrh r0, [r5, 0x2] - ldrh r1, [r6, 0x2] - subs r0, r1 - strh r0, [r2, 0x2] - ldrh r0, [r5, 0x4] - ldrh r1, [r6, 0x4] - subs r0, r1 - strh r0, [r2, 0x4] - ldrh r0, [r5, 0x8] - ldrh r1, [r6, 0x8] - subs r0, r1 - strh r0, [r2, 0x6] - ldrh r0, [r5, 0xA] - ldrh r1, [r6, 0xA] - subs r0, r1 - strh r0, [r2, 0x8] - ldrh r0, [r5, 0x6] - ldrh r1, [r6, 0x6] - subs r0, r1 - strh r0, [r2, 0xA] - add r0, sp, 0x24 - strb r4, [r0] - ldr r3, [sp, 0x28] - strb r3, [r0, 0x1] - mov r1, r9 - strb r1, [r0, 0x2] - movs r7, 0 - mov r10, r0 - movs r0, 0x1 - negs r0, r0 - mov r9, r0 - add r6, sp, 0x18 -_081D36CA: - lsls r0, r7, 4 - subs r0, r7 - lsls r0, 24 - lsrs r5, r0, 24 - mov r1, r10 - str r1, [sp] - mov r0, r9 - str r0, [sp, 0x4] - ldr r1, =gUnknown_08625B54 - lsls r0, r7, 2 - adds r0, r1 - ldr r0, [r0] - str r0, [sp, 0x8] - mov r0, r8 - movs r1, 0x1 - movs r2, 0 - adds r3, r5, 0 - bl box_print - lsls r0, r7, 1 - mov r4, sp - adds r4, r0 - adds r4, 0xC - movs r1, 0 - ldrsh r0, [r4, r1] - ldr r1, =gUnknown_085EEA76 - cmp r0, 0 - blt _081D3704 - ldr r1, =gUnknown_085EEA73 -_081D3704: - adds r0, r6, 0 - bl CopyString - mov r0, r10 - str r0, [sp] - mov r1, r9 - str r1, [sp, 0x4] - str r6, [sp, 0x8] - mov r0, r8 - movs r1, 0x1 - movs r2, 0x38 - adds r3, r5, 0 - bl box_print - movs r0, 0 - ldrsh r1, [r4, r0] - adds r0, r1, 0 - cmp r1, 0 - bge _081D372C - negs r0, r1 -_081D372C: - movs r4, 0xC - cmp r0, 0x9 - bgt _081D3734 - movs r4, 0x12 -_081D3734: - cmp r1, 0 - bge _081D373A - negs r1, r1 -_081D373A: - adds r0, r6, 0 - movs r2, 0 - movs r3, 0x2 - bl ConvertIntToDecimalString - adds r2, r4, 0 - adds r2, 0x38 - mov r1, r10 - str r1, [sp] - mov r0, r9 - str r0, [sp, 0x4] - str r6, [sp, 0x8] - mov r0, r8 - movs r1, 0x1 - adds r3, r5, 0 - bl box_print - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r7, 0x5 - bls _081D36CA - add sp, 0x2C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D3640 - - thumb_func_start sub_81D3784 -sub_81D3784: @ 81D3784 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x2C - mov r8, r0 - adds r5, r1, 0 - adds r4, r2, 0 - adds r6, r3, 0 - ldr r2, [sp, 0x4C] - lsls r4, 24 - lsrs r4, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, r4, 4 - orrs r1, r4 - lsls r1, 24 - lsrs r1, 24 - str r2, [sp, 0x28] - bl FillWindowPixelBuffer - add r1, sp, 0xC - ldrh r0, [r5] - strh r0, [r1] - ldrh r0, [r5, 0x2] - strh r0, [r1, 0x2] - ldrh r0, [r5, 0x4] - strh r0, [r1, 0x4] - ldrh r0, [r5, 0x8] - strh r0, [r1, 0x6] - ldrh r0, [r5, 0xA] - strh r0, [r1, 0x8] - ldrh r0, [r5, 0x6] - strh r0, [r1, 0xA] - add r0, sp, 0x24 - strb r4, [r0] - strb r6, [r0, 0x1] - ldr r2, [sp, 0x28] - strb r2, [r0, 0x2] - movs r6, 0 - add r1, sp, 0x18 - mov r9, r1 - mov r7, r8 - mov r10, r0 - movs r2, 0x1 - negs r2, r2 - mov r8, r2 -_081D37EE: - lsls r1, r6, 1 - mov r0, sp - adds r0, r1 - adds r0, 0xC - movs r2, 0 - ldrsh r0, [r0, r2] - movs r4, 0x3 - cmp r0, 0x63 - bgt _081D3808 - movs r4, 0x1 - cmp r0, 0x9 - ble _081D3808 - movs r4, 0x2 -_081D3808: - mov r0, sp - adds r0, r1 - adds r0, 0xC - movs r2, 0 - ldrsh r1, [r0, r2] - mov r0, r9 - movs r2, 0 - adds r3, r4, 0 - bl ConvertIntToDecimalString - movs r0, 0x4 - subs r0, r4 - lsls r4, r0, 1 - adds r4, r0 - lsls r4, 17 - lsrs r4, 16 - lsls r5, r6, 4 - subs r5, r6 - lsls r5, 24 - lsrs r5, 24 - mov r0, r10 - str r0, [sp] - mov r1, r8 - str r1, [sp, 0x4] - ldr r1, =gUnknown_08625B54 - lsls r0, r6, 2 - adds r0, r1 - ldr r0, [r0] - str r0, [sp, 0x8] - adds r0, r7, 0 - movs r1, 0x1 - movs r2, 0 - adds r3, r5, 0 - bl box_print - adds r4, 0x38 - lsls r4, 24 - lsrs r4, 24 - mov r2, r10 - str r2, [sp] - mov r0, r8 - str r0, [sp, 0x4] - mov r1, r9 - str r1, [sp, 0x8] - adds r0, r7, 0 - movs r1, 0x1 - adds r2, r4, 0 - adds r3, r5, 0 - bl box_print - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x5 - bls _081D37EE - add sp, 0x2C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D3784 - - thumb_func_start sub_81D388C -sub_81D388C: @ 81D388C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r1, 0x3A - bl pokemon_getattr - strh r0, [r5] - adds r0, r4, 0 - movs r1, 0x3B - bl pokemon_getattr - strh r0, [r5, 0x2] - adds r0, r4, 0 - movs r1, 0x3C - bl pokemon_getattr - strh r0, [r5, 0x4] - adds r0, r4, 0 - movs r1, 0x3D - bl pokemon_getattr - strh r0, [r5, 0x6] - adds r0, r4, 0 - movs r1, 0x3E - bl pokemon_getattr - strh r0, [r5, 0x8] - adds r0, r4, 0 - movs r1, 0x3F - bl pokemon_getattr - strh r0, [r5, 0xA] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81D388C - - thumb_func_start sub_81D38D4 -sub_81D38D4: @ 81D38D4 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003d6d - adds r0, r1 - ldrb r1, [r0] - adds r2, r1, 0x1 - adds r0, r2, 0 - asrs r0, 8 - lsls r0, 8 - subs r0, r2, r0 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D38D4 - - thumb_func_start sub_81D38FC -sub_81D38FC: @ 81D38FC - push {r4,r5,lr} - adds r4, r0, 0 - movs r5, 0x9C - lsls r5, 2 - adds r1, r5, 0 - bl sub_806F96C - adds r4, r5 - ldr r1, [r4] - cmp r0, r1 - bne _081D3916 - movs r0, 0x1 - b _081D3918 -_081D3916: - movs r0, 0 -_081D3918: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81D38FC - - thumb_func_start sub_81D3920 -sub_81D3920: @ 81D3920 - push {r4-r7,lr} - adds r7, r0, 0 - ldrb r6, [r7] - subs r0, r6, 0x1 - cmp r0, 0x7 - bhi _081D3964 - movs r5, 0 - cmp r5, r6 - bcs _081D394C - adds r4, r7, 0 - adds r4, 0x8 -_081D3936: - adds r0, r4, 0 - bl sub_81D38FC - cmp r0, 0 - beq _081D3964 - movs r0, 0x9D - lsls r0, 2 - adds r4, r0 - adds r5, 0x1 - cmp r5, r6 - bcc _081D3936 -_081D394C: - adds r0, r7, 0 - adds r0, 0x8 - movs r1, 0x9D - lsls r1, 2 - muls r1, r6 - bl sub_806F96C - ldr r1, [r7, 0x4] - cmp r0, r1 - bne _081D3964 - movs r0, 0x1 - b _081D3966 -_081D3964: - movs r0, 0 -_081D3966: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81D3920 - - thumb_func_start sub_81D396C -sub_81D396C: @ 81D396C - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4] - subs r0, 0x1 - cmp r0, 0x7 - bhi _081D398E - adds r0, r4, 0 - adds r0, 0x8 - movs r1, 0xEE - lsls r1, 4 - bl sub_806F96C - ldr r1, [r4, 0x4] - cmp r0, r1 - bne _081D398E - movs r0, 0x1 - b _081D3990 -_081D398E: - movs r0, 0 -_081D3990: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81D396C - - thumb_func_start sub_81D3998 -sub_81D3998: @ 81D3998 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r7, r0, 0 - mov r8, r1 - movs r2, 0x80 - lsls r2, 5 - mov r0, r8 - movs r1, 0 - bl memset - ldrb r0, [r7] - mov r1, r8 - strb r0, [r1] - bl sub_81D38D4 - mov r2, r8 - strb r0, [r2, 0x1] - ldrb r0, [r7] - adds r0, 0x1 - asrs r0, 1 - strb r0, [r2, 0x2] - movs r6, 0 - b _081D3A42 -_081D39C8: - movs r0, 0x1 - ands r0, r6 - cmp r0, 0 - bne _081D3A14 - lsrs r0, r6, 31 - adds r0, r6, r0 - asrs r0, 1 - lsls r4, r0, 4 - subs r4, r0 - lsls r4, 3 - subs r4, r0 - lsls r4, 3 - add r4, r8 - movs r0, 0x9D - lsls r0, 2 - adds r5, r6, 0 - muls r5, r0 - adds r5, r7, r5 - ldrb r0, [r5, 0x8] - strb r0, [r4, 0x8] - movs r1, 0xA7 - lsls r1, 2 - adds r0, r4, r1 - movs r2, 0xAA - lsls r2, 1 - adds r1, r5, r2 - subs r2, 0x30 - bl memcpy - adds r4, 0xC - adds r5, 0xC - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0xA4 - lsls r2, 1 - bl memcpy - b _081D3A40 -_081D3A14: - lsrs r1, r6, 31 - adds r1, r6, r1 - asrs r1, 1 - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 3 - subs r0, r1 - lsls r0, 3 - add r0, r8 - movs r1, 0x9D - lsls r1, 2 - muls r1, r6 - adds r1, r7, r1 - ldrb r2, [r1, 0x8] - strb r2, [r0, 0x9] - movs r2, 0xAA - lsls r2, 1 - adds r0, r2 - adds r1, 0xC - subs r2, 0xC - bl memcpy -_081D3A40: - adds r6, 0x1 -_081D3A42: - ldrb r0, [r7] - cmp r6, r0 - blt _081D39C8 - movs r0, 0x1 - ands r0, r6 - cmp r0, 0 - beq _081D3A7E - lsrs r2, r6, 31 - adds r2, r6, r2 - asrs r2, 1 - lsls r0, r2, 4 - subs r0, r2 - lsls r0, 3 - subs r0, r2 - lsls r0, 3 - add r0, r8 - movs r1, 0xAA - lsls r1, 1 - adds r0, r1 - ldr r3, =gUnknown_08625B6C - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r2 - lsls r1, 3 - adds r1, r3 - movs r2, 0xA4 - lsls r2, 1 - bl memcpy -_081D3A7E: - mov r0, r8 - adds r0, 0x8 - movs r1, 0xEE - lsls r1, 4 - bl sub_806F96C - mov r2, r8 - str r0, [r2, 0x4] - movs r0, 0x1E - mov r1, r8 - bl sub_8153634 - cmp r0, 0x1 - bne _081D3AA4 - movs r0, 0x1 - b _081D3AA6 - .pool -_081D3AA4: - movs r0, 0 -_081D3AA6: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81D3998 - - thumb_func_start sub_81D3AB0 -sub_81D3AB0: @ 81D3AB0 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x80 - lsls r0, 5 - bl AllocZeroed - adds r5, r0, 0 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_81D3998 - adds r4, r0, 0 - adds r0, r5, 0 - bl Free - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81D3AB0 - - thumb_func_start sub_81D3AD8 -sub_81D3AD8: @ 81D3AD8 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - movs r0, 0x1E - bl sub_81535DC - cmp r0, 0x1 - bne _081D3B04 - ldr r2, =0x00000ee8 - adds r0, r5, 0 - adds r1, r4, 0 - bl memcpy - adds r0, r5, 0 - bl sub_81D396C - cmp r0, 0 - beq _081D3B04 - movs r0, 0x1 - b _081D3B06 - .pool -_081D3B04: - movs r0, 0 -_081D3B06: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81D3AD8 - - thumb_func_start sub_81D3B0C -sub_81D3B0C: @ 81D3B0C - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x80 - lsls r0, 5 - bl AllocZeroed - adds r5, r0, 0 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_81D3AD8 - adds r4, r0, 0 - adds r0, r5, 0 - bl Free - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81D3B0C - - thumb_func_start sub_81D3B34 -sub_81D3B34: @ 81D3B34 - push {r4,r5,lr} - movs r0, 0x80 - lsls r0, 5 - bl AllocZeroed - adds r4, r0, 0 - bl sub_81D3B0C - adds r5, r0, 0 - adds r0, r4, 0 - bl Free - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81D3B34 - - thumb_func_start sub_81D3B54 -sub_81D3B54: @ 81D3B54 - push {r4-r7,lr} - sub sp, 0x4 - adds r6, r0, 0 - adds r5, r1, 0 - bl sub_81D41A0 - movs r7, 0x2 - ldr r4, =0x03003144 -_081D3B64: - bl sub_81D4170 - ldr r0, =0x030012e2 - ldrh r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081D3B76 - strb r7, [r4] -_081D3B76: - movs r0, 0x1 - adds r1, r6, 0 - adds r2, r5, 0 - movs r3, 0 - bl sub_81D3D70 - adds r1, r0, 0 - ldr r0, =0x030012e4 - strh r1, [r0] - movs r0, 0x13 - ands r0, r1 - cmp r0, 0x10 - bne _081D3BA0 - movs r4, 0 - b _081D3BC2 - .pool -_081D3BA0: - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _081D3BAC - movs r4, 0x1 - b _081D3BC2 -_081D3BAC: - movs r0, 0x4 - ands r0, r1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _081D3BC0 - strb r0, [r4] - bl VBlankIntrWait - b _081D3B64 -_081D3BC0: - movs r4, 0x2 -_081D3BC2: - movs r0, 0 - str r0, [sp] - ldr r1, =0x030012c8 - ldr r2, =0x05000006 - mov r0, sp - bl CpuSet - bl sub_81D41F4 - adds r0, r4, 0 - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D3B54 - - thumb_func_start sub_81D3BE8 -sub_81D3BE8: @ 81D3BE8 - push {r4-r6,lr} - sub sp, 0x4 - adds r5, r0, 0 - bl sub_81D41A0 - movs r6, 0x2 - ldr r4, =0x03003144 -_081D3BF6: - bl sub_81D4170 - ldr r0, =0x030012e2 - ldrh r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081D3C08 - strb r6, [r4] -_081D3C08: - movs r0, 0 - movs r1, 0 - movs r2, 0 - adds r3, r5, 0 - bl sub_81D3D70 - adds r1, r0, 0 - ldr r0, =0x030012e4 - strh r1, [r0] - movs r0, 0x13 - ands r0, r1 - cmp r0, 0x10 - bne _081D3C34 - movs r4, 0 - b _081D3C56 - .pool -_081D3C34: - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _081D3C40 - movs r4, 0x1 - b _081D3C56 -_081D3C40: - movs r0, 0x4 - ands r0, r1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _081D3C54 - strb r0, [r4] - bl VBlankIntrWait - b _081D3BF6 -_081D3C54: - movs r4, 0x2 -_081D3C56: - movs r0, 0 - str r0, [sp] - ldr r1, =0x030012c8 - ldr r2, =0x05000006 - mov r0, sp - bl CpuSet - bl sub_81D41F4 - adds r0, r4, 0 - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D3BE8 - - thumb_func_start sub_81D3C7C -sub_81D3C7C: @ 81D3C7C - push {r4,lr} - ldr r4, =0x04000208 - movs r3, 0 - strh r3, [r4] - ldr r2, =0x04000200 - ldrh r1, [r2] - ldr r0, =0x0000ff3f - ands r0, r1 - strh r0, [r2] - movs r0, 0x1 - strh r0, [r4] - ldr r0, =0x04000128 - strh r3, [r0] - subs r0, 0x1A - strh r3, [r0] - ldr r1, =0x04000202 - movs r0, 0xC0 - strh r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D3C7C - - thumb_func_start sub_81D3CBC -sub_81D3CBC: @ 81D3CBC - push {r4-r7,lr} - sub sp, 0x4 - ldr r5, =0x04000208 - movs r4, 0 - strh r4, [r5] - ldr r3, =0x04000200 - ldrh r1, [r3] - ldr r0, =0x0000ff3f - ands r0, r1 - strh r0, [r3] - movs r6, 0x1 - strh r6, [r5] - ldr r0, =0x04000134 - strh r4, [r0] - ldr r2, =0x04000128 - movs r1, 0x80 - lsls r1, 6 - adds r0, r1, 0 - strh r0, [r2] - ldrh r0, [r2] - ldr r7, =0x00004003 - adds r1, r7, 0 - orrs r0, r1 - strh r0, [r2] - strh r4, [r5] - ldrh r0, [r3] - movs r1, 0x80 - orrs r0, r1 - strh r0, [r3] - strh r6, [r5] - ldr r1, =0x030012c8 - ldrb r0, [r1, 0x1] - cmp r0, 0 - bne _081D3D0A - str r0, [sp] - ldr r2, =0x05000006 - mov r0, sp - bl CpuSet -_081D3D0A: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D3CBC - - thumb_func_start sub_81D3D34 -sub_81D3D34: @ 81D3D34 - ldr r0, =0x04000134 - movs r3, 0 - strh r3, [r0] - ldr r2, =0x04000128 - movs r1, 0xA0 - lsls r1, 7 - adds r0, r1, 0 - strh r0, [r2] - ldrh r0, [r2] - movs r1, 0x8 - orrs r0, r1 - strh r0, [r2] - ldr r0, =0x03003144 - strb r3, [r0] - ldr r0, =0x030012e6 - strh r3, [r0] - ldr r1, =0x030012e8 - movs r0, 0 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_81D3D34 - - thumb_func_start sub_81D3D70 -sub_81D3D70: @ 81D3D70 - push {r4-r6,lr} - adds r4, r1, 0 - adds r5, r2, 0 - adds r6, r3, 0 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x030012c8 - ldrb r0, [r0, 0x1] - cmp r0, 0x6 - bls _081D3D86 - b _081D3ECC -_081D3D86: - lsls r0, 2 - ldr r1, =_081D3D98 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081D3D98: - .4byte _081D3DB4 - .4byte _081D3DC8 - .4byte _081D3DE8 - .4byte _081D3DFC - .4byte _081D3E74 - .4byte _081D3E84 - .4byte _081D3EBC -_081D3DB4: - bl sub_81D3CBC - ldr r1, =0x030012c8 - movs r0, 0x1 - strb r0, [r1, 0x2] - strb r0, [r1, 0x1] - b _081D3ECC - .pool -_081D3DC8: - adds r0, r2, 0 - bl sub_81D3EE8 - lsls r0, 16 - cmp r0, 0 - beq _081D3DD8 - bl sub_81D413C -_081D3DD8: - ldr r0, =0x03003144 - ldrb r0, [r0] - cmp r0, 0x2 - beq _081D3DE2 - b _081D3ECC -_081D3DE2: - b _081D3E04 - .pool -_081D3DE8: - bl sub_81D3D34 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - bl sub_81D3F1C - ldr r1, =0x030012c8 - movs r0, 0x3 - strb r0, [r1, 0x1] -_081D3DFC: - ldr r0, =0x03003144 - ldrb r0, [r0] - cmp r0, 0x2 - bne _081D3E18 -_081D3E04: - ldr r1, =0x030012c8 - strb r0, [r1, 0x4] - movs r0, 0x6 - strb r0, [r1, 0x1] - b _081D3ECC - .pool -_081D3E18: - ldr r2, =0x030012e6 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - ldr r1, =0x030012e8 - ldr r0, [r1] - adds r3, r0, 0x1 - str r3, [r1] - ldr r1, =0x030012c8 - ldrb r0, [r1] - cmp r0, 0 - bne _081D3E3C - cmp r3, 0x3C - bls _081D3E3C - movs r0, 0x1 - strb r0, [r1, 0x4] - movs r0, 0x6 - strb r0, [r1, 0x1] -_081D3E3C: - ldr r4, =0x030012c8 - ldrb r0, [r4, 0x2] - cmp r0, 0x2 - beq _081D3ECC - ldrb r0, [r4] - cmp r0, 0 - beq _081D3E64 - ldrh r0, [r2] - cmp r0, 0x2 - bls _081D3E64 - bl sub_81D413C - movs r0, 0x2 - b _081D3ECA - .pool -_081D3E64: - bl sub_81D413C - ldr r1, =0x030012c8 - movs r0, 0x2 - strb r0, [r1, 0x2] - b _081D3ECC - .pool -_081D3E74: - bl sub_81D3CBC - ldr r1, =0x030012c8 - movs r0, 0x5 - strb r0, [r1, 0x1] - b _081D3ECC - .pool -_081D3E84: - ldr r0, =0x030012c8 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081D3E98 - ldr r0, =0x030012e6 - ldrh r0, [r0] - cmp r0, 0x2 - bls _081D3E98 - bl sub_81D413C -_081D3E98: - ldr r1, =0x030012e6 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x3C - bls _081D3ECC - ldr r0, =0x030012c8 - movs r1, 0x1 - strb r1, [r0, 0x4] - movs r1, 0x6 - strb r1, [r0, 0x1] - b _081D3ECC - .pool -_081D3EBC: - ldr r4, =0x030012c8 - ldrb r0, [r4, 0x2] - cmp r0, 0 - beq _081D3ECC - bl sub_81D3C7C - movs r0, 0 -_081D3ECA: - strb r0, [r4, 0x2] -_081D3ECC: - ldr r2, =0x030012c8 - ldrb r0, [r2, 0x2] - ldrb r1, [r2, 0x4] - lsls r1, 2 - orrs r0, r1 - ldrb r1, [r2, 0x3] - lsls r1, 4 - orrs r0, r1 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D3D70 - - thumb_func_start sub_81D3EE8 -sub_81D3EE8: @ 81D3EE8 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x04000128 - ldr r0, [r0] - movs r1, 0xC - ands r0, r1 - cmp r0, 0x8 - bne _081D3F0C - cmp r2, 0 - beq _081D3F0C - ldr r1, =0x030012c8 - movs r0, 0x1 - b _081D3F10 - .pool -_081D3F0C: - ldr r1, =0x030012c8 - movs r0, 0 -_081D3F10: - strb r0, [r1] - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D3EE8 - - thumb_func_start sub_81D3F1C -sub_81D3F1C: @ 81D3F1C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldr r3, =0x030012c8 - ldrb r0, [r3] - cmp r0, 0 - beq _081D3F54 - ldr r2, =0x04000128 - ldrh r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strh r0, [r2] - str r5, [r3, 0x8] - ldr r0, =0x04000120 - str r4, [r0] - lsrs r0, r4, 2 - adds r0, 0x1 - str r0, [r3, 0x10] - bl sub_81D3F68 - b _081D3F5C - .pool -_081D3F54: - ldr r1, =0x04000128 - ldrh r0, [r1] - strh r0, [r1] - str r2, [r3, 0x8] -_081D3F5C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D3F1C - - thumb_func_start sub_81D3F68 -sub_81D3F68: @ 81D3F68 - ldr r1, =0x0400010c - ldr r2, =0x0000fda7 - adds r0, r2, 0 - strh r0, [r1] - ldr r0, =0x0400010e - movs r2, 0x40 - strh r2, [r0] - ldr r3, =0x04000208 - movs r0, 0 - strh r0, [r3] - adds r1, 0xF4 - ldrh r0, [r1] - orrs r0, r2 - strh r0, [r1] - movs r0, 0x1 - strh r0, [r3] - bx lr - .pool - thumb_func_end sub_81D3F68 - - thumb_func_start sub_81D3F9C -sub_81D3F9C: @ 81D3F9C - push {lr} - bl sub_81D414C - bl sub_81D413C - pop {r0} - bx r0 - thumb_func_end sub_81D3F9C - - thumb_func_start sub_81D3FAC -sub_81D3FAC: @ 81D3FAC - push {r4-r6,lr} - sub sp, 0x8 - ldr r2, =0x030012c8 - ldrb r0, [r2, 0x1] - adds r3, r2, 0 - cmp r0, 0x3 - beq _081D4034 - cmp r0, 0x3 - bgt _081D3FC8 - cmp r0, 0x1 - beq _081D3FD0 - b _081D412A - .pool -_081D3FC8: - cmp r0, 0x5 - bne _081D3FCE - b _081D40FC -_081D3FCE: - b _081D412A -_081D3FD0: - ldr r1, =0x0400012a - ldr r2, =0x0000ccd0 - adds r0, r2, 0 - strh r0, [r1] - ldr r0, =0x04000120 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp] - str r1, [sp, 0x4] - movs r1, 0 - movs r2, 0 - movs r4, 0 - ldr r6, =0x0000ccd0 - ldr r5, =0x0000ffff -_081D3FEC: - lsls r0, r1, 1 - add r0, sp - ldrh r0, [r0] - cmp r0, r6 - bne _081D4010 - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - b _081D401A - .pool -_081D4010: - cmp r0, r5 - beq _081D401A - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 -_081D401A: - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x3 - bls _081D3FEC - cmp r2, 0x2 - beq _081D402A - b _081D412A -_081D402A: - cmp r4, 0 - beq _081D4030 - b _081D412A -_081D4030: - strb r2, [r3, 0x1] - b _081D412A -_081D4034: - ldr r0, =0x04000120 - ldr r4, [r0] - ldr r0, [r2, 0xC] - cmp r0, 0 - bne _081D404A - ldrb r0, [r2] - cmp r0, 0 - bne _081D404A - lsrs r0, r4, 2 - adds r0, 0x1 - str r0, [r2, 0x10] -_081D404A: - ldrb r0, [r3] - cmp r0, 0x1 - bne _081D4080 - ldr r1, [r3, 0xC] - ldr r0, [r3, 0x10] - cmp r1, r0 - bge _081D4074 - ldr r2, =0x04000120 - ldr r0, [r3, 0x8] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - str r0, [r2] - ldr r0, [r3, 0x14] - ldr r1, [r1] - adds r0, r1 - str r0, [r3, 0x14] - b _081D40BA - .pool -_081D4074: - ldr r1, =0x04000120 - ldr r0, [r3, 0x14] - b _081D40B8 - .pool -_081D4080: - ldr r1, [r3, 0xC] - cmp r1, 0 - ble _081D40A0 - ldr r0, [r3, 0x10] - adds r0, 0x1 - cmp r1, r0 - bge _081D40A0 - ldr r0, [r3, 0x8] - lsls r1, 2 - adds r1, r0 - subs r1, 0x4 - str r4, [r1] - ldr r0, [r3, 0x14] - adds r0, r4 - str r0, [r3, 0x14] - b _081D40B4 -_081D40A0: - ldr r0, [r3, 0xC] - cmp r0, 0 - beq _081D40B4 - ldr r0, [r3, 0x14] - cmp r0, r4 - bne _081D40B0 - movs r0, 0x1 - b _081D40B2 -_081D40B0: - movs r0, 0x2 -_081D40B2: - strb r0, [r3, 0x3] -_081D40B4: - ldr r1, =0x030012e8 - movs r0, 0 -_081D40B8: - str r0, [r1] -_081D40BA: - ldr r1, [r3, 0xC] - adds r1, 0x1 - str r1, [r3, 0xC] - ldr r0, [r3, 0x10] - adds r0, 0x2 - cmp r1, r0 - bge _081D40EA - ldrb r0, [r3] - cmp r0, 0 - beq _081D40E4 - ldr r0, =0x0400010e - ldrh r1, [r0] - movs r2, 0x80 - orrs r1, r2 - strh r1, [r0] - b _081D412A - .pool -_081D40E4: - bl sub_81D413C - b _081D412A -_081D40EA: - movs r0, 0 - movs r1, 0x4 - strb r1, [r3, 0x1] - ldr r1, =0x030012e6 - strh r0, [r1] - b _081D412A - .pool -_081D40FC: - ldrb r3, [r2] - cmp r3, 0 - bne _081D4108 - ldr r1, =0x0400012a - ldrb r0, [r2, 0x3] - strh r0, [r1] -_081D4108: - ldr r0, =0x04000120 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp] - str r1, [sp, 0x4] - mov r0, sp - ldrh r1, [r0, 0x2] - subs r0, r1, 0x1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _081D412A - cmp r3, 0x1 - bne _081D4126 - strb r1, [r2, 0x3] -_081D4126: - movs r0, 0x6 - strb r0, [r2, 0x1] -_081D412A: - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D3FAC - - thumb_func_start sub_81D413C -sub_81D413C: @ 81D413C - ldr r0, =0x04000128 - ldrh r1, [r0] - movs r2, 0x80 - orrs r1, r2 - strh r1, [r0] - bx lr - .pool - thumb_func_end sub_81D413C - - thumb_func_start sub_81D414C -sub_81D414C: @ 81D414C - ldr r2, =0x0400010e - ldrh r1, [r2] - ldr r0, =0x0000ff7f - ands r0, r1 - strh r0, [r2] - ldr r1, =0x0400010c - ldr r2, =0x0000fda7 - adds r0, r2, 0 - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_81D414C - - thumb_func_start sub_81D4170 -sub_81D4170: @ 81D4170 - push {r4,lr} - ldr r0, =0x04000130 - ldrh r0, [r0] - ldr r2, =0x000003ff - adds r1, r2, 0 - eors r1, r0 - ldr r4, =0x030012e2 - ldr r3, =0x030012e0 - ldrh r2, [r3] - adds r0, r1, 0 - bics r0, r2 - strh r0, [r4] - strh r1, [r3] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D4170 - - thumb_func_start sub_81D41A0 -sub_81D41A0: @ 81D41A0 - ldr r1, =0x030012ec - ldr r0, =0x04000208 - ldrh r0, [r0] - strh r0, [r1] - ldr r1, =0x030012ee - ldr r0, =0x04000200 - ldrh r0, [r0] - strh r0, [r1] - ldr r1, =0x030012f0 - ldr r0, =0x0400010e - ldrh r0, [r0] - strh r0, [r1] - ldr r1, =0x030012f2 - ldr r0, =0x04000128 - ldrh r0, [r0] - strh r0, [r1] - ldr r1, =0x030012f4 - ldr r0, =0x04000134 - ldrh r0, [r0] - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_81D41A0 - - thumb_func_start sub_81D41F4 -sub_81D41F4: @ 81D41F4 - ldr r1, =0x04000208 - ldr r0, =0x030012ec - ldrh r0, [r0] - strh r0, [r1] - subs r1, 0x8 - ldr r0, =0x030012ee - ldrh r0, [r0] - strh r0, [r1] - subs r1, 0xF2 - ldr r0, =0x030012f0 - ldrh r0, [r0] - strh r0, [r1] - adds r1, 0x1A - ldr r0, =0x030012f2 - ldrh r0, [r0] - strh r0, [r1] - adds r1, 0xC - ldr r0, =0x030012f4 - ldrh r0, [r0] - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_81D41F4 - - thumb_func_start sub_81D4238 -sub_81D4238: @ 81D4238 - push {lr} - sub sp, 0x4 - movs r0, 0 - str r0, [sp] - ldr r1, =0x030012c8 - ldr r2, =0x05000006 - mov r0, sp - bl CpuSet - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D4238 - - thumb_func_start sub_81D4258 -sub_81D4258: @ 81D4258 - push {lr} - sub sp, 0x4 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrb r1, [r0, 0x5] - ldrb r2, [r0, 0x4] - movs r0, 0x1 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - mov r0, sp - ldrb r0, [r0] - add sp, 0x4 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D4258 - - thumb_func_start sub_81D427C -sub_81D427C: @ 81D427C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - bl sub_81D4258 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r2, =0x02037350 - adds r5, r1, r2 - ldr r4, =0x030012f8 - ldr r3, =0x02037590 - ldrb r1, [r3, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x14] - ldrh r1, [r5, 0x10] - subs r0, r1 - strh r0, [r4] - ldr r4, =0x030012fa - ldrb r1, [r3, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x16] - ldrh r1, [r5, 0x12] - subs r0, r1 - strh r0, [r4] - movs r0, 0 - mov r8, r0 - ldr r2, =0x030012fc - movs r1, 0 -_081D42CA: - mov r3, r8 - adds r0, r3, r2 - strb r1, [r0] - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0x3 - bls _081D42CA - ldr r2, =0x02037350 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r2, r0, r2 - movs r4, 0x14 - ldrsh r1, [r2, r4] - movs r6, 0x10 - ldrsh r0, [r2, r6] - cmp r1, r0 - bne _081D4304 - movs r0, 0x16 - ldrsh r1, [r2, r0] - movs r3, 0x12 - ldrsh r0, [r2, r3] - cmp r1, r0 - beq _081D4356 -_081D4304: - ldr r0, =0x0000403a - bl VarGet - lsls r0, 16 - movs r1, 0xE0 - lsls r1, 11 - ands r1, r0 - cmp r1, 0 - bne _081D4338 - ldrb r1, [r5, 0x1] - movs r0, 0x21 - negs r0, r0 - ands r0, r1 - b _081D433E - .pool -_081D4338: - ldrb r0, [r5, 0x1] - movs r1, 0x20 - orrs r0, r1 -_081D433E: - strb r0, [r5, 0x1] - ldr r0, =0x0000403a - bl VarGet - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x9 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - bne _081D4360 -_081D4356: - movs r0, 0 - b _081D4816 - .pool -_081D4360: - movs r4, 0 - mov r8, r4 - ldr r6, =0x02037350 - mov r10, r6 -_081D4368: - ldr r3, =0x02037590 - ldrb r1, [r3, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - mov r1, r10 - adds r4, r0, r1 - mov r2, r8 - lsls r1, r2, 2 - ldr r6, =gUnknown_0862608C - adds r0, r1, r6 - movs r6, 0x14 - ldrsh r2, [r4, r6] - movs r6, 0 - ldrsh r0, [r0, r6] - ldr r6, =0x02037350 - mov r9, r6 - mov r12, r3 - adds r7, r1, 0 - cmp r2, r0 - beq _081D4394 - b _081D449E -_081D4394: - movs r3, 0 - ldr r1, =gUnknown_0862608E - adds r0, r7, r1 - movs r2, 0x16 - ldrsh r1, [r4, r2] - movs r4, 0 - ldrsh r2, [r0, r4] - cmp r1, r2 - bge _081D43C0 - movs r6, 0x12 - ldrsh r0, [r5, r6] - cmp r0, r2 - bgt _081D43CA - b _081D449E - .pool -_081D43C0: - movs r1, 0x12 - ldrsh r0, [r5, r1] - cmp r0, r2 - blt _081D43CA - movs r3, 0x1 -_081D43CA: - cmp r3, 0 - bne _081D449E - ldr r0, =0x030012f8 - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r0, 0 - ble _081D4410 - movs r3, 0x10 - ldrsh r2, [r5, r3] - adds r2, 0x1 - mov r4, r12 - ldrb r1, [r4, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - add r0, r9 - movs r6, 0x14 - ldrsh r0, [r0, r6] - cmp r2, r0 - bne _081D4446 - ldrh r0, [r5, 0x10] - adds r0, 0x1 - lsls r0, 16 - asrs r0, 16 - movs r2, 0x12 - ldrsh r1, [r5, r2] - bl sub_81D4834 - lsls r0, 24 - cmp r0, 0 - beq _081D4446 -_081D4408: - movs r0, 0x4 - b _081D4816 - .pool -_081D4410: - cmp r0, 0 - bge _081D4446 - movs r3, 0x10 - ldrsh r2, [r5, r3] - subs r2, 0x1 - mov r4, r12 - ldrb r1, [r4, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - add r0, r9 - movs r6, 0x14 - ldrsh r0, [r0, r6] - cmp r2, r0 - bne _081D4446 - ldrh r0, [r5, 0x10] - subs r0, 0x1 - lsls r0, 16 - asrs r0, 16 - movs r2, 0x12 - ldrsh r1, [r5, r2] - bl sub_81D4834 - lsls r0, 24 - cmp r0, 0 - beq _081D4446 - b _081D45AA -_081D4446: - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - add r0, r10 - movs r3, 0x10 - ldrsh r1, [r5, r3] - movs r4, 0x14 - ldrsh r0, [r0, r4] - cmp r1, r0 - bne _081D449E - ldr r0, =0x030012fa - movs r6, 0 - ldrsh r0, [r0, r6] - cmp r0, 0 - ble _081D4488 - adds r0, r1, 0 - ldrh r1, [r5, 0x12] - subs r1, 0x1 - lsls r1, 16 - asrs r1, 16 - bl sub_81D4834 - lsls r0, 24 - cmp r0, 0 - beq _081D449E -_081D447C: - movs r0, 0x2 - b _081D4816 - .pool -_081D4488: - movs r2, 0x10 - ldrsh r0, [r5, r2] - ldrh r1, [r5, 0x12] - adds r1, 0x1 - lsls r1, 16 - asrs r1, 16 - bl sub_81D4834 - lsls r0, 24 - cmp r0, 0 - bne _081D4538 -_081D449E: - ldr r2, =0x02037590 - ldrb r1, [r2, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - mov r3, r10 - adds r4, r0, r3 - ldr r6, =gUnknown_0862608C - ldr r1, =gUnknown_0862608E - adds r0, r7, r1 - movs r3, 0x16 - ldrsh r1, [r4, r3] - movs r3, 0 - ldrsh r0, [r0, r3] - ldr r3, =0x02037350 - mov r9, r3 - mov r12, r2 - cmp r1, r0 - beq _081D44C6 - b _081D45D0 -_081D44C6: - movs r3, 0 - adds r0, r7, r6 - movs r6, 0x14 - ldrsh r1, [r4, r6] - movs r4, 0 - ldrsh r2, [r0, r4] - cmp r1, r2 - bge _081D44F0 - movs r6, 0x10 - ldrsh r0, [r5, r6] - cmp r0, r2 - bgt _081D44FA - b _081D45D0 - .pool -_081D44F0: - movs r1, 0x10 - ldrsh r0, [r5, r1] - cmp r0, r2 - blt _081D44FA - movs r3, 0x1 -_081D44FA: - cmp r3, 0 - bne _081D45D0 - ldr r0, =0x030012fa - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r0, 0 - ble _081D4540 - movs r3, 0x12 - ldrsh r2, [r5, r3] - adds r2, 0x1 - mov r4, r12 - ldrb r1, [r4, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - add r0, r9 - movs r6, 0x16 - ldrsh r0, [r0, r6] - cmp r2, r0 - bne _081D4576 - movs r1, 0x10 - ldrsh r0, [r5, r1] - ldrh r1, [r5, 0x12] - adds r1, 0x1 - lsls r1, 16 - asrs r1, 16 - bl sub_81D4834 - lsls r0, 24 - cmp r0, 0 - beq _081D4576 -_081D4538: - movs r0, 0x1 - b _081D4816 - .pool -_081D4540: - cmp r0, 0 - bge _081D4576 - movs r3, 0x12 - ldrsh r2, [r5, r3] - subs r2, 0x1 - mov r4, r12 - ldrb r1, [r4, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - add r0, r9 - movs r6, 0x16 - ldrsh r0, [r0, r6] - cmp r2, r0 - bne _081D4576 - movs r1, 0x10 - ldrsh r0, [r5, r1] - ldrh r1, [r5, 0x12] - subs r1, 0x1 - lsls r1, 16 - asrs r1, 16 - bl sub_81D4834 - lsls r0, 24 - cmp r0, 0 - beq _081D4576 - b _081D447C -_081D4576: - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - add r0, r10 - movs r2, 0x12 - ldrsh r1, [r5, r2] - movs r3, 0x16 - ldrsh r0, [r0, r3] - cmp r1, r0 - bne _081D45D0 - ldr r0, =0x030012f8 - movs r4, 0 - ldrsh r0, [r0, r4] - cmp r0, 0 - ble _081D45B8 - ldrh r0, [r5, 0x10] - subs r0, 0x1 - lsls r0, 16 - asrs r0, 16 - bl sub_81D4834 - lsls r0, 24 - cmp r0, 0 - beq _081D45D0 -_081D45AA: - movs r0, 0x3 - b _081D4816 - .pool -_081D45B8: - ldrh r0, [r5, 0x10] - adds r0, 0x1 - lsls r0, 16 - asrs r0, 16 - movs r2, 0x12 - ldrsh r1, [r5, r2] - bl sub_81D4834 - lsls r0, 24 - cmp r0, 0 - beq _081D45D0 - b _081D4408 -_081D45D0: - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0x3 - bhi _081D45E0 - b _081D4368 -_081D45E0: - adds r0, r5, 0 - movs r1, 0 - bl sub_81D4C14 - lsls r0, 24 - cmp r0, 0 - beq _081D461C - adds r0, r5, 0 - movs r1, 0x1 - bl sub_81D4C58 - lsls r0, 24 - cmp r0, 0 - beq _081D4604 - movs r0, 0x2 - bl sub_81D4D24 - b _081D4812 -_081D4604: - adds r0, r5, 0 - movs r1, 0x1 - bl sub_81D4CE0 - lsls r0, 24 - cmp r0, 0 - bne _081D4614 - b _081D447C -_081D4614: - movs r0, 0x2 - bl sub_81D4D24 - b _081D4812 -_081D461C: - adds r0, r5, 0 - movs r1, 0 - bl sub_81D4C9C - lsls r0, 24 - cmp r0, 0 - beq _081D4658 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_81D4C58 - lsls r0, 24 - cmp r0, 0 - beq _081D4640 - movs r0, 0x2 - bl sub_81D4D24 - b _081D4812 -_081D4640: - adds r0, r5, 0 - movs r1, 0x1 - bl sub_81D4CE0 - lsls r0, 24 - cmp r0, 0 - bne _081D4650 - b _081D4538 -_081D4650: - movs r0, 0x2 - bl sub_81D4D24 - b _081D4812 -_081D4658: - adds r0, r5, 0 - movs r1, 0 - bl sub_81D4C58 - lsls r0, 24 - cmp r0, 0 - beq _081D4694 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_81D4C14 - lsls r0, 24 - cmp r0, 0 - beq _081D467C - movs r0, 0x2 - bl sub_81D4D24 - b _081D4812 -_081D467C: - adds r0, r5, 0 - movs r1, 0x1 - bl sub_81D4C9C - lsls r0, 24 - cmp r0, 0 - bne _081D468C - b _081D4408 -_081D468C: - movs r0, 0x2 - bl sub_81D4D24 - b _081D4812 -_081D4694: - adds r0, r5, 0 - movs r1, 0 - bl sub_81D4CE0 - lsls r0, 24 - cmp r0, 0 - beq _081D46D0 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_81D4C14 - lsls r0, 24 - cmp r0, 0 - beq _081D46B8 - movs r0, 0x2 - bl sub_81D4D24 - b _081D4812 -_081D46B8: - adds r0, r5, 0 - movs r1, 0x1 - bl sub_81D4C9C - lsls r0, 24 - cmp r0, 0 - bne _081D46C8 - b _081D45AA -_081D46C8: - movs r0, 0x2 - bl sub_81D4D24 - b _081D4812 -_081D46D0: - ldr r0, =0x030012fa - movs r3, 0 - ldrsh r0, [r0, r3] - cmp r0, 0 - bne _081D476E - ldr r2, =0x02037350 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r4, 0x12 - ldrsh r1, [r0, r4] - ldrh r2, [r5, 0x12] - movs r6, 0x12 - ldrsh r0, [r5, r6] - cmp r1, r0 - ble _081D470C - movs r1, 0x10 - ldrsh r0, [r5, r1] - subs r1, r2, 0x1 - lsls r1, 16 - asrs r1, 16 - bl sub_81D4834 - lsls r0, 24 - cmp r0, 0 - beq _081D470C - b _081D447C -_081D470C: - ldr r2, =0x02037350 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r2, 0x12 - ldrsh r1, [r0, r2] - ldrh r2, [r5, 0x12] - movs r3, 0x12 - ldrsh r0, [r5, r3] - cmp r1, r0 - bge _081D473E - movs r4, 0x10 - ldrsh r0, [r5, r4] - adds r1, r2, 0x1 - lsls r1, 16 - asrs r1, 16 - bl sub_81D4834 - lsls r0, 24 - cmp r0, 0 - beq _081D473E - b _081D4538 -_081D473E: - movs r6, 0x10 - ldrsh r0, [r5, r6] - ldrh r1, [r5, 0x12] - subs r1, 0x1 - lsls r1, 16 - asrs r1, 16 - bl sub_81D4834 - lsls r0, 24 - cmp r0, 0 - beq _081D4756 - b _081D447C -_081D4756: - movs r1, 0x10 - ldrsh r0, [r5, r1] - ldrh r1, [r5, 0x12] - adds r1, 0x1 - lsls r1, 16 - asrs r1, 16 - bl sub_81D4834 - lsls r0, 24 - cmp r0, 0 - beq _081D476E - b _081D4538 -_081D476E: - ldr r0, =0x030012f8 - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r0, 0 - bne _081D480C - ldr r2, =0x02037350 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r3, 0x10 - ldrsh r1, [r0, r3] - ldrh r2, [r5, 0x10] - movs r4, 0x10 - ldrsh r0, [r5, r4] - cmp r1, r0 - ble _081D47AA - subs r0, r2, 0x1 - lsls r0, 16 - asrs r0, 16 - movs r6, 0x12 - ldrsh r1, [r5, r6] - bl sub_81D4834 - lsls r0, 24 - cmp r0, 0 - beq _081D47AA - b _081D45AA -_081D47AA: - ldr r2, =0x02037350 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r2, 0x10 - ldrsh r1, [r0, r2] - ldrh r2, [r5, 0x10] - movs r3, 0x10 - ldrsh r0, [r5, r3] - cmp r1, r0 - bge _081D47DC - adds r0, r2, 0x1 - lsls r0, 16 - asrs r0, 16 - movs r4, 0x12 - ldrsh r1, [r5, r4] - bl sub_81D4834 - lsls r0, 24 - cmp r0, 0 - beq _081D47DC - b _081D4408 -_081D47DC: - ldrh r0, [r5, 0x10] - adds r0, 0x1 - lsls r0, 16 - asrs r0, 16 - movs r6, 0x12 - ldrsh r1, [r5, r6] - bl sub_81D4834 - lsls r0, 24 - cmp r0, 0 - beq _081D47F4 - b _081D4408 -_081D47F4: - ldrh r0, [r5, 0x10] - subs r0, 0x1 - lsls r0, 16 - asrs r0, 16 - movs r2, 0x12 - ldrsh r1, [r5, r2] - bl sub_81D4834 - lsls r0, 24 - cmp r0, 0 - beq _081D480C - b _081D45AA -_081D480C: - movs r0, 0 - bl sub_81D4890 -_081D4812: - lsls r0, 24 - lsrs r0, 24 -_081D4816: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D427C - - thumb_func_start sub_81D4834 -sub_81D4834: @ 81D4834 - push {r4,lr} - lsls r0, 16 - lsls r1, 16 - lsrs r4, r1, 16 - ldr r3, =0x02037350 - ldr r1, =0x02037590 - ldrb r2, [r1, 0x5] - lsls r1, r2, 3 - adds r1, r2 - lsls r1, 2 - adds r2, r1, r3 - movs r3, 0x10 - ldrsh r1, [r2, r3] - lsrs r3, r0, 16 - asrs r0, 16 - cmp r1, r0 - bne _081D4870 - movs r0, 0x12 - ldrsh r1, [r2, r0] - lsls r0, r4, 16 - asrs r0, 16 - cmp r1, r0 - bne _081D4870 - movs r0, 0 - b _081D4888 - .pool -_081D4870: - lsls r0, r3, 16 - asrs r0, 16 - lsls r1, r4, 16 - asrs r1, 16 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl sub_8088E64 - lsls r0, 24 - lsrs r0, 24 -_081D4888: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81D4834 - - thumb_func_start sub_81D4890 -sub_81D4890: @ 81D4890 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - bl sub_81D4258 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02037350 - adds r4, r1, r0 - movs r1, 0 - ldr r3, =0x030012fc - movs r2, 0 -_081D48B0: - adds r0, r1, r3 - strb r2, [r0] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x3 - bls _081D48B0 - movs r1, 0x10 - ldrsh r0, [r4, r1] - ldrh r1, [r4, 0x12] - subs r1, 0x1 - lsls r1, 16 - asrs r1, 16 - bl sub_81D4834 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081D48E8 - cmp r6, 0x2 - beq _081D48E8 - ldr r0, =0x030012fc - adds r0, r5, r0 - movs r1, 0x2 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_081D48E8: - ldrh r0, [r4, 0x10] - adds r0, 0x1 - lsls r0, 16 - asrs r0, 16 - movs r2, 0x12 - ldrsh r1, [r4, r2] - bl sub_81D4834 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081D4912 - cmp r6, 0x4 - beq _081D4912 - ldr r0, =0x030012fc - adds r0, r5, r0 - movs r1, 0x4 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_081D4912: - movs r1, 0x10 - ldrsh r0, [r4, r1] - ldrh r1, [r4, 0x12] - adds r1, 0x1 - lsls r1, 16 - asrs r1, 16 - bl sub_81D4834 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1 - bne _081D493A - cmp r6, 0x1 - beq _081D493A - ldr r0, =0x030012fc - adds r0, r5, r0 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_081D493A: - ldrh r0, [r4, 0x10] - subs r0, 0x1 - lsls r0, 16 - asrs r0, 16 - movs r2, 0x12 - ldrsh r1, [r4, r2] - bl sub_81D4834 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081D4964 - cmp r6, 0x3 - beq _081D4964 - ldr r0, =0x030012fc - adds r0, r5, r0 - movs r1, 0x3 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_081D4964: - cmp r5, 0x1 - bhi _081D4974 - ldr r0, =0x030012fc - b _081D4988 - .pool -_081D4974: - ldr r4, =0x030012fc - ldr r0, =0x0000403a - bl VarGet - lsls r0, 16 - lsrs r0, 16 - adds r1, r5, 0 - bl __modsi3 - adds r0, r4 -_081D4988: - ldrb r0, [r0] - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D4890 - - thumb_func_start sub_81D4998 -sub_81D4998: @ 81D4998 - push {r4,lr} - ldr r4, =0x0000403a - adds r0, r4, 0 - bl VarGet - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r1, [r0, 0x4] - ldr r0, =0x0000391a - cmp r1, r0 - bne _081D49E0 - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, =0x0000270e - cmp r2, r0 - bls _081D49D8 - adds r0, r4, 0 - movs r1, 0 - bl VarSet - b _081D49E0 - .pool -_081D49D8: - adds r0, r4, 0 - adds r1, r2, 0 - bl VarSet -_081D49E0: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81D4998 - - thumb_func_start FieldObjectIsFarawayIslandMew -@ bool8 FieldObjectIsFarawayIslandMew(struct npc_state *fieldObject) -FieldObjectIsFarawayIslandMew: @ 81D49E8 - push {lr} - adds r2, r0, 0 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r1, [r0, 0x4] - ldr r0, =0x0000391a - cmp r1, r0 - bne _081D4A0C - ldrb r0, [r2, 0x5] - cmp r0, 0xE5 - bne _081D4A0C - movs r0, 0x1 - b _081D4A0E - .pool -_081D4A0C: - movs r0, 0 -_081D4A0E: - pop {r1} - bx r1 - thumb_func_end FieldObjectIsFarawayIslandMew - - thumb_func_start unown_chamber_related -unown_chamber_related: @ 81D4A14 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r1, [r0, 0x4] - ldr r0, =0x0000391a - cmp r1, r0 - bne _081D4A50 - movs r0, 0xE5 - lsls r0, 1 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081D4A50 - ldr r0, =0x000002ce - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081D4A50 - movs r0, 0x1 - b _081D4A52 - .pool -_081D4A50: - movs r0, 0 -_081D4A52: - pop {r1} - bx r1 - thumb_func_end unown_chamber_related - - thumb_func_start sub_81D4A58 -sub_81D4A58: @ 81D4A58 - push {r4,lr} - ldr r4, =0x0000403a - adds r0, r4, 0 - bl VarGet - lsls r0, 16 - ldr r1, =0xffff0000 - cmp r0, r1 - beq _081D4A88 - adds r0, r4, 0 - bl VarGet - lsls r0, 16 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r0 - cmp r1, 0 - bne _081D4A88 - movs r0, 0x1 - b _081D4A8A - .pool -_081D4A88: - movs r0, 0 -_081D4A8A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81D4A58 - - thumb_func_start sub_81D4A90 -sub_81D4A90: @ 81D4A90 - push {r4-r6,lr} - sub sp, 0x4 - bl sub_81D4258 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02037350 - adds r5, r1, r0 - ldrb r1, [r5, 0x1] - movs r0, 0x21 - negs r0, r0 - ands r0, r1 - strb r0, [r5, 0x1] - ldr r0, =0x020375e0 - ldrh r4, [r0] - cmp r4, 0x1 - bne _081D4AF8 - ldrb r0, [r5, 0x3] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r5, 0x3] - ldr r3, =0x02020630 - ldrb r1, [r5, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x42 - ldrb r2, [r0] - movs r1, 0x3F - ands r1, r2 - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0] - ldrb r1, [r5, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x43 - strb r4, [r0] - b _081D4BC4 - .pool -_081D4AF8: - ldr r0, =0x0000403a - ldr r1, =0x0000ffff - bl VarSet - ldrb r0, [r5, 0x3] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r5, 0x3] - ldr r6, =0x02020630 - ldrb r1, [r5, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x42 - ldrb r2, [r0] - movs r1, 0x3F - ands r1, r2 - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0] - ldr r0, =0x020375f4 - ldrh r0, [r0] - cmp r0, 0x2 - beq _081D4B3A - ldrb r0, [r5, 0x4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - adds r1, 0x43 - movs r0, 0x1 - strb r0, [r1] -_081D4B3A: - ldr r4, =gFieldEffectObjectPaletteInfo1 - adds r0, r4, 0 - bl LoadTaggedObjectPalette - ldrh r0, [r4, 0x4] - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 24 - bl sub_80ABE18 - ldrh r1, [r5, 0x10] - mov r0, sp - strh r1, [r0] - ldrh r0, [r5, 0x12] - mov r4, sp - adds r4, 0x2 - strh r0, [r4] - mov r0, sp - adds r1, r4, 0 - movs r2, 0x8 - movs r3, 0x8 - bl sub_80930E0 - ldr r0, =gFieldEffectObjectTemplatePointers - ldr r0, [r0, 0x3C] - mov r1, sp - movs r2, 0 - ldrsh r1, [r1, r2] - movs r3, 0 - ldrsh r2, [r4, r3] - ldrb r4, [r5, 0x4] - lsls r3, r4, 4 - adds r3, r4 - lsls r3, 2 - adds r3, r6 - adds r3, 0x43 - ldrb r3, [r3] - subs r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - bl AddObjectToBack - ldr r1, =0x0203cf50 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _081D4BC4 - ldrb r0, [r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - adds r3, r1, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r2, 0x2 - orrs r0, r2 - strb r0, [r3] - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - movs r2, 0x8 - orrs r0, r2 - strb r0, [r1, 0x5] - ldr r0, =DummyObjectCallback - str r0, [r1, 0x1C] -_081D4BC4: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D4A90 - - thumb_func_start sub_81D4BEC -sub_81D4BEC: @ 81D4BEC - push {lr} - ldr r1, =0x0203cf50 - ldrb r0, [r1] - cmp r0, 0x40 - beq _081D4C06 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles -_081D4C06: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D4BEC - - thumb_func_start sub_81D4C14 -sub_81D4C14: @ 81D4C14 - push {r4,lr} - adds r2, r0, 0 - lsls r1, 24 - lsrs r4, r1, 24 - ldr r0, =0x030012fa - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - ble _081D4C50 - movs r1, 0x10 - ldrsh r0, [r2, r1] - ldrh r1, [r2, 0x12] - subs r1, 0x1 - lsls r1, 16 - asrs r1, 16 - bl sub_81D4834 - lsls r0, 24 - cmp r0, 0 - beq _081D4C50 - ldr r0, =0x030012fc - adds r0, r4, r0 - movs r1, 0x2 - strb r1, [r0] - movs r0, 0x1 - b _081D4C52 - .pool -_081D4C50: - movs r0, 0 -_081D4C52: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81D4C14 - - thumb_func_start sub_81D4C58 -sub_81D4C58: @ 81D4C58 - push {r4,lr} - adds r2, r0, 0 - lsls r1, 24 - lsrs r4, r1, 24 - ldr r0, =0x030012f8 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bge _081D4C94 - ldrh r0, [r2, 0x10] - adds r0, 0x1 - lsls r0, 16 - asrs r0, 16 - movs r3, 0x12 - ldrsh r1, [r2, r3] - bl sub_81D4834 - lsls r0, 24 - cmp r0, 0 - beq _081D4C94 - ldr r0, =0x030012fc - adds r0, r4, r0 - movs r1, 0x4 - strb r1, [r0] - movs r0, 0x1 - b _081D4C96 - .pool -_081D4C94: - movs r0, 0 -_081D4C96: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81D4C58 - - thumb_func_start sub_81D4C9C -sub_81D4C9C: @ 81D4C9C - push {r4,lr} - adds r2, r0, 0 - lsls r1, 24 - lsrs r4, r1, 24 - ldr r0, =0x030012fa - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bge _081D4CD8 - movs r1, 0x10 - ldrsh r0, [r2, r1] - ldrh r1, [r2, 0x12] - adds r1, 0x1 - lsls r1, 16 - asrs r1, 16 - bl sub_81D4834 - lsls r0, 24 - cmp r0, 0 - beq _081D4CD8 - ldr r0, =0x030012fc - adds r0, r4, r0 - movs r1, 0x1 - strb r1, [r0] - movs r0, 0x1 - b _081D4CDA - .pool -_081D4CD8: - movs r0, 0 -_081D4CDA: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81D4C9C - - thumb_func_start sub_81D4CE0 -sub_81D4CE0: @ 81D4CE0 - push {r4,lr} - adds r2, r0, 0 - lsls r1, 24 - lsrs r4, r1, 24 - ldr r0, =0x030012f8 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - ble _081D4D1C - ldrh r0, [r2, 0x10] - subs r0, 0x1 - lsls r0, 16 - asrs r0, 16 - movs r3, 0x12 - ldrsh r1, [r2, r3] - bl sub_81D4834 - lsls r0, 24 - cmp r0, 0 - beq _081D4D1C - ldr r0, =0x030012fc - adds r0, r4, r0 - movs r1, 0x3 - strb r1, [r0] - movs r0, 0x1 - b _081D4D1E - .pool -_081D4D1C: - movs r0, 0 -_081D4D1E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81D4CE0 - - thumb_func_start sub_81D4D24 -sub_81D4D24: @ 81D4D24 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =0x030012fc - ldr r0, =0x0000403a - bl VarGet - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0 - bl __modsi3 - adds r0, r5 - ldrb r0, [r0] - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D4D24 - - thumb_func_start sub_81D4D50 -sub_81D4D50: @ 81D4D50 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x4 - adds r5, r0, 0 - adds r6, r1, 0 - mov r8, r2 - mov r1, sp - ldr r4, =0x04000208 - ldrh r0, [r4] - strh r0, [r1] - movs r0, 0 - strh r0, [r4] - ldr r1, =0x03002710 - ldr r0, =sub_81D3FAC - str r0, [r1, 0x4] - ldr r0, =sub_81D3F9C - str r0, [r1, 0x8] - bl sub_81D41A0 - bl sub_81D4238 - ldr r2, =0x04000200 - ldrh r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strh r0, [r2] - mov r0, sp - ldrh r0, [r0] - strh r0, [r4] - movs r0, 0 - strh r0, [r5] - str r6, [r5, 0x4] - mov r0, r8 - str r0, [r5, 0x8] - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D4D50 - - thumb_func_start sub_81D4DB8 -sub_81D4DB8: @ 81D4DB8 - push {r4,lr} - sub sp, 0x4 - mov r1, sp - ldr r4, =0x04000208 - ldrh r0, [r4] - strh r0, [r1] - movs r0, 0 - strh r0, [r4] - bl sub_81D4238 - bl sub_81D41F4 - bl RestoreSerialTimer3IntrHandlers - mov r0, sp - ldrh r0, [r0] - strh r0, [r4] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D4DB8 - - thumb_func_start sub_81D4DE8 -sub_81D4DE8: @ 81D4DE8 - push {r4,r5,lr} - adds r4, r0, 0 - movs r5, 0 - ldr r1, [r4, 0x4] - ldr r2, [r4, 0x8] - movs r0, 0x1 - movs r3, 0 - bl sub_81D3D70 - adds r1, r0, 0 - strh r1, [r4] - movs r0, 0x13 - ands r0, r1 - cmp r0, 0x10 - bne _081D4E08 - movs r5, 0x1 -_081D4E08: - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _081D4E12 - movs r5, 0x2 -_081D4E12: - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _081D4E1C - movs r5, 0x3 -_081D4E1C: - ldr r1, =0x03003144 - movs r0, 0 - strb r0, [r1] - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D4DE8 - - thumb_func_start sub_81D4E30 -sub_81D4E30: @ 81D4E30 - push {lr} - ldr r0, =0x0201c000 - movs r2, 0x80 - lsls r2, 6 - movs r1, 0 - bl memset - ldr r1, =0x020229c6 - ldr r2, =0x00005503 - adds r0, r2, 0 - strh r0, [r1] - bl sub_8009734 - movs r0, 0x1 - bl sub_800B330 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D4E30 - - thumb_func_start sub_81D4E60 -sub_81D4E60: @ 81D4E60 - push {lr} - sub sp, 0xC - mov r1, sp - ldr r2, =0x04000208 - ldrh r0, [r2] - strh r0, [r1] - movs r0, 0 - strh r0, [r2] - ldr r0, =0x03003174 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp, 0x4] - str r1, [sp, 0x8] - mov r0, sp - ldrh r0, [r0] - strh r0, [r2] - add r2, sp, 0x4 - ldrh r1, [r2] - ldr r0, =0x0000b9a0 - cmp r1, r0 - bne _081D4EB8 - ldrh r1, [r2, 0x2] - ldr r0, =0x0000ccd0 - cmp r1, r0 - bne _081D4EB8 - ldrh r1, [r2, 0x4] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _081D4EB8 - ldrh r0, [r2, 0x6] - cmp r0, r1 - bne _081D4EB8 - movs r0, 0x1 - b _081D4EBA - .pool -_081D4EB8: - movs r0, 0 -_081D4EBA: - add sp, 0xC - pop {r1} - bx r1 - thumb_func_end sub_81D4E60 - - thumb_func_start sub_81D4EC0 -sub_81D4EC0: @ 81D4EC0 - push {lr} - bl sub_800ABBC - lsls r0, 24 - cmp r0, 0 - beq _081D4EDC - bl sub_800ABAC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _081D4EDC - movs r0, 0x1 - b _081D4EDE -_081D4EDC: - movs r0, 0 -_081D4EDE: - pop {r1} - bx r1 - thumb_func_end sub_81D4EC0 - - thumb_func_start sub_81D4EE4 -sub_81D4EE4: @ 81D4EE4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4] - subs r0, 0x3 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bhi _081D4F08 - bl sub_800B33C - lsls r0, 24 - cmp r0, 0 - beq _081D4F08 - movs r0, 0 - strb r0, [r4] - movs r0, 0x3 - b _081D500E -_081D4F08: - ldrb r0, [r4] - cmp r0, 0x5 - bls _081D4F10 - b _081D500C -_081D4F10: - lsls r0, 2 - ldr r1, =_081D4F20 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081D4F20: - .4byte _081D4F38 - .4byte _081D4F54 - .4byte _081D4F6C - .4byte _081D4FA0 - .4byte _081D4FEC - .4byte _081D4FF8 -_081D4F38: - bl sub_800ABBC - lsls r0, 24 - cmp r0, 0 - beq _081D4F88 - bl sub_800ABAC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _081D4F88 - movs r0, 0x1 - strb r0, [r4] - b _081D500C -_081D4F54: - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x5 - bls _081D500C - movs r0, 0 - strh r0, [r5] - movs r0, 0x2 - strb r0, [r4] - b _081D500C -_081D4F6C: - bl sub_800ABAC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _081D4F88 - movs r0, 0x49 - bl audio_play - bl sub_800A620 - movs r0, 0 - strh r0, [r5] - b _081D4FE6 -_081D4F88: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081D500C - movs r0, 0 - strb r0, [r4] - movs r0, 0x1 - b _081D500E - .pool -_081D4FA0: - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1E - bls _081D4FB6 - movs r0, 0 - strb r0, [r4] - movs r0, 0x5 - b _081D500E -_081D4FB6: - bl sub_800B320 - lsls r0, 24 - cmp r0, 0 - beq _081D500C - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _081D4FE6 - bl sub_800A23C - lsls r0, 24 - cmp r0, 0 - beq _081D4FE0 - movs r0, 0 - strb r0, [r4] - movs r0, 0x2 - b _081D500E - .pool -_081D4FE0: - movs r0, 0x4 - strb r0, [r4] - b _081D500C -_081D4FE6: - movs r0, 0x3 - strb r0, [r4] - b _081D500C -_081D4FEC: - movs r0, 0 - bl sub_800ABF4 - movs r0, 0x5 - strb r0, [r4] - b _081D500C -_081D4FF8: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _081D500C - strb r0, [r4] - movs r0, 0x4 - b _081D500E - .pool -_081D500C: - movs r0, 0 -_081D500E: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81D4EE4 - - thumb_func_start sub_81D5014 -sub_81D5014: @ 81D5014 - push {r4,lr} - ldr r0, =sub_81D5084 - movs r1, 0 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =0x03005e08 - adds r4, r0 - movs r0, 0 - strb r0, [r4, 0x8] - strb r0, [r4, 0x9] - strb r0, [r4, 0xA] - strb r0, [r4, 0xB] - strb r0, [r4, 0xC] - strb r0, [r4, 0xD] - movs r1, 0 - strh r0, [r4] - strh r0, [r4, 0x2] - strh r0, [r4, 0x4] - strh r0, [r4, 0x6] - strb r1, [r4, 0xE] - movs r0, 0x40 - bl AllocZeroed - str r0, [r4, 0x10] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D5014 - - thumb_func_start sub_81D505C -sub_81D505C: @ 81D505C - movs r1, 0 - strh r1, [r0] - bx lr - thumb_func_end sub_81D505C - - thumb_func_start sub_81D5064 -sub_81D5064: @ 81D5064 - push {lr} - adds r2, r0, 0 - lsls r1, 16 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - lsls r0, 16 - cmp r0, r1 - bhi _081D507A - movs r0, 0 - b _081D5080 -_081D507A: - movs r0, 0 - strh r0, [r2] - movs r0, 0x1 -_081D5080: - pop {r1} - bx r1 - thumb_func_end sub_81D5064 - - thumb_func_start sub_81D5084 -sub_81D5084: @ 81D5084 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - ldrb r0, [r4, 0x8] - cmp r0, 0x1A - bls _081D509C - b _081D548A -_081D509C: - lsls r0, 2 - ldr r1, =_081D50B0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081D50B0: - .4byte _081D511C - .4byte _081D5138 - .4byte _081D5148 - .4byte _081D515C - .4byte _081D516C - .4byte _081D5198 - .4byte _081D51D0 - .4byte _081D524C - .4byte _081D5268 - .4byte _081D5290 - .4byte _081D52AC - .4byte _081D52DC - .4byte _081D52F2 - .4byte _081D5308 - .4byte _081D536A - .4byte _081D5390 - .4byte _081D53A8 - .4byte _081D53C6 - .4byte _081D53F2 - .4byte _081D5418 - .4byte _081D5448 - .4byte _081D5454 - .4byte _081D5460 - .4byte _081D5430 - .4byte _081D548A - .4byte _081D548A - .4byte _081D5478 -_081D511C: - adds r0, r4, 0 - adds r0, 0x9 - ldr r1, =gUnknown_085EDFD6 - bl mevent_0814257C - cmp r0, 0 - bne _081D512C - b _081D548A -_081D512C: - movs r0, 0x1 - strb r0, [r4, 0x8] - b _081D548A - .pool -_081D5138: - bl sub_81D4E30 - adds r0, r4, 0 - bl sub_81D505C - movs r0, 0x2 - strb r0, [r4, 0x8] - b _081D548A -_081D5148: - adds r0, r4, 0 - movs r1, 0xA - bl sub_81D5064 - cmp r0, 0 - bne _081D5156 - b _081D548A -_081D5156: - movs r0, 0x3 - strb r0, [r4, 0x8] - b _081D548A -_081D515C: - bl sub_81D4EC0 - cmp r0, 0 - beq _081D5166 - b _081D52FC -_081D5166: - bl sub_80097E8 - b _081D525C -_081D516C: - adds r0, r4, 0 - adds r0, 0x9 - ldr r1, =gUnknown_085EDFF5 - bl mevent_0814257C - cmp r0, 0 - bne _081D517C - b _081D548A -_081D517C: - ldr r0, =gUnknown_085EE014 - bl sub_8018884 - adds r0, r4, 0 - bl sub_81D505C - movs r0, 0x5 - strb r0, [r4, 0x8] - b _081D548A - .pool -_081D5198: - adds r0, r4, 0 - movs r1, 0x5A - bl sub_81D5064 - cmp r0, 0 - beq _081D51AE - bl sub_81D4E30 - movs r0, 0x6 - strb r0, [r4, 0x8] - b _081D548A -_081D51AE: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _081D51BC - b _081D548A -_081D51BC: - adds r0, r4, 0 - bl sub_81D505C - movs r0, 0x5 - bl audio_play - b _081D535A - .pool -_081D51D0: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081D51F4 - movs r0, 0x5 - bl audio_play - bl sub_80097E8 - adds r0, r4, 0 - bl sub_81D505C - b _081D535A - .pool -_081D51F4: - bl sub_800ABAC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _081D5210 - adds r0, r4, 0 - bl sub_81D505C - bl sub_80097E8 - movs r0, 0x7 - strb r0, [r4, 0x8] - b _081D548A -_081D5210: - bl sub_81D4E60 - cmp r0, 0 - beq _081D522E - movs r0, 0x5 - bl audio_play - bl sub_80097E8 - adds r0, r4, 0 - bl sub_81D505C - movs r0, 0x8 - strb r0, [r4, 0x8] - b _081D548A -_081D522E: - adds r0, r4, 0 - movs r1, 0xA - bl sub_81D5064 - cmp r0, 0 - bne _081D523C - b _081D548A -_081D523C: - bl sub_80097E8 - bl sub_81D4E30 - adds r0, r4, 0 - bl sub_81D505C - b _081D548A -_081D524C: - adds r0, r4, 0 - adds r0, 0x9 - ldr r1, =gUnknown_085EE05C - bl mevent_0814257C - cmp r0, 0 - bne _081D525C - b _081D548A -_081D525C: - movs r0, 0x4 - strb r0, [r4, 0x8] - b _081D548A - .pool -_081D5268: - ldr r0, =gUnknown_085EE097 - bl sub_8018884 - ldr r0, =0x03006370 - ldr r1, =gUnknown_089A6550 - ldr r2, =gUnknown_089A3470 - subs r1, r2 - bl sub_81D4D50 - movs r0, 0x9 - strb r0, [r4, 0x8] - b _081D548A - .pool -_081D5290: - ldr r0, =0x03006370 - bl sub_81D4DE8 - strb r0, [r4, 0xE] - lsls r0, 24 - cmp r0, 0 - bne _081D52A0 - b _081D548A -_081D52A0: - movs r0, 0xA - strb r0, [r4, 0x8] - b _081D548A - .pool -_081D52AC: - ldr r0, =0x03006370 - bl sub_81D4DB8 - ldrb r0, [r4, 0xE] - cmp r0, 0x3 - bne _081D52BA - b _081D53C0 -_081D52BA: - cmp r0, 0x1 - beq _081D52C0 - b _081D546E -_081D52C0: - adds r0, r4, 0 - bl sub_81D505C - ldr r0, =gUnknown_085EE120 - bl sub_8018884 - movs r0, 0xB - strb r0, [r4, 0x8] - b _081D548A - .pool -_081D52DC: - movs r1, 0xD2 - lsls r1, 2 - adds r0, r4, 0 - bl sub_81D5064 - cmp r0, 0 - bne _081D52EC - b _081D548A -_081D52EC: - movs r0, 0xC - strb r0, [r4, 0x8] - b _081D548A -_081D52F2: - bl sub_81D4E30 - ldr r0, =gUnknown_085EE0DC - bl sub_8018884 -_081D52FC: - movs r0, 0xD - strb r0, [r4, 0x8] - b _081D548A - .pool -_081D5308: - adds r0, r4, 0 - adds r0, 0x9 - adds r1, r4, 0 - bl sub_81D4EE4 - cmp r0, 0x5 - bls _081D5318 - b _081D548A -_081D5318: - lsls r0, 2 - ldr r1, =_081D5328 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081D5328: - .4byte _081D548A - .4byte _081D5350 - .4byte _081D5340 - .4byte _081D5374 - .4byte _081D5374 - .4byte _081D5360 -_081D5340: - ldr r0, =gUnknown_085EE097 - bl sub_8018884 - movs r0, 0xE - strb r0, [r4, 0x8] - b _081D548A - .pool -_081D5350: - movs r0, 0x5 - bl audio_play - bl sub_80097E8 -_081D535A: - movs r0, 0x17 - strb r0, [r4, 0x8] - b _081D548A -_081D5360: - bl sub_80097E8 - movs r0, 0x15 - strb r0, [r4, 0x8] - b _081D548A -_081D536A: - bl sub_800B33C - lsls r0, 24 - cmp r0, 0 - beq _081D537A -_081D5374: - bl sub_80097E8 - b _081D53C0 -_081D537A: - bl sub_800A550 - lsls r0, 24 - cmp r0, 0 - bne _081D5386 - b _081D548A -_081D5386: - bl sub_800A5B4 - movs r0, 0xF - strb r0, [r4, 0x8] - b _081D548A -_081D5390: - ldr r0, =0x0201c000 - bl sub_81D3920 - strb r0, [r4, 0xE] - ldrb r0, [r4, 0xE] - bl sub_800ABF4 - movs r0, 0x10 - strb r0, [r4, 0x8] - b _081D548A - .pool -_081D53A8: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _081D548A - ldrb r0, [r4, 0xE] - cmp r0, 0x1 - bne _081D53C0 - movs r0, 0x11 - strb r0, [r4, 0x8] - b _081D548A - .pool -_081D53C0: - movs r0, 0x14 - strb r0, [r4, 0x8] - b _081D548A -_081D53C6: - ldr r0, =0x0201c000 - bl sub_81D3AB0 - cmp r0, 0 - beq _081D53EC - ldr r0, =gUnknown_085EE0FA - bl sub_8018884 - adds r0, r4, 0 - bl sub_81D505C - movs r0, 0x12 - strb r0, [r4, 0x8] - b _081D548A - .pool -_081D53EC: - movs r0, 0x16 - strb r0, [r4, 0x8] - b _081D548A -_081D53F2: - adds r0, r4, 0 - movs r1, 0x78 - bl sub_81D5064 - cmp r0, 0 - beq _081D548A - ldr r0, =gUnknown_085EE107 - bl sub_8018884 - movs r0, 0xB9 - lsls r0, 1 - bl fanfare_play - movs r0, 0x13 - strb r0, [r4, 0x8] - b _081D548A - .pool -_081D5418: - bl task_is_not_running_overworld_fanfare - lsls r0, 24 - cmp r0, 0 - beq _081D548A - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - b _081D543A - .pool -_081D5430: - adds r0, r4, 0 - adds r0, 0x9 - ldr r1, =gUnknown_085EE06B - bl mevent_0814257C -_081D543A: - cmp r0, 0 - beq _081D548A - movs r0, 0x1A - strb r0, [r4, 0x8] - b _081D548A - .pool -_081D5448: - adds r0, r4, 0 - adds r0, 0x9 - ldr r1, =gUnknown_085EE0A3 - b _081D5466 - .pool -_081D5454: - adds r0, r4, 0 - adds r0, 0x9 - ldr r1, =gUnknown_085EE0BF - b _081D5466 - .pool -_081D5460: - adds r0, r4, 0 - adds r0, 0x9 - ldr r1, =gUnknown_085EE12D -_081D5466: - bl mevent_0814257C - cmp r0, 0 - beq _081D548A -_081D546E: - movs r0, 0 - strb r0, [r4, 0x8] - b _081D548A - .pool -_081D5478: - ldr r0, [r4, 0x10] - bl Free - adds r0, r5, 0 - bl remove_task - ldr r0, =sub_80186A4 - bl SetMainCallback2 -_081D548A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D5084 - - thumb_func_start sp194_trainer_tower -sp194_trainer_tower: @ 81D5494 - push {lr} - bl sub_81D56B0 - ldr r1, =gUnknown_0862A618 - ldr r0, =0x020375e0 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - bl sub_81D5710 - pop {r0} - bx r0 - .pool - thumb_func_end sp194_trainer_tower - - thumb_func_start sub_81D54BC -sub_81D54BC: @ 81D54BC - push {r4-r6,lr} - ldr r4, =0x03005d90 - ldr r1, [r4] - ldr r3, =0x00000ef9 - adds r1, r3 - ldrb r2, [r1] - movs r0, 0x7F - ands r0, r2 - strb r0, [r1] - ldr r1, [r4] - adds r1, r3 - ldrb r2, [r1] - movs r0, 0x80 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r2, =0x03005d8c - ldr r0, [r2] - ldr r1, =0x00003d68 - adds r0, r1 - movs r1, 0 - str r1, [r0] - adds r6, r2, 0 - ldr r5, =0x00003718 - movs r4, 0x3 -_081D54EE: - ldr r0, [r6] - adds r0, r5 - ldr r1, =0x00034bbf - bl sub_81D5DF4 - adds r5, 0x4 - subs r4, 0x1 - cmp r4, 0 - bge _081D54EE - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D54BC - - thumb_func_start sub_81D5520 -sub_81D5520: @ 81D5520 - ldr r0, =0x02037318 - ldrb r0, [r0, 0x12] - adds r0, 0x61 - lsls r0, 24 - lsrs r0, 24 - bx lr - .pool - thumb_func_end sub_81D5520 - - thumb_func_start sub_81D5530 -sub_81D5530: @ 81D5530 - lsls r0, 24 - movs r1, 0xFF - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - ldr r2, =gTrainerClassNameIndices - ldr r1, =0x0203cf58 - ldr r1, [r1] - adds r1, 0x16 - adds r1, r0 - ldrb r0, [r1] - adds r0, r2 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_81D5530 - - thumb_func_start sub_81D5554 -sub_81D5554: @ 81D5554 - push {r4,lr} - adds r4, r0, 0 - lsls r1, 24 - movs r0, 0xFF - lsls r0, 24 - adds r1, r0 - lsrs r1, 24 - movs r3, 0 - ldr r0, =0x0203cf58 - ldr r2, [r0] - movs r0, 0xB - muls r0, r1 - adds r2, r0, r2 -_081D556E: - adds r1, r4, r3 - ldrb r0, [r2] - strb r0, [r1] - adds r2, 0x1 - adds r3, 0x1 - cmp r3, 0xA - ble _081D556E - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D5554 - - thumb_func_start sub_81D5588 -sub_81D5588: @ 81D5588 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl sub_81D56B0 - subs r4, 0x1 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x0203cf54 - ldr r3, [r0] - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r4 - ldrb r2, [r3] - lsls r0, r2, 4 - subs r0, r2 - lsls r0, 3 - subs r0, r2 - adds r0, r1 - lsls r0, 3 - adds r3, r0 - ldrb r4, [r3, 0x1B] - bl sub_81D5710 - ldr r0, =gTrainerPicIndices - adds r4, r0 - ldrb r0, [r4] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D5588 - - thumb_func_start sub_81D55D0 -sub_81D55D0: @ 81D55D0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - bl sub_81D56B0 - ldr r4, =0x0203cf58 - movs r0, 0x18 - bl AllocZeroed - str r0, [r4] - movs r6, 0 - ldr r0, =0x0203cf54 - mov r10, r0 -_081D55EE: - movs r5, 0 - lsls r1, r6, 2 - mov r8, r1 - adds r0, r6, 0x1 - mov r9, r0 - movs r0, 0xB - adds r1, r6, 0 - muls r1, r0 - mov r12, r1 - mov r1, r8 - adds r0, r1, r6 - lsls r0, 3 - adds r0, r6 - lsls r7, r0, 3 -_081D560A: - ldr r0, =0x0203cf58 - ldr r4, [r0] - mov r1, r12 - adds r0, r5, r1 - adds r4, r0 - mov r0, r10 - ldr r2, [r0] - adds r3, r5, r7 - ldrb r1, [r2] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 3 - subs r0, r1 - lsls r0, 3 - adds r3, r0 - adds r2, 0x10 - adds r2, r3 - ldrb r0, [r2] - strb r0, [r4] - adds r5, 0x1 - cmp r5, 0xA - ble _081D560A - ldr r1, =0x0203cf58 - ldr r4, [r1] - adds r4, 0x16 - adds r4, r6 - mov r0, r10 - ldr r3, [r0] - mov r1, r8 - adds r2, r1, r6 - lsls r2, 3 - adds r2, r6 - ldrb r1, [r3] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 3 - subs r0, r1 - adds r0, r2 - lsls r0, 3 - adds r3, r0 - ldrb r0, [r3, 0x1B] - strb r0, [r4] - mov r6, r9 - cmp r6, 0x1 - ble _081D55EE - ldr r1, =0x03005d8c - ldr r0, [r1] - ldr r1, =0x00003d64 - adds r0, r1 - bl sub_80008DC - bl sub_81D5710 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D55D0 - - thumb_func_start sub_81D5694 -sub_81D5694: @ 81D5694 - push {r4,lr} - ldr r4, =0x0203cf58 - ldr r0, [r4] - cmp r0, 0 - beq _081D56A6 - bl Free - movs r0, 0 - str r0, [r4] -_081D56A6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D5694 - - thumb_func_start sub_81D56B0 -sub_81D56B0: @ 81D56B0 - push {r4,lr} - ldr r4, =0x0203cf54 - ldr r0, [r4] - cmp r0, 0 - bne _081D56EC - ldr r0, =0x00000eec - bl AllocZeroed - str r0, [r4] - ldr r1, =0x02037318 - ldrb r1, [r1, 0x12] - adds r1, 0x61 - strb r1, [r0] - ldr r1, =gUnknown_0862A5F8 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x00003d6e - adds r0, r2 - ldrb r0, [r0] - lsrs r0, 6 - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - ldr r1, [r4] - adds r1, 0x4 - ldr r2, =0x040003ba - bl CpuSet - bl nullsub_2 -_081D56EC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D56B0 - - thumb_func_start sub_81D5710 -sub_81D5710: @ 81D5710 - push {r4,lr} - ldr r4, =0x0203cf54 - ldr r0, [r4] - cmp r0, 0 - beq _081D5722 - bl Free - movs r0, 0 - str r0, [r4] -_081D5722: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D5710 - - thumb_func_start sub_81D572C -sub_81D572C: @ 81D572C - push {r4-r6,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - lsls r4, 16 - lsrs r4, 16 - bl sub_81D56B0 - bl sub_81D5520 - lsls r0, 24 - lsrs r2, r0, 24 - subs r4, 0x1 - lsls r4, 24 - lsrs r4, 24 - cmp r5, 0x3 - beq _081D5790 - cmp r5, 0x3 - bgt _081D575A - cmp r5, 0x2 - beq _081D5764 - b _081D580E -_081D575A: - cmp r6, 0x4 - beq _081D57BC - cmp r6, 0x5 - beq _081D57E8 - b _081D580E -_081D5764: - ldr r0, =0x0203cf54 - lsls r1, r2, 4 - subs r1, r2 - lsls r1, 3 - subs r1, r2 - lsls r1, 3 - adds r1, 0xC - ldr r0, [r0] - adds r0, r1 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r4 - lsls r1, 3 - adds r1, 0x4 - adds r0, r1 - adds r0, 0x10 - bl ConvertBattleFrontierTrainerSpeechToString - b _081D580E - .pool -_081D5790: - ldr r0, =0x0203cf54 - lsls r1, r2, 4 - subs r1, r2 - lsls r1, 3 - subs r1, r2 - lsls r1, 3 - adds r1, 0xC - ldr r0, [r0] - adds r0, r1 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r4 - lsls r1, 3 - adds r1, 0x4 - adds r0, r1 - adds r0, 0x1C - bl ConvertBattleFrontierTrainerSpeechToString - b _081D580E - .pool -_081D57BC: - ldr r0, =0x0203cf54 - lsls r1, r2, 4 - subs r1, r2 - lsls r1, 3 - subs r1, r2 - lsls r1, 3 - adds r1, 0xC - ldr r0, [r0] - adds r0, r1 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r4 - lsls r1, 3 - adds r1, 0x4 - adds r0, r1 - adds r0, 0x28 - bl ConvertBattleFrontierTrainerSpeechToString - b _081D580E - .pool -_081D57E8: - ldr r0, =0x0203cf54 - lsls r1, r2, 4 - subs r1, r2 - lsls r1, 3 - subs r1, r2 - lsls r1, 3 - adds r1, 0xC - ldr r0, [r0] - adds r0, r1 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r4 - lsls r1, 3 - adds r1, 0x4 - adds r0, r1 - adds r0, 0x34 - bl ConvertBattleFrontierTrainerSpeechToString -_081D580E: - bl sub_81D5710 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D572C - - thumb_func_start sub_81D581C -sub_81D581C: @ 81D581C - push {r4-r6,lr} - bl nullsub_2 - bl sub_81D3B34 - cmp r0, 0 - bne _081D5844 - ldr r3, =0x03005d8c - ldr r1, [r3] - ldr r0, =0x00003d6e - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x20 - orrs r0, r2 - b _081D5854 - .pool -_081D5844: - ldr r3, =0x03005d8c - ldr r1, [r3] - ldr r0, =0x00003d6e - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x21 - negs r0, r0 - ands r0, r2 -_081D5854: - strb r0, [r1] - adds r6, r3, 0 - ldr r0, [r6] - ldr r1, =0x00003d6c - adds r0, r1 - movs r5, 0 - strb r5, [r0] - ldr r0, [r6] - ldr r4, =0x00003d64 - adds r0, r4 - bl sub_80008DC - ldr r1, [r6] - adds r4, r1, r4 - str r5, [r4] - ldr r3, =0x00003d6e - adds r1, r3 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r6] - adds r1, r3 - ldrb r2, [r1] - movs r0, 0x3 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r6] - adds r1, r3 - ldrb r2, [r1] - movs r0, 0x11 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r0, =0x03005d90 - ldr r0, [r0] - movs r1, 0xEE - lsls r1, 4 - adds r0, r1 - strb r5, [r0] - ldr r0, =0x0202433a - strb r5, [r0] - ldr r1, [r6] - adds r1, r3 - ldrb r2, [r1] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D581C - - thumb_func_start sub_81D58D8 -sub_81D58D8: @ 81D58D8 - push {lr} - bl sub_80008E8 - ldr r3, =0x020375f0 - movs r0, 0 - strh r0, [r3] - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003d6e - adds r2, r0, r1 - ldrb r1, [r2] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _081D58FA - movs r0, 0x1 - strh r0, [r3] -_081D58FA: - ldrb r1, [r2] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x3 - bne _081D590A - ldrh r0, [r3] - adds r0, 0x1 - strh r0, [r3] -_081D590A: - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D58D8 - - thumb_func_start sub_81D5924 -sub_81D5924: @ 81D5924 - push {r4-r7,lr} - mov r7, r8 - push {r7} - bl sub_81D6640 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =0x0203cf54 - ldr r0, [r0] - ldrb r0, [r0, 0x6] - cmp r0, 0x4 - bne _081D5952 - ldr r0, =0x03005d8c - mov r8, r0 - ldr r0, [r0] - ldr r7, =0x00003d6e - adds r0, r7 - ldrb r0, [r0] - movs r6, 0x1 - adds r4, r6, 0 - ands r4, r0 - cmp r4, 0 - beq _081D596C -_081D5952: - ldr r1, =0x020375f0 - movs r0, 0x2 - strh r0, [r1] - b _081D59C0 - .pool -_081D596C: - adds r0, r5, 0 - movs r1, 0x1 - bl bag_add_item - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081D59BC - ldr r1, =0x02021dc4 - adds r0, r5, 0 - bl itemid_get_name - mov r0, r8 - ldr r1, [r0] - adds r1, r7 - ldrb r0, [r1] - movs r2, 0x1 - orrs r0, r2 - strb r0, [r1] - ldr r0, =0x03005d90 - ldr r1, [r0] - ldr r0, =0x00000ef9 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x80 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r0, =0x020375f0 - strh r4, [r0] - b _081D59C0 - .pool -_081D59BC: - ldr r0, =0x020375f0 - strh r6, [r0] -_081D59C0: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D5924 - - thumb_func_start sub_81D59D0 -sub_81D59D0: @ 81D59D0 - push {r4-r6,lr} - ldr r4, =0x03005d8c - ldr r2, [r4] - ldr r6, =0x00003d6e - adds r0, r2, r6 - ldrb r1, [r0] - movs r3, 0x2 - adds r0, r3, 0 - ands r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - beq _081D59FC - ldr r0, =0x020375f0 - strh r3, [r0] - b _081D5A4E - .pool -_081D59FC: - ldr r1, =0x00003d68 - adds r0, r2, r1 - bl free_203F458 - ldr r2, [r4] - ldr r3, =0x00003d64 - adds r1, r2, r3 - ldr r1, [r1] - cmp r0, r1 - bls _081D5A48 - adds r3, 0x4 - adds r0, r2, r3 - bl sub_81D5DF4 - ldr r2, [r4] - adds r0, r2, r6 - ldrb r0, [r0] - lsrs r0, 6 - lsls r0, 2 - ldr r3, =0x00003718 - adds r1, r2, r3 - adds r1, r0 - ldr r0, =0x00003d68 - adds r2, r0 - ldr r0, [r2] - str r0, [r1] - ldr r0, =0x020375f0 - strh r5, [r0] - b _081D5A4E - .pool -_081D5A48: - ldr r1, =0x020375f0 - movs r0, 0x1 - strh r0, [r1] -_081D5A4E: - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r3, =0x00003d6e - adds r1, r3 - ldrb r0, [r1] - movs r2, 0x2 - orrs r0, r2 - strb r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D59D0 - - thumb_func_start sub_81D5A70 -sub_81D5A70: @ 81D5A70 - push {lr} - ldr r0, =0x03005d8c - ldr r2, [r0] - ldr r1, =0x00003d6e - adds r0, r2, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - bne _081D5AAE - ldr r0, =0x00003d64 - adds r2, r0 - ldr r1, [r2] - ldr r0, =0x00034bbe - cmp r1, r0 - bls _081D5AA8 - adds r0, 0x1 - str r0, [r2] - b _081D5AAE - .pool -_081D5AA8: - adds r0, r2, 0 - bl sub_80008DC -_081D5AAE: - pop {r0} - bx r0 - thumb_func_end sub_81D5A70 - - thumb_func_start sub_81D5AB4 -sub_81D5AB4: @ 81D5AB4 - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r0, =0x00003d6e - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x8 - orrs r0, r2 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_81D5AB4 - - thumb_func_start sub_81D5AD0 -sub_81D5AD0: @ 81D5AD0 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003d6e - adds r2, r0, r1 - ldrb r1, [r2] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _081D5B00 - movs r0, 0x9 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldr r1, =0x020375f0 - movs r0, 0 - b _081D5B20 - .pool -_081D5B00: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _081D5B1C - movs r0, 0x11 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldr r1, =0x020375f0 - movs r0, 0x1 - b _081D5B20 - .pool -_081D5B1C: - ldr r1, =0x020375f0 - movs r0, 0x2 -_081D5B20: - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D5AD0 - - thumb_func_start sub_81D5B2C -sub_81D5B2C: @ 81D5B2C - push {r4-r7,lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003d64 - adds r0, r1 - ldr r7, [r0] - ldr r0, =0x00034bbe - cmp r7, r0 - ble _081D5B40 - ldr r7, =0x00034bbf -_081D5B40: - movs r4, 0xE1 - lsls r4, 4 - adds r0, r7, 0 - adds r1, r4, 0 - bl __divsi3 - adds r6, r0, 0 - adds r0, r7, 0 - adds r1, r4, 0 - bl __modsi3 - adds r7, r0, 0 - movs r1, 0x3C - bl __divsi3 - adds r5, r0, 0 - adds r0, r7, 0 - movs r1, 0x3C - bl __modsi3 - adds r7, r0, 0 - movs r0, 0xA8 - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - adds r4, r0, 0 - ldr r0, =0x02021cc4 - adds r1, r6, 0 - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r0, =0x02021dc4 - adds r1, r5, 0 - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r0, =0x02021ec4 - adds r1, r4, 0 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalString - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D5B2C - - thumb_func_start sub_81D5BBC -sub_81D5BBC: @ 81D5BBC - push {lr} - bl sub_81D56B0 - ldr r0, =0x0203cf54 - ldr r1, [r0] - ldrb r0, [r1, 0x6] - cmp r0, 0x4 - beq _081D5BEC - ldr r0, =0x02021cc4 - ldrb r1, [r1, 0x6] - movs r2, 0 - movs r3, 0x1 - bl ConvertIntToDecimalString - ldr r1, =0x020375f0 - movs r0, 0 - b _081D5BF0 - .pool -_081D5BEC: - ldr r1, =0x020375f0 - movs r0, 0x1 -_081D5BF0: - strh r0, [r1] - bl sub_81D5710 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D5BBC - - thumb_func_start sub_81D5C00 -sub_81D5C00: @ 81D5C00 - push {lr} - bl sub_81D56B0 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - bl sub_81D5710 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D5C00 - - thumb_func_start sub_81D5C18 -sub_81D5C18: @ 81D5C18 - push {lr} - ldr r0, =0x000040d6 - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _081D5C42 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003d6e - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - bne _081D5C42 - bl GetCurrentTrainerHillMapId - lsls r0, 24 - cmp r0, 0 - bne _081D5C54 -_081D5C42: - movs r0, 0 - b _081D5C56 - .pool -_081D5C54: - movs r0, 0x1 -_081D5C56: - pop {r1} - bx r1 - thumb_func_end sub_81D5C18 - - thumb_func_start sub_81D5C5C -sub_81D5C5C: @ 81D5C5C - push {lr} - bl sub_81D5C18 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _081D5C74 - ldr r0, =0x020375f0 - strh r1, [r0] - b _081D5C7A - .pool -_081D5C74: - ldr r1, =0x020375f0 - movs r0, 0x1 - strh r0, [r1] -_081D5C7A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D5C5C - - thumb_func_start nullsub_129 -nullsub_129: @ 81D5C84 - bx lr - thumb_func_end nullsub_129 - - thumb_func_start nullsub_2 -nullsub_2: @ 81D5C88 - bx lr - thumb_func_end nullsub_2 - - thumb_func_start sub_81D5C8C -sub_81D5C8C: @ 81D5C8C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - bl sub_81D56B0 - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r5, =gUnknown_085EF88A - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0xD0 - bl GetStringCenterAlignXOffset - lsls r2, r0, 24 - lsrs r2, 24 - ldr r6, =gUnknown_0862A5F4 - str r6, [sp] - movs r4, 0x1 - negs r4, r4 - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r3, 0x2 - bl box_print - movs r7, 0x12 - movs r0, 0 - mov r8, r0 - mov r10, r4 - ldr r1, =0x02021fc4 - mov r9, r1 -_081D5CD6: - lsls r3, r7, 24 - lsrs r3, 24 - ldr r0, =gUnknown_0862A5F4 - str r0, [sp] - mov r1, r10 - str r1, [sp, 0x4] - ldr r0, =gUnknown_0862A660 - mov r1, r8 - lsls r4, r1, 2 - adds r0, r4, r0 - ldr r0, [r0] - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r2, 0 - bl box_print - adds r7, 0xF - ldr r0, =0x03005d8c - ldr r1, =0x00003718 - adds r4, r1 - ldr r0, [r0] - adds r0, r4 - bl free_203F458 - adds r4, r0, 0 - movs r5, 0xE1 - lsls r5, 4 - adds r1, r5, 0 - bl __udivsi3 - adds r6, r0, 0 - adds r0, r4, 0 - adds r1, r5, 0 - bl __umodsi3 - adds r5, r0, 0 - ldr r0, =0x02021cc4 - adds r1, r6, 0 - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalString - adds r0, r5, 0 - movs r1, 0x3C - bl __udivsi3 - adds r4, r0, 0 - adds r0, r5, 0 - movs r1, 0x3C - bl __umodsi3 - adds r5, r0, 0 - ldr r0, =0x02021dc4 - adds r1, r4, 0 - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalString - movs r0, 0xA8 - muls r0, r5 - movs r1, 0x64 - bl __udivsi3 - adds r1, r0, 0 - ldr r0, =0x02021ec4 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalString - mov r0, r9 - ldr r1, =gUnknown_085EF895 - bl CopyString - ldr r1, =gUnknown_085EF8A3 - bl ExpandStringRefs - movs r0, 0x1 - mov r1, r9 - movs r2, 0xD0 - bl GetStringRightAlignXOffset - lsls r2, r0, 24 - lsrs r2, 24 - lsls r3, r7, 24 - lsrs r3, 24 - ldr r0, =gUnknown_0862A5F4 - str r0, [sp] - mov r1, r10 - str r1, [sp, 0x4] - mov r0, r9 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - bl box_print - adds r7, 0x11 - movs r1, 0x1 - add r8, r1 - mov r0, r8 - cmp r0, 0x3 - ble _081D5CD6 - movs r0, 0 - bl PutWindowTilemap - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - bl sub_81D5710 - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D5C8C - - thumb_func_start free_203F458 -free_203F458: @ 81D5DF0 - ldr r0, [r0] - bx lr - thumb_func_end free_203F458 - - thumb_func_start sub_81D5DF4 -sub_81D5DF4: @ 81D5DF4 - str r1, [r0] - bx lr - thumb_func_end sub_81D5DF4 - - thumb_func_start sub_81D5DF8 -sub_81D5DF8: @ 81D5DF8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r1, 0xC7 - lsls r1, 4 - adds r1, r0, r1 - str r1, [sp, 0x4] - bl sub_81D5F48 - cmp r0, 0 - beq _081D5F0E - bl sub_81D56B0 - movs r7, 0 - ldr r4, =0x03005d90 - ldr r3, =0x00000cb4 - ldr r0, =0x0000ffff - adds r2, r0, 0 -_081D5E26: - ldr r1, [r4] - lsls r0, r7, 1 - adds r1, r3 - adds r1, r0 - ldrh r0, [r1] - orrs r0, r2 - strh r0, [r1] - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x1 - bls _081D5E26 - movs r0, 0 - str r0, [sp] - ldr r0, =0x03005d8c - ldr r1, [r0] - movs r2, 0xC7 - lsls r2, 4 - adds r1, r2 - ldr r2, =0x05000180 - mov r0, sp - bl CpuSet - bl sub_81D5520 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r7, 0 - ldr r3, =0x0203cf54 - mov r10, r3 -_081D5E64: - lsls r4, r7, 1 - mov r8, r4 - adds r5, r4, r7 - lsls r5, 3 - ldr r0, [sp, 0x4] - adds r5, r0 - adds r1, r5, 0 - ldr r0, =gUnknown_0862A670 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - adds r6, r7, 0x1 - strb r6, [r5] - mov r0, r10 - ldr r1, [r0] - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r7 - lsls r0, 3 - mov r2, r9 - lsls r4, r2, 4 - subs r4, r2 - lsls r4, 3 - subs r4, r2 - lsls r4, 3 - adds r0, r4 - adds r1, r0 - ldrb r0, [r1, 0x1B] - bl sub_81660B8 - strb r0, [r5, 0x1] - mov r0, r10 - ldr r3, [r0] - adds r0, r7, r4 - movs r2, 0xF0 - lsls r2, 2 - adds r1, r3, r2 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0xF - ands r0, r2 - strh r0, [r5, 0x4] - ldrb r0, [r1] - lsrs r0, 4 - movs r1, 0xF - ands r0, r1 - adds r0, 0x5 - strh r0, [r5, 0x6] - lsls r1, r7, 26 - lsrs r1, 24 - adds r3, r4 - ldr r2, =0x000003c2 - adds r3, r2 - ldrb r0, [r3] - asrs r0, r1 - movs r3, 0xF - ands r0, r3 - adds r0, 0x7 - strb r0, [r5, 0x9] - mov r2, r10 - ldr r0, [r2] - adds r0, r4 - ldr r3, =0x000003c3 - adds r0, r3 - ldrb r0, [r0] - asrs r0, r1 - movs r1, 0xF - ands r0, r1 - strh r0, [r5, 0xE] - ldr r0, =gUnknown_082C83F0 - str r0, [r5, 0x10] - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r4, =0x00000cb4 - adds r0, r4 - add r0, r8 - strh r6, [r0] - lsls r6, 24 - lsrs r7, r6, 24 - cmp r7, 0x1 - bls _081D5E64 - bl sub_81D5710 -_081D5F0E: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D5DF8 - - thumb_func_start sub_81D5F48 -sub_81D5F48: @ 81D5F48 - push {lr} - bl sub_81D56B0 - bl sub_81D5710 - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_81D5F48 - - thumb_func_start sub_81D5F58 -sub_81D5F58: @ 81D5F58 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x0203cf54 - ldr r4, [r4] - mov r12, r4 - lsls r4, r2, 1 - lsls r5, r0, 4 - subs r5, r0 - lsls r5, 3 - subs r5, r0 - lsls r5, 3 - adds r4, r5 - movs r0, 0xE8 - lsls r0, 2 - add r0, r12 - adds r0, r4 - ldrh r0, [r0] - movs r4, 0xF - subs r4, r1 - asrs r0, r4 - movs r4, 0x1 - ands r0, r4 - muls r2, r3 - adds r2, r1 - adds r2, r5 - movs r1, 0xA8 - lsls r1, 2 - add r1, r12 - adds r1, r2 - ldrb r1, [r1] - movs r2, 0x80 - lsls r2, 2 - adds r3, r2, 0 - movs r2, 0xC0 - lsls r2, 6 - lsls r0, 10 - orrs r0, r2 - orrs r1, r3 - orrs r0, r1 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D5F58 - - thumb_func_start sub_81D5FB4 -sub_81D5FB4: @ 81D5FB4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r4, r0, 0 - bl GetCurrentTrainerHillMapId - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - cmp r0, 0x6 - bne _081D5FD2 - bl sub_8087D74 - b _081D605E -_081D5FD2: - bl sub_81D56B0 - mov r0, r9 - cmp r0, 0x5 - bne _081D5FE6 - bl sub_8087D74 - bl sub_81D5710 - b _081D605E -_081D5FE6: - bl sub_81D5520 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldr r0, =0x02037318 - ldr r0, [r0] - ldr r2, [r0, 0xC] - ldr r1, =0x03005dc0 - str r4, [r1, 0x8] - movs r0, 0x1F - str r0, [r1] - movs r0, 0x23 - str r0, [r1, 0x4] - movs r0, 0xE0 - lsls r0, 1 - adds r3, r4, r0 - movs r6, 0x4 -_081D600A: - adds r4, r2, 0 - adds r4, 0x20 - adds r1, r3, 0 - movs r5, 0xF -_081D6012: - ldrh r0, [r2] - strh r0, [r1] - adds r2, 0x2 - adds r1, 0x2 - subs r5, 0x1 - cmp r5, 0 - bge _081D6012 - adds r3, 0x3E - adds r2, r4, 0 - subs r6, 0x1 - cmp r6, 0 - bge _081D600A - movs r6, 0 -_081D602C: - movs r5, 0 - adds r7, r3, 0 - adds r7, 0x3E - adds r0, r6, 0x1 - mov r8, r0 - adds r4, r3, 0 -_081D6038: - mov r0, r9 - adds r1, r5, 0 - adds r2, r6, 0 - movs r3, 0x10 - bl sub_81D5F58 - strh r0, [r4] - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0xF - ble _081D6038 - adds r3, r7, 0 - mov r6, r8 - cmp r6, 0xF - ble _081D602C - bl mapheader_run_script_with_tag_x1 - bl sub_81D5710 -_081D605E: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D5FB4 - - thumb_func_start InTrainerHill -InTrainerHill: @ 81D6074 - push {lr} - ldr r1, =0x02037318 - ldr r2, =0xfffffe61 - adds r0, r2, 0 - ldrh r1, [r1, 0x12] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0 - cmp r0, 0x3 - bhi _081D608C - movs r1, 0x1 -_081D608C: - adds r0, r1, 0 - pop {r1} - bx r1 - .pool - thumb_func_end InTrainerHill - - thumb_func_start GetCurrentTrainerHillMapId -@ u8 GetCurrentTrainerHillMapId() -GetCurrentTrainerHillMapId: @ 81D609C - push {lr} - ldr r0, =0x02037318 - ldrh r2, [r0, 0x12] - ldr r0, =0x0000019f - cmp r2, r0 - bne _081D60B4 - movs r1, 0x1 - b _081D60F8 - .pool -_081D60B4: - movs r0, 0xD0 - lsls r0, 1 - cmp r2, r0 - bne _081D60C0 - movs r1, 0x2 - b _081D60F8 -_081D60C0: - ldr r0, =0x000001a1 - cmp r2, r0 - bne _081D60D0 - movs r1, 0x3 - b _081D60F8 - .pool -_081D60D0: - movs r0, 0xD1 - lsls r0, 1 - cmp r2, r0 - bne _081D60DC - movs r1, 0x4 - b _081D60F8 -_081D60DC: - ldr r0, =0x000001a3 - cmp r2, r0 - bne _081D60EC - movs r1, 0x5 - b _081D60F8 - .pool -_081D60EC: - movs r0, 0xCF - lsls r0, 1 - movs r1, 0 - cmp r2, r0 - bne _081D60F8 - movs r1, 0x6 -_081D60F8: - adds r0, r1, 0 - pop {r1} - bx r1 - thumb_func_end GetCurrentTrainerHillMapId - - thumb_func_start sub_81D6100 -sub_81D6100: @ 81D6100 - push {lr} - ldr r0, =0x02037318 - ldrh r1, [r0, 0x12] - ldr r0, =0x000001a3 - movs r2, 0 - cmp r1, r0 - bne _081D6110 - movs r2, 0x1 -_081D6110: - adds r0, r2, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D6100 - - thumb_func_start sub_81D6120 -sub_81D6120: @ 81D6120 - push {lr} - movs r0, 0x1A - movs r1, 0x40 - bl get_mapheader_by_bank_and_number - ldr r0, [r0, 0x4] - ldr r0, [r0, 0x8] - adds r0, 0x8 - pop {r1} - bx r1 - thumb_func_end sub_81D6120 - - thumb_func_start sub_81D6134 -sub_81D6134: @ 81D6134 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081D614C - ldr r0, =0x02037318 - ldr r0, [r0, 0x4] - ldr r0, [r0, 0x8] - adds r0, 0x8 - b _081D6176 - .pool -_081D614C: - bl sub_81D6490 - lsls r0, 24 - lsrs r2, r0, 24 - movs r1, 0xFF - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x3 - bls _081D6162 - movs r2, 0x4 -_081D6162: - ldr r1, =gUnknown_0862A688 - subs r0, r2, 0x1 - lsls r0, 2 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x1A - bl get_mapheader_by_bank_and_number - ldr r0, [r0, 0x4] - ldr r0, [r0, 0x8] -_081D6176: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D6134 - - thumb_func_start battle_init -battle_init: @ 81D6180 - lsls r0, 24 - ldr r1, =0x03005d90 - ldr r1, [r1] - lsrs r0, 23 - adds r1, r0 - ldr r0, =0x00000cb2 - adds r1, r0 - ldrh r0, [r1] - bx lr - .pool - thumb_func_end battle_init - - thumb_func_start GetTrainerHillTrainerFlag -@ u8 GetTrainerHillTrainerFlag(u8 fieldObjectId) -GetTrainerHillTrainerFlag: @ 81D619C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_81D5520 - lsls r0, 24 - lsrs r0, 23 - ldr r2, =0x02037350 - lsls r1, r4, 3 - adds r1, r4 - lsls r1, 2 - adds r1, r2 - adds r0, 0xFF - ldrb r1, [r1, 0x8] - adds r0, r1 - lsls r0, 24 - ldr r1, =0x03005d90 - ldr r1, [r1] - movs r2, 0xEE - lsls r2, 4 - adds r1, r2 - ldr r2, =gUnknown_0832A328 - lsrs r0, 22 - adds r0, r2 - ldr r0, [r0] - ldrb r1, [r1] - ands r0, r1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetTrainerHillTrainerFlag - - thumb_func_start sub_81D61E8 -sub_81D61E8: @ 81D61E8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - bl sub_81D5520 - lsls r0, 25 - lsrs r4, r0, 24 - movs r3, 0 - ldr r0, =0x02038bca - mov r8, r0 - ldr r6, =0x03005d90 - ldr r1, =gUnknown_0832A328 - mov r12, r1 - adds r5, r6, 0 -_081D6204: - ldr r2, [r5] - lsls r0, r3, 1 - ldr r7, =0x00000cb4 - adds r1, r2, r7 - adds r1, r0 - ldrh r0, [r1] - mov r1, r8 - ldrh r1, [r1] - cmp r0, r1 - bne _081D6240 - movs r7, 0xEE - lsls r7, 4 - adds r2, r7 - adds r0, r4, r3 - lsls r0, 2 - add r0, r12 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - b _081D624A - .pool -_081D6240: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x1 - bls _081D6204 -_081D624A: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _081D62A2 - movs r3, 0 - ldr r5, =0x02038bcc - ldr r0, =gUnknown_0832A328 - mov r8, r0 -_081D6260: - ldr r2, [r6] - lsls r0, r3, 1 - ldr r7, =0x00000cb4 - adds r1, r2, r7 - adds r1, r0 - ldrh r0, [r1] - ldrh r1, [r5] - cmp r0, r1 - bne _081D6298 - movs r7, 0xEE - lsls r7, 4 - adds r2, r7 - adds r0, r4, r3 - lsls r0, 2 - add r0, r8 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - b _081D62A2 - .pool -_081D6298: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x1 - bls _081D6260 -_081D62A2: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81D61E8 - - thumb_func_start sub_81D62AC -sub_81D62AC: @ 81D62AC - ldr r0, =gUnknown_082C83F0 - bx lr - .pool - thumb_func_end sub_81D62AC - - thumb_func_start sub_81D62B4 -sub_81D62B4: @ 81D62B4 - push {lr} - ldr r0, =0x020375f2 - ldrh r1, [r0] - movs r0, 0x5 - bl sub_81D572C - bl sub_80982B8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D62B4 - - thumb_func_start sub_81D62CC -sub_81D62CC: @ 81D62CC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 16 - lsrs r0, 16 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - subs r1, r0, 0x1 - lsls r0, r1, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _081D636A - lsls r0, r1, 24 - lsrs r6, r0, 24 - bl sub_81D56B0 - bl sub_8165CB4 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - bl sub_81D5520 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - mov r5, r9 - adds r0, r5, 0x3 - cmp r5, r0 - bge _081D6366 - ldr r1, =gUnknown_0862A698 - lsls r0, r6, 1 - adds r0, r6 - adds r7, r0, r1 -_081D6316: - ldrb r2, [r7] - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - mov r1, r8 - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 3 - subs r0, r1 - lsls r0, 3 - adds r0, 0xC - ldr r3, =0x0203cf54 - ldr r1, [r3] - adds r1, r0 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r6 - lsls r0, 3 - adds r0, 0x4 - adds r1, r0 - movs r0, 0x2C - muls r0, r2 - adds r0, 0x40 - adds r1, r0 - adds r0, r4, 0 - bl sub_806819C - adds r0, r4, 0 - mov r1, r10 - bl sub_81D642C - adds r5, 0x1 - adds r7, 0x1 - mov r0, r9 - adds r0, 0x3 - cmp r5, r0 - blt _081D6316 -_081D6366: - bl sub_81D5710 -_081D636A: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D62CC - - thumb_func_start sub_81D6384 -sub_81D6384: @ 81D6384 - push {lr} - bl zero_enemy_party_data - ldr r0, =0x02038bca - ldrh r0, [r0] - movs r1, 0 - bl sub_81D62CC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D6384 - - thumb_func_start sub_81D639C -sub_81D639C: @ 81D639C - push {lr} - bl zero_enemy_party_data - ldr r0, =0x02038bca - ldrh r0, [r0] - movs r1, 0 - bl sub_81D62CC - ldr r0, =0x02038bcc - ldrh r0, [r0] - movs r1, 0x3 - bl sub_81D62CC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D639C - - thumb_func_start sub_81D63C4 -sub_81D63C4: @ 81D63C4 - movs r0, 0x7 - bx lr - thumb_func_end sub_81D63C4 - - thumb_func_start sub_81D63C8 -sub_81D63C8: @ 81D63C8 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl sub_81D56B0 - subs r4, 0x1 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x0203cf54 - ldr r3, [r0] - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r4 - ldrb r2, [r3] - lsls r0, r2, 4 - subs r0, r2 - lsls r0, 3 - subs r0, r2 - adds r0, r1 - lsls r0, 3 - adds r3, r0 - ldrb r4, [r3, 0x1B] - bl sub_81D5710 - movs r2, 0 - ldr r0, =gTrainerClassNameIndices - adds r4, r0 - ldrb r3, [r4] - ldr r1, =gUnknown_0862A3B4 -_081D6406: - ldrb r0, [r1] - cmp r0, r3 - bne _081D641C - ldrb r0, [r1, 0x1] - b _081D6426 - .pool -_081D641C: - adds r1, 0x4 - adds r2, 0x1 - cmp r2, 0x35 - bls _081D6406 - movs r0, 0 -_081D6426: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81D63C8 - - thumb_func_start sub_81D642C -sub_81D642C: @ 81D642C - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - mov r0, sp - strb r1, [r0] - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - ldr r5, =gExperienceTables - mov r1, sp - ldrb r2, [r1] - lsls r2, 2 - ldr r3, =gBaseStats - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r1, [r1, 0x13] - movs r0, 0xCA - lsls r0, 1 - muls r0, r1 - adds r2, r0 - adds r2, r5 - ldr r0, [r2] - str r0, [sp, 0x4] - add r2, sp, 0x4 - adds r0, r4, 0 - movs r1, 0x19 - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x38 - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - bl pokemon_calc_effective_stats - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D642C - - thumb_func_start sub_81D6490 -sub_81D6490: @ 81D6490 - push {r4,lr} - bl sub_81D56B0 - ldr r0, =0x0203cf54 - ldr r0, [r0] - ldrb r4, [r0, 0x6] - bl sub_81D5710 - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D6490 - - thumb_func_start sub_81D64AC -sub_81D64AC: @ 81D64AC - ldr r0, =0x03005d90 - ldr r0, [r0] - movs r1, 0xEE - lsls r1, 4 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - bx lr - .pool - thumb_func_end sub_81D64AC - - thumb_func_start sub_81D64C0 -sub_81D64C0: @ 81D64C0 - push {lr} - bl sub_81D6534 - cmp r0, 0x1 - bne _081D64D4 - ldr r0, =gUnknown_0862A5D4 - movs r1, 0x70 - movs r2, 0x20 - bl gpu_pal_apply -_081D64D4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D64C0 - - thumb_func_start sub_81D64DC -sub_81D64DC: @ 81D64DC - ldr r1, =0x020375f0 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r2, =0x00000ef9 - adds r0, r2 - ldrb r0, [r0] - lsrs r0, 7 - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_81D64DC - - thumb_func_start sub_81D64FC -sub_81D64FC: @ 81D64FC - ldr r0, =0x03005d90 - ldr r1, [r0] - ldr r0, =0x00000ef9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x80 - orrs r0, r2 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_81D64FC - - thumb_func_start sub_81D6518 -sub_81D6518: @ 81D6518 - ldr r0, =0x03005d90 - ldr r1, [r0] - ldr r0, =0x00000ef9 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x7F - ands r0, r2 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_81D6518 - - thumb_func_start sub_81D6534 -sub_81D6534: @ 81D6534 - push {lr} - bl sub_81D5C18 - lsls r0, 24 - cmp r0, 0 - beq _081D6560 - bl GetCurrentTrainerHillMapId - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x6 - beq _081D6560 - bl sub_81D5C00 - ldr r0, =0x020375f0 - ldrh r0, [r0] - cmp r0, 0 - beq _081D6560 - movs r0, 0x1 - b _081D6562 - .pool -_081D6560: - movs r0, 0 -_081D6562: - pop {r1} - bx r1 - thumb_func_end sub_81D6534 - - thumb_func_start sub_81D6568 -sub_81D6568: @ 81D6568 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003d6e - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _081D6590 - ldr r1, =0x020375f0 - movs r0, 0 - b _081D6594 - .pool -_081D6590: - ldr r1, =0x020375f0 - movs r0, 0x1 -_081D6594: - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D6568 - - thumb_func_start sub_81D65A0 -sub_81D65A0: @ 81D65A0 - push {r4,r5,lr} - ldr r4, =0x03005d8c - ldr r2, [r4] - ldr r5, =0x020375e2 - ldr r0, =0x00003d6e - adds r2, r0 - ldrb r1, [r5] - lsls r1, 6 - ldrb r3, [r2] - movs r0, 0x3F - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldr r1, [r4] - ldr r3, =0x00003d68 - adds r2, r1, r3 - ldrh r0, [r5] - lsls r0, 2 - ldr r3, =0x00003718 - adds r1, r3 - adds r1, r0 - ldr r0, [r1] - str r0, [r2] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D65A0 - - thumb_func_start sub_81D65E8 -sub_81D65E8: @ 81D65E8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - movs r3, 0 - movs r4, 0 - ldr r0, =0x0203cf54 - ldr r6, [r0] - movs r5, 0x1F -_081D65F8: - lsls r1, r4, 4 - subs r1, r4 - lsls r1, 3 - subs r1, r4 - lsls r1, 3 - adds r1, r6, r1 - ldrb r2, [r1, 0xC] - adds r0, r5, 0 - ands r0, r2 - eors r3, r0 - ldrb r1, [r1, 0xD] - adds r0, r5, 0 - ands r0, r1 - eors r3, r0 - lsls r0, r3, 24 - lsrs r3, r0, 24 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _081D65F8 - movs r1, 0x5 - cmp r7, 0 - beq _081D662A - movs r1, 0xA -_081D662A: - adds r0, r3, 0 - bl __umodsi3 - lsls r0, 24 - lsrs r3, r0, 24 - adds r0, r3, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D65E8 - - thumb_func_start sub_81D6640 -sub_81D6640: @ 81D6640 - push {r4,r5,lr} - movs r3, 0 - movs r2, 0 - ldr r0, =0x0203cf54 - ldr r4, [r0] -_081D664A: - lsls r0, r2, 4 - subs r0, r2 - lsls r0, 3 - subs r0, r2 - lsls r0, 3 - adds r0, r4, r0 - ldrb r1, [r0, 0xC] - adds r1, r3, r1 - ldrb r0, [r0, 0xD] - adds r3, r1, r0 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x3 - bls _081D664A - adds r0, r3, 0 - cmp r0, 0 - bge _081D6670 - adds r0, 0xFF -_081D6670: - asrs r4, r0, 8 - lsrs r0, 31 - adds r0, r4, r0 - asrs r0, 1 - lsls r0, 1 - subs r4, r0 - ldr r0, =0x00000864 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _081D66A0 - ldr r0, =0x0203cf54 - ldr r0, [r0] - ldrb r0, [r0, 0x4] - cmp r0, 0x8 - bne _081D66A0 - movs r0, 0x1 - b _081D66A2 - .pool -_081D66A0: - movs r0, 0 -_081D66A2: - bl sub_81D65E8 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x03005d8c - ldr r5, [r0] - ldr r1, =0x00003d6e - adds r0, r5, r1 - ldrb r1, [r0] - movs r0, 0xC0 - ands r0, r1 - cmp r0, 0xC0 - bne _081D66C8 - adds r0, r2, 0x1 - movs r1, 0xA - bl __modsi3 - lsls r0, 24 - lsrs r2, r0, 24 -_081D66C8: - ldr r1, =gUnknown_0862A5CC - lsls r0, r4, 2 - adds r0, r1 - ldr r1, [r0] - lsls r0, r2, 2 - adds r0, r1 - ldr r4, [r0] - ldr r1, =0x00003d64 - adds r0, r5, r1 - ldr r0, [r0] - movs r1, 0xE1 - lsls r1, 4 - bl __divsi3 - movs r1, 0 - cmp r0, 0xB - ble _081D6704 - movs r1, 0x1 - cmp r0, 0xC - ble _081D6704 - movs r1, 0x2 - cmp r0, 0xD - ble _081D6704 - movs r1, 0x3 - cmp r0, 0xF - ble _081D6704 - movs r1, 0x5 - cmp r0, 0x11 - bgt _081D6704 - movs r1, 0x4 -_081D6704: - lsls r0, r1, 1 - adds r0, r4 - ldrh r0, [r0] - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D6640 - - thumb_func_start sub_81D6720 -sub_81D6720: @ 81D6720 - 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, =0x0203cf60 - ldr r0, =0x00002018 - bl AllocZeroed - str r0, [r6] - ldr r1, =0x00002006 - adds r0, r1 - strb r4, [r0] - ldr r0, [r6] - mov r1, r8 - str r1, [r0] - ldr r1, =0x00002007 - adds r0, r1 - strb r5, [r0] - ldr r0, =sub_81D6774 - bl SetMainCallback2 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D6720 - - thumb_func_start sub_81D6774 -sub_81D6774: @ 81D6774 - push {lr} - bl SetVBlankHBlankCallbacksToNull - bl clear_scheduled_bg_copies_to_vram - bl remove_some_task - bl ResetObjectPaletteAllocator - bl sub_80A1A74 - bl ResetAllObjectData - bl clear_tasks - movs r0, 0 - movs r1, 0xF0 - movs r2, 0x20 - bl rboxid_80040B8 - ldr r1, =gUnknown_0862A6A0 - ldr r0, =0x0203cf60 - ldr r0, [r0] - ldr r2, =0x00002006 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0 - bl AddTask - ldr r0, =sub_81D67D0 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D6774 - - thumb_func_start sub_81D67D0 -sub_81D67D0: @ 81D67D0 - push {lr} - bl RunActiveTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl do_scheduled_bg_tilemap_copies_to_vram - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_81D67D0 - - thumb_func_start sub_81D67EC -sub_81D67EC: @ 81D67EC - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_81D67EC - - thumb_func_start sub_81D6800 -sub_81D6800: @ 81D6800 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081D6830 - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - ldr r4, =0x0203cf60 - ldr r0, [r4] - ldr r0, [r0] - bl SetMainCallback2 - ldr r0, [r4] - bl Free - adds r0, r5, 0 - bl remove_task -_081D6830: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D6800 - - thumb_func_start sub_81D6840 -sub_81D6840: @ 81D6840 - push {r4-r6,lr} - lsls r0, 24 - lsrs r3, r0, 24 - adds r6, r3, 0 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _081D68B2 - ldr r2, =0x0203cf60 - ldr r1, [r2] - ldr r4, =0x00002007 - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081D6888 - ldr r0, =0x03005e00 - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81D6800 - b _081D68B0 - .pool -_081D6888: - ldr r4, =0x00002006 - adds r1, r4 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r2, [r2] - ldr r1, =0x00002004 - adds r0, r2, r1 - strh r5, [r0] - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r3, =gUnknown_0862A6A0 - adds r2, r4 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] -_081D68B0: - str r0, [r1] -_081D68B2: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D6840 - - thumb_func_start sub_81D68C8 -sub_81D68C8: @ 81D68C8 - push {lr} - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuReg - movs r0, 0x4A - movs r1, 0 - bl SetGpuReg - movs r0, 0x40 - movs r1, 0xF0 - bl SetGpuReg - ldr r1, =0x00001888 - movs r0, 0x44 - bl SetGpuReg - ldr r0, =0x02037714 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02037b14 - strh r1, [r0] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D68C8 - - thumb_func_start sub_81D6904 -sub_81D6904: @ 81D6904 - push {lr} - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x3F - bl SetGpuReg - pop {r0} - bx r0 - thumb_func_end sub_81D6904 - - thumb_func_start sub_81D691C -sub_81D691C: @ 81D691C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r5, r0, r1 - bl sub_81D750C - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081D697E - movs r0, 0 - ldrsh r1, [r5, r0] - cmp r1, 0x40 - bne _081D6954 - bl sub_81D7438 - b _081D6978 - .pool -_081D6954: - cmp r1, 0x90 - bne _081D695E - bl sub_81D7480 - b _081D6978 -_081D695E: - cmp r1, 0x94 - beq _081D6974 - movs r0, 0xA4 - lsls r0, 1 - cmp r1, r0 - bne _081D6978 - adds r0, r4, 0 - movs r1, 0 - bl sub_81D75B4 - b _081D697E -_081D6974: - bl sub_81D74C8 -_081D6978: - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] -_081D697E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81D691C - - thumb_func_start sub_81D6984 -sub_81D6984: @ 81D6984 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r0, =gUnknown_0862A72C - mov r8, r0 - movs r1, 0x58 - movs r2, 0x48 - movs r3, 0x3 - bl AddObjectToFront - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r6, =0x02020630 - lsls r4, r5, 4 - adds r4, r5 - lsls r4, 2 - adds r0, r6, 0 - adds r0, 0x1C - adds r0, r4, r0 - ldr r1, =sub_81D6A20 - str r1, [r0] - adds r0, r6, 0 - adds r0, 0x2E - adds r4, r0 - mov r0, r8 - movs r1, 0x38 - movs r2, 0x68 - movs r3, 0x3 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - ldr r0, =gUnknown_0862A750 - movs r1, 0x4B - movs r2, 0x65 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x2] - ldr r0, =gUnknown_0862A774 - movs r1, 0x6D - movs r2, 0x72 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x4] - movs r0, 0 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x1 - bl StartObjectImageAnim - adds r0, r5, 0 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D6984 - - thumb_func_start sub_81D6A20 -sub_81D6A20: @ 81D6A20 - push {r4,lr} - adds r3, r0, 0 - movs r0, 0x2E - adds r0, r3 - mov r12, r0 - ldrh r0, [r0, 0xA] - adds r0, 0x1 - movs r1, 0x1F - ands r0, r1 - mov r1, r12 - strh r0, [r1, 0xA] - cmp r0, 0 - bne _081D6A84 - ldrh r1, [r3, 0x20] - movs r2, 0x20 - ldrsh r0, [r3, r2] - cmp r0, 0x48 - beq _081D6A84 - subs r0, r1, 0x1 - strh r0, [r3, 0x20] - ldr r2, =0x02020630 - movs r4, 0x2E - ldrsh r1, [r3, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x20] - subs r1, 0x1 - strh r1, [r0, 0x20] - mov r0, r12 - movs r4, 0x2 - ldrsh r1, [r0, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x20] - subs r1, 0x1 - strh r1, [r0, 0x20] - mov r0, r12 - movs r4, 0x4 - ldrsh r1, [r0, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x20] - subs r1, 0x1 - strh r1, [r0, 0x20] -_081D6A84: - adds r0, r3, 0 - adds r0, 0x2B - ldrb r3, [r0] - cmp r3, 0x1 - beq _081D6AE4 - cmp r3, 0x1 - bgt _081D6A9C - cmp r3, 0 - beq _081D6AA6 - b _081D6B68 - .pool -_081D6A9C: - cmp r3, 0x2 - beq _081D6B24 - cmp r3, 0x3 - beq _081D6AE4 - b _081D6B68 -_081D6AA6: - ldr r2, =0x02020630 - mov r0, r12 - movs r4, 0x2 - ldrsh r1, [r0, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r3, [r0, 0x24] - mov r0, r12 - movs r4, 0x2 - ldrsh r1, [r0, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r3, [r0, 0x26] - mov r0, r12 - movs r4, 0x4 - ldrsh r1, [r0, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r3, [r0, 0x24] - mov r0, r12 - movs r4, 0x4 - ldrsh r1, [r0, r4] - b _081D6B5E - .pool -_081D6AE4: - ldr r2, =0x02020630 - mov r0, r12 - movs r3, 0x2 - ldrsh r1, [r0, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0000ffff - strh r1, [r0, 0x24] - mov r4, r12 - movs r0, 0x2 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r3, 0 - strh r3, [r0, 0x26] - movs r0, 0x4 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x1 - negs r1, r1 - b _081D6B58 - .pool -_081D6B24: - ldr r2, =0x02020630 - mov r3, r12 - movs r4, 0x2 - ldrsh r1, [r3, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0000ffff - strh r1, [r0, 0x24] - movs r0, 0x2 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r3, 0x1 - strh r3, [r0, 0x26] - mov r4, r12 - movs r0, 0x4 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0000fffe -_081D6B58: - strh r1, [r0, 0x24] - movs r0, 0x4 - ldrsh r1, [r4, r0] -_081D6B5E: - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r3, [r0, 0x26] -_081D6B68: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D6A20 - - thumb_func_start sub_81D6B7C -sub_81D6B7C: @ 81D6B7C - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r5, =gUnknown_0862A81C - adds r0, r5, 0 - movs r1, 0x88 - movs r2, 0x60 - movs r3, 0x1 - bl AddObjectToFront - mov r8, r0 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r6, =0x02020630 - lsls r4, r0, 4 - add r4, r8 - lsls r4, 2 - adds r0, r6, 0 - adds r0, 0x1C - adds r0, r4, r0 - ldr r1, =sub_81D6D20 - str r1, [r0] - adds r0, r6, 0 - adds r0, 0x2E - adds r4, r0 - adds r0, r5, 0 - movs r1, 0xA8 - movs r2, 0x60 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 8 - strh r0, [r4] - adds r0, r5, 0 - movs r1, 0x88 - movs r2, 0x70 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4] - orrs r0, r1 - strh r0, [r4] - adds r0, r5, 0 - movs r1, 0xA8 - movs r2, 0x70 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 8 - strh r0, [r4, 0x2] - adds r0, r5, 0 - movs r1, 0x88 - movs r2, 0x80 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x2] - orrs r0, r1 - strh r0, [r4, 0x2] - adds r0, r5, 0 - movs r1, 0xA8 - movs r2, 0x80 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 8 - strh r0, [r4, 0x4] - adds r0, r5, 0 - movs r1, 0x68 - movs r2, 0x80 - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x4] - orrs r0, r1 - strh r0, [r4, 0x4] - adds r0, r5, 0 - movs r1, 0x88 - movs r2, 0x80 - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 8 - strh r0, [r4, 0x6] - adds r0, r5, 0 - movs r1, 0xB8 - movs r2, 0x80 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x6] - orrs r0, r1 - strh r0, [r4, 0x6] - ldr r0, =gUnknown_0862A84C - movs r1, 0xD0 - movs r2, 0x84 - movs r3, 0 - bl AddObjectToFront - lsls r0, 8 - strh r0, [r4, 0x8] - ldr r0, =gUnknown_0862A864 - movs r1, 0xC8 - movs r2, 0x78 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x8] - orrs r0, r1 - strh r0, [r4, 0x8] - ldrh r1, [r4] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x1 - bl StartObjectImageAnim - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x2 - bl StartObjectImageAnim - ldrh r1, [r4, 0x2] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x3 - bl StartObjectImageAnim - ldrb r1, [r4, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x4 - bl StartObjectImageAnim - ldrh r1, [r4, 0x4] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x5 - bl StartObjectImageAnim - ldrb r1, [r4, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x6 - bl StartObjectImageAnim - ldrh r1, [r4, 0x6] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x7 - bl StartObjectImageAnim - ldrb r1, [r4, 0x6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x8 - bl StartObjectImageAnim - mov r0, r8 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D6B7C - - thumb_func_start sub_81D6D20 -sub_81D6D20: @ 81D6D20 - push {r4-r7,lr} - adds r4, r0, 0 - adds r3, r4, 0 - adds r3, 0x2E - ldrh r0, [r3, 0xA] - adds r0, 0x1 - movs r1, 0x1F - ands r0, r1 - strh r0, [r3, 0xA] - ldr r7, =0x02020630 - cmp r0, 0 - bne _081D6E0E - ldrh r1, [r4, 0x20] - movs r2, 0x20 - ldrsh r0, [r4, r2] - cmp r0, 0x98 - beq _081D6E0E - adds r0, r1, 0x1 - strh r0, [r4, 0x20] - ldrh r1, [r4, 0x2E] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r0, [r4, 0x2E] - movs r2, 0xFF - adds r1, r2, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r1, [r3, 0x2] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r0, [r3, 0x2] - adds r1, r2, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r1, [r3, 0x4] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r0, [r3, 0x4] - adds r1, r2, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r1, [r3, 0x6] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r0, [r3, 0x6] - adds r1, r2, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r1, [r3, 0x8] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r0, [r3, 0x8] - ands r2, r0 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] -_081D6E0E: - adds r6, r7, 0 - movs r5, 0xFF - ldrb r1, [r3, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x2B - ldrb r2, [r0] - cmp r2, 0x1 - beq _081D6EE0 - cmp r2, 0x1 - bgt _081D6E34 - cmp r2, 0 - beq _081D6E40 - b _081D6FC8 - .pool -_081D6E34: - cmp r2, 0x2 - bne _081D6E3A - b _081D6F68 -_081D6E3A: - cmp r2, 0x3 - beq _081D6EE0 - b _081D6FC8 -_081D6E40: - strh r2, [r4, 0x26] - ldrh r1, [r3] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r0, [r3] - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x2] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r0, [r3, 0x2] - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x4] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r0, [r3, 0x4] - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x6] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r0, [r3, 0x6] - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x8] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x8] - ands r1, r5 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - b _081D6FC6 -_081D6EE0: - movs r2, 0x1 - strh r2, [r4, 0x26] - ldrh r1, [r3] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x2] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrb r1, [r3, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x4] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrb r1, [r3, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x6] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrb r1, [r3, 0x6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x8] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrb r1, [r3, 0x8] - b _081D6FBE -_081D6F68: - strh r2, [r4, 0x26] - ldrh r1, [r3] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r0, [r3] - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x2] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r0, [r3, 0x2] - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x4] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x8] - ands r1, r5 -_081D6FBE: - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 -_081D6FC6: - strh r2, [r0, 0x26] -_081D6FC8: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81D6D20 - - thumb_func_start sub_81D6FD0 -sub_81D6FD0: @ 81D6FD0 - push {lr} - bl sub_81D67EC - bl sub_80BA0A8 - pop {r0} - bx r0 - thumb_func_end sub_81D6FD0 - - thumb_func_start sub_81D6FE0 -sub_81D6FE0: @ 81D6FE0 - push {r4,lr} - bl sub_8121DA0 - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0862A888 - movs r0, 0 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r4, =0x0203cf60 - ldr r1, [r4] - adds r1, 0x4 - movs r0, 0 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00000804 - adds r1, r0 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00001004 - adds r1, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - bl sub_8121E10 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D6FE0 - - thumb_func_start sub_81D706C -sub_81D706C: @ 81D706C - push {r4,lr} - sub sp, 0x4 - bl reset_temp_tile_data_buffers - ldr r1, =gUnknown_08DA33C0 - movs r0, 0 - str r0, [sp] - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram -_081D7082: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - bne _081D7082 - ldr r0, =gUnknown_08DA3988 - ldr r4, =0x0203cf60 - ldr r1, [r4] - adds r1, 0x4 - bl LZDecompressWram - ldr r0, =gUnknown_08DA3824 - ldr r1, [r4] - ldr r2, =0x00000804 - adds r1, r2 - bl LZDecompressWram - ldr r0, =gUnknown_08DA3A88 - ldr r1, [r4] - ldr r2, =0x00001004 - adds r1, r2 - bl LZDecompressWram - ldr r0, =gUnknown_08DA37E8 - movs r1, 0 - movs r2, 0x40 - bl decompress_palette - ldr r0, =gUnknown_0862A8C4 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0862A8F8 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0862A924 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0862A9D4 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0862AA14 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0862AA34 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0862A8CC - bl LoadCompressedObjectPalette - ldr r0, =gUnknown_0862A9DC - bl LoadCompressedObjectPalette - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D706C - - thumb_func_start task_add_00_WIN0V_open_close_above_and_more -task_add_00_WIN0V_open_close_above_and_more: @ 81D7134 - push {r4-r7,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r6, r1, 3 - ldr r7, =0x03005e08 - adds r5, r6, r7 - bl dp12_8087EA4 - bl sub_81D6FE0 - bl sub_81D706C - movs r4, 0 - str r4, [sp, 0x4] - ldr r1, =0x02038c28 - ldr r2, =0x010003c0 - add r0, sp, 0x4 - bl CpuFastSet - ldr r2, =gUnknown_0862A87C - ldr r0, [r2] - ldr r1, [r2, 0x4] - ldr r2, [r2, 0x8] - bl sub_80BA038 - strh r4, [r5] - ldr r0, =sub_81D7228 - movs r1, 0 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x2] - ldr r0, =0x0203cf60 - ldr r0, [r0] - ldr r1, =0x00002006 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _081D71CC - bl sub_81D6984 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x4] - bl sub_81D6B7C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x6] - adds r0, r7, 0 - subs r0, 0x8 - adds r0, r6, r0 - ldr r1, =sub_81D691C - str r1, [r0] - b _081D71EE - .pool -_081D71CC: - bl sub_81D7664 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x4] - bl sub_81D78BC - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x6] - adds r0, r7, 0 - subs r0, 0x8 - adds r0, r6, r0 - ldr r1, =sub_81D736C - str r1, [r0] - bl sub_80A2F30 -_081D71EE: - movs r4, 0x1 - negs r4, r4 - adds r0, r4, 0 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r0, =sub_81D6FD0 - bl SetVBlankCallback - movs r0, 0x53 - bl audio_play - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end task_add_00_WIN0V_open_close_above_and_more - - thumb_func_start sub_81D7228 -sub_81D7228: @ 81D7228 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r3, r1, r0 - movs r1, 0x18 - ldr r7, =0x0203cf60 - ldr r4, =0x02038c28 - movs r0, 0xF0 - lsls r0, 3 - adds r5, r4, r0 -_081D7244: - lsls r0, r1, 16 - asrs r1, r0, 16 - adds r6, r0, 0 - cmp r1, 0x2F - bgt _081D726C - lsls r1, 1 - adds r2, r1, r4 - ldrh r0, [r3] - lsrs r0, 8 - strh r0, [r2] - adds r1, r5 - ldrh r0, [r3] - b _081D72CA - .pool -_081D726C: - cmp r1, 0x3F - bgt _081D7280 - lsls r1, 1 - adds r2, r1, r4 - ldrh r0, [r3, 0x2] - lsrs r0, 8 - strh r0, [r2] - adds r1, r5 - ldrh r0, [r3, 0x2] - b _081D72CA -_081D7280: - cmp r1, 0x4B - bgt _081D7294 - lsls r1, 1 - adds r2, r1, r4 - ldrh r0, [r3, 0x4] - lsrs r0, 8 - strh r0, [r2] - adds r1, r5 - ldrh r0, [r3, 0x4] - b _081D72CA -_081D7294: - cmp r1, 0x53 - bgt _081D72A8 - lsls r1, 1 - adds r2, r1, r4 - ldrh r0, [r3, 0x6] - lsrs r0, 8 - strh r0, [r2] - adds r1, r5 - ldrh r0, [r3, 0x6] - b _081D72CA -_081D72A8: - cmp r1, 0x57 - bgt _081D72BC - lsls r1, 1 - adds r2, r1, r4 - ldrh r0, [r3, 0x8] - lsrs r0, 8 - strh r0, [r2] - adds r1, r5 - ldrh r0, [r3, 0x8] - b _081D72CA -_081D72BC: - lsls r1, 1 - adds r2, r1, r4 - ldrh r0, [r3, 0xA] - lsrs r0, 8 - strh r0, [r2] - adds r1, r5 - ldrh r0, [r3, 0xA] -_081D72CA: - lsrs r0, 8 - strh r0, [r1] - movs r1, 0x80 - lsls r1, 9 - adds r0, r6, r1 - lsrs r1, r0, 16 - asrs r0, 16 - cmp r0, 0x5B - ble _081D7244 - ldr r0, [r7] - ldr r1, =0x00002006 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _081D7324 - movs r1, 0xE0 - lsls r1, 1 - adds r0, r1, 0 - ldrh r1, [r3] - adds r0, r1 - strh r0, [r3] - movs r1, 0xC0 - lsls r1, 1 - adds r0, r1, 0 - ldrh r1, [r3, 0x2] - adds r0, r1 - strh r0, [r3, 0x2] - movs r1, 0xA0 - lsls r1, 1 - adds r0, r1, 0 - ldrh r1, [r3, 0x4] - adds r0, r1 - strh r0, [r3, 0x4] - movs r1, 0x80 - lsls r1, 1 - adds r0, r1, 0 - ldrh r1, [r3, 0x6] - adds r0, r1 - strh r0, [r3, 0x6] - ldrh r0, [r3, 0x8] - adds r0, 0xC0 - b _081D735E - .pool -_081D7324: - movs r1, 0xC0 - lsls r1, 2 - adds r0, r1, 0 - ldrh r1, [r3] - adds r0, r1 - strh r0, [r3] - movs r1, 0xA0 - lsls r1, 2 - adds r0, r1, 0 - ldrh r1, [r3, 0x2] - adds r0, r1 - strh r0, [r3, 0x2] - movs r1, 0x80 - lsls r1, 2 - adds r0, r1, 0 - ldrh r1, [r3, 0x4] - adds r0, r1 - strh r0, [r3, 0x4] - movs r1, 0xC0 - lsls r1, 1 - adds r0, r1, 0 - ldrh r1, [r3, 0x6] - adds r0, r1 - strh r0, [r3, 0x6] - movs r1, 0x80 - lsls r1, 1 - adds r0, r1, 0 - ldrh r1, [r3, 0x8] - adds r0, r1 -_081D735E: - strh r0, [r3, 0x8] - ldrh r0, [r3, 0xA] - adds r0, 0x80 - strh r0, [r3, 0xA] - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81D7228 - - thumb_func_start sub_81D736C -sub_81D736C: @ 81D736C - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r7, =0x03005e08 - adds r4, r0, r7 - bl sub_81D750C - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - bne _081D742E - movs r0, 0 - ldrsh r1, [r4, r0] - cmp r1, 0x20 - beq _081D739C - cmp r1, 0x70 - bne _081D73AC -_081D739C: - bl sub_81D7438 - b _081D7428 - .pool -_081D73AC: - cmp r1, 0xD8 - bne _081D73B6 - bl sub_81D7480 - b _081D7428 -_081D73B6: - cmp r1, 0xDC - bne _081D73C0 - bl sub_81D74C8 - b _081D7428 -_081D73C0: - movs r0, 0xBE - lsls r0, 1 - cmp r1, r0 - beq _081D73D8 - adds r0, 0x20 - cmp r1, r0 - bne _081D7428 - adds r0, r5, 0 - movs r1, 0x2 - bl sub_81D75B4 - b _081D742E -_081D73D8: - movs r1, 0x91 - lsls r1, 2 - movs r0, 0x50 - bl SetGpuReg - adds r2, r7, 0 - subs r2, 0x8 - movs r0, 0x2 - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldr r1, =sub_81D752C - str r1, [r0] - movs r0, 0x2 - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - strh r6, [r0, 0x8] - movs r0, 0x2 - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrh r1, [r4, 0x4] - strh r1, [r0, 0xC] - movs r0, 0x2 - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrh r1, [r4, 0x6] - strh r1, [r0, 0xE] - bl remove_some_task -_081D7428: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_081D742E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D736C - - thumb_func_start sub_81D7438 -sub_81D7438: @ 81D7438 - push {r4,lr} - sub sp, 0xC - movs r0, 0x57 - bl audio_play - ldr r0, =0x00007fff - ldr r1, =0x0000ffff - str r1, [sp] - movs r4, 0 - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl sub_80A2C44 - ldr r0, =0xffff0000 - str r4, [sp] - str r4, [sp, 0x4] - movs r1, 0x1 - str r1, [sp, 0x8] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl sub_80A2C44 - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D7438 - - thumb_func_start sub_81D7480 -sub_81D7480: @ 81D7480 - push {r4,lr} - sub sp, 0xC - movs r0, 0x57 - bl audio_play - ldr r0, =0x00007fff - ldr r1, =0x0000ffff - str r1, [sp] - movs r4, 0 - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0 - movs r2, 0x10 - movs r3, 0x10 - bl sub_80A2C44 - ldr r0, =0xffff0000 - str r4, [sp] - str r4, [sp, 0x4] - movs r1, 0x1 - str r1, [sp, 0x8] - movs r1, 0 - movs r2, 0x10 - movs r3, 0x10 - bl sub_80A2C44 - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D7480 - - thumb_func_start sub_81D74C8 -sub_81D74C8: @ 81D74C8 - push {r4,lr} - sub sp, 0xC - ldr r0, =0x00007fff - ldr r1, =0x0000ffff - str r1, [sp] - movs r4, 0 - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x4 - movs r2, 0x10 - movs r3, 0 - bl sub_80A2C44 - ldr r0, =0xffff0000 - str r4, [sp] - str r4, [sp, 0x4] - movs r1, 0x1 - str r1, [sp, 0x8] - movs r1, 0x4 - movs r2, 0x10 - movs r3, 0 - bl sub_80A2C44 - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D74C8 - - thumb_func_start sub_81D750C -sub_81D750C: @ 81D750C - push {lr} - movs r1, 0x80 - lsls r1, 3 - movs r0, 0x2 - movs r2, 0x1 - bl ChangeBgX - movs r1, 0x80 - lsls r1, 4 - movs r0, 0x2 - movs r2, 0x2 - bl ChangeBgY - pop {r0} - bx r0 - thumb_func_end sub_81D750C - - thumb_func_start sub_81D752C -sub_81D752C: @ 81D752C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r5, r1, r0 - movs r0, 0x4 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl sub_81D7860 - movs r0, 0x6 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl sub_81D7D14 - movs r0, 0x1 - bl GetBgY - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0x1 - bl GetBgY - cmp r0, 0 - beq _081D757A - movs r0, 0x80 - lsls r0, 8 - cmp r4, r0 - bls _081D7586 -_081D757A: - movs r1, 0x80 - lsls r1, 3 - movs r0, 0x1 - movs r2, 0x2 - bl ChangeBgY -_081D7586: - ldrh r2, [r5] - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0x10 - beq _081D75A6 - adds r2, 0x1 - strh r2, [r5] - lsls r1, r2, 8 - movs r0, 0x10 - subs r0, r2 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg -_081D75A6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D752C - - thumb_func_start sub_81D75B4 -sub_81D75B4: @ 81D75B4 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r4, r1, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x54 - bl audio_play - movs r0, 0x1 - negs r0, r0 - lsls r4, 24 - asrs r4, 24 - movs r1, 0 - str r1, [sp] - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81D7600 - str r1, [r0] - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D75B4 - - thumb_func_start sub_81D7600 -sub_81D7600: @ 81D7600 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r6, r1, 3 - ldr r7, =0x03005e08 - adds r5, r6, r7 - bl sub_81D750C - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _081D7652 - ldrb r0, [r5, 0x2] - bl remove_task - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0 - bl SetVBlankCallback - bl remove_some_task - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - strh r4, [r5] - adds r0, r7, 0 - subs r0, 0x8 - adds r0, r6, r0 - ldr r1, =sub_81D6840 - str r1, [r0] -_081D7652: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D7600 - - thumb_func_start sub_81D7664 -sub_81D7664: @ 81D7664 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r0, =gUnknown_0862A8D4 - mov r8, r0 - movs r1, 0x62 - movs r2, 0x48 - movs r3, 0x3 - bl AddObjectToFront - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r6, =0x02020630 - lsls r4, r5, 4 - adds r4, r5 - lsls r4, 2 - adds r0, r6, 0 - adds r0, 0x1C - adds r0, r4, r0 - ldr r1, =sub_81D7700 - str r1, [r0] - adds r0, r6, 0 - adds r0, 0x2E - adds r4, r0 - mov r0, r8 - movs r1, 0x42 - movs r2, 0x68 - movs r3, 0x3 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - ldr r0, =gUnknown_0862A900 - movs r1, 0x55 - movs r2, 0x65 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x2] - ldr r0, =gUnknown_0862A92C - movs r1, 0x77 - movs r2, 0x72 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x4] - movs r0, 0 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x1 - bl StartObjectImageAnim - adds r0, r5, 0 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D7664 - - thumb_func_start sub_81D7700 -sub_81D7700: @ 81D7700 - push {r4,lr} - adds r3, r0, 0 - movs r0, 0x2E - adds r0, r3 - mov r12, r0 - ldrh r0, [r0, 0xA] - adds r0, 0x1 - movs r1, 0xF - ands r0, r1 - mov r1, r12 - strh r0, [r1, 0xA] - movs r1, 0x7 - ands r1, r0 - cmp r1, 0 - bne _081D7768 - ldrh r1, [r3, 0x20] - movs r2, 0x20 - ldrsh r0, [r3, r2] - cmp r0, 0x48 - beq _081D7768 - subs r0, r1, 0x1 - strh r0, [r3, 0x20] - ldr r2, =0x02020630 - movs r4, 0x2E - ldrsh r1, [r3, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x20] - subs r1, 0x1 - strh r1, [r0, 0x20] - mov r0, r12 - movs r4, 0x2 - ldrsh r1, [r0, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x20] - subs r1, 0x1 - strh r1, [r0, 0x20] - mov r0, r12 - movs r4, 0x4 - ldrsh r1, [r0, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x20] - subs r1, 0x1 - strh r1, [r0, 0x20] -_081D7768: - adds r0, r3, 0 - adds r0, 0x2B - ldrb r3, [r0] - cmp r3, 0x1 - beq _081D77C8 - cmp r3, 0x1 - bgt _081D7780 - cmp r3, 0 - beq _081D778A - b _081D784C - .pool -_081D7780: - cmp r3, 0x2 - beq _081D7808 - cmp r3, 0x3 - beq _081D77C8 - b _081D784C -_081D778A: - ldr r2, =0x02020630 - mov r0, r12 - movs r4, 0x2 - ldrsh r1, [r0, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r3, [r0, 0x24] - mov r0, r12 - movs r4, 0x2 - ldrsh r1, [r0, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r3, [r0, 0x26] - mov r0, r12 - movs r4, 0x4 - ldrsh r1, [r0, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r3, [r0, 0x24] - mov r0, r12 - movs r4, 0x4 - ldrsh r1, [r0, r4] - b _081D7842 - .pool -_081D77C8: - ldr r2, =0x02020630 - mov r0, r12 - movs r3, 0x2 - ldrsh r1, [r0, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0000ffff - strh r1, [r0, 0x24] - mov r4, r12 - movs r0, 0x2 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r3, 0 - strh r3, [r0, 0x26] - movs r0, 0x4 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x1 - negs r1, r1 - b _081D783C - .pool -_081D7808: - ldr r2, =0x02020630 - mov r3, r12 - movs r4, 0x2 - ldrsh r1, [r3, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0000ffff - strh r1, [r0, 0x24] - movs r0, 0x2 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r3, 0x1 - strh r3, [r0, 0x26] - mov r4, r12 - movs r0, 0x4 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0000fffe -_081D783C: - strh r1, [r0, 0x24] - movs r0, 0x4 - ldrsh r1, [r4, r0] -_081D7842: - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r3, [r0, 0x26] -_081D784C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D7700 - - thumb_func_start sub_81D7860 -sub_81D7860: @ 81D7860 - push {r4,lr} - adds r1, r0, 0 - adds r3, r1, 0 - adds r3, 0x2E - ldrh r2, [r1, 0x22] - movs r4, 0x22 - ldrsh r0, [r1, r4] - cmp r0, 0xA0 - bgt _081D78B0 - adds r0, r2, 0 - adds r0, 0x8 - strh r0, [r1, 0x22] - ldr r2, =0x02020630 - movs r0, 0x2E - ldrsh r1, [r1, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x22] - adds r1, 0x8 - strh r1, [r0, 0x22] - movs r4, 0x2 - ldrsh r1, [r3, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x22] - adds r1, 0x8 - strh r1, [r0, 0x22] - movs r0, 0x4 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x22] - adds r1, 0x8 - strh r1, [r0, 0x22] -_081D78B0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D7860 - - thumb_func_start sub_81D78BC -sub_81D78BC: @ 81D78BC - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r5, =gUnknown_0862A9E4 - adds r0, r5, 0 - movs r1, 0x7E - movs r2, 0x60 - movs r3, 0x1 - bl AddObjectToFront - mov r8, r0 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r6, =0x02020630 - lsls r4, r0, 4 - add r4, r8 - lsls r4, 2 - adds r0, r6, 0 - adds r0, 0x1C - adds r0, r4, r0 - ldr r1, =sub_81D7A60 - str r1, [r0] - adds r0, r6, 0 - adds r0, 0x2E - adds r4, r0 - adds r0, r5, 0 - movs r1, 0x9E - movs r2, 0x60 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 8 - strh r0, [r4] - adds r0, r5, 0 - movs r1, 0x7E - movs r2, 0x70 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4] - orrs r0, r1 - strh r0, [r4] - adds r0, r5, 0 - movs r1, 0x9E - movs r2, 0x70 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 8 - strh r0, [r4, 0x2] - adds r0, r5, 0 - movs r1, 0x7E - movs r2, 0x80 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x2] - orrs r0, r1 - strh r0, [r4, 0x2] - adds r0, r5, 0 - movs r1, 0x9E - movs r2, 0x80 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 8 - strh r0, [r4, 0x4] - adds r0, r5, 0 - movs r1, 0x5E - movs r2, 0x80 - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x4] - orrs r0, r1 - strh r0, [r4, 0x4] - adds r0, r5, 0 - movs r1, 0x7E - movs r2, 0x80 - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 8 - strh r0, [r4, 0x6] - adds r0, r5, 0 - movs r1, 0xAE - movs r2, 0x80 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x6] - orrs r0, r1 - strh r0, [r4, 0x6] - ldr r0, =gUnknown_0862AA1C - movs r1, 0xC6 - movs r2, 0x84 - movs r3, 0 - bl AddObjectToFront - lsls r0, 8 - strh r0, [r4, 0x8] - ldr r0, =gUnknown_0862AA3C - movs r1, 0xBE - movs r2, 0x78 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x8] - orrs r0, r1 - strh r0, [r4, 0x8] - ldrh r1, [r4] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x1 - bl StartObjectImageAnim - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x2 - bl StartObjectImageAnim - ldrh r1, [r4, 0x2] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x3 - bl StartObjectImageAnim - ldrb r1, [r4, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x4 - bl StartObjectImageAnim - ldrh r1, [r4, 0x4] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x5 - bl StartObjectImageAnim - ldrb r1, [r4, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x6 - bl StartObjectImageAnim - ldrh r1, [r4, 0x6] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x7 - bl StartObjectImageAnim - ldrb r1, [r4, 0x6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x8 - bl StartObjectImageAnim - mov r0, r8 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D78BC - - thumb_func_start sub_81D7A60 -sub_81D7A60: @ 81D7A60 - push {r4-r7,lr} - adds r4, r0, 0 - adds r3, r4, 0 - adds r3, 0x2E - ldrh r0, [r3, 0xA] - adds r0, 0x1 - movs r1, 0xF - ands r0, r1 - strh r0, [r3, 0xA] - movs r1, 0x7 - ands r1, r0 - ldr r7, =0x02020630 - cmp r1, 0 - bne _081D7B52 - ldrh r1, [r4, 0x20] - movs r2, 0x20 - ldrsh r0, [r4, r2] - cmp r0, 0x98 - beq _081D7B52 - adds r0, r1, 0x1 - strh r0, [r4, 0x20] - ldrh r1, [r4, 0x2E] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r0, [r4, 0x2E] - movs r2, 0xFF - adds r1, r2, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r1, [r3, 0x2] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r0, [r3, 0x2] - adds r1, r2, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r1, [r3, 0x4] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r0, [r3, 0x4] - adds r1, r2, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r1, [r3, 0x6] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r0, [r3, 0x6] - adds r1, r2, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r1, [r3, 0x8] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - ldrh r0, [r3, 0x8] - ands r2, r0 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] -_081D7B52: - adds r6, r7, 0 - movs r5, 0xFF - ldrb r1, [r3, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x2B - ldrb r2, [r0] - cmp r2, 0x1 - beq _081D7C24 - cmp r2, 0x1 - bgt _081D7B78 - cmp r2, 0 - beq _081D7B84 - b _081D7D0C - .pool -_081D7B78: - cmp r2, 0x2 - bne _081D7B7E - b _081D7CAC -_081D7B7E: - cmp r2, 0x3 - beq _081D7C24 - b _081D7D0C -_081D7B84: - strh r2, [r4, 0x26] - ldrh r1, [r3] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r0, [r3] - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x2] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r0, [r3, 0x2] - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x4] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r0, [r3, 0x4] - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x6] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r0, [r3, 0x6] - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x8] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x8] - ands r1, r5 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - b _081D7D0A -_081D7C24: - movs r2, 0x1 - strh r2, [r4, 0x26] - ldrh r1, [r3] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x2] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrb r1, [r3, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x4] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrb r1, [r3, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x6] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrb r1, [r3, 0x6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x8] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrb r1, [r3, 0x8] - b _081D7D02 -_081D7CAC: - strh r2, [r4, 0x26] - ldrh r1, [r3] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r0, [r3] - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x2] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r0, [r3, 0x2] - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x4] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r1, [r3, 0x8] - ands r1, r5 -_081D7D02: - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 -_081D7D0A: - strh r2, [r0, 0x26] -_081D7D0C: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81D7A60 - - thumb_func_start sub_81D7D14 -sub_81D7D14: @ 81D7D14 - push {lr} - adds r2, r0, 0 - movs r0, 0x2E - adds r0, r2 - mov r12, r0 - ldrh r1, [r2, 0x22] - movs r3, 0x22 - ldrsh r0, [r2, r3] - cmp r0, 0xA0 - bgt _081D7E08 - adds r0, r1, 0 - adds r0, 0x8 - strh r0, [r2, 0x22] - ldr r3, =0x02020630 - ldrh r1, [r2, 0x2E] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x22] - adds r1, 0x8 - strh r1, [r0, 0x22] - ldrh r0, [r2, 0x2E] - movs r2, 0xFF - adds r1, r2, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x22] - adds r1, 0x8 - strh r1, [r0, 0x22] - mov r0, r12 - ldrh r1, [r0, 0x2] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x22] - adds r1, 0x8 - strh r1, [r0, 0x22] - mov r1, r12 - ldrh r0, [r1, 0x2] - adds r1, r2, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x22] - adds r1, 0x8 - strh r1, [r0, 0x22] - mov r0, r12 - ldrh r1, [r0, 0x4] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x22] - adds r1, 0x8 - strh r1, [r0, 0x22] - mov r1, r12 - ldrh r0, [r1, 0x4] - adds r1, r2, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x22] - adds r1, 0x8 - strh r1, [r0, 0x22] - mov r0, r12 - ldrh r1, [r0, 0x6] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x22] - adds r1, 0x8 - strh r1, [r0, 0x22] - mov r1, r12 - ldrh r0, [r1, 0x6] - adds r1, r2, 0 - ands r1, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x22] - adds r1, 0x8 - strh r1, [r0, 0x22] - mov r0, r12 - ldrh r1, [r0, 0x8] - lsls r1, 16 - asrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x22] - adds r1, 0x8 - strh r1, [r0, 0x22] - mov r1, r12 - ldrh r0, [r1, 0x8] - ands r2, r0 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x22] - adds r1, 0x8 - strh r1, [r0, 0x22] -_081D7E08: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D7D14 - - thumb_func_start sub_81D7E10 -sub_81D7E10: @ 81D7E10 - push {r4,lr} - bl sub_8121DA0 - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0862AA54 - movs r0, 0x1 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r4, =0x0203cf60 - ldr r1, [r4] - adds r1, 0x4 - movs r0, 0 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00000804 - adds r1, r0 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00001004 - adds r1, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - bl sub_8121E10 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D7E10 - - thumb_func_start sub_81D7E9C -sub_81D7E9C: @ 81D7E9C - push {r4,lr} - sub sp, 0x4 - bl reset_temp_tile_data_buffers - ldr r1, =gUnknown_08DA33C0 - movs r4, 0 - str r4, [sp] - movs r0, 0 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r1, =gUnknown_08DA4F70 - str r4, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r1, =gUnknown_08DA3C94 - str r4, [sp] - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram -_081D7ED0: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - bne _081D7ED0 - ldr r0, =gUnknown_08DA3988 - ldr r4, =0x0203cf60 - ldr r1, [r4] - adds r1, 0x4 - bl LZDecompressWram - ldr r0, =gUnknown_08DA60B8 - ldr r1, [r4] - ldr r2, =0x00000804 - adds r1, r2 - bl LZDecompressWram - ldr r0, =gUnknown_08DA4DEC - ldr r1, [r4] - ldr r2, =0x00001004 - adds r1, r2 - bl LZDecompressWram - ldr r0, =gUnknown_08DA4DA8 - movs r1, 0 - movs r2, 0x40 - bl decompress_palette - ldr r0, =gUnknown_0862AA90 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0862AA98 - bl LoadCompressedObjectPalette - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D7E9C - - thumb_func_start sub_81D7F4C -sub_81D7F4C: @ 81D7F4C - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r5, =0x03005e08 - adds r6, r4, r5 - movs r0, 0xE8 - lsls r0, 1 - bl current_map_music_set - bl sub_81D7E10 - bl sub_81D7E9C - movs r1, 0x94 - lsls r1, 2 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x00000808 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - ldr r0, =sub_81D67EC - bl SetVBlankCallback - ldr r0, =sub_81D81A4 - movs r1, 0 - bl AddTask - movs r0, 0 - strh r0, [r6] - strh r0, [r6, 0x2] - subs r5, 0x8 - adds r4, r5 - ldr r0, =sub_81D7FC0 - str r0, [r4] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D7F4C - - thumb_func_start sub_81D7FC0 -sub_81D7FC0: @ 81D7FC0 - push {r4-r6,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - movs r0, 0 - ldrsh r5, [r4, r0] - cmp r5, 0x1 - beq _081D802A - cmp r5, 0x1 - bgt _081D7FE8 - cmp r5, 0 - beq _081D7FF4 - b _081D815A - .pool -_081D7FE8: - cmp r5, 0x2 - beq _081D80A4 - cmp r5, 0x3 - bne _081D7FF2 - b _081D8124 -_081D7FF2: - b _081D815A -_081D7FF4: - ldrh r1, [r4, 0x2] - movs r2, 0x2 - ldrsh r0, [r4, r2] - cmp r0, 0x8 - bne _081D8024 - movs r0, 0x1 - negs r0, r0 - str r5, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - strh r5, [r4, 0x4] - movs r0, 0x1E - strh r0, [r4, 0x6] - strh r5, [r4, 0x8] - movs r0, 0x7 - strh r0, [r4, 0xA] - strh r5, [r4, 0x2] - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - b _081D815A -_081D8024: - adds r0, r1, 0x1 - strh r0, [r4, 0x2] - b _081D815A -_081D802A: - ldrh r1, [r4, 0x6] - ldrh r3, [r4, 0x4] - adds r0, r1, r3 - strh r0, [r4, 0x4] - ldrh r2, [r4, 0xA] - ldrh r3, [r4, 0x8] - adds r0, r2, r3 - strh r0, [r4, 0x8] - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _081D8046 - subs r0, r1, 0x3 - strh r0, [r4, 0x6] -_081D8046: - lsls r0, r2, 16 - cmp r0, 0 - beq _081D8050 - subs r0, r2, 0x1 - strh r0, [r4, 0xA] -_081D8050: - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0xFF - ble _081D8078 - movs r2, 0x80 - lsls r2, 1 - adds r0, r2, 0 - strh r0, [r4, 0x4] - movs r1, 0 - strh r1, [r4, 0x6] - movs r0, 0xC - strh r0, [r4, 0xC] - movs r3, 0x1 - negs r3, r3 - adds r0, r3, 0 - strh r0, [r4, 0xE] - strh r1, [r4, 0x2] - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_081D8078: - movs r1, 0xF0 - lsls r1, 7 - movs r2, 0xC0 - lsls r2, 5 - ldrh r0, [r4, 0x8] - adds r0, 0x20 - lsls r0, 16 - asrs r0, 16 - str r0, [sp] - movs r3, 0x4 - ldrsh r0, [r4, r3] - str r0, [sp, 0x4] - movs r3, 0x4 - ldrsh r0, [r4, r3] - str r0, [sp, 0x8] - movs r0, 0 - str r0, [sp, 0xC] - movs r0, 0x2 - movs r3, 0x78 - bl SetBgAffine - b _081D815A -_081D80A4: - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] - movs r1, 0xF0 - lsls r1, 7 - movs r2, 0xC0 - lsls r2, 5 - ldrh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 18 - adds r0, 0x20 - ldrh r3, [r4, 0x8] - adds r0, r3 - lsls r0, 16 - asrs r0, 16 - str r0, [sp] - movs r3, 0x4 - ldrsh r0, [r4, r3] - str r0, [sp, 0x4] - movs r3, 0x4 - ldrsh r0, [r4, r3] - str r0, [sp, 0x8] - movs r5, 0 - str r5, [sp, 0xC] - movs r0, 0x2 - movs r3, 0x78 - bl SetBgAffine - ldrh r0, [r4, 0xE] - ldrh r1, [r4, 0xC] - adds r0, r1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r1, r0, 16 - cmp r1, 0xC - beq _081D80F4 - movs r0, 0xC - negs r0, r0 - cmp r1, r0 - bne _081D815A -_081D80F4: - movs r2, 0xE - ldrsh r0, [r4, r2] - negs r0, r0 - strh r0, [r4, 0xE] - movs r3, 0x2 - ldrsh r1, [r4, r3] - ldr r0, =0x00000127 - cmp r1, r0 - ble _081D815A - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - movs r0, 0x1 - negs r0, r0 - str r5, [sp] - movs r1, 0x6 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - b _081D815A - .pool -_081D8124: - ldrh r0, [r4, 0x4] - adds r0, 0x10 - strh r0, [r4, 0x4] - movs r1, 0xF0 - lsls r1, 7 - movs r2, 0xC0 - lsls r2, 5 - ldrh r0, [r4, 0x8] - adds r0, 0x20 - lsls r0, 16 - asrs r0, 16 - str r0, [sp] - movs r3, 0x4 - ldrsh r0, [r4, r3] - str r0, [sp, 0x4] - movs r3, 0x4 - ldrsh r0, [r4, r3] - str r0, [sp, 0x8] - movs r0, 0 - str r0, [sp, 0xC] - movs r0, 0x2 - movs r3, 0x78 - bl SetBgAffine - adds r0, r6, 0 - bl sub_81D8164 -_081D815A: - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81D7FC0 - - thumb_func_start sub_81D8164 -sub_81D8164: @ 81D8164 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081D8192 - movs r0, 0 - bl SetVBlankCallback - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81D6840 - str r0, [r1] -_081D8192: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D8164 - - thumb_func_start sub_81D81A4 -sub_81D81A4: @ 81D81A4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - ldrh r1, [r4, 0x2] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _081D8254 - ldr r0, =gUnknown_0862AAA0 - ldr r3, =gUnknown_0862AAB8 - movs r1, 0 - ldrsh r2, [r4, r1] - lsls r2, 1 - adds r1, r2, r3 - ldrb r1, [r1] - lsls r1, 24 - asrs r1, 24 - lsls r1, 18 - movs r6, 0xF0 - lsls r6, 15 - adds r1, r6 - asrs r1, 16 - adds r3, 0x1 - adds r2, r3 - ldrb r2, [r2] - lsls r2, 24 - asrs r2, 24 - lsls r2, 18 - movs r3, 0xA0 - lsls r3, 15 - adds r2, r3 - asrs r2, 16 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02020630 - lsls r3, r0, 4 - adds r3, r0 - lsls r3, 2 - adds r3, r1 - movs r0, 0 - ldrsb r0, [r4, r0] - strh r0, [r3, 0x2E] - ldrb r2, [r3, 0x1] - movs r1, 0xD - negs r1, r1 - adds r0, r1, 0 - ands r0, r2 - movs r2, 0x4 - orrs r0, r2 - movs r2, 0x3 - orrs r0, r2 - strb r0, [r3, 0x1] - ldrb r0, [r3, 0x5] - ands r1, r0 - movs r0, 0x8 - orrs r1, r0 - strb r1, [r3, 0x5] - adds r0, r3, 0 - bl obj_alloc_rotscale_entry - ldrh r1, [r4] - movs r6, 0 - ldrsh r0, [r4, r6] - cmp r0, 0x9 - bne _081D8250 - adds r0, r5, 0 - bl remove_task - b _081D825A - .pool -_081D8250: - adds r0, r1, 0x1 - strh r0, [r4] -_081D8254: - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] -_081D825A: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81D81A4 - - thumb_func_start sub_81D8260 -sub_81D8260: @ 81D8260 - push {lr} - adds r2, r0, 0 - movs r1, 0x30 - ldrsh r0, [r2, r1] - cmp r0, 0 - bne _081D8270 - strh r0, [r2, 0x24] - b _081D829A -_081D8270: - ldr r1, =gUnknown_0862AAB8 - movs r3, 0x2E - ldrsh r0, [r2, r3] - lsls r0, 1 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldrh r3, [r2, 0x24] - adds r0, r3 - strh r0, [r2, 0x24] - movs r3, 0x2E - ldrsh r0, [r2, r3] - lsls r0, 1 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldrh r1, [r2, 0x26] - adds r0, r1 -_081D829A: - strh r0, [r2, 0x26] - ldrh r0, [r2, 0x30] - adds r0, 0x1 - movs r1, 0xF - ands r0, r1 - strh r0, [r2, 0x30] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D8260 - - thumb_func_start sub_81D82B0 -sub_81D82B0: @ 81D82B0 - push {r4,lr} - bl sub_8121DA0 - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0862AACC - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - ldr r4, =0x0203cf60 - ldr r1, [r4] - adds r1, 0x4 - movs r0, 0 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00000804 - adds r1, r0 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00001004 - adds r1, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00001804 - adds r1, r0 - movs r0, 0x3 - bl SetBgTilemapBuffer - bl sub_8121E10 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x3 - bl schedule_bg_copy_tilemap_to_vram - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D82B0 - - thumb_func_start sub_81D8358 -sub_81D8358: @ 81D8358 - push {r4-r7,lr} - sub sp, 0xC - bl reset_temp_tile_data_buffers - ldr r1, =gUnknown_08DA7528 - movs r4, 0 - str r4, [sp] - movs r0, 0 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r1, =gUnknown_08DA69BC - str r4, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - add r7, sp, 0x8 -_081D8380: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - bne _081D8380 - ldr r0, =gUnknown_08DA7AAC - ldr r5, =0x0203cf60 - ldr r1, [r5] - adds r1, 0x4 - bl LZDecompressWram - ldr r0, =gUnknown_08DA7784 - ldr r1, [r5] - ldr r4, =0x00001804 - adds r1, r4 - bl LZDecompressWram - str r6, [sp, 0x4] - ldr r1, [r5] - ldr r0, =0x00001004 - adds r1, r0 - ldr r2, =0x01000200 - add r0, sp, 0x4 - bl CpuFastSet - ldr r1, [r5] - adds r4, r1, r4 - ldr r0, =0x00000804 - adds r1, r0 - movs r2, 0x80 - lsls r2, 2 - adds r0, r4, 0 - bl CpuFastSet - str r6, [sp, 0x8] - ldr r1, [r5] - ldr r0, =0x00000904 - adds r1, r0 - ldr r2, =0x010000d0 - adds r0, r7, 0 - bl CpuFastSet - ldr r0, =gUnknown_08DA7744 - movs r1, 0 - movs r2, 0x40 - bl decompress_palette - ldr r0, =0x02037714 - ldr r1, =0x00007fff - strh r1, [r0] - ldr r0, =0x02037b14 - strh r1, [r0] - ldr r0, =gUnknown_0862AAFC - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0862AB04 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0862AB0C - bl LoadCompressedObjectPalette - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D8358 - - thumb_func_start sub_81D844C -sub_81D844C: @ 81D844C - push {r4,r5,lr} - movs r0, 0x6 - bl GetGpuReg - lsls r0, 16 - lsrs r2, r0, 16 - adds r1, r2, 0 - subs r1, 0x18 - lsls r0, r1, 16 - lsrs r0, 16 - cmp r0, 0x6F - bhi _081D848C - ldr r0, =0x0203cf60 - ldr r0, [r0] - ldr r3, =0x00002008 - adds r0, r3 - movs r3, 0 - ldrsh r0, [r0, r3] - cmp r1, r0 - bgt _081D848C - ldr r1, =0x04000052 - ldr r3, =0x00000d08 - b _081D8492 - .pool -_081D848C: - ldr r1, =0x04000052 - movs r3, 0x80 - lsls r3, 5 -_081D8492: - adds r0, r3, 0 - strh r0, [r1] - cmp r2, 0 - bne _081D84E0 - ldr r0, =0x0203cf60 - ldr r1, [r0] - ldr r2, =0x00002008 - adds r3, r1, r2 - ldrh r4, [r3] - movs r1, 0 - ldrsh r2, [r3, r1] - ldr r1, =0x00001fff - adds r5, r0, 0 - cmp r2, r1 - bgt _081D84D4 - cmp r2, 0x27 - bgt _081D84C8 - adds r0, r4, 0x4 - b _081D84D2 - .pool -_081D84C8: - cmp r2, 0x4F - bgt _081D84D0 - adds r0, r4, 0x2 - b _081D84D2 -_081D84D0: - adds r0, r4, 0x1 -_081D84D2: - strh r0, [r3] -_081D84D4: - ldr r1, [r5] - ldr r2, =0x0000200a - adds r1, r2 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_081D84E0: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D844C - - thumb_func_start sub_81D84EC -sub_81D84EC: @ 81D84EC - push {r4-r6,lr} - mov r6, r8 - push {r6} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r6, =0x03005e08 - adds r5, r4, r6 - bl sub_81D82B0 - bl sub_81D8358 - ldr r1, =0x00001e41 - movs r0, 0x50 - bl SetGpuRegBits - movs r0, 0x80 - lsls r0, 5 - mov r8, r0 - movs r0, 0x52 - mov r1, r8 - bl SetGpuReg - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - ldr r0, =sub_81D67EC - bl SetVBlankCallback - ldr r0, =0x0203cf60 - ldr r0, [r0] - ldr r1, =0x00002008 - adds r2, r0, r1 - movs r1, 0 - strh r1, [r2] - ldr r2, =0x0000200a - adds r0, r2 - strh r1, [r0] - strh r1, [r5] - strh r1, [r5, 0x2] - strh r1, [r5, 0x4] - strh r1, [r5, 0x6] - mov r0, r8 - strh r0, [r5, 0x8] - subs r6, 0x8 - adds r4, r6 - ldr r0, =sub_81D857C - str r0, [r4] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D84EC - - thumb_func_start sub_81D857C -sub_81D857C: @ 81D857C - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r5, r0, r1 - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0x4 - bhi _081D8674 - lsls r0, 2 - ldr r1, =_081D85A8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081D85A8: - .4byte _081D85BC - .4byte _081D85DC - .4byte _081D861A - .4byte _081D863A - .4byte _081D8656 -_081D85BC: - ldrh r1, [r5, 0x2] - movs r2, 0x2 - ldrsh r0, [r5, r2] - cmp r0, 0x8 - bne _081D8634 - movs r0, 0x1 - negs r0, r0 - movs r4, 0 - str r4, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - strh r4, [r5, 0x2] - b _081D864E -_081D85DC: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _081D8674 - ldrh r2, [r5, 0x2] - movs r3, 0x2 - ldrsh r0, [r5, r3] - cmp r0, 0xA - bne _081D8614 - strh r1, [r5, 0x2] - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - ldr r0, =sub_81D844C - bl SetHBlankCallback - movs r0, 0x3 - bl EnableInterrupts - b _081D8674 - .pool -_081D8614: - adds r0, r2, 0x1 - strh r0, [r5, 0x2] - b _081D8674 -_081D861A: - ldrh r1, [r5, 0x2] - movs r2, 0x2 - ldrsh r0, [r5, r2] - cmp r0, 0x50 - bne _081D8634 - movs r0, 0 - strh r0, [r5, 0x2] - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - bl sub_81D86CC - b _081D8674 -_081D8634: - adds r0, r1, 0x1 - strh r0, [r5, 0x2] - b _081D8674 -_081D863A: - ldrh r0, [r5, 0x2] - adds r0, 0x1 - strh r0, [r5, 0x2] - lsls r0, 16 - movs r1, 0xB8 - lsls r1, 17 - cmp r0, r1 - bne _081D8674 - movs r0, 0 - strh r0, [r5, 0x2] -_081D864E: - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - b _081D8674 -_081D8656: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81D8684 - str r1, [r0] -_081D8674: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D857C - - thumb_func_start sub_81D8684 -sub_81D8684: @ 81D8684 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081D86B8 - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - bl SetHBlankCallback - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81D6840 - str r0, [r1] -_081D86B8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D8684 - - thumb_func_start sub_81D86CC -sub_81D86CC: @ 81D86CC - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r0, =gUnknown_0862AB14 - movs r1, 0xA0 - movs r2, 0 - movs r3, 0 - bl AddObjectToFront - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - lsls r5, r6, 4 - adds r5, r6 - lsls r5, 2 - ldr r4, =0x0202065e - adds r0, r5, r4 - mov r8, r0 - ldr r0, =gUnknown_0862AB2C - movs r2, 0x30 - negs r2, r2 - movs r1, 0xB8 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - mov r1, r8 - strh r0, [r1] - adds r3, r4, 0 - subs r3, 0x2E - subs r4, 0x12 - adds r4, r5, r4 - ldr r0, =sub_81D874C - str r0, [r4] - adds r5, r3 - ldrb r0, [r5, 0x5] - movs r2, 0xC - orrs r0, r2 - strb r0, [r5, 0x5] - movs r4, 0 - ldrsh r1, [r1, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r1, [r0, 0x5] - orrs r1, r2 - strb r1, [r0, 0x5] - adds r0, r6, 0 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D86CC - - thumb_func_start sub_81D874C -sub_81D874C: @ 81D874C - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r5, 0 - adds r4, 0x2E - movs r0, 0x4 - ldrsh r1, [r4, r0] - cmp r1, 0 - bne _081D8764 - movs r0, 0xC - strh r0, [r4, 0x6] - movs r0, 0x8 - b _081D87C2 -_081D8764: - movs r0, 0x80 - lsls r0, 1 - cmp r1, r0 - bne _081D8774 - movs r0, 0x9 - strh r0, [r4, 0x6] - movs r0, 0x7 - b _081D87C2 -_081D8774: - movs r0, 0x86 - lsls r0, 1 - cmp r1, r0 - bne _081D8784 - movs r0, 0x8 - strh r0, [r4, 0x6] - movs r0, 0x6 - b _081D87C2 -_081D8784: - movs r0, 0x8C - lsls r0, 1 - cmp r1, r0 - bne _081D8794 - movs r0, 0x7 - strh r0, [r4, 0x6] - movs r0, 0x5 - b _081D87C2 -_081D8794: - movs r0, 0x92 - lsls r0, 1 - cmp r1, r0 - bne _081D87A4 - movs r0, 0x6 - strh r0, [r4, 0x6] - movs r0, 0x4 - b _081D87C2 -_081D87A4: - movs r0, 0x98 - lsls r0, 1 - cmp r1, r0 - bne _081D87B4 - movs r0, 0x5 - strh r0, [r4, 0x6] - movs r0, 0x3 - b _081D87C2 -_081D87B4: - movs r0, 0xA0 - lsls r0, 1 - cmp r1, r0 - bne _081D87C4 - movs r0, 0x4 - strh r0, [r4, 0x6] - movs r0, 0x2 -_081D87C2: - strh r0, [r4, 0x8] -_081D87C4: - movs r1, 0x4 - ldrsh r0, [r4, r1] - movs r2, 0x6 - ldrsh r1, [r4, r2] - bl __modsi3 - cmp r0, 0 - bne _081D87EE - ldrh r0, [r5, 0x24] - subs r0, 0x1 - strh r0, [r5, 0x24] - ldr r2, =0x02020630 - movs r0, 0 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x24] - subs r1, 0x1 - strh r1, [r0, 0x24] -_081D87EE: - movs r1, 0x4 - ldrsh r0, [r4, r1] - movs r2, 0x8 - ldrsh r1, [r4, r2] - bl __modsi3 - cmp r0, 0 - bne _081D8818 - ldrh r0, [r5, 0x26] - adds r0, 0x1 - strh r0, [r5, 0x26] - ldr r2, =0x02020630 - movs r0, 0 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x26] - adds r1, 0x1 - strh r1, [r0, 0x26] -_081D8818: - ldrh r0, [r4, 0x4] - adds r0, 0x1 - strh r0, [r4, 0x4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D874C - - thumb_func_start sub_81D8828 -sub_81D8828: @ 81D8828 - push {r4,lr} - bl sub_8121DA0 - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0862AB44 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - ldr r4, =0x0203cf60 - ldr r1, [r4] - adds r1, 0x4 - movs r0, 0 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00000804 - adds r1, r0 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00001004 - adds r1, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00001804 - adds r1, r0 - movs r0, 0x3 - bl SetBgTilemapBuffer - bl sub_8121E10 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x3 - bl schedule_bg_copy_tilemap_to_vram - movs r1, 0xC1 - lsls r1, 6 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D8828 - - thumb_func_start sub_81D88D0 -sub_81D88D0: @ 81D88D0 - push {r4,lr} - sub sp, 0x4 - bl reset_temp_tile_data_buffers - ldr r1, =gUnknown_08DA80BC - movs r4, 0 - str r4, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r1, =gUnknown_08DA7EAC - str r4, [sp] - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r1, =gUnknown_08DA7C30 - str r4, [sp] - movs r0, 0x3 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram -_081D8904: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - bne _081D8904 - ldr r0, =gUnknown_08DA8D6C - ldr r4, =0x0203cf60 - ldr r1, [r4] - adds r1, 0x4 - bl LZDecompressWram - ldr r0, =gUnknown_08DA8B40 - ldr r1, [r4] - ldr r2, =0x00000804 - adds r1, r2 - bl LZDecompressWram - ldr r0, =gUnknown_08DA7FB4 - ldr r1, [r4] - ldr r2, =0x00001004 - adds r1, r2 - bl LZDecompressWram - ldr r0, =gUnknown_08DA7D6C - ldr r1, [r4] - ldr r2, =0x00001804 - adds r1, r2 - bl LZDecompressWram - ldr r0, =gUnknown_08DA8E84 - movs r1, 0 - movs r2, 0x80 - bl decompress_palette - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D88D0 - - thumb_func_start sub_81D8980 -sub_81D8980: @ 81D8980 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r5, =0x03005e08 - adds r6, r4, r5 - bl sub_81D8828 - bl sub_81D88D0 - bl sub_81D68C8 - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - ldr r0, =sub_81D67EC - bl SetVBlankCallback - movs r0, 0 - strh r0, [r6] - strh r0, [r6, 0x2] - ldr r0, =sub_81D8AD8 - movs r1, 0 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x4] - subs r5, 0x8 - adds r4, r5 - ldr r0, =sub_81D89E0 - str r0, [r4] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D8980 - - thumb_func_start sub_81D89E0 -sub_81D89E0: @ 81D89E0 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - bl sub_81D8BB4 - ldrh r1, [r4, 0x6] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - bne _081D8A16 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bgt _081D8A16 - movs r2, 0x2 - ldrsh r0, [r4, r2] - cmp r0, 0x59 - bgt _081D8A16 - movs r0, 0x67 - bl audio_play -_081D8A16: - ldrh r0, [r4, 0x6] - adds r0, 0x1 - strh r0, [r4, 0x6] - movs r0, 0 - ldrsh r5, [r4, r0] - cmp r5, 0x1 - beq _081D8A5C - cmp r5, 0x1 - bgt _081D8A34 - cmp r5, 0 - beq _081D8A3E - b _081D8AC6 - .pool -_081D8A34: - cmp r5, 0x2 - beq _081D8A8C - cmp r5, 0x3 - beq _081D8AA8 - b _081D8AC6 -_081D8A3E: - ldrh r1, [r4, 0x2] - movs r2, 0x2 - ldrsh r0, [r4, r2] - cmp r0, 0x8 - bne _081D8AA2 - movs r0, 0x1 - negs r0, r0 - str r5, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - strh r5, [r4, 0x2] - b _081D8A9A -_081D8A5C: - ldrh r1, [r4, 0x2] - movs r2, 0x2 - ldrsh r0, [r4, r2] - cmp r0, 0x7F - bne _081D8AA2 - movs r0, 0 - strh r0, [r4, 0x2] - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - ldr r2, =0x03005e00 - movs r0, 0x4 - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldr r1, =sub_81D8B2C - b _081D8AC4 - .pool -_081D8A8C: - ldrh r1, [r4, 0x2] - movs r2, 0x2 - ldrsh r0, [r4, r2] - cmp r0, 0xC - bne _081D8AA2 - movs r0, 0 - strh r0, [r4, 0x2] -_081D8A9A: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - b _081D8AC6 -_081D8AA2: - adds r0, r1, 0x1 - strh r0, [r4, 0x2] - b _081D8AC6 -_081D8AA8: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81D8BEC -_081D8AC4: - str r1, [r0] -_081D8AC6: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D89E0 - - thumb_func_start sub_81D8AD8 -sub_81D8AD8: @ 81D8AD8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r5, r1, r0 - ldrh r1, [r5, 0x1E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _081D8B1C - bl GenerateRandomNumber - movs r4, 0x7 - adds r1, r4, 0 - ands r1, r0 - subs r1, 0x4 - lsls r1, 8 - movs r0, 0x1 - movs r2, 0 - bl ChangeBgX - bl GenerateRandomNumber - ands r4, r0 - subs r4, 0x4 - lsls r4, 8 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0 - bl ChangeBgY -_081D8B1C: - ldrh r0, [r5, 0x1E] - adds r0, 0x1 - strh r0, [r5, 0x1E] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D8AD8 - - thumb_func_start sub_81D8B2C -sub_81D8B2C: @ 81D8B2C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r4, r1, r0 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081D8B70 - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - movs r0, 0xA - strh r0, [r4, 0x2] - movs r1, 0x1 - negs r1, r1 - adds r0, r1, 0 - b _081D8BAA - .pool -_081D8B70: - cmp r0, 0x1 - bne _081D8BAC - movs r0, 0x2 - ldrsh r1, [r4, r0] - lsls r1, 8 - movs r0, 0x1 - movs r2, 0x2 - bl ChangeBgX - movs r0, 0x2 - ldrsh r1, [r4, r0] - lsls r1, 8 - movs r0, 0x1 - movs r2, 0x1 - bl ChangeBgY - ldrh r0, [r4, 0x4] - ldrh r1, [r4, 0x2] - adds r0, r1 - strh r0, [r4, 0x2] - lsls r0, 16 - asrs r0, 16 - movs r1, 0xA - negs r1, r1 - cmp r0, r1 - bne _081D8BAC - movs r1, 0x4 - ldrsh r0, [r4, r1] - negs r0, r0 -_081D8BAA: - strh r0, [r4, 0x4] -_081D8BAC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81D8B2C - - thumb_func_start sub_81D8BB4 -sub_81D8BB4: @ 81D8BB4 - push {r4,lr} - movs r4, 0x80 - lsls r4, 3 - movs r0, 0x2 - adds r1, r4, 0 - movs r2, 0x2 - bl ChangeBgX - movs r0, 0x2 - adds r1, r4, 0 - movs r2, 0x1 - bl ChangeBgY - movs r4, 0x80 - lsls r4, 4 - movs r0, 0 - adds r1, r4, 0 - movs r2, 0x2 - bl ChangeBgX - movs r0, 0 - adds r1, r4, 0 - movs r2, 0x1 - bl ChangeBgY - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81D8BB4 - - thumb_func_start sub_81D8BEC -sub_81D8BEC: @ 81D8BEC - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r5, r1, 3 - ldr r6, =0x03005e08 - adds r4, r5, r6 - bl sub_81D8BB4 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081D8C26 - movs r0, 0 - bl SetVBlankCallback - bl sub_81D6904 - ldrb r0, [r4, 0x4] - bl remove_task - adds r0, r6, 0 - subs r0, 0x8 - adds r0, r5, r0 - ldr r1, =sub_81D6840 - str r1, [r0] -_081D8C26: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D8BEC - - thumb_func_start sub_81D8C38 -sub_81D8C38: @ 81D8C38 - push {r4,lr} - bl sub_8121DA0 - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0862AD08 - movs r0, 0x1 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r4, =0x0203cf60 - ldr r1, [r4] - adds r1, 0x4 - movs r0, 0 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00000804 - adds r1, r0 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00001004 - adds r1, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - bl sub_8121E10 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - movs r1, 0xC1 - lsls r1, 6 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D8C38 - - thumb_func_start sub_81D8CC4 -sub_81D8CC4: @ 81D8CC4 - push {r4,lr} - sub sp, 0x4 - bl reset_temp_tile_data_buffers - ldr r1, =gUnknown_08DAAB24 - movs r4, 0 - str r4, [sp] - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r1, =gUnknown_08DAA8B4 - str r4, [sp] - movs r0, 0 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram -_081D8CEA: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - bne _081D8CEA - ldr r0, =gUnknown_08DAAE54 - ldr r4, =0x0203cf60 - ldr r1, [r4] - ldr r2, =0x00000804 - adds r1, r2 - bl LZDecompressWram - ldr r0, =gUnknown_08DAAC1C - ldr r1, [r4] - adds r1, 0x4 - bl LZDecompressWram - ldr r0, =gUnknown_08DAAF98 - ldr r1, [r4] - ldr r2, =0x00001004 - adds r1, r2 - bl LZDecompressWram - ldr r0, =gUnknown_08DAAFEC - movs r1, 0 - movs r2, 0x60 - bl decompress_palette - ldr r0, =gUnknown_0862AC28 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0862AC30 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0862AC38 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0862AC40 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0862AC48 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0862AC50 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0862AC58 - bl LoadCompressedObjectPalette - ldr r0, =gUnknown_0862AC60 - bl LoadCompressedObjectPalette - ldr r0, =gUnknown_0862AC68 - bl LoadCompressedObjectPalette - ldr r0, =gUnknown_0862AC70 - bl LoadCompressedObjectPalette - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D8CC4 - - thumb_func_start sub_81D8DB4 -sub_81D8DB4: @ 81D8DB4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r5, =0x03005e08 - adds r6, r4, r5 - bl sub_81D8C38 - bl sub_81D8CC4 - bl sub_81D68C8 - movs r1, 0x80 - lsls r1, 3 - movs r0, 0 - bl ClearGpuRegBits - ldr r1, =0x00000241 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x00000e09 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - ldr r0, =sub_81D67EC - bl SetVBlankCallback - movs r0, 0 - strh r0, [r6] - strh r0, [r6, 0x2] - subs r5, 0x8 - adds r4, r5 - ldr r0, =sub_81D8E80 - str r0, [r4] - ldr r0, =sub_81D8FB0 - movs r1, 0 - bl AddTask - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x4] - movs r0, 0x4 - ldrsh r1, [r6, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - movs r2, 0 - strh r2, [r0, 0x8] - movs r0, 0x4 - ldrsh r1, [r6, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - strh r2, [r0, 0xA] - movs r0, 0x4 - ldrsh r1, [r6, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - strh r2, [r0, 0xC] - movs r0, 0x4 - ldrsh r1, [r6, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - movs r2, 0x1 - strh r2, [r0, 0xE] - movs r0, 0x4 - ldrsh r1, [r6, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - strh r2, [r0, 0x10] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D8DB4 - - thumb_func_start sub_81D8E80 -sub_81D8E80: @ 81D8E80 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r7, r0, 3 - ldr r0, =0x03005e08 - mov r8, r0 - adds r4, r7, r0 - movs r1, 0 - ldrsh r5, [r4, r1] - cmp r5, 0x1 - beq _081D8EDE - cmp r5, 0x1 - bgt _081D8EB0 - cmp r5, 0 - beq _081D8EBA - b _081D8FA0 - .pool -_081D8EB0: - cmp r5, 0x2 - beq _081D8F1E - cmp r5, 0x3 - beq _081D8F84 - b _081D8FA0 -_081D8EBA: - ldrh r1, [r4, 0x2] - movs r2, 0x2 - ldrsh r0, [r4, r2] - cmp r0, 0x8 - bne _081D8F18 - adds r0, r6, 0 - bl sub_81D90A8 - movs r0, 0x1 - negs r0, r0 - str r5, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - strh r5, [r4, 0x2] - b _081D8F30 -_081D8EDE: - ldr r2, =0x02020630 - movs r0, 0xA - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =sub_81D97E0 - cmp r1, r0 - bne _081D8FA0 - ldrh r1, [r4, 0x2] - movs r2, 0x2 - ldrsh r0, [r4, r2] - cmp r0, 0x40 - bne _081D8F18 - adds r0, r6, 0 - bl sub_81D94D4 - adds r0, r6, 0 - bl sub_81D93D8 - b _081D8F2C - .pool -_081D8F18: - adds r0, r1, 0x1 - strh r0, [r4, 0x2] - b _081D8FA0 -_081D8F1E: - ldrh r2, [r4, 0x2] - movs r0, 0x2 - ldrsh r1, [r4, r0] - movs r0, 0xE0 - lsls r0, 1 - cmp r1, r0 - bne _081D8F38 -_081D8F2C: - movs r0, 0 - strh r0, [r4, 0x2] -_081D8F30: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - b _081D8FA0 -_081D8F38: - adds r0, r2, 0x1 - strh r0, [r4, 0x2] - movs r1, 0x2 - ldrsh r0, [r4, r1] - movs r1, 0x90 - bl __modsi3 - lsls r0, 16 - asrs r4, r0, 16 - cmp r4, 0 - bne _081D8FA0 - ldr r0, =0x0000fffe - ldr r1, =0x0000ffff - str r1, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl sub_80A2C44 - ldr r0, =0xffff0000 - str r4, [sp] - str r4, [sp, 0x4] - movs r1, 0x1 - str r1, [sp, 0x8] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl sub_80A2C44 - b _081D8FA0 - .pool -_081D8F84: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r1, 0x4 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - mov r0, r8 - subs r0, 0x8 - adds r0, r7, r0 - ldr r1, =sub_81D9034 - str r1, [r0] -_081D8FA0: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D8E80 - - thumb_func_start sub_81D8FB0 -sub_81D8FB0: @ 81D8FB0 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r4, r1, r0 - ldrh r1, [r4] - movs r0, 0xF - ands r0, r1 - cmp r0, 0 - bne _081D9024 - ldrh r1, [r4, 0x2] - adds r1, 0xE - lsls r1, 8 - movs r2, 0xF8 - lsls r2, 5 - adds r0, r2, 0 - ands r1, r0 - ldrh r0, [r4, 0x4] - adds r0, 0x9 - movs r2, 0xF - ands r0, r2 - orrs r1, r0 - movs r0, 0x52 - bl SetGpuReg - ldrh r1, [r4, 0x2] - ldrh r0, [r4, 0x6] - subs r1, r0 - strh r1, [r4, 0x2] - ldrh r0, [r4, 0x8] - ldrh r2, [r4, 0x4] - adds r0, r2 - strh r0, [r4, 0x4] - lsls r1, 16 - asrs r1, 16 - movs r0, 0x3 - negs r0, r0 - cmp r1, r0 - beq _081D9008 - cmp r1, 0 - bne _081D9010 -_081D9008: - movs r1, 0x6 - ldrsh r0, [r4, r1] - negs r0, r0 - strh r0, [r4, 0x6] -_081D9010: - movs r2, 0x4 - ldrsh r0, [r4, r2] - cmp r0, 0x3 - beq _081D901C - cmp r0, 0 - bne _081D9024 -_081D901C: - movs r1, 0x8 - ldrsh r0, [r4, r1] - negs r0, r0 - strh r0, [r4, 0x8] -_081D9024: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D8FB0 - - thumb_func_start sub_81D9034 -sub_81D9034: @ 81D9034 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r6, r1, 3 - ldr r7, =0x03005e08 - adds r4, r6, r7 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _081D90A0 - bl sub_80A2F30 - movs r1, 0x2 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081D9078 - movs r0, 0 - bl SetVBlankCallback - bl sub_81D6904 - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - ldrb r0, [r4, 0x4] - bl remove_task -_081D9078: - ldrh r1, [r4, 0x2] - movs r2, 0x2 - ldrsh r0, [r4, r2] - cmp r0, 0x20 - bne _081D909C - strh r5, [r4, 0x2] - adds r0, r7, 0 - subs r0, 0x8 - adds r0, r6, r0 - ldr r1, =sub_81D6840 - str r1, [r0] - b _081D90A0 - .pool -_081D909C: - adds r0, r1, 0x1 - strh r0, [r4, 0x2] -_081D90A0: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81D9034 - - thumb_func_start sub_81D90A8 -sub_81D90A8: @ 81D90A8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =0x03005e08 - adds r4, r0 - ldr r0, =gUnknown_0862AC78 - movs r1, 0x40 - movs r2, 0x78 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x6] - movs r0, 0x6 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x0202065e - mov r10, r1 - adds r7, r0, r1 - ldr r0, =gUnknown_0862AC90 - movs r1, 0x10 - movs r2, 0x82 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7] - movs r2, 0x2E - negs r2, r2 - add r2, r10 - mov r8, r2 - movs r1, 0x6 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r8 - ldrb r2, [r1, 0x5] - movs r6, 0xD - negs r6, r6 - adds r0, r6, 0 - ands r0, r2 - movs r2, 0x4 - mov r9, r2 - mov r2, r9 - orrs r0, r2 - strb r0, [r1, 0x5] - movs r1, 0 - ldrsh r0, [r7, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r8 - ldrb r2, [r1, 0x5] - adds r0, r6, 0 - ands r0, r2 - mov r2, r9 - orrs r0, r2 - strb r0, [r1, 0x5] - ldr r5, =gUnknown_0862ACA8 - adds r0, r5, 0 - movs r1, 0xA0 - movs r2, 0x80 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x8] - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - mov r1, r10 - adds r7, r0, r1 - adds r0, r5, 0 - movs r1, 0xC0 - movs r2, 0x80 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7] - adds r0, r5, 0 - movs r1, 0xE0 - movs r2, 0x80 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7, 0x2] - movs r2, 0x8 - ldrsh r0, [r4, r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r8 - ldrb r2, [r1, 0x5] - adds r0, r6, 0 - ands r0, r2 - mov r2, r9 - orrs r0, r2 - strb r0, [r1, 0x5] - movs r1, 0 - ldrsh r0, [r7, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r8 - ldrb r2, [r1, 0x5] - adds r0, r6, 0 - ands r0, r2 - mov r2, r9 - orrs r0, r2 - strb r0, [r1, 0x5] - movs r1, 0x2 - ldrsh r0, [r7, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r8 - ldrb r2, [r1, 0x5] - adds r0, r6, 0 - ands r0, r2 - mov r2, r9 - orrs r0, r2 - strb r0, [r1, 0x5] - movs r0, 0 - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - movs r1, 0x1 - bl StartObjectImageAnim - movs r2, 0x2 - ldrsh r1, [r7, r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - movs r1, 0x2 - bl StartObjectImageAnim - ldr r0, =gUnknown_0862ACC0 - movs r2, 0x41 - negs r2, r2 - movs r1, 0x78 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0xA] - movs r0, 0xA - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - mov r1, r10 - adds r7, r0, r1 - ldr r0, =gUnknown_0862ACD8 - movs r2, 0x71 - negs r2, r2 - movs r1, 0x78 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7] - movs r2, 0xA - ldrsh r0, [r4, r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r8 - ldrb r2, [r1, 0x5] - adds r0, r6, 0 - ands r0, r2 - mov r2, r9 - orrs r0, r2 - strb r0, [r1, 0x5] - movs r0, 0 - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - ldrb r1, [r0, 0x5] - ands r6, r1 - orrs r6, r2 - strb r6, [r0, 0x5] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D90A8 - - thumb_func_start sub_81D9274 -sub_81D9274: @ 81D9274 - push {r4-r6,lr} - mov r6, r8 - push {r6} - lsls r0, 24 - lsrs r0, 24 - lsls r2, r0, 2 - adds r2, r0 - lsls r2, 3 - ldr r0, =0x03005e08 - adds r2, r0 - ldr r3, =0x02020630 - movs r0, 0x6 - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - movs r1, 0x1C - adds r1, r3 - mov r8, r1 - add r0, r8 - ldr r6, =pokemon_alive_on_battle_side - str r6, [r0] - movs r0, 0x6 - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r4, 0 - strh r4, [r0, 0x36] - movs r0, 0x6 - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x38] - movs r0, 0x6 - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r5, 0x4 - strh r5, [r0, 0x3A] - movs r0, 0x6 - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x3C] - movs r0, 0x8 - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - str r6, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x36] - movs r0, 0x8 - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x38] - movs r0, 0x8 - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r5, [r0, 0x3A] - movs r0, 0x8 - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0x1 - strh r1, [r0, 0x3C] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D9274 - - thumb_func_start pokemon_alive_on_battle_side -pokemon_alive_on_battle_side: @ 81D9338 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x36] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - bne _081D93CC - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081D9370 - ldrh r0, [r4, 0x20] - ldrh r3, [r4, 0x3A] - subs r0, r3 - strh r0, [r4, 0x20] - ldr r2, =0x02020630 - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x20] - subs r1, r3 - b _081D939E - .pool -_081D9370: - ldrh r2, [r4, 0x3A] - ldrh r1, [r4, 0x20] - adds r0, r2, r1 - strh r0, [r4, 0x20] - ldr r3, =0x02020630 - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x20] - adds r2, r1 - strh r2, [r0, 0x20] - movs r2, 0x30 - ldrsh r1, [r4, r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r4, 0x3A] - ldrh r2, [r0, 0x20] - adds r1, r2 -_081D939E: - strh r1, [r0, 0x20] - ldrh r1, [r4, 0x38] - adds r1, 0x1 - movs r2, 0 - strh r1, [r4, 0x38] - ldrh r0, [r4, 0x3A] - subs r0, r1 - strh r0, [r4, 0x3A] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x3 - bne _081D93CC - strh r2, [r4, 0x36] - strh r2, [r4, 0x38] - strh r2, [r4, 0x3A] - ldr r0, =DummyObjectCallback - str r0, [r4, 0x1C] - b _081D93D2 - .pool -_081D93CC: - ldrh r0, [r4, 0x36] - adds r0, 0x1 - strh r0, [r4, 0x36] -_081D93D2: - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemon_alive_on_battle_side - - thumb_func_start sub_81D93D8 -sub_81D93D8: @ 81D93D8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r2, r0, 2 - adds r2, r0 - lsls r2, 3 - ldr r0, =0x03005e08 - adds r2, r0 - ldr r3, =0x02020630 - movs r0, 0x6 - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r3, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_81D9420 - str r1, [r0] - movs r0, 0x6 - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0x1 - bl StartObjectImageAnim - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D93D8 - - thumb_func_start sub_81D9420 -sub_81D9420: @ 81D9420 - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x2B - ldrb r0, [r0] - cmp r0, 0x1 - beq _081D9488 - cmp r0, 0x1 - bgt _081D9436 - cmp r0, 0 - beq _081D9440 - b _081D94C4 -_081D9436: - cmp r0, 0x2 - beq _081D9440 - cmp r0, 0x3 - beq _081D9488 - b _081D94C4 -_081D9440: - adds r0, r4, 0 - adds r0, 0x2C - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 26 - movs r1, 0xC - bl __umodsi3 - lsls r0, 24 - ldr r2, =0x02020630 - cmp r0, 0 - bne _081D9470 - ldrh r0, [r4, 0x20] - subs r0, 0x2 - strh r0, [r4, 0x20] - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x20] - subs r1, 0x2 - strh r1, [r0, 0x20] -_081D9470: - movs r1, 0x2E - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0 - strh r0, [r1, 0x26] - b _081D94C4 - .pool -_081D9488: - ldr r2, =0x02020630 - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0000fffe - strh r1, [r0, 0x26] - adds r0, r4, 0 - adds r0, 0x2C - ldrb r1, [r0] - lsls r1, 26 - lsrs r1, 26 - movs r0, 0xF - ands r0, r1 - cmp r0, 0 - bne _081D94C4 - ldrh r0, [r4, 0x22] - adds r0, 0x1 - strh r0, [r4, 0x22] - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x22] - adds r1, 0x1 - strh r1, [r0, 0x22] -_081D94C4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D9420 - - thumb_func_start sub_81D94D4 -sub_81D94D4: @ 81D94D4 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r1, r0 - movs r0, 0x8 - ldrsh r1, [r1, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r2, =0x0202065e - adds r4, r0, r2 - subs r2, 0x12 - adds r0, r2 - ldr r3, =sub_81D9528 - str r3, [r0] - movs r0, 0 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - str r3, [r0] - movs r0, 0x2 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - str r3, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D94D4 - - thumb_func_start sub_81D9528 -sub_81D9528: @ 81D9528 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r7, r0, 0 - ldrh r1, [r7, 0x36] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _081D9550 - ldrh r1, [r7, 0x24] - movs r2, 0x24 - ldrsh r0, [r7, r2] - cmp r0, 0x1 - bne _081D954C - ldr r0, =0x0000ffff - b _081D954E - .pool -_081D954C: - movs r0, 0x1 -_081D954E: - strh r0, [r7, 0x24] -_081D9550: - movs r1, 0x38 - ldrsh r0, [r7, r1] - cmp r0, 0x80 - bne _081D95CE - ldr r2, =gUnknown_0862ACF0 - mov r8, r2 - mov r0, r8 - movs r1, 0x98 - movs r2, 0x84 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7, 0x3C] - ldr r5, =0x02020630 - movs r1, 0x3C - ldrsh r0, [r7, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r2, [r1, 0x5] - movs r4, 0xD - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - movs r6, 0x4 - orrs r0, r6 - strb r0, [r1, 0x5] - mov r0, r8 - movs r1, 0xE0 - movs r2, 0x84 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7, 0x3C] - movs r2, 0x3C - ldrsh r1, [r7, r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r1, [r0, 0x5] - ands r4, r1 - orrs r4, r6 - strb r4, [r0, 0x5] - movs r0, 0x3C - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3F - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] - ldrh r0, [r7, 0x38] - adds r0, 0x1 - strh r0, [r7, 0x38] -_081D95CE: - ldrh r1, [r7, 0x38] - movs r2, 0x38 - ldrsh r0, [r7, r2] - cmp r0, 0x7F - ble _081D95F8 - movs r1, 0x26 - ldrsh r0, [r7, r1] - cmp r0, 0x20 - beq _081D95FC - ldrh r0, [r7, 0x3A] - adds r0, 0x1 - strh r0, [r7, 0x3A] - lsls r0, 16 - asrs r0, 20 - strh r0, [r7, 0x26] - b _081D95FC - .pool -_081D95F8: - adds r0, r1, 0x1 - strh r0, [r7, 0x38] -_081D95FC: - ldrh r0, [r7, 0x36] - movs r1, 0x3F - ands r0, r1 - cmp r0, 0 - bne _081D960C - movs r0, 0xA5 - bl audio_play -_081D960C: - ldrh r0, [r7, 0x36] - adds r0, 0x1 - strh r0, [r7, 0x36] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81D9528 - - thumb_func_start sub_81D961C -sub_81D961C: @ 81D961C - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x3C - ldrsh r1, [r4, r0] - cmp r1, 0x40 - bgt _081D968C - ldrh r0, [r4, 0x26] - adds r0, 0x2 - strh r0, [r4, 0x26] - ldr r5, =0x02020630 - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrh r1, [r0, 0x26] - adds r1, 0x2 - strh r1, [r0, 0x26] - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0x40 - beq _081D964C - b _081D979E -_081D964C: - movs r3, 0x30 - negs r3, r3 - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - bl sub_81D9868 - movs r2, 0x5 - strh r2, [r4, 0x36] - ldr r0, =0x0000ffff - strh r0, [r4, 0x38] - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x3 - strh r1, [r0, 0x36] - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x38] - b _081D979E - .pool -_081D968C: - cmp r1, 0x6F - bgt _081D96BE - adds r0, r4, 0 - bl sub_81D97E0 - movs r1, 0x36 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081D96A4 - movs r0, 0x68 - bl audio_play -_081D96A4: - movs r0, 0x36 - ldrsh r1, [r4, r0] - movs r0, 0x3 - negs r0, r0 - cmp r1, r0 - bne _081D979E - adds r0, r4, 0 - movs r1, 0x2 - movs r2, 0x30 - movs r3, 0x10 - bl sub_81D9868 - b _081D979E -_081D96BE: - cmp r1, 0x70 - bne _081D96EC - ldr r2, =0x02020630 - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x7 - strh r1, [r0, 0x36] - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x3 - strh r1, [r0, 0x38] - b _081D96F2 - .pool -_081D96EC: - ldr r0, =0x00000147 - cmp r1, r0 - bgt _081D9700 -_081D96F2: - adds r0, r4, 0 - bl sub_81D97E0 - b _081D979E - .pool -_081D9700: - movs r0, 0xA4 - lsls r0, 1 - cmp r1, r0 - bne _081D974C - adds r0, r4, 0 - bl sub_81D97E0 - adds r0, r4, 0 - movs r1, 0x3 - movs r2, 0x30 - movs r3, 0x10 - bl sub_81D9868 - movs r3, 0x1 - strh r3, [r4, 0x24] - ldr r2, =0x02020630 - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r3, [r0, 0x24] - movs r0, 0xCB - lsls r0, 1 - movs r1, 0 - bl cry_related - ldr r0, =sub_81D98B4 - movs r1, 0 - bl AddTask - b _081D979E - .pool -_081D974C: - movs r0, 0xB0 - lsls r0, 1 - cmp r1, r0 - beq _081D9790 - adds r0, 0x18 - cmp r1, r0 - bne _081D979E - movs r3, 0 - strh r3, [r4, 0x24] - ldr r2, =0x02020630 - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r3, [r0, 0x24] - adds r0, r4, 0 - bl sub_81D97E0 - adds r0, r4, 0 - movs r1, 0x2 - movs r2, 0x30 - movs r3, 0x10 - bl sub_81D9868 - ldr r0, =sub_81D97E0 - str r0, [r4, 0x1C] - b _081D97D2 - .pool -_081D9790: - ldr r0, =sub_81D8E80 - bl get_task_id_by_function - lsls r0, 24 - lsrs r0, 24 - bl sub_81D9274 -_081D979E: - ldrh r2, [r4, 0x3C] - movs r0, 0x3C - ldrsh r1, [r4, r0] - movs r0, 0xA4 - lsls r0, 1 - cmp r1, r0 - ble _081D97CC - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - bne _081D97CC - movs r1, 0x24 - ldrsh r2, [r4, r1] - negs r2, r2 - strh r2, [r4, 0x24] - ldr r3, =0x02020630 - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r2, [r0, 0x24] -_081D97CC: - ldrh r0, [r4, 0x3C] - adds r0, 0x1 - strh r0, [r4, 0x3C] -_081D97D2: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D961C - - thumb_func_start sub_81D97E0 -sub_81D97E0: @ 81D97E0 - push {r4-r7,lr} - adds r3, r0, 0 - movs r0, 0x2E - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =0x02020630 - adds r4, r0, r5 - ldrh r1, [r3, 0x3A] - ldrh r0, [r4, 0x36] - ands r0, r1 - cmp r0, 0 - bne _081D985C - ldrh r2, [r3, 0x36] - ldrh r1, [r3, 0x26] - adds r0, r2, r1 - strh r0, [r3, 0x26] - movs r7, 0x2E - ldrsh r1, [r3, r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrh r1, [r0, 0x26] - adds r2, r1 - strh r2, [r0, 0x26] - ldrh r0, [r3, 0x38] - ldrh r2, [r3, 0x36] - adds r0, r2 - strh r0, [r3, 0x36] - lsls r0, 16 - asrs r5, r0, 16 - ldrh r6, [r4, 0x38] - movs r7, 0x38 - ldrsh r2, [r4, r7] - cmp r5, r2 - bge _081D9836 - movs r0, 0x36 - ldrsh r1, [r3, r0] - adds r0, r2, 0 - cmn r1, r0 - bgt _081D985C -_081D9836: - cmp r5, r2 - ble _081D9844 - strh r6, [r3, 0x36] - b _081D9854 - .pool -_081D9844: - movs r0, 0x36 - ldrsh r1, [r3, r0] - movs r2, 0x38 - ldrsh r0, [r4, r2] - cmn r1, r0 - bge _081D9854 - negs r0, r6 - strh r0, [r3, 0x36] -_081D9854: - movs r7, 0x38 - ldrsh r0, [r3, r7] - negs r0, r0 - strh r0, [r3, 0x38] -_081D985C: - ldrh r0, [r3, 0x3A] - adds r0, 0x1 - strh r0, [r3, 0x3A] - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81D97E0 - - thumb_func_start sub_81D9868 -sub_81D9868: @ 81D9868 - push {r4,r5,lr} - adds r5, r1, 0 - lsls r5, 24 - lsrs r5, 24 - movs r4, 0x2E - ldrsh r1, [r0, r4] - lsls r4, r1, 4 - adds r4, r1 - lsls r4, 2 - ldr r1, =0x02020630 - adds r4, r1 - lsls r2, 16 - asrs r2, 16 - ldrh r1, [r0, 0x20] - adds r2, r1 - strh r2, [r4, 0x20] - lsls r3, 16 - asrs r3, 16 - ldrh r1, [r0, 0x22] - adds r3, r1 - strh r3, [r4, 0x22] - ldrh r1, [r0, 0x24] - strh r1, [r4, 0x24] - ldrh r1, [r0, 0x26] - strh r1, [r4, 0x26] - adds r1, r5, 0 - bl StartObjectImageAnim - adds r0, r4, 0 - adds r1, r5, 0 - bl StartObjectImageAnim - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D9868 - - thumb_func_start sub_81D98B4 -sub_81D98B4: @ 81D98B4 - push {r4,r5,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - movs r0, 0 - ldrsh r1, [r4, r0] - cmp r1, 0x1 - beq _081D990C - cmp r1, 0x1 - bgt _081D98DC - cmp r1, 0 - beq _081D98E2 - b _081D99B4 - .pool -_081D98DC: - cmp r1, 0x2 - beq _081D99A4 - b _081D99B4 -_081D98E2: - movs r2, 0x80 - lsls r2, 7 - movs r0, 0x40 - str r0, [sp] - adds r0, 0xC0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r1, [sp, 0xC] - movs r0, 0x2 - adds r1, r2, 0 - movs r3, 0x78 - bl SetBgAffine - movs r1, 0x80 - lsls r1, 3 - movs r0, 0 - bl SetGpuRegBits - movs r0, 0x10 - strh r0, [r4, 0x8] - b _081D9922 -_081D990C: - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0x8 - bne _081D991A - movs r0, 0x12 - bl audio_play -_081D991A: - movs r3, 0x4 - ldrsh r0, [r4, r3] - cmp r0, 0x2 - bne _081D992A -_081D9922: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - b _081D99B4 -_081D992A: - ldrh r5, [r4, 0x8] - ldrh r1, [r4, 0x2] - adds r0, r5, r1 - strh r0, [r4, 0x2] - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - movs r3, 0x6 - ldrsh r0, [r4, r3] - movs r1, 0x3 - bl __modsi3 - lsls r0, 16 - cmp r0, 0 - bne _081D9954 - lsls r0, r5, 16 - asrs r0, 16 - cmp r0, 0x4 - beq _081D9954 - subs r0, r5, 0x2 - strh r0, [r4, 0x8] -_081D9954: - ldrh r0, [r4, 0x6] - adds r0, 0x1 - strh r0, [r4, 0x6] - movs r2, 0x80 - lsls r2, 7 - movs r0, 0x40 - str r0, [sp] - ldrh r0, [r4, 0x2] - movs r3, 0x80 - lsls r3, 1 - adds r1, r3, 0 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - str r0, [sp, 0x4] - ldrh r0, [r4, 0x2] - subs r1, r0 - lsls r1, 16 - asrs r1, 16 - str r1, [sp, 0x8] - movs r5, 0 - str r5, [sp, 0xC] - movs r0, 0x2 - adds r1, r2, 0 - movs r3, 0x78 - bl SetBgAffine - movs r1, 0x2 - ldrsh r0, [r4, r1] - cmp r0, 0xFF - ble _081D99B4 - strh r5, [r4, 0x2] - strh r5, [r4, 0x6] - strh r5, [r4, 0xA] - movs r0, 0x10 - strh r0, [r4, 0x8] - ldrh r0, [r4, 0x4] - adds r0, 0x1 - strh r0, [r4, 0x4] - b _081D99B4 -_081D99A4: - movs r1, 0x80 - lsls r1, 3 - movs r0, 0 - bl ClearGpuRegBits - adds r0, r5, 0 - bl remove_task -_081D99B4: - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81D98B4 - - thumb_func_start sub_81D99BC -sub_81D99BC: @ 81D99BC - push {r4,lr} - bl sub_80D2578 - cmp r0, 0 - bne _081D99DC - ldr r4, =0x02021cc4 - bl sub_80D2548 - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - movs r0, 0x1 - b _081D99DE - .pool -_081D99DC: - movs r0, 0 -_081D99DE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81D99BC - - thumb_func_start walda_maybe -walda_maybe: @ 81D99E4 - push {r4,lr} - sub sp, 0x8 - ldr r4, =0x02021dc4 - bl sub_80D2548 - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - movs r0, 0 - str r0, [sp] - ldr r0, =sub_81D9A1C - str r0, [sp, 0x4] - movs r0, 0x4 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0 - bl do_choose_name_or_words_screen - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end walda_maybe - - thumb_func_start sub_81D9A1C -sub_81D9A1C: @ 81D9A1C - push {r4,r5,lr} - ldr r4, =0x020375e0 - ldr r5, =0x02021dc4 - adds r0, r5, 0 - bl sub_81D9A98 - strh r0, [r4] - ldrh r0, [r4] - cmp r0, 0x1 - beq _081D9A68 - cmp r0, 0x1 - bgt _081D9A44 - cmp r0, 0 - beq _081D9A62 - b _081D9A68 - .pool -_081D9A44: - cmp r0, 0x2 - bne _081D9A68 - bl sub_80D2578 - cmp r0, 0 - beq _081D9A5C - ldr r0, =gUnknown_085EE49A - bl sub_80D255C - b _081D9A68 - .pool -_081D9A5C: - movs r0, 0x1 - strh r0, [r4] - b _081D9A68 -_081D9A62: - adds r0, r5, 0 - bl sub_80D255C -_081D9A68: - ldr r4, =0x02021cc4 - bl sub_80D2548 - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - ldr r1, =0x03005dac - ldr r0, =sub_80AF168 - str r0, [r1] - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D9A1C - - thumb_func_start sub_81D9A98 -sub_81D9A98: @ 81D9A98 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0xFF - bne _081D9AA6 - movs r0, 0x2 - b _081D9ABC -_081D9AA6: - bl sub_80D2548 - adds r1, r0, 0 - adds r0, r4, 0 - bl CompareString - cmp r0, 0 - beq _081D9ABA - movs r0, 0 - b _081D9ABC -_081D9ABA: - movs r0, 0x1 -_081D9ABC: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81D9A98 - - thumb_func_start sub_81D9AC4 -sub_81D9AC4: @ 81D9AC4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - ldr r0, =0x03005d90 - ldr r0, [r0] - adds r0, 0xA - bl sub_80842DC - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r0, =0x020375f0 - mov r8, r0 - bl sub_80D2548 - mov r7, sp - adds r7, 0xA - add r6, sp, 0xC - mov r5, sp - adds r5, 0xD - str r4, [sp] - str r0, [sp, 0x4] - add r0, sp, 0x8 - adds r1, r7, 0 - adds r2, r6, 0 - adds r3, r5, 0 - bl sub_81D9B68 - mov r1, r8 - strh r0, [r1] - lsls r0, 16 - cmp r0, 0 - beq _081D9B1E - ldrb r0, [r5] - bl sub_80D24BC - ldrb r0, [r6] - bl sub_80D24F0 - add r0, sp, 0x8 - ldrh r0, [r0] - ldrh r1, [r7] - bl sub_80D2524 -_081D9B1E: - mov r1, r8 - ldrh r0, [r1] - bl sub_80D2480 - mov r1, r8 - ldrb r0, [r1] - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D9AC4 - - thumb_func_start sub_81D9B40 -sub_81D9B40: @ 81D9B40 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - movs r1, 0 - ldr r3, =gUnknown_0862AD14 -_081D9B4A: - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _081D9B5C - lsls r0, r1, 24 - lsrs r0, 24 - b _081D9B64 - .pool -_081D9B5C: - adds r1, 0x1 - cmp r1, 0x1F - bls _081D9B4A - movs r0, 0x20 -_081D9B64: - pop {r1} - bx r1 - thumb_func_end sub_81D9B40 - - thumb_func_start sub_81D9B68 -sub_81D9B68: @ 81D9B68 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x2C - mov r10, r0 - str r1, [sp, 0x20] - str r2, [sp, 0x24] - str r3, [sp, 0x28] - ldr r0, [sp, 0x4C] - ldr r5, [sp, 0x50] - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - adds r0, r5, 0 - bl GetStringLength - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xF - bne _081D9C7E - movs r4, 0 - add r7, sp, 0x10 -_081D9B98: - adds r0, r5, r4 - ldrb r0, [r0] - bl sub_81D9B40 - adds r1, r7, r4 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x20 - beq _081D9C7E - adds r4, 0x1 - cmp r4, 0xE - ble _081D9B98 - movs r6, 0x3 - movs r5, 0 - movs r0, 0x5 - mov r8, r0 - movs r4, 0xD -_081D9BBC: - mov r1, r8 - str r1, [sp] - add r0, sp, 0x4 - adds r1, r7, 0 - adds r2, r5, 0 - adds r3, r6, 0 - bl sub_81D9D5C - adds r6, 0x8 - adds r5, 0x5 - subs r4, 0x1 - cmp r4, 0 - bge _081D9BBC - movs r0, 0x2 - str r0, [sp] - add r0, sp, 0x4 - adds r1, r7, 0 - movs r2, 0x46 - movs r3, 0x73 - bl sub_81D9D5C - add r0, sp, 0x4 - movs r1, 0 - movs r2, 0x3 - bl sub_81D9DAC - adds r4, r0, 0 - adds r0, r7, 0 - movs r1, 0x75 - movs r2, 0x3 - bl sub_81D9DAC - cmp r4, r0 - bne _081D9C7E - add r0, sp, 0x4 - movs r1, 0x9 - movs r2, 0x15 - bl sub_81D9C90 - add r0, sp, 0x4 - ldrb r0, [r0, 0x8] - movs r2, 0xF - ands r2, r0 - add r0, sp, 0x4 - movs r1, 0x8 - bl sub_81D9C90 - add r0, sp, 0x4 - ldrb r2, [r0, 0x8] - lsrs r2, 4 - movs r1, 0x8 - bl sub_81D9CDC - add r0, sp, 0x4 - ldrb r2, [r0, 0x6] - adds r1, r0, 0 - ldrb r0, [r0] - ldrb r1, [r1, 0x2] - eors r0, r1 - add r1, sp, 0x4 - ldrb r4, [r1, 0x4] - eors r0, r4 - mov r3, r9 - lsrs r1, r3, 8 - eors r0, r1 - cmp r2, r0 - bne _081D9C7E - add r0, sp, 0x4 - ldrb r3, [r0, 0x7] - adds r2, r0, 0 - ldrb r1, [r0, 0x1] - ldrb r0, [r2, 0x3] - eors r1, r0 - adds r0, r2, 0 - ldrb r2, [r0, 0x5] - eors r1, r2 - movs r0, 0xFF - mov r5, r9 - ands r0, r5 - eors r1, r0 - cmp r3, r1 - bne _081D9C7E - add r0, sp, 0x4 - ldrh r0, [r0] - mov r1, r10 - strh r0, [r1] - mov r0, sp - adds r0, 0x6 - ldrh r0, [r0] - ldr r3, [sp, 0x20] - strh r0, [r3] - ldr r5, [sp, 0x24] - strb r4, [r5] - ldr r0, [sp, 0x28] - strb r2, [r0] - movs r0, 0x1 - b _081D9C80 -_081D9C7E: - movs r0, 0 -_081D9C80: - 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_81D9B68 - - thumb_func_start sub_81D9C90 -sub_81D9C90: @ 81D9C90 - push {r4-r7,lr} - adds r7, r0, 0 - mov r12, r1 - subs r3, r2, 0x1 - cmp r2, 0 - beq _081D9CD6 -_081D9C9C: - ldrb r1, [r7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 31 - mov r2, r12 - subs r2, 0x1 - subs r5, r3, 0x1 - cmp r2, 0 - blt _081D9CCC - movs r6, 0x80 - adds r3, r2, r7 -_081D9CB4: - ldrb r1, [r3] - adds r0, r6, 0 - ands r0, r1 - lsls r0, 24 - lsls r1, 1 - orrs r4, r1 - strb r4, [r3] - lsrs r4, r0, 31 - subs r3, 0x1 - subs r2, 0x1 - cmp r2, 0 - bge _081D9CB4 -_081D9CCC: - adds r3, r5, 0 - movs r0, 0x1 - negs r0, r0 - cmp r3, r0 - bne _081D9C9C -_081D9CD6: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81D9C90 - - thumb_func_start sub_81D9CDC -sub_81D9CDC: @ 81D9CDC - push {r4-r6,lr} - adds r6, r0, 0 - adds r5, r1, 0 - lsls r2, 24 - lsrs r3, r2, 24 - lsls r0, r3, 4 - orrs r3, r0 - lsls r0, r3, 24 - lsrs r3, r0, 24 - movs r4, 0 - cmp r4, r5 - bcs _081D9D04 -_081D9CF4: - adds r2, r6, r4 - ldrb r1, [r2] - adds r0, r3, 0 - eors r0, r1 - strb r0, [r2] - adds r4, 0x1 - cmp r4, r5 - bcc _081D9CF4 -_081D9D04: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81D9CDC - - thumb_func_start sub_81D9D0C -sub_81D9D0C: @ 81D9D0C - push {lr} - lsrs r3, r1, 3 - movs r2, 0x7 - ands r2, r1 - movs r1, 0x80 - asrs r1, r2 - adds r0, r3 - ldrb r0, [r0] - ands r0, r1 - cmp r0, 0 - beq _081D9D24 - movs r0, 0x1 -_081D9D24: - pop {r1} - bx r1 - thumb_func_end sub_81D9D0C - - thumb_func_start sub_81D9D28 -sub_81D9D28: @ 81D9D28 - lsrs r3, r1, 3 - movs r2, 0x7 - ands r2, r1 - movs r1, 0x80 - asrs r1, r2 - lsls r1, 24 - lsrs r1, 24 - adds r0, r3 - ldrb r2, [r0] - orrs r1, r2 - strb r1, [r0] - bx lr - thumb_func_end sub_81D9D28 - - thumb_func_start sub_81D9D40 -sub_81D9D40: @ 81D9D40 - lsrs r3, r1, 3 - movs r2, 0x7 - ands r2, r1 - movs r1, 0x80 - asrs r1, r2 - mvns r1, r1 - lsls r1, 24 - lsrs r1, 24 - adds r0, r3 - ldrb r2, [r0] - ands r1, r2 - strb r1, [r0] - bx lr - thumb_func_end sub_81D9D40 - - thumb_func_start sub_81D9D5C -sub_81D9D5C: @ 81D9D5C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r6, r0, 0 - mov r9, r1 - adds r1, r2, 0 - mov r8, r3 - ldr r7, [sp, 0x1C] - movs r5, 0 - cmp r5, r7 - bcs _081D9DA0 - adds r4, r1, 0 -_081D9D76: - mov r0, r8 - adds r1, r0, r5 - mov r0, r9 - bl sub_81D9D0C - lsls r0, 24 - cmp r0, 0 - beq _081D9D90 - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_81D9D28 - b _081D9D98 -_081D9D90: - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_81D9D40 -_081D9D98: - adds r4, 0x1 - adds r5, 0x1 - cmp r5, r7 - bcc _081D9D76 -_081D9DA0: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81D9D5C - - thumb_func_start sub_81D9DAC -sub_81D9DAC: @ 81D9DAC - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r8, r0 - adds r7, r1, 0 - adds r6, r2, 0 - movs r4, 0 - movs r5, 0 - cmp r4, r6 - bcs _081D9DD6 -_081D9DC0: - lsls r4, 1 - adds r1, r7, r5 - mov r0, r8 - bl sub_81D9D0C - lsls r0, 24 - lsrs r0, 24 - orrs r4, r0 - adds r5, 0x1 - cmp r5, r6 - bcc _081D9DC0 -_081D9DD6: - adds r0, r4, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81D9DAC - - thumb_func_start sub_81D9DE4 -sub_81D9DE4: @ 81D9DE4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - movs r1, 0x1A - ldrsh r0, [r0, r1] - cmp r0, 0x4 - bhi _081D9EA4 - lsls r0, 2 - ldr r1, =_081D9E10 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081D9E10: - .4byte _081D9E24 - .4byte _081D9E44 - .4byte _081D9E64 - .4byte _081D9E84 - .4byte _081D9EA4 -_081D9E24: - ldr r4, =0x02039f31 - ldr r0, =0x02039f24 - ldrb r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x32 - b _081D9EB4 - .pool -_081D9E44: - ldr r4, =0x02039f31 - ldr r0, =0x02039f24 - ldrb r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x33 - b _081D9EB4 - .pool -_081D9E64: - ldr r4, =0x02039f31 - ldr r0, =0x02039f24 - ldrb r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x34 - b _081D9EB4 - .pool -_081D9E84: - ldr r4, =0x02039f31 - ldr r0, =0x02039f24 - ldrb r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x35 - b _081D9EB4 - .pool -_081D9EA4: - ldr r4, =0x02039f31 - ldr r0, =0x02039f24 - ldrb r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x36 -_081D9EB4: - bl pokemon_getattr - strb r0, [r4] - ldr r5, =0x02039e00 - ldr r4, =0x02039f25 - ldrb r0, [r4] - lsls r0, 6 - adds r0, r5 - ldr r1, =0x02039f31 - ldrb r1, [r1] - adds r0, 0x2C - strb r1, [r0] - ldr r0, =0x00000864 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - negs r0, r0 - lsrs r0, 31 - ldrb r1, [r4] - lsls r1, 6 - adds r1, r5 - adds r1, 0x2D - strb r0, [r1] - ldr r1, =sub_81DA160 - ldr r2, =sub_81D9F14 - adds r0, r6, 0 - bl set_task_function_and_args_14_15 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D9DE4 - - thumb_func_start sub_81D9F14 -sub_81D9F14: @ 81D9F14 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =sub_81DA244 - ldr r2, =sub_81D9F30 - bl set_task_function_and_args_14_15 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D9F14 - - thumb_func_start sub_81D9F30 -sub_81D9F30: @ 81D9F30 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =sub_81DA2E8 - ldr r2, =sub_81D9F4C - bl set_task_function_and_args_14_15 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D9F30 - - thumb_func_start sub_81D9F4C -sub_81D9F4C: @ 81D9F4C - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =sub_81DA3B8 - ldr r2, =sub_81D9F68 - bl set_task_function_and_args_14_15 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D9F4C - - thumb_func_start sub_81D9F68 -sub_81D9F68: @ 81D9F68 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r6, r0, 24 - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - movs r3, 0 - ldr r5, =0x02039f30 - mov r8, r5 - ldr r0, =0x020375e0 - mov r12, r0 - add r1, sp, 0x4 - mov r9, r1 - ldrb r4, [r5] - cmp r3, r4 - bcs _081D9FB2 - lsls r0, r6, 2 - adds r0, r6 - lsls r4, r0, 3 - ldr r7, =0x03005e08 -_081D9F98: - mov r0, sp - adds r2, r0, r3 - adds r1, r3, 0x1 - lsls r0, r1, 1 - adds r0, r4 - adds r0, r7 - ldrh r0, [r0] - strb r0, [r2] - lsls r1, 24 - lsrs r3, r1, 24 - ldrb r1, [r5] - cmp r3, r1 - bcc _081D9F98 -_081D9FB2: - movs r3, 0 - mov r4, r8 - ldrb r0, [r4] - cmp r3, r0 - bcs _081D9FD6 - adds r4, r0, 0 - mov r2, sp -_081D9FC0: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r4 - bcs _081D9FD6 - mov r7, sp - adds r1, r7, r3 - ldrb r0, [r2] - ldrb r1, [r1] - cmp r0, r1 - beq _081D9FC0 -_081D9FD6: - mov r0, r8 - ldrb r0, [r0] - cmp r3, r0 - bne _081D9FF4 - movs r0, 0 - mov r1, r12 - strh r0, [r1] - b _081D9FFA - .pool -_081D9FF4: - movs r0, 0x1 - mov r4, r12 - strh r0, [r4] -_081D9FFA: - movs r3, 0 - mov r7, r8 - mov r0, r8 - ldrb r0, [r0] - cmp r3, r0 - bcs _081DA02A - mov r4, r9 - lsls r0, r6, 2 - adds r0, r6 - lsls r2, r0, 3 - ldr r5, =0x03005e08 -_081DA010: - adds r1, r4, r3 - adds r0, r3, 0x5 - lsls r0, 1 - adds r0, r2 - adds r0, r5 - ldrh r0, [r0] - strb r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - ldrb r1, [r7] - cmp r3, r1 - bcc _081DA010 -_081DA02A: - mov r4, r8 - ldrb r0, [r4] - cmp r0, 0x4 - beq _081DA0B8 - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - bne _081DA0B8 - ldr r0, =0x02039e00 - adds r1, r0, 0 - adds r1, 0x2C - ldrb r2, [r1] - movs r3, 0x1 - ldrb r1, [r4] - adds r5, r0, 0 - cmp r3, r1 - bcs _081DA06C - adds r4, r5, 0 - mov r7, r8 - ldrb r1, [r7] -_081DA054: - lsls r0, r3, 6 - adds r0, r4 - adds r0, 0x2C - ldrb r7, [r0] - cmp r2, r7 - bcs _081DA062 - ldrb r2, [r0] -_081DA062: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r1 - bcc _081DA054 -_081DA06C: - cmp r2, 0 - beq _081DA076 - subs r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 -_081DA076: - movs r4, 0x1 - movs r3, 0 - mov r0, r8 - ldrb r0, [r0] - cmp r3, r0 - bcs _081DA0AC - adds r0, r5, 0 - b _081DA0A2 - .pool -_081DA090: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - mov r1, r8 - ldrb r1, [r1] - cmp r3, r1 - bcs _081DA0AC - lsls r0, r3, 6 - adds r0, r5 -_081DA0A2: - adds r0, 0x2D - ldrb r0, [r0] - cmp r0, 0 - bne _081DA090 - movs r4, 0 -_081DA0AC: - mov r0, sp - ldrb r0, [r0] - adds r1, r2, 0 - adds r2, r4, 0 - bl sub_80DACBC -_081DA0B8: - mov r0, r9 - bl sub_80F86E0 - ldr r1, =0x02039f2b - strb r0, [r1] - ldr r0, =0x02039f30 - ldrb r0, [r0] - cmp r0, 0x3 - bhi _081DA0E8 - ldr r1, =sub_81DA488 - ldr r2, =sub_81DA10C - adds r0, r6, 0 - bl set_task_function_and_args_14_15 - b _081DA0F6 - .pool -_081DA0E8: - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81DA10C - str r0, [r1] -_081DA0F6: - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D9F68 - - thumb_func_start sub_81DA10C -sub_81DA10C: @ 81DA10C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x02039f2c - ldrb r0, [r0] - bl sub_80DB09C - ldr r1, =sub_80FCF40 - ldr r2, =sub_81DA138 - adds r0, r4, 0 - bl set_task_function_and_args_14_15 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81DA10C - - thumb_func_start sub_81DA138 -sub_81DA138: @ 81DA138 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - bl sub_80DCE58 - ldr r1, =sub_80FCFD0 - ldr r2, =sub_80F8714 - adds r0, r4, 0 - bl set_task_function_and_args_14_15 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81DA138 - - thumb_func_start sub_81DA160 -sub_81DA160: @ 81DA160 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - lsls r6, r7, 2 - adds r0, r6, r7 - lsls r4, r0, 3 - ldr r5, =0x03005e08 - adds r0, r4, r5 - adds r0, 0x18 - bl sub_80FC670 - cmp r0, 0 - beq _081DA224 - adds r0, r5, 0 - subs r0, 0x8 - adds r4, r0 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _081DA1A4 - cmp r0, 0x1 - beq _081DA1D4 - movs r0, 0 - strh r0, [r4, 0x8] - strh r0, [r4, 0x20] - adds r0, r7, 0 - bl set_task_function_to_args_14_15 - b _081DA224 - .pool -_081DA1A4: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _081DA224 - ldr r0, =0x02039f25 - ldrb r0, [r0] - lsls r0, 6 - ldr r1, =0x02039e00 - adds r0, r1 - movs r1, 0x40 - bl sub_80FC4F4 - cmp r0, 0x1 - bne _081DA224 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _081DA224 - .pool -_081DA1D4: - bl sub_80FC55C - lsls r0, 24 - cmp r0, 0 - beq _081DA224 - movs r5, 0 - ldr r0, =0x02039f30 - mov r8, r6 - ldrb r0, [r0] - cmp r5, r0 - bge _081DA214 - ldr r6, =0x020229e8 -_081DA1EC: - lsls r4, r5, 6 - ldr r0, =0x02039e00 - adds r4, r0 - lsls r1, r5, 8 - ldr r0, =0x020223c4 - adds r1, r0 - adds r0, r4, 0 - movs r2, 0x40 - bl memcpy - ldrh r1, [r6, 0x1A] - adds r0, r4, 0 - bl sub_80DFA08 - adds r6, 0x1C - adds r5, 0x1 - ldr r0, =0x02039f30 - ldrb r0, [r0] - cmp r5, r0 - blt _081DA1EC -_081DA214: - ldr r0, =0x03005e00 - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_081DA224: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81DA160 - - thumb_func_start sub_81DA244 -sub_81DA244: @ 81DA244 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r5, r0, 3 - ldr r6, =0x03005e08 - adds r0, r5, r6 - adds r0, 0x18 - bl sub_80FC670 - cmp r0, 0 - beq _081DA2D4 - adds r0, r6, 0 - subs r0, 0x8 - adds r5, r0 - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _081DA284 - cmp r0, 0x1 - beq _081DA2AC - movs r0, 0 - strh r0, [r5, 0x8] - strh r0, [r5, 0x20] - adds r0, r4, 0 - bl set_task_function_to_args_14_15 - b _081DA2D4 - .pool -_081DA284: - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - bne _081DA2CE - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _081DA2D4 - ldr r0, =0x03005d80 - movs r1, 0x4 - bl sub_80FC4F4 - cmp r0, 0x1 - bne _081DA2D4 - b _081DA2CE - .pool -_081DA2AC: - movs r0, 0 - bl sub_80FC530 - lsls r0, 24 - cmp r0, 0 - beq _081DA2D4 - ldr r0, =0x03005d80 - ldr r4, =0x020223c4 - adds r1, r4, 0 - movs r2, 0x4 - bl memcpy - ldr r0, =0x030060b8 - adds r1, r4, 0 - movs r2, 0x4 - bl memcpy -_081DA2CE: - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] -_081DA2D4: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81DA244 - - thumb_func_start sub_81DA2E8 -sub_81DA2E8: @ 81DA2E8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - mov r9, r0 - adds r0, r6 - lsls r5, r0, 3 - ldr r1, =0x03005e08 - mov r8, r1 - adds r0, r5, r1 - adds r0, 0x18 - bl sub_80FC670 - cmp r0, 0 - beq _081DA39E - movs r0, 0x8 - negs r0, r0 - add r0, r8 - mov r10, r0 - adds r4, r5, r0 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _081DA338 - cmp r0, 0x1 - beq _081DA35A - movs r0, 0 - strh r0, [r4, 0x8] - strh r0, [r4, 0x20] - adds r0, r6, 0 - bl set_task_function_to_args_14_15 - b _081DA39E - .pool -_081DA338: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _081DA39E - add r0, sp, 0x8 - movs r1, 0x6E - strh r1, [r0] - movs r1, 0x2 - bl sub_80FC4F4 - cmp r0, 0x1 - bne _081DA39E - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _081DA39E -_081DA35A: - bl sub_80FC55C - lsls r0, 24 - cmp r0, 0 - beq _081DA39E - movs r1, 0 - ldr r7, =0x02039f30 - ldrb r0, [r7] - cmp r1, r0 - bge _081DA390 - mov r0, r8 - adds r0, 0xA - adds r3, r5, r0 - ldr r4, =0x020223c4 - mov r2, sp - movs r5, 0x80 - lsls r5, 1 -_081DA37C: - ldrh r0, [r4] - strh r0, [r2] - strh r0, [r3] - adds r3, 0x2 - adds r4, r5 - adds r2, 0x2 - adds r1, 0x1 - ldrb r0, [r7] - cmp r1, r0 - blt _081DA37C -_081DA390: - mov r0, r9 - adds r1, r0, r6 - lsls r1, 3 - add r1, r10 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_081DA39E: - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81DA2E8 - - thumb_func_start sub_81DA3B8 -sub_81DA3B8: @ 81DA3B8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - mov r9, r0 - adds r0, r6 - lsls r5, r0, 3 - ldr r1, =0x03005e08 - mov r8, r1 - adds r0, r5, r1 - adds r0, 0x18 - bl sub_80FC670 - cmp r0, 0 - beq _081DA46E - movs r0, 0x8 - negs r0, r0 - add r0, r8 - mov r10, r0 - adds r4, r5, r0 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _081DA408 - cmp r0, 0x1 - beq _081DA42A - movs r0, 0 - strh r0, [r4, 0x8] - strh r0, [r4, 0x20] - adds r0, r6, 0 - bl set_task_function_to_args_14_15 - b _081DA46E - .pool -_081DA408: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _081DA46E - ldrh r1, [r4, 0x1A] - add r0, sp, 0x8 - strh r1, [r0] - movs r1, 0x2 - bl sub_80FC4F4 - cmp r0, 0x1 - bne _081DA46E - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _081DA46E -_081DA42A: - bl sub_80FC55C - lsls r0, 24 - cmp r0, 0 - beq _081DA46E - movs r1, 0 - ldr r7, =0x02039f30 - ldrb r0, [r7] - cmp r1, r0 - bge _081DA460 - mov r0, r8 - adds r0, 0x2 - adds r3, r5, r0 - ldr r4, =0x020223c4 - mov r2, sp - movs r5, 0x80 - lsls r5, 1 -_081DA44C: - ldrh r0, [r4] - strh r0, [r2] - strh r0, [r3] - adds r3, 0x2 - adds r4, r5 - adds r2, 0x2 - adds r1, 0x1 - ldrb r0, [r7] - cmp r1, r0 - blt _081DA44C -_081DA460: - mov r0, r9 - adds r1, r0, r6 - lsls r1, 3 - add r1, r10 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_081DA46E: - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81DA3B8 - - thumb_func_start sub_81DA488 -sub_81DA488: @ 81DA488 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r7, r6, 2 - adds r0, r7, r6 - lsls r4, r0, 3 - ldr r5, =0x03005e08 - adds r0, r4, r5 - adds r0, 0x18 - bl sub_80FC670 - cmp r0, 0 - beq _081DA55C - adds r0, r5, 0 - subs r0, 0x8 - adds r4, r0 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _081DA4CC - cmp r0, 0x1 - beq _081DA50C - movs r0, 0 - strh r0, [r4, 0x8] - strh r0, [r4, 0x20] - adds r0, r6, 0 - bl set_task_function_to_args_14_15 - b _081DA55C - .pool -_081DA4CC: - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - bne _081DA4FA - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _081DA55C - ldr r0, =0x02039f30 - ldrb r2, [r0] - lsls r0, r2, 6 - ldr r1, =0x02039e00 - adds r0, r1 - movs r1, 0x4 - subs r1, r2 - lsls r1, 22 - lsrs r1, 16 - bl sub_80FC4F4 - cmp r0, 0x1 - bne _081DA55C -_081DA4FA: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _081DA55C - .pool -_081DA50C: - movs r0, 0 - bl sub_80FC530 - lsls r0, 24 - cmp r0, 0 - beq _081DA55C - ldr r4, =0x02039f30 - ldrb r3, [r4] - lsls r0, r3, 6 - ldr r5, =0x02039e00 - adds r0, r5 - ldr r1, =0x020223c4 - movs r2, 0x4 - subs r2, r3 - lsls r2, 6 - bl memcpy - ldrb r4, [r4] - mov r8, r7 - cmp r4, 0x3 - bgt _081DA54C - lsls r0, r4, 6 - adds r5, r0, r5 - ldr r7, =0x020229e8 -_081DA53C: - ldrh r1, [r7, 0x1A] - adds r0, r5, 0 - bl sub_80DFA08 - adds r5, 0x40 - adds r4, 0x1 - cmp r4, 0x3 - ble _081DA53C -_081DA54C: - ldr r0, =0x03005e00 - mov r2, r8 - adds r1, r2, r6 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_081DA55C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81DA488 - - thumb_func_start sub_81DA57C -sub_81DA57C: @ 81DA57C - push {lr} - ldr r0, =0x00000864 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _081DA5CA - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1E - bhi _081DA5CA - movs r0, 0x5B - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _081DA5C0 - ldr r0, =gUnknown_0862AD34 - movs r1, 0x8 - movs r2, 0x5 - bl sub_81DA5D4 - b _081DA5CA - .pool -_081DA5C0: - ldr r0, =gUnknown_0862AD44 - movs r1, 0x7 - movs r2, 0x1 - bl sub_81DA5D4 -_081DA5CA: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81DA57C - - thumb_func_start sub_81DA5D4 -sub_81DA5D4: @ 81DA5D4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - mov r9, r0 - adds r7, r1, 0 - mov r10, r2 - movs r6, 0 - movs r0, 0x5 - mov r8, r0 - movs r5, 0 - cmp r5, r7 - bcs _081DA61C - mov r4, r9 -_081DA5F4: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r1, [r4] - ldr r2, =0x000009ca - adds r0, r2 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _081DA614 - adds r0, r1, 0 - bl sub_81DA6CC - cmp r8, r0 - ble _081DA612 - mov r8, r0 -_081DA612: - adds r6, 0x1 -_081DA614: - adds r4, 0x2 - adds r5, 0x1 - cmp r5, r7 - bcc _081DA5F4 -_081DA61C: - cmp r6, 0 - beq _081DA6BA - cmp r8, r10 - bhi _081DA6BA - movs r6, 0 - movs r5, 0 - cmp r5, r7 - bcs _081DA654 - mov r4, r9 -_081DA62E: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r1, [r4] - ldr r2, =0x000009ca - adds r0, r2 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _081DA64C - adds r0, r1, 0 - bl sub_81DA6CC - cmp r0, r8 - bne _081DA64C - adds r6, 0x1 -_081DA64C: - adds r4, 0x2 - adds r5, 0x1 - cmp r5, r7 - bcc _081DA62E -_081DA654: - cmp r6, 0 - beq _081DA6BA - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl __modsi3 - adds r6, r0, 0 - movs r5, 0 - cmp r5, r7 - bcs _081DA6BA - ldr r2, =0x03005d8c - ldr r3, =0x000009ca - mov r4, r9 -_081DA674: - ldr r0, [r2] - ldrh r1, [r4] - adds r0, r3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _081DA6B2 - adds r0, r1, 0 - str r2, [sp] - str r3, [sp, 0x4] - bl sub_81DA6CC - ldr r2, [sp] - ldr r3, [sp, 0x4] - cmp r0, r8 - bne _081DA6B2 - cmp r6, 0 - bne _081DA6B0 - ldr r0, [r2] - adds r0, r3 - ldrh r4, [r4] - adds r0, r4 - mov r1, r8 - strb r1, [r0] - b _081DA6BA - .pool -_081DA6B0: - subs r6, 0x1 -_081DA6B2: - adds r4, 0x2 - adds r5, 0x1 - cmp r5, r7 - bcc _081DA674 -_081DA6BA: - 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_81DA5D4 - - thumb_func_start sub_81DA6CC -sub_81DA6CC: @ 81DA6CC - push {r4-r6,lr} - adds r5, r0, 0 - movs r4, 0 - ldr r6, =gUnknown_085500A4 -_081DA6D4: - lsls r0, r4, 1 - lsls r1, r5, 4 - adds r0, r1 - adds r0, r6 - ldrh r0, [r0] - bl trainer_flag_check - lsls r0, 24 - cmp r0, 0 - bne _081DA6F0 - adds r0, r4, 0 - b _081DA6F8 - .pool -_081DA6F0: - adds r4, 0x1 - cmp r4, 0x4 - ble _081DA6D4 - movs r0, 0x5 -_081DA6F8: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81DA6CC - - thumb_func_start sub_81DA700 -sub_81DA700: @ 81DA700 - push {lr} - sub sp, 0x8 - add r1, sp, 0x4 - mov r0, sp - bl sub_8149F58 - ldr r0, =gUnknown_0862AD54 - ldr r1, [sp, 0x4] - bl LZ77UnCompVram - ldr r0, =gUnknown_0862AF30 - ldr r1, [sp] - bl LZ77UnCompVram - ldr r0, =gUnknown_0862B53C - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =gUnknown_0862B724 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0862B72C - bl LoadTaggedObjectPalette - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81DA700 - - thumb_func_start sub_81DA74C -sub_81DA74C: @ 81DA74C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r5, r0, 0 - adds r6, r1, 0 - ldr r0, [sp, 0x24] - ldr r1, [sp, 0x28] - ldr r4, [sp, 0x2C] - lsls r2, 24 - lsrs r2, 24 - str r2, [sp] - lsls r3, 24 - lsrs r3, 24 - mov r10, r3 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - lsls r4, 24 - lsrs r7, r4, 24 - ldr r0, =gUnknown_0862B758 - lsls r5, 16 - asrs r5, 16 - lsls r6, 16 - asrs r6, 16 - adds r1, r5, 0 - adds r2, r6, 0 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r5, r0, 24 - cmp r7, 0x1 - beq _081DA7D0 - cmp r7, 0x1 - bgt _081DA7A8 - cmp r7, 0 - beq _081DA7B8 - b _081DA7AC - .pool -_081DA7A8: - cmp r7, 0x2 - beq _081DA7E4 -_081DA7AC: - ldr r6, =0x02020630 - lsls r3, r5, 4 - b _081DA7F8 - .pool -_081DA7B8: - ldr r2, =0x02020630 - lsls r3, r5, 4 - adds r0, r3, r5 - lsls r0, 2 - adds r0, r2 - movs r1, 0x78 - strh r1, [r0, 0x2E] - movs r1, 0x2D - b _081DA7F4 - .pool -_081DA7D0: - ldr r2, =0x02020630 - lsls r3, r5, 4 - adds r0, r3, r5 - lsls r0, 2 - adds r0, r2 - movs r1, 0x59 - b _081DA7F0 - .pool -_081DA7E4: - ldr r2, =0x02020630 - lsls r3, r5, 4 - adds r0, r3, r5 - lsls r0, 2 - adds r0, r2 - movs r1, 0x97 -_081DA7F0: - strh r1, [r0, 0x2E] - movs r1, 0x61 -_081DA7F4: - strh r1, [r0, 0x30] - adds r6, r2, 0 -_081DA7F8: - adds r4, r3, r5 - lsls r4, 2 - adds r0, r4, r6 - mov r2, r8 - lsls r1, r2, 24 - asrs r1, 24 - movs r2, 0 - strh r1, [r0, 0x32] - mov r3, r9 - lsls r1, r3, 24 - asrs r1, 24 - strh r1, [r0, 0x34] - mov r1, sp - ldrh r1, [r1] - strh r1, [r0, 0x3A] - mov r3, r10 - strh r3, [r0, 0x3C] - strh r2, [r0, 0x36] - strh r2, [r0, 0x38] - adds r1, r7, 0 - bl StartObjectImageAnim - adds r0, r6, 0 - adds r0, 0x1C - adds r4, r0 - ldr r0, =sub_81DA848 - str r0, [r4] - adds r0, r5, 0 - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81DA74C - - thumb_func_start sub_81DA848 -sub_81DA848: @ 81DA848 - push {r4,r5,lr} - adds r3, r0, 0 - adds r2, r3, 0 - adds r2, 0x2E - movs r0, 0x20 - ldrsh r1, [r3, r0] - movs r4, 0x2E - ldrsh r0, [r3, r4] - cmp r1, r0 - bne _081DA874 - movs r5, 0x22 - ldrsh r1, [r3, r5] - movs r4, 0x2 - ldrsh r0, [r2, r4] - cmp r1, r0 - bne _081DA874 - ldr r0, =DummyObjectCallback - str r0, [r3, 0x1C] - b _081DA8B4 - .pool -_081DA874: - ldrh r4, [r2, 0x8] - movs r5, 0x8 - ldrsh r1, [r2, r5] - movs r5, 0xC - ldrsh r0, [r2, r5] - cmp r1, r0 - bne _081DA890 - ldrh r0, [r2, 0x4] - ldrh r1, [r3, 0x20] - adds r0, r1 - movs r1, 0 - strh r0, [r3, 0x20] - strh r1, [r2, 0x8] - b _081DA894 -_081DA890: - adds r0, r4, 0x1 - strh r0, [r2, 0x8] -_081DA894: - ldrh r4, [r2, 0xA] - movs r5, 0xA - ldrsh r1, [r2, r5] - movs r5, 0xE - ldrsh r0, [r2, r5] - cmp r1, r0 - bne _081DA8B0 - ldrh r0, [r2, 0x6] - ldrh r1, [r3, 0x22] - adds r0, r1 - movs r1, 0 - strh r0, [r3, 0x22] - strh r1, [r2, 0xA] - b _081DA8B4 -_081DA8B0: - adds r0, r4, 0x1 - strh r0, [r2, 0xA] -_081DA8B4: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81DA848 - - thumb_func_start sub_81DA8BC -sub_81DA8BC: @ 81DA8BC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - adds r6, r0, 0 - mov r8, r1 - ldr r0, [sp, 0x2C] - ldr r1, [sp, 0x30] - ldr r4, [sp, 0x34] - ldr r5, [sp, 0x38] - lsls r2, 16 - lsrs r2, 16 - str r2, [sp] - lsls r3, 16 - lsrs r3, 16 - str r3, [sp, 0x4] - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - lsls r1, 16 - lsrs r1, 16 - mov r9, r1 - lsls r4, 16 - lsrs r7, r4, 16 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_0862B758 - lsls r6, 16 - asrs r6, 16 - mov r1, r8 - lsls r1, 16 - asrs r1, 16 - mov r8, r1 - adds r1, r6, 0 - mov r2, r8 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - cmp r5, 0x1 - beq _081DA94C - cmp r5, 0x1 - bgt _081DA924 - cmp r5, 0 - beq _081DA934 - b _081DA928 - .pool -_081DA924: - cmp r5, 0x2 - beq _081DA960 -_081DA928: - ldr r2, =0x02020630 - lsls r3, r6, 4 - b _081DA972 - .pool -_081DA934: - ldr r2, =0x02020630 - lsls r3, r6, 4 - adds r0, r3, r6 - lsls r0, 2 - adds r0, r2 - movs r1, 0x78 - strh r1, [r0, 0x2E] - movs r1, 0x2D - b _081DA970 - .pool -_081DA94C: - ldr r2, =0x02020630 - lsls r3, r6, 4 - adds r0, r3, r6 - lsls r0, 2 - adds r0, r2 - movs r1, 0x59 - b _081DA96C - .pool -_081DA960: - ldr r2, =0x02020630 - lsls r3, r6, 4 - adds r0, r3, r6 - lsls r0, 2 - adds r0, r2 - movs r1, 0x97 -_081DA96C: - strh r1, [r0, 0x2E] - movs r1, 0x61 -_081DA970: - strh r1, [r0, 0x30] -_081DA972: - adds r4, r3, r6 - lsls r4, 2 - adds r0, r4, r2 - mov r3, sp - ldrh r3, [r3] - strh r3, [r0, 0x32] - mov r1, sp - ldrh r1, [r1, 0x4] - strh r1, [r0, 0x34] - mov r3, r10 - strh r3, [r0, 0x36] - mov r1, r9 - strh r1, [r0, 0x38] - strh r7, [r0, 0x3A] - adds r1, r5, 0 - str r2, [sp, 0x8] - bl StartObjectImageAnim - ldr r2, [sp, 0x8] - adds r0, r2, 0 - adds r0, 0x1C - adds r4, r0 - ldr r0, =sub_81DA9BC - str r0, [r4] - adds r0, r6, 0 - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81DA8BC - - thumb_func_start sub_81DA9BC -sub_81DA9BC: @ 81DA9BC - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x32] - bl sine2 - lsls r0, 16 - asrs r0, 16 - movs r2, 0x36 - ldrsh r1, [r4, r2] - muls r0, r1 - asrs r0, 12 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x32] - bl cosine2 - lsls r0, 16 - asrs r0, 16 - movs r3, 0x36 - ldrsh r1, [r4, r3] - muls r0, r1 - asrs r0, 12 - strh r0, [r4, 0x26] - movs r1, 0x32 - ldrsh r0, [r4, r1] - movs r2, 0x34 - ldrsh r1, [r4, r2] - adds r0, r1 - movs r1, 0xB4 - lsls r1, 1 - bl __modsi3 - strh r0, [r4, 0x32] - ldrh r2, [r4, 0x36] - movs r3, 0x36 - ldrsh r1, [r4, r3] - movs r3, 0x38 - ldrsh r0, [r4, r3] - cmp r1, r0 - beq _081DAA12 - ldrh r0, [r4, 0x3A] - adds r0, r2, r0 - strh r0, [r4, 0x36] - b _081DAA16 -_081DAA12: - ldr r0, =DummyObjectCallback - str r0, [r4, 0x1C] -_081DAA16: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81DA9BC - - thumb_func_start sub_81DAA20 -sub_81DAA20: @ 81DAA20 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x00002e90 - adds r0, r4, 0 - bl FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - movs r0, 0x10 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl RemoveObjectAndFreeTiles - movs r0, 0x12 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - movs r0, 0x14 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81DAA20 - - thumb_func_start sub_81DAA74 -sub_81DAA74: @ 81DAA74 - push {r4,r5,lr} - adds r3, r0, 0 - ldr r2, =0x02020630 - movs r0, 0x10 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r5, r2, 0 - adds r5, 0x1C - adds r0, r5 - ldr r4, [r0] - ldr r0, =DummyObjectCallback - cmp r4, r0 - bne _081DAAC4 - movs r0, 0x12 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r2, [r0] - cmp r2, r4 - bne _081DAAC4 - movs r1, 0x14 - ldrsh r0, [r3, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - ldr r0, [r1] - cmp r0, r2 - bne _081DAAC4 - movs r0, 0x1 - b _081DAAC6 - .pool -_081DAAC4: - movs r0, 0 -_081DAAC6: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81DAA74 - - thumb_func_start sub_81DAACC -sub_81DAACC: @ 81DAACC - push {r4,lr} - adds r4, r0, 0 - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _081DAB20 - bl sub_81DA700 - ldr r1, =0x00003f41 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 5 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r1, 0xA0 - lsls r1, 3 - movs r0, 0 - movs r2, 0x2 - bl ChangeBgY - movs r0, 0 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0x1 - b _081DAB46 - .pool -_081DAB20: - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl ClearGpuRegBits - movs r1, 0x80 - lsls r1, 7 - movs r0, 0 - bl ClearGpuRegBits - movs r1, 0x80 - lsls r1, 1 - movs r0, 0 - bl ClearGpuRegBits - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - movs r0, 0 -_081DAB46: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81DAACC - - thumb_func_start sub_81DAB4C -sub_81DAB4C: @ 81DAB4C - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081DAB64 - movs r1, 0x80 - lsls r1, 1 - movs r0, 0 - bl SetGpuRegBits -_081DAB64: - ldrh r1, [r4, 0xC] - movs r2, 0xC - ldrsh r0, [r4, r2] - cmp r0, 0x10 - bne _081DAB98 - ldrh r1, [r4, 0xE] - movs r2, 0xE - ldrsh r0, [r4, r2] - cmp r0, 0x1F - bne _081DAB92 - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - str r0, [sp] - adds r0, r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _081DABB0 -_081DAB92: - adds r0, r1, 0x1 - strh r0, [r4, 0xE] - b _081DABB0 -_081DAB98: - adds r0, r1, 0x1 - strh r0, [r4, 0xC] - ldrh r1, [r4, 0xC] - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg -_081DABB0: - movs r0, 0 - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81DAB4C - - thumb_func_start sub_81DABBC -sub_81DABBC: @ 81DABBC - push {r4,lr} - adds r4, r0, 0 - bl sub_81DAA74 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081DABD2 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_081DABD2: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81DABBC - - thumb_func_start sub_81DABDC -sub_81DABDC: @ 81DABDC - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_0862B770 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_081DABEE: - movs r1, 0x8 - ldrsh r0, [r4, r1] - lsls r0, 2 - adds r0, r5 - ldr r1, [r0] - adds r0, r4, 0 - bl _call_via_r1 - lsls r0, 24 - cmp r0, 0 - bne _081DABEE - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81DABDC - - thumb_func_start sub_81DAC14 -sub_81DAC14: @ 81DAC14 - push {r4-r6,lr} - sub sp, 0xC - adds r6, r0, 0 - movs r1, 0x33 - negs r1, r1 - movs r0, 0 - str r0, [sp] - movs r5, 0x2 - str r5, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x78 - movs r2, 0 - movs r3, 0 - bl sub_81DA74C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x10] - movs r0, 0x7 - negs r0, r0 - str r5, [sp] - movs r4, 0x2 - negs r4, r4 - str r4, [sp, 0x4] - movs r1, 0x1 - str r1, [sp, 0x8] - movs r1, 0xC1 - movs r2, 0 - movs r3, 0 - bl sub_81DA74C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x12] - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0xF7 - movs r1, 0xC1 - movs r2, 0 - movs r3, 0 - bl sub_81DA74C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x14] - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] - movs r0, 0 - add sp, 0xC - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81DAC14 - - thumb_func_start sub_81DAC80 -sub_81DAC80: @ 81DAC80 - push {lr} - adds r2, r0, 0 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081DACA4 - adds r0, r2, 0 - bl sub_81DAA20 - ldr r0, =sub_81DABDC - bl get_task_id_by_function - lsls r0, 24 - lsrs r0, 24 - bl remove_task -_081DACA4: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81DAC80 - - thumb_func_start sub_81DACB4 -sub_81DACB4: @ 81DACB4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_0862B784 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_081DACC6: - movs r1, 0x8 - ldrsh r0, [r4, r1] - lsls r0, 2 - adds r0, r5 - ldr r1, [r0] - adds r0, r4, 0 - bl _call_via_r1 - lsls r0, 24 - cmp r0, 0 - bne _081DACC6 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81DACB4 - - thumb_func_start sub_81DACEC -sub_81DACEC: @ 81DACEC - push {r4,r5,lr} - sub sp, 0xC - adds r5, r0, 0 - movs r0, 0 - str r0, [sp] - movs r4, 0x4 - negs r4, r4 - str r4, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x78 - movs r1, 0xC5 - movs r2, 0 - movs r3, 0 - bl sub_81DA74C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x10] - str r4, [sp] - movs r4, 0x2 - str r4, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - movs r0, 0xF1 - movs r1, 0x3B - movs r2, 0 - movs r3, 0x1 - bl sub_81DA74C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x12] - movs r0, 0x1 - negs r0, r0 - movs r1, 0x4 - str r1, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x3B - movs r2, 0 - movs r3, 0x1 - bl sub_81DA74C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x14] - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0 - add sp, 0xC - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81DACEC - - thumb_func_start sub_81DAD58 -sub_81DAD58: @ 81DAD58 - push {lr} - adds r2, r0, 0 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081DAD7C - adds r0, r2, 0 - bl sub_81DAA20 - ldr r0, =sub_81DACB4 - bl get_task_id_by_function - lsls r0, 24 - lsrs r0, 24 - bl remove_task -_081DAD7C: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81DAD58 - - thumb_func_start sub_81DAD8C -sub_81DAD8C: @ 81DAD8C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_0862B798 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_081DAD9E: - movs r1, 0x8 - ldrsh r0, [r4, r1] - lsls r0, 2 - adds r0, r5 - ldr r1, [r0] - adds r0, r4, 0 - bl _call_via_r1 - lsls r0, 24 - cmp r0, 0 - bne _081DAD9E - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81DAD8C - - thumb_func_start sub_81DADC4 -sub_81DADC4: @ 81DADC4 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x10 - mov r8, r0 - movs r6, 0x80 - str r6, [sp] - movs r4, 0 - str r4, [sp, 0x4] - movs r5, 0x4 - negs r5, r5 - str r5, [sp, 0x8] - str r4, [sp, 0xC] - movs r0, 0x78 - movs r1, 0x2D - movs r2, 0xC - movs r3, 0x4 - bl sub_81DA8BC - lsls r0, 24 - lsrs r0, 24 - mov r1, r8 - strh r0, [r1, 0x10] - str r6, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x1 - str r0, [sp, 0xC] - movs r0, 0x59 - movs r1, 0x61 - movs r2, 0xFC - movs r3, 0x4 - bl sub_81DA8BC - lsls r0, 24 - lsrs r0, 24 - mov r1, r8 - strh r0, [r1, 0x12] - str r6, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x2 - str r0, [sp, 0xC] - movs r0, 0x97 - movs r1, 0x61 - movs r2, 0x84 - movs r3, 0x4 - bl sub_81DA8BC - lsls r0, 24 - lsrs r0, 24 - mov r1, r8 - strh r0, [r1, 0x14] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - movs r0, 0 - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81DADC4 - - thumb_func_start sub_81DAE44 -sub_81DAE44: @ 81DAE44 - push {lr} - adds r2, r0, 0 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081DAE68 - adds r0, r2, 0 - bl sub_81DAA20 - ldr r0, =sub_81DAD8C - bl get_task_id_by_function - lsls r0, 24 - lsrs r0, 24 - bl remove_task -_081DAE68: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81DAE44 - - thumb_func_start sub_81DAE78 -sub_81DAE78: @ 81DAE78 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_0862B7AC - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_081DAE8A: - movs r1, 0x8 - ldrsh r0, [r4, r1] - lsls r0, 2 - adds r0, r5 - ldr r1, [r0] - adds r0, r4, 0 - bl _call_via_r1 - lsls r0, 24 - cmp r0, 0 - bne _081DAE8A - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81DAE78 - - thumb_func_start sub_81DAEB0 -sub_81DAEB0: @ 81DAEB0 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x10 - mov r8, r0 - movs r2, 0x8E - lsls r2, 1 - movs r6, 0x83 - str r6, [sp] - movs r5, 0x23 - str r5, [sp, 0x4] - movs r4, 0x3 - negs r4, r4 - str r4, [sp, 0x8] - movs r0, 0 - str r0, [sp, 0xC] - movs r0, 0x78 - movs r1, 0x50 - movs r3, 0x8 - bl sub_81DA8BC - lsls r0, 24 - lsrs r0, 24 - mov r1, r8 - strh r0, [r1, 0x10] - str r6, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x1 - str r0, [sp, 0xC] - movs r0, 0x78 - movs r1, 0x50 - movs r2, 0x2C - movs r3, 0x8 - bl sub_81DA8BC - lsls r0, 24 - lsrs r0, 24 - mov r1, r8 - strh r0, [r1, 0x12] - str r6, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x2 - str r0, [sp, 0xC] - movs r0, 0x79 - movs r1, 0x50 - movs r2, 0xA4 - movs r3, 0x8 - bl sub_81DA8BC - lsls r0, 24 - lsrs r0, 24 - mov r1, r8 - strh r0, [r1, 0x14] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - movs r0, 0 - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81DAEB0 - - thumb_func_start sub_81DAF34 -sub_81DAF34: @ 81DAF34 - push {lr} - adds r2, r0, 0 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081DAF58 - adds r0, r2, 0 - bl sub_81DAA20 - ldr r0, =sub_81DAE78 - bl get_task_id_by_function - lsls r0, 24 - lsrs r0, 24 - bl remove_task -_081DAF58: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81DAF34 - - thumb_func_start sub_81DAF68 -sub_81DAF68: @ 81DAF68 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_0862B7C0 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_081DAF7A: - movs r1, 0x8 - ldrsh r0, [r4, r1] - lsls r0, 2 - adds r0, r5 - ldr r1, [r0] - adds r0, r4, 0 - bl _call_via_r1 - lsls r0, 24 - cmp r0, 0 - bne _081DAF7A - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81DAF68 - - thumb_func_start sub_81DAFA0 -sub_81DAFA0: @ 81DAFA0 - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - movs r0, 0xA - ldrsh r2, [r4, r0] - cmp r2, 0 - bne _081DAFCC - movs r1, 0x33 - negs r1, r1 - str r2, [sp] - movs r0, 0x4 - str r0, [sp, 0x4] - str r2, [sp, 0x8] - movs r0, 0x78 - movs r2, 0 - movs r3, 0 - bl sub_81DA74C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x10] - b _081DB01A -_081DAFCC: - cmp r2, 0x10 - bne _081DAFF2 - movs r0, 0x7 - negs r0, r0 - movs r1, 0x4 - str r1, [sp] - subs r1, 0x8 - str r1, [sp, 0x4] - movs r1, 0x1 - str r1, [sp, 0x8] - movs r1, 0xC1 - movs r2, 0 - movs r3, 0 - bl sub_81DA74C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x12] - b _081DB01A -_081DAFF2: - cmp r2, 0x20 - bne _081DB01A - movs r0, 0x4 - negs r0, r0 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x2 - str r0, [sp, 0x8] - movs r0, 0xF7 - movs r1, 0xC1 - movs r2, 0 - movs r3, 0 - bl sub_81DA74C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x14] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_081DB01A: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - movs r0, 0 - add sp, 0xC - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81DAFA0 - - thumb_func_start sub_81DB02C -sub_81DB02C: @ 81DB02C - push {lr} - adds r2, r0, 0 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081DB050 - adds r0, r2, 0 - bl sub_81DAA20 - ldr r0, =sub_81DAF68 - bl get_task_id_by_function - lsls r0, 24 - lsrs r0, 24 - bl remove_task -_081DB050: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81DB02C - - thumb_func_start sub_81DB060 -sub_81DB060: @ 81DB060 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_0862B7D4 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_081DB072: - movs r1, 0x8 - ldrsh r0, [r4, r1] - lsls r0, 2 - adds r0, r5 - ldr r1, [r0] - adds r0, r4, 0 - bl _call_via_r1 - lsls r0, 24 - cmp r0, 0 - bne _081DB072 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81DB060 - - thumb_func_start sub_81DB098 -sub_81DB098: @ 81DB098 - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - movs r0, 0xA - ldrsh r1, [r4, r0] - cmp r1, 0 - bne _081DB0C4 - str r1, [sp] - movs r0, 0x8 - negs r0, r0 - str r0, [sp, 0x4] - str r1, [sp, 0x8] - movs r0, 0x78 - movs r1, 0xC5 - movs r2, 0 - movs r3, 0 - bl sub_81DA74C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x10] - b _081DB112 -_081DB0C4: - cmp r1, 0x10 - bne _081DB0E8 - movs r0, 0x8 - negs r0, r0 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0xF1 - movs r1, 0x4E - movs r2, 0 - movs r3, 0 - bl sub_81DA74C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x12] - b _081DB112 -_081DB0E8: - cmp r1, 0x20 - bne _081DB112 - movs r0, 0x1 - negs r0, r0 - movs r1, 0x8 - str r1, [sp] - movs r1, 0x1 - str r1, [sp, 0x4] - movs r1, 0x2 - str r1, [sp, 0x8] - movs r1, 0x4E - movs r2, 0 - movs r3, 0 - bl sub_81DA74C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x14] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_081DB112: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - movs r0, 0 - add sp, 0xC - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81DB098 - - thumb_func_start sub_81DB124 -sub_81DB124: @ 81DB124 - push {lr} - adds r2, r0, 0 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081DB148 - adds r0, r2, 0 - bl sub_81DAA20 - ldr r0, =sub_81DB060 - bl get_task_id_by_function - lsls r0, 24 - lsrs r0, 24 - bl remove_task -_081DB148: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81DB124 - - thumb_func_start sub_81DB158 -sub_81DB158: @ 81DB158 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_0862B7E8 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_081DB16A: - movs r1, 0x8 - ldrsh r0, [r4, r1] - lsls r0, 2 - adds r0, r5 - ldr r1, [r0] - adds r0, r4, 0 - bl _call_via_r1 - lsls r0, 24 - cmp r0, 0 - bne _081DB16A - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81DB158 - - thumb_func_start sub_81DB190 -sub_81DB190: @ 81DB190 - push {r4,lr} - sub sp, 0x10 - adds r4, r0, 0 - movs r0, 0xA - ldrsh r1, [r4, r0] - cmp r1, 0 - bne _081DB1BE - movs r0, 0x80 - str r0, [sp] - str r1, [sp, 0x4] - subs r0, 0x84 - str r0, [sp, 0x8] - str r1, [sp, 0xC] - movs r0, 0x78 - movs r1, 0x2D - movs r2, 0xC - movs r3, 0x4 - bl sub_81DA8BC - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x10] - b _081DB212 -_081DB1BE: - cmp r1, 0x10 - bne _081DB1E6 - movs r0, 0x80 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - subs r0, 0x4 - str r0, [sp, 0x8] - movs r0, 0x1 - str r0, [sp, 0xC] - movs r0, 0x59 - movs r1, 0x61 - movs r2, 0xFC - movs r3, 0x4 - bl sub_81DA8BC - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x12] - b _081DB212 -_081DB1E6: - cmp r1, 0x20 - bne _081DB212 - movs r0, 0x80 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - subs r0, 0x4 - str r0, [sp, 0x8] - movs r0, 0x2 - str r0, [sp, 0xC] - movs r0, 0x97 - movs r1, 0x61 - movs r2, 0x84 - movs r3, 0x4 - bl sub_81DA8BC - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x14] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_081DB212: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - movs r0, 0 - add sp, 0x10 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81DB190 - - thumb_func_start sub_81DB224 -sub_81DB224: @ 81DB224 - push {lr} - adds r2, r0, 0 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081DB248 - adds r0, r2, 0 - bl sub_81DAA20 - ldr r0, =sub_81DB158 - bl get_task_id_by_function - lsls r0, 24 - lsrs r0, 24 - bl remove_task -_081DB248: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81DB224 - - thumb_func_start sub_81DB258 -sub_81DB258: @ 81DB258 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_0862B7FC - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_081DB26A: - movs r1, 0x8 - ldrsh r0, [r4, r1] - lsls r0, 2 - adds r0, r5 - ldr r1, [r0] - adds r0, r4, 0 - bl _call_via_r1 - lsls r0, 24 - cmp r0, 0 - bne _081DB26A - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81DB258 - - thumb_func_start sub_81DB290 -sub_81DB290: @ 81DB290 - push {r4,lr} - sub sp, 0x10 - adds r4, r0, 0 - movs r0, 0xA - ldrsh r1, [r4, r0] - cmp r1, 0 - bne _081DB2C2 - movs r2, 0x8E - lsls r2, 1 - movs r0, 0x83 - str r0, [sp] - movs r0, 0x23 - str r0, [sp, 0x4] - subs r0, 0x26 - str r0, [sp, 0x8] - str r1, [sp, 0xC] - movs r0, 0x78 - movs r1, 0x50 - movs r3, 0x8 - bl sub_81DA8BC - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x10] - b _081DB316 -_081DB2C2: - cmp r1, 0x10 - bne _081DB2EA - movs r0, 0x83 - str r0, [sp] - movs r0, 0x23 - str r0, [sp, 0x4] - subs r0, 0x26 - str r0, [sp, 0x8] - movs r0, 0x1 - str r0, [sp, 0xC] - movs r0, 0x78 - movs r1, 0x50 - movs r2, 0x2C - movs r3, 0x8 - bl sub_81DA8BC - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x12] - b _081DB316 -_081DB2EA: - cmp r1, 0x20 - bne _081DB316 - movs r0, 0x83 - str r0, [sp] - movs r0, 0x23 - str r0, [sp, 0x4] - subs r0, 0x26 - str r0, [sp, 0x8] - movs r0, 0x2 - str r0, [sp, 0xC] - movs r0, 0x79 - movs r1, 0x50 - movs r2, 0xA4 - movs r3, 0x8 - bl sub_81DA8BC - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x14] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_081DB316: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - movs r0, 0 - add sp, 0x10 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81DB290 - - thumb_func_start sub_81DB328 -sub_81DB328: @ 81DB328 - push {lr} - adds r2, r0, 0 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081DB34C - adds r0, r2, 0 - bl sub_81DAA20 - ldr r0, =sub_81DB258 - bl get_task_id_by_function - lsls r0, 24 - lsrs r0, 24 - bl remove_task -_081DB34C: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81DB328 - - thumb_func_start GetStringCenterAlignXOffset -@ s32 GetStringCenterAlignXOffset(u8 fontId, u8 *str, s32 totalWidth) -GetStringCenterAlignXOffset: @ 81DB35C - push {lr} - movs r3, 0 - bl GetStringCenterAlignXOffsetWithLetterSpacing - pop {r1} - bx r1 - thumb_func_end GetStringCenterAlignXOffset - - thumb_func_start GetStringRightAlignXOffset -@ s32 GetStringRightAlignXOffset(u8 fontId, u8 *str, s32 totalWidth) -GetStringRightAlignXOffset: @ 81DB368 - push {lr} - movs r3, 0 - bl GetStringWidthDifference - pop {r1} - bx r1 - thumb_func_end GetStringRightAlignXOffset - - thumb_func_start GetStringCenterAlignXOffsetWithLetterSpacing -@ s32 GetStringCenterAlignXOffsetWithLetterSpacing(u8 fontId, u8 *str, s32 totalWidth, s16 letterSpacing) -GetStringCenterAlignXOffsetWithLetterSpacing: @ 81DB374 - push {lr} - bl GetStringWidthDifference - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - pop {r1} - bx r1 - thumb_func_end GetStringCenterAlignXOffsetWithLetterSpacing - - thumb_func_start GetStringWidthDifference -@ s32 GetStringWidthDifference(u8 fontId, u8 *str, s32 totalWidth, s16 letterSpacing) -GetStringWidthDifference: @ 81DB384 - push {r4,lr} - adds r4, r2, 0 - adds r2, r3, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r2, 16 - asrs r2, 16 - bl GetStringWidth - cmp r4, r0 - bgt _081DB39E - movs r0, 0 - b _081DB3A0 -_081DB39E: - subs r0, r4, r0 -_081DB3A0: - pop {r4} - pop {r1} - bx r1 - thumb_func_end GetStringWidthDifference - - thumb_func_start GetMaxWidthInMenuTable -GetMaxWidthInMenuTable: @ 81DB3A8 - push {r4-r6,lr} - movs r6, 0 - cmp r6, r1 - bge _081DB3CC - adds r5, r0, 0 - adds r4, r1, 0 -_081DB3B4: - ldr r1, [r5] - movs r0, 0x1 - movs r2, 0 - bl GetStringWidth - cmp r0, r6 - ble _081DB3C4 - adds r6, r0, 0 -_081DB3C4: - adds r5, 0x8 - subs r4, 0x1 - cmp r4, 0 - bne _081DB3B4 -_081DB3CC: - adds r0, r6, 0 - bl convert_pixel_width_to_tile_width - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end GetMaxWidthInMenuTable - - thumb_func_start sub_81DB3D8 -sub_81DB3D8: @ 81DB3D8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r8, r0 - adds r7, r1, 0 - adds r5, r2, 0 - movs r6, 0 - movs r4, 0 - cmp r6, r5 - bge _081DB40A -_081DB3EC: - adds r0, r7, r4 - ldrb r0, [r0] - lsls r0, 3 - add r0, r8 - ldr r1, [r0] - movs r0, 0x1 - movs r2, 0 - bl GetStringWidth - cmp r0, r6 - ble _081DB404 - adds r6, r0, 0 -_081DB404: - adds r4, 0x1 - cmp r4, r5 - blt _081DB3EC -_081DB40A: - adds r0, r6, 0 - bl convert_pixel_width_to_tile_width - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81DB3D8 - - thumb_func_start sub_81DB41C -sub_81DB41C: @ 81DB41C - push {r4-r7,lr} - adds r4, r0, 0 - ldr r1, [r4] - movs r7, 0 - movs r6, 0 - ldrh r0, [r4, 0xC] - cmp r7, r0 - bge _081DB44C - adds r5, r1, 0 -_081DB42E: - ldrb r0, [r4, 0x17] - lsls r0, 26 - lsrs r0, 26 - ldr r1, [r5] - movs r2, 0 - bl GetStringWidth - cmp r0, r7 - ble _081DB442 - adds r7, r0, 0 -_081DB442: - adds r5, 0x8 - adds r6, 0x1 - ldrh r0, [r4, 0xC] - cmp r6, r0 - blt _081DB42E -_081DB44C: - ldrb r0, [r4, 0x12] - adds r1, r7, r0 - adds r0, r1, 0 - adds r0, 0x9 - cmp r0, 0 - bge _081DB45A - adds r0, 0x7 -_081DB45A: - asrs r0, 3 - cmp r0, 0x1C - ble _081DB462 - movs r0, 0x1C -_081DB462: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81DB41C - - thumb_func_start sub_81DB468 -sub_81DB468: @ 81DB468 - push {lr} - adds r2, r0, 0 - adds r0, r1, 0 - lsls r2, 5 - ldr r1, =gPokedexEntries - adds r2, r1 - adds r1, r2, 0 - bl CopyString - movs r1, 0 - strb r1, [r0] - adds r0, 0x1 - ldr r1, =gUnknown_085E8268 - bl CopyString - pop {r0} - bx r0 - .pool - thumb_func_end sub_81DB468 - - thumb_func_start sub_81DB494 -sub_81DB494: @ 81DB494 - push {r4-r7,lr} - adds r6, r1, 0 - adds r5, r2, 0 - adds r7, r3, 0 - cmp r5, 0 - beq _081DB4B6 - adds r1, r5, 0 - bl CopyString - adds r4, r0, 0 - lsls r0, r6, 24 - lsrs r0, 24 - adds r1, r5, 0 - movs r2, 0 - bl GetStringWidth - b _081DB4BA -_081DB4B6: - adds r4, r0, 0 - movs r0, 0 -_081DB4BA: - subs r3, r7, r0 - cmp r3, 0 - ble _081DB4D4 - movs r0, 0xFC - strb r0, [r4] - adds r4, 0x1 - movs r0, 0x11 - strb r0, [r4] - adds r4, 0x1 - strb r3, [r4] - adds r4, 0x1 - movs r0, 0xFF - strb r0, [r4] -_081DB4D4: - adds r0, r4, 0 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81DB494 - - thumb_func_start sub_81DB4DC -sub_81DB4DC: @ 81DB4DC - push {r4,r5,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - bl StripExtendedControlCodes - adds r0, r4, 0 - bl GetStringLength - lsls r0, 24 - lsrs r1, r0, 24 - cmp r5, 0xFC - bne _081DB51A - cmp r1, 0x5 - bhi _081DB51E - movs r3, 0xFC - movs r2, 0x7 -_081DB4FE: - adds r0, r4, r1 - strb r3, [r0] - strb r2, [r0, 0x1] - adds r0, r1, 0x2 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x5 - bls _081DB4FE - b _081DB51E -_081DB510: - adds r0, r4, r1 - strb r5, [r0] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 -_081DB51A: - cmp r1, 0x5 - bls _081DB510 -_081DB51E: - adds r1, r4, r1 - movs r0, 0xFF - strb r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81DB4DC - - thumb_func_start sub_81DB52C -sub_81DB52C: @ 81DB52C - push {r4,lr} - adds r4, r0, 0 - bl GetStringLength - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x5 - bhi _081DB546 - adds r0, r4, 0 - movs r1, 0x1 - bl StopMusicWhileStringIsPrinted - b _081DB54C -_081DB546: - adds r0, r4, 0 - bl StripExtendedControlCodes -_081DB54C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81DB52C - - thumb_func_start sub_81DB554 -sub_81DB554: @ 81DB554 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - bl GetStringLength - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x5 - bhi _081DB572 - adds r0, r4, 0 - movs r1, 0x1 - bl StopMusicWhileStringIsPrinted - b _081DB5A4 -_081DB572: - cmp r5, 0xFC - bne _081DB57E - adds r0, r4, 0 - bl StripExtendedControlCodes - b _081DB5A4 -_081DB57E: - adds r1, r4, 0 - b _081DB584 -_081DB582: - adds r1, 0x1 -_081DB584: - ldrb r0, [r1, 0x1] - cmp r0, 0xFF - bne _081DB582 - cmp r1, r4 - bcc _081DB5A4 - ldrb r0, [r1] - cmp r0, r5 - bne _081DB5A4 - movs r2, 0xFF -_081DB596: - strb r2, [r1] - subs r1, 0x1 - cmp r1, r4 - bcc _081DB5A4 - ldrb r0, [r1] - cmp r0, r5 - beq _081DB596 -_081DB5A4: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81DB554 - - thumb_func_start sub_81DB5AC -sub_81DB5AC: @ 81DB5AC - push {lr} - adds r2, r0, 0 - ldrb r0, [r2] - adds r2, 0x1 - cmp r0, 0xFC - bne _081DB5E4 - ldrb r0, [r2] - adds r2, 0x1 - cmp r0, 0x15 - bne _081DB5E4 - b _081DB5CE -_081DB5C2: - cmp r1, 0xFC - bne _081DB5CC - ldrb r0, [r2, 0x1] - cmp r0, 0x16 - beq _081DB5E4 -_081DB5CC: - adds r2, 0x1 -_081DB5CE: - ldrb r1, [r2] - adds r0, r1, 0 - cmp r0, 0xFF - bne _081DB5C2 - movs r0, 0xFC - strb r0, [r2] - adds r2, 0x1 - movs r0, 0x16 - strb r0, [r2] - movs r0, 0xFF - strb r0, [r2, 0x1] -_081DB5E4: - pop {r0} - bx r0 - thumb_func_end sub_81DB5AC - - thumb_func_start sub_81DB5E8 -sub_81DB5E8: @ 81DB5E8 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r2, 0 - bl CopyString - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - adds r1, r4, 0 - bl StopMusicWhileStringIsPrinted - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81DB5E8 - - thumb_func_start sub_81DB604 -sub_81DB604: @ 81DB604 - push {lr} - adds r1, r0, 0 - ldrb r0, [r1] - cmp r0, 0xFC - bne _081DB618 - ldrb r0, [r1, 0x1] - cmp r0, 0x15 - bne _081DB618 - movs r0, 0x1 - b _081DB61A -_081DB618: - movs r0, 0x2 -_081DB61A: - pop {r1} - bx r1 - thumb_func_end sub_81DB604 - - thumb_func_start sub_81DB620 -sub_81DB620: @ 81DB620 - push {r4-r7,lr} - sub sp, 0x4 - lsls r4, r0, 1 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020004 - adds r4, r0 - lsls r7, r3, 5 - ldrb r0, [r4, 0x3] - lsls r6, r0, 5 - muls r2, r6 - ldr r0, [r4, 0x8] - adds r0, r2 - lsls r1, 5 - adds r5, r0, r1 - ldr r0, [sp, 0x18] - cmp r0, 0 - ble _081DB66C - adds r4, r0, 0 -_081DB646: - ldr r0, =0x11111111 - str r0, [sp] - adds r2, r7, 0 - cmp r2, 0 - bge _081DB652 - adds r2, 0x3 -_081DB652: - lsls r2, 9 - lsrs r2, 11 - movs r0, 0x80 - lsls r0, 17 - orrs r2, r0 - mov r0, sp - adds r1, r5, 0 - bl CpuFastSet - adds r5, r6 - subs r4, 0x1 - cmp r4, 0 - bne _081DB646 -_081DB66C: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81DB620 - - .include "data/data1.s" - .include "asm/libgcnmultiboot.s" - .include "asm/libmks4agb.s" - .include "asm/libagbbackup.s" - .include "asm/librtc.s" - .include "asm/librfu.s" - .include "asm/libagbsyscall.s" - .include "asm/libgcc.s" - .include "data/data2.s" + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_81BAD84.s b/asm/rom_81BAD84.s new file mode 100644 index 0000000000..ae0a7cbe43 --- /dev/null +++ b/asm/rom_81BAD84.s @@ -0,0 +1,63142 @@ + .include "asm/macros.s" + .include "constants/constants.s" + + .syntax unified + + .text + + thumb_func_start sub_81BAD84 +sub_81BAD84: @ 81BAD84 + push {r4-r6,lr} + movs r6, 0x80 + lsls r6, 19 + movs r2, 0 + strh r2, [r6] + ldr r1, =0x04000010 + strh r2, [r1] + adds r1, 0x2 + strh r2, [r1] + adds r1, 0x3E + strh r2, [r1] + ldr r5, =gUnknown_08617128 + lsls r4, r0, 1 + adds r4, r0 + lsls r4, 2 + adds r0, r4, r5 + ldr r0, [r0] + movs r1, 0xC0 + lsls r1, 19 + bl LZ77UnCompVram + adds r0, r5, 0x4 + adds r0, r4, r0 + ldr r0, [r0] + ldr r1, =0x0600f800 + bl LZ77UnCompVram + adds r5, 0x8 + adds r4, r5 + ldr r0, [r4] + movs r1, 0xA0 + lsls r1, 19 + movs r4, 0x80 + lsls r4, 1 + adds r2, r4, 0 + bl CpuSet + ldr r1, =0x04000008 + movs r2, 0xF8 + lsls r2, 5 + adds r0, r2, 0 + strh r0, [r1] + strh r4, [r6] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BAD84 + + thumb_func_start nullsub_77 +nullsub_77: @ 81BADF0 + bx lr + thumb_func_end nullsub_77 + + thumb_func_start sub_81BADF4 +sub_81BADF4: @ 81BADF4 + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_exec_buffer_A_ch0_tbl3 + str r1, [r0] + bx lr + .pool + thumb_func_end sub_81BADF4 + + thumb_func_start bx_exec_buffer_A_ch0_tbl3 +bx_exec_buffer_A_ch0_tbl3: @ 81BAE10 + push {lr} + ldr r2, =0x02024068 + ldr r1, =gUnknown_0832A328 + ldr r0, =0x02024064 + ldrb r3, [r0] + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _081BAE5C + ldr r0, =0x02023064 + lsls r1, r3, 9 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x38 + bhi _081BAE58 + ldr r0, =gUnknown_08617170 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 + b _081BAE5C + .pool +_081BAE58: + bl dp01_tbl3_exec_completed +_081BAE5C: + pop {r0} + bx r0 + thumb_func_end bx_exec_buffer_A_ch0_tbl3 + + thumb_func_start sub_81BAE60 +sub_81BAE60: @ 81BAE60 + push {lr} + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + bne _081BAE84 + bl dp01_tbl3_exec_completed +_081BAE84: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BAE60 + + thumb_func_start sub_81BAE98 +sub_81BAE98: @ 81BAE98 + push {r4-r6,lr} + ldr r6, =0x02020630 + ldr r5, =0x020241e4 + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r6, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + bne _081BAEE8 + movs r0, 0 + bl nullsub_25 + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl obj_free_rotscale_entry + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl RemoveObjectAndFreeTiles + bl dp01_tbl3_exec_completed +_081BAEE8: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BAE98 + + thumb_func_start sub_81BAF00 +sub_81BAF00: @ 81BAF00 + push {r4,lr} + ldr r4, =0x020244d0 + ldr r1, [r4] + ldr r3, =0x02024064 + ldrb r0, [r3] + ldr r2, [r1, 0x4] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x9] + subs r0, 0x1 + strb r0, [r1, 0x9] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _081BAF38 + ldr r0, [r4] + ldrb r1, [r3] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strb r1, [r0, 0x9] + bl dp01_tbl3_exec_completed +_081BAF38: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BAF00 + + thumb_func_start sub_81BAF48 +sub_81BAF48: @ 81BAF48 + push {r4-r6,lr} + movs r6, 0 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _081BAF6C + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _081BAFA0 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081BAFA0 +_081BAF6C: + ldr r2, =0x02020630 + ldr r1, =0x03005d70 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + bne _081BAFD8 + b _081BAFD6 + .pool +_081BAFA0: + ldr r2, =0x02020630 + ldr r5, =0x03005d70 + ldr r0, =0x02024064 + ldrb r3, [r0] + adds r0, r3, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, r2, 0 + adds r4, 0x1C + adds r0, r4 + ldr r2, [r0] + ldr r0, =DummyObjectCallback + cmp r2, r0 + bne _081BAFD8 + movs r0, 0x2 + eors r3, r0 + adds r0, r3, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + cmp r0, r2 + bne _081BAFD8 +_081BAFD6: + movs r6, 0x1 +_081BAFD8: + bl sub_80A36C8 + lsls r0, 24 + cmp r0, 0 + beq _081BAFE4 + movs r6, 0 +_081BAFE4: + cmp r6, 0 + beq _081BB00A + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r3, =0x02024064 + ldrb r1, [r3] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x3 + strb r1, [r0, 0x9] + ldr r1, =0x03005d60 + ldrb r0, [r3] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_81BAF00 + str r1, [r0] +_081BB00A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BAF48 + + thumb_func_start sub_81BB02C +sub_81BB02C: @ 81BB02C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =0x020244d0 + mov r12, r0 + ldr r0, [r0] + ldr r7, =0x02024064 + ldrb r2, [r7] + ldr r3, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r4, r0, r3 + ldrb r1, [r4] + movs r5, 0x8 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _081BB058 + b _081BB196 +_081BB058: + movs r1, 0x2 + mov r8, r1 + adds r1, r2, 0 + mov r0, r8 + eors r1, r0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r1, [r0] + adds r0, r5, 0 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + beq _081BB07A + b _081BB196 +_081BB07A: + ldr r1, =0x02020630 + mov r10, r1 + ldr r0, =0x03005d7c + mov r9, r0 + adds r0, r2, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + mov r5, r10 + adds r5, 0x1C + adds r0, r5 + ldr r3, [r0] + ldr r0, =DummyObjectCallback + cmp r3, r0 + bne _081BB196 + ldr r0, =0x020241e4 + adds r0, r2, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r0, [r0] + cmp r0, r3 + bne _081BB196 + ldrb r0, [r4, 0x9] + adds r0, 0x1 + strb r0, [r4, 0x9] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081BB196 + mov r1, r12 + ldr r0, [r1] + ldrb r1, [r7] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strb r6, [r0, 0x9] + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _081BB134 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _081BB134 + ldrb r0, [r7] + mov r1, r8 + eors r0, r1 + add r0, r9 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r10 + bl RemoveObjectAndFreeTiles + ldr r4, =0x03005d70 + ldrb r0, [r7] + mov r1, r8 + eors r1, r0 + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x020244ec + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe + ldrb r0, [r7] + mov r1, r8 + eors r0, r1 + bl sub_8076918 + ldrb r0, [r7] + mov r1, r8 + eors r0, r1 + adds r0, r4 + ldrb r0, [r0] + bl sub_80729D0 +_081BB134: + ldr r1, =0x03005d7c + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + ldr r5, =0x03005d70 + ldrb r1, [r4] + adds r0, r1, r5 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x020244ec + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe + ldrb r0, [r4] + bl sub_8076918 + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + bl sub_80729D0 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r2, [r0, 0x8] + ldrb r1, [r2, 0x9] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x9] + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_81BAF48 + str r1, [r0] +_081BB196: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BB02C + + thumb_func_start sub_81BB1D4 +sub_81BB1D4: @ 81BB1D4 + push {lr} + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + adds r0, r1, 0 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 27 + cmp r0, 0 + bge _081BB202 + movs r2, 0x24 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _081BB202 + bl dp01_tbl3_exec_completed +_081BB202: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BB1D4 + + thumb_func_start bx_t3_healthbar_update +bx_t3_healthbar_update: @ 81BB214 + push {r4-r6,lr} + ldr r5, =0x02024064 + ldrb r0, [r5] + ldr r6, =0x03005d70 + adds r1, r0, r6 + ldrb r1, [r1] + movs r2, 0 + movs r3, 0 + bl sub_8074AA0 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldrb r0, [r5] + adds r0, r6 + ldrb r0, [r0] + bl sub_80729D0 + lsls r4, 16 + asrs r1, r4, 16 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081BB25C + ldrb r0, [r5] + adds r0, r6 + ldrb r0, [r0] + movs r2, 0 + bl heathbar_draw_hp + b _081BB276 + .pool +_081BB25C: + ldr r2, =0x0202406e + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =0x020244ec + adds r0, r2 + bl sub_805E990 + bl dp01_tbl3_exec_completed +_081BB276: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end bx_t3_healthbar_update + + thumb_func_start sub_81BB284 +sub_81BB284: @ 81BB284 + push {lr} + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _081BB296 + bl dp01_tbl3_exec_completed +_081BB296: + pop {r0} + bx r0 + thumb_func_end sub_81BB284 + + thumb_func_start sub_81BB29C +sub_81BB29C: @ 81BB29C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r1, =0x03005e00 + lsls r0, 2 + add r0, r9 + lsls r0, 3 + adds r0, r1 + mov r8, r0 + ldrb r0, [r0, 0x8] + mov r10, r0 + mov r1, r8 + ldrb r7, [r1, 0xC] + str r7, [sp, 0x8] + ldrh r2, [r1, 0xA] + str r2, [sp, 0xC] + bl battle_type_is_double + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081BB2E2 + ldr r1, =0x0202406e + lsls r0, r7, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r10, r0 + bne _081BB2E2 + b _081BB3F8 +_081BB2E2: + movs r0, 0x64 + mov r1, r10 + muls r1, r0 + ldr r0, =0x020244ec + adds r6, r1, r0 + adds r0, r6, 0 + movs r1, 0xB + bl pokemon_getattr + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r6, 0 + movs r1, 0x38 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + movs r1, 0x19 + bl pokemon_getattr + str r0, [sp, 0x4] + ldr r3, =gExperienceTables + adds r4, 0x1 + lsls r4, 2 + ldr r2, =gBaseStats + lsls r1, r5, 3 + subs r1, r5 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x13] + movs r1, 0xCA + lsls r1, 1 + muls r1, r2 + adds r4, r1 + adds r4, r3 + ldr r2, [r4] + str r2, [sp] + ldr r3, [sp, 0xC] + lsls r1, r3, 16 + asrs r1, 16 + adds r0, r1 + cmp r0, r2 + bcc _081BB3D0 + adds r0, r6, 0 + movs r1, 0x19 + mov r2, sp + bl pokemon_setattr + adds r0, r6, 0 + bl pokemon_calc_effective_stats + ldr r2, [sp] + add r0, sp, 0x4 + ldrh r0, [r0] + subs r2, r0 + ldr r0, [sp, 0xC] + subs r2, r0, r2 + ldr r4, =0x02024064 + ldrb r5, [r4] + strb r7, [r4] + lsls r2, 16 + lsrs r2, 16 + movs r0, 0x1 + movs r1, 0xB + bl dp01_build_cmdbuf_x21_a_bb + strb r5, [r4] + bl battle_type_is_double + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081BB3B8 + ldr r2, =0x0202406e + lsls r0, r7, 1 + adds r0, r2 + mov r1, r10 + ldrh r0, [r0] + cmp r1, r0 + beq _081BB396 + movs r0, 0x2 + eors r7, r0 + lsls r0, r7, 1 + adds r0, r2 + ldrh r0, [r0] + cmp r1, r0 + bne _081BB3B8 +_081BB396: + ldr r0, =sub_81BB628 + b _081BB3FA + .pool +_081BB3B8: + ldr r0, =0x03005e00 + mov r2, r9 + lsls r1, r2, 2 + add r1, r9 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81BB740 + b _081BB3FC + .pool +_081BB3D0: + str r0, [sp, 0x4] + add r2, sp, 0x4 + adds r0, r6, 0 + movs r1, 0x19 + bl pokemon_setattr + ldr r1, =0x03005d60 + ldr r3, [sp, 0x8] + lsls r0, r3, 2 + adds r0, r1 + ldr r1, =sub_81BB284 + str r1, [r0] + mov r0, r9 + bl remove_task + b _081BB3FE + .pool +_081BB3F8: + ldr r0, =sub_81BB414 +_081BB3FA: + mov r1, r8 +_081BB3FC: + str r0, [r1] +_081BB3FE: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BB29C + + thumb_func_start sub_81BB414 +sub_81BB414: @ 81BB414 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005e00 + lsls r2, r0, 2 + mov r8, r2 + add r8, r0 + mov r0, r8 + lsls r0, 3 + mov r8, r0 + add r8, r1 + mov r2, r8 + ldrb r1, [r2, 0x8] + movs r0, 0xA + ldrsh r2, [r2, r0] + mov r9, r2 + mov r2, r8 + ldrb r2, [r2, 0xC] + mov r10, r2 + movs r0, 0x64 + adds r6, r1, 0 + muls r6, r0 + ldr r0, =0x020244ec + adds r6, r0 + adds r0, r6, 0 + movs r1, 0x38 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + movs r1, 0xB + bl pokemon_getattr + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r6, 0 + movs r1, 0x19 + bl pokemon_getattr + adds r3, r0, 0 + ldr r6, =gExperienceTables + lsls r1, r4, 2 + ldr r2, =gBaseStats + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r0, r2 + ldrb r2, [r0, 0x13] + movs r0, 0xCA + lsls r0, 1 + muls r0, r2 + adds r1, r0 + adds r1, r6 + ldr r1, [r1] + subs r3, r1 + adds r4, 0x1 + lsls r4, 2 + adds r4, r0 + adds r4, r6 + ldr r2, [r4] + subs r2, r1 + ldr r0, =0x03005d70 + add r0, r10 + ldrb r1, [r0] + mov r0, r9 + negs r0, r0 + str r0, [sp] + mov r0, r10 + bl sub_807294C + movs r0, 0x21 + bl audio_play + ldr r0, =sub_81BB4E4 + mov r1, r8 + str r0, [r1] + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BB414 + + thumb_func_start sub_81BB4E4 +sub_81BB4E4: @ 81BB4E4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, =0x03005e00 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r6, r0, r1 + ldrh r1, [r6, 0x1C] + movs r2, 0x1C + ldrsh r0, [r6, r2] + cmp r0, 0xC + bgt _081BB514 + adds r0, r1, 0x1 + strh r0, [r6, 0x1C] + b _081BB610 + .pool +_081BB514: + ldrb r0, [r6, 0x8] + mov r9, r0 + ldrh r2, [r6, 0xA] + mov r10, r2 + ldrb r7, [r6, 0xC] + ldr r5, =0x03005d70 + adds r5, r7, r5 + ldrb r1, [r5] + adds r0, r7, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_8074AA0 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldrb r0, [r5] + bl sub_80729D0 + lsls r4, 16 + asrs r4, 16 + movs r0, 0x1 + negs r0, r0 + cmp r4, r0 + bne _081BB610 + movs r0, 0x21 + bl m4aSongNumStop + movs r0, 0x64 + mov r1, r9 + muls r1, r0 + ldr r0, =0x020244ec + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0x38 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x19 + bl pokemon_getattr + str r0, [sp, 0x4] + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + ldr r3, =gExperienceTables + adds r4, 0x1 + lsls r4, 2 + ldr r2, =gBaseStats + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r1, [r1, 0x13] + movs r0, 0xCA + lsls r0, 1 + muls r0, r1 + adds r4, r0 + adds r4, r3 + ldr r1, [r4] + str r1, [sp] + mov r2, r10 + lsls r0, r2, 16 + asrs r4, r0, 16 + ldr r0, [sp, 0x4] + adds r0, r4 + cmp r0, r1 + blt _081BB5F4 + adds r0, r5, 0 + movs r1, 0x19 + mov r2, sp + bl pokemon_setattr + adds r0, r5, 0 + bl pokemon_calc_effective_stats + ldr r2, [sp] + add r0, sp, 0x4 + ldrh r0, [r0] + subs r2, r0 + subs r2, r4, r2 + ldr r4, =0x02024064 + ldrb r5, [r4] + strb r7, [r4] + lsls r2, 16 + lsrs r2, 16 + movs r0, 0x1 + movs r1, 0xB + bl dp01_build_cmdbuf_x21_a_bb + strb r5, [r4] + ldr r0, =sub_81BB628 + str r0, [r6] + b _081BB610 + .pool +_081BB5F4: + str r0, [sp, 0x4] + add r2, sp, 0x4 + adds r0, r5, 0 + movs r1, 0x19 + bl pokemon_setattr + ldr r1, =0x03005d60 + lsls r0, r7, 2 + adds r0, r1 + ldr r1, =sub_81BB284 + str r1, [r0] + mov r0, r8 + bl remove_task +_081BB610: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BB4E4 + + thumb_func_start sub_81BB628 +sub_81BB628: @ 81BB628 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldrb r4, [r0, 0xC] + ldrb r6, [r0, 0x8] + bl battle_type_is_double + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081BB65C + ldr r1, =0x0202406e + movs r0, 0x2 + adds r2, r4, 0 + eors r2, r0 + lsls r0, r2, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r6, r0 + bne _081BB65C + adds r4, r2, 0 +_081BB65C: + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r4, 0 + movs r3, 0 + bl move_anim_start_t4 + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81BB688 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BB628 + + thumb_func_start sub_81BB688 +sub_81BB688: @ 81BB688 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r2, r0, r1 + ldrb r5, [r2, 0xC] + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _081BB72A + ldrb r4, [r2, 0x8] + movs r0, 0x64 + adds r1, r4, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r7, r1, r0 + adds r0, r7, 0 + movs r1, 0x38 + bl pokemon_getattr + bl battle_type_is_double + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081BB708 + ldr r1, =0x0202406e + movs r0, 0x2 + adds r2, r5, 0 + eors r2, r0 + lsls r0, r2, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r4, r0 + bne _081BB708 + ldr r0, =0x03005d70 + adds r0, r2, r0 + ldrb r0, [r0] + adds r1, r7, 0 + movs r2, 0 + bl healthbar_draw_field_maybe + b _081BB71C + .pool +_081BB708: + ldr r0, =0x03005d70 + adds r0, r5, r0 + ldrb r0, [r0] + movs r1, 0x64 + muls r1, r4 + ldr r2, =0x020244ec + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe +_081BB71C: + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81BB740 + str r0, [r1] +_081BB72A: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BB688 + + thumb_func_start sub_81BB740 +sub_81BB740: @ 81BB740 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =0x03005e00 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + ldrb r1, [r4, 0x8] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x38 + bl pokemon_getattr + ldrb r0, [r4, 0xC] + ldr r1, =0x03005d60 + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_81BB284 + str r1, [r0] + adds r0, r5, 0 + bl remove_task + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BB740 + + thumb_func_start sub_81BB78C +sub_81BB78C: @ 81BB78C + push {r4-r6,lr} + ldr r6, =0x02020630 + ldr r5, =0x020241e4 + ldr r4, =0x02024064 + ldrb r2, [r4] + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r3, 0x22 + ldrsh r1, [r0, r3] + movs r3, 0x26 + ldrsh r0, [r0, r3] + adds r1, r0 + cmp r1, 0xA0 + ble _081BB808 + ldr r1, =0x0202406e + lsls r0, r2, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + bl nullsub_24 + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl RemoveObjectAndFreeTiles + ldr r1, =0x03005d70 + ldrb r0, [r4] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl dp01_tbl3_exec_completed +_081BB808: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BB78C + + thumb_func_start sub_81BB828 +sub_81BB828: @ 81BB828 + push {r4-r6,lr} + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r6, =0x02024064 + ldrb r2, [r6] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _081BB87C + ldr r5, =0x020241e4 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl obj_free_rotscale_entry + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r1, =0x03005d70 + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl dp01_tbl3_exec_completed +_081BB87C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BB828 + + thumb_func_start sub_81BB898 +sub_81BB898: @ 81BB898 + push {lr} + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _081BB8AA + bl dp01_tbl3_exec_completed +_081BB8AA: + pop {r0} + bx r0 + thumb_func_end sub_81BB898 + + thumb_func_start bx_blink_t3 +bx_blink_t3: @ 81BB8B0 + push {r4,lr} + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + ldr r2, =0x02020630 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, r0, r2 + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0x20 + bne _081BB8FC + movs r3, 0 + movs r0, 0 + strh r0, [r4, 0x30] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + subs r0, 0x5 + ands r0, r1 + strb r0, [r2] + ldr r0, =0x020244b9 + strb r3, [r0] + bl dp01_tbl3_exec_completed + b _081BB926 + .pool +_081BB8FC: + ldrh r0, [r4, 0x30] + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _081BB920 + adds r3, r4, 0 + adds r3, 0x3E + ldrb r2, [r3] + lsls r0, r2, 29 + lsrs r0, 31 + movs r1, 0x1 + eors r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] +_081BB920: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] +_081BB926: + pop {r4} + pop {r0} + bx r0 + thumb_func_end bx_blink_t3 + + thumb_func_start sub_81BB92C +sub_81BB92C: @ 81BB92C + push {r4,lr} + ldr r2, =0x02020630 + ldr r0, =0x03005d70 + ldr r4, =0x02024064 + ldrb r3, [r4] + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + bne _081BB97E + adds r0, r3, 0 + bl sub_805E408 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldrb r2, [r4] + ldr r1, [r0] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _081BB972 + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x6 + bl move_anim_start_t4 +_081BB972: + ldr r0, =0x03005d60 + ldrb r1, [r4] + lsls r1, 2 + adds r1, r0 + ldr r0, =dp01t_35_3_free_vram + str r0, [r1] +_081BB97E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BB92C + + thumb_func_start dp01t_35_3_free_vram +dp01t_35_3_free_vram: @ 81BB9A0 + push {lr} + ldr r0, =0x020244d0 + ldr r1, [r0] + ldr r0, =0x02024064 + ldrb r3, [r0] + ldr r1, [r1, 0x4] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _081BB9DC + ldr r2, =0x02020630 + ldr r0, =0x020241e4 + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + bne _081BB9DC + bl dp01_tbl3_exec_completed +_081BB9DC: + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_35_3_free_vram + + thumb_func_start sub_81BB9F4 +sub_81BB9F4: @ 81BB9F4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r3, =0x020244d0 + ldr r0, [r3] + ldr r7, =0x02024064 + ldrb r1, [r7] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r2, r0, r2 + ldrb r1, [r2, 0x1] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081BBAB0 + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + ldr r0, [r3] + ldrb r2, [r7] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + ldr r4, =0x000027f9 + adds r0, r4, 0 + bl FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + ldr r0, =c3_0802FDF4 + movs r1, 0xA + bl AddTask + ldr r0, =0x0202406e + mov r8, r0 + ldrb r1, [r7] + lsls r0, r1, 1 + add r0, r8 + ldrh r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x020244ec + adds r0, r5 + bl sub_805E990 + ldr r1, =0x020241e4 + ldrb r0, [r7] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r1, 0 + bl StartObjectImageAnim + ldr r4, =0x03005d70 + ldrb r1, [r7] + adds r0, r1, r4 + ldrb r0, [r0] + lsls r1, 1 + add r1, r8 + ldrh r1, [r1] + muls r1, r6 + adds r1, r5 + movs r2, 0 + bl healthbar_draw_field_maybe + ldrb r0, [r7] + bl sub_8076918 + ldrb r0, [r7] + adds r0, r4 + ldrb r0, [r0] + bl sub_80729D0 + ldr r1, =0x03005d60 + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_81BB92C + str r1, [r0] +_081BBAB0: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BB9F4 + + thumb_func_start sub_81BBAE8 +sub_81BBAE8: @ 81BBAE8 + push {r4-r6,lr} + ldr r6, =0x020244d0 + ldr r0, [r6] + ldr r4, =0x02024064 + ldrb r2, [r4] + ldr r1, [r0, 0x4] + lsls r3, r2, 1 + adds r0, r3, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x88 + ands r0, r1 + cmp r0, 0 + bne _081BBB1A + ldr r0, =0x0202406e + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_081BBB1A: + ldr r5, =0x02020630 + ldr r0, =0x03005d7c + ldrb r2, [r4] + adds r0, r2, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r3, r0, 2 + adds r0, r5, 0 + adds r0, 0x1C + adds r0, r3, r0 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + bne _081BBB60 + ldr r0, [r6] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _081BBB60 + adds r0, r3, r5 + bl RemoveObjectAndFreeTiles + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_81BB9F4 + str r1, [r0] +_081BBB60: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BBAE8 + + thumb_func_start dp01_tbl3_exec_completed +dp01_tbl3_exec_completed: @ 81BBB8C + push {r4,lr} + sub sp, 0x4 + ldr r1, =0x03005d60 + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_exec_buffer_A_ch0_tbl3 + str r1, [r0] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081BBBE0 + bl link_get_multiplayer_id + mov r1, sp + strb r0, [r1] + movs r0, 0x2 + movs r1, 0x4 + mov r2, sp + bl dp01_prepare_buffer_wireless_probably + ldr r1, =0x02023064 + ldrb r0, [r4] + lsls r0, 9 + adds r0, r1 + movs r1, 0x38 + strb r1, [r0] + b _081BBBF2 + .pool +_081BBBE0: + ldr r2, =0x02024068 + ldr r1, =gUnknown_0832A328 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldr r0, [r2] + bics r0, r1 + str r0, [r2] +_081BBBF2: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_tbl3_exec_completed + + thumb_func_start sub_81BBC04 +sub_81BBC04: @ 81BBC04 + push {lr} + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _081BBC26 + bl dp01_tbl3_exec_completed +_081BBC26: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BBC04 + + thumb_func_start bx_80E8A6C +bx_80E8A6C: @ 81BBC34 + push {lr} + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _081BBC56 + bl dp01_tbl3_exec_completed +_081BBC56: + pop {r0} + bx r0 + .pool + thumb_func_end bx_80E8A6C + + thumb_func_start dp01t_00_3_getattr +dp01t_00_3_getattr: @ 81BBC64 + push {r4-r6,lr} + sub sp, 0x100 + movs r6, 0 + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _081BBC9C + ldr r0, =0x0202406e + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + mov r1, sp + bl dp01_getattr_by_ch1_for_player_pokemon + adds r6, r0, 0 + b _081BBCBE + .pool +_081BBC9C: + ldrb r4, [r1] + movs r5, 0 +_081BBCA0: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _081BBCB6 + lsls r0, r5, 24 + lsrs r0, 24 + mov r2, sp + adds r1, r2, r6 + bl dp01_getattr_by_ch1_for_player_pokemon + adds r6, r0 +_081BBCB6: + lsrs r4, 1 + adds r5, 0x1 + cmp r5, 0x5 + ble _081BBCA0 +_081BBCBE: + lsls r1, r6, 16 + lsrs r1, 16 + movs r0, 0x1 + mov r2, sp + bl dp01_build_cmdbuf_x1D_1D_numargs_varargs + bl dp01_tbl3_exec_completed + add sp, 0x100 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end dp01t_00_3_getattr + + thumb_func_start dp01_getattr_by_ch1_for_player_pokemon +dp01_getattr_by_ch1_for_player_pokemon: @ 81BBCD8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x90 + adds r7, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + movs r6, 0 + ldr r2, =0x02023064 + ldr r3, =0x02024064 + ldrb r0, [r3] + lsls r0, 9 + adds r1, r2, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3B + bls _081BBD02 + bl _081BC46E +_081BBD02: + lsls r0, 2 + ldr r1, =_081BBD18 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081BBD18: + .4byte _081BBE08 + .4byte _081BC02C + .4byte _081BC03C + .4byte _081BC04C + .4byte _081BC0B4 + .4byte _081BC0B4 + .4byte _081BC0B4 + .4byte _081BC0B4 + .4byte _081BC0D0 + .4byte _081BC10C + .4byte _081BC10C + .4byte _081BC10C + .4byte _081BC10C + .4byte _081BC46E + .4byte _081BC46E + .4byte _081BC46E + .4byte _081BC46E + .4byte _081BC128 + .4byte _081BC138 + .4byte _081BC168 + .4byte _081BC178 + .4byte _081BC188 + .4byte _081BC198 + .4byte _081BC1A8 + .4byte _081BC1B8 + .4byte _081BC1C8 + .4byte _081BC1D8 + .4byte _081BC1E8 + .4byte _081BC1F8 + .4byte _081BC208 + .4byte _081BC218 + .4byte _081BC228 + .4byte _081BC278 + .4byte _081BC288 + .4byte _081BC298 + .4byte _081BC2A8 + .4byte _081BC2B8 + .4byte _081BC2C8 + .4byte _081BC2D8 + .4byte _081BC2E8 + .4byte _081BC2F8 + .4byte _081BC32C + .4byte _081BC33C + .4byte _081BC34C + .4byte _081BC35C + .4byte _081BC36C + .4byte _081BC37C + .4byte _081BC38C + .4byte _081BC39C + .4byte _081BC3BC + .4byte _081BC3CC + .4byte _081BC3DC + .4byte _081BC3EC + .4byte _081BC3FC + .4byte _081BC40C + .4byte _081BC41C + .4byte _081BC42C + .4byte _081BC43C + .4byte _081BC44C + .4byte _081BC45C +_081BBE08: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + mov r1, sp + strh r0, [r1] + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x2E] + movs r6, 0 + add r0, sp, 0x24 + mov r9, r0 + movs r1, 0x3B + add r1, sp + mov r10, r1 + mov r2, sp + adds r2, 0x2B + str r2, [sp, 0x80] + mov r0, sp + adds r0, 0x2A + str r0, [sp, 0x7C] + mov r1, sp + adds r1, 0x68 + str r1, [sp, 0x8C] + adds r2, 0x5 + str r2, [sp, 0x84] + adds r0, 0x12 + str r0, [sp, 0x88] + mov r8, r4 + add r4, sp, 0xC +_081BBE54: + adds r1, r6, 0 + adds r1, 0xD + mov r0, r8 + bl pokemon_getattr + strh r0, [r4] + adds r1, r6, 0 + adds r1, 0x11 + mov r0, r8 + bl pokemon_getattr + mov r2, r9 + adds r1, r2, r6 + strb r0, [r1] + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _081BBE54 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x15 + bl pokemon_getattr + mov r1, r10 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x20 + bl pokemon_getattr + ldr r2, [sp, 0x80] + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0x19 + bl pokemon_getattr + str r0, [sp, 0x44] + adds r0, r4, 0 + movs r1, 0x27 + bl pokemon_getattr + mov r3, sp + movs r5, 0x1F + ands r0, r5 + ldrb r2, [r3, 0x14] + movs r1, 0x20 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x14] + adds r0, r4, 0 + movs r1, 0x28 + bl pokemon_getattr + mov r3, sp + movs r6, 0x1F + ands r0, r6 + lsls r0, 5 + ldrh r2, [r3, 0x14] + ldr r1, =0xfffffc1f + ands r1, r2 + orrs r1, r0 + strh r1, [r3, 0x14] + adds r0, r4, 0 + movs r1, 0x29 + bl pokemon_getattr + mov r3, sp + ands r0, r5 + lsls r0, 2 + ldrb r2, [r3, 0x15] + movs r1, 0x7D + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x15] + adds r0, r4, 0 + movs r1, 0x2A + bl pokemon_getattr + movs r1, 0x1F + ands r1, r0 + lsls r1, 15 + ldr r0, [sp, 0x14] + ldr r2, =0xfff07fff + ands r0, r2 + orrs r0, r1 + str r0, [sp, 0x14] + adds r0, r4, 0 + movs r1, 0x2B + bl pokemon_getattr + mov r3, sp + ands r0, r6 + lsls r0, 4 + ldrh r2, [r3, 0x16] + ldr r1, =0xfffffe0f + ands r1, r2 + orrs r1, r0 + strh r1, [r3, 0x16] + adds r0, r4, 0 + movs r1, 0x2C + bl pokemon_getattr + mov r3, sp + ands r0, r5 + lsls r0, 1 + ldrb r2, [r3, 0x17] + movs r1, 0x3F + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x17] + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + str r0, [sp, 0x48] + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr + str r0, [sp, 0x4C] + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + ldr r1, [sp, 0x7C] + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x28] + adds r0, r4, 0 + movs r1, 0x3A + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x2C] + adds r0, r4, 0 + movs r1, 0x3B + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x2] + adds r0, r4, 0 + movs r1, 0x3C + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x4] + adds r0, r4, 0 + movs r1, 0x3D + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x6] + adds r0, r4, 0 + movs r1, 0x3E + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x8] + adds r0, r4, 0 + movs r1, 0x3F + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0xA] + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + mov r3, sp + movs r1, 0x1 + ands r0, r1 + lsls r0, 6 + ldrb r2, [r3, 0x17] + movs r1, 0x41 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x17] + adds r0, r4, 0 + movs r1, 0x2E + bl pokemon_getattr + mov r3, sp + lsls r0, 7 + ldrb r2, [r3, 0x17] + movs r1, 0x7F + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x17] + adds r0, r4, 0 + movs r1, 0x1 + bl pokemon_getattr + str r0, [sp, 0x54] + adds r0, r4, 0 + movs r1, 0x2 + ldr r2, [sp, 0x8C] + bl pokemon_getattr + ldr r0, [sp, 0x84] + ldr r1, [sp, 0x8C] + bl CopyString_Limit10 + adds r0, r4, 0 + movs r1, 0x7 + ldr r2, [sp, 0x88] + bl pokemon_getattr + mov r2, sp + movs r6, 0 +_081BC00C: + adds r0, r7, r6 + adds r1, r2, r6 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + cmp r6, 0x57 + bls _081BC00C + b _081BC46E + .pool +_081BC02C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + b _081BC3A6 + .pool +_081BC03C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xC + b _081BC3A6 + .pool +_081BC04C: + movs r6, 0 + add r2, sp, 0x58 + mov r9, r2 + add r0, sp, 0x60 + mov r10, r0 + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + mov r8, r9 +_081BC062: + adds r1, r6, 0 + adds r1, 0xD + adds r0, r4, 0 + bl pokemon_getattr + mov r1, r8 + strh r0, [r1] + adds r1, r6, 0 + adds r1, 0x11 + adds r0, r4, 0 + bl pokemon_getattr + mov r2, r10 + adds r1, r2, r6 + strb r0, [r1] + movs r0, 0x2 + add r8, r0 + adds r6, 0x1 + cmp r6, 0x3 + ble _081BC062 + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + mov r1, r9 + strb r0, [r1, 0xC] + mov r2, r9 + movs r6, 0 +_081BC0A0: + adds r0, r7, r6 + adds r1, r2, r6 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + cmp r6, 0xF + bls _081BC0A0 + b _081BC46E + .pool +_081BC0B4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x9 + b _081BC3A6 + .pool +_081BC0D0: + movs r6, 0 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r2, =0x020244ec + mov r8, r2 +_081BC0DC: + adds r1, r6, 0 + adds r1, 0x11 + mov r2, r8 + adds r0, r4, r2 + bl pokemon_getattr + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + cmp r6, 0x3 + ble _081BC0DC + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + b _081BC46E + .pool +_081BC10C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x8 + b _081BC466 + .pool +_081BC128: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1 + b _081BC142 + .pool +_081BC138: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x19 +_081BC142: + bl pokemon_getattr + adds r1, r0, 0 + strb r1, [r7] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + lsrs r0, 8 + strb r0, [r7, 0x1] + movs r0, 0xFF + lsls r0, 16 + ands r0, r1 + lsrs r0, 16 + strb r0, [r7, 0x2] + movs r6, 0x3 + b _081BC46E + .pool +_081BC168: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1A + b _081BC466 + .pool +_081BC178: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1B + b _081BC466 + .pool +_081BC188: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1C + b _081BC466 + .pool +_081BC198: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1D + b _081BC466 + .pool +_081BC1A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1E + b _081BC466 + .pool +_081BC1B8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1F + b _081BC466 + .pool +_081BC1C8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x20 + b _081BC466 + .pool +_081BC1D8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x22 + b _081BC466 + .pool +_081BC1E8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x23 + b _081BC466 + .pool +_081BC1F8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x24 + b _081BC466 + .pool +_081BC208: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x25 + b _081BC466 + .pool +_081BC218: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x26 + b _081BC466 + .pool +_081BC228: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x27 + bl pokemon_getattr + strb r0, [r7] + adds r0, r4, 0 + movs r1, 0x28 + bl pokemon_getattr + strb r0, [r7, 0x1] + adds r0, r4, 0 + movs r1, 0x29 + bl pokemon_getattr + strb r0, [r7, 0x2] + adds r0, r4, 0 + movs r1, 0x2A + bl pokemon_getattr + strb r0, [r7, 0x3] + adds r0, r4, 0 + movs r1, 0x2B + bl pokemon_getattr + strb r0, [r7, 0x4] + adds r0, r4, 0 + movs r1, 0x2C + bl pokemon_getattr + strb r0, [r7, 0x5] + movs r6, 0x6 + b _081BC46E + .pool +_081BC278: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x27 + b _081BC466 + .pool +_081BC288: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x28 + b _081BC466 + .pool +_081BC298: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x29 + b _081BC466 + .pool +_081BC2A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2A + b _081BC466 + .pool +_081BC2B8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2B + b _081BC466 + .pool +_081BC2C8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2C + b _081BC466 + .pool +_081BC2D8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0 + b _081BC302 + .pool +_081BC2E8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x9 + b _081BC3A6 + .pool +_081BC2F8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x37 +_081BC302: + bl pokemon_getattr + adds r1, r0, 0 + strb r1, [r7] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + lsrs r0, 8 + strb r0, [r7, 0x1] + movs r0, 0xFF + lsls r0, 16 + ands r0, r1 + lsrs r0, 16 + strb r0, [r7, 0x2] + lsrs r0, r1, 24 + strb r0, [r7, 0x3] + movs r6, 0x4 + b _081BC46E + .pool +_081BC32C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x38 + b _081BC466 + .pool +_081BC33C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x39 + b _081BC3A6 + .pool +_081BC34C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3A + b _081BC3A6 + .pool +_081BC35C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3B + b _081BC3A6 + .pool +_081BC36C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3C + b _081BC3A6 + .pool +_081BC37C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3D + b _081BC3A6 + .pool +_081BC38C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3E + b _081BC3A6 + .pool +_081BC39C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3F +_081BC3A6: + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + strb r0, [r7] + lsrs r0, 8 + strb r0, [r7, 0x1] + movs r6, 0x2 + b _081BC46E + .pool +_081BC3BC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x16 + b _081BC466 + .pool +_081BC3CC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x17 + b _081BC466 + .pool +_081BC3DC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x18 + b _081BC466 + .pool +_081BC3EC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x21 + b _081BC466 + .pool +_081BC3FC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2F + b _081BC466 + .pool +_081BC40C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x30 + b _081BC466 + .pool +_081BC41C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x32 + b _081BC466 + .pool +_081BC42C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x33 + b _081BC466 + .pool +_081BC43C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x34 + b _081BC466 + .pool +_081BC44C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x35 + b _081BC466 + .pool +_081BC45C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x36 +_081BC466: + bl pokemon_getattr + strb r0, [r7] + movs r6, 0x1 +_081BC46E: + adds r0, r6, 0 + add sp, 0x90 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end dp01_getattr_by_ch1_for_player_pokemon + + thumb_func_start sub_81BC484 +sub_81BC484: @ 81BC484 + push {lr} + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81BC484 + + thumb_func_start sub_81BC490 +sub_81BC490: @ 81BC490 + push {r4,r5,lr} + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _081BC4C0 + ldr r0, =0x0202406e + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + bl sub_81BC4E8 + b _081BC4DE + .pool +_081BC4C0: + ldrb r4, [r1] + movs r5, 0 +_081BC4C4: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _081BC4D2 + adds r0, r5, 0 + bl sub_81BC4E8 +_081BC4D2: + lsrs r4, 1 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _081BC4C4 +_081BC4DE: + bl dp01_tbl3_exec_completed + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81BC490 + + thumb_func_start sub_81BC4E8 +sub_81BC4E8: @ 81BC4E8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x34 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 9 + ldr r2, =0x02023067 + adds r3, r0, r2 + adds r6, r3, 0 + subs r1, r2, 0x2 + adds r0, r1 + ldrb r0, [r0] + adds r7, r2, 0 + cmp r0, 0x3B + bls _081BC514 + bl _081BCEAE +_081BC514: + lsls r0, 2 + ldr r1, =_081BC52C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081BC52C: + .4byte _081BC61C + .4byte _081BC7B4 + .4byte _081BC7D4 + .4byte _081BC7F4 + .4byte _081BC84C + .4byte _081BC84C + .4byte _081BC84C + .4byte _081BC84C + .4byte _081BC874 + .4byte _081BC8D8 + .4byte _081BC8D8 + .4byte _081BC8D8 + .4byte _081BC8D8 + .4byte _081BCEAE + .4byte _081BCEAE + .4byte _081BCEAE + .4byte _081BCEAE + .4byte _081BC908 + .4byte _081BC928 + .4byte _081BC948 + .4byte _081BC968 + .4byte _081BC988 + .4byte _081BC9A8 + .4byte _081BC9C8 + .4byte _081BC9E8 + .4byte _081BCA08 + .4byte _081BCA28 + .4byte _081BCA48 + .4byte _081BCA68 + .4byte _081BCA88 + .4byte _081BCAA8 + .4byte _081BCAC8 + .4byte _081BCB38 + .4byte _081BCB58 + .4byte _081BCB78 + .4byte _081BCB98 + .4byte _081BCBB8 + .4byte _081BCBD8 + .4byte _081BCBF8 + .4byte _081BCC18 + .4byte _081BCC38 + .4byte _081BCC58 + .4byte _081BCC78 + .4byte _081BCC98 + .4byte _081BCCB8 + .4byte _081BCCD8 + .4byte _081BCCF8 + .4byte _081BCD18 + .4byte _081BCD38 + .4byte _081BCD58 + .4byte _081BCD78 + .4byte _081BCD98 + .4byte _081BCDB8 + .4byte _081BCDD8 + .4byte _081BCDF8 + .4byte _081BCE18 + .4byte _081BCE38 + .4byte _081BCE58 + .4byte _081BCE78 + .4byte _081BCE98 +_081BC61C: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + adds r2, r6, 0 + bl pokemon_setattr + adds r2, r6, 0 + adds r2, 0x2E + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_setattr + movs r0, 0 + mov r8, r0 + movs r0, 0x3B + adds r0, r6 + mov r10, r0 + adds r0, r6, 0 + adds r0, 0x2B + str r0, [sp, 0x20] + adds r0, 0x19 + str r0, [sp, 0x28] + adds r0, 0x4 + str r0, [sp, 0x2C] + adds r0, 0x4 + str r0, [sp, 0x30] + subs r0, 0x22 + str r0, [sp, 0x1C] + subs r0, 0x2 + str r0, [sp, 0x18] + adds r0, 0x4 + str r0, [sp, 0x24] + adds r0, r6, 0x2 + str r0, [sp, 0x4] + adds r0, r6, 0x4 + str r0, [sp, 0x8] + adds r0, r6, 0x6 + str r0, [sp, 0xC] + adds r0, 0x2 + str r0, [sp, 0x10] + adds r0, 0x2 + str r0, [sp, 0x14] + mov r9, r4 + adds r7, r6, 0 + adds r7, 0x24 + adds r4, r6, 0 + adds r4, 0xC +_081BC682: + mov r1, r8 + adds r1, 0xD + mov r0, r9 + adds r2, r4, 0 + bl pokemon_setattr + mov r1, r8 + adds r1, 0x11 + mov r0, r9 + adds r2, r7, 0 + bl pokemon_setattr + adds r7, 0x1 + adds r4, 0x2 + movs r0, 0x1 + add r8, r0 + mov r0, r8 + cmp r0, 0x3 + ble _081BC682 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x15 + mov r2, r10 + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x20 + ldr r2, [sp, 0x20] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x19 + ldr r2, [sp, 0x28] + bl pokemon_setattr + ldrb r0, [r6, 0x14] + lsls r0, 27 + lsrs r0, 27 + mov r1, sp + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x27 + mov r2, sp + bl pokemon_setattr + mov r1, sp + ldrh r0, [r6, 0x14] + lsls r0, 22 + lsrs r0, 27 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x28 + mov r2, sp + bl pokemon_setattr + mov r1, sp + ldrb r0, [r6, 0x15] + lsls r0, 25 + lsrs r0, 27 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x29 + mov r2, sp + bl pokemon_setattr + mov r1, sp + ldr r0, [r6, 0x14] + lsls r0, 12 + lsrs r0, 27 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x2A + mov r2, sp + bl pokemon_setattr + mov r1, sp + ldrh r0, [r6, 0x16] + lsls r0, 23 + lsrs r0, 27 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x2B + mov r2, sp + bl pokemon_setattr + mov r1, sp + ldrb r0, [r6, 0x17] + lsls r0, 26 + lsrs r0, 27 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x2C + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0 + ldr r2, [sp, 0x2C] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x37 + ldr r2, [sp, 0x30] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x38 + ldr r2, [sp, 0x1C] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x39 + ldr r2, [sp, 0x18] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3A + ldr r2, [sp, 0x24] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3B + ldr r2, [sp, 0x4] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3C + ldr r2, [sp, 0x8] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3D + ldr r2, [sp, 0xC] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3E + ldr r2, [sp, 0x10] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3F + ldr r2, [sp, 0x14] + bl pokemon_setattr + b _081BCEAE + .pool +_081BC7B4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0xB + bl pokemon_setattr + b _081BCEAE + .pool +_081BC7D4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0xC + bl pokemon_setattr + b _081BCEAE + .pool +_081BC7F4: + movs r0, 0 + mov r8, r0 + movs r0, 0xC + adds r0, r3 + mov r9, r0 + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r7, r1, r0 + adds r6, r3, 0 + adds r6, 0x8 + adds r4, r3, 0 +_081BC80E: + mov r1, r8 + adds r1, 0xD + adds r0, r7, 0 + adds r2, r4, 0 + bl pokemon_setattr + mov r1, r8 + adds r1, 0x11 + adds r0, r7, 0 + adds r2, r6, 0 + bl pokemon_setattr + adds r6, 0x1 + adds r4, 0x2 + movs r0, 0x1 + add r8, r0 + mov r0, r8 + cmp r0, 0x3 + ble _081BC80E + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x15 + mov r2, r9 + bl pokemon_setattr + b _081BCEAE + .pool +_081BC84C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r3, =0x02023064 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x9 + b _081BC8F0 + .pool +_081BC874: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + ldr r5, =0x02024064 + ldrb r2, [r5] + lsls r2, 9 + adds r2, r7 + adds r0, r4, 0 + movs r1, 0x11 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x1 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x12 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x2 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x13 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x3 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x14 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x4 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x15 + bl pokemon_setattr + b _081BCEAE + .pool +_081BC8D8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r3, =0x02023064 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x8 +_081BC8F0: + adds r3, 0x3 + adds r2, r3 + bl pokemon_setattr + b _081BCEAE + .pool +_081BC908: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1 + bl pokemon_setattr + b _081BCEAE + .pool +_081BC928: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x19 + bl pokemon_setattr + b _081BCEAE + .pool +_081BC948: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1A + bl pokemon_setattr + b _081BCEAE + .pool +_081BC968: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1B + bl pokemon_setattr + b _081BCEAE + .pool +_081BC988: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1C + bl pokemon_setattr + b _081BCEAE + .pool +_081BC9A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1D + bl pokemon_setattr + b _081BCEAE + .pool +_081BC9C8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1E + bl pokemon_setattr + b _081BCEAE + .pool +_081BC9E8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1F + bl pokemon_setattr + b _081BCEAE + .pool +_081BCA08: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x20 + bl pokemon_setattr + b _081BCEAE + .pool +_081BCA28: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x22 + bl pokemon_setattr + b _081BCEAE + .pool +_081BCA48: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x23 + bl pokemon_setattr + b _081BCEAE + .pool +_081BCA68: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x24 + bl pokemon_setattr + b _081BCEAE + .pool +_081BCA88: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x25 + bl pokemon_setattr + b _081BCEAE + .pool +_081BCAA8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x26 + bl pokemon_setattr + b _081BCEAE + .pool +_081BCAC8: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + ldr r5, =0x02024064 + ldrb r2, [r5] + lsls r2, 9 + adds r2, r7 + adds r0, r4, 0 + movs r1, 0x27 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x1 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x28 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x2 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x29 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x3 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x2A + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x4 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x2B + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x5 + adds r2, r0 + adds r0, r4, 0 + b _081BCBE8 + .pool +_081BCB38: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x27 + bl pokemon_setattr + b _081BCEAE + .pool +_081BCB58: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x28 + bl pokemon_setattr + b _081BCEAE + .pool +_081BCB78: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x29 + bl pokemon_setattr + b _081BCEAE + .pool +_081BCB98: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2A + bl pokemon_setattr + b _081BCEAE + .pool +_081BCBB8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2B + bl pokemon_setattr + b _081BCEAE + .pool +_081BCBD8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 +_081BCBE8: + movs r1, 0x2C + bl pokemon_setattr + b _081BCEAE + .pool +_081BCBF8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0 + bl pokemon_setattr + b _081BCEAE + .pool +_081BCC18: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x9 + bl pokemon_setattr + b _081BCEAE + .pool +_081BCC38: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x37 + bl pokemon_setattr + b _081BCEAE + .pool +_081BCC58: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x38 + bl pokemon_setattr + b _081BCEAE + .pool +_081BCC78: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x39 + bl pokemon_setattr + b _081BCEAE + .pool +_081BCC98: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3A + bl pokemon_setattr + b _081BCEAE + .pool +_081BCCB8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3B + bl pokemon_setattr + b _081BCEAE + .pool +_081BCCD8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3C + bl pokemon_setattr + b _081BCEAE + .pool +_081BCCF8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3D + bl pokemon_setattr + b _081BCEAE + .pool +_081BCD18: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3E + bl pokemon_setattr + b _081BCEAE + .pool +_081BCD38: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3F + bl pokemon_setattr + b _081BCEAE + .pool +_081BCD58: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x16 + bl pokemon_setattr + b _081BCEAE + .pool +_081BCD78: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x17 + bl pokemon_setattr + b _081BCEAE + .pool +_081BCD98: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x18 + bl pokemon_setattr + b _081BCEAE + .pool +_081BCDB8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x21 + bl pokemon_setattr + b _081BCEAE + .pool +_081BCDD8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2F + bl pokemon_setattr + b _081BCEAE + .pool +_081BCDF8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x30 + bl pokemon_setattr + b _081BCEAE + .pool +_081BCE18: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x32 + bl pokemon_setattr + b _081BCEAE + .pool +_081BCE38: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x33 + bl pokemon_setattr + b _081BCEAE + .pool +_081BCE58: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x34 + bl pokemon_setattr + b _081BCEAE + .pool +_081BCE78: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x35 + bl pokemon_setattr + b _081BCEAE + .pool +_081BCE98: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x36 + bl pokemon_setattr +_081BCEAE: + ldr r2, =0x0202406e + ldr r0, =0x02024064 + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =0x020244ec + adds r0, r2 + bl sub_805E990 + add sp, 0x34 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BC4E8 + + thumb_func_start sub_81BCEE4 +sub_81BCEE4: @ 81BCEE4 + push {r4-r7,lr} + ldr r1, =0x0202406e + ldr r7, =0x02024064 + ldrb r2, [r7] + lsls r0, r2, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + adds r3, r1, 0 + muls r3, r0 + ldr r4, =0x02023064 + lsls r2, 9 + adds r0, r4, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + ldr r1, =0x020244ec + adds r0, r1 + adds r5, r3, r0 + movs r3, 0 + adds r0, r4, 0x2 + adds r2, r0 + ldrb r2, [r2] + cmp r3, r2 + bcs _081BCF3C + adds r6, r4, 0 + adds r2, r7, 0 + adds r4, r0, 0 +_081BCF1A: + adds r1, r5, r3 + ldrb r0, [r2] + lsls r0, 9 + adds r0, 0x3 + adds r0, r3, r0 + adds r0, r6 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + ldrb r0, [r2] + lsls r0, 9 + adds r0, r4 + ldrb r0, [r0] + cmp r3, r0 + bcc _081BCF1A +_081BCF3C: + bl dp01_tbl3_exec_completed + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BCEE4 + + thumb_func_start sub_81BCF58 +sub_81BCF58: @ 81BCF58 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, =0x0202406e + mov r8, r0 + ldr r6, =0x02024064 + ldrb r1, [r6] + lsls r0, r1, 1 + add r0, r8 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r4, =0x020244ec + adds r0, r4 + bl sub_805DD7C + ldrb r0, [r6] + lsls r0, 1 + add r0, r8 + ldrh r0, [r0] + muls r0, r5 + adds r0, r4 + movs r1, 0xB + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldrb r0, [r6] + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_806A068 + ldr r0, =0x0202499c + mov r8, r0 + ldrb r0, [r6] + movs r1, 0x2 + bl sub_80A5C6C + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldrb r0, [r6] + bl sub_80A6138 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r6] + bl sub_80A82E4 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + mov r0, r8 + adds r1, r5, 0 + adds r2, r4, 0 + bl AddObjectToFront + ldr r4, =0x020241e4 + ldrb r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r5, =0x02020630 + ldrb r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =0x0000ff10 + strh r1, [r0, 0x24] + ldrb r2, [r6] + adds r0, r2, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x2E] + ldrb r3, [r6] + adds r0, r3, r4 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + lsls r3, 4 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x5] + ldrb r2, [r6] + adds r4, r2, r4 + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =0x020244e4 + adds r2, r1 + ldrb r1, [r2] + bl StartObjectImageAnim + ldr r1, =0x03005d60 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_81BB1D4 + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BCF58 + + thumb_func_start sub_81BD074 +sub_81BD074: @ 81BD074 + push {r4-r6,lr} + ldr r5, =0x02024064 + ldrb r0, [r5] + ldr r4, =0x02023064 + lsls r1, r0, 9 + adds r6, r4, 0x2 + adds r1, r6 + ldrb r1, [r1] + bl sub_805EF84 + ldr r2, =0x0202406e + ldrb r0, [r5] + lsls r1, r0, 1 + adds r1, r2 + lsls r0, 9 + adds r4, 0x1 + adds r0, r4 + ldrb r0, [r0] + strh r0, [r1] + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =0x020244ec + adds r0, r2 + bl sub_805DD7C + ldrb r0, [r5] + lsls r1, r0, 9 + adds r1, r6 + ldrb r1, [r1] + bl sub_81BD0E4 + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_81BBAE8 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BD074 + + thumb_func_start sub_81BD0E4 +sub_81BD0E4: @ 81BD0E4 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + bl sub_805EF84 + ldr r0, =0x0202406e + lsls r2, r6, 1 + adds r2, r0 + ldr r0, =0x02023064 + lsls r1, r6, 9 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + strh r0, [r2] + ldrh r1, [r2] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + mov r8, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, =sub_805D714 + bl object_new_hidden_with_callback + ldr r1, =0x03005d7c + mov r9, r1 + add r9, r6 + mov r1, r9 + strb r0, [r1] + adds r0, r6, 0 + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, r8 + bl sub_806A068 + ldr r0, =0x0202499c + mov r10, r0 + adds r0, r6, 0 + movs r1, 0x2 + bl sub_80A5C6C + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r6, 0 + bl sub_80A6138 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + bl sub_80A82E4 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + mov r0, r10 + adds r1, r5, 0 + adds r2, r4, 0 + bl AddObjectToFront + ldr r4, =0x020241e4 + adds r4, r6, r4 + strb r0, [r4] + ldr r5, =0x02020630 + mov r0, r9 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r1, [r4] + strh r1, [r0, 0x30] + mov r0, r9 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r6, [r0, 0x32] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r6, [r0, 0x2E] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + mov r1, r8 + strh r1, [r0, 0x32] + ldrb r0, [r4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + lsls r3, r6, 4 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x5] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =0x020244e4 + adds r6, r1 + ldrb r1, [r6] + bl StartObjectImageAnim + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r5, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =DummyObjectCallback + str r1, [r0] + movs r0, 0 + movs r1, 0xFF + bl sub_80753E8 + mov r1, r9 + ldrb r2, [r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r5 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0x2E] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BD0E4 + + thumb_func_start sub_81BD260 +sub_81BD260: @ 81BD260 + push {r4-r6,lr} + ldr r1, =0x02023064 + ldr r6, =0x02024064 + ldrb r2, [r6] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r3, [r0] + cmp r3, 0 + bne _081BD2A8 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + strb r3, [r0, 0x4] + ldr r1, =0x03005d60 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_81BD2F0 + str r1, [r0] + b _081BD2DE + .pool +_081BD2A8: + ldr r5, =0x020241e4 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl obj_free_rotscale_entry + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r1, =0x03005d70 + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl dp01_tbl3_exec_completed +_081BD2DE: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BD260 + + thumb_func_start sub_81BD2F0 +sub_81BD2F0: @ 81BD2F0 + push {r4-r6,lr} + ldr r6, =0x020244d0 + ldr r4, [r6] + ldr r5, =0x02024064 + ldrb r2, [r5] + ldr r1, [r4, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r3, r0, r1 + ldrb r0, [r3, 0x4] + cmp r0, 0 + beq _081BD318 + cmp r0, 0x1 + beq _081BD346 + b _081BD36E + .pool +_081BD318: + ldr r1, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _081BD332 + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_081BD332: + ldr r0, [r6] + ldrb r1, [r5] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x1 + strb r1, [r0, 0x4] + b _081BD36E +_081BD346: + ldrb r1, [r3] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _081BD36E + strb r0, [r3, 0x4] + ldrb r2, [r5] + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x1 + bl move_anim_start_t4 + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_81BB828 + str r1, [r0] +_081BD36E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BD2F0 + + thumb_func_start sub_81BD37C +sub_81BD37C: @ 81BD37C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r2, =0x02038bce + ldrh r1, [r2] + ldr r0, =0x00000c03 + cmp r1, r0 + bne _081BD3A8 + movs r4, 0x7 + movs r0, 0x5A + mov r9, r0 + ldr r0, =gUnknown_08305D2C + ldrb r1, [r0, 0x1C] + b _081BD3BE + .pool +_081BD3A8: + ldrh r0, [r2] + bl sub_8162AA0 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x20 + mov r9, r0 + ldr r1, =gUnknown_083054E0 + lsls r0, r4, 2 + adds r0, r1 + ldrb r1, [r0] +_081BD3BE: + movs r0, 0x8 + subs r0, r1 + lsls r0, 18 + movs r1, 0xA0 + lsls r1, 15 + adds r0, r1 + lsrs r7, r0, 16 + ldr r0, =0x02038bce + ldrh r1, [r0] + ldr r0, =0x00000c03 + cmp r1, r0 + bne _081BD494 + ldr r5, =0x02024064 + ldrb r1, [r5] + adds r0, r4, 0 + bl sub_805DF84 + ldrb r0, [r5] + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl template_build_for_pokemon_or_trainer + ldr r6, =0x0202499c + mov r8, r9 + lsls r4, r7, 16 + asrs r4, 16 + ldrb r0, [r5] + bl sub_80A82E4 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r6, 0 + mov r1, r8 + adds r2, r4, 0 + bl AddObjectToFront + ldr r6, =0x020241e4 + ldrb r1, [r5] + adds r1, r6 + strb r0, [r1] + ldr r4, =0x02020630 + ldrb r3, [r5] + adds r0, r3, r6 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + lsls r3, 4 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x5] + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xF0 + strh r1, [r0, 0x24] + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =0x0000fffe + strh r1, [r0, 0x2E] + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, 0x1C + adds r0, r4 + ldr r1, =sub_805D7AC + str r1, [r0] + b _081BD57C + .pool +_081BD494: + adds r5, r4, 0 + ldr r6, =0x02024064 + ldrb r1, [r6] + adds r0, r5, 0 + bl sub_805DF38 + ldrb r0, [r6] + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl sub_806A1C0 + ldr r0, =0x0202499c + mov r8, r0 + lsls r4, r7, 16 + asrs r4, 16 + ldrb r0, [r6] + bl sub_80A82E4 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + mov r0, r8 + mov r1, r9 + adds r2, r4, 0 + bl AddObjectToFront + ldr r4, =0x020241e4 + ldrb r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r0, =gTrainerFrontPicPaletteTable + lsls r5, 3 + adds r5, r0 + ldrh r0, [r5, 0x4] + bl IndexOfObjectPaletteTag + ldr r5, =0x02020630 + ldrb r1, [r6] + adds r1, r4 + ldrb r1, [r1] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r5 + lsls r0, 4 + ldrb r3, [r2, 0x5] + movs r1, 0xF + ands r1, r3 + orrs r1, r0 + strb r1, [r2, 0x5] + ldrb r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0xF0 + strh r1, [r0, 0x24] + ldrb r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x30 + strh r1, [r0, 0x26] + ldrb r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =0x0000fffe + strh r1, [r0, 0x2E] + ldrb r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r5, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_805D7AC + str r1, [r0] + ldrb r0, [r6] + adds r0, r4 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r2, [r1, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + ldrb r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3F + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] +_081BD57C: + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_81BAE60 + str r1, [r0] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BD37C + + thumb_func_start sub_81BD5BC +sub_81BD5BC: @ 81BD5BC + push {lr} + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81BD5BC + + thumb_func_start sub_81BD5C8 +sub_81BD5C8: @ 81BD5C8 + push {r4-r6,lr} + ldr r6, =0x020241e4 + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, =0x02020630 + adds r0, r5 + bl oamt_add_pos2_onto_pos1 + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x23 + strh r1, [r0, 0x2E] + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =0x0000ffd8 + strh r1, [r0, 0x32] + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrh r1, [r0, 0x22] + strh r1, [r0, 0x36] + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r5, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_80A6EEC + str r1, [r0] + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =DummyObjectCallback + bl oamt_set_x3A_32 + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_81BAE98 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BD5C8 + + thumb_func_start sub_81BD674 +sub_81BD674: @ 81BD674 + push {r4-r6,lr} + ldr r6, =0x020244d0 + ldr r4, [r6] + ldr r5, =0x02024064 + ldrb r2, [r5] + ldr r0, [r4, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r3, r1, r0 + ldrb r0, [r3, 0x4] + cmp r0, 0 + bne _081BD6C8 + ldr r1, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _081BD6A8 + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_081BD6A8: + ldr r0, [r6] + ldrb r1, [r5] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x4] + adds r1, 0x1 + strb r1, [r0, 0x4] + b _081BD73E + .pool +_081BD6C8: + ldrb r1, [r3] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _081BD73E + strb r4, [r3, 0x4] + ldr r2, =0x0202406e + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =0x020244ec + adds r0, r2 + bl sub_805E990 + movs r1, 0x40 + negs r1, r1 + movs r0, 0x10 + bl audio_play_and_stuff + ldr r2, =0x02020630 + ldr r3, =0x020241e4 + ldrb r0, [r5] + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r4, [r0, 0x30] + ldrb r0, [r5] + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x5 + strh r1, [r0, 0x32] + ldrb r0, [r5] + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_8039C00 + str r1, [r0] + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_81BB78C + str r1, [r0] +_081BD73E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BD674 + + thumb_func_start sub_81BD760 +sub_81BD760: @ 81BD760 + push {lr} + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81BD760 + + thumb_func_start sub_81BD76C +sub_81BD76C: @ 81BD76C + push {lr} + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81BD76C + + thumb_func_start sub_81BD778 +sub_81BD778: @ 81BD778 + push {lr} + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81BD778 + + thumb_func_start sub_81BD784 +sub_81BD784: @ 81BD784 + push {lr} + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81BD784 + + thumb_func_start sub_81BD790 +sub_81BD790: @ 81BD790 + push {r4-r6,lr} + ldr r6, =0x02024064 + ldrb r0, [r6] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + beq _081BD7A2 + b _081BD8B6 +_081BD7A2: + ldr r0, =0x02023064 + mov r12, r0 + ldrb r2, [r6] + lsls r2, 9 + adds r0, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + mov r1, r12 + adds r1, 0x2 + adds r1, r2, r1 + ldrb r1, [r1] + lsls r1, 8 + orrs r0, r1 + ldr r5, =0x02038432 + mov r1, r12 + adds r1, 0x3 + adds r2, r1 + ldrb r1, [r2] + strb r1, [r5] + ldr r4, =0x02038408 + ldrb r2, [r6] + lsls r2, 9 + mov r1, r12 + adds r1, 0x4 + adds r1, r2, r1 + ldrb r3, [r1] + mov r1, r12 + adds r1, 0x5 + adds r2, r1 + ldrb r1, [r2] + lsls r1, 8 + orrs r3, r1 + strh r3, [r4] + ldr r4, =0x02038404 + ldrb r2, [r6] + lsls r2, 9 + mov r1, r12 + adds r1, 0x6 + adds r1, r2, r1 + ldrb r3, [r1] + mov r1, r12 + adds r1, 0x7 + adds r1, r2, r1 + ldrb r1, [r1] + lsls r1, 8 + orrs r3, r1 + mov r1, r12 + adds r1, 0x8 + adds r1, r2, r1 + ldrb r1, [r1] + lsls r1, 16 + orrs r3, r1 + mov r1, r12 + adds r1, 0x9 + adds r2, r1 + ldrb r1, [r2] + lsls r1, 24 + orrs r3, r1 + str r3, [r4] + ldr r3, =0x0203841a + ldrb r1, [r6] + lsls r1, 9 + mov r2, r12 + adds r2, 0xA + adds r1, r2 + ldrb r1, [r1] + strb r1, [r3] + ldr r4, =0x0203841c + ldrb r2, [r6] + lsls r2, 9 + mov r1, r12 + adds r1, 0xC + adds r1, r2, r1 + ldrb r3, [r1] + mov r1, r12 + adds r1, 0xD + adds r2, r1 + ldrb r1, [r2] + lsls r1, 8 + orrs r3, r1 + strh r3, [r4] + ldr r3, =0x02038400 + ldrb r2, [r6] + lsls r2, 9 + mov r1, r12 + adds r1, 0x10 + adds r2, r1 + str r2, [r3] + ldr r3, =0x020244bc + ldrb r1, [r6] + lsls r1, 2 + adds r1, r3 + ldr r2, [r2] + str r2, [r1] + ldrb r1, [r5] + bl sub_805DB8C + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + beq _081BD898 + bl dp01_tbl3_exec_completed + b _081BD8B6 + .pool +_081BD898: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldrb r1, [r6] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strb r3, [r0, 0x4] + ldr r1, =0x03005d60 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_move_anim_3 + str r1, [r0] +_081BD8B6: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BD790 + + thumb_func_start bx_move_anim_3 +bx_move_anim_3: @ 81BD8C8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r2, =0x02023064 + ldr r6, =0x02024064 + ldrb r3, [r6] + lsls r1, r3, 9 + adds r0, r2, 0x1 + mov r10, r0 + adds r0, r1, r0 + ldrb r4, [r0] + adds r5, r2, 0x2 + mov r9, r5 + adds r0, r1, r5 + ldrb r0, [r0] + lsls r0, 8 + orrs r4, r0 + adds r2, 0xB + adds r1, r2 + ldrb r1, [r1] + mov r8, r1 + ldr r7, =0x020244d0 + ldr r5, [r7] + ldr r1, [r5, 0x4] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x4] + cmp r2, 0x1 + beq _081BD960 + cmp r2, 0x1 + bgt _081BD920 + cmp r2, 0 + beq _081BD92A + b _081BDA3C + .pool +_081BD920: + cmp r2, 0x2 + beq _081BD98A + cmp r2, 0x3 + beq _081BDA00 + b _081BDA3C +_081BD92A: + ldr r1, [r5] + lsls r0, r3, 2 + adds r1, r0, r1 + ldrb r2, [r1] + movs r0, 0xC + ands r0, r2 + cmp r0, 0x4 + bne _081BD94C + movs r0, 0x8 + orrs r0, r2 + strb r0, [r1] + ldrb r2, [r6] + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_081BD94C: + ldr r0, [r7] + ldrb r1, [r6] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x1 + strb r1, [r0, 0x4] + b _081BDA3C +_081BD960: + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _081BDA3C + movs r0, 0 + bl sub_805EB9C + adds r0, r4, 0 + bl move_anim_start_t1 + ldr r0, [r7] + ldrb r1, [r6] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x2 + strb r1, [r0, 0x4] + b _081BDA3C +_081BD98A: + ldr r0, =0x020383f8 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, =0x020383fd + ldrb r0, [r0] + cmp r0, 0 + bne _081BDA3C + movs r0, 0x1 + bl sub_805EB9C + ldr r0, [r7] + ldrb r2, [r6] + ldr r1, [r0] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _081BD9D8 + mov r0, r8 + cmp r0, 0x1 + bhi _081BD9D8 + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x6 + bl move_anim_start_t4 + ldr r0, [r7] + ldrb r1, [r6] + ldr r0, [r0] + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] +_081BD9D8: + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x3 + strb r1, [r0, 0x4] + b _081BDA3C + .pool +_081BDA00: + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _081BDA3C + bl sub_805E394 + ldrb r0, [r6] + lsls r2, r0, 9 + mov r3, r10 + adds r1, r2, r3 + ldrb r1, [r1] + add r2, r9 + ldrb r2, [r2] + lsls r2, 8 + orrs r1, r2 + bl sub_805E94C + ldr r0, [r7] + ldrb r1, [r6] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strb r4, [r0, 0x4] + bl dp01_tbl3_exec_completed +_081BDA3C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end bx_move_anim_3 + + thumb_func_start sub_81BDA4C +sub_81BDA4C: @ 81BDA4C + push {r4,lr} + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r0, 9 + ldr r1, =0x02023066 + adds r0, r1 + ldrh r0, [r0] + bl battle_pick_message + ldr r0, =0x02022e2c + movs r1, 0 + bl battle_show_message_maybe + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_81BB898 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BDA4C + + thumb_func_start sub_81BDAA0 +sub_81BDAA0: @ 81BDAA0 + push {lr} + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81BDAA0 + + thumb_func_start sub_81BDAAC +sub_81BDAAC: @ 81BDAAC + push {lr} + bl sub_8063880 + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81BDAAC + + thumb_func_start sub_81BDABC +sub_81BDABC: @ 81BDABC + push {lr} + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81BDABC + + thumb_func_start sub_81BDAC8 +sub_81BDAC8: @ 81BDAC8 + push {r4-r6,lr} + ldr r6, =0x02024064 + ldrb r4, [r6] + lsls r4, 9 + ldr r0, =0x02023068 + adds r4, r0 + movs r0, 0xF + bl sub_8130950 + bl sub_8130BA4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, =gBattleMoves + lsls r0, r5, 1 + adds r4, r0 + ldrh r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x6] + movs r0, 0x12 + ands r0, r1 + cmp r0, 0 + beq _081BDB02 + ldr r1, =0x0202420c + ldrb r0, [r6] + strb r0, [r1] +_081BDB02: + ldrh r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x6] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _081BDB3C + movs r0, 0x1 + bl battle_get_side_with_given_state + ldr r4, =0x0202420c + strb r0, [r4] + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _081BDB3C + movs r0, 0x3 + bl battle_get_side_with_given_state + strb r0, [r4] +_081BDB3C: + ldr r0, =0x0202420c + ldrb r2, [r0] + lsls r2, 8 + orrs r2, r5 + movs r0, 0x1 + movs r1, 0xA + bl dp01_build_cmdbuf_x21_a_bb + bl dp01_tbl3_exec_completed + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BDAC8 + + thumb_func_start sub_81BDB70 +sub_81BDB70: @ 81BDB70 + push {lr} + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81BDB70 + + thumb_func_start sub_81BDB7C +sub_81BDB7C: @ 81BDB7C + push {r4-r6,lr} + bl sub_8063A90 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x6 + bne _081BDBD0 + movs r0, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0x2 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0x3 + b _081BDBA4 +_081BDBA2: + adds r4, 0x1 +_081BDBA4: + cmp r4, 0x5 + bgt _081BDBD0 + movs r0, 0x64 + muls r0, r4 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _081BDBA2 + ldr r1, =0x0202406e + lsls r0, r6, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r4, r0 + beq _081BDBA2 + lsls r0, r5, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r4, r0 + beq _081BDBA2 +_081BDBD0: + ldr r0, =0x02024064 + ldrb r0, [r0] + ldr r1, =0x0202449c + ldr r1, [r1] + adds r0, r1 + adds r0, 0x5C + strb r4, [r0] + lsls r1, r4, 24 + lsrs r1, 24 + movs r0, 0x1 + movs r2, 0 + bl dp01_build_cmdbuf_x22_a_three_bytes + bl dp01_tbl3_exec_completed + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BDB7C + + thumb_func_start sub_81BDC04 +sub_81BDC04: @ 81BDC04 + push {lr} + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81BDC04 + + thumb_func_start sub_81BDC10 +sub_81BDC10: @ 81BDC10 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + movs r0, 0 + bl load_gfxc_health_bar + ldr r3, =0x02023064 + ldr r0, =0x02024064 + mov r9, r0 + ldrb r4, [r0] + lsls r2, r4, 9 + adds r0, r3, 0x2 + adds r0, r2, r0 + ldrb r1, [r0] + adds r3, 0x3 + adds r2, r3 + ldrb r0, [r2] + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + asrs r7, r1, 16 + ldr r0, =0x00007fff + cmp r7, r0 + beq _081BDCA0 + ldr r6, =0x0202406e + lsls r0, r4, 1 + adds r0, r6 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r4, =0x020244ec + adds r0, r4 + movs r1, 0x3A + bl pokemon_getattr + mov r8, r0 + mov r1, r9 + ldrb r0, [r1] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + muls r0, r5 + adds r0, r4 + movs r1, 0x39 + bl pokemon_getattr + adds r3, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r1, =0x03005d70 + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + mov r2, r8 + bl sub_807294C + b _081BDCCA + .pool +_081BDCA0: + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3A + bl pokemon_getattr + adds r2, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r1, =0x03005d70 + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + movs r3, 0 + bl sub_807294C +_081BDCCA: + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_t3_healthbar_update + str r1, [r0] + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BDC10 + + thumb_func_start sub_81BDD00 +sub_81BDD00: @ 81BDD00 + push {r4-r7,lr} + ldr r5, =0x02023064 + ldr r6, =0x02024064 + ldrb r0, [r6] + lsls r0, 9 + adds r1, r5, 0x1 + adds r0, r1 + ldrb r7, [r0] + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + cmp r0, 0x63 + bls _081BDD38 + bl dp01_tbl3_exec_completed + b _081BDD84 + .pool +_081BDD38: + movs r0, 0x1 + bl load_gfxc_health_bar + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + ldrb r1, [r6] + lsls r1, 9 + adds r0, r5, 0x2 + adds r0, r1, r0 + ldrb r4, [r0] + adds r0, r5, 0x3 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 8 + orrs r4, r0 + ldr r0, =sub_81BB29C + movs r1, 0xA + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r7, [r1, 0x8] + strh r4, [r1, 0xA] + ldrb r0, [r6] + strh r0, [r1, 0xC] + ldr r1, =0x03005d60 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =nullsub_21 + str r1, [r0] +_081BDD84: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BDD00 + + thumb_func_start sub_81BDD9C +sub_81BDD9C: @ 81BDD9C + push {r4,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _081BDDF0 + ldr r0, =0x03005d70 + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x020244ec + adds r1, r2 + movs r2, 0x9 + bl healthbar_draw_field_maybe + ldrb r2, [r4] + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_81BBC04 + str r1, [r0] +_081BDDF0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BDD9C + + thumb_func_start sub_81BDE14 +sub_81BDE14: @ 81BDE14 + push {r4,r5,lr} + ldr r5, =0x02024064 + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _081BDE64 + ldr r4, =0x02023064 + ldrb r3, [r5] + lsls r3, 9 + adds r0, r4, 0x1 + adds r0, r3, r0 + ldrb r0, [r0] + adds r1, r4, 0x2 + adds r1, r3, r1 + ldrb r1, [r1] + adds r2, r4, 0x3 + adds r2, r3, r2 + ldrb r2, [r2] + lsls r2, 8 + orrs r1, r2 + adds r2, r4, 0x4 + adds r2, r3, r2 + ldrb r2, [r2] + lsls r2, 16 + orrs r1, r2 + adds r4, 0x5 + adds r3, r4 + ldrb r2, [r3] + lsls r2, 24 + orrs r1, r2 + bl move_anim_start_t2_for_situation + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_81BBC04 + str r1, [r0] +_081BDE64: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BDE14 + + thumb_func_start sub_81BDE7C +sub_81BDE7C: @ 81BDE7C + push {lr} + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81BDE7C + + thumb_func_start sub_81BDE88 +sub_81BDE88: @ 81BDE88 + push {lr} + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81BDE88 + + thumb_func_start sub_81BDE94 +sub_81BDE94: @ 81BDE94 + push {lr} + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81BDE94 + + thumb_func_start sub_81BDEA0 +sub_81BDEA0: @ 81BDEA0 + push {lr} + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81BDEA0 + + thumb_func_start sub_81BDEAC +sub_81BDEAC: @ 81BDEAC + push {lr} + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81BDEAC + + thumb_func_start sub_81BDEB8 +sub_81BDEB8: @ 81BDEB8 + push {lr} + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81BDEB8 + + thumb_func_start sub_81BDEC4 +sub_81BDEC4: @ 81BDEC4 + push {lr} + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81BDEC4 + + thumb_func_start sub_81BDED0 +sub_81BDED0: @ 81BDED0 + push {lr} + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81BDED0 + + thumb_func_start sub_81BDEDC +sub_81BDEDC: @ 81BDEDC + push {lr} + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81BDEDC + + thumb_func_start sub_81BDEE8 +sub_81BDEE8: @ 81BDEE8 + push {lr} + ldr r2, =0x02022d0c + ldrb r1, [r2] + movs r0, 0x80 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BDEE8 + + thumb_func_start sub_81BDF04 +sub_81BDF04: @ 81BDF04 + push {lr} + ldr r3, =0x02022d0c + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0x7F + ands r1, r0 + ldrb r2, [r3] + movs r0, 0x80 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BDF04 + + thumb_func_start sub_81BDF3C +sub_81BDF3C: @ 81BDF3C + push {lr} + ldr r2, =0x02022d0c + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BDF3C + + thumb_func_start sub_81BDF54 +sub_81BDF54: @ 81BDF54 + push {lr} + ldr r3, =0x02022d0c + ldr r1, [r3] + lsls r1, 24 + lsrs r1, 31 + movs r0, 0x1 + eors r1, r0 + lsls r1, 7 + ldrb r2, [r3] + movs r0, 0x7F + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BDF54 + + thumb_func_start dp01t_29_3_blink +dp01t_29_3_blink: @ 81BDF7C + push {r4,lr} + ldr r3, =0x02020630 + ldr r2, =0x020241e4 + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _081BDFB0 + bl dp01_tbl3_exec_completed + b _081BDFDA + .pool +_081BDFB0: + ldr r1, =0x020244b9 + movs r0, 0x1 + strb r0, [r1] + ldrb r0, [r4] + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0 + strh r1, [r0, 0x30] + ldrb r0, [r4] + bl sub_80769F4 + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_blink_t3 + str r1, [r0] +_081BDFDA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_29_3_blink + + thumb_func_start sub_81BDFEC +sub_81BDFEC: @ 81BDFEC + push {lr} + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81BDFEC + + thumb_func_start sub_81BDFF8 +sub_81BDFF8: @ 81BDFF8 + push {r4,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + movs r3, 0x3F + cmp r0, 0 + bne _081BE00C + movs r3, 0xC0 +_081BE00C: + ldr r2, =0x02023064 + ldrb r1, [r4] + lsls r1, 9 + adds r0, r2, 0x1 + adds r0, r1, r0 + ldrb r0, [r0] + adds r2, 0x2 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 8 + orrs r0, r1 + lsls r1, r3, 24 + asrs r1, 24 + bl audio_play_and_stuff + bl dp01_tbl3_exec_completed + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BDFF8 + + thumb_func_start sub_81BE03C +sub_81BE03C: @ 81BE03C + push {r4,r5,lr} + ldr r4, =0x02023064 + ldr r5, =0x02024064 + ldrb r0, [r5] + lsls r3, r0, 9 + adds r0, r4, 0x3 + adds r0, r3, r0 + ldrb r0, [r0] + cmp r0, 0 + beq _081BE078 + bl sub_805EA60 + ldrb r1, [r5] + lsls r1, 9 + adds r0, r4, 0x1 + adds r0, r1, r0 + ldrb r0, [r0] + adds r2, r4, 0x2 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 8 + orrs r0, r1 + bl song_play_for_text + b _081BE08C + .pool +_081BE078: + adds r0, r4, 0x1 + adds r0, r3, r0 + ldrb r0, [r0] + adds r1, r4, 0x2 + adds r1, r3, r1 + ldrb r1, [r1] + lsls r1, 8 + orrs r0, r1 + bl fanfare_play +_081BE08C: + bl dp01_tbl3_exec_completed + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81BE03C + + thumb_func_start sub_81BE098 +sub_81BE098: @ 81BE098 + push {lr} + ldr r1, =0x0202406e + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x19 + negs r1, r1 + movs r2, 0x5 + bl sub_80A32E4 + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BE098 + + thumb_func_start dp01t_2E_3_battle_intro +dp01t_2E_3_battle_intro: @ 81BE0D8 + push {lr} + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + bl battle_intro_launch + ldr r2, =0x020243fc + ldrh r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_2E_3_battle_intro + + thumb_func_start sub_81BE10C +sub_81BE10C: @ 81BE10C + push {r4-r6,lr} + ldr r6, =0x020241e4 + ldr r5, =0x02024064 + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl oamt_add_pos2_onto_pos1 + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x32 + strh r1, [r0, 0x2E] + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =0x0000ffd8 + strh r1, [r0, 0x32] + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x22] + strh r1, [r0, 0x36] + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_80A6EEC + str r1, [r0] + ldrb r2, [r5] + adds r0, r2, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r2, [r0, 0x38] + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_805CC00 + bl oamt_set_x3A_32 + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl StartObjectImageAnim + ldr r0, =0x0000d6f9 + bl AllocObjectPalette + lsls r0, 24 + lsrs r4, r0, 24 + ldr r2, =0x02038bce + ldrh r1, [r2] + ldr r0, =0x00000c03 + cmp r1, r0 + bne _081BE1FC + ldr r0, =gTrainerBackPicPaletteTable + ldr r0, [r0, 0x38] + lsls r4, 4 + movs r2, 0x80 + lsls r2, 1 + adds r1, r4, r2 + movs r2, 0x20 + bl decompress_palette + b _081BE21A + .pool +_081BE1FC: + ldrh r0, [r2] + bl sub_8162AA0 + lsls r0, 24 + ldr r1, =gTrainerFrontPicPaletteTable + lsrs r0, 21 + adds r0, r1 + ldr r0, [r0] + lsls r4, 4 + movs r2, 0x80 + lsls r2, 1 + adds r1, r4, r2 + movs r2, 0x20 + bl decompress_palette +_081BE21A: + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r5, =0x02024064 + ldrb r0, [r5] + adds r0, r1 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r4 + strb r0, [r1, 0x5] + ldr r0, =sub_81BE2C8 + movs r1, 0x5 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + ldrb r0, [r5] + strh r0, [r1, 0x8] + ldr r3, =0x020244d0 + ldr r0, [r3] + ldrb r2, [r5] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081BE27E + ldr r0, =0x020244b4 + adds r0, r2, r0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + ldr r1, =sub_8073C30 + str r1, [r0] +_081BE27E: + ldr r0, [r3] + ldr r2, [r0, 0x8] + ldrb r0, [r2, 0x9] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x9] + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =nullsub_77 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BE10C + + thumb_func_start sub_81BE2C8 +sub_81BE2C8: @ 81BE2C8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, =0x03005e00 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r1, r0, r1 + ldrh r2, [r1, 0xA] + movs r3, 0xA + ldrsh r0, [r1, r3] + cmp r0, 0x17 + bgt _081BE2F4 + adds r0, r2, 0x1 + strh r0, [r1, 0xA] + b _081BE3B0 + .pool +_081BE2F4: + ldr r7, =0x02024064 + ldrb r0, [r7] + mov r9, r0 + ldrh r0, [r1, 0x8] + strb r0, [r7] + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _081BE314 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081BE344 +_081BE314: + ldr r0, =0x02023064 + ldrb r1, [r7] + lsls r2, r1, 9 + adds r0, 0x1 + adds r2, r0 + ldr r0, =0x0202406e + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + strb r0, [r2] + ldrb r0, [r7] + movs r1, 0 + bl sub_81BD0E4 + b _081BE398 + .pool +_081BE344: + ldr r4, =0x02023064 + ldrb r0, [r7] + lsls r1, r0, 9 + adds r4, 0x1 + adds r1, r4 + ldr r5, =0x0202406e + lsls r0, 1 + adds r0, r5 + ldrh r0, [r0] + strb r0, [r1] + ldrb r0, [r7] + movs r1, 0 + bl sub_81BD0E4 + ldrb r0, [r7] + movs r6, 0x2 + eors r0, r6 + strb r0, [r7] + ldrb r0, [r7] + lsls r1, r0, 9 + adds r1, r4 + lsls r0, 1 + adds r0, r5 + ldrh r0, [r0] + strb r0, [r1] + ldrb r1, [r7] + lsls r0, r1, 1 + adds r0, r5 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =0x020244ec + adds r0, r2 + bl sub_805DD7C + ldrb r0, [r7] + movs r1, 0 + bl sub_81BD0E4 + ldrb r0, [r7] + eors r0, r6 + strb r0, [r7] +_081BE398: + ldr r1, =0x03005d60 + ldr r2, =0x02024064 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_81BB02C + str r1, [r0] + mov r3, r9 + strb r3, [r2] + mov r0, r8 + bl remove_task +_081BE3B0: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BE2C8 + + thumb_func_start dp01t_30_3_80EB11C +dp01t_30_3_80EB11C: @ 81BE3D4 + push {r4-r6,lr} + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _081BE404 + adds r0, r2, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _081BE404 + bl dp01_tbl3_exec_completed + b _081BE478 + .pool +_081BE404: + ldr r6, =0x020244d0 + ldr r0, [r6] + ldr r5, =0x02024064 + ldrb r1, [r5] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] + ldrb r0, [r5] + lsls r3, r0, 9 + ldr r4, =0x02023068 + adds r1, r3, r4 + subs r2, r4, 0x3 + adds r2, r3, r2 + ldrb r2, [r2] + subs r4, 0x2 + adds r3, r4 + ldrb r3, [r3] + bl sub_80735DC + ldr r2, =0x020244b4 + ldrb r1, [r5] + adds r1, r2 + movs r3, 0 + strb r0, [r1] + ldr r0, [r6] + ldrb r1, [r5] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strb r3, [r0, 0x5] + ldrb r2, [r5] + lsls r0, r2, 9 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _081BE46C + ldr r0, [r6] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + movs r1, 0x5D + strb r1, [r0, 0x5] +_081BE46C: + ldr r0, =0x03005d60 + ldrb r1, [r5] + lsls r1, 2 + adds r1, r0 + ldr r0, =sub_81BE498 + str r0, [r1] +_081BE478: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_30_3_80EB11C + + thumb_func_start sub_81BE498 +sub_81BE498: @ 81BE498 + push {r4,lr} + ldr r4, =0x020244d0 + ldr r0, [r4] + ldr r3, =0x02024064 + ldrb r1, [r3] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x5] + adds r2, r1, 0x1 + strb r2, [r0, 0x5] + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x5C + bls _081BE4D0 + ldr r0, [r4] + ldrb r1, [r3] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strb r1, [r0, 0x5] + bl dp01_tbl3_exec_completed +_081BE4D0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BE498 + + thumb_func_start sub_81BE4E0 +sub_81BE4E0: @ 81BE4E0 + push {lr} + ldr r0, =0x020244d0 + ldr r1, [r0] + ldr r0, =0x02024064 + ldrb r3, [r0] + ldr r1, [r1, 0x4] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081BE512 + ldr r2, =0x03005e00 + ldr r0, =0x020244b4 + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, =sub_8073C30 + str r1, [r0] +_081BE512: + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BE4E0 + + thumb_func_start sub_81BE530 +sub_81BE530: @ 81BE530 + push {lr} + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81BE530 + + thumb_func_start sub_81BE53C +sub_81BE53C: @ 81BE53C + push {r4,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + bl sub_80A6A90 + lsls r0, 24 + cmp r0, 0 + beq _081BE582 + ldr r3, =0x02020630 + ldr r0, =0x020241e4 + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + ldr r0, =0x02023064 + lsls r1, 9 + adds r0, 0x1 + adds r1, r0 + adds r2, 0x3E + movs r0, 0x1 + ldrb r1, [r1] + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldrb r0, [r4] + bl sub_805E408 +_081BE582: + bl dp01_tbl3_exec_completed + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BE53C + + thumb_func_start sub_81BE59C +sub_81BE59C: @ 81BE59C + push {r4-r6,lr} + sub sp, 0x4 + ldr r6, =0x02024064 + ldrb r0, [r6] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _081BE5F4 + ldr r5, =0x02023064 + ldrb r2, [r6] + lsls r1, r2, 9 + adds r0, r5, 0x1 + adds r0, r1, r0 + ldrb r3, [r0] + adds r0, r5, 0x2 + adds r0, r1, r0 + ldrb r4, [r0] + adds r5, 0x3 + adds r1, r5 + ldrb r0, [r1] + lsls r0, 8 + orrs r4, r0 + str r4, [sp] + adds r0, r2, 0 + adds r1, r2, 0 + bl move_anim_start_t3 + lsls r0, 24 + cmp r0, 0 + beq _081BE5E8 + bl dp01_tbl3_exec_completed + b _081BE5F4 + .pool +_081BE5E8: + ldr r0, =0x03005d60 + ldrb r1, [r6] + lsls r1, 2 + adds r1, r0 + ldr r0, =bx_80E8A6C + str r0, [r1] +_081BE5F4: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BE59C + + thumb_func_start sub_81BE604 +sub_81BE604: @ 81BE604 + push {lr} + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81BE604 + + thumb_func_start sub_81BE610 +sub_81BE610: @ 81BE610 + push {lr} + bl dp01_tbl3_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81BE610 + + thumb_func_start sub_81BE61C +sub_81BE61C: @ 81BE61C + push {r4,lr} + ldr r2, =0x0202433a + ldr r1, =0x02023064 + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + movs r0, 0x5 + bl sub_80A2F50 + movs r0, 0x3 + bl sub_80A2390 + bl dp01_tbl3_exec_completed + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_80587B0 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BE61C + + thumb_func_start nullsub_128 +nullsub_128: @ 81BE668 + bx lr + thumb_func_end nullsub_128 + + thumb_func_start sub_81BE66C +sub_81BE66C: @ 81BE66C + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r1, [r0, 0x4] + movs r0, 0xD0 + lsls r0, 5 + cmp r1, r0 + bne _081BE690 + movs r0, 0xA7 + lsls r0, 1 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + b _081BE692 + .pool +_081BE690: + movs r0, 0 +_081BE692: + pop {r1} + bx r1 + thumb_func_end sub_81BE66C + + thumb_func_start sub_81BE698 +sub_81BE698: @ 81BE698 + push {lr} + ldr r0, =0x0203cf18 + ldr r0, [r0] + adds r0, 0x4 + bl sub_8151E50 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BE698 + + thumb_func_start sub_81BE6AC +sub_81BE6AC: @ 81BE6AC + ldr r1, =0x0203cf18 + movs r0, 0 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_81BE6AC + + thumb_func_start sub_81BE6B8 +sub_81BE6B8: @ 81BE6B8 + push {r4,lr} + ldr r4, =0x0203cf18 + ldr r0, [r4] + cmp r0, 0 + beq _081BE6CC + movs r0, 0 + str r0, [r4] + b _081BE718 + .pool +_081BE6CC: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r1, [r0, 0x4] + movs r0, 0xD0 + lsls r0, 5 + cmp r1, r0 + bne _081BE718 + movs r0, 0xA7 + lsls r0, 1 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _081BE718 + movs r0, 0xC8 + bl AllocZeroed + str r0, [r4] + adds r0, 0x4 + bl sub_8151B3C + ldr r0, [r4] + adds r0, 0x4 + ldr r1, =gUnknown_08617E18 + bl sub_8151B68 + ldr r0, [r4] + adds r0, 0x4 + movs r1, 0x1 + movs r2, 0x1 + bl sub_8151CA8 + ldr r0, =sub_81BE698 + movs r1, 0xFF + bl AddTask + ldr r1, [r4] + strb r0, [r1] +_081BE718: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BE6B8 + + thumb_func_start sub_81BE72C +sub_81BE72C: @ 81BE72C + push {r4,lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r1, [r0, 0x4] + movs r0, 0xD0 + lsls r0, 5 + cmp r1, r0 + bne _081BE788 + movs r0, 0xA7 + lsls r0, 1 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _081BE788 + ldr r4, =0x0203cf18 + ldr r0, [r4] + cmp r0, 0 + beq _081BE788 + ldr r0, =sub_81BE698 + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + beq _081BE766 + ldr r0, [r4] + ldrb r0, [r0] + bl remove_task +_081BE766: + ldr r0, [r4] + adds r0, 0x4 + movs r1, 0x1 + movs r2, 0x1 + bl sub_8151D28 + ldr r0, [r4] + adds r0, 0x4 + movs r1, 0x1 + movs r2, 0x1 + bl sub_8151C50 + ldr r0, [r4] + bl Free + movs r0, 0 + str r0, [r4] +_081BE788: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BE72C + + thumb_func_start sub_81BE79C +sub_81BE79C: @ 81BE79C + push {r4,lr} + ldr r0, =0x000040cb + bl VarGet + lsls r0, 16 + cmp r0, 0 + beq _081BE7B8 + movs r0, 0xA7 + lsls r0, 1 + bl FlagReset + b _081BE7EE + .pool +_081BE7B8: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x1 + ands r4, r0 + movs r0, 0x9D + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081BE7D4 + movs r4, 0x1 +_081BE7D4: + cmp r4, 0 + beq _081BE7E6 + movs r0, 0xA7 + lsls r0, 1 + bl FlagSet + bl sub_81BE6B8 + b _081BE7EE +_081BE7E6: + movs r0, 0xA7 + lsls r0, 1 + bl FlagReset +_081BE7EE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81BE79C + + thumb_func_start sub_81BE7F4 +sub_81BE7F4: @ 81BE7F4 + push {lr} + ldr r0, =sub_81BE808 + movs r1, 0x8 + bl AddTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BE7F4 + + thumb_func_start sub_81BE808 +sub_81BE808: @ 81BE808 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + movs r0, 0x2D + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + mov r0, sp + ldrb r0, [r0] + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 2 + ldr r4, =0x02037350 + adds r2, r4 + ldr r3, =0x02020630 + ldrb r1, [r2, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x26] + adds r1, 0x4 + strh r1, [r0, 0x26] + ldr r0, =0x02037590 + ldrb r0, [r0, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r2, [r2, 0x4] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r3 + movs r4, 0x22 + ldrsh r2, [r0, r4] + movs r4, 0x26 + ldrsh r0, [r0, r4] + adds r2, r0 + ldrb r1, [r1, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r3, 0x22 + ldrsh r1, [r0, r3] + movs r4, 0x26 + ldrsh r0, [r0, r4] + adds r1, r0 + cmp r2, r1 + blt _081BE882 + adds r0, r5, 0 + bl remove_task + bl script_env_2_enable_and_set_ctx_running +_081BE882: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BE808 + + thumb_func_start sp136_strengh_sound +sp136_strengh_sound: @ 81BE89C + 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 r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + ldr r0, =sub_81BE900 + movs r1, 0x9 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r4, [r1, 0x8] + strh r0, [r1, 0xA] + strh r5, [r1, 0xC] + strh r6, [r1, 0xE] + mov r0, r8 + strh r0, [r1, 0x10] + movs r0, 0 + bl SetCameraPanningCallback + movs r0, 0xD6 + bl audio_play + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sp136_strengh_sound + + thumb_func_start sub_81BE900 +sub_81BE900: @ 81BE900 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + movs r1, 0x2 + ldrsh r0, [r4, r1] + movs r2, 0x6 + ldrsh r1, [r4, r2] + bl __modsi3 + cmp r0, 0 + bne _081BE95C + strh r0, [r4, 0x2] + ldrh r0, [r4, 0x4] + subs r0, 0x1 + strh r0, [r4, 0x4] + ldrh r0, [r4] + negs r0, r0 + strh r0, [r4] + ldrh r0, [r4, 0x8] + negs r0, r0 + strh r0, [r4, 0x8] + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x8 + ldrsh r1, [r4, r2] + bl SetCameraPanning + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081BE95C + bl sub_81BE968 + adds r0, r5, 0 + bl remove_task + bl InstallCameraPanAheadCallback +_081BE95C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BE900 + + thumb_func_start sub_81BE968 +sub_81BE968: @ 81BE968 + push {lr} + ldr r0, =sub_81BE9C0 + bl get_task_id_by_function + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _081BE988 + ldr r0, =0x03005e00 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_081BE988: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BE968 + + thumb_func_start sub_81BE994 +sub_81BE994: @ 81BE994 + push {lr} + ldr r0, =gUnknown_08617D94 + bl LoadObjectPics + bl sub_81BEA20 + ldr r0, =sub_81BE9C0 + movs r1, 0x8 + bl AddTask + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0x10 + movs r3, 0x3 + bl sp136_strengh_sound + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BE994 + + thumb_func_start sub_81BE9C0 +sub_81BE9C0: @ 81BE9C0 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r3, r1, 3 + ldr r4, =0x03005e08 + adds r2, r3, r4 + ldrh r0, [r2, 0x2] + adds r0, 0x1 + strh r0, [r2, 0x2] + lsls r0, 16 + movs r1, 0xFA + lsls r1, 18 + cmp r0, r1 + beq _081BE9E6 + ldrh r0, [r2] + cmp r0, 0x11 + bne _081BE9F0 +_081BE9E6: + adds r0, r4, 0 + subs r0, 0x8 + adds r0, r3, r0 + ldr r1, =sub_81BEA00 + str r1, [r0] +_081BE9F0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BE9C0 + + thumb_func_start sub_81BEA00 +sub_81BEA00: @ 81BEA00 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0xFA + lsls r0, 4 + bl FreeObjectTilesByTag + adds r0, r4, 0 + bl remove_task + bl script_env_2_enable_and_set_ctx_running + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81BEA00 + + thumb_func_start sub_81BEA20 +sub_81BEA20: @ 81BEA20 + push {r4-r7,lr} + movs r4, 0 + ldr r5, =gUnknown_08617D64 + adds r7, r5, 0x2 + ldr r6, =0x02020630 +_081BEA2A: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 1 + adds r1, r0, r5 + ldrh r1, [r1] + adds r1, 0x78 + lsls r1, 16 + asrs r1, 16 + adds r0, r7 + movs r3, 0 + ldrsh r2, [r0, r3] + ldr r0, =gUnknown_08617E60 + movs r3, 0x8 + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r2, [r0, 0x5] + movs r3, 0xD + negs r3, r3 + adds r1, r3, 0 + ands r2, r1 + movs r1, 0xF + ands r2, r1 + strb r2, [r0, 0x5] + strh r4, [r0, 0x2E] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _081BEA2A + movs r4, 0 + ldr r5, =gUnknown_08617D64 + adds r7, r5, 0x2 + ldr r6, =0x02020630 +_081BEA78: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 1 + adds r1, r0, r5 + ldrh r1, [r1] + adds r1, 0x73 + lsls r1, 16 + asrs r1, 16 + adds r0, r7 + ldrh r2, [r0] + subs r2, 0x3 + lsls r2, 16 + asrs r2, 16 + ldr r0, =gUnknown_08617E34 + movs r3, 0x8 + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r2, [r0, 0x5] + movs r3, 0xD + negs r3, r3 + adds r1, r3, 0 + ands r2, r1 + movs r1, 0xF + ands r2, r1 + strb r2, [r0, 0x5] + strh r4, [r0, 0x2E] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _081BEA78 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BEA20 + + thumb_func_start sub_81BEAD8 +sub_81BEAD8: @ 81BEAD8 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + adds r0, 0x2 + strh r0, [r4, 0x30] + movs r1, 0x30 + ldrsh r0, [r4, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + strh r0, [r4, 0x26] + movs r0, 0x22 + ldrsh r3, [r4, r0] + movs r1, 0x26 + ldrsh r0, [r4, r1] + adds r3, r0 + ldr r2, =gUnknown_08617D64 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + adds r2, 0x4 + adds r0, r2 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r3, r0 + ble _081BEB1A + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + bl sub_81BE968 +_081BEB1A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BEAD8 + + thumb_func_start sub_81BEB24 +sub_81BEB24: @ 81BEB24 + push {r4,r5,lr} + movs r4, 0 + ldr r5, =gUnknown_08617DA4 +_081BEB2A: + lsls r2, r4, 2 + adds r2, r5 + ldrb r0, [r2] + adds r0, 0x7 + ldrb r1, [r2, 0x1] + adds r1, 0x7 + ldrh r2, [r2, 0x2] + bl MapGridSetMetatileIdAt + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x11 + bls _081BEB2A + bl DrawWholeMapView + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BEB24 + + thumb_func_start sub_81BEB54 +sub_81BEB54: @ 81BEB54 + push {lr} + ldr r0, =sub_81BED50 + movs r1, 0x9 + bl AddTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BEB54 + + thumb_func_start sub_81BEB68 +sub_81BEB68: @ 81BEB68 + push {lr} + ldr r0, =sub_81BEBF4 + movs r1, 0x9 + bl AddTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BEB68 + + thumb_func_start sub_81BEB7C +sub_81BEB7C: @ 81BEB7C + push {lr} + ldr r0, =sub_81BF028 + movs r1, 0x9 + bl AddTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BEB7C + + thumb_func_start sub_81BEB90 +sub_81BEB90: @ 81BEB90 + push {r4,lr} + ldr r4, =0x0203cf14 + ldr r0, [r4] + ldrh r1, [r0] + movs r0, 0x10 + bl SetGpuReg + ldr r0, [r4] + ldrh r1, [r0, 0x2] + movs r0, 0x12 + bl SetGpuReg + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BEB90 + + thumb_func_start sub_81BEBB4 +sub_81BEBB4: @ 81BEBB4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r2, r1, r2 + ldrh r1, [r2, 0x8] + movs r3, 0x8 + ldrsh r0, [r2, r3] + cmp r0, 0 + bne _081BEBEC + ldr r0, =0x0203cf14 + ldr r1, [r0] + ldrh r0, [r1] + negs r0, r0 + strh r0, [r1] + movs r0, 0x2 + strh r0, [r2, 0x8] + bl sub_81BEB90 + b _081BEBF0 + .pool +_081BEBEC: + subs r0, r1, 0x1 + strh r0, [r2, 0x8] +_081BEBF0: + pop {r0} + bx r0 + thumb_func_end sub_81BEBB4 + + thumb_func_start sub_81BEBF4 +sub_81BEBF4: @ 81BEBF4 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0x6 + bls _081BEC10 + b _081BED40 +_081BEC10: + lsls r0, 2 + ldr r1, =_081BEC24 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081BEC24: + .4byte _081BEC40 + .4byte _081BEC50 + .4byte _081BEC88 + .4byte _081BECB0 + .4byte _081BECF8 + .4byte _081BED00 + .4byte _081BED1C +_081BEC40: + bl FreeAllWindowBuffers + movs r0, 0 + movs r1, 0x7 + movs r2, 0x2 + bl SetBgAttribute + b _081BED04 +_081BEC50: + ldr r4, =0x0203cf04 + movs r0, 0x92 + lsls r0, 4 + bl AllocZeroed + str r0, [r4] + ldr r4, =0x0203cf08 + movs r0, 0x80 + lsls r0, 4 + bl AllocZeroed + str r0, [r4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + b _081BECD8 + .pool +_081BEC88: + ldr r0, =gUnknown_08617274 + ldr r4, =0x0203cf04 + ldr r1, [r4] + movs r2, 0x92 + lsls r2, 3 + bl CpuSet + ldr r1, [r4] + movs r2, 0x92 + lsls r2, 4 + movs r0, 0 + movs r3, 0 + bl LoadBgTiles + b _081BECD8 + .pool +_081BECB0: + ldr r0, =0x0203cf08 + ldr r1, [r0] + movs r0, 0 + bl SetBgTilemapBuffer + ldr r1, =gUnknown_08617B94 + movs r0, 0x6 + str r0, [sp] + movs r0, 0xC + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + movs r2, 0xC + movs r3, 0x1D + bl CopyToBgTilemapBufferRect_ChangePalette + movs r0, 0 + bl CopyBgTilemapBufferToVram +_081BECD8: + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + b _081BED40 + .pool +_081BECF8: + movs r0, 0 + bl ShowBg + b _081BED04 +_081BED00: + bl sub_81BEB24 +_081BED04: + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _081BED40 + .pool +_081BED1C: + ldr r4, =0x0203cf14 + movs r0, 0x4 + bl Alloc + str r0, [r4] + movs r2, 0 + movs r1, 0x2 + strh r1, [r0] + strh r2, [r0, 0x2] + ldr r0, =sub_81BEBB4 + movs r1, 0xA + bl AddTask + adds r0, r5, 0 + bl remove_task + bl script_env_2_enable_and_set_ctx_running +_081BED40: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BEBF4 + + thumb_func_start sub_81BED50 +sub_81BED50: @ 81BED50 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r1, =0x03005e00 + lsls r0, 2 + add r0, r10 + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x8] + subs r0, 0x1 + lsls r0, 16 + asrs r0, 16 + adds r6, r1, 0 + cmp r0, 0x7 + bls _081BED7C + b _081BF002 +_081BED7C: + lsls r0, 2 + ldr r1, =_081BED90 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081BED90: + .4byte _081BEDB0 + .4byte _081BF002 + .4byte _081BEDC4 + .4byte _081BEF64 + .4byte _081BEF94 + .4byte _081BEFD0 + .4byte _081BEFF0 + .4byte _081BEFF8 +_081BEDB0: + ldr r4, =0x0203cf10 + movs r0, 0xC0 + lsls r0, 2 + bl AllocZeroed + str r0, [r4] + b _081BF002 + .pool +_081BEDC4: + mov r1, r10 + lsls r0, r1, 2 + adds r1, r0, r1 + lsls r1, 3 + adds r2, r1, r6 + ldrh r3, [r2, 0xE] + movs r4, 0xE + ldrsh r1, [r2, r4] + str r0, [sp, 0x8] + cmp r1, 0x5F + bgt _081BEE8A + movs r1, 0xA + ldrsh r0, [r2, r1] + cmp r0, 0x1 + ble _081BEE7C + lsls r0, r3, 24 + lsrs r4, r0, 24 + movs r0, 0x30 + bl Alloc + ldr r3, =0x0203cf10 + ldr r1, [r3] + lsls r2, r4, 3 + adds r1, r2, r1 + str r0, [r1] + movs r5, 0 + adds r4, r2, 0 +_081BEDFA: + ldr r0, [r3] + adds r0, r4, r0 + ldr r0, [r0] + adds r0, r5 + strb r5, [r0] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x2F + bls _081BEDFA + movs r5, 0 + ldr r7, =0x0203cf10 + adds r6, r2, 0 +_081BEE14: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x30 + bl __umodsi3 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x30 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + ldr r1, [r7] + adds r1, r6, r1 + ldr r1, [r1] + adds r0, r1, r0 + ldrb r2, [r0] + adds r1, r4 + ldrb r1, [r1] + strb r1, [r0] + ldr r0, [r7] + adds r0, r6, r0 + ldr r0, [r0] + adds r0, r4 + strb r2, [r0] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x2F + bls _081BEE14 + ldr r0, =0x03005e00 + ldr r1, [sp, 0x8] + add r1, r10 + lsls r1, 3 + adds r2, r1, r0 + ldrh r3, [r2, 0xE] + movs r4, 0xE + ldrsh r1, [r2, r4] + adds r6, r0, 0 + cmp r1, 0x5F + bgt _081BEE78 + adds r0, r3, 0x1 + strh r0, [r2, 0xE] +_081BEE78: + movs r0, 0 + strh r0, [r2, 0xA] +_081BEE7C: + ldr r1, [sp, 0x8] + add r1, r10 + lsls r1, 3 + adds r1, r6 + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] +_081BEE8A: + ldr r0, [sp, 0x8] + add r0, r10 + lsls r0, 3 + adds r0, r6 + ldrb r4, [r0, 0xE] + ldrb r5, [r0, 0xC] + lsls r0, r4, 16 + cmp r5, r4 + bcs _081BEF32 + str r0, [sp, 0xC] +_081BEE9E: + movs r6, 0 + adds r0, r5, 0x1 + str r0, [sp, 0x4] + lsls r4, r5, 3 + movs r2, 0x5F + subs r1, r2, r5 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 4 + mov r9, r0 +_081BEEB2: + ldr r0, =0x0203cf04 + ldr r0, [r0] + ldr r7, =0x0203cf10 + ldr r3, [r7] + adds r3, r4, r3 + ldrb r2, [r3, 0x4] + adds r1, r2, 0x1 + strb r1, [r3, 0x4] + lsls r2, 24 + lsrs r2, 24 + ldr r1, [r3] + adds r1, r2 + ldrb r1, [r1] + add r1, r9 + lsls r1, 16 + lsrs r1, 16 + movs r2, 0x1 + mov r8, r2 + str r2, [sp] + movs r2, 0 + movs r3, 0x30 + bl sub_81BF2B8 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + beq _081BEEB2 + ldr r0, [r7] + adds r1, r4, r0 + ldrb r0, [r1, 0x4] + cmp r0, 0x2F + bls _081BEF24 + ldr r0, [r1] + bl Free + ldr r0, [r7] + adds r0, r4, r0 + movs r1, 0 + str r1, [r0] + ldr r1, [sp, 0x8] + add r1, r10 + lsls r1, 3 + ldr r4, =0x03005e00 + adds r1, r4 + ldrh r0, [r1, 0xC] + adds r0, 0x1 + strh r0, [r1, 0xC] + mov r0, r8 + ands r5, r0 + cmp r5, 0x1 + bne _081BEF24 + ldr r0, =0x0203cf14 + ldr r1, [r0] + ldrh r0, [r1, 0x2] + subs r0, 0x1 + strh r0, [r1, 0x2] +_081BEF24: + ldr r1, [sp, 0x4] + lsls r0, r1, 16 + lsrs r5, r0, 16 + ldr r2, [sp, 0xC] + lsrs r0, r2, 16 + cmp r5, r0 + bcc _081BEE9E +_081BEF32: + ldr r0, =0x0203cf04 + ldr r1, [r0] + movs r2, 0x92 + lsls r2, 4 + movs r0, 0 + movs r3, 0 + bl LoadBgTiles + ldr r0, =0x0203cf10 + ldr r0, [r0] + movs r4, 0xBE + lsls r4, 2 + adds r0, r4 + ldrb r0, [r0, 0x4] + cmp r0, 0x2F + bhi _081BF002 + b _081BF014 + .pool +_081BEF64: + movs r0, 0 + bl UnsetBgTilemapBuffer + ldr r0, =sub_81BEBB4 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _081BEF7C + bl remove_task +_081BEF7C: + ldr r0, =0x0203cf14 + ldr r1, [r0] + movs r0, 0 + strh r0, [r1] + strh r0, [r1, 0x2] + bl sub_81BEB90 + b _081BF002 + .pool +_081BEF94: + ldr r4, =0x0203cf14 + ldr r0, [r4] + bl Free + movs r5, 0 + str r5, [r4] + ldr r4, =0x0203cf10 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203cf04 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203cf08 + ldr r0, [r4] + bl Free + str r5, [r4] + b _081BF002 + .pool +_081BEFD0: + movs r0, 0xC + movs r1, 0x2 + bl SetGpuRegBits + movs r0, 0x8 + movs r1, 0 + bl SetGpuRegBits + movs r0, 0 + movs r1, 0x7 + movs r2, 0 + bl SetBgAttribute + bl sub_81971D0 + b _081BF002 +_081BEFF0: + movs r0, 0 + bl ShowBg + b _081BF002 +_081BEFF8: + mov r0, r10 + bl remove_task + bl script_env_2_enable_and_set_ctx_running +_081BF002: + ldr r0, =0x03005e00 + mov r2, r10 + lsls r1, r2, 2 + add r1, r10 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_081BF014: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BED50 + + thumb_func_start sub_81BF028 +sub_81BF028: @ 81BF028 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x18 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x8] + subs r0, 0x1 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + bls _081BF04C + b _081BF228 +_081BF04C: + lsls r0, 2 + ldr r1, =_081BF060 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081BF060: + .4byte _081BF080 + .4byte _081BF0B4 + .4byte _081BF0DC + .4byte _081BF0F0 + .4byte _081BF148 + .4byte _081BF170 + .4byte _081BF1CC + .4byte _081BF224 +_081BF080: + ldr r4, =0x0203cf0c + movs r0, 0x14 + bl AllocZeroed + str r0, [r4] + movs r0, 0x80 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1] + movs r0, 0x8 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1, 0x4] + movs r0, 0x80 + lsls r0, 2 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1, 0xC] + movs r0, 0 + strh r0, [r1, 0x10] + b _081BF228 + .pool +_081BF0B4: + ldr r0, =0x0203cf0c + ldr r0, [r0] + ldr r1, [r0] + movs r5, 0 + ldr r2, =gUnknown_08617C44 +_081BF0BE: + adds r0, r5, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + adds r1, 0x1 + cmp r5, 0x7F + bls _081BF0BE + b _081BF228 + .pool +_081BF0DC: + ldr r0, =0x0203cf0c + ldr r0, [r0] + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r1] + movs r0, 0x80 + strh r0, [r1, 0x4] + b _081BF228 + .pool +_081BF0F0: + mov r1, sp + ldr r0, =gUnknown_08617E00 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r4, =0x0203cf0c + ldr r0, [r4] + ldr r0, [r0, 0x4] + str r0, [sp, 0xC] + movs r2, 0x10 + negs r2, r2 + mov r0, sp + movs r1, 0x80 + movs r3, 0x1 + bl AddObjectToFront + ldr r1, [r4] + movs r3, 0 + strb r0, [r1, 0x8] + ldr r2, =0x02020630 + ldr r0, [r4] + ldrb r1, [r0, 0x8] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x28 + strb r3, [r0] + ldr r3, [r4] + ldrb r1, [r3, 0x8] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x20] + strh r1, [r0, 0x2E] + ldrb r1, [r3, 0x8] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x1 + strh r1, [r0, 0x30] +_081BF148: + movs r5, 0 + ldr r2, =0x0203cf0c +_081BF14C: + ldr r0, [r2] + ldr r1, [r0, 0xC] + lsls r0, r5, 1 + adds r0, r1 + strh r5, [r0] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0xFF + bls _081BF14C + b _081BF228 + .pool +_081BF170: + movs r5, 0 + movs r6, 0xFF + ldr r0, =0x000001ff + mov r8, r0 +_081BF178: + bl GenerateRandomNumber + adds r4, r6, 0 + ands r4, r0 + bl GenerateRandomNumber + adds r1, r6, 0 + ands r1, r0 + ldr r0, =0x0203cf0c + ldr r3, [r0] + ldr r0, [r3, 0xC] + lsls r1, 1 + adds r1, r0 + ldrh r2, [r1] + lsls r4, 1 + adds r4, r0 + ldrh r0, [r4] + strh r0, [r1] + strh r2, [r4] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, r8 + bls _081BF178 + ldr r2, =0x02020630 + ldrb r1, [r3, 0x8] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_81BF248 + str r1, [r0] + b _081BF228 + .pool +_081BF1CC: + ldr r3, =0x02020630 + ldr r5, =0x0203cf0c + ldr r0, [r5] + ldrb r1, [r0, 0x8] + lsls r0, r1, 4 + adds r0, r1 + lsls r2, r0, 2 + adds r0, r3, 0 + adds r0, 0x1C + adds r0, r2, r0 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + bne _081BF238 + adds r0, r2, r3 + bl RemoveObjectAndFreeTiles + ldr r0, [r5] + ldr r0, [r0, 0xC] + bl Free + ldr r0, [r5] + movs r4, 0 + str r4, [r0, 0xC] + ldr r0, [r0, 0x4] + bl Free + ldr r0, [r5] + str r4, [r0, 0x4] + ldr r0, [r0] + bl Free + ldr r0, [r5] + str r4, [r0] + bl Free + str r4, [r5] + b _081BF228 + .pool +_081BF224: + bl script_env_2_enable_and_set_ctx_running +_081BF228: + ldr r0, =0x03005e00 + lsls r1, r7, 2 + adds r1, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_081BF238: + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BF028 + + thumb_func_start sub_81BF248 +sub_81BF248: @ 81BF248 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + ldr r0, =0x0203cf0c + ldr r0, [r0] + ldrh r0, [r0, 0x10] + cmp r0, 0xFF + bls _081BF268 + ldr r0, =DummyObjectCallback + str r0, [r5, 0x1C] + b _081BF2B0 + .pool +_081BF268: + ldrh r1, [r5, 0x22] + movs r2, 0x22 + ldrsh r0, [r5, r2] + cmp r0, 0x5F + ble _081BF2AC + movs r4, 0 +_081BF274: + ldr r0, =0x0203cf0c + ldr r3, [r0] + ldr r0, [r3] + ldrh r1, [r3, 0x10] + adds r2, r1, 0x1 + strh r2, [r3, 0x10] + lsls r1, 16 + ldr r2, [r3, 0xC] + lsrs r1, 15 + adds r1, r2 + ldrh r1, [r1] + movs r2, 0 + str r2, [sp] + movs r3, 0x10 + bl sub_81BF2B8 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _081BF274 + adds r0, r5, 0 + movs r1, 0 + bl StartObjectImageAnim + b _081BF2B0 + .pool +_081BF2AC: + adds r0, r1, 0x1 + strh r0, [r5, 0x22] +_081BF2B0: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81BF248 + + thumb_func_start sub_81BF2B8 +sub_81BF2B8: @ 81BF2B8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + str r0, [sp] + mov r10, r1 + adds r6, r2, 0 + mov r8, r3 + ldr r0, [sp, 0x28] + mov r9, r0 + lsls r1, 16 + lsrs r1, 16 + mov r10, r1 + lsls r6, 24 + lsrs r6, 24 + mov r0, r8 + lsls r0, 24 + mov r8, r0 + lsrs r7, r0, 24 + mov r1, r9 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + mov r0, r10 + adds r1, r7, 0 + bl __divsi3 + adds r5, r0, 0 + lsls r5, 24 + lsrs r4, r5, 24 + ldr r3, =0x030012a8 + strh r4, [r3] + mov r0, r10 + adds r1, r7, 0 + str r3, [sp, 0x4] + bl __modsi3 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r3, [sp, 0x4] + strh r2, [r3, 0x2] + movs r1, 0x7 + ands r4, r1 + ands r2, r1 + strh r4, [r3, 0x4] + strh r2, [r3, 0x6] + lsrs r0, 27 + lsrs r5, 27 + strh r0, [r3, 0x8] + strh r5, [r3, 0xA] + mov r1, r8 + lsrs r1, 27 + lsls r1, 6 + mov r8, r1 + mov r1, r8 + muls r1, r5 + lsls r0, 6 + adds r1, r0 + lsls r1, 16 + lsrs r1, 16 + strh r1, [r3, 0xC] + lsls r4, 3 + adds r4, r2 + adds r1, r4 + lsls r4, r1, 16 + lsrs r4, 17 + strh r1, [r3, 0xE] + movs r1, 0x1 + mov r0, r10 + ands r1, r0 + movs r2, 0x1 + eors r1, r2 + lsls r0, r1, 2 + lsls r6, r0 + eors r1, r2 + lsls r1, 2 + movs r0, 0xF + lsls r0, r1 + orrs r6, r0 + lsls r6, 24 + lsrs r6, 24 + mov r1, r9 + lsls r1, 5 + mov r9, r1 + add r9, r4 + ldr r1, [sp] + add r1, r9 + ldrb r0, [r1] + ands r6, r0 + strb r6, [r1] + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BF2B8 + + thumb_func_start sub_81BF384 +sub_81BF384: @ 81BF384 + push {r4,lr} + ldr r0, =0x0000ffff + bl DisableInterrupts + movs r0, 0x1 + bl EnableInterrupts + bl SoundVSyncOff_rev01 + movs r0, 0 + bl SetVBlankCallback + bl ResetAllObjectData + bl clear_tasks + bl remove_some_task + movs r0, 0 + movs r1, 0 + bl SetGpuReg + ldr r4, =0x030012b8 + movs r0, 0x50 + bl AllocZeroed + str r0, [r4] + movs r1, 0 + strb r1, [r0] + ldr r1, [r4] + movs r0, 0x6 + strb r0, [r1, 0x1] + ldr r0, =sub_81BF3DC + bl SetMainCallback2 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BF384 + + thumb_func_start sub_81BF3DC +sub_81BF3DC: @ 81BF3DC + push {r4,r5,lr} + sub sp, 0x4 + ldr r1, =0x030012b8 + ldr r0, [r1] + ldrb r0, [r0] + adds r5, r1, 0 + cmp r0, 0x7 + bls _081BF3EE + b _081BF592 +_081BF3EE: + lsls r0, 2 + ldr r1, =_081BF400 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081BF400: + .4byte _081BF420 + .4byte _081BF430 + .4byte _081BF45C + .4byte _081BF488 + .4byte _081BF4BC + .4byte _081BF514 + .4byte _081BF552 + .4byte _081BF574 +_081BF420: + bl sub_81BF5A4 + ldr r0, =0x030012b8 + ldr r1, [r0] + movs r0, 0x1 + b _081BF590 + .pool +_081BF430: + movs r0, 0x5 + bl sub_81BF7A4 + cmp r0, 0x5 + beq _081BF43C + b _081BF592 +_081BF43C: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081BF44A + b _081BF592 +_081BF44A: + ldr r0, =0x030012b8 + ldr r1, [r0] + movs r0, 0x2 + b _081BF590 + .pool +_081BF45C: + movs r0, 0 + bl sub_81BF7A4 + cmp r0, 0 + beq _081BF468 + b _081BF592 +_081BF468: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081BF476 + b _081BF592 +_081BF476: + ldr r0, =0x030012b8 + ldr r1, [r0] + movs r0, 0x3 + b _081BF590 + .pool +_081BF488: + movs r0, 0x1 + bl sub_81BF7A4 + cmp r0, 0x1 + beq _081BF494 + b _081BF592 +_081BF494: + ldr r4, =0x030012b8 + ldr r0, [r4] + ldr r1, =gUnknown_089A6550 + str r1, [r0, 0x2C] + adds r0, 0x4F + movs r5, 0 + strb r5, [r0] + ldr r0, [r4] + adds r0, 0x4 + bl MultiBootInit + ldr r1, [r4] + strh r5, [r1, 0x2] + movs r0, 0x4 + b _081BF590 + .pool +_081BF4BC: + adds r4, r5, 0 + ldr r0, [r4] + adds r0, 0x4 + bl MultiBootMain + ldr r4, [r4] + ldrb r0, [r4, 0x1C] + cmp r0, 0 + bne _081BF4D8 + ldr r0, [r4, 0x20] + ldr r1, =0x00020200 + ands r0, r1 + cmp r0, r1 + beq _081BF4E4 +_081BF4D8: + movs r0, 0 + strh r0, [r4, 0x2] + b _081BF592 + .pool +_081BF4E4: + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xB4 + bls _081BF592 + adds r0, r4, 0x4 + ldr r1, =gMultiBootProgram_BerryGlitchFix_Start + ldr r2, =gMultiBootProgram_BerryGlitchFix_End + subs r2, r1 + movs r3, 0x1 + str r3, [sp] + movs r3, 0x4 + bl MultiBootStartMaster + ldr r1, [r5] + movs r0, 0x5 + b _081BF590 + .pool +_081BF514: + movs r0, 0x2 + bl sub_81BF7A4 + adds r4, r0, 0 + cmp r4, 0x2 + bne _081BF592 + ldr r5, =0x030012b8 + ldr r0, [r5] + adds r0, 0x4 + bl MultiBootMain + ldr r0, [r5] + adds r0, 0x4 + bl MultiBootCheckComplete + cmp r0, 0 + beq _081BF540 + ldr r1, [r5] + movs r0, 0x6 + b _081BF590 + .pool +_081BF540: + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0x22 + ldrb r0, [r0] + ands r4, r0 + cmp r4, 0 + bne _081BF592 + movs r0, 0x7 + b _081BF590 +_081BF552: + movs r0, 0x3 + bl sub_81BF7A4 + cmp r0, 0x3 + bne _081BF592 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081BF592 + bl Reset + b _081BF592 + .pool +_081BF574: + movs r0, 0x4 + bl sub_81BF7A4 + cmp r0, 0x4 + bne _081BF592 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081BF592 + ldr r0, =0x030012b8 + ldr r1, [r0] + movs r0, 0x1 +_081BF590: + strb r0, [r1] +_081BF592: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BF3DC + + thumb_func_start sub_81BF5A4 +sub_81BF5A4: @ 81BF5A4 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x10 + movs r0, 0x8 + movs r1, 0 + bl SetGpuReg + movs r0, 0xA + movs r1, 0 + bl SetGpuReg + movs r0, 0x10 + movs r1, 0 + bl SetGpuReg + movs r0, 0x12 + movs r1, 0 + bl SetGpuReg + movs r0, 0x14 + movs r1, 0 + bl SetGpuReg + movs r0, 0x16 + movs r1, 0 + bl SetGpuReg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r1, 0 + str r1, [sp, 0xC] + ldr r4, =0x040000d4 + add r0, sp, 0xC + str r0, [r4] + movs r0, 0xC0 + lsls r0, 19 + str r0, [r4, 0x4] + ldr r0, =0x85006000 + str r0, [r4, 0x8] + ldr r0, [r4, 0x8] + str r1, [sp, 0xC] + add r0, sp, 0xC + str r0, [r4] + movs r0, 0xE0 + lsls r0, 19 + str r0, [r4, 0x4] + ldr r2, =0x85000100 + str r2, [r4, 0x8] + ldr r0, [r4, 0x8] + str r1, [sp, 0xC] + add r0, sp, 0xC + str r0, [r4] + movs r0, 0xA0 + lsls r0, 19 + str r0, [r4, 0x4] + str r2, [r4, 0x8] + ldr r0, [r4, 0x8] + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_08618108 + movs r0, 0 + movs r2, 0x2 + bl InitBgsFromTemplates + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + ldr r0, =gUnknown_08618110 + bl InitWindows + bl DeactivateAllTextPrinters + ldr r0, =gUnknown_08618138 + str r0, [r4] + ldr r0, =0x050001e0 + str r0, [r4, 0x4] + ldr r0, =0x84000008 + str r0, [r4, 0x8] + ldr r0, [r4, 0x8] + movs r0, 0 + movs r1, 0x40 + bl SetGpuReg + movs r0, 0x2 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x3 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0 + movs r1, 0xAA + bl FillWindowPixelBuffer + ldr r5, =gUnknown_08617E9B + movs r0, 0 + adds r1, r5, 0 + movs r2, 0 + bl GetStringWidth + adds r1, r0, 0 + movs r4, 0x78 + subs r0, r4, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + lsls r2, r0, 24 + lsrs r2, 24 + ldr r6, =gUnknown_0861815B + str r6, [sp] + movs r0, 0x1 + negs r0, r0 + mov r8, r0 + str r0, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x2 + movs r1, 0 + movs r3, 0x3 + bl box_print + ldr r5, =gUnknown_08617E8D + movs r0, 0 + adds r1, r5, 0 + movs r2, 0 + bl GetStringWidth + adds r1, r0, 0 + subs r4, r1 + lsrs r0, r4, 31 + adds r4, r0 + asrs r4, 1 + adds r0, r4, 0 + adds r0, 0x78 + lsls r2, r0, 24 + lsrs r2, 24 + str r6, [sp] + mov r0, r8 + str r0, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x2 + movs r1, 0 + movs r3, 0x3 + bl box_print + movs r0, 0 + adds r1, r5, 0 + movs r2, 0 + bl GetStringWidth + adds r1, r0, 0 + movs r0, 0x70 + subs r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + lsls r2, r0, 24 + lsrs r2, 24 + str r6, [sp] + mov r0, r8 + str r0, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x3 + movs r1, 0 + movs r3, 0 + bl box_print + ldr r4, =gUnknown_08617E78 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0 + bl GetStringWidth + adds r1, r0, 0 + movs r0, 0xD0 + subs r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + lsls r2, r0, 24 + lsrs r2, 24 + ldr r0, =gUnknown_08618158 + str r0, [sp] + mov r0, r8 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r3, 0x2 + bl box_print + movs r0, 0x2 + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0x3 + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BF5A4 + + thumb_func_start sub_81BF7A4 +sub_81BF7A4: @ 81BF7A4 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =0x030012b8 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + cmp r0, r4 + bne _081BF7BC + adds r0, r4, 0 + b _081BF7DC + .pool +_081BF7BC: + cmp r0, 0x6 + bne _081BF7CC + adds r0, r4, 0 + bl sub_81BF7E8 + ldr r0, [r5] + strb r4, [r0, 0x1] + b _081BF7D6 +_081BF7CC: + bl sub_81BF8D8 + ldr r1, [r5] + movs r0, 0x6 + strb r0, [r1, 0x1] +_081BF7D6: + ldr r0, =0x030012b8 + ldr r0, [r0] + ldrb r0, [r0, 0x1] +_081BF7DC: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81BF7A4 + + thumb_func_start sub_81BF7E8 +sub_81BF7E8: @ 81BF7E8 + push {r4-r6,lr} + sub sp, 0xC + adds r6, r0, 0 + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0x1 + movs r1, 0xAA + bl FillWindowPixelBuffer + ldr r0, =gUnknown_08618158 + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + ldr r0, =gUnknown_08618160 + lsls r4, r6, 2 + adds r0, r4, r0 + ldr r0, [r0] + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + movs r3, 0 + bl box_print + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0x1 + movs r1, 0x2 + bl CopyWindowToVram + cmp r6, 0x5 + bhi _081BF87E + ldr r0, =_081BF850 + adds r0, r4, r0 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081BF850: + .4byte _081BF868 + .4byte _081BF870 + .4byte _081BF868 + .4byte _081BF868 + .4byte _081BF868 + .4byte _081BF878 +_081BF868: + movs r0, 0x2 + bl PutWindowTilemap + b _081BF87E +_081BF870: + movs r0, 0x3 + bl PutWindowTilemap + b _081BF87E +_081BF878: + movs r0, 0 + bl PutWindowTilemap +_081BF87E: + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldr r5, =gUnknown_08618178 + lsls r4, r6, 1 + adds r4, r6 + lsls r4, 2 + adds r0, r4, r5 + ldr r0, [r0] + ldr r1, =0x06004000 + bl LZ77UnCompVram + adds r0, r5, 0x4 + adds r0, r4, r0 + ldr r0, [r0] + ldr r1, =0x0600f800 + bl LZ77UnCompVram + adds r5, 0x8 + adds r4, r5 + ldr r0, [r4] + movs r1, 0xA0 + lsls r1, 19 + ldr r2, =0x04000040 + bl CpuSet + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BF7E8 + + thumb_func_start sub_81BF8D8 +sub_81BF8D8: @ 81BF8D8 + push {lr} + movs r0, 0 + bl HideBg + movs r0, 0x1 + bl HideBg + pop {r0} + bx r0 + thumb_func_end sub_81BF8D8 + + thumb_func_start sub_81BF8EC +sub_81BF8EC: @ 81BF8EC + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r1 + adds r5, r2, 0 + adds r6, r3, 0 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + ldr r4, =0x0203cf1c + ldr r0, =0x000040f8 + bl AllocZeroed + str r0, [r4] + ldr r1, =0x000040bc + adds r0, r1 + strb r7, [r0] + ldr r0, [r4] + mov r2, r8 + str r2, [r0] + adds r1, 0x2 + adds r0, r1 + strb r5, [r0] + ldr r0, [r4] + ldr r2, =0x000040bf + adds r0, r2 + strb r6, [r0] + ldr r1, [r4] + ldr r0, [sp, 0x18] + str r0, [r1, 0x4] + cmp r7, 0x2 + bne _081BF94C + subs r2, 0x2 + adds r1, r2 + movs r0, 0x1 + b _081BF952 + .pool +_081BF94C: + ldr r0, =0x000040bd + adds r1, r0 + movs r0, 0 +_081BF952: + strb r0, [r1] + cmp r7, 0x1 + beq _081BF9A0 + cmp r7, 0x1 + bgt _081BF96C + cmp r7, 0 + beq _081BF97C + ldr r2, =0x0203cf1c + b _081BF9EE + .pool +_081BF96C: + cmp r7, 0x2 + beq _081BF97C + cmp r7, 0x3 + beq _081BF9D0 + ldr r2, =0x0203cf1c + b _081BF9EE + .pool +_081BF97C: + ldr r2, =0x0203cf1c + ldr r0, [r2] + ldr r1, =0x000040c1 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + ldr r1, =0x000040c2 + adds r0, r1 + movs r1, 0x3 + b _081BF9EC + .pool +_081BF9A0: + ldr r2, =0x0203cf1c + ldr r0, [r2] + ldr r1, =0x000040c1 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + ldr r1, =0x000040c2 + adds r0, r1 + movs r1, 0x3 + strb r1, [r0] + ldr r0, [r2] + ldr r1, =0x000040c8 + adds r0, r1 + strb r7, [r0] + b _081BF9EE + .pool +_081BF9D0: + ldr r2, =0x0203cf1c + ldr r0, [r2] + ldr r1, =0x000040c1 + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] + ldr r0, [r2] + ldr r1, =0x000040c2 + adds r0, r1 + strb r7, [r0] + ldr r0, [r2] + adds r1, 0x1 + adds r0, r1 + movs r1, 0x1 +_081BF9EC: + strb r1, [r0] +_081BF9EE: + ldr r0, [r2] + ldr r2, =0x000040c1 + adds r1, r0, r2 + ldrb r1, [r1] + subs r2, 0x1 + adds r0, r2 + strb r1, [r0] + movs r0, 0xFF + bl sub_81C488C + ldr r0, =0x020244d4 + ldr r0, [r0] + cmp r0, 0 + bne _081BFA12 + movs r0, 0 + movs r1, 0 + bl sub_806F2AC +_081BFA12: + ldr r0, =sub_81BFAE4 + bl SetMainCallback2 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BF8EC + + thumb_func_start sub_81BFA38 +sub_81BFA38: @ 81BFA38 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + mov r8, r0 + adds r4, r1, 0 + adds r5, r2, 0 + ldr r6, [sp, 0x18] + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 16 + lsrs r6, 16 + str r3, [sp] + movs r0, 0x3 + mov r1, r8 + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_81BF8EC + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040c4 + adds r0, r1 + strh r6, [r0] + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BFA38 + + thumb_func_start sub_81BFA80 +sub_81BFA80: @ 81BFA80 + push {r4,lr} + sub sp, 0x4 + ldr r4, [sp, 0xC] + lsls r0, 24 + lsrs r0, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + str r4, [sp] + bl sub_81BF8EC + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040ef + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BFA80 + + thumb_func_start sub_81BFAB4 +sub_81BFAB4: @ 81BFAB4 + push {lr} + bl RunActiveTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl do_scheduled_bg_tilemap_copies_to_vram + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_81BFAB4 + + thumb_func_start sub_81BFAD0 +sub_81BFAD0: @ 81BFAD0 + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_81BFAD0 + + thumb_func_start sub_81BFAE4 +sub_81BFAE4: @ 81BFAE4 + push {lr} +_081BFAE6: + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081BFB0A + bl sub_81BFB10 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081BFB0A + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081BFAE6 +_081BFB0A: + pop {r0} + bx r0 + thumb_func_end sub_81BFAE4 + + thumb_func_start sub_81BFB10 +sub_81BFB10: @ 81BFB10 + push {r4,lr} + sub sp, 0x4 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x18 + bls _081BFB24 + b _081BFE00 +_081BFB24: + lsls r0, 2 + ldr r1, =_081BFB38 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081BFB38: + .4byte _081BFB9C + .4byte _081BFBAA + .4byte _081BFBBC + .4byte _081BFBD0 + .4byte _081BFBE4 + .4byte _081BFBEA + .4byte _081BFC04 + .4byte _081BFC20 + .4byte _081BFC26 + .4byte _081BFC38 + .4byte _081BFC58 + .4byte _081BFC7C + .4byte _081BFC82 + .4byte _081BFC94 + .4byte _081BFCAC + .4byte _081BFCC0 + .4byte _081BFCD8 + .4byte _081BFCF8 + .4byte _081BFD34 + .4byte _081BFD50 + .4byte _081BFD60 + .4byte _081BFD74 + .4byte _081BFD7A + .4byte _081BFDB0 + .4byte _081BFDCC +_081BFB9C: + bl SetVBlankHBlankCallbacksToNull + bl sub_8121DA0 + bl clear_scheduled_bg_copies_to_vram + b _081BFDE6 +_081BFBAA: + bl remove_some_task + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081BFDEE + .pool +_081BFBBC: + bl sub_80A1A74 + ldr r2, =0x02037fd4 + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + b _081BFDE4 + .pool +_081BFBD0: + bl ResetAllObjectData + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081BFDEE + .pool +_081BFBE4: + bl ResetObjectPaletteAllocator + b _081BFDE6 +_081BFBEA: + bl sub_81BFE24 + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040f0 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _081BFDE6 + .pool +_081BFC04: + bl sub_81BFEB0 + lsls r0, 24 + cmp r0, 0 + bne _081BFC10 + b _081BFE18 +_081BFC10: + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081BFDEE + .pool +_081BFC20: + bl sub_81C2554 + b _081BFDE6 +_081BFC26: + bl sub_81C1BA0 + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081BFDEE + .pool +_081BFC38: + ldr r4, =0x0203cf1c + ldr r0, [r4] + adds r0, 0xC + bl sub_81C0098 + ldr r0, [r4] + ldr r1, =0x000040f0 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _081BFDE6 + .pool +_081BFC58: + ldr r0, =0x0203cf1c + ldr r0, [r0] + adds r0, 0xC + bl sub_81C00F0 + lsls r0, 24 + cmp r0, 0 + bne _081BFC6A + b _081BFE18 +_081BFC6A: + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081BFDEE + .pool +_081BFC7C: + bl sub_81C25E8 + b _081BFDE6 +_081BFC82: + bl sub_81C286C + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081BFDEE + .pool +_081BFC94: + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040c0 + adds r0, r1 + ldrb r0, [r0] + bl sub_81C2D9C + b _081BFDE6 + .pool +_081BFCAC: + bl sub_81C0348 + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081BFDEE + .pool +_081BFCC0: + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040c0 + adds r0, r1 + ldrb r0, [r0] + bl sub_81C2AFC + b _081BFDE6 + .pool +_081BFCD8: + bl sub_81C4190 + bl sub_81C42C8 + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040f0 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _081BFDE6 + .pool +_081BFCF8: + ldr r4, =0x0203cf1c + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0xC + ldr r2, =0x000040f0 + adds r1, r2 + bl sub_81C45F4 + ldr r1, [r4] + ldr r2, =0x000040d3 + adds r1, r2 + strb r0, [r1] + ldr r1, [r4] + adds r2, r1, r2 + ldrb r0, [r2] + cmp r0, 0xFF + bne _081BFD1C + b _081BFE18 +_081BFD1C: + ldr r0, =0x000040f0 + adds r1, r0 + movs r0, 0 + strh r0, [r1] + b _081BFDE6 + .pool +_081BFD34: + ldr r0, =0x0203cf1c + ldr r0, [r0] + adds r0, 0xC + bl sub_81C4984 + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081BFDEE + .pool +_081BFD50: + ldr r0, =0x0203cf1c + ldr r0, [r0] + adds r0, 0xC + bl sub_81C4A08 + b _081BFDE6 + .pool +_081BFD60: + bl sub_81C4A88 + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081BFDEE + .pool +_081BFD74: + bl sub_81C4280 + b _081BFDE6 +_081BFD7A: + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040bc + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3 + beq _081BFDA0 + ldr r0, =sub_81C0510 + movs r1, 0 + bl AddTask + b _081BFDE6 + .pool +_081BFDA0: + ldr r0, =sub_81C171C + movs r1, 0 + bl AddTask + b _081BFDE6 + .pool +_081BFDB0: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081BFDEE + .pool +_081BFDCC: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 +_081BFDE4: + strb r0, [r2, 0x8] +_081BFDE6: + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 +_081BFDEE: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _081BFE18 + .pool +_081BFE00: + ldr r0, =sub_81BFAD0 + bl SetVBlankCallback + ldr r0, =sub_81BFAB4 + bl SetMainCallback2 + movs r0, 0x1 + b _081BFE1A + .pool +_081BFE18: + movs r0, 0 +_081BFE1A: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81BFB10 + + thumb_func_start sub_81BFE24 +sub_81BFE24: @ 81BFE24 + push {r4,lr} + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0861CBB4 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + ldr r4, =0x0203cf1c + ldr r1, [r4] + ldr r0, =0x000020bc + adds r1, r0 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x000010bc + adds r1, r0 + movs r0, 0x2 + bl SetBgTilemapBuffer + ldr r1, [r4] + adds r1, 0xBC + movs r0, 0x3 + bl SetBgTilemapBuffer + bl sub_8121E10 + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x3 + bl schedule_bg_copy_tilemap_to_vram + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BFE24 + + thumb_func_start sub_81BFEB0 +sub_81BFEB0: @ 81BFEB0 + push {r4,lr} + sub sp, 0x4 + ldr r1, =0x0203cf1c + ldr r0, [r1] + ldr r2, =0x000040f0 + adds r0, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + adds r4, r1, 0 + cmp r0, 0xC + bls _081BFEC8 + b _081C008C +_081BFEC8: + lsls r0, 2 + ldr r1, =_081BFEE0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081BFEE0: + .4byte _081BFF14 + .4byte _081BFF30 + .4byte _081BFF60 + .4byte _081BFF78 + .4byte _081BFF90 + .4byte _081BFFA8 + .4byte _081BFFC0 + .4byte _081BFFF0 + .4byte _081BFFFC + .4byte _081C0018 + .4byte _081C0024 + .4byte _081C0040 + .4byte _081C0064 +_081BFF14: + bl reset_temp_tile_data_buffers + ldr r1, =gUnknown_08D97D0C + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + b _081C0046 + .pool +_081BFF30: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081BFF3E + b _081C008C +_081BFF3E: + ldr r0, =gUnknown_08D9862C + ldr r4, =0x0203cf1c + ldr r1, [r4] + adds r1, 0xBC + bl LZDecompressWram + ldr r1, [r4] + ldr r2, =0x000040f0 + adds r1, r2 + b _081C004E + .pool +_081BFF60: + ldr r0, =gUnknown_08D98CC8 + ldr r1, [r4] + ldr r2, =0x000008bc + adds r1, r2 + bl LZDecompressWram + ldr r1, [r4] + b _081C004A + .pool +_081BFF78: + ldr r0, =gUnknown_08D987FC + ldr r1, [r4] + ldr r2, =0x000018bc + adds r1, r2 + bl LZDecompressWram + ldr r1, [r4] + b _081C004A + .pool +_081BFF90: + ldr r0, =gUnknown_08D9898C + ldr r1, [r4] + ldr r2, =0x000028bc + adds r1, r2 + bl LZDecompressWram + ldr r1, [r4] + b _081C004A + .pool +_081BFFA8: + ldr r0, =gUnknown_08D98B28 + ldr r1, [r4] + ldr r2, =0x000038bc + adds r1, r2 + bl LZDecompressWram + ldr r1, [r4] + b _081C004A + .pool +_081BFFC0: + ldr r0, =gUnknown_08D9853C + movs r2, 0x80 + lsls r2, 1 + movs r1, 0 + bl decompress_palette + ldr r0, =gUnknown_08D85620 + movs r1, 0x81 + movs r2, 0x1E + bl gpu_pal_apply + ldr r0, =0x0203cf1c + ldr r1, [r0] + ldr r2, =0x000040f0 + adds r1, r2 + b _081C004E + .pool +_081BFFF0: + ldr r0, =gUnknown_0861CFBC + bl LoadCompressedObjectPic + b _081C0046 + .pool +_081BFFFC: + ldr r0, =gUnknown_0861D074 + bl LoadCompressedObjectPic + ldr r0, =0x0203cf1c + ldr r1, [r0] + ldr r2, =0x000040f0 + adds r1, r2 + b _081C004E + .pool +_081C0018: + ldr r0, =gUnknown_0861D0F8 + bl LoadCompressedObjectPic + b _081C0046 + .pool +_081C0024: + ldr r0, =gUnknown_0861D100 + bl LoadCompressedObjectPalette + ldr r0, =0x0203cf1c + ldr r1, [r0] + ldr r2, =0x000040f0 + adds r1, r2 + b _081C004E + .pool +_081C0040: + ldr r0, =gUnknown_0861D07C + bl LoadCompressedObjectPalette +_081C0046: + ldr r0, =0x0203cf1c + ldr r1, [r0] +_081C004A: + ldr r0, =0x000040f0 + adds r1, r0 +_081C004E: + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _081C008C + .pool +_081C0064: + ldr r0, =gUnknown_08D97B84 + movs r1, 0xE8 + lsls r1, 1 + movs r2, 0x60 + bl decompress_palette + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040f0 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + movs r0, 0x1 + b _081C008E + .pool +_081C008C: + movs r0, 0 +_081C008E: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81BFEB0 + + thumb_func_start sub_81C0098 +sub_81C0098: @ 81C0098 + push {r4,lr} + adds r3, r0, 0 + ldr r0, =0x0203cf1c + ldr r1, [r0] + ldr r2, =0x000040bd + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _081C00D0 + ldr r2, [r1] + ldr r4, =0x000040be + adds r0, r1, r4 + ldrb r1, [r0] + movs r0, 0x64 + muls r1, r0 + adds r1, r2 + adds r0, r3, 0 + movs r2, 0x64 + bl memcpy + b _081C00E6 + .pool +_081C00D0: + ldr r0, [r1] + ldr r2, =0x000040be + adds r1, r2 + ldrb r2, [r1] + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 4 + adds r0, r1 + adds r1, r3, 0 + bl sub_8069004 +_081C00E6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C0098 + + thumb_func_start sub_81C00F0 +sub_81C00F0: @ 81C00F0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r5, r0, 0 + ldr r0, =0x0203cf1c + ldr r7, [r0] + adds r6, r7, 0 + adds r6, 0x70 + ldr r1, =0x000040f0 + adds r0, r7, r1 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0x1 + beq _081C0198 + cmp r0, 0x1 + bgt _081C0120 + cmp r0, 0 + beq _081C012C + b _081C0314 + .pool +_081C0120: + cmp r0, 0x2 + beq _081C01DC + cmp r0, 0x3 + bne _081C012A + b _081C02A8 +_081C012A: + b _081C0314 +_081C012C: + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + strh r0, [r6] + adds r0, r5, 0 + movs r1, 0x41 + bl pokemon_getattr + strh r0, [r6, 0x2] + adds r0, r5, 0 + movs r1, 0x19 + bl pokemon_getattr + str r0, [r6, 0x10] + adds r0, r5, 0 + movs r1, 0x38 + bl pokemon_getattr + strb r0, [r6, 0x5] + adds r0, r5, 0 + movs r1, 0x2E + bl pokemon_getattr + strb r0, [r6, 0x8] + adds r0, r5, 0 + movs r1, 0xC + bl pokemon_getattr + strh r0, [r6, 0x2E] + adds r0, r5, 0 + movs r1, 0 + bl pokemon_getattr + str r0, [r6, 0xC] + adds r0, r5, 0 + movs r1, 0x4 + bl pokemon_getattr + adds r1, r7, 0 + adds r1, 0xA5 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + beq _081C018C + movs r0, 0x1 + strb r0, [r6, 0x4] + b _081C0322 +_081C018C: + adds r0, r5, 0 + movs r1, 0x2D + bl pokemon_getattr + strb r0, [r6, 0x4] + b _081C0322 +_081C0198: + movs r4, 0 + movs r0, 0x8C + adds r0, r7 + mov r8, r0 + movs r1, 0xA4 + adds r1, r7 + mov r9, r1 + adds r6, r7, 0 + adds r6, 0x84 +_081C01AA: + adds r1, r4, 0 + adds r1, 0xD + adds r0, r5, 0 + bl pokemon_getattr + strh r0, [r6] + adds r1, r4, 0 + adds r1, 0x11 + adds r0, r5, 0 + bl pokemon_getattr + mov r2, r8 + adds r1, r2, r4 + strb r0, [r1] + adds r6, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + bls _081C01AA + adds r0, r5, 0 + movs r1, 0x15 + bl pokemon_getattr + mov r1, r9 + strb r0, [r1] + b _081C0322 +_081C01DC: + ldr r1, [r7] + ldr r0, =0x020244ec + cmp r1, r0 + beq _081C01F8 + ldr r2, =0x000040bc + adds r0, r7, r2 + ldrb r0, [r0] + cmp r0, 0x2 + beq _081C01F8 + ldr r1, =0x000040ef + adds r0, r7, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081C0254 +_081C01F8: + adds r0, r5, 0 + bl GetNature + adds r1, r6, 0 + adds r1, 0x33 + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + strh r0, [r6, 0x20] + adds r0, r5, 0 + movs r1, 0x3A + bl pokemon_getattr + strh r0, [r6, 0x22] + adds r0, r5, 0 + movs r1, 0x3B + bl pokemon_getattr + strh r0, [r6, 0x24] + adds r0, r5, 0 + movs r1, 0x3C + bl pokemon_getattr + strh r0, [r6, 0x26] + adds r0, r5, 0 + movs r1, 0x3E + bl pokemon_getattr + strh r0, [r6, 0x28] + adds r0, r5, 0 + movs r1, 0x3F + bl pokemon_getattr + strh r0, [r6, 0x2A] + adds r0, r5, 0 + movs r1, 0x3D + b _081C02A0 + .pool +_081C0254: + adds r0, r5, 0 + bl GetNature + adds r1, r7, 0 + adds r1, 0xA3 + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + strh r0, [r6, 0x20] + adds r0, r5, 0 + movs r1, 0x3A + bl pokemon_getattr + strh r0, [r6, 0x22] + adds r0, r5, 0 + movs r1, 0x54 + bl pokemon_getattr + strh r0, [r6, 0x24] + adds r0, r5, 0 + movs r1, 0x55 + bl pokemon_getattr + strh r0, [r6, 0x26] + adds r0, r5, 0 + movs r1, 0x57 + bl pokemon_getattr + strh r0, [r6, 0x28] + adds r0, r5, 0 + movs r1, 0x58 + bl pokemon_getattr + strh r0, [r6, 0x2A] + adds r0, r5, 0 + movs r1, 0x56 +_081C02A0: + bl pokemon_getattr + strh r0, [r6, 0x2C] + b _081C0322 +_081C02A8: + adds r4, r7, 0 + adds r4, 0xA6 + adds r0, r5, 0 + movs r1, 0x7 + adds r2, r4, 0 + bl pokemon_getattr + adds r0, r5, 0 + movs r1, 0x3 + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StopMusicWhileStringIsPrinted + adds r0, r5, 0 + bl sub_81B205C + strb r0, [r6, 0x7] + adds r0, r5, 0 + movs r1, 0x31 + bl pokemon_getattr + adds r1, r7, 0 + adds r1, 0xA2 + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0x1 + bl pokemon_getattr + str r0, [r6, 0x48] + adds r0, r5, 0 + movs r1, 0x23 + bl pokemon_getattr + strb r0, [r6, 0x9] + adds r0, r5, 0 + movs r1, 0x24 + bl pokemon_getattr + strb r0, [r6, 0xA] + adds r0, r5, 0 + movs r1, 0x25 + bl pokemon_getattr + strb r0, [r6, 0xB] + adds r0, r5, 0 + movs r1, 0x20 + bl pokemon_getattr + strh r0, [r6, 0x30] + b _081C0322 +_081C0314: + adds r0, r5, 0 + movs r1, 0x52 + bl pokemon_getattr + strb r0, [r6, 0x6] + movs r0, 0x1 + b _081C0332 +_081C0322: + ldr r0, =0x0203cf1c + ldr r1, [r0] + ldr r2, =0x000040f0 + adds r1, r2 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + movs r0, 0 +_081C0332: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81C00F0 + + thumb_func_start sub_81C0348 +sub_81C0348: @ 81C0348 + push {r4-r6,lr} + ldr r6, =0x0203cf1c + ldr r2, [r6] + ldr r1, =0x000040c0 + adds r0, r2, r1 + ldrb r0, [r0] + subs r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _081C037C + movs r0, 0 + movs r1, 0xFF + bl sub_81C1DA4 + movs r0, 0 + movs r1, 0xFF + movs r2, 0 + bl sub_81C1EFC + b _081C03D8 + .pool +_081C037C: + ldr r1, =0x000040c6 + adds r0, r2, r1 + ldrb r1, [r0] + lsls r1, 1 + adds r0, r2, 0 + adds r0, 0x84 + adds r0, r1 + ldrh r0, [r0] + bl sub_81C240C + ldr r0, [r6] + ldr r5, =0x000020bc + adds r0, r5 + movs r1, 0x3 + movs r2, 0 + bl sub_81C2194 + ldr r0, [r6] + ldr r4, =0x000030bc + adds r0, r4 + movs r1, 0x1 + movs r2, 0 + bl sub_81C2194 + ldr r1, [r6] + adds r1, r4 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, [r6] + adds r1, r5 + movs r0, 0x2 + bl SetBgTilemapBuffer + movs r1, 0x80 + lsls r1, 9 + movs r0, 0x2 + movs r2, 0x1 + bl ChangeBgX + movs r0, 0x13 + bl ClearWindowTilemap + movs r0, 0xD + bl ClearWindowTilemap +_081C03D8: + ldr r0, =0x0203cf1c + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x77 + ldrb r0, [r0] + cmp r0, 0 + bne _081C0400 + movs r0, 0 + movs r1, 0xFF + bl sub_81C2074 + b _081C0416 + .pool +_081C0400: + ldr r2, =0x000040c0 + adds r0, r1, r2 + ldrb r0, [r0] + subs r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _081C0416 + movs r0, 0xD + bl PutWindowTilemap +_081C0416: + bl sub_81C2524 + ldr r0, =0x0203cf1c + ldr r0, [r0] + adds r0, 0xC + bl sub_81C2228 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C0348 + + thumb_func_start sub_81C0434 +sub_81C0434: @ 81C0434 + push {lr} + bl FreeAllWindowBuffers + ldr r0, =0x0203cf1c + ldr r0, [r0] + bl Free + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C0434 + + thumb_func_start sub_81C044C +sub_81C044C: @ 81C044C + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81C0484 + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C044C + + thumb_func_start sub_81C0484 +sub_81C0484: @ 81C0484 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C04EC + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081C04EC + ldr r4, =0x0203cf1c + ldr r0, [r4] + ldr r0, [r0, 0x4] + bl SetMainCallback2 + ldr r1, =0x0203cf20 + ldr r0, [r4] + ldr r2, =0x000040be + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + bl sub_81C4898 + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + bl sub_80A369C + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl + ldr r0, =0x020244d4 + ldr r0, [r0] + cmp r0, 0 + bne _081C04E2 + movs r0, 0 + bl sub_806F47C +_081C04E2: + bl sub_81C0434 + adds r0, r5, 0 + bl remove_task +_081C04EC: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C0484 + + thumb_func_start sub_81C0510 +sub_81C0510: @ 81C0510 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C05FE + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r2, 0x80 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _081C05FE + ldr r5, =0x030022c0 + ldrh r1, [r5, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081C0550 + movs r1, 0x1 + negs r1, r1 + adds r0, r4, 0 + bl sub_81C0604 + b _081C05FE + .pool +_081C0550: + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _081C0562 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81C0604 + b _081C05FE +_081C0562: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _081C0576 + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C0582 +_081C0576: + movs r1, 0x1 + negs r1, r1 + adds r0, r4, 0 + bl sub_81C0A8C + b _081C05FE +_081C0582: + ldrh r1, [r5, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _081C0598 + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _081C05A2 +_081C0598: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81C0A8C + b _081C05FE +_081C05A2: + ldrh r1, [r5, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081C05E6 + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040c0 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _081C05FE + cmp r0, 0 + bne _081C05D8 + bl sub_81C48F0 + movs r0, 0x5 + bl audio_play + adds r0, r4, 0 + bl sub_81C044C + b _081C05FE + .pool +_081C05D8: + movs r0, 0x5 + bl audio_play + adds r0, r4, 0 + bl sub_81C0E48 + b _081C05FE +_081C05E6: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081C05FE + bl sub_81C48F0 + movs r0, 0x5 + bl audio_play + adds r0, r4, 0 + bl sub_81C044C +_081C05FE: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81C0510 + + thumb_func_start sub_81C0604 +sub_81C0604: @ 81C0604 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + adds r4, r5, 0 + ldr r1, =0x0203cf1c + ldr r3, [r1] + ldr r2, =0x000040c3 + adds r0, r3, r2 + ldrb r0, [r0] + adds r6, r1, 0 + cmp r0, 0 + bne _081C06EE + ldr r1, =0x000040bd + adds r0, r3, r1 + ldrb r2, [r0] + cmp r2, 0x1 + bne _081C0678 + adds r1, 0x3 + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _081C0654 + lsls r1, r5, 24 + asrs r1, 24 + movs r4, 0x2 + eors r1, r2 + negs r0, r1 + orrs r0, r1 + asrs r0, 31 + ands r4, r0 + b _081C065C + .pool +_081C0654: + movs r4, 0x3 + cmp r5, 0x1 + bne _081C065C + movs r4, 0x1 +_081C065C: + ldr r2, [r6] + ldr r0, [r2] + ldr r3, =0x000040be + adds r1, r2, r3 + ldrb r1, [r1] + adds r3, 0x1 + adds r2, r3 + ldrb r2, [r2] + adds r3, r4, 0 + bl sub_80D214C + b _081C0696 + .pool +_081C0678: + bl sub_81B1250 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C068E + lsls r0, r5, 24 + asrs r0, 24 + bl sub_81C09B4 + b _081C0696 +_081C068E: + lsls r0, r4, 24 + asrs r0, 24 + bl sub_81C08F8 +_081C0696: + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _081C06EE + movs r0, 0x5 + bl audio_play + ldr r5, =0x0203cf1c + ldr r0, [r5] + adds r0, 0x77 + ldrb r0, [r0] + cmp r0, 0 + beq _081C06D4 + movs r0, 0x2 + movs r1, 0x1 + bl sub_81C4204 + movs r0, 0xD + bl ClearWindowTilemap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0 + movs r1, 0x2 + bl sub_81C2074 +_081C06D4: + ldr r0, [r5] + ldr r1, =0x000040be + adds r0, r1 + movs r2, 0 + strb r4, [r0] + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + strh r2, [r0, 0x8] + ldr r1, =sub_81C0704 + str r1, [r0] +_081C06EE: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C0604 + + thumb_func_start sub_81C0704 +sub_81C0704: @ 81C0704 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r4, r1, 3 + ldr r6, =0x03005e08 + adds r5, r4, r6 + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0xC + bls _081C071E + b _081C08BC +_081C071E: + lsls r0, 2 + ldr r1, =_081C0730 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081C0730: + .4byte _081C0764 + .4byte _081C076A + .4byte _081C0780 + .4byte _081C07A8 + .4byte _081C07C8 + .4byte _081C07E0 + .4byte _081C07F0 + .4byte _081C0800 + .4byte _081C0828 + .4byte _081C086C + .4byte _081C0872 + .4byte _081C0878 + .4byte _081C0894 +_081C0764: + bl sub_80A369C + b _081C08EC +_081C076A: + bl sub_81C4898 + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040d3 + b _081C0786 + .pool +_081C0780: + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040d4 +_081C0786: + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeResources + b _081C08EC + .pool +_081C07A8: + ldr r4, =0x0203cf1c + ldr r0, [r4] + adds r0, 0xC + bl sub_81C0098 + ldr r0, [r4] + ldr r1, =0x000040f0 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _081C08EC + .pool +_081C07C8: + ldr r0, =0x0203cf1c + ldr r0, [r0] + adds r0, 0xC + bl sub_81C00F0 + lsls r0, 24 + cmp r0, 0 + bne _081C07DA + b _081C08F2 +_081C07DA: + b _081C08EC + .pool +_081C07E0: + ldr r0, =0x0203cf1c + ldr r0, [r0] + adds r0, 0xC + bl sub_81C49E0 + b _081C08EC + .pool +_081C07F0: + ldr r0, =0x0203cf1c + ldr r0, [r0] + adds r0, 0xC + bl sub_81C4A08 + b _081C08EC + .pool +_081C0800: + ldr r4, =0x0203cf1c + ldr r0, [r4] + adds r0, 0x77 + ldrb r0, [r0] + cmp r0, 0 + beq _081C0816 + movs r1, 0x2 + negs r1, r1 + movs r0, 0xA + bl sub_81C2074 +_081C0816: + ldr r0, [r4] + adds r0, 0xC + bl sub_81C2228 + movs r0, 0 + strh r0, [r5, 0x2] + b _081C08EC + .pool +_081C0828: + ldr r4, =0x0203cf1c + ldr r0, [r4] + adds r0, 0xC + adds r1, r5, 0x2 + bl sub_81C45F4 + ldr r1, [r4] + ldr r2, =0x000040d3 + adds r1, r2 + strb r0, [r1] + ldr r0, [r4] + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _081C08F2 + ldr r2, =0x02020630 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x1 + strh r1, [r0, 0x32] + bl sub_81C0E24 + movs r0, 0 + strh r0, [r5, 0x2] + b _081C08EC + .pool +_081C086C: + bl sub_81C4280 + b _081C08EC +_081C0872: + bl sub_81C25E8 + b _081C08EC +_081C0878: + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040c0 + adds r0, r1 + ldrb r0, [r0] + bl sub_81C2D9C + bl sub_81C2524 + b _081C08EC + .pool +_081C0894: + ldr r2, =0x02020630 + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040d3 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strh r1, [r0, 0x32] + b _081C08EC + .pool +_081C08BC: + bl sub_81221EC + lsls r0, 24 + cmp r0, 0 + bne _081C08F2 + ldr r0, =sub_81C20F0 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _081C08F2 + strh r0, [r5] + adds r0, r6, 0 + subs r0, 0x8 + adds r0, r4, r0 + ldr r1, =sub_81C0510 + str r1, [r0] + b _081C08F2 + .pool +_081C08EC: + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] +_081C08F2: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81C0704 + + thumb_func_start sub_81C08F8 +sub_81C08F8: @ 81C08F8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x0203cf1c + ldr r2, [r1] + ldr r7, [r2] + ldr r3, =0x000040c0 + adds r0, r2, r3 + ldrb r0, [r0] + adds r5, r1, 0 + cmp r0, 0 + bne _081C0960 + lsls r0, r4, 24 + asrs r3, r0, 24 + movs r1, 0x1 + negs r1, r1 + adds r6, r0, 0 + cmp r3, r1 + bne _081C0928 + ldr r1, =0x000040be + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _081C0988 +_081C0928: + asrs r0, r6, 24 + cmp r0, 0x1 + bne _081C0940 + ldr r0, [r5] + ldr r2, =0x000040be + adds r1, r0, r2 + ldr r3, =0x000040bf + adds r0, r3 + ldrb r1, [r1] + ldrb r0, [r0] + cmp r1, r0 + bcs _081C0988 +_081C0940: + ldr r0, [r5] + ldr r1, =0x000040be + adds r0, r1 + ldrb r0, [r0] + adds r0, r4 + lsls r0, 24 + asrs r0, 24 + b _081C09AE + .pool +_081C0960: + ldr r3, =0x000040be + adds r0, r2, r3 + ldrb r5, [r0] + lsls r6, r4, 24 +_081C0968: + lsls r0, r5, 24 + asrs r0, 24 + asrs r1, r6, 24 + adds r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + asrs r4, r0, 24 + cmp r4, 0 + blt _081C0988 + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040bf + adds r0, r1 + ldrb r0, [r0] + cmp r4, r0 + ble _081C099C +_081C0988: + movs r0, 0x1 + negs r0, r0 + b _081C09AE + .pool +_081C099C: + movs r0, 0x64 + muls r0, r4 + adds r0, r7, r0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _081C0968 + adds r0, r4, 0 +_081C09AE: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81C08F8 + + thumb_func_start sub_81C09B4 +sub_81C09B4: @ 81C09B4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r12, r0 + ldr r6, =0x0203cf1c + ldr r0, [r6] + ldr r1, [r0] + mov r8, r1 + movs r5, 0 + movs r2, 0 + ldr r3, =gUnknown_0861CC1C + movs r1, 0 + ldrsb r1, [r3, r1] + ldr r4, =0x000040be + adds r0, r4 + ldrb r0, [r0] + cmp r1, r0 + beq _081C09FC + adds r7, r3, 0 + adds r3, r4, 0 +_081C09E0: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bhi _081C09FC + adds r0, r2, r7 + movs r1, 0 + ldrsb r1, [r0, r1] + ldr r0, [r6] + adds r0, r3 + ldrb r0, [r0] + cmp r1, r0 + bne _081C09E0 + adds r5, r2, 0 +_081C09FC: + mov r0, r12 + lsls r6, r0, 24 + ldr r7, =gUnknown_0861CC1C +_081C0A02: + lsls r0, r5, 24 + asrs r0, 24 + asrs r1, r6, 24 + adds r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, r5, 24 + lsrs r0, r1, 24 + cmp r0, 0x5 + bhi _081C0A40 + asrs r0, r1, 24 + adds r0, r7 + movs r4, 0 + ldrsb r4, [r0, r4] + movs r0, 0x64 + muls r0, r4 + add r0, r8 + bl sub_81C0A50 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C0A02 + adds r0, r4, 0 + b _081C0A44 + .pool +_081C0A40: + movs r0, 0x1 + negs r0, r0 +_081C0A44: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81C09B4 + + thumb_func_start sub_81C0A50 +sub_81C0A50: @ 81C0A50 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _081C0A84 + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040be + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _081C0A78 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _081C0A84 +_081C0A78: + movs r0, 0x1 + b _081C0A86 + .pool +_081C0A84: + movs r0, 0 +_081C0A86: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81C0A50 + + thumb_func_start sub_81C0A8C +sub_81C0A8C: @ 81C0A8C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 24 + lsrs r6, r0, 24 + str r6, [sp] + lsls r1, 24 + lsrs r3, r1, 24 + str r3, [sp, 0x4] + ldr r0, =0x0203cf1c + mov r8, r0 + ldr r2, [r0] + adds r1, r2, 0 + adds r1, 0x70 + lsls r0, r6, 2 + adds r0, r6 + lsls r7, r0, 3 + ldr r0, =0x03005e08 + mov r9, r0 + adds r0, r7, r0 + str r0, [sp, 0x8] + ldrb r1, [r1, 0x4] + mov r10, r1 + cmp r1, 0 + bne _081C0B6E + lsls r0, r3, 24 + asrs r5, r0, 24 + movs r0, 0x1 + negs r0, r0 + cmp r5, r0 + bne _081C0AE0 + ldr r1, =0x000040c0 + adds r0, r2, r1 + ldr r3, =0x000040c1 + adds r1, r2, r3 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + beq _081C0B6E +_081C0AE0: + cmp r5, 0x1 + bne _081C0AF4 + ldr r1, =0x000040c0 + adds r0, r2, r1 + ldr r3, =0x000040c2 + adds r1, r2, r3 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + beq _081C0B6E +_081C0AF4: + movs r0, 0x5 + bl audio_play + mov r1, r8 + ldr r0, [r1] + ldr r4, =0x000040c0 + adds r0, r4 + ldrb r0, [r0] + bl sub_81C2C38 + mov r2, r8 + ldr r1, [r2] + adds r1, r4 + ldrb r0, [r1] + ldr r3, [sp, 0x4] + adds r0, r3 + strb r0, [r1] + mov r1, r10 + ldr r0, [sp, 0x8] + strh r1, [r0] + cmp r5, 0x1 + bne _081C0B4C + ldr r1, =sub_81C0B8C + mov r0, r9 + subs r0, 0x8 + adds r0, r7, r0 + ldr r2, [r0] + adds r0, r6, 0 + bl set_task_function_and_args_14_15 + b _081C0B5C + .pool +_081C0B4C: + ldr r1, =sub_81C0CC4 + mov r0, r9 + subs r0, 0x8 + adds r0, r7, r0 + ldr r2, [r0] + ldr r0, [sp] + bl set_task_function_and_args_14_15 +_081C0B5C: + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r2, =0x000040c0 + adds r0, r2 + ldrb r0, [r0] + bl sub_81C2DE4 + bl sub_81C424C +_081C0B6E: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C0A8C + + thumb_func_start sub_81C0B8C +sub_81C0B8C: @ 81C0B8C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081C0C2A + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r3, =0x000040c9 + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _081C0BE0 + movs r0, 0x1 + strh r0, [r4, 0x2] + movs r0, 0x1 + movs r1, 0x7 + movs r2, 0x1 + bl SetBgAttribute + movs r0, 0x2 + movs r1, 0x7 + movs r2, 0x2 + bl SetBgAttribute + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + b _081C0BFE + .pool +_081C0BE0: + movs r0, 0x2 + strh r0, [r4, 0x2] + movs r0, 0x2 + movs r1, 0x7 + movs r2, 0x1 + bl SetBgAttribute + movs r0, 0x1 + movs r1, 0x7 + movs r2, 0x2 + bl SetBgAttribute + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram +_081C0BFE: + ldrb r0, [r4, 0x2] + movs r1, 0 + movs r2, 0 + bl ChangeBgX + ldrb r0, [r4, 0x2] + ldr r1, =0x0203cf1c + ldr r1, [r1] + ldr r3, =0x000040c0 + adds r2, r1, r3 + ldrb r2, [r2] + lsls r2, 12 + adds r2, 0xBC + adds r1, r2 + bl SetBgTilemapBuffer + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg +_081C0C2A: + ldrb r0, [r4, 0x2] + movs r1, 0x80 + lsls r1, 6 + movs r2, 0x1 + bl ChangeBgX + ldrh r0, [r4] + adds r0, 0x20 + strh r0, [r4] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _081C0C52 + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81C0C68 + str r0, [r1] +_081C0C52: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C0B8C + + thumb_func_start sub_81C0C68 +sub_81C0C68: @ 81C0C68 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r2, r4, 2 + adds r2, r4 + lsls r2, 3 + ldr r0, =0x03005e08 + adds r2, r0 + ldr r5, =0x0203cf1c + ldr r3, [r5] + ldr r0, =0x000040c9 + adds r3, r0 + ldrb r0, [r3] + movs r1, 0x1 + eors r0, r1 + movs r1, 0 + strb r0, [r3] + strh r1, [r2, 0x2] + strh r1, [r2] + bl sub_81C1BA0 + ldr r0, [r5] + ldr r1, =0x000040c0 + adds r0, r1 + ldrb r0, [r0] + bl sub_81C2AFC + bl sub_81C4280 + bl sub_81C0E24 + adds r0, r4, 0 + bl set_task_function_to_args_14_15 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C0C68 + + thumb_func_start sub_81C0CC4 +sub_81C0CC4: @ 81C0CC4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081C0D0C + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040c9 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _081C0CFC + movs r0, 0x2 + b _081C0CFE + .pool +_081C0CFC: + movs r0, 0x1 +_081C0CFE: + strh r0, [r4, 0x2] + ldrb r0, [r4, 0x2] + movs r1, 0x80 + lsls r1, 9 + movs r2, 0 + bl ChangeBgX +_081C0D0C: + ldrb r0, [r4, 0x2] + movs r1, 0x80 + lsls r1, 6 + movs r2, 0x2 + bl ChangeBgX + ldrh r0, [r4] + adds r0, 0x20 + strh r0, [r4] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _081C0D34 + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81C0D44 + str r0, [r1] +_081C0D34: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C0CC4 + + thumb_func_start sub_81C0D44 +sub_81C0D44: @ 81C0D44 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040c9 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _081C0D8C + movs r0, 0x1 + movs r1, 0x7 + movs r2, 0x1 + bl SetBgAttribute + movs r0, 0x2 + movs r1, 0x7 + movs r2, 0x2 + bl SetBgAttribute + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + b _081C0DA6 + .pool +_081C0D8C: + movs r0, 0x2 + movs r1, 0x7 + movs r2, 0x1 + bl SetBgAttribute + movs r0, 0x1 + movs r1, 0x7 + movs r2, 0x2 + bl SetBgAttribute + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram +_081C0DA6: + ldr r6, =0x0203cf1c + ldr r2, [r6] + ldr r7, =0x000040c0 + adds r1, r2, r7 + ldrb r0, [r1] + cmp r0, 0x1 + bls _081C0DD0 + ldrb r0, [r4, 0x2] + ldrb r1, [r1] + lsls r1, 12 + ldr r3, =0xfffff0bc + adds r1, r3 + adds r1, r2, r1 + bl SetBgTilemapBuffer + ldrb r0, [r4, 0x2] + movs r1, 0x80 + lsls r1, 9 + movs r2, 0 + bl ChangeBgX +_081C0DD0: + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + ldr r2, [r6] + ldr r0, =0x000040c9 + adds r2, r0 + ldrb r0, [r2] + movs r1, 0x1 + eors r0, r1 + movs r1, 0 + strb r0, [r2] + strh r1, [r4, 0x2] + strh r1, [r4] + bl sub_81C1BA0 + ldr r0, [r6] + adds r0, r7 + ldrb r0, [r0] + bl sub_81C2AFC + bl sub_81C4280 + bl sub_81C0E24 + adds r0, r5, 0 + bl set_task_function_to_args_14_15 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C0D44 + + thumb_func_start sub_81C0E24 +sub_81C0E24: @ 81C0E24 + push {lr} + ldr r0, =0x0203cf1c + ldr r1, [r0] + ldr r2, =0x000040c0 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081C0E3C + adds r0, r1, 0 + adds r0, 0xC + bl sub_81C22CC +_081C0E3C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C0E24 + + thumb_func_start sub_81C0E48 +sub_81C0E48: @ 81C0E48 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r5, =0x0203cf1c + ldr r0, [r5] + ldr r2, =0x000040c6 + adds r0, r2 + movs r1, 0 + strb r1, [r0] + ldr r1, [r5] + adds r2, r1, r2 + ldrb r0, [r2] + lsls r0, 1 + adds r1, 0x84 + adds r1, r0 + ldrh r6, [r1] + mov r8, r6 + movs r0, 0x13 + bl ClearWindowTilemap + ldr r2, =0x02020630 + ldr r0, [r5] + ldr r1, =0x000040d5 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _081C0E96 + movs r0, 0xD + bl ClearWindowTilemap +_081C0E96: + movs r4, 0x3 + negs r4, r4 + movs r0, 0x9 + adds r1, r4, 0 + bl sub_81C1DA4 + movs r0, 0x9 + adds r1, r4, 0 + adds r2, r6, 0 + bl sub_81C1EFC + ldr r0, [r5] + ldr r1, =0x000040c8 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _081C0EC4 + movs r0, 0x5 + bl ClearWindowTilemap + movs r0, 0x6 + bl PutWindowTilemap +_081C0EC4: + ldr r0, [r5] + ldr r1, =0x000020bc + adds r0, r1 + movs r1, 0x3 + movs r2, 0 + bl sub_81C2194 + ldr r0, [r5] + ldr r1, =0x000030bc + adds r0, r1 + movs r1, 0x1 + movs r2, 0 + bl sub_81C2194 + mov r0, r8 + bl sub_81C3E9C + bl sub_81C3F44 + bl sub_81C44F0 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x8 + bl sub_81C4AF8 + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81C0F44 + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C0E48 + + thumb_func_start sub_81C0F44 +sub_81C0F44: @ 81C0F44 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C103A + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081C0F98 + movs r0, 0x4 + strh r0, [r4] + movs r1, 0x1 + negs r1, r1 + ldr r0, =0x0203cf1c + ldr r2, [r0] + ldr r0, =0x000040c6 + adds r2, r0 + adds r0, r4, 0 + bl sub_81C1070 + b _081C103A + .pool +_081C0F98: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081C0FC0 + movs r0, 0x4 + strh r0, [r4] + ldr r0, =0x0203cf1c + ldr r2, [r0] + ldr r0, =0x000040c6 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81C1070 + b _081C103A + .pool +_081C0FC0: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081C1026 + ldr r0, =0x0203cf1c + ldr r1, [r0] + ldr r2, =0x000040c8 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x1 + beq _081C0FE8 + subs r2, 0x4 + adds r0, r1, r2 + ldr r0, [r0] + ldr r1, =0x00ffffff + ands r0, r1 + movs r1, 0x80 + lsls r1, 11 + cmp r0, r1 + bne _081C1004 +_081C0FE8: + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_81C11F4 + b _081C103A + .pool +_081C1004: + bl sub_81C1040 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C101E + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_81C129C + b _081C103A +_081C101E: + movs r0, 0x20 + bl audio_play + b _081C103A +_081C1026: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081C103A + movs r0, 0x5 + bl audio_play + adds r0, r6, 0 + bl sub_81C11F4 +_081C103A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81C0F44 + + thumb_func_start sub_81C1040 +sub_81C1040: @ 81C1040 + push {lr} + movs r1, 0x1 + ldr r0, =0x0203cf1c + ldr r0, [r0] + adds r2, r0, 0 + adds r2, 0x84 +_081C104C: + lsls r0, r1, 1 + adds r0, r2, r0 + ldrh r0, [r0] + cmp r0, 0 + beq _081C1060 + movs r0, 0x1 + b _081C106C + .pool +_081C1060: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bls _081C104C + movs r0, 0 +_081C106C: + pop {r1} + bx r1 + thumb_func_end sub_81C1040 + + thumb_func_start sub_81C1070 +sub_81C1070: @ 81C1070 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r7, r0, 0 + adds r4, r1, 0 + mov r8, r2 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl audio_play + mov r0, r8 + ldrb r6, [r0] + movs r2, 0 + lsls r4, 24 + asrs r4, 24 + mov r12, r4 + movs r1, 0 + ldrsh r4, [r7, r1] + ldrb r0, [r7] + lsls r3, r0, 24 +_081C109C: + lsls r0, r6, 24 + asrs r0, 24 + add r0, r12 + lsls r0, 24 + lsrs r6, r0, 24 + asrs r0, 24 + cmp r0, r4 + ble _081C10B0 + movs r6, 0 + b _081C10B6 +_081C10B0: + cmp r0, 0 + bge _081C10B6 + lsrs r6, r3, 24 +_081C10B6: + lsls r0, r6, 24 + asrs r1, r0, 24 + mov r9, r0 + cmp r1, 0x4 + bne _081C10C2 + b _081C11CC +_081C10C2: + ldr r0, =0x0203cf1c + ldr r0, [r0] + lsls r1, 1 + adds r0, 0x84 + adds r0, r1 + ldrh r5, [r0] + cmp r5, 0 + bne _081C10E2 + lsls r0, r2, 24 + movs r1, 0x80 + lsls r1, 17 + adds r0, r1 + lsrs r2, r0, 24 + asrs r0, 24 + cmp r0, 0x3 + ble _081C109C +_081C10E2: + adds r0, r5, 0 + bl sub_81C240C + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + adds r0, r5, 0 + bl sub_81C3E9C + mov r1, r8 + ldrb r0, [r1] + cmp r0, 0x4 + bne _081C1110 + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040c4 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _081C1118 +_081C1110: + movs r1, 0x2 + ldrsh r0, [r7, r1] + cmp r0, 0x1 + bne _081C115E +_081C1118: + movs r0, 0x13 + bl ClearWindowTilemap + ldr r2, =0x02020630 + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040d5 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _081C1142 + movs r0, 0xD + bl ClearWindowTilemap +_081C1142: + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r4, 0x3 + negs r4, r4 + movs r0, 0x9 + adds r1, r4, 0 + bl sub_81C1DA4 + movs r0, 0x9 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_81C1EFC +_081C115E: + mov r1, r8 + ldrb r0, [r1] + cmp r0, 0x4 + beq _081C11A0 + mov r1, r9 + asrs r0, r1, 24 + cmp r0, 0x4 + bne _081C11A0 + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040c4 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + bne _081C11A0 + movs r0, 0xE + bl ClearWindowTilemap + movs r0, 0xF + bl ClearWindowTilemap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0 + movs r1, 0x3 + bl sub_81C1DA4 + movs r0, 0 + movs r1, 0x3 + movs r2, 0 + bl sub_81C1EFC +_081C11A0: + mov r0, r8 + strb r6, [r0] + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040c6 + adds r0, r1 + cmp r8, r0 + bne _081C11E0 + movs r0, 0x8 + bl sub_81C4D18 + b _081C11E6 + .pool +_081C11CC: + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040c4 + adds r0, r1 + ldrh r5, [r0] + b _081C10E2 + .pool +_081C11E0: + movs r0, 0x12 + bl sub_81C4D18 +_081C11E6: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81C1070 + + thumb_func_start sub_81C11F4 +sub_81C11F4: @ 81C11F4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x8 + bl sub_81C4C60 + movs r0, 0x6 + bl ClearWindowTilemap + movs r0, 0x5 + bl PutWindowTilemap + movs r0, 0 + bl sub_81C3E9C + ldr r4, =0x0203cf1c + ldr r0, [r4] + ldr r1, =0x000020bc + adds r0, r1 + movs r1, 0x3 + movs r2, 0x1 + bl sub_81C2194 + ldr r0, [r4] + ldr r1, =0x000030bc + adds r0, r1 + movs r1, 0x1 + movs r2, 0x1 + bl sub_81C2194 + bl sub_81C4064 + ldr r0, [r4] + ldr r1, =0x000040c6 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x4 + beq _081C125E + movs r0, 0xE + bl ClearWindowTilemap + movs r0, 0xF + bl ClearWindowTilemap + movs r0, 0 + movs r1, 0x3 + bl sub_81C1DA4 + movs r0, 0 + movs r1, 0x3 + movs r2, 0 + bl sub_81C1EFC +_081C125E: + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81C0510 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C11F4 + + thumb_func_start sub_81C129C +sub_81C129C: @ 81C129C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r2, =0x000040c6 + adds r1, r0, r2 + ldrb r1, [r1] + adds r2, 0x1 + adds r0, r2 + strb r1, [r0] + movs r0, 0x1 + bl sub_81C4C84 + movs r0, 0x12 + bl sub_81C4AF8 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81C12E4 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C129C + + thumb_func_start sub_81C12E4 +sub_81C12E4: @ 81C12E4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C13AA + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081C1338 + movs r0, 0x3 + strh r0, [r4] + movs r1, 0x1 + negs r1, r1 + ldr r0, =0x0203cf1c + ldr r2, [r0] + ldr r0, =0x000040c7 + adds r2, r0 + adds r0, r4, 0 + bl sub_81C1070 + b _081C13AA + .pool +_081C1338: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081C1360 + movs r0, 0x3 + strh r0, [r4] + ldr r0, =0x0203cf1c + ldr r2, [r0] + ldr r0, =0x000040c7 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81C1070 + b _081C13AA + .pool +_081C1360: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081C139A + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r2, =0x000040c6 + adds r1, r0, r2 + adds r2, 0x1 + adds r0, r2 + ldrb r1, [r1] + ldrb r0, [r0] + cmp r1, r0 + bne _081C1390 + adds r0, r5, 0 + movs r1, 0 + bl sub_81C13B0 + b _081C13AA + .pool +_081C1390: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81C13B0 + b _081C13AA +_081C139A: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081C13AA + adds r0, r6, 0 + movs r1, 0 + bl sub_81C13B0 +_081C13AA: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81C12E4 + + thumb_func_start sub_81C13B0 +sub_81C13B0: @ 81C13B0 + push {r4-r7,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl audio_play + movs r0, 0 + bl sub_81C4C84 + movs r0, 0x12 + bl sub_81C4C60 + cmp r4, 0x1 + bne _081C1464 + ldr r0, =0x0203cf1c + ldr r3, [r0] + ldr r1, =0x000040bd + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _081C1410 + ldr r0, [r3] + ldr r2, =0x000040be + adds r1, r3, r2 + ldrb r2, [r1] + movs r1, 0x64 + muls r1, r2 + adds r0, r1 + ldr r4, =0x000040c6 + adds r1, r3, r4 + ldrb r1, [r1] + adds r4, 0x1 + adds r2, r3, r4 + ldrb r2, [r2] + bl sub_81C14BC + b _081C1430 + .pool +_081C1410: + ldr r0, [r3] + ldr r2, =0x000040be + adds r1, r3, r2 + ldrb r2, [r1] + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 4 + adds r0, r1 + ldr r4, =0x000040c6 + adds r1, r3, r4 + ldrb r1, [r1] + adds r4, 0x1 + adds r2, r3, r4 + ldrb r2, [r2] + bl sub_81C15EC +_081C1430: + ldr r5, =0x0203cf1c + ldr r0, [r5] + adds r0, 0xC + bl sub_81C0098 + ldr r1, [r5] + ldr r6, =0x000040c6 + adds r0, r1, r6 + ldrb r0, [r0] + ldr r4, =0x000040c7 + adds r1, r4 + ldrb r1, [r1] + bl sub_81C40A0 + ldr r1, [r5] + adds r0, r1, r6 + ldrb r0, [r0] + adds r1, r4 + ldrb r1, [r1] + bl sub_81C4568 + ldr r0, [r5] + adds r4, r0, r4 + ldrb r1, [r4] + adds r0, r6 + strb r1, [r0] +_081C1464: + ldr r0, =0x0203cf1c + ldr r1, [r0] + ldr r2, =0x000040c6 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 1 + adds r1, 0x84 + adds r1, r0 + ldrh r4, [r1] + adds r0, r4, 0 + bl sub_81C3E9C + adds r0, r4, 0 + bl sub_81C240C + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81C0F44 + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C13B0 + + thumb_func_start sub_81C14BC +sub_81C14BC: @ 81C14BC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + adds r7, r0, 0 + adds r4, r1, 0 + adds r6, r2, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r6, 24 + lsrs r6, 24 + ldr r0, =0x0203cf1c + ldr r2, [r0] + lsls r0, r4, 1 + mov r10, r0 + adds r1, r2, 0 + adds r1, 0x84 + adds r0, r1, r0 + str r0, [sp, 0x8] + ldrh r0, [r0] + mov r3, sp + adds r3, 0x2 + str r3, [sp, 0x1C] + strh r0, [r3] + lsls r0, r6, 1 + mov r9, r0 + add r1, r9 + str r1, [sp, 0xC] + ldrh r1, [r1] + mov r0, sp + strh r1, [r0] + adds r1, r2, 0 + adds r1, 0x8C + adds r3, r1, r4 + str r3, [sp, 0x10] + ldrb r0, [r3] + mov r3, sp + adds r3, 0x5 + str r3, [sp, 0x24] + strb r0, [r3] + adds r1, r6 + str r1, [sp, 0x14] + ldrb r0, [r1] + mov r1, sp + adds r1, 0x4 + str r1, [sp, 0x20] + strb r0, [r1] + adds r2, 0xA4 + str r2, [sp, 0x18] + ldrb r0, [r2] + mov r5, sp + adds r5, 0x6 + strb r0, [r5] + ldr r1, =gUnknown_08329D22 + adds r0, r4, r1 + ldrb r0, [r0] + mov r8, r0 + ldrb r0, [r5] + adds r2, r0, 0 + mov r3, r8 + ands r2, r3 + mov r3, r10 + asrs r2, r3 + lsls r2, 24 + lsrs r2, 24 + adds r1, r6, r1 + ldrb r1, [r1] + mov r12, r1 + adds r1, r0, 0 + mov r3, r12 + ands r1, r3 + mov r3, r9 + asrs r1, r3 + lsls r1, 24 + lsrs r1, 24 + mov r3, r8 + bics r0, r3 + strb r0, [r5] + ldrb r0, [r5] + mov r3, r12 + bics r0, r3 + strb r0, [r5] + mov r0, r9 + lsls r2, r0 + mov r3, r10 + lsls r1, r3 + adds r2, r1 + ldrb r0, [r5] + orrs r0, r2 + strb r0, [r5] + adds r1, r4, 0 + adds r1, 0xD + adds r0, r7, 0 + mov r2, sp + bl pokemon_setattr + adds r1, r6, 0 + adds r1, 0xD + adds r0, r7, 0 + ldr r2, [sp, 0x1C] + bl pokemon_setattr + adds r4, 0x11 + adds r0, r7, 0 + adds r1, r4, 0 + ldr r2, [sp, 0x20] + bl pokemon_setattr + adds r6, 0x11 + adds r0, r7, 0 + adds r1, r6, 0 + ldr r2, [sp, 0x24] + bl pokemon_setattr + adds r0, r7, 0 + movs r1, 0x15 + adds r2, r5, 0 + bl pokemon_setattr + mov r0, sp + ldrh r0, [r0] + ldr r1, [sp, 0x8] + strh r0, [r1] + ldr r3, [sp, 0x1C] + ldrh r0, [r3] + ldr r1, [sp, 0xC] + strh r0, [r1] + ldr r3, [sp, 0x20] + ldrb r0, [r3] + ldr r1, [sp, 0x10] + strb r0, [r1] + ldr r3, [sp, 0x24] + ldrb r0, [r3] + ldr r1, [sp, 0x14] + strb r0, [r1] + ldrb r0, [r5] + ldr r3, [sp, 0x18] + strb r0, [r3] + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C14BC + + thumb_func_start sub_81C15EC +sub_81C15EC: @ 81C15EC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + adds r7, r0, 0 + adds r4, r1, 0 + adds r6, r2, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r6, 24 + lsrs r6, 24 + ldr r0, =0x0203cf1c + ldr r2, [r0] + lsls r0, r4, 1 + mov r10, r0 + adds r1, r2, 0 + adds r1, 0x84 + adds r0, r1, r0 + str r0, [sp, 0x8] + ldrh r0, [r0] + mov r3, sp + adds r3, 0x2 + str r3, [sp, 0x1C] + strh r0, [r3] + lsls r0, r6, 1 + mov r9, r0 + add r1, r9 + str r1, [sp, 0xC] + ldrh r1, [r1] + mov r0, sp + strh r1, [r0] + adds r1, r2, 0 + adds r1, 0x8C + adds r3, r1, r4 + str r3, [sp, 0x10] + ldrb r0, [r3] + mov r3, sp + adds r3, 0x5 + str r3, [sp, 0x24] + strb r0, [r3] + adds r1, r6 + str r1, [sp, 0x14] + ldrb r0, [r1] + mov r1, sp + adds r1, 0x4 + str r1, [sp, 0x20] + strb r0, [r1] + adds r2, 0xA4 + str r2, [sp, 0x18] + ldrb r0, [r2] + mov r5, sp + adds r5, 0x6 + strb r0, [r5] + ldr r1, =gUnknown_08329D22 + adds r0, r4, r1 + ldrb r0, [r0] + mov r8, r0 + ldrb r0, [r5] + adds r2, r0, 0 + mov r3, r8 + ands r2, r3 + mov r3, r10 + asrs r2, r3 + lsls r2, 24 + lsrs r2, 24 + adds r1, r6, r1 + ldrb r1, [r1] + mov r12, r1 + adds r1, r0, 0 + mov r3, r12 + ands r1, r3 + mov r3, r9 + asrs r1, r3 + lsls r1, 24 + lsrs r1, 24 + mov r3, r8 + bics r0, r3 + strb r0, [r5] + ldrb r0, [r5] + mov r3, r12 + bics r0, r3 + strb r0, [r5] + mov r0, r9 + lsls r2, r0 + mov r3, r10 + lsls r1, r3 + adds r2, r1 + ldrb r0, [r5] + orrs r0, r2 + strb r0, [r5] + adds r1, r4, 0 + adds r1, 0xD + adds r0, r7, 0 + mov r2, sp + bl pokemon_setattr_encrypted + adds r1, r6, 0 + adds r1, 0xD + adds r0, r7, 0 + ldr r2, [sp, 0x1C] + bl pokemon_setattr_encrypted + adds r4, 0x11 + adds r0, r7, 0 + adds r1, r4, 0 + ldr r2, [sp, 0x20] + bl pokemon_setattr_encrypted + adds r6, 0x11 + adds r0, r7, 0 + adds r1, r6, 0 + ldr r2, [sp, 0x24] + bl pokemon_setattr_encrypted + adds r0, r7, 0 + movs r1, 0x15 + adds r2, r5, 0 + bl pokemon_setattr_encrypted + mov r0, sp + ldrh r0, [r0] + ldr r1, [sp, 0x8] + strh r0, [r1] + ldr r3, [sp, 0x1C] + ldrh r0, [r3] + ldr r1, [sp, 0xC] + strh r0, [r1] + ldr r3, [sp, 0x20] + ldrb r0, [r3] + ldr r1, [sp, 0x10] + strb r0, [r1] + ldr r3, [sp, 0x24] + ldrb r0, [r3] + ldr r1, [sp, 0x14] + strb r0, [r1] + ldrb r0, [r5] + ldr r3, [sp, 0x18] + strb r0, [r3] + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C15EC + + thumb_func_start sub_81C171C +sub_81C171C: @ 81C171C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_81C44F0 + movs r0, 0x8 + bl sub_81C4AF8 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81C174C + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C171C + + thumb_func_start sub_81C174C +sub_81C174C: @ 81C174C + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C176A + b _081C189A +_081C176A: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r2, 0x80 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _081C177A + b _081C189A +_081C177A: + ldr r6, =0x030022c0 + ldrh r1, [r6, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081C17B4 + movs r0, 0x4 + strh r0, [r4] + movs r1, 0x1 + negs r1, r1 + ldr r0, =0x0203cf1c + ldr r2, [r0] + ldr r0, =0x000040c6 + adds r2, r0 + adds r0, r4, 0 + bl sub_81C1070 + b _081C189A + .pool +_081C17B4: + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _081C17DC + movs r0, 0x4 + strh r0, [r4] + ldr r0, =0x0203cf1c + ldr r2, [r0] + ldr r1, =0x000040c6 + adds r2, r1 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81C1070 + b _081C189A + .pool +_081C17DC: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _081C17F0 + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C17FC +_081C17F0: + movs r1, 0x1 + negs r1, r1 + adds r0, r5, 0 + bl sub_81C0A8C + b _081C189A +_081C17FC: + ldrh r1, [r6, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _081C1812 + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _081C181C +_081C1812: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81C0A8C + b _081C189A +_081C181C: + ldrh r1, [r6, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081C1876 + bl sub_81C18A8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C1868 + bl sub_81C48F0 + movs r0, 0x5 + bl audio_play + ldr r2, =0x0203cf21 + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040c6 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r1, =0x020375e2 + ldrb r0, [r2] + strh r0, [r1] + adds r0, r5, 0 + bl sub_81C044C + b _081C189A + .pool +_081C1868: + movs r0, 0x20 + bl audio_play + adds r0, r5, 0 + bl sub_81C18F4 + b _081C189A +_081C1876: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081C189A + bl sub_81C48F0 + movs r0, 0x5 + bl audio_play + ldr r1, =0x0203cf21 + movs r0, 0x4 + strb r0, [r1] + ldr r1, =0x020375e2 + movs r0, 0x4 + strh r0, [r1] + adds r0, r5, 0 + bl sub_81C044C +_081C189A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C174C + + thumb_func_start sub_81C18A8 +sub_81C18A8: @ 81C18A8 + push {lr} + ldr r0, =0x0203cf1c + ldr r2, [r0] + ldr r0, =0x000040c6 + adds r1, r2, r0 + ldrb r0, [r1] + cmp r0, 0x4 + beq _081C18DA + ldr r3, =0x000040c4 + adds r0, r2, r3 + ldrh r0, [r0] + cmp r0, 0 + beq _081C18DA + ldrb r1, [r1] + lsls r1, 1 + adds r0, r2, 0 + adds r0, 0x84 + adds r0, r1 + ldrh r0, [r0] + bl sub_81B6D14 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C18EC +_081C18DA: + movs r0, 0x1 + b _081C18EE + .pool +_081C18EC: + movs r0, 0 +_081C18EE: + pop {r1} + bx r1 + thumb_func_end sub_81C18A8 + + thumb_func_start sub_81C18F4 +sub_81C18F4: @ 81C18F4 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0xE + bl ClearWindowTilemap + movs r0, 0xF + bl ClearWindowTilemap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0 + movs r1, 0x3 + bl sub_81C1DA4 + movs r0, 0 + movs r1, 0x3 + movs r2, 0 + bl sub_81C1EFC + bl sub_81C4154 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81C1940 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C18F4 + + thumb_func_start sub_81C1940 +sub_81C1940: @ 81C1940 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + mov r8, r0 + ldr r0, =0x03005e08 + mov r9, r0 + mov r4, r8 + add r4, r9 + ldr r0, =sub_81C1E20 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C196C + b _081C1B74 +_081C196C: + ldr r6, =0x030022c0 + ldrh r1, [r6, 0x2E] + movs r0, 0x40 + ands r0, r1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + beq _081C19B0 + movs r0, 0x1 + strh r0, [r4, 0x2] + movs r0, 0x4 + strh r0, [r4] + movs r1, 0x1 + negs r1, r1 + ldr r0, =0x0203cf1c + ldr r2, [r0] + ldr r0, =0x000040c6 + adds r2, r0 + adds r0, r4, 0 + bl sub_81C1070 + movs r0, 0 + strh r0, [r4, 0x2] + b _081C1B6A + .pool +_081C19B0: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081C19DC + movs r0, 0x1 + strh r0, [r4, 0x2] + movs r0, 0x4 + strh r0, [r4] + ldr r0, =0x0203cf1c + ldr r2, [r0] + ldr r1, =0x000040c6 + adds r2, r1 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81C1070 + strh r5, [r4, 0x2] + b _081C1B6A + .pool +_081C19DC: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _081C19F0 + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C1A64 +_081C19F0: + ldr r4, =0x0203cf1c + ldr r0, [r4] + ldr r2, =0x000040c0 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0x2 + bne _081C1A00 + b _081C1B74 +_081C1A00: + movs r0, 0x13 + bl ClearWindowTilemap + ldr r2, =0x02020630 + ldr r0, [r4] + ldr r1, =0x000040d5 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _081C1A28 + movs r0, 0xD + bl ClearWindowTilemap +_081C1A28: + ldr r1, [r4] + ldr r2, =0x000040c6 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 1 + adds r1, 0x84 + adds r1, r0 + ldrh r5, [r1] + mov r0, r9 + subs r0, 0x8 + add r0, r8 + ldr r1, =sub_81C174C + str r1, [r0] + movs r1, 0x1 + negs r1, r1 + adds r0, r7, 0 + b _081C1ACE + .pool +_081C1A64: + ldrh r1, [r6, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _081C1A7A + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _081C1B04 +_081C1A7A: + ldr r4, =0x0203cf1c + ldr r0, [r4] + ldr r1, =0x000040c0 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3 + beq _081C1B74 + movs r0, 0x13 + bl ClearWindowTilemap + ldr r2, =0x02020630 + ldr r0, [r4] + ldr r1, =0x000040d5 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _081C1AB0 + movs r0, 0xD + bl ClearWindowTilemap +_081C1AB0: + ldr r1, [r4] + ldr r2, =0x000040c6 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 1 + adds r1, 0x84 + adds r1, r0 + ldrh r5, [r1] + mov r0, r9 + subs r0, 0x8 + add r0, r8 + ldr r1, =sub_81C174C + str r1, [r0] + adds r0, r7, 0 + movs r1, 0x1 +_081C1ACE: + bl sub_81C0A8C + movs r4, 0x2 + negs r4, r4 + movs r0, 0x9 + adds r1, r4, 0 + bl sub_81C1DA4 + movs r0, 0x9 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_81C1EFC + b _081C1B74 + .pool +_081C1B04: + ldrh r1, [r6, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081C1B74 + movs r0, 0x13 + bl ClearWindowTilemap + ldr r2, =0x02020630 + ldr r4, =0x0203cf1c + ldr r0, [r4] + ldr r1, =0x000040d5 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _081C1B38 + movs r0, 0xD + bl ClearWindowTilemap +_081C1B38: + ldr r1, [r4] + ldr r2, =0x000040c6 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 1 + adds r1, 0x84 + adds r1, r0 + ldrh r5, [r1] + adds r0, r5, 0 + bl sub_81C3E9C + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r4, 0x3 + negs r4, r4 + movs r0, 0x9 + adds r1, r4, 0 + bl sub_81C1DA4 + movs r0, 0x9 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_81C1EFC +_081C1B6A: + mov r0, r9 + subs r0, 0x8 + add r0, r8 + ldr r1, =sub_81C174C + str r1, [r0] +_081C1B74: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C1940 + + thumb_func_start sub_81C1B94 +sub_81C1B94: @ 81C1B94 + ldr r0, =0x0203cf21 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_81C1B94 + + thumb_func_start sub_81C1BA0 +sub_81C1BA0: @ 81C1BA0 + push {r4-r7,lr} + sub sp, 0xC + movs r0, 0x20 + bl Alloc + adds r4, r0, 0 + movs r5, 0 +_081C1BAE: + lsls r0, r5, 25 + lsrs r1, r0, 24 + adds r6, r1, 0 + ldr r0, =0x0203cf1c + ldr r3, [r0] + ldr r2, =0x000040c1 + adds r0, r3, r2 + ldrb r0, [r0] + cmp r5, r0 + bcs _081C1BD8 + lsls r0, r1, 1 + adds r0, r4 + movs r1, 0x40 + strh r1, [r0] + strh r1, [r0, 0x2] + movs r1, 0x50 + b _081C1BEE + .pool +_081C1BD8: + ldr r7, =0x000040c2 + adds r0, r3, r7 + ldrb r2, [r0] + cmp r5, r2 + bls _081C1BF8 + lsls r0, r1, 1 + adds r0, r4 + movs r1, 0x4A + strh r1, [r0] + strh r1, [r0, 0x2] + movs r1, 0x5A +_081C1BEE: + strh r1, [r0, 0x10] + strh r1, [r0, 0x12] + b _081C1C78 + .pool +_081C1BF8: + ldr r7, =0x000040c0 + adds r0, r3, r7 + ldrb r0, [r0] + cmp r5, r0 + bcs _081C1C1C + lsls r1, 1 + adds r1, r4 + movs r0, 0x46 + strh r0, [r1] + movs r0, 0x47 + strh r0, [r1, 0x2] + movs r0, 0x56 + strh r0, [r1, 0x10] + movs r0, 0x57 + b _081C1C76 + .pool +_081C1C1C: + cmp r5, r0 + bne _081C1C4C + cmp r5, r2 + beq _081C1C38 + lsls r1, 1 + adds r1, r4 + movs r0, 0x41 + strh r0, [r1] + movs r0, 0x42 + strh r0, [r1, 0x2] + movs r0, 0x51 + strh r0, [r1, 0x10] + movs r0, 0x52 + b _081C1C76 +_081C1C38: + lsls r1, 1 + adds r1, r4 + movs r0, 0x4B + strh r0, [r1] + movs r0, 0x4C + strh r0, [r1, 0x2] + movs r0, 0x5B + strh r0, [r1, 0x10] + movs r0, 0x5C + b _081C1C76 +_081C1C4C: + cmp r5, r2 + beq _081C1C64 + lsls r1, 1 + adds r1, r4 + movs r0, 0x43 + strh r0, [r1] + movs r0, 0x44 + strh r0, [r1, 0x2] + movs r0, 0x53 + strh r0, [r1, 0x10] + movs r0, 0x54 + b _081C1C76 +_081C1C64: + lsls r1, r6, 1 + adds r1, r4 + movs r0, 0x48 + strh r0, [r1] + movs r0, 0x49 + strh r0, [r1, 0x2] + movs r0, 0x58 + strh r0, [r1, 0x10] + movs r0, 0x59 +_081C1C76: + strh r0, [r1, 0x12] +_081C1C78: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _081C1BAE + movs r0, 0x8 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x10 + str r0, [sp, 0x8] + movs r0, 0x3 + adds r1, r4, 0 + movs r2, 0xB + movs r3, 0 + bl CopyToBgTilemapBufferRect_ChangePalette + movs r0, 0x3 + bl schedule_bg_copy_tilemap_to_vram + adds r0, r4, 0 + bl Free + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81C1BA0 + + thumb_func_start sub_81C1CB0 +sub_81C1CB0: @ 81C1CB0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + mov r8, r1 + lsls r2, 24 + lsrs r6, r2, 24 + lsls r3, 24 + lsrs r5, r3, 24 + ldrb r1, [r4, 0x6] + ldrb r0, [r4, 0x7] + lsls r0, 1 + muls r0, r1 + bl Alloc + adds r7, r0, 0 + mov r1, sp + ldrh r0, [r4, 0x4] + strh r0, [r1] + ldrb r1, [r4, 0x7] + ldrb r0, [r4, 0x6] + adds r2, r1, 0 + muls r2, r0 + movs r0, 0x80 + lsls r0, 17 + orrs r2, r0 + mov r0, sp + adds r1, r7, 0 + bl CpuSet + ldrb r0, [r4, 0x6] + cmp r0, r6 + beq _081C1D60 + cmp r5, 0 + bne _081C1D30 + movs r5, 0 + ldrb r0, [r4, 0x7] + cmp r5, r0 + bcs _081C1D60 +_081C1D00: + ldrb r2, [r4, 0x6] + adds r1, r2, 0 + muls r1, r5 + adds r3, r6, r1 + lsls r3, 1 + ldr r0, [r4] + adds r0, r3 + lsls r1, 1 + adds r1, r7, r1 + subs r2, r6 + ldr r3, =0x001fffff + ands r2, r3 + bl CpuSet + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + ldrb r3, [r4, 0x7] + cmp r5, r3 + bcc _081C1D00 + b _081C1D60 + .pool +_081C1D30: + movs r5, 0 + ldrb r0, [r4, 0x7] + cmp r5, r0 + bcs _081C1D60 +_081C1D38: + ldrb r2, [r4, 0x6] + adds r1, r2, 0 + muls r1, r5 + lsls r3, r1, 1 + ldr r0, [r4] + adds r0, r3 + adds r1, r6, r1 + lsls r1, 1 + adds r1, r7, r1 + subs r2, r6 + ldr r3, =0x001fffff + ands r2, r3 + bl CpuSet + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + ldrb r3, [r4, 0x7] + cmp r5, r3 + bcc _081C1D38 +_081C1D60: + movs r5, 0 + b _081C1D8A + .pool +_081C1D68: + ldrb r2, [r4, 0x6] + adds r0, r2, 0 + muls r0, r5 + lsls r0, 1 + adds r0, r7, r0 + ldrb r1, [r4, 0x9] + adds r1, r5 + lsls r1, 5 + ldrb r3, [r4, 0x8] + adds r1, r3 + lsls r1, 1 + add r1, r8 + bl CpuSet + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_081C1D8A: + ldrb r0, [r4, 0x7] + cmp r5, r0 + bcc _081C1D68 + adds r0, r7, 0 + bl Free + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81C1CB0 + + thumb_func_start sub_81C1DA4 +sub_81C1DA4: @ 81C1DA4 + push {r4-r6,lr} + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 16 + lsrs r4, r1, 16 + asrs r1, 16 + ldr r3, =gUnknown_0861CC04 + ldrb r2, [r3, 0x6] + cmp r1, r2 + ble _081C1DBA + adds r4, r2, 0 +_081C1DBA: + lsls r0, r4, 16 + asrs r0, 16 + cmp r0, 0 + beq _081C1DC6 + cmp r0, r2 + bne _081C1DE8 +_081C1DC6: + ldr r0, =0x0203cf1c + ldr r1, [r0] + ldr r0, =0x000020bc + adds r1, r0 + lsls r2, r4, 24 + lsrs r2, 24 + adds r0, r3, 0 + movs r3, 0x1 + bl sub_81C1CB0 + b _081C1E12 + .pool +_081C1DE8: + ldr r5, =sub_81C1E20 + adds r0, r5, 0 + bl get_task_id_by_function + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + bne _081C1E04 + adds r0, r5, 0 + movs r1, 0x8 + bl AddTask + lsls r0, 24 + lsrs r2, r0, 24 +_081C1E04: + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + strh r4, [r0, 0x8] + strh r6, [r0, 0xA] +_081C1E12: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C1DA4 + + thumb_func_start sub_81C1E20 +sub_81C1E20: @ 81C1E20 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + ldrh r0, [r4] + ldrh r1, [r4, 0x2] + adds r0, r1 + strh r0, [r4, 0x2] + lsls r0, 16 + cmp r0, 0 + bge _081C1E50 + movs r0, 0 + strh r0, [r4, 0x2] + ldr r7, =gUnknown_0861CC04 + b _081C1E60 + .pool +_081C1E50: + movs r0, 0x2 + ldrsh r1, [r4, r0] + ldr r0, =gUnknown_0861CC04 + ldrb r2, [r0, 0x6] + adds r7, r0, 0 + cmp r1, r2 + ble _081C1E60 + strh r2, [r4, 0x2] +_081C1E60: + ldr r5, =0x0203cf1c + ldr r1, [r5] + ldr r0, =0x000020bc + adds r1, r0 + ldrb r2, [r4, 0x2] + adds r0, r7, 0 + movs r3, 0x1 + bl sub_81C1CB0 + movs r1, 0x2 + ldrsh r0, [r4, r1] + cmp r0, 0 + ble _081C1E80 + ldrb r7, [r7, 0x6] + cmp r0, r7 + blt _081C1EE0 +_081C1E80: + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + bge _081C1EAC + ldr r0, [r5] + ldr r1, =0x000040c0 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x2 + bne _081C1ED4 + movs r0, 0xE + bl PutWindowTilemap + b _081C1ED4 + .pool +_081C1EAC: + ldr r2, =0x02020630 + ldr r0, [r5] + ldr r1, =0x000040d5 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _081C1ECE + movs r0, 0xD + bl PutWindowTilemap +_081C1ECE: + movs r0, 0x13 + bl PutWindowTilemap +_081C1ED4: + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + adds r0, r6, 0 + bl remove_task +_081C1EE0: + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C1E20 + + thumb_func_start sub_81C1EFC +sub_81C1EFC: @ 81C1EFC + push {r4-r7,lr} + lsls r0, 16 + lsrs r7, r0, 16 + lsls r1, 16 + lsls r2, 16 + lsrs r6, r2, 16 + lsrs r4, r1, 16 + asrs r1, 16 + ldr r3, =gUnknown_0861CC10 + ldrb r2, [r3, 0x6] + cmp r1, r2 + ble _081C1F16 + adds r4, r2, 0 +_081C1F16: + lsls r0, r4, 16 + asrs r0, 16 + cmp r0, 0 + beq _081C1F22 + cmp r0, r2 + bne _081C1F44 +_081C1F22: + ldr r0, =0x0203cf1c + ldr r1, [r0] + ldr r0, =0x000030bc + adds r1, r0 + lsls r2, r4, 24 + lsrs r2, 24 + adds r0, r3, 0 + movs r3, 0x1 + bl sub_81C1CB0 + b _081C1F70 + .pool +_081C1F44: + ldr r5, =sub_81C1F80 + adds r0, r5, 0 + bl get_task_id_by_function + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + bne _081C1F60 + adds r0, r5, 0 + movs r1, 0x8 + bl AddTask + lsls r0, 24 + lsrs r2, r0, 24 +_081C1F60: + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + strh r4, [r0, 0x8] + strh r7, [r0, 0xA] + strh r6, [r0, 0xC] +_081C1F70: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C1EFC + + thumb_func_start sub_81C1F80 +sub_81C1F80: @ 81C1F80 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + ldrh r0, [r4] + ldrh r1, [r4, 0x2] + adds r0, r1 + strh r0, [r4, 0x2] + lsls r0, 16 + cmp r0, 0 + bge _081C1FB0 + movs r0, 0 + strh r0, [r4, 0x2] + ldr r7, =gUnknown_0861CC10 + b _081C1FC0 + .pool +_081C1FB0: + movs r0, 0x2 + ldrsh r1, [r4, r0] + ldr r0, =gUnknown_0861CC10 + ldrb r2, [r0, 0x6] + adds r7, r0, 0 + cmp r1, r2 + ble _081C1FC0 + strh r2, [r4, 0x2] +_081C1FC0: + ldr r5, =0x0203cf1c + ldr r1, [r5] + ldr r0, =0x000030bc + adds r1, r0 + ldrb r2, [r4, 0x2] + adds r0, r7, 0 + movs r3, 0x1 + bl sub_81C1CB0 + movs r1, 0x2 + ldrsh r0, [r4, r1] + cmp r0, 0 + ble _081C1FE0 + ldrb r7, [r7, 0x6] + cmp r0, r7 + blt _081C2058 +_081C1FE0: + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + bge _081C2024 + ldr r0, [r5] + ldr r1, =0x000040c0 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C2006 + ldr r0, =sub_81C0B8C + bl is_function_an_active_task + lsls r0, 24 + cmp r0, 0 + bne _081C2006 + movs r0, 0xF + bl PutWindowTilemap +_081C2006: + ldrh r0, [r4, 0x4] + bl sub_81C240C + b _081C204C + .pool +_081C2024: + ldr r2, =0x02020630 + ldr r0, [r5] + ldr r1, =0x000040d5 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _081C2046 + movs r0, 0xD + bl PutWindowTilemap +_081C2046: + movs r0, 0x13 + bl PutWindowTilemap +_081C204C: + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + adds r0, r6, 0 + bl remove_task +_081C2058: + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C1F80 + + thumb_func_start sub_81C2074 +sub_81C2074: @ 81C2074 + push {r4,r5,lr} + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 16 + lsrs r4, r1, 16 + asrs r1, 16 + ldr r3, =gUnknown_0861CBEC + ldrb r2, [r3, 0x6] + cmp r1, r2 + ble _081C208A + adds r4, r2, 0 +_081C208A: + lsls r0, r4, 16 + asrs r0, 16 + cmp r0, 0 + beq _081C2096 + cmp r0, r2 + bne _081C20C8 +_081C2096: + ldr r5, =0x0203cf1c + ldr r1, [r5] + adds r1, 0xBC + lsls r4, 24 + lsrs r4, 24 + adds r0, r3, 0 + adds r2, r4, 0 + movs r3, 0 + bl sub_81C1CB0 + ldr r0, =gUnknown_0861CBF8 + ldr r1, [r5] + adds r1, 0xBC + adds r2, r4, 0 + movs r3, 0 + bl sub_81C1CB0 + b _081C20E2 + .pool +_081C20C8: + ldr r0, =sub_81C20F0 + movs r1, 0x8 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + strh r5, [r1, 0xA] +_081C20E2: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C2074 + + thumb_func_start sub_81C20F0 +sub_81C20F0: @ 81C20F0 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r5, r0, r1 + ldrh r0, [r5] + ldrh r1, [r5, 0x2] + adds r0, r1 + strh r0, [r5, 0x2] + lsls r0, 16 + cmp r0, 0 + bge _081C2120 + movs r0, 0 + strh r0, [r5, 0x2] + ldr r7, =gUnknown_0861CBEC + b _081C2130 + .pool +_081C2120: + movs r0, 0x2 + ldrsh r1, [r5, r0] + ldr r0, =gUnknown_0861CBEC + ldrb r2, [r0, 0x6] + adds r7, r0, 0 + cmp r1, r2 + ble _081C2130 + strh r2, [r5, 0x2] +_081C2130: + ldr r4, =0x0203cf1c + ldr r1, [r4] + adds r1, 0xBC + ldrb r2, [r5, 0x2] + adds r0, r7, 0 + movs r3, 0 + bl sub_81C1CB0 + ldr r0, =gUnknown_0861CBF8 + ldr r1, [r4] + adds r1, 0xBC + ldrb r2, [r5, 0x2] + movs r3, 0 + bl sub_81C1CB0 + movs r0, 0x3 + bl schedule_bg_copy_tilemap_to_vram + movs r1, 0x2 + ldrsh r0, [r5, r1] + cmp r0, 0 + ble _081C2162 + ldrb r7, [r7, 0x6] + cmp r0, r7 + blt _081C2180 +_081C2162: + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0 + bge _081C217A + bl sub_81C4A88 + movs r0, 0xD + bl PutWindowTilemap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram +_081C217A: + adds r0, r6, 0 + bl remove_task +_081C2180: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C20F0 + + thumb_func_start sub_81C2194 +sub_81C2194: @ 81C2194 + push {r4-r7,lr} + adds r6, r0, 0 + lsls r2, 24 + lsls r1, 28 + lsrs r4, r1, 16 + ldr r7, =0x0000056a + cmp r2, 0 + bne _081C21E4 + movs r3, 0 + ldr r5, =gUnknown_08DC3CD4 +_081C21A8: + adds r2, r7, r3 + lsls r2, 1 + adds r2, r6 + lsls r0, r3, 1 + adds r0, r5 + ldrh r1, [r0] + adds r1, r4, r1 + strh r1, [r2] + adds r0, r2, 0 + adds r0, 0x40 + strh r1, [r0] + adds r2, 0x80 + adds r0, r3, 0 + adds r0, 0x14 + lsls r0, 1 + adds r0, r5 + ldrh r0, [r0] + adds r0, r4, r0 + strh r0, [r2] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x13 + bls _081C21A8 + b _081C221C + .pool +_081C21E4: + movs r3, 0 + ldr r5, =gUnknown_08DC3CD4 +_081C21E8: + adds r1, r7, r3 + lsls r1, 1 + adds r1, r6 + adds r0, r3, 0 + adds r0, 0x14 + lsls r0, 1 + adds r0, r5 + ldrh r0, [r0] + adds r0, r4, r0 + strh r0, [r1] + adds r2, r1, 0 + adds r2, 0x40 + adds r0, r3, 0 + adds r0, 0x28 + lsls r0, 1 + adds r0, r5 + ldrh r0, [r0] + adds r0, r4, r0 + strh r0, [r2] + adds r1, 0x80 + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x13 + bls _081C21E8 +_081C221C: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C2194 + + thumb_func_start sub_81C2228 +sub_81C2228: @ 81C2228 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0 + bl sub_806DD7C + lsls r0, 24 + cmp r0, 0 + bne _081C225C + adds r0, r4, 0 + movs r1, 0 + bl sub_806DDE4 + lsls r0, 24 + cmp r0, 0 + beq _081C225C + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r2, =0x00000502 + adds r1, r0, r2 + movs r2, 0x2C + b _081C2266 + .pool +_081C225C: + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r2, =0x00000502 + adds r1, r0, r2 + ldr r2, =0x0000081a +_081C2266: + strh r2, [r1] + ldr r1, =0x00000d02 + adds r0, r1 + strh r2, [r0] + movs r0, 0x3 + bl schedule_bg_copy_tilemap_to_vram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C2228 + + thumb_func_start sub_81C228C +sub_81C228C: @ 81C228C + push {lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _081C22AC + movs r0, 0x8 + str r0, [sp] + str r1, [sp, 0x4] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0x4 + movs r3, 0x8 + bl sub_8199C30 + b _081C22C0 +_081C22AC: + movs r0, 0x8 + str r0, [sp] + movs r0, 0x5 + str r0, [sp, 0x4] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0x4 + movs r3, 0x8 + bl sub_8199C30 +_081C22C0: + movs r0, 0x3 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x8 + pop {r0} + bx r0 + thumb_func_end sub_81C228C + + thumb_func_start sub_81C22CC +sub_81C22CC: @ 81C22CC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =0x0203cf1c + ldr r1, [r0] + adds r6, r1, 0 + adds r6, 0x70 + ldrb r1, [r6, 0x5] + mov r8, r0 + cmp r1, 0x63 + bhi _081C2340 + ldr r5, =gExperienceTables + adds r2, r1, 0 + adds r1, r2, 0x1 + lsls r1, 2 + ldr r4, =gBaseStats + ldrh r3, [r6] + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r4 + ldrb r3, [r0, 0x13] + movs r0, 0xCA + lsls r0, 1 + muls r0, r3 + adds r1, r0 + adds r1, r5 + lsls r2, 2 + adds r2, r0 + adds r2, r5 + ldr r1, [r1] + ldr r2, [r2] + subs r1, r2 + ldr r0, [r6, 0x10] + subs r4, r0, r2 + lsls r0, r4, 6 + bl __udivsi3 + adds r6, r0, 0 + movs r7, 0 + adds r0, r7, 0 + orrs r0, r6 + cmp r0, 0 + bne _081C2344 + cmp r4, 0 + beq _081C2344 + movs r6, 0x1 + movs r7, 0 + b _081C2344 + .pool +_081C2340: + movs r6, 0 + movs r7, 0 +_081C2344: + mov r1, r8 + ldr r0, [r1] + ldr r2, =0x00001d66 + adds r2, r0 + mov r9, r2 + movs r0, 0 + mov r12, r0 + ldr r1, =0x00002062 + mov r10, r1 +_081C2356: + cmp r7, 0 + bgt _081C2362 + cmp r7, 0 + bne _081C237C + cmp r6, 0x7 + bls _081C237C +_081C2362: + mov r2, r12 + lsls r0, r2, 1 + add r0, r9 + ldr r2, =0x0000206a + adds r1, r2, 0 + strh r1, [r0] + b _081C23B6 + .pool +_081C237C: + mov r1, r12 + lsls r0, r1, 1 + add r0, r9 + mov r8, r0 + adds r5, r7, 0 + adds r4, r6, 0 + cmp r7, 0 + bge _081C2394 + movs r4, 0x7 + movs r5, 0 + adds r4, r6 + adcs r5, r7 +_081C2394: + lsls r3, r5, 29 + lsrs r2, r4, 3 + adds r0, r3, 0 + orrs r0, r2 + asrs r1, r5, 3 + lsrs r5, r0, 29 + lsls r4, r1, 3 + adds r3, r5, 0 + orrs r3, r4 + lsls r2, r0, 3 + adds r1, r7, 0 + adds r0, r6, 0 + subs r0, r2 + sbcs r1, r3 + add r0, r10 + mov r2, r8 + strh r0, [r2] +_081C23B6: + movs r0, 0x8 + negs r0, r0 + asrs r1, r0, 31 + adds r6, r0 + adcs r7, r1 + cmp r7, 0 + bge _081C23C8 + movs r6, 0 + movs r7, 0 +_081C23C8: + mov r0, r12 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r12, r0 + cmp r0, 0x7 + bls _081C2356 + movs r0, 0x1 + bl GetBgTilemapBuffer + ldr r1, =0x0203cf1c + ldr r1, [r1] + ldr r2, =0x000010bc + adds r1, r2 + cmp r0, r1 + bne _081C23F8 + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + b _081C23FE + .pool +_081C23F8: + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram +_081C23FE: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81C22CC + + thumb_func_start sub_81C240C +sub_81C240C: @ 81C240C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 16 + lsrs r3, r0, 16 + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000038bc + adds r5, r0, r1 + cmp r3, 0 + beq _081C2510 + ldr r1, =gContestEffects + ldr r2, =gContestMoves + lsls r3, 3 + adds r0, r3, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldrb r4, [r0, 0x1] + mov r9, r1 + mov r8, r2 + mov r10, r3 + cmp r4, 0xFF + beq _081C244C + adds r0, r4, 0 + movs r1, 0xA + bl __udivsi3 + lsls r0, 24 + lsrs r4, r0, 24 +_081C244C: + movs r2, 0 + movs r6, 0x3 + movs r3, 0xF3 + lsls r3, 2 +_081C2454: + cmp r4, 0xFF + beq _081C2484 + cmp r2, r4 + bcs _081C2484 + lsrs r0, r2, 2 + adds r1, r2, 0 + ands r1, r6 + lsls r0, 5 + adds r0, r1 + lsls r0, 1 + adds r0, r5 + adds r0, r3 + ldr r7, =0x0000103a + b _081C2496 + .pool +_081C2484: + lsrs r0, r2, 2 + adds r1, r2, 0 + ands r1, r6 + lsls r0, 5 + adds r0, r1 + lsls r0, 1 + adds r0, r5 + adds r0, r3 + ldr r7, =0x00001039 +_081C2496: + adds r1, r7, 0 + strh r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x7 + bls _081C2454 + mov r0, r10 + add r0, r8 + ldrb r0, [r0] + lsls r0, 2 + add r0, r9 + ldrb r4, [r0, 0x2] + cmp r4, 0xFF + beq _081C24C0 + adds r0, r4, 0 + movs r1, 0xA + bl __udivsi3 + lsls r0, 24 + lsrs r4, r0, 24 +_081C24C0: + movs r2, 0 + movs r6, 0x3 + ldr r3, =0x0000044c +_081C24C6: + cmp r4, 0xFF + beq _081C24F0 + cmp r2, r4 + bcs _081C24F0 + lsrs r0, r2, 2 + adds r1, r2, 0 + ands r1, r6 + lsls r0, 5 + adds r0, r1 + lsls r0, 1 + adds r0, r5 + adds r0, r3 + ldr r7, =0x0000103c + b _081C2502 + .pool +_081C24F0: + lsrs r0, r2, 2 + adds r1, r2, 0 + ands r1, r6 + lsls r0, 5 + adds r0, r1 + lsls r0, 1 + adds r0, r5 + adds r0, r3 + ldr r7, =0x0000103d +_081C2502: + adds r1, r7, 0 + strh r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x7 + bls _081C24C6 +_081C2510: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C240C + + thumb_func_start sub_81C2524 +sub_81C2524: @ 81C2524 + push {lr} + ldr r0, =0x0203cf1c + ldr r0, [r0] + adds r0, 0x74 + ldrb r0, [r0] + cmp r0, 0 + beq _081C2544 + movs r1, 0x80 + lsls r1, 9 + movs r0, 0x3 + movs r2, 0 + bl ChangeBgX + b _081C254E + .pool +_081C2544: + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgX +_081C254E: + pop {r0} + bx r0 + thumb_func_end sub_81C2524 + + thumb_func_start sub_81C2554 +sub_81C2554: @ 81C2554 + push {r4,r5,lr} + ldr r0, =gUnknown_0861CC24 + bl InitWindows + bl DeactivateAllTextPrinters + movs r4, 0 +_081C2562: + adds r0, r4, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x13 + bls _081C2562 + movs r4, 0 + ldr r5, =0x0203cf1c + ldr r3, =0x000040cb + movs r2, 0xFF +_081C257C: + ldr r0, [r5] + adds r0, r3 + adds r0, r4 + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _081C257C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C2554 + + thumb_func_start sub_81C25A4 +sub_81C25A4: @ 81C25A4 + push {r4-r6,lr} + sub sp, 0x14 + ldr r4, [sp, 0x24] + ldr r5, [sp, 0x28] + lsls r0, 24 + lsrs r0, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + movs r6, 0 + str r6, [sp] + str r4, [sp, 0x4] + lsls r4, r5, 1 + adds r4, r5 + ldr r5, =gUnknown_0861CD2C + adds r4, r5 + str r4, [sp, 0x8] + str r6, [sp, 0xC] + str r1, [sp, 0x10] + movs r1, 0x1 + bl AddTextPrinterParametrized2 + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C25A4 + + thumb_func_start sub_81C25E8 +sub_81C25E8: @ 81C25E8 + push {lr} + movs r0, 0x11 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x12 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x13 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r0, =0x0203cf1c + ldr r0, [r0] + adds r0, 0x74 + ldrb r0, [r0] + cmp r0, 0 + bne _081C2618 + bl sub_81C2628 + b _081C261C + .pool +_081C2618: + bl sub_81C2794 +_081C261C: + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + pop {r0} + bx r0 + thumb_func_end sub_81C25E8 + + thumb_func_start sub_81C2628 +sub_81C2628: @ 81C2628 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x18 + ldr r0, =0x0203cf1c + ldr r0, [r0] + movs r1, 0xC + adds r1, r0 + mov r8, r1 + adds r7, r0, 0 + adds r7, 0x70 + ldrh r0, [r7] + bl sub_806E3C0 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, =0x0000ffff + cmp r5, r0 + beq _081C26CE + ldr r6, =0x02021cc4 + ldr r1, =gUnknown_085E8D4F + adds r0, r6, 0 + bl CopyString + ldr r4, =0x02021dc4 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x2 + movs r3, 0x3 + bl ConvertIntToDecimalString + adds r0, r6, 0 + adds r1, r4, 0 + bl AppendString + mov r0, r8 + bl sub_806EBA4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _081C26AC + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r0, 0x11 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_81C25A4 + movs r0, 0 + bl sub_81C228C + b _081C26C6 + .pool +_081C26AC: + movs r0, 0 + str r0, [sp] + movs r0, 0x7 + str r0, [sp, 0x4] + movs r0, 0x11 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_81C25A4 + movs r0, 0x1 + bl sub_81C228C +_081C26C6: + movs r0, 0x11 + bl PutWindowTilemap + b _081C26EE +_081C26CE: + movs r0, 0x11 + bl ClearWindowTilemap + mov r0, r8 + bl sub_806EBA4 + lsls r0, 24 + cmp r0, 0 + bne _081C26E8 + movs r0, 0 + bl sub_81C228C + b _081C26EE +_081C26E8: + movs r0, 0x1 + bl sub_81C228C +_081C26EE: + ldr r4, =0x02021cc4 + ldr r1, =gUnknown_085E8D4D + adds r0, r4, 0 + bl CopyString + ldr r5, =0x02021dc4 + ldrb r1, [r7, 0x5] + adds r0, r5, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + adds r0, r4, 0 + adds r1, r5, 0 + bl AppendString + movs r6, 0 + str r6, [sp] + movs r5, 0x1 + str r5, [sp, 0x4] + movs r0, 0x13 + adds r1, r4, 0 + movs r2, 0x18 + movs r3, 0x11 + bl sub_81C25A4 + mov r0, r8 + adds r1, r4, 0 + bl GetMonNickname + str r6, [sp] + str r5, [sp, 0x4] + movs r0, 0x12 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_81C25A4 + add r1, sp, 0x8 + movs r0, 0xBA + strb r0, [r1] + mov r0, sp + adds r0, 0x9 + ldrh r2, [r7, 0x2] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + str r6, [sp] + str r5, [sp, 0x4] + movs r0, 0x13 + add r1, sp, 0x8 + movs r2, 0 + movs r3, 0x1 + bl sub_81C25A4 + ldrh r1, [r7, 0x2] + mov r0, r8 + bl sub_81C27DC + movs r0, 0x12 + bl PutWindowTilemap + movs r0, 0x13 + bl PutWindowTilemap + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C2628 + + thumb_func_start sub_81C2794 +sub_81C2794: @ 81C2794 + push {r4,lr} + sub sp, 0x8 + ldr r0, =0x0203cf1c + ldr r0, [r0] + adds r0, 0xC + ldr r4, =0x02021cc4 + adds r1, r4, 0 + bl GetMonNickname + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r0, 0x12 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_81C25A4 + movs r0, 0x12 + bl PutWindowTilemap + movs r0, 0x11 + bl ClearWindowTilemap + movs r0, 0x13 + bl ClearWindowTilemap + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C2794 + + thumb_func_start sub_81C27DC +sub_81C27DC: @ 81C27DC + push {lr} + sub sp, 0x8 + lsls r1, 16 + lsrs r1, 16 + cmp r1, 0x20 + beq _081C282C + cmp r1, 0x1D + beq _081C282C + bl pokemon_get_gender + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _081C27FE + cmp r0, 0xFE + beq _081C2818 + b _081C282C +_081C27FE: + ldr r1, =gUnknown_085E8D49 + str r0, [sp] + movs r0, 0x3 + str r0, [sp, 0x4] + movs r0, 0x13 + movs r2, 0x39 + movs r3, 0x11 + bl sub_81C25A4 + b _081C282C + .pool +_081C2818: + ldr r1, =gUnknown_085E8D4B + movs r0, 0 + str r0, [sp] + movs r0, 0x4 + str r0, [sp, 0x4] + movs r0, 0x13 + movs r2, 0x39 + movs r3, 0x11 + bl sub_81C25A4 +_081C282C: + add sp, 0x8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C27DC + + thumb_func_start sub_81C2838 +sub_81C2838: @ 81C2838 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + ldr r3, =gUnknown_0861CDD3 + cmp r1, 0 + bne _081C284A + subs r3, 0x80 +_081C284A: + lsls r2, 16 + lsrs r2, 16 + movs r0, 0x10 + str r0, [sp] + str r0, [sp, 0x4] + adds r0, r4, 0 + adds r1, r3, 0 + movs r3, 0 + bl BlitBitmapToWindow + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C2838 + + thumb_func_start sub_81C286C +sub_81C286C: @ 81C286C + push {r4-r7,lr} + sub sp, 0x8 + ldr r1, =gUnknown_085EA3CF + movs r5, 0 + str r5, [sp] + movs r6, 0x1 + str r6, [sp, 0x4] + movs r0, 0 + movs r2, 0x2 + movs r3, 0x1 + bl sub_81C25A4 + ldr r1, =gUnknown_085EA3DC + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0x1 + movs r2, 0x2 + movs r3, 0x1 + bl sub_81C25A4 + ldr r1, =gUnknown_085EA3EB + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0x2 + movs r2, 0x2 + movs r3, 0x1 + bl sub_81C25A4 + ldr r1, =gUnknown_085EA3F8 + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0x3 + movs r2, 0x2 + movs r3, 0x1 + bl sub_81C25A4 + ldr r7, =gUnknown_085E8CF7 + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x3E + bl GetStringRightAlignXOffset + adds r4, r0, 0 + adds r2, r4, 0 + subs r2, 0x10 + cmp r2, 0 + bge _081C28CC + movs r2, 0 +_081C28CC: + movs r0, 0x4 + movs r1, 0 + bl sub_81C2838 + lsls r2, r4, 24 + lsrs r2, 24 + str r5, [sp] + str r5, [sp, 0x4] + movs r0, 0x4 + adds r1, r7, 0 + movs r3, 0x1 + bl sub_81C25A4 + ldr r7, =gUnknown_085EA406 + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x3E + bl GetStringRightAlignXOffset + adds r4, r0, 0 + adds r2, r4, 0 + subs r2, 0x10 + cmp r2, 0 + bge _081C28FE + movs r2, 0 +_081C28FE: + movs r0, 0x5 + movs r1, 0 + bl sub_81C2838 + lsls r2, r4, 24 + lsrs r2, 24 + str r5, [sp] + str r5, [sp, 0x4] + movs r0, 0x5 + adds r1, r7, 0 + movs r3, 0x1 + bl sub_81C25A4 + ldr r7, =gUnknown_085EA3C8 + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x3E + bl GetStringRightAlignXOffset + adds r4, r0, 0 + adds r2, r4, 0 + subs r2, 0x10 + cmp r2, 0 + bge _081C2930 + movs r2, 0 +_081C2930: + movs r0, 0x6 + movs r1, 0 + bl sub_81C2838 + lsls r2, r4, 24 + lsrs r2, 24 + str r5, [sp] + str r5, [sp, 0x4] + movs r0, 0x6 + adds r1, r7, 0 + movs r3, 0x1 + bl sub_81C25A4 + ldr r1, =gUnknown_085EA369 + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0x8 + movs r2, 0 + movs r3, 0x1 + bl sub_81C25A4 + ldr r1, =gUnknown_085EA378 + str r5, [sp] + str r5, [sp, 0x4] + movs r0, 0x9 + movs r2, 0 + movs r3, 0x1 + bl sub_81C25A4 + ldr r4, =gUnknown_085EA361 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x2A + bl GetStringCenterAlignXOffset + adds r0, 0x6 + lsls r2, r0, 24 + lsrs r2, 24 + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0xA + adds r1, r4, 0 + movs r3, 0x1 + bl sub_81C25A4 + ldr r4, =gUnknown_085EA33C + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x2A + bl GetStringCenterAlignXOffset + adds r0, 0x6 + lsls r2, r0, 24 + lsrs r2, 24 + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0xA + adds r1, r4, 0 + movs r3, 0x11 + bl sub_81C25A4 + ldr r4, =gUnknown_085EA343 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x2A + bl GetStringCenterAlignXOffset + adds r0, 0x6 + lsls r2, r0, 24 + lsrs r2, 24 + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0xA + adds r1, r4, 0 + movs r3, 0x21 + bl sub_81C25A4 + ldr r4, =gUnknown_085EA34B + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x24 + bl GetStringCenterAlignXOffset + adds r0, 0x2 + lsls r2, r0, 24 + lsrs r2, 24 + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0xB + adds r1, r4, 0 + movs r3, 0x1 + bl sub_81C25A4 + ldr r4, =gUnknown_085EA353 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x24 + bl GetStringCenterAlignXOffset + adds r0, 0x2 + lsls r2, r0, 24 + lsrs r2, 24 + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0xB + adds r1, r4, 0 + movs r3, 0x11 + bl sub_81C25A4 + ldr r4, =gUnknown_085EA35B + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x24 + bl GetStringCenterAlignXOffset + adds r0, 0x2 + lsls r2, r0, 24 + lsrs r2, 24 + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0xB + adds r1, r4, 0 + movs r3, 0x21 + bl sub_81C25A4 + ldr r1, =gUnknown_085EA39F + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0xC + movs r2, 0x6 + movs r3, 0x1 + bl sub_81C25A4 + ldr r1, =gUnknown_085EA3AB + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0xC + movs r2, 0x6 + movs r3, 0x11 + bl sub_81C25A4 + ldr r1, =gUnknown_085EA398 + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0xD + movs r2, 0x2 + movs r3, 0x1 + bl sub_81C25A4 + ldr r1, =gUnknown_085EA37E + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0xE + movs r2, 0 + movs r3, 0x1 + bl sub_81C25A4 + ldr r1, =gUnknown_085EA384 + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0xE + movs r2, 0 + movs r3, 0x11 + bl sub_81C25A4 + ldr r1, =gUnknown_085EA38D + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0xF + movs r2, 0 + movs r3, 0x1 + bl sub_81C25A4 + ldr r1, =gUnknown_085EA394 + str r5, [sp] + str r6, [sp, 0x4] + movs r0, 0xF + movs r2, 0 + movs r3, 0x11 + bl sub_81C25A4 + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C286C + + thumb_func_start sub_81C2AFC +sub_81C2AFC: @ 81C2AFC + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + movs r0, 0 + bl ClearWindowTilemap + movs r0, 0x1 + bl ClearWindowTilemap + movs r0, 0x2 + bl ClearWindowTilemap + movs r0, 0x3 + bl ClearWindowTilemap + cmp r4, 0x1 + beq _081C2B66 + cmp r4, 0x1 + bgt _081C2B2A + cmp r4, 0 + beq _081C2B34 + b _081C2C06 +_081C2B2A: + cmp r5, 0x2 + beq _081C2B80 + cmp r5, 0x3 + beq _081C2BC4 + b _081C2C06 +_081C2B34: + movs r0, 0 + bl PutWindowTilemap + movs r0, 0x4 + bl PutWindowTilemap + bl sub_81A6BF4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C2B58 + bl sub_81B9E94 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C2B5E +_081C2B58: + movs r0, 0x8 + bl PutWindowTilemap +_081C2B5E: + movs r0, 0x9 + bl PutWindowTilemap + b _081C2C06 +_081C2B66: + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0xA + bl PutWindowTilemap + movs r0, 0xB + bl PutWindowTilemap + movs r0, 0xC + bl PutWindowTilemap + b _081C2C06 +_081C2B80: + movs r0, 0x2 + bl PutWindowTilemap + ldr r0, =0x0203cf1c + ldr r1, [r0] + ldr r2, =0x000040bc + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C2BBC + adds r2, 0x8 + adds r0, r1, r2 + ldr r0, [r0] + ldr r1, =0x00ffffff + ands r0, r1 + movs r1, 0x80 + lsls r1, 11 + cmp r0, r1 + beq _081C2C06 + movs r0, 0xE + bl PutWindowTilemap + b _081C2C06 + .pool +_081C2BBC: + movs r0, 0x5 + bl PutWindowTilemap + b _081C2C06 +_081C2BC4: + movs r0, 0x3 + bl PutWindowTilemap + ldr r0, =0x0203cf1c + ldr r1, [r0] + ldr r2, =0x000040bc + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C2C00 + adds r2, 0x8 + adds r0, r1, r2 + ldr r0, [r0] + ldr r1, =0x00ffffff + ands r0, r1 + movs r1, 0x80 + lsls r1, 11 + cmp r0, r1 + beq _081C2C06 + movs r0, 0xF + bl PutWindowTilemap + b _081C2C06 + .pool +_081C2C00: + movs r0, 0x5 + bl PutWindowTilemap +_081C2C06: + movs r4, 0 + ldr r5, =0x0203cf1c +_081C2C0A: + ldr r0, [r5] + ldr r1, =0x000040cb + adds r0, r1 + adds r0, r4 + ldrb r0, [r0] + bl PutWindowTilemap + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _081C2C0A + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C2AFC + + thumb_func_start sub_81C2C38 +sub_81C2C38: @ 81C2C38 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x1 + beq _081C2C84 + cmp r0, 0x1 + bgt _081C2C4E + cmp r0, 0 + beq _081C2C58 + b _081C2D0E +_081C2C4E: + cmp r1, 0x2 + beq _081C2C98 + cmp r1, 0x3 + beq _081C2CD4 + b _081C2D0E +_081C2C58: + movs r0, 0x4 + bl ClearWindowTilemap + bl sub_81A6BF4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C2C76 + bl sub_81B9E94 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C2C7C +_081C2C76: + movs r0, 0x8 + bl ClearWindowTilemap +_081C2C7C: + movs r0, 0x9 + bl ClearWindowTilemap + b _081C2D0E +_081C2C84: + movs r0, 0xA + bl ClearWindowTilemap + movs r0, 0xB + bl ClearWindowTilemap + movs r0, 0xC + bl ClearWindowTilemap + b _081C2D0E +_081C2C98: + ldr r0, =0x0203cf1c + ldr r1, [r0] + ldr r2, =0x000040bc + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C2CCC + adds r2, 0x8 + adds r0, r1, r2 + ldr r0, [r0] + ldr r1, =0x00ffffff + ands r0, r1 + movs r1, 0x80 + lsls r1, 11 + cmp r0, r1 + beq _081C2D0E + movs r0, 0xE + bl ClearWindowTilemap + b _081C2D0E + .pool +_081C2CCC: + movs r0, 0x5 + bl ClearWindowTilemap + b _081C2D0E +_081C2CD4: + ldr r0, =0x0203cf1c + ldr r1, [r0] + ldr r2, =0x000040bc + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C2D08 + adds r2, 0x8 + adds r0, r1, r2 + ldr r0, [r0] + ldr r1, =0x00ffffff + ands r0, r1 + movs r1, 0x80 + lsls r1, 11 + cmp r0, r1 + beq _081C2D0E + movs r0, 0xF + bl ClearWindowTilemap + b _081C2D0E + .pool +_081C2D08: + movs r0, 0x5 + bl ClearWindowTilemap +_081C2D0E: + movs r4, 0 +_081C2D10: + adds r0, r4, 0 + bl sub_81C2D68 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _081C2D10 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81C2C38 + + thumb_func_start sub_81C2D2C +sub_81C2D2C: @ 81C2D2C + push {r4,lr} + adds r3, r0, 0 + lsls r1, 24 + lsrs r2, r1, 24 + ldr r0, =0x0203cf1c + ldr r4, =0x000040cb + adds r1, r2, r4 + ldr r0, [r0] + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0xFF + bne _081C2D56 + lsls r0, r2, 3 + adds r0, r3, r0 + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl FillWindowPixelBuffer +_081C2D56: + ldrb r0, [r4] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81C2D2C + + thumb_func_start sub_81C2D68 +sub_81C2D68: @ 81C2D68 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0203cf1c + ldr r2, =0x000040cb + adds r0, r2 + ldr r1, [r1] + adds r4, r1, r0 + ldrb r0, [r4] + cmp r0, 0xFF + beq _081C2D8C + bl ClearWindowTilemap + ldrb r0, [r4] + bl RemoveWindow + movs r0, 0xFF + strb r0, [r4] +_081C2D8C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C2D68 + + thumb_func_start sub_81C2D9C +sub_81C2D9C: @ 81C2D9C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 +_081C2DA4: + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040cb + adds r0, r1 + adds r1, r0, r4 + ldrb r0, [r1] + cmp r0, 0xFF + beq _081C2DBA + movs r1, 0 + bl FillWindowPixelBuffer +_081C2DBA: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x7 + bls _081C2DA4 + ldr r0, =gUnknown_0861CE54 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C2D9C + + thumb_func_start sub_81C2DE4 +sub_81C2DE4: @ 81C2DE4 + push {lr} + lsls r0, 24 + ldr r1, =gUnknown_0861CE64 + lsrs r0, 22 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x10 + bl AddTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C2DE4 + + thumb_func_start sub_81C2E00 +sub_81C2E00: @ 81C2E00 + push {lr} + ldr r0, =0x0203cf1c + ldr r0, [r0] + adds r0, 0x74 + ldrb r0, [r0] + cmp r0, 0 + beq _081C2E24 + bl sub_81C335C + bl sub_81C33CC + bl sub_81C3428 + bl sub_81C349C + b _081C2E3C + .pool +_081C2E24: + bl sub_81C2EC4 + bl sub_81C2F5C + bl sub_81C2FD8 + bl sub_81C302C + bl sub_81C307C + bl sub_81C3194 +_081C2E3C: + pop {r0} + bx r0 + thumb_func_end sub_81C2E00 + + thumb_func_start sub_81C2E40 +sub_81C2E40: @ 81C2E40 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + ldrh r0, [r4] + subs r0, 0x1 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + bhi _081C2EB8 + lsls r0, 2 + ldr r1, =_081C2E70 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081C2E70: + .4byte _081C2E8C + .4byte _081C2E92 + .4byte _081C2E98 + .4byte _081C2E9E + .4byte _081C2EA4 + .4byte _081C2EAA + .4byte _081C2EB0 +_081C2E8C: + bl sub_81C2EC4 + b _081C2EB8 +_081C2E92: + bl sub_81C2F5C + b _081C2EB8 +_081C2E98: + bl sub_81C2FD8 + b _081C2EB8 +_081C2E9E: + bl sub_81C302C + b _081C2EB8 +_081C2EA4: + bl sub_81C307C + b _081C2EB8 +_081C2EAA: + bl sub_81C3194 + b _081C2EB8 +_081C2EB0: + adds r0, r2, 0 + bl remove_task + b _081C2EBE +_081C2EB8: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_081C2EBE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81C2E40 + + thumb_func_start sub_81C2EC4 +sub_81C2EC4: @ 81C2EC4 + push {r4-r6,lr} + sub sp, 0x8 + bl sub_81A6BF4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C2F54 + bl sub_81B9E94 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C2F54 + ldr r0, =gUnknown_0861CCCC + movs r1, 0 + bl sub_81C2D2C + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =gUnknown_085EA365 + movs r6, 0 + str r6, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_81C25A4 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0 + bl GetStringWidth + adds r2, r0, 0 + ldr r0, =0x0203cf1c + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xA2 + ldrb r0, [r0] + cmp r0, 0 + bne _081C2F40 + adds r1, 0xA6 + lsls r2, 24 + lsrs r2, 24 + str r6, [sp] + movs r0, 0x5 + str r0, [sp, 0x4] + adds r0, r5, 0 + movs r3, 0x1 + bl sub_81C25A4 + b _081C2F54 + .pool +_081C2F40: + adds r1, 0xA6 + lsls r2, 24 + lsrs r2, 24 + str r6, [sp] + movs r0, 0x6 + str r0, [sp, 0x4] + adds r0, r5, 0 + movs r3, 0x1 + bl sub_81C25A4 +_081C2F54: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81C2EC4 + + thumb_func_start sub_81C2F5C +sub_81C2F5C: @ 81C2F5C + push {r4,r5,lr} + sub sp, 0x8 + bl sub_81A6BF4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C2FC0 + bl sub_81B9E94 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C2FC0 + ldr r5, =0x02021cc4 + ldr r1, =gUnknown_085E8D59 + adds r0, r5, 0 + bl CopyString + ldr r1, =0x0203cf1c + ldr r1, [r1] + adds r1, 0xB8 + ldrh r1, [r1] + movs r2, 0x2 + movs r3, 0x5 + bl ConvertIntToDecimalString + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x38 + bl GetStringRightAlignXOffset + adds r4, r0, 0 + ldr r0, =gUnknown_0861CCCC + movs r1, 0x1 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsrs r4, 24 + movs r1, 0 + str r1, [sp] + movs r1, 0x1 + str r1, [sp, 0x4] + adds r1, r5, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_81C25A4 +_081C2FC0: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C2F5C + + thumb_func_start sub_81C2FD8 +sub_81C2FD8: @ 81C2FD8 + push {r4,lr} + sub sp, 0x8 + ldr r0, =0x0203cf1c + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x70 + ldrh r0, [r0] + adds r1, 0x78 + ldrb r1, [r1] + bl sub_806B694 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_0861CCCC + movs r1, 0x2 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + movs r1, 0xD + muls r1, r4 + ldr r2, =gAbilityNames + adds r1, r2 + movs r2, 0 + str r2, [sp] + movs r2, 0x1 + str r2, [sp, 0x4] + movs r2, 0 + movs r3, 0x1 + bl sub_81C25A4 + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C2FD8 + + thumb_func_start sub_81C302C +sub_81C302C: @ 81C302C + push {r4,lr} + sub sp, 0x8 + ldr r0, =0x0203cf1c + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x70 + ldrh r0, [r0] + adds r1, 0x78 + ldrb r1, [r1] + bl sub_806B694 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_0861CCCC + movs r1, 0x2 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gAbilityDescriptionPointers + lsls r4, 2 + adds r4, r1 + ldr r1, [r4] + movs r2, 0 + str r2, [sp] + str r2, [sp, 0x4] + movs r3, 0x11 + bl sub_81C25A4 + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C302C + + thumb_func_start sub_81C307C +sub_81C307C: @ 81C307C + push {r4-r6,lr} + ldr r0, =0x0203cf1c + ldr r0, [r0] + adds r4, r0, 0 + adds r4, 0x70 + bl sub_81AFBF0 + ldr r1, =gUnknown_0861CE74 + movs r0, 0 + bl sub_81AFC0C + ldr r1, =gUnknown_0861CE7B + movs r0, 0x1 + bl sub_81AFC0C + bl sub_81C31C0 + bl sub_81A6BF4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C30C2 + bl sub_81B9E94 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C30C2 + bl sub_81C3304 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C30E0 +_081C30C2: + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085EA5DB + bl sub_81AFC28 + b _081C3182 + .pool +_081C30E0: + movs r0, 0x20 + bl Alloc + adds r6, r0, 0 + movs r0, 0x20 + bl Alloc + adds r5, r0, 0 + adds r0, r6, 0 + bl sub_81C31F0 + ldrb r0, [r4, 0x9] + cmp r0, 0xD4 + bhi _081C310C + adds r1, r0, 0 + adds r0, r5, 0 + bl sub_8124610 + movs r0, 0x4 + adds r1, r5, 0 + bl sub_81AFC0C +_081C310C: + bl sub_81C3220 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C3148 + ldrb r0, [r4, 0xA] + cmp r0, 0 + bne _081C3134 + ldrb r0, [r4, 0x9] + ldr r1, =gUnknown_085EA516 + cmp r0, 0xD4 + bls _081C3170 + ldr r1, =gUnknown_085EA617 + b _081C3170 + .pool +_081C3134: + ldrb r0, [r4, 0x9] + ldr r1, =gUnknown_085EA4EC + cmp r0, 0xD4 + bls _081C3170 + ldr r1, =gUnknown_085EA5EB + b _081C3170 + .pool +_081C3148: + ldrb r0, [r4, 0x9] + cmp r0, 0xFF + bne _081C3158 + ldr r1, =gUnknown_085EA56A + b _081C3170 + .pool +_081C3158: + cmp r0, 0xFE + beq _081C316E + bl sub_81C32BC + lsls r0, 24 + cmp r0, 0 + beq _081C316E + ldrb r0, [r4, 0x9] + ldr r1, =gUnknown_085EA5A8 + cmp r0, 0xD4 + bls _081C3170 +_081C316E: + ldr r1, =gUnknown_085EA544 +_081C3170: + ldr r0, =0x02021fc4 + bl sub_81AFC28 + adds r0, r6, 0 + bl Free + adds r0, r5, 0 + bl Free +_081C3182: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C307C + + thumb_func_start sub_81C3194 +sub_81C3194: @ 81C3194 + push {lr} + sub sp, 0x8 + ldr r0, =gUnknown_0861CCCC + movs r1, 0x3 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02021fc4 + movs r2, 0 + str r2, [sp] + str r2, [sp, 0x4] + movs r3, 0x1 + bl sub_81C25A4 + add sp, 0x8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C3194 + + thumb_func_start sub_81C31C0 +sub_81C31C0: @ 81C31C0 + push {lr} + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =gNatureNamePointers + adds r0, 0xA3 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + movs r0, 0x2 + bl sub_81AFC0C + ldr r1, =gUnknown_085EA3C0 + movs r0, 0x5 + bl sub_81AFC0C + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C31C0 + + thumb_func_start sub_81C31F0 +sub_81C31F0: @ 81C31F0 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x0203cf1c + ldr r0, [r0] + adds r0, 0x7A + ldrb r1, [r0] + cmp r1, 0 + bne _081C3202 + movs r1, 0x5 +_081C3202: + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + movs r0, 0x3 + adds r1, r4, 0 + bl sub_81AFC0C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C31F0 + + thumb_func_start sub_81C3220 +sub_81C3220: @ 81C3220 + push {r4-r6,lr} + ldr r0, =0x0203cf1c + ldr r0, [r0] + adds r6, r0, 0 + adds r6, 0x70 + ldr r1, [r0] + ldr r0, =0x02024744 + cmp r1, r0 + bne _081C326C + bl link_get_multiplayer_id + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x020229e8 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r0, r2, 0x4 + adds r0, r1, r0 + ldrh r4, [r0] + adds r0, r1, r2 + ldrb r5, [r0, 0x13] + ldr r0, =0x02021cc4 + adds r2, 0x8 + adds r1, r2 + bl CopyString + b _081C3282 + .pool +_081C326C: + bl sub_80F0020 + adds r4, r0, 0 + ldr r0, =0x0000ffff + ands r4, r0 + ldr r0, =0x03005d90 + ldr r1, [r0] + ldrb r5, [r1, 0x8] + ldr r0, =0x02021cc4 + bl CopyString +_081C3282: + adds r0, r6, 0 + adds r0, 0x32 + ldrb r0, [r0] + cmp r5, r0 + bne _081C32A4 + ldr r0, [r6, 0x48] + ldr r1, =0x0000ffff + ands r0, r1 + cmp r4, r0 + bne _081C32A4 + ldr r0, =0x02021cc4 + adds r1, r6, 0 + adds r1, 0x36 + bl CompareStringWithoutExtendedControlCodes + cmp r0, 0 + beq _081C32B4 +_081C32A4: + movs r0, 0 + b _081C32B6 + .pool +_081C32B4: + movs r0, 0x1 +_081C32B6: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81C3220 + + thumb_func_start sub_81C32BC +sub_81C32BC: @ 81C32BC + push {lr} + ldr r0, =0x0203cf1c + ldr r0, [r0] + adds r0, 0x70 + ldrb r0, [r0, 0xB] + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bls _081C32D8 + movs r0, 0 + b _081C32DA + .pool +_081C32D8: + movs r0, 0x1 +_081C32DA: + pop {r1} + bx r1 + thumb_func_end sub_81C32BC + + thumb_func_start sub_81C32E0 +sub_81C32E0: @ 81C32E0 + push {lr} + ldr r0, =0x0203cf1c + ldr r0, [r0] + adds r0, 0x70 + ldrb r0, [r0, 0xB] + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bls _081C32FC + movs r0, 0 + b _081C32FE + .pool +_081C32FC: + movs r0, 0x1 +_081C32FE: + pop {r1} + bx r1 + thumb_func_end sub_81C32E0 + + thumb_func_start sub_81C3304 +sub_81C3304: @ 81C3304 + push {lr} + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _081C3354 + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081C3354 + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040be + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _081C333A + cmp r0, 0x4 + beq _081C333A + cmp r0, 0x5 + bne _081C3354 +_081C333A: + movs r0, 0x1 + b _081C3356 + .pool +_081C3354: + movs r0, 0 +_081C3356: + pop {r1} + bx r1 + thumb_func_end sub_81C3304 + + thumb_func_start sub_81C335C +sub_81C335C: @ 81C335C + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x8 + ldr r0, =gUnknown_0861CCCC + movs r1, 0 + bl sub_81C2D2C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_085EA365 + mov r8, r0 + movs r0, 0x1 + mov r1, r8 + movs r2, 0 + bl GetStringWidth + adds r5, r0, 0 + movs r0, 0 + mov r9, r0 + str r0, [sp] + movs r6, 0x1 + str r6, [sp, 0x4] + adds r0, r4, 0 + mov r1, r8 + movs r2, 0 + movs r3, 0x1 + bl sub_81C25A4 + ldr r1, =gUnknown_085E8D38 + lsls r5, 24 + lsrs r5, 24 + mov r0, r9 + str r0, [sp] + str r6, [sp, 0x4] + adds r0, r4, 0 + adds r2, r5, 0 + movs r3, 0x1 + bl sub_81C25A4 + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C335C + + thumb_func_start sub_81C33CC +sub_81C33CC: @ 81C33CC + push {r4,r5,lr} + sub sp, 0x8 + ldr r5, =0x02021cc4 + ldr r1, =gUnknown_085E8D59 + adds r0, r5, 0 + bl CopyString + ldr r1, =gUnknown_085E8D38 + adds r0, r5, 0 + bl AppendString + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x38 + bl GetStringRightAlignXOffset + adds r4, r0, 0 + ldr r0, =gUnknown_0861CCCC + movs r1, 0x1 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsrs r4, 24 + movs r1, 0 + str r1, [sp] + movs r1, 0x1 + str r1, [sp, 0x4] + adds r1, r5, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_81C25A4 + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C33CC + + thumb_func_start sub_81C3428 +sub_81C3428: @ 81C3428 + push {r4,lr} + sub sp, 0x8 + ldr r0, =0x0203cf1c + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0x70 + adds r0, 0xA5 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081C3448 + ldr r4, =gUnknown_085EA40B + b _081C346C + .pool +_081C3448: + ldrh r0, [r1, 0x30] + cmp r0, 0x5 + bhi _081C3458 + ldr r4, =gUnknown_085EA4A2 + b _081C346C + .pool +_081C3458: + cmp r0, 0xA + bhi _081C3464 + ldr r4, =gUnknown_085EA475 + b _081C346C + .pool +_081C3464: + ldr r4, =gUnknown_085EA40B + cmp r0, 0x28 + bhi _081C346C + ldr r4, =gUnknown_085EA442 +_081C346C: + ldr r0, =gUnknown_0861CCCC + movs r1, 0x2 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + str r1, [sp] + str r1, [sp, 0x4] + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_81C25A4 + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C3428 + + thumb_func_start sub_81C349C +sub_81C349C: @ 81C349C + push {r4,lr} + sub sp, 0x8 + ldr r0, =0x0203cf1c + ldr r0, [r0] + adds r4, r0, 0 + adds r4, 0x70 + adds r0, 0xA5 + ldrb r0, [r0] + cmp r0, 0x1 + beq _081C3500 + ldrb r0, [r4, 0x9] + cmp r0, 0xFF + bne _081C34C4 + ldr r4, =gUnknown_085EA678 + b _081C3502 + .pool +_081C34C4: + bl sub_81C32BC + lsls r0, 24 + cmp r0, 0 + beq _081C34D8 + bl sub_81C3220 + lsls r0, 24 + cmp r0, 0 + bne _081C34E0 +_081C34D8: + ldr r4, =gUnknown_085EA6AB + b _081C3502 + .pool +_081C34E0: + ldrb r0, [r4, 0x9] + cmp r0, 0xFD + bne _081C3500 + bl sub_81C32E0 + lsls r0, 24 + lsrs r0, 24 + ldr r4, =gUnknown_085EA702 + cmp r0, 0x1 + bne _081C3502 + ldr r4, =gUnknown_085EA6D7 + b _081C3502 + .pool +_081C3500: + ldr r4, =gUnknown_085EA647 +_081C3502: + ldr r0, =gUnknown_0861CCCC + movs r1, 0x3 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + str r1, [sp] + str r1, [sp, 0x4] + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_81C25A4 + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C349C + + thumb_func_start sub_81C3530 +sub_81C3530: @ 81C3530 + push {lr} + bl sub_81C35E4 + bl sub_81C3690 + bl sub_81C3710 + bl sub_81C37D8 + bl sub_81C3808 + bl sub_81C3890 + bl sub_81C38C0 + pop {r0} + bx r0 + thumb_func_end sub_81C3530 + + thumb_func_start sub_81C3554 +sub_81C3554: @ 81C3554 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + ldrh r0, [r4] + subs r0, 0x1 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + bhi _081C35D6 + lsls r0, 2 + ldr r1, =_081C3584 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081C3584: + .4byte _081C35A4 + .4byte _081C35AA + .4byte _081C35B0 + .4byte _081C35B6 + .4byte _081C35BC + .4byte _081C35C2 + .4byte _081C35C8 + .4byte _081C35CE +_081C35A4: + bl sub_81C35E4 + b _081C35D6 +_081C35AA: + bl sub_81C3690 + b _081C35D6 +_081C35B0: + bl sub_81C3710 + b _081C35D6 +_081C35B6: + bl sub_81C37D8 + b _081C35D6 +_081C35BC: + bl sub_81C3808 + b _081C35D6 +_081C35C2: + bl sub_81C3890 + b _081C35D6 +_081C35C8: + bl sub_81C38C0 + b _081C35D6 +_081C35CE: + adds r0, r2, 0 + bl remove_task + b _081C35DC +_081C35D6: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_081C35DC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81C3554 + + thumb_func_start sub_81C35E4 +sub_81C35E4: @ 81C35E4 + push {r4,r5,lr} + sub sp, 0x8 + ldr r4, =0x0203cf1c + ldr r0, [r4] + adds r0, 0x9E + ldrh r0, [r0] + cmp r0, 0xAF + bne _081C3628 + bl sub_81B1250 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C3628 + ldr r0, [r4] + ldr r1, =0x000040be + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _081C3614 + cmp r0, 0x4 + beq _081C3614 + cmp r0, 0x5 + bne _081C3628 +_081C3614: + movs r0, 0xAF + bl itemid_get_item + adds r5, r0, 0 + b _081C3650 + .pool +_081C3628: + ldr r0, =0x0203cf1c + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0x9E + ldrh r0, [r1] + cmp r0, 0 + bne _081C3644 + ldr r5, =gUnknown_085E8D26 + b _081C3650 + .pool +_081C3644: + ldrh r0, [r1] + ldr r4, =0x02021cc4 + adds r1, r4, 0 + bl itemid_get_name + adds r5, r4, 0 +_081C3650: + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x48 + bl GetStringCenterAlignXOffset + adds r4, r0, 0 + adds r4, 0x6 + ldr r0, =gUnknown_0861CCEC + movs r1, 0 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsrs r4, 24 + movs r1, 0 + str r1, [sp] + str r1, [sp, 0x4] + adds r1, r5, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_81C25A4 + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C35E4 + + thumb_func_start sub_81C3690 +sub_81C3690: @ 81C3690 + push {r4,r5,lr} + sub sp, 0x8 + ldr r0, =0x0203cf1c + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0x76 + ldrb r0, [r1] + cmp r0, 0 + bne _081C36B0 + ldr r5, =gUnknown_085E8D26 + b _081C36C8 + .pool +_081C36B0: + ldr r0, =0x02021cc4 + ldrb r1, [r1] + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EA3B4 + adds r0, r4, 0 + bl ExpandStringRefs + adds r5, r4, 0 +_081C36C8: + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x46 + bl GetStringCenterAlignXOffset + adds r4, r0, 0 + adds r4, 0x6 + ldr r0, =gUnknown_0861CCEC + movs r1, 0x1 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsrs r4, 24 + movs r1, 0 + str r1, [sp] + str r1, [sp, 0x4] + adds r1, r5, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_81C25A4 + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C3690 + + thumb_func_start sub_81C3710 +sub_81C3710: @ 81C3710 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + movs r0, 0x8 + bl Alloc + mov r9, r0 + movs r0, 0x8 + bl Alloc + mov r8, r0 + movs r0, 0x8 + bl Alloc + adds r6, r0, 0 + movs r0, 0x8 + bl Alloc + adds r5, r0, 0 + ldr r4, =0x0203cf1c + ldr r0, [r4] + adds r0, 0x90 + ldrh r1, [r0] + mov r0, r9 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r0, [r4] + adds r0, 0x92 + ldrh r1, [r0] + mov r0, r8 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r0, [r4] + adds r0, 0x94 + ldrh r1, [r0] + adds r0, r6, 0 + movs r2, 0x1 + movs r3, 0x7 + bl ConvertIntToDecimalString + ldr r0, [r4] + adds r0, 0x96 + ldrh r1, [r0] + adds r0, r5, 0 + movs r2, 0x1 + movs r3, 0x7 + bl ConvertIntToDecimalString + bl sub_81AFBF0 + movs r0, 0 + mov r1, r9 + bl sub_81AFC0C + movs r0, 0x1 + mov r1, r8 + bl sub_81AFC0C + movs r0, 0x2 + adds r1, r6, 0 + bl sub_81AFC0C + movs r0, 0x3 + adds r1, r5, 0 + bl sub_81AFC0C + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_0861CE82 + bl sub_81AFC28 + mov r0, r9 + bl Free + mov r0, r8 + bl Free + adds r0, r6, 0 + bl Free + adds r0, r5, 0 + bl Free + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C3710 + + thumb_func_start sub_81C37D8 +sub_81C37D8: @ 81C37D8 + push {lr} + sub sp, 0x8 + ldr r0, =gUnknown_0861CCEC + movs r1, 0x2 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02021fc4 + movs r2, 0 + str r2, [sp] + str r2, [sp, 0x4] + movs r2, 0x4 + movs r3, 0x1 + bl sub_81C25A4 + add sp, 0x8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C37D8 + + thumb_func_start sub_81C3808 +sub_81C3808: @ 81C3808 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, =0x02021cc4 + mov r8, r0 + ldr r4, =0x0203cf1c + ldr r0, [r4] + adds r0, 0x98 + ldrh r1, [r0] + mov r0, r8 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r6, =0x02021dc4 + ldr r0, [r4] + adds r0, 0x9A + ldrh r1, [r0] + adds r0, r6, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r5, =0x02021ec4 + ldr r0, [r4] + adds r0, 0x9C + ldrh r1, [r0] + adds r0, r5, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + bl sub_81AFBF0 + movs r0, 0 + mov r1, r8 + bl sub_81AFC0C + movs r0, 0x1 + adds r1, r6, 0 + bl sub_81AFC0C + movs r0, 0x2 + adds r1, r5, 0 + bl sub_81AFC0C + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_0861CE8E + bl sub_81AFC28 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C3808 + + thumb_func_start sub_81C3890 +sub_81C3890: @ 81C3890 + push {lr} + sub sp, 0x8 + ldr r0, =gUnknown_0861CCEC + movs r1, 0x3 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02021fc4 + movs r2, 0 + str r2, [sp] + str r2, [sp, 0x4] + movs r2, 0x2 + movs r3, 0x1 + bl sub_81C25A4 + add sp, 0x8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C3890 + + thumb_func_start sub_81C38C0 +sub_81C38C0: @ 81C38C0 + push {r4-r6,lr} + sub sp, 0x8 + ldr r0, =0x0203cf1c + ldr r0, [r0] + adds r5, r0, 0 + adds r5, 0x70 + ldr r0, =gUnknown_0861CCEC + movs r1, 0x4 + bl sub_81C2D2C + lsls r0, 24 + lsrs r6, r0, 24 + ldr r4, =0x02021cc4 + ldr r1, [r5, 0x10] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x7 + bl ConvertIntToDecimalString + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x2A + bl GetStringRightAlignXOffset + adds r0, 0x2 + lsls r2, r0, 24 + lsrs r2, 24 + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + adds r0, r6, 0 + adds r1, r4, 0 + movs r3, 0x1 + bl sub_81C25A4 + ldrb r0, [r5, 0x5] + cmp r0, 0x63 + bhi _081C3948 + ldr r4, =gExperienceTables + adds r1, r0, 0 + adds r1, 0x1 + lsls r1, 2 + ldr r3, =gBaseStats + ldrh r2, [r5] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r3 + ldrb r2, [r0, 0x13] + movs r0, 0xCA + lsls r0, 1 + muls r0, r2 + adds r1, r0 + adds r1, r4 + ldr r1, [r1] + ldr r0, [r5, 0x10] + subs r1, r0 + b _081C394A + .pool +_081C3948: + movs r1, 0 +_081C394A: + ldr r4, =0x02021cc4 + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x6 + bl ConvertIntToDecimalString + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x2A + bl GetStringRightAlignXOffset + adds r0, 0x2 + lsls r2, r0, 24 + lsrs r2, 24 + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + adds r0, r6, 0 + adds r1, r4, 0 + movs r3, 0x11 + bl sub_81C25A4 + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C38C0 + + thumb_func_start sub_81C3984 +sub_81C3984: @ 81C3984 + push {r4,lr} + movs r0, 0 + bl sub_81C3B08 + movs r0, 0x1 + bl sub_81C3B08 + movs r0, 0x2 + bl sub_81C3B08 + movs r0, 0x3 + bl sub_81C3B08 + ldr r4, =0x0203cf1c + ldr r0, [r4] + ldr r1, =0x000040bc + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C39EA + bl sub_81C3F44 + ldr r1, [r4] + ldr r0, =0x000040c6 + adds r2, r1, r0 + ldrb r0, [r2] + cmp r0, 0x4 + bne _081C39DC + ldr r0, =0x000040c4 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _081C39EA + bl sub_81C3E9C + b _081C39EA + .pool +_081C39DC: + ldrb r0, [r2] + lsls r0, 1 + adds r1, 0x84 + adds r1, r0 + ldrh r0, [r1] + bl sub_81C3E9C +_081C39EA: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81C3984 + + thumb_func_start sub_81C39F0 +sub_81C39F0: @ 81C39F0 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + ldrh r0, [r4] + subs r0, 0x1 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + bhi _081C3AFC + lsls r0, 2 + ldr r1, =_081C3A20 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081C3A20: + .4byte _081C3A40 + .4byte _081C3A48 + .4byte _081C3A50 + .4byte _081C3A58 + .4byte _081C3A60 + .4byte _081C3A7C + .4byte _081C3ABE + .4byte _081C3AF4 +_081C3A40: + movs r0, 0 + bl sub_81C3B08 + b _081C3AFC +_081C3A48: + movs r0, 0x1 + bl sub_81C3B08 + b _081C3AFC +_081C3A50: + movs r0, 0x2 + bl sub_81C3B08 + b _081C3AFC +_081C3A58: + movs r0, 0x3 + bl sub_81C3B08 + b _081C3AFC +_081C3A60: + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040bc + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C3AFC + bl sub_81C3F44 + b _081C3AFC + .pool +_081C3A7C: + ldr r0, =0x0203cf1c + ldr r1, [r0] + ldr r2, =0x000040bc + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C3AFC + ldr r0, =0x000040c6 + adds r2, r1, r0 + ldrb r0, [r2] + cmp r0, 0x4 + bne _081C3AB0 + ldr r2, =0x000040c4 + adds r0, r1, r2 + ldrh r0, [r0] + strh r0, [r4, 0x2] + b _081C3AFC + .pool +_081C3AB0: + ldrb r0, [r2] + lsls r0, 1 + adds r1, 0x84 + adds r1, r0 + ldrh r0, [r1] + strh r0, [r4, 0x2] + b _081C3AFC +_081C3ABE: + ldr r0, =0x0203cf1c + ldr r1, [r0] + ldr r2, =0x000040bc + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C3AFC + adds r2, 0x8 + adds r0, r1, r2 + ldr r0, [r0] + ldr r1, =0x00ffffff + ands r0, r1 + movs r1, 0x80 + lsls r1, 11 + cmp r0, r1 + beq _081C3AFC + ldrh r0, [r4, 0x2] + bl sub_81C3E9C + b _081C3AFC + .pool +_081C3AF4: + adds r0, r2, 0 + bl remove_task + b _081C3B02 +_081C3AFC: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_081C3B02: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81C39F0 + + thumb_func_start sub_81C3B08 +sub_81C3B08: @ 81C3B08 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x0203cf1c + ldr r0, [r0] + mov r10, r0 + ldr r4, =gUnknown_0861CD14 + adds r0, r4, 0 + movs r1, 0 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] + lsls r1, r7, 1 + mov r0, r10 + adds r0, 0x84 + adds r0, r1 + ldrh r5, [r0] + cmp r5, 0 + beq _081C3C00 + mov r0, r10 + adds r0, 0xA4 + ldrb r1, [r0] + adds r0, r5, 0 + adds r2, r7, 0 + bl CalcPPWithPPUps + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + movs r0, 0xD + adds r1, r5, 0 + muls r1, r0 + ldr r0, =gMoveNames + adds r1, r0 + lsls r0, r7, 4 + mov r9, r0 + mov r3, r9 + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + mov r0, r8 + movs r2, 0 + bl sub_81C25A4 + ldr r0, =0x02021cc4 + mov r8, r0 + mov r5, r10 + adds r5, 0x8C + adds r5, r7 + ldrb r1, [r5] + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r4, =0x02021dc4 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalString + bl sub_81AFBF0 + movs r0, 0 + mov r1, r8 + bl sub_81AFC0C + movs r0, 0x1 + adds r1, r4, 0 + bl sub_81AFC0C + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_0861CE97 + adds r0, r4, 0 + bl sub_81AFC28 + adds r7, r4, 0 + ldrb r0, [r5] + adds r1, r6, 0 + bl sub_814FC20 + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + adds r5, 0x9 + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x2C + bl GetStringRightAlignXOffset + mov r4, r9 + b _081C3C26 + .pool +_081C3C00: + ldr r1, =gUnknown_085E8D40 + lsls r4, r7, 4 + adds r3, r4, 0x1 + lsls r3, 24 + lsrs r3, 24 + str r5, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + mov r0, r8 + movs r2, 0 + bl sub_81C25A4 + ldr r7, =gUnknown_085E8D42 + movs r5, 0xC + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x2C + bl GetStringCenterAlignXOffset +_081C3C26: + lsls r2, r0, 24 + lsrs r2, 24 + adds r3, r4, 0x1 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0 + str r0, [sp] + lsls r0, r5, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + ldr r0, [sp, 0x8] + adds r1, r7, 0 + bl sub_81C25A4 + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C3B08 + + thumb_func_start sub_81C3C5C +sub_81C3C5C: @ 81C3C5C + push {r4-r6,lr} + sub sp, 0x8 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + beq _081C3CFC + movs r0, 0x13 + str r0, [sp] + movs r0, 0x20 + str r0, [sp, 0x4] + movs r0, 0xE + movs r1, 0 + movs r2, 0x35 + movs r3, 0 + bl FillWindowPixelRect + ldr r2, =gBattleMoves + lsls r1, r5, 1 + adds r0, r1, r5 + lsls r0, 2 + adds r2, r0, r2 + ldrb r0, [r2, 0x1] + adds r6, r1, 0 + cmp r0, 0x1 + bhi _081C3C9C + ldr r1, =gUnknown_085E8D45 + b _081C3CAC + .pool +_081C3C9C: + ldr r4, =0x02021cc4 + ldrb r1, [r2, 0x1] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + adds r1, r4, 0 +_081C3CAC: + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0xE + movs r2, 0x35 + movs r3, 0x1 + bl sub_81C25A4 + ldr r1, =gBattleMoves + adds r0, r6, r5 + lsls r0, 2 + adds r1, r0, r1 + ldrb r0, [r1, 0x3] + cmp r0, 0 + bne _081C3CDC + ldr r1, =gUnknown_085E8D45 + b _081C3CEC + .pool +_081C3CDC: + ldr r4, =0x02021cc4 + ldrb r1, [r1, 0x3] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + adds r1, r4, 0 +_081C3CEC: + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0xE + movs r2, 0x35 + movs r3, 0x11 + bl sub_81C25A4 +_081C3CFC: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C3C5C + + thumb_func_start sub_81C3D08 +sub_81C3D08: @ 81C3D08 + push {r4,lr} + movs r0, 0 + bl sub_81C3B08 + movs r0, 0x1 + bl sub_81C3B08 + movs r0, 0x2 + bl sub_81C3B08 + movs r0, 0x3 + bl sub_81C3B08 + ldr r4, =0x0203cf1c + ldr r0, [r4] + ldr r1, =0x000040bc + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C3D40 + bl sub_81C3F44 + ldr r0, [r4] + ldr r1, =0x000040c6 + adds r0, r1 + ldrb r0, [r0] + bl sub_81C3E2C +_081C3D40: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C3D08 + + thumb_func_start sub_81C3D54 +sub_81C3D54: @ 81C3D54 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + ldrh r0, [r4] + subs r0, 0x1 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + bhi _081C3E20 + lsls r0, 2 + ldr r1, =_081C3D84 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081C3D84: + .4byte _081C3DA0 + .4byte _081C3DA8 + .4byte _081C3DB0 + .4byte _081C3DB8 + .4byte _081C3DC0 + .4byte _081C3DDC + .4byte _081C3E18 +_081C3DA0: + movs r0, 0 + bl sub_81C3B08 + b _081C3E20 +_081C3DA8: + movs r0, 0x1 + bl sub_81C3B08 + b _081C3E20 +_081C3DB0: + movs r0, 0x2 + bl sub_81C3B08 + b _081C3E20 +_081C3DB8: + movs r0, 0x3 + bl sub_81C3B08 + b _081C3E20 +_081C3DC0: + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040bc + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C3E20 + bl sub_81C3F44 + b _081C3E20 + .pool +_081C3DDC: + ldr r0, =0x0203cf1c + ldr r2, [r0] + ldr r1, =0x000040bc + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x3 + bne _081C3E20 + adds r1, 0x8 + adds r0, r2, r1 + ldr r0, [r0] + ldr r1, =0x00ffffff + ands r0, r1 + movs r1, 0x80 + lsls r1, 11 + cmp r0, r1 + beq _081C3E20 + ldr r1, =0x000040c6 + adds r0, r2, r1 + ldrb r0, [r0] + bl sub_81C3E2C + b _081C3E20 + .pool +_081C3E18: + adds r0, r2, 0 + bl remove_task + b _081C3E26 +_081C3E20: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_081C3E26: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81C3D54 + + thumb_func_start sub_81C3E2C +sub_81C3E2C: @ 81C3E2C + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x4 + bne _081C3E48 + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040c4 + b _081C3E50 + .pool +_081C3E48: + ldr r0, =0x0203cf1c + ldr r0, [r0] + lsls r1, 1 + adds r0, 0x84 +_081C3E50: + adds r0, r1 + ldrh r4, [r0] + cmp r4, 0 + beq _081C3E82 + ldr r0, =gUnknown_0861CD14 + movs r1, 0x2 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + ldr r3, =gContestEffectDescriptionPointers + ldr r2, =gContestMoves + lsls r1, r4, 3 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + movs r2, 0 + str r2, [sp] + str r2, [sp, 0x4] + movs r2, 0x6 + movs r3, 0x1 + bl sub_81C25A4 +_081C3E82: + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C3E2C + + thumb_func_start sub_81C3E9C +sub_81C3E9C: @ 81C3E9C + push {r4-r6,lr} + sub sp, 0x8 + lsls r0, 16 + lsrs r4, r0, 16 + adds r6, r4, 0 + ldr r0, =gUnknown_0861CD14 + movs r1, 0x2 + bl sub_81C2D2C + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + movs r1, 0 + bl FillWindowPixelBuffer + cmp r4, 0 + beq _081C3F30 + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040c0 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x2 + bne _081C3F00 + adds r0, r4, 0 + bl sub_81C3C5C + ldr r1, =gMoveDescriptionPointers + subs r0, r4, 0x1 + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + adds r0, r5, 0 + movs r2, 0x6 + movs r3, 0x1 + bl sub_81C25A4 + b _081C3F20 + .pool +_081C3F00: + ldr r2, =gContestEffectDescriptionPointers + ldr r1, =gContestMoves + lsls r0, r6, 3 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r2 + ldr r1, [r0] + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + adds r0, r5, 0 + movs r2, 0x6 + movs r3, 0x1 + bl sub_81C25A4 +_081C3F20: + adds r0, r5, 0 + bl PutWindowTilemap + b _081C3F36 + .pool +_081C3F30: + adds r0, r5, 0 + bl ClearWindowTilemap +_081C3F36: + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81C3E9C + + thumb_func_start sub_81C3F44 +sub_81C3F44: @ 81C3F44 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + ldr r4, =gUnknown_0861CD14 + adds r0, r4, 0 + movs r1, 0 + bl sub_81C2D2C + lsls r0, 24 + lsrs r6, r0, 24 + adds r7, r6, 0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81C2D2C + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, =0x0203cf1c + ldr r1, [r0] + ldr r2, =0x000040c4 + adds r0, r1, r2 + ldrh r2, [r0] + cmp r2, 0 + bne _081C3F9C + ldr r1, =gUnknown_085E8CF0 + str r2, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + adds r0, r6, 0 + movs r2, 0 + movs r3, 0x41 + bl sub_81C25A4 + b _081C4044 + .pool +_081C3F9C: + ldrh r5, [r0] + ldr r2, =0x000040c0 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x2 + bne _081C3FD0 + movs r0, 0xD + adds r1, r5, 0 + muls r1, r0 + ldr r0, =gMoveNames + adds r1, r0 + movs r0, 0 + str r0, [sp] + movs r0, 0x6 + str r0, [sp, 0x4] + adds r0, r6, 0 + movs r2, 0 + movs r3, 0x41 + bl sub_81C25A4 + b _081C3FEC + .pool +_081C3FD0: + movs r0, 0xD + adds r1, r5, 0 + muls r1, r0 + ldr r0, =gMoveNames + adds r1, r0 + movs r0, 0 + str r0, [sp] + movs r0, 0x5 + str r0, [sp, 0x4] + adds r0, r7, 0 + movs r2, 0 + movs r3, 0x41 + bl sub_81C25A4 +_081C3FEC: + ldr r4, =0x02021cc4 + ldr r1, =gBattleMoves + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x4] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalString + bl sub_81AFBF0 + movs r0, 0 + adds r1, r4, 0 + bl sub_81AFC0C + movs r0, 0x1 + adds r1, r4, 0 + bl sub_81AFC0C + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_0861CE97 + adds r0, r4, 0 + bl sub_81AFC28 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x2C + bl GetStringRightAlignXOffset + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0 + str r0, [sp] + movs r0, 0xC + str r0, [sp, 0x4] + mov r0, r8 + adds r1, r4, 0 + movs r3, 0x41 + bl sub_81C25A4 +_081C4044: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C3F44 + + thumb_func_start sub_81C4064 +sub_81C4064: @ 81C4064 + push {r4,lr} + sub sp, 0x8 + ldr r0, =gUnknown_0861CD14 + movs r1, 0 + bl sub_81C2D2C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x48 + str r0, [sp] + movs r0, 0x10 + str r0, [sp, 0x4] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x42 + bl FillWindowPixelRect + adds r0, r4, 0 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4064 + + thumb_func_start sub_81C40A0 +sub_81C40A0: @ 81C40A0 + 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 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + mov r0, r10 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r5, =gUnknown_0861CD14 + adds r0, r5, 0 + movs r1, 0 + bl sub_81C2D2C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81C2D2C + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + mov r0, r9 + lsls r6, r0, 4 + movs r0, 0x48 + mov r8, r0 + str r0, [sp] + movs r0, 0x10 + str r0, [sp, 0x4] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + adds r3, r6, 0 + bl FillWindowPixelRect + mov r0, r10 + lsls r7, r0, 4 + mov r0, r8 + str r0, [sp] + movs r0, 0x10 + str r0, [sp, 0x4] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + adds r3, r7, 0 + bl FillWindowPixelRect + movs r4, 0x30 + str r4, [sp] + movs r0, 0x10 + str r0, [sp, 0x4] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0 + adds r3, r6, 0 + bl FillWindowPixelRect + str r4, [sp] + movs r0, 0x10 + str r0, [sp, 0x4] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0 + adds r3, r7, 0 + bl FillWindowPixelRect + mov r0, r9 + bl sub_81C3B08 + mov r0, r10 + bl sub_81C3B08 + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C40A0 + + thumb_func_start sub_81C4154 +sub_81C4154: @ 81C4154 + push {r4,lr} + sub sp, 0x8 + ldr r0, =gUnknown_0861CD14 + movs r1, 0x2 + bl sub_81C2D2C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r1, =gUnknown_085EA4CB + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + adds r0, r4, 0 + movs r2, 0x6 + movs r3, 0x1 + bl sub_81C25A4 + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4154 + + thumb_func_start sub_81C4190 +sub_81C4190: @ 81C4190 + push {r4,r5,lr} + movs r2, 0 + ldr r5, =0x0203cf1c + ldr r4, =0x000040d3 + movs r3, 0xFF +_081C419A: + ldr r0, [r5] + adds r0, r4 + adds r0, r2 + ldrb r1, [r0] + orrs r1, r3 + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x1B + bls _081C419A + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4190 + + thumb_func_start sub_81C41C0 +sub_81C41C0: @ 81C41C0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r5, =0x0203cf1c + ldr r0, [r5] + ldr r1, =0x000040d3 + adds r0, r1 + adds r1, r0, r4 + ldrb r0, [r1] + cmp r0, 0xFF + beq _081C41F2 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + ldr r0, [r5] + ldr r1, =0x000040d3 + adds r0, r1 + adds r0, r4 + movs r1, 0xFF + strb r1, [r0] +_081C41F2: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C41C0 + + thumb_func_start sub_81C4204 +sub_81C4204: @ 81C4204 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =0x02020630 + ldr r2, =0x0203cf1c + ldr r2, [r2] + ldr r4, =0x000040d3 + adds r2, r4 + adds r2, r0 + ldrb r0, [r2] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + adds r2, 0x3E + movs r0, 0x1 + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4204 + + thumb_func_start sub_81C424C +sub_81C424C: @ 81C424C + push {r4,lr} + movs r4, 0x3 +_081C4250: + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040d3 + adds r0, r1 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0xFF + beq _081C4268 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81C4204 +_081C4268: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1B + bls _081C4250 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C424C + + thumb_func_start sub_81C4280 +sub_81C4280: @ 81C4280 + push {lr} + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040c0 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x2 + beq _081C42B0 + cmp r0, 0x2 + bgt _081C42A4 + cmp r0, 0 + beq _081C42AA + b _081C42C2 + .pool +_081C42A4: + cmp r0, 0x3 + beq _081C42BA + b _081C42C2 +_081C42AA: + bl sub_81C43A0 + b _081C42C2 +_081C42B0: + bl sub_81C4420 + bl sub_81C44F0 + b _081C42C2 +_081C42BA: + bl sub_81C4484 + bl sub_81C44F0 +_081C42C2: + pop {r0} + bx r0 + thumb_func_end sub_81C4280 + + thumb_func_start sub_81C42C8 +sub_81C42C8: @ 81C42C8 + push {r4,r5,lr} + movs r4, 0x3 + ldr r5, =0x0203cf1c +_081C42CE: + ldr r0, [r5] + ldr r1, =0x000040d3 + adds r0, r1 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0xFF + bne _081C42F2 + ldr r0, =gUnknown_0861CFC4 + movs r1, 0 + movs r2, 0 + movs r3, 0x2 + bl AddObjectToFront + ldr r1, [r5] + ldr r2, =0x000040d3 + adds r1, r2 + adds r1, r4 + strb r0, [r1] +_081C42F2: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81C4204 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _081C42CE + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C42C8 + + thumb_func_start sub_81C4318 +sub_81C4318: @ 81C4318 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + mov r8, r2 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040d3 + adds r0, r1 + adds r0, r3 + ldrb r0, [r0] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + adds r0, r4, 0 + adds r1, r5, 0 + str r3, [sp] + bl StartObjectImageAnim + ldr r0, =gUnknown_0861CFDC + adds r5, r0 + ldrb r1, [r5] + lsls r1, 4 + ldrb r2, [r4, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x5] + adds r6, 0x10 + strh r6, [r4, 0x20] + movs r0, 0x8 + add r8, r0 + mov r1, r8 + strh r1, [r4, 0x22] + ldr r3, [sp] + adds r0, r3, 0 + movs r1, 0 + bl sub_81C4204 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4318 + + thumb_func_start sub_81C43A0 +sub_81C43A0: @ 81C43A0 + push {r4,r5,lr} + ldr r0, =0x0203cf1c + ldr r0, [r0] + adds r5, r0, 0 + adds r5, 0x70 + ldrb r0, [r5, 0x4] + cmp r0, 0 + beq _081C43CC + movs r0, 0x9 + movs r1, 0x78 + movs r2, 0x30 + movs r3, 0x3 + bl sub_81C4318 + movs r0, 0x4 + movs r1, 0x1 + bl sub_81C4204 + b _081C4418 + .pool +_081C43CC: + ldr r4, =gBaseStats + ldrh r1, [r5] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x6] + movs r1, 0x78 + movs r2, 0x30 + movs r3, 0x3 + bl sub_81C4318 + ldrh r1, [r5] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r1, r0, r4 + ldrb r0, [r1, 0x6] + ldrb r2, [r1, 0x7] + cmp r0, r2 + beq _081C4410 + ldrb r0, [r1, 0x7] + movs r1, 0xA0 + movs r2, 0x30 + movs r3, 0x4 + bl sub_81C4318 + movs r0, 0x4 + movs r1, 0 + bl sub_81C4204 + b _081C4418 + .pool +_081C4410: + movs r0, 0x4 + movs r1, 0x1 + bl sub_81C4204 +_081C4418: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81C43A0 + + thumb_func_start sub_81C4420 +sub_81C4420: @ 81C4420 + push {r4-r6,lr} + ldr r0, =0x0203cf1c + ldr r0, [r0] + adds r5, r0, 0 + adds r5, 0x70 + movs r4, 0 + ldr r6, =gBattleMoves +_081C442E: + lsls r0, r4, 1 + adds r1, r5, 0 + adds r1, 0x14 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _081C4468 + adds r1, r0, 0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x2] + lsls r2, r4, 28 + movs r1, 0x80 + lsls r1, 22 + adds r2, r1 + lsrs r2, 24 + adds r3, r4, 0x3 + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x55 + bl sub_81C4318 + b _081C4474 + .pool +_081C4468: + adds r0, r4, 0x3 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_81C4204 +_081C4474: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081C442E + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81C4420 + + thumb_func_start sub_81C4484 +sub_81C4484: @ 81C4484 + push {r4,r5,lr} + ldr r0, =0x0203cf1c + ldr r0, [r0] + adds r5, r0, 0 + adds r5, 0x70 + movs r4, 0 +_081C4490: + lsls r0, r4, 1 + adds r1, r5, 0 + adds r1, 0x14 + adds r2, r1, r0 + ldrh r0, [r2] + cmp r0, 0 + beq _081C44D4 + ldr r1, =gContestMoves + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0, 0x1] + lsls r0, 29 + lsrs r0, 5 + movs r1, 0x90 + lsls r1, 21 + adds r0, r1 + lsrs r0, 24 + lsls r2, r4, 28 + movs r1, 0x80 + lsls r1, 22 + adds r2, r1 + lsrs r2, 24 + adds r3, r4, 0x3 + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x55 + bl sub_81C4318 + b _081C44E0 + .pool +_081C44D4: + adds r0, r4, 0x3 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_81C4204 +_081C44E0: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081C4490 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81C4484 + + thumb_func_start sub_81C44F0 +sub_81C44F0: @ 81C44F0 + push {lr} + ldr r0, =0x0203cf1c + ldr r1, [r0] + ldr r0, =0x000040c4 + adds r3, r1, r0 + ldrh r0, [r3] + cmp r0, 0 + bne _081C4514 + movs r0, 0x7 + movs r1, 0x1 + bl sub_81C4204 + b _081C4560 + .pool +_081C4514: + ldr r2, =0x000040c0 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x2 + bne _081C4540 + ldr r2, =gBattleMoves + ldrh r1, [r3] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x2] + movs r1, 0x55 + movs r2, 0x60 + movs r3, 0x7 + bl sub_81C4318 + b _081C4560 + .pool +_081C4540: + ldr r1, =gContestMoves + ldrh r0, [r3] + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0, 0x1] + lsls r0, 29 + lsrs r0, 5 + movs r1, 0x90 + lsls r1, 21 + adds r0, r1 + lsrs r0, 24 + movs r1, 0x55 + movs r2, 0x60 + movs r3, 0x7 + bl sub_81C4318 +_081C4560: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C44F0 + + thumb_func_start sub_81C4568 +sub_81C4568: @ 81C4568 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =0x0203cf1c + ldr r2, [r2] + adds r0, 0x3 + ldr r3, =0x000040d3 + adds r2, r3 + adds r0, r2, r0 + ldrb r0, [r0] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r5, =0x02020630 + adds r4, r5 + adds r1, 0x3 + adds r2, r1 + ldrb r0, [r2] + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + adds r3, r5 + adds r5, r4, 0 + adds r5, 0x2A + ldrb r1, [r5] + adds r2, r3, 0 + adds r2, 0x2A + ldrb r0, [r2] + strb r0, [r5] + strb r1, [r2] + ldrb r6, [r4, 0x5] + lsrs r5, r6, 4 + ldrb r2, [r3, 0x5] + lsrs r2, 4 + lsls r2, 4 + movs r1, 0xF + adds r0, r1, 0 + ands r0, r6 + orrs r0, r2 + strb r0, [r4, 0x5] + lsls r5, 4 + ldrb r0, [r3, 0x5] + ands r1, r0 + orrs r1, r5 + strb r1, [r3, 0x5] + adds r4, 0x3F + ldrb r0, [r4] + movs r2, 0x4 + orrs r0, r2 + movs r1, 0x11 + negs r1, r1 + ands r0, r1 + strb r0, [r4] + adds r3, 0x3F + ldrb r0, [r3] + orrs r0, r2 + ands r0, r1 + strb r0, [r3] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4568 + + thumb_func_start sub_81C45F4 +sub_81C45F4: @ 81C45F4 + push {r4-r6,lr} + adds r3, r0, 0 + adds r6, r1, 0 + ldr r0, =0x0203cf1c + ldr r2, [r0] + adds r5, r2, 0 + adds r5, 0x70 + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + beq _081C4620 + cmp r0, 0x1 + bne _081C4610 + b _081C4750 +_081C4610: + adds r0, r3, 0 + bl sub_81C47B4 + lsls r0, 24 + lsrs r0, 24 + b _081C4770 + .pool +_081C4620: + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081C4680 + ldr r1, =0x000040be + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x3 + bl sub_80688F8 + lsls r0, 24 + cmp r0, 0 + beq _081C4668 + ldrh r2, [r5, 0x2] + lsls r0, r2, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r1, [r1] + ldr r1, [r1, 0x8] + b _081C46D6 + .pool +_081C4668: + ldrh r2, [r5, 0x2] + lsls r0, r2, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r1, [r1] + b _081C46B0 + .pool +_081C4680: + ldr r0, =0x020244d4 + ldr r3, [r0] + adds r4, r0, 0 + cmp r3, 0 + beq _081C46E4 + ldr r1, [r2] + ldr r0, =0x020244ec + cmp r1, r0 + beq _081C46A6 + ldr r1, =0x000040bc + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x2 + beq _081C46A6 + adds r1, 0x33 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081C46CC +_081C46A6: + ldrh r2, [r5, 0x2] + lsls r0, r2, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + ldr r1, [r4] +_081C46B0: + ldr r1, [r1, 0x8] + ldr r3, [r5, 0xC] + bl DecompressMonPic_DetectFrontOrBack_2 + b _081C4768 + .pool +_081C46CC: + ldrh r2, [r5, 0x2] + lsls r0, r2, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + ldr r1, [r3, 0x8] +_081C46D6: + ldr r3, [r5, 0xC] + bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack + b _081C4768 + .pool +_081C46E4: + ldr r1, [r2] + ldr r0, =0x020244ec + cmp r1, r0 + beq _081C4700 + ldr r1, =0x000040bc + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x2 + beq _081C4700 + adds r1, 0x33 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081C472C +_081C4700: + ldrh r4, [r5, 0x2] + lsls r4, 3 + ldr r0, =gMonFrontPicTable + adds r4, r0 + movs r0, 0 + movs r1, 0x1 + bl sub_806F4F8 + adds r1, r0, 0 + ldrh r2, [r5, 0x2] + ldr r3, [r5, 0xC] + adds r0, r4, 0 + bl DecompressMonPic_DetectFrontOrBack_2 + b _081C4768 + .pool +_081C472C: + ldrh r4, [r5, 0x2] + lsls r4, 3 + ldr r0, =gMonFrontPicTable + adds r4, r0 + movs r0, 0 + movs r1, 0x1 + bl sub_806F4F8 + adds r1, r0, 0 + ldrh r2, [r5, 0x2] + ldr r3, [r5, 0xC] + adds r0, r4, 0 + bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack + b _081C4768 + .pool +_081C4750: + ldrh r0, [r5, 0x2] + ldr r1, [r5, 0x48] + ldr r2, [r5, 0xC] + bl sub_806E7CC + adds r4, r0, 0 + bl LoadCompressedObjectPalette + ldrh r0, [r4, 0x4] + movs r1, 0x1 + bl sub_806A068 +_081C4768: + ldrh r0, [r6] + adds r0, 0x1 + strh r0, [r6] + movs r0, 0xFF +_081C4770: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81C45F4 + + thumb_func_start sub_81C4778 +sub_81C4778: @ 81C4778 + push {r4,lr} + ldr r0, =0x0203cf1c + ldr r1, [r0] + adds r4, r1, 0 + adds r4, 0x70 + ldrb r0, [r4, 0x4] + cmp r0, 0 + bne _081C47AE + adds r0, r1, 0 + adds r0, 0xC + bl sub_805F110 + cmp r0, 0x1 + bne _081C47A4 + ldrh r0, [r4, 0x2] + movs r1, 0 + movs r2, 0 + bl sub_80A32E4 + b _081C47AE + .pool +_081C47A4: + ldrh r0, [r4, 0x2] + movs r1, 0 + movs r2, 0xB + bl sub_80A32E4 +_081C47AE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81C4778 + + thumb_func_start sub_81C47B4 +sub_81C47B4: @ 81C47B4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =0x0203cf1c + ldr r6, [r0] + adds r6, 0x70 + ldr r0, =0x0202499c + movs r1, 0x28 + movs r2, 0x40 + movs r3, 0x5 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r4, r0, 4 + add r4, r8 + lsls r4, 2 + ldr r5, =0x02020630 + adds r7, r4, r5 + adds r0, r7, 0 + bl obj_free_rotscale_entry + ldrh r0, [r6, 0x2] + movs r1, 0 + strh r0, [r7, 0x2E] + strh r1, [r7, 0x32] + adds r5, 0x1C + adds r4, r5 + ldr r0, =sub_81C4844 + str r0, [r4] + ldrb r1, [r7, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + strb r0, [r7, 0x5] + ldrh r0, [r6, 0x2] + bl sub_806E840 + lsls r0, 24 + cmp r0, 0 + bne _081C4828 + adds r0, r7, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] + b _081C4836 + .pool +_081C4828: + adds r2, r7, 0 + adds r2, 0x3F + ldrb r1, [r2] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_081C4836: + mov r0, r8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81C47B4 + + thumb_func_start sub_81C4844 +sub_81C4844: @ 81C4844 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, =0x0203cf1c + ldr r0, [r0] + adds r5, r0, 0 + adds r5, 0x70 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081C487E + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _081C487E + ldrh r0, [r4, 0x2E] + bl sub_806E840 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x30] + bl sub_81C4778 + ldrh r1, [r4, 0x2E] + ldrb r2, [r5, 0x4] + adds r0, r4, 0 + bl sub_806EE0C +_081C487E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4844 + + thumb_func_start sub_81C488C +sub_81C488C: @ 81C488C + ldr r1, =0x0203cf24 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_81C488C + + thumb_func_start sub_81C4898 +sub_81C4898: @ 81C4898 + push {r4,lr} + ldr r4, =0x0203cf24 + ldrb r0, [r4] + cmp r0, 0xFF + beq _081C48AA + bl remove_task + movs r0, 0xFF + strb r0, [r4] +_081C48AA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4898 + + thumb_func_start sub_81C48B4 +sub_81C48B4: @ 81C48B4 + push {lr} + ldr r2, =0x02020630 + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040d3 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + beq _081C48E8 + movs r0, 0x1 + b _081C48EA + .pool +_081C48E8: + movs r0, 0 +_081C48EA: + pop {r1} + bx r1 + thumb_func_end sub_81C48B4 + + thumb_func_start sub_81C48F0 +sub_81C48F0: @ 81C48F0 + push {r4-r6,lr} + ldr r6, =0x02020630 + ldr r5, =0x0203cf1c + ldr r0, [r5] + ldr r4, =0x000040d3 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x2C + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r6, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =DummyObjectCallback + str r1, [r0] + bl sub_806EE98 + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x5] + lsrs r0, 4 + lsls r3, r0, 4 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1, 0 + orrs r3, r0 + movs r2, 0 + ldr r5, =0x02037714 + ldr r4, =0x02037b14 +_081C494C: + adds r0, r2, r3 + lsls r0, 16 + lsrs r0, 15 + adds r1, r0, r5 + adds r0, r4 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0xF + bls _081C494C + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C48F0 + + thumb_func_start sub_81C4984 +sub_81C4984: @ 81C4984 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r1, =0x00007533 + ldr r2, =gUnknown_0861D120 + adds r0, r1, 0 + bl sub_811FF94 + adds r4, r0, 0 + ldr r6, =0x0203cf1c + ldr r0, [r6] + str r4, [r0, 0x8] + cmp r4, 0 + beq _081C49CE + adds r0, r5, 0 + movs r1, 0x8 + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + ldr r1, [r6] + ldr r2, [r1, 0x8] + movs r0, 0x3C + strh r0, [r2, 0x20] + ldr r2, [r1, 0x8] + movs r0, 0x1A + strh r0, [r2, 0x22] + ldr r2, [r1, 0x8] + ldrb r1, [r2, 0x5] + subs r0, 0x27 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0x5] +_081C49CE: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4984 + + thumb_func_start sub_81C49E0 +sub_81C49E0: @ 81C49E0 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r0, [r0, 0x8] + bl RemoveObjectAndFreeTiles + ldr r0, =0x00007533 + bl FreeObjectTilesByTag + adds r0, r4, 0 + bl sub_81C4984 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C49E0 + + thumb_func_start sub_81C4A08 +sub_81C4A08: @ 81C4A08 + push {r4,lr} + movs r1, 0x26 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + bl ball_number_to_ball_processing_index + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_8076A78 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + ldr r1, =gUnknown_0832C588 + adds r0, r1 + movs r1, 0x10 + movs r2, 0x88 + movs r3, 0 + bl AddObjectToFront + ldr r2, =0x0203cf1c + ldr r1, [r2] + ldr r3, =0x000040d4 + adds r1, r3 + strb r0, [r1] + ldr r4, =0x02020630 + ldr r2, [r2] + adds r2, r3 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =DummyObjectCallback + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0, 0x5] + movs r2, 0xC + orrs r1, r2 + strb r1, [r0, 0x5] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4A08 + + thumb_func_start sub_81C4A88 +sub_81C4A88: @ 81C4A88 + push {r4,r5,lr} + ldr r5, =0x0203cf1c + ldr r0, [r5] + ldr r1, =0x000040d5 + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0xFF + bne _081C4AA6 + ldr r0, =gUnknown_0861D108 + movs r1, 0x40 + movs r2, 0x98 + movs r3, 0 + bl AddObjectToFront + strb r0, [r4] +_081C4AA6: + ldr r0, [r5] + adds r0, 0xC + bl sub_81B205C + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _081C4AE8 + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + subs r1, r2, 0x1 + lsls r1, 24 + lsrs r1, 24 + bl StartObjectImageAnim + movs r0, 0x2 + movs r1, 0 + bl sub_81C4204 + b _081C4AF0 + .pool +_081C4AE8: + movs r0, 0x2 + movs r1, 0x1 + bl sub_81C4204 +_081C4AF0: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81C4A88 + + thumb_func_start sub_81C4AF8 +sub_81C4AF8: @ 81C4AF8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, =0x0203cf1c + ldr r1, =0x000040d3 + add r1, r8 + ldr r0, [r0] + adds r7, r0, r1 + ldr r1, =0x000040c0 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bls _081C4BD2 + movs r0, 0 + mov r9, r0 + mov r1, r8 + cmp r1, 0x8 + bne _081C4B2A + movs r0, 0x1 + mov r9, r0 +_081C4B2A: + movs r5, 0 + ldr r6, =0x02020630 + mov r10, r5 +_081C4B30: + lsls r1, r5, 20 + movs r0, 0xB2 + lsls r0, 15 + adds r1, r0 + asrs r1, 16 + ldr r0, =gUnknown_0861D084 + movs r2, 0x28 + mov r3, r9 + bl AddObjectToFront + adds r1, r7, r5 + strb r0, [r1] + adds r4, r1, 0 + cmp r5, 0 + bne _081C4B74 + ldrb r1, [r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x4 + bl StartObjectImageAnim + b _081C4B9A + .pool +_081C4B74: + cmp r5, 0x9 + bne _081C4B8A + ldrb r1, [r7, 0x9] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x5 + bl StartObjectImageAnim + b _081C4B9A +_081C4B8A: + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x6 + bl StartObjectImageAnim +_081C4B9A: + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r6, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_81C4BE4 + str r1, [r0] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + mov r1, r8 + strh r1, [r0, 0x2E] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + mov r1, r10 + strh r1, [r0, 0x30] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x9 + bls _081C4B30 +_081C4BD2: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4AF8 + + thumb_func_start sub_81C4BE4 +sub_81C4BE4: @ 81C4BE4 + push {lr} + adds r3, r0, 0 + adds r0, 0x2A + ldrb r0, [r0] + subs r0, 0x4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bhi _081C4C1C + ldrh r0, [r3, 0x30] + adds r0, 0x1 + movs r1, 0x1F + ands r0, r1 + strh r0, [r3, 0x30] + cmp r0, 0x18 + ble _081C4C10 + adds r2, r3, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + b _081C4C2A +_081C4C10: + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + b _081C4C28 +_081C4C1C: + movs r0, 0 + strh r0, [r3, 0x30] + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + subs r0, 0x5 +_081C4C28: + ands r0, r1 +_081C4C2A: + strb r0, [r2] + movs r1, 0x2E + ldrsh r0, [r3, r1] + cmp r0, 0x8 + bne _081C4C44 + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040c6 + b _081C4C4A + .pool +_081C4C44: + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040c7 +_081C4C4A: + adds r0, r1 + ldrb r0, [r0] + lsls r0, 4 + strh r0, [r3, 0x26] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4BE4 + + thumb_func_start sub_81C4C60 +sub_81C4C60: @ 81C4C60 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 +_081C4C68: + adds r0, r5, r4 + lsls r0, 24 + lsrs r0, 24 + bl sub_81C41C0 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x9 + bls _081C4C68 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81C4C60 + + thumb_func_start sub_81C4C84 +sub_81C4C84: @ 81C4C84 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x0203cf1c + ldr r0, [r0] + ldr r1, =0x000040db + adds r5, r0, r1 + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 24 + movs r4, 0 + ldr r7, =0x02020630 + movs r2, 0x80 + lsls r2, 19 + adds r2, r0 + mov r9, r2 + lsrs r6, r0, 24 + movs r1, 0xA0 + lsls r1, 19 + adds r1, r0 + mov r8, r1 +_081C4CB4: + cmp r4, 0 + bne _081C4CD4 + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + mov r2, r9 + b _081C4CE4 + .pool +_081C4CD4: + cmp r4, 0x9 + bne _081C4CEC + ldrb r1, [r5, 0x9] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + mov r2, r8 +_081C4CE4: + lsrs r1, r2, 24 + bl StartObjectImageAnim + b _081C4D02 +_081C4CEC: + adds r0, r5, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + adds r1, r6, 0x6 + lsls r1, 24 + lsrs r1, 24 + bl StartObjectImageAnim +_081C4D02: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x9 + bls _081C4CB4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81C4C84 + + thumb_func_start sub_81C4D18 +sub_81C4D18: @ 81C4D18 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0203cf1c + ldr r2, =0x000040d3 + adds r0, r2 + ldr r1, [r1] + adds r5, r1, r0 + movs r3, 0 + ldr r4, =0x02020630 + movs r7, 0x5 + negs r7, r7 + movs r6, 0 +_081C4D32: + adds r2, r5, r3 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r6, [r0, 0x30] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + adds r1, 0x3E + ldrb r2, [r1] + adds r0, r7, 0 + ands r0, r2 + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x9 + bls _081C4D32 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4D18 + + thumb_func_start sub_81C4D70 +sub_81C4D70: @ 81C4D70 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + ldr r4, =0x0203cf28 + movs r0, 0x4 + bl Alloc + str r0, [r4] + ldr r1, [r5] + lsls r0, r1, 20 + lsrs r4, r0, 30 + cmp r4, 0 + bne _081C4DDC + lsls r0, r1, 30 + lsrs r0, 30 + movs r1, 0x8 + movs r2, 0 + bl SetBgAttribute + ldr r3, [r5] + lsls r0, r3, 30 + lsrs r0, 30 + ldr r1, =gUnknown_0861D1A0 + lsls r3, 22 + lsrs r3, 24 + str r4, [sp] + movs r2, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r0, [r5] + lsls r0, 30 + lsrs r0, 30 + ldr r1, =gUnknown_0861DEF4 + movs r2, 0x1 + str r2, [sp] + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r1, [r5] + lsls r1, 22 + lsrs r1, 24 + str r4, [sp] + movs r2, 0x20 + movs r3, 0x20 + bl sub_8199D3C + b _081C4E2E + .pool +_081C4DDC: + lsls r0, r1, 30 + lsrs r0, 30 + movs r1, 0x8 + movs r2, 0x2 + bl SetBgAttribute + ldr r0, [r5] + lsls r0, 30 + lsrs r0, 30 + movs r1, 0x9 + movs r2, 0x1 + bl SetBgAttribute + ldr r3, [r5] + lsls r0, r3, 30 + lsrs r0, 30 + ldr r1, =gUnknown_0861E208 + lsls r3, 22 + lsrs r3, 24 + movs r2, 0 + str r2, [sp] + bl decompress_and_copy_tile_data_to_vram + ldr r0, [r5] + lsls r0, 30 + lsrs r0, 30 + ldr r1, =gUnknown_0861EF64 + movs r4, 0x1 + str r4, [sp] + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r1, [r5] + lsls r1, 22 + lsrs r1, 24 + str r4, [sp] + movs r2, 0x40 + movs r3, 0x40 + bl sub_8199D3C +_081C4E2E: + ldr r0, [r5] + lsls r0, 30 + lsrs r0, 30 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + ldr r0, [r5] + lsls r0, 30 + lsrs r0, 30 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + ldr r0, [r5] + lsls r0, 30 + lsrs r0, 30 + movs r1, 0x4 + movs r2, 0x1 + bl SetBgAttribute + ldr r0, =gUnknown_0861D140 + ldr r1, =0x020377f4 + ldr r2, =0x04000018 + bl CpuSet + ldr r0, =0x0203cf28 + ldr r1, [r0] + ldr r0, [r5] + lsls r0, 30 + lsrs r0, 30 + strb r0, [r1] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4D70 + + thumb_func_start sub_81C4E90 +sub_81C4E90: @ 81C4E90 + push {lr} + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + beq _081C4EA0 + movs r0, 0x1 + b _081C4EAC +_081C4EA0: + ldr r0, =0x0203cf28 + ldr r0, [r0] + ldrb r0, [r0] + bl ShowBg + movs r0, 0 +_081C4EAC: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81C4E90 + + thumb_func_start sub_81C4EB4 +sub_81C4EB4: @ 81C4EB4 + push {r4,lr} + ldr r4, =0x0203cf28 + ldr r0, [r4] + cmp r0, 0 + beq _081C4EC6 + bl Free + movs r0, 0 + str r0, [r4] +_081C4EC6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4EB4 + + thumb_func_start sub_81C4ED0 +sub_81C4ED0: @ 81C4ED0 + push {lr} + adds r1, r0, 0 + ldr r0, =0x0203cf28 + ldr r0, [r0] + ldrb r0, [r0] + lsls r1, 8 + movs r2, 0 + bl ChangeBgY + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4ED0 + + thumb_func_start sub_81C4EEC +sub_81C4EEC: @ 81C4EEC + ldr r1, =0x0203cf30 + movs r0, 0 + strh r0, [r1, 0x6] + strh r0, [r1, 0x8] + bx lr + .pool + thumb_func_end sub_81C4EEC + + thumb_func_start sub_81C4EFC +sub_81C4EFC: @ 81C4EFC + push {lr} + ldr r1, =sub_8086194 + movs r0, 0 + bl sub_81C4F98 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4EFC + + thumb_func_start sub_81C4F10 +sub_81C4F10: @ 81C4F10 + push {lr} + ldr r1, =sub_8059D50 + movs r0, 0x1 + bl sub_81C4F98 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4F10 + + thumb_func_start sub_81C4F24 +sub_81C4F24: @ 81C4F24 + push {lr} + bl script_env_2_enable + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r0, =sub_81C4F44 + movs r1, 0xA + bl AddTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4F24 + + thumb_func_start sub_81C4F44 +sub_81C4F44: @ 81C4F44 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081C4F6E + bl overworld_free_bg_tilemaps + ldr r0, =0x03005db0 + ldr r1, =hm_add_c3_without_phase_2 + str r1, [r0] + ldr r1, =c2_exit_to_overworld_2_switch + movs r0, 0x3 + bl sub_81C4F98 + adds r0, r4, 0 + bl remove_task +_081C4F6E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4F44 + + thumb_func_start sub_81C4F84 +sub_81C4F84: @ 81C4F84 + push {lr} + ldr r0, =0x0203cf30 + ldr r1, [r0] + movs r0, 0x4 + bl sub_81C4F98 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4F84 + + thumb_func_start sub_81C4F98 +sub_81C4F98: @ 81C4F98 + push {r4-r6,lr} + adds r5, r1, 0 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r6, =0x0203cf2c + ldr r0, =0x0000098c + bl AllocZeroed + str r0, [r6] + cmp r4, 0x4 + beq _081C4FB2 + ldr r0, =0x0203cf30 + strb r4, [r0, 0x4] +_081C4FB2: + cmp r5, 0 + beq _081C4FBA + ldr r0, =0x0203cf30 + str r5, [r0] +_081C4FBA: + ldr r0, [r6] + movs r1, 0 + str r1, [r0] + ldr r1, =0x00000814 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r6] + ldr r1, =0x00000816 + adds r0, r1 + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + ldr r0, [r6] + ldr r1, =0x00000804 + adds r0, r1 + movs r1, 0xFF + movs r2, 0xB + bl memset + ldr r0, [r6] + ldr r1, =0x0000080f + adds r0, r1 + movs r1, 0xFF + movs r2, 0x5 + bl memset + ldr r0, =sub_81C504C + bl SetMainCallback2 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C4F98 + + thumb_func_start sub_81C501C +sub_81C501C: @ 81C501C + push {lr} + bl RunActiveTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl do_scheduled_bg_tilemap_copies_to_vram + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_81C501C + + thumb_func_start sub_81C5038 +sub_81C5038: @ 81C5038 + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_81C5038 + + thumb_func_start sub_81C504C +sub_81C504C: @ 81C504C + push {lr} +_081C504E: + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C5072 + bl sub_81C5078 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C5072 + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C504E +_081C5072: + pop {r0} + bx r0 + thumb_func_end sub_81C504C + + thumb_func_start sub_81C5078 +sub_81C5078: @ 81C5078 + push {lr} + sub sp, 0x4 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x10 + bls _081C508C + b _081C51BC +_081C508C: + lsls r0, 2 + ldr r1, =_081C50A0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081C50A0: + .4byte _081C50E4 + .4byte _081C50EE + .4byte _081C50F4 + .4byte _081C50FA + .4byte _081C510C + .4byte _081C5112 + .4byte _081C5122 + .4byte _081C513C + .4byte _081C5148 + .4byte _081C514E + .4byte _081C515C + .4byte _081C5162 + .4byte _081C5168 + .4byte _081C516E + .4byte _081C5174 + .4byte _081C517A + .4byte _081C5188 +_081C50E4: + bl SetVBlankHBlankCallbacksToNull + bl clear_scheduled_bg_copies_to_vram + b _081C51A2 +_081C50EE: + bl remove_some_task + b _081C51A2 +_081C50F4: + bl ResetObjectPaletteAllocator + b _081C51A2 +_081C50FA: + bl sub_80A1A74 + ldr r2, =0x02037fd4 + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + b _081C51A0 + .pool +_081C510C: + bl ResetAllObjectData + b _081C51A2 +_081C5112: + bl sub_81221AC + lsls r0, 24 + cmp r0, 0 + bne _081C51A2 + bl clear_tasks + b _081C51A2 +_081C5122: + bl sub_81C51DC + ldr r0, =0x0203cf2c + ldr r0, [r0] + ldr r1, =0x00000984 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _081C51A2 + .pool +_081C513C: + bl sub_81C5238 + lsls r0, 24 + cmp r0, 0 + beq _081C51D4 + b _081C51A2 +_081C5148: + bl sub_81C6BD8 + b _081C51A2 +_081C514E: + bl sub_81C5924 + bl sub_81C59BC + bl sub_81C5A20 + b _081C51A2 +_081C515C: + bl sub_81C5314 + b _081C51A2 +_081C5162: + bl sub_81C56F8 + b _081C51A2 +_081C5168: + bl sub_81C6EF4 + b _081C51A2 +_081C516E: + bl sub_81C5674 + b _081C51A2 +_081C5174: + bl sub_81C700C + b _081C51A2 +_081C517A: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + b _081C51A2 +_081C5188: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 +_081C51A0: + strb r0, [r2, 0x8] +_081C51A2: + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _081C51D4 + .pool +_081C51BC: + ldr r0, =sub_81C5038 + bl SetVBlankCallback + ldr r0, =sub_81C501C + bl SetMainCallback2 + movs r0, 0x1 + b _081C51D6 + .pool +_081C51D4: + movs r0, 0 +_081C51D6: + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_81C5078 + + thumb_func_start sub_81C51DC +sub_81C51DC: @ 81C51DC + push {lr} + bl sub_8121DA0 + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0861F2B4 + movs r0, 0 + movs r2, 0x3 + bl InitBgsFromTemplates + ldr r0, =0x0203cf2c + ldr r1, [r0] + adds r1, 0x4 + movs r0, 0x2 + bl SetBgTilemapBuffer + bl sub_8121E10 + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C51DC + + thumb_func_start sub_81C5238 +sub_81C5238: @ 81C5238 + push {r4,lr} + sub sp, 0x4 + ldr r4, =0x0203cf2c + ldr r0, [r4] + ldr r1, =0x00000984 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x4 + bhi _081C52F0 + lsls r0, 2 + ldr r1, =_081C5264 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081C5264: + .4byte _081C5278 + .4byte _081C5294 + .4byte _081C52B8 + .4byte _081C52C8 + .4byte _081C52D4 +_081C5278: + bl reset_temp_tile_data_buffers + ldr r1, =gUnknown_08D9A620 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + b _081C52D8 + .pool +_081C5294: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C5308 + ldr r0, =gUnknown_08D9AE04 + ldr r4, =0x0203cf2c + ldr r1, [r4] + adds r1, 0x4 + bl LZDecompressWram + ldr r1, [r4] + b _081C52DC + .pool +_081C52B8: + ldr r0, =gUnknown_08D9AF44 + movs r1, 0 + movs r2, 0x20 + bl decompress_palette + b _081C52D8 + .pool +_081C52C8: + ldr r0, =gUnknown_0861F3CC + bl LoadCompressedObjectPic + b _081C52D8 + .pool +_081C52D4: + bl sub_81C6E98 +_081C52D8: + ldr r0, =0x0203cf2c + ldr r1, [r0] +_081C52DC: + ldr r0, =0x00000984 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _081C5308 + .pool +_081C52F0: + bl sub_8122328 + ldr r0, [r4] + ldr r1, =0x00000984 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + movs r0, 0x1 + b _081C530A + .pool +_081C5308: + movs r0, 0 +_081C530A: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81C5238 + + thumb_func_start sub_81C5314 +sub_81C5314: @ 81C5314 + push {r4-r7,lr} + ldr r0, =0x03005d90 + ldr r2, [r0] + ldr r1, =0x00000ca9 + adds r0, r2, r1 + ldrb r1, [r0] + lsls r1, 30 + lsrs r1, 30 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + ldr r3, =0x00000e2c + adds r0, r3 + adds r7, r2, r0 + movs r6, 0 + ldr r1, =0x0203cf2c + ldr r0, [r1] + ldr r4, =0x00000821 + adds r0, r4 + ldrb r0, [r0] + subs r0, 0x1 + cmp r6, r0 + bge _081C5382 + adds r5, r1, 0 +_081C5344: + lsls r1, r6, 1 + adds r4, r1, r6 + lsls r4, 3 + ldr r0, =0x0000087c + adds r4, r0 + ldr r0, [r5] + adds r0, r4 + adds r1, r7 + ldrh r1, [r1] + bl sub_81C540C + ldr r1, [r5] + lsls r2, r6, 3 + ldr r3, =0x00000824 + adds r0, r1, r3 + adds r0, r2 + adds r4, r1, r4 + str r4, [r0] + ldr r4, =0x00000828 + adds r0, r1, r4 + adds r0, r2 + str r6, [r0] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =0x00000821 + adds r1, r0 + ldrb r0, [r1] + subs r0, 0x1 + cmp r6, r0 + blt _081C5344 +_081C5382: + ldr r5, =0x0203cf2c + lsls r4, r6, 1 + adds r4, r6 + lsls r4, 3 + ldr r1, =0x0000087c + adds r4, r1 + ldr r0, [r5] + adds r0, r4 + ldr r1, =gUnknown_085E8DB4 + bl CopyString + ldr r1, [r5] + lsls r2, r6, 3 + ldr r3, =0x00000824 + adds r0, r1, r3 + adds r0, r2 + adds r4, r1, r4 + str r4, [r0] + ldr r4, =0x00000828 + adds r1, r4 + adds r1, r2 + movs r0, 0x2 + negs r0, r0 + str r0, [r1] + ldr r2, =0x03006310 + adds r1, r2, 0 + ldr r0, =gUnknown_0861F2C0 + ldm r0!, {r4,r6,r7} + stm r1!, {r4,r6,r7} + ldm r0!, {r4,r6,r7} + stm r1!, {r4,r6,r7} + ldr r1, [r5] + ldr r6, =0x00000821 + adds r0, r1, r6 + ldrb r0, [r0] + strh r0, [r2, 0xC] + adds r3, r1, r3 + str r3, [r2] + ldr r7, =0x00000822 + adds r1, r7 + ldrb r0, [r1] + strh r0, [r2, 0xE] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C5314 + + thumb_func_start sub_81C540C +sub_81C540C: @ 81C540C + push {r4,r5,lr} + adds r5, r0, 0 + lsls r1, 16 + lsrs r4, r1, 16 + adds r0, r4, 0 + bl itemid_get_pocket_number + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bne _081C5450 + ldr r0, =0x02021cc4 + adds r1, r4, 0 + subs r1, 0x84 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r1, =0x02021dc4 + adds r0, r4, 0 + bl itemid_get_name + ldr r1, =gUnknown_085E9210 + adds r0, r5, 0 + bl ExpandStringRefs + b _081C5458 + .pool +_081C5450: + adds r0, r4, 0 + adds r1, r5, 0 + bl itemid_get_name +_081C5458: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81C540C + + thumb_func_start sub_81C5460 +sub_81C5460: @ 81C5460 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x1 + beq _081C5476 + movs r0, 0x5 + bl audio_play + bl sub_81C6F20 +_081C5476: + ldr r5, =0x0203cf2c + ldr r1, [r5] + ldr r2, =0x00000814 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0xFF + bne _081C5504 + adds r2, 0x1 + adds r0, r1, r2 + ldrb r1, [r0] + movs r0, 0x1 + eors r0, r1 + bl sub_81C6FF8 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _081C54E0 + ldr r0, =0x03005d90 + ldr r2, [r0] + lsls r3, r4, 1 + ldr r1, =0x00000ca9 + adds r0, r2, r1 + ldrb r1, [r0] + lsls r1, 30 + lsrs r1, 30 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r3, r0 + ldr r0, =0x00000e2c + adds r2, r0 + adds r2, r3 + ldrh r0, [r2] + ldr r1, [r5] + ldr r2, =0x00000815 + adds r1, r2 + ldrb r1, [r1] + bl sub_81C6F90 + b _081C54EE + .pool +_081C54E0: + ldr r0, =0x0000ffff + ldr r1, [r5] + ldr r2, =0x00000815 + adds r1, r2 + ldrb r1, [r1] + bl sub_81C6F90 +_081C54EE: + ldr r0, =0x0203cf2c + ldr r1, [r0] + ldr r0, =0x00000815 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x1 + eors r0, r2 + strb r0, [r1] + adds r0, r4, 0 + bl sub_81C55D8 +_081C5504: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C5460 + + thumb_func_start sub_81C5518 +sub_81C5518: @ 81C5518 + push {r4-r6,lr} + sub sp, 0x10 + adds r4, r1, 0 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r2, 24 + lsrs r5, r2, 24 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _081C55B8 + ldr r0, =0x0203cf2c + ldr r0, [r0] + ldr r1, =0x00000814 + adds r0, r1 + ldrb r1, [r0] + cmp r1, 0xFF + beq _081C5560 + lsls r0, r4, 24 + lsrs r0, 24 + cmp r1, r0 + bne _081C5558 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81C5AB8 + b _081C5560 + .pool +_081C5558: + adds r0, r5, 0 + movs r1, 0xFF + bl sub_81C5AB8 +_081C5560: + ldr r0, =0x02021cc4 + ldr r1, =0x03005d90 + ldr r3, [r1] + ldr r2, =0x00000ca9 + adds r1, r3, r2 + ldrb r2, [r1] + lsls r2, 30 + lsrs r2, 30 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 1 + adds r1, r4, r1 + ldr r2, =0x00000e54 + adds r3, r2 + adds r3, r1 + ldrb r1, [r3] + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E8DA0 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0x7 + adds r1, r4, 0 + movs r2, 0x77 + bl GetStringRightAlignXOffset + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + movs r1, 0 + str r1, [sp] + str r1, [sp, 0x4] + movs r0, 0xFF + str r0, [sp, 0x8] + str r1, [sp, 0xC] + adds r0, r6, 0 + adds r1, r4, 0 + adds r3, r5, 0 + bl sub_81C6C94 +_081C55B8: + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C5518 + + thumb_func_start sub_81C55D8 +sub_81C55D8: @ 81C55D8 + push {r4,lr} + sub sp, 0x10 + adds r3, r0, 0 + movs r0, 0x2 + negs r0, r0 + cmp r3, r0 + beq _081C561C + ldr r0, =0x03005d90 + ldr r2, [r0] + lsls r3, 1 + ldr r1, =0x00000ca9 + adds r0, r2, r1 + ldrb r1, [r0] + lsls r1, 30 + lsrs r1, 30 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r3, r0 + ldr r0, =0x00000e2c + adds r2, r0 + adds r2, r3 + ldrh r0, [r2] + bl itemid_get_description + adds r4, r0, 0 + b _081C5638 + .pool +_081C561C: + ldr r0, =0x02021cc4 + ldr r2, =gUnknown_085E91B0 + ldr r1, =0x0203cf30 + ldrb r1, [r1, 0x4] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl CopyString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E91C0 + adds r0, r4, 0 + bl ExpandStringRefs +_081C5638: + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r1, 0 + str r1, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + str r1, [sp, 0x8] + str r1, [sp, 0xC] + adds r1, r4, 0 + movs r2, 0x3 + movs r3, 0 + bl sub_81C6C3C + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C55D8 + + thumb_func_start sub_81C5674 +sub_81C5674: @ 81C5674 + push {r4,lr} + sub sp, 0x10 + ldr r4, =0x0203cf2c + ldr r1, [r4] + ldr r2, =0x00000816 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0xFF + bne _081C56B4 + adds r2, 0xB + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + subs r0, r1 + str r0, [sp] + ldr r0, =0x00000b5e + str r0, [sp, 0x4] + str r0, [sp, 0x8] + ldr r0, =0x0203cf38 + str r0, [sp, 0xC] + movs r0, 0x2 + movs r1, 0xAC + movs r2, 0xC + movs r3, 0x94 + bl AddScrollIndicatorArrowPairParametrized + ldr r1, [r4] + ldr r2, =0x00000816 + adds r1, r2 + strb r0, [r1] +_081C56B4: + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C5674 + + thumb_func_start sub_81C56CC +sub_81C56CC: @ 81C56CC + push {r4,lr} + ldr r4, =0x0203cf2c + ldr r0, [r4] + ldr r2, =0x00000816 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _081C56EA + bl RemoveScrollIndicatorArrowPair + ldr r0, [r4] + ldr r1, =0x00000816 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] +_081C56EA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C56CC + + thumb_func_start sub_81C56F8 +sub_81C56F8: @ 81C56F8 + push {r4,lr} + ldr r0, =sub_81C5BC8 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =0x03005e08 + adds r4, r0 + ldr r0, =0x03006310 + ldr r2, =0x0203cf30 + ldrh r1, [r2, 0x8] + ldrh r2, [r2, 0x6] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C56F8 + + thumb_func_start sub_81C5738 +sub_81C5738: @ 81C5738 + push {r4-r6,lr} + mov r6, r8 + push {r6} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =0x03005d90 + ldr r6, [r2] + ldr r3, =0x00000ca9 + adds r2, r6, r3 + ldrb r3, [r2] + lsls r3, 30 + lsrs r2, r3, 30 + lsls r4, r2, 2 + adds r4, r2 + lsls r4, 2 + ldr r2, =0x00000e2c + adds r4, r2 + adds r4, r6, r4 + lsrs r3, 30 + lsls r2, r3, 2 + adds r2, r3 + lsls r2, 1 + ldr r3, =0x00000e54 + adds r2, r3 + adds r6, r2 + lsls r5, r0, 1 + adds r5, r4 + ldrh r2, [r5] + mov r8, r2 + lsls r2, r1, 1 + adds r2, r4 + ldrh r3, [r2] + strh r3, [r5] + mov r3, r8 + strh r3, [r2] + adds r0, r6, r0 + ldrb r2, [r0] + adds r6, r1 + ldrb r1, [r6] + strb r1, [r0] + strb r2, [r6] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C5738 + + thumb_func_start sub_81C57A8 +sub_81C57A8: @ 81C57A8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r4, r0, 24 + adds r7, r4, 0 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r0, =0x03005d90 + ldr r3, [r0] + ldr r1, =0x00000ca9 + adds r0, r3, r1 + ldrb r1, [r0] + lsls r1, 30 + lsrs r2, r1, 30 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x00000e2c + adds r0, r2 + adds r6, r3, r0 + lsrs r1, 30 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + ldr r1, =0x00000e54 + adds r0, r1 + adds r3, r0 + cmp r4, r5 + beq _081C5862 + lsls r0, r4, 1 + adds r0, r6 + ldrh r0, [r0] + mov r12, r0 + adds r0, r3, r4 + ldrb r0, [r0] + mov r8, r0 + cmp r5, r4 + bls _081C5830 + subs r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r2, r4, 16 + cmp r4, r5 + bge _081C5854 +_081C5802: + asrs r2, 16 + lsls r0, r2, 1 + adds r0, r6 + ldrh r1, [r0, 0x2] + strh r1, [r0] + adds r1, r3, r2 + ldrb r0, [r1, 0x1] + strb r0, [r1] + adds r2, 0x1 + lsls r2, 16 + asrs r0, r2, 16 + cmp r0, r5 + blt _081C5802 + b _081C5854 + .pool +_081C5830: + lsls r2, r7, 16 + cmp r7, r5 + ble _081C5854 +_081C5836: + asrs r2, 16 + lsls r1, r2, 1 + adds r1, r6 + subs r0, r1, 0x2 + ldrh r0, [r0] + strh r0, [r1] + adds r1, r3, r2 + subs r0, r1, 0x1 + ldrb r0, [r0] + strb r0, [r1] + subs r2, 0x1 + lsls r2, 16 + asrs r0, r2, 16 + cmp r0, r5 + bgt _081C5836 +_081C5854: + lsls r0, r5, 1 + adds r0, r6 + mov r2, r12 + strh r2, [r0] + adds r0, r3, r5 + mov r1, r8 + strb r1, [r0] +_081C5862: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81C57A8 + + thumb_func_start sub_81C586C +sub_81C586C: @ 81C586C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r0, =0x03005d90 + ldr r3, [r0] + ldr r1, =0x00000ca9 + adds r0, r3, r1 + ldrb r1, [r0] + lsls r1, 30 + lsrs r2, r1, 30 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x00000e2c + adds r0, r2 + adds r0, r3 + mov r9, r0 + lsrs r1, 30 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + ldr r4, =0x00000e54 + adds r0, r4 + adds r3, r0 + mov r8, r3 + movs r5, 0 + movs r3, 0 +_081C58A4: + lsls r0, r5, 1 + mov r1, r9 + adds r2, r0, r1 + ldrh r0, [r2] + mov r4, r8 + adds r1, r4, r5 + cmp r0, 0 + beq _081C58BA + ldrb r0, [r1] + cmp r0, 0 + bne _081C58BE +_081C58BA: + strh r3, [r2] + strb r3, [r1] +_081C58BE: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x9 + bls _081C58A4 + movs r5, 0 +_081C58CA: + adds r1, r5, 0x1 + lsls r0, r1, 24 + lsrs r4, r0, 24 + adds r7, r1, 0 + cmp r4, 0x9 + bhi _081C58FE + lsls r0, r5, 1 + mov r1, r9 + adds r6, r0, r1 +_081C58DC: + ldrh r0, [r6] + cmp r0, 0 + beq _081C58EC + mov r2, r8 + adds r0, r2, r5 + ldrb r0, [r0] + cmp r0, 0 + bne _081C58F4 +_081C58EC: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81C5738 +_081C58F4: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x9 + bls _081C58DC +_081C58FE: + lsls r0, r7, 24 + lsrs r5, r0, 24 + cmp r5, 0x8 + bls _081C58CA + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C586C + + thumb_func_start sub_81C5924 +sub_81C5924: @ 81C5924 + push {r4-r6,lr} + ldr r0, =0x03005d90 + ldr r2, [r0] + ldr r1, =0x00000ca9 + adds r0, r2, r1 + ldrb r1, [r0] + lsls r1, 30 + lsrs r1, 30 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x00000e2c + adds r0, r1 + adds r5, r2, r0 + bl sub_81C586C + ldr r3, =0x0203cf2c + ldr r0, [r3] + ldr r2, =0x00000821 + adds r0, r2 + movs r1, 0 + strb r1, [r0] + movs r4, 0 + adds r6, r3, 0 +_081C5954: + lsls r0, r4, 1 + adds r0, r5 + ldrh r0, [r0] + ldr r3, =0x0203cf2c + cmp r0, 0 + beq _081C596A + ldr r1, [r6] + adds r1, r2 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_081C596A: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x9 + bls _081C5954 + ldr r0, [r3] + ldr r2, =0x00000821 + adds r0, r2 + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + ldr r0, [r3] + adds r2, r0, r2 + ldrb r2, [r2] + cmp r2, 0x8 + bls _081C59AC + ldr r2, =0x00000822 + adds r1, r0, r2 + movs r0, 0x8 + strb r0, [r1] + b _081C59B2 + .pool +_081C59AC: + ldr r1, =0x00000822 + adds r0, r1 + strb r2, [r0] +_081C59B2: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C5924 + + thumb_func_start sub_81C59BC +sub_81C59BC: @ 81C59BC + push {r4,r5,lr} + ldr r0, =0x0203cf30 + ldrh r1, [r0, 0x8] + adds r3, r0, 0 + ldr r4, =0x0203cf2c + cmp r1, 0 + beq _081C59E4 + ldrh r0, [r3, 0x8] + ldr r1, [r4] + ldr r5, =0x00000822 + adds r2, r1, r5 + ldrb r2, [r2] + adds r0, r2 + subs r5, 0x1 + adds r1, r5 + ldrb r1, [r1] + cmp r0, r1 + ble _081C59E4 + subs r0, r1, r2 + strh r0, [r3, 0x8] +_081C59E4: + adds r2, r3, 0 + ldrh r1, [r2, 0x8] + ldrh r0, [r2, 0x6] + adds r1, r0 + ldr r0, [r4] + ldr r4, =0x00000821 + adds r0, r4 + ldrb r0, [r0] + cmp r1, r0 + blt _081C5A18 + adds r1, r0, 0 + cmp r1, 0 + bne _081C5A14 + strh r1, [r2, 0x6] + b _081C5A18 + .pool +_081C5A14: + subs r0, 0x1 + strh r0, [r3, 0x6] +_081C5A18: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81C59BC + + thumb_func_start sub_81C5A20 +sub_81C5A20: @ 81C5A20 + push {r4-r7,lr} + ldr r0, =0x0203cf30 + ldrh r1, [r0, 0x6] + adds r5, r0, 0 + cmp r1, 0x4 + bls _081C5A80 + movs r4, 0 + ldrh r0, [r5, 0x6] + subs r0, 0x4 + cmp r4, r0 + bgt _081C5A80 + ldrh r2, [r5, 0x8] + ldr r6, =0x0203cf2c + ldr r0, [r6] + ldr r3, =0x00000822 + adds r1, r0, r3 + ldrb r1, [r1] + adds r2, r1 + ldr r7, =0x00000821 + adds r0, r7 + ldrb r0, [r0] + cmp r2, r0 + beq _081C5A80 + adds r3, r5, 0 +_081C5A50: + ldrh r0, [r3, 0x6] + subs r0, 0x1 + strh r0, [r3, 0x6] + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldrh r0, [r3, 0x6] + subs r0, 0x4 + cmp r4, r0 + bgt _081C5A80 + ldrh r2, [r5, 0x8] + ldr r1, [r6] + ldr r7, =0x00000822 + adds r0, r1, r7 + ldrb r0, [r0] + adds r2, r0 + ldr r0, =0x00000821 + adds r1, r0 + ldrb r1, [r1] + cmp r2, r1 + bne _081C5A50 +_081C5A80: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C5A20 + + thumb_func_start sub_81C5A98 +sub_81C5A98: @ 81C5A98 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsrs r4, 24 + bl ListMenuGetYCoordForPrintingArrowCursor + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + bl sub_81C5AB8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81C5A98 + + thumb_func_start sub_81C5AB8 +sub_81C5AB8: @ 81C5AB8 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r2, r1, 24 + cmp r2, 0xFF + bne _081C5AF4 + movs r0, 0x1 + movs r1, 0 + bl GetMenuCursorDimensionByFont + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + movs r1, 0x1 + bl GetMenuCursorDimensionByFont + lsls r0, 24 + lsrs r0, 24 + str r4, [sp] + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + adds r3, r5, 0 + bl FillWindowPixelRect + b _081C5B08 +_081C5AF4: + ldr r1, =gUnknown_085E8D60 + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r2, [sp, 0xC] + movs r2, 0 + adds r3, r5, 0 + bl sub_81C6C3C +_081C5B08: + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C5AB8 + + thumb_func_start sub_81C5B14 +sub_81C5B14: @ 81C5B14 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81C5B4C + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C5B14 + + thumb_func_start sub_81C5B4C +sub_81C5B4C: @ 81C5B4C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r2, r0, r1 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081C5BBC + ldrb r0, [r2] + ldr r4, =0x0203cf38 + subs r2, r4, 0x2 + adds r1, r4, 0 + bl sub_81AE6C8 + ldr r0, =0x0203cf2c + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0 + beq _081C5B94 + bl SetMainCallback2 + b _081C5B9E + .pool +_081C5B94: + adds r0, r4, 0 + subs r0, 0x8 + ldr r0, [r0] + bl SetMainCallback2 +_081C5B9E: + bl sub_81C56CC + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + bl FreeAllWindowBuffers + ldr r0, =0x0203cf2c + ldr r0, [r0] + bl Free + adds r0, r5, 0 + bl remove_task +_081C5BBC: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C5B4C + + thumb_func_start sub_81C5BC8 +sub_81C5BC8: @ 81C5BC8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r7, r0, r1 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C5BEA + b _081C5D16 +_081C5BEA: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081C5BF8 + b _081C5D16 +_081C5BF8: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x4 + ands r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _081C5C5C + ldr r4, =0x0203cf30 + ldrb r0, [r4, 0x4] + cmp r0, 0x2 + bne _081C5C12 + b _081C5D16 +_081C5C12: + ldrb r0, [r7] + adds r1, r4, 0 + adds r1, 0x8 + adds r2, r4, 0x6 + bl get_coro_args_x18_x1A + ldrh r1, [r4, 0x8] + ldrh r0, [r4, 0x6] + adds r1, r0 + ldr r0, =0x0203cf2c + ldr r0, [r0] + ldr r2, =0x00000821 + adds r0, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + beq _081C5D16 + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_81C67CC + b _081C5D16 + .pool +_081C5C5C: + ldrb r0, [r7] + bl ListMenuHandleInput + adds r6, r0, 0 + ldrb r0, [r7] + ldr r1, =0x0203cf38 + mov r8, r1 + mov r2, r8 + subs r2, 0x2 + bl get_coro_args_x18_x1A + movs r0, 0x2 + negs r0, r0 + cmp r6, r0 + beq _081C5C88 + adds r0, 0x1 + cmp r6, r0 + bne _081C5CA0 + b _081C5D16 + .pool +_081C5C88: + movs r0, 0x5 + bl audio_play + ldr r0, =0x0203ce7c + strh r4, [r0] + adds r0, r5, 0 + bl sub_81C5B14 + b _081C5D16 + .pool +_081C5CA0: + movs r0, 0x5 + bl audio_play + ldr r2, =0x0203ce7c + mov r12, r2 + ldr r0, =0x03005d90 + ldr r2, [r0] + lsls r3, r6, 1 + ldr r0, =0x00000ca9 + adds r4, r2, r0 + ldrb r1, [r4] + lsls r1, 30 + lsrs r1, 30 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r3, r0 + ldr r1, =0x00000e2c + adds r0, r2, r1 + adds r0, r3 + ldrh r0, [r0] + mov r1, r12 + strh r0, [r1] + strh r6, [r7, 0x2] + ldrb r1, [r4] + lsls r1, 30 + lsrs r1, 30 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + adds r0, r6, r0 + ldr r1, =0x00000e54 + adds r2, r1 + adds r2, r0 + ldrb r0, [r2] + strh r0, [r7, 0x4] + mov r0, r8 + subs r0, 0x8 + ldrb r0, [r0, 0x4] + cmp r0, 0x2 + bne _081C5D10 + adds r0, r5, 0 + bl sub_81C674C + b _081C5D16 + .pool +_081C5D10: + adds r0, r5, 0 + bl sub_81C5D20 +_081C5D16: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81C5BC8 + + thumb_func_start sub_81C5D20 +sub_81C5D20: @ 81C5D20 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =0x03005e08 + adds r4, r0 + bl sub_81C56CC + ldrb r0, [r4] + movs r1, 0x1 + bl sub_81C5A98 + ldr r0, =0x0203cf30 + ldrb r4, [r0, 0x4] + cmp r4, 0x1 + beq _081C5D74 + cmp r4, 0x3 + beq _081C5DC4 + ldr r0, =0x0203cf2c + ldr r1, [r0] + ldr r0, =0x00000818 + adds r2, r1, r0 + ldr r0, =gUnknown_0861F308 + str r0, [r2] + movs r0, 0x82 + lsls r0, 4 + adds r1, r0 + movs r0, 0x4 + b _081C5DD8 + .pool +_081C5D74: + ldr r0, =0x0203ce7c + ldrh r0, [r0] + bl itemid_get_usage + lsls r0, 24 + cmp r0, 0 + beq _081C5DA0 + ldr r0, =0x0203cf2c + ldr r1, [r0] + ldr r0, =0x00000818 + adds r2, r1, r0 + ldr r0, =gUnknown_0861F30E + b _081C5DCE + .pool +_081C5DA0: + ldr r0, =0x0203cf2c + ldr r0, [r0] + ldr r1, =0x00000818 + adds r2, r0, r1 + ldr r1, =gUnknown_0861F310 + str r1, [r2] + movs r1, 0x82 + lsls r1, 4 + adds r0, r1 + strb r4, [r0] + b _081C5DDA + .pool +_081C5DC4: + ldr r0, =0x0203cf2c + ldr r1, [r0] + ldr r0, =0x00000818 + adds r2, r1, r0 + ldr r0, =gUnknown_0861F30C +_081C5DCE: + str r0, [r2] + movs r0, 0x82 + lsls r0, 4 + adds r1, r0 + movs r0, 0x2 +_081C5DD8: + strb r0, [r1] +_081C5DDA: + ldr r0, =0x0203ce7c + ldrh r0, [r0] + ldr r1, =0x02021cc4 + bl itemid_get_name + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E8DBE + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r1, 0 + str r1, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + str r1, [sp, 0x8] + str r1, [sp, 0xC] + adds r1, r4, 0 + movs r2, 0x3 + movs r3, 0 + bl sub_81C6C3C + ldr r0, =0x0203cf2c + ldr r0, [r0] + movs r1, 0x82 + lsls r1, 4 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081C5E3C + movs r0, 0 + b _081C5E42 + .pool +_081C5E3C: + cmp r0, 0x2 + bne _081C5E50 + movs r0, 0x1 +_081C5E42: + bl sub_81C6D24 + lsls r0, 24 + lsrs r0, 24 + bl sub_81C5EAC + b _081C5E62 +_081C5E50: + movs r0, 0x2 + bl sub_81C6D24 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + movs r2, 0x2 + bl sub_81C5F08 +_081C5E62: + ldr r0, =0x0203cf2c + ldr r0, [r0] + movs r1, 0x82 + lsls r1, 4 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x4 + bne _081C5E8C + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81C5FE4 + b _081C5E98 + .pool +_081C5E8C: + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81C5F68 +_081C5E98: + str r0, [r1] + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C5D20 + + thumb_func_start sub_81C5EAC +sub_81C5EAC: @ 81C5EAC + push {r4-r6,lr} + sub sp, 0x14 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + str r0, [sp] + movs r0, 0x10 + str r0, [sp, 0x4] + ldr r6, =0x0203cf2c + ldr r1, [r6] + movs r5, 0x82 + lsls r5, 4 + adds r0, r1, r5 + ldrb r0, [r0] + str r0, [sp, 0x8] + ldr r0, =gUnknown_0861F2D8 + str r0, [sp, 0xC] + ldr r0, =0x00000818 + adds r1, r0 + ldr r0, [r1] + str r0, [sp, 0x10] + adds r0, r4, 0 + movs r1, 0x7 + movs r2, 0x8 + movs r3, 0x1 + bl AddItemMenuActionTextPrinters + ldr r0, [r6] + adds r0, r5 + ldrb r1, [r0] + adds r0, r4, 0 + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C5EAC + + thumb_func_start sub_81C5F08 +sub_81C5F08: @ 81C5F08 + push {r4-r6,lr} + sub sp, 0x14 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + movs r0, 0x38 + str r0, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + ldr r0, =gUnknown_0861F2D8 + str r0, [sp, 0xC] + ldr r0, =0x0203cf2c + ldr r0, [r0] + ldr r1, =0x00000818 + adds r0, r1 + ldr r0, [r0] + str r0, [sp, 0x10] + adds r0, r4, 0 + movs r1, 0x7 + movs r2, 0x8 + movs r3, 0x1 + bl sub_8198DBC + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r1, 0x38 + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_8199944 + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C5F08 + + thumb_func_start sub_81C5F68 +sub_81C5F68: @ 81C5F68 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C5FD0 + bl ProcessMenuInputNoWrapAround + lsls r0, 24 + asrs r4, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _081C5FD0 + adds r0, 0x1 + cmp r4, r0 + bne _081C5FA8 + movs r0, 0x5 + bl audio_play + ldr r0, =gUnknown_0861F2D8 + ldr r1, [r0, 0x1C] + adds r0, r5, 0 + bl _call_via_r1 + b _081C5FD0 + .pool +_081C5FA8: + movs r0, 0x5 + bl audio_play + ldr r1, =gUnknown_0861F2D8 + ldr r0, =0x0203cf2c + ldr r0, [r0] + ldr r2, =0x00000818 + adds r0, r2 + ldr r0, [r0] + adds r0, r4 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + adds r0, r1 + ldr r1, [r0] + cmp r1, 0 + beq _081C5FD0 + adds r0, r6, 0 + bl _call_via_r1 +_081C5FD0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C5F68 + + thumb_func_start sub_81C5FE4 +sub_81C5FE4: @ 81C5FE4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C5FF8 + b _081C6160 +_081C5FF8: + bl GetMenuCursorPos + lsls r0, 24 + lsrs r4, r0, 24 + ldr r5, =0x030022c0 + ldrh r1, [r5, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081C6040 + lsls r0, r4, 24 + asrs r0, 24 + cmp r0, 0 + bgt _081C6016 + b _081C6160 +_081C6016: + subs r0, 0x2 + lsls r0, 24 + asrs r0, 24 + bl sub_81C616C + lsls r0, 24 + cmp r0, 0 + bne _081C6028 + b _081C6160 +_081C6028: + movs r0, 0x5 + bl audio_play + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + bl sub_8199134 + b _081C6160 + .pool +_081C6040: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081C6084 + lsls r0, r4, 24 + asrs r1, r0, 24 + ldr r0, =0x0203cf2c + ldr r0, [r0] + movs r2, 0x82 + lsls r2, 4 + adds r0, r2 + ldrb r0, [r0] + subs r0, 0x2 + cmp r1, r0 + blt _081C6060 + b _081C6160 +_081C6060: + adds r0, r1, 0x2 + lsls r0, 24 + asrs r0, 24 + bl sub_81C616C + lsls r0, 24 + cmp r0, 0 + beq _081C6160 + movs r0, 0x5 + bl audio_play + movs r0, 0 + movs r1, 0x1 + bl sub_8199134 + b _081C6160 + .pool +_081C6084: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _081C6098 + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C60C0 +_081C6098: + lsls r0, r4, 24 + asrs r1, r0, 24 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081C6160 + subs r0, r1, 0x1 + lsls r0, 24 + asrs r0, 24 + bl sub_81C616C + lsls r0, 24 + cmp r0, 0 + beq _081C6160 + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + negs r0, r0 + b _081C60FA +_081C60C0: + ldrh r1, [r5, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _081C60D6 + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _081C6102 +_081C60D6: + lsls r0, r4, 24 + asrs r1, r0, 24 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081C6160 + adds r0, r1, 0x1 + lsls r0, 24 + asrs r0, 24 + bl sub_81C616C + lsls r0, 24 + cmp r0, 0 + beq _081C6160 + movs r0, 0x5 + bl audio_play + movs r0, 0x1 +_081C60FA: + movs r1, 0 + bl sub_8199134 + b _081C6160 +_081C6102: + ldrh r1, [r5, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081C6148 + movs r0, 0x5 + bl audio_play + ldr r2, =gUnknown_0861F2D8 + ldr r0, =0x0203cf2c + ldr r0, [r0] + lsls r1, r4, 24 + asrs r1, 24 + ldr r3, =0x00000818 + adds r0, r3 + ldr r0, [r0] + adds r0, r1 + ldrb r0, [r0] + lsls r0, 3 + adds r2, 0x4 + adds r0, r2 + ldr r1, [r0] + cmp r1, 0 + beq _081C6160 + adds r0, r6, 0 + bl _call_via_r1 + b _081C6160 + .pool +_081C6148: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081C6160 + movs r0, 0x5 + bl audio_play + ldr r0, =gUnknown_0861F2D8 + ldr r1, [r0, 0x1C] + adds r0, r6, 0 + bl _call_via_r1 +_081C6160: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C5FE4 + + thumb_func_start sub_81C616C +sub_81C616C: @ 81C616C + push {lr} + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + blt _081C61A0 + ldr r0, =0x0203cf2c + ldr r2, [r0] + movs r3, 0x82 + lsls r3, 4 + adds r0, r2, r3 + ldrb r0, [r0] + cmp r1, r0 + bgt _081C61A0 + ldr r3, =0x00000818 + adds r0, r2, r3 + ldr r0, [r0] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x5 + beq _081C61A0 + movs r0, 0x1 + b _081C61A2 + .pool +_081C61A0: + movs r0, 0 +_081C61A2: + pop {r1} + bx r1 + thumb_func_end sub_81C616C + + thumb_func_start sub_81C61A8 +sub_81C61A8: @ 81C61A8 + push {lr} + ldr r0, =0x0203cf2c + ldr r0, [r0] + movs r1, 0x82 + lsls r1, 4 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081C61C8 + movs r0, 0 + bl sub_81C6D6C + b _081C61DA + .pool +_081C61C8: + cmp r0, 0x2 + bne _081C61D4 + movs r0, 0x1 + bl sub_81C6D6C + b _081C61DA +_081C61D4: + movs r0, 0x2 + bl sub_81C6D6C +_081C61DA: + pop {r0} + bx r0 + thumb_func_end sub_81C61A8 + + thumb_func_start sub_81C61E0 +sub_81C61E0: @ 81C61E0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =0x0203ce7c + ldrh r0, [r4] + bl itemid_get_pocket_number + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + beq _081C620C + cmp r0, 0x2 + beq _081C620C + cmp r0, 0x3 + beq _081C620C + ldrh r0, [r4] + bl itemid_is_mail + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C6228 +_081C620C: + bl sub_81C61A8 + ldr r1, =gUnknown_085E8F31 + ldr r2, =sub_81C6714 + adds r0, r5, 0 + bl DisplayItemMessageInBattlePyramid + b _081C6252 + .pool +_081C6228: + ldrh r0, [r4] + bl itemid_get_overworld_function + cmp r0, 0 + beq _081C6252 + bl sub_81C61A8 + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldrh r0, [r4] + bl itemid_get_overworld_function + adds r1, r0, 0 + adds r0, r5, 0 + bl _call_via_r1 +_081C6252: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81C61E0 + + thumb_func_start sub_81C6258 +sub_81C6258: @ 81C6258 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =0x03005e08 + adds r4, r0 + bl sub_81C61A8 + movs r1, 0x2 + ldrsh r0, [r4, r1] + bl sub_81C55D8 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + ldrb r0, [r4] + movs r1, 0 + bl sub_81C5A98 + adds r0, r5, 0 + bl sub_81C629C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6258 + + thumb_func_start sub_81C629C +sub_81C629C: @ 81C629C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_81C5674 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81C5BC8 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C629C + + thumb_func_start sub_81C62C4 +sub_81C62C4: @ 81C62C4 + push {r4-r7,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r6, r0, 3 + ldr r7, =0x03005e08 + adds r4, r6, r7 + bl sub_81C61A8 + movs r0, 0x1 + strh r0, [r4, 0x10] + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _081C62F4 + adds r0, r5, 0 + bl sub_81C6350 + b _081C6334 + .pool +_081C62F4: + ldr r0, =0x0203ce7c + ldrh r0, [r0] + ldr r1, =0x02021cc4 + bl itemid_get_name + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E8EE0 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r1, 0 + str r1, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + str r1, [sp, 0x8] + str r1, [sp, 0xC] + adds r1, r4, 0 + movs r2, 0x3 + movs r3, 0 + bl sub_81C6C3C + bl sub_81C6404 + adds r0, r7, 0 + subs r0, 0x8 + adds r0, r6, r0 + ldr r1, =sub_81C64B4 + str r1, [r0] +_081C6334: + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C62C4 + + thumb_func_start sub_81C6350 +sub_81C6350: @ 81C6350 + push {r4,r5,lr} + sub sp, 0x10 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =0x03005e08 + adds r4, r0 + ldr r0, =0x0203ce7c + ldrh r0, [r0] + ldr r1, =0x02021cc4 + bl itemid_get_name + ldr r0, =0x02021dc4 + movs r2, 0x10 + ldrsh r1, [r4, r2] + movs r2, 0 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E8F0E + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r1, 0 + str r1, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + str r1, [sp, 0x8] + str r1, [sp, 0xC] + adds r1, r4, 0 + movs r2, 0x3 + movs r3, 0 + bl sub_81C6C3C + ldr r1, =gUnknown_0861F314 + adds r0, r5, 0 + bl sub_81C6DAC + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6350 + + thumb_func_start sub_81C63D0 +sub_81C63D0: @ 81C63D0 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =0x03005e08 + adds r4, r0 + movs r1, 0x2 + ldrsh r0, [r4, r1] + bl sub_81C55D8 + ldrb r0, [r4] + movs r1, 0 + bl sub_81C5A98 + adds r0, r5, 0 + bl sub_81C629C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C63D0 + + thumb_func_start sub_81C6404 +sub_81C6404: @ 81C6404 + push {r4,lr} + sub sp, 0xC + ldr r0, =0x02021cc4 + movs r1, 0x1 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E8DA0 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0x3 + bl sub_81C6CEC + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x28 + bl GetStringCenterAlignXOffset + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x2 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + adds r2, r4, 0 + bl Print + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6404 + + thumb_func_start sub_81C645C +sub_81C645C: @ 81C645C + push {r4,lr} + sub sp, 0xC + adds r1, r0, 0 + ldr r0, =0x02021cc4 + lsls r1, 16 + asrs r1, 16 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E8DA0 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x28 + bl GetStringCenterAlignXOffset + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x2 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + adds r2, r4, 0 + bl Print + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C645C + + thumb_func_start sub_81C64B4 +sub_81C64B4: @ 81C64B4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + adds r0, r4, 0 + adds r0, 0x10 + ldrh r1, [r4, 0x4] + bl AdjustQuantityAccordingToDPadInput + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C64E8 + movs r1, 0x10 + ldrsh r0, [r4, r1] + bl sub_81C645C + b _081C6544 + .pool +_081C64E8: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081C651C + movs r0, 0x5 + bl audio_play + movs r0, 0x3 + movs r1, 0 + bl sub_8198070 + movs r0, 0x3 + bl ClearWindowTilemap + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + adds r0, r5, 0 + bl sub_81C6350 + b _081C6544 + .pool +_081C651C: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081C6544 + movs r0, 0x5 + bl audio_play + movs r0, 0x3 + movs r1, 0 + bl sub_8198070 + movs r0, 0x3 + bl ClearWindowTilemap + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + adds r0, r6, 0 + bl sub_81C63D0 +_081C6544: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81C64B4 + + thumb_func_start sub_81C654C +sub_81C654C: @ 81C654C + push {r4-r6,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r5, =0x03005e08 + adds r6, r4, r5 + ldr r0, =0x0203ce7c + ldrh r0, [r0] + ldr r1, =0x02021cc4 + bl itemid_get_name + ldr r0, =0x02021dc4 + movs r2, 0x10 + ldrsh r1, [r6, r2] + movs r2, 0 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r6, =0x02021fc4 + ldr r1, =gUnknown_085E8EF9 + adds r0, r6, 0 + bl ExpandStringRefs + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r1, 0 + str r1, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + str r1, [sp, 0x8] + str r1, [sp, 0xC] + adds r1, r6, 0 + movs r2, 0x3 + movs r3, 0 + bl sub_81C6C3C + subs r5, 0x8 + adds r4, r5 + ldr r0, =sub_81C65CC + str r0, [r4] + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C654C + + thumb_func_start sub_81C65CC +sub_81C65CC: @ 81C65CC + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + ldr r6, =0x0203cf38 + subs r7, r6, 0x2 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081C662E + movs r0, 0x5 + bl audio_play + ldr r0, =0x0203ce7c + ldrh r0, [r0] + ldrh r1, [r4, 0x10] + bl sub_80D7334 + ldrb r0, [r4] + adds r1, r6, 0 + adds r2, r7, 0 + bl sub_81AE6C8 + bl sub_81C5924 + bl sub_81C59BC + bl sub_81C5314 + ldr r0, =0x03006310 + ldrh r1, [r6] + ldrh r2, [r7] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + adds r0, r5, 0 + bl sub_81C629C +_081C662E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C65CC + + thumb_func_start sub_81C6648 +sub_81C6648: @ 81C6648 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + bl sub_81C61A8 + ldr r5, =0x0203ce7c + ldrh r0, [r5] + bl itemid_is_mail + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081C667C + ldr r1, =gUnknown_085E8DCE + ldr r2, =sub_81C66EC + adds r0, r4, 0 + bl DisplayItemMessageInBattlePyramid + b _081C66A6 + .pool +_081C667C: + ldrh r0, [r5] + bl itemid_is_unique + lsls r0, 24 + cmp r0, 0 + bne _081C66A0 + ldr r0, =0x0203cf2c + ldr r1, [r0] + ldr r0, =sub_81B7F60 + str r0, [r1] + adds r0, r4, 0 + bl sub_81C5B14 + b _081C66A6 + .pool +_081C66A0: + adds r0, r6, 0 + bl sub_81C66AC +_081C66A6: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81C6648 + + thumb_func_start sub_81C66AC +sub_81C66AC: @ 81C66AC + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x0203ce7c + ldrh r0, [r0] + ldr r1, =0x02021cc4 + bl itemid_get_name + ldr r5, =0x02021fc4 + ldr r1, =gUnknown_085E8E11 + adds r0, r5, 0 + bl ExpandStringRefs + ldr r2, =sub_81C66EC + adds r0, r4, 0 + adds r1, r5, 0 + bl DisplayItemMessageInBattlePyramid + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C66AC + + thumb_func_start sub_81C66EC +sub_81C66EC: @ 81C66EC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081C670A + movs r0, 0x5 + bl audio_play + adds r0, r4, 0 + bl sub_81C6714 +_081C670A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C66EC + + thumb_func_start sub_81C6714 +sub_81C6714: @ 81C6714 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =0x03005e08 + adds r4, r0 + bl sub_81C6E1C + movs r1, 0x2 + ldrsh r0, [r4, r1] + bl sub_81C55D8 + ldrb r0, [r4] + movs r1, 0 + bl sub_81C5A98 + adds r0, r5, 0 + bl sub_81C629C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6714 + + thumb_func_start sub_81C674C +sub_81C674C: @ 81C674C + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + ldr r5, =0x0203ce7c + ldrh r0, [r5] + bl itemid_80BF6D8_mail_related + lsls r0, 24 + cmp r0, 0 + bne _081C677C + ldr r1, =gUnknown_085E8DCE + ldr r2, =sub_81C66EC + adds r0, r4, 0 + bl DisplayItemMessageInBattlePyramid + b _081C6796 + .pool +_081C677C: + ldrh r0, [r5] + bl itemid_is_unique + lsls r0, 24 + cmp r0, 0 + bne _081C6790 + adds r0, r4, 0 + bl sub_81C5B14 + b _081C6796 +_081C6790: + adds r0, r6, 0 + bl sub_81C66AC +_081C6796: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81C674C + + thumb_func_start sub_81C679C +sub_81C679C: @ 81C679C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =0x0203ce7c + ldrh r0, [r4] + bl itemid_get_battle_function + cmp r0, 0 + beq _081C67C0 + bl sub_81C61A8 + ldrh r0, [r4] + bl itemid_get_battle_function + adds r1, r0, 0 + adds r0, r5, 0 + bl _call_via_r1 +_081C67C0: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C679C + + thumb_func_start sub_81C67CC +sub_81C67CC: @ 81C67CC + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =0x03005e08 + mov r9, r0 + adds r5, r4, r0 + ldr r0, =0x0203cf30 + ldrh r1, [r0, 0x6] + ldrh r0, [r0, 0x8] + adds r1, r0 + strh r1, [r5, 0x2] + ldr r0, =0x0203cf2c + ldr r0, [r0] + ldr r2, =0x00000814 + adds r0, r2 + movs r2, 0 + mov r8, r2 + strb r1, [r0] + ldrb r0, [r5] + movs r1, 0x10 + movs r2, 0x1 + bl sub_81AF15C + ldr r0, =0x03005d90 + ldr r3, [r0] + movs r0, 0x2 + ldrsh r2, [r5, r0] + lsls r2, 1 + ldr r1, =0x00000ca9 + adds r0, r3, r1 + ldrb r1, [r0] + lsls r1, 30 + lsrs r1, 30 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, r0 + ldr r0, =0x00000e2c + adds r3, r0 + adds r3, r2 + ldrh r0, [r3] + ldr r1, =0x02021cc4 + bl itemid_get_name + ldr r6, =0x02021fc4 + ldr r1, =gUnknown_085E8DFE + adds r0, r6, 0 + bl ExpandStringRefs + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + mov r1, r8 + str r1, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + str r1, [sp, 0x8] + str r1, [sp, 0xC] + adds r1, r6, 0 + movs r2, 0x3 + movs r3, 0 + bl sub_81C6C3C + ldrb r0, [r5] + movs r1, 0x1 + bl sub_81C5A98 + ldrb r0, [r5, 0x2] + bl sub_81C704C + movs r2, 0x8 + negs r2, r2 + add r9, r2 + add r4, r9 + ldr r0, =sub_81C68B0 + str r0, [r4] + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C67CC + + thumb_func_start sub_81C68B0 +sub_81C68B0: @ 81C68B0 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081C695C + ldr r7, =0x030022c0 + ldrh r1, [r7, 0x2E] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _081C68F8 + movs r0, 0x5 + bl audio_play + ldrb r0, [r4] + ldr r1, =0x0203cf38 + subs r2, r1, 0x2 + bl get_coro_args_x18_x1A + b _081C6940 + .pool +_081C68F8: + ldrb r0, [r4] + bl ListMenuHandleInput + adds r6, r0, 0 + ldrb r0, [r4] + ldr r4, =0x0203cf38 + subs r2, r4, 0x2 + adds r1, r4, 0 + bl get_coro_args_x18_x1A + movs r0, 0 + bl sub_81C7028 + subs r4, 0x8 + ldrb r0, [r4, 0x6] + bl sub_81C704C + movs r0, 0x2 + negs r0, r0 + cmp r6, r0 + beq _081C6930 + adds r0, 0x1 + cmp r6, r0 + bne _081C6950 + b _081C695C + .pool +_081C6930: + movs r0, 0x5 + bl audio_play + ldrh r1, [r7, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081C6948 +_081C6940: + adds r0, r5, 0 + bl sub_81C6964 + b _081C695C +_081C6948: + adds r0, r5, 0 + bl sub_81C6A14 + b _081C695C +_081C6950: + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_81C6964 +_081C695C: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81C68B0 + + thumb_func_start sub_81C6964 +sub_81C6964: @ 81C6964 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r5, r0, r1 + ldr r7, =0x0203cf38 + subs r0, r7, 0x2 + mov r8, r0 + ldrh r0, [r0] + ldrh r1, [r7] + adds r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + movs r3, 0x2 + ldrsh r1, [r5, r3] + cmp r1, r4 + beq _081C6996 + subs r0, r4, 0x1 + cmp r1, r0 + bne _081C69A8 +_081C6996: + adds r0, r6, 0 + bl sub_81C6A14 + b _081C69FC + .pool +_081C69A8: + ldrb r0, [r5, 0x2] + lsls r1, r4, 24 + lsrs r1, 24 + bl sub_81C57A8 + ldr r0, =0x0203cf2c + ldr r0, [r0] + ldr r1, =0x00000814 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + movs r0, 0x1 + bl sub_81C7028 + ldrb r0, [r5] + adds r1, r7, 0 + mov r2, r8 + bl sub_81AE6C8 + movs r3, 0x2 + ldrsh r0, [r5, r3] + cmp r0, r4 + bge _081C69E0 + adds r1, r7, 0 + subs r1, 0x8 + ldrh r0, [r1, 0x6] + subs r0, 0x1 + strh r0, [r1, 0x6] +_081C69E0: + bl sub_81C5314 + ldr r0, =0x03006310 + ldrh r1, [r7] + mov r3, r8 + ldrh r2, [r3] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + adds r0, r6, 0 + bl sub_81C629C +_081C69FC: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6964 + + thumb_func_start sub_81C6A14 +sub_81C6A14: @ 81C6A14 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + ldr r5, =0x0203cf38 + subs r7, r5, 0x2 + ldr r0, =0x0203cf2c + ldr r0, [r0] + ldr r1, =0x00000814 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + movs r0, 0x1 + bl sub_81C7028 + ldrb r0, [r4] + adds r1, r5, 0 + adds r2, r7, 0 + bl sub_81AE6C8 + movs r0, 0x2 + ldrsh r2, [r4, r0] + ldrh r0, [r5] + ldrh r1, [r7] + adds r0, r1 + cmp r2, r0 + bge _081C6A5E + adds r1, r5, 0 + subs r1, 0x8 + ldrh r0, [r1, 0x6] + subs r0, 0x1 + strh r0, [r1, 0x6] +_081C6A5E: + bl sub_81C5314 + ldr r0, =0x03006310 + ldrh r1, [r5] + ldrh r2, [r7] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + adds r0, r6, 0 + bl sub_81C629C + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6A14 + + thumb_func_start sub_81C6A94 +sub_81C6A94: @ 81C6A94 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + ldr r0, =0x020244ec + mov r9, r0 + movs r0, 0x14 + bl Alloc + adds r7, r0, 0 + movs r0, 0xA + bl Alloc + adds r5, r0, 0 + ldr r1, =0x03005d90 + mov r8, r1 + ldr r2, [r1] + ldr r4, =0x00000ca9 + adds r0, r2, r4 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldr r0, =0x00000e2c + adds r1, r0 + adds r0, r7, 0 + movs r2, 0x14 + bl memcpy + mov r1, r8 + ldr r2, [r1] + adds r0, r2, r4 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 1 + adds r1, r2 + ldr r0, =0x00000e54 + adds r1, r0 + adds r0, r5, 0 + movs r2, 0xA + bl memcpy + movs r6, 0 +_081C6AF8: + movs r0, 0x64 + muls r0, r6 + add r0, r9 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + mov r1, sp + strh r0, [r1] + cmp r0, 0 + beq _081C6B88 + movs r1, 0x1 + bl bag_add_item + lsls r0, 24 + cmp r0, 0 + bne _081C6B88 + mov r1, r8 + ldr r2, [r1] + adds r0, r2, r4 + ldrb r1, [r0] + lsls r1, 30 + lsrs r1, 30 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x00000e2c + adds r0, r1 + adds r1, r7, 0 + movs r2, 0x14 + bl memcpy + mov r0, r8 + ldr r2, [r0] + adds r0, r2, r4 + ldrb r1, [r0] + lsls r1, 30 + lsrs r1, 30 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + adds r0, r2 + ldr r1, =0x00000e54 + adds r0, r1 + adds r1, r5, 0 + movs r2, 0xA + bl memcpy + adds r0, r7, 0 + bl Free + adds r0, r5, 0 + bl Free + ldr r1, =0x020375f0 + movs r0, 0x1 + strh r0, [r1] + b _081C6BC6 + .pool +_081C6B88: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bls _081C6AF8 + movs r1, 0 + mov r0, sp + strh r1, [r0] + movs r6, 0 + movs r4, 0x64 +_081C6B9C: + adds r0, r6, 0 + muls r0, r4 + add r0, r9 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bls _081C6B9C + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + adds r0, r7, 0 + bl Free + adds r0, r5, 0 + bl Free +_081C6BC6: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6A94 + + thumb_func_start sub_81C6BD8 +sub_81C6BD8: @ 81C6BD8 + push {r4,lr} + ldr r0, =gUnknown_0861F328 + bl InitWindows + bl DeactivateAllTextPrinters + movs r0, 0 + movs r1, 0x1 + movs r2, 0xE0 + bl sub_809882C + movs r0, 0 + movs r1, 0xA + movs r2, 0xD0 + bl copy_textbox_border_tile_patterns_to_vram + ldr r0, =gUnknown_0860F074 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + movs r4, 0 +_081C6C04: + adds r0, r4, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _081C6C04 + movs r0, 0 + bl PutWindowTilemap + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6BD8 + + thumb_func_start sub_81C6C3C +sub_81C6C3C: @ 81C6C3C + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x14 + ldr r4, [sp, 0x28] + ldr r6, [sp, 0x2C] + ldr r5, [sp, 0x30] + mov r8, r5 + ldr r5, [sp, 0x34] + lsls r0, 24 + lsrs r0, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r5, 24 + lsrs r5, 24 + str r4, [sp] + str r6, [sp, 0x4] + lsls r4, r5, 1 + adds r4, r5 + ldr r5, =gUnknown_0861F31C + adds r4, r5 + str r4, [sp, 0x8] + mov r4, r8 + lsls r4, 24 + asrs r4, 24 + str r4, [sp, 0xC] + str r1, [sp, 0x10] + movs r1, 0x1 + bl AddTextPrinterParametrized2 + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6C3C + + thumb_func_start sub_81C6C94 +sub_81C6C94: @ 81C6C94 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x14 + ldr r4, [sp, 0x28] + ldr r6, [sp, 0x2C] + ldr r5, [sp, 0x30] + mov r8, r5 + ldr r5, [sp, 0x34] + lsls r0, 24 + lsrs r0, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r5, 24 + lsrs r5, 24 + str r4, [sp] + str r6, [sp, 0x4] + lsls r4, r5, 1 + adds r4, r5 + ldr r5, =gUnknown_0861F31C + adds r4, r5 + str r4, [sp, 0x8] + mov r4, r8 + lsls r4, 24 + asrs r4, 24 + str r4, [sp, 0xC] + str r1, [sp, 0x10] + movs r1, 0x7 + bl AddTextPrinterParametrized2 + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6C94 + + thumb_func_start sub_81C6CEC +sub_81C6CEC: @ 81C6CEC + push {lr} + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + movs r2, 0x1 + movs r3, 0xE + bl SetWindowBorderStyle + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + pop {r0} + bx r0 + thumb_func_end sub_81C6CEC + + thumb_func_start sub_81C6D08 +sub_81C6D08: @ 81C6D08 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0203cf2c + ldr r1, [r1] + ldr r2, =0x0000080f + adds r1, r2 + adds r1, r0 + ldrb r0, [r1] + bx lr + .pool + thumb_func_end sub_81C6D08 + + thumb_func_start sub_81C6D24 +sub_81C6D24: @ 81C6D24 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x0203cf2c + ldr r3, =0x0000080f + adds r1, r2, r3 + ldr r0, [r0] + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0xFF + bne _081C6D58 + lsls r0, r2, 3 + ldr r1, =gUnknown_0861F350 + adds r0, r1 + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + movs r2, 0x1 + movs r3, 0xE + bl SetWindowBorderStyle + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram +_081C6D58: + ldrb r0, [r4] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81C6D24 + + thumb_func_start sub_81C6D6C +sub_81C6D6C: @ 81C6D6C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0203cf2c + ldr r2, =0x0000080f + adds r0, r2 + ldr r1, [r1] + adds r4, r1, r0 + ldrb r0, [r4] + cmp r0, 0xFF + beq _081C6D9E + movs r1, 0 + bl sub_8198070 + ldrb r0, [r4] + bl ClearWindowTilemap + ldrb r0, [r4] + bl RemoveWindow + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0xFF + strb r0, [r4] +_081C6D9E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6D6C + + thumb_func_start sub_81C6DAC +sub_81C6DAC: @ 81C6DAC + push {lr} + sub sp, 0x10 + adds r3, r1, 0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0861F370 + movs r2, 0x2 + str r2, [sp] + movs r2, 0x1 + str r2, [sp, 0x4] + movs r2, 0xE + str r2, [sp, 0x8] + str r3, [sp, 0xC] + movs r2, 0x1 + movs r3, 0 + bl CreateYesNoMenuWithCallbacks + add sp, 0x10 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6DAC + + thumb_func_start DisplayItemMessageInBattlePyramid +@ void DisplayItemMessageInBattlePyramid(u8 taskId, u8 *str, void ( *callback)(u8 taskId)) +DisplayItemMessageInBattlePyramid: @ 81C6DD8 + push {r4-r6,lr} + sub sp, 0x10 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x2 + movs r1, 0x11 + bl FillWindowPixelBuffer + bl sav2_get_text_speed + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + str r1, [sp] + str r0, [sp, 0x4] + str r5, [sp, 0x8] + str r6, [sp, 0xC] + adds r0, r4, 0 + movs r1, 0x2 + movs r2, 0xA + movs r3, 0xD + bl DisplayMessageAndContinueTask + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end DisplayItemMessageInBattlePyramid + + thumb_func_start sub_81C6E1C +sub_81C6E1C: @ 81C6E1C + push {lr} + movs r0, 0x2 + movs r1, 0 + bl sub_8197DF8 + movs r0, 0x2 + bl ClearWindowTilemap + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + pop {r0} + bx r0 + thumb_func_end sub_81C6E1C + + thumb_func_start sub_81C6E38 +sub_81C6E38: @ 81C6E38 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x0203cf2c + ldr r2, =0x00000804 + adds r1, r4, r2 + ldr r0, [r0] + adds r5, r0, r1 + ldrb r0, [r5] + cmp r0, 0xFF + beq _081C6E80 + ldr r0, =0x00001024 + adds r4, r0 + adds r0, r4, 0 + bl FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl obj_free_rotscale_entry + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + movs r0, 0xFF + strb r0, [r5] +_081C6E80: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6E38 + + thumb_func_start sub_81C6E98 +sub_81C6E98: @ 81C6E98 + push {r4,lr} + sub sp, 0x8 + movs r0, 0x40 + bl Alloc + adds r4, r0, 0 + ldr r0, =gUnknown_08D9ADD0 + adds r1, r4, 0 + bl LZDecompressWram + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 25 + adds r0, r4, r0 + str r0, [sp] + ldr r1, =0xffff0000 + ldr r0, [sp, 0x4] + ands r0, r1 + ldr r1, =0x00001024 + orrs r0, r1 + str r0, [sp, 0x4] + mov r0, sp + bl LoadTaggedObjectPalette + adds r0, r4, 0 + bl Free + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6E98 + + thumb_func_start sub_81C6EF4 +sub_81C6EF4: @ 81C6EF4 + push {r4,lr} + ldr r0, =0x0203cf2c + ldr r4, [r0] + ldr r0, =0x00000804 + adds r4, r0 + ldr r0, =gUnknown_0861F3D4 + movs r1, 0x44 + movs r2, 0x38 + movs r3, 0 + bl AddObjectToFront + strb r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6EF4 + + thumb_func_start sub_81C6F20 +sub_81C6F20: @ 81C6F20 + push {r4,lr} + ldr r0, =0x0203cf2c + ldr r0, [r0] + ldr r1, =0x00000804 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r4, r0, r1 + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _081C6F50 + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim + ldr r0, =sub_81C6F68 + str r0, [r4, 0x1C] +_081C6F50: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6F20 + + thumb_func_start sub_81C6F68 +sub_81C6F68: @ 81C6F68 + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _081C6F84 + adds r0, r4, 0 + movs r1, 0 + bl StartObjectRotScalAnim + ldr r0, =DummyObjectCallback + str r0, [r4, 0x1C] +_081C6F84: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6F68 + + thumb_func_start sub_81C6F90 +sub_81C6F90: @ 81C6F90 + push {r4-r6,lr} + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 24 + lsrs r4, r1, 24 + ldr r0, =0x0203cf2c + ldr r2, =0x00000805 + adds r1, r4, r2 + ldr r0, [r0] + adds r5, r0, r1 + ldrb r0, [r5] + cmp r0, 0xFF + bne _081C6FE0 + ldr r0, =0x00001025 + adds r4, r0 + adds r0, r4, 0 + bl FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r6, 0 + bl AddItemIconObject + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _081C6FE0 + strb r2, [r5] + ldr r1, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + movs r1, 0x18 + strh r1, [r0, 0x24] + movs r1, 0x58 + strh r1, [r0, 0x26] +_081C6FE0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C6F90 + + thumb_func_start sub_81C6FF8 +sub_81C6FF8: @ 81C6FF8 + push {lr} + lsls r0, 24 + movs r1, 0x80 + lsls r1, 17 + adds r0, r1 + lsrs r0, 24 + bl sub_81C6E38 + pop {r0} + bx r0 + thumb_func_end sub_81C6FF8 + + thumb_func_start sub_81C700C +sub_81C700C: @ 81C700C + push {lr} + ldr r0, =0x0203cf2c + ldr r0, [r0] + ldr r1, =0x00000807 + adds r0, r1 + movs r1, 0x8 + bl sub_8122344 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C700C + + thumb_func_start sub_81C7028 +sub_81C7028: @ 81C7028 + push {lr} + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =0x0203cf2c + ldr r0, [r0] + ldr r1, =0x00000807 + adds r0, r1 + movs r1, 0x8 + bl sub_81223FC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C7028 + + thumb_func_start sub_81C704C +sub_81C704C: @ 81C704C + push {lr} + adds r3, r0, 0 + lsls r3, 24 + ldr r0, =0x0203cf2c + ldr r0, [r0] + ldr r1, =0x00000807 + adds r0, r1 + lsrs r3, 4 + movs r1, 0x80 + lsls r1, 13 + adds r3, r1 + lsrs r3, 16 + movs r1, 0x88 + movs r2, 0x78 + bl sub_8122448 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C704C + + thumb_func_start sub_81C7078 +sub_81C7078: @ 81C7078 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + bl is_c1_link_related_active + cmp r0, 0 + bne _081C7090 + ldr r0, =sub_81C7170 + b _081C7092 + .pool +_081C7090: + ldr r0, =sub_81C71E4 +_081C7092: + lsls r1, r4, 24 + lsrs r1, 24 + bl AddTask + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + movs r1, 0x1 + adds r2, r5, 0 + bl set_word_task_arg + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r2, =0x0203cf3c + ldrb r1, [r2] + strh r1, [r0, 0xE] + ldrb r0, [r2] + adds r1, r0, 0x1 + strb r1, [r2] + lsls r0, 24 + lsrs r0, 8 + orrs r0, r4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81C7078 + + thumb_func_start sub_81C70D8 +sub_81C70D8: @ 81C70D8 + push {lr} + ldr r1, =0x0000ffff + ands r1, r0 + lsrs r3, r0, 16 + ldr r2, =0x03005e00 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r1, r0, r2 + ldrb r0, [r1, 0x4] + cmp r0, 0 + beq _081C711C + ldr r2, [r1] + ldr r0, =sub_81C7170 + cmp r2, r0 + beq _081C70FE + ldr r0, =sub_81C71E4 + cmp r2, r0 + bne _081C711C +_081C70FE: + movs r2, 0xE + ldrsh r0, [r1, r2] + cmp r0, r3 + bne _081C711C + movs r0, 0x1 + b _081C711E + .pool +_081C711C: + movs r0, 0 +_081C711E: + pop {r1} + bx r1 + thumb_func_end sub_81C70D8 + + thumb_func_start sub_81C7124 +sub_81C7124: @ 81C7124 + push {r4-r6,lr} + adds r6, r0, 0 + movs r5, 0 + ldr r4, =0x03005e00 +_081C712C: + ldrb r0, [r4, 0x4] + cmp r0, 0 + beq _081C7160 + ldr r1, [r4] + ldr r0, =sub_81C7170 + cmp r1, r0 + beq _081C7140 + ldr r0, =sub_81C71E4 + cmp r1, r0 + bne _081C7160 +_081C7140: + lsls r0, r5, 24 + lsrs r0, 24 + movs r1, 0x1 + bl get_word_task_arg + cmp r0, r6 + bne _081C7160 + movs r0, 0x1 + b _081C716A + .pool +_081C7160: + adds r4, 0x28 + adds r5, 0x1 + cmp r5, 0xF + ble _081C712C + movs r0, 0 +_081C716A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81C7124 + + thumb_func_start sub_81C7170 +sub_81C7170: @ 81C7170 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + movs r1, 0x1 + bl get_word_task_arg + adds r6, r0, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + movs r7, 0 +_081C718C: + movs r1, 0 + ldrsh r0, [r4, r1] + bl _call_via_r6 + cmp r0, 0x4 + bhi _081C71D6 + lsls r0, 2 + ldr r1, =_081C71AC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081C71AC: + .4byte _081C71C6 + .4byte _081C71C0 + .4byte _081C71DE + .4byte _081C71DA + .4byte _081C71CE +_081C71C0: + ldrh r0, [r4] + adds r0, 0x1 + b _081C71D8 +_081C71C6: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _081C71DE +_081C71CE: + adds r0, r5, 0 + bl remove_task + b _081C71DE +_081C71D6: + subs r0, 0x5 +_081C71D8: + strh r0, [r4] +_081C71DA: + cmp r7, 0 + beq _081C718C +_081C71DE: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81C7170 + + thumb_func_start sub_81C71E4 +sub_81C71E4: @ 81C71E4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_8087598 + cmp r0, 0 + bne _081C724A + adds r0, r5, 0 + movs r1, 0x1 + bl get_word_task_arg + adds r2, r0, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + movs r1, 0 + ldrsh r0, [r4, r1] + bl _call_via_r2 + cmp r0, 0x4 + bhi _081C7246 + lsls r0, 2 + ldr r1, =_081C7224 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081C7224: + .4byte _081C7238 + .4byte _081C7238 + .4byte _081C724A + .4byte _081C724A + .4byte _081C723E +_081C7238: + ldrh r0, [r4] + adds r0, 0x1 + b _081C7248 +_081C723E: + adds r0, r5, 0 + bl remove_task + b _081C724A +_081C7246: + subs r0, 0x5 +_081C7248: + strh r0, [r4] +_081C724A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81C71E4 + + thumb_func_start CB2_PokeNav +CB2_PokeNav: @ 81C7250 + push {r4,lr} + ldr r4, =0x0203cf40 + movs r0, 0x5C + bl Alloc + str r0, [r4] + cmp r0, 0 + bne _081C7270 + ldr r0, =sub_8086194 + bl SetMainCallback2 + b _081C7292 + .pool +_081C7270: + bl sub_81C7360 + bl clear_tasks + movs r0, 0 + bl SetVBlankCallback + ldr r0, =sub_81C742C + movs r1, 0 + bl AddTask + ldr r0, =sub_81C7400 + bl SetMainCallback2 + ldr r0, =sub_81C7418 + bl SetVBlankCallback +_081C7292: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end CB2_PokeNav + + thumb_func_start sub_81C72A4 +sub_81C72A4: @ 81C72A4 + push {lr} + ldr r0, =sub_81C72BC + bl SetMainCallback2 + movs r0, 0x1 + movs r1, 0 + bl fade_screen + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C72A4 + + thumb_func_start sub_81C72BC +sub_81C72BC: @ 81C72BC + push {r4,lr} + bl fade_and_return_progress_probably + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081C7320 + ldr r4, =0x0203cf40 + movs r0, 0x5C + bl Alloc + str r0, [r4] + cmp r0, 0 + bne _081C72F0 + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 + b _081C7320 + .pool +_081C72F0: + bl sub_81C7360 + ldr r1, [r4] + movs r0, 0x1 + strh r0, [r1, 0x8] + bl clear_tasks + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + movs r0, 0 + bl SetVBlankCallback + ldr r0, =sub_81C742C + movs r1, 0 + bl AddTask + ldr r0, =sub_81C7400 + bl SetMainCallback2 + ldr r0, =sub_81C7418 + bl SetVBlankCallback +_081C7320: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C72BC + + thumb_func_start sub_81C7334 +sub_81C7334: @ 81C7334 + push {r4,lr} + movs r4, 0 +_081C7338: + adds r0, r4, 0 + bl sub_81C7650 + adds r4, 0x1 + cmp r4, 0x12 + ble _081C7338 + ldr r4, =0x0203cf40 + ldr r0, [r4] + bl Free + movs r0, 0 + str r0, [r4] + bl InitKeypadData + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C7334 + + thumb_func_start sub_81C7360 +sub_81C7360: @ 81C7360 + push {r4,r5,lr} + adds r5, r0, 0 + movs r2, 0 + movs r1, 0x12 + adds r0, 0x58 +_081C736A: + str r2, [r0] + subs r0, 0x4 + subs r1, 0x1 + cmp r1, 0 + bge _081C736A + movs r4, 0 + strh r4, [r5, 0x8] + str r4, [r5, 0x4] + bl sub_81C7388 + str r0, [r5, 0xC] + str r4, [r5] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81C7360 + + thumb_func_start sub_81C7388 +sub_81C7388: @ 81C7388 + push {r4-r6,lr} + movs r5, 0 +_081C738C: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x5 + bl pokemon_getattr + cmp r0, 0 + beq _081C73BA + adds r0, r4, 0 + movs r1, 0x6 + bl pokemon_getattr + cmp r0, 0 + bne _081C73BA + adds r0, r4, 0 + movs r1, 0x52 + bl pokemon_getattr + cmp r0, 0 + bne _081C73E2 +_081C73BA: + adds r5, 0x1 + cmp r5, 0x5 + ble _081C738C + movs r4, 0 +_081C73C2: + movs r5, 0 + lsls r6, r4, 24 +_081C73C6: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80D2270 + cmp r0, 0 + beq _081C73EC + lsls r1, r5, 24 + lsrs r1, 24 + lsrs r0, r6, 24 + movs r2, 0x52 + bl get_pokemon_data_from_any_box + cmp r0, 0 + beq _081C73EC +_081C73E2: + movs r0, 0x1 + b _081C73FA + .pool +_081C73EC: + adds r5, 0x1 + cmp r5, 0x1D + ble _081C73C6 + adds r4, 0x1 + cmp r4, 0xD + ble _081C73C2 + movs r0, 0 +_081C73FA: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81C7388 + + thumb_func_start sub_81C7400 +sub_81C7400: @ 81C7400 + push {lr} + bl RunActiveTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_81C7400 + + thumb_func_start sub_81C7418 +sub_81C7418: @ 81C7418 + push {lr} + bl copy_pal_bg_faded_to_pal_ram + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + pop {r0} + bx r0 + thumb_func_end sub_81C7418 + + thumb_func_start sub_81C742C +sub_81C742C: @ 81C742C + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r7, r1, r0 + movs r1, 0 + ldrsh r0, [r7, r1] + cmp r0, 0x5 + bls _081C7446 + b _081C7562 +_081C7446: + lsls r0, 2 + ldr r1, =_081C7458 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081C7458: + .4byte _081C7470 + .4byte _081C747A + .4byte _081C7490 + .4byte _081C749C + .4byte _081C751E + .4byte _081C752C +_081C7470: + bl sub_81C76C4 + movs r0, 0x1 + strh r0, [r7] + b _081C7562 +_081C747A: + bl sub_81C76FC + cmp r0, 0 + bne _081C7562 + ldr r0, =0x000186a0 + bl sub_81C756C + b _081C74E8 + .pool +_081C7490: + bl sub_81C786C + cmp r0, 0 + bne _081C7562 + movs r0, 0x3 + strh r0, [r7] +_081C749C: + bl sub_81C75E0 + adds r6, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r6, r0 + beq _081C74FC + ldr r0, =0x0001869f + cmp r6, r0 + bls _081C7506 + ldr r4, =gUnknown_0861F3EC + ldr r5, =0x0203cf40 + ldr r0, [r5] + ldr r1, [r0, 0x4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x18 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, [r5] + ldr r1, [r0, 0x4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r4, 0x14 + adds r0, r4 + ldr r0, [r0] + bl _call_via_r0 + adds r0, r6, 0 + bl sub_81C756C + cmp r0, 0 + beq _081C74FC +_081C74E8: + movs r0, 0x4 + strh r0, [r7] + b _081C7562 + .pool +_081C74FC: + bl sub_81C7710 + movs r0, 0x5 + strh r0, [r7] + b _081C7562 +_081C7506: + cmp r6, 0 + beq _081C7562 + adds r0, r6, 0 + bl sub_81C7850 + bl sub_81C786C + cmp r0, 0 + beq _081C7562 + movs r0, 0x2 + strh r0, [r7] + b _081C7562 +_081C751E: + bl sub_81C75D4 + cmp r0, 0 + bne _081C7562 + movs r0, 0x3 + strh r0, [r7] + b _081C7562 +_081C752C: + bl sub_81C7738 + cmp r0, 0 + bne _081C7562 + ldr r0, =0x0203cf40 + ldr r0, [r0] + ldrh r0, [r0, 0x8] + negs r4, r0 + orrs r4, r0 + lsrs r4, 31 + bl sub_81C9430 + bl sub_81C7334 + cmp r4, 0 + beq _081C755C + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 + b _081C7562 + .pool +_081C755C: + ldr r0, =sub_8086194 + bl SetMainCallback2 +_081C7562: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C742C + + thumb_func_start sub_81C756C +sub_81C756C: @ 81C756C + push {r4-r6,lr} + ldr r1, =0xfffe7960 + adds r6, r0, r1 + bl sub_81C75F4 + ldr r5, =gUnknown_0861F3EC + lsls r0, r6, 3 + subs r0, r6 + lsls r4, r0, 2 + adds r0, r4, r5 + ldr r0, [r0] + bl _call_via_r0 + cmp r0, 0 + beq _081C75CC + adds r0, r5, 0 + adds r0, 0x8 + adds r0, r4, r0 + ldr r0, [r0] + bl _call_via_r0 + cmp r0, 0 + beq _081C75CC + adds r0, r5, 0 + adds r0, 0xC + adds r0, r4, r0 + ldr r0, [r0] + adds r1, r5, 0 + adds r1, 0x10 + adds r1, r4, r1 + ldr r1, [r1] + bl sub_81C7834 + ldr r0, =0x0203cf40 + ldr r1, [r0] + adds r0, r5, 0x4 + adds r0, r4, r0 + ldr r0, [r0] + str r0, [r1] + str r6, [r1, 0x4] + movs r0, 0x1 + b _081C75CE + .pool +_081C75CC: + movs r0, 0 +_081C75CE: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81C756C + + thumb_func_start sub_81C75D4 +sub_81C75D4: @ 81C75D4 + push {lr} + bl sub_81C786C + pop {r1} + bx r1 + thumb_func_end sub_81C75D4 + + thumb_func_start sub_81C75E0 +sub_81C75E0: @ 81C75E0 + push {lr} + ldr r0, =0x0203cf40 + ldr r0, [r0] + ldr r0, [r0] + bl _call_via_r0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81C75E0 + + thumb_func_start sub_81C75F4 +sub_81C75F4: @ 81C75F4 + push {lr} + bl InitKeypadData + pop {r0} + bx r0 + thumb_func_end sub_81C75F4 + + thumb_func_start c3args_set_0toR1_1to0 +c3args_set_0toR1_1to0: @ 81C7600 + push {lr} + bl SetVBlankCallback + pop {r0} + bx r0 + thumb_func_end c3args_set_0toR1_1to0 + + thumb_func_start sub_81C760C +sub_81C760C: @ 81C760C + push {lr} + ldr r0, =sub_81C7418 + bl SetVBlankCallback + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C760C + + thumb_func_start sub_81C761C +sub_81C761C: @ 81C761C + push {r4,lr} + adds r4, r0, 0 + adds r0, r1, 0 + bl Alloc + ldr r1, =0x0203cf40 + ldr r1, [r1] + lsls r4, 2 + adds r1, 0x10 + adds r1, r4 + str r0, [r1] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81C761C + + thumb_func_start sub_81C763C +sub_81C763C: @ 81C763C + ldr r1, =0x0203cf40 + ldr r1, [r1] + lsls r0, 2 + adds r1, 0x10 + adds r1, r0 + ldr r0, [r1] + bx lr + .pool + thumb_func_end sub_81C763C + + thumb_func_start sub_81C7650 +sub_81C7650: @ 81C7650 + push {r4,r5,lr} + ldr r5, =0x0203cf40 + ldr r1, [r5] + lsls r4, r0, 2 + adds r1, 0x10 + adds r1, r4 + ldr r0, [r1] + cmp r0, 0 + beq _081C7670 + bl Free + ldr r0, [r5] + adds r0, 0x10 + adds r0, r4 + movs r1, 0 + str r1, [r0] +_081C7670: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C7650 + + thumb_func_start sub_81C767C +sub_81C767C: @ 81C767C + ldr r0, =0x0203cf40 + ldr r0, [r0] + ldrh r0, [r0, 0x8] + bx lr + .pool + thumb_func_end sub_81C767C + + thumb_func_start sub_81C7688 +sub_81C7688: @ 81C7688 + ldr r1, =0x0203cf40 + ldr r1, [r1] + strh r0, [r1, 0x8] + bx lr + .pool + thumb_func_end sub_81C7688 + + thumb_func_start sub_81C7694 +sub_81C7694: @ 81C7694 + push {lr} + adds r1, r0, 0 + cmp r1, 0x4 + bls _081C769E + movs r1, 0 +_081C769E: + ldr r0, =0x0203cf40 + ldr r0, [r0] + strh r1, [r0, 0xA] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C7694 + + thumb_func_start sub_81C76AC +sub_81C76AC: @ 81C76AC + ldr r0, =0x0203cf40 + ldr r0, [r0] + ldrh r0, [r0, 0xA] + bx lr + .pool + thumb_func_end sub_81C76AC + + thumb_func_start sub_81C76B8 +sub_81C76B8: @ 81C76B8 + ldr r0, =0x0203cf40 + ldr r0, [r0] + ldr r0, [r0, 0xC] + bx lr + .pool + thumb_func_end sub_81C76B8 + + thumb_func_start sub_81C76C4 +sub_81C76C4: @ 81C76C4 + push {r4,lr} + ldr r1, =0x0000082c + movs r0, 0 + bl sub_81C761C + adds r4, r0, 0 + cmp r4, 0 + beq _081C76F4 + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + ldr r0, =sub_81C7764 + movs r1, 0x1 + bl sub_81C7078 + str r0, [r4, 0xC] + movs r0, 0x1 + b _081C76F6 + .pool +_081C76F4: + movs r0, 0 +_081C76F6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81C76C4 + + thumb_func_start sub_81C76FC +sub_81C76FC: @ 81C76FC + push {lr} + movs r0, 0 + bl sub_81C763C + ldr r0, [r0, 0xC] + bl sub_81C70D8 + pop {r1} + bx r1 + thumb_func_end sub_81C76FC + + thumb_func_start sub_81C7710 +sub_81C7710: @ 81C7710 + push {lr} + sub sp, 0x4 + movs r0, 0x6F + bl audio_play + bl sub_81CAADC + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_81C7710 + + thumb_func_start sub_81C7738 +sub_81C7738: @ 81C7738 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081C7750 + movs r0, 0x1 + b _081C775E + .pool +_081C7750: + bl sub_81C99D4 + bl sub_81C7C94 + bl FreeAllWindowBuffers + movs r0, 0 +_081C775E: + pop {r1} + bx r1 + thumb_func_end sub_81C7738 + + thumb_func_start sub_81C7764 +sub_81C7764: @ 81C7764 + push {r4,lr} + sub sp, 0x4 + cmp r0, 0x1 + beq _081C77B0 + cmp r0, 0x1 + bgt _081C7776 + cmp r0, 0 + beq _081C7780 + b _081C782A +_081C7776: + cmp r0, 0x2 + beq _081C77FC + cmp r0, 0x3 + beq _081C780E + b _081C782A +_081C7780: + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + bl FreeAllWindowBuffers + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0861FA04 + movs r0, 0 + movs r2, 0x1 + bl InitBgsFromTemplates + bl sub_8199D98 + bl reset_temp_tile_data_buffers + movs r0, 0x1 + b _081C782C + .pool +_081C77B0: + movs r0, 0 + bl sub_81C763C + adds r4, r0, 0 + ldr r1, =gUnknown_08DC7B80 + movs r0, 0 + str r0, [sp] + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + adds r4, 0x2C + movs r0, 0 + adds r1, r4, 0 + bl SetBgTilemapBuffer + ldr r1, =gUnknown_08DC7D84 + movs r0, 0 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + ldr r0, =gUnknown_08DC7B60 + movs r1, 0 + movs r2, 0x20 + bl sub_81C7944 + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0 + b _081C782C + .pool +_081C77FC: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _081C7818 + bl sub_81C7B74 + movs r0, 0 + b _081C782C +_081C780E: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _081C781C +_081C7818: + movs r0, 0x2 + b _081C782C +_081C781C: + bl sub_81C7C28 + bl sub_81C7D28 + movs r0, 0 + bl ShowBg +_081C782A: + movs r0, 0x4 +_081C782C: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81C7764 + + thumb_func_start sub_81C7834 +sub_81C7834: @ 81C7834 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0 + bl sub_81C763C + str r4, [r0] + str r5, [r0, 0x4] + movs r1, 0 + str r1, [r0, 0x8] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81C7834 + + thumb_func_start sub_81C7850 +sub_81C7850: @ 81C7850 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0 + bl sub_81C763C + movs r1, 0 + str r1, [r0, 0x8] + ldr r1, [r0] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81C7850 + + thumb_func_start sub_81C786C +sub_81C786C: @ 81C786C + push {lr} + movs r0, 0 + bl sub_81C763C + ldr r0, [r0, 0x4] + bl _call_via_r0 + pop {r1} + bx r1 + thumb_func_end sub_81C786C + + thumb_func_start sub_81C7880 +sub_81C7880: @ 81C7880 + push {r4,lr} + movs r0, 0 + bl sub_81C763C + adds r4, r0, 0 + ldr r0, =atk47_cmd47 + movs r1, 0x4 + bl sub_81C7078 + str r0, [r4, 0xC] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C7880 + + thumb_func_start sub_81C78A0 +sub_81C78A0: @ 81C78A0 + push {r4,lr} + movs r0, 0 + bl sub_81C763C + adds r4, r0, 0 + ldr r0, =sub_81C791C + movs r1, 0x4 + bl sub_81C7078 + str r0, [r4, 0xC] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C78A0 + + thumb_func_start sub_81C78C0 +sub_81C78C0: @ 81C78C0 + push {lr} + movs r0, 0 + bl sub_81C763C + ldr r0, [r0, 0xC] + bl sub_81C70D8 + pop {r1} + bx r1 + thumb_func_end sub_81C78C0 + + thumb_func_start atk47_cmd47 +atk47_cmd47: @ 81C78D4 + push {lr} + cmp r0, 0x1 + beq _081C78EA + cmp r0, 0x1 + bgt _081C78E4 + cmp r0, 0 + beq _081C78EA + b _081C7914 +_081C78E4: + cmp r0, 0x2 + beq _081C78EE + b _081C7914 +_081C78EA: + movs r0, 0 + b _081C7916 +_081C78EE: + movs r1, 0xC0 + lsls r1, 1 + movs r0, 0 + movs r2, 0x1 + bl ChangeBgY + ldr r1, =0x00001fff + cmp r0, r1 + bhi _081C7908 + movs r0, 0x2 + b _081C7916 + .pool +_081C7908: + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + movs r2, 0 + bl ChangeBgY +_081C7914: + movs r0, 0x4 +_081C7916: + pop {r1} + bx r1 + thumb_func_end atk47_cmd47 + + thumb_func_start sub_81C791C +sub_81C791C: @ 81C791C + push {lr} + movs r1, 0xC0 + lsls r1, 1 + movs r0, 0 + movs r2, 0x2 + bl ChangeBgY + cmp r0, 0 + ble _081C7932 + movs r0, 0x2 + b _081C793E +_081C7932: + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x4 +_081C793E: + pop {r1} + bx r1 + thumb_func_end sub_81C791C + + thumb_func_start sub_81C7944 +sub_81C7944: @ 81C7944 + push {lr} + lsls r1, 1 + ldr r3, =0x02037714 + adds r1, r3 + lsls r2, 10 + lsrs r2, 11 + bl CpuSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C7944 + + thumb_func_start sub_81C795C +sub_81C795C: @ 81C795C + push {r4,lr} + adds r4, r0, 0 + b _081C7974 +_081C7962: + lsls r0, r1, 4 + movs r2, 0x80 + lsls r2, 1 + adds r1, r0, r2 + ldr r0, [r4] + movs r2, 0x20 + bl sub_81C7944 + adds r4, 0x8 +_081C7974: + ldr r0, [r4] + cmp r0, 0 + beq _081C7988 + ldrh r0, [r4, 0x4] + bl AllocObjectPalette + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xFF + bne _081C7962 +_081C7988: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81C795C + + thumb_func_start sub_81C7990 +sub_81C7990: @ 81C7990 + push {lr} + sub sp, 0x4 + adds r3, r0, 0 + lsls r1, 16 + lsrs r1, 16 + mov r0, sp + strh r1, [r0] + lsls r3, 5 + ldr r0, =0x02037d14 + adds r3, r0 + ldr r2, =0x01000010 + mov r0, sp + adds r1, r3, 0 + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C7990 + + thumb_func_start sub_81C79BC +sub_81C79BC: @ 81C79BC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + str r0, [sp] + str r1, [sp, 0x4] + mov r10, r2 + str r3, [sp, 0x8] + ldr r0, [sp, 0x2C] + cmp r0, 0 + bne _081C79E4 + ldr r2, =0x001fffff + mov r1, r10 + ands r2, r1 + ldr r0, [sp] + b _081C79F4 + .pool +_081C79E4: + ldr r2, [sp, 0x2C] + ldr r0, [sp, 0x8] + cmp r2, r0 + blt _081C7A00 + ldr r2, =0x001fffff + mov r1, r10 + ands r2, r1 + ldr r0, [sp, 0x4] +_081C79F4: + ldr r1, [sp, 0x30] + bl CpuSet + b _081C7AAE + .pool +_081C7A00: + movs r2, 0x1 + negs r2, r2 + add r10, r2 + b _081C7AA6 +_081C7A08: + ldr r1, [sp] + ldrh r0, [r1] + movs r2, 0x1F + mov r9, r2 + mov r1, r9 + ands r1, r0 + mov r9, r1 + lsls r0, 16 + lsrs r2, r0, 21 + movs r1, 0x1F + ands r1, r2 + mov r8, r1 + lsrs r7, r0, 26 + movs r2, 0x1F + ands r7, r2 + ldr r0, [sp, 0x4] + ldrh r4, [r0] + movs r0, 0x1F + ands r0, r4 + mov r1, r9 + subs r0, r1 + lsls r0, 8 + ldr r1, [sp, 0x8] + bl __divsi3 + ldr r2, [sp, 0x2C] + adds r6, r0, 0 + muls r6, r2 + asrs r6, 8 + lsls r4, 16 + lsrs r0, r4, 21 + movs r1, 0x1F + ands r0, r1 + mov r2, r8 + subs r0, r2 + lsls r0, 8 + ldr r1, [sp, 0x8] + bl __divsi3 + ldr r1, [sp, 0x2C] + adds r5, r0, 0 + muls r5, r1 + asrs r5, 8 + lsrs r4, 26 + movs r2, 0x1F + ands r4, r2 + subs r4, r7 + lsls r4, 8 + adds r0, r4, 0 + ldr r1, [sp, 0x8] + bl __divsi3 + ldr r1, [sp, 0x2C] + muls r0, r1 + asrs r0, 8 + add r6, r9 + movs r2, 0x1F + ands r6, r2 + add r5, r8 + ands r5, r2 + adds r0, r7, r0 + ands r0, r2 + lsls r0, 10 + lsls r5, 5 + orrs r0, r5 + orrs r0, r6 + ldr r1, [sp, 0x30] + strh r0, [r1] + ldr r2, [sp] + adds r2, 0x2 + str r2, [sp] + ldr r0, [sp, 0x4] + adds r0, 0x2 + str r0, [sp, 0x4] + adds r1, 0x2 + str r1, [sp, 0x30] + movs r1, 0x1 + negs r1, r1 + add r10, r1 +_081C7AA6: + movs r0, 0x1 + negs r0, r0 + cmp r10, r0 + bne _081C7A08 +_081C7AAE: + 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_81C79BC + + thumb_func_start sub_81C7AC0 +sub_81C7AC0: @ 81C7AC0 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + movs r0, 0 + bl sub_81C763C + cmp r4, 0x1 + beq _081C7AF0 + cmp r4, 0x1 + bgt _081C7ADA + cmp r4, 0 + beq _081C7AE4 + b _081C7B2C +_081C7ADA: + cmp r4, 0x2 + beq _081C7B04 + cmp r4, 0x3 + beq _081C7B18 + b _081C7B2C +_081C7AE4: + ldr r0, [r0, 0x14] + movs r1, 0x2 + negs r1, r1 + str r4, [sp] + movs r2, 0 + b _081C7B10 +_081C7AF0: + ldr r0, [r0, 0x14] + movs r1, 0x2 + negs r1, r1 + movs r2, 0 + str r2, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + b _081C7B2C +_081C7B04: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x2 + negs r1, r1 + movs r2, 0 + str r2, [sp] +_081C7B10: + movs r3, 0x10 + bl pal_fade_maybe + b _081C7B2C +_081C7B18: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x2 + negs r1, r1 + movs r2, 0 + str r2, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe +_081C7B2C: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81C7AC0 + + thumb_func_start sub_81C7B34 +sub_81C7B34: @ 81C7B34 + ldr r0, =0x02037fd4 + ldrb r0, [r0, 0x7] + lsrs r0, 7 + bx lr + .pool + thumb_func_end sub_81C7B34 + + thumb_func_start sub_81C7B40 +sub_81C7B40: @ 81C7B40 + push {lr} + ldr r0, =0xfffefffe + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C7B40 + + thumb_func_start sub_81C7B54 +sub_81C7B54: @ 81C7B54 + push {r4,r5,lr} + adds r5, r0, 0 + cmp r1, 0 + ble _081C7B6C + adds r4, r1, 0 +_081C7B5E: + adds r0, r5, 0 + adds r5, 0x4 + bl InitBgFromTemplate + subs r4, 0x1 + cmp r4, 0 + bne _081C7B5E +_081C7B6C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81C7B54 + + thumb_func_start sub_81C7B74 +sub_81C7B74: @ 81C7B74 + push {r4,lr} + movs r0, 0 + bl sub_81C763C + adds r4, r0, 0 + ldr r0, =gUnknown_0861FA08 + bl InitWindows + movs r0, 0 + str r0, [r4, 0x10] + bl sub_81C7BF8 + ldrb r0, [r4, 0x10] + bl PutWindowTilemap + ldrb r0, [r4, 0x10] + movs r1, 0x3 + bl CopyWindowToVram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C7B74 + + thumb_func_start sub_81C7BA4 +sub_81C7BA4: @ 81C7BA4 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r0, 0 + movs r0, 0 + bl sub_81C763C + adds r5, r0, 0 + ldr r0, [r5, 0x10] + bl sub_81C7BF8 + ldrb r0, [r5, 0x10] + ldr r1, =gUnknown_0861FA48 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + ldr r1, =gUnknown_0861FA18 + lsls r4, 2 + adds r4, r1 + ldr r1, [r4] + str r1, [sp, 0x8] + movs r1, 0x1 + movs r2, 0 + movs r3, 0x1 + bl box_print + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C7BA4 + + thumb_func_start sub_81C7BE8 +sub_81C7BE8: @ 81C7BE8 + push {lr} + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_81C7BE8 + + thumb_func_start sub_81C7BF8 +sub_81C7BF8: @ 81C7BF8 + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x44 + bl FillWindowPixelBuffer + movs r0, 0x80 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + adds r0, r4, 0 + movs r1, 0x55 + movs r2, 0 + movs r3, 0 + bl FillWindowPixelRect + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81C7BF8 + + thumb_func_start sub_81C7C28 +sub_81C7C28: @ 81C7C28 + push {r4-r6,lr} + movs r0, 0 + bl sub_81C763C + adds r6, r0, 0 + movs r5, 0 + ldr r4, =gUnknown_0861FA4C +_081C7C36: + adds r0, r4, 0 + bl LoadCompressedObjectPic + adds r4, 0x8 + adds r5, 0x1 + cmp r5, 0 + beq _081C7C36 + ldr r0, =gUnknown_0861FA54 + bl sub_81C795C + movs r0, 0 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x80 + lsls r1, 9 + lsls r1, r0 + movs r0, 0x2 + negs r0, r0 + bics r0, r1 + str r0, [r6, 0x14] + ldr r0, =gUnknown_0861FB04 + movs r1, 0xDC + movs r2, 0xC + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + str r1, [r6, 0x18] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C7C28 + + thumb_func_start sub_81C7C94 +sub_81C7C94: @ 81C7C94 + push {lr} + movs r0, 0 + bl sub_81C763C + ldr r0, [r0, 0x18] + bl RemoveObjectAndFreeTiles + movs r0, 0 + bl FreeObjectTilesByTag + movs r0, 0 + bl FreeObjectPaletteByTag + pop {r0} + bx r0 + thumb_func_end sub_81C7C94 + + thumb_func_start sub_81C7CB4 +sub_81C7CB4: @ 81C7CB4 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0 + bl GetBgY + lsrs r0, 8 + negs r0, r0 + strh r0, [r4, 0x26] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81C7CB4 + + thumb_func_start sub_81C7CCC +sub_81C7CCC: @ 81C7CCC + push {lr} + movs r0, 0 + bl sub_81C763C + ldr r0, [r0, 0x18] + ldr r1, =DummyObjectCallback + str r1, [r0, 0x1C] + pop {r1} + bx r1 + .pool + thumb_func_end sub_81C7CCC + + thumb_func_start sub_81C7CE4 +sub_81C7CE4: @ 81C7CE4 + push {r4,lr} + movs r0, 0 + bl sub_81C763C + ldr r2, [r0, 0x18] + movs r4, 0 + movs r1, 0xDC + strh r1, [r2, 0x20] + ldr r2, [r0, 0x18] + movs r1, 0xC + strh r1, [r2, 0x22] + ldr r2, [r0, 0x18] + ldr r1, =sub_81C7CB4 + str r1, [r2, 0x1C] + adds r2, 0x3E + ldrb r3, [r2] + movs r1, 0x5 + negs r1, r1 + ands r1, r3 + strb r1, [r2] + ldr r3, [r0, 0x18] + ldrb r2, [r3, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + strb r1, [r3, 0x5] + ldr r0, [r0, 0x18] + adds r0, 0x43 + strb r4, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C7CE4 + + thumb_func_start sub_81C7D28 +sub_81C7D28: @ 81C7D28 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r0, 0 + bl sub_81C763C + adds r6, r0, 0 + ldr r0, =gUnknown_0861FA64 + bl LoadCompressedObjectPic + movs r0, 0x1 + bl AllocObjectPalette + movs r0, 0x2 + bl AllocObjectPalette + movs r5, 0 + ldr r0, =0x02020630 + mov r8, r0 + movs r7, 0x4 +_081C7D50: + ldr r0, =gUnknown_0861FB2C + movs r1, 0 + movs r2, 0 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + lsls r4, r5, 2 + adds r2, r6, 0 + adds r2, 0x1C + adds r2, r4 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + str r0, [r2] + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r7 + strb r1, [r0] + ldr r1, [r2] + lsls r0, r5, 6 + strh r0, [r1, 0x24] + ldr r0, =gUnknown_0861FB44 + movs r1, 0 + movs r2, 0 + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + adds r2, r6, 0 + adds r2, 0x24 + adds r2, r4 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + str r0, [r2] + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r7 + strb r1, [r0] + ldr r1, [r2] + lsls r0, r5, 5 + strh r0, [r1, 0x24] + ldr r1, [r2] + movs r0, 0x12 + strh r0, [r1, 0x26] + ldr r3, [r2] + ldrh r2, [r3, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + lsls r0, r5, 3 + adds r0, 0x40 + adds r1, r0 + ldr r4, =0x000003ff + adds r0, r4, 0 + ands r1, r0 + ldr r4, =0xfffffc00 + adds r0, r4, 0 + ands r2, r0 + orrs r2, r1 + strh r2, [r3, 0x4] + adds r5, 0x1 + cmp r5, 0x1 + ble _081C7D50 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C7D28 + + thumb_func_start sub_81C7DFC +sub_81C7DFC: @ 81C7DFC + push {lr} + cmp r0, 0x5 + bhi _081C7E08 + bl sub_81C7E58 + b _081C7E0E +_081C7E08: + subs r0, 0x6 + bl sub_81C7F24 +_081C7E0E: + pop {r0} + bx r0 + thumb_func_end sub_81C7DFC + + thumb_func_start sub_81C7E14 +sub_81C7E14: @ 81C7E14 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0 + bl sub_81C763C + adds r5, r0, 0 + cmp r4, 0x4 + bne _081C7E30 + movs r0, 0x2 + bl GetObjectTileRangeStartByTag + ldr r3, [r5, 0x20] + adds r0, 0x20 + b _081C7E3A +_081C7E30: + movs r0, 0x2 + bl GetObjectTileRangeStartByTag + ldr r3, [r5, 0x20] + adds r0, 0x40 +_081C7E3A: + ldr r2, =0x000003ff + adds r1, r2, 0 + ands r0, r1 + ldrh r2, [r3, 0x4] + ldr r1, =0xfffffc00 + ands r1, r2 + orrs r1, r0 + strh r1, [r3, 0x4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C7E14 + + thumb_func_start sub_81C7E58 +sub_81C7E58: @ 81C7E58 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r9, r0 + cmp r0, 0x5 + bhi _081C7F16 + movs r0, 0 + bl sub_81C763C + adds r7, r0, 0 + ldr r0, =gUnknown_0861FA6C + mov r1, r9 + lsls r6, r1, 3 + adds r6, r0 + ldrh r4, [r6, 0x6] + ldr r2, [r6] + mov r8, r2 + mov r0, r8 + bl sub_8034974 + adds r5, r0, 0 + lsls r4, 5 + ldr r0, =gUnknown_08DC7F00 + adds r4, r0 + movs r0, 0x1 + bl IndexOfObjectPaletteTag + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 4 + movs r0, 0x80 + lsls r0, 17 + adds r1, r0 + lsrs r1, 16 + adds r0, r4, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r4, =0x0201c000 + mov r0, r8 + adds r1, r4, 0 + bl LZ77UnCompWram + movs r0, 0x2 + bl GetObjectTileRangeStartByTag + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 11 + ldr r2, =0x06010000 + adds r1, r2 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + adds r2, r5, 0 + movs r3, 0x1 + bl RequestDma3Copy + movs r0, 0x2 + bl GetObjectTileRangeStartByTag + ldr r3, [r7, 0x20] + ldrh r1, [r6, 0x4] + adds r0, r1 + ldr r2, =0x000003ff + adds r1, r2, 0 + ands r0, r1 + ldrh r2, [r3, 0x4] + ldr r1, =0xfffffc00 + ands r1, r2 + orrs r1, r0 + strh r1, [r3, 0x4] + mov r0, r9 + subs r0, 0x4 + cmp r0, 0x1 + bhi _081C7F10 + ldr r1, [r7, 0x20] + movs r0, 0x38 + b _081C7F14 + .pool +_081C7F10: + ldr r1, [r7, 0x20] + movs r0, 0x40 +_081C7F14: + strh r0, [r1, 0x24] +_081C7F16: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81C7E58 + + thumb_func_start sub_81C7F24 +sub_81C7F24: @ 81C7F24 + push {r4-r6,lr} + cmp r0, 0x6 + bhi _081C7F8A + ldr r2, =gUnknown_0861FA9C + lsls r1, r0, 3 + adds r0, r2, 0x4 + adds r0, r1, r0 + ldr r4, [r0] + adds r1, r2 + ldr r6, [r1] + adds r0, r6, 0 + bl sub_8034974 + adds r5, r0, 0 + lsls r4, 5 + ldr r0, =gUnknown_08DC7F00 + adds r4, r0 + movs r0, 0x2 + bl IndexOfObjectPaletteTag + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 4 + movs r0, 0x80 + lsls r0, 17 + adds r1, r0 + lsrs r1, 16 + adds r0, r4, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r4, =0x0201d000 + adds r0, r6, 0 + adds r1, r4, 0 + bl LZ77UnCompWram + movs r0, 0x2 + bl GetObjectTileRangeStartByTag + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 11 + ldr r0, =0x06010800 + adds r1, r0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + adds r2, r5, 0 + movs r3, 0x1 + bl RequestDma3Copy +_081C7F8A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C7F24 + + thumb_func_start sub_81C7FA0 +sub_81C7FA0: @ 81C7FA0 + push {lr} + adds r3, r0, 0 + movs r0, 0x10 + cmp r1, 0 + bne _081C7FAC + movs r0, 0x30 +_081C7FAC: + cmp r3, 0x5 + bhi _081C7FB8 + adds r1, r2, 0 + bl sub_81C803C + b _081C7FBE +_081C7FB8: + adds r1, r2, 0 + bl sub_81C8088 +_081C7FBE: + pop {r0} + bx r0 + thumb_func_end sub_81C7FA0 + + thumb_func_start sub_81C7FC4 +sub_81C7FC4: @ 81C7FC4 + push {lr} + cmp r0, 0x5 + bhi _081C7FD2 + adds r0, r1, 0 + bl sub_81C80D4 + b _081C7FD8 +_081C7FD2: + adds r0, r1, 0 + bl sub_81C8110 +_081C7FD8: + pop {r0} + bx r0 + thumb_func_end sub_81C7FC4 + + thumb_func_start sub_81C7FDC +sub_81C7FDC: @ 81C7FDC + push {r4,lr} + movs r0, 0 + bl sub_81C763C + movs r4, 0x4 + adds r2, r0, 0 + adds r2, 0x1C + movs r3, 0x1 +_081C7FEC: + ldr r1, [r2] + adds r1, 0x3E + ldrb r0, [r1] + orrs r0, r4 + strb r0, [r1] + ldr r1, [r2, 0x8] + adds r1, 0x3E + ldrb r0, [r1] + orrs r0, r4 + strb r0, [r1] + adds r2, 0x4 + subs r3, 0x1 + cmp r3, 0 + bge _081C7FEC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81C7FDC + + thumb_func_start sub_81C8010 +sub_81C8010: @ 81C8010 + push {lr} + movs r0, 0 + bl sub_81C763C + adds r1, r0, 0 + ldr r0, [r1, 0x1C] + ldr r2, [r0, 0x1C] + ldr r0, =DummyObjectCallback + cmp r2, r0 + bne _081C8034 + ldr r0, [r1, 0x24] + ldr r0, [r0, 0x1C] + cmp r0, r2 + bne _081C8034 + movs r0, 0 + b _081C8036 + .pool +_081C8034: + movs r0, 0x1 +_081C8036: + pop {r1} + bx r1 + thumb_func_end sub_81C8010 + + thumb_func_start sub_81C803C +sub_81C803C: @ 81C803C + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + adds r4, r1, 0 + movs r0, 0 + bl sub_81C763C + cmp r4, 0 + bne _081C8058 + movs r7, 0x60 + negs r7, r7 + movs r6, 0x20 + b _081C805E +_081C8058: + movs r7, 0x80 + lsls r7, 1 + movs r6, 0xA0 +_081C805E: + adds r4, r0, 0 + adds r4, 0x1C + movs r5, 0x1 +_081C8064: + ldr r0, [r4] + mov r1, r8 + strh r1, [r0, 0x22] + ldm r4!, {r0} + adds r1, r7, 0 + adds r2, r6, 0 + movs r3, 0xC + bl sub_81C814C + subs r5, 0x1 + cmp r5, 0 + bge _081C8064 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81C803C + + thumb_func_start sub_81C8088 +sub_81C8088: @ 81C8088 + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + adds r4, r1, 0 + movs r0, 0 + bl sub_81C763C + cmp r4, 0 + bne _081C80A4 + movs r7, 0x60 + negs r7, r7 + movs r6, 0x10 + b _081C80AA +_081C80A4: + movs r7, 0x80 + lsls r7, 1 + movs r6, 0xC0 +_081C80AA: + adds r4, r0, 0 + adds r4, 0x24 + movs r5, 0x1 +_081C80B0: + ldr r0, [r4] + mov r1, r8 + strh r1, [r0, 0x22] + ldm r4!, {r0} + adds r1, r7, 0 + adds r2, r6, 0 + movs r3, 0xC + bl sub_81C814C + subs r5, 0x1 + cmp r5, 0 + bge _081C80B0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81C8088 + + thumb_func_start sub_81C80D4 +sub_81C80D4: @ 81C80D4 + push {r4-r7,lr} + adds r4, r0, 0 + movs r0, 0 + bl sub_81C763C + cmp r4, 0 + bne _081C80EA + movs r6, 0x20 + movs r5, 0x60 + negs r5, r5 + b _081C80F0 +_081C80EA: + movs r6, 0xC0 + movs r5, 0x80 + lsls r5, 1 +_081C80F0: + adds r7, r0, 0 + adds r7, 0x1C + movs r4, 0x1 +_081C80F6: + ldm r7!, {r0} + adds r1, r6, 0 + adds r2, r5, 0 + movs r3, 0xC + bl sub_81C814C + subs r4, 0x1 + cmp r4, 0 + bge _081C80F6 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81C80D4 + + thumb_func_start sub_81C8110 +sub_81C8110: @ 81C8110 + push {r4-r7,lr} + adds r4, r0, 0 + movs r0, 0 + bl sub_81C763C + cmp r4, 0 + bne _081C8126 + movs r6, 0x10 + movs r5, 0x60 + negs r5, r5 + b _081C812C +_081C8126: + movs r6, 0xC0 + movs r5, 0x80 + lsls r5, 1 +_081C812C: + adds r7, r0, 0 + adds r7, 0x24 + movs r4, 0x1 +_081C8132: + ldm r7!, {r0} + adds r1, r6, 0 + adds r2, r5, 0 + movs r3, 0xC + bl sub_81C814C + subs r4, 0x1 + cmp r4, 0 + bge _081C8132 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81C8110 + + thumb_func_start sub_81C814C +sub_81C814C: @ 81C814C + push {r4-r6,lr} + adds r4, r0, 0 + adds r0, r1, 0 + adds r6, r2, 0 + adds r5, r3, 0 + strh r0, [r4, 0x20] + lsls r1, r0, 4 + strh r1, [r4, 0x2E] + subs r0, r6, r0 + lsls r0, 4 + adds r1, r5, 0 + bl __divsi3 + strh r0, [r4, 0x30] + strh r5, [r4, 0x32] + strh r6, [r4, 0x3C] + ldr r0, =sub_81C817C + str r0, [r4, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C814C + + thumb_func_start sub_81C817C +sub_81C817C: @ 81C817C + push {lr} + adds r2, r0, 0 + ldrh r1, [r2, 0x32] + movs r3, 0x32 + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _081C81C4 + subs r0, r1, 0x1 + strh r0, [r2, 0x32] + ldrh r0, [r2, 0x30] + ldrh r1, [r2, 0x2E] + adds r0, r1 + strh r0, [r2, 0x2E] + lsls r0, 16 + asrs r0, 20 + strh r0, [r2, 0x20] + adds r0, 0x10 + lsls r0, 16 + movs r1, 0x88 + lsls r1, 17 + cmp r0, r1 + bls _081C81B6 + adds r0, r2, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + b _081C81CC +_081C81B6: + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + b _081C81CC +_081C81C4: + ldrh r0, [r2, 0x3C] + strh r0, [r2, 0x20] + ldr r0, =DummyObjectCallback + str r0, [r2, 0x1C] +_081C81CC: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C817C + + thumb_func_start sub_81C81D4 +sub_81C81D4: @ 81C81D4 + push {r4-r7,lr} + adds r6, r0, 0 + adds r5, r1, 0 + adds r7, r2, 0 + ldr r1, =0x000008a4 + movs r0, 0x11 + bl sub_81C761C + adds r4, r0, 0 + cmp r4, 0 + beq _081C821C + ldr r1, =0x00000888 + adds r0, r4, r1 + adds r1, r5, 0 + bl sub_81C9160 + adds r0, r4, 0 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r7, 0 + bl sub_81C91AC + cmp r0, 0 + beq _081C821C + ldr r0, =sub_81C8254 + movs r1, 0x6 + bl sub_81C7078 + movs r0, 0x1 + b _081C821E + .pool +_081C821C: + movs r0, 0 +_081C821E: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81C81D4 + + thumb_func_start sub_81C8224 +sub_81C8224: @ 81C8224 + push {lr} + ldr r0, =sub_81C8254 + bl sub_81C7124 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81C8224 + + thumb_func_start sub_81C8234 +sub_81C8234: @ 81C8234 + push {r4,lr} + movs r0, 0x11 + bl sub_81C763C + adds r4, r0, 0 + bl sub_81C8FE0 + ldrb r0, [r4, 0x8] + bl RemoveWindow + movs r0, 0x11 + bl sub_81C7650 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81C8234 + + thumb_func_start sub_81C8254 +sub_81C8254: @ 81C8254 + push {r4,lr} + adds r4, r0, 0 + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _081C82C0 + movs r0, 0x11 + bl sub_81C763C + adds r2, r0, 0 + cmp r4, 0x4 + bhi _081C82D6 + lsls r0, r4, 2 + ldr r1, =_081C827C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081C827C: + .4byte _081C8290 + .4byte _081C829A + .4byte _081C82A4 + .4byte _081C82B8 + .4byte _081C82CC +_081C8290: + adds r0, r2, 0 + bl sub_81C82E4 + movs r0, 0 + b _081C82D8 +_081C829A: + adds r0, r2, 0 + bl sub_81C835C + movs r0, 0 + b _081C82D8 +_081C82A4: + ldr r1, =0x00000888 + adds r0, r2, r1 + adds r1, r2, 0 + bl sub_81C837C + movs r0, 0 + b _081C82D8 + .pool +_081C82B8: + bl sub_81C83E0 + cmp r0, 0 + beq _081C82C4 +_081C82C0: + movs r0, 0x2 + b _081C82D8 +_081C82C4: + bl sub_81C8ED0 + movs r0, 0x1 + b _081C82D8 +_081C82CC: + ldr r1, =0x00000888 + adds r0, r2, r1 + adds r1, r2, 0 + bl sub_81C8EF8 +_081C82D6: + movs r0, 0x4 +_081C82D8: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81C8254 + + thumb_func_start sub_81C82E4 +sub_81C82E4: @ 81C82E4 + push {r4,r5,lr} + sub sp, 0x8 + adds r5, r0, 0 + ldrb r4, [r5, 0x1] + lsls r4, 12 + ldrh r0, [r5, 0x6] + orrs r4, r0 + lsls r4, 16 + lsrs r4, 16 + ldrb r0, [r5] + ldrh r2, [r5, 0x6] + movs r1, 0x11 + movs r3, 0x1 + bl sub_8199DF0 + ldrb r0, [r5] + ldrh r2, [r5, 0x6] + adds r2, 0x1 + movs r1, 0x44 + movs r3, 0x1 + bl sub_8199DF0 + ldrb r0, [r5] + adds r1, r5, 0 + adds r1, 0x88 + bl SetBgTilemapBuffer + ldrb r0, [r5] + movs r1, 0x20 + str r1, [sp] + str r1, [sp, 0x4] + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + ldrb r0, [r5] + movs r1, 0 + movs r2, 0 + bl ChangeBgY + ldrb r0, [r5] + movs r1, 0 + movs r2, 0 + bl ChangeBgX + ldrb r0, [r5] + ldrb r1, [r5, 0x3] + lsls r1, 11 + movs r2, 0x2 + bl ChangeBgY + ldrb r0, [r5] + bl CopyBgTilemapBufferToVram + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81C82E4 + + thumb_func_start sub_81C835C +sub_81C835C: @ 81C835C + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0x8] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldrb r0, [r4, 0x8] + bl PutWindowTilemap + ldrb r0, [r4, 0x8] + movs r1, 0x1 + bl CopyWindowToVram + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81C835C + + thumb_func_start sub_81C837C +sub_81C837C: @ 81C837C + push {r4,r5,lr} + sub sp, 0x8 + adds r3, r0, 0 + adds r5, r1, 0 + ldrh r0, [r3, 0x2] + ldrh r4, [r3] + subs r2, r0, r4 + ldrh r0, [r3, 0x8] + cmp r2, r0 + ble _081C8392 + adds r2, r0, 0 +_081C8392: + ldr r0, [r3, 0x10] + ldr r3, [r3, 0xC] + movs r1, 0 + str r1, [sp] + str r5, [sp, 0x4] + adds r1, r4, 0 + bl sub_81C83AC + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81C837C + + thumb_func_start sub_81C83AC +sub_81C83AC: @ 81C83AC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, [sp, 0x10] + cmp r2, 0 + beq _081C83D6 + adds r0, r5, 0 + muls r0, r3 + adds r0, r4, r0 + str r0, [r1, 0x1C] + str r3, [r1, 0x18] + movs r0, 0 + strh r0, [r1, 0xC] + strh r2, [r1, 0xE] + str r5, [r1, 0x14] + ldr r0, [sp, 0xC] + str r0, [r1, 0x10] + ldr r0, =sub_81C83F0 + movs r1, 0x5 + bl sub_81C7078 +_081C83D6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C83AC + + thumb_func_start sub_81C83E0 +sub_81C83E0: @ 81C83E0 + push {lr} + ldr r0, =sub_81C83F0 + bl sub_81C7124 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81C83E0 + + thumb_func_start sub_81C83F0 +sub_81C83F0: @ 81C83F0 + push {r4-r7,lr} + sub sp, 0xC + adds r6, r0, 0 + movs r0, 0x11 + bl sub_81C763C + adds r4, r0, 0 + cmp r6, 0 + beq _081C8408 + cmp r6, 0x1 + beq _081C848C + b _081C849A +_081C8408: + ldrh r0, [r4, 0xA] + ldrh r1, [r4, 0xC] + adds r0, r1 + ldr r1, [r4, 0x10] + adds r5, r0, r1 + movs r0, 0xF + ands r5, r0 + ldr r0, [r4, 0x1C] + adds r7, r4, 0 + adds r7, 0x48 + ldr r2, [r4, 0x34] + adds r1, r7, 0 + bl _call_via_r2 + ldr r3, [r4, 0x38] + cmp r3, 0 + beq _081C8434 + ldrh r0, [r4, 0x8] + ldr r1, [r4, 0x14] + adds r2, r5, 0 + bl _call_via_r3 +_081C8434: + ldrb r0, [r4, 0x8] + ldrb r1, [r4, 0x5] + lsls r2, r5, 4 + movs r3, 0x1 + orrs r2, r3 + str r2, [sp] + movs r2, 0xFF + str r2, [sp, 0x4] + str r6, [sp, 0x8] + adds r2, r7, 0 + movs r3, 0x8 + bl Print + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r4, 0xE] + cmp r0, r1 + bcc _081C847A + ldr r0, [r4, 0x38] + cmp r0, 0 + beq _081C846E + ldrb r0, [r4, 0x8] + movs r1, 0x3 + bl CopyWindowToVram + b _081C8476 +_081C846E: + ldrb r0, [r4, 0x8] + movs r1, 0x2 + bl CopyWindowToVram +_081C8476: + movs r0, 0 + b _081C849C +_081C847A: + ldr r0, [r4, 0x1C] + ldr r1, [r4, 0x18] + adds r0, r1 + str r0, [r4, 0x1C] + ldr r0, [r4, 0x14] + adds r0, 0x1 + str r0, [r4, 0x14] + movs r0, 0x3 + b _081C849C +_081C848C: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _081C849A + movs r0, 0x2 + b _081C849C +_081C849A: + movs r0, 0x4 +_081C849C: + add sp, 0xC + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81C83F0 + + thumb_func_start sub_81C84A4 +sub_81C84A4: @ 81C84A4 + push {lr} + movs r0, 0x11 + bl sub_81C763C + ldr r1, =0x00000888 + adds r0, r1 + ldrh r1, [r0] + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81C84A4 + + thumb_func_start sub_81C84C0 +sub_81C84C0: @ 81C84C0 + push {lr} + movs r0, 0x11 + bl sub_81C763C + ldr r1, =0x00000888 + adds r0, r1 + movs r3, 0 + ldrh r1, [r0] + ldrh r2, [r0, 0x8] + adds r1, r2 + ldrh r0, [r0, 0x2] + cmp r1, r0 + bge _081C84DC + movs r3, 0x1 +_081C84DC: + adds r0, r3, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81C84C0 + + thumb_func_start sub_81C84E8 +sub_81C84E8: @ 81C84E8 + push {r4-r7,lr} + sub sp, 0x8 + adds r6, r0, 0 + adds r4, r1, 0 + movs r0, 0x11 + bl sub_81C763C + adds r7, r0, 0 + ldr r0, =0x00000888 + adds r5, r7, r0 + cmp r6, 0 + bge _081C8524 + ldrh r1, [r5] + adds r0, r1, r6 + cmp r0, 0 + bge _081C850A + negs r6, r1 +_081C850A: + cmp r4, 0 + beq _081C854E + ldr r0, [r5, 0x10] + adds r1, r6 + negs r2, r6 + ldr r3, [r5, 0xC] + str r6, [sp] + str r7, [sp, 0x4] + bl sub_81C83AC + b _081C854E + .pool +_081C8524: + cmp r4, 0 + beq _081C854E + ldr r2, =0x0203cf44 + ldrh r1, [r5] + ldrh r0, [r5, 0x8] + adds r4, r1, r0 + str r4, [r2] + adds r0, r4, r6 + ldrh r1, [r5, 0x2] + cmp r0, r1 + blt _081C853C + subs r6, r1, r4 +_081C853C: + ldr r0, [r5, 0x10] + ldr r3, [r5, 0xC] + ldrh r1, [r5, 0x8] + str r1, [sp] + str r7, [sp, 0x4] + adds r1, r4, 0 + adds r2, r6, 0 + bl sub_81C83AC +_081C854E: + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_81C8568 + ldrh r0, [r5] + adds r0, r6 + strh r0, [r5] + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C84E8 + + thumb_func_start sub_81C8568 +sub_81C8568: @ 81C8568 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldrb r0, [r4] + bl GetBgY + str r0, [r4, 0x20] + lsls r1, r5, 12 + adds r0, r1 + str r0, [r4, 0x24] + cmp r5, 0 + ble _081C8584 + movs r0, 0x1 + b _081C8586 +_081C8584: + movs r0, 0x2 +_081C8586: + str r0, [r4, 0x30] + str r5, [r4, 0x2C] + ldr r0, =sub_81C85A0 + movs r1, 0x6 + bl sub_81C7078 + str r0, [r4, 0x28] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C8568 + + thumb_func_start sub_81C85A0 +sub_81C85A0: @ 81C85A0 + push {r4-r6,lr} + adds r5, r0, 0 + movs r0, 0x11 + bl sub_81C763C + adds r4, r0, 0 + cmp r5, 0 + beq _081C85B8 + cmp r5, 0x1 + beq _081C85C4 + movs r0, 0x4 + b _081C862A +_081C85B8: + bl sub_81C83E0 + cmp r0, 0 + bne _081C8628 + movs r0, 0x1 + b _081C862A +_081C85C4: + movs r6, 0 + ldrb r0, [r4] + bl GetBgY + adds r5, r0, 0 + ldrb r0, [r4] + movs r1, 0x80 + lsls r1, 5 + ldr r2, [r4, 0x30] + lsls r2, 24 + lsrs r2, 24 + bl ChangeBgY + adds r1, r0, 0 + ldr r0, [r4, 0x30] + cmp r0, 0x2 + bne _081C85F8 + ldr r2, [r4, 0x24] + cmp r5, r2 + bgt _081C85F2 + ldr r0, [r4, 0x20] + cmp r5, r0 + bgt _081C860A +_081C85F2: + cmp r1, r2 + bgt _081C860A + b _081C860E +_081C85F8: + ldr r2, [r4, 0x24] + cmp r5, r2 + blt _081C8604 + ldr r0, [r4, 0x20] + cmp r5, r0 + blt _081C860A +_081C8604: + cmp r1, r2 + blt _081C860A + movs r6, 0x1 +_081C860A: + cmp r6, 0 + beq _081C8628 +_081C860E: + ldr r1, [r4, 0x2C] + ldrh r0, [r4, 0xA] + adds r0, r1 + movs r1, 0xF + ands r0, r1 + strh r0, [r4, 0xA] + ldrb r0, [r4] + adds r1, r2, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x4 + b _081C862A +_081C8628: + movs r0, 0x2 +_081C862A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81C85A0 + + thumb_func_start sub_81C8630 +sub_81C8630: @ 81C8630 + push {lr} + movs r0, 0x11 + bl sub_81C763C + ldr r0, [r0, 0x28] + bl sub_81C70D8 + pop {r1} + bx r1 + thumb_func_end sub_81C8630 + + thumb_func_start sub_81C8644 +sub_81C8644: @ 81C8644 + push {lr} + movs r0, 0x11 + bl sub_81C763C + ldr r1, =0x00000888 + adds r0, r1 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81C8644 + + thumb_func_start sub_81C8658 +sub_81C8658: @ 81C8658 + push {lr} + bl sub_81C8644 + adds r1, r0, 0 + ldrh r0, [r1, 0x6] + cmp r0, 0 + beq _081C866E + subs r0, 0x1 + strh r0, [r1, 0x6] + movs r0, 0x1 + b _081C8686 +_081C866E: + bl sub_81C84A4 + cmp r0, 0 + bne _081C867A + movs r0, 0 + b _081C8686 +_081C867A: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x1 + bl sub_81C84E8 + movs r0, 0x2 +_081C8686: + pop {r1} + bx r1 + thumb_func_end sub_81C8658 + + thumb_func_start sub_81C868C +sub_81C868C: @ 81C868C + push {lr} + bl sub_81C8644 + adds r2, r0, 0 + ldrh r1, [r2] + ldrh r3, [r2, 0x6] + adds r1, r3 + ldrh r0, [r2, 0x2] + subs r0, 0x1 + cmp r1, r0 + bge _081C86BA + ldrh r0, [r2, 0x8] + subs r0, 0x1 + cmp r3, r0 + bge _081C86B2 + adds r0, r3, 0x1 + strh r0, [r2, 0x6] + movs r0, 0x1 + b _081C86C8 +_081C86B2: + bl sub_81C84C0 + cmp r0, 0 + bne _081C86BE +_081C86BA: + movs r0, 0 + b _081C86C8 +_081C86BE: + movs r0, 0x1 + movs r1, 0x1 + bl sub_81C84E8 + movs r0, 0x2 +_081C86C8: + pop {r1} + bx r1 + thumb_func_end sub_81C868C + + thumb_func_start sub_81C86CC +sub_81C86CC: @ 81C86CC + push {r4,lr} + bl sub_81C8644 + adds r4, r0, 0 + bl sub_81C84A4 + adds r1, r0, 0 + cmp r1, 0 + beq _081C86F8 + ldrh r0, [r4] + ldrh r1, [r4, 0x8] + cmp r0, r1 + bcc _081C86EA + ldrh r0, [r4, 0x8] + b _081C86EC +_081C86EA: + ldrh r0, [r4] +_081C86EC: + negs r0, r0 + movs r1, 0x1 + bl sub_81C84E8 + movs r0, 0x2 + b _081C8706 +_081C86F8: + ldrh r0, [r4, 0x6] + cmp r0, 0 + bne _081C8702 + movs r0, 0 + b _081C8706 +_081C8702: + strh r1, [r4, 0x6] + movs r0, 0x1 +_081C8706: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81C86CC + + thumb_func_start sub_81C870C +sub_81C870C: @ 81C870C + push {r4,lr} + bl sub_81C8644 + adds r4, r0, 0 + bl sub_81C84C0 + cmp r0, 0 + beq _081C8736 + ldrh r0, [r4] + ldrh r3, [r4, 0x8] + adds r2, r0, r3 + ldrh r1, [r4, 0x4] + subs r0, r1, r0 + cmp r2, r1 + bgt _081C872C + adds r0, r3, 0 +_081C872C: + movs r1, 0x1 + bl sub_81C84E8 + movs r0, 0x2 + b _081C8756 +_081C8736: + ldrh r0, [r4, 0x2] + ldrh r1, [r4, 0x8] + cmp r0, r1 + bcc _081C8744 + ldrh r1, [r4, 0x6] + ldrh r0, [r4, 0x8] + b _081C8748 +_081C8744: + ldrh r1, [r4, 0x6] + ldrh r0, [r4, 0x2] +_081C8748: + subs r0, 0x1 + cmp r1, r0 + bge _081C8754 + strh r0, [r4, 0x6] + movs r0, 0x1 + b _081C8756 +_081C8754: + movs r0, 0 +_081C8756: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81C870C + + thumb_func_start sub_81C875C +sub_81C875C: @ 81C875C + push {lr} + bl sub_81C8644 + adds r1, r0, 0 + ldrh r0, [r1] + ldrh r1, [r1, 0x6] + adds r0, r1 + pop {r1} + bx r1 + thumb_func_end sub_81C875C + + thumb_func_start sub_81C8770 +sub_81C8770: @ 81C8770 + push {lr} + bl sub_81C8644 + ldrh r0, [r0] + pop {r1} + bx r1 + thumb_func_end sub_81C8770 + + thumb_func_start sub_81C877C +sub_81C877C: @ 81C877C + push {r4,lr} + movs r0, 0x11 + bl sub_81C763C + adds r4, r0, 0 + ldr r0, =0x0000089c + adds r1, r4, r0 + movs r0, 0 + str r0, [r1] + ldr r0, =sub_81C8870 + movs r1, 0x6 + bl sub_81C7078 + movs r1, 0x8A + lsls r1, 4 + adds r4, r1 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C877C + + thumb_func_start sub_81C87AC +sub_81C87AC: @ 81C87AC + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0x11 + bl sub_81C763C + adds r5, r0, 0 + ldr r0, =0x00000888 + adds r1, r5, r0 + ldrh r0, [r1] + adds r0, r4 + movs r2, 0 + strh r0, [r1] + ldr r1, =0x0000089c + adds r0, r5, r1 + str r2, [r0] + ldr r0, =sub_81C8958 + movs r1, 0x6 + bl sub_81C7078 + movs r1, 0x8A + lsls r1, 4 + adds r5, r1 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C87AC + + thumb_func_start sub_81C87F0 +sub_81C87F0: @ 81C87F0 + push {r4,lr} + movs r0, 0x11 + bl sub_81C763C + adds r4, r0, 0 + ldr r0, =0x0000089c + adds r1, r4, r0 + movs r0, 0 + str r0, [r1] + ldr r0, =sub_81C8A28 + movs r1, 0x6 + bl sub_81C7078 + movs r1, 0x8A + lsls r1, 4 + adds r4, r1 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C87F0 + + thumb_func_start sub_81C8820 +sub_81C8820: @ 81C8820 + push {lr} + movs r0, 0x11 + bl sub_81C763C + movs r1, 0x8A + lsls r1, 4 + adds r0, r1 + ldr r0, [r0] + bl sub_81C70D8 + pop {r1} + bx r1 + thumb_func_end sub_81C8820 + + thumb_func_start sub_81C8838 +sub_81C8838: @ 81C8838 + push {r4,lr} + movs r0, 0x11 + bl sub_81C763C + adds r4, r0, 0 + ldr r0, =0x00000888 + adds r2, r4, r0 + ldrh r0, [r4, 0x8] + ldrh r1, [r2] + ldrh r3, [r2, 0x6] + adds r1, r3 + ldrh r2, [r4, 0xA] + adds r2, r3 + movs r3, 0xF + ands r2, r3 + ldr r3, [r4, 0x38] + bl _call_via_r3 + ldrb r0, [r4, 0x8] + movs r1, 0x1 + bl CopyWindowToVram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C8838 + + thumb_func_start sub_81C8870 +sub_81C8870: @ 81C8870 + push {r4,r5,lr} + adds r5, r0, 0 + movs r0, 0x11 + bl sub_81C763C + adds r4, r0, 0 + cmp r5, 0x4 + bhi _081C894C + lsls r0, r5, 2 + ldr r1, =_081C8890 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081C8890: + .4byte _081C88A4 + .4byte _081C88AC + .4byte _081C88D8 + .4byte _081C8918 + .4byte _081C8938 +_081C88A4: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81C9008 +_081C88AC: + ldr r0, =0x0000089c + adds r5, r4, r0 + ldr r1, =0x0000088e + adds r0, r4, r1 + ldr r1, [r5] + ldrh r0, [r0] + cmp r1, r0 + beq _081C88C4 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_81C8B70 +_081C88C4: + ldr r0, [r5] + adds r0, 0x1 + str r0, [r5] +_081C88CA: + movs r0, 0 + b _081C894E + .pool +_081C88D8: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _081C8942 + ldr r2, =0x0000089c + adds r0, r4, r2 + subs r2, 0xC + adds r1, r4, r2 + ldr r3, [r0] + ldrh r1, [r1] + cmp r3, r1 + beq _081C88FC + movs r0, 0x6 + b _081C894E + .pool +_081C88FC: + ldr r0, =0x0000088e + adds r1, r4, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _081C88CA + adds r2, r0, 0 + adds r0, r4, 0 + adds r1, r3, 0 + bl sub_81C8B70 + b _081C88CA + .pool +_081C8918: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _081C8942 + ldr r2, =0x0000088e + adds r1, r4, r2 + ldrh r0, [r1] + cmp r0, 0 + beq _081C894C + movs r1, 0 + bl sub_81C84E8 + b _081C88CA + .pool +_081C8938: + bl sub_81C8630 + adds r1, r0, 0 + cmp r1, 0 + beq _081C8946 +_081C8942: + movs r0, 0x2 + b _081C894E +_081C8946: + ldr r2, =0x0000088e + adds r0, r4, r2 + strh r1, [r0] +_081C894C: + movs r0, 0x4 +_081C894E: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81C8870 + + thumb_func_start sub_81C8958 +sub_81C8958: @ 81C8958 + push {r4,r5,lr} + adds r5, r0, 0 + movs r0, 0x11 + bl sub_81C763C + adds r4, r0, 0 + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _081C8972 + movs r0, 0x2 + b _081C8A22 +_081C8972: + cmp r5, 0x7 + bhi _081C8A1C + lsls r0, r5, 2 + ldr r1, =_081C8984 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081C8984: + .4byte _081C89A4 + .4byte _081C89B4 + .4byte _081C89BE + .4byte _081C89D0 + .4byte _081C89DA + .4byte _081C89EC + .4byte _081C89F6 + .4byte _081C8A08 +_081C89A4: + ldr r1, =0x00000888 + adds r0, r4, r1 + adds r1, r4, 0 + bl sub_81C8CB4 + b _081C8A20 + .pool +_081C89B4: + adds r0, r4, 0 + movs r1, 0 + bl sub_81C8DBC + b _081C8A20 +_081C89BE: + ldr r1, =0x00000888 + adds r0, r4, r1 + adds r1, r4, 0 + movs r2, 0 + bl sub_81C8E54 + b _081C8A20 + .pool +_081C89D0: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81C8DBC + b _081C8A20 +_081C89DA: + ldr r1, =0x00000888 + adds r0, r4, r1 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_81C8E54 + b _081C8A20 + .pool +_081C89EC: + adds r0, r4, 0 + movs r1, 0x2 + bl sub_81C8DBC + b _081C8A20 +_081C89F6: + ldr r1, =0x00000888 + adds r0, r4, r1 + adds r1, r4, 0 + movs r2, 0x2 + bl sub_81C8E54 + b _081C8A20 + .pool +_081C8A08: + ldr r1, =0x00000888 + adds r0, r4, r1 + adds r1, r4, 0 + movs r2, 0x3 + bl sub_81C8E54 + b _081C8A20 + .pool +_081C8A1C: + movs r0, 0x4 + b _081C8A22 +_081C8A20: + movs r0, 0 +_081C8A22: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81C8958 + + thumb_func_start sub_81C8A28 +sub_81C8A28: @ 81C8A28 + push {r4-r7,lr} + sub sp, 0x8 + adds r5, r0, 0 + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _081C8AA6 + movs r0, 0x11 + bl sub_81C763C + adds r4, r0, 0 + ldr r0, =0x00000888 + adds r6, r4, r0 + adds r2, r4, 0 + cmp r5, 0x6 + bls _081C8A4C + b _081C8B64 +_081C8A4C: + lsls r0, r5, 2 + ldr r1, =_081C8A60 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081C8A60: + .4byte _081C8A7C + .4byte _081C8A88 + .4byte _081C8AE8 + .4byte _081C8AFC + .4byte _081C8B14 + .4byte _081C8B34 + .4byte _081C8B5C +_081C8A7C: + adds r0, r6, 0 + adds r1, r2, 0 + bl sub_81C8D4C + movs r0, 0 + b _081C8B66 +_081C8A88: + ldr r1, =0x0000089c + adds r7, r4, r1 + ldr r0, [r7] + adds r1, r0, 0x1 + str r1, [r7] + movs r3, 0x89 + lsls r3, 4 + adds r0, r4, r3 + ldrh r0, [r0] + cmp r1, r0 + bge _081C8AB0 + adds r0, r2, 0 + movs r2, 0x1 + bl sub_81C8B70 +_081C8AA6: + movs r0, 0x2 + b _081C8B66 + .pool +_081C8AB0: + movs r0, 0 + str r0, [r7] + ldrh r0, [r6, 0x2] + ldrh r1, [r6, 0x8] + cmp r0, r1 + bhi _081C8AC6 + ldrh r0, [r6] + cmp r0, 0 + beq _081C8B52 + adds r4, r0, 0 + b _081C8AD4 +_081C8AC6: + ldrh r1, [r6] + ldrh r0, [r6, 0x8] + adds r4, r1, r0 + ldrh r1, [r6, 0x2] + cmp r4, r1 + ble _081C8B52 + subs r4, r1 +_081C8AD4: + negs r5, r4 + adds r0, r2, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_81C8B70 + strh r4, [r6, 0x6] + str r5, [r7] + movs r0, 0 + b _081C8B66 +_081C8AE8: + ldr r2, =0x0000089c + adds r0, r4, r2 + ldr r0, [r0] + movs r1, 0 + bl sub_81C84E8 + movs r0, 0 + b _081C8B66 + .pool +_081C8AFC: + bl sub_81C8630 + adds r1, r0, 0 + cmp r1, 0 + bne _081C8AA6 + ldr r3, =0x0000089c + adds r0, r4, r3 + str r1, [r0] +_081C8B0C: + movs r0, 0x1 + b _081C8B66 + .pool +_081C8B14: + ldr r0, [r6, 0x10] + ldrh r1, [r6] + ldr r3, =0x0000089c + adds r2, r4, r3 + ldr r2, [r2] + adds r1, r2 + ldr r3, [r6, 0xC] + str r2, [sp] + str r4, [sp, 0x4] + movs r2, 0x1 + bl sub_81C83AC + movs r0, 0 + b _081C8B66 + .pool +_081C8B34: + bl sub_81C83E0 + cmp r0, 0 + bne _081C8AA6 + ldr r0, =0x0000089c + adds r1, r4, r0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldrh r1, [r6, 0x2] + cmp r0, r1 + bge _081C8B0C + ldrh r6, [r6, 0x8] + cmp r0, r6 + bge _081C8B0C +_081C8B52: + movs r0, 0x9 + b _081C8B66 + .pool +_081C8B5C: + adds r0, r2, 0 + movs r1, 0 + bl sub_81C9008 +_081C8B64: + movs r0, 0x4 +_081C8B66: + add sp, 0x8 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81C8A28 + + thumb_func_start sub_81C8B70 +sub_81C8B70: @ 81C8B70 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + mov r9, r0 + adds r7, r1, 0 + adds r6, r2, 0 + ldrb r0, [r0, 0x8] + movs r1, 0x7 + bl GetWindowAttribute + mov r10, r0 + mov r1, r9 + ldrb r0, [r1, 0x4] + lsls r3, r0, 6 + ldrh r0, [r1, 0xA] + adds r7, r0, r7 + movs r0, 0xF + ands r7, r0 + adds r0, r7, r6 + cmp r0, 0x10 + bgt _081C8BD4 + ldr r0, =0x11111111 + str r0, [sp] + adds r1, r7, 0 + muls r1, r3 + add r1, r10 + adds r2, r6, 0 + muls r2, r3 + lsrs r2, 2 + ldr r0, =0x001fffff + ands r2, r0 + movs r0, 0x80 + lsls r0, 17 + orrs r2, r0 + mov r0, sp + bl CpuFastSet + mov r1, r9 + ldrb r0, [r1, 0x8] + movs r1, 0x2 + bl CopyWindowToVram + b _081C8C1E + .pool +_081C8BD4: + movs r2, 0x10 + subs r2, r7 + subs r0, r6, r2 + mov r8, r0 + ldr r1, =0x11111111 + str r1, [sp, 0x4] + add r0, sp, 0x4 + adds r1, r7, 0 + muls r1, r3 + add r1, r10 + muls r2, r3 + lsrs r2, 2 + ldr r5, =0x001fffff + ands r2, r5 + movs r4, 0x80 + lsls r4, 17 + orrs r2, r4 + str r3, [sp, 0xC] + bl CpuFastSet + ldr r0, =0x11111111 + str r0, [sp, 0x8] + add r0, sp, 0x8 + ldr r3, [sp, 0xC] + mov r2, r8 + muls r2, r3 + lsrs r2, 2 + ands r2, r5 + orrs r2, r4 + mov r1, r10 + bl CpuFastSet + mov r1, r9 + ldrb r0, [r1, 0x8] + movs r1, 0x2 + bl CopyWindowToVram +_081C8C1E: + subs r6, 0x1 + movs r0, 0x1 + negs r0, r0 + cmp r6, r0 + beq _081C8C40 + movs r5, 0xF + adds r4, r0, 0 +_081C8C2C: + mov r1, r9 + ldrh r0, [r1, 0x8] + adds r1, r7, 0 + bl sub_81CBD48 + adds r7, 0x1 + ands r7, r5 + subs r6, 0x1 + cmp r6, r4 + bne _081C8C2C +_081C8C40: + mov r1, r9 + ldrb r0, [r1, 0x8] + movs r1, 0x1 + bl CopyWindowToVram + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C8B70 + + thumb_func_start sub_81C8C64 +sub_81C8C64: @ 81C8C64 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldrb r0, [r5, 0x8] + movs r1, 0 + bl GetWindowAttribute + lsls r0, 24 + lsrs r0, 24 + bl GetBgTilemapBuffer + adds r2, r0, 0 + ldrh r0, [r5, 0xA] + lsls r0, 6 + ldrb r1, [r5, 0x2] + adds r0, r1 + lsls r0, 1 + subs r0, 0x2 + adds r2, r0 + cmp r4, 0 + beq _081C8C98 + ldrb r0, [r5, 0x1] + lsls r0, 12 + ldrh r1, [r5, 0x6] + adds r1, 0x1 + b _081C8C9E +_081C8C98: + ldrb r0, [r5, 0x1] + lsls r0, 12 + ldrh r1, [r5, 0x6] +_081C8C9E: + orrs r0, r1 + lsls r0, 16 + lsrs r1, r0, 16 + strh r1, [r2] + adds r0, r2, 0 + adds r0, 0x40 + strh r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81C8C64 + + thumb_func_start sub_81C8CB4 +sub_81C8CB4: @ 81C8CB4 + push {r4-r6,lr} + sub sp, 0x10 + adds r5, r0, 0 + adds r4, r1, 0 + ldr r1, =gUnknown_0861FBE4 + add r0, sp, 0xC + movs r2, 0x3 + bl memcpy + ldrh r1, [r5] + ldr r0, [r5, 0xC] + muls r1, r0 + ldr r0, [r5, 0x10] + adds r0, r1 + adds r6, r4, 0 + adds r6, 0x48 + ldr r2, [r4, 0x34] + adds r1, r6, 0 + bl _call_via_r2 + ldrh r0, [r4, 0x8] + ldrh r1, [r5] + ldrh r2, [r4, 0xA] + ldr r3, [r4, 0x38] + bl _call_via_r3 + ldrb r0, [r4, 0x8] + ldrh r3, [r4, 0xA] + lsls r3, 20 + lsrs r3, 16 + ldrb r1, [r4, 0x4] + lsls r1, 3 + str r1, [sp] + movs r1, 0x10 + str r1, [sp, 0x4] + movs r1, 0x44 + movs r2, 0 + bl FillWindowPixelRect + ldrb r0, [r4, 0x8] + ldrb r1, [r4, 0x5] + ldrh r3, [r4, 0xA] + lsls r3, 4 + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + add r2, sp, 0xC + str r2, [sp] + movs r2, 0x1 + negs r2, r2 + str r2, [sp, 0x4] + str r6, [sp, 0x8] + movs r2, 0x8 + bl box_print + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81C8C64 + ldrh r0, [r4, 0x8] + ldrh r3, [r4, 0xA] + lsls r3, 1 + ldrb r1, [r4, 0x4] + str r1, [sp] + movs r1, 0x2 + str r1, [sp, 0x4] + movs r1, 0x3 + movs r2, 0 + bl CopyWindowRectToVram + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C8CB4 + + thumb_func_start sub_81C8D4C +sub_81C8D4C: @ 81C8D4C + push {r4,r5,lr} + sub sp, 0xC + adds r4, r1, 0 + ldrh r2, [r0] + ldr r1, [r0, 0xC] + muls r1, r2 + ldr r0, [r0, 0x10] + adds r0, r1 + adds r5, r4, 0 + adds r5, 0x48 + ldr r2, [r4, 0x34] + adds r1, r5, 0 + bl _call_via_r2 + ldrb r0, [r4, 0x8] + ldrh r3, [r4, 0xA] + lsls r3, 20 + lsrs r3, 16 + ldrb r1, [r4, 0x4] + lsls r1, 3 + str r1, [sp] + movs r1, 0x10 + str r1, [sp, 0x4] + movs r1, 0x11 + movs r2, 0 + bl FillWindowPixelRect + ldrb r0, [r4, 0x8] + ldrb r1, [r4, 0x5] + ldrh r2, [r4, 0xA] + lsls r2, 4 + adds r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp] + movs r2, 0xFF + str r2, [sp, 0x4] + movs r2, 0 + str r2, [sp, 0x8] + adds r2, r5, 0 + movs r3, 0x8 + bl Print + adds r0, r4, 0 + movs r1, 0 + bl sub_81C8C64 + ldrb r0, [r4, 0x8] + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81C8D4C + + thumb_func_start sub_81C8DBC +sub_81C8DBC: @ 81C8DBC + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x1C + adds r6, r0, 0 + mov r8, r1 + add r1, sp, 0xC + ldr r0, =gUnknown_0861FBE8 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + add r0, sp, 0x18 + mov r9, r0 + ldr r1, =gUnknown_0861FBF4 + movs r2, 0x3 + bl memcpy + ldrh r4, [r6, 0xA] + mov r1, r8 + lsls r0, r1, 1 + adds r0, 0x1 + adds r4, r0 + movs r0, 0xF + ands r4, r0 + ldrb r0, [r6, 0x8] + lsls r5, r4, 4 + adds r3, r5, 0 + ldrb r1, [r6, 0x4] + str r1, [sp] + movs r1, 0x10 + str r1, [sp, 0x4] + movs r1, 0x11 + movs r2, 0 + bl FillWindowPixelRect + ldrb r0, [r6, 0x8] + movs r1, 0x1 + orrs r5, r1 + mov r2, r9 + str r2, [sp] + subs r1, 0x2 + str r1, [sp, 0x4] + mov r3, r8 + lsls r3, 2 + mov r8, r3 + mov r1, sp + add r1, r8 + adds r1, 0xC + ldr r1, [r1] + str r1, [sp, 0x8] + movs r1, 0x7 + movs r2, 0x2 + adds r3, r5, 0 + bl box_print + ldrh r0, [r6, 0x8] + lsls r4, 1 + ldrb r1, [r6, 0x4] + str r1, [sp] + movs r1, 0x2 + str r1, [sp, 0x4] + movs r2, 0 + adds r3, r4, 0 + bl CopyWindowRectToVram + add sp, 0x1C + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C8DBC + + thumb_func_start sub_81C8E54 +sub_81C8E54: @ 81C8E54 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + adds r7, r1, 0 + adds r1, r2, 0 + ldrh r3, [r7, 0xA] + ldr r2, =gUnknown_0861FBF7 + adds r2, r1, r2 + ldrb r2, [r2] + adds r6, r3, r2 + movs r2, 0xF + ands r6, r2 + ldrh r0, [r0] + bl sub_81CAFD8 + adds r5, r0, 0 + cmp r5, 0 + beq _081C8EC0 + ldrh r0, [r7, 0x8] + lsls r4, r6, 1 + ldrb r3, [r7, 0x4] + subs r3, 0x1 + movs r1, 0x2 + mov r8, r1 + str r1, [sp] + movs r1, 0x1 + adds r2, r4, 0 + bl sub_81DB620 + ldrb r0, [r7, 0x8] + lsls r1, r6, 4 + movs r2, 0x1 + orrs r1, r2 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x7 + adds r2, r5, 0 + movs r3, 0x2 + bl Print + ldrh r0, [r7, 0x8] + ldrb r1, [r7, 0x4] + str r1, [sp] + mov r1, r8 + str r1, [sp, 0x4] + movs r1, 0x2 + movs r2, 0 + adds r3, r4, 0 + bl CopyWindowRectToVram +_081C8EC0: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C8E54 + + thumb_func_start sub_81C8ED0 +sub_81C8ED0: @ 81C8ED0 + push {r4,r5,lr} + movs r5, 0 + ldr r4, =gUnknown_0861FBFC +_081C8ED6: + adds r0, r4, 0 + bl LoadCompressedObjectPic + adds r4, 0x8 + adds r5, 0x1 + cmp r5, 0 + beq _081C8ED6 + ldr r0, =gUnknown_0861FC04 + bl sub_81C795C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C8ED0 + + thumb_func_start sub_81C8EF8 +sub_81C8EF8: @ 81C8EF8 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, =gUnknown_0861FC1C + ldrb r1, [r5, 0x2] + lsls r1, 3 + adds r1, 0x3 + ldrb r2, [r5, 0x3] + adds r2, 0x1 + lsls r2, 3 + movs r3, 0x7 + bl AddObjectToFront + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + ldr r1, =0x02020630 + mov r8, r1 + add r0, r8 + str r0, [r5, 0x3C] + ldrb r6, [r5, 0x2] + lsls r6, 3 + ldrb r0, [r5, 0x4] + subs r0, 0x1 + lsls r0, 2 + ldr r3, =gUnknown_0861FC3C + mov r10, r3 + adds r6, r0 + ldrb r2, [r5, 0x3] + lsls r2, 3 + ldrh r0, [r4, 0x8] + lsls r0, 4 + adds r2, r0 + lsls r2, 16 + asrs r2, 16 + mov r0, r10 + adds r1, r6, 0 + movs r3, 0x7 + bl AddObjectToFront + lsls r0, 24 + lsrs r3, r0, 24 + lsls r2, r3, 4 + adds r2, r3 + lsls r2, 2 + add r2, r8 + str r2, [r5, 0x44] + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x2 + ldr r0, =0x000003ff + mov r9, r0 + mov r0, r9 + ands r1, r0 + ldr r4, =0xfffffc00 + adds r0, r4, 0 + ands r0, r3 + orrs r0, r1 + strh r0, [r2, 0x4] + ldr r1, [r5, 0x44] + ldr r0, =sub_81C90A0 + str r0, [r1, 0x1C] + ldrb r2, [r5, 0x3] + lsls r2, 3 + mov r0, r10 + adds r1, r6, 0 + movs r3, 0x7 + bl AddObjectToFront + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + add r1, r8 + str r1, [r5, 0x40] + ldrh r2, [r1, 0x4] + lsls r0, r2, 22 + lsrs r0, 22 + adds r0, 0x4 + mov r3, r9 + ands r0, r3 + ands r4, r2 + orrs r4, r0 + strh r4, [r1, 0x4] + ldr r1, [r5, 0x40] + ldr r0, =sub_81C90F4 + str r0, [r1, 0x1C] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C8EF8 + + thumb_func_start sub_81C8FE0 +sub_81C8FE0: @ 81C8FE0 + push {r4,lr} + adds r4, r0, 0 + ldr r0, [r4, 0x3C] + bl RemoveObjectAndFreeTiles + ldr r0, [r4, 0x40] + bl RemoveObjectAndFreeTiles + ldr r0, [r4, 0x44] + bl RemoveObjectAndFreeTiles + movs r0, 0xA + bl FreeObjectTilesByTag + movs r0, 0x14 + bl FreeObjectPaletteByTag + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81C8FE0 + + thumb_func_start sub_81C9008 +sub_81C9008: @ 81C9008 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + cmp r4, 0 + beq _081C9028 + ldr r2, [r5, 0x3C] + ldr r1, =DummyObjectCallback + str r1, [r2, 0x1C] + ldr r0, [r5, 0x40] + str r1, [r0, 0x1C] + ldr r0, [r5, 0x44] + str r1, [r0, 0x1C] + b _081C903A + .pool +_081C9028: + ldr r2, [r5, 0x3C] + ldr r0, =sub_81C9080 + str r0, [r2, 0x1C] + ldr r1, [r5, 0x40] + ldr r0, =sub_81C90F4 + str r0, [r1, 0x1C] + ldr r1, [r5, 0x44] + ldr r0, =sub_81C90A0 + str r0, [r1, 0x1C] +_081C903A: + adds r3, r2, 0 + adds r3, 0x3E + movs r0, 0x1 + ands r4, r0 + lsls r4, 2 + ldrb r2, [r3] + movs r1, 0x5 + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + orrs r0, r4 + strb r0, [r3] + ldr r2, [r5, 0x40] + adds r2, 0x3E + ldrb r3, [r2] + adds r0, r1, 0 + ands r0, r3 + orrs r0, r4 + strb r0, [r2] + ldr r0, [r5, 0x44] + adds r0, 0x3E + ldrb r2, [r0] + ands r1, r2 + orrs r1, r4 + strb r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C9008 + + thumb_func_start sub_81C9080 +sub_81C9080: @ 81C9080 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x11 + bl sub_81C763C + ldr r1, =0x0000088e + adds r0, r1 + ldrh r0, [r0] + lsls r0, 4 + strh r0, [r4, 0x26] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C9080 + + thumb_func_start sub_81C90A0 +sub_81C90A0: @ 81C90A0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081C90C2 + bl sub_81C84C0 + cmp r0, 0 + beq _081C90C2 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + b _081C90CC +_081C90C2: + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 +_081C90CC: + strb r0, [r2] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _081C90EC + movs r0, 0 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + movs r1, 0x7 + ands r0, r1 + strh r0, [r4, 0x30] + strh r0, [r4, 0x26] +_081C90EC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81C90A0 + + thumb_func_start sub_81C90F4 +sub_81C90F4: @ 81C90F4 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081C9116 + bl sub_81C84A4 + cmp r0, 0 + beq _081C9116 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + b _081C9120 +_081C9116: + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 +_081C9120: + strb r0, [r2] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _081C9142 + movs r0, 0 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + movs r1, 0x7 + ands r0, r1 + strh r0, [r4, 0x30] + negs r0, r0 + strh r0, [r4, 0x26] +_081C9142: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81C90F4 + + thumb_func_start sub_81C9148 +sub_81C9148: @ 81C9148 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x11 + bl sub_81C763C + ldr r1, [r0, 0x40] + strh r4, [r1, 0x3C] + ldr r0, [r0, 0x44] + strh r4, [r0, 0x3C] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81C9148 + + thumb_func_start sub_81C9160 +sub_81C9160: @ 81C9160 + push {r4,r5,lr} + adds r2, r0, 0 + ldr r0, [r1] + str r0, [r2, 0x10] + ldrh r4, [r1, 0x6] + movs r5, 0 + strh r4, [r2] + ldrh r3, [r1, 0x4] + strh r3, [r2, 0x2] + ldrb r0, [r1, 0x8] + str r0, [r2, 0xC] + ldrb r1, [r1, 0xC] + strh r1, [r2, 0x8] + lsls r0, r3, 16 + lsrs r0, 16 + cmp r1, r0 + bcc _081C918A + strh r5, [r2] + strh r5, [r2, 0x4] + strh r4, [r2, 0x6] + b _081C91A6 +_081C918A: + subs r0, r3, r1 + strh r0, [r2, 0x4] + ldrh r1, [r2] + ldrh r0, [r2, 0x8] + adds r1, r0 + ldrh r0, [r2, 0x2] + cmp r1, r0 + ble _081C91A4 + subs r0, r1, r0 + strh r0, [r2, 0x6] + subs r0, r4, r0 + strh r0, [r2] + b _081C91A6 +_081C91A4: + strh r5, [r2, 0x6] +_081C91A6: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81C9160 + + thumb_func_start sub_81C91AC +sub_81C91AC: @ 81C91AC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + adds r7, r0, 0 + ldr r4, [r1] + lsls r4, 30 + lsrs r0, r4, 30 + movs r1, 0 + mov r9, r1 + strb r0, [r7] + strh r3, [r7, 0x6] + ldr r0, [r2, 0x10] + str r0, [r7, 0x34] + ldr r0, [r2, 0x14] + str r0, [r7, 0x38] + ldrb r6, [r2, 0xD] + strb r6, [r7, 0x1] + ldrb r1, [r2, 0x9] + strb r1, [r7, 0x2] + ldrb r0, [r2, 0xB] + strb r0, [r7, 0x3] + ldrb r5, [r2, 0xA] + strb r5, [r7, 0x4] + ldrb r0, [r2, 0xE] + strb r0, [r7, 0x5] + lsrs r4, 30 + ldr r2, =0xffffff00 + mov r8, r2 + ldr r0, [sp] + ands r0, r2 + orrs r0, r4 + lsls r1, 24 + lsrs r1, 16 + ldr r2, =0xffff00ff + ands r0, r2 + orrs r0, r1 + ldr r1, =0xff00ffff + ands r0, r1 + lsls r5, 24 + ldr r1, =0x00ffffff + ands r0, r1 + orrs r0, r5 + str r0, [sp] + ldr r0, [sp, 0x4] + mov r1, r8 + ands r0, r1 + movs r1, 0x20 + orrs r0, r1 + lsls r6, 24 + lsrs r6, 16 + ands r0, r2 + orrs r0, r6 + adds r3, 0x2 + lsls r3, 16 + ldr r1, =0x0000ffff + ands r0, r1 + orrs r0, r3 + str r0, [sp, 0x4] + mov r0, sp + bl AddWindow + strh r0, [r7, 0x8] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xFF + beq _081C9258 + mov r2, r9 + strh r2, [r7, 0xA] + mov r0, r9 + str r0, [r7, 0x3C] + str r0, [r7, 0x40] + str r0, [r7, 0x44] + movs r0, 0x1 + b _081C925A + .pool +_081C9258: + movs r0, 0 +_081C925A: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81C91AC + + thumb_func_start sub_81C9268 +sub_81C9268: @ 81C9268 + push {r4,lr} + movs r4, 0 + movs r0, 0x98 + lsls r0, 1 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _081C928A + movs r4, 0x1 + ldr r0, =0x0000089b + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _081C928A + movs r4, 0x2 +_081C928A: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81C9268 + + thumb_func_start sub_81C9298 +sub_81C9298: @ 81C9298 + push {r4,lr} + movs r0, 0x1 + movs r1, 0x10 + bl sub_81C761C + adds r4, r0, 0 + cmp r4, 0 + beq _081C92C4 + bl sub_81C9268 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + strh r0, [r4] + strh r1, [r4, 0x2] + strh r1, [r4, 0x4] + strh r1, [r4, 0x6] + adds r0, r4, 0 + bl sub_81C939C + movs r0, 0x1 + b _081C92C6 +_081C92C4: + movs r0, 0 +_081C92C6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81C9298 + + thumb_func_start sub_81C92CC +sub_81C92CC: @ 81C92CC + push {r4,lr} + movs r0, 0x1 + movs r1, 0x10 + bl sub_81C761C + adds r4, r0, 0 + cmp r4, 0 + beq _081C92FA + bl sub_81C9268 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + strh r0, [r4] + movs r0, 0x2 + strh r0, [r4, 0x2] + strh r0, [r4, 0x4] + strh r1, [r4, 0x6] + adds r0, r4, 0 + bl sub_81C939C + movs r0, 0x1 + b _081C92FC +_081C92FA: + movs r0, 0 +_081C92FC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81C92CC + + thumb_func_start sub_81C9304 +sub_81C9304: @ 81C9304 + push {r4,lr} + movs r0, 0x1 + movs r1, 0x10 + bl sub_81C761C + adds r4, r0, 0 + cmp r4, 0 + beq _081C932E + bl sub_81C9268 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + movs r0, 0x3 + strh r0, [r4, 0x2] + strh r0, [r4, 0x4] + adds r0, r4, 0 + bl sub_81C939C + movs r0, 0x1 + b _081C9330 +_081C932E: + movs r0, 0 +_081C9330: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81C9304 + + thumb_func_start sub_81C9338 +sub_81C9338: @ 81C9338 + push {lr} + movs r0, 0x1 + movs r1, 0x10 + bl sub_81C761C + adds r2, r0, 0 + cmp r2, 0 + beq _081C9360 + movs r0, 0 + movs r1, 0x3 + strh r1, [r2] + strh r0, [r2, 0x2] + movs r1, 0x5 + strh r1, [r2, 0x4] + strh r0, [r2, 0x6] + adds r0, r2, 0 + bl sub_81C939C + movs r0, 0x1 + b _081C9362 +_081C9360: + movs r0, 0 +_081C9362: + pop {r1} + bx r1 + thumb_func_end sub_81C9338 + + thumb_func_start sub_81C9368 +sub_81C9368: @ 81C9368 + push {r4,r5,lr} + movs r0, 0x1 + movs r1, 0x10 + bl sub_81C761C + adds r5, r0, 0 + cmp r5, 0 + beq _081C9394 + movs r4, 0 + movs r0, 0x4 + strh r0, [r5] + bl sub_81C76AC + strh r0, [r5, 0x2] + adds r0, 0x8 + strh r0, [r5, 0x4] + strh r4, [r5, 0x6] + adds r0, r5, 0 + bl sub_81C939C + movs r0, 0x1 + b _081C9396 +_081C9394: + movs r0, 0 +_081C9396: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81C9368 + + thumb_func_start sub_81C939C +sub_81C939C: @ 81C939C + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4] + cmp r0, 0x4 + bhi _081C93E0 + lsls r0, 2 + ldr r1, =_081C93B4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081C93B4: + .4byte _081C93C8 + .4byte _081C93CE + .4byte _081C93CE + .4byte _081C93D4 + .4byte _081C93DC +_081C93C8: + movs r0, 0 + bl sub_81C7688 +_081C93CE: + bl sub_81C93EC + b _081C93DE +_081C93D4: + ldr r0, =sub_81C963C + b _081C93DE + .pool +_081C93DC: + ldr r0, =sub_81C96FC +_081C93DE: + str r0, [r4, 0xC] +_081C93E0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C939C + + thumb_func_start sub_81C93EC +sub_81C93EC: @ 81C93EC + push {lr} + bl sub_81C767C + cmp r0, 0x1 + beq _081C9408 + cmp r0, 0x1 + bcc _081C93FE + cmp r0, 0x2 + beq _081C9410 +_081C93FE: + ldr r0, =sub_81C943C + b _081C9412 + .pool +_081C9408: + ldr r0, =sub_81C9520 + b _081C9412 + .pool +_081C9410: + ldr r0, =c2_pre_battle_1 +_081C9412: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81C93EC + + thumb_func_start sub_81C941C +sub_81C941C: @ 81C941C + push {lr} + movs r0, 0x1 + bl sub_81C763C + ldr r1, [r0, 0xC] + bl _call_via_r1 + pop {r1} + bx r1 + thumb_func_end sub_81C941C + + thumb_func_start sub_81C9430 +sub_81C9430: @ 81C9430 + push {lr} + movs r0, 0x1 + bl sub_81C7650 + pop {r0} + bx r0 + thumb_func_end sub_81C9430 + + thumb_func_start sub_81C943C +sub_81C943C: @ 81C943C + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_81C9814 + cmp r0, 0 + beq _081C944C + movs r0, 0x1 + b _081C951A +_081C944C: + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + ands r0, r1 + adds r5, r2, 0 + cmp r0, 0 + beq _081C9508 + ldr r3, =gUnknown_0861FC59 + movs r0, 0x2 + ldrsh r1, [r4, r0] + ldrh r2, [r4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 1 + adds r1, r0 + adds r1, r3 + ldrb r0, [r1] + cmp r0, 0x4 + bhi _081C9508 + lsls r0, 2 + ldr r1, =_081C9488 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081C9488: + .4byte _081C949C + .4byte _081C94BC + .4byte _081C94D4 + .4byte _081C94E0 + .4byte _081C9516 +_081C949C: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r1, [r0, 0x15] + movs r0, 0x8 + ands r0, r1 + movs r1, 0x1 + cmp r0, 0 + beq _081C94AE + movs r1, 0x2 +_081C94AE: + strh r1, [r4, 0x6] + ldr r1, =0x000186a6 + b _081C94EE + .pool +_081C94BC: + movs r1, 0 + movs r0, 0x3 + strh r0, [r4] + strh r1, [r4, 0x2] + ldrb r0, [r3, 0x12] + strh r0, [r4, 0x4] + ldr r0, =sub_81C963C + str r0, [r4, 0xC] + movs r0, 0x2 + b _081C951A + .pool +_081C94D4: + movs r0, 0x6 + strh r0, [r4, 0x6] + ldr r1, =0x000186ab + b _081C94EE + .pool +_081C94E0: + bl sub_81C76B8 + cmp r0, 0 + beq _081C94FC + movs r0, 0x9 + strh r0, [r4, 0x6] + ldr r1, =0x000186ac +_081C94EE: + adds r0, r4, 0 + bl sub_81C97B0 + movs r0, 0x8 + b _081C951A + .pool +_081C94FC: + ldr r0, =sub_81C9600 + str r0, [r4, 0xC] + movs r0, 0x6 + b _081C951A + .pool +_081C9508: + ldrh r1, [r5, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _081C9516 + movs r0, 0 + b _081C951A +_081C9516: + movs r0, 0x1 + negs r0, r0 +_081C951A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81C943C + + thumb_func_start sub_81C9520 +sub_81C9520: @ 81C9520 + push {r4,lr} + adds r4, r0, 0 + bl sub_81C9814 + cmp r0, 0 + beq _081C9530 + movs r0, 0x1 + b _081C9580 +_081C9530: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081C9570 + ldr r3, =gUnknown_0861FC59 + movs r0, 0x2 + ldrsh r1, [r4, r0] + ldrh r2, [r4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 1 + adds r1, r0 + adds r1, r3 + ldrb r0, [r1] + cmp r0, 0x2 + bne _081C9578 + movs r0, 0x6 + strh r0, [r4, 0x6] + ldr r1, =0x000186ab + adds r0, r4, 0 + bl sub_81C97B0 + movs r0, 0x8 + b _081C9580 + .pool +_081C9570: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081C957E +_081C9578: + movs r0, 0x20 + bl audio_play +_081C957E: + movs r0, 0 +_081C9580: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81C9520 + + thumb_func_start c2_pre_battle_1 +c2_pre_battle_1: @ 81C9588 + push {r4,lr} + adds r4, r0, 0 + bl sub_81C9814 + cmp r0, 0 + beq _081C9598 + movs r0, 0x1 + b _081C95F8 +_081C9598: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081C95E8 + ldr r3, =gUnknown_0861FC59 + movs r0, 0x2 + ldrsh r1, [r4, r0] + ldrh r2, [r4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 1 + adds r1, r0 + adds r1, r3 + ldrb r0, [r1] + cmp r0, 0x2 + beq _081C95D4 + cmp r0, 0x4 + beq _081C95F4 + movs r0, 0x20 + bl audio_play + movs r0, 0 + b _081C95F8 + .pool +_081C95D4: + movs r0, 0x6 + strh r0, [r4, 0x6] + ldr r1, =0x000186ab + adds r0, r4, 0 + bl sub_81C97B0 + movs r0, 0x8 + b _081C95F8 + .pool +_081C95E8: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _081C95F4 + movs r0, 0 + b _081C95F8 +_081C95F4: + movs r0, 0x1 + negs r0, r0 +_081C95F8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end c2_pre_battle_1 + + thumb_func_start sub_81C9600 +sub_81C9600: @ 81C9600 + push {r4,lr} + adds r4, r0, 0 + bl sub_81C9814 + cmp r0, 0 + beq _081C9616 + bl sub_81C93EC + str r0, [r4, 0xC] + movs r0, 0x1 + b _081C9634 +_081C9616: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _081C962C + movs r0, 0 + b _081C9634 + .pool +_081C962C: + bl sub_81C93EC + str r0, [r4, 0xC] + movs r0, 0x7 +_081C9634: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81C9600 + + thumb_func_start sub_81C963C +sub_81C963C: @ 81C963C + push {r4-r6,lr} + adds r4, r0, 0 + bl sub_81C9814 + adds r3, r0, 0 + cmp r3, 0 + beq _081C964E + movs r0, 0x1 + b _081C96F6 +_081C964E: + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + ands r0, r1 + adds r6, r2, 0 + cmp r0, 0 + beq _081C96B8 + ldr r5, =gUnknown_0861FC59 + movs r1, 0x2 + ldrsh r0, [r4, r1] + ldrh r2, [r4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 1 + adds r0, r1 + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0x6 + beq _081C968E + cmp r0, 0x6 + bgt _081C9688 + cmp r0, 0x5 + beq _081C96A4 + b _081C96B8 + .pool +_081C9688: + cmp r0, 0x7 + beq _081C96E4 + b _081C96B8 +_081C968E: + movs r0, 0x4 + strh r0, [r4] + strh r3, [r4, 0x2] + ldrb r0, [r5, 0x18] + strh r0, [r4, 0x4] + ldr r0, =sub_81C96FC + str r0, [r4, 0xC] + movs r0, 0x4 + b _081C96F6 + .pool +_081C96A4: + strh r3, [r4, 0x6] + ldr r1, =0x000186a7 + adds r0, r4, 0 + bl sub_81C97B0 + movs r0, 0x8 + b _081C96F6 + .pool +_081C96B8: + ldrh r1, [r6, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081C96F4 + movs r0, 0x2 + ldrsh r2, [r4, r0] + ldr r1, =gUnknown_0861FC54 + ldrh r0, [r4] + adds r0, r1 + ldrb r0, [r0] + cmp r2, r0 + beq _081C96E4 + strh r0, [r4, 0x2] + ldr r0, =sub_81C9798 + str r0, [r4, 0xC] + movs r0, 0x1 + b _081C96F6 + .pool +_081C96E4: + movs r0, 0x5 + bl audio_play + adds r0, r4, 0 + bl sub_81C97C0 + movs r0, 0x3 + b _081C96F6 +_081C96F4: + movs r0, 0 +_081C96F6: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81C963C + + thumb_func_start sub_81C96FC +sub_81C96FC: @ 81C96FC + push {r4,lr} + adds r4, r0, 0 + bl sub_81C9814 + cmp r0, 0 + beq _081C970C + movs r0, 0x1 + b _081C9792 +_081C970C: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081C9754 + ldr r3, =gUnknown_0861FC59 + movs r0, 0x2 + ldrsh r1, [r4, r0] + ldrh r2, [r4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 1 + adds r1, r0 + adds r1, r3 + ldrb r0, [r1] + cmp r0, 0xD + beq _081C9780 + subs r0, 0x8 + bl sub_81C7694 + ldr r1, =0x000186a8 + adds r0, r4, 0 + bl sub_81C97B0 + movs r0, 0x3 + strh r0, [r4, 0x6] + movs r0, 0x8 + b _081C9792 + .pool +_081C9754: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081C9790 + movs r0, 0x2 + ldrsh r2, [r4, r0] + ldr r1, =gUnknown_0861FC54 + ldrh r0, [r4] + adds r0, r1 + ldrb r0, [r0] + cmp r2, r0 + beq _081C9780 + strh r0, [r4, 0x2] + ldr r0, =sub_81C97A4 + str r0, [r4, 0xC] + movs r0, 0x1 + b _081C9792 + .pool +_081C9780: + movs r0, 0x5 + bl audio_play + adds r0, r4, 0 + bl sub_81C97F8 + movs r0, 0x5 + b _081C9792 +_081C9790: + movs r0, 0 +_081C9792: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81C96FC + + thumb_func_start sub_81C9798 +sub_81C9798: @ 81C9798 + push {lr} + bl sub_81C97C0 + movs r0, 0x3 + pop {r1} + bx r1 + thumb_func_end sub_81C9798 + + thumb_func_start sub_81C97A4 +sub_81C97A4: @ 81C97A4 + push {lr} + bl sub_81C97F8 + movs r0, 0x5 + pop {r1} + bx r1 + thumb_func_end sub_81C97A4 + + thumb_func_start sub_81C97B0 +sub_81C97B0: @ 81C97B0 + str r1, [r0, 0x8] + ldr r1, =sub_81C97BC + str r1, [r0, 0xC] + bx lr + .pool + thumb_func_end sub_81C97B0 + + thumb_func_start sub_81C97BC +sub_81C97BC: @ 81C97BC + ldr r0, [r0, 0x8] + bx lr + thumb_func_end sub_81C97BC + + thumb_func_start sub_81C97C0 +sub_81C97C0: @ 81C97C0 + push {r4,lr} + adds r4, r0, 0 + bl sub_81C9268 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + movs r0, 0x1 + strh r0, [r4, 0x2] + ldr r2, =gUnknown_0861FC59 + ldrh r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + adds r0, 0x1 + adds r0, r2 + ldrb r0, [r0] + strh r0, [r4, 0x4] + ldr r0, =sub_81C943C + str r0, [r4, 0xC] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C97C0 + + thumb_func_start sub_81C97F8 +sub_81C97F8: @ 81C97F8 + movs r1, 0x3 + strh r1, [r0] + movs r1, 0x1 + strh r1, [r0, 0x2] + ldr r1, =gUnknown_0861FC59 + ldrb r1, [r1, 0x13] + strh r1, [r0, 0x4] + ldr r1, =sub_81C963C + str r1, [r0, 0xC] + bx lr + .pool + thumb_func_end sub_81C97F8 + + thumb_func_start sub_81C9814 +sub_81C9814: @ 81C9814 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x40 + ands r0, r1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + beq _081C9848 + ldrh r0, [r4, 0x2] + subs r0, 0x1 + strh r0, [r4, 0x2] + lsls r0, 16 + ldrh r3, [r4] + cmp r0, 0 + bge _081C986A + ldr r0, =gUnknown_0861FC54 + adds r0, r3, r0 + ldrb r0, [r0] + strh r0, [r4, 0x2] + b _081C986A + .pool +_081C9848: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081C988C + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + movs r0, 0x2 + ldrsh r2, [r4, r0] + ldr r0, =gUnknown_0861FC54 + ldrh r1, [r4] + adds r0, r1, r0 + adds r3, r1, 0 + ldrb r0, [r0] + cmp r2, r0 + ble _081C986A + strh r5, [r4, 0x2] +_081C986A: + ldr r2, =gUnknown_0861FC59 + movs r0, 0x2 + ldrsh r1, [r4, r0] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 1 + adds r1, r0 + adds r1, r2 + ldrb r0, [r1] + strh r0, [r4, 0x4] + movs r0, 0x1 + b _081C988E + .pool +_081C988C: + movs r0, 0 +_081C988E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81C9814 + + thumb_func_start sub_81C9894 +sub_81C9894: @ 81C9894 + push {lr} + movs r0, 0x1 + bl sub_81C763C + ldrh r0, [r0] + pop {r1} + bx r1 + thumb_func_end sub_81C9894 + + thumb_func_start sub_81C98A4 +sub_81C98A4: @ 81C98A4 + push {lr} + movs r0, 0x1 + bl sub_81C763C + movs r1, 0x2 + ldrsh r0, [r0, r1] + pop {r1} + bx r1 + thumb_func_end sub_81C98A4 + + thumb_func_start sub_81C98B4 +sub_81C98B4: @ 81C98B4 + push {lr} + movs r0, 0x1 + bl sub_81C763C + ldrh r0, [r0, 0x4] + pop {r1} + bx r1 + thumb_func_end sub_81C98B4 + + thumb_func_start sub_81C98C4 +sub_81C98C4: @ 81C98C4 + push {lr} + movs r0, 0x1 + bl sub_81C763C + ldrh r0, [r0, 0x6] + pop {r1} + bx r1 + thumb_func_end sub_81C98C4 + + thumb_func_start sub_81C98D4 +sub_81C98D4: @ 81C98D4 + push {r4,lr} + movs r4, 0 +_081C98D8: + adds r0, r4, 0 + bl sub_81CB0C8 + ldr r1, =0x02037318 + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1, 0x14] + cmp r0, r1 + bne _081C9914 + adds r0, r4, 0 + bl sub_81CAE08 + cmp r0, 0 + beq _081C9914 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x000009ca + adds r0, r1 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _081C9914 + movs r0, 0x1 + b _081C991C + .pool +_081C9914: + adds r4, 0x1 + cmp r4, 0x4D + ble _081C98D8 + movs r0, 0 +_081C991C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81C98D4 + + thumb_func_start sub_81C9924 +sub_81C9924: @ 81C9924 + push {lr} + bl sub_81C9958 + adds r1, r0, 0 + cmp r1, 0 + beq _081C9938 + movs r0, 0 + strb r0, [r1, 0xD] + movs r0, 0x1 + b _081C993A +_081C9938: + movs r0, 0 +_081C993A: + pop {r1} + bx r1 + thumb_func_end sub_81C9924 + + thumb_func_start sub_81C9940 +sub_81C9940: @ 81C9940 + push {lr} + bl sub_81C9958 + adds r1, r0, 0 + cmp r1, 0 + beq _081C9952 + movs r0, 0x1 + strb r0, [r1, 0xD] + b _081C9954 +_081C9952: + movs r0, 0 +_081C9954: + pop {r1} + bx r1 + thumb_func_end sub_81C9940 + + thumb_func_start sub_81C9958 +sub_81C9958: @ 81C9958 + push {r4,lr} + ldr r1, =0x0000088c + movs r0, 0x2 + bl sub_81C761C + adds r4, r0, 0 + cmp r4, 0 + beq _081C997A + movs r0, 0 + strb r0, [r4, 0xC] + ldr r0, =sub_81C9A10 + movs r1, 0x1 + bl sub_81C7078 + str r0, [r4, 0x4] + ldr r0, =sub_81C99FC + str r0, [r4] +_081C997A: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81C9958 + + thumb_func_start sub_81C9990 +sub_81C9990: @ 81C9990 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x2 + bl sub_81C763C + adds r5, r0, 0 + ldr r0, =gUnknown_086201A0 + lsls r4, 2 + adds r4, r0 + ldr r0, [r4] + movs r1, 0x1 + bl sub_81C7078 + str r0, [r5, 0x4] + ldr r0, =sub_81C99FC + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C9990 + + thumb_func_start sub_81C99C0 +sub_81C99C0: @ 81C99C0 + push {lr} + movs r0, 0x2 + bl sub_81C763C + ldr r0, [r0] + bl _call_via_r0 + pop {r1} + bx r1 + thumb_func_end sub_81C99C0 + + thumb_func_start sub_81C99D4 +sub_81C99D4: @ 81C99D4 + push {r4,lr} + movs r0, 0x2 + bl sub_81C763C + adds r4, r0, 0 + bl sub_81CA7F4 + ldrb r0, [r4, 0x8] + bl RemoveWindow + bl sub_81C9FEC + bl sub_81CA994 + movs r0, 0x2 + bl sub_81C7650 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81C99D4 + + thumb_func_start sub_81C99FC +sub_81C99FC: @ 81C99FC + push {lr} + movs r0, 0x2 + bl sub_81C763C + ldr r0, [r0, 0x4] + bl sub_81C70D8 + pop {r1} + bx r1 + thumb_func_end sub_81C99FC + + thumb_func_start sub_81C9A10 +sub_81C9A10: @ 81C9A10 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + movs r0, 0x2 + bl sub_81C763C + adds r5, r0, 0 + cmp r4, 0x9 + bls _081C9A24 + b _081C9C60 +_081C9A24: + lsls r0, r4, 2 + ldr r1, =_081C9A34 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081C9A34: + .4byte _081C9A5C + .4byte _081C9AEC + .4byte _081C9B30 + .4byte _081C9B88 + .4byte _081C9B9E + .4byte _081C9BA4 + .4byte _081C9BB6 + .4byte _081C9BC0 + .4byte _081C9C0E + .4byte _081C9C4C +_081C9A5C: + ldr r0, =gUnknown_08620194 + movs r1, 0x3 + bl sub_81C7B54 + ldr r1, =gUnknown_08DC90E0 + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + adds r1, r5, 0 + adds r1, 0x8C + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, =gUnknown_08DC9130 + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + ldr r0, =gUnknown_08DC90C0 + movs r1, 0x10 + movs r2, 0x20 + bl sub_81C7944 + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgY +_081C9AD6: + movs r0, 0 + b _081C9C62 + .pool +_081C9AEC: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _081C9AFA + b _081C9C5C +_081C9AFA: + ldr r1, =gUnknown_0861FD6C + str r0, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r1, =gUnknown_0861FFF4 + movs r0, 0x1 + str r0, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r0, =gUnknown_0861FD4C + movs r1, 0x20 + movs r2, 0x20 + bl sub_81C7944 + b _081C9AD6 + .pool +_081C9B30: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _081C9B3E + b _081C9C5C +_081C9B3E: + ldr r1, =gUnknown_0861FC98 + str r0, [sp] + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r1, =gUnknown_0861FCAC + movs r0, 0x1 + str r0, [sp] + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r0, =gUnknown_0861FC78 + movs r1, 0x30 + movs r2, 0x20 + bl sub_81C7944 + bl sub_81C9894 + cmp r0, 0x3 + beq _081C9B76 + bl sub_81C9894 + cmp r0, 0x4 + bne _081C9AD6 +_081C9B76: + bl sub_81CA850 + b _081C9AD6 + .pool +_081C9B88: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _081C9C5C + bl sub_81CA6E0 + bl sub_81CA7D4 +_081C9B9A: + movs r0, 0x1 + b _081C9C62 +_081C9B9E: + bl sub_81C9FC4 + b _081C9B9A +_081C9BA4: + bl sub_81CA714 + bl sub_81CA02C + bl sub_81CA640 + bl sub_81CA0C8 + b _081C9AD6 +_081C9BB6: + bl sub_81CA7C4 + cmp r0, 0 + bne _081C9C5C + b _081C9B9A +_081C9BC0: + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + ldrb r0, [r5, 0xD] + cmp r0, 0 + beq _081C9BE0 + movs r0, 0x1 + bl sub_81C7AC0 + b _081C9BEC +_081C9BE0: + movs r0, 0x6E + bl audio_play + movs r0, 0x3 + bl sub_81C7AC0 +_081C9BEC: + bl sub_81C9894 + cmp r0, 0x3 + beq _081C9BFE + cmp r0, 0x4 + bne _081C9C06 + movs r0, 0x7 + bl sub_81C7DFC +_081C9BFE: + movs r0, 0x1 + bl sub_81C7DFC + b _081C9AD6 +_081C9C06: + movs r0, 0 + bl sub_81C7DFC + b _081C9AD6 +_081C9C0E: + bl sub_81C7B34 + cmp r0, 0 + bne _081C9C5C + bl sub_81C9894 + cmp r0, 0x3 + beq _081C9C2C + cmp r0, 0x4 + bne _081C9C38 + movs r0, 0x7 + movs r1, 0 + movs r2, 0 + bl sub_81C7FA0 +_081C9C2C: + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl sub_81C7FA0 + b _081C9C42 +_081C9C38: + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl sub_81C7FA0 +_081C9C42: + bl sub_81CA20C + bl titlescreen_0 + b _081C9B9A +_081C9C4C: + bl sub_81CA324 + cmp r0, 0 + bne _081C9C5C + bl sub_81C8010 + cmp r0, 0 + beq _081C9C60 +_081C9C5C: + movs r0, 0x2 + b _081C9C62 +_081C9C60: + movs r0, 0x4 +_081C9C62: + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81C9A10 + + thumb_func_start sub_81C9C6C +sub_81C9C6C: @ 81C9C6C + push {lr} + cmp r0, 0 + beq _081C9C78 + cmp r0, 0x1 + beq _081C9C8E + b _081C9CA2 +_081C9C78: + bl sub_81CAA3C + bl sub_81CA278 + bl sub_81CA714 + movs r0, 0x5 + bl audio_play + movs r0, 0 + b _081C9CA4 +_081C9C8E: + bl sub_81CA324 + cmp r0, 0 + bne _081C9C9E + bl sub_81CA7C4 + cmp r0, 0 + beq _081C9CA2 +_081C9C9E: + movs r0, 0x2 + b _081C9CA4 +_081C9CA2: + movs r0, 0x4 +_081C9CA4: + pop {r1} + bx r1 + thumb_func_end sub_81C9C6C + + thumb_func_start sub_81C9CA8 +sub_81C9CA8: @ 81C9CA8 + push {lr} + cmp r0, 0x1 + beq _081C9CDC + cmp r0, 0x1 + bgt _081C9CB8 + cmp r0, 0 + beq _081C9CC2 + b _081C9D3C +_081C9CB8: + cmp r0, 0x2 + beq _081C9CFA + cmp r0, 0x3 + beq _081C9D14 + b _081C9D3C +_081C9CC2: + bl sub_81CA9C8 + bl sub_81CA2DC + movs r0, 0 + movs r1, 0 + bl sub_81C7FC4 + movs r0, 0x5 + bl audio_play + movs r0, 0 + b _081C9D3E +_081C9CDC: + bl sub_81CA324 + cmp r0, 0 + bne _081C9D34 + bl sub_81C8010 + cmp r0, 0 + bne _081C9D34 + bl sub_81CA0C8 + movs r0, 0x1 + bl sub_81C7DFC + movs r0, 0 + b _081C9D3E +_081C9CFA: + bl sub_81CA20C + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl sub_81C7FA0 + bl sub_81CA818 + bl sub_81CA714 + movs r0, 0 + b _081C9D3E +_081C9D14: + bl sub_81CA324 + cmp r0, 0 + bne _081C9D34 + bl sub_81C8010 + cmp r0, 0 + bne _081C9D34 + bl sub_81CA89C + cmp r0, 0 + bne _081C9D34 + bl sub_81CA7C4 + cmp r0, 0 + beq _081C9D38 +_081C9D34: + movs r0, 0x2 + b _081C9D3E +_081C9D38: + bl sub_81CA9D8 +_081C9D3C: + movs r0, 0x4 +_081C9D3E: + pop {r1} + bx r1 + thumb_func_end sub_81C9CA8 + + thumb_func_start sub_81C9D44 +sub_81C9D44: @ 81C9D44 + push {lr} + cmp r0, 0x1 + beq _081C9D72 + cmp r0, 0x1 + bgt _081C9D54 + cmp r0, 0 + beq _081C9D5E + b _081C9DD2 +_081C9D54: + cmp r0, 0x2 + beq _081C9D90 + cmp r0, 0x3 + beq _081C9DAA + b _081C9DD2 +_081C9D5E: + bl sub_81CA9C8 + bl sub_81CA2DC + movs r0, 0x1 + movs r1, 0 + bl sub_81C7FC4 + movs r0, 0 + b _081C9DD4 +_081C9D72: + bl sub_81CA324 + cmp r0, 0 + bne _081C9DCA + bl sub_81C8010 + cmp r0, 0 + bne _081C9DCA + bl sub_81CA0C8 + movs r0, 0 + bl sub_81C7DFC + movs r0, 0 + b _081C9DD4 +_081C9D90: + bl sub_81CA20C + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl sub_81C7FA0 + bl sub_81CA864 + bl sub_81CA714 + movs r0, 0 + b _081C9DD4 +_081C9DAA: + bl sub_81CA324 + cmp r0, 0 + bne _081C9DCA + bl sub_81C8010 + cmp r0, 0 + bne _081C9DCA + bl sub_81CA89C + cmp r0, 0 + bne _081C9DCA + bl sub_81CA7C4 + cmp r0, 0 + beq _081C9DCE +_081C9DCA: + movs r0, 0x2 + b _081C9DD4 +_081C9DCE: + bl sub_81CA9D8 +_081C9DD2: + movs r0, 0x4 +_081C9DD4: + pop {r1} + bx r1 + thumb_func_end sub_81C9D44 + + thumb_func_start sub_81C9DD8 +sub_81C9DD8: @ 81C9DD8 + push {lr} + cmp r0, 0x1 + beq _081C9E04 + cmp r0, 0x1 + bgt _081C9DE8 + cmp r0, 0 + beq _081C9DF2 + b _081C9E50 +_081C9DE8: + cmp r0, 0x2 + beq _081C9E1A + cmp r0, 0x3 + beq _081C9E30 + b _081C9E50 +_081C9DF2: + bl sub_81CA9C8 + bl sub_81CA2DC + movs r0, 0x5 + bl audio_play + movs r0, 0 + b _081C9E52 +_081C9E04: + bl sub_81CA324 + cmp r0, 0 + bne _081C9E48 + movs r0, 0x7 + bl sub_81C7DFC + bl sub_81CA0C8 + movs r0, 0 + b _081C9E52 +_081C9E1A: + bl sub_81CA20C + movs r0, 0x7 + movs r1, 0 + movs r2, 0 + bl sub_81C7FA0 + bl sub_81CA714 + movs r0, 0 + b _081C9E52 +_081C9E30: + bl sub_81CA324 + cmp r0, 0 + bne _081C9E48 + bl sub_81C8010 + cmp r0, 0 + bne _081C9E48 + bl sub_81CA89C + cmp r0, 0 + beq _081C9E4C +_081C9E48: + movs r0, 0x2 + b _081C9E52 +_081C9E4C: + bl sub_81CA9D8 +_081C9E50: + movs r0, 0x4 +_081C9E52: + pop {r1} + bx r1 + thumb_func_end sub_81C9DD8 + + thumb_func_start sub_81C9E58 +sub_81C9E58: @ 81C9E58 + push {lr} + cmp r0, 0x1 + beq _081C9E86 + cmp r0, 0x1 + bgt _081C9E68 + cmp r0, 0 + beq _081C9E72 + b _081C9EC2 +_081C9E68: + cmp r0, 0x2 + beq _081C9E9E + cmp r0, 0x3 + beq _081C9EAA + b _081C9EC2 +_081C9E72: + bl sub_81CA9C8 + bl sub_81CA2DC + movs r0, 0x7 + movs r1, 0 + bl sub_81C7FC4 + movs r0, 0 + b _081C9EC4 +_081C9E86: + bl sub_81CA324 + cmp r0, 0 + bne _081C9EBA + bl sub_81C8010 + cmp r0, 0 + bne _081C9EBA + bl sub_81CA0C8 + movs r0, 0 + b _081C9EC4 +_081C9E9E: + bl sub_81CA20C + bl sub_81CA714 + movs r0, 0 + b _081C9EC4 +_081C9EAA: + bl sub_81CA324 + cmp r0, 0 + bne _081C9EBA + bl sub_81CA89C + cmp r0, 0 + beq _081C9EBE +_081C9EBA: + movs r0, 0x2 + b _081C9EC4 +_081C9EBE: + bl sub_81CA9D8 +_081C9EC2: + movs r0, 0x4 +_081C9EC4: + pop {r1} + bx r1 + thumb_func_end sub_81C9E58 + + thumb_func_start sub_81C9EC8 +sub_81C9EC8: @ 81C9EC8 + push {lr} + cmp r0, 0 + beq _081C9ED4 + cmp r0, 0x1 + beq _081C9EE2 + b _081C9EF0 +_081C9ED4: + movs r0, 0x20 + bl audio_play + bl sub_81CA770 + movs r0, 0 + b _081C9EF2 +_081C9EE2: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _081C9EF0 + movs r0, 0x2 + b _081C9EF2 +_081C9EF0: + movs r0, 0x4 +_081C9EF2: + pop {r1} + bx r1 + thumb_func_end sub_81C9EC8 + + thumb_func_start sub_81C9EF8 +sub_81C9EF8: @ 81C9EF8 + push {lr} + cmp r0, 0 + beq _081C9F04 + cmp r0, 0x1 + beq _081C9F12 + b _081C9F20 +_081C9F04: + movs r0, 0x5 + bl audio_play + bl sub_81CA714 + movs r0, 0 + b _081C9F22 +_081C9F12: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _081C9F20 + movs r0, 0x2 + b _081C9F22 +_081C9F20: + movs r0, 0x4 +_081C9F22: + pop {r1} + bx r1 + thumb_func_end sub_81C9EF8 + + thumb_func_start sub_81C9F28 +sub_81C9F28: @ 81C9F28 + push {lr} + cmp r0, 0x1 + beq _081C9F52 + cmp r0, 0x1 + bgt _081C9F38 + cmp r0, 0 + beq _081C9F42 + b _081C9FBC +_081C9F38: + cmp r0, 0x2 + beq _081C9F96 + cmp r0, 0x3 + beq _081C9FB0 + b _081C9FBC +_081C9F42: + bl sub_81C98C4 + lsls r0, 16 + lsrs r0, 16 + bl sub_81C7BA4 + movs r0, 0 + b _081C9FBE +_081C9F52: + bl sub_81C7BE8 + cmp r0, 0 + bne _081C9FB8 + bl sub_81C7880 + bl sub_81CA9C8 + bl sub_81CA2DC + bl sub_81C9894 + cmp r0, 0x3 + beq _081C9F7A + cmp r0, 0x4 + bne _081C9F84 + movs r0, 0x7 + movs r1, 0 + bl sub_81C7FC4 +_081C9F7A: + movs r0, 0x1 + movs r1, 0 + bl sub_81C7FC4 + b _081C9F8C +_081C9F84: + movs r0, 0 + movs r1, 0 + bl sub_81C7FC4 +_081C9F8C: + movs r0, 0x5 + bl audio_play + movs r0, 0 + b _081C9FBE +_081C9F96: + bl sub_81CA324 + cmp r0, 0 + bne _081C9FB8 + bl sub_81C8010 + cmp r0, 0 + bne _081C9FB8 + movs r0, 0 + bl sub_81C7AC0 + movs r0, 0 + b _081C9FBE +_081C9FB0: + bl sub_81C7B34 + cmp r0, 0 + beq _081C9FBC +_081C9FB8: + movs r0, 0x2 + b _081C9FBE +_081C9FBC: + movs r0, 0x4 +_081C9FBE: + pop {r1} + bx r1 + thumb_func_end sub_81C9F28 + + thumb_func_start sub_81C9FC4 +sub_81C9FC4: @ 81C9FC4 + push {r4,r5,lr} + movs r5, 0 + ldr r4, =gUnknown_086201C4 +_081C9FCA: + adds r0, r4, 0 + bl LoadCompressedObjectPic + adds r4, 0x8 + adds r5, 0x1 + cmp r5, 0x1 + bls _081C9FCA + ldr r0, =gUnknown_086201D4 + bl sub_81C795C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81C9FC4 + + thumb_func_start sub_81C9FEC +sub_81C9FEC: @ 81C9FEC + push {lr} + movs r0, 0x3 + bl FreeObjectTilesByTag + movs r0, 0x1 + bl FreeObjectTilesByTag + movs r0, 0x4 + bl FreeObjectPaletteByTag + movs r0, 0x5 + bl FreeObjectPaletteByTag + movs r0, 0x6 + bl FreeObjectPaletteByTag + movs r0, 0x7 + bl FreeObjectPaletteByTag + movs r0, 0x8 + bl FreeObjectPaletteByTag + movs r0, 0x3 + bl FreeObjectPaletteByTag + bl sub_81CA094 + bl sub_81CA698 + pop {r0} + bx r0 + thumb_func_end sub_81C9FEC + + thumb_func_start sub_81CA02C +sub_81CA02C: @ 81CA02C + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r0, 0x2 + bl sub_81C763C + movs r2, 0 + adds r0, 0x2C + mov r8, r0 +_081CA03E: + movs r4, 0 + lsls r0, r2, 2 + lsls r1, r2, 4 + adds r7, r2, 0x1 + adds r0, r2 + lsls r0, 18 + movs r2, 0xA0 + lsls r2, 14 + adds r5, r0, r2 + mov r0, r8 + adds r6, r1, r0 +_081CA054: + ldr r0, =gUnknown_0862034C + movs r1, 0x8C + asrs r2, r5, 16 + movs r3, 0x3 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + stm r6!, {r1} + lsls r0, r4, 5 + strh r0, [r1, 0x24] + adds r4, 0x1 + cmp r4, 0x3 + ble _081CA054 + adds r2, r7, 0 + cmp r2, 0x5 + ble _081CA03E + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CA02C + + thumb_func_start sub_81CA094 +sub_81CA094: @ 81CA094 + push {r4-r7,lr} + movs r0, 0x2 + bl sub_81C763C + movs r1, 0 + adds r7, r0, 0 + adds r7, 0x2C +_081CA0A2: + lsls r0, r1, 4 + adds r6, r1, 0x1 + adds r4, r0, r7 + movs r5, 0x3 +_081CA0AA: + ldr r0, [r4] + bl obj_free_rotscale_entry + ldm r4!, {r0} + bl RemoveObjectAndFreeTiles + subs r5, 0x1 + cmp r5, 0 + bge _081CA0AA + adds r1, r6, 0 + cmp r1, 0x5 + ble _081CA0A2 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81CA094 + + thumb_func_start sub_81CA0C8 +sub_81CA0C8: @ 81CA0C8 + push {lr} + bl sub_81C9894 + lsls r2, r0, 3 + subs r2, r0 + lsls r2, 2 + ldr r1, =gUnknown_08620244 + adds r0, r2, r1 + subs r1, 0x4 + adds r2, r1 + ldrh r1, [r2] + ldrh r2, [r2, 0x2] + bl sub_81CA0EC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CA0C8 + + thumb_func_start sub_81CA0EC +sub_81CA0EC: @ 81CA0EC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + adds r6, r0, 0 + str r1, [sp, 0x14] + str r2, [sp] + movs r0, 0x2 + bl sub_81C763C + mov r10, r0 + movs r0, 0x3 + bl GetObjectTileRangeStartByTag + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x4] + movs r1, 0 +_081CA114: + ldr r0, [r6] + cmp r0, 0 + beq _081CA1B0 + movs r5, 0 + lsls r2, r1, 4 + mov r0, r10 + adds r0, 0x2C + lsls r3, r1, 2 + mov r9, r3 + movs r4, 0x10 + add r4, r10 + mov r8, r4 + adds r7, r6, 0x4 + str r7, [sp, 0xC] + ldr r3, [sp, 0x14] + ldr r4, [sp] + adds r3, r4 + str r3, [sp, 0x8] + adds r1, 0x1 + str r1, [sp, 0x10] + adds r4, r2, r0 +_081CA13E: + ldr r3, [r4] + ldr r0, [r6] + ldrh r2, [r0] + ldr r7, [sp, 0x4] + adds r2, r7 + lsls r0, r5, 3 + adds r2, r0 + ldr r1, =0x000003ff + adds r0, r1, 0 + ands r2, r0 + ldrh r0, [r3, 0x4] + ldr r7, =0xfffffc00 + adds r1, r7, 0 + ands r0, r1 + orrs r0, r2 + strh r0, [r3, 0x4] + ldr r0, [r6] + ldrh r0, [r0, 0x2] + adds r0, 0x4 + lsls r0, 16 + lsrs r0, 16 + bl IndexOfObjectPaletteTag + ldr r3, [r4] + lsls r0, 4 + ldrb r2, [r3, 0x5] + movs r1, 0xF + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x5] + ldr r2, [r4] + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, [r4] + mov r1, sp + ldrh r1, [r1, 0x14] + strh r1, [r0, 0x22] + ldr r1, [r4] + movs r0, 0x8C + strh r0, [r1, 0x20] + ldm r4!, {r1} + lsls r0, r5, 5 + strh r0, [r1, 0x24] + adds r5, 0x1 + cmp r5, 0x3 + ble _081CA13E + mov r1, r8 + add r1, r9 + movs r0, 0x1 + b _081CA1EC + .pool +_081CA1B0: + lsls r2, r1, 4 + mov r0, r10 + adds r0, 0x2C + lsls r3, r1, 2 + mov r9, r3 + movs r4, 0x10 + add r4, r10 + mov r8, r4 + adds r6, 0x4 + str r6, [sp, 0xC] + ldr r7, [sp, 0x14] + ldr r3, [sp] + adds r7, r3 + str r7, [sp, 0x8] + adds r1, 0x1 + str r1, [sp, 0x10] + movs r3, 0x4 + adds r2, r0 + movs r5, 0x3 +_081CA1D6: + ldm r2!, {r1} + adds r1, 0x3E + ldrb r0, [r1] + orrs r0, r3 + strb r0, [r1] + subs r5, 0x1 + cmp r5, 0 + bge _081CA1D6 + mov r1, r8 + add r1, r9 + movs r0, 0 +_081CA1EC: + str r0, [r1] + ldr r6, [sp, 0xC] + ldr r4, [sp, 0x8] + str r4, [sp, 0x14] + ldr r1, [sp, 0x10] + cmp r1, 0x5 + ble _081CA114 + 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_81CA0EC + + thumb_func_start sub_81CA20C +sub_81CA20C: @ 81CA20C + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r0, 0x2 + bl sub_81C763C + adds r6, r0, 0 + bl sub_81C98A4 + mov r8, r0 + movs r7, 0 + movs r5, 0 + adds r4, r6, 0 + adds r4, 0x2C +_081CA228: + lsls r0, r5, 2 + adds r1, r6, 0 + adds r1, 0x10 + adds r1, r0 + ldr r0, [r1] + cmp r0, 0 + beq _081CA25C + adds r0, r7, 0 + adds r7, 0x1 + cmp r0, r8 + bne _081CA244 + movs r2, 0x82 + strb r5, [r6, 0xB] + b _081CA246 +_081CA244: + movs r2, 0x8C +_081CA246: + adds r0, r4, 0 + movs r1, 0x80 + lsls r1, 1 + movs r3, 0xC + bl sub_81CA35C + adds r0, r4, 0 + movs r1, 0 + bl sub_81CA448 + b _081CA264 +_081CA25C: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81CA448 +_081CA264: + adds r4, 0x10 + adds r5, 0x1 + cmp r5, 0x5 + ble _081CA228 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81CA20C + + thumb_func_start sub_81CA278 +sub_81CA278: @ 81CA278 + push {r4,r5,lr} + movs r0, 0x2 + bl sub_81C763C + adds r4, r0, 0 + bl sub_81C98A4 + adds r3, r0, 0 + movs r2, 0 + movs r5, 0 + ldr r0, [r4, 0x10] + cmp r0, 0 + beq _081CA298 + cmp r5, r3 + beq _081CA2B2 +_081CA296: + adds r5, 0x1 +_081CA298: + adds r2, 0x1 + cmp r2, 0x5 + bgt _081CA2B2 + lsls r0, r2, 2 + adds r1, r4, 0 + adds r1, 0x10 + adds r1, r0 + ldr r0, [r1] + cmp r0, 0 + beq _081CA298 + cmp r5, r3 + bne _081CA296 + adds r5, r2, 0 +_081CA2B2: + ldrb r0, [r4, 0xB] + lsls r0, 4 + adds r0, 0x2C + adds r0, r4, r0 + movs r1, 0x82 + movs r2, 0x8C + movs r3, 0x4 + bl sub_81CA35C + lsls r0, r5, 4 + adds r0, 0x2C + adds r0, r4, r0 + movs r1, 0x8C + movs r2, 0x82 + movs r3, 0x4 + bl sub_81CA35C + strb r5, [r4, 0xB] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81CA278 + + thumb_func_start sub_81CA2DC +sub_81CA2DC: @ 81CA2DC + push {r4-r6,lr} + movs r0, 0x2 + bl sub_81C763C + adds r6, r0, 0 + movs r5, 0 + adds r4, r6, 0 + adds r4, 0x2C +_081CA2EC: + lsls r0, r5, 2 + adds r1, r6, 0 + adds r1, 0x10 + adds r1, r0 + ldr r0, [r1] + cmp r0, 0 + beq _081CA316 + ldrb r0, [r6, 0xB] + cmp r0, r5 + beq _081CA310 + adds r0, r4, 0 + movs r1, 0x8C + movs r2, 0x80 + lsls r2, 1 + movs r3, 0x8 + bl sub_81CA35C + b _081CA316 +_081CA310: + adds r0, r4, 0 + bl sub_81CA3B4 +_081CA316: + adds r4, 0x10 + adds r5, 0x1 + cmp r5, 0x5 + ble _081CA2EC + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81CA2DC + + thumb_func_start sub_81CA324 +sub_81CA324: @ 81CA324 + push {r4,lr} + movs r0, 0x2 + bl sub_81C763C + adds r3, r0, 0 + movs r2, 0 + ldr r4, =DummyObjectCallback + adds r1, r3, 0 + adds r1, 0x2C +_081CA336: + ldr r0, [r1] + ldr r0, [r0, 0x1C] + cmp r0, r4 + bne _081CA354 + adds r1, 0x10 + adds r2, 0x1 + cmp r2, 0x5 + ble _081CA336 + ldrb r0, [r3, 0xC] + cmp r0, 0 + bne _081CA354 + movs r0, 0 + b _081CA356 + .pool +_081CA354: + movs r0, 0x1 +_081CA356: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81CA324 + + thumb_func_start sub_81CA35C +sub_81CA35C: @ 81CA35C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r4, r0, 0 + adds r5, r1, 0 + mov r9, r2 + adds r6, r3, 0 + ldr r0, =sub_81CA474 + mov r8, r0 + subs r0, r2, r5 + lsls r0, 4 + adds r1, r6, 0 + bl __divsi3 + adds r3, r0, 0 + movs r1, 0x3 + lsls r2, r5, 4 +_081CA380: + ldr r0, [r4] + strh r5, [r0, 0x20] + ldr r0, [r4] + strh r6, [r0, 0x2E] + ldr r0, [r4] + strh r3, [r0, 0x30] + ldr r0, [r4] + strh r2, [r0, 0x32] + ldr r0, [r4] + mov r7, r9 + strh r7, [r0, 0x3C] + ldm r4!, {r0} + mov r7, r8 + str r7, [r0, 0x1C] + subs r1, 0x1 + cmp r1, 0 + bge _081CA380 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CA35C + + thumb_func_start sub_81CA3B4 +sub_81CA3B4: @ 81CA3B4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + movs r0, 0x2 + bl sub_81C763C + adds r7, r0, 0 + movs r5, 0 + mov r8, r5 +_081CA3C8: + ldr r2, [r4] + ldrb r1, [r2, 0x1] + movs r3, 0xD + negs r3, r3 + adds r0, r3, 0 + ands r1, r0 + movs r0, 0x4 + orrs r1, r0 + strb r1, [r2, 0x1] + ldr r2, [r4] + ldrb r0, [r2, 0x1] + movs r1, 0x3 + orrs r0, r1 + strb r0, [r2, 0x1] + ldr r1, [r4] + ldr r0, =sub_81CA4AC + str r0, [r1, 0x1C] + movs r6, 0x8 + strh r6, [r1, 0x2E] + ldr r0, [r4] + mov r1, r8 + strh r1, [r0, 0x30] + ldr r0, [r4] + strh r5, [r0, 0x3C] + ldr r0, [r4] + bl obj_alloc_rotscale_entry + ldm r4!, {r0} + movs r1, 0 + bl StartObjectRotScalAnim + adds r5, 0x1 + cmp r5, 0x3 + ble _081CA3C8 + movs r0, 0x52 + movs r1, 0x10 + bl SetGpuReg + ldr r0, =sub_81CA580 + movs r1, 0x3 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r6, [r1, 0x8] + ldrb r0, [r7, 0xC] + adds r0, 0x1 + strb r0, [r7, 0xC] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CA3B4 + + thumb_func_start sub_81CA448 +sub_81CA448: @ 81CA448 + push {r4-r6,lr} + adds r5, r0, 0 + movs r0, 0x1 + ands r1, r0 + lsls r4, r1, 2 + movs r6, 0x5 + negs r6, r6 + movs r3, 0x3 +_081CA458: + ldm r5!, {r0} + adds r0, 0x3E + ldrb r2, [r0] + adds r1, r6, 0 + ands r1, r2 + orrs r1, r4 + strb r1, [r0] + subs r3, 0x1 + cmp r3, 0 + bge _081CA458 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81CA448 + + thumb_func_start sub_81CA474 +sub_81CA474: @ 81CA474 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x2E] + subs r0, 0x1 + strh r0, [r2, 0x2E] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _081CA49A + ldrh r0, [r2, 0x30] + ldrh r1, [r2, 0x32] + adds r0, r1 + strh r0, [r2, 0x32] + lsls r0, 16 + asrs r0, 20 + strh r0, [r2, 0x20] + b _081CA4A2 +_081CA49A: + ldrh r0, [r2, 0x3C] + strh r0, [r2, 0x20] + ldr r0, =DummyObjectCallback + str r0, [r2, 0x1C] +_081CA4A2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CA474 + + thumb_func_start sub_81CA4AC +sub_81CA4AC: @ 81CA4AC + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x2E] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _081CA574 + movs r0, 0x30 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _081CA4E2 + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + movs r0, 0x80 + lsls r0, 1 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + strh r5, [r4, 0x24] + b _081CA578 +_081CA4E2: + ldrh r0, [r4, 0x32] + adds r0, 0x10 + strh r0, [r4, 0x32] + movs r2, 0x32 + ldrsh r0, [r4, r2] + asrs r1, r0, 3 + adds r0, r1, 0 + subs r0, 0x20 + lsrs r1, r0, 31 + adds r0, r1 + asrs r1, r0, 1 + movs r2, 0x3C + ldrsh r0, [r4, r2] + cmp r0, 0x1 + beq _081CA518 + cmp r0, 0x1 + bgt _081CA50A + cmp r0, 0 + beq _081CA514 + b _081CA526 +_081CA50A: + cmp r0, 0x2 + beq _081CA51C + cmp r0, 0x3 + beq _081CA520 + b _081CA526 +_081CA514: + negs r1, r1 + b _081CA520 +_081CA518: + negs r0, r1 + b _081CA524 +_081CA51C: + strh r1, [r4, 0x24] + b _081CA526 +_081CA520: + lsls r0, r1, 1 + adds r0, r1 +_081CA524: + strh r0, [r4, 0x24] +_081CA526: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _081CA578 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + ldrb r1, [r4, 0x1] + lsrs r1, 6 + ldrb r2, [r4, 0x3] + lsrs r2, 6 + adds r0, r4, 0 + movs r3, 0 + bl CalcVecFromObjectCenterToObjectUpperLeft + ldrb r1, [r4, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0xD + negs r1, r1 + ands r0, r1 + strb r0, [r4, 0x1] + ldr r0, =DummyObjectCallback + str r0, [r4, 0x1C] + b _081CA578 + .pool +_081CA574: + subs r0, r1, 0x1 + strh r0, [r4, 0x2E] +_081CA578: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81CA4AC + + thumb_func_start sub_81CA580 +sub_81CA580: @ 81CA580 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + ldrh r0, [r4] + movs r1, 0 + ldrsh r2, [r4, r1] + cmp r2, 0 + bne _081CA634 + movs r0, 0x2 + ldrsh r1, [r4, r0] + cmp r1, 0 + beq _081CA5AC + cmp r1, 0x1 + beq _081CA5CC + b _081CA638 + .pool +_081CA5AC: + movs r0, 0x10 + strh r0, [r4, 0x4] + strh r2, [r4, 0x6] + movs r1, 0xFC + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0x10 + bl SetGpuReg + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + b _081CA638 +_081CA5CC: + ldrh r0, [r4, 0x8] + ands r1, r0 + cmp r1, 0 + beq _081CA5E4 + ldrh r0, [r4, 0x4] + subs r0, 0x3 + strh r0, [r4, 0x4] + lsls r0, 16 + cmp r0, 0 + bge _081CA5F6 + strh r2, [r4, 0x4] + b _081CA5F6 +_081CA5E4: + ldrh r0, [r4, 0x6] + adds r0, 0x3 + strh r0, [r4, 0x6] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + ble _081CA5F6 + movs r0, 0x10 + strh r0, [r4, 0x6] +_081CA5F6: + ldrh r1, [r4, 0x6] + lsls r1, 8 + ldrh r0, [r4, 0x4] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xC + bne _081CA638 + movs r0, 0x2 + bl sub_81C763C + ldrb r1, [r0, 0xC] + subs r1, 0x1 + strb r1, [r0, 0xC] + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl SetGpuReg + adds r0, r5, 0 + bl remove_task + b _081CA638 +_081CA634: + subs r0, 0x1 + strh r0, [r4] +_081CA638: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81CA580 + + thumb_func_start sub_81CA640 +sub_81CA640: @ 81CA640 + push {r4,lr} + movs r0, 0x2 + bl sub_81C763C + adds r4, r0, 0 + ldr r0, =gUnknown_0862036C + movs r1, 0x10 + movs r2, 0x60 + movs r3, 0x4 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + str r1, [r4, 0x28] + bl sub_81C98D4 + cmp r0, 0 + beq _081CA684 + ldr r1, [r4, 0x28] + ldr r0, =sub_81CA6AC + str r0, [r1, 0x1C] + b _081CA690 + .pool +_081CA684: + ldr r0, [r4, 0x28] + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_081CA690: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81CA640 + + thumb_func_start sub_81CA698 +sub_81CA698: @ 81CA698 + push {lr} + movs r0, 0x2 + bl sub_81C763C + ldr r0, [r0, 0x28] + bl RemoveObjectAndFreeTiles + pop {r0} + bx r0 + thumb_func_end sub_81CA698 + + thumb_func_start sub_81CA6AC +sub_81CA6AC: @ 81CA6AC + push {lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _081CA6DA + movs r0, 0 + strh r0, [r3, 0x2E] + adds r3, 0x3E + ldrb r2, [r3] + lsls r0, r2, 29 + lsrs r0, 31 + movs r1, 0x1 + eors r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] +_081CA6DA: + pop {r0} + bx r0 + thumb_func_end sub_81CA6AC + + thumb_func_start sub_81CA6E0 +sub_81CA6E0: @ 81CA6E0 + push {r4,lr} + movs r0, 0x2 + bl sub_81C763C + adds r4, r0, 0 + ldr r0, =gUnknown_086202CC + bl AddWindow + strh r0, [r4, 0x8] + lsls r0, 24 + lsrs r0, 24 + bl PutWindowTilemap + ldrb r0, [r4, 0x8] + movs r1, 0x66 + bl FillWindowPixelBuffer + ldrb r0, [r4, 0x8] + movs r1, 0x3 + bl CopyWindowToVram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CA6E0 + + thumb_func_start sub_81CA714 +sub_81CA714: @ 81CA714 + push {r4-r6,lr} + sub sp, 0xC + movs r0, 0x2 + bl sub_81C763C + adds r5, r0, 0 + bl sub_81C98B4 + ldr r1, =gUnknown_086202D4 + lsls r0, 2 + adds r0, r1 + ldr r6, [r0] + movs r2, 0x1 + negs r2, r2 + movs r0, 0x1 + adds r1, r6, 0 + bl GetStringWidth + adds r4, r0, 0 + ldrb r0, [r5, 0x8] + movs r1, 0x66 + bl FillWindowPixelBuffer + ldrb r0, [r5, 0x8] + movs r2, 0xC0 + subs r2, r4 + lsrs r2, 1 + lsls r2, 24 + lsrs r2, 24 + ldr r1, =gUnknown_0862030C + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r6, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x1 + bl box_print + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CA714 + + thumb_func_start sub_81CA770 +sub_81CA770: @ 81CA770 + push {r4-r6,lr} + sub sp, 0xC + movs r0, 0x2 + bl sub_81C763C + adds r5, r0, 0 + ldr r6, =gUnknown_085EBD4A + movs r2, 0x1 + negs r2, r2 + movs r0, 0x1 + adds r1, r6, 0 + bl GetStringWidth + adds r4, r0, 0 + ldrb r0, [r5, 0x8] + movs r1, 0x66 + bl FillWindowPixelBuffer + ldrb r0, [r5, 0x8] + movs r2, 0xC0 + subs r2, r4 + lsrs r2, 1 + lsls r2, 24 + lsrs r2, 24 + ldr r1, =gUnknown_0862030F + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r6, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x1 + bl box_print + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CA770 + + thumb_func_start sub_81CA7C4 +sub_81CA7C4: @ 81CA7C4 + push {lr} + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_81CA7C4 + + thumb_func_start sub_81CA7D4 +sub_81CA7D4: @ 81CA7D4 + push {r4,lr} + movs r0, 0x2 + bl sub_81C763C + adds r4, r0, 0 + ldr r0, =sub_81CA808 + movs r1, 0x2 + bl AddTask + strb r0, [r4, 0xA] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CA7D4 + + thumb_func_start sub_81CA7F4 +sub_81CA7F4: @ 81CA7F4 + push {lr} + movs r0, 0x2 + bl sub_81C763C + ldrb r0, [r0, 0xA] + bl remove_task + pop {r0} + bx r0 + thumb_func_end sub_81CA7F4 + + thumb_func_start sub_81CA808 +sub_81CA808: @ 81CA808 + push {lr} + movs r0, 0x3 + movs r1, 0x80 + movs r2, 0x1 + bl ChangeBgX + pop {r0} + bx r0 + thumb_func_end sub_81CA808 + + thumb_func_start sub_81CA818 +sub_81CA818: @ 81CA818 + push {r4,r5,lr} + ldr r0, =sub_81CA8B0 + movs r1, 0x3 + bl AddTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =gUnknown_0861FC7A + adds r0, r4, 0 + movs r1, 0x1 + adds r2, r5, 0 + bl set_word_task_arg + adds r5, 0xC + adds r0, r4, 0 + movs r1, 0x3 + adds r2, r5, 0 + bl set_word_task_arg + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CA818 + + thumb_func_start sub_81CA850 +sub_81CA850: @ 81CA850 + push {lr} + ldr r0, =gUnknown_0861FC86 + movs r1, 0x31 + movs r2, 0x4 + bl sub_81C7944 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CA850 + + thumb_func_start sub_81CA864 +sub_81CA864: @ 81CA864 + push {r4,r5,lr} + ldr r0, =sub_81CA8B0 + movs r1, 0x3 + bl AddTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =gUnknown_0861FC86 + adds r0, r4, 0 + movs r1, 0x1 + adds r2, r5, 0 + bl set_word_task_arg + subs r5, 0xC + adds r0, r4, 0 + movs r1, 0x3 + adds r2, r5, 0 + bl set_word_task_arg + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CA864 + + thumb_func_start sub_81CA89C +sub_81CA89C: @ 81CA89C + push {lr} + ldr r0, =sub_81CA8B0 + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CA89C + + thumb_func_start sub_81CA8B0 +sub_81CA8B0: @ 81CA8B0 + push {r4-r6,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r6, r0, 24 + lsls r4, r6, 2 + adds r4, r6 + lsls r4, 3 + ldr r0, =0x03005e08 + adds r4, r0 + adds r0, r6, 0 + movs r1, 0x1 + bl get_word_task_arg + adds r5, r0, 0 + adds r0, r6, 0 + movs r1, 0x3 + bl get_word_task_arg + adds r1, r0, 0 + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + lsls r0, 16 + asrs r0, 16 + str r0, [sp] + add r0, sp, 0x8 + str r0, [sp, 0x4] + adds r0, r5, 0 + movs r2, 0x2 + movs r3, 0xC + bl sub_81C79BC + add r0, sp, 0x8 + movs r1, 0x31 + movs r2, 0x4 + bl gpu_pal_apply + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0xC + bne _081CA908 + adds r0, r6, 0 + bl remove_task +_081CA908: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CA8B0 + + thumb_func_start sub_81CA914 +sub_81CA914: @ 81CA914 + push {lr} + bl copy_pal_bg_faded_to_pal_ram + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl sub_80BA0A8 + pop {r0} + bx r0 + thumb_func_end sub_81CA914 + + thumb_func_start titlescreen_0 +titlescreen_0: @ 81CA92C + push {lr} + movs r0, 0x50 + movs r1, 0x90 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl SetGpuRegBits + movs r0, 0x48 + movs r1, 0x3F + bl SetGpuRegBits + movs r0, 0x4A + movs r1, 0x1F + bl SetGpuRegBits + movs r0, 0x44 + movs r1, 0xA0 + bl SetGpuRegBits + bl remove_some_task + bl sub_81CAA3C + ldr r2, =gUnknown_08620384 + ldr r0, [r2] + ldr r1, [r2, 0x4] + ldr r2, [r2, 0x8] + bl sub_80BA038 + ldr r0, =sub_81CA914 + bl c3args_set_0toR1_1to0 + ldr r0, =sub_81CA9EC + movs r1, 0x3 + bl AddTask + pop {r0} + bx r0 + .pool + thumb_func_end titlescreen_0 + + thumb_func_start sub_81CA994 +sub_81CA994: @ 81CA994 + push {lr} + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl ClearGpuRegBits + bl remove_some_task + ldr r0, =sub_81CA9EC + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task + bl sub_81C760C + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CA994 + + thumb_func_start sub_81CA9C8 +sub_81CA9C8: @ 81CA9C8 + push {lr} + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + pop {r0} + bx r0 + thumb_func_end sub_81CA9C8 + + thumb_func_start sub_81CA9D8 +sub_81CA9D8: @ 81CA9D8 + push {lr} + bl sub_81CAA3C + movs r0, 0x50 + movs r1, 0x90 + bl SetGpuReg + pop {r0} + bx r0 + thumb_func_end sub_81CA9D8 + + thumb_func_start sub_81CA9EC +sub_81CA9EC: @ 81CA9EC + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r2, r1, r0 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + lsls r0, 16 + cmp r0, 0 + ble _081CAA30 + movs r0, 0 + strh r0, [r2] + ldrh r0, [r2, 0x2] + adds r0, 0x3 + movs r1, 0x7F + ands r0, r1 + strh r0, [r2, 0x2] + ldr r1, =gUnknown_08329F40 + movs r3, 0x2 + ldrsh r0, [r2, r3] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r1, 16 + asrs r1, 21 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x54 + bl SetGpuReg +_081CAA30: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CA9EC + + thumb_func_start sub_81CAA3C +sub_81CAA3C: @ 81CAA3C + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x8 + bl sub_81C9894 + adds r4, r0, 0 + bl sub_81C98A4 + ldr r2, =gUnknown_08620240 + lsls r1, r4, 3 + subs r1, r4 + lsls r1, 2 + adds r1, r2 + ldrh r2, [r1, 0x2] + adds r4, r2, 0 + muls r4, r0 + ldrh r1, [r1] + adds r4, r1 + subs r4, 0x8 + mov r0, sp + movs r6, 0 + strh r6, [r0] + ldr r5, =0x02038c28 + ldr r0, =0x010000a0 + mov r8, r0 + mov r0, sp + adds r1, r5, 0 + mov r2, r8 + bl CpuSet + mov r0, sp + adds r0, 0x2 + strh r6, [r0] + movs r1, 0xF0 + lsls r1, 3 + adds r1, r5 + mov r9, r1 + mov r2, r8 + bl CpuSet + add r0, sp, 0x4 + ldr r1, =0x000072f0 + adds r6, r1, 0 + strh r6, [r0] + lsls r4, 1 + adds r5, r4, r5 + ldr r1, =0x01000010 + mov r8, r1 + adds r1, r5, 0 + mov r2, r8 + bl CpuSet + mov r0, sp + adds r0, 0x6 + strh r6, [r0] + add r4, r9 + adds r1, r4, 0 + mov r2, r8 + bl CpuSet + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CAA3C + + thumb_func_start sub_81CAADC +sub_81CAADC: @ 81CAADC + push {lr} + bl sub_81CA9C8 + pop {r0} + bx r0 + thumb_func_end sub_81CAADC + + thumb_func_start sub_81CAAE8 +sub_81CAAE8: @ 81CAAE8 + push {r4,lr} + movs r1, 0xD4 + lsls r1, 1 + movs r0, 0x5 + bl sub_81C761C + adds r4, r0, 0 + cmp r4, 0 + beq _081CAB1C + ldr r0, =sub_81CAB44 + str r0, [r4, 0x18] + movs r0, 0 + strh r0, [r4, 0x8] + str r0, [r4, 0x10] + ldr r0, =sub_81CAD20 + movs r1, 0x1 + bl sub_81C7078 + str r0, [r4, 0x14] + movs r0, 0x1 + b _081CAB1E + .pool +_081CAB1C: + movs r0, 0 +_081CAB1E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81CAAE8 + + thumb_func_start sub_81CAB24 +sub_81CAB24: @ 81CAB24 + push {lr} + movs r0, 0x5 + bl sub_81C763C + ldr r1, [r0, 0x18] + bl _call_via_r1 + pop {r1} + bx r1 + thumb_func_end sub_81CAB24 + + thumb_func_start sub_81CAB38 +sub_81CAB38: @ 81CAB38 + push {lr} + movs r0, 0x5 + bl sub_81C7650 + pop {r0} + bx r0 + thumb_func_end sub_81CAB38 + + thumb_func_start sub_81CAB44 +sub_81CAB44: @ 81CAB44 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r3, =0x030022c0 + ldrh r1, [r3, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081CAB5C + movs r0, 0x2 + b _081CABF4 + .pool +_081CAB5C: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081CAB68 + movs r0, 0x1 + b _081CABF4 +_081CAB68: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _081CAB74 + movs r0, 0x4 + b _081CABF4 +_081CAB74: + movs r0, 0x10 + ands r0, r1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0 + beq _081CAB84 + movs r0, 0x3 + b _081CABF4 +_081CAB84: + ldrh r1, [r3, 0x2E] + movs r5, 0x1 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _081CABD0 + ldr r0, =sub_81CAC04 + str r0, [r4, 0x18] + strh r2, [r4] + bl sub_81C875C + lsls r0, 2 + adds r1, r4, r0 + ldrb r0, [r1, 0x1C] + cmp r0, 0 + beq _081CABAE + ldrh r0, [r1, 0x1E] + bl sub_81D17E8 + cmp r0, 0 + beq _081CABC0 +_081CABAE: + ldr r0, =gUnknown_0862250A + str r0, [r4, 0x4] + movs r0, 0x2 + strh r0, [r4, 0x2] + b _081CABC6 + .pool +_081CABC0: + ldr r0, =gUnknown_08622508 + str r0, [r4, 0x4] + strh r5, [r4, 0x2] +_081CABC6: + movs r0, 0x5 + b _081CABF4 + .pool +_081CABD0: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081CABF2 + bl sub_81C767C + cmp r0, 0x1 + beq _081CABEC + ldr r0, =sub_81CABFC + str r0, [r4, 0x18] + movs r0, 0xF + b _081CABF4 + .pool +_081CABEC: + movs r0, 0x20 + bl audio_play +_081CABF2: + movs r0, 0 +_081CABF4: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81CAB44 + + thumb_func_start sub_81CABFC +sub_81CABFC: @ 81CABFC + ldr r0, =0x000186a4 + bx lr + .pool + thumb_func_end sub_81CABFC + + thumb_func_start sub_81CAC04 +sub_81CAC04: @ 81CAC04 + push {r4,lr} + adds r4, r0, 0 + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081CAC24 + ldrh r0, [r4] + cmp r0, 0 + beq _081CAC24 + subs r0, 0x1 + b _081CAC38 + .pool +_081CAC24: + ldrh r1, [r2, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081CAC3E + ldrh r0, [r4] + ldrh r1, [r4, 0x2] + cmp r0, r1 + bcs _081CAC3E + adds r0, 0x1 +_081CAC38: + strh r0, [r4] + movs r0, 0x6 + b _081CACAC +_081CAC3E: + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081CAC98 + ldrh r1, [r4] + ldr r0, [r4, 0x4] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _081CAC8C + cmp r0, 0x1 + bgt _081CAC5E + cmp r0, 0 + beq _081CAC64 + b _081CAC98 +_081CAC5E: + cmp r0, 0x2 + bne _081CAC98 + b _081CACA6 +_081CAC64: + bl sub_81C767C + cmp r0, 0x1 + bne _081CAC72 + movs r0, 0x2 + bl sub_81C7688 +_081CAC72: + ldr r0, =sub_81CACF8 + str r0, [r4, 0x18] + bl sub_81CB1D0 + cmp r0, 0 + beq _081CAC88 + movs r0, 0x9 + b _081CACAC + .pool +_081CAC88: + movs r0, 0x8 + b _081CACAC +_081CAC8C: + ldr r0, =sub_81CACB8 + str r0, [r4, 0x18] + movs r0, 0xB + b _081CACAC + .pool +_081CAC98: + ldrh r1, [r2, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _081CACA6 + movs r0, 0 + b _081CACAC +_081CACA6: + ldr r0, =sub_81CAB44 + str r0, [r4, 0x18] + movs r0, 0x7 +_081CACAC: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CAC04 + + thumb_func_start sub_81CACB8 +sub_81CACB8: @ 81CACB8 + push {lr} + adds r3, r0, 0 + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081CACD0 + movs r0, 0xC + b _081CACF0 + .pool +_081CACD0: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081CACDC + movs r0, 0xD + b _081CACF0 +_081CACDC: + ldrh r1, [r2, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _081CACEA + movs r0, 0 + b _081CACF0 +_081CACEA: + ldr r0, =sub_81CAB44 + str r0, [r3, 0x18] + movs r0, 0xE +_081CACF0: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CACB8 + + thumb_func_start sub_81CACF8 +sub_81CACF8: @ 81CACF8 + push {lr} + adds r2, r0, 0 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _081CAD10 + movs r0, 0 + b _081CAD16 + .pool +_081CAD10: + ldr r0, =sub_81CAB44 + str r0, [r2, 0x18] + movs r0, 0xA +_081CAD16: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CACF8 + + thumb_func_start sub_81CAD20 +sub_81CAD20: @ 81CAD20 + push {r4-r7,lr} + adds r5, r0, 0 + movs r0, 0x5 + bl sub_81C763C + adds r4, r0, 0 + cmp r5, 0x1 + beq _081CAD4C + cmp r5, 0x1 + bgt _081CAD3A + cmp r5, 0 + beq _081CAD44 + b _081CAE00 +_081CAD3A: + cmp r5, 0x2 + beq _081CAD9C + cmp r5, 0x3 + beq _081CADFC + b _081CAE00 +_081CAD44: + strh r5, [r4, 0x8] + strh r5, [r4, 0xA] +_081CAD48: + movs r0, 0x1 + b _081CAE02 +_081CAD4C: + movs r6, 0 + ldrh r5, [r4, 0x8] +_081CAD50: + adds r0, r5, 0 + bl sub_81D15F4 + cmp r0, 0 + beq _081CAD80 + ldrh r0, [r4, 0xA] + lsls r0, 2 + adds r0, r4, r0 + strh r5, [r0, 0x1E] + ldrh r0, [r4, 0xA] + lsls r0, 2 + adds r0, r4, r0 + movs r1, 0x1 + strb r1, [r0, 0x1C] + adds r0, r5, 0 + bl sub_81D16DC + ldrh r1, [r4, 0xA] + lsls r1, 2 + adds r1, r4, r1 + strb r0, [r1, 0x1D] + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] +_081CAD80: + ldrh r0, [r4, 0x8] + adds r1, r0, 0x1 + movs r2, 0 + strh r1, [r4, 0x8] + lsls r0, r1, 16 + lsrs r0, 16 + cmp r0, 0x14 + bhi _081CADF6 + adds r6, 0x1 + adds r5, 0x1 + cmp r6, 0x1D + ble _081CAD50 + movs r0, 0x3 + b _081CAE02 +_081CAD9C: + movs r6, 0 + ldrh r5, [r4, 0x8] + movs r7, 0 +_081CADA2: + ldrh r0, [r4, 0x8] + bl sub_81D1BF8 + cmp r0, 0 + bne _081CADDC + ldrh r0, [r4, 0x8] + bl sub_81CAE08 + cmp r0, 0 + beq _081CADDC + ldrh r0, [r4, 0xA] + lsls r0, 2 + adds r0, r4, r0 + ldrh r1, [r4, 0x8] + strh r1, [r0, 0x1E] + ldrh r0, [r4, 0xA] + lsls r0, 2 + adds r0, r4, r0 + strb r7, [r0, 0x1C] + adds r0, r5, 0 + bl sub_81CB0C8 + ldrh r1, [r4, 0xA] + lsls r1, 2 + adds r1, r4, r1 + strb r0, [r1, 0x1D] + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] +_081CADDC: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x4D + bhi _081CAD48 + adds r6, 0x1 + adds r5, 0x1 + cmp r6, 0x1D + ble _081CADA2 + movs r0, 0x3 + b _081CAE02 +_081CADF6: + strh r1, [r4, 0xC] + strh r2, [r4, 0x8] + b _081CAD48 +_081CADFC: + movs r0, 0x1 + str r0, [r4, 0x10] +_081CAE00: + movs r0, 0x4 +_081CAE02: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81CAD20 + + thumb_func_start sub_81CAE08 +sub_81CAE08: @ 81CAE08 + push {lr} + cmp r0, 0x4D + ble _081CAE12 + movs r0, 0 + b _081CAE24 +_081CAE12: + movs r1, 0xAE + lsls r1, 1 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 +_081CAE24: + pop {r1} + bx r1 + thumb_func_end sub_81CAE08 + + thumb_func_start sub_81CAE28 +sub_81CAE28: @ 81CAE28 + push {lr} + movs r0, 0x5 + bl sub_81C763C + ldr r0, [r0, 0x10] + pop {r1} + bx r1 + thumb_func_end sub_81CAE28 + + thumb_func_start sub_81CAE38 +sub_81CAE38: @ 81CAE38 + push {lr} + movs r0, 0x5 + bl sub_81C763C + ldrh r0, [r0, 0xA] + pop {r1} + bx r1 + thumb_func_end sub_81CAE38 + + thumb_func_start sub_81CAE48 +sub_81CAE48: @ 81CAE48 + push {lr} + movs r0, 0x5 + bl sub_81C763C + ldrh r0, [r0, 0xC] + pop {r1} + bx r1 + thumb_func_end sub_81CAE48 + + thumb_func_start sub_81CAE58 +sub_81CAE58: @ 81CAE58 + push {lr} + movs r0, 0x5 + bl sub_81C763C + adds r1, r0, 0 + ldrh r0, [r1, 0xA] + ldrh r1, [r1, 0xC] + subs r0, r1 + pop {r1} + bx r1 + thumb_func_end sub_81CAE58 + + thumb_func_start sub_81CAE6C +sub_81CAE6C: @ 81CAE6C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x5 + bl sub_81C763C + adds r1, r0, 0 + ldrh r0, [r1, 0xC] + adds r4, r0 + ldrh r0, [r1, 0xA] + cmp r4, r0 + bge _081CAE8A + lsls r0, r4, 2 + adds r0, r1, r0 + ldrh r0, [r0, 0x1E] + b _081CAE8C +_081CAE8A: + movs r0, 0x4E +_081CAE8C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81CAE6C + + thumb_func_start sub_81CAE94 +sub_81CAE94: @ 81CAE94 + push {lr} + movs r0, 0x5 + bl sub_81C763C + adds r0, 0x1C + pop {r1} + bx r1 + thumb_func_end sub_81CAE94 + + thumb_func_start sub_81CAEA4 +sub_81CAEA4: @ 81CAEA4 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x5 + bl sub_81C763C + lsls r4, 2 + adds r0, r4 + ldrb r0, [r0, 0x1D] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81CAEA4 + + thumb_func_start sub_81CAEBC +sub_81CAEBC: @ 81CAEBC + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x5 + bl sub_81C763C + lsls r1, r4, 2 + adds r1, r0, r1 + ldrb r0, [r1, 0x1C] + cmp r0, 0 + bne _081CAED4 + ldrh r4, [r1, 0x1E] + b _081CAEDC +_081CAED4: + ldrh r0, [r1, 0x1E] + bl sub_81D1854 + adds r4, r0, 0 +_081CAEDC: + cmp r4, 0x4E + beq _081CAEFC + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x000009ca + adds r0, r1 + adds r0, r4 + ldrb r1, [r0] + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + b _081CAEFE + .pool +_081CAEFC: + movs r0, 0 +_081CAEFE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81CAEBC + + thumb_func_start sub_81CAF04 +sub_81CAF04: @ 81CAF04 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x5 + bl sub_81C763C + lsls r1, r4, 2 + adds r1, r0, r1 + ldrb r0, [r1, 0x1C] + cmp r0, 0 + bne _081CAF34 + ldrh r0, [r1, 0x1E] + bl sub_81D15BC + adds r4, r0, 0 + ldr r1, =gTrainers + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0, 0x3] + b _081CAF6C + .pool +_081CAF34: + ldrh r5, [r1, 0x1E] + adds r0, r5, 0 + bl sub_81D1854 + adds r4, r0, 0 + cmp r4, 0x4E + bne _081CAF58 + adds r0, r5, 0 + bl sub_81D1BD0 + adds r4, r0, 0 + ldr r0, =gTrainerPicIndices + adds r0, r4, r0 + ldrb r0, [r0] + b _081CAF6C + .pool +_081CAF58: + adds r0, r4, 0 + bl sub_81D15BC + adds r4, r0, 0 + ldr r0, =gTrainers + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrb r0, [r1, 0x3] +_081CAF6C: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CAF04 + + thumb_func_start sub_81CAF78 +sub_81CAF78: @ 81CAF78 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + movs r0, 0x5 + bl sub_81C763C + adds r4, r0, 0 + movs r0, 0 + strb r0, [r6] + ldr r0, =0x02037318 + ldrb r0, [r0, 0x17] + bl is_light_level_1_2_3_or_6 + lsls r0, 24 + cmp r0, 0 + bne _081CAFA4 + ldr r0, =gUnknown_085EEB0B + b _081CAFCE + .pool +_081CAFA4: + lsls r0, r5, 2 + adds r1, r4, r0 + ldrb r0, [r1, 0x1C] + cmp r0, 0 + bne _081CAFC4 + ldrh r0, [r1, 0x1E] + bl sub_81D15BC + ldr r1, =0x02021fc4 + bl sub_81967AC + strb r0, [r6] + b _081CAFCC + .pool +_081CAFC4: + ldrh r0, [r1, 0x1E] + ldr r1, =0x02021fc4 + bl sub_81D189C +_081CAFCC: + ldr r0, =0x02021fc4 +_081CAFCE: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CAF78 + + thumb_func_start sub_81CAFD8 +sub_81CAFD8: @ 81CAFD8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x5 + bl sub_81C763C + lsls r4, 2 + adds r4, r0, r4 + ldrb r0, [r4, 0x1C] + cmp r0, 0 + beq _081CB004 + ldrh r0, [r4, 0x1E] + bl sub_81D1854 + adds r1, r0, 0 + cmp r1, 0x4E + bne _081CB006 + ldrh r0, [r4, 0x1E] + adds r1, r5, 0 + bl sub_81D1B40 + b _081CB012 +_081CB004: + ldrh r1, [r4, 0x1E] +_081CB006: + ldr r2, =gUnknown_08622028 + lsls r0, r5, 2 + lsls r1, 4 + adds r0, r1 + adds r0, r2 + ldr r0, [r0] +_081CB012: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CAFD8 + + thumb_func_start sub_81CB01C +sub_81CB01C: @ 81CB01C + push {lr} + movs r0, 0x5 + bl sub_81C763C + ldrh r0, [r0] + pop {r1} + bx r1 + thumb_func_end sub_81CB01C + + thumb_func_start sub_81CB02C +sub_81CB02C: @ 81CB02C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x5 + bl sub_81C763C + adds r1, r0, 0 + ldrh r0, [r1, 0x2] + cmp r0, r4 + blt _081CB046 + ldr r0, [r1, 0x4] + adds r0, r4 + ldrb r0, [r0] + b _081CB048 +_081CB046: + movs r0, 0x3 +_081CB048: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81CB02C + + thumb_func_start sub_81CB050 +sub_81CB050: @ 81CB050 + push {r4,lr} + sub sp, 0x8 + adds r2, r0, 0 + adds r4, r1, 0 + ldrb r0, [r2] + cmp r0, 0 + bne _081CB088 + ldrh r0, [r2, 0x2] + bl sub_81D15BC + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTrainers + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r0, 0xD + muls r0, r2 + ldr r2, =gTrainerClassNames + adds r0, r2 + str r0, [sp] + adds r1, 0x4 + str r1, [sp, 0x4] + b _081CB092 + .pool +_081CB088: + ldrh r0, [r2, 0x2] + add r2, sp, 0x4 + mov r1, sp + bl sub_81D1A78 +_081CB092: + ldr r2, [sp] + cmp r2, 0 + beq _081CB0B4 + ldr r0, [sp, 0x4] + cmp r0, 0 + beq _081CB0B4 + adds r0, r4, 0 + movs r1, 0x7 + movs r3, 0x45 + bl sub_81DB494 + ldr r2, [sp, 0x4] + movs r1, 0x7 + movs r3, 0x33 + bl sub_81DB494 + b _081CB0C0 +_081CB0B4: + adds r0, r4, 0 + movs r1, 0x7 + movs r2, 0 + movs r3, 0x78 + bl sub_81DB494 +_081CB0C0: + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81CB050 + + thumb_func_start sub_81CB0C8 +sub_81CB0C8: @ 81CB0C8 + push {lr} + ldr r1, =gUnknown_085500A4 + lsls r0, 4 + adds r0, r1 + ldrh r2, [r0, 0xA] + ldrh r1, [r0, 0xC] + adds r0, r2, 0 + bl get_mapheader_by_bank_and_number + ldrb r0, [r0, 0x14] + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CB0C8 + + thumb_func_start sub_81CB0E4 +sub_81CB0E4: @ 81CB0E4 + push {r4-r7,lr} + adds r5, r0, 0 + movs r0, 0x5 + bl sub_81C763C + adds r7, r0, 0 + movs r6, 0x1 + adds r5, 0x1 + ldrh r0, [r7, 0xA] + cmp r5, r0 + bge _081CB120 + lsls r0, r5, 2 + adds r0, 0x1C + adds r4, r0, r7 +_081CB100: + ldrb r0, [r4] + cmp r0, 0 + beq _081CB110 + ldrh r0, [r4, 0x2] + bl sub_81D17E8 + cmp r0, 0 + beq _081CB114 +_081CB110: + adds r0, r6, 0 + b _081CB122 +_081CB114: + adds r6, 0x1 + adds r4, 0x4 + adds r5, 0x1 + ldrh r0, [r7, 0xA] + cmp r5, r0 + blt _081CB100 +_081CB120: + movs r0, 0 +_081CB122: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81CB0E4 + + thumb_func_start sub_81CB128 +sub_81CB128: @ 81CB128 + push {r4-r6,lr} + adds r5, r0, 0 + movs r0, 0x5 + bl sub_81C763C + adds r1, r0, 0 + movs r6, 0x1 + negs r6, r6 + subs r5, 0x1 + cmp r5, 0 + blt _081CB162 + lsls r0, r5, 2 + adds r0, 0x1C + adds r4, r0, r1 +_081CB144: + ldrb r0, [r4] + cmp r0, 0 + beq _081CB154 + ldrh r0, [r4, 0x2] + bl sub_81D17E8 + cmp r0, 0 + beq _081CB158 +_081CB154: + adds r0, r6, 0 + b _081CB164 +_081CB158: + subs r6, 0x1 + subs r4, 0x4 + subs r5, 0x1 + cmp r5, 0 + bge _081CB144 +_081CB162: + movs r0, 0 +_081CB164: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81CB128 + + thumb_func_start sub_81CB16C +sub_81CB16C: @ 81CB16C + push {r4,lr} + movs r4, 0 +_081CB170: + adds r0, r4, 0 + bl sub_81CAE08 + cmp r0, 0 + beq _081CB18A + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x000009ca + adds r0, r1 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _081CB1B2 +_081CB18A: + adds r4, 0x1 + cmp r4, 0x4D + ble _081CB170 + movs r4, 0 +_081CB192: + adds r0, r4, 0 + bl sub_81D15F4 + cmp r0, 0 + beq _081CB1C0 + adds r0, r4, 0 + bl sub_81D1854 + ldr r1, =0x03005d8c + ldr r1, [r1] + ldr r2, =0x000009ca + adds r1, r2 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _081CB1C0 +_081CB1B2: + movs r0, 0x1 + b _081CB1C8 + .pool +_081CB1C0: + adds r4, 0x1 + cmp r4, 0x14 + ble _081CB192 + movs r0, 0 +_081CB1C8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81CB16C + + thumb_func_start sub_81CB1D0 +sub_81CB1D0: @ 81CB1D0 + push {r4,lr} + movs r0, 0x5 + bl sub_81C763C + adds r4, r0, 0 + bl sub_81C875C + adds r1, r0, 0 + lsls r0, r1, 2 + adds r4, r0 + ldrb r0, [r4, 0x1C] + cmp r0, 0 + bne _081CB218 + adds r0, r1, 0 + bl sub_81CAEA4 + ldr r1, =0x02037318 + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1, 0x14] + cmp r0, r1 + bne _081CB258 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x000009ca + adds r0, r1 + ldrh r4, [r4, 0x1E] + adds r0, r4 + ldrb r0, [r0] + b _081CB246 + .pool +_081CB218: + ldrh r0, [r4, 0x1E] + cmp r0, 0xB + bne _081CB258 + adds r0, r1, 0 + bl sub_81CAEA4 + ldr r1, =0x02037318 + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1, 0x14] + cmp r0, r1 + bne _081CB258 + ldr r0, =0x0000086b + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081CB258 + movs r0, 0x5B + bl FlagGet + lsls r0, 24 +_081CB246: + cmp r0, 0 + bne _081CB258 + movs r0, 0x1 + b _081CB25A + .pool +_081CB258: + movs r0, 0 +_081CB25A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81CB1D0 + + thumb_func_start sub_81CB260 +sub_81CB260: @ 81CB260 + push {r4,lr} + ldr r1, =0x00002048 + movs r0, 0x6 + bl sub_81C761C + adds r4, r0, 0 + cmp r4, 0 + beq _081CB294 + movs r0, 0 + strb r0, [r4, 0x19] + ldr r0, =sub_81CB324 + movs r1, 0x1 + bl sub_81C7078 + str r0, [r4, 0x4] + ldr r0, =sub_81CB310 + str r0, [r4] + movs r0, 0x1 + b _081CB296 + .pool +_081CB294: + movs r0, 0 +_081CB296: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81CB260 + + thumb_func_start sub_81CB29C +sub_81CB29C: @ 81CB29C + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x6 + bl sub_81C763C + adds r5, r0, 0 + ldr r0, =gUnknown_08622798 + lsls r4, 2 + adds r4, r0 + ldr r0, [r4] + movs r1, 0x1 + bl sub_81C7078 + str r0, [r5, 0x4] + ldr r0, =sub_81CB310 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CB29C + + thumb_func_start sub_81CB2CC +sub_81CB2CC: @ 81CB2CC + push {lr} + movs r0, 0x6 + bl sub_81C763C + ldr r0, [r0] + bl _call_via_r0 + pop {r1} + bx r1 + thumb_func_end sub_81CB2CC + + thumb_func_start sub_81CB2E0 +sub_81CB2E0: @ 81CB2E0 + push {r4,lr} + movs r0, 0x6 + bl sub_81C763C + adds r4, r0, 0 + bl sub_81CC2B4 + bl sub_81CBC1C + ldrb r0, [r4, 0x12] + bl RemoveWindow + ldrb r0, [r4, 0x10] + bl RemoveWindow + ldrb r0, [r4, 0x14] + bl RemoveWindow + movs r0, 0x6 + bl sub_81C7650 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81CB2E0 + + thumb_func_start sub_81CB310 +sub_81CB310: @ 81CB310 + push {lr} + movs r0, 0x6 + bl sub_81C763C + ldr r0, [r0, 0x4] + bl sub_81C70D8 + pop {r1} + bx r1 + thumb_func_end sub_81CB310 + + thumb_func_start sub_81CB324 +sub_81CB324: @ 81CB324 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + movs r0, 0x6 + bl sub_81C763C + adds r5, r0, 0 + cmp r4, 0x7 + bls _081CB338 + b _081CB504 +_081CB338: + lsls r0, r4, 2 + ldr r1, =_081CB348 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081CB348: + .4byte _081CB368 + .4byte _081CB3D4 + .4byte _081CB424 + .4byte _081CB468 + .4byte _081CB482 + .4byte _081CB494 + .4byte _081CB4A6 + .4byte _081CB4EA +_081CB368: + ldr r0, =gUnknown_0862278C + movs r1, 0x3 + bl sub_81C7B54 + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + ldr r1, =gUnknown_08622530 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r0, =0x00001024 + adds r1, r5, r0 + movs r0, 0x2 + bl SetBgTilemapBuffer + ldr r1, =gUnknown_086225D4 + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + ldr r0, =gUnknown_08622510 + movs r1, 0x20 + movs r2, 0x20 + bl sub_81C7944 + movs r0, 0x2 + b _081CB418 + .pool +_081CB3D4: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + beq _081CB3E0 + b _081CB4FA +_081CB3E0: + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8199DF0 + adds r1, r5, 0 + adds r1, 0x24 + movs r0, 0x1 + bl SetBgTilemapBuffer + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x20 + str r0, [sp] + movs r0, 0x14 + str r0, [sp, 0x4] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + ldr r0, =gUnknown_086226E0 + movs r1, 0x10 + movs r2, 0x20 + bl sub_81C7944 + movs r0, 0x1 +_081CB418: + bl CopyBgTilemapBufferToVram + movs r0, 0 + b _081CB506 + .pool +_081CB424: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _081CB4FA + adds r0, r5, 0 + bl sub_81CC034 + ldr r1, =gUnknown_08622760 + str r4, [sp] + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r0, =gUnknown_08622700 + movs r1, 0x30 + movs r2, 0x20 + bl sub_81C7944 + ldr r0, =gUnknown_08622720 + movs r1, 0x50 + movs r2, 0x20 + bl sub_81C7944 + movs r0, 0 + b _081CB506 + .pool +_081CB468: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _081CB4FA + bl sub_81CAE28 + cmp r0, 0 + beq _081CB4FA + bl sub_81CBBB8 + movs r0, 0 + b _081CB506 +_081CB482: + bl sub_81C8224 + cmp r0, 0 + bne _081CB4FA + adds r0, r5, 0 + bl sub_81CBD78 + movs r0, 0 + b _081CB506 +_081CB494: + adds r0, r5, 0 + bl sub_81CBDC0 + adds r0, r5, 0 + movs r1, 0 + bl sub_81CBEF8 + movs r0, 0 + b _081CB506 +_081CB4A6: + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + movs r0, 0x1 + bl ShowBg + bl sub_81CC214 + movs r0, 0x3 + bl sub_81C7DFC + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0 + bl sub_81C7FA0 + movs r0, 0x1 + bl sub_81C7AC0 + movs r0, 0 + b _081CB506 +_081CB4EA: + bl sub_81C7B34 + cmp r0, 0 + bne _081CB4FA + bl sub_81C8010 + cmp r0, 0 + beq _081CB4FE +_081CB4FA: + movs r0, 0x2 + b _081CB506 +_081CB4FE: + movs r0, 0x1 + bl sub_81CBC38 +_081CB504: + movs r0, 0x4 +_081CB506: + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81CB324 + + thumb_func_start sub_81CB510 +sub_81CB510: @ 81CB510 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x6 + bl sub_81C763C + adds r5, r0, 0 + cmp r4, 0x1 + beq _081CB55E + cmp r4, 0x1 + bgt _081CB52A + cmp r4, 0 + beq _081CB534 + b _081CB580 +_081CB52A: + cmp r4, 0x2 + beq _081CB566 + cmp r4, 0x3 + beq _081CB572 + b _081CB580 +_081CB534: + bl sub_81C868C + cmp r0, 0x1 + beq _081CB54C + cmp r0, 0x1 + bgt _081CB546 + cmp r0, 0 + beq _081CB580 + b _081CB56E +_081CB546: + cmp r0, 0x2 + beq _081CB556 + b _081CB56E +_081CB54C: + movs r0, 0x5 + bl audio_play + movs r0, 0x7 + b _081CB582 +_081CB556: + movs r0, 0x5 + bl audio_play + b _081CB56E +_081CB55E: + bl sub_81C8630 + cmp r0, 0 + bne _081CB57C +_081CB566: + adds r0, r5, 0 + movs r1, 0 + bl sub_81CBEF8 +_081CB56E: + movs r0, 0 + b _081CB582 +_081CB572: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _081CB580 +_081CB57C: + movs r0, 0x2 + b _081CB582 +_081CB580: + movs r0, 0x4 +_081CB582: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81CB510 + + thumb_func_start sub_81CB588 +sub_81CB588: @ 81CB588 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x6 + bl sub_81C763C + adds r5, r0, 0 + cmp r4, 0x1 + beq _081CB5D6 + cmp r4, 0x1 + bgt _081CB5A2 + cmp r4, 0 + beq _081CB5AC + b _081CB5F8 +_081CB5A2: + cmp r4, 0x2 + beq _081CB5DE + cmp r4, 0x3 + beq _081CB5EA + b _081CB5F8 +_081CB5AC: + bl sub_81C8658 + cmp r0, 0x1 + beq _081CB5C4 + cmp r0, 0x1 + bgt _081CB5BE + cmp r0, 0 + beq _081CB5F8 + b _081CB5E6 +_081CB5BE: + cmp r0, 0x2 + beq _081CB5CE + b _081CB5E6 +_081CB5C4: + movs r0, 0x5 + bl audio_play + movs r0, 0x7 + b _081CB5FA +_081CB5CE: + movs r0, 0x5 + bl audio_play + b _081CB5E6 +_081CB5D6: + bl sub_81C8630 + cmp r0, 0 + bne _081CB5F4 +_081CB5DE: + adds r0, r5, 0 + movs r1, 0 + bl sub_81CBEF8 +_081CB5E6: + movs r0, 0 + b _081CB5FA +_081CB5EA: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _081CB5F8 +_081CB5F4: + movs r0, 0x2 + b _081CB5FA +_081CB5F8: + movs r0, 0x4 +_081CB5FA: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81CB588 + + thumb_func_start sub_81CB600 +sub_81CB600: @ 81CB600 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x6 + bl sub_81C763C + adds r5, r0, 0 + cmp r4, 0x1 + beq _081CB64E + cmp r4, 0x1 + bgt _081CB61A + cmp r4, 0 + beq _081CB624 + b _081CB670 +_081CB61A: + cmp r4, 0x2 + beq _081CB656 + cmp r4, 0x3 + beq _081CB662 + b _081CB670 +_081CB624: + bl sub_81C870C + cmp r0, 0x1 + beq _081CB63C + cmp r0, 0x1 + bgt _081CB636 + cmp r0, 0 + beq _081CB670 + b _081CB65E +_081CB636: + cmp r0, 0x2 + beq _081CB646 + b _081CB65E +_081CB63C: + movs r0, 0x5 + bl audio_play + movs r0, 0x7 + b _081CB672 +_081CB646: + movs r0, 0x5 + bl audio_play + b _081CB65E +_081CB64E: + bl sub_81C8630 + cmp r0, 0 + bne _081CB66C +_081CB656: + adds r0, r5, 0 + movs r1, 0 + bl sub_81CBEF8 +_081CB65E: + movs r0, 0 + b _081CB672 +_081CB662: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _081CB670 +_081CB66C: + movs r0, 0x2 + b _081CB672 +_081CB670: + movs r0, 0x4 +_081CB672: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81CB600 + + thumb_func_start sub_81CB678 +sub_81CB678: @ 81CB678 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x6 + bl sub_81C763C + adds r5, r0, 0 + cmp r4, 0x1 + beq _081CB6C6 + cmp r4, 0x1 + bgt _081CB692 + cmp r4, 0 + beq _081CB69C + b _081CB6E8 +_081CB692: + cmp r4, 0x2 + beq _081CB6CE + cmp r4, 0x3 + beq _081CB6DA + b _081CB6E8 +_081CB69C: + bl sub_81C86CC + cmp r0, 0x1 + beq _081CB6B4 + cmp r0, 0x1 + bgt _081CB6AE + cmp r0, 0 + beq _081CB6E8 + b _081CB6D6 +_081CB6AE: + cmp r0, 0x2 + beq _081CB6BE + b _081CB6D6 +_081CB6B4: + movs r0, 0x5 + bl audio_play + movs r0, 0x7 + b _081CB6EA +_081CB6BE: + movs r0, 0x5 + bl audio_play + b _081CB6D6 +_081CB6C6: + bl sub_81C8630 + cmp r0, 0 + bne _081CB6E4 +_081CB6CE: + adds r0, r5, 0 + movs r1, 0 + bl sub_81CBEF8 +_081CB6D6: + movs r0, 0 + b _081CB6EA +_081CB6DA: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _081CB6E8 +_081CB6E4: + movs r0, 0x2 + b _081CB6EA +_081CB6E8: + movs r0, 0x4 +_081CB6EA: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81CB678 + + thumb_func_start sub_81CB6F0 +sub_81CB6F0: @ 81CB6F0 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x6 + bl sub_81C763C + adds r5, r0, 0 + cmp r4, 0 + beq _081CB706 + cmp r4, 0x1 + beq _081CB71C + b _081CB72A +_081CB706: + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_81CBF60 + movs r0, 0x7 + bl sub_81C7BA4 + movs r0, 0 + b _081CB72C +_081CB71C: + adds r0, r5, 0 + bl sub_81CBFC4 + cmp r0, 0 + beq _081CB72A + movs r0, 0x2 + b _081CB72C +_081CB72A: + movs r0, 0x4 +_081CB72C: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81CB6F0 + + thumb_func_start sub_81CB734 +sub_81CB734: @ 81CB734 + push {r4,lr} + movs r0, 0x5 + bl audio_play + movs r0, 0x6 + bl sub_81C763C + adds r4, r0, 0 + bl sub_81CB01C + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_81CC344 + movs r0, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81CB734 + + thumb_func_start sub_81CB75C +sub_81CB75C: @ 81CB75C + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x6 + bl sub_81C763C + adds r5, r0, 0 + cmp r4, 0 + beq _081CB772 + cmp r4, 0x1 + beq _081CB788 + b _081CB796 +_081CB772: + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_81CBFF0 + movs r0, 0x6 + bl sub_81C7BA4 + movs r0, 0 + b _081CB798 +_081CB788: + adds r0, r5, 0 + bl sub_81CC004 + cmp r0, 0 + beq _081CB796 + movs r0, 0x2 + b _081CB798 +_081CB796: + movs r0, 0x4 +_081CB798: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81CB75C + + thumb_func_start sub_81CB7A0 +sub_81CB7A0: @ 81CB7A0 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x6 + bl sub_81C763C + adds r5, r0, 0 + cmp r4, 0x1 + beq _081CB7D4 + cmp r4, 0x1 + bgt _081CB7BA + cmp r4, 0 + beq _081CB7C4 + b _081CB81A +_081CB7BA: + cmp r4, 0x2 + beq _081CB7F8 + cmp r4, 0x3 + beq _081CB80C + b _081CB81A +_081CB7C4: + movs r0, 0x1 + bl sub_81C9148 + adds r0, r5, 0 + bl sub_81CC058 + movs r0, 0 + b _081CB81C +_081CB7D4: + adds r0, r5, 0 + bl sub_81CC0D0 + adds r4, r0, 0 + cmp r4, 0 + bne _081CB816 + adds r0, r5, 0 + bl sub_81CC0E0 + ldr r0, =0x00000107 + bl audio_play + strb r4, [r5, 0xE] + movs r0, 0 + b _081CB81C + .pool +_081CB7F8: + adds r0, r5, 0 + bl sub_81CC104 + cmp r0, 0 + bne _081CB816 + adds r0, r5, 0 + bl sub_81CC158 + movs r0, 0 + b _081CB81C +_081CB80C: + adds r0, r5, 0 + bl sub_81CC194 + cmp r0, 0 + beq _081CB81A +_081CB816: + movs r0, 0x2 + b _081CB81C +_081CB81A: + movs r0, 0x4 +_081CB81C: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81CB7A0 + + thumb_func_start sub_81CB824 +sub_81CB824: @ 81CB824 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x6 + bl sub_81C763C + adds r5, r0, 0 + cmp r4, 0x1 + beq _081CB85E + cmp r4, 0x1 + bgt _081CB83E + cmp r4, 0 + beq _081CB844 + b _081CB880 +_081CB83E: + cmp r4, 0x2 + beq _081CB872 + b _081CB880 +_081CB844: + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_81CC09C + movs r0, 0x1 + bl sub_81C9148 + movs r0, 0x1 + strb r0, [r5, 0xE] + movs r0, 0 + b _081CB882 +_081CB85E: + adds r0, r5, 0 + bl sub_81CC0D0 + cmp r0, 0 + bne _081CB87C + adds r0, r5, 0 + bl sub_81CC11C + movs r0, 0 + b _081CB882 +_081CB872: + adds r0, r5, 0 + bl sub_81CC140 + cmp r0, 0 + beq _081CB880 +_081CB87C: + movs r0, 0x2 + b _081CB882 +_081CB880: + movs r0, 0x4 +_081CB882: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81CB824 + + thumb_func_start sub_81CB888 +sub_81CB888: @ 81CB888 + push {r4-r6,lr} + adds r5, r0, 0 + movs r0, 0x6 + bl sub_81C763C + adds r4, r0, 0 + movs r6, 0 + cmp r5, 0x6 + bhi _081CB934 + lsls r0, r5, 2 + ldr r1, =_081CB8A8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081CB8A8: + .4byte _081CB8C4 + .4byte _081CB8DA + .4byte _081CB8E2 + .4byte _081CB8F0 + .4byte _081CB8F8 + .4byte _081CB90C + .4byte _081CB922 +_081CB8C4: + ldrb r0, [r4, 0xE] + cmp r0, 0 + bne _081CB8D2 + movs r0, 0x84 + lsls r0, 1 + bl audio_play +_081CB8D2: + movs r0, 0x5 + bl audio_play + b _081CB934 +_081CB8DA: + adds r0, r4, 0 + bl sub_81CC1DC + b _081CB934 +_081CB8E2: + adds r0, r4, 0 + bl sub_81CC204 + cmp r0, 0 + beq _081CB934 +_081CB8EC: + movs r6, 0x2 + b _081CB934 +_081CB8F0: + adds r0, r4, 0 + bl sub_81CBFF0 + b _081CB934 +_081CB8F8: + adds r0, r4, 0 + bl sub_81CC004 + cmp r0, 0 + beq _081CB904 + movs r6, 0x2 +_081CB904: + movs r0, 0x6 + bl sub_81C7BA4 + b _081CB934 +_081CB90C: + bl sub_81C7BE8 + cmp r0, 0 + bne _081CB8EC + ldrb r0, [r4, 0xF] + cmp r0, 0 + beq _081CB92C + bl sub_81C8838 + movs r6, 0x1 + b _081CB934 +_081CB922: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _081CB8EC +_081CB92C: + movs r0, 0 + bl sub_81C9148 + movs r6, 0x4 +_081CB934: + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81CB888 + + thumb_func_start sub_81CB93C +sub_81CB93C: @ 81CB93C + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x6 + bl sub_81C763C + adds r5, r0, 0 + cmp r4, 0x1 + beq _081CB974 + cmp r4, 0x1 + bgt _081CB956 + cmp r4, 0 + beq _081CB960 + b _081CB9BE +_081CB956: + cmp r4, 0x2 + beq _081CB990 + cmp r4, 0x3 + beq _081CB9A0 + b _081CB9BE +_081CB960: + movs r0, 0x5 + bl audio_play + bl sub_81C877C + adds r0, r5, 0 + bl sub_81CC014 + movs r0, 0 + b _081CB9C0 +_081CB974: + bl sub_81C8820 + cmp r0, 0 + bne _081CB9BA + adds r0, r5, 0 + bl sub_81CC004 + cmp r0, 0 + bne _081CB9BA + movs r0, 0x8 + bl sub_81C7BA4 + movs r0, 0 + b _081CB9C0 +_081CB990: + movs r0, 0 + bl sub_81C87AC + adds r0, r5, 0 + bl sub_81CC39C + movs r0, 0 + b _081CB9C0 +_081CB9A0: + bl sub_81C8820 + cmp r0, 0 + bne _081CB9BA + adds r0, r5, 0 + bl sub_81CC42C + cmp r0, 0 + bne _081CB9BA + bl sub_81C7BE8 + cmp r0, 0 + beq _081CB9BE +_081CB9BA: + movs r0, 0x2 + b _081CB9C0 +_081CB9BE: + movs r0, 0x4 +_081CB9C0: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81CB93C + + thumb_func_start sub_81CB9C8 +sub_81CB9C8: @ 81CB9C8 + push {r4,r5,lr} + adds r5, r0, 0 + movs r0, 0x6 + bl sub_81C763C + adds r4, r0, 0 + cmp r5, 0x4 + bhi _081CBA60 + lsls r0, r5, 2 + ldr r1, =_081CB9E8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081CB9E8: + .4byte _081CB9FC + .4byte _081CBA1C + .4byte _081CBA34 + .4byte _081CBA40 + .4byte _081CBA4A +_081CB9FC: + bl sub_81C8770 + bl sub_81CB0E4 + adds r5, r0, 0 + cmp r5, 0 + beq _081CBA60 + movs r0, 0x5 + bl audio_play + strh r5, [r4, 0x16] + adds r0, r4, 0 + bl sub_81CC420 + movs r0, 0 + b _081CBA62 +_081CBA1C: + adds r0, r4, 0 + bl sub_81CC42C + cmp r0, 0 + bne _081CBA5C + movs r0, 0x16 + ldrsh r1, [r4, r0] + adds r0, r4, 0 + bl sub_81CBEF8 + movs r0, 0 + b _081CBA62 +_081CBA34: + movs r1, 0x16 + ldrsh r0, [r4, r1] + bl sub_81C87AC + movs r0, 0 + b _081CBA62 +_081CBA40: + adds r0, r4, 0 + bl sub_81CC39C + movs r0, 0 + b _081CBA62 +_081CBA4A: + bl sub_81C8820 + cmp r0, 0 + bne _081CBA5C + adds r0, r4, 0 + bl sub_81CC42C + cmp r0, 0 + beq _081CBA60 +_081CBA5C: + movs r0, 0x2 + b _081CBA62 +_081CBA60: + movs r0, 0x4 +_081CBA62: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81CB9C8 + + thumb_func_start sub_81CBA68 +sub_81CBA68: @ 81CBA68 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x6 + bl sub_81C763C + adds r5, r0, 0 + cmp r4, 0x1 + beq _081CBA9C + cmp r4, 0x1 + bgt _081CBA82 + cmp r4, 0 + beq _081CBA88 + b _081CBACC +_081CBA82: + cmp r4, 0x2 + beq _081CBABE + b _081CBACC +_081CBA88: + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_81CC420 + bl sub_81C87F0 + movs r0, 0 + b _081CBACE +_081CBA9C: + bl sub_81C8820 + cmp r0, 0 + bne _081CBAC8 + adds r0, r5, 0 + bl sub_81CC42C + cmp r0, 0 + bne _081CBAC8 + movs r0, 0x6 + bl sub_81C7BA4 + adds r0, r5, 0 + bl sub_81CBDC0 + movs r0, 0 + b _081CBACE +_081CBABE: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _081CBACC +_081CBAC8: + movs r0, 0x2 + b _081CBACE +_081CBACC: + movs r0, 0x4 +_081CBACE: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81CBA68 + + thumb_func_start sub_81CBAD4 +sub_81CBAD4: @ 81CBAD4 + push {r4,r5,lr} + adds r5, r0, 0 + movs r0, 0x6 + bl sub_81C763C + adds r4, r0, 0 + cmp r5, 0x4 + bhi _081CBB6C + lsls r0, r5, 2 + ldr r1, =_081CBAF4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081CBAF4: + .4byte _081CBB08 + .4byte _081CBB28 + .4byte _081CBB40 + .4byte _081CBB4C + .4byte _081CBB56 +_081CBB08: + bl sub_81C8770 + bl sub_81CB128 + adds r5, r0, 0 + cmp r5, 0 + beq _081CBB6C + movs r0, 0x5 + bl audio_play + strh r5, [r4, 0x16] + adds r0, r4, 0 + bl sub_81CC420 + movs r0, 0 + b _081CBB6E +_081CBB28: + adds r0, r4, 0 + bl sub_81CC42C + cmp r0, 0 + bne _081CBB68 + movs r0, 0x16 + ldrsh r1, [r4, r0] + adds r0, r4, 0 + bl sub_81CBEF8 + movs r0, 0 + b _081CBB6E +_081CBB40: + movs r1, 0x16 + ldrsh r0, [r4, r1] + bl sub_81C87AC + movs r0, 0 + b _081CBB6E +_081CBB4C: + adds r0, r4, 0 + bl sub_81CC39C + movs r0, 0 + b _081CBB6E +_081CBB56: + bl sub_81C8820 + cmp r0, 0 + bne _081CBB68 + adds r0, r4, 0 + bl sub_81CC42C + cmp r0, 0 + beq _081CBB6C +_081CBB68: + movs r0, 0x2 + b _081CBB6E +_081CBB6C: + movs r0, 0x4 +_081CBB6E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81CBAD4 + + thumb_func_start sub_81CBB74 +sub_81CBB74: @ 81CBB74 + push {lr} + cmp r0, 0 + beq _081CBB80 + cmp r0, 0x1 + beq _081CBB9A + b _081CBBB2 +_081CBB80: + movs r0, 0x5 + bl audio_play + movs r0, 0 + bl sub_81CBC38 + movs r0, 0 + bl sub_81C7AC0 + bl sub_81C78A0 + movs r0, 0 + b _081CBBB4 +_081CBB9A: + bl sub_81C7B34 + cmp r0, 0 + bne _081CBBAA + bl sub_81C78C0 + cmp r0, 0 + beq _081CBBAE +_081CBBAA: + movs r0, 0x2 + b _081CBBB4 +_081CBBAE: + bl sub_81C7FDC +_081CBBB2: + movs r0, 0x4 +_081CBBB4: + pop {r1} + bx r1 + thumb_func_end sub_81CBB74 + + thumb_func_start sub_81CBBB8 +sub_81CBBB8: @ 81CBBB8 + push {lr} + sub sp, 0x18 + bl sub_81CAE94 + str r0, [sp] + bl sub_81CAE38 + mov r1, sp + movs r2, 0 + strh r0, [r1, 0x4] + movs r0, 0x4 + strb r0, [r1, 0x8] + mov r0, sp + strh r2, [r0, 0x6] + movs r0, 0xD + strb r0, [r1, 0x9] + movs r0, 0x10 + strb r0, [r1, 0xA] + movs r0, 0x1 + strb r0, [r1, 0xB] + movs r0, 0x8 + strb r0, [r1, 0xC] + movs r0, 0x3 + strb r0, [r1, 0xD] + movs r0, 0x7 + strb r0, [r1, 0xE] + ldr r0, =sub_81CB050 + str r0, [sp, 0x10] + ldr r0, =sub_81CBCEC + str r0, [sp, 0x14] + ldr r0, =gUnknown_08622794 + movs r2, 0x2 + bl sub_81C81D4 + ldr r0, =sub_81CBC64 + movs r1, 0x7 + bl AddTask + add sp, 0x18 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CBBB8 + + thumb_func_start sub_81CBC1C +sub_81CBC1C: @ 81CBC1C + push {lr} + bl sub_81C8234 + ldr r0, =sub_81CBC64 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CBC1C + + thumb_func_start sub_81CBC38 +sub_81CBC38: @ 81CBC38 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =sub_81CBC64 + bl get_task_id_by_function + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _081CBC56 + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + strh r4, [r0, 0x26] +_081CBC56: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CBC38 + + thumb_func_start sub_81CBC64 +sub_81CBC64: @ 81CBC64 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r2, r1, r0 + movs r1, 0x1E + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _081CBCC8 + ldrh r0, [r2] + adds r0, 0x4 + movs r1, 0x7F + ands r0, r1 + strh r0, [r2] + ldr r1, =gUnknown_08329F40 + movs r3, 0 + ldrsh r0, [r2, r3] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 20 + strh r0, [r2, 0x2] + ldr r0, =gUnknown_08622720 + adds r1, r0, 0 + adds r1, 0x20 + movs r3, 0x2 + ldrsh r2, [r2, r3] + str r2, [sp] + ldr r4, =0x020377b4 + str r4, [sp, 0x4] + movs r2, 0x10 + movs r3, 0x10 + bl sub_81C79BC + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081CBCC8 + ldr r1, =0x02037bb4 + ldr r2, =0x04000008 + adds r0, r4, 0 + bl CpuSet +_081CBCC8: + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CBC64 + + thumb_func_start sub_81CBCEC +sub_81CBCEC: @ 81CBCEC + push {r4-r6,lr} + adds r5, r1, 0 + adds r4, r2, 0 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl GetWindowAttribute + lsls r0, 24 + lsrs r0, 24 + bl GetBgTilemapBuffer + adds r6, r0, 0 + lsls r4, 7 + adds r4, 0x3A + adds r6, r4 + adds r0, r5, 0 + bl sub_81CAEBC + cmp r0, 0 + beq _081CBD30 + movs r1, 0xA0 + lsls r1, 7 + adds r0, r1, 0 + strh r0, [r6] + adds r1, r6, 0 + adds r1, 0x40 + ldr r2, =0x00005001 + adds r0, r2, 0 + strh r0, [r1] + b _081CBD3C + .pool +_081CBD30: + ldr r0, =0x00005002 + adds r1, r0, 0 + strh r1, [r6] + adds r0, r6, 0 + adds r0, 0x40 + strh r1, [r0] +_081CBD3C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CBCEC + + thumb_func_start sub_81CBD48 +sub_81CBD48: @ 81CBD48 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl GetWindowAttribute + lsls r0, 24 + lsrs r0, 24 + bl GetBgTilemapBuffer + lsls r4, 7 + adds r4, 0x3A + adds r0, r4 + ldr r2, =0x00005002 + adds r1, r2, 0 + strh r1, [r0] + adds r0, 0x40 + strh r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CBD48 + + thumb_func_start sub_81CBD78 +sub_81CBD78: @ 81CBD78 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gUnknown_086227D8 + bl AddWindow + strh r0, [r4, 0x10] + ldr r0, =gUnknown_086227E0 + bl AddWindow + strh r0, [r4, 0x12] + ldrb r0, [r4, 0x10] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldrb r0, [r4, 0x10] + bl PutWindowTilemap + ldrb r0, [r4, 0x12] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldrb r0, [r4, 0x12] + bl PutWindowTilemap + ldrb r0, [r4, 0x10] + movs r1, 0x1 + bl CopyWindowToVram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CBD78 + + thumb_func_start sub_81CBDC0 +sub_81CBDC0: @ 81CBDC0 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0x12] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldrh r0, [r4, 0x12] + bl sub_81CBDF4 + ldrh r0, [r4, 0x12] + bl sub_81CBE0C + ldrh r0, [r4, 0x12] + bl sub_81CBE38 + ldrh r0, [r4, 0x12] + bl sub_81CBE50 + ldrb r0, [r4, 0x12] + movs r1, 0x2 + bl CopyWindowToVram + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81CBDC0 + + thumb_func_start sub_81CBDF4 +sub_81CBDF4: @ 81CBDF4 + push {lr} + lsls r0, 16 + lsrs r0, 16 + ldr r1, =gUnknown_085EBE5F + movs r2, 0 + bl sub_81CBE88 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CBDF4 + + thumb_func_start sub_81CBE0C +sub_81CBE0C: @ 81CBE0C + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl sub_81CAE38 + adds r1, r0, 0 + mov r0, sp + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + adds r0, r4, 0 + mov r1, sp + movs r2, 0x1 + bl sub_81CBEB4 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81CBE0C + + thumb_func_start sub_81CBE38 +sub_81CBE38: @ 81CBE38 + push {lr} + lsls r0, 16 + lsrs r0, 16 + ldr r1, =gUnknown_085EBE6E + movs r2, 0x2 + bl sub_81CBE88 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CBE38 + + thumb_func_start sub_81CBE50 +sub_81CBE50: @ 81CBE50 + push {r4,lr} + sub sp, 0x8 + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x9 + bl sub_80847F8 + adds r1, r0, 0 + ldr r0, =0x0001869f + cmp r1, r0 + ble _081CBE68 + adds r1, r0, 0 +_081CBE68: + mov r0, sp + movs r2, 0 + movs r3, 0x5 + bl ConvertIntToDecimalString + adds r0, r4, 0 + mov r1, sp + movs r2, 0x3 + bl sub_81CBEB4 + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CBE50 + + thumb_func_start sub_81CBE88 +sub_81CBE88: @ 81CBE88 + push {lr} + sub sp, 0xC + adds r3, r1, 0 + lsls r2, 4 + adds r2, 0x1 + lsls r0, 24 + lsrs r0, 24 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x7 + adds r2, r3, 0 + movs r3, 0x2 + bl Print + add sp, 0xC + pop {r0} + bx r0 + thumb_func_end sub_81CBE88 + + thumb_func_start sub_81CBEB4 +sub_81CBEB4: @ 81CBEB4 + push {r4-r6,lr} + sub sp, 0xC + adds r5, r0, 0 + adds r6, r1, 0 + adds r4, r2, 0 + lsls r5, 16 + lsrs r5, 16 + movs r0, 0x7 + movs r2, 0x56 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + lsls r4, 4 + adds r4, 0x1 + lsls r5, 24 + lsrs r5, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0x7 + adds r2, r6, 0 + bl Print + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81CBEB4 + + thumb_func_start sub_81CBEF8 +sub_81CBEF8: @ 81CBEF8 + push {r4,r5,lr} + sub sp, 0x2C + adds r5, r0, 0 + adds r4, r1, 0 + bl sub_81C875C + adds r0, r4 + bl sub_81CAEA4 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0xD5 + beq _081CBF1C + add r0, sp, 0xC + movs r2, 0 + bl GetMapName + b _081CBF24 +_081CBF1C: + ldr r1, =gUnknown_085EC00F + add r0, sp, 0xC + bl CopyString +_081CBF24: + movs r0, 0x7 + add r1, sp, 0xC + movs r2, 0x58 + bl GetStringCenterAlignXOffset + adds r4, r0, 0 + ldrb r0, [r5, 0x10] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldrb r0, [r5, 0x10] + lsls r4, 24 + lsrs r4, 24 + movs r1, 0x1 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x7 + add r2, sp, 0xC + adds r3, r4, 0 + bl Print + add sp, 0x2C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CBEF8 + + thumb_func_start sub_81CBF60 +sub_81CBF60: @ 81CBF60 + push {r4-r6,lr} + sub sp, 0xC + adds r5, r0, 0 + ldrb r0, [r5, 0x12] + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r4, 0 + movs r6, 0x80 + lsls r6, 17 + b _081CBF9C +_081CBF76: + ldrb r0, [r5, 0x12] + ldr r2, =gUnknown_086227E8 + lsls r1, 2 + adds r1, r2 + ldr r2, [r1] + lsrs r1, r6, 24 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x7 + movs r3, 0x10 + bl Print + movs r0, 0x80 + lsls r0, 21 + adds r6, r0 + adds r4, 0x1 +_081CBF9C: + cmp r4, 0x2 + bhi _081CBFAE + adds r0, r4, 0 + bl sub_81CB02C + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x3 + bne _081CBF76 +_081CBFAE: + ldrb r0, [r5, 0x12] + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CBF60 + + thumb_func_start sub_81CBFC4 +sub_81CBFC4: @ 81CBFC4 + push {r4,lr} + adds r4, r0, 0 + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _081CBFD6 + movs r0, 0x1 + b _081CBFE8 +_081CBFD6: + bl sub_81CB01C + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_81CC2F0 + movs r0, 0 +_081CBFE8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81CBFC4 + + thumb_func_start sub_81CBFF0 +sub_81CBFF0: @ 81CBFF0 + push {r4,lr} + adds r4, r0, 0 + bl sub_81CC330 + adds r0, r4, 0 + bl sub_81CBDC0 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81CBFF0 + + thumb_func_start sub_81CC004 +sub_81CC004: @ 81CC004 + push {lr} + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_81CC004 + + thumb_func_start sub_81CC014 +sub_81CC014: @ 81CC014 + push {r4,lr} + adds r4, r0, 0 + bl sub_81CC330 + ldrb r0, [r4, 0x12] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldrb r0, [r4, 0x12] + movs r1, 0x2 + bl CopyWindowToVram + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81CC014 + + thumb_func_start sub_81CC034 +sub_81CC034: @ 81CC034 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gUnknown_08622808 + bl AddWindow + strh r0, [r4, 0x14] + ldrh r0, [r4, 0x14] + movs r1, 0x1 + movs r2, 0x4 + bl sub_8197184 + bl sub_81C7B40 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CC034 + + thumb_func_start sub_81CC058 +sub_81CC058: @ 81CC058 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x14] + movs r1, 0x1 + movs r2, 0x4 + bl sub_8197184 + ldrh r0, [r4, 0x14] + movs r1, 0x1 + movs r2, 0x4 + bl sub_81971C4 + ldrb r0, [r4, 0x14] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldrb r0, [r4, 0x14] + bl PutWindowTilemap + ldrb r0, [r4, 0x14] + movs r1, 0x3 + bl CopyWindowToVram + bl sub_81C7CCC + movs r2, 0 + movs r1, 0x18 + strh r1, [r0, 0x20] + movs r1, 0x70 + strh r1, [r0, 0x22] + strh r2, [r0, 0x26] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81CC058 + + thumb_func_start sub_81CC09C +sub_81CC09C: @ 81CC09C + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0x14] + movs r1, 0x1 + movs r2, 0x40 + bl sub_809882C + ldrb r0, [r4, 0x14] + movs r1, 0x1 + movs r2, 0x4 + bl sub_8098858 + ldrb r0, [r4, 0x14] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldrb r0, [r4, 0x14] + bl PutWindowTilemap + ldrb r0, [r4, 0x14] + movs r1, 0x3 + bl CopyWindowToVram + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81CC09C + + thumb_func_start sub_81CC0D0 +sub_81CC0D0: @ 81CC0D0 + push {lr} + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_81CC0D0 + + thumb_func_start sub_81CC0E0 +sub_81CC0E0: @ 81CC0E0 + push {lr} + sub sp, 0xC + ldrb r0, [r0, 0x14] + ldr r2, =gUnknown_086227F4 + movs r1, 0x1 + str r1, [sp] + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x20 + bl Print + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CC0E0 + + thumb_func_start sub_81CC104 +sub_81CC104: @ 81CC104 + push {r4,lr} + adds r4, r0, 0 + bl RunTextPrinters + ldrb r0, [r4, 0x14] + bl IsTextPrinterActive + lsls r0, 16 + lsrs r0, 16 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81CC104 + + thumb_func_start sub_81CC11C +sub_81CC11C: @ 81CC11C + push {lr} + sub sp, 0xC + ldrb r0, [r0, 0x14] + ldr r2, =gUnknown_085EBF95 + movs r1, 0x1 + str r1, [sp] + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CC11C + + thumb_func_start sub_81CC140 +sub_81CC140: @ 81CC140 + push {r4,lr} + adds r4, r0, 0 + bl RunTextPrinters + ldrb r0, [r4, 0x14] + bl IsTextPrinterActive + lsls r0, 16 + lsrs r0, 16 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81CC140 + + thumb_func_start sub_81CC158 +sub_81CC158: @ 81CC158 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r0, 0 + bl sub_81C875C + adds r1, r4, 0 + adds r1, 0xF + bl sub_81CAF78 + adds r5, r0, 0 + bl sav2_get_text_speed + lsls r0, 24 + lsrs r0, 24 + ldrb r2, [r4, 0x14] + movs r1, 0x1 + str r1, [sp] + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r2, 0 + adds r2, r5, 0 + movs r3, 0x20 + bl Print + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81CC158 + + thumb_func_start sub_81CC194 +sub_81CC194: @ 81CC194 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2C] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081CC1B8 + ldr r0, =0x03003014 + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] + b _081CC1C4 + .pool +_081CC1B8: + ldr r2, =0x03003014 + ldrb r1, [r2] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_081CC1C4: + bl RunTextPrinters + ldrb r0, [r4, 0x14] + bl IsTextPrinterActive + lsls r0, 16 + lsrs r0, 16 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CC194 + + thumb_func_start sub_81CC1DC +sub_81CC1DC: @ 81CC1DC + push {lr} + sub sp, 0x8 + bl sub_81C7CE4 + movs r0, 0x20 + str r0, [sp] + movs r0, 0x14 + str r0, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + add sp, 0x8 + pop {r0} + bx r0 + thumb_func_end sub_81CC1DC + + thumb_func_start sub_81CC204 +sub_81CC204: @ 81CC204 + push {lr} + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_81CC204 + + thumb_func_start sub_81CC214 +sub_81CC214: @ 81CC214 + push {r4-r6,lr} + sub sp, 0x8 + movs r0, 0x6 + bl sub_81C763C + adds r6, r0, 0 + movs r5, 0 + ldr r4, =gUnknown_08622810 +_081CC224: + adds r0, r4, 0 + bl LoadCompressedObjectPic + adds r4, 0x8 + adds r5, 0x1 + cmp r5, 0 + beq _081CC224 + ldr r0, =gUnknown_08622818 + bl sub_81C795C + movs r0, 0 + str r0, [r6, 0x1C] + ldr r1, =0x00001828 + adds r0, r6, r1 + str r0, [sp] + ldr r1, =0xffff0000 + ldr r0, [sp, 0x4] + ands r0, r1 + movs r1, 0x80 + lsls r1, 4 + orrs r0, r1 + ldr r1, =0x0000ffff + ands r0, r1 + movs r1, 0x80 + lsls r1, 12 + orrs r0, r1 + str r0, [sp, 0x4] + mov r0, sp + bl LoadObjectPic + ldr r2, =0x00001824 + adds r1, r6, r2 + lsls r0, 16 + lsrs r0, 11 + ldr r2, =0x06010000 + adds r0, r2 + str r0, [r1] + movs r0, 0xD + bl AllocObjectPalette + lsls r0, 24 + lsrs r0, 20 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + strh r0, [r6, 0x1A] + bl sub_81CC370 + str r0, [r6, 0x20] + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CC214 + + thumb_func_start sub_81CC2B4 +sub_81CC2B4: @ 81CC2B4 + push {r4,lr} + movs r0, 0x6 + bl sub_81C763C + adds r4, r0, 0 + ldr r0, [r4, 0x1C] + cmp r0, 0 + beq _081CC2C8 + bl RemoveObjectAndFreeTiles +_081CC2C8: + ldr r0, [r4, 0x20] + cmp r0, 0 + beq _081CC2D2 + bl RemoveObjectAndFreeTiles +_081CC2D2: + movs r0, 0x8 + bl FreeObjectTilesByTag + movs r0, 0x7 + bl FreeObjectTilesByTag + movs r0, 0xC + bl FreeObjectPaletteByTag + movs r0, 0xD + bl FreeObjectPaletteByTag + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81CC2B4 + + thumb_func_start sub_81CC2F0 +sub_81CC2F0: @ 81CC2F0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, [r4, 0x1C] + cmp r0, 0 + bne _081CC320 + ldr r0, =gUnknown_08622830 + movs r1, 0x4 + movs r2, 0x50 + movs r3, 0x5 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + str r1, [r4, 0x1C] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81CC344 +_081CC320: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CC2F0 + + thumb_func_start sub_81CC330 +sub_81CC330: @ 81CC330 + push {r4,lr} + adds r4, r0, 0 + ldr r0, [r4, 0x1C] + bl RemoveObjectAndFreeTiles + movs r0, 0 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81CC330 + + thumb_func_start sub_81CC344 +sub_81CC344: @ 81CC344 + ldr r0, [r0, 0x1C] + lsls r1, 4 + strh r1, [r0, 0x26] + bx lr + thumb_func_end sub_81CC344 + + thumb_func_start sub_81CC34C +sub_81CC34C: @ 81CC34C + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _081CC36C + movs r0, 0 + strh r0, [r2, 0x2E] + ldrh r0, [r2, 0x24] + adds r0, 0x1 + movs r1, 0x7 + ands r0, r1 + strh r0, [r2, 0x24] +_081CC36C: + pop {r0} + bx r0 + thumb_func_end sub_81CC34C + + thumb_func_start sub_81CC370 +sub_81CC370: @ 81CC370 + push {lr} + ldr r0, =gUnknown_08622850 + movs r1, 0x2C + movs r2, 0x68 + movs r3, 0x6 + bl AddObjectToFront + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CC370 + + thumb_func_start sub_81CC39C +sub_81CC39C: @ 81CC39C + push {r4-r7,lr} + adds r7, r0, 0 + bl sub_81C875C + bl sub_81CAF04 + cmp r0, 0 + blt _081CC400 + lsls r4, r0, 3 + ldr r0, =gTrainerFrontPicTable + adds r0, r4, r0 + ldr r1, =0x00001828 + adds r5, r7, r1 + adds r1, r5, 0 + movs r2, 0 + bl DecompressPicFromTable + ldr r0, =gTrainerFrontPicPaletteTable + adds r4, r0 + ldr r0, [r4] + ldr r1, =0x00002028 + adds r6, r7, r1 + adds r1, r6, 0 + bl LZ77UnCompWram + ldr r1, =0x00001824 + adds r0, r7, r1 + ldr r1, [r0] + movs r2, 0x80 + lsls r2, 4 + adds r0, r5, 0 + movs r3, 0x1 + bl RequestDma3Copy + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldrh r1, [r7, 0x1A] + adds r0, r6, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, [r7, 0x20] + movs r0, 0 + strh r0, [r1, 0x2E] + ldr r0, [r7, 0x20] + strh r4, [r0, 0x3C] + ldr r1, [r7, 0x20] + ldr r0, =sub_81CC440 + str r0, [r1, 0x1C] +_081CC400: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CC39C + + thumb_func_start sub_81CC420 +sub_81CC420: @ 81CC420 + ldr r1, [r0, 0x20] + ldr r0, =sub_81CC4A4 + str r0, [r1, 0x1C] + bx lr + .pool + thumb_func_end sub_81CC420 + + thumb_func_start sub_81CC42C +sub_81CC42C: @ 81CC42C + ldr r0, [r0, 0x20] + ldr r1, [r0, 0x1C] + ldr r0, =DummyObjectCallback + eors r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + bx lr + .pool + thumb_func_end sub_81CC42C + + thumb_func_start sub_81CC440 +sub_81CC440: @ 81CC440 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081CC452 + cmp r0, 0x1 + beq _081CC484 + b _081CC498 +_081CC452: + movs r1, 0x3C + ldrsh r0, [r4, r1] + bl CheckForSpaceForDma3Request + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _081CC498 + ldr r0, =0x0000ffb0 + strh r0, [r4, 0x24] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _081CC498 + .pool +_081CC484: + ldrh r0, [r4, 0x24] + adds r0, 0x8 + strh r0, [r4, 0x24] + lsls r0, 16 + cmp r0, 0 + blt _081CC498 + movs r0, 0 + strh r0, [r4, 0x24] + ldr r0, =DummyObjectCallback + str r0, [r4, 0x1C] +_081CC498: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CC440 + + thumb_func_start sub_81CC4A4 +sub_81CC4A4: @ 81CC4A4 + push {lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x24] + subs r0, 0x8 + strh r0, [r3, 0x24] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x50 + negs r1, r1 + cmp r0, r1 + bgt _081CC4CA + adds r2, r3, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =DummyObjectCallback + str r0, [r3, 0x1C] +_081CC4CA: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CC4A4 + + thumb_func_start sub_81CC4D4 +sub_81CC4D4: @ 81CC4D4 + push {r4,lr} + movs r0, 0x3 + movs r1, 0x14 + bl sub_81C761C + adds r4, r0, 0 + cmp r4, 0 + beq _081CC4F0 + ldr r1, =0x00000884 + movs r0, 0x10 + bl sub_81C761C + cmp r0, 0 + bne _081CC4F8 +_081CC4F0: + movs r0, 0 + b _081CC51A + .pool +_081CC4F8: + ldr r0, =0x02037318 + ldrb r0, [r0, 0x14] + bl sub_8124668 + str r0, [r4, 0xC] + cmp r0, 0 + bne _081CC514 + ldr r0, =sub_81CC568 + b _081CC516 + .pool +_081CC514: + ldr r0, =sub_81CC5B4 +_081CC516: + str r0, [r4, 0x10] + movs r0, 0x1 +_081CC51A: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CC4D4 + + thumb_func_start sub_81CC524 +sub_81CC524: @ 81CC524 + push {lr} + bl sub_8124658 + ldr r1, =0x03005d90 + ldr r3, [r1] + movs r1, 0x1 + ands r1, r0 + lsls r1, 3 + ldrb r2, [r3, 0x15] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x15] + movs r0, 0x10 + bl sub_81C7650 + movs r0, 0x3 + bl sub_81C7650 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CC524 + + thumb_func_start sub_81CC554 +sub_81CC554: @ 81CC554 + push {lr} + movs r0, 0x3 + bl sub_81C763C + ldr r1, [r0, 0x10] + bl _call_via_r1 + pop {r1} + bx r1 + thumb_func_end sub_81CC554 + + thumb_func_start sub_81CC568 +sub_81CC568: @ 81CC568 + push {r4,lr} + adds r4, r0, 0 + bl sub_81230AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + beq _081CC58C + cmp r0, 0x4 + bgt _081CC582 + cmp r0, 0x3 + beq _081CC588 + b _081CC5AC +_081CC582: + cmp r0, 0x5 + beq _081CC59E + b _081CC5AC +_081CC588: + movs r0, 0x1 + b _081CC5AE +_081CC58C: + bl sub_8124658 + lsls r0, 24 + cmp r0, 0 + bne _081CC59A + movs r0, 0x3 + b _081CC5AE +_081CC59A: + movs r0, 0x2 + b _081CC5AE +_081CC59E: + ldr r0, =sub_81CC5DC + str r0, [r4, 0x10] + movs r0, 0x4 + b _081CC5AE + .pool +_081CC5AC: + movs r0, 0 +_081CC5AE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81CC568 + + thumb_func_start sub_81CC5B4 +sub_81CC5B4: @ 81CC5B4 + push {lr} + adds r2, r0, 0 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _081CC5CC + movs r0, 0 + b _081CC5D2 + .pool +_081CC5CC: + ldr r0, =sub_81CC5DC + str r0, [r2, 0x10] + movs r0, 0x4 +_081CC5D2: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CC5B4 + + thumb_func_start sub_81CC5DC +sub_81CC5DC: @ 81CC5DC + ldr r0, =0x000186a1 + bx lr + .pool + thumb_func_end sub_81CC5DC + + thumb_func_start sub_81CC5E4 +sub_81CC5E4: @ 81CC5E4 + push {lr} + movs r0, 0x3 + bl sub_81C763C + ldr r0, [r0, 0xC] + pop {r1} + bx r1 + thumb_func_end sub_81CC5E4 + + thumb_func_start sub_81CC5F4 +sub_81CC5F4: @ 81CC5F4 + push {r4,lr} + ldr r1, =0x00001948 + movs r0, 0x4 + bl sub_81C761C + adds r4, r0, 0 + cmp r4, 0 + beq _081CC624 + ldr r0, =sub_81CC6F4 + movs r1, 0x1 + bl sub_81C7078 + str r0, [r4, 0x4] + ldr r0, =sub_81CC6BC + str r0, [r4] + movs r0, 0x1 + b _081CC626 + .pool +_081CC624: + movs r0, 0 +_081CC626: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81CC5F4 + + thumb_func_start sub_81CC62C +sub_81CC62C: @ 81CC62C + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x4 + bl sub_81C763C + adds r5, r0, 0 + ldr r0, =gUnknown_086230E4 + lsls r4, 2 + adds r4, r0 + ldr r0, [r4] + movs r1, 0x1 + bl sub_81C7078 + str r0, [r5, 0x4] + ldr r0, =sub_81CC6BC + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CC62C + + thumb_func_start sub_81CC65C +sub_81CC65C: @ 81CC65C + push {lr} + movs r0, 0x4 + bl sub_81C763C + ldr r0, [r0] + bl _call_via_r0 + pop {r1} + bx r1 + thumb_func_end sub_81CC65C + + thumb_func_start sub_81CC670 +sub_81CC670: @ 81CC670 + push {r4,lr} + movs r0, 0x4 + bl sub_81C763C + adds r4, r0, 0 + bl sub_812305C + bl sub_81CC9EC + ldrb r0, [r4, 0x8] + bl RemoveWindow + movs r0, 0x10 + bl sub_81C7650 + movs r0, 0x4 + bl sub_81C7650 + bl sub_81C760C + movs r0, 0 + bl SetBgMode + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81CC670 + + thumb_func_start sub_81CC6A4 +sub_81CC6A4: @ 81CC6A4 + push {lr} + bl copy_pal_bg_faded_to_pal_ram + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl sub_81237B4 + pop {r0} + bx r0 + thumb_func_end sub_81CC6A4 + + thumb_func_start sub_81CC6BC +sub_81CC6BC: @ 81CC6BC + push {lr} + movs r0, 0x4 + bl sub_81C763C + ldr r0, [r0, 0x4] + bl sub_81C70D8 + pop {r1} + bx r1 + thumb_func_end sub_81CC6BC + + thumb_func_start sub_81CC6D0 +sub_81CC6D0: @ 81CC6D0 + push {lr} + bl sub_81CC5E4 + cmp r0, 0 + bne _081CC6EC + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x15] + lsrs r0, 3 + movs r1, 0x1 + ands r0, r1 + b _081CC6EE + .pool +_081CC6EC: + movs r0, 0 +_081CC6EE: + pop {r1} + bx r1 + thumb_func_end sub_81CC6D0 + + thumb_func_start sub_81CC6F4 +sub_81CC6F4: @ 81CC6F4 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x4 + bl sub_81C763C + adds r5, r0, 0 + cmp r4, 0x7 + bls _081CC706 + b _081CC83E +_081CC706: + lsls r0, r4, 2 + ldr r1, =_081CC714 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081CC714: + .4byte _081CC734 + .4byte _081CC784 + .4byte _081CC7B6 + .4byte _081CC7BE + .4byte _081CC7CE + .4byte _081CC7E2 + .4byte _081CC804 + .4byte _081CC82A +_081CC734: + movs r0, 0 + bl c3args_set_0toR1_1to0 + movs r0, 0x1 + bl HideBg + movs r0, 0x2 + bl HideBg + movs r0, 0x3 + bl HideBg + movs r0, 0x1 + bl SetBgMode + ldr r4, =gUnknown_086230D8 + adds r0, r4, 0 + movs r1, 0x2 + bl sub_81C7B54 + movs r0, 0x10 + bl sub_81C763C + adds r5, r0, 0 + adds r4, 0x4 + bl sub_81CC6D0 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8122CF8 + bl sub_81CC9C0 +_081CC77C: + movs r0, 0 + b _081CC840 + .pool +_081CC784: + bl sub_8122DB0 + lsls r0, 24 + cmp r0, 0 + bne _081CC83A + bl sub_81CC5E4 + cmp r0, 0 + bne _081CC7AC + movs r0, 0x4 + movs r1, 0x9 + bl sub_8124288 + movs r0, 0x5 + movs r1, 0xA + bl sub_81240D4 + bl sub_812454C + b _081CC77C +_081CC7AC: + movs r0, 0 + movs r1, 0x6 + bl sub_8123030 + b _081CC77C +_081CC7B6: + bl sub_81CCD10 +_081CC7BA: + movs r0, 0x1 + b _081CC840 +_081CC7BE: + bl sub_81CCD24 + cmp r0, 0 + bne _081CC83A + adds r0, r5, 0 + bl sub_81CCA1C + b _081CC7BA +_081CC7CE: + bl sub_81CCAFC + cmp r0, 0 + bne _081CC83A + adds r0, r5, 0 + bl sub_81CCB0C + bl sub_81C7B40 + b _081CC77C +_081CC7E2: + adds r0, r5, 0 + bl sub_81CCC4C + cmp r0, 0 + bne _081CC83A + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + ldr r0, =sub_81CC6A4 + bl c3args_set_0toR1_1to0 + b _081CC77C + .pool +_081CC804: + bl sub_81CC6D0 + lsls r0, 24 + movs r4, 0x5 + cmp r0, 0 + bne _081CC812 + movs r4, 0x4 +_081CC812: + adds r0, r4, 0 + bl sub_81C7DFC + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_81C7FA0 + movs r0, 0x1 + bl sub_81C7AC0 + b _081CC77C +_081CC82A: + bl sub_81C7B34 + cmp r0, 0 + bne _081CC83A + bl sub_81C8010 + cmp r0, 0 + beq _081CC7BA +_081CC83A: + movs r0, 0x2 + b _081CC840 +_081CC83E: + movs r0, 0x4 +_081CC840: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81CC6F4 + + thumb_func_start sub_81CC848 +sub_81CC848: @ 81CC848 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x4 + bl sub_81C763C + cmp r4, 0 + beq _081CC85C + cmp r4, 0x1 + beq _081CC864 + b _081CC870 +_081CC85C: + bl sub_81CCB0C + movs r0, 0 + b _081CC872 +_081CC864: + bl sub_81CCC4C + cmp r0, 0 + beq _081CC870 + movs r0, 0x2 + b _081CC872 +_081CC870: + movs r0, 0x4 +_081CC872: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81CC848 + + thumb_func_start sub_81CC878 +sub_81CC878: @ 81CC878 + push {lr} + cmp r0, 0x1 + beq _081CC8A2 + cmp r0, 0x1 + bgt _081CC888 + cmp r0, 0 + beq _081CC88E + b _081CC8D0 +_081CC888: + cmp r0, 0x2 + beq _081CC8BE + b _081CC8D0 +_081CC88E: + movs r0, 0x5 + bl audio_play + movs r0, 0 + bl sub_81CCC5C + bl sub_8123418 + movs r0, 0 + b _081CC8D2 +_081CC8A2: + bl sub_8123514 + lsls r0, 24 + cmp r0, 0 + bne _081CC8C6 + bl sub_81CCC88 + cmp r0, 0 + bne _081CC8C6 + movs r0, 0x1 + bl sub_81C7BA4 + movs r0, 0 + b _081CC8D2 +_081CC8BE: + bl sub_81C7BE8 + cmp r0, 0 + beq _081CC8CA +_081CC8C6: + movs r0, 0x2 + b _081CC8D2 +_081CC8CA: + movs r0, 0x4 + bl sub_81C7E14 +_081CC8D0: + movs r0, 0x4 +_081CC8D2: + pop {r1} + bx r1 + thumb_func_end sub_81CC878 + + thumb_func_start sub_81CC8D8 +sub_81CC8D8: @ 81CC8D8 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x4 + bl sub_81C763C + adds r5, r0, 0 + cmp r4, 0x1 + beq _081CC90C + cmp r4, 0x1 + bgt _081CC8F2 + cmp r4, 0 + beq _081CC8FC + b _081CC952 +_081CC8F2: + cmp r4, 0x2 + beq _081CC924 + cmp r4, 0x3 + beq _081CC940 + b _081CC952 +_081CC8FC: + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_81CCB0C + movs r0, 0 + b _081CC954 +_081CC90C: + adds r0, r5, 0 + bl sub_81CCC4C + cmp r0, 0 + bne _081CC948 + movs r0, 0x1 + bl sub_81CCC5C + bl sub_8123418 + movs r0, 0 + b _081CC954 +_081CC924: + bl sub_8123514 + lsls r0, 24 + cmp r0, 0 + bne _081CC948 + bl sub_81CCC88 + cmp r0, 0 + bne _081CC948 + movs r0, 0x2 + bl sub_81C7BA4 + movs r0, 0 + b _081CC954 +_081CC940: + bl sub_81C7BE8 + cmp r0, 0 + beq _081CC94C +_081CC948: + movs r0, 0x2 + b _081CC954 +_081CC94C: + movs r0, 0x5 + bl sub_81C7E14 +_081CC952: + movs r0, 0x4 +_081CC954: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81CC8D8 + + thumb_func_start sub_81CC95C +sub_81CC95C: @ 81CC95C + push {lr} + cmp r0, 0x1 + beq _081CC982 + cmp r0, 0x1 + bgt _081CC96C + cmp r0, 0 + beq _081CC972 + b _081CC9B8 +_081CC96C: + cmp r0, 0x2 + beq _081CC996 + b _081CC9B8 +_081CC972: + movs r0, 0x5 + bl audio_play + movs r0, 0 + bl sub_81C7AC0 + movs r0, 0 + b _081CC9BA +_081CC982: + bl sub_81C7B34 + cmp r0, 0 + bne _081CC99E + bl sub_81C7FDC + bl sub_81C78A0 + movs r0, 0 + b _081CC9BA +_081CC996: + bl sub_81C78C0 + cmp r0, 0 + beq _081CC9A2 +_081CC99E: + movs r0, 0x2 + b _081CC9BA +_081CC9A2: + movs r0, 0x1 + bl HideBg + movs r0, 0x2 + bl HideBg + movs r0, 0x3 + bl HideBg + movs r0, 0 + b _081CC9BA +_081CC9B8: + movs r0, 0x4 +_081CC9BA: + pop {r1} + bx r1 + thumb_func_end sub_81CC95C + + thumb_func_start sub_81CC9C0 +sub_81CC9C0: @ 81CC9C0 + push {r4,r5,lr} + movs r5, 0 + ldr r4, =gUnknown_086230F8 +_081CC9C6: + adds r0, r4, 0 + bl LoadCompressedObjectPic + adds r4, 0x8 + adds r5, 0x1 + cmp r5, 0 + beq _081CC9C6 + ldr r0, =gUnknown_08623100 + bl sub_81C795C + bl sub_81CCE58 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CC9C0 + + thumb_func_start sub_81CC9EC +sub_81CC9EC: @ 81CC9EC + push {r4,r5,lr} + movs r0, 0x4 + bl sub_81C763C + adds r4, r0, 0 + movs r0, 0x6 + bl FreeObjectTilesByTag + movs r0, 0xB + bl FreeObjectPaletteByTag + adds r5, r4, 0 + adds r5, 0xC + movs r4, 0x2 +_081CCA08: + ldm r5!, {r0} + bl RemoveObjectAndFreeTiles + subs r4, 0x1 + cmp r4, 0 + bge _081CCA08 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81CC9EC + + thumb_func_start sub_81CCA1C +sub_81CCA1C: @ 81CCA1C + push {r4,r5,lr} + sub sp, 0x8 + adds r5, r0, 0 + movs r0, 0x1 + movs r1, 0 + movs r2, 0x40 + movs r3, 0x1 + bl sub_8199DF0 + movs r0, 0x1 + movs r1, 0x11 + movs r2, 0x41 + movs r3, 0x1 + bl sub_8199DF0 + add r1, sp, 0x4 + movs r2, 0x82 + lsls r2, 5 + adds r0, r2, 0 + strh r0, [r1] + adds r4, r5, 0 + adds r4, 0x18 + ldr r2, =0x01000400 + adds r0, r1, 0 + adds r1, r4, 0 + bl CpuSet + movs r0, 0x1 + adds r1, r4, 0 + bl SetBgTilemapBuffer + ldr r0, =gUnknown_08623110 + bl AddWindow + movs r4, 0 + strh r0, [r5, 0x8] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x42 + movs r2, 0x40 + bl box_border_load_tiles_and_pal + ldrb r0, [r5, 0x8] + movs r1, 0x42 + movs r2, 0x4 + bl sub_8098858 + ldr r1, =gUnknown_08622888 + str r4, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldrb r0, [r5, 0x8] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldrb r0, [r5, 0x8] + bl PutWindowTilemap + ldrb r0, [r5, 0x8] + movs r1, 0x3 + bl CopyWindowToVram + ldr r0, =gUnknown_08622868 + movs r1, 0x10 + movs r2, 0x20 + bl sub_81C7944 + ldr r0, =gUnknown_08DC91E8 + movs r1, 0x30 + movs r2, 0x20 + bl sub_81C7944 + bl sub_8124658 + lsls r0, 24 + cmp r0, 0 + bne _081CCAE0 + ldr r1, =0xffffa000 + movs r0, 0x1 + movs r2, 0 + bl ChangeBgY + b _081CCAEA + .pool +_081CCAE0: + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgY +_081CCAEA: + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81CCA1C + + thumb_func_start sub_81CCAFC +sub_81CCAFC: @ 81CCAFC + push {lr} + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_81CCAFC + + thumb_func_start sub_81CCB0C +sub_81CCB0C: @ 81CCB0C + push {r4,r5,lr} + sub sp, 0xC + adds r4, r0, 0 + movs r0, 0x10 + bl sub_81C763C + adds r5, r0, 0 + ldrb r0, [r5, 0x2] + cmp r0, 0x4 + bls _081CCB22 + b _081CCC40 +_081CCB22: + lsls r0, 2 + ldr r1, =_081CCB30 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081CCB30: + .4byte _081CCC1C + .4byte _081CCBDC + .4byte _081CCB44 + .4byte _081CCB8E + .4byte _081CCBDC +_081CCB44: + ldrb r0, [r4, 0x8] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldrb r0, [r4, 0x8] + movs r1, 0x2 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0xC + bl PutWindowRectTilemap + ldrb r0, [r4, 0x8] + adds r2, r5, 0x4 + movs r1, 0x1 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x7 + movs r3, 0 + bl Print + ldrh r1, [r5] + ldrb r2, [r5, 0x3] + adds r0, r4, 0 + bl sub_81CCD70 + ldrb r0, [r4, 0x8] + movs r1, 0x3 + bl CopyWindowToVram + movs r0, 0 + bl sub_81CCFA4 + b _081CCC40 +_081CCB8E: + ldrb r0, [r4, 0x8] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldrb r0, [r4, 0x8] + movs r1, 0x2 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0xC + bl PutWindowRectTilemap + ldrb r0, [r4, 0x8] + adds r2, r5, 0x4 + movs r1, 0x1 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x7 + movs r3, 0 + bl Print + ldr r1, =0x00001041 + movs r0, 0xC + str r0, [sp] + movs r0, 0xB + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r2, 0x11 + movs r3, 0x6 + bl FillBgTilemapBufferRect + b _081CCC0C + .pool +_081CCBDC: + ldrb r0, [r4, 0x8] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldrb r0, [r4, 0x8] + bl PutWindowTilemap + ldrb r0, [r4, 0x8] + adds r2, r5, 0x4 + movs r1, 0x1 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x7 + movs r3, 0 + bl Print + ldrh r1, [r5] + ldrb r2, [r5, 0x3] + adds r0, r4, 0 + bl sub_81CCDE8 +_081CCC0C: + ldrb r0, [r4, 0x8] + movs r1, 0x3 + bl CopyWindowToVram + movs r0, 0x1 + bl sub_81CCFA4 + b _081CCC40 +_081CCC1C: + ldr r1, =0x00001041 + movs r0, 0xC + str r0, [sp] + movs r0, 0xD + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r2, 0x11 + movs r3, 0x4 + bl FillBgTilemapBufferRect + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0x1 + bl sub_81CCFA4 +_081CCC40: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CCB0C + + thumb_func_start sub_81CCC4C +sub_81CCC4C: @ 81CCC4C + push {lr} + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_81CCC4C + + thumb_func_start sub_81CCC5C +sub_81CCC5C: @ 81CCC5C + push {r4,lr} + adds r4, r0, 0 + ldr r0, =sub_81CCC9C + movs r1, 0x3 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CCC5C + + thumb_func_start sub_81CCC88 +sub_81CCC88: @ 81CCC88 + push {lr} + ldr r0, =sub_81CCC9C + bl is_function_an_active_task + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CCC88 + + thumb_func_start sub_81CCC9C +sub_81CCC9C: @ 81CCC9C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _081CCCE0 + movs r1, 0x90 + lsls r1, 3 + movs r0, 0x1 + movs r2, 0x1 + bl ChangeBgY + cmp r0, 0 + blt _081CCCD6 + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + adds r0, r4, 0 + bl remove_task +_081CCCD6: + bl sub_81CCF78 + b _081CCD04 + .pool +_081CCCE0: + movs r1, 0x90 + lsls r1, 3 + movs r0, 0x1 + movs r2, 0x2 + bl ChangeBgY + ldr r1, =0xffffa000 + cmp r0, r1 + bgt _081CCD00 + movs r0, 0x1 + movs r2, 0 + bl ChangeBgY + adds r0, r5, 0 + bl remove_task +_081CCD00: + bl sub_81CCF78 +_081CCD04: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CCC9C + + thumb_func_start sub_81CCD10 +sub_81CCD10: @ 81CCD10 + push {lr} + ldr r0, =sub_81CCD34 + movs r1, 0x1 + bl sub_81C7078 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CCD10 + + thumb_func_start sub_81CCD24 +sub_81CCD24: @ 81CCD24 + push {lr} + ldr r0, =sub_81CCD34 + bl sub_81C7124 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CCD24 + + thumb_func_start sub_81CCD34 +sub_81CCD34: @ 81CCD34 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x4 + bl sub_81C763C + adds r2, r0, 0 + cmp r4, 0x15 + ble _081CCD48 + movs r0, 0x4 + b _081CCD62 +_081CCD48: + ldr r0, =gUnknown_08623118 + lsls r1, r4, 3 + adds r0, 0x4 + adds r1, r0 + ldr r0, [r1] + movs r1, 0xC8 + muls r1, r4 + ldr r3, =0x00000818 + adds r1, r3 + adds r1, r2, r1 + bl LZ77UnCompWram + movs r0, 0x1 +_081CCD62: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CCD34 + + thumb_func_start sub_81CCD70 +sub_81CCD70: @ 81CCD70 + push {r4-r6,lr} + sub sp, 0x8 + adds r6, r0, 0 + adds r3, r1, 0 + movs r4, 0 + ldr r0, =gUnknown_08623118 + ldrh r1, [r0] + adds r5, r0, 0 + cmp r1, r3 + bne _081CCD8A + ldrh r0, [r5, 0x2] + cmp r0, r2 + beq _081CCDA0 +_081CCD8A: + adds r4, 0x1 + cmp r4, 0x15 + bgt _081CCDA0 + lsls r0, r4, 3 + adds r1, r0, r5 + ldrh r0, [r1] + cmp r0, r3 + bne _081CCD8A + ldrh r0, [r1, 0x2] + cmp r0, r2 + bne _081CCD8A +_081CCDA0: + cmp r4, 0x16 + beq _081CCDD4 + ldr r1, =0x00001041 + movs r0, 0xC + str r0, [sp] + movs r0, 0xB + str r0, [sp, 0x4] + movs r0, 0x1 + movs r2, 0x11 + movs r3, 0x6 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0xC8 + adds r1, r4, 0 + muls r1, r0 + ldr r0, =0x00000818 + adds r1, r0 + adds r1, r6, r1 + movs r0, 0xA + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x1 + movs r2, 0x12 + movs r3, 0x6 + bl CopyToBgTilemapBufferRect +_081CCDD4: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CCD70 + + thumb_func_start sub_81CCDE8 +sub_81CCDE8: @ 81CCDE8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + mov r9, r0 + movs r5, 0 + ldr r6, =0x02021cc4 + movs r4, 0x88 + lsls r4, 21 + lsls r1, 24 + mov r8, r1 + lsls r7, r2, 24 + b _081CCE34 + .pool +_081CCE08: + adds r0, r6, 0 + movs r2, 0 + movs r3, 0xC + bl CopyStringPadded + mov r1, r9 + ldrb r0, [r1, 0x8] + lsrs r1, r4, 24 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x7 + adds r2, r6, 0 + movs r3, 0 + bl Print + movs r0, 0x80 + lsls r0, 21 + adds r4, r0 + adds r5, 0x1 +_081CCE34: + lsls r2, r5, 24 + lsrs r2, 24 + mov r1, r8 + lsrs r0, r1, 24 + lsrs r1, r7, 24 + bl sub_8145CF4 + adds r1, r0, 0 + cmp r1, 0 + bne _081CCE08 + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81CCDE8 + + thumb_func_start sub_81CCE58 +sub_81CCE58: @ 81CCE58 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r0, 0x4 + bl sub_81C763C + adds r4, r0, 0 + bl sub_8124658 + lsls r0, 24 + movs r2, 0x84 + cmp r0, 0 + bne _081CCE74 + movs r2, 0xE4 +_081CCE74: + movs r5, 0 + lsls r7, r2, 16 + adds r4, 0xC + mov r8, r4 + movs r6, 0x98 + lsls r6, 16 +_081CCE80: + asrs r1, r6, 16 + ldr r0, =gUnknown_086231D0 + asrs r2, r7, 16 + movs r3, 0x8 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, =0x02020630 + adds r2, r0 + movs r0, 0 + strh r0, [r2, 0x2E] + lsls r4, r5, 2 + strh r4, [r2, 0x30] + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r0, r1, 22 + adds r1, r0, 0 + strh r0, [r2, 0x32] + movs r0, 0x96 + strh r0, [r2, 0x34] + strh r4, [r2, 0x36] + adds r1, r4 + ldr r4, =0x000003ff + adds r0, r4, 0 + ands r1, r0 + ldr r4, =0xfffffc00 + adds r0, r4, 0 + ands r3, r0 + orrs r3, r1 + strh r3, [r2, 0x4] + mov r0, r8 + adds r0, 0x4 + mov r8, r0 + subs r0, 0x4 + stm r0!, {r2} + movs r4, 0x80 + lsls r4, 14 + adds r6, r4 + adds r5, 0x1 + cmp r5, 0x2 + ble _081CCE80 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CCE58 + + thumb_func_start sub_81CCEF4 +sub_81CCEF4: @ 81CCEF4 + push {r4,r5,lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x34] + movs r1, 0x34 + ldrsh r4, [r3, r1] + cmp r4, 0 + beq _081CCF06 + subs r0, 0x1 + b _081CCF6E +_081CCF06: + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB + ble _081CCF16 + strh r4, [r3, 0x2E] +_081CCF16: + ldrh r0, [r3, 0x30] + adds r0, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3C + ble _081CCF26 + strh r4, [r3, 0x30] +_081CCF26: + ldrh r5, [r3, 0x30] + ldrh r2, [r3, 0x32] + adds r1, r5, r2 + ldr r2, =0x000003ff + adds r0, r2, 0 + ands r1, r0 + ldrh r2, [r3, 0x4] + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x4] + ldrh r1, [r3, 0x38] + movs r2, 0x38 + ldrsh r0, [r3, r2] + cmp r0, 0x3 + bgt _081CCF5C + movs r2, 0x2E + ldrsh r0, [r3, r2] + cmp r0, 0 + bne _081CCF70 + adds r0, r1, 0x1 + strh r0, [r3, 0x38] + b _081CCF6C + .pool +_081CCF5C: + lsls r0, r5, 16 + asrs r0, 16 + movs r2, 0x36 + ldrsh r1, [r3, r2] + cmp r0, r1 + bne _081CCF70 + strh r4, [r3, 0x38] + strh r4, [r3, 0x2E] +_081CCF6C: + movs r0, 0x78 +_081CCF6E: + strh r0, [r3, 0x34] +_081CCF70: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81CCEF4 + + thumb_func_start sub_81CCF78 +sub_81CCF78: @ 81CCF78 + push {r4,lr} + movs r0, 0x4 + bl sub_81C763C + adds r4, r0, 0 + movs r0, 0x1 + bl GetBgY + asrs r0, 8 + movs r1, 0x84 + subs r1, r0 + adds r4, 0xC + movs r2, 0x2 +_081CCF92: + ldm r4!, {r0} + strh r1, [r0, 0x22] + subs r2, 0x1 + cmp r2, 0 + bge _081CCF92 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81CCF78 + + thumb_func_start sub_81CCFA4 +sub_81CCFA4: @ 81CCFA4 + push {r4-r6,lr} + adds r4, r0, 0 + movs r0, 0x4 + bl sub_81C763C + movs r1, 0x1 + ands r4, r1 + lsls r5, r4, 2 + movs r6, 0x5 + negs r6, r6 + adds r4, r0, 0 + adds r4, 0xC + movs r3, 0x2 +_081CCFBE: + ldm r4!, {r0} + adds r0, 0x3E + ldrb r2, [r0] + adds r1, r6, 0 + ands r1, r2 + orrs r1, r5 + strb r1, [r0] + subs r3, 0x1 + cmp r3, 0 + bge _081CCFBE + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81CCFA4 + + thumb_func_start sub_81CCFD8 +sub_81CCFD8: @ 81CCFD8 + push {r4,lr} + ldr r1, =0x0000678c + movs r0, 0xB + bl sub_81C761C + adds r4, r0, 0 + cmp r4, 0 + beq _081CD01C + ldr r1, =0x00006428 + adds r0, r4, r1 + bl sub_81D1ED4 + bl sub_81CD970 + ldr r1, =0x030022b0 + movs r0, 0x14 + strh r0, [r1] + ldr r0, =0x00006304 + adds r1, r4, r0 + ldr r0, =sub_81CD08C + str r0, [r1] + movs r0, 0x1 + b _081CD01E + .pool +_081CD01C: + movs r0, 0 +_081CD01E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81CCFD8 + + thumb_func_start sub_81CD024 +sub_81CD024: @ 81CD024 + push {r4,lr} + ldr r1, =0x0000678c + movs r0, 0xB + bl sub_81C761C + adds r4, r0, 0 + cmp r4, 0 + beq _081CD068 + ldr r1, =0x00006428 + adds r0, r4, r1 + bl sub_81D1ED4 + bl sub_81CD9F8 + ldr r1, =0x030022b0 + movs r0, 0x14 + strh r0, [r1] + ldr r0, =0x00006304 + adds r1, r4, r0 + ldr r0, =sub_81CD08C + str r0, [r1] + movs r0, 0x1 + b _081CD06A + .pool +_081CD068: + movs r0, 0 +_081CD06A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81CD024 + + thumb_func_start sub_81CD070 +sub_81CD070: @ 81CD070 + push {lr} + movs r0, 0xB + bl sub_81C763C + ldr r2, =0x00006304 + adds r1, r0, r2 + ldr r1, [r1] + bl _call_via_r1 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CD070 + + thumb_func_start sub_81CD08C +sub_81CD08C: @ 81CD08C + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x12 + bl sub_81C763C + adds r5, r0, 0 + adds r0, r4, 0 + bl sub_81CD1E4 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _081CD100 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _081CD0D0 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081CD100 + movs r1, 0xC6 + lsls r1, 7 + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _081CD0F0 + ldrh r1, [r5, 0x2] + ldrh r0, [r5] + subs r0, 0x1 + cmp r1, r0 + bne _081CD100 +_081CD0D0: + movs r0, 0x5 + bl audio_play + ldr r0, =0x00006304 + adds r1, r4, r0 + ldr r0, =sub_81CD19C + str r0, [r1] + movs r2, 0x2 + b _081CD100 + .pool +_081CD0F0: + movs r0, 0x5 + bl audio_play + movs r2, 0x5 + ldr r0, =0x00006304 + adds r1, r4, r0 + ldr r0, =sub_81CD110 + str r0, [r1] +_081CD100: + adds r0, r2, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CD08C + + thumb_func_start sub_81CD110 +sub_81CD110: @ 81CD110 + push {r4-r6,lr} + sub sp, 0x4 + adds r6, r0, 0 + movs r4, 0 + bl sub_811FBA4 + lsls r0, 24 + cmp r0, 0 + bne _081CD18A + bl sub_81CEF14 + ldr r1, =0x00006786 + adds r5, r6, r1 + movs r1, 0 + ldrsb r1, [r5, r1] + ldr r2, =0x00006783 + adds r4, r6, r2 + adds r1, r4, r1 + strb r0, [r1] + movs r0, 0x12 + bl sub_81C763C + ldrh r1, [r0, 0x2] + lsls r1, 2 + adds r0, r1 + ldrb r2, [r0, 0x4] + ldrb r3, [r0, 0x5] + movs r0, 0 + ldrsb r0, [r5, r0] + adds r4, r0 + ldrb r1, [r4] + mov r0, sp + strb r1, [r0] + cmp r2, 0xE + bne _081CD174 + movs r0, 0x64 + muls r0, r3 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x8 + mov r2, sp + bl pokemon_setattr + b _081CD180 + .pool +_081CD174: + adds r0, r2, 0 + adds r1, r3, 0 + movs r2, 0x8 + mov r3, sp + bl set_pokemon_data_from_any_box +_081CD180: + ldr r0, =0x00006304 + adds r1, r6, r0 + ldr r0, =sub_81CD08C + str r0, [r1] + movs r4, 0x6 +_081CD18A: + adds r0, r4, 0 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CD110 + + thumb_func_start sub_81CD19C +sub_81CD19C: @ 81CD19C + push {lr} + movs r1, 0xC6 + lsls r1, 7 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _081CD1B4 + ldr r0, =0x000186aa + b _081CD1B6 + .pool +_081CD1B4: + ldr r0, =0x000186a2 +_081CD1B6: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CD19C + + thumb_func_start sub_81CD1C0 +sub_81CD1C0: @ 81CD1C0 + push {lr} + movs r0, 0xB + bl sub_81C763C + movs r1, 0xC6 + lsls r1, 7 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _081CD1DA + movs r0, 0x12 + bl sub_81C7650 +_081CD1DA: + movs r0, 0xB + bl sub_81C7650 + pop {r0} + bx r0 + thumb_func_end sub_81CD1C0 + + thumb_func_start sub_81CD1E4 +sub_81CD1E4: @ 81CD1E4 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x12 + bl sub_81C763C + adds r2, r0, 0 + movs r3, 0 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2C] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081CD220 + movs r1, 0xC6 + lsls r1, 7 + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _081CD210 + ldrh r0, [r2, 0x2] + cmp r0, 0 + beq _081CD24E +_081CD210: + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + b _081CD246 + .pool +_081CD220: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081CD24E + movs r1, 0xC6 + lsls r1, 7 + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _081CD23E + ldrh r1, [r2, 0x2] + ldrh r0, [r2] + subs r0, 0x1 + cmp r1, r0 + bge _081CD24E +_081CD23E: + movs r0, 0x5 + bl audio_play + movs r0, 0 +_081CD246: + bl sub_81CD258 + lsls r0, 24 + lsrs r3, r0, 24 +_081CD24E: + adds r0, r3, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81CD1E4 + + thumb_func_start sub_81CD258 +sub_81CD258: @ 81CD258 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r0, 0xB + bl sub_81C763C + adds r4, r0, 0 + movs r0, 0x12 + bl sub_81C763C + adds r5, r0, 0 + mov r0, r8 + cmp r0, 0 + beq _081CD284 + ldr r1, =0x00006788 + adds r0, r4, r1 + b _081CD288 + .pool +_081CD284: + ldr r2, =0x00006787 + adds r0, r4, r2 +_081CD288: + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 16 + lsrs r0, 16 + adds r7, r0, 0 + ldr r1, =0x00006428 + adds r0, r4, r1 + ldr r2, =0x00006786 + adds r1, r4, r2 + movs r2, 0 + ldrsb r2, [r1, r2] + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 2 + ldr r3, =0x0000643c + adds r1, r3 + adds r1, r4, r1 + lsls r2, r7, 2 + adds r2, r7 + lsls r2, 2 + adds r2, r3 + adds r2, r4, r2 + bl sub_81D1F84 + ldrh r6, [r5, 0x2] + bl sub_81CDD5C + cmp r0, 0 + beq _081CD2D8 + ldrh r1, [r5] + b _081CD2DC + .pool +_081CD2D8: + ldrh r1, [r5] + subs r1, 0x1 +_081CD2DC: + eors r1, r6 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + adds r6, r0, 0 + mov r0, r8 + cmp r0, 0 + beq _081CD332 + ldr r1, =0x00006787 + adds r2, r4, r1 + ldrb r0, [r2] + adds r1, 0x1 + adds r3, r4, r1 + strb r0, [r3] + ldr r0, =0x00006786 + adds r1, r4, r0 + ldrb r0, [r1] + strb r0, [r2] + strb r7, [r1] + ldrb r1, [r3] + ldr r2, =0x00006789 + adds r0, r4, r2 + strb r1, [r0] + ldrh r0, [r5, 0x2] + cmp r0, 0 + bne _081CD312 + ldrh r0, [r5] +_081CD312: + subs r1, r0, 0x1 + strh r1, [r5, 0x2] + lsls r0, r1, 16 + cmp r0, 0 + beq _081CD32C + subs r1, 0x1 + b _081CD384 + .pool +_081CD32C: + ldrh r0, [r5] + subs r1, r0, 0x1 + b _081CD384 +_081CD332: + ldr r0, =0x00006788 + adds r2, r4, r0 + ldrb r0, [r2] + ldr r1, =0x00006787 + adds r3, r4, r1 + strb r0, [r3] + ldr r0, =0x00006786 + adds r1, r4, r0 + ldrb r0, [r1] + strb r0, [r2] + strb r7, [r1] + ldrb r1, [r3] + ldr r2, =0x00006789 + adds r0, r4, r2 + strb r1, [r0] + ldrh r1, [r5, 0x2] + ldrh r0, [r5] + subs r0, 0x1 + cmp r1, r0 + bge _081CD370 + adds r0, r1, 0x1 + b _081CD372 + .pool +_081CD370: + movs r0, 0 +_081CD372: + strh r0, [r5, 0x2] + ldrh r1, [r5, 0x2] + ldrh r0, [r5] + subs r0, 0x1 + cmp r1, r0 + bge _081CD382 + adds r1, 0x1 + b _081CD384 +_081CD382: + movs r1, 0 +_081CD384: + ldr r2, =0x00006302 + adds r0, r4, r2 + strh r1, [r0] + ldrh r4, [r5, 0x2] + bl sub_81CDD5C + cmp r0, 0 + beq _081CD39C + ldrh r1, [r5] + b _081CD3A0 + .pool +_081CD39C: + ldrh r1, [r5] + subs r1, 0x1 +_081CD3A0: + eors r1, r4 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + cmp r6, 0 + bne _081CD3B0 + movs r0, 0x3 + b _081CD3BA +_081CD3B0: + cmp r0, 0 + beq _081CD3B8 + movs r0, 0x1 + b _081CD3BA +_081CD3B8: + movs r0, 0x4 +_081CD3BA: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81CD258 + + thumb_func_start sub_81CD3C4 +sub_81CD3C4: @ 81CD3C4 + push {r4,lr} + movs r0, 0xB + bl sub_81C763C + adds r4, r0, 0 + movs r0, 0x12 + bl sub_81C763C + adds r2, r0, 0 + ldr r1, =0x0000678a + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0x9 + bls _081CD3E2 + b _081CD530 +_081CD3E2: + lsls r0, 2 + ldr r1, =_081CD3F4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081CD3F4: + .4byte _081CD41C + .4byte _081CD428 + .4byte _081CD434 + .4byte _081CD440 + .4byte _081CD490 + .4byte _081CD4A8 + .4byte _081CD4C0 + .4byte _081CD4D8 + .4byte _081CD4F0 + .4byte _081CD508 +_081CD41C: + movs r1, 0x2 + ldrsh r0, [r2, r1] + movs r1, 0 + bl sub_81CD824 + b _081CD530 +_081CD428: + movs r1, 0x2 + ldrsh r0, [r2, r1] + movs r1, 0 + bl sub_81CDA1C + b _081CD530 +_081CD434: + movs r1, 0x2 + ldrsh r0, [r2, r1] + movs r1, 0 + bl sub_81CDB98 + b _081CD530 +_081CD440: + ldrh r0, [r2] + cmp r0, 0x1 + bne _081CD468 + ldr r2, =0x00006786 + adds r0, r4, r2 + movs r1, 0 + strb r1, [r0] + adds r2, 0x1 + adds r0, r4, r2 + strb r1, [r0] + adds r2, 0x1 + adds r0, r4, r2 + strb r1, [r0] + adds r2, 0x2 + adds r0, r4, r2 + strb r1, [r0] + movs r0, 0x1 + b _081CD53C + .pool +_081CD468: + ldr r0, =0x00006786 + adds r1, r4, r0 + movs r0, 0 + strb r0, [r1] + ldr r2, =0x00006787 + adds r1, r4, r2 + movs r0, 0x1 + strb r0, [r1] + ldr r0, =0x00006788 + adds r1, r4, r0 + movs r0, 0x2 + strb r0, [r1] + b _081CD530 + .pool +_081CD490: + ldrh r0, [r2, 0x2] + adds r0, 0x1 + ldrh r2, [r2] + cmp r0, r2 + blt _081CD49C + movs r0, 0 +_081CD49C: + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + bl sub_81CD824 + b _081CD530 +_081CD4A8: + ldrh r0, [r2, 0x2] + adds r0, 0x1 + ldrh r2, [r2] + cmp r0, r2 + blt _081CD4B4 + movs r0, 0 +_081CD4B4: + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + bl sub_81CDA1C + b _081CD530 +_081CD4C0: + ldrh r0, [r2, 0x2] + adds r0, 0x1 + ldrh r2, [r2] + cmp r0, r2 + blt _081CD4CC + movs r0, 0 +_081CD4CC: + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + bl sub_81CDB98 + b _081CD530 +_081CD4D8: + ldrh r0, [r2, 0x2] + subs r0, 0x1 + cmp r0, 0 + bge _081CD4E4 + ldrh r0, [r2] + subs r0, 0x1 +_081CD4E4: + lsls r0, 16 + asrs r0, 16 + movs r1, 0x2 + bl sub_81CD824 + b _081CD530 +_081CD4F0: + ldrh r0, [r2, 0x2] + subs r0, 0x1 + cmp r0, 0 + bge _081CD4FC + ldrh r0, [r2] + subs r0, 0x1 +_081CD4FC: + lsls r0, 16 + asrs r0, 16 + movs r1, 0x2 + bl sub_81CDA1C + b _081CD530 +_081CD508: + ldrh r0, [r2, 0x2] + subs r0, 0x1 + cmp r0, 0 + bge _081CD514 + ldrh r0, [r2] + subs r0, 0x1 +_081CD514: + lsls r0, 16 + asrs r0, 16 + movs r1, 0x2 + bl sub_81CDB98 + ldr r2, =0x0000678a + adds r1, r4, r2 + movs r0, 0 + strb r0, [r1] + movs r0, 0x1 + b _081CD53C + .pool +_081CD530: + ldr r0, =0x0000678a + adds r1, r4, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r0, 0 +_081CD53C: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CD3C4 + + thumb_func_start sub_81CD548 +sub_81CD548: @ 81CD548 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + movs r0, 0xB + bl sub_81C763C + adds r1, r0, 0 + cmp r4, 0x1 + beq _081CD588 + cmp r4, 0x1 + bgt _081CD566 + cmp r4, 0 + beq _081CD56C + b _081CD5C4 +_081CD566: + cmp r5, 0x2 + beq _081CD5A4 + b _081CD5C4 +_081CD56C: + ldr r2, =0x00006302 + adds r0, r1, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + ldr r2, =0x00006789 + adds r1, r2 + ldrb r1, [r1] + bl sub_81CD824 + b _081CD5C4 + .pool +_081CD588: + ldr r2, =0x00006302 + adds r0, r1, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + ldr r2, =0x00006789 + adds r1, r2 + ldrb r1, [r1] + bl sub_81CDA1C + b _081CD5C4 + .pool +_081CD5A4: + ldr r2, =0x00006302 + adds r0, r1, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + ldr r2, =0x00006789 + adds r1, r2 + ldrb r1, [r1] + bl sub_81CDB98 + movs r0, 0x1 + b _081CD5C6 + .pool +_081CD5C4: + movs r0, 0 +_081CD5C6: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81CD548 + + thumb_func_start sub_81CD5CC +sub_81CD5CC: @ 81CD5CC + push {r4,lr} + adds r4, r0, 0 + lsls r2, 16 + lsrs r2, 16 + b _081CD5E4 +_081CD5D6: + strb r3, [r4] + adds r1, 0x1 + adds r4, 0x1 + lsls r0, r2, 16 + ldr r2, =0xffff0000 + adds r0, r2 + lsrs r2, r0, 16 +_081CD5E4: + ldrb r3, [r1] + adds r0, r3, 0 + cmp r0, 0xFF + bne _081CD5D6 + adds r1, r2, 0 + lsls r0, r1, 16 + ldr r2, =0xffff0000 + adds r0, r2 + lsrs r2, r0, 16 + lsls r1, 16 + cmp r1, 0 + ble _081CD612 + movs r3, 0 +_081CD5FE: + strb r3, [r4] + adds r4, 0x1 + adds r1, r2, 0 + lsls r0, r1, 16 + ldr r2, =0xffff0000 + adds r0, r2 + lsrs r2, r0, 16 + lsls r1, 16 + cmp r1, 0 + bgt _081CD5FE +_081CD612: + movs r0, 0xFF + strb r0, [r4] + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CD5CC + + thumb_func_start sub_81CD624 +sub_81CD624: @ 81CD624 + 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 r4, 16 + lsrs r4, 16 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + movs r0, 0x12 + bl sub_81C763C + lsls r4, 2 + adds r0, r4 + ldrb r4, [r0, 0x4] + mov r8, r4 + ldrb r6, [r0, 0x5] + mov r9, r6 + movs r0, 0xFC + strb r0, [r5] + adds r5, 0x1 + movs r0, 0x4 + strb r0, [r5] + adds r5, 0x1 + movs r0, 0x8 + strb r0, [r5] + adds r5, 0x1 + movs r0, 0 + strb r0, [r5] + adds r5, 0x1 + movs r0, 0x9 + strb r0, [r5] + adds r5, 0x1 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0x2D + movs r3, 0 + bl sub_81D2C68 + cmp r0, 0 + beq _081CD690 + ldr r1, =gUnknown_085E8264 + adds r0, r5, 0 + movs r2, 0 + movs r3, 0xC + bl CopyStringPadded + b _081CD80E + .pool +_081CD690: + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0x2 + adds r3, r5, 0 + bl sub_81D2C68 + adds r0, r5, 0 + bl GetStringEnd_Limit7 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0xB + movs r3, 0 + bl sub_81D2C68 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r4, 0xE + bne _081CD6E0 + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + adds r0, r4, 0 + bl pokemon_get_gender + lsls r0, 24 + lsrs r6, r0, 24 + b _081CD6FE + .pool +_081CD6E0: + mov r0, r8 + mov r1, r9 + bl get_pokemon_by_box_and_pos + adds r4, r0, 0 + bl pokemon_roll_gender + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r4, 0 + bl sub_80690C0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 +_081CD6FE: + cmp r7, 0x1D + beq _081CD706 + cmp r7, 0x20 + bne _081CD71C +_081CD706: + movs r0, 0xB + adds r1, r7, 0 + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r5, 0 + bl CompareString + cmp r0, 0 + bne _081CD71C + movs r6, 0xFF +_081CD71C: + adds r3, r5, 0 + b _081CD726 + .pool +_081CD724: + adds r3, 0x1 +_081CD726: + ldrb r0, [r3] + cmp r0, 0xFF + bne _081CD724 + movs r1, 0xFC + strb r1, [r3] + adds r3, 0x1 + movs r0, 0x12 + strb r0, [r3] + adds r3, 0x1 + movs r0, 0x3C + strb r0, [r3] + adds r3, 0x1 + cmp r6, 0 + beq _081CD74A + cmp r6, 0xFE + beq _081CD76E + movs r0, 0x77 + b _081CD790 +_081CD74A: + strb r1, [r3] + adds r3, 0x1 + movs r0, 0x1 + strb r0, [r3] + adds r3, 0x1 + movs r0, 0x4 + strb r0, [r3] + adds r3, 0x1 + strb r1, [r3] + adds r3, 0x1 + movs r0, 0x3 + strb r0, [r3] + adds r3, 0x1 + movs r0, 0x5 + strb r0, [r3] + adds r3, 0x1 + movs r0, 0xB5 + b _081CD790 +_081CD76E: + strb r1, [r3] + adds r3, 0x1 + movs r0, 0x1 + strb r0, [r3] + adds r3, 0x1 + movs r0, 0x6 + strb r0, [r3] + adds r3, 0x1 + strb r1, [r3] + adds r3, 0x1 + movs r0, 0x3 + strb r0, [r3] + adds r3, 0x1 + movs r0, 0x7 + strb r0, [r3] + adds r3, 0x1 + movs r0, 0xB6 +_081CD790: + strb r0, [r3] + adds r3, 0x1 + movs r0, 0xFC + strb r0, [r3] + adds r3, 0x1 + movs r0, 0x4 + strb r0, [r3] + adds r3, 0x1 + movs r0, 0x8 + strb r0, [r3] + adds r3, 0x1 + movs r5, 0 + strb r5, [r3] + adds r3, 0x1 + movs r0, 0x9 + strb r0, [r3] + adds r3, 0x1 + movs r0, 0xBA + strb r0, [r3] + adds r3, 0x1 + movs r0, 0xF9 + strb r0, [r3] + adds r3, 0x1 + movs r0, 0x5 + strb r0, [r3] + adds r3, 0x1 + adds r4, r3, 0 + adds r0, r4, 0 + mov r1, r8 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + adds r3, r0, 0 + subs r4, r3, r4 + lsls r4, 16 + lsrs r4, 16 + strb r5, [r3] + adds r3, 0x1 + mov r0, r10 + cmp r0, 0 + bne _081CD808 + movs r0, 0x3 + subs r0, r4 + lsls r0, 16 + ldr r1, =0xffff0000 + adds r0, r1 + lsrs r4, r0, 16 + ldr r0, =0x0000ffff + cmp r4, r0 + beq _081CD808 + movs r2, 0 + adds r1, r0, 0 +_081CD7FA: + strb r2, [r3] + adds r3, 0x1 + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, r1 + bne _081CD7FA +_081CD808: + movs r0, 0xFF + strb r0, [r3] + adds r0, r3, 0 +_081CD80E: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CD624 + + thumb_func_start sub_81CD824 +sub_81CD824: @ 81CD824 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r1, 24 + lsrs r6, r1, 24 + movs r0, 0xB + bl sub_81C763C + adds r5, r0, 0 + movs r0, 0x12 + bl sub_81C763C + adds r7, r0, 0 + mov r1, r8 + lsls r0, r1, 16 + asrs r4, r0, 16 + bl sub_81CDD5C + cmp r0, 0 + beq _081CD85A + ldrh r2, [r7] + cmp r4, r2 + bne _081CD862 + b _081CD900 +_081CD85A: + ldrh r0, [r7] + subs r0, 0x1 + cmp r4, r0 + beq _081CD900 +_081CD862: + lsls r0, r6, 6 + ldr r1, =0x00006368 + adds r0, r1 + adds r0, r5, r0 + mov r2, r8 + lsls r4, r2, 16 + lsrs r1, r4, 16 + movs r2, 0 + bl sub_81CD624 + asrs r4, 14 + adds r4, r7, r4 + ldrb r3, [r4, 0x4] + lsls r0, r6, 1 + adds r0, r6 + lsls r4, r0, 3 + ldr r1, =0x00006320 + adds r0, r5, r1 + adds r0, r4 + movs r2, 0 + movs r1, 0xFC + strb r1, [r0] + ldr r1, =0x00006321 + adds r0, r5, r1 + adds r0, r4 + movs r1, 0x4 + strb r1, [r0] + ldr r1, =0x00006322 + adds r0, r5, r1 + adds r0, r4 + movs r1, 0x8 + strb r1, [r0] + ldr r1, =0x00006323 + adds r0, r5, r1 + adds r0, r4 + strb r2, [r0] + ldr r2, =0x00006324 + adds r0, r5, r2 + adds r0, r4 + movs r1, 0x9 + strb r1, [r0] + cmp r3, 0xE + bne _081CD8E4 + adds r0, r4, r5 + ldr r1, =0x00006325 + adds r0, r1 + ldr r1, =gUnknown_085EBFCE + b _081CD8F4 + .pool +_081CD8E4: + adds r4, r5 + ldr r2, =0x00006325 + adds r4, r2 + adds r0, r3, 0 + bl sav3_get_box_name + adds r1, r0, 0 + adds r0, r4, 0 +_081CD8F4: + movs r2, 0x8 + bl sub_81CD5CC + b _081CD95C + .pool +_081CD900: + movs r1, 0 + lsls r4, r6, 6 + lsls r0, r6, 1 + mov r8, r0 + adds r3, r4, 0 + ldr r0, =0x00006368 + adds r2, r5, r0 + movs r7, 0 +_081CD910: + adds r0, r1, r3 + adds r0, r2, r0 + strb r7, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0xB + bls _081CD910 + adds r1, r4 + ldr r2, =0x00006368 + adds r0, r5, r2 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + movs r1, 0 + mov r2, r8 + adds r0, r2, r6 + lsls r3, r0, 3 + ldr r0, =0x00006320 + adds r2, r5, r0 + movs r4, 0 +_081CD93A: + adds r0, r1, r3 + adds r0, r2, r0 + strb r4, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x7 + bls _081CD93A + mov r2, r8 + adds r0, r2, r6 + lsls r0, 3 + adds r0, r1, r0 + ldr r2, =0x00006320 + adds r1, r5, r2 + adds r1, r0 + movs r0, 0xFF + strb r0, [r1] +_081CD95C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CD824 + + thumb_func_start sub_81CD970 +sub_81CD970: @ 81CD970 + push {r4-r7,lr} + movs r0, 0xB + bl sub_81C763C + adds r7, r0, 0 + ldr r1, =0x000006ac + movs r0, 0x12 + bl sub_81C761C + adds r6, r0, 0 + movs r0, 0xC6 + lsls r0, 7 + adds r1, r7, r0 + movs r0, 0 + strb r0, [r1] + movs r4, 0 + movs r5, 0 + b _081CD9C4 + .pool +_081CD998: + movs r0, 0x64 + muls r0, r4 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2D + bl pokemon_getattr + adds r2, r0, 0 + cmp r2, 0 + bne _081CD9BE + lsls r1, r5, 2 + adds r1, r6, r1 + movs r0, 0xE + strb r0, [r1, 0x4] + strb r4, [r1, 0x5] + strh r2, [r1, 0x6] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_081CD9BE: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_081CD9C4: + bl calc_player_party_count + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bcc _081CD998 + lsls r0, r5, 2 + adds r0, r6, r0 + movs r1, 0 + strb r1, [r0, 0x4] + strb r1, [r0, 0x5] + movs r2, 0 + strh r1, [r0, 0x6] + strh r1, [r6, 0x2] + adds r0, r5, 0x1 + strh r0, [r6] + ldr r1, =0x0000678a + adds r0, r7, r1 + strb r2, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CD970 + + thumb_func_start sub_81CD9F8 +sub_81CD9F8: @ 81CD9F8 + push {lr} + movs r0, 0xB + bl sub_81C763C + movs r1, 0xC6 + lsls r1, 7 + adds r2, r0, r1 + movs r3, 0 + movs r1, 0x1 + strb r1, [r2] + ldr r1, =0x0000678a + adds r0, r1 + strb r3, [r0] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CD9F8 + + thumb_func_start sub_81CDA1C +sub_81CDA1C: @ 81CDA1C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + movs r0, 0xB + bl sub_81C763C + mov r8, r0 + movs r0, 0x12 + bl sub_81C763C + adds r4, r0, 0 + lsls r0, r6, 16 + asrs r5, r0, 16 + bl sub_81CDD5C + cmp r0, 0 + beq _081CDA52 + ldrh r0, [r4] + cmp r5, r0 + bne _081CDA5A + b _081CDB48 +_081CDA52: + ldrh r0, [r4] + subs r0, 0x1 + cmp r5, r0 + beq _081CDB48 +_081CDA5A: + lsls r0, r6, 16 + asrs r0, 14 + adds r0, r4, r0 + ldrb r6, [r0, 0x4] + ldrb r7, [r0, 0x5] + adds r0, r6, 0 + adds r1, r7, 0 + movs r2, 0x16 + movs r3, 0 + bl sub_81D2C68 + mov r1, r9 + lsls r5, r1, 2 + adds r4, r5, r1 + ldr r1, =0x00006428 + add r1, r8 + adds r1, r4 + strb r0, [r1] + adds r0, r6, 0 + adds r1, r7, 0 + movs r2, 0x2F + movs r3, 0 + bl sub_81D2C68 + ldr r1, =0x00006429 + add r1, r8 + adds r1, r4 + strb r0, [r1] + adds r0, r6, 0 + adds r1, r7, 0 + movs r2, 0x21 + movs r3, 0 + bl sub_81D2C68 + ldr r1, =0x0000642a + add r1, r8 + adds r1, r4 + strb r0, [r1] + adds r0, r6, 0 + adds r1, r7, 0 + movs r2, 0x18 + movs r3, 0 + bl sub_81D2C68 + ldr r1, =0x0000642b + add r1, r8 + adds r1, r4 + strb r0, [r1] + adds r0, r6, 0 + adds r1, r7, 0 + movs r2, 0x17 + movs r3, 0 + bl sub_81D2C68 + ldr r1, =0x0000642c + add r1, r8 + adds r1, r4 + strb r0, [r1] + movs r0, 0xCF + lsls r0, 7 + add r0, r8 + mov r2, r9 + adds r4, r0, r2 + adds r0, r6, 0 + adds r1, r7, 0 + movs r2, 0x30 + movs r3, 0 + bl sub_81D2C68 + cmp r0, 0xFF + beq _081CDB10 + adds r0, r6, 0 + adds r1, r7, 0 + movs r2, 0x30 + movs r3, 0 + bl sub_81D2C68 + movs r1, 0x1D + bl __udivsi3 + b _081CDB12 + .pool +_081CDB10: + movs r0, 0x9 +_081CDB12: + strb r0, [r4] + adds r0, r6, 0 + adds r1, r7, 0 + movs r2, 0x8 + movs r3, 0 + bl sub_81D2C68 + ldr r1, =0x00006783 + add r1, r8 + add r1, r9 + strb r0, [r1] + mov r0, r9 + adds r1, r5, r0 + ldr r2, =0x00006428 + adds r0, r1, r2 + add r0, r8 + lsls r1, 2 + adds r2, 0x14 + adds r1, r2 + add r1, r8 + bl sub_81D2754 + b _081CDB80 + .pool +_081CDB48: + movs r2, 0 + mov r0, r9 + lsls r5, r0, 2 + add r5, r9 + ldr r4, =0x00006428 + add r4, r8 + lsls r3, r5, 2 + mov r9, r2 + ldr r7, =0x0000643c + movs r6, 0x9B +_081CDB5C: + adds r0, r2, r5 + adds r0, r4, r0 + mov r1, r9 + strb r1, [r0] + lsls r0, r2, 2 + adds r0, r3 + add r0, r8 + adds r1, r0, r7 + strh r6, [r1] + ldr r1, =0x0000643e + adds r0, r1 + movs r1, 0x5B + strh r1, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x4 + bls _081CDB5C +_081CDB80: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CDA1C + + thumb_func_start sub_81CDB98 +sub_81CDB98: @ 81CDB98 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + movs r0, 0xB + bl sub_81C763C + adds r7, r0, 0 + movs r0, 0x12 + bl sub_81C763C + adds r4, r0, 0 + lsls r0, r6, 16 + asrs r5, r0, 16 + bl sub_81CDD5C + cmp r0, 0 + beq _081CDBCC + ldrh r0, [r4] + b _081CDBD0 +_081CDBCC: + ldrh r0, [r4] + subs r0, 0x1 +_081CDBD0: + cmp r5, r0 + beq _081CDC3E + lsls r0, r6, 16 + asrs r0, 14 + adds r0, r4, r0 + ldrb r5, [r0, 0x4] + ldrb r6, [r0, 0x5] + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0x41 + movs r3, 0 + bl sub_81D2C68 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_81D2C68 + mov r8, r0 + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0 + bl sub_81D2C68 + adds r5, r0, 0 + lsls r0, r4, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + mov r2, r9 + lsls r1, r2, 13 + movs r2, 0xC0 + lsls r2, 2 + adds r1, r2 + adds r1, r7, r1 + movs r2, 0x1 + str r2, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl DecompressMonPic + adds r0, r4, 0 + mov r1, r8 + adds r2, r5, 0 + bl species_and_otid_get_pal + mov r2, r9 + lsls r1, r2, 7 + adds r1, r7, r1 + bl LZ77UnCompWram +_081CDC3E: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CDB98 + + thumb_func_start sub_81CDC50 +sub_81CDC50: @ 81CDC50 + push {lr} + movs r0, 0x12 + bl sub_81C763C + ldrh r0, [r0] + pop {r1} + bx r1 + thumb_func_end sub_81CDC50 + + thumb_func_start sub_81CDC60 +sub_81CDC60: @ 81CDC60 + push {lr} + movs r0, 0x12 + bl sub_81C763C + ldrh r0, [r0, 0x2] + pop {r1} + bx r1 + thumb_func_end sub_81CDC60 + + thumb_func_start sub_81CDC70 +sub_81CDC70: @ 81CDC70 + push {lr} + movs r0, 0xB + bl sub_81C763C + ldr r1, =0x00006428 + adds r0, r1 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CDC70 + + thumb_func_start sub_81CDC84 +sub_81CDC84: @ 81CDC84 + push {lr} + movs r0, 0xB + bl sub_81C763C + ldr r1, =0x00006786 + adds r0, r1 + ldrb r0, [r0] + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CDC84 + + thumb_func_start sub_81CDC9C +sub_81CDC9C: @ 81CDC9C + push {lr} + movs r0, 0xB + bl sub_81C763C + ldr r1, =0x00006302 + adds r0, r1 + ldrb r0, [r0] + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CDC9C + + thumb_func_start sub_81CDCB4 +sub_81CDCB4: @ 81CDCB4 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0xB + bl sub_81C763C + lsls r4, 13 + movs r1, 0xC0 + lsls r1, 2 + adds r4, r1 + adds r0, r4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81CDCB4 + + thumb_func_start sub_81CDCD4 +sub_81CDCD4: @ 81CDCD4 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0xB + bl sub_81C763C + lsls r4, 7 + adds r0, r4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81CDCD4 + + thumb_func_start sub_81CDCEC +sub_81CDCEC: @ 81CDCEC + push {lr} + movs r0, 0xB + bl sub_81C763C + ldr r1, =0x00006789 + adds r0, r1 + ldrb r0, [r0] + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CDCEC + + thumb_func_start sub_81CDD04 +sub_81CDD04: @ 81CDD04 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0xB + bl sub_81C763C + lsls r4, 6 + ldr r1, =0x00006368 + adds r4, r1 + adds r0, r4 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CDD04 + + thumb_func_start sub_81CDD24 +sub_81CDD24: @ 81CDD24 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0xB + bl sub_81C763C + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 3 + ldr r2, =0x00006320 + adds r1, r2 + adds r0, r1 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CDD24 + + thumb_func_start sub_81CDD48 +sub_81CDD48: @ 81CDD48 + push {lr} + movs r0, 0x12 + bl sub_81C763C + ldrh r1, [r0, 0x2] + lsls r1, 2 + adds r0, r1 + ldrh r0, [r0, 0x6] + pop {r1} + bx r1 + thumb_func_end sub_81CDD48 + + thumb_func_start sub_81CDD5C +sub_81CDD5C: @ 81CDD5C + push {lr} + movs r0, 0xB + bl sub_81C763C + movs r1, 0xC6 + lsls r1, 7 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _081CDD74 + movs r0, 0 + b _081CDD76 +_081CDD74: + movs r0, 0x1 +_081CDD76: + pop {r1} + bx r1 + thumb_func_end sub_81CDD5C + + thumb_func_start sub_81CDD7C +sub_81CDD7C: @ 81CDD7C + push {lr} + movs r0, 0xB + bl sub_81C763C + adds r2, r0, 0 + movs r1, 0xC6 + lsls r1, 7 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _081CDD96 + movs r0, 0 + b _081CDDA6 +_081CDD96: + ldr r3, =0x00006786 + adds r0, r2, r3 + movs r1, 0 + ldrsb r1, [r0, r1] + subs r3, 0x3 + adds r0, r2, r3 + adds r0, r1 + ldrb r0, [r0] +_081CDDA6: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CDD7C + + thumb_func_start sub_81CDDB0 +sub_81CDDB0: @ 81CDDB0 + push {lr} + movs r0, 0xB + bl sub_81C763C + ldr r2, =0x00006786 + adds r1, r0, r2 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + subs r2, 0x6 + adds r0, r2 + adds r0, r1 + ldrb r0, [r0] + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CDDB0 + + thumb_func_start sub_81CDDD4 +sub_81CDDD4: @ 81CDDD4 + push {r4,lr} + ldr r1, =0x000038ac + movs r0, 0xC + bl sub_81C761C + adds r4, r0, 0 + cmp r4, 0 + beq _081CDE24 + ldr r0, =0x00001816 + adds r1, r4, r0 + movs r0, 0xFF + strb r0, [r1] + ldr r0, =sub_81CDE94 + movs r1, 0x1 + bl sub_81C7078 + str r0, [r4] + ldr r0, =0x00001810 + adds r1, r4, r0 + ldr r0, =sub_81CDE80 + str r0, [r1] + ldr r0, =0x00002908 + adds r1, r4, r0 + movs r0, 0 + strb r0, [r1] + movs r0, 0x1 + b _081CDE26 + .pool +_081CDE24: + movs r0, 0 +_081CDE26: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81CDDD4 + + thumb_func_start sub_81CDE2C +sub_81CDE2C: @ 81CDE2C + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0xC + bl sub_81C763C + adds r5, r0, 0 + ldr r0, =gUnknown_08623384 + lsls r4, 2 + adds r4, r0 + ldr r0, [r4] + movs r1, 0x1 + bl sub_81C7078 + str r0, [r5] + ldr r0, =0x00001810 + adds r5, r0 + ldr r0, =sub_81CDE80 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CDE2C + + thumb_func_start sub_81CDE64 +sub_81CDE64: @ 81CDE64 + push {lr} + movs r0, 0xC + bl sub_81C763C + ldr r1, =0x00001810 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CDE64 + + thumb_func_start sub_81CDE80 +sub_81CDE80: @ 81CDE80 + push {lr} + movs r0, 0xC + bl sub_81C763C + ldr r0, [r0] + bl sub_81C70D8 + pop {r1} + bx r1 + thumb_func_end sub_81CDE80 + + thumb_func_start sub_81CDE94 +sub_81CDE94: @ 81CDE94 + push {r4-r6,lr} + sub sp, 0xC + adds r4, r0, 0 + movs r0, 0xC + bl sub_81C763C + adds r5, r0, 0 + cmp r4, 0x14 + bls _081CDEA8 + b _081CE2C4 +_081CDEA8: + lsls r0, r4, 2 + ldr r1, =_081CDEB8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081CDEB8: + .4byte _081CDF0C + .4byte _081CDF18 + .4byte _081CDF94 + .4byte _081CDFB8 + .4byte _081CE030 + .4byte _081CE074 + .4byte _081CE0B0 + .4byte _081CE118 + .4byte _081CE120 + .4byte _081CE126 + .4byte _081CE136 + .4byte _081CE146 + .4byte _081CE156 + .4byte _081CE16C + .4byte _081CE1C8 + .4byte _081CE1EC + .4byte _081CE218 + .4byte _081CE23C + .4byte _081CE24A + .4byte _081CE25A + .4byte _081CE262 +_081CDF0C: + bl sub_81CD3C4 + cmp r0, 0x1 + beq _081CDF16 + b _081CE2C0 +_081CDF16: + b _081CDFB0 +_081CDF18: + ldr r0, =gUnknown_08623358 + movs r1, 0x3 + bl sub_81C7B54 + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + ldr r1, =0x00007940 + movs r0, 0 + bl SetGpuReg + ldr r1, =0x00000844 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x0000040b + movs r0, 0x52 + bl SetGpuReg + ldr r1, =gUnknown_08DC6548 + movs r0, 0 + str r0, [sp] + movs r0, 0x3 + b _081CDFA8 + .pool +_081CDF94: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _081CDFA2 + b _081CE2C0 +_081CDFA2: + ldr r1, =gUnknown_08623228 + str r0, [sp] + movs r0, 0x2 +_081CDFA8: + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram +_081CDFB0: + movs r0, 0 + b _081CE2C6 + .pool +_081CDFB8: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + beq _081CDFC4 + b _081CE2C0 +_081CDFC4: + ldr r0, =gUnknown_08DC6DFC + adds r4, r5, 0x4 + adds r1, r4, 0 + bl LZ77UnCompVram + movs r0, 0x3 + adds r1, r4, 0 + bl SetBgTilemapBuffer + bl sub_81CDD5C + cmp r0, 0x1 + bne _081CDFF2 + ldr r1, =gUnknown_08DC7070 + movs r0, 0x9 + str r0, [sp] + movs r0, 0x4 + str r0, [sp, 0x4] + movs r0, 0x3 + movs r2, 0 + movs r3, 0x5 + bl CopyToBgTilemapBufferRect +_081CDFF2: + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + ldr r0, =gUnknown_08DC6528 + movs r1, 0x10 + movs r2, 0x20 + bl sub_81C7944 + ldr r0, =gUnknown_08623208 + movs r1, 0xF0 + movs r2, 0x20 + bl sub_81C7944 + ldr r0, =0x00001814 + adds r1, r5, r0 + ldr r0, =0x0000ffb0 + strh r0, [r1] + b _081CDFB0 + .pool +_081CE030: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + beq _081CE03C + b _081CE2C0 +_081CE03C: + ldr r0, =gUnknown_0862323C + ldr r1, =0x00001004 + adds r4, r5, r1 + adds r1, r4, 0 + bl LZ77UnCompVram + movs r0, 0x2 + adds r1, r4, 0 + bl SetBgTilemapBuffer + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + ldr r0, =gUnknown_086231E8 + movs r1, 0x30 + movs r2, 0x20 + bl sub_81C7944 + movs r0, 0x2 + bl sub_81D21DC + b _081CDFB0 + .pool +_081CE074: + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8199DF0 + movs r0, 0x1 + movs r1, 0x11 + movs r2, 0x1 + movs r3, 0x1 + bl sub_8199DF0 + movs r0, 0 + str r0, [sp, 0x8] + ldr r2, =0x00000804 + adds r4, r5, r2 + ldr r2, =0x05000200 + add r0, sp, 0x8 + adds r1, r4, 0 + bl CpuSet + movs r0, 0x1 + adds r1, r4, 0 + bl SetBgTilemapBuffer + b _081CDFB0 + .pool +_081CE0B0: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + beq _081CE0BC + b _081CE2C0 +_081CE0BC: + ldr r0, =gUnknown_08623364 + bl AddWindow + movs r2, 0xC1 + lsls r2, 5 + adds r1, r5, r2 + strb r0, [r1] + bl sub_81CDD5C + cmp r0, 0x1 + bne _081CE0F6 + ldr r0, =gUnknown_0862336C + bl AddWindow + ldr r2, =0x00001821 + adds r1, r5, r2 + strb r0, [r1] + ldr r0, =gUnknown_08623374 + bl AddWindow + ldr r2, =0x00001822 + adds r1, r5, r2 + strb r0, [r1] + ldr r0, =gUnknown_0862337C + bl AddWindow + ldr r2, =0x00001823 + adds r1, r5, r2 + strb r0, [r1] +_081CE0F6: + bl DeactivateAllTextPrinters + b _081CDFB0 + .pool +_081CE118: + movs r0, 0 + bl sub_81CED30 + b _081CDFB0 +_081CE120: + bl sub_81CE9E4 + b _081CDFB0 +_081CE126: + bl sub_81CDD5C + cmp r0, 0x1 + beq _081CE130 + b _081CDFB0 +_081CE130: + bl sub_81CE934 + b _081CDFB0 +_081CE136: + bl sub_81CDC84 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 8 + lsrs r1, 16 + movs r0, 0 + b _081CE164 +_081CE146: + bl sub_81CDC84 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 8 + lsrs r1, 16 + movs r0, 0x1 + b _081CE164 +_081CE156: + bl sub_81CDC84 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 8 + lsrs r1, 16 + movs r0, 0x2 +_081CE164: + movs r2, 0x1 + bl sub_81CE754 + b _081CDFB0 +_081CE16C: + bl sub_81CDC84 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 8 + lsrs r1, 16 + movs r0, 0x3 + movs r2, 0x1 + bl sub_81CE754 + cmp r0, 0x1 + beq _081CE186 + b _081CE2C0 +_081CE186: + movs r1, 0xC1 + lsls r1, 5 + adds r0, r5, r1 + ldrb r0, [r0] + bl PutWindowTilemap + bl sub_81CDD5C + cmp r0, 0x1 + beq _081CE19C + b _081CDFB0 +_081CE19C: + ldr r2, =0x00001821 + adds r0, r5, r2 + ldrb r0, [r0] + bl PutWindowTilemap + ldr r1, =0x00001822 + adds r0, r5, r1 + ldrb r0, [r0] + bl PutWindowTilemap + ldr r2, =0x00001823 + adds r0, r5, r2 + ldrb r0, [r0] + bl PutWindowTilemap + b _081CDFB0 + .pool +_081CE1C8: + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl HideBg + movs r0, 0x3 + bl ShowBg + bl sub_81CDD5C + cmp r0, 0x1 + beq _081CE1E4 + b _081CDFB0 +_081CE1E4: + movs r0, 0x4 + bl sub_81C7BA4 + b _081CDFB0 +_081CE1EC: + movs r0, 0x1 + bl sub_81C7AC0 + bl sub_81CDD5C + cmp r0, 0 + beq _081CE1FC + b _081CDFB0 +_081CE1FC: + movs r0, 0x6 + bl sub_81C7DFC + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + bl sub_81C7FA0 + movs r0, 0x6 + movs r1, 0x1 + movs r2, 0 + bl sub_81C7FA0 + b _081CDFB0 +_081CE218: + bl sub_81C7B34 + cmp r0, 0 + bne _081CE2C0 + bl sub_81CDD5C + cmp r0, 0 + bne _081CE230 + bl sub_81C8010 + cmp r0, 0 + bne _081CE2C0 +_081CE230: + ldr r0, =sub_81CEE44 + bl c3args_set_0toR1_1to0 + b _081CDFB0 + .pool +_081CE23C: + bl sub_81CEE90 + bl sub_81CDC70 + bl sub_81D20AC + b _081CDFB0 +_081CE24A: + bl sub_81CDC70 + bl sub_81D20BC + lsls r0, 24 + cmp r0, 0 + bne _081CE2C0 + b _081CDFB0 +_081CE25A: + movs r0, 0x1 + bl sub_81CEE74 + b _081CDFB0 +_081CE262: + bl sub_81CDC70 + ldr r2, =0x00001814 + adds r1, r5, r2 + bl sub_81D3178 + lsls r0, 24 + cmp r0, 0 + bne _081CE2C0 + ldr r0, =0x000028e0 + adds r6, r5, r0 + adds r0, r6, 0 + bl sub_81D3464 + bl sub_81CDD5C + cmp r0, 0x1 + beq _081CE298 + bl sub_81CDC60 + adds r4, r0, 0 + bl sub_81CDC50 + lsls r4, 16 + lsls r0, 16 + cmp r4, r0 + beq _081CE2C4 +_081CE298: + ldr r1, =0x00001816 + adds r0, r5, r1 + ldrb r4, [r0] + bl sub_81CDDB0 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_81D3480 + b _081CE2C4 + .pool +_081CE2C0: + movs r0, 0x2 + b _081CE2C6 +_081CE2C4: + movs r0, 0x4 +_081CE2C6: + add sp, 0xC + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81CDE94 + + thumb_func_start sub_81CE2D0 +sub_81CE2D0: @ 81CE2D0 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0xC + bl sub_81C763C + adds r5, r0, 0 + cmp r4, 0x1 + beq _081CE308 + cmp r4, 0x1 + bgt _081CE2EA + cmp r4, 0 + beq _081CE2F4 + b _081CE374 +_081CE2EA: + cmp r4, 0x2 + beq _081CE328 + cmp r4, 0x3 + beq _081CE33E + b _081CE374 +_081CE2F4: + bl sub_81CEEC8 + ldr r1, =0x000028e0 + adds r0, r5, r1 + bl sub_81D3520 + movs r0, 0x1 + b _081CE376 + .pool +_081CE308: + bl sub_81CDC70 + ldr r2, =0x00001814 + adds r1, r5, r2 + bl sub_81D31A4 + lsls r0, 24 + cmp r0, 0 + bne _081CE34E + movs r0, 0 + bl sub_81CEE74 + movs r0, 0x1 + b _081CE376 + .pool +_081CE328: + movs r0, 0 + bl sub_81C7AC0 + bl sub_81CDD5C + cmp r0, 0 + bne _081CE33A + bl sub_81C78A0 +_081CE33A: + movs r0, 0 + b _081CE376 +_081CE33E: + bl sub_81C7B34 + cmp r0, 0 + bne _081CE34E + bl sub_81C78C0 + cmp r0, 0 + beq _081CE352 +_081CE34E: + movs r0, 0x2 + b _081CE376 +_081CE352: + ldr r1, =0x000028e0 + adds r0, r5, r1 + bl sub_81D354C + movs r0, 0x1 + bl HideBg + movs r0, 0x2 + bl HideBg + movs r0, 0x3 + bl HideBg + movs r0, 0x1 + b _081CE376 + .pool +_081CE374: + movs r0, 0x4 +_081CE376: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81CE2D0 + + thumb_func_start sub_81CE37C +sub_81CE37C: @ 81CE37C + push {r4-r6,lr} + adds r4, r0, 0 + movs r0, 0xC + bl sub_81C763C + adds r6, r0, 0 + bl sub_81CDC70 + adds r2, r0, 0 + cmp r4, 0x9 + bls _081CE394 + b _081CE4D0 +_081CE394: + lsls r0, r4, 2 + ldr r1, =_081CE3A4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081CE3A4: + .4byte _081CE3CC + .4byte _081CE3D0 + .4byte _081CE3DA + .4byte _081CE3F0 + .4byte _081CE3F8 + .4byte _081CE418 + .4byte _081CE428 + .4byte _081CE438 + .4byte _081CE44E + .4byte _081CE468 +_081CE3CC: + movs r0, 0 + b _081CE3D2 +_081CE3D0: + movs r0, 0x1 +_081CE3D2: + bl sub_81CD548 +_081CE3D6: + movs r0, 0x1 + b _081CE4D2 +_081CE3DA: + movs r0, 0x2 + bl sub_81CD548 + ldr r1, =0x000028e0 + adds r0, r6, r1 + bl sub_81D3520 + b _081CE3D6 + .pool +_081CE3F0: + adds r0, r2, 0 + bl sub_81D2074 + b _081CE3D6 +_081CE3F8: + ldr r1, =0x00001814 + adds r0, r6, r1 + bl sub_81D3150 + lsls r0, 24 + cmp r0, 0 + bne _081CE4CC + bl sub_81CDC84 + lsls r0, 24 + lsrs r0, 24 + bl sub_81CED30 + b _081CE3D6 + .pool +_081CE418: + bl sub_81CDC84 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 8 + lsrs r1, 16 + movs r0, 0 + b _081CE446 +_081CE428: + bl sub_81CDC84 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 8 + lsrs r1, 16 + movs r0, 0x1 + b _081CE446 +_081CE438: + bl sub_81CDC84 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 8 + lsrs r1, 16 + movs r0, 0x2 +_081CE446: + movs r2, 0 + bl sub_81CE754 + b _081CE3D6 +_081CE44E: + bl sub_81CDC84 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 8 + lsrs r1, 16 + movs r0, 0x3 + movs r2, 0 + bl sub_81CE754 + cmp r0, 0x1 + beq _081CE3D6 + b _081CE4CC +_081CE468: + bl sub_81CDC70 + adds r2, r0, 0 + ldr r0, =0x00001814 + adds r1, r6, r0 + adds r0, r2, 0 + bl sub_81D3178 + lsls r0, 24 + cmp r0, 0 + bne _081CE4CC + ldr r1, =0x000028e0 + adds r0, r6, r1 + bl sub_81D3464 + bl sub_81CDD5C + cmp r0, 0x1 + beq _081CE4A0 + bl sub_81CDC60 + adds r4, r0, 0 + bl sub_81CDC50 + lsls r4, 16 + lsls r0, 16 + cmp r4, r0 + beq _081CE3D6 +_081CE4A0: + ldr r0, =0x000028e0 + adds r5, r6, r0 + ldr r1, =0x00001816 + adds r0, r6, r1 + ldrb r4, [r0] + bl sub_81CDDB0 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81D3480 + b _081CE3D6 + .pool +_081CE4CC: + movs r0, 0x2 + b _081CE4D2 +_081CE4D0: + movs r0, 0x4 +_081CE4D2: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81CE37C + + thumb_func_start sub_81CE4D8 +sub_81CE4D8: @ 81CE4D8 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0xC + bl sub_81C763C + adds r5, r0, 0 + cmp r4, 0x8 + bhi _081CE5DC + lsls r0, r4, 2 + ldr r1, =_081CE4F8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081CE4F8: + .4byte _081CE51C + .4byte _081CE520 + .4byte _081CE524 + .4byte _081CE52E + .4byte _081CE53E + .4byte _081CE54E + .4byte _081CE55E + .4byte _081CE576 + .4byte _081CE592 +_081CE51C: + movs r0, 0 + b _081CE526 +_081CE520: + movs r0, 0x1 + b _081CE526 +_081CE524: + movs r0, 0x2 +_081CE526: + bl sub_81CD548 + movs r0, 0x1 + b _081CE5DE +_081CE52E: + bl sub_81CDC84 + lsls r0, 24 + lsrs r0, 24 + bl sub_81CED30 + movs r0, 0x1 + b _081CE5DE +_081CE53E: + bl sub_81CDC84 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 8 + lsrs r1, 16 + movs r0, 0 + b _081CE56C +_081CE54E: + bl sub_81CDC84 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 8 + lsrs r1, 16 + movs r0, 0x1 + b _081CE56C +_081CE55E: + bl sub_81CDC84 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 8 + lsrs r1, 16 + movs r0, 0x2 +_081CE56C: + movs r2, 0 + bl sub_81CE754 + movs r0, 0x1 + b _081CE5DE +_081CE576: + bl sub_81CDC84 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 8 + lsrs r1, 16 + movs r0, 0x3 + movs r2, 0 + bl sub_81CE754 + cmp r0, 0x1 + bne _081CE5D8 + movs r0, 0x1 + b _081CE5DE +_081CE592: + bl sub_81CDC70 + ldr r2, =0x00001814 + adds r1, r5, r2 + bl sub_81D3178 + lsls r0, 24 + cmp r0, 0 + bne _081CE5D8 + ldr r0, =0x000028e0 + adds r4, r5, r0 + adds r0, r4, 0 + bl sub_81D3464 + ldr r1, =0x00001816 + adds r0, r5, r1 + ldrb r5, [r0] + bl sub_81CDDB0 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81D3480 + movs r0, 0x1 + b _081CE5DE + .pool +_081CE5D8: + movs r0, 0x2 + b _081CE5DE +_081CE5DC: + movs r0, 0x4 +_081CE5DE: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81CE4D8 + + thumb_func_start sub_81CE5E4 +sub_81CE5E4: @ 81CE5E4 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0xC + bl sub_81C763C + adds r5, r0, 0 + cmp r4, 0x7 + bhi _081CE6B2 + lsls r0, r4, 2 + ldr r1, =_081CE604 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081CE604: + .4byte _081CE624 + .4byte _081CE628 + .4byte _081CE632 + .4byte _081CE648 + .4byte _081CE660 + .4byte _081CE670 + .4byte _081CE680 + .4byte _081CE696 +_081CE624: + movs r0, 0 + b _081CE62A +_081CE628: + movs r0, 0x1 +_081CE62A: + bl sub_81CD548 +_081CE62E: + movs r0, 0x1 + b _081CE6B4 +_081CE632: + movs r0, 0x2 + bl sub_81CD548 + ldr r1, =0x000028e0 + adds r0, r5, r1 + bl sub_81D3520 + b _081CE62E + .pool +_081CE648: + bl sub_81CDC70 + ldr r2, =0x00001814 + adds r1, r5, r2 + bl sub_81D31A4 + lsls r0, 24 + cmp r0, 0 + beq _081CE62E + b _081CE6AE + .pool +_081CE660: + bl sub_81CDC84 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 8 + lsrs r1, 16 + movs r0, 0 + b _081CE68E +_081CE670: + bl sub_81CDC84 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 8 + lsrs r1, 16 + movs r0, 0x1 + b _081CE68E +_081CE680: + bl sub_81CDC84 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 8 + lsrs r1, 16 + movs r0, 0x2 +_081CE68E: + movs r2, 0 + bl sub_81CE754 + b _081CE62E +_081CE696: + bl sub_81CDC84 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 8 + lsrs r1, 16 + movs r0, 0x3 + movs r2, 0 + bl sub_81CE754 + cmp r0, 0x1 + beq _081CE62E +_081CE6AE: + movs r0, 0x2 + b _081CE6B4 +_081CE6B2: + movs r0, 0x4 +_081CE6B4: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81CE5E4 + + thumb_func_start sub_81CE6BC +sub_81CE6BC: @ 81CE6BC + push {lr} + cmp r0, 0x1 + beq _081CE6E6 + cmp r0, 0x1 + bgt _081CE6CC + cmp r0, 0 + beq _081CE6D2 + b _081CE6FA +_081CE6CC: + cmp r0, 0x2 + beq _081CE6EE + b _081CE6FA +_081CE6D2: + bl sub_81CDD7C + lsls r0, 24 + lsrs r0, 24 + movs r1, 0xB0 + movs r2, 0x20 + bl sub_811FAA4 +_081CE6E2: + movs r0, 0x1 + b _081CE6FC +_081CE6E6: + movs r0, 0x5 + bl sub_81C7BA4 + b _081CE6E2 +_081CE6EE: + bl sub_81C7BE8 + cmp r0, 0x1 + bne _081CE6E2 + movs r0, 0x2 + b _081CE6FC +_081CE6FA: + movs r0, 0x4 +_081CE6FC: + pop {r1} + bx r1 + thumb_func_end sub_81CE6BC + + thumb_func_start sub_81CE700 +sub_81CE700: @ 81CE700 + push {lr} + cmp r0, 0x1 + beq _081CE71E + cmp r0, 0x1 + bgt _081CE710 + cmp r0, 0 + beq _081CE716 + b _081CE732 +_081CE710: + cmp r0, 0x2 + beq _081CE726 + b _081CE732 +_081CE716: + bl sub_811FAF8 +_081CE71A: + movs r0, 0x1 + b _081CE734 +_081CE71E: + movs r0, 0x4 + bl sub_81C7BA4 + b _081CE71A +_081CE726: + bl sub_81C7BE8 + cmp r0, 0x1 + bne _081CE71A + movs r0, 0x2 + b _081CE734 +_081CE732: + movs r0, 0x4 +_081CE734: + pop {r1} + bx r1 + thumb_func_end sub_81CE700 + + thumb_func_start sub_81CE738 +sub_81CE738: @ 81CE738 + push {lr} + lsls r1, 16 + lsrs r1, 16 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalString + ldr r1, =gUnknown_085EBFD7 + bl CopyString + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CE738 + + thumb_func_start sub_81CE754 +sub_81CE754: @ 81CE754 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x2C + lsls r0, 24 + lsrs r4, r0, 24 + adds r7, r4, 0 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + lsls r2, 24 + lsrs r5, r2, 24 + movs r0, 0xC + bl sub_81C763C + adds r6, r0, 0 + cmp r4, 0x1 + beq _081CE7B8 + cmp r4, 0x1 + bgt _081CE782 + cmp r4, 0 + beq _081CE78E + b _081CE924 +_081CE782: + cmp r4, 0x2 + beq _081CE800 + cmp r4, 0x3 + bne _081CE78C + b _081CE89C +_081CE78C: + b _081CE924 +_081CE78E: + movs r1, 0xC1 + lsls r1, 5 + adds r0, r6, r1 + ldrb r0, [r0] + movs r1, 0 + bl FillWindowPixelBuffer + bl sub_81CDD5C + cmp r0, 0x1 + beq _081CE7A6 + b _081CE924 +_081CE7A6: + ldr r1, =0x00001821 + adds r0, r6, r1 + ldrb r0, [r0] + movs r1, 0 + bl FillWindowPixelBuffer + b _081CE924 + .pool +_081CE7B8: + bl sub_81CDC60 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl sub_81CDC50 + lsls r0, 16 + lsrs r0, 16 + subs r0, 0x1 + cmp r4, r0 + bne _081CE7DA + bl sub_81CDD5C + cmp r0, 0x1 + beq _081CE7DA + b _081CE924 +_081CE7DA: + mov r1, r8 + lsls r0, r1, 24 + lsrs r0, 24 + bl sub_81CDD04 + adds r2, r0, 0 + movs r1, 0xC1 + lsls r1, 5 + adds r0, r6, r1 + ldrb r0, [r0] + str r7, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + b _081CE924 +_081CE800: + bl sub_81CDD5C + adds r7, r0, 0 + cmp r7, 0x1 + beq _081CE80C + b _081CE924 +_081CE80C: + mov r1, r8 + lsls r0, r1, 24 + lsrs r0, 24 + bl sub_81CDD24 + adds r2, r0, 0 + movs r1, 0xC1 + lsls r1, 5 + adds r0, r6, r1 + ldrb r0, [r0] + movs r1, 0x11 + str r1, [sp] + movs r4, 0 + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + add r1, sp, 0xC + movs r0, 0xFC + strb r0, [r1] + movs r0, 0x4 + strb r0, [r1, 0x1] + movs r0, 0x8 + strb r0, [r1, 0x2] + adds r0, r1, 0 + strb r4, [r0, 0x3] + movs r0, 0x9 + strb r0, [r1, 0x4] + mov r5, sp + adds r5, 0x11 + ldr r1, =gUnknown_085EBFD7 + adds r0, r5, 0 + bl CopyString + ldr r0, =0x00001821 + adds r6, r0 + ldrb r0, [r6] + str r7, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + add r2, sp, 0xC + movs r3, 0x4 + bl Print + bl sub_81CDD48 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalString + ldrb r0, [r6] + str r7, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + add r2, sp, 0xC + movs r3, 0x1C + bl Print + b _081CE924 + .pool +_081CE89C: + ldr r1, =0x00002908 + adds r0, r6, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _081CE8B0 + cmp r0, 0x1 + beq _081CE8EC + b _081CE924 + .pool +_081CE8B0: + cmp r5, 0 + beq _081CE8C4 + movs r1, 0xC1 + lsls r1, 5 + adds r0, r6, r1 + ldrb r0, [r0] + movs r1, 0x3 + bl CopyWindowToVram + b _081CE8D2 +_081CE8C4: + movs r1, 0xC1 + lsls r1, 5 + adds r0, r6, r1 + ldrb r0, [r0] + movs r1, 0x2 + bl CopyWindowToVram +_081CE8D2: + bl sub_81CDD5C + cmp r0, 0x1 + bne _081CE910 + ldr r0, =0x00002908 + adds r1, r6, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _081CE924 + .pool +_081CE8EC: + cmp r5, 0 + beq _081CE904 + ldr r1, =0x00001821 + adds r0, r6, r1 + ldrb r0, [r0] + movs r1, 0x3 + bl CopyWindowToVram + b _081CE910 + .pool +_081CE904: + ldr r1, =0x00001821 + adds r0, r6, r1 + ldrb r0, [r0] + movs r1, 0x2 + bl CopyWindowToVram +_081CE910: + ldr r0, =0x00002908 + adds r1, r6, r0 + movs r0, 0 + strb r0, [r1] + movs r0, 0x1 + b _081CE926 + .pool +_081CE924: + movs r0, 0 +_081CE926: + add sp, 0x2C + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81CE754 + + thumb_func_start sub_81CE934 +sub_81CE934: @ 81CE934 + push {r4,lr} + movs r0, 0xC + bl sub_81C763C + adds r4, r0, 0 + ldr r1, =0x00001822 + adds r0, r4, r1 + ldrb r0, [r0] + movs r1, 0x3 + bl CopyWindowToVram + ldr r0, =0x00001823 + adds r4, r0 + ldrb r0, [r4] + movs r1, 0x3 + bl CopyWindowToVram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CE934 + + thumb_func_start sub_81CE964 +sub_81CE964: @ 81CE964 + push {r4,r5,lr} + adds r5, r0, 0 + movs r0, 0x2E + ldrsh r4, [r5, r0] + bl sub_81CDC60 + lsls r0, 16 + lsrs r0, 16 + cmp r4, r0 + bne _081CE982 + adds r0, r5, 0 + movs r1, 0 + bl StartObjectImageAnim + b _081CE98A +_081CE982: + adds r0, r5, 0 + movs r1, 0x1 + bl StartObjectImageAnim +_081CE98A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81CE964 + + thumb_func_start sub_81CE990 +sub_81CE990: @ 81CE990 + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_81CDC60 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl sub_81CDC50 + lsls r0, 16 + lsrs r0, 16 + subs r0, 0x1 + cmp r4, r0 + bne _081CE9B0 + movs r0, 0x65 + b _081CE9B2 +_081CE9B0: + movs r0, 0x66 +_081CE9B2: + bl IndexOfObjectPaletteTag + lsls r0, 4 + ldrb r2, [r5, 0x5] + movs r1, 0xF + ands r1, r2 + orrs r1, r0 + strb r1, [r5, 0x5] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81CE990 + + thumb_func_start sub_81CE9C8 +sub_81CE9C8: @ 81CE9C8 + push {r4,lr} + adds r4, r0, 0 + bl sub_81CDD7C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81CE9C8 + + thumb_func_start sub_81CE9E4 +sub_81CE9E4: @ 81CE9E4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x58 + movs r0, 0xC + bl sub_81C763C + adds r6, r0, 0 + add r4, sp, 0x20 + add r5, sp, 0x38 + mov r0, sp + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_81D321C + bl sub_81CDD5C + adds r7, r4, 0 + mov r10, r5 + cmp r0, 0x1 + bne _081CEA78 + ldr r1, =0x00001824 + adds r0, r6, r1 + movs r2, 0x6A + strh r2, [r0] + ldr r3, =0x00001826 + adds r1, r6, r3 + strh r2, [r1] + bl sub_811F90C + bl sub_811FA90 + ldr r2, =gUnknown_08623338 + movs r0, 0x69 + movs r1, 0x69 + bl sub_811FF94 + ldrb r1, [r0, 0x5] + movs r2, 0xC + orrs r1, r2 + strb r1, [r0, 0x5] + movs r1, 0xC0 + strh r1, [r0, 0x20] + movs r1, 0x20 + strh r1, [r0, 0x22] + ldr r1, =sub_81CE9C8 + str r1, [r0, 0x1C] + ldr r2, =0x000028dc + adds r1, r6, r2 + str r0, [r1] + movs r0, 0x69 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_81C7990 + add r3, sp, 0x50 + mov r8, r3 + b _081CEBC6 + .pool +_081CEA78: + mov r0, sp + bl LoadObjectPics + mov r0, r10 + bl sub_81C795C + movs r4, 0 + add r0, sp, 0x50 + mov r8, r0 + b _081CEAE8 +_081CEA8C: + lsls r2, r4, 2 + adds r2, r4 + lsls r2, 18 + movs r1, 0x80 + lsls r1, 12 + adds r2, r1 + asrs r2, 16 + adds r0, r7, 0 + movs r1, 0xE2 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x40 + beq _081CEAD8 + ldr r2, =0x00001806 + adds r0, r6, r2 + adds r0, r4 + strb r3, [r0] + ldr r2, =0x02020630 + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + adds r1, r0, r2 + strh r4, [r1, 0x2E] + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_81CE964 + str r1, [r0] + b _081CEAE2 + .pool +_081CEAD8: + ldr r3, =0x00001806 + adds r0, r6, r3 + adds r0, r4 + movs r1, 0xFF + strb r1, [r0] +_081CEAE2: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_081CEAE8: + bl sub_81CDC50 + lsls r0, 16 + lsrs r0, 16 + subs r0, 0x1 + cmp r4, r0 + blt _081CEA8C + movs r0, 0x67 + strh r0, [r7] + ldr r0, =DummyObjectCallback + str r0, [r7, 0x14] + cmp r4, 0x5 + bhi _081CEB5C + ldr r0, =0x00001806 + adds r5, r6, r0 + ldr r1, =0x02020630 + mov r9, r1 +_081CEB0A: + lsls r2, r4, 2 + adds r2, r4 + lsls r2, 18 + movs r3, 0x80 + lsls r3, 12 + adds r2, r3 + asrs r2, 16 + adds r0, r7, 0 + movs r1, 0xE6 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x40 + beq _081CEB4C + adds r0, r5, r4 + strb r3, [r0] + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + add r1, r9 + ldrb r2, [r1, 0x3] + movs r0, 0x3F + ands r0, r2 + strb r0, [r1, 0x3] + b _081CEB52 + .pool +_081CEB4C: + adds r1, r5, r4 + movs r0, 0xFF + strb r0, [r1] +_081CEB52: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x5 + bls _081CEB0A +_081CEB5C: + movs r0, 0x66 + strh r0, [r7] + ldr r0, =sub_81CE990 + str r0, [r7, 0x14] + lsls r2, r4, 2 + adds r2, r4 + lsls r2, 18 + movs r0, 0x80 + lsls r0, 12 + adds r2, r0 + asrs r2, 16 + adds r0, r7, 0 + movs r1, 0xDE + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x40 + beq _081CEBBC + ldr r1, =0x00001806 + adds r0, r6, r1 + adds r0, r4 + strb r3, [r0] + ldr r0, =0x02020630 + lsls r2, r3, 4 + adds r2, r3 + lsls r2, 2 + adds r2, r0 + ldrb r3, [r2, 0x1] + movs r1, 0x3F + adds r0, r1, 0 + ands r0, r3 + movs r3, 0x40 + orrs r0, r3 + strb r0, [r2, 0x1] + ldrb r0, [r2, 0x3] + ands r1, r0 + movs r0, 0x80 + orrs r1, r0 + strb r1, [r2, 0x3] + b _081CEBC6 + .pool +_081CEBBC: + ldr r2, =0x00001806 + adds r0, r6, r2 + adds r0, r4 + movs r1, 0xFF + strb r1, [r0] +_081CEBC6: + mov r0, r8 + mov r1, r10 + bl sub_81D32B0 + mov r0, r8 + bl LoadObjectPic + movs r0, 0 + mov r3, r10 + str r0, [r3, 0x8] + mov r0, r10 + bl sub_81C795C + add sp, 0x58 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CE9E4 + + thumb_func_start sub_81CEBF4 +sub_81CEBF4: @ 81CEBF4 + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_81CDD5C + cmp r0, 0x1 + bne _081CEC28 + ldr r1, =0x000028dc + adds r0, r5, r1 + ldr r0, [r0] + bl RemoveObjectAndFreeTiles + movs r0, 0x6A + bl FreeObjectTilesByTag + movs r0, 0x69 + bl FreeObjectTilesByTag + movs r0, 0x6A + bl FreeObjectPaletteByTag + movs r0, 0x69 + bl FreeObjectPaletteByTag + b _081CEC68 + .pool +_081CEC28: + movs r4, 0 +_081CEC2A: + ldr r1, =0x00001806 + adds r0, r5, r1 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x6 + bls _081CEC2A + movs r0, 0x65 + bl FreeObjectTilesByTag + movs r0, 0x66 + bl FreeObjectTilesByTag + movs r0, 0x67 + bl FreeObjectTilesByTag + movs r0, 0x65 + bl FreeObjectPaletteByTag + movs r0, 0x66 + bl FreeObjectPaletteByTag +_081CEC68: + ldr r0, =0x00001816 + adds r1, r5, r0 + ldrb r0, [r1] + cmp r0, 0xFF + beq _081CEC8E + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + movs r0, 0x64 + bl FreeObjectTilesByTag + movs r0, 0x64 + bl FreeObjectPaletteByTag +_081CEC8E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CEBF4 + + thumb_func_start sub_81CECA0 +sub_81CECA0: @ 81CECA0 + push {r4,lr} + movs r0, 0xC + bl sub_81C763C + adds r4, r0, 0 + movs r1, 0xC1 + lsls r1, 5 + adds r0, r4, r1 + ldrb r0, [r0] + bl RemoveWindow + bl sub_81CDD5C + cmp r0, 0x1 + bne _081CECEC + ldr r1, =0x00001821 + adds r0, r4, r1 + ldrb r0, [r0] + bl RemoveWindow + ldr r1, =0x00001822 + adds r0, r4, r1 + ldrb r0, [r0] + bl RemoveWindow + ldr r1, =0x00001823 + adds r0, r4, r1 + ldrb r0, [r0] + bl RemoveWindow + b _081CECF0 + .pool +_081CECEC: + bl sub_81C7FDC +_081CECF0: + movs r1, 0x8A + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + adds r0, r4, 0 + bl sub_81CEBF4 + bl sub_81CEE68 + movs r0, 0xC + bl sub_81C7650 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81CECA0 + + thumb_func_start sub_81CED10 +sub_81CED10: @ 81CED10 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0xC + bl sub_81C763C + ldr r1, =0x00001814 + adds r0, r1 + ldrh r0, [r0] + adds r0, 0x26 + strh r0, [r4, 0x20] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CED10 + + thumb_func_start sub_81CED30 +sub_81CED30: @ 81CED30 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x28 + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0xC + bl sub_81C763C + mov r8, r0 + ldr r7, =0x00001816 + add r7, r8 + ldrb r0, [r7] + cmp r0, 0xFF + bne _081CEDFC + add r5, sp, 0x18 + add r4, sp, 0x20 + adds r0, r5, 0 + mov r1, sp + adds r2, r4, 0 + bl sub_81D31D0 + adds r0, r6, 0 + bl sub_81CDCB4 + str r0, [sp, 0x18] + adds r0, r6, 0 + bl sub_81CDCD4 + str r0, [sp, 0x20] + adds r0, r4, 0 + bl LoadTaggedObjectPalette + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x00001818 + add r4, r8 + strh r0, [r4] + adds r0, r5, 0 + bl LoadObjectPic + ldr r5, =0x0000181a + add r5, r8 + strh r0, [r5] + mov r0, sp + movs r1, 0x26 + movs r2, 0x68 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + strb r0, [r7] + cmp r0, 0x40 + bne _081CEDBC + movs r0, 0x64 + bl FreeObjectTilesByTag + movs r0, 0x64 + bl FreeObjectPaletteByTag + movs r0, 0xFF + strb r0, [r7] + b _081CEE26 + .pool +_081CEDBC: + strb r0, [r7] + ldr r2, =0x02020630 + ldrb r1, [r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_81CED10 + str r1, [r0] + ldr r1, =0x0000181c + add r1, r8 + ldrh r0, [r5] + lsls r0, 5 + ldr r2, =0x06010000 + adds r0, r2 + str r0, [r1] + ldrh r0, [r4] + lsls r0, 4 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + strh r0, [r4] + b _081CEE26 + .pool +_081CEDFC: + adds r0, r6, 0 + bl sub_81CDCB4 + ldr r1, =0x0000181c + add r1, r8 + ldr r2, [r1] + ldr r1, =0x040000d4 + str r0, [r1] + str r2, [r1, 0x4] + ldr r0, =0x80000400 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r0, r6, 0 + bl sub_81CDCD4 + ldr r1, =0x00001818 + add r1, r8 + ldrh r1, [r1] + movs r2, 0x20 + bl gpu_pal_apply +_081CEE26: + add sp, 0x28 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CED30 + + thumb_func_start sub_81CEE44 +sub_81CEE44: @ 81CEE44 + push {r4,lr} + bl sub_81CDC70 + adds r4, r0, 0 + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + adds r0, r4, 0 + bl sub_81D2108 + bl sub_80BA0A8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81CEE44 + + thumb_func_start sub_81CEE68 +sub_81CEE68: @ 81CEE68 + push {lr} + bl sub_81C760C + pop {r0} + bx r0 + thumb_func_end sub_81CEE68 + + thumb_func_start sub_81CEE74 +sub_81CEE74: @ 81CEE74 + push {lr} + lsls r0, 24 + cmp r0, 0 + beq _081CEE84 + movs r0, 0x2 + bl ShowBg + b _081CEE8A +_081CEE84: + movs r0, 0x2 + bl HideBg +_081CEE8A: + pop {r0} + bx r0 + thumb_func_end sub_81CEE74 + + thumb_func_start sub_81CEE90 +sub_81CEE90: @ 81CEE90 + push {r4,lr} + bl sub_81CDC70 + adds r4, r0, 0 + bl sub_81CDC84 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x030012bc + strb r0, [r1] + adds r1, r4, 0 + adds r1, 0x50 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 2 + adds r2, 0x14 + adds r2, r4, r2 + adds r0, r4, 0 + bl sub_81D1F84 + adds r0, r4, 0 + bl sub_81D2074 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CEE90 + + thumb_func_start sub_81CEEC8 +sub_81CEEC8: @ 81CEEC8 + push {r4,r5,lr} + bl sub_81CDC70 + adds r5, r0, 0 + bl sub_81CDD5C + cmp r0, 0 + bne _081CEEF0 + bl sub_81CDC60 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl sub_81CDC50 + lsls r0, 16 + lsrs r0, 16 + subs r0, 0x1 + cmp r4, r0 + beq _081CEF0C +_081CEEF0: + bl sub_81CDC84 + lsls r0, 24 + asrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, 0x14 + adds r1, r5, r1 + adds r2, r5, 0 + adds r2, 0x50 + adds r0, r5, 0 + bl sub_81D1F84 +_081CEF0C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81CEEC8 + + thumb_func_start sub_81CEF14 +sub_81CEF14: @ 81CEF14 + push {r4,lr} + movs r0, 0xC + bl sub_81C763C + adds r4, r0, 0 + bl sub_81CDD5C + cmp r0, 0x1 + beq _081CEF2A + movs r0, 0 + b _081CEF30 +_081CEF2A: + ldr r1, =0x00001828 + adds r0, r4, r1 + ldrb r0, [r0] +_081CEF30: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CEF14 + + thumb_func_start sub_81CEF3C +sub_81CEF3C: @ 81CEF3C + push {r4,lr} + movs r0, 0x7 + movs r1, 0x24 + bl sub_81C761C + adds r4, r0, 0 + cmp r4, 0 + beq _081CEF90 + ldr r1, =0x000006ac + movs r0, 0x12 + bl sub_81C761C + str r0, [r4, 0x20] + cmp r0, 0 + beq _081CEF90 + ldr r0, =sub_81CF010 + str r0, [r4] + ldr r0, =sub_81CF11C + movs r1, 0x1 + bl sub_81C7078 + str r0, [r4, 0x4] + movs r0, 0 + str r0, [r4, 0x18] + bl sub_81C76AC + ldr r1, =gUnknown_086233A0 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [r4, 0x14] + movs r0, 0x1 + b _081CEF92 + .pool +_081CEF90: + movs r0, 0 +_081CEF92: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81CEF3C + + thumb_func_start sub_81CEF98 +sub_81CEF98: @ 81CEF98 + push {r4,lr} + movs r0, 0x7 + movs r1, 0x24 + bl sub_81C761C + adds r4, r0, 0 + cmp r4, 0 + beq _081CEFD4 + movs r0, 0x12 + bl sub_81C763C + str r0, [r4, 0x20] + ldr r0, =sub_81CF030 + str r0, [r4] + movs r0, 0x1 + str r0, [r4, 0x18] + bl sub_81C76AC + ldr r1, =gUnknown_086233A0 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [r4, 0x14] + movs r0, 0x1 + b _081CEFD6 + .pool +_081CEFD4: + movs r0, 0 +_081CEFD6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81CEF98 + + thumb_func_start sub_81CEFDC +sub_81CEFDC: @ 81CEFDC + push {lr} + movs r0, 0x7 + bl sub_81C763C + ldr r1, [r0] + bl _call_via_r1 + pop {r1} + bx r1 + thumb_func_end sub_81CEFDC + + thumb_func_start sub_81CEFF0 +sub_81CEFF0: @ 81CEFF0 + push {lr} + movs r0, 0x7 + bl sub_81C763C + ldr r0, [r0, 0x1C] + cmp r0, 0 + bne _081CF004 + movs r0, 0x12 + bl sub_81C7650 +_081CF004: + movs r0, 0x7 + bl sub_81C7650 + pop {r0} + bx r0 + thumb_func_end sub_81CEFF0 + + thumb_func_start sub_81CF010 +sub_81CF010: @ 81CF010 + push {r4,lr} + adds r4, r0, 0 + ldr r0, [r4, 0x4] + bl sub_81C70D8 + cmp r0, 0 + bne _081CF022 + ldr r0, =sub_81CF030 + str r0, [r4] +_081CF022: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CF010 + + thumb_func_start sub_81CF030 +sub_81CF030: @ 81CF030 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081CF048 + movs r0, 0x1 + b _081CF0A6 + .pool +_081CF048: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081CF054 + movs r0, 0x2 + b _081CF0A6 +_081CF054: + ldrh r1, [r2, 0x2E] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _081CF062 + movs r0, 0x3 + b _081CF0A6 +_081CF062: + movs r0, 0x10 + ands r0, r1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0 + beq _081CF072 + movs r0, 0x4 + b _081CF0A6 +_081CF072: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081CF088 + str r2, [r4, 0x1C] + ldr r0, =sub_81CF0B0 + str r0, [r4] + movs r0, 0x5 + b _081CF0A6 + .pool +_081CF088: + movs r5, 0x1 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _081CF096 + movs r0, 0 + b _081CF0A6 +_081CF096: + bl sub_81C875C + ldr r1, [r4, 0x20] + strh r0, [r1, 0x2] + str r5, [r4, 0x1C] + ldr r0, =sub_81CF0B8 + str r0, [r4] + movs r0, 0x6 +_081CF0A6: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CF030 + + thumb_func_start sub_81CF0B0 +sub_81CF0B0: @ 81CF0B0 + ldr r0, =0x000186a3 + bx lr + .pool + thumb_func_end sub_81CF0B0 + + thumb_func_start sub_81CF0B8 +sub_81CF0B8: @ 81CF0B8 + ldr r0, =0x000186a9 + bx lr + .pool + thumb_func_end sub_81CF0B8 + + thumb_func_start sub_81CF0C0 +sub_81CF0C0: @ 81CF0C0 + push {lr} + movs r0, 0x7 + bl sub_81C763C + ldr r0, [r0, 0x18] + pop {r1} + bx r1 + thumb_func_end sub_81CF0C0 + + thumb_func_start sub_81CF0D0 +sub_81CF0D0: @ 81CF0D0 + push {lr} + movs r0, 0x7 + bl sub_81C763C + ldr r0, [r0, 0x20] + adds r0, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_81CF0D0 + + thumb_func_start sub_81CF0E0 +sub_81CF0E0: @ 81CF0E0 + push {lr} + movs r0, 0x7 + bl sub_81C763C + ldr r0, [r0, 0x20] + ldrh r0, [r0] + pop {r1} + bx r1 + thumb_func_end sub_81CF0E0 + + thumb_func_start sub_81CF0F0 +sub_81CF0F0: @ 81CF0F0 + push {r4,lr} + movs r0, 0x7 + bl sub_81C763C + adds r4, r0, 0 + bl sub_81C875C + ldr r1, [r4, 0x20] + lsls r0, 2 + adds r1, r0 + ldrh r0, [r1, 0x6] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81CF0F0 + + thumb_func_start sub_81CF10C +sub_81CF10C: @ 81CF10C + push {lr} + movs r0, 0x7 + bl sub_81C763C + ldr r0, [r0, 0x20] + ldrh r0, [r0, 0x2] + pop {r1} + bx r1 + thumb_func_end sub_81CF10C + + thumb_func_start sub_81CF11C +sub_81CF11C: @ 81CF11C + push {lr} + ldr r2, =gUnknown_086233B4 + lsls r1, r0, 2 + adds r1, r2 + ldr r1, [r1] + bl _call_via_r1 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CF11C + + thumb_func_start sub_81CF134 +sub_81CF134: @ 81CF134 + push {r4-r6,lr} + sub sp, 0x4 + movs r0, 0x7 + bl sub_81C763C + adds r6, r0, 0 + ldr r0, [r6, 0x20] + movs r1, 0 + strh r1, [r0] + ldr r0, [r6, 0x20] + strh r1, [r0, 0x2] + ldr r1, =0xffffff00 + ldr r0, [sp] + ands r0, r1 + movs r1, 0xE + orrs r0, r1 + str r0, [sp] + movs r5, 0 +_081CF158: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x5 + bl pokemon_getattr + cmp r0, 0 + beq _081CF1AA + adds r0, r4, 0 + movs r1, 0x6 + bl pokemon_getattr + cmp r0, 0 + bne _081CF1A4 + lsls r1, r5, 24 + lsrs r1, 16 + ldr r2, =0xffff00ff + ldr r0, [sp] + ands r0, r2 + orrs r0, r1 + str r0, [sp] + ldr r1, [r6, 0x14] + adds r0, r4, 0 + bl pokemon_getattr + lsls r0, 16 + ldr r2, =0x0000ffff + ldr r1, [sp] + ands r1, r2 + orrs r1, r0 + str r1, [sp] + adds r0, r6, 0 + mov r1, sp + bl sub_81CF2C4 +_081CF1A4: + adds r5, 0x1 + cmp r5, 0x5 + ble _081CF158 +_081CF1AA: + movs r0, 0x1 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CF134 + + thumb_func_start sub_81CF1C4 +sub_81CF1C4: @ 81CF1C4 + push {lr} + movs r0, 0x7 + bl sub_81C763C + movs r1, 0 + str r1, [r0, 0x10] + str r1, [r0, 0xC] + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_81CF1C4 + + thumb_func_start sub_81CF1D8 +sub_81CF1D8: @ 81CF1D8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + movs r0, 0x7 + bl sub_81C763C + adds r6, r0, 0 + ldr r5, [r6, 0xC] + ldr r4, [r6, 0x10] + movs r0, 0 + mov r8, r0 + cmp r5, 0xD + bgt _081CF268 +_081CF1F4: + cmp r4, 0x1D + bgt _081CF260 + lsls r0, r5, 24 + lsrs r7, r0, 24 +_081CF1FC: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80D2270 + cmp r0, 0 + beq _081CF23A + ldr r1, =0xffffff00 + ldr r0, [sp] + ands r0, r1 + orrs r0, r7 + lsls r1, r4, 24 + lsrs r1, 24 + lsls r3, r1, 8 + ldr r2, =0xffff00ff + ands r0, r2 + orrs r0, r3 + str r0, [sp] + ldr r2, [r6, 0x14] + adds r0, r7, 0 + bl get_pokemon_data_from_any_box + lsls r0, 16 + ldr r2, =0x0000ffff + ldr r1, [sp] + ands r1, r2 + orrs r1, r0 + str r1, [sp] + adds r0, r6, 0 + mov r1, sp + bl sub_81CF2C4 +_081CF23A: + movs r0, 0x1 + add r8, r0 + adds r4, 0x1 + mov r0, r8 + cmp r0, 0xE + ble _081CF25C + str r5, [r6, 0xC] + str r4, [r6, 0x10] + movs r0, 0x3 + b _081CF26A + .pool +_081CF25C: + cmp r4, 0x1D + ble _081CF1FC +_081CF260: + movs r4, 0 + adds r5, 0x1 + cmp r5, 0xD + ble _081CF1F4 +_081CF268: + movs r0, 0x1 +_081CF26A: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81CF1D8 + + thumb_func_start sub_81CF278 +sub_81CF278: @ 81CF278 + push {r4-r6,lr} + movs r0, 0x7 + bl sub_81C763C + adds r5, r0, 0 + ldr r0, [r5, 0x20] + ldrh r6, [r0] + ldrh r4, [r0, 0x6] + movs r1, 0x1 + strh r1, [r0, 0x6] + movs r3, 0x1 + cmp r3, r6 + bge _081CF2B8 +_081CF292: + ldr r2, [r5, 0x20] + lsls r0, r3, 2 + adds r1, r2, r0 + ldrh r0, [r1, 0x6] + cmp r0, r4 + bne _081CF2AC + subs r0, r3, 0x1 + lsls r0, 2 + adds r0, r2, r0 + ldrh r0, [r0, 0x6] + strh r0, [r1, 0x6] + adds r0, r3, 0x1 + b _081CF2B2 +_081CF2AC: + adds r4, r0, 0 + adds r0, r3, 0x1 + strh r0, [r1, 0x6] +_081CF2B2: + adds r3, r0, 0 + cmp r3, r6 + blt _081CF292 +_081CF2B8: + movs r0, 0x1 + str r0, [r5, 0x18] + movs r0, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81CF278 + + thumb_func_start sub_81CF2C4 +sub_81CF2C4: @ 81CF2C4 + push {r4-r7,lr} + adds r5, r0, 0 + adds r7, r1, 0 + movs r1, 0 + ldr r0, [r5, 0x20] + ldrh r2, [r0] + lsrs r3, r2, 1 + cmp r2, r3 + beq _081CF2F4 + adds r6, r0, 0 + ldrh r4, [r7, 0x2] +_081CF2DA: + lsls r0, r3, 2 + adds r0, r6, r0 + ldrh r0, [r0, 0x6] + cmp r4, r0 + bls _081CF2E8 + adds r2, r3, 0 + b _081CF2EA +_081CF2E8: + adds r1, r3, 0x1 +_081CF2EA: + subs r0, r2, r1 + lsrs r0, 1 + adds r3, r1, r0 + cmp r2, r3 + bne _081CF2DA +_081CF2F4: + ldr r0, [r5, 0x20] + ldrh r2, [r0] + lsls r6, r3, 2 + cmp r2, r3 + bls _081CF318 + lsls r0, r2, 2 + subs r4, r0, 0x4 +_081CF302: + ldr r0, [r5, 0x20] + lsls r1, r2, 2 + adds r0, 0x4 + adds r1, r0, r1 + adds r0, r4 + ldr r0, [r0] + str r0, [r1] + subs r4, 0x4 + subs r2, 0x1 + cmp r2, r3 + bhi _081CF302 +_081CF318: + ldr r0, [r5, 0x20] + adds r0, 0x4 + adds r0, r6 + ldr r1, [r7] + str r1, [r0] + ldr r1, [r5, 0x20] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81CF2C4 + + thumb_func_start sub_81CF330 +sub_81CF330: @ 81CF330 + push {r4,lr} + movs r1, 0x81 + lsls r1, 4 + movs r0, 0x8 + bl sub_81C761C + adds r4, r0, 0 + cmp r4, 0 + beq _081CF360 + ldr r0, =sub_81CF418 + movs r1, 0x1 + bl sub_81C7078 + str r0, [r4, 0x4] + ldr r0, =sub_81CF3E4 + str r0, [r4] + movs r0, 0 + str r0, [r4, 0xC] + movs r0, 0x1 + b _081CF362 + .pool +_081CF360: + movs r0, 0 +_081CF362: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81CF330 + + thumb_func_start sub_81CF368 +sub_81CF368: @ 81CF368 + push {r4,lr} + movs r1, 0x81 + lsls r1, 4 + movs r0, 0x8 + bl sub_81C761C + adds r4, r0, 0 + cmp r4, 0 + beq _081CF398 + ldr r0, =sub_81CF418 + movs r1, 0x1 + bl sub_81C7078 + str r0, [r4, 0x4] + ldr r0, =sub_81CF3E4 + str r0, [r4] + movs r0, 0x1 + str r0, [r4, 0xC] + b _081CF39A + .pool +_081CF398: + movs r0, 0 +_081CF39A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81CF368 + + thumb_func_start sub_81CF3A0 +sub_81CF3A0: @ 81CF3A0 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x8 + bl sub_81C763C + adds r5, r0, 0 + ldr r0, =gUnknown_08623598 + lsls r4, 2 + adds r4, r0 + ldr r0, [r4] + movs r1, 0x1 + bl sub_81C7078 + str r0, [r5, 0x4] + ldr r0, =sub_81CF3E4 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CF3A0 + + thumb_func_start sub_81CF3D0 +sub_81CF3D0: @ 81CF3D0 + push {lr} + movs r0, 0x8 + bl sub_81C763C + ldr r0, [r0] + bl _call_via_r0 + pop {r1} + bx r1 + thumb_func_end sub_81CF3D0 + + thumb_func_start sub_81CF3E4 +sub_81CF3E4: @ 81CF3E4 + push {lr} + movs r0, 0x8 + bl sub_81C763C + ldr r0, [r0, 0x4] + bl sub_81C70D8 + pop {r1} + bx r1 + thumb_func_end sub_81CF3E4 + + thumb_func_start sub_81CF3F8 +sub_81CF3F8: @ 81CF3F8 + push {r4,lr} + movs r0, 0x8 + bl sub_81C763C + adds r4, r0, 0 + bl sub_81C8234 + ldrb r0, [r4, 0x8] + bl RemoveWindow + movs r0, 0x8 + bl sub_81C7650 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81CF3F8 + + thumb_func_start sub_81CF418 +sub_81CF418: @ 81CF418 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + movs r0, 0x8 + bl sub_81C763C + adds r5, r0, 0 + cmp r4, 0x5 + bls _081CF42C + b _081CF56E +_081CF42C: + lsls r0, r4, 2 + ldr r1, =_081CF43C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081CF43C: + .4byte _081CF454 + .4byte _081CF4AC + .4byte _081CF4C0 + .4byte _081CF4E0 + .4byte _081CF4F6 + .4byte _081CF55A +_081CF454: + ldr r0, =gUnknown_08623590 + movs r1, 0x2 + bl sub_81C7B54 + ldr r1, =gUnknown_086233E4 + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + adds r1, r5, 0 + adds r1, 0x10 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, =gUnknown_086234AC + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + ldr r0, =gUnknown_086233C4 + movs r1, 0x10 + movs r2, 0x20 + bl sub_81C7944 + movs r0, 0x1 + bl CopyBgTilemapBufferToVram +_081CF498: + movs r0, 0 + b _081CF570 + .pool +_081CF4AC: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _081CF56A + bl sub_81CF0C0 + cmp r0, 0 + beq _081CF56A + b _081CF498 +_081CF4C0: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _081CF56A + ldr r0, =gUnknown_08623570 + movs r1, 0x20 + movs r2, 0x20 + bl sub_81C7944 + bl sub_81CF88C + b _081CF498 + .pool +_081CF4E0: + bl sub_81C8224 + cmp r0, 0 + bne _081CF56A + adds r0, r5, 0 + bl sub_81CF7C8 + movs r0, 0x3 + bl sub_81C7BA4 + b _081CF498 +_081CF4F6: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _081CF56A + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl HideBg + ldr r0, [r5, 0xC] + cmp r0, 0 + bne _081CF552 + bl sub_81C76AC + adds r4, r0, 0 + adds r4, 0x8 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_81C7DFC + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl sub_81C7FA0 + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + bl sub_81C7FA0 +_081CF552: + movs r0, 0x1 + bl sub_81C7AC0 + b _081CF498 +_081CF55A: + bl sub_81C7B34 + cmp r0, 0 + bne _081CF56A + bl sub_81C8010 + cmp r0, 0 + beq _081CF56E +_081CF56A: + movs r0, 0x2 + b _081CF570 +_081CF56E: + movs r0, 0x4 +_081CF570: + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81CF418 + + thumb_func_start sub_81CF578 +sub_81CF578: @ 81CF578 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x8 + bl sub_81C763C + adds r5, r0, 0 + cmp r4, 0x1 + beq _081CF5C6 + cmp r4, 0x1 + bgt _081CF592 + cmp r4, 0 + beq _081CF59C + b _081CF5E6 +_081CF592: + cmp r4, 0x2 + beq _081CF5CE + cmp r4, 0x3 + beq _081CF5D8 + b _081CF5E6 +_081CF59C: + bl sub_81C8658 + cmp r0, 0x1 + beq _081CF5B4 + cmp r0, 0x1 + bgt _081CF5AE + cmp r0, 0 + beq _081CF5E6 + b _081CF5D4 +_081CF5AE: + cmp r0, 0x2 + beq _081CF5BE + b _081CF5D4 +_081CF5B4: + movs r0, 0x5 + bl audio_play + movs r0, 0x7 + b _081CF5E8 +_081CF5BE: + movs r0, 0x5 + bl audio_play + b _081CF5D4 +_081CF5C6: + bl sub_81C8630 + cmp r0, 0 + bne _081CF5E2 +_081CF5CE: + adds r0, r5, 0 + bl sub_81CF7F4 +_081CF5D4: + movs r0, 0 + b _081CF5E8 +_081CF5D8: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _081CF5E6 +_081CF5E2: + movs r0, 0x2 + b _081CF5E8 +_081CF5E6: + movs r0, 0x4 +_081CF5E8: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81CF578 + + thumb_func_start sub_81CF5F0 +sub_81CF5F0: @ 81CF5F0 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x8 + bl sub_81C763C + adds r5, r0, 0 + cmp r4, 0x1 + beq _081CF63E + cmp r4, 0x1 + bgt _081CF60A + cmp r4, 0 + beq _081CF614 + b _081CF65E +_081CF60A: + cmp r4, 0x2 + beq _081CF646 + cmp r4, 0x3 + beq _081CF650 + b _081CF65E +_081CF614: + bl sub_81C868C + cmp r0, 0x1 + beq _081CF62C + cmp r0, 0x1 + bgt _081CF626 + cmp r0, 0 + beq _081CF65E + b _081CF64C +_081CF626: + cmp r0, 0x2 + beq _081CF636 + b _081CF64C +_081CF62C: + movs r0, 0x5 + bl audio_play + movs r0, 0x7 + b _081CF660 +_081CF636: + movs r0, 0x5 + bl audio_play + b _081CF64C +_081CF63E: + bl sub_81C8630 + cmp r0, 0 + bne _081CF65A +_081CF646: + adds r0, r5, 0 + bl sub_81CF7F4 +_081CF64C: + movs r0, 0 + b _081CF660 +_081CF650: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _081CF65E +_081CF65A: + movs r0, 0x2 + b _081CF660 +_081CF65E: + movs r0, 0x4 +_081CF660: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81CF5F0 + + thumb_func_start sub_81CF668 +sub_81CF668: @ 81CF668 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x8 + bl sub_81C763C + adds r5, r0, 0 + cmp r4, 0x1 + beq _081CF6B6 + cmp r4, 0x1 + bgt _081CF682 + cmp r4, 0 + beq _081CF68C + b _081CF6D6 +_081CF682: + cmp r4, 0x2 + beq _081CF6BE + cmp r4, 0x3 + beq _081CF6C8 + b _081CF6D6 +_081CF68C: + bl sub_81C86CC + cmp r0, 0x1 + beq _081CF6A4 + cmp r0, 0x1 + bgt _081CF69E + cmp r0, 0 + beq _081CF6D6 + b _081CF6C4 +_081CF69E: + cmp r0, 0x2 + beq _081CF6AE + b _081CF6C4 +_081CF6A4: + movs r0, 0x5 + bl audio_play + movs r0, 0x7 + b _081CF6D8 +_081CF6AE: + movs r0, 0x5 + bl audio_play + b _081CF6C4 +_081CF6B6: + bl sub_81C8630 + cmp r0, 0 + bne _081CF6D2 +_081CF6BE: + adds r0, r5, 0 + bl sub_81CF7F4 +_081CF6C4: + movs r0, 0 + b _081CF6D8 +_081CF6C8: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _081CF6D6 +_081CF6D2: + movs r0, 0x2 + b _081CF6D8 +_081CF6D6: + movs r0, 0x4 +_081CF6D8: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81CF668 + + thumb_func_start sub_81CF6E0 +sub_81CF6E0: @ 81CF6E0 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x8 + bl sub_81C763C + adds r5, r0, 0 + cmp r4, 0x1 + beq _081CF72E + cmp r4, 0x1 + bgt _081CF6FA + cmp r4, 0 + beq _081CF704 + b _081CF74E +_081CF6FA: + cmp r4, 0x2 + beq _081CF736 + cmp r4, 0x3 + beq _081CF740 + b _081CF74E +_081CF704: + bl sub_81C870C + cmp r0, 0x1 + beq _081CF71C + cmp r0, 0x1 + bgt _081CF716 + cmp r0, 0 + beq _081CF74E + b _081CF73C +_081CF716: + cmp r0, 0x2 + beq _081CF726 + b _081CF73C +_081CF71C: + movs r0, 0x5 + bl audio_play + movs r0, 0x7 + b _081CF750 +_081CF726: + movs r0, 0x5 + bl audio_play + b _081CF73C +_081CF72E: + bl sub_81C8630 + cmp r0, 0 + bne _081CF74A +_081CF736: + adds r0, r5, 0 + bl sub_81CF7F4 +_081CF73C: + movs r0, 0 + b _081CF750 +_081CF740: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _081CF74E +_081CF74A: + movs r0, 0x2 + b _081CF750 +_081CF74E: + movs r0, 0x4 +_081CF750: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81CF6E0 + + thumb_func_start sub_81CF758 +sub_81CF758: @ 81CF758 + push {lr} + cmp r0, 0 + beq _081CF764 + cmp r0, 0x1 + beq _081CF778 + b _081CF790 +_081CF764: + movs r0, 0x5 + bl audio_play + movs r0, 0 + bl sub_81C7AC0 + bl sub_81C78A0 + movs r0, 0 + b _081CF792 +_081CF778: + bl sub_81C7B34 + cmp r0, 0 + bne _081CF788 + bl sub_81C78C0 + cmp r0, 0 + beq _081CF78C +_081CF788: + movs r0, 0x2 + b _081CF792 +_081CF78C: + bl sub_81C7FDC +_081CF790: + movs r0, 0x4 +_081CF792: + pop {r1} + bx r1 + thumb_func_end sub_81CF758 + + thumb_func_start sub_81CF798 +sub_81CF798: @ 81CF798 + push {lr} + cmp r0, 0 + beq _081CF7A4 + cmp r0, 0x1 + beq _081CF7B4 + b _081CF7C0 +_081CF7A4: + movs r0, 0x5 + bl audio_play + movs r0, 0 + bl sub_81C7AC0 + movs r0, 0 + b _081CF7C2 +_081CF7B4: + bl sub_81C7B34 + cmp r0, 0 + beq _081CF7C0 + movs r0, 0x2 + b _081CF7C2 +_081CF7C0: + movs r0, 0x4 +_081CF7C2: + pop {r1} + bx r1 + thumb_func_end sub_81CF798 + + thumb_func_start sub_81CF7C8 +sub_81CF7C8: @ 81CF7C8 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gUnknown_086235B4 + bl AddWindow + strh r0, [r4, 0x8] + lsls r0, 24 + lsrs r0, 24 + bl PutWindowTilemap + ldrb r0, [r4, 0x8] + movs r1, 0x1 + bl CopyWindowToVram + adds r0, r4, 0 + bl sub_81CF7F4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CF7C8 + + thumb_func_start sub_81CF7F4 +sub_81CF7F4: @ 81CF7F4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + mov r8, r0 + bl sub_81CF0F0 + adds r7, r0, 0 + bl sub_81AFBF0 + ldr r4, =0x02021cc4 + movs r0, 0 + adds r1, r4, 0 + bl sub_81AFC0C + movs r0, 0xFF + strb r0, [r4] + ldr r5, =0x02021dc4 + ldr r1, =gUnknown_085EC029 + adds r0, r5, 0 + bl sub_81AFC28 + mov r1, r8 + ldrb r0, [r1, 0x8] + movs r1, 0x1 + mov r10, r1 + str r1, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r6, 0 + str r6, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + movs r3, 0x4 + bl Print + adds r0, r4, 0 + adds r1, r7, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + mov r1, r8 + ldrb r0, [r1, 0x8] + mov r1, r10 + str r1, [sp] + mov r1, r9 + str r1, [sp, 0x4] + str r6, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x22 + bl Print + mov r1, r8 + ldrb r0, [r1, 0x8] + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CF7F4 + + thumb_func_start sub_81CF88C +sub_81CF88C: @ 81CF88C + push {r4,lr} + sub sp, 0x18 + bl sub_81CF0D0 + str r0, [sp] + bl sub_81CF0E0 + mov r1, sp + movs r4, 0 + strh r0, [r1, 0x4] + movs r0, 0x4 + strb r0, [r1, 0x8] + bl sub_81CF10C + mov r1, sp + strh r0, [r1, 0x6] + movs r0, 0xD + strb r0, [r1, 0x9] + movs r0, 0x11 + strb r0, [r1, 0xA] + mov r0, sp + movs r2, 0x1 + strb r2, [r0, 0xB] + movs r0, 0x8 + strb r0, [r1, 0xC] + movs r0, 0x2 + strb r0, [r1, 0xD] + mov r0, sp + strb r2, [r0, 0xE] + ldr r0, =sub_81CF8E4 + str r0, [sp, 0x10] + str r4, [sp, 0x14] + ldr r0, =gUnknown_08623594 + movs r2, 0 + bl sub_81C81D4 + add sp, 0x18 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CF88C + + thumb_func_start sub_81CF8E4 +sub_81CF8E4: @ 81CF8E4 + push {r4-r7,lr} + adds r2, r0, 0 + adds r6, r1, 0 + ldrb r0, [r2] + cmp r0, 0xE + bne _081CF924 + ldrb r1, [r2, 0x1] + movs r0, 0x64 + adds r4, r1, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + bl pokemon_get_gender + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + bl level_by_exp + lsls r0, 24 + lsrs r7, r0, 24 + ldr r2, =0x02021ec4 + adds r0, r4, 0 + movs r1, 0x2 + bl pokemon_getattr + b _081CF94A + .pool +_081CF924: + ldrb r0, [r2] + ldrb r1, [r2, 0x1] + bl get_pokemon_by_box_and_pos + adds r4, r0, 0 + bl pokemon_roll_gender + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + bl sub_80690C0 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r2, =0x02021ec4 + adds r0, r4, 0 + movs r1, 0x2 + bl pokemon_getattr_encrypted +_081CF94A: + ldr r4, =0x02021ec4 + adds r0, r4, 0 + bl GetStringEnd_Limit7 + adds r0, r6, 0 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x3C + bl sub_81DB494 + adds r6, r0, 0 + cmp r5, 0 + beq _081CF974 + cmp r5, 0xFE + beq _081CF97C + ldr r1, =gUnknown_086235D4 + b _081CF97E + .pool +_081CF974: + ldr r1, =gUnknown_086235BC + b _081CF97E + .pool +_081CF97C: + ldr r1, =gUnknown_086235C8 +_081CF97E: + ldr r4, =0x02021cc4 + adds r0, r4, 0 + bl CopyString + movs r1, 0xBA + strb r1, [r0] + adds r0, 0x1 + movs r1, 0xF9 + strb r1, [r0] + adds r0, 0x1 + movs r1, 0x5 + strb r1, [r0] + adds r0, 0x1 + adds r1, r7, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + adds r0, r6, 0 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x28 + bl sub_81DB494 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CF8E4 + + thumb_func_start sub_81CF9BC +sub_81CF9BC: @ 81CF9BC + push {r4,lr} + movs r0, 0x9 + movs r1, 0x20 + bl sub_81C761C + adds r4, r0, 0 + cmp r4, 0 + beq _081CF9FC + ldr r1, =0x000006ac + movs r0, 0x12 + bl sub_81C761C + str r0, [r4, 0x1C] + cmp r0, 0 + beq _081CF9FC + ldr r0, =sub_81CFA68 + str r0, [r4] + ldr r0, =sub_81CFB74 + movs r1, 0x1 + bl sub_81C7078 + str r0, [r4, 0x4] + movs r0, 0 + str r0, [r4, 0x14] + movs r0, 0x1 + b _081CF9FE + .pool +_081CF9FC: + movs r0, 0 +_081CF9FE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81CF9BC + + thumb_func_start sub_81CFA04 +sub_81CFA04: @ 81CFA04 + push {r4,lr} + movs r0, 0x9 + movs r1, 0x20 + bl sub_81C761C + adds r4, r0, 0 + cmp r4, 0 + beq _081CFA2C + movs r0, 0x12 + bl sub_81C763C + str r0, [r4, 0x1C] + ldr r0, =sub_81CFA88 + str r0, [r4] + movs r0, 0x1 + str r0, [r4, 0x14] + b _081CFA2E + .pool +_081CFA2C: + movs r0, 0 +_081CFA2E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81CFA04 + + thumb_func_start sub_81CFA34 +sub_81CFA34: @ 81CFA34 + push {lr} + movs r0, 0x9 + bl sub_81C763C + ldr r1, [r0] + bl _call_via_r1 + pop {r1} + bx r1 + thumb_func_end sub_81CFA34 + + thumb_func_start sub_81CFA48 +sub_81CFA48: @ 81CFA48 + push {lr} + movs r0, 0x9 + bl sub_81C763C + ldr r0, [r0, 0x18] + cmp r0, 0 + bne _081CFA5C + movs r0, 0x12 + bl sub_81C7650 +_081CFA5C: + movs r0, 0x9 + bl sub_81C7650 + pop {r0} + bx r0 + thumb_func_end sub_81CFA48 + + thumb_func_start sub_81CFA68 +sub_81CFA68: @ 81CFA68 + push {r4,lr} + adds r4, r0, 0 + ldr r0, [r4, 0x4] + bl sub_81C70D8 + cmp r0, 0 + bne _081CFA7A + ldr r0, =sub_81CFA88 + str r0, [r4] +_081CFA7A: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CFA68 + + thumb_func_start sub_81CFA88 +sub_81CFA88: @ 81CFA88 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081CFAA0 + movs r0, 0x1 + b _081CFAFE + .pool +_081CFAA0: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081CFAAC + movs r0, 0x2 + b _081CFAFE +_081CFAAC: + ldrh r1, [r2, 0x2E] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _081CFABA + movs r0, 0x3 + b _081CFAFE +_081CFABA: + movs r0, 0x10 + ands r0, r1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0 + beq _081CFACA + movs r0, 0x4 + b _081CFAFE +_081CFACA: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081CFAE0 + str r2, [r4, 0x18] + ldr r0, =sub_81CFB08 + str r0, [r4] + movs r0, 0x5 + b _081CFAFE + .pool +_081CFAE0: + movs r5, 0x1 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _081CFAEE + movs r0, 0 + b _081CFAFE +_081CFAEE: + bl sub_81C875C + ldr r1, [r4, 0x1C] + strh r0, [r1, 0x2] + str r5, [r4, 0x18] + ldr r0, =sub_81CFB10 + str r0, [r4] + movs r0, 0x6 +_081CFAFE: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CFA88 + + thumb_func_start sub_81CFB08 +sub_81CFB08: @ 81CFB08 + ldr r0, =0x000186a5 + bx lr + .pool + thumb_func_end sub_81CFB08 + + thumb_func_start sub_81CFB10 +sub_81CFB10: @ 81CFB10 + ldr r0, =0x000186ad + bx lr + .pool + thumb_func_end sub_81CFB10 + + thumb_func_start sub_81CFB18 +sub_81CFB18: @ 81CFB18 + push {lr} + movs r0, 0x9 + bl sub_81C763C + ldr r0, [r0, 0x14] + pop {r1} + bx r1 + thumb_func_end sub_81CFB18 + + thumb_func_start sub_81CFB28 +sub_81CFB28: @ 81CFB28 + push {lr} + movs r0, 0x9 + bl sub_81C763C + ldr r0, [r0, 0x1C] + adds r0, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_81CFB28 + + thumb_func_start sub_81CFB38 +sub_81CFB38: @ 81CFB38 + push {lr} + movs r0, 0x9 + bl sub_81C763C + ldr r0, [r0, 0x1C] + ldrh r0, [r0] + pop {r1} + bx r1 + thumb_func_end sub_81CFB38 + + thumb_func_start sub_81CFB48 +sub_81CFB48: @ 81CFB48 + push {r4,lr} + movs r0, 0x9 + bl sub_81C763C + adds r4, r0, 0 + bl sub_81C875C + ldr r1, [r4, 0x1C] + lsls r0, 2 + adds r1, r0 + ldrh r0, [r1, 0x6] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81CFB48 + + thumb_func_start sub_81CFB64 +sub_81CFB64: @ 81CFB64 + push {lr} + movs r0, 0x9 + bl sub_81C763C + ldr r0, [r0, 0x1C] + ldrh r0, [r0, 0x2] + pop {r1} + bx r1 + thumb_func_end sub_81CFB64 + + thumb_func_start sub_81CFB74 +sub_81CFB74: @ 81CFB74 + push {lr} + ldr r2, =gUnknown_086235D8 + lsls r1, r0, 2 + adds r1, r2 + ldr r1, [r1] + bl _call_via_r1 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CFB74 + + thumb_func_start sub_81CFB8C +sub_81CFB8C: @ 81CFB8C + push {r4-r6,lr} + sub sp, 0x4 + movs r0, 0x9 + bl sub_81C763C + adds r6, r0, 0 + ldr r0, [r6, 0x1C] + movs r1, 0 + strh r1, [r0] + ldr r0, [r6, 0x1C] + strh r1, [r0, 0x2] + ldr r1, =0xffffff00 + ldr r0, [sp] + ands r0, r1 + movs r1, 0xE + orrs r0, r1 + str r0, [sp] + movs r5, 0 +_081CFBB0: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x5 + bl pokemon_getattr + cmp r0, 0 + beq _081CFC10 + adds r0, r4, 0 + movs r1, 0x6 + bl pokemon_getattr + cmp r0, 0 + bne _081CFC0A + adds r0, r4, 0 + movs r1, 0x4 + bl pokemon_getattr + cmp r0, 0 + bne _081CFC0A + adds r0, r4, 0 + movs r1, 0x52 + bl pokemon_getattr + adds r3, r0, 0 + cmp r3, 0 + beq _081CFC0A + lsls r1, r5, 24 + lsrs r1, 16 + ldr r2, =0xffff00ff + ldr r0, [sp] + ands r0, r2 + orrs r0, r1 + lsls r2, r3, 16 + ldr r1, =0x0000ffff + ands r0, r1 + orrs r0, r2 + str r0, [sp] + adds r0, r6, 0 + mov r1, sp + bl sub_81CFCEC +_081CFC0A: + adds r5, 0x1 + cmp r5, 0x5 + ble _081CFBB0 +_081CFC10: + movs r0, 0x1 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81CFB8C + + thumb_func_start sub_81CFC2C +sub_81CFC2C: @ 81CFC2C + push {lr} + movs r0, 0x9 + bl sub_81C763C + movs r1, 0 + str r1, [r0, 0x10] + str r1, [r0, 0xC] + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_81CFC2C + + thumb_func_start sub_81CFC40 +sub_81CFC40: @ 81CFC40 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + movs r0, 0x9 + bl sub_81C763C + mov r8, r0 + ldr r7, [r0, 0xC] + ldr r6, [r0, 0x10] + movs r0, 0 + mov r9, r0 + cmp r7, 0xD + bgt _081CFCD4 + b _081CFCC8 +_081CFC60: + adds r0, r7, 0 + adds r1, r6, 0 + bl sub_80D2270 + cmp r0, 0 + beq _081CFCA6 + lsls r0, r7, 24 + lsrs r5, r0, 24 + lsls r0, r6, 24 + lsrs r4, r0, 24 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x52 + bl get_pokemon_data_from_any_box + adds r3, r0, 0 + cmp r3, 0 + beq _081CFCA6 + ldr r1, =0xffffff00 + ldr r0, [sp] + ands r0, r1 + orrs r0, r5 + lsls r2, r4, 8 + ldr r1, =0xffff00ff + ands r0, r1 + orrs r0, r2 + lsls r2, r3, 16 + ldr r1, =0x0000ffff + ands r0, r1 + orrs r0, r2 + str r0, [sp] + mov r0, r8 + mov r1, sp + bl sub_81CFCEC +_081CFCA6: + movs r1, 0x1 + add r9, r1 + adds r6, 0x1 + mov r0, r9 + cmp r0, 0xE + ble _081CFCC8 + mov r1, r8 + str r7, [r1, 0xC] + str r6, [r1, 0x10] + movs r0, 0x3 + b _081CFCDC + .pool +_081CFCC8: + cmp r6, 0x1D + ble _081CFC60 + movs r6, 0 + adds r7, 0x1 + cmp r7, 0xD + ble _081CFCC8 +_081CFCD4: + movs r0, 0x1 + mov r1, r8 + str r0, [r1, 0x14] + movs r0, 0x4 +_081CFCDC: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81CFC40 + + thumb_func_start sub_81CFCEC +sub_81CFCEC: @ 81CFCEC + push {r4-r7,lr} + adds r5, r0, 0 + adds r7, r1, 0 + movs r1, 0 + ldr r0, [r5, 0x1C] + ldrh r2, [r0] + lsrs r3, r2, 1 + cmp r2, r3 + beq _081CFD1C + adds r6, r0, 0 + ldrh r4, [r7, 0x2] +_081CFD02: + lsls r0, r3, 2 + adds r0, r6, r0 + ldrh r0, [r0, 0x6] + cmp r4, r0 + bls _081CFD10 + adds r2, r3, 0 + b _081CFD12 +_081CFD10: + adds r1, r3, 0x1 +_081CFD12: + subs r0, r2, r1 + lsrs r0, 1 + adds r3, r1, r0 + cmp r2, r3 + bne _081CFD02 +_081CFD1C: + ldr r0, [r5, 0x1C] + ldrh r2, [r0] + lsls r6, r3, 2 + cmp r2, r3 + bls _081CFD40 + lsls r0, r2, 2 + subs r4, r0, 0x4 +_081CFD2A: + ldr r0, [r5, 0x1C] + lsls r1, r2, 2 + adds r0, 0x4 + adds r1, r0, r1 + adds r0, r4 + ldr r0, [r0] + str r0, [r1] + subs r4, 0x4 + subs r2, 0x1 + cmp r2, r3 + bhi _081CFD2A +_081CFD40: + ldr r0, [r5, 0x1C] + adds r0, 0x4 + adds r0, r6 + ldr r1, [r7] + str r1, [r0] + ldr r1, [r5, 0x1C] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81CFCEC + + thumb_func_start sub_81CFD58 +sub_81CFD58: @ 81CFD58 + push {r4-r6,lr} + movs r5, 0 +_081CFD5C: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x5 + bl pokemon_getattr + cmp r0, 0 + beq _081CFD8A + adds r0, r4, 0 + movs r1, 0x6 + bl pokemon_getattr + cmp r0, 0 + bne _081CFD8A + adds r0, r4, 0 + movs r1, 0x53 + bl pokemon_getattr + cmp r0, 0 + bne _081CFDB2 +_081CFD8A: + adds r5, 0x1 + cmp r5, 0x5 + ble _081CFD5C + movs r5, 0 +_081CFD92: + movs r4, 0 + lsls r6, r5, 24 +_081CFD96: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80D2270 + cmp r0, 0 + beq _081CFDBC + lsls r1, r4, 24 + lsrs r1, 24 + lsrs r0, r6, 24 + movs r2, 0x53 + bl get_pokemon_data_from_any_box + cmp r0, 0 + beq _081CFDBC +_081CFDB2: + movs r0, 0x1 + b _081CFDCA + .pool +_081CFDBC: + adds r4, 0x1 + cmp r4, 0x1D + ble _081CFD96 + adds r5, 0x1 + cmp r5, 0xD + ble _081CFD92 + movs r0, 0 +_081CFDCA: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81CFD58 + + thumb_func_start sub_81CFDD0 +sub_81CFDD0: @ 81CFDD0 + push {r4,lr} + movs r1, 0x81 + lsls r1, 4 + movs r0, 0xA + bl sub_81C761C + adds r4, r0, 0 + cmp r4, 0 + beq _081CFE00 + ldr r0, =sub_81CFEB8 + movs r1, 0x1 + bl sub_81C7078 + str r0, [r4, 0x4] + ldr r0, =sub_81CFE84 + str r0, [r4] + movs r0, 0 + str r0, [r4, 0xC] + movs r0, 0x1 + b _081CFE02 + .pool +_081CFE00: + movs r0, 0 +_081CFE02: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81CFDD0 + + thumb_func_start sub_81CFE08 +sub_81CFE08: @ 81CFE08 + push {r4,lr} + movs r1, 0x81 + lsls r1, 4 + movs r0, 0xA + bl sub_81C761C + adds r4, r0, 0 + cmp r4, 0 + beq _081CFE38 + ldr r0, =sub_81CFEB8 + movs r1, 0x1 + bl sub_81C7078 + str r0, [r4, 0x4] + ldr r0, =sub_81CFE84 + str r0, [r4] + movs r0, 0x1 + str r0, [r4, 0xC] + b _081CFE3A + .pool +_081CFE38: + movs r0, 0 +_081CFE3A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81CFE08 + + thumb_func_start sub_81CFE40 +sub_81CFE40: @ 81CFE40 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0xA + bl sub_81C763C + adds r5, r0, 0 + ldr r0, =gUnknown_086237B8 + lsls r4, 2 + adds r4, r0 + ldr r0, [r4] + movs r1, 0x1 + bl sub_81C7078 + str r0, [r5, 0x4] + ldr r0, =sub_81CFE84 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81CFE40 + + thumb_func_start sub_81CFE70 +sub_81CFE70: @ 81CFE70 + push {lr} + movs r0, 0xA + bl sub_81C763C + ldr r0, [r0] + bl _call_via_r0 + pop {r1} + bx r1 + thumb_func_end sub_81CFE70 + + thumb_func_start sub_81CFE84 +sub_81CFE84: @ 81CFE84 + push {lr} + movs r0, 0xA + bl sub_81C763C + ldr r0, [r0, 0x4] + bl sub_81C70D8 + pop {r1} + bx r1 + thumb_func_end sub_81CFE84 + + thumb_func_start sub_81CFE98 +sub_81CFE98: @ 81CFE98 + push {r4,lr} + movs r0, 0xA + bl sub_81C763C + adds r4, r0, 0 + bl sub_81C8234 + ldrb r0, [r4, 0x8] + bl RemoveWindow + movs r0, 0xA + bl sub_81C7650 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81CFE98 + + thumb_func_start sub_81CFEB8 +sub_81CFEB8: @ 81CFEB8 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + movs r0, 0xA + bl sub_81C763C + adds r5, r0, 0 + cmp r4, 0x5 + bls _081CFECC + b _081CFFF2 +_081CFECC: + lsls r0, r4, 2 + ldr r1, =_081CFEDC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081CFEDC: + .4byte _081CFEF4 + .4byte _081CFF48 + .4byte _081CFF76 + .4byte _081CFF94 + .4byte _081CFFA4 + .4byte _081CFFDE +_081CFEF4: + ldr r0, =gUnknown_086237B0 + movs r1, 0x2 + bl sub_81C7B54 + ldr r1, =gUnknown_08623604 + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + adds r1, r5, 0 + adds r1, 0x10 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, =gUnknown_086236CC + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + ldr r0, =gUnknown_086235E4 + movs r1, 0x10 + movs r2, 0x20 + bl sub_81C7944 + movs r0, 0x1 + bl CopyBgTilemapBufferToVram +_081CFF32: + movs r0, 0 + b _081CFFF4 + .pool +_081CFF48: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _081CFFEE + bl sub_81CFB18 + cmp r0, 0 + beq _081CFFEE + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x1 + bl ShowBg + b _081CFF32 +_081CFF76: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _081CFFEE + ldr r0, =gUnknown_08623790 + movs r1, 0x20 + movs r2, 0x20 + bl sub_81C7944 + bl sub_81D0304 + b _081CFF32 + .pool +_081CFF94: + bl sub_81C8224 + cmp r0, 0 + bne _081CFFEE + adds r0, r5, 0 + bl sub_81D024C + b _081CFF32 +_081CFFA4: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _081CFFEE + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl HideBg + movs r0, 0x9 + bl sub_81C7BA4 + movs r0, 0x1 + bl sub_81C7AC0 + ldr r0, [r5, 0xC] + cmp r0, 0 + bne _081CFF32 + movs r0, 0x2 + bl sub_81C7DFC + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0 + bl sub_81C7FA0 + b _081CFF32 +_081CFFDE: + bl sub_81C7B34 + cmp r0, 0 + bne _081CFFEE + bl sub_81C8010 + cmp r0, 0 + beq _081CFFF2 +_081CFFEE: + movs r0, 0x2 + b _081CFFF4 +_081CFFF2: + movs r0, 0x4 +_081CFFF4: + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81CFEB8 + + thumb_func_start sub_81CFFFC +sub_81CFFFC: @ 81CFFFC + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0xA + bl sub_81C763C + adds r5, r0, 0 + cmp r4, 0x1 + beq _081D004A + cmp r4, 0x1 + bgt _081D0016 + cmp r4, 0 + beq _081D0020 + b _081D006A +_081D0016: + cmp r4, 0x2 + beq _081D0052 + cmp r4, 0x3 + beq _081D005C + b _081D006A +_081D0020: + bl sub_81C8658 + cmp r0, 0x1 + beq _081D0038 + cmp r0, 0x1 + bgt _081D0032 + cmp r0, 0 + beq _081D006A + b _081D0058 +_081D0032: + cmp r0, 0x2 + beq _081D0042 + b _081D0058 +_081D0038: + movs r0, 0x5 + bl audio_play + movs r0, 0x7 + b _081D006C +_081D0042: + movs r0, 0x5 + bl audio_play + b _081D0058 +_081D004A: + bl sub_81C8630 + cmp r0, 0 + bne _081D0066 +_081D0052: + adds r0, r5, 0 + bl sub_81D0288 +_081D0058: + movs r0, 0 + b _081D006C +_081D005C: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _081D006A +_081D0066: + movs r0, 0x2 + b _081D006C +_081D006A: + movs r0, 0x4 +_081D006C: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81CFFFC + + thumb_func_start sub_81D0074 +sub_81D0074: @ 81D0074 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0xA + bl sub_81C763C + adds r5, r0, 0 + cmp r4, 0x1 + beq _081D00C2 + cmp r4, 0x1 + bgt _081D008E + cmp r4, 0 + beq _081D0098 + b _081D00E2 +_081D008E: + cmp r4, 0x2 + beq _081D00CA + cmp r4, 0x3 + beq _081D00D4 + b _081D00E2 +_081D0098: + bl sub_81C868C + cmp r0, 0x1 + beq _081D00B0 + cmp r0, 0x1 + bgt _081D00AA + cmp r0, 0 + beq _081D00E2 + b _081D00D0 +_081D00AA: + cmp r0, 0x2 + beq _081D00BA + b _081D00D0 +_081D00B0: + movs r0, 0x5 + bl audio_play + movs r0, 0x7 + b _081D00E4 +_081D00BA: + movs r0, 0x5 + bl audio_play + b _081D00D0 +_081D00C2: + bl sub_81C8630 + cmp r0, 0 + bne _081D00DE +_081D00CA: + adds r0, r5, 0 + bl sub_81D0288 +_081D00D0: + movs r0, 0 + b _081D00E4 +_081D00D4: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _081D00E2 +_081D00DE: + movs r0, 0x2 + b _081D00E4 +_081D00E2: + movs r0, 0x4 +_081D00E4: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81D0074 + + thumb_func_start sub_81D00EC +sub_81D00EC: @ 81D00EC + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0xA + bl sub_81C763C + adds r5, r0, 0 + cmp r4, 0x1 + beq _081D013A + cmp r4, 0x1 + bgt _081D0106 + cmp r4, 0 + beq _081D0110 + b _081D015A +_081D0106: + cmp r4, 0x2 + beq _081D0142 + cmp r4, 0x3 + beq _081D014C + b _081D015A +_081D0110: + bl sub_81C86CC + cmp r0, 0x1 + beq _081D0128 + cmp r0, 0x1 + bgt _081D0122 + cmp r0, 0 + beq _081D015A + b _081D0148 +_081D0122: + cmp r0, 0x2 + beq _081D0132 + b _081D0148 +_081D0128: + movs r0, 0x5 + bl audio_play + movs r0, 0x7 + b _081D015C +_081D0132: + movs r0, 0x5 + bl audio_play + b _081D0148 +_081D013A: + bl sub_81C8630 + cmp r0, 0 + bne _081D0156 +_081D0142: + adds r0, r5, 0 + bl sub_81D0288 +_081D0148: + movs r0, 0 + b _081D015C +_081D014C: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _081D015A +_081D0156: + movs r0, 0x2 + b _081D015C +_081D015A: + movs r0, 0x4 +_081D015C: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81D00EC + + thumb_func_start sub_81D0164 +sub_81D0164: @ 81D0164 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0xA + bl sub_81C763C + adds r5, r0, 0 + cmp r4, 0x1 + beq _081D01B2 + cmp r4, 0x1 + bgt _081D017E + cmp r4, 0 + beq _081D0188 + b _081D01D2 +_081D017E: + cmp r4, 0x2 + beq _081D01BA + cmp r4, 0x3 + beq _081D01C4 + b _081D01D2 +_081D0188: + bl sub_81C870C + cmp r0, 0x1 + beq _081D01A0 + cmp r0, 0x1 + bgt _081D019A + cmp r0, 0 + beq _081D01D2 + b _081D01C0 +_081D019A: + cmp r0, 0x2 + beq _081D01AA + b _081D01C0 +_081D01A0: + movs r0, 0x5 + bl audio_play + movs r0, 0x7 + b _081D01D4 +_081D01AA: + movs r0, 0x5 + bl audio_play + b _081D01C0 +_081D01B2: + bl sub_81C8630 + cmp r0, 0 + bne _081D01CE +_081D01BA: + adds r0, r5, 0 + bl sub_81D0288 +_081D01C0: + movs r0, 0 + b _081D01D4 +_081D01C4: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _081D01D2 +_081D01CE: + movs r0, 0x2 + b _081D01D4 +_081D01D2: + movs r0, 0x4 +_081D01D4: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81D0164 + + thumb_func_start sub_81D01DC +sub_81D01DC: @ 81D01DC + push {lr} + cmp r0, 0 + beq _081D01E8 + cmp r0, 0x1 + beq _081D01FC + b _081D0214 +_081D01E8: + movs r0, 0x5 + bl audio_play + movs r0, 0 + bl sub_81C7AC0 + bl sub_81C78A0 + movs r0, 0 + b _081D0216 +_081D01FC: + bl sub_81C7B34 + cmp r0, 0 + bne _081D020C + bl sub_81C78C0 + cmp r0, 0 + beq _081D0210 +_081D020C: + movs r0, 0x2 + b _081D0216 +_081D0210: + bl sub_81C7FDC +_081D0214: + movs r0, 0x4 +_081D0216: + pop {r1} + bx r1 + thumb_func_end sub_81D01DC + + thumb_func_start sub_81D021C +sub_81D021C: @ 81D021C + push {lr} + cmp r0, 0 + beq _081D0228 + cmp r0, 0x1 + beq _081D0238 + b _081D0244 +_081D0228: + movs r0, 0x5 + bl audio_play + movs r0, 0 + bl sub_81C7AC0 + movs r0, 0 + b _081D0246 +_081D0238: + bl sub_81C7B34 + cmp r0, 0 + beq _081D0244 + movs r0, 0x2 + b _081D0246 +_081D0244: + movs r0, 0x4 +_081D0246: + pop {r1} + bx r1 + thumb_func_end sub_81D021C + + thumb_func_start sub_81D024C +sub_81D024C: @ 81D024C + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gUnknown_086237D4 + bl AddWindow + strh r0, [r4, 0x8] + lsls r0, 24 + lsrs r0, 24 + bl PutWindowTilemap + bl sub_81CFB38 + adds r2, r0, 0 + ldrh r0, [r4, 0x8] + movs r1, 0 + bl sub_81D02B0 + ldrb r0, [r4, 0x8] + movs r1, 0x1 + bl CopyWindowToVram + adds r0, r4, 0 + bl sub_81D0288 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D024C + + thumb_func_start sub_81D0288 +sub_81D0288: @ 81D0288 + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_81C875C + adds r4, r0, 0 + bl sub_81CFB38 + adds r2, r0, 0 + ldrh r0, [r5, 0x8] + adds r4, 0x1 + adds r1, r4, 0 + bl sub_81D02B0 + ldrb r0, [r5, 0x8] + movs r1, 0x2 + bl CopyWindowToVram + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81D0288 + + thumb_func_start sub_81D02B0 +sub_81D02B0: @ 81D02B0 + push {r4,r5,lr} + sub sp, 0x1C + adds r4, r0, 0 + adds r5, r2, 0 + add r0, sp, 0xC + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + movs r1, 0xBA + strb r1, [r0] + adds r0, 0x1 + adds r1, r5, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + movs r0, 0x1 + add r1, sp, 0xC + movs r2, 0x38 + bl GetStringCenterAlignXOffset + adds r3, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + add r2, sp, 0xC + bl Print + add sp, 0x1C + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81D02B0 + + thumb_func_start sub_81D0304 +sub_81D0304: @ 81D0304 + push {r4,lr} + sub sp, 0x18 + bl sub_81CFB28 + str r0, [sp] + bl sub_81CFB38 + mov r1, sp + movs r4, 0 + strh r0, [r1, 0x4] + movs r0, 0x4 + strb r0, [r1, 0x8] + bl sub_81CFB64 + mov r1, sp + strh r0, [r1, 0x6] + movs r0, 0xD + strb r0, [r1, 0x9] + movs r0, 0x11 + strb r0, [r1, 0xA] + mov r0, sp + movs r2, 0x1 + strb r2, [r0, 0xB] + movs r0, 0x8 + strb r0, [r1, 0xC] + movs r0, 0x2 + strb r0, [r1, 0xD] + mov r0, sp + strb r2, [r0, 0xE] + ldr r0, =sub_81D035C + str r0, [sp, 0x10] + str r4, [sp, 0x14] + ldr r0, =gUnknown_086237B4 + movs r2, 0 + bl sub_81C81D4 + add sp, 0x18 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D0304 + + thumb_func_start sub_81D035C +sub_81D035C: @ 81D035C + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r1, 0 + adds r7, r0, 0 + ldrb r0, [r7] + cmp r0, 0xE + bne _081D03A4 + ldrb r1, [r7, 0x1] + movs r0, 0x64 + adds r4, r1, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + bl pokemon_get_gender + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + bl level_by_exp + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r2, =0x02021ec4 + adds r0, r4, 0 + movs r1, 0x2 + bl pokemon_getattr + b _081D03CC + .pool +_081D03A4: + ldrb r0, [r7] + ldrb r1, [r7, 0x1] + bl get_pokemon_by_box_and_pos + adds r4, r0, 0 + bl pokemon_roll_gender + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + bl sub_80690C0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r2, =0x02021ec4 + adds r0, r4, 0 + movs r1, 0x2 + bl pokemon_getattr_encrypted +_081D03CC: + ldr r4, =0x02021ec4 + adds r0, r4, 0 + bl GetStringEnd_Limit7 + adds r0, r6, 0 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x3C + bl sub_81DB494 + adds r6, r0, 0 + cmp r5, 0 + beq _081D03F8 + cmp r5, 0xFE + beq _081D0400 + ldr r1, =gUnknown_086237F4 + b _081D0402 + .pool +_081D03F8: + ldr r1, =gUnknown_086237DC + b _081D0402 + .pool +_081D0400: + ldr r1, =gUnknown_086237E8 +_081D0402: + ldr r4, =0x02021cc4 + adds r0, r4, 0 + bl CopyString + movs r1, 0xBA + strb r1, [r0] + adds r0, 0x1 + movs r1, 0xF9 + strb r1, [r0] + adds r0, 0x1 + movs r1, 0x5 + strb r1, [r0] + adds r0, 0x1 + mov r1, r8 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + adds r0, r6, 0 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x36 + bl sub_81DB494 + adds r6, r0, 0 + ldrh r1, [r7, 0x2] + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalString + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D035C + + thumb_func_start sub_81D0450 +sub_81D0450: @ 81D0450 + push {r4,lr} + movs r0, 0xD + movs r1, 0x9C + bl sub_81C761C + adds r4, r0, 0 + cmp r4, 0 + beq _081D0498 + movs r0, 0x12 + bl sub_81C763C + str r0, [r4, 0x8] + cmp r0, 0 + beq _081D0498 + adds r0, r4, 0 + bl sub_81D0814 + adds r1, r4, 0 + adds r1, 0x98 + ldr r0, =sub_81D04C4 + str r0, [r1] + ldr r1, =0x030026fc + movs r0, 0x3 + strh r0, [r1] + ldr r1, =0x030022b0 + movs r0, 0xA + strh r0, [r1] + movs r0, 0x1 + b _081D049A + .pool +_081D0498: + movs r0, 0 +_081D049A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81D0450 + + thumb_func_start sub_81D04A0 +sub_81D04A0: @ 81D04A0 + push {lr} + movs r0, 0xD + bl sub_81C763C + adds r1, r0, 0 + adds r1, 0x98 + ldr r1, [r1] + bl _call_via_r1 + pop {r1} + bx r1 + thumb_func_end sub_81D04A0 + + thumb_func_start sub_81D04B8 +sub_81D04B8: @ 81D04B8 + push {lr} + movs r0, 0xD + bl sub_81C7650 + pop {r0} + bx r0 + thumb_func_end sub_81D04B8 + + thumb_func_start sub_81D04C4 +sub_81D04C4: @ 81D04C4 + push {r4,lr} + adds r4, r0, 0 + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081D04E4 + ldr r3, [r4, 0x8] + ldrh r0, [r3, 0x2] + cmp r0, 0 + beq _081D04E4 + subs r0, 0x1 + b _081D04FC + .pool +_081D04E4: + ldrh r1, [r2, 0x30] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081D050C + ldr r3, [r4, 0x8] + ldrh r1, [r3, 0x2] + ldrh r0, [r3] + subs r0, 0x1 + cmp r1, r0 + bge _081D050C + adds r0, r1, 0x1 +_081D04FC: + movs r1, 0 + strh r0, [r3, 0x2] + strh r1, [r4, 0xC] + adds r0, r4, 0 + bl sub_81D0814 + movs r0, 0x1 + b _081D053E +_081D050C: + ldrh r2, [r2, 0x2E] + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _081D0528 + adds r1, r4, 0 + adds r1, 0x98 + ldr r0, =sub_81D0548 + str r0, [r1] + movs r0, 0x2 + b _081D053E + .pool +_081D0528: + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + bne _081D0534 + movs r0, 0 + b _081D053E +_081D0534: + adds r1, r4, 0 + adds r1, 0x98 + ldr r0, =sub_81D05D4 + str r0, [r1] + movs r0, 0x5 +_081D053E: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D04C4 + + thumb_func_start sub_81D0548 +sub_81D0548: @ 81D0548 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081D0562 + adds r0, r4, 0 + bl sub_81D05DC + cmp r0, 0 + bne _081D05A4 +_081D0562: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x30] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081D0578 + adds r0, r4, 0 + bl sub_81D061C + cmp r0, 0 + bne _081D05A4 +_081D0578: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x30] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _081D058E + adds r0, r4, 0 + bl sub_81D0664 + cmp r0, 0 + bne _081D05A4 +_081D058E: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x30] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _081D05AC + adds r0, r4, 0 + bl sub_81D0688 + cmp r0, 0 + beq _081D05AC +_081D05A4: + movs r0, 0x3 + b _081D05CA + .pool +_081D05AC: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _081D05C0 + movs r0, 0 + b _081D05CA + .pool +_081D05C0: + adds r1, r4, 0 + adds r1, 0x98 + ldr r0, =sub_81D04C4 + str r0, [r1] + movs r0, 0x4 +_081D05CA: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D0548 + + thumb_func_start sub_81D05D4 +sub_81D05D4: @ 81D05D4 + ldr r0, =0x000186ae + bx lr + .pool + thumb_func_end sub_81D05D4 + + thumb_func_start sub_81D05DC +sub_81D05DC: @ 81D05DC + push {r4,lr} + adds r1, r0, 0 + ldrh r0, [r1, 0xC] + adds r2, r0, 0 + cmp r2, 0x18 + bhi _081D05F0 + cmp r2, 0x8 + bls _081D0612 + subs r0, 0x9 + b _081D060C +_081D05F0: + ldrh r3, [r1, 0x10] + adds r2, r3, 0 + cmp r2, 0 + beq _081D0612 + ldrh r0, [r1, 0xC] + subs r0, 0x1B + ldrh r4, [r1, 0xE] + adds r0, r4 + strh r0, [r1, 0xC] + lsls r0, 16 + lsrs r0, 16 + cmp r0, r2 + bcc _081D060E + subs r0, r3, 0x1 +_081D060C: + strh r0, [r1, 0xC] +_081D060E: + movs r0, 0x1 + b _081D0614 +_081D0612: + movs r0, 0 +_081D0614: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81D05DC + + thumb_func_start sub_81D061C +sub_81D061C: @ 81D061C + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0xC] + adds r1, r0, 0 + cmp r1, 0x18 + bhi _081D065C + ldrh r3, [r2, 0xE] + cmp r1, r3 + bcs _081D0640 + adds r0, 0x9 + strh r0, [r2, 0xC] + ldrh r1, [r2, 0x10] + lsls r0, 16 + lsrs r0, 16 + cmp r0, r1 + bcc _081D0658 + subs r0, r1, 0x1 + b _081D0656 +_081D0640: + ldrh r0, [r2, 0x12] + cmp r0, 0 + beq _081D065C + ldrh r1, [r2, 0xC] + ldrh r0, [r2, 0xE] + subs r0, r1, r0 + ldrh r1, [r2, 0x12] + cmp r0, r1 + blt _081D0654 + subs r0, r1, 0x1 +_081D0654: + adds r0, 0x1B +_081D0656: + strh r0, [r2, 0xC] +_081D0658: + movs r0, 0x1 + b _081D065E +_081D065C: + movs r0, 0 +_081D065E: + pop {r1} + bx r1 + thumb_func_end sub_81D061C + + thumb_func_start sub_81D0664 +sub_81D0664: @ 81D0664 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r4, [r5, 0xC] + adds r0, r4, 0 + movs r1, 0x9 + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + bne _081D067C + movs r0, 0 + b _081D0682 +_081D067C: + subs r0, r4, 0x1 + strh r0, [r5, 0xC] + movs r0, 0x1 +_081D0682: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81D0664 + + thumb_func_start sub_81D0688 +sub_81D0688: @ 81D0688 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r4, [r5, 0xC] + adds r0, r4, 0 + movs r1, 0x9 + bl __umodsi3 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x7 + bgt _081D06BC + cmp r4, 0x1A + bhi _081D06AC + ldrh r0, [r5, 0x10] + subs r0, 0x1 + cmp r4, r0 + bge _081D06BC + b _081D06B4 +_081D06AC: + ldrh r0, [r5, 0x12] + subs r0, 0x1 + cmp r1, r0 + bge _081D06BC +_081D06B4: + adds r0, r4, 0x1 + strh r0, [r5, 0xC] + movs r0, 0x1 + b _081D06BE +_081D06BC: + movs r0, 0 +_081D06BE: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81D0688 + + thumb_func_start sub_81D06C4 +sub_81D06C4: @ 81D06C4 + push {lr} + movs r0, 0xD + bl sub_81C763C + ldr r0, [r0, 0x8] + ldrh r0, [r0, 0x2] + pop {r1} + bx r1 + thumb_func_end sub_81D06C4 + + thumb_func_start sub_81D06D4 +sub_81D06D4: @ 81D06D4 + push {lr} + movs r0, 0xD + bl sub_81C763C + ldr r0, [r0, 0x8] + ldrh r0, [r0] + pop {r1} + bx r1 + thumb_func_end sub_81D06D4 + + thumb_func_start sub_81D06E4 +sub_81D06E4: @ 81D06E4 + push {r4-r7,lr} + adds r5, r0, 0 + adds r7, r1, 0 + adds r6, r2, 0 + movs r0, 0xD + bl sub_81C763C + ldr r1, [r0, 0x8] + ldrh r0, [r1, 0x2] + lsls r0, 2 + adds r0, 0x4 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0xE + bne _081D0730 + ldrb r1, [r1, 0x1] + movs r0, 0x64 + adds r4, r1, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x2 + adds r2, r5, 0 + bl pokemon_getattr + adds r0, r4, 0 + bl level_by_exp + strb r0, [r7] + adds r0, r4, 0 + bl pokemon_get_gender + strb r0, [r6] + b _081D0752 + .pool +_081D0730: + ldrb r0, [r1] + ldrb r1, [r1, 0x1] + bl get_pokemon_by_box_and_pos + adds r4, r0, 0 + bl pokemon_roll_gender + strb r0, [r6] + adds r0, r4, 0 + bl sub_80690C0 + strb r0, [r7] + adds r0, r4, 0 + movs r1, 0x2 + adds r2, r5, 0 + bl pokemon_getattr_encrypted +_081D0752: + adds r0, r5, 0 + bl GetStringEnd_Limit7 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81D06E4 + + thumb_func_start sub_81D0760 +sub_81D0760: @ 81D0760 + push {r4-r7,lr} + adds r5, r0, 0 + adds r6, r1, 0 + adds r7, r2, 0 + movs r0, 0xD + bl sub_81C763C + ldr r1, [r0, 0x8] + ldrh r0, [r1, 0x2] + lsls r0, 2 + adds r0, 0x4 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0xE + bne _081D07AC + ldrb r1, [r1, 0x1] + movs r0, 0x64 + adds r4, r1, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + strh r0, [r5] + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + str r0, [r6] + adds r0, r4, 0 + movs r1, 0x1 + bl pokemon_getattr + b _081D07D0 + .pool +_081D07AC: + ldrb r0, [r1] + ldrb r1, [r1, 0x1] + bl get_pokemon_by_box_and_pos + adds r4, r0, 0 + movs r1, 0xB + bl pokemon_getattr_encrypted + strh r0, [r5] + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr_encrypted + str r0, [r6] + adds r0, r4, 0 + movs r1, 0x1 + bl pokemon_getattr_encrypted +_081D07D0: + str r0, [r7] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81D0760 + + thumb_func_start sub_81D07D8 +sub_81D07D8: @ 81D07D8 + push {lr} + movs r0, 0xD + bl sub_81C763C + ldr r1, [r0, 0x8] + ldrh r0, [r1, 0x2] + lsls r0, 2 + adds r0, 0x4 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0xE + beq _081D07FA + ldrb r1, [r1, 0x1] + movs r2, 0x52 + bl get_pokemon_data_from_any_box + b _081D080A +_081D07FA: + ldrb r1, [r1, 0x1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x52 + bl pokemon_getattr +_081D080A: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D07D8 + + thumb_func_start sub_81D0814 +sub_81D0814: @ 81D0814 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrh r1, [r0, 0x2] + lsls r1, 2 + adds r1, 0x4 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0xE + bne _081D0848 + ldrb r1, [r1, 0x1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x53 + bl pokemon_getattr + b _081D0852 + .pool +_081D0848: + ldrb r0, [r1] + ldrb r1, [r1, 0x1] + movs r2, 0x53 + bl get_pokemon_data_from_any_box +_081D0852: + mov r12, r0 + movs r0, 0 + strh r0, [r5, 0x10] + strh r0, [r5, 0x12] + movs r6, 0 + ldr r0, =gUnknown_086237F8 + mov r9, r0 + mov r10, r9 +_081D0862: + lsls r2, r6, 2 + mov r3, r9 + adds r1, r2, r3 + movs r0, 0x1 + ldrb r3, [r1] + lsls r0, r3 + subs r4, r0, 0x1 + mov r0, r12 + ands r4, r0 + ldrb r0, [r1, 0x3] + adds r7, r2, 0 + cmp r0, 0 + bne _081D08AC + movs r3, 0 + adds r6, 0x1 + mov r8, r6 + cmp r3, r4 + bge _081D08D6 + adds r6, r5, 0 + adds r6, 0x14 + mov r1, r10 + adds r0, r7, r1 + ldrb r2, [r0, 0x2] +_081D0890: + ldrh r0, [r5, 0x10] + adds r1, r0, 0x1 + strh r1, [r5, 0x10] + lsls r0, 16 + lsrs r0, 14 + adds r0, r6, r0 + adds r1, r2, r3 + str r1, [r0] + adds r3, 0x1 + cmp r3, r4 + blt _081D0890 + b _081D08D6 + .pool +_081D08AC: + movs r3, 0 + adds r6, 0x1 + mov r8, r6 + cmp r3, r4 + bge _081D08D6 + adds r6, r5, 0 + adds r6, 0x78 + mov r1, r10 + adds r0, r7, r1 + ldrb r2, [r0, 0x2] +_081D08C0: + ldrh r0, [r5, 0x12] + adds r1, r0, 0x1 + strh r1, [r5, 0x12] + lsls r0, 16 + lsrs r0, 14 + adds r0, r6, r0 + adds r1, r2, r3 + str r1, [r0] + adds r3, 0x1 + cmp r3, r4 + blt _081D08C0 +_081D08D6: + mov r3, r9 + adds r0, r7, r3 + mov r1, r12 + ldrb r0, [r0] + lsrs r1, r0 + mov r12, r1 + mov r6, r8 + cmp r6, 0x10 + bls _081D0862 + ldrh r0, [r5, 0x10] + cmp r0, 0 + beq _081D0900 + subs r0, 0x1 + movs r1, 0x9 + bl __divsi3 + lsls r1, r0, 3 + adds r1, r0 + movs r0, 0 + strh r1, [r5, 0xE] + b _081D0904 +_081D0900: + strh r0, [r5, 0xE] + movs r0, 0x1B +_081D0904: + strh r0, [r5, 0xC] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81D0814 + + thumb_func_start sub_81D0914 +sub_81D0914: @ 81D0914 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0xD + bl sub_81C763C + ldrh r1, [r0, 0x10] + str r1, [r4] + adds r0, 0x14 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81D0914 + + thumb_func_start sub_81D092C +sub_81D092C: @ 81D092C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0xD + bl sub_81C763C + ldrh r1, [r0, 0x12] + str r1, [r4] + adds r0, 0x78 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81D092C + + thumb_func_start sub_81D0944 +sub_81D0944: @ 81D0944 + push {lr} + movs r0, 0xD + bl sub_81C763C + ldrh r0, [r0, 0xC] + pop {r1} + bx r1 + thumb_func_end sub_81D0944 + + thumb_func_start sub_81D0954 +sub_81D0954: @ 81D0954 + push {lr} + movs r0, 0xD + bl sub_81C763C + adds r1, r0, 0 + ldrh r0, [r1, 0xC] + cmp r0, 0x18 + ble _081D096C + subs r0, 0x1B + lsls r0, 2 + adds r1, 0x78 + b _081D0970 +_081D096C: + lsls r0, 2 + adds r1, 0x14 +_081D0970: + adds r1, r0 + ldr r0, [r1] + pop {r1} + bx r1 + thumb_func_end sub_81D0954 + + thumb_func_start sub_81D0978 +sub_81D0978: @ 81D0978 + push {r4,lr} + ldr r1, =0x0000101c + movs r0, 0xE + bl sub_81C761C + adds r4, r0, 0 + cmp r4, 0 + beq _081D09A8 + ldr r0, =sub_81D0A6C + movs r1, 0x1 + bl sub_81C7078 + str r0, [r4, 0x4] + ldr r0, =sub_81D0A58 + str r0, [r4] + movs r0, 0x1 + b _081D09AA + .pool +_081D09A8: + movs r0, 0 +_081D09AA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81D0978 + + thumb_func_start sub_81D09B0 +sub_81D09B0: @ 81D09B0 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0xE + bl sub_81C763C + adds r5, r0, 0 + ldr r0, =gUnknown_08624BA0 + lsls r4, 2 + adds r4, r0 + ldr r0, [r4] + movs r1, 0x1 + bl sub_81C7078 + str r0, [r5, 0x4] + ldr r0, =sub_81D0A58 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D09B0 + + thumb_func_start sub_81D09E0 +sub_81D09E0: @ 81D09E0 + push {lr} + movs r0, 0xE + bl sub_81C763C + ldr r0, [r0] + bl _call_via_r0 + pop {r1} + bx r1 + thumb_func_end sub_81D09E0 + + thumb_func_start sub_81D09F4 +sub_81D09F4: @ 81D09F4 + push {r4,lr} + movs r0, 0xE + bl sub_81C763C + adds r4, r0, 0 + ldrb r0, [r4, 0xA] + bl RemoveWindow + ldrb r0, [r4, 0x8] + bl RemoveWindow + ldrb r0, [r4, 0xC] + bl RemoveWindow + ldrb r0, [r4, 0xE] + bl RemoveWindow + adds r0, r4, 0 + bl sub_81D1178 + movs r0, 0x9 + bl FreeObjectTilesByTag + movs r0, 0xF + bl FreeObjectPaletteByTag + movs r0, 0x10 + bl FreeObjectPaletteByTag + movs r0, 0x11 + bl FreeObjectPaletteByTag + movs r0, 0x12 + bl FreeObjectPaletteByTag + movs r0, 0x13 + bl FreeObjectPaletteByTag + ldr r0, [r4, 0x14] + bl obj_free_rotscale_entry + ldr r0, [r4, 0x14] + bl RemoveObjectAndFreeTiles + movs r0, 0xE + bl sub_81C7650 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81D09F4 + + thumb_func_start sub_81D0A58 +sub_81D0A58: @ 81D0A58 + push {lr} + movs r0, 0xE + bl sub_81C763C + ldr r0, [r0, 0x4] + bl sub_81C70D8 + pop {r1} + bx r1 + thumb_func_end sub_81D0A58 + + thumb_func_start sub_81D0A6C +sub_81D0A6C: @ 81D0A6C + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + movs r0, 0xE + bl sub_81C763C + adds r5, r0, 0 + cmp r4, 0x9 + bls _081D0A80 + b _081D0C48 +_081D0A80: + lsls r0, r4, 2 + ldr r1, =_081D0A90 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081D0A90: + .4byte _081D0AB8 + .4byte _081D0B04 + .4byte _081D0B74 + .4byte _081D0B88 + .4byte _081D0B9C + .4byte _081D0BB0 + .4byte _081D0BC4 + .4byte _081D0BD8 + .4byte _081D0BE8 + .4byte _081D0C3C +_081D0AB8: + ldr r0, =gUnknown_08624B98 + movs r1, 0x2 + bl sub_81C7B54 + ldr r1, =gUnknown_08DDE030 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + adds r1, r5, 0 + adds r1, 0x1C + movs r0, 0x2 + bl SetBgTilemapBuffer + ldr r1, =gUnknown_08DDE12C + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + ldr r0, =gUnknown_08DDE010 + movs r1, 0x10 + movs r2, 0x20 + bl sub_81C7944 + b _081D0BBA + .pool +_081D0B04: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _081D0B12 + b _081D0C44 +_081D0B12: + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8199DF0 + ldr r1, =gUnknown_086240B8 + str r4, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0x1 + bl decompress_and_copy_tile_data_to_vram + ldr r0, =0x0000081c + adds r1, r5, r0 + movs r0, 0x1 + bl SetBgTilemapBuffer + movs r0, 0x20 + str r0, [sp] + movs r0, 0x14 + str r0, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + ldr r0, =gUnknown_08623FF8 + movs r1, 0x20 + movs r2, 0xA0 + bl sub_81C7944 + ldr r0, =gUnknown_08624098 + movs r1, 0xA0 + movs r2, 0x20 + bl sub_81C7944 + movs r0, 0x1 + b _081D0BBC + .pool +_081D0B74: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _081D0C44 + adds r0, r5, 0 + bl sub_81D0E60 + movs r0, 0 + b _081D0C4A +_081D0B88: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _081D0C44 + adds r0, r5, 0 + bl sub_81D0FCC + movs r0, 0 + b _081D0C4A +_081D0B9C: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _081D0C44 + adds r0, r5, 0 + bl sub_81D10A4 + movs r0, 0 + b _081D0C4A +_081D0BB0: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _081D0C44 +_081D0BBA: + movs r0, 0x2 +_081D0BBC: + bl CopyBgTilemapBufferToVram + movs r0, 0 + b _081D0C4A +_081D0BC4: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _081D0C44 + adds r0, r5, 0 + bl sub_81D1148 + movs r0, 0x1 + b _081D0C4A +_081D0BD8: + adds r0, r5, 0 + bl sub_81D12D8 + movs r0, 0xA + bl sub_81C7BA4 + movs r0, 0 + b _081D0C4A +_081D0BE8: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _081D0C44 + adds r0, r5, 0 + bl sub_81D13FC + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl HideBg + movs r0, 0x1 + bl sub_81C7AC0 + movs r0, 0 + b _081D0C4A +_081D0C3C: + bl sub_81C7B34 + cmp r0, 0 + beq _081D0C48 +_081D0C44: + movs r0, 0x2 + b _081D0C4A +_081D0C48: + movs r0, 0x4 +_081D0C4A: + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81D0A6C + + thumb_func_start sub_81D0C54 +sub_81D0C54: @ 81D0C54 + push {lr} + cmp r0, 0 + beq _081D0C60 + cmp r0, 0x1 + beq _081D0C70 + b _081D0C7C +_081D0C60: + movs r0, 0x5 + bl audio_play + movs r0, 0 + bl sub_81C7AC0 + movs r0, 0 + b _081D0C7E +_081D0C70: + bl sub_81C7B34 + cmp r0, 0 + beq _081D0C7C + movs r0, 0x2 + b _081D0C7E +_081D0C7C: + movs r0, 0x4 +_081D0C7E: + pop {r1} + bx r1 + thumb_func_end sub_81D0C54 + + thumb_func_start sub_81D0C84 +sub_81D0C84: @ 81D0C84 + push {r4,r5,lr} + adds r5, r0, 0 + movs r0, 0xE + bl sub_81C763C + adds r4, r0, 0 + cmp r5, 0x6 + bhi _081D0D24 + lsls r0, r5, 2 + ldr r1, =_081D0CA4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081D0CA4: + .4byte _081D0CC0 + .4byte _081D0CD0 + .4byte _081D0CE4 + .4byte _081D0CEE + .4byte _081D0CF8 + .4byte _081D0D02 + .4byte _081D0D16 +_081D0CC0: + movs r0, 0x5 + bl audio_play + adds r0, r4, 0 + bl sub_81D11D8 + movs r0, 0 + b _081D0D26 +_081D0CD0: + adds r0, r4, 0 + bl sub_81D1234 + cmp r0, 0 + bne _081D0D20 + adds r0, r4, 0 + bl sub_81D0FF0 + movs r0, 0x1 + b _081D0D26 +_081D0CE4: + adds r0, r4, 0 + bl sub_81D12D8 + movs r0, 0x1 + b _081D0D26 +_081D0CEE: + adds r0, r4, 0 + bl sub_81D10D0 + movs r0, 0x1 + b _081D0D26 +_081D0CF8: + adds r0, r4, 0 + bl sub_81D0E84 + movs r0, 0x1 + b _081D0D26 +_081D0D02: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _081D0D20 + adds r0, r4, 0 + bl sub_81D11FC + movs r0, 0 + b _081D0D26 +_081D0D16: + adds r0, r4, 0 + bl sub_81D1234 + cmp r0, 0 + beq _081D0D24 +_081D0D20: + movs r0, 0x2 + b _081D0D26 +_081D0D24: + movs r0, 0x4 +_081D0D26: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81D0C84 + + thumb_func_start sub_81D0D2C +sub_81D0D2C: @ 81D0D2C + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0xE + bl sub_81C763C + adds r5, r0, 0 + cmp r4, 0x1 + beq _081D0D5C + cmp r4, 0x1 + bgt _081D0D46 + cmp r4, 0 + beq _081D0D4C + b _081D0D84 +_081D0D46: + cmp r4, 0x2 + beq _081D0D76 + b _081D0D84 +_081D0D4C: + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_81D1448 + movs r0, 0 + b _081D0D86 +_081D0D5C: + adds r0, r5, 0 + bl sub_81D1524 + cmp r0, 0 + bne _081D0D80 + adds r0, r5, 0 + bl sub_81D0EFC + movs r0, 0xB + bl sub_81C7BA4 + movs r0, 0 + b _081D0D86 +_081D0D76: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _081D0D84 +_081D0D80: + movs r0, 0x2 + b _081D0D86 +_081D0D84: + movs r0, 0x4 +_081D0D86: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81D0D2C + + thumb_func_start sub_81D0D8C +sub_81D0D8C: @ 81D0D8C + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0xE + bl sub_81C763C + adds r5, r0, 0 + cmp r4, 0x1 + beq _081D0DC0 + cmp r4, 0x1 + bgt _081D0DA6 + cmp r4, 0 + beq _081D0DB0 + b _081D0DF6 +_081D0DA6: + cmp r4, 0x2 + beq _081D0DD4 + cmp r4, 0x3 + beq _081D0DE8 + b _081D0DF6 +_081D0DB0: + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_81D1500 + movs r0, 0 + b _081D0DF8 +_081D0DC0: + adds r0, r5, 0 + bl sub_81D1524 + cmp r0, 0 + bne _081D0DF2 + adds r0, r5, 0 + bl sub_81D1448 + movs r0, 0 + b _081D0DF8 +_081D0DD4: + adds r0, r5, 0 + bl sub_81D1524 + cmp r0, 0 + bne _081D0DF2 + adds r0, r5, 0 + bl sub_81D0EFC + movs r0, 0 + b _081D0DF8 +_081D0DE8: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _081D0DF6 +_081D0DF2: + movs r0, 0x2 + b _081D0DF8 +_081D0DF6: + movs r0, 0x4 +_081D0DF8: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81D0D8C + + thumb_func_start sub_81D0E00 +sub_81D0E00: @ 81D0E00 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0xE + bl sub_81C763C + adds r5, r0, 0 + cmp r4, 0x1 + beq _081D0E30 + cmp r4, 0x1 + bgt _081D0E1A + cmp r4, 0 + beq _081D0E20 + b _081D0E58 +_081D0E1A: + cmp r4, 0x2 + beq _081D0E4A + b _081D0E58 +_081D0E20: + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_81D1500 + movs r0, 0 + b _081D0E5A +_081D0E30: + adds r0, r5, 0 + bl sub_81D1524 + cmp r0, 0 + bne _081D0E54 + adds r0, r5, 0 + bl sub_81D0E84 + movs r0, 0xA + bl sub_81C7BA4 + movs r0, 0 + b _081D0E5A +_081D0E4A: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _081D0E58 +_081D0E54: + movs r0, 0x2 + b _081D0E5A +_081D0E58: + movs r0, 0x4 +_081D0E5A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81D0E00 + + thumb_func_start sub_81D0E60 +sub_81D0E60: @ 81D0E60 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gUnknown_08624BB8 + bl AddWindow + strh r0, [r4, 0xA] + lsls r0, 24 + lsrs r0, 24 + bl PutWindowTilemap + adds r0, r4, 0 + bl sub_81D0E84 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D0E60 + + thumb_func_start sub_81D0E84 +sub_81D0E84: @ 81D0E84 + push {r4,r5,lr} + sub sp, 0x10 + adds r5, r0, 0 + ldr r1, =gUnknown_08624BC0 + add r0, sp, 0xC + movs r2, 0x3 + bl memcpy + ldr r4, =0x02021cc4 + bl sub_81D07D8 + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x2 + bl ConvertIntToDecimalString + bl sub_81AFBF0 + movs r0, 0 + adds r1, r4, 0 + bl sub_81AFC0C + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EC030 + adds r0, r4, 0 + bl sub_81AFC28 + ldrb r0, [r5, 0xA] + movs r1, 0x44 + bl FillWindowPixelBuffer + ldrb r0, [r5, 0xA] + add r1, sp, 0xC + str r1, [sp] + movs r1, 0x1 + negs r1, r1 + str r1, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r2, 0 + movs r3, 0x1 + bl box_print + ldrb r0, [r5, 0xA] + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D0E84 + + thumb_func_start sub_81D0EFC +sub_81D0EFC: @ 81D0EFC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + adds r7, r0, 0 + bl sub_81D0954 + adds r5, r0, 0 + ldr r1, =gUnknown_08624BC0 + add r0, sp, 0xC + movs r2, 0x3 + bl memcpy + ldrb r0, [r7, 0xA] + movs r1, 0x44 + bl FillWindowPixelBuffer + cmp r5, 0x18 + bhi _081D0F60 + lsls r1, r5, 3 + ldr r0, =gRibbonDescriptionPointers + adds r6, r1, r0 + movs r5, 0x80 + lsls r5, 17 + movs r4, 0x1 +_081D0F2E: + ldrb r0, [r7, 0xA] + lsrs r3, r5, 24 + add r1, sp, 0xC + str r1, [sp] + movs r1, 0x1 + negs r1, r1 + str r1, [sp, 0x4] + ldm r6!, {r1} + str r1, [sp, 0x8] + movs r1, 0x1 + movs r2, 0 + bl box_print + movs r0, 0x80 + lsls r0, 21 + adds r5, r0 + subs r4, 0x1 + cmp r4, 0 + bge _081D0F2E + b _081D0FAA + .pool +_081D0F60: + ldr r0, =0x03005d8c + ldr r0, [r0] + adds r0, r5 + ldr r1, =0x0000318f + adds r0, r1 + ldrb r5, [r0] + cmp r5, 0 + beq _081D0FB2 + subs r5, 0x1 + movs r4, 0 + ldr r0, =gGiftRibbonDescriptionPointers + mov r8, r0 + movs r6, 0x80 + lsls r6, 17 +_081D0F7C: + ldrb r0, [r7, 0xA] + lsrs r3, r6, 24 + add r1, sp, 0xC + str r1, [sp] + movs r1, 0x1 + negs r1, r1 + str r1, [sp, 0x4] + lsls r1, r4, 2 + lsls r2, r5, 3 + adds r1, r2 + add r1, r8 + ldr r1, [r1] + str r1, [sp, 0x8] + movs r1, 0x1 + movs r2, 0 + bl box_print + movs r0, 0x80 + lsls r0, 21 + adds r6, r0 + adds r4, 0x1 + cmp r4, 0x1 + ble _081D0F7C +_081D0FAA: + ldrb r0, [r7, 0xA] + movs r1, 0x2 + bl CopyWindowToVram +_081D0FB2: + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D0EFC + + thumb_func_start sub_81D0FCC +sub_81D0FCC: @ 81D0FCC + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gUnknown_08624BC4 + bl AddWindow + strh r0, [r4, 0x8] + lsls r0, 24 + lsrs r0, 24 + bl PutWindowTilemap + adds r0, r4, 0 + bl sub_81D0FF0 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D0FCC + + thumb_func_start sub_81D0FF0 +sub_81D0FF0: @ 81D0FF0 + push {r4-r7,lr} + sub sp, 0x10 + ldrh r7, [r0, 0x8] + ldrb r5, [r0, 0x8] + adds r0, r5, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r4, =0x02021ec4 + mov r6, sp + adds r6, 0xD + adds r0, r4, 0 + add r1, sp, 0xC + adds r2, r6, 0 + bl sub_81D06E4 + movs r0, 0x1 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0 + bl Print + ldrb r0, [r6] + cmp r0, 0 + beq _081D1040 + cmp r0, 0xFE + beq _081D1048 + ldr r1, =gUnknown_08624BE4 + b _081D104A + .pool +_081D1040: + ldr r1, =gUnknown_08624BCC + b _081D104A + .pool +_081D1048: + ldr r1, =gUnknown_08624BD8 +_081D104A: + ldr r5, =0x02021cc4 + adds r0, r5, 0 + bl CopyString + movs r1, 0xBA + strb r1, [r0] + adds r0, 0x1 + movs r1, 0xF9 + strb r1, [r0] + adds r0, 0x1 + movs r1, 0x5 + strb r1, [r0] + adds r0, 0x1 + add r1, sp, 0xC + ldrb r1, [r1] + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + lsls r4, r7, 24 + lsrs r4, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + adds r2, r5, 0 + movs r3, 0x3C + bl Print + adds r0, r4, 0 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D0FF0 + + thumb_func_start sub_81D10A4 +sub_81D10A4: @ 81D10A4 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gUnknown_08624BE8 + bl AddWindow + strh r0, [r4, 0xC] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldrb r0, [r4, 0xC] + bl PutWindowTilemap + adds r0, r4, 0 + bl sub_81D10D0 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D10A4 + + thumb_func_start sub_81D10D0 +sub_81D10D0: @ 81D10D0 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0xC + mov r8, r0 + bl sub_81D06C4 + adds r4, r0, 0 + adds r4, 0x1 + bl sub_81D06D4 + adds r6, r0, 0 + ldr r5, =0x02021cc4 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + movs r1, 0xBA + strb r1, [r0] + adds r0, 0x1 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x38 + bl GetStringCenterAlignXOffset + adds r3, r0, 0 + mov r1, r8 + ldrb r0, [r1, 0xC] + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x1 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + bl Print + mov r1, r8 + ldrb r0, [r1, 0xC] + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D10D0 + + thumb_func_start sub_81D1148 +sub_81D1148: @ 81D1148 + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + add r1, sp, 0x4 + add r2, sp, 0x8 + mov r0, sp + bl sub_81D0760 + bl dp13_810BB8C + movs r0, 0x28 + movs r1, 0x68 + bl sub_81D1184 + strh r0, [r4, 0x10] + movs r0, 0xF + movs r1, 0 + bl sub_81C7990 + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81D1148 + + thumb_func_start sub_81D1178 +sub_81D1178: @ 81D1178 + push {lr} + ldrh r0, [r0, 0x10] + bl sub_818D820 + pop {r0} + bx r0 + thumb_func_end sub_81D1178 + + thumb_func_start sub_81D1184 +sub_81D1184: @ 81D1184 + push {lr} + sub sp, 0x1C + add r1, sp, 0x14 + add r2, sp, 0x18 + add r0, sp, 0x10 + bl sub_81D0760 + add r0, sp, 0x10 + ldrh r0, [r0] + ldr r1, [sp, 0x18] + ldr r2, [sp, 0x14] + movs r3, 0x28 + str r3, [sp] + movs r3, 0x68 + str r3, [sp, 0x4] + movs r3, 0xF + str r3, [sp, 0x8] + ldr r3, =0x0000ffff + str r3, [sp, 0xC] + movs r3, 0x1 + bl sub_818D7D8 + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x02020630 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r1 + ldrb r3, [r2, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r3 + strb r1, [r2, 0x5] + add sp, 0x1C + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D1184 + + thumb_func_start sub_81D11D8 +sub_81D11D8: @ 81D11D8 + push {lr} + ldrh r1, [r0, 0x10] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r2, 0x20 + negs r2, r2 + movs r1, 0x28 + movs r3, 0x6 + bl sub_81D1258 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D11D8 + + thumb_func_start sub_81D11FC +sub_81D11FC: @ 81D11FC + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x10] + bl sub_818D820 + movs r5, 0x20 + negs r5, r5 + adds r0, r5, 0 + movs r1, 0x68 + bl sub_81D1184 + strh r0, [r4, 0x10] + ldrh r1, [r4, 0x10] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + adds r1, r5, 0 + movs r2, 0x28 + movs r3, 0x6 + bl sub_81D1258 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D11FC + + thumb_func_start sub_81D1234 +sub_81D1234: @ 81D1234 + ldr r2, =0x02020630 + ldrh r1, [r0, 0x10] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + eors r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + bx lr + .pool + thumb_func_end sub_81D1234 + + thumb_func_start sub_81D1258 +sub_81D1258: @ 81D1258 + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r2, 0 + adds r5, r3, 0 + subs r0, r6, r1 + strh r1, [r4, 0x20] + lsls r1, 4 + strh r1, [r4, 0x2E] + lsls r0, 4 + adds r1, r5, 0 + bl __udivsi3 + strh r0, [r4, 0x30] + strh r5, [r4, 0x32] + strh r6, [r4, 0x34] + ldr r0, =sub_81D1284 + str r0, [r4, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D1258 + + thumb_func_start sub_81D1284 +sub_81D1284: @ 81D1284 + push {lr} + adds r2, r0, 0 + ldrh r1, [r2, 0x32] + movs r3, 0x32 + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _081D12C8 + subs r0, r1, 0x1 + strh r0, [r2, 0x32] + ldrh r0, [r2, 0x30] + ldrh r1, [r2, 0x2E] + adds r0, r1 + strh r0, [r2, 0x2E] + lsls r0, 16 + asrs r0, 20 + strh r0, [r2, 0x20] + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + bgt _081D12BA + adds r0, r2, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + b _081D12D0 +_081D12BA: + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + b _081D12D0 +_081D12C8: + ldrh r0, [r2, 0x34] + strh r0, [r2, 0x20] + ldr r0, =DummyObjectCallback + str r0, [r2, 0x1C] +_081D12D0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D1284 + + thumb_func_start sub_81D12D8 +sub_81D12D8: @ 81D12D8 + push {r4-r6,lr} + bl sub_81D1350 + ldr r5, =0x030012c0 + adds r0, r5, 0 + bl sub_81D0914 + adds r6, r0, 0 + ldr r2, =0x030012c4 + movs r1, 0 + str r1, [r2] + ldr r0, [r5] + cmp r1, r0 + bcs _081D130A + adds r4, r2, 0 +_081D12F6: + ldr r0, [r4] + ldm r6!, {r1} + bl sub_81D1370 + ldr r1, [r4] + adds r1, 0x1 + str r1, [r4] + ldr r0, [r5] + cmp r1, r0 + bcc _081D12F6 +_081D130A: + ldr r4, =0x030012c0 + adds r0, r4, 0 + bl sub_81D092C + adds r6, r0, 0 + ldr r2, =0x030012c4 + movs r1, 0 + str r1, [r2] + ldr r0, [r4] + cmp r1, r0 + bcs _081D133A + adds r4, r2, 0 +_081D1322: + ldr r0, [r4] + adds r0, 0x1B + ldm r6!, {r1} + bl sub_81D1370 + ldr r1, [r4] + adds r1, 0x1 + str r1, [r4] + ldr r0, =0x030012c0 + ldr r0, [r0] + cmp r1, r0 + bcc _081D1322 +_081D133A: + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D12D8 + + thumb_func_start sub_81D1350 +sub_81D1350: @ 81D1350 + push {lr} + sub sp, 0x8 + movs r0, 0x20 + str r0, [sp] + movs r0, 0x14 + str r0, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + add sp, 0x8 + pop {r0} + bx r0 + thumb_func_end sub_81D1350 + + thumb_func_start sub_81D1370 +sub_81D1370: @ 81D1370 + push {r4-r6,lr} + sub sp, 0x10 + adds r4, r0, 0 + adds r6, r1, 0 + movs r1, 0x9 + bl __umodsi3 + adds r5, r0, 0 + lsls r5, 1 + adds r5, 0xB + adds r0, r4, 0 + movs r1, 0x9 + bl __udivsi3 + adds r4, r0, 0 + lsls r4, 1 + adds r4, 0x4 + add r0, sp, 0x8 + adds r1, r6, 0 + bl sub_81D13BC + lsls r5, 24 + lsrs r5, 24 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x2 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x1 + add r1, sp, 0x8 + adds r2, r5, 0 + adds r3, r4, 0 + bl CopyToBgTilemapBufferRect + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81D1370 + + thumb_func_start sub_81D13BC +sub_81D13BC: @ 81D13BC + push {r4,r5,lr} + ldr r2, =gUnknown_08624BF8 + lsls r1, 2 + adds r1, r2 + ldrh r3, [r1, 0x2] + adds r3, 0x2 + lsls r3, 16 + ldrh r1, [r1] + lsls r1, 1 + adds r1, 0x1 + lsls r1, 16 + lsrs r1, 16 + lsrs r3, 4 + adds r2, r1, 0 + orrs r2, r3 + strh r2, [r0] + movs r5, 0x80 + lsls r5, 3 + adds r4, r5, 0 + orrs r2, r4 + strh r2, [r0, 0x2] + adds r1, 0x1 + orrs r1, r3 + strh r1, [r0, 0x4] + orrs r1, r4 + strh r1, [r0, 0x6] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D13BC + + thumb_func_start sub_81D13FC +sub_81D13FC: @ 81D13FC + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gUnknown_08624C78 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_08624C80 + bl sub_81C795C + ldr r0, =gUnknown_08624D04 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + str r1, [r4, 0x14] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D13FC + + thumb_func_start sub_81D1448 +sub_81D1448: @ 81D1448 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r6, r0, 0 + bl sub_81D0944 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r4, 0 + movs r1, 0x9 + bl __modsi3 + adds r5, r0, 0 + lsls r5, 4 + adds r5, 0x60 + adds r0, r4, 0 + movs r1, 0x9 + bl __divsi3 + lsls r0, 4 + adds r0, 0x28 + ldr r1, [r6, 0x14] + movs r2, 0 + mov r8, r2 + strh r5, [r1, 0x20] + ldr r1, [r6, 0x14] + strh r0, [r1, 0x22] + bl sub_81D0954 + adds r4, r0, 0 + movs r0, 0x9 + bl GetObjectTileRangeStartByTag + ldr r3, [r6, 0x14] + ldr r1, =gUnknown_08624BF8 + lsls r4, 2 + adds r4, r1 + ldrh r1, [r4] + lsls r1, 4 + adds r0, r1 + ldr r2, =0x000003ff + adds r1, r2, 0 + ands r0, r1 + ldrh r2, [r3, 0x4] + ldr r1, =0xfffffc00 + ands r1, r2 + orrs r1, r0 + strh r1, [r3, 0x4] + ldrh r0, [r4, 0x2] + adds r0, 0xF + lsls r0, 16 + lsrs r0, 16 + bl IndexOfObjectPaletteTag + ldr r3, [r6, 0x14] + lsls r0, 4 + ldrb r2, [r3, 0x5] + movs r1, 0xF + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x5] + ldr r0, [r6, 0x14] + movs r1, 0x1 + bl StartObjectRotScalAnim + ldr r1, [r6, 0x14] + adds r1, 0x3E + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r0, [r6, 0x14] + mov r1, r8 + strh r1, [r0, 0x2E] + ldr r1, [r6, 0x14] + ldr r0, =sub_81D1538 + str r0, [r1, 0x1C] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D1448 + + thumb_func_start sub_81D1500 +sub_81D1500: @ 81D1500 + push {r4,lr} + adds r4, r0, 0 + ldr r1, [r4, 0x14] + movs r0, 0x1 + strh r0, [r1, 0x2E] + ldr r0, [r4, 0x14] + movs r1, 0x2 + bl StartObjectRotScalAnim + ldr r1, [r4, 0x14] + ldr r0, =sub_81D1538 + str r0, [r1, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D1500 + + thumb_func_start sub_81D1524 +sub_81D1524: @ 81D1524 + ldr r0, [r0, 0x14] + ldr r1, [r0, 0x1C] + ldr r0, =DummyObjectCallback + eors r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + bx lr + .pool + thumb_func_end sub_81D1524 + + thumb_func_start sub_81D1538 +sub_81D1538: @ 81D1538 + push {lr} + adds r3, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _081D156A + movs r0, 0x3E + adds r0, r3 + mov r12, r0 + movs r0, 0x1 + ldrh r1, [r3, 0x2E] + ands r1, r0 + lsls r1, 2 + mov r0, r12 + ldrb r2, [r0] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] + ldr r0, =DummyObjectCallback + str r0, [r3, 0x1C] +_081D156A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D1538 + + thumb_func_start sub_81D1574 +sub_81D1574: @ 81D1574 + push {lr} + ldrb r0, [r0] + cmp r0, 0x5 + bhi _081D15A4 + lsls r0, 2 + ldr r1, =_081D158C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081D158C: + .4byte _081D15A4 + .4byte _081D15A8 + .4byte _081D15AC + .4byte _081D15B4 + .4byte _081D15B0 + .4byte _081D15A8 +_081D15A4: + movs r0, 0 + b _081D15B6 +_081D15A8: + movs r0, 0x1 + b _081D15B6 +_081D15AC: + movs r0, 0x2 + b _081D15B6 +_081D15B0: + movs r0, 0x3 + b _081D15B6 +_081D15B4: + movs r0, 0x4 +_081D15B6: + pop {r1} + bx r1 + thumb_func_end sub_81D1574 + + thumb_func_start sub_81D15BC +sub_81D15BC: @ 81D15BC + ldr r1, =gUnknown_085500A4 + lsls r0, 4 + adds r0, r1 + ldrh r0, [r0] + bx lr + .pool + thumb_func_end sub_81D15BC + + thumb_func_start sub_81D15CC +sub_81D15CC: @ 81D15CC + push {lr} + adds r3, r0, 0 + movs r1, 0 + ldr r2, =gUnknown_085500A4 +_081D15D4: + ldrh r0, [r2] + cmp r0, r3 + bne _081D15E4 + adds r0, r1, 0 + b _081D15F0 + .pool +_081D15E4: + adds r2, 0x10 + adds r1, 0x1 + cmp r1, 0x4D + ble _081D15D4 + movs r0, 0x1 + negs r0, r0 +_081D15F0: + pop {r1} + bx r1 + thumb_func_end sub_81D15CC + + thumb_func_start sub_81D15F4 +sub_81D15F4: @ 81D15F4 + push {r4,lr} + cmp r0, 0x14 + bhi _081D1620 + ldr r1, =gUnknown_086252A8 + lsls r0, 2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_81D1574 + ldr r1, =gUnknown_086252FC + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r4, 0 + bl _call_via_r1 + b _081D1622 + .pool +_081D1620: + movs r0, 0 +_081D1622: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81D15F4 + + thumb_func_start sub_81D1628 +sub_81D1628: @ 81D1628 + push {lr} + adds r2, r0, 0 + ldrh r1, [r2, 0x2] + ldr r0, =0x0000ffff + cmp r1, r0 + beq _081D1644 + adds r0, r1, 0 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + b _081D1646 + .pool +_081D1644: + movs r0, 0x1 +_081D1646: + pop {r1} + bx r1 + thumb_func_end sub_81D1628 + + thumb_func_start sub_81D164C +sub_81D164C: @ 81D164C + push {lr} + adds r2, r0, 0 + ldrh r1, [r2, 0x2] + ldr r0, =0x0000ffff + cmp r1, r0 + beq _081D1668 + adds r0, r1, 0 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + b _081D166A + .pool +_081D1668: + movs r0, 0x1 +_081D166A: + pop {r1} + bx r1 + thumb_func_end sub_81D164C + + thumb_func_start sub_81D1670 +sub_81D1670: @ 81D1670 + push {lr} + adds r2, r0, 0 + ldrh r1, [r2, 0x2] + ldr r0, =0x0000ffff + cmp r1, r0 + beq _081D168C + adds r0, r1, 0 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + b _081D168E + .pool +_081D168C: + movs r0, 0x1 +_081D168E: + pop {r1} + bx r1 + thumb_func_end sub_81D1670 + + thumb_func_start sub_81D1694 +sub_81D1694: @ 81D1694 + push {lr} + adds r2, r0, 0 + ldr r0, =0x03005d90 + ldr r1, [r0] + ldrb r0, [r2, 0x1] + ldrb r1, [r1, 0x8] + cmp r0, r1 + beq _081D16AC + movs r0, 0 + b _081D16C6 + .pool +_081D16AC: + ldrh r1, [r2, 0x2] + ldr r0, =0x0000ffff + cmp r1, r0 + beq _081D16C4 + adds r0, r1, 0 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + b _081D16C6 + .pool +_081D16C4: + movs r0, 0x1 +_081D16C6: + pop {r1} + bx r1 + thumb_func_end sub_81D1694 + + thumb_func_start sub_81D16CC +sub_81D16CC: @ 81D16CC + push {lr} + ldrh r0, [r0, 0x2] + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_81D16CC + + thumb_func_start sub_81D16DC +sub_81D16DC: @ 81D16DC + push {r4,lr} + cmp r0, 0x14 + bhi _081D170C + ldr r1, =gUnknown_086252A8 + lsls r0, 2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_81D1574 + ldr r1, =gUnknown_08625310 + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r4, 0 + bl _call_via_r1 + lsls r0, 24 + lsrs r0, 24 + b _081D170E + .pool +_081D170C: + movs r0, 0 +_081D170E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81D16DC + + thumb_func_start sub_81D1714 +sub_81D1714: @ 81D1714 + ldrb r0, [r0, 0x1] + bx lr + thumb_func_end sub_81D1714 + + thumb_func_start sub_81D1718 +sub_81D1718: @ 81D1718 + ldrb r0, [r0, 0x1] + bx lr + thumb_func_end sub_81D1718 + + thumb_func_start sub_81D171C +sub_81D171C: @ 81D171C + push {r4-r7,lr} + adds r5, r0, 0 + movs r6, 0 + ldr r7, =0x0000ffff + b _081D172E + .pool +_081D172C: + adds r6, 0x1 +_081D172E: + ldr r0, [r5, 0x10] + lsls r4, r6, 2 + adds r1, r4, r0 + ldrh r0, [r1] + cmp r0, r7 + beq _081D1744 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _081D172C +_081D1744: + ldr r0, [r5, 0x10] + adds r0, r4, r0 + ldrb r0, [r0, 0x2] + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81D171C + + thumb_func_start sub_81D1750 +sub_81D1750: @ 81D1750 + movs r0, 0xD5 + bx lr + thumb_func_end sub_81D1750 + + thumb_func_start sub_81D1754 +sub_81D1754: @ 81D1754 + movs r0, 0xD5 + bx lr + thumb_func_end sub_81D1754 + + thumb_func_start sub_81D1758 +sub_81D1758: @ 81D1758 + push {r4,lr} + cmp r0, 0x14 + bhi _081D1784 + ldr r1, =gUnknown_086252A8 + lsls r0, 2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_81D1574 + ldr r1, =gUnknown_08625324 + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r4, 0 + bl _call_via_r1 + b _081D1786 + .pool +_081D1784: + movs r0, 0 +_081D1786: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81D1758 + + thumb_func_start sub_81D178C +sub_81D178C: @ 81D178C + movs r0, 0 + bx lr + thumb_func_end sub_81D178C + + thumb_func_start sub_81D1790 +sub_81D1790: @ 81D1790 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x4] + cmp r0, 0x48 + bhi _081D17B8 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x000009ca + adds r0, r2 + ldrh r1, [r1, 0x4] + adds r0, r1 + ldrb r1, [r0] + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + b _081D17BA + .pool +_081D17B8: + movs r0, 0 +_081D17BA: + pop {r1} + bx r1 + thumb_func_end sub_81D1790 + + thumb_func_start sub_81D17C0 +sub_81D17C0: @ 81D17C0 + ldr r1, =0x03005d8c + ldr r1, [r1] + ldr r2, =0x000009ca + adds r1, r2 + ldrh r0, [r0, 0x4] + adds r1, r0 + ldrb r1, [r1] + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + bx lr + .pool + thumb_func_end sub_81D17C0 + + thumb_func_start sub_81D17E0 +sub_81D17E0: @ 81D17E0 + movs r0, 0 + bx lr + thumb_func_end sub_81D17E0 + + thumb_func_start sub_81D17E4 +sub_81D17E4: @ 81D17E4 + movs r0, 0 + bx lr + thumb_func_end sub_81D17E4 + + thumb_func_start sub_81D17E8 +sub_81D17E8: @ 81D17E8 + push {r4,r5,lr} + adds r5, r0, 0 + cmp r5, 0x14 + bhi _081D1832 + ldr r1, =gUnknown_086252A8 + lsls r0, r5, 2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_81D1574 + adds r2, r0, 0 + ldr r1, =gUnknown_08625338 + lsls r0, r2, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r4, 0 + bl _call_via_r1 + cmp r0, 0 + beq _081D1820 +_081D1812: + movs r0, 0x1 + b _081D1834 + .pool +_081D1820: + movs r2, 0 + ldr r1, =gUnknown_08625388 +_081D1824: + ldrh r0, [r1] + cmp r0, r5 + beq _081D1812 + adds r1, 0x18 + adds r2, 0x1 + cmp r2, 0x3 + bls _081D1824 +_081D1832: + movs r0, 0 +_081D1834: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D17E8 + + thumb_func_start sub_81D1840 +sub_81D1840: @ 81D1840 + movs r0, 0 + bx lr + thumb_func_end sub_81D1840 + + thumb_func_start sub_81D1844 +sub_81D1844: @ 81D1844 + movs r0, 0x1 + bx lr + thumb_func_end sub_81D1844 + + thumb_func_start sub_81D1848 +sub_81D1848: @ 81D1848 + movs r0, 0x1 + bx lr + thumb_func_end sub_81D1848 + + thumb_func_start sub_81D184C +sub_81D184C: @ 81D184C + movs r0, 0 + bx lr + thumb_func_end sub_81D184C + + thumb_func_start sub_81D1850 +sub_81D1850: @ 81D1850 + movs r0, 0 + bx lr + thumb_func_end sub_81D1850 + + thumb_func_start sub_81D1854 +sub_81D1854: @ 81D1854 + push {r4,lr} + cmp r0, 0x14 + bhi _081D1880 + ldr r1, =gUnknown_086252A8 + lsls r0, 2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_81D1574 + ldr r1, =gUnknown_0862534C + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r4, 0 + bl _call_via_r1 + b _081D1882 + .pool +_081D1880: + movs r0, 0x4E +_081D1882: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81D1854 + + thumb_func_start sub_81D1888 +sub_81D1888: @ 81D1888 + movs r0, 0x4E + bx lr + thumb_func_end sub_81D1888 + + thumb_func_start sub_81D188C +sub_81D188C: @ 81D188C + ldrh r0, [r0, 0x4] + bx lr + thumb_func_end sub_81D188C + + thumb_func_start sub_81D1890 +sub_81D1890: @ 81D1890 + ldrh r0, [r0, 0x4] + bx lr + thumb_func_end sub_81D1890 + + thumb_func_start sub_81D1894 +sub_81D1894: @ 81D1894 + movs r0, 0x4E + bx lr + thumb_func_end sub_81D1894 + + thumb_func_start sub_81D1898 +sub_81D1898: @ 81D1898 + movs r0, 0x4E + bx lr + thumb_func_end sub_81D1898 + + thumb_func_start sub_81D189C +sub_81D189C: @ 81D189C + push {r4,r5,lr} + adds r5, r1, 0 + cmp r0, 0x14 + bhi _081D18C2 + ldr r1, =gUnknown_086252A8 + lsls r0, 2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_81D1574 + ldr r1, =gUnknown_08625360 + lsls r0, 2 + adds r0, r1 + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl _call_via_r2 +_081D18C2: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D189C + + thumb_func_start sub_81D18D0 +sub_81D18D0: @ 81D18D0 + push {lr} + ldr r0, [r0, 0xC] + bl sub_81D1920 + pop {r0} + bx r0 + thumb_func_end sub_81D18D0 + + thumb_func_start sub_81D18DC +sub_81D18DC: @ 81D18DC + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + ldrb r0, [r3] + cmp r0, 0x5 + beq _081D18F0 + ldr r0, [r3, 0x10] + bl sub_81D1920 + b _081D18F8 +_081D18F0: + ldr r0, [r3, 0x10] + ldrh r1, [r3, 0x4] + bl sub_81D199C +_081D18F8: + pop {r0} + bx r0 + thumb_func_end sub_81D18DC + + thumb_func_start sub_81D18FC +sub_81D18FC: @ 81D18FC + push {lr} + ldr r0, [r0, 0xC] + bl sub_81D1920 + pop {r0} + bx r0 + thumb_func_end sub_81D18FC + + thumb_func_start sub_81D1908 +sub_81D1908: @ 81D1908 + push {lr} + ldr r0, [r0, 0xC] + bl sub_81D1920 + pop {r0} + bx r0 + thumb_func_end sub_81D1908 + + thumb_func_start sub_81D1914 +sub_81D1914: @ 81D1914 + push {lr} + adds r0, r1, 0 + bl sub_8197080 + pop {r0} + bx r0 + thumb_func_end sub_81D1914 + + thumb_func_start sub_81D1920 +sub_81D1920: @ 81D1920 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r6, r0, 0 + mov r9, r1 + movs r5, 0 + ldr r0, [r6] + cmp r0, 0 + beq _081D1940 + adds r1, r6, 0 +_081D1936: + adds r1, 0x8 + adds r5, 0x1 + ldr r0, [r1] + cmp r0, 0 + bne _081D1936 +_081D1940: + cmp r5, 0 + beq _081D1946 + subs r5, 0x1 +_081D1946: + ldr r0, =0x0000ffff + mov r8, r0 + lsls r0, r5, 3 + adds r0, 0x4 + adds r4, r0, r6 + b _081D195C + .pool +_081D1958: + subs r4, 0x8 + subs r5, 0x1 +_081D195C: + lsls r7, r5, 3 + cmp r5, 0 + beq _081D1974 + ldrh r0, [r4] + cmp r0, r8 + beq _081D1958 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081D1958 +_081D1974: + adds r4, r7, r6 + ldrh r1, [r4, 0x6] + ldr r0, =0x0000ffff + cmp r1, r0 + beq _081D1984 + adds r0, r1, 0 + bl FlagSet +_081D1984: + ldr r1, [r4] + mov r0, r9 + bl ExpandStringRefs + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D1920 + + thumb_func_start sub_81D199C +sub_81D199C: @ 81D199C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r6, r0, 0 + mov r10, r2 + lsls r1, 16 + lsrs r7, r1, 16 + movs r5, 0 + ldr r0, [r6] + cmp r0, 0 + beq _081D19E6 + ldrh r0, [r6, 0x4] + ldr r1, =0x0000fffe + cmp r0, r1 + beq _081D1A24 + ldr r0, =0x0000ffff + mov r9, r0 + mov r8, r1 + adds r4, r6, 0 +_081D19C6: + ldrh r0, [r4, 0x4] + cmp r0, r9 + beq _081D19D6 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _081D19E6 +_081D19D6: + adds r4, 0x8 + adds r5, 0x1 + ldr r0, [r4] + cmp r0, 0 + beq _081D19E6 + ldrh r0, [r4, 0x4] + cmp r0, r8 + bne _081D19C6 +_081D19E6: + lsls r0, r5, 3 + adds r0, r6 + ldrh r1, [r0, 0x4] + ldr r0, =0x0000fffe + cmp r1, r0 + beq _081D1A24 + cmp r5, 0 + beq _081D19F8 + subs r5, 0x1 +_081D19F8: + lsls r0, r5, 3 + adds r4, r0, r6 + ldrh r1, [r4, 0x6] + ldr r0, =0x0000ffff + cmp r1, r0 + beq _081D1A0A + adds r0, r1, 0 + bl FlagSet +_081D1A0A: + ldr r1, [r4] + mov r0, r10 + bl ExpandStringRefs + b _081D1A5C + .pool +_081D1A1C: + adds r5, 0x2 + b _081D1A50 +_081D1A20: + adds r5, 0x3 + b _081D1A50 +_081D1A24: + ldr r0, =0x00000864 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _081D1A50 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x000009ca + adds r0, r1 + adds r0, r7 + ldrb r0, [r0] + cmp r0, 0 + bne _081D1A1C + adds r0, r7, 0 + bl sub_80B2318 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _081D1A20 + adds r5, 0x1 +_081D1A50: + lsls r0, r5, 3 + adds r0, r6 + ldr r1, [r0] + mov r0, r10 + bl ExpandStringRefs +_081D1A5C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D199C + + thumb_func_start sub_81D1A78 +sub_81D1A78: @ 81D1A78 + push {r4-r6,lr} + adds r5, r1, 0 + adds r6, r2, 0 + cmp r0, 0x14 + bhi _081D1AA2 + ldr r1, =gUnknown_086252A8 + lsls r0, 2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_81D1574 + ldr r1, =gUnknown_08625374 + lsls r0, 2 + adds r0, r1 + ldr r3, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl _call_via_r3 +_081D1AA2: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D1A78 + + thumb_func_start sub_81D1AB0 +sub_81D1AB0: @ 81D1AB0 + ldr r3, [r0, 0x4] + str r3, [r1] + ldr r0, [r0, 0x8] + str r0, [r2] + bx lr + thumb_func_end sub_81D1AB0 + + thumb_func_start sub_81D1ABC +sub_81D1ABC: @ 81D1ABC + push {r4,r5,lr} + adds r5, r1, 0 + adds r4, r0, 0 + ldr r0, [r4, 0xC] + cmp r0, 0 + bne _081D1AD0 + ldrh r0, [r4, 0x4] + bl sub_81D1B0C + b _081D1AD2 +_081D1AD0: + str r0, [r2] +_081D1AD2: + ldr r0, [r4, 0x8] + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81D1ABC + + thumb_func_start sub_81D1ADC +sub_81D1ADC: @ 81D1ADC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrh r0, [r4, 0x4] + bl sub_81D1B0C + ldr r0, [r4, 0x8] + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81D1ADC + + thumb_func_start sub_81D1AF4 +sub_81D1AF4: @ 81D1AF4 + ldr r3, [r0, 0x4] + str r3, [r1] + ldr r0, [r0, 0x8] + str r0, [r2] + bx lr + thumb_func_end sub_81D1AF4 + + thumb_func_start sub_81D1B00 +sub_81D1B00: @ 81D1B00 + ldr r3, [r0, 0x4] + str r3, [r1] + ldr r0, [r0, 0x8] + str r0, [r2] + bx lr + thumb_func_end sub_81D1B00 + + thumb_func_start sub_81D1B0C +sub_81D1B0C: @ 81D1B0C + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + bl sub_81D15BC + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTrainers + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r0, 0xD + muls r0, r2 + ldr r2, =gTrainerClassNames + adds r0, r2 + str r0, [r4] + adds r1, 0x4 + str r1, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D1B0C + + thumb_func_start sub_81D1B40 +sub_81D1B40: @ 81D1B40 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r6, r0, 0 + movs r5, 0 + ldr r2, =gUnknown_08625388 + movs r0, 0x8 + adds r0, r2 + mov r9, r0 +_081D1B54: + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 3 + adds r0, r2 + ldrh r0, [r0] + cmp r0, r6 + bne _081D1BBC + adds r4, r5, 0x1 + lsls r1, 2 + mov r8, r1 + cmp r4, 0x3 + bhi _081D1BA8 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + adds r0, r2 + ldrh r0, [r0] + cmp r0, r6 + bne _081D1BA8 + ldr r7, =gUnknown_08625388 +_081D1B7C: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + adds r1, r7, 0x4 + adds r0, r1 + ldrh r0, [r0] + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _081D1BA8 + adds r5, r4, 0 + adds r4, r5, 0x1 + cmp r4, 0x3 + bhi _081D1BA8 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + adds r0, r7 + ldrh r0, [r0] + cmp r0, r6 + beq _081D1B7C +_081D1BA8: + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 3 + add r0, r8 + add r0, r9 + ldr r0, [r0] + b _081D1BC4 + .pool +_081D1BBC: + adds r5, 0x1 + cmp r5, 0x3 + bls _081D1B54 + movs r0, 0 +_081D1BC4: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81D1B40 + + thumb_func_start sub_81D1BD0 +sub_81D1BD0: @ 81D1BD0 + push {lr} + adds r3, r0, 0 + movs r2, 0 + ldr r1, =gUnknown_08625388 +_081D1BD8: + ldrh r0, [r1] + cmp r0, r3 + bne _081D1BE8 + ldrh r0, [r1, 0x2] + b _081D1BF4 + .pool +_081D1BE8: + adds r1, 0x18 + adds r2, 0x1 + cmp r2, 0x3 + bls _081D1BD8 + movs r0, 0x1 + negs r0, r0 +_081D1BF4: + pop {r1} + bx r1 + thumb_func_end sub_81D1BD0 + + thumb_func_start sub_81D1BF8 +sub_81D1BF8: @ 81D1BF8 + push {r4,r5,lr} + adds r5, r0, 0 + movs r4, 0 +_081D1BFE: + adds r0, r4, 0 + bl sub_81D1854 + cmp r0, 0x4E + beq _081D1C10 + cmp r0, r5 + bne _081D1C10 + movs r0, 0x1 + b _081D1C18 +_081D1C10: + adds r4, 0x1 + cmp r4, 0x14 + ble _081D1BFE + movs r0, 0 +_081D1C18: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81D1BF8 + + thumb_func_start sub_81D1C20 +sub_81D1C20: @ 81D1C20 + push {lr} + ldr r0, =0x020375e0 + ldrh r0, [r0] + bl sub_81D15CC + cmp r0, 0 + blt _081D1C3C + movs r1, 0xAE + lsls r1, 1 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + bl FlagSet +_081D1C3C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D1C20 + + thumb_func_start sub_81D1C44 +sub_81D1C44: @ 81D1C44 + push {r4,lr} + lsls r0, 24 + ldr r4, =0x0203cf4c + lsrs r0, 21 + adds r0, 0x8 + bl Alloc + str r0, [r4] + cmp r0, 0 + bne _081D1C60 + movs r0, 0 + b _081D1C7A + .pool +_081D1C60: + movs r2, 0 + ldr r4, =0x0203cf48 + movs r3, 0xFF +_081D1C66: + adds r0, r2, r4 + ldrb r1, [r0] + orrs r1, r3 + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x2 + bls _081D1C66 + movs r0, 0x1 +_081D1C7A: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D1C44 + + thumb_func_start sub_81D1C84 +sub_81D1C84: @ 81D1C84 + push {r4-r6,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r6, =0x0203cf48 + adds r5, r4, r6 + ldrb r0, [r5] + cmp r0, 0xFF + bne _081D1CEC + cmp r4, 0x2 + bne _081D1CD4 + ldr r0, =gUnknown_086253E8 + ldr r1, [r0, 0x14] + ldr r0, [r0, 0x10] + str r0, [sp] + str r1, [sp, 0x4] + ldr r0, =gUnknown_085DFF04 + movs r1, 0x4 + bl GetMaxWidthInMenuTable + lsls r0, 24 + ldr r2, =0x00ffffff + ldr r1, [sp] + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + bl AddWindow + strb r0, [r6, 0x2] + b _081D1CE0 + .pool +_081D1CD4: + lsls r0, r4, 3 + ldr r1, =gUnknown_086253E8 + adds r0, r1 + bl AddWindow + strb r0, [r5] +_081D1CE0: + ldr r0, =0x0203cf48 + adds r0, r4, r0 + ldrb r0, [r0] + movs r1, 0 + bl SetStandardWindowBorderStyle +_081D1CEC: + ldr r0, =0x0203cf48 + adds r0, r4, r0 + ldrb r0, [r0] + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D1C84 + + thumb_func_start sub_81D1D04 +sub_81D1D04: @ 81D1D04 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x0203cf48 + adds r4, r0 + ldrb r0, [r4] + movs r1, 0 + bl sub_8198070 + ldrb r0, [r4] + bl ClearWindowTilemap + ldrb r0, [r4] + bl RemoveWindow + movs r0, 0xFF + strb r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D1D04 + + thumb_func_start sub_81D1D34 +sub_81D1D34: @ 81D1D34 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0203cf48 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_81D1D34 + + thumb_func_start sub_81D1D44 +sub_81D1D44: @ 81D1D44 + push {r4,r5,lr} + sub sp, 0x34 + adds r3, r1, 0 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r2, 24 + lsrs r5, r2, 24 + movs r0, 0x2 + negs r0, r0 + cmp r3, r0 + beq _081D1DAC + ldr r0, =0x03005d8c + lsls r1, r3, 3 + adds r1, r3 + lsls r1, 2 + ldr r0, [r0] + adds r1, r0 + ldr r0, =0x00002cca + adds r1, r0 + add r0, sp, 0x14 + bl CopyString + add r0, sp, 0x14 + bl sub_81DB52C + add r0, sp, 0x14 + bl GetStringLength + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x5 + bhi _081D1D8C + add r0, sp, 0x14 + movs r1, 0x1 + bl StopMusicWhileStringIsPrinted +_081D1D8C: + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + ldr r0, =gUnknown_08625400 + str r0, [sp, 0x8] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0xC] + add r0, sp, 0x14 + str r0, [sp, 0x10] + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0x8 + adds r3, r5, 0 + bl AddTextPrinterParametrized2 +_081D1DAC: + add sp, 0x34 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D1D44 + + thumb_func_start sub_81D1DC0 +sub_81D1DC0: @ 81D1DC0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r5, r0, 0 + movs r3, 0 + ldr r7, =0x0203cf4c + ldr r0, =gUnknown_085E8CF7 + mov r12, r0 + ldr r4, =0x03006310 + ldr r1, =0x0203cf48 + mov r8, r1 + ldr r2, =sub_81D1E7C + mov r9, r2 + ldr r0, =sub_81D1D44 + mov r10, r0 + ldrb r1, [r5, 0x5] + cmp r3, r1 + bcs _081D1E02 + adds r6, r7, 0 + ldr r2, =gUnknown_08625403 +_081D1DEC: + ldr r1, [r6] + lsls r0, r3, 3 + adds r0, r1 + str r2, [r0] + str r3, [r0, 0x4] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + ldrb r0, [r5, 0x5] + cmp r3, r0 + bcc _081D1DEC +_081D1E02: + ldr r2, [r7] + lsls r0, r3, 3 + adds r0, r2 + mov r1, r12 + str r1, [r0] + movs r1, 0x2 + negs r1, r1 + str r1, [r0, 0x4] + str r2, [r4] + ldrb r0, [r5, 0x5] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0xC] + mov r2, r8 + ldrb r0, [r2, 0x1] + strb r0, [r4, 0x10] + strb r1, [r4, 0x11] + movs r0, 0x8 + strb r0, [r4, 0x12] + strb r1, [r4, 0x13] + strh r0, [r4, 0xE] + movs r0, 0x29 + strb r0, [r4, 0x14] + movs r0, 0x31 + strb r0, [r4, 0x15] + mov r0, r9 + str r0, [r4, 0x4] + mov r1, r10 + str r1, [r4, 0x8] + movs r0, 0x1 + strb r0, [r4, 0x17] + movs r0, 0 + strb r0, [r4, 0x16] + ldrh r1, [r5, 0x2] + ldrh r2, [r5] + adds r0, r4, 0 + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D1DC0 + + thumb_func_start sub_81D1E7C +sub_81D1E7C: @ 81D1E7C + push {lr} + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x1 + beq _081D1E8C + movs r0, 0x5 + bl audio_play +_081D1E8C: + pop {r0} + bx r0 + thumb_func_end sub_81D1E7C + + thumb_func_start sub_81D1E90 +sub_81D1E90: @ 81D1E90 + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + ldrb r0, [r4, 0x5] + ldrb r1, [r4, 0x4] + subs r0, r1 + adds r0, 0x1 + str r0, [sp] + movs r0, 0x6E + str r0, [sp, 0x4] + str r0, [sp, 0x8] + adds r0, r4, 0x2 + str r0, [sp, 0xC] + movs r0, 0x2 + movs r1, 0xC8 + movs r2, 0xC + movs r3, 0x94 + bl AddScrollIndicatorArrowPairParametrized + strb r0, [r4, 0x9] + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81D1E90 + + thumb_func_start sub_81D1EC0 +sub_81D1EC0: @ 81D1EC0 + push {lr} + ldr r0, =0x0203cf4c + ldr r0, [r0] + bl Free + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D1EC0 + + thumb_func_start sub_81D1ED4 +sub_81D1ED4: @ 81D1ED4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r3, r0, 0 + movs r6, 0 + movs r7, 0 +_081D1EE6: + movs r2, 0 + lsls r5, r6, 2 + adds r0, r6, 0x1 + mov r10, r0 + adds r4, r5, 0 +_081D1EF0: + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 2 + adds r0, r4, r0 + adds r0, r3, r0 + adds r1, r0, 0 + adds r1, 0x64 + strh r7, [r1] + adds r0, 0x66 + strh r7, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x9 + bls _081D1EF0 + movs r2, 0 + mov r9, r2 + str r5, [sp] + movs r1, 0x9B + mov r8, r1 + movs r4, 0x5B + mov r12, r4 +_081D1F1C: + lsls r0, r2, 2 + adds r0, r2 + adds r1, r6, r0 + adds r1, r3, r1 + mov r4, r9 + strb r4, [r1] + lsls r0, 2 + ldr r1, [sp] + adds r0, r1, r0 + adds r0, r3, r0 + mov r4, r8 + strh r4, [r0, 0x14] + mov r1, r12 + strh r1, [r0, 0x16] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _081D1F1C + adds r1, r3, r5 + movs r2, 0x96 + lsls r2, 1 + adds r0, r1, r2 + strh r7, [r0] + movs r4, 0x97 + lsls r4, 1 + adds r0, r1, r4 + strh r7, [r0] + mov r1, r10 + lsls r0, r1, 24 + lsrs r6, r0, 24 + cmp r6, 0x4 + bls _081D1EE6 + movs r2, 0xD5 + lsls r2, 2 + adds r0, r3, r2 + movs r1, 0 + strb r1, [r0] + ldr r4, =0x00000352 + adds r0, r3, r4 + strh r1, [r0] + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D1ED4 + + thumb_func_start sub_81D1F84 +sub_81D1F84: @ 81D1F84 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + mov r8, r0 + str r1, [sp] + mov r9, r2 + movs r7, 0 +_081D1F98: + lsls r4, r7, 2 + ldr r1, [sp] + adds r0, r4, r1 + ldrh r1, [r0] + lsls r5, r1, 8 + mov r2, r9 + adds r0, r4, r2 + ldrh r0, [r0] + subs r0, r1 + lsls r0, 8 + movs r1, 0xA + bl __divsi3 + adds r6, r0, 0 + movs r3, 0 + adds r7, 0x1 + mov r10, r7 + mov r12, r4 +_081D1FBC: + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 2 + add r0, r12 + add r0, r8 + asrs r2, r5, 8 + asrs r1, r5, 7 + movs r7, 0x1 + ands r1, r7 + adds r2, r1 + adds r0, 0x64 + strh r2, [r0] + adds r5, r6 + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x8 + bls _081D1FBC + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 2 + adds r0, r4, r0 + add r0, r8 + mov r1, r9 + adds r2, r4, r1 + ldrh r1, [r2] + adds r0, 0x64 + strh r1, [r0] + ldr r7, [sp] + adds r0, r4, r7 + ldrh r1, [r0, 0x2] + lsls r5, r1, 8 + ldrh r0, [r2, 0x2] + subs r0, r1 + lsls r0, 8 + movs r1, 0xA + bl __divsi3 + adds r6, r0, 0 + movs r3, 0 + str r4, [sp, 0x4] + movs r0, 0x1 + mov r12, r0 +_081D2012: + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 2 + ldr r1, [sp, 0x4] + adds r0, r1, r0 + add r0, r8 + asrs r2, r5, 8 + asrs r1, r5, 7 + mov r7, r12 + ands r1, r7 + adds r2, r1 + adds r0, 0x66 + strh r2, [r0] + adds r5, r6 + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x8 + bls _081D2012 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 2 + adds r0, r4, r0 + add r0, r8 + mov r2, r9 + adds r1, r4, r2 + ldrh r1, [r1, 0x2] + adds r0, 0x66 + strh r1, [r0] + mov r7, r10 + lsls r0, r7, 16 + lsrs r7, r0, 16 + cmp r7, 0x4 + bls _081D1F98 + ldr r1, =0x00000352 + add r1, r8 + movs r0, 0 + strh r0, [r1] + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D1F84 + + thumb_func_start sub_81D2074 +sub_81D2074: @ 81D2074 + push {r4,lr} + adds r1, r0, 0 + ldr r0, =0x00000352 + adds r4, r1, r0 + ldrh r0, [r4] + cmp r0, 0x9 + bls _081D208C + movs r0, 0 + b _081D20A6 + .pool +_081D208C: + adds r0, r1, 0 + bl sub_81D2230 + ldrh r1, [r4] + adds r1, 0x1 + strh r1, [r4] + lsls r1, 16 + lsrs r1, 16 + movs r0, 0xA + eors r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 +_081D20A6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81D2074 + + thumb_func_start sub_81D20AC +sub_81D20AC: @ 81D20AC + ldr r1, =0x00000355 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + bx lr + .pool + thumb_func_end sub_81D20AC + + thumb_func_start sub_81D20BC +sub_81D20BC: @ 81D20BC + push {r4,r5,lr} + sub sp, 0xC + ldr r1, =0x00000355 + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0 + beq _081D20D4 + cmp r0, 0x1 + beq _081D20E2 + b _081D20FA + .pool +_081D20D4: + bl dp12_8087EA4 + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + movs r0, 0x1 + b _081D20FC +_081D20E2: + mov r0, sp + ldr r1, =gUnknown_08625404 + ldm r1!, {r2,r3,r5} + stm r0!, {r2,r3,r5} + ldr r0, [sp] + ldr r1, [sp, 0x4] + ldr r2, [sp, 0x8] + bl sub_80BA038 + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] +_081D20FA: + movs r0, 0 +_081D20FC: + add sp, 0xC + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D20BC + + thumb_func_start sub_81D2108 +sub_81D2108: @ 81D2108 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + adds r6, r0, 0 + movs r1, 0xD5 + lsls r1, 2 + adds r0, r6, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _081D21BE + adds r0, r6, 0 + bl sub_81D24A4 + adds r0, r6, 0 + bl sub_81D2634 + movs r7, 0 + ldr r5, =0x02038c28 + mov r12, r5 + movs r0, 0xF0 + lsls r0, 3 + add r0, r12 + mov r9, r0 + movs r1, 0xA0 + lsls r1, 1 + adds r1, r6, r1 + str r1, [sp] + ldr r5, =0x0000ffff + mov r8, r5 + movs r0, 0xA1 + lsls r0, 1 + adds r0, r6, r0 + str r0, [sp, 0x4] + movs r1, 0x92 + lsls r1, 2 + adds r1, r6, r1 + str r1, [sp, 0x8] + ldr r5, =0x0000024a + adds r5, r6 + mov r10, r5 +_081D215E: + adds r2, r7, 0 + adds r2, 0x37 + lsls r3, r2, 2 + mov r0, r9 + adds r0, r3, r0 + str r0, [sp, 0xC] + add r3, r12 + lsls r4, r7, 2 + ldr r1, [sp] + adds r0, r1, r4 + ldrh r0, [r0] + lsls r0, 8 + ldr r5, [sp, 0x4] + adds r1, r5, r4 + ldrh r1, [r1] + orrs r0, r1 + strh r0, [r3] + mov r1, r8 + ands r0, r1 + ldr r5, [sp, 0xC] + strh r0, [r5] + lsls r2, 1 + adds r2, 0x1 + lsls r2, 1 + mov r0, r9 + adds r3, r2, r0 + add r2, r12 + ldr r1, [sp, 0x8] + adds r0, r1, r4 + ldrh r0, [r0] + lsls r0, 8 + add r4, r10 + ldrh r1, [r4] + orrs r0, r1 + strh r0, [r2] + mov r5, r8 + ands r0, r5 + strh r0, [r3] + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, 0x41 + bls _081D215E + movs r0, 0xD5 + lsls r0, 2 + adds r1, r6, r0 + movs r0, 0 + strb r0, [r1] +_081D21BE: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D2108 + + thumb_func_start sub_81D21DC +sub_81D21DC: @ 81D21DC + push {r4,r5,lr} + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bls _081D21E8 + movs r1, 0 +_081D21E8: + movs r0, 0x1 + lsls r0, r1 + movs r5, 0x1F + bics r5, r0 + movs r0, 0x40 + movs r1, 0xF0 + bl SetGpuReg + movs r0, 0x42 + movs r1, 0x9B + bl SetGpuReg + ldr r4, =0x00003879 + movs r0, 0x44 + adds r1, r4, 0 + bl SetGpuReg + movs r0, 0x46 + adds r1, r4, 0 + bl SetGpuReg + ldr r1, =0x00003f3f + movs r0, 0x48 + bl SetGpuReg + movs r0, 0x4A + adds r1, r5, 0 + bl SetGpuReg + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D21DC + + thumb_func_start sub_81D2230 +sub_81D2230: @ 81D2230 + push {r4-r7,lr} + mov r12, r0 + movs r4, 0 + movs r7, 0x96 + lsls r7, 1 + add r7, r12 + ldr r6, =0x00000352 + add r6, r12 + mov r5, r12 + adds r5, 0x64 +_081D2244: + lsls r2, r4, 2 + adds r3, r7, r2 + ldrh r1, [r6] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, r0 + adds r2, r5, r2 + ldr r0, [r2] + str r0, [r3] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x4 + bls _081D2244 + movs r1, 0xD5 + lsls r1, 2 + add r1, r12 + movs r0, 0x1 + strb r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D2230 + + thumb_func_start sub_81D2278 +sub_81D2278: @ 81D2278 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + str r0, [sp] + adds r6, r1, 0 + adds r5, r2, 0 + str r3, [sp, 0x4] + ldr r0, [sp, 0x38] + ldr r7, [sp, 0x3C] + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r0, 0 + str r0, [sp, 0xC] + ldrh r0, [r5, 0x2] + ldrh r1, [r3, 0x2] + cmp r0, r1 + bcs _081D22B2 + adds r2, r0, 0 + mov r10, r2 + ldrh r0, [r3, 0x2] + ldrh r1, [r5] + lsls r4, r1, 10 + ldrh r3, [r3] + str r3, [sp, 0x8] + b _081D22C6 +_081D22B2: + ldrh r0, [r5, 0x2] + ldr r1, [sp, 0x4] + ldrh r1, [r1, 0x2] + mov r10, r1 + ldr r2, [sp, 0x4] + ldrh r1, [r2] + lsls r4, r1, 10 + ldrh r3, [r5] + str r3, [sp, 0x8] + mov r2, r10 +_081D22C6: + subs r0, r2 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r0, 0 + beq _081D22DE + subs r0, r3, r1 + lsls r0, 10 + mov r1, r8 + bl __divsi3 + str r0, [sp, 0xC] +_081D22DE: + mov r0, r8 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r7, 0 + bne _081D2328 + mov r0, r10 + subs r0, 0x38 + lsls r0, 2 + adds r6, r0 + movs r5, 0 + mov r3, r9 + lsls r3, 1 + mov r12, r3 + ldr r0, [sp, 0x8] + add r0, r9 + str r0, [sp, 0x10] + cmp r7, r8 + bcs _081D23B6 + movs r7, 0x1 +_081D2308: + adds r2, r3, r6 + asrs r1, r4, 10 + asrs r0, r4, 9 + ands r0, r7 + adds r1, r0 + add r1, r9 + strh r1, [r2] + ldr r1, [sp, 0xC] + adds r4, r1 + adds r6, 0x4 + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, r8 + bcc _081D2308 + b _081D23B6 +_081D2328: + ldr r2, [sp, 0xC] + cmp r2, 0 + ble _081D23C0 + mov r0, r10 + subs r0, 0x38 + lsls r0, 2 + adds r7, r0 + movs r5, 0 + mov r3, r9 + lsls r3, 1 + mov r12, r3 + ldr r0, [sp, 0x8] + add r0, r9 + str r0, [sp, 0x10] + cmp r5, r8 + bcs _081D237A + ldr r0, =0x00026bff + cmp r4, r0 + bgt _081D237A + mov r1, r12 + str r1, [sp, 0x14] +_081D2352: + ldr r3, [sp, 0x14] + adds r2, r3, r7 + asrs r1, r4, 10 + asrs r0, r4, 9 + movs r3, 0x1 + ands r0, r3 + adds r1, r0 + add r1, r9 + strh r1, [r2] + ldr r0, [sp, 0xC] + adds r4, r0 + adds r7, 0x4 + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, r8 + bcs _081D237A + ldr r1, =0x00026bff + cmp r4, r1 + ble _081D2352 +_081D237A: + mov r2, r10 + adds r1, r2, r5 + ldr r3, [sp] + movs r2, 0xD4 + lsls r2, 2 + adds r0, r3, r2 + strh r1, [r0] + ldrh r0, [r0] + subs r0, 0x38 + lsls r0, 2 + adds r6, r0 + cmp r5, r8 + bcs _081D23B6 + mov r3, r12 + movs r7, 0x1 +_081D2398: + adds r2, r3, r6 + asrs r1, r4, 10 + asrs r0, r4, 9 + ands r0, r7 + adds r1, r0 + add r1, r9 + strh r1, [r2] + ldr r0, [sp, 0xC] + adds r4, r0 + adds r6, 0x4 + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, r8 + bcc _081D2398 +_081D23B6: + subs r0, r6, 0x4 + b _081D248C + .pool +_081D23C0: + ldr r1, [sp, 0xC] + cmp r1, 0 + bge _081D2464 + mov r0, r10 + subs r0, 0x38 + lsls r0, 2 + adds r6, r0 + movs r5, 0 + mov r2, r9 + lsls r2, 1 + mov r12, r2 + ldr r3, [sp, 0x8] + add r3, r9 + str r3, [sp, 0x10] + cmp r5, r8 + bcs _081D241E + adds r3, r2, r6 + asrs r1, r4, 10 + asrs r0, r4, 9 + movs r2, 0x1 + ands r0, r2 + adds r1, r0 + add r1, r9 + strh r1, [r3] + b _081D2414 +_081D23F2: + ldr r0, [sp, 0xC] + adds r4, r0 + adds r6, 0x4 + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, r8 + bcs _081D241E + mov r1, r12 + adds r3, r1, r6 + asrs r2, r4, 10 + asrs r0, r4, 9 + movs r1, 0x1 + ands r0, r1 + adds r2, r0 + add r2, r9 + strh r2, [r3] +_081D2414: + ldr r0, =0x00026bff + cmp r4, r0 + bgt _081D23F2 + movs r0, 0x9B + strh r0, [r3] +_081D241E: + mov r2, r10 + adds r1, r2, r5 + ldr r3, [sp] + movs r2, 0xD4 + lsls r2, 2 + adds r0, r3, r2 + strh r1, [r0] + ldrh r0, [r0] + subs r0, 0x38 + lsls r0, 2 + adds r7, r0 + cmp r5, r8 + bcs _081D245A + mov r3, r12 + movs r6, 0x1 +_081D243C: + adds r2, r3, r7 + asrs r1, r4, 10 + asrs r0, r4, 9 + ands r0, r6 + adds r1, r0 + add r1, r9 + strh r1, [r2] + ldr r0, [sp, 0xC] + adds r4, r0 + adds r7, 0x4 + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, r8 + bcc _081D243C +_081D245A: + subs r0, r7, 0x4 + b _081D248C + .pool +_081D2464: + ldr r1, [sp] + movs r2, 0xD4 + lsls r2, 2 + adds r0, r1, r2 + mov r3, r10 + strh r3, [r0] + mov r0, r10 + subs r0, 0x38 + lsls r0, 2 + adds r6, r0 + adds r7, r0 + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r6, 0x2] + ldr r1, [sp, 0x4] + ldrh r0, [r1] + strh r0, [r7] + movs r0, 0x9B + strh r0, [r7, 0x2] + b _081D2494 +_081D248C: + add r0, r12 + mov r2, sp + ldrh r2, [r2, 0x10] + strh r2, [r0] +_081D2494: + 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_81D2278 + + thumb_func_start sub_81D24A4 +sub_81D24A4: @ 81D24A4 + push {r4-r7,lr} + sub sp, 0x8 + adds r4, r0, 0 + movs r0, 0x97 + lsls r0, 1 + adds r2, r4, r0 + movs r3, 0x99 + lsls r3, 1 + adds r1, r4, r3 + ldrh r0, [r2] + ldrh r3, [r1] + cmp r0, r3 + bcs _081D24E0 + adds r7, r0, 0 + movs r0, 0xA0 + lsls r0, 1 + adds r1, r4, r0 + movs r3, 0x96 + lsls r3, 1 + adds r2, r4, r3 + subs r0, 0x10 + adds r3, r4, r0 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + adds r0, r4, 0 + bl sub_81D2278 + b _081D2500 +_081D24E0: + ldrh r7, [r1] + movs r2, 0xA0 + lsls r2, 1 + adds r1, r4, r2 + movs r3, 0x98 + lsls r3, 1 + adds r2, r4, r3 + movs r0, 0x96 + lsls r0, 1 + adds r3, r4, r0 + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + adds r0, r4, 0 + bl sub_81D2278 +_081D2500: + movs r1, 0xA0 + lsls r1, 1 + adds r5, r4, r1 + movs r3, 0x98 + lsls r3, 1 + adds r2, r4, r3 + movs r0, 0x9A + lsls r0, 1 + adds r6, r4, r0 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + adds r0, r4, 0 + adds r1, r5, 0 + adds r3, r6, 0 + bl sub_81D2278 + movs r2, 0 + movs r1, 0x9B + lsls r1, 1 + adds r0, r4, r1 + movs r3, 0x9D + lsls r3, 1 + adds r1, r4, r3 + ldrh r0, [r0] + ldrh r1, [r1] + cmp r0, r1 + bhi _081D253C + movs r2, 0x1 +_081D253C: + movs r0, 0x9C + lsls r0, 1 + adds r3, r4, r0 + str r2, [sp] + movs r1, 0x92 + lsls r1, 2 + adds r0, r4, r1 + str r0, [sp, 0x4] + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_81D2278 + movs r2, 0x38 + cmp r2, r7 + bcs _081D257E + adds r6, r5, 0 + movs r3, 0 + movs r0, 0xA1 + lsls r0, 1 + adds r5, r4, r0 +_081D2566: + adds r0, r2, 0 + subs r0, 0x38 + lsls r0, 2 + adds r1, r6, r0 + strh r3, [r1] + adds r0, r5, r0 + strh r3, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, r7 + bcc _081D2566 +_081D257E: + movs r1, 0x97 + lsls r1, 1 + adds r0, r4, r1 + ldrh r2, [r0] + movs r3, 0xD4 + lsls r3, 2 + adds r0, r4, r3 + ldrh r1, [r0] + cmp r2, r1 + bhi _081D25B2 + movs r1, 0xA0 + lsls r1, 1 + adds r3, r4, r1 + movs r5, 0x9B + adds r1, r0, 0 +_081D259C: + adds r0, r2, 0 + subs r0, 0x38 + lsls r0, 2 + adds r0, r3, r0 + strh r5, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + ldrh r0, [r1] + cmp r2, r0 + bls _081D259C +_081D25B2: + movs r2, 0x9B + lsls r2, 1 + adds r1, r4, r2 + movs r3, 0xD4 + lsls r3, 2 + adds r0, r4, r3 + ldrh r0, [r0] + ldrh r1, [r1] + cmp r0, r1 + bcs _081D25C8 + adds r0, r1, 0 +_081D25C8: + adds r0, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x79 + bhi _081D25F8 + movs r0, 0xA0 + lsls r0, 1 + adds r6, r4, r0 + movs r3, 0 + movs r1, 0xA1 + lsls r1, 1 + adds r5, r4, r1 +_081D25E0: + adds r0, r2, 0 + subs r0, 0x38 + lsls r0, 2 + adds r1, r6, r0 + strh r3, [r1] + adds r0, r5, r0 + strh r3, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x79 + bls _081D25E0 +_081D25F8: + movs r2, 0x38 + movs r3, 0xA0 + lsls r3, 1 + adds r5, r4, r3 + movs r0, 0xA1 + lsls r0, 1 + adds r4, r0 + movs r6, 0x9B +_081D2608: + adds r0, r2, 0 + subs r0, 0x38 + lsls r1, r0, 2 + adds r3, r5, r1 + ldrh r0, [r3] + cmp r0, 0 + bne _081D2620 + adds r0, r4, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _081D2620 + strh r6, [r3] +_081D2620: + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x79 + bls _081D2608 + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81D24A4 + + thumb_func_start sub_81D2634 +sub_81D2634: @ 81D2634 + push {r4-r6,lr} + sub sp, 0x8 + adds r4, r0, 0 + movs r0, 0x97 + lsls r0, 1 + adds r2, r4, r0 + movs r3, 0x9F + lsls r3, 1 + adds r1, r4, r3 + ldrh r0, [r2] + ldrh r5, [r1] + cmp r0, r5 + bcs _081D266E + adds r6, r0, 0 + movs r0, 0x92 + lsls r0, 2 + adds r1, r4, r0 + subs r3, 0x12 + adds r2, r4, r3 + movs r5, 0x9E + lsls r5, 1 + adds r3, r4, r5 + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + adds r0, r4, 0 + bl sub_81D2278 + b _081D2690 +_081D266E: + ldrh r6, [r1] + movs r0, 0x92 + lsls r0, 2 + adds r1, r4, r0 + movs r3, 0x9E + lsls r3, 1 + adds r2, r4, r3 + movs r5, 0x96 + lsls r5, 1 + adds r3, r4, r5 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + adds r0, r4, 0 + bl sub_81D2278 +_081D2690: + movs r0, 0x92 + lsls r0, 2 + adds r5, r4, r0 + movs r1, 0x9E + lsls r1, 1 + adds r2, r4, r1 + movs r0, 0x9C + lsls r0, 1 + adds r3, r4, r0 + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81D2278 + cmp r6, 0x38 + ble _081D26C8 + movs r0, 0 + adds r1, r5, 0 + adds r2, r6, 0 + subs r2, 0x38 +_081D26BC: + strh r0, [r1] + strh r0, [r1, 0x2] + adds r1, 0x4 + subs r2, 0x1 + cmp r2, 0 + bne _081D26BC +_081D26C8: + movs r1, 0x97 + lsls r1, 1 + adds r0, r4, r1 + ldrh r2, [r0] + movs r3, 0xD4 + lsls r3, 2 + adds r0, r4, r3 + ldrh r5, [r0] + cmp r2, r5 + bgt _081D26F6 + movs r3, 0x9B + adds r1, r0, 0 + lsls r0, r2, 2 + movs r5, 0xB5 + lsls r5, 1 + adds r0, r5 + adds r0, r4 +_081D26EA: + strh r3, [r0] + adds r0, 0x4 + adds r2, 0x1 + ldrh r5, [r1] + cmp r2, r5 + ble _081D26EA +_081D26F6: + movs r1, 0x9D + lsls r1, 1 + adds r0, r4, r1 + ldrh r0, [r0] + adds r1, r0, 0x1 + movs r2, 0xD4 + lsls r2, 2 + adds r0, r4, r2 + ldrh r0, [r0] + cmp r0, r1 + bge _081D270E + adds r0, r1, 0 +_081D270E: + adds r2, r0, 0 + cmp r2, 0x79 + bgt _081D272C + movs r1, 0 + lsls r0, r2, 2 + movs r3, 0xB4 + lsls r3, 1 + adds r0, r3 + adds r0, r4 +_081D2720: + strh r1, [r0] + strh r1, [r0, 0x2] + adds r0, 0x4 + adds r2, 0x1 + cmp r2, 0x79 + ble _081D2720 +_081D272C: + movs r3, 0 + movs r5, 0x92 + lsls r5, 2 + adds r1, r4, r5 + movs r2, 0x41 +_081D2736: + ldrh r0, [r1] + ldrh r4, [r1, 0x2] + cmp r0, r4 + bcc _081D2742 + strh r3, [r1, 0x2] + strh r3, [r1] +_081D2742: + adds r1, 0x4 + subs r2, 0x1 + cmp r2, 0 + bge _081D2736 + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81D2634 + + thumb_func_start sub_81D2754 +sub_81D2754: @ 81D2754 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r6, r0, 0 + mov r8, r1 + ldr r1, =gUnknown_08625410 + ldrb r0, [r6] + adds r0, r1 + ldrb r2, [r0] + adds r6, 0x1 + movs r0, 0x9B + mov r3, r8 + strh r0, [r3] + movs r0, 0x5B + subs r0, r2 + strh r0, [r3, 0x2] + movs r7, 0x40 + movs r0, 0 + mov r12, r0 + movs r2, 0x1 + mov r9, r2 + ldr r3, =gUnknown_08329F40 + mov r10, r3 +_081D2786: + adds r0, r7, 0 + adds r0, 0x33 + lsls r0, 24 + lsrs r7, r0, 24 + mov r1, r12 + lsls r0, r1, 24 + movs r2, 0xFF + lsls r2, 24 + adds r0, r2 + lsrs r3, r0, 24 + mov r12, r3 + cmp r0, 0 + bge _081D27A4 + movs r0, 0x4 + mov r12, r0 +_081D27A4: + mov r1, r12 + lsls r0, r1, 24 + asrs r4, r0, 24 + cmp r4, 0x2 + bne _081D27B4 + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 +_081D27B4: + ldrb r0, [r6] + ldr r2, =gUnknown_08625410 + adds r0, r2 + ldrb r2, [r0] + adds r6, 0x1 + lsls r0, r4, 2 + mov r1, r8 + adds r3, r0, r1 + adds r0, r7, 0 + adds r0, 0x40 + lsls r0, 1 + add r0, r10 + movs r1, 0 + ldrsh r0, [r0, r1] + muls r0, r2 + asrs r5, r0, 8 + adds r0, r5, 0 + adds r0, 0x9B + strh r0, [r3] + lsls r0, r7, 1 + add r0, r10 + movs r1, 0 + ldrsh r0, [r0, r1] + adds r1, r2, 0 + muls r1, r0 + asrs r1, 8 + movs r0, 0x5B + subs r0, r1 + strh r0, [r3, 0x2] + cmp r4, 0x2 + bgt _081D2800 + cmp r2, 0x20 + bne _081D27FA + cmp r4, 0x2 + beq _081D2800 +_081D27FA: + adds r0, r5, 0 + adds r0, 0x9C + strh r0, [r3] +_081D2800: + mov r0, r9 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + cmp r0, 0x4 + bls _081D2786 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D2754 + + thumb_func_start sub_81D2824 +sub_81D2824: @ 81D2824 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gUnknown_08625510 + bl InitWindows + bl DeactivateAllTextPrinters + movs r0, 0 + movs r1, 0x1 + movs r2, 0xE0 + bl sub_809882C + ldr r0, =gUnknown_0860F074 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + movs r4, 0 +_081D284A: + adds r0, r4, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _081D284A + cmp r5, 0 + bne _081D287C + movs r0, 0 + bl PutWindowTilemap + movs r0, 0 + movs r1, 0 + movs r2, 0x1 + movs r3, 0xE + bl SetWindowBorderStyle + b _081D288E + .pool +_081D287C: + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0x1 + movs r1, 0 + movs r2, 0x1 + movs r3, 0xE + bl SetWindowBorderStyle +_081D288E: + movs r0, 0x2 + bl PutWindowTilemap + movs r0, 0x3 + bl PutWindowTilemap + movs r0, 0x2 + movs r1, 0 + movs r2, 0x1 + movs r3, 0xE + bl SetWindowBorderStyle + movs r0, 0x3 + movs r1, 0 + movs r2, 0x1 + movs r3, 0xE + bl SetWindowBorderStyle + bl nullsub_79 + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81D2824 + + thumb_func_start nullsub_79 +nullsub_79: @ 81D28C4 + bx lr + thumb_func_end nullsub_79 + + thumb_func_start sub_81D28C8 +sub_81D28C8: @ 81D28C8 + push {r4-r7,lr} + lsls r1, 16 + lsrs r4, r1, 16 + ldr r3, =0x03006310 + adds r2, r3, 0 + ldr r1, =gUnknown_08625548 + ldm r1!, {r5-r7} + stm r2!, {r5-r7} + ldm r1!, {r5-r7} + stm r2!, {r5-r7} + strh r4, [r3, 0xC] + str r0, [r3] + cmp r4, 0x5 + bhi _081D28F0 + strh r4, [r3, 0xE] + b _081D28F4 + .pool +_081D28F0: + movs r0, 0x6 + strh r0, [r3, 0xE] +_081D28F4: + ldrb r0, [r3, 0xE] + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81D28C8 + + thumb_func_start sub_81D28FC +sub_81D28FC: @ 81D28FC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + mov r9, r0 + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r5, =gUnknown_085EFA31 + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x80 + bl GetStringCenterAlignXOffset + adds r4, r0, 0 + lsls r3, r4, 24 + lsrs r3, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0xFF + mov r8, r0 + str r0, [sp, 0x4] + movs r7, 0 + str r7, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + adds r2, r5, 0 + bl Print + ldr r5, =gUnknown_085EFA52 + movs r1, 0x29 + mov r10, r1 + str r1, [sp] + mov r0, r8 + str r0, [sp, 0x4] + str r7, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + adds r2, r5, 0 + movs r3, 0x4 + bl Print + ldr r5, =gUnknown_085EFA56 + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x6A + bl GetStringRightAlignXOffset + adds r4, r0, 0 + lsls r3, r4, 24 + lsrs r3, 24 + movs r1, 0x19 + str r1, [sp] + mov r0, r8 + str r0, [sp, 0x4] + str r7, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + adds r2, r5, 0 + bl Print + ldr r5, =gUnknown_085EFA5D + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x6A + bl GetStringRightAlignXOffset + adds r4, r0, 0 + lsls r3, r4, 24 + lsrs r3, 24 + mov r1, r10 + str r1, [sp] + mov r0, r8 + str r0, [sp, 0x4] + str r7, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + adds r2, r5, 0 + bl Print + movs r0, 0x2 + negs r0, r0 + cmp r9, r0 + bne _081D29C4 + movs r0, 0 + movs r1, 0x2 + bl CopyWindowToVram + b _081D2AB6 + .pool +_081D29C4: + mov r1, r9 + lsls r0, r1, 1 + add r0, r9 + lsls r0, 2 + ldr r1, =gBattleMoves + adds r6, r0, r1 + ldrb r1, [r6, 0x2] + lsls r0, r1, 3 + subs r0, r1 + ldr r1, =gTypeNames + adds r5, r0, r1 + movs r0, 0x19 + str r0, [sp] + mov r1, r8 + str r1, [sp, 0x4] + str r7, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + adds r2, r5, 0 + movs r3, 0x4 + bl Print + ldr r1, =gUnknown_085EFA52 + movs r0, 0x1 + movs r2, 0 + bl GetStringWidth + adds r4, r0, 0x4 + ldrb r1, [r6, 0x4] + add r0, sp, 0xC + movs r2, 0 + movs r3, 0x2 + bl ConvertIntToDecimalString + lsls r3, r4, 24 + lsrs r3, 24 + mov r0, r10 + str r0, [sp] + mov r1, r8 + str r1, [sp, 0x4] + str r7, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + add r2, sp, 0xC + bl Print + ldrb r0, [r6, 0x1] + cmp r0, 0x1 + bhi _081D2A3C + ldr r5, =gUnknown_085E8D45 + b _081D2A4A + .pool +_081D2A3C: + ldrb r1, [r6, 0x1] + add r0, sp, 0xC + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + add r5, sp, 0xC +_081D2A4A: + movs r0, 0x19 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + movs r3, 0x6A + bl Print + ldrb r0, [r6, 0x3] + cmp r0, 0 + bne _081D2A70 + ldr r5, =gUnknown_085E8D45 + b _081D2A7E + .pool +_081D2A70: + ldrb r1, [r6, 0x3] + add r0, sp, 0xC + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + add r5, sp, 0xC +_081D2A7E: + movs r0, 0x29 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + adds r2, r5, 0 + movs r3, 0x6A + bl Print + ldr r1, =gMoveDescriptionPointers + mov r0, r9 + subs r0, 0x1 + lsls r0, 2 + adds r0, r1 + ldr r5, [r0] + movs r0, 0x41 + str r0, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r1, 0x7 + adds r2, r5, 0 + movs r3, 0 + bl Print +_081D2AB6: + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D28FC + + thumb_func_start sub_81D2ACC +sub_81D2ACC: @ 81D2ACC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + adds r4, r0, 0 + bl sub_816137C + movs r0, 0x1 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r5, =gUnknown_085EFA3E + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x80 + bl GetStringCenterAlignXOffset + lsls r3, r0, 24 + lsrs r3, 24 + movs r0, 0x1 + str r0, [sp] + movs r7, 0xFF + str r7, [sp, 0x4] + movs r6, 0 + str r6, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + bl Print + ldr r5, =gUnknown_085EFA67 + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x5C + bl GetStringRightAlignXOffset + lsls r3, r0, 24 + lsrs r3, 24 + movs r0, 0x19 + mov r8, r0 + str r0, [sp] + str r7, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r5, 0 + bl Print + ldr r5, =gUnknown_085EFA6E + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x5C + bl GetStringRightAlignXOffset + lsls r3, r0, 24 + lsrs r3, 24 + movs r0, 0x29 + str r0, [sp] + str r7, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r5, 0 + bl Print + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + bne _081D2B6C + movs r0, 0x1 + movs r1, 0x2 + bl CopyWindowToVram + b _081D2BB8 + .pool +_081D2B6C: + lsls r4, 3 + ldr r0, =gContestMoves + adds r4, r0 + ldr r1, =gContestMoveTypeTextPointers + ldrb r0, [r4, 0x1] + lsls r0, 29 + lsrs r0, 27 + adds r0, r1 + ldr r5, [r0] + mov r0, r8 + str r0, [sp] + str r7, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r5, 0 + movs r3, 0x4 + bl Print + ldr r1, =gContestEffectDescriptionPointers + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r5, [r0] + movs r0, 0x41 + str r0, [sp] + str r7, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x7 + adds r2, r5, 0 + movs r3, 0 + bl Print + movs r0, 0x1 + movs r1, 0x2 + bl CopyWindowToVram +_081D2BB8: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D2ACC + + thumb_func_start sub_81D2BD0 +sub_81D2BD0: @ 81D2BD0 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x1 + beq _081D2BE2 + movs r0, 0x5 + bl audio_play +_081D2BE2: + adds r0, r4, 0 + bl sub_81D28FC + adds r0, r4, 0 + bl sub_81D2ACC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81D2BD0 + + thumb_func_start sub_81D2BF4 +sub_81D2BF4: @ 81D2BF4 + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + movs r0, 0x3 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r2, =0x03003014 + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + bl sav2_get_text_speed + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r1, 0x1 + adds r2, r4, 0 + bl AddTextPrinterParametrized + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D2BF4 + + thumb_func_start sub_81D2C3C +sub_81D2C3C: @ 81D2C3C + push {lr} + bl RunTextPrinters + movs r0, 0x3 + bl IsTextPrinterActive + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_81D2C3C + + thumb_func_start sub_81D2C50 +sub_81D2C50: @ 81D2C50 + push {lr} + ldr r0, =gUnknown_08625540 + movs r1, 0x1 + movs r2, 0xE + movs r3, 0 + bl CreateYesNoMenu + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D2C50 + + thumb_func_start sub_81D2C68 +sub_81D2C68: @ 81D2C68 + push {lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r1, 16 + cmp r0, 0xE + bne _081D2CA8 + cmp r2, 0x2 + beq _081D2C7E + cmp r2, 0x7 + bne _081D2C94 +_081D2C7E: + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + adds r1, r2, 0 + adds r2, r3, 0 + bl pokemon_getattr + b _081D2CCA + .pool +_081D2C94: + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + adds r1, r2, 0 + bl pokemon_getattr + b _081D2CCA + .pool +_081D2CA8: + cmp r2, 0x2 + beq _081D2CB0 + cmp r2, 0x7 + bne _081D2CBE +_081D2CB0: + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + bl sub_80D1ED0 + b _081D2CCA +_081D2CBE: + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + bl get_pokemon_data_from_any_box +_081D2CCA: + pop {r1} + bx r1 + thumb_func_end sub_81D2C68 + + thumb_func_start sub_81D2CD0 +sub_81D2CD0: @ 81D2CD0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 16 + lsrs r6, r2, 16 + movs r0, 0xFC + strb r0, [r5] + adds r5, 0x1 + movs r0, 0x4 + strb r0, [r5] + adds r5, 0x1 + movs r0, 0x8 + strb r0, [r5] + adds r5, 0x1 + movs r0, 0 + strb r0, [r5] + adds r5, 0x1 + movs r0, 0x9 + strb r0, [r5] + adds r5, 0x1 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0x2D + movs r3, 0 + bl sub_81D2C68 + cmp r0, 0 + beq _081D2D20 + ldr r1, =gUnknown_085E8264 + adds r0, r5, 0 + movs r2, 0 + movs r3, 0xC + bl CopyStringPadded + b _081D2E70 + .pool +_081D2D20: + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0x2 + adds r3, r5, 0 + bl sub_81D2C68 + adds r0, r5, 0 + bl GetStringEnd_Limit7 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0xB + movs r3, 0 + bl sub_81D2C68 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r4, 0xE + bne _081D2D70 + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + adds r0, r4, 0 + bl pokemon_get_gender + lsls r0, 24 + lsrs r6, r0, 24 + b _081D2D92 + .pool +_081D2D70: + lsls r0, r4, 24 + lsrs r0, 24 + lsls r1, r6, 24 + lsrs r1, 24 + bl get_pokemon_by_box_and_pos + adds r4, r0, 0 + bl pokemon_roll_gender + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r4, 0 + bl sub_80690C0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 +_081D2D92: + cmp r7, 0x1D + beq _081D2D9A + cmp r7, 0x20 + bne _081D2DB0 +_081D2D9A: + movs r0, 0xB + adds r1, r7, 0 + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r5, 0 + bl CompareString + cmp r0, 0 + bne _081D2DB0 + movs r6, 0xFF +_081D2DB0: + adds r3, r5, 0 + b _081D2DBA + .pool +_081D2DB8: + adds r3, 0x1 +_081D2DBA: + ldrb r0, [r3] + cmp r0, 0xFF + bne _081D2DB8 + movs r1, 0xFC + strb r1, [r3] + adds r3, 0x1 + movs r0, 0x12 + strb r0, [r3] + adds r3, 0x1 + movs r0, 0x3C + strb r0, [r3] + adds r3, 0x1 + cmp r6, 0 + beq _081D2DDE + cmp r6, 0xFE + beq _081D2E02 + movs r0, 0 + b _081D2E24 +_081D2DDE: + strb r1, [r3] + adds r3, 0x1 + movs r0, 0x1 + strb r0, [r3] + adds r3, 0x1 + movs r0, 0x4 + strb r0, [r3] + adds r3, 0x1 + strb r1, [r3] + adds r3, 0x1 + movs r0, 0x3 + strb r0, [r3] + adds r3, 0x1 + movs r0, 0x5 + strb r0, [r3] + adds r3, 0x1 + movs r0, 0xB5 + b _081D2E24 +_081D2E02: + strb r1, [r3] + adds r3, 0x1 + movs r0, 0x1 + strb r0, [r3] + adds r3, 0x1 + movs r0, 0x6 + strb r0, [r3] + adds r3, 0x1 + strb r1, [r3] + adds r3, 0x1 + movs r0, 0x3 + strb r0, [r3] + adds r3, 0x1 + movs r0, 0x7 + strb r0, [r3] + adds r3, 0x1 + movs r0, 0xB6 +_081D2E24: + strb r0, [r3] + adds r3, 0x1 + movs r0, 0xFC + strb r0, [r3] + adds r3, 0x1 + movs r0, 0x4 + strb r0, [r3] + adds r3, 0x1 + movs r0, 0x8 + strb r0, [r3] + adds r3, 0x1 + movs r4, 0 + strb r4, [r3] + adds r3, 0x1 + movs r0, 0x9 + strb r0, [r3] + adds r3, 0x1 + movs r0, 0xBA + strb r0, [r3] + adds r3, 0x1 + movs r0, 0xF9 + strb r0, [r3] + adds r3, 0x1 + movs r0, 0x5 + strb r0, [r3] + adds r3, 0x1 + adds r0, r3, 0 + mov r1, r8 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + adds r3, r0, 0 + strb r4, [r3] + adds r3, 0x1 + movs r0, 0xFF + strb r0, [r3] + adds r0, r3, 0 +_081D2E70: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81D2CD0 + + thumb_func_start sub_81D2E7C +sub_81D2E7C: @ 81D2E7C + push {r4,lr} + adds r4, r0, 0 + lsls r2, 16 + lsrs r2, 16 + b _081D2E94 +_081D2E86: + strb r3, [r4] + adds r1, 0x1 + adds r4, 0x1 + lsls r0, r2, 16 + ldr r2, =0xffff0000 + adds r0, r2 + lsrs r2, r0, 16 +_081D2E94: + ldrb r3, [r1] + adds r0, r3, 0 + cmp r0, 0xFF + bne _081D2E86 + adds r1, r2, 0 + lsls r0, r1, 16 + ldr r2, =0xffff0000 + adds r0, r2 + lsrs r2, r0, 16 + lsls r1, 16 + cmp r1, 0 + ble _081D2EC2 + movs r3, 0 +_081D2EAE: + strb r3, [r4] + adds r4, 0x1 + adds r1, r2, 0 + lsls r0, r1, 16 + ldr r2, =0xffff0000 + adds r0, r2 + lsrs r2, r0, 16 + lsls r1, 16 + cmp r1, 0 + bgt _081D2EAE +_081D2EC2: + movs r0, 0xFF + strb r0, [r4] + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D2E7C + + thumb_func_start sub_81D2ED4 +sub_81D2ED4: @ 81D2ED4 + push {r4-r7,lr} + adds r5, r0, 0 + adds r6, r1, 0 + ldr r0, [sp, 0x14] + ldr r1, [sp, 0x18] + ldr r4, [sp, 0x1C] + lsls r2, 16 + lsrs r7, r2, 16 + lsls r3, 16 + lsrs r3, 16 + lsls r0, 16 + lsrs r2, r0, 16 + lsls r1, 16 + lsrs r0, r1, 16 + lsls r4, 24 + cmp r4, 0 + bne _081D2EFC + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 +_081D2EFC: + cmp r2, r0 + beq _081D2F42 + adds r0, r6, 0 + adds r1, r7, 0 + adds r2, r3, 0 + bl sub_81D2CD0 + movs r0, 0xFC + strb r0, [r5] + movs r0, 0x4 + strb r0, [r5, 0x1] + movs r0, 0x8 + strb r0, [r5, 0x2] + movs r0, 0 + strb r0, [r5, 0x3] + movs r0, 0x9 + strb r0, [r5, 0x4] + cmp r7, 0xE + bne _081D2F2C + adds r0, r5, 0x5 + ldr r1, =gUnknown_085EBFCE + b _081D2F3A + .pool +_081D2F2C: + adds r4, r5, 0x5 + lsls r0, r7, 24 + lsrs r0, 24 + bl sav3_get_box_name + adds r1, r0, 0 + adds r0, r4, 0 +_081D2F3A: + movs r2, 0x8 + bl sub_81D2E7C + b _081D2F72 +_081D2F42: + movs r1, 0 + movs r2, 0 +_081D2F46: + adds r0, r6, r1 + strb r2, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0xB + bls _081D2F46 + adds r1, r6, r1 + movs r0, 0xFF + strb r0, [r1] + movs r1, 0 + movs r2, 0 +_081D2F5E: + adds r0, r5, r1 + strb r2, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x7 + bls _081D2F5E + adds r1, r5, r1 + movs r0, 0xFF + strb r0, [r1] +_081D2F72: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81D2ED4 + + thumb_func_start sub_81D2F78 +sub_81D2F78: @ 81D2F78 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r8, r0 + mov r10, r1 + ldr r0, [sp, 0x20] + ldr r1, [sp, 0x24] + ldr r4, [sp, 0x28] + ldr r5, [sp, 0x2C] + lsls r2, 16 + lsrs r7, r2, 16 + lsls r3, 16 + lsrs r6, r3, 16 + lsls r0, 16 + lsrs r2, r0, 16 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + lsls r4, 16 + lsrs r0, r4, 16 + lsls r5, 24 + cmp r5, 0 + bne _081D2FB0 + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 +_081D2FB0: + cmp r2, r0 + beq _081D305C + adds r0, r7, 0 + adds r1, r6, 0 + movs r2, 0x16 + movs r3, 0 + bl sub_81D2C68 + mov r1, r9 + lsls r5, r1, 2 + adds r4, r5, r1 + mov r2, r8 + adds r1, r2, r4 + strb r0, [r1] + adds r0, r7, 0 + adds r1, r6, 0 + movs r2, 0x2F + movs r3, 0 + bl sub_81D2C68 + mov r1, r8 + adds r1, 0x1 + adds r1, r4 + strb r0, [r1] + adds r0, r7, 0 + adds r1, r6, 0 + movs r2, 0x21 + movs r3, 0 + bl sub_81D2C68 + mov r1, r8 + adds r1, 0x2 + adds r1, r4 + strb r0, [r1] + adds r0, r7, 0 + adds r1, r6, 0 + movs r2, 0x18 + movs r3, 0 + bl sub_81D2C68 + mov r1, r8 + adds r1, 0x3 + adds r1, r4 + strb r0, [r1] + adds r0, r7, 0 + adds r1, r6, 0 + movs r2, 0x17 + movs r3, 0 + bl sub_81D2C68 + mov r1, r8 + adds r1, 0x4 + adds r1, r4 + strb r0, [r1] + mov r4, r10 + add r4, r9 + adds r0, r7, 0 + adds r1, r6, 0 + movs r2, 0x30 + movs r3, 0 + bl sub_81D2C68 + cmp r0, 0xFF + beq _081D3044 + adds r0, r7, 0 + adds r1, r6, 0 + movs r2, 0x30 + movs r3, 0 + bl sub_81D2C68 + movs r1, 0x1D + bl __udivsi3 + b _081D3046 +_081D3044: + movs r0, 0x9 +_081D3046: + strb r0, [r4] + mov r0, r9 + adds r1, r5, r0 + mov r2, r8 + adds r0, r2, r1 + lsls r1, 2 + adds r1, 0x14 + add r1, r8 + bl sub_81D2754 + b _081D3086 +_081D305C: + movs r2, 0 + mov r0, r9 + lsls r5, r0, 2 + adds r1, r5, r0 + movs r6, 0 + lsls r3, r1, 2 + movs r5, 0x9B + movs r4, 0x5B +_081D306C: + adds r0, r2, r1 + add r0, r8 + strb r6, [r0] + lsls r0, r2, 2 + adds r0, r3 + add r0, r8 + strh r5, [r0, 0x14] + strh r4, [r0, 0x16] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x4 + bls _081D306C +_081D3086: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81D2F78 + + thumb_func_start sub_81D3094 +sub_81D3094: @ 81D3094 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + mov r8, r0 + mov r9, r1 + ldr r0, [sp, 0x20] + ldr r1, [sp, 0x24] + ldr r4, [sp, 0x28] + lsls r2, 16 + lsrs r7, r2, 16 + lsls r3, 16 + lsrs r5, r3, 16 + lsls r0, 16 + lsrs r2, r0, 16 + lsls r1, 16 + lsrs r0, r1, 16 + lsls r4, 24 + cmp r4, 0 + bne _081D30C4 + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 +_081D30C4: + cmp r2, r0 + beq _081D311A + adds r0, r7, 0 + adds r1, r5, 0 + movs r2, 0x41 + movs r3, 0 + bl sub_81D2C68 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r7, 0 + adds r1, r5, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_81D2C68 + adds r6, r0, 0 + adds r0, r7, 0 + adds r1, r5, 0 + movs r2, 0 + movs r3, 0 + bl sub_81D2C68 + adds r5, r0, 0 + lsls r0, r4, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + movs r1, 0x1 + str r1, [sp] + mov r1, r8 + adds r2, r4, 0 + adds r3, r5, 0 + bl DecompressMonPic + adds r0, r4, 0 + adds r1, r6, 0 + adds r2, r5, 0 + bl species_and_otid_get_pal + mov r1, r9 + bl LZ77UnCompWram +_081D311A: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D3094 + + thumb_func_start sub_81D312C +sub_81D312C: @ 81D312C + push {lr} + adds r1, r0, 0 + ldrh r0, [r1] + adds r0, 0x18 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + ble _081D3140 + movs r0, 0 + strh r0, [r1] +_081D3140: + movs r0, 0 + ldrsh r1, [r1, r0] + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + pop {r1} + bx r1 + thumb_func_end sub_81D312C + + thumb_func_start sub_81D3150 +sub_81D3150: @ 81D3150 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1] + subs r0, 0x18 + strh r0, [r1] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x50 + negs r2, r2 + cmp r0, r2 + bge _081D3168 + strh r2, [r1] +_081D3168: + movs r0, 0 + ldrsh r1, [r1, r0] + eors r1, r2 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + pop {r1} + bx r1 + thumb_func_end sub_81D3150 + + thumb_func_start sub_81D3178 +sub_81D3178: @ 81D3178 + push {r4,r5,lr} + adds r5, r1, 0 + bl sub_81D2074 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + bl sub_81D312C + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + cmp r4, 0 + bne _081D319A + cmp r0, 0 + beq _081D319C +_081D319A: + movs r1, 0x1 +_081D319C: + adds r0, r1, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81D3178 + + thumb_func_start sub_81D31A4 +sub_81D31A4: @ 81D31A4 + push {r4,r5,lr} + adds r5, r1, 0 + bl sub_81D2074 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + bl sub_81D3150 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + cmp r4, 0 + bne _081D31C6 + cmp r0, 0 + beq _081D31C8 +_081D31C6: + movs r1, 0x1 +_081D31C8: + adds r0, r1, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81D31A4 + + thumb_func_start sub_81D31D0 +sub_81D31D0: @ 81D31D0 + push {r4-r7,lr} + sub sp, 0x20 + ldr r3, =gUnknown_08625A48 + ldr r4, [r3] + ldr r5, [r3, 0x4] + str r4, [sp, 0x18] + str r5, [sp, 0x1C] + mov r4, sp + ldr r3, =gUnknown_08625A50 + ldm r3!, {r5-r7} + stm r4!, {r5-r7} + ldm r3!, {r5-r7} + stm r4!, {r5-r7} + ldr r3, =gUnknown_08625A68 + ldr r4, [r3, 0x4] + ldr r3, [r3] + ldr r5, [sp, 0x18] + ldr r6, [sp, 0x1C] + str r5, [r0] + str r6, [r0, 0x4] + mov r0, sp + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + str r3, [r2] + str r4, [r2, 0x4] + add sp, 0x20 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D31D0 + + thumb_func_start sub_81D321C +sub_81D321C: @ 81D321C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x50 + adds r5, r0, 0 + mov r12, r1 + mov r8, r2 + mov r1, sp + ldr r0, =gUnknown_08625A70 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2,r6,r7} + stm r1!, {r2,r6,r7} + ldm r0!, {r3,r4} + stm r1!, {r3,r4} + add r3, sp, 0x20 + adds r1, r3, 0 + ldr r0, =gUnknown_08625A90 + ldm r0!, {r2,r6,r7} + stm r1!, {r2,r6,r7} + ldm r0!, {r4,r6,r7} + stm r1!, {r4,r6,r7} + add r2, sp, 0x38 + adds r1, r2, 0 + ldr r0, =gUnknown_08625AA8 + ldm r0!, {r4,r6,r7} + stm r1!, {r4,r6,r7} + ldm r0!, {r4,r6,r7} + stm r1!, {r4,r6,r7} + movs r4, 0 +_081D3258: + lsls r0, r4, 3 + add r0, sp + ldr r1, [r0, 0x4] + ldr r0, [r0] + stm r5!, {r0,r1} + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081D3258 + mov r1, r12 + adds r0, r2, 0 + ldm r0!, {r2,r4,r5} + stm r1!, {r2,r4,r5} + ldm r0!, {r2,r6,r7} + stm r1!, {r2,r6,r7} + movs r4, 0 +_081D327A: + lsls r0, r4, 3 + adds r0, r3, r0 + ldr r1, [r0, 0x4] + ldr r0, [r0] + mov r5, r8 + adds r5, 0x8 + mov r8, r5 + subs r5, 0x8 + stm r5!, {r0,r1} + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081D327A + add sp, 0x50 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D321C + + thumb_func_start sub_81D32B0 +sub_81D32B0: @ 81D32B0 + push {r4,r5,lr} + ldr r2, =gUnknown_08625AC0 + ldr r4, [r2] + ldr r5, [r2, 0x4] + ldr r2, =gUnknown_08625AC8 + ldr r3, [r2, 0x4] + ldr r2, [r2] + str r4, [r0] + str r5, [r0, 0x4] + str r2, [r1] + str r3, [r1, 0x4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D32B0 + + thumb_func_start sub_81D32D4 +sub_81D32D4: @ 81D32D4 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x30] + adds r0, 0x1 + strh r0, [r1, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3C + ble _081D32F0 + movs r0, 0 + strh r0, [r1, 0x30] + adds r0, r1, 0 + bl sub_81D3408 +_081D32F0: + pop {r0} + bx r0 + thumb_func_end sub_81D32D4 + + thumb_func_start sub_81D32F4 +sub_81D32F4: @ 81D32F4 + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _081D330C + movs r0, 0 + strh r0, [r2, 0x30] + ldr r0, =sub_81D32D4 + str r0, [r2, 0x1C] +_081D330C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D32F4 + + thumb_func_start sub_81D3314 +sub_81D3314: @ 81D3314 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x36 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r3, r1, r0 + cmp r3, 0 + beq _081D3360 + ldrh r1, [r3, 0x24] + ldrh r2, [r3, 0x20] + adds r1, r2 + ldr r2, =gUnknown_08625B2C + movs r5, 0x2E + ldrsh r0, [r4, r5] + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r1, [r3, 0x26] + ldrh r3, [r3, 0x22] + adds r1, r3 + movs r3, 0x2E + ldrsh r0, [r4, r3] + lsls r0, 2 + adds r2, 0x2 + adds r0, r2 + ldrh r0, [r0] + adds r0, r1 + b _081D337E + .pool +_081D3360: + ldr r1, =gUnknown_08625B2C + movs r5, 0x2E + ldrsh r0, [r4, r5] + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0] + adds r0, 0x28 + strh r0, [r4, 0x20] + movs r2, 0x2E + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r1, 0x2 + adds r0, r1 + ldrh r0, [r0] + adds r0, 0x68 +_081D337E: + strh r0, [r4, 0x22] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D3314 + + thumb_func_start sub_81D338C +sub_81D338C: @ 81D338C + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r2 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + movs r5, 0 +_081D339E: + lsls r0, r5, 2 + mov r1, r8 + adds r4, r0, r1 + ldr r0, [r4] + cmp r0, 0 + beq _081D33F0 + strh r5, [r0, 0x2E] + ldr r1, [r4] + lsls r0, r5, 4 + adds r0, 0x1 + strh r0, [r1, 0x30] + ldr r0, [r4] + strh r6, [r0, 0x32] + ldr r0, [r4] + strh r5, [r0, 0x34] + cmp r7, 0 + beq _081D33C4 + cmp r6, 0x9 + beq _081D33D0 +_081D33C4: + ldr r1, [r4] + ldr r0, =sub_81D3564 + str r0, [r1, 0x1C] + b _081D33F0 + .pool +_081D33D0: + ldr r0, [r4] + bl sub_81D3314 + ldr r0, [r4] + bl sub_81D35E8 + ldr r2, [r4] + ldr r0, =sub_81D32F4 + str r0, [r2, 0x1C] + adds r2, 0x3E + ldrb r0, [r2] + movs r3, 0x5 + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 + strb r0, [r2] +_081D33F0: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x9 + bls _081D339E + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D338C + + thumb_func_start sub_81D3408 +sub_81D3408: @ 81D3408 + push {r4-r7,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x38] + lsls r0, 24 + lsrs r2, r0, 24 + movs r3, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + adds r0, 0x1 + cmp r3, r0 + bge _081D3454 + ldr r5, =0x02020630 + movs r7, 0x1C + adds r7, r5 + mov r12, r7 + ldr r6, =sub_81D3564 +_081D3428: + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r2, r1, r5 + movs r7, 0x2E + ldrsh r0, [r2, r7] + lsls r0, 4 + adds r0, 0x1 + strh r0, [r2, 0x30] + add r1, r12 + str r6, [r1] + ldrh r0, [r2, 0x38] + lsls r0, 24 + lsrs r2, r0, 24 + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + movs r1, 0x32 + ldrsh r0, [r4, r1] + adds r0, 0x1 + cmp r3, r0 + blt _081D3428 +_081D3454: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D3408 + + thumb_func_start sub_81D3464 +sub_81D3464: @ 81D3464 + push {lr} + adds r2, r0, 0 + movs r1, 0 + movs r3, 0 +_081D346C: + lsls r0, r1, 2 + adds r0, r2 + str r3, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x9 + bls _081D346C + pop {r0} + bx r0 + thumb_func_end sub_81D3464 + + thumb_func_start sub_81D3480 +sub_81D3480: @ 81D3480 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r8, r0 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + movs r0, 0 + mov r9, r0 + lsrs r7, r2, 24 + movs r5, 0 + adds r0, r7, 0x1 + cmp r9, r0 + bge _081D34FE +_081D34A2: + ldr r0, =gUnknown_08625B14 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r3, r0, 24 + adds r6, r3, 0 + cmp r3, 0x40 + beq _081D34FE + lsls r0, r5, 2 + mov r1, r8 + adds r4, r0, r1 + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + str r0, [r4] + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r4] + mov r1, r10 + strh r1, [r0, 0x36] + cmp r5, 0 + beq _081D34F0 + subs r0, r4, 0x4 + ldr r0, [r0] + strh r3, [r0, 0x38] + b _081D34F2 + .pool +_081D34F0: + mov r9, r6 +_081D34F2: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r7, 0x1 + cmp r5, r0 + blt _081D34A2 +_081D34FE: + lsls r0, r7, 2 + add r0, r8 + ldr r0, [r0] + mov r1, r9 + strh r1, [r0, 0x38] + adds r0, r7, 0 + movs r1, 0x1 + mov r2, r8 + bl sub_81D338C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81D3480 + + thumb_func_start sub_81D3520 +sub_81D3520: @ 81D3520 + push {r4-r6,lr} + adds r6, r0, 0 + movs r5, 0 +_081D3526: + cmp r5, 0x9 + bhi _081D3544 + lsls r0, r5, 2 + adds r4, r0, r6 + ldr r0, [r4] + cmp r0, 0 + beq _081D3544 + bl RemoveObjectAndFreeTiles + movs r0, 0 + str r0, [r4] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + b _081D3526 +_081D3544: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81D3520 + + thumb_func_start sub_81D354C +sub_81D354C: @ 81D354C + push {lr} + bl sub_81D3520 + movs r0, 0x68 + bl FreeObjectTilesByTag + movs r0, 0x68 + bl FreeObjectPaletteByTag + pop {r0} + bx r0 + thumb_func_end sub_81D354C + + thumb_func_start sub_81D3564 +sub_81D3564: @ 81D3564 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x30] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _081D3592 + subs r0, r1, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + cmp r0, 0 + bne _081D35DC + adds r0, r4, 0 + movs r1, 0 + bl SeekObjectImageAnim + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_081D3592: + adds r0, r4, 0 + bl sub_81D3314 + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _081D35DC + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x34 + ldrsh r1, [r4, r0] + movs r2, 0x32 + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _081D35D8 + cmp r1, 0x9 + bne _081D35D0 + adds r0, r4, 0 + bl sub_81D35E8 + ldr r0, =sub_81D32F4 + b _081D35DA + .pool +_081D35D0: + ldr r0, =sub_81D32D4 + b _081D35DA + .pool +_081D35D8: + ldr r0, =DummyObjectCallback +_081D35DA: + str r0, [r4, 0x1C] +_081D35DC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D3564 + + thumb_func_start sub_81D35E8 +sub_81D35E8: @ 81D35E8 + push {r4-r7,lr} + adds r6, r0, 0 + ldrh r0, [r6, 0x38] + lsls r0, 24 + lsrs r1, r0, 24 + movs r5, 0 + movs r2, 0x32 + ldrsh r0, [r6, r2] + adds r0, 0x1 + cmp r5, r0 + bge _081D3636 + movs r0, 0x5 + negs r0, r0 + adds r7, r0, 0 +_081D3604: + lsls r4, r1, 4 + adds r4, r1 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0 + bl SeekObjectImageAnim + adds r1, r4, 0 + adds r1, 0x3E + ldrb r0, [r1] + ands r0, r7 + strb r0, [r1] + ldrh r0, [r4, 0x38] + lsls r0, 24 + lsrs r1, r0, 24 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + movs r2, 0x32 + ldrsh r0, [r6, r2] + adds r0, 0x1 + cmp r5, r0 + blt _081D3604 +_081D3636: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D35E8 + + thumb_func_start sub_81D3640 +sub_81D3640: @ 81D3640 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + mov r8, r0 + adds r6, r1, 0 + adds r5, r2, 0 + adds r4, r3, 0 + ldr r3, [sp, 0x4C] + ldr r0, [sp, 0x50] + mov r9, r0 + lsls r4, 24 + lsrs r4, 24 + lsls r3, 24 + lsrs r3, 24 + mov r1, r9 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, r4, 4 + orrs r1, r4 + lsls r1, 24 + lsrs r1, 24 + str r3, [sp, 0x28] + bl FillWindowPixelBuffer + add r2, sp, 0xC + ldrh r0, [r5] + ldrh r1, [r6] + subs r0, r1 + strh r0, [r2] + ldrh r0, [r5, 0x2] + ldrh r1, [r6, 0x2] + subs r0, r1 + strh r0, [r2, 0x2] + ldrh r0, [r5, 0x4] + ldrh r1, [r6, 0x4] + subs r0, r1 + strh r0, [r2, 0x4] + ldrh r0, [r5, 0x8] + ldrh r1, [r6, 0x8] + subs r0, r1 + strh r0, [r2, 0x6] + ldrh r0, [r5, 0xA] + ldrh r1, [r6, 0xA] + subs r0, r1 + strh r0, [r2, 0x8] + ldrh r0, [r5, 0x6] + ldrh r1, [r6, 0x6] + subs r0, r1 + strh r0, [r2, 0xA] + add r0, sp, 0x24 + strb r4, [r0] + ldr r3, [sp, 0x28] + strb r3, [r0, 0x1] + mov r1, r9 + strb r1, [r0, 0x2] + movs r7, 0 + mov r10, r0 + movs r0, 0x1 + negs r0, r0 + mov r9, r0 + add r6, sp, 0x18 +_081D36CA: + lsls r0, r7, 4 + subs r0, r7 + lsls r0, 24 + lsrs r5, r0, 24 + mov r1, r10 + str r1, [sp] + mov r0, r9 + str r0, [sp, 0x4] + ldr r1, =gUnknown_08625B54 + lsls r0, r7, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [sp, 0x8] + mov r0, r8 + movs r1, 0x1 + movs r2, 0 + adds r3, r5, 0 + bl box_print + lsls r0, r7, 1 + mov r4, sp + adds r4, r0 + adds r4, 0xC + movs r1, 0 + ldrsh r0, [r4, r1] + ldr r1, =gUnknown_085EEA76 + cmp r0, 0 + blt _081D3704 + ldr r1, =gUnknown_085EEA73 +_081D3704: + adds r0, r6, 0 + bl CopyString + mov r0, r10 + str r0, [sp] + mov r1, r9 + str r1, [sp, 0x4] + str r6, [sp, 0x8] + mov r0, r8 + movs r1, 0x1 + movs r2, 0x38 + adds r3, r5, 0 + bl box_print + movs r0, 0 + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _081D372C + negs r0, r1 +_081D372C: + movs r4, 0xC + cmp r0, 0x9 + bgt _081D3734 + movs r4, 0x12 +_081D3734: + cmp r1, 0 + bge _081D373A + negs r1, r1 +_081D373A: + adds r0, r6, 0 + movs r2, 0 + movs r3, 0x2 + bl ConvertIntToDecimalString + adds r2, r4, 0 + adds r2, 0x38 + mov r1, r10 + str r1, [sp] + mov r0, r9 + str r0, [sp, 0x4] + str r6, [sp, 0x8] + mov r0, r8 + movs r1, 0x1 + adds r3, r5, 0 + bl box_print + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, 0x5 + bls _081D36CA + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D3640 + + thumb_func_start sub_81D3784 +sub_81D3784: @ 81D3784 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + mov r8, r0 + adds r5, r1, 0 + adds r4, r2, 0 + adds r6, r3, 0 + ldr r2, [sp, 0x4C] + lsls r4, 24 + lsrs r4, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, r4, 4 + orrs r1, r4 + lsls r1, 24 + lsrs r1, 24 + str r2, [sp, 0x28] + bl FillWindowPixelBuffer + add r1, sp, 0xC + ldrh r0, [r5] + strh r0, [r1] + ldrh r0, [r5, 0x2] + strh r0, [r1, 0x2] + ldrh r0, [r5, 0x4] + strh r0, [r1, 0x4] + ldrh r0, [r5, 0x8] + strh r0, [r1, 0x6] + ldrh r0, [r5, 0xA] + strh r0, [r1, 0x8] + ldrh r0, [r5, 0x6] + strh r0, [r1, 0xA] + add r0, sp, 0x24 + strb r4, [r0] + strb r6, [r0, 0x1] + ldr r2, [sp, 0x28] + strb r2, [r0, 0x2] + movs r6, 0 + add r1, sp, 0x18 + mov r9, r1 + mov r7, r8 + mov r10, r0 + movs r2, 0x1 + negs r2, r2 + mov r8, r2 +_081D37EE: + lsls r1, r6, 1 + mov r0, sp + adds r0, r1 + adds r0, 0xC + movs r2, 0 + ldrsh r0, [r0, r2] + movs r4, 0x3 + cmp r0, 0x63 + bgt _081D3808 + movs r4, 0x1 + cmp r0, 0x9 + ble _081D3808 + movs r4, 0x2 +_081D3808: + mov r0, sp + adds r0, r1 + adds r0, 0xC + movs r2, 0 + ldrsh r1, [r0, r2] + mov r0, r9 + movs r2, 0 + adds r3, r4, 0 + bl ConvertIntToDecimalString + movs r0, 0x4 + subs r0, r4 + lsls r4, r0, 1 + adds r4, r0 + lsls r4, 17 + lsrs r4, 16 + lsls r5, r6, 4 + subs r5, r6 + lsls r5, 24 + lsrs r5, 24 + mov r0, r10 + str r0, [sp] + mov r1, r8 + str r1, [sp, 0x4] + ldr r1, =gUnknown_08625B54 + lsls r0, r6, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [sp, 0x8] + adds r0, r7, 0 + movs r1, 0x1 + movs r2, 0 + adds r3, r5, 0 + bl box_print + adds r4, 0x38 + lsls r4, 24 + lsrs r4, 24 + mov r2, r10 + str r2, [sp] + mov r0, r8 + str r0, [sp, 0x4] + mov r1, r9 + str r1, [sp, 0x8] + adds r0, r7, 0 + movs r1, 0x1 + adds r2, r4, 0 + adds r3, r5, 0 + bl box_print + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x5 + bls _081D37EE + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D3784 + + thumb_func_start sub_81D388C +sub_81D388C: @ 81D388C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r1, 0x3A + bl pokemon_getattr + strh r0, [r5] + adds r0, r4, 0 + movs r1, 0x3B + bl pokemon_getattr + strh r0, [r5, 0x2] + adds r0, r4, 0 + movs r1, 0x3C + bl pokemon_getattr + strh r0, [r5, 0x4] + adds r0, r4, 0 + movs r1, 0x3D + bl pokemon_getattr + strh r0, [r5, 0x6] + adds r0, r4, 0 + movs r1, 0x3E + bl pokemon_getattr + strh r0, [r5, 0x8] + adds r0, r4, 0 + movs r1, 0x3F + bl pokemon_getattr + strh r0, [r5, 0xA] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81D388C + + thumb_func_start sub_81D38D4 +sub_81D38D4: @ 81D38D4 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003d6d + adds r0, r1 + ldrb r1, [r0] + adds r2, r1, 0x1 + adds r0, r2, 0 + asrs r0, 8 + lsls r0, 8 + subs r0, r2, r0 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D38D4 + + thumb_func_start sub_81D38FC +sub_81D38FC: @ 81D38FC + push {r4,r5,lr} + adds r4, r0, 0 + movs r5, 0x9C + lsls r5, 2 + adds r1, r5, 0 + bl sub_806F96C + adds r4, r5 + ldr r1, [r4] + cmp r0, r1 + bne _081D3916 + movs r0, 0x1 + b _081D3918 +_081D3916: + movs r0, 0 +_081D3918: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81D38FC + + thumb_func_start sub_81D3920 +sub_81D3920: @ 81D3920 + push {r4-r7,lr} + adds r7, r0, 0 + ldrb r6, [r7] + subs r0, r6, 0x1 + cmp r0, 0x7 + bhi _081D3964 + movs r5, 0 + cmp r5, r6 + bcs _081D394C + adds r4, r7, 0 + adds r4, 0x8 +_081D3936: + adds r0, r4, 0 + bl sub_81D38FC + cmp r0, 0 + beq _081D3964 + movs r0, 0x9D + lsls r0, 2 + adds r4, r0 + adds r5, 0x1 + cmp r5, r6 + bcc _081D3936 +_081D394C: + adds r0, r7, 0 + adds r0, 0x8 + movs r1, 0x9D + lsls r1, 2 + muls r1, r6 + bl sub_806F96C + ldr r1, [r7, 0x4] + cmp r0, r1 + bne _081D3964 + movs r0, 0x1 + b _081D3966 +_081D3964: + movs r0, 0 +_081D3966: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81D3920 + + thumb_func_start sub_81D396C +sub_81D396C: @ 81D396C + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4] + subs r0, 0x1 + cmp r0, 0x7 + bhi _081D398E + adds r0, r4, 0 + adds r0, 0x8 + movs r1, 0xEE + lsls r1, 4 + bl sub_806F96C + ldr r1, [r4, 0x4] + cmp r0, r1 + bne _081D398E + movs r0, 0x1 + b _081D3990 +_081D398E: + movs r0, 0 +_081D3990: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81D396C + + thumb_func_start sub_81D3998 +sub_81D3998: @ 81D3998 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + mov r8, r1 + movs r2, 0x80 + lsls r2, 5 + mov r0, r8 + movs r1, 0 + bl memset + ldrb r0, [r7] + mov r1, r8 + strb r0, [r1] + bl sub_81D38D4 + mov r2, r8 + strb r0, [r2, 0x1] + ldrb r0, [r7] + adds r0, 0x1 + asrs r0, 1 + strb r0, [r2, 0x2] + movs r6, 0 + b _081D3A42 +_081D39C8: + movs r0, 0x1 + ands r0, r6 + cmp r0, 0 + bne _081D3A14 + lsrs r0, r6, 31 + adds r0, r6, r0 + asrs r0, 1 + lsls r4, r0, 4 + subs r4, r0 + lsls r4, 3 + subs r4, r0 + lsls r4, 3 + add r4, r8 + movs r0, 0x9D + lsls r0, 2 + adds r5, r6, 0 + muls r5, r0 + adds r5, r7, r5 + ldrb r0, [r5, 0x8] + strb r0, [r4, 0x8] + movs r1, 0xA7 + lsls r1, 2 + adds r0, r4, r1 + movs r2, 0xAA + lsls r2, 1 + adds r1, r5, r2 + subs r2, 0x30 + bl memcpy + adds r4, 0xC + adds r5, 0xC + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0xA4 + lsls r2, 1 + bl memcpy + b _081D3A40 +_081D3A14: + lsrs r1, r6, 31 + adds r1, r6, r1 + asrs r1, 1 + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 3 + subs r0, r1 + lsls r0, 3 + add r0, r8 + movs r1, 0x9D + lsls r1, 2 + muls r1, r6 + adds r1, r7, r1 + ldrb r2, [r1, 0x8] + strb r2, [r0, 0x9] + movs r2, 0xAA + lsls r2, 1 + adds r0, r2 + adds r1, 0xC + subs r2, 0xC + bl memcpy +_081D3A40: + adds r6, 0x1 +_081D3A42: + ldrb r0, [r7] + cmp r6, r0 + blt _081D39C8 + movs r0, 0x1 + ands r0, r6 + cmp r0, 0 + beq _081D3A7E + lsrs r2, r6, 31 + adds r2, r6, r2 + asrs r2, 1 + lsls r0, r2, 4 + subs r0, r2 + lsls r0, 3 + subs r0, r2 + lsls r0, 3 + add r0, r8 + movs r1, 0xAA + lsls r1, 1 + adds r0, r1 + ldr r3, =gUnknown_08625B6C + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r2 + lsls r1, 3 + adds r1, r3 + movs r2, 0xA4 + lsls r2, 1 + bl memcpy +_081D3A7E: + mov r0, r8 + adds r0, 0x8 + movs r1, 0xEE + lsls r1, 4 + bl sub_806F96C + mov r2, r8 + str r0, [r2, 0x4] + movs r0, 0x1E + mov r1, r8 + bl sub_8153634 + cmp r0, 0x1 + bne _081D3AA4 + movs r0, 0x1 + b _081D3AA6 + .pool +_081D3AA4: + movs r0, 0 +_081D3AA6: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81D3998 + + thumb_func_start sub_81D3AB0 +sub_81D3AB0: @ 81D3AB0 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x80 + lsls r0, 5 + bl AllocZeroed + adds r5, r0, 0 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81D3998 + adds r4, r0, 0 + adds r0, r5, 0 + bl Free + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81D3AB0 + + thumb_func_start sub_81D3AD8 +sub_81D3AD8: @ 81D3AD8 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r0, 0x1E + bl sub_81535DC + cmp r0, 0x1 + bne _081D3B04 + ldr r2, =0x00000ee8 + adds r0, r5, 0 + adds r1, r4, 0 + bl memcpy + adds r0, r5, 0 + bl sub_81D396C + cmp r0, 0 + beq _081D3B04 + movs r0, 0x1 + b _081D3B06 + .pool +_081D3B04: + movs r0, 0 +_081D3B06: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81D3AD8 + + thumb_func_start sub_81D3B0C +sub_81D3B0C: @ 81D3B0C + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x80 + lsls r0, 5 + bl AllocZeroed + adds r5, r0, 0 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81D3AD8 + adds r4, r0, 0 + adds r0, r5, 0 + bl Free + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81D3B0C + + thumb_func_start sub_81D3B34 +sub_81D3B34: @ 81D3B34 + push {r4,r5,lr} + movs r0, 0x80 + lsls r0, 5 + bl AllocZeroed + adds r4, r0, 0 + bl sub_81D3B0C + adds r5, r0, 0 + adds r0, r4, 0 + bl Free + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81D3B34 + + thumb_func_start sub_81D3B54 +sub_81D3B54: @ 81D3B54 + push {r4-r7,lr} + sub sp, 0x4 + adds r6, r0, 0 + adds r5, r1, 0 + bl sub_81D41A0 + movs r7, 0x2 + ldr r4, =0x03003144 +_081D3B64: + bl sub_81D4170 + ldr r0, =0x030012e2 + ldrh r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081D3B76 + strb r7, [r4] +_081D3B76: + movs r0, 0x1 + adds r1, r6, 0 + adds r2, r5, 0 + movs r3, 0 + bl sub_81D3D70 + adds r1, r0, 0 + ldr r0, =0x030012e4 + strh r1, [r0] + movs r0, 0x13 + ands r0, r1 + cmp r0, 0x10 + bne _081D3BA0 + movs r4, 0 + b _081D3BC2 + .pool +_081D3BA0: + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _081D3BAC + movs r4, 0x1 + b _081D3BC2 +_081D3BAC: + movs r0, 0x4 + ands r0, r1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _081D3BC0 + strb r0, [r4] + bl VBlankIntrWait + b _081D3B64 +_081D3BC0: + movs r4, 0x2 +_081D3BC2: + movs r0, 0 + str r0, [sp] + ldr r1, =0x030012c8 + ldr r2, =0x05000006 + mov r0, sp + bl CpuSet + bl sub_81D41F4 + adds r0, r4, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D3B54 + + thumb_func_start sub_81D3BE8 +sub_81D3BE8: @ 81D3BE8 + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + bl sub_81D41A0 + movs r6, 0x2 + ldr r4, =0x03003144 +_081D3BF6: + bl sub_81D4170 + ldr r0, =0x030012e2 + ldrh r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081D3C08 + strb r6, [r4] +_081D3C08: + movs r0, 0 + movs r1, 0 + movs r2, 0 + adds r3, r5, 0 + bl sub_81D3D70 + adds r1, r0, 0 + ldr r0, =0x030012e4 + strh r1, [r0] + movs r0, 0x13 + ands r0, r1 + cmp r0, 0x10 + bne _081D3C34 + movs r4, 0 + b _081D3C56 + .pool +_081D3C34: + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _081D3C40 + movs r4, 0x1 + b _081D3C56 +_081D3C40: + movs r0, 0x4 + ands r0, r1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _081D3C54 + strb r0, [r4] + bl VBlankIntrWait + b _081D3BF6 +_081D3C54: + movs r4, 0x2 +_081D3C56: + movs r0, 0 + str r0, [sp] + ldr r1, =0x030012c8 + ldr r2, =0x05000006 + mov r0, sp + bl CpuSet + bl sub_81D41F4 + adds r0, r4, 0 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D3BE8 + + thumb_func_start sub_81D3C7C +sub_81D3C7C: @ 81D3C7C + push {r4,lr} + ldr r4, =0x04000208 + movs r3, 0 + strh r3, [r4] + ldr r2, =0x04000200 + ldrh r1, [r2] + ldr r0, =0x0000ff3f + ands r0, r1 + strh r0, [r2] + movs r0, 0x1 + strh r0, [r4] + ldr r0, =0x04000128 + strh r3, [r0] + subs r0, 0x1A + strh r3, [r0] + ldr r1, =0x04000202 + movs r0, 0xC0 + strh r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D3C7C + + thumb_func_start sub_81D3CBC +sub_81D3CBC: @ 81D3CBC + push {r4-r7,lr} + sub sp, 0x4 + ldr r5, =0x04000208 + movs r4, 0 + strh r4, [r5] + ldr r3, =0x04000200 + ldrh r1, [r3] + ldr r0, =0x0000ff3f + ands r0, r1 + strh r0, [r3] + movs r6, 0x1 + strh r6, [r5] + ldr r0, =0x04000134 + strh r4, [r0] + ldr r2, =0x04000128 + movs r1, 0x80 + lsls r1, 6 + adds r0, r1, 0 + strh r0, [r2] + ldrh r0, [r2] + ldr r7, =0x00004003 + adds r1, r7, 0 + orrs r0, r1 + strh r0, [r2] + strh r4, [r5] + ldrh r0, [r3] + movs r1, 0x80 + orrs r0, r1 + strh r0, [r3] + strh r6, [r5] + ldr r1, =0x030012c8 + ldrb r0, [r1, 0x1] + cmp r0, 0 + bne _081D3D0A + str r0, [sp] + ldr r2, =0x05000006 + mov r0, sp + bl CpuSet +_081D3D0A: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D3CBC + + thumb_func_start sub_81D3D34 +sub_81D3D34: @ 81D3D34 + ldr r0, =0x04000134 + movs r3, 0 + strh r3, [r0] + ldr r2, =0x04000128 + movs r1, 0xA0 + lsls r1, 7 + adds r0, r1, 0 + strh r0, [r2] + ldrh r0, [r2] + movs r1, 0x8 + orrs r0, r1 + strh r0, [r2] + ldr r0, =0x03003144 + strb r3, [r0] + ldr r0, =0x030012e6 + strh r3, [r0] + ldr r1, =0x030012e8 + movs r0, 0 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_81D3D34 + + thumb_func_start sub_81D3D70 +sub_81D3D70: @ 81D3D70 + push {r4-r6,lr} + adds r4, r1, 0 + adds r5, r2, 0 + adds r6, r3, 0 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x030012c8 + ldrb r0, [r0, 0x1] + cmp r0, 0x6 + bls _081D3D86 + b _081D3ECC +_081D3D86: + lsls r0, 2 + ldr r1, =_081D3D98 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081D3D98: + .4byte _081D3DB4 + .4byte _081D3DC8 + .4byte _081D3DE8 + .4byte _081D3DFC + .4byte _081D3E74 + .4byte _081D3E84 + .4byte _081D3EBC +_081D3DB4: + bl sub_81D3CBC + ldr r1, =0x030012c8 + movs r0, 0x1 + strb r0, [r1, 0x2] + strb r0, [r1, 0x1] + b _081D3ECC + .pool +_081D3DC8: + adds r0, r2, 0 + bl sub_81D3EE8 + lsls r0, 16 + cmp r0, 0 + beq _081D3DD8 + bl sub_81D413C +_081D3DD8: + ldr r0, =0x03003144 + ldrb r0, [r0] + cmp r0, 0x2 + beq _081D3DE2 + b _081D3ECC +_081D3DE2: + b _081D3E04 + .pool +_081D3DE8: + bl sub_81D3D34 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_81D3F1C + ldr r1, =0x030012c8 + movs r0, 0x3 + strb r0, [r1, 0x1] +_081D3DFC: + ldr r0, =0x03003144 + ldrb r0, [r0] + cmp r0, 0x2 + bne _081D3E18 +_081D3E04: + ldr r1, =0x030012c8 + strb r0, [r1, 0x4] + movs r0, 0x6 + strb r0, [r1, 0x1] + b _081D3ECC + .pool +_081D3E18: + ldr r2, =0x030012e6 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + ldr r1, =0x030012e8 + ldr r0, [r1] + adds r3, r0, 0x1 + str r3, [r1] + ldr r1, =0x030012c8 + ldrb r0, [r1] + cmp r0, 0 + bne _081D3E3C + cmp r3, 0x3C + bls _081D3E3C + movs r0, 0x1 + strb r0, [r1, 0x4] + movs r0, 0x6 + strb r0, [r1, 0x1] +_081D3E3C: + ldr r4, =0x030012c8 + ldrb r0, [r4, 0x2] + cmp r0, 0x2 + beq _081D3ECC + ldrb r0, [r4] + cmp r0, 0 + beq _081D3E64 + ldrh r0, [r2] + cmp r0, 0x2 + bls _081D3E64 + bl sub_81D413C + movs r0, 0x2 + b _081D3ECA + .pool +_081D3E64: + bl sub_81D413C + ldr r1, =0x030012c8 + movs r0, 0x2 + strb r0, [r1, 0x2] + b _081D3ECC + .pool +_081D3E74: + bl sub_81D3CBC + ldr r1, =0x030012c8 + movs r0, 0x5 + strb r0, [r1, 0x1] + b _081D3ECC + .pool +_081D3E84: + ldr r0, =0x030012c8 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081D3E98 + ldr r0, =0x030012e6 + ldrh r0, [r0] + cmp r0, 0x2 + bls _081D3E98 + bl sub_81D413C +_081D3E98: + ldr r1, =0x030012e6 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x3C + bls _081D3ECC + ldr r0, =0x030012c8 + movs r1, 0x1 + strb r1, [r0, 0x4] + movs r1, 0x6 + strb r1, [r0, 0x1] + b _081D3ECC + .pool +_081D3EBC: + ldr r4, =0x030012c8 + ldrb r0, [r4, 0x2] + cmp r0, 0 + beq _081D3ECC + bl sub_81D3C7C + movs r0, 0 +_081D3ECA: + strb r0, [r4, 0x2] +_081D3ECC: + ldr r2, =0x030012c8 + ldrb r0, [r2, 0x2] + ldrb r1, [r2, 0x4] + lsls r1, 2 + orrs r0, r1 + ldrb r1, [r2, 0x3] + lsls r1, 4 + orrs r0, r1 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D3D70 + + thumb_func_start sub_81D3EE8 +sub_81D3EE8: @ 81D3EE8 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x04000128 + ldr r0, [r0] + movs r1, 0xC + ands r0, r1 + cmp r0, 0x8 + bne _081D3F0C + cmp r2, 0 + beq _081D3F0C + ldr r1, =0x030012c8 + movs r0, 0x1 + b _081D3F10 + .pool +_081D3F0C: + ldr r1, =0x030012c8 + movs r0, 0 +_081D3F10: + strb r0, [r1] + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D3EE8 + + thumb_func_start sub_81D3F1C +sub_81D3F1C: @ 81D3F1C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r3, =0x030012c8 + ldrb r0, [r3] + cmp r0, 0 + beq _081D3F54 + ldr r2, =0x04000128 + ldrh r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] + str r5, [r3, 0x8] + ldr r0, =0x04000120 + str r4, [r0] + lsrs r0, r4, 2 + adds r0, 0x1 + str r0, [r3, 0x10] + bl sub_81D3F68 + b _081D3F5C + .pool +_081D3F54: + ldr r1, =0x04000128 + ldrh r0, [r1] + strh r0, [r1] + str r2, [r3, 0x8] +_081D3F5C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D3F1C + + thumb_func_start sub_81D3F68 +sub_81D3F68: @ 81D3F68 + ldr r1, =0x0400010c + ldr r2, =0x0000fda7 + adds r0, r2, 0 + strh r0, [r1] + ldr r0, =0x0400010e + movs r2, 0x40 + strh r2, [r0] + ldr r3, =0x04000208 + movs r0, 0 + strh r0, [r3] + adds r1, 0xF4 + ldrh r0, [r1] + orrs r0, r2 + strh r0, [r1] + movs r0, 0x1 + strh r0, [r3] + bx lr + .pool + thumb_func_end sub_81D3F68 + + thumb_func_start sub_81D3F9C +sub_81D3F9C: @ 81D3F9C + push {lr} + bl sub_81D414C + bl sub_81D413C + pop {r0} + bx r0 + thumb_func_end sub_81D3F9C + + thumb_func_start sub_81D3FAC +sub_81D3FAC: @ 81D3FAC + push {r4-r6,lr} + sub sp, 0x8 + ldr r2, =0x030012c8 + ldrb r0, [r2, 0x1] + adds r3, r2, 0 + cmp r0, 0x3 + beq _081D4034 + cmp r0, 0x3 + bgt _081D3FC8 + cmp r0, 0x1 + beq _081D3FD0 + b _081D412A + .pool +_081D3FC8: + cmp r0, 0x5 + bne _081D3FCE + b _081D40FC +_081D3FCE: + b _081D412A +_081D3FD0: + ldr r1, =0x0400012a + ldr r2, =0x0000ccd0 + adds r0, r2, 0 + strh r0, [r1] + ldr r0, =0x04000120 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp] + str r1, [sp, 0x4] + movs r1, 0 + movs r2, 0 + movs r4, 0 + ldr r6, =0x0000ccd0 + ldr r5, =0x0000ffff +_081D3FEC: + lsls r0, r1, 1 + add r0, sp + ldrh r0, [r0] + cmp r0, r6 + bne _081D4010 + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + b _081D401A + .pool +_081D4010: + cmp r0, r5 + beq _081D401A + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_081D401A: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x3 + bls _081D3FEC + cmp r2, 0x2 + beq _081D402A + b _081D412A +_081D402A: + cmp r4, 0 + beq _081D4030 + b _081D412A +_081D4030: + strb r2, [r3, 0x1] + b _081D412A +_081D4034: + ldr r0, =0x04000120 + ldr r4, [r0] + ldr r0, [r2, 0xC] + cmp r0, 0 + bne _081D404A + ldrb r0, [r2] + cmp r0, 0 + bne _081D404A + lsrs r0, r4, 2 + adds r0, 0x1 + str r0, [r2, 0x10] +_081D404A: + ldrb r0, [r3] + cmp r0, 0x1 + bne _081D4080 + ldr r1, [r3, 0xC] + ldr r0, [r3, 0x10] + cmp r1, r0 + bge _081D4074 + ldr r2, =0x04000120 + ldr r0, [r3, 0x8] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r2] + ldr r0, [r3, 0x14] + ldr r1, [r1] + adds r0, r1 + str r0, [r3, 0x14] + b _081D40BA + .pool +_081D4074: + ldr r1, =0x04000120 + ldr r0, [r3, 0x14] + b _081D40B8 + .pool +_081D4080: + ldr r1, [r3, 0xC] + cmp r1, 0 + ble _081D40A0 + ldr r0, [r3, 0x10] + adds r0, 0x1 + cmp r1, r0 + bge _081D40A0 + ldr r0, [r3, 0x8] + lsls r1, 2 + adds r1, r0 + subs r1, 0x4 + str r4, [r1] + ldr r0, [r3, 0x14] + adds r0, r4 + str r0, [r3, 0x14] + b _081D40B4 +_081D40A0: + ldr r0, [r3, 0xC] + cmp r0, 0 + beq _081D40B4 + ldr r0, [r3, 0x14] + cmp r0, r4 + bne _081D40B0 + movs r0, 0x1 + b _081D40B2 +_081D40B0: + movs r0, 0x2 +_081D40B2: + strb r0, [r3, 0x3] +_081D40B4: + ldr r1, =0x030012e8 + movs r0, 0 +_081D40B8: + str r0, [r1] +_081D40BA: + ldr r1, [r3, 0xC] + adds r1, 0x1 + str r1, [r3, 0xC] + ldr r0, [r3, 0x10] + adds r0, 0x2 + cmp r1, r0 + bge _081D40EA + ldrb r0, [r3] + cmp r0, 0 + beq _081D40E4 + ldr r0, =0x0400010e + ldrh r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strh r1, [r0] + b _081D412A + .pool +_081D40E4: + bl sub_81D413C + b _081D412A +_081D40EA: + movs r0, 0 + movs r1, 0x4 + strb r1, [r3, 0x1] + ldr r1, =0x030012e6 + strh r0, [r1] + b _081D412A + .pool +_081D40FC: + ldrb r3, [r2] + cmp r3, 0 + bne _081D4108 + ldr r1, =0x0400012a + ldrb r0, [r2, 0x3] + strh r0, [r1] +_081D4108: + ldr r0, =0x04000120 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp] + str r1, [sp, 0x4] + mov r0, sp + ldrh r1, [r0, 0x2] + subs r0, r1, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _081D412A + cmp r3, 0x1 + bne _081D4126 + strb r1, [r2, 0x3] +_081D4126: + movs r0, 0x6 + strb r0, [r2, 0x1] +_081D412A: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D3FAC + + thumb_func_start sub_81D413C +sub_81D413C: @ 81D413C + ldr r0, =0x04000128 + ldrh r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strh r1, [r0] + bx lr + .pool + thumb_func_end sub_81D413C + + thumb_func_start sub_81D414C +sub_81D414C: @ 81D414C + ldr r2, =0x0400010e + ldrh r1, [r2] + ldr r0, =0x0000ff7f + ands r0, r1 + strh r0, [r2] + ldr r1, =0x0400010c + ldr r2, =0x0000fda7 + adds r0, r2, 0 + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_81D414C + + thumb_func_start sub_81D4170 +sub_81D4170: @ 81D4170 + push {r4,lr} + ldr r0, =0x04000130 + ldrh r0, [r0] + ldr r2, =0x000003ff + adds r1, r2, 0 + eors r1, r0 + ldr r4, =0x030012e2 + ldr r3, =0x030012e0 + ldrh r2, [r3] + adds r0, r1, 0 + bics r0, r2 + strh r0, [r4] + strh r1, [r3] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D4170 + + thumb_func_start sub_81D41A0 +sub_81D41A0: @ 81D41A0 + ldr r1, =0x030012ec + ldr r0, =0x04000208 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, =0x030012ee + ldr r0, =0x04000200 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, =0x030012f0 + ldr r0, =0x0400010e + ldrh r0, [r0] + strh r0, [r1] + ldr r1, =0x030012f2 + ldr r0, =0x04000128 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, =0x030012f4 + ldr r0, =0x04000134 + ldrh r0, [r0] + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_81D41A0 + + thumb_func_start sub_81D41F4 +sub_81D41F4: @ 81D41F4 + ldr r1, =0x04000208 + ldr r0, =0x030012ec + ldrh r0, [r0] + strh r0, [r1] + subs r1, 0x8 + ldr r0, =0x030012ee + ldrh r0, [r0] + strh r0, [r1] + subs r1, 0xF2 + ldr r0, =0x030012f0 + ldrh r0, [r0] + strh r0, [r1] + adds r1, 0x1A + ldr r0, =0x030012f2 + ldrh r0, [r0] + strh r0, [r1] + adds r1, 0xC + ldr r0, =0x030012f4 + ldrh r0, [r0] + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_81D41F4 + + thumb_func_start sub_81D4238 +sub_81D4238: @ 81D4238 + push {lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + ldr r1, =0x030012c8 + ldr r2, =0x05000006 + mov r0, sp + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D4238 + + thumb_func_start sub_81D4258 +sub_81D4258: @ 81D4258 + push {lr} + sub sp, 0x4 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + movs r0, 0x1 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + mov r0, sp + ldrb r0, [r0] + add sp, 0x4 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D4258 + + thumb_func_start sub_81D427C +sub_81D427C: @ 81D427C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + bl sub_81D4258 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r2, =0x02037350 + adds r5, r1, r2 + ldr r4, =0x030012f8 + ldr r3, =0x02037590 + ldrb r1, [r3, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x14] + ldrh r1, [r5, 0x10] + subs r0, r1 + strh r0, [r4] + ldr r4, =0x030012fa + ldrb r1, [r3, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x16] + ldrh r1, [r5, 0x12] + subs r0, r1 + strh r0, [r4] + movs r0, 0 + mov r8, r0 + ldr r2, =0x030012fc + movs r1, 0 +_081D42CA: + mov r3, r8 + adds r0, r3, r2 + strb r1, [r0] + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x3 + bls _081D42CA + ldr r2, =0x02037350 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r2, r0, r2 + movs r4, 0x14 + ldrsh r1, [r2, r4] + movs r6, 0x10 + ldrsh r0, [r2, r6] + cmp r1, r0 + bne _081D4304 + movs r0, 0x16 + ldrsh r1, [r2, r0] + movs r3, 0x12 + ldrsh r0, [r2, r3] + cmp r1, r0 + beq _081D4356 +_081D4304: + ldr r0, =0x0000403a + bl VarGet + lsls r0, 16 + movs r1, 0xE0 + lsls r1, 11 + ands r1, r0 + cmp r1, 0 + bne _081D4338 + ldrb r1, [r5, 0x1] + movs r0, 0x21 + negs r0, r0 + ands r0, r1 + b _081D433E + .pool +_081D4338: + ldrb r0, [r5, 0x1] + movs r1, 0x20 + orrs r0, r1 +_081D433E: + strb r0, [r5, 0x1] + ldr r0, =0x0000403a + bl VarGet + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x9 + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + bne _081D4360 +_081D4356: + movs r0, 0 + b _081D4816 + .pool +_081D4360: + movs r4, 0 + mov r8, r4 + ldr r6, =0x02037350 + mov r10, r6 +_081D4368: + ldr r3, =0x02037590 + ldrb r1, [r3, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + mov r1, r10 + adds r4, r0, r1 + mov r2, r8 + lsls r1, r2, 2 + ldr r6, =gUnknown_0862608C + adds r0, r1, r6 + movs r6, 0x14 + ldrsh r2, [r4, r6] + movs r6, 0 + ldrsh r0, [r0, r6] + ldr r6, =0x02037350 + mov r9, r6 + mov r12, r3 + adds r7, r1, 0 + cmp r2, r0 + beq _081D4394 + b _081D449E +_081D4394: + movs r3, 0 + ldr r1, =gUnknown_0862608E + adds r0, r7, r1 + movs r2, 0x16 + ldrsh r1, [r4, r2] + movs r4, 0 + ldrsh r2, [r0, r4] + cmp r1, r2 + bge _081D43C0 + movs r6, 0x12 + ldrsh r0, [r5, r6] + cmp r0, r2 + bgt _081D43CA + b _081D449E + .pool +_081D43C0: + movs r1, 0x12 + ldrsh r0, [r5, r1] + cmp r0, r2 + blt _081D43CA + movs r3, 0x1 +_081D43CA: + cmp r3, 0 + bne _081D449E + ldr r0, =0x030012f8 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + ble _081D4410 + movs r3, 0x10 + ldrsh r2, [r5, r3] + adds r2, 0x1 + mov r4, r12 + ldrb r1, [r4, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + add r0, r9 + movs r6, 0x14 + ldrsh r0, [r0, r6] + cmp r2, r0 + bne _081D4446 + ldrh r0, [r5, 0x10] + adds r0, 0x1 + lsls r0, 16 + asrs r0, 16 + movs r2, 0x12 + ldrsh r1, [r5, r2] + bl sub_81D4834 + lsls r0, 24 + cmp r0, 0 + beq _081D4446 +_081D4408: + movs r0, 0x4 + b _081D4816 + .pool +_081D4410: + cmp r0, 0 + bge _081D4446 + movs r3, 0x10 + ldrsh r2, [r5, r3] + subs r2, 0x1 + mov r4, r12 + ldrb r1, [r4, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + add r0, r9 + movs r6, 0x14 + ldrsh r0, [r0, r6] + cmp r2, r0 + bne _081D4446 + ldrh r0, [r5, 0x10] + subs r0, 0x1 + lsls r0, 16 + asrs r0, 16 + movs r2, 0x12 + ldrsh r1, [r5, r2] + bl sub_81D4834 + lsls r0, 24 + cmp r0, 0 + beq _081D4446 + b _081D45AA +_081D4446: + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + add r0, r10 + movs r3, 0x10 + ldrsh r1, [r5, r3] + movs r4, 0x14 + ldrsh r0, [r0, r4] + cmp r1, r0 + bne _081D449E + ldr r0, =0x030012fa + movs r6, 0 + ldrsh r0, [r0, r6] + cmp r0, 0 + ble _081D4488 + adds r0, r1, 0 + ldrh r1, [r5, 0x12] + subs r1, 0x1 + lsls r1, 16 + asrs r1, 16 + bl sub_81D4834 + lsls r0, 24 + cmp r0, 0 + beq _081D449E +_081D447C: + movs r0, 0x2 + b _081D4816 + .pool +_081D4488: + movs r2, 0x10 + ldrsh r0, [r5, r2] + ldrh r1, [r5, 0x12] + adds r1, 0x1 + lsls r1, 16 + asrs r1, 16 + bl sub_81D4834 + lsls r0, 24 + cmp r0, 0 + bne _081D4538 +_081D449E: + ldr r2, =0x02037590 + ldrb r1, [r2, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + mov r3, r10 + adds r4, r0, r3 + ldr r6, =gUnknown_0862608C + ldr r1, =gUnknown_0862608E + adds r0, r7, r1 + movs r3, 0x16 + ldrsh r1, [r4, r3] + movs r3, 0 + ldrsh r0, [r0, r3] + ldr r3, =0x02037350 + mov r9, r3 + mov r12, r2 + cmp r1, r0 + beq _081D44C6 + b _081D45D0 +_081D44C6: + movs r3, 0 + adds r0, r7, r6 + movs r6, 0x14 + ldrsh r1, [r4, r6] + movs r4, 0 + ldrsh r2, [r0, r4] + cmp r1, r2 + bge _081D44F0 + movs r6, 0x10 + ldrsh r0, [r5, r6] + cmp r0, r2 + bgt _081D44FA + b _081D45D0 + .pool +_081D44F0: + movs r1, 0x10 + ldrsh r0, [r5, r1] + cmp r0, r2 + blt _081D44FA + movs r3, 0x1 +_081D44FA: + cmp r3, 0 + bne _081D45D0 + ldr r0, =0x030012fa + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + ble _081D4540 + movs r3, 0x12 + ldrsh r2, [r5, r3] + adds r2, 0x1 + mov r4, r12 + ldrb r1, [r4, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + add r0, r9 + movs r6, 0x16 + ldrsh r0, [r0, r6] + cmp r2, r0 + bne _081D4576 + movs r1, 0x10 + ldrsh r0, [r5, r1] + ldrh r1, [r5, 0x12] + adds r1, 0x1 + lsls r1, 16 + asrs r1, 16 + bl sub_81D4834 + lsls r0, 24 + cmp r0, 0 + beq _081D4576 +_081D4538: + movs r0, 0x1 + b _081D4816 + .pool +_081D4540: + cmp r0, 0 + bge _081D4576 + movs r3, 0x12 + ldrsh r2, [r5, r3] + subs r2, 0x1 + mov r4, r12 + ldrb r1, [r4, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + add r0, r9 + movs r6, 0x16 + ldrsh r0, [r0, r6] + cmp r2, r0 + bne _081D4576 + movs r1, 0x10 + ldrsh r0, [r5, r1] + ldrh r1, [r5, 0x12] + subs r1, 0x1 + lsls r1, 16 + asrs r1, 16 + bl sub_81D4834 + lsls r0, 24 + cmp r0, 0 + beq _081D4576 + b _081D447C +_081D4576: + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + add r0, r10 + movs r2, 0x12 + ldrsh r1, [r5, r2] + movs r3, 0x16 + ldrsh r0, [r0, r3] + cmp r1, r0 + bne _081D45D0 + ldr r0, =0x030012f8 + movs r4, 0 + ldrsh r0, [r0, r4] + cmp r0, 0 + ble _081D45B8 + ldrh r0, [r5, 0x10] + subs r0, 0x1 + lsls r0, 16 + asrs r0, 16 + bl sub_81D4834 + lsls r0, 24 + cmp r0, 0 + beq _081D45D0 +_081D45AA: + movs r0, 0x3 + b _081D4816 + .pool +_081D45B8: + ldrh r0, [r5, 0x10] + adds r0, 0x1 + lsls r0, 16 + asrs r0, 16 + movs r2, 0x12 + ldrsh r1, [r5, r2] + bl sub_81D4834 + lsls r0, 24 + cmp r0, 0 + beq _081D45D0 + b _081D4408 +_081D45D0: + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x3 + bhi _081D45E0 + b _081D4368 +_081D45E0: + adds r0, r5, 0 + movs r1, 0 + bl sub_81D4C14 + lsls r0, 24 + cmp r0, 0 + beq _081D461C + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81D4C58 + lsls r0, 24 + cmp r0, 0 + beq _081D4604 + movs r0, 0x2 + bl sub_81D4D24 + b _081D4812 +_081D4604: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81D4CE0 + lsls r0, 24 + cmp r0, 0 + bne _081D4614 + b _081D447C +_081D4614: + movs r0, 0x2 + bl sub_81D4D24 + b _081D4812 +_081D461C: + adds r0, r5, 0 + movs r1, 0 + bl sub_81D4C9C + lsls r0, 24 + cmp r0, 0 + beq _081D4658 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81D4C58 + lsls r0, 24 + cmp r0, 0 + beq _081D4640 + movs r0, 0x2 + bl sub_81D4D24 + b _081D4812 +_081D4640: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81D4CE0 + lsls r0, 24 + cmp r0, 0 + bne _081D4650 + b _081D4538 +_081D4650: + movs r0, 0x2 + bl sub_81D4D24 + b _081D4812 +_081D4658: + adds r0, r5, 0 + movs r1, 0 + bl sub_81D4C58 + lsls r0, 24 + cmp r0, 0 + beq _081D4694 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81D4C14 + lsls r0, 24 + cmp r0, 0 + beq _081D467C + movs r0, 0x2 + bl sub_81D4D24 + b _081D4812 +_081D467C: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81D4C9C + lsls r0, 24 + cmp r0, 0 + bne _081D468C + b _081D4408 +_081D468C: + movs r0, 0x2 + bl sub_81D4D24 + b _081D4812 +_081D4694: + adds r0, r5, 0 + movs r1, 0 + bl sub_81D4CE0 + lsls r0, 24 + cmp r0, 0 + beq _081D46D0 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81D4C14 + lsls r0, 24 + cmp r0, 0 + beq _081D46B8 + movs r0, 0x2 + bl sub_81D4D24 + b _081D4812 +_081D46B8: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81D4C9C + lsls r0, 24 + cmp r0, 0 + bne _081D46C8 + b _081D45AA +_081D46C8: + movs r0, 0x2 + bl sub_81D4D24 + b _081D4812 +_081D46D0: + ldr r0, =0x030012fa + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r0, 0 + bne _081D476E + ldr r2, =0x02037350 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r4, 0x12 + ldrsh r1, [r0, r4] + ldrh r2, [r5, 0x12] + movs r6, 0x12 + ldrsh r0, [r5, r6] + cmp r1, r0 + ble _081D470C + movs r1, 0x10 + ldrsh r0, [r5, r1] + subs r1, r2, 0x1 + lsls r1, 16 + asrs r1, 16 + bl sub_81D4834 + lsls r0, 24 + cmp r0, 0 + beq _081D470C + b _081D447C +_081D470C: + ldr r2, =0x02037350 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r2, 0x12 + ldrsh r1, [r0, r2] + ldrh r2, [r5, 0x12] + movs r3, 0x12 + ldrsh r0, [r5, r3] + cmp r1, r0 + bge _081D473E + movs r4, 0x10 + ldrsh r0, [r5, r4] + adds r1, r2, 0x1 + lsls r1, 16 + asrs r1, 16 + bl sub_81D4834 + lsls r0, 24 + cmp r0, 0 + beq _081D473E + b _081D4538 +_081D473E: + movs r6, 0x10 + ldrsh r0, [r5, r6] + ldrh r1, [r5, 0x12] + subs r1, 0x1 + lsls r1, 16 + asrs r1, 16 + bl sub_81D4834 + lsls r0, 24 + cmp r0, 0 + beq _081D4756 + b _081D447C +_081D4756: + movs r1, 0x10 + ldrsh r0, [r5, r1] + ldrh r1, [r5, 0x12] + adds r1, 0x1 + lsls r1, 16 + asrs r1, 16 + bl sub_81D4834 + lsls r0, 24 + cmp r0, 0 + beq _081D476E + b _081D4538 +_081D476E: + ldr r0, =0x030012f8 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + bne _081D480C + ldr r2, =0x02037350 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r3, 0x10 + ldrsh r1, [r0, r3] + ldrh r2, [r5, 0x10] + movs r4, 0x10 + ldrsh r0, [r5, r4] + cmp r1, r0 + ble _081D47AA + subs r0, r2, 0x1 + lsls r0, 16 + asrs r0, 16 + movs r6, 0x12 + ldrsh r1, [r5, r6] + bl sub_81D4834 + lsls r0, 24 + cmp r0, 0 + beq _081D47AA + b _081D45AA +_081D47AA: + ldr r2, =0x02037350 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r2, 0x10 + ldrsh r1, [r0, r2] + ldrh r2, [r5, 0x10] + movs r3, 0x10 + ldrsh r0, [r5, r3] + cmp r1, r0 + bge _081D47DC + adds r0, r2, 0x1 + lsls r0, 16 + asrs r0, 16 + movs r4, 0x12 + ldrsh r1, [r5, r4] + bl sub_81D4834 + lsls r0, 24 + cmp r0, 0 + beq _081D47DC + b _081D4408 +_081D47DC: + ldrh r0, [r5, 0x10] + adds r0, 0x1 + lsls r0, 16 + asrs r0, 16 + movs r6, 0x12 + ldrsh r1, [r5, r6] + bl sub_81D4834 + lsls r0, 24 + cmp r0, 0 + beq _081D47F4 + b _081D4408 +_081D47F4: + ldrh r0, [r5, 0x10] + subs r0, 0x1 + lsls r0, 16 + asrs r0, 16 + movs r2, 0x12 + ldrsh r1, [r5, r2] + bl sub_81D4834 + lsls r0, 24 + cmp r0, 0 + beq _081D480C + b _081D45AA +_081D480C: + movs r0, 0 + bl sub_81D4890 +_081D4812: + lsls r0, 24 + lsrs r0, 24 +_081D4816: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D427C + + thumb_func_start sub_81D4834 +sub_81D4834: @ 81D4834 + push {r4,lr} + lsls r0, 16 + lsls r1, 16 + lsrs r4, r1, 16 + ldr r3, =0x02037350 + ldr r1, =0x02037590 + ldrb r2, [r1, 0x5] + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 2 + adds r2, r1, r3 + movs r3, 0x10 + ldrsh r1, [r2, r3] + lsrs r3, r0, 16 + asrs r0, 16 + cmp r1, r0 + bne _081D4870 + movs r0, 0x12 + ldrsh r1, [r2, r0] + lsls r0, r4, 16 + asrs r0, 16 + cmp r1, r0 + bne _081D4870 + movs r0, 0 + b _081D4888 + .pool +_081D4870: + lsls r0, r3, 16 + asrs r0, 16 + lsls r1, r4, 16 + asrs r1, 16 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl sub_8088E64 + lsls r0, 24 + lsrs r0, 24 +_081D4888: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81D4834 + + thumb_func_start sub_81D4890 +sub_81D4890: @ 81D4890 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + bl sub_81D4258 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02037350 + adds r4, r1, r0 + movs r1, 0 + ldr r3, =0x030012fc + movs r2, 0 +_081D48B0: + adds r0, r1, r3 + strb r2, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bls _081D48B0 + movs r1, 0x10 + ldrsh r0, [r4, r1] + ldrh r1, [r4, 0x12] + subs r1, 0x1 + lsls r1, 16 + asrs r1, 16 + bl sub_81D4834 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081D48E8 + cmp r6, 0x2 + beq _081D48E8 + ldr r0, =0x030012fc + adds r0, r5, r0 + movs r1, 0x2 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_081D48E8: + ldrh r0, [r4, 0x10] + adds r0, 0x1 + lsls r0, 16 + asrs r0, 16 + movs r2, 0x12 + ldrsh r1, [r4, r2] + bl sub_81D4834 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081D4912 + cmp r6, 0x4 + beq _081D4912 + ldr r0, =0x030012fc + adds r0, r5, r0 + movs r1, 0x4 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_081D4912: + movs r1, 0x10 + ldrsh r0, [r4, r1] + ldrh r1, [r4, 0x12] + adds r1, 0x1 + lsls r1, 16 + asrs r1, 16 + bl sub_81D4834 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1 + bne _081D493A + cmp r6, 0x1 + beq _081D493A + ldr r0, =0x030012fc + adds r0, r5, r0 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_081D493A: + ldrh r0, [r4, 0x10] + subs r0, 0x1 + lsls r0, 16 + asrs r0, 16 + movs r2, 0x12 + ldrsh r1, [r4, r2] + bl sub_81D4834 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081D4964 + cmp r6, 0x3 + beq _081D4964 + ldr r0, =0x030012fc + adds r0, r5, r0 + movs r1, 0x3 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_081D4964: + cmp r5, 0x1 + bhi _081D4974 + ldr r0, =0x030012fc + b _081D4988 + .pool +_081D4974: + ldr r4, =0x030012fc + ldr r0, =0x0000403a + bl VarGet + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + bl __modsi3 + adds r0, r4 +_081D4988: + ldrb r0, [r0] + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D4890 + + thumb_func_start sub_81D4998 +sub_81D4998: @ 81D4998 + push {r4,lr} + ldr r4, =0x0000403a + adds r0, r4, 0 + bl VarGet + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r1, [r0, 0x4] + ldr r0, =0x0000391a + cmp r1, r0 + bne _081D49E0 + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, =0x0000270e + cmp r2, r0 + bls _081D49D8 + adds r0, r4, 0 + movs r1, 0 + bl VarSet + b _081D49E0 + .pool +_081D49D8: + adds r0, r4, 0 + adds r1, r2, 0 + bl VarSet +_081D49E0: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81D4998 + + thumb_func_start FieldObjectIsFarawayIslandMew +@ bool8 FieldObjectIsFarawayIslandMew(struct npc_state *fieldObject) +FieldObjectIsFarawayIslandMew: @ 81D49E8 + push {lr} + adds r2, r0, 0 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r1, [r0, 0x4] + ldr r0, =0x0000391a + cmp r1, r0 + bne _081D4A0C + ldrb r0, [r2, 0x5] + cmp r0, 0xE5 + bne _081D4A0C + movs r0, 0x1 + b _081D4A0E + .pool +_081D4A0C: + movs r0, 0 +_081D4A0E: + pop {r1} + bx r1 + thumb_func_end FieldObjectIsFarawayIslandMew + + thumb_func_start unown_chamber_related +unown_chamber_related: @ 81D4A14 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r1, [r0, 0x4] + ldr r0, =0x0000391a + cmp r1, r0 + bne _081D4A50 + movs r0, 0xE5 + lsls r0, 1 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081D4A50 + ldr r0, =0x000002ce + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081D4A50 + movs r0, 0x1 + b _081D4A52 + .pool +_081D4A50: + movs r0, 0 +_081D4A52: + pop {r1} + bx r1 + thumb_func_end unown_chamber_related + + thumb_func_start sub_81D4A58 +sub_81D4A58: @ 81D4A58 + push {r4,lr} + ldr r4, =0x0000403a + adds r0, r4, 0 + bl VarGet + lsls r0, 16 + ldr r1, =0xffff0000 + cmp r0, r1 + beq _081D4A88 + adds r0, r4, 0 + bl VarGet + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + cmp r1, 0 + bne _081D4A88 + movs r0, 0x1 + b _081D4A8A + .pool +_081D4A88: + movs r0, 0 +_081D4A8A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81D4A58 + + thumb_func_start sub_81D4A90 +sub_81D4A90: @ 81D4A90 + push {r4-r6,lr} + sub sp, 0x4 + bl sub_81D4258 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02037350 + adds r5, r1, r0 + ldrb r1, [r5, 0x1] + movs r0, 0x21 + negs r0, r0 + ands r0, r1 + strb r0, [r5, 0x1] + ldr r0, =0x020375e0 + ldrh r4, [r0] + cmp r4, 0x1 + bne _081D4AF8 + ldrb r0, [r5, 0x3] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r5, 0x3] + ldr r3, =0x02020630 + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x42 + ldrb r2, [r0] + movs r1, 0x3F + ands r1, r2 + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0] + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x43 + strb r4, [r0] + b _081D4BC4 + .pool +_081D4AF8: + ldr r0, =0x0000403a + ldr r1, =0x0000ffff + bl VarSet + ldrb r0, [r5, 0x3] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r5, 0x3] + ldr r6, =0x02020630 + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x42 + ldrb r2, [r0] + movs r1, 0x3F + ands r1, r2 + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0] + ldr r0, =0x020375f4 + ldrh r0, [r0] + cmp r0, 0x2 + beq _081D4B3A + ldrb r0, [r5, 0x4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + adds r1, 0x43 + movs r0, 0x1 + strb r0, [r1] +_081D4B3A: + ldr r4, =gFieldEffectObjectPaletteInfo1 + adds r0, r4, 0 + bl LoadTaggedObjectPalette + ldrh r0, [r4, 0x4] + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 24 + bl sub_80ABE18 + ldrh r1, [r5, 0x10] + mov r0, sp + strh r1, [r0] + ldrh r0, [r5, 0x12] + mov r4, sp + adds r4, 0x2 + strh r0, [r4] + mov r0, sp + adds r1, r4, 0 + movs r2, 0x8 + movs r3, 0x8 + bl sub_80930E0 + ldr r0, =gFieldEffectObjectTemplatePointers + ldr r0, [r0, 0x3C] + mov r1, sp + movs r2, 0 + ldrsh r1, [r1, r2] + movs r3, 0 + ldrsh r2, [r4, r3] + ldrb r4, [r5, 0x4] + lsls r3, r4, 4 + adds r3, r4 + lsls r3, 2 + adds r3, r6 + adds r3, 0x43 + ldrb r3, [r3] + subs r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + bl AddObjectToBack + ldr r1, =0x0203cf50 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _081D4BC4 + ldrb r0, [r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + adds r3, r1, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r2, 0x2 + orrs r0, r2 + strb r0, [r3] + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + movs r2, 0x8 + orrs r0, r2 + strb r0, [r1, 0x5] + ldr r0, =DummyObjectCallback + str r0, [r1, 0x1C] +_081D4BC4: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D4A90 + + thumb_func_start sub_81D4BEC +sub_81D4BEC: @ 81D4BEC + push {lr} + ldr r1, =0x0203cf50 + ldrb r0, [r1] + cmp r0, 0x40 + beq _081D4C06 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles +_081D4C06: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D4BEC + + thumb_func_start sub_81D4C14 +sub_81D4C14: @ 81D4C14 + push {r4,lr} + adds r2, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + ldr r0, =0x030012fa + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + ble _081D4C50 + movs r1, 0x10 + ldrsh r0, [r2, r1] + ldrh r1, [r2, 0x12] + subs r1, 0x1 + lsls r1, 16 + asrs r1, 16 + bl sub_81D4834 + lsls r0, 24 + cmp r0, 0 + beq _081D4C50 + ldr r0, =0x030012fc + adds r0, r4, r0 + movs r1, 0x2 + strb r1, [r0] + movs r0, 0x1 + b _081D4C52 + .pool +_081D4C50: + movs r0, 0 +_081D4C52: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81D4C14 + + thumb_func_start sub_81D4C58 +sub_81D4C58: @ 81D4C58 + push {r4,lr} + adds r2, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + ldr r0, =0x030012f8 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _081D4C94 + ldrh r0, [r2, 0x10] + adds r0, 0x1 + lsls r0, 16 + asrs r0, 16 + movs r3, 0x12 + ldrsh r1, [r2, r3] + bl sub_81D4834 + lsls r0, 24 + cmp r0, 0 + beq _081D4C94 + ldr r0, =0x030012fc + adds r0, r4, r0 + movs r1, 0x4 + strb r1, [r0] + movs r0, 0x1 + b _081D4C96 + .pool +_081D4C94: + movs r0, 0 +_081D4C96: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81D4C58 + + thumb_func_start sub_81D4C9C +sub_81D4C9C: @ 81D4C9C + push {r4,lr} + adds r2, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + ldr r0, =0x030012fa + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _081D4CD8 + movs r1, 0x10 + ldrsh r0, [r2, r1] + ldrh r1, [r2, 0x12] + adds r1, 0x1 + lsls r1, 16 + asrs r1, 16 + bl sub_81D4834 + lsls r0, 24 + cmp r0, 0 + beq _081D4CD8 + ldr r0, =0x030012fc + adds r0, r4, r0 + movs r1, 0x1 + strb r1, [r0] + movs r0, 0x1 + b _081D4CDA + .pool +_081D4CD8: + movs r0, 0 +_081D4CDA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81D4C9C + + thumb_func_start sub_81D4CE0 +sub_81D4CE0: @ 81D4CE0 + push {r4,lr} + adds r2, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + ldr r0, =0x030012f8 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + ble _081D4D1C + ldrh r0, [r2, 0x10] + subs r0, 0x1 + lsls r0, 16 + asrs r0, 16 + movs r3, 0x12 + ldrsh r1, [r2, r3] + bl sub_81D4834 + lsls r0, 24 + cmp r0, 0 + beq _081D4D1C + ldr r0, =0x030012fc + adds r0, r4, r0 + movs r1, 0x3 + strb r1, [r0] + movs r0, 0x1 + b _081D4D1E + .pool +_081D4D1C: + movs r0, 0 +_081D4D1E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81D4CE0 + + thumb_func_start sub_81D4D24 +sub_81D4D24: @ 81D4D24 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =0x030012fc + ldr r0, =0x0000403a + bl VarGet + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __modsi3 + adds r0, r5 + ldrb r0, [r0] + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D4D24 + + thumb_func_start sub_81D4D50 +sub_81D4D50: @ 81D4D50 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + mov r8, r2 + mov r1, sp + ldr r4, =0x04000208 + ldrh r0, [r4] + strh r0, [r1] + movs r0, 0 + strh r0, [r4] + ldr r1, =0x03002710 + ldr r0, =sub_81D3FAC + str r0, [r1, 0x4] + ldr r0, =sub_81D3F9C + str r0, [r1, 0x8] + bl sub_81D41A0 + bl sub_81D4238 + ldr r2, =0x04000200 + ldrh r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strh r0, [r2] + mov r0, sp + ldrh r0, [r0] + strh r0, [r4] + movs r0, 0 + strh r0, [r5] + str r6, [r5, 0x4] + mov r0, r8 + str r0, [r5, 0x8] + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D4D50 + + thumb_func_start sub_81D4DB8 +sub_81D4DB8: @ 81D4DB8 + push {r4,lr} + sub sp, 0x4 + mov r1, sp + ldr r4, =0x04000208 + ldrh r0, [r4] + strh r0, [r1] + movs r0, 0 + strh r0, [r4] + bl sub_81D4238 + bl sub_81D41F4 + bl RestoreSerialTimer3IntrHandlers + mov r0, sp + ldrh r0, [r0] + strh r0, [r4] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D4DB8 + + thumb_func_start sub_81D4DE8 +sub_81D4DE8: @ 81D4DE8 + push {r4,r5,lr} + adds r4, r0, 0 + movs r5, 0 + ldr r1, [r4, 0x4] + ldr r2, [r4, 0x8] + movs r0, 0x1 + movs r3, 0 + bl sub_81D3D70 + adds r1, r0, 0 + strh r1, [r4] + movs r0, 0x13 + ands r0, r1 + cmp r0, 0x10 + bne _081D4E08 + movs r5, 0x1 +_081D4E08: + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _081D4E12 + movs r5, 0x2 +_081D4E12: + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _081D4E1C + movs r5, 0x3 +_081D4E1C: + ldr r1, =0x03003144 + movs r0, 0 + strb r0, [r1] + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D4DE8 + + thumb_func_start sub_81D4E30 +sub_81D4E30: @ 81D4E30 + push {lr} + ldr r0, =0x0201c000 + movs r2, 0x80 + lsls r2, 6 + movs r1, 0 + bl memset + ldr r1, =0x020229c6 + ldr r2, =0x00005503 + adds r0, r2, 0 + strh r0, [r1] + bl sub_8009734 + movs r0, 0x1 + bl sub_800B330 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D4E30 + + thumb_func_start sub_81D4E60 +sub_81D4E60: @ 81D4E60 + push {lr} + sub sp, 0xC + mov r1, sp + ldr r2, =0x04000208 + ldrh r0, [r2] + strh r0, [r1] + movs r0, 0 + strh r0, [r2] + ldr r0, =0x03003174 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x4] + str r1, [sp, 0x8] + mov r0, sp + ldrh r0, [r0] + strh r0, [r2] + add r2, sp, 0x4 + ldrh r1, [r2] + ldr r0, =0x0000b9a0 + cmp r1, r0 + bne _081D4EB8 + ldrh r1, [r2, 0x2] + ldr r0, =0x0000ccd0 + cmp r1, r0 + bne _081D4EB8 + ldrh r1, [r2, 0x4] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _081D4EB8 + ldrh r0, [r2, 0x6] + cmp r0, r1 + bne _081D4EB8 + movs r0, 0x1 + b _081D4EBA + .pool +_081D4EB8: + movs r0, 0 +_081D4EBA: + add sp, 0xC + pop {r1} + bx r1 + thumb_func_end sub_81D4E60 + + thumb_func_start sub_81D4EC0 +sub_81D4EC0: @ 81D4EC0 + push {lr} + bl sub_800ABBC + lsls r0, 24 + cmp r0, 0 + beq _081D4EDC + bl sub_800ABAC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _081D4EDC + movs r0, 0x1 + b _081D4EDE +_081D4EDC: + movs r0, 0 +_081D4EDE: + pop {r1} + bx r1 + thumb_func_end sub_81D4EC0 + + thumb_func_start sub_81D4EE4 +sub_81D4EE4: @ 81D4EE4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4] + subs r0, 0x3 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bhi _081D4F08 + bl sub_800B33C + lsls r0, 24 + cmp r0, 0 + beq _081D4F08 + movs r0, 0 + strb r0, [r4] + movs r0, 0x3 + b _081D500E +_081D4F08: + ldrb r0, [r4] + cmp r0, 0x5 + bls _081D4F10 + b _081D500C +_081D4F10: + lsls r0, 2 + ldr r1, =_081D4F20 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081D4F20: + .4byte _081D4F38 + .4byte _081D4F54 + .4byte _081D4F6C + .4byte _081D4FA0 + .4byte _081D4FEC + .4byte _081D4FF8 +_081D4F38: + bl sub_800ABBC + lsls r0, 24 + cmp r0, 0 + beq _081D4F88 + bl sub_800ABAC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _081D4F88 + movs r0, 0x1 + strb r0, [r4] + b _081D500C +_081D4F54: + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x5 + bls _081D500C + movs r0, 0 + strh r0, [r5] + movs r0, 0x2 + strb r0, [r4] + b _081D500C +_081D4F6C: + bl sub_800ABAC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _081D4F88 + movs r0, 0x49 + bl audio_play + bl sub_800A620 + movs r0, 0 + strh r0, [r5] + b _081D4FE6 +_081D4F88: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081D500C + movs r0, 0 + strb r0, [r4] + movs r0, 0x1 + b _081D500E + .pool +_081D4FA0: + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1E + bls _081D4FB6 + movs r0, 0 + strb r0, [r4] + movs r0, 0x5 + b _081D500E +_081D4FB6: + bl sub_800B320 + lsls r0, 24 + cmp r0, 0 + beq _081D500C + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _081D4FE6 + bl sub_800A23C + lsls r0, 24 + cmp r0, 0 + beq _081D4FE0 + movs r0, 0 + strb r0, [r4] + movs r0, 0x2 + b _081D500E + .pool +_081D4FE0: + movs r0, 0x4 + strb r0, [r4] + b _081D500C +_081D4FE6: + movs r0, 0x3 + strb r0, [r4] + b _081D500C +_081D4FEC: + movs r0, 0 + bl sub_800ABF4 + movs r0, 0x5 + strb r0, [r4] + b _081D500C +_081D4FF8: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _081D500C + strb r0, [r4] + movs r0, 0x4 + b _081D500E + .pool +_081D500C: + movs r0, 0 +_081D500E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81D4EE4 + + thumb_func_start sub_81D5014 +sub_81D5014: @ 81D5014 + push {r4,lr} + ldr r0, =sub_81D5084 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =0x03005e08 + adds r4, r0 + movs r0, 0 + strb r0, [r4, 0x8] + strb r0, [r4, 0x9] + strb r0, [r4, 0xA] + strb r0, [r4, 0xB] + strb r0, [r4, 0xC] + strb r0, [r4, 0xD] + movs r1, 0 + strh r0, [r4] + strh r0, [r4, 0x2] + strh r0, [r4, 0x4] + strh r0, [r4, 0x6] + strb r1, [r4, 0xE] + movs r0, 0x40 + bl AllocZeroed + str r0, [r4, 0x10] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D5014 + + thumb_func_start sub_81D505C +sub_81D505C: @ 81D505C + movs r1, 0 + strh r1, [r0] + bx lr + thumb_func_end sub_81D505C + + thumb_func_start sub_81D5064 +sub_81D5064: @ 81D5064 + push {lr} + adds r2, r0, 0 + lsls r1, 16 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + lsls r0, 16 + cmp r0, r1 + bhi _081D507A + movs r0, 0 + b _081D5080 +_081D507A: + movs r0, 0 + strh r0, [r2] + movs r0, 0x1 +_081D5080: + pop {r1} + bx r1 + thumb_func_end sub_81D5064 + + thumb_func_start sub_81D5084 +sub_81D5084: @ 81D5084 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + ldrb r0, [r4, 0x8] + cmp r0, 0x1A + bls _081D509C + b _081D548A +_081D509C: + lsls r0, 2 + ldr r1, =_081D50B0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081D50B0: + .4byte _081D511C + .4byte _081D5138 + .4byte _081D5148 + .4byte _081D515C + .4byte _081D516C + .4byte _081D5198 + .4byte _081D51D0 + .4byte _081D524C + .4byte _081D5268 + .4byte _081D5290 + .4byte _081D52AC + .4byte _081D52DC + .4byte _081D52F2 + .4byte _081D5308 + .4byte _081D536A + .4byte _081D5390 + .4byte _081D53A8 + .4byte _081D53C6 + .4byte _081D53F2 + .4byte _081D5418 + .4byte _081D5448 + .4byte _081D5454 + .4byte _081D5460 + .4byte _081D5430 + .4byte _081D548A + .4byte _081D548A + .4byte _081D5478 +_081D511C: + adds r0, r4, 0 + adds r0, 0x9 + ldr r1, =gUnknown_085EDFD6 + bl mevent_0814257C + cmp r0, 0 + bne _081D512C + b _081D548A +_081D512C: + movs r0, 0x1 + strb r0, [r4, 0x8] + b _081D548A + .pool +_081D5138: + bl sub_81D4E30 + adds r0, r4, 0 + bl sub_81D505C + movs r0, 0x2 + strb r0, [r4, 0x8] + b _081D548A +_081D5148: + adds r0, r4, 0 + movs r1, 0xA + bl sub_81D5064 + cmp r0, 0 + bne _081D5156 + b _081D548A +_081D5156: + movs r0, 0x3 + strb r0, [r4, 0x8] + b _081D548A +_081D515C: + bl sub_81D4EC0 + cmp r0, 0 + beq _081D5166 + b _081D52FC +_081D5166: + bl sub_80097E8 + b _081D525C +_081D516C: + adds r0, r4, 0 + adds r0, 0x9 + ldr r1, =gUnknown_085EDFF5 + bl mevent_0814257C + cmp r0, 0 + bne _081D517C + b _081D548A +_081D517C: + ldr r0, =gUnknown_085EE014 + bl sub_8018884 + adds r0, r4, 0 + bl sub_81D505C + movs r0, 0x5 + strb r0, [r4, 0x8] + b _081D548A + .pool +_081D5198: + adds r0, r4, 0 + movs r1, 0x5A + bl sub_81D5064 + cmp r0, 0 + beq _081D51AE + bl sub_81D4E30 + movs r0, 0x6 + strb r0, [r4, 0x8] + b _081D548A +_081D51AE: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _081D51BC + b _081D548A +_081D51BC: + adds r0, r4, 0 + bl sub_81D505C + movs r0, 0x5 + bl audio_play + b _081D535A + .pool +_081D51D0: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081D51F4 + movs r0, 0x5 + bl audio_play + bl sub_80097E8 + adds r0, r4, 0 + bl sub_81D505C + b _081D535A + .pool +_081D51F4: + bl sub_800ABAC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _081D5210 + adds r0, r4, 0 + bl sub_81D505C + bl sub_80097E8 + movs r0, 0x7 + strb r0, [r4, 0x8] + b _081D548A +_081D5210: + bl sub_81D4E60 + cmp r0, 0 + beq _081D522E + movs r0, 0x5 + bl audio_play + bl sub_80097E8 + adds r0, r4, 0 + bl sub_81D505C + movs r0, 0x8 + strb r0, [r4, 0x8] + b _081D548A +_081D522E: + adds r0, r4, 0 + movs r1, 0xA + bl sub_81D5064 + cmp r0, 0 + bne _081D523C + b _081D548A +_081D523C: + bl sub_80097E8 + bl sub_81D4E30 + adds r0, r4, 0 + bl sub_81D505C + b _081D548A +_081D524C: + adds r0, r4, 0 + adds r0, 0x9 + ldr r1, =gUnknown_085EE05C + bl mevent_0814257C + cmp r0, 0 + bne _081D525C + b _081D548A +_081D525C: + movs r0, 0x4 + strb r0, [r4, 0x8] + b _081D548A + .pool +_081D5268: + ldr r0, =gUnknown_085EE097 + bl sub_8018884 + ldr r0, =0x03006370 + ldr r1, =gUnknown_089A6550 + ldr r2, =gUnknown_089A3470 + subs r1, r2 + bl sub_81D4D50 + movs r0, 0x9 + strb r0, [r4, 0x8] + b _081D548A + .pool +_081D5290: + ldr r0, =0x03006370 + bl sub_81D4DE8 + strb r0, [r4, 0xE] + lsls r0, 24 + cmp r0, 0 + bne _081D52A0 + b _081D548A +_081D52A0: + movs r0, 0xA + strb r0, [r4, 0x8] + b _081D548A + .pool +_081D52AC: + ldr r0, =0x03006370 + bl sub_81D4DB8 + ldrb r0, [r4, 0xE] + cmp r0, 0x3 + bne _081D52BA + b _081D53C0 +_081D52BA: + cmp r0, 0x1 + beq _081D52C0 + b _081D546E +_081D52C0: + adds r0, r4, 0 + bl sub_81D505C + ldr r0, =gUnknown_085EE120 + bl sub_8018884 + movs r0, 0xB + strb r0, [r4, 0x8] + b _081D548A + .pool +_081D52DC: + movs r1, 0xD2 + lsls r1, 2 + adds r0, r4, 0 + bl sub_81D5064 + cmp r0, 0 + bne _081D52EC + b _081D548A +_081D52EC: + movs r0, 0xC + strb r0, [r4, 0x8] + b _081D548A +_081D52F2: + bl sub_81D4E30 + ldr r0, =gUnknown_085EE0DC + bl sub_8018884 +_081D52FC: + movs r0, 0xD + strb r0, [r4, 0x8] + b _081D548A + .pool +_081D5308: + adds r0, r4, 0 + adds r0, 0x9 + adds r1, r4, 0 + bl sub_81D4EE4 + cmp r0, 0x5 + bls _081D5318 + b _081D548A +_081D5318: + lsls r0, 2 + ldr r1, =_081D5328 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081D5328: + .4byte _081D548A + .4byte _081D5350 + .4byte _081D5340 + .4byte _081D5374 + .4byte _081D5374 + .4byte _081D5360 +_081D5340: + ldr r0, =gUnknown_085EE097 + bl sub_8018884 + movs r0, 0xE + strb r0, [r4, 0x8] + b _081D548A + .pool +_081D5350: + movs r0, 0x5 + bl audio_play + bl sub_80097E8 +_081D535A: + movs r0, 0x17 + strb r0, [r4, 0x8] + b _081D548A +_081D5360: + bl sub_80097E8 + movs r0, 0x15 + strb r0, [r4, 0x8] + b _081D548A +_081D536A: + bl sub_800B33C + lsls r0, 24 + cmp r0, 0 + beq _081D537A +_081D5374: + bl sub_80097E8 + b _081D53C0 +_081D537A: + bl sub_800A550 + lsls r0, 24 + cmp r0, 0 + bne _081D5386 + b _081D548A +_081D5386: + bl sub_800A5B4 + movs r0, 0xF + strb r0, [r4, 0x8] + b _081D548A +_081D5390: + ldr r0, =0x0201c000 + bl sub_81D3920 + strb r0, [r4, 0xE] + ldrb r0, [r4, 0xE] + bl sub_800ABF4 + movs r0, 0x10 + strb r0, [r4, 0x8] + b _081D548A + .pool +_081D53A8: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _081D548A + ldrb r0, [r4, 0xE] + cmp r0, 0x1 + bne _081D53C0 + movs r0, 0x11 + strb r0, [r4, 0x8] + b _081D548A + .pool +_081D53C0: + movs r0, 0x14 + strb r0, [r4, 0x8] + b _081D548A +_081D53C6: + ldr r0, =0x0201c000 + bl sub_81D3AB0 + cmp r0, 0 + beq _081D53EC + ldr r0, =gUnknown_085EE0FA + bl sub_8018884 + adds r0, r4, 0 + bl sub_81D505C + movs r0, 0x12 + strb r0, [r4, 0x8] + b _081D548A + .pool +_081D53EC: + movs r0, 0x16 + strb r0, [r4, 0x8] + b _081D548A +_081D53F2: + adds r0, r4, 0 + movs r1, 0x78 + bl sub_81D5064 + cmp r0, 0 + beq _081D548A + ldr r0, =gUnknown_085EE107 + bl sub_8018884 + movs r0, 0xB9 + lsls r0, 1 + bl fanfare_play + movs r0, 0x13 + strb r0, [r4, 0x8] + b _081D548A + .pool +_081D5418: + bl task_is_not_running_overworld_fanfare + lsls r0, 24 + cmp r0, 0 + beq _081D548A + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + b _081D543A + .pool +_081D5430: + adds r0, r4, 0 + adds r0, 0x9 + ldr r1, =gUnknown_085EE06B + bl mevent_0814257C +_081D543A: + cmp r0, 0 + beq _081D548A + movs r0, 0x1A + strb r0, [r4, 0x8] + b _081D548A + .pool +_081D5448: + adds r0, r4, 0 + adds r0, 0x9 + ldr r1, =gUnknown_085EE0A3 + b _081D5466 + .pool +_081D5454: + adds r0, r4, 0 + adds r0, 0x9 + ldr r1, =gUnknown_085EE0BF + b _081D5466 + .pool +_081D5460: + adds r0, r4, 0 + adds r0, 0x9 + ldr r1, =gUnknown_085EE12D +_081D5466: + bl mevent_0814257C + cmp r0, 0 + beq _081D548A +_081D546E: + movs r0, 0 + strb r0, [r4, 0x8] + b _081D548A + .pool +_081D5478: + ldr r0, [r4, 0x10] + bl Free + adds r0, r5, 0 + bl remove_task + ldr r0, =sub_80186A4 + bl SetMainCallback2 +_081D548A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D5084 + + thumb_func_start sp194_trainer_tower +sp194_trainer_tower: @ 81D5494 + push {lr} + bl sub_81D56B0 + ldr r1, =gUnknown_0862A618 + ldr r0, =0x020375e0 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + bl sub_81D5710 + pop {r0} + bx r0 + .pool + thumb_func_end sp194_trainer_tower + + thumb_func_start sub_81D54BC +sub_81D54BC: @ 81D54BC + push {r4-r6,lr} + ldr r4, =0x03005d90 + ldr r1, [r4] + ldr r3, =0x00000ef9 + adds r1, r3 + ldrb r2, [r1] + movs r0, 0x7F + ands r0, r2 + strb r0, [r1] + ldr r1, [r4] + adds r1, r3 + ldrb r2, [r1] + movs r0, 0x80 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r2, =0x03005d8c + ldr r0, [r2] + ldr r1, =0x00003d68 + adds r0, r1 + movs r1, 0 + str r1, [r0] + adds r6, r2, 0 + ldr r5, =0x00003718 + movs r4, 0x3 +_081D54EE: + ldr r0, [r6] + adds r0, r5 + ldr r1, =0x00034bbf + bl sub_81D5DF4 + adds r5, 0x4 + subs r4, 0x1 + cmp r4, 0 + bge _081D54EE + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D54BC + + thumb_func_start sub_81D5520 +sub_81D5520: @ 81D5520 + ldr r0, =0x02037318 + ldrb r0, [r0, 0x12] + adds r0, 0x61 + lsls r0, 24 + lsrs r0, 24 + bx lr + .pool + thumb_func_end sub_81D5520 + + thumb_func_start sub_81D5530 +sub_81D5530: @ 81D5530 + lsls r0, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + ldr r2, =gTrainerClassNameIndices + ldr r1, =0x0203cf58 + ldr r1, [r1] + adds r1, 0x16 + adds r1, r0 + ldrb r0, [r1] + adds r0, r2 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_81D5530 + + thumb_func_start sub_81D5554 +sub_81D5554: @ 81D5554 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 24 + movs r0, 0xFF + lsls r0, 24 + adds r1, r0 + lsrs r1, 24 + movs r3, 0 + ldr r0, =0x0203cf58 + ldr r2, [r0] + movs r0, 0xB + muls r0, r1 + adds r2, r0, r2 +_081D556E: + adds r1, r4, r3 + ldrb r0, [r2] + strb r0, [r1] + adds r2, 0x1 + adds r3, 0x1 + cmp r3, 0xA + ble _081D556E + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D5554 + + thumb_func_start sub_81D5588 +sub_81D5588: @ 81D5588 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl sub_81D56B0 + subs r4, 0x1 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x0203cf54 + ldr r3, [r0] + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r4 + ldrb r2, [r3] + lsls r0, r2, 4 + subs r0, r2 + lsls r0, 3 + subs r0, r2 + adds r0, r1 + lsls r0, 3 + adds r3, r0 + ldrb r4, [r3, 0x1B] + bl sub_81D5710 + ldr r0, =gTrainerPicIndices + adds r4, r0 + ldrb r0, [r4] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D5588 + + thumb_func_start sub_81D55D0 +sub_81D55D0: @ 81D55D0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + bl sub_81D56B0 + ldr r4, =0x0203cf58 + movs r0, 0x18 + bl AllocZeroed + str r0, [r4] + movs r6, 0 + ldr r0, =0x0203cf54 + mov r10, r0 +_081D55EE: + movs r5, 0 + lsls r1, r6, 2 + mov r8, r1 + adds r0, r6, 0x1 + mov r9, r0 + movs r0, 0xB + adds r1, r6, 0 + muls r1, r0 + mov r12, r1 + mov r1, r8 + adds r0, r1, r6 + lsls r0, 3 + adds r0, r6 + lsls r7, r0, 3 +_081D560A: + ldr r0, =0x0203cf58 + ldr r4, [r0] + mov r1, r12 + adds r0, r5, r1 + adds r4, r0 + mov r0, r10 + ldr r2, [r0] + adds r3, r5, r7 + ldrb r1, [r2] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 3 + subs r0, r1 + lsls r0, 3 + adds r3, r0 + adds r2, 0x10 + adds r2, r3 + ldrb r0, [r2] + strb r0, [r4] + adds r5, 0x1 + cmp r5, 0xA + ble _081D560A + ldr r1, =0x0203cf58 + ldr r4, [r1] + adds r4, 0x16 + adds r4, r6 + mov r0, r10 + ldr r3, [r0] + mov r1, r8 + adds r2, r1, r6 + lsls r2, 3 + adds r2, r6 + ldrb r1, [r3] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 3 + subs r0, r1 + adds r0, r2 + lsls r0, 3 + adds r3, r0 + ldrb r0, [r3, 0x1B] + strb r0, [r4] + mov r6, r9 + cmp r6, 0x1 + ble _081D55EE + ldr r1, =0x03005d8c + ldr r0, [r1] + ldr r1, =0x00003d64 + adds r0, r1 + bl sub_80008DC + bl sub_81D5710 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D55D0 + + thumb_func_start sub_81D5694 +sub_81D5694: @ 81D5694 + push {r4,lr} + ldr r4, =0x0203cf58 + ldr r0, [r4] + cmp r0, 0 + beq _081D56A6 + bl Free + movs r0, 0 + str r0, [r4] +_081D56A6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D5694 + + thumb_func_start sub_81D56B0 +sub_81D56B0: @ 81D56B0 + push {r4,lr} + ldr r4, =0x0203cf54 + ldr r0, [r4] + cmp r0, 0 + bne _081D56EC + ldr r0, =0x00000eec + bl AllocZeroed + str r0, [r4] + ldr r1, =0x02037318 + ldrb r1, [r1, 0x12] + adds r1, 0x61 + strb r1, [r0] + ldr r1, =gUnknown_0862A5F8 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x00003d6e + adds r0, r2 + ldrb r0, [r0] + lsrs r0, 6 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, [r4] + adds r1, 0x4 + ldr r2, =0x040003ba + bl CpuSet + bl nullsub_2 +_081D56EC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D56B0 + + thumb_func_start sub_81D5710 +sub_81D5710: @ 81D5710 + push {r4,lr} + ldr r4, =0x0203cf54 + ldr r0, [r4] + cmp r0, 0 + beq _081D5722 + bl Free + movs r0, 0 + str r0, [r4] +_081D5722: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D5710 + + thumb_func_start sub_81D572C +sub_81D572C: @ 81D572C + push {r4-r6,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + lsls r4, 16 + lsrs r4, 16 + bl sub_81D56B0 + bl sub_81D5520 + lsls r0, 24 + lsrs r2, r0, 24 + subs r4, 0x1 + lsls r4, 24 + lsrs r4, 24 + cmp r5, 0x3 + beq _081D5790 + cmp r5, 0x3 + bgt _081D575A + cmp r5, 0x2 + beq _081D5764 + b _081D580E +_081D575A: + cmp r6, 0x4 + beq _081D57BC + cmp r6, 0x5 + beq _081D57E8 + b _081D580E +_081D5764: + ldr r0, =0x0203cf54 + lsls r1, r2, 4 + subs r1, r2 + lsls r1, 3 + subs r1, r2 + lsls r1, 3 + adds r1, 0xC + ldr r0, [r0] + adds r0, r1 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r4 + lsls r1, 3 + adds r1, 0x4 + adds r0, r1 + adds r0, 0x10 + bl ConvertBattleFrontierTrainerSpeechToString + b _081D580E + .pool +_081D5790: + ldr r0, =0x0203cf54 + lsls r1, r2, 4 + subs r1, r2 + lsls r1, 3 + subs r1, r2 + lsls r1, 3 + adds r1, 0xC + ldr r0, [r0] + adds r0, r1 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r4 + lsls r1, 3 + adds r1, 0x4 + adds r0, r1 + adds r0, 0x1C + bl ConvertBattleFrontierTrainerSpeechToString + b _081D580E + .pool +_081D57BC: + ldr r0, =0x0203cf54 + lsls r1, r2, 4 + subs r1, r2 + lsls r1, 3 + subs r1, r2 + lsls r1, 3 + adds r1, 0xC + ldr r0, [r0] + adds r0, r1 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r4 + lsls r1, 3 + adds r1, 0x4 + adds r0, r1 + adds r0, 0x28 + bl ConvertBattleFrontierTrainerSpeechToString + b _081D580E + .pool +_081D57E8: + ldr r0, =0x0203cf54 + lsls r1, r2, 4 + subs r1, r2 + lsls r1, 3 + subs r1, r2 + lsls r1, 3 + adds r1, 0xC + ldr r0, [r0] + adds r0, r1 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r4 + lsls r1, 3 + adds r1, 0x4 + adds r0, r1 + adds r0, 0x34 + bl ConvertBattleFrontierTrainerSpeechToString +_081D580E: + bl sub_81D5710 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D572C + + thumb_func_start sub_81D581C +sub_81D581C: @ 81D581C + push {r4-r6,lr} + bl nullsub_2 + bl sub_81D3B34 + cmp r0, 0 + bne _081D5844 + ldr r3, =0x03005d8c + ldr r1, [r3] + ldr r0, =0x00003d6e + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x20 + orrs r0, r2 + b _081D5854 + .pool +_081D5844: + ldr r3, =0x03005d8c + ldr r1, [r3] + ldr r0, =0x00003d6e + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x21 + negs r0, r0 + ands r0, r2 +_081D5854: + strb r0, [r1] + adds r6, r3, 0 + ldr r0, [r6] + ldr r1, =0x00003d6c + adds r0, r1 + movs r5, 0 + strb r5, [r0] + ldr r0, [r6] + ldr r4, =0x00003d64 + adds r0, r4 + bl sub_80008DC + ldr r1, [r6] + adds r4, r1, r4 + str r5, [r4] + ldr r3, =0x00003d6e + adds r1, r3 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r6] + adds r1, r3 + ldrb r2, [r1] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r6] + adds r1, r3 + ldrb r2, [r1] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r0, =0x03005d90 + ldr r0, [r0] + movs r1, 0xEE + lsls r1, 4 + adds r0, r1 + strb r5, [r0] + ldr r0, =0x0202433a + strb r5, [r0] + ldr r1, [r6] + adds r1, r3 + ldrb r2, [r1] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D581C + + thumb_func_start sub_81D58D8 +sub_81D58D8: @ 81D58D8 + push {lr} + bl sub_80008E8 + ldr r3, =0x020375f0 + movs r0, 0 + strh r0, [r3] + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003d6e + adds r2, r0, r1 + ldrb r1, [r2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _081D58FA + movs r0, 0x1 + strh r0, [r3] +_081D58FA: + ldrb r1, [r2] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x3 + bne _081D590A + ldrh r0, [r3] + adds r0, 0x1 + strh r0, [r3] +_081D590A: + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D58D8 + + thumb_func_start sub_81D5924 +sub_81D5924: @ 81D5924 + push {r4-r7,lr} + mov r7, r8 + push {r7} + bl sub_81D6640 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, =0x0203cf54 + ldr r0, [r0] + ldrb r0, [r0, 0x6] + cmp r0, 0x4 + bne _081D5952 + ldr r0, =0x03005d8c + mov r8, r0 + ldr r0, [r0] + ldr r7, =0x00003d6e + adds r0, r7 + ldrb r0, [r0] + movs r6, 0x1 + adds r4, r6, 0 + ands r4, r0 + cmp r4, 0 + beq _081D596C +_081D5952: + ldr r1, =0x020375f0 + movs r0, 0x2 + strh r0, [r1] + b _081D59C0 + .pool +_081D596C: + adds r0, r5, 0 + movs r1, 0x1 + bl bag_add_item + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081D59BC + ldr r1, =0x02021dc4 + adds r0, r5, 0 + bl itemid_get_name + mov r0, r8 + ldr r1, [r0] + adds r1, r7 + ldrb r0, [r1] + movs r2, 0x1 + orrs r0, r2 + strb r0, [r1] + ldr r0, =0x03005d90 + ldr r1, [r0] + ldr r0, =0x00000ef9 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x80 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r0, =0x020375f0 + strh r4, [r0] + b _081D59C0 + .pool +_081D59BC: + ldr r0, =0x020375f0 + strh r6, [r0] +_081D59C0: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D5924 + + thumb_func_start sub_81D59D0 +sub_81D59D0: @ 81D59D0 + push {r4-r6,lr} + ldr r4, =0x03005d8c + ldr r2, [r4] + ldr r6, =0x00003d6e + adds r0, r2, r6 + ldrb r1, [r0] + movs r3, 0x2 + adds r0, r3, 0 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + beq _081D59FC + ldr r0, =0x020375f0 + strh r3, [r0] + b _081D5A4E + .pool +_081D59FC: + ldr r1, =0x00003d68 + adds r0, r2, r1 + bl free_203F458 + ldr r2, [r4] + ldr r3, =0x00003d64 + adds r1, r2, r3 + ldr r1, [r1] + cmp r0, r1 + bls _081D5A48 + adds r3, 0x4 + adds r0, r2, r3 + bl sub_81D5DF4 + ldr r2, [r4] + adds r0, r2, r6 + ldrb r0, [r0] + lsrs r0, 6 + lsls r0, 2 + ldr r3, =0x00003718 + adds r1, r2, r3 + adds r1, r0 + ldr r0, =0x00003d68 + adds r2, r0 + ldr r0, [r2] + str r0, [r1] + ldr r0, =0x020375f0 + strh r5, [r0] + b _081D5A4E + .pool +_081D5A48: + ldr r1, =0x020375f0 + movs r0, 0x1 + strh r0, [r1] +_081D5A4E: + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r3, =0x00003d6e + adds r1, r3 + ldrb r0, [r1] + movs r2, 0x2 + orrs r0, r2 + strb r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D59D0 + + thumb_func_start sub_81D5A70 +sub_81D5A70: @ 81D5A70 + push {lr} + ldr r0, =0x03005d8c + ldr r2, [r0] + ldr r1, =0x00003d6e + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _081D5AAE + ldr r0, =0x00003d64 + adds r2, r0 + ldr r1, [r2] + ldr r0, =0x00034bbe + cmp r1, r0 + bls _081D5AA8 + adds r0, 0x1 + str r0, [r2] + b _081D5AAE + .pool +_081D5AA8: + adds r0, r2, 0 + bl sub_80008DC +_081D5AAE: + pop {r0} + bx r0 + thumb_func_end sub_81D5A70 + + thumb_func_start sub_81D5AB4 +sub_81D5AB4: @ 81D5AB4 + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r0, =0x00003d6e + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x8 + orrs r0, r2 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_81D5AB4 + + thumb_func_start sub_81D5AD0 +sub_81D5AD0: @ 81D5AD0 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003d6e + adds r2, r0, r1 + ldrb r1, [r2] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _081D5B00 + movs r0, 0x9 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r1, =0x020375f0 + movs r0, 0 + b _081D5B20 + .pool +_081D5B00: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _081D5B1C + movs r0, 0x11 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r1, =0x020375f0 + movs r0, 0x1 + b _081D5B20 + .pool +_081D5B1C: + ldr r1, =0x020375f0 + movs r0, 0x2 +_081D5B20: + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D5AD0 + + thumb_func_start sub_81D5B2C +sub_81D5B2C: @ 81D5B2C + push {r4-r7,lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003d64 + adds r0, r1 + ldr r7, [r0] + ldr r0, =0x00034bbe + cmp r7, r0 + ble _081D5B40 + ldr r7, =0x00034bbf +_081D5B40: + movs r4, 0xE1 + lsls r4, 4 + adds r0, r7, 0 + adds r1, r4, 0 + bl __divsi3 + adds r6, r0, 0 + adds r0, r7, 0 + adds r1, r4, 0 + bl __modsi3 + adds r7, r0, 0 + movs r1, 0x3C + bl __divsi3 + adds r5, r0, 0 + adds r0, r7, 0 + movs r1, 0x3C + bl __modsi3 + adds r7, r0, 0 + movs r0, 0xA8 + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + adds r4, r0, 0 + ldr r0, =0x02021cc4 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r0, =0x02021dc4 + adds r1, r5, 0 + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r0, =0x02021ec4 + adds r1, r4, 0 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalString + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D5B2C + + thumb_func_start sub_81D5BBC +sub_81D5BBC: @ 81D5BBC + push {lr} + bl sub_81D56B0 + ldr r0, =0x0203cf54 + ldr r1, [r0] + ldrb r0, [r1, 0x6] + cmp r0, 0x4 + beq _081D5BEC + ldr r0, =0x02021cc4 + ldrb r1, [r1, 0x6] + movs r2, 0 + movs r3, 0x1 + bl ConvertIntToDecimalString + ldr r1, =0x020375f0 + movs r0, 0 + b _081D5BF0 + .pool +_081D5BEC: + ldr r1, =0x020375f0 + movs r0, 0x1 +_081D5BF0: + strh r0, [r1] + bl sub_81D5710 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D5BBC + + thumb_func_start sub_81D5C00 +sub_81D5C00: @ 81D5C00 + push {lr} + bl sub_81D56B0 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + bl sub_81D5710 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D5C00 + + thumb_func_start sub_81D5C18 +sub_81D5C18: @ 81D5C18 + push {lr} + ldr r0, =0x000040d6 + bl VarGet + lsls r0, 16 + cmp r0, 0 + beq _081D5C42 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003d6e + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _081D5C42 + bl GetCurrentTrainerHillMapId + lsls r0, 24 + cmp r0, 0 + bne _081D5C54 +_081D5C42: + movs r0, 0 + b _081D5C56 + .pool +_081D5C54: + movs r0, 0x1 +_081D5C56: + pop {r1} + bx r1 + thumb_func_end sub_81D5C18 + + thumb_func_start sub_81D5C5C +sub_81D5C5C: @ 81D5C5C + push {lr} + bl sub_81D5C18 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _081D5C74 + ldr r0, =0x020375f0 + strh r1, [r0] + b _081D5C7A + .pool +_081D5C74: + ldr r1, =0x020375f0 + movs r0, 0x1 + strh r0, [r1] +_081D5C7A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D5C5C + + thumb_func_start nullsub_129 +nullsub_129: @ 81D5C84 + bx lr + thumb_func_end nullsub_129 + + thumb_func_start nullsub_2 +nullsub_2: @ 81D5C88 + bx lr + thumb_func_end nullsub_2 + + thumb_func_start sub_81D5C8C +sub_81D5C8C: @ 81D5C8C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + bl sub_81D56B0 + movs r0, 0 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r5, =gUnknown_085EF88A + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0xD0 + bl GetStringCenterAlignXOffset + lsls r2, r0, 24 + lsrs r2, 24 + ldr r6, =gUnknown_0862A5F4 + str r6, [sp] + movs r4, 0x1 + negs r4, r4 + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r3, 0x2 + bl box_print + movs r7, 0x12 + movs r0, 0 + mov r8, r0 + mov r10, r4 + ldr r1, =0x02021fc4 + mov r9, r1 +_081D5CD6: + lsls r3, r7, 24 + lsrs r3, 24 + ldr r0, =gUnknown_0862A5F4 + str r0, [sp] + mov r1, r10 + str r1, [sp, 0x4] + ldr r0, =gUnknown_0862A660 + mov r1, r8 + lsls r4, r1, 2 + adds r0, r4, r0 + ldr r0, [r0] + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r2, 0 + bl box_print + adds r7, 0xF + ldr r0, =0x03005d8c + ldr r1, =0x00003718 + adds r4, r1 + ldr r0, [r0] + adds r0, r4 + bl free_203F458 + adds r4, r0, 0 + movs r5, 0xE1 + lsls r5, 4 + adds r1, r5, 0 + bl __udivsi3 + adds r6, r0, 0 + adds r0, r4, 0 + adds r1, r5, 0 + bl __umodsi3 + adds r5, r0, 0 + ldr r0, =0x02021cc4 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalString + adds r0, r5, 0 + movs r1, 0x3C + bl __udivsi3 + adds r4, r0, 0 + adds r0, r5, 0 + movs r1, 0x3C + bl __umodsi3 + adds r5, r0, 0 + ldr r0, =0x02021dc4 + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalString + movs r0, 0xA8 + muls r0, r5 + movs r1, 0x64 + bl __udivsi3 + adds r1, r0, 0 + ldr r0, =0x02021ec4 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalString + mov r0, r9 + ldr r1, =gUnknown_085EF895 + bl CopyString + ldr r1, =gUnknown_085EF8A3 + bl ExpandStringRefs + movs r0, 0x1 + mov r1, r9 + movs r2, 0xD0 + bl GetStringRightAlignXOffset + lsls r2, r0, 24 + lsrs r2, 24 + lsls r3, r7, 24 + lsrs r3, 24 + ldr r0, =gUnknown_0862A5F4 + str r0, [sp] + mov r1, r10 + str r1, [sp, 0x4] + mov r0, r9 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + bl box_print + adds r7, 0x11 + movs r1, 0x1 + add r8, r1 + mov r0, r8 + cmp r0, 0x3 + ble _081D5CD6 + movs r0, 0 + bl PutWindowTilemap + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + bl sub_81D5710 + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D5C8C + + thumb_func_start free_203F458 +free_203F458: @ 81D5DF0 + ldr r0, [r0] + bx lr + thumb_func_end free_203F458 + + thumb_func_start sub_81D5DF4 +sub_81D5DF4: @ 81D5DF4 + str r1, [r0] + bx lr + thumb_func_end sub_81D5DF4 + + thumb_func_start sub_81D5DF8 +sub_81D5DF8: @ 81D5DF8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r1, 0xC7 + lsls r1, 4 + adds r1, r0, r1 + str r1, [sp, 0x4] + bl sub_81D5F48 + cmp r0, 0 + beq _081D5F0E + bl sub_81D56B0 + movs r7, 0 + ldr r4, =0x03005d90 + ldr r3, =0x00000cb4 + ldr r0, =0x0000ffff + adds r2, r0, 0 +_081D5E26: + ldr r1, [r4] + lsls r0, r7, 1 + adds r1, r3 + adds r1, r0 + ldrh r0, [r1] + orrs r0, r2 + strh r0, [r1] + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x1 + bls _081D5E26 + movs r0, 0 + str r0, [sp] + ldr r0, =0x03005d8c + ldr r1, [r0] + movs r2, 0xC7 + lsls r2, 4 + adds r1, r2 + ldr r2, =0x05000180 + mov r0, sp + bl CpuSet + bl sub_81D5520 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r7, 0 + ldr r3, =0x0203cf54 + mov r10, r3 +_081D5E64: + lsls r4, r7, 1 + mov r8, r4 + adds r5, r4, r7 + lsls r5, 3 + ldr r0, [sp, 0x4] + adds r5, r0 + adds r1, r5, 0 + ldr r0, =gUnknown_0862A670 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + adds r6, r7, 0x1 + strb r6, [r5] + mov r0, r10 + ldr r1, [r0] + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r7 + lsls r0, 3 + mov r2, r9 + lsls r4, r2, 4 + subs r4, r2 + lsls r4, 3 + subs r4, r2 + lsls r4, 3 + adds r0, r4 + adds r1, r0 + ldrb r0, [r1, 0x1B] + bl sub_81660B8 + strb r0, [r5, 0x1] + mov r0, r10 + ldr r3, [r0] + adds r0, r7, r4 + movs r2, 0xF0 + lsls r2, 2 + adds r1, r3, r2 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0xF + ands r0, r2 + strh r0, [r5, 0x4] + ldrb r0, [r1] + lsrs r0, 4 + movs r1, 0xF + ands r0, r1 + adds r0, 0x5 + strh r0, [r5, 0x6] + lsls r1, r7, 26 + lsrs r1, 24 + adds r3, r4 + ldr r2, =0x000003c2 + adds r3, r2 + ldrb r0, [r3] + asrs r0, r1 + movs r3, 0xF + ands r0, r3 + adds r0, 0x7 + strb r0, [r5, 0x9] + mov r2, r10 + ldr r0, [r2] + adds r0, r4 + ldr r3, =0x000003c3 + adds r0, r3 + ldrb r0, [r0] + asrs r0, r1 + movs r1, 0xF + ands r0, r1 + strh r0, [r5, 0xE] + ldr r0, =gUnknown_082C83F0 + str r0, [r5, 0x10] + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r4, =0x00000cb4 + adds r0, r4 + add r0, r8 + strh r6, [r0] + lsls r6, 24 + lsrs r7, r6, 24 + cmp r7, 0x1 + bls _081D5E64 + bl sub_81D5710 +_081D5F0E: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D5DF8 + + thumb_func_start sub_81D5F48 +sub_81D5F48: @ 81D5F48 + push {lr} + bl sub_81D56B0 + bl sub_81D5710 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_81D5F48 + + thumb_func_start sub_81D5F58 +sub_81D5F58: @ 81D5F58 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x0203cf54 + ldr r4, [r4] + mov r12, r4 + lsls r4, r2, 1 + lsls r5, r0, 4 + subs r5, r0 + lsls r5, 3 + subs r5, r0 + lsls r5, 3 + adds r4, r5 + movs r0, 0xE8 + lsls r0, 2 + add r0, r12 + adds r0, r4 + ldrh r0, [r0] + movs r4, 0xF + subs r4, r1 + asrs r0, r4 + movs r4, 0x1 + ands r0, r4 + muls r2, r3 + adds r2, r1 + adds r2, r5 + movs r1, 0xA8 + lsls r1, 2 + add r1, r12 + adds r1, r2 + ldrb r1, [r1] + movs r2, 0x80 + lsls r2, 2 + adds r3, r2, 0 + movs r2, 0xC0 + lsls r2, 6 + lsls r0, 10 + orrs r0, r2 + orrs r1, r3 + orrs r0, r1 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D5F58 + + thumb_func_start sub_81D5FB4 +sub_81D5FB4: @ 81D5FB4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r4, r0, 0 + bl GetCurrentTrainerHillMapId + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + cmp r0, 0x6 + bne _081D5FD2 + bl sub_8087D74 + b _081D605E +_081D5FD2: + bl sub_81D56B0 + mov r0, r9 + cmp r0, 0x5 + bne _081D5FE6 + bl sub_8087D74 + bl sub_81D5710 + b _081D605E +_081D5FE6: + bl sub_81D5520 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r0, =0x02037318 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r1, =0x03005dc0 + str r4, [r1, 0x8] + movs r0, 0x1F + str r0, [r1] + movs r0, 0x23 + str r0, [r1, 0x4] + movs r0, 0xE0 + lsls r0, 1 + adds r3, r4, r0 + movs r6, 0x4 +_081D600A: + adds r4, r2, 0 + adds r4, 0x20 + adds r1, r3, 0 + movs r5, 0xF +_081D6012: + ldrh r0, [r2] + strh r0, [r1] + adds r2, 0x2 + adds r1, 0x2 + subs r5, 0x1 + cmp r5, 0 + bge _081D6012 + adds r3, 0x3E + adds r2, r4, 0 + subs r6, 0x1 + cmp r6, 0 + bge _081D600A + movs r6, 0 +_081D602C: + movs r5, 0 + adds r7, r3, 0 + adds r7, 0x3E + adds r0, r6, 0x1 + mov r8, r0 + adds r4, r3, 0 +_081D6038: + mov r0, r9 + adds r1, r5, 0 + adds r2, r6, 0 + movs r3, 0x10 + bl sub_81D5F58 + strh r0, [r4] + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0xF + ble _081D6038 + adds r3, r7, 0 + mov r6, r8 + cmp r6, 0xF + ble _081D602C + bl mapheader_run_script_with_tag_x1 + bl sub_81D5710 +_081D605E: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D5FB4 + + thumb_func_start InTrainerHill +InTrainerHill: @ 81D6074 + push {lr} + ldr r1, =0x02037318 + ldr r2, =0xfffffe61 + adds r0, r2, 0 + ldrh r1, [r1, 0x12] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + cmp r0, 0x3 + bhi _081D608C + movs r1, 0x1 +_081D608C: + adds r0, r1, 0 + pop {r1} + bx r1 + .pool + thumb_func_end InTrainerHill + + thumb_func_start GetCurrentTrainerHillMapId +@ u8 GetCurrentTrainerHillMapId() +GetCurrentTrainerHillMapId: @ 81D609C + push {lr} + ldr r0, =0x02037318 + ldrh r2, [r0, 0x12] + ldr r0, =0x0000019f + cmp r2, r0 + bne _081D60B4 + movs r1, 0x1 + b _081D60F8 + .pool +_081D60B4: + movs r0, 0xD0 + lsls r0, 1 + cmp r2, r0 + bne _081D60C0 + movs r1, 0x2 + b _081D60F8 +_081D60C0: + ldr r0, =0x000001a1 + cmp r2, r0 + bne _081D60D0 + movs r1, 0x3 + b _081D60F8 + .pool +_081D60D0: + movs r0, 0xD1 + lsls r0, 1 + cmp r2, r0 + bne _081D60DC + movs r1, 0x4 + b _081D60F8 +_081D60DC: + ldr r0, =0x000001a3 + cmp r2, r0 + bne _081D60EC + movs r1, 0x5 + b _081D60F8 + .pool +_081D60EC: + movs r0, 0xCF + lsls r0, 1 + movs r1, 0 + cmp r2, r0 + bne _081D60F8 + movs r1, 0x6 +_081D60F8: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end GetCurrentTrainerHillMapId + + thumb_func_start sub_81D6100 +sub_81D6100: @ 81D6100 + push {lr} + ldr r0, =0x02037318 + ldrh r1, [r0, 0x12] + ldr r0, =0x000001a3 + movs r2, 0 + cmp r1, r0 + bne _081D6110 + movs r2, 0x1 +_081D6110: + adds r0, r2, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D6100 + + thumb_func_start sub_81D6120 +sub_81D6120: @ 81D6120 + push {lr} + movs r0, 0x1A + movs r1, 0x40 + bl get_mapheader_by_bank_and_number + ldr r0, [r0, 0x4] + ldr r0, [r0, 0x8] + adds r0, 0x8 + pop {r1} + bx r1 + thumb_func_end sub_81D6120 + + thumb_func_start sub_81D6134 +sub_81D6134: @ 81D6134 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081D614C + ldr r0, =0x02037318 + ldr r0, [r0, 0x4] + ldr r0, [r0, 0x8] + adds r0, 0x8 + b _081D6176 + .pool +_081D614C: + bl sub_81D6490 + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x3 + bls _081D6162 + movs r2, 0x4 +_081D6162: + ldr r1, =gUnknown_0862A688 + subs r0, r2, 0x1 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x1A + bl get_mapheader_by_bank_and_number + ldr r0, [r0, 0x4] + ldr r0, [r0, 0x8] +_081D6176: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D6134 + + thumb_func_start battle_init +battle_init: @ 81D6180 + lsls r0, 24 + ldr r1, =0x03005d90 + ldr r1, [r1] + lsrs r0, 23 + adds r1, r0 + ldr r0, =0x00000cb2 + adds r1, r0 + ldrh r0, [r1] + bx lr + .pool + thumb_func_end battle_init + + thumb_func_start GetTrainerHillTrainerFlag +@ u8 GetTrainerHillTrainerFlag(u8 fieldObjectId) +GetTrainerHillTrainerFlag: @ 81D619C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_81D5520 + lsls r0, 24 + lsrs r0, 23 + ldr r2, =0x02037350 + lsls r1, r4, 3 + adds r1, r4 + lsls r1, 2 + adds r1, r2 + adds r0, 0xFF + ldrb r1, [r1, 0x8] + adds r0, r1 + lsls r0, 24 + ldr r1, =0x03005d90 + ldr r1, [r1] + movs r2, 0xEE + lsls r2, 4 + adds r1, r2 + ldr r2, =gUnknown_0832A328 + lsrs r0, 22 + adds r0, r2 + ldr r0, [r0] + ldrb r1, [r1] + ands r0, r1 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end GetTrainerHillTrainerFlag + + thumb_func_start sub_81D61E8 +sub_81D61E8: @ 81D61E8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + bl sub_81D5520 + lsls r0, 25 + lsrs r4, r0, 24 + movs r3, 0 + ldr r0, =0x02038bca + mov r8, r0 + ldr r6, =0x03005d90 + ldr r1, =gUnknown_0832A328 + mov r12, r1 + adds r5, r6, 0 +_081D6204: + ldr r2, [r5] + lsls r0, r3, 1 + ldr r7, =0x00000cb4 + adds r1, r2, r7 + adds r1, r0 + ldrh r0, [r1] + mov r1, r8 + ldrh r1, [r1] + cmp r0, r1 + bne _081D6240 + movs r7, 0xEE + lsls r7, 4 + adds r2, r7 + adds r0, r4, r3 + lsls r0, 2 + add r0, r12 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + b _081D624A + .pool +_081D6240: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x1 + bls _081D6204 +_081D624A: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _081D62A2 + movs r3, 0 + ldr r5, =0x02038bcc + ldr r0, =gUnknown_0832A328 + mov r8, r0 +_081D6260: + ldr r2, [r6] + lsls r0, r3, 1 + ldr r7, =0x00000cb4 + adds r1, r2, r7 + adds r1, r0 + ldrh r0, [r1] + ldrh r1, [r5] + cmp r0, r1 + bne _081D6298 + movs r7, 0xEE + lsls r7, 4 + adds r2, r7 + adds r0, r4, r3 + lsls r0, 2 + add r0, r8 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + b _081D62A2 + .pool +_081D6298: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x1 + bls _081D6260 +_081D62A2: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81D61E8 + + thumb_func_start sub_81D62AC +sub_81D62AC: @ 81D62AC + ldr r0, =gUnknown_082C83F0 + bx lr + .pool + thumb_func_end sub_81D62AC + + thumb_func_start sub_81D62B4 +sub_81D62B4: @ 81D62B4 + push {lr} + ldr r0, =0x020375f2 + ldrh r1, [r0] + movs r0, 0x5 + bl sub_81D572C + bl sub_80982B8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D62B4 + + thumb_func_start sub_81D62CC +sub_81D62CC: @ 81D62CC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + subs r1, r0, 0x1 + lsls r0, r1, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _081D636A + lsls r0, r1, 24 + lsrs r6, r0, 24 + bl sub_81D56B0 + bl sub_8165CB4 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + bl sub_81D5520 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + mov r5, r9 + adds r0, r5, 0x3 + cmp r5, r0 + bge _081D6366 + ldr r1, =gUnknown_0862A698 + lsls r0, r6, 1 + adds r0, r6 + adds r7, r0, r1 +_081D6316: + ldrb r2, [r7] + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + mov r1, r8 + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 3 + subs r0, r1 + lsls r0, 3 + adds r0, 0xC + ldr r3, =0x0203cf54 + ldr r1, [r3] + adds r1, r0 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r6 + lsls r0, 3 + adds r0, 0x4 + adds r1, r0 + movs r0, 0x2C + muls r0, r2 + adds r0, 0x40 + adds r1, r0 + adds r0, r4, 0 + bl sub_806819C + adds r0, r4, 0 + mov r1, r10 + bl sub_81D642C + adds r5, 0x1 + adds r7, 0x1 + mov r0, r9 + adds r0, 0x3 + cmp r5, r0 + blt _081D6316 +_081D6366: + bl sub_81D5710 +_081D636A: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D62CC + + thumb_func_start sub_81D6384 +sub_81D6384: @ 81D6384 + push {lr} + bl zero_enemy_party_data + ldr r0, =0x02038bca + ldrh r0, [r0] + movs r1, 0 + bl sub_81D62CC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D6384 + + thumb_func_start sub_81D639C +sub_81D639C: @ 81D639C + push {lr} + bl zero_enemy_party_data + ldr r0, =0x02038bca + ldrh r0, [r0] + movs r1, 0 + bl sub_81D62CC + ldr r0, =0x02038bcc + ldrh r0, [r0] + movs r1, 0x3 + bl sub_81D62CC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D639C + + thumb_func_start sub_81D63C4 +sub_81D63C4: @ 81D63C4 + movs r0, 0x7 + bx lr + thumb_func_end sub_81D63C4 + + thumb_func_start sub_81D63C8 +sub_81D63C8: @ 81D63C8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl sub_81D56B0 + subs r4, 0x1 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x0203cf54 + ldr r3, [r0] + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r4 + ldrb r2, [r3] + lsls r0, r2, 4 + subs r0, r2 + lsls r0, 3 + subs r0, r2 + adds r0, r1 + lsls r0, 3 + adds r3, r0 + ldrb r4, [r3, 0x1B] + bl sub_81D5710 + movs r2, 0 + ldr r0, =gTrainerClassNameIndices + adds r4, r0 + ldrb r3, [r4] + ldr r1, =gUnknown_0862A3B4 +_081D6406: + ldrb r0, [r1] + cmp r0, r3 + bne _081D641C + ldrb r0, [r1, 0x1] + b _081D6426 + .pool +_081D641C: + adds r1, 0x4 + adds r2, 0x1 + cmp r2, 0x35 + bls _081D6406 + movs r0, 0 +_081D6426: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81D63C8 + + thumb_func_start sub_81D642C +sub_81D642C: @ 81D642C + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + mov r0, sp + strb r1, [r0] + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + ldr r5, =gExperienceTables + mov r1, sp + ldrb r2, [r1] + lsls r2, 2 + ldr r3, =gBaseStats + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r1, [r1, 0x13] + movs r0, 0xCA + lsls r0, 1 + muls r0, r1 + adds r2, r0 + adds r2, r5 + ldr r0, [r2] + str r0, [sp, 0x4] + add r2, sp, 0x4 + adds r0, r4, 0 + movs r1, 0x19 + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x38 + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + bl pokemon_calc_effective_stats + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D642C + + thumb_func_start sub_81D6490 +sub_81D6490: @ 81D6490 + push {r4,lr} + bl sub_81D56B0 + ldr r0, =0x0203cf54 + ldr r0, [r0] + ldrb r4, [r0, 0x6] + bl sub_81D5710 + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D6490 + + thumb_func_start sub_81D64AC +sub_81D64AC: @ 81D64AC + ldr r0, =0x03005d90 + ldr r0, [r0] + movs r1, 0xEE + lsls r1, 4 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + bx lr + .pool + thumb_func_end sub_81D64AC + + thumb_func_start sub_81D64C0 +sub_81D64C0: @ 81D64C0 + push {lr} + bl sub_81D6534 + cmp r0, 0x1 + bne _081D64D4 + ldr r0, =gUnknown_0862A5D4 + movs r1, 0x70 + movs r2, 0x20 + bl gpu_pal_apply +_081D64D4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D64C0 + + thumb_func_start sub_81D64DC +sub_81D64DC: @ 81D64DC + ldr r1, =0x020375f0 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r2, =0x00000ef9 + adds r0, r2 + ldrb r0, [r0] + lsrs r0, 7 + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_81D64DC + + thumb_func_start sub_81D64FC +sub_81D64FC: @ 81D64FC + ldr r0, =0x03005d90 + ldr r1, [r0] + ldr r0, =0x00000ef9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x80 + orrs r0, r2 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_81D64FC + + thumb_func_start sub_81D6518 +sub_81D6518: @ 81D6518 + ldr r0, =0x03005d90 + ldr r1, [r0] + ldr r0, =0x00000ef9 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x7F + ands r0, r2 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_81D6518 + + thumb_func_start sub_81D6534 +sub_81D6534: @ 81D6534 + push {lr} + bl sub_81D5C18 + lsls r0, 24 + cmp r0, 0 + beq _081D6560 + bl GetCurrentTrainerHillMapId + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6 + beq _081D6560 + bl sub_81D5C00 + ldr r0, =0x020375f0 + ldrh r0, [r0] + cmp r0, 0 + beq _081D6560 + movs r0, 0x1 + b _081D6562 + .pool +_081D6560: + movs r0, 0 +_081D6562: + pop {r1} + bx r1 + thumb_func_end sub_81D6534 + + thumb_func_start sub_81D6568 +sub_81D6568: @ 81D6568 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003d6e + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _081D6590 + ldr r1, =0x020375f0 + movs r0, 0 + b _081D6594 + .pool +_081D6590: + ldr r1, =0x020375f0 + movs r0, 0x1 +_081D6594: + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D6568 + + thumb_func_start sub_81D65A0 +sub_81D65A0: @ 81D65A0 + push {r4,r5,lr} + ldr r4, =0x03005d8c + ldr r2, [r4] + ldr r5, =0x020375e2 + ldr r0, =0x00003d6e + adds r2, r0 + ldrb r1, [r5] + lsls r1, 6 + ldrb r3, [r2] + movs r0, 0x3F + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldr r1, [r4] + ldr r3, =0x00003d68 + adds r2, r1, r3 + ldrh r0, [r5] + lsls r0, 2 + ldr r3, =0x00003718 + adds r1, r3 + adds r1, r0 + ldr r0, [r1] + str r0, [r2] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D65A0 + + thumb_func_start sub_81D65E8 +sub_81D65E8: @ 81D65E8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + movs r3, 0 + movs r4, 0 + ldr r0, =0x0203cf54 + ldr r6, [r0] + movs r5, 0x1F +_081D65F8: + lsls r1, r4, 4 + subs r1, r4 + lsls r1, 3 + subs r1, r4 + lsls r1, 3 + adds r1, r6, r1 + ldrb r2, [r1, 0xC] + adds r0, r5, 0 + ands r0, r2 + eors r3, r0 + ldrb r1, [r1, 0xD] + adds r0, r5, 0 + ands r0, r1 + eors r3, r0 + lsls r0, r3, 24 + lsrs r3, r0, 24 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081D65F8 + movs r1, 0x5 + cmp r7, 0 + beq _081D662A + movs r1, 0xA +_081D662A: + adds r0, r3, 0 + bl __umodsi3 + lsls r0, 24 + lsrs r3, r0, 24 + adds r0, r3, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D65E8 + + thumb_func_start sub_81D6640 +sub_81D6640: @ 81D6640 + push {r4,r5,lr} + movs r3, 0 + movs r2, 0 + ldr r0, =0x0203cf54 + ldr r4, [r0] +_081D664A: + lsls r0, r2, 4 + subs r0, r2 + lsls r0, 3 + subs r0, r2 + lsls r0, 3 + adds r0, r4, r0 + ldrb r1, [r0, 0xC] + adds r1, r3, r1 + ldrb r0, [r0, 0xD] + adds r3, r1, r0 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _081D664A + adds r0, r3, 0 + cmp r0, 0 + bge _081D6670 + adds r0, 0xFF +_081D6670: + asrs r4, r0, 8 + lsrs r0, 31 + adds r0, r4, r0 + asrs r0, 1 + lsls r0, 1 + subs r4, r0 + ldr r0, =0x00000864 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _081D66A0 + ldr r0, =0x0203cf54 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0x8 + bne _081D66A0 + movs r0, 0x1 + b _081D66A2 + .pool +_081D66A0: + movs r0, 0 +_081D66A2: + bl sub_81D65E8 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x03005d8c + ldr r5, [r0] + ldr r1, =0x00003d6e + adds r0, r5, r1 + ldrb r1, [r0] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0xC0 + bne _081D66C8 + adds r0, r2, 0x1 + movs r1, 0xA + bl __modsi3 + lsls r0, 24 + lsrs r2, r0, 24 +_081D66C8: + ldr r1, =gUnknown_0862A5CC + lsls r0, r4, 2 + adds r0, r1 + ldr r1, [r0] + lsls r0, r2, 2 + adds r0, r1 + ldr r4, [r0] + ldr r1, =0x00003d64 + adds r0, r5, r1 + ldr r0, [r0] + movs r1, 0xE1 + lsls r1, 4 + bl __divsi3 + movs r1, 0 + cmp r0, 0xB + ble _081D6704 + movs r1, 0x1 + cmp r0, 0xC + ble _081D6704 + movs r1, 0x2 + cmp r0, 0xD + ble _081D6704 + movs r1, 0x3 + cmp r0, 0xF + ble _081D6704 + movs r1, 0x5 + cmp r0, 0x11 + bgt _081D6704 + movs r1, 0x4 +_081D6704: + lsls r0, r1, 1 + adds r0, r4 + ldrh r0, [r0] + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D6640 + + thumb_func_start sub_81D6720 +sub_81D6720: @ 81D6720 + 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, =0x0203cf60 + ldr r0, =0x00002018 + bl AllocZeroed + str r0, [r6] + ldr r1, =0x00002006 + adds r0, r1 + strb r4, [r0] + ldr r0, [r6] + mov r1, r8 + str r1, [r0] + ldr r1, =0x00002007 + adds r0, r1 + strb r5, [r0] + ldr r0, =sub_81D6774 + bl SetMainCallback2 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D6720 + + thumb_func_start sub_81D6774 +sub_81D6774: @ 81D6774 + push {lr} + bl SetVBlankHBlankCallbacksToNull + bl clear_scheduled_bg_copies_to_vram + bl remove_some_task + bl ResetObjectPaletteAllocator + bl sub_80A1A74 + bl ResetAllObjectData + bl clear_tasks + movs r0, 0 + movs r1, 0xF0 + movs r2, 0x20 + bl rboxid_80040B8 + ldr r1, =gUnknown_0862A6A0 + ldr r0, =0x0203cf60 + ldr r0, [r0] + ldr r2, =0x00002006 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + bl AddTask + ldr r0, =sub_81D67D0 + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D6774 + + thumb_func_start sub_81D67D0 +sub_81D67D0: @ 81D67D0 + push {lr} + bl RunActiveTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl do_scheduled_bg_tilemap_copies_to_vram + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_81D67D0 + + thumb_func_start sub_81D67EC +sub_81D67EC: @ 81D67EC + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_81D67EC + + thumb_func_start sub_81D6800 +sub_81D6800: @ 81D6800 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081D6830 + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + ldr r4, =0x0203cf60 + ldr r0, [r4] + ldr r0, [r0] + bl SetMainCallback2 + ldr r0, [r4] + bl Free + adds r0, r5, 0 + bl remove_task +_081D6830: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D6800 + + thumb_func_start sub_81D6840 +sub_81D6840: @ 81D6840 + push {r4-r6,lr} + lsls r0, 24 + lsrs r3, r0, 24 + adds r6, r3, 0 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _081D68B2 + ldr r2, =0x0203cf60 + ldr r1, [r2] + ldr r4, =0x00002007 + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081D6888 + ldr r0, =0x03005e00 + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81D6800 + b _081D68B0 + .pool +_081D6888: + ldr r4, =0x00002006 + adds r1, r4 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r2, [r2] + ldr r1, =0x00002004 + adds r0, r2, r1 + strh r5, [r0] + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r3, =gUnknown_0862A6A0 + adds r2, r4 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] +_081D68B0: + str r0, [r1] +_081D68B2: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D6840 + + thumb_func_start sub_81D68C8 +sub_81D68C8: @ 81D68C8 + push {lr} + movs r0, 0x48 + movs r1, 0x3F + bl SetGpuReg + movs r0, 0x4A + movs r1, 0 + bl SetGpuReg + movs r0, 0x40 + movs r1, 0xF0 + bl SetGpuReg + ldr r1, =0x00001888 + movs r0, 0x44 + bl SetGpuReg + ldr r0, =0x02037714 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02037b14 + strh r1, [r0] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D68C8 + + thumb_func_start sub_81D6904 +sub_81D6904: @ 81D6904 + push {lr} + movs r0, 0x48 + movs r1, 0x3F + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x3F + bl SetGpuReg + pop {r0} + bx r0 + thumb_func_end sub_81D6904 + + thumb_func_start sub_81D691C +sub_81D691C: @ 81D691C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r5, r0, r1 + bl sub_81D750C + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081D697E + movs r0, 0 + ldrsh r1, [r5, r0] + cmp r1, 0x40 + bne _081D6954 + bl sub_81D7438 + b _081D6978 + .pool +_081D6954: + cmp r1, 0x90 + bne _081D695E + bl sub_81D7480 + b _081D6978 +_081D695E: + cmp r1, 0x94 + beq _081D6974 + movs r0, 0xA4 + lsls r0, 1 + cmp r1, r0 + bne _081D6978 + adds r0, r4, 0 + movs r1, 0 + bl sub_81D75B4 + b _081D697E +_081D6974: + bl sub_81D74C8 +_081D6978: + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] +_081D697E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81D691C + + thumb_func_start sub_81D6984 +sub_81D6984: @ 81D6984 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, =gUnknown_0862A72C + mov r8, r0 + movs r1, 0x58 + movs r2, 0x48 + movs r3, 0x3 + bl AddObjectToFront + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r6, =0x02020630 + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + adds r0, r6, 0 + adds r0, 0x1C + adds r0, r4, r0 + ldr r1, =sub_81D6A20 + str r1, [r0] + adds r0, r6, 0 + adds r0, 0x2E + adds r4, r0 + mov r0, r8 + movs r1, 0x38 + movs r2, 0x68 + movs r3, 0x3 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + ldr r0, =gUnknown_0862A750 + movs r1, 0x4B + movs r2, 0x65 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2] + ldr r0, =gUnknown_0862A774 + movs r1, 0x6D + movs r2, 0x72 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x4] + movs r0, 0 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x1 + bl StartObjectImageAnim + adds r0, r5, 0 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D6984 + + thumb_func_start sub_81D6A20 +sub_81D6A20: @ 81D6A20 + push {r4,lr} + adds r3, r0, 0 + movs r0, 0x2E + adds r0, r3 + mov r12, r0 + ldrh r0, [r0, 0xA] + adds r0, 0x1 + movs r1, 0x1F + ands r0, r1 + mov r1, r12 + strh r0, [r1, 0xA] + cmp r0, 0 + bne _081D6A84 + ldrh r1, [r3, 0x20] + movs r2, 0x20 + ldrsh r0, [r3, r2] + cmp r0, 0x48 + beq _081D6A84 + subs r0, r1, 0x1 + strh r0, [r3, 0x20] + ldr r2, =0x02020630 + movs r4, 0x2E + ldrsh r1, [r3, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x20] + subs r1, 0x1 + strh r1, [r0, 0x20] + mov r0, r12 + movs r4, 0x2 + ldrsh r1, [r0, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x20] + subs r1, 0x1 + strh r1, [r0, 0x20] + mov r0, r12 + movs r4, 0x4 + ldrsh r1, [r0, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x20] + subs r1, 0x1 + strh r1, [r0, 0x20] +_081D6A84: + adds r0, r3, 0 + adds r0, 0x2B + ldrb r3, [r0] + cmp r3, 0x1 + beq _081D6AE4 + cmp r3, 0x1 + bgt _081D6A9C + cmp r3, 0 + beq _081D6AA6 + b _081D6B68 + .pool +_081D6A9C: + cmp r3, 0x2 + beq _081D6B24 + cmp r3, 0x3 + beq _081D6AE4 + b _081D6B68 +_081D6AA6: + ldr r2, =0x02020630 + mov r0, r12 + movs r4, 0x2 + ldrsh r1, [r0, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r3, [r0, 0x24] + mov r0, r12 + movs r4, 0x2 + ldrsh r1, [r0, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r3, [r0, 0x26] + mov r0, r12 + movs r4, 0x4 + ldrsh r1, [r0, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r3, [r0, 0x24] + mov r0, r12 + movs r4, 0x4 + ldrsh r1, [r0, r4] + b _081D6B5E + .pool +_081D6AE4: + ldr r2, =0x02020630 + mov r0, r12 + movs r3, 0x2 + ldrsh r1, [r0, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x0000ffff + strh r1, [r0, 0x24] + mov r4, r12 + movs r0, 0x2 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r3, 0 + strh r3, [r0, 0x26] + movs r0, 0x4 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x1 + negs r1, r1 + b _081D6B58 + .pool +_081D6B24: + ldr r2, =0x02020630 + mov r3, r12 + movs r4, 0x2 + ldrsh r1, [r3, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x0000ffff + strh r1, [r0, 0x24] + movs r0, 0x2 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r3, 0x1 + strh r3, [r0, 0x26] + mov r4, r12 + movs r0, 0x4 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x0000fffe +_081D6B58: + strh r1, [r0, 0x24] + movs r0, 0x4 + ldrsh r1, [r4, r0] +_081D6B5E: + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r3, [r0, 0x26] +_081D6B68: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D6A20 + + thumb_func_start sub_81D6B7C +sub_81D6B7C: @ 81D6B7C + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r5, =gUnknown_0862A81C + adds r0, r5, 0 + movs r1, 0x88 + movs r2, 0x60 + movs r3, 0x1 + bl AddObjectToFront + mov r8, r0 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r6, =0x02020630 + lsls r4, r0, 4 + add r4, r8 + lsls r4, 2 + adds r0, r6, 0 + adds r0, 0x1C + adds r0, r4, r0 + ldr r1, =sub_81D6D20 + str r1, [r0] + adds r0, r6, 0 + adds r0, 0x2E + adds r4, r0 + adds r0, r5, 0 + movs r1, 0xA8 + movs r2, 0x60 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 8 + strh r0, [r4] + adds r0, r5, 0 + movs r1, 0x88 + movs r2, 0x70 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4] + orrs r0, r1 + strh r0, [r4] + adds r0, r5, 0 + movs r1, 0xA8 + movs r2, 0x70 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 8 + strh r0, [r4, 0x2] + adds r0, r5, 0 + movs r1, 0x88 + movs r2, 0x80 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x2] + orrs r0, r1 + strh r0, [r4, 0x2] + adds r0, r5, 0 + movs r1, 0xA8 + movs r2, 0x80 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 8 + strh r0, [r4, 0x4] + adds r0, r5, 0 + movs r1, 0x68 + movs r2, 0x80 + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x4] + orrs r0, r1 + strh r0, [r4, 0x4] + adds r0, r5, 0 + movs r1, 0x88 + movs r2, 0x80 + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 8 + strh r0, [r4, 0x6] + adds r0, r5, 0 + movs r1, 0xB8 + movs r2, 0x80 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x6] + orrs r0, r1 + strh r0, [r4, 0x6] + ldr r0, =gUnknown_0862A84C + movs r1, 0xD0 + movs r2, 0x84 + movs r3, 0 + bl AddObjectToFront + lsls r0, 8 + strh r0, [r4, 0x8] + ldr r0, =gUnknown_0862A864 + movs r1, 0xC8 + movs r2, 0x78 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x8] + orrs r0, r1 + strh r0, [r4, 0x8] + ldrh r1, [r4] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x1 + bl StartObjectImageAnim + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x2 + bl StartObjectImageAnim + ldrh r1, [r4, 0x2] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x3 + bl StartObjectImageAnim + ldrb r1, [r4, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x4 + bl StartObjectImageAnim + ldrh r1, [r4, 0x4] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x5 + bl StartObjectImageAnim + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x6 + bl StartObjectImageAnim + ldrh r1, [r4, 0x6] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x7 + bl StartObjectImageAnim + ldrb r1, [r4, 0x6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x8 + bl StartObjectImageAnim + mov r0, r8 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D6B7C + + thumb_func_start sub_81D6D20 +sub_81D6D20: @ 81D6D20 + push {r4-r7,lr} + adds r4, r0, 0 + adds r3, r4, 0 + adds r3, 0x2E + ldrh r0, [r3, 0xA] + adds r0, 0x1 + movs r1, 0x1F + ands r0, r1 + strh r0, [r3, 0xA] + ldr r7, =0x02020630 + cmp r0, 0 + bne _081D6E0E + ldrh r1, [r4, 0x20] + movs r2, 0x20 + ldrsh r0, [r4, r2] + cmp r0, 0x98 + beq _081D6E0E + adds r0, r1, 0x1 + strh r0, [r4, 0x20] + ldrh r1, [r4, 0x2E] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r0, [r4, 0x2E] + movs r2, 0xFF + adds r1, r2, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r1, [r3, 0x2] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r0, [r3, 0x2] + adds r1, r2, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r1, [r3, 0x4] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r0, [r3, 0x4] + adds r1, r2, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r1, [r3, 0x6] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r0, [r3, 0x6] + adds r1, r2, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r1, [r3, 0x8] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r0, [r3, 0x8] + ands r2, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] +_081D6E0E: + adds r6, r7, 0 + movs r5, 0xFF + ldrb r1, [r3, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x2B + ldrb r2, [r0] + cmp r2, 0x1 + beq _081D6EE0 + cmp r2, 0x1 + bgt _081D6E34 + cmp r2, 0 + beq _081D6E40 + b _081D6FC8 + .pool +_081D6E34: + cmp r2, 0x2 + bne _081D6E3A + b _081D6F68 +_081D6E3A: + cmp r2, 0x3 + beq _081D6EE0 + b _081D6FC8 +_081D6E40: + strh r2, [r4, 0x26] + ldrh r1, [r3] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r0, [r3] + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x2] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r0, [r3, 0x2] + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x4] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r0, [r3, 0x4] + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x6] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r0, [r3, 0x6] + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x8] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x8] + ands r1, r5 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + b _081D6FC6 +_081D6EE0: + movs r2, 0x1 + strh r2, [r4, 0x26] + ldrh r1, [r3] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x2] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrb r1, [r3, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x4] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrb r1, [r3, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x6] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrb r1, [r3, 0x6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x8] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrb r1, [r3, 0x8] + b _081D6FBE +_081D6F68: + strh r2, [r4, 0x26] + ldrh r1, [r3] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r0, [r3] + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x2] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r0, [r3, 0x2] + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x4] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x8] + ands r1, r5 +_081D6FBE: + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 +_081D6FC6: + strh r2, [r0, 0x26] +_081D6FC8: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81D6D20 + + thumb_func_start sub_81D6FD0 +sub_81D6FD0: @ 81D6FD0 + push {lr} + bl sub_81D67EC + bl sub_80BA0A8 + pop {r0} + bx r0 + thumb_func_end sub_81D6FD0 + + thumb_func_start sub_81D6FE0 +sub_81D6FE0: @ 81D6FE0 + push {r4,lr} + bl sub_8121DA0 + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0862A888 + movs r0, 0 + movs r2, 0x3 + bl InitBgsFromTemplates + ldr r4, =0x0203cf60 + ldr r1, [r4] + adds r1, 0x4 + movs r0, 0 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00000804 + adds r1, r0 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00001004 + adds r1, r0 + movs r0, 0x2 + bl SetBgTilemapBuffer + bl sub_8121E10 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D6FE0 + + thumb_func_start sub_81D706C +sub_81D706C: @ 81D706C + push {r4,lr} + sub sp, 0x4 + bl reset_temp_tile_data_buffers + ldr r1, =gUnknown_08DA33C0 + movs r0, 0 + str r0, [sp] + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram +_081D7082: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _081D7082 + ldr r0, =gUnknown_08DA3988 + ldr r4, =0x0203cf60 + ldr r1, [r4] + adds r1, 0x4 + bl LZDecompressWram + ldr r0, =gUnknown_08DA3824 + ldr r1, [r4] + ldr r2, =0x00000804 + adds r1, r2 + bl LZDecompressWram + ldr r0, =gUnknown_08DA3A88 + ldr r1, [r4] + ldr r2, =0x00001004 + adds r1, r2 + bl LZDecompressWram + ldr r0, =gUnknown_08DA37E8 + movs r1, 0 + movs r2, 0x40 + bl decompress_palette + ldr r0, =gUnknown_0862A8C4 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0862A8F8 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0862A924 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0862A9D4 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0862AA14 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0862AA34 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0862A8CC + bl LoadCompressedObjectPalette + ldr r0, =gUnknown_0862A9DC + bl LoadCompressedObjectPalette + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D706C + + thumb_func_start task_add_00_WIN0V_open_close_above_and_more +task_add_00_WIN0V_open_close_above_and_more: @ 81D7134 + push {r4-r7,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r6, r1, 3 + ldr r7, =0x03005e08 + adds r5, r6, r7 + bl dp12_8087EA4 + bl sub_81D6FE0 + bl sub_81D706C + movs r4, 0 + str r4, [sp, 0x4] + ldr r1, =0x02038c28 + ldr r2, =0x010003c0 + add r0, sp, 0x4 + bl CpuFastSet + ldr r2, =gUnknown_0862A87C + ldr r0, [r2] + ldr r1, [r2, 0x4] + ldr r2, [r2, 0x8] + bl sub_80BA038 + strh r4, [r5] + ldr r0, =sub_81D7228 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x2] + ldr r0, =0x0203cf60 + ldr r0, [r0] + ldr r1, =0x00002006 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _081D71CC + bl sub_81D6984 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x4] + bl sub_81D6B7C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x6] + adds r0, r7, 0 + subs r0, 0x8 + adds r0, r6, r0 + ldr r1, =sub_81D691C + str r1, [r0] + b _081D71EE + .pool +_081D71CC: + bl sub_81D7664 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x4] + bl sub_81D78BC + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x6] + adds r0, r7, 0 + subs r0, 0x8 + adds r0, r6, r0 + ldr r1, =sub_81D736C + str r1, [r0] + bl sub_80A2F30 +_081D71EE: + movs r4, 0x1 + negs r4, r4 + adds r0, r4, 0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r0, =sub_81D6FD0 + bl SetVBlankCallback + movs r0, 0x53 + bl audio_play + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end task_add_00_WIN0V_open_close_above_and_more + + thumb_func_start sub_81D7228 +sub_81D7228: @ 81D7228 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r3, r1, r0 + movs r1, 0x18 + ldr r7, =0x0203cf60 + ldr r4, =0x02038c28 + movs r0, 0xF0 + lsls r0, 3 + adds r5, r4, r0 +_081D7244: + lsls r0, r1, 16 + asrs r1, r0, 16 + adds r6, r0, 0 + cmp r1, 0x2F + bgt _081D726C + lsls r1, 1 + adds r2, r1, r4 + ldrh r0, [r3] + lsrs r0, 8 + strh r0, [r2] + adds r1, r5 + ldrh r0, [r3] + b _081D72CA + .pool +_081D726C: + cmp r1, 0x3F + bgt _081D7280 + lsls r1, 1 + adds r2, r1, r4 + ldrh r0, [r3, 0x2] + lsrs r0, 8 + strh r0, [r2] + adds r1, r5 + ldrh r0, [r3, 0x2] + b _081D72CA +_081D7280: + cmp r1, 0x4B + bgt _081D7294 + lsls r1, 1 + adds r2, r1, r4 + ldrh r0, [r3, 0x4] + lsrs r0, 8 + strh r0, [r2] + adds r1, r5 + ldrh r0, [r3, 0x4] + b _081D72CA +_081D7294: + cmp r1, 0x53 + bgt _081D72A8 + lsls r1, 1 + adds r2, r1, r4 + ldrh r0, [r3, 0x6] + lsrs r0, 8 + strh r0, [r2] + adds r1, r5 + ldrh r0, [r3, 0x6] + b _081D72CA +_081D72A8: + cmp r1, 0x57 + bgt _081D72BC + lsls r1, 1 + adds r2, r1, r4 + ldrh r0, [r3, 0x8] + lsrs r0, 8 + strh r0, [r2] + adds r1, r5 + ldrh r0, [r3, 0x8] + b _081D72CA +_081D72BC: + lsls r1, 1 + adds r2, r1, r4 + ldrh r0, [r3, 0xA] + lsrs r0, 8 + strh r0, [r2] + adds r1, r5 + ldrh r0, [r3, 0xA] +_081D72CA: + lsrs r0, 8 + strh r0, [r1] + movs r1, 0x80 + lsls r1, 9 + adds r0, r6, r1 + lsrs r1, r0, 16 + asrs r0, 16 + cmp r0, 0x5B + ble _081D7244 + ldr r0, [r7] + ldr r1, =0x00002006 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _081D7324 + movs r1, 0xE0 + lsls r1, 1 + adds r0, r1, 0 + ldrh r1, [r3] + adds r0, r1 + strh r0, [r3] + movs r1, 0xC0 + lsls r1, 1 + adds r0, r1, 0 + ldrh r1, [r3, 0x2] + adds r0, r1 + strh r0, [r3, 0x2] + movs r1, 0xA0 + lsls r1, 1 + adds r0, r1, 0 + ldrh r1, [r3, 0x4] + adds r0, r1 + strh r0, [r3, 0x4] + movs r1, 0x80 + lsls r1, 1 + adds r0, r1, 0 + ldrh r1, [r3, 0x6] + adds r0, r1 + strh r0, [r3, 0x6] + ldrh r0, [r3, 0x8] + adds r0, 0xC0 + b _081D735E + .pool +_081D7324: + movs r1, 0xC0 + lsls r1, 2 + adds r0, r1, 0 + ldrh r1, [r3] + adds r0, r1 + strh r0, [r3] + movs r1, 0xA0 + lsls r1, 2 + adds r0, r1, 0 + ldrh r1, [r3, 0x2] + adds r0, r1 + strh r0, [r3, 0x2] + movs r1, 0x80 + lsls r1, 2 + adds r0, r1, 0 + ldrh r1, [r3, 0x4] + adds r0, r1 + strh r0, [r3, 0x4] + movs r1, 0xC0 + lsls r1, 1 + adds r0, r1, 0 + ldrh r1, [r3, 0x6] + adds r0, r1 + strh r0, [r3, 0x6] + movs r1, 0x80 + lsls r1, 1 + adds r0, r1, 0 + ldrh r1, [r3, 0x8] + adds r0, r1 +_081D735E: + strh r0, [r3, 0x8] + ldrh r0, [r3, 0xA] + adds r0, 0x80 + strh r0, [r3, 0xA] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81D7228 + + thumb_func_start sub_81D736C +sub_81D736C: @ 81D736C + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r7, =0x03005e08 + adds r4, r0, r7 + bl sub_81D750C + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _081D742E + movs r0, 0 + ldrsh r1, [r4, r0] + cmp r1, 0x20 + beq _081D739C + cmp r1, 0x70 + bne _081D73AC +_081D739C: + bl sub_81D7438 + b _081D7428 + .pool +_081D73AC: + cmp r1, 0xD8 + bne _081D73B6 + bl sub_81D7480 + b _081D7428 +_081D73B6: + cmp r1, 0xDC + bne _081D73C0 + bl sub_81D74C8 + b _081D7428 +_081D73C0: + movs r0, 0xBE + lsls r0, 1 + cmp r1, r0 + beq _081D73D8 + adds r0, 0x20 + cmp r1, r0 + bne _081D7428 + adds r0, r5, 0 + movs r1, 0x2 + bl sub_81D75B4 + b _081D742E +_081D73D8: + movs r1, 0x91 + lsls r1, 2 + movs r0, 0x50 + bl SetGpuReg + adds r2, r7, 0 + subs r2, 0x8 + movs r0, 0x2 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, =sub_81D752C + str r1, [r0] + movs r0, 0x2 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + strh r6, [r0, 0x8] + movs r0, 0x2 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r4, 0x4] + strh r1, [r0, 0xC] + movs r0, 0x2 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r4, 0x6] + strh r1, [r0, 0xE] + bl remove_some_task +_081D7428: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_081D742E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D736C + + thumb_func_start sub_81D7438 +sub_81D7438: @ 81D7438 + push {r4,lr} + sub sp, 0xC + movs r0, 0x57 + bl audio_play + ldr r0, =0x00007fff + ldr r1, =0x0000ffff + str r1, [sp] + movs r4, 0 + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A2C44 + ldr r0, =0xffff0000 + str r4, [sp] + str r4, [sp, 0x4] + movs r1, 0x1 + str r1, [sp, 0x8] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A2C44 + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D7438 + + thumb_func_start sub_81D7480 +sub_81D7480: @ 81D7480 + push {r4,lr} + sub sp, 0xC + movs r0, 0x57 + bl audio_play + ldr r0, =0x00007fff + ldr r1, =0x0000ffff + str r1, [sp] + movs r4, 0 + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0 + movs r2, 0x10 + movs r3, 0x10 + bl sub_80A2C44 + ldr r0, =0xffff0000 + str r4, [sp] + str r4, [sp, 0x4] + movs r1, 0x1 + str r1, [sp, 0x8] + movs r1, 0 + movs r2, 0x10 + movs r3, 0x10 + bl sub_80A2C44 + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D7480 + + thumb_func_start sub_81D74C8 +sub_81D74C8: @ 81D74C8 + push {r4,lr} + sub sp, 0xC + ldr r0, =0x00007fff + ldr r1, =0x0000ffff + str r1, [sp] + movs r4, 0 + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x4 + movs r2, 0x10 + movs r3, 0 + bl sub_80A2C44 + ldr r0, =0xffff0000 + str r4, [sp] + str r4, [sp, 0x4] + movs r1, 0x1 + str r1, [sp, 0x8] + movs r1, 0x4 + movs r2, 0x10 + movs r3, 0 + bl sub_80A2C44 + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D74C8 + + thumb_func_start sub_81D750C +sub_81D750C: @ 81D750C + push {lr} + movs r1, 0x80 + lsls r1, 3 + movs r0, 0x2 + movs r2, 0x1 + bl ChangeBgX + movs r1, 0x80 + lsls r1, 4 + movs r0, 0x2 + movs r2, 0x2 + bl ChangeBgY + pop {r0} + bx r0 + thumb_func_end sub_81D750C + + thumb_func_start sub_81D752C +sub_81D752C: @ 81D752C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r5, r1, r0 + movs r0, 0x4 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl sub_81D7860 + movs r0, 0x6 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl sub_81D7D14 + movs r0, 0x1 + bl GetBgY + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x1 + bl GetBgY + cmp r0, 0 + beq _081D757A + movs r0, 0x80 + lsls r0, 8 + cmp r4, r0 + bls _081D7586 +_081D757A: + movs r1, 0x80 + lsls r1, 3 + movs r0, 0x1 + movs r2, 0x2 + bl ChangeBgY +_081D7586: + ldrh r2, [r5] + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0x10 + beq _081D75A6 + adds r2, 0x1 + strh r2, [r5] + lsls r1, r2, 8 + movs r0, 0x10 + subs r0, r2 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg +_081D75A6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D752C + + thumb_func_start sub_81D75B4 +sub_81D75B4: @ 81D75B4 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r4, r1, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x54 + bl audio_play + movs r0, 0x1 + negs r0, r0 + lsls r4, 24 + asrs r4, 24 + movs r1, 0 + str r1, [sp] + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81D7600 + str r1, [r0] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D75B4 + + thumb_func_start sub_81D7600 +sub_81D7600: @ 81D7600 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r6, r1, 3 + ldr r7, =0x03005e08 + adds r5, r6, r7 + bl sub_81D750C + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _081D7652 + ldrb r0, [r5, 0x2] + bl remove_task + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0 + bl SetVBlankCallback + bl remove_some_task + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + strh r4, [r5] + adds r0, r7, 0 + subs r0, 0x8 + adds r0, r6, r0 + ldr r1, =sub_81D6840 + str r1, [r0] +_081D7652: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D7600 + + thumb_func_start sub_81D7664 +sub_81D7664: @ 81D7664 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, =gUnknown_0862A8D4 + mov r8, r0 + movs r1, 0x62 + movs r2, 0x48 + movs r3, 0x3 + bl AddObjectToFront + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r6, =0x02020630 + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + adds r0, r6, 0 + adds r0, 0x1C + adds r0, r4, r0 + ldr r1, =sub_81D7700 + str r1, [r0] + adds r0, r6, 0 + adds r0, 0x2E + adds r4, r0 + mov r0, r8 + movs r1, 0x42 + movs r2, 0x68 + movs r3, 0x3 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + ldr r0, =gUnknown_0862A900 + movs r1, 0x55 + movs r2, 0x65 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2] + ldr r0, =gUnknown_0862A92C + movs r1, 0x77 + movs r2, 0x72 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x4] + movs r0, 0 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x1 + bl StartObjectImageAnim + adds r0, r5, 0 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D7664 + + thumb_func_start sub_81D7700 +sub_81D7700: @ 81D7700 + push {r4,lr} + adds r3, r0, 0 + movs r0, 0x2E + adds r0, r3 + mov r12, r0 + ldrh r0, [r0, 0xA] + adds r0, 0x1 + movs r1, 0xF + ands r0, r1 + mov r1, r12 + strh r0, [r1, 0xA] + movs r1, 0x7 + ands r1, r0 + cmp r1, 0 + bne _081D7768 + ldrh r1, [r3, 0x20] + movs r2, 0x20 + ldrsh r0, [r3, r2] + cmp r0, 0x48 + beq _081D7768 + subs r0, r1, 0x1 + strh r0, [r3, 0x20] + ldr r2, =0x02020630 + movs r4, 0x2E + ldrsh r1, [r3, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x20] + subs r1, 0x1 + strh r1, [r0, 0x20] + mov r0, r12 + movs r4, 0x2 + ldrsh r1, [r0, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x20] + subs r1, 0x1 + strh r1, [r0, 0x20] + mov r0, r12 + movs r4, 0x4 + ldrsh r1, [r0, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x20] + subs r1, 0x1 + strh r1, [r0, 0x20] +_081D7768: + adds r0, r3, 0 + adds r0, 0x2B + ldrb r3, [r0] + cmp r3, 0x1 + beq _081D77C8 + cmp r3, 0x1 + bgt _081D7780 + cmp r3, 0 + beq _081D778A + b _081D784C + .pool +_081D7780: + cmp r3, 0x2 + beq _081D7808 + cmp r3, 0x3 + beq _081D77C8 + b _081D784C +_081D778A: + ldr r2, =0x02020630 + mov r0, r12 + movs r4, 0x2 + ldrsh r1, [r0, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r3, [r0, 0x24] + mov r0, r12 + movs r4, 0x2 + ldrsh r1, [r0, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r3, [r0, 0x26] + mov r0, r12 + movs r4, 0x4 + ldrsh r1, [r0, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r3, [r0, 0x24] + mov r0, r12 + movs r4, 0x4 + ldrsh r1, [r0, r4] + b _081D7842 + .pool +_081D77C8: + ldr r2, =0x02020630 + mov r0, r12 + movs r3, 0x2 + ldrsh r1, [r0, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x0000ffff + strh r1, [r0, 0x24] + mov r4, r12 + movs r0, 0x2 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r3, 0 + strh r3, [r0, 0x26] + movs r0, 0x4 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x1 + negs r1, r1 + b _081D783C + .pool +_081D7808: + ldr r2, =0x02020630 + mov r3, r12 + movs r4, 0x2 + ldrsh r1, [r3, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x0000ffff + strh r1, [r0, 0x24] + movs r0, 0x2 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r3, 0x1 + strh r3, [r0, 0x26] + mov r4, r12 + movs r0, 0x4 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x0000fffe +_081D783C: + strh r1, [r0, 0x24] + movs r0, 0x4 + ldrsh r1, [r4, r0] +_081D7842: + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r3, [r0, 0x26] +_081D784C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D7700 + + thumb_func_start sub_81D7860 +sub_81D7860: @ 81D7860 + push {r4,lr} + adds r1, r0, 0 + adds r3, r1, 0 + adds r3, 0x2E + ldrh r2, [r1, 0x22] + movs r4, 0x22 + ldrsh r0, [r1, r4] + cmp r0, 0xA0 + bgt _081D78B0 + adds r0, r2, 0 + adds r0, 0x8 + strh r0, [r1, 0x22] + ldr r2, =0x02020630 + movs r0, 0x2E + ldrsh r1, [r1, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x22] + adds r1, 0x8 + strh r1, [r0, 0x22] + movs r4, 0x2 + ldrsh r1, [r3, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x22] + adds r1, 0x8 + strh r1, [r0, 0x22] + movs r0, 0x4 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x22] + adds r1, 0x8 + strh r1, [r0, 0x22] +_081D78B0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D7860 + + thumb_func_start sub_81D78BC +sub_81D78BC: @ 81D78BC + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r5, =gUnknown_0862A9E4 + adds r0, r5, 0 + movs r1, 0x7E + movs r2, 0x60 + movs r3, 0x1 + bl AddObjectToFront + mov r8, r0 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r6, =0x02020630 + lsls r4, r0, 4 + add r4, r8 + lsls r4, 2 + adds r0, r6, 0 + adds r0, 0x1C + adds r0, r4, r0 + ldr r1, =sub_81D7A60 + str r1, [r0] + adds r0, r6, 0 + adds r0, 0x2E + adds r4, r0 + adds r0, r5, 0 + movs r1, 0x9E + movs r2, 0x60 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 8 + strh r0, [r4] + adds r0, r5, 0 + movs r1, 0x7E + movs r2, 0x70 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4] + orrs r0, r1 + strh r0, [r4] + adds r0, r5, 0 + movs r1, 0x9E + movs r2, 0x70 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 8 + strh r0, [r4, 0x2] + adds r0, r5, 0 + movs r1, 0x7E + movs r2, 0x80 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x2] + orrs r0, r1 + strh r0, [r4, 0x2] + adds r0, r5, 0 + movs r1, 0x9E + movs r2, 0x80 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 8 + strh r0, [r4, 0x4] + adds r0, r5, 0 + movs r1, 0x5E + movs r2, 0x80 + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x4] + orrs r0, r1 + strh r0, [r4, 0x4] + adds r0, r5, 0 + movs r1, 0x7E + movs r2, 0x80 + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 8 + strh r0, [r4, 0x6] + adds r0, r5, 0 + movs r1, 0xAE + movs r2, 0x80 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x6] + orrs r0, r1 + strh r0, [r4, 0x6] + ldr r0, =gUnknown_0862AA1C + movs r1, 0xC6 + movs r2, 0x84 + movs r3, 0 + bl AddObjectToFront + lsls r0, 8 + strh r0, [r4, 0x8] + ldr r0, =gUnknown_0862AA3C + movs r1, 0xBE + movs r2, 0x78 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x8] + orrs r0, r1 + strh r0, [r4, 0x8] + ldrh r1, [r4] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x1 + bl StartObjectImageAnim + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x2 + bl StartObjectImageAnim + ldrh r1, [r4, 0x2] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x3 + bl StartObjectImageAnim + ldrb r1, [r4, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x4 + bl StartObjectImageAnim + ldrh r1, [r4, 0x4] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x5 + bl StartObjectImageAnim + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x6 + bl StartObjectImageAnim + ldrh r1, [r4, 0x6] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x7 + bl StartObjectImageAnim + ldrb r1, [r4, 0x6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x8 + bl StartObjectImageAnim + mov r0, r8 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D78BC + + thumb_func_start sub_81D7A60 +sub_81D7A60: @ 81D7A60 + push {r4-r7,lr} + adds r4, r0, 0 + adds r3, r4, 0 + adds r3, 0x2E + ldrh r0, [r3, 0xA] + adds r0, 0x1 + movs r1, 0xF + ands r0, r1 + strh r0, [r3, 0xA] + movs r1, 0x7 + ands r1, r0 + ldr r7, =0x02020630 + cmp r1, 0 + bne _081D7B52 + ldrh r1, [r4, 0x20] + movs r2, 0x20 + ldrsh r0, [r4, r2] + cmp r0, 0x98 + beq _081D7B52 + adds r0, r1, 0x1 + strh r0, [r4, 0x20] + ldrh r1, [r4, 0x2E] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r0, [r4, 0x2E] + movs r2, 0xFF + adds r1, r2, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r1, [r3, 0x2] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r0, [r3, 0x2] + adds r1, r2, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r1, [r3, 0x4] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r0, [r3, 0x4] + adds r1, r2, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r1, [r3, 0x6] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r0, [r3, 0x6] + adds r1, r2, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r1, [r3, 0x8] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + ldrh r0, [r3, 0x8] + ands r2, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] +_081D7B52: + adds r6, r7, 0 + movs r5, 0xFF + ldrb r1, [r3, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x2B + ldrb r2, [r0] + cmp r2, 0x1 + beq _081D7C24 + cmp r2, 0x1 + bgt _081D7B78 + cmp r2, 0 + beq _081D7B84 + b _081D7D0C + .pool +_081D7B78: + cmp r2, 0x2 + bne _081D7B7E + b _081D7CAC +_081D7B7E: + cmp r2, 0x3 + beq _081D7C24 + b _081D7D0C +_081D7B84: + strh r2, [r4, 0x26] + ldrh r1, [r3] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r0, [r3] + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x2] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r0, [r3, 0x2] + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x4] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r0, [r3, 0x4] + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x6] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r0, [r3, 0x6] + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x8] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x8] + ands r1, r5 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + b _081D7D0A +_081D7C24: + movs r2, 0x1 + strh r2, [r4, 0x26] + ldrh r1, [r3] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x2] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrb r1, [r3, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x4] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrb r1, [r3, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x6] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrb r1, [r3, 0x6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x8] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrb r1, [r3, 0x8] + b _081D7D02 +_081D7CAC: + strh r2, [r4, 0x26] + ldrh r1, [r3] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r0, [r3] + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x2] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r0, [r3, 0x2] + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x4] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r1, [r3, 0x8] + ands r1, r5 +_081D7D02: + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 +_081D7D0A: + strh r2, [r0, 0x26] +_081D7D0C: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81D7A60 + + thumb_func_start sub_81D7D14 +sub_81D7D14: @ 81D7D14 + push {lr} + adds r2, r0, 0 + movs r0, 0x2E + adds r0, r2 + mov r12, r0 + ldrh r1, [r2, 0x22] + movs r3, 0x22 + ldrsh r0, [r2, r3] + cmp r0, 0xA0 + bgt _081D7E08 + adds r0, r1, 0 + adds r0, 0x8 + strh r0, [r2, 0x22] + ldr r3, =0x02020630 + ldrh r1, [r2, 0x2E] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x22] + adds r1, 0x8 + strh r1, [r0, 0x22] + ldrh r0, [r2, 0x2E] + movs r2, 0xFF + adds r1, r2, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x22] + adds r1, 0x8 + strh r1, [r0, 0x22] + mov r0, r12 + ldrh r1, [r0, 0x2] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x22] + adds r1, 0x8 + strh r1, [r0, 0x22] + mov r1, r12 + ldrh r0, [r1, 0x2] + adds r1, r2, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x22] + adds r1, 0x8 + strh r1, [r0, 0x22] + mov r0, r12 + ldrh r1, [r0, 0x4] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x22] + adds r1, 0x8 + strh r1, [r0, 0x22] + mov r1, r12 + ldrh r0, [r1, 0x4] + adds r1, r2, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x22] + adds r1, 0x8 + strh r1, [r0, 0x22] + mov r0, r12 + ldrh r1, [r0, 0x6] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x22] + adds r1, 0x8 + strh r1, [r0, 0x22] + mov r1, r12 + ldrh r0, [r1, 0x6] + adds r1, r2, 0 + ands r1, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x22] + adds r1, 0x8 + strh r1, [r0, 0x22] + mov r0, r12 + ldrh r1, [r0, 0x8] + lsls r1, 16 + asrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x22] + adds r1, 0x8 + strh r1, [r0, 0x22] + mov r1, r12 + ldrh r0, [r1, 0x8] + ands r2, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x22] + adds r1, 0x8 + strh r1, [r0, 0x22] +_081D7E08: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D7D14 + + thumb_func_start sub_81D7E10 +sub_81D7E10: @ 81D7E10 + push {r4,lr} + bl sub_8121DA0 + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0862AA54 + movs r0, 0x1 + movs r2, 0x3 + bl InitBgsFromTemplates + ldr r4, =0x0203cf60 + ldr r1, [r4] + adds r1, 0x4 + movs r0, 0 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00000804 + adds r1, r0 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00001004 + adds r1, r0 + movs r0, 0x2 + bl SetBgTilemapBuffer + bl sub_8121E10 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D7E10 + + thumb_func_start sub_81D7E9C +sub_81D7E9C: @ 81D7E9C + push {r4,lr} + sub sp, 0x4 + bl reset_temp_tile_data_buffers + ldr r1, =gUnknown_08DA33C0 + movs r4, 0 + str r4, [sp] + movs r0, 0 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r1, =gUnknown_08DA4F70 + str r4, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r1, =gUnknown_08DA3C94 + str r4, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram +_081D7ED0: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _081D7ED0 + ldr r0, =gUnknown_08DA3988 + ldr r4, =0x0203cf60 + ldr r1, [r4] + adds r1, 0x4 + bl LZDecompressWram + ldr r0, =gUnknown_08DA60B8 + ldr r1, [r4] + ldr r2, =0x00000804 + adds r1, r2 + bl LZDecompressWram + ldr r0, =gUnknown_08DA4DEC + ldr r1, [r4] + ldr r2, =0x00001004 + adds r1, r2 + bl LZDecompressWram + ldr r0, =gUnknown_08DA4DA8 + movs r1, 0 + movs r2, 0x40 + bl decompress_palette + ldr r0, =gUnknown_0862AA90 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0862AA98 + bl LoadCompressedObjectPalette + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D7E9C + + thumb_func_start sub_81D7F4C +sub_81D7F4C: @ 81D7F4C + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r5, =0x03005e08 + adds r6, r4, r5 + movs r0, 0xE8 + lsls r0, 1 + bl current_map_music_set + bl sub_81D7E10 + bl sub_81D7E9C + movs r1, 0x94 + lsls r1, 2 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x00000808 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldr r0, =sub_81D67EC + bl SetVBlankCallback + ldr r0, =sub_81D81A4 + movs r1, 0 + bl AddTask + movs r0, 0 + strh r0, [r6] + strh r0, [r6, 0x2] + subs r5, 0x8 + adds r4, r5 + ldr r0, =sub_81D7FC0 + str r0, [r4] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D7F4C + + thumb_func_start sub_81D7FC0 +sub_81D7FC0: @ 81D7FC0 + push {r4-r6,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + movs r0, 0 + ldrsh r5, [r4, r0] + cmp r5, 0x1 + beq _081D802A + cmp r5, 0x1 + bgt _081D7FE8 + cmp r5, 0 + beq _081D7FF4 + b _081D815A + .pool +_081D7FE8: + cmp r5, 0x2 + beq _081D80A4 + cmp r5, 0x3 + bne _081D7FF2 + b _081D8124 +_081D7FF2: + b _081D815A +_081D7FF4: + ldrh r1, [r4, 0x2] + movs r2, 0x2 + ldrsh r0, [r4, r2] + cmp r0, 0x8 + bne _081D8024 + movs r0, 0x1 + negs r0, r0 + str r5, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + strh r5, [r4, 0x4] + movs r0, 0x1E + strh r0, [r4, 0x6] + strh r5, [r4, 0x8] + movs r0, 0x7 + strh r0, [r4, 0xA] + strh r5, [r4, 0x2] + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _081D815A +_081D8024: + adds r0, r1, 0x1 + strh r0, [r4, 0x2] + b _081D815A +_081D802A: + ldrh r1, [r4, 0x6] + ldrh r3, [r4, 0x4] + adds r0, r1, r3 + strh r0, [r4, 0x4] + ldrh r2, [r4, 0xA] + ldrh r3, [r4, 0x8] + adds r0, r2, r3 + strh r0, [r4, 0x8] + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _081D8046 + subs r0, r1, 0x3 + strh r0, [r4, 0x6] +_081D8046: + lsls r0, r2, 16 + cmp r0, 0 + beq _081D8050 + subs r0, r2, 0x1 + strh r0, [r4, 0xA] +_081D8050: + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0xFF + ble _081D8078 + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r4, 0x4] + movs r1, 0 + strh r1, [r4, 0x6] + movs r0, 0xC + strh r0, [r4, 0xC] + movs r3, 0x1 + negs r3, r3 + adds r0, r3, 0 + strh r0, [r4, 0xE] + strh r1, [r4, 0x2] + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_081D8078: + movs r1, 0xF0 + lsls r1, 7 + movs r2, 0xC0 + lsls r2, 5 + ldrh r0, [r4, 0x8] + adds r0, 0x20 + lsls r0, 16 + asrs r0, 16 + str r0, [sp] + movs r3, 0x4 + ldrsh r0, [r4, r3] + str r0, [sp, 0x4] + movs r3, 0x4 + ldrsh r0, [r4, r3] + str r0, [sp, 0x8] + movs r0, 0 + str r0, [sp, 0xC] + movs r0, 0x2 + movs r3, 0x78 + bl SetBgAffine + b _081D815A +_081D80A4: + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + movs r1, 0xF0 + lsls r1, 7 + movs r2, 0xC0 + lsls r2, 5 + ldrh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 18 + adds r0, 0x20 + ldrh r3, [r4, 0x8] + adds r0, r3 + lsls r0, 16 + asrs r0, 16 + str r0, [sp] + movs r3, 0x4 + ldrsh r0, [r4, r3] + str r0, [sp, 0x4] + movs r3, 0x4 + ldrsh r0, [r4, r3] + str r0, [sp, 0x8] + movs r5, 0 + str r5, [sp, 0xC] + movs r0, 0x2 + movs r3, 0x78 + bl SetBgAffine + ldrh r0, [r4, 0xE] + ldrh r1, [r4, 0xC] + adds r0, r1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0xC + beq _081D80F4 + movs r0, 0xC + negs r0, r0 + cmp r1, r0 + bne _081D815A +_081D80F4: + movs r2, 0xE + ldrsh r0, [r4, r2] + negs r0, r0 + strh r0, [r4, 0xE] + movs r3, 0x2 + ldrsh r1, [r4, r3] + ldr r0, =0x00000127 + cmp r1, r0 + ble _081D815A + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + movs r0, 0x1 + negs r0, r0 + str r5, [sp] + movs r1, 0x6 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + b _081D815A + .pool +_081D8124: + ldrh r0, [r4, 0x4] + adds r0, 0x10 + strh r0, [r4, 0x4] + movs r1, 0xF0 + lsls r1, 7 + movs r2, 0xC0 + lsls r2, 5 + ldrh r0, [r4, 0x8] + adds r0, 0x20 + lsls r0, 16 + asrs r0, 16 + str r0, [sp] + movs r3, 0x4 + ldrsh r0, [r4, r3] + str r0, [sp, 0x4] + movs r3, 0x4 + ldrsh r0, [r4, r3] + str r0, [sp, 0x8] + movs r0, 0 + str r0, [sp, 0xC] + movs r0, 0x2 + movs r3, 0x78 + bl SetBgAffine + adds r0, r6, 0 + bl sub_81D8164 +_081D815A: + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81D7FC0 + + thumb_func_start sub_81D8164 +sub_81D8164: @ 81D8164 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081D8192 + movs r0, 0 + bl SetVBlankCallback + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81D6840 + str r0, [r1] +_081D8192: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D8164 + + thumb_func_start sub_81D81A4 +sub_81D81A4: @ 81D81A4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + ldrh r1, [r4, 0x2] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _081D8254 + ldr r0, =gUnknown_0862AAA0 + ldr r3, =gUnknown_0862AAB8 + movs r1, 0 + ldrsh r2, [r4, r1] + lsls r2, 1 + adds r1, r2, r3 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + lsls r1, 18 + movs r6, 0xF0 + lsls r6, 15 + adds r1, r6 + asrs r1, 16 + adds r3, 0x1 + adds r2, r3 + ldrb r2, [r2] + lsls r2, 24 + asrs r2, 24 + lsls r2, 18 + movs r3, 0xA0 + lsls r3, 15 + adds r2, r3 + asrs r2, 16 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02020630 + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + adds r3, r1 + movs r0, 0 + ldrsb r0, [r4, r0] + strh r0, [r3, 0x2E] + ldrb r2, [r3, 0x1] + movs r1, 0xD + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + movs r2, 0x4 + orrs r0, r2 + movs r2, 0x3 + orrs r0, r2 + strb r0, [r3, 0x1] + ldrb r0, [r3, 0x5] + ands r1, r0 + movs r0, 0x8 + orrs r1, r0 + strb r1, [r3, 0x5] + adds r0, r3, 0 + bl obj_alloc_rotscale_entry + ldrh r1, [r4] + movs r6, 0 + ldrsh r0, [r4, r6] + cmp r0, 0x9 + bne _081D8250 + adds r0, r5, 0 + bl remove_task + b _081D825A + .pool +_081D8250: + adds r0, r1, 0x1 + strh r0, [r4] +_081D8254: + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] +_081D825A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81D81A4 + + thumb_func_start sub_81D8260 +sub_81D8260: @ 81D8260 + push {lr} + adds r2, r0, 0 + movs r1, 0x30 + ldrsh r0, [r2, r1] + cmp r0, 0 + bne _081D8270 + strh r0, [r2, 0x24] + b _081D829A +_081D8270: + ldr r1, =gUnknown_0862AAB8 + movs r3, 0x2E + ldrsh r0, [r2, r3] + lsls r0, 1 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrh r3, [r2, 0x24] + adds r0, r3 + strh r0, [r2, 0x24] + movs r3, 0x2E + ldrsh r0, [r2, r3] + lsls r0, 1 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrh r1, [r2, 0x26] + adds r0, r1 +_081D829A: + strh r0, [r2, 0x26] + ldrh r0, [r2, 0x30] + adds r0, 0x1 + movs r1, 0xF + ands r0, r1 + strh r0, [r2, 0x30] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D8260 + + thumb_func_start sub_81D82B0 +sub_81D82B0: @ 81D82B0 + push {r4,lr} + bl sub_8121DA0 + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0862AACC + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + ldr r4, =0x0203cf60 + ldr r1, [r4] + adds r1, 0x4 + movs r0, 0 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00000804 + adds r1, r0 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00001004 + adds r1, r0 + movs r0, 0x2 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00001804 + adds r1, r0 + movs r0, 0x3 + bl SetBgTilemapBuffer + bl sub_8121E10 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x3 + bl schedule_bg_copy_tilemap_to_vram + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D82B0 + + thumb_func_start sub_81D8358 +sub_81D8358: @ 81D8358 + push {r4-r7,lr} + sub sp, 0xC + bl reset_temp_tile_data_buffers + ldr r1, =gUnknown_08DA7528 + movs r4, 0 + str r4, [sp] + movs r0, 0 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r1, =gUnknown_08DA69BC + str r4, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + add r7, sp, 0x8 +_081D8380: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _081D8380 + ldr r0, =gUnknown_08DA7AAC + ldr r5, =0x0203cf60 + ldr r1, [r5] + adds r1, 0x4 + bl LZDecompressWram + ldr r0, =gUnknown_08DA7784 + ldr r1, [r5] + ldr r4, =0x00001804 + adds r1, r4 + bl LZDecompressWram + str r6, [sp, 0x4] + ldr r1, [r5] + ldr r0, =0x00001004 + adds r1, r0 + ldr r2, =0x01000200 + add r0, sp, 0x4 + bl CpuFastSet + ldr r1, [r5] + adds r4, r1, r4 + ldr r0, =0x00000804 + adds r1, r0 + movs r2, 0x80 + lsls r2, 2 + adds r0, r4, 0 + bl CpuFastSet + str r6, [sp, 0x8] + ldr r1, [r5] + ldr r0, =0x00000904 + adds r1, r0 + ldr r2, =0x010000d0 + adds r0, r7, 0 + bl CpuFastSet + ldr r0, =gUnknown_08DA7744 + movs r1, 0 + movs r2, 0x40 + bl decompress_palette + ldr r0, =0x02037714 + ldr r1, =0x00007fff + strh r1, [r0] + ldr r0, =0x02037b14 + strh r1, [r0] + ldr r0, =gUnknown_0862AAFC + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0862AB04 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0862AB0C + bl LoadCompressedObjectPalette + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D8358 + + thumb_func_start sub_81D844C +sub_81D844C: @ 81D844C + push {r4,r5,lr} + movs r0, 0x6 + bl GetGpuReg + lsls r0, 16 + lsrs r2, r0, 16 + adds r1, r2, 0 + subs r1, 0x18 + lsls r0, r1, 16 + lsrs r0, 16 + cmp r0, 0x6F + bhi _081D848C + ldr r0, =0x0203cf60 + ldr r0, [r0] + ldr r3, =0x00002008 + adds r0, r3 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r1, r0 + bgt _081D848C + ldr r1, =0x04000052 + ldr r3, =0x00000d08 + b _081D8492 + .pool +_081D848C: + ldr r1, =0x04000052 + movs r3, 0x80 + lsls r3, 5 +_081D8492: + adds r0, r3, 0 + strh r0, [r1] + cmp r2, 0 + bne _081D84E0 + ldr r0, =0x0203cf60 + ldr r1, [r0] + ldr r2, =0x00002008 + adds r3, r1, r2 + ldrh r4, [r3] + movs r1, 0 + ldrsh r2, [r3, r1] + ldr r1, =0x00001fff + adds r5, r0, 0 + cmp r2, r1 + bgt _081D84D4 + cmp r2, 0x27 + bgt _081D84C8 + adds r0, r4, 0x4 + b _081D84D2 + .pool +_081D84C8: + cmp r2, 0x4F + bgt _081D84D0 + adds r0, r4, 0x2 + b _081D84D2 +_081D84D0: + adds r0, r4, 0x1 +_081D84D2: + strh r0, [r3] +_081D84D4: + ldr r1, [r5] + ldr r2, =0x0000200a + adds r1, r2 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_081D84E0: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D844C + + thumb_func_start sub_81D84EC +sub_81D84EC: @ 81D84EC + push {r4-r6,lr} + mov r6, r8 + push {r6} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r6, =0x03005e08 + adds r5, r4, r6 + bl sub_81D82B0 + bl sub_81D8358 + ldr r1, =0x00001e41 + movs r0, 0x50 + bl SetGpuRegBits + movs r0, 0x80 + lsls r0, 5 + mov r8, r0 + movs r0, 0x52 + mov r1, r8 + bl SetGpuReg + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldr r0, =sub_81D67EC + bl SetVBlankCallback + ldr r0, =0x0203cf60 + ldr r0, [r0] + ldr r1, =0x00002008 + adds r2, r0, r1 + movs r1, 0 + strh r1, [r2] + ldr r2, =0x0000200a + adds r0, r2 + strh r1, [r0] + strh r1, [r5] + strh r1, [r5, 0x2] + strh r1, [r5, 0x4] + strh r1, [r5, 0x6] + mov r0, r8 + strh r0, [r5, 0x8] + subs r6, 0x8 + adds r4, r6 + ldr r0, =sub_81D857C + str r0, [r4] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D84EC + + thumb_func_start sub_81D857C +sub_81D857C: @ 81D857C + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r5, r0, r1 + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0x4 + bhi _081D8674 + lsls r0, 2 + ldr r1, =_081D85A8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081D85A8: + .4byte _081D85BC + .4byte _081D85DC + .4byte _081D861A + .4byte _081D863A + .4byte _081D8656 +_081D85BC: + ldrh r1, [r5, 0x2] + movs r2, 0x2 + ldrsh r0, [r5, r2] + cmp r0, 0x8 + bne _081D8634 + movs r0, 0x1 + negs r0, r0 + movs r4, 0 + str r4, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + strh r4, [r5, 0x2] + b _081D864E +_081D85DC: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _081D8674 + ldrh r2, [r5, 0x2] + movs r3, 0x2 + ldrsh r0, [r5, r3] + cmp r0, 0xA + bne _081D8614 + strh r1, [r5, 0x2] + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + ldr r0, =sub_81D844C + bl SetHBlankCallback + movs r0, 0x3 + bl EnableInterrupts + b _081D8674 + .pool +_081D8614: + adds r0, r2, 0x1 + strh r0, [r5, 0x2] + b _081D8674 +_081D861A: + ldrh r1, [r5, 0x2] + movs r2, 0x2 + ldrsh r0, [r5, r2] + cmp r0, 0x50 + bne _081D8634 + movs r0, 0 + strh r0, [r5, 0x2] + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + bl sub_81D86CC + b _081D8674 +_081D8634: + adds r0, r1, 0x1 + strh r0, [r5, 0x2] + b _081D8674 +_081D863A: + ldrh r0, [r5, 0x2] + adds r0, 0x1 + strh r0, [r5, 0x2] + lsls r0, 16 + movs r1, 0xB8 + lsls r1, 17 + cmp r0, r1 + bne _081D8674 + movs r0, 0 + strh r0, [r5, 0x2] +_081D864E: + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + b _081D8674 +_081D8656: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81D8684 + str r1, [r0] +_081D8674: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D857C + + thumb_func_start sub_81D8684 +sub_81D8684: @ 81D8684 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081D86B8 + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + bl SetHBlankCallback + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81D6840 + str r0, [r1] +_081D86B8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D8684 + + thumb_func_start sub_81D86CC +sub_81D86CC: @ 81D86CC + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, =gUnknown_0862AB14 + movs r1, 0xA0 + movs r2, 0 + movs r3, 0 + bl AddObjectToFront + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r5, r6, 4 + adds r5, r6 + lsls r5, 2 + ldr r4, =0x0202065e + adds r0, r5, r4 + mov r8, r0 + ldr r0, =gUnknown_0862AB2C + movs r2, 0x30 + negs r2, r2 + movs r1, 0xB8 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + strh r0, [r1] + adds r3, r4, 0 + subs r3, 0x2E + subs r4, 0x12 + adds r4, r5, r4 + ldr r0, =sub_81D874C + str r0, [r4] + adds r5, r3 + ldrb r0, [r5, 0x5] + movs r2, 0xC + orrs r0, r2 + strb r0, [r5, 0x5] + movs r4, 0 + ldrsh r1, [r1, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r1, [r0, 0x5] + orrs r1, r2 + strb r1, [r0, 0x5] + adds r0, r6, 0 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D86CC + + thumb_func_start sub_81D874C +sub_81D874C: @ 81D874C + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r5, 0 + adds r4, 0x2E + movs r0, 0x4 + ldrsh r1, [r4, r0] + cmp r1, 0 + bne _081D8764 + movs r0, 0xC + strh r0, [r4, 0x6] + movs r0, 0x8 + b _081D87C2 +_081D8764: + movs r0, 0x80 + lsls r0, 1 + cmp r1, r0 + bne _081D8774 + movs r0, 0x9 + strh r0, [r4, 0x6] + movs r0, 0x7 + b _081D87C2 +_081D8774: + movs r0, 0x86 + lsls r0, 1 + cmp r1, r0 + bne _081D8784 + movs r0, 0x8 + strh r0, [r4, 0x6] + movs r0, 0x6 + b _081D87C2 +_081D8784: + movs r0, 0x8C + lsls r0, 1 + cmp r1, r0 + bne _081D8794 + movs r0, 0x7 + strh r0, [r4, 0x6] + movs r0, 0x5 + b _081D87C2 +_081D8794: + movs r0, 0x92 + lsls r0, 1 + cmp r1, r0 + bne _081D87A4 + movs r0, 0x6 + strh r0, [r4, 0x6] + movs r0, 0x4 + b _081D87C2 +_081D87A4: + movs r0, 0x98 + lsls r0, 1 + cmp r1, r0 + bne _081D87B4 + movs r0, 0x5 + strh r0, [r4, 0x6] + movs r0, 0x3 + b _081D87C2 +_081D87B4: + movs r0, 0xA0 + lsls r0, 1 + cmp r1, r0 + bne _081D87C4 + movs r0, 0x4 + strh r0, [r4, 0x6] + movs r0, 0x2 +_081D87C2: + strh r0, [r4, 0x8] +_081D87C4: + movs r1, 0x4 + ldrsh r0, [r4, r1] + movs r2, 0x6 + ldrsh r1, [r4, r2] + bl __modsi3 + cmp r0, 0 + bne _081D87EE + ldrh r0, [r5, 0x24] + subs r0, 0x1 + strh r0, [r5, 0x24] + ldr r2, =0x02020630 + movs r0, 0 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x24] + subs r1, 0x1 + strh r1, [r0, 0x24] +_081D87EE: + movs r1, 0x4 + ldrsh r0, [r4, r1] + movs r2, 0x8 + ldrsh r1, [r4, r2] + bl __modsi3 + cmp r0, 0 + bne _081D8818 + ldrh r0, [r5, 0x26] + adds r0, 0x1 + strh r0, [r5, 0x26] + ldr r2, =0x02020630 + movs r0, 0 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x26] + adds r1, 0x1 + strh r1, [r0, 0x26] +_081D8818: + ldrh r0, [r4, 0x4] + adds r0, 0x1 + strh r0, [r4, 0x4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D874C + + thumb_func_start sub_81D8828 +sub_81D8828: @ 81D8828 + push {r4,lr} + bl sub_8121DA0 + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0862AB44 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + ldr r4, =0x0203cf60 + ldr r1, [r4] + adds r1, 0x4 + movs r0, 0 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00000804 + adds r1, r0 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00001004 + adds r1, r0 + movs r0, 0x2 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00001804 + adds r1, r0 + movs r0, 0x3 + bl SetBgTilemapBuffer + bl sub_8121E10 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x3 + bl schedule_bg_copy_tilemap_to_vram + movs r1, 0xC1 + lsls r1, 6 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D8828 + + thumb_func_start sub_81D88D0 +sub_81D88D0: @ 81D88D0 + push {r4,lr} + sub sp, 0x4 + bl reset_temp_tile_data_buffers + ldr r1, =gUnknown_08DA80BC + movs r4, 0 + str r4, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r1, =gUnknown_08DA7EAC + str r4, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r1, =gUnknown_08DA7C30 + str r4, [sp] + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram +_081D8904: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _081D8904 + ldr r0, =gUnknown_08DA8D6C + ldr r4, =0x0203cf60 + ldr r1, [r4] + adds r1, 0x4 + bl LZDecompressWram + ldr r0, =gUnknown_08DA8B40 + ldr r1, [r4] + ldr r2, =0x00000804 + adds r1, r2 + bl LZDecompressWram + ldr r0, =gUnknown_08DA7FB4 + ldr r1, [r4] + ldr r2, =0x00001004 + adds r1, r2 + bl LZDecompressWram + ldr r0, =gUnknown_08DA7D6C + ldr r1, [r4] + ldr r2, =0x00001804 + adds r1, r2 + bl LZDecompressWram + ldr r0, =gUnknown_08DA8E84 + movs r1, 0 + movs r2, 0x80 + bl decompress_palette + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D88D0 + + thumb_func_start sub_81D8980 +sub_81D8980: @ 81D8980 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r5, =0x03005e08 + adds r6, r4, r5 + bl sub_81D8828 + bl sub_81D88D0 + bl sub_81D68C8 + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldr r0, =sub_81D67EC + bl SetVBlankCallback + movs r0, 0 + strh r0, [r6] + strh r0, [r6, 0x2] + ldr r0, =sub_81D8AD8 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x4] + subs r5, 0x8 + adds r4, r5 + ldr r0, =sub_81D89E0 + str r0, [r4] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D8980 + + thumb_func_start sub_81D89E0 +sub_81D89E0: @ 81D89E0 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + bl sub_81D8BB4 + ldrh r1, [r4, 0x6] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + bne _081D8A16 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bgt _081D8A16 + movs r2, 0x2 + ldrsh r0, [r4, r2] + cmp r0, 0x59 + bgt _081D8A16 + movs r0, 0x67 + bl audio_play +_081D8A16: + ldrh r0, [r4, 0x6] + adds r0, 0x1 + strh r0, [r4, 0x6] + movs r0, 0 + ldrsh r5, [r4, r0] + cmp r5, 0x1 + beq _081D8A5C + cmp r5, 0x1 + bgt _081D8A34 + cmp r5, 0 + beq _081D8A3E + b _081D8AC6 + .pool +_081D8A34: + cmp r5, 0x2 + beq _081D8A8C + cmp r5, 0x3 + beq _081D8AA8 + b _081D8AC6 +_081D8A3E: + ldrh r1, [r4, 0x2] + movs r2, 0x2 + ldrsh r0, [r4, r2] + cmp r0, 0x8 + bne _081D8AA2 + movs r0, 0x1 + negs r0, r0 + str r5, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + strh r5, [r4, 0x2] + b _081D8A9A +_081D8A5C: + ldrh r1, [r4, 0x2] + movs r2, 0x2 + ldrsh r0, [r4, r2] + cmp r0, 0x7F + bne _081D8AA2 + movs r0, 0 + strh r0, [r4, 0x2] + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + ldr r2, =0x03005e00 + movs r0, 0x4 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, =sub_81D8B2C + b _081D8AC4 + .pool +_081D8A8C: + ldrh r1, [r4, 0x2] + movs r2, 0x2 + ldrsh r0, [r4, r2] + cmp r0, 0xC + bne _081D8AA2 + movs r0, 0 + strh r0, [r4, 0x2] +_081D8A9A: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _081D8AC6 +_081D8AA2: + adds r0, r1, 0x1 + strh r0, [r4, 0x2] + b _081D8AC6 +_081D8AA8: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81D8BEC +_081D8AC4: + str r1, [r0] +_081D8AC6: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D89E0 + + thumb_func_start sub_81D8AD8 +sub_81D8AD8: @ 81D8AD8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r5, r1, r0 + ldrh r1, [r5, 0x1E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _081D8B1C + bl GenerateRandomNumber + movs r4, 0x7 + adds r1, r4, 0 + ands r1, r0 + subs r1, 0x4 + lsls r1, 8 + movs r0, 0x1 + movs r2, 0 + bl ChangeBgX + bl GenerateRandomNumber + ands r4, r0 + subs r4, 0x4 + lsls r4, 8 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0 + bl ChangeBgY +_081D8B1C: + ldrh r0, [r5, 0x1E] + adds r0, 0x1 + strh r0, [r5, 0x1E] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D8AD8 + + thumb_func_start sub_81D8B2C +sub_81D8B2C: @ 81D8B2C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r4, r1, r0 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081D8B70 + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + movs r0, 0xA + strh r0, [r4, 0x2] + movs r1, 0x1 + negs r1, r1 + adds r0, r1, 0 + b _081D8BAA + .pool +_081D8B70: + cmp r0, 0x1 + bne _081D8BAC + movs r0, 0x2 + ldrsh r1, [r4, r0] + lsls r1, 8 + movs r0, 0x1 + movs r2, 0x2 + bl ChangeBgX + movs r0, 0x2 + ldrsh r1, [r4, r0] + lsls r1, 8 + movs r0, 0x1 + movs r2, 0x1 + bl ChangeBgY + ldrh r0, [r4, 0x4] + ldrh r1, [r4, 0x2] + adds r0, r1 + strh r0, [r4, 0x2] + lsls r0, 16 + asrs r0, 16 + movs r1, 0xA + negs r1, r1 + cmp r0, r1 + bne _081D8BAC + movs r1, 0x4 + ldrsh r0, [r4, r1] + negs r0, r0 +_081D8BAA: + strh r0, [r4, 0x4] +_081D8BAC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81D8B2C + + thumb_func_start sub_81D8BB4 +sub_81D8BB4: @ 81D8BB4 + push {r4,lr} + movs r4, 0x80 + lsls r4, 3 + movs r0, 0x2 + adds r1, r4, 0 + movs r2, 0x2 + bl ChangeBgX + movs r0, 0x2 + adds r1, r4, 0 + movs r2, 0x1 + bl ChangeBgY + movs r4, 0x80 + lsls r4, 4 + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x2 + bl ChangeBgX + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl ChangeBgY + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81D8BB4 + + thumb_func_start sub_81D8BEC +sub_81D8BEC: @ 81D8BEC + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r5, r1, 3 + ldr r6, =0x03005e08 + adds r4, r5, r6 + bl sub_81D8BB4 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081D8C26 + movs r0, 0 + bl SetVBlankCallback + bl sub_81D6904 + ldrb r0, [r4, 0x4] + bl remove_task + adds r0, r6, 0 + subs r0, 0x8 + adds r0, r5, r0 + ldr r1, =sub_81D6840 + str r1, [r0] +_081D8C26: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D8BEC + + thumb_func_start sub_81D8C38 +sub_81D8C38: @ 81D8C38 + push {r4,lr} + bl sub_8121DA0 + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0862AD08 + movs r0, 0x1 + movs r2, 0x3 + bl InitBgsFromTemplates + ldr r4, =0x0203cf60 + ldr r1, [r4] + adds r1, 0x4 + movs r0, 0 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00000804 + adds r1, r0 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00001004 + adds r1, r0 + movs r0, 0x2 + bl SetBgTilemapBuffer + bl sub_8121E10 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + movs r1, 0xC1 + lsls r1, 6 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D8C38 + + thumb_func_start sub_81D8CC4 +sub_81D8CC4: @ 81D8CC4 + push {r4,lr} + sub sp, 0x4 + bl reset_temp_tile_data_buffers + ldr r1, =gUnknown_08DAAB24 + movs r4, 0 + str r4, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r1, =gUnknown_08DAA8B4 + str r4, [sp] + movs r0, 0 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram +_081D8CEA: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _081D8CEA + ldr r0, =gUnknown_08DAAE54 + ldr r4, =0x0203cf60 + ldr r1, [r4] + ldr r2, =0x00000804 + adds r1, r2 + bl LZDecompressWram + ldr r0, =gUnknown_08DAAC1C + ldr r1, [r4] + adds r1, 0x4 + bl LZDecompressWram + ldr r0, =gUnknown_08DAAF98 + ldr r1, [r4] + ldr r2, =0x00001004 + adds r1, r2 + bl LZDecompressWram + ldr r0, =gUnknown_08DAAFEC + movs r1, 0 + movs r2, 0x60 + bl decompress_palette + ldr r0, =gUnknown_0862AC28 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0862AC30 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0862AC38 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0862AC40 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0862AC48 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0862AC50 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0862AC58 + bl LoadCompressedObjectPalette + ldr r0, =gUnknown_0862AC60 + bl LoadCompressedObjectPalette + ldr r0, =gUnknown_0862AC68 + bl LoadCompressedObjectPalette + ldr r0, =gUnknown_0862AC70 + bl LoadCompressedObjectPalette + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D8CC4 + + thumb_func_start sub_81D8DB4 +sub_81D8DB4: @ 81D8DB4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r5, =0x03005e08 + adds r6, r4, r5 + bl sub_81D8C38 + bl sub_81D8CC4 + bl sub_81D68C8 + movs r1, 0x80 + lsls r1, 3 + movs r0, 0 + bl ClearGpuRegBits + ldr r1, =0x00000241 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x00000e09 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldr r0, =sub_81D67EC + bl SetVBlankCallback + movs r0, 0 + strh r0, [r6] + strh r0, [r6, 0x2] + subs r5, 0x8 + adds r4, r5 + ldr r0, =sub_81D8E80 + str r0, [r4] + ldr r0, =sub_81D8FB0 + movs r1, 0 + bl AddTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x4] + movs r0, 0x4 + ldrsh r1, [r6, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + movs r2, 0 + strh r2, [r0, 0x8] + movs r0, 0x4 + ldrsh r1, [r6, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + strh r2, [r0, 0xA] + movs r0, 0x4 + ldrsh r1, [r6, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + strh r2, [r0, 0xC] + movs r0, 0x4 + ldrsh r1, [r6, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + movs r2, 0x1 + strh r2, [r0, 0xE] + movs r0, 0x4 + ldrsh r1, [r6, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + strh r2, [r0, 0x10] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D8DB4 + + thumb_func_start sub_81D8E80 +sub_81D8E80: @ 81D8E80 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r7, r0, 3 + ldr r0, =0x03005e08 + mov r8, r0 + adds r4, r7, r0 + movs r1, 0 + ldrsh r5, [r4, r1] + cmp r5, 0x1 + beq _081D8EDE + cmp r5, 0x1 + bgt _081D8EB0 + cmp r5, 0 + beq _081D8EBA + b _081D8FA0 + .pool +_081D8EB0: + cmp r5, 0x2 + beq _081D8F1E + cmp r5, 0x3 + beq _081D8F84 + b _081D8FA0 +_081D8EBA: + ldrh r1, [r4, 0x2] + movs r2, 0x2 + ldrsh r0, [r4, r2] + cmp r0, 0x8 + bne _081D8F18 + adds r0, r6, 0 + bl sub_81D90A8 + movs r0, 0x1 + negs r0, r0 + str r5, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + strh r5, [r4, 0x2] + b _081D8F30 +_081D8EDE: + ldr r2, =0x02020630 + movs r0, 0xA + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =sub_81D97E0 + cmp r1, r0 + bne _081D8FA0 + ldrh r1, [r4, 0x2] + movs r2, 0x2 + ldrsh r0, [r4, r2] + cmp r0, 0x40 + bne _081D8F18 + adds r0, r6, 0 + bl sub_81D94D4 + adds r0, r6, 0 + bl sub_81D93D8 + b _081D8F2C + .pool +_081D8F18: + adds r0, r1, 0x1 + strh r0, [r4, 0x2] + b _081D8FA0 +_081D8F1E: + ldrh r2, [r4, 0x2] + movs r0, 0x2 + ldrsh r1, [r4, r0] + movs r0, 0xE0 + lsls r0, 1 + cmp r1, r0 + bne _081D8F38 +_081D8F2C: + movs r0, 0 + strh r0, [r4, 0x2] +_081D8F30: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _081D8FA0 +_081D8F38: + adds r0, r2, 0x1 + strh r0, [r4, 0x2] + movs r1, 0x2 + ldrsh r0, [r4, r1] + movs r1, 0x90 + bl __modsi3 + lsls r0, 16 + asrs r4, r0, 16 + cmp r4, 0 + bne _081D8FA0 + ldr r0, =0x0000fffe + ldr r1, =0x0000ffff + str r1, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A2C44 + ldr r0, =0xffff0000 + str r4, [sp] + str r4, [sp, 0x4] + movs r1, 0x1 + str r1, [sp, 0x8] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A2C44 + b _081D8FA0 + .pool +_081D8F84: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r1, 0x4 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + mov r0, r8 + subs r0, 0x8 + adds r0, r7, r0 + ldr r1, =sub_81D9034 + str r1, [r0] +_081D8FA0: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D8E80 + + thumb_func_start sub_81D8FB0 +sub_81D8FB0: @ 81D8FB0 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r4, r1, r0 + ldrh r1, [r4] + movs r0, 0xF + ands r0, r1 + cmp r0, 0 + bne _081D9024 + ldrh r1, [r4, 0x2] + adds r1, 0xE + lsls r1, 8 + movs r2, 0xF8 + lsls r2, 5 + adds r0, r2, 0 + ands r1, r0 + ldrh r0, [r4, 0x4] + adds r0, 0x9 + movs r2, 0xF + ands r0, r2 + orrs r1, r0 + movs r0, 0x52 + bl SetGpuReg + ldrh r1, [r4, 0x2] + ldrh r0, [r4, 0x6] + subs r1, r0 + strh r1, [r4, 0x2] + ldrh r0, [r4, 0x8] + ldrh r2, [r4, 0x4] + adds r0, r2 + strh r0, [r4, 0x4] + lsls r1, 16 + asrs r1, 16 + movs r0, 0x3 + negs r0, r0 + cmp r1, r0 + beq _081D9008 + cmp r1, 0 + bne _081D9010 +_081D9008: + movs r1, 0x6 + ldrsh r0, [r4, r1] + negs r0, r0 + strh r0, [r4, 0x6] +_081D9010: + movs r2, 0x4 + ldrsh r0, [r4, r2] + cmp r0, 0x3 + beq _081D901C + cmp r0, 0 + bne _081D9024 +_081D901C: + movs r1, 0x8 + ldrsh r0, [r4, r1] + negs r0, r0 + strh r0, [r4, 0x8] +_081D9024: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D8FB0 + + thumb_func_start sub_81D9034 +sub_81D9034: @ 81D9034 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r6, r1, 3 + ldr r7, =0x03005e08 + adds r4, r6, r7 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _081D90A0 + bl sub_80A2F30 + movs r1, 0x2 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081D9078 + movs r0, 0 + bl SetVBlankCallback + bl sub_81D6904 + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + ldrb r0, [r4, 0x4] + bl remove_task +_081D9078: + ldrh r1, [r4, 0x2] + movs r2, 0x2 + ldrsh r0, [r4, r2] + cmp r0, 0x20 + bne _081D909C + strh r5, [r4, 0x2] + adds r0, r7, 0 + subs r0, 0x8 + adds r0, r6, r0 + ldr r1, =sub_81D6840 + str r1, [r0] + b _081D90A0 + .pool +_081D909C: + adds r0, r1, 0x1 + strh r0, [r4, 0x2] +_081D90A0: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81D9034 + + thumb_func_start sub_81D90A8 +sub_81D90A8: @ 81D90A8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =0x03005e08 + adds r4, r0 + ldr r0, =gUnknown_0862AC78 + movs r1, 0x40 + movs r2, 0x78 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x6] + movs r0, 0x6 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x0202065e + mov r10, r1 + adds r7, r0, r1 + ldr r0, =gUnknown_0862AC90 + movs r1, 0x10 + movs r2, 0x82 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7] + movs r2, 0x2E + negs r2, r2 + add r2, r10 + mov r8, r2 + movs r1, 0x6 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r8 + ldrb r2, [r1, 0x5] + movs r6, 0xD + negs r6, r6 + adds r0, r6, 0 + ands r0, r2 + movs r2, 0x4 + mov r9, r2 + mov r2, r9 + orrs r0, r2 + strb r0, [r1, 0x5] + movs r1, 0 + ldrsh r0, [r7, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r8 + ldrb r2, [r1, 0x5] + adds r0, r6, 0 + ands r0, r2 + mov r2, r9 + orrs r0, r2 + strb r0, [r1, 0x5] + ldr r5, =gUnknown_0862ACA8 + adds r0, r5, 0 + movs r1, 0xA0 + movs r2, 0x80 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x8] + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + mov r1, r10 + adds r7, r0, r1 + adds r0, r5, 0 + movs r1, 0xC0 + movs r2, 0x80 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7] + adds r0, r5, 0 + movs r1, 0xE0 + movs r2, 0x80 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7, 0x2] + movs r2, 0x8 + ldrsh r0, [r4, r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r8 + ldrb r2, [r1, 0x5] + adds r0, r6, 0 + ands r0, r2 + mov r2, r9 + orrs r0, r2 + strb r0, [r1, 0x5] + movs r1, 0 + ldrsh r0, [r7, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r8 + ldrb r2, [r1, 0x5] + adds r0, r6, 0 + ands r0, r2 + mov r2, r9 + orrs r0, r2 + strb r0, [r1, 0x5] + movs r1, 0x2 + ldrsh r0, [r7, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r8 + ldrb r2, [r1, 0x5] + adds r0, r6, 0 + ands r0, r2 + mov r2, r9 + orrs r0, r2 + strb r0, [r1, 0x5] + movs r0, 0 + ldrsh r1, [r7, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + movs r1, 0x1 + bl StartObjectImageAnim + movs r2, 0x2 + ldrsh r1, [r7, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + movs r1, 0x2 + bl StartObjectImageAnim + ldr r0, =gUnknown_0862ACC0 + movs r2, 0x41 + negs r2, r2 + movs r1, 0x78 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0xA] + movs r0, 0xA + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + mov r1, r10 + adds r7, r0, r1 + ldr r0, =gUnknown_0862ACD8 + movs r2, 0x71 + negs r2, r2 + movs r1, 0x78 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7] + movs r2, 0xA + ldrsh r0, [r4, r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r8 + ldrb r2, [r1, 0x5] + adds r0, r6, 0 + ands r0, r2 + mov r2, r9 + orrs r0, r2 + strb r0, [r1, 0x5] + movs r0, 0 + ldrsh r1, [r7, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + ldrb r1, [r0, 0x5] + ands r6, r1 + orrs r6, r2 + strb r6, [r0, 0x5] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D90A8 + + thumb_func_start sub_81D9274 +sub_81D9274: @ 81D9274 + push {r4-r6,lr} + mov r6, r8 + push {r6} + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + ldr r0, =0x03005e08 + adds r2, r0 + ldr r3, =0x02020630 + movs r0, 0x6 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + movs r1, 0x1C + adds r1, r3 + mov r8, r1 + add r0, r8 + ldr r6, =pokemon_alive_on_battle_side + str r6, [r0] + movs r0, 0x6 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r4, 0 + strh r4, [r0, 0x36] + movs r0, 0x6 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x38] + movs r0, 0x6 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r5, 0x4 + strh r5, [r0, 0x3A] + movs r0, 0x6 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x3C] + movs r0, 0x8 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + str r6, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x36] + movs r0, 0x8 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x38] + movs r0, 0x8 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r5, [r0, 0x3A] + movs r0, 0x8 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0x1 + strh r1, [r0, 0x3C] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D9274 + + thumb_func_start pokemon_alive_on_battle_side +pokemon_alive_on_battle_side: @ 81D9338 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x36] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + bne _081D93CC + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081D9370 + ldrh r0, [r4, 0x20] + ldrh r3, [r4, 0x3A] + subs r0, r3 + strh r0, [r4, 0x20] + ldr r2, =0x02020630 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x20] + subs r1, r3 + b _081D939E + .pool +_081D9370: + ldrh r2, [r4, 0x3A] + ldrh r1, [r4, 0x20] + adds r0, r2, r1 + strh r0, [r4, 0x20] + ldr r3, =0x02020630 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x20] + adds r2, r1 + strh r2, [r0, 0x20] + movs r2, 0x30 + ldrsh r1, [r4, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r4, 0x3A] + ldrh r2, [r0, 0x20] + adds r1, r2 +_081D939E: + strh r1, [r0, 0x20] + ldrh r1, [r4, 0x38] + adds r1, 0x1 + movs r2, 0 + strh r1, [r4, 0x38] + ldrh r0, [r4, 0x3A] + subs r0, r1 + strh r0, [r4, 0x3A] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x3 + bne _081D93CC + strh r2, [r4, 0x36] + strh r2, [r4, 0x38] + strh r2, [r4, 0x3A] + ldr r0, =DummyObjectCallback + str r0, [r4, 0x1C] + b _081D93D2 + .pool +_081D93CC: + ldrh r0, [r4, 0x36] + adds r0, 0x1 + strh r0, [r4, 0x36] +_081D93D2: + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemon_alive_on_battle_side + + thumb_func_start sub_81D93D8 +sub_81D93D8: @ 81D93D8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + ldr r0, =0x03005e08 + adds r2, r0 + ldr r3, =0x02020630 + movs r0, 0x6 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r3, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_81D9420 + str r1, [r0] + movs r0, 0x6 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0x1 + bl StartObjectImageAnim + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D93D8 + + thumb_func_start sub_81D9420 +sub_81D9420: @ 81D9420 + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x2B + ldrb r0, [r0] + cmp r0, 0x1 + beq _081D9488 + cmp r0, 0x1 + bgt _081D9436 + cmp r0, 0 + beq _081D9440 + b _081D94C4 +_081D9436: + cmp r0, 0x2 + beq _081D9440 + cmp r0, 0x3 + beq _081D9488 + b _081D94C4 +_081D9440: + adds r0, r4, 0 + adds r0, 0x2C + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 26 + movs r1, 0xC + bl __umodsi3 + lsls r0, 24 + ldr r2, =0x02020630 + cmp r0, 0 + bne _081D9470 + ldrh r0, [r4, 0x20] + subs r0, 0x2 + strh r0, [r4, 0x20] + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x20] + subs r1, 0x2 + strh r1, [r0, 0x20] +_081D9470: + movs r1, 0x2E + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0x26] + b _081D94C4 + .pool +_081D9488: + ldr r2, =0x02020630 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x0000fffe + strh r1, [r0, 0x26] + adds r0, r4, 0 + adds r0, 0x2C + ldrb r1, [r0] + lsls r1, 26 + lsrs r1, 26 + movs r0, 0xF + ands r0, r1 + cmp r0, 0 + bne _081D94C4 + ldrh r0, [r4, 0x22] + adds r0, 0x1 + strh r0, [r4, 0x22] + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x22] + adds r1, 0x1 + strh r1, [r0, 0x22] +_081D94C4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D9420 + + thumb_func_start sub_81D94D4 +sub_81D94D4: @ 81D94D4 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r1, r0 + movs r0, 0x8 + ldrsh r1, [r1, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r2, =0x0202065e + adds r4, r0, r2 + subs r2, 0x12 + adds r0, r2 + ldr r3, =sub_81D9528 + str r3, [r0] + movs r0, 0 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + str r3, [r0] + movs r0, 0x2 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + str r3, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D94D4 + + thumb_func_start sub_81D9528 +sub_81D9528: @ 81D9528 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + ldrh r1, [r7, 0x36] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _081D9550 + ldrh r1, [r7, 0x24] + movs r2, 0x24 + ldrsh r0, [r7, r2] + cmp r0, 0x1 + bne _081D954C + ldr r0, =0x0000ffff + b _081D954E + .pool +_081D954C: + movs r0, 0x1 +_081D954E: + strh r0, [r7, 0x24] +_081D9550: + movs r1, 0x38 + ldrsh r0, [r7, r1] + cmp r0, 0x80 + bne _081D95CE + ldr r2, =gUnknown_0862ACF0 + mov r8, r2 + mov r0, r8 + movs r1, 0x98 + movs r2, 0x84 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7, 0x3C] + ldr r5, =0x02020630 + movs r1, 0x3C + ldrsh r0, [r7, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r2, [r1, 0x5] + movs r4, 0xD + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + movs r6, 0x4 + orrs r0, r6 + strb r0, [r1, 0x5] + mov r0, r8 + movs r1, 0xE0 + movs r2, 0x84 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7, 0x3C] + movs r2, 0x3C + ldrsh r1, [r7, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r1, [r0, 0x5] + ands r4, r1 + orrs r4, r6 + strb r4, [r0, 0x5] + movs r0, 0x3C + ldrsh r1, [r7, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3F + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] + ldrh r0, [r7, 0x38] + adds r0, 0x1 + strh r0, [r7, 0x38] +_081D95CE: + ldrh r1, [r7, 0x38] + movs r2, 0x38 + ldrsh r0, [r7, r2] + cmp r0, 0x7F + ble _081D95F8 + movs r1, 0x26 + ldrsh r0, [r7, r1] + cmp r0, 0x20 + beq _081D95FC + ldrh r0, [r7, 0x3A] + adds r0, 0x1 + strh r0, [r7, 0x3A] + lsls r0, 16 + asrs r0, 20 + strh r0, [r7, 0x26] + b _081D95FC + .pool +_081D95F8: + adds r0, r1, 0x1 + strh r0, [r7, 0x38] +_081D95FC: + ldrh r0, [r7, 0x36] + movs r1, 0x3F + ands r0, r1 + cmp r0, 0 + bne _081D960C + movs r0, 0xA5 + bl audio_play +_081D960C: + ldrh r0, [r7, 0x36] + adds r0, 0x1 + strh r0, [r7, 0x36] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81D9528 + + thumb_func_start sub_81D961C +sub_81D961C: @ 81D961C + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x3C + ldrsh r1, [r4, r0] + cmp r1, 0x40 + bgt _081D968C + ldrh r0, [r4, 0x26] + adds r0, 0x2 + strh r0, [r4, 0x26] + ldr r5, =0x02020630 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrh r1, [r0, 0x26] + adds r1, 0x2 + strh r1, [r0, 0x26] + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0x40 + beq _081D964C + b _081D979E +_081D964C: + movs r3, 0x30 + negs r3, r3 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl sub_81D9868 + movs r2, 0x5 + strh r2, [r4, 0x36] + ldr r0, =0x0000ffff + strh r0, [r4, 0x38] + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x3 + strh r1, [r0, 0x36] + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x38] + b _081D979E + .pool +_081D968C: + cmp r1, 0x6F + bgt _081D96BE + adds r0, r4, 0 + bl sub_81D97E0 + movs r1, 0x36 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081D96A4 + movs r0, 0x68 + bl audio_play +_081D96A4: + movs r0, 0x36 + ldrsh r1, [r4, r0] + movs r0, 0x3 + negs r0, r0 + cmp r1, r0 + bne _081D979E + adds r0, r4, 0 + movs r1, 0x2 + movs r2, 0x30 + movs r3, 0x10 + bl sub_81D9868 + b _081D979E +_081D96BE: + cmp r1, 0x70 + bne _081D96EC + ldr r2, =0x02020630 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x7 + strh r1, [r0, 0x36] + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x3 + strh r1, [r0, 0x38] + b _081D96F2 + .pool +_081D96EC: + ldr r0, =0x00000147 + cmp r1, r0 + bgt _081D9700 +_081D96F2: + adds r0, r4, 0 + bl sub_81D97E0 + b _081D979E + .pool +_081D9700: + movs r0, 0xA4 + lsls r0, 1 + cmp r1, r0 + bne _081D974C + adds r0, r4, 0 + bl sub_81D97E0 + adds r0, r4, 0 + movs r1, 0x3 + movs r2, 0x30 + movs r3, 0x10 + bl sub_81D9868 + movs r3, 0x1 + strh r3, [r4, 0x24] + ldr r2, =0x02020630 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r3, [r0, 0x24] + movs r0, 0xCB + lsls r0, 1 + movs r1, 0 + bl cry_related + ldr r0, =sub_81D98B4 + movs r1, 0 + bl AddTask + b _081D979E + .pool +_081D974C: + movs r0, 0xB0 + lsls r0, 1 + cmp r1, r0 + beq _081D9790 + adds r0, 0x18 + cmp r1, r0 + bne _081D979E + movs r3, 0 + strh r3, [r4, 0x24] + ldr r2, =0x02020630 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r3, [r0, 0x24] + adds r0, r4, 0 + bl sub_81D97E0 + adds r0, r4, 0 + movs r1, 0x2 + movs r2, 0x30 + movs r3, 0x10 + bl sub_81D9868 + ldr r0, =sub_81D97E0 + str r0, [r4, 0x1C] + b _081D97D2 + .pool +_081D9790: + ldr r0, =sub_81D8E80 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl sub_81D9274 +_081D979E: + ldrh r2, [r4, 0x3C] + movs r0, 0x3C + ldrsh r1, [r4, r0] + movs r0, 0xA4 + lsls r0, 1 + cmp r1, r0 + ble _081D97CC + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + bne _081D97CC + movs r1, 0x24 + ldrsh r2, [r4, r1] + negs r2, r2 + strh r2, [r4, 0x24] + ldr r3, =0x02020630 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r2, [r0, 0x24] +_081D97CC: + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] +_081D97D2: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D961C + + thumb_func_start sub_81D97E0 +sub_81D97E0: @ 81D97E0 + push {r4-r7,lr} + adds r3, r0, 0 + movs r0, 0x2E + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, =0x02020630 + adds r4, r0, r5 + ldrh r1, [r3, 0x3A] + ldrh r0, [r4, 0x36] + ands r0, r1 + cmp r0, 0 + bne _081D985C + ldrh r2, [r3, 0x36] + ldrh r1, [r3, 0x26] + adds r0, r2, r1 + strh r0, [r3, 0x26] + movs r7, 0x2E + ldrsh r1, [r3, r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrh r1, [r0, 0x26] + adds r2, r1 + strh r2, [r0, 0x26] + ldrh r0, [r3, 0x38] + ldrh r2, [r3, 0x36] + adds r0, r2 + strh r0, [r3, 0x36] + lsls r0, 16 + asrs r5, r0, 16 + ldrh r6, [r4, 0x38] + movs r7, 0x38 + ldrsh r2, [r4, r7] + cmp r5, r2 + bge _081D9836 + movs r0, 0x36 + ldrsh r1, [r3, r0] + adds r0, r2, 0 + cmn r1, r0 + bgt _081D985C +_081D9836: + cmp r5, r2 + ble _081D9844 + strh r6, [r3, 0x36] + b _081D9854 + .pool +_081D9844: + movs r0, 0x36 + ldrsh r1, [r3, r0] + movs r2, 0x38 + ldrsh r0, [r4, r2] + cmn r1, r0 + bge _081D9854 + negs r0, r6 + strh r0, [r3, 0x36] +_081D9854: + movs r7, 0x38 + ldrsh r0, [r3, r7] + negs r0, r0 + strh r0, [r3, 0x38] +_081D985C: + ldrh r0, [r3, 0x3A] + adds r0, 0x1 + strh r0, [r3, 0x3A] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81D97E0 + + thumb_func_start sub_81D9868 +sub_81D9868: @ 81D9868 + push {r4,r5,lr} + adds r5, r1, 0 + lsls r5, 24 + lsrs r5, 24 + movs r4, 0x2E + ldrsh r1, [r0, r4] + lsls r4, r1, 4 + adds r4, r1 + lsls r4, 2 + ldr r1, =0x02020630 + adds r4, r1 + lsls r2, 16 + asrs r2, 16 + ldrh r1, [r0, 0x20] + adds r2, r1 + strh r2, [r4, 0x20] + lsls r3, 16 + asrs r3, 16 + ldrh r1, [r0, 0x22] + adds r3, r1 + strh r3, [r4, 0x22] + ldrh r1, [r0, 0x24] + strh r1, [r4, 0x24] + ldrh r1, [r0, 0x26] + strh r1, [r4, 0x26] + adds r1, r5, 0 + bl StartObjectImageAnim + adds r0, r4, 0 + adds r1, r5, 0 + bl StartObjectImageAnim + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D9868 + + thumb_func_start sub_81D98B4 +sub_81D98B4: @ 81D98B4 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + movs r0, 0 + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _081D990C + cmp r1, 0x1 + bgt _081D98DC + cmp r1, 0 + beq _081D98E2 + b _081D99B4 + .pool +_081D98DC: + cmp r1, 0x2 + beq _081D99A4 + b _081D99B4 +_081D98E2: + movs r2, 0x80 + lsls r2, 7 + movs r0, 0x40 + str r0, [sp] + adds r0, 0xC0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r1, [sp, 0xC] + movs r0, 0x2 + adds r1, r2, 0 + movs r3, 0x78 + bl SetBgAffine + movs r1, 0x80 + lsls r1, 3 + movs r0, 0 + bl SetGpuRegBits + movs r0, 0x10 + strh r0, [r4, 0x8] + b _081D9922 +_081D990C: + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0x8 + bne _081D991A + movs r0, 0x12 + bl audio_play +_081D991A: + movs r3, 0x4 + ldrsh r0, [r4, r3] + cmp r0, 0x2 + bne _081D992A +_081D9922: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _081D99B4 +_081D992A: + ldrh r5, [r4, 0x8] + ldrh r1, [r4, 0x2] + adds r0, r5, r1 + strh r0, [r4, 0x2] + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + movs r3, 0x6 + ldrsh r0, [r4, r3] + movs r1, 0x3 + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + bne _081D9954 + lsls r0, r5, 16 + asrs r0, 16 + cmp r0, 0x4 + beq _081D9954 + subs r0, r5, 0x2 + strh r0, [r4, 0x8] +_081D9954: + ldrh r0, [r4, 0x6] + adds r0, 0x1 + strh r0, [r4, 0x6] + movs r2, 0x80 + lsls r2, 7 + movs r0, 0x40 + str r0, [sp] + ldrh r0, [r4, 0x2] + movs r3, 0x80 + lsls r3, 1 + adds r1, r3, 0 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + str r0, [sp, 0x4] + ldrh r0, [r4, 0x2] + subs r1, r0 + lsls r1, 16 + asrs r1, 16 + str r1, [sp, 0x8] + movs r5, 0 + str r5, [sp, 0xC] + movs r0, 0x2 + adds r1, r2, 0 + movs r3, 0x78 + bl SetBgAffine + movs r1, 0x2 + ldrsh r0, [r4, r1] + cmp r0, 0xFF + ble _081D99B4 + strh r5, [r4, 0x2] + strh r5, [r4, 0x6] + strh r5, [r4, 0xA] + movs r0, 0x10 + strh r0, [r4, 0x8] + ldrh r0, [r4, 0x4] + adds r0, 0x1 + strh r0, [r4, 0x4] + b _081D99B4 +_081D99A4: + movs r1, 0x80 + lsls r1, 3 + movs r0, 0 + bl ClearGpuRegBits + adds r0, r5, 0 + bl remove_task +_081D99B4: + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81D98B4 + + thumb_func_start sub_81D99BC +sub_81D99BC: @ 81D99BC + push {r4,lr} + bl sub_80D2578 + cmp r0, 0 + bne _081D99DC + ldr r4, =0x02021cc4 + bl sub_80D2548 + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + movs r0, 0x1 + b _081D99DE + .pool +_081D99DC: + movs r0, 0 +_081D99DE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81D99BC + + thumb_func_start walda_maybe +walda_maybe: @ 81D99E4 + push {r4,lr} + sub sp, 0x8 + ldr r4, =0x02021dc4 + bl sub_80D2548 + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + movs r0, 0 + str r0, [sp] + ldr r0, =sub_81D9A1C + str r0, [sp, 0x4] + movs r0, 0x4 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl do_choose_name_or_words_screen + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end walda_maybe + + thumb_func_start sub_81D9A1C +sub_81D9A1C: @ 81D9A1C + push {r4,r5,lr} + ldr r4, =0x020375e0 + ldr r5, =0x02021dc4 + adds r0, r5, 0 + bl sub_81D9A98 + strh r0, [r4] + ldrh r0, [r4] + cmp r0, 0x1 + beq _081D9A68 + cmp r0, 0x1 + bgt _081D9A44 + cmp r0, 0 + beq _081D9A62 + b _081D9A68 + .pool +_081D9A44: + cmp r0, 0x2 + bne _081D9A68 + bl sub_80D2578 + cmp r0, 0 + beq _081D9A5C + ldr r0, =gUnknown_085EE49A + bl sub_80D255C + b _081D9A68 + .pool +_081D9A5C: + movs r0, 0x1 + strh r0, [r4] + b _081D9A68 +_081D9A62: + adds r0, r5, 0 + bl sub_80D255C +_081D9A68: + ldr r4, =0x02021cc4 + bl sub_80D2548 + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + ldr r1, =0x03005dac + ldr r0, =sub_80AF168 + str r0, [r1] + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D9A1C + + thumb_func_start sub_81D9A98 +sub_81D9A98: @ 81D9A98 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0xFF + bne _081D9AA6 + movs r0, 0x2 + b _081D9ABC +_081D9AA6: + bl sub_80D2548 + adds r1, r0, 0 + adds r0, r4, 0 + bl CompareString + cmp r0, 0 + beq _081D9ABA + movs r0, 0 + b _081D9ABC +_081D9ABA: + movs r0, 0x1 +_081D9ABC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81D9A98 + + thumb_func_start sub_81D9AC4 +sub_81D9AC4: @ 81D9AC4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + ldr r0, =0x03005d90 + ldr r0, [r0] + adds r0, 0xA + bl sub_80842DC + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, =0x020375f0 + mov r8, r0 + bl sub_80D2548 + mov r7, sp + adds r7, 0xA + add r6, sp, 0xC + mov r5, sp + adds r5, 0xD + str r4, [sp] + str r0, [sp, 0x4] + add r0, sp, 0x8 + adds r1, r7, 0 + adds r2, r6, 0 + adds r3, r5, 0 + bl sub_81D9B68 + mov r1, r8 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + beq _081D9B1E + ldrb r0, [r5] + bl sub_80D24BC + ldrb r0, [r6] + bl sub_80D24F0 + add r0, sp, 0x8 + ldrh r0, [r0] + ldrh r1, [r7] + bl sub_80D2524 +_081D9B1E: + mov r1, r8 + ldrh r0, [r1] + bl sub_80D2480 + mov r1, r8 + ldrb r0, [r1] + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81D9AC4 + + thumb_func_start sub_81D9B40 +sub_81D9B40: @ 81D9B40 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0 + ldr r3, =gUnknown_0862AD14 +_081D9B4A: + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _081D9B5C + lsls r0, r1, 24 + lsrs r0, 24 + b _081D9B64 + .pool +_081D9B5C: + adds r1, 0x1 + cmp r1, 0x1F + bls _081D9B4A + movs r0, 0x20 +_081D9B64: + pop {r1} + bx r1 + thumb_func_end sub_81D9B40 + + thumb_func_start sub_81D9B68 +sub_81D9B68: @ 81D9B68 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + mov r10, r0 + str r1, [sp, 0x20] + str r2, [sp, 0x24] + str r3, [sp, 0x28] + ldr r0, [sp, 0x4C] + ldr r5, [sp, 0x50] + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + adds r0, r5, 0 + bl GetStringLength + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xF + bne _081D9C7E + movs r4, 0 + add r7, sp, 0x10 +_081D9B98: + adds r0, r5, r4 + ldrb r0, [r0] + bl sub_81D9B40 + adds r1, r7, r4 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x20 + beq _081D9C7E + adds r4, 0x1 + cmp r4, 0xE + ble _081D9B98 + movs r6, 0x3 + movs r5, 0 + movs r0, 0x5 + mov r8, r0 + movs r4, 0xD +_081D9BBC: + mov r1, r8 + str r1, [sp] + add r0, sp, 0x4 + adds r1, r7, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_81D9D5C + adds r6, 0x8 + adds r5, 0x5 + subs r4, 0x1 + cmp r4, 0 + bge _081D9BBC + movs r0, 0x2 + str r0, [sp] + add r0, sp, 0x4 + adds r1, r7, 0 + movs r2, 0x46 + movs r3, 0x73 + bl sub_81D9D5C + add r0, sp, 0x4 + movs r1, 0 + movs r2, 0x3 + bl sub_81D9DAC + adds r4, r0, 0 + adds r0, r7, 0 + movs r1, 0x75 + movs r2, 0x3 + bl sub_81D9DAC + cmp r4, r0 + bne _081D9C7E + add r0, sp, 0x4 + movs r1, 0x9 + movs r2, 0x15 + bl sub_81D9C90 + add r0, sp, 0x4 + ldrb r0, [r0, 0x8] + movs r2, 0xF + ands r2, r0 + add r0, sp, 0x4 + movs r1, 0x8 + bl sub_81D9C90 + add r0, sp, 0x4 + ldrb r2, [r0, 0x8] + lsrs r2, 4 + movs r1, 0x8 + bl sub_81D9CDC + add r0, sp, 0x4 + ldrb r2, [r0, 0x6] + adds r1, r0, 0 + ldrb r0, [r0] + ldrb r1, [r1, 0x2] + eors r0, r1 + add r1, sp, 0x4 + ldrb r4, [r1, 0x4] + eors r0, r4 + mov r3, r9 + lsrs r1, r3, 8 + eors r0, r1 + cmp r2, r0 + bne _081D9C7E + add r0, sp, 0x4 + ldrb r3, [r0, 0x7] + adds r2, r0, 0 + ldrb r1, [r0, 0x1] + ldrb r0, [r2, 0x3] + eors r1, r0 + adds r0, r2, 0 + ldrb r2, [r0, 0x5] + eors r1, r2 + movs r0, 0xFF + mov r5, r9 + ands r0, r5 + eors r1, r0 + cmp r3, r1 + bne _081D9C7E + add r0, sp, 0x4 + ldrh r0, [r0] + mov r1, r10 + strh r0, [r1] + mov r0, sp + adds r0, 0x6 + ldrh r0, [r0] + ldr r3, [sp, 0x20] + strh r0, [r3] + ldr r5, [sp, 0x24] + strb r4, [r5] + ldr r0, [sp, 0x28] + strb r2, [r0] + movs r0, 0x1 + b _081D9C80 +_081D9C7E: + movs r0, 0 +_081D9C80: + 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_81D9B68 + + thumb_func_start sub_81D9C90 +sub_81D9C90: @ 81D9C90 + push {r4-r7,lr} + adds r7, r0, 0 + mov r12, r1 + subs r3, r2, 0x1 + cmp r2, 0 + beq _081D9CD6 +_081D9C9C: + ldrb r1, [r7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 31 + mov r2, r12 + subs r2, 0x1 + subs r5, r3, 0x1 + cmp r2, 0 + blt _081D9CCC + movs r6, 0x80 + adds r3, r2, r7 +_081D9CB4: + ldrb r1, [r3] + adds r0, r6, 0 + ands r0, r1 + lsls r0, 24 + lsls r1, 1 + orrs r4, r1 + strb r4, [r3] + lsrs r4, r0, 31 + subs r3, 0x1 + subs r2, 0x1 + cmp r2, 0 + bge _081D9CB4 +_081D9CCC: + adds r3, r5, 0 + movs r0, 0x1 + negs r0, r0 + cmp r3, r0 + bne _081D9C9C +_081D9CD6: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81D9C90 + + thumb_func_start sub_81D9CDC +sub_81D9CDC: @ 81D9CDC + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r1, 0 + lsls r2, 24 + lsrs r3, r2, 24 + lsls r0, r3, 4 + orrs r3, r0 + lsls r0, r3, 24 + lsrs r3, r0, 24 + movs r4, 0 + cmp r4, r5 + bcs _081D9D04 +_081D9CF4: + adds r2, r6, r4 + ldrb r1, [r2] + adds r0, r3, 0 + eors r0, r1 + strb r0, [r2] + adds r4, 0x1 + cmp r4, r5 + bcc _081D9CF4 +_081D9D04: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81D9CDC + + thumb_func_start sub_81D9D0C +sub_81D9D0C: @ 81D9D0C + push {lr} + lsrs r3, r1, 3 + movs r2, 0x7 + ands r2, r1 + movs r1, 0x80 + asrs r1, r2 + adds r0, r3 + ldrb r0, [r0] + ands r0, r1 + cmp r0, 0 + beq _081D9D24 + movs r0, 0x1 +_081D9D24: + pop {r1} + bx r1 + thumb_func_end sub_81D9D0C + + thumb_func_start sub_81D9D28 +sub_81D9D28: @ 81D9D28 + lsrs r3, r1, 3 + movs r2, 0x7 + ands r2, r1 + movs r1, 0x80 + asrs r1, r2 + lsls r1, 24 + lsrs r1, 24 + adds r0, r3 + ldrb r2, [r0] + orrs r1, r2 + strb r1, [r0] + bx lr + thumb_func_end sub_81D9D28 + + thumb_func_start sub_81D9D40 +sub_81D9D40: @ 81D9D40 + lsrs r3, r1, 3 + movs r2, 0x7 + ands r2, r1 + movs r1, 0x80 + asrs r1, r2 + mvns r1, r1 + lsls r1, 24 + lsrs r1, 24 + adds r0, r3 + ldrb r2, [r0] + ands r1, r2 + strb r1, [r0] + bx lr + thumb_func_end sub_81D9D40 + + thumb_func_start sub_81D9D5C +sub_81D9D5C: @ 81D9D5C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r6, r0, 0 + mov r9, r1 + adds r1, r2, 0 + mov r8, r3 + ldr r7, [sp, 0x1C] + movs r5, 0 + cmp r5, r7 + bcs _081D9DA0 + adds r4, r1, 0 +_081D9D76: + mov r0, r8 + adds r1, r0, r5 + mov r0, r9 + bl sub_81D9D0C + lsls r0, 24 + cmp r0, 0 + beq _081D9D90 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_81D9D28 + b _081D9D98 +_081D9D90: + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_81D9D40 +_081D9D98: + adds r4, 0x1 + adds r5, 0x1 + cmp r5, r7 + bcc _081D9D76 +_081D9DA0: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81D9D5C + + thumb_func_start sub_81D9DAC +sub_81D9DAC: @ 81D9DAC + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + adds r7, r1, 0 + adds r6, r2, 0 + movs r4, 0 + movs r5, 0 + cmp r4, r6 + bcs _081D9DD6 +_081D9DC0: + lsls r4, 1 + adds r1, r7, r5 + mov r0, r8 + bl sub_81D9D0C + lsls r0, 24 + lsrs r0, 24 + orrs r4, r0 + adds r5, 0x1 + cmp r5, r6 + bcc _081D9DC0 +_081D9DD6: + adds r0, r4, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81D9DAC + + thumb_func_start sub_81D9DE4 +sub_81D9DE4: @ 81D9DE4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1A + ldrsh r0, [r0, r1] + cmp r0, 0x4 + bhi _081D9EA4 + lsls r0, 2 + ldr r1, =_081D9E10 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081D9E10: + .4byte _081D9E24 + .4byte _081D9E44 + .4byte _081D9E64 + .4byte _081D9E84 + .4byte _081D9EA4 +_081D9E24: + ldr r4, =0x02039f31 + ldr r0, =0x02039f24 + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x32 + b _081D9EB4 + .pool +_081D9E44: + ldr r4, =0x02039f31 + ldr r0, =0x02039f24 + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x33 + b _081D9EB4 + .pool +_081D9E64: + ldr r4, =0x02039f31 + ldr r0, =0x02039f24 + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x34 + b _081D9EB4 + .pool +_081D9E84: + ldr r4, =0x02039f31 + ldr r0, =0x02039f24 + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x35 + b _081D9EB4 + .pool +_081D9EA4: + ldr r4, =0x02039f31 + ldr r0, =0x02039f24 + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x36 +_081D9EB4: + bl pokemon_getattr + strb r0, [r4] + ldr r5, =0x02039e00 + ldr r4, =0x02039f25 + ldrb r0, [r4] + lsls r0, 6 + adds r0, r5 + ldr r1, =0x02039f31 + ldrb r1, [r1] + adds r0, 0x2C + strb r1, [r0] + ldr r0, =0x00000864 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + negs r0, r0 + lsrs r0, 31 + ldrb r1, [r4] + lsls r1, 6 + adds r1, r5 + adds r1, 0x2D + strb r0, [r1] + ldr r1, =sub_81DA160 + ldr r2, =sub_81D9F14 + adds r0, r6, 0 + bl set_task_function_and_args_14_15 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D9DE4 + + thumb_func_start sub_81D9F14 +sub_81D9F14: @ 81D9F14 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =sub_81DA244 + ldr r2, =sub_81D9F30 + bl set_task_function_and_args_14_15 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D9F14 + + thumb_func_start sub_81D9F30 +sub_81D9F30: @ 81D9F30 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =sub_81DA2E8 + ldr r2, =sub_81D9F4C + bl set_task_function_and_args_14_15 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D9F30 + + thumb_func_start sub_81D9F4C +sub_81D9F4C: @ 81D9F4C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =sub_81DA3B8 + ldr r2, =sub_81D9F68 + bl set_task_function_and_args_14_15 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D9F4C + + thumb_func_start sub_81D9F68 +sub_81D9F68: @ 81D9F68 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + movs r3, 0 + ldr r5, =0x02039f30 + mov r8, r5 + ldr r0, =0x020375e0 + mov r12, r0 + add r1, sp, 0x4 + mov r9, r1 + ldrb r4, [r5] + cmp r3, r4 + bcs _081D9FB2 + lsls r0, r6, 2 + adds r0, r6 + lsls r4, r0, 3 + ldr r7, =0x03005e08 +_081D9F98: + mov r0, sp + adds r2, r0, r3 + adds r1, r3, 0x1 + lsls r0, r1, 1 + adds r0, r4 + adds r0, r7 + ldrh r0, [r0] + strb r0, [r2] + lsls r1, 24 + lsrs r3, r1, 24 + ldrb r1, [r5] + cmp r3, r1 + bcc _081D9F98 +_081D9FB2: + movs r3, 0 + mov r4, r8 + ldrb r0, [r4] + cmp r3, r0 + bcs _081D9FD6 + adds r4, r0, 0 + mov r2, sp +_081D9FC0: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r4 + bcs _081D9FD6 + mov r7, sp + adds r1, r7, r3 + ldrb r0, [r2] + ldrb r1, [r1] + cmp r0, r1 + beq _081D9FC0 +_081D9FD6: + mov r0, r8 + ldrb r0, [r0] + cmp r3, r0 + bne _081D9FF4 + movs r0, 0 + mov r1, r12 + strh r0, [r1] + b _081D9FFA + .pool +_081D9FF4: + movs r0, 0x1 + mov r4, r12 + strh r0, [r4] +_081D9FFA: + movs r3, 0 + mov r7, r8 + mov r0, r8 + ldrb r0, [r0] + cmp r3, r0 + bcs _081DA02A + mov r4, r9 + lsls r0, r6, 2 + adds r0, r6 + lsls r2, r0, 3 + ldr r5, =0x03005e08 +_081DA010: + adds r1, r4, r3 + adds r0, r3, 0x5 + lsls r0, 1 + adds r0, r2 + adds r0, r5 + ldrh r0, [r0] + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + ldrb r1, [r7] + cmp r3, r1 + bcc _081DA010 +_081DA02A: + mov r4, r8 + ldrb r0, [r4] + cmp r0, 0x4 + beq _081DA0B8 + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _081DA0B8 + ldr r0, =0x02039e00 + adds r1, r0, 0 + adds r1, 0x2C + ldrb r2, [r1] + movs r3, 0x1 + ldrb r1, [r4] + adds r5, r0, 0 + cmp r3, r1 + bcs _081DA06C + adds r4, r5, 0 + mov r7, r8 + ldrb r1, [r7] +_081DA054: + lsls r0, r3, 6 + adds r0, r4 + adds r0, 0x2C + ldrb r7, [r0] + cmp r2, r7 + bcs _081DA062 + ldrb r2, [r0] +_081DA062: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r1 + bcc _081DA054 +_081DA06C: + cmp r2, 0 + beq _081DA076 + subs r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 +_081DA076: + movs r4, 0x1 + movs r3, 0 + mov r0, r8 + ldrb r0, [r0] + cmp r3, r0 + bcs _081DA0AC + adds r0, r5, 0 + b _081DA0A2 + .pool +_081DA090: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + mov r1, r8 + ldrb r1, [r1] + cmp r3, r1 + bcs _081DA0AC + lsls r0, r3, 6 + adds r0, r5 +_081DA0A2: + adds r0, 0x2D + ldrb r0, [r0] + cmp r0, 0 + bne _081DA090 + movs r4, 0 +_081DA0AC: + mov r0, sp + ldrb r0, [r0] + adds r1, r2, 0 + adds r2, r4, 0 + bl sub_80DACBC +_081DA0B8: + mov r0, r9 + bl sub_80F86E0 + ldr r1, =0x02039f2b + strb r0, [r1] + ldr r0, =0x02039f30 + ldrb r0, [r0] + cmp r0, 0x3 + bhi _081DA0E8 + ldr r1, =sub_81DA488 + ldr r2, =sub_81DA10C + adds r0, r6, 0 + bl set_task_function_and_args_14_15 + b _081DA0F6 + .pool +_081DA0E8: + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81DA10C + str r0, [r1] +_081DA0F6: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81D9F68 + + thumb_func_start sub_81DA10C +sub_81DA10C: @ 81DA10C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x02039f2c + ldrb r0, [r0] + bl sub_80DB09C + ldr r1, =sub_80FCF40 + ldr r2, =sub_81DA138 + adds r0, r4, 0 + bl set_task_function_and_args_14_15 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81DA10C + + thumb_func_start sub_81DA138 +sub_81DA138: @ 81DA138 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + bl sub_80DCE58 + ldr r1, =sub_80FCFD0 + ldr r2, =sub_80F8714 + adds r0, r4, 0 + bl set_task_function_and_args_14_15 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81DA138 + + thumb_func_start sub_81DA160 +sub_81DA160: @ 81DA160 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r6, r7, 2 + adds r0, r6, r7 + lsls r4, r0, 3 + ldr r5, =0x03005e08 + adds r0, r4, r5 + adds r0, 0x18 + bl sub_80FC670 + cmp r0, 0 + beq _081DA224 + adds r0, r5, 0 + subs r0, 0x8 + adds r4, r0 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081DA1A4 + cmp r0, 0x1 + beq _081DA1D4 + movs r0, 0 + strh r0, [r4, 0x8] + strh r0, [r4, 0x20] + adds r0, r7, 0 + bl set_task_function_to_args_14_15 + b _081DA224 + .pool +_081DA1A4: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _081DA224 + ldr r0, =0x02039f25 + ldrb r0, [r0] + lsls r0, 6 + ldr r1, =0x02039e00 + adds r0, r1 + movs r1, 0x40 + bl sub_80FC4F4 + cmp r0, 0x1 + bne _081DA224 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _081DA224 + .pool +_081DA1D4: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + beq _081DA224 + movs r5, 0 + ldr r0, =0x02039f30 + mov r8, r6 + ldrb r0, [r0] + cmp r5, r0 + bge _081DA214 + ldr r6, =0x020229e8 +_081DA1EC: + lsls r4, r5, 6 + ldr r0, =0x02039e00 + adds r4, r0 + lsls r1, r5, 8 + ldr r0, =0x020223c4 + adds r1, r0 + adds r0, r4, 0 + movs r2, 0x40 + bl memcpy + ldrh r1, [r6, 0x1A] + adds r0, r4, 0 + bl sub_80DFA08 + adds r6, 0x1C + adds r5, 0x1 + ldr r0, =0x02039f30 + ldrb r0, [r0] + cmp r5, r0 + blt _081DA1EC +_081DA214: + ldr r0, =0x03005e00 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_081DA224: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81DA160 + + thumb_func_start sub_81DA244 +sub_81DA244: @ 81DA244 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r5, r0, 3 + ldr r6, =0x03005e08 + adds r0, r5, r6 + adds r0, 0x18 + bl sub_80FC670 + cmp r0, 0 + beq _081DA2D4 + adds r0, r6, 0 + subs r0, 0x8 + adds r5, r0 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _081DA284 + cmp r0, 0x1 + beq _081DA2AC + movs r0, 0 + strh r0, [r5, 0x8] + strh r0, [r5, 0x20] + adds r0, r4, 0 + bl set_task_function_to_args_14_15 + b _081DA2D4 + .pool +_081DA284: + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _081DA2CE + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _081DA2D4 + ldr r0, =0x03005d80 + movs r1, 0x4 + bl sub_80FC4F4 + cmp r0, 0x1 + bne _081DA2D4 + b _081DA2CE + .pool +_081DA2AC: + movs r0, 0 + bl sub_80FC530 + lsls r0, 24 + cmp r0, 0 + beq _081DA2D4 + ldr r0, =0x03005d80 + ldr r4, =0x020223c4 + adds r1, r4, 0 + movs r2, 0x4 + bl memcpy + ldr r0, =0x030060b8 + adds r1, r4, 0 + movs r2, 0x4 + bl memcpy +_081DA2CE: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] +_081DA2D4: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81DA244 + + thumb_func_start sub_81DA2E8 +sub_81DA2E8: @ 81DA2E8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + mov r9, r0 + adds r0, r6 + lsls r5, r0, 3 + ldr r1, =0x03005e08 + mov r8, r1 + adds r0, r5, r1 + adds r0, 0x18 + bl sub_80FC670 + cmp r0, 0 + beq _081DA39E + movs r0, 0x8 + negs r0, r0 + add r0, r8 + mov r10, r0 + adds r4, r5, r0 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081DA338 + cmp r0, 0x1 + beq _081DA35A + movs r0, 0 + strh r0, [r4, 0x8] + strh r0, [r4, 0x20] + adds r0, r6, 0 + bl set_task_function_to_args_14_15 + b _081DA39E + .pool +_081DA338: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _081DA39E + add r0, sp, 0x8 + movs r1, 0x6E + strh r1, [r0] + movs r1, 0x2 + bl sub_80FC4F4 + cmp r0, 0x1 + bne _081DA39E + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _081DA39E +_081DA35A: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + beq _081DA39E + movs r1, 0 + ldr r7, =0x02039f30 + ldrb r0, [r7] + cmp r1, r0 + bge _081DA390 + mov r0, r8 + adds r0, 0xA + adds r3, r5, r0 + ldr r4, =0x020223c4 + mov r2, sp + movs r5, 0x80 + lsls r5, 1 +_081DA37C: + ldrh r0, [r4] + strh r0, [r2] + strh r0, [r3] + adds r3, 0x2 + adds r4, r5 + adds r2, 0x2 + adds r1, 0x1 + ldrb r0, [r7] + cmp r1, r0 + blt _081DA37C +_081DA390: + mov r0, r9 + adds r1, r0, r6 + lsls r1, 3 + add r1, r10 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_081DA39E: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81DA2E8 + + thumb_func_start sub_81DA3B8 +sub_81DA3B8: @ 81DA3B8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + mov r9, r0 + adds r0, r6 + lsls r5, r0, 3 + ldr r1, =0x03005e08 + mov r8, r1 + adds r0, r5, r1 + adds r0, 0x18 + bl sub_80FC670 + cmp r0, 0 + beq _081DA46E + movs r0, 0x8 + negs r0, r0 + add r0, r8 + mov r10, r0 + adds r4, r5, r0 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081DA408 + cmp r0, 0x1 + beq _081DA42A + movs r0, 0 + strh r0, [r4, 0x8] + strh r0, [r4, 0x20] + adds r0, r6, 0 + bl set_task_function_to_args_14_15 + b _081DA46E + .pool +_081DA408: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _081DA46E + ldrh r1, [r4, 0x1A] + add r0, sp, 0x8 + strh r1, [r0] + movs r1, 0x2 + bl sub_80FC4F4 + cmp r0, 0x1 + bne _081DA46E + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _081DA46E +_081DA42A: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + beq _081DA46E + movs r1, 0 + ldr r7, =0x02039f30 + ldrb r0, [r7] + cmp r1, r0 + bge _081DA460 + mov r0, r8 + adds r0, 0x2 + adds r3, r5, r0 + ldr r4, =0x020223c4 + mov r2, sp + movs r5, 0x80 + lsls r5, 1 +_081DA44C: + ldrh r0, [r4] + strh r0, [r2] + strh r0, [r3] + adds r3, 0x2 + adds r4, r5 + adds r2, 0x2 + adds r1, 0x1 + ldrb r0, [r7] + cmp r1, r0 + blt _081DA44C +_081DA460: + mov r0, r9 + adds r1, r0, r6 + lsls r1, 3 + add r1, r10 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_081DA46E: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81DA3B8 + + thumb_func_start sub_81DA488 +sub_81DA488: @ 81DA488 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r7, r6, 2 + adds r0, r7, r6 + lsls r4, r0, 3 + ldr r5, =0x03005e08 + adds r0, r4, r5 + adds r0, 0x18 + bl sub_80FC670 + cmp r0, 0 + beq _081DA55C + adds r0, r5, 0 + subs r0, 0x8 + adds r4, r0 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081DA4CC + cmp r0, 0x1 + beq _081DA50C + movs r0, 0 + strh r0, [r4, 0x8] + strh r0, [r4, 0x20] + adds r0, r6, 0 + bl set_task_function_to_args_14_15 + b _081DA55C + .pool +_081DA4CC: + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _081DA4FA + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _081DA55C + ldr r0, =0x02039f30 + ldrb r2, [r0] + lsls r0, r2, 6 + ldr r1, =0x02039e00 + adds r0, r1 + movs r1, 0x4 + subs r1, r2 + lsls r1, 22 + lsrs r1, 16 + bl sub_80FC4F4 + cmp r0, 0x1 + bne _081DA55C +_081DA4FA: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _081DA55C + .pool +_081DA50C: + movs r0, 0 + bl sub_80FC530 + lsls r0, 24 + cmp r0, 0 + beq _081DA55C + ldr r4, =0x02039f30 + ldrb r3, [r4] + lsls r0, r3, 6 + ldr r5, =0x02039e00 + adds r0, r5 + ldr r1, =0x020223c4 + movs r2, 0x4 + subs r2, r3 + lsls r2, 6 + bl memcpy + ldrb r4, [r4] + mov r8, r7 + cmp r4, 0x3 + bgt _081DA54C + lsls r0, r4, 6 + adds r5, r0, r5 + ldr r7, =0x020229e8 +_081DA53C: + ldrh r1, [r7, 0x1A] + adds r0, r5, 0 + bl sub_80DFA08 + adds r5, 0x40 + adds r4, 0x1 + cmp r4, 0x3 + ble _081DA53C +_081DA54C: + ldr r0, =0x03005e00 + mov r2, r8 + adds r1, r2, r6 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_081DA55C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81DA488 + + thumb_func_start sub_81DA57C +sub_81DA57C: @ 81DA57C + push {lr} + ldr r0, =0x00000864 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _081DA5CA + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1E + bhi _081DA5CA + movs r0, 0x5B + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _081DA5C0 + ldr r0, =gUnknown_0862AD34 + movs r1, 0x8 + movs r2, 0x5 + bl sub_81DA5D4 + b _081DA5CA + .pool +_081DA5C0: + ldr r0, =gUnknown_0862AD44 + movs r1, 0x7 + movs r2, 0x1 + bl sub_81DA5D4 +_081DA5CA: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81DA57C + + thumb_func_start sub_81DA5D4 +sub_81DA5D4: @ 81DA5D4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + mov r9, r0 + adds r7, r1, 0 + mov r10, r2 + movs r6, 0 + movs r0, 0x5 + mov r8, r0 + movs r5, 0 + cmp r5, r7 + bcs _081DA61C + mov r4, r9 +_081DA5F4: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r1, [r4] + ldr r2, =0x000009ca + adds r0, r2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _081DA614 + adds r0, r1, 0 + bl sub_81DA6CC + cmp r8, r0 + ble _081DA612 + mov r8, r0 +_081DA612: + adds r6, 0x1 +_081DA614: + adds r4, 0x2 + adds r5, 0x1 + cmp r5, r7 + bcc _081DA5F4 +_081DA61C: + cmp r6, 0 + beq _081DA6BA + cmp r8, r10 + bhi _081DA6BA + movs r6, 0 + movs r5, 0 + cmp r5, r7 + bcs _081DA654 + mov r4, r9 +_081DA62E: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r1, [r4] + ldr r2, =0x000009ca + adds r0, r2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _081DA64C + adds r0, r1, 0 + bl sub_81DA6CC + cmp r0, r8 + bne _081DA64C + adds r6, 0x1 +_081DA64C: + adds r4, 0x2 + adds r5, 0x1 + cmp r5, r7 + bcc _081DA62E +_081DA654: + cmp r6, 0 + beq _081DA6BA + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __modsi3 + adds r6, r0, 0 + movs r5, 0 + cmp r5, r7 + bcs _081DA6BA + ldr r2, =0x03005d8c + ldr r3, =0x000009ca + mov r4, r9 +_081DA674: + ldr r0, [r2] + ldrh r1, [r4] + adds r0, r3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _081DA6B2 + adds r0, r1, 0 + str r2, [sp] + str r3, [sp, 0x4] + bl sub_81DA6CC + ldr r2, [sp] + ldr r3, [sp, 0x4] + cmp r0, r8 + bne _081DA6B2 + cmp r6, 0 + bne _081DA6B0 + ldr r0, [r2] + adds r0, r3 + ldrh r4, [r4] + adds r0, r4 + mov r1, r8 + strb r1, [r0] + b _081DA6BA + .pool +_081DA6B0: + subs r6, 0x1 +_081DA6B2: + adds r4, 0x2 + adds r5, 0x1 + cmp r5, r7 + bcc _081DA674 +_081DA6BA: + 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_81DA5D4 + + thumb_func_start sub_81DA6CC +sub_81DA6CC: @ 81DA6CC + push {r4-r6,lr} + adds r5, r0, 0 + movs r4, 0 + ldr r6, =gUnknown_085500A4 +_081DA6D4: + lsls r0, r4, 1 + lsls r1, r5, 4 + adds r0, r1 + adds r0, r6 + ldrh r0, [r0] + bl trainer_flag_check + lsls r0, 24 + cmp r0, 0 + bne _081DA6F0 + adds r0, r4, 0 + b _081DA6F8 + .pool +_081DA6F0: + adds r4, 0x1 + cmp r4, 0x4 + ble _081DA6D4 + movs r0, 0x5 +_081DA6F8: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81DA6CC + + thumb_func_start sub_81DA700 +sub_81DA700: @ 81DA700 + push {lr} + sub sp, 0x8 + add r1, sp, 0x4 + mov r0, sp + bl sub_8149F58 + ldr r0, =gUnknown_0862AD54 + ldr r1, [sp, 0x4] + bl LZ77UnCompVram + ldr r0, =gUnknown_0862AF30 + ldr r1, [sp] + bl LZ77UnCompVram + ldr r0, =gUnknown_0862B53C + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_0862B724 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0862B72C + bl LoadTaggedObjectPalette + add sp, 0x8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81DA700 + + thumb_func_start sub_81DA74C +sub_81DA74C: @ 81DA74C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + ldr r0, [sp, 0x24] + ldr r1, [sp, 0x28] + ldr r4, [sp, 0x2C] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp] + lsls r3, 24 + lsrs r3, 24 + mov r10, r3 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + lsls r4, 24 + lsrs r7, r4, 24 + ldr r0, =gUnknown_0862B758 + lsls r5, 16 + asrs r5, 16 + lsls r6, 16 + asrs r6, 16 + adds r1, r5, 0 + adds r2, r6, 0 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r5, r0, 24 + cmp r7, 0x1 + beq _081DA7D0 + cmp r7, 0x1 + bgt _081DA7A8 + cmp r7, 0 + beq _081DA7B8 + b _081DA7AC + .pool +_081DA7A8: + cmp r7, 0x2 + beq _081DA7E4 +_081DA7AC: + ldr r6, =0x02020630 + lsls r3, r5, 4 + b _081DA7F8 + .pool +_081DA7B8: + ldr r2, =0x02020630 + lsls r3, r5, 4 + adds r0, r3, r5 + lsls r0, 2 + adds r0, r2 + movs r1, 0x78 + strh r1, [r0, 0x2E] + movs r1, 0x2D + b _081DA7F4 + .pool +_081DA7D0: + ldr r2, =0x02020630 + lsls r3, r5, 4 + adds r0, r3, r5 + lsls r0, 2 + adds r0, r2 + movs r1, 0x59 + b _081DA7F0 + .pool +_081DA7E4: + ldr r2, =0x02020630 + lsls r3, r5, 4 + adds r0, r3, r5 + lsls r0, 2 + adds r0, r2 + movs r1, 0x97 +_081DA7F0: + strh r1, [r0, 0x2E] + movs r1, 0x61 +_081DA7F4: + strh r1, [r0, 0x30] + adds r6, r2, 0 +_081DA7F8: + adds r4, r3, r5 + lsls r4, 2 + adds r0, r4, r6 + mov r2, r8 + lsls r1, r2, 24 + asrs r1, 24 + movs r2, 0 + strh r1, [r0, 0x32] + mov r3, r9 + lsls r1, r3, 24 + asrs r1, 24 + strh r1, [r0, 0x34] + mov r1, sp + ldrh r1, [r1] + strh r1, [r0, 0x3A] + mov r3, r10 + strh r3, [r0, 0x3C] + strh r2, [r0, 0x36] + strh r2, [r0, 0x38] + adds r1, r7, 0 + bl StartObjectImageAnim + adds r0, r6, 0 + adds r0, 0x1C + adds r4, r0 + ldr r0, =sub_81DA848 + str r0, [r4] + adds r0, r5, 0 + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81DA74C + + thumb_func_start sub_81DA848 +sub_81DA848: @ 81DA848 + push {r4,r5,lr} + adds r3, r0, 0 + adds r2, r3, 0 + adds r2, 0x2E + movs r0, 0x20 + ldrsh r1, [r3, r0] + movs r4, 0x2E + ldrsh r0, [r3, r4] + cmp r1, r0 + bne _081DA874 + movs r5, 0x22 + ldrsh r1, [r3, r5] + movs r4, 0x2 + ldrsh r0, [r2, r4] + cmp r1, r0 + bne _081DA874 + ldr r0, =DummyObjectCallback + str r0, [r3, 0x1C] + b _081DA8B4 + .pool +_081DA874: + ldrh r4, [r2, 0x8] + movs r5, 0x8 + ldrsh r1, [r2, r5] + movs r5, 0xC + ldrsh r0, [r2, r5] + cmp r1, r0 + bne _081DA890 + ldrh r0, [r2, 0x4] + ldrh r1, [r3, 0x20] + adds r0, r1 + movs r1, 0 + strh r0, [r3, 0x20] + strh r1, [r2, 0x8] + b _081DA894 +_081DA890: + adds r0, r4, 0x1 + strh r0, [r2, 0x8] +_081DA894: + ldrh r4, [r2, 0xA] + movs r5, 0xA + ldrsh r1, [r2, r5] + movs r5, 0xE + ldrsh r0, [r2, r5] + cmp r1, r0 + bne _081DA8B0 + ldrh r0, [r2, 0x6] + ldrh r1, [r3, 0x22] + adds r0, r1 + movs r1, 0 + strh r0, [r3, 0x22] + strh r1, [r2, 0xA] + b _081DA8B4 +_081DA8B0: + adds r0, r4, 0x1 + strh r0, [r2, 0xA] +_081DA8B4: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81DA848 + + thumb_func_start sub_81DA8BC +sub_81DA8BC: @ 81DA8BC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + adds r6, r0, 0 + mov r8, r1 + ldr r0, [sp, 0x2C] + ldr r1, [sp, 0x30] + ldr r4, [sp, 0x34] + ldr r5, [sp, 0x38] + lsls r2, 16 + lsrs r2, 16 + str r2, [sp] + lsls r3, 16 + lsrs r3, 16 + str r3, [sp, 0x4] + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + lsls r4, 16 + lsrs r7, r4, 16 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_0862B758 + lsls r6, 16 + asrs r6, 16 + mov r1, r8 + lsls r1, 16 + asrs r1, 16 + mov r8, r1 + adds r1, r6, 0 + mov r2, r8 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + cmp r5, 0x1 + beq _081DA94C + cmp r5, 0x1 + bgt _081DA924 + cmp r5, 0 + beq _081DA934 + b _081DA928 + .pool +_081DA924: + cmp r5, 0x2 + beq _081DA960 +_081DA928: + ldr r2, =0x02020630 + lsls r3, r6, 4 + b _081DA972 + .pool +_081DA934: + ldr r2, =0x02020630 + lsls r3, r6, 4 + adds r0, r3, r6 + lsls r0, 2 + adds r0, r2 + movs r1, 0x78 + strh r1, [r0, 0x2E] + movs r1, 0x2D + b _081DA970 + .pool +_081DA94C: + ldr r2, =0x02020630 + lsls r3, r6, 4 + adds r0, r3, r6 + lsls r0, 2 + adds r0, r2 + movs r1, 0x59 + b _081DA96C + .pool +_081DA960: + ldr r2, =0x02020630 + lsls r3, r6, 4 + adds r0, r3, r6 + lsls r0, 2 + adds r0, r2 + movs r1, 0x97 +_081DA96C: + strh r1, [r0, 0x2E] + movs r1, 0x61 +_081DA970: + strh r1, [r0, 0x30] +_081DA972: + adds r4, r3, r6 + lsls r4, 2 + adds r0, r4, r2 + mov r3, sp + ldrh r3, [r3] + strh r3, [r0, 0x32] + mov r1, sp + ldrh r1, [r1, 0x4] + strh r1, [r0, 0x34] + mov r3, r10 + strh r3, [r0, 0x36] + mov r1, r9 + strh r1, [r0, 0x38] + strh r7, [r0, 0x3A] + adds r1, r5, 0 + str r2, [sp, 0x8] + bl StartObjectImageAnim + ldr r2, [sp, 0x8] + adds r0, r2, 0 + adds r0, 0x1C + adds r4, r0 + ldr r0, =sub_81DA9BC + str r0, [r4] + adds r0, r6, 0 + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81DA8BC + + thumb_func_start sub_81DA9BC +sub_81DA9BC: @ 81DA9BC + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x32] + bl sine2 + lsls r0, 16 + asrs r0, 16 + movs r2, 0x36 + ldrsh r1, [r4, r2] + muls r0, r1 + asrs r0, 12 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x32] + bl cosine2 + lsls r0, 16 + asrs r0, 16 + movs r3, 0x36 + ldrsh r1, [r4, r3] + muls r0, r1 + asrs r0, 12 + strh r0, [r4, 0x26] + movs r1, 0x32 + ldrsh r0, [r4, r1] + movs r2, 0x34 + ldrsh r1, [r4, r2] + adds r0, r1 + movs r1, 0xB4 + lsls r1, 1 + bl __modsi3 + strh r0, [r4, 0x32] + ldrh r2, [r4, 0x36] + movs r3, 0x36 + ldrsh r1, [r4, r3] + movs r3, 0x38 + ldrsh r0, [r4, r3] + cmp r1, r0 + beq _081DAA12 + ldrh r0, [r4, 0x3A] + adds r0, r2, r0 + strh r0, [r4, 0x36] + b _081DAA16 +_081DAA12: + ldr r0, =DummyObjectCallback + str r0, [r4, 0x1C] +_081DAA16: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81DA9BC + + thumb_func_start sub_81DAA20 +sub_81DAA20: @ 81DAA20 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x00002e90 + adds r0, r4, 0 + bl FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + movs r0, 0x10 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl RemoveObjectAndFreeTiles + movs r0, 0x12 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + movs r0, 0x14 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81DAA20 + + thumb_func_start sub_81DAA74 +sub_81DAA74: @ 81DAA74 + push {r4,r5,lr} + adds r3, r0, 0 + ldr r2, =0x02020630 + movs r0, 0x10 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r5, r2, 0 + adds r5, 0x1C + adds r0, r5 + ldr r4, [r0] + ldr r0, =DummyObjectCallback + cmp r4, r0 + bne _081DAAC4 + movs r0, 0x12 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r2, [r0] + cmp r2, r4 + bne _081DAAC4 + movs r1, 0x14 + ldrsh r0, [r3, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldr r0, [r1] + cmp r0, r2 + bne _081DAAC4 + movs r0, 0x1 + b _081DAAC6 + .pool +_081DAAC4: + movs r0, 0 +_081DAAC6: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81DAA74 + + thumb_func_start sub_81DAACC +sub_81DAACC: @ 81DAACC + push {r4,lr} + adds r4, r0, 0 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081DAB20 + bl sub_81DA700 + ldr r1, =0x00003f41 + movs r0, 0x50 + bl SetGpuReg + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r1, 0xA0 + lsls r1, 3 + movs r0, 0 + movs r2, 0x2 + bl ChangeBgY + movs r0, 0 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x1 + b _081DAB46 + .pool +_081DAB20: + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl ClearGpuRegBits + movs r1, 0x80 + lsls r1, 7 + movs r0, 0 + bl ClearGpuRegBits + movs r1, 0x80 + lsls r1, 1 + movs r0, 0 + bl ClearGpuRegBits + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + movs r0, 0 +_081DAB46: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81DAACC + + thumb_func_start sub_81DAB4C +sub_81DAB4C: @ 81DAB4C + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081DAB64 + movs r1, 0x80 + lsls r1, 1 + movs r0, 0 + bl SetGpuRegBits +_081DAB64: + ldrh r1, [r4, 0xC] + movs r2, 0xC + ldrsh r0, [r4, r2] + cmp r0, 0x10 + bne _081DAB98 + ldrh r1, [r4, 0xE] + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r0, 0x1F + bne _081DAB92 + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _081DABB0 +_081DAB92: + adds r0, r1, 0x1 + strh r0, [r4, 0xE] + b _081DABB0 +_081DAB98: + adds r0, r1, 0x1 + strh r0, [r4, 0xC] + ldrh r1, [r4, 0xC] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg +_081DABB0: + movs r0, 0 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81DAB4C + + thumb_func_start sub_81DABBC +sub_81DABBC: @ 81DABBC + push {r4,lr} + adds r4, r0, 0 + bl sub_81DAA74 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081DABD2 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_081DABD2: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81DABBC + + thumb_func_start sub_81DABDC +sub_81DABDC: @ 81DABDC + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_0862B770 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_081DABEE: + movs r1, 0x8 + ldrsh r0, [r4, r1] + lsls r0, 2 + adds r0, r5 + ldr r1, [r0] + adds r0, r4, 0 + bl _call_via_r1 + lsls r0, 24 + cmp r0, 0 + bne _081DABEE + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81DABDC + + thumb_func_start sub_81DAC14 +sub_81DAC14: @ 81DAC14 + push {r4-r6,lr} + sub sp, 0xC + adds r6, r0, 0 + movs r1, 0x33 + negs r1, r1 + movs r0, 0 + str r0, [sp] + movs r5, 0x2 + str r5, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x78 + movs r2, 0 + movs r3, 0 + bl sub_81DA74C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x10] + movs r0, 0x7 + negs r0, r0 + str r5, [sp] + movs r4, 0x2 + negs r4, r4 + str r4, [sp, 0x4] + movs r1, 0x1 + str r1, [sp, 0x8] + movs r1, 0xC1 + movs r2, 0 + movs r3, 0 + bl sub_81DA74C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x12] + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0xF7 + movs r1, 0xC1 + movs r2, 0 + movs r3, 0 + bl sub_81DA74C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x14] + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + movs r0, 0 + add sp, 0xC + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81DAC14 + + thumb_func_start sub_81DAC80 +sub_81DAC80: @ 81DAC80 + push {lr} + adds r2, r0, 0 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081DACA4 + adds r0, r2, 0 + bl sub_81DAA20 + ldr r0, =sub_81DABDC + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_081DACA4: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81DAC80 + + thumb_func_start sub_81DACB4 +sub_81DACB4: @ 81DACB4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_0862B784 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_081DACC6: + movs r1, 0x8 + ldrsh r0, [r4, r1] + lsls r0, 2 + adds r0, r5 + ldr r1, [r0] + adds r0, r4, 0 + bl _call_via_r1 + lsls r0, 24 + cmp r0, 0 + bne _081DACC6 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81DACB4 + + thumb_func_start sub_81DACEC +sub_81DACEC: @ 81DACEC + push {r4,r5,lr} + sub sp, 0xC + adds r5, r0, 0 + movs r0, 0 + str r0, [sp] + movs r4, 0x4 + negs r4, r4 + str r4, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x78 + movs r1, 0xC5 + movs r2, 0 + movs r3, 0 + bl sub_81DA74C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x10] + str r4, [sp] + movs r4, 0x2 + str r4, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + movs r0, 0xF1 + movs r1, 0x3B + movs r2, 0 + movs r3, 0x1 + bl sub_81DA74C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x12] + movs r0, 0x1 + negs r0, r0 + movs r1, 0x4 + str r1, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x3B + movs r2, 0 + movs r3, 0x1 + bl sub_81DA74C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x14] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0 + add sp, 0xC + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81DACEC + + thumb_func_start sub_81DAD58 +sub_81DAD58: @ 81DAD58 + push {lr} + adds r2, r0, 0 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081DAD7C + adds r0, r2, 0 + bl sub_81DAA20 + ldr r0, =sub_81DACB4 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_081DAD7C: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81DAD58 + + thumb_func_start sub_81DAD8C +sub_81DAD8C: @ 81DAD8C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_0862B798 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_081DAD9E: + movs r1, 0x8 + ldrsh r0, [r4, r1] + lsls r0, 2 + adds r0, r5 + ldr r1, [r0] + adds r0, r4, 0 + bl _call_via_r1 + lsls r0, 24 + cmp r0, 0 + bne _081DAD9E + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81DAD8C + + thumb_func_start sub_81DADC4 +sub_81DADC4: @ 81DADC4 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x10 + mov r8, r0 + movs r6, 0x80 + str r6, [sp] + movs r4, 0 + str r4, [sp, 0x4] + movs r5, 0x4 + negs r5, r5 + str r5, [sp, 0x8] + str r4, [sp, 0xC] + movs r0, 0x78 + movs r1, 0x2D + movs r2, 0xC + movs r3, 0x4 + bl sub_81DA8BC + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + strh r0, [r1, 0x10] + str r6, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + str r0, [sp, 0xC] + movs r0, 0x59 + movs r1, 0x61 + movs r2, 0xFC + movs r3, 0x4 + bl sub_81DA8BC + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + strh r0, [r1, 0x12] + str r6, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x2 + str r0, [sp, 0xC] + movs r0, 0x97 + movs r1, 0x61 + movs r2, 0x84 + movs r3, 0x4 + bl sub_81DA8BC + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + strh r0, [r1, 0x14] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + movs r0, 0 + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81DADC4 + + thumb_func_start sub_81DAE44 +sub_81DAE44: @ 81DAE44 + push {lr} + adds r2, r0, 0 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081DAE68 + adds r0, r2, 0 + bl sub_81DAA20 + ldr r0, =sub_81DAD8C + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_081DAE68: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81DAE44 + + thumb_func_start sub_81DAE78 +sub_81DAE78: @ 81DAE78 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_0862B7AC + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_081DAE8A: + movs r1, 0x8 + ldrsh r0, [r4, r1] + lsls r0, 2 + adds r0, r5 + ldr r1, [r0] + adds r0, r4, 0 + bl _call_via_r1 + lsls r0, 24 + cmp r0, 0 + bne _081DAE8A + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81DAE78 + + thumb_func_start sub_81DAEB0 +sub_81DAEB0: @ 81DAEB0 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x10 + mov r8, r0 + movs r2, 0x8E + lsls r2, 1 + movs r6, 0x83 + str r6, [sp] + movs r5, 0x23 + str r5, [sp, 0x4] + movs r4, 0x3 + negs r4, r4 + str r4, [sp, 0x8] + movs r0, 0 + str r0, [sp, 0xC] + movs r0, 0x78 + movs r1, 0x50 + movs r3, 0x8 + bl sub_81DA8BC + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + strh r0, [r1, 0x10] + str r6, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + str r0, [sp, 0xC] + movs r0, 0x78 + movs r1, 0x50 + movs r2, 0x2C + movs r3, 0x8 + bl sub_81DA8BC + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + strh r0, [r1, 0x12] + str r6, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x2 + str r0, [sp, 0xC] + movs r0, 0x79 + movs r1, 0x50 + movs r2, 0xA4 + movs r3, 0x8 + bl sub_81DA8BC + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + strh r0, [r1, 0x14] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + movs r0, 0 + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81DAEB0 + + thumb_func_start sub_81DAF34 +sub_81DAF34: @ 81DAF34 + push {lr} + adds r2, r0, 0 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081DAF58 + adds r0, r2, 0 + bl sub_81DAA20 + ldr r0, =sub_81DAE78 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_081DAF58: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81DAF34 + + thumb_func_start sub_81DAF68 +sub_81DAF68: @ 81DAF68 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_0862B7C0 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_081DAF7A: + movs r1, 0x8 + ldrsh r0, [r4, r1] + lsls r0, 2 + adds r0, r5 + ldr r1, [r0] + adds r0, r4, 0 + bl _call_via_r1 + lsls r0, 24 + cmp r0, 0 + bne _081DAF7A + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81DAF68 + + thumb_func_start sub_81DAFA0 +sub_81DAFA0: @ 81DAFA0 + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + movs r0, 0xA + ldrsh r2, [r4, r0] + cmp r2, 0 + bne _081DAFCC + movs r1, 0x33 + negs r1, r1 + str r2, [sp] + movs r0, 0x4 + str r0, [sp, 0x4] + str r2, [sp, 0x8] + movs r0, 0x78 + movs r2, 0 + movs r3, 0 + bl sub_81DA74C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x10] + b _081DB01A +_081DAFCC: + cmp r2, 0x10 + bne _081DAFF2 + movs r0, 0x7 + negs r0, r0 + movs r1, 0x4 + str r1, [sp] + subs r1, 0x8 + str r1, [sp, 0x4] + movs r1, 0x1 + str r1, [sp, 0x8] + movs r1, 0xC1 + movs r2, 0 + movs r3, 0 + bl sub_81DA74C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x12] + b _081DB01A +_081DAFF2: + cmp r2, 0x20 + bne _081DB01A + movs r0, 0x4 + negs r0, r0 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x2 + str r0, [sp, 0x8] + movs r0, 0xF7 + movs r1, 0xC1 + movs r2, 0 + movs r3, 0 + bl sub_81DA74C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x14] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_081DB01A: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + movs r0, 0 + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81DAFA0 + + thumb_func_start sub_81DB02C +sub_81DB02C: @ 81DB02C + push {lr} + adds r2, r0, 0 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081DB050 + adds r0, r2, 0 + bl sub_81DAA20 + ldr r0, =sub_81DAF68 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_081DB050: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81DB02C + + thumb_func_start sub_81DB060 +sub_81DB060: @ 81DB060 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_0862B7D4 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_081DB072: + movs r1, 0x8 + ldrsh r0, [r4, r1] + lsls r0, 2 + adds r0, r5 + ldr r1, [r0] + adds r0, r4, 0 + bl _call_via_r1 + lsls r0, 24 + cmp r0, 0 + bne _081DB072 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81DB060 + + thumb_func_start sub_81DB098 +sub_81DB098: @ 81DB098 + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + movs r0, 0xA + ldrsh r1, [r4, r0] + cmp r1, 0 + bne _081DB0C4 + str r1, [sp] + movs r0, 0x8 + negs r0, r0 + str r0, [sp, 0x4] + str r1, [sp, 0x8] + movs r0, 0x78 + movs r1, 0xC5 + movs r2, 0 + movs r3, 0 + bl sub_81DA74C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x10] + b _081DB112 +_081DB0C4: + cmp r1, 0x10 + bne _081DB0E8 + movs r0, 0x8 + negs r0, r0 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0xF1 + movs r1, 0x4E + movs r2, 0 + movs r3, 0 + bl sub_81DA74C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x12] + b _081DB112 +_081DB0E8: + cmp r1, 0x20 + bne _081DB112 + movs r0, 0x1 + negs r0, r0 + movs r1, 0x8 + str r1, [sp] + movs r1, 0x1 + str r1, [sp, 0x4] + movs r1, 0x2 + str r1, [sp, 0x8] + movs r1, 0x4E + movs r2, 0 + movs r3, 0 + bl sub_81DA74C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x14] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_081DB112: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + movs r0, 0 + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81DB098 + + thumb_func_start sub_81DB124 +sub_81DB124: @ 81DB124 + push {lr} + adds r2, r0, 0 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081DB148 + adds r0, r2, 0 + bl sub_81DAA20 + ldr r0, =sub_81DB060 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_081DB148: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81DB124 + + thumb_func_start sub_81DB158 +sub_81DB158: @ 81DB158 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_0862B7E8 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_081DB16A: + movs r1, 0x8 + ldrsh r0, [r4, r1] + lsls r0, 2 + adds r0, r5 + ldr r1, [r0] + adds r0, r4, 0 + bl _call_via_r1 + lsls r0, 24 + cmp r0, 0 + bne _081DB16A + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81DB158 + + thumb_func_start sub_81DB190 +sub_81DB190: @ 81DB190 + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + movs r0, 0xA + ldrsh r1, [r4, r0] + cmp r1, 0 + bne _081DB1BE + movs r0, 0x80 + str r0, [sp] + str r1, [sp, 0x4] + subs r0, 0x84 + str r0, [sp, 0x8] + str r1, [sp, 0xC] + movs r0, 0x78 + movs r1, 0x2D + movs r2, 0xC + movs r3, 0x4 + bl sub_81DA8BC + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x10] + b _081DB212 +_081DB1BE: + cmp r1, 0x10 + bne _081DB1E6 + movs r0, 0x80 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + subs r0, 0x4 + str r0, [sp, 0x8] + movs r0, 0x1 + str r0, [sp, 0xC] + movs r0, 0x59 + movs r1, 0x61 + movs r2, 0xFC + movs r3, 0x4 + bl sub_81DA8BC + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x12] + b _081DB212 +_081DB1E6: + cmp r1, 0x20 + bne _081DB212 + movs r0, 0x80 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + subs r0, 0x4 + str r0, [sp, 0x8] + movs r0, 0x2 + str r0, [sp, 0xC] + movs r0, 0x97 + movs r1, 0x61 + movs r2, 0x84 + movs r3, 0x4 + bl sub_81DA8BC + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x14] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_081DB212: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + movs r0, 0 + add sp, 0x10 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81DB190 + + thumb_func_start sub_81DB224 +sub_81DB224: @ 81DB224 + push {lr} + adds r2, r0, 0 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081DB248 + adds r0, r2, 0 + bl sub_81DAA20 + ldr r0, =sub_81DB158 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_081DB248: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81DB224 + + thumb_func_start sub_81DB258 +sub_81DB258: @ 81DB258 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_0862B7FC + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_081DB26A: + movs r1, 0x8 + ldrsh r0, [r4, r1] + lsls r0, 2 + adds r0, r5 + ldr r1, [r0] + adds r0, r4, 0 + bl _call_via_r1 + lsls r0, 24 + cmp r0, 0 + bne _081DB26A + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81DB258 + + thumb_func_start sub_81DB290 +sub_81DB290: @ 81DB290 + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + movs r0, 0xA + ldrsh r1, [r4, r0] + cmp r1, 0 + bne _081DB2C2 + movs r2, 0x8E + lsls r2, 1 + movs r0, 0x83 + str r0, [sp] + movs r0, 0x23 + str r0, [sp, 0x4] + subs r0, 0x26 + str r0, [sp, 0x8] + str r1, [sp, 0xC] + movs r0, 0x78 + movs r1, 0x50 + movs r3, 0x8 + bl sub_81DA8BC + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x10] + b _081DB316 +_081DB2C2: + cmp r1, 0x10 + bne _081DB2EA + movs r0, 0x83 + str r0, [sp] + movs r0, 0x23 + str r0, [sp, 0x4] + subs r0, 0x26 + str r0, [sp, 0x8] + movs r0, 0x1 + str r0, [sp, 0xC] + movs r0, 0x78 + movs r1, 0x50 + movs r2, 0x2C + movs r3, 0x8 + bl sub_81DA8BC + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x12] + b _081DB316 +_081DB2EA: + cmp r1, 0x20 + bne _081DB316 + movs r0, 0x83 + str r0, [sp] + movs r0, 0x23 + str r0, [sp, 0x4] + subs r0, 0x26 + str r0, [sp, 0x8] + movs r0, 0x2 + str r0, [sp, 0xC] + movs r0, 0x79 + movs r1, 0x50 + movs r2, 0xA4 + movs r3, 0x8 + bl sub_81DA8BC + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x14] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_081DB316: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + movs r0, 0 + add sp, 0x10 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81DB290 + + thumb_func_start sub_81DB328 +sub_81DB328: @ 81DB328 + push {lr} + adds r2, r0, 0 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081DB34C + adds r0, r2, 0 + bl sub_81DAA20 + ldr r0, =sub_81DB258 + bl get_task_id_by_function + lsls r0, 24 + lsrs r0, 24 + bl remove_task +_081DB34C: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81DB328 + + thumb_func_start GetStringCenterAlignXOffset +@ s32 GetStringCenterAlignXOffset(u8 fontId, u8 *str, s32 totalWidth) +GetStringCenterAlignXOffset: @ 81DB35C + push {lr} + movs r3, 0 + bl GetStringCenterAlignXOffsetWithLetterSpacing + pop {r1} + bx r1 + thumb_func_end GetStringCenterAlignXOffset + + thumb_func_start GetStringRightAlignXOffset +@ s32 GetStringRightAlignXOffset(u8 fontId, u8 *str, s32 totalWidth) +GetStringRightAlignXOffset: @ 81DB368 + push {lr} + movs r3, 0 + bl GetStringWidthDifference + pop {r1} + bx r1 + thumb_func_end GetStringRightAlignXOffset + + thumb_func_start GetStringCenterAlignXOffsetWithLetterSpacing +@ s32 GetStringCenterAlignXOffsetWithLetterSpacing(u8 fontId, u8 *str, s32 totalWidth, s16 letterSpacing) +GetStringCenterAlignXOffsetWithLetterSpacing: @ 81DB374 + push {lr} + bl GetStringWidthDifference + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + pop {r1} + bx r1 + thumb_func_end GetStringCenterAlignXOffsetWithLetterSpacing + + thumb_func_start GetStringWidthDifference +@ s32 GetStringWidthDifference(u8 fontId, u8 *str, s32 totalWidth, s16 letterSpacing) +GetStringWidthDifference: @ 81DB384 + push {r4,lr} + adds r4, r2, 0 + adds r2, r3, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r2, 16 + asrs r2, 16 + bl GetStringWidth + cmp r4, r0 + bgt _081DB39E + movs r0, 0 + b _081DB3A0 +_081DB39E: + subs r0, r4, r0 +_081DB3A0: + pop {r4} + pop {r1} + bx r1 + thumb_func_end GetStringWidthDifference + + thumb_func_start GetMaxWidthInMenuTable +GetMaxWidthInMenuTable: @ 81DB3A8 + push {r4-r6,lr} + movs r6, 0 + cmp r6, r1 + bge _081DB3CC + adds r5, r0, 0 + adds r4, r1, 0 +_081DB3B4: + ldr r1, [r5] + movs r0, 0x1 + movs r2, 0 + bl GetStringWidth + cmp r0, r6 + ble _081DB3C4 + adds r6, r0, 0 +_081DB3C4: + adds r5, 0x8 + subs r4, 0x1 + cmp r4, 0 + bne _081DB3B4 +_081DB3CC: + adds r0, r6, 0 + bl convert_pixel_width_to_tile_width + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end GetMaxWidthInMenuTable + + thumb_func_start sub_81DB3D8 +sub_81DB3D8: @ 81DB3D8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + adds r7, r1, 0 + adds r5, r2, 0 + movs r6, 0 + movs r4, 0 + cmp r6, r5 + bge _081DB40A +_081DB3EC: + adds r0, r7, r4 + ldrb r0, [r0] + lsls r0, 3 + add r0, r8 + ldr r1, [r0] + movs r0, 0x1 + movs r2, 0 + bl GetStringWidth + cmp r0, r6 + ble _081DB404 + adds r6, r0, 0 +_081DB404: + adds r4, 0x1 + cmp r4, r5 + blt _081DB3EC +_081DB40A: + adds r0, r6, 0 + bl convert_pixel_width_to_tile_width + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81DB3D8 + + thumb_func_start sub_81DB41C +sub_81DB41C: @ 81DB41C + push {r4-r7,lr} + adds r4, r0, 0 + ldr r1, [r4] + movs r7, 0 + movs r6, 0 + ldrh r0, [r4, 0xC] + cmp r7, r0 + bge _081DB44C + adds r5, r1, 0 +_081DB42E: + ldrb r0, [r4, 0x17] + lsls r0, 26 + lsrs r0, 26 + ldr r1, [r5] + movs r2, 0 + bl GetStringWidth + cmp r0, r7 + ble _081DB442 + adds r7, r0, 0 +_081DB442: + adds r5, 0x8 + adds r6, 0x1 + ldrh r0, [r4, 0xC] + cmp r6, r0 + blt _081DB42E +_081DB44C: + ldrb r0, [r4, 0x12] + adds r1, r7, r0 + adds r0, r1, 0 + adds r0, 0x9 + cmp r0, 0 + bge _081DB45A + adds r0, 0x7 +_081DB45A: + asrs r0, 3 + cmp r0, 0x1C + ble _081DB462 + movs r0, 0x1C +_081DB462: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81DB41C + + thumb_func_start sub_81DB468 +sub_81DB468: @ 81DB468 + push {lr} + adds r2, r0, 0 + adds r0, r1, 0 + lsls r2, 5 + ldr r1, =gPokedexEntries + adds r2, r1 + adds r1, r2, 0 + bl CopyString + movs r1, 0 + strb r1, [r0] + adds r0, 0x1 + ldr r1, =gUnknown_085E8268 + bl CopyString + pop {r0} + bx r0 + .pool + thumb_func_end sub_81DB468 + + thumb_func_start sub_81DB494 +sub_81DB494: @ 81DB494 + push {r4-r7,lr} + adds r6, r1, 0 + adds r5, r2, 0 + adds r7, r3, 0 + cmp r5, 0 + beq _081DB4B6 + adds r1, r5, 0 + bl CopyString + adds r4, r0, 0 + lsls r0, r6, 24 + lsrs r0, 24 + adds r1, r5, 0 + movs r2, 0 + bl GetStringWidth + b _081DB4BA +_081DB4B6: + adds r4, r0, 0 + movs r0, 0 +_081DB4BA: + subs r3, r7, r0 + cmp r3, 0 + ble _081DB4D4 + movs r0, 0xFC + strb r0, [r4] + adds r4, 0x1 + movs r0, 0x11 + strb r0, [r4] + adds r4, 0x1 + strb r3, [r4] + adds r4, 0x1 + movs r0, 0xFF + strb r0, [r4] +_081DB4D4: + adds r0, r4, 0 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81DB494 + + thumb_func_start sub_81DB4DC +sub_81DB4DC: @ 81DB4DC + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + bl StripExtendedControlCodes + adds r0, r4, 0 + bl GetStringLength + lsls r0, 24 + lsrs r1, r0, 24 + cmp r5, 0xFC + bne _081DB51A + cmp r1, 0x5 + bhi _081DB51E + movs r3, 0xFC + movs r2, 0x7 +_081DB4FE: + adds r0, r4, r1 + strb r3, [r0] + strb r2, [r0, 0x1] + adds r0, r1, 0x2 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x5 + bls _081DB4FE + b _081DB51E +_081DB510: + adds r0, r4, r1 + strb r5, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 +_081DB51A: + cmp r1, 0x5 + bls _081DB510 +_081DB51E: + adds r1, r4, r1 + movs r0, 0xFF + strb r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81DB4DC + + thumb_func_start sub_81DB52C +sub_81DB52C: @ 81DB52C + push {r4,lr} + adds r4, r0, 0 + bl GetStringLength + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x5 + bhi _081DB546 + adds r0, r4, 0 + movs r1, 0x1 + bl StopMusicWhileStringIsPrinted + b _081DB54C +_081DB546: + adds r0, r4, 0 + bl StripExtendedControlCodes +_081DB54C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81DB52C + + thumb_func_start sub_81DB554 +sub_81DB554: @ 81DB554 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + bl GetStringLength + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x5 + bhi _081DB572 + adds r0, r4, 0 + movs r1, 0x1 + bl StopMusicWhileStringIsPrinted + b _081DB5A4 +_081DB572: + cmp r5, 0xFC + bne _081DB57E + adds r0, r4, 0 + bl StripExtendedControlCodes + b _081DB5A4 +_081DB57E: + adds r1, r4, 0 + b _081DB584 +_081DB582: + adds r1, 0x1 +_081DB584: + ldrb r0, [r1, 0x1] + cmp r0, 0xFF + bne _081DB582 + cmp r1, r4 + bcc _081DB5A4 + ldrb r0, [r1] + cmp r0, r5 + bne _081DB5A4 + movs r2, 0xFF +_081DB596: + strb r2, [r1] + subs r1, 0x1 + cmp r1, r4 + bcc _081DB5A4 + ldrb r0, [r1] + cmp r0, r5 + beq _081DB596 +_081DB5A4: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81DB554 + + thumb_func_start sub_81DB5AC +sub_81DB5AC: @ 81DB5AC + push {lr} + adds r2, r0, 0 + ldrb r0, [r2] + adds r2, 0x1 + cmp r0, 0xFC + bne _081DB5E4 + ldrb r0, [r2] + adds r2, 0x1 + cmp r0, 0x15 + bne _081DB5E4 + b _081DB5CE +_081DB5C2: + cmp r1, 0xFC + bne _081DB5CC + ldrb r0, [r2, 0x1] + cmp r0, 0x16 + beq _081DB5E4 +_081DB5CC: + adds r2, 0x1 +_081DB5CE: + ldrb r1, [r2] + adds r0, r1, 0 + cmp r0, 0xFF + bne _081DB5C2 + movs r0, 0xFC + strb r0, [r2] + adds r2, 0x1 + movs r0, 0x16 + strb r0, [r2] + movs r0, 0xFF + strb r0, [r2, 0x1] +_081DB5E4: + pop {r0} + bx r0 + thumb_func_end sub_81DB5AC + + thumb_func_start sub_81DB5E8 +sub_81DB5E8: @ 81DB5E8 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r2, 0 + bl CopyString + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl StopMusicWhileStringIsPrinted + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81DB5E8 + + thumb_func_start sub_81DB604 +sub_81DB604: @ 81DB604 + push {lr} + adds r1, r0, 0 + ldrb r0, [r1] + cmp r0, 0xFC + bne _081DB618 + ldrb r0, [r1, 0x1] + cmp r0, 0x15 + bne _081DB618 + movs r0, 0x1 + b _081DB61A +_081DB618: + movs r0, 0x2 +_081DB61A: + pop {r1} + bx r1 + thumb_func_end sub_81DB604 + + thumb_func_start sub_81DB620 +sub_81DB620: @ 81DB620 + push {r4-r7,lr} + sub sp, 0x4 + lsls r4, r0, 1 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020004 + adds r4, r0 + lsls r7, r3, 5 + ldrb r0, [r4, 0x3] + lsls r6, r0, 5 + muls r2, r6 + ldr r0, [r4, 0x8] + adds r0, r2 + lsls r1, 5 + adds r5, r0, r1 + ldr r0, [sp, 0x18] + cmp r0, 0 + ble _081DB66C + adds r4, r0, 0 +_081DB646: + ldr r0, =0x11111111 + str r0, [sp] + adds r2, r7, 0 + cmp r2, 0 + bge _081DB652 + adds r2, 0x3 +_081DB652: + lsls r2, 9 + lsrs r2, 11 + movs r0, 0x80 + lsls r0, 17 + orrs r2, r0 + mov r0, sp + adds r1, r5, 0 + bl CpuFastSet + adds r5, r6 + subs r4, 0x1 + cmp r4, 0 + bne _081DB646 +_081DB66C: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81DB620 + + .align 2, 0 @ Don't pad with nop. diff --git a/charmap.txt b/charmap.txt index 1c68994df7..e9919584b0 100644 --- a/charmap.txt +++ b/charmap.txt @@ -330,14 +330,15 @@ STR_VAR_2 = FD 03 STR_VAR_3 = FD 04 KUN = FD 05 RIVAL = FD 06 -@ version-dependent strings -VERSION = FD 07 @ "RUBY" / "SAPPHIRE" -EVIL_TEAM = FD 08 @ "MAGMA" / "AQUA" -GOOD_TEAM = FD 09 @ "AQUA" / "MAGMA" -EVIL_LEADER = FD 0A @ "MAXIE" / "ARCHIE" -GOOD_LEADER = FD 0B @ "ARCHIE" / "MAXIE" -EVIL_LEGENDARY = FD 0C @ "GROUDON" / "KYOGRE" -GOOD_LEGENDARY = FD 0D @ "KYOGRE" / "GROUDON" +@ version-dependent strings (originally made for Ruby/Sapphire differences) +@ Emerald uses the Sapphire strings (except for VERSION). +VERSION = FD 07 @ "EMERALD" +AQUA = FD 08 +MAGMA = FD 09 +ARCHIE = FD 0A +MAXIE = FD 0B +KYOGRE = FD 0C +GROUDON = FD 0D @ battle macros @@ -366,7 +367,7 @@ PAUSE_UNTIL_PRESS = FC 09 UNKNOWN_A = FC 0A PLAY_BGM = FC 0B ESCAPE = FC 0C -SHIFT_TEXT = FC 0D +SHIFT_TEXT = FC 0D UNKNOWN_E = FC 0E UNKNOWN_F = FC 0F PLAY_SE = FC 10 diff --git a/constants/easy_chat_constants.s b/constants/easy_chat_constants.s index 26089c294f..4d9aecec52 100644 --- a/constants/easy_chat_constants.s +++ b/constants/easy_chat_constants.s @@ -21,7 +21,7 @@ .set EC_GROUP_TRENDY_SAYING, 0x14 .set EC_GROUP_POKEMON2, 0x15 -; Trainer +@ Trainer .set EC_WORD_I_CHOOSE_YOU, (EC_GROUP_TRAINER << 9) | 0x0 .set EC_WORD_GOTCHA, (EC_GROUP_TRAINER << 9) | 0x1 .set EC_WORD_TRADE, (EC_GROUP_TRAINER << 9) | 0x2 @@ -50,7 +50,7 @@ .set EC_WORD_SILVER, (EC_GROUP_TRAINER << 9) | 0x19 .set EC_WORD_EMERALD, (EC_GROUP_TRAINER << 9) | 0x1a -; Status +@ Status .set EC_WORD_DARK, (EC_GROUP_STATUS << 9) | 0x0 .set EC_WORD_STENCH, (EC_GROUP_STATUS << 9) | 0x1 .set EC_WORD_THICK_FAT, (EC_GROUP_STATUS << 9) | 0x2 @@ -161,7 +161,7 @@ .set EC_WORD_PURE_POWER, (EC_GROUP_STATUS << 9) | 0x6b .set EC_WORD_SHIELD_DUST, (EC_GROUP_STATUS << 9) | 0x6c -; Battle +@ Battle .set EC_WORD_MATCH_UP, (EC_GROUP_BATTLE << 9) | 0x0 .set EC_WORD_GO, (EC_GROUP_BATTLE << 9) | 0x1 .set EC_WORD_NO_1, (EC_GROUP_BATTLE << 9) | 0x2 @@ -226,7 +226,7 @@ .set EC_WORD_RULE, (EC_GROUP_BATTLE << 9) | 0x3d .set EC_WORD_MOVE, (EC_GROUP_BATTLE << 9) | 0x3e -; Greetings +@ Greetings .set EC_WORD_THANKS, (EC_GROUP_GREETINGS << 9) | 0x0 .set EC_WORD_YES, (EC_GROUP_GREETINGS << 9) | 0x1 .set EC_WORD_HERE_GOES, (EC_GROUP_GREETINGS << 9) | 0x2 @@ -270,7 +270,7 @@ .set EC_WORD_COME_OVER, (EC_GROUP_GREETINGS << 9) | 0x28 .set EC_WORD_COUNT_ON, (EC_GROUP_GREETINGS << 9) | 0x29 -; People +@ People .set EC_WORD_OPPONENT, (EC_GROUP_PEOPLE << 9) | 0x0 .set EC_WORD_I, (EC_GROUP_PEOPLE << 9) | 0x1 .set EC_WORD_YOU, (EC_GROUP_PEOPLE << 9) | 0x2 @@ -347,7 +347,7 @@ .set EC_WORD_SHE_IS, (EC_GROUP_PEOPLE << 9) | 0x49 .set EC_WORD_SOME, (EC_GROUP_PEOPLE << 9) | 0x4a -; Voices +@ Voices .set EC_WORD_EXCL, (EC_GROUP_VOICES << 9) | 0x0 .set EC_WORD_EXCL_EXCL, (EC_GROUP_VOICES << 9) | 0x1 .set EC_WORD_QUES_EXCL, (EC_GROUP_VOICES << 9) | 0x2 @@ -412,7 +412,7 @@ .set EC_WORD_GWAH, (EC_GROUP_VOICES << 9) | 0x3d .set EC_WORD_WAHAHAHA, (EC_GROUP_VOICES << 9) | 0x3e -; Speech +@ Speech .set EC_WORD_LISTEN, (EC_GROUP_SPEECH << 9) | 0x0 .set EC_WORD_NOT_VERY, (EC_GROUP_SPEECH << 9) | 0x1 .set EC_WORD_MEAN, (EC_GROUP_SPEECH << 9) | 0x2 @@ -474,7 +474,7 @@ .set EC_WORD_INSTEAD, (EC_GROUP_SPEECH << 9) | 0x3a .set EC_WORD_FANTASTIC, (EC_GROUP_SPEECH << 9) | 0x3b -; Endings +@ Endings .set EC_WORD_WILL, (EC_GROUP_ENDINGS << 9) | 0x0 .set EC_WORD_WILL_BE_HERE, (EC_GROUP_ENDINGS << 9) | 0x1 .set EC_WORD_OR, (EC_GROUP_ENDINGS << 9) | 0x2 @@ -545,7 +545,7 @@ .set EC_WORD_ONCE, (EC_GROUP_ENDINGS << 9) | 0x43 .set EC_WORD_ANYWHERE, (EC_GROUP_ENDINGS << 9) | 0x44 -; Feelings +@ Feelings .set EC_WORD_MEET, (EC_GROUP_FEELINGS << 9) | 0x0 .set EC_WORD_PLAY, (EC_GROUP_FEELINGS << 9) | 0x1 .set EC_WORD_HURRIED, (EC_GROUP_FEELINGS << 9) | 0x2 @@ -616,7 +616,7 @@ .set EC_WORD_UNDERSTAND, (EC_GROUP_FEELINGS << 9) | 0x43 .set EC_WORD_UNDERSTANDS, (EC_GROUP_FEELINGS << 9) | 0x44 -; Conditions +@ Conditions .set EC_WORD_HOT, (EC_GROUP_CONDITIONS << 9) | 0x0 .set EC_WORD_EXISTS, (EC_GROUP_CONDITIONS << 9) | 0x1 .set EC_WORD_EXCESS, (EC_GROUP_CONDITIONS << 9) | 0x2 @@ -687,7 +687,7 @@ .set EC_WORD_SEEMS, (EC_GROUP_CONDITIONS << 9) | 0x43 .set EC_WORD_BADLY, (EC_GROUP_CONDITIONS << 9) | 0x44 -; Actions +@ Actions .set EC_WORD_MEETS, (EC_GROUP_ACTIONS << 9) | 0x0 .set EC_WORD_CONCEDE, (EC_GROUP_ACTIONS << 9) | 0x1 .set EC_WORD_GIVE, (EC_GROUP_ACTIONS << 9) | 0x2 @@ -767,7 +767,7 @@ .set EC_WORD_FAINT, (EC_GROUP_ACTIONS << 9) | 0x4c .set EC_WORD_FAINTED, (EC_GROUP_ACTIONS << 9) | 0x4d -; Lifestyle +@ Lifestyle .set EC_WORD_CHORES, (EC_GROUP_LIFESTYLE << 9) | 0x0 .set EC_WORD_HOME, (EC_GROUP_LIFESTYLE << 9) | 0x1 .set EC_WORD_MONEY, (EC_GROUP_LIFESTYLE << 9) | 0x2 @@ -814,7 +814,7 @@ .set EC_WORD_RENTAL, (EC_GROUP_LIFESTYLE << 9) | 0x2b .set EC_WORD_WORLD, (EC_GROUP_LIFESTYLE << 9) | 0x2c -; Hobbies +@ Hobbies .set EC_WORD_IDOL, (EC_GROUP_HOBBIES << 9) | 0x0 .set EC_WORD_ANIME, (EC_GROUP_HOBBIES << 9) | 0x1 .set EC_WORD_SONG, (EC_GROUP_HOBBIES << 9) | 0x2 @@ -870,7 +870,7 @@ .set EC_WORD_VACATION, (EC_GROUP_HOBBIES << 9) | 0x34 .set EC_WORD_LOOK, (EC_GROUP_HOBBIES << 9) | 0x35 -; Time +@ Time .set EC_WORD_FALL, (EC_GROUP_TIME << 9) | 0x0 .set EC_WORD_MORNING, (EC_GROUP_TIME << 9) | 0x1 .set EC_WORD_TOMORROW, (EC_GROUP_TIME << 9) | 0x2 @@ -917,7 +917,7 @@ .set EC_WORD_NIGHT, (EC_GROUP_TIME << 9) | 0x2b .set EC_WORD_WEEK, (EC_GROUP_TIME << 9) | 0x2c -; Misc. +@ Misc. .set EC_WORD_HIGHS, (EC_GROUP_MISC << 9) | 0x0 .set EC_WORD_LOWS, (EC_GROUP_MISC << 9) | 0x1 .set EC_WORD_UM, (EC_GROUP_MISC << 9) | 0x2 @@ -961,7 +961,7 @@ .set EC_WORD_LEFT, (EC_GROUP_MISC << 9) | 0x28 .set EC_WORD_RIGHT, (EC_GROUP_MISC << 9) | 0x29 -; Adjectives +@ Adjectives .set EC_WORD_WANDERING, (EC_GROUP_ADJECTIVES << 9) | 0x0 .set EC_WORD_RICKETY, (EC_GROUP_ADJECTIVES << 9) | 0x1 .set EC_WORD_ROCK_SOLID, (EC_GROUP_ADJECTIVES << 9) | 0x2 @@ -999,7 +999,7 @@ .set EC_WORD_HAPPILY, (EC_GROUP_ADJECTIVES << 9) | 0x22 .set EC_WORD_ANTICIPATION, (EC_GROUP_ADJECTIVES << 9) | 0x23 -; Events +@ Events .set EC_WORD_APPEAL, (EC_GROUP_EVENTS << 9) | 0x0 .set EC_WORD_EVENTS, (EC_GROUP_EVENTS << 9) | 0x1 .set EC_WORD_STAY_AT_HOME, (EC_GROUP_EVENTS << 9) | 0x2 @@ -1030,7 +1030,7 @@ .set EC_WORD_WIRELESS, (EC_GROUP_EVENTS << 9) | 0x1b .set EC_WORD_FRONTIER, (EC_GROUP_EVENTS << 9) | 0x1c -; Trendy Saying +@ Trendy Saying .set EC_WORD_KTHX_BYE, (EC_GROUP_TRENDY_SAYING << 9) | 0x0 .set EC_WORD_YES_SIR_EXCL, (EC_GROUP_TRENDY_SAYING << 9) | 0x1 .set EC_WORD_AVANT_GARDE, (EC_GROUP_TRENDY_SAYING << 9) | 0x2 diff --git a/constants/gba_constants.s b/constants/gba_constants.s index 2a128faa69..46dfdcc2f9 100644 --- a/constants/gba_constants.s +++ b/constants/gba_constants.s @@ -32,9 +32,9 @@ .set INTR_FLAG_KEYPAD, 1 << 12 .set INTR_FLAG_GAMEPAK, 1 << 13 - .set REG_BASE, 0x4000000 ; I/O register base address + .set REG_BASE, 0x4000000 @ I/O register base address -; I/O register offsets +@ I/O register offsets .set OFFSET_REG_DISPCNT, 0x0 .set OFFSET_REG_DISPSTAT, 0x4 .set OFFSET_REG_VCOUNT, 0x6 @@ -201,7 +201,7 @@ .set OFFSET_REG_WAITCNT, 0x204 -; I/O register addresses +@ 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 @@ -368,7 +368,7 @@ .set REG_WAITCNT, REG_BASE + OFFSET_REG_WAITCNT -; OAM attribute constants +@ OAM attribute constants .set OAM_OBJ_NORMAL, 0x00000000 .set OAM_OBJ_BLEND, 0x00000400 diff --git a/constants/map_constants.s b/constants/map_constants.s index 3058bb8398..eabfe6e69d 100644 --- a/constants/map_constants.s +++ b/constants/map_constants.s @@ -1,587 +1,587 @@ .set cur_map_group, -1 new_map_group - map_group PETALBURG_CITY ; 0.0 - map_group SLATEPORT_CITY ; 0.1 - map_group MAUVILLE_CITY ; 0.2 - map_group RUSTBORO_CITY ; 0.3 - map_group FORTREE_CITY ; 0.4 - map_group LILYCOVE_CITY ; 0.5 - map_group MOSSDEEP_CITY ; 0.6 - map_group SOOTOPOLIS_CITY ; 0.7 - map_group EVER_GRANDE_CITY ; 0.8 - map_group LITTLEROOT_TOWN ; 0.9 - map_group OLDALE_TOWN ; 0.10 - map_group DEWFORD_TOWN ; 0.11 - map_group LAVARIDGE_TOWN ; 0.12 - map_group FALLARBOR_TOWN ; 0.13 - map_group VERDANTURF_TOWN ; 0.14 - map_group PACIFIDLOG_TOWN ; 0.15 - map_group ROUTE_101 ; 0.16 - map_group ROUTE_102 ; 0.17 - map_group ROUTE_103 ; 0.18 - map_group ROUTE_104 ; 0.19 - map_group ROUTE_105 ; 0.20 - map_group ROUTE_106 ; 0.21 - map_group ROUTE_107 ; 0.22 - map_group ROUTE_108 ; 0.23 - map_group ROUTE_109 ; 0.24 - map_group ROUTE_110 ; 0.25 - map_group ROUTE_111 ; 0.26 - map_group ROUTE_112 ; 0.27 - map_group ROUTE_113 ; 0.28 - map_group ROUTE_114 ; 0.29 - map_group ROUTE_115 ; 0.30 - map_group ROUTE_116 ; 0.31 - map_group ROUTE_117 ; 0.32 - map_group ROUTE_118 ; 0.33 - map_group ROUTE_119 ; 0.34 - map_group ROUTE_120 ; 0.35 - map_group ROUTE_121 ; 0.36 - map_group ROUTE_122 ; 0.37 - map_group ROUTE_123 ; 0.38 - map_group ROUTE_124 ; 0.39 - map_group ROUTE_125 ; 0.40 - map_group ROUTE_126 ; 0.41 - map_group ROUTE_127 ; 0.42 - map_group ROUTE_128 ; 0.43 - map_group ROUTE_129 ; 0.44 - map_group ROUTE_130 ; 0.45 - map_group ROUTE_131 ; 0.46 - map_group ROUTE_132 ; 0.47 - map_group ROUTE_133 ; 0.48 - map_group ROUTE_134 ; 0.49 - map_group UNDERWATER_1 ; 0.50 - map_group UNDERWATER_2 ; 0.51 - map_group UNDERWATER_3 ; 0.52 - map_group UNDERWATER_4 ; 0.53 - map_group UNDERWATER_5 ; 0.54 - map_group UNDERWATER_6 ; 0.55 - map_group UNDERWATER_7 ; 0.56 + map_group PETALBURG_CITY @ 0.0 + map_group SLATEPORT_CITY @ 0.1 + map_group MAUVILLE_CITY @ 0.2 + map_group RUSTBORO_CITY @ 0.3 + map_group FORTREE_CITY @ 0.4 + map_group LILYCOVE_CITY @ 0.5 + map_group MOSSDEEP_CITY @ 0.6 + map_group SOOTOPOLIS_CITY @ 0.7 + map_group EVER_GRANDE_CITY @ 0.8 + map_group LITTLEROOT_TOWN @ 0.9 + map_group OLDALE_TOWN @ 0.10 + map_group DEWFORD_TOWN @ 0.11 + map_group LAVARIDGE_TOWN @ 0.12 + map_group FALLARBOR_TOWN @ 0.13 + map_group VERDANTURF_TOWN @ 0.14 + map_group PACIFIDLOG_TOWN @ 0.15 + map_group ROUTE_101 @ 0.16 + map_group ROUTE_102 @ 0.17 + map_group ROUTE_103 @ 0.18 + map_group ROUTE_104 @ 0.19 + map_group ROUTE_105 @ 0.20 + map_group ROUTE_106 @ 0.21 + map_group ROUTE_107 @ 0.22 + map_group ROUTE_108 @ 0.23 + map_group ROUTE_109 @ 0.24 + map_group ROUTE_110 @ 0.25 + map_group ROUTE_111 @ 0.26 + map_group ROUTE_112 @ 0.27 + map_group ROUTE_113 @ 0.28 + map_group ROUTE_114 @ 0.29 + map_group ROUTE_115 @ 0.30 + map_group ROUTE_116 @ 0.31 + map_group ROUTE_117 @ 0.32 + map_group ROUTE_118 @ 0.33 + map_group ROUTE_119 @ 0.34 + map_group ROUTE_120 @ 0.35 + map_group ROUTE_121 @ 0.36 + map_group ROUTE_122 @ 0.37 + map_group ROUTE_123 @ 0.38 + map_group ROUTE_124 @ 0.39 + map_group ROUTE_125 @ 0.40 + map_group ROUTE_126 @ 0.41 + map_group ROUTE_127 @ 0.42 + map_group ROUTE_128 @ 0.43 + map_group ROUTE_129 @ 0.44 + map_group ROUTE_130 @ 0.45 + map_group ROUTE_131 @ 0.46 + map_group ROUTE_132 @ 0.47 + map_group ROUTE_133 @ 0.48 + map_group ROUTE_134 @ 0.49 + map_group UNDERWATER_1 @ 0.50 + map_group UNDERWATER_2 @ 0.51 + map_group UNDERWATER_3 @ 0.52 + map_group UNDERWATER_4 @ 0.53 + map_group UNDERWATER_5 @ 0.54 + map_group UNDERWATER_6 @ 0.55 + map_group UNDERWATER_7 @ 0.56 new_map_group - map_group LITTLEROOT_TOWN_BRENDANS_HOUSE_1F ; 1.0 - map_group LITTLEROOT_TOWN_BRENDANS_HOUSE_2F ; 1.1 - map_group LITTLEROOT_TOWN_MAYS_HOUSE_1F ; 1.2 - map_group LITTLEROOT_TOWN_MAYS_HOUSE_2F ; 1.3 - map_group LITTLEROOT_TOWN_PROFESSOR_BIRCHS_LAB ; 1.4 + map_group LITTLEROOT_TOWN_BRENDANS_HOUSE_1F @ 1.0 + map_group LITTLEROOT_TOWN_BRENDANS_HOUSE_2F @ 1.1 + map_group LITTLEROOT_TOWN_MAYS_HOUSE_1F @ 1.2 + map_group LITTLEROOT_TOWN_MAYS_HOUSE_2F @ 1.3 + map_group LITTLEROOT_TOWN_PROFESSOR_BIRCHS_LAB @ 1.4 new_map_group - map_group OLDALE_TOWN_HOUSE_1 ; 2.0 - map_group OLDALE_TOWN_HOUSE_2 ; 2.1 - map_group OLDALE_TOWN_POKEMON_CENTER_1F ; 2.2 - map_group OLDALE_TOWN_POKEMON_CENTER_2F ; 2.3 - map_group OLDALE_TOWN_MART ; 2.4 + map_group OLDALE_TOWN_HOUSE_1 @ 2.0 + map_group OLDALE_TOWN_HOUSE_2 @ 2.1 + map_group OLDALE_TOWN_POKEMON_CENTER_1F @ 2.2 + map_group OLDALE_TOWN_POKEMON_CENTER_2F @ 2.3 + map_group OLDALE_TOWN_MART @ 2.4 new_map_group - map_group DEWFORD_TOWN_HOUSE_1 ; 3.0 - map_group DEWFORD_TOWN_POKEMON_CENTER_1F ; 3.1 - map_group DEWFORD_TOWN_POKEMON_CENTER_2F ; 3.2 - map_group DEWFORD_TOWN_GYM ; 3.3 - map_group DEWFORD_TOWN_HALL ; 3.4 - map_group DEWFORD_TOWN_HOUSE_2 ; 3.5 + map_group DEWFORD_TOWN_HOUSE_1 @ 3.0 + map_group DEWFORD_TOWN_POKEMON_CENTER_1F @ 3.1 + map_group DEWFORD_TOWN_POKEMON_CENTER_2F @ 3.2 + map_group DEWFORD_TOWN_GYM @ 3.3 + map_group DEWFORD_TOWN_HALL @ 3.4 + map_group DEWFORD_TOWN_HOUSE_2 @ 3.5 new_map_group - map_group LAVARIDGE_TOWN_HERB_SHOP ; 4.0 - map_group LAVARIDGE_TOWN_GYM_1F ; 4.1 - map_group LAVARIDGE_TOWN_GYM_B1F ; 4.2 - map_group LAVARIDGE_TOWN_HOUSE ; 4.3 - map_group LAVARIDGE_TOWN_MART ; 4.4 - map_group LAVARIDGE_TOWN_POKEMON_CENTER_1F ; 4.5 - map_group LAVARIDGE_TOWN_POKEMON_CENTER_2F ; 4.6 + map_group LAVARIDGE_TOWN_HERB_SHOP @ 4.0 + map_group LAVARIDGE_TOWN_GYM_1F @ 4.1 + map_group LAVARIDGE_TOWN_GYM_B1F @ 4.2 + map_group LAVARIDGE_TOWN_HOUSE @ 4.3 + map_group LAVARIDGE_TOWN_MART @ 4.4 + map_group LAVARIDGE_TOWN_POKEMON_CENTER_1F @ 4.5 + map_group LAVARIDGE_TOWN_POKEMON_CENTER_2F @ 4.6 new_map_group - map_group FALLARBOR_TOWN_MART ; 5.0 - map_group FALLARBOR_TOWN_BATTLE_TENT_LOBBY ; 5.1 - map_group FALLARBOR_TOWN_BATTLE_TENT_CORRIDOR ; 5.2 - map_group FALLARBOR_TOWN_BATTLE_TENT_BATTLE_ROOM ; 5.3 - map_group FALLARBOR_TOWN_POKEMON_CENTER_1F ; 5.4 - map_group FALLARBOR_TOWN_POKEMON_CENTER_2F ; 5.5 - map_group FALLARBOR_TOWN_HOUSE_1 ; 5.6 - map_group FALLARBOR_TOWN_HOUSE_2 ; 5.7 + map_group FALLARBOR_TOWN_MART @ 5.0 + map_group FALLARBOR_TOWN_BATTLE_TENT_LOBBY @ 5.1 + map_group FALLARBOR_TOWN_BATTLE_TENT_CORRIDOR @ 5.2 + map_group FALLARBOR_TOWN_BATTLE_TENT_BATTLE_ROOM @ 5.3 + map_group FALLARBOR_TOWN_POKEMON_CENTER_1F @ 5.4 + map_group FALLARBOR_TOWN_POKEMON_CENTER_2F @ 5.5 + map_group FALLARBOR_TOWN_HOUSE_1 @ 5.6 + map_group FALLARBOR_TOWN_HOUSE_2 @ 5.7 new_map_group - map_group VERDANTURF_TOWN_BATTLE_TENT_LOBBY ; 6.0 - map_group VERDANTURF_TOWN_BATTLE_TENT_CORRIDOR ; 6.1 - map_group VERDANTURF_TOWN_BATTLE_TENT_BATTLE_ROOM ; 6.2 - map_group VERDANTURF_TOWN_MART ; 6.3 - map_group VERDANTURF_TOWN_POKEMON_CENTER_1F ; 6.4 - map_group VERDANTURF_TOWN_POKEMON_CENTER_2F ; 6.5 - map_group VERDANTURF_TOWN_WANDAS_HOUSE ; 6.6 - map_group VERDANTURF_TOWN_FRIENDSHIP_RATERS_HOUSE ; 6.7 - map_group VERDANTURF_TOWN_HOUSE ; 6.8 + map_group VERDANTURF_TOWN_BATTLE_TENT_LOBBY @ 6.0 + map_group VERDANTURF_TOWN_BATTLE_TENT_CORRIDOR @ 6.1 + map_group VERDANTURF_TOWN_BATTLE_TENT_BATTLE_ROOM @ 6.2 + map_group VERDANTURF_TOWN_MART @ 6.3 + map_group VERDANTURF_TOWN_POKEMON_CENTER_1F @ 6.4 + map_group VERDANTURF_TOWN_POKEMON_CENTER_2F @ 6.5 + map_group VERDANTURF_TOWN_WANDAS_HOUSE @ 6.6 + map_group VERDANTURF_TOWN_FRIENDSHIP_RATERS_HOUSE @ 6.7 + map_group VERDANTURF_TOWN_HOUSE @ 6.8 new_map_group - map_group PACIFIDLOG_TOWN_POKEMON_CENTER_1F ; 7.0 - map_group PACIFIDLOG_TOWN_POKEMON_CENTER_2F ; 7.1 - map_group PACIFIDLOG_TOWN_HOUSE_1 ; 7.2 - map_group PACIFIDLOG_TOWN_HOUSE_2 ; 7.3 - map_group PACIFIDLOG_TOWN_HOUSE_3 ; 7.4 - map_group PACIFIDLOG_TOWN_HOUSE_4 ; 7.5 - map_group PACIFIDLOG_TOWN_HOUSE_5 ; 7.6 + map_group PACIFIDLOG_TOWN_POKEMON_CENTER_1F @ 7.0 + map_group PACIFIDLOG_TOWN_POKEMON_CENTER_2F @ 7.1 + map_group PACIFIDLOG_TOWN_HOUSE_1 @ 7.2 + map_group PACIFIDLOG_TOWN_HOUSE_2 @ 7.3 + map_group PACIFIDLOG_TOWN_HOUSE_3 @ 7.4 + map_group PACIFIDLOG_TOWN_HOUSE_4 @ 7.5 + map_group PACIFIDLOG_TOWN_HOUSE_5 @ 7.6 new_map_group - map_group PETALBURG_CITY_WALLYS_HOUSE ; 8.0 - map_group PETALBURG_CITY_GYM ; 8.1 - map_group PETALBURG_CITY_HOUSE_1 ; 8.2 - map_group PETALBURG_CITY_HOUSE_2 ; 8.3 - map_group PETALBURG_CITY_POKEMON_CENTER_1F ; 8.4 - map_group PETALBURG_CITY_POKEMON_CENTER_2F ; 8.5 - map_group PETALBURG_CITY_MART ; 8.6 + map_group PETALBURG_CITY_WALLYS_HOUSE @ 8.0 + map_group PETALBURG_CITY_GYM @ 8.1 + map_group PETALBURG_CITY_HOUSE_1 @ 8.2 + map_group PETALBURG_CITY_HOUSE_2 @ 8.3 + map_group PETALBURG_CITY_POKEMON_CENTER_1F @ 8.4 + map_group PETALBURG_CITY_POKEMON_CENTER_2F @ 8.5 + map_group PETALBURG_CITY_MART @ 8.6 new_map_group - map_group SLATEPORT_CITY_STERNS_SHIPYARD_1F ; 9.0 - map_group SLATEPORT_CITY_STERNS_SHIPYARD_2F ; 9.1 - map_group SLATEPORT_CITY_BATTLE_TENT_LOBBY ; 9.2 - map_group SLATEPORT_CITY_BATTLE_TENT_CORRIDOR ; 9.3 - map_group SLATEPORT_CITY_BATTLE_TENT_BATTLE_ROOM ; 9.4 - map_group SLATEPORT_CITY_HOUSE_1 ; 9.5 - map_group SLATEPORT_CITY_POKEMON_FAN_CLUB ; 9.6 - map_group SLATEPORT_CITY_OCEANIC_MUSEUM_1F ; 9.7 - map_group SLATEPORT_CITY_OCEANIC_MUSEUM_2F ; 9.8 - map_group SLATEPORT_CITY_HARBOR ; 9.9 - map_group SLATEPORT_CITY_HOUSE_2 ; 9.10 - map_group SLATEPORT_CITY_POKEMON_CENTER_1F ; 9.11 - map_group SLATEPORT_CITY_POKEMON_CENTER_2F ; 9.12 - map_group SLATEPORT_CITY_MART ; 9.13 + map_group SLATEPORT_CITY_STERNS_SHIPYARD_1F @ 9.0 + map_group SLATEPORT_CITY_STERNS_SHIPYARD_2F @ 9.1 + map_group SLATEPORT_CITY_BATTLE_TENT_LOBBY @ 9.2 + map_group SLATEPORT_CITY_BATTLE_TENT_CORRIDOR @ 9.3 + map_group SLATEPORT_CITY_BATTLE_TENT_BATTLE_ROOM @ 9.4 + map_group SLATEPORT_CITY_HOUSE_1 @ 9.5 + map_group SLATEPORT_CITY_POKEMON_FAN_CLUB @ 9.6 + map_group SLATEPORT_CITY_OCEANIC_MUSEUM_1F @ 9.7 + map_group SLATEPORT_CITY_OCEANIC_MUSEUM_2F @ 9.8 + map_group SLATEPORT_CITY_HARBOR @ 9.9 + map_group SLATEPORT_CITY_HOUSE_2 @ 9.10 + map_group SLATEPORT_CITY_POKEMON_CENTER_1F @ 9.11 + map_group SLATEPORT_CITY_POKEMON_CENTER_2F @ 9.12 + map_group SLATEPORT_CITY_MART @ 9.13 new_map_group - map_group MAUVILLE_CITY_GYM ; 10.0 - map_group MAUVILLE_CITY_BIKE_SHOP ; 10.1 - map_group MAUVILLE_CITY_HOUSE_1 ; 10.2 - map_group MAUVILLE_CITY_GAME_CORNER ; 10.3 - map_group MAUVILLE_CITY_HOUSE_2 ; 10.4 - map_group MAUVILLE_CITY_POKEMON_CENTER_1F ; 10.5 - map_group MAUVILLE_CITY_POKEMON_CENTER_2F ; 10.6 - map_group MAUVILLE_CITY_MART ; 10.7 + map_group MAUVILLE_CITY_GYM @ 10.0 + map_group MAUVILLE_CITY_BIKE_SHOP @ 10.1 + map_group MAUVILLE_CITY_HOUSE_1 @ 10.2 + map_group MAUVILLE_CITY_GAME_CORNER @ 10.3 + map_group MAUVILLE_CITY_HOUSE_2 @ 10.4 + map_group MAUVILLE_CITY_POKEMON_CENTER_1F @ 10.5 + map_group MAUVILLE_CITY_POKEMON_CENTER_2F @ 10.6 + map_group MAUVILLE_CITY_MART @ 10.7 new_map_group - map_group RUSTBORO_CITY_DEVON_CORP_1F ; 11.0 - map_group RUSTBORO_CITY_DEVON_CORP_2F ; 11.1 - map_group RUSTBORO_CITY_DEVON_CORP_3F ; 11.2 - map_group RUSTBORO_CITY_GYM ; 11.3 - map_group RUSTBORO_CITY_POKEMON_SCHOOL ; 11.4 - map_group RUSTBORO_CITY_POKEMON_CENTER_1F ; 11.5 - map_group RUSTBORO_CITY_POKEMON_CENTER_2F ; 11.6 - map_group RUSTBORO_CITY_MART ; 11.7 - map_group RUSTBORO_CITY_FLAT_1_1F ; 11.8 - map_group RUSTBORO_CITY_FLAT_1_2F ; 11.9 - map_group RUSTBORO_CITY_HOUSE_1 ; 11.10 - map_group RUSTBORO_CITY_CUTTERS_HOUSE ; 11.11 - map_group RUSTBORO_CITY_HOUSE_2 ; 11.12 - map_group RUSTBORO_CITY_FLAT_2_1F ; 11.13 - map_group RUSTBORO_CITY_FLAT_2_2F ; 11.14 - map_group RUSTBORO_CITY_FLAT_2_3F ; 11.15 - map_group RUSTBORO_CITY_HOUSE_3 ; 11.16 + map_group RUSTBORO_CITY_DEVON_CORP_1F @ 11.0 + map_group RUSTBORO_CITY_DEVON_CORP_2F @ 11.1 + map_group RUSTBORO_CITY_DEVON_CORP_3F @ 11.2 + map_group RUSTBORO_CITY_GYM @ 11.3 + map_group RUSTBORO_CITY_POKEMON_SCHOOL @ 11.4 + map_group RUSTBORO_CITY_POKEMON_CENTER_1F @ 11.5 + map_group RUSTBORO_CITY_POKEMON_CENTER_2F @ 11.6 + map_group RUSTBORO_CITY_MART @ 11.7 + map_group RUSTBORO_CITY_FLAT_1_1F @ 11.8 + map_group RUSTBORO_CITY_FLAT_1_2F @ 11.9 + map_group RUSTBORO_CITY_HOUSE_1 @ 11.10 + map_group RUSTBORO_CITY_CUTTERS_HOUSE @ 11.11 + map_group RUSTBORO_CITY_HOUSE_2 @ 11.12 + map_group RUSTBORO_CITY_FLAT_2_1F @ 11.13 + map_group RUSTBORO_CITY_FLAT_2_2F @ 11.14 + map_group RUSTBORO_CITY_FLAT_2_3F @ 11.15 + map_group RUSTBORO_CITY_HOUSE_3 @ 11.16 new_map_group - map_group FORTREE_CITY_HOUSE_1 ; 12.0 - map_group FORTREE_CITY_GYM ; 12.1 - map_group FORTREE_CITY_POKEMON_CENTER_1F ; 12.2 - map_group FORTREE_CITY_POKEMON_CENTER_2F ; 12.3 - map_group FORTREE_CITY_MART ; 12.4 - map_group FORTREE_CITY_HOUSE_2 ; 12.5 - map_group FORTREE_CITY_HOUSE_3 ; 12.6 - map_group FORTREE_CITY_HOUSE_4 ; 12.7 - map_group FORTREE_CITY_HOUSE_5 ; 12.8 - map_group FORTREE_CITY_DECORATION_SHOP ; 12.9 + map_group FORTREE_CITY_HOUSE_1 @ 12.0 + map_group FORTREE_CITY_GYM @ 12.1 + map_group FORTREE_CITY_POKEMON_CENTER_1F @ 12.2 + map_group FORTREE_CITY_POKEMON_CENTER_2F @ 12.3 + map_group FORTREE_CITY_MART @ 12.4 + map_group FORTREE_CITY_HOUSE_2 @ 12.5 + map_group FORTREE_CITY_HOUSE_3 @ 12.6 + map_group FORTREE_CITY_HOUSE_4 @ 12.7 + map_group FORTREE_CITY_HOUSE_5 @ 12.8 + map_group FORTREE_CITY_DECORATION_SHOP @ 12.9 new_map_group - map_group LILYCOVE_CITY_COVE_LILY_MOTEL_1F ; 13.0 - map_group LILYCOVE_CITY_COVE_LILY_MOTEL_2F ; 13.1 - map_group LILYCOVE_CITY_LILYCOVE_MUSEUM_1F ; 13.2 - map_group LILYCOVE_CITY_LILYCOVE_MUSEUM_2F ; 13.3 - map_group LILYCOVE_CITY_CONTEST_LOBBY ; 13.4 - map_group LILYCOVE_CITY_CONTEST_HALL ; 13.5 - map_group LILYCOVE_CITY_POKEMON_CENTER_1F ; 13.6 - map_group LILYCOVE_CITY_POKEMON_CENTER_2F ; 13.7 - map_group LILYCOVE_CITY_UNUSED_MART ; 13.8 - map_group LILYCOVE_CITY_POKEMON_TRAINER_FAN_CLUB ; 13.9 - map_group LILYCOVE_CITY_HARBOR ; 13.10 - map_group LILYCOVE_CITY_MOVE_DELETERS_HOUSE ; 13.11 - map_group LILYCOVE_CITY_HOUSE_1 ; 13.12 - map_group LILYCOVE_CITY_HOUSE_2 ; 13.13 - map_group LILYCOVE_CITY_HOUSE_3 ; 13.14 - map_group LILYCOVE_CITY_HOUSE_4 ; 13.15 - map_group LILYCOVE_CITY_DEPARTMENT_STORE_1F ; 13.16 - map_group LILYCOVE_CITY_DEPARTMENT_STORE_2F ; 13.17 - map_group LILYCOVE_CITY_DEPARTMENT_STORE_3F ; 13.18 - map_group LILYCOVE_CITY_DEPARTMENT_STORE_4F ; 13.19 - map_group LILYCOVE_CITY_DEPARTMENT_STORE_5F ; 13.20 - map_group LILYCOVE_CITY_DEPARTMENT_STORE_ROOFTOP ; 13.21 - map_group LILYCOVE_CITY_DEPARTMENT_STORE_ELEVATOR ; 13.22 + map_group LILYCOVE_CITY_COVE_LILY_MOTEL_1F @ 13.0 + map_group LILYCOVE_CITY_COVE_LILY_MOTEL_2F @ 13.1 + map_group LILYCOVE_CITY_LILYCOVE_MUSEUM_1F @ 13.2 + map_group LILYCOVE_CITY_LILYCOVE_MUSEUM_2F @ 13.3 + map_group LILYCOVE_CITY_CONTEST_LOBBY @ 13.4 + map_group LILYCOVE_CITY_CONTEST_HALL @ 13.5 + map_group LILYCOVE_CITY_POKEMON_CENTER_1F @ 13.6 + map_group LILYCOVE_CITY_POKEMON_CENTER_2F @ 13.7 + map_group LILYCOVE_CITY_UNUSED_MART @ 13.8 + map_group LILYCOVE_CITY_POKEMON_TRAINER_FAN_CLUB @ 13.9 + map_group LILYCOVE_CITY_HARBOR @ 13.10 + map_group LILYCOVE_CITY_MOVE_DELETERS_HOUSE @ 13.11 + map_group LILYCOVE_CITY_HOUSE_1 @ 13.12 + map_group LILYCOVE_CITY_HOUSE_2 @ 13.13 + map_group LILYCOVE_CITY_HOUSE_3 @ 13.14 + map_group LILYCOVE_CITY_HOUSE_4 @ 13.15 + map_group LILYCOVE_CITY_DEPARTMENT_STORE_1F @ 13.16 + map_group LILYCOVE_CITY_DEPARTMENT_STORE_2F @ 13.17 + map_group LILYCOVE_CITY_DEPARTMENT_STORE_3F @ 13.18 + map_group LILYCOVE_CITY_DEPARTMENT_STORE_4F @ 13.19 + map_group LILYCOVE_CITY_DEPARTMENT_STORE_5F @ 13.20 + map_group LILYCOVE_CITY_DEPARTMENT_STORE_ROOFTOP @ 13.21 + map_group LILYCOVE_CITY_DEPARTMENT_STORE_ELEVATOR @ 13.22 new_map_group - map_group MOSSDEEP_CITY_GYM ; 14.0 - map_group MOSSDEEP_CITY_HOUSE_1 ; 14.1 - map_group MOSSDEEP_CITY_HOUSE_2 ; 14.2 - map_group MOSSDEEP_CITY_POKEMON_CENTER_1F ; 14.3 - map_group MOSSDEEP_CITY_POKEMON_CENTER_2F ; 14.4 - map_group MOSSDEEP_CITY_MART ; 14.5 - map_group MOSSDEEP_CITY_HOUSE_3 ; 14.6 - map_group MOSSDEEP_CITY_STEVENS_HOUSE ; 14.7 - map_group MOSSDEEP_CITY_HOUSE_4 ; 14.8 - map_group MOSSDEEP_CITY_SPACE_CENTER_1F ; 14.9 - map_group MOSSDEEP_CITY_SPACE_CENTER_2F ; 14.10 - map_group MOSSDEEP_CITY_GAME_CORNER_1F ; 14.11 - map_group MOSSDEEP_CITY_GAME_CORNER_B1F ; 14.12 + map_group MOSSDEEP_CITY_GYM @ 14.0 + map_group MOSSDEEP_CITY_HOUSE_1 @ 14.1 + map_group MOSSDEEP_CITY_HOUSE_2 @ 14.2 + map_group MOSSDEEP_CITY_POKEMON_CENTER_1F @ 14.3 + map_group MOSSDEEP_CITY_POKEMON_CENTER_2F @ 14.4 + map_group MOSSDEEP_CITY_MART @ 14.5 + map_group MOSSDEEP_CITY_HOUSE_3 @ 14.6 + map_group MOSSDEEP_CITY_STEVENS_HOUSE @ 14.7 + map_group MOSSDEEP_CITY_HOUSE_4 @ 14.8 + map_group MOSSDEEP_CITY_SPACE_CENTER_1F @ 14.9 + map_group MOSSDEEP_CITY_SPACE_CENTER_2F @ 14.10 + map_group MOSSDEEP_CITY_GAME_CORNER_1F @ 14.11 + map_group MOSSDEEP_CITY_GAME_CORNER_B1F @ 14.12 new_map_group - map_group SOOTOPOLIS_CITY_GYM_1F ; 15.0 - map_group SOOTOPOLIS_CITY_GYM_B1F ; 15.1 - map_group SOOTOPOLIS_CITY_POKEMON_CENTER_1F ; 15.2 - map_group SOOTOPOLIS_CITY_POKEMON_CENTER_2F ; 15.3 - map_group SOOTOPOLIS_CITY_MART ; 15.4 - map_group SOOTOPOLIS_CITY_HOUSE_1 ; 15.5 - map_group SOOTOPOLIS_CITY_HOUSE_2 ; 15.6 - map_group SOOTOPOLIS_CITY_HOUSE_3 ; 15.7 - map_group SOOTOPOLIS_CITY_HOUSE_4 ; 15.8 - map_group SOOTOPOLIS_CITY_HOUSE_5 ; 15.9 - map_group SOOTOPOLIS_CITY_HOUSE_6 ; 15.10 - map_group SOOTOPOLIS_CITY_HOUSE_7 ; 15.11 - map_group SOOTOPOLIS_CITY_LOTAD_AND_SEEDOT_HOUSE ; 15.12 - map_group SOOTOPOLIS_CITY_MYSTERY_EVENTS_HOUSE_1F ; 15.13 - map_group SOOTOPOLIS_CITY_MYSTERY_EVENTS_HOUSE_B1F ; 15.14 + map_group SOOTOPOLIS_CITY_GYM_1F @ 15.0 + map_group SOOTOPOLIS_CITY_GYM_B1F @ 15.1 + map_group SOOTOPOLIS_CITY_POKEMON_CENTER_1F @ 15.2 + map_group SOOTOPOLIS_CITY_POKEMON_CENTER_2F @ 15.3 + map_group SOOTOPOLIS_CITY_MART @ 15.4 + map_group SOOTOPOLIS_CITY_HOUSE_1 @ 15.5 + map_group SOOTOPOLIS_CITY_HOUSE_2 @ 15.6 + map_group SOOTOPOLIS_CITY_HOUSE_3 @ 15.7 + map_group SOOTOPOLIS_CITY_HOUSE_4 @ 15.8 + map_group SOOTOPOLIS_CITY_HOUSE_5 @ 15.9 + map_group SOOTOPOLIS_CITY_HOUSE_6 @ 15.10 + map_group SOOTOPOLIS_CITY_HOUSE_7 @ 15.11 + map_group SOOTOPOLIS_CITY_LOTAD_AND_SEEDOT_HOUSE @ 15.12 + map_group SOOTOPOLIS_CITY_MYSTERY_EVENTS_HOUSE_1F @ 15.13 + map_group SOOTOPOLIS_CITY_MYSTERY_EVENTS_HOUSE_B1F @ 15.14 new_map_group - map_group EVER_GRANDE_CITY_SIDNEYS_ROOM ; 16.0 - map_group EVER_GRANDE_CITY_PHOEBES_ROOM ; 16.1 - map_group EVER_GRANDE_CITY_GLACIAS_ROOM ; 16.2 - map_group EVER_GRANDE_CITY_DRAKES_ROOM ; 16.3 - map_group EVER_GRANDE_CITY_CHAMPIONS_ROOM ; 16.4 - map_group EVER_GRANDE_CITY_HALL_1 ; 16.5 - map_group EVER_GRANDE_CITY_HALL_2 ; 16.6 - map_group EVER_GRANDE_CITY_HALL_3 ; 16.7 - map_group EVER_GRANDE_CITY_HALL_4 ; 16.8 - map_group EVER_GRANDE_CITY_HALL_5 ; 16.9 - map_group EVER_GRANDE_CITY_POKEMON_LEAGUE_1F ; 16.10 - map_group EVER_GRANDE_CITY_HALL_OF_FAME ; 16.11 - map_group EVER_GRANDE_CITY_POKEMON_CENTER_1F ; 16.12 - map_group EVER_GRANDE_CITY_POKEMON_CENTER_2F ; 16.13 - map_group EVER_GRANDE_CITY_POKEMON_LEAGUE_2F ; 16.14 + map_group EVER_GRANDE_CITY_SIDNEYS_ROOM @ 16.0 + map_group EVER_GRANDE_CITY_PHOEBES_ROOM @ 16.1 + map_group EVER_GRANDE_CITY_GLACIAS_ROOM @ 16.2 + map_group EVER_GRANDE_CITY_DRAKES_ROOM @ 16.3 + map_group EVER_GRANDE_CITY_CHAMPIONS_ROOM @ 16.4 + map_group EVER_GRANDE_CITY_HALL_1 @ 16.5 + map_group EVER_GRANDE_CITY_HALL_2 @ 16.6 + map_group EVER_GRANDE_CITY_HALL_3 @ 16.7 + map_group EVER_GRANDE_CITY_HALL_4 @ 16.8 + map_group EVER_GRANDE_CITY_HALL_5 @ 16.9 + map_group EVER_GRANDE_CITY_POKEMON_LEAGUE_1F @ 16.10 + map_group EVER_GRANDE_CITY_HALL_OF_FAME @ 16.11 + map_group EVER_GRANDE_CITY_POKEMON_CENTER_1F @ 16.12 + map_group EVER_GRANDE_CITY_POKEMON_CENTER_2F @ 16.13 + map_group EVER_GRANDE_CITY_POKEMON_LEAGUE_2F @ 16.14 new_map_group - map_group ROUTE_104_MR_BRINEYS_HOUSE ; 17.0 - map_group ROUTE_104_PRETTY_PETAL_FLOWER_SHOP ; 17.1 + map_group ROUTE_104_MR_BRINEYS_HOUSE @ 17.0 + map_group ROUTE_104_PRETTY_PETAL_FLOWER_SHOP @ 17.1 new_map_group - map_group ROUTE_111_WINSTRATE_FAMILYS_HOUSE ; 18.0 - map_group ROUTE_111_OLD_LADYS_REST_STOP ; 18.1 + map_group ROUTE_111_WINSTRATE_FAMILYS_HOUSE @ 18.0 + map_group ROUTE_111_OLD_LADYS_REST_STOP @ 18.1 new_map_group - map_group ROUTE_112_CABLE_CAR_STATION ; 19.0 - map_group MT_CHIMNEY_CABLE_CAR_STATION ; 19.1 + map_group ROUTE_112_CABLE_CAR_STATION @ 19.0 + map_group MT_CHIMNEY_CABLE_CAR_STATION @ 19.1 new_map_group - map_group ROUTE_114_FOSSIL_MANIACS_HOUSE ; 20.0 - map_group ROUTE_114_FOSSIL_MANIACS_TUNNEL ; 20.1 - map_group ROUTE_114_LANETTES_HOUSE ; 20.2 + map_group ROUTE_114_FOSSIL_MANIACS_HOUSE @ 20.0 + map_group ROUTE_114_FOSSIL_MANIACS_TUNNEL @ 20.1 + map_group ROUTE_114_LANETTES_HOUSE @ 20.2 new_map_group - map_group ROUTE_116_TUNNELERS_REST_HOUSE ; 21.0 + map_group ROUTE_116_TUNNELERS_REST_HOUSE @ 21.0 new_map_group - map_group ROUTE_117_POKEMON_DAY_CARE ; 22.0 + map_group ROUTE_117_POKEMON_DAY_CARE @ 22.0 new_map_group - map_group ROUTE_121_SAFARI_ZONE_ENTRANCE ; 23.0 + map_group ROUTE_121_SAFARI_ZONE_ENTRANCE @ 23.0 new_map_group - map_group METEOR_FALLS_1F_1R ; 24.0 - map_group METEOR_FALLS_1F_2R ; 24.1 - map_group METEOR_FALLS_B1F_1R ; 24.2 - map_group METEOR_FALLS_B1F_2R ; 24.3 - map_group RUSTURF_TUNNEL ; 24.4 - map_group UNDERWATER_SOOTOPOLIS_CITY ; 24.5 - map_group DESERT_RUINS ; 24.6 - map_group GRANITE_CAVE_1F ; 24.7 - map_group GRANITE_CAVE_B1F ; 24.8 - map_group GRANITE_CAVE_B2F ; 24.9 - map_group GRANITE_CAVE_STEVENS_ROOM ; 24.10 - map_group PETALBURG_WOODS ; 24.11 - map_group MT_CHIMNEY ; 24.12 - map_group JAGGED_PASS ; 24.13 - map_group FIERY_PATH ; 24.14 - map_group MT_PYRE_1F ; 24.15 - map_group MT_PYRE_2F ; 24.16 - map_group MT_PYRE_3F ; 24.17 - map_group MT_PYRE_4F ; 24.18 - map_group MT_PYRE_5F ; 24.19 - map_group MT_PYRE_6F ; 24.20 - map_group MT_PYRE_EXTERIOR ; 24.21 - map_group MT_PYRE_SUMMIT ; 24.22 - map_group AQUA_HIDEOUT_1F ; 24.23 - map_group AQUA_HIDEOUT_B1F ; 24.24 - map_group AQUA_HIDEOUT_B2F ; 24.25 - map_group UNDERWATER_SEAFLOOR_CAVERN ; 24.26 - map_group SEAFLOOR_CAVERN_ENTRANCE ; 24.27 - map_group SEAFLOOR_CAVERN_ROOM_1 ; 24.28 - map_group SEAFLOOR_CAVERN_ROOM_2 ; 24.29 - map_group SEAFLOOR_CAVERN_ROOM_3 ; 24.30 - map_group SEAFLOOR_CAVERN_ROOM_4 ; 24.31 - map_group SEAFLOOR_CAVERN_ROOM_5 ; 24.32 - map_group SEAFLOOR_CAVERN_ROOM_6 ; 24.33 - map_group SEAFLOOR_CAVERN_ROOM_7 ; 24.34 - map_group SEAFLOOR_CAVERN_ROOM_8 ; 24.35 - map_group SEAFLOOR_CAVERN_ROOM_9 ; 24.36 - map_group CAVE_OF_ORIGIN_ENTRANCE ; 24.37 - map_group CAVE_OF_ORIGIN_1F ; 24.38 - map_group CAVE_OF_ORIGIN_UNUSED_RUBY_SAPPHIRE_MAP_1 ; 24.39 - map_group CAVE_OF_ORIGIN_UNUSED_RUBY_SAPPHIRE_MAP_2 ; 24.40 - map_group CAVE_OF_ORIGIN_UNUSED_RUBY_SAPPHIRE_MAP_3 ; 24.41 - map_group CAVE_OF_ORIGIN_B1F ; 24.42 - map_group VICTORY_ROAD_1F ; 24.43 - map_group VICTORY_ROAD_B1F ; 24.44 - map_group VICTORY_ROAD_B2F ; 24.45 - map_group SHOAL_CAVE_LOW_TIDE_ENTRANCE_ROOM ; 24.46 - map_group SHOAL_CAVE_LOW_TIDE_INNER_ROOM ; 24.47 - map_group SHOAL_CAVE_LOW_TIDE_STAIRS_ROOM ; 24.48 - map_group SHOAL_CAVE_LOW_TIDE_LOWER_ROOM ; 24.49 - map_group SHOAL_CAVE_HIGH_TIDE_ENTRANCE_ROOM ; 24.50 - map_group SHOAL_CAVE_HIGH_TIDE_INNER_ROOM ; 24.51 - map_group NEW_MAUVILLE_ENTRANCE ; 24.52 - map_group NEW_MAUVILLE_INSIDE ; 24.53 - map_group ABANDONED_SHIP_DECK ; 24.54 - map_group ABANDONED_SHIP_CORRIDORS_1F ; 24.55 - map_group ABANDONED_SHIP_ROOMS_1F ; 24.56 - map_group ABANDONED_SHIP_CORRIDORS_B1F ; 24.57 - map_group ABANDONED_SHIP_ROOMS_B1F ; 24.58 - map_group ABANDONED_SHIP_ROOMS_2_B1F ; 24.59 - map_group ABANDONED_SHIP_UNDERWATER_1 ; 24.60 - map_group ABANDONED_SHIP_ROOM_B1F ; 24.61 - map_group ABANDONED_SHIP_ROOMS_2_1F ; 24.62 - map_group ABANDONED_SHIP_CAPTAINS_OFFICE ; 24.63 - map_group ABANDONED_SHIP_UNDERWATER_2 ; 24.64 - map_group ABANDONED_SHIP_HIDDEN_FLOOR_CORRIDORS ; 24.65 - map_group ABANDONED_SHIP_HIDDEN_FLOOR_ROOMS ; 24.66 - map_group ISLAND_CAVE ; 24.67 - map_group ANCIENT_TOMB ; 24.68 - map_group UNDERWATER_ROUTE_134 ; 24.69 - map_group UNDERWATER_SEALED_CHAMBER ; 24.70 - map_group SEALED_CHAMBER_OUTER_ROOM ; 24.71 - map_group SEALED_CHAMBER_INNER_ROOM ; 24.72 - map_group SCORCHED_SLAB ; 24.73 - map_group AQUA_HIDEOUT_UNUSED_RUBY_MAP_1 ; 24.74 - map_group AQUA_HIDEOUT_UNUSED_RUBY_MAP_2 ; 24.75 - map_group AQUA_HIDEOUT_UNUSED_RUBY_MAP_3 ; 24.76 - map_group SKY_PILLAR_ENTRANCE ; 24.77 - map_group SKY_PILLAR_OUTSIDE ; 24.78 - map_group SKY_PILLAR_1F ; 24.79 - map_group SKY_PILLAR_2F ; 24.80 - map_group SKY_PILLAR_3F ; 24.81 - map_group SKY_PILLAR_4F ; 24.82 - map_group SHOAL_CAVE_LOW_TIDE_ICE_ROOM ; 24.83 - map_group SKY_PILLAR_5F ; 24.84 - map_group SKY_PILLAR_TOP ; 24.85 - map_group MAGMA_HIDEOUT_1F ; 24.86 - map_group MAGMA_HIDEOUT_2F_1R ; 24.87 - map_group MAGMA_HIDEOUT_2F_2R ; 24.88 - map_group MAGMA_HIDEOUT_3F_1R ; 24.89 - map_group MAGMA_HIDEOUT_3F_2R ; 24.90 - map_group MAGMA_HIDEOUT_4F ; 24.91 - map_group MAGMA_HIDEOUT_3F_3R ; 24.92 - map_group MAGMA_HIDEOUT_2F_3R ; 24.93 - map_group MIRAGE_TOWER_1F ; 24.94 - map_group MIRAGE_TOWER_2F ; 24.95 - map_group MIRAGE_TOWER_3F ; 24.96 - map_group MIRAGE_TOWER_4F ; 24.97 - map_group DESERT_UNDERPASS ; 24.98 - map_group ARTISAN_CAVE_B1F ; 24.99 - map_group ARTISAN_CAVE_1F ; 24.100 - map_group UNDERWATER_MARINE_CAVE ; 24.101 - map_group MARINE_CAVE_ENTRANCE ; 24.102 - map_group MARINE_CAVE_END ; 24.103 - map_group TERRA_CAVE_ENTRANCE ; 24.104 - map_group TERRA_CAVE_END ; 24.105 - map_group ALTERING_CAVE ; 24.106 - map_group METEOR_FALLS_STEVENS_CAVE ; 24.107 + map_group METEOR_FALLS_1F_1R @ 24.0 + map_group METEOR_FALLS_1F_2R @ 24.1 + map_group METEOR_FALLS_B1F_1R @ 24.2 + map_group METEOR_FALLS_B1F_2R @ 24.3 + map_group RUSTURF_TUNNEL @ 24.4 + map_group UNDERWATER_SOOTOPOLIS_CITY @ 24.5 + map_group DESERT_RUINS @ 24.6 + map_group GRANITE_CAVE_1F @ 24.7 + map_group GRANITE_CAVE_B1F @ 24.8 + map_group GRANITE_CAVE_B2F @ 24.9 + map_group GRANITE_CAVE_STEVENS_ROOM @ 24.10 + map_group PETALBURG_WOODS @ 24.11 + map_group MT_CHIMNEY @ 24.12 + map_group JAGGED_PASS @ 24.13 + map_group FIERY_PATH @ 24.14 + map_group MT_PYRE_1F @ 24.15 + map_group MT_PYRE_2F @ 24.16 + map_group MT_PYRE_3F @ 24.17 + map_group MT_PYRE_4F @ 24.18 + map_group MT_PYRE_5F @ 24.19 + map_group MT_PYRE_6F @ 24.20 + map_group MT_PYRE_EXTERIOR @ 24.21 + map_group MT_PYRE_SUMMIT @ 24.22 + map_group AQUA_HIDEOUT_1F @ 24.23 + map_group AQUA_HIDEOUT_B1F @ 24.24 + map_group AQUA_HIDEOUT_B2F @ 24.25 + map_group UNDERWATER_SEAFLOOR_CAVERN @ 24.26 + map_group SEAFLOOR_CAVERN_ENTRANCE @ 24.27 + map_group SEAFLOOR_CAVERN_ROOM_1 @ 24.28 + map_group SEAFLOOR_CAVERN_ROOM_2 @ 24.29 + map_group SEAFLOOR_CAVERN_ROOM_3 @ 24.30 + map_group SEAFLOOR_CAVERN_ROOM_4 @ 24.31 + map_group SEAFLOOR_CAVERN_ROOM_5 @ 24.32 + map_group SEAFLOOR_CAVERN_ROOM_6 @ 24.33 + map_group SEAFLOOR_CAVERN_ROOM_7 @ 24.34 + map_group SEAFLOOR_CAVERN_ROOM_8 @ 24.35 + map_group SEAFLOOR_CAVERN_ROOM_9 @ 24.36 + map_group CAVE_OF_ORIGIN_ENTRANCE @ 24.37 + map_group CAVE_OF_ORIGIN_1F @ 24.38 + map_group CAVE_OF_ORIGIN_UNUSED_RUBY_SAPPHIRE_MAP_1 @ 24.39 + map_group CAVE_OF_ORIGIN_UNUSED_RUBY_SAPPHIRE_MAP_2 @ 24.40 + map_group CAVE_OF_ORIGIN_UNUSED_RUBY_SAPPHIRE_MAP_3 @ 24.41 + map_group CAVE_OF_ORIGIN_B1F @ 24.42 + map_group VICTORY_ROAD_1F @ 24.43 + map_group VICTORY_ROAD_B1F @ 24.44 + map_group VICTORY_ROAD_B2F @ 24.45 + map_group SHOAL_CAVE_LOW_TIDE_ENTRANCE_ROOM @ 24.46 + map_group SHOAL_CAVE_LOW_TIDE_INNER_ROOM @ 24.47 + map_group SHOAL_CAVE_LOW_TIDE_STAIRS_ROOM @ 24.48 + map_group SHOAL_CAVE_LOW_TIDE_LOWER_ROOM @ 24.49 + map_group SHOAL_CAVE_HIGH_TIDE_ENTRANCE_ROOM @ 24.50 + map_group SHOAL_CAVE_HIGH_TIDE_INNER_ROOM @ 24.51 + map_group NEW_MAUVILLE_ENTRANCE @ 24.52 + map_group NEW_MAUVILLE_INSIDE @ 24.53 + map_group ABANDONED_SHIP_DECK @ 24.54 + map_group ABANDONED_SHIP_CORRIDORS_1F @ 24.55 + map_group ABANDONED_SHIP_ROOMS_1F @ 24.56 + map_group ABANDONED_SHIP_CORRIDORS_B1F @ 24.57 + map_group ABANDONED_SHIP_ROOMS_B1F @ 24.58 + map_group ABANDONED_SHIP_ROOMS_2_B1F @ 24.59 + map_group ABANDONED_SHIP_UNDERWATER_1 @ 24.60 + map_group ABANDONED_SHIP_ROOM_B1F @ 24.61 + map_group ABANDONED_SHIP_ROOMS_2_1F @ 24.62 + map_group ABANDONED_SHIP_CAPTAINS_OFFICE @ 24.63 + map_group ABANDONED_SHIP_UNDERWATER_2 @ 24.64 + map_group ABANDONED_SHIP_HIDDEN_FLOOR_CORRIDORS @ 24.65 + map_group ABANDONED_SHIP_HIDDEN_FLOOR_ROOMS @ 24.66 + map_group ISLAND_CAVE @ 24.67 + map_group ANCIENT_TOMB @ 24.68 + map_group UNDERWATER_ROUTE_134 @ 24.69 + map_group UNDERWATER_SEALED_CHAMBER @ 24.70 + map_group SEALED_CHAMBER_OUTER_ROOM @ 24.71 + map_group SEALED_CHAMBER_INNER_ROOM @ 24.72 + map_group SCORCHED_SLAB @ 24.73 + map_group AQUA_HIDEOUT_UNUSED_RUBY_MAP_1 @ 24.74 + map_group AQUA_HIDEOUT_UNUSED_RUBY_MAP_2 @ 24.75 + map_group AQUA_HIDEOUT_UNUSED_RUBY_MAP_3 @ 24.76 + map_group SKY_PILLAR_ENTRANCE @ 24.77 + map_group SKY_PILLAR_OUTSIDE @ 24.78 + map_group SKY_PILLAR_1F @ 24.79 + map_group SKY_PILLAR_2F @ 24.80 + map_group SKY_PILLAR_3F @ 24.81 + map_group SKY_PILLAR_4F @ 24.82 + map_group SHOAL_CAVE_LOW_TIDE_ICE_ROOM @ 24.83 + map_group SKY_PILLAR_5F @ 24.84 + map_group SKY_PILLAR_TOP @ 24.85 + map_group MAGMA_HIDEOUT_1F @ 24.86 + map_group MAGMA_HIDEOUT_2F_1R @ 24.87 + map_group MAGMA_HIDEOUT_2F_2R @ 24.88 + map_group MAGMA_HIDEOUT_3F_1R @ 24.89 + map_group MAGMA_HIDEOUT_3F_2R @ 24.90 + map_group MAGMA_HIDEOUT_4F @ 24.91 + map_group MAGMA_HIDEOUT_3F_3R @ 24.92 + map_group MAGMA_HIDEOUT_2F_3R @ 24.93 + map_group MIRAGE_TOWER_1F @ 24.94 + map_group MIRAGE_TOWER_2F @ 24.95 + map_group MIRAGE_TOWER_3F @ 24.96 + map_group MIRAGE_TOWER_4F @ 24.97 + map_group DESERT_UNDERPASS @ 24.98 + map_group ARTISAN_CAVE_B1F @ 24.99 + map_group ARTISAN_CAVE_1F @ 24.100 + map_group UNDERWATER_MARINE_CAVE @ 24.101 + map_group MARINE_CAVE_ENTRANCE @ 24.102 + map_group MARINE_CAVE_END @ 24.103 + map_group TERRA_CAVE_ENTRANCE @ 24.104 + map_group TERRA_CAVE_END @ 24.105 + map_group ALTERING_CAVE @ 24.106 + map_group METEOR_FALLS_STEVENS_CAVE @ 24.107 new_map_group - map_group SECRET_BASE_RED_CAVE_1 ; 25.0 - map_group SECRET_BASE_BROWN_CAVE_1 ; 25.1 - map_group SECRET_BASE_BLUE_CAVE_1 ; 25.2 - map_group SECRET_BASE_YELLOW_CAVE_1 ; 25.3 - map_group SECRET_BASE_TREE_1 ; 25.4 - map_group SECRET_BASE_SHRUB_1 ; 25.5 - map_group SECRET_BASE_RED_CAVE_2 ; 25.6 - map_group SECRET_BASE_BROWN_CAVE_2 ; 25.7 - map_group SECRET_BASE_BLUE_CAVE_2 ; 25.8 - map_group SECRET_BASE_YELLOW_CAVE_2 ; 25.9 - map_group SECRET_BASE_TREE_2 ; 25.10 - map_group SECRET_BASE_SHRUB_2 ; 25.11 - map_group SECRET_BASE_RED_CAVE_3 ; 25.12 - map_group SECRET_BASE_BROWN_CAVE_3 ; 25.13 - map_group SECRET_BASE_BLUE_CAVE_3 ; 25.14 - map_group SECRET_BASE_YELLOW_CAVE_3 ; 25.15 - map_group SECRET_BASE_TREE_3 ; 25.16 - map_group SECRET_BASE_SHRUB_3 ; 25.17 - map_group SECRET_BASE_RED_CAVE_4 ; 25.18 - map_group SECRET_BASE_BROWN_CAVE_4 ; 25.19 - map_group SECRET_BASE_BLUE_CAVE_4 ; 25.20 - map_group SECRET_BASE_YELLOW_CAVE_4 ; 25.21 - map_group SECRET_BASE_TREE_4 ; 25.22 - map_group SECRET_BASE_SHRUB_4 ; 25.23 - map_group SINGLE_BATTLE_COLOSSEUM ; 25.24 - map_group TRADE_CENTER ; 25.25 - map_group RECORD_CORNER ; 25.26 - map_group DOUBLE_BATTLE_COLOSSEUM ; 25.27 - map_group LINK_CONTEST_ROOM_1 ; 25.28 - map_group UNKNOWN_MAP_25_29 ; 25.29 - map_group UNKNOWN_MAP_25_30 ; 25.30 - map_group UNKNOWN_MAP_25_31 ; 25.31 - map_group UNKNOWN_MAP_25_32 ; 25.32 - map_group UNKNOWN_MAP_25_33 ; 25.33 - map_group UNKNOWN_MAP_25_34 ; 25.34 - map_group LINK_CONTEST_ROOM_2 ; 25.35 - map_group LINK_CONTEST_ROOM_3 ; 25.36 - map_group LINK_CONTEST_ROOM_4 ; 25.37 - map_group LINK_CONTEST_ROOM_5 ; 25.38 - map_group LINK_CONTEST_ROOM_6 ; 25.39 - map_group INSIDE_OF_TRUCK ; 25.40 - map_group SS_TIDAL_CORRIDOR ; 25.41 - map_group SS_TIDAL_LOWER_DECK ; 25.42 - map_group SS_TIDAL_ROOMS ; 25.43 - map_group BATTLE_PYRAMID_SQUARE_01 ; 25.44 - map_group BATTLE_PYRAMID_SQUARE_02 ; 25.45 - map_group BATTLE_PYRAMID_SQUARE_03 ; 25.46 - map_group BATTLE_PYRAMID_SQUARE_04 ; 25.47 - map_group BATTLE_PYRAMID_SQUARE_05 ; 25.48 - map_group BATTLE_PYRAMID_SQUARE_06 ; 25.49 - map_group BATTLE_PYRAMID_SQUARE_07 ; 25.50 - map_group BATTLE_PYRAMID_SQUARE_08 ; 25.51 - map_group BATTLE_PYRAMID_SQUARE_09 ; 25.52 - map_group BATTLE_PYRAMID_SQUARE_10 ; 25.53 - map_group BATTLE_PYRAMID_SQUARE_11 ; 25.54 - map_group BATTLE_PYRAMID_SQUARE_12 ; 25.55 - map_group BATTLE_PYRAMID_SQUARE_13 ; 25.56 - map_group BATTLE_PYRAMID_SQUARE_14 ; 25.57 - map_group BATTLE_PYRAMID_SQUARE_15 ; 25.58 - map_group BATTLE_PYRAMID_SQUARE_16 ; 25.59 - map_group UNION_ROOM ; 25.60 + map_group SECRET_BASE_RED_CAVE_1 @ 25.0 + map_group SECRET_BASE_BROWN_CAVE_1 @ 25.1 + map_group SECRET_BASE_BLUE_CAVE_1 @ 25.2 + map_group SECRET_BASE_YELLOW_CAVE_1 @ 25.3 + map_group SECRET_BASE_TREE_1 @ 25.4 + map_group SECRET_BASE_SHRUB_1 @ 25.5 + map_group SECRET_BASE_RED_CAVE_2 @ 25.6 + map_group SECRET_BASE_BROWN_CAVE_2 @ 25.7 + map_group SECRET_BASE_BLUE_CAVE_2 @ 25.8 + map_group SECRET_BASE_YELLOW_CAVE_2 @ 25.9 + map_group SECRET_BASE_TREE_2 @ 25.10 + map_group SECRET_BASE_SHRUB_2 @ 25.11 + map_group SECRET_BASE_RED_CAVE_3 @ 25.12 + map_group SECRET_BASE_BROWN_CAVE_3 @ 25.13 + map_group SECRET_BASE_BLUE_CAVE_3 @ 25.14 + map_group SECRET_BASE_YELLOW_CAVE_3 @ 25.15 + map_group SECRET_BASE_TREE_3 @ 25.16 + map_group SECRET_BASE_SHRUB_3 @ 25.17 + map_group SECRET_BASE_RED_CAVE_4 @ 25.18 + map_group SECRET_BASE_BROWN_CAVE_4 @ 25.19 + map_group SECRET_BASE_BLUE_CAVE_4 @ 25.20 + map_group SECRET_BASE_YELLOW_CAVE_4 @ 25.21 + map_group SECRET_BASE_TREE_4 @ 25.22 + map_group SECRET_BASE_SHRUB_4 @ 25.23 + map_group SINGLE_BATTLE_COLOSSEUM @ 25.24 + map_group TRADE_CENTER @ 25.25 + map_group RECORD_CORNER @ 25.26 + map_group DOUBLE_BATTLE_COLOSSEUM @ 25.27 + map_group LINK_CONTEST_ROOM_1 @ 25.28 + map_group UNKNOWN_MAP_25_29 @ 25.29 + map_group UNKNOWN_MAP_25_30 @ 25.30 + map_group UNKNOWN_MAP_25_31 @ 25.31 + map_group UNKNOWN_MAP_25_32 @ 25.32 + map_group UNKNOWN_MAP_25_33 @ 25.33 + map_group UNKNOWN_MAP_25_34 @ 25.34 + map_group LINK_CONTEST_ROOM_2 @ 25.35 + map_group LINK_CONTEST_ROOM_3 @ 25.36 + map_group LINK_CONTEST_ROOM_4 @ 25.37 + map_group LINK_CONTEST_ROOM_5 @ 25.38 + map_group LINK_CONTEST_ROOM_6 @ 25.39 + map_group INSIDE_OF_TRUCK @ 25.40 + map_group SS_TIDAL_CORRIDOR @ 25.41 + map_group SS_TIDAL_LOWER_DECK @ 25.42 + map_group SS_TIDAL_ROOMS @ 25.43 + map_group BATTLE_PYRAMID_SQUARE_01 @ 25.44 + map_group BATTLE_PYRAMID_SQUARE_02 @ 25.45 + map_group BATTLE_PYRAMID_SQUARE_03 @ 25.46 + map_group BATTLE_PYRAMID_SQUARE_04 @ 25.47 + map_group BATTLE_PYRAMID_SQUARE_05 @ 25.48 + map_group BATTLE_PYRAMID_SQUARE_06 @ 25.49 + map_group BATTLE_PYRAMID_SQUARE_07 @ 25.50 + map_group BATTLE_PYRAMID_SQUARE_08 @ 25.51 + map_group BATTLE_PYRAMID_SQUARE_09 @ 25.52 + map_group BATTLE_PYRAMID_SQUARE_10 @ 25.53 + map_group BATTLE_PYRAMID_SQUARE_11 @ 25.54 + map_group BATTLE_PYRAMID_SQUARE_12 @ 25.55 + map_group BATTLE_PYRAMID_SQUARE_13 @ 25.56 + map_group BATTLE_PYRAMID_SQUARE_14 @ 25.57 + map_group BATTLE_PYRAMID_SQUARE_15 @ 25.58 + map_group BATTLE_PYRAMID_SQUARE_16 @ 25.59 + map_group UNION_ROOM @ 25.60 new_map_group - map_group SAFARI_ZONE_NORTHWEST ; 26.0 - map_group SAFARI_ZONE_NORTH ; 26.1 - map_group SAFARI_ZONE_SOUTHWEST ; 26.2 - map_group SAFARI_ZONE_SOUTH ; 26.3 - map_group BATTLE_FRONTIER_OUTSIDE_WEST ; 26.4 - map_group BATTLE_FRONTIER_BATTLE_TOWER_LOBBY ; 26.5 - map_group BATTLE_FRONTIER_BATTLE_TOWER_ELEVATOR ; 26.6 - map_group BATTLE_FRONTIER_BATTLE_TOWER_CORRIDOR ; 26.7 - map_group BATTLE_FRONTIER_BATTLE_TOWER_BATTLE_ROOM ; 26.8 - map_group SOUTHERN_ISLAND_EXTERIOR ; 26.9 - map_group SOUTHERN_ISLAND_INTERIOR ; 26.10 - map_group SAFARI_ZONE_REST_HOUSE ; 26.11 - map_group SAFARI_ZONE_NORTHEAST ; 26.12 - map_group SAFARI_ZONE_SOUTHEAST ; 26.13 - map_group BATTLE_FRONTIER_OUTSIDE_EAST ; 26.14 - map_group BATTLE_FRONTIER_BATTLE_TOWER_MULTI_BATTLE_ROOM ; 26.15 - map_group BATTLE_FRONTIER_BATTLE_TOWER_CORRIDOR_2 ; 26.16 - map_group BATTLE_FRONTIER_BATTLE_TOWER_BATTLE_ROOM_2 ; 26.17 - map_group BATTLE_FRONTIER_BATTLE_DOME_LOBBY ; 26.18 - map_group BATTLE_FRONTIER_BATTLE_DOME_CORRIDOR ; 26.19 - map_group BATTLE_FRONTIER_BATTLE_DOME_PRE_BATTLE_ROOM ; 26.20 - map_group BATTLE_FRONTIER_BATTLE_DOME_BATTLE_ROOM ; 26.21 - map_group BATTLE_FRONTIER_BATTLE_PALACE_LOBBY ; 26.22 - map_group BATTLE_FRONTIER_BATTLE_PALACE_CORRIDOR ; 26.23 - map_group BATTLE_FRONTIER_BATTLE_PALACE_BATTLE_ROOM ; 26.24 - map_group BATTLE_FRONTIER_BATTLE_PYRAMID_LOBBY ; 26.25 - map_group BATTLE_FRONTIER_BATTLE_PYRAMID_EMPTY_SQUARE ; 26.26 - map_group BATTLE_FRONTIER_BATTLE_PYRAMID_TOP ; 26.27 - map_group BATTLE_FRONTIER_BATTLE_ARENA_LOBBY ; 26.28 - map_group BATTLE_FRONTIER_BATTLE_ARENA_CORRIDOR ; 26.29 - map_group BATTLE_FRONTIER_BATTLE_ARENA_BATTLE_ROOM ; 26.30 - map_group BATTLE_FRONTIER_BATTLE_FACTORY_LOBBY ; 26.31 - map_group BATTLE_FRONTIER_BATTLE_FACTORY_PRE_BATTLE_ROOM ; 26.32 - map_group BATTLE_FRONTIER_BATTLE_FACTORY_BATTLE_ROOM ; 26.33 - map_group BATTLE_FRONTIER_BATTLE_PIKE_LOBBY ; 26.34 - map_group BATTLE_FRONTIER_BATTLE_PIKE_CORRIDOR ; 26.35 - map_group BATTLE_FRONTIER_BATTLE_PIKE_THREE_PATH_ROOM ; 26.36 - map_group BATTLE_FRONTIER_BATTLE_PIKE_RANDOM_ROOM_1 ; 26.37 - map_group BATTLE_FRONTIER_BATTLE_PIKE_RANDOM_ROOM_2 ; 26.38 - map_group BATTLE_FRONTIER_BATTLE_PIKE_RANDOM_ROOM_3 ; 26.39 - map_group BATTLE_FRONTIER_RANKING_HALL ; 26.40 - map_group BATTLE_FRONTIER_LOUNGE_1 ; 26.41 - map_group BATTLE_FRONTIER_BATTLE_POINT_EXCHANGE_SERVICE_CORNER ; 26.42 - map_group BATTLE_FRONTIER_LOUNGE_2 ; 26.43 - map_group BATTLE_FRONTIER_LOUNGE_3 ; 26.44 - map_group BATTLE_FRONTIER_LOUNGE_4 ; 26.45 - map_group BATTLE_FRONTIER_SCOTTS_HOUSE ; 26.46 - map_group BATTLE_FRONTIER_LOUNGE_5 ; 26.47 - map_group BATTLE_FRONTIER_LOUNGE_6 ; 26.48 - map_group BATTLE_FRONTIER_LOUNGE_7 ; 26.49 - map_group BATTLE_FRONTIER_RECEPTION_GATE ; 26.50 - map_group BATTLE_FRONTIER_LOUNGE_8 ; 26.51 - map_group BATTLE_FRONTIER_LOUNGE_9 ; 26.52 - map_group BATTLE_FRONTIER_POKEMON_CENTER_1F ; 26.53 - map_group BATTLE_FRONTIER_POKEMON_CENTER_2F ; 26.54 - map_group BATTLE_FRONTIER_MART ; 26.55 - map_group FARAWAY_ISLAND_ENTRANCE ; 26.56 - map_group FARAWAY_ISLAND_INTERIOR ; 26.57 - map_group BIRTH_ISLAND_EXTERIOR ; 26.58 - map_group BIRTH_ISLAND_HARBOR ; 26.59 - map_group TRAINER_HILL_ENTRANCE ; 26.60 - map_group TRAINER_HILL_1F ; 26.61 - map_group TRAINER_HILL_2F ; 26.62 - map_group TRAINER_HILL_3F ; 26.63 - map_group TRAINER_HILL_4F ; 26.64 - map_group TRAINER_HILL_ROOF ; 26.65 - map_group NAVEL_ROCK_EXTERIOR ; 26.66 - map_group NAVEL_ROCK_HARBOR ; 26.67 - map_group NAVEL_ROCK_ENTRANCE ; 26.68 - map_group NAVEL_ROCK_B1F ; 26.69 - map_group NAVEL_ROCK_FORK ; 26.70 - map_group NAVEL_ROCK_UP_1 ; 26.71 - map_group NAVEL_ROCK_UP_2 ; 26.72 - map_group NAVEL_ROCK_UP_3 ; 26.73 - map_group NAVEL_ROCK_UP_4 ; 26.74 - map_group NAVEL_ROCK_TOP ; 26.75 - map_group NAVEL_ROCK_DOWN_01 ; 26.76 - map_group NAVEL_ROCK_DOWN_02 ; 26.77 - map_group NAVEL_ROCK_DOWN_03 ; 26.78 - map_group NAVEL_ROCK_DOWN_04 ; 26.79 - map_group NAVEL_ROCK_DOWN_05 ; 26.80 - map_group NAVEL_ROCK_DOWN_06 ; 26.81 - map_group NAVEL_ROCK_DOWN_07 ; 26.82 - map_group NAVEL_ROCK_DOWN_08 ; 26.83 - map_group NAVEL_ROCK_DOWN_09 ; 26.84 - map_group NAVEL_ROCK_DOWN_10 ; 26.85 - map_group NAVEL_ROCK_DOWN_11 ; 26.86 - map_group NAVEL_ROCK_BOTTOM ; 26.87 - map_group TRAINER_HILL_ELEVATOR ; 26.88 + map_group SAFARI_ZONE_NORTHWEST @ 26.0 + map_group SAFARI_ZONE_NORTH @ 26.1 + map_group SAFARI_ZONE_SOUTHWEST @ 26.2 + map_group SAFARI_ZONE_SOUTH @ 26.3 + map_group BATTLE_FRONTIER_OUTSIDE_WEST @ 26.4 + map_group BATTLE_FRONTIER_BATTLE_TOWER_LOBBY @ 26.5 + map_group BATTLE_FRONTIER_BATTLE_TOWER_ELEVATOR @ 26.6 + map_group BATTLE_FRONTIER_BATTLE_TOWER_CORRIDOR @ 26.7 + map_group BATTLE_FRONTIER_BATTLE_TOWER_BATTLE_ROOM @ 26.8 + map_group SOUTHERN_ISLAND_EXTERIOR @ 26.9 + map_group SOUTHERN_ISLAND_INTERIOR @ 26.10 + map_group SAFARI_ZONE_REST_HOUSE @ 26.11 + map_group SAFARI_ZONE_NORTHEAST @ 26.12 + map_group SAFARI_ZONE_SOUTHEAST @ 26.13 + map_group BATTLE_FRONTIER_OUTSIDE_EAST @ 26.14 + map_group BATTLE_FRONTIER_BATTLE_TOWER_MULTI_BATTLE_ROOM @ 26.15 + map_group BATTLE_FRONTIER_BATTLE_TOWER_CORRIDOR_2 @ 26.16 + map_group BATTLE_FRONTIER_BATTLE_TOWER_BATTLE_ROOM_2 @ 26.17 + map_group BATTLE_FRONTIER_BATTLE_DOME_LOBBY @ 26.18 + map_group BATTLE_FRONTIER_BATTLE_DOME_CORRIDOR @ 26.19 + map_group BATTLE_FRONTIER_BATTLE_DOME_PRE_BATTLE_ROOM @ 26.20 + map_group BATTLE_FRONTIER_BATTLE_DOME_BATTLE_ROOM @ 26.21 + map_group BATTLE_FRONTIER_BATTLE_PALACE_LOBBY @ 26.22 + map_group BATTLE_FRONTIER_BATTLE_PALACE_CORRIDOR @ 26.23 + map_group BATTLE_FRONTIER_BATTLE_PALACE_BATTLE_ROOM @ 26.24 + map_group BATTLE_FRONTIER_BATTLE_PYRAMID_LOBBY @ 26.25 + map_group BATTLE_FRONTIER_BATTLE_PYRAMID_EMPTY_SQUARE @ 26.26 + map_group BATTLE_FRONTIER_BATTLE_PYRAMID_TOP @ 26.27 + map_group BATTLE_FRONTIER_BATTLE_ARENA_LOBBY @ 26.28 + map_group BATTLE_FRONTIER_BATTLE_ARENA_CORRIDOR @ 26.29 + map_group BATTLE_FRONTIER_BATTLE_ARENA_BATTLE_ROOM @ 26.30 + map_group BATTLE_FRONTIER_BATTLE_FACTORY_LOBBY @ 26.31 + map_group BATTLE_FRONTIER_BATTLE_FACTORY_PRE_BATTLE_ROOM @ 26.32 + map_group BATTLE_FRONTIER_BATTLE_FACTORY_BATTLE_ROOM @ 26.33 + map_group BATTLE_FRONTIER_BATTLE_PIKE_LOBBY @ 26.34 + map_group BATTLE_FRONTIER_BATTLE_PIKE_CORRIDOR @ 26.35 + map_group BATTLE_FRONTIER_BATTLE_PIKE_THREE_PATH_ROOM @ 26.36 + map_group BATTLE_FRONTIER_BATTLE_PIKE_RANDOM_ROOM_1 @ 26.37 + map_group BATTLE_FRONTIER_BATTLE_PIKE_RANDOM_ROOM_2 @ 26.38 + map_group BATTLE_FRONTIER_BATTLE_PIKE_RANDOM_ROOM_3 @ 26.39 + map_group BATTLE_FRONTIER_RANKING_HALL @ 26.40 + map_group BATTLE_FRONTIER_LOUNGE_1 @ 26.41 + map_group BATTLE_FRONTIER_BATTLE_POINT_EXCHANGE_SERVICE_CORNER @ 26.42 + map_group BATTLE_FRONTIER_LOUNGE_2 @ 26.43 + map_group BATTLE_FRONTIER_LOUNGE_3 @ 26.44 + map_group BATTLE_FRONTIER_LOUNGE_4 @ 26.45 + map_group BATTLE_FRONTIER_SCOTTS_HOUSE @ 26.46 + map_group BATTLE_FRONTIER_LOUNGE_5 @ 26.47 + map_group BATTLE_FRONTIER_LOUNGE_6 @ 26.48 + map_group BATTLE_FRONTIER_LOUNGE_7 @ 26.49 + map_group BATTLE_FRONTIER_RECEPTION_GATE @ 26.50 + map_group BATTLE_FRONTIER_LOUNGE_8 @ 26.51 + map_group BATTLE_FRONTIER_LOUNGE_9 @ 26.52 + map_group BATTLE_FRONTIER_POKEMON_CENTER_1F @ 26.53 + map_group BATTLE_FRONTIER_POKEMON_CENTER_2F @ 26.54 + map_group BATTLE_FRONTIER_MART @ 26.55 + map_group FARAWAY_ISLAND_ENTRANCE @ 26.56 + map_group FARAWAY_ISLAND_INTERIOR @ 26.57 + map_group BIRTH_ISLAND_EXTERIOR @ 26.58 + map_group BIRTH_ISLAND_HARBOR @ 26.59 + map_group TRAINER_HILL_ENTRANCE @ 26.60 + map_group TRAINER_HILL_1F @ 26.61 + map_group TRAINER_HILL_2F @ 26.62 + map_group TRAINER_HILL_3F @ 26.63 + map_group TRAINER_HILL_4F @ 26.64 + map_group TRAINER_HILL_ROOF @ 26.65 + map_group NAVEL_ROCK_EXTERIOR @ 26.66 + map_group NAVEL_ROCK_HARBOR @ 26.67 + map_group NAVEL_ROCK_ENTRANCE @ 26.68 + map_group NAVEL_ROCK_B1F @ 26.69 + map_group NAVEL_ROCK_FORK @ 26.70 + map_group NAVEL_ROCK_UP_1 @ 26.71 + map_group NAVEL_ROCK_UP_2 @ 26.72 + map_group NAVEL_ROCK_UP_3 @ 26.73 + map_group NAVEL_ROCK_UP_4 @ 26.74 + map_group NAVEL_ROCK_TOP @ 26.75 + map_group NAVEL_ROCK_DOWN_01 @ 26.76 + map_group NAVEL_ROCK_DOWN_02 @ 26.77 + map_group NAVEL_ROCK_DOWN_03 @ 26.78 + map_group NAVEL_ROCK_DOWN_04 @ 26.79 + map_group NAVEL_ROCK_DOWN_05 @ 26.80 + map_group NAVEL_ROCK_DOWN_06 @ 26.81 + map_group NAVEL_ROCK_DOWN_07 @ 26.82 + map_group NAVEL_ROCK_DOWN_08 @ 26.83 + map_group NAVEL_ROCK_DOWN_09 @ 26.84 + map_group NAVEL_ROCK_DOWN_10 @ 26.85 + map_group NAVEL_ROCK_DOWN_11 @ 26.86 + map_group NAVEL_ROCK_BOTTOM @ 26.87 + map_group TRAINER_HILL_ELEVATOR @ 26.88 new_map_group - map_group ROUTE_104_PROTOTYPE ; 27.0 - map_group ROUTE_104_PROTOTYPE_PRETTY_PETAL_FLOWER_SHOP ; 27.1 + map_group ROUTE_104_PROTOTYPE @ 27.0 + map_group ROUTE_104_PROTOTYPE_PRETTY_PETAL_FLOWER_SHOP @ 27.1 new_map_group - map_group ROUTE_109_SEASHORE_HOUSE ; 28.0 + map_group ROUTE_109_SEASHORE_HOUSE @ 28.0 new_map_group - map_group ROUTE_110_TRICK_HOUSE_ENTRANCE ; 29.0 - map_group ROUTE_110_TRICK_HOUSE_END ; 29.1 - map_group ROUTE_110_TRICK_HOUSE_CORRIDOR ; 29.2 - map_group ROUTE_110_TRICK_HOUSE_PUZZLE_1 ; 29.3 - map_group ROUTE_110_TRICK_HOUSE_PUZZLE_2 ; 29.4 - map_group ROUTE_110_TRICK_HOUSE_PUZZLE_3 ; 29.5 - map_group ROUTE_110_TRICK_HOUSE_PUZZLE_4 ; 29.6 - map_group ROUTE_110_TRICK_HOUSE_PUZZLE_5 ; 29.7 - map_group ROUTE_110_TRICK_HOUSE_PUZZLE_6 ; 29.8 - map_group ROUTE_110_TRICK_HOUSE_PUZZLE_7 ; 29.9 - map_group ROUTE_110_TRICK_HOUSE_PUZZLE_8 ; 29.10 - map_group ROUTE_110_SEASIDE_CYCLING_ROAD_ENTRANCE_1 ; 29.11 - map_group ROUTE_110_SEASIDE_CYCLING_ROAD_ENTRANCE_2 ; 29.12 + map_group ROUTE_110_TRICK_HOUSE_ENTRANCE @ 29.0 + map_group ROUTE_110_TRICK_HOUSE_END @ 29.1 + map_group ROUTE_110_TRICK_HOUSE_CORRIDOR @ 29.2 + map_group ROUTE_110_TRICK_HOUSE_PUZZLE_1 @ 29.3 + map_group ROUTE_110_TRICK_HOUSE_PUZZLE_2 @ 29.4 + map_group ROUTE_110_TRICK_HOUSE_PUZZLE_3 @ 29.5 + map_group ROUTE_110_TRICK_HOUSE_PUZZLE_4 @ 29.6 + map_group ROUTE_110_TRICK_HOUSE_PUZZLE_5 @ 29.7 + map_group ROUTE_110_TRICK_HOUSE_PUZZLE_6 @ 29.8 + map_group ROUTE_110_TRICK_HOUSE_PUZZLE_7 @ 29.9 + map_group ROUTE_110_TRICK_HOUSE_PUZZLE_8 @ 29.10 + map_group ROUTE_110_SEASIDE_CYCLING_ROAD_ENTRANCE_1 @ 29.11 + map_group ROUTE_110_SEASIDE_CYCLING_ROAD_ENTRANCE_2 @ 29.12 new_map_group - map_group ROUTE_113_GLASS_WORKSHOP ; 30.0 + map_group ROUTE_113_GLASS_WORKSHOP @ 30.0 new_map_group - map_group ROUTE_123_BERRY_MASTERS_HOUSE ; 31.0 + map_group ROUTE_123_BERRY_MASTERS_HOUSE @ 31.0 new_map_group - map_group ROUTE_119_WEATHER_INSTITUTE_1F ; 32.0 - map_group ROUTE_119_WEATHER_INSTITUTE_2F ; 32.1 - map_group ROUTE_119_HOUSE ; 32.2 + map_group ROUTE_119_WEATHER_INSTITUTE_1F @ 32.0 + map_group ROUTE_119_WEATHER_INSTITUTE_2F @ 32.1 + map_group ROUTE_119_HOUSE @ 32.2 new_map_group - map_group ROUTE_124_DIVING_TREASURE_HUNTERS_HOUSE ; 33.0 + map_group ROUTE_124_DIVING_TREASURE_HUNTERS_HOUSE @ 33.0 diff --git a/constants/pokemon_data_constants.s b/constants/pokemon_data_constants.s index 565eae71eb..cf5d4df41b 100644 --- a/constants/pokemon_data_constants.s +++ b/constants/pokemon_data_constants.s @@ -61,18 +61,18 @@ .set F_SUMMARY_SCREEN_FLIP_SPRITE, 0x80 - .set EVO_FRIENDSHIP, 0x0001 ; Pokémon levels up with friendship ≥ 220 - .set EVO_FRIENDSHIP_DAY, 0x0002 ; Pokémon levels up during the day with friendship ≥ 220 - .set EVO_FRIENDSHIP_NIGHT, 0x0003 ; Pokémon levels up at night with friendship ≥ 220 - .set EVO_LEVEL, 0x0004 ; Pokémon reaches the specified level - .set EVO_TRADE, 0x0005 ; Pokémon is traded - .set EVO_TRADE_ITEM, 0x0006 ; Pokémon is traded while it's holding the specified item - .set EVO_ITEM, 0x0007 ; specified item is used on Pokémon - .set EVO_LEVEL_ATK_GT_DEF, 0x0008 ; Pokémon reaches the specified level with attack > defense - .set EVO_LEVEL_ATK_EQ_DEF, 0x0009 ; Pokémon reaches the specified level with attack = defense - .set EVO_LEVEL_ATK_LT_DEF, 0x000a ; Pokémon reaches the specified level with attack < defense - .set EVO_LEVEL_SILCOON, 0x000b ; Pokémon reaches the specified level with a Silcoon personality value - .set EVO_LEVEL_CASCOON, 0x000c ; Pokémon reaches the specified level with a Cascoon personality value - .set EVO_LEVEL_NINJASK, 0x000d ; Pokémon reaches the specified level (special value for Ninjask) - .set EVO_LEVEL_SHEDINJA, 0x000e ; Pokémon reaches the specified level (special value for Shedinja) - .set EVO_BEAUTY, 0x000f ; Pokémon levels up with beauty ≥ specified value + .set EVO_FRIENDSHIP, 0x0001 @ Pokémon levels up with friendship ≥ 220 + .set EVO_FRIENDSHIP_DAY, 0x0002 @ Pokémon levels up during the day with friendship ≥ 220 + .set EVO_FRIENDSHIP_NIGHT, 0x0003 @ Pokémon levels up at night with friendship ≥ 220 + .set EVO_LEVEL, 0x0004 @ Pokémon reaches the specified level + .set EVO_TRADE, 0x0005 @ Pokémon is traded + .set EVO_TRADE_ITEM, 0x0006 @ Pokémon is traded while it's holding the specified item + .set EVO_ITEM, 0x0007 @ specified item is used on Pokémon + .set EVO_LEVEL_ATK_GT_DEF, 0x0008 @ Pokémon reaches the specified level with attack > defense + .set EVO_LEVEL_ATK_EQ_DEF, 0x0009 @ Pokémon reaches the specified level with attack = defense + .set EVO_LEVEL_ATK_LT_DEF, 0x000a @ Pokémon reaches the specified level with attack < defense + .set EVO_LEVEL_SILCOON, 0x000b @ Pokémon reaches the specified level with a Silcoon personality value + .set EVO_LEVEL_CASCOON, 0x000c @ Pokémon reaches the specified level with a Cascoon personality value + .set EVO_LEVEL_NINJASK, 0x000d @ Pokémon reaches the specified level (special value for Ninjask) + .set EVO_LEVEL_SHEDINJA, 0x000e @ Pokémon reaches the specified level (special value for Shedinja) + .set EVO_BEAUTY, 0x000f @ Pokémon levels up with beauty ≥ specified value diff --git a/constants/trainer_constants.s b/constants/trainer_constants.s index 9e356ff9f9..f761b721ca 100644 --- a/constants/trainer_constants.s +++ b/constants/trainer_constants.s @@ -1098,25 +1098,25 @@ .set TRAINER_CLASS_NAME_PYRAMID_KING, 0x40 .set TRAINER_CLASS_NAME_PKMN_TRAINER_4, 0x41 - .set TRAINER_ENCOUNTER_MUSIC_MALE, 0 ; standard male encounter music - .set TRAINER_ENCOUNTER_MUSIC_FEMALE, 1 ; standard female encounter music - .set TRAINER_ENCOUNTER_MUSIC_GIRL, 2 ; used for male Tubers and Young Couples too + .set TRAINER_ENCOUNTER_MUSIC_MALE, 0 @ standard male encounter music + .set TRAINER_ENCOUNTER_MUSIC_FEMALE, 1 @ standard female encounter music + .set TRAINER_ENCOUNTER_MUSIC_GIRL, 2 @ used for male Tubers and Young Couples too .set TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, 3 .set TRAINER_ENCOUNTER_MUSIC_INTENSE, 4 .set TRAINER_ENCOUNTER_MUSIC_COOL, 5 .set TRAINER_ENCOUNTER_MUSIC_AQUA, 6 .set TRAINER_ENCOUNTER_MUSIC_MAGMA, 7 .set TRAINER_ENCOUNTER_MUSIC_SWIMMER, 8 - .set TRAINER_ENCOUNTER_MUSIC_TWINS, 9 ; used for other trainer classes too + .set TRAINER_ENCOUNTER_MUSIC_TWINS, 9 @ used for other trainer classes too .set TRAINER_ENCOUNTER_MUSIC_ELITE_FOUR, 10 - .set TRAINER_ENCOUNTER_MUSIC_HIKER, 11 ; used for other trainer classes too + .set TRAINER_ENCOUNTER_MUSIC_HIKER, 11 @ used for other trainer classes too .set TRAINER_ENCOUNTER_MUSIC_INTERVIEWER, 12 - .set TRAINER_ENCOUNTER_MUSIC_RICH, 13 ; Rich Boys and Gentlemen + .set TRAINER_ENCOUNTER_MUSIC_RICH, 13 @ Rich Boys and Gentlemen .set F_TRAINER_FEMALE, 1 << 7 -; All trainer parties specify the IV, level, and species for each Pokémon in the -; party. Some trainer parties also specify held items and custom moves for each -; Pokémon. +@ All trainer parties specify the IV, level, and species for each Pokémon in the +@ party. Some trainer parties also specify held items and custom moves for each +@ Pokémon. .set F_TRAINER_PARTY_CUSTOM_MOVESET, 1 << 0 .set F_TRAINER_PARTY_HELD_ITEM, 1 << 1 diff --git a/data/data1.s b/data/data1.s index 5d3aa509c8..ac22193464 100644 --- a/data/data1.s +++ b/data/data1.s @@ -1,5 +1,10 @@ @ the first big chunk of data + .include "asm/macros.s" + .include "constants/constants.s" + + .section script_data, "aw", %progbits + @ 81DB67C .include "data/event_script_command_function_table.s" diff --git a/data/data2.s b/data/data2.s index 927828366a..3812c7d775 100644 --- a/data/data2.s +++ b/data/data2.s @@ -1,6 +1,9 @@ @ the second big chunk of data - .align 2, 0 + .include "asm/macros.s" + .include "constants/constants.s" + + .section .rodata gUnknown_82E9530: @ 82E9530 .byte 3 diff --git a/ewram_syms.txt b/ewram_syms.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/fix_local_labels.pl b/fix_local_labels.pl deleted file mode 100644 index d3258c7662..0000000000 --- a/fix_local_labels.pl +++ /dev/null @@ -1,28 +0,0 @@ -use strict; -use warnings; - -open(IN_FILE, $ARGV[0]); -open(OUT_FILE, ">", $ARGV[1]); - -my @labels = (); - -while () { - if ($_ =~ /^\.(.+):/) { - push(@labels, $1); - } -} - -seek IN_FILE, 0, 0; - -while () { - for (my $i = 0; $i < scalar(@labels); $i++) { - my $find = quotemeta '.' . $labels[$i]; - my $replace = '$' . $labels[$i]; - $_ =~ s/$find/$replace/; - } - - print OUT_FILE $_; -} - -close(IN_FILE); -close(OUT_FILE); diff --git a/wram_syms.txt b/iwram_syms.txt similarity index 100% rename from wram_syms.txt rename to iwram_syms.txt diff --git a/ld_script.txt b/ld_script.txt index 48982d49d4..8be7d561ba 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -1,6 +1,92 @@ ENTRY(Start) +gNumMusicPlayers = 4; +gMaxLines = 60; + SECTIONS { + . = 0x2020000; + + ewram (NOLOAD) : + ALIGN(4) + { + } + + . = 0x3000000; + + iwram (NOLOAD) : + ALIGN(4) + { + } + . = 0x8000000; - .text : { *(.text); } + + .text : + ALIGN(4) + { + asm/crt0.o(.text); + asm/main.o(.text); + src/malloc.o(.text); + asm/dma3_manager.o(.text); + src/gpu_regs.o(.text); + asm/gpu_bg.o(.text); + asm/pixel_buffer.o(.text); + asm/window.o(.text); + asm/text_renderer.o(.text); + asm/gpu_obj.o(.text); + asm/string_util.o(.text); + asm/rom_80093CC.o(.text); + asm/rtc.o(.text); + asm/main_menu.o(.text); + asm/rom_8032654.o(.text); + asm/tileset_animation.o(.text); + asm/rom_80A18F4.o(.text); + asm/task.o(.text); + asm/rom_80A92F4.o(.text); + asm/multiboot.o(.text); + asm/rom_81BAD84.o(.text); + } =0 + + script_data : + ALIGN(4) + { + data/data1.o(script_data); + } =0 + + lib_text : + ALIGN(4) + { + asm/libgcnmultiboot.o(.text); + asm/libmks4agb.o(.text); + asm/libagbbackup.o(.text); + asm/librtc.o(.text); + asm/librfu.o(.text); + asm/libagbsyscall.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:_fixunsdfsi.o(.text); + tools/agbcc/lib/libgcc.a:_fixunssfsi.o(.text); + tools/agbcc/lib/libgcc.a:_modsi3.o(.text); + tools/agbcc/lib/libgcc.a:_muldi3.o(.text); + tools/agbcc/lib/libgcc.a:_udivdi3.o(.text); + tools/agbcc/lib/libgcc.a:_udivsi3.o(.text); + tools/agbcc/lib/libgcc.a:_umodsi3.o(.text); + tools/agbcc/lib/libgcc.a:dp-bit.o(.text); + tools/agbcc/lib/libgcc.a:fp-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/data2.o(.rodata); + } =0 + + /* Discard everything not specifically mentioned above. */ + /DISCARD/ : + { + *(*); + } }